From 7a48b7935552280ca4ac6dd27f8de93b82ab10b1 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 24 Aug 2004 12:58:12 +0200 Subject: [PATCH 0001/1063] Enabled mysqltest for MASTER_PORT replacement. Replaced fixed port numbers by MASTER_PORT replacement. This allows for a set of ports per tree and hence parallel testing on multiple trees. client/mysqltest.c: Enabled mysqltest for MASTER_PORT replacement. mysql-test/r/rpl000014.result: Replaced fixed port numbers by MASTER_PORT. mysql-test/r/rpl000015.result: Replaced fixed port numbers by MASTER_PORT. mysql-test/r/rpl_rotate_logs.result: Replaced fixed port numbers by MASTER_PORT. mysql-test/t/rpl000001.test: Replaced fixed port numbers by MASTER_PORT replacement. Just in case it might get un-commented. mysql-test/t/rpl000014.test: Replaced fixed port numbers by MASTER_PORT replacement. mysql-test/t/rpl000015.test: Replaced fixed port numbers by MASTER_PORT replacement. mysql-test/t/rpl_rotate_logs.test: Replaced fixed port numbers by MASTER_PORT replacement. BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted --- BitKeeper/etc/logging_ok | 1 + client/mysqltest.c | 46 +++++++++++++++++++++-------- mysql-test/r/rpl000014.result | 8 ++--- mysql-test/r/rpl000015.result | 6 ++-- mysql-test/r/rpl_rotate_logs.result | 6 ++-- mysql-test/t/rpl000001.test | 2 +- mysql-test/t/rpl000014.test | 8 ++--- mysql-test/t/rpl000015.test | 6 ++-- mysql-test/t/rpl_rotate_logs.test | 6 ++-- 9 files changed, 55 insertions(+), 34 deletions(-) diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok index e0a0f4304fb..d025a25f5c5 100644 --- a/BitKeeper/etc/logging_ok +++ b/BitKeeper/etc/logging_ok @@ -11,6 +11,7 @@ greg@mysql.com guilhem@mysql.com heikki@donna.mysql.fi heikki@hundin.mysql.fi +ingo@mysql.com jani@hynda.mysql.fi jorge@linux.jorge.mysql.com konstantin@mysql.com diff --git a/client/mysqltest.c b/client/mysqltest.c index 18fafff275e..afd78ac6fb4 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -220,7 +220,8 @@ int dyn_string_cmp(DYNAMIC_STRING* ds, const char* fname); void reject_dump(const char* record_file, char* buf, int size); int close_connection(struct st_query* q); -VAR* var_get(const char* var_name, const char** var_name_end, int raw); +VAR* var_get(const char* var_name, const char** var_name_end, int raw, + my_bool ignore_not_existing); int eval_expr(VAR* v, const char* p, const char** p_end); /* Definitions for replace */ @@ -277,7 +278,7 @@ static void do_eval(DYNAMIC_STRING* query_eval, const char* query) } else { - if(!(v = var_get(p, &p, 0))) + if(!(v = var_get(p, &p, 0, 0))) die("Bad variable in eval"); dynstr_append_mem(query_eval, v->str_val, v->str_val_len); } @@ -486,7 +487,8 @@ static int check_result(DYNAMIC_STRING* ds, const char* fname, return error; } -VAR* var_get(const char* var_name, const char** var_name_end, int raw) +VAR* var_get(const char* var_name, const char** var_name_end, int raw, + my_bool ignore_not_existing) { int digit; VAR* v; @@ -507,7 +509,11 @@ VAR* var_get(const char* var_name, const char** var_name_end, int raw) ++var_name; } if(var_name == save_var_name) + { + if (ignore_not_existing) + return 0; die("Empty variable"); + } if(!(v = (VAR*)hash_search(&var_hash, save_var_name, var_name - save_var_name))) @@ -629,7 +635,7 @@ int eval_expr(VAR* v, const char* p, const char** p_end) VAR* vp; if (*p == '$') { - if ((vp = var_get(p,p_end,0))) + if ((vp = var_get(p,p_end,0, 0))) { memcpy(v, vp, sizeof(*v)); return 0; @@ -671,7 +677,7 @@ int do_inc(struct st_query* q) { char* p=q->first_argument; VAR* v; - v = var_get(p, 0, 1); + v = var_get(p, 0, 1, 0); v->int_val++; v->int_dirty = 1; return 0; @@ -681,7 +687,7 @@ int do_dec(struct st_query* q) { char* p=q->first_argument; VAR* v; - v = var_get(p, 0, 1); + v = var_get(p, 0, 1, 0); v->int_val--; v->int_dirty = 1; return 0; @@ -909,14 +915,16 @@ static void get_ints(uint *to,struct st_query* q) /* Get a string; Return ptr to end of string Strings may be surrounded by " or ' + + If string is a '$variable', return the value of the variable. */ -static void get_string(char **to_ptr, char **from_ptr, - struct st_query* q) +static char *get_string(char **to_ptr, char **from_ptr, + struct st_query* q) { reg1 char c,sep; - char *to= *to_ptr, *from= *from_ptr; + char *to= *to_ptr, *from= *from_ptr, *start=to; DBUG_ENTER("get_string"); /* Find separator */ @@ -969,6 +977,19 @@ static void get_string(char **to_ptr, char **from_ptr, *to++ =0; /* End of string marker */ *to_ptr= to; *from_ptr= from; + + /* Check if this was a variable */ + if (*start == '$') + { + const char *end= --to; + VAR *var=var_get(start, &end, 0, 1); + if (var && to == (char*) end+1) + { + DBUG_PRINT("info",("get_string: '%s' -> '%s'", start, var->str_val)); + DBUG_RETURN(var->str_val); /* return found variable value */ + } + } + DBUG_RETURN(start); } @@ -994,13 +1015,12 @@ static void get_replace(struct st_query *q) start=buff=my_malloc(strlen(from)+1,MYF(MY_WME | MY_FAE)); while (*from) { - char *to=buff; - get_string(&buff, &from, q); + char *to; + to= get_string(&buff, &from, q); if (!*from) die("Wrong number of arguments to replace in %s\n", q->query); insert_pointer_name(&from_array,to); - to=buff; - get_string(&buff, &from, q); + to= get_string(&buff, &from, q); insert_pointer_name(&to_array,to); } for (i=1,pos=word_end_chars ; i < 256 ; i++) diff --git a/mysql-test/r/rpl000014.result b/mysql-test/r/rpl000014.result index a47c3c91c1d..2a2a9bafa11 100644 --- a/mysql-test/r/rpl000014.result +++ b/mysql-test/r/rpl000014.result @@ -1,13 +1,13 @@ File Position Binlog_do_db Binlog_ignore_db master-bin.001 73 Master_Host Master_User Master_Port Connect_retry Log_File Pos Slave_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter -127.0.0.1 root 9999 1 master-bin.001 73 Yes 0 0 +127.0.0.1 root MASTER_PORT 1 master-bin.001 73 Yes 0 0 Master_Host Master_User Master_Port Connect_retry Log_File Pos Slave_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter -127.0.0.1 root 9999 1 master-bin.001 73 No 0 0 +127.0.0.1 root MASTER_PORT 1 master-bin.001 73 No 0 0 Master_Host Master_User Master_Port Connect_retry Log_File Pos Slave_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter -127.0.0.1 root 9999 1 master-bin.001 73 Yes 0 0 +127.0.0.1 root MASTER_PORT 1 master-bin.001 73 Yes 0 0 Master_Host Master_User Master_Port Connect_retry Log_File Pos Slave_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter -127.0.0.1 root 9999 1 master-bin.001 173 Yes 0 0 +127.0.0.1 root MASTER_PORT 1 master-bin.001 173 Yes 0 0 File Position Binlog_do_db Binlog_ignore_db master-bin.001 73 n diff --git a/mysql-test/r/rpl000015.result b/mysql-test/r/rpl000015.result index 58487af27f8..79856748f58 100644 --- a/mysql-test/r/rpl000015.result +++ b/mysql-test/r/rpl000015.result @@ -3,11 +3,11 @@ master-bin.001 73 Master_Host Master_User Master_Port Connect_retry Log_File Pos Slave_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter 0 0 0 No 0 0 Master_Host Master_User Master_Port Connect_retry Log_File Pos Slave_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter -127.0.0.1 test 9998 60 4 No 0 0 +127.0.0.1 test MASTER_PORT 60 4 No 0 0 Master_Host Master_User Master_Port Connect_retry Log_File Pos Slave_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter -127.0.0.1 root 9999 60 4 No 0 0 +127.0.0.1 root MASTER_PORT 60 4 No 0 0 Master_Host Master_User Master_Port Connect_retry Log_File Pos Slave_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter -127.0.0.1 root 9999 60 master-bin.001 73 Yes 0 0 +127.0.0.1 root MASTER_PORT 60 master-bin.001 73 Yes 0 0 n 10 45 diff --git a/mysql-test/r/rpl_rotate_logs.result b/mysql-test/r/rpl_rotate_logs.result index cf432d07b08..a711811d768 100644 --- a/mysql-test/r/rpl_rotate_logs.result +++ b/mysql-test/r/rpl_rotate_logs.result @@ -1,5 +1,5 @@ Master_Host Master_User Master_Port Connect_retry Log_File Pos Slave_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter -127.0.0.1 root 9999 60 master-bin.001 387 Yes 0 0 +127.0.0.1 root MASTER_PORT 60 master-bin.001 387 Yes 0 0 s Could not break slave Tried hard @@ -12,7 +12,7 @@ testing temporary tables Log_name master-bin.003 Master_Host Master_User Master_Port Connect_retry Log_File Pos Slave_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter -127.0.0.1 root 9999 60 master-bin.003 329 Yes 0 0 +127.0.0.1 root MASTER_PORT 60 master-bin.003 329 Yes 0 0 m 34 65 @@ -29,6 +29,6 @@ master-bin.006 490 a testing temporary tables part 2 Master_Host Master_User Master_Port Connect_retry Log_File Pos Slave_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter -127.0.0.1 root 9999 60 master-bin.006 490 Yes 0 0 +127.0.0.1 root MASTER_PORT 60 master-bin.006 490 Yes 0 0 count(*) 100 diff --git a/mysql-test/t/rpl000001.test b/mysql-test/t/rpl000001.test index 6a827368fa4..e69ed9987d1 100644 --- a/mysql-test/t/rpl000001.test +++ b/mysql-test/t/rpl000001.test @@ -61,7 +61,7 @@ sleep 2; # The following test can't be done because the result of Pos will differ # on different computers -# --replace_result 9306 9999 3334 9999 3335 9999 +# --replace_result $MASTER_MYPORT MASTER_PORT # show slave status; set sql_slave_skip_counter=1; diff --git a/mysql-test/t/rpl000014.test b/mysql-test/t/rpl000014.test index b501d63b10e..e98471657ac 100644 --- a/mysql-test/t/rpl000014.test +++ b/mysql-test/t/rpl000014.test @@ -4,18 +4,18 @@ show master status; save_master_pos; connection slave; sync_with_master; ---replace_result 9306 9999 3334 9999 3335 9999 +--replace_result $MASTER_MYPORT MASTER_PORT show slave status; change master to master_log_pos=73; slave stop; change master to master_log_pos=73; ---replace_result 9306 9999 3334 9999 3335 9999 +--replace_result $MASTER_MYPORT MASTER_PORT show slave status; slave start; ---replace_result 9306 9999 3334 9999 3335 9999 +--replace_result $MASTER_MYPORT MASTER_PORT show slave status; change master to master_log_pos=173; ---replace_result 9306 9999 3334 9999 3335 9999 +--replace_result $MASTER_MYPORT MASTER_PORT show slave status; connection master; show master status; diff --git a/mysql-test/t/rpl000015.test b/mysql-test/t/rpl000015.test index 73a10bed7b3..d3c30c19cc1 100644 --- a/mysql-test/t/rpl000015.test +++ b/mysql-test/t/rpl000015.test @@ -8,15 +8,15 @@ connection slave; reset slave; show slave status; change master to master_host='127.0.0.1'; ---replace_result 3306 9998 9306 9999 3334 9999 3335 9999 +--replace_result $MASTER_MYPORT MASTER_PORT 3306 MASTER_PORT show slave status; eval change master to master_host='127.0.0.1',master_user='root', master_password='',master_port=$MASTER_MYPORT; ---replace_result 9306 9999 3334 9999 3335 9999 +--replace_result $MASTER_MYPORT MASTER_PORT show slave status; slave start; sync_with_master; ---replace_result 9306 9999 3334 9999 3335 9999 +--replace_result $MASTER_MYPORT MASTER_PORT show slave status; connection master; drop table if exists t1; diff --git a/mysql-test/t/rpl_rotate_logs.test b/mysql-test/t/rpl_rotate_logs.test index ab88def5b2d..92baba5f737 100644 --- a/mysql-test/t/rpl_rotate_logs.test +++ b/mysql-test/t/rpl_rotate_logs.test @@ -40,7 +40,7 @@ insert into t1 values('Could not break slave'),('Tried hard'); save_master_pos; connection slave; sync_with_master; ---replace_result 9306 9999 3334 9999 3335 9999 +--replace_result $MASTER_MYPORT MASTER_PORT show slave status; select * from t1; connection master; @@ -96,7 +96,7 @@ insert into t2 values (65); save_master_pos; connection slave; sync_with_master; ---replace_result 9306 9999 3334 9999 3335 9999 +--replace_result $MASTER_MYPORT MASTER_PORT show slave status; select * from t2; @@ -126,7 +126,7 @@ connection slave; sync_with_master; select * from t4; ---replace_result 9306 9999 3334 9999 3335 9999 +--replace_result $MASTER_MYPORT MASTER_PORT show slave status; # because of concurrent insert, the table may not be up to date # if we do not lock From 2466cbc4793fd56e531d128225227ba05e019757 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 30 Aug 2004 15:26:27 +0300 Subject: [PATCH 0002/1063] Fix for Bug#3759 The cause of the bug is that Item_func_in::fix_fields did not fully update its used_table_cache. This was the cause for not_null_tables in setup_conds() to be still 0 after the call not_null_tables= (*conds)->not_null_tables(); As a result the condition in setup_conds() if ( ... (table->table->map & not_null_tables) ...) failed, which was the cause for the ON expression not to be added to conds, and later the optimizer couldn't detect that it could apply the OUTER JOIN ==> JOIN optimization. sql/item_cmpfunc.h: Fix for Bug#3759 BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted --- BitKeeper/etc/logging_ok | 1 + sql/item_cmpfunc.h | 3 +++ 2 files changed, 4 insertions(+) diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok index 698f7655b6e..ce1b4d16eb9 100644 --- a/BitKeeper/etc/logging_ok +++ b/BitKeeper/etc/logging_ok @@ -136,6 +136,7 @@ tim@sand.box tim@threads.polyesthetic.msg tim@white.box tim@work.mysql.com +timour@mysql.com tom@basil-firewall.home.com tonu@hundin.mysql.fi tonu@volk.internalnet diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h index 236ebb8d28b..a4f8118f21d 100644 --- a/sql/item_cmpfunc.h +++ b/sql/item_cmpfunc.h @@ -431,6 +431,9 @@ class Item_func_in :public Item_int_func { bool res= (item->fix_fields(thd,tlist) || Item_func::fix_fields(thd,tlist)); with_sum_func= with_sum_func || item->with_sum_func; + used_tables_cache|= item->used_tables(); + not_null_tables_cache|= item->not_null_tables(); + const_item_cache&= item->const_item(); return res; } void fix_length_and_dec(); From 65a94e3470018a66d4b148c40fd7e5b91db229ed Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 30 Aug 2004 18:14:29 +0300 Subject: [PATCH 0003/1063] added test for BUG#3759 --- mysql-test/r/select.result | 21 +++++++++++++++++++++ mysql-test/t/select.test | 14 ++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result index 206fa507615..99041701cb8 100644 --- a/mysql-test/r/select.result +++ b/mysql-test/r/select.result @@ -2327,3 +2327,24 @@ select * from t2,t3 where t2.s = t3.s; s s two two drop table t1, t2, t3; +create table t1 (a integer, b integer, index(a), index(b)); +create table t2 (c integer, d integer, index(c), index(d)); +insert into t1 values (1,2), (2,2), (3,2), (4,2); +insert into t2 values (1,3), (2,3), (3,4), (4,4); +explain select * from t1 left join t2 on a=c where d in (4); +table type possible_keys key key_len ref rows Extra +t2 ref c,d d 5 const 2 Using where +t1 ALL a NULL NULL NULL 3 Using where +select * from t1 left join t2 on a=c where d in (4); +a b c d +3 2 3 4 +4 2 4 4 +explain select * from t1 left join t2 on a=c where d = 4; +table type possible_keys key key_len ref rows Extra +t2 ref c,d d 5 const 2 Using where +t1 ALL a NULL NULL NULL 3 Using where +select * from t1 left join t2 on a=c where d = 4; +a b c d +3 2 3 4 +4 2 4 4 +drop table t1, t2; diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test index 7cb157f194e..11b3ae6aed1 100644 --- a/mysql-test/t/select.test +++ b/mysql-test/t/select.test @@ -1874,3 +1874,17 @@ select * from t3 where s = 'one'; select * from t1,t2 where t1.s = t2.s; select * from t2,t3 where t2.s = t3.s; drop table t1, t2, t3; + +# +# Bug #3759 +# Both queries should produce identical plans and results. +# +create table t1 (a integer, b integer, index(a), index(b)); +create table t2 (c integer, d integer, index(c), index(d)); +insert into t1 values (1,2), (2,2), (3,2), (4,2); +insert into t2 values (1,3), (2,3), (3,4), (4,4); +explain select * from t1 left join t2 on a=c where d in (4); +select * from t1 left join t2 on a=c where d in (4); +explain select * from t1 left join t2 on a=c where d = 4; +select * from t1 left join t2 on a=c where d = 4; +drop table t1, t2; \ No newline at end of file From f6834a5de08024c795a0506bbe906d4e6756c131 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 2 Sep 2004 16:20:30 +0500 Subject: [PATCH 0004/1063] A fix (bug #5056: defaults-extra-file throws no error when file is inaccessible). --- mysys/default.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/mysys/default.c b/mysys/default.c index 81290322223..e8195893ad8 100644 --- a/mysys/default.c +++ b/mysys/default.c @@ -164,8 +164,11 @@ int load_defaults(const char *conf_file, const char **groups, if (forced_default_file) { if ((error= search_default_file(&args, &alloc, "", - forced_default_file, "", &group)) < 0) + forced_default_file, "", &group))) + { + fprintf(stderr, "Error reading '%s' file.\n", forced_default_file); goto err; + } } else if (dirname_length(conf_file)) { @@ -199,8 +202,11 @@ int load_defaults(const char *conf_file, const char **groups, else if (defaults_extra_file) { if (search_default_file(&args, &alloc, NullS, defaults_extra_file, - default_ext, &group) < 0) + default_ext, &group)) + { + fprintf(stderr, "Error reading '%s' file.\n", defaults_extra_file); goto err; /* Fatal error */ + } } } } From 99e1b8179eb88ad64e8cae7a6acd7822b94dda1f Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 8 Sep 2004 02:07:53 +0400 Subject: [PATCH 0005/1063] Fix for bug#5138: hash indexes on heap tables support statistics. KEY::rec_per_key is updated every time 1/HEAP_STATS_UPDATE_THRESHOLD part of table records has been changed. heap/_check.c: Hash indexes on heap tables now support statistics - number of hash buckets. The value is updated on any insert/delete operation. heap/hp_clear.c: Hash indexes on heap tables now support statistics - number of hash buckets. The value is updated on any insert/delete operation. heap/hp_create.c: Hash indexes on heap tables now support statistics - number of hash buckets. The value is updated on any insert/delete operation. heap/hp_delete.c: Hash indexes on heap tables now support statistics - number of hash buckets. The value is updated on any insert/delete operation. heap/hp_hash.c: Hash indexes on heap tables now support statistics - number of hash buckets. The value is updated on any insert/delete operation. heap/hp_write.c: Hash indexes on heap tables now support statistics - number of hash buckets. The value is updated on any insert/delete operation. include/heap.h: Hash indexes on heap tables now support statistics - number of hash buckets. The value is updated on any insert/delete operation. mysql-test/r/heap.result: Fix for bug#5138: store/use statistics for hash indexes on heap tables mysql-test/r/heap_hash.result: Fix for bug#5138: store/use statistics for hash indexes on heap tables mysql-test/r/myisam.result: Fix for bug#5138: store/use statistics for hash indexes on heap tables mysql-test/t/heap_hash.test: Fix for bug#5138: store/use statistics for hash indexes on heap tables sql/structs.h: Added comments --- heap/_check.c | 23 ++++-- heap/hp_clear.c | 1 + heap/hp_create.c | 1 + heap/hp_delete.c | 8 +- heap/hp_hash.c | 20 ++++- heap/hp_write.c | 25 +++++- include/heap.h | 7 +- mysql-test/r/heap.result | 8 +- mysql-test/r/heap_hash.result | 144 +++++++++++++++++++++++++++++++++- mysql-test/r/myisam.result | 2 +- mysql-test/t/heap_hash.test | 104 +++++++++++++++++++++++- sql/ha_heap.cc | 56 ++++++++++++- sql/ha_heap.h | 10 ++- sql/structs.h | 7 +- 14 files changed, 386 insertions(+), 30 deletions(-) diff --git a/heap/_check.c b/heap/_check.c index 233cb8cb0c5..a745aee48bf 100644 --- a/heap/_check.c +++ b/heap/_check.c @@ -102,9 +102,11 @@ static int check_one_key(HP_KEYDEF *keydef, uint keynr, ulong records, int error; uint i,found,max_links,seek,links; uint rec_link; /* Only used with debugging */ + uint hash_buckets_found; HASH_INFO *hash_info; error=0; + hash_buckets_found= 0; for (i=found=max_links=seek=0 ; i < records ; i++) { hash_info=hp_find_hash(&keydef->block,i); @@ -128,21 +130,32 @@ static int check_one_key(HP_KEYDEF *keydef, uint keynr, ulong records, found++; } if (links > max_links) max_links=links; + hash_buckets_found++; } } if (found != records) { - DBUG_PRINT("error",("Found %ld of %ld records")); + DBUG_PRINT("error",("Found %ld of %ld records", found, records)); + error=1; + } + if (keydef->hash_buckets != hash_buckets_found) + { + DBUG_PRINT("error",("Found %ld buckets, stats shows %ld buckets", + hash_buckets_found, keydef->hash_buckets)); error=1; } DBUG_PRINT("info", - ("records: %ld seeks: %d max links: %d hitrate: %.2f", + ("records: %ld seeks: %d max links: %d hitrate: %.2f " + "buckets: %d", records,seek,max_links, - (float) seek / (float) (records ? records : 1))); + (float) seek / (float) (records ? records : 1), + hash_buckets_found)); if (print_status) - printf("Key: %d records: %ld seeks: %d max links: %d hitrate: %.2f\n", + printf("Key: %d records: %ld seeks: %d max links: %d " + "hitrate: %.2f buckets: %d\n", keynr, records, seek, max_links, - (float) seek / (float) (records ? records : 1)); + (float) seek / (float) (records ? records : 1), + hash_buckets_found); return error; } diff --git a/heap/hp_clear.c b/heap/hp_clear.c index 4440344f990..596d71ebe9c 100644 --- a/heap/hp_clear.c +++ b/heap/hp_clear.c @@ -97,6 +97,7 @@ void hp_clear_keys(HP_SHARE *info) VOID(hp_free_level(block,block->levels,block->root,(byte*) 0)); block->levels=0; block->last_allocated=0; + keyinfo->hash_buckets= 0; } } info->index_length=0; diff --git a/heap/hp_create.c b/heap/hp_create.c index 02725576c8f..d1783118c0d 100644 --- a/heap/hp_create.c +++ b/heap/hp_create.c @@ -128,6 +128,7 @@ int heap_create(const char *name, uint keys, HP_KEYDEF *keydef, max_records); keyinfo->delete_key= hp_delete_key; keyinfo->write_key= hp_write_key; + keyinfo->hash_buckets= 0; } } share->min_records= min_records; diff --git a/heap/hp_delete.c b/heap/hp_delete.c index c918cf37f05..a89fe49f495 100644 --- a/heap/hp_delete.c +++ b/heap/hp_delete.c @@ -151,6 +151,8 @@ int hp_delete_key(HP_INFO *info, register HP_KEYDEF *keyinfo, pos->ptr_to_rec=empty->ptr_to_rec; pos->next_key=empty->next_key; } + else + keyinfo->hash_buckets--; if (empty == lastpos) /* deleted last hash key */ DBUG_RETURN (0); @@ -187,7 +189,11 @@ int hp_delete_key(HP_INFO *info, register HP_KEYDEF *keyinfo, } pos3= pos; /* Link pos->next after lastpos */ } - else pos3= 0; /* Different positions merge */ + else + { + pos3= 0; /* Different positions merge */ + keyinfo->hash_buckets--; + } empty[0]=lastpos[0]; hp_movelink(pos3, empty, pos->next_key); diff --git a/heap/hp_hash.c b/heap/hp_hash.c index 71eecc8bdf2..2108765cc7f 100644 --- a/heap/hp_hash.c +++ b/heap/hp_hash.c @@ -196,7 +196,18 @@ byte *hp_search_next(HP_INFO *info, HP_KEYDEF *keyinfo, const byte *key, } - /* Calculate pos according to keys */ +/* + Calculate position number for hash value. + SYNOPSIS + hp_mask() + hashnr Hash value + buffmax Value such that + 2^(n-1) < maxlength <= 2^n = buffmax + maxlength + + RETURN + Array index, in [0..maxlength) +*/ ulong hp_mask(ulong hashnr, ulong buffmax, ulong maxlength) { @@ -205,7 +216,12 @@ ulong hp_mask(ulong hashnr, ulong buffmax, ulong maxlength) } - /* Change link from pos to new_link */ +/* + Change + next_link -> ... -> X -> pos + to + next_link -> ... -> X -> newlink +*/ void hp_movelink(HASH_INFO *pos, HASH_INFO *next_link, HASH_INFO *newlink) { diff --git a/heap/hp_write.c b/heap/hp_write.c index 3b0ec76d616..853360976bf 100644 --- a/heap/hp_write.c +++ b/heap/hp_write.c @@ -36,7 +36,7 @@ int heap_write(HP_INFO *info, const byte *record) byte *pos; HP_SHARE *share=info->s; DBUG_ENTER("heap_write"); - + printf("heap_write\n"); #ifndef DBUG_OFF if (info->mode & O_RDONLY) { @@ -180,15 +180,31 @@ int hp_write_key(HP_INFO *info, HP_KEYDEF *keyinfo, DBUG_RETURN(-1); /* No more memory */ halfbuff= (long) share->blength >> 1; pos= hp_find_hash(&keyinfo->block,(first_index=share->records-halfbuff)); - + + /* + We're about to add one more hash position, with hash_mask=#records. + Entries that should be relocated to that position are currently members + of the list that starts at #first_index position. + At #first_index position there may be either: + a) A list of items with hash_mask=first_index. The list contains + 1) entries that should be relocated to the list that starts at new + position we're adding + 2) entries that should be left in the list starting at #first_index + position + or + b) An entry with hashnr != first_index. We don't need to move it. + */ if (pos != empty) /* If some records */ { do { hashnr = hp_rec_hashnr(keyinfo, pos->ptr_to_rec); if (flag == 0) /* First loop; Check if ok */ + { + /* Bail out if we're dealing with case b) from above comment */ if (hp_mask(hashnr, share->blength, share->records) != first_index) break; + } if (!(hashnr & halfbuff)) { /* Key will not move */ if (!(flag & LOWFIND)) @@ -245,6 +261,9 @@ int hp_write_key(HP_INFO *info, HP_KEYDEF *keyinfo, } } while ((pos=pos->next_key)); + + if ((flag & (LOWFIND | HIGHFIND)) == (LOWFIND | HIGHFIND)) + keyinfo->hash_buckets++; if ((flag & (LOWFIND | LOWUSED)) == LOWFIND) { @@ -265,6 +284,7 @@ int hp_write_key(HP_INFO *info, HP_KEYDEF *keyinfo, { pos->ptr_to_rec=recpos; pos->next_key=0; + keyinfo->hash_buckets++; } else { @@ -280,6 +300,7 @@ int hp_write_key(HP_INFO *info, HP_KEYDEF *keyinfo, } else { + keyinfo->hash_buckets++; pos->ptr_to_rec=recpos; pos->next_key=0; hp_movelink(pos, gpos, empty); diff --git a/include/heap.h b/include/heap.h index 63f2abbabc7..e3e7f228421 100644 --- a/include/heap.h +++ b/include/heap.h @@ -87,6 +87,11 @@ typedef struct st_hp_keydef /* Key definition with open */ uint8 algorithm; /* HASH / BTREE */ HA_KEYSEG *seg; HP_BLOCK block; /* Where keys are saved */ + /* + Number of buckets used in hash table. Used only to provide + #records estimates for heap key scans. + */ + ha_rows hash_buckets; TREE rb_tree; int (*write_key)(struct st_heap_info *info, struct st_hp_keydef *keyinfo, const byte *record, byte *recpos); @@ -102,7 +107,7 @@ typedef struct st_heap_share ulong min_records,max_records; /* Params to open */ ulong data_length,index_length; uint records; /* records */ - uint blength; + uint blength; /* records rounded up to 2^n */ uint deleted; /* Deleted records in database */ uint reclength; /* Length of one record */ uint changed; diff --git a/mysql-test/r/heap.result b/mysql-test/r/heap.result index c49c9abb368..f4ee11fe1a3 100644 --- a/mysql-test/r/heap.result +++ b/mysql-test/r/heap.result @@ -4,7 +4,7 @@ insert into t1 values(1,1),(2,2),(3,3),(4,4); delete from t1 where a=1 or a=0; show keys from t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment -t1 0 PRIMARY 1 a NULL NULL NULL NULL HASH +t1 0 PRIMARY 1 a NULL 3 NULL NULL HASH select * from t1; a b 2 2 @@ -169,7 +169,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL btn NULL NULL NULL 11 Using where explain select * from t1 where btn="a" and new_col="a"; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref btn btn 11 const,const 10 Using where +1 SIMPLE t1 ref btn btn 11 const,const 2 Using where drop table t1; CREATE TABLE t1 ( a int default NULL, @@ -182,7 +182,7 @@ SELECT * FROM t1 WHERE a=NULL; a b explain SELECT * FROM t1 WHERE a IS NULL; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref a a 5 const 10 Using where +1 SIMPLE t1 ref a a 5 const 1 Using where SELECT * FROM t1 WHERE a<=>NULL; a b NULL 99 @@ -204,7 +204,7 @@ key a (a) INSERT INTO t1 VALUES (10), (10), (10); EXPLAIN SELECT * FROM t1 WHERE a=10; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref a a 5 const 10 Using where +1 SIMPLE t1 ref a a 5 const 3 Using where SELECT * FROM t1 WHERE a=10; a 10 diff --git a/mysql-test/r/heap_hash.result b/mysql-test/r/heap_hash.result index 7affbf788fb..29287b23745 100644 --- a/mysql-test/r/heap_hash.result +++ b/mysql-test/r/heap_hash.result @@ -1,10 +1,10 @@ -drop table if exists t1; +drop table if exists t1,t2; create table t1 (a int not null,b int not null, primary key using HASH (a)) engine=heap comment="testing heaps" avg_row_length=100 min_rows=1 max_rows=100; insert into t1 values(1,1),(2,2),(3,3),(4,4); delete from t1 where a=1 or a=0; show keys from t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment -t1 0 PRIMARY 1 a NULL NULL NULL NULL HASH +t1 0 PRIMARY 1 a NULL 3 NULL NULL HASH select * from t1; a b 2 2 @@ -169,7 +169,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL btn NULL NULL NULL 11 Using where explain select * from t1 where btn="a" and new_col="a"; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref btn btn 11 const,const 10 Using where +1 SIMPLE t1 ref btn btn 11 const,const 2 Using where drop table t1; CREATE TABLE t1 ( a int default NULL, @@ -182,7 +182,7 @@ SELECT * FROM t1 WHERE a=NULL; a b explain SELECT * FROM t1 WHERE a IS NULL; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref a a 5 const 10 Using where +1 SIMPLE t1 ref a a 5 const 1 Using where SELECT * FROM t1 WHERE a<=>NULL; a b NULL 99 @@ -203,3 +203,139 @@ DELETE from t1 where a < 100; SELECT * from t1; a DROP TABLE t1; +create table t1 +( +a char(8) not null, +b char(20) not null, +c int not null, +key (a) +) engine=heap; +insert into t1 values ('aaaa', 'prefill-hash=5',0); +insert into t1 values ('aaab', 'prefill-hash=0',0); +insert into t1 values ('aaac', 'prefill-hash=7',0); +insert into t1 values ('aaad', 'prefill-hash=2',0); +insert into t1 values ('aaae', 'prefill-hash=1',0); +insert into t1 values ('aaaf', 'prefill-hash=4',0); +insert into t1 values ('aaag', 'prefill-hash=3',0); +insert into t1 values ('aaah', 'prefill-hash=6',0); +explain select * from t1 where a='aaaa'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref a a 8 const 1 Using where +explain select * from t1 where a='aaab'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref a a 8 const 1 Using where +explain select * from t1 where a='aaac'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref a a 8 const 1 Using where +explain select * from t1 where a='aaad'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref a a 8 const 1 Using where +insert into t1 select * from t1; +explain select * from t1 where a='aaaa'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref a a 8 const 2 Using where +explain select * from t1 where a='aaab'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref a a 8 const 2 Using where +explain select * from t1 where a='aaac'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref a a 8 const 2 Using where +explain select * from t1 where a='aaad'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref a a 8 const 2 Using where +create table t2 as select * from t1; +delete from t1; +insert into t1 select * from t2; +explain select * from t1 where a='aaaa'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref a a 8 const 2 Using where +explain select * from t1 where a='aaab'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref a a 8 const 2 Using where +explain select * from t1 where a='aaac'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref a a 8 const 2 Using where +explain select * from t1 where a='aaad'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref a a 8 const 2 Using where +drop table t1, t2; +create table t1 ( +id int unsigned not null primary key auto_increment, +name varchar(20) not null, +index heap_idx(name), +index btree_idx using btree(name) +) engine=heap; +create table t2 ( +id int unsigned not null primary key auto_increment, +name varchar(20) not null, +index btree_idx using btree(name), +index heap_idx(name) +) engine=heap; +insert into t1 (name) values ('Matt'), ('Lilu'), ('Corbin'), ('Carly'), +('Suzy'), ('Hoppy'), ('Burrito'), ('Mimi'), ('Sherry'), ('Ben'), ('Phil'), +('Emily'), ('Mike'); +insert into t2 select * from t1; +explain select * from t1 where name='matt'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref heap_idx,btree_idx heap_idx 20 const 1 Using where +explain select * from t2 where name='matt'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ref btree_idx,heap_idx btree_idx 20 const 1 Using where +explain select * from t1 where name='Lilu'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref heap_idx,btree_idx heap_idx 20 const 1 Using where +explain select * from t2 where name='Lilu'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ref btree_idx,heap_idx btree_idx 20 const 1 Using where +explain select * from t1 where name='Phil'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref heap_idx,btree_idx heap_idx 20 const 1 Using where +explain select * from t2 where name='Phil'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ref btree_idx,heap_idx btree_idx 20 const 1 Using where +explain select * from t1 where name='Lilu'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref heap_idx,btree_idx heap_idx 20 const 1 Using where +explain select * from t2 where name='Lilu'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ref btree_idx,heap_idx btree_idx 20 const 1 Using where +insert into t1 (name) select name from t2; +insert into t1 (name) select name from t2; +insert into t1 (name) select name from t2; +insert into t1 (name) select name from t2; +insert into t1 (name) select name from t2; +insert into t1 (name) select name from t2; +select count(*) from t1 where name='Matt'; +count(*) +7 +explain select * from t1 ignore index (btree_idx) where name='matt'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref heap_idx heap_idx 20 const 7 Using where +show index from t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment +t1 0 PRIMARY 1 id NULL 91 NULL NULL HASH +t1 1 heap_idx 1 name NULL 15 NULL NULL HASH +t1 1 btree_idx 1 name A NULL NULL NULL BTREE +flush tables; +show index from t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment +t1 0 PRIMARY 1 id NULL 91 NULL NULL HASH +t1 1 heap_idx 1 name NULL 13 NULL NULL HASH +t1 1 btree_idx 1 name A NULL NULL NULL BTREE +create table t3 +( +a varchar(20) not null, +b varchar(20) not null, +key (a,b) +) engine=heap; +insert into t3 select name, name from t1; +show index from t3; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment +t3 1 a 1 a NULL NULL NULL NULL HASH +t3 1 a 2 b NULL 15 NULL NULL HASH +flush tables; +show index from t3; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment +t3 1 a 1 a NULL NULL NULL NULL HASH +t3 1 a 2 b NULL 13 NULL NULL HASH +drop table t1,t2; diff --git a/mysql-test/r/myisam.result b/mysql-test/r/myisam.result index 26dcce43d08..31b14f9b822 100644 --- a/mysql-test/r/myisam.result +++ b/mysql-test/r/myisam.result @@ -543,7 +543,7 @@ Warnings: Note 1031 Table storage engine for 't1' doesn't have this option show keys from t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment -t1 1 a 1 a NULL NULL NULL NULL YES HASH +t1 1 a 1 a NULL 1000 NULL NULL YES HASH drop table t1,t2; create table t1 ( a tinytext, b char(1), index idx (a(1),b) ); insert into t1 values (null,''), (null,''); diff --git a/mysql-test/t/heap_hash.test b/mysql-test/t/heap_hash.test index 412b6f2e705..df233633840 100644 --- a/mysql-test/t/heap_hash.test +++ b/mysql-test/t/heap_hash.test @@ -3,7 +3,7 @@ # --disable_warnings -drop table if exists t1; +drop table if exists t1,t2; --enable_warnings create table t1 (a int not null,b int not null, primary key using HASH (a)) engine=heap comment="testing heaps" avg_row_length=100 min_rows=1 max_rows=100; @@ -141,3 +141,105 @@ INSERT into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11); DELETE from t1 where a < 100; SELECT * from t1; DROP TABLE t1; + + +# +# Hash index # records estimate test +# +create table t1 +( + a char(8) not null, + b char(20) not null, + c int not null, + key (a) +) engine=heap; + +insert into t1 values ('aaaa', 'prefill-hash=5',0); +insert into t1 values ('aaab', 'prefill-hash=0',0); +insert into t1 values ('aaac', 'prefill-hash=7',0); +insert into t1 values ('aaad', 'prefill-hash=2',0); +insert into t1 values ('aaae', 'prefill-hash=1',0); +insert into t1 values ('aaaf', 'prefill-hash=4',0); +insert into t1 values ('aaag', 'prefill-hash=3',0); +insert into t1 values ('aaah', 'prefill-hash=6',0); + +explain select * from t1 where a='aaaa'; +explain select * from t1 where a='aaab'; +explain select * from t1 where a='aaac'; +explain select * from t1 where a='aaad'; +insert into t1 select * from t1; +explain select * from t1 where a='aaaa'; +explain select * from t1 where a='aaab'; +explain select * from t1 where a='aaac'; +explain select * from t1 where a='aaad'; + +# Check if delete_all_rows() updates #hash_buckets +create table t2 as select * from t1; +delete from t1; +insert into t1 select * from t2; +explain select * from t1 where a='aaaa'; +explain select * from t1 where a='aaab'; +explain select * from t1 where a='aaac'; +explain select * from t1 where a='aaad'; +drop table t1, t2; + + +# Btree and hash index use costs. +create table t1 ( + id int unsigned not null primary key auto_increment, + name varchar(20) not null, + index heap_idx(name), + index btree_idx using btree(name) +) engine=heap; + +create table t2 ( + id int unsigned not null primary key auto_increment, + name varchar(20) not null, + index btree_idx using btree(name), + index heap_idx(name) +) engine=heap; + +insert into t1 (name) values ('Matt'), ('Lilu'), ('Corbin'), ('Carly'), + ('Suzy'), ('Hoppy'), ('Burrito'), ('Mimi'), ('Sherry'), ('Ben'), ('Phil'), + ('Emily'), ('Mike'); +insert into t2 select * from t1; + +explain select * from t1 where name='matt'; +explain select * from t2 where name='matt'; + +explain select * from t1 where name='Lilu'; +explain select * from t2 where name='Lilu'; + +explain select * from t1 where name='Phil'; +explain select * from t2 where name='Phil'; + +explain select * from t1 where name='Lilu'; +explain select * from t2 where name='Lilu'; + +insert into t1 (name) select name from t2; +insert into t1 (name) select name from t2; +insert into t1 (name) select name from t2; +insert into t1 (name) select name from t2; +insert into t1 (name) select name from t2; +insert into t1 (name) select name from t2; + +select count(*) from t1 where name='Matt'; +explain select * from t1 ignore index (btree_idx) where name='matt'; +show index from t1; + +flush tables; +show index from t1; + +create table t3 +( + a varchar(20) not null, + b varchar(20) not null, + key (a,b) +) engine=heap; +insert into t3 select name, name from t1; +show index from t3; +flush tables; +show index from t3; + +drop table t1,t2; + diff --git a/sql/ha_heap.cc b/sql/ha_heap.cc index d7327362286..7643037e24f 100644 --- a/sql/ha_heap.cc +++ b/sql/ha_heap.cc @@ -30,6 +30,12 @@ const char **ha_heap::bas_ext() const { static const char *ext[1]= { NullS }; return ext; } +/* + Hash index statistics is updated (copied from HP_KEYDEF::hash_buckets to + rec_per_key) after 1/HEAP_STATS_UPDATE_THRESHOLD records have been inserted/ + updated/deleted. delete_all_rows() and table flush cause immediate update. +*/ +#define HEAP_STATS_UPDATE_THRESHOLD 10 int ha_heap::open(const char *name, int mode, uint test_if_locked) { @@ -48,6 +54,8 @@ int ha_heap::open(const char *name, int mode, uint test_if_locked) { /* Initialize variables for the opened table */ set_keys_for_scanning(); + if (table->tmp_table == NO_TMP_TABLE) + update_key_stats(); } return (file ? 0 : 1); } @@ -84,28 +92,59 @@ void ha_heap::set_keys_for_scanning(void) } } +void ha_heap::update_key_stats() +{ + printf("update_key_stats\n"); + for (uint i= 0; i < table->keys; i++) + { + KEY *key=table->key_info+i; + if (key->algorithm != HA_KEY_ALG_BTREE) + { + ha_rows hash_buckets= file->s->keydef[i].hash_buckets; + key->rec_per_key[key->key_parts-1]= + hash_buckets ? file->s->records/hash_buckets : 0; + } + } + records_changed= 0; +} + int ha_heap::write_row(byte * buf) { + int res; statistic_increment(ha_write_count,&LOCK_status); if (table->timestamp_default_now) update_timestamp(buf+table->timestamp_default_now-1); if (table->next_number_field && buf == table->record[0]) update_auto_increment(); - return heap_write(file,buf); + res= heap_write(file,buf); + if (!res && table->tmp_table == NO_TMP_TABLE && + ++records_changed*HEAP_STATS_UPDATE_THRESHOLD > file->s->records) + update_key_stats(); + return res; } int ha_heap::update_row(const byte * old_data, byte * new_data) { + int res; statistic_increment(ha_update_count,&LOCK_status); if (table->timestamp_on_update_now) update_timestamp(new_data+table->timestamp_on_update_now-1); - return heap_update(file,old_data,new_data); + res= heap_update(file,old_data,new_data); + if (!res && table->tmp_table == NO_TMP_TABLE && + ++records_changed*HEAP_STATS_UPDATE_THRESHOLD > file->s->records) + update_key_stats(); + return res; } int ha_heap::delete_row(const byte * buf) { + int res; statistic_increment(ha_delete_count,&LOCK_status); - return heap_delete(file,buf); + res= heap_delete(file,buf); + if (!res && table->tmp_table == NO_TMP_TABLE && + ++records_changed*HEAP_STATS_UPDATE_THRESHOLD > file->s->records) + update_key_stats(); + return res; } int ha_heap::index_read(byte * buf, const byte * key, uint key_len, @@ -227,6 +266,8 @@ int ha_heap::extra(enum ha_extra_function operation) int ha_heap::delete_all_rows() { heap_clear(file); + if (table->tmp_table == NO_TMP_TABLE) + update_key_stats(); return 0; } @@ -383,7 +424,14 @@ ha_rows ha_heap::records_in_range(uint inx, key_range *min_key, min_key->flag != HA_READ_KEY_EXACT || max_key->flag != HA_READ_AFTER_KEY) return HA_POS_ERROR; // Can only use exact keys - return 10; // Good guess + else + { + ha_rows records= file->s->records; + if (!records) + return 0; + ha_rows res= records / file->s->keydef[inx].hash_buckets; + return res ? res : 1; + } } diff --git a/sql/ha_heap.h b/sql/ha_heap.h index 9ca6b9b76b6..f36e9f31c55 100644 --- a/sql/ha_heap.h +++ b/sql/ha_heap.h @@ -27,9 +27,10 @@ class ha_heap: public handler { HP_INFO *file; key_map btree_keys; - - public: - ha_heap(TABLE *table): handler(table), file(0) {} + /* number of records changed since last statistics update */ + uint records_changed; +public: + ha_heap(TABLE *table): handler(table), file(0), records_changed(0) {} ~ha_heap() {} const char *table_type() const { return "HEAP"; } const char *index_type(uint inx) @@ -91,5 +92,6 @@ class ha_heap: public handler THR_LOCK_DATA **store_lock(THD *thd, THR_LOCK_DATA **to, enum thr_lock_type lock_type); - +private: + void update_key_stats(); }; diff --git a/sql/structs.h b/sql/structs.h index c30d85f59cb..846b3400fab 100644 --- a/sql/structs.h +++ b/sql/structs.h @@ -89,7 +89,12 @@ typedef struct st_key { enum ha_key_alg algorithm; KEY_PART_INFO *key_part; char *name; /* Name of key */ - ulong *rec_per_key; /* Key part distribution */ + /* + Array of AVG(#records with the same field value) for 1st ... Nth key part. + 0 means 'not known'. + For temporary heap tables this member is NULL. + */ + ulong *rec_per_key; union { int bdb_return_if_eq; } handler; From 7d94788c1ad489f57f339066396259941e05d577 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 16 Sep 2004 00:47:45 +0600 Subject: [PATCH 0006/1063] WL#964 porting mysql_test_run on Linux and Windows client/mysqltest.c: added windows code mysql-test/Makefile.am: added code of creating make file mysql-test/r/fulltext.result: added FORMAT() for compatible with Windows version mysql-test/r/fulltext_cache.result: added FORMAT() mysql-test/r/fulltext_multi.result: added FORMAT() mysql-test/r/fulltext_order_by.result: added FORMAT() mysql-test/r/type_float.result: added --replace-result mysql-test/t/fulltext.test: added FORMAT() mysql-test/t/fulltext_cache.test: added FORMAT() mysql-test/t/fulltext_multi.test: added FORMAT() mysql-test/t/fulltext_order_by.test: added FORMAT() mysql-test/t/innodb.test: added --replace-result mysql-test/t/insert.test: added --replace_result mysql-test/t/type_float.test: added --replace-result mysql-test/t/variables.test: added --replace_result --- client/mysqltest.c | 36 +- mysql-test/Makefile.am | 5 + mysql-test/my_manage.c | 860 ++++++++++++ mysql-test/my_manage.h | 135 ++ mysql-test/mysql_test_run.c | 1728 +++++++++++++++++++++++++ mysql-test/r/fulltext.result | 6 +- mysql-test/r/fulltext_cache.result | 36 +- mysql-test/r/fulltext_multi.result | 30 +- mysql-test/r/fulltext_order_by.result | 54 +- mysql-test/r/type_float.result | 4 +- mysql-test/t/fulltext.test | 2 +- mysql-test/t/fulltext_cache.test | 4 +- mysql-test/t/fulltext_multi.test | 6 +- mysql-test/t/fulltext_order_by.test | 12 +- mysql-test/t/innodb.test | 1 + mysql-test/t/insert.test | 11 + mysql-test/t/type_float.test | 3 + mysql-test/t/variables.test | 1 + 18 files changed, 2842 insertions(+), 92 deletions(-) create mode 100644 mysql-test/my_manage.c create mode 100644 mysql-test/my_manage.h create mode 100644 mysql-test/mysql_test_run.c diff --git a/client/mysqltest.c b/client/mysqltest.c index f638053b515..a42b4698b3c 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -180,9 +180,9 @@ typedef struct int alloced; } VAR; -#ifdef __NETWARE__ +#if defined(__NETWARE__) || defined(__WIN__) /* - Netware doesn't proved environment variable substitution that is done + Netware and Windows don't proved environment variable substitution that is done by the shell in unix environments. We do this in the following function: */ @@ -479,7 +479,7 @@ static void free_used_memory() free_defaults(default_argv); mysql_server_end(); my_end(MY_CHECK_ERROR); - DBUG_VOID_RETURN; +// DBUG_VOID_RETURN; } static void die(const char* fmt, ...) @@ -885,8 +885,8 @@ int do_exec(struct st_query* q) char buf[1024]; FILE *res_file; char *cmd= q->first_argument; + DBUG_ENTER("do_exec"); - while (*cmd && my_isspace(charset_info, *cmd)) cmd++; if (!*cmd) @@ -935,8 +935,11 @@ int do_exec(struct st_query* q) if (ds == &ds_tmp) dynstr_free(&ds_tmp); } +#ifndef __WIN__ pclose(res_file); - +#else + _pclose(res_file); +#endif DBUG_RETURN(error); } @@ -1517,8 +1520,8 @@ void init_manager() die("Failed in mysql_manager_init()"); if (!mysql_manager_connect(manager,manager_host,manager_user, manager_pass,manager_port)) - die("Could not connect to MySQL manager: %s(%d)",manager->last_error, - manager->last_errno); + die("Could not connect to MySQL manager: %s(%d) %d",manager->last_error, + manager->last_errno, manager_port); } #endif @@ -1575,7 +1578,7 @@ int do_connect(struct st_query* q) if (*con_port_str == '$') { if (!(var_port = var_get(con_port_str, 0, 0, 0))) - die("Unknown variable '%s'", con_port_str+1); + die("Unknown variable '%s'", con_port_str+1); con_port = var_port->int_val; } else @@ -1584,9 +1587,9 @@ int do_connect(struct st_query* q) if (*con_sock == '$') { if (!(var_sock = var_get(con_sock, 0, 0, 0))) - die("Unknown variable '%s'", con_sock+1); + die("Unknown variable '%s'", con_sock+1); if (!(con_sock = (char*)my_malloc(var_sock->str_val_len+1, MYF(0)))) - die("Out of memory"); + die("Out of memory"); free_con_sock = 1; memcpy(con_sock, var_sock->str_val, var_sock->str_val_len); con_sock[var_sock->str_val_len] = 0; @@ -1617,8 +1620,8 @@ int do_connect(struct st_query* q) if ((safe_connect(&next_con->mysql, con_host, con_user, con_pass, con_db, con_port, con_sock ? con_sock: 0))) - die("Could not open connection '%s': %s", con_name, - mysql_error(&next_con->mysql)); + die("Could not open connection '%s': %s %d", con_name, + mysql_error(&next_con->mysql),con_port); if (!(next_con->name = my_strdup(con_name, MYF(MY_WME)))) die(NullS); @@ -3686,8 +3689,7 @@ static void get_replace_column(struct st_query *q) my_free(start, MYF(0)); } -#ifdef __NETWARE__ - +#if defined(__NETWARE__) || defined(__WIN__) /* Substitute environment variables with text. @@ -3778,9 +3780,13 @@ FILE *my_popen(const char *cmd, const char *mode __attribute__((unused))) FILE *res_file; subst_cmd= subst_env_var(cmd); +#ifndef __WIN__ res_file= popen(subst_cmd, "r0"); +#else + res_file= _popen(subst_cmd, "r0"); +#endif my_free(subst_cmd, MYF(0)); return res_file; } -#endif /* __NETWARE__ */ +#endif /* __NETWARE__ or __WIN__*/ diff --git a/mysql-test/Makefile.am b/mysql-test/Makefile.am index 6ec8c293a9c..1f57dedc4c5 100644 --- a/mysql-test/Makefile.am +++ b/mysql-test/Makefile.am @@ -29,6 +29,11 @@ test_SCRIPTS = mysql-test-run install_test_db test_DATA = std_data/client-key.pem std_data/client-cert.pem std_data/cacert.pem CLEANFILES = $(test_SCRIPTS) $(test_DATA) +INCLUDES = -I$(srcdir)/../include -I../include -I.. +bin_PROGRAMS = mysql_test_run +mysql_test_run_SOURCES= mysql_test_run.c my_manage.c + + dist-hook: mkdir -p $(distdir)/t $(distdir)/r $(distdir)/include \ $(distdir)/std_data diff --git a/mysql-test/my_manage.c b/mysql-test/my_manage.c new file mode 100644 index 00000000000..e23d4f2227e --- /dev/null +++ b/mysql-test/my_manage.c @@ -0,0 +1,860 @@ +/* + Copyright (c) 2003 Novell, Inc. All Rights Reserved. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include +#include +#ifndef __WIN__ +#include +#endif +#include +#ifdef __NETWARE__ +#include +#include +#else +#include +#ifndef __WIN__ +#include +#include +#else +#include +#include +#include +#endif +#endif +#include +#include +#include +#include + +#include "my_manage.h" + +#ifndef __NETWARE__ +#define ASSERT assert +extern char **environ; +#endif + + + +/****************************************************************************** + + macros + +******************************************************************************/ + +/****************************************************************************** + + global variables + +******************************************************************************/ + +/****************************************************************************** + + functions + +******************************************************************************/ + +/****************************************************************************** + + init_args() + + Init an argument list. + +******************************************************************************/ +void init_args(arg_list_t *al) +{ + ASSERT(al != NULL); + + al->argc = 0; + al->size = ARG_BUF; + al->argv = malloc(al->size * sizeof(char *)); + ASSERT(al->argv != NULL); + + return; +} + +/****************************************************************************** + + add_arg() + + Add an argument to a list. + +******************************************************************************/ +void add_arg(arg_list_t *al, const char *format, ...) +{ + va_list ap; + char temp[PATH_MAX]; + + ASSERT(al != NULL); + + // increase size + if (al->argc >= (int)al->size) + { + al->size += ARG_BUF; + al->argv = realloc(al->argv, al->size * sizeof(char *)); + ASSERT(al->argv != NULL); + } + + if (format) + { + va_start(ap, format); + vsprintf(temp, format, ap); + va_end(ap); + + al->argv[al->argc] = malloc(strlen(temp)+1); + ASSERT(al->argv[al->argc] != NULL); + strcpy(al->argv[al->argc], temp); + + ++(al->argc); + } + else + { + al->argv[al->argc] = NULL; + } + + return; +} + +/****************************************************************************** + + free_args() + + Free an argument list. + +******************************************************************************/ +void free_args(arg_list_t *al) +{ + int i; + + ASSERT(al != NULL); + + for(i = 0; i < al->argc; i++) + { + ASSERT(al->argv[i] != NULL); + free(al->argv[i]); + al->argv[i] = NULL; + } + + free(al->argv); + al->argc = 0; + al->argv = NULL; + + return; +} + +/****************************************************************************** + + sleep_until_file_deleted() + + Sleep until the given file is no longer found. + +******************************************************************************/ +#ifndef __WIN__ +int sleep_until_file_deleted(char *pid_file) +#else +int sleep_until_file_deleted(HANDLE pid_file) +#endif +{ + int err; +#ifndef __WIN__ + struct stat buf; + int i; + + for(i = 0; (i < TRY_MAX) && (err = !stat(pid_file, &buf)); i++) sleep(1); + + if (err != 0) err = errno; +#else + err= (WaitForSingleObject(pid_file, TRY_MAX*1000) == WAIT_TIMEOUT); +#endif + return err; +} + +/****************************************************************************** + + sleep_until_file_exists() + + Sleep until the given file exists. + +******************************************************************************/ +#ifndef __WIN__ +int sleep_until_file_exists(char *pid_file) +#else +int sleep_until_file_exists(HANDLE pid_file) +#endif +{ + int err; +#ifndef __WIN__ + struct stat buf; + int i; + + for(i = 0; (i < TRY_MAX) && (err = stat(pid_file, &buf)); i++) sleep(1); + + if (err != 0) err = errno; +#else + err= (WaitForSingleObject(pid_file, TRY_MAX*1000) == WAIT_TIMEOUT); +#endif + return err; +} + +/****************************************************************************** + + wait_for_server_start() + + Wait for the server on the given port to start. + +******************************************************************************/ +int wait_for_server_start(char *bin_dir, char *mysqladmin_file, char *user, char *password, int port,char *tmp_dir) +{ + arg_list_t al; + int err, i; + char trash[PATH_MAX]; + + // mysqladmin file + snprintf(trash, PATH_MAX, "%s/trash.out",tmp_dir); + + // args + init_args(&al); + add_arg(&al, "%s", mysqladmin_file); + add_arg(&al, "--no-defaults"); + add_arg(&al, "--port=%u", port); + add_arg(&al, "--user=%s", user); + add_arg(&al, "--password=%s", password); + add_arg(&al, "--silent"); + +//#ifdef NOT_USED +#ifndef __NETWARE__ + add_arg(&al, "-O"); + add_arg(&al, "connect_timeout=10"); + add_arg(&al, "-w"); +#endif + + add_arg(&al, "--host=localhost"); +#ifndef __NETWARE__ + add_arg(&al, "--protocol=tcp"); +#endif + add_arg(&al, "ping"); + + // NetWare does not support the connect timeout in the TCP/IP stack + // -- we will try the ping multiple times +#ifndef __WIN__ + for(i = 0; (i < TRY_MAX) + && (err = spawn(mysqladmin_file, &al, TRUE, NULL, + trash, NULL, NULL)); i++) sleep(1); +#else + err = spawn(mysqladmin_file, &al, TRUE, NULL,trash, NULL, NULL); +#endif + + // free args + free_args(&al); + + return err; +} + +/****************************************************************************** + + spawn() + + Spawn the given path with the given arguments. + +******************************************************************************/ +#ifdef __NETWARE__ +int spawn(char *path, arg_list_t *al, int join, char *input, + char *output, char *error, char *pid_file) +{ + pid_t pid; + int result = 0; + wiring_t wiring = { FD_UNUSED, FD_UNUSED, FD_UNUSED }; + unsigned long flags = PROC_CURRENT_SPACE | PROC_INHERIT_CWD; + + // open wiring + if (input) + wiring.infd = open(input, O_RDONLY); + + if (output) + wiring.outfd = open(output, O_WRONLY | O_CREAT | O_TRUNC); + + if (error) + wiring.errfd = open(error, O_WRONLY | O_CREAT | O_TRUNC); + + // procve requires a NULL + add_arg(al, NULL); + + // go + pid = procve(path, flags, NULL, &wiring, NULL, NULL, 0, + NULL, (const char **)al->argv); + + // close wiring + if (wiring.infd != -1) + close(wiring.infd); + + if (wiring.outfd != -1) + close(wiring.outfd); + + if (wiring.errfd != -1) + close(wiring.errfd); + + return result; +} +#elif __WIN__ + +int spawn(char *path, arg_list_t *al, int join, char *input, + char *output, char *error, HANDLE *pid) +{ + intptr_t result; + int i; + STARTUPINFO startup_info; + PROCESS_INFORMATION process_information; + DWORD exit_code; + char win_args[1024]= ""; + char command_line[1024]= ""; + + /* + Skip the first parameter + */ + for(i = 1; i < al->argc; i++) + { + ASSERT(al->argv[i] != NULL); + strcat(win_args,al->argv[i]); + strcat(win_args," "); + } + + memset(&startup_info,0,sizeof(STARTUPINFO)); + startup_info.cb = sizeof(STARTUPINFO); + + if (input) + freopen(input, "rb", stdin); + + if (output) + freopen(output, "wb", stdout); + + if (error) + freopen(error, "wb", stderr); + + result= CreateProcess( + path, + (LPSTR)&win_args, + NULL, + NULL, + TRUE, + 0, + NULL, + NULL, + &startup_info, + &process_information + ); + + if (result && process_information.hProcess) + { + if (join) + { + if (WaitForSingleObject(process_information.hProcess, mysqld_timeout) == WAIT_TIMEOUT) + { + exit_code= -1; + } + else + { + GetExitCodeProcess(process_information.hProcess, &exit_code); + } + CloseHandle(process_information.hProcess); + } + else + { + exit_code= 0; + } + if (pid != NULL) + *pid= process_information.hProcess; + } + else + { + exit_code= -1; + } + if (input) + freopen("CONIN$","rb",stdin); + if (output) + freopen("CONOUT$","wb",stdout); + if (error) + freopen("CONOUT$","wb",stderr); + + return exit_code; +} +#else +int spawn(char *path, arg_list_t *al, int join, char *input, + char *output, char *error, char *pid_file) +{ + pid_t pid; + int res_exec = 0; + int result = 0; + + pid = fork(); + + if (pid == -1) + { + fprintf(stderr, "fork was't created\n"); + /* + We can't create the fork...exit with error + */ + return EXIT_FAILURE; + } + + if (pid > 0) + { + /* + The parent process is waiting for child process if join is not zero + */ + if (join) + { + waitpid(pid, &result, 0); + if (WIFEXITED(result) != 0) + { + result = WEXITSTATUS(result); + } + else + { + result = EXIT_FAILURE; + } + } + } + else + { + + /* + Child process + */ + + add_arg(al, NULL); + + + /* + Reassign streams + */ + if (input) + freopen(input, "r", stdin); + + + if (output) + freopen(output, "w", stdout); + + + if (error) + freopen(error, "w", stderr); + + /* Spawn the process */ + if ((res_exec = execve(path, al->argv, environ)) < 0) + { + exit(EXIT_FAILURE); + } + + /* + Restore streams + */ + if (input) + freopen("/dev/tty", "r", stdin); + + if (output) + freopen("/dev/tty", "w", stdout); + + if (error) + freopen("/dev/tty", "w", stderr); + + exit(0); + } + + return result; +} +#endif +/****************************************************************************** + + stop_server() + + Stop the server with the given port and pid file. + +******************************************************************************/ +#ifndef __WIN__ +int stop_server(char *bin_dir, char *mysqladmin_file, char *user, char *password, int port, + char *pid_file,char *tmp_dir) +#else +int stop_server(char *bin_dir, char *mysqladmin_file, char *user, char *password, int port, + HANDLE pid_file,char *tmp_dir) +#endif +{ + arg_list_t al; + int err = 0; + char trash[PATH_MAX]; + + snprintf(trash, PATH_MAX, "%s/trash.out",tmp_dir); + + // args + init_args(&al); + add_arg(&al, "%s", mysqladmin_file); + add_arg(&al, "--no-defaults"); + add_arg(&al, "--port=%u", port); + add_arg(&al, "--user=%s", user); + add_arg(&al, "--password=%s", password); + add_arg(&al, "-O"); + add_arg(&al, "shutdown_timeout=20"); +#ifndef __NETWARE__ + add_arg(&al, "--protocol=tcp"); +#endif + add_arg(&al, "shutdown"); + + // spawn + if ((err = spawn(mysqladmin_file, &al, TRUE, NULL, + trash, NULL, NULL)) == 0) + { + sleep_until_file_deleted(pid_file); + } + else + { +#ifndef __WIN__ + pid_t pid = get_server_pid(pid_file); + + // shutdown failed - kill server + kill_server(pid); + + sleep(TRY_MAX); + + // remove pid file if possible + err = remove(pid_file); +#else + TerminateProcess(pid_file,err); +#endif + } + + // free args + free_args(&al); + + return err; +} + +/****************************************************************************** + + get_server_pid() + + Get the VM id with the given pid file. + +******************************************************************************/ +#ifndef __WIN__ +pid_t get_server_pid(char *pid_file) +{ + char buf[PATH_MAX]; + int fd, err; + char *p; + pid_t id = 0; + + // discover id + fd = open(pid_file, O_RDONLY); + + err = read(fd, buf, PATH_MAX); + + close(fd); + + if (err > 0) + { + // terminate string + if ((p = strchr(buf, '\n')) != NULL) + { + *p = '\0'; + + // check for a '\r' + if ((p = strchr(buf, '\r')) != NULL) + { + *p = '\0'; + } + } + else + { + buf[err] = '\0'; + } + + id = strtol(buf, NULL, 0); + } + + return id; +} + +/****************************************************************************** + + kill_server() + + Force a kill of the server with the given pid. + +******************************************************************************/ +void kill_server(pid_t pid) +{ + if (pid > 0) + { +#if !defined(__NETWARE__) + /* Send SIGTERM to pid */ + kill(pid, SIGTERM); +#else /* __NETWARE__ */ + /* destroy vm */ + NXVmDestroy(pid); +#endif + } +} +#endif +/****************************************************************************** + + del_tree() + + Delete the directory and subdirectories. + +******************************************************************************/ +void del_tree(char *dir) +{ +#ifndef __WIN__ + DIR *parent = opendir(dir); + struct dirent *entry; + char temp[PATH_MAX]; + + if (parent == NULL) + { + return; + } + + while((entry = readdir(parent)) != NULL) + { + // create long name + snprintf(temp, PATH_MAX, "%s/%s", dir, entry->d_name); + + if (entry->d_name[0] == '.') + { + // Skip + } + else + if (S_ISDIR(entry->d_type)) + { + // delete subdirectory + del_tree(temp); + } + else + { + // remove file + remove(temp); + } + } + // remove directory + rmdir(dir); +#else + struct _finddata_t parent; + intptr_t handle; + char temp[PATH_MAX]; + char mask[PATH_MAX]; + + snprintf(mask,MAX_PATH,"%s/*.*",dir); + + if ((handle=_findfirst(mask,&parent)) == -1L) + { + return; + } + + do + { + // create long name + snprintf(temp, PATH_MAX, "%s/%s", dir, parent.name); + if (parent.name[0] == '.') + { + // Skip + } + else + if (parent.attrib & _A_SUBDIR) + { + // delete subdirectory + del_tree(temp); + } + else + { + // remove file + remove(temp); + } + } while (_findnext(handle,&parent) == 0); + + _findclose(handle); + + // remove directory + _rmdir(dir); +#endif +} + +/****************************************************************************** + + removef() + +******************************************************************************/ +int removef(const char *format, ...) +{ +#ifdef __NETWARE__ + va_list ap; + char path[PATH_MAX]; + + va_start(ap, format); + + vsnprintf(path, PATH_MAX, format, ap); + + va_end(ap); + return remove(path); + +#eldef __WIN__ + { + va_list ap; + char path[PATH_MAX]; + struct _finddata_t parent; + intptr_t handle; + char temp[PATH_MAX]; + char *p; + + va_start(ap, format); + + vsnprintf(path, PATH_MAX, format, ap); + + va_end(ap); + + p = path + strlen(path); + while (*p != '\\' && *p != '/' && p > path) p--; + + if ((handle=_findfirst(path,&parent)) == -1L) + { + /* + if there is not files....it's ok. + */ + return 0; + } + + *p = '\0'; + + do + { + if (! (parent.attrib & _A_SUBDIR)) + { + snprintf(temp, PATH_MAX, "%s/%s", path, parent.name); + remove(temp); + } + }while (_findnext(handle,&parent) == 0); + + _findclose(handle); + } +#else + DIR *parent; + struct dirent *entry; + char temp[PATH_MAX]; + va_list ap; + char path[PATH_MAX]; + char *p; + /* + Get path with mask + */ + va_start(ap, format); + + vsnprintf(path, PATH_MAX, format, ap); + + va_end(ap); + + p = path + strlen(path); + while (*p != '\\' && *p != '/' && p > path) p--; + *p = '\0'; + p++; + + parent = opendir(path); + + if (parent == NULL) + { + return; + } + + while((entry = readdir(parent)) != NULL) + { + /* + entry is not directory and entry matches with mask + */ + if (!S_ISDIR(entry->d_type) && !fnmatch(p, entry->d_name,0)) + { + // create long name + snprintf(temp, PATH_MAX, "%s/%s", path, entry->d_name); + // Delete only files + remove(temp); + } + } +#endif + return 0; +} + +/****************************************************************************** + + get_basedir() + +******************************************************************************/ +void get_basedir(char *argv0, char *basedir) +{ + char temp[PATH_MAX]; + char *p; + int position; + + ASSERT(argv0 != NULL); + ASSERT(basedir != NULL); + + strcpy(temp, strlwr(argv0)); + while((p = strchr(temp, '\\')) != NULL) *p = '/'; + + if ((position = strinstr(temp, "/bin/")) != 0) + { + p = temp + position; + *p = '\0'; + strcpy(basedir, temp); + } +} + +#if !defined(__NETWARE__) && !defined(__WIN__) +char *strlwr(const char *s) +{ + return s; +} +#endif + +uint strinstr(reg1 const char *str,reg4 const char *search) +{ + reg2 my_string i,j; + my_string start = (my_string) str; + + skipp: + while (*str != '\0') + { + if (*str++ == *search) + { + i=(my_string) str; j= (my_string) search+1; + while (*j) + if (*i++ != *j++) goto skipp; + return ((uint) (str - start)); + } + } + return (0); +} + +/****************************************************************************** + + remove_empty_file() + +******************************************************************************/ +void remove_empty_file(const char *file_name) +{ + struct stat file; + + if (!stat(file_name,&file)) + { + if (!file.st_size) + remove(file_name); + } +} diff --git a/mysql-test/my_manage.h b/mysql-test/my_manage.h new file mode 100644 index 00000000000..56ba7ce0496 --- /dev/null +++ b/mysql-test/my_manage.h @@ -0,0 +1,135 @@ +/* + Copyright (c) 2002 Novell, Inc. All Rights Reserved. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#ifndef _MY_MANAGE +#define _MY_MANAGE + +/****************************************************************************** + + includes + +******************************************************************************/ + +#include +#ifndef __WIN__ +#include +#endif +#ifndef __NETWARE__ +#include +#include +#include + +#ifndef __WIN__ +#define strnicmp strncasecmp +char *strlwr(const char *s); +#else +int my_vsnprintf_(char *to, size_t n, const char* value, ...); +#endif +#endif + +/****************************************************************************** + + macros + +******************************************************************************/ + +#define ARG_BUF 10 +#define TRY_MAX 5 + +#ifdef __WIN__ +#define PATH_MAX _MAX_PATH +#define NAME_MAX _MAX_FNAME +#define kill(A,B) TerminateProcess((HANDLE)A,0) +#define NOT_NEED_PID 0 +#define MASTER_PID 1 +#define SLAVE_PID 2 +#define mysqld_timeout 60000 + +int pid_mode; +bool run_server; +bool skip_first_param; + +#define snprintf _snprintf +#define vsnprintf _vsnprintf +#endif + + +/****************************************************************************** + + structures + +******************************************************************************/ + +typedef struct +{ + + int argc; + char **argv; + + size_t size; + +} arg_list_t; + +#ifdef __WIN__ +typedef int pid_t; +#endif +/****************************************************************************** + + global variables + +******************************************************************************/ + +/****************************************************************************** + + prototypes + +******************************************************************************/ + +void init_args(arg_list_t *); +void add_arg(arg_list_t *, const char *, ...); +void free_args(arg_list_t *); + +#ifndef __WIN__ +int sleep_until_file_exists(char *); +int sleep_until_file_deleted(char *); +#else +int sleep_until_file_exists(HANDLE); +int sleep_until_file_deleted(HANDLE); +#endif +int wait_for_server_start(char *, char *, char *, char *, int,char *); + +#ifndef __WIN__ +int spawn(char *, arg_list_t *, int, char *, char *, char *, char *); +#else +int spawn(char *, arg_list_t *, int , char *, char *, char *, HANDLE *); +#endif + +#ifndef __WIN__ +int stop_server(char *, char *, char *, char *, int, char *,char *); +pid_t get_server_pid(char *); +void kill_server(pid_t pid); +#else +int stop_server(char *, char *, char *, char *, int, HANDLE,char *); +#endif +void del_tree(char *); +int removef(const char *, ...); + +void get_basedir(char *, char *); +void remove_empty_file(const char *file_name); + +#endif /* _MY_MANAGE */ diff --git a/mysql-test/mysql_test_run.c b/mysql-test/mysql_test_run.c new file mode 100644 index 00000000000..6f388fc4a45 --- /dev/null +++ b/mysql-test/mysql_test_run.c @@ -0,0 +1,1728 @@ +/* + Copyright (c) 2002, 2003 Novell, Inc. All Rights Reserved. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include +#include +#include +#ifndef __WIN__ +#include +#endif +#include +#ifdef __NETWARE__ +#include +#include +#endif +#include +#include +#ifndef __WIN__ +#include +#endif +#include +#ifdef __NETWARE__ +#include +#endif +#ifdef __WIN__ +#include +#include +#endif + +#include "my_manage.h" + +/****************************************************************************** + + macros + +******************************************************************************/ + +#define HEADER "TEST RESULT \n" +#define DASH "-------------------------------------------------------\n" + +#define NW_TEST_SUFFIX ".nw-test" +#define NW_RESULT_SUFFIX ".nw-result" +#define TEST_SUFFIX ".test" +#define RESULT_SUFFIX ".result" +#define REJECT_SUFFIX ".reject" +#define OUT_SUFFIX ".out" +#define ERR_SUFFIX ".err" + +const char *TEST_PASS = "[ pass ]"; +const char *TEST_SKIP = "[ skip ]"; +const char *TEST_FAIL = "[ fail ]"; +const char *TEST_BAD = "[ bad ]"; +const char *TEST_IGNORE = "[ignore]"; + +/****************************************************************************** + + global variables + +******************************************************************************/ +#ifdef __NETWARE__ +static char base_dir[PATH_MAX] = "sys:/mysql"; +#else +static char base_dir[PATH_MAX] = ".."; +#endif +static char db[PATH_MAX] = "test"; +static char user[PATH_MAX] = "root"; +static char password[PATH_MAX] = ""; + +int master_port = 9306; +int slave_port = 9307; + +#if !defined(__NETWARE__) && !defined(__WIN__) +static char master_socket[PATH_MAX] = "./var/tmp/master.sock"; +static char slave_socket[PATH_MAX] = "./var/tmp/slave.sock"; +#endif + +// comma delimited list of tests to skip or empty string +#ifndef __WIN__ +static char skip_test[PATH_MAX] = " lowercase_table3 , system_mysql_db_fix "; +#else +/* + The most ignore testes contain the calls of system command +*/ +#define MAX_COUNT_TESTES 1024 +/* + lowercase_table3 is disabled by Gerg + system_mysql_db_fix is disabled by Gerg + sp contains a command system + rpl_EE_error contains a command system + rpl_loaddatalocal contains a command system + ndb_autodiscover contains a command system + rpl_rotate_logs contains a command system + repair contains a command system + rpl_trunc_binlog contains a command system + mysqldump contains a command system + rpl000001 makes non-exit loop...temporary skiped +*/ +static char skip_test[PATH_MAX] = " lowercase_table3 , system_mysql_db_fix , sp , rpl_EE_error , rpl_loaddatalocal , ndb_autodiscover , rpl_rotate_logs , repair , rpl_trunc_binlog , mysqldump , rpl000001 "; +#endif +static char ignore_test[PATH_MAX] = ""; + +static char bin_dir[PATH_MAX]; +static char mysql_test_dir[PATH_MAX]; +static char test_dir[PATH_MAX]; +static char mysql_tmp_dir[PATH_MAX]; +static char result_dir[PATH_MAX]; +static char master_dir[PATH_MAX]; +static char slave_dir[PATH_MAX]; +static char lang_dir[PATH_MAX]; +static char char_dir[PATH_MAX]; + +static char mysqladmin_file[PATH_MAX]; +static char mysqld_file[PATH_MAX]; +static char mysqltest_file[PATH_MAX]; +#ifndef __WIN__ +static char master_pid[PATH_MAX]; +static char slave_pid[PATH_MAX]; +static char sh_file[PATH_MAX] = "/bin/sh"; +#else +static HANDLE master_pid; +static HANDLE slave_pid; +#endif + +static char master_opt[PATH_MAX] = ""; +static char slave_opt[PATH_MAX] = ""; + +static char slave_master_info[PATH_MAX] = ""; + +static char master_init_script[PATH_MAX] = ""; +static char slave_init_script[PATH_MAX] = ""; + +// OpenSSL +static char ca_cert[PATH_MAX]; +static char server_cert[PATH_MAX]; +static char server_key[PATH_MAX]; +static char client_cert[PATH_MAX]; +static char client_key[PATH_MAX]; + +int total_skip = 0; +int total_pass = 0; +int total_fail = 0; +int total_test = 0; + +int total_ignore = 0; + +int use_openssl = FALSE; +int master_running = FALSE; +int slave_running = FALSE; +int skip_slave = TRUE; +int single_test = TRUE; + +int restarts = 0; + +FILE *log_fd = NULL; + +/****************************************************************************** + + functions + +******************************************************************************/ + +/****************************************************************************** + + prototypes + +******************************************************************************/ + +void report_stats(); +void install_db(char *); +void mysql_install_db(); +void start_master(); +void start_slave(); +void mysql_start(); +void stop_slave(); +void stop_master(); +void mysql_stop(); +void mysql_restart(); +int read_option(char *, char *); +void run_test(char *); +void setup(char *); +void vlog(const char *, va_list); +void mlog(const char *, ...); +void log_info(const char *, ...); +void log_error(const char *, ...); +void log_errno(const char *, ...); +void die(const char *); +char *str_tok(char *string, const char *delim); +#ifndef __WIN__ +void run_init_script(const char *script_name); +#endif +/****************************************************************************** + + report_stats() + + Report the gathered statistics. + +******************************************************************************/ +void report_stats() +{ + if (total_fail == 0) + { + mlog("\nAll %d test(s) were successful.\n", total_test); + } + else + { + double percent = ((double)total_pass / total_test) * 100; + + mlog("\nFailed %u/%u test(s), %.02f%% successful.\n", + total_fail, total_test, percent); + mlog("\nThe .out and .err files in %s may give you some\n", result_dir); + mlog("hint of what when wrong.\n"); + mlog("\nIf you want to report this error, please first read the documentation\n"); + mlog("at: http://www.mysql.com/doc/M/y/MySQL_test_suite.html\n"); + } +} + +/****************************************************************************** + + install_db() + + Install the a database. + +******************************************************************************/ +void install_db(char *datadir) +{ + arg_list_t al; + int err; + char input[PATH_MAX]; + char output[PATH_MAX]; + char error[PATH_MAX]; + + // input file +#ifdef __NETWARE__ + snprintf(input, PATH_MAX, "%s/bin/init_db.sql", base_dir); +#else + snprintf(input, PATH_MAX, "%s/mysql-test/init_db.sql", base_dir); +#endif + snprintf(output, PATH_MAX, "%s/install.out", datadir); + snprintf(error, PATH_MAX, "%s/install.err", datadir); + + // args + init_args(&al); + add_arg(&al, mysqld_file); + add_arg(&al, "--no-defaults"); + add_arg(&al, "--bootstrap"); + add_arg(&al, "--skip-grant-tables"); + add_arg(&al, "--basedir=%s", base_dir); + add_arg(&al, "--datadir=%s", datadir); + add_arg(&al, "--skip-innodb"); + add_arg(&al, "--skip-bdb"); +#ifndef __NETWARE__ + add_arg(&al, "--character-sets-dir=%s", char_dir); + add_arg(&al, "--language=%s", lang_dir); +#endif + + // spawn + if ((err = spawn(mysqld_file, &al, TRUE, input, output, error, NULL)) != 0) + { + die("Unable to create database."); + } + + // free args + free_args(&al); +} + +/****************************************************************************** + + mysql_install_db() + + Install the test databases. + +******************************************************************************/ +void mysql_install_db() +{ + char temp[PATH_MAX]; + + // var directory + snprintf(temp, PATH_MAX, "%s/var", mysql_test_dir); + + // clean up old direcotry + del_tree(temp); + + // create var directory +#ifndef __WIN__ + mkdir(temp, S_IRWXU); + // create subdirectories + mlog("Creating test-suite folders...\n"); + snprintf(temp, PATH_MAX, "%s/var/run", mysql_test_dir); + mkdir(temp, S_IRWXU); + snprintf(temp, PATH_MAX, "%s/var/tmp", mysql_test_dir); + mkdir(temp, S_IRWXU); + snprintf(temp, PATH_MAX, "%s/var/master-data", mysql_test_dir); + mkdir(temp, S_IRWXU); + snprintf(temp, PATH_MAX, "%s/var/master-data/mysql", mysql_test_dir); + mkdir(temp, S_IRWXU); + snprintf(temp, PATH_MAX, "%s/var/master-data/test", mysql_test_dir); + mkdir(temp, S_IRWXU); + snprintf(temp, PATH_MAX, "%s/var/slave-data", mysql_test_dir); + mkdir(temp, S_IRWXU); + snprintf(temp, PATH_MAX, "%s/var/slave-data/mysql", mysql_test_dir); + mkdir(temp, S_IRWXU); + snprintf(temp, PATH_MAX, "%s/var/slave-data/test", mysql_test_dir); + mkdir(temp, S_IRWXU); +#else + mkdir(temp); + // create subdirectories + mlog("Creating test-suite folders...\n"); + snprintf(temp, PATH_MAX, "%s/var/run", mysql_test_dir); + mkdir(temp); + snprintf(temp, PATH_MAX, "%s/var/tmp", mysql_test_dir); + mkdir(temp); + snprintf(temp, PATH_MAX, "%s/var/master-data", mysql_test_dir); + mkdir(temp); + snprintf(temp, PATH_MAX, "%s/var/master-data/mysql", mysql_test_dir); + mkdir(temp); + snprintf(temp, PATH_MAX, "%s/var/master-data/test", mysql_test_dir); + mkdir(temp); + snprintf(temp, PATH_MAX, "%s/var/slave-data", mysql_test_dir); + mkdir(temp); + snprintf(temp, PATH_MAX, "%s/var/slave-data/mysql", mysql_test_dir); + mkdir(temp); + snprintf(temp, PATH_MAX, "%s/var/slave-data/test", mysql_test_dir); + mkdir(temp); +#endif + + // install databases + mlog("Creating test databases for master... \n"); + install_db(master_dir); + mlog("Creating test databases for slave... \n"); + install_db(slave_dir); +} + +/****************************************************************************** + + start_master() + + Start the master server. + +******************************************************************************/ +void start_master() +{ + arg_list_t al; + int err; + char master_out[PATH_MAX]; + char master_err[PATH_MAX]; +// char temp[PATH_MAX]; + char temp2[PATH_MAX]; + + // remove old berkeley db log files that can confuse the server + removef("%s/log.*", master_dir); + + // remove stale binary logs + removef("%s/var/log/*-bin.*", mysql_test_dir); + + // remove stale binary logs + removef("%s/var/log/*.index", mysql_test_dir); + + // remove master.info file + removef("%s/master.info", master_dir); + + // remove relay files + removef("%s/var/log/*relay*", mysql_test_dir); + + // remove relay-log.info file + removef("%s/relay-log.info", master_dir); + + // init script + if (master_init_script[0] != 0) + { +#ifdef __NETWARE__ + // TODO: use the scripts + if (strinstr(master_init_script, "repair_part2-master.sh") != 0) + { + FILE *fp; + + // create an empty index file + snprintf(temp, PATH_MAX, "%s/test/t1.MYI", master_dir); + fp = fopen(temp, "wb+"); + + fputs("1", fp); + + fclose(fp); + } +#elif !defined(__WIN__) + run_init_script(master_init_script); +#endif + } + + // redirection files + snprintf(master_out, PATH_MAX, "%s/var/run/master%u.out", + mysql_test_dir, restarts); + snprintf(master_err, PATH_MAX, "%s/var/run/master%u.err", + mysql_test_dir, restarts); +#ifndef __WIN__ + snprintf(temp2,PATH_MAX,"%s/var",mysql_test_dir); + mkdir(temp2,S_IRWXU); + snprintf(temp2,PATH_MAX,"%s/var/log",mysql_test_dir); + mkdir(temp2,S_IRWXU); +#else + snprintf(temp2,PATH_MAX,"%s/var",mysql_test_dir); + mkdir(temp2); + snprintf(temp2,PATH_MAX,"%s/var/log",mysql_test_dir); + mkdir(temp2); +#endif + // args + init_args(&al); + add_arg(&al, "%s", mysqld_file); + add_arg(&al, "--no-defaults"); + add_arg(&al, "--log-bin=%s/var/log/master-bin",mysql_test_dir); + add_arg(&al, "--server-id=1"); + add_arg(&al, "--basedir=%s", base_dir); + add_arg(&al, "--port=%u", master_port); +#if !defined(__NETWARE__) && !defined(__WIN__) + add_arg(&al, "--socket=%s",master_socket); +#endif + add_arg(&al, "--local-infile"); + add_arg(&al, "--core"); + add_arg(&al, "--datadir=%s", master_dir); +#ifndef __WIN__ + add_arg(&al, "--pid-file=%s", master_pid); +#endif + add_arg(&al, "--character-sets-dir=%s", char_dir); + add_arg(&al, "--tmpdir=%s", mysql_tmp_dir); + add_arg(&al, "--language=%s", lang_dir); +#ifdef DEBUG //only for debug builds + add_arg(&al, "--debug"); +#endif + + if (use_openssl) + { + add_arg(&al, "--ssl-ca=%s", ca_cert); + add_arg(&al, "--ssl-cert=%s", server_cert); + add_arg(&al, "--ssl-key=%s", server_key); + } + + // $MASTER_40_ARGS + add_arg(&al, "--rpl-recovery-rank=1"); + add_arg(&al, "--init-rpl-role=master"); + + // $SMALL_SERVER + add_arg(&al, "-O"); + add_arg(&al, "key_buffer_size=1M"); + add_arg(&al, "-O"); + add_arg(&al, "sort_buffer=256K"); + add_arg(&al, "-O"); + add_arg(&al, "max_heap_table_size=1M"); + + // $EXTRA_MASTER_OPT + if (master_opt[0] != 0) + { + char *p; + + p = (char *)str_tok(master_opt, " \t"); + if (!strstr(master_opt, "timezone")) + { + while (p) + { + add_arg(&al, "%s", p); + p = (char *)str_tok(NULL, " \t"); + } + } + } + + // remove the pid file if it exists +#ifndef __WIN__ + remove(master_pid); +#endif + + // spawn +#ifdef __WIN__ + if ((err= spawn(mysqld_file, &al, FALSE, NULL, master_out, master_err, &master_pid)) == 0) +#else + if ((err= spawn(mysqld_file, &al, FALSE, NULL, master_out, master_err, master_pid)) == 0) +#endif + { + sleep_until_file_exists(master_pid); + + if ((err = wait_for_server_start(bin_dir, mysqladmin_file, user, password, master_port, + mysql_tmp_dir)) == 0) + { + master_running = TRUE; + } + else + { + log_error("The master server went down early."); + } + } + else + { + log_error("Unable to start master server."); + } + + // free_args + free_args(&al); +} + +/****************************************************************************** + + start_slave() + + Start the slave server. + +******************************************************************************/ +void start_slave() +{ + arg_list_t al; + int err; + char slave_out[PATH_MAX]; + char slave_err[PATH_MAX]; + + // skip? + if (skip_slave) return; + + // remove stale binary logs + removef("%s/*-bin.*", slave_dir); + + // remove stale binary logs + removef("%s/*.index", slave_dir); + + // remove master.info file + removef("%s/master.info", slave_dir); + + // remove relay files + removef("%s/var/log/*relay*", mysql_test_dir); + + // remove relay-log.info file + removef("%s/relay-log.info", slave_dir); + + // init script + if (slave_init_script[0] != 0) + { +#ifdef __NETWARE__ + // TODO: use the scripts + if (strinstr(slave_init_script, "rpl000016-slave.sh") != 0) + { + // create empty master.info file + snprintf(temp, PATH_MAX, "%s/master.info", slave_dir); + close(open(temp, O_WRONLY | O_CREAT,S_IRWXU|S_IRWXG|S_IRWXO)); + } + else if (strinstr(slave_init_script, "rpl000017-slave.sh") != 0) + { + FILE *fp; + + // create a master.info file + snprintf(temp, PATH_MAX, "%s/master.info", slave_dir); + fp = fopen(temp, "wb+"); + + fputs("master-bin.000001\n", fp); + fputs("4\n", fp); + fputs("127.0.0.1\n", fp); + fputs("replicate\n", fp); + fputs("aaaaaaaaaaaaaaab\n", fp); + fputs("9306\n", fp); + fputs("1\n", fp); + fputs("0\n", fp); + + fclose(fp); + } + else if (strinstr(slave_init_script, "rpl_rotate_logs-slave.sh") != 0) + { + // create empty master.info file + snprintf(temp, PATH_MAX, "%s/master.info", slave_dir); + close(open(temp, O_WRONLY | O_CREAT,S_IRWXU|S_IRWXG|S_IRWXO)); + } +#elif !defined(__WIN__) + run_init_script(slave_init_script); +#endif + } + + // redirection files + snprintf(slave_out, PATH_MAX, "%s/var/run/slave%u.out", + mysql_test_dir, restarts); + snprintf(slave_err, PATH_MAX, "%s/var/run/slave%u.err", + mysql_test_dir, restarts); + + // args + init_args(&al); + add_arg(&al, "%s", mysqld_file); + add_arg(&al, "--no-defaults"); + add_arg(&al, "--log-bin=slave-bin"); + add_arg(&al, "--relay_log=slave-relay-bin"); + add_arg(&al, "--basedir=%s", base_dir); + add_arg(&al, "--port=%u", slave_port); +#if !defined(__NETWARE__) && !defined(__WIN__) + add_arg(&al, "--socket=%s",slave_socket); +#endif + add_arg(&al, "--datadir=%s", slave_dir); +#ifndef __WIN__ + add_arg(&al, "--pid-file=%s", slave_pid); +#endif + add_arg(&al, "--character-sets-dir=%s", char_dir); + add_arg(&al, "--core"); + add_arg(&al, "--tmpdir=%s", mysql_tmp_dir); + add_arg(&al, "--language=%s", lang_dir); + + add_arg(&al, "--exit-info=256"); + add_arg(&al, "--log-slave-updates"); + add_arg(&al, "--init-rpl-role=slave"); + add_arg(&al, "--skip-innodb"); + add_arg(&al, "--skip-slave-start"); + add_arg(&al, "--slave-load-tmpdir=../../var/tmp"); + + add_arg(&al, "--report-user=%s", user); + add_arg(&al, "--report-host=127.0.0.1"); + add_arg(&al, "--report-port=%u", slave_port); + + add_arg(&al, "--master-retry-count=10"); + add_arg(&al, "-O"); + add_arg(&al, "slave_net_timeout=10"); +#ifdef DEBUG //only for debug builds + add_arg(&al, "--debug"); +#endif + + if (use_openssl) + { + add_arg(&al, "--ssl-ca=%s", ca_cert); + add_arg(&al, "--ssl-cert=%s", server_cert); + add_arg(&al, "--ssl-key=%s", server_key); + } + + // slave master info + if (slave_master_info[0] != 0) + { + char *p; + + p = (char *)str_tok(slave_master_info, " \t"); + + while(p) + { + add_arg(&al, "%s", p); + + p = (char *)str_tok(NULL, " \t"); + } + } + else + { + add_arg(&al, "--master-user=%s", user); + add_arg(&al, "--master-password=%s", password); + add_arg(&al, "--master-host=127.0.0.1"); + add_arg(&al, "--master-port=%u", master_port); + add_arg(&al, "--master-connect-retry=1"); + add_arg(&al, "--server-id=2"); + add_arg(&al, "--rpl-recovery-rank=2"); + } + + // small server + add_arg(&al, "-O"); + add_arg(&al, "key_buffer_size=1M"); + add_arg(&al, "-O"); + add_arg(&al, "sort_buffer=256K"); + add_arg(&al, "-O"); + add_arg(&al, "max_heap_table_size=1M"); + + + // opt args + if (slave_opt[0] != 0) + { + char *p; + + p = (char *)str_tok(slave_opt, " \t"); + + while(p) + { + add_arg(&al, "%s", p); + + p = (char *)str_tok(NULL, " \t"); + } + } + + // remove the pid file if it exists +#ifndef __WIN__ + remove(slave_pid); +#endif + // spawn +#ifdef __WIN__ + if ((err = spawn(mysqld_file, &al, FALSE, NULL, slave_out, slave_err, &slave_pid)) == 0) +#else + if ((err = spawn(mysqld_file, &al, FALSE, NULL, slave_out, slave_err, slave_pid)) == 0) +#endif + { + sleep_until_file_exists(slave_pid); + + if ((err = wait_for_server_start(bin_dir, mysqladmin_file, user, password, slave_port, + mysql_tmp_dir)) == 0) + { + slave_running = TRUE; + } + else + { + log_error("The slave server went down early."); + } + } + else + { + log_error("Unable to start slave server."); + } + + // free args + free_args(&al); +} + +/****************************************************************************** + + mysql_start() + + Start the mysql servers. + +******************************************************************************/ +void mysql_start() +{ +// log_info("Starting the MySQL server(s): %u", ++restarts); + start_master(); + + start_slave(); + + // activate the test screen +#ifdef __NETWARE__ + ActivateScreen(getscreenhandle()); +#endif +} + +/****************************************************************************** + + stop_slave() + + Stop the slave server. + +******************************************************************************/ +void stop_slave() +{ + int err; + + // running? + if (!slave_running) return; + + // stop + if ((err = stop_server(bin_dir, mysqladmin_file, user, password, slave_port, slave_pid, + mysql_tmp_dir)) == 0) + { + slave_running = FALSE; + } + else + { + log_error("Unable to stop slave server."); + } +} + +/****************************************************************************** + + stop_master() + + Stop the master server. + +******************************************************************************/ +void stop_master() +{ + int err; + + // running? + if (!master_running) return; + + if ((err = stop_server(bin_dir, mysqladmin_file, user, password, master_port, master_pid, + mysql_tmp_dir)) == 0) + { + master_running = FALSE; + } + else + { + log_error("Unable to stop master server."); + } +} + +/****************************************************************************** + + mysql_stop() + + Stop the mysql servers. + +******************************************************************************/ +void mysql_stop() +{ + + stop_master(); + + stop_slave(); + + // activate the test screen +#ifdef __NETWARE__ + ActivateScreen(getscreenhandle()); +#endif +} + +/****************************************************************************** + + mysql_restart() + + Restart the mysql servers. + +******************************************************************************/ +void mysql_restart() +{ +// log_info("Restarting the MySQL server(s): %u", ++restarts); + + mysql_stop(); + + mlog(DASH); + + mysql_start(); +} + +/****************************************************************************** + + read_option() + + Read the option file. + +******************************************************************************/ +int read_option(char *opt_file, char *opt) +{ + int fd, err; + char *p; + char buf[PATH_MAX]; + + // copy current option + strncpy(buf, opt, PATH_MAX); + + // open options file + fd = open(opt_file, O_RDONLY); + + err = read(fd, opt, PATH_MAX); + + close(fd); + + if (err > 0) + { + // terminate string + if ((p = strchr(opt, '\n')) != NULL) + { + *p = 0; + + // check for a '\r' + if ((p = strchr(opt, '\r')) != NULL) + { + *p = 0; + } + } + else + { + opt[err] = 0; + } + + // check for $MYSQL_TEST_DIR + if ((p = strstr(opt, "$MYSQL_TEST_DIR")) != NULL) + { + char temp[PATH_MAX]; + + *p = 0; + + strcpy(temp, p + strlen("$MYSQL_TEST_DIR")); + + strcat(opt, mysql_test_dir); + + strcat(opt, temp); + } + // Check for double backslash and replace it with single bakslash + if ((p = strstr(opt, "\\\\")) != NULL) + { + /* bmove is guranteed to work byte by byte */ + bmove(p, p+1, strlen(p+1)); + } + } + else + { + // clear option + *opt = 0; + } + + // compare current option with previous + return strcmp(opt, buf); +} + +/****************************************************************************** + + run_test() + + Run the given test case. + +******************************************************************************/ +void run_test(char *test) +{ + char temp[PATH_MAX]; + const char *rstr; + int skip = FALSE, ignore=FALSE; + int restart = FALSE; + int flag = FALSE; + struct stat info; + + // skip tests in the skip list + snprintf(temp, PATH_MAX, " %s ", test); + skip = (strinstr(skip_test, temp) != 0); + if (skip == FALSE) + ignore = (strinstr(ignore_test, temp) != 0); + + snprintf(master_init_script, PATH_MAX, "%s/%s-master.sh", test_dir, test); + snprintf(slave_init_script, PATH_MAX, "%s/%s-slave.sh", test_dir, test); +#ifdef __WIN__ + if (! stat(master_init_script, &info)) + skip = TRUE; + if (!stat(slave_init_script, &info)) + skip = TRUE; +#endif + if (ignore) + { + // show test + mlog("%-46s ", test); + + // ignore + rstr = TEST_IGNORE; + ++total_ignore; + } + else if (!skip) // skip test? + { + char test_file[PATH_MAX]; + char master_opt_file[PATH_MAX]; + char slave_opt_file[PATH_MAX]; + char slave_master_info_file[PATH_MAX]; + char result_file[PATH_MAX]; + char reject_file[PATH_MAX]; + char out_file[PATH_MAX]; + char err_file[PATH_MAX]; + int err; + arg_list_t al; +#ifdef __WIN__ + /* + Clean test database + */ + removef("%s/test/*.*", master_dir); + removef("%s/test/*.*", slave_dir); + removef("%s/mysqltest/*.*", master_dir); + removef("%s/mysqltest/*.*", slave_dir); + +#endif + // skip slave? + flag = skip_slave; + skip_slave = (strncmp(test, "rpl", 3) != 0); + if (flag != skip_slave) restart = TRUE; + + // create files + snprintf(master_opt_file, PATH_MAX, "%s/%s-master.opt", test_dir, test); + snprintf(slave_opt_file, PATH_MAX, "%s/%s-slave.opt", test_dir, test); + snprintf(slave_master_info_file, PATH_MAX, "%s/%s.slave-mi", test_dir, test); + snprintf(reject_file, PATH_MAX, "%s/%s%s", result_dir, test, REJECT_SUFFIX); + snprintf(out_file, PATH_MAX, "%s/%s%s", result_dir, test, OUT_SUFFIX); + snprintf(err_file, PATH_MAX, "%s/%s%s", result_dir, test, ERR_SUFFIX); + + // netware specific files + snprintf(test_file, PATH_MAX, "%s/%s%s", test_dir, test, NW_TEST_SUFFIX); + if (stat(test_file, &info)) + { + snprintf(test_file, PATH_MAX, "%s/%s%s", test_dir, test, TEST_SUFFIX); + if (access(test_file,0)) + { + printf("Invalid test name %s, %s file not found\n",test,test_file); + return; + } + } + + snprintf(result_file, PATH_MAX, "%s/%s%s", result_dir, test, NW_RESULT_SUFFIX); + if (stat(result_file, &info)) + { + snprintf(result_file, PATH_MAX, "%s/%s%s", result_dir, test, RESULT_SUFFIX); + } + + // init scripts + if (stat(master_init_script, &info)) + master_init_script[0] = 0; + else + restart = TRUE; + + if (stat(slave_init_script, &info)) + slave_init_script[0] = 0; + else + restart = TRUE; + + // read options + if (read_option(master_opt_file, master_opt)) restart = TRUE; + if (read_option(slave_opt_file, slave_opt)) restart = TRUE; + if (read_option(slave_master_info_file, slave_master_info)) restart = TRUE; + + // cleanup previous run + remove(reject_file); + remove(out_file); + remove(err_file); + + // start or restart? + if (!master_running) mysql_start(); + else if (restart) mysql_restart(); + + // let the system stabalize + sleep(1); + + // show test + mlog("%-46s ", test); + + + // args + init_args(&al); + add_arg(&al, "%s", mysqltest_file); + add_arg(&al, "--no-defaults"); + add_arg(&al, "--port=%u", master_port); +#if !defined(__NETWARE__) && !defined(__WIN__) + add_arg(&al, "--socket=%s", master_socket); + add_arg(&al, "--tmpdir=%s", mysql_tmp_dir); +#endif + add_arg(&al, "--database=%s", db); + add_arg(&al, "--user=%s", user); + add_arg(&al, "--password=%s", password); + add_arg(&al, "--silent"); + add_arg(&al, "--basedir=%s/", mysql_test_dir); + add_arg(&al, "--host=127.0.0.1"); + add_arg(&al, "-v"); + add_arg(&al, "-R"); + add_arg(&al, "%s", result_file); + + if (use_openssl) + { + add_arg(&al, "--ssl-ca=%s", ca_cert); + add_arg(&al, "--ssl-cert=%s", client_cert); + add_arg(&al, "--ssl-key=%s", client_key); + } + + // spawn + err = spawn(mysqltest_file, &al, TRUE, test_file, out_file, err_file, NULL); + + // free args + free_args(&al); + + remove_empty_file(out_file); + remove_empty_file(err_file); + + if (err == 0) + { + // pass + rstr = TEST_PASS; + ++total_pass; + + // increment total + ++total_test; + } + else if (err == 2) + { + // skip + rstr = TEST_SKIP; + ++total_skip; + } + else if (err == 1) + { + // fail + rstr = TEST_FAIL; + ++total_fail; + + // increment total + ++total_test; + } + else + { + rstr = TEST_BAD; + } + } + else // early skips + { + // show test + mlog("%-46s ", test); + + // skip + rstr = TEST_SKIP; + ++total_skip; + } + + // result + mlog("%-14s\n", rstr); +} + +/****************************************************************************** + + vlog() + + Log the message. + +******************************************************************************/ +void vlog(const char *format, va_list ap) +{ + vfprintf(stdout, format, ap); + fflush(stdout); + + if (log_fd) + { + vfprintf(log_fd, format, ap); + fflush(log_fd); + } +} + +/****************************************************************************** + + log() + + Log the message. + +******************************************************************************/ +void mlog(const char *format, ...) +{ + va_list ap; + + va_start(ap, format); + + vlog(format, ap); + + va_end(ap); +} + +/****************************************************************************** + + log_info() + + Log the given information. + +******************************************************************************/ +void log_info(const char *format, ...) +{ + va_list ap; + + va_start(ap, format); + + mlog("-- INFO : "); + vlog(format, ap); + mlog("\n"); + + va_end(ap); +} + +/****************************************************************************** + + log_error() + + Log the given error. + +******************************************************************************/ +void log_error(const char *format, ...) +{ + va_list ap; + + va_start(ap, format); + + mlog("-- ERROR: "); + vlog(format, ap); + mlog("\n"); + + va_end(ap); +} + +/****************************************************************************** + + log_errno() + + Log the given error and errno. + +******************************************************************************/ +void log_errno(const char *format, ...) +{ + va_list ap; + + va_start(ap, format); + + mlog("-- ERROR: (%003u) ", errno); + vlog(format, ap); + mlog("\n"); + + va_end(ap); +} + +/****************************************************************************** + + die() + + Exit the application. + +******************************************************************************/ +void die(const char *msg) +{ + log_error(msg); +#ifdef __NETWARE__ + pressanykey(); +#endif + exit(-1); +} + +/****************************************************************************** + + setup() + + Setup the mysql test enviornment. + +******************************************************************************/ +void setup(char *file) +{ + char temp[PATH_MAX]; + char file_path[PATH_MAX*2]; + char *p; + int position; + + // set the timezone for the timestamp test +#ifdef __WIN__ + _putenv( "TZ=GMT-3" ); +#else + setenv("TZ", "GMT-3", TRUE); +#endif + // find base dir +#ifdef __NETWARE__ + strcpy(temp, strlwr(file)); + while((p = strchr(temp, '\\')) != NULL) *p = '/'; +#else + getcwd(temp, PATH_MAX); + position = strlen(temp); + temp[position] = '/'; + temp[position+1] = 0; +#ifdef __WIN__ + while((p = strchr(temp, '\\')) != NULL) *p = '/'; +#endif +#endif + + if ((position = strinstr(temp, "/mysql-test/")) != 0) + { + p = temp + position - 1; + *p = 0; + strcpy(base_dir, temp); + } + + log_info("Currect directory: %s",base_dir); + +#ifdef __NETWARE__ + // setup paths + snprintf(bin_dir, PATH_MAX, "%s/bin", base_dir); + snprintf(mysql_test_dir, PATH_MAX, "%s/mysql-test", base_dir); + snprintf(test_dir, PATH_MAX, "%s/t", mysql_test_dir); + snprintf(mysql_tmp_dir, PATH_MAX, "%s/var/tmp", mysql_test_dir); + snprintf(result_dir, PATH_MAX, "%s/r", mysql_test_dir); + snprintf(master_dir, PATH_MAX, "%s/var/master-data", mysql_test_dir); + snprintf(slave_dir, PATH_MAX, "%s/var/slave-data", mysql_test_dir); + snprintf(lang_dir, PATH_MAX, "%s/share/english", base_dir); + snprintf(char_dir, PATH_MAX, "%s/share/charsets", base_dir); + +#ifdef HAVE_OPENSSL + use_openssl = TRUE; +#endif // HAVE_OPENSSL + + // OpenSSL paths + snprintf(ca_cert, PATH_MAX, "%s/SSL/cacert.pem", base_dir); + snprintf(server_cert, PATH_MAX, "%s/SSL/server-cert.pem", base_dir); + snprintf(server_key, PATH_MAX, "%s/SSL/server-key.pem", base_dir); + snprintf(client_cert, PATH_MAX, "%s/SSL/client-cert.pem", base_dir); + snprintf(client_key, PATH_MAX, "%s/SSL/client-key.pem", base_dir); + + // setup files + snprintf(mysqld_file, PATH_MAX, "%s/mysqld", bin_dir); + snprintf(mysqltest_file, PATH_MAX, "%s/mysqltest", bin_dir); + snprintf(mysqladmin_file, PATH_MAX, "%s/mysqladmin", bin_dir); + snprintf(master_pid, PATH_MAX, "%s/var/run/master.pid", mysql_test_dir); + snprintf(slave_pid, PATH_MAX, "%s/var/run/slave.pid", mysql_test_dir); +#elif __WIN__ + // setup paths +#ifdef _DEBUG + snprintf(bin_dir, PATH_MAX, "%s/client_debug", base_dir); +#else + snprintf(bin_dir, PATH_MAX, "%s/client_release", base_dir); +#endif + snprintf(mysql_test_dir, PATH_MAX, "%s/mysql-test", base_dir); + snprintf(test_dir, PATH_MAX, "%s/t", mysql_test_dir); + snprintf(mysql_tmp_dir, PATH_MAX, "%s/var/tmp", mysql_test_dir); + snprintf(result_dir, PATH_MAX, "%s/r", mysql_test_dir); + snprintf(master_dir, PATH_MAX, "%s/var/master-data", mysql_test_dir); + snprintf(slave_dir, PATH_MAX, "%s/var/slave-data", mysql_test_dir); + snprintf(lang_dir, PATH_MAX, "%s/share/english", base_dir); + snprintf(char_dir, PATH_MAX, "%s/share/charsets", base_dir); + +#ifdef HAVE_OPENSSL + use_openssl = TRUE; +#endif // HAVE_OPENSSL + + // OpenSSL paths + snprintf(ca_cert, PATH_MAX, "%s/SSL/cacert.pem", base_dir); + snprintf(server_cert, PATH_MAX, "%s/SSL/server-cert.pem", base_dir); + snprintf(server_key, PATH_MAX, "%s/SSL/server-key.pem", base_dir); + snprintf(client_cert, PATH_MAX, "%s/SSL/client-cert.pem", base_dir); + snprintf(client_key, PATH_MAX, "%s/SSL/client-key.pem", base_dir); + + // setup files + snprintf(mysqld_file, PATH_MAX, "%s/mysqld.exe", bin_dir); + snprintf(mysqltest_file, PATH_MAX, "%s/mysqltest.exe", bin_dir); + snprintf(mysqladmin_file, PATH_MAX, "%s/mysqladmin.exe", bin_dir); +#else + // setup paths + snprintf(bin_dir, PATH_MAX, "%s/client", base_dir); + snprintf(mysql_test_dir, PATH_MAX, "%s/mysql-test", base_dir); + snprintf(test_dir, PATH_MAX, "%s/t", mysql_test_dir); + snprintf(mysql_tmp_dir, PATH_MAX, "%s/var/tmp", mysql_test_dir); + snprintf(result_dir, PATH_MAX, "%s/r", mysql_test_dir); + snprintf(master_dir, PATH_MAX, "%s/var/master-data", mysql_test_dir); + snprintf(slave_dir, PATH_MAX, "%s/var/slave-data", mysql_test_dir); + snprintf(lang_dir, PATH_MAX, "%s/sql/share/english", base_dir); + snprintf(char_dir, PATH_MAX, "%s/sql/share/charsets", base_dir); + +#ifdef HAVE_OPENSSL + use_openssl = TRUE; +#endif // HAVE_OPENSSL + + // OpenSSL paths + snprintf(ca_cert, PATH_MAX, "%s/SSL/cacert.pem", base_dir); + snprintf(server_cert, PATH_MAX, "%s/SSL/server-cert.pem", base_dir); + snprintf(server_key, PATH_MAX, "%s/SSL/server-key.pem", base_dir); + snprintf(client_cert, PATH_MAX, "%s/SSL/client-cert.pem", base_dir); + snprintf(client_key, PATH_MAX, "%s/SSL/client-key.pem", base_dir); + + // setup files + snprintf(mysqld_file, PATH_MAX, "%s/sql/mysqld", base_dir); + snprintf(mysqltest_file, PATH_MAX, "%s/mysqltest", bin_dir); + snprintf(mysqladmin_file, PATH_MAX, "%s/mysqladmin", bin_dir); + snprintf(master_pid, PATH_MAX, "%s/var/run/master.pid", mysql_test_dir); + snprintf(slave_pid, PATH_MAX, "%s/var/run/slave.pid", mysql_test_dir); + + snprintf(master_socket,PATH_MAX, "%s/var/tmp/master.sock", mysql_test_dir); + snprintf(slave_socket,PATH_MAX, "%s/var/tmp/slave.sock", mysql_test_dir); + +#endif + // create log file + snprintf(temp, PATH_MAX, "%s/mysql-test-run.log", mysql_test_dir); + if ((log_fd = fopen(temp, "w+")) == NULL) + { + log_errno("Unable to create log file."); + } + + // prepare skip test list + while((p = strchr(skip_test, ',')) != NULL) *p = ' '; + strcpy(temp, strlwr(skip_test)); + snprintf(skip_test, PATH_MAX, " %s ", temp); + + // environment +#ifdef __NETWARE__ + setenv("MYSQL_TEST_DIR", mysql_test_dir, 1); + snprintf(file_path, PATH_MAX*2, "%s/client/mysqldump --no-defaults -u root --port=%u", bin_dir, master_port); + setenv("MYSQL_DUMP", file_path, 1); + snprintf(file_path, PATH_MAX*2, "%s/client/mysqlbinlog --no-defaults --local-load=%s", bin_dir, mysql_tmp_dir); + setenv("MYSQL_BINLOG", file_path, 1); +#elif __WIN__ + snprintf(file_path,MAX_PATH,"MYSQL_TEST_DIR=%s",mysql_test_dir); + _putenv(file_path); + snprintf(file_path, PATH_MAX*2, "MYSQL_DUMP=%s/mysqldump.exe --no-defaults -u root --port=%u", bin_dir, master_port); + _putenv(file_path); + snprintf(file_path, PATH_MAX*2, "MYSQL_BINLOG=%s/mysqlbinlog.exe --no-defaults --local-load=%s", bin_dir, mysql_tmp_dir); + _putenv(file_path); +#else + setenv("MYSQL_TEST_DIR", mysql_test_dir, 1); + snprintf(file_path, PATH_MAX*2, "%s/mysqldump --no-defaults -u root --port=%u --socket=%s", bin_dir, master_port, master_socket); + setenv("MYSQL_DUMP", file_path, 1); + snprintf(file_path, PATH_MAX*2, "%s/mysqlbinlog --no-defaults --local-load=%s", bin_dir, mysql_tmp_dir); + setenv("MYSQL_BINLOG", file_path, 1); +#endif + +#ifndef __WIN__ + setenv("MASTER_MYPORT", "9306", 1); + setenv("SLAVE_MYPORT", "9307", 1); + setenv("MYSQL_TCP_PORT", "3306", 1); +#else + _putenv("MASTER_MYPORT=9306"); + _putenv("SLAVE_MYPORT=9307"); + _putenv("MYSQL_TCP_PORT=3306"); +#endif + +} + +/****************************************************************************** + + main() + +******************************************************************************/ +int main(int argc, char **argv) +{ + int is_ignore_list = 0; + // setup + setup(argv[0]); + + /* The --ignore option is comma saperated list of test cases to skip and + should be very first command line option to the test suite. + + The usage is now: + mysql_test_run --ignore=test1,test2 test3 test4 + where test1 and test2 are test cases to ignore + and test3 and test4 are test cases to run. + */ + if (argc >= 2 && !strnicmp(argv[1], "--ignore=", sizeof("--ignore=")-1)) + { + char *temp, *token; + temp= strdup(strchr(argv[1],'=') + 1); + for (token=str_tok(temp, ","); token != NULL; token=str_tok(NULL, ",")) + { + if (strlen(ignore_test) + strlen(token) + 2 <= PATH_MAX-1) + sprintf(ignore_test+strlen(ignore_test), " %s ", token); + else + { + free(temp); + die("ignore list too long."); + } + } + free(temp); + is_ignore_list = 1; + } + // header +#ifndef __WIN__ + mlog("MySQL Server %s, for %s (%s)\n\n", VERSION, SYSTEM_TYPE, MACHINE_TYPE); +#else + mlog("MySQL Server ---, for %s (%s)\n\n", SYSTEM_TYPE, MACHINE_TYPE); +#endif + + mlog("Initializing Tests...\n"); + + // install test databases + mysql_install_db(); + + mlog("Starting Tests...\n"); + + mlog("\n"); + mlog(HEADER); + mlog(DASH); + + if ( argc > 1 + is_ignore_list ) + { + int i; + + // single test + single_test = TRUE; + + for (i = 1 + is_ignore_list; i < argc; i++) + { + // run given test + run_test(argv[i]); + } + } + else + { + // run all tests +#ifndef __WIN__ + struct dirent **namelist; + int i,n; + char test[NAME_MAX]; + char *p; + int position; + + n = scandir(test_dir, &namelist, 0, alphasort); + if (n < 0) + die("Unable to open tests directory."); + else + { + for (i = 0; i < n; i++) + { + strcpy(test, strlwr(namelist[i]->d_name)); + // find the test suffix + if ((position = strinstr(test, TEST_SUFFIX)) != 0) + { + p = test + position - 1; + // null terminate at the suffix + *p = 0; + // run test + run_test(test); + } + free(namelist[n]); + } + free(namelist); + } +#else + struct _finddata_t dir; + intptr_t handle; + char test[NAME_MAX]; + char mask[PATH_MAX]; + char *p; + int position; + char **names = 0; + char **testes = 0; + int name_index; + int index; + + // single test + single_test = FALSE; + + snprintf(mask,MAX_PATH,"%s/*.test",test_dir); + + if ((handle=_findfirst(mask,&dir)) == -1L) + { + die("Unable to open tests directory."); + } + + names = malloc(MAX_COUNT_TESTES*4); + testes = names; + name_index = 0; + + do + { + if (!(dir.attrib & _A_SUBDIR)) + { + strcpy(test, strlwr(dir.name)); + + // find the test suffix + if ((position = strinstr(test, TEST_SUFFIX)) != 0) + { + p = test + position - 1; + // null terminate at the suffix + *p = 0; + + // insert test + *names = malloc(PATH_MAX); + strcpy(*names,test); + names++; + name_index++; + } + } + }while (_findnext(handle,&dir) == 0); + + _findclose(handle); + + qsort( (void *)testes, name_index, sizeof( char * ), compare ); + + for (index = 0; index <= name_index; index++) + { + run_test(testes[index]); + free(testes[index]); + } + + free(testes); +#endif + } + + // stop server + mysql_stop(); + + mlog(DASH); + mlog("\n"); + + mlog("Ending Tests...\n"); + + // report stats + report_stats(); + + // close log + if (log_fd) fclose(log_fd); + + // keep results up +#ifdef __NETWARE__ + pressanykey(); +#endif + return 0; +} + + +/* + Synopsis: + This function breaks the string into a sequence of tokens. The difference + between this function and strtok is that it respects the quoted string i.e. + it skips any delimiter character within the quoted part of the string. + It return tokens by eliminating quote character. It modifies the input string + passed. It will work with whitespace delimeter but may not work properly with + other delimeter. If the delimeter will contain any quote character, then + function will not tokenize and will return null string. + e.g. if input string is + --init-slave="set global max_connections=500" --skip-external-locking + then the output will two string i.e. + --init-slave=set global max_connections=500 + --skip-external-locking + +Arguments: + string: input string + delim: set of delimiter character +Output: + return the null terminated token of NULL. +*/ + + +char *str_tok(char *string, const char *delim) +{ + char *token; /* current token received from strtok */ + char *qt_token; /* token delimeted by the matching pair of quote */ + /* + if there are any quote chars found in the token then this variable + will hold the concatenated string to return to the caller + */ + char *ptr_token=NULL; + /* pointer to the quote character in the token from strtok */ + char *ptr_quote=NULL; + + /* See if the delimeter contains any quote character */ + if (strchr(delim,'\'') || strchr(delim,'\"')) + return NULL; + + /* repeate till we are getting some token from strtok */ + while ((token = (char*)strtok(string, delim) ) != NULL) + { + /* + make the input string NULL so that next time onward strtok can + be called with NULL input string. + */ + string = NULL; + /* + We don't need to remove any quote character for Windows version + */ +#ifndef __WIN__ + /* check if the current token contain double quote character*/ + if ((ptr_quote = (char*)strchr(token,'\"')) != NULL) + { + /* + get the matching the matching double quote in the remaining + input string + */ + qt_token = (char*)strtok(NULL,"\""); + } + /* check if the current token contain single quote character*/ + else if ((ptr_quote = (char*)strchr(token,'\'')) != NULL) + { + /* + get the matching the matching single quote in the remaining + input string + */ + qt_token = (char*)strtok(NULL,"\'"); + } +#endif + /* + if the current token does not contains any quote character then + return to the caller. + */ + if (ptr_quote == NULL) + { + /* + if there is any earlier token i.e. ptr_token then append the + current token in it and return it else return the current + token directly + */ + return ptr_token ? strcat(ptr_token,token) : token; + } + + /* + remove the quote character i.e. make NULL so that the token will + be devided in two part and later both part can be concatenated + and hence quote will be removed + */ + *ptr_quote= 0; + + /* check if ptr_token has been initialized or not */ + if (ptr_token == NULL) + { + /* initialize the ptr_token with current token */ + ptr_token= token; + /* copy entire string between matching pair of quote*/ + sprintf(ptr_token+strlen(ptr_token),"%s %s", ptr_quote+1, qt_token); + } + else + { + /* + copy the current token and entire string between matching pair + of quote + */ + if (qt_token == NULL) + { + sprintf(ptr_token+strlen(ptr_token),"%s%s", token, ptr_quote+1); + } + else + { + sprintf(ptr_token+strlen(ptr_token),"%s%s %s", token, ptr_quote+1, + qt_token ); + } + } + } + + /* return the concatenated token */ + return ptr_token; +} + +#ifndef __WIN__ + +/* + Synopsis: + This function run scripts files on Linux and Netware + +Arguments: + script_name: name of script file + +Output: + nothing +*/ +void run_init_script(const char *script_name) +{ + arg_list_t al; + int err; + + // args + init_args(&al); + add_arg(&al, sh_file); + add_arg(&al, script_name); + + // spawn + if ((err = spawn(sh_file, &al, TRUE, NULL, NULL, NULL, NULL)) != 0) + { + die("Unable to run script."); + } + + // free args + free_args(&al); +} +#endif diff --git a/mysql-test/r/fulltext.result b/mysql-test/r/fulltext.result index c86a379cccd..4d4b6eee9a4 100644 --- a/mysql-test/r/fulltext.result +++ b/mysql-test/r/fulltext.result @@ -352,9 +352,9 @@ t collation(t) aus Osnabrück utf8_general_ci SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('Osnabrueck'); t collation(t) -SELECT t, collation(t),MATCH t AGAINST ('Osnabruck') FROM t1 WHERE MATCH t AGAINST ('Osnabruck'); -t collation(t) MATCH t AGAINST ('Osnabruck') -aus Osnabrück utf8_general_ci 1.591139793396 +SELECT t, collation(t),FORMAT(MATCH t AGAINST ('Osnabruck'),6) FROM t1 WHERE MATCH t AGAINST ('Osnabruck'); +t collation(t) FORMAT(MATCH t AGAINST ('Osnabruck'),6) +aus Osnabrück utf8_general_ci 1.591140 alter table t1 modify t varchar(200) collate latin1_german2_ci not null; SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('Osnabrück'); t collation(t) diff --git a/mysql-test/r/fulltext_cache.result b/mysql-test/r/fulltext_cache.result index c489bdefeb8..4c210b8a3cb 100644 --- a/mysql-test/r/fulltext_cache.result +++ b/mysql-test/r/fulltext_cache.result @@ -21,17 +21,17 @@ INSERT INTO t2 VALUES (5,2,'um copo de Vodka'); INSERT INTO t2 VALUES (6,2,'um chocolate Snickers'); INSERT INTO t2 VALUES (7,1,'Bife'); INSERT INTO t2 VALUES (8,1,'Pizza de Salmao'); -SELECT t1.q, t2.item, t2.id, MATCH t2.item AGAINST ('sushi') +SELECT t1.q, t2.item, t2.id, FORMAT(MATCH t2.item AGAINST ('sushi'),6) as x FROM t1, t2 WHERE (t2.id2 = t1.id) ORDER BY x DESC,t2.id; q item id x -aaaaaaaaa dsaass de sushi 1 1.92378664016724 -aaaaaaaaa dsaass de Bolo de Chocolate 2 0 -aaaaaaaaa dsaass de Feijoada 3 0 -aaaaaaaaa dsaass de Mousse de Chocolate 4 0 -ssde df s fsda sad er um copo de Vodka 5 0 -ssde df s fsda sad er um chocolate Snickers 6 0 -aaaaaaaaa dsaass de Bife 7 0 -aaaaaaaaa dsaass de Pizza de Salmao 8 0 +aaaaaaaaa dsaass de sushi 1 1.923787 +aaaaaaaaa dsaass de Bolo de Chocolate 2 0.000000 +aaaaaaaaa dsaass de Feijoada 3 0.000000 +aaaaaaaaa dsaass de Mousse de Chocolate 4 0.000000 +ssde df s fsda sad er um copo de Vodka 5 0.000000 +ssde df s fsda sad er um chocolate Snickers 6 0.000000 +aaaaaaaaa dsaass de Bife 7 0.000000 +aaaaaaaaa dsaass de Pizza de Salmao 8 0.000000 SELECT t1.q, t2.item, t2.id, MATCH t2.item AGAINST ('sushi' IN BOOLEAN MODE) as x FROM t1, t2 WHERE (t2.id2 = t1.id) ORDER BY x DESC,t2.id; q item id x @@ -43,17 +43,17 @@ ssde df s fsda sad er um copo de Vodka 5 0 ssde df s fsda sad er um chocolate Snickers 6 0 aaaaaaaaa dsaass de Bife 7 0 aaaaaaaaa dsaass de Pizza de Salmao 8 0 -SELECT t1.q, t2.item, t2.id, MATCH t2.item AGAINST ('sushi') +SELECT t1.q, t2.item, t2.id, FORMAT(MATCH t2.item AGAINST ('sushi'),6) as x FROM t2, t1 WHERE (t2.id2 = t1.id) ORDER BY x DESC,t2.id; q item id x -aaaaaaaaa dsaass de sushi 1 1.92378664016724 -aaaaaaaaa dsaass de Bolo de Chocolate 2 0 -aaaaaaaaa dsaass de Feijoada 3 0 -aaaaaaaaa dsaass de Mousse de Chocolate 4 0 -ssde df s fsda sad er um copo de Vodka 5 0 -ssde df s fsda sad er um chocolate Snickers 6 0 -aaaaaaaaa dsaass de Bife 7 0 -aaaaaaaaa dsaass de Pizza de Salmao 8 0 +aaaaaaaaa dsaass de sushi 1 1.923787 +aaaaaaaaa dsaass de Bolo de Chocolate 2 0.000000 +aaaaaaaaa dsaass de Feijoada 3 0.000000 +aaaaaaaaa dsaass de Mousse de Chocolate 4 0.000000 +ssde df s fsda sad er um copo de Vodka 5 0.000000 +ssde df s fsda sad er um chocolate Snickers 6 0.000000 +aaaaaaaaa dsaass de Bife 7 0.000000 +aaaaaaaaa dsaass de Pizza de Salmao 8 0.000000 SELECT t1.q, t2.item, t2.id, MATCH t2.item AGAINST ('sushi' IN BOOLEAN MODE) as x FROM t2, t1 WHERE (t2.id2 = t1.id) ORDER BY x DESC,t2.id; q item id x diff --git a/mysql-test/r/fulltext_multi.result b/mysql-test/r/fulltext_multi.result index 968b00020e2..426b104ae89 100644 --- a/mysql-test/r/fulltext_multi.result +++ b/mysql-test/r/fulltext_multi.result @@ -11,19 +11,19 @@ FULLTEXT KEY a(b,c) INSERT INTO t1 VALUES (1,'lala lolo lili','oooo aaaa pppp'); INSERT INTO t1 VALUES (2,'asdf fdsa','lkjh fghj'); INSERT INTO t1 VALUES (3,'qpwoei','zmxnvb'); -SELECT a, MATCH b AGAINST ('lala lkjh') FROM t1; -a MATCH b AGAINST ('lala lkjh') -1 0.67003107070923 -2 0 -3 0 -SELECT a, MATCH c AGAINST ('lala lkjh') FROM t1; -a MATCH c AGAINST ('lala lkjh') -1 0 -2 0.67756325006485 -3 0 -SELECT a, MATCH b,c AGAINST ('lala lkjh') FROM t1; -a MATCH b,c AGAINST ('lala lkjh') -1 0.64840710163116 -2 0.66266459226608 -3 0 +SELECT a, FORMAT(MATCH b AGAINST ('lala lkjh'),6) FROM t1; +a FORMAT(MATCH b AGAINST ('lala lkjh'),6) +1 0.670031 +2 0.000000 +3 0.000000 +SELECT a, FORMAT(MATCH c AGAINST ('lala lkjh'),6) FROM t1; +a FORMAT(MATCH c AGAINST ('lala lkjh'),6) +1 0.000000 +2 0.677563 +3 0.000000 +SELECT a, FORMAT(MATCH b,c AGAINST ('lala lkjh'),6) FROM t1; +a FORMAT(MATCH b,c AGAINST ('lala lkjh'),6) +1 0.648407 +2 0.662665 +3 0.000000 drop table t1; diff --git a/mysql-test/r/fulltext_order_by.result b/mysql-test/r/fulltext_order_by.result index bfee9eba280..c6c42fa2e8b 100644 --- a/mysql-test/r/fulltext_order_by.result +++ b/mysql-test/r/fulltext_order_by.result @@ -6,53 +6,53 @@ FULLTEXT(message) ) comment = 'original testcase by sroussey@network54.com'; INSERT INTO t1 (message) VALUES ("Testing"),("table"),("testbug"), ("steve"),("is"),("cool"),("steve is cool"); -SELECT a, MATCH (message) AGAINST ('steve') FROM t1 WHERE MATCH (message) AGAINST ('steve'); -a MATCH (message) AGAINST ('steve') -4 0.90587323904037 -7 0.89568990468979 +SELECT a, FORMAT(MATCH (message) AGAINST ('steve'),6) FROM t1 WHERE MATCH (message) AGAINST ('steve'); +a FORMAT(MATCH (message) AGAINST ('steve'),6) +4 0.905873 +7 0.895690 SELECT a, MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) FROM t1 WHERE MATCH (message) AGAINST ('steve'); a MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) 4 1 7 1 -SELECT a, MATCH (message) AGAINST ('steve') FROM t1 WHERE MATCH (message) AGAINST ('steve' IN BOOLEAN MODE); -a MATCH (message) AGAINST ('steve') -4 0.90587323904037 -7 0.89568990468979 +SELECT a, FORMAT(MATCH (message) AGAINST ('steve'),6) FROM t1 WHERE MATCH (message) AGAINST ('steve' IN BOOLEAN MODE); +a FORMAT(MATCH (message) AGAINST ('steve'),6) +4 0.905873 +7 0.895690 SELECT a, MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) FROM t1 WHERE MATCH (message) AGAINST ('steve' IN BOOLEAN MODE); a MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) 4 1 7 1 -SELECT a, MATCH (message) AGAINST ('steve') FROM t1 WHERE MATCH (message) AGAINST ('steve') ORDER BY a; -a MATCH (message) AGAINST ('steve') -4 0.90587323904037 -7 0.89568990468979 +SELECT a, FORMAT(MATCH (message) AGAINST ('steve'),6) FROM t1 WHERE MATCH (message) AGAINST ('steve') ORDER BY a; +a FORMAT(MATCH (message) AGAINST ('steve'),6) +4 0.905873 +7 0.895690 SELECT a, MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) FROM t1 WHERE MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) ORDER BY a; a MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) 4 1 7 1 -SELECT a, MATCH (message) AGAINST ('steve') FROM t1 WHERE a in (2,7,4) and MATCH (message) AGAINST ('steve') ORDER BY a DESC; -a MATCH (message) AGAINST ('steve') -7 0.89568990468979 -4 0.90587323904037 +SELECT a, FORMAT(MATCH (message) AGAINST ('steve'),6) FROM t1 WHERE a in (2,7,4) and MATCH (message) AGAINST ('steve') ORDER BY a DESC; +a FORMAT(MATCH (message) AGAINST ('steve'),6) +7 0.895690 +4 0.905873 SELECT a, MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) FROM t1 WHERE a in (2,7,4) and MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) ORDER BY a DESC; a MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) 7 1 4 1 -SELECT a, MATCH (message) AGAINST ('steve') FROM t1 WHERE a=7 and MATCH (message) AGAINST ('steve') ORDER BY 1; -a MATCH (message) AGAINST ('steve') -7 0.89568990468979 +SELECT a, FORMAT(MATCH (message) AGAINST ('steve'),6) FROM t1 WHERE a=7 and MATCH (message) AGAINST ('steve') ORDER BY 1; +a FORMAT(MATCH (message) AGAINST ('steve'),6) +7 0.895690 SELECT a, MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) FROM t1 WHERE a=7 and MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) ORDER BY 1; a MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) 7 1 -SELECT a, MATCH (message) AGAINST ('steve') as rel FROM t1 ORDER BY rel; +SELECT a, FORMAT(MATCH (message) AGAINST ('steve'),6) as rel FROM t1 ORDER BY rel; a rel -1 0 -2 0 -3 0 -5 0 -6 0 -7 0.89568990468979 -4 0.90587323904037 +1 0.000000 +2 0.000000 +3 0.000000 +5 0.000000 +6 0.000000 +7 0.895690 +4 0.905873 SELECT a, MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) as rel FROM t1 ORDER BY rel; a rel 1 0 diff --git a/mysql-test/r/type_float.result b/mysql-test/r/type_float.result index 30de1e62df7..38845fd08ca 100644 --- a/mysql-test/r/type_float.result +++ b/mysql-test/r/type_float.result @@ -22,14 +22,14 @@ select * from t1; f1 f2 10 10 100000 100000 -1.23457e+09 1234567890 +1.23457e+9 1234567890 1e+10 10000000000 1e+15 1e+15 1e+20 1e+20 3.40282e+38 1e+50 3.40282e+38 1e+150 -10 -10 -1e-05 1e-05 +1e-5 1e-5 1e-10 1e-10 1e-15 1e-15 1e-20 1e-20 diff --git a/mysql-test/t/fulltext.test b/mysql-test/t/fulltext.test index 66df5b1cb92..13722d9732a 100644 --- a/mysql-test/t/fulltext.test +++ b/mysql-test/t/fulltext.test @@ -272,7 +272,7 @@ SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('Osnabr SET NAMES latin1; SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('Osnabrück'); SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('Osnabrueck'); -SELECT t, collation(t),MATCH t AGAINST ('Osnabruck') FROM t1 WHERE MATCH t AGAINST ('Osnabruck'); +SELECT t, collation(t),FORMAT(MATCH t AGAINST ('Osnabruck'),6) FROM t1 WHERE MATCH t AGAINST ('Osnabruck'); #alter table t1 modify t text character set latin1 collate latin1_german2_ci not null; alter table t1 modify t varchar(200) collate latin1_german2_ci not null; SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('Osnabrück'); diff --git a/mysql-test/t/fulltext_cache.test b/mysql-test/t/fulltext_cache.test index 15f32fdb5a0..e8c2b4a7f74 100644 --- a/mysql-test/t/fulltext_cache.test +++ b/mysql-test/t/fulltext_cache.test @@ -29,13 +29,13 @@ INSERT INTO t2 VALUES (6,2,'um chocolate Snickers'); INSERT INTO t2 VALUES (7,1,'Bife'); INSERT INTO t2 VALUES (8,1,'Pizza de Salmao'); -SELECT t1.q, t2.item, t2.id, MATCH t2.item AGAINST ('sushi') +SELECT t1.q, t2.item, t2.id, FORMAT(MATCH t2.item AGAINST ('sushi'),6) as x FROM t1, t2 WHERE (t2.id2 = t1.id) ORDER BY x DESC,t2.id; SELECT t1.q, t2.item, t2.id, MATCH t2.item AGAINST ('sushi' IN BOOLEAN MODE) as x FROM t1, t2 WHERE (t2.id2 = t1.id) ORDER BY x DESC,t2.id; -SELECT t1.q, t2.item, t2.id, MATCH t2.item AGAINST ('sushi') +SELECT t1.q, t2.item, t2.id, FORMAT(MATCH t2.item AGAINST ('sushi'),6) as x FROM t2, t1 WHERE (t2.id2 = t1.id) ORDER BY x DESC,t2.id; SELECT t1.q, t2.item, t2.id, MATCH t2.item AGAINST ('sushi' IN BOOLEAN MODE) diff --git a/mysql-test/t/fulltext_multi.test b/mysql-test/t/fulltext_multi.test index c312a5938b2..437ce96794b 100644 --- a/mysql-test/t/fulltext_multi.test +++ b/mysql-test/t/fulltext_multi.test @@ -17,7 +17,7 @@ INSERT INTO t1 VALUES (1,'lala lolo lili','oooo aaaa pppp'); INSERT INTO t1 VALUES (2,'asdf fdsa','lkjh fghj'); INSERT INTO t1 VALUES (3,'qpwoei','zmxnvb'); -SELECT a, MATCH b AGAINST ('lala lkjh') FROM t1; -SELECT a, MATCH c AGAINST ('lala lkjh') FROM t1; -SELECT a, MATCH b,c AGAINST ('lala lkjh') FROM t1; +SELECT a, FORMAT(MATCH b AGAINST ('lala lkjh'),6) FROM t1; +SELECT a, FORMAT(MATCH c AGAINST ('lala lkjh'),6) FROM t1; +SELECT a, FORMAT(MATCH b,c AGAINST ('lala lkjh'),6) FROM t1; drop table t1; diff --git a/mysql-test/t/fulltext_order_by.test b/mysql-test/t/fulltext_order_by.test index f8afe49d95d..5856f68ec9e 100644 --- a/mysql-test/t/fulltext_order_by.test +++ b/mysql-test/t/fulltext_order_by.test @@ -10,25 +10,25 @@ CREATE TABLE t1 ( INSERT INTO t1 (message) VALUES ("Testing"),("table"),("testbug"), ("steve"),("is"),("cool"),("steve is cool"); # basic MATCH -SELECT a, MATCH (message) AGAINST ('steve') FROM t1 WHERE MATCH (message) AGAINST ('steve'); +SELECT a, FORMAT(MATCH (message) AGAINST ('steve'),6) FROM t1 WHERE MATCH (message) AGAINST ('steve'); SELECT a, MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) FROM t1 WHERE MATCH (message) AGAINST ('steve'); -SELECT a, MATCH (message) AGAINST ('steve') FROM t1 WHERE MATCH (message) AGAINST ('steve' IN BOOLEAN MODE); +SELECT a, FORMAT(MATCH (message) AGAINST ('steve'),6) FROM t1 WHERE MATCH (message) AGAINST ('steve' IN BOOLEAN MODE); SELECT a, MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) FROM t1 WHERE MATCH (message) AGAINST ('steve' IN BOOLEAN MODE); # MATCH + ORDER BY (with ft-ranges) -SELECT a, MATCH (message) AGAINST ('steve') FROM t1 WHERE MATCH (message) AGAINST ('steve') ORDER BY a; +SELECT a, FORMAT(MATCH (message) AGAINST ('steve'),6) FROM t1 WHERE MATCH (message) AGAINST ('steve') ORDER BY a; SELECT a, MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) FROM t1 WHERE MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) ORDER BY a; # MATCH + ORDER BY (with normal ranges) + UNIQUE -SELECT a, MATCH (message) AGAINST ('steve') FROM t1 WHERE a in (2,7,4) and MATCH (message) AGAINST ('steve') ORDER BY a DESC; +SELECT a, FORMAT(MATCH (message) AGAINST ('steve'),6) FROM t1 WHERE a in (2,7,4) and MATCH (message) AGAINST ('steve') ORDER BY a DESC; SELECT a, MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) FROM t1 WHERE a in (2,7,4) and MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) ORDER BY a DESC; # MATCH + ORDER BY + UNIQUE (const_table) -SELECT a, MATCH (message) AGAINST ('steve') FROM t1 WHERE a=7 and MATCH (message) AGAINST ('steve') ORDER BY 1; +SELECT a, FORMAT(MATCH (message) AGAINST ('steve'),6) FROM t1 WHERE a=7 and MATCH (message) AGAINST ('steve') ORDER BY 1; SELECT a, MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) FROM t1 WHERE a=7 and MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) ORDER BY 1; # ORDER BY MATCH -SELECT a, MATCH (message) AGAINST ('steve') as rel FROM t1 ORDER BY rel; +SELECT a, FORMAT(MATCH (message) AGAINST ('steve'),6) as rel FROM t1 ORDER BY rel; SELECT a, MATCH (message) AGAINST ('steve' IN BOOLEAN MODE) as rel FROM t1 ORDER BY rel; drop table t1; diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test index e0cc96ccb32..162e44c35ea 100644 --- a/mysql-test/t/innodb.test +++ b/mysql-test/t/innodb.test @@ -1093,6 +1093,7 @@ show create table t2; drop table t2; # Test error handling +--replace_result \\ / --error 1005 create table t2 (id int(11) not null, id2 int(11) not null, constraint t1_id_fk foreign key (id2,id) references t1 (id)) engine = innodb; diff --git a/mysql-test/t/insert.test b/mysql-test/t/insert.test index fd728c453aa..b03b77f0be8 100644 --- a/mysql-test/t/insert.test +++ b/mysql-test/t/insert.test @@ -97,46 +97,57 @@ create table t1(number int auto_increment primary key, original_value varchar(50 set @value= "aa"; insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value); +--replace_result e-0 e- e+0 e+ --query_vertical select * from t1 where number =last_insert_id() set @value= "1aa"; insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value); +--replace_result e-0 e- e+0 e+ --query_vertical select * from t1 where number =last_insert_id() set @value= "aa1"; insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value); +--replace_result e-0 e- e+0 e+ --query_vertical select * from t1 where number =last_insert_id() set @value= "1e+1111111111a"; insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value); +--replace_result e-0 e- e+0 e+ --query_vertical select * from t1 where number =last_insert_id() set @value= "-1e+1111111111a"; insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value); +--replace_result e-0 e- e+0 e+ --query_vertical select * from t1 where number =last_insert_id() set @value= 1e+1111111111; insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value); +--replace_result e-0 e- e+0 e+ --query_vertical select * from t1 where number =last_insert_id() set @value= -1e+1111111111; insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value); +--replace_result e-0 e- e+0 e+ --query_vertical select * from t1 where number =last_insert_id() set @value= 1e+111; insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value); +--replace_result e-0 e- e+0 e+ --query_vertical select * from t1 where number =last_insert_id() set @value= -1e+111; insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value); +--replace_result e-0 e- e+0 e+ --query_vertical select * from t1 where number =last_insert_id() set @value= 1; insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value); +--replace_result e-0 e- e+0 e+ --query_vertical select * from t1 where number =last_insert_id() set @value= -1; insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value); +--replace_result e-0 e- e+0 e+ --query_vertical select * from t1 where number =last_insert_id() drop table t1; diff --git a/mysql-test/t/type_float.test b/mysql-test/t/type_float.test index d3ddecfc314..6497525424e 100644 --- a/mysql-test/t/type_float.test +++ b/mysql-test/t/type_float.test @@ -6,7 +6,9 @@ drop table if exists t1; --enable_warnings +--replace_result e-0 e- e+0 e+ SELECT 10,10.0,10.,.1e+2,100.0e-1; +--replace_result e-00 e-0 SELECT 6e-05, -6e-05, --6e-05, -6e-05+1.000000; SELECT 1e1,1.e1,1.0e1,1e+1,1.e+1,1.0e+1,1e-1,1.e-1,1.0e-1; @@ -14,6 +16,7 @@ create table t1 (f1 float(24),f2 float(52)); show full columns from t1; insert into t1 values(10,10),(1e+5,1e+5),(1234567890,1234567890),(1e+10,1e+10),(1e+15,1e+15),(1e+20,1e+20),(1e+50,1e+50),(1e+150,1e+150); insert into t1 values(-10,-10),(1e-5,1e-5),(1e-10,1e-10),(1e-15,1e-15),(1e-20,1e-20),(1e-50,1e-50),(1e-150,1e-150); +--replace_result e-0 e- e+0 e+ select * from t1; drop table t1; diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test index 60ebeb045f5..eec08a7a776 100644 --- a/mysql-test/t/variables.test +++ b/mysql-test/t/variables.test @@ -8,6 +8,7 @@ drop table if exists t1,t2; set @`test`=1,@TEST=3,@select=2,@t5=1.23456; select @test,@`select`,@TEST,@not_used; set @test_int=10,@test_double=1e-10,@test_string="abcdeghi",@test_string2="abcdefghij",@select=NULL; +--replace_result e-0 e- e+0 e+ select @test_int,@test_double,@test_string,@test_string2,@select; set @test_int="hello",@test_double="hello",@test_string="hello",@test_string2="hello"; select @test_int,@test_double,@test_string,@test_string2; From 6722d12c6848efd267821ea2345afcc8944d5c1c Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 26 Sep 2004 17:16:40 +0500 Subject: [PATCH 0007/1063] Fix to compile sql/examples content in embedded server libmysqld/Makefile.am: Commands to compile sql/examples content in libmysqld added --- libmysqld/Makefile.am | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/libmysqld/Makefile.am b/libmysqld/Makefile.am index 75a5ef7ff91..ba30a41c32b 100644 --- a/libmysqld/Makefile.am +++ b/libmysqld/Makefile.am @@ -26,7 +26,7 @@ DEFS = -DEMBEDDED_LIBRARY -DMYSQL_SERVER \ -DDATADIR="\"$(MYSQLDATAdir)\"" \ -DSHAREDIR="\"$(MYSQLSHAREdir)\"" INCLUDES= @MT_INCLUDES@ @bdb_includes@ -I$(top_srcdir)/include \ - -I$(top_srcdir)/sql -I$(top_srcdir)/regex \ + -I$(top_srcdir)/sql -I$(top_srcdir)/sql/examples -I$(top_srcdir)/regex \ $(openssl_includes) @ZLIB_INCLUDES@ noinst_LIBRARIES = libmysqld_int.a @@ -35,6 +35,7 @@ SUBDIRS = . examples libmysqld_sources= libmysqld.c lib_sql.cc emb_qcache.cc libmysqlsources = errmsg.c get_password.c libmysql.c client.c pack.c \ my_time.c +sqlexamplessources = ha_example.cc ha_archive.cc ha_tina.cc noinst_HEADERS = embedded_priv.h emb_qcache.h @@ -59,7 +60,7 @@ sqlsources = derror.cc field.cc field_conv.cc strfunc.cc filesort.cc \ unireg.cc uniques.cc stacktrace.c sql_union.cc hash_filo.cc \ spatial.cc gstream.cc sql_help.cc tztime.cc -libmysqld_int_a_SOURCES= $(libmysqld_sources) $(libmysqlsources) $(sqlsources) +libmysqld_int_a_SOURCES= $(libmysqld_sources) $(libmysqlsources) $(sqlsources) $(sqlexamplessources) libmysqld_a_SOURCES= # automake misses these @@ -123,12 +124,16 @@ link_sources: rm -f $(srcdir)/$$f; \ @LN_CP_F@ $(srcdir)/../libmysql/$$f $(srcdir)/$$f; \ done; \ + for f in $(sqlexamplessources); do \ + rm -f $(srcdir)/$$f; \ + @LN_CP_F@ $(srcdir)/../sql/examples/$$f $(srcdir)/$$f; \ + done; \ rm -f $(srcdir)/client_settings.h; \ @LN_CP_F@ $(srcdir)/../libmysql/client_settings.h $(srcdir)/client_settings.h; clean-local: - rm -f `echo $(sqlsources) $(libmysqlsources) | sed "s;\.lo;.c;g"` \ + rm -f `echo $(sqlsources) $(libmysqlsources) $(sqlexamplessources) | sed "s;\.lo;.c;g"` \ $(top_srcdir)/linked_libmysqld_sources; \ rm -f client_settings.h From 612c83b845822e13a6653af3985c4e3395cb8259 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 12 Oct 2004 18:21:25 +0400 Subject: [PATCH 0008/1063] Fix for bug#5138 continued: added comments, removed extra debug printf calls, changed ha_heap::records_in_range to use table->rec_per_key. heap/hp_block.c: Fix for bug#5138 continued: Added comments. heap/hp_delete.c: Fix for bug#5138 continued: Added comments. heap/hp_write.c: Fix for bug#5138 continued: Added comments, removed unneeded printf include/heap.h: Fix for bug#5138 continued: Added comments. mysql-test/r/heap_hash.result: Fix for bug#5138 continued: added FLUSH TABLES and rec_per_key estimates tests, updated test results mysql-test/t/heap_hash.test: Fix for bug#5138 continued: added FLUSH TABLES and rec_per_key estimates tests, updated test results sql/ha_heap.cc: Fix for bug#5138 continued: fixed comments to be correct removed unneded printf use TABLE::rec_per_key for records_in_range statistics --- heap/hp_block.c | 51 ++++++++++++++++-- heap/hp_delete.c | 4 +- heap/hp_write.c | 99 +++++++++++++++++++++++++++-------- include/heap.h | 44 +++++++++++++--- mysql-test/r/heap_hash.result | 34 ++++++++---- mysql-test/t/heap_hash.test | 18 +++++-- sql/ha_heap.cc | 19 ++++--- 7 files changed, 209 insertions(+), 60 deletions(-) diff --git a/heap/hp_block.c b/heap/hp_block.c index 6a022fb3084..f26b208b521 100644 --- a/heap/hp_block.c +++ b/heap/hp_block.c @@ -18,12 +18,19 @@ #include "heapdef.h" - /* Find record according to record-position */ +/* + Find record according to record-position. + + The record is located by factoring position number pos into (p_0, p_1, ...) + such that + pos = SUM_i(block->level_info[i].records_under_level * p_i) + {p_0, p_1, ...} serve as indexes to descend the blocks tree. +*/ byte *hp_find_block(HP_BLOCK *block, ulong pos) { reg1 int i; - reg3 HP_PTRS *ptr; + reg3 HP_PTRS *ptr; /* block base ptr */ for (i=block->levels-1, ptr=block->root ; i > 0 ; i--) { @@ -34,8 +41,18 @@ byte *hp_find_block(HP_BLOCK *block, ulong pos) } - /* get one new block-of-records. Alloc ptr to block if neaded */ - /* Interrupts are stopped to allow ha_panic in interrupts */ +/* + Get one new block-of-records. Alloc ptr to block if needed + SYNOPSIS + hp_get_new_block() + block HP_BLOCK tree-like block + alloc_length OUT Amount of memory allocated from the heap + + Interrupts are stopped to allow ha_panic in interrupts + RETURN + 0 OK + 1 Out of memory +*/ int hp_get_new_block(HP_BLOCK *block, ulong *alloc_length) { @@ -46,6 +63,18 @@ int hp_get_new_block(HP_BLOCK *block, ulong *alloc_length) if (block->level_info[i].free_ptrs_in_block) break; + /* + Allocate space for leaf block plus space for upper level blocks up to + first level that has a free slot to put the pointer. + In some cases we actually allocate more then we need: + Consider e.g. a situation where we have one level 1 block and one level 0 + block, the level 0 block is full and this function is called. We only + need a leaf block in this case. Nevertheless, we will get here with i=1 + and will also allocate sizeof(HP_PTRS) for non-leaf block and will never + use this space. + This doesn't add much overhead - with current values of sizeof(HP_PTRS) + and my_default_record_cache_size we get about 1/128 unused memory. + */ *alloc_length=sizeof(HP_PTRS)*i+block->records_in_block* block->recbuffer; if (!(root=(HP_PTRS*) my_malloc(*alloc_length,MYF(0)))) return 1; @@ -60,21 +89,33 @@ int hp_get_new_block(HP_BLOCK *block, ulong *alloc_length) dont_break(); /* Dont allow SIGHUP or SIGINT */ if ((uint) i == block->levels) { + /* Adding a new level on top of the existing ones. */ block->levels=i+1; + /* + Use first allocated HP_PTRS as a top-level block. Put the current + block tree into the first slot of a new top-level block. + */ block->level_info[i].free_ptrs_in_block=HP_PTRS_IN_NOD-1; ((HP_PTRS**) root)[0]= block->root; block->root=block->level_info[i].last_blocks= root++; } + /* Occupy the free slot we've found at level i */ block->level_info[i].last_blocks-> blocks[HP_PTRS_IN_NOD - block->level_info[i].free_ptrs_in_block--]= (byte*) root; - + + /* Add a block subtree with each node having one left-most child */ for (j=i-1 ; j >0 ; j--) { block->level_info[j].last_blocks= root++; block->level_info[j].last_blocks->blocks[0]=(byte*) root; block->level_info[j].free_ptrs_in_block=HP_PTRS_IN_NOD-1; } + + /* + root now points to last (block->records_in_block* block->recbuffer) + allocated bytes. Use it as a leaf block. + */ block->level_info[0].last_blocks= root; allow_break(); /* Allow SIGHUP & SIGINT */ } diff --git a/heap/hp_delete.c b/heap/hp_delete.c index a89fe49f495..9cf8b8936b6 100644 --- a/heap/hp_delete.c +++ b/heap/hp_delete.c @@ -97,8 +97,8 @@ int hp_rb_delete_key(HP_INFO *info, register HP_KEYDEF *keyinfo, flag Is set if we want's to correct info->current_ptr RETURN - 0 ok - # error number + 0 Ok + other Error code */ int hp_delete_key(HP_INFO *info, register HP_KEYDEF *keyinfo, diff --git a/heap/hp_write.c b/heap/hp_write.c index 853360976bf..43cee67b39c 100644 --- a/heap/hp_write.c +++ b/heap/hp_write.c @@ -36,7 +36,6 @@ int heap_write(HP_INFO *info, const byte *record) byte *pos; HP_SHARE *share=info->s; DBUG_ENTER("heap_write"); - printf("heap_write\n"); #ifndef DBUG_OFF if (info->mode & O_RDONLY) { @@ -160,7 +159,31 @@ static byte *next_free_record_pos(HP_SHARE *info) block_pos*info->block.recbuffer); } - /* Write a hash-key to the hash-index */ + +/* + Write a hash-key to the hash-index + SYNOPSIS + info Heap table info + keyinfo Key info + record Table record to added + recpos Memory buffer where the table record will be stored if added + successfully + NOTE + Hash index uses HP_BLOCK structure as a 'growable array' of HASH_INFO + structs. Array size == number of entries in hash index. + hp_mask(hp_rec_hashnr()) maps hash entries values to hash array positions. + If there are several hash entries with the same hash array position P, + they are connected in a linked list via HASH_INFO::next_key. The first + list element is located at position P, next elements are located at + positions for which there is no record that should be located at that + position. The order of elements in the list is arbitrary. + + RETURN + 0 - OK + -1 - Out of memory + HA_ERR_FOUND_DUPP_KEY - Duplicate record on unique key. The record was + still added and the caller must call hp_delete_key for it. +*/ int hp_write_key(HP_INFO *info, HP_KEYDEF *keyinfo, const byte *record, byte *recpos) @@ -182,33 +205,52 @@ int hp_write_key(HP_INFO *info, HP_KEYDEF *keyinfo, pos= hp_find_hash(&keyinfo->block,(first_index=share->records-halfbuff)); /* - We're about to add one more hash position, with hash_mask=#records. - Entries that should be relocated to that position are currently members - of the list that starts at #first_index position. - At #first_index position there may be either: - a) A list of items with hash_mask=first_index. The list contains - 1) entries that should be relocated to the list that starts at new - position we're adding - 2) entries that should be left in the list starting at #first_index - position + We're about to add one more hash array position, with hash_mask=#records. + The number of hash positions will change and some entries might need to + be relocated to the newly added position. Those entries are currently + members of the list that starts at #first_index position (this is + guaranteed by properties of hp_mask(hp_rec_hashnr(X)) mapping function) + At #first_index position currently there may be either: + a) An entry with hashnr != first_index. We don't need to move it. or - b) An entry with hashnr != first_index. We don't need to move it. + b) A list of items with hash_mask=first_index. The list contains entries + of 2 types: + 1) entries that should be relocated to the list that starts at new + position we're adding ('uppper' list) + 2) entries that should be left in the list starting at #first_index + position ('lower' list) */ if (pos != empty) /* If some records */ { do { hashnr = hp_rec_hashnr(keyinfo, pos->ptr_to_rec); - if (flag == 0) /* First loop; Check if ok */ + if (flag == 0) { - /* Bail out if we're dealing with case b) from above comment */ + /* + First loop, bail out if we're dealing with case a) from above + comment + */ if (hp_mask(hashnr, share->blength, share->records) != first_index) break; } + /* + flag & LOWFIND - found a record that should be put into lower position + flag & LOWUSED - lower position occupied by the record + Same for HIGHFIND and HIGHUSED and 'upper' position + + gpos - ptr to last element in lower position's list + gpos2 - ptr to last element in upper position's list + + ptr_to_rec - ptr to last entry that should go into lower list. + ptr_to_rec2 - same for upper list. + */ if (!(hashnr & halfbuff)) - { /* Key will not move */ + { + /* Key should be put into 'lower' list */ if (!(flag & LOWFIND)) { + /* key is the first element to go into lower position */ if (flag & HIGHFIND) { flag=LOWFIND | HIGHFIND; @@ -219,16 +261,21 @@ int hp_write_key(HP_INFO *info, HP_KEYDEF *keyinfo, } else { - flag=LOWFIND | LOWUSED; /* key isn't changed */ + /* + We can only get here at first iteration: key is at 'lower' + position pos and should be left here. + */ + flag=LOWFIND | LOWUSED; gpos=pos; ptr_to_rec=pos->ptr_to_rec; } } else - { + { + /* Already have another key for lower position */ if (!(flag & LOWUSED)) { - /* Change link of previous LOW-key */ + /* Change link of previous lower-list key */ gpos->ptr_to_rec=ptr_to_rec; gpos->next_key=pos; flag= (flag & HIGHFIND) | (LOWFIND | LOWUSED); @@ -238,19 +285,21 @@ int hp_write_key(HP_INFO *info, HP_KEYDEF *keyinfo, } } else - { /* key will be moved */ + { + /* key will be put into 'higher' list */ if (!(flag & HIGHFIND)) { flag= (flag & LOWFIND) | HIGHFIND; /* key shall be moved to the last (empty) position */ - gpos2 = empty; empty=pos; + gpos2= empty; + empty= pos; ptr_to_rec2=pos->ptr_to_rec; } else { if (!(flag & HIGHUSED)) { - /* Change link of previous hash-key and save */ + /* Change link of previous upper-list key and save */ gpos2->ptr_to_rec=ptr_to_rec2; gpos2->next_key=pos; flag= (flag & LOWFIND) | (HIGHFIND | HIGHUSED); @@ -262,8 +311,14 @@ int hp_write_key(HP_INFO *info, HP_KEYDEF *keyinfo, } while ((pos=pos->next_key)); - if ((flag & (LOWFIND | HIGHFIND)) == (LOWFIND | HIGHFIND)) + if ((flag & (LOWFIND | HIGHFIND)) == (LOWFIND | HIGHFIND)) + { + /* + If both 'higher' and 'lower' list have at least one element, now + there are two hash buckets instead of one. + */ keyinfo->hash_buckets++; + } if ((flag & (LOWFIND | LOWUSED)) == LOWFIND) { diff --git a/include/heap.h b/include/heap.h index e3e7f228421..5e83a6e2cb5 100644 --- a/include/heap.h +++ b/include/heap.h @@ -63,18 +63,48 @@ typedef struct st_heap_ptrs struct st_level_info { - uint free_ptrs_in_block,records_under_level; - HP_PTRS *last_blocks; /* pointers to HP_PTRS or records */ + /* Number of unused slots in *last_blocks HP_PTRS block (0 for 0th level) */ + uint free_ptrs_in_block; + + /* + Maximum number of records that can be 'contained' inside of each element + of last_blocks array. For level 0 - 1, for level 1 - HP_PTRS_IN_NOD, for + level 2 - HP_PTRS_IN_NOD^2 and so forth. + */ + uint records_under_level; + + /* + Ptr to last allocated HP_PTRS (or records buffer for level 0) on this + level. + */ + HP_PTRS *last_blocks; }; -typedef struct st_heap_block /* The data is saved in blocks */ + +/* + Heap table records and hash index entries are stored in HP_BLOCKs. + HP_BLOCK is used as a 'growable array' of fixed-size records. Size of record + is recbuffer bytes. + The internal representation is as follows: + HP_BLOCK is a hierarchical structure of 'blocks'. + A block at level 0 is an array records_in_block records. + A block at higher level is an HP_PTRS structure with pointers to blocks at + lower levels. + At the highest level there is one top block. It is stored in HP_BLOCK::root. + + See hp_find_block for a description of how record pointer is obtained from + its index. + See hp_get_new_block +*/ + +typedef struct st_heap_block { - HP_PTRS *root; + HP_PTRS *root; /* Top-level block */ struct st_level_info level_info[HP_MAX_LEVELS+1]; - uint levels; - uint records_in_block; /* Records in a heap-block */ + uint levels; /* number of used levels */ + uint records_in_block; /* Records in one heap-block */ uint recbuffer; /* Length of one saved record */ - ulong last_allocated; /* Blocks allocated, used by keys */ + ulong last_allocated; /* number of records there is allocated space for */ } HP_BLOCK; struct st_heap_info; /* For referense */ diff --git a/mysql-test/r/heap_hash.result b/mysql-test/r/heap_hash.result index 29287b23745..4f5de197858 100644 --- a/mysql-test/r/heap_hash.result +++ b/mysql-test/r/heap_hash.result @@ -233,6 +233,19 @@ id select_type table type possible_keys key key_len ref rows Extra insert into t1 select * from t1; explain select * from t1 where a='aaaa'; id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref a a 8 const 1 Using where +explain select * from t1 where a='aaab'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref a a 8 const 1 Using where +explain select * from t1 where a='aaac'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref a a 8 const 1 Using where +explain select * from t1 where a='aaad'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref a a 8 const 1 Using where +flush tables; +explain select * from t1 where a='aaaa'; +id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ref a a 8 const 2 Using where explain select * from t1 where a='aaab'; id select_type table type possible_keys key key_len ref rows Extra @@ -248,16 +261,16 @@ delete from t1; insert into t1 select * from t2; explain select * from t1 where a='aaaa'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref a a 8 const 2 Using where +1 SIMPLE t1 ref a a 8 const 1 Using where explain select * from t1 where a='aaab'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref a a 8 const 2 Using where +1 SIMPLE t1 ref a a 8 const 1 Using where explain select * from t1 where a='aaac'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref a a 8 const 2 Using where +1 SIMPLE t1 ref a a 8 const 1 Using where explain select * from t1 where a='aaad'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref a a 8 const 2 Using where +1 SIMPLE t1 ref a a 8 const 1 Using where drop table t1, t2; create table t1 ( id int unsigned not null primary key auto_increment, @@ -305,6 +318,7 @@ insert into t1 (name) select name from t2; insert into t1 (name) select name from t2; insert into t1 (name) select name from t2; insert into t1 (name) select name from t2; +flush tables; select count(*) from t1 where name='Matt'; count(*) 7 @@ -314,9 +328,8 @@ id select_type table type possible_keys key key_len ref rows Extra show index from t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment t1 0 PRIMARY 1 id NULL 91 NULL NULL HASH -t1 1 heap_idx 1 name NULL 15 NULL NULL HASH +t1 1 heap_idx 1 name NULL 13 NULL NULL HASH t1 1 btree_idx 1 name A NULL NULL NULL BTREE -flush tables; show index from t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment t1 0 PRIMARY 1 id NULL 91 NULL NULL HASH @@ -333,9 +346,12 @@ show index from t3; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment t3 1 a 1 a NULL NULL NULL NULL HASH t3 1 a 2 b NULL 15 NULL NULL HASH -flush tables; show index from t3; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment t3 1 a 1 a NULL NULL NULL NULL HASH -t3 1 a 2 b NULL 13 NULL NULL HASH -drop table t1,t2; +t3 1 a 2 b NULL 15 NULL NULL HASH +explain select * from t1 ignore key(btree_idx), t3 where t1.name='matt' and t3.a = concat('',t1.name) and t3.b=t1.name; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref heap_idx heap_idx 20 const 7 Using where +1 SIMPLE t3 ref a a 40 func,const 6 Using where +drop table t1, t2, t3; diff --git a/mysql-test/t/heap_hash.test b/mysql-test/t/heap_hash.test index df233633840..6d8fdec4b9e 100644 --- a/mysql-test/t/heap_hash.test +++ b/mysql-test/t/heap_hash.test @@ -168,6 +168,14 @@ explain select * from t1 where a='aaab'; explain select * from t1 where a='aaac'; explain select * from t1 where a='aaad'; insert into t1 select * from t1; + +explain select * from t1 where a='aaaa'; +explain select * from t1 where a='aaab'; +explain select * from t1 where a='aaac'; +explain select * from t1 where a='aaad'; + +# a known effect: table reload causes statistics to be updated: +flush tables; explain select * from t1 where a='aaaa'; explain select * from t1 where a='aaab'; explain select * from t1 where a='aaac'; @@ -203,7 +211,6 @@ insert into t1 (name) values ('Matt'), ('Lilu'), ('Corbin'), ('Carly'), ('Suzy'), ('Hoppy'), ('Burrito'), ('Mimi'), ('Sherry'), ('Ben'), ('Phil'), ('Emily'), ('Mike'); insert into t2 select * from t1; - explain select * from t1 where name='matt'; explain select * from t2 where name='matt'; @@ -222,12 +229,11 @@ insert into t1 (name) select name from t2; insert into t1 (name) select name from t2; insert into t1 (name) select name from t2; insert into t1 (name) select name from t2; - +flush tables; select count(*) from t1 where name='Matt'; explain select * from t1 ignore index (btree_idx) where name='matt'; show index from t1; -flush tables; show index from t1; create table t3 @@ -238,8 +244,10 @@ create table t3 ) engine=heap; insert into t3 select name, name from t1; show index from t3; -flush tables; show index from t3; -drop table t1,t2; +# test rec_per_key use for joins. +explain select * from t1 ignore key(btree_idx), t3 where t1.name='matt' and t3.a = concat('',t1.name) and t3.b=t1.name; + +drop table t1, t2, t3; diff --git a/sql/ha_heap.cc b/sql/ha_heap.cc index 7643037e24f..5e79ee02745 100644 --- a/sql/ha_heap.cc +++ b/sql/ha_heap.cc @@ -32,8 +32,14 @@ const char **ha_heap::bas_ext() const /* Hash index statistics is updated (copied from HP_KEYDEF::hash_buckets to - rec_per_key) after 1/HEAP_STATS_UPDATE_THRESHOLD records have been inserted/ - updated/deleted. delete_all_rows() and table flush cause immediate update. + rec_per_key) after 1/HEAP_STATS_UPDATE_THRESHOLD fraction of table records + have been inserted/updated/deleted. delete_all_rows() and table flush cause + immediate update. + + NOTE + hash index statistics must be updated when number of table records changes + from 0 to non-zero value and vice versa. Otherwise records_in_range may + erroneously return 0 and 'range' may miss records. */ #define HEAP_STATS_UPDATE_THRESHOLD 10 @@ -94,7 +100,6 @@ void ha_heap::set_keys_for_scanning(void) void ha_heap::update_key_stats() { - printf("update_key_stats\n"); for (uint i= 0; i < table->keys; i++) { KEY *key=table->key_info+i; @@ -425,13 +430,7 @@ ha_rows ha_heap::records_in_range(uint inx, key_range *min_key, max_key->flag != HA_READ_AFTER_KEY) return HA_POS_ERROR; // Can only use exact keys else - { - ha_rows records= file->s->records; - if (!records) - return 0; - ha_rows res= records / file->s->keydef[inx].hash_buckets; - return res ? res : 1; - } + return key->rec_per_key[key->key_parts-1]; } From ab5610ecc6a3e574dbceff110d5fa6a80df246c0 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 15 Oct 2004 23:12:15 -0500 Subject: [PATCH 0009/1063] texi2html: Changes parsing of @image argument. Docs/Support/texi2html: Changes parsing of @image argument. BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted --- BitKeeper/etc/logging_ok | 1 + Docs/Support/texi2html | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok index d025a25f5c5..7a4086b9711 100644 --- a/BitKeeper/etc/logging_ok +++ b/BitKeeper/etc/logging_ok @@ -36,6 +36,7 @@ mwagner@cash.mwagner.org nick@mysql.com nick@nick.leippe.com paul@central.snake.net +paul@ice.snake.net paul@teton.kitebird.com salle@geopard.(none) salle@geopard.online.bg diff --git a/Docs/Support/texi2html b/Docs/Support/texi2html index 5dda7c8bbd5..8067d8f72ce 100755 --- a/Docs/Support/texi2html +++ b/Docs/Support/texi2html @@ -1811,7 +1811,7 @@ sub fix_image { my($text) = @_; my($arg1, $ext); - $text =~ /^([^,]*)$/; + $text =~ /^([^,]*)/; die "error in image: '$text'" unless defined($1); $arg1 = $1; $arg1 =~ s/@@/@/g; From 9c8436505ddacb7df84962f2c80ce116cae5125c Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 19 Oct 2004 11:00:44 +0500 Subject: [PATCH 0010/1063] A fix (bug #6101: mysqldump writes invalid SQL). client/mysqldump.c: A fix (bug #6101: mysqldump writes invalid SQL). Syntax corrected. --- client/mysqldump.c | 2 +- mysql-test/r/mysqldump.result | 20 ++++++++++++++++++++ mysql-test/t/mysqldump.test | 6 ++++++ 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/client/mysqldump.c b/client/mysqldump.c index 56505afd235..e2101bd6c23 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -1797,7 +1797,7 @@ static int init_dumping(char *database) MYSQL_ROW row; MYSQL_RES *dbinfo; - sprintf(qbuf,"SHOW CREATE DATABASE WITH IF NOT EXISTS %s", + sprintf(qbuf,"SHOW CREATE DATABASE IF NOT EXISTS %s", qdatabase); if (mysql_query(sock, qbuf) || !(dbinfo = mysql_store_result(sock))) diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index 7e69620394b..5d6fbd713e8 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -332,3 +332,23 @@ CREATE TABLE `t1` ( 2 3 drop table t1; + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */; + +CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET latin1 */; + +USE `test`; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; + diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test index 89b3739f955..3d8f417bad0 100644 --- a/mysql-test/t/mysqldump.test +++ b/mysql-test/t/mysqldump.test @@ -127,3 +127,9 @@ insert into t1 values (1),(2),(3); --exec rm $MYSQL_TEST_DIR/var/tmp/t1.sql --exec rm $MYSQL_TEST_DIR/var/tmp/t1.txt drop table t1; + +# +# Bug #6101: create database problem +# + +--exec $MYSQL_DUMP --skip-comments --databases test From 4324519868ec94df1804fd1a0288b45f2ae90ad8 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 19 Oct 2004 11:54:33 +0300 Subject: [PATCH 0011/1063] fixed retsult code --- sql/sql_parse.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 9e0853a370b..1fe9e5093eb 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -1765,7 +1765,7 @@ mysql_execute_command(void) if (lex->name && (!lex->name[0] || strlen(lex->name) > NAME_LEN)) { net_printf(&thd->net,ER_WRONG_TABLE_NAME,lex->name); - res=0; + res= 1; break; } if (!select_lex->db) From afe39f259042a5a6dfa558d4b96b214b84be5926 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 19 Oct 2004 22:27:19 +0200 Subject: [PATCH 0012/1063] Optimization: in the replication slave, we can avoid doing one strlen() per event's execution, as we already have db_len in Log_event. Only if rewrite_db() changed the db we need a strlen (so we now do the strlen() in rewrite_db). Plus a test (we had none for --replicate-rewrite-db :( ). sql/log_event.cc: The goal is to get of rid of one strlen() per replication event in slave: we don't need to compute strlen(thd->db) as we already have db_len in the event; only case where we need to do a strlen() is if rewrite_db() changed the db. Note that db_len is always a meaningful value. It's 0 if event's db is 0. sql/slave.cc: rewrite_db now returns the len of the returned db. print_slave_db_safe() needn't call rewrite_db() as rewrite_db() is already called by caller. sql/slave.h: declaration updates for slave.cc --- mysql-test/r/rpl_rewrite_db.result | 22 ++++++++++++++++++++++ mysql-test/t/rpl_rewrite_db-slave.opt | 1 + mysql-test/t/rpl_rewrite_db.test | 19 +++++++++++++++++++ sql/log_event.cc | 23 ++++++++++------------- sql/slave.cc | 7 +++++-- sql/slave.h | 4 ++-- 6 files changed, 59 insertions(+), 17 deletions(-) create mode 100644 mysql-test/r/rpl_rewrite_db.result create mode 100644 mysql-test/t/rpl_rewrite_db-slave.opt create mode 100644 mysql-test/t/rpl_rewrite_db.test diff --git a/mysql-test/r/rpl_rewrite_db.result b/mysql-test/r/rpl_rewrite_db.result new file mode 100644 index 00000000000..2804b98dea1 --- /dev/null +++ b/mysql-test/r/rpl_rewrite_db.result @@ -0,0 +1,22 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +drop database if exists mysqltest1; +create database mysqltest1; +use mysqltest1; +create table t1 (a int); +insert into t1 values(9); +select * from mysqltest1.t1; +a +9 +show databases like 'mysqltest1'; +Database (mysqltest1) +mysqltest1 +select * from test.t1; +a +9 +drop table t1; +drop database mysqltest1; diff --git a/mysql-test/t/rpl_rewrite_db-slave.opt b/mysql-test/t/rpl_rewrite_db-slave.opt new file mode 100644 index 00000000000..b9cd29e9205 --- /dev/null +++ b/mysql-test/t/rpl_rewrite_db-slave.opt @@ -0,0 +1 @@ +"--replicate-rewrite-db=mysqltest1->test" diff --git a/mysql-test/t/rpl_rewrite_db.test b/mysql-test/t/rpl_rewrite_db.test new file mode 100644 index 00000000000..4cc8ae4b676 --- /dev/null +++ b/mysql-test/t/rpl_rewrite_db.test @@ -0,0 +1,19 @@ +source include/master-slave.inc; +--disable_warnings +drop database if exists mysqltest1; +--enable_warnings +create database mysqltest1; + +use mysqltest1; +create table t1 (a int); +insert into t1 values(9); +select * from mysqltest1.t1; +sync_slave_with_master; +show databases like 'mysqltest1'; # should be empty +select * from test.t1; +# cleanup +connection master; +drop table t1; +drop database mysqltest1; +sync_slave_with_master; + diff --git a/sql/log_event.cc b/sql/log_event.cc index 326f2fc5c59..977c3c0fe24 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -977,7 +977,8 @@ void Query_log_event::print(FILE* file, bool short_form, char* last_db) int Query_log_event::exec_event(struct st_relay_log_info* rli) { int expected_error,actual_error= 0; - thd->db= (char*) rewrite_db(db); // thd->db_length is set later if needed + thd->db_length= db_len; + thd->db= (char*) rewrite_db(db, &thd->db_length); /* InnoDB internally stores the master log position it has processed so far; @@ -995,11 +996,6 @@ int Query_log_event::exec_event(struct st_relay_log_info* rli) if (db_ok(thd->db, replicate_do_db, replicate_ignore_db)) { thd->set_time((time_t)when); - /* - We cannot use db_len from event to fill thd->db_length, because - rewrite_db() may have changed db. - */ - thd->db_length= thd->db ? strlen(thd->db) : 0; thd->query_length= q_len; thd->query = (char*)query; VOID(pthread_mutex_lock(&LOCK_thread_count)); @@ -1057,7 +1053,7 @@ Default database: '%s'. Query: '%s'", expected_error, actual_error ? thd->net.last_error: "no error", actual_error, - print_slave_db_safe(db), query); + print_slave_db_safe(thd->db), query); thd->query_error= 1; } /* @@ -1078,7 +1074,7 @@ Default database: '%s'. Query: '%s'", "Error '%s' on query. Default database: '%s'. Query: '%s'", (actual_error ? thd->net.last_error : "unexpected success or fatal error"), - print_slave_db_safe(db), query); + print_slave_db_safe(thd->db), query); thd->query_error= 1; } } /* End of if (db_ok(... */ @@ -1706,7 +1702,8 @@ int Load_log_event::exec_event(NET* net, struct st_relay_log_info* rli, bool use_rli_only_for_errors) { char *load_data_query= 0; - thd->db= (char*) rewrite_db(db); // thd->db_length is set later if needed + thd->db_length= db_len; + thd->db= (char*) rewrite_db(db, &thd->db_length); DBUG_ASSERT(thd->query == 0); thd->query_length= 0; // Should not be needed thd->query_error= 0; @@ -1741,7 +1738,6 @@ int Load_log_event::exec_event(NET* net, struct st_relay_log_info* rli, if (db_ok(thd->db, replicate_do_db, replicate_ignore_db)) { thd->set_time((time_t)when); - thd->db_length= thd->db ? strlen(thd->db) : 0; VOID(pthread_mutex_lock(&LOCK_thread_count)); thd->query_id = query_id++; VOID(pthread_mutex_unlock(&LOCK_thread_count)); @@ -1847,7 +1843,7 @@ Slave: load data infile on table '%s' at log position %s in log \ (char*) table_name, llstr(log_pos,llbuff), RPL_LOG_NAME, (ulong) thd->cuted_fields, - print_slave_db_safe(db)); + print_slave_db_safe(thd->db)); } if (net) net->pkt_nr= thd->net.pkt_nr; @@ -1865,6 +1861,7 @@ Slave: load data infile on table '%s' at log position %s in log \ } thd->net.vio = 0; + char *save_db= thd->db; VOID(pthread_mutex_lock(&LOCK_thread_count)); thd->db= 0; thd->query= 0; @@ -1887,7 +1884,7 @@ Slave: load data infile on table '%s' at log position %s in log \ } slave_print_error(rli,sql_errno,"\ Error '%s' running LOAD DATA INFILE on table '%s'. Default database: '%s'", - err, (char*)table_name, print_slave_db_safe(db)); + err, (char*)table_name, print_slave_db_safe(save_db)); free_root(&thd->mem_root,MYF(MY_KEEP_PREALLOC)); return 1; } @@ -1897,7 +1894,7 @@ Error '%s' running LOAD DATA INFILE on table '%s'. Default database: '%s'", { slave_print_error(rli,ER_UNKNOWN_ERROR, "\ Fatal error running LOAD DATA INFILE on table '%s'. Default database: '%s'", - (char*)table_name, print_slave_db_safe(db)); + (char*)table_name, print_slave_db_safe(save_db)); return 1; } diff --git a/sql/slave.cc b/sql/slave.cc index 4ef8715f1e6..d5278e06d8a 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -1032,7 +1032,7 @@ bool net_request_file(NET* net, const char* fname) } -const char *rewrite_db(const char* db) +const char *rewrite_db(const char* db, uint *new_len) { if (replicate_rewrite_db.is_empty() || !db) return db; @@ -1042,7 +1042,10 @@ const char *rewrite_db(const char* db) while ((tmp=it++)) { if (!strcmp(tmp->key, db)) + { + *new_len= strlen(tmp->val); return tmp->val; + } } return db; } @@ -1056,7 +1059,7 @@ const char *rewrite_db(const char* db) const char *print_slave_db_safe(const char* db) { - return (db ? rewrite_db(db) : ""); + return (db ? db : ""); } /* diff --git a/sql/slave.h b/sql/slave.h index 20167094453..97f197fb50a 100644 --- a/sql/slave.h +++ b/sql/slave.h @@ -510,8 +510,8 @@ int add_table_rule(HASH* h, const char* table_spec); int add_wild_table_rule(DYNAMIC_ARRAY* a, const char* table_spec); void init_table_rule_hash(HASH* h, bool* h_inited); void init_table_rule_array(DYNAMIC_ARRAY* a, bool* a_inited); -const char *rewrite_db(const char* db); -const char *print_slave_db_safe(const char* db); +const char *rewrite_db(const char* db, uint *new_db_len); +const char *print_slave_db_safe(const char *db); int check_expected_error(THD* thd, RELAY_LOG_INFO* rli, int error_code); void skip_load_data_infile(NET* net); void slave_print_error(RELAY_LOG_INFO* rli, int err_code, const char* msg, ...); From af18865e5afedc31a4f58d15d781e420a5588e6a Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 20 Oct 2004 18:10:44 +0500 Subject: [PATCH 0013/1063] A fix (bug #6000 No "@%"-accounts after install). scripts/mysql_install_db.sh: A fix (bug #6000 No "@%"-accounts after install). Why do we need those REPLACE queries? Removed $hostname queries for windows builds. --- scripts/mysql_install_db.sh | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index f9f3160d220..c75f9854a2a 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -275,14 +275,16 @@ then c_u="$c_u )" c_u="$c_u comment='Users and global privileges';" - i_u="INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); - INSERT INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); - - REPLACE INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); - REPLACE INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); - - INSERT INTO user (host,user) values ('localhost',''); - INSERT INTO user (host,user) values ('$hostname','');" + if test "$windows" = 1 + then + i_u="INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); + INSERT INTO user (host,user) values ('localhost','');" + else + i_u="INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); + INSERT INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); + INSERT INTO user (host,user) values ('localhost',''); + INSERT INTO user (host,user) values ('$hostname','');" + fi fi if test ! -f $mdata/func.frm From 70fe41d2ec0fccdd54f643d832b67274a8f76f16 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 21 Oct 2004 17:02:24 +0500 Subject: [PATCH 0014/1063] A fix (bug #4802 prompt in mysql client shows wrong database after dropping default db). client/mysql.cc: A fix (bug #4802 prompt in mysql client shows wrong database after dropping default db). Introduced new get_current_db() function which is called from the com_use() and the com_go() if we get SERVER_STATUS_DB_DROPPED. include/mysql_com.h: A fix (bug #4802 prompt in mysql client shows wrong database after dropping default db). SERVER_STATUS_DB_DROPPED flag added. Note: it is set to 256 to don't conflict with 5.0 ver. sql/sql_db.cc: A fix (bug #4802 prompt in mysql client shows wrong database after dropping default db). SERVER_STATUS_DB_DROPPED flag is set/unset. --- client/mysql.cc | 38 ++++++++++++++++++++------------------ include/mysql_com.h | 1 + sql/sql_db.cc | 2 ++ 3 files changed, 23 insertions(+), 18 deletions(-) diff --git a/client/mysql.cc b/client/mysql.cc index 05d5d1355ad..18dc4dd76cb 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -1574,6 +1574,22 @@ static int reconnect(void) return 0; } +static void get_current_db() +{ + MYSQL_RES *res; + + my_free(current_db, MYF(MY_ALLOW_ZERO_PTR)); + current_db= NULL; + /* In case of error below current_db will be NULL */ + if (!mysql_query(&mysql, "SELECT DATABASE()") && + (res= mysql_use_result(&mysql))) + { + MYSQL_ROW row= mysql_fetch_row(res); + if (row[0]) + current_db= my_strdup(row[0], MYF(MY_WME)); + mysql_free_result(res); + } +} /*************************************************************************** The different commands @@ -1899,6 +1915,9 @@ com_go(String *buffer,char *line __attribute__((unused))) if (err >= 1) error= put_error(&mysql); + if (!status.batch && (mysql.server_status & SERVER_STATUS_DB_DROPPED)) + get_current_db(); + return error; /* New command follows */ } @@ -2614,24 +2633,7 @@ com_use(String *buffer __attribute__((unused)), char *line) under our feet, for example if DROP DATABASE or RENAME DATABASE (latter one not yet available by the time the comment was written) */ - /* Let's reset current_db, assume it's gone */ - my_free(current_db, MYF(MY_ALLOW_ZERO_PTR)); - current_db= 0; - /* - We don't care about in case of an error below because current_db - was just set to 0. - */ - if (!mysql_query(&mysql, "SELECT DATABASE()") && - (res= mysql_use_result(&mysql))) - { - row= mysql_fetch_row(res); - if (row[0]) - { - current_db= my_strdup(row[0], MYF(MY_WME)); - } - (void) mysql_fetch_row(res); // Read eof - mysql_free_result(res); - } + get_current_db(); if (!current_db || cmp_database(charset_info, current_db,tmp)) { diff --git a/include/mysql_com.h b/include/mysql_com.h index 449cd0ba396..6fc1d106197 100644 --- a/include/mysql_com.h +++ b/include/mysql_com.h @@ -127,6 +127,7 @@ enum enum_server_command #define SERVER_MORE_RESULTS_EXISTS 8 /* Multi query - next query exists */ #define SERVER_QUERY_NO_GOOD_INDEX_USED 16 #define SERVER_QUERY_NO_INDEX_USED 32 +#define SERVER_STATUS_DB_DROPPED 256 /* A database was dropped */ #define MYSQL_ERRMSG_SIZE 512 #define NET_READ_TIMEOUT 30 /* Timeout on read */ diff --git a/sql/sql_db.cc b/sql/sql_db.cc index 426f7d36633..e5b426ef508 100644 --- a/sql/sql_db.cc +++ b/sql/sql_db.cc @@ -634,7 +634,9 @@ int mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent) thd->clear_error(); mysql_bin_log.write(&qinfo); } + thd->server_status|= SERVER_STATUS_DB_DROPPED; send_ok(thd, (ulong) deleted); + thd->server_status&= !SERVER_STATUS_DB_DROPPED; } exit: From a0b63729640187349a9b51ef5fe55a291676272a Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 21 Oct 2004 12:08:51 -0500 Subject: [PATCH 0015/1063] texi2html: Update texi2html with version from mysqldoc repository. (Please merge this forward to 4.0, 4.1, 5.0.) Docs/Support/texi2html: Update texi2html with version from mysqldoc repository. (Please merge this forward to 4.0, 4.1, 5.0.) BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted --- BitKeeper/etc/logging_ok | 1 + Docs/Support/texi2html | 98 ++++++++++++++++++++++------------------ 2 files changed, 54 insertions(+), 45 deletions(-) diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok index 7a4086b9711..b82221bfb95 100644 --- a/BitKeeper/etc/logging_ok +++ b/BitKeeper/etc/logging_ok @@ -37,6 +37,7 @@ nick@mysql.com nick@nick.leippe.com paul@central.snake.net paul@ice.snake.net +paul@kite-hub.kitebird.com paul@teton.kitebird.com salle@geopard.(none) salle@geopard.online.bg diff --git a/Docs/Support/texi2html b/Docs/Support/texi2html index 8067d8f72ce..f13c006c7dc 100755 --- a/Docs/Support/texi2html +++ b/Docs/Support/texi2html @@ -1,4 +1,4 @@ -#!PATH_TO_PERL -*- perl -*- +#!/usr/bin/perl # Add path to perl on the previous line and make this executable # if you want to use this as a normal script. 'di '; @@ -12,7 +12,7 @@ #-############################################################################## # @(#)texi2html 1.52 971230 Written (mainly) by Lionel Cons, Lionel.Cons@cern.ch -# Enhanced by David Axmark, david@detron.se +# Enhanced by David Axmark # The man page for this program is included at the end of this file and can be # viewed using the command 'nroff -man texi2html'. @@ -40,8 +40,7 @@ $NODESRE = '[^@{}:\'`"]+'; # RE for a list of node names $XREFRE = '[^@{}]+'; # RE for a xref (should use NODERE) $ERROR = "***"; # prefix for errors and warnings -$THISPROG = "texi2html 1.52 (hacked by david\@detron.se)"; # program name and version -$HOMEPAGE = "http://www.mathematik.uni-kl.de/~obachman/Texi2html/"; # program home page +$THISPROG = "texi2html 1.52 (with additions by MySQL AB)"; # program name and version $TODAY = &pretty_date; # like "20 September 1993" $SPLITTAG = "\n"; # tag to know where to split $PROTECTTAG = "_ThisIsProtected_"; # tag to recognize protected sections @@ -114,10 +113,12 @@ $html2_doctype = '", # HTML+ + "*", "
", # HTML+ " ", " ", "\n", "\n", "|", "", @@ -134,6 +135,8 @@ $html2_doctype = '', # paragraph break + 'br', '

', # paragraph break 'bullet', '*', 'copyright', '(C)', + 'registeredsymbol', '(R)', 'dots', '...', 'equiv', '==', 'error', 'error-->', @@ -161,27 +165,28 @@ $html2_doctype = '\n", __LINE__)); + push(@lines, &debug("\n", __LINE__)); } else { warn "$ERROR Bad table line: $_"; } @@ -873,7 +887,7 @@ READ_LINE: while ($_ = &next_line) &simple_substitutions; s/\@value{($VARRE)}/$value{$1}/eg; s/\@footnote\{/\@footnote$docu_doc\{/g; # mark footnotes, cf. pass 4 - s|\s+\@tab\s*| \n", __LINE__)) unless $html_element eq 'TABLE'; &html_pop_if('TR'); - $what =~ s|\s+\@tab\s*|
|g if ($in_multitable); + s/(^|\s+)\@tab\s*/ <\/TD> /g if ($in_multitable); # # analyze the tag again @@ -885,7 +899,7 @@ READ_LINE: while ($_ = &next_line) $name =~ s/\s+$//; $level = $sec2level{$tag}; $name = &update_sec_num($tag, $level) . " $name" - if $number_sections && $tag !~ /^unnumbered/; + if $number_sections && $tag !~ /^unnumbered/ && $tag ne 'subsubheading'; if ($tag =~ /heading$/) { push(@lines, &html_debug("\n", __LINE__)); if ($html_element ne 'body') { @@ -1079,7 +1093,7 @@ EOC push(@lines, &debug("
|g; + $what =~ s/(^|\s+)\@tab\s*/ <\/TD> /g; push(@lines, &debug("
$what\n", __LINE__)); &html_push('TR'); if ($deferred_ref) @@ -1463,11 +1477,7 @@ print "# end of pass 4\n" if $verbose; # # #---############################################################################ -$header = < -EOT - + $header = ''; $full_title = $value{'_title'} || $value{'_settitle'} || "Untitled Document"; $title = $value{'_settitle'} || $full_title; $_ = &substitute_style($full_title); @@ -1815,8 +1825,10 @@ sub fix_image die "error in image: '$text'" unless defined($1); $arg1 = $1; $arg1 =~ s/@@/@/g; - $ext = "jpg" if -f "$arg1.jpg"; - $ext = "gif" if -f "$arg1.gif"; + foreach (@include_dirs) { + $ext = "jpg" if -f "$_/$arg1.jpg"; + $ext = "gif" if -f "$_/$arg1.gif"; + } if (defined($ext)) { ""; @@ -2010,7 +2022,7 @@ sub print_toplevel_header { local($_); - &print_header; # pass given arg... + &print_header unless $opt_empty_headers; # pass given arg... print FILE $full_title; if ($value{'_subtitle'}) { $value{'_subtitle'} =~ s/\n+$//; @@ -2042,13 +2054,7 @@ EOT sub print_toplevel_footer { - &print_ruler; - print FILE <texi2html -translator version 1.52 (extended by davida\@detron.se).

-EOT - &print_footer; + &print_footer unless $opt_empty_headers; } sub protect_texi @@ -2065,8 +2071,10 @@ sub protect_html { local($what) = @_; # protect & < > - # Avoid loop in & replacement. This instead bugs out for &# in text.. - $what =~ s/\&([^#]|$)/\&\#38;$1/g; + # hack for the two entity-like variable reference in existing examples + $what =~ s/\&(length|ts);/\&\#38;$1;/g; + # this leaves alone entities, but encodes standalone ampersands + $what =~ s/\&(?!([a-z0-9]+|#\d+);)/\&\#38;/ig; $what =~ s/\/\&\#62;/g; # but recognize some HTML things From e6e1600ec93ae95dbb17a9e462ca1abd7e715396 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 21 Oct 2004 23:56:12 +0300 Subject: [PATCH 0016/1063] Check of temporary tables hiding for query fetched from QC (BUG#6084) mysql-test/r/query_cache.result: hiding real table stored in query cache by temporary table mysql-test/t/query_cache.test: hiding real table stored in query cache by temporary table sql/sql_cache.cc: Check of temporary tables hiding for query fetched from QC sql/sql_cache.h: Key length now stored in table record of query cache --- mysql-test/r/query_cache.result | 13 +++++++++++++ mysql-test/t/query_cache.test | 12 ++++++++++++ sql/sql_cache.cc | 32 +++++++++++++++++++++++++++++++- sql/sql_cache.h | 3 +++ 4 files changed, 59 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/query_cache.result b/mysql-test/r/query_cache.result index a9e9f167e5f..85fe77b1f10 100644 --- a/mysql-test/r/query_cache.result +++ b/mysql-test/r/query_cache.result @@ -704,4 +704,17 @@ Qcache_queries_in_cache 1 unlock table; drop table t1,t2; set query_cache_wlock_invalidate=default; +CREATE TABLE t1 (id INT PRIMARY KEY); +insert into t1 values (1),(2),(3); +select * from t1; +id +1 +2 +3 +create temporary table t1 (a int not null auto_increment +primary key); +select * from t1; +a +drop table t1; +drop table t1; set GLOBAL query_cache_size=0; diff --git a/mysql-test/t/query_cache.test b/mysql-test/t/query_cache.test index 8a07c0a53a0..61fbadde1e1 100644 --- a/mysql-test/t/query_cache.test +++ b/mysql-test/t/query_cache.test @@ -521,4 +521,16 @@ unlock table; drop table t1,t2; set query_cache_wlock_invalidate=default; +# +# hiding real table stored in query cache by temporary table +# +CREATE TABLE t1 (id INT PRIMARY KEY); +insert into t1 values (1),(2),(3); +select * from t1; +create temporary table t1 (a int not null auto_increment +primary key); +select * from t1; +drop table t1; +drop table t1; + set GLOBAL query_cache_size=0; diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc index 60f0cfadc8e..8e953e223a9 100644 --- a/sql/sql_cache.cc +++ b/sql/sql_cache.cc @@ -971,9 +971,38 @@ Query_cache::send_result_to_client(THD *thd, char *sql, uint query_length) for (; block_table != block_table_end; block_table++) { TABLE_LIST table_list; - bzero((char*) &table_list,sizeof(table_list)); + TABLE *tmptable; Query_cache_table *table = block_table->parent; + + /* + Check that we have not temporary tables with same names of tables + of this query. If we have such tables, we will not send data from + query cache, because temporary tables hide real tables by which + query in query cache was made. + */ + for (tmptable= thd->temporary_tables; tmptable ; tmptable= tmptable->next) + { + if (tmptable->key_length - 8 == table->key_len() && + !memcmp(tmptable->table_cache_key, table->data(), + table->key_len())) + { + DBUG_PRINT("qcache", + ("Temporary table detected: '%s.%s'", + table_list.db, table_list.alias)); + STRUCT_UNLOCK(&structure_guard_mutex); + /* + We should not store result of this query because it contain + temporary tables => assign following wariable to make check + faster. + */ + thd->safe_to_cache_query=0; + BLOCK_UNLOCK_RD(query_block); + DBUG_RETURN(-1); + } + } + + bzero((char*) &table_list,sizeof(table_list)); table_list.db = table->db(); table_list.alias= table_list.real_name= table->table(); if (check_table_access(thd,SELECT_ACL,&table_list,1)) @@ -2066,6 +2095,7 @@ Query_cache::insert_table(uint key_len, char *key, } char *db = header->db(); header->table(db + db_length + 1); + header->key_len(key_len); } Query_cache_block_table *list_root = table_block->table(0); diff --git a/sql/sql_cache.h b/sql/sql_cache.h index 0c6579250ab..454f0318c12 100644 --- a/sql/sql_cache.h +++ b/sql/sql_cache.h @@ -144,10 +144,13 @@ struct Query_cache_query struct Query_cache_table { char *tbl; + uint32 key_length; inline char *db() { return (char *) data(); } inline char *table() { return tbl; } inline void table(char *table) { tbl = table; } + inline uint32 key_len() { return key_length; } + inline void key_len(uint32 len) { key_length= len; } inline gptr data() { return (gptr)(((byte*)this)+ From 7e38104cb4685227044daa6ef3f34028456f1c9c Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 22 Oct 2004 20:32:02 +0500 Subject: [PATCH 0017/1063] Fix for bug #6117 (Centroid() crashes server) I learned that one shouldn't use String::set in val_str() methods... mysql-test/r/gis.result: Test result for #6117 mysql-test/t/gis.test: Test case #6117 sql/item_geofunc.cc: String::set doesn't work here sql/spatial.cc: Error message isn't needed here --- mysql-test/r/gis.result | 74 ++++++++++++++++++++++++++++++++++++++++ mysql-test/t/gis.test | 75 +++++++++++++++++++++++++++++++++++++++++ sql/item_geofunc.cc | 6 ++-- sql/spatial.cc | 4 +-- 4 files changed, 153 insertions(+), 6 deletions(-) diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result index 2226c6e33c9..c51b07f09d6 100644 --- a/mysql-test/r/gis.result +++ b/mysql-test/r/gis.result @@ -581,3 +581,77 @@ t1 CREATE TABLE `t1` ( `POINT(1,3)` longblob NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; +CREATE TABLE `t1` (`object_id` bigint(20) unsigned NOT NULL default '0', `geo` +geometry NOT NULL default '') ENGINE=MyISAM ; +insert into t1 values ('85984',GeomFromText('MULTIPOLYGON(((-115.006363 +36.305435,-114.992394 36.305202,-114.991219 36.305975,-114.991163 +36.306845,-114.989432 36.309452,-114.978275 36.312642,-114.977363 +36.311978,-114.975327 36.312344,-114.96502 36.31597,-114.963364 +36.313629,-114.961723 36.313721,-114.956398 36.316057,-114.951882 +36.320979,-114.947073 36.323475,-114.945207 36.326451,-114.945207 +36.326451,-114.944132 36.326061,-114.94003 36.326588,-114.924017 +36.334484,-114.923281 36.334146,-114.92564 36.331504,-114.94072 +36.319282,-114.945348 36.314812,-114.948091 36.314762,-114.951755 +36.316211,-114.952446 36.313883,-114.952644 36.309488,-114.944725 +36.313083,-114.93706 36.32043,-114.932478 36.323497,-114.924556 +36.327708,-114.922608 36.329715,-114.92009 36.328695,-114.912105 +36.323566,-114.901647 36.317952,-114.897436 36.313968,-114.895344 +36.309573,-114.891699 36.304398,-114.890569 36.303551,-114.886356 +36.302702,-114.885141 36.301351,-114.885709 36.297391,-114.892499 +36.290893,-114.902142 36.288974,-114.904941 36.288838,-114.905308 +36.289845,-114.906325 36.290395,-114.909916 36.289549,-114.914527 +36.287535,-114.918797 36.284423,-114.922982 36.279731,-114.924113 +36.277282,-114.924057 36.275817,-114.927733 36.27053,-114.929354 +36.269029,-114.929354 36.269029,-114.950856 36.268715,-114.950768 +36.264324,-114.960206 36.264293,-114.960301 36.268943,-115.006662 +36.268929,-115.008583 36.265619,-115.00665 36.264247,-115.006659 +36.246873,-115.006659 36.246873,-115.006838 36.247697,-115.010764 +36.247774,-115.015609 36.25113,-115.015765 36.254505,-115.029517 +36.254619,-115.038573 36.249317,-115.038573 36.249317,-115.023403 +36.25841,-115.023873 36.258994,-115.031845 36.259829,-115.03183 +36.261053,-115.025561 36.261095,-115.036417 36.274632,-115.033729 +36.276041,-115.032217 36.274851,-115.029845 36.273959,-115.029934 +36.274966,-115.025763 36.274896,-115.025406 36.281044,-115.028731 +36.284471,-115.036497 36.290377,-115.042071 36.291039,-115.026759 +36.298478,-115.008995 36.301966,-115.006363 36.305435),(-115.079835 +36.244369,-115.079735 36.260186,-115.076435 36.262369,-115.069758 +36.265,-115.070235 36.268757,-115.064542 36.268655,-115.061843 +36.269857,-115.062676 36.270693,-115.06305 36.272344,-115.059051 +36.281023,-115.05918 36.283008,-115.060591 36.285246,-115.061913 +36.290022,-115.062499 36.306353,-115.062499 36.306353,-115.060918 +36.30642,-115.06112 36.289779,-115.05713 36.2825,-115.057314 +36.279446,-115.060779 36.274659,-115.061366 36.27209,-115.057858 +36.26557,-115.055805 36.262883,-115.054688 36.262874,-115.047335 +36.25037,-115.044234 36.24637,-115.052434 36.24047,-115.061734 +36.23507,-115.061934 36.22677,-115.061934 36.22677,-115.061491 +36.225267,-115.062024 36.218194,-115.060134 36.218278,-115.060133 +36.210771,-115.057833 36.210771,-115.057433 36.196271,-115.062233 +36.196271,-115.062233 36.190371,-115.062233 36.190371,-115.065533 +36.190371,-115.071333 36.188571,-115.098331 36.188275,-115.098331 +36.188275,-115.098435 36.237569,-115.097535 36.240369,-115.097535 +36.240369,-115.093235 36.240369,-115.089135 36.240469,-115.083135 +36.240569,-115.083135 36.240569,-115.079835 +36.244369)))')),('85998',GeomFromText('MULTIPOLYGON(((-115.333107 +36.264587,-115.333168 36.280638,-115.333168 36.280638,-115.32226 +36.280643,-115.322538 36.274311,-115.327222 36.274258,-115.32733 +36.263026,-115.330675 36.262984,-115.332132 36.264673,-115.333107 +36.264587),(-115.247239 36.247066,-115.247438 36.218267,-115.247438 +36.218267,-115.278525 36.219263,-115.278525 36.219263,-115.301545 +36.219559,-115.332748 36.219197,-115.332757 36.220041,-115.332757 +36.220041,-115.332895 36.233514,-115.349023 36.233479,-115.351489 +36.234475,-115.353681 36.237021,-115.357106 36.239789,-115.36519 +36.243331,-115.368156 36.243487,-115.367389 36.244902,-115.364553 +36.246014,-115.359219 36.24616,-115.356186 36.248025,-115.353347 +36.248004,-115.350813 36.249507,-115.339673 36.25387,-115.333069 +36.255018,-115.333069 36.255018,-115.333042 36.247767,-115.279039 +36.248666,-115.263639 36.247466,-115.263839 36.252766,-115.261439 +36.252666,-115.261439 36.247366,-115.247239 36.247066)))')); +select object_id, geometrytype(geo), ISSIMPLE(GEO), ASTEXT(centroid(geo)) from +t1 where object_id=85998; +object_id geometrytype(geo) ISSIMPLE(GEO) ASTEXT(centroid(geo)) +85998 MULTIPOLYGON 0 POINT(115.31877315203 -36.237472821022) +select object_id, geometrytype(geo), ISSIMPLE(GEO), ASTEXT(centroid(geo)) from +t1 where object_id=85984; +object_id geometrytype(geo) ISSIMPLE(GEO) ASTEXT(centroid(geo)) +85984 MULTIPOLYGON 0 POINT(-114.87787186923 36.33101763469) +drop table t1; diff --git a/mysql-test/t/gis.test b/mysql-test/t/gis.test index 739fced1f29..86c34eacbc5 100644 --- a/mysql-test/t/gis.test +++ b/mysql-test/t/gis.test @@ -284,3 +284,78 @@ drop table t1; create table t1 select POINT(1,3); show create table t1; drop table t1; + +CREATE TABLE `t1` (`object_id` bigint(20) unsigned NOT NULL default '0', `geo` +geometry NOT NULL default '') ENGINE=MyISAM ; + +insert into t1 values ('85984',GeomFromText('MULTIPOLYGON(((-115.006363 +36.305435,-114.992394 36.305202,-114.991219 36.305975,-114.991163 +36.306845,-114.989432 36.309452,-114.978275 36.312642,-114.977363 +36.311978,-114.975327 36.312344,-114.96502 36.31597,-114.963364 +36.313629,-114.961723 36.313721,-114.956398 36.316057,-114.951882 +36.320979,-114.947073 36.323475,-114.945207 36.326451,-114.945207 +36.326451,-114.944132 36.326061,-114.94003 36.326588,-114.924017 +36.334484,-114.923281 36.334146,-114.92564 36.331504,-114.94072 +36.319282,-114.945348 36.314812,-114.948091 36.314762,-114.951755 +36.316211,-114.952446 36.313883,-114.952644 36.309488,-114.944725 +36.313083,-114.93706 36.32043,-114.932478 36.323497,-114.924556 +36.327708,-114.922608 36.329715,-114.92009 36.328695,-114.912105 +36.323566,-114.901647 36.317952,-114.897436 36.313968,-114.895344 +36.309573,-114.891699 36.304398,-114.890569 36.303551,-114.886356 +36.302702,-114.885141 36.301351,-114.885709 36.297391,-114.892499 +36.290893,-114.902142 36.288974,-114.904941 36.288838,-114.905308 +36.289845,-114.906325 36.290395,-114.909916 36.289549,-114.914527 +36.287535,-114.918797 36.284423,-114.922982 36.279731,-114.924113 +36.277282,-114.924057 36.275817,-114.927733 36.27053,-114.929354 +36.269029,-114.929354 36.269029,-114.950856 36.268715,-114.950768 +36.264324,-114.960206 36.264293,-114.960301 36.268943,-115.006662 +36.268929,-115.008583 36.265619,-115.00665 36.264247,-115.006659 +36.246873,-115.006659 36.246873,-115.006838 36.247697,-115.010764 +36.247774,-115.015609 36.25113,-115.015765 36.254505,-115.029517 +36.254619,-115.038573 36.249317,-115.038573 36.249317,-115.023403 +36.25841,-115.023873 36.258994,-115.031845 36.259829,-115.03183 +36.261053,-115.025561 36.261095,-115.036417 36.274632,-115.033729 +36.276041,-115.032217 36.274851,-115.029845 36.273959,-115.029934 +36.274966,-115.025763 36.274896,-115.025406 36.281044,-115.028731 +36.284471,-115.036497 36.290377,-115.042071 36.291039,-115.026759 +36.298478,-115.008995 36.301966,-115.006363 36.305435),(-115.079835 +36.244369,-115.079735 36.260186,-115.076435 36.262369,-115.069758 +36.265,-115.070235 36.268757,-115.064542 36.268655,-115.061843 +36.269857,-115.062676 36.270693,-115.06305 36.272344,-115.059051 +36.281023,-115.05918 36.283008,-115.060591 36.285246,-115.061913 +36.290022,-115.062499 36.306353,-115.062499 36.306353,-115.060918 +36.30642,-115.06112 36.289779,-115.05713 36.2825,-115.057314 +36.279446,-115.060779 36.274659,-115.061366 36.27209,-115.057858 +36.26557,-115.055805 36.262883,-115.054688 36.262874,-115.047335 +36.25037,-115.044234 36.24637,-115.052434 36.24047,-115.061734 +36.23507,-115.061934 36.22677,-115.061934 36.22677,-115.061491 +36.225267,-115.062024 36.218194,-115.060134 36.218278,-115.060133 +36.210771,-115.057833 36.210771,-115.057433 36.196271,-115.062233 +36.196271,-115.062233 36.190371,-115.062233 36.190371,-115.065533 +36.190371,-115.071333 36.188571,-115.098331 36.188275,-115.098331 +36.188275,-115.098435 36.237569,-115.097535 36.240369,-115.097535 +36.240369,-115.093235 36.240369,-115.089135 36.240469,-115.083135 +36.240569,-115.083135 36.240569,-115.079835 +36.244369)))')),('85998',GeomFromText('MULTIPOLYGON(((-115.333107 +36.264587,-115.333168 36.280638,-115.333168 36.280638,-115.32226 +36.280643,-115.322538 36.274311,-115.327222 36.274258,-115.32733 +36.263026,-115.330675 36.262984,-115.332132 36.264673,-115.333107 +36.264587),(-115.247239 36.247066,-115.247438 36.218267,-115.247438 +36.218267,-115.278525 36.219263,-115.278525 36.219263,-115.301545 +36.219559,-115.332748 36.219197,-115.332757 36.220041,-115.332757 +36.220041,-115.332895 36.233514,-115.349023 36.233479,-115.351489 +36.234475,-115.353681 36.237021,-115.357106 36.239789,-115.36519 +36.243331,-115.368156 36.243487,-115.367389 36.244902,-115.364553 +36.246014,-115.359219 36.24616,-115.356186 36.248025,-115.353347 +36.248004,-115.350813 36.249507,-115.339673 36.25387,-115.333069 +36.255018,-115.333069 36.255018,-115.333042 36.247767,-115.279039 +36.248666,-115.263639 36.247466,-115.263839 36.252766,-115.261439 +36.252666,-115.261439 36.247366,-115.247239 36.247066)))')); + +select object_id, geometrytype(geo), ISSIMPLE(GEO), ASTEXT(centroid(geo)) from +t1 where object_id=85998; + +select object_id, geometrytype(geo), ISSIMPLE(GEO), ASTEXT(centroid(geo)) from +t1 where object_id=85984; + +drop table t1; diff --git a/sql/item_geofunc.cc b/sql/item_geofunc.cc index 935925c1e83..7c3319bbfea 100644 --- a/sql/item_geofunc.cc +++ b/sql/item_geofunc.cc @@ -148,9 +148,9 @@ String *Item_func_geometry_type::val_str(String *str) swkb->length() - SRID_SIZE))))) return 0; /* String will not move */ - str->set(geom->get_class_info()->m_name.str, - geom->get_class_info()->m_name.length, - default_charset()); + str->copy(geom->get_class_info()->m_name.str, + geom->get_class_info()->m_name.length, + default_charset()); return str; } diff --git a/sql/spatial.cc b/sql/spatial.cc index 0668dd2faab..bcfefd9dde8 100644 --- a/sql/spatial.cc +++ b/sql/spatial.cc @@ -828,9 +828,7 @@ int Gis_polygon::centroid_xy(double *x, double *y) const if (!first_loop) { - double d_area= res_area - cur_area; - if (d_area <= 0) - return 1; + double d_area= fabs(res_area - cur_area); res_cx= (res_area * res_cx - cur_area * cur_cx) / d_area; res_cy= (res_area * res_cy - cur_area * cur_cy) / d_area; } From 5ab6c5e532f682631761f02bec6f894df3930002 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 22 Oct 2004 22:51:04 +0300 Subject: [PATCH 0018/1063] postreview fixes sql/mysql_priv.h: constant definition sql/sql_base.cc: difine used instead of constant sql/sql_cache.cc: difine used instead of constant typo fixed --- sql/mysql_priv.h | 1 + sql/sql_base.cc | 5 +++-- sql/sql_cache.cc | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index b5e571e74d0..b123927d09e 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -551,6 +551,7 @@ int mysql_ha_flush(THD *thd, TABLE_LIST *tables, uint mode_flags); #define MYSQL_HA_FLUSH_ALL 0x02 /* sql_base.cc */ +#define TMP_TABLE_KEY_EXTRA 8 void set_item_name(Item *item,char *pos,uint length); bool add_field_to_list(char *field_name, enum enum_field_types type, char *length, char *decimal, diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 72400bf0abb..ddc81053357 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -816,8 +816,9 @@ TABLE *open_table(THD *thd,const char *db,const char *table_name, for (table=thd->temporary_tables; table ; table=table->next) { - if (table->key_length == key_length+8 && - !memcmp(table->table_cache_key,key,key_length+8)) + if (table->key_length == key_length + TMP_TABLE_KEY_EXTRA && + !memcmp(table->table_cache_key, key, + key_length + TMP_TABLE_KEY_EXTRA)) { if (table->query_id == thd->query_id) { diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc index 8e953e223a9..f503a63e752 100644 --- a/sql/sql_cache.cc +++ b/sql/sql_cache.cc @@ -983,7 +983,7 @@ Query_cache::send_result_to_client(THD *thd, char *sql, uint query_length) */ for (tmptable= thd->temporary_tables; tmptable ; tmptable= tmptable->next) { - if (tmptable->key_length - 8 == table->key_len() && + if (tmptable->key_length - TMP_TABLE_KEY_EXTRA == table->key_len() && !memcmp(tmptable->table_cache_key, table->data(), table->key_len())) { @@ -993,7 +993,7 @@ Query_cache::send_result_to_client(THD *thd, char *sql, uint query_length) STRUCT_UNLOCK(&structure_guard_mutex); /* We should not store result of this query because it contain - temporary tables => assign following wariable to make check + temporary tables => assign following variable to make check faster. */ thd->safe_to_cache_query=0; From 743597ea96cbf227c2c5dd34b9837802d62ad834 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 27 Oct 2004 13:33:11 +0300 Subject: [PATCH 0019/1063] Backport innodb_max_purge_lag from 4.1 innobase/include/srv0srv.h: Add configuration parameter srv_max_purge_lag. Add global variable srv_dml_needed_delay. innobase/include/trx0sys.h: Add trx_sys->rseg_history_len innobase/row/row0mysql.c: Add row_mysql_delay_if_needed() for delaying INSERTs, UPDATEs and DELETEs for srv_dml_needed_delay microseconds. innobase/srv/srv0srv.c: Define global variable srv_dml_needed_delay. Define configuration parameter srv_max_purge_lag. innobase/trx/trx0purge.c: Update trx_sys->rseg_history_len. trx_purge(): Compute srv_dml_needed_delay from srv_max_purge_lag and trx_sys->rseg_history_len. innobase/trx/trx0rseg.c: Initialize trx_sys->rseg_history_len at InnoDB start-up. sql/ha_innodb.h: Add configuration parameter srv_max_purge_lag. sql/mysqld.cc: Add startup option innodb_max_purge_lag, with default value 0 (meaning infinite, disabling the feature). sql/set_var.cc: Add global variable innodb_max_purge_lag. --- innobase/include/srv0srv.h | 2 ++ innobase/include/trx0sys.h | 4 ++++ innobase/row/row0mysql.c | 17 +++++++++++++++++ innobase/srv/srv0srv.c | 6 ++++++ innobase/trx/trx0purge.c | 38 ++++++++++++++++++++++++++++++++++++++ innobase/trx/trx0rseg.c | 7 ++++++- sql/ha_innodb.h | 1 + sql/mysqld.cc | 6 ++++++ sql/set_var.cc | 4 ++++ 9 files changed, 84 insertions(+), 1 deletion(-) diff --git a/innobase/include/srv0srv.h b/innobase/include/srv0srv.h index 57ca1f84f26..c76a1917615 100644 --- a/innobase/include/srv0srv.h +++ b/innobase/include/srv0srv.h @@ -99,6 +99,7 @@ extern ibool srv_use_doublewrite_buf; extern ibool srv_set_thread_priorities; extern int srv_query_thread_priority; +extern ulint srv_max_purge_lag; /*-------------------------------------------*/ extern ulint srv_n_rows_inserted; @@ -152,6 +153,7 @@ extern ulint srv_test_array_size; extern ulint srv_activity_count; extern ulint srv_fatal_semaphore_wait_threshold; +extern ulint srv_dml_needed_delay; extern mutex_t* kernel_mutex_temp;/* mutex protecting the server, trx structs, query threads, and lock table: we allocate diff --git a/innobase/include/trx0sys.h b/innobase/include/trx0sys.h index c7ef4d1929d..4d83c5eeaae 100644 --- a/innobase/include/trx0sys.h +++ b/innobase/include/trx0sys.h @@ -419,6 +419,10 @@ struct trx_sys_struct{ trx_rseg_t* rseg_array[TRX_SYS_N_RSEGS]; /* Pointer array to rollback segments; NULL if slot not in use */ + ulint rseg_history_len;/* Length of the TRX_RSEG_HISTORY + list (update undo logs for committed + transactions), protected by + rseg->mutex */ UT_LIST_BASE_NODE_T(read_view_t) view_list; /* List of read views sorted on trx no, biggest first */ diff --git a/innobase/row/row0mysql.c b/innobase/row/row0mysql.c index 3eb4f0de60e..78b2aa8e28f 100644 --- a/innobase/row/row0mysql.c +++ b/innobase/row/row0mysql.c @@ -89,6 +89,19 @@ row_mysql_is_system_table( || 0 == strcmp(name + 6, "user") || 0 == strcmp(name + 6, "db")); } + +/*********************************************************************** +Delays an INSERT, DELETE or UPDATE operation if the purge is lagging. */ +static +void +row_mysql_delay_if_needed(void) +/*===========================*/ +{ + if (srv_dml_needed_delay) { + os_thread_sleep(srv_dml_needed_delay); + } +} + /*********************************************************************** Reads a MySQL format variable-length field (like VARCHAR) length and returns pointer to the field data. */ @@ -856,6 +869,8 @@ row_insert_for_mysql( trx->op_info = (char *) "inserting"; + row_mysql_delay_if_needed(); + trx_start_if_not_started(trx); if (node == NULL) { @@ -1071,6 +1086,8 @@ row_update_for_mysql( trx->op_info = (char *) "updating or deleting"; + row_mysql_delay_if_needed(); + trx_start_if_not_started(trx); node = prebuilt->upd_node; diff --git a/innobase/srv/srv0srv.c b/innobase/srv/srv0srv.c index 0643ab96c1d..0a814268a36 100644 --- a/innobase/srv/srv0srv.c +++ b/innobase/srv/srv0srv.c @@ -58,6 +58,10 @@ ulint srv_activity_count = 0; /* The following is the maximum allowed duration of a lock wait. */ ulint srv_fatal_semaphore_wait_threshold = 600; +/* How much data manipulation language (DML) statements need to be delayed, +in microseconds, in order to reduce the lagging of the purge thread. */ +ulint srv_dml_needed_delay = 0; + ibool srv_lock_timeout_and_monitor_active = FALSE; ibool srv_error_monitor_active = FALSE; @@ -841,6 +845,8 @@ srv_general_init(void) /*======================= InnoDB Server FIFO queue =======================*/ +/* Maximum allowable purge history length. <=0 means 'infinite'. */ +ulint srv_max_purge_lag = 0; /************************************************************************* Puts an OS thread to wait if there are too many concurrent threads diff --git a/innobase/trx/trx0purge.c b/innobase/trx/trx0purge.c index a8b6b9fcc21..d772af47b29 100644 --- a/innobase/trx/trx0purge.c +++ b/innobase/trx/trx0purge.c @@ -295,6 +295,9 @@ trx_purge_add_update_undo_to_history( /* Add the log as the first in the history list */ flst_add_first(rseg_header + TRX_RSEG_HISTORY, undo_header + TRX_UNDO_HISTORY_NODE, mtr); + mutex_enter(&kernel_mutex); + trx_sys->rseg_history_len++; + mutex_exit(&kernel_mutex); /* Write the trx number to the undo log header */ mlog_write_dulint(undo_header + TRX_UNDO_TRX_NO, trx->no, mtr); @@ -386,6 +389,12 @@ loop: flst_cut_end(rseg_hdr + TRX_RSEG_HISTORY, log_hdr + TRX_UNDO_HISTORY_NODE, n_removed_logs, &mtr); + + mutex_enter(&kernel_mutex); + ut_ad(trx_sys->rseg_history_len >= n_removed_logs); + trx_sys->rseg_history_len -= n_removed_logs; + mutex_exit(&kernel_mutex); + freed = FALSE; while (!freed) { @@ -470,6 +479,11 @@ loop: } if (cmp >= 0) { + mutex_enter(&kernel_mutex); + ut_a(trx_sys->rseg_history_len >= n_removed_logs); + trx_sys->rseg_history_len -= n_removed_logs; + mutex_exit(&kernel_mutex); + flst_truncate_end(rseg_hdr + TRX_RSEG_HISTORY, log_hdr + TRX_UNDO_HISTORY_NODE, n_removed_logs, &mtr); @@ -1031,6 +1045,30 @@ trx_purge(void) purge_sys->view = NULL; mem_heap_empty(purge_sys->heap); + /* Determine how much data manipulation language (DML) statements + need to be delayed in order to reduce the lagging of the purge + thread. */ + srv_dml_needed_delay = 0; /* in microseconds; default: no delay */ + + /* If we cannot advance the 'purge view' because of an old + 'consistent read view', then the DML statements cannot be delayed. + Also, srv_max_purge_lag <= 0 means 'infinity'. */ + if (srv_max_purge_lag > 0 + && !UT_LIST_GET_LAST(trx_sys->view_list)) { + float ratio = (float) trx_sys->rseg_history_len + / srv_max_purge_lag; + if (ratio > ULINT_MAX / 10000) { + /* Avoid overflow: maximum delay is 4295 seconds */ + srv_dml_needed_delay = ULINT_MAX; + } else if (ratio > 1) { + /* If the history list length exceeds the + innodb_max_purge_lag, the + data manipulation statements are delayed + by at least 5000 microseconds. */ + srv_dml_needed_delay = (ulint) ((ratio - .5) * 10000); + } + } + purge_sys->view = read_view_oldest_copy_or_open_new(NULL, purge_sys->heap); mutex_exit(&kernel_mutex); diff --git a/innobase/trx/trx0rseg.c b/innobase/trx/trx0rseg.c index e3885c86def..a01d4bb835d 100644 --- a/innobase/trx/trx0rseg.c +++ b/innobase/trx/trx0rseg.c @@ -135,6 +135,7 @@ trx_rseg_mem_create( trx_ulogf_t* undo_log_hdr; fil_addr_t node_addr; ulint sum_of_undo_sizes; + ulint len; #ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&kernel_mutex)); @@ -166,7 +167,9 @@ trx_rseg_mem_create( MLOG_4BYTES, mtr) + 1 + sum_of_undo_sizes; - if (flst_get_len(rseg_header + TRX_RSEG_HISTORY, mtr) > 0) { + len = flst_get_len(rseg_header + TRX_RSEG_HISTORY, mtr); + if (len > 0) { + trx_sys->rseg_history_len += len; node_addr = trx_purge_get_log_from_hist( flst_get_last(rseg_header + TRX_RSEG_HISTORY, @@ -206,6 +209,8 @@ trx_rseg_list_and_array_init( UT_LIST_INIT(trx_sys->rseg_list); + trx_sys->rseg_history_len = 0; + for (i = 0; i < TRX_SYS_N_RSEGS; i++) { page_no = trx_sysf_rseg_get_page_no(sys_header, i, mtr); diff --git a/sql/ha_innodb.h b/sql/ha_innodb.h index 5736f70c65c..74acc0640c9 100644 --- a/sql/ha_innodb.h +++ b/sql/ha_innodb.h @@ -207,6 +207,7 @@ extern my_bool innobase_log_archive, innobase_create_status_file; extern "C" { extern ulong srv_max_buf_pool_modified_pct; +extern ulong srv_max_purge_lag; } extern TYPELIB innobase_lock_typelib; diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 5838bd909dd..d36b441ac9a 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -3520,6 +3520,7 @@ enum options_mysqld { OPT_INNODB_LOG_BUFFER_SIZE, OPT_INNODB_BUFFER_POOL_SIZE, OPT_INNODB_ADDITIONAL_MEM_POOL_SIZE, + OPT_INNODB_MAX_PURGE_LAG, OPT_INNODB_FILE_IO_THREADS, OPT_INNODB_LOCK_WAIT_TIMEOUT, OPT_INNODB_THREAD_CONCURRENCY, @@ -3700,6 +3701,11 @@ struct my_option my_long_options[] = {"innodb_max_dirty_pages_pct", OPT_INNODB_MAX_DIRTY_PAGES_PCT, "Percentage of dirty pages allowed in bufferpool", (gptr*) &srv_max_buf_pool_modified_pct, (gptr*) &srv_max_buf_pool_modified_pct, 0, GET_ULONG, REQUIRED_ARG, 90, 0, 100, 0, 0, 0}, + {"innodb_max_purge_lag", OPT_INNODB_MAX_PURGE_LAG, + "", + (gptr*) &srv_max_purge_lag, + (gptr*) &srv_max_purge_lag, 0, GET_LONG, REQUIRED_ARG, 0, 0, ~0L, + 0, 1L, 0}, {"innodb_table_locks", OPT_INNODB_TABLE_LOCKS, "If Innodb should enforce LOCK TABLE", (gptr*) &global_system_variables.innodb_table_locks, diff --git a/sql/set_var.cc b/sql/set_var.cc index a6a5ea72c71..d5aadbfbdab 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -263,6 +263,8 @@ sys_var_thd_ulong sys_net_wait_timeout("wait_timeout", #ifdef HAVE_INNOBASE_DB sys_var_long_ptr sys_innodb_max_dirty_pages_pct("innodb_max_dirty_pages_pct", &srv_max_buf_pool_modified_pct); +sys_var_long_ptr sys_innodb_max_purge_lag("innodb_max_purge_lag", + &srv_max_purge_lag); sys_var_thd_bool sys_innodb_table_locks("innodb_table_locks", &SV::innodb_table_locks); #endif @@ -451,6 +453,7 @@ sys_var *sys_variables[]= &sys_os, #ifdef HAVE_INNOBASE_DB &sys_innodb_max_dirty_pages_pct, + &sys_innodb_max_purge_lag, &sys_innodb_table_locks, #endif &sys_unique_checks @@ -523,6 +526,7 @@ struct show_var_st init_vars[]= { {"innodb_log_group_home_dir", (char*) &innobase_log_group_home_dir, SHOW_CHAR_PTR}, {"innodb_mirrored_log_groups", (char*) &innobase_mirrored_log_groups, SHOW_LONG}, {sys_innodb_max_dirty_pages_pct.name, (char*) &sys_innodb_max_dirty_pages_pct, SHOW_SYS}, + {sys_innodb_max_purge_lag.name, (char*) &sys_innodb_max_purge_lag, SHOW_SYS}, {sys_innodb_table_locks.name, (char*) &sys_innodb_table_locks, SHOW_SYS}, #endif {sys_interactive_timeout.name,(char*) &sys_interactive_timeout, SHOW_SYS}, From d43421155e1f8d70fbe0abebf6a04d56b93d4670 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 27 Oct 2004 17:54:10 +0200 Subject: [PATCH 0020/1063] Change 'Build-tools/mysql-copyright' to ensure the receiving machines will build without trying to re-run autotools. (Backport from 4.1.7 for 4.0.22) Build-tools/mysql-copyright: The top level Makefile will try to re-run the autotools unless the timestamps of the relevant files are in truly ascending order. Ensure this order! (Backport from 4.1.7 for 4.0.22) --- Build-tools/mysql-copyright | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/Build-tools/mysql-copyright b/Build-tools/mysql-copyright index 251a6c78d23..81d6d761498 100755 --- a/Build-tools/mysql-copyright +++ b/Build-tools/mysql-copyright @@ -3,7 +3,7 @@ # Untar a MySQL distribution, change the copyright texts, # pack it up again to a given directory -$VER="1.4"; +$VER="1.5"; use Cwd; use File::Basename; @@ -103,9 +103,8 @@ sub main unlink("$destdir/PUBLIC", "$destdir/README"); unlink("$destdir/COPYING", "$destdir/EXCEPTIONS-CLIENT"); copy("$WD/Docs/MySQLEULA.txt", "$destdir"); - + # remove subdirectories 'bdb', 'cmd-line-utils/readline' - # (latter does not apply to 4.0, but is in different place there!) my @extra_fat= ('bdb', 'cmd-line-utils/readline'); foreach my $fat (@extra_fat) @@ -116,7 +115,7 @@ sub main # fix file copyrights &fix_usage_copyright(); &add_copyright(); - + # fix LICENSE tag in include/mysql_version.h &fix_mysql_version(); @@ -135,7 +134,6 @@ sub main # remove temporary directory chdir($WD) or print "$! Unable to move up one dir\n"; - `cd $WD`; my $cwd = getcwd(); print "current dir is $cwd\n" if $opt_verbose ; if (-e $dir) { @@ -146,7 +144,7 @@ sub main } } exit(0); -} +} #### #### This function will s/GPL/Commercial/ in include/mysql_version.h for the @@ -175,6 +173,7 @@ sub fix_mysql_version #### This function will remove unwanted parts of a src tree for the mysqlcom #### distributions. #### + sub trim_the_fat { my $the_fat= shift; @@ -219,6 +218,7 @@ sub trim_the_fat #### #### This function will run the autotools on the reduced source tree. #### + sub run_autotools { my $cwd= getcwd(); @@ -230,7 +230,14 @@ sub run_autotools # File "configure.in" has already been modified by "trim_the_fat()" - `aclocal && autoheader && aclocal && automake && autoconf`; + # It must be ensured that the timestamps of the relevant files are really + # ascending, for otherwise the Makefile may cause a re-run of these + # autotools. Experience shows that deletion is the only safe way. + unlink ("config.h.in") or die "Can't delete $destdir/config.h.in: $!\n"; + unlink ("aclocal.m4") or die "Can't delete $destdir/aclocal.m4: $!\n"; + + # These sleep commands also ensure the ascending order. + `aclocal && sleep 2 && autoheader && sleep 2 && automake && sleep 2 && autoconf`; die "'./configure' was not produced!" unless (-f "configure"); if (-d "autom4te.cache") { From 3bdd7e77fdb66acb4d051dec2b1c4fd136a49f9c Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 27 Oct 2004 18:57:49 +0300 Subject: [PATCH 0021/1063] Fix when compiling without InnoDB BitKeeper/deleted/.del-innodb-lock-master.opt~f76a4a1999728f87: Delete: mysql-test/t/innodb-lock-master.opt --- mysql-test/r/innodb-lock.result | 1 + mysql-test/t/innodb-lock-master.opt | 1 - mysql-test/t/innodb-lock.test | 5 +++++ 3 files changed, 6 insertions(+), 1 deletion(-) delete mode 100644 mysql-test/t/innodb-lock-master.opt diff --git a/mysql-test/r/innodb-lock.result b/mysql-test/r/innodb-lock.result index 407a85ed038..4ace4065c34 100644 --- a/mysql-test/r/innodb-lock.result +++ b/mysql-test/r/innodb-lock.result @@ -1,3 +1,4 @@ +set global innodb_table_locks=1; select @@innodb_table_locks; @@innodb_table_locks 1 diff --git a/mysql-test/t/innodb-lock-master.opt b/mysql-test/t/innodb-lock-master.opt deleted file mode 100644 index 403fcde87ed..00000000000 --- a/mysql-test/t/innodb-lock-master.opt +++ /dev/null @@ -1 +0,0 @@ ---innodb-table-lock=1 diff --git a/mysql-test/t/innodb-lock.test b/mysql-test/t/innodb-lock.test index 430369f4fda..a3b6f8993f2 100644 --- a/mysql-test/t/innodb-lock.test +++ b/mysql-test/t/innodb-lock.test @@ -4,6 +4,8 @@ # Check and select innodb lock type # +set global innodb_table_locks=1; + select @@innodb_table_locks; # @@ -12,7 +14,10 @@ select @@innodb_table_locks; connect (con1,localhost,root,,); connect (con2,localhost,root,,); + +--disable_warnings drop table if exists t1; +--enable_warnings # # Testing of explicit table locks with enforced table locks From 5bef45506fc01df3021db1679d3dce488d18bee7 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 27 Oct 2004 17:30:12 +0000 Subject: [PATCH 0022/1063] Implemented fragmented signal from API primarily to enable creation of tables with more attributes than 91 (up to 128) Intermediate push for testing CHUNK_SZ will be set higher in real implementation and API_TRACE added --- ndb/src/ndbapi/TransporterFacade.cpp | 113 +++++++++++++++++++++++++-- ndb/src/ndbapi/TransporterFacade.hpp | 3 +- 2 files changed, 108 insertions(+), 8 deletions(-) diff --git a/ndb/src/ndbapi/TransporterFacade.cpp b/ndb/src/ndbapi/TransporterFacade.cpp index bc24110ea14..0377cf0c84b 100644 --- a/ndb/src/ndbapi/TransporterFacade.cpp +++ b/ndb/src/ndbapi/TransporterFacade.cpp @@ -475,7 +475,8 @@ TransporterFacade::TransporterFacade() : theTransporterRegistry(0), theStopReceive(0), theSendThread(NULL), - theReceiveThread(NULL) + theReceiveThread(NULL), + m_fragmented_signal_id(0) { theOwnId = 0; @@ -833,6 +834,105 @@ TransporterFacade::sendSignalUnCond(NdbApiSignal * aSignal, NodeId aNode){ return (ss == SEND_OK ? 0 : -1); } +#define CHUNK_SZ 100u +int +TransporterFacade::sendFragmentedSignal(NdbApiSignal* aSignal, NodeId aNode, + LinearSectionPtr ptr[3], Uint32 secs){ + NdbApiSignal tmp_signal(*(SignalHeader*)aSignal); + LinearSectionPtr tmp_ptr[3]; + Uint32 unique_id= m_fragmented_signal_id++; // next unique id + unsigned i; + for (i= 0; i < secs; i++) + tmp_ptr[i]= ptr[i]; + + unsigned start_i= 0; + unsigned chunk_sz= 0; + unsigned fragment_info= 0; + Uint32 *tmp_data= tmp_signal.getDataPtrSend(); + for (i= 0; i < secs;) { + unsigned save_sz= tmp_ptr[i].sz; + tmp_data[i-start_i]= i; + if (chunk_sz + save_sz > CHUNK_SZ) { + // truncate + unsigned send_sz= CHUNK_SZ - chunk_sz; + tmp_ptr[i].sz= send_sz; + if (fragment_info < 2) + fragment_info++; + + // send tmp_signal + tmp_data[i-start_i+1]= unique_id; + tmp_signal.setLength(i-start_i+2); + tmp_signal.m_fragmentInfo= fragment_info; + // do prepare send + { + int ret; + if(getIsNodeSendable(aNode) == true){ + SendStatus ss = theTransporterRegistry->prepareSend + (&tmp_signal, + 1, // JBB + tmp_signal.getDataPtrSend(), + aNode, + &ptr[start_i]); + assert(ss != SEND_MESSAGE_TOO_BIG); + ret = (ss == SEND_OK ? 0 : -1); + } else + ret = -1; + if (ret != SEND_OK) + return ret; + } + + // setup variables for next signal + start_i= i; + chunk_sz= 0; + tmp_ptr[i].sz= save_sz-send_sz; + tmp_ptr[i].p+= send_sz; + } + else + { + chunk_sz+= save_sz; + i++; + } + } + + unsigned a_sz= aSignal->getLength(); + + if (fragment_info > 0) { + // update the original signal to include section info + Uint32 *a_data= aSignal->getDataPtrSend(); + unsigned tmp_sz= i-start_i; + memcpy(a_data+a_sz, + tmp_data, + tmp_sz*sizeof(Uint32)); + a_data[a_sz+tmp_sz]= unique_id; + aSignal->setLength(a_sz+tmp_sz+1); + + // send last fragment + aSignal->m_fragmentInfo= 3; + aSignal->m_noOfSections= i-start_i; + } else { + aSignal->m_noOfSections= secs; + } + + // send aSignal + int ret; + if(getIsNodeSendable(aNode) == true){ + SendStatus ss = theTransporterRegistry->prepareSend + (aSignal, + 1, // JBB + aSignal->getDataPtrSend(), + aNode, + &ptr[start_i]); + assert(ss != SEND_MESSAGE_TOO_BIG); + ret = (ss == SEND_OK ? 0 : -1); + } else + ret = -1; + aSignal->m_noOfSections = 0; + aSignal->m_fragmentInfo = 0; + aSignal->setLength(a_sz); + return ret; +} + +#if 0 int TransporterFacade::sendFragmentedSignal(NdbApiSignal* aSignal, NodeId aNode, LinearSectionPtr ptr[3], Uint32 secs){ @@ -864,7 +964,7 @@ TransporterFacade::sendFragmentedSignal(NdbApiSignal* aSignal, NodeId aNode, aSignal->m_noOfSections = 0; return -1; } - +#endif int @@ -886,11 +986,10 @@ TransporterFacade::sendFragmentedSignalUnCond(NdbApiSignal* aSignal, aSignal->theSendersBlockRef = tmp; } #endif - SendStatus ss = theTransporterRegistry->prepareSend(aSignal, - 1, // JBB - aSignal->getDataPtrSend(), - aNode, - ptr); + SendStatus ss = + theTransporterRegistry->prepareSend(aSignal, 1, // JBB + aSignal->getDataPtrSend(), + aNode, ptr); assert(ss != SEND_MESSAGE_TOO_BIG); aSignal->m_noOfSections = 0; return (ss == SEND_OK ? 0 : -1); diff --git a/ndb/src/ndbapi/TransporterFacade.hpp b/ndb/src/ndbapi/TransporterFacade.hpp index 5f473975585..b288e2ee8e6 100644 --- a/ndb/src/ndbapi/TransporterFacade.hpp +++ b/ndb/src/ndbapi/TransporterFacade.hpp @@ -224,7 +224,8 @@ private: } m_threads; Uint32 m_max_trans_id; - + Uint32 m_fragmented_signal_id; + /** * execute function */ From 464da8f13a69d7ce51e1c130475e1a8c4cab59a5 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 27 Oct 2004 21:11:06 +0300 Subject: [PATCH 0023/1063] removed incorrect error message about aggregate functions improved mechanisn of detection posibility to be NULL for single row queries switched off substitution optimisation for single row subqueries in PS due to problem in resolving substituted expressions (changes to make subselects test working with PS protocol) mysql-test/r/subselect.result: removed incorrect error message about aggregate functions improved mechanisn of detection posibility to be NULL for single row queries mysql-test/t/subselect.test: removed incorrect error message about aggregate functions sql/item_subselect.cc: removed incorrect error message about aggregate functions switched off substitution optimisation for single row subqueries in PS due to problem in resolving substituted expressions improved mechanisn of detection posibility to be NULL for single row queries sql/item_subselect.h: new method to help in NULL ability detection --- mysql-test/r/subselect.result | 15 +++--- mysql-test/t/subselect.test | 5 +- sql/item_subselect.cc | 91 +++++++++++++++++++++++++++++------ sql/item_subselect.h | 4 ++ 4 files changed, 91 insertions(+), 24 deletions(-) diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index 04c5f685f58..32d482f5a32 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -55,7 +55,7 @@ SELECT 1 FROM (SELECT 1 as a) as b HAVING (SELECT a)=1; 1 1 SELECT (SELECT 1), a; -ERROR 42S22: Unknown column 'a' in 'checking transformed subquery' +ERROR 42S22: Unknown column 'a' in 'field list' SELECT 1 as a FROM (SELECT 1) as b HAVING (SELECT a)=1; a 1 @@ -999,7 +999,9 @@ drop table t1, t2; CREATE TABLE `t1` (`i` int(11) NOT NULL default '0',PRIMARY KEY (`i`)) ENGINE=MyISAM CHARSET=latin1; INSERT INTO t1 VALUES (1); UPDATE t1 SET i=i+1 WHERE i=(SELECT MAX(i)); -ERROR HY000: Invalid use of group function +select * from t1; +i +1 drop table t1; CREATE TABLE t1 (a int(1)); EXPLAIN EXTENDED SELECT (SELECT RAND() FROM t1) FROM t1; @@ -1084,7 +1086,7 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `a` bigint(20) NOT NULL default '0', - `(SELECT a)` bigint(20) default NULL + `(SELECT a)` bigint(20) NOT NULL default '0' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; CREATE TABLE t1 SELECT * FROM (SELECT 1 as a,(SELECT a+0)) a; @@ -1102,7 +1104,7 @@ a SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` bigint(20) default NULL + `a` bigint(20) NOT NULL default '0' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; create table t1 (a int); @@ -1186,11 +1188,12 @@ PRIMARY KEY (`i`) ) ENGINE=MyISAM CHARSET=latin1; INSERT INTO t1 VALUES (1); UPDATE t1 SET i=i+(SELECT MAX(i) FROM (SELECT 1) t) WHERE i=(SELECT MAX(i)); -ERROR HY000: Invalid use of group function UPDATE t1 SET i=i+1 WHERE i=(SELECT MAX(i)); -ERROR HY000: Invalid use of group function UPDATE t1 SET t.i=i+(SELECT MAX(i) FROM (SELECT 1) t); ERROR 42S02: Unknown table 't' in field list +select * from t1; +i +1 drop table t1; CREATE TABLE t1 ( id int(11) default NULL diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test index 5e3aa4064e4..e0f6fcbf515 100644 --- a/mysql-test/t/subselect.test +++ b/mysql-test/t/subselect.test @@ -543,8 +543,8 @@ drop table t1, t2; CREATE TABLE `t1` (`i` int(11) NOT NULL default '0',PRIMARY KEY (`i`)) ENGINE=MyISAM CHARSET=latin1; INSERT INTO t1 VALUES (1); --- error 1111 UPDATE t1 SET i=i+1 WHERE i=(SELECT MAX(i)); +select * from t1; drop table t1; #test of uncacheable subqueries @@ -689,12 +689,11 @@ CREATE TABLE `t1` ( ) ENGINE=MyISAM CHARSET=latin1; INSERT INTO t1 VALUES (1); --- error 1111 UPDATE t1 SET i=i+(SELECT MAX(i) FROM (SELECT 1) t) WHERE i=(SELECT MAX(i)); --- error 1111 UPDATE t1 SET i=i+1 WHERE i=(SELECT MAX(i)); -- error 1109 UPDATE t1 SET t.i=i+(SELECT MAX(i) FROM (SELECT 1) t); +select * from t1; drop table t1; # diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index a869e2d24fb..401d4dee20f 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -164,12 +164,7 @@ bool Item_subselect::fix_fields(THD *thd_param, TABLE_LIST *tables, Item **ref) thd->where= "checking transformed subquery"; if (!(*ref)->fixed) ret= (*ref)->fix_fields(thd, tables, ref); - // We can't substitute aggregate functions like "SELECT (max(i))" - if (substype() == SINGLEROW_SUBS && (*ref)->with_sum_func) - { - my_error(ER_INVALID_GROUP_FUNC_USE, MYF(0)); - return 1; - } + thd->where= save_where; return ret; } // Is it one field subselect? @@ -322,6 +317,7 @@ Item_singlerow_subselect::select_transformer(JOIN *join) if (!select_lex->master_unit()->first_select()->next_select() && !select_lex->table_list.elements && select_lex->item_list.elements == 1 && + !select_lex->item_list.head()->with_sum_func && /* We cant change name of Item_field or Item_ref, because it will prevent it's correct resolving, but we should save name of @@ -330,7 +326,13 @@ Item_singlerow_subselect::select_transformer(JOIN *join) TODO: solve above problem */ !(select_lex->item_list.head()->type() == FIELD_ITEM || - select_lex->item_list.head()->type() == REF_ITEM) + select_lex->item_list.head()->type() == REF_ITEM) && + /* + switch off this optimisation for prepare statement, + because we do not rollback this changes + TODO: make rollback for it, or special name resolving mode in 5.0. + */ + !arena->is_stmt_prepare() ) { @@ -352,9 +354,6 @@ Item_singlerow_subselect::select_transformer(JOIN *join) if (join->conds || join->having) { Item *cond; - if (arena->is_stmt_prepare()) - thd->set_n_backup_item_arena(arena, &backup); - if (!join->having) cond= join->conds; else if (!join->conds) @@ -365,16 +364,12 @@ Item_singlerow_subselect::select_transformer(JOIN *join) if (!(substitution= new Item_func_if(cond, substitution, new Item_null()))) goto err; - if (arena->is_stmt_prepare()) - thd->restore_backup_item_arena(arena, &backup); - } + } return RES_REDUCE; } return RES_OK; err: - if (arena->is_stmt_prepare()) - thd->restore_backup_item_arena(arena, &backup); return RES_ERROR; } @@ -401,6 +396,13 @@ void Item_singlerow_subselect::fix_length_and_dec() engine->fix_length_and_dec(row); value= *row; } + /* + If there are not tables in subquery then ability to have NULL value + depends on SELECT list (if single row subquery have tables then it + always can be NULL if there are not records fetched). + */ + if (engine->no_tables()) + maybe_null= engine->may_be_null(); } uint Item_singlerow_subselect::cols() @@ -644,6 +646,7 @@ Item_subselect::trans_res Item_in_subselect::single_value_transformer(JOIN *join, Comp_creator *func) { + const char *save_where= thd->where; DBUG_ENTER("Item_in_subselect::single_value_transformer"); if (changed) @@ -899,6 +902,7 @@ Item_in_subselect::single_value_transformer(JOIN *join, ok: if (arena->is_stmt_prepare()) thd->restore_backup_item_arena(arena, &backup); + thd->where= save_where; DBUG_RETURN(RES_OK); err: @@ -911,6 +915,7 @@ err: Item_subselect::trans_res Item_in_subselect::row_value_transformer(JOIN *join) { + const char *save_where= thd->where; DBUG_ENTER("Item_in_subselect::row_value_transformer"); if (changed) @@ -1003,6 +1008,7 @@ Item_in_subselect::row_value_transformer(JOIN *join) } if (arena->is_stmt_prepare()) thd->restore_backup_item_arena(arena, &backup); + thd->where= save_where; DBUG_RETURN(RES_OK); err: @@ -1562,3 +1568,58 @@ int subselect_uniquesubquery_engine::change_item(Item_subselect *si, DBUG_ASSERT(0); return -1; } + + +/* + Report about presence of tables in subquery + + SINOPSYS + subselect_single_select_engine::no_tables() + + RETURN + TRUE there are not tables used in subquery + FALSE there are some tables in subquery +*/ +bool subselect_single_select_engine::no_tables() +{ + return(select_lex->table_list.elements == 0); +} + + +/* + Report about presence of tables in subquery + + SINOPSYS + subselect_union_engine::no_tables() + + RETURN + TRUE there are not tables used in subquery + FALSE there are some tables in subquery +*/ +bool subselect_union_engine::no_tables() +{ + for (SELECT_LEX *sl= unit->first_select(); sl; sl= sl->next_select()) + { + if (sl->table_list.elements) + return FALSE; + } + return TRUE; +} + + +/* + Report about presence of tables in subquery + + SINOPSYS + subselect_uniquesubquery_engine::no_tables() + + RETURN + TRUE there are not tables used in subquery + FALSE there are some tables in subquery +*/ + +bool subselect_uniquesubquery_engine::no_tables() +{ + /* returning value is correct, but this method should never be called */ + return 0; +} diff --git a/sql/item_subselect.h b/sql/item_subselect.h index f570d89f28f..764c41f33b4 100644 --- a/sql/item_subselect.h +++ b/sql/item_subselect.h @@ -291,6 +291,7 @@ public: static table_map calc_const_tables(TABLE_LIST *); virtual void print(String *str)= 0; virtual int change_item(Item_subselect *si, select_subselect *result)= 0; + virtual bool no_tables()= 0; }; @@ -315,6 +316,7 @@ public: table_map upper_select_const_tables(); void print (String *str); int change_item(Item_subselect *si, select_subselect *result); + bool no_tables(); }; @@ -335,6 +337,7 @@ public: table_map upper_select_const_tables(); void print (String *str); int change_item(Item_subselect *si, select_subselect *result); + bool no_tables(); }; @@ -364,6 +367,7 @@ public: table_map upper_select_const_tables() { return 0; } void print (String *str); int change_item(Item_subselect *si, select_subselect *result); + bool no_tables(); }; From d6065cb4cd11037e45559a019557e6b0e35f6a9c Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 27 Oct 2004 13:44:31 -0500 Subject: [PATCH 0024/1063] texi2html: Updated version of texi2html so that 4.0.22 HTML manual doesn't turn out all goofy. Docs/Support/texi2html: Updated version of texi2html so that 4.0.22 HTML manual doesn't turn out all goofy. --- Docs/Support/texi2html | 98 +++++++++++++++++++++++------------------- 1 file changed, 53 insertions(+), 45 deletions(-) diff --git a/Docs/Support/texi2html b/Docs/Support/texi2html index 8067d8f72ce..f13c006c7dc 100755 --- a/Docs/Support/texi2html +++ b/Docs/Support/texi2html @@ -1,4 +1,4 @@ -#!PATH_TO_PERL -*- perl -*- +#!/usr/bin/perl # Add path to perl on the previous line and make this executable # if you want to use this as a normal script. 'di '; @@ -12,7 +12,7 @@ #-############################################################################## # @(#)texi2html 1.52 971230 Written (mainly) by Lionel Cons, Lionel.Cons@cern.ch -# Enhanced by David Axmark, david@detron.se +# Enhanced by David Axmark # The man page for this program is included at the end of this file and can be # viewed using the command 'nroff -man texi2html'. @@ -40,8 +40,7 @@ $NODESRE = '[^@{}:\'`"]+'; # RE for a list of node names $XREFRE = '[^@{}]+'; # RE for a xref (should use NODERE) $ERROR = "***"; # prefix for errors and warnings -$THISPROG = "texi2html 1.52 (hacked by david\@detron.se)"; # program name and version -$HOMEPAGE = "http://www.mathematik.uni-kl.de/~obachman/Texi2html/"; # program home page +$THISPROG = "texi2html 1.52 (with additions by MySQL AB)"; # program name and version $TODAY = &pretty_date; # like "20 September 1993" $SPLITTAG = "\n"; # tag to know where to split $PROTECTTAG = "_ThisIsProtected_"; # tag to recognize protected sections @@ -114,10 +113,12 @@ $html2_doctype = '", # HTML+ + "*", "
", # HTML+ " ", " ", "\n", "\n", "|", "", @@ -134,6 +135,8 @@ $html2_doctype = '', # paragraph break + 'br', '

', # paragraph break 'bullet', '*', 'copyright', '(C)', + 'registeredsymbol', '(R)', 'dots', '...', 'equiv', '==', 'error', 'error-->', @@ -161,27 +165,28 @@ $html2_doctype = '\n", __LINE__)); + push(@lines, &debug("\n", __LINE__)); } else { warn "$ERROR Bad table line: $_"; } @@ -873,7 +887,7 @@ READ_LINE: while ($_ = &next_line) &simple_substitutions; s/\@value{($VARRE)}/$value{$1}/eg; s/\@footnote\{/\@footnote$docu_doc\{/g; # mark footnotes, cf. pass 4 - s|\s+\@tab\s*| \n", __LINE__)) unless $html_element eq 'TABLE'; &html_pop_if('TR'); - $what =~ s|\s+\@tab\s*|
|g if ($in_multitable); + s/(^|\s+)\@tab\s*/ <\/TD> /g if ($in_multitable); # # analyze the tag again @@ -885,7 +899,7 @@ READ_LINE: while ($_ = &next_line) $name =~ s/\s+$//; $level = $sec2level{$tag}; $name = &update_sec_num($tag, $level) . " $name" - if $number_sections && $tag !~ /^unnumbered/; + if $number_sections && $tag !~ /^unnumbered/ && $tag ne 'subsubheading'; if ($tag =~ /heading$/) { push(@lines, &html_debug("\n", __LINE__)); if ($html_element ne 'body') { @@ -1079,7 +1093,7 @@ EOC push(@lines, &debug("
|g; + $what =~ s/(^|\s+)\@tab\s*/ <\/TD> /g; push(@lines, &debug("
$what\n", __LINE__)); &html_push('TR'); if ($deferred_ref) @@ -1463,11 +1477,7 @@ print "# end of pass 4\n" if $verbose; # # #---############################################################################ -$header = < -EOT - + $header = ''; $full_title = $value{'_title'} || $value{'_settitle'} || "Untitled Document"; $title = $value{'_settitle'} || $full_title; $_ = &substitute_style($full_title); @@ -1815,8 +1825,10 @@ sub fix_image die "error in image: '$text'" unless defined($1); $arg1 = $1; $arg1 =~ s/@@/@/g; - $ext = "jpg" if -f "$arg1.jpg"; - $ext = "gif" if -f "$arg1.gif"; + foreach (@include_dirs) { + $ext = "jpg" if -f "$_/$arg1.jpg"; + $ext = "gif" if -f "$_/$arg1.gif"; + } if (defined($ext)) { ""; @@ -2010,7 +2022,7 @@ sub print_toplevel_header { local($_); - &print_header; # pass given arg... + &print_header unless $opt_empty_headers; # pass given arg... print FILE $full_title; if ($value{'_subtitle'}) { $value{'_subtitle'} =~ s/\n+$//; @@ -2042,13 +2054,7 @@ EOT sub print_toplevel_footer { - &print_ruler; - print FILE <texi2html -translator version 1.52 (extended by davida\@detron.se).

-EOT - &print_footer; + &print_footer unless $opt_empty_headers; } sub protect_texi @@ -2065,8 +2071,10 @@ sub protect_html { local($what) = @_; # protect & < > - # Avoid loop in & replacement. This instead bugs out for &# in text.. - $what =~ s/\&([^#]|$)/\&\#38;$1/g; + # hack for the two entity-like variable reference in existing examples + $what =~ s/\&(length|ts);/\&\#38;$1;/g; + # this leaves alone entities, but encodes standalone ampersands + $what =~ s/\&(?!([a-z0-9]+|#\d+);)/\&\#38;/ig; $what =~ s/\/\&\#62;/g; # but recognize some HTML things From 8ace53109ecc69efc166816b01470ed7333bd862 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 27 Oct 2004 21:56:17 +0300 Subject: [PATCH 0025/1063] Fixed access to freed memory innobase/srv/srv0srv.c: after merge fix sql/set_var.cc: after merge fix sql/sql_cache.cc: after merge fix --- innobase/srv/srv0srv.c | 2 -- sql/set_var.cc | 2 -- sql/sql_cache.cc | 6 +++--- sql/sql_insert.cc | 6 ++++-- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/innobase/srv/srv0srv.c b/innobase/srv/srv0srv.c index 582f43fa4ec..b8d03cfab5f 100644 --- a/innobase/srv/srv0srv.c +++ b/innobase/srv/srv0srv.c @@ -881,8 +881,6 @@ srv_general_init(void) /*======================= InnoDB Server FIFO queue =======================*/ -/* Maximum allowable purge history length. <=0 means 'infinite'. */ -ulint srv_max_purge_lag = 0; /************************************************************************* Puts an OS thread to wait if there are too many concurrent threads diff --git a/sql/set_var.cc b/sql/set_var.cc index d8c1ed2c975..905bffac29a 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -358,8 +358,6 @@ sys_var_thd_bool sys_innodb_table_locks("innodb_table_locks", &SV::innodb_table_locks); sys_var_long_ptr sys_innodb_autoextend_increment("innodb_autoextend_increment", &srv_auto_extend_increment); -sys_var_long_ptr sys_innodb_max_purge_lag("innodb_max_purge_lag", - &srv_max_purge_lag); #endif /* Time/date/datetime formats */ diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc index be50b48d264..1bf8d179770 100644 --- a/sql/sql_cache.cc +++ b/sql/sql_cache.cc @@ -1037,9 +1037,9 @@ Query_cache::send_result_to_client(THD *thd, char *sql, uint query_length) */ for (tmptable= thd->temporary_tables; tmptable ; tmptable= tmptable->next) { - if (tmptable->key_length - TMP_TABLE_KEY_EXTRA == table->key_len() && + if (tmptable->key_length - TMP_TABLE_KEY_EXTRA == table->key_length() && !memcmp(tmptable->table_cache_key, table->data(), - table->key_len())) + table->key_length())) { DBUG_PRINT("qcache", ("Temporary table detected: '%s.%s'", @@ -1050,7 +1050,7 @@ Query_cache::send_result_to_client(THD *thd, char *sql, uint query_length) temporary tables => assign following variable to make check faster. */ - thd->safe_to_cache_query=0; + thd->lex->safe_to_cache_query=0; BLOCK_UNLOCK_RD(query_block); DBUG_RETURN(-1); } diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 2c48d1dca8f..648549ca3ac 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -1681,9 +1681,10 @@ bool select_create::send_eof() */ if (!table->tmp_table) { + ulong version= table->version; hash_delete(&open_cache,(byte*) table); /* Tell threads waiting for refresh that something has happened */ - if (table->version != refresh_version) + if (version != refresh_version) VOID(pthread_cond_broadcast(&COND_refresh)); } lock=0; @@ -1707,11 +1708,12 @@ void select_create::abort() enum db_type table_type=table->db_type; if (!table->tmp_table) { + ulong version= table->version; hash_delete(&open_cache,(byte*) table); if (!create_info->table_existed) quick_rm_table(table_type, db, name); /* Tell threads waiting for refresh that something has happened */ - if (table->version != refresh_version) + if (version != refresh_version) VOID(pthread_cond_broadcast(&COND_refresh)); } else if (!create_info->table_existed) From 447fef48fdb3bb96ad51394d24708a68f56cda9f Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 27 Oct 2004 23:46:22 +0400 Subject: [PATCH 0026/1063] A fix and test case for Bug#6096 "field.max_length is always zero for numeric columns (stmt_resultset_metadata)" libmysql/libmysql.c: A fix for Bug#6096 "field.max_length is always zero for numeric columns (stmt_resultset_metadata)": set field->max_lenght for numeric columns when we set up skip_result functions. A minor drawback for this approach is that field->max_length can be not zero even if STMT_ATTR_UPDATE_MAX_LENGTH is not set. sql-common/my_time.c: Fix valgrind warning. tests/client_test.c: A test case for Bug#6096 "field.max_length is always zero for numeric columns (stmt_resultset_metadata) --- libmysql/libmysql.c | 21 ++++++++- sql-common/my_time.c | 3 -- tests/client_test.c | 101 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 120 insertions(+), 5 deletions(-) diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index 2dfdfbb687b..9195f0a5bc5 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -1752,6 +1752,7 @@ static void stmt_update_metadata(MYSQL_STMT *stmt, MYSQL_ROWS *data); */ #define MAX_DATETIME_REP_LENGTH 12 +#define MAX_DOUBLE_STRING_REP_LENGTH 331 /**************** Misc utility functions ****************************/ @@ -3265,7 +3266,12 @@ static void read_binary_time(MYSQL_TIME *tm, uchar **pos) tm->second= (uint) to[7]; tm->second_part= (length > 8) ? (ulong) sint4korr(to+8) : 0; tm->year= tm->month= 0; - + if (tm->day) + { + /* Convert days to hours at once */ + tm->hour+= tm->day*24; + tm->day= 0; + } *pos+= length; } else @@ -3558,7 +3564,7 @@ static void fetch_float_with_conversion(MYSQL_BIND *param, MYSQL_FIELD *field, floating point -> string conversion nicely, honor all typecodes and param->offset possibly set in mysql_stmt_fetch_column */ - char buff[331]; + char buff[MAX_DOUBLE_STRING_REP_LENGTH]; char *end; /* TODO: move this to a header shared between client and server. */ #define NOT_FIXED_DEC 31 @@ -3992,32 +3998,43 @@ my_bool STDCALL mysql_stmt_bind_result(MYSQL_STMT *stmt, MYSQL_BIND *bind) switch (field->type) { case MYSQL_TYPE_NULL: /* for dummy binds */ param->pack_length= 0; + field->max_length= 0; break; case MYSQL_TYPE_TINY: param->pack_length= 1; + field->max_length= 4; /* as in '-127' */ break; case MYSQL_TYPE_YEAR: case MYSQL_TYPE_SHORT: param->pack_length= 2; + field->max_length= 6; /* as in '-32767' */ break; case MYSQL_TYPE_INT24: + field->max_length= 9; /* as in '16777216' or in '-8388607' */ + param->pack_length= 4; + break; case MYSQL_TYPE_LONG: + field->max_length= 11; /* '-2147483647' */ param->pack_length= 4; break; case MYSQL_TYPE_LONGLONG: + field->max_length= 21; /* '18446744073709551616' */ param->pack_length= 8; break; case MYSQL_TYPE_FLOAT: param->pack_length= 4; + field->max_length= MAX_DOUBLE_STRING_REP_LENGTH; break; case MYSQL_TYPE_DOUBLE: param->pack_length= 8; + field->max_length= MAX_DOUBLE_STRING_REP_LENGTH; break; case MYSQL_TYPE_TIME: case MYSQL_TYPE_DATE: case MYSQL_TYPE_DATETIME: case MYSQL_TYPE_TIMESTAMP: param->skip_result= skip_result_with_length; + field->max_length= MAX_DATE_STRING_REP_LENGTH; break; case MYSQL_TYPE_DECIMAL: case MYSQL_TYPE_ENUM: diff --git a/sql-common/my_time.c b/sql-common/my_time.c index be349285b88..6c020466e1e 100644 --- a/sql-common/my_time.c +++ b/sql-common/my_time.c @@ -743,9 +743,6 @@ void set_zero_time(MYSQL_TIME *tm) int my_time_to_str(const MYSQL_TIME *l_time, char *to) { uint extra_hours= 0; - /* Get extra hours, if we are getting data from the server */ - if (l_time->year == 0 && l_time->month == 0) - extra_hours= l_time->day*24; return my_sprintf(to, (to, "%s%02d:%02d:%02d", (l_time->neg ? "-" : ""), extra_hours+ l_time->hour, diff --git a/tests/client_test.c b/tests/client_test.c index 562f6e307d3..48676ae7e12 100644 --- a/tests/client_test.c +++ b/tests/client_test.c @@ -10713,6 +10713,106 @@ static void test_bug6081() rc= simple_command(mysql, COM_CREATE_DB, current_db, (ulong)strlen(current_db), 0); myquery_r(rc); + rc= mysql_select_db(mysql, current_db); + myquery(rc); +} + + +static void test_bug6096() +{ + MYSQL_STMT *stmt; + MYSQL_RES *query_result, *stmt_metadata; + const char *stmt_text; + MYSQL_BIND bind[12]; + MYSQL_FIELD *query_field_list, *stmt_field_list; + ulong query_field_count, stmt_field_count; + int rc; + uint i; + + myheader("test_bug6096"); + + stmt_text= "drop table if exists t1"; + rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text)); + myquery(rc); + + stmt_text= "create table t1 (c_tinyint tinyint, c_smallint smallint, " + " c_mediumint mediumint, c_int int, " + " c_bigint bigint, c_float float, " + " c_double double, c_varchar varchar(20), " + " c_char char(20), c_time time, c_date date, " + " c_datetime datetime)"; + rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text)); + myquery(rc); + stmt_text= "insert into t1 values (-100, -20000, 30000000, 4, 8, 1.0, " + "2.0, 'abc', 'def', now(), now(), now())"; + rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text)); + myquery(rc); + + stmt_text= "select * from t1"; + + /* Run select in prepared and non-prepared mode and compare metadata */ + rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text)); + myquery(rc); + query_result= mysql_store_result(mysql); + query_field_list= mysql_fetch_fields(query_result); + query_field_count= mysql_num_fields(query_result); + + stmt= mysql_stmt_init(mysql); + rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text)); + check_execute(stmt, rc); + rc= mysql_stmt_execute(stmt); + check_execute(stmt, rc); + rc= 1; + mysql_stmt_attr_set(stmt, STMT_ATTR_UPDATE_MAX_LENGTH, (void*)&rc); + mysql_stmt_store_result(stmt); + stmt_metadata= mysql_stmt_result_metadata(stmt); + stmt_field_list= mysql_fetch_fields(stmt_metadata); + stmt_field_count= mysql_num_fields(stmt_metadata); + DIE_UNLESS(stmt_field_count == query_field_count); + + /* Print out and check the metadata */ + + printf(" ---------------------------------------------------------------\n"); + printf(" | Metadata \n"); + printf(" ---------------------------------------------------------------\n"); + printf(" | Query | Prepared statement \n"); + printf(" ---------------------------------------------------------------\n"); + printf(" field name | length | max_length | length | max_length \n"); + printf(" ---------------------------------------------------------------\n"); + + for (i= 0; i < query_field_count; ++i) + { + MYSQL_FIELD *f1= &query_field_list[i], *f2= &stmt_field_list[i]; + printf(" %-11s | %9lu | %10lu | %9lu | %10lu \n", + f1->name, f1->length, f1->max_length, f2->length, f2->max_length); + DIE_UNLESS(f1->length == f2->length); + } + printf(" ---------------------------------------------------------------\n"); + + /* Bind and fetch the data */ + + bzero(bind, sizeof(bind)); + for (i= 0; i < stmt_field_count; ++i) + { + bind[i].buffer_type= MYSQL_TYPE_STRING; + bind[i].buffer_length= stmt_field_list[i].max_length + 1; + bind[i].buffer= malloc(bind[i].buffer_length); + } + mysql_stmt_bind_result(stmt, bind); + rc= mysql_stmt_fetch(stmt); + check_execute(stmt, rc); + rc= mysql_stmt_fetch(stmt); + DIE_UNLESS(rc == MYSQL_NO_DATA); + + /* Clean up */ + + for (i= 0; i < stmt_field_count; ++i) + free(bind[i].buffer); + mysql_stmt_close(stmt); + mysql_free_result(query_result); + stmt_text= "drop table t1"; + rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text)); + myquery(rc); } @@ -11031,6 +11131,7 @@ int main(int argc, char **argv) test_bug6059(); /* correct metadata for SELECT ... INTO OUTFILE */ test_bug6046(); /* NATURAL JOIN transformation works in PS */ test_bug6081(); /* test of mysql_create_db()/mysql_rm_db() */ + test_bug6096(); /* max_length for numeric columns */ /* XXX: PLEASE RUN THIS PROGRAM UNDER VALGRIND AND VERIFY THAT YOUR TEST DOESN'T CONTAIN WARNINGS/ERRORS BEFORE YOU PUSH. From 11ff375efd71ac8794aad06c62e6efbbdc6d8165 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 27 Oct 2004 21:51:27 +0200 Subject: [PATCH 0027/1063] - Applied some Windows portability fixes for myisampack.c and sql_handler.cc (backports from fixes made in 4.1) myisam/myisampack.c: - replaced "1ULL" with "((ulonglong)1)" to resolve a compile error on Windows sql/sql_handler.cc: - removed some unused variables - added a (byte*) cast to fix a compile error on Windows (backport of a fix made in 4.1) --- myisam/myisampack.c | 2 +- sql/sql_handler.cc | 8 +------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/myisam/myisampack.c b/myisam/myisampack.c index 0dde1916f03..9f4e3bde65a 100644 --- a/myisam/myisampack.c +++ b/myisam/myisampack.c @@ -2047,7 +2047,7 @@ static int save_state(MI_INFO *isam_file,PACK_MRG_INFO *mrg,my_off_t new_length, share->state.dellink= HA_OFFSET_ERROR; share->state.split=(ha_rows) mrg->records; share->state.version=(ulong) time((time_t*) 0); - if (share->state.key_map != (1ULL << share->base.keys) - 1) + if (share->state.key_map != (((ulonglong)1) << share->base.keys) - 1) { /* Some indexes are disabled, cannot use current key_file_length value diff --git a/sql/sql_handler.cc b/sql/sql_handler.cc index 44ffb713dcc..5bfcc897fc7 100644 --- a/sql/sql_handler.cc +++ b/sql/sql_handler.cc @@ -265,8 +265,6 @@ int mysql_ha_close(THD *thd, TABLE_LIST *tables) { TABLE_LIST *hash_tables; TABLE **table_ptr; - bool was_flushed= FALSE; - bool not_opened; DBUG_ENTER("mysql_ha_close"); DBUG_PRINT("enter",("'%s'.'%s' as '%s'", tables->db, tables->real_name, tables->alias)); @@ -363,7 +361,6 @@ int mysql_ha_read(THD *thd, TABLE_LIST *tables, int err; int keyno=-1; uint num_rows; - bool was_flushed; MYSQL_LOCK *lock; DBUG_ENTER("mysql_ha_read"); DBUG_PRINT("enter",("'%s'.'%s' as '%s'", @@ -615,10 +612,8 @@ err0: int mysql_ha_flush(THD *thd, TABLE_LIST *tables, uint mode_flags) { - TABLE_LIST **tmp_tables_p; TABLE_LIST *tmp_tables; TABLE **table_ptr; - bool was_flushed; DBUG_ENTER("mysql_ha_flush"); DBUG_PRINT("enter", ("tables: %p mode_flags: 0x%02x", tables, mode_flags)); @@ -692,14 +687,13 @@ static int mysql_ha_flush_table(THD *thd, TABLE **table_ptr, uint mode_flags) { TABLE_LIST *hash_tables; TABLE *table= *table_ptr; - bool was_flushed; DBUG_ENTER("mysql_ha_flush_table"); DBUG_PRINT("enter",("'%s'.'%s' as '%s' flags: 0x%02x", table->table_cache_key, table->real_name, table->table_name, mode_flags)); if ((hash_tables= (TABLE_LIST*) hash_search(&thd->handler_tables_hash, - (*table_ptr)->table_name, + (byte*) (*table_ptr)->table_name, strlen((*table_ptr)->table_name) + 1))) { if (! (mode_flags & MYSQL_HA_REOPEN_ON_USAGE)) From 616b7460aabc027075e7457c72742a1d5e89ff1b Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 27 Oct 2004 21:59:34 +0200 Subject: [PATCH 0028/1063] Fix for bug#5385 ("Text files have unix line break"): Windows style line end \r\n on README, license, and similar essential plaintext files. scripts/make_win_src_distribution.sh: Some plain text files (which a Windows user might view in any editor) should have Windows style line end \r\n (bug#5385). The tool is changed to do a systematic pass over all files, find all relevant ones (especially "README*", "ChangeLog", "INSTALL*", license text), and adapt them. Included are two minor cleanups ("useless use of cat" avoided, variable setting moved to more sensible place). --- scripts/make_win_src_distribution.sh | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh index e58d44f336b..fd7884068ba 100644 --- a/scripts/make_win_src_distribution.sh +++ b/scripts/make_win_src_distribution.sh @@ -6,7 +6,6 @@ version=@VERSION@ export version -SOURCE=`pwd` CP="cp -p" DEBUG=0 @@ -24,6 +23,7 @@ if [ ! -f scripts/make_win_src_distribution ]; then echo "ERROR : You must run this script from the MySQL top-level directory" exit 1 fi +SOURCE=`pwd` # # Check for source compilation/configuration @@ -119,7 +119,7 @@ unix_to_dos() for arg do print_debug "Replacing LF -> CRLF from '$arg'" - cat $arg | awk '{sub(/$/,"\r");print}' > $arg.tmp + awk '{sub(/$/,"\r");print}' < $arg > $arg.tmp rm -f $arg mv $arg.tmp $arg done @@ -138,14 +138,6 @@ if [ -d $BASE ] ; then fi $CP -r $SOURCE/VC++Files $BASE -( -find $BASE \( -name "*.dsp" -o -name "*.dsw" \) -and -not -path \*SCCS\* -print -)|( - while read v - do - unix_to_dos $v - done -) # # Process version tags in InstallShield files @@ -281,7 +273,6 @@ for i in COPYING ChangeLog README EXCEPTIONS-CLIENT\ Docs/manual_toc.html Docs/manual.html \ Docs/manual.txt Docs/mysqld_error.txt \ Docs/INSTALL-BINARY Docs/internals.texi - do print_debug "Copying file '$i'" if [ -f $i ] @@ -322,7 +313,18 @@ done ./extra/replace std:: "" < $BASE/sql/sql_yacc.cpp | sed '/^ *switch (yytype)$/ { N; /\n *{$/ { N; /\n *default:$/ { N; /\n *break;$/ { N; /\n *}$/ d; };};};} ' > $BASE/sql/sql_yacc.cpp-new mv $BASE/sql/sql_yacc.cpp-new $BASE/sql/sql_yacc.cpp -unix_to_dos $BASE/README +# +# Search the tree for plain text files and adapt the line end marker +# +find $BASE \( -name "*.dsp" -o -name "*.dsw" -o -name "*.cnf" -o -name "*.ini" \ + -o -name COPYING -o -name ChangeLog -o -name EXCEPTIONS-CLIENT -o -name "INSTALL*" -o -name LICENSE -o -name "README*" \) -type f -print \ +| while read v + do + unix_to_dos $v + done +# File extension '.txt' matches too many other files, error messages etc. +unix_to_dos $BASE/Docs/*.txt + mv $BASE/README $BASE/README.txt # From b97048498a81dc0013261f0a67ae15a14cc7eb76 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 28 Oct 2004 02:54:32 +0400 Subject: [PATCH 0029/1063] Making the latest fix for Bug#6166 (key.test) work in prepared statements. sql/sql_prepare.cc: Catch another class of errors possible during yyparse: if thd->net.report_error is set, we need to send the message and abort. --- sql/sql_prepare.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index 5a311eefacd..bccf517466d 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -1609,7 +1609,7 @@ int mysql_stmt_prepare(THD *thd, char *packet, uint packet_length, lex->safe_to_cache_query= 0; error= yyparse((void *)thd) || thd->is_fatal_error || - init_param_array(stmt); + thd->net.report_error || init_param_array(stmt); /* While doing context analysis of the query (in send_prepare_results) we allocate a lot of additional memory: for open tables, JOINs, derived @@ -1640,7 +1640,9 @@ int mysql_stmt_prepare(THD *thd, char *packet, uint packet_length, /* Statement map deletes statement on erase */ thd->stmt_map.erase(stmt); stmt= NULL; - /* error is sent inside yyparse/send_prepare_results */ + if (thd->net.report_error) + send_error(thd); + /* otherwise the error is sent inside yyparse/send_prepare_results */ } else { From a5087248e30123ed7cbd18ab3ab7889f21c9a726 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 28 Oct 2004 11:43:31 +0500 Subject: [PATCH 0030/1063] An extra "separator" class member was removed from Item_func_concat_ws. args[0] is now used instead. --- sql/item_func.cc | 4 +-- sql/item_strfunc.cc | 62 ++++++++------------------------------------- sql/item_strfunc.h | 20 +-------------- sql/sql_yacc.yy | 2 +- 4 files changed, 14 insertions(+), 74 deletions(-) diff --git a/sql/item_func.cc b/sql/item_func.cc index 17cf8642ce5..879c0b36bdd 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -2873,10 +2873,10 @@ void Item_func_match::init_search(bool no_order) if (key == NO_SUCH_KEY) { List fields; + fields.push_back(new Item_string(" ",1, cmp_collation.collation)); for (uint i=1; i < arg_count; i++) fields.push_back(args[i]); - concat=new Item_func_concat_ws(new Item_string(" ",1, - cmp_collation.collation), fields); + concat=new Item_func_concat_ws(fields); /* Above function used only to get value and do not need fix_fields for it: Item_string - basic constant diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index d78a3ac88a4..c51894afde4 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -532,7 +532,7 @@ String *Item_func_concat_ws::val_str(String *str) uint i; null_value=0; - if (!(sep_str= separator->val_str(&tmp_sep_str))) + if (!(sep_str= args[0]->val_str(&tmp_sep_str))) goto null; use_as_buff= &tmp_value; @@ -541,7 +541,7 @@ String *Item_func_concat_ws::val_str(String *str) // Skip until non-null argument is found. // If not, return the empty string - for (i=0; i < arg_count; i++) + for (i=1; i < arg_count; i++) if ((res= args[i]->val_str(str))) break; if (i == arg_count) @@ -635,67 +635,25 @@ null: return 0; } -void Item_func_concat_ws::split_sum_func(THD *thd, Item **ref_pointer_array, - List &fields) -{ - if (separator->with_sum_func && separator->type() != SUM_FUNC_ITEM) - separator->split_sum_func(thd, ref_pointer_array, fields); - else if (separator->used_tables() || separator->type() == SUM_FUNC_ITEM) - { - uint el= fields.elements; - Item *new_item= new Item_ref(ref_pointer_array + el, 0, separator->name); - fields.push_front(separator); - ref_pointer_array[el]= separator; - thd->change_item_tree(&separator, new_item); - } - Item_str_func::split_sum_func(thd, ref_pointer_array, fields); -} void Item_func_concat_ws::fix_length_and_dec() { - collation.set(separator->collation); - max_length=separator->max_length*(arg_count-1); - for (uint i=0 ; i < arg_count ; i++) - { - DTCollation tmp(collation.collation, collation.derivation); + max_length=0; + + if (agg_arg_collations(collation, args, arg_count)) + return; + + max_length= arg_count > 1 ? args[0]->max_length * (arg_count - 2) : 0; + for (uint i=1 ; i < arg_count ; i++) max_length+=args[i]->max_length; - if (collation.aggregate(args[i]->collation)) - { - collation.set(tmp); // Restore the previous value - my_coll_agg_error(collation, args[i]->collation, func_name()); - break; - } - } + if (max_length > MAX_BLOB_WIDTH) { max_length=MAX_BLOB_WIDTH; maybe_null=1; } - used_tables_cache|= separator->used_tables(); - not_null_tables_cache&= separator->not_null_tables(); - const_item_cache&= separator->const_item(); - with_sum_func= with_sum_func || separator->with_sum_func; } -void Item_func_concat_ws::update_used_tables() -{ - Item_func::update_used_tables(); - separator->update_used_tables(); - used_tables_cache|=separator->used_tables(); - const_item_cache&=separator->const_item(); -} - -void Item_func_concat_ws::print(String *str) -{ - str->append("concat_ws(", 10); - separator->print(str); - if (arg_count) - { - str->append(','); - print_args(str, 0); - } - str->append(')'); -} String *Item_func_reverse::val_str(String *str) { diff --git a/sql/item_strfunc.h b/sql/item_strfunc.h index 77c1caec9fc..afe03c31345 100644 --- a/sql/item_strfunc.h +++ b/sql/item_strfunc.h @@ -89,30 +89,12 @@ public: class Item_func_concat_ws :public Item_str_func { - Item *separator; String tmp_value; - public: - Item_func_concat_ws(Item *a,List &list) - :Item_str_func(list),separator(a) {} + Item_func_concat_ws(List &list) :Item_str_func(list) {} String *val_str(String *); void fix_length_and_dec(); - void update_used_tables(); - bool fix_fields(THD *thd, TABLE_LIST *tlist, Item **ref) - { - DBUG_ASSERT(fixed == 0); - return (separator->fix_fields(thd, tlist, &separator) || - separator->check_cols(1) || - Item_func::fix_fields(thd, tlist, ref)); - } - void split_sum_func(THD *thd, Item **ref_pointer_array, List &fields); const char *func_name() const { return "concat_ws"; } - bool walk(Item_processor processor, byte *arg) - { - return separator->walk(processor, arg) || - Item_str_func::walk(processor, arg); - } - void print(String *str); }; class Item_func_reverse :public Item_str_func diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 142f52b87ab..4538cb6e6ac 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -2889,7 +2889,7 @@ simple_expr: | CONCAT '(' expr_list ')' { $$= new Item_func_concat(* $3); } | CONCAT_WS '(' expr ',' expr_list ')' - { $$= new Item_func_concat_ws($3, *$5); } + { $5->push_front($3); $$= new Item_func_concat_ws(*$5); } | CONVERT_TZ_SYM '(' expr ',' expr ',' expr ')' { Lex->time_zone_tables_used= &fake_time_zone_tables_list; From f785b951b5251b4b118f276f39c4bcff997572cb Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 28 Oct 2004 10:50:39 +0200 Subject: [PATCH 0031/1063] Fix for aix4 which defines clock_gettime, but it only returns ENOSYS --- configure.in | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 979782fe511..9376f8748ee 100644 --- a/configure.in +++ b/configure.in @@ -1913,7 +1913,7 @@ AC_CHECK_FUNCS(alarm bcmp bfill bmove bzero chsize cuserid fchmod fcntl \ getcwd gethostbyaddr_r gethostbyname_r getpass getpassphrase getpwnam \ getpwuid getrlimit getrusage getwd gmtime_r index initgroups isnan \ localtime_r locking longjmp lrand48 madvise mallinfo memcpy memmove \ - mkstemp mlockall perror poll pread pthread_attr_create clock_gettime \ + mkstemp mlockall perror poll pread pthread_attr_create \ pthread_attr_getstacksize pthread_attr_setprio pthread_attr_setschedparam \ pthread_attr_setstacksize pthread_condattr_create pthread_getsequence_np \ pthread_key_delete pthread_rwlock_rdlock pthread_setprio \ @@ -1922,6 +1922,18 @@ AC_CHECK_FUNCS(alarm bcmp bfill bmove bzero chsize cuserid fchmod fcntl \ snprintf socket stpcpy strcasecmp strerror strnlen strpbrk strstr strtol \ strtoll strtoul strtoull tell tempnam thr_setconcurrency vidattr) +# +# +# +case "$target" in + *-*-aix4*) + # (grr) aix 4.3 has a stub for clock_gettime, (returning ENOSYS) + # and using AC_TRY_RUN is hard when cross-compiling + ;; + *) AC_CHECK_FUNCS(clock_gettime) + ;; +esac + # isinf() could be a function or a macro (HPUX) AC_MSG_CHECKING(for isinf with ) AC_TRY_LINK([#include ], [float f = 0.0; isinf(f)], From 5be6c328f5a9f78f37176bbbd88a538fa3b65fe9 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 28 Oct 2004 15:21:20 +0500 Subject: [PATCH 0032/1063] Produce a "truncated" warning if a value cannot be converted into the column character set on INSERT/UPDATE. sql/sql_string.cc: New argument to report an error. sql/sql_string.h: New argument to report an error. --- mysql-test/r/alter_table.result | 1 + mysql-test/r/ctype_recoding.result | 8 ++++++++ mysql-test/r/fulltext.result | 5 +++++ mysql-test/t/alter_table.test | 1 + mysql-test/t/ctype_recoding.test | 10 ++++++++++ sql/field.cc | 32 ++++++++++++++++++++---------- sql/sql_string.cc | 21 ++++++++++++++++---- sql/sql_string.h | 4 ++-- 8 files changed, 66 insertions(+), 16 deletions(-) diff --git a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result index e85ad303564..89b8bd66848 100644 --- a/mysql-test/r/alter_table.result +++ b/mysql-test/r/alter_table.result @@ -349,6 +349,7 @@ alter table t1 change a a char(10) character set koi8r; select a,hex(a) from t1; a hex(a) ÔÅÓÔ D4C5D3D4 +delete from t1; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( diff --git a/mysql-test/r/ctype_recoding.result b/mysql-test/r/ctype_recoding.result index be792c007fc..72d19885101 100644 --- a/mysql-test/r/ctype_recoding.result +++ b/mysql-test/r/ctype_recoding.result @@ -166,3 +166,11 @@ ERROR HY000: Invalid utf8 character string: ' SET NAMES utf8; CREATE TABLE `goodÐÌÏÈÏ` (a int); ERROR HY000: Invalid utf8 character string: 'ÐÌÏÈÏ` (a int)' +set names latin1; +create table t1 (a char(10) character set koi8r, b text character set koi8r); +insert into t1 values ('test','test'); +insert into t1 values ('ÊÃÕË','ÊÃÕË'); +Warnings: +Warning 1265 Data truncated for column 'a' at row 1 +Warning 1265 Data truncated for column 'b' at row 1 +drop table t1; diff --git a/mysql-test/r/fulltext.result b/mysql-test/r/fulltext.result index 30c4c75f3d1..d07e4df6e73 100644 --- a/mysql-test/r/fulltext.result +++ b/mysql-test/r/fulltext.result @@ -356,6 +356,11 @@ SELECT t, collation(t),MATCH t AGAINST ('Osnabruck') FROM t1 WHERE MATCH t AGAIN t collation(t) MATCH t AGAINST ('Osnabruck') aus Osnabrück utf8_general_ci 1.591139793396 alter table t1 modify t varchar(200) collate latin1_german2_ci not null; +Warnings: +Warning 1265 Data truncated for column 't' at row 3 +Warning 1265 Data truncated for column 't' at row 4 +Warning 1265 Data truncated for column 't' at row 5 +Warning 1265 Data truncated for column 't' at row 6 SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('Osnabrück'); t collation(t) aus Osnabrück latin1_german2_ci diff --git a/mysql-test/t/alter_table.test b/mysql-test/t/alter_table.test index eb35aa90fe2..e46027ae8d9 100644 --- a/mysql-test/t/alter_table.test +++ b/mysql-test/t/alter_table.test @@ -207,6 +207,7 @@ alter table t1 change a a text character set cp1251; select a,hex(a) from t1; alter table t1 change a a char(10) character set koi8r; select a,hex(a) from t1; +delete from t1; # # Test ALTER TABLE .. CHARACTER SET .. diff --git a/mysql-test/t/ctype_recoding.test b/mysql-test/t/ctype_recoding.test index 82d0643b577..5f417352d95 100644 --- a/mysql-test/t/ctype_recoding.test +++ b/mysql-test/t/ctype_recoding.test @@ -121,3 +121,13 @@ CREATE TABLE `good SET NAMES utf8; --error 1300 CREATE TABLE `goodÐÌÏÈÏ` (a int); + + +# +# Test that we produce a warnign when conversion loses data. +# +set names latin1; +create table t1 (a char(10) character set koi8r, b text character set koi8r); +insert into t1 values ('test','test'); +insert into t1 values ('ÊÃÕË','ÊÃÕË'); +drop table t1; diff --git a/sql/field.cc b/sql/field.cc index 3e625f3a582..261494d2125 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -4275,9 +4275,12 @@ int Field_string::store(const char *from,uint length,CHARSET_INFO *cs) /* Convert character set if nesessary */ if (String::needs_conversion(length, cs, field_charset, ¬_used)) { - tmpstr.copy(from, length, cs, field_charset); + uint conv_errors; + tmpstr.copy(from, length, cs, field_charset, &conv_errors); from= tmpstr.ptr(); length= tmpstr.length(); + if (conv_errors) + error= 1; } /* @@ -4300,11 +4303,11 @@ int Field_string::store(const char *from,uint length,CHARSET_INFO *cs) from+= field_charset->cset->scan(field_charset, from, end, MY_SEQ_SPACES); if (from != end) - { - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED, 1); - error=1; - } + error= 1; } + if (error) + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED, 1); + return error; } @@ -4528,16 +4531,20 @@ int Field_varstring::store(const char *from,uint length,CHARSET_INFO *cs) /* Convert character set if nesessary */ if (String::needs_conversion(length, cs, field_charset, ¬_used)) { - tmpstr.copy(from, length, cs, field_charset); + uint conv_errors; + tmpstr.copy(from, length, cs, field_charset, &conv_errors); from= tmpstr.ptr(); length= tmpstr.length(); + if (conv_errors) + error= 1; } if (length > field_length) { length=field_length; - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED, 1); error= 1; } + if (error) + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED, 1); memcpy(ptr+HA_KEY_BLOB_LENGTH,from,length); int2store(ptr, length); return error; @@ -4865,6 +4872,7 @@ void Field_blob::put_length(char *pos, uint32 length) int Field_blob::store(const char *from,uint length,CHARSET_INFO *cs) { + int error= 0; if (!length) { bzero(ptr,Field_blob::pack_length()); @@ -4881,9 +4889,12 @@ int Field_blob::store(const char *from,uint length,CHARSET_INFO *cs) if ((was_conversion= String::needs_conversion(length, cs, field_charset, ¬_used))) { - tmpstr.copy(from, length, cs, field_charset); + uint conv_errors; + tmpstr.copy(from, length, cs, field_charset, &conv_errors); from= tmpstr.ptr(); length= tmpstr.length(); + if (conv_errors) + error= 1; } copy_length= max_data_length(); @@ -4897,8 +4908,7 @@ int Field_blob::store(const char *from,uint length,CHARSET_INFO *cs) min(length, copy_length), copy_length); if (copy_length < length) - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED, 1); - + error= 1; Field_blob::store_length(copy_length); if (was_conversion || table->copy_blobs || copy_length <= MAX_FIELD_WIDTH) { // Must make a copy @@ -4910,6 +4920,8 @@ int Field_blob::store(const char *from,uint length,CHARSET_INFO *cs) } bmove(ptr+packlength,(char*) &from,sizeof(char*)); } + if (error) + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED, 1); return 0; } diff --git a/sql/sql_string.cc b/sql/sql_string.cc index 1044dc4e58e..30559496fde 100644 --- a/sql/sql_string.cc +++ b/sql/sql_string.cc @@ -331,19 +331,26 @@ bool String::set_or_copy_aligned(const char *str,uint32 arg_length, /* Copy with charset convertion */ bool String::copy(const char *str, uint32 arg_length, - CHARSET_INFO *from_cs, CHARSET_INFO *to_cs) + CHARSET_INFO *from_cs, CHARSET_INFO *to_cs, uint *errors) { uint32 offset; if (!needs_conversion(arg_length, from_cs, to_cs, &offset)) + { + if (errors) + *errors= 0; return copy(str, arg_length, to_cs); + } if ((from_cs == &my_charset_bin) && offset) + { + if (errors) + *errors= 0; return copy_aligned(str, arg_length, offset, to_cs); - + } uint32 new_length= to_cs->mbmaxlen*arg_length; if (alloc(new_length)) return TRUE; str_length=copy_and_convert((char*) Ptr, new_length, to_cs, - str, arg_length, from_cs); + str, arg_length, from_cs, errors); str_charset=to_cs; return FALSE; } @@ -769,7 +776,8 @@ String *copy_if_not_alloced(String *to,String *from,uint32 from_length) uint32 copy_and_convert(char *to, uint32 to_length, CHARSET_INFO *to_cs, - const char *from, uint32 from_length, CHARSET_INFO *from_cs) + const char *from, uint32 from_length, CHARSET_INFO *from_cs, + uint *errors) { int cnvres; my_wc_t wc; @@ -780,6 +788,7 @@ copy_and_convert(char *to, uint32 to_length, CHARSET_INFO *to_cs, const uchar *) = from_cs->cset->mb_wc; int (*wc_mb)(struct charset_info_st *, my_wc_t, uchar *s, uchar *e)= to_cs->cset->wc_mb; + uint error_count= 0; while (1) { @@ -788,6 +797,7 @@ copy_and_convert(char *to, uint32 to_length, CHARSET_INFO *to_cs, from+= cnvres; else if (cnvres == MY_CS_ILSEQ) { + error_count++; from++; wc= '?'; } @@ -799,12 +809,15 @@ outp: to+= cnvres; else if (cnvres == MY_CS_ILUNI && wc != '?') { + error_count++; wc= '?'; goto outp; } else break; } + if (errors) + *errors= error_count; return (uint32) (to - to_start); } diff --git a/sql/sql_string.h b/sql/sql_string.h index 2d368991159..de8f4af58d9 100644 --- a/sql/sql_string.h +++ b/sql/sql_string.h @@ -29,7 +29,7 @@ int sortcmp(const String *a,const String *b, CHARSET_INFO *cs); String *copy_if_not_alloced(String *a,String *b,uint32 arg_length); uint32 copy_and_convert(char *to, uint32 to_length, CHARSET_INFO *to_cs, const char *from, uint32 from_length, - CHARSET_INFO *from_cs); + CHARSET_INFO *from_cs, uint *errors= 0); class String { @@ -199,7 +199,7 @@ public: CHARSET_INFO *cs); bool set_or_copy_aligned(const char *s, uint32 arg_length, CHARSET_INFO *cs); bool copy(const char*s,uint32 arg_length, CHARSET_INFO *csfrom, - CHARSET_INFO *csto); + CHARSET_INFO *csto, uint *errors= 0); bool append(const String &s); bool append(const char *s); bool append(const char *s,uint32 arg_length); From 51cff67d08222d6c2909b4d373f5a406560a3a10 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 28 Oct 2004 11:19:51 +0000 Subject: [PATCH 0033/1063] added test for max limit of 128 attributes in table new define for long signal section size bumbed up limit for attributes to 128 use new define in SectionSegment some bug fixing of send fragmented signal + make chunk size a multiple the dew define for SectionSegment size mysql-test/r/ndb_basic.result: added test for max limit of 128 attributes in table mysql-test/t/ndb_basic.test: added test for max limit of 128 attributes in table ndb/include/kernel/ndb_limits.h: new define for long signal section size ndb/include/ndbapi/ndbapi_limits.h: bumbed up limit for attributes to 128 ndb/src/kernel/vm/LongSignal.hpp: use new define in SectionSegment ndb/src/ndbapi/TransporterFacade.cpp: some bug fixing of send fragmented signal + make chunk size a multiple the dew define for SectionSegment size --- mysql-test/r/ndb_basic.result | 131 ++++++++++++++++++++++++++ mysql-test/t/ndb_basic.test | 136 +++++++++++++++++++++++++++ ndb/include/kernel/ndb_limits.h | 5 + ndb/include/ndbapi/ndbapi_limits.h | 2 +- ndb/src/kernel/vm/LongSignal.hpp | 2 +- ndb/src/ndbapi/TransporterFacade.cpp | 64 +++++++------ 6 files changed, 311 insertions(+), 29 deletions(-) diff --git a/mysql-test/r/ndb_basic.result b/mysql-test/r/ndb_basic.result index abe1b98b536..37083beac89 100644 --- a/mysql-test/r/ndb_basic.result +++ b/mysql-test/r/ndb_basic.result @@ -414,3 +414,134 @@ select * from t1 where b IS NOT NULL; a b 1 drop table t1; +create table t1 ( +c1 int, +c2 int, +c3 int, +c4 int, +c5 int, +c6 int, +c7 int, +c8 int, +c9 int, +c10 int, +c11 int, +c12 int, +c13 int, +c14 int, +c15 int, +c16 int, +c17 int, +c18 int, +c19 int, +c20 int, +c21 int, +c22 int, +c23 int, +c24 int, +c25 int, +c26 int, +c27 int, +c28 int, +c29 int, +c30 int, +c31 int, +c32 int, +c33 int, +c34 int, +c35 int, +c36 int, +c37 int, +c38 int, +c39 int, +c40 int, +c41 int, +c42 int, +c43 int, +c44 int, +c45 int, +c46 int, +c47 int, +c48 int, +c49 int, +c50 int, +c51 int, +c52 int, +c53 int, +c54 int, +c55 int, +c56 int, +c57 int, +c58 int, +c59 int, +c60 int, +c61 int, +c62 int, +c63 int, +c64 int, +c65 int, +c66 int, +c67 int, +c68 int, +c69 int, +c70 int, +c71 int, +c72 int, +c73 int, +c74 int, +c75 int, +c76 int, +c77 int, +c78 int, +c79 int, +c80 int, +c81 int, +c82 int, +c83 int, +c84 int, +c85 int, +c86 int, +c87 int, +c88 int, +c89 int, +c90 int, +c91 int, +c92 int, +c93 int, +c94 int, +c95 int, +c96 int, +c97 int, +c98 int, +c99 int, +c100 int, +c101 int, +c102 int, +c103 int, +c104 int, +c105 int, +c106 int, +c107 int, +c108 int, +c109 int, +c110 int, +c111 int, +c112 int, +c113 int, +c114 int, +c115 int, +c116 int, +c117 int, +c118 int, +c119 int, +c120 int, +c121 int, +c122 int, +c123 int, +c124 int, +c125 int, +c126 int, +c127 int, +c128 int, +primary key(c1)) engine=ndb; +drop table t1; diff --git a/mysql-test/t/ndb_basic.test b/mysql-test/t/ndb_basic.test index e79815bbeb1..0d4bffce80d 100644 --- a/mysql-test/t/ndb_basic.test +++ b/mysql-test/t/ndb_basic.test @@ -371,3 +371,139 @@ select * from t1 order by b; select * from t1 where b IS NULL; select * from t1 where b IS NOT NULL; drop table t1; + +# +# test the limit of no of attributes in one table +# + +create table t1 ( +c1 int, +c2 int, +c3 int, +c4 int, +c5 int, +c6 int, +c7 int, +c8 int, +c9 int, +c10 int, +c11 int, +c12 int, +c13 int, +c14 int, +c15 int, +c16 int, +c17 int, +c18 int, +c19 int, +c20 int, +c21 int, +c22 int, +c23 int, +c24 int, +c25 int, +c26 int, +c27 int, +c28 int, +c29 int, +c30 int, +c31 int, +c32 int, +c33 int, +c34 int, +c35 int, +c36 int, +c37 int, +c38 int, +c39 int, +c40 int, +c41 int, +c42 int, +c43 int, +c44 int, +c45 int, +c46 int, +c47 int, +c48 int, +c49 int, +c50 int, +c51 int, +c52 int, +c53 int, +c54 int, +c55 int, +c56 int, +c57 int, +c58 int, +c59 int, +c60 int, +c61 int, +c62 int, +c63 int, +c64 int, +c65 int, +c66 int, +c67 int, +c68 int, +c69 int, +c70 int, +c71 int, +c72 int, +c73 int, +c74 int, +c75 int, +c76 int, +c77 int, +c78 int, +c79 int, +c80 int, +c81 int, +c82 int, +c83 int, +c84 int, +c85 int, +c86 int, +c87 int, +c88 int, +c89 int, +c90 int, +c91 int, +c92 int, +c93 int, +c94 int, +c95 int, +c96 int, +c97 int, +c98 int, +c99 int, +c100 int, +c101 int, +c102 int, +c103 int, +c104 int, +c105 int, +c106 int, +c107 int, +c108 int, +c109 int, +c110 int, +c111 int, +c112 int, +c113 int, +c114 int, +c115 int, +c116 int, +c117 int, +c118 int, +c119 int, +c120 int, +c121 int, +c122 int, +c123 int, +c124 int, +c125 int, +c126 int, +c127 int, +c128 int, +primary key(c1)) engine=ndb; +drop table t1; diff --git a/ndb/include/kernel/ndb_limits.h b/ndb/include/kernel/ndb_limits.h index 88fcff22da7..48a56c019bb 100644 --- a/ndb/include/kernel/ndb_limits.h +++ b/ndb/include/kernel/ndb_limits.h @@ -117,4 +117,9 @@ */ #define NDB_BLOB_HEAD_SIZE 2 /* sizeof(NdbBlob::Head) >> 2 */ +/* + * Long signals + */ +#define NDB_SECTION_SEGMENT_SZ 60 + #endif diff --git a/ndb/include/ndbapi/ndbapi_limits.h b/ndb/include/ndbapi/ndbapi_limits.h index 1cf2d9b342d..6b8787d587d 100644 --- a/ndb/include/ndbapi/ndbapi_limits.h +++ b/ndb/include/ndbapi/ndbapi_limits.h @@ -22,7 +22,7 @@ #define NDB_MAX_DATABASE_NAME_SIZE 128 #define NDB_MAX_SCHEMA_NAME_SIZE 128 #define NDB_MAX_TAB_NAME_SIZE 128 -#define NDB_MAX_ATTRIBUTES_IN_TABLE 91 +#define NDB_MAX_ATTRIBUTES_IN_TABLE 128 #define NDB_MAX_TUPLE_SIZE_IN_WORDS 1023 #define NDB_MAX_KEYSIZE_IN_WORDS 1023 diff --git a/ndb/src/kernel/vm/LongSignal.hpp b/ndb/src/kernel/vm/LongSignal.hpp index f9ed443d995..9818358011f 100644 --- a/ndb/src/kernel/vm/LongSignal.hpp +++ b/ndb/src/kernel/vm/LongSignal.hpp @@ -25,7 +25,7 @@ */ struct SectionSegment { - STATIC_CONST( DataLength = 60 ); + STATIC_CONST( DataLength = NDB_SECTION_SEGMENT_SZ ); Uint32 m_ownerRef; Uint32 m_sz; diff --git a/ndb/src/ndbapi/TransporterFacade.cpp b/ndb/src/ndbapi/TransporterFacade.cpp index 0377cf0c84b..6495fee444a 100644 --- a/ndb/src/ndbapi/TransporterFacade.cpp +++ b/ndb/src/ndbapi/TransporterFacade.cpp @@ -34,6 +34,7 @@ #include #include #include +#include //#define REPORT_TRANSPORTER //#define API_TRACE; @@ -834,10 +835,14 @@ TransporterFacade::sendSignalUnCond(NdbApiSignal * aSignal, NodeId aNode){ return (ss == SEND_OK ? 0 : -1); } -#define CHUNK_SZ 100u +#define CHUNK_SZ NDB_SECTION_SEGMENT_SZ*1 int TransporterFacade::sendFragmentedSignal(NdbApiSignal* aSignal, NodeId aNode, - LinearSectionPtr ptr[3], Uint32 secs){ + LinearSectionPtr ptr[3], Uint32 secs) +{ + if(getIsNodeSendable(aNode) != true) + return -1; + NdbApiSignal tmp_signal(*(SignalHeader*)aSignal); LinearSectionPtr tmp_ptr[3]; Uint32 unique_id= m_fragmented_signal_id++; // next unique id @@ -855,41 +860,47 @@ TransporterFacade::sendFragmentedSignal(NdbApiSignal* aSignal, NodeId aNode, if (chunk_sz + save_sz > CHUNK_SZ) { // truncate unsigned send_sz= CHUNK_SZ - chunk_sz; + if (i != start_i) // first piece of a new section has to be a multiple of NDB_SECTION_SEGMENT_SZ + { + send_sz= + NDB_SECTION_SEGMENT_SZ + *(send_sz+NDB_SECTION_SEGMENT_SZ-1) + /NDB_SECTION_SEGMENT_SZ; + if (send_sz > save_sz) + send_sz= save_sz; + } tmp_ptr[i].sz= send_sz; - if (fragment_info < 2) + + if (fragment_info < 2) // 1 = first fragment, 2 = middle fragments fragment_info++; // send tmp_signal tmp_data[i-start_i+1]= unique_id; tmp_signal.setLength(i-start_i+2); tmp_signal.m_fragmentInfo= fragment_info; + tmp_signal.m_noOfSections= i-start_i+1; // do prepare send { - int ret; - if(getIsNodeSendable(aNode) == true){ - SendStatus ss = theTransporterRegistry->prepareSend - (&tmp_signal, - 1, // JBB - tmp_signal.getDataPtrSend(), - aNode, - &ptr[start_i]); - assert(ss != SEND_MESSAGE_TOO_BIG); - ret = (ss == SEND_OK ? 0 : -1); - } else - ret = -1; - if (ret != SEND_OK) - return ret; + SendStatus ss = theTransporterRegistry->prepareSend + (&tmp_signal, + 1, /*JBB*/ + tmp_data, + aNode, + &tmp_ptr[start_i]); + assert(ss != SEND_MESSAGE_TOO_BIG); + if (ss != SEND_OK) return -1; } - // setup variables for next signal start_i= i; chunk_sz= 0; tmp_ptr[i].sz= save_sz-send_sz; tmp_ptr[i].p+= send_sz; + if (tmp_ptr[i].sz == 0) + i++; } else { - chunk_sz+= save_sz; + chunk_sz+=save_sz; i++; } } @@ -907,7 +918,7 @@ TransporterFacade::sendFragmentedSignal(NdbApiSignal* aSignal, NodeId aNode, aSignal->setLength(a_sz+tmp_sz+1); // send last fragment - aSignal->m_fragmentInfo= 3; + aSignal->m_fragmentInfo= 3; // 3 = last fragment aSignal->m_noOfSections= i-start_i; } else { aSignal->m_noOfSections= secs; @@ -915,17 +926,16 @@ TransporterFacade::sendFragmentedSignal(NdbApiSignal* aSignal, NodeId aNode, // send aSignal int ret; - if(getIsNodeSendable(aNode) == true){ + { SendStatus ss = theTransporterRegistry->prepareSend - (aSignal, - 1, // JBB + (aSignal, + 1/*JBB*/, aSignal->getDataPtrSend(), - aNode, - &ptr[start_i]); + aNode, + &tmp_ptr[start_i]); assert(ss != SEND_MESSAGE_TOO_BIG); ret = (ss == SEND_OK ? 0 : -1); - } else - ret = -1; + } aSignal->m_noOfSections = 0; aSignal->m_fragmentInfo = 0; aSignal->setLength(a_sz); From f6129385b391d7c7e6775d56c0c86db18b06272f Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 28 Oct 2004 11:24:59 +0000 Subject: [PATCH 0034/1063] ndbapi_limits.h: corrected define for NDB_MAX_TUPLE_SIZE_IN_WORDS ndb/include/ndbapi/ndbapi_limits.h: corrected define for NDB_MAX_TUPLE_SIZE_IN_WORDS --- ndb/include/ndbapi/ndbapi_limits.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ndb/include/ndbapi/ndbapi_limits.h b/ndb/include/ndbapi/ndbapi_limits.h index 6b8787d587d..b3577119e33 100644 --- a/ndb/include/ndbapi/ndbapi_limits.h +++ b/ndb/include/ndbapi/ndbapi_limits.h @@ -24,7 +24,7 @@ #define NDB_MAX_TAB_NAME_SIZE 128 #define NDB_MAX_ATTRIBUTES_IN_TABLE 128 -#define NDB_MAX_TUPLE_SIZE_IN_WORDS 1023 +#define NDB_MAX_TUPLE_SIZE_IN_WORDS 2013 #define NDB_MAX_KEYSIZE_IN_WORDS 1023 #define NDB_MAX_KEY_SIZE NDB_MAX_KEYSIZE_IN_WORDS*sizeof(Uint32) #define NDB_MAX_TUPLE_SIZE NDB_MAX_TUPLE_SIZE_IN_WORDS*sizeof(uint32) From f944465bf0dd474271ba83ace34a6c1efbb496e1 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 28 Oct 2004 11:56:09 +0000 Subject: [PATCH 0035/1063] Dbdict.cpp: changed to using fragmented signals for CREATE_TABLE_REQ ndb/src/kernel/blocks/dbdict/Dbdict.cpp: changed to using fragmented signals for CREATE_TABLE_REQ --- ndb/src/kernel/blocks/dbdict/Dbdict.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ndb/src/kernel/blocks/dbdict/Dbdict.cpp b/ndb/src/kernel/blocks/dbdict/Dbdict.cpp index d1a8128ea7f..882557daae1 100644 --- a/ndb/src/kernel/blocks/dbdict/Dbdict.cpp +++ b/ndb/src/kernel/blocks/dbdict/Dbdict.cpp @@ -3661,9 +3661,8 @@ Dbdict::execCREATE_FRAGMENTATION_CONF(Signal* signal){ req->tableId = tabPtr.i; req->tableVersion = tabEntry->m_tableVersion + 1; - sendSignal(rg, GSN_CREATE_TAB_REQ, signal, - CreateTabReq::SignalLength, JBB); - + sendFragmentedSignal(rg, GSN_CREATE_TAB_REQ, signal, + CreateTabReq::SignalLength, JBB); return; } From 51ad907d4894c486aa11089d695e918b2a1a04ef Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 28 Oct 2004 13:50:46 +0000 Subject: [PATCH 0036/1063] set set "CHUNK_SZ" for fragmented signal to real value added API_TRACE code removed old implementation of fragmented signal --- ndb/src/ndbapi/TransporterFacade.cpp | 80 +++++----------------------- 1 file changed, 14 insertions(+), 66 deletions(-) diff --git a/ndb/src/ndbapi/TransporterFacade.cpp b/ndb/src/ndbapi/TransporterFacade.cpp index 6495fee444a..2bf2b39f9a6 100644 --- a/ndb/src/ndbapi/TransporterFacade.cpp +++ b/ndb/src/ndbapi/TransporterFacade.cpp @@ -835,7 +835,7 @@ TransporterFacade::sendSignalUnCond(NdbApiSignal * aSignal, NodeId aNode){ return (ss == SEND_OK ? 0 : -1); } -#define CHUNK_SZ NDB_SECTION_SEGMENT_SZ*1 +#define CHUNK_SZ NDB_SECTION_SEGMENT_SZ*64 // related to MAX_MESSAGE_SIZE int TransporterFacade::sendFragmentedSignal(NdbApiSignal* aSignal, NodeId aNode, LinearSectionPtr ptr[3], Uint32 secs) @@ -843,6 +843,19 @@ TransporterFacade::sendFragmentedSignal(NdbApiSignal* aSignal, NodeId aNode, if(getIsNodeSendable(aNode) != true) return -1; +#ifdef API_TRACE + if(setSignalLog() && TRACE_GSN(aSignal->theVerId_signalNumber)){ + Uint32 tmp = aSignal->theSendersBlockRef; + aSignal->theSendersBlockRef = numberToRef(tmp, theOwnId); + signalLogger.sendSignal(* aSignal, + 1, + aSignal->getDataPtrSend(), + aNode, + ptr, secs); + aSignal->theSendersBlockRef = tmp; + } +#endif + NdbApiSignal tmp_signal(*(SignalHeader*)aSignal); LinearSectionPtr tmp_ptr[3]; Uint32 unique_id= m_fragmented_signal_id++; // next unique id @@ -942,71 +955,6 @@ TransporterFacade::sendFragmentedSignal(NdbApiSignal* aSignal, NodeId aNode, return ret; } -#if 0 -int -TransporterFacade::sendFragmentedSignal(NdbApiSignal* aSignal, NodeId aNode, - LinearSectionPtr ptr[3], Uint32 secs){ - aSignal->m_noOfSections = secs; - if(getIsNodeSendable(aNode) == true){ -#ifdef API_TRACE - if(setSignalLog() && TRACE_GSN(aSignal->theVerId_signalNumber)){ - Uint32 tmp = aSignal->theSendersBlockRef; - aSignal->theSendersBlockRef = numberToRef(tmp, theOwnId); - signalLogger.sendSignal(* aSignal, - 1, - aSignal->getDataPtrSend(), - aNode, - ptr, secs); - signalLogger.flushSignalLog(); - aSignal->theSendersBlockRef = tmp; - } -#endif - SendStatus ss = theTransporterRegistry->prepareSend - (aSignal, - 1, // JBB - aSignal->getDataPtrSend(), - aNode, - ptr); - assert(ss != SEND_MESSAGE_TOO_BIG); - aSignal->m_noOfSections = 0; - return (ss == SEND_OK ? 0 : -1); - } - aSignal->m_noOfSections = 0; - return -1; -} -#endif - - -int -TransporterFacade::sendFragmentedSignalUnCond(NdbApiSignal* aSignal, - NodeId aNode, - LinearSectionPtr ptr[3], - Uint32 secs){ - aSignal->m_noOfSections = secs; - -#ifdef API_TRACE - if(setSignalLog() && TRACE_GSN(aSignal->theVerId_signalNumber)){ - Uint32 tmp = aSignal->theSendersBlockRef; - aSignal->theSendersBlockRef = numberToRef(tmp, theOwnId); - signalLogger.sendSignal(* aSignal, - 1, - aSignal->getDataPtrSend(), - aNode, - ptr, secs); - aSignal->theSendersBlockRef = tmp; - } -#endif - SendStatus ss = - theTransporterRegistry->prepareSend(aSignal, 1, // JBB - aSignal->getDataPtrSend(), - aNode, ptr); - assert(ss != SEND_MESSAGE_TOO_BIG); - aSignal->m_noOfSections = 0; - return (ss == SEND_OK ? 0 : -1); -} - - - /****************************************************************************** * CONNECTION METHODS Etc ******************************************************************************/ From e3ac81bebf547b2031982134131ded3090cbe623 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 28 Oct 2004 14:49:40 +0000 Subject: [PATCH 0037/1063] scan should not send fragmented signal use new sendSignal method instead new send signal method which sends segments remove unused method sendFragmentedSignalUnCond ndb/src/ndbapi/NdbScanOperation.cpp: scan should not send fragmented signal use new sendSignal method instead ndb/src/ndbapi/TransporterFacade.cpp: new send signal method which sends segments ndb/src/ndbapi/TransporterFacade.hpp: new send signal method which sends segments remove unused method sendFragmentedSignalUnCond --- ndb/src/ndbapi/NdbScanOperation.cpp | 4 ++-- ndb/src/ndbapi/TransporterFacade.cpp | 32 ++++++++++++++++++++++++++++ ndb/src/ndbapi/TransporterFacade.hpp | 7 ++---- 3 files changed, 36 insertions(+), 7 deletions(-) diff --git a/ndb/src/ndbapi/NdbScanOperation.cpp b/ndb/src/ndbapi/NdbScanOperation.cpp index fd63ce96f25..86bac7deb16 100644 --- a/ndb/src/ndbapi/NdbScanOperation.cpp +++ b/ndb/src/ndbapi/NdbScanOperation.cpp @@ -612,7 +612,7 @@ NdbScanOperation::send_next_scan(Uint32 cnt, bool stopScanFlag){ LinearSectionPtr ptr[3]; ptr[0].p = prep_array; ptr[0].sz = cnt; - ret = tp->sendFragmentedSignal(&tSignal, nodeId, ptr, 1); + ret = tp->sendSignal(&tSignal, nodeId, ptr, 1); } else { tSignal.setLength(4+cnt); ret = tp->sendSignal(&tSignal, nodeId); @@ -803,7 +803,7 @@ NdbScanOperation::doSendScan(int aProcessorId) LinearSectionPtr ptr[3]; ptr[0].p = m_prepared_receivers; ptr[0].sz = theParallelism; - if (tp->sendFragmentedSignal(tSignal, aProcessorId, ptr, 1) == -1) { + if (tp->sendSignal(tSignal, aProcessorId, ptr, 1) == -1) { setErrorCode(4002); return -1; } diff --git a/ndb/src/ndbapi/TransporterFacade.cpp b/ndb/src/ndbapi/TransporterFacade.cpp index 2bf2b39f9a6..dfb090c8416 100644 --- a/ndb/src/ndbapi/TransporterFacade.cpp +++ b/ndb/src/ndbapi/TransporterFacade.cpp @@ -955,6 +955,38 @@ TransporterFacade::sendFragmentedSignal(NdbApiSignal* aSignal, NodeId aNode, return ret; } +int +TransporterFacade::sendSignal(NdbApiSignal* aSignal, NodeId aNode, + LinearSectionPtr ptr[3], Uint32 secs){ + aSignal->m_noOfSections = secs; + if(getIsNodeSendable(aNode) == true){ +#ifdef API_TRACE + if(setSignalLog() && TRACE_GSN(aSignal->theVerId_signalNumber)){ + Uint32 tmp = aSignal->theSendersBlockRef; + aSignal->theSendersBlockRef = numberToRef(tmp, theOwnId); + signalLogger.sendSignal(* aSignal, + 1, + aSignal->getDataPtrSend(), + aNode, + ptr, secs); + signalLogger.flushSignalLog(); + aSignal->theSendersBlockRef = tmp; + } +#endif + SendStatus ss = theTransporterRegistry->prepareSend + (aSignal, + 1, // JBB + aSignal->getDataPtrSend(), + aNode, + ptr); + assert(ss != SEND_MESSAGE_TOO_BIG); + aSignal->m_noOfSections = 0; + return (ss == SEND_OK ? 0 : -1); + } + aSignal->m_noOfSections = 0; + return -1; +} + /****************************************************************************** * CONNECTION METHODS Etc ******************************************************************************/ diff --git a/ndb/src/ndbapi/TransporterFacade.hpp b/ndb/src/ndbapi/TransporterFacade.hpp index b288e2ee8e6..5680e3a6f03 100644 --- a/ndb/src/ndbapi/TransporterFacade.hpp +++ b/ndb/src/ndbapi/TransporterFacade.hpp @@ -69,14 +69,11 @@ public: // Only sends to nodes which are alive int sendSignal(NdbApiSignal * signal, NodeId nodeId); + int sendSignal(NdbApiSignal*, NodeId, + LinearSectionPtr ptr[3], Uint32 secs); int sendFragmentedSignal(NdbApiSignal*, NodeId, LinearSectionPtr ptr[3], Uint32 secs); - //Dirrrrty - int sendFragmentedSignalUnCond(NdbApiSignal*, NodeId, - LinearSectionPtr ptr[3], Uint32 secs); - - // Is node available for running transactions bool get_node_alive(NodeId nodeId) const; bool get_node_stopping(NodeId nodeId) const; From 1aa81f3818023eaf95b46b795a7c4222850e46d1 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 28 Oct 2004 15:35:06 +0000 Subject: [PATCH 0038/1063] test that attribute name truncation works exposed the attribute name size limit for handler added field name truncation to ndb handler mysql-test/t/ndb_basic.test: test that attribute name truncation works ndb/include/ndbapi/ndbapi_limits.h: exposed the attribute name size limit for handler sql/ha_ndbcluster.cc: added field name truncation to ndb handler --- mysql-test/t/ndb_basic.test | 15 +++++++++++++++ ndb/include/ndbapi/ndbapi_limits.h | 1 + sql/ha_ndbcluster.cc | 21 ++++++++++++++++++--- 3 files changed, 34 insertions(+), 3 deletions(-) diff --git a/mysql-test/t/ndb_basic.test b/mysql-test/t/ndb_basic.test index 0d4bffce80d..f5bed3dcdff 100644 --- a/mysql-test/t/ndb_basic.test +++ b/mysql-test/t/ndb_basic.test @@ -507,3 +507,18 @@ c127 int, c128 int, primary key(c1)) engine=ndb; drop table t1; + +# +# test max size of attribute name and truncation +# + +create table t1 ( +a1234567890123456789012345678901234567890 int primary key, +a12345678901234567890123456789a1234567890 int, +index(a12345678901234567890123456789a1234567890) +) engine=ndb; +show tables; +insert into t1 values (1,1),(2,1),(3,1),(4,1),(5,2),(6,1),(7,1); +explain select * from t1 where a12345678901234567890123456789a1234567890=2; +select * from t1 where a12345678901234567890123456789a1234567890=2; +drop table t1; diff --git a/ndb/include/ndbapi/ndbapi_limits.h b/ndb/include/ndbapi/ndbapi_limits.h index b3577119e33..05556ab2f5f 100644 --- a/ndb/include/ndbapi/ndbapi_limits.h +++ b/ndb/include/ndbapi/ndbapi_limits.h @@ -22,6 +22,7 @@ #define NDB_MAX_DATABASE_NAME_SIZE 128 #define NDB_MAX_SCHEMA_NAME_SIZE 128 #define NDB_MAX_TAB_NAME_SIZE 128 +#define NDB_MAX_ATTR_NAME_SIZE 32 #define NDB_MAX_ATTRIBUTES_IN_TABLE 128 #define NDB_MAX_TUPLE_SIZE_IN_WORDS 2013 diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 044cb85b913..838cf69855a 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -1393,8 +1393,13 @@ int ha_ndbcluster::set_bounds(NdbIndexScanOperation *op, // Set bound if not cancelled via type -1 if (p.bound_type != -1) - if (op->setBound(field->field_name, p.bound_type, p.bound_ptr)) + { + char truncated_field_name[NDB_MAX_ATTR_NAME_SIZE]; + strnmov(truncated_field_name,field->field_name,sizeof(truncated_field_name)); + truncated_field_name[sizeof(truncated_field_name)-1]= '\0'; + if (op->setBound(truncated_field_name, p.bound_type, p.bound_ptr)) ERR_RETURN(op->getNdbError()); + } } } @@ -3102,7 +3107,12 @@ static int create_ndb_column(NDBCOL &col, HA_CREATE_INFO *info) { // Set name - col.setName(field->field_name); + { + char truncated_field_name[NDB_MAX_ATTR_NAME_SIZE]; + strnmov(truncated_field_name,field->field_name,sizeof(truncated_field_name)); + truncated_field_name[sizeof(truncated_field_name)-1]= '\0'; + col.setName(truncated_field_name); + } // Get char set CHARSET_INFO *cs= field->charset(); // Set type and sizes @@ -3430,7 +3440,12 @@ int ha_ndbcluster::create_index(const char *name, { Field *field= key_part->field; DBUG_PRINT("info", ("attr: %s", field->field_name)); - ndb_index.addColumnName(field->field_name); + { + char truncated_field_name[NDB_MAX_ATTR_NAME_SIZE]; + strnmov(truncated_field_name,field->field_name,sizeof(truncated_field_name)); + truncated_field_name[sizeof(truncated_field_name)-1]= '\0'; + ndb_index.addColumnName(truncated_field_name); + } } if (dict->createIndex(ndb_index)) From 9d07242b67ff2864b821afb200e94ba8290e3643 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 28 Oct 2004 15:43:16 +0000 Subject: [PATCH 0039/1063] ndb_basic.result: forgot to commit new result mysql-test/r/ndb_basic.result: forgot to commit new result --- mysql-test/r/ndb_basic.result | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/mysql-test/r/ndb_basic.result b/mysql-test/r/ndb_basic.result index 37083beac89..604084a72c2 100644 --- a/mysql-test/r/ndb_basic.result +++ b/mysql-test/r/ndb_basic.result @@ -545,3 +545,19 @@ c127 int, c128 int, primary key(c1)) engine=ndb; drop table t1; +create table t1 ( +a1234567890123456789012345678901234567890 int primary key, +a12345678901234567890123456789a1234567890 int, +index(a12345678901234567890123456789a1234567890) +) engine=ndb; +show tables; +Tables_in_test +t1 +insert into t1 values (1,1),(2,1),(3,1),(4,1),(5,2),(6,1),(7,1); +explain select * from t1 where a12345678901234567890123456789a1234567890=2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref a12345678901234567890123456789a1234567890 a12345678901234567890123456789a1234567890 5 const 10 Using where +select * from t1 where a12345678901234567890123456789a1234567890=2; +a1234567890123456789012345678901234567890 a12345678901234567890123456789a1234567890 +5 2 +drop table t1; From 33d68675f7a5df7df9d98046d1e40a25744280ee Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 28 Oct 2004 21:14:00 +0300 Subject: [PATCH 0040/1063] close table before next iteration of table proccesing in mysql_admin_table (to allow open next table) --- sql/sql_table.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 8190e31bc0b..65690e56039 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -1268,9 +1268,13 @@ static int mysql_admin_table(THD* thd, TABLE_LIST* tables, if (prepare_func) { switch ((*prepare_func)(thd, table, check_opt)) { - case 1: continue; // error, message written to net - case -1: goto err; // error, message could be written to net - default: ; // should be 0 otherwise + case 1: // error, message written to net + close_thread_tables(thd); + continue; + case -1: // error, message could be written to net + goto err; + default: // should be 0 otherwise + ; } } From 99b76e6bf41d5fb08cb25bc2005885633cf6e323 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 29 Oct 2004 09:24:21 +0200 Subject: [PATCH 0041/1063] - bumped up version number from 4.0.22 to 4.0.23 in configure.in - tagged ChangeSet@1.2048.1.2 as "mysql-4.0.22" configure.in: - bumped up version number from 4.0.22 to 4.0.23 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index d4073ea441b..d4ede468435 100644 --- a/configure.in +++ b/configure.in @@ -4,7 +4,7 @@ dnl Process this file with autoconf to produce a configure script. AC_INIT(sql/mysqld.cc) AC_CANONICAL_SYSTEM # The Docs Makefile.am parses this line! -AM_INIT_AUTOMAKE(mysql, 4.0.22) +AM_INIT_AUTOMAKE(mysql, 4.0.23) AM_CONFIG_HEADER(config.h) PROTOCOL_VERSION=10 From 3b658d07181dfe470f59d1f15fc302ee83bc49f6 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 29 Oct 2004 09:49:04 +0000 Subject: [PATCH 0042/1063] Tru64 cxx compiler fix cxx does not include -I/ust/include.dtk as it should removed dependency on ndb_types configure.in: Tru64 cxx compiler fix cxx does not include -I/ust/include.dtk as it should ndb/include/ndbapi/ndbapi_limits.h: removed dependency on ndb_types sql/ha_ndbcluster.h: removed dependency on ndb_types --- configure.in | 3 ++- ndb/include/ndbapi/ndbapi_limits.h | 4 ++-- sql/ha_ndbcluster.h | 1 - 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/configure.in b/configure.in index 656af354607..ec003b55cb5 100644 --- a/configure.in +++ b/configure.in @@ -1144,7 +1144,8 @@ dnl Is this the right match for DEC OSF on alpha? # gethostbyname_r is deprecated and doesn't work ok on OSF1 CFLAGS="$CFLAGS -DUNDEF_HAVE_GETHOSTBYNAME_R" CXXFLAGS="$CXXFLAGS -DUNDEF_HAVE_GETHOSTBYNAME_R" - ndb_cxxflags_fix="$ndb_cxxflags_fix -I/usr/include.dtk" + # fix to handle include of correctly on OSF1 with cxx compiler + CXXFLAGS="$CXXFLAGS -I/usr/include/cxx -I/usr/include/cxx_cname -I/usr/include.dtk" ;; *netware*) # No need for curses library so set it to null diff --git a/ndb/include/ndbapi/ndbapi_limits.h b/ndb/include/ndbapi/ndbapi_limits.h index 1cf2d9b342d..f812fa2d69d 100644 --- a/ndb/include/ndbapi/ndbapi_limits.h +++ b/ndb/include/ndbapi/ndbapi_limits.h @@ -26,8 +26,8 @@ #define NDB_MAX_TUPLE_SIZE_IN_WORDS 1023 #define NDB_MAX_KEYSIZE_IN_WORDS 1023 -#define NDB_MAX_KEY_SIZE NDB_MAX_KEYSIZE_IN_WORDS*sizeof(Uint32) -#define NDB_MAX_TUPLE_SIZE NDB_MAX_TUPLE_SIZE_IN_WORDS*sizeof(uint32) +#define NDB_MAX_KEY_SIZE (NDB_MAX_KEYSIZE_IN_WORDS*4) +#define NDB_MAX_TUPLE_SIZE (NDB_MAX_TUPLE_SIZE_IN_WORDS*4) #define NDB_MAX_ACTIVE_EVENTS 100 #endif diff --git a/sql/ha_ndbcluster.h b/sql/ha_ndbcluster.h index 8224d1c4167..b33a0657d4f 100644 --- a/sql/ha_ndbcluster.h +++ b/sql/ha_ndbcluster.h @@ -26,7 +26,6 @@ #endif #include -#include class Ndb; // Forward declaration class NdbOperation; // Forward declaration From a739f2d692093accfb5babf3df9008913fdf5d3f Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 29 Oct 2004 16:00:03 +0500 Subject: [PATCH 0043/1063] Allow to convert to non-Unicode charset when mixing a string constant with a column. The string is converted into the column character set. It conversion doesn't lose data, then operation is possible. Otherwise, give an error, as it was earlier. sql/item.h: Change bool argument to uint flags: we have now two different flags. --- mysql-test/r/ctype_recoding.result | 12 +++ mysql-test/t/ctype_recoding.test | 22 ++++++ sql/item.cc | 81 +++++++++++++++----- sql/item.h | 16 +++- sql/item_cmpfunc.cc | 118 +++++++++++++++++------------ sql/item_func.cc | 8 +- sql/item_func.h | 4 +- 7 files changed, 187 insertions(+), 74 deletions(-) diff --git a/mysql-test/r/ctype_recoding.result b/mysql-test/r/ctype_recoding.result index 72d19885101..dc1f4c12e25 100644 --- a/mysql-test/r/ctype_recoding.result +++ b/mysql-test/r/ctype_recoding.result @@ -174,3 +174,15 @@ Warnings: Warning 1265 Data truncated for column 'a' at row 1 Warning 1265 Data truncated for column 'b' at row 1 drop table t1; +set names koi8r; +create table t1 (a char(10) character set cp1251); +insert into t1 values (_koi8r'×ÁÓÑ'); +select * from t1 where a=_koi8r'×ÁÓÑ'; +a +×ÁÓÑ +select * from t1 where a=concat(_koi8r'×ÁÓÑ'); +ERROR HY000: Illegal mix of collations (cp1251_general_ci,IMPLICIT) and (koi8r_general_ci,COERCIBLE) for operation '=' +select * from t1 where a=_latin1'×ÁÓÑ'; +ERROR HY000: Illegal mix of collations (cp1251_general_ci,IMPLICIT) and (latin1_swedish_ci,COERCIBLE) for operation '=' +drop table t1; +set names latin1; diff --git a/mysql-test/t/ctype_recoding.test b/mysql-test/t/ctype_recoding.test index 5f417352d95..dab898e9f2c 100644 --- a/mysql-test/t/ctype_recoding.test +++ b/mysql-test/t/ctype_recoding.test @@ -131,3 +131,25 @@ create table t1 (a char(10) character set koi8r, b text character set koi8r); insert into t1 values ('test','test'); insert into t1 values ('ÊÃÕË','ÊÃÕË'); drop table t1; + +# +# Try to apply an automatic conversion in some cases: +# E.g. when mixing a column to a string, the string +# is converted into the column character set. +# If conversion loses data, then error. Otherwise, +# the string is replaced by its converted representation +# +set names koi8r; +create table t1 (a char(10) character set cp1251); +insert into t1 values (_koi8r'×ÁÓÑ'); +# this is possible: +select * from t1 where a=_koi8r'×ÁÓÑ'; +# this is not possible, because we have a function, not just a constant: +--error 1267 +select * from t1 where a=concat(_koi8r'×ÁÓÑ'); +# this is not posible, cannot convert _latin1'×ÁÓÑ' into cp1251: +--error 1267 +select * from t1 where a=_latin1'×ÁÓÑ'; +drop table t1; +set names latin1; + diff --git a/sql/item.cc b/sql/item.cc index b4c416e7741..18025d6d689 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -259,7 +259,43 @@ CHARSET_INFO *Item::default_charset() return current_thd->variables.collation_connection; } -bool DTCollation::aggregate(DTCollation &dt, bool superset_conversion) + +/* + Aggregate two collations together taking + into account their coercibility (aka derivation): + + 0 == DERIVATION_EXPLICIT - an explicitely written COLLATE clause + 1 == DERIVATION_NONE - a mix of two different collations + 2 == DERIVATION_IMPLICIT - a column + 3 == DERIVATION_COERCIBLE - a string constant + + The most important rules are: + + 1. If collations are the same: + chose this collation, and the strongest derivation. + + 2. If collations are different: + - Character sets may differ, but only if conversion without + data loss is possible. The caller provides flags whether + character set conversion attempts should be done. If no + flags are substituted, then the character sets must be the same. + Currently processed flags are: + MY_COLL_ALLOW_SUPERSET_CONV - allow conversion to a superset + MY_COLL_ALLOW_COERCIBLE_CONV - allow conversion of a coercible value + - two EXPLICIT collations produce an error, e.g. this is wrong: + CONCAT(expr1 collate latin1_swedish_ci, expr2 collate latin1_german_ci) + - the side with smaller derivation value wins, + i.e. a column is stronger than a string constant, + an explicit COLLATE clause is stronger than a column. + - if derivations are the same, we have DERIVATION_NONE, + we'll wait for an explicit COLLATE clause which possibly can + come from another argument later: for example, this is valid, + but we don't know yet when collecting the first two arguments: + CONCAT(latin1_swedish_ci_column, + latin1_german1_ci_column, + expr COLLATE latin1_german2_ci) +*/ +bool DTCollation::aggregate(DTCollation &dt, uint flags) { nagg++; if (!my_charset_same(collation, dt.collation)) @@ -290,28 +326,37 @@ bool DTCollation::aggregate(DTCollation &dt, bool superset_conversion) else ; // Do nothing } - else if (superset_conversion) + else if ((flags & MY_COLL_ALLOW_SUPERSET_CONV) && + derivation < dt.derivation && + collation->state & MY_CS_UNICODE) { - if (derivation < dt.derivation && - collation->state & MY_CS_UNICODE) - ; // Do nothing - else if (dt.derivation < derivation && - dt.collation->state & MY_CS_UNICODE) - { - set(dt); - strong= nagg; - } - else - { - // Cannot convert to superset - set(0, DERIVATION_NONE); - return 1; - } + // Do nothing + } + else if ((flags & MY_COLL_ALLOW_SUPERSET_CONV) && + dt.derivation < derivation && + dt.collation->state & MY_CS_UNICODE) + { + set(dt); + strong= nagg; + } + else if ((flags & MY_COLL_ALLOW_COERCIBLE_CONV) && + derivation < dt.derivation && + dt.derivation == DERIVATION_COERCIBLE) + { + // Do nothing; + } + else if ((flags & MY_COLL_ALLOW_COERCIBLE_CONV) && + dt.derivation < derivation && + derivation == DERIVATION_COERCIBLE) + { + set(dt); + strong= nagg; } else { + // Cannot apply conversion set(0, DERIVATION_NONE); - return 1; + return 1; } } else if (derivation < dt.derivation) diff --git a/sql/item.h b/sql/item.h index e22cef7ba7f..2c0c3306c44 100644 --- a/sql/item.h +++ b/sql/item.h @@ -37,6 +37,16 @@ enum Derivation DERIVATION_EXPLICIT= 0 }; +/* + Flags for collation aggregation modes: + allow conversion to a superset + allow conversion of a coercible value (i.e. constant). +*/ + +#define MY_COLL_ALLOW_SUPERSET_CONV 1 +#define MY_COLL_ALLOW_COERCIBLE_CONV 2 + + class DTCollation { public: CHARSET_INFO *collation; @@ -72,9 +82,9 @@ public: { collation= collation_arg; } void set(Derivation derivation_arg) { derivation= derivation_arg; } - bool aggregate(DTCollation &dt, bool superset_conversion= FALSE); - bool set(DTCollation &dt1, DTCollation &dt2, bool superset_conversion= FALSE) - { set(dt1); return aggregate(dt2, superset_conversion); } + bool aggregate(DTCollation &dt, uint flags= 0); + bool set(DTCollation &dt1, DTCollation &dt2, uint flags= 0) + { set(dt1); return aggregate(dt2, flags); } const char *derivation_name() const { switch(derivation) diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index c9396aaa67c..dc0377c791f 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -174,62 +174,87 @@ void Item_bool_func2::fix_length_and_dec() return; /* - We allow to convert to Unicode character sets in some cases. + We allow to apply automatic character set conversion in some cases. The conditions when conversion is possible are: - arguments A and B have different charsets - A wins according to coercibility rules - - character set of A is superset for character set of B - + (i.e. a column is stronger than a string constant, + an explicit COLLATE clause is stronger than a column) + - character set of A is either superset for character set of B, + or B is a string constant which can be converted into the + character set of A without data loss. + If all of the above is true, then it's possible to convert B into the character set of A, and then compare according to the collation of A. */ - if (args[0] && args[1]) - { - uint strong= 0; - uint weak= 0; - uint32 dummy_offset; - DTCollation coll; + uint32 dummy_offset; + DTCollation coll; - if (args[0]->result_type() == STRING_RESULT && - args[1]->result_type() == STRING_RESULT && - String::needs_conversion(0, args[0]->collation.collation, - args[1]->collation.collation, - &dummy_offset) && - !coll.set(args[0]->collation, args[1]->collation, TRUE)) + if (args[0]->result_type() == STRING_RESULT && + args[1]->result_type() == STRING_RESULT && + String::needs_conversion(0, args[0]->collation.collation, + args[1]->collation.collation, + &dummy_offset) && + !coll.set(args[0]->collation, args[1]->collation, + MY_COLL_ALLOW_SUPERSET_CONV | + MY_COLL_ALLOW_COERCIBLE_CONV)) + { + Item* conv= 0; + Item_arena *arena= thd->current_arena, backup; + uint strong= coll.strong; + uint weak= strong ? 0 : 1; + /* + In case we're in statement prepare, create conversion item + in its memory: it will be reused on each execute. + */ + if (arena->is_stmt_prepare()) + thd->set_n_backup_item_arena(arena, &backup); + if (args[weak]->type() == STRING_ITEM) { - Item* conv= 0; - Item_arena *arena= thd->current_arena, backup; - strong= coll.strong; - weak= strong ? 0 : 1; - /* - In case we're in statement prepare, create conversion item - in its memory: it will be reused on each execute. - */ - if (arena->is_stmt_prepare()) - thd->set_n_backup_item_arena(arena, &backup); - if (args[weak]->type() == STRING_ITEM) + uint conv_errors; + String tmp, cstr, *ostr= args[weak]->val_str(&tmp); + cstr.copy(ostr->ptr(), ostr->length(), ostr->charset(), + args[strong]->collation.collation, &conv_errors); + if (conv_errors) { - String tmp, cstr; - String *ostr= args[weak]->val_str(&tmp); - cstr.copy(ostr->ptr(), ostr->length(), ostr->charset(), - args[strong]->collation.collation); - conv= new Item_string(cstr.ptr(),cstr.length(),cstr.charset(), - args[weak]->collation.derivation); - ((Item_string*)conv)->str_value.copy(); + /* + We could not convert a string into the character set + of the stronger side of the operation without data loss. + It can happen if we tried to combine a column with a string + constant, and the column charset does not cover all the + characters from the string. Operation cannot be done + correctly. Return an error. + */ + my_coll_agg_error(args[0]->collation, args[1]->collation, + func_name()); + return; } - else - { - conv= new Item_func_conv_charset(args[weak], - args[strong]->collation.collation); - conv->collation.set(args[weak]->collation.derivation); - conv->fix_fields(thd, 0, &conv); - } - if (arena->is_stmt_prepare()) - thd->restore_backup_item_arena(arena, &backup); - args[weak]= conv ? conv : args[weak]; + conv= new Item_string(cstr.ptr(),cstr.length(),cstr.charset(), + args[weak]->collation.derivation); + ((Item_string*)conv)->str_value.copy(); } + else + { + if (!(coll.collation->state & MY_CS_UNICODE)) + { + /* + Don't allow automatic conversion to non-Unicode charsets, + as it potentially loses data. + */ + my_coll_agg_error(args[0]->collation, args[1]->collation, + func_name()); + return; + } + conv= new Item_func_conv_charset(args[weak], + args[strong]->collation.collation); + conv->collation.set(args[weak]->collation.derivation); + conv->fix_fields(thd, 0, &conv); + } + if (arena->is_stmt_prepare()) + thd->restore_backup_item_arena(arena, &backup); + args[weak]= conv ? conv : args[weak]; } // Make a special case of compare with fields to get nicer DATE comparisons @@ -1782,14 +1807,13 @@ void Item_func_in::fix_length_and_dec() via creating Item_func_conv_charset(). */ - if (agg_arg_collations_for_comparison(cmp_collation, - args, arg_count, TRUE)) + if (agg_arg_collations_for_comparison(cmp_collation, args, arg_count, + MY_COLL_ALLOW_SUPERSET_CONV)) return; if ((!my_charset_same(args[0]->collation.collation, cmp_collation.collation) || !const_itm)) { - if (agg_arg_collations_for_comparison(cmp_collation, - args, arg_count, FALSE)) + if (agg_arg_collations_for_comparison(cmp_collation, args, arg_count)) return; } else diff --git a/sql/item_func.cc b/sql/item_func.cc index 879c0b36bdd..3cb125d2868 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -76,7 +76,7 @@ static void my_coll_agg_error(Item** args, uint count, const char *fname) bool Item_func::agg_arg_collations(DTCollation &c, Item **av, uint count, - bool allow_superset_conversion) + uint flags) { uint i; c.nagg= 0; @@ -84,7 +84,7 @@ bool Item_func::agg_arg_collations(DTCollation &c, Item **av, uint count, c.set(av[0]->collation); for (i= 1; i < count; i++) { - if (c.aggregate(av[i]->collation, allow_superset_conversion)) + if (c.aggregate(av[i]->collation, flags)) { my_coll_agg_error(av, count, func_name()); return TRUE; @@ -96,9 +96,9 @@ bool Item_func::agg_arg_collations(DTCollation &c, Item **av, uint count, bool Item_func::agg_arg_collations_for_comparison(DTCollation &c, Item **av, uint count, - bool allow_superset_conv) + uint flags) { - if (agg_arg_collations(c, av, count, allow_superset_conv)) + if (agg_arg_collations(c, av, count, flags)) return TRUE; if (c.derivation == DERIVATION_NONE) diff --git a/sql/item_func.h b/sql/item_func.h index 6e43d66a32d..963038227a2 100644 --- a/sql/item_func.h +++ b/sql/item_func.h @@ -141,10 +141,10 @@ public: Item *get_tmp_table_item(THD *thd); bool agg_arg_collations(DTCollation &c, Item **items, uint nitems, - bool allow_superset_conversion= FALSE); + uint flags= 0); bool agg_arg_collations_for_comparison(DTCollation &c, Item **items, uint nitems, - bool allow_superset_comversion= FALSE); + uint flags= 0); bool walk(Item_processor processor, byte *arg); }; From eb865dc687f4dabb46d2c7b39a0f4e9cb194e4a0 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 29 Oct 2004 11:06:06 +0000 Subject: [PATCH 0044/1063] configure.in: -I/usr/include needed for cxx on Tru64 configure.in: -I/usr/include needed for cxx on Tru64 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 7c6b9ff7b51..a361e11935c 100644 --- a/configure.in +++ b/configure.in @@ -1145,7 +1145,7 @@ dnl Is this the right match for DEC OSF on alpha? CFLAGS="$CFLAGS -DUNDEF_HAVE_GETHOSTBYNAME_R" CXXFLAGS="$CXXFLAGS -DUNDEF_HAVE_GETHOSTBYNAME_R" # fix to handle include of correctly on OSF1 with cxx compiler - CXXFLAGS="$CXXFLAGS -I/usr/include/cxx -I/usr/include/cxx_cname -I/usr/include.dtk" + CXXFLAGS="$CXXFLAGS -I/usr/include/cxx -I/usr/include/cxx_cname -I/usr/include -I/usr/include.dtk" ;; *netware*) # No need for curses library so set it to null From fcb322279eba22dcc29093d0212ea5a21f78ed59 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 29 Oct 2004 16:06:51 +0500 Subject: [PATCH 0045/1063] item_strfunc.cc: Unnecessary code was removed. sql/item_strfunc.cc: Unnecessary code was removed. --- sql/item_strfunc.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index c51894afde4..2d9f7e7bff8 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -643,7 +643,12 @@ void Item_func_concat_ws::fix_length_and_dec() if (agg_arg_collations(collation, args, arg_count)) return; - max_length= arg_count > 1 ? args[0]->max_length * (arg_count - 2) : 0; + /* + arg_count cannot be less than 2, + it is done on parser level in sql_yacc.yy + so, (arg_count - 2) is safe here. + */ + max_length= args[0]->max_length * (arg_count - 2); for (uint i=1 ; i < arg_count ; i++) max_length+=args[i]->max_length; From 731b06f47fcd220dd12324fd7547943e80e68505 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 29 Oct 2004 11:25:16 +0000 Subject: [PATCH 0046/1063] bumped up version for ndb protocal change in create table, now allows for more than 91 attributes upgrade compatability with 3.5.3 configure.in: bumped up version for ndb protocal change in create table, now allows for more than 91 attributes ndb/src/common/util/version.c: upgrade compatability with 3.5.3 --- configure.in | 2 +- ndb/src/common/util/version.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 9901ef5d4fd..392aaba2cda 100644 --- a/configure.in +++ b/configure.in @@ -15,7 +15,7 @@ SHARED_LIB_VERSION=14:0:0 # ndb version NDB_VERSION_MAJOR=3 NDB_VERSION_MINOR=5 -NDB_VERSION_BUILD=3 +NDB_VERSION_BUILD=4 NDB_VERSION_STATUS="" # Set all version vars based on $VERSION. How do we do this more elegant ? diff --git a/ndb/src/common/util/version.c b/ndb/src/common/util/version.c index e2515b243b1..f2b3d5bd522 100644 --- a/ndb/src/common/util/version.c +++ b/ndb/src/common/util/version.c @@ -74,6 +74,7 @@ struct NdbUpGradeCompatible ndbCompatibleTable_full[] = { }; struct NdbUpGradeCompatible ndbCompatibleTable_upgrade[] = { + { MAKE_VERSION(3,5,4), MAKE_VERSION(3,5,3), UG_Exact }, { 0, 0, UG_Null } }; From 6e781e11a9f7606b8b41532c382df9cf00617d17 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 29 Oct 2004 17:00:39 +0500 Subject: [PATCH 0047/1063] A fix according to Monty's request: "uint *errors" is now a non-optional parameter in String:copy() and copy_and_convert(). --- sql/field.cc | 15 ++++++++++----- sql/item.cc | 4 +++- sql/item_cmpfunc.cc | 3 ++- sql/item_create.cc | 5 ++++- sql/item_func.cc | 3 ++- sql/item_strfunc.cc | 9 ++++++--- sql/item_timefunc.cc | 4 +++- sql/protocol.cc | 3 ++- sql/sql_class.cc | 6 ++++-- sql/sql_parse.cc | 17 ++++++++++++----- sql/sql_show.cc | 6 ++++-- sql/sql_string.cc | 25 ++++++++++++++----------- sql/sql_string.h | 4 ++-- sql/thr_malloc.cc | 5 ++++- 14 files changed, 72 insertions(+), 37 deletions(-) diff --git a/sql/field.cc b/sql/field.cc index 261494d2125..4b833874221 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -531,7 +531,8 @@ int Field_decimal::store(const char *from, uint len, CHARSET_INFO *cs) /* Convert character set if the old one is multi byte */ if (cs->mbmaxlen > 1) { - tmp.copy(from, len, cs, &my_charset_bin); + uint dummy_errors; + tmp.copy(from, len, cs, &my_charset_bin, &dummy_errors); from= tmp.ptr(); len= tmp.length(); } @@ -5502,7 +5503,8 @@ int Field_enum::store(const char *from,uint length,CHARSET_INFO *cs) /* Convert character set if nesessary */ if (String::needs_conversion(length, cs, field_charset, ¬_used)) { - tmpstr.copy(from, length, cs, field_charset); + uint dummy_errors; + tmpstr.copy(from, length, cs, field_charset, &dummy_errors); from= tmpstr.ptr(); length= tmpstr.length(); } @@ -5650,10 +5652,11 @@ void Field_enum::sql_type(String &res) const bool flag=0; for (const char **pos= typelib->type_names; *pos; pos++) { + uint dummy_errors; if (flag) res.append(','); /* convert to res.charset() == utf8, then quote */ - enum_item.copy(*pos, strlen(*pos), charset(), res.charset()); + enum_item.copy(*pos, strlen(*pos), charset(), res.charset(), &dummy_errors); append_unescaped(&res, enum_item.ptr(), enum_item.length()); flag= 1; } @@ -5684,7 +5687,8 @@ int Field_set::store(const char *from,uint length,CHARSET_INFO *cs) /* Convert character set if nesessary */ if (String::needs_conversion(length, cs, field_charset, ¬_used_offset)) { - tmpstr.copy(from, length, cs, field_charset); + uint dummy_errors; + tmpstr.copy(from, length, cs, field_charset, &dummy_errors); from= tmpstr.ptr(); length= tmpstr.length(); } @@ -5760,10 +5764,11 @@ void Field_set::sql_type(String &res) const bool flag=0; for (const char **pos= typelib->type_names; *pos; pos++) { + uint dummy_errors; if (flag) res.append(','); /* convert to res.charset() == utf8, then quote */ - set_item.copy(*pos, strlen(*pos), charset(), res.charset()); + set_item.copy(*pos, strlen(*pos), charset(), res.charset(), &dummy_errors); append_unescaped(&res, set_item.ptr(), set_item.length()); flag= 1; } diff --git a/sql/item.cc b/sql/item.cc index 18025d6d689..46215fd78ed 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -818,7 +818,9 @@ bool Item_param::set_str(const char *str, ulong length) Assign string with no conversion: data is converted only after it's been written to the binary log. */ - if (str_value.copy(str, length, &my_charset_bin, &my_charset_bin)) + uint dummy_errors; + if (str_value.copy(str, length, &my_charset_bin, &my_charset_bin, + &dummy_errors)) DBUG_RETURN(TRUE); state= STRING_VALUE; maybe_null= 0; diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index dc0377c791f..d9db07e2289 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -1832,8 +1832,9 @@ void Item_func_in::fix_length_and_dec() { Item_string *conv; String tmp, cstr, *ostr= arg[0]->val_str(&tmp); + uint dummy_errors; cstr.copy(ostr->ptr(), ostr->length(), ostr->charset(), - cmp_collation.collation); + cmp_collation.collation, &dummy_errors); conv= new Item_string(cstr.ptr(),cstr.length(), cstr.charset(), arg[0]->collation.derivation); conv->str_value.copy(); diff --git a/sql/item_create.cc b/sql/item_create.cc index c98c7892c26..800489a6a72 100644 --- a/sql/item_create.cc +++ b/sql/item_create.cc @@ -377,7 +377,10 @@ Item *create_func_space(Item *a) { sp= new Item_string("",0,cs); if (sp) - sp->str_value.copy(" ",1,&my_charset_latin1,cs); + { + uint dummy_errors; + sp->str_value.copy(" ", 1, &my_charset_latin1, cs, &dummy_errors); + } } else { diff --git a/sql/item_func.cc b/sql/item_func.cc index 3cb125d2868..50843d3bf76 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -2906,8 +2906,9 @@ void Item_func_match::init_search(bool no_order) if (ft_tmp->charset() != cmp_collation.collation) { + uint dummy_errors; search_value.copy(ft_tmp->ptr(), ft_tmp->length(), ft_tmp->charset(), - cmp_collation.collation); + cmp_collation.collation, &dummy_errors); ft_tmp= &search_value; } diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 2d9f7e7bff8..5eda89ef21e 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -2160,13 +2160,14 @@ String *Item_func_conv_charset::val_str(String *str) { DBUG_ASSERT(fixed == 1); String *arg= args[0]->val_str(str); + uint dummy_errors; if (!arg) { null_value=1; return 0; } null_value= str_value.copy(arg->ptr(),arg->length(),arg->charset(), - conv_charset); + conv_charset, &dummy_errors); return null_value ? 0 : &str_value; } @@ -2249,11 +2250,12 @@ String *Item_func_charset::val_str(String *str) { DBUG_ASSERT(fixed == 1); String *res = args[0]->val_str(str); + uint dummy_errors; if ((null_value=(args[0]->null_value || !res->charset()))) return 0; str->copy(res->charset()->csname,strlen(res->charset()->csname), - &my_charset_latin1, collation.collation); + &my_charset_latin1, collation.collation, &dummy_errors); return str; } @@ -2261,11 +2263,12 @@ String *Item_func_collation::val_str(String *str) { DBUG_ASSERT(fixed == 1); String *res = args[0]->val_str(str); + uint dummy_errors; if ((null_value=(args[0]->null_value || !res->charset()))) return 0; str->copy(res->charset()->name,strlen(res->charset()->name), - &my_charset_latin1, collation.collation); + &my_charset_latin1, collation.collation, &dummy_errors); return str; } diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index 3c8dbb013a9..f621953a5bc 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -2121,8 +2121,10 @@ String *Item_char_typecast::val_str(String *str) else { // Convert character set if differ + uint dummy_errors; if (!(res1= args[0]->val_str(&tmp_value)) || - str->copy(res1->ptr(), res1->length(),res1->charset(), cast_cs)) + str->copy(res1->ptr(), res1->length(), res1->charset(), + cast_cs, &dummy_errors)) { null_value= 1; return 0; diff --git a/sql/protocol.cc b/sql/protocol.cc index 887177c0a19..598d102ec29 100644 --- a/sql/protocol.cc +++ b/sql/protocol.cc @@ -713,7 +713,8 @@ bool Protocol::store_string_aux(const char *from, uint length, fromcs != &my_charset_bin && tocs != &my_charset_bin) { - return convert->copy(from, length, fromcs, tocs) || + uint dummy_errors; + return convert->copy(from, length, fromcs, tocs, &dummy_errors) || net_store_data(convert->ptr(), convert->length()); } return net_store_data(from, length); diff --git a/sql/sql_class.cc b/sql/sql_class.cc index abe00027b07..7ad20967de0 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -508,13 +508,14 @@ bool THD::convert_string(LEX_STRING *to, CHARSET_INFO *to_cs, { DBUG_ENTER("convert_string"); size_s new_length= to_cs->mbmaxlen * from_length; + uint dummy_errors; if (!(to->str= alloc(new_length+1))) { to->length= 0; // Safety fix DBUG_RETURN(1); // EOM } to->length= copy_and_convert((char*) to->str, new_length, to_cs, - from, from_length, from_cs); + from, from_length, from_cs, &dummy_errors); to->str[to->length]=0; // Safety DBUG_RETURN(0); } @@ -537,7 +538,8 @@ bool THD::convert_string(LEX_STRING *to, CHARSET_INFO *to_cs, bool THD::convert_string(String *s, CHARSET_INFO *from_cs, CHARSET_INFO *to_cs) { - if (convert_buffer.copy(s->ptr(), s->length(), from_cs, to_cs)) + uint dummy_errors; + if (convert_buffer.copy(s->ptr(), s->length(), from_cs, to_cs, &dummy_errors)) return TRUE; /* If convert_buffer >> s copying is more efficient long term */ if (convert_buffer.alloced_length() >= convert_buffer.length() * 2 || diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index d1f460d918e..dce32720184 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -882,18 +882,20 @@ static int check_connection(THD *thd) /* Since 4.1 all database names are stored in utf8 */ if (db) { + uint dummy_errors; db_buff[copy_and_convert(db_buff, sizeof(db_buff)-1, system_charset_info, db, strlen(db), - thd->charset())]= 0; + thd->charset(), &dummy_errors)]= 0; db= db_buff; } if (user) { + uint dummy_errors; user_buff[copy_and_convert(user_buff, sizeof(user_buff)-1, system_charset_info, user, strlen(user), - thd->charset())]= '\0'; + thd->charset(), &dummy_errors)]= '\0'; user= user_buff; } @@ -1380,9 +1382,10 @@ bool dispatch_command(enum enum_server_command command, THD *thd, } #endif /* Convert database name to utf8 */ + uint dummy_errors; db_buff[copy_and_convert(db_buff, sizeof(db_buff)-1, system_charset_info, db, strlen(db), - thd->charset())]= 0; + thd->charset(), &dummy_errors)]= 0; db= db_buff; /* Save user and privileges */ @@ -2066,8 +2069,12 @@ mysql_execute_command(THD *thd) } if (need_conversion) - query_len= copy_and_convert(query_str, query_len, to_cs, pstr->ptr(), - pstr->length(), pstr->charset()); + { + uint dummy_errors; + query_len= copy_and_convert(query_str, query_len, to_cs, + pstr->ptr(), pstr->length(), + pstr->charset(), &dummy_errors); + } else memcpy(query_str, pstr->ptr(), pstr->length()); query_str[query_len]= 0; diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 3bf11c0d6b8..2af4cb3fc23 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -752,8 +752,9 @@ mysqld_show_fields(THD *thd, TABLE_LIST *table_list,const char *wild, String def(tmp1,sizeof(tmp1), system_charset_info); type.set(tmp, sizeof(tmp), field->charset()); field->val_str(&type); + uint dummy_errors; def.copy(type.ptr(), type.length(), type.charset(), - system_charset_info); + system_charset_info, &dummy_errors); protocol->store(def.ptr(), def.length(), def.charset()); } else if (field->unireg_check == Field::NEXT_NUMBER || @@ -1338,9 +1339,10 @@ store_create_info(THD *thd, TABLE *table, String *packet) if (type.length()) { String def_val; + uint dummy_errors; /* convert to system_charset_info == utf8 */ def_val.copy(type.ptr(), type.length(), field->charset(), - system_charset_info); + system_charset_info, &dummy_errors); append_unescaped(packet, def_val.ptr(), def_val.length()); } else diff --git a/sql/sql_string.cc b/sql/sql_string.cc index 30559496fde..6b2bb07fb8c 100644 --- a/sql/sql_string.cc +++ b/sql/sql_string.cc @@ -121,12 +121,13 @@ bool String::set(ulonglong num, CHARSET_INFO *cs) bool String::set(double num,uint decimals, CHARSET_INFO *cs) { char buff[331]; + uint dummy_errors; str_charset=cs; if (decimals >= NOT_FIXED_DEC) { uint32 len= my_sprintf(buff,(buff, "%.14g",num));// Enough for a DATETIME - return copy(buff, len, &my_charset_latin1, cs); + return copy(buff, len, &my_charset_latin1, cs, &dummy_errors); } #ifdef HAVE_FCONVERT int decpt,sign; @@ -191,7 +192,8 @@ end: #else sprintf(buff,"%.*f",(int) decimals,num); #endif - return copy(buff,(uint32) strlen(buff), &my_charset_latin1, cs); + return copy(buff,(uint32) strlen(buff), &my_charset_latin1, cs, + &dummy_errors); #endif } @@ -336,14 +338,12 @@ bool String::copy(const char *str, uint32 arg_length, uint32 offset; if (!needs_conversion(arg_length, from_cs, to_cs, &offset)) { - if (errors) - *errors= 0; + *errors= 0; return copy(str, arg_length, to_cs); } if ((from_cs == &my_charset_bin) && offset) { - if (errors) - *errors= 0; + *errors= 0; return copy_aligned(str, arg_length, offset, to_cs); } uint32 new_length= to_cs->mbmaxlen*arg_length; @@ -382,7 +382,8 @@ bool String::set_ascii(const char *str, uint32 arg_length) set(str, arg_length, str_charset); return 0; } - return copy(str, arg_length, &my_charset_latin1, str_charset); + uint dummy_errors; + return copy(str, arg_length, &my_charset_latin1, str_charset, &dummy_errors); } @@ -436,10 +437,12 @@ bool String::append(const char *s,uint32 arg_length) if (str_charset->mbminlen > 1) { uint32 add_length=arg_length * str_charset->mbmaxlen; + uint dummy_errors; if (realloc(str_length+ add_length)) return TRUE; str_length+= copy_and_convert(Ptr+str_length, add_length, str_charset, - s, arg_length, &my_charset_latin1); + s, arg_length, &my_charset_latin1, + &dummy_errors); return FALSE; } @@ -476,10 +479,11 @@ bool String::append(const char *s,uint32 arg_length, CHARSET_INFO *cs) if (needs_conversion(arg_length, cs, str_charset, &dummy_offset)) { uint32 add_length= arg_length / cs->mbminlen * str_charset->mbmaxlen; + uint dummy_errors; if (realloc(str_length + add_length)) return TRUE; str_length+= copy_and_convert(Ptr+str_length, add_length, str_charset, - s, arg_length, cs); + s, arg_length, cs, &dummy_errors); } else { @@ -816,8 +820,7 @@ outp: else break; } - if (errors) - *errors= error_count; + *errors= error_count; return (uint32) (to - to_start); } diff --git a/sql/sql_string.h b/sql/sql_string.h index de8f4af58d9..a8fb9574c0b 100644 --- a/sql/sql_string.h +++ b/sql/sql_string.h @@ -29,7 +29,7 @@ int sortcmp(const String *a,const String *b, CHARSET_INFO *cs); String *copy_if_not_alloced(String *a,String *b,uint32 arg_length); uint32 copy_and_convert(char *to, uint32 to_length, CHARSET_INFO *to_cs, const char *from, uint32 from_length, - CHARSET_INFO *from_cs, uint *errors= 0); + CHARSET_INFO *from_cs, uint *errors); class String { @@ -199,7 +199,7 @@ public: CHARSET_INFO *cs); bool set_or_copy_aligned(const char *s, uint32 arg_length, CHARSET_INFO *cs); bool copy(const char*s,uint32 arg_length, CHARSET_INFO *csfrom, - CHARSET_INFO *csto, uint *errors= 0); + CHARSET_INFO *csto, uint *errors); bool append(const String &s); bool append(const char *s); bool append(const char *s,uint32 arg_length); diff --git a/sql/thr_malloc.cc b/sql/thr_malloc.cc index fa678ec7de2..0df60858bcb 100644 --- a/sql/thr_malloc.cc +++ b/sql/thr_malloc.cc @@ -108,8 +108,11 @@ char *sql_strmake_with_convert(const char *str, uint32 arg_length, memcpy(pos, str, new_length); } else + { + uint dummy_errors; new_length= copy_and_convert((char*) pos, new_length, to_cs, str, - arg_length, from_cs); + arg_length, from_cs, &dummy_errors); + } pos[new_length]= 0; *result_length= new_length; return pos; From 13ff3fa4b92642779c260c9fcd56ea2e5c96391c Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 29 Oct 2004 14:24:06 +0200 Subject: [PATCH 0048/1063] proper max_records estimation for sort-repair of fulltext indexes mysql-test/t/ctype_utf8.test: bad merge fixed --- myisam/mi_check.c | 2 +- mysql-test/r/fulltext.result | 3 +++ mysql-test/t/ctype_utf8.test | 1 + mysql-test/t/fulltext.test | 9 ++++++++- 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/myisam/mi_check.c b/myisam/mi_check.c index 4da388af1c7..1df518a2712 100644 --- a/myisam/mi_check.c +++ b/myisam/mi_check.c @@ -2037,7 +2037,7 @@ int mi_repair_by_sort(MI_CHECK *param, register MI_INFO *info, uint ft_max_word_len_for_sort=FT_MAX_WORD_LEN_FOR_SORT* sort_param.keyinfo->seg->charset->mbmaxlen; sort_info.max_records= - (ha_rows) (sort_info.filelength/ft_max_word_len_for_sort+1); + (ha_rows) (sort_info.filelength/ft_min_word_len+1); sort_param.key_read=sort_ft_key_read; sort_param.key_write=sort_ft_key_write; diff --git a/mysql-test/r/fulltext.result b/mysql-test/r/fulltext.result index 30c4c75f3d1..65f88932d54 100644 --- a/mysql-test/r/fulltext.result +++ b/mysql-test/r/fulltext.result @@ -330,6 +330,9 @@ t1_id name t2_id t1_id name select * from t2 where match name against ('a* b* c* d* e* f*' in boolean mode); t2_id t1_id name drop table t1,t2; +create table t1 (a text, fulltext key (a)); +insert into t1 select "xxxx yyyy zzzz"; +drop table t1; SET NAMES latin1; CREATE TABLE t1 (t text character set utf8 not null, fulltext(t)); INSERT t1 VALUES ('Mit freundlichem Grüß'), ('aus Osnabrück'); diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test index 0c8bdd6a94d..c75b1dee63c 100644 --- a/mysql-test/t/ctype_utf8.test +++ b/mysql-test/t/ctype_utf8.test @@ -645,6 +645,7 @@ insert into t1 values(1,'foo'),(2,'foobar'); select * from t1 where b like 'foob%'; --disable_warnings alter table t1 engine=bdb; +--enable_warnings select * from t1 where b like 'foob%'; drop table t1; diff --git a/mysql-test/t/fulltext.test b/mysql-test/t/fulltext.test index 66df5b1cb92..5af2575ddc4 100644 --- a/mysql-test/t/fulltext.test +++ b/mysql-test/t/fulltext.test @@ -253,9 +253,16 @@ select * from t1 join t2 using(`t1_id`) where match (t1.name, t2.name) against(' # bug with many short (< ft_min_word_len) words in boolean search # select * from t2 where match name against ('a* b* c* d* e* f*' in boolean mode); - drop table t1,t2; +# +# bug with repair-by-sort and incorrect records estimation +# + +create table t1 (a text, fulltext key (a)); +insert into t1 select "xxxx yyyy zzzz"; +drop table t1; + # # UTF8 # From c24a6280860b89853597a3c95e8c86356c664a18 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 29 Oct 2004 14:51:56 +0200 Subject: [PATCH 0049/1063] These modifications are the result of WL#2067 add features to mysqltest: "disable_error_abort" + "$mysql_errno" $mysql_errno is a new builtin variable of mysqltest and contains the return code of the last command send to the server. "--disable_abort_on_error" switches the abort of mysqltest after "unmasked" failing statements off. "--enable_abort_on_error" switches the abort of mysqltest after "unmasked" failing statements on. (default) "Maskings" are !$ and --error in the line before the statement to be checked. The benefit of the option "--disable_abort_on_error" is that - all statements after the failing statement are executed - a r/.reject will be produced - it is possible to write test cases, which perform code sequences depending on the return code of a single statement client/mysqltest.c: Implementation of the features - "--disable_abort_on_error"/"--enable_abort_on_error" switch - "$mysql_errno" variable mysql-test/r/mysqltest.result: test cases for the features added mysql-test/t/mysqltest.test: updated results --- client/mysqltest.c | 30 ++++- mysql-test/r/mysqltest.result | 128 ++++++++++++++++++++ mysql-test/t/mysqltest.test | 219 ++++++++++++++++++++++++++++++++++ 3 files changed, 376 insertions(+), 1 deletion(-) diff --git a/client/mysqltest.c b/client/mysqltest.c index 4c87561ab84..21f93b1fc6a 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -243,6 +243,8 @@ VAR var_reg[10]; HASH var_hash; my_bool disable_query_log=0, disable_result_log=0, disable_warnings=0; my_bool disable_info= 1; /* By default off */ +/* default for disable_abort_on_error: false = abort on unmasked error */ +my_bool disable_abort_on_error= 0; struct connection cons[MAX_CONS]; struct connection* cur_con, *next_con, *cons_end; @@ -274,6 +276,7 @@ Q_ENABLE_WARNINGS, Q_DISABLE_WARNINGS, Q_ENABLE_INFO, Q_DISABLE_INFO, Q_ENABLE_METADATA, Q_DISABLE_METADATA, Q_EXEC, Q_DELIMITER, +Q_DISABLE_ABORT_ON_ERROR, Q_ENABLE_ABORT_ON_ERROR, Q_DISPLAY_VERTICAL_RESULTS, Q_DISPLAY_HORIZONTAL_RESULTS, Q_QUERY_VERTICAL, Q_QUERY_HORIZONTAL, Q_START_TIMER, Q_END_TIMER, @@ -352,6 +355,8 @@ const char *command_names[]= "disable_metadata", "exec", "delimiter", + "disable_abort_on_error", + "enable_abort_on_error", "vertical_results", "horizontal_results", "query_vertical", @@ -1239,6 +1244,18 @@ int do_let(struct st_query* q) return var_set(var_name, var_name_end, var_val_start, q->end); } +/* Store an integer (typically the returncode of the last SQL) */ +/* statement in the mysqltest builtin variable $mysql_errno, by */ +/* simulating of a user statement "let $mysql_errno= " */ +int var_set_errno(int sql_errno ) +{ + char var_name[] = "$mysql_errno", var_val[30]; + sprintf(var_val, "%d", sql_errno); + /* On some odd systems, the return value from sprintf() isn't */ + /* always the length of the string, so we use strlen() */ + return var_set(var_name, var_name + 12, var_val, var_val + strlen(var_val)); +} + int do_rpl_probe(struct st_query* q __attribute__((unused))) { DBUG_ENTER("do_rpl_probe"); @@ -1996,7 +2013,7 @@ int read_query(struct st_query** q_ptr) 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; + q->abort_on_error= (global_expected_errors == 0 && !disable_abort_on_error); bzero((gptr) global_expected_errno, sizeof(global_expected_errno)); global_expected_errors=0; if (p[0] == '-' && p[1] == '-') @@ -2642,6 +2659,10 @@ end: dynstr_free(&ds_tmp); if (q->type == Q_EVAL) dynstr_free(&eval_query); + /* We save the return code (mysql_errno(mysql)) from the last call sent */ + /* to the server into the mysqltest builtin variable $mysql_errno. This */ + /* variable then can be used from the test case itself. */ + var_set_errno(mysql_errno(mysql)); DBUG_RETURN(error); } @@ -3395,6 +3416,11 @@ int main(int argc, char **argv) init_var_hash(&cur_con->mysql); + /* Initialize $mysql_errno with -1, so we can */ + /* - distinguish it from valid values ( >= 0 ) and */ + /* - detect if there was never a command sent to the server */ + var_set_errno(-1); + while (!read_query(&q)) { int current_line_inc = 1, processed = 0; @@ -3414,6 +3440,8 @@ int main(int argc, char **argv) case Q_DISABLE_RPL_PARSE: do_disable_rpl_parse(q); break; case Q_ENABLE_QUERY_LOG: disable_query_log=0; break; case Q_DISABLE_QUERY_LOG: disable_query_log=1; break; + case Q_ENABLE_ABORT_ON_ERROR: disable_abort_on_error=0; break; + case Q_DISABLE_ABORT_ON_ERROR: disable_abort_on_error=1; break; case Q_ENABLE_RESULT_LOG: disable_result_log=0; break; case Q_DISABLE_RESULT_LOG: disable_result_log=1; break; case Q_ENABLE_WARNINGS: disable_warnings=0; break; diff --git a/mysql-test/r/mysqltest.result b/mysql-test/r/mysqltest.result index 4e30d5bc110..5dc9ede1ca6 100644 --- a/mysql-test/r/mysqltest.result +++ b/mysql-test/r/mysqltest.result @@ -1,3 +1,6 @@ +select -1 as "before_use_test" ; +before_use_test +-1 select otto from (select 1 as otto) as t1; otto 1 @@ -21,3 +24,128 @@ select friedrich from (select 1 as otto) as t1; ERROR 42S22: Unknown column 'friedrich' in 'field list' select friedrich from (select 1 as otto) as t1; ERROR 42S22: Unknown column 'friedrich' in 'field list' +select otto from (select 1 as otto) as t1; +otto +1 +select 0 as "after_successful_stmt_errno" ; +after_successful_stmt_errno +0 +garbage ; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'garbage' at line 1 +select 1064 as "after_wrong_syntax_errno" ; +after_wrong_syntax_errno +1064 +garbage ; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'garbage' at line 1 +select 1064 as "after_let_var_equal_value" ; +after_let_var_equal_value +1064 +garbage ; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'garbage' at line 1 +set @my_var= 'abc' ; +select 0 as "after_set_var_equal_value" ; +after_set_var_equal_value +0 +garbage ; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'garbage' at line 1 +select 1064 as "after_disable_warnings_command" ; +after_disable_warnings_command +1064 +drop table if exists t1 ; +garbage ; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'garbage' at line 1 +drop table if exists t1 ; +select 0 as "after_disable_warnings" ; +after_disable_warnings +0 +garbage ; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'garbage' at line 1 +select 3 from t1 ; +ERROR 42S02: Table 'test.t1' doesn't exist +select 1146 as "after_minus_masked" ; +after_minus_masked +1146 +garbage ; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'garbage' at line 1 +select 3 from t1 ; +ERROR 42S02: Table 'test.t1' doesn't exist +select 1146 as "after_!_masked" ; +after_!_masked +1146 +garbage ; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'garbage' at line 1 +select -1 as "after_let_errno_equal_value" ; +after_let_errno_equal_value +-1 +garbage ; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'garbage' at line 1 +prepare stmt from "select 3 from t1" ; +ERROR 42S02: Table 'test.t1' doesn't exist +select 1146 as "after_failing_prepare" ; +after_failing_prepare +1146 +create table t1 ( f1 char(10)); +garbage ; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'garbage' at line 1 +prepare stmt from "select 3 from t1" ; +select 0 as "after_successful_prepare" ; +after_successful_prepare +0 +garbage ; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'garbage' at line 1 +execute stmt; +3 +select 0 as "after_successful_execute" ; +after_successful_execute +0 +drop table t1; +garbage ; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'garbage' at line 1 +execute stmt; +ERROR 42S02: Table 'test.t1' doesn't exist +select 1146 as "after_failing_execute" ; +after_failing_execute +1146 +garbage ; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'garbage' at line 1 +execute __stmt_; +ERROR HY000: Unknown prepared statement handler (__stmt_) given to EXECUTE +select 1243 as "after_failing_execute" ; +after_failing_execute +1243 +garbage ; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'garbage' at line 1 +deallocate prepare stmt; +select 0 as "after_successful_deallocate" ; +after_successful_deallocate +0 +garbage ; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'garbage' at line 1 +deallocate prepare __stmt_; +ERROR HY000: Unknown prepared statement handler (__stmt_) given to DEALLOCATE PREPARE +select 1243 as "after_failing_deallocate" ; +after_failing_deallocate +1243 +garbage ; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'garbage' at line 1 +select 1064 as "after_--disable_abort_on_error" ; +after_--disable_abort_on_error +1064 +select 3 from t1 ; +ERROR 42S02: Table 'test.t1' doesn't exist +select 3 from t1 ; +ERROR 42S02: Table 'test.t1' doesn't exist +select 3 from t1 ; +ERROR 42S02: Table 'test.t1' doesn't exist +select 1146 as "after_!errno_masked_error" ; +after_!errno_masked_error +1146 +garbage ; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'garbage' at line 1 +select 1064 as "after_--enable_abort_on_error" ; +after_--enable_abort_on_error +1064 +select 3 from t1 ; +ERROR 42S02: Table 'test.t1' doesn't exist +select 3 from t1 ; +ERROR 42S02: Table 'test.t1' doesn't exist diff --git a/mysql-test/t/mysqltest.test b/mysql-test/t/mysqltest.test index c18dfe1e25c..b7007e1a519 100644 --- a/mysql-test/t/mysqltest.test +++ b/mysql-test/t/mysqltest.test @@ -5,6 +5,15 @@ # # ============================================================================ +# ---------------------------------------------------------------------------- +# $mysql_errno contains the return code of the last command +# send to the server. +# ---------------------------------------------------------------------------- +# get $mysql_errno before the first statement +# $mysql_errno should be -1 +eval select $mysql_errno as "before_use_test" ; + + # ---------------------------------------------------------------------------- # Positive case(statement) # ---------------------------------------------------------------------------- @@ -76,3 +85,213 @@ select friedrich from (select 1 as otto) as t1; #--error S00000 #select friedrich from (select 1 as otto) as t1; + +# ---------------------------------------------------------------------------- +# test cases for $mysql_errno +# +# $mysql_errno is a builtin variable of mysqltest and contains the return code +# of the last command send to the server. +# +# The following test cases often initialize $mysql_errno to 1064 by +# a command with wrong syntax. +# Example: !$1064 To prevent the abort after the error. +# garbage ; +# ---------------------------------------------------------------------------- + +# ---------------------------------------------------------------------------- +# 1. check mysql_errno = 0 after successful statement +# ---------------------------------------------------------------------------- +select otto from (select 1 as otto) as t1; +eval select $mysql_errno as "after_successful_stmt_errno" ; + +#---------------------------------------------------------------------------- +# 2. check mysql_errno = 1064 after statement with wrong syntax +# ---------------------------------------------------------------------------- +!$1064 +garbage ; +eval select $mysql_errno as "after_wrong_syntax_errno" ; + +# ---------------------------------------------------------------------------- +# 3. check if let $my_var= 'abc' ; affects $mysql_errno +# ---------------------------------------------------------------------------- +!$1064 +garbage ; +let $my_var= 'abc' ; +eval select $mysql_errno as "after_let_var_equal_value" ; + +# ---------------------------------------------------------------------------- +# 4. check if set @my_var= 'abc' ; affects $mysql_errno +# ---------------------------------------------------------------------------- +!$1064 +garbage ; +set @my_var= 'abc' ; +eval select $mysql_errno as "after_set_var_equal_value" ; + +# ---------------------------------------------------------------------------- +# 5. check if the setting of --disable-warnings itself affects $mysql_errno +# (May be -- modifies $mysql_errno.) +# ---------------------------------------------------------------------------- +!$1064 +garbage ; +--disable_warnings +eval select $mysql_errno as "after_disable_warnings_command" ; + +# ---------------------------------------------------------------------------- +# 6. check if --disable-warnings + command with warning affects the errno +# stored within $mysql_errno +# (May be disabled warnings affect $mysql_errno.) +# ---------------------------------------------------------------------------- +drop table if exists t1 ; +!$1064 +garbage ; +drop table if exists t1 ; +eval select $mysql_errno as "after_disable_warnings" ; +--enable_warnings + +# ---------------------------------------------------------------------------- +# 7. check if masked errors affect $mysql_errno +# ---------------------------------------------------------------------------- +!$1064 +garbage ; +--error 1146 +select 3 from t1 ; +eval select $mysql_errno as "after_minus_masked" ; +!$1064 +garbage ; +!$1146 +select 3 from t1 ; +eval select $mysql_errno as "after_!_masked" ; + +# ---------------------------------------------------------------------------- +# 8. Will manipulations of $mysql_errno be possible and visible ? +# ---------------------------------------------------------------------------- +!$1064 +garbage ; +let $mysql_errno= -1; +eval select $mysql_errno as "after_let_errno_equal_value" ; + +# ---------------------------------------------------------------------------- +# 9. How affect actions on prepared statements $mysql_errno ? +# ---------------------------------------------------------------------------- +# failing prepare +!$1064 +garbage ; +!$1146 +prepare stmt from "select 3 from t1" ; +eval select $mysql_errno as "after_failing_prepare" ; +create table t1 ( f1 char(10)); + +# successful prepare +!$1064 +garbage ; +prepare stmt from "select 3 from t1" ; +eval select $mysql_errno as "after_successful_prepare" ; + +# successful execute +!$1064 +garbage ; +execute stmt; +eval select $mysql_errno as "after_successful_execute" ; + +# failing execute (table dropped) +drop table t1; +!$1064 +garbage ; +!$1146 +execute stmt; +eval select $mysql_errno as "after_failing_execute" ; + +# failing execute (unknown statement) +!$1064 +garbage ; +!$1243 +execute __stmt_; +eval select $mysql_errno as "after_failing_execute" ; + +# successful deallocate +!$1064 +garbage ; +deallocate prepare stmt; +eval select $mysql_errno as "after_successful_deallocate" ; + +# failing deallocate ( statement handle does not exist ) +!$1064 +garbage ; +!$1243 +deallocate prepare __stmt_; +eval select $mysql_errno as "after_failing_deallocate" ; + + +# ---------------------------------------------------------------------------- +# test cases for "--disable_abort_on_error" +# +# "--disable_abort_on_error" switches the abort of mysqltest +# after "unmasked" failing statements off. +# +# The default is "--enable_abort_on_error". +# +# "Maskings" are +# !$ and --error +# in the line before the failing statement. +# +# There are some additional test case for $mysql_errno +# because "--disable_abort_on_error" enables a new situation. +# Example: "unmasked" statement fails + analysis of $mysql_errno +# ---------------------------------------------------------------------------- + +# ---------------------------------------------------------------------------- +# 1. Switch the abort on error off and check the effect on $mysql_errno +# ---------------------------------------------------------------------------- +!$1064 +garbage ; +--disable_abort_on_error +eval select $mysql_errno as "after_--disable_abort_on_error" ; + +# ---------------------------------------------------------------------------- +# 2. "unmasked" failing statement should not cause an abort +# ---------------------------------------------------------------------------- +select 3 from t1 ; + +# ---------------------------------------------------------------------------- +# 3. masked failing statements +# ---------------------------------------------------------------------------- +# expected error = response +--error 1146 +select 3 from t1 ; +!$1146 +select 3 from t1 ; +eval select $mysql_errno as "after_!errno_masked_error" ; +# expected error <> response +# --error 1000 +# select 3 from t1 ; +# !$1000 +# select 3 from t1 ; + +# ---------------------------------------------------------------------------- +# 4. Switch the abort on error on and check the effect on $mysql_errno +# ---------------------------------------------------------------------------- +!$1064 +garbage ; +--enable_abort_on_error +eval select $mysql_errno as "after_--enable_abort_on_error" ; + +# ---------------------------------------------------------------------------- +# 5. masked failing statements +# ---------------------------------------------------------------------------- +# expected error = response +--error 1146 +select 3 from t1 ; +!$1146 +select 3 from t1 ; + +# ---------------------------------------------------------------------------- +# 6. check that the old default behaviour is not changed +# Please remove the '#' to get the abort on error +# ---------------------------------------------------------------------------- +#--error 1064 +#select 3 from t1 ; +# +#!$1064 +#select 3 from t1 ; +# +#select 3 from t1 ; From 90218123848f26942446af7eabff0363467e3d0d Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 29 Oct 2004 13:59:40 +0000 Subject: [PATCH 0050/1063] added define flag SNPRINTF_RETURN_ZERO to indicate that snprintf returns zero if buffer too small use flag SNPRINTF_RETURN_ZERO emulate snprintf behavior by writing to _big_ buffer if set use my_vsnprintf if HAVE_SNPRINTF is not set and set SNPRINTF_RETURN_ZERO in that case configure.in: added define flag to indicate that snprintf returns zero if buffer too small ndb/src/common/util/basestring_vsnprintf.c: use flag SNPRINTF_RETURN_ZERO emulate snprintf behavior by writing to _big_ buffer if set use my_vsnprintf if HAVE_SNPRINTF is not set and set SNPRINTF_RETURN_ZERO in that case --- configure.in | 4 ++-- ndb/src/common/util/basestring_vsnprintf.c | 22 +++++++++++++++++++++- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/configure.in b/configure.in index 392aaba2cda..353e455dbac 100644 --- a/configure.in +++ b/configure.in @@ -1142,8 +1142,8 @@ dnl Is this the right match for DEC OSF on alpha? fi echo "Adding defines for OSF1" # gethostbyname_r is deprecated and doesn't work ok on OSF1 - CFLAGS="$CFLAGS -DUNDEF_HAVE_GETHOSTBYNAME_R" - CXXFLAGS="$CXXFLAGS -DUNDEF_HAVE_GETHOSTBYNAME_R" + CFLAGS="$CFLAGS -DUNDEF_HAVE_GETHOSTBYNAME_R -DSNPRINTF_RETURN_ZERO" + CXXFLAGS="$CXXFLAGS -DUNDEF_HAVE_GETHOSTBYNAME_R -DSNPRINTF_RETURN_ZERO" # fix to handle include of correctly on OSF1 with cxx compiler CXXFLAGS="$CXXFLAGS -I/usr/include/cxx -I/usr/include/cxx_cname -I/usr/include -I/usr/include.dtk" ;; diff --git a/ndb/src/common/util/basestring_vsnprintf.c b/ndb/src/common/util/basestring_vsnprintf.c index 10932226d18..87ffb8ad146 100644 --- a/ndb/src/common/util/basestring_vsnprintf.c +++ b/ndb/src/common/util/basestring_vsnprintf.c @@ -18,6 +18,7 @@ #define _XOPEN_SOURCE 500 #include #include +#include int basestring_snprintf(char *str, size_t size, const char *format, ...) @@ -30,8 +31,27 @@ basestring_snprintf(char *str, size_t size, const char *format, ...) return(ret); } +#ifdef HAVE_SNPRINTF + #define BASESTRING_VSNPRINTF_FUNC(a,b,c,d) vsnprintf(a,b,c,d) +#else + #define SNPRINTF_RETURN_ZERO + #define BASESTRING_VSNPRINTF_FUNC(a,b,c,d) my_vsnprintf(a,b,c,d) + extern int my_vsnprintf(char *str, size_t size, const char *format, va_list ap); +#endif + +#ifdef SNPRINTF_RETURN_ZERO +static char basestring_vsnprintf_buf[16*1024]; +#endif int basestring_vsnprintf(char *str, size_t size, const char *format, va_list ap) { - return(vsnprintf(str, size, format, ap)); + int ret= BASESTRING_VSNPRINTF_FUNC(str, size, format, ap); +#ifdef SNPRINTF_RETURN_ZERO + if (ret == 0 && format != 0 && format[0] != '\0') { + ret= BASESTRING_VSNPRINTF_FUNC(basestring_vsnprintf_buf, + sizeof(basestring_vsnprintf_buf), + format, ap); + } +#endif + return ret; } From d46c7366ebf3e7cd37253f61b927d62fbe180170 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 30 Oct 2004 17:17:52 +0400 Subject: [PATCH 0051/1063] Enable REPLACE ... SELECT in prepared statements. mysql-test/include/ps_modify.inc: replace ... select now works. mysql-test/r/ps_2myisam.result: replace ... select now works. mysql-test/r/ps_3innodb.result: replace ... select now works. mysql-test/r/ps_4heap.result: replace ... select now works. mysql-test/r/ps_5merge.result: replace ... select now works. mysql-test/r/ps_6bdb.result: replace ... select now works. mysql-test/r/ps_7ndb.result: replace ... select now works. mysql-test/t/ps_7ndb.test: replace ... select now works. sql/sql_prepare.cc: Enable SQLCOM_REPLACE_SELECT: no need for any code changes but enable this SQLCOM in the switch. --- mysql-test/include/ps_modify.inc | 5 ++++- mysql-test/r/ps_2myisam.result | 4 +++- mysql-test/r/ps_3innodb.result | 4 +++- mysql-test/r/ps_4heap.result | 4 +++- mysql-test/r/ps_5merge.result | 8 ++++++-- mysql-test/r/ps_6bdb.result | 4 +++- mysql-test/r/ps_7ndb.result | 1 - mysql-test/t/ps_7ndb.test | 2 +- sql/sql_prepare.cc | 1 + 9 files changed, 24 insertions(+), 9 deletions(-) diff --git a/mysql-test/include/ps_modify.inc b/mysql-test/include/ps_modify.inc index 9cf11709e69..eb6820934f3 100644 --- a/mysql-test/include/ps_modify.inc +++ b/mysql-test/include/ps_modify.inc @@ -322,8 +322,11 @@ select a,b from t1 where a >= 1000 order by a ; delete from t1 where a >= 1000 ; ## replace ---error 1295 prepare stmt1 from ' replace into t1 (a,b) select 100, ''hundred'' '; +execute stmt1; +execute stmt1; +execute stmt1; + ## multi table statements diff --git a/mysql-test/r/ps_2myisam.result b/mysql-test/r/ps_2myisam.result index 40b2516f0b9..efb12561950 100644 --- a/mysql-test/r/ps_2myisam.result +++ b/mysql-test/r/ps_2myisam.result @@ -1581,7 +1581,9 @@ a b 1200 x1000_1updatedupdated delete from t1 where a >= 1000 ; prepare stmt1 from ' replace into t1 (a,b) select 100, ''hundred'' '; -ERROR HY000: This command is not supported in the prepared statement protocol yet +execute stmt1; +execute stmt1; +execute stmt1; test_sequence ------ multi table tests ------ delete from t1 ; diff --git a/mysql-test/r/ps_3innodb.result b/mysql-test/r/ps_3innodb.result index 11669b131a7..cb096882d13 100644 --- a/mysql-test/r/ps_3innodb.result +++ b/mysql-test/r/ps_3innodb.result @@ -1564,7 +1564,9 @@ a b 1200 x1000_1updatedupdated delete from t1 where a >= 1000 ; prepare stmt1 from ' replace into t1 (a,b) select 100, ''hundred'' '; -ERROR HY000: This command is not supported in the prepared statement protocol yet +execute stmt1; +execute stmt1; +execute stmt1; test_sequence ------ multi table tests ------ delete from t1 ; diff --git a/mysql-test/r/ps_4heap.result b/mysql-test/r/ps_4heap.result index a3837650e0e..ac9946ef070 100644 --- a/mysql-test/r/ps_4heap.result +++ b/mysql-test/r/ps_4heap.result @@ -1565,7 +1565,9 @@ a b 1200 x1000_1updatedupdated delete from t1 where a >= 1000 ; prepare stmt1 from ' replace into t1 (a,b) select 100, ''hundred'' '; -ERROR HY000: This command is not supported in the prepared statement protocol yet +execute stmt1; +execute stmt1; +execute stmt1; test_sequence ------ multi table tests ------ delete from t1 ; diff --git a/mysql-test/r/ps_5merge.result b/mysql-test/r/ps_5merge.result index 619b59e4e3d..15e707959ca 100644 --- a/mysql-test/r/ps_5merge.result +++ b/mysql-test/r/ps_5merge.result @@ -1607,7 +1607,9 @@ a b 1200 x1000_1updatedupdated delete from t1 where a >= 1000 ; prepare stmt1 from ' replace into t1 (a,b) select 100, ''hundred'' '; -ERROR HY000: This command is not supported in the prepared statement protocol yet +execute stmt1; +execute stmt1; +execute stmt1; test_sequence ------ multi table tests ------ delete from t1 ; @@ -4615,7 +4617,9 @@ a b 1200 x1000_1updatedupdated delete from t1 where a >= 1000 ; prepare stmt1 from ' replace into t1 (a,b) select 100, ''hundred'' '; -ERROR HY000: This command is not supported in the prepared statement protocol yet +execute stmt1; +execute stmt1; +execute stmt1; test_sequence ------ multi table tests ------ delete from t1 ; diff --git a/mysql-test/r/ps_6bdb.result b/mysql-test/r/ps_6bdb.result index 5c23a574f51..3dd9c200510 100644 --- a/mysql-test/r/ps_6bdb.result +++ b/mysql-test/r/ps_6bdb.result @@ -1564,7 +1564,9 @@ a b 1200 x1000_1updatedupdated delete from t1 where a >= 1000 ; prepare stmt1 from ' replace into t1 (a,b) select 100, ''hundred'' '; -ERROR HY000: This command is not supported in the prepared statement protocol yet +execute stmt1; +execute stmt1; +execute stmt1; test_sequence ------ multi table tests ------ delete from t1 ; diff --git a/mysql-test/r/ps_7ndb.result b/mysql-test/r/ps_7ndb.result index cf567750b85..85e51df776f 100644 --- a/mysql-test/r/ps_7ndb.result +++ b/mysql-test/r/ps_7ndb.result @@ -1543,7 +1543,6 @@ a b 1000 x1000_1 delete from t1 where a >= 1000 ; prepare stmt1 from ' replace into t1 (a,b) select 100, ''hundred'' '; -ERROR HY000: This command is not supported in the prepared statement protocol yet test_sequence ------ multi table tests ------ delete from t1 ; diff --git a/mysql-test/t/ps_7ndb.test b/mysql-test/t/ps_7ndb.test index af669a26400..22370a7f3ac 100644 --- a/mysql-test/t/ps_7ndb.test +++ b/mysql-test/t/ps_7ndb.test @@ -339,8 +339,8 @@ select a,b from t1 where a >= 1000 order by a ; delete from t1 where a >= 1000 ; ## replace ---error 1295 prepare stmt1 from ' replace into t1 (a,b) select 100, ''hundred'' '; +--error 1031 ## multi table statements --disable_query_log diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index bccf517466d..b5e12c4d208 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -1442,6 +1442,7 @@ static int send_prepare_results(Prepared_statement *stmt, bool text_protocol) break; case SQLCOM_INSERT_SELECT: + case SQLCOM_REPLACE_SELECT: res= mysql_test_insert_select(stmt, tables); break; From 61ac832464a48afcf85f8c302734aa01d4346c78 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 31 Oct 2004 15:43:29 +0200 Subject: [PATCH 0052/1063] row0mysql.c, pars0pars.c, eval0eval.c, dict0load.c, dict0dict.c, dict0crea.c: Fix bug #3478: InnoDB's FOREIGN KEY tables treated table and database names as case-insensitive; RENAME TABLE t to T would hang in an endless loop if t had a foreign key constraint defined on it dict0dict.c: Fix bug #3478: InnoDB's FOREIGN KEY tables treated table and database names as case-insensitive; RENAME TABLE t to T would hang in an endless loop if t had a foreign key constraint defined on it; fix also a hang that would occur if one tried in ALTER TABLE or RENAME TABLE to create a foreign key constraint name that collided with another existing name innobase/dict/dict0crea.c: Fix bug #3478: InnoDB's FOREIGN KEY tables treated table and database names as case-insensitive; RENAME TABLE t to T would hang in an endless loop if t had a foreign key constraint defined on it innobase/dict/dict0load.c: Fix bug #3478: InnoDB's FOREIGN KEY tables treated table and database names as case-insensitive; RENAME TABLE t to T would hang in an endless loop if t had a foreign key constraint defined on it innobase/dict/dict0dict.c: Fix bug #3478: InnoDB's FOREIGN KEY tables treated table and database names as case-insensitive; RENAME TABLE t to T would hang in an endless loop if t had a foreign key constraint defined on it; fix also a hang that would occur if one tried in ALTER TABLE or RENAME TABLE to create a foreign key constraint name that collided with another existing name innobase/eval/eval0eval.c: Fix bug #3478: InnoDB's FOREIGN KEY tables treated table and database names as case-insensitive; RENAME TABLE t to T would hang in an endless loop if t had a foreign key constraint defined on it innobase/pars/pars0pars.c: Fix bug #3478: InnoDB's FOREIGN KEY tables treated table and database names as case-insensitive; RENAME TABLE t to T would hang in an endless loop if t had a foreign key constraint defined on it innobase/row/row0mysql.c: Fix bug #3478: InnoDB's FOREIGN KEY tables treated table and database names as case-insensitive; RENAME TABLE t to T would hang in an endless loop if t had a foreign key constraint defined on it --- innobase/dict/dict0crea.c | 16 +++++++++++++++- innobase/dict/dict0dict.c | 4 ++-- innobase/dict/dict0load.c | 21 ++++++++++++++++++--- innobase/eval/eval0eval.c | 18 +++++++++++++++++- innobase/pars/pars0pars.c | 8 ++++++-- innobase/row/row0mysql.c | 15 +++++++++++---- 6 files changed, 69 insertions(+), 13 deletions(-) diff --git a/innobase/dict/dict0crea.c b/innobase/dict/dict0crea.c index 31a601e68b0..e8261ab1e91 100644 --- a/innobase/dict/dict0crea.c +++ b/innobase/dict/dict0crea.c @@ -1011,6 +1011,12 @@ dict_create_or_check_foreign_constraint_tables(void) there are 2 secondary indexes on SYS_FOREIGN, and they are defined just like below */ + /* NOTE: when designing InnoDB's foreign key support in 2001, we made + an error and made the table names and the foreign key id of type + 'CHAR' (internally, really a VARCHAR). We should have made the type + VARBINARY, like in other InnoDB system tables, to get a clean + design. */ + str = (char *) "PROCEDURE CREATE_FOREIGN_SYS_TABLES_PROC () IS\n" "BEGIN\n" @@ -1227,9 +1233,17 @@ loop: fputs(".\nA foreign key constraint of name ", ef); ut_print_name(ef, foreign->id); fputs("\nalready exists." - " (Note that internally InnoDB adds 'databasename/'\n" + " (Note that internally InnoDB adds 'databasename/'\n" "in front of the user-defined constraint name).\n", ef); + fputs("Note that InnoDB's FOREIGN KEY system tables store\n" + "constraint names as case-insensitive, with the\n" + "MySQL standard latin1_swedish_ci collation. If you\n" + "create tables or databases whose names differ only in\n" + "the character case, then collisions in constraint\n" + "names can occur. Workaround: name your constraints\n" + "explicitly with unique names.\n", + ef); mutex_exit(&dict_foreign_err_mutex); diff --git a/innobase/dict/dict0dict.c b/innobase/dict/dict0dict.c index 4340934ab3d..5ca31ecd422 100644 --- a/innobase/dict/dict0dict.c +++ b/innobase/dict/dict0dict.c @@ -132,7 +132,7 @@ dict_index_build_internal_non_clust( dict_index_t* index); /* in: user representation of a non-clustered index */ /************************************************************************** -Removes a foreign constraint struct from the dictionet cache. */ +Removes a foreign constraint struct from the dictionary cache. */ static void dict_foreign_remove_from_cache( @@ -581,7 +581,7 @@ dict_table_get_on_id( dict_table_t* table; if (ut_dulint_cmp(table_id, DICT_FIELDS_ID) <= 0 - || trx->dict_operation) { + || trx->dict_operation_lock_mode == RW_X_LATCH) { /* It is a system table which will always exist in the table cache: we avoid acquiring the dictionary mutex, because if we are doing a rollback to handle an error in TABLE diff --git a/innobase/dict/dict0load.c b/innobase/dict/dict0load.c index 6a4d4c86824..a4637e09d07 100644 --- a/innobase/dict/dict0load.c +++ b/innobase/dict/dict0load.c @@ -19,6 +19,7 @@ Created 4/24/1996 Heikki Tuuri #include "mach0data.h" #include "dict0dict.h" #include "dict0boot.h" +#include "rem0cmp.h" /************************************************************************ Finds the first table name in the given database. */ @@ -1121,12 +1122,26 @@ loop: rec = btr_pcur_get_rec(&pcur); field = rec_get_nth_field(rec, 0, &len); - /* Check if the table name in record is the one searched for */ - if (len != ut_strlen(table_name) - || 0 != ut_memcmp(field, table_name, len)) { + /* Check if the table name in the record is the one searched for; the + following call does the comparison in the latin1_swedish_ci + charset-collation, in a case-insensitive way. */ + if (0 != cmp_data_data(dfield_get_type(dfield), + dfield_get_data(dfield), dfield_get_len(dfield), + field, len)) { + goto load_next_index; } + + /* Since table names in SYS_FOREIGN are stored in a case-insensitive + order, we have to check that the table name matches also in a binary + string comparison. On Unix, MySQL allows table names that only differ + in character case. */ + + if (0 != ut_memcmp(field, table_name, len)) { + + goto next_rec; + } if (rec_get_deleted_flag(rec)) { diff --git a/innobase/eval/eval0eval.c b/innobase/eval/eval0eval.c index ebb6cb1b7d9..5b2d1f857b1 100644 --- a/innobase/eval/eval0eval.c +++ b/innobase/eval/eval0eval.c @@ -627,7 +627,11 @@ eval_concat( } /********************************************************************* -Evaluates a predefined function node. */ +Evaluates a predefined function node. If the first argument is an integer, +this function looks at the second argument which is the integer length in +bytes, and converts the integer to a VARCHAR. +If the first argument is of some other type, this function converts it to +BINARY. */ UNIV_INLINE void eval_to_binary( @@ -638,12 +642,24 @@ eval_to_binary( que_node_t* arg2; dfield_t* dfield; byte* str1; + ulint len; ulint len1; arg1 = func_node->args; str1 = dfield_get_data(que_node_get_val(arg1)); + if (dtype_get_mtype(que_node_get_data_type(arg1)) != DATA_INT) { + + len = dfield_get_len(que_node_get_val(arg1)); + + dfield = que_node_get_val(func_node); + + dfield_set_data(dfield, str1, len); + + return; + } + arg2 = que_node_get_next(arg1); len1 = (ulint)eval_node_get_int_val(arg2); diff --git a/innobase/pars/pars0pars.c b/innobase/pars/pars0pars.c index a4124672df0..5be0e52d0c8 100644 --- a/innobase/pars/pars0pars.c +++ b/innobase/pars/pars0pars.c @@ -259,9 +259,13 @@ pars_resolve_func_data_type( dtype_set(que_node_get_data_type(node), DATA_VARCHAR, DATA_ENGLISH, 0, 0); } else if (func == PARS_TO_BINARY_TOKEN) { - ut_a(dtype_get_mtype(que_node_get_data_type(arg)) == DATA_INT); - dtype_set(que_node_get_data_type(node), DATA_VARCHAR, + if (dtype_get_mtype(que_node_get_data_type(arg)) == DATA_INT) { + dtype_set(que_node_get_data_type(node), DATA_VARCHAR, DATA_ENGLISH, 0, 0); + } else { + dtype_set(que_node_get_data_type(node), DATA_BINARY, + 0, 0, 0); + } } else if (func == PARS_TO_NUMBER_TOKEN) { ut_a(dtype_get_mtype(que_node_get_data_type(arg)) == DATA_VARCHAR); diff --git a/innobase/row/row0mysql.c b/innobase/row/row0mysql.c index 78b2aa8e28f..2e8f7121d2c 100644 --- a/innobase/row/row0mysql.c +++ b/innobase/row/row0mysql.c @@ -1981,7 +1981,8 @@ row_drop_table_for_mysql( "WHILE found = 1 LOOP\n" " SELECT ID INTO foreign_id\n" " FROM SYS_FOREIGN\n" - " WHERE FOR_NAME = table_name;\n" + " WHERE FOR_NAME = table_name\n" + " AND TO_BINARY(FOR_NAME) = TO_BINARY(table_name);\n" " IF (SQL % NOTFOUND) THEN\n" " found := 0;\n" " ELSE" @@ -2381,7 +2382,8 @@ row_rename_table_for_mysql( "WHILE found = 1 LOOP\n" " SELECT ID INTO foreign_id\n" " FROM SYS_FOREIGN\n" - " WHERE FOR_NAME = old_table_name;\n" + " WHERE FOR_NAME = old_table_name\n" + " AND TO_BINARY(FOR_NAME) = TO_BINARY(old_table_name);\n" " IF (SQL % NOTFOUND) THEN\n" " found := 0;\n" " ELSE\n" @@ -2414,7 +2416,8 @@ row_rename_table_for_mysql( " END IF;\n" "END LOOP;\n" "UPDATE SYS_FOREIGN SET REF_NAME = new_table_name\n" - "WHERE REF_NAME = old_table_name;\n"; + "WHERE REF_NAME = old_table_name\n" + " AND TO_BINARY(REF_NAME) = TO_BINARY(old_table_name);\n"; static const char str5[] = "END;\n"; @@ -2602,7 +2605,11 @@ row_rename_table_for_mysql( if (err == DB_DUPLICATE_KEY) { ut_print_timestamp(stderr); - fputs(" InnoDB: Error: table ", stderr); + fputs( + " InnoDB: Error; possible reasons:\n" + "InnoDB: 1) Table rename would cause two FOREIGN KEY constraints\n" + "InnoDB: to have the same internal name in case-insensitive comparison.\n" + "InnoDB: 2) table ", stderr); ut_print_name(stderr, new_name); fputs(" exists in the InnoDB internal data\n" "InnoDB: dictionary though MySQL is trying rename table ", stderr); From e4f0614cf40ae894290b2a792d22ed6b0992c6c5 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 31 Oct 2004 15:33:56 +0100 Subject: [PATCH 0053/1063] NDB bug-6018 support writeTuple with blobs mysql-test/r/ndb_blob.result: bug-6018 mysql-test/t/ndb_blob.test: bug-6018 ndb/include/ndbapi/NdbBlob.hpp: bug-6018 ndb/include/ndbapi/NdbConnection.hpp: bug-6018 ndb/include/ndbapi/NdbIndexOperation.hpp: bug-6018 ndb/include/ndbapi/NdbOperation.hpp: bug-6018 ndb/src/ndbapi/NdbBlob.cpp: bug-6018 ndb/src/ndbapi/NdbConnection.cpp: bug-6018 ndb/src/ndbapi/NdbDictionaryImpl.cpp: bug-6018 ndb/src/ndbapi/NdbIndexOperation.cpp: bug-6018 ndb/src/ndbapi/NdbOperation.cpp: bug-6018 ndb/src/ndbapi/NdbOperationExec.cpp: bug-6018 ndb/test/ndbapi/testBlobs.cpp: bug-6018 --- mysql-test/r/ndb_blob.result | 269 ++++++++++------- mysql-test/t/ndb_blob.test | 180 ++++++++---- ndb/include/ndbapi/NdbBlob.hpp | 47 ++- ndb/include/ndbapi/NdbConnection.hpp | 4 +- ndb/include/ndbapi/NdbIndexOperation.hpp | 4 + ndb/include/ndbapi/NdbOperation.hpp | 9 +- ndb/src/ndbapi/NdbBlob.cpp | 359 ++++++++++++++++------- ndb/src/ndbapi/NdbConnection.cpp | 15 +- ndb/src/ndbapi/NdbDictionaryImpl.cpp | 9 +- ndb/src/ndbapi/NdbIndexOperation.cpp | 26 +- ndb/src/ndbapi/NdbOperation.cpp | 4 +- ndb/src/ndbapi/NdbOperationExec.cpp | 14 +- ndb/test/ndbapi/testBlobs.cpp | 201 +++++++++---- 13 files changed, 754 insertions(+), 387 deletions(-) diff --git a/mysql-test/r/ndb_blob.result b/mysql-test/r/ndb_blob.result index cf64ec41ae3..1f2cf33f57d 100644 --- a/mysql-test/r/ndb_blob.result +++ b/mysql-test/r/ndb_blob.result @@ -1,25 +1,5 @@ drop table if exists t1; -drop database if exists mysqltest; -create table t1 ( -a int not null primary key, -b tinytext -) engine=ndbcluster; -insert into t1 values(1, 'x'); -update t1 set b = 'y'; -select * from t1; -a b -1 y -delete from t1; -drop table t1; -create table t1 ( -a int not null primary key, -b text not null -) engine=ndbcluster; -insert into t1 values(1, ''); -select * from t1; -a b -1 -drop table t1; +drop database if exists test2; set autocommit=0; create table t1 ( a int not null primary key, @@ -102,6 +82,53 @@ commit; select count(*) from t1; count(*) 0 +replace t1 set a=1,b=@b1,c=111,d=@d1; +replace t1 set a=2,b=@b2,c=222,d=@d2; +commit; +explain select * from t1 where a = 1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1 +select a,length(b),substr(b,1+2*900,2),length(d),substr(d,1+3*900,3) +from t1 where a=1; +a length(b) substr(b,1+2*900,2) length(d) substr(d,1+3*900,3) +1 2256 b1 3000 dd1 +select a,length(b),substr(b,1+2*9000,2),length(d),substr(d,1+3*9000,3) +from t1 where a=2; +a length(b) substr(b,1+2*9000,2) length(d) substr(d,1+3*9000,3) +2 20000 b2 30000 dd2 +replace t1 set a=1,b=@b2,c=111,d=@d2; +replace t1 set a=2,b=@b1,c=222,d=@d1; +commit; +select a,length(b),substr(b,1+2*9000,2),length(d),substr(d,1+3*9000,3) +from t1 where a=1; +a length(b) substr(b,1+2*9000,2) length(d) substr(d,1+3*9000,3) +1 20000 b2 30000 dd2 +select a,length(b),substr(b,1+2*900,2),length(d),substr(d,1+3*900,3) +from t1 where a=2; +a length(b) substr(b,1+2*900,2) length(d) substr(d,1+3*900,3) +2 2256 b1 3000 dd1 +replace t1 set a=1,b=concat(@b2,@b2),c=111,d=concat(@d2,@d2); +replace t1 set a=2,b=concat(@b1,@b1),c=222,d=concat(@d1,@d1); +commit; +select a,length(b),substr(b,1+4*9000,2),length(d),substr(d,1+6*9000,3) +from t1 where a=1; +a length(b) substr(b,1+4*9000,2) length(d) substr(d,1+6*9000,3) +1 40000 b2 60000 dd2 +select a,length(b),substr(b,1+4*900,2),length(d),substr(d,1+6*900,3) +from t1 where a=2; +a length(b) substr(b,1+4*900,2) length(d) substr(d,1+6*900,3) +2 4512 b1 6000 dd1 +replace t1 set a=1,b='xyz',c=111,d=null; +commit; +select a,b from t1 where d is null; +a b +1 xyz +delete from t1 where a=1; +delete from t1 where a=2; +commit; +select count(*) from t1; +count(*) +0 insert into t1 values(1,@b1,111,@d1); insert into t1 values(2,@b2,222,@d2); commit; @@ -241,90 +268,6 @@ a b c d 7 7xb7 777 7xdd7 8 8xb8 888 8xdd8 9 9xb9 999 9xdd9 -select * from t1 order by a; -a b c d -1 1xb1 111 1xdd1 -2 2xb2 222 2xdd2 -3 3xb3 333 3xdd3 -4 4xb4 444 4xdd4 -5 5xb5 555 5xdd5 -6 6xb6 666 6xdd6 -7 7xb7 777 7xdd7 -8 8xb8 888 8xdd8 -9 9xb9 999 9xdd9 -alter table t1 add x int; -select * from t1 order by a; -a b c d x -1 1xb1 111 1xdd1 NULL -2 2xb2 222 2xdd2 NULL -3 3xb3 333 3xdd3 NULL -4 4xb4 444 4xdd4 NULL -5 5xb5 555 5xdd5 NULL -6 6xb6 666 6xdd6 NULL -7 7xb7 777 7xdd7 NULL -8 8xb8 888 8xdd8 NULL -9 9xb9 999 9xdd9 NULL -alter table t1 drop x; -select * from t1 order by a; -a b c d -1 1xb1 111 1xdd1 -2 2xb2 222 2xdd2 -3 3xb3 333 3xdd3 -4 4xb4 444 4xdd4 -5 5xb5 555 5xdd5 -6 6xb6 666 6xdd6 -7 7xb7 777 7xdd7 -8 8xb8 888 8xdd8 -9 9xb9 999 9xdd9 -create database mysqltest; -use mysqltest; -CREATE TABLE t2 ( -a bigint unsigned NOT NULL PRIMARY KEY, -b int unsigned not null, -c int unsigned -) engine=ndbcluster; -insert into t2 values (1,1,1),(2,2,2); -select * from test.t1,t2 where test.t1.a = t2.a order by test.t1.a; -a b c d a b c -1 1xb1 111 1xdd1 1 1 1 -2 2xb2 222 2xdd2 2 2 2 -drop table t2; -use test; -select * from t1 order by a; -a b c d -1 1xb1 111 1xdd1 -2 2xb2 222 2xdd2 -3 3xb3 333 3xdd3 -4 4xb4 444 4xdd4 -5 5xb5 555 5xdd5 -6 6xb6 666 6xdd6 -7 7xb7 777 7xdd7 -8 8xb8 888 8xdd8 -9 9xb9 999 9xdd9 -alter table t1 add x int; -select * from t1 order by a; -a b c d x -1 1xb1 111 1xdd1 NULL -2 2xb2 222 2xdd2 NULL -3 3xb3 333 3xdd3 NULL -4 4xb4 444 4xdd4 NULL -5 5xb5 555 5xdd5 NULL -6 6xb6 666 6xdd6 NULL -7 7xb7 777 7xdd7 NULL -8 8xb8 888 8xdd8 NULL -9 9xb9 999 9xdd9 NULL -alter table t1 drop x; -select * from t1 order by a; -a b c d -1 1xb1 111 1xdd1 -2 2xb2 222 2xdd2 -3 3xb3 333 3xdd3 -4 4xb4 444 4xdd4 -5 5xb5 555 5xdd5 -6 6xb6 666 6xdd6 -7 7xb7 777 7xdd7 -8 8xb8 888 8xdd8 -9 9xb9 999 9xdd9 delete from t1 where c >= 100; commit; select count(*) from t1; @@ -375,8 +318,122 @@ rollback; select count(*) from t1; count(*) 0 +insert into t1 values(1,'b1',111,'dd1'); +insert into t1 values(2,'b2',222,'dd2'); +insert into t1 values(3,'b3',333,'dd3'); +insert into t1 values(4,'b4',444,'dd4'); +insert into t1 values(5,'b5',555,'dd5'); +insert into t1 values(6,'b6',666,'dd6'); +insert into t1 values(7,'b7',777,'dd7'); +insert into t1 values(8,'b8',888,'dd8'); +insert into t1 values(9,'b9',999,'dd9'); +commit; +select * from t1 order by a; +a b c d +1 b1 111 dd1 +2 b2 222 dd2 +3 b3 333 dd3 +4 b4 444 dd4 +5 b5 555 dd5 +6 b6 666 dd6 +7 b7 777 dd7 +8 b8 888 dd8 +9 b9 999 dd9 +alter table t1 add x int; +select * from t1 order by a; +a b c d x +1 b1 111 dd1 NULL +2 b2 222 dd2 NULL +3 b3 333 dd3 NULL +4 b4 444 dd4 NULL +5 b5 555 dd5 NULL +6 b6 666 dd6 NULL +7 b7 777 dd7 NULL +8 b8 888 dd8 NULL +9 b9 999 dd9 NULL +alter table t1 drop x; +select * from t1 order by a; +a b c d +1 b1 111 dd1 +2 b2 222 dd2 +3 b3 333 dd3 +4 b4 444 dd4 +5 b5 555 dd5 +6 b6 666 dd6 +7 b7 777 dd7 +8 b8 888 dd8 +9 b9 999 dd9 +create database test2; +use test2; +CREATE TABLE t2 ( +a bigint unsigned NOT NULL PRIMARY KEY, +b int unsigned not null, +c int unsigned +) engine=ndbcluster; +insert into t2 values (1,1,1),(2,2,2); +select * from test.t1,t2 where test.t1.a = t2.a order by test.t1.a; +a b c d a b c +1 b1 111 dd1 1 1 1 +2 b2 222 dd2 2 2 2 +drop table t2; +use test; +select * from t1 order by a; +a b c d +1 b1 111 dd1 +2 b2 222 dd2 +3 b3 333 dd3 +4 b4 444 dd4 +5 b5 555 dd5 +6 b6 666 dd6 +7 b7 777 dd7 +8 b8 888 dd8 +9 b9 999 dd9 +alter table t1 add x int; +select * from t1 order by a; +a b c d x +1 b1 111 dd1 NULL +2 b2 222 dd2 NULL +3 b3 333 dd3 NULL +4 b4 444 dd4 NULL +5 b5 555 dd5 NULL +6 b6 666 dd6 NULL +7 b7 777 dd7 NULL +8 b8 888 dd8 NULL +9 b9 999 dd9 NULL +alter table t1 drop x; +select * from t1 order by a; +a b c d +1 b1 111 dd1 +2 b2 222 dd2 +3 b3 333 dd3 +4 b4 444 dd4 +5 b5 555 dd5 +6 b6 666 dd6 +7 b7 777 dd7 +8 b8 888 dd8 +9 b9 999 dd9 +drop table t1; +drop database test2; +create table t1 ( +a int not null primary key, +b tinytext +) engine=ndbcluster; +insert into t1 values(1, 'x'); +update t1 set b = 'y'; +select * from t1; +a b +1 x +delete from t1; +drop table t1; +create table t1 ( +a int not null primary key, +b text not null +) engine=ndbcluster; +insert into t1 values(1, ''); +select * from t1; +a b +1 drop table t1; -drop database mysqltest; set autocommit=1; use test; CREATE TABLE t1 ( diff --git a/mysql-test/t/ndb_blob.test b/mysql-test/t/ndb_blob.test index 5454dd91d26..ba5f089b17b 100644 --- a/mysql-test/t/ndb_blob.test +++ b/mysql-test/t/ndb_blob.test @@ -2,7 +2,7 @@ --disable_warnings drop table if exists t1; -drop database if exists mysqltest; +drop database if exists test2; --enable_warnings # @@ -12,31 +12,7 @@ drop database if exists mysqltest; # A prerequisite for this handler test is that "testBlobs" succeeds. # -# -- bug-5252 tinytext crashes -- - -create table t1 ( - a int not null primary key, - b tinytext -) engine=ndbcluster; - -insert into t1 values(1, 'x'); -update t1 set b = 'y'; -select * from t1; -delete from t1; -drop table t1; - -# -- bug-5013 insert empty string to text -- - -create table t1 ( - a int not null primary key, - b text not null -) engine=ndbcluster; - -insert into t1 values(1, ''); -select * from t1; -drop table t1; - --- general test starts -- +# -- general test starts -- # make test harder with autocommit off set autocommit=0; @@ -117,7 +93,6 @@ from t1 where a=2; # pk update to null update t1 set d=null where a=1; commit; -# FIXME now fails at random due to weird mixup between the 2 rows select a from t1 where d is null; # pk delete @@ -126,6 +101,49 @@ delete from t1 where a=2; commit; select count(*) from t1; +# -- replace ( bug-6018 ) -- + +# insert +replace t1 set a=1,b=@b1,c=111,d=@d1; +replace t1 set a=2,b=@b2,c=222,d=@d2; +commit; +explain select * from t1 where a = 1; + +# pk read +select a,length(b),substr(b,1+2*900,2),length(d),substr(d,1+3*900,3) +from t1 where a=1; +select a,length(b),substr(b,1+2*9000,2),length(d),substr(d,1+3*9000,3) +from t1 where a=2; + +# update +replace t1 set a=1,b=@b2,c=111,d=@d2; +replace t1 set a=2,b=@b1,c=222,d=@d1; +commit; +select a,length(b),substr(b,1+2*9000,2),length(d),substr(d,1+3*9000,3) +from t1 where a=1; +select a,length(b),substr(b,1+2*900,2),length(d),substr(d,1+3*900,3) +from t1 where a=2; + +# update +replace t1 set a=1,b=concat(@b2,@b2),c=111,d=concat(@d2,@d2); +replace t1 set a=2,b=concat(@b1,@b1),c=222,d=concat(@d1,@d1); +commit; +select a,length(b),substr(b,1+4*9000,2),length(d),substr(d,1+6*9000,3) +from t1 where a=1; +select a,length(b),substr(b,1+4*900,2),length(d),substr(d,1+6*900,3) +from t1 where a=2; + +# update to null +replace t1 set a=1,b='xyz',c=111,d=null; +commit; +select a,b from t1 where d is null; + +# pk delete +delete from t1 where a=1; +delete from t1 where a=2; +commit; +select count(*) from t1; + # -- hash index ops -- insert into t1 values(1,@b1,111,@d1); @@ -231,39 +249,6 @@ where c >= 100; commit; select * from t1 where c >= 100 order by a; -# alter table - -select * from t1 order by a; -alter table t1 add x int; -select * from t1 order by a; -alter table t1 drop x; -select * from t1 order by a; - -# multi db - -create database mysqltest; -use mysqltest; - -CREATE TABLE t2 ( - a bigint unsigned NOT NULL PRIMARY KEY, - b int unsigned not null, - c int unsigned -) engine=ndbcluster; - -insert into t2 values (1,1,1),(2,2,2); -select * from test.t1,t2 where test.t1.a = t2.a order by test.t1.a; - -drop table t2; -use test; - -# alter table - -select * from t1 order by a; -alter table t1 add x int; -select * from t1 order by a; -alter table t1 drop x; -select * from t1 order by a; - # range scan delete delete from t1 where c >= 100; commit; @@ -306,10 +291,77 @@ select a,length(b),substr(b,1+2*900,2),length(d),substr(d,1+3*900,3) from t1 order by a; rollback; select count(*) from t1; -drop table t1; -drop database mysqltest; -# bug #5349 +# -- alter table and multi db -- + +insert into t1 values(1,'b1',111,'dd1'); +insert into t1 values(2,'b2',222,'dd2'); +insert into t1 values(3,'b3',333,'dd3'); +insert into t1 values(4,'b4',444,'dd4'); +insert into t1 values(5,'b5',555,'dd5'); +insert into t1 values(6,'b6',666,'dd6'); +insert into t1 values(7,'b7',777,'dd7'); +insert into t1 values(8,'b8',888,'dd8'); +insert into t1 values(9,'b9',999,'dd9'); +commit; + +select * from t1 order by a; +alter table t1 add x int; +select * from t1 order by a; +alter table t1 drop x; +select * from t1 order by a; + +create database test2; +use test2; + +CREATE TABLE t2 ( + a bigint unsigned NOT NULL PRIMARY KEY, + b int unsigned not null, + c int unsigned +) engine=ndbcluster; + +insert into t2 values (1,1,1),(2,2,2); +select * from test.t1,t2 where test.t1.a = t2.a order by test.t1.a; + +drop table t2; +use test; + +select * from t1 order by a; +alter table t1 add x int; +select * from t1 order by a; +alter table t1 drop x; +select * from t1 order by a; + +# -- end general test -- + +drop table t1; +drop database test2; + +# -- bug-5252 tinytext crashes -- + +create table t1 ( + a int not null primary key, + b tinytext +) engine=ndbcluster; + +insert into t1 values(1, 'x'); +update t1 set b = 'y'; +select * from t1; +delete from t1; +drop table t1; + +# -- bug-5013 insert empty string to text -- + +create table t1 ( + a int not null primary key, + b text not null +) engine=ndbcluster; + +insert into t1 values(1, ''); +select * from t1; +drop table t1; + +# -- bug #5349 -- set autocommit=1; use test; CREATE TABLE t1 ( @@ -327,7 +379,7 @@ select * from t1 order by a; alter table t1 engine=ndb; select * from t1 order by a; -# bug #5872 +# -- bug #5872 -- alter table t1 engine=myisam; select * from t1 order by a; drop table t1; diff --git a/ndb/include/ndbapi/NdbBlob.hpp b/ndb/include/ndbapi/NdbBlob.hpp index 22e393b6c5d..b3c28c9e950 100644 --- a/ndb/include/ndbapi/NdbBlob.hpp +++ b/ndb/include/ndbapi/NdbBlob.hpp @@ -36,7 +36,7 @@ class NdbColumnImpl; * Blob data is stored in 2 places: * * - "header" and "inline bytes" stored in the blob attribute - * - "blob parts" stored in a separate table NDB$BLOB___ + * - "blob parts" stored in a separate table NDB$BLOB__ * * Inline and part sizes can be set via NdbDictionary::Column methods * when the table is created. @@ -74,23 +74,21 @@ class NdbColumnImpl; * NdbBlob methods return -1 on error and 0 on success, and use output * parameters when necessary. * - * Notes: - * - table and its blob part tables are not created atomically - * - scan must use the "new" interface NdbScanOperation - * - to update a blob in a read op requires exclusive tuple lock - * - update op in scan must do its own getBlobHandle - * - delete creates implicit, not-accessible blob handles - * - NdbOperation::writeTuple does not support blobs - * - there is no support for an asynchronous interface + * Operation types: + * - insertTuple must use setValue if blob column is non-nullable + * - readTuple with exclusive lock can also update existing value + * - updateTuple can overwrite with setValue or update existing value + * - writeTuple always overwrites and must use setValue if non-nullable + * - deleteTuple creates implicit non-accessible blob handles + * - scan with exclusive lock can also update existing value + * - scan "lock takeover" update op must do its own getBlobHandle * * Bugs / limitations: - * - scan must use exclusive locking for now - * - * Todo: - * - add scan method hold-read-lock + return-keyinfo - * - check keyinfo length when setting keys - * - check allowed blob ops vs locking mode - * - overload control (too many pending ops) + * - lock mode upgrade should be handled automatically + * - lock mode vs allowed operation is not checked + * - too many pending blob ops can blow up i/o buffers + * - table and its blob part tables are not created atomically + * - there is no support for an asynchronous interface */ class NdbBlob { public: @@ -172,19 +170,11 @@ public: * read in the in/out bytes parameter. */ int readData(void* data, Uint32& bytes); - /** - * Read at given position. Does not use or update current position. - */ - int readData(Uint64 pos, void* data, Uint32& bytes); /** * Write at current position and set new position to first byte after * the data written. A write past blob end extends the blob value. */ int writeData(const void* data, Uint32 bytes); - /** - * Write at given position. Does not use or update current position. - */ - int writeData(Uint64 pos, const void* data, Uint32 bytes); /** * Return the blob column. */ @@ -266,14 +256,17 @@ private: Buf(); ~Buf(); void alloc(unsigned n); + void copyfrom(const Buf& src); }; Buf theKeyBuf; Buf theAccessKeyBuf; Buf theHeadInlineBuf; + Buf theHeadInlineCopyBuf; // for writeTuple Buf thePartBuf; Head* theHead; char* theInlineData; NdbRecAttr* theHeadInlineRecAttr; + NdbOperation* theHeadInlineReadOp; bool theHeadInlineUpdateFlag; // length and read/write position int theNullFlag; @@ -294,6 +287,7 @@ private: bool isReadOp(); bool isInsertOp(); bool isUpdateOp(); + bool isWriteOp(); bool isDeleteOp(); bool isScanOp(); // computations @@ -309,12 +303,13 @@ private: void getHeadFromRecAttr(); int setHeadInlineValue(NdbOperation* anOp); // data operations - int readDataPrivate(Uint64 pos, char* buf, Uint32& bytes); - int writeDataPrivate(Uint64 pos, const char* buf, Uint32 bytes); + int readDataPrivate(char* buf, Uint32& bytes); + int writeDataPrivate(const char* buf, Uint32 bytes); int readParts(char* buf, Uint32 part, Uint32 count); int insertParts(const char* buf, Uint32 part, Uint32 count); int updateParts(const char* buf, Uint32 part, Uint32 count); int deleteParts(Uint32 part, Uint32 count); + int deletePartsUnknown(Uint32 part); // pending ops int executePendingBlobReads(); int executePendingBlobWrites(); diff --git a/ndb/include/ndbapi/NdbConnection.hpp b/ndb/include/ndbapi/NdbConnection.hpp index 92b940e96f7..7af5d27b922 100644 --- a/ndb/include/ndbapi/NdbConnection.hpp +++ b/ndb/include/ndbapi/NdbConnection.hpp @@ -526,7 +526,7 @@ private: int sendCOMMIT(); // Send a TC_COMMITREQ signal; void setGCI(int GCI); // Set the global checkpoint identity - int OpCompleteFailure(Uint8 abortoption); + int OpCompleteFailure(Uint8 abortoption, bool setFailure = true); int OpCompleteSuccess(); void CompletedOperations(); // Move active ops to list of completed @@ -552,7 +552,7 @@ private: void setOperationErrorCode(int anErrorCode); // Indicate something went wrong in the definition phase - void setOperationErrorCodeAbort(int anErrorCode); + void setOperationErrorCodeAbort(int anErrorCode, int abortOption = -1); int checkMagicNumber(); // Verify correct object NdbOperation* getNdbOperation(const class NdbTableImpl* aTable, diff --git a/ndb/include/ndbapi/NdbIndexOperation.hpp b/ndb/include/ndbapi/NdbIndexOperation.hpp index 7612fe54d1b..1472f1b249e 100644 --- a/ndb/include/ndbapi/NdbIndexOperation.hpp +++ b/ndb/include/ndbapi/NdbIndexOperation.hpp @@ -49,6 +49,9 @@ public: * @{ */ + /** insert is not allowed */ + int insertTuple(); + /** * Define the NdbIndexOperation to be a standard operation of type readTuple. * When calling NdbConnection::execute, this operation @@ -193,6 +196,7 @@ private: // Private attributes const NdbIndexImpl* m_theIndex; + const NdbTableImpl* m_thePrimaryTable; Uint32 m_theIndexDefined[NDB_MAX_ATTRIBUTES_IN_INDEX][3]; Uint32 m_theIndexLen; // Length of the index in words Uint32 m_theNoOfIndexDefined; // The number of index attributes diff --git a/ndb/include/ndbapi/NdbOperation.hpp b/ndb/include/ndbapi/NdbOperation.hpp index 8e0294e41e6..46d4ddab0f5 100644 --- a/ndb/include/ndbapi/NdbOperation.hpp +++ b/ndb/include/ndbapi/NdbOperation.hpp @@ -918,6 +918,13 @@ protected: // Blobs in this operation NdbBlob* theBlobList; + /* + * Abort option per operation, used by blobs. Default -1. If set, + * overrides abort option on connection level. If set to IgnoreError, + * does not cause execute() to return failure. This is different from + * IgnoreError on connection level. + */ + Int8 m_abortOption; }; #ifdef NDB_NO_DROPPED_SIGNAL @@ -1160,5 +1167,3 @@ NdbOperation::setValue(Uint32 anAttrId, double aPar) } #endif - - diff --git a/ndb/src/ndbapi/NdbBlob.cpp b/ndb/src/ndbapi/NdbBlob.cpp index feab95d8ca5..5b193870558 100644 --- a/ndb/src/ndbapi/NdbBlob.cpp +++ b/ndb/src/ndbapi/NdbBlob.cpp @@ -33,21 +33,24 @@ ndbout << prefix << " " << hex << (void*)this << " " << cname; \ ndbout << " " << dec << __LINE__ << " " << x << " " << *this << endl; \ } while (0) -#else -#define DBG(x) -#endif static char* ndb_blob_debug(const Uint32* data, unsigned size) { - static char buf[128 + 1]; // MT irrelevant + static char buf[200]; // MT irrelevant buf[0] = 0; - for (unsigned i = 0; i < size && i < 128 / 4; i++) { - sprintf(buf + strlen(buf), "%*s%08x", i != 0, "", data[i]); + for (unsigned i = 0; i < size; i++) { + unsigned n = strlen(buf); + if (n + 10 < sizeof(buf)) + sprintf(buf + n, "%*s%08x", i != 0, "", data[i]); } return buf; } +#else +#define DBG(x) +#endif + /* * Reading index table directly (as a table) is faster but there are * bugs or limitations. Keep the code and make possible to choose. @@ -162,6 +165,7 @@ NdbBlob::init() theHead = NULL; theInlineData = NULL; theHeadInlineRecAttr = NULL; + theHeadInlineReadOp = NULL; theHeadInlineUpdateFlag = false; theNullFlag = -1; theLength = 0; @@ -206,6 +210,13 @@ NdbBlob::Buf::alloc(unsigned n) #endif } +void +NdbBlob::Buf::copyfrom(const NdbBlob::Buf& src) +{ + assert(size == src.size); + memcpy(data, src.data, size); +} + // classify operations (inline) inline bool @@ -226,6 +237,7 @@ NdbBlob::isKeyOp() return theNdbOp->theOperationType == NdbOperation::InsertRequest || theNdbOp->theOperationType == NdbOperation::UpdateRequest || + theNdbOp->theOperationType == NdbOperation::WriteRequest || theNdbOp->theOperationType == NdbOperation::ReadRequest || theNdbOp->theOperationType == NdbOperation::ReadExclusive || theNdbOp->theOperationType == NdbOperation::DeleteRequest; @@ -253,6 +265,13 @@ NdbBlob::isUpdateOp() theNdbOp->theOperationType == NdbOperation::UpdateRequest; } +inline bool +NdbBlob::isWriteOp() +{ + return + theNdbOp->theOperationType == NdbOperation::WriteRequest; +} + inline bool NdbBlob::isDeleteOp() { @@ -289,7 +308,7 @@ inline Uint32 NdbBlob::getDistKey(Uint32 part) { assert(theStripeSize != 0); - return (part / theStripeSize) % theStripeSize; + return part / theStripeSize; } // getters and setters @@ -401,7 +420,7 @@ NdbBlob::getHeadFromRecAttr() theNullFlag = theHeadInlineRecAttr->isNULL(); assert(theNullFlag != -1); theLength = ! theNullFlag ? theHead->length : 0; - DBG("getHeadFromRecAttr out"); + DBG("getHeadFromRecAttr [out]"); } int @@ -453,7 +472,7 @@ NdbBlob::setValue(const void* data, Uint32 bytes) setErrorCode(ErrState); return -1; } - if (! isInsertOp() && ! isUpdateOp()) { + if (! isInsertOp() && ! isUpdateOp() && ! isWriteOp()) { setErrorCode(ErrUsage); return -1; } @@ -466,11 +485,12 @@ NdbBlob::setValue(const void* data, Uint32 bytes) theGetSetBytes = bytes; if (isInsertOp()) { // write inline part now - if (theSetBuf != 0) { - unsigned n = theGetSetBytes; + if (theSetBuf != NULL) { + Uint32 n = theGetSetBytes; if (n > theInlineSize) n = theInlineSize; - if (writeDataPrivate(0, theSetBuf, n) == -1) + assert(thePos == 0); + if (writeDataPrivate(theSetBuf, n) == -1) return -1; } else { theNullFlag = true; @@ -555,7 +575,7 @@ NdbBlob::getLength(Uint64& len) int NdbBlob::truncate(Uint64 length) { - DBG("truncate length=" << length); + DBG("truncate [in] length=" << length); if (theNullFlag == -1) { setErrorCode(ErrState); return -1; @@ -573,7 +593,10 @@ NdbBlob::truncate(Uint64 length) } theLength = length; theHeadInlineUpdateFlag = true; + if (thePos > length) + thePos = length; } + DBG("truncate [out]"); return 0; } @@ -609,33 +632,21 @@ NdbBlob::setPos(Uint64 pos) int NdbBlob::readData(void* data, Uint32& bytes) -{ - if (readData(thePos, data, bytes) == -1) - return -1; - thePos += bytes; - assert(thePos <= theLength); - return 0; -} - -int -NdbBlob::readData(Uint64 pos, void* data, Uint32& bytes) { if (theState != Active) { setErrorCode(ErrState); return -1; } char* buf = static_cast(data); - return readDataPrivate(pos, buf, bytes); + return readDataPrivate(buf, bytes); } int -NdbBlob::readDataPrivate(Uint64 pos, char* buf, Uint32& bytes) +NdbBlob::readDataPrivate(char* buf, Uint32& bytes) { - DBG("readData pos=" << pos << " bytes=" << bytes); - if (pos > theLength) { - setErrorCode(ErrSeek); - return -1; - } + DBG("readData [in] bytes=" << bytes); + assert(thePos <= theLength); + Uint64 pos = thePos; if (bytes > theLength - pos) bytes = theLength - pos; Uint32 len = bytes; @@ -709,38 +720,29 @@ NdbBlob::readDataPrivate(Uint64 pos, char* buf, Uint32& bytes) len -= n; } assert(len == 0); + thePos = pos; + assert(thePos <= theLength); + DBG("readData [out]"); return 0; } int NdbBlob::writeData(const void* data, Uint32 bytes) -{ - if (writeData(thePos, data, bytes) == -1) - return -1; - thePos += bytes; - assert(thePos <= theLength); - return 0; -} - -int -NdbBlob::writeData(Uint64 pos, const void* data, Uint32 bytes) { if (theState != Active) { setErrorCode(ErrState); return -1; } const char* buf = static_cast(data); - return writeDataPrivate(pos, buf, bytes); + return writeDataPrivate(buf, bytes); } int -NdbBlob::writeDataPrivate(Uint64 pos, const char* buf, Uint32 bytes) +NdbBlob::writeDataPrivate(const char* buf, Uint32 bytes) { - DBG("writeData pos=" << pos << " bytes=" << bytes); - if (pos > theLength) { - setErrorCode(ErrSeek); - return -1; - } + DBG("writeData [in] bytes=" << bytes); + assert(thePos <= theLength); + Uint64 pos = thePos; Uint32 len = bytes; // any write makes blob not NULL if (theNullFlag) { @@ -778,7 +780,7 @@ NdbBlob::writeDataPrivate(Uint64 pos, const char* buf, Uint32 bytes) if (readParts(thePartBuf.data, part, 1) == -1) return -1; // need result now - DBG("execute pending part reafs"); + DBG("execute pending part reads"); if (executePendingBlobReads() == -1) return -1; Uint32 n = thePartSize - off; @@ -855,14 +857,16 @@ NdbBlob::writeDataPrivate(Uint64 pos, const char* buf, Uint32 bytes) theLength = pos; theHeadInlineUpdateFlag = true; } - DBG("writeData out"); + thePos = pos; + assert(thePos <= theLength); + DBG("writeData [out]"); return 0; } int NdbBlob::readParts(char* buf, Uint32 part, Uint32 count) { - DBG("readParts part=" << part << " count=" << count); + DBG("readParts [in] part=" << part << " count=" << count); Uint32 n = 0; while (n < count) { NdbOperation* tOp = theNdbCon->getNdbOperation(theBlobTable); @@ -873,6 +877,7 @@ NdbBlob::readParts(char* buf, Uint32 part, Uint32 count) setErrorCode(tOp); return -1; } + tOp->m_abortOption = AbortOnError; buf += thePartSize; n++; thePendingBlobOps |= (1 << NdbOperation::ReadRequest); @@ -884,7 +889,7 @@ NdbBlob::readParts(char* buf, Uint32 part, Uint32 count) int NdbBlob::insertParts(const char* buf, Uint32 part, Uint32 count) { - DBG("insertParts part=" << part << " count=" << count); + DBG("insertParts [in] part=" << part << " count=" << count); Uint32 n = 0; while (n < count) { NdbOperation* tOp = theNdbCon->getNdbOperation(theBlobTable); @@ -895,6 +900,7 @@ NdbBlob::insertParts(const char* buf, Uint32 part, Uint32 count) setErrorCode(tOp); return -1; } + tOp->m_abortOption = AbortOnError; buf += thePartSize; n++; thePendingBlobOps |= (1 << NdbOperation::InsertRequest); @@ -906,7 +912,7 @@ NdbBlob::insertParts(const char* buf, Uint32 part, Uint32 count) int NdbBlob::updateParts(const char* buf, Uint32 part, Uint32 count) { - DBG("updateParts part=" << part << " count=" << count); + DBG("updateParts [in] part=" << part << " count=" << count); Uint32 n = 0; while (n < count) { NdbOperation* tOp = theNdbCon->getNdbOperation(theBlobTable); @@ -917,6 +923,7 @@ NdbBlob::updateParts(const char* buf, Uint32 part, Uint32 count) setErrorCode(tOp); return -1; } + tOp->m_abortOption = AbortOnError; buf += thePartSize; n++; thePendingBlobOps |= (1 << NdbOperation::UpdateRequest); @@ -928,7 +935,7 @@ NdbBlob::updateParts(const char* buf, Uint32 part, Uint32 count) int NdbBlob::deleteParts(Uint32 part, Uint32 count) { - DBG("deleteParts part=" << part << " count=" << count); + DBG("deleteParts [in] part=" << part << " count=" << count); Uint32 n = 0; while (n < count) { NdbOperation* tOp = theNdbCon->getNdbOperation(theBlobTable); @@ -938,6 +945,7 @@ NdbBlob::deleteParts(Uint32 part, Uint32 count) setErrorCode(tOp); return -1; } + tOp->m_abortOption = AbortOnError; n++; thePendingBlobOps |= (1 << NdbOperation::DeleteRequest); theNdbCon->thePendingBlobOps |= (1 << NdbOperation::DeleteRequest); @@ -945,6 +953,57 @@ NdbBlob::deleteParts(Uint32 part, Uint32 count) return 0; } +/* + * Number of blob parts not known. Used to check for race condition + * when writeTuple is used for insert. Deletes all parts found. + */ +int +NdbBlob::deletePartsUnknown(Uint32 part) +{ + DBG("deletePartsUnknown [in] part=" << part << " count=all"); + static const unsigned maxbat = 256; + static const unsigned minbat = 1; + unsigned bat = minbat; + NdbOperation* tOpList[maxbat]; + Uint32 count = 0; + while (true) { + Uint32 n; + n = 0; + while (n < bat) { + NdbOperation*& tOp = tOpList[n]; // ref + tOp = theNdbCon->getNdbOperation(theBlobTable); + if (tOp == NULL || + tOp->deleteTuple() == -1 || + setPartKeyValue(tOp, part + count + n) == -1) { + setErrorCode(tOp); + return -1; + } + tOp->m_abortOption = IgnoreError; + n++; + if (theNdbCon->executeNoBlobs(NoCommit) == -1) + return -1; + } + n = 0; + while (n < bat) { + NdbOperation* tOp = tOpList[n]; + if (tOp->theError.code != 0) { + if (tOp->theError.code != 626) { + setErrorCode(tOp); + return -1; + } + // first non-existent part + DBG("deletePartsUnknown [out] count=" << count); + return 0; + } + n++; + count++; + } + bat *= 4; + if (bat > maxbat) + bat = maxbat; + } +} + // pending ops int @@ -1007,7 +1066,7 @@ NdbBlob::atPrepare(NdbConnection* aCon, NdbOperation* anOp, const NdbColumnImpl* theTable = anOp->m_currentTable; theAccessTable = anOp->m_accessTable; theColumn = aColumn; - DBG("atPrepare"); + DBG("atPrepare [in]"); NdbDictionary::Column::Type partType = NdbDictionary::Column::Undefined; switch (theColumn->getType()) { case NdbDictionary::Column::Blob: @@ -1046,6 +1105,7 @@ NdbBlob::atPrepare(NdbConnection* aCon, NdbOperation* anOp, const NdbColumnImpl* theKeyBuf.alloc(theTable->m_sizeOfKeysInWords << 2); theAccessKeyBuf.alloc(theAccessTable->m_sizeOfKeysInWords << 2); theHeadInlineBuf.alloc(sizeof(Head) + theInlineSize); + theHeadInlineCopyBuf.alloc(sizeof(Head) + theInlineSize); thePartBuf.alloc(thePartSize); theHead = (Head*)theHeadInlineBuf.data; theInlineData = theHeadInlineBuf.data + sizeof(Head); @@ -1080,6 +1140,12 @@ NdbBlob::atPrepare(NdbConnection* aCon, NdbOperation* anOp, const NdbColumnImpl* theNullFlag = true; theLength = 0; } + if (isWriteOp()) { + // becomes NULL unless set before execute + theNullFlag = true; + theLength = 0; + theHeadInlineUpdateFlag = true; + } supportedOp = true; } if (isScanOp()) { @@ -1093,19 +1159,21 @@ NdbBlob::atPrepare(NdbConnection* aCon, NdbOperation* anOp, const NdbColumnImpl* return -1; } setState(Prepared); - DBG("atPrepare out"); + DBG("atPrepare [out]"); return 0; } /* * Before execute of prepared operation. May add new operations before * this one. May ask that this operation and all before it (a "batch") - * is executed immediately in no-commit mode. + * is executed immediately in no-commit mode. In this case remaining + * prepared operations are saved in a separate list. They are added + * back after postExecute. */ int NdbBlob::preExecute(ExecType anExecType, bool& batch) { - DBG("preExecute"); + DBG("preExecute [in]"); if (theState == Invalid) return -1; assert(theState == Prepared); @@ -1120,11 +1188,11 @@ NdbBlob::preExecute(ExecType anExecType, bool& batch) if (isInsertOp()) { if (theSetFlag && theGetSetBytes > theInlineSize) { // add ops to write rest of a setValue - assert(theSetBuf != 0); - Uint64 pos = theInlineSize; + assert(theSetBuf != NULL); const char* buf = theSetBuf + theInlineSize; Uint32 bytes = theGetSetBytes - theInlineSize; - if (writeDataPrivate(pos, buf, bytes) == -1) + assert(thePos == theInlineSize); + if (writeDataPrivate(buf, bytes) == -1) return -1; if (theHeadInlineUpdateFlag) { // add an operation to update head+inline @@ -1136,11 +1204,12 @@ NdbBlob::preExecute(ExecType anExecType, bool& batch) setErrorCode(ErrAbort); return -1; } + DBG("add op to update head+inline"); } } } if (isTableOp()) { - if (isUpdateOp() || isDeleteOp()) { + if (isUpdateOp() || isWriteOp() || isDeleteOp()) { // add operation before this one to read head+inline NdbOperation* tOp = theNdbCon->getNdbOperation(theTable, theNdbOp); if (tOp == NULL || @@ -1150,8 +1219,13 @@ NdbBlob::preExecute(ExecType anExecType, bool& batch) setErrorCode(tOp); return -1; } + if (isWriteOp()) { + tOp->m_abortOption = IgnoreError; + } + theHeadInlineReadOp = tOp; // execute immediately batch = true; + DBG("add op before to read head+inline"); } } if (isIndexOp()) { @@ -1180,6 +1254,7 @@ NdbBlob::preExecute(ExecType anExecType, bool& batch) } } } + DBG("added op before to read table key"); if (isUpdateOp() || isDeleteOp()) { // add op before this one to read head+inline via index NdbIndexOperation* tOp = theNdbCon->getNdbIndexOperation(theAccessTable->m_index, theTable, theNdbOp); @@ -1190,15 +1265,43 @@ NdbBlob::preExecute(ExecType anExecType, bool& batch) setErrorCode(tOp); return -1; } + if (isWriteOp()) { + tOp->m_abortOption = IgnoreError; + } + theHeadInlineReadOp = tOp; // execute immediately batch = true; + DBG("added index op before to read head+inline"); + } + if (isWriteOp()) { + // XXX until IgnoreError fixed for index op + batch = true; + } + } + if (isWriteOp()) { + if (theSetFlag) { + // write head+inline now + theNullFlag = true; + theLength = 0; + if (theSetBuf != NULL) { + Uint32 n = theGetSetBytes; + if (n > theInlineSize) + n = theInlineSize; + assert(thePos == 0); + if (writeDataPrivate(theSetBuf, n) == -1) + return -1; + } + if (setHeadInlineValue(theNdbOp) == -1) + return -1; + // the read op before us may overwrite + theHeadInlineCopyBuf.copyfrom(theHeadInlineBuf); } } if (theActiveHook != NULL) { // need blob head for callback batch = true; } - DBG("preExecute out batch=" << batch); + DBG("preExecute [out] batch=" << batch); return 0; } @@ -1211,15 +1314,16 @@ NdbBlob::preExecute(ExecType anExecType, bool& batch) int NdbBlob::postExecute(ExecType anExecType) { - DBG("postExecute type=" << anExecType); + DBG("postExecute [in] type=" << anExecType); if (theState == Invalid) return -1; if (theState == Active) { setState(anExecType == NoCommit ? Active : Closed); - DBG("postExecute skip"); + DBG("postExecute [skip]"); return 0; } assert(theState == Prepared); + setState(anExecType == NoCommit ? Active : Closed); assert(isKeyOp()); if (isIndexOp()) { NdbBlob* tFirstBlob = theNdbOp->theBlobList; @@ -1231,22 +1335,13 @@ NdbBlob::postExecute(ExecType anExecType) } if (isReadOp()) { getHeadFromRecAttr(); - if (theGetFlag && theGetSetBytes > 0) { - // copy inline bytes to user buffer - assert(theGetBuf != NULL); - unsigned n = theGetSetBytes; - if (n > theInlineSize) - n = theInlineSize; - memcpy(theGetBuf, theInlineData, n); - } - if (theGetFlag && theGetSetBytes > theInlineSize) { - // add ops to read rest of a getValue - assert(anExecType == NoCommit); - assert(theGetBuf != 0); - Uint64 pos = theInlineSize; - char* buf = theGetBuf + theInlineSize; - Uint32 bytes = theGetSetBytes - theInlineSize; - if (readDataPrivate(pos, buf, bytes) == -1) + if (setPos(0) == -1) + return -1; + if (theGetFlag) { + assert(theGetSetBytes == 0 || theGetBuf != 0); + assert(theGetSetBytes <= theInlineSize || anExecType == NoCommit); + Uint32 bytes = theGetSetBytes; + if (readDataPrivate(theGetBuf, bytes) == -1) return -1; } } @@ -1255,10 +1350,11 @@ NdbBlob::postExecute(ExecType anExecType) getHeadFromRecAttr(); if (theSetFlag) { // setValue overwrites everything - if (theSetBuf != 0) { + if (theSetBuf != NULL) { if (truncate(0) == -1) return -1; - if (writeDataPrivate(0, theSetBuf, theGetSetBytes) == -1) + assert(thePos == 0); + if (writeDataPrivate(theSetBuf, theGetSetBytes) == -1) return -1; } else { if (setNull() == -1) @@ -1266,6 +1362,57 @@ NdbBlob::postExecute(ExecType anExecType) } } } + if (isWriteOp() && isTableOp()) { + assert(anExecType == NoCommit); + if (theHeadInlineReadOp->theError.code == 0) { + int tNullFlag = theNullFlag; + Uint64 tLength = theLength; + Uint64 tPos = thePos; + getHeadFromRecAttr(); + DBG("tuple found"); + if (truncate(0) == -1) + return -1; + // restore previous head+inline + theHeadInlineBuf.copyfrom(theHeadInlineCopyBuf); + theNullFlag = tNullFlag; + theLength = tLength; + thePos = tPos; + } else { + if (theHeadInlineReadOp->theError.code != 626) { + setErrorCode(theHeadInlineReadOp); + return -1; + } + DBG("tuple not found"); + /* + * Read found no tuple but it is possible that a tuple was + * created after the read by another transaction. Delete all + * blob parts which may exist. + */ + if (deletePartsUnknown(0) == -1) + return -1; + } + if (theSetFlag && theGetSetBytes > theInlineSize) { + assert(theSetBuf != NULL); + const char* buf = theSetBuf + theInlineSize; + Uint32 bytes = theGetSetBytes - theInlineSize; + assert(thePos == theInlineSize); + if (writeDataPrivate(buf, bytes) == -1) + return -1; + } + } + if (isWriteOp() && isIndexOp()) { + // XXX until IgnoreError fixed for index op + if (deletePartsUnknown(0) == -1) + return -1; + if (theSetFlag && theGetSetBytes > theInlineSize) { + assert(theSetBuf != NULL); + const char* buf = theSetBuf + theInlineSize; + Uint32 bytes = theGetSetBytes - theInlineSize; + assert(thePos == theInlineSize); + if (writeDataPrivate(buf, bytes) == -1) + return -1; + } + } if (isDeleteOp()) { assert(anExecType == NoCommit); getHeadFromRecAttr(); @@ -1278,7 +1425,7 @@ NdbBlob::postExecute(ExecType anExecType) if (invokeActiveHook() == -1) return -1; } - DBG("postExecute out"); + DBG("postExecute [out]"); return 0; } @@ -1289,12 +1436,12 @@ NdbBlob::postExecute(ExecType anExecType) int NdbBlob::preCommit() { - DBG("preCommit"); + DBG("preCommit [in]"); if (theState == Invalid) return -1; assert(theState == Active); assert(isKeyOp()); - if (isInsertOp() || isUpdateOp()) { + if (isInsertOp() || isUpdateOp() || isWriteOp()) { if (theHeadInlineUpdateFlag) { // add an operation to update head+inline NdbOperation* tOp = theNdbCon->getNdbOperation(theTable); @@ -1305,9 +1452,11 @@ NdbBlob::preCommit() setErrorCode(ErrAbort); return -1; } + tOp->m_abortOption = AbortOnError; + DBG("added op to update head+inline"); } } - DBG("preCommit out"); + DBG("preCommit [out]"); return 0; } @@ -1317,13 +1466,10 @@ NdbBlob::preCommit() int NdbBlob::atNextResult() { - DBG("atNextResult"); + DBG("atNextResult [in]"); if (theState == Invalid) return -1; assert(isScanOp()); - getHeadFromRecAttr(); - // reset position - thePos = 0; // get primary key { Uint32* data = (Uint32*)theKeyBuf.data; unsigned size = theTable->m_sizeOfKeysInWords; @@ -1332,26 +1478,14 @@ NdbBlob::atNextResult() return -1; } } - if (! theNullFlag) { - if (theGetFlag && theGetSetBytes > 0) { - // copy inline bytes to user buffer - assert(theGetBuf != NULL); - unsigned n = theGetSetBytes; - if (n > theLength) - n = theLength; - if (n > theInlineSize) - n = theInlineSize; - memcpy(theGetBuf, theInlineData, n); - } - if (theGetFlag && theGetSetBytes > theInlineSize && theLength > theInlineSize) { - // add ops to read rest of a getValue - assert(theGetBuf != 0); - Uint64 pos = theInlineSize; - char* buf = theGetBuf + theInlineSize; - Uint32 bytes = theGetSetBytes - theInlineSize; - if (readDataPrivate(pos, buf, bytes) == -1) - return -1; - } + getHeadFromRecAttr(); + if (setPos(0) == -1) + return -1; + if (theGetFlag) { + assert(theGetSetBytes == 0 || theGetBuf != 0); + Uint32 bytes = theGetSetBytes; + if (readDataPrivate(theGetBuf, bytes) == -1) + return -1; } setState(Active); // activation callback @@ -1359,7 +1493,7 @@ NdbBlob::atNextResult() if (invokeActiveHook() == -1) return -1; } - DBG("atNextResult out"); + DBG("atNextResult [out]"); return 0; } @@ -1444,7 +1578,8 @@ operator<<(NdbOut& out, const NdbBlob& blob) ndbout << dec << " n=" << blob.theNullFlag;; ndbout << dec << " l=" << blob.theLength; ndbout << dec << " p=" << blob.thePos; - ndbout << dec << " u=" << (Uint32) blob.theHeadInlineUpdateFlag; + ndbout << dec << " u=" << (Uint32)blob.theHeadInlineUpdateFlag; + ndbout << dec << " g=" << (Uint32)blob.theGetSetBytes; return out; } #endif diff --git a/ndb/src/ndbapi/NdbConnection.cpp b/ndb/src/ndbapi/NdbConnection.cpp index 1457792cf28..c21a85fd24d 100644 --- a/ndb/src/ndbapi/NdbConnection.cpp +++ b/ndb/src/ndbapi/NdbConnection.cpp @@ -170,12 +170,14 @@ Remark: Sets an error code on the connection object from an operation object. *****************************************************************************/ void -NdbConnection::setOperationErrorCodeAbort(int error) +NdbConnection::setOperationErrorCodeAbort(int error, int abortOption) { DBUG_ENTER("NdbConnection::setOperationErrorCodeAbort"); + if (abortOption == -1) + abortOption = m_abortOption; if (theTransactionIsStarted == false) { theCommitStatus = Aborted; - } else if ((m_abortOption == AbortOnError) && + } else if ((abortOption == AbortOnError) && (theCommitStatus != Committed) && (theCommitStatus != Aborted)) { theCommitStatus = NeedAbort; @@ -335,8 +337,11 @@ NdbConnection::execute(ExecType aTypeOfExec, tOp = tOp->next(); } } + if (executeNoBlobs(tExecType, abortOption, forceSend) == -1) ret = -1; + assert(theFirstOpInList == NULL && theLastOpInList == NULL); + { NdbOperation* tOp = theCompletedFirstOp; while (tOp != NULL) { @@ -360,6 +365,7 @@ NdbConnection::execute(ExecType aTypeOfExec, theLastOpInList->next(tRestOp); theLastOpInList = tLastOp; } + assert(theFirstOpInList == NULL || tExecType == NoCommit); } while (theFirstOpInList != NULL || tExecType != aTypeOfExec); DBUG_RETURN(ret); @@ -1806,11 +1812,12 @@ Parameters: aErrorCode: The error code. Remark: An operation was completed with failure. *******************************************************************************/ int -NdbConnection::OpCompleteFailure(Uint8 abortOption) +NdbConnection::OpCompleteFailure(Uint8 abortOption, bool setFailure) { Uint32 tNoComp = theNoOfOpCompleted; Uint32 tNoSent = theNoOfOpSent; - theCompletionStatus = NdbConnection::CompletedFailure; + if (setFailure) + theCompletionStatus = NdbConnection::CompletedFailure; tNoComp++; theNoOfOpCompleted = tNoComp; if (tNoComp == tNoSent) { diff --git a/ndb/src/ndbapi/NdbDictionaryImpl.cpp b/ndb/src/ndbapi/NdbDictionaryImpl.cpp index cf51a30fe0b..76854cabcd7 100644 --- a/ndb/src/ndbapi/NdbDictionaryImpl.cpp +++ b/ndb/src/ndbapi/NdbDictionaryImpl.cpp @@ -47,13 +47,15 @@ * Column */ NdbColumnImpl::NdbColumnImpl() - : NdbDictionary::Column(* this), m_facade(this) + : NdbDictionary::Column(* this), m_facade(this), + m_attrId(-1) { init(); } NdbColumnImpl::NdbColumnImpl(NdbDictionary::Column & f) - : NdbDictionary::Column(* this), m_facade(&f) + : NdbDictionary::Column(* this), m_facade(&f), + m_attrId(-1) { init(); } @@ -93,8 +95,7 @@ NdbColumnImpl::init(Type t) { // do not use default_charset_info as it may not be initialized yet // use binary collation until NDB tests can handle charsets - CHARSET_INFO* default_cs = &my_charset_latin1_bin; - m_attrId = -1; + CHARSET_INFO* default_cs = &my_charset_bin; m_type = t; switch (m_type) { case Tinyint: diff --git a/ndb/src/ndbapi/NdbIndexOperation.cpp b/ndb/src/ndbapi/NdbIndexOperation.cpp index 9abde639914..3f174a61b64 100644 --- a/ndb/src/ndbapi/NdbIndexOperation.cpp +++ b/ndb/src/ndbapi/NdbIndexOperation.cpp @@ -71,6 +71,7 @@ NdbIndexOperation::indxInit(const NdbIndexImpl * anIndex, return -1; } m_theIndex = anIndex; + m_thePrimaryTable = aTable; m_accessTable = anIndex->m_table; m_theIndexLen = 0; m_theNoOfIndexDefined = 0; @@ -102,6 +103,12 @@ int NdbIndexOperation::readTuple(NdbOperation::LockMode lm) }; } +int NdbIndexOperation::insertTuple() +{ + setErrorCode(4200); + return -1; +} + int NdbIndexOperation::readTuple() { // First check that index is unique @@ -341,12 +348,11 @@ int NdbIndexOperation::equal_impl(const NdbColumnImpl* tAttrInfo, theDistrGroupIndicator = 1; }//if /************************************************************************** - * If the operation is an insert request and the attribute is stored then + * If the operation is a write request and the attribute is stored then * we also set the value in the stored part through putting the * information in the INDXATTRINFO signals. *************************************************************************/ - if ((tOpType == InsertRequest) || - (tOpType == WriteRequest)) { + if ((tOpType == WriteRequest)) { if (!tAttrInfo->m_indexOnly){ // invalid data can crash kernel if (cs != NULL && @@ -357,7 +363,13 @@ int NdbIndexOperation::equal_impl(const NdbColumnImpl* tAttrInfo, goto equal_error4; Uint32 ahValue; Uint32 sz = totalSizeInWords; - AttributeHeader::init(&ahValue, tAttrId, sz); + /* + * XXX should be linked in metadata but cannot now because + * things can be defined in arbitrary order + */ + const NdbColumnImpl* primaryCol = m_thePrimaryTable->getColumn(tAttrInfo->m_name.c_str()); + assert(primaryCol != NULL); + AttributeHeader::init(&ahValue, primaryCol->m_attrId, sz); insertATTRINFO( ahValue ); insertATTRINFOloop((Uint32*)aValueToWrite, sizeInWords); if (bitsInLastWord != 0) { @@ -369,7 +381,6 @@ int NdbIndexOperation::equal_impl(const NdbColumnImpl* tAttrInfo, }//if }//if }//if - /************************************************************************** * Store the Key information in the TCINDXREQ and INDXKEYINFO signals. *************************************************************************/ @@ -734,13 +745,10 @@ NdbIndexOperation::receiveTCINDXREF( NdbApiSignal* aSignal) }//if theStatus = Finished; - + theNdbCon->theReturnStatus = NdbConnection::ReturnFailure; Uint32 errorCode = tcIndxRef->errorCode; theError.code = errorCode; theNdbCon->setOperationErrorCodeAbort(errorCode); return theNdbCon->OpCompleteFailure(theNdbCon->m_abortOption); }//NdbIndexOperation::receiveTCINDXREF() - - - diff --git a/ndb/src/ndbapi/NdbOperation.cpp b/ndb/src/ndbapi/NdbOperation.cpp index b0b95d0ff43..88d8a000d50 100644 --- a/ndb/src/ndbapi/NdbOperation.cpp +++ b/ndb/src/ndbapi/NdbOperation.cpp @@ -78,7 +78,8 @@ NdbOperation::NdbOperation(Ndb* aNdb) : m_tcReqGSN(GSN_TCKEYREQ), m_keyInfoGSN(GSN_KEYINFO), m_attrInfoGSN(GSN_ATTRINFO), - theBlobList(NULL) + theBlobList(NULL), + m_abortOption(-1) { theReceiver.init(NdbReceiver::NDB_OPERATION, this); theError.code = 0; @@ -167,6 +168,7 @@ NdbOperation::init(const NdbTableImpl* tab, NdbConnection* myConnection){ theTotalNrOfKeyWordInSignal = 8; theMagicNumber = 0xABCDEF01; theBlobList = NULL; + m_abortOption = -1; tSignal = theNdb->getSignal(); if (tSignal == NULL) diff --git a/ndb/src/ndbapi/NdbOperationExec.cpp b/ndb/src/ndbapi/NdbOperationExec.cpp index f1338ae01e4..fa46e93a57f 100644 --- a/ndb/src/ndbapi/NdbOperationExec.cpp +++ b/ndb/src/ndbapi/NdbOperationExec.cpp @@ -191,7 +191,8 @@ NdbOperation::prepareSend(Uint32 aTC_ConnectPtr, Uint64 aTransId) Uint8 tDirtyIndicator = theDirtyIndicator; OperationType tOperationType = theOperationType; Uint32 tTupKeyLen = theTupKeyLen; - Uint8 abortOption = theNdbCon->m_abortOption; + Uint8 abortOption = + m_abortOption != -1 ? m_abortOption : theNdbCon->m_abortOption; tcKeyReq->setDirtyFlag(tReqInfo, tDirtyIndicator); tcKeyReq->setOperationType(tReqInfo, tOperationType); @@ -541,17 +542,20 @@ NdbOperation::receiveTCKEYREF( NdbApiSignal* aSignal) return -1; }//if - AbortOption ao = (AbortOption)theNdbCon->m_abortOption; + AbortOption ao = (AbortOption) + (m_abortOption != -1 ? m_abortOption : theNdbCon->m_abortOption); theReceiver.m_received_result_length = ~0; theStatus = Finished; - theNdbCon->theReturnStatus = NdbConnection::ReturnFailure; + // blobs want this + if (m_abortOption != IgnoreError) + theNdbCon->theReturnStatus = NdbConnection::ReturnFailure; theError.code = aSignal->readData(4); - theNdbCon->setOperationErrorCodeAbort(aSignal->readData(4)); + theNdbCon->setOperationErrorCodeAbort(aSignal->readData(4), ao); if(theOperationType != ReadRequest || !theSimpleIndicator) // not simple read - return theNdbCon->OpCompleteFailure(ao); + return theNdbCon->OpCompleteFailure(ao, m_abortOption != IgnoreError); /** * If TCKEYCONF has arrived diff --git a/ndb/test/ndbapi/testBlobs.cpp b/ndb/test/ndbapi/testBlobs.cpp index 41bb82f3e06..f7ee7921229 100644 --- a/ndb/test/ndbapi/testBlobs.cpp +++ b/ndb/test/ndbapi/testBlobs.cpp @@ -48,7 +48,7 @@ struct Opt { unsigned m_rows; unsigned m_seed; const char* m_skip; - const char* m_style; + const char* m_test; // metadata const char* m_tname; const char* m_x1name; // hash index @@ -71,8 +71,8 @@ struct Opt { m_parts(10), m_rows(100), m_seed(0), - m_skip(""), - m_style("012"), + m_skip(0), + m_test(0), // metadata m_tname("TBLOB1"), m_x1name("TBLOB1X1"), @@ -101,45 +101,44 @@ printusage() << " -dbg print debug" << endl << " -dbgall print also NDB API debug (if compiled in)" << endl << " -full read/write only full blob values" << endl - << " -inline read/write only blobs which fit inline" << endl << " -loop N loop N times 0=forever [" << d.m_loop << "]" << endl << " -parts N max parts in blob value [" << d.m_parts << "]" << endl << " -rows N number of rows [" << d.m_rows << "]" << endl << " -seed N random seed 0=loop number [" << d.m_seed << "]" << endl - << " -skip xxx skip these tests (see list) [" << d.m_skip << endl - << " -style xxx access styles to test (see list) [" << d.m_style << "]" << endl + << " -skip xxx skip given tests (see list) [no tests]" << endl + << " -test xxx only given tests (see list) [all tests]" << endl << "metadata" << endl << " -pk2len N length of PK2 [" << d.m_pk2len << "/" << g_max_pk2len <<"]" << endl << " -oneblob only 1 blob attribute [default 2]" << endl - << "testcases for -skip" << endl + << "testcases for test/skip" << endl << " k primary key ops" << endl << " i hash index ops" << endl << " s table scans" << endl << " r ordered index scans" << endl - << " u update blob value" << endl - << "access styles for -style" << endl + << "additional flags for test/skip" << endl + << " u update existing blob value" << endl + << " n normal insert and update" << endl + << " w insert and update using writeTuple" << endl << " 0 getValue / setValue" << endl << " 1 setActiveHook" << endl << " 2 readData / writeData" << endl << "bug tests (no blob test)" << endl << " -bug 4088 ndb api hang with mixed ops on index table" << endl - << " -bug 2222 delete + write gives 626" << endl - << " -bug 3333 acc crash on delete and long key" << endl + << " -bug nnnn delete + write gives 626" << endl + << " -bug nnnn acc crash on delete and long key" << endl ; } static Opt g_opt; static bool -skipcase(int x) +testcase(char x) { - return strchr(g_opt.m_skip, x) != 0; -} - -static bool -skipstyle(int x) -{ - return strchr(g_opt.m_style, '0' + x) == 0; + if (x < 10) + x += '0'; + return + (g_opt.m_test == 0 || strchr(g_opt.m_test, x) != 0) && + (g_opt.m_skip == 0 || strchr(g_opt.m_skip, x) == 0); } static Ndb* g_ndb = 0; @@ -435,7 +434,9 @@ getBlobLength(NdbBlob* h, unsigned& len) CHK(h->getLength(len2) == 0); len = (unsigned)len2; assert(len == len2); - DBG("getBlobLength " << h->getColumn()->getName() << " len=" << len); + bool isNull; + CHK(h->getNull(isNull) == 0); + DBG("getBlobLength " << h->getColumn()->getName() << " len=" << len << " null=" << isNull); return 0; } @@ -911,6 +912,41 @@ updatePk(int style) return 0; } +static int +writePk(int style) +{ + DBG("--- writePk " << stylename[style] << " ---"); + for (unsigned k = 0; k < g_opt.m_rows; k++) { + Tup& tup = g_tups[k]; + DBG("writePk pk1=" << hex << tup.m_pk1); + CHK((g_con = g_ndb->startTransaction()) != 0); + CHK((g_opr = g_con->getNdbOperation(g_opt.m_tname)) != 0); + CHK(g_opr->writeTuple() == 0); + CHK(g_opr->equal("PK1", tup.m_pk1) == 0); + if (g_opt.m_pk2len != 0) + CHK(g_opr->equal("PK2", tup.m_pk2) == 0); + CHK(getBlobHandles(g_opr) == 0); + if (style == 0) { + CHK(setBlobValue(tup) == 0); + } else if (style == 1) { + // non-nullable must be set + CHK(g_bh1->setValue("", 0) == 0); + CHK(setBlobWriteHook(tup) == 0); + } else { + // non-nullable must be set + CHK(g_bh1->setValue("", 0) == 0); + CHK(g_con->execute(NoCommit) == 0); + CHK(writeBlobData(tup) == 0); + } + CHK(g_con->execute(Commit) == 0); + g_ndb->closeTransaction(g_con); + g_opr = 0; + g_con = 0; + tup.m_exists = true; + } + return 0; +} + static int deletePk() { @@ -995,6 +1031,35 @@ updateIdx(int style) return 0; } +static int +writeIdx(int style) +{ + DBG("--- writeIdx " << stylename[style] << " ---"); + for (unsigned k = 0; k < g_opt.m_rows; k++) { + Tup& tup = g_tups[k]; + DBG("writeIdx pk1=" << hex << tup.m_pk1); + CHK((g_con = g_ndb->startTransaction()) != 0); + CHK((g_opx = g_con->getNdbIndexOperation(g_opt.m_x1name, g_opt.m_tname)) != 0); + CHK(g_opx->writeTuple() == 0); + CHK(g_opx->equal("PK2", tup.m_pk2) == 0); + CHK(getBlobHandles(g_opx) == 0); + if (style == 0) { + CHK(setBlobValue(tup) == 0); + } else if (style == 1) { + CHK(setBlobWriteHook(tup) == 0); + } else { + CHK(g_con->execute(NoCommit) == 0); + CHK(writeBlobData(tup) == 0); + } + CHK(g_con->execute(Commit) == 0); + g_ndb->closeTransaction(g_con); + g_opx = 0; + g_con = 0; + tup.m_exists = true; + } + return 0; +} + static int deleteIdx() { @@ -1170,7 +1235,6 @@ deleteScan(bool idx) static int testmain() { - int style; g_ndb = new Ndb("TEST_DB"); CHK(g_ndb->init() == 0); CHK(g_ndb->waitUntilReady() == 0); @@ -1194,55 +1258,88 @@ testmain() if (g_opt.m_seed != 0) srandom(g_opt.m_seed); for (g_loop = 0; g_opt.m_loop == 0 || g_loop < g_opt.m_loop; g_loop++) { + int style; DBG("=== loop " << g_loop << " ==="); if (g_opt.m_seed == 0) srandom(g_loop); // pk for (style = 0; style <= 2; style++) { - if (skipcase('k') || skipstyle(style)) + if (! testcase('k') || ! testcase(style)) continue; DBG("--- pk ops " << stylename[style] << " ---"); - calcTups(false); - CHK(insertPk(style) == 0); - CHK(verifyBlob() == 0); - CHK(readPk(style) == 0); - if (! skipcase('u')) { - calcTups(style); - CHK(updatePk(style) == 0); + if (testcase('n')) { + calcTups(false); + CHK(insertPk(style) == 0); + CHK(verifyBlob() == 0); + CHK(readPk(style) == 0); + if (testcase('u')) { + calcTups(style); + CHK(updatePk(style) == 0); + CHK(verifyBlob() == 0); + CHK(readPk(style) == 0); + } + CHK(deletePk() == 0); + CHK(verifyBlob() == 0); + } + if (testcase('w')) { + calcTups(false); + CHK(writePk(style) == 0); + CHK(verifyBlob() == 0); + CHK(readPk(style) == 0); + if (testcase('u')) { + calcTups(style); + CHK(writePk(style) == 0); + CHK(verifyBlob() == 0); + CHK(readPk(style) == 0); + } + CHK(deletePk() == 0); CHK(verifyBlob() == 0); } - CHK(readPk(style) == 0); - CHK(deletePk() == 0); - CHK(verifyBlob() == 0); } // hash index for (style = 0; style <= 2; style++) { - if (skipcase('i') || skipstyle(style)) + if (! testcase('i') || ! testcase(style)) continue; DBG("--- idx ops " << stylename[style] << " ---"); - calcTups(false); - CHK(insertPk(style) == 0); - CHK(verifyBlob() == 0); - CHK(readIdx(style) == 0); - calcTups(style); - if (! skipcase('u')) { - CHK(updateIdx(style) == 0); + if (testcase('n')) { + calcTups(false); + CHK(insertPk(style) == 0); CHK(verifyBlob() == 0); CHK(readIdx(style) == 0); + if (testcase('u')) { + calcTups(style); + CHK(updateIdx(style) == 0); + CHK(verifyBlob() == 0); + CHK(readIdx(style) == 0); + } + CHK(deleteIdx() == 0); + CHK(verifyBlob() == 0); + } + if (testcase('w')) { + calcTups(false); + CHK(writePk(style) == 0); + CHK(verifyBlob() == 0); + CHK(readIdx(style) == 0); + if (testcase('u')) { + calcTups(style); + CHK(writeIdx(style) == 0); + CHK(verifyBlob() == 0); + CHK(readIdx(style) == 0); + } + CHK(deleteIdx() == 0); + CHK(verifyBlob() == 0); } - CHK(deleteIdx() == 0); - CHK(verifyBlob() == 0); } // scan table for (style = 0; style <= 2; style++) { - if (skipcase('s') || skipstyle(style)) + if (! testcase('s') || ! testcase(style)) continue; DBG("--- table scan " << stylename[style] << " ---"); calcTups(false); CHK(insertPk(style) == 0); CHK(verifyBlob() == 0); CHK(readScan(style, false) == 0); - if (! skipcase('u')) { + if (testcase('u')) { CHK(updateScan(style, false) == 0); CHK(verifyBlob() == 0); } @@ -1251,14 +1348,14 @@ testmain() } // scan index for (style = 0; style <= 2; style++) { - if (skipcase('r') || skipstyle(style)) + if (! testcase('r') || ! testcase(style)) continue; DBG("--- index scan " << stylename[style] << " ---"); calcTups(false); CHK(insertPk(style) == 0); CHK(verifyBlob() == 0); CHK(readScan(style, true) == 0); - if (! skipcase('u')) { + if (testcase('u')) { CHK(updateScan(style, true) == 0); CHK(verifyBlob() == 0); } @@ -1331,9 +1428,7 @@ static struct { int m_bug; int (*m_test)(); } g_bugtest[] = { - { 4088, bugtest_4088 }, - { 2222, bugtest_2222 }, - { 3333, bugtest_3333 } + { 4088, bugtest_4088 } }; NDB_COMMAND(testOdbcDriver, "testBlobs", "testBlobs", "testBlobs", 65535) @@ -1395,9 +1490,9 @@ NDB_COMMAND(testOdbcDriver, "testBlobs", "testBlobs", "testBlobs", 65535) continue; } } - if (strcmp(arg, "-style") == 0) { + if (strcmp(arg, "-test") == 0) { if (++argv, --argc > 0) { - g_opt.m_style = strdup(argv[0]); + g_opt.m_test = strdup(argv[0]); continue; } } @@ -1433,7 +1528,9 @@ NDB_COMMAND(testOdbcDriver, "testBlobs", "testBlobs", "testBlobs", 65535) } if (g_opt.m_pk2len == 0) { char b[100]; - strcpy(b, g_opt.m_skip); + b[0] = 0; + if (g_opt.m_skip != 0) + strcpy(b, g_opt.m_skip); strcat(b, "i"); strcat(b, "r"); g_opt.m_skip = strdup(b); From f8f7110afe89b22742b9c61c5adc421696f13f5c Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 1 Nov 2004 10:38:27 +0100 Subject: [PATCH 0054/1063] Fixed hanging ndb_mgmd on various platforms Move init of node-init-mutex to before alloc node id ndb/src/mgmsrv/MgmtSrvr.cpp: Move init of node-init-mutex to before alloc node id --- ndb/src/mgmsrv/MgmtSrvr.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/ndb/src/mgmsrv/MgmtSrvr.cpp b/ndb/src/mgmsrv/MgmtSrvr.cpp index 29df10630f3..01dae3aeddb 100644 --- a/ndb/src/mgmsrv/MgmtSrvr.cpp +++ b/ndb/src/mgmsrv/MgmtSrvr.cpp @@ -480,6 +480,13 @@ MgmtSrvr::MgmtSrvr(NodeId nodeId, _ownNodeId= 0; NodeId tmp= nodeId; BaseString error_string; + + if ((m_node_id_mutex = NdbMutex_Create()) == 0) + { + ndbout << "mutex creation failed line = " << __LINE__ << endl; + exit(-1); + } + #if 0 char my_hostname[256]; struct sockaddr_in tmp_addr; @@ -512,7 +519,6 @@ MgmtSrvr::MgmtSrvr(NodeId nodeId, #endif _ownNodeId = tmp; - { DBUG_PRINT("info", ("verifyConfig")); ConfigRetriever cr(m_local_config, NDB_VERSION, NDB_MGM_NODE_TYPE_MGM); @@ -534,12 +540,6 @@ MgmtSrvr::MgmtSrvr(NodeId nodeId, m_statisticsListner.m_logLevel = se.m_logLevel; } - if ((m_node_id_mutex = NdbMutex_Create()) == 0) - { - ndbout << "mutex creation failed line = " << __LINE__ << endl; - exit(-1); - } - DBUG_VOID_RETURN; } From 3ff74fe4a07b407166fb1b35ba48db0949e7d175 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 1 Nov 2004 12:08:44 +0200 Subject: [PATCH 0055/1063] mysqld.cc: Describe innodb_max_purge_lag Improve description of innodb_table_locks sql/mysqld.cc: Describe innodb_max_purge_lag Improve description of innodb_table_locks --- sql/mysqld.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index d36b441ac9a..768acd77c27 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -3702,12 +3702,12 @@ struct my_option my_long_options[] = "Percentage of dirty pages allowed in bufferpool", (gptr*) &srv_max_buf_pool_modified_pct, (gptr*) &srv_max_buf_pool_modified_pct, 0, GET_ULONG, REQUIRED_ARG, 90, 0, 100, 0, 0, 0}, {"innodb_max_purge_lag", OPT_INNODB_MAX_PURGE_LAG, - "", + "Desired maximum length of the purge queue (0 = no limit)", (gptr*) &srv_max_purge_lag, (gptr*) &srv_max_purge_lag, 0, GET_LONG, REQUIRED_ARG, 0, 0, ~0L, 0, 1L, 0}, {"innodb_table_locks", OPT_INNODB_TABLE_LOCKS, - "If Innodb should enforce LOCK TABLE", + "Enable InnoDB locking in LOCK TABLES", (gptr*) &global_system_variables.innodb_table_locks, (gptr*) &global_system_variables.innodb_table_locks, 0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0}, From 3ba04dced35e10405c1927a955c9ef6ca2d31beb Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 1 Nov 2004 12:49:38 +0100 Subject: [PATCH 0056/1063] Removed old not used/illegal declaration --- ndb/include/kernel/signaldata/DictTabInfo.hpp | 1 - 1 file changed, 1 deletion(-) diff --git a/ndb/include/kernel/signaldata/DictTabInfo.hpp b/ndb/include/kernel/signaldata/DictTabInfo.hpp index 6b4a3f34553..ae78c023c2a 100644 --- a/ndb/include/kernel/signaldata/DictTabInfo.hpp +++ b/ndb/include/kernel/signaldata/DictTabInfo.hpp @@ -51,7 +51,6 @@ class DictTabInfo { friend class Trix; friend class DbUtil; // API - friend class Table; friend class NdbSchemaOp; /** From 52487afa1ff27c19ad4ad12128a20f3336574363 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 1 Nov 2004 13:01:20 +0100 Subject: [PATCH 0057/1063] NDB blob fixes. INCOMPATIBLE with existing blobs ndb/src/ndbapi/NdbBlob.cpp: misplaced code line + change blob tabledist ndb/test/ndbapi/testBlobs.cpp: misplaced code line + change blob tabledist --- ndb/src/ndbapi/NdbBlob.cpp | 43 ++++++++++++++++++----------------- ndb/test/ndbapi/testBlobs.cpp | 7 ++++++ 2 files changed, 29 insertions(+), 21 deletions(-) diff --git a/ndb/src/ndbapi/NdbBlob.cpp b/ndb/src/ndbapi/NdbBlob.cpp index 5b193870558..13532a413bb 100644 --- a/ndb/src/ndbapi/NdbBlob.cpp +++ b/ndb/src/ndbapi/NdbBlob.cpp @@ -97,6 +97,14 @@ NdbBlob::getBlobTable(NdbTableImpl& bt, const NdbTableImpl* t, const NdbColumnIm bt.setName(btname); bt.setLogging(t->getLogging()); bt.setFragmentType(t->getFragmentType()); + { NdbDictionary::Column bc("PK"); + bc.setType(NdbDictionary::Column::Unsigned); + assert(t->m_sizeOfKeysInWords != 0); + bc.setLength(t->m_sizeOfKeysInWords); + bc.setPrimaryKey(true); + bc.setDistributionKey(true); + bt.addColumn(bc); + } { NdbDictionary::Column bc("DIST"); bc.setType(NdbDictionary::Column::Unsigned); bc.setPrimaryKey(true); @@ -108,13 +116,6 @@ NdbBlob::getBlobTable(NdbTableImpl& bt, const NdbTableImpl* t, const NdbColumnIm bc.setPrimaryKey(true); bt.addColumn(bc); } - { NdbDictionary::Column bc("PK"); - bc.setType(NdbDictionary::Column::Unsigned); - assert(t->m_sizeOfKeysInWords != 0); - bc.setLength(t->m_sizeOfKeysInWords); - bc.setPrimaryKey(true); - bt.addColumn(bc); - } { NdbDictionary::Column bc("DATA"); switch (c->m_type) { case NdbDictionary::Column::Blob: @@ -392,9 +393,9 @@ NdbBlob::setPartKeyValue(NdbOperation* anOp, Uint32 part) Uint32* data = (Uint32*)theKeyBuf.data; unsigned size = theTable->m_sizeOfKeysInWords; DBG("setPartKeyValue dist=" << getDistKey(part) << " part=" << part << " key=" << ndb_blob_debug(data, size)); - if (anOp->equal((Uint32)0, getDistKey(part)) == -1 || - anOp->equal((Uint32)1, part) == -1 || - anOp->equal((Uint32)2, theKeyBuf.data) == -1) { + if (anOp->equal((Uint32)0, theKeyBuf.data) == -1 || + anOp->equal((Uint32)1, getDistKey(part)) == -1 || + anOp->equal((Uint32)2, part) == -1) { setErrorCode(anOp); return -1; } @@ -676,7 +677,6 @@ NdbBlob::readDataPrivate(char* buf, Uint32& bytes) if (readParts(thePartBuf.data, part, 1) == -1) return -1; // need result now - DBG("execute pending part reads"); if (executePendingBlobReads() == -1) return -1; Uint32 n = thePartSize - off; @@ -710,7 +710,6 @@ NdbBlob::readDataPrivate(char* buf, Uint32& bytes) if (readParts(thePartBuf.data, part, 1) == -1) return -1; // need result now - DBG("execute pending part reads"); if (executePendingBlobReads() == -1) return -1; memcpy(buf, thePartBuf.data, len); @@ -773,14 +772,12 @@ NdbBlob::writeDataPrivate(const char* buf, Uint32 bytes) if (off != 0) { DBG("partial first block pos=" << pos << " len=" << len); // flush writes to guarantee correct read - DBG("execute pending part writes"); if (executePendingBlobWrites() == -1) return -1; Uint32 part = (pos - theInlineSize) / thePartSize; if (readParts(thePartBuf.data, part, 1) == -1) return -1; // need result now - DBG("execute pending part reads"); if (executePendingBlobReads() == -1) return -1; Uint32 n = thePartSize - off; @@ -824,13 +821,11 @@ NdbBlob::writeDataPrivate(const char* buf, Uint32 bytes) Uint32 part = (pos - theInlineSize) / thePartSize; if (theLength > pos + len) { // flush writes to guarantee correct read - DBG("execute pending part writes"); if (executePendingBlobWrites() == -1) return -1; if (readParts(thePartBuf.data, part, 1) == -1) return -1; // need result now - DBG("execute pending part reads"); if (executePendingBlobReads() == -1) return -1; memcpy(thePartBuf.data, buf, len); @@ -980,9 +975,11 @@ NdbBlob::deletePartsUnknown(Uint32 part) } tOp->m_abortOption = IgnoreError; n++; - if (theNdbCon->executeNoBlobs(NoCommit) == -1) - return -1; } + DBG("deletePartsUnknown: executeNoBlobs [in] bat=" << bat); + if (theNdbCon->executeNoBlobs(NoCommit) == -1) + return -1; + DBG("deletePartsUnknown: executeNoBlobs [out]"); n = 0; while (n < bat) { NdbOperation* tOp = tOpList[n]; @@ -1011,8 +1008,10 @@ NdbBlob::executePendingBlobReads() { Uint8 flags = (1 << NdbOperation::ReadRequest); if (thePendingBlobOps & flags) { + DBG("executePendingBlobReads: executeNoBlobs [in]"); if (theNdbCon->executeNoBlobs(NoCommit) == -1) return -1; + DBG("executePendingBlobReads: executeNoBlobs [out]"); thePendingBlobOps = 0; theNdbCon->thePendingBlobOps = 0; } @@ -1024,8 +1023,10 @@ NdbBlob::executePendingBlobWrites() { Uint8 flags = 0xFF & ~(1 << NdbOperation::ReadRequest); if (thePendingBlobOps & flags) { + DBG("executePendingBlobWrites: executeNoBlobs [in]"); if (theNdbCon->executeNoBlobs(NoCommit) == -1) return -1; + DBG("executePendingBlobWrites: executeNoBlobs [out]"); thePendingBlobOps = 0; theNdbCon->thePendingBlobOps = 0; } @@ -1037,10 +1038,10 @@ NdbBlob::executePendingBlobWrites() int NdbBlob::invokeActiveHook() { - DBG("invokeActiveHook"); + DBG("invokeActiveHook [in]"); assert(theState == Active && theActiveHook != NULL); int ret = (*theActiveHook)(this, theActiveHookArg); - DBG("invokeActiveHook ret=" << ret); + DBG("invokeActiveHook [out] ret=" << ret); if (ret != 0) { // no error is set on blob level return -1; @@ -1244,7 +1245,7 @@ NdbBlob::preExecute(ExecType anExecType, bool& batch) return -1; } } else { - NdbOperation* tOp = theNdbCon->getNdbIndexOperation(theAccessTable->m_index, theTable, theNdbOp); + NdbIndexOperation* tOp = theNdbCon->getNdbIndexOperation(theAccessTable->m_index, theTable, theNdbOp); if (tOp == NULL || tOp->readTuple() == -1 || setAccessKeyValue(tOp) == -1 || diff --git a/ndb/test/ndbapi/testBlobs.cpp b/ndb/test/ndbapi/testBlobs.cpp index f7ee7921229..08bf8a2fd4b 100644 --- a/ndb/test/ndbapi/testBlobs.cpp +++ b/ndb/test/ndbapi/testBlobs.cpp @@ -1232,6 +1232,13 @@ deleteScan(bool idx) // main +// from here on print always +#undef DBG +#define DBG(x) \ + do { \ + ndbout << "line " << __LINE__ << " " << x << endl; \ + } while (0) + static int testmain() { From a2e4768f2019f0d4ffb10ad6afcb443e15f99602 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 1 Nov 2004 13:55:43 +0000 Subject: [PATCH 0058/1063] aligned ndb versioning with mysql changed define SNPRINTF_RETURN_ZERO to SNPRINTF_RETURN_TRUNC added define NDB_INIT removed getarg, strlcat, strlcpy aligned ndb version with mysql version cpcd: removed old way of reading config file and replaced with mysql load_defaults changed from using getarg to my_getopts use mysql my_progname moved getarg to test BitKeeper/deleted/.del-strlcat.c~250851f8f1ac1c2c: Delete: ndb/src/common/util/strlcat.c BitKeeper/deleted/.del-strlcpy.c~43266e312d11c47b: Delete: ndb/src/common/util/strlcpy.c ndb/test/include/getarg.h: Rename: ndb/include/util/getarg.h -> ndb/test/include/getarg.h configure.in: aligned ndb versioning with mysql changed define SNPRINTF_RETURN_ZERO to SNPRINTF_RETURN_TRUNC ndb/include/ndb_global.h: added define NDB_INIT removed strlcpy, strlcat ndb/src/common/editline/sysunix.c: removed usage of strlcat ndb/src/common/util/Makefile.am: removed getarg, strlcat, strlcpy ndb/src/common/util/basestring_vsnprintf.c: changed define from SNPRINTF_RETURN_ZERO to SNPRINTF_RETURN_TRUNC ndb/src/common/util/socket_io.cpp: removed usage of strlcat ndb/src/common/util/version.c: aligned ndb version with mysql version ndb/src/cw/cpcd/common.cpp: removed old way of reading config file and replaced with mysql load_defaults ndb/src/cw/cpcd/common.hpp: removed old way of reading config file and replaced with mysql load_defaults ndb/src/cw/cpcd/main.cpp: changed from usin getarg to my_opts ndb/src/kernel/blocks/backup/restore/main.cpp: changed from usin getarg to my_opts ndb/src/kernel/error/ErrorReporter.cpp: use mysql my_progname ndb/src/kernel/main.cpp: removed const in main declaration ndb/src/kernel/vm/Configuration.cpp: changed from usin getarg to my_opts ndb/src/kernel/vm/Configuration.hpp: removed const in main declaration ndb/src/mgmclient/main.cpp: changed from usin getarg to my_opts ndb/src/mgmsrv/main.cpp: changed from usin getarg to my_opts ndb/src/ndbapi/Ndb.cpp: fixed compiler warnings ndb/test/run-test/Makefile.am: moved getarg to test ndb/test/src/Makefile.am: moved getarg to test ndb/test/src/getarg.c: moved strlcat and strlcpy into getarg.c ndb/tools/delete_all.cpp: changed from usin getarg to my_opts ndb/tools/desc.cpp: changed from usin getarg to my_opts ndb/tools/drop_index.cpp: changed from usin getarg to my_opts ndb/tools/drop_tab.cpp: changed from usin getarg to my_opts ndb/tools/listTables.cpp: changed from usin getarg to my_opts ndb/tools/select_all.cpp: changed from usin getarg to my_opts ndb/tools/select_count.cpp: changed from usin getarg to my_opts ndb/tools/waiter.cpp: changed from usin getarg to my_opts --- configure.in | 11 +- ndb/include/ndb_global.h | 9 +- ndb/include/util/ndb_opts.h | 57 ++++++ ndb/src/common/editline/sysunix.c | 9 +- ndb/src/common/util/Makefile.am | 4 +- ndb/src/common/util/basestring_vsnprintf.c | 9 +- ndb/src/common/util/socket_io.cpp | 39 ++-- ndb/src/common/util/strlcat.c | 48 ----- ndb/src/common/util/strlcpy.c | 57 ------ ndb/src/common/util/version.c | 1 + ndb/src/cw/cpcd/common.cpp | 63 ------- ndb/src/cw/cpcd/common.hpp | 3 +- ndb/src/cw/cpcd/main.cpp | 75 ++++---- ndb/src/kernel/blocks/backup/restore/main.cpp | 178 ++++++++++-------- ndb/src/kernel/error/ErrorReporter.cpp | 2 +- ndb/src/kernel/main.cpp | 8 +- ndb/src/kernel/vm/Configuration.cpp | 140 +++++++------- ndb/src/kernel/vm/Configuration.hpp | 2 +- ndb/src/mgmclient/main.cpp | 77 +++++--- ndb/src/mgmsrv/main.cpp | 114 ++++++----- ndb/src/ndbapi/Ndb.cpp | 7 +- ndb/{include/util => test/include}/getarg.h | 0 ndb/test/run-test/Makefile.am | 2 +- ndb/test/src/Makefile.am | 2 +- ndb/{src/common/util => test/src}/getarg.c | 32 +++- ndb/tools/delete_all.cpp | 73 ++++--- ndb/tools/desc.cpp | 82 +++++--- ndb/tools/drop_index.cpp | 70 ++++--- ndb/tools/drop_tab.cpp | 78 +++++--- ndb/tools/listTables.cpp | 106 ++++++----- ndb/tools/select_all.cpp | 122 +++++++----- ndb/tools/select_count.cpp | 82 +++++--- ndb/tools/waiter.cpp | 79 +++++--- 33 files changed, 918 insertions(+), 723 deletions(-) create mode 100644 ndb/include/util/ndb_opts.h delete mode 100644 ndb/src/common/util/strlcat.c delete mode 100644 ndb/src/common/util/strlcpy.c rename ndb/{include/util => test/include}/getarg.h (100%) rename ndb/{src/common/util => test/src}/getarg.c (97%) diff --git a/configure.in b/configure.in index 353e455dbac..fe487b15557 100644 --- a/configure.in +++ b/configure.in @@ -4,6 +4,7 @@ dnl Process this file with autoconf to produce a configure script. AC_INIT(sql/mysqld.cc) AC_CANONICAL_SYSTEM # The Docs Makefile.am parses this line! +# remember to also change ndb version below and update version.c in ndb AM_INIT_AUTOMAKE(mysql, 4.1.8) AM_CONFIG_HEADER(config.h) @@ -13,9 +14,9 @@ DOT_FRM_VERSION=6 SHARED_LIB_VERSION=14:0:0 # ndb version -NDB_VERSION_MAJOR=3 -NDB_VERSION_MINOR=5 -NDB_VERSION_BUILD=4 +NDB_VERSION_MAJOR=4 +NDB_VERSION_MINOR=1 +NDB_VERSION_BUILD=8 NDB_VERSION_STATUS="" # Set all version vars based on $VERSION. How do we do this more elegant ? @@ -1142,8 +1143,8 @@ dnl Is this the right match for DEC OSF on alpha? fi echo "Adding defines for OSF1" # gethostbyname_r is deprecated and doesn't work ok on OSF1 - CFLAGS="$CFLAGS -DUNDEF_HAVE_GETHOSTBYNAME_R -DSNPRINTF_RETURN_ZERO" - CXXFLAGS="$CXXFLAGS -DUNDEF_HAVE_GETHOSTBYNAME_R -DSNPRINTF_RETURN_ZERO" + CFLAGS="$CFLAGS -DUNDEF_HAVE_GETHOSTBYNAME_R -DSNPRINTF_RETURN_TRUNC" + CXXFLAGS="$CXXFLAGS -DUNDEF_HAVE_GETHOSTBYNAME_R -DSNPRINTF_RETURN_TRUNC" # fix to handle include of correctly on OSF1 with cxx compiler CXXFLAGS="$CXXFLAGS -I/usr/include/cxx -I/usr/include/cxx_cname -I/usr/include -I/usr/include.dtk" ;; diff --git a/ndb/include/ndb_global.h b/ndb/include/ndb_global.h index 09559f6ddff..bdd4e503cc5 100644 --- a/ndb/include/ndb_global.h +++ b/ndb/include/ndb_global.h @@ -82,19 +82,12 @@ extern "C" { /* call in main() - does not return on error */ extern int ndb_init(void); extern void ndb_end(int); +#define NDB_INIT(prog_name) {my_progname=(prog_name); ndb_init();} #ifndef HAVE_STRDUP extern char * strdup(const char *s); #endif -#ifndef HAVE_STRLCPY -extern size_t strlcpy (char *dst, const char *src, size_t dst_sz); -#endif - -#ifndef HAVE_STRLCAT -extern size_t strlcat (char *dst, const char *src, size_t dst_sz); -#endif - #ifndef HAVE_STRCASECMP extern int strcasecmp(const char *s1, const char *s2); extern int strncasecmp(const char *s1, const char *s2, size_t n); diff --git a/ndb/include/util/ndb_opts.h b/ndb/include/util/ndb_opts.h new file mode 100644 index 00000000000..6cba9c04449 --- /dev/null +++ b/ndb/include/util/ndb_opts.h @@ -0,0 +1,57 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef _NDB_OPTS_H +#define _NDB_OPTS_H + +#include +#include +#include +#include + +#ifndef DBUG_OFF +#define NDB_STD_OPTS(prog_name) \ + { "debug", '#', "Output debug log. Often this is 'd:t:o,filename'.", \ + 0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0 }, \ + { "usage", '?', "Display this help and exit.", \ + 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 }, \ + { "help", '?', "Display this help and exit.", \ + 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 }, \ + { "version", 'V', "Output version information and exit.", 0, 0, 0, \ + GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 }, \ + { "connect-string", 'c', \ + "Set connect string for connecting to ndb_mgmd. " \ + "=\"host=[;nodeid=]\". " \ + "Overides specifying entries in NDB_CONNECTSTRING and config file", \ + (gptr*) &opt_connect_str, (gptr*) &opt_connect_str, 0, \ + GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 } +#else +#define NDB_STD_OPTS(prog_name) \ + { "usage", '?', "Display this help and exit.", \ + 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 }, \ + { "help", '?', "Display this help and exit.", \ + 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 }, \ + { "version", 'V', "Output version information and exit.", 0, 0, 0, \ + GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 }, \ + { "connect-string", 'c', \ + "Set connect string for connecting to ndb_mgmd. " \ + "=\"host=[;nodeid=]\". " \ + "Overides specifying entries in NDB_CONNECTSTRING and config file", \ + (gptr*) &opt_connect_str, (gptr*) &opt_connect_str, 0, \ + GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 } +#endif + +#endif /*_NDB_OPTS_H */ diff --git a/ndb/src/common/editline/sysunix.c b/ndb/src/common/editline/sysunix.c index 000bca78dfc..1339e5769e2 100644 --- a/ndb/src/common/editline/sysunix.c +++ b/ndb/src/common/editline/sysunix.c @@ -138,6 +138,11 @@ rl_add_slash(char *path, char *p, size_t p_len) { struct stat Sb; - if (stat(path, &Sb) >= 0) - (void)strlcat(p, S_ISDIR(Sb.st_mode) ? "/" : " ", p_len); + if (stat(path, &Sb) >= 0) { + int len= strlen(p); + if (len+1 < p_len) { + p[len]= S_ISDIR(Sb.st_mode) ? '/' : ' '; + p[len+1]= 0; + } + } } diff --git a/ndb/src/common/util/Makefile.am b/ndb/src/common/util/Makefile.am index 0235adae7c9..61fd7992002 100644 --- a/ndb/src/common/util/Makefile.am +++ b/ndb/src/common/util/Makefile.am @@ -7,8 +7,8 @@ libgeneral_la_SOURCES = \ SocketServer.cpp SocketClient.cpp SocketAuthenticator.cpp\ OutputStream.cpp NdbOut.cpp BaseString.cpp Base64.cpp \ NdbSqlUtil.cpp new.cpp \ - uucode.c random.c getarg.c version.c \ - strdup.c strlcat.c strlcpy.c \ + uucode.c random.c version.c \ + strdup.c \ ConfigValues.cpp ndb_init.c basestring_vsnprintf.c include $(top_srcdir)/ndb/config/common.mk.am diff --git a/ndb/src/common/util/basestring_vsnprintf.c b/ndb/src/common/util/basestring_vsnprintf.c index 87ffb8ad146..c96d1a300e1 100644 --- a/ndb/src/common/util/basestring_vsnprintf.c +++ b/ndb/src/common/util/basestring_vsnprintf.c @@ -34,20 +34,19 @@ basestring_snprintf(char *str, size_t size, const char *format, ...) #ifdef HAVE_SNPRINTF #define BASESTRING_VSNPRINTF_FUNC(a,b,c,d) vsnprintf(a,b,c,d) #else - #define SNPRINTF_RETURN_ZERO + #define SNPRINTF_RETURN_TRUNC #define BASESTRING_VSNPRINTF_FUNC(a,b,c,d) my_vsnprintf(a,b,c,d) extern int my_vsnprintf(char *str, size_t size, const char *format, va_list ap); #endif - -#ifdef SNPRINTF_RETURN_ZERO +#ifdef SNPRINTF_RETURN_TRUNC static char basestring_vsnprintf_buf[16*1024]; #endif int basestring_vsnprintf(char *str, size_t size, const char *format, va_list ap) { int ret= BASESTRING_VSNPRINTF_FUNC(str, size, format, ap); -#ifdef SNPRINTF_RETURN_ZERO - if (ret == 0 && format != 0 && format[0] != '\0') { +#ifdef SNPRINTF_RETURN_TRUNC + if (ret == size-1) { ret= BASESTRING_VSNPRINTF_FUNC(basestring_vsnprintf_buf, sizeof(basestring_vsnprintf_buf), format, ap); diff --git a/ndb/src/common/util/socket_io.cpp b/ndb/src/common/util/socket_io.cpp index 6f4c7e63684..83a546de773 100644 --- a/ndb/src/common/util/socket_io.cpp +++ b/ndb/src/common/util/socket_io.cpp @@ -172,22 +172,21 @@ vprint_socket(NDB_SOCKET_TYPE socket, int timeout_millis, const char * fmt, va_list ap){ char buf[1000]; char *buf2 = buf; - size_t size = sizeof(buf); + size_t size; - if (fmt != 0) { + if (fmt != 0 && fmt[0] != 0) { size = BaseString::vsnprintf(buf, sizeof(buf), fmt, ap); /* Check if the output was truncated */ - if(size >= sizeof(buf)) { - buf2 = (char *)malloc(size+1); + if(size > sizeof(buf)) { + buf2 = (char *)malloc(size); if(buf2 == NULL) return -1; BaseString::vsnprintf(buf2, size, fmt, ap); - } else - size = sizeof(buf); + } } else - buf[0] = 0; + return 0; - int ret = write_socket(socket, timeout_millis, buf2, strlen(buf2)); + int ret = write_socket(socket, timeout_millis, buf2, size); if(buf2 != buf) free(buf2); return ret; @@ -199,23 +198,23 @@ vprintln_socket(NDB_SOCKET_TYPE socket, int timeout_millis, const char * fmt, va_list ap){ char buf[1000]; char *buf2 = buf; - size_t size = sizeof(buf); + size_t size; - if (fmt != 0) { - size = BaseString::vsnprintf(buf, sizeof(buf), fmt, ap); + if (fmt != 0 && fmt[0] != 0) { + size = BaseString::vsnprintf(buf, sizeof(buf), fmt, ap)+1;// extra byte for '/n' /* Check if the output was truncated */ - if(size >= sizeof(buf)-1) { - buf2 = (char *)malloc(size+2); + if(size > sizeof(buf)) { + buf2 = (char *)malloc(size); if(buf2 == NULL) return -1; - BaseString::vsnprintf(buf2, size+1, fmt, ap); - } else - size = sizeof(buf); - } else - buf[0] = 0; - strlcat(buf2, "\n", size+2); + BaseString::vsnprintf(buf2, size, fmt, ap); + } + } else { + size = 1; + } + buf2[size-1]='\n'; - int ret = write_socket(socket, timeout_millis, buf2, strlen(buf2)); + int ret = write_socket(socket, timeout_millis, buf2, size); if(buf2 != buf) free(buf2); return ret; diff --git a/ndb/src/common/util/strlcat.c b/ndb/src/common/util/strlcat.c deleted file mode 100644 index aa282abe48d..00000000000 --- a/ndb/src/common/util/strlcat.c +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 1995 - 1999 Kungliga Tekniska Högskolan - * (Royal Institute of Technology, Stockholm, Sweden). - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Institute nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include - -/* RCSID("$KTH: strlcat.c,v 1.1 2000/08/16 01:23:47 lha Exp $"); */ - - -#ifndef HAVE_STRLCAT - -size_t -strlcat (char *dst, const char *src, size_t dst_sz) -{ - size_t len = strlen(dst); - - return len + strlcpy (dst + len, src, dst_sz - len); -} -#endif diff --git a/ndb/src/common/util/strlcpy.c b/ndb/src/common/util/strlcpy.c deleted file mode 100644 index 97cff177d48..00000000000 --- a/ndb/src/common/util/strlcpy.c +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 1995 - 1999 Kungliga Tekniska Högskolan - * (Royal Institute of Technology, Stockholm, Sweden). - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. Neither the name of the Institute nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include - -/* RCSID("$KTH: strlcpy.c,v 1.1 2000/08/16 01:23:48 lha Exp $"); */ - -#ifndef HAVE_STRLCPY - -size_t -strlcpy (char *dst, const char *src, size_t dst_sz) -{ - size_t n; - char *p; - - for (p = dst, n = 0; - n + 1 < dst_sz && *src != '\0'; - ++p, ++src, ++n) - *p = *src; - *p = '\0'; - if (*src == '\0') - return n; - else - return n + strlen (src); -} - -#endif diff --git a/ndb/src/common/util/version.c b/ndb/src/common/util/version.c index f2b3d5bd522..82acd949c46 100644 --- a/ndb/src/common/util/version.c +++ b/ndb/src/common/util/version.c @@ -70,6 +70,7 @@ struct NdbUpGradeCompatible { #ifndef TEST_VERSION struct NdbUpGradeCompatible ndbCompatibleTable_full[] = { { MAKE_VERSION(3,5,2), MAKE_VERSION(3,5,1), UG_Exact }, + { MAKE_VERSION(4,1,8), MAKE_VERSION(3,5,4), UG_Exact }, /* Aligned version with MySQL */ { 0, 0, UG_Null } }; diff --git a/ndb/src/cw/cpcd/common.cpp b/ndb/src/cw/cpcd/common.cpp index cb1c0c37183..53c0e4d5a64 100644 --- a/ndb/src/cw/cpcd/common.cpp +++ b/ndb/src/cw/cpcd/common.cpp @@ -96,66 +96,3 @@ insert_file(const char * filename, class Properties& p){ if(f) fclose(f); return res; } - -int -parse_config_file(struct getargs args[], int num_arg, const Properties& p){ - Properties::Iterator it(&p); - for(const char * name = it.first(); name != 0; name = it.next()){ - bool found = false; - for(int i = 0; i #include +#if 0 #include +#endif extern int debug; @@ -30,6 +32,5 @@ int insert(const char * pair, class Properties & p); int insert_file(const char * filename, class Properties&); int insert_file(FILE *, class Properties&, bool break_on_empty = false); -int parse_config_file(struct getargs args[], int num_arg, const Properties& p); #endif /* ! __CPCD_COMMON_HPP_INCLUDED__ */ diff --git a/ndb/src/cw/cpcd/main.cpp b/ndb/src/cw/cpcd/main.cpp index 207b81bfa89..300b51d7b5a 100644 --- a/ndb/src/cw/cpcd/main.cpp +++ b/ndb/src/cw/cpcd/main.cpp @@ -15,13 +15,13 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include /* Needed for mkdir(2) */ +#include #include "CPCD.hpp" #include "APIService.hpp" #include #include #include -#include #include #include #include @@ -29,28 +29,44 @@ #include "common.hpp" static const char *work_dir = CPCD_DEFAULT_WORK_DIR; -static int port = CPCD_DEFAULT_TCP_PORT; -static int use_syslog = 0; +static int port; +static int use_syslog; static const char *logfile = NULL; static const char *config_file = CPCD_DEFAULT_CONFIG_FILE; static const char *user = 0; -static struct getargs args[] = { - { "work-dir", 'w', arg_string, &work_dir, - "Work directory", "directory" }, - { "port", 'p', arg_integer, &port, - "TCP port to listen on", "port" }, - { "syslog", 'S', arg_flag, &use_syslog, - "Log events to syslog", NULL}, - { "logfile", 'L', arg_string, &logfile, - "File to log events to", "file"}, - { "debug", 'D', arg_flag, &debug, - "Enable debug mode", NULL}, - { "config", 'c', arg_string, &config_file, "Config file", NULL }, - { "user", 'u', arg_string, &user, "Run as user", NULL } +static struct my_option my_long_options[] = +{ + { "work-dir", 'w', "Work directory", + (gptr*) &work_dir, (gptr*) &work_dir, 0, + GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, + { "port", 'p', "TCP port to listen on", + (gptr*) &port, (gptr*) &port, 0, + GET_INT, REQUIRED_ARG, CPCD_DEFAULT_TCP_PORT, 0, 0, 0, 0, 0 }, + { "syslog", 'S', "Log events to syslog", + (gptr*) &use_syslog, (gptr*) &use_syslog, 0, + GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 }, + { "logfile", 'L', "File to log events to", + (gptr*) &logfile, (gptr*) &logfile, 0, + GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, + { "debug", 'D', "Enable debug mode", + (gptr*) &debug, (gptr*) &debug, 0, + GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 }, + { "config", 'c', "Config file", + (gptr*) &config_file, (gptr*) &config_file, 0, + GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, + { "user", 'u', "Run as user", + (gptr*) &user, (gptr*) &user, 0, + GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} }; -static const int num_args = sizeof(args) / sizeof(args[0]); +static my_bool +get_one_option(int optid, const struct my_option *opt __attribute__((unused)), + char *argument) +{ + return 0; +} static CPCD * g_cpcd = 0; #if 0 @@ -59,23 +75,16 @@ extern "C" static void sig_child(int signo, siginfo_t*, void*); const char *progname = "ndb_cpcd"; -NDB_MAIN(ndb_cpcd){ - int optind = 0; +int main(int argc, char** argv){ + int save_argc= argc; + char** save_argv= argv; + const char *load_default_groups[]= { "ndb_cpcd",0 }; + MY_INIT(argv[0]); - if(getarg(args, num_args, argc, argv, &optind)) { - arg_printusage(args, num_args, progname, ""); - exit(1); - } - - Properties p; - insert_file(config_file, p); - if(parse_config_file(args, num_args, p)){ - ndbout_c("Invalid config file: %s", config_file); - exit(1); - } - - if(getarg(args, num_args, argc, argv, &optind)) { - arg_printusage(args, num_args, progname, ""); + load_defaults("ndb_cpcd",load_default_groups,&argc,&argv); + if (handle_options(&argc, &argv, my_long_options, get_one_option)) { + my_print_help(my_long_options); + my_print_variables(my_long_options); exit(1); } diff --git a/ndb/src/kernel/blocks/backup/restore/main.cpp b/ndb/src/kernel/blocks/backup/restore/main.cpp index f7b1479cc93..482212911cb 100644 --- a/ndb/src/kernel/blocks/backup/restore/main.cpp +++ b/ndb/src/kernel/blocks/backup/restore/main.cpp @@ -14,7 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include +#include +#include #include #include #include @@ -35,80 +36,107 @@ static Vector g_consumers; static const char* ga_backupPath = "." DIR_SEPARATOR; -static const char* ga_connect_NDB = NULL; +static const char* opt_connect_str= NULL; /** * print and restore flags */ static bool ga_restore = false; static bool ga_print = false; -bool -readArguments(const int argc, const char** argv) +static int _print = 0; +static int _print_meta = 0; +static int _print_data = 0; +static int _print_log = 0; +static int _restore_data = 0; +static int _restore_meta = 0; + +static struct my_option my_long_options[] = { + NDB_STD_OPTS("ndb_restore"), + { "connect", 'c', "same as --connect-string", + (gptr*) &opt_connect_str, (gptr*) &opt_connect_str, 0, + GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, + { "nodeid", 'n', "Backup files from node with id", + (gptr*) &ga_nodeId, (gptr*) &ga_nodeId, 0, + GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, + { "backupid", 'b', "Backup id", + (gptr*) &ga_backupId, (gptr*) &ga_backupId, 0, + GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, + { "restore_data", 'r', + "Restore table data/logs into NDB Cluster using NDBAPI", + (gptr*) &_restore_data, (gptr*) &_restore_data, 0, + GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 }, + { "restore_meta", 'm', + "Restore meta data into NDB Cluster using NDBAPI", + (gptr*) &_restore_meta, (gptr*) &_restore_meta, 0, + GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 }, + { "parallelism", 'p', + "No of parallel transactions during restore of data." + "(parallelism can be 1 to 1024)", + (gptr*) &ga_nParallelism, (gptr*) &ga_nParallelism, 0, + GET_INT, REQUIRED_ARG, 128, 0, 0, 0, 0, 0 }, + { "print", 256, "Print data and log to stdout", + (gptr*) &_print, (gptr*) &_print, 0, + GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 }, + { "print_data", 257, "Print data to stdout", + (gptr*) &_print_data, (gptr*) &_print_data, 0, + GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 }, + { "print_meta", 258, "Print meta data to stdout", + (gptr*) &_print_meta, (gptr*) &_print_meta, 0, + GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 }, + { "print_log", 259, "Print log to stdout", + (gptr*) &_print_log, (gptr*) &_print_log, 0, + GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 }, + { "dont_ignore_systab_0", 'f', + "Experimental. Do not ignore system table during restore.", + (gptr*) &ga_dont_ignore_systab_0, (gptr*) &ga_dont_ignore_systab_0, 0, + GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} +}; - int _print = 0; - int _print_meta = 0; - int _print_data = 0; - int _print_log = 0; - int _restore_data = 0; - int _restore_meta = 0; - - - struct getargs args[] = - { - { "connect", 'c', arg_string, &ga_connect_NDB, - "NDB Cluster connection", "\"nodeid=;host=\""}, - { "nodeid", 'n', arg_integer, &ga_nodeId, - "Backup files from node", "db node id"}, - { "backupid", 'b',arg_integer, &ga_backupId, "Backup id", "backup id"}, - { "print", '\0', arg_flag, &_print, - "Print data and log to stdout", "print data and log"}, - { "print_data", '\0', arg_flag, &_print_data, - "Print data to stdout", "print data"}, - { "print_meta", '\0', arg_flag, &_print_meta, - "Print meta data to stdout", "print meta data"}, - { "print_log", '\0', arg_flag, &_print_log, - "Print log to stdout", "print log"}, - { "restore_data", 'r', arg_flag, &_restore_data, - "Restore table data/logs into NDB Cluster using NDBAPI", - "Restore table data/log"}, - { "restore_meta", 'm', arg_flag, &_restore_meta, - "Restore meta data into NDB Cluster using NDBAPI", "Restore meta data"}, - { "parallelism", 'p', arg_integer, &ga_nParallelism, - "No of parallel transactions during restore of data." - "(parallelism can be 1 to 1024)", - "Parallelism"}, -#ifdef USE_MYSQL - { "use_mysql", '\0', arg_flag, &use_mysql, - "Restore meta data via mysql. Systab will be ignored. Data is restored " - "using NDBAPI.", "use mysql"}, - { "user", '\0', arg_string, &ga_user, "MySQL user", "Default: root"}, - { "password", '\0', arg_string, &ga_password, "MySQL user's password", - "Default: \"\" "}, - { "host", '\0', arg_string, &ga_host, "Hostname of MySQL server", - "Default: localhost"}, - { "socket", '\0', arg_string, &ga_socket, "Path to MySQL server socket file", - "Default: /tmp/mysql.sock"}, - { "port", '\0', arg_integer, &ga_port, "Port number of MySQL server", - "Default: 3306"}, -#endif - { "dont_ignore_systab_0", 'f', arg_flag, &ga_dont_ignore_systab_0, - "Experimental. Do not ignore system table during restore.", - "dont_ignore_systab_0"} - - }; - - int num_args = sizeof(args) / sizeof(args[0]); - int optind = 0; - - if (getarg(args, num_args, argc, argv, &optind) || +static void short_usage_sub(void) +{ + printf("Usage: %s [OPTIONS] []\n", my_progname); +} +static void print_version() +{ + printf("MySQL distrib %s, for %s (%s)\n",MYSQL_SERVER_VERSION,SYSTEM_TYPE,MACHINE_TYPE); +} +static void usage() +{ + short_usage_sub(); + print_version(); + my_print_help(my_long_options); + my_print_variables(my_long_options); +} +static my_bool +get_one_option(int optid, const struct my_option *opt __attribute__((unused)), + char *argument) +{ + switch (optid) { + case '#': + DBUG_PUSH(argument ? argument : "d:t:O,/tmp/ndb_restore.trace"); + break; + case 'V': + print_version(); + exit(0); + case '?': + usage(); + exit(0); + } + return 0; +} +bool +readArguments(int *pargc, char*** pargv) +{ + const char *load_default_groups[]= { "ndb_tools","ndb_restore",0 }; + load_defaults("my",load_default_groups,pargc,pargv); + if (handle_options(pargc, pargv, my_long_options, get_one_option) || ga_nodeId == 0 || ga_backupId == 0 || ga_nParallelism < 1 || - ga_nParallelism >1024) - { - arg_printusage(args, num_args, argv[0], "\n"); - return false; + ga_nParallelism >1024) { + exit(1); } BackupPrinter* printer = new BackupPrinter(); @@ -122,10 +150,6 @@ readArguments(const int argc, const char** argv) return false; } - /** - * Got segmentation fault when using the printer's attributes directly - * in getargs... Do not have the time to found out why... this is faster... - */ if (_print) { ga_print = true; @@ -169,15 +193,14 @@ readArguments(const int argc, const char** argv) g_consumers.push_back(c); } // Set backup file path - if (argv[optind] != NULL) + if (*pargv[0] != NULL) { - ga_backupPath = argv[optind]; + ga_backupPath = *pargv[0]; } return true; } - void clearConsumers() { @@ -204,19 +227,16 @@ free_data_callback() } int -main(int argc, const char** argv) +main(int argc, char** argv) { - ndb_init(); - if (!readArguments(argc, argv)) + NDB_INIT(argv[0]); + + if (!readArguments(&argc, &argv)) { return -1; } - if (ga_connect_NDB != NULL) - { - // Use connection string - Ndb::setConnectString(ga_connect_NDB); - } + Ndb::setConnectString(opt_connect_str); /** * we must always load meta data, even if we will only print it to stdout diff --git a/ndb/src/kernel/error/ErrorReporter.cpp b/ndb/src/kernel/error/ErrorReporter.cpp index 35c99b30994..35cd3f099d9 100644 --- a/ndb/src/kernel/error/ErrorReporter.cpp +++ b/ndb/src/kernel/error/ErrorReporter.cpp @@ -137,7 +137,7 @@ ErrorReporter::formatMessage(ErrorCategory type, faultID, (problemData == NULL) ? "" : problemData, objRef, - programName, + my_progname, processId, theNameOfTheTraceFile ? theNameOfTheTraceFile : ""); diff --git a/ndb/src/kernel/main.cpp b/ndb/src/kernel/main.cpp index fa44704807d..926647838c9 100644 --- a/ndb/src/kernel/main.cpp +++ b/ndb/src/kernel/main.cpp @@ -53,11 +53,9 @@ extern "C" void handler_error(int signum); // for process signal handling void systemInfo(const Configuration & conf, const LogLevel & ll); -const char programName[] = "NDB Kernel"; - -NDB_MAIN(ndb_kernel){ - - ndb_init(); +int main(int argc, char** argv) +{ + NDB_INIT(argv[0]); // Print to stdout/console g_eventLogger.createConsoleHandler(); g_eventLogger.setCategory("NDB"); diff --git a/ndb/src/kernel/vm/Configuration.cpp b/ndb/src/kernel/vm/Configuration.cpp index 706f60fd9cf..b3a436275f7 100644 --- a/ndb/src/kernel/vm/Configuration.cpp +++ b/ndb/src/kernel/vm/Configuration.cpp @@ -15,6 +15,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include +#include #include #include "Configuration.hpp" @@ -28,8 +29,6 @@ #include #include -#include - #include #include #include @@ -47,81 +46,86 @@ extern "C" { #include extern EventLogger g_eventLogger; -bool -Configuration::init(int argc, const char** argv){ - - /** - * Default values for arguments - */ - int _no_start = 0; - int _initial = 0; - const char* _connect_str = NULL; - int _daemon = 1; - int _no_daemon = 0; - int _help = 0; - int _print_version = 0; -#ifndef DBUG_OFF - const char *debug_option= 0; -#endif - - /** - * Arguments to NDB process - */ - - struct getargs args[] = { - { "version", 'v', arg_flag, &_print_version, "Print ndbd version", "" }, - { "nostart", 'n', arg_flag, &_no_start, - "Don't start ndbd immediately. Ndbd will await command from ndb_mgmd", "" }, - { "daemon", 'd', arg_flag, &_daemon, "Start ndbd as daemon (default)", "" }, - { "nodaemon", 0, arg_flag, &_no_daemon, "Do not start ndbd as daemon, provided for testing purposes", "" }, -#ifndef DBUG_OFF - { "debug", 0, arg_string, &debug_option, - "Specify debug options e.g. d:t:i:o,out.trace", "options" }, -#endif - { "initial", 0, arg_flag, &_initial, - "Perform initial start of ndbd, including cleaning the file system. Consult documentation before using this", "" }, - - { "connect-string", 'c', arg_string, &_connect_str, - "Set connect string for connecting to ndb_mgmd. =\"host=[;nodeid=]\". Overides specifying entries in NDB_CONNECTSTRING and config file", - "" }, - { "usage", '?', arg_flag, &_help, "Print help", "" } - }; - int num_args = sizeof(args) / sizeof(args[0]); - int optind = 0; - char desc[] = - "The MySQL Cluster kernel"; - - if(getarg(args, num_args, argc, argv, &optind) || _help) { - arg_printusage(args, num_args, argv[0], desc); - for (int i = 0; i < argc; i++) { - if (strcmp("-i",argv[i]) == 0) { - printf("flag depricated %s, use %s\n", "-i", "--initial"); - } - } - return false; +static const char* opt_connect_str= 0; +static int _daemon, _no_daemon, _initial, _no_start; +/** + * Arguments to NDB process + */ +static struct my_option my_long_options[] = +{ + NDB_STD_OPTS("ndbd"), + { "initial", 256, + "Perform initial start of ndbd, including cleaning the file system. " + "Consult documentation before using this", + (gptr*) &_initial, (gptr*) &_initial, 0, + GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 }, + { "nostart", 'n', + "Don't start ndbd immediately. Ndbd will await command from ndb_mgmd", + (gptr*) &_no_start, (gptr*) &_no_start, 0, + GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 }, + { "daemon", 'd', "Start ndbd as daemon (default)", + (gptr*) &_daemon, (gptr*) &_daemon, 0, + GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0 }, + { "nodaemon", 257, + "Do not start ndbd as daemon, provided for testing purposes", + (gptr*) &_no_daemon, (gptr*) &_no_daemon, 0, + GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} +}; +static void short_usage_sub(void) +{ + printf("Usage: %s [OPTIONS]\n", my_progname); +} +static void print_version() +{ + printf("MySQL distrib %s, for %s (%s)\n",MYSQL_SERVER_VERSION,SYSTEM_TYPE,MACHINE_TYPE); +} +static void usage() +{ + short_usage_sub(); + print_version(); + my_print_help(my_long_options); + my_print_variables(my_long_options); +} +static my_bool +get_one_option(int optid, const struct my_option *opt __attribute__((unused)), + char *argument) +{ + switch (optid) { + case '#': + DBUG_PUSH(argument ? argument : "d:t:O,/tmp/ndbd.trace"); + break; + case 'V': + print_version(); + exit(0); + case '?': + usage(); + exit(0); } + return 0; +} + +bool +Configuration::init(int argc, char** argv) +{ + const char *load_default_groups[]= { "ndbd",0 }; + load_defaults("my",load_default_groups,&argc,&argv); + + int ho_error; + if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option))) + exit(ho_error); + if (_no_daemon) { _daemon= 0; } - // check for depricated flag '-i' - -#ifndef DBUG_OFF - if (debug_option) - DBUG_PUSH(debug_option); -#endif DBUG_PRINT("info", ("no_start=%d", _no_start)); DBUG_PRINT("info", ("initial=%d", _initial)); DBUG_PRINT("info", ("daemon=%d", _daemon)); - DBUG_PRINT("info", ("connect_str=%s", _connect_str)); + DBUG_PRINT("info", ("connect_str=%s", opt_connect_str)); ndbSetOwnVersion(); - if (_print_version) { - ndbPrintVersion(); - return false; - } - // Check the start flag if (_no_start) globalData.theRestartFlag = initial_state; @@ -133,8 +137,8 @@ Configuration::init(int argc, const char** argv){ _initialStart = true; // Check connectstring - if (_connect_str) - _connectString = strdup(_connect_str); + if (opt_connect_str) + _connectString = strdup(opt_connect_str); // Check daemon flag if (_daemon) diff --git a/ndb/src/kernel/vm/Configuration.hpp b/ndb/src/kernel/vm/Configuration.hpp index 2ea32ffea37..e4cd64f5ca8 100644 --- a/ndb/src/kernel/vm/Configuration.hpp +++ b/ndb/src/kernel/vm/Configuration.hpp @@ -31,7 +31,7 @@ public: /** * Returns false if arguments are invalid */ - bool init(int argc, const char** argv); + bool init(int argc, char** argv); void fetch_configuration(LocalConfig &local_config); void setupConfiguration(); diff --git a/ndb/src/mgmclient/main.cpp b/ndb/src/mgmclient/main.cpp index cc6d4bf600e..a37214d366b 100644 --- a/ndb/src/mgmclient/main.cpp +++ b/ndb/src/mgmclient/main.cpp @@ -15,11 +15,12 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include +#include #include #include -#include #include +#include #include #include "CommandInterpreter.hpp" @@ -43,28 +44,62 @@ handler(int sig){ } } -int main(int argc, const char** argv){ - ndb_init(); - int optind = 0; + +static unsigned _try_reconnect; +static char *opt_connect_str= 0; + +static struct my_option my_long_options[] = +{ + NDB_STD_OPTS("ndb_mgm"), + { "try-reconnect", 't', + "Specify number of retries for connecting to ndb_mgmd, default infinite", + (gptr*) &_try_reconnect, (gptr*) &_try_reconnect, 0, + GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} +}; +static void short_usage_sub(void) +{ + printf("Usage: %s [OPTIONS] [hostname [port]]\n", my_progname); +} +static void print_version() +{ + printf("MySQL distrib %s, for %s (%s)\n",MYSQL_SERVER_VERSION,SYSTEM_TYPE,MACHINE_TYPE); +} +static void usage() +{ + short_usage_sub(); + print_version(); + my_print_help(my_long_options); + my_print_variables(my_long_options); +} +static my_bool +get_one_option(int optid, const struct my_option *opt __attribute__((unused)), + char *argument) +{ + switch (optid) { + case '#': + DBUG_PUSH(argument ? argument : "d:t:O,/tmp/ndb_mgm.trace"); + break; + case 'V': + print_version(); + exit(0); + case '?': + usage(); + exit(0); + } + return 0; +} + +int main(int argc, char** argv){ + NDB_INIT(argv[0]); const char *_host = 0; int _port = 0; - int _help = 0; - int _try_reconnect = 0; - - struct getargs args[] = { - { "try-reconnect", 't', arg_integer, &_try_reconnect, "Specify number of retries for connecting to ndb_mgmd, default infinite", "#" }, - { "usage", '?', arg_flag, &_help, "Print help", "" }, - }; - int num_args = sizeof(args) / sizeof(args[0]); /* Number of arguments */ - - - if(getarg(args, num_args, argc, argv, &optind) || _help) { - arg_printusage(args, num_args, progname, "[host [port]]"); - exit(1); - } + const char *load_default_groups[]= { "ndb_mgm",0 }; - argv += optind; - argc -= optind; + load_defaults("my",load_default_groups,&argc,&argv); + int ho_error; + if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option))) + exit(ho_error); LocalConfig cfg; @@ -74,7 +109,7 @@ int main(int argc, const char** argv){ _port = atoi(argv[1]); } } else { - if(cfg.init(0, 0) && cfg.ids.size() > 0 && cfg.ids[0].type == MgmId_TCP){ + if(cfg.init(opt_connect_str, 0) && cfg.ids.size() > 0 && cfg.ids[0].type == MgmId_TCP){ _host = cfg.ids[0].name.c_str(); _port = cfg.ids[0].port; } else { diff --git a/ndb/src/mgmsrv/main.cpp b/ndb/src/mgmsrv/main.cpp index 5ee48e4cfcc..c1876f68ea2 100644 --- a/ndb/src/mgmsrv/main.cpp +++ b/ndb/src/mgmsrv/main.cpp @@ -15,6 +15,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include +#include #include "MgmtSrvr.hpp" #include "EventLogger.hpp" @@ -33,7 +34,6 @@ #include #include #include -#include #include @@ -97,41 +97,70 @@ bool g_StopServer; extern EventLogger g_EventLogger; extern int global_mgmt_server_check; -int _print_version = 0; -#ifndef DBUG_OFF -const char *debug_option= 0; -#endif +static char *opt_connect_str= 0; -struct getargs args[] = { - { "version", 'v', arg_flag, &_print_version, - "Print ndb_mgmd version",""}, - { "config-file", 'c', arg_string, &glob.config_filename, - "Specify cluster configuration file (default config.ini if available)", - "filename"}, -#ifndef DBUG_OFF - { "debug", 0, arg_string, &debug_option, - "Specify debug options e.g. d:t:i:o,out.trace", "options"}, -#endif - { "daemon", 'd', arg_flag, &glob.daemon, - "Run ndb_mgmd in daemon mode (default)",""}, - { NULL, 'l', arg_string, &glob.local_config_filename, - "Specify configuration file connect string (default Ndb.cfg if available)", - "filename"}, - { "interactive", 0, arg_flag, &glob.interactive, - "Run interactive. Not supported but provided for testing purposes", ""}, - { "no-nodeid-checks", 0, arg_flag, &g_no_nodeid_checks, - "Do not provide any node id checks", ""}, - { "nodaemon", 0, arg_flag, &glob.non_interactive, - "Don't run as daemon, but don't read from stdin", "non-interactive"} +static struct my_option my_long_options[] = +{ + NDB_STD_OPTS("ndb_mgmd"), + { "config-file", 'c', "Specify cluster configuration file", + (gptr*) &glob.config_filename, (gptr*) &glob.config_filename, 0, + GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, + { "daemon", 'd', "Run ndb_mgmd in daemon mode (default)", + (gptr*) &glob.daemon, (gptr*) &glob.daemon, 0, + GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0 }, + { "l", 'l', "Specify configuration file connect string (default Ndb.cfg if available)", + (gptr*) &glob.local_config_filename, (gptr*) &glob.local_config_filename, 0, + GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, + { "interactive", 256, "Run interactive. Not supported but provided for testing purposes", + (gptr*) &glob.interactive, (gptr*) &glob.interactive, 0, + GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 }, + { "no-nodeid-checks", 257, "Do not provide any node id checks", + (gptr*) &g_no_nodeid_checks, (gptr*) &g_no_nodeid_checks, 0, + GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 }, + { "nodaemon", 258, "Don't run as daemon, but don't read from stdin", + (gptr*) &glob.non_interactive, (gptr*) &glob.non_interactive, 0, + GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} }; - -int num_args = sizeof(args) / sizeof(args[0]); +static void short_usage_sub(void) +{ + printf("Usage: %s [OPTIONS]\n", my_progname); +} +static void print_version() +{ + printf("MySQL distrib %s, for %s (%s)\n",MYSQL_SERVER_VERSION,SYSTEM_TYPE,MACHINE_TYPE); +} +static void usage() +{ + short_usage_sub(); + print_version(); + my_print_help(my_long_options); + my_print_variables(my_long_options); +} +static my_bool +get_one_option(int optid, const struct my_option *opt __attribute__((unused)), + char *argument) +{ + switch (optid) { + case '#': + DBUG_PUSH(argument ? argument : "d:t:O,/tmp/ndb_mgmd.trace"); + break; + case 'V': + print_version(); + exit(0); + case '?': + usage(); + exit(0); + } + return 0; +} /* * MAIN */ -NDB_MAIN(mgmsrv){ - ndb_init(); +int main(int argc, char** argv) +{ + NDB_INIT(argv[0]); /** * OSE specific. Enable shared ownership of file system resources. @@ -143,31 +172,20 @@ NDB_MAIN(mgmsrv){ #endif global_mgmt_server_check = 1; + glob.config_filename= "config.ini"; - int optind = 0; - if(getarg(args, num_args, argc, argv, &optind)) { - arg_printusage(args, num_args, progname, ""); - exit(1); - } + const char *load_default_groups[]= { "ndb_mgmd",0 }; + load_defaults("my",load_default_groups,&argc,&argv); + + int ho_error; + if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option))) + exit(ho_error); if (glob.interactive || glob.non_interactive) { glob.daemon= 0; } -#ifndef DBUG_OFF - if (debug_option) - DBUG_PUSH(debug_option); -#endif - - if (_print_version) { - ndbPrintVersion(); - exit(0); - } - - if(glob.config_filename == NULL) { - glob.config_filename= "config.ini"; - } glob.socketServer = new SocketServer(); MgmApiService * mapi = new MgmApiService(); diff --git a/ndb/src/ndbapi/Ndb.cpp b/ndb/src/ndbapi/Ndb.cpp index d7b8a695fe2..75ae539fc8b 100644 --- a/ndb/src/ndbapi/Ndb.cpp +++ b/ndb/src/ndbapi/Ndb.cpp @@ -1386,6 +1386,7 @@ Ndb::printState(const char* fmt, ...) va_end(ap); NdbMutex_Lock(ndb_print_state_mutex); bool dups = false; + unsigned i; ndbout << buf << " ndb=" << hex << this << dec; #ifndef NDB_WIN32 ndbout << " thread=" << (int)pthread_self(); @@ -1406,21 +1407,21 @@ Ndb::printState(const char* fmt, ...) ndbout << "!! DUPS !!" << endl; dups = true; } - for (unsigned i = 0; i < theNoOfPreparedTransactions; i++) + for (i = 0; i < theNoOfPreparedTransactions; i++) thePreparedTransactionsArray[i]->printState(); ndbout << "sent: " << theNoOfSentTransactions<< endl; if (checkdups(theSentTransactionsArray, theNoOfSentTransactions)) { ndbout << "!! DUPS !!" << endl; dups = true; } - for (unsigned i = 0; i < theNoOfSentTransactions; i++) + for (i = 0; i < theNoOfSentTransactions; i++) theSentTransactionsArray[i]->printState(); ndbout << "completed: " << theNoOfCompletedTransactions<< endl; if (checkdups(theCompletedTransactionsArray, theNoOfCompletedTransactions)) { ndbout << "!! DUPS !!" << endl; dups = true; } - for (unsigned i = 0; i < theNoOfCompletedTransactions; i++) + for (i = 0; i < theNoOfCompletedTransactions; i++) theCompletedTransactionsArray[i]->printState(); NdbMutex_Unlock(ndb_print_state_mutex); } diff --git a/ndb/include/util/getarg.h b/ndb/test/include/getarg.h similarity index 100% rename from ndb/include/util/getarg.h rename to ndb/test/include/getarg.h diff --git a/ndb/test/run-test/Makefile.am b/ndb/test/run-test/Makefile.am index 3bf2edde47a..80e9e05eef7 100644 --- a/ndb/test/run-test/Makefile.am +++ b/ndb/test/run-test/Makefile.am @@ -11,7 +11,7 @@ test_SCRIPTS=atrt-analyze-result.sh atrt-gather-result.sh atrt-setup.sh \ atrt-clear-result.sh make-config.sh make-index.sh make-html-reports.sh atrt_SOURCES = main.cpp -INCLUDES_LOC = -I$(top_srcdir)/ndb/src/mgmclient +INCLUDES_LOC = -I$(top_srcdir)/ndb/test/include -I$(top_srcdir)/ndb/src/mgmclient LDADD_LOC = $(top_builddir)/ndb/src/mgmclient/CpcClient.o \ $(top_builddir)/ndb/src/libndbclient.la \ $(top_builddir)/dbug/libdbug.a \ diff --git a/ndb/test/src/Makefile.am b/ndb/test/src/Makefile.am index a513086dc33..a8f34a0ea22 100644 --- a/ndb/test/src/Makefile.am +++ b/ndb/test/src/Makefile.am @@ -9,7 +9,7 @@ libNDBT_a_SOURCES = \ HugoAsynchTransactions.cpp UtilTransactions.cpp \ NdbRestarter.cpp NdbRestarts.cpp NDBT_Output.cpp \ NdbBackup.cpp NdbConfig.cpp NdbGrep.cpp NDBT_Table.cpp \ - NdbSchemaCon.cpp NdbSchemaOp.cpp + NdbSchemaCon.cpp NdbSchemaOp.cpp getarg.c INCLUDES_LOC = -I$(top_srcdir)/ndb/src/common/mgmcommon -I$(top_srcdir)/ndb/include/mgmcommon -I$(top_srcdir)/ndb/include/kernel -I$(top_srcdir)/ndb/src/mgmapi diff --git a/ndb/src/common/util/getarg.c b/ndb/test/src/getarg.c similarity index 97% rename from ndb/src/common/util/getarg.c rename to ndb/test/src/getarg.c index 99b2840a5a6..9f03af69824 100644 --- a/ndb/src/common/util/getarg.c +++ b/ndb/test/src/getarg.c @@ -36,15 +36,33 @@ #include "getarg.h" -#define ISFLAG(X) ((X).type == arg_flag || (X).type == arg_negative_flag) - #ifndef HAVE_STRLCPY -extern size_t strlcpy (char *dst, const char *src, size_t dst_sz); -#endif /* !HAVE_STRLCPY */ - +static size_t +strlcpy (char *dst, const char *src, size_t dst_sz) +{ + size_t n; + char *p; + for (p = dst, n = 0; + n + 1 < dst_sz && *src != '\0'; + ++p, ++src, ++n) + *p = *src; + *p = '\0'; + if (*src == '\0') + return n; + else + return n + strlen (src); +} +#endif #ifndef HAVE_STRLCAT -extern size_t strlcat (char *dst, const char *src, size_t dst_sz); -#endif /* !HAVE_STRLCAT */ +static size_t +strlcat (char *dst, const char *src, size_t dst_sz) +{ + size_t len = strlen(dst); + return len + strlcpy (dst + len, src, dst_sz - len); +} +#endif + +#define ISFLAG(X) ((X).type == arg_flag || (X).type == arg_negative_flag) #ifndef max #define max(a, b) (a) > (b) ? (a) : (b) diff --git a/ndb/tools/delete_all.cpp b/ndb/tools/delete_all.cpp index aa5798376ae..a4fd73a5128 100644 --- a/ndb/tools/delete_all.cpp +++ b/ndb/tools/delete_all.cpp @@ -15,41 +15,65 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include +#include #include #include #include #include -#include - static int clear_table(Ndb* pNdb, const NdbDictionary::Table* pTab, int parallelism=240); -int main(int argc, const char** argv){ - ndb_init(); - - const char* _tabname = NULL; - const char* _dbname = "TEST_DB"; - int _help = 0; - - struct getargs args[] = { - { "usage", '?', arg_flag, &_help, "Print help", "" }, - { "database", 'd', arg_string, &_dbname, "dbname", - "Name of database table is in"} - }; - int num_args = sizeof(args) / sizeof(args[0]); - int optind = 0; +static const char* opt_connect_str= 0; +static const char* _dbname = "TEST_DB"; +static struct my_option my_long_options[] = +{ + NDB_STD_OPTS("ndb_desc"), + { "database", 'd', "Name of database table is in", + (gptr*) &_dbname, (gptr*) &_dbname, 0, + GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} +}; +static void print_version() +{ + printf("MySQL distrib %s, for %s (%s)\n",MYSQL_SERVER_VERSION,SYSTEM_TYPE,MACHINE_TYPE); +} +static void usage() +{ char desc[] = "tabname\n"\ "This program will delete all records in the specified table using scan delete.\n"; - - if(getarg(args, num_args, argc, argv, &optind) || - argv[optind] == NULL || _help) { - arg_printusage(args, num_args, argv[0], desc); - return NDBT_ProgramExit(NDBT_WRONGARGS); + print_version(); + my_print_help(my_long_options); + my_print_variables(my_long_options); +} +static my_bool +get_one_option(int optid, const struct my_option *opt __attribute__((unused)), + char *argument) +{ + switch (optid) { + case '#': + DBUG_PUSH(argument ? argument : "d:t:O,/tmp/ndb_delete_all.trace"); + break; + case 'V': + print_version(); + exit(0); + case '?': + usage(); + exit(0); } - _tabname = argv[optind]; + return 0; +} +int main(int argc, char** argv){ + NDB_INIT(argv[0]); + const char *load_default_groups[]= { "ndb_tools",0 }; + load_defaults("my",load_default_groups,&argc,&argv); + int ho_error; + if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option))) + return NDBT_ProgramExit(NDBT_WRONGARGS); + + Ndb::setConnectString(opt_connect_str); // Connect to Ndb Ndb MyNdb(_dbname); @@ -64,13 +88,12 @@ int main(int argc, const char** argv){ // Check if table exists in db int res = NDBT_OK; - for(int i = optind; i +#include +#include #include #include - - - -int main(int argc, const char** argv){ - ndb_init(); - const char* _tabname = NULL; - const char* _dbname = "TEST_DB"; - int _unqualified = 0; - int _help = 0; - - struct getargs args[] = { - { "unqualified", 'u', arg_flag, &_unqualified, "unqualified", - "Use unqualified table names"}, - { "database", 'd', arg_string, &_dbname, "dbname", - "Name of database table is in"}, - { "usage", '?', arg_flag, &_help, "Print help", "" } - }; - int num_args = sizeof(args) / sizeof(args[0]); - int optind = 0; +static const char* opt_connect_str= 0; +static const char* _dbname = "TEST_DB"; +static int _unqualified = 0; +static struct my_option my_long_options[] = +{ + NDB_STD_OPTS("ndb_desc"), + { "database", 'd', "Name of database table is in", + (gptr*) &_dbname, (gptr*) &_dbname, 0, + GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, + { "unqualified", 'u', "Use unqualified table names", + (gptr*) &_unqualified, (gptr*) &_unqualified, 0, + GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} +}; +static void print_version() +{ + printf("MySQL distrib %s, for %s (%s)\n",MYSQL_SERVER_VERSION,SYSTEM_TYPE,MACHINE_TYPE); +} +static void usage() +{ char desc[] = "tabname\n"\ "This program list all properties of table(s) in NDB Cluster.\n"\ - " ex: desc T1 T2 T4\n"; - - if(getarg(args, num_args, argc, argv, &optind) || - argv[optind] == NULL ||_help) { - arg_printusage(args, num_args, argv[0], desc); - return NDBT_ProgramExit(NDBT_WRONGARGS); + " ex: desc T1 T2 T4\n"; + print_version(); + my_print_help(my_long_options); + my_print_variables(my_long_options); +} +static my_bool +get_one_option(int optid, const struct my_option *opt __attribute__((unused)), + char *argument) +{ + switch (optid) { + case '#': + DBUG_PUSH(argument ? argument : "d:t:O,/tmp/ndb_desc.trace"); + break; + case 'V': + print_version(); + exit(0); + case '?': + usage(); + exit(0); } - _tabname = argv[optind]; + return 0; +} + +int main(int argc, char** argv){ + NDB_INIT(argv[0]); + const char *load_default_groups[]= { "ndb_tools",0 }; + load_defaults("my",load_default_groups,&argc,&argv); + int ho_error; + if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option))) + return NDBT_ProgramExit(NDBT_WRONGARGS); + + Ndb::setConnectString(opt_connect_str); Ndb* pMyNdb; pMyNdb = new Ndb(_dbname); @@ -60,7 +86,7 @@ int main(int argc, const char** argv){ ndbout << endl; NdbDictionary::Dictionary * dict = pMyNdb->getDictionary(); - for (int i = optind; i < argc; i++) { + for (int i = 0; i < argc; i++) { NDBT_Table* pTab = (NDBT_Table*)dict->getTable(argv[i]); if (pTab != 0){ ndbout << (* pTab) << endl; diff --git a/ndb/tools/drop_index.cpp b/ndb/tools/drop_index.cpp index 70c29461c23..1d4b454682f 100644 --- a/ndb/tools/drop_index.cpp +++ b/ndb/tools/drop_index.cpp @@ -15,38 +15,66 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include +#include #include #include #include -#include - -int main(int argc, const char** argv){ - ndb_init(); - - const char* _tabname = NULL; - const char* _dbname = "TEST_DB"; - int _help = 0; - - struct getargs args[] = { - { "database", 'd', arg_string, &_dbname, "dbname", - "Name of database table is in"}, - { "usage", '?', arg_flag, &_help, "Print help", "" } - }; - int num_args = sizeof(args) / sizeof(args[0]); - int optind = 0; +static const char* opt_connect_str= 0; +static const char* _dbname = "TEST_DB"; +static struct my_option my_long_options[] = +{ + NDB_STD_OPTS("ndb_desc"), + { "database", 'd', "Name of database table is in", + (gptr*) &_dbname, (gptr*) &_dbname, 0, + GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} +}; +static void print_version() +{ + printf("MySQL distrib %s, for %s (%s)\n",MYSQL_SERVER_VERSION,SYSTEM_TYPE,MACHINE_TYPE); +} +static void usage() +{ char desc[] = "+\n"\ "This program will drop index(es) in Ndb\n"; + print_version(); + my_print_help(my_long_options); + my_print_variables(my_long_options); +} +static my_bool +get_one_option(int optid, const struct my_option *opt __attribute__((unused)), + char *argument) +{ + switch (optid) { + case '#': + DBUG_PUSH(argument ? argument : "d:t:O,/tmp/ndb_drop_index.trace"); + break; + case 'V': + print_version(); + exit(0); + case '?': + usage(); + exit(0); + } + return 0; +} - if(getarg(args, num_args, argc, argv, &optind) || - argv[optind] == NULL || _help){ - arg_printusage(args, num_args, argv[0], desc); +int main(int argc, char** argv){ + NDB_INIT(argv[0]); + const char *load_default_groups[]= { "ndb_tools",0 }; + load_defaults("my",load_default_groups,&argc,&argv); + int ho_error; + if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option))) + return NDBT_ProgramExit(NDBT_WRONGARGS); + if (argc < 1) { + usage(); return NDBT_ProgramExit(NDBT_WRONGARGS); } - _tabname = argv[optind]; + Ndb::setConnectString(opt_connect_str); // Connect to Ndb Ndb MyNdb(_dbname); if(MyNdb.init() != 0){ @@ -58,7 +86,7 @@ int main(int argc, const char** argv){ ndbout << "Waiting for ndb to become ready..." << endl; int res = 0; - for(int i = optind; idropIndex(argv[i], 0)) != 0){ diff --git a/ndb/tools/drop_tab.cpp b/ndb/tools/drop_tab.cpp index 15c229cb0fb..428730419fa 100644 --- a/ndb/tools/drop_tab.cpp +++ b/ndb/tools/drop_tab.cpp @@ -15,43 +15,67 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include +#include #include #include #include -#include - -int main(int argc, const char** argv){ - ndb_init(); - - const char* _tabname = NULL; - const char* _dbname = "TEST_DB"; - const char* _connectstr = NULL; - int _help = 0; - - struct getargs args[] = { - { "database", 'd', arg_string, &_dbname, "dbname", - "Name of database table is in"}, - { "connstr", 'c', arg_string, &_connectstr, "connect string", - "How to connect to NDB"}, - { "usage", '?', arg_flag, &_help, "Print help", "" } - }; - int num_args = sizeof(args) / sizeof(args[0]); - int optind = 0; +static const char* opt_connect_str= 0; +static const char* _dbname = "TEST_DB"; +static struct my_option my_long_options[] = +{ + NDB_STD_OPTS("ndb_desc"), + { "database", 'd', "Name of database table is in", + (gptr*) &_dbname, (gptr*) &_dbname, 0, + GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} +}; +static void print_version() +{ + printf("MySQL distrib %s, for %s (%s)\n",MYSQL_SERVER_VERSION,SYSTEM_TYPE,MACHINE_TYPE); + ndbPrintVersion(); +} +static void usage() +{ char desc[] = "tabname\n"\ "This program will drop one table in Ndb\n"; + print_version(); + my_print_help(my_long_options); + my_print_variables(my_long_options); +} +static my_bool +get_one_option(int optid, const struct my_option *opt __attribute__((unused)), + char *argument) +{ + switch (optid) { + case '#': + DBUG_PUSH(argument ? argument : "d:t:O,/tmp/ndb_drop_table.trace"); + break; + case 'V': + print_version(); + exit(0); + case '?': + usage(); + exit(0); + } + return 0; +} - if(getarg(args, num_args, argc, argv, &optind) || - argv[optind] == NULL || _help){ - arg_printusage(args, num_args, argv[0], desc); +int main(int argc, char** argv){ + NDB_INIT(argv[0]); + const char *load_default_groups[]= { "ndb_tools",0 }; + load_defaults("my",load_default_groups,&argc,&argv); + int ho_error; + if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option))) + return NDBT_ProgramExit(NDBT_WRONGARGS); + if (argc < 1) { + usage(); return NDBT_ProgramExit(NDBT_WRONGARGS); } - _tabname = argv[optind]; - - if (_connectstr) - Ndb::setConnectString(_connectstr); + + Ndb::setConnectString(opt_connect_str); Ndb MyNdb(_dbname); if(MyNdb.init() != 0){ ERR(MyNdb.getNdbError()); @@ -62,7 +86,7 @@ int main(int argc, const char** argv){ ndbout << "Waiting for ndb to become ready..." << endl; int res = 0; - for(int i = optind; idropTable(argv[i])) != 0){ diff --git a/ndb/tools/listTables.cpp b/ndb/tools/listTables.cpp index 4fc5bcd7f21..2fc34394a9c 100644 --- a/ndb/tools/listTables.cpp +++ b/ndb/tools/listTables.cpp @@ -22,7 +22,7 @@ */ #include -#include +#include #include #include @@ -161,39 +161,34 @@ list(const char * tabname, } } -#ifndef DBUG_OFF -const char *debug_option= 0; -#endif - -int main(int argc, const char** argv){ - ndb_init(); - int _loops = 1; - const char* _tabname = NULL; - const char* _dbname = "TEST_DB"; - int _type = 0; - int _help = 0; - const char* _connect_str = NULL; - - struct getargs args[] = { - { "loops", 'l', arg_integer, &_loops, "loops", - "Number of times to run(default = 1)" }, - { "unqualified", 'u', arg_flag, &_unqualified, "unqualified", - "Use unqualified table names"}, - { "database", 'd', arg_string, &_dbname, "dbname", - "Name of database table is in"}, - { "type", 't', arg_integer, &_type, "type", - "Type of objects to show, see NdbDictionary.hpp for numbers(default = 0)" }, - { "connect-string", 'c', arg_string, &_connect_str, - "Set connect string for connecting to ndb_mgmd. =\"host=[;nodeid=]\". Overides specifying entries in NDB_CONNECTSTRING and config file", - "" }, -#ifndef DBUG_OFF - { "debug", 0, arg_string, &debug_option, - "Specify debug options e.g. d:t:i:o,out.trace", "options" }, -#endif - { "usage", '?', arg_flag, &_help, "Print help", "" } - }; - int num_args = sizeof(args) / sizeof(args[0]); - int optind = 0; +static const char* opt_connect_str= 0; +static const char* _dbname = "TEST_DB"; +static int _loops; +static int _type; +static struct my_option my_long_options[] = +{ + NDB_STD_OPTS("ndb_desc"), + { "database", 'd', "Name of database table is in", + (gptr*) &_dbname, (gptr*) &_dbname, 0, + GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, + { "loops", 'l', "loops", + (gptr*) &_loops, (gptr*) &_loops, 0, + GET_INT, REQUIRED_ARG, 1, 0, 0, 0, 0, 0 }, + { "type", 't', "type", + (gptr*) &_type, (gptr*) &_type, 0, + GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, + { "unqualified", 'u', "Use unqualified table names", + (gptr*) &_unqualified, (gptr*) &_unqualified, 0, + GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} +}; +static void print_version() +{ + printf("MySQL distrib %s, for %s (%s)\n",MYSQL_SERVER_VERSION,SYSTEM_TYPE,MACHINE_TYPE); + ndbPrintVersion(); +} +static void usage() +{ char desc[] = "tabname\n"\ "This program list all system objects in NDB Cluster.\n"\ @@ -201,19 +196,42 @@ int main(int argc, const char** argv){ " ex: list_tables -t 2 would show all UserTables\n"\ "To show all indexes for a table write table name as final argument\n"\ " ex: list_tables T1\n"; - - if(getarg(args, num_args, argc, argv, &optind) || _help) { - arg_printusage(args, num_args, argv[0], desc); + print_version(); + my_print_help(my_long_options); + my_print_variables(my_long_options); +} +static my_bool +get_one_option(int optid, const struct my_option *opt __attribute__((unused)), + char *argument) +{ + switch (optid) { + case '#': + DBUG_PUSH(argument ? argument : "d:t:O,/tmp/ndb_show_tables.trace"); + break; + case 'V': + print_version(); + exit(0); + case '?': + usage(); + exit(0); + } + return 0; +} + +int main(int argc, char** argv){ + NDB_INIT(argv[0]); + const char* _tabname; + const char *load_default_groups[]= { "ndb_tools",0 }; + load_defaults("my",load_default_groups,&argc,&argv); + int ho_error; + if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option))) + return NDBT_ProgramExit(NDBT_WRONGARGS); + if ((_tabname = argv[0]) == 0) { + usage(); return NDBT_ProgramExit(NDBT_WRONGARGS); } - _tabname = argv[optind]; - -#ifndef DBUG_OFF - if (debug_option) - DBUG_PUSH(debug_option); -#endif - ndb_cluster_connection = new Ndb_cluster_connection(_connect_str); + ndb_cluster_connection = new Ndb_cluster_connection(opt_connect_str); ndb = new Ndb(ndb_cluster_connection, _dbname); if (ndb->init() != 0) fatal("init"); diff --git a/ndb/tools/select_all.cpp b/ndb/tools/select_all.cpp index 9f8108d9f32..758c1e48c88 100644 --- a/ndb/tools/select_all.cpp +++ b/ndb/tools/select_all.cpp @@ -16,6 +16,7 @@ #include +#include #include @@ -23,13 +24,8 @@ #include #include #include -#include #include -#ifndef DBUG_OFF -const char *debug_option= 0; -#endif - int scanReadRecords(Ndb*, const NdbDictionary::Table*, const NdbDictionary::Index*, @@ -40,39 +36,44 @@ int scanReadRecords(Ndb*, char delim, bool orderby); -int main(int argc, const char** argv){ - ndb_init(); - int _parallelism = 240; - const char* _delimiter = "\t"; - int _header = true; - int _useHexFormat = false; - const char* _tabname = NULL; - const char* _dbname = "TEST_DB"; - int _help = 0; - int _lock = 0; - int _order = 0; +static const char* opt_connect_str= 0; +static const char* _dbname = "TEST_DB"; +static const char* _delimiter = "\t"; +static int _unqualified, _header, _parallelism, _useHexFormat, _lock, + _order; - struct getargs args[] = { - { "database", 'd', arg_string, &_dbname, "dbname", - "Name of database table is in"}, - { "parallelism", 'p', arg_integer, &_parallelism, "parallelism", - "parallelism" }, - { "header", 'h', arg_flag, &_header, "Print header", "header" }, - { "useHexFormat", 'x', arg_flag, &_useHexFormat, - "Output numbers in hexadecimal format", "useHexFormat" }, - { "delimiter", 'd', arg_string, &_delimiter, "Column delimiter", - "delimiter" }, -#ifndef DBUG_OFF - { "debug", 0, arg_string, &debug_option, - "Specify debug options e.g. d:t:i:o,out.trace", "options" }, -#endif - { "usage", '?', arg_flag, &_help, "Print help", "" }, - { "lock", 'l', arg_integer, &_lock, - "Read(0), Read-hold(1), Exclusive(2)", "lock"}, - { "order", 'o', arg_flag, &_order, "Sort resultset according to index", ""} - }; - int num_args = sizeof(args) / sizeof(args[0]); - int optind = 0; +static struct my_option my_long_options[] = +{ + NDB_STD_OPTS("ndb_desc"), + { "database", 'd', "Name of database table is in", + (gptr*) &_dbname, (gptr*) &_dbname, 0, + GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, + { "parallelism", 'p', "parallelism", + (gptr*) &_parallelism, (gptr*) &_parallelism, 0, + GET_INT, REQUIRED_ARG, 240, 0, 0, 0, 0, 0 }, + { "lock", 'l', "Read(0), Read-hold(1), Exclusive(2)", + (gptr*) &_lock, (gptr*) &_lock, 0, + GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, + { "order", 'o', "Sort resultset according to index", + (gptr*) &_order, (gptr*) &_order, 0, + GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 }, + { "header", 'h', "Print header", + (gptr*) &_header, (gptr*) &_header, 0, + GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0 }, + { "useHexFormat", 'x', "Output numbers in hexadecimal format", + (gptr*) &_useHexFormat, (gptr*) &_useHexFormat, 0, + GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 }, + { "delimiter", 'D', "Column delimiter", + (gptr*) &_delimiter, (gptr*) &_delimiter, 0, + GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} +}; +static void print_version() +{ + printf("MySQL distrib %s, for %s (%s)\n",MYSQL_SERVER_VERSION,SYSTEM_TYPE,MACHINE_TYPE); +} +static void usage() +{ char desc[] = "tabname\n"\ "This program reads all records from one table in NDB Cluster\n"\ @@ -80,19 +81,42 @@ int main(int argc, const char** argv){ "(It only print error messages if it encounters a permanent error.)\n"\ "It can also be used to dump the content of a table to file \n"\ " ex: select_all --no-header --delimiter=';' T4 > T4.data\n"; - - if(getarg(args, num_args, argc, argv, &optind) || - argv[optind] == NULL || _help) { - arg_printusage(args, num_args, argv[0], desc); + print_version(); + my_print_help(my_long_options); + my_print_variables(my_long_options); +} +static my_bool +get_one_option(int optid, const struct my_option *opt __attribute__((unused)), + char *argument) +{ + switch (optid) { + case '#': + DBUG_PUSH(argument ? argument : "d:t:O,/tmp/ndb_select_all.trace"); + break; + case 'V': + print_version(); + exit(0); + case '?': + usage(); + exit(0); + } + return 0; +} + +int main(int argc, char** argv){ + NDB_INIT(argv[0]); + const char *load_default_groups[]= { "ndb_tools",0 }; + load_defaults("my",load_default_groups,&argc,&argv); + const char* _tabname; + int ho_error; + if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option))) + return NDBT_ProgramExit(NDBT_WRONGARGS); + if ((_tabname = argv[0]) == 0) { + usage(); return NDBT_ProgramExit(NDBT_WRONGARGS); } - _tabname = argv[optind]; - -#ifndef DBUG_OFF - if (debug_option) - DBUG_PUSH(debug_option); -#endif + Ndb::setConnectString(opt_connect_str); // Connect to Ndb Ndb MyNdb(_dbname); @@ -108,8 +132,8 @@ int main(int argc, const char** argv){ // Check if table exists in db const NdbDictionary::Table* pTab = NDBT_Table::discoverTableFromDb(&MyNdb, _tabname); const NdbDictionary::Index * pIdx = 0; - if(optind+1 < argc){ - pIdx = MyNdb.getDictionary()->getIndex(argv[optind+1], _tabname); + if(argc > 1){ + pIdx = MyNdb.getDictionary()->getIndex(argv[0], _tabname); } if(pTab == NULL){ diff --git a/ndb/tools/select_count.cpp b/ndb/tools/select_count.cpp index 6650421e637..6ee49ddbff0 100644 --- a/ndb/tools/select_count.cpp +++ b/ndb/tools/select_count.cpp @@ -16,6 +16,7 @@ #include +#include #include @@ -23,7 +24,6 @@ #include #include #include -#include #include static int @@ -32,34 +32,68 @@ select_count(Ndb* pNdb, const NdbDictionary::Table* pTab, int* count_rows, UtilTransactions::ScanLock lock); -int main(int argc, const char** argv){ - ndb_init(); - const char* _dbname = "TEST_DB"; - int _parallelism = 240; - int _help = 0; - int _lock = 0; - - struct getargs args[] = { - { "database", 'd', arg_string, &_dbname, "dbname", - "Name of database table is in"}, - { "parallelism", 's', arg_integer, &_parallelism, "parallelism", "parallelism" }, - { "usage", '?', arg_flag, &_help, "Print help", "" }, - { "lock", 'l', arg_integer, &_lock, - "Read(0), Read-hold(1), Exclusive(2)", "lock"} - - }; - int num_args = sizeof(args) / sizeof(args[0]); - int optind = 0; +static const char* opt_connect_str= 0; +static const char* _dbname = "TEST_DB"; +static int _parallelism = 240; +static int _lock = 0; +static struct my_option my_long_options[] = +{ + NDB_STD_OPTS("ndb_desc"), + { "database", 'd', "Name of database table is in", + (gptr*) &_dbname, (gptr*) &_dbname, 0, + GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, + { "parallelism", 'p', "parallelism", + (gptr*) &_parallelism, (gptr*) &_parallelism, 0, + GET_INT, REQUIRED_ARG, 240, 0, 0, 0, 0, 0 }, + { "lock", 'l', "Read(0), Read-hold(1), Exclusive(2)", + (gptr*) &_lock, (gptr*) &_lock, 0, + GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} +}; +static void print_version() +{ + printf("MySQL distrib %s, for %s (%s)\n",MYSQL_SERVER_VERSION,SYSTEM_TYPE,MACHINE_TYPE); +} +static void usage() +{ char desc[] = "tabname1 ... tabnameN\n"\ "This program will count the number of records in tables\n"; - - if(getarg(args, num_args, argc, argv, &optind) || - argv[optind] == NULL || _help) { - arg_printusage(args, num_args, argv[0], desc); + print_version(); + my_print_help(my_long_options); + my_print_variables(my_long_options); +} +static my_bool +get_one_option(int optid, const struct my_option *opt __attribute__((unused)), + char *argument) +{ + switch (optid) { + case '#': + DBUG_PUSH(argument ? argument : "d:t:O,/tmp/ndb_select_count.trace"); + break; + case 'V': + print_version(); + exit(0); + case '?': + usage(); + exit(0); + } + return 0; +} + +int main(int argc, char** argv){ + NDB_INIT(argv[0]); + const char *load_default_groups[]= { "ndb_tools",0 }; + load_defaults("my",load_default_groups,&argc,&argv); + int ho_error; + if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option))) + return NDBT_ProgramExit(NDBT_WRONGARGS); + if (argc < 1) { + usage(); return NDBT_ProgramExit(NDBT_WRONGARGS); } + Ndb::setConnectString(opt_connect_str); // Connect to Ndb Ndb MyNdb(_dbname); @@ -72,7 +106,7 @@ int main(int argc, const char** argv){ while(MyNdb.waitUntilReady() != 0) ndbout << "Waiting for ndb to become ready..." << endl; - for(int i = optind; i +#include + #include #include #include #include -#include #include #include "../include/mgmcommon/LocalConfig.hpp" @@ -29,34 +30,60 @@ int waitClusterStatus(const char* _addr, ndb_mgm_node_status _status, unsigned int _timeout); -int main(int argc, const char** argv){ - ndb_init(); - - const char* _hostName = NULL; - int _no_contact = 0; - int _help = 0; - int _timeout = 120; - - struct getargs args[] = { - { "timeout", 0, arg_integer, &_timeout, "Timeout to wait", "#" }, - { "no-contact", 0, arg_flag, &_no_contact, "Wait for cluster no contact", "" }, - { "usage", '?', arg_flag, &_help, "Print help", "" } - }; - - int num_args = sizeof(args) / sizeof(args[0]); - int optind = 0; - char desc[] = - "hostname:port\n"\ - "This program will connect to the mgmsrv of a NDB cluster.\n"\ - "It will then wait for all nodes to be started\n"; - - if(getarg(args, num_args, argc, argv, &optind) || _help) { - arg_printusage(args, num_args, argv[0], desc); - return NDBT_ProgramExit(NDBT_WRONGARGS); +static const char* opt_connect_str= 0; +static int _no_contact = 0; +static int _timeout = 120; +static struct my_option my_long_options[] = +{ + NDB_STD_OPTS("ndb_desc"), + { "no-contact", 'n', "Wait for cluster no contact", + (gptr*) &_no_contact, (gptr*) &_no_contact, 0, + GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 }, + { "timeout", 't', "Timeout to wait", + (gptr*) &_timeout, (gptr*) &_timeout, 0, + GET_INT, REQUIRED_ARG, 120, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} +}; +static void print_version() +{ + printf("MySQL distrib %s, for %s (%s)\n",MYSQL_SERVER_VERSION,SYSTEM_TYPE,MACHINE_TYPE); + ndbPrintVersion(); +} +static void usage() +{ + print_version(); + my_print_help(my_long_options); + my_print_variables(my_long_options); +} +static my_bool +get_one_option(int optid, const struct my_option *opt __attribute__((unused)), + char *argument) +{ + switch (optid) { + case '#': + DBUG_PUSH(argument ? argument : "d:t:O,/tmp/ndb_drop_table.trace"); + break; + case 'V': + print_version(); + exit(0); + case '?': + usage(); + exit(0); } + return 0; +} + +int main(int argc, char** argv){ + NDB_INIT(argv[0]); + const char *load_default_groups[]= { "ndb_tools",0 }; + load_defaults("my",load_default_groups,&argc,&argv); + const char* _hostName = NULL; + int ho_error; + if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option))) + return NDBT_ProgramExit(NDBT_WRONGARGS); char buf[255]; - _hostName = argv[optind]; + _hostName = argv[0]; if (_hostName == NULL){ LocalConfig lcfg; From 075cee0d495fed6fdf23951da4d641f6e48b5513 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 1 Nov 2004 14:25:07 +0000 Subject: [PATCH 0059/1063] configure.in: added flag on sun forte, -instances=static (check is only made for "non-gcc", hopefully enough) configure.in: added flag on sun forte, -instances=static (check is only made for "non-gcc", hopefully enough) --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index fe487b15557..95d241ad669 100644 --- a/configure.in +++ b/configure.in @@ -975,7 +975,7 @@ case $SYSTEM_TYPE-$MACHINE_TYPE-$ac_cv_prog_gcc in CXXFLAGS="$CXXFLAGS -DBIG_TABLES" ;; # workaround for Sun Forte compile problem for ndb - *solaris2.10*-sparc-no) + *solaris2.*-no) ndb_cxxflags_fix="$ndb_cxxflags_fix -instances=static" ;; *) ;; From a38490bb038d83edd12b215c0b85c16edaa41e26 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 1 Nov 2004 14:43:53 +0000 Subject: [PATCH 0060/1063] fix call of string::copy() if HAVE_FCONVERT is set --- sql/sql_string.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sql/sql_string.cc b/sql/sql_string.cc index 6b2bb07fb8c..c1701e7e9bf 100644 --- a/sql/sql_string.cc +++ b/sql/sql_string.cc @@ -142,7 +142,8 @@ bool String::set(double num,uint decimals, CHARSET_INFO *cs) buff[0]='-'; pos=buff; } - return copy(pos,(uint32) strlen(pos), &my_charset_latin1, cs); + uint dummy_errors; + return copy(pos,(uint32) strlen(pos), &my_charset_latin1, cs, &dummy_errors); } if (alloc((uint32) ((uint32) decpt+3+decimals))) return TRUE; From 04ff58d5e4837c28afca0eec91f9fb1b31b9cb02 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 1 Nov 2004 16:04:36 +0100 Subject: [PATCH 0061/1063] NDB blobs restore backwards compatibility ndb/src/ndbapi/NdbBlob.cpp: restore backwards compatibility --- ndb/src/ndbapi/NdbBlob.cpp | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/ndb/src/ndbapi/NdbBlob.cpp b/ndb/src/ndbapi/NdbBlob.cpp index 13532a413bb..731f32ba916 100644 --- a/ndb/src/ndbapi/NdbBlob.cpp +++ b/ndb/src/ndbapi/NdbBlob.cpp @@ -97,14 +97,6 @@ NdbBlob::getBlobTable(NdbTableImpl& bt, const NdbTableImpl* t, const NdbColumnIm bt.setName(btname); bt.setLogging(t->getLogging()); bt.setFragmentType(t->getFragmentType()); - { NdbDictionary::Column bc("PK"); - bc.setType(NdbDictionary::Column::Unsigned); - assert(t->m_sizeOfKeysInWords != 0); - bc.setLength(t->m_sizeOfKeysInWords); - bc.setPrimaryKey(true); - bc.setDistributionKey(true); - bt.addColumn(bc); - } { NdbDictionary::Column bc("DIST"); bc.setType(NdbDictionary::Column::Unsigned); bc.setPrimaryKey(true); @@ -116,6 +108,13 @@ NdbBlob::getBlobTable(NdbTableImpl& bt, const NdbTableImpl* t, const NdbColumnIm bc.setPrimaryKey(true); bt.addColumn(bc); } + { NdbDictionary::Column bc("PK"); + bc.setType(NdbDictionary::Column::Unsigned); + assert(t->m_sizeOfKeysInWords != 0); + bc.setLength(t->m_sizeOfKeysInWords); + bc.setPrimaryKey(true); + bt.addColumn(bc); + } { NdbDictionary::Column bc("DATA"); switch (c->m_type) { case NdbDictionary::Column::Blob: @@ -309,7 +308,7 @@ inline Uint32 NdbBlob::getDistKey(Uint32 part) { assert(theStripeSize != 0); - return part / theStripeSize; + return (part / theStripeSize) % theStripeSize; } // getters and setters @@ -393,9 +392,9 @@ NdbBlob::setPartKeyValue(NdbOperation* anOp, Uint32 part) Uint32* data = (Uint32*)theKeyBuf.data; unsigned size = theTable->m_sizeOfKeysInWords; DBG("setPartKeyValue dist=" << getDistKey(part) << " part=" << part << " key=" << ndb_blob_debug(data, size)); - if (anOp->equal((Uint32)0, theKeyBuf.data) == -1 || - anOp->equal((Uint32)1, getDistKey(part)) == -1 || - anOp->equal((Uint32)2, part) == -1) { + if (anOp->equal((Uint32)0, getDistKey(part)) == -1 || + anOp->equal((Uint32)1, part) == -1 || + anOp->equal((Uint32)2, theKeyBuf.data) == -1) { setErrorCode(anOp); return -1; } From 55974b50bf26d8178465c63bfabcdcebdbf56933 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 1 Nov 2004 19:01:50 +0300 Subject: [PATCH 0062/1063] Remove support for obsolete 4.1.1 prepared statements C API names: having approval for it since 4.1.4, I also have some assurance that very few people actually used this: to enable these calls a user had to #define HAVE_DEPRECATED_411_API and recompile the client library. include/mysql.h: remove defines for obsolete 4.1 prepared statements C API names libmysql/libmysql.c: Remove #ifdefed implementation of obsolete mysql_prepare call. --- include/mysql.h | 17 ----------------- libmysql/libmysql.c | 16 ---------------- 2 files changed, 33 deletions(-) diff --git a/include/mysql.h b/include/mysql.h index 1c886020fdb..156d749234b 100644 --- a/include/mysql.h +++ b/include/mysql.h @@ -642,23 +642,6 @@ typedef struct st_mysql_methods #endif } MYSQL_METHODS; -#ifdef HAVE_DEPRECATED_411_API -/* Deprecated calls (since MySQL 4.1.2) */ - -/* Use mysql_stmt_init + mysql_stmt_prepare instead */ -MYSQL_STMT * STDCALL mysql_prepare(MYSQL * mysql, const char *query, - unsigned long length); -#define mysql_execute mysql_stmt_execute -#define mysql_fetch mysql_stmt_fetch -#define mysql_fetch_column mysql_stmt_fetch_column -#define mysql_bind_param mysql_stmt_bind_param -#define mysql_bind_result mysql_stmt_bind_result -#define mysql_param_count mysql_stmt_param_count -#define mysql_param_result mysql_stmt_param_metadata -#define mysql_get_metadata mysql_stmt_result_metadata -#define mysql_send_long_data mysql_stmt_send_long_data - -#endif /* HAVE_DEPRECATED_411_API */ MYSQL_STMT * STDCALL mysql_stmt_init(MYSQL *mysql); int STDCALL mysql_stmt_prepare(MYSQL_STMT *stmt, const char *query, diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index 9195f0a5bc5..88f46ce19e7 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -1886,22 +1886,6 @@ my_bool cli_read_prepare_result(MYSQL *mysql, MYSQL_STMT *stmt) DBUG_RETURN(0); } -#ifdef HAVE_DEPRECATED_411_API -MYSQL_STMT * STDCALL mysql_prepare(MYSQL *mysql, const char *query, - unsigned long query_length) -{ - MYSQL_STMT *stmt; - DBUG_ENTER("mysql_prepare"); - - stmt= mysql_stmt_init(mysql); - if (stmt && mysql_stmt_prepare(stmt, query, query_length)) - { - mysql_stmt_close(stmt); - DBUG_RETURN(0); - } - DBUG_RETURN(stmt); -} -#endif /* Allocate memory and init prepared statement structure. From e823c99731d37a682030c02d06dc47a178717d5b Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 1 Nov 2004 18:15:45 +0100 Subject: [PATCH 0063/1063] Ensure that a source distribution contains 'libmysql/libmysql.def' which is needed for Netware ports. --- libmysql/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libmysql/Makefile.am b/libmysql/Makefile.am index fefed7f079c..3c4e98e5053 100644 --- a/libmysql/Makefile.am +++ b/libmysql/Makefile.am @@ -31,7 +31,7 @@ include $(srcdir)/Makefile.shared libmysqlclient_la_SOURCES = $(target_sources) libmysqlclient_la_LIBADD = $(target_libadd) libmysqlclient_la_LDFLAGS = $(target_ldflags) -EXTRA_DIST = Makefile.shared +EXTRA_DIST = Makefile.shared libmysql.def # This is called from the toplevel makefile link_sources: From bf30b006d30f1295df50419ab2c906a2aa6c9878 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 1 Nov 2004 18:21:57 +0000 Subject: [PATCH 0064/1063] fix for solaris forte -instances=static added libNDBT.a removed printout fixed error that ndb_show_tables required table name configure.in: fix for solaris forte -instances=static ndb/test/run-test/Makefile.am: added libNDBT.a ndb/tools/drop_tab.cpp: removed printout ndb/tools/listTables.cpp: removed printout fixed error that ndb_show_tables required table name ndb/tools/waiter.cpp: removed printout --- configure.in | 5 ++++- ndb/test/run-test/Makefile.am | 1 + ndb/tools/drop_tab.cpp | 1 - ndb/tools/listTables.cpp | 6 +----- ndb/tools/waiter.cpp | 1 - 5 files changed, 6 insertions(+), 8 deletions(-) diff --git a/configure.in b/configure.in index 95d241ad669..d63859720a3 100644 --- a/configure.in +++ b/configure.in @@ -974,8 +974,11 @@ case $SYSTEM_TYPE-$MACHINE_TYPE-$ac_cv_prog_gcc in CFLAGS="$CFLAGS -DBIG_TABLES" CXXFLAGS="$CXXFLAGS -DBIG_TABLES" ;; + *) ;; +esac +case $SYSTEM_TYPE-$ac_cv_prog_gcc in # workaround for Sun Forte compile problem for ndb - *solaris2.*-no) + *solaris*-no) ndb_cxxflags_fix="$ndb_cxxflags_fix -instances=static" ;; *) ;; diff --git a/ndb/test/run-test/Makefile.am b/ndb/test/run-test/Makefile.am index 80e9e05eef7..1eac96e7ac7 100644 --- a/ndb/test/run-test/Makefile.am +++ b/ndb/test/run-test/Makefile.am @@ -13,6 +13,7 @@ test_SCRIPTS=atrt-analyze-result.sh atrt-gather-result.sh atrt-setup.sh \ atrt_SOURCES = main.cpp INCLUDES_LOC = -I$(top_srcdir)/ndb/test/include -I$(top_srcdir)/ndb/src/mgmclient LDADD_LOC = $(top_builddir)/ndb/src/mgmclient/CpcClient.o \ + $(top_builddir)/ndb/test/src/libNDBT.a \ $(top_builddir)/ndb/src/libndbclient.la \ $(top_builddir)/dbug/libdbug.a \ $(top_builddir)/mysys/libmysys.a \ diff --git a/ndb/tools/drop_tab.cpp b/ndb/tools/drop_tab.cpp index 428730419fa..3362c7de47b 100644 --- a/ndb/tools/drop_tab.cpp +++ b/ndb/tools/drop_tab.cpp @@ -34,7 +34,6 @@ static struct my_option my_long_options[] = static void print_version() { printf("MySQL distrib %s, for %s (%s)\n",MYSQL_SERVER_VERSION,SYSTEM_TYPE,MACHINE_TYPE); - ndbPrintVersion(); } static void usage() { diff --git a/ndb/tools/listTables.cpp b/ndb/tools/listTables.cpp index 2fc34394a9c..05e864a35c4 100644 --- a/ndb/tools/listTables.cpp +++ b/ndb/tools/listTables.cpp @@ -185,7 +185,6 @@ static struct my_option my_long_options[] = static void print_version() { printf("MySQL distrib %s, for %s (%s)\n",MYSQL_SERVER_VERSION,SYSTEM_TYPE,MACHINE_TYPE); - ndbPrintVersion(); } static void usage() { @@ -226,10 +225,7 @@ int main(int argc, char** argv){ int ho_error; if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option))) return NDBT_ProgramExit(NDBT_WRONGARGS); - if ((_tabname = argv[0]) == 0) { - usage(); - return NDBT_ProgramExit(NDBT_WRONGARGS); - } + _tabname = argv[0]; ndb_cluster_connection = new Ndb_cluster_connection(opt_connect_str); ndb = new Ndb(ndb_cluster_connection, _dbname); diff --git a/ndb/tools/waiter.cpp b/ndb/tools/waiter.cpp index 1ff852b90cb..c9e76bb8ed3 100644 --- a/ndb/tools/waiter.cpp +++ b/ndb/tools/waiter.cpp @@ -47,7 +47,6 @@ static struct my_option my_long_options[] = static void print_version() { printf("MySQL distrib %s, for %s (%s)\n",MYSQL_SERVER_VERSION,SYSTEM_TYPE,MACHINE_TYPE); - ndbPrintVersion(); } static void usage() { From f8a875a2389215191daeaba7d93ac61a564bdb27 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 1 Nov 2004 22:27:29 +0000 Subject: [PATCH 0065/1063] removed unused member variable (probably causing some of the problems we've seen with ndb_mgmd) --- ndb/src/mgmsrv/MgmtSrvr.cpp | 1 - ndb/src/mgmsrv/MgmtSrvr.hpp | 1 - 2 files changed, 2 deletions(-) diff --git a/ndb/src/mgmsrv/MgmtSrvr.cpp b/ndb/src/mgmsrv/MgmtSrvr.cpp index 01dae3aeddb..2e30d73290b 100644 --- a/ndb/src/mgmsrv/MgmtSrvr.cpp +++ b/ndb/src/mgmsrv/MgmtSrvr.cpp @@ -407,7 +407,6 @@ MgmtSrvr::MgmtSrvr(NodeId nodeId, // signals to other management servers. _ownReference(0), m_local_config(local_config), - m_allocated_resources(*this), theSignalIdleList(NULL), theWaitState(WAIT_SUBSCRIBE_CONF), m_statisticsListner(this) diff --git a/ndb/src/mgmsrv/MgmtSrvr.hpp b/ndb/src/mgmsrv/MgmtSrvr.hpp index a5f21b6bc4a..c796e1e9219 100644 --- a/ndb/src/mgmsrv/MgmtSrvr.hpp +++ b/ndb/src/mgmsrv/MgmtSrvr.hpp @@ -534,7 +534,6 @@ private: Uint32 m_nextConfigGenerationNumber; NodeBitmask m_reserved_nodes; - Allocated_resources m_allocated_resources; struct in_addr m_connect_address[MAX_NODES]; //************************************************************************** From 46aa022aa6cf40801518d1be2c9e8e7ffcee9928 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 2 Nov 2004 09:00:46 +0400 Subject: [PATCH 0066/1063] ctype_sjis.result, ctype_sjis.test, ctype-sjis.c: Bug #6223 Japanese half-width kana characters get truncated. Bytes 0xA1..0xDF were not treated as a single byte sequence in a mistake. strings/ctype-sjis.c: Bug #6223 Japanese half-width kana characters get truncated. Bytes 0xA1..0xDF were not treated as a single byte sequence in a mistake. mysql-test/t/ctype_sjis.test: Bug #6223 Japanese half-width kana characters get truncated. Bytes 0xA1..0xDF were not treated as a single byte sequence in a mistake. mysql-test/r/ctype_sjis.result: Bug #6223 Japanese half-width kana characters get truncated. Bytes 0xA1..0xDF were not treated as a single byte sequence in a mistake. --- mysql-test/r/ctype_sjis.result | 11 +++++++++++ mysql-test/t/ctype_sjis.test | 11 +++++++++++ strings/ctype-sjis.c | 9 +++++++-- 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/ctype_sjis.result b/mysql-test/r/ctype_sjis.result index b0edbed1a41..944fa0602a9 100644 --- a/mysql-test/r/ctype_sjis.result +++ b/mysql-test/r/ctype_sjis.result @@ -60,3 +60,14 @@ hex(c) 9353 9373 drop table t1; +SET NAMES sjis; +CREATE TABLE t1 ( +c char(16) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=sjis; +insert into t1 values(0xb1),(0xb2),(0xb3); +select hex(c) from t1; +hex(c) +B1 +B2 +B3 +drop table t1; diff --git a/mysql-test/t/ctype_sjis.test b/mysql-test/t/ctype_sjis.test index c910812ef8a..a3a44789975 100644 --- a/mysql-test/t/ctype_sjis.test +++ b/mysql-test/t/ctype_sjis.test @@ -51,3 +51,14 @@ insert into t1 values (0x9353); insert into t1 values (0x9373); select hex(c) from t1; drop table t1; + +# +# Bug #6223 Japanese half-width kana characters get truncated +# +SET NAMES sjis; +CREATE TABLE t1 ( + c char(16) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=sjis; +insert into t1 values(0xb1),(0xb2),(0xb3); +select hex(c) from t1; +drop table t1; diff --git a/strings/ctype-sjis.c b/strings/ctype-sjis.c index 4176ff2e538..a8b5394f8c5 100644 --- a/strings/ctype-sjis.c +++ b/strings/ctype-sjis.c @@ -4581,14 +4581,19 @@ uint my_well_formed_len_sjis(CHARSET_INFO *cs __attribute__((unused)), */ if (((int8)b[0]) >= 0) { - /* Single byte character */ - b+= 1; + /* Single byte ascii character */ + b++; } else if (issjishead((uchar)*b) && (e-b)>1 && issjistail((uchar)b[1])) { /* Double byte character */ b+= 2; } + else if (((uchar)*b) >= 0xA1 && ((uchar)*b) <= 0xDF) + { + /* Half width kana */ + b++; + } else { /* Wrong byte sequence */ From 6a0ce3adbc776d5a62ffab636cc2a32c93c33e7e Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 2 Nov 2004 09:46:23 +0200 Subject: [PATCH 0067/1063] dict0load.c: Raise fatal semaphore wait timeout to 2 hours when we are printing the InnoDB table monitor output innobase/dict/dict0load.c: Raise fatal semaphore wait timeout to 2 hours when we are printing the InnoDB table monitor output --- innobase/dict/dict0load.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/innobase/dict/dict0load.c b/innobase/dict/dict0load.c index d430eadc97b..c2b778f77c3 100644 --- a/innobase/dict/dict0load.c +++ b/innobase/dict/dict0load.c @@ -20,6 +20,7 @@ Created 4/24/1996 Heikki Tuuri #include "dict0dict.h" #include "dict0boot.h" #include "srv0start.h" +#include "srv0srv.h" /************************************************************************ Finds the first table name in the given database. */ @@ -123,6 +124,13 @@ dict_print(void) ulint len; mtr_t mtr; + /* Enlarge the fatal semaphore wait timeout during the InnoDB table + monitor printout */ + + mutex_enter(&kernel_mutex); + srv_fatal_semaphore_wait_threshold += 7200; /* 2 hours */ + mutex_exit(&kernel_mutex); + mutex_enter(&(dict_sys->mutex)); mtr_start(&mtr); @@ -145,6 +153,12 @@ loop: mutex_exit(&(dict_sys->mutex)); + /* Restore the fatal semaphore wait timeout */ + + mutex_enter(&kernel_mutex); + srv_fatal_semaphore_wait_threshold -= 7200; /* 2 hours */ + mutex_exit(&kernel_mutex); + return; } From 7e06386ae1c28079a047fb132397b1e4c0499a41 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 2 Nov 2004 13:14:07 +0400 Subject: [PATCH 0068/1063] A fix (bug #6309: myisamchk compiled without debug support , --help shows vise versa bug #6380: mysqlcheck --help prints wrong --debug msg for non-debug version). client/mysqlcheck.c: A fix (bug #6380: mysqlcheck --help prints wrong --debug msg for non-debug version). myisam/myisamchk.c: A fix (bug #6309: myisamchk compiled without debug support , --help shows vise versa). --- client/mysqlcheck.c | 5 +++++ myisam/myisamchk.c | 8 ++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/client/mysqlcheck.c b/client/mysqlcheck.c index 8182b95fb83..c670b84db44 100644 --- a/client/mysqlcheck.c +++ b/client/mysqlcheck.c @@ -81,8 +81,13 @@ static struct my_option my_long_options[] = "To check several databases. Note the difference in usage; In this case no tables are given. All name arguments are regarded as databasenames.", (gptr*) &opt_databases, (gptr*) &opt_databases, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, +#ifdef DBUG_OFF + {"debug", '#', "This is a non-debug version. Catch this and exit.", + 0, 0, 0, GET_DISABLED, OPT_ARG, 0, 0, 0, 0, 0, 0}, +#else {"debug", '#', "Output debug log. Often this is 'd:t:o,filename'.", 0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, +#endif {"default-character-set", OPT_DEFAULT_CHARSET, "Set the default character set.", (gptr*) &default_charset, (gptr*) &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, diff --git a/myisam/myisamchk.c b/myisam/myisamchk.c index 648e29e1e9e..c89abca9cad 100644 --- a/myisam/myisamchk.c +++ b/myisam/myisamchk.c @@ -354,8 +354,12 @@ static void usage(void) puts("Description, check and repair of MyISAM tables."); puts("Used without options all tables on the command will be checked for errors"); printf("Usage: %s [OPTIONS] tables[.MYI]\n", my_progname_short); - printf("\nGlobal options:\n\ - -#, --debug=... Output debug log. Often this is 'd:t:o,filename'.\n\ + printf("\nGlobal options:\n"); +#ifndef DBUG_OFF + printf("\ + -#, --debug=... Output debug log. Often this is 'd:t:o,filename'.\n"); +#endif + printf("\ -?, --help Display this help and exit.\n\ -O, --set-variable var=option.\n\ Change the value of a variable. Please note that\n\ From 9c06c80dff5744ac0b1d214404c9d16f752e41bb Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 2 Nov 2004 13:21:11 +0200 Subject: [PATCH 0069/1063] ha_innodb.cc: Backport Jan's fix of the LOAD DATA INFILE REPLACE duplicate key error bug (Bug #5835) to 4.0 sql/ha_innodb.cc: Backport Jan's fix of the LOAD DATA INFILE REPLACE duplicate key error bug (Bug #5835) to 4.0 --- sql/ha_innodb.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index e747ff3210c..d57a9f73c91 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -2285,7 +2285,9 @@ ha_innobase::write_row( if (error == DB_DUPLICATE_KEY && (user_thd->lex.sql_command == SQLCOM_REPLACE || user_thd->lex.sql_command - == SQLCOM_REPLACE_SELECT)) { + == SQLCOM_REPLACE_SELECT + || (user_thd->lex.sql_command == SQLCOM_LOAD + && user_thd->lex.duplicates == DUP_REPLACE))) { skip_auto_inc_decr= TRUE; } From b3042ccbb44fe399a64cbbcbc5dc7f4ac0ef784b Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 2 Nov 2004 13:34:11 +0200 Subject: [PATCH 0070/1063] ha_innodb.cc: Correct English grammar sql/ha_innodb.cc: Correct English grammar --- sql/ha_innodb.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index 8d9ecb95fc0..0bcb7062437 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -2464,7 +2464,7 @@ ha_innobase::write_row( NOTE that a REPLACE command and LOAD DATA INFILE REPLACE handles a duplicate key error itself, and we must not decrement the autoinc counter - if we are performing a those statements. + if we are performing those statements. NOTE 2: if there was an error, for example a deadlock, which caused InnoDB to roll back the whole transaction already in the call of row_insert_for_mysql(), we may no From fc04692c8b5fb192b9be52d4672423aa41ebc6b1 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 2 Nov 2004 16:02:12 +0400 Subject: [PATCH 0071/1063] Many files: Allow mixing of different character sets for more SQL functions. item_func.h: Allow mixing of different character sets for more SQL functions.. sql/item_cmpfunc.cc: Allow mixing of different character sets for more SQL functions. sql/item_func.cc: Allow mixing of different character sets for more SQL functions. sql/item_func.h: Allow mixing of different character sets for more SQL functions.. sql/item_strfunc.cc: Allow mixing of different character sets for more SQL functions. sql/item.cc: Allow mixing of different character sets for more SQL functions. sql/item.h: Allow mixing of different character sets for more SQL functions. mysql-test/t/ctype_recoding.test: Allow mixing of different character sets for more SQL functions. mysql-test/r/ctype_recoding.result: Allow mixing of different character sets for more SQL functions. --- mysql-test/r/ctype_recoding.result | 54 +++++++++++++++ mysql-test/t/ctype_recoding.test | 26 +++++++ sql/item.cc | 41 +++++++++++ sql/item.h | 18 ++++- sql/item_cmpfunc.cc | 96 +++----------------------- sql/item_func.cc | 105 +++++++++++++++++++++++++---- sql/item_func.h | 3 +- sql/item_strfunc.cc | 58 +++++++++------- 8 files changed, 274 insertions(+), 127 deletions(-) diff --git a/mysql-test/r/ctype_recoding.result b/mysql-test/r/ctype_recoding.result index dc1f4c12e25..1c75988fd21 100644 --- a/mysql-test/r/ctype_recoding.result +++ b/mysql-test/r/ctype_recoding.result @@ -186,3 +186,57 @@ select * from t1 where a=_latin1' ERROR HY000: Illegal mix of collations (cp1251_general_ci,IMPLICIT) and (latin1_swedish_ci,COERCIBLE) for operation '=' drop table t1; set names latin1; +set names koi8r; +create table t1 (c1 char(10) character set cp1251); +insert into t1 values ('ß'); +select c1 from t1 where c1 between 'ß' and 'ß'; +c1 +ß +select ifnull(c1,'ß'), ifnull(null,c1) from t1; +ifnull(c1,'ß') ifnull(null,c1) +ß ß +select if(1,c1,'ö'), if(0,c1,'ö') from t1; +if(1,c1,'ö') if(0,c1,'ö') +ß ö +select coalesce('ö',c1), coalesce(null,c1) from t1; +coalesce('ö',c1) coalesce(null,c1) +ö ß +select least(c1,'ö'), greatest(c1,'ö') from t1; +least(c1,'ö') greatest(c1,'ö') +ö ß +select locate(c1,'ß'), locate('ß',c1) from t1; +locate(c1,'ß') locate('ß',c1) +1 1 +select field(c1,'ß'),field('ß',c1) from t1; +field(c1,'ß') field('ß',c1) +1 1 +select concat(c1,'ö'), concat('ö',c1) from t1; +concat(c1,'ö') concat('ö',c1) +ßö öß +select concat_ws(c1,'ö','ß'), concat_ws('ö',c1,'ß') from t1; +concat_ws(c1,'ö','ß') concat_ws('ö',c1,'ß') +ößß ßöß +select replace(c1,'ß','ö'), replace('ß',c1,'ö') from t1; +replace(c1,'ß','ö') replace('ß',c1,'ö') +ö ö +select substring_index(c1,'öößß',2) from t1; +substring_index(c1,'öößß',2) +ß +select elt(1,c1,'ö'),elt(1,'ö',c1) from t1; +elt(1,c1,'ö') elt(1,'ö',c1) +ß ö +select make_set(3,c1,'ö'), make_set(3,'ö',c1) from t1; +make_set(3,c1,'ö') make_set(3,'ö',c1) +ß,ö ö,ß +select insert(c1,1,2,'ö'),insert('ö',1,2,c1) from t1; +insert(c1,1,2,'ö') insert('ö',1,2,c1) +ö ß +select trim(c1 from 'ß'),trim('ß' from c1) from t1; +trim(c1 from 'ß') trim('ß' from c1) + +select lpad(c1,3,'ö'), lpad('ö',3,c1) from t1; +lpad(c1,3,'ö') lpad('ö',3,c1) +ööß ßßö +select rpad(c1,3,'ö'), rpad('ö',3,c1) from t1; +rpad(c1,3,'ö') rpad('ö',3,c1) +ßöö ößß diff --git a/mysql-test/t/ctype_recoding.test b/mysql-test/t/ctype_recoding.test index dab898e9f2c..0e5e954c720 100644 --- a/mysql-test/t/ctype_recoding.test +++ b/mysql-test/t/ctype_recoding.test @@ -153,3 +153,29 @@ select * from t1 where a=_latin1' drop table t1; set names latin1; +# +# Check more automatic conversion +# +set names koi8r; +create table t1 (c1 char(10) character set cp1251); +insert into t1 values ('ß'); +select c1 from t1 where c1 between 'ß' and 'ß'; +select ifnull(c1,'ß'), ifnull(null,c1) from t1; +select if(1,c1,'ö'), if(0,c1,'ö') from t1; +select coalesce('ö',c1), coalesce(null,c1) from t1; +select least(c1,'ö'), greatest(c1,'ö') from t1; +select locate(c1,'ß'), locate('ß',c1) from t1; +select field(c1,'ß'),field('ß',c1) from t1; +select concat(c1,'ö'), concat('ö',c1) from t1; +select concat_ws(c1,'ö','ß'), concat_ws('ö',c1,'ß') from t1; +select replace(c1,'ß','ö'), replace('ß',c1,'ö') from t1; +select substring_index(c1,'öößß',2) from t1; +select elt(1,c1,'ö'),elt(1,'ö',c1) from t1; +select make_set(3,c1,'ö'), make_set(3,'ö',c1) from t1; +select insert(c1,1,2,'ö'),insert('ö',1,2,c1) from t1; +select trim(c1 from 'ß'),trim('ß' from c1) from t1; +select lpad(c1,3,'ö'), lpad('ö',3,c1) from t1; +select rpad(c1,3,'ö'), rpad('ö',3,c1) from t1; +# TODO +#select case c1 when 'ß' then 'ß' when 'ö' then 'ö' else 'c' end from t1; +#select export_set(5,c1,'ö'), export_set(5,'ö',c1) from t1; diff --git a/sql/item.cc b/sql/item.cc index 46215fd78ed..7dc7e9e542c 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -205,6 +205,41 @@ bool Item::eq(const Item *item, bool binary_cmp) const } +Item *Item::safe_charset_converter(CHARSET_INFO *tocs) +{ + /* + Don't allow automatic conversion to non-Unicode charsets, + as it potentially loses data. + */ + if (!(tocs->state & MY_CS_UNICODE)) + return NULL; // safe conversion is not possible + return new Item_func_conv_charset(this, tocs); +} + + +Item *Item_string::safe_charset_converter(CHARSET_INFO *tocs) +{ + Item_string *conv; + uint conv_errors; + String tmp, cstr, *ostr= val_str(&tmp); + cstr.copy(ostr->ptr(), ostr->length(), ostr->charset(), tocs, &conv_errors); + if (conv_errors || !(conv= new Item_string(cstr.ptr(), cstr.length(), + cstr.charset(), + collation.derivation))) + { + /* + Safe conversion is not possible (or EOM). + We could not convert a string into the requested character set + without data loss. The target charset does not cover all the + characters from the string. Operation cannot be done correctly. + */ + return NULL; + } + conv->str_value.copy(); + return conv; +} + + bool Item_string::eq(const Item *item, bool binary_cmp) const { if (type() == item->type()) @@ -723,6 +758,12 @@ String *Item_null::val_str(String *str) } +Item *Item_null::safe_charset_converter(CHARSET_INFO *tocs) +{ + collation.set(tocs); + return this; +} + /*********************** Item_param related ******************************/ /* diff --git a/sql/item.h b/sql/item.h index 2c0c3306c44..fea3aa010a8 100644 --- a/sql/item.h +++ b/sql/item.h @@ -39,13 +39,22 @@ enum Derivation /* Flags for collation aggregation modes: - allow conversion to a superset - allow conversion of a coercible value (i.e. constant). + MY_COLL_ALLOW_SUPERSET_CONV - allow conversion to a superset + MY_COLL_ALLOW_COERCIBLE_CONV - allow conversion of a coercible value + (i.e. constant). + MY_COLL_ALLOW_CONV - allow any kind of conversion + (combintion of the above two) + MY_COLL_DISALLOW_NONE - don't allow return DERIVATION_NONE + (e.g. when aggregating for comparison) + MY_COLL_CMP_CONV - combination of MY_COLL_ALLOW_CONV + and MY_COLL_DISALLOW_NONE */ #define MY_COLL_ALLOW_SUPERSET_CONV 1 #define MY_COLL_ALLOW_COERCIBLE_CONV 2 - +#define MY_COLL_ALLOW_CONV 3 +#define MY_COLL_DISALLOW_NONE 4 +#define MY_COLL_CMP_CONV 7 class DTCollation { public: @@ -302,6 +311,7 @@ public: Field *tmp_table_field_from_field_type(TABLE *table); virtual Item *neg_transformer(THD *thd) { return NULL; } + virtual Item *safe_charset_converter(CHARSET_INFO *tocs); void delete_self() { cleanup(); @@ -447,6 +457,7 @@ public: Item *new_item() { return new Item_null(name); } bool is_null() { return 1; } void print(String *str) { str->append("NULL", 4); } + Item *safe_charset_converter(CHARSET_INFO *tocs); }; @@ -717,6 +728,7 @@ public: return new Item_string(name, str_value.ptr(), str_value.length(), &my_charset_bin); } + Item *safe_charset_converter(CHARSET_INFO *tocs); String *const_string() { return &str_value; } inline void append(char *str, uint length) { str_value.append(str, length); } void print(String *str); diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index d9db07e2289..701894cacb5 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -173,89 +173,11 @@ void Item_bool_func2::fix_length_and_dec() if (!args[0] || !args[1]) return; - /* - We allow to apply automatic character set conversion in some cases. - The conditions when conversion is possible are: - - arguments A and B have different charsets - - A wins according to coercibility rules - (i.e. a column is stronger than a string constant, - an explicit COLLATE clause is stronger than a column) - - character set of A is either superset for character set of B, - or B is a string constant which can be converted into the - character set of A without data loss. - - If all of the above is true, then it's possible to convert - B into the character set of A, and then compare according - to the collation of A. - */ - - uint32 dummy_offset; DTCollation coll; - if (args[0]->result_type() == STRING_RESULT && args[1]->result_type() == STRING_RESULT && - String::needs_conversion(0, args[0]->collation.collation, - args[1]->collation.collation, - &dummy_offset) && - !coll.set(args[0]->collation, args[1]->collation, - MY_COLL_ALLOW_SUPERSET_CONV | - MY_COLL_ALLOW_COERCIBLE_CONV)) - { - Item* conv= 0; - Item_arena *arena= thd->current_arena, backup; - uint strong= coll.strong; - uint weak= strong ? 0 : 1; - /* - In case we're in statement prepare, create conversion item - in its memory: it will be reused on each execute. - */ - if (arena->is_stmt_prepare()) - thd->set_n_backup_item_arena(arena, &backup); - if (args[weak]->type() == STRING_ITEM) - { - uint conv_errors; - String tmp, cstr, *ostr= args[weak]->val_str(&tmp); - cstr.copy(ostr->ptr(), ostr->length(), ostr->charset(), - args[strong]->collation.collation, &conv_errors); - if (conv_errors) - { - /* - We could not convert a string into the character set - of the stronger side of the operation without data loss. - It can happen if we tried to combine a column with a string - constant, and the column charset does not cover all the - characters from the string. Operation cannot be done - correctly. Return an error. - */ - my_coll_agg_error(args[0]->collation, args[1]->collation, - func_name()); - return; - } - conv= new Item_string(cstr.ptr(),cstr.length(),cstr.charset(), - args[weak]->collation.derivation); - ((Item_string*)conv)->str_value.copy(); - } - else - { - if (!(coll.collation->state & MY_CS_UNICODE)) - { - /* - Don't allow automatic conversion to non-Unicode charsets, - as it potentially loses data. - */ - my_coll_agg_error(args[0]->collation, args[1]->collation, - func_name()); - return; - } - conv= new Item_func_conv_charset(args[weak], - args[strong]->collation.collation); - conv->collation.set(args[weak]->collation.derivation); - conv->fix_fields(thd, 0, &conv); - } - if (arena->is_stmt_prepare()) - thd->restore_backup_item_arena(arena, &backup); - args[weak]= conv ? conv : args[weak]; - } + agg_arg_charsets(coll, args, 2, MY_COLL_CMP_CONV)) + return; // Make a special case of compare with fields to get nicer DATE comparisons @@ -871,7 +793,7 @@ void Item_func_between::fix_length_and_dec() return; agg_cmp_type(&cmp_type, args, 3); if (cmp_type == STRING_RESULT && - agg_arg_collations_for_comparison(cmp_collation, args, 3)) + agg_arg_charsets(cmp_collation, args, 3, MY_COLL_CMP_CONV)) return; /* @@ -987,7 +909,7 @@ Item_func_ifnull::fix_length_and_dec() decimals=max(args[0]->decimals,args[1]->decimals); agg_result_type(&cached_result_type, args, 2); if (cached_result_type == STRING_RESULT) - agg_arg_collations(collation, args, arg_count); + agg_arg_charsets(collation, args, arg_count, MY_COLL_CMP_CONV); else if (cached_result_type != REAL_RESULT) decimals= 0; @@ -1083,7 +1005,7 @@ Item_func_if::fix_length_and_dec() agg_result_type(&cached_result_type, args+1, 2); if (cached_result_type == STRING_RESULT) { - if (agg_arg_collations(collation, args+1, 2)) + if (agg_arg_charsets(collation, args+1, 2, MY_COLL_ALLOW_CONV)) return; } else @@ -1354,7 +1276,7 @@ void Item_func_case::fix_length_and_dec() agg_result_type(&cached_result_type, agg, nagg); if ((cached_result_type == STRING_RESULT) && - agg_arg_collations(collation, agg, nagg)) + agg_arg_charsets(collation, agg, nagg, MY_COLL_ALLOW_CONV)) return; @@ -1370,7 +1292,7 @@ void Item_func_case::fix_length_and_dec() nagg++; agg_cmp_type(&cmp_type, agg, nagg); if ((cmp_type == STRING_RESULT) && - agg_arg_collations_for_comparison(cmp_collation, agg, nagg)) + agg_arg_charsets(cmp_collation, agg, nagg, MY_COLL_CMP_CONV)) return; } @@ -1477,7 +1399,7 @@ void Item_func_coalesce::fix_length_and_dec() set_if_bigger(decimals,args[i]->decimals); } if (cached_result_type == STRING_RESULT) - agg_arg_collations(collation, args, arg_count); + agg_arg_charsets(collation, args, arg_count, MY_COLL_ALLOW_CONV); else if (cached_result_type != REAL_RESULT) decimals= 0; } @@ -2423,7 +2345,7 @@ Item_func_regex::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref) max_length= 1; decimals= 0; - if (agg_arg_collations(cmp_collation, args, 2)) + if (agg_arg_charsets(cmp_collation, args, 2, MY_COLL_CMP_CONV)) return 1; used_tables_cache=args[0]->used_tables() | args[1]->used_tables(); diff --git a/sql/item_func.cc b/sql/item_func.cc index 50843d3bf76..09d7e50eaa3 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -90,6 +90,12 @@ bool Item_func::agg_arg_collations(DTCollation &c, Item **av, uint count, return TRUE; } } + if ((flags & MY_COLL_DISALLOW_NONE) && + c.derivation == DERIVATION_NONE) + { + my_coll_agg_error(av, count, func_name()); + return TRUE; + } return FALSE; } @@ -98,15 +104,7 @@ bool Item_func::agg_arg_collations_for_comparison(DTCollation &c, Item **av, uint count, uint flags) { - if (agg_arg_collations(c, av, count, flags)) - return TRUE; - - if (c.derivation == DERIVATION_NONE) - { - my_coll_agg_error(av, count, func_name()); - return TRUE; - } - return FALSE; + return (agg_arg_collations(c, av, count, flags | MY_COLL_DISALLOW_NONE)); } @@ -119,6 +117,89 @@ eval_const_cond(COND *cond) } + +/* + Collect arguments' character sets together. + We allow to apply automatic character set conversion in some cases. + The conditions when conversion is possible are: + - arguments A and B have different charsets + - A wins according to coercibility rules + (i.e. a column is stronger than a string constant, + an explicit COLLATE clause is stronger than a column) + - character set of A is either superset for character set of B, + or B is a string constant which can be converted into the + character set of A without data loss. + + If all of the above is true, then it's possible to convert + B into the character set of A, and then compare according + to the collation of A. + + For functions with more than two arguments: + + collect(A,B,C) ::= collect(collect(A,B),C) +*/ + +bool Item_func::agg_arg_charsets(DTCollation &coll, + Item **args, uint nargs, uint flags) +{ + Item **arg, **last, *safe_args[2]; + if (agg_arg_collations(coll, args, nargs, flags)) + return TRUE; + + /* + For better error reporting: save the first and the second argument. + We need this only if the the number of args is 3 or 2: + - for a longer argument list, "Illegal mix of collations" + doesn't display each argument's characteristics. + - if nargs is 1, then this error cannot happen. + */ + if (nargs >=2 && nargs <= 3) + { + safe_args[0]= args[0]; + safe_args[1]= args[1]; + } + + THD *thd= current_thd; + Item_arena *arena= thd->current_arena, backup; + bool res= FALSE; + /* + In case we're in statement prepare, create conversion item + in its memory: it will be reused on each execute. + */ + if (arena->is_stmt_prepare()) + thd->set_n_backup_item_arena(arena, &backup); + + for (arg= args, last= args + nargs; arg < last; arg++) + { + Item* conv; + uint dummy_offset; + if (!String::needs_conversion(0, coll.collation, + (*arg)->collation.collation, + &dummy_offset)) + continue; + + if (!(conv= (*arg)->safe_charset_converter(coll.collation))) + { + if (nargs >=2 && nargs <= 3) + { + /* restore the original arguments for better error message */ + args[0]= safe_args[0]; + args[1]= safe_args[1]; + } + my_coll_agg_error(args, nargs, func_name()); + res= TRUE; + break; // we cannot return here, we need to restore "arena". + } + conv->fix_fields(thd, 0, &conv); + *arg= conv; + } + if (arena->is_stmt_prepare()) + thd->restore_backup_item_arena(arena, &backup); + return res; +} + + + void Item_func::set_arguments(List &list) { allowed_arg_cols= 1; @@ -1105,7 +1186,7 @@ void Item_func_min_max::fix_length_and_dec() cmp_type=item_cmp_type(cmp_type,args[i]->result_type()); } if (cmp_type == STRING_RESULT) - agg_arg_collations_for_comparison(collation, args, arg_count); + agg_arg_charsets(collation, args, arg_count, MY_COLL_CMP_CONV); } @@ -1259,7 +1340,7 @@ longlong Item_func_coercibility::val_int() void Item_func_locate::fix_length_and_dec() { maybe_null=0; max_length=11; - agg_arg_collations_for_comparison(cmp_collation, args, 2); + agg_arg_charsets(cmp_collation, args, 2, MY_COLL_CMP_CONV); } @@ -1358,7 +1439,7 @@ void Item_func_field::fix_length_and_dec() for (uint i=1; i < arg_count ; i++) cmp_type= item_cmp_type(cmp_type, args[i]->result_type()); if (cmp_type == STRING_RESULT) - agg_arg_collations_for_comparison(cmp_collation, args, arg_count); + agg_arg_charsets(cmp_collation, args, arg_count, MY_COLL_CMP_CONV); } diff --git a/sql/item_func.h b/sql/item_func.h index 963038227a2..ce2b34499d6 100644 --- a/sql/item_func.h +++ b/sql/item_func.h @@ -145,7 +145,8 @@ public: bool agg_arg_collations_for_comparison(DTCollation &c, Item **items, uint nitems, uint flags= 0); - + bool agg_arg_charsets(DTCollation &c, Item **items, uint nitems, + uint flags= 0); bool walk(Item_processor processor, byte *arg); }; diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 5eda89ef21e..81fff899ec7 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -346,7 +346,7 @@ void Item_func_concat::fix_length_and_dec() { max_length=0; - if (agg_arg_collations(collation, args, arg_count)) + if (agg_arg_charsets(collation, args, arg_count, MY_COLL_ALLOW_CONV)) return; for (uint i=0 ; i < arg_count ; i++) @@ -640,7 +640,7 @@ void Item_func_concat_ws::fix_length_and_dec() { max_length=0; - if (agg_arg_collations(collation, args, arg_count)) + if (agg_arg_charsets(collation, args, arg_count, MY_COLL_ALLOW_CONV)) return; /* @@ -848,7 +848,7 @@ void Item_func_replace::fix_length_and_dec() maybe_null=1; } - if (agg_arg_collations_for_comparison(collation, args, 3)) + if (agg_arg_charsets(collation, args, 3, MY_COLL_CMP_CONV)) return; } @@ -893,11 +893,13 @@ null: void Item_func_insert::fix_length_and_dec() { - if (collation.set(args[0]->collation, args[3]->collation)) - { - my_coll_agg_error(args[0]->collation, args[3]->collation, func_name()); - return; - } + Item *cargs[2]; + cargs[0]= args[0]; + cargs[1]= args[3]; + if (agg_arg_charsets(collation, cargs, 2, MY_COLL_ALLOW_CONV)) + return; + args[0]= cargs[0]; + args[3]= cargs[1]; max_length=args[0]->max_length+args[3]->max_length; if (max_length > MAX_BLOB_WIDTH) { @@ -1063,7 +1065,7 @@ void Item_func_substr_index::fix_length_and_dec() { max_length= args[0]->max_length; - if (agg_arg_collations_for_comparison(collation, args, 2)) + if (agg_arg_charsets(collation, args, 2, MY_COLL_CMP_CONV)) return; } @@ -1355,10 +1357,14 @@ void Item_func_trim::fix_length_and_dec() remove.set_ascii(" ",1); } else - if (collation.set(args[1]->collation, args[0]->collation) || - collation.derivation == DERIVATION_NONE) { - my_coll_agg_error(args[1]->collation, args[0]->collation, func_name()); + Item *cargs[2]; + cargs[0]= args[1]; + cargs[1]= args[0]; + if (agg_arg_charsets(collation, cargs, 2, MY_COLL_CMP_CONV)) + return; + args[0]= cargs[1]; + args[1]= cargs[0]; } } @@ -1679,7 +1685,7 @@ void Item_func_elt::fix_length_and_dec() max_length=0; decimals=0; - if (agg_arg_collations(collation, args+1, arg_count-1)) + if (agg_arg_charsets(collation, args+1, arg_count-1, MY_COLL_ALLOW_CONV)) return; for (uint i= 1 ; i < arg_count ; i++) @@ -1755,7 +1761,7 @@ void Item_func_make_set::fix_length_and_dec() { max_length=arg_count-1; - if (agg_arg_collations(collation, args, arg_count)) + if (agg_arg_charsets(collation, args, arg_count, MY_COLL_ALLOW_CONV)) return; for (uint i=0 ; i < arg_count ; i++) @@ -1963,12 +1969,13 @@ err: void Item_func_rpad::fix_length_and_dec() { - if (collation.set(args[0]->collation, args[2]->collation)) - { - my_coll_agg_error(args[0]->collation, args[2]->collation, func_name()); + Item *cargs[2]; + cargs[0]= args[0]; + cargs[1]= args[2]; + if (agg_arg_charsets(collation, cargs, 2, MY_COLL_ALLOW_CONV)) return; - } - + args[0]= cargs[0]; + args[2]= cargs[1]; if (args[1]->const_item()) { uint32 length= (uint32) args[1]->val_int() * collation.collation->mbmaxlen; @@ -2047,11 +2054,13 @@ String *Item_func_rpad::val_str(String *str) void Item_func_lpad::fix_length_and_dec() { - if (collation.set(args[0]->collation, args[2]->collation)) - { - my_coll_agg_error(args[0]->collation, args[2]->collation, func_name()); + Item *cargs[2]; + cargs[0]= args[0]; + cargs[1]= args[2]; + if (agg_arg_charsets(collation, cargs, 2, MY_COLL_ALLOW_CONV)) return; - } + args[0]= cargs[0]; + args[2]= cargs[1]; if (args[1]->const_item()) { @@ -2495,7 +2504,8 @@ void Item_func_export_set::fix_length_and_dec() uint sep_length=(arg_count > 3 ? args[3]->max_length : 1); max_length=length*64+sep_length*63; - if (agg_arg_collations(collation, args+1, min(4,arg_count)-1)) + if (agg_arg_charsets(collation, args+1, min(4,arg_count)-1), + MY_COLL_ALLOW_CONV) return; } From d5121051f22101d326e3e6c005bdb25b9c88caf9 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 2 Nov 2004 13:15:55 +0100 Subject: [PATCH 0072/1063] NDB fix blob parts distribution - backwards compatible ndb/src/ndbapi/NdbBlob.cpp: fix blob parts distribution - backwards compatible --- ndb/src/ndbapi/NdbBlob.cpp | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/ndb/src/ndbapi/NdbBlob.cpp b/ndb/src/ndbapi/NdbBlob.cpp index 731f32ba916..9d21304939a 100644 --- a/ndb/src/ndbapi/NdbBlob.cpp +++ b/ndb/src/ndbapi/NdbBlob.cpp @@ -97,6 +97,14 @@ NdbBlob::getBlobTable(NdbTableImpl& bt, const NdbTableImpl* t, const NdbColumnIm bt.setName(btname); bt.setLogging(t->getLogging()); bt.setFragmentType(t->getFragmentType()); + { NdbDictionary::Column bc("PK"); + bc.setType(NdbDictionary::Column::Unsigned); + assert(t->m_sizeOfKeysInWords != 0); + bc.setLength(t->m_sizeOfKeysInWords); + bc.setPrimaryKey(true); + bc.setDistributionKey(true); + bt.addColumn(bc); + } { NdbDictionary::Column bc("DIST"); bc.setType(NdbDictionary::Column::Unsigned); bc.setPrimaryKey(true); @@ -106,13 +114,7 @@ NdbBlob::getBlobTable(NdbTableImpl& bt, const NdbTableImpl* t, const NdbColumnIm { NdbDictionary::Column bc("PART"); bc.setType(NdbDictionary::Column::Unsigned); bc.setPrimaryKey(true); - bt.addColumn(bc); - } - { NdbDictionary::Column bc("PK"); - bc.setType(NdbDictionary::Column::Unsigned); - assert(t->m_sizeOfKeysInWords != 0); - bc.setLength(t->m_sizeOfKeysInWords); - bc.setPrimaryKey(true); + bc.setDistributionKey(false); bt.addColumn(bc); } { NdbDictionary::Column bc("DATA"); @@ -392,9 +394,10 @@ NdbBlob::setPartKeyValue(NdbOperation* anOp, Uint32 part) Uint32* data = (Uint32*)theKeyBuf.data; unsigned size = theTable->m_sizeOfKeysInWords; DBG("setPartKeyValue dist=" << getDistKey(part) << " part=" << part << " key=" << ndb_blob_debug(data, size)); - if (anOp->equal((Uint32)0, getDistKey(part)) == -1 || - anOp->equal((Uint32)1, part) == -1 || - anOp->equal((Uint32)2, theKeyBuf.data) == -1) { + // TODO use attr ids after compatibility with 4.1.7 not needed + if (anOp->equal("PK", theKeyBuf.data) == -1 || + anOp->equal("DIST", getDistKey(part)) == -1 || + anOp->equal("PART", part) == -1) { setErrorCode(anOp); return -1; } From edca1f6a0c5481e1684d27ecdbad74dce80ce2ec Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 2 Nov 2004 13:58:22 +0100 Subject: [PATCH 0073/1063] build issue Fix so that signed/unsigned char does not matter in comparision ndb/src/ndbapi/NdbOperationExec.cpp: Fix so that signed/unsigned char does not matter in comparision --- ndb/src/ndbapi/NdbOperationExec.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ndb/src/ndbapi/NdbOperationExec.cpp b/ndb/src/ndbapi/NdbOperationExec.cpp index fa46e93a57f..6d7a3817e04 100644 --- a/ndb/src/ndbapi/NdbOperationExec.cpp +++ b/ndb/src/ndbapi/NdbOperationExec.cpp @@ -192,7 +192,7 @@ NdbOperation::prepareSend(Uint32 aTC_ConnectPtr, Uint64 aTransId) OperationType tOperationType = theOperationType; Uint32 tTupKeyLen = theTupKeyLen; Uint8 abortOption = - m_abortOption != -1 ? m_abortOption : theNdbCon->m_abortOption; + m_abortOption != (Int8)-1 ? m_abortOption : theNdbCon->m_abortOption; tcKeyReq->setDirtyFlag(tReqInfo, tDirtyIndicator); tcKeyReq->setOperationType(tReqInfo, tOperationType); @@ -543,7 +543,7 @@ NdbOperation::receiveTCKEYREF( NdbApiSignal* aSignal) }//if AbortOption ao = (AbortOption) - (m_abortOption != -1 ? m_abortOption : theNdbCon->m_abortOption); + (m_abortOption != (Int8)-1 ? m_abortOption : theNdbCon->m_abortOption); theReceiver.m_received_result_length = ~0; theStatus = Finished; From 6b53505f60b17edfc50b7cd34981fed6a647e462 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 2 Nov 2004 15:09:57 +0100 Subject: [PATCH 0074/1063] Test expansion: "MOD" on non-integral first operand. mysql-test/r/ps_10nestset.result: Result of expanded test: "MOD" on non-integral first operand. mysql-test/t/ps_10nestset.test: Use the newly expanded "MOD" operator (non-integral first operand, bug#6138). --- mysql-test/r/ps_10nestset.result | 11 +++++++++++ mysql-test/t/ps_10nestset.test | 13 ++++++------- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/mysql-test/r/ps_10nestset.result b/mysql-test/r/ps_10nestset.result index 68f58a03674..ff63485a5f9 100644 --- a/mysql-test/r/ps_10nestset.result +++ b/mysql-test/r/ps_10nestset.result @@ -62,4 +62,15 @@ id emp salary l r 4 Donna 1064.80 5 6 5 Eddie 931.70 7 8 6 Fred 798.60 9 10 +prepare st_round from 'update t1 set salary = salary + ? - ( salary MOD ? )'; +set @arg_round= 50; +execute st_round using @arg_round, @arg_round; +select * from t1; +id emp salary l r +1 Jerry 1350.00 1 12 +2 Bert 1200.00 2 3 +3 Chuck 1250.00 4 11 +4 Donna 1100.00 5 6 +5 Eddie 950.00 7 8 +6 Fred 800.00 9 10 drop table t1; diff --git a/mysql-test/t/ps_10nestset.test b/mysql-test/t/ps_10nestset.test index d2adaca689e..53e84f7a47d 100644 --- a/mysql-test/t/ps_10nestset.test +++ b/mysql-test/t/ps_10nestset.test @@ -61,12 +61,11 @@ while ($1) select * from t1; -# Waiting for the resolution of bug#6138 -# # Now, increase salary to a multiple of 50 -# prepare st_round from 'update t1 set salary = salary + ? - ( salary MOD ? )'; -# set @arg_round= 50; -# execute st_round using @arg_round, @arg_round; -# -# select * from t1; +# Now, increase salary to a multiple of 50 (checks for bug#6138) +prepare st_round from 'update t1 set salary = salary + ? - ( salary MOD ? )'; +set @arg_round= 50; +execute st_round using @arg_round, @arg_round; + +select * from t1; drop table t1; From a6aaa907d1050eb6e7e6fce9ff56f142df043a2a Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 2 Nov 2004 15:37:26 +0100 Subject: [PATCH 0075/1063] Make sure that Int8(16,32,64) is signed Better fix for previous build issue --- ndb/include/ndb_types.h | 10 +++++----- ndb/src/ndbapi/NdbOperationExec.cpp | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ndb/include/ndb_types.h b/ndb/include/ndb_types.h index a2988dbae78..64b3f517934 100644 --- a/ndb/include/ndb_types.h +++ b/ndb/include/ndb_types.h @@ -21,11 +21,11 @@ #ifndef NDB_TYPES_H #define NDB_TYPES_H -typedef char Int8; +typedef signed char Int8; typedef unsigned char Uint8; -typedef short Int16; +typedef signed short Int16; typedef unsigned short Uint16; -typedef int Int32; +typedef signed int Int32; typedef unsigned int Uint32; typedef unsigned int UintR; @@ -45,10 +45,10 @@ typedef uintptr_t UintPtr; #if defined(WIN32) || defined(NDB_WIN32) typedef unsigned __int64 Uint64; -typedef __int64 Int64; +typedef signed __int64 Int64; #else typedef unsigned long long Uint64; -typedef long long Int64; +typedef signed long long Int64; #endif #endif diff --git a/ndb/src/ndbapi/NdbOperationExec.cpp b/ndb/src/ndbapi/NdbOperationExec.cpp index 6d7a3817e04..fa46e93a57f 100644 --- a/ndb/src/ndbapi/NdbOperationExec.cpp +++ b/ndb/src/ndbapi/NdbOperationExec.cpp @@ -192,7 +192,7 @@ NdbOperation::prepareSend(Uint32 aTC_ConnectPtr, Uint64 aTransId) OperationType tOperationType = theOperationType; Uint32 tTupKeyLen = theTupKeyLen; Uint8 abortOption = - m_abortOption != (Int8)-1 ? m_abortOption : theNdbCon->m_abortOption; + m_abortOption != -1 ? m_abortOption : theNdbCon->m_abortOption; tcKeyReq->setDirtyFlag(tReqInfo, tDirtyIndicator); tcKeyReq->setOperationType(tReqInfo, tOperationType); @@ -543,7 +543,7 @@ NdbOperation::receiveTCKEYREF( NdbApiSignal* aSignal) }//if AbortOption ao = (AbortOption) - (m_abortOption != (Int8)-1 ? m_abortOption : theNdbCon->m_abortOption); + (m_abortOption != -1 ? m_abortOption : theNdbCon->m_abortOption); theReceiver.m_received_result_length = ~0; theStatus = Finished; From c940b515d46247a5b1107bedf30d074721ef2dc9 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 2 Nov 2004 19:48:37 +0400 Subject: [PATCH 0076/1063] A fix (bug #6331: INSERT IGNORE .. SELECT breaks subsequent inserts). --- mysql-test/r/ndb_insert.result | 29 +++++++++++++++++++++++++++++ mysql-test/t/ndb_insert.test | 15 +++++++++++++++ sql/ha_ndbcluster.cc | 3 ++- 3 files changed, 46 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/ndb_insert.result b/mysql-test/r/ndb_insert.result index cdc445558b9..16c76f39680 100644 --- a/mysql-test/r/ndb_insert.result +++ b/mysql-test/r/ndb_insert.result @@ -557,3 +557,32 @@ select * from t1 where pk1=1; pk1 b c 1 2 3 DROP TABLE t1; +CREATE TABLE t1(a INT) ENGINE=ndb; +INSERT IGNORE INTO t1 VALUES (1); +INSERT IGNORE INTO t1 VALUES (1); +INSERT IGNORE INTO t1 SELECT a FROM t1; +INSERT IGNORE INTO t1 SELECT a FROM t1; +INSERT IGNORE INTO t1 SELECT a FROM t1; +INSERT IGNORE INTO t1 VALUES (1); +INSERT IGNORE INTO t1 VALUES (1); +SELECT * FROM t1; +a +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +DROP TABLE t1; diff --git a/mysql-test/t/ndb_insert.test b/mysql-test/t/ndb_insert.test index 310c16de3d8..c3da4641014 100644 --- a/mysql-test/t/ndb_insert.test +++ b/mysql-test/t/ndb_insert.test @@ -583,3 +583,18 @@ INSERT INTO t1 VALUES(1,1,1) ON DUPLICATE KEY UPDATE b=79; select * from t1 where pk1=1; DROP TABLE t1; + +# +# Bug #6331: problem with 'insert ignore' +# + +CREATE TABLE t1(a INT) ENGINE=ndb; +INSERT IGNORE INTO t1 VALUES (1); +INSERT IGNORE INTO t1 VALUES (1); +INSERT IGNORE INTO t1 SELECT a FROM t1; +INSERT IGNORE INTO t1 SELECT a FROM t1; +INSERT IGNORE INTO t1 SELECT a FROM t1; +INSERT IGNORE INTO t1 VALUES (1); +INSERT IGNORE INTO t1 VALUES (1); +SELECT * FROM t1; +DROP TABLE t1; diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 838cf69855a..4f0bd1f99ec 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -2650,7 +2650,8 @@ int ha_ndbcluster::extra(enum ha_extra_function operation) m_use_write= TRUE; } else { - m_ignore_dup_key_not_supported= TRUE; + if (table->keys) + m_ignore_dup_key_not_supported= TRUE; } break; case HA_EXTRA_NO_IGNORE_DUP_KEY: From 55de702588131237433957f036bdd3bc9dc5ee06 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 2 Nov 2004 18:18:21 +0100 Subject: [PATCH 0077/1063] Bug# 5303 Windows --log-error option doesn't work correctly sql/mysqld.cc: changed to open log_error_file instead of "mysql.err" on Windows --- sql/mysqld.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 7062334edbb..2159fd5e402 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -2918,11 +2918,10 @@ we force server id to 2, but this MySQL server will not act as a slave."); exit(1); #ifdef __WIN__ -#define MYSQL_ERR_FILE "mysql.err" if (!opt_console) { - freopen(MYSQL_ERR_FILE,"a+",stdout); - freopen(MYSQL_ERR_FILE,"a+",stderr); + freopen(log_error_file,"a+",stdout); + freopen(log_error_file,"a+",stderr); FreeConsole(); // Remove window } #endif From 505caa28796f0fe13a0a4eb004fe70a084d64c85 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 2 Nov 2004 20:13:27 +0200 Subject: [PATCH 0078/1063] Remove usage of !$ from mysql-tests Added protocol::flush() for easier embedded-server code Increase block allocation variables a bit as they where a bit too small for MySQL 4.1 Added option --silent to client_test client/mysqltest.c: Removed compiler warning Fixed identation & comments from earlier push Renamed variable 'disable_abort_on_error' to 'abort_on_error' Ensure that '$mysql_errno' also with --ps-protocol include/mysql_com.h: Removed special handling of net_flush for embedded server mysql-test/r/mysqltest.result: Remove usage of !$ in tests mysql-test/t/client_test.test: Use --silent mysql-test/t/comments.test: Remove usage of !$ in tests mysql-test/t/join_outer.test: Remove usage of !$ in tests mysql-test/t/key.test: Remove usage of !$ in tests mysql-test/t/mysqltest.test: Remove usage of !$ in tests mysql-test/t/show_check.test: Remove usage of !$ in tests mysql-test/t/temp_table.test: Remove usage of !$ in tests mysql-test/t/type_ranges.test: Remove usage of !$ in tests sql/mysqld.cc: Increase block allocation variables a bit as they where a bit too small for MySQL 4.1 sql/net_serv.cc: Remove special usage of net_flush in embedded server sql/protocol.cc: Added protocol::flush() for easier embedded-server code sql/protocol.h: Added protocol::flush() for easier embedded-server code sql/sql_prepare.cc: Added protocol::flush() for easier embedded-server code Remove one extra flush() for prepared statements sql/sql_show.cc: Added protocol::flush() for easier embedded-server code tests/client_test.c: Added option --silent --- client/mysqltest.c | 90 +-- include/mysql_com.h | 6 - mysql-test/r/mysqltest.result | 7 - mysql-test/t/client_test.test | 2 +- mysql-test/t/comments.test | 3 +- mysql-test/t/join_outer.test | 15 +- mysql-test/t/key.test | 3 +- mysql-test/t/mysqltest.test | 97 ++- mysql-test/t/show_check.test | 3 +- mysql-test/t/temp_table.test | 6 +- mysql-test/t/type_ranges.test | 3 +- sql/mysqld.cc | 4 +- sql/net_serv.cc | 12 +- sql/protocol.cc | 9 + sql/protocol.h | 1 + sql/sql_prepare.cc | 26 +- sql/sql_show.cc | 6 +- tests/client_test.c | 1105 ++++++++++++++++++++------------- 18 files changed, 836 insertions(+), 562 deletions(-) diff --git a/client/mysqltest.c b/client/mysqltest.c index 21f93b1fc6a..aef36823dfc 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -42,7 +42,7 @@ **********************************************************************/ -#define MTEST_VERSION "2.3" +#define MTEST_VERSION "2.4" #include #include @@ -243,8 +243,7 @@ VAR var_reg[10]; HASH var_hash; my_bool disable_query_log=0, disable_result_log=0, disable_warnings=0; my_bool disable_info= 1; /* By default off */ -/* default for disable_abort_on_error: false = abort on unmasked error */ -my_bool disable_abort_on_error= 0; +my_bool abort_on_error= 1; struct connection cons[MAX_CONS]; struct connection* cur_con, *next_con, *cons_end; @@ -370,7 +369,7 @@ const char *command_names[]= }; TYPELIB command_typelib= {array_elements(command_names),"", - command_names}; + command_names, 0}; DYNAMIC_STRING ds_res; static void die(const char *fmt, ...); @@ -744,7 +743,7 @@ err: DBUG_RETURN(0); } -static VAR* var_obtain(char* name, int len) +static VAR *var_obtain(const char* name, int len) { VAR* v; if ((v = (VAR*)hash_search(&var_hash, name, len))) @@ -754,28 +753,33 @@ static VAR* var_obtain(char* name, int len) return v; } -int var_set(char* var_name, char* var_name_end, char* var_val, - char* var_val_end) +int var_set(const char *var_name, const char *var_name_end, + const char *var_val, const char *var_val_end) { int digit; VAR* v; + DBUG_ENTER("var_set"); + DBUG_PRINT("enter", ("var_name: '%.*s' = '%.*s' (length: %d)", + (int) (var_name_end - var_name), var_name, + (int) (var_val_end - var_val), var_val, + (int) (var_val_end - var_val))); + if (*var_name++ != '$') - { - --var_name; - *var_name_end = 0; - die("Variable name in %s does not start with '$'", var_name); - } + { + var_name--; + die("Variable name in %s does not start with '$'", var_name); + } digit = *var_name - '0'; if (!(digit < 10 && digit >= 0)) - { - v = var_obtain(var_name, var_name_end - var_name); - } + { + v = var_obtain(var_name, (uint) (var_name_end - var_name)); + } else - v = var_reg + digit; - + v = var_reg + digit; return eval_expr(v, var_val, (const char**)&var_val_end); } + int open_file(const char* name) { char buff[FN_REFLEN]; @@ -1244,18 +1248,22 @@ int do_let(struct st_query* q) return var_set(var_name, var_name_end, var_val_start, q->end); } -/* Store an integer (typically the returncode of the last SQL) */ -/* statement in the mysqltest builtin variable $mysql_errno, by */ -/* simulating of a user statement "let $mysql_errno= " */ -int var_set_errno(int sql_errno ) + +/* + Store an integer (typically the returncode of the last SQL) + statement in the mysqltest builtin variable $mysql_errno, by + simulating of a user statement "let $mysql_errno= " +*/ + +int var_set_errno(int sql_errno) { - char var_name[] = "$mysql_errno", var_val[30]; - sprintf(var_val, "%d", sql_errno); - /* On some odd systems, the return value from sprintf() isn't */ - /* always the length of the string, so we use strlen() */ - return var_set(var_name, var_name + 12, var_val, var_val + strlen(var_val)); + const char *var_name= "$mysql_errno"; + char var_val[21]; + uint length= my_sprintf(var_val, (var_val, "%d", sql_errno)); + return var_set(var_name, var_name + 12, var_val, var_val + length); } + int do_rpl_probe(struct st_query* q __attribute__((unused))) { DBUG_ENTER("do_rpl_probe"); @@ -1264,12 +1272,14 @@ int do_rpl_probe(struct st_query* q __attribute__((unused))) DBUG_RETURN(0); } + int do_enable_rpl_parse(struct st_query* q __attribute__((unused))) { mysql_enable_rpl_parse(&cur_con->mysql); return 0; } + int do_disable_rpl_parse(struct st_query* q __attribute__((unused))) { mysql_disable_rpl_parse(&cur_con->mysql); @@ -2013,7 +2023,7 @@ int read_query(struct st_query** q_ptr) 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 && !disable_abort_on_error); + 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] == '-') @@ -2422,7 +2432,7 @@ static int run_query(MYSQL *mysql, struct st_query *q, int flags) if (ps_protocol_enabled && disable_info && (flags & QUERY_SEND) && (flags & QUERY_REAP) && ps_match_re(q->query)) - return run_query_stmt (mysql, q, flags); + return run_query_stmt(mysql, q, flags); return run_query_normal(mysql, q, flags); } @@ -2659,9 +2669,12 @@ end: dynstr_free(&ds_tmp); if (q->type == Q_EVAL) dynstr_free(&eval_query); - /* We save the return code (mysql_errno(mysql)) from the last call sent */ - /* to the server into the mysqltest builtin variable $mysql_errno. This */ - /* variable then can be used from the test case itself. */ + + /* + We save the return code (mysql_errno(mysql)) from the last call sent + to the server into the mysqltest builtin variable $mysql_errno. This + variable then can be used from the test case itself. + */ var_set_errno(mysql_errno(mysql)); DBUG_RETURN(error); } @@ -3012,6 +3025,7 @@ end: dynstr_free(&ds_tmp); if (q->type == Q_EVAL) dynstr_free(&eval_query); + var_set_errno(mysql_stmt_errno(stmt)); mysql_stmt_close(stmt); DBUG_RETURN(error); } @@ -3319,7 +3333,7 @@ static VAR* var_from_env(const char *name, const char *def_val) if (!(tmp = getenv(name))) tmp = def_val; - v = var_init(0, name, 0, tmp, 0); + v = var_init(0, name, strlen(name), tmp, strlen(tmp)); my_hash_insert(&var_hash, (byte*)v); return v; } @@ -3416,9 +3430,11 @@ int main(int argc, char **argv) init_var_hash(&cur_con->mysql); - /* Initialize $mysql_errno with -1, so we can */ - /* - distinguish it from valid values ( >= 0 ) and */ - /* - detect if there was never a command sent to the server */ + /* + Initialize $mysql_errno with -1, so we can + - distinguish it from valid values ( >= 0 ) and + - detect if there was never a command sent to the server + */ var_set_errno(-1); while (!read_query(&q)) @@ -3440,8 +3456,8 @@ int main(int argc, char **argv) case Q_DISABLE_RPL_PARSE: do_disable_rpl_parse(q); break; case Q_ENABLE_QUERY_LOG: disable_query_log=0; break; case Q_DISABLE_QUERY_LOG: disable_query_log=1; break; - case Q_ENABLE_ABORT_ON_ERROR: disable_abort_on_error=0; break; - case Q_DISABLE_ABORT_ON_ERROR: disable_abort_on_error=1; break; + case Q_ENABLE_ABORT_ON_ERROR: abort_on_error=1; break; + case Q_DISABLE_ABORT_ON_ERROR: abort_on_error=0; break; case Q_ENABLE_RESULT_LOG: disable_result_log=0; break; case Q_DISABLE_RESULT_LOG: disable_result_log=1; break; case Q_ENABLE_WARNINGS: disable_warnings=0; break; diff --git a/include/mysql_com.h b/include/mysql_com.h index 4686acc098f..6a6136bd974 100644 --- a/include/mysql_com.h +++ b/include/mysql_com.h @@ -282,13 +282,7 @@ void my_net_local_init(NET *net); void net_end(NET *net); void net_clear(NET *net); my_bool net_realloc(NET *net, unsigned long length); - -#ifndef EMBEDDED_LIBRARY /* To be removed by HF */ my_bool net_flush(NET *net); -#else -#define net_flush(A) -#endif - my_bool my_net_write(NET *net,const char *packet,unsigned long len); my_bool net_write_command(NET *net,unsigned char command, const char *header, unsigned long head_len, diff --git a/mysql-test/r/mysqltest.result b/mysql-test/r/mysqltest.result index 5dc9ede1ca6..d75dbd5d00c 100644 --- a/mysql-test/r/mysqltest.result +++ b/mysql-test/r/mysqltest.result @@ -7,11 +7,6 @@ otto select otto from (select 1 as otto) as t1; otto 1 -select otto from (select 1 as otto) as t1; -otto -1 -select friedrich from (select 1 as otto) as t1; -ERROR 42S22: Unknown column 'friedrich' in 'field list' select friedrich from (select 1 as otto) as t1; ERROR 42S22: Unknown column 'friedrich' in 'field list' select otto from (select 1 as otto) as t1; @@ -147,5 +142,3 @@ after_--enable_abort_on_error 1064 select 3 from t1 ; ERROR 42S02: Table 'test.t1' doesn't exist -select 3 from t1 ; -ERROR 42S02: Table 'test.t1' doesn't exist diff --git a/mysql-test/t/client_test.test b/mysql-test/t/client_test.test index b56e8038d9b..830c5f1b8a2 100644 --- a/mysql-test/t/client_test.test +++ b/mysql-test/t/client_test.test @@ -1,2 +1,2 @@ --disable_result_log ---exec $TESTS_BINDIR/client_test --testcase --user=root --socket=$MASTER_MYSOCK --port=$MYSQL_TCP_PORT +--exec $TESTS_BINDIR/client_test --testcase --user=root --socket=$MASTER_MYSOCK --port=$MYSQL_TCP_PORT --silent diff --git a/mysql-test/t/comments.test b/mysql-test/t/comments.test index 2fc6237907c..087df60f3f5 100644 --- a/mysql-test/t/comments.test +++ b/mysql-test/t/comments.test @@ -5,7 +5,8 @@ select 1+2/*hello*/+3; select 1 /* long multi line comment */; -!$1065 ; +--error 1065 + ; select 1 /*!32301 +1 */; select 1 /*!52301 +1 */; select 1--1; diff --git a/mysql-test/t/join_outer.test b/mysql-test/t/join_outer.test index 0c4c9614d88..bc96318ae2e 100644 --- a/mysql-test/t/join_outer.test +++ b/mysql-test/t/join_outer.test @@ -34,11 +34,14 @@ explain select t1.*,t2.* from t1 left join t2 on t1.a=t2.a where isnull(t2.a)=1; select t1.*,t2.*,t3.a from t1 left join t2 on (t1.a=t2.a) left join t1 as t3 on (t2.a=t3.a); # The next query should rearange the left joins to get this to work -!$1120 explain select t1.*,t2.*,t3.a from t1 left join t2 on (t3.a=t2.a) left join t1 as t3 on (t1.a=t3.a); -!$1120 select t1.*,t2.*,t3.a from t1 left join t2 on (t3.a=t2.a) left join t1 as t3 on (t1.a=t3.a); +--error 1120 +explain select t1.*,t2.*,t3.a from t1 left join t2 on (t3.a=t2.a) left join t1 as t3 on (t1.a=t3.a); +--error 1120 +select t1.*,t2.*,t3.a from t1 left join t2 on (t3.a=t2.a) left join t1 as t3 on (t1.a=t3.a); # The next query should give an error in MySQL -!$1120 select t1.*,t2.*,t3.a from t1 left join t2 on (t3.a=t2.a) left join t1 as t3 on (t2.a=t3.a); +--error 1120 +select t1.*,t2.*,t3.a from t1 left join t2 on (t3.a=t2.a) left join t1 as t3 on (t2.a=t3.a); # Test of inner join select t1.*,t2.* from t1 inner join t2 using (a); @@ -94,7 +97,8 @@ WHERE t1.uniq_id = 4 ORDER BY t2.c_amount; INSERT INTO t2 VALUES (2,3,3000,6000,0,0,746584,837484,'yes'); -!$1062 INSERT INTO t2 VALUES (2,3,3000,6000,0,0,746584,837484,'yes'); +--error 1062 +INSERT INTO t2 VALUES (2,3,3000,6000,0,0,746584,837484,'yes'); INSERT INTO t2 VALUES (7,3,1000,2000,0,0,746294,937484,'yes'); #3rd select should show that one record is returned with null entries for the @@ -288,7 +292,8 @@ insert into t3 values (1); insert into t4 values (1,1); insert into t5 values (1,1); -!$1120 explain select * from t3 left join t4 on t4.seq_1_id = t2.t2_id left join t1 on t1.t1_id = t4.seq_0_id left join t5 on t5.seq_0_id = t1.t1_id left join t2 on t2.t2_id = t5.seq_1_id where t3.t3_id = 23; +--error 1120 +explain select * from t3 left join t4 on t4.seq_1_id = t2.t2_id left join t1 on t1.t1_id = t4.seq_0_id left join t5 on t5.seq_0_id = t1.t1_id left join t2 on t2.t2_id = t5.seq_1_id where t3.t3_id = 23; drop table t1,t2,t3,t4,t5; diff --git a/mysql-test/t/key.test b/mysql-test/t/key.test index 4be34cac30e..5ee2f68ab83 100644 --- a/mysql-test/t/key.test +++ b/mysql-test/t/key.test @@ -146,7 +146,8 @@ create table t1 ); INSERT INTO t1 VALUES (1, 1, 1, 1, 'a'); INSERT INTO t1 VALUES (1, 1, 1, 1, 'b'); -!$1062 INSERT INTO t1 VALUES (1, 1, 1, 1, 'a'); +--error 1062 +INSERT INTO t1 VALUES (1, 1, 1, 1, 'a'); drop table t1; # diff --git a/mysql-test/t/mysqltest.test b/mysql-test/t/mysqltest.test index b7007e1a519..0802c18ed6c 100644 --- a/mysql-test/t/mysqltest.test +++ b/mysql-test/t/mysqltest.test @@ -20,12 +20,10 @@ eval select $mysql_errno as "before_use_test" ; select otto from (select 1 as otto) as t1; # expectation = response -!$0 select otto from (select 1 as otto) as t1; --error 0 select otto from (select 1 as otto) as t1; # expectation <> response --- // !$1054 select otto from (select 1 as otto) as t1; -- // --error 1054 -- // select otto from (select 1 as otto) as t1; @@ -38,12 +36,10 @@ select otto from (select 1 as otto) as t1; # ---------------------------------------------------------------------------- # expectation <> response -#!$0 select friedrich from (select 1 as otto) as t1; #--error 0 #select friedrich from (select 1 as otto) as t1; # expectation = response -!$1054 select friedrich from (select 1 as otto) as t1; --error 1054 select friedrich from (select 1 as otto) as t1; @@ -94,130 +90,130 @@ select friedrich from (select 1 as otto) as t1; # # The following test cases often initialize $mysql_errno to 1064 by # a command with wrong syntax. -# Example: !$1064 To prevent the abort after the error. +# Example: --error 1064 To prevent the abort after the error. # garbage ; # ---------------------------------------------------------------------------- # ---------------------------------------------------------------------------- -# 1. check mysql_errno = 0 after successful statement +# check mysql_errno = 0 after successful statement # ---------------------------------------------------------------------------- select otto from (select 1 as otto) as t1; eval select $mysql_errno as "after_successful_stmt_errno" ; #---------------------------------------------------------------------------- -# 2. check mysql_errno = 1064 after statement with wrong syntax +# check mysql_errno = 1064 after statement with wrong syntax # ---------------------------------------------------------------------------- -!$1064 +--error 1064 garbage ; eval select $mysql_errno as "after_wrong_syntax_errno" ; # ---------------------------------------------------------------------------- -# 3. check if let $my_var= 'abc' ; affects $mysql_errno +# check if let $my_var= 'abc' ; affects $mysql_errno # ---------------------------------------------------------------------------- -!$1064 +--error 1064 garbage ; let $my_var= 'abc' ; eval select $mysql_errno as "after_let_var_equal_value" ; # ---------------------------------------------------------------------------- -# 4. check if set @my_var= 'abc' ; affects $mysql_errno +# check if set @my_var= 'abc' ; affects $mysql_errno # ---------------------------------------------------------------------------- -!$1064 +--error 1064 garbage ; set @my_var= 'abc' ; eval select $mysql_errno as "after_set_var_equal_value" ; # ---------------------------------------------------------------------------- -# 5. check if the setting of --disable-warnings itself affects $mysql_errno -# (May be -- modifies $mysql_errno.) +# check if the setting of --disable-warnings itself affects $mysql_errno +# (May be -- modifies $mysql_errno.) # ---------------------------------------------------------------------------- -!$1064 +--error 1064 garbage ; --disable_warnings eval select $mysql_errno as "after_disable_warnings_command" ; # ---------------------------------------------------------------------------- -# 6. check if --disable-warnings + command with warning affects the errno -# stored within $mysql_errno -# (May be disabled warnings affect $mysql_errno.) +# check if --disable-warnings + command with warning affects the errno +# stored within $mysql_errno +# (May be disabled warnings affect $mysql_errno.) # ---------------------------------------------------------------------------- drop table if exists t1 ; -!$1064 +--error 1064 garbage ; drop table if exists t1 ; eval select $mysql_errno as "after_disable_warnings" ; --enable_warnings # ---------------------------------------------------------------------------- -# 7. check if masked errors affect $mysql_errno +# check if masked errors affect $mysql_errno # ---------------------------------------------------------------------------- -!$1064 +--error 1064 garbage ; --error 1146 select 3 from t1 ; eval select $mysql_errno as "after_minus_masked" ; -!$1064 +--error 1064 garbage ; -!$1146 +--error 1146 select 3 from t1 ; eval select $mysql_errno as "after_!_masked" ; # ---------------------------------------------------------------------------- -# 8. Will manipulations of $mysql_errno be possible and visible ? +# Will manipulations of $mysql_errno be possible and visible ? # ---------------------------------------------------------------------------- -!$1064 +--error 1064 garbage ; let $mysql_errno= -1; eval select $mysql_errno as "after_let_errno_equal_value" ; # ---------------------------------------------------------------------------- -# 9. How affect actions on prepared statements $mysql_errno ? +# How affect actions on prepared statements $mysql_errno ? # ---------------------------------------------------------------------------- # failing prepare -!$1064 +--error 1064 garbage ; -!$1146 +--error 1146 prepare stmt from "select 3 from t1" ; eval select $mysql_errno as "after_failing_prepare" ; create table t1 ( f1 char(10)); # successful prepare -!$1064 +--error 1064 garbage ; prepare stmt from "select 3 from t1" ; eval select $mysql_errno as "after_successful_prepare" ; # successful execute -!$1064 +--error 1064 garbage ; execute stmt; eval select $mysql_errno as "after_successful_execute" ; # failing execute (table dropped) drop table t1; -!$1064 +--error 1064 garbage ; -!$1146 +--error 1146 execute stmt; eval select $mysql_errno as "after_failing_execute" ; # failing execute (unknown statement) -!$1064 +--error 1064 garbage ; -!$1243 +--error 1243 execute __stmt_; eval select $mysql_errno as "after_failing_execute" ; # successful deallocate -!$1064 +--error 1064 garbage ; deallocate prepare stmt; eval select $mysql_errno as "after_successful_deallocate" ; # failing deallocate ( statement handle does not exist ) -!$1064 +--error 1064 garbage ; -!$1243 +--error 1243 deallocate prepare __stmt_; eval select $mysql_errno as "after_failing_deallocate" ; @@ -231,7 +227,7 @@ eval select $mysql_errno as "after_failing_deallocate" ; # The default is "--enable_abort_on_error". # # "Maskings" are -# !$ and --error +# --error and --error # in the line before the failing statement. # # There are some additional test case for $mysql_errno @@ -240,58 +236,53 @@ eval select $mysql_errno as "after_failing_deallocate" ; # ---------------------------------------------------------------------------- # ---------------------------------------------------------------------------- -# 1. Switch the abort on error off and check the effect on $mysql_errno +# Switch the abort on error off and check the effect on $mysql_errno # ---------------------------------------------------------------------------- -!$1064 +--error 1064 garbage ; --disable_abort_on_error eval select $mysql_errno as "after_--disable_abort_on_error" ; # ---------------------------------------------------------------------------- -# 2. "unmasked" failing statement should not cause an abort +# "unmasked" failing statement should not cause an abort # ---------------------------------------------------------------------------- select 3 from t1 ; # ---------------------------------------------------------------------------- -# 3. masked failing statements +# masked failing statements # ---------------------------------------------------------------------------- # expected error = response --error 1146 select 3 from t1 ; -!$1146 +--error 1146 select 3 from t1 ; eval select $mysql_errno as "after_!errno_masked_error" ; # expected error <> response # --error 1000 # select 3 from t1 ; -# !$1000 +# --error 1000 # select 3 from t1 ; # ---------------------------------------------------------------------------- -# 4. Switch the abort on error on and check the effect on $mysql_errno +# Switch the abort on error on and check the effect on $mysql_errno # ---------------------------------------------------------------------------- -!$1064 +--error 1064 garbage ; --enable_abort_on_error eval select $mysql_errno as "after_--enable_abort_on_error" ; # ---------------------------------------------------------------------------- -# 5. masked failing statements +# masked failing statements # ---------------------------------------------------------------------------- # expected error = response --error 1146 select 3 from t1 ; -!$1146 -select 3 from t1 ; # ---------------------------------------------------------------------------- -# 6. check that the old default behaviour is not changed +# check that the old default behaviour is not changed # Please remove the '#' to get the abort on error # ---------------------------------------------------------------------------- #--error 1064 #select 3 from t1 ; # -#!$1064 -#select 3 from t1 ; -# #select 3 from t1 ; diff --git a/mysql-test/t/show_check.test b/mysql-test/t/show_check.test index 681127eab5e..efbe2e9371d 100644 --- a/mysql-test/t/show_check.test +++ b/mysql-test/t/show_check.test @@ -21,7 +21,8 @@ check table t1 changed; check table t1 medium; check table t1 extended; show index from t1; -!$1062 insert into t1 values (5,5,5); +--error 1062 +insert into t1 values (5,5,5); optimize table t1; optimize table t1; drop table t1; diff --git a/mysql-test/t/temp_table.test b/mysql-test/t/temp_table.test index 2181d3eb74c..74276c7668c 100644 --- a/mysql-test/t/temp_table.test +++ b/mysql-test/t/temp_table.test @@ -20,8 +20,10 @@ create TEMPORARY TABLE t2 engine=heap select * from t1; create TEMPORARY TABLE IF NOT EXISTS t2 (a int) engine=heap; # This should give errors -!$1050 CREATE TEMPORARY TABLE t1 (a int not null, b char (10) not null); -!$1050 ALTER TABLE t1 RENAME t2; +--error 1050 +CREATE TEMPORARY TABLE t1 (a int not null, b char (10) not null); +--error 1050 +ALTER TABLE t1 RENAME t2; select * from t2; alter table t2 add primary key (a,b); diff --git a/mysql-test/t/type_ranges.test b/mysql-test/t/type_ranges.test index 09b5867e7a8..572dc0af313 100644 --- a/mysql-test/t/type_ranges.test +++ b/mysql-test/t/type_ranges.test @@ -135,7 +135,8 @@ drop table t1,t2; create table t1 (c int); insert into t1 values(1),(2); create table t2 select * from t1; -!$1060 create table t3 select * from t1, t2; # Should give an error +--error 1060 +create table t3 select * from t1, t2; # Should give an error create table t3 select t1.c AS c1, t2.c AS c2,1 as "const" from t1, t2; show full columns from t3; drop table t1,t2,t3; diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 7062334edbb..d06aba3387e 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -5026,12 +5026,12 @@ The minimum value for this variable is 4096.", "Persistent buffer for query parsing and execution", (gptr*) &global_system_variables.query_prealloc_size, (gptr*) &max_system_variables.query_prealloc_size, 0, GET_ULONG, - REQUIRED_ARG, QUERY_ALLOC_PREALLOC_SIZE, 1024, ~0L, 0, 1024, 0}, + REQUIRED_ARG, QUERY_ALLOC_PREALLOC_SIZE, 16384, ~0L, 0, 1024, 0}, {"range_alloc_block_size", OPT_RANGE_ALLOC_BLOCK_SIZE, "Allocation block size for storing ranges during optimization", (gptr*) &global_system_variables.range_alloc_block_size, (gptr*) &max_system_variables.range_alloc_block_size, 0, GET_ULONG, - REQUIRED_ARG, RANGE_ALLOC_BLOCK_SIZE, 1024, ~0L, 0, 1024, 0}, + REQUIRED_ARG, RANGE_ALLOC_BLOCK_SIZE, 4096, ~0L, 0, 1024, 0}, {"read_buffer_size", OPT_RECORD_BUFFER, "Each thread that does a sequential scan allocates a buffer of this size for each table it scans. If you do many sequential scans, you may want to increase this value.", (gptr*) &global_system_variables.read_buff_size, diff --git a/sql/net_serv.cc b/sql/net_serv.cc index 457b2052a45..5985cf63ed6 100644 --- a/sql/net_serv.cc +++ b/sql/net_serv.cc @@ -53,19 +53,9 @@ #include #ifdef EMBEDDED_LIBRARY - #undef MYSQL_SERVER - -#ifndef MYSQL_CLIENT +#undef MYSQL_CLIENT #define MYSQL_CLIENT -#endif - -#undef net_flush - -extern "C" { -my_bool net_flush(NET *net); -} - #endif /*EMBEDDED_LIBRARY */ diff --git a/sql/protocol.cc b/sql/protocol.cc index 598d102ec29..eaa0fd55b25 100644 --- a/sql/protocol.cc +++ b/sql/protocol.cc @@ -470,6 +470,15 @@ void Protocol::init(THD *thd_arg) } +bool Protocol::flush() +{ +#ifndef EMBEDDED_LIBRARY + return net_flush(&thd->net); +#else + return 0; +#endif +} + /* Send name and type of result to client. diff --git a/sql/protocol.h b/sql/protocol.h index d7ce5425ad1..a3b6da55da3 100644 --- a/sql/protocol.h +++ b/sql/protocol.h @@ -75,6 +75,7 @@ public: field_count=item_list->elements; return 0; } + virtual bool flush(); virtual void prepare_for_resend()=0; virtual bool store_null()=0; diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index b5e12c4d208..4ae69e40342 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -153,6 +153,8 @@ static bool send_prep_stmt(Prepared_statement *stmt, uint columns) { NET *net= &stmt->thd->net; char buff[9]; + DBUG_ENTER("send_prep_stmt"); + buff[0]= 0; /* OK packet indicator */ int4store(buff+1, stmt->id); int2store(buff+5, columns); @@ -161,12 +163,11 @@ static bool send_prep_stmt(Prepared_statement *stmt, uint columns) Send types and names of placeholders to the client XXX: fix this nasty upcast from List to List */ - return my_net_write(net, buff, sizeof(buff)) || - (stmt->param_count && - stmt->thd->protocol_simple.send_fields((List *) - &stmt->lex->param_list, 0)) || - net_flush(net); - return 0; + DBUG_RETURN(my_net_write(net, buff, sizeof(buff)) || + (stmt->param_count && + stmt->thd->protocol_simple.send_fields((List *) + &stmt->lex->param_list, + 0))); } #else static bool send_prep_stmt(Prepared_statement *stmt, @@ -1088,7 +1089,7 @@ static int mysql_test_select(Prepared_statement *stmt, { if (lex->describe) { - if (send_prep_stmt(stmt, 0)) + if (send_prep_stmt(stmt, 0) || thd->protocol->flush()) goto err_prep; } else @@ -1106,11 +1107,8 @@ static int mysql_test_select(Prepared_statement *stmt, prepared in unit->prepare call above. */ if (send_prep_stmt(stmt, lex->result->field_count(fields)) || - lex->result->send_fields(fields, 0) -#ifndef EMBEDDED_LIBRARY - || net_flush(&thd->net) -#endif - ) + lex->result->send_fields(fields, 0) || + thd->protocol->flush()) goto err_prep; } } @@ -1389,7 +1387,6 @@ static int send_prepare_results(Prepared_statement *stmt, bool text_protocol) enum enum_sql_command sql_command= lex->sql_command; int res= 0; DBUG_ENTER("send_prepare_results"); - DBUG_PRINT("enter",("command: %d, param_count: %ld", sql_command, stmt->param_count)); @@ -1475,7 +1472,8 @@ static int send_prepare_results(Prepared_statement *stmt, bool text_protocol) goto error; } if (res == 0) - DBUG_RETURN(text_protocol? 0 : send_prep_stmt(stmt, 0)); + DBUG_RETURN(text_protocol? 0 : (send_prep_stmt(stmt, 0) || + thd->protocol->flush())); error: if (res < 0) send_error(thd, thd->killed ? ER_SERVER_SHUTDOWN : 0); diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 2af4cb3fc23..bda490e2916 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -1081,7 +1081,7 @@ mysqld_list_fields(THD *thd, TABLE_LIST *table_list, const char *wild) restore_record(table,default_values); // Get empty record if (thd->protocol->send_fields(&field_list,2)) DBUG_VOID_RETURN; - net_flush(&thd->net); + thd->protocol->flush(); DBUG_VOID_RETURN; } @@ -1098,13 +1098,11 @@ mysqld_dump_create_info(THD *thd, TABLE *table, int fd) if (store_create_info(thd, table, packet)) DBUG_RETURN(-1); - //if (protocol->convert) - // protocol->convert->convert((char*) packet->ptr(), packet->length()); if (fd < 0) { if (protocol->write()) DBUG_RETURN(-1); - net_flush(&thd->net); + protocol->flush(); } else { diff --git a/tests/client_test.c b/tests/client_test.c index 48676ae7e12..70e1b26aeaa 100644 --- a/tests/client_test.c +++ b/tests/client_test.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003 MySQL AB +/* Copyright (C) 2003-2004 MySQL AB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -27,6 +27,7 @@ #include #include +#define VER "2.0" #define MAX_TEST_QUERY_LENGTH 300 /* MAX QUERY BUFFER LENGTH */ /* set default options */ @@ -37,7 +38,7 @@ static char *opt_password= 0; static char *opt_host= 0; static char *opt_unix_socket= 0; static unsigned int opt_port; -static my_bool tty_password= 0; +static my_bool tty_password= 0, opt_silent= 0; static MYSQL *mysql= 0; static char query[MAX_TEST_QUERY_LENGTH]; @@ -52,6 +53,7 @@ static double total_time; const char *default_dbug_option= "d:t:o,/tmp/client_test.trace"; #define myheader(str) \ +if (opt_silent < 2) \ { \ fprintf(stdout, "\n\n#####################################\n"); \ fprintf(stdout, "%d of (%d/%d): %s", test_count++, iter_count, \ @@ -59,6 +61,7 @@ const char *default_dbug_option= "d:t:o,/tmp/client_test.trace"; fprintf(stdout, " \n#####################################\n"); \ } #define myheader_r(str) \ +if (!opt_silent) \ { \ fprintf(stdout, "\n\n#####################################\n"); \ fprintf(stdout, "%s", str); \ @@ -144,32 +147,39 @@ DIE_UNLESS(stmt == 0);\ static void print_error(const char *msg) { - if (mysql && mysql_errno(mysql)) + if (!opt_silent) { - if (mysql->server_version) - fprintf(stdout, "\n [MySQL-%s]", mysql->server_version); - else - fprintf(stdout, "\n [MySQL]"); - fprintf(stdout, "[%d] %s\n", mysql_errno(mysql), mysql_error(mysql)); + if (mysql && mysql_errno(mysql)) + { + if (mysql->server_version) + fprintf(stdout, "\n [MySQL-%s]", mysql->server_version); + else + fprintf(stdout, "\n [MySQL]"); + fprintf(stdout, "[%d] %s\n", mysql_errno(mysql), mysql_error(mysql)); + } + else if (msg) + fprintf(stderr, " [MySQL] %s\n", msg); } - else if (msg) fprintf(stderr, " [MySQL] %s\n", msg); } static void print_st_error(MYSQL_STMT *stmt, const char *msg) { - if (stmt && mysql_stmt_errno(stmt)) + if (!opt_silent) { - if (stmt->mysql && stmt->mysql->server_version) - fprintf(stdout, "\n [MySQL-%s]", stmt->mysql->server_version); - else - fprintf(stdout, "\n [MySQL]"); + if (stmt && mysql_stmt_errno(stmt)) + { + if (stmt->mysql && stmt->mysql->server_version) + fprintf(stdout, "\n [MySQL-%s]", stmt->mysql->server_version); + else + fprintf(stdout, "\n [MySQL]"); - fprintf(stdout, "[%d] %s\n", mysql_stmt_errno(stmt), - mysql_stmt_error(stmt)); + fprintf(stdout, "[%d] %s\n", mysql_stmt_errno(stmt), + mysql_stmt_error(stmt)); + } + else if (msg) + fprintf(stderr, " [MySQL] %s\n", msg); } - else if (msg) - fprintf(stderr, " [MySQL] %s\n", msg); } @@ -198,8 +208,9 @@ static void client_connect() int rc; myheader_r("client_connect"); - fprintf(stdout, "\n Establishing a connection to '%s' ...", - opt_host ? opt_host : ""); + if (!opt_silent) + fprintf(stdout, "\n Establishing a connection to '%s' ...", + opt_host ? opt_host : ""); if (!(mysql= mysql_init(NULL))) { @@ -217,12 +228,14 @@ static void client_connect() exit(1); } - fprintf(stdout, " OK"); + if (!opt_silent) + fprintf(stdout, " OK"); /* set AUTOCOMMIT to ON*/ mysql_autocommit(mysql, TRUE); - fprintf(stdout, "\n Creating a test database '%s' ...", current_db); + if (!opt_silent) + fprintf(stdout, "\n Creating a test database '%s' ...", current_db); strxmov(query, "CREATE DATABASE IF NOT EXISTS ", current_db, NullS); rc= mysql_query(mysql, query); @@ -232,7 +245,8 @@ static void client_connect() rc= mysql_query(mysql, query); myquery(rc); - fprintf(stdout, " OK"); + if (!opt_silent) + fprintf(stdout, " OK"); } @@ -244,13 +258,16 @@ static void client_disconnect() if (mysql) { - fprintf(stdout, "\n dropping the test database '%s' ...", current_db); + if (!opt_silent) + fprintf(stdout, "\n dropping the test database '%s' ...", current_db); strxmov(query, "DROP DATABASE IF EXISTS ", current_db, NullS); mysql_query(mysql, query); - fprintf(stdout, " OK"); + if (!opt_silent) + fprintf(stdout, " OK"); - fprintf(stdout, "\n closing the connection ..."); + if (!opt_silent) + fprintf(stdout, "\n closing the connection ..."); mysql_close(mysql); fprintf(stdout, " OK\n"); } @@ -331,8 +348,11 @@ static void my_print_result_metadata(MYSQL_RES *result) unsigned int field_count; mysql_field_seek(result, 0); - fputc('\n', stdout); - fputc('\n', stdout); + if (!opt_silent) + { + fputc('\n', stdout); + fputc('\n', stdout); + } field_count= mysql_num_fields(result); for(i= 0; i< field_count; i++) @@ -345,18 +365,25 @@ static void my_print_result_metadata(MYSQL_RES *result) j= 4; field->max_length= j; } - my_print_dashes(result); - fputc('\t', stdout); - fputc('|', stdout); + if (!opt_silent) + { + my_print_dashes(result); + fputc('\t', stdout); + fputc('|', stdout); + } mysql_field_seek(result, 0); for(i= 0; i< field_count; i++) { field= mysql_fetch_field(result); - fprintf(stdout, " %-*s |", (int) field->max_length, field->name); + if (!opt_silent) + fprintf(stdout, " %-*s |", (int) field->max_length, field->name); + } + if (!opt_silent) + { + fputc('\n', stdout); + my_print_dashes(result); } - fputc('\n', stdout); - my_print_dashes(result); } @@ -377,31 +404,43 @@ int my_process_result_set(MYSQL_RES *result) while ((row= mysql_fetch_row(result)) != NULL) { mysql_field_seek(result, 0); - fputc('\t', stdout); - fputc('|', stdout); + if (!opt_silent) + { + fputc('\t', stdout); + fputc('|', stdout); + } for(i= 0; i< mysql_num_fields(result); i++) { field= mysql_fetch_field(result); - if (row[i] == NULL) - fprintf(stdout, " %-*s |", (int) field->max_length, "NULL"); - else if (IS_NUM(field->type)) - fprintf(stdout, " %*s |", (int) field->max_length, row[i]); - else - fprintf(stdout, " %-*s |", (int) field->max_length, row[i]); + if (!opt_silent) + { + if (row[i] == NULL) + fprintf(stdout, " %-*s |", (int) field->max_length, "NULL"); + else if (IS_NUM(field->type)) + fprintf(stdout, " %*s |", (int) field->max_length, row[i]); + else + fprintf(stdout, " %-*s |", (int) field->max_length, row[i]); + } + } + if (!opt_silent) + { + fputc('\t', stdout); + fputc('\n', stdout); } - fputc('\t', stdout); - fputc('\n', stdout); row_count++; } - if (row_count) - my_print_dashes(result); + if (!opt_silent) + { + if (row_count) + my_print_dashes(result); - if (mysql_errno(mysql) != 0) - fprintf(stderr, "\n\tmysql_fetch_row() failed\n"); - else - fprintf(stdout, "\n\t%d %s returned\n", row_count, - row_count == 1 ? "row" : "rows"); + if (mysql_errno(mysql) != 0) + fprintf(stderr, "\n\tmysql_fetch_row() failed\n"); + else + fprintf(stdout, "\n\t%d %s returned\n", row_count, + row_count == 1 ? "row" : "rows"); + } return row_count; } @@ -470,34 +509,44 @@ int my_process_stmt_result(MYSQL_STMT *stmt) mysql_field_seek(result, 0); while (mysql_stmt_fetch(stmt) == 0) { - fputc('\t', stdout); - fputc('|', stdout); - + if (!opt_silent) + { + fputc('\t', stdout); + fputc('|', stdout); + } mysql_field_seek(result, 0); for (i= 0; i < field_count; i++) { field= mysql_fetch_field(result); - if (is_null[i]) - fprintf(stdout, " %-*s |", (int) field->max_length, "NULL"); - else if (length[i] == 0) + if (!opt_silent) { - data[i][0]= '\0'; /* unmodified buffer */ - fprintf(stdout, " %*s |", (int) field->max_length, data[i]); + if (is_null[i]) + fprintf(stdout, " %-*s |", (int) field->max_length, "NULL"); + else if (length[i] == 0) + { + data[i][0]= '\0'; /* unmodified buffer */ + fprintf(stdout, " %*s |", (int) field->max_length, data[i]); + } + else if (IS_NUM(field->type)) + fprintf(stdout, " %*s |", (int) field->max_length, data[i]); + else + fprintf(stdout, " %-*s |", (int) field->max_length, data[i]); } - else if (IS_NUM(field->type)) - fprintf(stdout, " %*s |", (int) field->max_length, data[i]); - else - fprintf(stdout, " %-*s |", (int) field->max_length, data[i]); } - fputc('\t', stdout); - fputc('\n', stdout); + if (!opt_silent) + { + fputc('\t', stdout); + fputc('\n', stdout); + } row_count++; } - if (row_count) - my_print_dashes(result); - - fprintf(stdout, "\n\t%d %s returned\n", row_count, - row_count == 1 ? "row" : "rows"); + if (!opt_silent) + { + if (row_count) + my_print_dashes(result); + fprintf(stdout, "\n\t%d %s returned\n", row_count, + row_count == 1 ? "row" : "rows"); + } mysql_free_result(result); return row_count; } @@ -511,7 +560,8 @@ int my_stmt_result(const char *buff) int row_count; int rc; - fprintf(stdout, "\n\n %s", buff); + if (!opt_silent) + fprintf(stdout, "\n\n %s", buff); stmt= mysql_simple_prepare(mysql, buff); check_stmt(stmt); @@ -537,7 +587,8 @@ static void verify_col_data(const char *table, const char *col, if (table && col) { strxmov(query, "SELECT ", col, " FROM ", table, " LIMIT 1", NullS); - fprintf(stdout, "\n %s", query); + if (!opt_silent) + fprintf(stdout, "\n %s", query); rc= mysql_query(mysql, query); myquery(rc); @@ -565,10 +616,12 @@ static void verify_col_data(const char *table, const char *col, /* Utility function to verify the field members */ static void verify_prepare_field(MYSQL_RES *result, - unsigned int no, const char *name, const char *org_name, - enum enum_field_types type, const char *table, - const char *org_table, const char *db, - unsigned long length, const char *def) + unsigned int no, const char *name, + const char *org_name, + enum enum_field_types type, + const char *table, + const char *org_table, const char *db, + unsigned long length, const char *def) { MYSQL_FIELD *field; @@ -577,23 +630,26 @@ static void verify_prepare_field(MYSQL_RES *result, fprintf(stdout, "\n *** ERROR: FAILED TO GET THE RESULT ***"); exit(1); } - fprintf(stdout, "\n field[%d]:", no); - fprintf(stdout, "\n name :`%s`\t(expected: `%s`)", field->name, name); - fprintf(stdout, "\n org_name :`%s`\t(expected: `%s`)", - field->org_name, org_name); - fprintf(stdout, "\n type :`%d`\t(expected: `%d`)", field->type, type); - fprintf(stdout, "\n table :`%s`\t(expected: `%s`)", - field->table, table); - fprintf(stdout, "\n org_table:`%s`\t(expected: `%s`)", - field->org_table, org_table); - fprintf(stdout, "\n database :`%s`\t(expected: `%s`)", field->db, db); - fprintf(stdout, "\n length :`%ld`\t(expected: `%ld`)", - field->length, length); - fprintf(stdout, "\n maxlength:`%ld`", field->max_length); - fprintf(stdout, "\n charsetnr:`%d`", field->charsetnr); - fprintf(stdout, "\n default :`%s`\t(expected: `%s`)", - field->def ? field->def : "(null)", def ? def: "(null)"); - fprintf(stdout, "\n"); + if (!opt_silent) + { + fprintf(stdout, "\n field[%d]:", no); + fprintf(stdout, "\n name :`%s`\t(expected: `%s`)", field->name, name); + fprintf(stdout, "\n org_name :`%s`\t(expected: `%s`)", + field->org_name, org_name); + fprintf(stdout, "\n type :`%d`\t(expected: `%d`)", field->type, type); + fprintf(stdout, "\n table :`%s`\t(expected: `%s`)", + field->table, table); + fprintf(stdout, "\n org_table:`%s`\t(expected: `%s`)", + field->org_table, org_table); + fprintf(stdout, "\n database :`%s`\t(expected: `%s`)", field->db, db); + fprintf(stdout, "\n length :`%ld`\t(expected: `%ld`)", + field->length, length); + fprintf(stdout, "\n maxlength:`%ld`", field->max_length); + fprintf(stdout, "\n charsetnr:`%d`", field->charsetnr); + fprintf(stdout, "\n default :`%s`\t(expected: `%s`)", + field->def ? field->def : "(null)", def ? def: "(null)"); + fprintf(stdout, "\n"); + } DIE_UNLESS(strcmp(field->name, name) == 0); DIE_UNLESS(strcmp(field->org_name, org_name) == 0); DIE_UNLESS(field->type == type); @@ -611,8 +667,9 @@ static void verify_prepare_field(MYSQL_RES *result, static void verify_param_count(MYSQL_STMT *stmt, long exp_count) { long param_count= mysql_stmt_param_count(stmt); - fprintf(stdout, "\n total parameters in stmt: `%ld` (expected: `%ld`)", - param_count, exp_count); + if (!opt_silent) + fprintf(stdout, "\n total parameters in stmt: `%ld` (expected: `%ld`)", + param_count, exp_count); DIE_UNLESS(param_count == exp_count); } @@ -622,8 +679,9 @@ static void verify_param_count(MYSQL_STMT *stmt, long exp_count) static void verify_st_affected_rows(MYSQL_STMT *stmt, ulonglong exp_count) { ulonglong affected_rows= mysql_stmt_affected_rows(stmt); - fprintf(stdout, "\n total affected rows: `%lld` (expected: `%lld`)", - affected_rows, exp_count); + if (!opt_silent) + fprintf(stdout, "\n total affected rows: `%lld` (expected: `%lld`)", + affected_rows, exp_count); DIE_UNLESS(affected_rows == exp_count); } @@ -633,7 +691,8 @@ static void verify_st_affected_rows(MYSQL_STMT *stmt, ulonglong exp_count) static void verify_affected_rows(ulonglong exp_count) { ulonglong affected_rows= mysql_affected_rows(mysql); - fprintf(stdout, "\n total affected rows: `%lld` (expected: `%lld`)", + if (!opt_silent) + fprintf(stdout, "\n total affected rows: `%lld` (expected: `%lld`)", affected_rows, exp_count); DIE_UNLESS(affected_rows == exp_count); } @@ -644,8 +703,9 @@ static void verify_affected_rows(ulonglong exp_count) static void verify_field_count(MYSQL_RES *result, uint exp_count) { uint field_count= mysql_num_fields(result); - fprintf(stdout, "\n total fields in the result set: `%d` (expected: `%d`)", - field_count, exp_count); + if (!opt_silent) + fprintf(stdout, "\n total fields in the result set: `%d` (expected: `%d`)", + field_count, exp_count); DIE_UNLESS(field_count == exp_count); } @@ -665,8 +725,9 @@ static void execute_prepare_query(const char *query, ulonglong exp_count) myquery(rc); affected_rows= mysql_stmt_affected_rows(stmt); - fprintf(stdout, "\n total affected rows: `%lld` (expected: `%lld`)", - affected_rows, exp_count); + if (!opt_silent) + fprintf(stdout, "\n total affected rows: `%lld` (expected: `%lld`)", + affected_rows, exp_count); DIE_UNLESS(affected_rows == exp_count); mysql_stmt_close(stmt); @@ -722,7 +783,8 @@ static my_bool thread_query(char *query) my_bool error; error= 0; - fprintf(stdout, "\n in thread_query(%s)", query); + if (!opt_silent) + fprintf(stdout, "\n in thread_query(%s)", query); if (!(l_mysql= mysql_init(NULL))) { myerror("mysql_init() failed"); @@ -753,6 +815,7 @@ end: static void test_debug_example() { + DBUG_ENTER("fill_tables"); int rc; MYSQL_RES *result; @@ -1033,7 +1096,8 @@ static void test_prepare_field_result() my_print_result_metadata(result); - fprintf(stdout, "\n\n field attributes:\n"); + if (!opt_silent) + fprintf(stdout, "\n\n field attributes:\n"); verify_prepare_field(result, 0, "int_c", "int_c", MYSQL_TYPE_LONG, "t1", "test_prepare_field_result", current_db, 11, 0); verify_prepare_field(result, 1, "var_c", "var_c", MYSQL_TYPE_VAR_STRING, @@ -1207,17 +1271,20 @@ static void test_prepare() rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - fprintf(stdout, "\n"); + if (!opt_silent) + { + fprintf(stdout, "\n"); - fprintf(stdout, "\n\t tiny : %d (%lu)", tiny_data, length[0]); - fprintf(stdout, "\n\t short : %d (%lu)", small_data, length[3]); - fprintf(stdout, "\n\t int : %d (%lu)", int_data, length[2]); - fprintf(stdout, "\n\t big : %lld (%lu)", big_data, length[4]); + fprintf(stdout, "\n\t tiny : %d (%lu)", tiny_data, length[0]); + fprintf(stdout, "\n\t short : %d (%lu)", small_data, length[3]); + fprintf(stdout, "\n\t int : %d (%lu)", int_data, length[2]); + fprintf(stdout, "\n\t big : %lld (%lu)", big_data, length[4]); - fprintf(stdout, "\n\t float : %f (%lu)", real_data, length[5]); - fprintf(stdout, "\n\t double : %f (%lu)", double_data, length[6]); + fprintf(stdout, "\n\t float : %f (%lu)", real_data, length[5]); + fprintf(stdout, "\n\t double : %f (%lu)", double_data, length[6]); - fprintf(stdout, "\n\t str : %s (%lu)", str_data, length[1]); + fprintf(stdout, "\n\t str : %s (%lu)", str_data, length[1]); + } DIE_UNLESS(tiny_data == o_tiny_data); DIE_UNLESS(is_null[0] == 0); @@ -1578,11 +1645,13 @@ static void test_fetch_null() rc++; for (i= 0; i < 10; i++) { - fprintf(stdout, "\n data[%d] : %s", i, - is_null[i] ? "NULL" : "NOT NULL"); + if (!opt_silent) + fprintf(stdout, "\n data[%d] : %s", i, + is_null[i] ? "NULL" : "NOT NULL"); DIE_UNLESS(is_null[i]); } - fprintf(stdout, "\n data[%d]: %d", i, nData); + if (!opt_silent) + fprintf(stdout, "\n data[%d]: %d", i, nData); DIE_UNLESS(nData == 1000 || nData == 88 || nData == 389789); DIE_UNLESS(is_null[i] == 0); DIE_UNLESS(length[i] == 4); @@ -2367,7 +2436,8 @@ static void test_long_data() /* execute */ rc= mysql_stmt_execute(stmt); - fprintf(stdout, " mysql_stmt_execute() returned %d\n", rc); + if (!opt_silent) + fprintf(stdout, " mysql_stmt_execute() returned %d\n", rc); check_execute(stmt, rc); rc= mysql_commit(mysql); @@ -2450,7 +2520,8 @@ static void test_long_data_str() } /* execute */ rc= mysql_stmt_execute(stmt); - fprintf(stdout, " mysql_stmt_execute() returned %d\n", rc); + if (!opt_silent) + fprintf(stdout, " mysql_stmt_execute() returned %d\n", rc); check_execute(stmt, rc); mysql_stmt_close(stmt); @@ -2541,7 +2612,8 @@ static void test_long_data_str1() /* execute */ rc= mysql_stmt_execute(stmt); - fprintf(stdout, " mysql_stmt_execute() returned %d\n", rc); + if (!opt_silent) + fprintf(stdout, " mysql_stmt_execute() returned %d\n", rc); check_execute(stmt, rc); mysql_stmt_close(stmt); @@ -2692,7 +2764,8 @@ static void test_long_data_bin() } /* execute */ rc= mysql_stmt_execute(stmt); - fprintf(stdout, " mysql_stmt_execute() returned %d\n", rc); + if (!opt_silent) + fprintf(stdout, " mysql_stmt_execute() returned %d\n", rc); check_execute(stmt, rc); mysql_stmt_close(stmt); @@ -2999,7 +3072,8 @@ static void test_bind_result() rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - fprintf(stdout, "\n row 1: %d, %s(%lu)", nData, szData, length1); + if (!opt_silent) + fprintf(stdout, "\n row 1: %d, %s(%lu)", nData, szData, length1); DIE_UNLESS(nData == 10); DIE_UNLESS(strcmp(szData, "venu") == 0); DIE_UNLESS(length1 == 4); @@ -3007,7 +3081,8 @@ static void test_bind_result() rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - fprintf(stdout, "\n row 2: %d, %s(%lu)", nData, szData, length1); + if (!opt_silent) + fprintf(stdout, "\n row 2: %d, %s(%lu)", nData, szData, length1); DIE_UNLESS(nData == 20); DIE_UNLESS(strcmp(szData, "MySQL") == 0); DIE_UNLESS(length1 == 5); @@ -3016,7 +3091,7 @@ static void test_bind_result() rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - if (is_null[0]) + if (!opt_silent && is_null[0]) fprintf(stdout, "\n row 3: NULL, %s(%lu)", szData, length1); DIE_UNLESS(is_null[0]); DIE_UNLESS(strcmp(szData, "monty") == 0); @@ -3114,19 +3189,21 @@ static void test_bind_result_ext() rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - fprintf(stdout, "\n data (tiny) : %d", t_data); - fprintf(stdout, "\n data (short) : %d", s_data); - fprintf(stdout, "\n data (int) : %d", i_data); - fprintf(stdout, "\n data (big) : %lld", b_data); + if (!opt_silent) + { + fprintf(stdout, "\n data (tiny) : %d", t_data); + fprintf(stdout, "\n data (short) : %d", s_data); + fprintf(stdout, "\n data (int) : %d", i_data); + fprintf(stdout, "\n data (big) : %lld", b_data); - fprintf(stdout, "\n data (float) : %f", f_data); - fprintf(stdout, "\n data (double) : %f", d_data); + fprintf(stdout, "\n data (float) : %f", f_data); + fprintf(stdout, "\n data (double) : %f", d_data); - fprintf(stdout, "\n data (str) : %s(%lu)", szData, szLength); - - bData[bLength]= '\0'; /* bData is binary */ - fprintf(stdout, "\n data (bin) : %s(%lu)", bData, bLength); + fprintf(stdout, "\n data (str) : %s(%lu)", szData, szLength); + bData[bLength]= '\0'; /* bData is binary */ + fprintf(stdout, "\n data (bin) : %s(%lu)", bData, bLength); + } DIE_UNLESS(t_data == 19); DIE_UNLESS(s_data == 2999); @@ -3234,16 +3311,19 @@ static void test_bind_result_ext1() rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - fprintf(stdout, "\n data (tiny) : %s(%lu)", t_data, length[0]); - fprintf(stdout, "\n data (short) : %f(%lu)", s_data, length[1]); - fprintf(stdout, "\n data (int) : %d(%lu)", i_data, length[2]); - fprintf(stdout, "\n data (big) : %d(%lu)", b_data, length[3]); + if (!opt_silent) + { + fprintf(stdout, "\n data (tiny) : %s(%lu)", t_data, length[0]); + fprintf(stdout, "\n data (short) : %f(%lu)", s_data, length[1]); + fprintf(stdout, "\n data (int) : %d(%lu)", i_data, length[2]); + fprintf(stdout, "\n data (big) : %d(%lu)", b_data, length[3]); - fprintf(stdout, "\n data (float) : %d(%lu)", f_data, length[4]); - fprintf(stdout, "\n data (double) : %s(%lu)", d_data, length[5]); + fprintf(stdout, "\n data (float) : %d(%lu)", f_data, length[4]); + fprintf(stdout, "\n data (double) : %s(%lu)", d_data, length[5]); - fprintf(stdout, "\n data (bin) : %ld(%lu)", bData, length[6]); - fprintf(stdout, "\n data (str) : %g(%lu)", szData, length[7]); + fprintf(stdout, "\n data (bin) : %ld(%lu)", bData, length[6]); + fprintf(stdout, "\n data (str) : %g(%lu)", szData, length[7]); + } DIE_UNLESS(strcmp(t_data, "120") == 0); DIE_UNLESS(i_data == 3999); @@ -3368,15 +3448,17 @@ static void bind_fetch(int row_count) rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - fprintf(stdout, "\n"); - fprintf(stdout, "\n tiny : %ld(%lu)", (ulong) i8_data, length[0]); - fprintf(stdout, "\n short : %ld(%lu)", (ulong) i16_data, length[1]); - fprintf(stdout, "\n int : %ld(%lu)", (ulong) i32_data, length[2]); - fprintf(stdout, "\n longlong : %ld(%lu)", (ulong) i64_data, length[3]); - fprintf(stdout, "\n float : %f(%lu)", f_data, length[4]); - fprintf(stdout, "\n double : %g(%lu)", d_data, length[5]); - fprintf(stdout, "\n char : %s(%lu)", s_data, length[6]); - + if (!opt_silent) + { + fprintf(stdout, "\n"); + fprintf(stdout, "\n tiny : %ld(%lu)", (ulong) i8_data, length[0]); + fprintf(stdout, "\n short : %ld(%lu)", (ulong) i16_data, length[1]); + fprintf(stdout, "\n int : %ld(%lu)", (ulong) i32_data, length[2]); + fprintf(stdout, "\n longlong : %ld(%lu)", (ulong) i64_data, length[3]); + fprintf(stdout, "\n float : %f(%lu)", f_data, length[4]); + fprintf(stdout, "\n double : %g(%lu)", d_data, length[5]); + fprintf(stdout, "\n char : %s(%lu)", s_data, length[6]); + } rc= 10+row_count; /* TINY */ @@ -3518,13 +3600,16 @@ static void test_fetch_date() rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - fprintf(stdout, "\n date : %s(%lu)", date, d_length); - fprintf(stdout, "\n time : %s(%lu)", time, t_length); - fprintf(stdout, "\n ts : %s(%lu)", ts, ts_length); - fprintf(stdout, "\n year : %d(%lu)", year, y_length); - fprintf(stdout, "\n dt : %s(%lu)", dt, dt_length); - fprintf(stdout, "\n ts(4) : %s(%lu)", ts_4, ts4_length); - fprintf(stdout, "\n ts(6) : %s(%lu)", ts_6, ts6_length); + if (!opt_silent) + { + fprintf(stdout, "\n date : %s(%lu)", date, d_length); + fprintf(stdout, "\n time : %s(%lu)", time, t_length); + fprintf(stdout, "\n ts : %s(%lu)", ts, ts_length); + fprintf(stdout, "\n year : %d(%lu)", year, y_length); + fprintf(stdout, "\n dt : %s(%lu)", dt, dt_length); + fprintf(stdout, "\n ts(4) : %s(%lu)", ts_4, ts4_length); + fprintf(stdout, "\n ts(6) : %s(%lu)", ts_6, ts6_length); + } DIE_UNLESS(strcmp(date, "2002-01-02") == 0); DIE_UNLESS(d_length == 10); @@ -3851,7 +3936,8 @@ static void test_field_names() myheader("test_field_names"); - fprintf(stdout, "\n %d, %d, %d", MYSQL_TYPE_DECIMAL, MYSQL_TYPE_NEWDATE, MYSQL_TYPE_ENUM); + if (!opt_silent) + fprintf(stdout, "\n %d, %d, %d", MYSQL_TYPE_DECIMAL, MYSQL_TYPE_NEWDATE, MYSQL_TYPE_ENUM); rc= mysql_query(mysql, "DROP TABLE IF EXISTS test_field_names1"); myquery(rc); @@ -3902,7 +3988,8 @@ static void test_warnings() rc= mysql_query(mysql, "DROP TABLE if exists test_non_exists"); myquery(rc); - fprintf(stdout, "\n total warnings: %d", mysql_warning_count(mysql)); + if (!opt_silent) + fprintf(stdout, "\n total warnings: %d", mysql_warning_count(mysql)); rc= mysql_query(mysql, "SHOW WARNINGS"); myquery(rc); @@ -4084,23 +4171,27 @@ static void test_field_flags() mytest(result); mysql_field_seek(result, 0); - fputc('\n', stdout); + if (!opt_silent) + fputc('\n', stdout); for(i= 0; i< mysql_num_fields(result); i++) { field= mysql_fetch_field(result); - fprintf(stdout, "\n field:%d", i); - if (field->flags & NOT_NULL_FLAG) - fprintf(stdout, "\n NOT_NULL_FLAG"); - if (field->flags & PRI_KEY_FLAG) - fprintf(stdout, "\n PRI_KEY_FLAG"); - if (field->flags & UNIQUE_KEY_FLAG) - fprintf(stdout, "\n UNIQUE_KEY_FLAG"); - if (field->flags & MULTIPLE_KEY_FLAG) - fprintf(stdout, "\n MULTIPLE_KEY_FLAG"); - if (field->flags & AUTO_INCREMENT_FLAG) - fprintf(stdout, "\n AUTO_INCREMENT_FLAG"); + if (!opt_silent) + { + fprintf(stdout, "\n field:%d", i); + if (field->flags & NOT_NULL_FLAG) + fprintf(stdout, "\n NOT_NULL_FLAG"); + if (field->flags & PRI_KEY_FLAG) + fprintf(stdout, "\n PRI_KEY_FLAG"); + if (field->flags & UNIQUE_KEY_FLAG) + fprintf(stdout, "\n UNIQUE_KEY_FLAG"); + if (field->flags & MULTIPLE_KEY_FLAG) + fprintf(stdout, "\n MULTIPLE_KEY_FLAG"); + if (field->flags & AUTO_INCREMENT_FLAG) + fprintf(stdout, "\n AUTO_INCREMENT_FLAG"); + } } mysql_free_result(result); } @@ -4119,7 +4210,8 @@ static void test_stmt_close() myheader("test_stmt_close"); - fprintf(stdout, "\n Establishing a test connection ..."); + if (!opt_silent) + fprintf(stdout, "\n Establishing a test connection ..."); if (!(lmysql= mysql_init(NULL))) { myerror("mysql_init() failed"); @@ -4132,7 +4224,8 @@ static void test_stmt_close() myerror("connection failed"); exit(1); } - fprintf(stdout, " OK"); + if (!opt_silent) + fprintf(stdout, " OK"); /* set AUTOCOMMIT to ON*/ @@ -4169,7 +4262,8 @@ static void test_stmt_close() verify_param_count(stmt2, 1); rc= mysql_stmt_close(stmt1); - fprintf(stdout, "\n mysql_close_stmt(1) returned: %d", rc); + if (!opt_silent) + fprintf(stdout, "\n mysql_close_stmt(1) returned: %d", rc); DIE_UNLESS(rc == 0); /* @@ -4203,7 +4297,8 @@ static void test_stmt_close() verify_st_affected_rows(stmt_x, 1); rc= mysql_stmt_close(stmt_x); - fprintf(stdout, "\n mysql_close_stmt(x) returned: %d", rc); + if (!opt_silent) + fprintf(stdout, "\n mysql_close_stmt(x) returned: %d", rc); DIE_UNLESS( rc == 0); rc= mysql_query(mysql, "SELECT id FROM test_stmt_close"); @@ -4262,7 +4357,8 @@ static void test_set_variable() rc= mysql_stmt_fetch(stmt1); check_execute(stmt1, rc); - fprintf(stdout, "\n max_error_count(default): %d", get_count); + if (!opt_silent) + fprintf(stdout, "\n max_error_count(default): %d", get_count); def_count= get_count; DIE_UNLESS(strcmp(var, "max_error_count") == 0); @@ -4292,7 +4388,8 @@ static void test_set_variable() rc= mysql_stmt_fetch(stmt1); check_execute(stmt1, rc); - fprintf(stdout, "\n max_error_count : %d", get_count); + if (!opt_silent) + fprintf(stdout, "\n max_error_count : %d", get_count); DIE_UNLESS(get_count == set_count); rc= mysql_stmt_fetch(stmt1); @@ -4309,7 +4406,8 @@ static void test_set_variable() rc= mysql_stmt_fetch(stmt1); check_execute(stmt1, rc); - fprintf(stdout, "\n max_error_count(default): %d", get_count); + if (!opt_silent) + fprintf(stdout, "\n max_error_count(default): %d", get_count); DIE_UNLESS(get_count == set_count); rc= mysql_stmt_fetch(stmt1); @@ -4367,12 +4465,14 @@ static void test_insert_meta() mysql_field_seek(result, 0); field= mysql_fetch_field(result); mytest(field); - fprintf(stdout, "\n obtained: `%s` (expected: `%s`)", field->name, "col1"); + if (!opt_silent) + fprintf(stdout, "\n obtained: `%s` (expected: `%s`)", field->name, "col1"); DIE_UNLESS(strcmp(field->name, "col1") == 0); field= mysql_fetch_field(result); mytest(field); - fprintf(stdout, "\n obtained: `%s` (expected: `%s`)", field->name, "col3"); + if (!opt_silent) + fprintf(stdout, "\n obtained: `%s` (expected: `%s`)", field->name, "col3"); DIE_UNLESS(strcmp(field->name, "col3") == 0); field= mysql_fetch_field(result); @@ -4429,15 +4529,21 @@ static void test_update_meta() mysql_field_seek(result, 0); field= mysql_fetch_field(result); mytest(field); - fprintf(stdout, "\n col obtained: `%s` (expected: `%s`)", field->name, "col1"); - fprintf(stdout, "\n tab obtained: `%s` (expected: `%s`)", field->table, "test_prep_update"); + if (!opt_silent) + { + fprintf(stdout, "\n col obtained: `%s` (expected: `%s`)", field->name, "col1"); + fprintf(stdout, "\n tab obtained: `%s` (expected: `%s`)", field->table, "test_prep_update"); + } DIE_UNLESS(strcmp(field->name, "col1") == 0); DIE_UNLESS(strcmp(field->table, "test_prep_update") == 0); field= mysql_fetch_field(result); mytest(field); - fprintf(stdout, "\n col obtained: `%s` (expected: `%s`)", field->name, "col3"); - fprintf(stdout, "\n tab obtained: `%s` (expected: `%s`)", field->table, "test_prep_update"); + if (!opt_silent) + { + fprintf(stdout, "\n col obtained: `%s` (expected: `%s`)", field->name, "col3"); + fprintf(stdout, "\n tab obtained: `%s` (expected: `%s`)", field->table, "test_prep_update"); + } DIE_UNLESS(strcmp(field->name, "col3") == 0); DIE_UNLESS(strcmp(field->table, "test_prep_update") == 0); @@ -4493,15 +4599,21 @@ static void test_select_meta() mysql_field_seek(result, 0); field= mysql_fetch_field(result); mytest(field); - fprintf(stdout, "\n col obtained: `%s` (expected: `%s`)", field->name, "col1"); - fprintf(stdout, "\n tab obtained: `%s` (expected: `%s`)", field->table, "test_prep_select"); + if (!opt_silent) + { + fprintf(stdout, "\n col obtained: `%s` (expected: `%s`)", field->name, "col1"); + fprintf(stdout, "\n tab obtained: `%s` (expected: `%s`)", field->table, "test_prep_select"); + } DIE_UNLESS(strcmp(field->name, "col1") == 0); DIE_UNLESS(strcmp(field->table, "test_prep_select") == 0); field= mysql_fetch_field(result); mytest(field); - fprintf(stdout, "\n col obtained: `%s` (expected: `%s`)", field->name, "col2"); - fprintf(stdout, "\n tab obtained: `%s` (expected: `%s`)", field->table, "test_prep_select"); + if (!opt_silent) + { + fprintf(stdout, "\n col obtained: `%s` (expected: `%s`)", field->name, "col2"); + fprintf(stdout, "\n tab obtained: `%s` (expected: `%s`)", field->table, "test_prep_select"); + } DIE_UNLESS(strcmp(field->name, "col2") == 0); DIE_UNLESS(strcmp(field->table, "test_prep_select") == 0); @@ -4545,8 +4657,9 @@ static void test_func_fields() field= mysql_fetch_field(result); mytest(field); - fprintf(stdout, "\n table name: `%s` (expected: `%s`)", field->table, - "test_dateformat"); + if (!opt_silent) + fprintf(stdout, "\n table name: `%s` (expected: `%s`)", field->table, + "test_dateformat"); DIE_UNLESS(strcmp(field->table, "test_dateformat") == 0); field= mysql_fetch_field(result); @@ -4563,7 +4676,8 @@ static void test_func_fields() field= mysql_fetch_field(result); mytest(field); - fprintf(stdout, "\n table name: `%s` (expected: `%s`)", field->table, ""); + if (!opt_silent) + fprintf(stdout, "\n table name: `%s` (expected: `%s`)", field->table, ""); DIE_UNLESS(field->table[0] == '\0'); field= mysql_fetch_field(result); @@ -4580,8 +4694,11 @@ static void test_func_fields() field= mysql_fetch_field(result); mytest(field); - fprintf(stdout, "\n field name: `%s` (expected: `%s`)", field->name, "YEAR"); - fprintf(stdout, "\n field org name: `%s` (expected: `%s`)", field->org_name, ""); + if (!opt_silent) + { + printf("\n field name: `%s` (expected: `%s`)", field->name, "YEAR"); + printf("\n field org name: `%s` (expected: `%s`)", field->org_name, ""); + } DIE_UNLESS(strcmp(field->name, "YEAR") == 0); DIE_UNLESS(field->org_name[0] == '\0'); @@ -4658,8 +4775,11 @@ static void test_multi_stmt() rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - fprintf(stdout, "\n int_data: %lu(%lu)", (ulong) id, length[0]); - fprintf(stdout, "\n str_data: %s(%lu)", name, length[1]); + if (!opt_silent) + { + fprintf(stdout, "\n int_data: %lu(%lu)", (ulong) id, length[0]); + fprintf(stdout, "\n str_data: %s(%lu)", name, length[1]); + } DIE_UNLESS(id == 10); DIE_UNLESS(strcmp(name, "mysql") == 0); @@ -4687,8 +4807,11 @@ static void test_multi_stmt() rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - fprintf(stdout, "\n int_data: %lu(%lu)", (ulong) id, length[0]); - fprintf(stdout, "\n str_data: %s(%lu)", name, length[1]); + if (!opt_silent) + { + fprintf(stdout, "\n int_data: %lu(%lu)", (ulong) id, length[0]); + fprintf(stdout, "\n str_data: %s(%lu)", name, length[1]); + } DIE_UNLESS(id == 10); DIE_UNLESS(strcmp(name, "updated") == 0); @@ -4762,12 +4885,14 @@ static void test_manual_sample() fprintf(stderr, "\n %s", mysql_error(mysql)); exit(1); } - fprintf(stdout, "\n prepare, insert successful"); + if (!opt_silent) + fprintf(stdout, "\n prepare, insert successful"); /* Get the parameter count from the statement */ param_count= mysql_stmt_param_count(stmt); - fprintf(stdout, "\n total parameters in insert: %d", param_count); + if (!opt_silent) + fprintf(stdout, "\n total parameters in insert: %d", param_count); if (param_count != 3) /* validate parameter count */ { fprintf(stderr, "\n invalid parameter count returned by MySQL"); @@ -4823,7 +4948,8 @@ static void test_manual_sample() /* Get the total rows affected */ affected_rows= mysql_stmt_affected_rows(stmt); - fprintf(stdout, "\n total affected rows: %lld", affected_rows); + if (!opt_silent) + fprintf(stdout, "\n total affected rows: %lld", affected_rows); if (affected_rows != 1) /* validate affected rows */ { fprintf(stderr, "\n invalid affected rows by MySQL"); @@ -4847,7 +4973,8 @@ static void test_manual_sample() /* Get the total rows affected */ affected_rows= mysql_stmt_affected_rows(stmt); - fprintf(stdout, "\n total affected rows: %lld", affected_rows); + if (!opt_silent) + fprintf(stdout, "\n total affected rows: %lld", affected_rows); if (affected_rows != 1) /* validate affected rows */ { fprintf(stderr, "\n invalid affected rows by MySQL"); @@ -4871,7 +4998,8 @@ static void test_manual_sample() fprintf(stderr, "\n %s", mysql_error(mysql)); exit(1); } - fprintf(stdout, "Success !!!"); + if (!opt_silent) + fprintf(stdout, "Success !!!"); } @@ -4993,13 +5121,14 @@ DROP TABLE IF EXISTS test_multi_tab"; for (count= 0 ; count < array_elements(rows) ; count++) { - fprintf(stdout, "\n Query %d: ", count); + if (!opt_silent) + fprintf(stdout, "\n Query %d: ", count); if ((result= mysql_store_result(mysql_local))) { (void) my_process_result_set(result); mysql_free_result(result); } - else + else if (!opt_silent) fprintf(stdout, "OK, %lld row(s) affected, %d warning(s)\n", mysql_affected_rows(mysql_local), mysql_warning_count(mysql_local)); @@ -5007,7 +5136,7 @@ DROP TABLE IF EXISTS test_multi_tab"; exp_value= (uint) mysql_affected_rows(mysql_local); if (rows[count] != exp_value) { - fprintf(stdout, "row %d had affected rows: %d, should be %d\n", + fprintf(stderr, "row %d had affected rows: %d, should be %d\n", count, exp_value, rows[count]); exit(1); } @@ -5083,7 +5212,7 @@ static void test_prepare_multi_statements() if (!(mysql_local= mysql_init(NULL))) { - fprintf(stdout, "\n mysql_init() failed"); + fprintf(stderr, "\n mysql_init() failed"); exit(1); } @@ -5091,7 +5220,7 @@ static void test_prepare_multi_statements() opt_password, current_db, opt_port, opt_unix_socket, CLIENT_MULTI_STATEMENTS))) { - fprintf(stdout, "\n connection failed(%s)", mysql_error(mysql_local)); + fprintf(stderr, "\n connection failed(%s)", mysql_error(mysql_local)); exit(1); } strmov(query, "select 1; select 'another value'"); @@ -5159,7 +5288,8 @@ static void test_store_result() rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - fprintf(stdout, "\n row 1: %ld, %s(%lu)", (long) nData, szData, length1); + if (!opt_silent) + fprintf(stdout, "\n row 1: %ld, %s(%lu)", (long) nData, szData, length1); DIE_UNLESS(nData == 10); DIE_UNLESS(strcmp(szData, "venu") == 0); DIE_UNLESS(length1 == 4); @@ -5167,7 +5297,8 @@ static void test_store_result() rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - fprintf(stdout, "\n row 2: %ld, %s(%lu)", (long) nData, szData, length1); + if (!opt_silent) + fprintf(stdout, "\n row 2: %ld, %s(%lu)", (long) nData, szData, length1); DIE_UNLESS(nData == 20); DIE_UNLESS(strcmp(szData, "mysql") == 0); DIE_UNLESS(length1 == 5); @@ -5176,7 +5307,7 @@ static void test_store_result() rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - if (is_null[0]) + if (!opt_silent && is_null[0]) fprintf(stdout, "\n row 3: NULL, %s(%lu)", szData, length1); DIE_UNLESS(is_null[0]); DIE_UNLESS(strcmp(szData, "monty") == 0); @@ -5194,7 +5325,8 @@ static void test_store_result() rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - fprintf(stdout, "\n row 1: %ld, %s(%lu)", (long) nData, szData, length1); + if (!opt_silent) + fprintf(stdout, "\n row 1: %ld, %s(%lu)", (long) nData, szData, length1); DIE_UNLESS(nData == 10); DIE_UNLESS(strcmp(szData, "venu") == 0); DIE_UNLESS(length1 == 4); @@ -5202,7 +5334,8 @@ static void test_store_result() rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - fprintf(stdout, "\n row 2: %ld, %s(%lu)", (long) nData, szData, length1); + if (!opt_silent) + fprintf(stdout, "\n row 2: %ld, %s(%lu)", (long) nData, szData, length1); DIE_UNLESS(nData == 20); DIE_UNLESS(strcmp(szData, "mysql") == 0); DIE_UNLESS(length1 == 5); @@ -5211,7 +5344,7 @@ static void test_store_result() rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - if (is_null[0]) + if (!opt_silent && is_null[0]) fprintf(stdout, "\n row 3: NULL, %s(%lu)", szData, length1); DIE_UNLESS(is_null[0]); DIE_UNLESS(strcmp(szData, "monty") == 0); @@ -5260,7 +5393,8 @@ static void test_store_result1() rc= 0; while (mysql_stmt_fetch(stmt) != MYSQL_NO_DATA) rc++; - fprintf(stdout, "\n total rows: %d", rc); + if (!opt_silent) + fprintf(stdout, "\n total rows: %d", rc); DIE_UNLESS(rc == 3); rc= mysql_stmt_execute(stmt); @@ -5272,7 +5406,8 @@ static void test_store_result1() rc= 0; while (mysql_stmt_fetch(stmt) != MYSQL_NO_DATA) rc++; - fprintf(stdout, "\n total rows: %d", rc); + if (!opt_silent) + fprintf(stdout, "\n total rows: %d", rc); DIE_UNLESS(rc == 3); mysql_stmt_close(stmt); @@ -5338,7 +5473,8 @@ static void test_store_result2() rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - fprintf(stdout, "\n row 1: %d", nData); + if (!opt_silent) + fprintf(stdout, "\n row 1: %d", nData); DIE_UNLESS(nData == 10); rc= mysql_stmt_fetch(stmt); @@ -5355,7 +5491,8 @@ static void test_store_result2() rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - fprintf(stdout, "\n row 1: %d", nData); + if (!opt_silent) + fprintf(stdout, "\n row 1: %d", nData); DIE_UNLESS(nData == 20); rc= mysql_stmt_fetch(stmt); @@ -5458,7 +5595,8 @@ static void test_subselect() rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - fprintf(stdout, "\n row 1: %d", id); + if (!opt_silent) + fprintf(stdout, "\n row 1: %d", id); DIE_UNLESS(id == 1); rc= mysql_stmt_fetch(stmt); @@ -5471,7 +5609,8 @@ static void test_subselect() rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - fprintf(stdout, "\n row 1: %d", id); + if (!opt_silent) + fprintf(stdout, "\n row 1: %d", id); DIE_UNLESS(id == 0); rc= mysql_stmt_fetch(stmt); @@ -5587,21 +5726,21 @@ static void test_bind_date_conv(uint row_count) rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - fprintf(stdout, "\n"); + if (!opt_silent) + fprintf(stdout, "\n"); for (i= 0; i < array_elements(bind); i++) { - fprintf(stdout, "\n"); - fprintf(stdout, " time[%d]: %02d-%02d-%02d %02d:%02d:%02d.%02lu", - i, tm[i].year, tm[i].month, tm[i].day, - tm[i].hour, tm[i].minute, tm[i].second, - tm[i].second_part); - + if (!opt_silent) + fprintf(stdout, "\ntime[%d]: %02d-%02d-%02d %02d:%02d:%02d.%02lu", + i, tm[i].year, tm[i].month, tm[i].day, + tm[i].hour, tm[i].minute, tm[i].second, + tm[i].second_part); DIE_UNLESS(tm[i].year == 0 || tm[i].year == year+count); DIE_UNLESS(tm[i].month == 0 || tm[i].month == month+count); DIE_UNLESS(tm[i].day == 0 || tm[i].day == day+count); DIE_UNLESS(tm[i].hour == 0 || tm[i].hour == hour+count); -#if 0 +#ifdef NOT_USED /* minute causes problems from date<->time, don't assert, instead validate separatly in another routine @@ -5856,7 +5995,8 @@ static void test_buffers() buffer[1]= 'X'; rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - fprintf(stdout, "\n data: %s (%lu)", buffer, length); + if (!opt_silent) + fprintf(stdout, "\n data: %s (%lu)", buffer, length); DIE_UNLESS(buffer[0] == 'M'); DIE_UNLESS(buffer[1] == 'X'); DIE_UNLESS(length == 5); @@ -5867,7 +6007,8 @@ static void test_buffers() rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - fprintf(stdout, "\n data: %s (%lu)", buffer, length); + if (!opt_silent) + fprintf(stdout, "\n data: %s (%lu)", buffer, length); DIE_UNLESS(strncmp(buffer, "Database", 8) == 0); DIE_UNLESS(length == 8); @@ -5877,7 +6018,8 @@ static void test_buffers() rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - fprintf(stdout, "\n data: %s (%lu)", buffer, length); + if (!opt_silent) + fprintf(stdout, "\n data: %s (%lu)", buffer, length); DIE_UNLESS(strcmp(buffer, "Open-Source") == 0); DIE_UNLESS(length == 11); @@ -5887,7 +6029,8 @@ static void test_buffers() rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - fprintf(stdout, "\n data: %s (%lu)", buffer, length); + if (!opt_silent) + fprintf(stdout, "\n data: %s (%lu)", buffer, length); DIE_UNLESS(strncmp(buffer, "Popula", 6) == 0); DIE_UNLESS(length == 7); @@ -6018,7 +6161,8 @@ static void test_fetch_nobuffs() while (mysql_stmt_fetch(stmt) != MYSQL_NO_DATA) rc++; - fprintf(stdout, "\n total rows : %d", rc); + if (!opt_silent) + fprintf(stdout, "\n total rows : %d", rc); DIE_UNLESS(rc == 1); bind[0].buffer_type= MYSQL_TYPE_STRING; @@ -6041,12 +6185,16 @@ static void test_fetch_nobuffs() while (mysql_stmt_fetch(stmt) != MYSQL_NO_DATA) { rc++; - fprintf(stdout, "\n CURRENT_DATABASE(): %s", str[0]); - fprintf(stdout, "\n CURRENT_USER() : %s", str[1]); - fprintf(stdout, "\n CURRENT_DATE() : %s", str[2]); - fprintf(stdout, "\n CURRENT_TIME() : %s", str[3]); + if (!opt_silent) + { + fprintf(stdout, "\n CURRENT_DATABASE(): %s", str[0]); + fprintf(stdout, "\n CURRENT_USER() : %s", str[1]); + fprintf(stdout, "\n CURRENT_DATE() : %s", str[2]); + fprintf(stdout, "\n CURRENT_TIME() : %s", str[3]); + } } - fprintf(stdout, "\n total rows : %d", rc); + if (!opt_silent) + fprintf(stdout, "\n total rows : %d", rc); DIE_UNLESS(rc == 1); mysql_stmt_close(stmt); @@ -6113,10 +6261,13 @@ static void test_ushort_bug() rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - fprintf(stdout, "\n ushort : %d (%ld)", short_value, s_length); - fprintf(stdout, "\n ulong : %lu (%ld)", (ulong) long_value, l_length); - fprintf(stdout, "\n longlong : %lld (%ld)", longlong_value, ll_length); - fprintf(stdout, "\n tinyint : %d (%ld)", tiny_value, t_length); + if (!opt_silent) + { + fprintf(stdout, "\n ushort : %d (%ld)", short_value, s_length); + fprintf(stdout, "\n ulong : %lu (%ld)", (ulong) long_value, l_length); + fprintf(stdout, "\n longlong : %lld (%ld)", longlong_value, ll_length); + fprintf(stdout, "\n tinyint : %d (%ld)", tiny_value, t_length); + } DIE_UNLESS(short_value == 35999); DIE_UNLESS(s_length == 2); @@ -6197,10 +6348,13 @@ static void test_sshort_bug() rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - fprintf(stdout, "\n sshort : %d (%ld)", short_value, s_length); - fprintf(stdout, "\n slong : %ld (%ld)", (long) long_value, l_length); - fprintf(stdout, "\n longlong : %lld (%ld)", longlong_value, ll_length); - fprintf(stdout, "\n tinyint : %d (%ld)", tiny_value, t_length); + if (!opt_silent) + { + fprintf(stdout, "\n sshort : %d (%ld)", short_value, s_length); + fprintf(stdout, "\n slong : %ld (%ld)", (long) long_value, l_length); + fprintf(stdout, "\n longlong : %lld (%ld)", longlong_value, ll_length); + fprintf(stdout, "\n tinyint : %d (%ld)", tiny_value, t_length); + } DIE_UNLESS(short_value == -5999); DIE_UNLESS(s_length == 2); @@ -6281,10 +6435,13 @@ static void test_stiny_bug() rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - fprintf(stdout, "\n sshort : %d (%ld)", short_value, s_length); - fprintf(stdout, "\n slong : %ld (%ld)", (long) long_value, l_length); - fprintf(stdout, "\n longlong : %lld (%ld)", longlong_value, ll_length); - fprintf(stdout, "\n tinyint : %d (%ld)", tiny_value, t_length); + if (!opt_silent) + { + fprintf(stdout, "\n sshort : %d (%ld)", short_value, s_length); + fprintf(stdout, "\n slong : %ld (%ld)", (long) long_value, l_length); + fprintf(stdout, "\n longlong : %lld (%ld)", longlong_value, ll_length); + fprintf(stdout, "\n tinyint : %d (%ld)", tiny_value, t_length); + } DIE_UNLESS(short_value == -128); DIE_UNLESS(s_length == 2); @@ -6373,7 +6530,8 @@ static void test_field_misc() rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - fprintf(stdout, "\n default table type: %s(%ld)", table_type, type_length); + if (!opt_silent) + fprintf(stdout, "\n default table type: %s(%ld)", table_type, type_length); rc= mysql_stmt_fetch(stmt); DIE_UNLESS(rc == MYSQL_NO_DATA); @@ -6493,7 +6651,8 @@ static void test_set_option() rc= mysql_query(mysql, "INSERT INTO test_limit VALUES(10), (20), (30), (40)"); myquery(rc); - fprintf(stdout, "\n with SQL_SELECT_LIMIT= 2 (direct)"); + if (!opt_silent) + fprintf(stdout, "\n with SQL_SELECT_LIMIT= 2 (direct)"); rc= mysql_query(mysql, "SELECT * FROM test_limit"); myquery(rc); @@ -6505,7 +6664,8 @@ static void test_set_option() mysql_free_result(result); - fprintf(stdout, "\n with SQL_SELECT_LIMIT=2 (prepare)"); + if (!opt_silent) + fprintf(stdout, "\n with SQL_SELECT_LIMIT=2 (prepare)"); stmt= mysql_simple_prepare(mysql, "SELECT * FROM test_limit"); check_stmt(stmt); @@ -6518,7 +6678,8 @@ static void test_set_option() mysql_stmt_close(stmt); /* RESET the LIMIT the rows count to 0 */ - fprintf(stdout, "\n with SQL_SELECT_LIMIT=DEFAULT (prepare)"); + if (!opt_silent) + fprintf(stdout, "\n with SQL_SELECT_LIMIT=DEFAULT (prepare)"); rc= mysql_query(mysql, "SET OPTION SQL_SELECT_LIMIT=DEFAULT"); myquery(rc); @@ -6576,7 +6737,8 @@ static void test_prepare_grant() MYSQL *org_mysql= mysql, *lmysql; MYSQL_STMT *stmt; - fprintf(stdout, "\n Establishing a test connection ..."); + if (!opt_silent) + fprintf(stdout, "\n Establishing a test connection ..."); if (!(lmysql= mysql_init(NULL))) { myerror("mysql_init() failed"); @@ -6590,7 +6752,8 @@ static void test_prepare_grant() mysql_close(lmysql); exit(1); } - fprintf(stdout, " OK"); + if (!opt_silent) + fprintf(stdout, " OK"); mysql= lmysql; rc= mysql_query(mysql, "INSERT INTO test_grant VALUES(NULL)"); @@ -6677,14 +6840,16 @@ static void test_frm_bug() rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - fprintf(stdout, "\n data directory: %s", data_dir); + if (!opt_silent) + fprintf(stdout, "\n data directory: %s", data_dir); rc= mysql_stmt_fetch(stmt); DIE_UNLESS(rc == MYSQL_NO_DATA); strxmov(test_frm, data_dir, "/", current_db, "/", "test_frm_bug.frm", NullS); - fprintf(stdout, "\n test_frm: %s", test_frm); + if (!opt_silent) + fprintf(stdout, "\n test_frm: %s", test_frm); if (!(test_file= my_fopen(test_frm, (int) (O_RDWR | O_CREAT), MYF(MY_WME)))) { @@ -6692,7 +6857,8 @@ static void test_frm_bug() fprintf(stdout, "\n test cancelled"); exit(1); } - fprintf(test_file, "this is a junk file for test"); + if (!opt_silent) + fprintf(test_file, "this is a junk file for test"); rc= mysql_query(mysql, "SHOW TABLE STATUS like 'test_frm_bug'"); myquery(rc); @@ -6708,7 +6874,8 @@ static void test_frm_bug() row= mysql_fetch_row(result); mytest(row); - fprintf(stdout, "\n Comment: %s", row[17]); + if (!opt_silent) + fprintf(stdout, "\n Comment: %s", row[17]); DIE_UNLESS(row[17] != 0); mysql_free_result(result); @@ -6771,7 +6938,8 @@ static void test_decimal_bug() rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - fprintf(stdout, "\n data: %s", data); + if (!opt_silent) + fprintf(stdout, "\n data: %s", data); DIE_UNLESS(strcmp(data, "8.00") == 0); rc= mysql_stmt_fetch(stmt); @@ -6788,7 +6956,8 @@ static void test_decimal_bug() rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - fprintf(stdout, "\n data: %s", data); + if (!opt_silent) + fprintf(stdout, "\n data: %s", data); DIE_UNLESS(strcmp(data, "5.61") == 0); rc= mysql_stmt_fetch(stmt); @@ -6812,7 +6981,8 @@ static void test_decimal_bug() rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - fprintf(stdout, "\n data: %s", data); + if (!opt_silent) + fprintf(stdout, "\n data: %s", data); DIE_UNLESS(strcmp(data, "10.22") == 0); rc= mysql_stmt_fetch(stmt); @@ -6852,8 +7022,9 @@ static void test_explain_bug() result= mysql_stmt_result_metadata(stmt); mytest(result); - fprintf(stdout, "\n total fields in the result: %d", - mysql_num_fields(result)); + if (!opt_silent) + fprintf(stdout, "\n total fields in the result: %d", + mysql_num_fields(result)); DIE_UNLESS(6 == mysql_num_fields(result)); verify_prepare_field(result, 0, "Field", "", MYSQL_TYPE_VAR_STRING, @@ -6889,8 +7060,9 @@ static void test_explain_bug() result= mysql_stmt_result_metadata(stmt); mytest(result); - fprintf(stdout, "\n total fields in the result: %d", - mysql_num_fields(result)); + if (!opt_silent) + fprintf(stdout, "\n total fields in the result: %d", + mysql_num_fields(result)); DIE_UNLESS(10 == mysql_num_fields(result)); verify_prepare_field(result, 0, "id", "", MYSQL_TYPE_LONGLONG, @@ -6911,8 +7083,12 @@ static void test_explain_bug() verify_prepare_field(result, 5, "key", "", MYSQL_TYPE_VAR_STRING, "", "", "", NAME_LEN, 0); - verify_prepare_field(result, 6, "key_len", "", MYSQL_TYPE_LONGLONG, - "", "", "", 3, 0); + verify_prepare_field(result, 6, "key_len", "", + (mysql_get_server_version(mysql) <= 50000 ? + MYSQL_TYPE_LONGLONG : MYSQL_TYPE_VAR_STRING), + "", "", "", + (mysql_get_server_version(mysql) <= 50000 ? 3 : 4096), + 0); verify_prepare_field(result, 7, "ref", "", MYSQL_TYPE_VAR_STRING, "", "", "", NAME_LEN*16, 0); @@ -6938,11 +7114,14 @@ static void test_explain_bug() static void check_errcode(const unsigned int err) { - if (mysql->server_version) - fprintf(stdout, "\n [MySQL-%s]", mysql->server_version); - else - fprintf(stdout, "\n [MySQL]"); - fprintf(stdout, "[%d] %s\n", mysql_errno(mysql), mysql_error(mysql)); + if (!opt_silent || mysql_errno(mysql) != err) + { + if (mysql->server_version) + fprintf(stdout, "\n [MySQL-%s]", mysql->server_version); + else + fprintf(stdout, "\n [MySQL]"); + fprintf(stdout, "[%d] %s\n", mysql_errno(mysql), mysql_error(mysql)); + } DIE_UNLESS(mysql_errno(mysql) == err); } @@ -6988,7 +7167,8 @@ static void test_drop_temp() { MYSQL *org_mysql= mysql, *lmysql; - fprintf(stdout, "\n Establishing a test connection ..."); + if (!opt_silent) + fprintf(stdout, "\n Establishing a test connection ..."); if (!(lmysql= mysql_init(NULL))) { myerror("mysql_init() failed"); @@ -7007,7 +7187,8 @@ static void test_drop_temp() mysql_close(lmysql); exit(1); } - fprintf(stdout, " OK"); + if (!opt_silent) + fprintf(stdout, " OK"); mysql= lmysql; rc= mysql_query(mysql, "INSERT INTO t1 VALUES(10, 'C')"); @@ -7076,14 +7257,16 @@ static void test_cuted_rows() myquery(rc); count= mysql_warning_count(mysql); - fprintf(stdout, "\n total warnings: %d", count); + if (!opt_silent) + fprintf(stdout, "\n total warnings: %d", count); DIE_UNLESS(count == 0); rc= mysql_query(mysql, "INSERT INTO t2 SELECT * FROM t1"); myquery(rc); count= mysql_warning_count(mysql); - fprintf(stdout, "\n total warnings: %d", count); + if (!opt_silent) + fprintf(stdout, "\n total warnings: %d", count); DIE_UNLESS(count == 2); rc= mysql_query(mysql, "SHOW WARNINGS"); @@ -7100,7 +7283,8 @@ static void test_cuted_rows() myquery(rc); count= mysql_warning_count(mysql); - fprintf(stdout, "\n total warnings: %d", count); + if (!opt_silent) + fprintf(stdout, "\n total warnings: %d", count); DIE_UNLESS(count == 2); rc= mysql_query(mysql, "SHOW WARNINGS"); @@ -7213,8 +7397,11 @@ static void test_logs() rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - fprintf(stdout, "\n id : %d", id); - fprintf(stdout, "\n name : %s(%ld)", data, length); + if (!opt_silent) + { + fprintf(stdout, "\n id : %d", id); + fprintf(stdout, "\n name : %s(%ld)", data, length); + } DIE_UNLESS(id == 9876); DIE_UNLESS(length == 19); /* Due to VARCHAR(20) */ @@ -7223,7 +7410,8 @@ static void test_logs() rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - fprintf(stdout, "\n name : %s(%ld)", data, length); + if (!opt_silent) + fprintf(stdout, "\n name : %s(%ld)", data, length); DIE_UNLESS(length == 1); DIE_UNLESS(strcmp(data, "'") == 0); @@ -7231,7 +7419,8 @@ static void test_logs() rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - fprintf(stdout, "\n name : %s(%ld)", data, length); + if (!opt_silent) + fprintf(stdout, "\n name : %s(%ld)", data, length); DIE_UNLESS(length == 1); DIE_UNLESS(strcmp(data, "\"") == 0); @@ -7239,7 +7428,8 @@ static void test_logs() rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - fprintf(stdout, "\n name : %s(%ld)", data, length); + if (!opt_silent) + fprintf(stdout, "\n name : %s(%ld)", data, length); DIE_UNLESS(length == 7); DIE_UNLESS(strcmp(data, "my\'sql\'") == 0); @@ -7247,7 +7437,8 @@ static void test_logs() rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - fprintf(stdout, "\n name : %s(%ld)", data, length); + if (!opt_silent) + fprintf(stdout, "\n name : %s(%ld)", data, length); DIE_UNLESS(length == 7); /*DIE_UNLESS(strcmp(data, "my\"sql\"") == 0); */ @@ -7293,7 +7484,8 @@ static void test_nstmts() for (i= 0; i < total_stmts; i++) { - fprintf(stdout, "\r stmt: %d", i); + if (!opt_silent) + fprintf(stdout, "\r stmt: %d", i); strmov(query, "insert into test_nstmts values(?)"); stmt= mysql_simple_prepare(mysql, query); @@ -7320,7 +7512,8 @@ static void test_nstmts() rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - fprintf(stdout, "\n total rows: %d", i); + if (!opt_silent) + fprintf(stdout, "\n total rows: %d", i); DIE_UNLESS( i == total_stmts); rc= mysql_stmt_fetch(stmt); @@ -7386,7 +7579,8 @@ static void test_fetch_seek() rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - fprintf(stdout, "\n row 0: %ld, %s, %s", (long) c1, c2, c3); + if (!opt_silent) + fprintf(stdout, "\n row 0: %ld, %s, %s", (long) c1, c2, c3); row= mysql_stmt_row_tell(stmt); @@ -7395,21 +7589,24 @@ static void test_fetch_seek() rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - fprintf(stdout, "\n row 2: %ld, %s, %s", (long) c1, c2, c3); + if (!opt_silent) + fprintf(stdout, "\n row 2: %ld, %s, %s", (long) c1, c2, c3); row= mysql_stmt_row_seek(stmt, row); rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - fprintf(stdout, "\n row 2: %ld, %s, %s", (long) c1, c2, c3); + if (!opt_silent) + fprintf(stdout, "\n row 2: %ld, %s, %s", (long) c1, c2, c3); mysql_stmt_data_seek(stmt, 0); rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - fprintf(stdout, "\n row 0: %ld, %s, %s", (long) c1, c2, c3); + if (!opt_silent) + fprintf(stdout, "\n row 0: %ld, %s, %s", (long) c1, c2, c3); rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); @@ -7477,17 +7674,20 @@ static void test_fetch_offset() data[0]= '\0'; rc= mysql_stmt_fetch_column(stmt, bind, 0, 0); check_execute(stmt, rc); - fprintf(stdout, "\n col 1: %s (%ld)", data, length); + if (!opt_silent) + fprintf(stdout, "\n col 1: %s (%ld)", data, length); DIE_UNLESS(strncmp(data, "abcd", 4) == 0 && length == 10); rc= mysql_stmt_fetch_column(stmt, bind, 0, 5); check_execute(stmt, rc); - fprintf(stdout, "\n col 1: %s (%ld)", data, length); + if (!opt_silent) + fprintf(stdout, "\n col 1: %s (%ld)", data, length); DIE_UNLESS(strncmp(data, "fg", 2) == 0 && length == 10); rc= mysql_stmt_fetch_column(stmt, bind, 0, 9); check_execute(stmt, rc); - fprintf(stdout, "\n col 0: %s (%ld)", data, length); + if (!opt_silent) + fprintf(stdout, "\n col 0: %s (%ld)", data, length); DIE_UNLESS(strncmp(data, "j", 1) == 0 && length == 10); rc= mysql_stmt_fetch(stmt); @@ -7560,7 +7760,8 @@ static void test_fetch_column() rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - fprintf(stdout, "\n row 0: %d, %s", bc1, bc2); + if (!opt_silent) + fprintf(stdout, "\n row 0: %d, %s", bc1, bc2); c2[0]= '\0'; l2= 0; bind[0].buffer_type= MYSQL_TYPE_STRING; @@ -7571,13 +7772,15 @@ static void test_fetch_column() rc= mysql_stmt_fetch_column(stmt, bind, 1, 0); check_execute(stmt, rc); - fprintf(stdout, "\n col 1: %s(%ld)", c2, l2); + if (!opt_silent) + fprintf(stdout, "\n col 1: %s(%ld)", c2, l2); DIE_UNLESS(strncmp(c2, "venu", 4) == 0 && l2 == 4); c2[0]= '\0'; l2= 0; rc= mysql_stmt_fetch_column(stmt, bind, 1, 0); check_execute(stmt, rc); - fprintf(stdout, "\n col 1: %s(%ld)", c2, l2); + if (!opt_silent) + fprintf(stdout, "\n col 1: %s(%ld)", c2, l2); DIE_UNLESS(strcmp(c2, "venu") == 0 && l2 == 4); c1= 0; @@ -7589,13 +7792,15 @@ static void test_fetch_column() rc= mysql_stmt_fetch_column(stmt, bind, 0, 0); check_execute(stmt, rc); - fprintf(stdout, "\n col 0: %d(%ld)", c1, l1); + if (!opt_silent) + fprintf(stdout, "\n col 0: %d(%ld)", c1, l1); DIE_UNLESS(c1 == 1 && l1 == 4); rc= mysql_stmt_fetch(stmt); check_execute(stmt, rc); - fprintf(stdout, "\n row 1: %d, %s", bc1, bc2); + if (!opt_silent) + fprintf(stdout, "\n row 1: %d, %s", bc1, bc2); c2[0]= '\0'; l2= 0; bind[0].buffer_type= MYSQL_TYPE_STRING; @@ -7606,13 +7811,15 @@ static void test_fetch_column() rc= mysql_stmt_fetch_column(stmt, bind, 1, 0); check_execute(stmt, rc); - fprintf(stdout, "\n col 1: %s(%ld)", c2, l2); + if (!opt_silent) + fprintf(stdout, "\n col 1: %s(%ld)", c2, l2); DIE_UNLESS(strncmp(c2, "mysq", 4) == 0 && l2 == 5); c2[0]= '\0'; l2= 0; rc= mysql_stmt_fetch_column(stmt, bind, 1, 0); check_execute(stmt, rc); - fprintf(stdout, "\n col 1: %si(%ld)", c2, l2); + if (!opt_silent) + fprintf(stdout, "\n col 1: %si(%ld)", c2, l2); DIE_UNLESS(strcmp(c2, "mysql") == 0 && l2 == 5); c1= 0; @@ -7624,7 +7831,8 @@ static void test_fetch_column() rc= mysql_stmt_fetch_column(stmt, bind, 0, 0); check_execute(stmt, rc); - fprintf(stdout, "\n col 0: %d(%ld)", c1, l1); + if (!opt_silent) + fprintf(stdout, "\n col 0: %d(%ld)", c1, l1); DIE_UNLESS(c1 == 2 && l1 == 4); rc= mysql_stmt_fetch(stmt); @@ -7678,7 +7886,6 @@ static void test_mem_overun() MYSQL_RES *field_res; int rc, i, length; - myheader("test_mem_overun"); /* @@ -7728,7 +7935,8 @@ static void test_mem_overun() field_res= mysql_stmt_result_metadata(stmt); mytest(field_res); - fprintf(stdout, "\n total fields : %d", mysql_num_fields(field_res)); + if (!opt_silent) + fprintf(stdout, "\n total fields : %d", mysql_num_fields(field_res)); DIE_UNLESS( 1000 == mysql_num_fields(field_res)); rc= mysql_stmt_store_result(stmt); @@ -7795,7 +8003,8 @@ static void test_free_result() rc= mysql_stmt_fetch_column(stmt, bind, 0, 0); check_execute(stmt, rc); - fprintf(stdout, "\n col 0: %s(%ld)", c2, l2); + if (!opt_silent) + fprintf(stdout, "\n col 0: %s(%ld)", c2, l2); DIE_UNLESS(strncmp(c2, "1", 1) == 0 && l2 == 1); rc= mysql_stmt_fetch(stmt); @@ -7810,7 +8019,8 @@ static void test_free_result() rc= mysql_stmt_fetch_column(stmt, bind, 0, 0); check_execute(stmt, rc); - fprintf(stdout, "\n col 0: %d(%ld)", c1, l2); + if (!opt_silent) + fprintf(stdout, "\n col 0: %d(%ld)", c1, l2); DIE_UNLESS(c1 == 2 && l2 == 4); rc= mysql_query(mysql, "drop table test_free_result"); @@ -7877,7 +8087,8 @@ static void test_free_store_result() rc= mysql_stmt_fetch_column(stmt, bind, 0, 0); check_execute(stmt, rc); - fprintf(stdout, "\n col 1: %s(%ld)", c2, l2); + if (!opt_silent) + fprintf(stdout, "\n col 1: %s(%ld)", c2, l2); DIE_UNLESS(strncmp(c2, "1", 1) == 0 && l2 == 1); rc= mysql_stmt_fetch(stmt); @@ -7892,7 +8103,8 @@ static void test_free_store_result() rc= mysql_stmt_fetch_column(stmt, bind, 0, 0); check_execute(stmt, rc); - fprintf(stdout, "\n col 0: %d(%ld)", c1, l2); + if (!opt_silent) + fprintf(stdout, "\n col 0: %d(%ld)", c1, l2); DIE_UNLESS(c1 == 2 && l2 == 4); rc= mysql_stmt_free_result(stmt); @@ -7924,16 +8136,19 @@ static void test_sqlmode() /* PIPES_AS_CONCAT */ strcpy(query, "SET SQL_MODE= \"PIPES_AS_CONCAT\""); - fprintf(stdout, "\n With %s", query); + if (!opt_silent) + fprintf(stdout, "\n With %s", query); rc= mysql_query(mysql, query); myquery(rc); strcpy(query, "INSERT INTO test_piping VALUES(?||?)"); - fprintf(stdout, "\n query: %s", query); + if (!opt_silent) + fprintf(stdout, "\n query: %s", query); stmt= mysql_simple_prepare(mysql, query); check_stmt(stmt); - fprintf(stdout, "\n total parameters: %ld", mysql_stmt_param_count(stmt)); + if (!opt_silent) + fprintf(stdout, "\n total parameters: %ld", mysql_stmt_param_count(stmt)); /* We need to bzero bind structure because mysql_stmt_bind_param checks all @@ -7963,21 +8178,25 @@ static void test_sqlmode() myquery(rc); strcpy(query, "SELECT connection_id ()"); - fprintf(stdout, "\n query: %s", query); + if (!opt_silent) + fprintf(stdout, "\n query: %s", query); stmt= mysql_simple_prepare(mysql, query); check_stmt_r(stmt); /* ANSI */ strcpy(query, "SET SQL_MODE= \"ANSI\""); - fprintf(stdout, "\n With %s", query); + if (!opt_silent) + fprintf(stdout, "\n With %s", query); rc= mysql_query(mysql, query); myquery(rc); strcpy(query, "INSERT INTO test_piping VALUES(?||?)"); - fprintf(stdout, "\n query: %s", query); + if (!opt_silent) + fprintf(stdout, "\n query: %s", query); stmt= mysql_simple_prepare(mysql, query); check_stmt(stmt); - fprintf(stdout, "\n total parameters: %ld", mysql_stmt_param_count(stmt)); + if (!opt_silent) + fprintf(stdout, "\n total parameters: %ld", mysql_stmt_param_count(stmt)); rc= mysql_stmt_bind_param(stmt, bind); check_execute(stmt, rc); @@ -7991,7 +8210,8 @@ static void test_sqlmode() /* ANSI mode spaces ... */ strcpy(query, "SELECT connection_id ()"); - fprintf(stdout, "\n query: %s", query); + if (!opt_silent) + fprintf(stdout, "\n query: %s", query); stmt= mysql_simple_prepare(mysql, query); check_stmt(stmt); @@ -8003,18 +8223,21 @@ static void test_sqlmode() rc= mysql_stmt_fetch(stmt); DIE_UNLESS(rc == MYSQL_NO_DATA); - fprintf(stdout, "\n returned 1 row\n"); + if (!opt_silent) + fprintf(stdout, "\n returned 1 row\n"); mysql_stmt_close(stmt); /* IGNORE SPACE MODE */ strcpy(query, "SET SQL_MODE= \"IGNORE_SPACE\""); - fprintf(stdout, "\n With %s", query); + if (!opt_silent) + fprintf(stdout, "\n With %s", query); rc= mysql_query(mysql, query); myquery(rc); strcpy(query, "SELECT connection_id ()"); - fprintf(stdout, "\n query: %s", query); + if (!opt_silent) + fprintf(stdout, "\n query: %s", query); stmt= mysql_simple_prepare(mysql, query); check_stmt(stmt); @@ -8026,7 +8249,8 @@ static void test_sqlmode() rc= mysql_stmt_fetch(stmt); DIE_UNLESS(rc == MYSQL_NO_DATA); - fprintf(stdout, "\n returned 1 row"); + if (!opt_silent) + fprintf(stdout, "\n returned 1 row"); mysql_stmt_close(stmt); } @@ -8118,7 +8342,8 @@ static void test_ts() sprintf(query, "SELECT a, b, c FROM test_ts WHERE %c=?", name); - fprintf(stdout, "\n %s", query); + if (!opt_silent) + fprintf(stdout, "\n %s", query); stmt= mysql_simple_prepare(mysql, query); check_stmt(stmt); @@ -8131,7 +8356,8 @@ static void test_ts() while (mysql_stmt_fetch(stmt) == 0) row_count++; - fprintf(stdout, "\n returned '%d' rows", row_count); + if (!opt_silent) + fprintf(stdout, "\n returned '%d' rows", row_count); DIE_UNLESS(row_count == 2); mysql_stmt_close(stmt); } @@ -8273,7 +8499,8 @@ static void test_bug1946() check_stmt(stmt); rc= mysql_real_query(mysql, query, strlen(query)); DIE_UNLESS(rc != 0); - fprintf(stdout, "Got error (as expected):\n"); + if (!opt_silent) + fprintf(stdout, "Got error (as expected):\n"); myerror(NULL); mysql_stmt_close(stmt); @@ -8291,19 +8518,23 @@ static void test_parse_error_and_bad_length() rc= mysql_query(mysql, "SHOW DATABAAAA"); DIE_UNLESS(rc); - fprintf(stdout, "Got error (as expected): '%s'\n", mysql_error(mysql)); + if (!opt_silent) + fprintf(stdout, "Got error (as expected): '%s'\n", mysql_error(mysql)); rc= mysql_real_query(mysql, "SHOW DATABASES", 100); DIE_UNLESS(rc); - fprintf(stdout, "Got error (as expected): '%s'\n", mysql_error(mysql)); + if (!opt_silent) + fprintf(stdout, "Got error (as expected): '%s'\n", mysql_error(mysql)); stmt= mysql_simple_prepare(mysql, "SHOW DATABAAAA"); DIE_UNLESS(!stmt); - fprintf(stdout, "Got error (as expected): '%s'\n", mysql_error(mysql)); + if (!opt_silent) + fprintf(stdout, "Got error (as expected): '%s'\n", mysql_error(mysql)); stmt= mysql_stmt_init(mysql); DIE_UNLESS(stmt); rc= mysql_stmt_prepare(stmt, "SHOW DATABASES", 100); DIE_UNLESS(rc != 0); - fprintf(stdout, "Got error (as expected): '%s'\n", mysql_stmt_error(stmt)); + if (!opt_silent) + fprintf(stdout, "Got error (as expected): '%s'\n", mysql_stmt_error(stmt)); mysql_stmt_close(stmt); } @@ -8324,7 +8555,8 @@ static void test_bug2247() myheader("test_bug2247"); - fprintf(stdout, "\nChecking if stmt_affected_rows is not affected by\n" + if (!opt_silent) + fprintf(stdout, "\nChecking if stmt_affected_rows is not affected by\n" "mysql_query ... "); /* create table and insert few rows */ rc= mysql_query(mysql, drop); @@ -8381,7 +8613,8 @@ static void test_bug2247() DIE_UNLESS(mysql_stmt_affected_rows(stmt) == exp_count); mysql_stmt_close(stmt); - fprintf(stdout, "OK"); + if (!opt_silent) + fprintf(stdout, "OK"); } @@ -8659,7 +8892,8 @@ static void test_bug3117() check_execute(stmt, rc); DIE_UNLESS(is_null == 0 && lii == 1); - fprintf(stdout, "\n\tLAST_INSERT_ID()= 1 ok\n"); + if (!opt_silent) + fprintf(stdout, "\n\tLAST_INSERT_ID()= 1 ok\n"); rc= mysql_query(mysql, "INSERT INTO t1 VALUES (NULL)"); myquery(rc); @@ -8671,7 +8905,8 @@ static void test_bug3117() check_execute(stmt, rc); DIE_UNLESS(is_null == 0 && lii == 2); - fprintf(stdout, "\tLAST_INSERT_ID()= 2 ok\n"); + if (!opt_silent) + fprintf(stdout, "\tLAST_INSERT_ID()= 2 ok\n"); mysql_stmt_close(stmt); @@ -8821,7 +9056,8 @@ static void test_create_drop() { rc= mysql_stmt_execute(stmt_create); check_execute(stmt_create, rc); - fprintf(stdout, "created %i\n", i); + if (!opt_silent) + fprintf(stdout, "created %i\n", i); rc= mysql_stmt_execute(stmt_select); check_execute(stmt_select, rc); @@ -8830,11 +9066,13 @@ static void test_create_drop() rc= mysql_stmt_execute(stmt_drop); check_execute(stmt_drop, rc); - fprintf(stdout, "droped %i\n", i); + if (!opt_silent) + fprintf(stdout, "droped %i\n", i); rc= mysql_stmt_execute(stmt_create_select); check_execute(stmt_create, rc); - fprintf(stdout, "created select %i\n", i); + if (!opt_silent) + fprintf(stdout, "created select %i\n", i); rc= mysql_stmt_execute(stmt_select); check_execute(stmt_select, rc); @@ -8843,7 +9081,8 @@ static void test_create_drop() rc= mysql_stmt_execute(stmt_drop); check_execute(stmt_drop, rc); - fprintf(stdout, "droped %i\n", i); + if (!opt_silent) + fprintf(stdout, "droped %i\n", i); } mysql_stmt_close(stmt_create); @@ -8874,25 +9113,29 @@ static void test_rename() rc= mysql_stmt_execute(stmt); check_execute_r(stmt, rc); - fprintf(stdout, "rename without t3\n"); + if (!opt_silent) + fprintf(stdout, "rename without t3\n"); rc= mysql_query(mysql, "create table t3 (a int)"); myquery(rc); rc= mysql_stmt_execute(stmt); check_execute(stmt, rc); - fprintf(stdout, "rename with t3\n"); + if (!opt_silent) + fprintf(stdout, "rename with t3\n"); rc= mysql_stmt_execute(stmt); check_execute_r(stmt, rc); - fprintf(stdout, "rename renamed\n"); + if (!opt_silent) + fprintf(stdout, "rename renamed\n"); rc= mysql_query(mysql, "rename table t2 to t1, t4 to t3"); myquery(rc); rc= mysql_stmt_execute(stmt); check_execute(stmt, rc); - fprintf(stdout, "rename reverted\n"); + if (!opt_silent) + fprintf(stdout, "rename reverted\n"); mysql_stmt_close(stmt); @@ -8926,10 +9169,12 @@ static void test_do_set() { rc= mysql_stmt_execute(stmt_do); check_execute(stmt_do, rc); - fprintf(stdout, "do %i\n", i); + if (!opt_silent) + fprintf(stdout, "do %i\n", i); rc= mysql_stmt_execute(stmt_set); check_execute(stmt_set, rc); - fprintf(stdout, "set %i\n", i); + if (!opt_silent) + fprintf(stdout, "set %i\n", i); } mysql_stmt_close(stmt_do); @@ -8995,11 +9240,13 @@ static void test_multi() rc= mysql_stmt_execute(stmt_update); check_execute(stmt_update, rc); - fprintf(stdout, "update %ld\n", (long) param); + if (!opt_silent) + fprintf(stdout, "update %ld\n", (long) param); rc= mysql_stmt_execute(stmt_delete); check_execute(stmt_delete, rc); - fprintf(stdout, "delete %ld\n", (long) param); + if (!opt_silent) + fprintf(stdout, "delete %ld\n", (long) param); rc= mysql_stmt_execute(stmt_select1); check_execute(stmt_select1, rc); @@ -9055,7 +9302,8 @@ static void test_insert_select() { rc= mysql_stmt_execute(stmt_insert); check_execute(stmt_insert, rc); - fprintf(stdout, "insert %u\n", i); + if (!opt_silent) + fprintf(stdout, "insert %u\n", i); rc= mysql_stmt_execute(stmt_select); check_execute(stmt_select, rc); @@ -9915,7 +10163,8 @@ static void test_bug3796() mysql_stmt_bind_result(stmt, bind); rc= mysql_stmt_fetch(stmt); - printf("Concat result: '%s'\n", out_buff); + if (!opt_silent) + printf("Concat result: '%s'\n", out_buff); check_execute(stmt, rc); strcpy(canonical_buff, concat_arg0); strcat(canonical_buff, "ONE"); @@ -9927,7 +10176,8 @@ static void test_bug3796() strcpy(canonical_buff + strlen(concat_arg0), "TWO"); DIE_UNLESS(strlen(canonical_buff) == out_length && strncmp(out_buff, canonical_buff, out_length) == 0); - printf("Concat result: '%s'\n", out_buff); + if (!opt_silent) + printf("Concat result: '%s'\n", out_buff); rc= mysql_stmt_fetch(stmt); DIE_UNLESS(rc == MYSQL_NO_DATA); @@ -10001,12 +10251,15 @@ static void test_bug4026() rc= mysql_stmt_fetch(stmt); DIE_UNLESS(rc == 0); - printf("%d:%d:%d.%lu\n", time_out.hour, time_out.minute, time_out.second, - time_out.second_part); - printf("%d-%d-%d %d:%d:%d.%lu\n", datetime_out.year, datetime_out.month, - datetime_out.day, datetime_out.hour, - datetime_out.minute, datetime_out.second, - datetime_out.second_part); + if (!opt_silent) + { + printf("%d:%d:%d.%lu\n", time_out.hour, time_out.minute, time_out.second, + time_out.second_part); + printf("%d-%d-%d %d:%d:%d.%lu\n", datetime_out.year, datetime_out.month, + datetime_out.day, datetime_out.hour, + datetime_out.minute, datetime_out.second, + datetime_out.second_part); + } DIE_UNLESS(memcmp(&time_in, &time_out, sizeof(time_in)) == 0); DIE_UNLESS(memcmp(&datetime_in, &datetime_out, sizeof(datetime_in)) == 0); mysql_stmt_close(stmt); @@ -10049,8 +10302,9 @@ static void test_bug4079() rc= mysql_stmt_fetch(stmt); DIE_UNLESS(rc != 0 && rc != MYSQL_NO_DATA); - printf("Got error from mysql_stmt_fetch (as expected):\n%s\n", - mysql_stmt_error(stmt)); + if (!opt_silent) + printf("Got error from mysql_stmt_fetch (as expected):\n%s\n", + mysql_stmt_error(stmt)); /* buggy version of libmysql hanged up here */ mysql_stmt_close(stmt); } @@ -10144,13 +10398,16 @@ static void test_bug4030() rc= mysql_stmt_fetch(stmt); DIE_UNLESS(rc == 0); - printf("%d:%d:%d.%lu\n", time_out.hour, time_out.minute, time_out.second, - time_out.second_part); - printf("%d-%d-%d\n", date_out.year, date_out.month, date_out.day); - printf("%d-%d-%d %d:%d:%d.%lu\n", datetime_out.year, datetime_out.month, - datetime_out.day, datetime_out.hour, - datetime_out.minute, datetime_out.second, - datetime_out.second_part); + if (!opt_silent) + { + printf("%d:%d:%d.%lu\n", time_out.hour, time_out.minute, time_out.second, + time_out.second_part); + printf("%d-%d-%d\n", date_out.year, date_out.month, date_out.day); + printf("%d-%d-%d %d:%d:%d.%lu\n", datetime_out.year, datetime_out.month, + datetime_out.day, datetime_out.hour, + datetime_out.minute, datetime_out.second, + datetime_out.second_part); + } DIE_UNLESS(memcmp(&time_canonical, &time_out, sizeof(time_out)) == 0); DIE_UNLESS(memcmp(&date_canonical, &date_out, sizeof(date_out)) == 0); DIE_UNLESS(memcmp(&datetime_canonical, &datetime_out, sizeof(datetime_out)) == 0); @@ -10200,7 +10457,8 @@ static void test_bug5126() rc= mysql_stmt_fetch(stmt); DIE_UNLESS(rc == 0); DIE_UNLESS(c1 == 8386608 && c2 == 1); - printf("%ld, %ld\n", (long) c1, (long) c2); + if (!opt_silent) + printf("%ld, %ld\n", (long) c1, (long) c2); mysql_stmt_close(stmt); } @@ -10306,7 +10564,8 @@ static void test_bug5399() check_execute(*stmt, rc); mysql_stmt_bind_result(*stmt, bind); } - printf("%d statements prepared.\n", NUM_OF_USED_STMT); + if (!opt_silent) + printf("%d statements prepared.\n", NUM_OF_USED_STMT); for (stmt= stmt_list; stmt != stmt_list + NUM_OF_USED_STMT; ++stmt) { @@ -10478,15 +10737,17 @@ static void test_bug5194() rc= mysql_stmt_prepare(stmt, query, query_ptr - query); if (rc && nrows * COLUMN_COUNT > uint16_max) { - printf("Failed to prepare a statement with %d placeholders " - "(as expected).\n", nrows * COLUMN_COUNT); + if (!opt_silent) + printf("Failed to prepare a statement with %d placeholders " + "(as expected).\n", nrows * COLUMN_COUNT); break; } else check_execute(stmt, rc); - printf("Insert: query length= %d, row count= %d, param count= %lu\n", - strlen(query), nrows, mysql_stmt_param_count(stmt)); + if (!opt_silent) + printf("Insert: query length= %d, row count= %d, param count= %lu\n", + strlen(query), nrows, mysql_stmt_param_count(stmt)); /* bind the parameter array and execute the query */ rc= mysql_stmt_bind_param(stmt, bind); @@ -10522,7 +10783,10 @@ static void test_bug5315() rc= mysql_stmt_execute(stmt); DIE_UNLESS(rc != 0); if (rc) - printf("Got error (as expected):\n%s", mysql_stmt_error(stmt)); + { + if (!opt_silent) + printf("Got error (as expected):\n%s", mysql_stmt_error(stmt)); + } /* check that connection is OK */ mysql_stmt_close(stmt); stmt= mysql_stmt_init(mysql); @@ -10570,8 +10834,11 @@ static void test_bug6049() rc= mysql_stmt_fetch(stmt); DIE_UNLESS(rc == 0); - printf("Result from query: %s\n", row[0]); - printf("Result from prepared statement: %s\n", (char*) buffer); + if (!opt_silent) + { + printf("Result from query: %s\n", row[0]); + printf("Result from prepared statement: %s\n", (char*) buffer); + } DIE_UNLESS(strcmp(row[0], (char*) buffer) == 0); @@ -10616,8 +10883,11 @@ static void test_bug6058() rc= mysql_stmt_fetch(stmt); DIE_UNLESS(rc == 0); - printf("Result from query: %s\n", row[0]); - printf("Result from prepared statement: %s\n", buffer); + if (!opt_silent) + { + printf("Result from query: %s\n", row[0]); + printf("Result from prepared statement: %s\n", buffer); + } DIE_UNLESS(strcmp(row[0], buffer) == 0); @@ -10656,17 +10926,17 @@ static void test_bug6046() stmt_text= "DROP TABLE IF EXISTS t1"; rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text)); myquery(rc); - stmt_text= "CREATE TABLE a1 (a int, b int)"; + stmt_text= "CREATE TABLE t1 (a int, b int)"; rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text)); myquery(rc); - stmt_text= "INSERT INTO a1 VALUES (1,1),(2,2),(3,1),(4,2)"; + stmt_text= "INSERT INTO t1 VALUES (1,1),(2,2),(3,1),(4,2)"; rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text)); myquery(rc); stmt= mysql_stmt_init(mysql); - stmt_text= "SELECT a1.a FROM a1 NATURAL JOIN a1 as X1 " - "WHERE a1.b > ? ORDER BY a1.a"; + stmt_text= "SELECT t1.a FROM t1 NATURAL JOIN t1 as X1 " + "WHERE t1.b > ? ORDER BY t1.a"; rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text)); check_execute(stmt, rc); @@ -10772,22 +11042,25 @@ static void test_bug6096() /* Print out and check the metadata */ - printf(" ---------------------------------------------------------------\n"); - printf(" | Metadata \n"); - printf(" ---------------------------------------------------------------\n"); - printf(" | Query | Prepared statement \n"); - printf(" ---------------------------------------------------------------\n"); - printf(" field name | length | max_length | length | max_length \n"); - printf(" ---------------------------------------------------------------\n"); - - for (i= 0; i < query_field_count; ++i) + if (!opt_silent) { - MYSQL_FIELD *f1= &query_field_list[i], *f2= &stmt_field_list[i]; - printf(" %-11s | %9lu | %10lu | %9lu | %10lu \n", - f1->name, f1->length, f1->max_length, f2->length, f2->max_length); - DIE_UNLESS(f1->length == f2->length); + printf(" ------------------------------------------------------------\n"); + printf(" | Metadata \n"); + printf(" ------------------------------------------------------------\n"); + printf(" | Query | Prepared statement \n"); + printf(" ------------------------------------------------------------\n"); + printf(" field name | length | max_length | length | max_length\n"); + printf(" ------------------------------------------------------------\n"); + + for (i= 0; i < query_field_count; ++i) + { + MYSQL_FIELD *f1= &query_field_list[i], *f2= &stmt_field_list[i]; + printf(" %-11s | %9lu | %10lu | %9lu | %10lu \n", + f1->name, f1->length, f1->max_length, f2->length, f2->max_length); + DIE_UNLESS(f1->length == f2->length); + } + printf(" ---------------------------------------------------------------\n"); } - printf(" ---------------------------------------------------------------\n"); /* Bind and fetch the data */ @@ -10842,6 +11115,8 @@ static struct my_option client_test_long_options[] = #endif {"port", 'P', "Port number to use for connection", (char **) &opt_port, (char **) &opt_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"silent", 's', "Be more silent", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, + 0}, {"socket", 'S', "Socket file to use for connection", (char **) &opt_unix_socket, (char **) &opt_unix_socket, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"testcase", 'c', "May disable some code when runs as mysql-test-run testcase.", @@ -10851,36 +11126,25 @@ static struct my_option client_test_long_options[] = { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} }; -static void client_test_print_version(void) -{ - fprintf(stdout, "%s Distrib %s, for %s (%s)\n\n", - my_progname, MYSQL_SERVER_VERSION, SYSTEM_TYPE, MACHINE_TYPE); -} - static void usage(void) { - /* - * show the usage string when the user asks for this - */ + /* show the usage string when the user asks for this */ putc('\n', stdout); - puts("***********************************************************************\n"); - puts(" Test for client-server protocol 4.1"); - puts(" By Monty & Venu \n"); - puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software, "); - puts("and you are welcome to modify and redistribute it under the GPL license\n"); - puts(" Copyright (C) 1995-2003 MySQL AB "); - puts("-----------------------------------------------------------------------\n"); - client_test_print_version(); - fprintf(stdout, "Usage: %s [OPTIONS]\n\n", my_progname); - + printf("%s Ver %s Distrib %s, for %s (%s)\n", + my_progname, VER, MYSQL_SERVER_VERSION, SYSTEM_TYPE, MACHINE_TYPE); + puts("By Monty, Venu, Kent and others\n"); + printf("\ +Copyright (C) 2002-2004 MySQL AB\n\ +This software comes with ABSOLUTELY NO WARRANTY. This is free software,\n\ +and you are welcome to modify and redistribute it under the GPL license\n"); + printf("Usage: %s [OPTIONS]\n", my_progname); my_print_help(client_test_long_options); print_defaults("my", client_test_load_default_groups); my_print_variables(client_test_long_options); - - puts("***********************************************************************\n"); } + static my_bool get_one_option(int optid, const struct my_option *opt __attribute__((unused)), char *argument) @@ -10905,6 +11169,12 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), else tty_password= 1; break; + case 's': + if (argument == disabled_my_option) + opt_silent= 0; + else + opt_silent++; + break; case '?': case 'I': /* Info */ usage(); @@ -10933,14 +11203,17 @@ static void get_options(int argc, char **argv) static void print_test_output() { - fprintf(stdout, "\n\n"); - fprintf(stdout, "All '%d' tests were successful (in '%d' iterations)", - test_count-1, opt_count); - fprintf(stdout, "\n Total execution time: %g SECS", total_time); - if (opt_count > 1) - fprintf(stdout, " (Avg: %g SECS)", total_time/opt_count); + if (opt_silent < 3) + { + fprintf(stdout, "\n\n"); + fprintf(stdout, "All '%d' tests were successful (in '%d' iterations)", + test_count-1, opt_count); + fprintf(stdout, "\n Total execution time: %g SECS", total_time); + if (opt_count > 1) + fprintf(stdout, " (Avg: %g SECS)", total_time/opt_count); - fprintf(stdout, "\n\n!!! SUCCESS !!!\n"); + fprintf(stdout, "\n\n!!! SUCCESS !!!\n"); + } } From 5c6cd1f79687c1ef738a3da6ff45166fc90c8f43 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 2 Nov 2004 19:40:10 +0000 Subject: [PATCH 0079/1063] add compile flad -DSNPRINTF_RETURN_TRUNC on hp ux 11 remove compiler warning patch for my_vsnprintf not dully implemented patch for platfroms that return -1 on snprintf overflow compile fix for hpux configure.in: add compile flad -DSNPRINTF_RETURN_TRUNC on hp ux 11 ndb/src/common/editline/sysunix.c: remove compiler warning ndb/src/common/util/basestring_vsnprintf.c: patch for my_vsnprintf not dully implemented patch for platfroms that return -1 on snprintf overflow ndb/src/kernel/vm/Emulator.hpp: compile fix for hpux ndb/src/mgmsrv/Services.cpp: compile fix for hp ux ndb/src/ndbapi/NdbDictionaryImpl.cpp: remove compiler warning --- configure.in | 4 ++-- ndb/src/common/editline/sysunix.c | 2 +- ndb/src/common/util/basestring_vsnprintf.c | 8 ++++++-- ndb/src/kernel/vm/Emulator.hpp | 1 + ndb/src/mgmsrv/Services.cpp | 22 ++++++++-------------- ndb/src/ndbapi/NdbDictionaryImpl.cpp | 6 ++---- 6 files changed, 20 insertions(+), 23 deletions(-) diff --git a/configure.in b/configure.in index d63859720a3..71adaa747f5 100644 --- a/configure.in +++ b/configure.in @@ -1039,8 +1039,8 @@ case $SYSTEM_TYPE in ;; *hpux11.*) echo "Enabling workarounds for hpux 11" - CFLAGS="$CFLAGS -DHPUX11 -DHAVE_BROKEN_PREAD -DDONT_USE_FINITE -DHAVE_BROKEN_GETPASS -DNO_FCNTL_NONBLOCK -DDO_NOT_REMOVE_THREAD_WRAPPERS -DHAVE_BROKEN_PTHREAD_COND_TIMEDWAIT" - CXXFLAGS="$CXXFLAGS -DHPUX11 -DHAVE_BROKEN_PREAD -DDONT_USE_FINITE -D_INCLUDE_LONGLONG -DNO_FCNTL_NONBLOCK -DDO_NOT_REMOVE_THREAD_WRAPPERS -DHAVE_BROKEN_PTHREAD_COND_TIMEDWAIT" + CFLAGS="$CFLAGS -DHPUX11 -DSNPRINTF_RETURN_TRUNC -DHAVE_BROKEN_PREAD -DDONT_USE_FINITE -DHAVE_BROKEN_GETPASS -DNO_FCNTL_NONBLOCK -DDO_NOT_REMOVE_THREAD_WRAPPERS -DHAVE_BROKEN_PTHREAD_COND_TIMEDWAIT" + CXXFLAGS="$CXXFLAGS -DHPUX11 -DSNPRINTF_RETURN_TRUNC -DHAVE_BROKEN_PREAD -DDONT_USE_FINITE -D_INCLUDE_LONGLONG -DNO_FCNTL_NONBLOCK -DDO_NOT_REMOVE_THREAD_WRAPPERS -DHAVE_BROKEN_PTHREAD_COND_TIMEDWAIT" if test "$with_named_thread" = "no" then echo "Using --with-named-thread=-lpthread" diff --git a/ndb/src/common/editline/sysunix.c b/ndb/src/common/editline/sysunix.c index 1339e5769e2..d7437f6a9c7 100644 --- a/ndb/src/common/editline/sysunix.c +++ b/ndb/src/common/editline/sysunix.c @@ -139,7 +139,7 @@ rl_add_slash(char *path, char *p, size_t p_len) struct stat Sb; if (stat(path, &Sb) >= 0) { - int len= strlen(p); + size_t len= strlen(p); if (len+1 < p_len) { p[len]= S_ISDIR(Sb.st_mode) ? '/' : ' '; p[len+1]= 0; diff --git a/ndb/src/common/util/basestring_vsnprintf.c b/ndb/src/common/util/basestring_vsnprintf.c index c96d1a300e1..7307279f345 100644 --- a/ndb/src/common/util/basestring_vsnprintf.c +++ b/ndb/src/common/util/basestring_vsnprintf.c @@ -35,7 +35,11 @@ basestring_snprintf(char *str, size_t size, const char *format, ...) #define BASESTRING_VSNPRINTF_FUNC(a,b,c,d) vsnprintf(a,b,c,d) #else #define SNPRINTF_RETURN_TRUNC - #define BASESTRING_VSNPRINTF_FUNC(a,b,c,d) my_vsnprintf(a,b,c,d) + /* #define BASESTRING_VSNPRINTF_FUNC(a,b,c,d) my_vsnprintf(a,b,c,d) + * we would like to use my_vsnprintf but it does not have enough features + * Let's hope vsnprintf works anyways + */ + #define BASESTRING_VSNPRINTF_FUNC(a,b,c,d) vsnprintf(a,b,c,d) extern int my_vsnprintf(char *str, size_t size, const char *format, va_list ap); #endif #ifdef SNPRINTF_RETURN_TRUNC @@ -46,7 +50,7 @@ basestring_vsnprintf(char *str, size_t size, const char *format, va_list ap) { int ret= BASESTRING_VSNPRINTF_FUNC(str, size, format, ap); #ifdef SNPRINTF_RETURN_TRUNC - if (ret == size-1) { + if (ret == size-1 || ret == -1) { ret= BASESTRING_VSNPRINTF_FUNC(basestring_vsnprintf_buf, sizeof(basestring_vsnprintf_buf), format, ap); diff --git a/ndb/src/kernel/vm/Emulator.hpp b/ndb/src/kernel/vm/Emulator.hpp index bd240f8679b..b3c64830802 100644 --- a/ndb/src/kernel/vm/Emulator.hpp +++ b/ndb/src/kernel/vm/Emulator.hpp @@ -25,6 +25,7 @@ // //=========================================================================== #include +#include extern class JobTable globalJobTable; extern class TimeQueue globalTimeQueue; diff --git a/ndb/src/mgmsrv/Services.cpp b/ndb/src/mgmsrv/Services.cpp index 5b552836955..2672d8c9d4b 100644 --- a/ndb/src/mgmsrv/Services.cpp +++ b/ndb/src/mgmsrv/Services.cpp @@ -773,8 +773,10 @@ MgmApiSession::setClusterLogLevel(Parser::Context &, /* XXX should use constants for this value */ if(level > 15) { - errorString.assign("Invalied loglevel"); - goto error; + m_output->println("set cluster loglevel reply"); + m_output->println("result: Invalid loglevel"); + m_output->println(""); + return; } EventSubscribeReq req; @@ -786,11 +788,6 @@ MgmApiSession::setClusterLogLevel(Parser::Context &, m_output->println("set cluster loglevel reply"); m_output->println("result: Ok"); m_output->println(""); - return; -error: - m_output->println("set cluster loglevel reply"); - m_output->println("result: %s", errorString.c_str()); - m_output->println(""); } void @@ -807,8 +804,10 @@ MgmApiSession::setLogLevel(Parser::Context &, /* XXX should use constants for this value */ if(level > 15) { - errorString.assign("Invalied loglevel"); - goto error; + m_output->println("set loglevel reply"); + m_output->println("result: Invalid loglevel", errorString.c_str()); + m_output->println(""); + return; } EventSubscribeReq req; @@ -820,11 +819,6 @@ MgmApiSession::setLogLevel(Parser::Context &, m_output->println("set loglevel reply"); m_output->println("result: Ok"); m_output->println(""); - return; - error: - m_output->println("set loglevel reply"); - m_output->println("result: %s", errorString.c_str()); - m_output->println(""); } void diff --git a/ndb/src/ndbapi/NdbDictionaryImpl.cpp b/ndb/src/ndbapi/NdbDictionaryImpl.cpp index 76854cabcd7..304d1b904d4 100644 --- a/ndb/src/ndbapi/NdbDictionaryImpl.cpp +++ b/ndb/src/ndbapi/NdbDictionaryImpl.cpp @@ -47,15 +47,13 @@ * Column */ NdbColumnImpl::NdbColumnImpl() - : NdbDictionary::Column(* this), m_facade(this), - m_attrId(-1) + : NdbDictionary::Column(* this), m_attrId(-1), m_facade(this) { init(); } NdbColumnImpl::NdbColumnImpl(NdbDictionary::Column & f) - : NdbDictionary::Column(* this), m_facade(&f), - m_attrId(-1) + : NdbDictionary::Column(* this), m_attrId(-1), m_facade(&f) { init(); } From a614bc9b59209e494a0299241b18283c3eaadcb9 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 2 Nov 2004 22:46:55 +0100 Subject: [PATCH 0080/1063] one more name clash in public includes fixed http://lists.mysql.com/internals/18149 --- include/my_list.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/my_list.h b/include/my_list.h index 789bbb50f97..f786621e311 100644 --- a/include/my_list.h +++ b/include/my_list.h @@ -33,8 +33,8 @@ extern LIST *list_delete(LIST *root,LIST *element); extern LIST *list_cons(void *data,LIST *root); extern LIST *list_reverse(LIST *root); extern void list_free(LIST *root,unsigned int free_data); -extern unsigned int list_length(LIST *list); -extern int list_walk(LIST *list,list_walk_action action,gptr argument); +extern unsigned int list_length(LIST *); +extern int list_walk(LIST *,list_walk_action action,gptr argument); #define rest(a) ((a)->next) #define list_push(a,b) (a)=list_cons((b),(a)) From 78c4faa297539c95c33c69d00dfb5e129c2afcca Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 2 Nov 2004 23:34:40 +0100 Subject: [PATCH 0081/1063] bad automerge (?) fixed --- tests/client_test.c | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/client_test.c b/tests/client_test.c index 70e1b26aeaa..227f7e29ef2 100644 --- a/tests/client_test.c +++ b/tests/client_test.c @@ -815,7 +815,6 @@ end: static void test_debug_example() { - DBUG_ENTER("fill_tables"); int rc; MYSQL_RES *result; From 1d3f4a1a490656378131d66cb507145e5141fbdd Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 2 Nov 2004 17:53:25 -0700 Subject: [PATCH 0082/1063] Portability fixes to mysqld_safe for non-Linux systems. Fix FIND_PROC for Solaris test, and fix if @IS_LINUX@ test in mysqld_safe itself. configure.in: Portability fix for FIND_PROC setting; on Solaris (and probably others), 'ps -p $$' inside a shell script just returns 'sh' for command line, even though $0 contains the filename. So, use 'ps -fp $$' in the test (it shows the full command line, e.g., 'sh configure'). Leave the actual FIND_PROC command as-is, since mysqld itself is not a shell script. scripts/mysqld_safe.sh: Portability fix for mysqld_safe on non-Linux systems. A bogus use of 'if' and 'test' caused non-bash shells to enter a section meant to be run only on Linux systems. BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted --- BitKeeper/etc/logging_ok | 1 + configure.in | 2 +- scripts/mysqld_safe.sh | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok index 060586b6874..a716afb2392 100644 --- a/BitKeeper/etc/logging_ok +++ b/BitKeeper/etc/logging_ok @@ -139,6 +139,7 @@ tim@bitch.mysql.fi tim@black.box tim@hundin.mysql.fi tim@sand.box +tim@siva.hindu.god tim@threads.polyesthetic.msg tim@white.box tim@work.mysql.com diff --git a/configure.in b/configure.in index d4ede468435..97a59258ba8 100644 --- a/configure.in +++ b/configure.in @@ -444,7 +444,7 @@ if $PS p $$ 2> /dev/null | grep $0 > /dev/null then FIND_PROC="$PS p \$\$PID | grep mysqld > /dev/null" # Solaris -elif $PS -p $$ 2> /dev/null | grep $0 > /dev/null +elif $PS -fp $$ 2> /dev/null | grep $0 > /dev/null then FIND_PROC="$PS -p \$\$PID | grep mysqld > /dev/null" # BSD style diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index b9e7ce21f79..da7e06f6c05 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -315,7 +315,7 @@ do break fi - if test @IS_LINUX@ -a $KILL_MYSQLD -eq 1 + if @IS_LINUX@ && test $KILL_MYSQLD -eq 1 then # Test if one process was hanging. # This is only a fix for Linux (running as base 3 mysqld processes) From a87ff6cc4e50285d3325c5dd55b984ff3164ccb4 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 3 Nov 2004 09:02:55 +0100 Subject: [PATCH 0083/1063] Changed order or template specializations (to make aCC on hpita2 not assert) ndb/src/common/util/basestring_vsnprintf.c: Removed redundant declaration ndb/src/ndbapi/NdbDictionary.cpp: Add printout of distribution key property --- ndb/src/common/debugger/signaldata/SignalDataPrint.cpp | 6 +++--- ndb/src/common/util/basestring_vsnprintf.c | 1 - ndb/src/ndbapi/NdbDictionary.cpp | 4 ++++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/ndb/src/common/debugger/signaldata/SignalDataPrint.cpp b/ndb/src/common/debugger/signaldata/SignalDataPrint.cpp index 3314f0bd097..188468e1c31 100644 --- a/ndb/src/common/debugger/signaldata/SignalDataPrint.cpp +++ b/ndb/src/common/debugger/signaldata/SignalDataPrint.cpp @@ -254,9 +254,9 @@ SignalDataPrintFunctions[] = { ,{ 0, 0 } }; -template class Bitmask<1>; -template class Bitmask<2>; -template class Bitmask<4>; template struct BitmaskPOD<1>; template struct BitmaskPOD<2>; template struct BitmaskPOD<4>; +template class Bitmask<1>; +template class Bitmask<2>; +template class Bitmask<4>; diff --git a/ndb/src/common/util/basestring_vsnprintf.c b/ndb/src/common/util/basestring_vsnprintf.c index 7307279f345..1b4d88679c1 100644 --- a/ndb/src/common/util/basestring_vsnprintf.c +++ b/ndb/src/common/util/basestring_vsnprintf.c @@ -40,7 +40,6 @@ basestring_snprintf(char *str, size_t size, const char *format, ...) * Let's hope vsnprintf works anyways */ #define BASESTRING_VSNPRINTF_FUNC(a,b,c,d) vsnprintf(a,b,c,d) - extern int my_vsnprintf(char *str, size_t size, const char *format, va_list ap); #endif #ifdef SNPRINTF_RETURN_TRUNC static char basestring_vsnprintf_buf[16*1024]; diff --git a/ndb/src/ndbapi/NdbDictionary.cpp b/ndb/src/ndbapi/NdbDictionary.cpp index c8414ec16a3..0da62cb2e1d 100644 --- a/ndb/src/ndbapi/NdbDictionary.cpp +++ b/ndb/src/ndbapi/NdbDictionary.cpp @@ -956,6 +956,10 @@ operator<<(NdbOut& out, const NdbDictionary::Column& col) out << " NOT NULL"; else out << " NULL"; + + if (col.getDistributionKey()) + out << " DISTRIBUTION KEY"; + return out; } From 15f7e7ad89ae68616106db5ed149866950cad445 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 3 Nov 2004 11:29:19 +0100 Subject: [PATCH 0084/1063] Changed implementation in NdbDaemon slightly to handle bug lockf & F_TEST on linux alpha,sparc,sparc64 (http://sources.redhat.com/ml/libc-alpha/2000-10/msg00390.html) --- ndb/src/common/portlib/NdbDaemon.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/ndb/src/common/portlib/NdbDaemon.c b/ndb/src/common/portlib/NdbDaemon.c index c73b5927ff4..3f1c1998501 100644 --- a/ndb/src/common/portlib/NdbDaemon.c +++ b/ndb/src/common/portlib/NdbDaemon.c @@ -55,18 +55,21 @@ NdbDaemon_Make(const char* lockfile, const char* logfile, unsigned flags) "%s: lseek failed: %s", lockfile, strerror(errno)); return -1; } +#ifdef F_TLOCK /* Test for lock before becoming daemon */ - if (lockf(lockfd, F_TEST, 0) == -1) { - if (errno == EACCES || errno == EAGAIN) { /* results may vary */ + if (lockf(lockfd, F_TLOCK, 0) == -1) + { + if (errno == EACCES || errno == EAGAIN) { /* results may vary */ snprintf(NdbDaemon_ErrorText, NdbDaemon_ErrorSize, - "%s: already locked by pid=%ld", lockfile, NdbDaemon_DaemonPid); + "%s: already locked by pid=%ld", lockfile, NdbDaemon_DaemonPid); return -1; } NdbDaemon_ErrorCode = errno; snprintf(NdbDaemon_ErrorText, NdbDaemon_ErrorSize, - "%s: lock test failed: %s", lockfile, strerror(errno)); + "%s: lock test failed: %s", lockfile, strerror(errno)); return -1; } +#endif /* Test open log file before becoming daemon */ if (logfile != NULL) { logfd = open(logfile, O_CREAT|O_WRONLY|O_APPEND, 0644); @@ -77,6 +80,15 @@ NdbDaemon_Make(const char* lockfile, const char* logfile, unsigned flags) return -1; } } +#ifdef F_TLOCK + if (lockf(lockfd, F_ULOCK, 0) == -1) + { + snprintf(NdbDaemon_ErrorText, NdbDaemon_ErrorSize, + "%s: fail to unlock", lockfile); + return -1; + } +#endif + /* Fork */ n = fork(); if (n == -1) { From 0afed4c3eb914788528087405022878a2ef5bc95 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 3 Nov 2004 15:22:33 +0400 Subject: [PATCH 0085/1063] opt_range.cc, range.result, range.test: Bug #6045: Binary Comparison regression in MySQL 4.1 Binary searches didn't use a case insensitive index, now they do. mysql-test/t/range.test: Bug #6045: Binary Comparison regression in MySQL 4.1 Binary searches didn't use a case insensitive index, now they do. mysql-test/r/range.result: Bug #6045: Binary Comparison regression in MySQL 4.1 Binary searches didn't use a case insensitive index, now they do. sql/opt_range.cc: Bug #6045: Binary Comparison regression in MySQL 4.1 Binary searches didn't use a case insensitive index, now they do. --- mysql-test/r/range.result | 16 ++++++++++++++++ mysql-test/t/range.test | 14 ++++++++++++++ sql/opt_range.cc | 15 ++++++++++++--- 3 files changed, 42 insertions(+), 3 deletions(-) diff --git a/mysql-test/r/range.result b/mysql-test/r/range.result index 4ca96316800..17ed9513653 100644 --- a/mysql-test/r/range.result +++ b/mysql-test/r/range.result @@ -561,3 +561,19 @@ select count(*) from t1 where x = 18446744073709551601; count(*) 1 drop table t1; +set names latin1; +create table t1 (a char(10), b text, key (a)) character set latin1; +INSERT INTO t1 (a) VALUES +('111'),('222'),('222'),('222'),('222'),('444'),('aaa'),('AAA'),('bbb'); +explain select * from t1 where a='aaa'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref a a 11 const 2 Using where +explain select * from t1 where a=binary 'aaa'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range a a 11 NULL 2 Using where +explain select * from t1 where a='aaa' collate latin1_bin; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range a a 11 NULL 2 Using where +explain select * from t1 where a='aaa' collate latin1_german1_ci; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL a NULL NULL NULL 9 Using where diff --git a/mysql-test/t/range.test b/mysql-test/t/range.test index cd6620f7126..44f55da5722 100644 --- a/mysql-test/t/range.test +++ b/mysql-test/t/range.test @@ -431,3 +431,17 @@ select count(*) from t1 where x = 18446744073709551601; drop table t1; +# +# Bug #6045: Binary Comparison regression in MySQL 4.1 +# Binary searches didn't use a case insensitive index. +# +set names latin1; +create table t1 (a char(10), b text, key (a)) character set latin1; +INSERT INTO t1 (a) VALUES +('111'),('222'),('222'),('222'),('222'),('444'),('aaa'),('AAA'),('bbb'); +# all these three can be optimized +explain select * from t1 where a='aaa'; +explain select * from t1 where a=binary 'aaa'; +explain select * from t1 where a='aaa' collate latin1_bin; +# this one cannot: +explain select * from t1 where a='aaa' collate latin1_german1_ci; diff --git a/sql/opt_range.cc b/sql/opt_range.cc index 541acc69ec7..c9528af7d98 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -1013,13 +1013,22 @@ get_mm_leaf(PARAM *param, COND *conf_func, Field *field, KEY_PART *key_part, } /* - We can't use an index when comparing strings of - different collations + 1. Usually we can't use an index if the column collation + differ from the operation collation. + + 2. However, we can reuse a case insensitive index for + the binary searches: + + WHERE latin1_swedish_ci_column = 'a' COLLATE lati1_bin; + + WHERE latin1_swedish_ci_colimn = BINARY 'a ' + */ if (field->result_type() == STRING_RESULT && value->result_type() == STRING_RESULT && key_part->image_type == Field::itRAW && - ((Field_str*)field)->charset() != conf_func->compare_collation()) + ((Field_str*)field)->charset() != conf_func->compare_collation() && + !(conf_func->compare_collation()->state & MY_CS_BINSORT)) DBUG_RETURN(0); if (type == Item_func::LIKE_FUNC) From 269c977aae168ca9645cd5a806acd69067210f3f Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 3 Nov 2004 11:43:46 +0000 Subject: [PATCH 0086/1063] mysql-master-run does not need to start second mysqld with innodb, add --skip-innodb --- mysql-test/mysql-test-run.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index 6b40fb3e974..65be9bf9c8e 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -994,9 +994,11 @@ start_master() if [ -n "$1" ] ; then id=`$EXPR $1 + 101`; this_master_myport=`$EXPR $MASTER_MYPORT + $1` + NOT_FIRST_MASTER_EXTRA_OPTS="--skip-innodb" else id=1; this_master_myport=$MASTER_MYPORT + NOT_FIRST_MASTER_EXTRA_OPTS="" fi if [ -z "$DO_BENCH" ] then @@ -1020,7 +1022,8 @@ start_master() --open-files-limit=1024 \ $MASTER_40_ARGS \ $SMALL_SERVER \ - $EXTRA_MASTER_OPT $EXTRA_MASTER_MYSQLD_OPT" + $EXTRA_MASTER_OPT $EXTRA_MASTER_MYSQLD_OPT \ + $NOT_FIRST_MASTER_EXTRA_OPTS" else master_args="--no-defaults --log-bin=$MYSQL_TEST_DIR/var/log/master-bin$1 \ --server-id=$id --rpl-recovery-rank=1 \ @@ -1039,7 +1042,8 @@ start_master() --innodb_data_file_path=ibdata1:50M \ $MASTER_40_ARGS \ $SMALL_SERVER \ - $EXTRA_MASTER_OPT $EXTRA_MASTER_MYSQLD_OPT" + $EXTRA_MASTER_OPT $EXTRA_MASTER_MYSQLD_OPT \ + $NOT_FIRST_MASTER_EXTRA_OPTS" fi CUR_MYERR=$MASTER_MYERR From 0aa8d14149e6cd22f91dd60db99d56fb93b11b9c Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 3 Nov 2004 14:56:48 +0200 Subject: [PATCH 0087/1063] InnoDB: fix bugs in the FOREIGN KEY parser (Bug #6340) innobase/dict/dict0dict.c: dict_scan_to(): skip quoted strings while scanning for the keyword dict_create_foreign_constraints_low(): allow quote immediately after CONSTRAINT --- innobase/dict/dict0dict.c | 55 +++++++++++++++++++++------------------ 1 file changed, 29 insertions(+), 26 deletions(-) diff --git a/innobase/dict/dict0dict.c b/innobase/dict/dict0dict.c index 5ca31ecd422..aa5bab210ef 100644 --- a/innobase/dict/dict0dict.c +++ b/innobase/dict/dict0dict.c @@ -604,7 +604,7 @@ dict_table_get_on_id( } /************************************************************************ -Looks for column n postion in the clustered index. */ +Looks for column n position in the clustered index. */ ulint dict_table_get_nth_col_pos( @@ -2140,8 +2140,8 @@ dict_foreign_add_to_cache( /************************************************************************* Scans from pointer onwards. Stops if is at the start of a copy of -'string' where characters are compared without case sensitivity. Stops -also at '\0'. */ +'string' where characters are compared without case sensitivity, and +only outside `` or "" quotes. Stops also at '\0'. */ static const char* dict_scan_to( @@ -2150,31 +2150,34 @@ dict_scan_to( const char* ptr, /* in: scan from */ const char* string) /* in: look for this */ { - ibool success; - ulint i; -loop: - if (*ptr == '\0') { - return(ptr); - } - - success = TRUE; - - for (i = 0; i < ut_strlen(string); i++) { - if (toupper((ulint)(ptr[i])) != toupper((ulint)(string[i]))) { - success = FALSE; + char quote = '\0'; + for (; *ptr; ptr++) { + if (*ptr == quote) { + /* Closing quote character: do not look for + starting quote or the keyword. */ + quote = '\0'; + } else if (quote) { + /* Within quotes: do nothing. */ + } else if (*ptr == '`' || *ptr == '"') { + /* Starting quote: remember the quote character. */ + quote = *ptr; + } else { + /* Outside quotes: look for the keyword. */ + ulint i; + for (i = 0; string[i]; i++) { + if (toupper((ulint)(ptr[i])) + != toupper((ulint)(string[i]))) { + goto nomatch; + } + } break; + nomatch: + ; } } - if (success) { - - return(ptr); - } - - ptr++; - - goto loop; + return(ptr); } /************************************************************************* @@ -2762,13 +2765,13 @@ loop: ut_a(success); - if (!isspace(*ptr)) { + if (!isspace(*ptr) && *ptr != '"' && *ptr != '`') { goto loop; } - do { + while (isspace(*ptr)) { ptr++; - } while (isspace(*ptr)); + } /* read constraint name unless got "CONSTRAINT FOREIGN" */ if (ptr != ptr2) { From 735be56379f1c4b79c73caef6d581f72d820b00a Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 3 Nov 2004 14:34:21 +0000 Subject: [PATCH 0088/1063] changed to use the future-proof option to ndb_mgmd there was a clash in using -c, added -f as the future proof switch mysql-test/ndb/ndbcluster.sh: changed to use the future-proof option to ndb_mgmd ndb/src/mgmsrv/main.cpp: there was a clash in using -c, added -f as the future proof switch --- mysql-test/ndb/ndbcluster.sh | 2 +- ndb/src/mgmsrv/main.cpp | 27 +++++++++++++++++++++++++-- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/mysql-test/ndb/ndbcluster.sh b/mysql-test/ndb/ndbcluster.sh index 294d32ac4be..9d83a291f3d 100644 --- a/mysql-test/ndb/ndbcluster.sh +++ b/mysql-test/ndb/ndbcluster.sh @@ -146,7 +146,7 @@ fi rm -f "$cfgfile" 2>&1 | cat > /dev/null rm -f "$fs_ndb/$cfgfile" 2>&1 | cat > /dev/null -if ( cd "$fs_ndb" ; $exec_mgmtsrvr -c config.ini ) ; then :; else +if ( cd "$fs_ndb" ; $exec_mgmtsrvr -f config.ini ) ; then :; else echo "Unable to start $exec_mgmtsrvr from `pwd`" exit 1 fi diff --git a/ndb/src/mgmsrv/main.cpp b/ndb/src/mgmsrv/main.cpp index c1876f68ea2..15767e4766d 100644 --- a/ndb/src/mgmsrv/main.cpp +++ b/ndb/src/mgmsrv/main.cpp @@ -101,8 +101,23 @@ static char *opt_connect_str= 0; static struct my_option my_long_options[] = { - NDB_STD_OPTS("ndb_mgmd"), - { "config-file", 'c', "Specify cluster configuration file", +#ifndef DBUG_OFF + { "debug", '#', "Output debug log. Often this is 'd:t:o,filename'.", + 0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0 }, +#endif + { "usage", '?', "Display this help and exit.", + 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 }, + { "help", '?', "Display this help and exit.", + 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 }, + { "version", 'V', "Output version information and exit.", 0, 0, 0, + GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 }, + { "connect-string", 1023, + "Set connect string for connecting to ndb_mgmd. " + "=\"host=[;nodeid=]\". " + "Overides specifying entries in NDB_CONNECTSTRING and config file", + (gptr*) &opt_connect_str, (gptr*) &opt_connect_str, 0, + GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, + { "config-file", 'f', "Specify cluster configuration file", (gptr*) &glob.config_filename, (gptr*) &glob.config_filename, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, { "daemon", 'd', "Run ndb_mgmd in daemon mode (default)", @@ -120,6 +135,11 @@ static struct my_option my_long_options[] = { "nodaemon", 258, "Don't run as daemon, but don't read from stdin", (gptr*) &glob.non_interactive, (gptr*) &glob.non_interactive, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 }, + { "config-file", 'c', + "-c provided for backwards compatability, will be removed in 5.0." + " Use -f instead", + (gptr*) &glob.config_filename, (gptr*) &glob.config_filename, 0, + GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} }; static void short_usage_sub(void) @@ -148,6 +168,9 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), case 'V': print_version(); exit(0); + case 'c': + printf("Warning: -c will be removed in 5.0, use -f instead\n"); + break; case '?': usage(); exit(0); From 9caa9f9cd3bd74ecf244dccd3330533563a3360d Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 3 Nov 2004 15:53:26 +0100 Subject: [PATCH 0089/1063] Fix for bug#6398 update of primary key fails --- mysql-test/r/ndb_basic.result | 5 ++ mysql-test/t/ndb_basic.test | 2 + sql/ha_ndbcluster.cc | 155 ++++++++++++++++++---------------- sql/ha_ndbcluster.h | 23 ++--- 4 files changed, 99 insertions(+), 86 deletions(-) diff --git a/mysql-test/r/ndb_basic.result b/mysql-test/r/ndb_basic.result index 604084a72c2..ba8ee820ad9 100644 --- a/mysql-test/r/ndb_basic.result +++ b/mysql-test/r/ndb_basic.result @@ -40,6 +40,11 @@ SELECT * FROM t1 ORDER BY pk1; pk1 attr1 attr2 attr3 3 1 NULL 9412 9412 9413 17 9413 +UPDATE t1 SET pk1=4 WHERE pk1 = 3; +SELECT * FROM t1 ORDER BY pk1; +pk1 attr1 attr2 attr3 +4 1 NULL 9412 +9412 9413 17 9413 DELETE FROM t1; SELECT * FROM t1; pk1 attr1 attr2 attr3 diff --git a/mysql-test/t/ndb_basic.test b/mysql-test/t/ndb_basic.test index f5bed3dcdff..b62d2a8e0e1 100644 --- a/mysql-test/t/ndb_basic.test +++ b/mysql-test/t/ndb_basic.test @@ -36,6 +36,8 @@ UPDATE t1 SET pk1=2 WHERE attr1=1; SELECT * FROM t1 ORDER BY pk1; UPDATE t1 SET pk1=pk1 + 1; SELECT * FROM t1 ORDER BY pk1; +UPDATE t1 SET pk1=4 WHERE pk1 = 3; +SELECT * FROM t1 ORDER BY pk1; # Delete the record DELETE FROM t1; diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 838cf69855a..ec00f09e5c5 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -324,7 +324,7 @@ int ha_ndbcluster::ndb_err(NdbConnection *trans) DBUG_PRINT("info", ("transformed ndbcluster error %d to mysql error %d", err.code, res)); if (res == HA_ERR_FOUND_DUPP_KEY) - dupkey= table->primary_key; + m_dupkey= table->primary_key; DBUG_RETURN(res); } @@ -551,7 +551,7 @@ int ha_ndbcluster::get_ndb_blobs_value(NdbBlob *last_ndb_blob) blob_size+= 8 - blob_size % 8; if (loop == 1) { - char *buf= blobs_buffer + offset; + char *buf= m_blobs_buffer + offset; uint32 len= 0xffffffff; // Max uint32 DBUG_PRINT("value", ("read blob ptr=%x len=%u", (uint)buf, (uint)blob_len)); @@ -563,15 +563,15 @@ int ha_ndbcluster::get_ndb_blobs_value(NdbBlob *last_ndb_blob) offset+= blob_size; } } - if (loop == 0 && offset > blobs_buffer_size) + if (loop == 0 && offset > m_blobs_buffer_size) { - my_free(blobs_buffer, MYF(MY_ALLOW_ZERO_PTR)); - blobs_buffer_size= 0; + my_free(m_blobs_buffer, MYF(MY_ALLOW_ZERO_PTR)); + m_blobs_buffer_size= 0; DBUG_PRINT("value", ("allocate blobs buffer size %u", offset)); - blobs_buffer= my_malloc(offset, MYF(MY_WME)); - if (blobs_buffer == NULL) + m_blobs_buffer= my_malloc(offset, MYF(MY_WME)); + if (m_blobs_buffer == NULL) DBUG_RETURN(-1); - blobs_buffer_size= offset; + m_blobs_buffer_size= offset; } } DBUG_RETURN(0); @@ -854,7 +854,7 @@ int ha_ndbcluster::get_ndb_lock_type(enum thr_lock_type type) { if (type >= TL_WRITE_ALLOW_WRITE) return NdbOperation::LM_Exclusive; - else if (uses_blob_value(retrieve_all_fields)) + else if (uses_blob_value(m_retrieve_all_fields)) return NdbOperation::LM_Read; else return NdbOperation::LM_CommittedRead; @@ -1018,7 +1018,7 @@ int ha_ndbcluster::pk_read(const byte *key, uint key_len, byte *buf) { Field *field= table->field[i]; if ((thd->query_id == field->query_id) || - retrieve_all_fields) + m_retrieve_all_fields) { if (get_ndb_value(op, field, i, buf)) ERR_RETURN(trans->getNdbError()); @@ -1055,7 +1055,7 @@ int ha_ndbcluster::complemented_pk_read(const byte *old_data, byte *new_data) THD *thd= current_thd; DBUG_ENTER("complemented_pk_read"); - if (retrieve_all_fields) + if (m_retrieve_all_fields) // We have allready retrieved all fields, nothing to complement DBUG_RETURN(0); @@ -1192,12 +1192,12 @@ inline int ha_ndbcluster::next_result(byte *buf) /* We can only handle one tuple with blobs at a time. */ - if (ops_pending && blobs_pending) + if (m_ops_pending && m_blobs_pending) { if (execute_no_commit(this,trans) != 0) DBUG_RETURN(ndb_err(trans)); - ops_pending= 0; - blobs_pending= FALSE; + m_ops_pending= 0; + m_blobs_pending= FALSE; } check= cursor->nextResult(contact_ndb); if (check == 0) @@ -1219,8 +1219,8 @@ inline int ha_ndbcluster::next_result(byte *buf) all pending update or delete operations should be sent to NDB */ - DBUG_PRINT("info", ("ops_pending: %d", ops_pending)); - if (ops_pending) + DBUG_PRINT("info", ("ops_pending: %d", m_ops_pending)); + if (m_ops_pending) { if (current_thd->transaction.on) { @@ -1234,7 +1234,7 @@ inline int ha_ndbcluster::next_result(byte *buf) int res= trans->restart(); DBUG_ASSERT(res == 0); } - ops_pending= 0; + m_ops_pending= 0; } contact_ndb= (check == 2); @@ -1423,7 +1423,7 @@ int ha_ndbcluster::define_read_attrs(byte* buf, NdbOperation* op) Field *field= table->field[i]; if ((thd->query_id == field->query_id) || (field->flags & PRI_KEY_FLAG) || - retrieve_all_fields) + m_retrieve_all_fields) { if (get_ndb_value(op, field, i, buf)) ERR_RETURN(op->getNdbError()); @@ -1666,9 +1666,9 @@ int ha_ndbcluster::write_row(byte *record) if (has_auto_increment) { - skip_auto_increment= FALSE; + m_skip_auto_increment= FALSE; update_auto_increment(); - skip_auto_increment= !auto_increment_column_changed; + m_skip_auto_increment= !auto_increment_column_changed; } if ((res= set_primary_key(op))) @@ -1683,7 +1683,7 @@ int ha_ndbcluster::write_row(byte *record) if (!(field->flags & PRI_KEY_FLAG) && set_ndb_value(op, field, i, &set_blob_value)) { - skip_auto_increment= TRUE; + m_skip_auto_increment= TRUE; ERR_RETURN(op->getNdbError()); } } @@ -1695,25 +1695,25 @@ int ha_ndbcluster::write_row(byte *record) to NoCommit the transaction between each row. Find out how this is detected! */ - rows_inserted++; + m_rows_inserted++; no_uncommitted_rows_update(1); - bulk_insert_not_flushed= TRUE; - if ((rows_to_insert == 1) || - ((rows_inserted % bulk_insert_rows) == 0) || + m_bulk_insert_not_flushed= TRUE; + if ((m_rows_to_insert == 1) || + ((m_rows_inserted % m_bulk_insert_rows) == 0) || set_blob_value) { THD *thd= current_thd; // Send rows to NDB DBUG_PRINT("info", ("Sending inserts to NDB, "\ "rows_inserted:%d, bulk_insert_rows: %d", - (int)rows_inserted, (int)bulk_insert_rows)); + (int)m_rows_inserted, (int)m_bulk_insert_rows)); - bulk_insert_not_flushed= FALSE; + m_bulk_insert_not_flushed= FALSE; if (thd->transaction.on) { if (execute_no_commit(this,trans) != 0) { - skip_auto_increment= TRUE; + m_skip_auto_increment= TRUE; no_uncommitted_rows_execute_failure(); DBUG_RETURN(ndb_err(trans)); } @@ -1722,7 +1722,7 @@ int ha_ndbcluster::write_row(byte *record) { if (execute_commit(this,trans) != 0) { - skip_auto_increment= TRUE; + m_skip_auto_increment= TRUE; no_uncommitted_rows_execute_failure(); DBUG_RETURN(ndb_err(trans)); } @@ -1730,7 +1730,7 @@ int ha_ndbcluster::write_row(byte *record) DBUG_ASSERT(res == 0); } } - if ((has_auto_increment) && (skip_auto_increment)) + if ((has_auto_increment) && (m_skip_auto_increment)) { Uint64 next_val= (Uint64) table->next_number_field->val_int() + 1; DBUG_PRINT("info", @@ -1740,7 +1740,7 @@ int ha_ndbcluster::write_row(byte *record) DBUG_PRINT("info", ("Setting next auto increment value to %u", next_val)); } - skip_auto_increment= TRUE; + m_skip_auto_increment= TRUE; DBUG_RETURN(0); } @@ -1820,7 +1820,9 @@ int ha_ndbcluster::update_row(const byte *old_data, byte *new_data) } // Delete old row DBUG_PRINT("info", ("insert succeded")); + m_primary_key_update= TRUE; delete_res= delete_row(old_data); + m_primary_key_update= FALSE; if (delete_res) { DBUG_PRINT("info", ("delete failed")); @@ -1843,9 +1845,9 @@ int ha_ndbcluster::update_row(const byte *old_data, byte *new_data) DBUG_PRINT("info", ("Calling updateTuple on cursor")); if (!(op= cursor->updateTuple())) ERR_RETURN(trans->getNdbError()); - ops_pending++; + m_ops_pending++; if (uses_blob_value(FALSE)) - blobs_pending= TRUE; + m_blobs_pending= TRUE; } else { @@ -1921,7 +1923,7 @@ int ha_ndbcluster::delete_row(const byte *record) DBUG_PRINT("info", ("Calling deleteTuple on cursor")); if (cursor->deleteTuple() != 0) ERR_RETURN(trans->getNdbError()); - ops_pending++; + m_ops_pending++; no_uncommitted_rows_update(-1); @@ -1951,8 +1953,10 @@ int ha_ndbcluster::delete_row(const byte *record) else { int res; - if ((res= set_primary_key(op))) - return res; + if ((res= (m_primary_key_update ? + set_primary_key_from_old_data(op, record) + : set_primary_key(op)))) + return res; } } @@ -2411,18 +2415,18 @@ int ha_ndbcluster::close_scan() DBUG_RETURN(1); - if (ops_pending) + if (m_ops_pending) { /* Take over any pending transactions to the deleteing/updating transaction before closing the scan */ - DBUG_PRINT("info", ("ops_pending: %d", ops_pending)); + DBUG_PRINT("info", ("ops_pending: %d", m_ops_pending)); if (execute_no_commit(this,trans) != 0) { no_uncommitted_rows_execute_failure(); DBUG_RETURN(ndb_err(trans)); } - ops_pending= 0; + m_ops_pending= 0; } cursor->close(); @@ -2555,7 +2559,7 @@ void ha_ndbcluster::info(uint flag) if (flag & HA_STATUS_ERRKEY) { DBUG_PRINT("info", ("HA_STATUS_ERRKEY")); - errkey= dupkey; + errkey= m_dupkey; } if (flag & HA_STATUS_AUTO) DBUG_PRINT("info", ("HA_STATUS_AUTO")); @@ -2663,7 +2667,7 @@ int ha_ndbcluster::extra(enum ha_extra_function operation) where field->query_id is the same as the current query id */ DBUG_PRINT("info", ("HA_EXTRA_RETRIEVE_ALL_COLS")); - retrieve_all_fields= TRUE; + m_retrieve_all_fields= TRUE; break; case HA_EXTRA_PREPARE_FOR_DELETE: DBUG_PRINT("info", ("HA_EXTRA_PREPARE_FOR_DELETE")); @@ -2707,8 +2711,8 @@ void ha_ndbcluster::start_bulk_insert(ha_rows rows) DBUG_ENTER("start_bulk_insert"); DBUG_PRINT("enter", ("rows: %d", (int)rows)); - rows_inserted= 0; - rows_to_insert= rows; + m_rows_inserted= 0; + m_rows_to_insert= rows; /* Calculate how many rows that should be inserted @@ -2722,7 +2726,7 @@ void ha_ndbcluster::start_bulk_insert(ha_rows rows) batch= bytesperbatch/bytes; batch= batch == 0 ? 1 : batch; DBUG_PRINT("info", ("batch: %d, bytes: %d", batch, bytes)); - bulk_insert_rows= batch; + m_bulk_insert_rows= batch; DBUG_VOID_RETURN; } @@ -2736,22 +2740,22 @@ int ha_ndbcluster::end_bulk_insert() DBUG_ENTER("end_bulk_insert"); // Check if last inserts need to be flushed - if (bulk_insert_not_flushed) + if (m_bulk_insert_not_flushed) { NdbConnection *trans= m_active_trans; // Send rows to NDB DBUG_PRINT("info", ("Sending inserts to NDB, "\ "rows_inserted:%d, bulk_insert_rows: %d", - rows_inserted, bulk_insert_rows)); - bulk_insert_not_flushed= FALSE; + m_rows_inserted, m_bulk_insert_rows)); + m_bulk_insert_not_flushed= FALSE; if (execute_no_commit(this,trans) != 0) { no_uncommitted_rows_execute_failure(); my_errno= error= ndb_err(trans); } } - rows_inserted= 0; - rows_to_insert= 1; + m_rows_inserted= 0; + m_rows_to_insert= 1; DBUG_RETURN(error); } @@ -2937,8 +2941,8 @@ int ha_ndbcluster::external_lock(THD *thd, int lock_type) (NdbConnection*)thd->transaction.stmt.ndb_tid; DBUG_ASSERT(m_active_trans); // Start of transaction - retrieve_all_fields= FALSE; - ops_pending= 0; + m_retrieve_all_fields= FALSE; + m_ops_pending= 0; { NDBDICT *dict= m_ndb->getDictionary(); const NDBTAB *tab; @@ -2986,13 +2990,13 @@ int ha_ndbcluster::external_lock(THD *thd, int lock_type) DBUG_PRINT("warning", ("m_active_cursor != NULL")); m_active_cursor= NULL; - if (blobs_pending) + if (m_blobs_pending) DBUG_PRINT("warning", ("blobs_pending != 0")); - blobs_pending= 0; + m_blobs_pending= 0; - if (ops_pending) + if (m_ops_pending) DBUG_PRINT("warning", ("ops_pending != 0L")); - ops_pending= 0; + m_ops_pending= 0; } DBUG_RETURN(error); } @@ -3029,8 +3033,8 @@ int ha_ndbcluster::start_stmt(THD *thd) m_active_trans= trans; // Start of statement - retrieve_all_fields= FALSE; - ops_pending= 0; + m_retrieve_all_fields= FALSE; + m_ops_pending= 0; DBUG_RETURN(error); } @@ -3571,13 +3575,13 @@ longlong ha_ndbcluster::get_auto_increment() DBUG_ENTER("get_auto_increment"); DBUG_PRINT("enter", ("m_tabname: %s", m_tabname)); int cache_size= - (rows_to_insert - rows_inserted < autoincrement_prefetch) ? - rows_to_insert - rows_inserted - : (rows_to_insert > autoincrement_prefetch) ? - rows_to_insert + (m_rows_to_insert - m_rows_inserted < autoincrement_prefetch) ? + m_rows_to_insert - m_rows_inserted + : (m_rows_to_insert > autoincrement_prefetch) ? + m_rows_to_insert : autoincrement_prefetch; Uint64 auto_value= - (skip_auto_increment) ? + (m_skip_auto_increment) ? m_ndb->readAutoIncrementValue((const NDBTAB *) m_table) : m_ndb->getAutoIncrementValue((const NDBTAB *) m_table, cache_size); DBUG_RETURN((longlong)auto_value); @@ -3602,17 +3606,18 @@ ha_ndbcluster::ha_ndbcluster(TABLE *table_arg): m_share(0), m_use_write(FALSE), m_ignore_dup_key_not_supported(FALSE), - retrieve_all_fields(FALSE), - rows_to_insert(1), - rows_inserted(0), - bulk_insert_rows(1024), - bulk_insert_not_flushed(FALSE), - ops_pending(0), - skip_auto_increment(TRUE), - blobs_pending(0), - blobs_buffer(0), - blobs_buffer_size(0), - dupkey((uint) -1) + m_primary_key_update(FALSE), + m_retrieve_all_fields(FALSE), + m_rows_to_insert(1), + m_rows_inserted(0), + m_bulk_insert_rows(1024), + m_bulk_insert_not_flushed(FALSE), + m_ops_pending(0), + m_skip_auto_increment(TRUE), + m_blobs_pending(0), + m_blobs_buffer(0), + m_blobs_buffer_size(0), + m_dupkey((uint) -1) { int i; @@ -3646,8 +3651,8 @@ ha_ndbcluster::~ha_ndbcluster() if (m_share) free_share(m_share); release_metadata(); - my_free(blobs_buffer, MYF(MY_ALLOW_ZERO_PTR)); - blobs_buffer= 0; + my_free(m_blobs_buffer, MYF(MY_ALLOW_ZERO_PTR)); + m_blobs_buffer= 0; // Check for open cursor/transaction if (m_active_cursor) { diff --git a/sql/ha_ndbcluster.h b/sql/ha_ndbcluster.h index b33a0657d4f..2121228a869 100644 --- a/sql/ha_ndbcluster.h +++ b/sql/ha_ndbcluster.h @@ -243,18 +243,19 @@ class ha_ndbcluster: public handler NdbValue m_value[NDB_MAX_ATTRIBUTES_IN_TABLE]; bool m_use_write; bool m_ignore_dup_key_not_supported; - bool retrieve_all_fields; - ha_rows rows_to_insert; - ha_rows rows_inserted; - ha_rows bulk_insert_rows; - bool bulk_insert_not_flushed; - ha_rows ops_pending; - bool skip_auto_increment; - bool blobs_pending; + bool m_primary_key_update; + bool m_retrieve_all_fields; + ha_rows m_rows_to_insert; + ha_rows m_rows_inserted; + ha_rows m_bulk_insert_rows; + bool m_bulk_insert_not_flushed; + ha_rows m_ops_pending; + bool m_skip_auto_increment; + bool m_blobs_pending; // memory for blobs in one tuple - char *blobs_buffer; - uint32 blobs_buffer_size; - uint dupkey; + char *m_blobs_buffer; + uint32 m_blobs_buffer_size; + uint m_dupkey; void set_rec_per_key(); void records_update(); From 539e2130b02b09581586ab1b1efd7ece8ef3ef4d Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 3 Nov 2004 18:23:58 +0100 Subject: [PATCH 0090/1063] Fix for bug#5551 (Version 4). The idea of the fix is that the administrative statements OPTIMIZE TABLE, REPAIR TABLE and ANALYZE TABLE should not generate binlog errors if there is no errors on the master. sql/sql_parse.cc: No binlog error generated sql/sql_table.cc: Documentation BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted --- BitKeeper/etc/logging_ok | 1 + mysql-test/r/rpl_failed_optimize.result | 15 +++++++++++++++ mysql-test/t/rpl_failed_optimize-master.opt | 1 + mysql-test/t/rpl_failed_optimize.test | 18 ++++++++++++++++++ sql/sql_parse.cc | 3 +++ sql/sql_table.cc | 6 ++++++ 6 files changed, 44 insertions(+) create mode 100644 mysql-test/r/rpl_failed_optimize.result create mode 100644 mysql-test/t/rpl_failed_optimize-master.opt create mode 100644 mysql-test/t/rpl_failed_optimize.test diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok index 953ddf7b564..ac02fa84bbc 100644 --- a/BitKeeper/etc/logging_ok +++ b/BitKeeper/etc/logging_ok @@ -95,6 +95,7 @@ kaj@work.mysql.com kent@mysql.com konstantin@mysql.com kostja@oak.local +lars@mysql.com lenz@kallisto.mysql.com lenz@mysql.com magnus@neptunus.(none) diff --git a/mysql-test/r/rpl_failed_optimize.result b/mysql-test/r/rpl_failed_optimize.result new file mode 100644 index 00000000000..1576ec60500 --- /dev/null +++ b/mysql-test/r/rpl_failed_optimize.result @@ -0,0 +1,15 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +CREATE TABLE t1 ( a int ) ENGINE=InnoDB; +BEGIN; +INSERT INTO t1 VALUES (1); +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status Operation failed +OPTIMIZE TABLE non_existing; +Table Op Msg_type Msg_text +test.non_existing optimize error Table 'test.non_existing' doesn't exist diff --git a/mysql-test/t/rpl_failed_optimize-master.opt b/mysql-test/t/rpl_failed_optimize-master.opt new file mode 100644 index 00000000000..a6ef074a120 --- /dev/null +++ b/mysql-test/t/rpl_failed_optimize-master.opt @@ -0,0 +1 @@ +--innodb-lock-wait-timeout=1 diff --git a/mysql-test/t/rpl_failed_optimize.test b/mysql-test/t/rpl_failed_optimize.test new file mode 100644 index 00000000000..d245d1bacbb --- /dev/null +++ b/mysql-test/t/rpl_failed_optimize.test @@ -0,0 +1,18 @@ +source include/have_innodb.inc; +source include/master-slave.inc; + +# +# BUG#5551 "Failed OPTIMIZE TABLE is logged to binary log" +# Replication should work when OPTIMIZE TABLE timeouts, and +# when OPTIMIZE TABLE is executed on a non-existing table +# + +CREATE TABLE t1 ( a int ) ENGINE=InnoDB; +BEGIN; +INSERT INTO t1 VALUES (1); + +connection master1; +OPTIMIZE TABLE t1; + +OPTIMIZE TABLE non_existing; +sync_slave_with_master; diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index dce32720184..f5b9bc0638f 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -2610,6 +2610,7 @@ unsent_create_error: mysql_update_log.write(thd, thd->query, thd->query_length); if (mysql_bin_log.is_open()) { + thd->clear_error(); // No binlog error generated Query_log_event qinfo(thd, thd->query, thd->query_length, 0); mysql_bin_log.write(&qinfo); } @@ -2638,6 +2639,7 @@ unsent_create_error: mysql_update_log.write(thd, thd->query, thd->query_length); if (mysql_bin_log.is_open()) { + thd->clear_error(); // No binlog error generated Query_log_event qinfo(thd, thd->query, thd->query_length, 0); mysql_bin_log.write(&qinfo); } @@ -2660,6 +2662,7 @@ unsent_create_error: mysql_update_log.write(thd, thd->query, thd->query_length); if (mysql_bin_log.is_open()) { + thd->clear_error(); // No binlog error generated Query_log_event qinfo(thd, thd->query, thd->query_length, 0); mysql_bin_log.write(&qinfo); } diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 2f7a5f32d01..c69235a5647 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -1734,6 +1734,12 @@ end: } +/* + RETURN VALUES + 0 Message sent to net (admin operation went ok) + -1 Message should be sent by caller + (admin operation or network communication failed) +*/ static int mysql_admin_table(THD* thd, TABLE_LIST* tables, HA_CHECK_OPT* check_opt, const char *operator_name, From d259ba4006a683e953486191d2851ee6c63f66b7 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 3 Nov 2004 17:59:03 +0000 Subject: [PATCH 0091/1063] Fix for bug #6387 "Queried timestamp values do not match the inserted value if server runs in time zone with leap seconds". Now in my_gmt_sec() function we take into account difference between our target and estimation in seconds part. mysql-test/Makefile.am: Added mysql-test/std_data/Moscow_leap reuired by new timezone3.test to source distribution. sql/time.cc: my_gmt_sec(): When comparing our target broken-down datetime t value and proper representation of our estimation *l_time we should take into account that they could differ in second part if we have time zone leap seconds. Also added comments about some assumptions used in this function. --- mysql-test/Makefile.am | 2 + .../r/have_moscow_leap_timezone.require | 2 + mysql-test/r/timezone3.result | 41 ++++++++++++ mysql-test/std_data/Moscow_leap | Bin 0 -> 991 bytes mysql-test/t/timezone3-master.opt | 1 + mysql-test/t/timezone3.test | 59 ++++++++++++++++++ sql/time.cc | 23 +++++-- 7 files changed, 123 insertions(+), 5 deletions(-) create mode 100644 mysql-test/r/have_moscow_leap_timezone.require create mode 100644 mysql-test/r/timezone3.result create mode 100644 mysql-test/std_data/Moscow_leap create mode 100644 mysql-test/t/timezone3-master.opt create mode 100644 mysql-test/t/timezone3.test diff --git a/mysql-test/Makefile.am b/mysql-test/Makefile.am index ba96c5947ba..8b0c096120a 100644 --- a/mysql-test/Makefile.am +++ b/mysql-test/Makefile.am @@ -32,6 +32,7 @@ dist-hook: $(INSTALL_DATA) $(srcdir)/r/*.result $(srcdir)/r/*.require $(distdir)/r $(INSTALL_DATA) $(srcdir)/std_data/*.dat $(srcdir)/std_data/*.001 $(distdir)/std_data $(INSTALL_DATA) $(srcdir)/std_data/des_key_file $(distdir)/std_data + $(INSTALL_DATA) $(srcdir)/std_data/Moscow_leap $(distdir)/std_data install-data-local: $(mkinstalldirs) \ @@ -50,6 +51,7 @@ install-data-local: $(INSTALL_DATA) $(srcdir)/std_data/*.dat $(DESTDIR)$(testdir)/std_data $(INSTALL_DATA) $(srcdir)/std_data/*.*001 $(DESTDIR)$(testdir)/std_data $(INSTALL_DATA) $(srcdir)/std_data/des_key_file $(DESTDIR)$(testdir)/std_data + $(INSTALL_DATA) $(srcdir)/std_data/Moscow_leap $(DESTDIR)$(testdir)/std_data SUFFIXES = .sh diff --git a/mysql-test/r/have_moscow_leap_timezone.require b/mysql-test/r/have_moscow_leap_timezone.require new file mode 100644 index 00000000000..f27452d7770 --- /dev/null +++ b/mysql-test/r/have_moscow_leap_timezone.require @@ -0,0 +1,2 @@ +from_unixtime(1072904422) +2004-01-01 00:00:00 diff --git a/mysql-test/r/timezone3.result b/mysql-test/r/timezone3.result new file mode 100644 index 00000000000..2135dd33511 --- /dev/null +++ b/mysql-test/r/timezone3.result @@ -0,0 +1,41 @@ +drop table if exists t1; +create table t1 (i int, c varchar(20)); +insert into t1 values +(unix_timestamp("2004-01-01 00:00:00"), "2004-01-01 00:00:00"); +insert into t1 values +(unix_timestamp("2004-03-28 01:59:59"), "2004-03-28 01:59:59"), +(unix_timestamp("2004-03-28 02:30:00"), "2004-03-28 02:30:00"), +(unix_timestamp("2004-03-28 03:00:00"), "2004-03-28 03:00:00"); +insert into t1 values +(unix_timestamp('2004-05-01 00:00:00'),'2004-05-01 00:00:00'); +insert into t1 values +(unix_timestamp('2004-10-31 01:00:00'),'2004-10-31 01:00:00'), +(unix_timestamp('2004-10-31 02:00:00'),'2004-10-31 02:00:00'), +(unix_timestamp('2004-10-31 02:59:59'),'2004-10-31 02:59:59'), +(unix_timestamp('2004-10-31 04:00:00'),'2004-10-31 04:00:00'), +(unix_timestamp('2004-10-31 02:59:59'),'2004-10-31 02:59:59'); +insert into t1 values +(unix_timestamp('1981-07-01 03:59:59'),'1981-07-01 03:59:59'), +(unix_timestamp('1981-07-01 04:00:00'),'1981-07-01 04:00:00'); +select i, from_unixtime(i), c from t1; +i from_unixtime(i) c +1072904422 2004-01-01 00:00:00 2004-01-01 00:00:00 +1080428421 2004-03-28 01:59:59 2004-03-28 01:59:59 +1080428422 2004-03-28 03:00:00 2004-03-28 02:30:00 +1080428422 2004-03-28 03:00:00 2004-03-28 03:00:00 +1083355222 2004-05-01 00:00:00 2004-05-01 00:00:00 +1099170022 2004-10-31 01:00:00 2004-10-31 01:00:00 +1099177222 2004-10-31 02:00:00 2004-10-31 02:00:00 +1099180821 2004-10-31 02:59:59 2004-10-31 02:59:59 +1099184422 2004-10-31 04:00:00 2004-10-31 04:00:00 +1099180821 2004-10-31 02:59:59 2004-10-31 02:59:59 +362793608 1981-07-01 03:59:59 1981-07-01 03:59:59 +362793610 1981-07-01 04:00:00 1981-07-01 04:00:00 +drop table t1; +create table t1 (ts timestamp); +insert into t1 values (19730101235900), (20040101235900); +select * from t1; +ts +19730101235900 +20040101235900 +drop table t1; diff --git a/mysql-test/std_data/Moscow_leap b/mysql-test/std_data/Moscow_leap new file mode 100644 index 0000000000000000000000000000000000000000..4994c005595dc06bc6d288e9ecea38307ce11c82 GIT binary patch literal 991 zcmWHE%1mRx1Ux_?5EcXCMkrfucD&q;xptps%+q==G4H!&$NZKEi3K-uITkXAX)Lr^ z=CDK{_rMZcqYX<%Gd3)>Wj?T6&NX1`63GNn_2oCkB<^^LbKH&+|HXe=;uYU*$=l98 zQfDULk>0c5kIb5he`M!0{gvw}{wrUT@>d}z^si!!+g~Lg^MA@V8vj&uB>$<(aQ#!` z{{3H_RlQ#Qt3-pwQ}GF!75gV>UbzsUb!4-n_Le)1I!n$r=}y_#q}Q^(S-)gKvq8$l zX2aOMEJj5$Sd4AwvzP=`v6{*@vYHviu$ui%X0wp4XtTKM%4YdHs?BPzI-B)vn>L$e z&TY24<=X7pRNL%lGqgFRv9~$4$g(-PzHD<&{?F#3db-Wk`5~Jd>)JMV<-=_5?@qCK zGB0KGJhz6;>v21q_qskdpEHZweESO6{MNL#`R4_(1@xr11%~If1?70Q1)B%7h4^T< zg^C-sh3W9Ng?$%kixAafi@5f!E%GZ5Thz82ZP8cWvBk{)$`-rj0$W`Db+-5^o7fWK zcd{kco@-08pUsvWyP+*bzLqW3c2Zj!$IP~L*^;*O7u9VUf5X}`PsFxm-L+`TUSZ#s zb1alCw?nZlZ<#q;eg<<}L7OC7VW0wAQR;8DVnZgj64$$Ir260> zt>VH8w#s*V+p0Enu~na&-&QkoSzGP8#&46d#rKnxUM*#tJ2k#)%%MxX^u>}~Q*K$@8| zJ(w9tvv7N~wE$^WUTyAHAkD_lW6uVp*#+JfwF7Amp>xZCE@I#moqwtmNOOrd{Nn=B z+>%L#-9Va0R`nGqd+{pXdJ1$i1E1==xqU#IU%mb!KadvC3ivt!NDJy1X#)MhAfzW8 nGYLow8$4GL2GSzNJ3OWUX;HHt0iX}T*%U}IFfalEm;ogKHtY+x literal 0 HcmV?d00001 diff --git a/mysql-test/t/timezone3-master.opt b/mysql-test/t/timezone3-master.opt new file mode 100644 index 00000000000..6910e6e6e8d --- /dev/null +++ b/mysql-test/t/timezone3-master.opt @@ -0,0 +1 @@ +--timezone=:$MYSQL_TEST_DIR/std_data/Moscow_leap diff --git a/mysql-test/t/timezone3.test b/mysql-test/t/timezone3.test new file mode 100644 index 00000000000..8910783cd85 --- /dev/null +++ b/mysql-test/t/timezone3.test @@ -0,0 +1,59 @@ +# +# Test of handling time zone with leap seconds. +# +# This test should be run with TZ=:$MYSQL_TEST_DIR/std_data/Moscow_leap +# This implies that this test should be run only on systems that interpret +# characters after colon in TZ variable as path to zoneinfo file. +# +# Check that we have successfully set time zone with leap seconds. +--require r/have_moscow_leap_timezone.require +disable_query_log; +select from_unixtime(1072904422); +enable_query_log; + +# Initial clean-up +--disable_warnings +drop table if exists t1; +--enable_warnings + +# +# Let us check behavior of conversion from broken-down representation +# to time_t representation, for normal, non-existent and ambigious dates +# (This check is similar to the one in timezone2.test in 4.1) +# +create table t1 (i int, c varchar(20)); +# Normal value without DST +insert into t1 values + (unix_timestamp("2004-01-01 00:00:00"), "2004-01-01 00:00:00"); +# Values around and in spring time-gap +insert into t1 values + (unix_timestamp("2004-03-28 01:59:59"), "2004-03-28 01:59:59"), + (unix_timestamp("2004-03-28 02:30:00"), "2004-03-28 02:30:00"), + (unix_timestamp("2004-03-28 03:00:00"), "2004-03-28 03:00:00"); +# Normal value with DST +insert into t1 values + (unix_timestamp('2004-05-01 00:00:00'),'2004-05-01 00:00:00'); +# Ambiguos values (also check for determenism) +insert into t1 values + (unix_timestamp('2004-10-31 01:00:00'),'2004-10-31 01:00:00'), + (unix_timestamp('2004-10-31 02:00:00'),'2004-10-31 02:00:00'), + (unix_timestamp('2004-10-31 02:59:59'),'2004-10-31 02:59:59'), + (unix_timestamp('2004-10-31 04:00:00'),'2004-10-31 04:00:00'), + (unix_timestamp('2004-10-31 02:59:59'),'2004-10-31 02:59:59'); +# Test of leap +insert into t1 values + (unix_timestamp('1981-07-01 03:59:59'),'1981-07-01 03:59:59'), + (unix_timestamp('1981-07-01 04:00:00'),'1981-07-01 04:00:00'); + +select i, from_unixtime(i), c from t1; +drop table t1; + +# +# Test for bug #6387 "Queried timestamp values do not match the +# inserted". my_gmt_sec() function was not working properly if we +# had time zone with leap seconds +# +create table t1 (ts timestamp); +insert into t1 values (19730101235900), (20040101235900); +select * from t1; +drop table t1; diff --git a/sql/time.cc b/sql/time.cc index 0363d764100..38670db054f 100644 --- a/sql/time.cc +++ b/sql/time.cc @@ -81,6 +81,10 @@ long my_gmt_sec(TIME *t, long *my_timezone) I couldn't come up with a better way to get a repeatable result :( We can't use mktime() as it's buggy on many platforms and not thread safe. + + Note: this code assumes that our time_t estimation is not too far away + from real value (we assume that localtime_r(tmp) will return something + within 24 hrs from t) which is probably true for all current time zones. */ tmp=(time_t) (((calc_daynr((uint) t->year,(uint) t->month,(uint) t->day) - (long) days_at_timestart)*86400L + (long) t->hour*3600L + @@ -93,7 +97,8 @@ long my_gmt_sec(TIME *t, long *my_timezone) for (loop=0; loop < 2 && (t->hour != (uint) l_time->tm_hour || - t->minute != (uint) l_time->tm_min); + t->minute != (uint) l_time->tm_min || + t->second != (uint) l_time->tm_sec); loop++) { /* One check should be enough ? */ /* Get difference in days */ @@ -103,15 +108,22 @@ long my_gmt_sec(TIME *t, long *my_timezone) else if (days > 1) days= -1; diff=(3600L*(long) (days*24+((int) t->hour - (int) l_time->tm_hour)) + - (long) (60*((int) t->minute - (int) l_time->tm_min))); + (long) (60*((int) t->minute - (int) l_time->tm_min)) + + (long) ((int) t->second - (int) l_time->tm_sec)); current_timezone+= diff+3600; // Compensate for -3600 above tmp+= (time_t) diff; localtime_r(&tmp,&tm_tmp); l_time=&tm_tmp; } /* - Fix that if we are in the not existing daylight saving time hour - we move the start of the next real hour + Fix that if we are in the non existing daylight saving time hour + we move the start of the next real hour. + + This code doesn't handle such exotical thing as time-gaps whose length + is more than one hour or non-integer (latter can theoretically happen + if one of seconds will be removed due leap correction, or because of + general time correction like it happened for Africa/Monrovia time zone + in year 1972). */ if (loop == 2 && t->hour != (uint) l_time->tm_hour) { @@ -121,7 +133,8 @@ long my_gmt_sec(TIME *t, long *my_timezone) else if (days > 1) days= -1; diff=(3600L*(long) (days*24+((int) t->hour - (int) l_time->tm_hour))+ - (long) (60*((int) t->minute - (int) l_time->tm_min))); + (long) (60*((int) t->minute - (int) l_time->tm_min)) + + (long) ((int) t->second - (int) l_time->tm_sec)); if (diff == 3600) tmp+=3600 - t->minute*60 - t->second; // Move to next hour else if (diff == -3600) From 35ded492637a44584dafda0a7b76dd209b6e8c69 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 3 Nov 2004 20:21:56 +0100 Subject: [PATCH 0092/1063] NDB blobs - try to handle insert-update-delete under autocommit=0 ndb/src/ndbapi/ndberror.c: 826 error text mysql-test/r/ndb_blob.result: result displayed error mysql-test/t/ndb_blob.test: result displayed error ndb/src/ndbapi/NdbBlob.cpp: update head+inline earlier ndb/src/ndbapi/NdbOperationExec.cpp: blob IgnoreError bug ndb/test/ndbapi/testBlobs.cpp: tried to set non-nullable to null, causing a complex abort case ndb/src/ndbapi/NdbConnection.cpp: prepared ops CAN be left in complex abort --- mysql-test/r/ndb_blob.result | 9 ++++++++- mysql-test/t/ndb_blob.test | 8 +++++++- ndb/src/ndbapi/NdbBlob.cpp | 12 ++++++++++++ ndb/src/ndbapi/NdbConnection.cpp | 5 +++++ ndb/src/ndbapi/NdbOperationExec.cpp | 2 +- ndb/src/ndbapi/ndberror.c | 2 +- ndb/test/ndbapi/testBlobs.cpp | 16 ++++++++++++++++ 7 files changed, 50 insertions(+), 4 deletions(-) diff --git a/mysql-test/r/ndb_blob.result b/mysql-test/r/ndb_blob.result index 1f2cf33f57d..156c2d570a4 100644 --- a/mysql-test/r/ndb_blob.result +++ b/mysql-test/r/ndb_blob.result @@ -414,6 +414,7 @@ a b c d 9 b9 999 dd9 drop table t1; drop database test2; +set autocommit=0; create table t1 ( a int not null primary key, b tinytext @@ -422,9 +423,13 @@ insert into t1 values(1, 'x'); update t1 set b = 'y'; select * from t1; a b -1 x +1 y delete from t1; +select * from t1; +a b +commit; drop table t1; +set autocommit=0; create table t1 ( a int not null primary key, b text not null @@ -433,6 +438,7 @@ insert into t1 values(1, ''); select * from t1; a b 1 +commit; drop table t1; set autocommit=1; use test; @@ -454,6 +460,7 @@ select * from t1 order by a; a b 1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 2 BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB +set autocommit=1; alter table t1 engine=myisam; select * from t1 order by a; a b diff --git a/mysql-test/t/ndb_blob.test b/mysql-test/t/ndb_blob.test index ba5f089b17b..06ecbc66d97 100644 --- a/mysql-test/t/ndb_blob.test +++ b/mysql-test/t/ndb_blob.test @@ -337,8 +337,9 @@ select * from t1 order by a; drop table t1; drop database test2; -# -- bug-5252 tinytext crashes -- +# -- bug-5252 tinytext crashes plus no-commit result -- +set autocommit=0; create table t1 ( a int not null primary key, b tinytext @@ -348,10 +349,13 @@ insert into t1 values(1, 'x'); update t1 set b = 'y'; select * from t1; delete from t1; +select * from t1; +commit; drop table t1; # -- bug-5013 insert empty string to text -- +set autocommit=0; create table t1 ( a int not null primary key, b text not null @@ -359,6 +363,7 @@ create table t1 ( insert into t1 values(1, ''); select * from t1; +commit; drop table t1; # -- bug #5349 -- @@ -380,6 +385,7 @@ alter table t1 engine=ndb; select * from t1 order by a; # -- bug #5872 -- +set autocommit=1; alter table t1 engine=myisam; select * from t1 order by a; drop table t1; diff --git a/ndb/src/ndbapi/NdbBlob.cpp b/ndb/src/ndbapi/NdbBlob.cpp index 9d21304939a..53c0a0e07f9 100644 --- a/ndb/src/ndbapi/NdbBlob.cpp +++ b/ndb/src/ndbapi/NdbBlob.cpp @@ -1428,6 +1428,18 @@ NdbBlob::postExecute(ExecType anExecType) if (invokeActiveHook() == -1) return -1; } + if (anExecType == NoCommit && theHeadInlineUpdateFlag) { + NdbOperation* tOp = theNdbCon->getNdbOperation(theTable); + if (tOp == NULL || + tOp->updateTuple() == -1 || + setTableKeyValue(tOp) == -1 || + setHeadInlineValue(tOp) == -1) { + setErrorCode(ErrAbort); + return -1; + } + tOp->m_abortOption = AbortOnError; + DBG("added op to update head+inline"); + } DBG("postExecute [out]"); return 0; } diff --git a/ndb/src/ndbapi/NdbConnection.cpp b/ndb/src/ndbapi/NdbConnection.cpp index c21a85fd24d..4f6468eb4ae 100644 --- a/ndb/src/ndbapi/NdbConnection.cpp +++ b/ndb/src/ndbapi/NdbConnection.cpp @@ -340,7 +340,12 @@ NdbConnection::execute(ExecType aTypeOfExec, if (executeNoBlobs(tExecType, abortOption, forceSend) == -1) ret = -1; +#ifndef VM_TRACE + // can happen in complex abort cases + theFirstOpInList = theLastOpInList = NULL; +#else assert(theFirstOpInList == NULL && theLastOpInList == NULL); +#endif { NdbOperation* tOp = theCompletedFirstOp; diff --git a/ndb/src/ndbapi/NdbOperationExec.cpp b/ndb/src/ndbapi/NdbOperationExec.cpp index 6d7a3817e04..13664794dcd 100644 --- a/ndb/src/ndbapi/NdbOperationExec.cpp +++ b/ndb/src/ndbapi/NdbOperationExec.cpp @@ -552,7 +552,7 @@ NdbOperation::receiveTCKEYREF( NdbApiSignal* aSignal) theNdbCon->theReturnStatus = NdbConnection::ReturnFailure; theError.code = aSignal->readData(4); - theNdbCon->setOperationErrorCodeAbort(aSignal->readData(4), ao); + theNdbCon->setOperationErrorCodeAbort(aSignal->readData(4), m_abortOption); if(theOperationType != ReadRequest || !theSimpleIndicator) // not simple read return theNdbCon->OpCompleteFailure(ao, m_abortOption != IgnoreError); diff --git a/ndb/src/ndbapi/ndberror.c b/ndb/src/ndbapi/ndberror.c index 20661b89517..17a80082023 100644 --- a/ndb/src/ndbapi/ndberror.c +++ b/ndb/src/ndbapi/ndberror.c @@ -150,7 +150,7 @@ ErrorBundle ErrorCodes[] = { { 623, IS, "623" }, { 624, IS, "624" }, { 625, IS, "Out of memory in Ndb Kernel, index part" }, - { 826, IS, "826" }, + { 826, IS, "Too many tables and attributes (increase MaxNoOfAttributes)" }, { 827, IS, "Out of memory in Ndb Kernel, data part" }, { 832, IS, "832" }, diff --git a/ndb/test/ndbapi/testBlobs.cpp b/ndb/test/ndbapi/testBlobs.cpp index 08bf8a2fd4b..efa0811aa39 100644 --- a/ndb/test/ndbapi/testBlobs.cpp +++ b/ndb/test/ndbapi/testBlobs.cpp @@ -42,6 +42,7 @@ struct Opt { bool m_core; bool m_dbg; bool m_dbgall; + const char* m_dbug; bool m_full; unsigned m_loop; unsigned m_parts; @@ -66,6 +67,7 @@ struct Opt { m_core(false), m_dbg(false), m_dbgall(false), + m_dbug(0), m_full(false), m_loop(1), m_parts(10), @@ -100,6 +102,7 @@ printusage() << " -core dump core on error" << endl << " -dbg print debug" << endl << " -dbgall print also NDB API debug (if compiled in)" << endl + << " -dbug opt dbug options" << endl << " -full read/write only full blob values" << endl << " -loop N loop N times 0=forever [" << d.m_loop << "]" << endl << " -parts N max parts in blob value [" << d.m_parts << "]" << endl @@ -1046,8 +1049,12 @@ writeIdx(int style) if (style == 0) { CHK(setBlobValue(tup) == 0); } else if (style == 1) { + // non-nullable must be set + CHK(g_bh1->setValue("", 0) == 0); CHK(setBlobWriteHook(tup) == 0); } else { + // non-nullable must be set + CHK(g_bh1->setValue("", 0) == 0); CHK(g_con->execute(NoCommit) == 0); CHK(writeBlobData(tup) == 0); } @@ -1463,6 +1470,12 @@ NDB_COMMAND(testOdbcDriver, "testBlobs", "testBlobs", "testBlobs", 65535) putenv(strdup("NDB_BLOB_DEBUG=1")); continue; } + if (strcmp(arg, "-dbug") == 0) { + if (++argv, --argc > 0) { + g_opt.m_dbug = strdup(argv[0]); + continue; + } + } if (strcmp(arg, "-full") == 0) { g_opt.m_full = true; continue; @@ -1533,6 +1546,9 @@ NDB_COMMAND(testOdbcDriver, "testBlobs", "testBlobs", "testBlobs", 65535) printusage(); return NDBT_ProgramExit(NDBT_WRONGARGS); } + if (g_opt.m_dbug != 0) { + DBUG_PUSH(g_opt.m_dbug); + } if (g_opt.m_pk2len == 0) { char b[100]; b[0] = 0; From d07f96cf4987ec7b41a5d9ee3f2180e32770342a Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 3 Nov 2004 21:32:48 +0200 Subject: [PATCH 0093/1063] InnoDB: commit after every 10000 rows in ALTER TABLE innobase/include/lock0lock.h: Added function lock_get_ix_table() innobase/include/row0mysql.h: Added parameter "table" to row_lock_table_for_mysql() innobase/lock/lock0lock.c: Added function lock_get_ix_table() innobase/row/row0mysql.c: Added parameter "table" to row_lock_table_for_mysql() sql/ha_innodb.cc: write_row(): commit every 10000 rows in ALTER TABLE sql/ha_innodb.h: Added member variable num_write_row --- innobase/include/lock0lock.h | 8 ++++++++ innobase/include/row0mysql.h | 6 +++++- innobase/lock/lock0lock.c | 13 +++++++++++++ innobase/row/row0mysql.c | 14 +++++++++++--- sql/ha_innodb.cc | 26 +++++++++++++++++++++++++- sql/ha_innodb.h | 4 +++- 6 files changed, 65 insertions(+), 6 deletions(-) diff --git a/innobase/include/lock0lock.h b/innobase/include/lock0lock.h index 9f525042dcc..f8435e14d97 100644 --- a/innobase/include/lock0lock.h +++ b/innobase/include/lock0lock.h @@ -463,6 +463,14 @@ lock_rec_hash( ulint space, /* in: space */ ulint page_no);/* in: page number */ /************************************************************************* +Gets the table covered by an IX table lock. */ + +dict_table_t* +lock_get_ix_table( +/*==============*/ + /* out: the table covered by the lock */ + lock_t* lock); /* in: table lock */ +/************************************************************************* Checks that a transaction id is sensible, i.e., not in the future. */ ibool diff --git a/innobase/include/row0mysql.h b/innobase/include/row0mysql.h index 9437ed4b6ee..73f41dea0da 100644 --- a/innobase/include/row0mysql.h +++ b/innobase/include/row0mysql.h @@ -175,8 +175,12 @@ int row_lock_table_for_mysql( /*=====================*/ /* out: error code or DB_SUCCESS */ - row_prebuilt_t* prebuilt); /* in: prebuilt struct in the MySQL + row_prebuilt_t* prebuilt, /* in: prebuilt struct in the MySQL table handle */ + dict_table_t* table); /* in: table to LOCK_IX, or NULL + if prebuilt->table should be + locked as LOCK_TABLE_EXP | + prebuilt->select_lock_type */ /************************************************************************* Does an insert for MySQL. */ diff --git a/innobase/lock/lock0lock.c b/innobase/lock/lock0lock.c index 68073647248..6f2d58b72c3 100644 --- a/innobase/lock/lock0lock.c +++ b/innobase/lock/lock0lock.c @@ -395,6 +395,19 @@ lock_rec_get_nth_bit( return(ut_bit_get_nth(b, bit_index)); } +/************************************************************************* +Gets the table covered by an IX table lock. */ + +dict_table_t* +lock_get_ix_table( +/*==============*/ + /* out: the table covered by the lock */ + lock_t* lock) /* in: table lock */ +{ + ut_a(lock->type_mode == (LOCK_TABLE | LOCK_IX)); + return(lock->un_member.tab_lock.table); +} + /*************************************************************************/ #define lock_mutex_enter_kernel() mutex_enter(&kernel_mutex) diff --git a/innobase/row/row0mysql.c b/innobase/row/row0mysql.c index 241ddc310e8..3e780138261 100644 --- a/innobase/row/row0mysql.c +++ b/innobase/row/row0mysql.c @@ -779,8 +779,12 @@ int row_lock_table_for_mysql( /*=====================*/ /* out: error code or DB_SUCCESS */ - row_prebuilt_t* prebuilt) /* in: prebuilt struct in the MySQL + row_prebuilt_t* prebuilt, /* in: prebuilt struct in the MySQL table handle */ + dict_table_t* table) /* in: table to LOCK_IX, or NULL + if prebuilt->table should be + locked as LOCK_TABLE_EXP | + prebuilt->select_lock_type */ { trx_t* trx = prebuilt->trx; que_thr_t* thr; @@ -813,8 +817,12 @@ run_again: trx_start_if_not_started(trx); - err = lock_table(LOCK_TABLE_EXP, prebuilt->table, - prebuilt->select_lock_type, thr); + if (table) { + err = lock_table(0, table, LOCK_IX, thr); + } else { + err = lock_table(LOCK_TABLE_EXP, prebuilt->table, + prebuilt->select_lock_type, thr); + } trx->error_state = err; diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index 0bcb7062437..25a0f154c25 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -2314,7 +2314,31 @@ ha_innobase::write_row( if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_INSERT) table->timestamp_field->set_time(); + num_write_row++; + + if (user_thd->lex->sql_command == SQLCOM_ALTER_TABLE + && num_write_row > 10000) { + /* ALTER TABLE is COMMITted at every 10000 copied rows. + The IX table lock for the original table has to be re-issued. + As this method will be called on a temporary table where the + contents of the original table is being copied to, it is + a bit tricky to determine the source table. The cursor + position in the source table need not be adjusted after the + intermediate COMMIT, since writes by other transactions are + being blocked by a MySQL table lock TL_WRITE_ALLOW_READ. */ + ut_a(prebuilt->trx->mysql_n_tables_locked == 2); + ut_a(UT_LIST_GET_LEN(prebuilt->trx->trx_locks) >= 2); + dict_table_t* table = lock_get_ix_table( + UT_LIST_GET_FIRST(prebuilt->trx->trx_locks)); + num_write_row = 0; + innobase_commit(user_thd, prebuilt->trx); + user_thd->transaction.all.innodb_active_trans = 1; + row_lock_table_for_mysql(prebuilt, table); + goto new_trx; + } + if (last_query_id != user_thd->query_id) { + new_trx: prebuilt->sql_stat_start = TRUE; last_query_id = user_thd->query_id; @@ -4986,7 +5010,7 @@ ha_innobase::external_lock( if (thd->in_lock_tables && thd->variables.innodb_table_locks) { ulint error; - error = row_lock_table_for_mysql(prebuilt); + error = row_lock_table_for_mysql(prebuilt, 0); if (error != DB_SUCCESS) { error = convert_error_code_to_mysql( diff --git a/sql/ha_innodb.h b/sql/ha_innodb.h index c10beacac1b..e76a966c6b9 100644 --- a/sql/ha_innodb.h +++ b/sql/ha_innodb.h @@ -64,6 +64,7 @@ class ha_innobase: public handler uint last_match_mode;/* match mode of the latest search: ROW_SEL_EXACT, ROW_SEL_EXACT_PREFIX, or undefined */ + uint num_write_row; /* number of write_row() calls */ longlong auto_inc_counter_for_this_stat; ulong max_supported_row_length(const byte *buf); @@ -85,7 +86,8 @@ class ha_innobase: public handler HA_PRIMARY_KEY_IN_READ_INDEX | HA_TABLE_SCAN_ON_INDEX), last_dup_key((uint) -1), - start_of_scan(0) + start_of_scan(0), + num_write_row(0) { } ~ha_innobase() {} From 66191b2244b081faee6a00a5c5e7a1bbbf8efaf8 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 4 Nov 2004 00:10:00 +0200 Subject: [PATCH 0094/1063] ibuf0ibuf.c: Do not print to .err log about discarding ibuf entries in DISCARD TABLESPACE; removed compiler warning about unused variable innobase/ibuf/ibuf0ibuf.c: Do not print to .err log about discarding ibuf entries in DISCARD TABLESPACE; removed compiler warning about unused variable --- innobase/ibuf/ibuf0ibuf.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/innobase/ibuf/ibuf0ibuf.c b/innobase/ibuf/ibuf0ibuf.c index b3c8ade2414..2191cdc0ee6 100644 --- a/innobase/ibuf/ibuf0ibuf.c +++ b/innobase/ibuf/ibuf0ibuf.c @@ -2866,6 +2866,8 @@ ibuf_delete_rec( #ifdef UNIV_IBUF_DEBUG ibuf_count_set(space, page_no, ibuf_count_get(space, page_no) - 1); +#else + UT_NOT_USED(space); #endif ibuf_data_sizes_update(ibuf_data, root, mtr); @@ -3267,11 +3269,11 @@ leave_loop: ibuf_data->n_merged_recs += n_inserts; mutex_exit(&ibuf_mutex); - + /* fprintf(stderr, "InnoDB: Discarded %lu ibuf entries for space %lu\n", (ulong) n_inserts, (ulong) space); - + */ ibuf_exit(); mem_heap_free(heap); From d4a3d5017074eb555022fdc4983caa0947163d88 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 4 Nov 2004 08:50:07 +0400 Subject: [PATCH 0095/1063] field.cc, sql_mode.result, sql_mode.test: "SHOW CREATE TABLE" mysql-4.0 and mysql-3.23 compatibiliry mode change: Check that a binary collation adds 'binary' suffix into a char() column definition in mysql40 and mysql2323 modes. This allows not to lose the column's case sensitivity when loading the dump in pre-4.1 servers. mysql-test/t/sql_mode.test: "SHOW CREATE TABLE" mysql-4.0 and mysql-3.23 compatibiliry mode change: mysql-test/r/sql_mode.result: "SHOW CREATE TABLE" mysql-4.0 and mysql-3.23 compatibiliry mode change: Check that a binary collation adds 'binary' suffix into a char() column definition in mysql40 and mysql2323 modes. This allows not to lose the column's case sensitivity when loading the dump in pre-4.1 servers. sql/field.cc: "SHOW CREATE TABLE" mysql-4.0 and mysql-3.23 compatibiliry mode change: Check that a binary collation adds 'binary' suffix into a char() column definition in mysql40 and mysql2323 modes. This allows not to lose the column's case sensitivity when loading the dump in pre-4.1 servers. --- mysql-test/r/sql_mode.result | 30 ++++++++++++++++++++++++++++++ mysql-test/t/sql_mode.test | 31 +++++++++++++++++++++++++++++++ sql/field.cc | 4 ++++ 3 files changed, 65 insertions(+) diff --git a/mysql-test/r/sql_mode.result b/mysql-test/r/sql_mode.result index e54dd217f8c..c18be2df403 100644 --- a/mysql-test/r/sql_mode.result +++ b/mysql-test/r/sql_mode.result @@ -85,6 +85,36 @@ t1 CREATE TABLE "t1" ( UNIQUE KEY "email" ("email") ) drop table t1; +CREATE TABLE t1 ( +a char(10), +b char(10) collate latin1_bin, +c binary(10) +) character set latin1; +set @@sql_mode=""; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` char(10) default NULL, + `b` char(10) character set latin1 collate latin1_bin default NULL, + `c` binary(10) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +set @@sql_mode="mysql323"; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` char(10) default NULL, + `b` char(10) binary default NULL, + `c` binary(10) default NULL +) TYPE=MyISAM +set @@sql_mode="mysql40"; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` char(10) default NULL, + `b` char(10) binary default NULL, + `c` binary(10) default NULL +) TYPE=MyISAM +drop table t1; set session sql_mode = ''; create table t1 ( min_num dec(6,6) default .000001); show create table t1; diff --git a/mysql-test/t/sql_mode.test b/mysql-test/t/sql_mode.test index 63a5d6d3671..f841d36e837 100644 --- a/mysql-test/t/sql_mode.test +++ b/mysql-test/t/sql_mode.test @@ -29,6 +29,37 @@ select @@sql_mode; show create table t1; drop table t1; +# +# Check that a binary collation adds 'binary' +# suffix into a char() column definition in +# mysql40 and mysql2323 modes. This allows +# not to lose the column's case sensitivity +# when loading the dump in pre-4.1 servers. +# +# Thus, in 4.0 and 3.23 modes we dump: +# +# 'char(10) collate xxx_bin' as 'char(10) binary' +# 'binary(10)' as 'binary(10)' +# +# In mysql-4.1 these types are different, and they will +# be recreated differently. +# +# In mysqld-4.0 the the above two types were the same, +# so it will create a 'char(10) binary' column for both definitions. +# +CREATE TABLE t1 ( + a char(10), + b char(10) collate latin1_bin, + c binary(10) +) character set latin1; +set @@sql_mode=""; +show create table t1; +set @@sql_mode="mysql323"; +show create table t1; +set @@sql_mode="mysql40"; +show create table t1; +drop table t1; + # # BUG#5318 - failure: 'IGNORE_SPACE' affects numeric values after DEFAULT # diff --git a/sql/field.cc b/sql/field.cc index 4b833874221..24bd0c48c92 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -4417,6 +4417,7 @@ void Field_string::sort_string(char *to,uint length) void Field_string::sql_type(String &res) const { + THD *thd= table->in_use; CHARSET_INFO *cs=res.charset(); ulong length= cs->cset->snprintf(cs,(char*) res.ptr(), res.alloced_length(), "%s(%d)", @@ -4427,6 +4428,9 @@ void Field_string::sql_type(String &res) const (has_charset() ? "char" : "binary")), (int) field_length / charset()->mbmaxlen); res.length(length); + if ((thd->variables.sql_mode & (MODE_MYSQL323 | MODE_MYSQL40)) && + has_charset() && (charset()->state & MY_CS_BINSORT)) + res.append(" binary"); } char *Field_string::pack(char *to, const char *from, uint max_length) From 0dd1ab1abbf81fef1ab9ebf43a06a1b0d0129487 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 4 Nov 2004 11:18:12 +0100 Subject: [PATCH 0096/1063] The files stored in "Docs/Images" within the "mysqldocs" BK tree must be included in the source tar-ball for distribution. This is done by using the "DISTFILES" macro in a new "Docs/Images/Makefile". As the source BK tree does not contain these files, they are copied from the "mysqldocs" tree at release build time. This changeset relies on "bk commit - mysqldoc tree (joerg:1.2276)" of today. Build-tools/Bootstrap: Copy the relevant files with "Docs/Images" from the "mysqldocs" BK tree into the build tree, ensuring that the "Makefile*" from the source BK tree are removed before. Docs/Images/Makefile.am: This dummy file is only needed to satisfy the Makefile hierarchy, at release build time it will be replaced by its counterpart from the "mysqldocs" BK tree. Docs/Makefile.am: Include the new "Docs/Images/Makefile" in the Makefile hierarchy. configure.in: Ensure that the autotools will handle the new "Docs/Images/Makefile.am". --- Build-tools/Bootstrap | 4 ++++ Docs/Images/Makefile.am | 35 +++++++++++++++++++++++++++++++++++ Docs/Makefile.am | 2 ++ configure.in | 2 +- 4 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 Docs/Images/Makefile.am diff --git a/Build-tools/Bootstrap b/Build-tools/Bootstrap index 8cad093bc5f..e21179fe78c 100755 --- a/Build-tools/Bootstrap +++ b/Build-tools/Bootstrap @@ -288,6 +288,10 @@ unless ($opt_skip_manual) system ("bk cat $opt_docdir/Docs/$file.texi > $target_dir/Docs/$file.texi") == 0 or &abort("Could not update $file.texi in $target_dir/Docs/!"); } + system ("rm $target_dir/Docs/Images/Makefile*") == 0 + or &abort("Could not remove Makefiles in $target_dir/Docs/Images/!"); + system ("cp $opt_docdir/Docs/Images/*.* $target_dir/Docs/Images") == 0 + or &abort("Could not copy image files in $target_dir/Docs/Images/!"); } # diff --git a/Docs/Images/Makefile.am b/Docs/Images/Makefile.am new file mode 100644 index 00000000000..b57d701d8a0 --- /dev/null +++ b/Docs/Images/Makefile.am @@ -0,0 +1,35 @@ +# Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Library General Public +# License as published by the Free Software Foundation; either +# version 2 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Library General Public License for more details. +# +# You should have received a copy of the GNU Library General Public +# License along with this library; if not, write to the Free +# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, +# MA 02111-1307, USA + +## Process this file with automake to create Makefile.in + +# This is a dummy file to satisfy the hierarchy of Makefiles. +# When a release is built, the true Makefile will be copied +# together with the "real" files in this directory. + +EXTRA_DIST = + +# Nothing to create in this dummy directory. +all: + : + +# Nothing to cleanup in this dummy directory. +clean: + : + +# Don't update the files from bitkeeper +%::SCCS/s.% diff --git a/Docs/Makefile.am b/Docs/Makefile.am index a4e8e14a38d..e53ea195d94 100644 --- a/Docs/Makefile.am +++ b/Docs/Makefile.am @@ -24,6 +24,8 @@ BUILT_SOURCES = $(targets) manual_toc.html include.texi EXTRA_DIST = $(noinst_SCRIPTS) $(BUILT_SOURCES) mysqld_error.txt \ INSTALL-BINARY reservedwords.texi +SUBDIRS = Images + all: $(targets) txt_files txt_files: ../INSTALL-SOURCE ../COPYING ../EXCEPTIONS-CLIENT \ diff --git a/configure.in b/configure.in index d4ede468435..0c520ca8980 100644 --- a/configure.in +++ b/configure.in @@ -2711,7 +2711,7 @@ AC_OUTPUT(Makefile extra/Makefile mysys/Makefile isam/Makefile dnl pstack/Makefile pstack/aout/Makefile sql/Makefile sql/share/Makefile dnl merge/Makefile dbug/Makefile scripts/Makefile dnl include/Makefile sql-bench/Makefile tools/Makefile dnl - tests/Makefile Docs/Makefile support-files/Makefile dnl + tests/Makefile Docs/Makefile Docs/Images/Makefile support-files/Makefile dnl support-files/MacOSX/Makefile mysql-test/Makefile dnl netware/Makefile dnl include/mysql_version.h dnl From 6aeb3468203e8a95804dd7f4826c5af01c83eba9 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 4 Nov 2004 12:14:19 +0100 Subject: [PATCH 0097/1063] DbaccMain.cpp: ugly fix for 'quadita2' ia64 icc -O1 ndb/src/kernel/blocks/dbacc/DbaccMain.cpp: ugly fix for 'quadita2' ia64 icc -O1 --- ndb/src/kernel/blocks/dbacc/DbaccMain.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp b/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp index 9a1bbd86562..c275e5382f7 100644 --- a/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp +++ b/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp @@ -4501,6 +4501,17 @@ void Dbacc::getdirindex(Signal* signal) /* BUCKET, AND SERCH FOR ELEMENT.THE PRIMARY KEYS WHICH IS SAVED */ /* IN THE OPERATION REC ARE THE CHECK ITEMS IN THE SEARCHING. */ /* --------------------------------------------------------------------------------- */ + +#if __ia64 == 1 +#if __INTEL_COMPILER == 810 +int ndb_acc_ia64_icc810_dummy_var = 0; +void ndb_acc_ia64_icc810_dummy_func() +{ + ndb_acc_ia64_icc810_dummy_var++; +} +#endif +#endif + void Dbacc::getElement(Signal* signal) { DirRangePtr geOverflowrangeptr; @@ -4595,6 +4606,12 @@ void Dbacc::getElement(Signal* signal) /* WE HAVE FOUND THE ELEMENT. GET THE LOCK INDICATOR AND RETURN FOUND. */ /* --------------------------------------------------------------------------------- */ jam(); +#if __ia64 == 1 +#if __INTEL_COMPILER == 810 + // prevents SIGSEGV under icc -O1 + ndb_acc_ia64_icc810_dummy_func(); +#endif +#endif tgeLocked = ElementHeader::getLocked(gePageptr.p->word32[tgeElementptr]); tgeResult = ZTRUE; TdataIndex = tgeElementptr + tgeForward; From c9a75ccf1acfc4578496a1606fcf009301366997 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 4 Nov 2004 13:06:22 +0000 Subject: [PATCH 0098/1063] just do kill instead ok kill -9 --- mysql-test/ndb/ndbcluster.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mysql-test/ndb/ndbcluster.sh b/mysql-test/ndb/ndbcluster.sh index 9d83a291f3d..d7b115d71b6 100644 --- a/mysql-test/ndb/ndbcluster.sh +++ b/mysql-test/ndb/ndbcluster.sh @@ -212,8 +212,8 @@ if [ -f "$fs_ndb/$pidfile" ] ; then attempt=`expr $attempt + 1` done if [ "$kill_pids" != "" ] ; then - echo "Failed to shutdown ndbcluster, executing kill -9 "$kill_pids - kill -9 $kill_pids + echo "Failed to shutdown ndbcluster, executing kill "$kill_pids + kill $kill_pids fi rm "$fs_ndb/$pidfile" fi From 9afd24f00090848243d31ae342706e27c8e00f4e Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 4 Nov 2004 14:06:24 +0100 Subject: [PATCH 0099/1063] NDB bug #6426 fix ndb/src/kernel/blocks/dblqh/DblqhMain.cpp: bug #6426 fix --- ndb/src/kernel/blocks/dblqh/DblqhMain.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp b/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp index cd15ad0c3b2..af1131e5e55 100644 --- a/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp +++ b/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp @@ -8725,7 +8725,7 @@ void Dblqh::sendKeyinfo20(Signal* signal, sendSignal(ref, GSN_KEYINFO20, signal, 25, JBB); src += KeyInfo20::DataLength;; keyLen -= KeyInfo20::DataLength; - } while(keyLen >= KeyInfo20::DataLength); + } MEMCOPY_NO_WORDS(keyInfo->keyData, src, keyLen); sendSignal(ref, GSN_KEYINFO20, signal, From f2be61f5b708a72ea22d773e46d1d42f8b2884a9 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 4 Nov 2004 15:57:54 +0200 Subject: [PATCH 0100/1063] ha_innodb.cc: write_row(): document the ALTER TABLE tweak better, and commit every n*10000 rows, not n*10000-1 rows. sql/ha_innodb.cc: write_row(): document the ALTER TABLE tweak better, and commit every n*10000 rows, not n*10000-1 rows. --- sql/ha_innodb.cc | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index 25a0f154c25..6e08fc680b2 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -2314,10 +2314,8 @@ ha_innobase::write_row( if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_INSERT) table->timestamp_field->set_time(); - num_write_row++; - if (user_thd->lex->sql_command == SQLCOM_ALTER_TABLE - && num_write_row > 10000) { + && num_write_row >= 10000) { /* ALTER TABLE is COMMITted at every 10000 copied rows. The IX table lock for the original table has to be re-issued. As this method will be called on a temporary table where the @@ -2331,14 +2329,20 @@ ha_innobase::write_row( dict_table_t* table = lock_get_ix_table( UT_LIST_GET_FIRST(prebuilt->trx->trx_locks)); num_write_row = 0; + /* Commit the transaction. This will release the table + locks, so they have to be acquired again. */ innobase_commit(user_thd, prebuilt->trx); + /* Note that this transaction is still active. */ user_thd->transaction.all.innodb_active_trans = 1; + /* Re-acquire the IX table lock on the source table. */ row_lock_table_for_mysql(prebuilt, table); - goto new_trx; + /* We will need an IX lock on the destination table. */ + prebuilt->sql_stat_start = TRUE; } + num_write_row++; + if (last_query_id != user_thd->query_id) { - new_trx: prebuilt->sql_stat_start = TRUE; last_query_id = user_thd->query_id; From 15ce871b1fdc2817c6a4966f85261a88631c4d51 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 4 Nov 2004 19:45:31 +0500 Subject: [PATCH 0101/1063] BUG#6056 fixed MySQL can't clean shutdown with --shared-memory sql/mysqld.cc: changed event_connect_request to global variable added signal sending --- sql/mysqld.cc | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index af6f25c1400..89b0a035e6c 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -468,6 +468,7 @@ Query_cache query_cache; #ifdef HAVE_SMEM char *shared_memory_base_name= default_shared_memory_base_name; bool opt_enable_shared_memory; +HANDLE event_connect_request= 0; #endif #include "sslopt-vars.h" @@ -743,6 +744,15 @@ void kill_mysql(void) CloseHandle(hEvent); */ } +#ifdef HAVE_SMEM + /* + Send event to event_connect_request for aborting + */ + if (!SetEvent(event_connect_request)) + { + DBUG_PRINT("error",("Got error: %ld from SetEvent of event_connect_request",GetLastError())); + } +#endif #endif #elif defined(OS2) pthread_cond_signal( &eventShutdown); // post semaphore @@ -3707,7 +3717,6 @@ pthread_handler_decl(handle_connections_shared_memory,arg) /* file-mapping object, use for create shared memory */ HANDLE handle_connect_file_map= 0; char *handle_connect_map= 0; // pointer on shared memory - HANDLE event_connect_request= 0; // for start connection actions HANDLE event_connect_answer= 0; ulong smem_buffer_length= shared_memory_buffer_length + 4; ulong connect_number= 1; @@ -3761,6 +3770,12 @@ pthread_handler_decl(handle_connections_shared_memory,arg) /* Wait a request from client */ WaitForSingleObject(event_connect_request,INFINITE); + /* + it can be after shutdown command + */ + if (abort_loop) + goto error; + HANDLE handle_client_file_map= 0; char *handle_client_map= 0; HANDLE event_client_wrote= 0; From 1186229ffc8a440d35b333dcf69501363bf45620 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 4 Nov 2004 15:59:19 +0100 Subject: [PATCH 0102/1063] BUG#6239 V2: Since uint can be shorter than ulong on 64 bit platforms, the comparision of "packet_len" (uint) and "len" (uint) with "packet_error" (ulong) was always false. --- client/mysqlbinlog.cc | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index 5f9a499bd31..8015871428e 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -204,7 +204,7 @@ int Load_log_processor::load_old_format_file(NET* net, const char*server_fname, for (;;) { - uint packet_len = my_net_read(net); + ulong packet_len = my_net_read(net); if (packet_len == 0) { if (my_net_write(net, "", 0) || net_flush(net)) @@ -226,7 +226,13 @@ int Load_log_processor::load_old_format_file(NET* net, const char*server_fname, return -1; } - if (my_write(file, (byte*) net->read_pos, packet_len,MYF(MY_WME|MY_NABP))) + if (packet_len > UINT_MAX) + { + sql_print_error("Illegal length of packet read from net"); + return -1; + } + if (my_write(file, (byte*) net->read_pos, + (uint) packet_len, MYF(MY_WME|MY_NABP))) return -1; } @@ -747,7 +753,8 @@ static int dump_remote_log_entries(const char* logname) { char buf[128]; char last_db[FN_REFLEN+1] = ""; - uint len, logname_len; + ulong len; + uint logname_len; NET* net; int old_format; int error= 0; @@ -770,7 +777,15 @@ static int dump_remote_log_entries(const char* logname) */ int4store(buf, (uint32)start_position); int2store(buf + BIN_LOG_HEADER_SIZE, binlog_flags); - logname_len = (uint) strlen(logname); + + size_s tlen = strlen(logname); + if (tlen > UINT_MAX) + { + fprintf(stderr,"Log name too long\n"); + error= 1; + goto err; + } + logname_len = (uint) tlen; int4store(buf + 6, 0); memcpy(buf + 10, logname, logname_len); if (simple_command(mysql, COM_BINLOG_DUMP, buf, logname_len + 10, 1)) From 76211d8689c28fbc49625998b237dacbd9f13408 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 4 Nov 2004 15:57:29 +0000 Subject: [PATCH 0103/1063] updated start script for ndbcluster to make better cleanup changed to use new switch mysql-test/ndb/ndbcluster.sh: updated start script for ndbcluster to make better cleanup ndb/test/run-test/main.cpp: changed to use new switch --- mysql-test/ndb/ndbcluster.sh | 60 +++++++++++++++++++++++++++++++----- ndb/test/run-test/main.cpp | 2 +- 2 files changed, 54 insertions(+), 8 deletions(-) diff --git a/mysql-test/ndb/ndbcluster.sh b/mysql-test/ndb/ndbcluster.sh index d7b115d71b6..9894e70c788 100644 --- a/mysql-test/ndb/ndbcluster.sh +++ b/mysql-test/ndb/ndbcluster.sh @@ -102,12 +102,43 @@ if [ ! -x "$exec_mgmtsrvr" ]; then echo "$exec_mgmtsrvr missing" exit 1 fi +if [ ! -x "$exec_waiter" ]; then + echo "$exec_waiter missing" + exit 1 +fi + +exec_mgmtclient="$exec_mgmtclient --no-defaults" +exec_mgmtsrvr="$exec_mgmtsrvr --no-defaults" +exec_ndb="$exec_ndb --no-defaults" +exec_waiter="$exec_waiter --no-defaults" ndb_host="localhost" ndb_mgmd_port=$port_base NDB_CONNECTSTRING="host=$ndb_host:$ndb_mgmd_port" export NDB_CONNECTSTRING +sleep_until_file_created () { + file=$1 + loop=$2 + org_time=$2 + message=$3 + while (test $loop -gt 0) + do + if [ -r $file ] + then + return 0 + fi + sleep 1 + loop=`expr $loop - 1` + done + if [ $message ] + then + echo $message + fi + echo "ERROR: $file was not created in $org_time seconds; Aborting" + return 1; +} + start_default_ndbcluster() { # do some checks @@ -127,8 +158,8 @@ port_transporter=`expr $ndb_mgmd_port + 2` # Start management server as deamon # Edit file system path and ports in config file - if [ $initial_ndb ] ; then + rm -f $fs_ndb/ndb_* sed \ -e s,"CHOOSE_MaxNoOfOrderedIndexes","$ndb_no_ord",g \ -e s,"CHOOSE_MaxNoOfConcurrentOperations","$ndb_con_op",g \ @@ -150,21 +181,32 @@ if ( cd "$fs_ndb" ; $exec_mgmtsrvr -f config.ini ) ; then :; else echo "Unable to start $exec_mgmtsrvr from `pwd`" exit 1 fi - +if sleep_until_file_created $fs_ndb/ndb_3.pid 30 +then :; else + exit 1 +fi cat `find "$fs_ndb" -name 'ndb_*.pid'` > "$fs_ndb/$pidfile" # Start database node echo "Starting ndbd" ( cd "$fs_ndb" ; $exec_ndb $flags_ndb & ) - +if sleep_until_file_created $fs_ndb/ndb_1.pid 30 +then :; else + stop_default_ndbcluster + exit 1 +fi cat `find "$fs_ndb" -name 'ndb_*.pid'` > "$fs_ndb/$pidfile" # Start database node echo "Starting ndbd" ( cd "$fs_ndb" ; $exec_ndb $flags_ndb & ) - +if sleep_until_file_created $fs_ndb/ndb_2.pid 30 +then :; else + stop_default_ndbcluster + exit 1 +fi cat `find "$fs_ndb" -name 'ndb_*.pid'` > "$fs_ndb/$pidfile" # test if Ndb Cluster starts properly @@ -172,6 +214,7 @@ cat `find "$fs_ndb" -name 'ndb_*.pid'` > "$fs_ndb/$pidfile" echo "Waiting for started..." if ( $exec_waiter ) | grep "NDBT_ProgramExit: 0 - OK"; then :; else echo "Ndbcluster startup failed" + stop_default_ndbcluster exit 1 fi @@ -198,10 +241,12 @@ if [ -f "$fs_ndb/$pidfile" ] ; then attempt=0 while [ $attempt -lt 10 ] ; do new_kill_pid="" + kill_pids2="" for p in $kill_pids ; do kill -0 $p 2> /dev/null if [ $? -eq 0 ] ; then new_kill_pid="$p $new_kill_pid" + kill_pids2="-$p $kill_pids2" fi done kill_pids=$new_kill_pid @@ -211,9 +256,10 @@ if [ -f "$fs_ndb/$pidfile" ] ; then sleep 1 attempt=`expr $attempt + 1` done - if [ "$kill_pids" != "" ] ; then - echo "Failed to shutdown ndbcluster, executing kill "$kill_pids - kill $kill_pids + if [ "$kill_pids2" != "" ] ; then + do_command="kill -9 $kill_pids2" + echo "Failed to shutdown ndbcluster, executing "$do_command + $do_command fi rm "$fs_ndb/$pidfile" fi diff --git a/ndb/test/run-test/main.cpp b/ndb/test/run-test/main.cpp index 22799a9a1b2..e5f73bc6a5c 100644 --- a/ndb/test/run-test/main.cpp +++ b/ndb/test/run-test/main.cpp @@ -459,7 +459,7 @@ setup_config(atrt_config& config){ proc.m_type = atrt_process::NDB_MGM; proc.m_proc.m_name.assfmt("%d-%s", index, "ndb_mgmd"); proc.m_proc.m_path.assign(dir).append("/libexec/ndb_mgmd"); - proc.m_proc.m_args = "--nodaemon -c initconfig.txt"; + proc.m_proc.m_args = "--nodaemon -f config.ini"; proc.m_proc.m_cwd.appfmt("%d.ndb_mgmd", index); connect_string.appfmt("host=%s:%d;", proc.m_hostname.c_str(), proc.m_ndb_mgm_port); From a68b4095ac7267631f866c1382955239d9afa33e Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 4 Nov 2004 16:24:41 +0000 Subject: [PATCH 0104/1063] to make sure we get the kill right on the different platforms --- mysql-test/ndb/ndbcluster.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/mysql-test/ndb/ndbcluster.sh b/mysql-test/ndb/ndbcluster.sh index 9894e70c788..9c6b6093b93 100644 --- a/mysql-test/ndb/ndbcluster.sh +++ b/mysql-test/ndb/ndbcluster.sh @@ -257,9 +257,13 @@ if [ -f "$fs_ndb/$pidfile" ] ; then attempt=`expr $attempt + 1` done if [ "$kill_pids2" != "" ] ; then - do_command="kill -9 $kill_pids2" - echo "Failed to shutdown ndbcluster, executing "$do_command - $do_command + echo "Failed to shutdown ndbcluster, executing kill "$kill_pids2 + kill -9 -- $kill_pids2 2> /dev/null + /bin/kill -9 -- $kill_pids2 2> /dev/null + /usr/bin/kill -9 -- $kill_pids2 2> /dev/null + kill -9 $kill_pids2 2> /dev/null + /bin/kill -9 $kill_pids2 2> /dev/null + /usr/bin/kill -9 $kill_pids2 2> /dev/null fi rm "$fs_ndb/$pidfile" fi From 1fc515c8cdc570b437a7bf4055511117aa11492a Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 4 Nov 2004 21:25:50 +0500 Subject: [PATCH 0105/1063] autocommit From 60d8ff97a8784daf443652655c7b1442eae04c17 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 4 Nov 2004 21:25:51 +0500 Subject: [PATCH 0106/1063] autocommit and changed name mysql_test_run_new client/mysqltest.c: autocommit mysql-test/Makefile.am: changed mysql_test_run to mysql_test_run_new --- client/mysqltest.c | 5 +- mysql-test/Makefile.am | 4 +- mysql-test/init_db.sql | 26 + mysql-test/mysql_test_run_new.c | 1728 +++++++++++++++++++++++++++++++ 4 files changed, 1760 insertions(+), 3 deletions(-) create mode 100644 mysql-test/init_db.sql create mode 100644 mysql-test/mysql_test_run_new.c diff --git a/client/mysqltest.c b/client/mysqltest.c index a635b5bdd11..df80fc7bb66 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -949,8 +949,11 @@ static void do_exec(struct st_query* q) while (fgets(buf, sizeof(buf), res_file)) replace_dynstr_append_mem(ds, buf, strlen(buf)); } - +#ifndef __WIN__ error= pclose(res_file); +#else + error= _pclose(res_file); +#endif if (error != 0) die("command \"%s\" failed", cmd); diff --git a/mysql-test/Makefile.am b/mysql-test/Makefile.am index 906ff4b72bf..4e8601f1b88 100644 --- a/mysql-test/Makefile.am +++ b/mysql-test/Makefile.am @@ -37,8 +37,8 @@ test_DATA = std_data/client-key.pem std_data/client-cert.pem std_data/cacert.pem CLEANFILES = $(test_SCRIPTS) $(test_DATA) INCLUDES = -I$(srcdir)/../include -I../include -I.. -bin_PROGRAMS = mysql_test_run -mysql_test_run_SOURCES= mysql_test_run.c my_manage.c +bin_PROGRAMS = mysql_test_run_new +mysql_test_run_new_SOURCES= mysql_test_run_new.c my_manage.c dist-hook: diff --git a/mysql-test/init_db.sql b/mysql-test/init_db.sql new file mode 100644 index 00000000000..4613e5c0274 --- /dev/null +++ b/mysql-test/init_db.sql @@ -0,0 +1,26 @@ +CREATE DATABASE mysql; +CREATE DATABASE test; + +USE mysql; + +CREATE TABLE db (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL, References_priv enum('N','Y') DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db,User), KEY User (User)) comment='Database privileges'; + +INSERT INTO db VALUES ('%','test','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y'); +INSERT INTO db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y'); + +CREATE TABLE host (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL, References_priv enum('N','Y') DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db)) comment='Host privileges; Merged with database privileges'; + +CREATE TABLE user (Host char(60) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Password char(45) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL, Reload_priv enum('N','Y') DEFAULT 'N' NOT NULL, Shutdown_priv enum('N','Y') DEFAULT 'N' NOT NULL, Process_priv enum('N','Y') DEFAULT 'N' NOT NULL, File_priv enum('N','Y') DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL, References_priv enum('N','Y') DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL, Show_db_priv enum('N','Y') DEFAULT 'N' NOT NULL, Super_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') DEFAULT 'N' NOT NULL, Repl_slave_priv enum('N','Y') DEFAULT 'N' NOT NULL, Repl_client_priv enum('N','Y') DEFAULT 'N' NOT NULL, ssl_type enum('','ANY','X509', 'SPECIFIED') DEFAULT '' NOT NULL, ssl_cipher BLOB NOT NULL, x509_issuer BLOB NOT NULL, x509_subject BLOB NOT NULL, max_questions int(11) unsigned DEFAULT 0 NOT NULL, max_updates int(11) unsigned DEFAULT 0 NOT NULL, max_connections int(11) unsigned DEFAULT 0 NOT NULL, PRIMARY KEY Host (Host,User)) comment='Users and global privileges'; + +INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); +INSERT INTO user VALUES ('','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); + +INSERT INTO user (host,user) values ('localhost',''); +INSERT INTO user (host,user) values ('',''); + +CREATE TABLE func (name char(64) binary DEFAULT '' NOT NULL, ret tinyint(1) DEFAULT '0' NOT NULL, dl char(128) DEFAULT '' NOT NULL, type enum ('function','aggregate') NOT NULL, PRIMARY KEY (name)) comment='User defined functions'; + +CREATE TABLE tables_priv (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Table_name char(60) binary DEFAULT '' NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Timestamp timestamp(14), Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') DEFAULT '' NOT NULL, Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name), KEY Grantor (Grantor)) comment='Table privileges'; + +CREATE TABLE columns_priv (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Column_name char(64) binary DEFAULT '' NOT NULL, Timestamp timestamp(14), Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name,Column_name)) comment='Column privileges'; + diff --git a/mysql-test/mysql_test_run_new.c b/mysql-test/mysql_test_run_new.c new file mode 100644 index 00000000000..6f388fc4a45 --- /dev/null +++ b/mysql-test/mysql_test_run_new.c @@ -0,0 +1,1728 @@ +/* + Copyright (c) 2002, 2003 Novell, Inc. All Rights Reserved. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include +#include +#include +#ifndef __WIN__ +#include +#endif +#include +#ifdef __NETWARE__ +#include +#include +#endif +#include +#include +#ifndef __WIN__ +#include +#endif +#include +#ifdef __NETWARE__ +#include +#endif +#ifdef __WIN__ +#include +#include +#endif + +#include "my_manage.h" + +/****************************************************************************** + + macros + +******************************************************************************/ + +#define HEADER "TEST RESULT \n" +#define DASH "-------------------------------------------------------\n" + +#define NW_TEST_SUFFIX ".nw-test" +#define NW_RESULT_SUFFIX ".nw-result" +#define TEST_SUFFIX ".test" +#define RESULT_SUFFIX ".result" +#define REJECT_SUFFIX ".reject" +#define OUT_SUFFIX ".out" +#define ERR_SUFFIX ".err" + +const char *TEST_PASS = "[ pass ]"; +const char *TEST_SKIP = "[ skip ]"; +const char *TEST_FAIL = "[ fail ]"; +const char *TEST_BAD = "[ bad ]"; +const char *TEST_IGNORE = "[ignore]"; + +/****************************************************************************** + + global variables + +******************************************************************************/ +#ifdef __NETWARE__ +static char base_dir[PATH_MAX] = "sys:/mysql"; +#else +static char base_dir[PATH_MAX] = ".."; +#endif +static char db[PATH_MAX] = "test"; +static char user[PATH_MAX] = "root"; +static char password[PATH_MAX] = ""; + +int master_port = 9306; +int slave_port = 9307; + +#if !defined(__NETWARE__) && !defined(__WIN__) +static char master_socket[PATH_MAX] = "./var/tmp/master.sock"; +static char slave_socket[PATH_MAX] = "./var/tmp/slave.sock"; +#endif + +// comma delimited list of tests to skip or empty string +#ifndef __WIN__ +static char skip_test[PATH_MAX] = " lowercase_table3 , system_mysql_db_fix "; +#else +/* + The most ignore testes contain the calls of system command +*/ +#define MAX_COUNT_TESTES 1024 +/* + lowercase_table3 is disabled by Gerg + system_mysql_db_fix is disabled by Gerg + sp contains a command system + rpl_EE_error contains a command system + rpl_loaddatalocal contains a command system + ndb_autodiscover contains a command system + rpl_rotate_logs contains a command system + repair contains a command system + rpl_trunc_binlog contains a command system + mysqldump contains a command system + rpl000001 makes non-exit loop...temporary skiped +*/ +static char skip_test[PATH_MAX] = " lowercase_table3 , system_mysql_db_fix , sp , rpl_EE_error , rpl_loaddatalocal , ndb_autodiscover , rpl_rotate_logs , repair , rpl_trunc_binlog , mysqldump , rpl000001 "; +#endif +static char ignore_test[PATH_MAX] = ""; + +static char bin_dir[PATH_MAX]; +static char mysql_test_dir[PATH_MAX]; +static char test_dir[PATH_MAX]; +static char mysql_tmp_dir[PATH_MAX]; +static char result_dir[PATH_MAX]; +static char master_dir[PATH_MAX]; +static char slave_dir[PATH_MAX]; +static char lang_dir[PATH_MAX]; +static char char_dir[PATH_MAX]; + +static char mysqladmin_file[PATH_MAX]; +static char mysqld_file[PATH_MAX]; +static char mysqltest_file[PATH_MAX]; +#ifndef __WIN__ +static char master_pid[PATH_MAX]; +static char slave_pid[PATH_MAX]; +static char sh_file[PATH_MAX] = "/bin/sh"; +#else +static HANDLE master_pid; +static HANDLE slave_pid; +#endif + +static char master_opt[PATH_MAX] = ""; +static char slave_opt[PATH_MAX] = ""; + +static char slave_master_info[PATH_MAX] = ""; + +static char master_init_script[PATH_MAX] = ""; +static char slave_init_script[PATH_MAX] = ""; + +// OpenSSL +static char ca_cert[PATH_MAX]; +static char server_cert[PATH_MAX]; +static char server_key[PATH_MAX]; +static char client_cert[PATH_MAX]; +static char client_key[PATH_MAX]; + +int total_skip = 0; +int total_pass = 0; +int total_fail = 0; +int total_test = 0; + +int total_ignore = 0; + +int use_openssl = FALSE; +int master_running = FALSE; +int slave_running = FALSE; +int skip_slave = TRUE; +int single_test = TRUE; + +int restarts = 0; + +FILE *log_fd = NULL; + +/****************************************************************************** + + functions + +******************************************************************************/ + +/****************************************************************************** + + prototypes + +******************************************************************************/ + +void report_stats(); +void install_db(char *); +void mysql_install_db(); +void start_master(); +void start_slave(); +void mysql_start(); +void stop_slave(); +void stop_master(); +void mysql_stop(); +void mysql_restart(); +int read_option(char *, char *); +void run_test(char *); +void setup(char *); +void vlog(const char *, va_list); +void mlog(const char *, ...); +void log_info(const char *, ...); +void log_error(const char *, ...); +void log_errno(const char *, ...); +void die(const char *); +char *str_tok(char *string, const char *delim); +#ifndef __WIN__ +void run_init_script(const char *script_name); +#endif +/****************************************************************************** + + report_stats() + + Report the gathered statistics. + +******************************************************************************/ +void report_stats() +{ + if (total_fail == 0) + { + mlog("\nAll %d test(s) were successful.\n", total_test); + } + else + { + double percent = ((double)total_pass / total_test) * 100; + + mlog("\nFailed %u/%u test(s), %.02f%% successful.\n", + total_fail, total_test, percent); + mlog("\nThe .out and .err files in %s may give you some\n", result_dir); + mlog("hint of what when wrong.\n"); + mlog("\nIf you want to report this error, please first read the documentation\n"); + mlog("at: http://www.mysql.com/doc/M/y/MySQL_test_suite.html\n"); + } +} + +/****************************************************************************** + + install_db() + + Install the a database. + +******************************************************************************/ +void install_db(char *datadir) +{ + arg_list_t al; + int err; + char input[PATH_MAX]; + char output[PATH_MAX]; + char error[PATH_MAX]; + + // input file +#ifdef __NETWARE__ + snprintf(input, PATH_MAX, "%s/bin/init_db.sql", base_dir); +#else + snprintf(input, PATH_MAX, "%s/mysql-test/init_db.sql", base_dir); +#endif + snprintf(output, PATH_MAX, "%s/install.out", datadir); + snprintf(error, PATH_MAX, "%s/install.err", datadir); + + // args + init_args(&al); + add_arg(&al, mysqld_file); + add_arg(&al, "--no-defaults"); + add_arg(&al, "--bootstrap"); + add_arg(&al, "--skip-grant-tables"); + add_arg(&al, "--basedir=%s", base_dir); + add_arg(&al, "--datadir=%s", datadir); + add_arg(&al, "--skip-innodb"); + add_arg(&al, "--skip-bdb"); +#ifndef __NETWARE__ + add_arg(&al, "--character-sets-dir=%s", char_dir); + add_arg(&al, "--language=%s", lang_dir); +#endif + + // spawn + if ((err = spawn(mysqld_file, &al, TRUE, input, output, error, NULL)) != 0) + { + die("Unable to create database."); + } + + // free args + free_args(&al); +} + +/****************************************************************************** + + mysql_install_db() + + Install the test databases. + +******************************************************************************/ +void mysql_install_db() +{ + char temp[PATH_MAX]; + + // var directory + snprintf(temp, PATH_MAX, "%s/var", mysql_test_dir); + + // clean up old direcotry + del_tree(temp); + + // create var directory +#ifndef __WIN__ + mkdir(temp, S_IRWXU); + // create subdirectories + mlog("Creating test-suite folders...\n"); + snprintf(temp, PATH_MAX, "%s/var/run", mysql_test_dir); + mkdir(temp, S_IRWXU); + snprintf(temp, PATH_MAX, "%s/var/tmp", mysql_test_dir); + mkdir(temp, S_IRWXU); + snprintf(temp, PATH_MAX, "%s/var/master-data", mysql_test_dir); + mkdir(temp, S_IRWXU); + snprintf(temp, PATH_MAX, "%s/var/master-data/mysql", mysql_test_dir); + mkdir(temp, S_IRWXU); + snprintf(temp, PATH_MAX, "%s/var/master-data/test", mysql_test_dir); + mkdir(temp, S_IRWXU); + snprintf(temp, PATH_MAX, "%s/var/slave-data", mysql_test_dir); + mkdir(temp, S_IRWXU); + snprintf(temp, PATH_MAX, "%s/var/slave-data/mysql", mysql_test_dir); + mkdir(temp, S_IRWXU); + snprintf(temp, PATH_MAX, "%s/var/slave-data/test", mysql_test_dir); + mkdir(temp, S_IRWXU); +#else + mkdir(temp); + // create subdirectories + mlog("Creating test-suite folders...\n"); + snprintf(temp, PATH_MAX, "%s/var/run", mysql_test_dir); + mkdir(temp); + snprintf(temp, PATH_MAX, "%s/var/tmp", mysql_test_dir); + mkdir(temp); + snprintf(temp, PATH_MAX, "%s/var/master-data", mysql_test_dir); + mkdir(temp); + snprintf(temp, PATH_MAX, "%s/var/master-data/mysql", mysql_test_dir); + mkdir(temp); + snprintf(temp, PATH_MAX, "%s/var/master-data/test", mysql_test_dir); + mkdir(temp); + snprintf(temp, PATH_MAX, "%s/var/slave-data", mysql_test_dir); + mkdir(temp); + snprintf(temp, PATH_MAX, "%s/var/slave-data/mysql", mysql_test_dir); + mkdir(temp); + snprintf(temp, PATH_MAX, "%s/var/slave-data/test", mysql_test_dir); + mkdir(temp); +#endif + + // install databases + mlog("Creating test databases for master... \n"); + install_db(master_dir); + mlog("Creating test databases for slave... \n"); + install_db(slave_dir); +} + +/****************************************************************************** + + start_master() + + Start the master server. + +******************************************************************************/ +void start_master() +{ + arg_list_t al; + int err; + char master_out[PATH_MAX]; + char master_err[PATH_MAX]; +// char temp[PATH_MAX]; + char temp2[PATH_MAX]; + + // remove old berkeley db log files that can confuse the server + removef("%s/log.*", master_dir); + + // remove stale binary logs + removef("%s/var/log/*-bin.*", mysql_test_dir); + + // remove stale binary logs + removef("%s/var/log/*.index", mysql_test_dir); + + // remove master.info file + removef("%s/master.info", master_dir); + + // remove relay files + removef("%s/var/log/*relay*", mysql_test_dir); + + // remove relay-log.info file + removef("%s/relay-log.info", master_dir); + + // init script + if (master_init_script[0] != 0) + { +#ifdef __NETWARE__ + // TODO: use the scripts + if (strinstr(master_init_script, "repair_part2-master.sh") != 0) + { + FILE *fp; + + // create an empty index file + snprintf(temp, PATH_MAX, "%s/test/t1.MYI", master_dir); + fp = fopen(temp, "wb+"); + + fputs("1", fp); + + fclose(fp); + } +#elif !defined(__WIN__) + run_init_script(master_init_script); +#endif + } + + // redirection files + snprintf(master_out, PATH_MAX, "%s/var/run/master%u.out", + mysql_test_dir, restarts); + snprintf(master_err, PATH_MAX, "%s/var/run/master%u.err", + mysql_test_dir, restarts); +#ifndef __WIN__ + snprintf(temp2,PATH_MAX,"%s/var",mysql_test_dir); + mkdir(temp2,S_IRWXU); + snprintf(temp2,PATH_MAX,"%s/var/log",mysql_test_dir); + mkdir(temp2,S_IRWXU); +#else + snprintf(temp2,PATH_MAX,"%s/var",mysql_test_dir); + mkdir(temp2); + snprintf(temp2,PATH_MAX,"%s/var/log",mysql_test_dir); + mkdir(temp2); +#endif + // args + init_args(&al); + add_arg(&al, "%s", mysqld_file); + add_arg(&al, "--no-defaults"); + add_arg(&al, "--log-bin=%s/var/log/master-bin",mysql_test_dir); + add_arg(&al, "--server-id=1"); + add_arg(&al, "--basedir=%s", base_dir); + add_arg(&al, "--port=%u", master_port); +#if !defined(__NETWARE__) && !defined(__WIN__) + add_arg(&al, "--socket=%s",master_socket); +#endif + add_arg(&al, "--local-infile"); + add_arg(&al, "--core"); + add_arg(&al, "--datadir=%s", master_dir); +#ifndef __WIN__ + add_arg(&al, "--pid-file=%s", master_pid); +#endif + add_arg(&al, "--character-sets-dir=%s", char_dir); + add_arg(&al, "--tmpdir=%s", mysql_tmp_dir); + add_arg(&al, "--language=%s", lang_dir); +#ifdef DEBUG //only for debug builds + add_arg(&al, "--debug"); +#endif + + if (use_openssl) + { + add_arg(&al, "--ssl-ca=%s", ca_cert); + add_arg(&al, "--ssl-cert=%s", server_cert); + add_arg(&al, "--ssl-key=%s", server_key); + } + + // $MASTER_40_ARGS + add_arg(&al, "--rpl-recovery-rank=1"); + add_arg(&al, "--init-rpl-role=master"); + + // $SMALL_SERVER + add_arg(&al, "-O"); + add_arg(&al, "key_buffer_size=1M"); + add_arg(&al, "-O"); + add_arg(&al, "sort_buffer=256K"); + add_arg(&al, "-O"); + add_arg(&al, "max_heap_table_size=1M"); + + // $EXTRA_MASTER_OPT + if (master_opt[0] != 0) + { + char *p; + + p = (char *)str_tok(master_opt, " \t"); + if (!strstr(master_opt, "timezone")) + { + while (p) + { + add_arg(&al, "%s", p); + p = (char *)str_tok(NULL, " \t"); + } + } + } + + // remove the pid file if it exists +#ifndef __WIN__ + remove(master_pid); +#endif + + // spawn +#ifdef __WIN__ + if ((err= spawn(mysqld_file, &al, FALSE, NULL, master_out, master_err, &master_pid)) == 0) +#else + if ((err= spawn(mysqld_file, &al, FALSE, NULL, master_out, master_err, master_pid)) == 0) +#endif + { + sleep_until_file_exists(master_pid); + + if ((err = wait_for_server_start(bin_dir, mysqladmin_file, user, password, master_port, + mysql_tmp_dir)) == 0) + { + master_running = TRUE; + } + else + { + log_error("The master server went down early."); + } + } + else + { + log_error("Unable to start master server."); + } + + // free_args + free_args(&al); +} + +/****************************************************************************** + + start_slave() + + Start the slave server. + +******************************************************************************/ +void start_slave() +{ + arg_list_t al; + int err; + char slave_out[PATH_MAX]; + char slave_err[PATH_MAX]; + + // skip? + if (skip_slave) return; + + // remove stale binary logs + removef("%s/*-bin.*", slave_dir); + + // remove stale binary logs + removef("%s/*.index", slave_dir); + + // remove master.info file + removef("%s/master.info", slave_dir); + + // remove relay files + removef("%s/var/log/*relay*", mysql_test_dir); + + // remove relay-log.info file + removef("%s/relay-log.info", slave_dir); + + // init script + if (slave_init_script[0] != 0) + { +#ifdef __NETWARE__ + // TODO: use the scripts + if (strinstr(slave_init_script, "rpl000016-slave.sh") != 0) + { + // create empty master.info file + snprintf(temp, PATH_MAX, "%s/master.info", slave_dir); + close(open(temp, O_WRONLY | O_CREAT,S_IRWXU|S_IRWXG|S_IRWXO)); + } + else if (strinstr(slave_init_script, "rpl000017-slave.sh") != 0) + { + FILE *fp; + + // create a master.info file + snprintf(temp, PATH_MAX, "%s/master.info", slave_dir); + fp = fopen(temp, "wb+"); + + fputs("master-bin.000001\n", fp); + fputs("4\n", fp); + fputs("127.0.0.1\n", fp); + fputs("replicate\n", fp); + fputs("aaaaaaaaaaaaaaab\n", fp); + fputs("9306\n", fp); + fputs("1\n", fp); + fputs("0\n", fp); + + fclose(fp); + } + else if (strinstr(slave_init_script, "rpl_rotate_logs-slave.sh") != 0) + { + // create empty master.info file + snprintf(temp, PATH_MAX, "%s/master.info", slave_dir); + close(open(temp, O_WRONLY | O_CREAT,S_IRWXU|S_IRWXG|S_IRWXO)); + } +#elif !defined(__WIN__) + run_init_script(slave_init_script); +#endif + } + + // redirection files + snprintf(slave_out, PATH_MAX, "%s/var/run/slave%u.out", + mysql_test_dir, restarts); + snprintf(slave_err, PATH_MAX, "%s/var/run/slave%u.err", + mysql_test_dir, restarts); + + // args + init_args(&al); + add_arg(&al, "%s", mysqld_file); + add_arg(&al, "--no-defaults"); + add_arg(&al, "--log-bin=slave-bin"); + add_arg(&al, "--relay_log=slave-relay-bin"); + add_arg(&al, "--basedir=%s", base_dir); + add_arg(&al, "--port=%u", slave_port); +#if !defined(__NETWARE__) && !defined(__WIN__) + add_arg(&al, "--socket=%s",slave_socket); +#endif + add_arg(&al, "--datadir=%s", slave_dir); +#ifndef __WIN__ + add_arg(&al, "--pid-file=%s", slave_pid); +#endif + add_arg(&al, "--character-sets-dir=%s", char_dir); + add_arg(&al, "--core"); + add_arg(&al, "--tmpdir=%s", mysql_tmp_dir); + add_arg(&al, "--language=%s", lang_dir); + + add_arg(&al, "--exit-info=256"); + add_arg(&al, "--log-slave-updates"); + add_arg(&al, "--init-rpl-role=slave"); + add_arg(&al, "--skip-innodb"); + add_arg(&al, "--skip-slave-start"); + add_arg(&al, "--slave-load-tmpdir=../../var/tmp"); + + add_arg(&al, "--report-user=%s", user); + add_arg(&al, "--report-host=127.0.0.1"); + add_arg(&al, "--report-port=%u", slave_port); + + add_arg(&al, "--master-retry-count=10"); + add_arg(&al, "-O"); + add_arg(&al, "slave_net_timeout=10"); +#ifdef DEBUG //only for debug builds + add_arg(&al, "--debug"); +#endif + + if (use_openssl) + { + add_arg(&al, "--ssl-ca=%s", ca_cert); + add_arg(&al, "--ssl-cert=%s", server_cert); + add_arg(&al, "--ssl-key=%s", server_key); + } + + // slave master info + if (slave_master_info[0] != 0) + { + char *p; + + p = (char *)str_tok(slave_master_info, " \t"); + + while(p) + { + add_arg(&al, "%s", p); + + p = (char *)str_tok(NULL, " \t"); + } + } + else + { + add_arg(&al, "--master-user=%s", user); + add_arg(&al, "--master-password=%s", password); + add_arg(&al, "--master-host=127.0.0.1"); + add_arg(&al, "--master-port=%u", master_port); + add_arg(&al, "--master-connect-retry=1"); + add_arg(&al, "--server-id=2"); + add_arg(&al, "--rpl-recovery-rank=2"); + } + + // small server + add_arg(&al, "-O"); + add_arg(&al, "key_buffer_size=1M"); + add_arg(&al, "-O"); + add_arg(&al, "sort_buffer=256K"); + add_arg(&al, "-O"); + add_arg(&al, "max_heap_table_size=1M"); + + + // opt args + if (slave_opt[0] != 0) + { + char *p; + + p = (char *)str_tok(slave_opt, " \t"); + + while(p) + { + add_arg(&al, "%s", p); + + p = (char *)str_tok(NULL, " \t"); + } + } + + // remove the pid file if it exists +#ifndef __WIN__ + remove(slave_pid); +#endif + // spawn +#ifdef __WIN__ + if ((err = spawn(mysqld_file, &al, FALSE, NULL, slave_out, slave_err, &slave_pid)) == 0) +#else + if ((err = spawn(mysqld_file, &al, FALSE, NULL, slave_out, slave_err, slave_pid)) == 0) +#endif + { + sleep_until_file_exists(slave_pid); + + if ((err = wait_for_server_start(bin_dir, mysqladmin_file, user, password, slave_port, + mysql_tmp_dir)) == 0) + { + slave_running = TRUE; + } + else + { + log_error("The slave server went down early."); + } + } + else + { + log_error("Unable to start slave server."); + } + + // free args + free_args(&al); +} + +/****************************************************************************** + + mysql_start() + + Start the mysql servers. + +******************************************************************************/ +void mysql_start() +{ +// log_info("Starting the MySQL server(s): %u", ++restarts); + start_master(); + + start_slave(); + + // activate the test screen +#ifdef __NETWARE__ + ActivateScreen(getscreenhandle()); +#endif +} + +/****************************************************************************** + + stop_slave() + + Stop the slave server. + +******************************************************************************/ +void stop_slave() +{ + int err; + + // running? + if (!slave_running) return; + + // stop + if ((err = stop_server(bin_dir, mysqladmin_file, user, password, slave_port, slave_pid, + mysql_tmp_dir)) == 0) + { + slave_running = FALSE; + } + else + { + log_error("Unable to stop slave server."); + } +} + +/****************************************************************************** + + stop_master() + + Stop the master server. + +******************************************************************************/ +void stop_master() +{ + int err; + + // running? + if (!master_running) return; + + if ((err = stop_server(bin_dir, mysqladmin_file, user, password, master_port, master_pid, + mysql_tmp_dir)) == 0) + { + master_running = FALSE; + } + else + { + log_error("Unable to stop master server."); + } +} + +/****************************************************************************** + + mysql_stop() + + Stop the mysql servers. + +******************************************************************************/ +void mysql_stop() +{ + + stop_master(); + + stop_slave(); + + // activate the test screen +#ifdef __NETWARE__ + ActivateScreen(getscreenhandle()); +#endif +} + +/****************************************************************************** + + mysql_restart() + + Restart the mysql servers. + +******************************************************************************/ +void mysql_restart() +{ +// log_info("Restarting the MySQL server(s): %u", ++restarts); + + mysql_stop(); + + mlog(DASH); + + mysql_start(); +} + +/****************************************************************************** + + read_option() + + Read the option file. + +******************************************************************************/ +int read_option(char *opt_file, char *opt) +{ + int fd, err; + char *p; + char buf[PATH_MAX]; + + // copy current option + strncpy(buf, opt, PATH_MAX); + + // open options file + fd = open(opt_file, O_RDONLY); + + err = read(fd, opt, PATH_MAX); + + close(fd); + + if (err > 0) + { + // terminate string + if ((p = strchr(opt, '\n')) != NULL) + { + *p = 0; + + // check for a '\r' + if ((p = strchr(opt, '\r')) != NULL) + { + *p = 0; + } + } + else + { + opt[err] = 0; + } + + // check for $MYSQL_TEST_DIR + if ((p = strstr(opt, "$MYSQL_TEST_DIR")) != NULL) + { + char temp[PATH_MAX]; + + *p = 0; + + strcpy(temp, p + strlen("$MYSQL_TEST_DIR")); + + strcat(opt, mysql_test_dir); + + strcat(opt, temp); + } + // Check for double backslash and replace it with single bakslash + if ((p = strstr(opt, "\\\\")) != NULL) + { + /* bmove is guranteed to work byte by byte */ + bmove(p, p+1, strlen(p+1)); + } + } + else + { + // clear option + *opt = 0; + } + + // compare current option with previous + return strcmp(opt, buf); +} + +/****************************************************************************** + + run_test() + + Run the given test case. + +******************************************************************************/ +void run_test(char *test) +{ + char temp[PATH_MAX]; + const char *rstr; + int skip = FALSE, ignore=FALSE; + int restart = FALSE; + int flag = FALSE; + struct stat info; + + // skip tests in the skip list + snprintf(temp, PATH_MAX, " %s ", test); + skip = (strinstr(skip_test, temp) != 0); + if (skip == FALSE) + ignore = (strinstr(ignore_test, temp) != 0); + + snprintf(master_init_script, PATH_MAX, "%s/%s-master.sh", test_dir, test); + snprintf(slave_init_script, PATH_MAX, "%s/%s-slave.sh", test_dir, test); +#ifdef __WIN__ + if (! stat(master_init_script, &info)) + skip = TRUE; + if (!stat(slave_init_script, &info)) + skip = TRUE; +#endif + if (ignore) + { + // show test + mlog("%-46s ", test); + + // ignore + rstr = TEST_IGNORE; + ++total_ignore; + } + else if (!skip) // skip test? + { + char test_file[PATH_MAX]; + char master_opt_file[PATH_MAX]; + char slave_opt_file[PATH_MAX]; + char slave_master_info_file[PATH_MAX]; + char result_file[PATH_MAX]; + char reject_file[PATH_MAX]; + char out_file[PATH_MAX]; + char err_file[PATH_MAX]; + int err; + arg_list_t al; +#ifdef __WIN__ + /* + Clean test database + */ + removef("%s/test/*.*", master_dir); + removef("%s/test/*.*", slave_dir); + removef("%s/mysqltest/*.*", master_dir); + removef("%s/mysqltest/*.*", slave_dir); + +#endif + // skip slave? + flag = skip_slave; + skip_slave = (strncmp(test, "rpl", 3) != 0); + if (flag != skip_slave) restart = TRUE; + + // create files + snprintf(master_opt_file, PATH_MAX, "%s/%s-master.opt", test_dir, test); + snprintf(slave_opt_file, PATH_MAX, "%s/%s-slave.opt", test_dir, test); + snprintf(slave_master_info_file, PATH_MAX, "%s/%s.slave-mi", test_dir, test); + snprintf(reject_file, PATH_MAX, "%s/%s%s", result_dir, test, REJECT_SUFFIX); + snprintf(out_file, PATH_MAX, "%s/%s%s", result_dir, test, OUT_SUFFIX); + snprintf(err_file, PATH_MAX, "%s/%s%s", result_dir, test, ERR_SUFFIX); + + // netware specific files + snprintf(test_file, PATH_MAX, "%s/%s%s", test_dir, test, NW_TEST_SUFFIX); + if (stat(test_file, &info)) + { + snprintf(test_file, PATH_MAX, "%s/%s%s", test_dir, test, TEST_SUFFIX); + if (access(test_file,0)) + { + printf("Invalid test name %s, %s file not found\n",test,test_file); + return; + } + } + + snprintf(result_file, PATH_MAX, "%s/%s%s", result_dir, test, NW_RESULT_SUFFIX); + if (stat(result_file, &info)) + { + snprintf(result_file, PATH_MAX, "%s/%s%s", result_dir, test, RESULT_SUFFIX); + } + + // init scripts + if (stat(master_init_script, &info)) + master_init_script[0] = 0; + else + restart = TRUE; + + if (stat(slave_init_script, &info)) + slave_init_script[0] = 0; + else + restart = TRUE; + + // read options + if (read_option(master_opt_file, master_opt)) restart = TRUE; + if (read_option(slave_opt_file, slave_opt)) restart = TRUE; + if (read_option(slave_master_info_file, slave_master_info)) restart = TRUE; + + // cleanup previous run + remove(reject_file); + remove(out_file); + remove(err_file); + + // start or restart? + if (!master_running) mysql_start(); + else if (restart) mysql_restart(); + + // let the system stabalize + sleep(1); + + // show test + mlog("%-46s ", test); + + + // args + init_args(&al); + add_arg(&al, "%s", mysqltest_file); + add_arg(&al, "--no-defaults"); + add_arg(&al, "--port=%u", master_port); +#if !defined(__NETWARE__) && !defined(__WIN__) + add_arg(&al, "--socket=%s", master_socket); + add_arg(&al, "--tmpdir=%s", mysql_tmp_dir); +#endif + add_arg(&al, "--database=%s", db); + add_arg(&al, "--user=%s", user); + add_arg(&al, "--password=%s", password); + add_arg(&al, "--silent"); + add_arg(&al, "--basedir=%s/", mysql_test_dir); + add_arg(&al, "--host=127.0.0.1"); + add_arg(&al, "-v"); + add_arg(&al, "-R"); + add_arg(&al, "%s", result_file); + + if (use_openssl) + { + add_arg(&al, "--ssl-ca=%s", ca_cert); + add_arg(&al, "--ssl-cert=%s", client_cert); + add_arg(&al, "--ssl-key=%s", client_key); + } + + // spawn + err = spawn(mysqltest_file, &al, TRUE, test_file, out_file, err_file, NULL); + + // free args + free_args(&al); + + remove_empty_file(out_file); + remove_empty_file(err_file); + + if (err == 0) + { + // pass + rstr = TEST_PASS; + ++total_pass; + + // increment total + ++total_test; + } + else if (err == 2) + { + // skip + rstr = TEST_SKIP; + ++total_skip; + } + else if (err == 1) + { + // fail + rstr = TEST_FAIL; + ++total_fail; + + // increment total + ++total_test; + } + else + { + rstr = TEST_BAD; + } + } + else // early skips + { + // show test + mlog("%-46s ", test); + + // skip + rstr = TEST_SKIP; + ++total_skip; + } + + // result + mlog("%-14s\n", rstr); +} + +/****************************************************************************** + + vlog() + + Log the message. + +******************************************************************************/ +void vlog(const char *format, va_list ap) +{ + vfprintf(stdout, format, ap); + fflush(stdout); + + if (log_fd) + { + vfprintf(log_fd, format, ap); + fflush(log_fd); + } +} + +/****************************************************************************** + + log() + + Log the message. + +******************************************************************************/ +void mlog(const char *format, ...) +{ + va_list ap; + + va_start(ap, format); + + vlog(format, ap); + + va_end(ap); +} + +/****************************************************************************** + + log_info() + + Log the given information. + +******************************************************************************/ +void log_info(const char *format, ...) +{ + va_list ap; + + va_start(ap, format); + + mlog("-- INFO : "); + vlog(format, ap); + mlog("\n"); + + va_end(ap); +} + +/****************************************************************************** + + log_error() + + Log the given error. + +******************************************************************************/ +void log_error(const char *format, ...) +{ + va_list ap; + + va_start(ap, format); + + mlog("-- ERROR: "); + vlog(format, ap); + mlog("\n"); + + va_end(ap); +} + +/****************************************************************************** + + log_errno() + + Log the given error and errno. + +******************************************************************************/ +void log_errno(const char *format, ...) +{ + va_list ap; + + va_start(ap, format); + + mlog("-- ERROR: (%003u) ", errno); + vlog(format, ap); + mlog("\n"); + + va_end(ap); +} + +/****************************************************************************** + + die() + + Exit the application. + +******************************************************************************/ +void die(const char *msg) +{ + log_error(msg); +#ifdef __NETWARE__ + pressanykey(); +#endif + exit(-1); +} + +/****************************************************************************** + + setup() + + Setup the mysql test enviornment. + +******************************************************************************/ +void setup(char *file) +{ + char temp[PATH_MAX]; + char file_path[PATH_MAX*2]; + char *p; + int position; + + // set the timezone for the timestamp test +#ifdef __WIN__ + _putenv( "TZ=GMT-3" ); +#else + setenv("TZ", "GMT-3", TRUE); +#endif + // find base dir +#ifdef __NETWARE__ + strcpy(temp, strlwr(file)); + while((p = strchr(temp, '\\')) != NULL) *p = '/'; +#else + getcwd(temp, PATH_MAX); + position = strlen(temp); + temp[position] = '/'; + temp[position+1] = 0; +#ifdef __WIN__ + while((p = strchr(temp, '\\')) != NULL) *p = '/'; +#endif +#endif + + if ((position = strinstr(temp, "/mysql-test/")) != 0) + { + p = temp + position - 1; + *p = 0; + strcpy(base_dir, temp); + } + + log_info("Currect directory: %s",base_dir); + +#ifdef __NETWARE__ + // setup paths + snprintf(bin_dir, PATH_MAX, "%s/bin", base_dir); + snprintf(mysql_test_dir, PATH_MAX, "%s/mysql-test", base_dir); + snprintf(test_dir, PATH_MAX, "%s/t", mysql_test_dir); + snprintf(mysql_tmp_dir, PATH_MAX, "%s/var/tmp", mysql_test_dir); + snprintf(result_dir, PATH_MAX, "%s/r", mysql_test_dir); + snprintf(master_dir, PATH_MAX, "%s/var/master-data", mysql_test_dir); + snprintf(slave_dir, PATH_MAX, "%s/var/slave-data", mysql_test_dir); + snprintf(lang_dir, PATH_MAX, "%s/share/english", base_dir); + snprintf(char_dir, PATH_MAX, "%s/share/charsets", base_dir); + +#ifdef HAVE_OPENSSL + use_openssl = TRUE; +#endif // HAVE_OPENSSL + + // OpenSSL paths + snprintf(ca_cert, PATH_MAX, "%s/SSL/cacert.pem", base_dir); + snprintf(server_cert, PATH_MAX, "%s/SSL/server-cert.pem", base_dir); + snprintf(server_key, PATH_MAX, "%s/SSL/server-key.pem", base_dir); + snprintf(client_cert, PATH_MAX, "%s/SSL/client-cert.pem", base_dir); + snprintf(client_key, PATH_MAX, "%s/SSL/client-key.pem", base_dir); + + // setup files + snprintf(mysqld_file, PATH_MAX, "%s/mysqld", bin_dir); + snprintf(mysqltest_file, PATH_MAX, "%s/mysqltest", bin_dir); + snprintf(mysqladmin_file, PATH_MAX, "%s/mysqladmin", bin_dir); + snprintf(master_pid, PATH_MAX, "%s/var/run/master.pid", mysql_test_dir); + snprintf(slave_pid, PATH_MAX, "%s/var/run/slave.pid", mysql_test_dir); +#elif __WIN__ + // setup paths +#ifdef _DEBUG + snprintf(bin_dir, PATH_MAX, "%s/client_debug", base_dir); +#else + snprintf(bin_dir, PATH_MAX, "%s/client_release", base_dir); +#endif + snprintf(mysql_test_dir, PATH_MAX, "%s/mysql-test", base_dir); + snprintf(test_dir, PATH_MAX, "%s/t", mysql_test_dir); + snprintf(mysql_tmp_dir, PATH_MAX, "%s/var/tmp", mysql_test_dir); + snprintf(result_dir, PATH_MAX, "%s/r", mysql_test_dir); + snprintf(master_dir, PATH_MAX, "%s/var/master-data", mysql_test_dir); + snprintf(slave_dir, PATH_MAX, "%s/var/slave-data", mysql_test_dir); + snprintf(lang_dir, PATH_MAX, "%s/share/english", base_dir); + snprintf(char_dir, PATH_MAX, "%s/share/charsets", base_dir); + +#ifdef HAVE_OPENSSL + use_openssl = TRUE; +#endif // HAVE_OPENSSL + + // OpenSSL paths + snprintf(ca_cert, PATH_MAX, "%s/SSL/cacert.pem", base_dir); + snprintf(server_cert, PATH_MAX, "%s/SSL/server-cert.pem", base_dir); + snprintf(server_key, PATH_MAX, "%s/SSL/server-key.pem", base_dir); + snprintf(client_cert, PATH_MAX, "%s/SSL/client-cert.pem", base_dir); + snprintf(client_key, PATH_MAX, "%s/SSL/client-key.pem", base_dir); + + // setup files + snprintf(mysqld_file, PATH_MAX, "%s/mysqld.exe", bin_dir); + snprintf(mysqltest_file, PATH_MAX, "%s/mysqltest.exe", bin_dir); + snprintf(mysqladmin_file, PATH_MAX, "%s/mysqladmin.exe", bin_dir); +#else + // setup paths + snprintf(bin_dir, PATH_MAX, "%s/client", base_dir); + snprintf(mysql_test_dir, PATH_MAX, "%s/mysql-test", base_dir); + snprintf(test_dir, PATH_MAX, "%s/t", mysql_test_dir); + snprintf(mysql_tmp_dir, PATH_MAX, "%s/var/tmp", mysql_test_dir); + snprintf(result_dir, PATH_MAX, "%s/r", mysql_test_dir); + snprintf(master_dir, PATH_MAX, "%s/var/master-data", mysql_test_dir); + snprintf(slave_dir, PATH_MAX, "%s/var/slave-data", mysql_test_dir); + snprintf(lang_dir, PATH_MAX, "%s/sql/share/english", base_dir); + snprintf(char_dir, PATH_MAX, "%s/sql/share/charsets", base_dir); + +#ifdef HAVE_OPENSSL + use_openssl = TRUE; +#endif // HAVE_OPENSSL + + // OpenSSL paths + snprintf(ca_cert, PATH_MAX, "%s/SSL/cacert.pem", base_dir); + snprintf(server_cert, PATH_MAX, "%s/SSL/server-cert.pem", base_dir); + snprintf(server_key, PATH_MAX, "%s/SSL/server-key.pem", base_dir); + snprintf(client_cert, PATH_MAX, "%s/SSL/client-cert.pem", base_dir); + snprintf(client_key, PATH_MAX, "%s/SSL/client-key.pem", base_dir); + + // setup files + snprintf(mysqld_file, PATH_MAX, "%s/sql/mysqld", base_dir); + snprintf(mysqltest_file, PATH_MAX, "%s/mysqltest", bin_dir); + snprintf(mysqladmin_file, PATH_MAX, "%s/mysqladmin", bin_dir); + snprintf(master_pid, PATH_MAX, "%s/var/run/master.pid", mysql_test_dir); + snprintf(slave_pid, PATH_MAX, "%s/var/run/slave.pid", mysql_test_dir); + + snprintf(master_socket,PATH_MAX, "%s/var/tmp/master.sock", mysql_test_dir); + snprintf(slave_socket,PATH_MAX, "%s/var/tmp/slave.sock", mysql_test_dir); + +#endif + // create log file + snprintf(temp, PATH_MAX, "%s/mysql-test-run.log", mysql_test_dir); + if ((log_fd = fopen(temp, "w+")) == NULL) + { + log_errno("Unable to create log file."); + } + + // prepare skip test list + while((p = strchr(skip_test, ',')) != NULL) *p = ' '; + strcpy(temp, strlwr(skip_test)); + snprintf(skip_test, PATH_MAX, " %s ", temp); + + // environment +#ifdef __NETWARE__ + setenv("MYSQL_TEST_DIR", mysql_test_dir, 1); + snprintf(file_path, PATH_MAX*2, "%s/client/mysqldump --no-defaults -u root --port=%u", bin_dir, master_port); + setenv("MYSQL_DUMP", file_path, 1); + snprintf(file_path, PATH_MAX*2, "%s/client/mysqlbinlog --no-defaults --local-load=%s", bin_dir, mysql_tmp_dir); + setenv("MYSQL_BINLOG", file_path, 1); +#elif __WIN__ + snprintf(file_path,MAX_PATH,"MYSQL_TEST_DIR=%s",mysql_test_dir); + _putenv(file_path); + snprintf(file_path, PATH_MAX*2, "MYSQL_DUMP=%s/mysqldump.exe --no-defaults -u root --port=%u", bin_dir, master_port); + _putenv(file_path); + snprintf(file_path, PATH_MAX*2, "MYSQL_BINLOG=%s/mysqlbinlog.exe --no-defaults --local-load=%s", bin_dir, mysql_tmp_dir); + _putenv(file_path); +#else + setenv("MYSQL_TEST_DIR", mysql_test_dir, 1); + snprintf(file_path, PATH_MAX*2, "%s/mysqldump --no-defaults -u root --port=%u --socket=%s", bin_dir, master_port, master_socket); + setenv("MYSQL_DUMP", file_path, 1); + snprintf(file_path, PATH_MAX*2, "%s/mysqlbinlog --no-defaults --local-load=%s", bin_dir, mysql_tmp_dir); + setenv("MYSQL_BINLOG", file_path, 1); +#endif + +#ifndef __WIN__ + setenv("MASTER_MYPORT", "9306", 1); + setenv("SLAVE_MYPORT", "9307", 1); + setenv("MYSQL_TCP_PORT", "3306", 1); +#else + _putenv("MASTER_MYPORT=9306"); + _putenv("SLAVE_MYPORT=9307"); + _putenv("MYSQL_TCP_PORT=3306"); +#endif + +} + +/****************************************************************************** + + main() + +******************************************************************************/ +int main(int argc, char **argv) +{ + int is_ignore_list = 0; + // setup + setup(argv[0]); + + /* The --ignore option is comma saperated list of test cases to skip and + should be very first command line option to the test suite. + + The usage is now: + mysql_test_run --ignore=test1,test2 test3 test4 + where test1 and test2 are test cases to ignore + and test3 and test4 are test cases to run. + */ + if (argc >= 2 && !strnicmp(argv[1], "--ignore=", sizeof("--ignore=")-1)) + { + char *temp, *token; + temp= strdup(strchr(argv[1],'=') + 1); + for (token=str_tok(temp, ","); token != NULL; token=str_tok(NULL, ",")) + { + if (strlen(ignore_test) + strlen(token) + 2 <= PATH_MAX-1) + sprintf(ignore_test+strlen(ignore_test), " %s ", token); + else + { + free(temp); + die("ignore list too long."); + } + } + free(temp); + is_ignore_list = 1; + } + // header +#ifndef __WIN__ + mlog("MySQL Server %s, for %s (%s)\n\n", VERSION, SYSTEM_TYPE, MACHINE_TYPE); +#else + mlog("MySQL Server ---, for %s (%s)\n\n", SYSTEM_TYPE, MACHINE_TYPE); +#endif + + mlog("Initializing Tests...\n"); + + // install test databases + mysql_install_db(); + + mlog("Starting Tests...\n"); + + mlog("\n"); + mlog(HEADER); + mlog(DASH); + + if ( argc > 1 + is_ignore_list ) + { + int i; + + // single test + single_test = TRUE; + + for (i = 1 + is_ignore_list; i < argc; i++) + { + // run given test + run_test(argv[i]); + } + } + else + { + // run all tests +#ifndef __WIN__ + struct dirent **namelist; + int i,n; + char test[NAME_MAX]; + char *p; + int position; + + n = scandir(test_dir, &namelist, 0, alphasort); + if (n < 0) + die("Unable to open tests directory."); + else + { + for (i = 0; i < n; i++) + { + strcpy(test, strlwr(namelist[i]->d_name)); + // find the test suffix + if ((position = strinstr(test, TEST_SUFFIX)) != 0) + { + p = test + position - 1; + // null terminate at the suffix + *p = 0; + // run test + run_test(test); + } + free(namelist[n]); + } + free(namelist); + } +#else + struct _finddata_t dir; + intptr_t handle; + char test[NAME_MAX]; + char mask[PATH_MAX]; + char *p; + int position; + char **names = 0; + char **testes = 0; + int name_index; + int index; + + // single test + single_test = FALSE; + + snprintf(mask,MAX_PATH,"%s/*.test",test_dir); + + if ((handle=_findfirst(mask,&dir)) == -1L) + { + die("Unable to open tests directory."); + } + + names = malloc(MAX_COUNT_TESTES*4); + testes = names; + name_index = 0; + + do + { + if (!(dir.attrib & _A_SUBDIR)) + { + strcpy(test, strlwr(dir.name)); + + // find the test suffix + if ((position = strinstr(test, TEST_SUFFIX)) != 0) + { + p = test + position - 1; + // null terminate at the suffix + *p = 0; + + // insert test + *names = malloc(PATH_MAX); + strcpy(*names,test); + names++; + name_index++; + } + } + }while (_findnext(handle,&dir) == 0); + + _findclose(handle); + + qsort( (void *)testes, name_index, sizeof( char * ), compare ); + + for (index = 0; index <= name_index; index++) + { + run_test(testes[index]); + free(testes[index]); + } + + free(testes); +#endif + } + + // stop server + mysql_stop(); + + mlog(DASH); + mlog("\n"); + + mlog("Ending Tests...\n"); + + // report stats + report_stats(); + + // close log + if (log_fd) fclose(log_fd); + + // keep results up +#ifdef __NETWARE__ + pressanykey(); +#endif + return 0; +} + + +/* + Synopsis: + This function breaks the string into a sequence of tokens. The difference + between this function and strtok is that it respects the quoted string i.e. + it skips any delimiter character within the quoted part of the string. + It return tokens by eliminating quote character. It modifies the input string + passed. It will work with whitespace delimeter but may not work properly with + other delimeter. If the delimeter will contain any quote character, then + function will not tokenize and will return null string. + e.g. if input string is + --init-slave="set global max_connections=500" --skip-external-locking + then the output will two string i.e. + --init-slave=set global max_connections=500 + --skip-external-locking + +Arguments: + string: input string + delim: set of delimiter character +Output: + return the null terminated token of NULL. +*/ + + +char *str_tok(char *string, const char *delim) +{ + char *token; /* current token received from strtok */ + char *qt_token; /* token delimeted by the matching pair of quote */ + /* + if there are any quote chars found in the token then this variable + will hold the concatenated string to return to the caller + */ + char *ptr_token=NULL; + /* pointer to the quote character in the token from strtok */ + char *ptr_quote=NULL; + + /* See if the delimeter contains any quote character */ + if (strchr(delim,'\'') || strchr(delim,'\"')) + return NULL; + + /* repeate till we are getting some token from strtok */ + while ((token = (char*)strtok(string, delim) ) != NULL) + { + /* + make the input string NULL so that next time onward strtok can + be called with NULL input string. + */ + string = NULL; + /* + We don't need to remove any quote character for Windows version + */ +#ifndef __WIN__ + /* check if the current token contain double quote character*/ + if ((ptr_quote = (char*)strchr(token,'\"')) != NULL) + { + /* + get the matching the matching double quote in the remaining + input string + */ + qt_token = (char*)strtok(NULL,"\""); + } + /* check if the current token contain single quote character*/ + else if ((ptr_quote = (char*)strchr(token,'\'')) != NULL) + { + /* + get the matching the matching single quote in the remaining + input string + */ + qt_token = (char*)strtok(NULL,"\'"); + } +#endif + /* + if the current token does not contains any quote character then + return to the caller. + */ + if (ptr_quote == NULL) + { + /* + if there is any earlier token i.e. ptr_token then append the + current token in it and return it else return the current + token directly + */ + return ptr_token ? strcat(ptr_token,token) : token; + } + + /* + remove the quote character i.e. make NULL so that the token will + be devided in two part and later both part can be concatenated + and hence quote will be removed + */ + *ptr_quote= 0; + + /* check if ptr_token has been initialized or not */ + if (ptr_token == NULL) + { + /* initialize the ptr_token with current token */ + ptr_token= token; + /* copy entire string between matching pair of quote*/ + sprintf(ptr_token+strlen(ptr_token),"%s %s", ptr_quote+1, qt_token); + } + else + { + /* + copy the current token and entire string between matching pair + of quote + */ + if (qt_token == NULL) + { + sprintf(ptr_token+strlen(ptr_token),"%s%s", token, ptr_quote+1); + } + else + { + sprintf(ptr_token+strlen(ptr_token),"%s%s %s", token, ptr_quote+1, + qt_token ); + } + } + } + + /* return the concatenated token */ + return ptr_token; +} + +#ifndef __WIN__ + +/* + Synopsis: + This function run scripts files on Linux and Netware + +Arguments: + script_name: name of script file + +Output: + nothing +*/ +void run_init_script(const char *script_name) +{ + arg_list_t al; + int err; + + // args + init_args(&al); + add_arg(&al, sh_file); + add_arg(&al, script_name); + + // spawn + if ((err = spawn(sh_file, &al, TRUE, NULL, NULL, NULL, NULL)) != 0) + { + die("Unable to run script."); + } + + // free args + free_args(&al); +} +#endif From e30bd1e48d8ef68a92dd8443611b1e3d8e356c7a Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 4 Nov 2004 19:19:23 +0100 Subject: [PATCH 0107/1063] Fix for BUG##5714 "Insert into MyISAM table and select ... for update]": the fact that the transaction log is empty does not mean we're not in a transaction (it could be BEGIN; SELECT * FOR UPDATE FROM ibtable: then we don't want to commit now, even if the statement is a MyISAM update). With a testcase. mysql-test/r/mix_innodb_myisam_binlog.result: result update mysql-test/t/mix_innodb_myisam_binlog.test: test update for a new bug sql/log.cc: The fact that the transaction log is empty does not mean we're not in a transaction (it could be BEGIN; SELECT * FOR UPDATE: then we don't want to commit now). --- mysql-test/r/mix_innodb_myisam_binlog.result | 21 ++++++++++++ .../t/mix_innodb_myisam_binlog-master.opt | 1 + mysql-test/t/mix_innodb_myisam_binlog.test | 32 +++++++++++++++++++ sql/log.cc | 3 +- 4 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 mysql-test/t/mix_innodb_myisam_binlog-master.opt diff --git a/mysql-test/r/mix_innodb_myisam_binlog.result b/mysql-test/r/mix_innodb_myisam_binlog.result index 7b266544c92..93a647f673c 100644 --- a/mysql-test/r/mix_innodb_myisam_binlog.result +++ b/mysql-test/r/mix_innodb_myisam_binlog.result @@ -177,4 +177,25 @@ master-bin.001 79 Query 1 79 use `test`; BEGIN master-bin.001 119 Query 1 79 use `test`; insert into t1 values(16) master-bin.001 179 Query 1 79 use `test`; insert into t1 values(18) master-bin.001 239 Query 1 239 use `test`; COMMIT +delete from t1; +delete from t2; +alter table t2 type=MyISAM; +insert into t1 values (1); +begin; +select * from t1 for update; +a +1 +select (@before:=unix_timestamp())*0; +(@before:=unix_timestamp())*0 +0 +begin; + select * from t1 for update; +insert into t2 values (20); +Lock wait timeout exceeded; Try restarting transaction +select (@after:=unix_timestamp())*0; +(@after:=unix_timestamp())*0 +0 +select (@after-@before) >= 2; +(@after-@before) >= 2 +1 drop table t1,t2; diff --git a/mysql-test/t/mix_innodb_myisam_binlog-master.opt b/mysql-test/t/mix_innodb_myisam_binlog-master.opt new file mode 100644 index 00000000000..cb48f1aaf60 --- /dev/null +++ b/mysql-test/t/mix_innodb_myisam_binlog-master.opt @@ -0,0 +1 @@ +--loose-innodb_lock_wait_timeout=2 diff --git a/mysql-test/t/mix_innodb_myisam_binlog.test b/mysql-test/t/mix_innodb_myisam_binlog.test index be45c2c3133..5f3b778c61a 100644 --- a/mysql-test/t/mix_innodb_myisam_binlog.test +++ b/mysql-test/t/mix_innodb_myisam_binlog.test @@ -175,4 +175,36 @@ select a from t1 order by a; # check that savepoints work :) show binlog events from 79; +# Test for BUG#5714, where a MyISAM update in the transaction used to +# release row-level locks in InnoDB + +connect (con3,localhost,root,,); + +connection con3; +delete from t1; +delete from t2; +--disable_warnings +alter table t2 type=MyISAM; +--enable_warnings +insert into t1 values (1); +begin; +select * from t1 for update; + +connection con2; +select (@before:=unix_timestamp())*0; # always give repeatable output +begin; +send select * from t1 for update; + +connection con3; +insert into t2 values (20); + +connection con2; +--error 1205 +reap; +select (@after:=unix_timestamp())*0; # always give repeatable output +# verify that innodb_lock_wait_timeout was exceeded. When there was +# the bug, the reap would return immediately after the insert into t2. +select (@after-@before) >= 2; + +# cleanup drop table t1,t2; diff --git a/sql/log.cc b/sql/log.cc index fee77b38f21..aa5d9d8753b 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -1254,7 +1254,8 @@ bool MYSQL_LOG::write(Log_event* event_info) if (flush_io_cache(file)) goto err; - if (opt_using_transactions && !my_b_tell(&thd->transaction.trans_log)) + if (opt_using_transactions && + !(thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN))) { /* LOAD DATA INFILE in AUTOCOMMIT=1 mode writes to the binlog From 7f3749c82ff55deb4f25626084b242ce6c2306e1 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 4 Nov 2004 21:26:36 +0300 Subject: [PATCH 0108/1063] Fix for Bug#6408 "configure checking for custom zlib fails because code check is wrong". acinclude.m4: Fix for Bug#6408 "configure checking for custom zlib fails because code check is wrong". AC_TRY_LINK needs something it can put into main() as its second argument. Apparently everything worked before because gcc supports nested functions. --- acinclude.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/acinclude.m4 b/acinclude.m4 index 7f25b447f10..671e279a9f3 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -208,7 +208,7 @@ INCLUDES="$INCLUDES $ZLIB_INCLUDES" LIBS="$LIBS $ZLIB_LIBS" AC_CACHE_VAL([mysql_cv_compress], [AC_TRY_LINK([#include ], - [int link_test() { return compress(0, (unsigned long*) 0, "", 0); }], + [return compress(0, (unsigned long*) 0, "", 0);], [mysql_cv_compress="yes" AC_MSG_RESULT([ok])], [mysql_cv_compress="no"]) From c7b5a8d7b14832b6257d6c410f7c6e8d37536617 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 5 Nov 2004 00:45:41 +0300 Subject: [PATCH 0109/1063] A test case for Bug#4172 "Floating point conversion looses precision (prepared staements)": adding the test case to close the bug (the bug was fixed along with other conversion incompatibilities in 4.1.7) tests/client_test.c: A test case for Bug#4172: "Floating point conversion loses precision (prepared staements)" Fix memleak. --- tests/client_test.c | 67 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) diff --git a/tests/client_test.c b/tests/client_test.c index 227f7e29ef2..004f076c6df 100644 --- a/tests/client_test.c +++ b/tests/client_test.c @@ -11082,12 +11082,77 @@ static void test_bug6096() free(bind[i].buffer); mysql_stmt_close(stmt); mysql_free_result(query_result); + mysql_free_result(stmt_metadata); stmt_text= "drop table t1"; rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text)); myquery(rc); } +static void test_bug4172() +{ + MYSQL_STMT *stmt; + MYSQL_BIND bind[3]; + const char *stmt_text; + MYSQL_RES *res; + MYSQL_ROW row; + int rc; + char f[100], d[100], e[100]; + long f_len, d_len, e_len; + + myheader("test_bug4172"); + + mysql_query(mysql, "DROP TABLE IF EXISTS t1"); + mysql_query(mysql, "CREATE TABLE t1 (f float, d double, e decimal(10,4))"); + mysql_query(mysql, "INSERT INTO t1 VALUES (12345.1234, 123456.123456, " + "123456.1234)"); + + stmt= mysql_stmt_init(mysql); + stmt_text= "SELECT f, d, e FROM t1"; + + rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text)); + check_execute(stmt, rc); + rc= mysql_stmt_execute(stmt); + check_execute(stmt, rc); + + bzero(bind, sizeof(bind)); + bind[0].buffer_type= MYSQL_TYPE_STRING; + bind[0].buffer= f; + bind[0].buffer_length= sizeof(f); + bind[0].length= &f_len; + bind[1].buffer_type= MYSQL_TYPE_STRING; + bind[1].buffer= d; + bind[1].buffer_length= sizeof(d); + bind[1].length= &d_len; + bind[2].buffer_type= MYSQL_TYPE_STRING; + bind[2].buffer= e; + bind[2].buffer_length= sizeof(e); + bind[2].length= &e_len; + + mysql_stmt_bind_result(stmt, bind); + + mysql_stmt_store_result(stmt); + rc= mysql_stmt_fetch(stmt); + check_execute(stmt, rc); + + rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text)); + myquery(rc); + res= mysql_store_result(mysql); + row= mysql_fetch_row(res); + + printf("Binary protocol: float=%s, double=%s, decimal(10,4)=%s\n", + f, d, e); + printf("Text protocol: float=%s, double=%s, decimal(10,4)=%s\n", + row[0], row[1], row[2]); + + DIE_UNLESS(!strcmp(f, row[0]) && !strcmp(d, row[1]) && !strcmp(e, row[2])); + + mysql_free_result(res); + mysql_stmt_close(stmt); +} + + + /* Read and parse arguments and MySQL options from my.cnf */ @@ -11404,6 +11469,8 @@ int main(int argc, char **argv) test_bug6046(); /* NATURAL JOIN transformation works in PS */ test_bug6081(); /* test of mysql_create_db()/mysql_rm_db() */ test_bug6096(); /* max_length for numeric columns */ + test_bug4172(); /* floating point conversions in libmysql */ + /* XXX: PLEASE RUN THIS PROGRAM UNDER VALGRIND AND VERIFY THAT YOUR TEST DOESN'T CONTAIN WARNINGS/ERRORS BEFORE YOU PUSH. From c52f3942a8ec10761594788c2c906706aa74b536 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 5 Nov 2004 08:08:38 +0400 Subject: [PATCH 0110/1063] mysqladmin.c: Missing initialized for "lengths" element. , client/mysqladmin.c: Missing initialized for "lengths" element. , --- client/mysqladmin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/mysqladmin.c b/client/mysqladmin.c index bccbf29ef83..6258b9685a5 100644 --- a/client/mysqladmin.c +++ b/client/mysqladmin.c @@ -108,7 +108,7 @@ static const char *command_names[]= { }; static TYPELIB command_typelib= -{ array_elements(command_names)-1,"commands", command_names}; +{ array_elements(command_names)-1,"commands", command_names, NULL}; static struct my_option my_long_options[] = { From 62ded37e365041e315f0f6317bdeda99f7a55ad0 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 4 Nov 2004 20:39:52 -0800 Subject: [PATCH 0111/1063] func_in.result, func_in.test: Added a case for bug #6365. item_cmpfunc.cc: Fixed bug #6365 : Server crashed when list of values in IN predicate contains NULL while the tested field is of the character type and not of the default set; e.g. when f in 'f IN (NULL,'aa') belongs to binary character set, while the default character set is latin1. sql/item_cmpfunc.cc: Fixed bug #6365 : Server crash when list of values in IN predicate contains NULL while the tested field is of the character type of not of the default set e.g. when f in 'f IN (NULL,'aa') belongs to binary character set, while the default character set is latin1. mysql-test/t/func_in.test: Added a case for bug #6365. mysql-test/r/func_in.result: Added a case for bug #6365. --- mysql-test/r/func_in.result | 6 ++++++ mysql-test/t/func_in.test | 7 +++++++ sql/item_cmpfunc.cc | 3 ++- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/func_in.result b/mysql-test/r/func_in.result index 374affce8c5..daeda51a12a 100644 --- a/mysql-test/r/func_in.result +++ b/mysql-test/r/func_in.result @@ -179,3 +179,9 @@ select 1 in ('1.1',2); select 1 in ('1.1',2.0); 1 in ('1.1',2.0) 0 +create table t1 (a char(20) character set binary); +insert into t1 values ('aa'), ('bb'); +select * from t1 where a in (NULL, 'aa'); +a +aa +drop table t1; diff --git a/mysql-test/t/func_in.test b/mysql-test/t/func_in.test index 22079377ad2..3cd8c064817 100644 --- a/mysql-test/t/func_in.test +++ b/mysql-test/t/func_in.test @@ -89,3 +89,10 @@ select 1 in ('1.0',2.0); select 1 in (1.0,'2.0'); select 1 in ('1.1',2); select 1 in ('1.1',2.0); + +# Test case for bug #6365 + +create table t1 (a char(20) character set binary); +insert into t1 values ('aa'), ('bb'); +select * from t1 where a in (NULL, 'aa'); +drop table t1; diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index 701894cacb5..a28f0f5d4a9 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -1749,7 +1749,8 @@ void Item_func_in::fix_length_and_dec() thd->set_n_backup_item_arena(arena, &backup); for (arg= args+1, arg_end= args+arg_count; arg < arg_end; arg++) { - if (!my_charset_same(cmp_collation.collation, + if (!arg[0]->null_value && + !my_charset_same(cmp_collation.collation, arg[0]->collation.collation)) { Item_string *conv; From 0a4984a4305c8088761e57d9cb8fb728f1913313 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 5 Nov 2004 08:44:40 +0400 Subject: [PATCH 0112/1063] libmysql.def, libmysql.c: Minor clean-ups libmysql/libmysql.c: Minor clean-ups libmysql/libmysql.def: bk commit --- libmysql/libmysql.c | 3 ++- libmysql/libmysql.def | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index 88f46ce19e7..a57c82e6424 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -1563,7 +1563,8 @@ void my_net_local_init(NET *net) trailing '. The caller must supply whichever of those is desired. */ -ulong mysql_hex_string(char *to, const char *from, ulong length) +ulong STDCALL +mysql_hex_string(char *to, const char *from, ulong length) { char *to0= to; const char *end; diff --git a/libmysql/libmysql.def b/libmysql/libmysql.def index bc91e90a41c..c9ff70f208d 100644 --- a/libmysql/libmysql.def +++ b/libmysql/libmysql.def @@ -47,6 +47,7 @@ EXPORTS mysql_errno mysql_error mysql_escape_string + mysql_hex_string mysql_stmt_execute mysql_stmt_fetch mysql_stmt_fetch_column From 85941cf54304e6b10ff56eb93766536682792312 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 5 Nov 2004 08:54:52 +0400 Subject: [PATCH 0113/1063] mysqldump.c: - 'mysqldump --help' comment that --xeh-blob doesn't work with --extended-inserts was removed. It does work now. Thanks to Lachlan who noticed this wrong help message. - Switched to use the recently introduced mysql_hex_string() instead of slow sprintf(). Thanks to Sinisa for the idea. - 'mysqldump --hex-blob' dumps in HEX not only BLOBs but also BINARY(x) columns. Thanks to Paul. client/mysqldump.c: - comment that --xeh-blob doesn't work with --extended-inserts was removed. It does work now. - Switched to use recently introduced mysql_hex_string() instead of sprintf() - BINARY(x) are dumped in HEX too --- client/mysqldump.c | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/client/mysqldump.c b/client/mysqldump.c index 1686278096b..a8db8ab440b 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -124,7 +124,7 @@ const char *compatible_mode_names[]= (1<<10) /* ANSI */\ ) TYPELIB compatible_mode_typelib= {array_elements(compatible_mode_names) - 1, - "", compatible_mode_names}; + "", compatible_mode_names, NULL}; static struct my_option my_long_options[] = @@ -317,7 +317,7 @@ static struct my_option my_long_options[] = {"comments", 'i', "Write additional information.", (gptr*) &opt_comments, (gptr*) &opt_comments, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, - {"hex-blob", OPT_HEXBLOB, "Dump BLOBs in HEX. this mode does not work with extended-insert", + {"hex-blob", OPT_HEXBLOB, "Dump BLOBs in HEX.", (gptr*) &opt_hex_blob, (gptr*) &opt_hex_blob, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} }; @@ -1523,10 +1523,11 @@ static void dumpTable(uint numFields, char *table) /* 63 is my_charset_bin. If charsetnr is not 63, we have not a BLOB but a TEXT column. - we'll dump it in hex only BLOB columns. + we'll dump in hex only BLOB columns. */ is_blob= (opt_hex_blob && field->charsetnr == 63 && - (field->type == FIELD_TYPE_BLOB || + (field->type == FIELD_TYPE_STRING || + field->type == FIELD_TYPE_BLOB || field->type == FIELD_TYPE_LONG_BLOB || field->type == FIELD_TYPE_MEDIUM_BLOB || field->type == FIELD_TYPE_TINY_BLOB)) ? 1 : 0; @@ -1544,6 +1545,13 @@ static void dumpTable(uint numFields, char *table) { if (!IS_NUM_FIELD(field)) { + /* + "length * 2 + 2" is OK for both HEX and non-HEX modes: + - In HEX mode we need exactly 2 bytes per character + plus 2 bytes for '0x' prefix. + - In non-HEX mode we need up to 2 bytes per character, + plus 2 bytes for leading and trailing '\'' characters. + */ if (dynstr_realloc(&extended_row,length * 2+2)) { fputs("Aborting dump (out of memory)",stderr); @@ -1552,15 +1560,11 @@ static void dumpTable(uint numFields, char *table) } if (opt_hex_blob && is_blob) { - ulong counter; - unsigned char *ptr= row[i]; dynstr_append(&extended_row, "0x"); - for (counter = 0; counter < lengths[i]; counter++) - { - char xx[3]; - sprintf(xx, "%02X", ptr[counter]); - dynstr_append(&extended_row, xx); - } + extended_row.length+= mysql_hex_string(extended_row.str + + extended_row.length, + row[i], length); + extended_row.str[extended_row.length]= '\0'; } else { From 1ba0ad70765e0f1f3d5ec0109f89165acb7dd262 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 5 Nov 2004 09:00:04 +0400 Subject: [PATCH 0114/1063] libmysql.def, libmysql.c: Clean-ups libmysql/libmysql.c: Clean-ups libmysql/libmysql.def: Clean-ups , --- libmysql/libmysql.c | 2 +- libmysql/libmysql.def | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index 9257bf0efd0..2257ae739eb 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -3170,7 +3170,7 @@ void my_net_local_init(NET *net) encoded string, not including the terminating null character. */ -unsigned long +ulong STDCALL mysql_hex_string(char *to, const char *from, unsigned long length) { char *to0= to; diff --git a/libmysql/libmysql.def b/libmysql/libmysql.def index b0433a34cb3..51a4edda5aa 100644 --- a/libmysql/libmysql.def +++ b/libmysql/libmysql.def @@ -11,6 +11,7 @@ EXPORTS mysql_errno mysql_error mysql_escape_string + mysql_hex_string mysql_fetch_field mysql_fetch_field_direct mysql_fetch_fields From 2f2eceacb18d348332395f82845e50fe5db79e99 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 5 Nov 2004 09:07:07 +0400 Subject: [PATCH 0115/1063] libmysql.c: After-merge clean-up libmysql/libmysql.c: After-merge clean-up --- libmysql/libmysql.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index 2250111f5a0..47f28e296b2 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -3173,7 +3173,8 @@ void my_net_local_init(NET *net) trailing '. The caller must supply whichever of those is desired. */ -ulong mysql_hex_string(char *to, const char *from, ulong length) +ulong STDCALL +mysql_hex_string(char *to, const char *from, ulong length) { char *to0= to; const char *end; From 7d0a67d6285e60885f58a3bf2998e9b3d84bbc94 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 5 Nov 2004 09:23:53 +0400 Subject: [PATCH 0116/1063] client_priv.h: Backport --hex-blob to 4.0 client/client_priv.h: Backport --hex-blob to 4.0 --- client/client_priv.h | 3 ++- client/mysqldump.c | 56 ++++++++++++++++++++++++++++++++++++++------ 2 files changed, 51 insertions(+), 8 deletions(-) diff --git a/client/client_priv.h b/client/client_priv.h index 5029f219494..016c9e5ee80 100644 --- a/client/client_priv.h +++ b/client/client_priv.h @@ -38,4 +38,5 @@ enum options_client { OPT_CHARSETS_DIR=256, OPT_DEFAULT_CHARSET, OPT_SSL_KEY, OPT_SSL_CERT, OPT_SSL_CA, OPT_SSL_CAPATH, OPT_SSL_CIPHER, OPT_SHUTDOWN_TIMEOUT, OPT_LOCAL_INFILE, OPT_DELETE_MASTER_LOGS, - OPT_PROMPT, OPT_IGN_LINES,OPT_TRANSACTION, OPT_FRM }; + OPT_PROMPT, OPT_IGN_LINES,OPT_TRANSACTION, OPT_FRM, + OPT_HEXBLOB }; diff --git a/client/mysqldump.c b/client/mysqldump.c index 49822f0bee0..a78eee3794a 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -78,7 +78,8 @@ static my_bool verbose=0,tFlag=0,cFlag=0,dFlag=0,quick=0, extended_insert = 0, opt_alldbs=0,opt_create_db=0,opt_first_slave=0, opt_autocommit=0,opt_master_data,opt_disable_keys=0,opt_xml=0, opt_delete_master_logs=0, tty_password=0, - opt_single_transaction=0, opt_comments= 0; + opt_single_transaction=0, opt_comments= 0, + opt_hex_blob; static ulong opt_max_allowed_packet, opt_net_buffer_length; static MYSQL mysql_connection,*sock=0; static char insert_pat[12 * 1024],*opt_password=0,*current_user=0, @@ -248,6 +249,8 @@ static struct my_option my_long_options[] = {"comments", 'i', "Write additional information.", (gptr*) &opt_comments, (gptr*) &opt_comments, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, + {"hex-blob", OPT_HEXBLOB, "Dump BLOBs in HEX.", + (gptr*) &opt_hex_blob, (gptr*) &opt_hex_blob, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} }; @@ -1104,6 +1107,7 @@ static void dumpTable(uint numFields, char *table) for (i = 0; i < mysql_num_fields(res); i++) { + int is_blob; if (!(field = mysql_fetch_field(res))) { sprintf(query,"%s: Not enough fields from table %s! Aborting.\n", @@ -1112,6 +1116,13 @@ static void dumpTable(uint numFields, char *table) error= EX_CONSCHECK; goto err; } + + is_blob= (opt_hex_blob && (field->flags & BINARY_FLAG) && + (field->type == FIELD_TYPE_STRING || + field->type == FIELD_TYPE_BLOB || + field->type == FIELD_TYPE_LONG_BLOB || + field->type == FIELD_TYPE_MEDIUM_BLOB || + field->type == FIELD_TYPE_TINY_BLOB)) ? 1 : 0; if (extended_insert) { ulong length = lengths[i]; @@ -1126,18 +1137,37 @@ static void dumpTable(uint numFields, char *table) { if (!IS_NUM_FIELD(field)) { + /* + "length * 2 + 2" is OK for both HEX and non-HEX modes: + - In HEX mode we need exactly 2 bytes per character + plus 2 bytes for '0x' prefix. + - In non-HEX mode we need up to 2 bytes per character, + plus 2 bytes for leading and trailing '\'' characters. + */ if (dynstr_realloc(&extended_row,length * 2+2)) { fputs("Aborting dump (out of memory)",stderr); error= EX_EOM; goto err; } - dynstr_append(&extended_row,"\'"); - extended_row.length += + if (opt_hex_blob && is_blob) + { + dynstr_append(&extended_row, "0x"); + extended_row.length+= mysql_hex_string(extended_row.str + + extended_row.length, + row[i], length); + extended_row.str[extended_row.length]= '\0'; + } + else + { + dynstr_append(&extended_row,"\'"); + extended_row.length += mysql_real_escape_string(&mysql_connection, - &extended_row.str[extended_row.length],row[i],length); - extended_row.str[extended_row.length]='\0'; - dynstr_append(&extended_row,"\'"); + &extended_row.str[extended_row.length], + row[i],length); + extended_row.str[extended_row.length]='\0'; + dynstr_append(&extended_row,"\'"); + } } else { @@ -1180,7 +1210,19 @@ static void dumpTable(uint numFields, char *table) if (opt_xml) print_quoted_xml(md_result_file, field->name, row[i], lengths[i]); - else + else if (opt_hex_blob && is_blob) + { /* sakaik got this idea. */ + ulong counter; + char xx[4]; + unsigned char *ptr= row[i]; + fputs("0x", md_result_file); + for (counter = 0; counter < lengths[i]; counter++) + { + sprintf(xx, "%02X", ptr[counter]); + fputs(xx, md_result_file); + } + } + else unescape(md_result_file, row[i], lengths[i]); } else From 8264d83dfae9616c0382b5bbc2c773ad3d129b92 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 5 Nov 2004 10:12:33 +0400 Subject: [PATCH 0117/1063] ps.result, ctype_ucs.result, ctype_ucs.test, ps.test: Bug #6351 make test failure "Unknown character set" UCS2 related tests were moved into ctype_ucs. mysql-test/t/ps.test: Bug #6351 make test failure "Unknown character set" UCS2 related tests were moved into ctype_ucs. Bug #6351 make test failure "Unknown character set" UCS2 related tests were moved into ctype_ucs. mysql-test/t/ctype_ucs.test: Bug #6351 make test failure "Unknown character set" UCS2 related tests were moved into ctype_ucs. mysql-test/r/ctype_ucs.result: Bug #6351 make test failure "Unknown character set" UCS2 related tests were moved into ctype_ucs. mysql-test/r/ps.result: Bug #6351 make test failure "Unknown character set" UCS2 related tests were moved into ctype_ucs. --- mysql-test/r/ctype_ucs.result | 7 +++++++ mysql-test/r/ps.result | 6 ------ mysql-test/t/ctype_ucs.test | 8 ++++++++ mysql-test/t/ps.test | 4 ---- 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/mysql-test/r/ctype_ucs.result b/mysql-test/r/ctype_ucs.result index 1d3deb0b09a..0e36b00a670 100644 --- a/mysql-test/r/ctype_ucs.result +++ b/mysql-test/r/ctype_ucs.result @@ -480,3 +480,10 @@ a 0061 b 0062 c 0063 drop table t1; +set @ivar= 1234; +set @str1 = 'select ?'; +set @str2 = convert(@str1 using ucs2); +prepare stmt1 from @str2; +execute stmt1 using @ivar; +? +1234 diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result index 6cad58282a2..6d9cfabb5a7 100644 --- a/mysql-test/r/ps.result +++ b/mysql-test/r/ps.result @@ -106,12 +106,6 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp set @fvar= 123.4567; prepare stmt1 from @fvar; ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '123.4567' at line 1 -set @str1 = 'select ?'; -set @str2 = convert(@str1 using ucs2); -prepare stmt1 from @str2; -execute stmt1 using @ivar; -? -1234 drop table t1,t2; PREPARE stmt1 FROM "select _utf8 'A' collate utf8_bin = ?"; set @var='A'; diff --git a/mysql-test/t/ctype_ucs.test b/mysql-test/t/ctype_ucs.test index d9ef91496e9..4c6d1bbebef 100644 --- a/mysql-test/t/ctype_ucs.test +++ b/mysql-test/t/ctype_ucs.test @@ -315,3 +315,11 @@ alter table t1 modify a char(5); select a, hex(a) from t1; drop table t1; +# +# Check prepare statement from an UCS2 string +# +set @ivar= 1234; +set @str1 = 'select ?'; +set @str2 = convert(@str1 using ucs2); +prepare stmt1 from @str2; +execute stmt1 using @ivar; diff --git a/mysql-test/t/ps.test b/mysql-test/t/ps.test index 978ce2bc2c3..2b3e961fc28 100644 --- a/mysql-test/t/ps.test +++ b/mysql-test/t/ps.test @@ -110,10 +110,6 @@ set @fvar= 123.4567; --error 1064 prepare stmt1 from @fvar; -set @str1 = 'select ?'; -set @str2 = convert(@str1 using ucs2); -prepare stmt1 from @str2; -execute stmt1 using @ivar; drop table t1,t2; # From aee1e78aa1e0be37acd9640dfb48f63200a7d0ef Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 5 Nov 2004 13:37:36 +0400 Subject: [PATCH 0118/1063] As it is wrong and confusing to associate any character set with NULL, @a should be latin2 after this query sequence: SET @a=_latin2'string'; SET @a=NULL; I.e. the second query should not change the charset to the current default value, but should keep the original value assigned during the first query. In order to do it, we don't copy charset from the argument if the argument is NULL and the variable has previously been initialized. mysql-test/r/ps_6bdb.result: t mysql-test/r/ps_5merge.result: t mysql-test/r/ps_3innodb.result: t mysql-test/r/ps_7ndb.result: t mysql-test/r/ps_4heap.result: t mysql-test/r/ps_2myisam.result: t sql/item_func.cc: t --- mysql-test/r/ps_2myisam.result | 76 ++++++++--------- mysql-test/r/ps_3innodb.result | 76 ++++++++--------- mysql-test/r/ps_4heap.result | 108 +++++++++++------------ mysql-test/r/ps_5merge.result | 152 ++++++++++++++++----------------- mysql-test/r/ps_6bdb.result | 76 ++++++++--------- mysql-test/r/ps_7ndb.result | 108 +++++++++++------------ sql/item_func.cc | 21 ++++- 7 files changed, 317 insertions(+), 300 deletions(-) diff --git a/mysql-test/r/ps_2myisam.result b/mysql-test/r/ps_2myisam.result index efb12561950..345929d8104 100644 --- a/mysql-test/r/ps_2myisam.result +++ b/mysql-test/r/ps_2myisam.result @@ -1793,7 +1793,7 @@ t5 CREATE TABLE `t5` ( `const12` char(0) default NULL, `param12` bigint(20) default NULL, `param13` double default NULL, - `param14` longblob, + `param14` longtext, `param15` longblob ) ENGINE=MyISAM DEFAULT CHARSET=latin1 select * from t5 ; @@ -1823,7 +1823,7 @@ def test t5 t5 param11 param11 8 20 4 Y 32768 0 63 def test t5 t5 const12 const12 254 0 0 Y 0 0 8 def test t5 t5 param12 param12 8 20 0 Y 32768 0 63 def test t5 t5 param13 param13 5 20 0 Y 32768 31 63 -def test t5 t5 param14 param14 252 16777215 0 Y 144 0 63 +def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8 def test t5 t5 param15 param15 252 16777215 0 Y 144 0 63 const01 8 param01 8 @@ -1976,19 +1976,19 @@ def @arg16 254 8192 0 Y 128 31 63 def @arg17 254 20 0 Y 128 31 63 def @arg18 254 20 0 Y 128 31 63 def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 128 31 63 -def @arg21 254 8192 0 Y 128 31 63 -def @arg22 254 8192 0 Y 128 31 63 +def @arg20 254 8192 0 Y 0 31 8 +def @arg21 254 8192 0 Y 0 31 8 +def @arg22 254 8192 0 Y 0 31 8 def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 0 31 8 def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 0 31 8 def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 0 31 8 def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 128 31 63 -def @arg31 254 8192 0 Y 128 31 63 -def @arg32 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 0 31 8 +def @arg31 254 8192 0 Y 0 31 8 +def @arg32 254 8192 0 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL prepare stmt1 from "select @@ -2066,19 +2066,19 @@ def @arg16 254 8192 0 Y 128 31 63 def @arg17 254 20 0 Y 128 31 63 def @arg18 254 20 0 Y 128 31 63 def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 128 31 63 -def @arg21 254 8192 0 Y 128 31 63 -def @arg22 254 8192 0 Y 128 31 63 +def @arg20 254 8192 0 Y 0 31 8 +def @arg21 254 8192 0 Y 0 31 8 +def @arg22 254 8192 0 Y 0 31 8 def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 0 31 8 def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 0 31 8 def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 0 31 8 def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 128 31 63 -def @arg31 254 8192 0 Y 128 31 63 -def @arg32 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 0 31 8 +def @arg31 254 8192 0 Y 0 31 8 +def @arg32 254 8192 0 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL prepare stmt1 from "select ? := c1 from t9 where c1= 1" ; @@ -2158,19 +2158,19 @@ def @arg16 254 8192 0 Y 128 31 63 def @arg17 254 20 0 Y 128 31 63 def @arg18 254 20 0 Y 128 31 63 def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 128 31 63 -def @arg21 254 8192 0 Y 128 31 63 -def @arg22 254 8192 0 Y 128 31 63 +def @arg20 254 8192 0 Y 0 31 8 +def @arg21 254 8192 0 Y 0 31 8 +def @arg22 254 8192 0 Y 0 31 8 def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 0 31 8 def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 0 31 8 def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 0 31 8 def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 128 31 63 -def @arg31 254 8192 0 Y 128 31 63 -def @arg32 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 0 31 8 +def @arg31 254 8192 0 Y 0 31 8 +def @arg32 254 8192 0 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL prepare stmt1 from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, @@ -2242,19 +2242,19 @@ def @arg16 254 8192 0 Y 128 31 63 def @arg17 254 20 0 Y 128 31 63 def @arg18 254 20 0 Y 128 31 63 def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 128 31 63 -def @arg21 254 8192 0 Y 128 31 63 -def @arg22 254 8192 0 Y 128 31 63 +def @arg20 254 8192 0 Y 0 31 8 +def @arg21 254 8192 0 Y 0 31 8 +def @arg22 254 8192 0 Y 0 31 8 def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 0 31 8 def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 0 31 8 def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 0 31 8 def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 128 31 63 -def @arg31 254 8192 0 Y 128 31 63 -def @arg32 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 0 31 8 +def @arg31 254 8192 0 Y 0 31 8 +def @arg32 254 8192 0 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL prepare stmt1 from "select c1 into ? from t9 where c1= 1" ; diff --git a/mysql-test/r/ps_3innodb.result b/mysql-test/r/ps_3innodb.result index cb096882d13..45a3af8e6fa 100644 --- a/mysql-test/r/ps_3innodb.result +++ b/mysql-test/r/ps_3innodb.result @@ -1776,7 +1776,7 @@ t5 CREATE TABLE `t5` ( `const12` char(0) default NULL, `param12` bigint(20) default NULL, `param13` double default NULL, - `param14` longblob, + `param14` longtext, `param15` longblob ) ENGINE=MyISAM DEFAULT CHARSET=latin1 select * from t5 ; @@ -1806,7 +1806,7 @@ def test t5 t5 param11 param11 8 20 4 Y 32768 0 63 def test t5 t5 const12 const12 254 0 0 Y 0 0 8 def test t5 t5 param12 param12 8 20 0 Y 32768 0 63 def test t5 t5 param13 param13 5 20 0 Y 32768 31 63 -def test t5 t5 param14 param14 252 16777215 0 Y 144 0 63 +def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8 def test t5 t5 param15 param15 252 16777215 0 Y 144 0 63 const01 8 param01 8 @@ -1959,19 +1959,19 @@ def @arg16 254 8192 0 Y 128 31 63 def @arg17 254 20 0 Y 128 31 63 def @arg18 254 20 0 Y 128 31 63 def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 128 31 63 -def @arg21 254 8192 0 Y 128 31 63 -def @arg22 254 8192 0 Y 128 31 63 +def @arg20 254 8192 0 Y 0 31 8 +def @arg21 254 8192 0 Y 0 31 8 +def @arg22 254 8192 0 Y 0 31 8 def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 0 31 8 def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 0 31 8 def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 0 31 8 def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 128 31 63 -def @arg31 254 8192 0 Y 128 31 63 -def @arg32 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 0 31 8 +def @arg31 254 8192 0 Y 0 31 8 +def @arg32 254 8192 0 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL prepare stmt1 from "select @@ -2049,19 +2049,19 @@ def @arg16 254 8192 0 Y 128 31 63 def @arg17 254 20 0 Y 128 31 63 def @arg18 254 20 0 Y 128 31 63 def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 128 31 63 -def @arg21 254 8192 0 Y 128 31 63 -def @arg22 254 8192 0 Y 128 31 63 +def @arg20 254 8192 0 Y 0 31 8 +def @arg21 254 8192 0 Y 0 31 8 +def @arg22 254 8192 0 Y 0 31 8 def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 0 31 8 def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 0 31 8 def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 0 31 8 def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 128 31 63 -def @arg31 254 8192 0 Y 128 31 63 -def @arg32 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 0 31 8 +def @arg31 254 8192 0 Y 0 31 8 +def @arg32 254 8192 0 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL prepare stmt1 from "select ? := c1 from t9 where c1= 1" ; @@ -2141,19 +2141,19 @@ def @arg16 254 8192 0 Y 128 31 63 def @arg17 254 20 0 Y 128 31 63 def @arg18 254 20 0 Y 128 31 63 def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 128 31 63 -def @arg21 254 8192 0 Y 128 31 63 -def @arg22 254 8192 0 Y 128 31 63 +def @arg20 254 8192 0 Y 0 31 8 +def @arg21 254 8192 0 Y 0 31 8 +def @arg22 254 8192 0 Y 0 31 8 def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 0 31 8 def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 0 31 8 def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 0 31 8 def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 128 31 63 -def @arg31 254 8192 0 Y 128 31 63 -def @arg32 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 0 31 8 +def @arg31 254 8192 0 Y 0 31 8 +def @arg32 254 8192 0 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL prepare stmt1 from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, @@ -2225,19 +2225,19 @@ def @arg16 254 8192 0 Y 128 31 63 def @arg17 254 20 0 Y 128 31 63 def @arg18 254 20 0 Y 128 31 63 def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 128 31 63 -def @arg21 254 8192 0 Y 128 31 63 -def @arg22 254 8192 0 Y 128 31 63 +def @arg20 254 8192 0 Y 0 31 8 +def @arg21 254 8192 0 Y 0 31 8 +def @arg22 254 8192 0 Y 0 31 8 def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 0 31 8 def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 0 31 8 def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 0 31 8 def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 128 31 63 -def @arg31 254 8192 0 Y 128 31 63 -def @arg32 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 0 31 8 +def @arg31 254 8192 0 Y 0 31 8 +def @arg32 254 8192 0 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL prepare stmt1 from "select c1 into ? from t9 where c1= 1" ; diff --git a/mysql-test/r/ps_4heap.result b/mysql-test/r/ps_4heap.result index ac9946ef070..995224fcd21 100644 --- a/mysql-test/r/ps_4heap.result +++ b/mysql-test/r/ps_4heap.result @@ -1777,7 +1777,7 @@ t5 CREATE TABLE `t5` ( `const12` char(0) default NULL, `param12` bigint(20) default NULL, `param13` double default NULL, - `param14` longblob, + `param14` longtext, `param15` longblob ) ENGINE=MyISAM DEFAULT CHARSET=latin1 select * from t5 ; @@ -1807,7 +1807,7 @@ def test t5 t5 param11 param11 8 20 4 Y 32768 0 63 def test t5 t5 const12 const12 254 0 0 Y 0 0 8 def test t5 t5 param12 param12 8 20 0 Y 32768 0 63 def test t5 t5 param13 param13 5 20 0 Y 32768 31 63 -def test t5 t5 param14 param14 252 16777215 0 Y 144 0 63 +def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8 def test t5 t5 param15 param15 252 16777215 0 Y 144 0 63 const01 8 param01 8 @@ -1960,19 +1960,19 @@ def @arg16 254 8192 0 Y 128 31 63 def @arg17 254 20 0 Y 128 31 63 def @arg18 254 20 0 Y 128 31 63 def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 128 31 63 -def @arg21 254 8192 0 Y 128 31 63 -def @arg22 254 8192 0 Y 128 31 63 -def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 128 31 63 -def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 128 31 63 -def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 128 31 63 -def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 128 31 63 -def @arg31 254 8192 0 Y 128 31 63 -def @arg32 254 8192 0 Y 128 31 63 +def @arg20 254 8192 0 Y 0 31 8 +def @arg21 254 8192 0 Y 0 31 8 +def @arg22 254 8192 0 Y 0 31 8 +def @arg23 254 8192 0 Y 0 31 8 +def @arg24 254 8192 0 Y 0 31 8 +def @arg25 254 8192 0 Y 0 31 8 +def @arg26 254 8192 0 Y 0 31 8 +def @arg27 254 8192 0 Y 0 31 8 +def @arg28 254 8192 0 Y 0 31 8 +def @arg29 254 8192 0 Y 0 31 8 +def @arg30 254 8192 0 Y 0 31 8 +def @arg31 254 8192 0 Y 0 31 8 +def @arg32 254 8192 0 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL prepare stmt1 from "select @@ -2050,19 +2050,19 @@ def @arg16 254 8192 0 Y 128 31 63 def @arg17 254 20 0 Y 128 31 63 def @arg18 254 20 0 Y 128 31 63 def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 128 31 63 -def @arg21 254 8192 0 Y 128 31 63 -def @arg22 254 8192 0 Y 128 31 63 -def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 128 31 63 -def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 128 31 63 -def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 128 31 63 -def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 128 31 63 -def @arg31 254 8192 0 Y 128 31 63 -def @arg32 254 8192 0 Y 128 31 63 +def @arg20 254 8192 0 Y 0 31 8 +def @arg21 254 8192 0 Y 0 31 8 +def @arg22 254 8192 0 Y 0 31 8 +def @arg23 254 8192 0 Y 0 31 8 +def @arg24 254 8192 0 Y 0 31 8 +def @arg25 254 8192 0 Y 0 31 8 +def @arg26 254 8192 0 Y 0 31 8 +def @arg27 254 8192 0 Y 0 31 8 +def @arg28 254 8192 0 Y 0 31 8 +def @arg29 254 8192 0 Y 0 31 8 +def @arg30 254 8192 0 Y 0 31 8 +def @arg31 254 8192 0 Y 0 31 8 +def @arg32 254 8192 0 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL prepare stmt1 from "select ? := c1 from t9 where c1= 1" ; @@ -2142,19 +2142,19 @@ def @arg16 254 8192 0 Y 128 31 63 def @arg17 254 20 0 Y 128 31 63 def @arg18 254 20 0 Y 128 31 63 def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 128 31 63 -def @arg21 254 8192 0 Y 128 31 63 -def @arg22 254 8192 0 Y 128 31 63 -def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 128 31 63 -def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 128 31 63 -def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 128 31 63 -def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 128 31 63 -def @arg31 254 8192 0 Y 128 31 63 -def @arg32 254 8192 0 Y 128 31 63 +def @arg20 254 8192 0 Y 0 31 8 +def @arg21 254 8192 0 Y 0 31 8 +def @arg22 254 8192 0 Y 0 31 8 +def @arg23 254 8192 0 Y 0 31 8 +def @arg24 254 8192 0 Y 0 31 8 +def @arg25 254 8192 0 Y 0 31 8 +def @arg26 254 8192 0 Y 0 31 8 +def @arg27 254 8192 0 Y 0 31 8 +def @arg28 254 8192 0 Y 0 31 8 +def @arg29 254 8192 0 Y 0 31 8 +def @arg30 254 8192 0 Y 0 31 8 +def @arg31 254 8192 0 Y 0 31 8 +def @arg32 254 8192 0 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL prepare stmt1 from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, @@ -2226,19 +2226,19 @@ def @arg16 254 8192 0 Y 128 31 63 def @arg17 254 20 0 Y 128 31 63 def @arg18 254 20 0 Y 128 31 63 def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 128 31 63 -def @arg21 254 8192 0 Y 128 31 63 -def @arg22 254 8192 0 Y 128 31 63 -def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 128 31 63 -def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 128 31 63 -def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 128 31 63 -def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 128 31 63 -def @arg31 254 8192 0 Y 128 31 63 -def @arg32 254 8192 0 Y 128 31 63 +def @arg20 254 8192 0 Y 0 31 8 +def @arg21 254 8192 0 Y 0 31 8 +def @arg22 254 8192 0 Y 0 31 8 +def @arg23 254 8192 0 Y 0 31 8 +def @arg24 254 8192 0 Y 0 31 8 +def @arg25 254 8192 0 Y 0 31 8 +def @arg26 254 8192 0 Y 0 31 8 +def @arg27 254 8192 0 Y 0 31 8 +def @arg28 254 8192 0 Y 0 31 8 +def @arg29 254 8192 0 Y 0 31 8 +def @arg30 254 8192 0 Y 0 31 8 +def @arg31 254 8192 0 Y 0 31 8 +def @arg32 254 8192 0 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL prepare stmt1 from "select c1 into ? from t9 where c1= 1" ; diff --git a/mysql-test/r/ps_5merge.result b/mysql-test/r/ps_5merge.result index 15e707959ca..7a0191b186a 100644 --- a/mysql-test/r/ps_5merge.result +++ b/mysql-test/r/ps_5merge.result @@ -1716,7 +1716,7 @@ t5 CREATE TABLE `t5` ( `const12` char(0) default NULL, `param12` bigint(20) default NULL, `param13` double default NULL, - `param14` longblob, + `param14` longtext, `param15` longblob ) ENGINE=MyISAM DEFAULT CHARSET=latin1 select * from t5 ; @@ -1746,7 +1746,7 @@ def test t5 t5 param11 param11 8 20 4 Y 32768 0 63 def test t5 t5 const12 const12 254 0 0 Y 0 0 8 def test t5 t5 param12 param12 8 20 0 Y 32768 0 63 def test t5 t5 param13 param13 5 20 0 Y 32768 31 63 -def test t5 t5 param14 param14 252 16777215 0 Y 144 0 63 +def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8 def test t5 t5 param15 param15 252 16777215 0 Y 144 0 63 const01 8 param01 8 @@ -1899,19 +1899,19 @@ def @arg16 254 8192 0 Y 128 31 63 def @arg17 254 20 0 Y 128 31 63 def @arg18 254 20 0 Y 128 31 63 def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 128 31 63 -def @arg21 254 8192 0 Y 128 31 63 -def @arg22 254 8192 0 Y 128 31 63 +def @arg20 254 8192 0 Y 0 31 8 +def @arg21 254 8192 0 Y 0 31 8 +def @arg22 254 8192 0 Y 0 31 8 def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 0 31 8 def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 0 31 8 def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 0 31 8 def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 128 31 63 -def @arg31 254 8192 0 Y 128 31 63 -def @arg32 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 0 31 8 +def @arg31 254 8192 0 Y 0 31 8 +def @arg32 254 8192 0 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL prepare stmt1 from "select @@ -1989,19 +1989,19 @@ def @arg16 254 8192 0 Y 128 31 63 def @arg17 254 20 0 Y 128 31 63 def @arg18 254 20 0 Y 128 31 63 def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 128 31 63 -def @arg21 254 8192 0 Y 128 31 63 -def @arg22 254 8192 0 Y 128 31 63 +def @arg20 254 8192 0 Y 0 31 8 +def @arg21 254 8192 0 Y 0 31 8 +def @arg22 254 8192 0 Y 0 31 8 def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 0 31 8 def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 0 31 8 def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 0 31 8 def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 128 31 63 -def @arg31 254 8192 0 Y 128 31 63 -def @arg32 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 0 31 8 +def @arg31 254 8192 0 Y 0 31 8 +def @arg32 254 8192 0 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL prepare stmt1 from "select ? := c1 from t9 where c1= 1" ; @@ -2081,19 +2081,19 @@ def @arg16 254 8192 0 Y 128 31 63 def @arg17 254 20 0 Y 128 31 63 def @arg18 254 20 0 Y 128 31 63 def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 128 31 63 -def @arg21 254 8192 0 Y 128 31 63 -def @arg22 254 8192 0 Y 128 31 63 +def @arg20 254 8192 0 Y 0 31 8 +def @arg21 254 8192 0 Y 0 31 8 +def @arg22 254 8192 0 Y 0 31 8 def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 0 31 8 def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 0 31 8 def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 0 31 8 def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 128 31 63 -def @arg31 254 8192 0 Y 128 31 63 -def @arg32 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 0 31 8 +def @arg31 254 8192 0 Y 0 31 8 +def @arg32 254 8192 0 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL prepare stmt1 from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, @@ -2165,19 +2165,19 @@ def @arg16 254 8192 0 Y 128 31 63 def @arg17 254 20 0 Y 128 31 63 def @arg18 254 20 0 Y 128 31 63 def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 128 31 63 -def @arg21 254 8192 0 Y 128 31 63 -def @arg22 254 8192 0 Y 128 31 63 +def @arg20 254 8192 0 Y 0 31 8 +def @arg21 254 8192 0 Y 0 31 8 +def @arg22 254 8192 0 Y 0 31 8 def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 0 31 8 def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 0 31 8 def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 0 31 8 def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 128 31 63 -def @arg31 254 8192 0 Y 128 31 63 -def @arg32 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 0 31 8 +def @arg31 254 8192 0 Y 0 31 8 +def @arg32 254 8192 0 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL prepare stmt1 from "select c1 into ? from t9 where c1= 1" ; @@ -4726,7 +4726,7 @@ t5 CREATE TABLE `t5` ( `const12` char(0) default NULL, `param12` bigint(20) default NULL, `param13` double default NULL, - `param14` longblob, + `param14` longtext, `param15` longblob ) ENGINE=MyISAM DEFAULT CHARSET=latin1 select * from t5 ; @@ -4756,7 +4756,7 @@ def test t5 t5 param11 param11 8 20 4 Y 32768 0 63 def test t5 t5 const12 const12 254 0 0 Y 0 0 8 def test t5 t5 param12 param12 8 20 0 Y 32768 0 63 def test t5 t5 param13 param13 5 20 0 Y 32768 31 63 -def test t5 t5 param14 param14 252 16777215 0 Y 144 0 63 +def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8 def test t5 t5 param15 param15 252 16777215 0 Y 144 0 63 const01 8 param01 8 @@ -4909,19 +4909,19 @@ def @arg16 254 8192 0 Y 128 31 63 def @arg17 254 20 0 Y 128 31 63 def @arg18 254 20 0 Y 128 31 63 def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 128 31 63 -def @arg21 254 8192 0 Y 128 31 63 -def @arg22 254 8192 0 Y 128 31 63 +def @arg20 254 8192 0 Y 0 31 8 +def @arg21 254 8192 0 Y 0 31 8 +def @arg22 254 8192 0 Y 0 31 8 def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 0 31 8 def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 0 31 8 def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 0 31 8 def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 128 31 63 -def @arg31 254 8192 0 Y 128 31 63 -def @arg32 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 0 31 8 +def @arg31 254 8192 0 Y 0 31 8 +def @arg32 254 8192 0 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL prepare stmt1 from "select @@ -4999,19 +4999,19 @@ def @arg16 254 8192 0 Y 128 31 63 def @arg17 254 20 0 Y 128 31 63 def @arg18 254 20 0 Y 128 31 63 def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 128 31 63 -def @arg21 254 8192 0 Y 128 31 63 -def @arg22 254 8192 0 Y 128 31 63 +def @arg20 254 8192 0 Y 0 31 8 +def @arg21 254 8192 0 Y 0 31 8 +def @arg22 254 8192 0 Y 0 31 8 def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 0 31 8 def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 0 31 8 def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 0 31 8 def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 128 31 63 -def @arg31 254 8192 0 Y 128 31 63 -def @arg32 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 0 31 8 +def @arg31 254 8192 0 Y 0 31 8 +def @arg32 254 8192 0 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL prepare stmt1 from "select ? := c1 from t9 where c1= 1" ; @@ -5091,19 +5091,19 @@ def @arg16 254 8192 0 Y 128 31 63 def @arg17 254 20 0 Y 128 31 63 def @arg18 254 20 0 Y 128 31 63 def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 128 31 63 -def @arg21 254 8192 0 Y 128 31 63 -def @arg22 254 8192 0 Y 128 31 63 +def @arg20 254 8192 0 Y 0 31 8 +def @arg21 254 8192 0 Y 0 31 8 +def @arg22 254 8192 0 Y 0 31 8 def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 0 31 8 def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 0 31 8 def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 0 31 8 def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 128 31 63 -def @arg31 254 8192 0 Y 128 31 63 -def @arg32 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 0 31 8 +def @arg31 254 8192 0 Y 0 31 8 +def @arg32 254 8192 0 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL prepare stmt1 from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, @@ -5175,19 +5175,19 @@ def @arg16 254 8192 0 Y 128 31 63 def @arg17 254 20 0 Y 128 31 63 def @arg18 254 20 0 Y 128 31 63 def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 128 31 63 -def @arg21 254 8192 0 Y 128 31 63 -def @arg22 254 8192 0 Y 128 31 63 +def @arg20 254 8192 0 Y 0 31 8 +def @arg21 254 8192 0 Y 0 31 8 +def @arg22 254 8192 0 Y 0 31 8 def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 0 31 8 def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 0 31 8 def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 0 31 8 def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 128 31 63 -def @arg31 254 8192 0 Y 128 31 63 -def @arg32 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 0 31 8 +def @arg31 254 8192 0 Y 0 31 8 +def @arg32 254 8192 0 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL prepare stmt1 from "select c1 into ? from t9 where c1= 1" ; diff --git a/mysql-test/r/ps_6bdb.result b/mysql-test/r/ps_6bdb.result index 3dd9c200510..d0549503bfe 100644 --- a/mysql-test/r/ps_6bdb.result +++ b/mysql-test/r/ps_6bdb.result @@ -1776,7 +1776,7 @@ t5 CREATE TABLE `t5` ( `const12` char(0) default NULL, `param12` bigint(20) default NULL, `param13` double default NULL, - `param14` longblob, + `param14` longtext, `param15` longblob ) ENGINE=MyISAM DEFAULT CHARSET=latin1 select * from t5 ; @@ -1806,7 +1806,7 @@ def test t5 t5 param11 param11 8 20 4 Y 32768 0 63 def test t5 t5 const12 const12 254 0 0 Y 0 0 8 def test t5 t5 param12 param12 8 20 0 Y 32768 0 63 def test t5 t5 param13 param13 5 20 0 Y 32768 31 63 -def test t5 t5 param14 param14 252 16777215 0 Y 144 0 63 +def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8 def test t5 t5 param15 param15 252 16777215 0 Y 144 0 63 const01 8 param01 8 @@ -1959,19 +1959,19 @@ def @arg16 254 8192 0 Y 128 31 63 def @arg17 254 20 0 Y 128 31 63 def @arg18 254 20 0 Y 128 31 63 def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 128 31 63 -def @arg21 254 8192 0 Y 128 31 63 -def @arg22 254 8192 0 Y 128 31 63 +def @arg20 254 8192 0 Y 0 31 8 +def @arg21 254 8192 0 Y 0 31 8 +def @arg22 254 8192 0 Y 0 31 8 def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 0 31 8 def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 0 31 8 def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 0 31 8 def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 128 31 63 -def @arg31 254 8192 0 Y 128 31 63 -def @arg32 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 0 31 8 +def @arg31 254 8192 0 Y 0 31 8 +def @arg32 254 8192 0 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL prepare stmt1 from "select @@ -2049,19 +2049,19 @@ def @arg16 254 8192 0 Y 128 31 63 def @arg17 254 20 0 Y 128 31 63 def @arg18 254 20 0 Y 128 31 63 def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 128 31 63 -def @arg21 254 8192 0 Y 128 31 63 -def @arg22 254 8192 0 Y 128 31 63 +def @arg20 254 8192 0 Y 0 31 8 +def @arg21 254 8192 0 Y 0 31 8 +def @arg22 254 8192 0 Y 0 31 8 def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 0 31 8 def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 0 31 8 def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 0 31 8 def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 128 31 63 -def @arg31 254 8192 0 Y 128 31 63 -def @arg32 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 0 31 8 +def @arg31 254 8192 0 Y 0 31 8 +def @arg32 254 8192 0 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL prepare stmt1 from "select ? := c1 from t9 where c1= 1" ; @@ -2141,19 +2141,19 @@ def @arg16 254 8192 0 Y 128 31 63 def @arg17 254 20 0 Y 128 31 63 def @arg18 254 20 0 Y 128 31 63 def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 128 31 63 -def @arg21 254 8192 0 Y 128 31 63 -def @arg22 254 8192 0 Y 128 31 63 +def @arg20 254 8192 0 Y 0 31 8 +def @arg21 254 8192 0 Y 0 31 8 +def @arg22 254 8192 0 Y 0 31 8 def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 0 31 8 def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 0 31 8 def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 0 31 8 def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 128 31 63 -def @arg31 254 8192 0 Y 128 31 63 -def @arg32 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 0 31 8 +def @arg31 254 8192 0 Y 0 31 8 +def @arg32 254 8192 0 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL prepare stmt1 from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, @@ -2225,19 +2225,19 @@ def @arg16 254 8192 0 Y 128 31 63 def @arg17 254 20 0 Y 128 31 63 def @arg18 254 20 0 Y 128 31 63 def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 128 31 63 -def @arg21 254 8192 0 Y 128 31 63 -def @arg22 254 8192 0 Y 128 31 63 +def @arg20 254 8192 0 Y 0 31 8 +def @arg21 254 8192 0 Y 0 31 8 +def @arg22 254 8192 0 Y 0 31 8 def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 0 31 8 def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 0 31 8 def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 0 31 8 def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 128 31 63 -def @arg31 254 8192 0 Y 128 31 63 -def @arg32 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 0 31 8 +def @arg31 254 8192 0 Y 0 31 8 +def @arg32 254 8192 0 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL prepare stmt1 from "select c1 into ? from t9 where c1= 1" ; diff --git a/mysql-test/r/ps_7ndb.result b/mysql-test/r/ps_7ndb.result index 85e51df776f..e90eff5d1cd 100644 --- a/mysql-test/r/ps_7ndb.result +++ b/mysql-test/r/ps_7ndb.result @@ -1752,7 +1752,7 @@ t5 CREATE TABLE `t5` ( `const12` char(0) default NULL, `param12` bigint(20) default NULL, `param13` double default NULL, - `param14` longblob, + `param14` longtext, `param15` longblob ) ENGINE=MyISAM DEFAULT CHARSET=latin1 select * from t5 ; @@ -1782,7 +1782,7 @@ def test t5 t5 param11 param11 8 20 4 Y 32768 0 63 def test t5 t5 const12 const12 254 0 0 Y 0 0 8 def test t5 t5 param12 param12 8 20 0 Y 32768 0 63 def test t5 t5 param13 param13 5 20 0 Y 32768 31 63 -def test t5 t5 param14 param14 252 16777215 0 Y 144 0 63 +def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8 def test t5 t5 param15 param15 252 16777215 0 Y 144 0 63 const01 8 param01 8 @@ -1935,19 +1935,19 @@ def @arg16 254 8192 0 Y 128 31 63 def @arg17 254 20 0 Y 128 31 63 def @arg18 254 20 0 Y 128 31 63 def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 128 31 63 -def @arg21 254 8192 0 Y 128 31 63 -def @arg22 254 8192 0 Y 128 31 63 -def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 128 31 63 -def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 128 31 63 -def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 128 31 63 -def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 128 31 63 -def @arg31 254 8192 0 Y 128 31 63 -def @arg32 254 8192 0 Y 128 31 63 +def @arg20 254 8192 0 Y 0 31 8 +def @arg21 254 8192 0 Y 0 31 8 +def @arg22 254 8192 0 Y 0 31 8 +def @arg23 254 8192 0 Y 0 31 8 +def @arg24 254 8192 0 Y 0 31 8 +def @arg25 254 8192 0 Y 0 31 8 +def @arg26 254 8192 0 Y 0 31 8 +def @arg27 254 8192 0 Y 0 31 8 +def @arg28 254 8192 0 Y 0 31 8 +def @arg29 254 8192 0 Y 0 31 8 +def @arg30 254 8192 0 Y 0 31 8 +def @arg31 254 8192 0 Y 0 31 8 +def @arg32 254 8192 0 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL prepare stmt1 from "select @@ -2025,19 +2025,19 @@ def @arg16 254 8192 0 Y 128 31 63 def @arg17 254 20 0 Y 128 31 63 def @arg18 254 20 0 Y 128 31 63 def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 128 31 63 -def @arg21 254 8192 0 Y 128 31 63 -def @arg22 254 8192 0 Y 128 31 63 -def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 128 31 63 -def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 128 31 63 -def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 128 31 63 -def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 128 31 63 -def @arg31 254 8192 0 Y 128 31 63 -def @arg32 254 8192 0 Y 128 31 63 +def @arg20 254 8192 0 Y 0 31 8 +def @arg21 254 8192 0 Y 0 31 8 +def @arg22 254 8192 0 Y 0 31 8 +def @arg23 254 8192 0 Y 0 31 8 +def @arg24 254 8192 0 Y 0 31 8 +def @arg25 254 8192 0 Y 0 31 8 +def @arg26 254 8192 0 Y 0 31 8 +def @arg27 254 8192 0 Y 0 31 8 +def @arg28 254 8192 0 Y 0 31 8 +def @arg29 254 8192 0 Y 0 31 8 +def @arg30 254 8192 0 Y 0 31 8 +def @arg31 254 8192 0 Y 0 31 8 +def @arg32 254 8192 0 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL prepare stmt1 from "select ? := c1 from t9 where c1= 1" ; @@ -2117,19 +2117,19 @@ def @arg16 254 8192 0 Y 128 31 63 def @arg17 254 20 0 Y 128 31 63 def @arg18 254 20 0 Y 128 31 63 def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 128 31 63 -def @arg21 254 8192 0 Y 128 31 63 -def @arg22 254 8192 0 Y 128 31 63 -def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 128 31 63 -def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 128 31 63 -def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 128 31 63 -def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 128 31 63 -def @arg31 254 8192 0 Y 128 31 63 -def @arg32 254 8192 0 Y 128 31 63 +def @arg20 254 8192 0 Y 0 31 8 +def @arg21 254 8192 0 Y 0 31 8 +def @arg22 254 8192 0 Y 0 31 8 +def @arg23 254 8192 0 Y 0 31 8 +def @arg24 254 8192 0 Y 0 31 8 +def @arg25 254 8192 0 Y 0 31 8 +def @arg26 254 8192 0 Y 0 31 8 +def @arg27 254 8192 0 Y 0 31 8 +def @arg28 254 8192 0 Y 0 31 8 +def @arg29 254 8192 0 Y 0 31 8 +def @arg30 254 8192 0 Y 0 31 8 +def @arg31 254 8192 0 Y 0 31 8 +def @arg32 254 8192 0 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL prepare stmt1 from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, @@ -2201,19 +2201,19 @@ def @arg16 254 8192 0 Y 128 31 63 def @arg17 254 20 0 Y 128 31 63 def @arg18 254 20 0 Y 128 31 63 def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 128 31 63 -def @arg21 254 8192 0 Y 128 31 63 -def @arg22 254 8192 0 Y 128 31 63 -def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 128 31 63 -def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 128 31 63 -def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 128 31 63 -def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 128 31 63 -def @arg31 254 8192 0 Y 128 31 63 -def @arg32 254 8192 0 Y 128 31 63 +def @arg20 254 8192 0 Y 0 31 8 +def @arg21 254 8192 0 Y 0 31 8 +def @arg22 254 8192 0 Y 0 31 8 +def @arg23 254 8192 0 Y 0 31 8 +def @arg24 254 8192 0 Y 0 31 8 +def @arg25 254 8192 0 Y 0 31 8 +def @arg26 254 8192 0 Y 0 31 8 +def @arg27 254 8192 0 Y 0 31 8 +def @arg28 254 8192 0 Y 0 31 8 +def @arg29 254 8192 0 Y 0 31 8 +def @arg30 254 8192 0 Y 0 31 8 +def @arg31 254 8192 0 Y 0 31 8 +def @arg32 254 8192 0 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL prepare stmt1 from "select c1 into ? from t9 where c1= 1" ; diff --git a/sql/item_func.cc b/sql/item_func.cc index 09d7e50eaa3..b382dbf7bf9 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -2340,6 +2340,7 @@ static user_var_entry *get_variable(HASH *hash, LEX_STRING &name, entry->value=0; entry->length=0; entry->update_query_id=0; + entry->collation.set(NULL, DERIVATION_NONE); /* If we are here, we were called from a SET or a query which sets a variable. Imagine it is this: @@ -2381,7 +2382,24 @@ bool Item_func_set_user_var::fix_fields(THD *thd, TABLE_LIST *tables, is different from query_id). */ entry->update_query_id= thd->query_id; - entry->collation.set(args[0]->collation); + /* + As it is wrong and confusing to associate any + character set with NULL, @a should be latin2 + after this query sequence: + + SET @a=_latin2'string'; + SET @a=NULL; + + I.e. the second query should not change the charset + to the current default value, but should keep the + original value assigned during the first query. + In order to do it, we don't copy charset + from the argument if the argument is NULL + and the variable has previously been initialized. + */ + if (!entry->collation.collation || !args[0]->null_value) + entry->collation.set(args[0]->collation); + collation.set(entry->collation); cached_result_type= args[0]->result_type(); return 0; } @@ -2409,7 +2427,6 @@ bool Item_func_set_user_var::update_hash(void *ptr, uint length, my_free(entry->value,MYF(0)); entry->value=0; entry->length=0; - entry->collation.set(cs, dv); } else { From ac391280932251ed953c2a5feaf5ae57ac8b9402 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 5 Nov 2004 10:42:37 +0100 Subject: [PATCH 0119/1063] The new "Bootstrap" pushed in 4.0 with changeset "joerg:1.2057" is used for building _all_ versions. It tries to remove "Docs/Images/Makefile*" as part of the actions to correct bug number 6350. If the source tree does not contain a dummy file matching that pattern, this "rm" will fail, and so "Bootstrap" will fail. The "Makefile.am" introduced with this changeset is identical to the one that will arrive here when "joerg:1.2057" is propagated from 4.0, so this separate introduction here is just to allow "Bootstraps" in the meantime. --- Docs/Images/Makefile.am | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 Docs/Images/Makefile.am diff --git a/Docs/Images/Makefile.am b/Docs/Images/Makefile.am new file mode 100644 index 00000000000..b57d701d8a0 --- /dev/null +++ b/Docs/Images/Makefile.am @@ -0,0 +1,35 @@ +# Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Library General Public +# License as published by the Free Software Foundation; either +# version 2 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Library General Public License for more details. +# +# You should have received a copy of the GNU Library General Public +# License along with this library; if not, write to the Free +# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, +# MA 02111-1307, USA + +## Process this file with automake to create Makefile.in + +# This is a dummy file to satisfy the hierarchy of Makefiles. +# When a release is built, the true Makefile will be copied +# together with the "real" files in this directory. + +EXTRA_DIST = + +# Nothing to create in this dummy directory. +all: + : + +# Nothing to cleanup in this dummy directory. +clean: + : + +# Don't update the files from bitkeeper +%::SCCS/s.% From 6608e22d9ceb67fe39879f7cf08cfbd9c05591f5 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 5 Nov 2004 14:07:12 +0400 Subject: [PATCH 0120/1063] user_var.result, user_var.test: My previous change that "set @a=NULL" doesn't change charset fixed 'Bug #6321' as well. Prove with a new test that FIELD(, ...) now works fine too. mysql-test/t/user_var.test: My previous change that "set @a=NULL" doesn't change charset fixed 'Bug #6321' as well. Prove with a new test that FIELD(, ...) now works fine too. mysql-test/r/user_var.result: My previous change that "set @a=NULL" doesn't change charset fixed 'Bug #6321' as well. Prove with a new test that FIELD(, ...) now works fine too. --- mysql-test/r/user_var.result | 4 ++++ mysql-test/t/user_var.test | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/mysql-test/r/user_var.result b/mysql-test/r/user_var.result index 2750478c1c5..659c392e153 100644 --- a/mysql-test/r/user_var.result +++ b/mysql-test/r/user_var.result @@ -195,3 +195,7 @@ SET @`v`:=_ucs2 0x006100620063 COLLATE ucs2_general_ci; SET TIMESTAMP=10000; insert into t2 values (@v); drop table t1, t2; +set @var= NULL ; +select FIELD( @var,'1it','Hit') as my_column; +my_column +0 diff --git a/mysql-test/t/user_var.test b/mysql-test/t/user_var.test index 601724e68c8..3816af42c55 100644 --- a/mysql-test/t/user_var.test +++ b/mysql-test/t/user_var.test @@ -120,3 +120,9 @@ show binlog events from 79; drop table t1, t2; +# +# Bug #6321 strange error: +# string function FIELD(, ...) +# +set @var= NULL ; +select FIELD( @var,'1it','Hit') as my_column; From 8d5703a3c788f73d8a9a964a444b0c52f4058096 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 5 Nov 2004 15:22:03 +0100 Subject: [PATCH 0121/1063] Change "Bootstrap" so that it will not fail on BK source trees of other versions; this is important because this 4.0 "Bootstrap" is the one generally used on host "build". Build-tools/Bootstrap: If the source tree does not contain any "Docs/Images/Makefile*" (due to an error, or because it is not yet prepared to contain the Images in the source tar-ball), a plain "rm" will fail and so cause "Bootstrap" to fail. (This has happened ...) Prevent this danger by using "rm -f". --- Build-tools/Bootstrap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Build-tools/Bootstrap b/Build-tools/Bootstrap index e21179fe78c..a7d347ba32f 100755 --- a/Build-tools/Bootstrap +++ b/Build-tools/Bootstrap @@ -288,7 +288,7 @@ unless ($opt_skip_manual) system ("bk cat $opt_docdir/Docs/$file.texi > $target_dir/Docs/$file.texi") == 0 or &abort("Could not update $file.texi in $target_dir/Docs/!"); } - system ("rm $target_dir/Docs/Images/Makefile*") == 0 + system ("rm -f $target_dir/Docs/Images/Makefile*") == 0 or &abort("Could not remove Makefiles in $target_dir/Docs/Images/!"); system ("cp $opt_docdir/Docs/Images/*.* $target_dir/Docs/Images") == 0 or &abort("Could not copy image files in $target_dir/Docs/Images/!"); From 00d05c1e6dce8528e51bf46badee1bcf73452055 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 5 Nov 2004 15:50:53 +0100 Subject: [PATCH 0122/1063] Ensure that even the (relatively new) "mysql-test/Makefile.am" gets into the source tar-ball. BitKeeper/etc/ignore: Added mysql-test/mysql_test_run_new to the ignore list mysql-test/Makefile.am: All source files must be contained in their respective macros in order to be contained in the DISTFILES macro so that they get included in the source file tar-ball. "my_manage.h" was missing. --- .bzrignore | 1 + mysql-test/Makefile.am | 1 + 2 files changed, 2 insertions(+) diff --git a/.bzrignore b/.bzrignore index 27fb593c662..1e89b903ac7 100644 --- a/.bzrignore +++ b/.bzrignore @@ -922,3 +922,4 @@ Docs/Images/mydsn-test-success.txt Docs/Images/mydsn-trace.txt Docs/Images/mydsn.txt Docs/Images/myflowchart.txt +mysql-test/mysql_test_run_new diff --git a/mysql-test/Makefile.am b/mysql-test/Makefile.am index 4e8601f1b88..ad02d304d1b 100644 --- a/mysql-test/Makefile.am +++ b/mysql-test/Makefile.am @@ -38,6 +38,7 @@ CLEANFILES = $(test_SCRIPTS) $(test_DATA) INCLUDES = -I$(srcdir)/../include -I../include -I.. bin_PROGRAMS = mysql_test_run_new +noinst_HEADERS = my_manage.h mysql_test_run_new_SOURCES= mysql_test_run_new.c my_manage.c From 3170761e02585ee4675e9da4427de28f43a74c1a Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 5 Nov 2004 20:33:56 +0400 Subject: [PATCH 0123/1063] mysqldump.c: Dump VARCHAR(n) BINARY in HEX if --hex-blob too. client/mysqldump.c: Dump VARCHAR(n) BINARY in HEX if --hex-blob too. --- client/mysqldump.c | 1 + 1 file changed, 1 insertion(+) diff --git a/client/mysqldump.c b/client/mysqldump.c index a78eee3794a..0e840512ba0 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -1119,6 +1119,7 @@ static void dumpTable(uint numFields, char *table) is_blob= (opt_hex_blob && (field->flags & BINARY_FLAG) && (field->type == FIELD_TYPE_STRING || + field->type == FIELD_TYPE_VAR_STRING || field->type == FIELD_TYPE_BLOB || field->type == FIELD_TYPE_LONG_BLOB || field->type == FIELD_TYPE_MEDIUM_BLOB || From 7bcd40bd32df675d9c2f84191015915aafa20ee2 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 5 Nov 2004 20:35:56 +0400 Subject: [PATCH 0124/1063] mysqldump.c: in 4.1: Dump only VARBINARY() in hex, while VARCHAR() COLLATE xxx_bin as a string. client/mysqldump.c: in 4.1: Dump only VARBINARY() in hex, while VARCHAR() COLLATE xxx_bin as a string. --- client/mysqldump.c | 1 + 1 file changed, 1 insertion(+) diff --git a/client/mysqldump.c b/client/mysqldump.c index a8db8ab440b..e1388aa0f85 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -1527,6 +1527,7 @@ static void dumpTable(uint numFields, char *table) */ is_blob= (opt_hex_blob && field->charsetnr == 63 && (field->type == FIELD_TYPE_STRING || + field->type == FIELD_TYPE_VAR_STRING || field->type == FIELD_TYPE_BLOB || field->type == FIELD_TYPE_LONG_BLOB || field->type == FIELD_TYPE_MEDIUM_BLOB || From 57ec8b2e48cf2bc5b870341a77e0fd5da482c62d Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 5 Nov 2004 18:59:19 +0200 Subject: [PATCH 0125/1063] Changed default.c so that it now checks for my.ini and then my.cnf from the default directories. BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted --- BitKeeper/etc/logging_ok | 1 + mysys/default.c | 89 ++++++++++++++++++++++------------------ 2 files changed, 51 insertions(+), 39 deletions(-) diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok index a716afb2392..01b9190b044 100644 --- a/BitKeeper/etc/logging_ok +++ b/BitKeeper/etc/logging_ok @@ -47,6 +47,7 @@ hf@genie.(none) igor@hundin.mysql.fi igor@rurik.mysql.com ingo@mysql.com +jani@a193-229-222-105.elisa-laajakaista.fi jani@a80-186-24-72.elisa-laajakaista.fi jani@a80-186-41-201.elisa-laajakaista.fi jani@dsl-jkl1657.dial.inet.fi diff --git a/mysys/default.c b/mysys/default.c index 81290322223..ed7f4b47097 100644 --- a/mysys/default.c +++ b/mysys/default.c @@ -60,11 +60,7 @@ DATADIR, NullS, }; -#define default_ext ".cnf" /* extension for config file */ -#ifdef __WIN__ -#include -#define windows_ext ".ini" -#endif +static const char *f_extensions[]= { ".ini", ".cnf", 0 }; static int search_default_file(DYNAMIC_ARRAY *args,MEM_ROOT *alloc, const char *dir, const char *config_file, @@ -115,7 +111,8 @@ int load_defaults(const char *conf_file, const char **groups, uint args_used=0; int error= 0; MEM_ROOT alloc; - char *ptr,**res; + char *ptr, **res, **ext; + DBUG_ENTER("load_defaults"); init_alloc_root(&alloc,512,0); @@ -169,38 +166,43 @@ int load_defaults(const char *conf_file, const char **groups, } else if (dirname_length(conf_file)) { - if ((error= search_default_file(&args, &alloc, NullS, conf_file, - default_ext, &group)) < 0) - goto err; + for (ext= (char**) f_extensions; *ext; *ext++) + if ((error= search_default_file(&args, &alloc, NullS, conf_file, + *ext, &group)) < 0) + goto err; } else { #ifdef __WIN__ char system_dir[FN_REFLEN]; GetWindowsDirectory(system_dir,sizeof(system_dir)); - if ((search_default_file(&args, &alloc, system_dir, conf_file, - windows_ext, &group))) - goto err; + for (ext= (char**) f_extensions; *ext; *ext++) + if ((search_default_file(&args, &alloc, system_dir, conf_file, + *ext, &group))) + goto err; #endif #if defined(__EMX__) || defined(OS2) - if (getenv("ETC") && - (search_default_file(&args, &alloc, getenv("ETC"), conf_file, - default_ext, &group)) < 0) - goto err; + for (ext= (char**) f_extensions; *ext; *ext++) + if (getenv("ETC") && + (search_default_file(&args, &alloc, getenv("ETC"), conf_file, + *ext, &group)) < 0) + goto err; #endif for (dirs=default_directories ; *dirs; dirs++) { if (**dirs) { - if (search_default_file(&args, &alloc, *dirs, conf_file, - default_ext, &group) < 0) - goto err; + for (ext= (char**) f_extensions; *ext; *ext++) + if (search_default_file(&args, &alloc, *dirs, conf_file, + *ext, &group) < 0) + goto err; } else if (defaults_extra_file) { - if (search_default_file(&args, &alloc, NullS, defaults_extra_file, - default_ext, &group) < 0) - goto err; /* Fatal error */ + for (ext= (char**) f_extensions; ext; ext++) + if (search_default_file(&args, &alloc, NullS, defaults_extra_file, + *ext, &group) < 0) + goto err; /* Fatal error */ } } } @@ -478,8 +480,9 @@ void print_defaults(const char *conf_file, const char **groups) #ifdef __WIN__ bool have_ext=fn_ext(conf_file)[0] != 0; #endif - char name[FN_REFLEN]; + char name[FN_REFLEN], **ext; const char **dirs; + puts("\nDefault options are read from the following files in the given order:"); if (dirname_length(conf_file)) @@ -488,27 +491,35 @@ void print_defaults(const char *conf_file, const char **groups) { #ifdef __WIN__ GetWindowsDirectory(name,sizeof(name)); - printf("%s\\%s%s ",name,conf_file,have_ext ? "" : windows_ext); + if (have_ext) + for (ext= (char**) f_extensions; *ext; *ext++) + printf("%s\\%s%s ", name, conf_file, *ext); + else + printf("%s\\%s ", name, conf_file); #endif #if defined(__EMX__) || defined(OS2) - if (getenv("ETC")) - printf("%s\\%s%s ", getenv("ETC"), conf_file, default_ext); + for (ext= (char**) f_extensions; *ext; *ext++) + if (getenv("ETC")) + printf("%s\\%s%s ", getenv("ETC"), conf_file, *ext); #endif for (dirs=default_directories ; *dirs; dirs++) { - const char *pos; - char *end; - if (**dirs) - pos= *dirs; - else if (defaults_extra_file) - pos= defaults_extra_file; - else - continue; - end=convert_dirname(name, pos, NullS); - if (name[0] == FN_HOMELIB) /* Add . to filenames in home */ - *end++='.'; - strxmov(end,conf_file,default_ext," ",NullS); - fputs(name,stdout); + for (ext= (char**) f_extensions; *ext; *ext++) + { + const char *pos; + char *end; + if (**dirs) + pos= *dirs; + else if (defaults_extra_file) + pos= defaults_extra_file; + else + continue; + end= convert_dirname(name, pos, NullS); + if (name[0] == FN_HOMELIB) /* Add . to filenames in home */ + *end++='.'; + strxmov(end, conf_file, *ext, " ", NullS); + fputs(name,stdout); + } } puts(""); } From b3d84df165fbc3d2ec0b1aab27f3e2e20ac49f2e Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 5 Nov 2004 21:02:12 +0300 Subject: [PATCH 0126/1063] A fix and test case for the bug reported by Reggie: if character set of client equals to character set of connection, possibly required conversion to character set of column is not performed (prepared statements, data is supplied using placeholders). sql/item.cc: Fix for the bug reported by Reggie: if character_set_connection is equal to character_set_client, placeholder's value is not converted furhter to character set of column when it's different. This is because the original implementation left placeholder's character set intact (binary) if there were no need for client->connection conversion. tests/client_test.c: A test case for the conversion bug. --- sql/item.cc | 4 +++ tests/client_test.c | 71 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+) diff --git a/sql/item.cc b/sql/item.cc index 7dc7e9e542c..b4e7322b7cc 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -1218,6 +1218,10 @@ bool Item_param::convert_str_value(THD *thd) value.cs_info.character_set_client, value.cs_info.final_character_set_of_str_value); } + else + str_value.set_charset(value.cs_info.final_character_set_of_str_value); + /* Here str_value is guaranteed to be in final_character_set_of_str_value */ + max_length= str_value.length(); decimals= 0; /* diff --git a/tests/client_test.c b/tests/client_test.c index 004f076c6df..d373f57c1de 100644 --- a/tests/client_test.c +++ b/tests/client_test.c @@ -11152,6 +11152,73 @@ static void test_bug4172() } +static void test_conversion() +{ + MYSQL_STMT *stmt; + const char *stmt_text; + int rc; + MYSQL_BIND bind[1]; + char buff[4]; + ulong length; + + myheader("test_conversion"); + + stmt_text= "DROP TABLE IF EXISTS t1"; + rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text)); + myquery(rc); + stmt_text= "CREATE TABLE t1 (a TEXT) DEFAULT CHARSET latin1"; + rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text)); + myquery(rc); + stmt_text= "SET character_set_connection=utf8, character_set_client=utf8, " + " character_set_results=latin1"; + rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text)); + myquery(rc); + + stmt= mysql_stmt_init(mysql); + + stmt_text= "INSERT INTO t1 (a) VALUES (?)"; + rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text)); + check_execute(stmt, rc); + + bzero(bind, sizeof(bind)); + bind[0].buffer= buff; + bind[0].length= &length; + bind[0].buffer_type= MYSQL_TYPE_STRING; + + mysql_stmt_bind_param(stmt, bind); + + buff[0]= 0xC3; + buff[1]= 0xA0; + length= 2; + + rc= mysql_stmt_execute(stmt); + check_execute(stmt, rc); + + stmt_text= "SELECT a FROM t1"; + rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text)); + check_execute(stmt, rc); + rc= mysql_stmt_execute(stmt); + check_execute(stmt, rc); + + bind[0].buffer_length= sizeof(buff); + mysql_stmt_bind_result(stmt, bind); + + rc= mysql_stmt_fetch(stmt); + DIE_UNLESS(rc == 0); + DIE_UNLESS(length == 1); + DIE_UNLESS((uchar) buff[0] == 0xE0); + rc= mysql_stmt_fetch(stmt); + DIE_UNLESS(rc == MYSQL_NO_DATA); + + mysql_stmt_close(stmt); + stmt_text= "DROP TABLE t1"; + rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text)); + myquery(rc); + stmt_text= "SET NAMES DEFAULT"; + rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text)); + myquery(rc); +} + /* Read and parse arguments and MySQL options from my.cnf @@ -11471,6 +11538,10 @@ int main(int argc, char **argv) test_bug6096(); /* max_length for numeric columns */ test_bug4172(); /* floating point conversions in libmysql */ + test_conversion(); /* placeholder value is not converted to + character set of column if character set + of connection equals to character set of + client */ /* XXX: PLEASE RUN THIS PROGRAM UNDER VALGRIND AND VERIFY THAT YOUR TEST DOESN'T CONTAIN WARNINGS/ERRORS BEFORE YOU PUSH. From 442b2d89b1992dd727eae1c59c16499d052ceb54 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 5 Nov 2004 23:58:30 +0200 Subject: [PATCH 0127/1063] Fixed a typo that caused segmentation fault when using --defaults-extra-file option. --- mysys/default.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysys/default.c b/mysys/default.c index ed7f4b47097..416de09b661 100644 --- a/mysys/default.c +++ b/mysys/default.c @@ -199,7 +199,7 @@ int load_defaults(const char *conf_file, const char **groups, } else if (defaults_extra_file) { - for (ext= (char**) f_extensions; ext; ext++) + for (ext= (char**) f_extensions; *ext; *ext++) if (search_default_file(&args, &alloc, NullS, defaults_extra_file, *ext, &group) < 0) goto err; /* Fatal error */ From e5b02acd1070868f331974d026f82646f6b956cc Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 5 Nov 2004 23:59:06 +0000 Subject: [PATCH 0128/1063] removed a bunch of "dead" files from the ndb src tree BitKeeper/deleted/.del-Makefile_mysql~13fd89716a05b953: Delete: ndb/test/odbc/tpcb/Makefile_mysql BitKeeper/deleted/.del-Makefile_ndb~6c74a0c6f8a79774: Delete: ndb/test/odbc/tpcb/Makefile_ndb BitKeeper/deleted/.del-Makefile~c02da49a787c2f6e: Delete: ndb/test/odbc/tpcb/Makefile BitKeeper/deleted/.del-readme.txt~3549c08b7818c64: Delete: ndb/test/odbc/tpcb/readme.txt BitKeeper/deleted/.del-timesten.h~24e85d9b33938c67: Delete: ndb/test/odbc/tpcb/timesten.h BitKeeper/deleted/.del-tpcb.cpp~7b670d738e1890ae: Delete: ndb/test/odbc/tpcb/tpcb.cpp BitKeeper/deleted/.del-ttTime.c~94f84fefd7be03f3: Delete: ndb/test/odbc/tpcb/ttTime.c BitKeeper/deleted/.del-ttTime.h~52ca967b5dfc48bc: Delete: ndb/test/odbc/tpcb/ttTime.h BitKeeper/deleted/.del-list.h~1329477d9fb820be: Delete: ndb/src/external/LINUX.x86/sci/include/list.h BitKeeper/deleted/.del-rmlib.h~1889009d4b47c498: Delete: ndb/src/external/LINUX.x86/sci/include/rmlib.h BitKeeper/deleted/.del-sci_errno.h~a1da22da939f627: Delete: ndb/src/external/LINUX.x86/sci/include/sci_errno.h BitKeeper/deleted/.del-sci_types.h~64136c0e5ac2ac5f: Delete: ndb/src/external/LINUX.x86/sci/include/sci_types.h BitKeeper/deleted/.del-sisci_api.h~67839b64a1235d51: Delete: ndb/src/external/LINUX.x86/sci/include/sisci_api.h BitKeeper/deleted/.del-sisci_demolib.h~ea5d3afd60121d20: Delete: ndb/src/external/LINUX.x86/sci/include/sisci_demolib.h BitKeeper/deleted/.del-sisci_error.h~c6771e123aa79c71: Delete: ndb/src/external/LINUX.x86/sci/include/sisci_error.h BitKeeper/deleted/.del-sisci_types.h~67a1a116970eb17f: Delete: ndb/src/external/LINUX.x86/sci/include/sisci_types.h BitKeeper/deleted/.del-sisci_version.h~d542bfa4c7633fc: Delete: ndb/src/external/LINUX.x86/sci/include/sisci_version.h BitKeeper/deleted/.del-version.h~b022e3a29d6d96ad: Delete: ndb/src/external/LINUX.x86/sci/include/version.h BitKeeper/deleted/.del-inttypes.h~c9dfa7f6273df1b1: Delete: ndb/src/external/LINUX.x86/sci/include/os/inttypes.h BitKeeper/deleted/.del-rmlib.h~61359201e51879bc: Delete: ndb/src/external/WIN32.x86/sci/include/rmlib.h BitKeeper/deleted/.del-sisci_api.h~3b78e2453819b68d: Delete: ndb/src/external/SOLARIS.SPARC/sci/include/sisci_api.h BitKeeper/deleted/.del-sisci_error.h~f48df70a324479a2: Delete: ndb/src/external/SOLARIS.SPARC/sci/include/sisci_error.h BitKeeper/deleted/.del-sisci_types.h~f97cdce73b27052d: Delete: ndb/src/external/SOLARIS.SPARC/sci/include/sisci_types.h BitKeeper/deleted/.del-sisci_version.h~fa5e2e6069bad028: Delete: ndb/src/external/SOLARIS.SPARC/sci/include/sisci_version.h BitKeeper/deleted/.del-scilib.h~144397858368aafd: Delete: ndb/src/external/WIN32.x86/sci/include/scilib.h BitKeeper/deleted/.del-sisci_api.h~23d9bf22685196be: Delete: ndb/src/external/WIN32.x86/sci/include/sisci_api.h BitKeeper/deleted/.del-sisci_demolib.h~c149b88ed12e698e: Delete: ndb/src/external/WIN32.x86/sci/include/sisci_demolib.h BitKeeper/deleted/.del-sisci_error.h~3118f4dbedb2eee0: Delete: ndb/src/external/WIN32.x86/sci/include/sisci_error.h BitKeeper/deleted/.del-sisci_types.h~3cf6f68a4de25d19: Delete: ndb/src/external/WIN32.x86/sci/include/sisci_types.h BitKeeper/deleted/.del-md5-rfc1321.txt~61f874f9cd434768: Delete: ndb/src/common/util/md5-rfc1321.txt BitKeeper/deleted/.del-getarg.3~3d3256e9714fadf1: Delete: ndb/src/common/util/getarg.3 BitKeeper/deleted/.del-getarg.3.ps~bfb45b011e1164ae: Delete: ndb/src/common/util/getarg.3.ps BitKeeper/deleted/.del-cvschk~c63d92daa21ed311: Delete: ndb/home/bin/cvschk BitKeeper/deleted/.del-AssemblyInfo.cs~7632ee81b277625: Delete: ndb/src/cw/cpcc-win32/csharp/AssemblyInfo.cs BitKeeper/deleted/.del-frmSplash.frm~40b5877abca91856: Delete: ndb/src/cw/cpcc-win32/vb6/frmSplash.frm --- ndb/home/bin/cvschk | 569 ----- ndb/src/common/util/getarg.3 | 315 --- ndb/src/common/util/getarg.3.ps | 458 ---- ndb/src/common/util/md5-rfc1321.txt | 1179 --------- ndb/src/cw/cpcc-win32/csharp/AssemblyInfo.cs | 58 - ndb/src/cw/cpcc-win32/vb6/frmSplash.frm | 159 -- ndb/src/external/LINUX.x86/sci/include/list.h | 56 - .../LINUX.x86/sci/include/os/inttypes.h | 53 - .../external/LINUX.x86/sci/include/rmlib.h | 212 -- .../LINUX.x86/sci/include/sci_errno.h | 216 -- .../LINUX.x86/sci/include/sci_types.h | 300 --- .../LINUX.x86/sci/include/sisci_api.h | 2170 ---------------- .../LINUX.x86/sci/include/sisci_demolib.h | 226 -- .../LINUX.x86/sci/include/sisci_error.h | 89 - .../LINUX.x86/sci/include/sisci_types.h | 133 - .../LINUX.x86/sci/include/sisci_version.h | 91 - .../external/LINUX.x86/sci/include/version.h | 25 - .../SOLARIS.SPARC/sci/include/sisci_api.h | 2148 ---------------- .../SOLARIS.SPARC/sci/include/sisci_error.h | 89 - .../SOLARIS.SPARC/sci/include/sisci_types.h | 133 - .../SOLARIS.SPARC/sci/include/sisci_version.h | 91 - .../external/WIN32.x86/sci/include/rmlib.h | 212 -- .../external/WIN32.x86/sci/include/scilib.h | 330 --- .../WIN32.x86/sci/include/sisci_api.h | 2217 ----------------- .../WIN32.x86/sci/include/sisci_demolib.h | 226 -- .../WIN32.x86/sci/include/sisci_error.h | 94 - .../WIN32.x86/sci/include/sisci_types.h | 133 - ndb/test/odbc/tpcb/Makefile | 30 - ndb/test/odbc/tpcb/Makefile_mysql | 33 - ndb/test/odbc/tpcb/Makefile_ndb | 30 - ndb/test/odbc/tpcb/readme.txt | 15 - ndb/test/odbc/tpcb/timesten.h | 188 -- ndb/test/odbc/tpcb/tpcb.cpp | 1415 ----------- ndb/test/odbc/tpcb/ttTime.c | 366 --- ndb/test/odbc/tpcb/ttTime.h | 125 - 35 files changed, 14184 deletions(-) delete mode 100755 ndb/home/bin/cvschk delete mode 100644 ndb/src/common/util/getarg.3 delete mode 100644 ndb/src/common/util/getarg.3.ps delete mode 100644 ndb/src/common/util/md5-rfc1321.txt delete mode 100644 ndb/src/cw/cpcc-win32/csharp/AssemblyInfo.cs delete mode 100644 ndb/src/cw/cpcc-win32/vb6/frmSplash.frm delete mode 100644 ndb/src/external/LINUX.x86/sci/include/list.h delete mode 100644 ndb/src/external/LINUX.x86/sci/include/os/inttypes.h delete mode 100644 ndb/src/external/LINUX.x86/sci/include/rmlib.h delete mode 100644 ndb/src/external/LINUX.x86/sci/include/sci_errno.h delete mode 100644 ndb/src/external/LINUX.x86/sci/include/sci_types.h delete mode 100644 ndb/src/external/LINUX.x86/sci/include/sisci_api.h delete mode 100644 ndb/src/external/LINUX.x86/sci/include/sisci_demolib.h delete mode 100644 ndb/src/external/LINUX.x86/sci/include/sisci_error.h delete mode 100644 ndb/src/external/LINUX.x86/sci/include/sisci_types.h delete mode 100644 ndb/src/external/LINUX.x86/sci/include/sisci_version.h delete mode 100644 ndb/src/external/LINUX.x86/sci/include/version.h delete mode 100644 ndb/src/external/SOLARIS.SPARC/sci/include/sisci_api.h delete mode 100644 ndb/src/external/SOLARIS.SPARC/sci/include/sisci_error.h delete mode 100644 ndb/src/external/SOLARIS.SPARC/sci/include/sisci_types.h delete mode 100644 ndb/src/external/SOLARIS.SPARC/sci/include/sisci_version.h delete mode 100644 ndb/src/external/WIN32.x86/sci/include/rmlib.h delete mode 100644 ndb/src/external/WIN32.x86/sci/include/scilib.h delete mode 100644 ndb/src/external/WIN32.x86/sci/include/sisci_api.h delete mode 100644 ndb/src/external/WIN32.x86/sci/include/sisci_demolib.h delete mode 100644 ndb/src/external/WIN32.x86/sci/include/sisci_error.h delete mode 100644 ndb/src/external/WIN32.x86/sci/include/sisci_types.h delete mode 100644 ndb/test/odbc/tpcb/Makefile delete mode 100644 ndb/test/odbc/tpcb/Makefile_mysql delete mode 100644 ndb/test/odbc/tpcb/Makefile_ndb delete mode 100644 ndb/test/odbc/tpcb/readme.txt delete mode 100644 ndb/test/odbc/tpcb/timesten.h delete mode 100644 ndb/test/odbc/tpcb/tpcb.cpp delete mode 100644 ndb/test/odbc/tpcb/ttTime.c delete mode 100644 ndb/test/odbc/tpcb/ttTime.h diff --git a/ndb/home/bin/cvschk b/ndb/home/bin/cvschk deleted file mode 100755 index 4510cc30888..00000000000 --- a/ndb/home/bin/cvschk +++ /dev/null @@ -1,569 +0,0 @@ -#!/usr/bin/perl -w -# -# cvschk -- fast offline check for new files and modifications of files - -# cvschk : A perl program which checks the status of the CVS controlled -# files and gives an ASCII table sorted after the status of files. -# -# If you have used CVS, then you know that it is hard to -# get a good overview the CVS-status of the files in you -# directories. Any new files? Any files changes? -# cvschk will help the programmer get the overview in the -# situation, where we do not have access to the CVS repository. -# -# Note that the program does only local checks of the files -# If you have fast access to the CVS repositiory, then consider -# the cvsstat-program - which additionally can tell if other -# people have made newer versions of the files. -# -# The program requires Perl 5.004 (maybe previous versions also work). -# -# It is tuned to parse the output of cvs(1) version 1.9. -# Earlier and later versions may require modifications to the script. -# -# ** Note that the first line might be wrong depending ** -# ** on the location of your perl program. ** -# -# Sample output: -# The directory ./mytempdir is not under CVS control -# -# Changed files -# --------------- -# ./cvs2html -# ./cvschk -# ./cvsstat -# -# New files -# --------------- -# ./.#cvschk -# ./XX -# ./cvs2html.ok -# -# Deleted files -# --------------- -# (none) - -# Changelog: -# -# Ver Date Author Changelog -# --- ---------- -------------------- ------------------------------------- -# 1.12 2002-01-04 Michael Kohne Fixed a $foo=<> warning for -# 5.004_01 with defined($foo=<>) -# Added a --tabular|-t switch -# -# 1.11 2001-12-27 Michael Kohne Added cvsignore functionality -# Handling of 'dummy timestamp' -# Handling of 'Result of Merge' -# -# 1.10 2001-11-06 Michael Kohne Added -r and -l options -# -# 1.9 2001-08-03 Lars G. T. Jørgensen Hack to allow special entry-line -# -# 1.8 2001-06-07 Peter Toft Back to the same as 1.6 -# CVS is my friend -# -# 1.7 2001-06-04 Peter Toft Peter was very tired and -# applied a wrong patch - -# version 1.7 is crap -# -# 1.6 2000-12-17 Peter Toft Better description added -# -# 1.5 2000-11-04 Peter Toft URL of cvsstat changed -# -# 1.4 2000-09-20 Peter Toft Must show deleted files also -# as the default -# -# 1.3 2000-08-08 Ole Tange and Initial version -# Peter Toft -# ---- ---------- -------------------- ------------------------------------- -# -# ----------------------------------------------------------------------------- -# -# This program is protected by the GPL, and all modifications of -# general interest should be emailed to the maintainer (pto@sslug.dk). -# -# This program also uses code parts from cvsstat -# (same homepage as cvschk) -# -# Copyright 2000,2001 by Peter Toft and Ole Tange -# as well as -# Lars G. T. Jørgensen -# -# The URL of the home page of cvschk is shown below. - - -use Time::Local; -use strict; -use Getopt::Long; - -my $startdir = "."; - -my $debug = 0; -my (%files,%filesok,%seen,%skip); - - -# Michael Kohne 12/16/01 -# -# Simulation of .cvsignore as CVS does it... -# -# using .cvsignore handling makes cvschk take from 2 to 3 times -# longer to run over the same set of files. -# in my tests, disabling cvsignore altogether, cvschk takes .2 -# seconds on my working directory. Adding cvsignore,takes -# .4 seconds. -# Note that I do not use individual .cvsignore files - if there -# are a lot of them in your directory tree, it will add run time -# -# variables used for .cvsignore handling -my $initcvsignoreregex;# regex holding all startup cvsignore pattersn (no ()) -my $cvsignoreregex;# one regex holding all current cvsignore patterns -my $disable_cvsignore=0;# set to 1 to disable cvsignore emulation - # (available in case it's REALLY screwed up) -my $disable_ind_cvsignore=0;# set to 1 to disable finding .cvsignore files - # in each directory. -my $debug_cvsignore = 0; # For debugging .cvsignore problems - -my %mon; -@mon{qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec)}= - 0..11; # Perl months are 0 .. 11 - -my ($version) = ('$Revision: 1.12 $ ' =~ /^\$\w+: (.*) \$ $/); -my $URL = "http://cvs.sslug.dk/cvs2html"; -my $version_line = "cvschk version $version (see $URL)\n"; - -my $opt_all; -my $restrict; -my $local; -my $tabular; - -my $opt_restrict; - -sub show_version {print $version_line} - -sub die_version {die $version_line} - -sub die_usage { - my $bundled = ($] > 5.00399 - ? "can be bundled" - : "can't be bundled, because your Perl is too old"); - die < 5.00399) { # This requires 5.004, so silently skip it for older Perls. - eval {Getopt::Long::config("bundling")}; # avoid 5.003 compilation error - warn $@ if $@; # For Perl 5.004+ we do want to see any compilation error -} - - -GetOptions( "all|a" => \$opt_all, - "tabular|t" => \$tabular, - "restrict|r" => \$restrict, - "local|l" => \$local, - "help|h" => \&die_help, - "debug|d" => \$debug, - "version|V" => \&die_version, - ) or die_usage; - -sub cvs_changed_in_dir($); #define prototype (for recursion) - -# functions for .cvsignore handling - -# converts a given filename pattern -# (of the sort that sh(1) takes) to -# a perl regex of similar meaning. -# -# It works by doing the following: -# -# change: -# . to \. -# $ to \$ -# * to .* -# ? to . -# -sub fpat_to_regex($) -{ - my $fexp; - $fexp = shift; - $fexp =~ s/\./\\\./g;#change . to \. - $fexp =~ s/\$/\\\$/g;#change dollar sign to \dollar sign - $fexp =~ s/\*/.*/g;# change * to .* - $fexp =~ s/\?/./g; # change ? to . - return $fexp; -} - -# copy the input list to one single regex, -# items seperated by | symbols. -# return the regex string -sub do_regex_convert -{ - my $rx = ""; - my $first = 1;#true for first element only - - - # convert each element of cvsignore into a regex - # this makes the patterns usable in perl - my $cp; - foreach $cp (@_) { - if (not $first) { $rx = $rx . "|"; } - if ($first) { $first = 0; } - $rx = $rx . fpat_to_regex($cp); - } - - return $rx; -} - -# first parameter is a reference to the array -# to be loaded -# the rest of the parameters are just items -# that need to be loaded into the array. -# Note that if a ! is found, the list is -# emptied, then further items are added. -# returns true if a ! was found -sub load_list_from_list -{ - my $arref = shift;# get reference to array from front - my $item; - my $ret=0;#false means no ! found - - chomp @_;#kill newlines - foreach $item (@_) { - $item =~ s/^\s*(.*?)\s*$/$1/;#kill leading/trailing whitespace - if ($item) { # empty string is false - push @$arref,$item; - } - if ($item eq "!") { - @$arref = ();# '!' causes list to clear - $ret = 1;# ! found - } - } - - return $ret; -} - -# loads the given list with lines from the -# specified file. Note that if a '!' is found -# all prior patterns are removed from the list -# before the following patterns are loaded -# first param is the filename, -# second param is a reference to an array -# that the data is to go into -# returns true if a ! was found -sub load_list_from_file -{ - my @inlist; - my $fname = shift;#filename to read from - #if (not -e $fname) { return; } - my $arref = shift;#array to store into - open CVSIGNORE,"$fname" or return;#file might not exist, that's OK - @inlist = ; - close CVSIGNORE; - return load_list_from_list($arref,@inlist); -} - -# loads $cvsignoreregex from -# $initcvsignoreregex and the .cvsignore file -# in the local directory -sub load_cvsignore -{ - if ($disable_ind_cvsignore) {return;}#don't look for local .cvsignore files - if ($disable_cvsignore) {return;}#don't do anything - - my $dir = shift; - my @cvsignore; - - # bang will be true if a ! was found. In such cases, I need - # to not use the pre-exisitng regex list. - my $bang = load_list_from_file("$dir/.cvsignore",\@cvsignore); - - # if we get a local cvsignore list, then... - my $rx = do_regex_convert(@cvsignore); - if ($rx) { - $cvsignoreregex = "("; - if (not $bang) {$cvsignoreregex = $cvsignoreregex . $initcvsignoreregex . "|";} - $cvsignoreregex = $cvsignoreregex . $rx . ")"; - } else { - if ($bang) {$cvsignoreregex = "";} - else {$cvsignoreregex = "(" . $initcvsignoreregex . ")";} - } - - if ($debug_cvsignore) {print $dir,":",$cvsignoreregex, "\n";} -} - - -# loads all of the cvsignore patterns that -# can be loaded at script startup -sub load_initial_cvsignore() -{ - #load the default patterns - # (taken from http://www.gnu.org/manual/cvs-1.9/html_node/cvs_141.html#IDX399) - # - # this gives you the patterns that cvs normally starts with - my @initcvsignore; - push @initcvsignore,("RCS"); - push @initcvsignore,("SCCS"); - push @initcvsignore,("CVS"); - push @initcvsignore,("CVS.adm"); - push @initcvsignore,("RCSLOG"); - push @initcvsignore,("cvslog.*"); - push @initcvsignore,("tags"); - push @initcvsignore,("TAGS"); - push @initcvsignore,(".make.state"); - push @initcvsignore,(".nse_depinfo"); - push @initcvsignore,("*~"); - push @initcvsignore,("\#*"); - push @initcvsignore,(".\#*"); - push @initcvsignore,("\,*"); - push @initcvsignore,("_\$\*"); - push @initcvsignore,("*\$"); - push @initcvsignore,("*.old"); - push @initcvsignore,("*.bak"); - push @initcvsignore,("*.BAK"); - push @initcvsignore,("*.orig"); - push @initcvsignore,("*.rej"); - push @initcvsignore,(".del-*"); - push @initcvsignore,("*.a"); - push @initcvsignore,("*.olb"); - push @initcvsignore,("*.o"); - push @initcvsignore,("*.obj"); - push @initcvsignore,("*.so"); - push @initcvsignore,("*.exe"); - push @initcvsignore,("*.Z"); - push @initcvsignore,("*.elc"); - push @initcvsignore,("*.ln"); - push @initcvsignore,("core"); - - - # now, load (in proper order!) - # each of the possible cvsignore files - - # there are 4 possible .cvsignore files: - - # $CVSROOT/CVSROOT/cvsignore - # ~/.cvsignore - # $CVSIGNORE environment variable - # .cvsignore in current directory - - # The first (CVSROOT/cvsignore) would require calling cvs, so - # we won't do that one. - # The last (.cvsignore in current directory) is done - # for each directory. It's handled in the load_cvsignore routine. - - # ~/.cvsignore - my @inlist; - my $item; - my $HOME=$ENV{"HOME"}; - if (not $HOME) {$HOME = ".";} - load_list_from_file("$HOME/.cvsignore",\@initcvsignore); - - # $CVSIGNORE environment variable - my $igstr = $ENV{"CVSIGNORE"}; # get env var - if ($igstr) { - my @iglist = split(/\s+/, $igstr); #if it exists, convert to list - load_list_from_list(\@initcvsignore,@iglist); - } - - # now that @initcvsignore is setup, - # turn it into a regex string - $initcvsignoreregex = do_regex_convert(@initcvsignore); - - # now preset the cvsignore regex string to match - # @initcvsignore. That way, if we aren't using local - # cvsignore files, we do nothing. - $cvsignoreregex = "(" . $initcvsignoreregex . ")"; -} -# routine to see if the given name is in the cvsignore regex -# returns true if it is, false if it's not -sub ignore_file($) -{ - #allow user to disable the cvsignore stuff - if ($disable_cvsignore) {return 0;} - if (not $cvsignoreregex) {return 0;}# if regex is empty, nothing matches the regex - my $filename = shift; - - if ($debug_cvsignore) {print "ignore_file:",$filename,"\n";} - - if ($filename =~ $cvsignoreregex) { - if ($debug_cvsignore) {print $filename," matches\n";} - return 1; - } - - if ($debug_cvsignore) {print $filename," doesn't match\n";} - return 0; -} - -sub cvs_changed_in_dir($) { - my $dir = shift; - - my ($line,$filename,$version,$mtime,$date, - $dir_filename,$cvstime,@subdirs, - @new_in_dir,$i); - - # Examine status of files in CVS/Entries - if(not open(ENTRIES,"$dir/CVS/Entries")) { - if ($tabular) { - push @{$files{Unknown}}, $dir; - } - else { - warn "The directory $dir is not under CVS control\n"; - } - } else { - load_cvsignore($dir);#load up proper cvsignore for given directory - - while(defined ($line=)) { - # Parse CVS/Entries-line - $line=~m!^/(.*)/(.*)/(.*)/.*/! or do { - $debug and warn("Skipping entry-line $line"); - next; - }; - ($filename,$version,$date) = ($1,$2,$3); - $dir_filename=$dir."/".$filename; - - # Mark this file as seen - $seen{$dir_filename}=1; - - # if not exists: Deleted - if(not -e $dir_filename) { - push @{$files{Deleted}}, $dir_filename; next; - } - # if dir: save name for recursion - -d $dir_filename and do { - push @subdirs, $dir_filename; next; - }; - - # modification time of $dir_filename - $mtime= (stat $dir_filename)[9]; - - - if($date eq "dummy timestamp") { - # dummy timestamp means it's new to the repository. - push @{$files{Changed}}, $dir_filename; - if ($debug) { - print "$dir_filename is changed\n"; - } - } - elsif($date eq "Result of merge") { - # result of merge means it's changed, then updated. - push @{$files{Changed}}, $dir_filename; - if ($debug) { - print "$dir_filename is changed\n"; - } - } - elsif(not - $date=~/... (...)\s+(\d+)\s+(\d+):(\d+):(\d+) (\d{4})/) - { - #bogus entry in Entires - warn "Warning: $dir_filename -> '$date' ". - "not in ctime(3) format\n"; - } else { - $cvstime=timegm($5,$4,$3,$2,$mon{$1},$6); - if($cvstime != $mtime) { - push @{$files{Changed}}, $dir_filename; - if ($debug) { - print "$dir_filename is changed\n"; - } - } else { - push @{$files{Unchanged}}, $dir_filename; - if ($debug) { - print "$dir_filename is Unchanged\n"; - } - } - } - } - close ENTRIES; - - # Locate any new files/dirs - if(not opendir(D,$dir)) { - warn("Cannot open $dir"); - @new_in_dir= (); - } else { - @skip{qw(. .. CVS)}=1..3; # Filenames that that we want to ignore - #(note: these are exact filenames) - @new_in_dir= - (grep { not $seen{$_} } # files we have not already processed - map { $dir."/".$_ } # map from file to dir/file - grep { not ignore_file($_) } # ignore files in the cvsignore list - grep { not $skip{$_} } # skip files to be ignored - readdir(D)); - closedir(D); - } - - # Remember new files (actually non-directories) - push @{$files{New}}, grep { not -d $_ } @new_in_dir; - if ($debug) { print "@{$files{New}} are new in $dir\n"; } - - # Remember new subdirs - push @subdirs, grep { -d $_ } @new_in_dir; - - # Recurse all subdirs - if (not $local) { - for $i (@subdirs) { cvs_changed_in_dir($i); } - } - } -} - -sub print_status() -{ - my $k; - my %show_these_states = ("Changed" => 1); - if(not $restrict) { - $show_these_states{"New"} = 1; - $show_these_states{"Deleted"} = 1; - } - - if($opt_all) { $show_these_states{"Unchanged"} = 1; } - - if ($tabular) { - my %allfiles; # key: filesname, value: state - my ($file, $state, $statefiles); - - $show_these_states{"Unknown"} = 1; - while (($state, $statefiles) = each %files) { - for my $f (@{$statefiles}) { - $allfiles{$f} = $state; - } - } - for $file (sort keys %allfiles) { - $state = $allfiles{$file}; - printf("%-10s %s\n", $state, $file) if $show_these_states{$state}; - } - } - else { - print "\n"; - for $k (keys %show_these_states) { - if(not $files{$k} or not @{$files{$k}}) { - # no files - $files{$k}=["(none)"]; - } - print("$k files\n", - "---------------\n", - map { "$_\n" } sort @{$files{$k}}); - print "\n"; - } - } -} - -load_initial_cvsignore(); -if ($debug_cvsignore) {print "initial regex:",$cvsignoreregex,"\n";} -cvs_changed_in_dir($startdir); -print_status(); - diff --git a/ndb/src/common/util/getarg.3 b/ndb/src/common/util/getarg.3 deleted file mode 100644 index 43aae5d7b31..00000000000 --- a/ndb/src/common/util/getarg.3 +++ /dev/null @@ -1,315 +0,0 @@ -.\" Copyright (c) 1999 Kungliga Tekniska Högskolan -.\" $KTH: getarg.3,v 1.1.4.1 2001/07/26 19:54:45 lha Exp $ -.Dd September 24, 1999 -.Dt GETARG 3 -.Os ROKEN -.Sh NAME -.Nm getarg , -.Nm arg_printusage -.Nd collect command line options -.Sh SYNOPSIS -.Fd #include - -.Ft int -.Fn getarg "struct getargs *args" "size_t num_args" "int argc" "char **argv" "int *optind" - -.Ft void -.Fn arg_printusage "struct getargs *args" "size_t num_args" "const char *progname" "const char *extra_string" - -.Sh DESCRIPTION -.Fn getarg -collects any command line options given to a program in an easily used way. -.Fn arg_printusage -pretty-prints the available options, with a short help text. -.Pp -.Fa args -is the option specification to use, and it's an array of -.Fa struct getargs -elements. -.Fa num_args -is the size of -.Fa args -(in elements). -.Fa argc -and -.Fa argv -are the argument count and argument vector to extract option from. -.Fa optind -is a pointer to an integer where the index to the last processed -argument is stored, it must be initialised to the first index (minus -one) to process (normally 0) before the first call. -.Pp -.Fa arg_printusage -take the same -.Fa args -and -.Fa num_args -as getarg; -.Fa progname is the name of the program (to be used in the help text), and -.Fa extra_string -is a string to print after the actual options to indicate more -arguments. The usefulness of this function is realised only be people -who has used programs that has help strings that doesn't match what -the code does. -.Pp -The -.Fa getargs -struct has the following elements. - -.Bd -literal -struct getargs{ - const char *long_name; - char short_name; - enum { arg_integer, - arg_string, - arg_flag, - arg_negative_flag, - arg_strings, - arg_double, - arg_collect - } type; - void *value; - const char *help; - const char *arg_help; -}; -.Ed -.Pp -.Fa long_name -is the long name of the option, it can be -.Dv NULL , -if you don't want a long name. -.Fa short_name -is the characted to use as short option, it can be zero. If the option -has a value the -.Fa value -field gets filled in with that value interpreted as specified by the -.Fa type -field. -.Fa help -is a longer help string for the option as a whole, if it's -.Dv NULL -the help text for the option is omitted (but it's still displayed in -the synopsis). -.Fa arg_help -is a description of the argument, if -.Dv NULL -a default value will be used, depending on the type of the option: -.Pp -.Bl -hang -width arg_negative_flag -.It arg_integer -the argument is a signed integer, and -.Fa value -should point to an -.Fa int . -.It Fa arg_string -the argument is a string, and -.Fa value -should point to a -.Fa char* . -.It Fa arg_flag -the argument is a flag, and -.Fa value -should point to a -.Fa int . -It gets filled in with either zero or one, depending on how the option -is given, the normal case beeing one. Note that if the option isn't -given, the value isn't altered, so it should be initialised to some -useful default. -.It Fa arg_negative_flag -this is the same as -.Fa arg_flag -but it reverses the meaning of the flag (a given short option clears -the flag), and the synopsis of a long option is negated. -.It Fa arg_strings -the argument can be given multiple times, and the values are collected -in an array; -.Fa value -should be a pointer to a -.Fa struct getarg_strings -structure, which holds a length and a string pointer. -.It Fa arg_double -argument is a double precision floating point value, and -.Fa value -should point to a -.Fa double . -.It Fa arg_collect -allows more fine-grained control of the option parsing process. -.Fa value -should be a pointer to a -.Fa getarg_collect_info -structure: -.Bd -literal -typedef int (*getarg_collect_func)(int short_opt, - int argc, - char **argv, - int *optind, - int *optarg, - void *data); - -typedef struct getarg_collect_info { - getarg_collect_func func; - void *data; -} getarg_collect_info; -.Ed -.Pp -With the -.Fa func -member set to a function to call, and -.Fa data -to some application specific data. The parameters to the collect function are: -.Bl -inset -.It Fa short_flag -non-zero if this call is via a short option flag, zero otherwise -.It Fa argc , argv -the whole argument list -.It Fa optind -pointer to the index in argv where the flag is -.It Fa optarg -pointer to the index in argv[*optind] where the flag name starts -.It Fa data -application specific data -.El -.Pp -You can modify -.Fa *optind , -and -.Fa *optarg , -but to do this correct you (more or less) have to know about the inner -workings of getarg. - -You can skip parts of arguments by increasing -.Fa *optarg -(you could -implement the -.Fl z Ns Ar 3 -set of flags from -.Nm gzip -with this), or whole argument strings by increasing -.Fa *optind -(let's say you want a flag -.Fl c Ar x y z -to specify a coordinate); if you also have to set -.Fa *optarg -to a sane value. -.Pp -The collect function should return one of -.Dv ARG_ERR_NO_MATCH , ARG_ERR_BAD_ARG , ARG_ERR_NO_ARG -on error, zero otherwise. -.Pp -For your convenience there is a function, -.Fn getarg_optarg , -that returns the traditional argument string, and you pass it all -arguments, sans data, that where given to the collection function. -.Pp -Don't use this more this unless you absolutely have to. -.El -.Pp -Option parsing is similar to what -.Xr getopt -uses. Short options without arguments can be compressed -.Pf ( Fl xyz -is the same as -.Fl x y z ) , -and short -options with arguments take these as either the rest of the -argv-string or as the next option -.Pf ( Fl o Ns Ar foo , -or -.Fl o Ar foo ) . -.Pp -Long option names are prefixed with -- (double dash), and the value -with a = (equal), -.Fl -foo= Ns Ar bar . -Long option flags can either be specified as they are -.Pf ( Fl -help ) , -or with an (boolean parsable) option -.Pf ( Fl -help= Ns Ar yes , -.Fl -help= Ns Ar true , -or similar), or they can also be negated -.Pf ( Fl -no-help -is the same as -.Fl -help= Ns no ) , -and if you're really confused you can do it multiple times -.Pf ( Fl -no-no-help= Ns Ar false , -or even -.Fl -no-no-help= Ns Ar maybe ) . -.Sh EXAMPLE -.Bd -literal -#include -#include -#include - -char *source = "Ouagadougou"; -char *destination; -int weight; -int include_catalog = 1; -int help_flag; - -struct getargs args[] = { - { "source", 's', arg_string, &source, - "source of shippment", "city" }, - { "destination", 'd', arg_string, &destination, - "destination of shippment", "city" }, - { "weight", 'w', arg_integer, &weight, - "weight of shippment", "tons" }, - { "catalog", 'c', arg_negative_flag, &include_catalog, - "include product catalog" }, - { "help", 'h', arg_flag, &help_flag } -}; - -int num_args = sizeof(args) / sizeof(args[0]); /* number of elements in args */ - -const char *progname = "ship++"; - -int -main(int argc, char **argv) -{ - int optind = 0; - if (getarg(args, num_args, argc, argv, &optind)) { - arg_printusage(args, num_args, progname, "stuff..."); - exit (1); - } - if (help_flag) { - arg_printusage(args, num_args, progname, "stuff..."); - exit (0); - } - if (destination == NULL) { - fprintf(stderr, "%s: must specify destination\n", progname); - exit(1); - } - if (strcmp(source, destination) == 0) { - fprintf(stderr, "%s: destination must be different from source\n"); - exit(1); - } - /* include more stuff here ... */ - exit(2); -} -.Ed -.Pp -The output help output from this program looks like this: -.Bd -literal -$ ship++ --help -Usage: ship++ [--source=city] [-s city] [--destination=city] [-d city] - [--weight=tons] [-w tons] [--no-catalog] [-c] [--help] [-h] stuff... --s city, --source=city source of shippment --d city, --destination=city destination of shippment --w tons, --weight=tons weight of shippment --c, --no-catalog include product catalog -.Ed - -.Sh BUGS -It should be more flexible, so it would be possible to use other more -complicated option syntaxes, such as what -.Xr ps 1 , -and -.Xr tar 1 , -uses, or the AFS model where you can skip the flag names as long as -the options come in the correct order. -.Pp -Options with multiple arguments should be handled better. -.Pp -Should be integreated with SL. -.Pp -It's very confusing that the struct you pass in is called getargS. -.Sh SEE ALSO -.Xr getopt 3 diff --git a/ndb/src/common/util/getarg.3.ps b/ndb/src/common/util/getarg.3.ps deleted file mode 100644 index 146fb8e4961..00000000000 --- a/ndb/src/common/util/getarg.3.ps +++ /dev/null @@ -1,458 +0,0 @@ -%!PS-Adobe-3.0 -%%Creator: groff version 1.15 -%%CreationDate: Thu Nov 7 12:53:13 2002 -%%DocumentNeededResources: font Times-Roman -%%+ font Times-Bold -%%+ font Courier-Bold -%%+ font Courier-Oblique -%%+ font Symbol -%%+ font Courier -%%DocumentSuppliedResources: procset grops 1.15 0 -%%Pages: 4 -%%PageOrder: Ascend -%%Orientation: Portrait -%%EndComments -%%BeginProlog -%%BeginResource: procset grops 1.15 0 -/setpacking where{ -pop -currentpacking -true setpacking -}if -/grops 120 dict dup begin -/SC 32 def -/A/show load def -/B{0 SC 3 -1 roll widthshow}bind def -/C{0 exch ashow}bind def -/D{0 exch 0 SC 5 2 roll awidthshow}bind def -/E{0 rmoveto show}bind def -/F{0 rmoveto 0 SC 3 -1 roll widthshow}bind def -/G{0 rmoveto 0 exch ashow}bind def -/H{0 rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def -/I{0 exch rmoveto show}bind def -/J{0 exch rmoveto 0 SC 3 -1 roll widthshow}bind def -/K{0 exch rmoveto 0 exch ashow}bind def -/L{0 exch rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def -/M{rmoveto show}bind def -/N{rmoveto 0 SC 3 -1 roll widthshow}bind def -/O{rmoveto 0 exch ashow}bind def -/P{rmoveto 0 exch 0 SC 5 2 roll awidthshow}bind def -/Q{moveto show}bind def -/R{moveto 0 SC 3 -1 roll widthshow}bind def -/S{moveto 0 exch ashow}bind def -/T{moveto 0 exch 0 SC 5 2 roll awidthshow}bind def -/SF{ -findfont exch -[exch dup 0 exch 0 exch neg 0 0]makefont -dup setfont -[exch/setfont cvx]cvx bind def -}bind def -/MF{ -findfont -[5 2 roll -0 3 1 roll -neg 0 0]makefont -dup setfont -[exch/setfont cvx]cvx bind def -}bind def -/level0 0 def -/RES 0 def -/PL 0 def -/LS 0 def -/MANUAL{ -statusdict begin/manualfeed true store end -}bind def -/PLG{ -gsave newpath clippath pathbbox grestore -exch pop add exch pop -}bind def -/BP{ -/level0 save def -1 setlinecap -1 setlinejoin -72 RES div dup scale -LS{ -90 rotate -}{ -0 PL translate -}ifelse -1 -1 scale -}bind def -/EP{ -level0 restore -showpage -}bind def -/DA{ -newpath arcn stroke -}bind def -/SN{ -transform -.25 sub exch .25 sub exch -round .25 add exch round .25 add exch -itransform -}bind def -/DL{ -SN -moveto -SN -lineto stroke -}bind def -/DC{ -newpath 0 360 arc closepath -}bind def -/TM matrix def -/DE{ -TM currentmatrix pop -translate scale newpath 0 0 .5 0 360 arc closepath -TM setmatrix -}bind def -/RC/rcurveto load def -/RL/rlineto load def -/ST/stroke load def -/MT/moveto load def -/CL/closepath load def -/FL{ -currentgray exch setgray fill setgray -}bind def -/BL/fill load def -/LW/setlinewidth load def -/RE{ -findfont -dup maxlength 1 index/FontName known not{1 add}if dict begin -{ -1 index/FID ne{def}{pop pop}ifelse -}forall -/Encoding exch def -dup/FontName exch def -currentdict end definefont pop -}bind def -/DEFS 0 def -/EBEGIN{ -moveto -DEFS begin -}bind def -/EEND/end load def -/CNT 0 def -/level1 0 def -/PBEGIN{ -/level1 save def -translate -div 3 1 roll div exch scale -neg exch neg exch translate -0 setgray -0 setlinecap -1 setlinewidth -0 setlinejoin -10 setmiterlimit -[]0 setdash -/setstrokeadjust where{ -pop -false setstrokeadjust -}if -/setoverprint where{ -pop -false setoverprint -}if -newpath -/CNT countdictstack def -userdict begin -/showpage{}def -}bind def -/PEND{ -clear -countdictstack CNT sub{end}repeat -level1 restore -}bind def -end def -/setpacking where{ -pop -setpacking -}if -%%EndResource -%%IncludeResource: font Times-Roman -%%IncludeResource: font Times-Bold -%%IncludeResource: font Courier-Bold -%%IncludeResource: font Courier-Oblique -%%IncludeResource: font Symbol -%%IncludeResource: font Courier -grops begin/DEFS 1 dict def DEFS begin/u{.001 mul}bind def end/RES 72 -def/PL 792 def/LS false def/ENC0[/asciicircum/asciitilde/Scaron/Zcaron -/scaron/zcaron/Ydieresis/trademark/quotesingle/.notdef/.notdef/.notdef -/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef -/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef -/.notdef/.notdef/space/exclam/quotedbl/numbersign/dollar/percent -/ampersand/quoteright/parenleft/parenright/asterisk/plus/comma/hyphen -/period/slash/zero/one/two/three/four/five/six/seven/eight/nine/colon -/semicolon/less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N/O -/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright/circumflex -/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y -/z/braceleft/bar/braceright/tilde/.notdef/quotesinglbase/guillemotleft -/guillemotright/bullet/florin/fraction/perthousand/dagger/daggerdbl -/endash/emdash/ff/fi/fl/ffi/ffl/dotlessi/dotlessj/grave/hungarumlaut -/dotaccent/breve/caron/ring/ogonek/quotedblleft/quotedblright/oe/lslash -/quotedblbase/OE/Lslash/.notdef/exclamdown/cent/sterling/currency/yen -/brokenbar/section/dieresis/copyright/ordfeminine/guilsinglleft -/logicalnot/minus/registered/macron/degree/plusminus/twosuperior -/threesuperior/acute/mu/paragraph/periodcentered/cedilla/onesuperior -/ordmasculine/guilsinglright/onequarter/onehalf/threequarters -/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE -/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex -/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis -/multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn -/germandbls/agrave/aacute/acircumflex/atilde/adieresis/aring/ae/ccedilla -/egrave/eacute/ecircumflex/edieresis/igrave/iacute/icircumflex/idieresis -/eth/ntilde/ograve/oacute/ocircumflex/otilde/odieresis/divide/oslash -/ugrave/uacute/ucircumflex/udieresis/yacute/thorn/ydieresis]def -/Courier@0 ENC0/Courier RE/Courier-Oblique@0 ENC0/Courier-Oblique RE -/Courier-Bold@0 ENC0/Courier-Bold RE/Times-Bold@0 ENC0/Times-Bold RE -/Times-Roman@0 ENC0/Times-Roman RE -%%EndProlog -%%Page: 1 1 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(GET)72 48 Q -.834(ARG \( 3 \))-.93 F -(OpenBSD Programmer')111.062 E 2.5(sM)-.55 G 108.562(anual GET)-2.5 F --.834(ARG \( 3 \))-.93 F/F1 10/Times-Bold@0 SF -.2(NA)72 108 S(ME).2 E -/F2 10/Courier-Bold@0 SF(getarg)102 120 Q F0(,)A F2(arg_printusage)2.5 E -F0 2.52.5 G(ollect command line options)-2.5 E F1(SYNOPSIS)72 144 -Q F2(#include )102 156 Q/F3 10/Courier-Oblique@0 SF(int)102 -186 Q F2(getarg)102 198 Q F0(\()A F3(struct getargs)A/F4 10/Symbol SF(*) -6 E F3(args)A F0(,)1.666 E F3(size_t num_args)4.166 E F0(,)1.666 E F3 -(int argc)4.166 E F0(,)1.666 E F3(char)4.166 E F4(**)6 E F3(argv)A F0(,) -1.666 E F3(int)151.666 210 Q F4(*)6 E F3(optind)A F0(\);)A F3(void)102 -240 Q F2(arg_printusage)102 252 Q F0(\()A F3(struct getargs)A F4(*)6 E -F3(args)A F0(,)1.666 E F3(size_t num_args)4.166 E F0(,)1.666 E F3 -(const char)4.166 E F4(*)6 E F3(progname)A F0(,)1.666 E F3(const char) -151.666 264 Q F4(*)6 E F3(extra_string)A F0(\);)A F1(DESCRIPTION)72 300 -Q F2(getarg)102 312 Q F0 2.721 1.666(\(\) c)D 6.053(ollects an)-1.666 F -8.553(yc)-.15 G 6.053(ommand line options gi)-8.553 F -.15(ve)-.25 G -8.552(nt).15 G 8.552(oap)-8.552 G 6.052(rogram in an easily used w) --8.552 F(ay)-.1 E(.)-.65 E F2(arg_printusage)102 324 Q F0 -3.332 1.666 -(\(\) p)D(retty-prints the a)-1.666 E -.25(va)-.2 G -(ilable options, with a short help te).25 E(xt.)-.15 E F3(args)102 342 Q -F0 .855(is the option speci\214cation to use, and it')3.355 F 3.356(sa) --.55 G 3.356(na)-3.356 G .856(rray of)-3.356 F F3 .856(struct getargs) -3.356 F F0(elements.)3.356 E F3(num_args)5.856 E F0(is)3.356 E .344 -(the size of)102 354 R F3(args)2.844 E F0 .344(\(in elements\).)2.844 F -F3(argc)5.344 E F0(and)2.844 E F3(argv)2.844 E F0 .344(are the ar)2.844 -F .344(gument count and ar)-.18 F .344(gument v)-.18 F .344(ector to e) --.15 F .343(xtract op-)-.15 F 1.127(tion from.)102 366 R F3(optind)6.127 -E F0 1.127(is a pointer to an inte)3.627 F 1.127(ger where the inde)-.15 -F 3.627(xt)-.15 G 3.628(ot)-3.627 G 1.128(he last processed ar)-3.628 F -1.128(gument is stored, it)-.18 F -(must be initialised to the \214rst inde)102 378 Q 2.5(x\()-.15 G -(minus one\) to process \(normally 0\) before the \214rst call.)-2.5 E -F3(arg_printusage)102 396 Q F0(tak)4.178 E 4.178(et)-.1 G 1.678(he same) --4.178 F F3(args)4.178 E F0(and)4.178 E F3(num_args)4.178 E F0 1.678 -(as getar)4.178 F(g;)-.18 E F3 1.677(progname is the name of)4.178 F -6.381(the program \(to be)102 408 R F0(progname0)12.381 E F3(0)12.381 E -F0(progname1)A F3(1)12.381 E F0(progname2)A F3(2)12.382 E F0(progname3)A -F3(3)12.382 E F0(progname4)A F3(4)102 420 Q F0(progname5)A F3 -(extra_string)3.404 E F0 .904 -(is a string to print after the actual options to indicate more ar)3.404 -F .904(guments. The)-.18 F .025(usefulness of this function is realised\ - only be people who has used programs that has help strings that doesn') -102 432 R(t)-.18 E(match what the code does.)102 444 Q(The)102 462 Q F3 -(getargs)2.5 E F0(struct has the follo)2.5 E(wing elements.)-.25 E/F5 10 -/Courier@0 SF(struct getargs{)102 504 Q(const char)126 516 Q F4(*)6 E F5 -(long_name;)A(char short_name;)126 528 Q(enum { arg_integer,)126 540 Q -(arg_string,)165 552 Q(arg_flag,)165 564 Q(arg_negative_flag,)165 576 Q -(arg_strings,)165 588 Q(arg_double,)165 600 Q(arg_collect)168 612 Q 6 -(}t)126 624 S(ype;)-6 E(void)126 636 Q F4(*)6 E F5(value;)A(const char) -126 648 Q F4(*)6 E F5(help;)A(const char)126 660 Q F4(*)6 E F5 -(arg_help;)A(};)102 672 Q F3(long_name)102 690 Q F0 .207 -(is the long name of the option, it can be)2.707 F F5(NULL)2.706 E F0 -2.706(,i)C 2.706(fy)-2.706 G .206(ou don')-2.706 F 2.706(tw)-.18 G .206 -(ant a long name.)-2.806 F F3(short_name)5.206 E F0 .397(is the charact\ -ed to use as short option, it can be zero. If the option has a v)102 702 -R .398(alue the)-.25 F F3(value)2.898 E F0 .398 -(\214eld gets \214lled in)2.898 F -.4(RO)77 750 S 152.325(KEN September) -.4 F(24, 1999)2.5 E(1)188.865 E EP -%%Page: 2 2 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(GET)72 48 Q -.834(ARG \( 3 \))-.93 F -(OpenBSD Programmer')111.062 E 2.5(sM)-.55 G 108.562(anual GET)-2.5 F --.834(ARG \( 3 \))-.93 F .737(with that v)102 96 R .737 -(alue interpreted as speci\214ed by the)-.25 F/F1 10/Courier-Oblique@0 -SF(type)3.237 E F0(\214eld.)3.237 E F1(help)5.737 E F0 .737 -(is a longer help string for the option as a)3.237 F 2.833 -(whole, if it')102 108 R(s)-.55 E/F2 10/Courier@0 SF(NULL)5.333 E F0 -2.833(the help te)5.333 F 2.833(xt for the option is omitted \(b)-.15 F -2.834(ut it')-.2 F 5.334(ss)-.55 G 2.834 -(till displayed in the synopsis\).)-5.334 F F1(arg_help)102 120 Q F0 -.391(is a description of the ar)2.891 F .391(gument, if)-.18 F F2(NULL) -2.891 E F0 2.891(ad)2.891 G(ef)-2.891 E .39(ault v)-.1 F .39 -(alue will be used, depending on the type of)-.25 F(the option:)102 132 -Q(ar)102 150 Q(g_inte)-.18 E 59.29(ger the)-.15 F(ar)2.5 E -(gument is a signed inte)-.18 E(ger)-.15 E 2.5(,a)-.4 G(nd)-2.5 E F1 -(value)2.5 E F0(should point to an)2.5 E F1(int)2.5 E F0(.)A F1 -(arg_string)102 168 Q F0(the ar)47 E(gument is a string, and)-.18 E F1 -(value)2.5 E F0(should point to a)2.5 E F1(char)2.5 E/F3 10/Symbol SF(*) -A F0(.)A F1(arg_flag)102 186 Q F0 .4(the ar)59 F .4 -(gument is a \215ag, and)-.18 F F1(value)2.9 E F0 .4(should point to a) -2.9 F F1(int)2.9 E F0 2.9(.I)C 2.9(tg)-2.9 G .4 -(ets \214lled in with ei-)-2.9 F 1.154 -(ther zero or one, depending on ho)209 198 R 3.654(wt)-.25 G 1.153 -(he option is gi)-3.654 F -.15(ve)-.25 G 1.153 -(n, the normal case beeing).15 F .526(one. Note that if the option isn') -209 210 R 3.026(tg)-.18 G -2.15 -.25(iv e)-3.026 H .526(n, the v).25 F -.526(alue isn')-.25 F 3.026(ta)-.18 G .527(ltered, so it should be ini-) --3.026 F(tialised to some useful def)209 222 Q(ault.)-.1 E F1 -(arg_negative_flag)102 240 Q F0 .058(this is the same as)2.558 F F1 -(arg_flag)2.558 E F0 -.2(bu)2.558 G 2.558(ti).2 G 2.558(tr)-2.558 G --2.15 -.25(ev e)-2.558 H .057(rses the meaning of the \215ag \(a gi).25 -F -.15(ve)-.25 G 2.557(ns).15 G(hort)-2.557 E -(option clears the \215ag\), and the synopsis of a long option is ne)209 -252 Q -.05(ga)-.15 G(ted.).05 E F1(arg_strings)102 270 Q F0 .195(the ar) -41 F .195(gument can be gi)-.18 F -.15(ve)-.25 G 2.695(nm).15 G .195 -(ultiple times, and the v)-2.695 F .195 -(alues are collected in an array;)-.25 F F1(value)209 282 Q F0 .947 -(should be a pointer to a)3.447 F F1 .947(struct getarg_strings)3.447 F -F0 .947(structure, which)3.447 F(holds a length and a string pointer)209 -294 Q(.)-.55 E F1(arg_double)102 312 Q F0(ar)47 E .538 -(gument is a double precision \215oating point v)-.18 F .539(alue, and) --.25 F F1(value)3.039 E F0 .539(should point to a)3.039 F F1(double)209 -324 Q F0(.)A F1(arg_collect)102 342 Q F0(allo)41 E .345 -(ws more \214ne-grained control of the option parsing process.)-.25 F F1 -(value)5.344 E F0 .344(should be)2.844 F 2.5(ap)209 354 S(ointer to a) --2.5 E F1(getarg_collect_info)2.5 E F0(structure:)2.5 E F2 -(typedef int \()209 372 Q F3(*)A F2 -(getarg_collect_func\)\(int short_opt,)A(int argc,)407 384 Q(char)407 -396 Q F3(**)6 E F2(argv,)A(int)407 408 Q F3(*)6 E F2(optind,)A(int)407 -420 Q F3(*)6 E F2(optarg,)A(void)407 432 Q F3(*)6 E F2(data\);)A -(typedef struct getarg_collect_info {)209 456 Q -(getarg_collect_func func;)233 468 Q(void)233 480 Q F3(*)6 E F2(data;)A -6(}g)209 492 S(etarg_collect_info;)-6 E F0 -.4(Wi)209 510 S 1.018 -(th the).4 F F1(func)3.518 E F0 1.019 -(member set to a function to call, and)3.518 F F1(data)3.519 E F0 1.019 -(to some application)3.519 F -(speci\214c data. The parameters to the collect function are:)209 522 Q -F1(short_flag)209 540 Q F0 -(non-zero if this call is via a short option \215ag, zero otherwise)2.5 -E F1(argc)209 558 Q F0(,)A F1(argv)6 E F0(the whole ar)2.5 E -(gument list)-.18 E F1(optind)209 576 Q F0(pointer to the inde)2.5 E 2.5 -(xi)-.15 G 2.5(na)-2.5 G -.18(rg)-2.5 G 2.5(vw).18 G(here the \215ag is) --2.5 E F1(optarg)209 594 Q F0(pointer to the inde)2.5 E 2.5(xi)-.15 G -2.5(na)-2.5 G -.18(rg)-2.5 G(v[).18 E F3(*)A F0 -(optind] where the \215ag name starts)A F1(data)209 612 Q F0 -(application speci\214c data)2.5 E -1.1(Yo)209 630 S 3.915(uc)1.1 G -1.415(an modify)-3.915 F F3(*)3.915 E F1(optind)A F0 3.915(,a)C(nd) --3.915 E F3(*)3.915 E F1(optarg)A F0 3.915(,b)C 1.414 -(ut to do this correct you \(more or)-4.115 F(less\) ha)209 642 Q .3 --.15(ve t)-.2 H 2.5(ok).15 G(no)-2.5 E 2.5(wa)-.25 G(bout the inner w) --2.5 E(orkings of getar)-.1 E(g.)-.18 E -1.1(Yo)209 666 S 3.604(uc)1.1 G -1.104(an skip parts of ar)-3.604 F 1.105(guments by increasing)-.18 F F3 -(*)3.605 E F1(optarg)A F0 1.105(\(you could implement)3.605 F(the)209 -678 Q/F4 10/Courier-Bold@0 SF4.567 E F1(3)A F0 .401 -(set of \215ags from)2.901 F F4(gzip)2.9 E F0 .4 -(with this\), or whole ar)2.9 F .4(gument strings by increas-)-.18 F -(ing)209 690 Q F3(*)3.275 E F1(optind)A F0(\(let')3.275 E 3.276(ss)-.55 -G .776(ay you w)-3.276 F .776(ant a \215ag)-.1 F F44.942 E F1 -6.776(xyz)6.776 G F0 .776(to specify a coordinate\); if)-3.5 F -(you also ha)209 702 Q .3 -.15(ve t)-.2 H 2.5(os).15 G(et)-2.5 E F3(*) -2.5 E F1(optarg)A F0(to a sane v)2.5 E(alue.)-.25 E -.4(RO)77 750 S -152.325(KEN September).4 F(24, 1999)2.5 E(2)188.865 E EP -%%Page: 3 3 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(GET)72 48 Q -.834(ARG \( 3 \))-.93 F -(OpenBSD Programmer')111.062 E 2.5(sM)-.55 G 108.562(anual GET)-2.5 F --.834(ARG \( 3 \))-.93 F 9.449 -(The collect function should return one of)209 96 R/F1 10/Courier@0 SF -(ARG_ERR_NO_MATCH)11.948 E F0(,)A F1(ARG_ERR_BAD_ARG)209 108 Q F0(,)A F1 -(ARG_ERR_NO_ARG)6 E F0(on error)2.5 E 2.5(,z)-.4 G(ero otherwise.)-2.5 E --.15(Fo)209 126 S 4.042(ry).15 G 1.542(our con)-4.042 F -.15(ve)-.4 G -1.542(nience there is a function,).15 F/F2 10/Courier-Bold@0 SF -(getarg_optarg)4.042 E F0 1.542(\(\), that returns the)B 1.251 -(traditional ar)209 138 R 1.251(gument string, and you pass it all ar) --.18 F 1.251(guments, sans data, that where)-.18 F(gi)209 150 Q -.15(ve) --.25 G 2.5(nt).15 G 2.5(ot)-2.5 G(he collection function.)-2.5 E(Don') -209 168 Q 2.5(tu)-.18 G(se this more this unless you absolutely ha)-2.5 -E .3 -.15(ve t)-.2 H(o.).15 E .213(Option parsing is similar to what)102 -186 R F1(getopt)2.713 E F0 .214(uses. Short options without ar)2.714 F -.214(guments can be compressed \()-.18 F F2(\255xyz)1.666 E F0 .207 -(is the same as)102 198 R F2 1.8734.373 F F0 .207 -(\), and short options with ar)B .207(guments tak)-.18 F 2.706(et)-.1 G -.206(hese as either the rest of the ar)-2.706 F(gv-string)-.18 E -(or as the ne)102 210 Q(xt option \()-.15 E F21.666 E/F3 10 -/Courier-Oblique@0 SF(foo)A F0 2.5(,o)C(r)-2.5 E F24.166 E F3(foo) -6 E F0(\).)A .78(Long option names are pre\214x)102 228 R .781 -(ed with -- \(double dash\), and the v)-.15 F .781 -(alue with a = \(equal\),)-.25 F F2(\255-foo=)4.947 E F3(bar)A F0 3.281 -(.L)C(ong)-3.281 E 3.815 -(option \215ags can either be speci\214ed as the)102 240 R 6.315(ya)-.15 -G 3.815(re \()-6.315 F F2(\255-help)1.666 E F0 3.815 -(\), or with an \(boolean parsable\) option)B(\()102 252 Q F2 -(\255-help=)1.666 E F3(yes)A F0(,)A F2(\255-help=)5.659 E F3(true)A F0 -3.993(,o)C 3.993(rs)-3.993 G 1.493(imilar\), or the)-3.993 F 3.993(yc) --.15 G 1.493(an also be ne)-3.993 F -.05(ga)-.15 G 1.493(ted \().05 F F2 -(\255-no-help)1.666 E F0 1.493(is the same as)3.993 F F2(\255-help=) -103.666 264 Q F0 1.363(no\), and if you')B 1.362 -(re really confused you can do it multiple times \()-.5 F F2 -(\255-no-no-help=)1.666 E F3(false)A F0 3.862(,o)C(r)-3.862 E -2.15 -.25 -(ev e)102 276 T(n).25 E F2(\255-no-no-help=)4.166 E F3(maybe)A F0(\).)A -/F4 10/Times-Bold@0 SF(EXAMPLE)72 300 Q F1(#include )102 330 Q -(#include )102 342 Q(#include )102 354 Q(char)102 -378 Q/F5 10/Symbol SF(*)6 E F1(source = "Ouagadougou";)A(char)102 390 Q -F5(*)6 E F1(destination;)A(int weight;)102 402 Q -(int include_catalog = 1;)102 414 Q(int help_flag;)102 426 Q -(struct getargs args[] = {)102 450 Q 6({")126 462 S 30(source", 's',)-6 -F 6(arg_string, &source,)6 F("source of shippment", "city" },)138 474 Q -6({")126 486 S(destination", 'd', arg_string,)-6 E(&destination,)12 E -("destination of shippment", "city" },)138 498 Q 6({")126 510 S 30 -(weight", 'w',)-6 F(arg_integer, &weight,)6 E -("weight of shippment", "tons" },)138 522 Q 6({")126 534 S 24 -(catalog", 'c',)-6 F(arg_negative_flag, &include_catalog,)6 E -("include product catalog" },)138 546 Q 6({")126 558 S 42(help", 'h',)-6 -F(arg_flag, &help_flag })6 E(};)102 570 Q -(int num_args = sizeof\(args\) / sizeof\(args[0]\); /)102 594 Q F5(*)A -F1(number of elements in args)6 E F5(*)6 E F1(/)A(const char)102 618 Q -F5(*)6 E F1(progname = "ship++";)A(int)102 642 Q(main\(int argc, char) -102 654 Q F5(**)6 E F1(argv\))A({)102 666 Q(int optind = 0;)126 678 Q -(if \(getarg\(args, num_args, argc, argv, &optind\)\) {)126 690 Q -(arg_printusage\(args, num_args, progname, "stuff..."\);)147 702 Q F0 --.4(RO)77 750 S 152.325(KEN September).4 F(24, 1999)2.5 E(3)188.865 E EP -%%Page: 4 4 -%%BeginPageSetup -BP -%%EndPageSetup -/F0 10/Times-Roman@0 SF(GET)72 48 Q -.834(ARG \( 3 \))-.93 F -(OpenBSD Programmer')111.062 E 2.5(sM)-.55 G 108.562(anual GET)-2.5 F --.834(ARG \( 3 \))-.93 F/F1 10/Courier@0 SF(exit \(1\);)147 96 Q(})126 -108 Q(if \(help_flag\) {)126 120 Q -(arg_printusage\(args, num_args, progname, "stuff..."\);)147 132 Q -(exit \(0\);)147 144 Q(})126 156 Q(if \(destination == NULL\) {)126 168 -Q(fprintf\(stderr, "%s: must specify destination0, progname\);)147 180 Q -(exit\(1\);)147 192 Q(})126 204 Q -(if \(strcmp\(source, destination\) == 0\) {)126 216 Q -(fprintf\(stderr, "%s: destination must be different from source0\);)147 -228 Q(exit\(1\);)147 240 Q(})126 252 Q(/)126 264 Q/F2 10/Symbol SF(*)A -F1(include more stuff here ...)6 E F2(*)6 E F1(/)A(exit\(2\);)126 276 Q -(})102 288 Q F0(The output help output from this program looks lik)102 -306 Q 2.5(et)-.1 G(his:)-2.5 E F1 6($s)102 324 S(hip++ --help)-6 E -(Usage: ship++ [--source=city] [-s city] [--destination=city] [-d city]) -102 336 Q -([--weight=tons] [-w tons] [--no-catalog] [-c] [--help] [-h] stuff...) -120 348 Q(-s city, --source=city)102 360 Q(source of shippment)36 E -(-d city, --destination=city destination of shippment)102 372 Q -(-w tons, --weight=tons)102 384 Q(weight of shippment)36 E -(-c, --no-catalog)102 396 Q(include product catalog)72 E/F3 10 -/Times-Bold@0 SF -.1(BU)72 432 S(GS).1 E F0 .9(It should be more \215e) -102 444 R .9(xible, so it w)-.15 F .901 -(ould be possible to use other more complicated option syntax)-.1 F .901 -(es, such as)-.15 F(what)102 456 Q F1(ps)3.167 E F0 .667(\(1\), and)B F1 -(tar)3.167 E F0 .666(\(1\), uses, or the AFS model where you can skip t\ -he \215ag names as long as the options)B(come in the correct order)102 -468 Q(.)-.55 E(Options with multiple ar)102 486 Q -(guments should be handled better)-.18 E(.)-.55 E(Should be inte)102 504 -Q(greated with SL.)-.15 E(It')102 522 Q 2.5(sv)-.55 G -(ery confusing that the struct you pass in is called getar)-2.65 E(gS.) --.18 E F3 1.666(SEE ALSO)72 546 R F1(getopt)102 558 Q F0(\(3\))A -.4(RO) -77 750 S 152.325(KEN September).4 F(24, 1999)2.5 E(4)188.865 E EP -%%Trailer -end -%%EOF diff --git a/ndb/src/common/util/md5-rfc1321.txt b/ndb/src/common/util/md5-rfc1321.txt deleted file mode 100644 index c9e09e00cce..00000000000 --- a/ndb/src/common/util/md5-rfc1321.txt +++ /dev/null @@ -1,1179 +0,0 @@ - - - - - - -Network Working Group R. Rivest -Request for Comments: 1321 MIT Laboratory for Computer Science - and RSA Data Security, Inc. - April 1992 - - - The MD5 Message-Digest Algorithm - -Status of this Memo - - This memo provides information for the Internet community. It does - not specify an Internet standard. Distribution of this memo is - unlimited. - -Acknowlegements - - We would like to thank Don Coppersmith, Burt Kaliski, Ralph Merkle, - David Chaum, and Noam Nisan for numerous helpful comments and - suggestions. - -Table of Contents - - 1. Executive Summary 1 - 2. Terminology and Notation 2 - 3. MD5 Algorithm Description 3 - 4. Summary 6 - 5. Differences Between MD4 and MD5 6 - References 7 - APPENDIX A - Reference Implementation 7 - Security Considerations 21 - Author's Address 21 - -1. Executive Summary - - This document describes the MD5 message-digest algorithm. The - algorithm takes as input a message of arbitrary length and produces - as output a 128-bit "fingerprint" or "message digest" of the input. - It is conjectured that it is computationally infeasible to produce - two messages having the same message digest, or to produce any - message having a given prespecified target message digest. The MD5 - algorithm is intended for digital signature applications, where a - large file must be "compressed" in a secure manner before being - encrypted with a private (secret) key under a public-key cryptosystem - such as RSA. - - - - - - - -Rivest [Page 1] - -RFC 1321 MD5 Message-Digest Algorithm April 1992 - - - The MD5 algorithm is designed to be quite fast on 32-bit machines. In - addition, the MD5 algorithm does not require any large substitution - tables; the algorithm can be coded quite compactly. - - The MD5 algorithm is an extension of the MD4 message-digest algorithm - 1,2]. MD5 is slightly slower than MD4, but is more "conservative" in - design. MD5 was designed because it was felt that MD4 was perhaps - being adopted for use more quickly than justified by the existing - critical review; because MD4 was designed to be exceptionally fast, - it is "at the edge" in terms of risking successful cryptanalytic - attack. MD5 backs off a bit, giving up a little in speed for a much - greater likelihood of ultimate security. It incorporates some - suggestions made by various reviewers, and contains additional - optimizations. The MD5 algorithm is being placed in the public domain - for review and possible adoption as a standard. - - For OSI-based applications, MD5's object identifier is - - md5 OBJECT IDENTIFIER ::= - iso(1) member-body(2) US(840) rsadsi(113549) digestAlgorithm(2) 5} - - In the X.509 type AlgorithmIdentifier [3], the parameters for MD5 - should have type NULL. - -2. Terminology and Notation - - In this document a "word" is a 32-bit quantity and a "byte" is an - eight-bit quantity. A sequence of bits can be interpreted in a - natural manner as a sequence of bytes, where each consecutive group - of eight bits is interpreted as a byte with the high-order (most - significant) bit of each byte listed first. Similarly, a sequence of - bytes can be interpreted as a sequence of 32-bit words, where each - consecutive group of four bytes is interpreted as a word with the - low-order (least significant) byte given first. - - Let x_i denote "x sub i". If the subscript is an expression, we - surround it in braces, as in x_{i+1}. Similarly, we use ^ for - superscripts (exponentiation), so that x^i denotes x to the i-th - power. - - Let the symbol "+" denote addition of words (i.e., modulo-2^32 - addition). Let X <<< s denote the 32-bit value obtained by circularly - shifting (rotating) X left by s bit positions. Let not(X) denote the - bit-wise complement of X, and let X v Y denote the bit-wise OR of X - and Y. Let X xor Y denote the bit-wise XOR of X and Y, and let XY - denote the bit-wise AND of X and Y. - - - - - -Rivest [Page 2] - -RFC 1321 MD5 Message-Digest Algorithm April 1992 - - -3. MD5 Algorithm Description - - We begin by supposing that we have a b-bit message as input, and that - we wish to find its message digest. Here b is an arbitrary - nonnegative integer; b may be zero, it need not be a multiple of - eight, and it may be arbitrarily large. We imagine the bits of the - message written down as follows: - - m_0 m_1 ... m_{b-1} - - The following five steps are performed to compute the message digest - of the message. - -3.1 Step 1. Append Padding Bits - - The message is "padded" (extended) so that its length (in bits) is - congruent to 448, modulo 512. That is, the message is extended so - that it is just 64 bits shy of being a multiple of 512 bits long. - Padding is always performed, even if the length of the message is - already congruent to 448, modulo 512. - - Padding is performed as follows: a single "1" bit is appended to the - message, and then "0" bits are appended so that the length in bits of - the padded message becomes congruent to 448, modulo 512. In all, at - least one bit and at most 512 bits are appended. - -3.2 Step 2. Append Length - - A 64-bit representation of b (the length of the message before the - padding bits were added) is appended to the result of the previous - step. In the unlikely event that b is greater than 2^64, then only - the low-order 64 bits of b are used. (These bits are appended as two - 32-bit words and appended low-order word first in accordance with the - previous conventions.) - - At this point the resulting message (after padding with bits and with - b) has a length that is an exact multiple of 512 bits. Equivalently, - this message has a length that is an exact multiple of 16 (32-bit) - words. Let M[0 ... N-1] denote the words of the resulting message, - where N is a multiple of 16. - -3.3 Step 3. Initialize MD Buffer - - A four-word buffer (A,B,C,D) is used to compute the message digest. - Here each of A, B, C, D is a 32-bit register. These registers are - initialized to the following values in hexadecimal, low-order bytes - first): - - - - -Rivest [Page 3] - -RFC 1321 MD5 Message-Digest Algorithm April 1992 - - - word A: 01 23 45 67 - word B: 89 ab cd ef - word C: fe dc ba 98 - word D: 76 54 32 10 - -3.4 Step 4. Process Message in 16-Word Blocks - - We first define four auxiliary functions that each take as input - three 32-bit words and produce as output one 32-bit word. - - F(X,Y,Z) = XY v not(X) Z - G(X,Y,Z) = XZ v Y not(Z) - H(X,Y,Z) = X xor Y xor Z - I(X,Y,Z) = Y xor (X v not(Z)) - - In each bit position F acts as a conditional: if X then Y else Z. - The function F could have been defined using + instead of v since XY - and not(X)Z will never have 1's in the same bit position.) It is - interesting to note that if the bits of X, Y, and Z are independent - and unbiased, the each bit of F(X,Y,Z) will be independent and - unbiased. - - The functions G, H, and I are similar to the function F, in that they - act in "bitwise parallel" to produce their output from the bits of X, - Y, and Z, in such a manner that if the corresponding bits of X, Y, - and Z are independent and unbiased, then each bit of G(X,Y,Z), - H(X,Y,Z), and I(X,Y,Z) will be independent and unbiased. Note that - the function H is the bit-wise "xor" or "parity" function of its - inputs. - - This step uses a 64-element table T[1 ... 64] constructed from the - sine function. Let T[i] denote the i-th element of the table, which - is equal to the integer part of 4294967296 times abs(sin(i)), where i - is in radians. The elements of the table are given in the appendix. - - Do the following: - - /* Process each 16-word block. */ - For i = 0 to N/16-1 do - - /* Copy block i into X. */ - For j = 0 to 15 do - Set X[j] to M[i*16+j]. - end /* of loop on j */ - - /* Save A as AA, B as BB, C as CC, and D as DD. */ - AA = A - BB = B - - - -Rivest [Page 4] - -RFC 1321 MD5 Message-Digest Algorithm April 1992 - - - CC = C - DD = D - - /* Round 1. */ - /* Let [abcd k s i] denote the operation - a = b + ((a + F(b,c,d) + X[k] + T[i]) <<< s). */ - /* Do the following 16 operations. */ - [ABCD 0 7 1] [DABC 1 12 2] [CDAB 2 17 3] [BCDA 3 22 4] - [ABCD 4 7 5] [DABC 5 12 6] [CDAB 6 17 7] [BCDA 7 22 8] - [ABCD 8 7 9] [DABC 9 12 10] [CDAB 10 17 11] [BCDA 11 22 12] - [ABCD 12 7 13] [DABC 13 12 14] [CDAB 14 17 15] [BCDA 15 22 16] - - /* Round 2. */ - /* Let [abcd k s i] denote the operation - a = b + ((a + G(b,c,d) + X[k] + T[i]) <<< s). */ - /* Do the following 16 operations. */ - [ABCD 1 5 17] [DABC 6 9 18] [CDAB 11 14 19] [BCDA 0 20 20] - [ABCD 5 5 21] [DABC 10 9 22] [CDAB 15 14 23] [BCDA 4 20 24] - [ABCD 9 5 25] [DABC 14 9 26] [CDAB 3 14 27] [BCDA 8 20 28] - [ABCD 13 5 29] [DABC 2 9 30] [CDAB 7 14 31] [BCDA 12 20 32] - - /* Round 3. */ - /* Let [abcd k s t] denote the operation - a = b + ((a + H(b,c,d) + X[k] + T[i]) <<< s). */ - /* Do the following 16 operations. */ - [ABCD 5 4 33] [DABC 8 11 34] [CDAB 11 16 35] [BCDA 14 23 36] - [ABCD 1 4 37] [DABC 4 11 38] [CDAB 7 16 39] [BCDA 10 23 40] - [ABCD 13 4 41] [DABC 0 11 42] [CDAB 3 16 43] [BCDA 6 23 44] - [ABCD 9 4 45] [DABC 12 11 46] [CDAB 15 16 47] [BCDA 2 23 48] - - /* Round 4. */ - /* Let [abcd k s t] denote the operation - a = b + ((a + I(b,c,d) + X[k] + T[i]) <<< s). */ - /* Do the following 16 operations. */ - [ABCD 0 6 49] [DABC 7 10 50] [CDAB 14 15 51] [BCDA 5 21 52] - [ABCD 12 6 53] [DABC 3 10 54] [CDAB 10 15 55] [BCDA 1 21 56] - [ABCD 8 6 57] [DABC 15 10 58] [CDAB 6 15 59] [BCDA 13 21 60] - [ABCD 4 6 61] [DABC 11 10 62] [CDAB 2 15 63] [BCDA 9 21 64] - - /* Then perform the following additions. (That is increment each - of the four registers by the value it had before this block - was started.) */ - A = A + AA - B = B + BB - C = C + CC - D = D + DD - - end /* of loop on i */ - - - -Rivest [Page 5] - -RFC 1321 MD5 Message-Digest Algorithm April 1992 - - -3.5 Step 5. Output - - The message digest produced as output is A, B, C, D. That is, we - begin with the low-order byte of A, and end with the high-order byte - of D. - - This completes the description of MD5. A reference implementation in - C is given in the appendix. - -4. Summary - - The MD5 message-digest algorithm is simple to implement, and provides - a "fingerprint" or message digest of a message of arbitrary length. - It is conjectured that the difficulty of coming up with two messages - having the same message digest is on the order of 2^64 operations, - and that the difficulty of coming up with any message having a given - message digest is on the order of 2^128 operations. The MD5 algorithm - has been carefully scrutinized for weaknesses. It is, however, a - relatively new algorithm and further security analysis is of course - justified, as is the case with any new proposal of this sort. - -5. Differences Between MD4 and MD5 - - The following are the differences between MD4 and MD5: - - 1. A fourth round has been added. - - 2. Each step now has a unique additive constant. - - 3. The function g in round 2 was changed from (XY v XZ v YZ) to - (XZ v Y not(Z)) to make g less symmetric. - - 4. Each step now adds in the result of the previous step. This - promotes a faster "avalanche effect". - - 5. The order in which input words are accessed in rounds 2 and - 3 is changed, to make these patterns less like each other. - - 6. The shift amounts in each round have been approximately - optimized, to yield a faster "avalanche effect." The shifts in - different rounds are distinct. - - - - - - - - - - -Rivest [Page 6] - -RFC 1321 MD5 Message-Digest Algorithm April 1992 - - -References - - [1] Rivest, R., "The MD4 Message Digest Algorithm", RFC 1320, MIT and - RSA Data Security, Inc., April 1992. - - [2] Rivest, R., "The MD4 message digest algorithm", in A.J. Menezes - and S.A. Vanstone, editors, Advances in Cryptology - CRYPTO '90 - Proceedings, pages 303-311, Springer-Verlag, 1991. - - [3] CCITT Recommendation X.509 (1988), "The Directory - - Authentication Framework." - -APPENDIX A - Reference Implementation - - This appendix contains the following files taken from RSAREF: A - Cryptographic Toolkit for Privacy-Enhanced Mail: - - global.h -- global header file - - md5.h -- header file for MD5 - - md5c.c -- source code for MD5 - - For more information on RSAREF, send email to . - - The appendix also includes the following file: - - mddriver.c -- test driver for MD2, MD4 and MD5 - - The driver compiles for MD5 by default but can compile for MD2 or MD4 - if the symbol MD is defined on the C compiler command line as 2 or 4. - - The implementation is portable and should work on many different - plaforms. However, it is not difficult to optimize the implementation - on particular platforms, an exercise left to the reader. For example, - on "little-endian" platforms where the lowest-addressed byte in a 32- - bit word is the least significant and there are no alignment - restrictions, the call to Decode in MD5Transform can be replaced with - a typecast. - -A.1 global.h - -/* GLOBAL.H - RSAREF types and constants - */ - -/* PROTOTYPES should be set to one if and only if the compiler supports - function argument prototyping. -The following makes PROTOTYPES default to 0 if it has not already - - - -Rivest [Page 7] - -RFC 1321 MD5 Message-Digest Algorithm April 1992 - - - been defined with C compiler flags. - */ -#ifndef PROTOTYPES -#define PROTOTYPES 0 -#endif - -/* POINTER defines a generic pointer type */ -typedef unsigned char *POINTER; - -/* UINT2 defines a two byte word */ -typedef unsigned short int UINT2; - -/* UINT4 defines a four byte word */ -typedef unsigned long int UINT4; - -/* PROTO_LIST is defined depending on how PROTOTYPES is defined above. -If using PROTOTYPES, then PROTO_LIST returns the list, otherwise it - returns an empty list. - */ -#if PROTOTYPES -#define PROTO_LIST(list) list -#else -#define PROTO_LIST(list) () -#endif - -A.2 md5.h - -/* MD5.H - header file for MD5C.C - */ - -/* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All -rights reserved. - -License to copy and use this software is granted provided that it -is identified as the "RSA Data Security, Inc. MD5 Message-Digest -Algorithm" in all material mentioning or referencing this software -or this function. - -License is also granted to make and use derivative works provided -that such works are identified as "derived from the RSA Data -Security, Inc. MD5 Message-Digest Algorithm" in all material -mentioning or referencing the derived work. - -RSA Data Security, Inc. makes no representations concerning either -the merchantability of this software or the suitability of this -software for any particular purpose. It is provided "as is" -without express or implied warranty of any kind. - - - - -Rivest [Page 8] - -RFC 1321 MD5 Message-Digest Algorithm April 1992 - - -These notices must be retained in any copies of any part of this -documentation and/or software. - */ - -/* MD5 context. */ -typedef struct { - UINT4 state[4]; /* state (ABCD) */ - UINT4 count[2]; /* number of bits, modulo 2^64 (lsb first) */ - unsigned char buffer[64]; /* input buffer */ -} MD5_CTX; - -void MD5Init PROTO_LIST ((MD5_CTX *)); -void MD5Update PROTO_LIST - ((MD5_CTX *, unsigned char *, unsigned int)); -void MD5Final PROTO_LIST ((unsigned char [16], MD5_CTX *)); - -A.3 md5c.c - -/* MD5C.C - RSA Data Security, Inc., MD5 message-digest algorithm - */ - -/* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All -rights reserved. - -License to copy and use this software is granted provided that it -is identified as the "RSA Data Security, Inc. MD5 Message-Digest -Algorithm" in all material mentioning or referencing this software -or this function. - -License is also granted to make and use derivative works provided -that such works are identified as "derived from the RSA Data -Security, Inc. MD5 Message-Digest Algorithm" in all material -mentioning or referencing the derived work. - -RSA Data Security, Inc. makes no representations concerning either -the merchantability of this software or the suitability of this -software for any particular purpose. It is provided "as is" -without express or implied warranty of any kind. - -These notices must be retained in any copies of any part of this -documentation and/or software. - */ - -#include "global.h" -#include "md5.h" - -/* Constants for MD5Transform routine. - */ - - - -Rivest [Page 9] - -RFC 1321 MD5 Message-Digest Algorithm April 1992 - - -#define S11 7 -#define S12 12 -#define S13 17 -#define S14 22 -#define S21 5 -#define S22 9 -#define S23 14 -#define S24 20 -#define S31 4 -#define S32 11 -#define S33 16 -#define S34 23 -#define S41 6 -#define S42 10 -#define S43 15 -#define S44 21 - -static void MD5Transform PROTO_LIST ((UINT4 [4], unsigned char [64])); -static void Encode PROTO_LIST - ((unsigned char *, UINT4 *, unsigned int)); -static void Decode PROTO_LIST - ((UINT4 *, unsigned char *, unsigned int)); -static void MD5_memcpy PROTO_LIST ((POINTER, POINTER, unsigned int)); -static void MD5_memset PROTO_LIST ((POINTER, int, unsigned int)); - -static unsigned char PADDING[64] = { - 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -}; - -/* F, G, H and I are basic MD5 functions. - */ -#define F(x, y, z) (((x) & (y)) | ((~x) & (z))) -#define G(x, y, z) (((x) & (z)) | ((y) & (~z))) -#define H(x, y, z) ((x) ^ (y) ^ (z)) -#define I(x, y, z) ((y) ^ ((x) | (~z))) - -/* ROTATE_LEFT rotates x left n bits. - */ -#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n)))) - -/* FF, GG, HH, and II transformations for rounds 1, 2, 3, and 4. -Rotation is separate from addition to prevent recomputation. - */ -#define FF(a, b, c, d, x, s, ac) { \ - (a) += F ((b), (c), (d)) + (x) + (UINT4)(ac); \ - (a) = ROTATE_LEFT ((a), (s)); \ - - - -Rivest [Page 10] - -RFC 1321 MD5 Message-Digest Algorithm April 1992 - - - (a) += (b); \ - } -#define GG(a, b, c, d, x, s, ac) { \ - (a) += G ((b), (c), (d)) + (x) + (UINT4)(ac); \ - (a) = ROTATE_LEFT ((a), (s)); \ - (a) += (b); \ - } -#define HH(a, b, c, d, x, s, ac) { \ - (a) += H ((b), (c), (d)) + (x) + (UINT4)(ac); \ - (a) = ROTATE_LEFT ((a), (s)); \ - (a) += (b); \ - } -#define II(a, b, c, d, x, s, ac) { \ - (a) += I ((b), (c), (d)) + (x) + (UINT4)(ac); \ - (a) = ROTATE_LEFT ((a), (s)); \ - (a) += (b); \ - } - -/* MD5 initialization. Begins an MD5 operation, writing a new context. - */ -void MD5Init (context) -MD5_CTX *context; /* context */ -{ - context->count[0] = context->count[1] = 0; - /* Load magic initialization constants. -*/ - context->state[0] = 0x67452301; - context->state[1] = 0xefcdab89; - context->state[2] = 0x98badcfe; - context->state[3] = 0x10325476; -} - -/* MD5 block update operation. Continues an MD5 message-digest - operation, processing another message block, and updating the - context. - */ -void MD5Update (context, input, inputLen) -MD5_CTX *context; /* context */ -unsigned char *input; /* input block */ -unsigned int inputLen; /* length of input block */ -{ - unsigned int i, index, partLen; - - /* Compute number of bytes mod 64 */ - index = (unsigned int)((context->count[0] >> 3) & 0x3F); - - /* Update number of bits */ - if ((context->count[0] += ((UINT4)inputLen << 3)) - - - -Rivest [Page 11] - -RFC 1321 MD5 Message-Digest Algorithm April 1992 - - - < ((UINT4)inputLen << 3)) - context->count[1]++; - context->count[1] += ((UINT4)inputLen >> 29); - - partLen = 64 - index; - - /* Transform as many times as possible. -*/ - if (inputLen >= partLen) { - MD5_memcpy - ((POINTER)&context->buffer[index], (POINTER)input, partLen); - MD5Transform (context->state, context->buffer); - - for (i = partLen; i + 63 < inputLen; i += 64) - MD5Transform (context->state, &input[i]); - - index = 0; - } - else - i = 0; - - /* Buffer remaining input */ - MD5_memcpy - ((POINTER)&context->buffer[index], (POINTER)&input[i], - inputLen-i); -} - -/* MD5 finalization. Ends an MD5 message-digest operation, writing the - the message digest and zeroizing the context. - */ -void MD5Final (digest, context) -unsigned char digest[16]; /* message digest */ -MD5_CTX *context; /* context */ -{ - unsigned char bits[8]; - unsigned int index, padLen; - - /* Save number of bits */ - Encode (bits, context->count, 8); - - /* Pad out to 56 mod 64. -*/ - index = (unsigned int)((context->count[0] >> 3) & 0x3f); - padLen = (index < 56) ? (56 - index) : (120 - index); - MD5Update (context, PADDING, padLen); - - /* Append length (before padding) */ - MD5Update (context, bits, 8); - - - -Rivest [Page 12] - -RFC 1321 MD5 Message-Digest Algorithm April 1992 - - - /* Store state in digest */ - Encode (digest, context->state, 16); - - /* Zeroize sensitive information. -*/ - MD5_memset ((POINTER)context, 0, sizeof (*context)); -} - -/* MD5 basic transformation. Transforms state based on block. - */ -static void MD5Transform (state, block) -UINT4 state[4]; -unsigned char block[64]; -{ - UINT4 a = state[0], b = state[1], c = state[2], d = state[3], x[16]; - - Decode (x, block, 64); - - /* Round 1 */ - FF (a, b, c, d, x[ 0], S11, 0xd76aa478); /* 1 */ - FF (d, a, b, c, x[ 1], S12, 0xe8c7b756); /* 2 */ - FF (c, d, a, b, x[ 2], S13, 0x242070db); /* 3 */ - FF (b, c, d, a, x[ 3], S14, 0xc1bdceee); /* 4 */ - FF (a, b, c, d, x[ 4], S11, 0xf57c0faf); /* 5 */ - FF (d, a, b, c, x[ 5], S12, 0x4787c62a); /* 6 */ - FF (c, d, a, b, x[ 6], S13, 0xa8304613); /* 7 */ - FF (b, c, d, a, x[ 7], S14, 0xfd469501); /* 8 */ - FF (a, b, c, d, x[ 8], S11, 0x698098d8); /* 9 */ - FF (d, a, b, c, x[ 9], S12, 0x8b44f7af); /* 10 */ - FF (c, d, a, b, x[10], S13, 0xffff5bb1); /* 11 */ - FF (b, c, d, a, x[11], S14, 0x895cd7be); /* 12 */ - FF (a, b, c, d, x[12], S11, 0x6b901122); /* 13 */ - FF (d, a, b, c, x[13], S12, 0xfd987193); /* 14 */ - FF (c, d, a, b, x[14], S13, 0xa679438e); /* 15 */ - FF (b, c, d, a, x[15], S14, 0x49b40821); /* 16 */ - - /* Round 2 */ - GG (a, b, c, d, x[ 1], S21, 0xf61e2562); /* 17 */ - GG (d, a, b, c, x[ 6], S22, 0xc040b340); /* 18 */ - GG (c, d, a, b, x[11], S23, 0x265e5a51); /* 19 */ - GG (b, c, d, a, x[ 0], S24, 0xe9b6c7aa); /* 20 */ - GG (a, b, c, d, x[ 5], S21, 0xd62f105d); /* 21 */ - GG (d, a, b, c, x[10], S22, 0x2441453); /* 22 */ - GG (c, d, a, b, x[15], S23, 0xd8a1e681); /* 23 */ - GG (b, c, d, a, x[ 4], S24, 0xe7d3fbc8); /* 24 */ - GG (a, b, c, d, x[ 9], S21, 0x21e1cde6); /* 25 */ - GG (d, a, b, c, x[14], S22, 0xc33707d6); /* 26 */ - GG (c, d, a, b, x[ 3], S23, 0xf4d50d87); /* 27 */ - - - -Rivest [Page 13] - -RFC 1321 MD5 Message-Digest Algorithm April 1992 - - - GG (b, c, d, a, x[ 8], S24, 0x455a14ed); /* 28 */ - GG (a, b, c, d, x[13], S21, 0xa9e3e905); /* 29 */ - GG (d, a, b, c, x[ 2], S22, 0xfcefa3f8); /* 30 */ - GG (c, d, a, b, x[ 7], S23, 0x676f02d9); /* 31 */ - GG (b, c, d, a, x[12], S24, 0x8d2a4c8a); /* 32 */ - - /* Round 3 */ - HH (a, b, c, d, x[ 5], S31, 0xfffa3942); /* 33 */ - HH (d, a, b, c, x[ 8], S32, 0x8771f681); /* 34 */ - HH (c, d, a, b, x[11], S33, 0x6d9d6122); /* 35 */ - HH (b, c, d, a, x[14], S34, 0xfde5380c); /* 36 */ - HH (a, b, c, d, x[ 1], S31, 0xa4beea44); /* 37 */ - HH (d, a, b, c, x[ 4], S32, 0x4bdecfa9); /* 38 */ - HH (c, d, a, b, x[ 7], S33, 0xf6bb4b60); /* 39 */ - HH (b, c, d, a, x[10], S34, 0xbebfbc70); /* 40 */ - HH (a, b, c, d, x[13], S31, 0x289b7ec6); /* 41 */ - HH (d, a, b, c, x[ 0], S32, 0xeaa127fa); /* 42 */ - HH (c, d, a, b, x[ 3], S33, 0xd4ef3085); /* 43 */ - HH (b, c, d, a, x[ 6], S34, 0x4881d05); /* 44 */ - HH (a, b, c, d, x[ 9], S31, 0xd9d4d039); /* 45 */ - HH (d, a, b, c, x[12], S32, 0xe6db99e5); /* 46 */ - HH (c, d, a, b, x[15], S33, 0x1fa27cf8); /* 47 */ - HH (b, c, d, a, x[ 2], S34, 0xc4ac5665); /* 48 */ - - /* Round 4 */ - II (a, b, c, d, x[ 0], S41, 0xf4292244); /* 49 */ - II (d, a, b, c, x[ 7], S42, 0x432aff97); /* 50 */ - II (c, d, a, b, x[14], S43, 0xab9423a7); /* 51 */ - II (b, c, d, a, x[ 5], S44, 0xfc93a039); /* 52 */ - II (a, b, c, d, x[12], S41, 0x655b59c3); /* 53 */ - II (d, a, b, c, x[ 3], S42, 0x8f0ccc92); /* 54 */ - II (c, d, a, b, x[10], S43, 0xffeff47d); /* 55 */ - II (b, c, d, a, x[ 1], S44, 0x85845dd1); /* 56 */ - II (a, b, c, d, x[ 8], S41, 0x6fa87e4f); /* 57 */ - II (d, a, b, c, x[15], S42, 0xfe2ce6e0); /* 58 */ - II (c, d, a, b, x[ 6], S43, 0xa3014314); /* 59 */ - II (b, c, d, a, x[13], S44, 0x4e0811a1); /* 60 */ - II (a, b, c, d, x[ 4], S41, 0xf7537e82); /* 61 */ - II (d, a, b, c, x[11], S42, 0xbd3af235); /* 62 */ - II (c, d, a, b, x[ 2], S43, 0x2ad7d2bb); /* 63 */ - II (b, c, d, a, x[ 9], S44, 0xeb86d391); /* 64 */ - - state[0] += a; - state[1] += b; - state[2] += c; - state[3] += d; - - /* Zeroize sensitive information. - - - -Rivest [Page 14] - -RFC 1321 MD5 Message-Digest Algorithm April 1992 - - -*/ - MD5_memset ((POINTER)x, 0, sizeof (x)); -} - -/* Encodes input (UINT4) into output (unsigned char). Assumes len is - a multiple of 4. - */ -static void Encode (output, input, len) -unsigned char *output; -UINT4 *input; -unsigned int len; -{ - unsigned int i, j; - - for (i = 0, j = 0; j < len; i++, j += 4) { - output[j] = (unsigned char)(input[i] & 0xff); - output[j+1] = (unsigned char)((input[i] >> 8) & 0xff); - output[j+2] = (unsigned char)((input[i] >> 16) & 0xff); - output[j+3] = (unsigned char)((input[i] >> 24) & 0xff); - } -} - -/* Decodes input (unsigned char) into output (UINT4). Assumes len is - a multiple of 4. - */ -static void Decode (output, input, len) -UINT4 *output; -unsigned char *input; -unsigned int len; -{ - unsigned int i, j; - - for (i = 0, j = 0; j < len; i++, j += 4) - output[i] = ((UINT4)input[j]) | (((UINT4)input[j+1]) << 8) | - (((UINT4)input[j+2]) << 16) | (((UINT4)input[j+3]) << 24); -} - -/* Note: Replace "for loop" with standard memcpy if possible. - */ - -static void MD5_memcpy (output, input, len) -POINTER output; -POINTER input; -unsigned int len; -{ - unsigned int i; - - for (i = 0; i < len; i++) - - - -Rivest [Page 15] - -RFC 1321 MD5 Message-Digest Algorithm April 1992 - - - output[i] = input[i]; -} - -/* Note: Replace "for loop" with standard memset if possible. - */ -static void MD5_memset (output, value, len) -POINTER output; -int value; -unsigned int len; -{ - unsigned int i; - - for (i = 0; i < len; i++) - ((char *)output)[i] = (char)value; -} - -A.4 mddriver.c - -/* MDDRIVER.C - test driver for MD2, MD4 and MD5 - */ - -/* Copyright (C) 1990-2, RSA Data Security, Inc. Created 1990. All -rights reserved. - -RSA Data Security, Inc. makes no representations concerning either -the merchantability of this software or the suitability of this -software for any particular purpose. It is provided "as is" -without express or implied warranty of any kind. - -These notices must be retained in any copies of any part of this -documentation and/or software. - */ - -/* The following makes MD default to MD5 if it has not already been - defined with C compiler flags. - */ -#ifndef MD -#define MD MD5 -#endif - -#include -#include -#include -#include "global.h" -#if MD == 2 -#include "md2.h" -#endif -#if MD == 4 - - - -Rivest [Page 16] - -RFC 1321 MD5 Message-Digest Algorithm April 1992 - - -#include "md4.h" -#endif -#if MD == 5 -#include "md5.h" -#endif - -/* Length of test block, number of test blocks. - */ -#define TEST_BLOCK_LEN 1000 -#define TEST_BLOCK_COUNT 1000 - -static void MDString PROTO_LIST ((char *)); -static void MDTimeTrial PROTO_LIST ((void)); -static void MDTestSuite PROTO_LIST ((void)); -static void MDFile PROTO_LIST ((char *)); -static void MDFilter PROTO_LIST ((void)); -static void MDPrint PROTO_LIST ((unsigned char [16])); - -#if MD == 2 -#define MD_CTX MD2_CTX -#define MDInit MD2Init -#define MDUpdate MD2Update -#define MDFinal MD2Final -#endif -#if MD == 4 -#define MD_CTX MD4_CTX -#define MDInit MD4Init -#define MDUpdate MD4Update -#define MDFinal MD4Final -#endif -#if MD == 5 -#define MD_CTX MD5_CTX -#define MDInit MD5Init -#define MDUpdate MD5Update -#define MDFinal MD5Final -#endif - -/* Main driver. - -Arguments (may be any combination): - -sstring - digests string - -t - runs time trial - -x - runs test script - filename - digests file - (none) - digests standard input - */ -int main (argc, argv) -int argc; - - - -Rivest [Page 17] - -RFC 1321 MD5 Message-Digest Algorithm April 1992 - - -char *argv[]; -{ - int i; - - if (argc > 1) - for (i = 1; i < argc; i++) - if (argv[i][0] == '-' && argv[i][1] == 's') - MDString (argv[i] + 2); - else if (strcmp (argv[i], "-t") == 0) - MDTimeTrial (); - else if (strcmp (argv[i], "-x") == 0) - MDTestSuite (); - else - MDFile (argv[i]); - else - MDFilter (); - - return (0); -} - -/* Digests a string and prints the result. - */ -static void MDString (string) -char *string; -{ - MD_CTX context; - unsigned char digest[16]; - unsigned int len = strlen (string); - - MDInit (&context); - MDUpdate (&context, string, len); - MDFinal (digest, &context); - - printf ("MD%d (\"%s\") = ", MD, string); - MDPrint (digest); - printf ("\n"); -} - -/* Measures the time to digest TEST_BLOCK_COUNT TEST_BLOCK_LEN-byte - blocks. - */ -static void MDTimeTrial () -{ - MD_CTX context; - time_t endTime, startTime; - unsigned char block[TEST_BLOCK_LEN], digest[16]; - unsigned int i; - - - - -Rivest [Page 18] - -RFC 1321 MD5 Message-Digest Algorithm April 1992 - - - printf - ("MD%d time trial. Digesting %d %d-byte blocks ...", MD, - TEST_BLOCK_LEN, TEST_BLOCK_COUNT); - - /* Initialize block */ - for (i = 0; i < TEST_BLOCK_LEN; i++) - block[i] = (unsigned char)(i & 0xff); - - /* Start timer */ - time (&startTime); - - /* Digest blocks */ - MDInit (&context); - for (i = 0; i < TEST_BLOCK_COUNT; i++) - MDUpdate (&context, block, TEST_BLOCK_LEN); - MDFinal (digest, &context); - - /* Stop timer */ - time (&endTime); - - printf (" done\n"); - printf ("Digest = "); - MDPrint (digest); - printf ("\nTime = %ld seconds\n", (long)(endTime-startTime)); - printf - ("Speed = %ld bytes/second\n", - (long)TEST_BLOCK_LEN * (long)TEST_BLOCK_COUNT/(endTime-startTime)); -} - -/* Digests a reference suite of strings and prints the results. - */ -static void MDTestSuite () -{ - printf ("MD%d test suite:\n", MD); - - MDString (""); - MDString ("a"); - MDString ("abc"); - MDString ("message digest"); - MDString ("abcdefghijklmnopqrstuvwxyz"); - MDString - ("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"); - MDString - ("1234567890123456789012345678901234567890\ -1234567890123456789012345678901234567890"); -} - -/* Digests a file and prints the result. - - - -Rivest [Page 19] - -RFC 1321 MD5 Message-Digest Algorithm April 1992 - - - */ -static void MDFile (filename) -char *filename; -{ - FILE *file; - MD_CTX context; - int len; - unsigned char buffer[1024], digest[16]; - - if ((file = fopen (filename, "rb")) == NULL) - printf ("%s can't be opened\n", filename); - - else { - MDInit (&context); - while (len = fread (buffer, 1, 1024, file)) - MDUpdate (&context, buffer, len); - MDFinal (digest, &context); - - fclose (file); - - printf ("MD%d (%s) = ", MD, filename); - MDPrint (digest); - printf ("\n"); - } -} - -/* Digests the standard input and prints the result. - */ -static void MDFilter () -{ - MD_CTX context; - int len; - unsigned char buffer[16], digest[16]; - - MDInit (&context); - while (len = fread (buffer, 1, 16, stdin)) - MDUpdate (&context, buffer, len); - MDFinal (digest, &context); - - MDPrint (digest); - printf ("\n"); -} - -/* Prints a message digest in hexadecimal. - */ -static void MDPrint (digest) -unsigned char digest[16]; -{ - - - -Rivest [Page 20] - -RFC 1321 MD5 Message-Digest Algorithm April 1992 - - - unsigned int i; - - for (i = 0; i < 16; i++) - printf ("%02x", digest[i]); -} - -A.5 Test suite - - The MD5 test suite (driver option "-x") should print the following - results: - -MD5 test suite: -MD5 ("") = d41d8cd98f00b204e9800998ecf8427e -MD5 ("a") = 0cc175b9c0f1b6a831c399e269772661 -MD5 ("abc") = 900150983cd24fb0d6963f7d28e17f72 -MD5 ("message digest") = f96b697d7cb7938d525a2f31aaf161d0 -MD5 ("abcdefghijklmnopqrstuvwxyz") = c3fcd3d76192e4007dfb496cca67e13b -MD5 ("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789") = -d174ab98d277d9f5a5611c2c9f419d9f -MD5 ("123456789012345678901234567890123456789012345678901234567890123456 -78901234567890") = 57edf4a22be3c955ac49da2e2107b67a - -Security Considerations - - The level of security discussed in this memo is considered to be - sufficient for implementing very high security hybrid digital- - signature schemes based on MD5 and a public-key cryptosystem. - -Author's Address - - Ronald L. Rivest - Massachusetts Institute of Technology - Laboratory for Computer Science - NE43-324 - 545 Technology Square - Cambridge, MA 02139-1986 - - Phone: (617) 253-5880 - EMail: rivest@theory.lcs.mit.edu - - - - - - - - - - - - -Rivest [Page 21] - diff --git a/ndb/src/cw/cpcc-win32/csharp/AssemblyInfo.cs b/ndb/src/cw/cpcc-win32/csharp/AssemblyInfo.cs deleted file mode 100644 index 9f89a3282c5..00000000000 --- a/ndb/src/cw/cpcc-win32/csharp/AssemblyInfo.cs +++ /dev/null @@ -1,58 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; - -// -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -// -[assembly: AssemblyTitle("")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("")] -[assembly: AssemblyCopyright("")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: - -[assembly: AssemblyVersion("1.0.*")] - -// -// In order to sign your assembly you must specify a key to use. Refer to the -// Microsoft .NET Framework documentation for more information on assembly signing. -// -// Use the attributes below to control which key is used for signing. -// -// Notes: -// (*) If no key is specified, the assembly is not signed. -// (*) KeyName refers to a key that has been installed in the Crypto Service -// Provider (CSP) on your machine. KeyFile refers to a file which contains -// a key. -// (*) If the KeyFile and the KeyName values are both specified, the -// following processing occurs: -// (1) If the KeyName can be found in the CSP, that key is used. -// (2) If the KeyName does not exist and the KeyFile does exist, the key -// in the KeyFile is installed into the CSP and used. -// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. -// When specifying the KeyFile, the location of the KeyFile should be -// relative to the project output directory which is -// %Project Directory%\obj\. For example, if your KeyFile is -// located in the project directory, you would specify the AssemblyKeyFile -// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] -// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework -// documentation for more information on this. -// -[assembly: AssemblyDelaySign(false)] -[assembly: AssemblyKeyFile("")] -[assembly: AssemblyKeyName("")] diff --git a/ndb/src/cw/cpcc-win32/vb6/frmSplash.frm b/ndb/src/cw/cpcc-win32/vb6/frmSplash.frm deleted file mode 100644 index 56ccbd79876..00000000000 --- a/ndb/src/cw/cpcc-win32/vb6/frmSplash.frm +++ /dev/null @@ -1,159 +0,0 @@ -VERSION 5.00 -Begin VB.Form frmSplash - BorderStyle = 3 'Fixed Dialog - ClientHeight = 4710 - ClientLeft = 45 - ClientTop = 45 - ClientWidth = 7455 - ControlBox = 0 'False - LinkTopic = "Form1" - MaxButton = 0 'False - MinButton = 0 'False - ScaleHeight = 4710 - ScaleWidth = 7455 - ShowInTaskbar = 0 'False - StartUpPosition = 2 'CenterScreen - Visible = 0 'False - Begin VB.Frame fraMainFrame - Height = 4590 - Left = 45 - TabIndex = 0 - Top = -15 - Width = 7380 - Begin VB.PictureBox picLogo - Height = 2385 - Left = 510 - Picture = "frmSplash.frx":0000 - ScaleHeight = 2325 - ScaleWidth = 1755 - TabIndex = 2 - Top = 855 - Width = 1815 - End - Begin VB.Label lblLicenseTo - Alignment = 1 'Right Justify - Caption = "LicenseTo" - Height = 255 - Left = 270 - TabIndex = 1 - Tag = "LicenseTo" - Top = 300 - Width = 6855 - End - Begin VB.Label lblProductName - AutoSize = -1 'True - Caption = "Product" - BeginProperty Font - Name = "MS Sans Serif" - Size = 29.25 - Charset = 0 - Weight = 700 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - Height = 720 - Left = 2670 - TabIndex = 9 - Tag = "Product" - Top = 1200 - Width = 2190 - End - Begin VB.Label lblCompanyProduct - AutoSize = -1 'True - Caption = "CompanyProduct" - BeginProperty Font - Name = "MS Sans Serif" - Size = 18 - Charset = 0 - Weight = 700 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - Height = 435 - Left = 2505 - TabIndex = 8 - Tag = "CompanyProduct" - Top = 765 - Width = 3000 - End - Begin VB.Label lblPlatform - Alignment = 1 'Right Justify - AutoSize = -1 'True - Caption = "Platform" - BeginProperty Font - Name = "MS Sans Serif" - Size = 13.5 - Charset = 0 - Weight = 700 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - Height = 360 - Left = 5865 - TabIndex = 7 - Tag = "Platform" - Top = 2400 - Width = 1140 - End - Begin VB.Label lblVersion - Alignment = 1 'Right Justify - AutoSize = -1 'True - Caption = "Version" - BeginProperty Font - Name = "MS Sans Serif" - Size = 12 - Charset = 0 - Weight = 700 - Underline = 0 'False - Italic = 0 'False - Strikethrough = 0 'False - EndProperty - Height = 300 - Left = 6075 - TabIndex = 6 - Tag = "Version" - Top = 2760 - Width = 930 - End - Begin VB.Label lblWarning - Caption = "Warning" - Height = 195 - Left = 300 - TabIndex = 3 - Tag = "Warning" - Top = 3720 - Width = 6855 - End - Begin VB.Label lblCompany - Caption = "Company" - Height = 255 - Left = 4710 - TabIndex = 5 - Tag = "Company" - Top = 3330 - Width = 2415 - End - Begin VB.Label lblCopyright - Caption = "Copyright" - Height = 255 - Left = 4710 - TabIndex = 4 - Tag = "Copyright" - Top = 3120 - Width = 2415 - End - End -End -Attribute VB_Name = "frmSplash" -Attribute VB_GlobalNameSpace = False -Attribute VB_Creatable = False -Attribute VB_PredeclaredId = True -Attribute VB_Exposed = False -Private Sub Form_Load() - lblVersion.Caption = "Version " & App.Major & "." & App.Minor & "." & App.Revision - lblProductName.Caption = App.Title -End Sub - diff --git a/ndb/src/external/LINUX.x86/sci/include/list.h b/ndb/src/external/LINUX.x86/sci/include/list.h deleted file mode 100644 index 81c467a461b..00000000000 --- a/ndb/src/external/LINUX.x86/sci/include/list.h +++ /dev/null @@ -1,56 +0,0 @@ -/* $Id: list.h,v 1.1 2002/12/13 12:17:20 hin Exp $ */ - -/******************************************************************************* - * * - * Copyright (C) 1993 - 2000 * - * Dolphin Interconnect Solutions AS * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, * - * or (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * * - * * - *******************************************************************************/ - - - -#ifndef _LIST_H -#define _LIST_H -#include "sci_types.h" - - -typedef struct ListElement *ListElement_t; -typedef struct List *List_t; - -struct ListElement { - void *element; - u_vkaddr_t key; - ListElement_t prev,next; -}; - -void *Get_Element(ListElement_t el); -void Set_Element(ListElement_t el,void *elptr,u_vkaddr_t key); -void Create_Element(ListElement_t *el); -void Destroy_Element(ListElement_t *el); -void Create_List(List_t *list); -void Destroy_List(List_t *list); -void Add_Element(List_t list,ListElement_t el); -void Remove_Element(List_t list,ListElement_t el); -ListElement_t Find_Element(List_t list,u_vkaddr_t key); -scibool List_Empty(List_t); -scibool List_Elements(List_t); -ListElement_t First_Element(List_t list); -ListElement_t Last_Element(List_t list); -ListElement_t Next_Element(ListElement_t el); - -#endif /* _LIST_H */ diff --git a/ndb/src/external/LINUX.x86/sci/include/os/inttypes.h b/ndb/src/external/LINUX.x86/sci/include/os/inttypes.h deleted file mode 100644 index b9e5a6cb19f..00000000000 --- a/ndb/src/external/LINUX.x86/sci/include/os/inttypes.h +++ /dev/null @@ -1,53 +0,0 @@ -/* $Id: inttypes.h,v 1.1 2002/12/13 12:17:21 hin Exp $ */ - -/******************************************************************************* - * * - * Copyright (C) 1993 - 2000 * - * Dolphin Interconnect Solutions AS * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, * - * or (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * * - * * - *******************************************************************************/ - - -#ifndef _SCI_OS_INTTYPES_H_ -#define _SCI_OS_INTTYPES_H_ - -/* - * -------------------------------------------------------------------------------------- - * Basic types of various sizes. - * -------------------------------------------------------------------------------------- - */ -typedef unsigned char unsigned8; -typedef unsigned short unsigned16; -typedef unsigned int unsigned32; -typedef unsigned long long unsigned64; - -typedef signed char signed8; -typedef signed short signed16; -typedef signed int signed32; -typedef signed long long signed64; - - -#ifdef CPU_WORD_IS_64_BIT -typedef unsigned64 uptr_t; -typedef signed64 iptr_t; -#else -typedef unsigned32 uptr_t; -typedef signed32 iptr_t; -#endif - -#endif /* _SCI_OS_INTTYPES_H_ */ diff --git a/ndb/src/external/LINUX.x86/sci/include/rmlib.h b/ndb/src/external/LINUX.x86/sci/include/rmlib.h deleted file mode 100644 index 9d2722e9798..00000000000 --- a/ndb/src/external/LINUX.x86/sci/include/rmlib.h +++ /dev/null @@ -1,212 +0,0 @@ -/* $Id: rmlib.h,v 1.1 2002/12/13 12:17:20 hin Exp $ */ - -/********************************************************************************* - * * - * Copyright (C) 1993 - 2000 * - * Dolphin Interconnect Solutions AS * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License as published by * - * the Free Software Foundation; either version 2.1 of the License, * - * or (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * * - * * - *********************************************************************************/ - -/********************************************************************************/ -/* This header file contains the declarations of the SCI Reflective Memory */ -/* library rmlib. The implementation of the library functions is in rmlib.c. */ -/* The library contains all the functions that operate on the reflective */ -/* memory. */ -/* */ -/* NB! */ -/* */ -/* DOLPHIN'S SCI REFLECTIVE MEMORY FILES ARE UNDER DEVELOPMENT AND MAY CHANGE. */ -/* PLEASE CONTACT DOLPHIN FOR FURTHER INFORMATION. */ -/* */ -/* */ -/********************************************************************************/ - -#include "sisci_error.h" -#include "sisci_api.h" -#include "sisci_demolib.h" -#include "sisci_types.h" - -unsigned int seqerr, syncseqerr; - -#ifndef _RMLIB_H -#define _RMLIB_H - - -#if defined(_REENTRANT) - -#define _RMLIB_EXPAND_NAME(name) _RMLIB_MT_ ## name - -#else - -#define _RMLIB_EXPAND_NAME(name) _RMLIB_ST_ ## name - -#endif - -#ifdef __sparc -#define CACHE_SIZE 2097152 -#else -#define CACHE_SIZE 8192 -#endif - -/*********************************************************************************/ -/* FLAG VALUES */ -/*********************************************************************************/ - -#define REFLECT_ERRCHECK 0x2 - -struct ReflectiveMemorySpace { - unsigned int localAdapterNo; - unsigned int localNodeId; - unsigned int remoteNodeId; - sci_desc_t sd; - sci_desc_t syncsd; - sci_map_t localMap; - sci_map_t remoteMap; - unsigned int localSegmentId; - unsigned int remoteSegmentId; - unsigned int syncSegmentId; - unsigned int sync_rSegmentId; - unsigned int segmentSize; - unsigned int *localMapAddr; - volatile unsigned int *remoteMapAddr; - sci_local_segment_t localSegment; - sci_remote_segment_t remoteSegment; - sci_local_segment_t syncSegment; - sci_remote_segment_t sync_rSegment; - sci_map_t syncMap; - sci_map_t sync_rMap; - sci_sequence_t syncsequence; - sci_sequence_t sequence; - unsigned int protection; - unsigned int retry_value; - sci_sequence_status_t sequenceStatus, syncsequenceStatus; - volatile unsigned int *syncMapAddr; - volatile unsigned int *sync_rMapAddr; -}; - -/*********************************************************************************/ -/* P R I N T R E F L E C T I V E M E M O R Y S P A C E */ -/* */ -/*********************************************************************************/ -#define ReflectPrintParameters _RMLIB_EXPAND_NAME(ReflectPrintParameters) -void ReflectPrintParameters(FILE *stream, struct ReflectiveMemorySpace RM_space); - -/*********************************************************************************/ -/* R E F L E C T D M A S E T U P */ -/* */ -/*********************************************************************************/ -#define ReflectDmaSetup _RMLIB_EXPAND_NAME(ReflectDmaSetup) -sci_error_t ReflectDmaSetup(struct ReflectiveMemorySpace RM_space, sci_dma_queue_t *dmaQueue); - -/*********************************************************************************/ -/* R E F L E C T D M A R E M O V E */ -/* */ -/*********************************************************************************/ -#define ReflectDmaRemove _RMLIB_EXPAND_NAME(ReflectDmaRemove) -sci_error_t ReflectDmaRemove(sci_dma_queue_t dmaQueue); - -/*********************************************************************************/ -/* R E F L E C T D M A R U N */ -/* */ -/*********************************************************************************/ -#define ReflectDmaRun _RMLIB_EXPAND_NAME(ReflectDmaRun) -sci_error_t ReflectDmaRun(struct ReflectiveMemorySpace RM_space, - unsigned int* privateSrc, - unsigned int size, - unsigned int offset, - sci_dma_queue_t dmaQueue); -/*********************************************************************************/ -/* C L O S E R E F L E C T I V E M E M O R Y S P A C E */ -/* */ -/*********************************************************************************/ -#define ReflectClose _RMLIB_EXPAND_NAME(ReflectClose) -sci_error_t ReflectClose(struct ReflectiveMemorySpace RM_space, unsigned int segment_no); - -/*********************************************************************************/ -/* O P E N R E F L E C T I V E M E M O R Y S P A C E */ -/* */ -/*********************************************************************************/ -#define ReflectOpen _RMLIB_EXPAND_NAME(ReflectOpen) -sci_error_t ReflectOpen(struct ReflectiveMemorySpace *RM_space, - unsigned int size, - unsigned int segment_no, - unsigned int localAdapterNo, - unsigned int remoteNodeId, - unsigned int protection, - unsigned int retry_value); - -/*********************************************************************************/ -/* R E F L E C T G E T A C C E S S */ -/* */ -/*********************************************************************************/ -#define ReflectGetAccess _RMLIB_EXPAND_NAME(ReflectGetAccess) -sci_error_t ReflectGetAccess(struct ReflectiveMemorySpace *RM_space); - -/*********************************************************************************/ -/* R E F L E C T R E L E A S E A C C E S S */ -/* */ -/*********************************************************************************/ -#define ReflectReleaseAccess _RMLIB_EXPAND_NAME(ReflectReleaseAccess) -sci_error_t ReflectReleaseAccess(struct ReflectiveMemorySpace *RM_space); - -/*********************************************************************************/ -/* R E F L E C T D M A */ -/* */ -/*********************************************************************************/ -#define ReflectDma _RMLIB_EXPAND_NAME(ReflectDma) -sci_error_t ReflectDma(struct ReflectiveMemorySpace RM_space, - unsigned int* privateSrc, - unsigned int size, - unsigned int offset); - -/*********************************************************************************/ -/* R E F L E C T M E M C O P Y */ -/* */ -/*********************************************************************************/ -#define ReflectMemCopy _RMLIB_EXPAND_NAME(ReflectMemCopy) -sci_error_t ReflectMemCopy(struct ReflectiveMemorySpace RM_space, - unsigned int* privateSrc, - unsigned int size, - unsigned int offset, - unsigned int flags); - -/*********************************************************************************/ -/* R E F L E C T S E T */ -/* */ -/*********************************************************************************/ -#define ReflectSet _RMLIB_EXPAND_NAME(ReflectSet) -sci_error_t ReflectSet(struct ReflectiveMemorySpace RM_space, - unsigned int value, - unsigned int size, - unsigned int offset, - unsigned int flags - ); - -/*********************************************************************************/ -/* R E F L E C T P R I N T */ -/* */ -/*********************************************************************************/ -#define ReflectPrint _RMLIB_EXPAND_NAME(ReflectPrint) -sci_error_t ReflectPrint(FILE *stream, - struct ReflectiveMemorySpace RM_space, - unsigned int size, - unsigned int offset - ); - - -#endif diff --git a/ndb/src/external/LINUX.x86/sci/include/sci_errno.h b/ndb/src/external/LINUX.x86/sci/include/sci_errno.h deleted file mode 100644 index 03f3256a86f..00000000000 --- a/ndb/src/external/LINUX.x86/sci/include/sci_errno.h +++ /dev/null @@ -1,216 +0,0 @@ -/* $Id: sci_errno.h,v 1.1 2002/12/13 12:17:20 hin Exp $ */ - -/******************************************************************************* - * * - * Copyright (C) 1993 - 2000 * - * Dolphin Interconnect Solutions AS * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, * - * or (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * * - * * - *******************************************************************************/ - - - -#ifndef _SCI_ERRNO_H_ -#define _SCI_ERRNO_H_ - - -/* - * SCI Error return values always have 30 bit set - * Remote errors should have bit 0 set - */ -#define SCI_ERR_MASK 0x40000000 -#define ESCI_REMOTE_MASK 0x01000000 - -#define SCI_ERR(u) ((unsigned32)(u)&0x7FFFFFFF ) -#define _SCI_ERROR(x) ((x) | SCI_ERR_MASK) -#define _SCI_REMOTE_ERROR(x) ( _SCI_ERROR(x) | ESCI_REMOTE_MASK ) - -/* - * Error codes - */ -typedef enum { - ESCI_OK = 0x000, - ESCI_STILL_EXPORTED = _SCI_ERROR(0x800), - - ESCI_BUS_ERR = _SCI_ERROR(0x900), - ESCI_PEND_SCIERR = _SCI_ERROR(0x901), - ESCI_SCI_ERR = _SCI_ERROR(0x902), - - /* - * Specific SCI error responses: - */ - ESCI_SCI_ERR_DATA = _SCI_ERROR(0x9021), - ESCI_SCI_ERR_TYPE = _SCI_ERROR(0x9022), - ESCI_SCI_ERR_ADDR = _SCI_ERROR(0x9023), - - ESCI_LINK_TIMEOUT = _SCI_ERROR(0x903), - ESCI_EXDEV_TIMEOUT = _SCI_ERROR(0x904), - ESCI_REMOTE_ERR = _SCI_ERROR(0x905), - ESCI_MBX_BUSY = _SCI_ERROR(0x906), - ESCI_DMAERR = _SCI_ERROR(0x907), - ESCI_DMA_DISABLED = _SCI_ERROR(0x908), - ESCI_SW_MBX_SEND_FAILED = _SCI_ERROR(0x909), - ESCI_HW_MBX_SEND_FAILED = _SCI_ERROR(0x90A), - ESCI_HAS_NO_SESSION = _SCI_ERROR(0xA00), - ESCI_CONNREFUSED_SESSION = _SCI_ERROR(0xA01), - ESCI_SESSION_NOT_ESTABLISHED = _SCI_ERROR(0xA11), - ESCI_REMOTE_NO_VALID_SESSION = _SCI_ERROR(0xA02), - ESCI_SESSION_DISABLED = _SCI_ERROR(0xA03), - ESCI_NODE_CLOSED = _SCI_ERROR(0xA04), - ESCI_NODE_DISABLED = _SCI_ERROR(0xA05), - - ESCI_LOCAL_MASTER_ERR = _SCI_ERROR(0xA06), - ESCI_REMOTE_MASTER_ERR = _SCI_REMOTE_ERROR(0xA06), - - ESCI_ILLEGAL_CMD_RECEIVED = _SCI_ERROR(0xA08), - ESCI_ILLEGAL_CMD_SENT = _SCI_ERROR(0xA09), - - /* used above: ESCI_SESSION_NOT_ESTABLISHED = _SCI_ERROR(0xA11), */ - - /* - * Remote error codes - */ - ESCI_CONNREFUSED = _SCI_ERROR(0xB00), - ESCI_NODE_NOT_RESPONDING = _SCI_ERROR(0xB01), - ESCI_ISCONN = _SCI_ERROR(0xB02), - ESCI_HOSTUNREACH = _SCI_ERROR(0xB03), - ESCI_NO_SUCH_USER_ID = _SCI_ERROR(0xB04), - ESCI_REMOTE_NO_SUCH_USER_ID = _SCI_REMOTE_ERROR(0xB04), /* ESCI_NO_SUCH_USER_ID */ - ESCI_NO_SUCH_KEY = _SCI_ERROR(0xB04), /* ESCI_NO_SUCH_USER_ID */ - ESCI_REMOTE_NO_SUCH_KEY = _SCI_REMOTE_ERROR(0xB04), /* ESCI_REMOTE_NO_SUCH_USER_ID */ - ESCI_NODE_ERR = _SCI_ERROR(0xB06), - ESCI_REMOTE_NODE_ERR = _SCI_REMOTE_ERROR(0xB06), /* ESCI_NODE_ERR */ - ESCI_NOSPC = _SCI_ERROR(0xB08), - ESCI_REMOTE_NOSPC = _SCI_REMOTE_ERROR(0xB08), /* ESCI_NOSPC */ - ESCI_NODMASPC = _SCI_ERROR(0xB0A), - ESCI_REMOTE_NODMASPC = _SCI_REMOTE_ERROR(0xB0A), /* ESCI_NODMASPC */ - ESCI_NOTMAP = _SCI_ERROR(0xC00), - ESCI_ISMAP = _SCI_ERROR(0xC01), - ESCI_NOT_INITIALIZED = _SCI_ERROR(0xD00), - ESCI_REMOTE_NOT_INITIALIZED = _SCI_REMOTE_ERROR(ESCI_NOT_INITIALIZED), - /* - * ??? - */ - ESCI_PARAM_ERR = _SCI_ERROR(0xD01), - ESCI_NO_FREE_VC = _SCI_ERROR(0xD02), - ESCI_REMOTE_NO_FREE_VC = _SCI_REMOTE_ERROR(0xD02), /* ESCI_NO_FREE_VC */ - - /* - * Adapter state related error codes: - */ - ESCI_SUSPENDED = _SCI_ERROR(0xD03), - ESCI_NOT_SUSPENDED = _SCI_ERROR(0xD04), - ESCI_NOT_READY = _SCI_ERROR(0xD05), - ESCI_NOT_CONFIGURED = _SCI_ERROR(0xD06), - ESCI_INVALID_ADAPTERID = _SCI_ERROR(0xD07), /* if an adapter-id is out of range */ - ESCI_NONEXIST_ADAPTERID = _SCI_ERROR(0xD08), /* if adapter-id is valid but no adapter matches */ - ESCI_ADAPTERID_INUSE = _SCI_ERROR(0xD09), - - ESCI_INVALID_INSTANCE = _SCI_ERROR(0xD0A), - ESCI_NONEXIST_INSTANCE = _SCI_ERROR(0xD0B), - - ESCI_ADAPTER_INIT_FAILURE = _SCI_ERROR(0xD0C), - - ESCI_PAUSED = _SCI_ERROR(0xD0D), - ESCI_NOT_PAUSED = _SCI_ERROR(0xD0E), - ESCI_ADAPTER_NEED_RESET = _SCI_ERROR(0xD0F), - - ESCI_NONEXIST_SERIAL_NUMBER = _SCI_ERROR(0xD10), - ESCI_NOT_AVAILABLE = _SCI_ERROR(0xD11), - - ESCI_EACCESS = _SCI_ERROR(0xD12), - - /* - * Local error codes - */ - ESCI_NO_LOCAL_ACCESS = _SCI_ERROR(0xE00), - ESCI_LRESOURCE_BUSY = _SCI_ERROR(0xE01), - ESCI_LRESOURCE_EXIST = _SCI_ERROR(0xE02), - ESCI_NO_LRESOURCE = _SCI_ERROR(0xE03), - ESCI_NOTCONN = _SCI_ERROR(0xE04), - ESCI_LOCAL_ERR = _SCI_ERROR(0xE05), - ESCI_NOVAL_NODEID = _SCI_ERROR(0xE06), - ESCI_NOT_SUPPORTED = _SCI_ERROR(0xE07), - ESCI_TIMEOUT = _SCI_ERROR(0xE08), - ESCI_NO_LOCAL_LC_ACCESS = _SCI_ERROR(0xE0A), - ESCI_INVALID_ATT = _SCI_ERROR(0xE0B), - ESCI_BAD_CHECKSUM = _SCI_ERROR(0xE0C), - ESCI_INTERRUPT_FLAG_DISABLED = _SCI_ERROR(0xE0D), - ESCI_COND_INT_RACE_PROBLEM = _SCI_ERROR(0xE0E), - ESCI_OVERFLOW = _SCI_ERROR(0xE0F), - ESCI_BLINK_PARITY_ERROR = _SCI_ERROR(0xE10), - ESCI_FIRMWARE_VERSION_MISMATCH = _SCI_ERROR(0xE11), - - /* - * Link error codes - */ - ESCI_NO_LINK_ACCESS = _SCI_ERROR(0xF00), - ESCI_NO_REMOTE_LINK_ACCESS = _SCI_REMOTE_ERROR(0xF00), /* ESCI_NO_LINK_ACCESS */ - - ESCI_NO_SUCH_NODE = _SCI_ERROR(0xF02), - ESCI_USR_ACCESS_DISABLED = _SCI_ERROR(0xF03), - ESCI_HW_AVOID_DEADLOCK = _SCI_ERROR(0xF04), - ESCI_POTENTIAL_ERROR = _SCI_ERROR(0xF05), - - ESCI_FENCED = _SCI_ERROR(0xF06), - ESCI_SWITCH_HW_FAILURE = _SCI_ERROR(0xF07), - ESCI_SWITCH_WRONG_BLINK_ID = _SCI_ERROR(0xF08), - ESCI_SWITCH_WRONG_PORT_NUMB = _SCI_ERROR(0xF09), - ESCI_SWITCH_WRONG_INIT_TYPE = _SCI_ERROR(0xF0A), /* It is determined that the swith initialization - * do not match the local adapter initialization - */ - ESCI_SWITCH_WRONG_SWITCH_NUMB = _SCI_ERROR(0xF0B), /* It is determined that we are operationg on the - * wrong switch port - */ - ESCI_SWITCH_NOT_CONNECTED = _SCI_ERROR(0xF0C), - ESCI_SWITCH_NOT_RECOGNIZED = _SCI_ERROR(0xF0D), - ESCI_SWITCH_INIT_IN_PROGRESS = _SCI_ERROR(0xF0E), /* Switch TINI initialization in progress */ - - - ESCI_NO_BACKBONE_LINK_ACCESS = _SCI_ERROR(0xF20), - ESCI_BACKBONE_FENCED = _SCI_ERROR(0xF21), - ESCI_NO_BACKBONE_ACCESS = _SCI_ERROR(0xF22), - ESCI_BACKBONE_CABLE_PROBLEM = _SCI_ERROR(0xF23), - ESCI_BACKBONE_BLINK_PROBLEM = _SCI_ERROR(0xF24), - ESCI_BACKBONE_HWINIT_PROBLEM = _SCI_ERROR(0xF25), - ESCI_BACKBONE_ID_PROBLEM = _SCI_ERROR(0xF26), - ESCI_BACKBONE_STATE_PROBLEM = _SCI_ERROR(0xF27), - ESCI_BACKBONE_REQ_LINK_PROBLEM = _SCI_ERROR(0xF28), - ESCI_BACKBONE_UNFENCING = _SCI_ERROR(0xF29), /* Unfencing in progress */ - - /* - * added for pci port - */ - ESCI_AGAIN = _SCI_ERROR(0xF15), - ESCI_ORANGE = _SCI_ERROR(0xF16), /* Out of range */ - ESCI_NOSYS = _SCI_ERROR(0xF17), /* Used instead of ENOSYS. Means function not implemented */ - ESCI_REMOTE_NOSYS = _SCI_REMOTE_ERROR(ESCI_NOSYS), - ESCI_INTR = _SCI_ERROR(0xF18), /* Used instead of EINTR from sys/errno.h */ - ESCI_IO = _SCI_ERROR(0xF19), /* Used instead of EIO from sys/errno.h */ - ESCI_FAULT = _SCI_ERROR(0xF1A), /* Used instead of EFAULT from sys/errno.h */ - ESCI_BUSY = _SCI_ERROR(0xF1B), /* Used instead of EBUST from sys/errno.h */ - ESCI_INVAL = _SCI_ERROR(0xF1C), /* Used instead of EINVAL from sys/errno.h */ - ESCI_NXIO = _SCI_ERROR(0xF1D), /* Used instead of ENXIO from sys/errno.h */ - ESCI_EXIST = _SCI_ERROR(0xF1E) /* Used instead of EEXIST from sys/errno.h */ - -} scierror_t; - -#endif /* _SCI_ERRNO_H_ */ - - - - diff --git a/ndb/src/external/LINUX.x86/sci/include/sci_types.h b/ndb/src/external/LINUX.x86/sci/include/sci_types.h deleted file mode 100644 index 740b3a45cfd..00000000000 --- a/ndb/src/external/LINUX.x86/sci/include/sci_types.h +++ /dev/null @@ -1,300 +0,0 @@ -/* $Id: sci_types.h,v 1.1 2002/12/13 12:17:21 hin Exp $ */ - -/******************************************************************************* - * * - * Copyright (C) 1993 - 2000 * - * Dolphin Interconnect Solutions AS * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, * - * or (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * * - * * - *******************************************************************************/ - - -#ifndef _SCI_TYPES_H_ -#define _SCI_TYPES_H_ - -/* - * Remains for the time being for backward compatibility .... - */ - -/* #define UNIQUE(type) struct { type x; } * */ -#ifndef UNIQUE -#define UNIQUE(type) type -#endif -#include "os/inttypes.h" - -#if defined(WIN32) -#if defined(_KERNEL) -#include -#else -#include -#endif /* _KERNEL */ -#else -#if defined(Linux) -#if defined(__KERNEL__) -#include -#else -#include -#endif -#else -#include -#endif -#ifdef SUNOS5 -#include -#include -#endif -#ifdef OS_IS_TRU64 -#include -#endif -#ifdef OS_IS_HP_UX11 -#if defined(_KERNEL) -#include <../wsio/wsio.h> -#else -#include -#endif -#endif -#endif - -/* See comments about "UNCONFIGURED_ADAPTERS" in config.h */ -#define UNCONFIGURED_ADAPTERS 100 - -#ifndef FALSE -#define FALSE 0 -#endif - -#ifndef TRUE -#define TRUE 1 -#endif - -#ifndef NULL -#define NULL 0 -#endif - -#ifndef IN -#define IN -#endif - -#ifndef NOT -#define NOT ! -#endif - -/* - * -------------------------------------------------------------------------------------- - * Basic types of various sizes. - * -------------------------------------------------------------------------------------- - */ - -typedef signed32 scibool; -#ifndef OS_IS_VXWORKS -typedef signed32 BOOL; -#else -/* VXWORKS has already defined BOOL */ -#endif -typedef unsigned32 node_t; /* This is the logical nodeid */ -typedef unsigned32 sciNodeId_t; /* This is the physical 16 bit SCI nodeid */ - -/* - * -------------------------------------------------------------------------------------- - * Various register types. - * -------------------------------------------------------------------------------------- - */ -typedef volatile unsigned32 register32; - - -/* -Temporary for Windows NT, until we use only the above types. -*/ - -#ifdef WIN32 - -typedef unsigned char u_char; -typedef unsigned short u_short; -typedef unsigned long u_long; -typedef unsigned int u_int; -typedef char * caddr_t; - -typedef long off_t; -typedef unsigned int size_t; - -#endif -#ifdef OS_IS_VXWORKS -#include -#endif - -/* - * -------------------------------------------------------------------------------------- - * Various address types. - * - * We are using a struct * instead of unsigned long (int) inorder to enforce strong - * type checking - * - * -------------------------------------------------------------------------------------- - */ -typedef UNIQUE(void *) vkaddr_t; /* Virtual kernel address */ -typedef UNIQUE(uptr_t) vuaddr_t; /* Virtual user address */ - -typedef UNIQUE(unsigned32) remaddr_t; /* Remote IO address (physical address on PCs) */ -typedef UNIQUE(unsigned32) sciofs_lo_t; /* Lower 32 bits of an SCI offset. */ -typedef UNIQUE(unsigned32) sciofs_hi_t; /* The upper 16 bits of an SCI offset. */ - -typedef UNIQUE(unsigned32) ioaddr_t; /* Local IO address (physical address on PCs) */ -typedef unsigned32 u_ioaddr_t; -typedef unsigned32 iooffset_t; -typedef unsigned32 iosize_t; - -typedef uptr_t vkoffset_t; -typedef uptr_t u_vkaddr_t; -typedef uptr_t u_vuaddr_t; -typedef unsigned32 u_sciofs_lo_t; -typedef unsigned32 u_sciofs_hi_t; -typedef unsigned32 u_remaddr_t; -typedef unsigned32 attOffset_t; /* Address displacement from start of ATT entry */ - -typedef unsigned32 adapterNo_t; - -typedef enum { - NO_NODE = 0, - AD_MEM_NODE = 1, - AD_ALT_NODE = 2, - AD_MBX_NODE = 3, - AD_LC_NODE = 4, - AD_LC_PORT_0 = 5, - AD_LC_PORT_1 = 6, - AD_LC_PORT_2 = 7, - PHYS_NODE = 8 -} node_type_t; - - -/* - * Currently we don't support more than 32 bit sizes. - */ -#define SIZEOF(x) ((unsigned32)sizeof(x)) - -#if defined(_KERNEL) - -/* - * -------------------------------------------------------------------------------------- - * Some small macros intended to ease the transition to more strongly typed address - * types. The intention is that they in the long run shall be removed ... - * -------------------------------------------------------------------------------------- - */ -#define P2SIZE_T(x) ((size_t)((uptr_t)(x))) /* Pointer to size_t */ -#define P2U32(x) ((unsigned32)((uptr_t)(x))) /* Pointer to Unsigned 32-bit int */ -#ifdef WIN32 -#define PHADDR(x) ((ioaddr_t)(x)) -#define HASV(x) (x) -#endif -#if 0 -static vkaddr_t VKPTR (void * ptr) { return (vkaddr_t)ptr; } -static vkaddr_t VKADDR(volatile void * ptr) { return (vkaddr_t)ptr; } -#else -#define VKPTR(ptr) (vkaddr_t)ptr -#define VKADDR(ptr) (vkaddr_t)ptr -#endif - -#ifdef KLOG -#define KLOG_LOG(n,m,v) ts_log((n),(m),(v)) -#else -#define KLOG_LOG(n,m,v) -#endif /* KLOG */ - - -/* - * -------------------------------------------------------------------------------------- - * - * M E M A R E A T - * - * Memory area descriptor. - * - * paddr -- Physical address (aligned) of memory area - * ual_vaddr -- (Kernel )Virtual address of the unaligned memory area - * vaddr -- (Kernel) Virtual address of memory area - * rsize -- Real (Physical) Size of memory area - * msize -- Mapped (Virtual) Size of memory area (Size of area mapped - * into virtual) memory - * - * -------------------------------------- - * | | <----- msize ----->| | - * |<------|------- rsize ------|------>| - * -------------------------------------- - * /|\ /|\ - * | | - * ual_vaddr vaddr/paddr - * - * -------------------------------------------------------------------------------------- - */ -struct _memarea_ { - ioaddr_t ioaddr; - vkaddr_t vaddr; - vkaddr_t ual_vaddr; - size_t rsize; - size_t msize; - char *id; - unsigned32 cookie; - - -#ifdef SUNOS5 -#ifdef _USE_NEW_SOLARIS_DDI_INTERFACE - ddi_acc_handle_t mem_handle; - ddi_dma_handle_t dma_handle; -#else - ddi_dma_handle_t handle; -#endif -#endif -#ifdef OS_IS_TRU64 - dma_handle_t dma_handle; -#endif - -#if OS_IS_LINUX - unsigned long ph_base_addr; -#endif - -#ifdef OS_IS_HP_UX11 - struct isc_table_type * isc; - wsio_shmem_attr_t type; -#endif -}; - -typedef struct _memarea_ memarea_t; - -#ifdef SCI_MALLOC_DEBUG -struct _maddr_ { - char *id; - size_t size; - struct _maddr_ *next; - struct _maddr_ **prev; - unsigned32 cookie; -}; - -typedef struct _maddr_ maddr_t; - -#define MALLOC_COOKIE 0xc3c3c3c3 - -#else - -typedef struct { void *p; } *maddr_t; - -#endif /* SCI_MALLOC_DEBUG */ - - -typedef struct { - scibool disabled; - unsigned32 disable_cnt; -} disable_info_t; - -#endif /* _KERNEL */ - -#endif /* _SCI_TYPES_H_ */ diff --git a/ndb/src/external/LINUX.x86/sci/include/sisci_api.h b/ndb/src/external/LINUX.x86/sci/include/sisci_api.h deleted file mode 100644 index 38fdf54125f..00000000000 --- a/ndb/src/external/LINUX.x86/sci/include/sisci_api.h +++ /dev/null @@ -1,2170 +0,0 @@ -/* $Id: sisci_api.h,v 1.1 2002/12/13 12:17:21 hin Exp $ */ -/******************************************************************************* - * * - * Copyright (C) 1993 - 2001 * - * Dolphin Interconnect Solutions AS * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License as published by * - * the Free Software Foundation; either version 2.1 of the License, * - * or (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * * - * * - *******************************************************************************/ - -#ifndef _SISCI_API_H -#define _SISCI_API_H - -#include "sisci_types.h" -#include "sisci_error.h" - - -#ifdef WIN32 -#ifdef API_DLL -#define DLL __declspec(dllexport) -#elif CLIENT_DLL -#define DLL __declspec(dllimport) -#endif -#endif /* WIN32 */ - - -#ifndef DLL -#define DLL -#endif - -#if defined(_REENTRANT) -#define _SISCI_EXPANDE_FUNCTION_NAME(name) _SISCI_PUBLIC_FUNC_MT_ ## name -#define _SISCI_EXPANDE_VARIABLE_NAME(name) _SISCI_PUBLIC_VAR_MT_ ## name -#else -#define _SISCI_EXPANDE_FUNCTION_NAME(name) _SISCI_PUBLIC_FUNC_ST_ ## name -#define _SISCI_EXPANDE_VARIABLE_NAME(name) _SISCI_PUBLIC_VAR_ST_ ## name -#endif -#define _SISCI_EXPANDE_CONSTANT_NAME(name) _SISCI_PUBLIC_CONST_ ## name - -#if defined(CPLUSPLUS) || defined(__cplusplus) -extern "C" { -#endif - - -/*********************************************************************************/ -/* FLAG VALUES */ -/*********************************************************************************/ - -#define SCI_FLAG_FIXED_INTNO _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_FIXED_INTNO) -extern const unsigned int SCI_FLAG_FIXED_INTNO; - -#define SCI_FLAG_SHARED_INT _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_SHARED_INT) -extern const unsigned int SCI_FLAG_SHARED_INT; - -#define SCI_FLAG_FIXED_MAP_ADDR _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_FIXED_MAP_ADDR) -extern const unsigned int SCI_FLAG_FIXED_MAP_ADDR; - -#define SCI_FLAG_READONLY_MAP _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_READONLY_MAP) -extern const unsigned int SCI_FLAG_READONLY_MAP; - -#define SCI_FLAG_USE_CALLBACK _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_USE_CALLBACK) -extern const unsigned int SCI_FLAG_USE_CALLBACK; - -#define SCI_FLAG_BLOCK_READ _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_BLOCK_READ) -extern const unsigned int SCI_FLAG_BLOCK_READ; - -#define SCI_FLAG_THREAD_SAFE _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_THREAD_SAFE) -extern const unsigned int SCI_FLAG_THREAD_SAFE; - -#define SCI_FLAG_ASYNCHRONOUS_CONNECT _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_ASYNCHRONOUS_CONNECT) -extern const unsigned int SCI_FLAG_ASYNCHRONOUS_CONNECT; - -#define SCI_FLAG_EMPTY _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_EMPTY) -extern const unsigned int SCI_FLAG_EMPTY; - -#define SCI_FLAG_PRIVATE _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_PRIVATE) -extern const unsigned int SCI_FLAG_PRIVATE; - -#define SCI_FLAG_FORCE_DISCONNECT _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_FORCE_DISCONNECT) -extern const unsigned int SCI_FLAG_FORCE_DISCONNECT; - -#define SCI_FLAG_NOTIFY _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_NOTIFY) -extern const unsigned int SCI_FLAG_NOTIFY; - -#define SCI_FLAG_DMA_READ _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_DMA_READ) -extern const unsigned int SCI_FLAG_DMA_READ; - -#define SCI_FLAG_DMA_POST _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_DMA_POST) -extern const unsigned int SCI_FLAG_DMA_POST; - -#define SCI_FLAG_DMA_WAIT _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_DMA_WAIT) -extern const unsigned int SCI_FLAG_DMA_WAIT; - -#define SCI_FLAG_DMA_RESET _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_DMA_RESET) -extern const unsigned int SCI_FLAG_DMA_RESET; - -#define SCI_FLAG_NO_FLUSH _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_NO_FLUSH) -extern const unsigned int SCI_FLAG_NO_FLUSH; - -#define SCI_FLAG_NO_STORE_BARRIER _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_NO_STORE_BARRIER) -extern const unsigned int SCI_FLAG_NO_STORE_BARRIER; - -#define SCI_FLAG_FAST_BARRIER _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_FAST_BARRIER) -extern const unsigned int SCI_FLAG_FAST_BARRIER; - -#define SCI_FLAG_ERROR_CHECK _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_ERROR_CHECK) -extern const unsigned int SCI_FLAG_ERROR_CHECK; - -#define SCI_FLAG_FLUSH_CPU_BUFFERS_ONLY _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_FLUSH_CPU_BUFFERS_ONLY) -extern const unsigned int SCI_FLAG_FLUSH_CPU_BUFFERS_ONLY; - -/* the FLUSH_CPU_BUFFERS_ONLY flag is for backwards compabillity only and should never be used */ -#define FLUSH_CPU_BUFFERS_ONLY _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_FLUSH_CPU_BUFFERS_ONLY) - -#define SCI_FLAG_LOCK_OPERATION _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_LOCK_OPERATION) -extern const unsigned int SCI_FLAG_LOCK_OPERATION; - -#define SCI_FLAG_READ_PREFETCH_AGGR_HOLD_MAP _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_READ_PREFETCH_AGGR_HOLD_MAP) -extern const unsigned int SCI_FLAG_READ_PREFETCH_AGGR_HOLD_MAP; - -#define SCI_FLAG_READ_PREFETCH_NO_HOLD_MAP _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_READ_PREFETCH_NO_HOLD_MAP) -extern const unsigned int SCI_FLAG_READ_PREFETCH_NO_HOLD_MAP; - -#define SCI_FLAG_IO_MAP_IOSPACE _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_IO_MAP_IOSPACE) -extern const unsigned int SCI_FLAG_IO_MAP_IOSPACE; - -#define SCI_FLAG_DMOVE_MAP _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_DMOVE_MAP) -extern const unsigned int SCI_FLAG_DMOVE_MAP; - -#define SCI_FLAG_WRITES_DISABLE_GATHER_MAP _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_WRITES_DISABLE_GATHER_MAP) -extern const unsigned int SCI_FLAG_WRITES_DISABLE_GATHER_MAP; - -#define SCI_FLAG_DISABLE_128_BYTES_PACKETS _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_DISABLE_128_BYTES_PACKETS) -extern const unsigned int SCI_FLAG_DISABLE_128_BYTES_PACKETS; - -#define SCI_FLAG_SHARED_MAP _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_SHARED_MAP) -extern const unsigned int SCI_FLAG_SHARED_MAP; - -#define SCI_FLAG_DMA_SOURCE_ONLY _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_DMA_SOURCE_ONLY) -extern const unsigned int SCI_FLAG_DMA_SOURCE_ONLY; - -#define SCI_FLAG_CONDITIONAL_INTERRUPT _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_CONDITIONAL_INTERRUPT) -extern const unsigned int SCI_FLAG_CONDITIONAL_INTERRUPT; - -#define SCI_FLAG_CONDITIONAL_INTERRUPT_MAP _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_CONDITIONAL_INTERRUPT_MAP) -extern const unsigned int SCI_FLAG_CONDITIONAL_INTERRUPT_MAP; - -#define SCI_FLAG_UNCONDITIONAL_DATA_INTERRUPT_MAP _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_UNCONDITIONAL_DATA_INTERRUPT_MAP) -extern const unsigned int SCI_FLAG_UNCONDITIONAL_DATA_INTERRUPT_MAP; - -#define SCI_FLAG_NO_MEMORY_LOOPBACK_MAP _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_NO_MEMORY_LOOPBACK_MAP) -extern const unsigned int SCI_FLAG_NO_MEMORY_LOOPBACK_MAP; - -#if defined(OS_IS_LYNXOS) || defined(OS_IS_VXWORKS) -#define SCI_FLAG_WRITE_BACK_CACHE_MAP _SISCI_EXPANDE_CONSTANT_NAME(WRITE_BACK_CACHE_MAP) -extern const unsigned int SCI_FLAG_WRITE_BACK_CACHE_MAP; -#endif - -#define SCI_FLAG_DMA_PHDMA _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_DMA_PHDMA) -extern const unsigned int SCI_FLAG_DMA_PHDMA; - -/*********************************************************************************/ -/* GENERAL VALUES */ -/*********************************************************************************/ -#define SCI_LOCAL_HOST _SISCI_EXPANDE_CONSTANT_NAME(SCI_LOCAL_HOST) -extern const unsigned int SCI_LOCAL_HOST; - -#define SCI_INFINITE_TIMEOUT _SISCI_EXPANDE_CONSTANT_NAME(SCI_INFINITE_TIMEOUT) -extern const unsigned int SCI_INFINITE_TIMEOUT; - -/*********************************************************************************/ -/* GENERAL ERROR CODES */ -/* */ -/* SCI_ERR_ILLEGAL_FLAG - Illegal flag value. */ -/* SCI_ERR_FLAG_NOT_IMPLEMENTED - Flag legal but flag feature not implemented. */ -/* SCI_ERR_NOT_IMPLEMENTED - Function not implemented. */ -/* SCI_ERR_SYSTEM - A system error. Check errno. */ -/* SCI_ERR_NOSPC - Unable to allocate OS resources. */ -/* SCI_ERR_API_NOSPC - Unable to allocate API resources. */ -/* SCI_ERR_HW_NOSPC - Unable to allocate HW resources (Hardware) */ -/* */ -/*********************************************************************************/ - - -/*********************************************************************************/ -/* GENERAL "ADAPTER" ERROR CODES */ -/* */ -/* SCI_ERR_NO_SUCH_ADAPTERNO - Adapter number is legal but does not exist. */ -/* SCI_ERR_ILLEGAL_ADAPTERNO - Illegal local adapter number (i.e. outside */ -/* legal range). */ -/* */ -/*********************************************************************************/ - - -/*********************************************************************************/ -/* GENERAL "NODEID" ERROR CODES */ -/* */ -/* SCI_ERR_NO_SUCH_NODEID - The remote adapter identified by nodeId does */ -/* not respond, but the intermediate link(s) */ -/* seem(s) to be operational. */ -/* SCI_ERR_ILLEGAL_NODEID - Illegal NodeId. */ -/* */ -/*********************************************************************************/ - - - -/********************************************************************************* - * * - * S C I I N I T I A L I Z E * - * * - * This function initializes the SISCI library. * - * The function must be called before SCIOpen(). * - * * - * Flags: * - * None * - * * - * Specific error codes for this function: * - * * - * None * - * * - *********************************************************************************/ -#define SCIInitialize _SISCI_EXPANDE_FUNCTION_NAME(SCIInitialize) -DLL void SCIInitialize(unsigned int flags, - sci_error_t *error); -#if 0 -unsigned int __Internal_SISCI_version_var; -#endif - -/********************************************************************************* - * * - * S C I T E R M I N A T E * - * * - * This function terminates the SISCI library. * - * The function must be called after SCIClose(). * - * * - * * - *********************************************************************************/ -#define SCITerminate _SISCI_EXPANDE_FUNCTION_NAME(SCITerminate) -DLL void SCITerminate(void); - -/********************************************************************************* - * * - * S C I O P E N * - * * - * * - * Opens a SCI virtual device. * - * Caller must supply a pointer to a variable of type sci_desc_t to be * - * initialized. * - * * - * Flags * - * SCI_FLAG_THREAD_SAFE - Operations on resources associated with this * - * descriptor will be performed in a multithread-safe * - * manner. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_INCONSISTENT_VERSIONS - Inconsistency between the SISCI library * - * and the SISCI driver versions. * - * * - * * - *********************************************************************************/ -#define SCIOpen _SISCI_EXPANDE_FUNCTION_NAME(SCIOpen) -DLL void SCIOpen(sci_desc_t *sd, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I C L O S E * - * * - * This function closes an open SCI virtual device. * - * * - * Flags: * - * None * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_BUSY - All resources are not deallocated. * - * * - *********************************************************************************/ -#define SCIClose _SISCI_EXPANDE_FUNCTION_NAME(SCIClose) -DLL void SCIClose(sci_desc_t sd, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I C O N N E C T S E G M E N T * - * * - * Connects to a remote shared memory segment located at with the * - * identifier . * - * The user may then call SCIMapRemoteSegment() to map shared memory * - * into user space. * - * * - * Flags * - * SCI_FLAG_USE_CALLBACK * - * SCI_FLAG_ASYNCHRONOUS_CONNECT * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_NO_SUCH_SEGMENT - Could not find the remote segment with the * - * given segmentId. * - * SCI_ERR_CONNECTION_REFUSED - Connection attempt refused by remote node. * - * SCI_ERR_TIMEOUT - The function timed out after specified * - * timeout value. * - * SCI_ERR_NO_LINK_ACCESS - It was not possible to communicate via the * - * local adapter. * - * SCI_ERR_NO_REMOTE_LINK_ACCESS - It was not possible to communicate via a * - * remote switch port. * - * * - *********************************************************************************/ -#define SCIConnectSegment _SISCI_EXPANDE_FUNCTION_NAME(SCIConnectSegment) -DLL void SCIConnectSegment(sci_desc_t sd, - sci_remote_segment_t *segment, - unsigned int nodeId, - unsigned int segmentId, - unsigned int localAdapterNo, - sci_cb_remote_segment_t callback, - void *callbackArg, - unsigned int timeout, - unsigned int flags, - sci_error_t *error); - - -/********************************************************************************* - * * - * S C I D I S C O N N E C T S E G M E N T * - * * - * Disconnects from the give mapped shared memory segment * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_BUSY - The segment is currently mapped or in use. * - * * - *********************************************************************************/ -#define SCIDisconnectSegment _SISCI_EXPANDE_FUNCTION_NAME(SCIDisconnectSegment) -DLL void SCIDisconnectSegment(sci_remote_segment_t segment, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I G E T R E M O T E S E G M E N T S I Z E * - * * - *********************************************************************************/ -#define SCIGetRemoteSegmentSize _SISCI_EXPANDE_FUNCTION_NAME(SCIGetRemoteSegmentSize) -DLL unsigned int SCIGetRemoteSegmentSize(sci_remote_segment_t segment); - - - -/********************************************************************************* - * * - * S C I W A I T F O R R E M O T E S E G M E N T E V E N T * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_TIMEOUT - The function timed out after specified * - * timeout value. * - * SCI_ERR_ILLEGAL_OPERATION - Illegal operation. * - * SCI_ERR_CANCELLED - The wait operation has been cancelled du * - * to a SCIDisconnectSegment() on the same * - * handle. The handle is invalid when this * - * error is returned. * - * * - *********************************************************************************/ -#define SCIWaitForRemoteSegmentEvent _SISCI_EXPANDE_FUNCTION_NAME(SCIWaitForRemoteSegmentEvent) -DLL sci_segment_cb_reason_t SCIWaitForRemoteSegmentEvent( - sci_remote_segment_t segment, - sci_error_t *status, - unsigned int timeout, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I M A P R E M O T E S E G M E N T * - * * - * This function is used to include a shared memory segment in the virtual * - * address space of the application. * - * * - * Flags: * - * * - * SCI_FLAG_SHARED_MAP - The low level physical map may be shared by * - * other applications. * - * * - * SCI_FLAG_FIXED_MAP_ADDR - Map at the suggested virtual address * - * SCI_FLAG_READONLY_MAP - The segment is mapped in read-only mode * - * SCI_FLAG_LOCK_OPERATION - Enable Lock operations (fetch and add) * - * SCI_FLAG_READ_PREFETCH_AGGR_HOLD_MAP * - * - Enable aggressive prefetch with speculative * - * hold. * - * * - * SCI_FLAG_READ_PREFETCH_NO_HOLD_MAP * - * - The PSB66 will prefetch 64 bytes. As soon * - * as the PCI read retry has been accepted, * - * the stream will change state to FREE, even * - * if less than 64 bytes were actually read. * - * * - * SCI_FLAG_IO_MAP_IOSPACE - Enable No Prefetch, no speculative hold. * - * * - * SCI_FLAG_DMOVE_MAP - Enable DMOVE packet type. The stream will be * - * set into FREE state immediately. * - * * - * SCI_FLAG_WRITES_DISABLE_GATHER_MAP * - * - Disable use of gather. * - * * - * SCI_FLAG_DISABLE_128_BYTES_PACKETS * - * - Disable use of 128-Byte packets * - * * - * SCI_FLAG_CONDITIONAL_INTERRUPT_MAP * - * - Write operations through this map will cause * - * an atomic "fetch-and-add-one" operation on * - * remote memory, but in addition an interrupt * - * will be generated if the target memory * - * location contained a "null value" before the * - * add operation was carried out. * - * The conditional interrupt flag must also be * - * specified in the SCIRegisterInterruptFlag() * - * function. * - * * - * SCI_FLAG_UNCONDITIONAL_INTERRUPT_MAP * - * - Write operations through this map will cause * - * an interrupt for the remote adapter * - * "in addition to" updating the corresponding * - * remote memory location with the data being * - * written. * - * The unconditional interrupt flag must also * - * be specified in the * - * SCIRegisterInterruptFlag() function. * - * * - * SCI_FLAG_WRITE_BACK_CACHE_MAP * - * - Enable cacheing of the mapped region. * - * Writes through this map will be written to a * - * write back cache, hence no remote SCI updates* - * until the cache line is flushed. The * - * application is responsible for the cache * - * flush operation. * - * The SCImemCopy() function will handle this * - * correctly by doing cache flushes internally. * - * This feature is architechture dependent and * - * not be available on all plattforms. * - * * - * SCI_FLAG_NO_MEMORY_LOOPBACK_MAP * - * - Forces a map to a remote segment located * - * in the local machine to be mapped using * - * SCI loopback. This is useful i.e. if you * - * want to use a regular map access to be * - * serialized with lock operations. * - * The default behaviour is to access a remte * - * segment located in the local machine as a * - * local MMU operation. * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_OUT_OF_RANGE - The sum of the offset and size is * - * larger than the segment size. * - * SCI_ERR_SIZE_ALIGNMENT - Size is not correctly aligned as * - * required by the implementation. * - * SCI_ERR_OFFSET_ALIGNMENT - Offset is not correctly aligned as * - * required by the implementation. * - * * - *********************************************************************************/ -#define SCIMapRemoteSegment _SISCI_EXPANDE_FUNCTION_NAME(SCIMapRemoteSegment) -DLL volatile void *SCIMapRemoteSegment( - sci_remote_segment_t segment, - sci_map_t *map, - unsigned int offset, - unsigned int size, - void *addr, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I M A P L O C A L S E G M E N T * - * * - * Flags * - * * - * SCI_FLAG_FIXED_MAP_ADDR * - * SCI_FLAG_READONLY_MAP * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_OUT_OF_RANGE - The sum of the offset and size is * - * larger than the segment size. * - * SCI_ERR_SIZE_ALIGNMENT - Size is not correctly aligned as * - * required by the implementation. * - * SCI_ERR_OFFSET_ALIGNMENT - Offset is not correctly aligned as * - * required by the implementation. * - * * - *********************************************************************************/ -#define SCIMapLocalSegment _SISCI_EXPANDE_FUNCTION_NAME(SCIMapLocalSegment) -DLL void *SCIMapLocalSegment(sci_local_segment_t segment, - sci_map_t *map, - unsigned int offset, - unsigned int size, - void *addr, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I U N M A P S E G M E N T * - * * - * This function unmaps pages of shared memory from the callers virtual * - * address space. * - * * - * Flags * - * None. * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_BUSY - The map is currently in use. * - * * - *********************************************************************************/ -#define SCIUnmapSegment _SISCI_EXPANDE_FUNCTION_NAME(SCIUnmapSegment) -DLL void SCIUnmapSegment(sci_map_t map, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I C R E A T E S E G M E N T * - * * - * Make the specified segment available for connections via the specified * - * adapter. If successful, the segment can be accessed from remote nodes * - * via the specified adapter. * - * * - * Flags: * - * * - * SCI_FLAG_USE_CALLBACK - The callback function will be invoked for events * - * on this segment. * - * SCI_FLAG_EMPTY - No memory will be allocated for the segment. * - * SCI_FLAG_PRIVATE - The segment will be private meaning it will never * - * be any connections to it. * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_SEGMENTID_USED - The segment with this segmentId is already used * - * SCI_ERR_SIZE_ALIGNMENT - Size is not correctly aligned as required * - * by the implementation. * - * * - *********************************************************************************/ -#define SCICreateSegment _SISCI_EXPANDE_FUNCTION_NAME(SCICreateSegment) -DLL void SCICreateSegment(sci_desc_t sd, - sci_local_segment_t *segment, - unsigned int segmentId, - unsigned int size, - sci_cb_local_segment_t callback, - void *callbackArg, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I W A I T F O R L O C A L S E G M E N T E V E N T * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_TIMEOUT - The function timed out after specified timeout value. * - * SCI_ERR_CANCELLED - The wait operation has been cancelled du to a * - * SCIRemoveSegment() on the same handle. * - * The handle is invalid when this error is returned. * - * * - *********************************************************************************/ -#define SCIWaitForLocalSegmentEvent _SISCI_EXPANDE_FUNCTION_NAME(SCIWaitForLocalSegmentEvent) -DLL sci_segment_cb_reason_t SCIWaitForLocalSegmentEvent( - sci_local_segment_t segment, - unsigned int *sourcenodeId, - unsigned int *localAdapterNo, - unsigned int timeout, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I P R E P A R E S E G M E N T * - * * - * Flags * - * * - * SCI_FLAG_DMA_SOURCE_ONLY - The segment will be used as a source segment * - * for DMA operations. On some system types this * - * will enable the SISCI driver to use performance * - * improving features. * - * * - * Specific error codes for this function: * - * * - * * - *********************************************************************************/ -#define SCIPrepareSegment _SISCI_EXPANDE_FUNCTION_NAME(SCIPrepareSegment) -DLL void SCIPrepareSegment(sci_local_segment_t segment, - unsigned int localAdapterNo, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I R E M O V E S E G M E N T * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_BUSY - Unable to remove the segment. The segment is currently * - * in use. * - * * - *********************************************************************************/ -#define SCIRemoveSegment _SISCI_EXPANDE_FUNCTION_NAME(SCIRemoveSegment) -DLL void SCIRemoveSegment(sci_local_segment_t segment, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I S E T S E G M E N T A V A I L A B L E * - * * - * Flags * - * None. * - * * - * * - * SCI_ERR_SEGMENT_NOT_PREPARED - The segment has not been prepared for access * - * from this adapter. * - * SCI_ERR_ILLEGAL_OPERATION - The segment is created with the * - * SCI_FLAG_PRIVATE flag specified and * - * therefore has no segmentId. * - * * - *********************************************************************************/ -#define SCISetSegmentAvailable _SISCI_EXPANDE_FUNCTION_NAME(SCISetSegmentAvailable) -DLL void SCISetSegmentAvailable(sci_local_segment_t segment, - unsigned int localAdapterNo, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I S E T S E G M E N T U N A V A I L A B L E * - * * - * Flags * - * * - * SCI_FLAG_FORCE_DISCONNECT * - * SCI_FLAG_NOTIFY * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_ILLEGAL_OPERATION - Illegal operation. * - * * - *********************************************************************************/ -#define SCISetSegmentUnavailable _SISCI_EXPANDE_FUNCTION_NAME(SCISetSegmentUnavailable) -DLL void SCISetSegmentUnavailable(sci_local_segment_t segment, - unsigned int localAdapterNo, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I C R E A T E M A P S E Q U E N C E * - * * - * Flags: * - * * - * SCI_FLAG_FAST_BARRIER * - * * - * * - * Specific error codes for this function: * - * * - *********************************************************************************/ -#define SCICreateMapSequence _SISCI_EXPANDE_FUNCTION_NAME(SCICreateMapSequence) -DLL void SCICreateMapSequence(sci_map_t map, - sci_sequence_t *sequence, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I R E M O V E S E Q U E N C E * - * * - * Flags: * - * None * - * * - * Specific error codes for this function: * - * * - *********************************************************************************/ -#define SCIRemoveSequence _SISCI_EXPANDE_FUNCTION_NAME(SCIRemoveSequence) -DLL void SCIRemoveSequence(sci_sequence_t sequence, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I S T A R T S E Q U E N C E * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * * - *********************************************************************************/ -#define SCIStartSequence _SISCI_EXPANDE_FUNCTION_NAME(SCIStartSequence) -DLL sci_sequence_status_t SCIStartSequence(sci_sequence_t sequence, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I C H E C K S E Q U E N CE * - * * - * Flags * - * * - * SCI_FLAG_NO_FLUSH * - * SCI_FLAG_NO_STORE_BARRIER * - * * - * * - * Specific error codes for this function: * - * * - *********************************************************************************/ -#define SCICheckSequence _SISCI_EXPANDE_FUNCTION_NAME(SCICheckSequence) -DLL sci_sequence_status_t SCICheckSequence(sci_sequence_t sequence, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I S T O R E B A R R I E R * - * * - * Flags * - * None. * - * * - * * - * * - *********************************************************************************/ -#define SCIStoreBarrier _SISCI_EXPANDE_FUNCTION_NAME(SCIStoreBarrier) -DLL void SCIStoreBarrier(sci_sequence_t sequence, - unsigned int flags); - - - - -/********************************************************************************* - * * - * S C I F L U S H R E A D B U F F E R S * - * * - *********************************************************************************/ -#define SCIFlushReadBuffers _SISCI_EXPANDE_FUNCTION_NAME(SCIFlushReadBuffers) -DLL void SCIFlushReadBuffers(sci_sequence_t sequence); - - - - -/********************************************************************************* - * * - * S C I P R O B E N O D E * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_NO_LINK_ACCESS - It was not possible to communicate via the * - * local adapter. * - * SCI_ERR_NO_REMOTE_LINK_ACCESS - It was not possible to communicate via a * - * remote switch port. * - * * - *********************************************************************************/ -#define SCIProbeNode _SISCI_EXPANDE_FUNCTION_NAME(SCIProbeNode) -DLL int SCIProbeNode(sci_desc_t sd, - unsigned int localAdapterNo, - unsigned int nodeId, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I G E T C S R R E G I S T E R * - * * - * SISCI Priveleged function * - * * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_NO_LINK_ACCESS - It was not possible to communicate via the * - * local adapter. * - * SCI_ERR_NO_REMOTE_LINK_ACCESS - It was not possible to communicate via a * - * remote switch port. * - * * - *********************************************************************************/ -#define SCIGetCSRRegister _SISCI_EXPANDE_FUNCTION_NAME(SCIGetCSRRegister) -DLL unsigned int SCIGetCSRRegister(sci_desc_t sd, - unsigned int localAdapterNo, - unsigned int SCINodeId, - unsigned int CSROffset, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I S E T C S R R E G I S T E R * - * * - * SISCI Priveleged function * - * * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_NO_LINK_ACCESS - It was not possible to communicate via the * - * local adapter. * - * SCI_ERR_NO_REMOTE_LINK_ACCESS - It was not possible to communicate via a * - * remote switch port. * - * * - *********************************************************************************/ -#define SCISetCSRRegister _SISCI_EXPANDE_FUNCTION_NAME(SCISetCSRRegister) -DLL void SCISetCSRRegister(sci_desc_t sd, - unsigned int localAdapterNo, - unsigned int SCINodeId, - unsigned int CSROffset, - unsigned int CSRValue, - unsigned int flags, - sci_error_t *error); - - -/********************************************************************************* - * * - * S C I G E T L O C A L C S R * - * * - * SISCI Priveleged function * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * * - *********************************************************************************/ -#define SCIGetLocalCSR _SISCI_EXPANDE_FUNCTION_NAME(SCIGetLocalCSR) -DLL unsigned int SCIGetLocalCSR(sci_desc_t sd, - unsigned int localAdapterNo, - unsigned int CSROffset, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I S E T L O C A L C S R * - * * - * SISCI Priveleged function - * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * * - *********************************************************************************/ -#define SCISetLocalCSR _SISCI_EXPANDE_FUNCTION_NAME(SCISetLocalCSR) -DLL void SCISetLocalCSR(sci_desc_t sd, - unsigned int localAdapterNo, - unsigned int CSROffset, - unsigned int CSRValue, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I A T T A C H P H Y S I C A L M E M O R Y * - * * - * SISCI Priveleged function * - * * - * Description: * - * * - * This function enables usage of physical devices and memory regions where the * - * Physical PCI bus address ( and mapped CPU address ) are already known. * - * The function will register the physical memory as a SISCI segment which can * - * be connected and mapped as a regular SISCI segment. * - * * - * Requirements: * - * * - * SCICreateSegment() with flag SCI_FLAG_EMPTY must have been called in advance * - * * - * Parameter description: * - * sci_ioaddr_t ioaddress : This is the address on the PCI bus that a PCI bus * - * master has to use to write to the specified memory * - * void * address : This is the (mapped) virtual address that the * - * application has to use to access the device. * - * This means that the device has to be mapped in * - * advance bye the devices own driver. * - * If the device is not to be accessed by the local * - * CPU, the address pointer shold be set to NULL * - * Flags * - * * - * None * - * * - * * - * Specific error codes for this function: * - * * - * * - *********************************************************************************/ -#define SCIAttachPhysicalMemory _SISCI_EXPANDE_FUNCTION_NAME(SCIAttachPhysicalMemory) -DLL void SCIAttachPhysicalMemory(sci_ioaddr_t ioaddress, - void *address, - unsigned int busNo, - unsigned int size, - sci_local_segment_t segment, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I Q U E R Y * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_ILLEGAL_QUERY - Unrecognized command. * - * * - *********************************************************************************/ -#define SCIQuery _SISCI_EXPANDE_FUNCTION_NAME(SCIQuery) -DLL void SCIQuery(unsigned int command, - void *data, - unsigned int flags, - sci_error_t *error); - - -/* MAJOR QUERY COMMANDS */ - -/* This command requires a pointer to a structure of type */ -/* "sci_query_string". The string will be filled in by the query. */ -#define SCI_Q_VENDORID _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_VENDORID) -extern const unsigned int SCI_Q_VENDORID; - - -/* Same as for SCI_VENDOR_ID */ -#define SCI_Q_API _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_API) -extern const unsigned int SCI_Q_API; - - -/* User passes a pointer to an allocated object of the */ -/* "sci_query_adapter" struct. */ -#define SCI_Q_ADAPTER _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER) -extern const unsigned int SCI_Q_ADAPTER; - - -/* User passes a pointer to an allocated object of the */ -/* "sci_query_system" struct. */ -#define SCI_Q_SYSTEM _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_SYSTEM) -extern const unsigned int SCI_Q_SYSTEM; - -#define SCI_Q_LOCAL_SEGMENT _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_LOCAL_SEGMENT) -extern const unsigned int SCI_Q_LOCAL_SEGMENT; - -#define SCI_Q_REMOTE_SEGMENT _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_REMOTE_SEGMENT) -extern const unsigned int SCI_Q_REMOTE_SEGMENT; - -#define SCI_Q_MAP _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_MAP) -extern const unsigned int SCI_Q_MAP; - -typedef struct { - char *str; /* Pointer to a string of minimum "length" characters */ - unsigned int length; -} sci_query_string_t; - - -typedef struct { - unsigned int localAdapterNo; /* The adapter no. that the query concern. */ - unsigned int portNo; /* The SCI Link port number that the query concern. */ - unsigned int subcommand; /* A subcommand as specified below. */ - void *data; /* A pointer to an unsigned int that will return */ - /* the response to the query. */ -} sci_query_adapter_t; - - -typedef struct { - unsigned int subcommand; /* A subcommand as specified below. */ - void *data; /* A pointer to an unsigned int that will return */ - /* the response to the query. */ -} sci_query_system_t; - -typedef struct { - sci_local_segment_t segment; - unsigned int subcommand; - union { - sci_ioaddr_t ioaddr; - } data; -} sci_query_local_segment_t; - -typedef struct { - sci_remote_segment_t segment; - unsigned int subcommand; - union { - sci_ioaddr_t ioaddr; - } data; -} sci_query_remote_segment_t; - -typedef struct { - sci_map_t map; - unsigned int subcommand; - unsigned int data; -} sci_query_map_t; - -/* Minor query commands (sub-commands) for adapter specific information SCI_ADAPTER */ -#define SCI_Q_ADAPTER_DMA_SIZE_ALIGNMENT _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_DMA_SIZE_ALIGNMENT) -extern const unsigned int SCI_Q_ADAPTER_DMA_SIZE_ALIGNMENT; - -#define SCI_Q_ADAPTER_DMA_OFFSET_ALIGNMENT _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_DMA_OFFSET_ALIGNMENT) -extern const unsigned int SCI_Q_ADAPTER_DMA_OFFSET_ALIGNMENT; - -#define SCI_Q_ADAPTER_DMA_MTU _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_DMA_MTU) -extern const unsigned int SCI_Q_ADAPTER_DMA_MTU; - -#define SCI_Q_ADAPTER_SUGGESTED_MIN_DMA_SIZE _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_SUGGESTED_MIN_DMA_SIZE) -extern const unsigned int SCI_Q_ADAPTER_SUGGESTED_MIN_DMA_SIZE; - -#define SCI_Q_ADAPTER_SUGGESTED_MIN_BLOCK_SIZE _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_SUGGESTED_MIN_BLOCK_SIZE) -extern const unsigned int SCI_Q_ADAPTER_SUGGESTED_MIN_BLOCK_SIZE; - -#define SCI_Q_ADAPTER_NODEID _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_NODEID) -extern const unsigned int SCI_Q_ADAPTER_NODEID; - -#define SCI_Q_ADAPTER_SERIAL_NUMBER _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_SERIAL_NUMBER) -extern const unsigned int SCI_Q_ADAPTER_SERIAL_NUMBER; - -#define SCI_Q_ADAPTER_CARD_TYPE _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_CARD_TYPE) -extern const unsigned int SCI_Q_ADAPTER_CARD_TYPE; - -#define SCI_Q_ADAPTER_NUMBER_OF_STREAMS _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_NUMBER_OF_STREAMS) -extern const unsigned int SCI_Q_ADAPTER_NUMBER_OF_STREAMS; - -#define SCI_Q_ADAPTER_STREAM_BUFFER_SIZE _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_STREAM_BUFFER_SIZE) -extern const unsigned int SCI_Q_ADAPTER_STREAM_BUFFER_SIZE; - -#define SCI_Q_ADAPTER_CONFIGURED _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_CONFIGURED) -extern const unsigned int SCI_Q_ADAPTER_CONFIGURED; - -#define SCI_Q_ADAPTER_LINK_OPERATIONAL _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_LINK_OPERATIONAL) -extern const unsigned int SCI_Q_ADAPTER_LINK_OPERATIONAL; - -#define SCI_Q_ADAPTER_HW_LINK_STATUS_IS_OK _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_HW_LINK_STATUS_IS_OK) -extern const unsigned int SCI_Q_ADAPTER_HW_LINK_STATUS_IS_OK; - -#define SCI_Q_ADAPTER_NUMBER _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_NUMBER) -extern const unsigned int SCI_Q_ADAPTER_NUMBER; - -#define SCI_Q_ADAPTER_INSTANCE_NUMBER _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_INSTANCE_NUMBER) -extern const unsigned int SCI_Q_ADAPTER_INSTANCE_NUMBER; - -#define SCI_Q_ADAPTER_FIRMWARE_OK _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_FIRMWARE_OK) -extern const unsigned int SCI_Q_ADAPTER_FIRMWARE_OK; - -#define SCI_Q_ADAPTER_CONNECTED_TO_SWITCH _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_CONNECTED_TO_SWITCH) -extern const unsigned int SCI_Q_ADAPTER_CONNECTED_TO_SWITCH; - -#define SCI_Q_ADAPTER_LOCAL_SWITCH_TYPE _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_LOCAL_SWITCH_TYPE) -extern const unsigned int SCI_Q_ADAPTER_LOCAL_SWITCH_TYPE; - -#define SCI_Q_ADAPTER_LOCAL_SWITCH_PORT_NUMBER _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_LOCAL_SWITCH_PORT_NUMBER) -extern const unsigned int SCI_Q_ADAPTER_LOCAL_SWITCH_PORT_NUMBER; - -#define SCI_Q_ADAPTER_CONNECTED_TO_EXPECTED_SWITCH_PORT _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_CONNECTED_TO_EXPECTED_SWITCH_PORT) -extern const unsigned int SCI_Q_ADAPTER_CONNECTED_TO_EXPECTED_SWITCH_PORT; - -#define SCI_Q_ADAPTER_ATT_PAGE_SIZE _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_ATT_PAGE_SIZE) -extern const unsigned int SCI_Q_ADAPTER_ATT_PAGE_SIZE; - -#define SCI_Q_ADAPTER_ATT_NUMBER_OF_ENTRIES _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_ATT_NUMBER_OF_ENTRIES) -extern const unsigned int SCI_Q_ADAPTER_ATT_NUMBER_OF_ENTRIES; - -#define SCI_Q_ADAPTER_ATT_AVAILABLE_ENTRIES _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_ATT_AVAILABLE_ENTRIES) -extern const unsigned int SCI_Q_ADAPTER_ATT_AVAILABLE_ENTRIES; - -#define SCI_Q_ADAPTER_PHYS_MEM_NODEID _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_SCI_Q_ADAPTER_PHYS_MEM_NODEID) -extern const unsigned int SCI_Q_ADAPTER_PHYS_MEM_NODEID; - -#define SCI_Q_ADAPTER_PHYS_MBX_NODEID _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_SCI_Q_ADAPTER_PHYS_MBX_NODEID) -extern const unsigned int SCI_Q_ADAPTER_PHYS_MBX_NODEID; - -#define SCI_Q_ADAPTER_PHYS_LINK_PORT_NODEID _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_PHYS_LINK_PORT_NODEID) -extern const unsigned int SCI_Q_ADAPTER_PHYS_LINK_PORT_NODEID; - -#define SCI_Q_ADAPTER_SCI_LINK_FREQUENCY _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_SCI_LINK_FREQUENCY) -extern const unsigned int SCI_Q_ADAPTER_SCI_LINK_FREQUENCY; - -#define SCI_Q_ADAPTER_B_LINK_FREQUENCY _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_B_LINK_FREQUENCY) -extern const unsigned int SCI_Q_ADAPTER_B_LINK_FREQUENCY; - -#define SCI_Q_ADAPTER_IO_BUS_FREQUENCY _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_IO_BUS_FREQUENCY) -extern const unsigned int SCI_Q_ADAPTER_IO_BUS_FREQUENCY; - -/* Minor query commands (sub-commands) for adapter specific information SCI_SYSTEM */ -#define SCI_Q_SYSTEM_HOSTBRIDGE _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_SYSTEM_HOSTBRIDGE) -extern const unsigned int SCI_Q_SYSTEM_HOSTBRIDGE; - -#define SCI_Q_SYSTEM_WRITE_POSTING_ENABLED _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_SYSTEM_WRITE_POSTING_ENABLED) -extern const unsigned int SCI_Q_SYSTEM_WRITE_POSTING_ENABLED; - -#define SCI_Q_SYSTEM_WRITE_COMBINING_ENABLED _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_SYSTEM_WRITE_COMBINING_ENABLED) -extern const unsigned int SCI_Q_SYSTEM_WRITE_COMBINING_ENABLED; - -#define SCI_Q_LOCAL_SEGMENT_IOADDR _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_LOCAL_SEGMENT_IOADDR) -extern const unsigned int SCI_Q_LOCAL_SEGMENT_IOADDR; - -#define SCI_Q_REMOTE_SEGMENT_IOADDR _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_REMOTE_SEGMENT_IOADDR) -extern const unsigned int SCI_Q_REMOTE_SEGMENT_IOADDR; - -#define SCI_Q_MAP_MAPPED_TO_LOCAL_TARGET _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_MAP_MAPPED_TO_LOCAL_TARGET) -extern const unsigned int SCI_Q_MAP_MAPPED_TO_LOCAL_TARGET; - -#define SCI_Q_MAP_QUERY_REMOTE_MAPPED_TO_LOCAL_TARGET _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_MAP_QUERY_REMOTE_MAPPED_TO_LOCAL_TARGET) -extern const unsigned int SCI_Q_MAP_QUERY_REMOTE_MAPPED_TO_LOCAL_TARGET; - -#define HOSTBRIDGE_NOT_AVAILABLE _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_NOT_AVAILABLE) -extern const unsigned int HOSTBRIDGE_NOT_AVAILABLE; - -#define HOSTBRIDGE_UNKNOWN _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_UNKNOWN) -extern const unsigned int HOSTBRIDGE_UNKNOWN; - -#define HOSTBRIDGE_440FX _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_440FX) -extern const unsigned int HOSTBRIDGE_440FX; - -#define HOSTBRIDGE_440LX _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_440LX) -extern const unsigned int HOSTBRIDGE_440LX; - -#define HOSTBRIDGE_440BX_A _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_440BX_A) -extern const unsigned int HOSTBRIDGE_440BX_A; - -#define HOSTBRIDGE_440BX_B _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_440BX_B) -extern const unsigned int HOSTBRIDGE_440BX_B; - -#define HOSTBRIDGE_440GX _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_440GX) -extern const unsigned int HOSTBRIDGE_440GX; - -#define HOSTBRIDGE_450KX _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_450KX) -extern const unsigned int HOSTBRIDGE_450KX; - -#define HOSTBRIDGE_430NX _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_430NX) -extern const unsigned int HOSTBRIDGE_430NX; - -#define HOSTBRIDGE_450NX _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_450NX) -extern const unsigned int HOSTBRIDGE_450NX; - -#define HOSTBRIDGE_450NX_MICO _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_450NX_MICO) -extern const unsigned int HOSTBRIDGE_450NX_MICO; - -#define HOSTBRIDGE_450NX_PXB _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_450NX_PXB) -extern const unsigned int HOSTBRIDGE_450NX_PXB; - -#define HOSTBRIDGE_I810 _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_I810) -extern const unsigned int HOSTBRIDGE_I810; - -#define HOSTBRIDGE_I810_DC100 _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_I810_DC100) -extern const unsigned int HOSTBRIDGE_I810_DC100; - -#define HOSTBRIDGE_I810E _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_I810E) -extern const unsigned int HOSTBRIDGE_I810E; - -#define HOSTBRIDGE_I815 _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_I815) -extern const unsigned int HOSTBRIDGE_I815; - -#define HOSTBRIDGE_I840 _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_I840) -extern const unsigned int HOSTBRIDGE_I840; - -#define HOSTBRIDGE_I850 _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_I850) -extern const unsigned int HOSTBRIDGE_I850; - -#define HOSTBRIDGE_I860 _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_I860) -extern const unsigned int HOSTBRIDGE_I860; - -#define HOSTBRIDGE_INTEL_E7500 _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_INTEL_E7500) -extern const unsigned int HOSTBRIDGE_INTEL_E7500; - -#define HOSTBRIDGE_VIA_KT133 _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_VIA_KT133) -extern const unsigned int HOSTBRIDGE_VIA_KT133; - -#define HOSTBRIDGE_VIA_KX133 _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_VIA_KX133) -extern const unsigned int HOSTBRIDGE_VIA_KX133; - -#define HOSTBRIDGE_VIA_APOLLO_PRO_133A _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_VIA_APOLLO_PRO_133A) -extern const unsigned int HOSTBRIDGE_VIA_APOLLO_PRO_133A; - -#define HOSTBRIDGE_VIA_APOLLO_PRO_266 _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_VIA_APOLLO_PRO_266) -extern const unsigned int HOSTBRIDGE_VIA_APOLLO_PRO_266; - -#define HOSTBRIDGE_AMD_760_MP _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_AMD_760_MP) -extern const unsigned int HOSTBRIDGE_AMD_760_MP; - -#define HOSTBRIDGE_AMD_HAMMER _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_AMD_HAMMER) -extern const unsigned int HOSTBRIDGE_AMD_HAMMER; - -#define HOSTBRIDGE_SERVERWORKS_HE _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_SERVERWORKS_HE) -extern const unsigned int HOSTBRIDGE_SERVERWORKS_HE; - -#define HOSTBRIDGE_SERVERWORKS_HE_B _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_SERVERWORKS_HE_B) -extern const unsigned int HOSTBRIDGE_SERVERWORKS_HE_B; - -#define HOSTBRIDGE_SERVERWORKS_LE _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_SERVERWORKS_LE) -extern const unsigned int HOSTBRIDGE_SERVERWORKS_LE; - -#define HOSTBRIDGE_SERVERWORKS_GC_HE _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_SERVERWORKS_GC_HE) -extern const unsigned int HOSTBRIDGE_SERVERWORKS_GC_HE; - -#define HOSTBRIDGE_SERVERWORKS_GC_LE _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_SERVERWORKS_GC_LE) -extern const unsigned int HOSTBRIDGE_SERVERWORKS_GC_LE; - -#define HOSTBRIDGE_SERVERWORKS_GC_WS _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_SERVERWORKS_GC_WS) -extern const unsigned int HOSTBRIDGE_SERVERWORKS_GC_WS; - -#define HOSTBRIDGE_SERVERWORKS_GC_SL _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_SERVERWORKS_GC_SL) -extern const unsigned int HOSTBRIDGE_SERVERWORKS_GC_SL; - - -#define HOSTBRIDGE_WRITE_POSTING_DISABLED _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_WRITE_POSTING_DISABLED) -extern const unsigned int HOSTBRIDGE_WRITE_POSTING_DISABLED; - -#define HOSTBRIDGE_WRITE_POSTING_ENABLED _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_WRITE_POSTING_ENABLED) -extern const unsigned int HOSTBRIDGE_WRITE_POSTING_ENABLED; - - - - -/********************************************************************************* - * * - * S C I C R E A T E D M A Q U E U E * - * * - * Flags * - * * - * SCI_FLAG_DMA_PHDMA : Create physical DMA queue. Please note that this is an * - * priveleged operation. * - * * - * * - * * - * Specific error codes for this function: * - * * - *********************************************************************************/ -#define SCICreateDMAQueue _SISCI_EXPANDE_FUNCTION_NAME(SCICreateDMAQueue) -DLL void SCICreateDMAQueue(sci_desc_t sd, - sci_dma_queue_t *dq, - unsigned int localAdapterNo, - unsigned int maxEntries, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I R E M O V E D M A Q U E U E * - * * - * Flags * - * None. * * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_ILLEGAL_OPERATION - Not allowed in this queue state. * - * * - *********************************************************************************/ -#define SCIRemoveDMAQueue _SISCI_EXPANDE_FUNCTION_NAME(SCIRemoveDMAQueue) -DLL void SCIRemoveDMAQueue(sci_dma_queue_t dq, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I E N Q U E U E D M A T R A N S F E R * - * * - * Flags: * - * * - * SCI_FLAG_DMA_READ - The DMA will be remote --> local * - * (default is local --> remote) * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_OUT_OF_RANGE - The sum of the offset and size is larger * - * than the segment size or larger than max * - * DMA size. * - * SCI_ERR_MAX_ENTRIES - The DMA queue is full * - * SCI_ERR_ILLEGAL_OPERATION - Illegal operation * - * SCI_ERR_SIZE_ALIGNMENT - Size is not correctly aligned as required * - * by the implementation. * - * SCI_ERR_OFFSET_ALIGNMENT - Offset is not correctly aligned as required * - * by the implementation. * - * SCI_ERR_SEGMENT_NOT_PREPARED - The local segment has not been prepared for * - * access from the adapter associated with the * - * queue. * - * SCI_ERR_SEGMENT_NOT_CONNECTED - The remote segment is not connected through * - * the adapter associated with the queue. * - *********************************************************************************/ -#define SCIEnqueueDMATransfer _SISCI_EXPANDE_FUNCTION_NAME(SCIEnqueueDMATransfer) -DLL sci_dma_queue_state_t SCIEnqueueDMATransfer(sci_dma_queue_t dq, - sci_local_segment_t localSegment, - sci_remote_segment_t remoteSegment, - unsigned int localOffset, - unsigned int remoteOffset, - unsigned int size, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I P O S T D M A Q U E U E * - * * - * Flags: * - * * - * SCI_FLAG_USE_CALLBACK - The end of the transfer will cause the callback * - * function to be invoked. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_ILLEGAL_OPERATION - Illegal operation * - * * - *********************************************************************************/ -#define SCIPostDMAQueue _SISCI_EXPANDE_FUNCTION_NAME(SCIPostDMAQueue) -DLL void SCIPostDMAQueue(sci_dma_queue_t dq, - sci_cb_dma_t callback, - void *callbackArg, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I A B O R T D M A Q U E U E * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_ILLEGAL_OPERATION - Illegal operation * - * * - *********************************************************************************/ -#define SCIAbortDMAQueue _SISCI_EXPANDE_FUNCTION_NAME(SCIAbortDMAQueue) -DLL void SCIAbortDMAQueue(sci_dma_queue_t dq, - unsigned int flags, - sci_error_t *error); - - -/********************************************************************************* - * * - * S C I R E S E T D M A Q U E U E * - * * - * Flags * - * None. * * - * * - * * - * Specific error codes for this function: * - * * - * * - *********************************************************************************/ -#define SCIResetDMAQueue _SISCI_EXPANDE_FUNCTION_NAME(SCIResetDMAQueue) -DLL void SCIResetDMAQueue(sci_dma_queue_t dq, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I D M A Q U E U E S T A T E * - * * - *********************************************************************************/ -#define SCIDMAQueueState _SISCI_EXPANDE_FUNCTION_NAME(SCIDMAQueueState) -DLL sci_dma_queue_state_t SCIDMAQueueState(sci_dma_queue_t dq); - - - -/********************************************************************************* - * * - * S C I W A I T F O R D M A Q U E U E * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_ILLEGAL_OPERATION - Illegal operation * - * SCI_ERR_TIMEOUT - The function timed out after specified * - * timeout value. * - * * - *********************************************************************************/ -#define SCIWaitForDMAQueue _SISCI_EXPANDE_FUNCTION_NAME(SCIWaitForDMAQueue) -DLL sci_dma_queue_state_t SCIWaitForDMAQueue(sci_dma_queue_t dq, - unsigned int timeout, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I P H D M A E N Q U E U E * - * * - * SISCI Priveleged function * - * * - * Flags * - * * - * SCI_FLAG_DMA_READ * - * * - * Specific error codes for this function: * - * * - *********************************************************************************/ -#define SCIphDmaEnqueue _SISCI_EXPANDE_FUNCTION_NAME(SCIphDmaEnqueue) -DLL void SCIphDmaEnqueue(sci_dma_queue_t dmaqueue, - unsigned int size, - sci_ioaddr_t localBusAddr, - unsigned int remote_nodeid, - unsigned int remote_highaddr, - unsigned int remote_lowaddr, - unsigned int flags, - sci_error_t *error); - -/********************************************************************************* - * * - * S C I P H D M A S T A R T * - * * - * Flags * - * * - * SCI_FLAG_DMA_WAIT * - * SCI_FLAG_USE_CALLBACK * - * SCI_FLAG_DMA_RESET * - * * - * Specific error codes for this function: * - * * - *********************************************************************************/ -#define SCIphDmaStart _SISCI_EXPANDE_FUNCTION_NAME(SCIphDmaStart) -DLL sci_dma_queue_state_t SCIphDmaStart(sci_dma_queue_t dmaqueue, - sci_cb_dma_t callback, - void *callbackArg, - unsigned int flags, - sci_error_t *error); - -/********************************************************************************* - * * - * S C I C R E A T E I N T E R R U P T * - * * - * Flags * - * * - * SCI_FLAG_USE_CALLBACK * - * SCI_FLAG_FIXED_INTNO * - * SCI_FLAG_SHARED_INT * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_INTNO_USED - This interrupt number is already used. * - * * - *********************************************************************************/ -#define SCICreateInterrupt _SISCI_EXPANDE_FUNCTION_NAME(SCICreateInterrupt) -DLL void SCICreateInterrupt(sci_desc_t sd, - sci_local_interrupt_t *interrupt, - unsigned int localAdapterNo, - unsigned int *interruptNo, - sci_cb_interrupt_t callback, - void *callbackArg, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I R E M O V E I N T E R R U P T * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - *********************************************************************************/ -#define SCIRemoveInterrupt _SISCI_EXPANDE_FUNCTION_NAME(SCIRemoveInterrupt) -DLL void SCIRemoveInterrupt(sci_local_interrupt_t interrupt, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I W A I T F O R I N T E R R U P T * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_TIMEOUT - The function timed out after specified timeout value. * - * SCI_ERR_CANCELLED - The wait was interrupted by a call to * - * SCIRemoveInterrupt. * - * The handle is invalid when this error code is returned.* - * * - *********************************************************************************/ -#define SCIWaitForInterrupt _SISCI_EXPANDE_FUNCTION_NAME(SCIWaitForInterrupt) -DLL void SCIWaitForInterrupt(sci_local_interrupt_t interrupt, - unsigned int timeout, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I C O N N E C T I N T E R R U P T * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_NO_SUCH_INTNO - No such interrupt number. * - * SCI_ERR_CONNECTION_REFUSED - Connection attempt refused by remote node. * - * SCI_ERR_TIMEOUT - The function timed out after specified * - * timeout value. * - * * - *********************************************************************************/ -#define SCIConnectInterrupt _SISCI_EXPANDE_FUNCTION_NAME(SCIConnectInterrupt) -DLL void SCIConnectInterrupt(sci_desc_t sd, - sci_remote_interrupt_t *interrupt, - unsigned int nodeId, - unsigned int localAdapterNo, - unsigned int interruptNo, - unsigned int timeout, - unsigned int flags, - sci_error_t *error); - - -/********************************************************************************* - * * - * S C I D I S C O N N E C T I N T E R R U P T * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * * - *********************************************************************************/ -#define SCIDisconnectInterrupt _SISCI_EXPANDE_FUNCTION_NAME(SCIDisconnectInterrupt) -DLL void SCIDisconnectInterrupt(sci_remote_interrupt_t interrupt, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I T R I G G E R I N T E R R U P T * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * * - *********************************************************************************/ -#define SCITriggerInterrupt _SISCI_EXPANDE_FUNCTION_NAME(SCITriggerInterrupt) -DLL void SCITriggerInterrupt(sci_remote_interrupt_t interrupt, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I R E G I S T E R I N T E R R U P T F L A G * - * * - * * - * This function register an "interrupt flag" that is identified as an unique * - * location within a local segment. If successful, the resulting interrupt * - * handle will have been associated with the specified local segment. * - * * - * It is up to the (remote) client(s) to set up an "interrupt mapping" for the * - * corresponding segment offset using either the * - * * - * - SCI_FLAG_CONDITIONAL_INTERRUPT_MAP * - * * - * or the * - * * - * - SCI_FLAG_UNCONDITIONAL_DATA_INTERRUPT_MAP * - * * - * option to "SCIMapRemoteSegment()". - I.e. after having established a * - * connection to the corresponding segment. A trigger operation can then * - * be implemented using a store operation via the relevant "interrupt map". * - * * - * * - * * - * * - * * - * Flags: * - * * - * SCI_FLAG_CONDITIONAL_INTERRUPT - Triggering is to take place using * - * "conditional interrupts". * - * * - * * - * * - * Specific error codes for this function: * - * None. * - * * - *********************************************************************************/ -#define SCIRegisterInterruptFlag _SISCI_EXPANDE_FUNCTION_NAME(SCIRegisterInterruptFlag) -DLL void SCIRegisterInterruptFlag( - unsigned int localAdapterNo, - sci_local_interrupt_t *interrupt, - sci_local_segment_t segment, - unsigned int offset, - sci_cb_interrupt_t callback, - void *callbackArg, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I E N A B L E C O N D I T I O N A L I N T E R R U P T * - * * - * * - * This function make sure that another HW interrupt will take place the next * - * time the corresponding interrupt flag is triggered by a * - * "conditional interrupt" operation. * - * * - * Default semantics: * - * * - * When successful, the client can rely on that the first subsequent trigger * - * operation will cause a HW interrupt and subsequently cause the client * - * handler function to be invoked. * - * * - * If an interrupt was triggered in parallell with the enable operation, then * - * the operation will fail (SCI_ERR_COND_INT_RACE_PROBLEM), and the client can * - * not rely on another trigger operation will lead to handler invocation. * - * Hence, any state checking normally associated with handling the * - * corresponding interrupt should take place before attempting to enable * - * again. * - * * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_COND_INT_RACE_PROBLEM - The enable operation failed because an * - * incomming trigger operation happened * - * concurrently. * - * * - *********************************************************************************/ -#define SCIEnableConditionalInterrupt _SISCI_EXPANDE_FUNCTION_NAME(SCIEnableConditionalInterrupt) -DLL void SCIEnableConditionalInterrupt( - sci_local_interrupt_t interrupt, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I D I S A B L E C O N D I T I O N A L I N T E R R U P T * - * * - * * - * Prevent subsequent "conditional interrupt"trigger operations for * - * the specified interupt flag from causing HW interrupt and handler * - * invocations. * - * * - * * - * Default semantics: * - * * - * If successful, no subsequent HW interrupts will take place, but handler * - * invocations that have already been scheduled may still take place. * - * * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * * - *********************************************************************************/ -#define SCIDisableConditionalInterrupt _SISCI_EXPANDE_FUNCTION_NAME(SCIDisableConditionalInterrupt) -DLL void SCIDisableConditionalInterrupt( - sci_local_interrupt_t interrupt, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I G E T C O N D I T I O N A L I N T E R R U P T C O U N T E R * - * * - * * - * Returns a value that indicates the number of times this flag has * - * been trigged since the last time it was enabled or disabled. * - * Calling the SCIEnableConditionalInterrupt / SCIDisableConditionalInterrupt * - * functions will reset the counter value. * - * * - * Default semantics: * - * * - * If successful, the current trig count is returned in the * - * interruptTrigCounter parameter. * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_OVERFLOW - The number of trig operations have exceeded the range * - * that can be counted. * - *********************************************************************************/ -#define SCIGetConditionalInterruptTrigCounter _SISCI_EXPANDE_FUNCTION_NAME(SCIGetConditionalInterruptTrigCounter) -DLL void SCIGetConditionalInterruptTrigCounter( - sci_local_interrupt_t interrupt, - unsigned int *interruptTrigCounter, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I T R A N S F E R B L O C K * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_OUT_OF_RANGE - The sum of the size and offset is larger * - * than the corresponding map size. * - * SCI_ERR_SIZE_ALIGNMENT - Size is not correctly aligned as required * - * by the implementation. * - * SCI_ERR_OFFSET_ALIGNMENT - Offset is not correctly aligned as required * - * by the implementation. * - * SCI_ERR_TRANSFER_FAILED - The data transfer failed. * - * * - *********************************************************************************/ -#define SCITransferBlock _SISCI_EXPANDE_FUNCTION_NAME(SCITransferBlock) -DLL void SCITransferBlock(sci_map_t sourceMap, - unsigned int sourceOffset, - sci_map_t destinationMap, - unsigned int destinationOffset, - unsigned int size, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I T R A N S F E R B L O C K A S Y N C * - * * - * Flags * - * * - * SCI_FLAG_BLOCK_READ * - * SCI_FLAG_USE_CALLBACK * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_OUT_OF_RANGE - The sum of the size and offset is larger than * - * the corresponding map size. * - * SCI_ERR_SIZE_ALIGNMENT - Size is not correctly aligned as required by * - * the implementation. * - * SCI_ERR_OFFSET_ALIGNMENT - Offset is not correctly aligned as required * - * by the implementation. * - * SCI_ERR_TRANSFER_FAILED - The data transfer failed. * - * * - *********************************************************************************/ -#define SCITransferBlockAsync _SISCI_EXPANDE_FUNCTION_NAME(SCITransferBlockAsync) -DLL void SCITransferBlockAsync(sci_map_t sourceMap, - unsigned int sourceOffset, - sci_map_t destinationMap, - unsigned int destinationOffset, - unsigned int size, - sci_block_transfer_t *block, - sci_cb_block_transfer_t callback, - void *callbackArg, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I W A I T F O R B L O C K T R A N S F E R * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_ILLEGAL_OPERATION - Illegal operation * - * SCI_ERR_TIMEOUT - The function timed out after specified * - * timeout value. * - * * - *********************************************************************************/ -#define SCIWaitForBlockTransfer _SISCI_EXPANDE_FUNCTION_NAME(SCIWaitForBlockTransfer) -DLL void SCIWaitForBlockTransfer(sci_block_transfer_t block, - unsigned int timeout, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I A B O R T B L O C K T R A N S F E R * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_ILLEGAL_OPERATION - Illegal operation * - * * - *********************************************************************************/ -#define SCIAbortBlockTransfer _SISCI_EXPANDE_FUNCTION_NAME(SCIAbortBlockTransfer) -DLL void SCIAbortBlockTransfer(sci_block_transfer_t block, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I M E M C P Y * - * * - * Flags: * - * SCI_FLAG_BLOCK_READ * - * SCI_FLAG_ERROR_CHECK * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_OUT_OF_RANGE - The sum of the size and offset is larger * - * than the corresponding map size. * - * SCI_ERR_SIZE_ALIGNMENT - Size is not correctly aligned as required * - * by the implementation. * - * SCI_ERR_OFFSET_ALIGNMENT - Offset is not correctly aligned as required * - * by the implementation. * - * SCI_ERR_TRANSFER_FAILED - The data transfer failed. * - * * - *********************************************************************************/ - -#define SCIMemCpy _SISCI_EXPANDE_FUNCTION_NAME(SCIMemCpy) -DLL void SCIMemCpy(sci_sequence_t sequence, - void *memAddr, - sci_map_t remoteMap, - unsigned int remoteOffset, - unsigned int size, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I M E M C O P Y * - * * - * Flags: * - * SCI_FLAG_BLOCK_READ * - * SCI_FLAG_ERROR_CHECK * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_OUT_OF_RANGE - The sum of the size and offset is larger * - * than the corresponding map size. * - * SCI_ERR_SIZE_ALIGNMENT - Size is not correctly aligned as required * - * by the implementation. * - * SCI_ERR_OFFSET_ALIGNMENT - Offset is not correctly aligned as required * - * by the implementation. * - * SCI_ERR_TRANSFER_FAILED - The data transfer failed. * - * * - *********************************************************************************/ - - -#define SCIMemCopy _SISCI_EXPANDE_FUNCTION_NAME(SCIMemCopy) -DLL void SCIMemCopy(void *memAddr, - sci_map_t remoteMap, - unsigned int remoteOffset, - unsigned int size, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I R E G I S T E R S E G M E N T M E M O R Y * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_SIZE_ALIGNMENT - Size is not correctly aligned as required by * - * the implementation. * - * SCI_ERR_ILLEGAL_ADDRESS - Illegal address. * - * SCI_ERR_OUT_OF_RANGE - Size is larger than the maximum size for the * - * local segment. * - * * - *********************************************************************************/ -#define SCIRegisterSegmentMemory _SISCI_EXPANDE_FUNCTION_NAME(SCIRegisterSegmentMemory) -DLL void SCIRegisterSegmentMemory(void *address, - unsigned int size, - sci_local_segment_t segment, - unsigned int flags, - sci_error_t *error); - - - - - -/********************************************************************************* - * * - * S C I C O N N E C T S C I S P A C E * - * * - * SISCI Priveleged function * - * * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_SIZE_ALIGNMENT - Size is not correctly aligned as required * - * by the implementation. * - * SCI_ERR_CONNECTION_REFUSED - Connection attempt refused by remote node. * - * * - *********************************************************************************/ -#define SCIConnectSCISpace _SISCI_EXPANDE_FUNCTION_NAME(SCIConnectSCISpace) -DLL void SCIConnectSCISpace(sci_desc_t sd, - unsigned int localAdapterNo, - sci_remote_segment_t *segment, - sci_address_t address, - unsigned int size, - unsigned int flags, - sci_error_t *error); - - - -/* - * ===================================================================================== - * - * S C I A T T A C H L O C A L S E G M E N T - * Description: - * - * SCIAttachLocalSegment() permits an application to "attach" to an already existing - * local segment, implying that two or more application want - * share the same local segment. The prerequest, is that the - * application which originally created the segment ("owner") has - * preformed a SCIShareSegment() in order to mark the segment - * "shareable". - * - * - * Flags: - * - * SCI_FLAG_USE_CALLBACK - The callback function will be invoked for events - * on this segment. - * - * - * Specific error codes for this function: - * - * SCI_ERR_ACCESS - No such shared segment - * SCI_ERR_NO_SUCH_SEGMENT - No such segment - * Note: Current implenentation will return SCI_ERR_ACCESS for both cases. This will - * change from next release. Application should handle both cases. - * - * ===================================================================================== - */ -#define SCIAttachLocalSegment _SISCI_EXPANDE_FUNCTION_NAME(SCIAttachLocalSegment) - -DLL void -SCIAttachLocalSegment(sci_desc_t sd, - sci_local_segment_t *segment, - unsigned int segmentId, - unsigned int *size, - sci_cb_local_segment_t callback, - void *callbackArg, - unsigned int flags, - sci_error_t *error); -/* - * ===================================================================================== - * - * S C I S H A R E S E G M E N T - * - * Description: - * - * SCIShareSegment() permits other application to "attach" to an already existing - * local segment, implying that two or more application want - * share the same local segment. The prerequest, is that the - * application which originally created the segment ("owner") has - * preformed a SCIShareSegment() in order to mark the segment - * "shareable". - * - * - * Flags: - * none - * - * Specific error codes for this function: - * - * - * - * ===================================================================================== - */ -#define SCIShareSegment _SISCI_EXPANDE_FUNCTION_NAME(SCIShareSegment) - -DLL void -SCIShareSegment(sci_local_segment_t segment, - unsigned int flags, - sci_error_t *error); - - -/********************************************************************************* - * * - * S C I F L U S H * - * * - * This function will flush the CPU buffers and the PSB buffers. * - * * - * Flags * - * SCI_FLAG_FLUSH_CPU_BUFFERS_ONLY : * - * Only flush CPU buffers ( Write combining * - * etc buffers). * - * * - *********************************************************************************/ - -#define SCIFlush _SISCI_EXPANDE_FUNCTION_NAME(SCIFlush) -DLL void SCIFlush(sci_sequence_t sequence, - unsigned int flags); - -#if defined(CPLUSPLUS) || defined(__cplusplus) -} -#endif - - -#endif - - - - - - - - - - - diff --git a/ndb/src/external/LINUX.x86/sci/include/sisci_demolib.h b/ndb/src/external/LINUX.x86/sci/include/sisci_demolib.h deleted file mode 100644 index 4284fc5585c..00000000000 --- a/ndb/src/external/LINUX.x86/sci/include/sisci_demolib.h +++ /dev/null @@ -1,226 +0,0 @@ -/* $Id: sisci_demolib.h,v 1.1 2002/12/13 12:17:21 hin Exp $ */ - -/******************************************************************************* - * * - * Copyright (C) 1993 - 2000 * - * Dolphin Interconnect Solutions AS * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, * - * or (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * * - * * - *******************************************************************************/ - -#ifndef _SISCI_DEMOLIB_H -#define _SISCI_DEMOLIB_H - - -#if defined(_REENTRANT) - -#define _SISCI_DEMOLIB_EXPAND_NAME(name) _SISCI_DEMOLIB_MT_ ## name - -#else - -#define _SISCI_DEMOLIB_EXPAND_NAME(name) _SISCI_DEMOLIB_ST_ ## name - -#endif - -/*********************************************************************************/ -/* Q U E R Y A D A P T E R */ -/* */ -/*********************************************************************************/ - -#define QueryAdapter _SISCI_DEMOLIB_EXPAND_NAME(QueryAdapter) - -sci_error_t QueryAdapter( - unsigned int subcommand, - unsigned int localAdapterNo, - unsigned int portNo, - unsigned int *data); - - -/*********************************************************************************/ -/* Q U E R Y S Y S T E M */ -/* */ -/*********************************************************************************/ - -#define QuerySystem _SISCI_DEMOLIB_EXPAND_NAME(QuerySystem) - -sci_error_t QuerySystem( - unsigned int subcommand, - unsigned int *data); - - -/*********************************************************************************/ -/* D E T E C T F I R S T A D A P T E R C A R D */ -/* */ -/*********************************************************************************/ - -#define DetectFirstAdapterCard _SISCI_DEMOLIB_EXPAND_NAME(DetectFirstAdapterCard) - -sci_error_t DetectFirstAdapterCard( - unsigned int *localAdapterNo, - unsigned int *localNodeId); - - -/*********************************************************************************/ -/* G E T A D A P T E R T Y P E */ -/* */ -/*********************************************************************************/ - -#define GetAdapterType _SISCI_DEMOLIB_EXPAND_NAME(GetAdapterType) - -sci_error_t GetAdapterType(unsigned int localAdapterNo, - unsigned int *adapterType); - - -/*********************************************************************************/ -/* G E T L O C A L N O D E I D */ -/* */ -/*********************************************************************************/ - -#define GetLocalNodeId _SISCI_DEMOLIB_EXPAND_NAME(GetLocalNodeId) - -sci_error_t GetLocalNodeId( - unsigned int localAdapterNo, - unsigned int *localNodeId); - - -/*********************************************************************************/ -/* G E T A D A P T E R S E R I A L N U M B E R */ -/* */ -/*********************************************************************************/ - -#define GetAdapterSerialNumber _SISCI_DEMOLIB_EXPAND_NAME(GetAdapterSerialNumber) - -sci_error_t GetAdapterSerialNumber( - unsigned int localAdapterNo, - unsigned int *serialNo); - - - -/*********************************************************************************/ -/* G E T H O S T B R I D G E T Y P E */ -/* */ -/*********************************************************************************/ - -#define GetHostbridgeType _SISCI_DEMOLIB_EXPAND_NAME(GetHostbridgeType) - -sci_error_t GetHostbridgeType(unsigned int *hostbridgeType); - - - -/*********************************************************************************/ -/* P R I N T H O S T B R I D G E T Y P E */ -/* */ -/*********************************************************************************/ - -#define PrintHostbridgeType _SISCI_DEMOLIB_EXPAND_NAME(PrintHostbridgeType) - -void PrintHostbridgeType(unsigned int hostbridge); - - - -/*********************************************************************************/ -/* G E T A P I V E R S I O N S T R I N G */ -/* */ -/*********************************************************************************/ - -#define GetAPIVersionString _SISCI_DEMOLIB_EXPAND_NAME(GetAPIVersionString) - -sci_error_t GetAPIVersionString(char str[], unsigned int strLength); - - - -/*********************************************************************************/ -/* G E T A D A P T E R I O B U S F R E Q U E N C Y */ -/* */ -/*********************************************************************************/ - -sci_error_t GetAdapterIoBusFrequency(unsigned int localAdapterNo, - unsigned int *ioBusFrequency); - - - -/*********************************************************************************/ -/* G E T A D A P T E R S C I L I N K F R E Q U E N C Y */ -/* */ -/*********************************************************************************/ - -sci_error_t GetAdapterSciLinkFrequency(unsigned int localAdapterNo, - unsigned int *sciLinkFrequency); - - - -/*********************************************************************************/ -/* G E T A D A P T E R B L I N K F R E Q U E N C Y */ -/* */ -/*********************************************************************************/ - -sci_error_t GetAdapterBlinkFrequency(unsigned int localAdapterNo, - unsigned int *bLinkFrequency); - - -/*********************************************************************************/ -/* S E N D I N T E R R U P T */ -/* */ -/*********************************************************************************/ - -#define SendInterrupt _SISCI_DEMOLIB_EXPAND_NAME(SendInterrupt) - -sci_error_t SendInterrupt( - sci_desc_t sd, - unsigned int localAdapterNo, - unsigned int localNodeId, - unsigned int remoteNodeId, - unsigned int interruptNo); - - -/*********************************************************************************/ -/* R E C E I V E I N T E R R U P T */ -/* */ -/*********************************************************************************/ - -#define ReceiveInterrupt _SISCI_DEMOLIB_EXPAND_NAME(ReceiveInterrupt) - -sci_error_t ReceiveInterrupt( - sci_desc_t sd, - unsigned int localAdapterNo, - unsigned int localNodeId, - unsigned int interruptNo); - - -/*********************************************************************************/ -/* E N D I A N S W A P */ -/* */ -/*********************************************************************************/ - -#define EndianSwap _SISCI_DEMOLIB_EXPAND_NAME(EndianSwap) - -unsigned int EndianSwap (unsigned int value); - - -/*********************************************************************************/ -/* S L E E P M I L L I S E C O N D S */ -/* */ -/*********************************************************************************/ - -#define SleepMilliseconds _SISCI_DEMOLIB_EXPAND_NAME(SleepMilliseconds) - -void SleepMilliseconds(int milliseconds); - - - - -#endif diff --git a/ndb/src/external/LINUX.x86/sci/include/sisci_error.h b/ndb/src/external/LINUX.x86/sci/include/sisci_error.h deleted file mode 100644 index c53fe8ad5d9..00000000000 --- a/ndb/src/external/LINUX.x86/sci/include/sisci_error.h +++ /dev/null @@ -1,89 +0,0 @@ -/* $Id: sisci_error.h,v 1.1 2002/12/13 12:17:21 hin Exp $ */ - -/******************************************************************************* - * * - * Copyright (C) 1993 - 2000 * - * Dolphin Interconnect Solutions AS * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, * - * or (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * * - * * - *******************************************************************************/ - - - - -#ifndef _SISCI_ERROR_H_ -#define _SISCI_ERROR_H_ - - -/* SCI Error return values always have 30 bit set */ -#define SCI_ERR_MASK 0x40000000 -#define SCI_ERR_REMOTE_MASK 0x01 /* Remote errors should have bit 0 set */ - -#define SCI_ERR(u) ((unsigned32)(u)&0x7FFFFFFF ) - -/* Error codes */ -typedef enum { - SCI_ERR_OK = 0x000, - - - SCI_ERR_BUSY = (0x900 | SCI_ERR_MASK), - SCI_ERR_FLAG_NOT_IMPLEMENTED = (0x901 | SCI_ERR_MASK), - SCI_ERR_ILLEGAL_FLAG = (0x902 | SCI_ERR_MASK), - SCI_ERR_NOSPC = (0x904 | SCI_ERR_MASK), - SCI_ERR_API_NOSPC = (0x905 | SCI_ERR_MASK), - SCI_ERR_HW_NOSPC = (0x906 | SCI_ERR_MASK), - SCI_ERR_NOT_IMPLEMENTED = (0x907 | SCI_ERR_MASK), - SCI_ERR_ILLEGAL_ADAPTERNO = (0x908 | SCI_ERR_MASK), - SCI_ERR_NO_SUCH_ADAPTERNO = (0x909 | SCI_ERR_MASK), - SCI_ERR_TIMEOUT = (0x90A | SCI_ERR_MASK), - SCI_ERR_OUT_OF_RANGE = (0x90B | SCI_ERR_MASK), - SCI_ERR_NO_SUCH_SEGMENT = (0x90C | SCI_ERR_MASK), - SCI_ERR_ILLEGAL_NODEID = (0x90D | SCI_ERR_MASK), - SCI_ERR_CONNECTION_REFUSED = (0x90E | SCI_ERR_MASK), - SCI_ERR_SEGMENT_NOT_CONNECTED = (0x90F | SCI_ERR_MASK), - SCI_ERR_SIZE_ALIGNMENT = (0x910 | SCI_ERR_MASK), - SCI_ERR_OFFSET_ALIGNMENT = (0x911 | SCI_ERR_MASK), - SCI_ERR_ILLEGAL_PARAMETER = (0x912 | SCI_ERR_MASK), - SCI_ERR_MAX_ENTRIES = (0x913 | SCI_ERR_MASK), - SCI_ERR_SEGMENT_NOT_PREPARED = (0x914 | SCI_ERR_MASK), - SCI_ERR_ILLEGAL_ADDRESS = (0x915 | SCI_ERR_MASK), - SCI_ERR_ILLEGAL_OPERATION = (0x916 | SCI_ERR_MASK), - SCI_ERR_ILLEGAL_QUERY = (0x917 | SCI_ERR_MASK), - SCI_ERR_SEGMENTID_USED = (0x918 | SCI_ERR_MASK), - SCI_ERR_SYSTEM = (0x919 | SCI_ERR_MASK), - SCI_ERR_CANCELLED = (0x91A | SCI_ERR_MASK), - SCI_ERR_NOT_CONNECTED = (0x91B | SCI_ERR_MASK), - SCI_ERR_NOT_AVAILABLE = (0x91C | SCI_ERR_MASK), - SCI_ERR_INCONSISTENT_VERSIONS = (0x91D | SCI_ERR_MASK), - SCI_ERR_COND_INT_RACE_PROBLEM = (0x91E | SCI_ERR_MASK), - SCI_ERR_OVERFLOW = (0x91F | SCI_ERR_MASK), - SCI_ERR_NOT_INITIALIZED = (0x920 | SCI_ERR_MASK), - - SCI_ERR_ACCESS = (0x921 | SCI_ERR_MASK), - - SCI_ERR_NO_SUCH_NODEID = (0xA00 | SCI_ERR_MASK), - SCI_ERR_NODE_NOT_RESPONDING = (0xA02 | SCI_ERR_MASK), - SCI_ERR_NO_REMOTE_LINK_ACCESS = (0xA04 | SCI_ERR_MASK), - SCI_ERR_NO_LINK_ACCESS = (0xA05 | SCI_ERR_MASK), - SCI_ERR_TRANSFER_FAILED = (0xA06 | SCI_ERR_MASK) -} sci_error_t; - - -#endif /* _SCI_ERROR_H_ */ - - - diff --git a/ndb/src/external/LINUX.x86/sci/include/sisci_types.h b/ndb/src/external/LINUX.x86/sci/include/sisci_types.h deleted file mode 100644 index f4125fdec69..00000000000 --- a/ndb/src/external/LINUX.x86/sci/include/sisci_types.h +++ /dev/null @@ -1,133 +0,0 @@ -/* $Id: sisci_types.h,v 1.1 2002/12/13 12:17:21 hin Exp $ */ - -/******************************************************************************* - * * - * Copyright (C) 1993 - 2000 * - * Dolphin Interconnect Solutions AS * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, * - * or (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * * - * * - *******************************************************************************/ - - -#ifndef _SISCI_TYPES_H -#define _SISCI_TYPES_H - -#include "sisci_error.h" - -#ifndef IN -#define IN -#endif - -#ifndef OUT -#define OUT -#endif - -#ifndef IN_OUT -#define IN_OUT -#endif - -/* Opaque data types for descriptors/handles */ -typedef struct sci_desc *sci_desc_t; -typedef struct sci_local_segment *sci_local_segment_t; -typedef struct sci_remote_segment *sci_remote_segment_t; - -typedef struct sci_map *sci_map_t; -typedef struct sci_sequence *sci_sequence_t; -#ifndef KERNEL -typedef struct sci_dma_queue *sci_dma_queue_t; -#endif -typedef struct sci_remote_interrupt *sci_remote_interrupt_t; -typedef struct sci_local_interrupt *sci_local_interrupt_t; -typedef struct sci_block_transfer *sci_block_transfer_t; - -/* - * Constants defining reasons for segment callbacks: - */ - -typedef enum { - SCI_CB_CONNECT = 1, - SCI_CB_DISCONNECT, - SCI_CB_NOT_OPERATIONAL, - SCI_CB_OPERATIONAL, - SCI_CB_LOST -} sci_segment_cb_reason_t; - -#define MAX_CB_REASON SCI_CB_LOST - -/* dma_queue_states is identical to the dma_queue_state_t in genif.h, they must be consistent.*/ -typedef enum { - SCI_DMAQUEUE_IDLE, - SCI_DMAQUEUE_GATHER, - SCI_DMAQUEUE_POSTED, - SCI_DMAQUEUE_DONE, - SCI_DMAQUEUE_ABORTED, - SCI_DMAQUEUE_ERROR -} sci_dma_queue_state_t; - - -typedef enum { - SCI_SEQ_OK, - SCI_SEQ_RETRIABLE, - SCI_SEQ_NOT_RETRIABLE, - SCI_SEQ_PENDING -} sci_sequence_status_t; - - -typedef struct { - unsigned short nodeId; /* SCI Address bit 63 - 48 */ - unsigned short offsHi; /* SCI Address bit 47 - 32 */ - unsigned int offsLo; /* SCI Address bit 31 - 0 */ -} sci_address_t; - - -typedef unsigned int sci_ioaddr_t; - -typedef enum { - SCI_CALLBACK_CANCEL = 1, - SCI_CALLBACK_CONTINUE -} sci_callback_action_t; - -#ifndef KERNEL -typedef sci_callback_action_t (*sci_cb_local_segment_t)(void *arg, - sci_local_segment_t segment, - sci_segment_cb_reason_t reason, - unsigned int nodeId, - unsigned int localAdapterNo, - sci_error_t error); - -typedef sci_callback_action_t (*sci_cb_remote_segment_t)(void *arg, - sci_remote_segment_t segment, - sci_segment_cb_reason_t reason, - sci_error_t status); - - -typedef sci_callback_action_t (*sci_cb_dma_t)(void IN *arg, - sci_dma_queue_t queue, - sci_error_t status); - - -typedef int (*sci_cb_block_transfer_t)(void *arg, - sci_block_transfer_t block, - sci_error_t status); - - -typedef sci_callback_action_t (*sci_cb_interrupt_t)(void *arg, - sci_local_interrupt_t interrupt, - sci_error_t status); - -#endif /* KERNEL */ -#endif diff --git a/ndb/src/external/LINUX.x86/sci/include/sisci_version.h b/ndb/src/external/LINUX.x86/sci/include/sisci_version.h deleted file mode 100644 index f1807c33aa5..00000000000 --- a/ndb/src/external/LINUX.x86/sci/include/sisci_version.h +++ /dev/null @@ -1,91 +0,0 @@ -/* $Id: sisci_version.h,v 1.1 2002/12/13 12:17:21 hin Exp $ */ - -/******************************************************************************* - * * - * Copyright (C) 1993 - 2000 * - * Dolphin Interconnect Solutions AS * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License as published by * - * the Free Software Foundation; either version 2.1 of the License, * - * or (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * * - * * - *******************************************************************************/ - - -#ifndef SISCI_VERSION_H -#define SISCI_VERSION_H - - -#define SISCI_API_VER_MAJOR 0x01 -#define SISCI_API_VER_MAJORC "1" - -#define SISCI_API_VER_MINOR 0x010 -#define SISCI_API_VER_MINORC "10" -#define SISCI_API_VER_MICRO 0x005 -#define SISCI_API_VER_MICROC "5" - -#define SISCI_SIGN_VERSION_MASK 0xfffff000 /* used to mask off API_VER_MICRO */ - -#define SISCI_API_VERSION (SISCI_API_VER_MAJOR << 24 | SISCI_API_VER_MINOR << 12 | SISCI_API_VER_MICRO) - -/* the rules are: - * - * Changes in API_VER_MICRO should be binary compatible, New flags, functions added. No changes to user code - * required if new features is not needed. - * - * Changes in API_VER_MINOR requires recompilation of user code. - * - * Changes in the API_VER_MAJOR will most likely require changes to user code. This should not happen very - * often... - * - */ - -#ifndef BUILD_DATE -#define BUILD_DATE __DATE__ -#endif - -#ifndef BUILD_NAME -#define BUILD_NAME "" -#endif - -#define API_VERSION "SISCI API version " SISCI_API_VER_MAJORC "." SISCI_API_VER_MINORC "."SISCI_API_VER_MICROC " ( "BUILD_NAME" "BUILD_DATE" )" - -#endif - - -/* Version info: */ -/* */ -/* 1.5.2 First SISCI version */ -/* 1.5.3 Some bug fixes */ -/* 1.5.4 Some bug fixes */ -/* 1.5.5 No release */ -/* 1.5.6 Lock flag implemented in function SCIConnectSegment */ -/* 1.5.7 Expanded query functionality */ -/* 1.5.8 Updated error checking (sequence) functionality for D320 */ -/* 1.6.0 Updated error checking (sequence) D320 and IRM 1.9 support */ -/* 1.9.0 Ported to Solaris_sparc, Solaris_x86 and Linux. IRM 1.9. */ -/* 1.9.1 Some bug fixes */ -/* 1.9.2 Added more adapter queries */ -/* 1.9.3 Bug fix in SCIMapLocalSegment and SCIMapRemoteSegment */ -/* 1.9.4 NT Release Developers Kit 2.40 */ -/* 1.9.5 Added flush after data transfer in SCIMemCopy() */ -/* 1.9.5 NT Release Developers Kit 2.44 */ -/* 1.10.0: - * New SCIInitialize(), SCITerminate() functions. - * Support for D330 - * - * - */ - - diff --git a/ndb/src/external/LINUX.x86/sci/include/version.h b/ndb/src/external/LINUX.x86/sci/include/version.h deleted file mode 100644 index a0e1fa6c5cd..00000000000 --- a/ndb/src/external/LINUX.x86/sci/include/version.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef _VERSION_H -#define _VERSION_H - - -/* -#define DEMO_VER_MAJOR "1" -#define DEMO_VER_MINOR "5" -#define DEMO_VER_MICRO "0" -*/ - -#ifndef BUILD_DATE -#define BUILD_DATE __DATE__ -#endif - -#ifndef BUILD_NAME -#define BUILD_NAME "" -#endif - -/* -#define DEMO_VERSION "version " DEMO_VER_MAJOR "." DEMO_VER_MINOR "."DEMO_VER_MICRO " ("BUILD_NAME" "BUILD_DATE" )" -*/ -#define DEMO_VERSION " ("BUILD_NAME" "BUILD_DATE" )" - - -#endif diff --git a/ndb/src/external/SOLARIS.SPARC/sci/include/sisci_api.h b/ndb/src/external/SOLARIS.SPARC/sci/include/sisci_api.h deleted file mode 100644 index d02d3aafe7f..00000000000 --- a/ndb/src/external/SOLARIS.SPARC/sci/include/sisci_api.h +++ /dev/null @@ -1,2148 +0,0 @@ -/* $Id: sisci_api.h,v 1.1 2002/12/13 12:17:22 hin Exp $ */ -/******************************************************************************* - * * - * Copyright (C) 1993 - 2001 * - * Dolphin Interconnect Solutions AS * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License as published by * - * the Free Software Foundation; either version 2.1 of the License, * - * or (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * * - * * - *******************************************************************************/ - -#ifndef _SISCI_API_H -#define _SISCI_API_H - -#include "sisci_types.h" -#include "sisci_error.h" - - -#ifdef WIN32 -#ifdef API_DLL -#define DLL __declspec(dllexport) -#elif CLIENT_DLL -#define DLL __declspec(dllimport) -#endif -#endif /* WIN32 */ - - -#ifndef DLL -#define DLL -#endif - -#if defined(_REENTRANT) -#define _SISCI_EXPANDE_FUNCTION_NAME(name) _SISCI_PUBLIC_FUNC_MT_ ## name -#define _SISCI_EXPANDE_VARIABLE_NAME(name) _SISCI_PUBLIC_VAR_MT_ ## name -#else -#define _SISCI_EXPANDE_FUNCTION_NAME(name) _SISCI_PUBLIC_FUNC_ST_ ## name -#define _SISCI_EXPANDE_VARIABLE_NAME(name) _SISCI_PUBLIC_VAR_ST_ ## name -#endif -#define _SISCI_EXPANDE_CONSTANT_NAME(name) _SISCI_PUBLIC_CONST_ ## name - -#if defined(CPLUSPLUS) || defined(__cplusplus) -extern "C" { -#endif - - -/*********************************************************************************/ -/* FLAG VALUES */ -/*********************************************************************************/ - -#define SCI_FLAG_FIXED_INTNO _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_FIXED_INTNO) -extern const unsigned int SCI_FLAG_FIXED_INTNO; - -#define SCI_FLAG_SHARED_INT _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_SHARED_INT) -extern const unsigned int SCI_FLAG_SHARED_INT; - -#define SCI_FLAG_FIXED_MAP_ADDR _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_FIXED_MAP_ADDR) -extern const unsigned int SCI_FLAG_FIXED_MAP_ADDR; - -#define SCI_FLAG_READONLY_MAP _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_READONLY_MAP) -extern const unsigned int SCI_FLAG_READONLY_MAP; - -#define SCI_FLAG_USE_CALLBACK _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_USE_CALLBACK) -extern const unsigned int SCI_FLAG_USE_CALLBACK; - -#define SCI_FLAG_BLOCK_READ _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_BLOCK_READ) -extern const unsigned int SCI_FLAG_BLOCK_READ; - -#define SCI_FLAG_THREAD_SAFE _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_THREAD_SAFE) -extern const unsigned int SCI_FLAG_THREAD_SAFE; - -#define SCI_FLAG_ASYNCHRONOUS_CONNECT _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_ASYNCHRONOUS_CONNECT) -extern const unsigned int SCI_FLAG_ASYNCHRONOUS_CONNECT; - -#define SCI_FLAG_EMPTY _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_EMPTY) -extern const unsigned int SCI_FLAG_EMPTY; - -#define SCI_FLAG_PRIVATE _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_PRIVATE) -extern const unsigned int SCI_FLAG_PRIVATE; - -#define SCI_FLAG_FORCE_DISCONNECT _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_FORCE_DISCONNECT) -extern const unsigned int SCI_FLAG_FORCE_DISCONNECT; - -#define SCI_FLAG_NOTIFY _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_NOTIFY) -extern const unsigned int SCI_FLAG_NOTIFY; - -#define SCI_FLAG_DMA_READ _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_DMA_READ) -extern const unsigned int SCI_FLAG_DMA_READ; - -#define SCI_FLAG_DMA_POST _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_DMA_POST) -extern const unsigned int SCI_FLAG_DMA_POST; - -#define SCI_FLAG_DMA_WAIT _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_DMA_WAIT) -extern const unsigned int SCI_FLAG_DMA_WAIT; - -#define SCI_FLAG_DMA_RESET _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_DMA_RESET) -extern const unsigned int SCI_FLAG_DMA_RESET; - -#define SCI_FLAG_NO_FLUSH _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_NO_FLUSH) -extern const unsigned int SCI_FLAG_NO_FLUSH; - -#define SCI_FLAG_NO_STORE_BARRIER _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_NO_STORE_BARRIER) -extern const unsigned int SCI_FLAG_NO_STORE_BARRIER; - -#define SCI_FLAG_FAST_BARRIER _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_FAST_BARRIER) -extern const unsigned int SCI_FLAG_FAST_BARRIER; - -#define SCI_FLAG_ERROR_CHECK _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_ERROR_CHECK) -extern const unsigned int SCI_FLAG_ERROR_CHECK; - -#define SCI_FLAG_FLUSH_CPU_BUFFERS_ONLY _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_FLUSH_CPU_BUFFERS_ONLY) -extern const unsigned int SCI_FLAG_FLUSH_CPU_BUFFERS_ONLY; - -/* the FLUSH_CPU_BUFFERS_ONLY flag is for backwards compabillity only and should never be used */ -#define FLUSH_CPU_BUFFERS_ONLY _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_FLUSH_CPU_BUFFERS_ONLY) - -#define SCI_FLAG_LOCK_OPERATION _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_LOCK_OPERATION) -extern const unsigned int SCI_FLAG_LOCK_OPERATION; - -#define SCI_FLAG_READ_PREFETCH_AGGR_HOLD_MAP _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_READ_PREFETCH_AGGR_HOLD_MAP) -extern const unsigned int SCI_FLAG_READ_PREFETCH_AGGR_HOLD_MAP; - -#define SCI_FLAG_READ_PREFETCH_NO_HOLD_MAP _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_READ_PREFETCH_NO_HOLD_MAP) -extern const unsigned int SCI_FLAG_READ_PREFETCH_NO_HOLD_MAP; - -#define SCI_FLAG_IO_MAP_IOSPACE _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_IO_MAP_IOSPACE) -extern const unsigned int SCI_FLAG_IO_MAP_IOSPACE; - -#define SCI_FLAG_DMOVE_MAP _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_DMOVE_MAP) -extern const unsigned int SCI_FLAG_DMOVE_MAP; - -#define SCI_FLAG_WRITES_DISABLE_GATHER_MAP _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_WRITES_DISABLE_GATHER_MAP) -extern const unsigned int SCI_FLAG_WRITES_DISABLE_GATHER_MAP; - -#define SCI_FLAG_DISABLE_128_BYTES_PACKETS _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_DISABLE_128_BYTES_PACKETS) -extern const unsigned int SCI_FLAG_DISABLE_128_BYTES_PACKETS; - -#define SCI_FLAG_DMA_SOURCE_ONLY _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_DMA_SOURCE_ONLY) -extern const unsigned int SCI_FLAG_DMA_SOURCE_ONLY; - -#define SCI_FLAG_CONDITIONAL_INTERRUPT _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_CONDITIONAL_INTERRUPT) -extern const unsigned int SCI_FLAG_CONDITIONAL_INTERRUPT; - -#define SCI_FLAG_CONDITIONAL_INTERRUPT_MAP _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_CONDITIONAL_INTERRUPT_MAP) -extern const unsigned int SCI_FLAG_CONDITIONAL_INTERRUPT_MAP; - -#define SCI_FLAG_UNCONDITIONAL_DATA_INTERRUPT_MAP _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_UNCONDITIONAL_DATA_INTERRUPT_MAP) -extern const unsigned int SCI_FLAG_UNCONDITIONAL_DATA_INTERRUPT_MAP; - -#define SCI_FLAG_NO_MEMORY_LOOPBACK_MAP _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_NO_MEMORY_LOOPBACK_MAP) -extern const unsigned int SCI_FLAG_NO_MEMORY_LOOPBACK_MAP; - -#if defined(OS_IS_LYNXOS) || defined(OS_IS_VXWORKS) -#define SCI_FLAG_WRITE_BACK_CACHE_MAP _SISCI_EXPANDE_CONSTANT_NAME(WRITE_BACK_CACHE_MAP) -extern const unsigned int SCI_FLAG_WRITE_BACK_CACHE_MAP; -#endif - -#define SCI_FLAG_DMA_PHDMA _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_DMA_PHDMA) -extern const unsigned int SCI_FLAG_DMA_PHDMA; - -/*********************************************************************************/ -/* GENERAL VALUES */ -/*********************************************************************************/ -#define SCI_LOCAL_HOST _SISCI_EXPANDE_CONSTANT_NAME(SCI_LOCAL_HOST) -extern const unsigned int SCI_LOCAL_HOST; - -#define SCI_INFINITE_TIMEOUT _SISCI_EXPANDE_CONSTANT_NAME(SCI_INFINITE_TIMEOUT) -extern const unsigned int SCI_INFINITE_TIMEOUT; - -/*********************************************************************************/ -/* GENERAL ERROR CODES */ -/* */ -/* SCI_ERR_ILLEGAL_FLAG - Illegal flag value. */ -/* SCI_ERR_FLAG_NOT_IMPLEMENTED - Flag legal but flag feature not implemented. */ -/* SCI_ERR_NOT_IMPLEMENTED - Function not implemented. */ -/* SCI_ERR_SYSTEM - A system error. Check errno. */ -/* SCI_ERR_NOSPC - Unable to allocate OS resources. */ -/* SCI_ERR_API_NOSPC - Unable to allocate API resources. */ -/* SCI_ERR_HW_NOSPC - Unable to allocate HW resources (Hardware) */ -/* */ -/*********************************************************************************/ - - -/*********************************************************************************/ -/* GENERAL "ADAPTER" ERROR CODES */ -/* */ -/* SCI_ERR_NO_SUCH_ADAPTERNO - Adapter number is legal but does not exist. */ -/* SCI_ERR_ILLEGAL_ADAPTERNO - Illegal local adapter number (i.e. outside */ -/* legal range). */ -/* */ -/*********************************************************************************/ - - -/*********************************************************************************/ -/* GENERAL "NODEID" ERROR CODES */ -/* */ -/* SCI_ERR_NO_SUCH_NODEID - The remote adapter identified by nodeId does */ -/* not respond, but the intermediate link(s) */ -/* seem(s) to be operational. */ -/* SCI_ERR_ILLEGAL_NODEID - Illegal NodeId. */ -/* */ -/*********************************************************************************/ - - - -/********************************************************************************* - * * - * S C I I N I T I A L I Z E * - * * - * This function initializes the SISCI library. * - * The function must be called before SCIOpen(). * - * * - * Flags: * - * None * - * * - * Specific error codes for this function: * - * * - * None * - * * - *********************************************************************************/ -#define SCIInitialize _SISCI_EXPANDE_FUNCTION_NAME(SCIInitialize) -DLL void SCIInitialize(unsigned int flags, - sci_error_t *error); -#if 0 -unsigned int __Internal_SISCI_version_var; -#endif - -/********************************************************************************* - * * - * S C I T E R M I N A T E * - * * - * This function terminates the SISCI library. * - * The function must be called after SCIClose(). * - * * - * * - *********************************************************************************/ -#define SCITerminate _SISCI_EXPANDE_FUNCTION_NAME(SCITerminate) -DLL void SCITerminate(void); - -/********************************************************************************* - * * - * S C I O P E N * - * * - * * - * Opens a SCI virtual device. * - * Caller must supply a pointer to a variable of type sci_desc_t to be * - * initialized. * - * * - * Flags * - * SCI_FLAG_THREAD_SAFE - Operations on resources associated with this * - * descriptor will be performed in a multithread-safe * - * manner. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_INCONSISTENT_VERSIONS - Inconsistency between the SISCI library * - * and the SISCI driver versions. * - * * - * * - *********************************************************************************/ -#define SCIOpen _SISCI_EXPANDE_FUNCTION_NAME(SCIOpen) -DLL void SCIOpen(sci_desc_t *sd, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I C L O S E * - * * - * This function closes an open SCI virtual device. * - * * - * Flags: * - * None * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_BUSY - All resources are not deallocated. * - * * - *********************************************************************************/ -#define SCIClose _SISCI_EXPANDE_FUNCTION_NAME(SCIClose) -DLL void SCIClose(sci_desc_t sd, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I C O N N E C T S E G M E N T * - * * - * Connects to a remote shared memory segment located at with the * - * identifier . * - * The user may then call SCIMapRemoteSegment() to map shared memory * - * into user space. * - * * - * Flags * - * SCI_FLAG_USE_CALLBACK * - * SCI_FLAG_ASYNCHRONOUS_CONNECT * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_NO_SUCH_SEGMENT - Could not find the remote segment with the * - * given segmentId. * - * SCI_ERR_CONNECTION_REFUSED - Connection attempt refused by remote node. * - * SCI_ERR_TIMEOUT - The function timed out after specified * - * timeout value. * - * SCI_ERR_NO_LINK_ACCESS - It was not possible to communicate via the * - * local adapter. * - * SCI_ERR_NO_REMOTE_LINK_ACCESS - It was not possible to communicate via a * - * remote switch port. * - * * - *********************************************************************************/ -#define SCIConnectSegment _SISCI_EXPANDE_FUNCTION_NAME(SCIConnectSegment) -DLL void SCIConnectSegment(sci_desc_t sd, - sci_remote_segment_t *segment, - unsigned int nodeId, - unsigned int segmentId, - unsigned int localAdapterNo, - sci_cb_remote_segment_t callback, - void *callbackArg, - unsigned int timeout, - unsigned int flags, - sci_error_t *error); - - -/********************************************************************************* - * * - * S C I D I S C O N N E C T S E G M E N T * - * * - * Disconnects from the give mapped shared memory segment * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_BUSY - The segment is currently mapped or in use. * - * * - *********************************************************************************/ -#define SCIDisconnectSegment _SISCI_EXPANDE_FUNCTION_NAME(SCIDisconnectSegment) -DLL void SCIDisconnectSegment(sci_remote_segment_t segment, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I G E T R E M O T E S E G M E N T S I Z E * - * * - *********************************************************************************/ -#define SCIGetRemoteSegmentSize _SISCI_EXPANDE_FUNCTION_NAME(SCIGetRemoteSegmentSize) -DLL unsigned int SCIGetRemoteSegmentSize(sci_remote_segment_t segment); - - - -/********************************************************************************* - * * - * S C I W A I T F O R R E M O T E S E G M E N T E V E N T * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_TIMEOUT - The function timed out after specified * - * timeout value. * - * SCI_ERR_ILLEGAL_OPERATION - Illegal operation. * - * SCI_ERR_CANCELLED - The wait operation has been cancelled du * - * to a SCIDisconnectSegment() on the same * - * handle. The handle is invalid when this * - * error is returned. * - * * - *********************************************************************************/ -#define SCIWaitForRemoteSegmentEvent _SISCI_EXPANDE_FUNCTION_NAME(SCIWaitForRemoteSegmentEvent) -DLL sci_segment_cb_reason_t SCIWaitForRemoteSegmentEvent( - sci_remote_segment_t segment, - sci_error_t *status, - unsigned int timeout, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I M A P R E M O T E S E G M E N T * - * * - * This function is used to include a shared memory segment in the virtual * - * address space of the application. * - * * - * Flags: * - * * - * SCI_FLAG_FIXED_MAP_ADDR - Map at the suggested virtual address * - * SCI_FLAG_READONLY_MAP - The segment is mapped in read-only mode * - * SCI_FLAG_LOCK_OPERATION - Enable Lock operations (fetch and add) * - * SCI_FLAG_READ_PREFETCH_AGGR_HOLD_MAP * - * - Enable aggressive prefetch with speculative * - * hold. * - * * - * SCI_FLAG_READ_PREFETCH_NO_HOLD_MAP * - * - The PSB66 will prefetch 64 bytes. As soon * - * as the PCI read retry has been accepted, * - * the stream will change state to FREE, even * - * if less than 64 bytes were actually read. * - * * - * SCI_FLAG_IO_MAP_IOSPACE - Enable No Prefetch, no speculative hold. * - * * - * SCI_FLAG_DMOVE_MAP - Enable DMOVE packet type. The stream will be * - * set into FREE state immediately. * - * * - * SCI_FLAG_WRITES_DISABLE_GATHER_MAP * - * - Disable use of gather. * - * * - * SCI_FLAG_DISABLE_128_BYTES_PACKETS * - * - Disable use of 128-Byte packets * - * * - * SCI_FLAG_CONDITIONAL_INTERRUPT_MAP * - * - Write operations through this map will cause * - * an atomic "fetch-and-add-one" operation on * - * remote memory, but in addition an interrupt * - * will be generated if the target memory * - * location contained a "null value" before the * - * add operation was carried out. * - * The conditional interrupt flag must also be * - * specified in the SCIRegisterInterruptFlag() * - * function. * - * * - * SCI_FLAG_UNCONDITIONAL_INTERRUPT_MAP * - * - Write operations through this map will cause * - * an interrupt for the remote adapter * - * "in addition to" updating the corresponding * - * remote memory location with the data being * - * written. * - * The unconditional interrupt flag must also * - * be specified in the * - * SCIRegisterInterruptFlag() function. * - * * - * SCI_FLAG_WRITE_BACK_CACHE_MAP * - * - Enable cacheing of the mapped region. * - * Writes through this map will be written to a * - * write back cache, hence no remote SCI updates* - * until the cache line is flushed. The * - * application is responsible for the cache * - * flush operation. * - * The SCImemCopy() function will handle this * - * correctly by doing cache flushes internally. * - * This feature is architechture dependent and * - * not be available on all plattforms. * - * * - * SCI_FLAG_NO_MEMORY_LOOPBACK_MAP * - * - Forces a map to a remote segment located * - * in the local machine to be mapped using * - * SCI loopback. This is useful i.e. if you * - * want to use a regular map access to be * - * serialized with lock operations. * - * The default behaviour is to access a remte * - * segment located in the local machine as a * - * local MMU operation. * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_OUT_OF_RANGE - The sum of the offset and size is * - * larger than the segment size. * - * SCI_ERR_SIZE_ALIGNMENT - Size is not correctly aligned as * - * required by the implementation. * - * SCI_ERR_OFFSET_ALIGNMENT - Offset is not correctly aligned as * - * required by the implementation. * - * * - *********************************************************************************/ -#define SCIMapRemoteSegment _SISCI_EXPANDE_FUNCTION_NAME(SCIMapRemoteSegment) -DLL volatile void *SCIMapRemoteSegment( - sci_remote_segment_t segment, - sci_map_t *map, - unsigned int offset, - unsigned int size, - void *addr, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I M A P L O C A L S E G M E N T * - * * - * Flags * - * * - * SCI_FLAG_FIXED_MAP_ADDR * - * SCI_FLAG_READONLY_MAP * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_OUT_OF_RANGE - The sum of the offset and size is * - * larger than the segment size. * - * SCI_ERR_SIZE_ALIGNMENT - Size is not correctly aligned as * - * required by the implementation. * - * SCI_ERR_OFFSET_ALIGNMENT - Offset is not correctly aligned as * - * required by the implementation. * - * * - *********************************************************************************/ -#define SCIMapLocalSegment _SISCI_EXPANDE_FUNCTION_NAME(SCIMapLocalSegment) -DLL void *SCIMapLocalSegment(sci_local_segment_t segment, - sci_map_t *map, - unsigned int offset, - unsigned int size, - void *addr, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I U N M A P S E G M E N T * - * * - * This function unmaps pages of shared memory from the callers virtual * - * address space. * - * * - * Flags * - * None. * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_BUSY - The map is currently in use. * - * * - *********************************************************************************/ -#define SCIUnmapSegment _SISCI_EXPANDE_FUNCTION_NAME(SCIUnmapSegment) -DLL void SCIUnmapSegment(sci_map_t map, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I C R E A T E S E G M E N T * - * * - * Make the specified segment available for connections via the specified * - * adapter. If successful, the segment can be accessed from remote nodes * - * via the specified adapter. * - * * - * Flags: * - * * - * SCI_FLAG_USE_CALLBACK - The callback function will be invoked for events * - * on this segment. * - * SCI_FLAG_EMPTY - No memory will be allocated for the segment. * - * SCI_FLAG_PRIVATE - The segment will be private meaning it will never * - * be any connections to it. * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_SEGMENTID_USED - The segment with this segmentId is already used * - * SCI_ERR_SIZE_ALIGNMENT - Size is not correctly aligned as required * - * by the implementation. * - * * - *********************************************************************************/ -#define SCICreateSegment _SISCI_EXPANDE_FUNCTION_NAME(SCICreateSegment) -DLL void SCICreateSegment(sci_desc_t sd, - sci_local_segment_t *segment, - unsigned int segmentId, - unsigned int size, - sci_cb_local_segment_t callback, - void *callbackArg, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I W A I T F O R L O C A L S E G M E N T E V E N T * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_TIMEOUT - The function timed out after specified timeout value. * - * SCI_ERR_CANCELLED - The wait operation has been cancelled du to a * - * SCIRemoveSegment() on the same handle. * - * The handle is invalid when this error is returned. * - * * - *********************************************************************************/ -#define SCIWaitForLocalSegmentEvent _SISCI_EXPANDE_FUNCTION_NAME(SCIWaitForLocalSegmentEvent) -DLL sci_segment_cb_reason_t SCIWaitForLocalSegmentEvent( - sci_local_segment_t segment, - unsigned int *sourcenodeId, - unsigned int *localAdapterNo, - unsigned int timeout, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I P R E P A R E S E G M E N T * - * * - * Flags * - * * - * SCI_FLAG_DMA_SOURCE_ONLY - The segment will be used as a source segment * - * for DMA operations. On some system types this * - * will enable the SISCI driver to use performance * - * improving features. * - * * - * Specific error codes for this function: * - * * - * * - *********************************************************************************/ -#define SCIPrepareSegment _SISCI_EXPANDE_FUNCTION_NAME(SCIPrepareSegment) -DLL void SCIPrepareSegment(sci_local_segment_t segment, - unsigned int localAdapterNo, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I R E M O V E S E G M E N T * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_BUSY - Unable to remove the segment. The segment is currently * - * in use. * - * * - *********************************************************************************/ -#define SCIRemoveSegment _SISCI_EXPANDE_FUNCTION_NAME(SCIRemoveSegment) -DLL void SCIRemoveSegment(sci_local_segment_t segment, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I S E T S E G M E N T A V A I L A B L E * - * * - * Flags * - * None. * - * * - * * - * SCI_ERR_SEGMENT_NOT_PREPARED - The segment has not been prepared for access * - * from this adapter. * - * SCI_ERR_ILLEGAL_OPERATION - The segment is created with the * - * SCI_FLAG_PRIVATE flag specified and * - * therefore has no segmentId. * - * * - *********************************************************************************/ -#define SCISetSegmentAvailable _SISCI_EXPANDE_FUNCTION_NAME(SCISetSegmentAvailable) -DLL void SCISetSegmentAvailable(sci_local_segment_t segment, - unsigned int localAdapterNo, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I S E T S E G M E N T U N A V A I L A B L E * - * * - * Flags * - * * - * SCI_FLAG_FORCE_DISCONNECT * - * SCI_FLAG_NOTIFY * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_ILLEGAL_OPERATION - Illegal operation. * - * * - *********************************************************************************/ -#define SCISetSegmentUnavailable _SISCI_EXPANDE_FUNCTION_NAME(SCISetSegmentUnavailable) -DLL void SCISetSegmentUnavailable(sci_local_segment_t segment, - unsigned int localAdapterNo, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I C R E A T E M A P S E Q U E N C E * - * * - * Flags: * - * * - * SCI_FLAG_FAST_BARRIER * - * * - * * - * Specific error codes for this function: * - * * - *********************************************************************************/ -#define SCICreateMapSequence _SISCI_EXPANDE_FUNCTION_NAME(SCICreateMapSequence) -DLL void SCICreateMapSequence(sci_map_t map, - sci_sequence_t *sequence, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I R E M O V E S E Q U E N C E * - * * - * Flags: * - * None * - * * - * Specific error codes for this function: * - * * - *********************************************************************************/ -#define SCIRemoveSequence _SISCI_EXPANDE_FUNCTION_NAME(SCIRemoveSequence) -DLL void SCIRemoveSequence(sci_sequence_t sequence, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I S T A R T S E Q U E N C E * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * * - *********************************************************************************/ -#define SCIStartSequence _SISCI_EXPANDE_FUNCTION_NAME(SCIStartSequence) -DLL sci_sequence_status_t SCIStartSequence(sci_sequence_t sequence, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I C H E C K S E Q U E N CE * - * * - * Flags * - * * - * SCI_FLAG_NO_FLUSH * - * SCI_FLAG_NO_STORE_BARRIER * - * * - * * - * Specific error codes for this function: * - * * - *********************************************************************************/ -#define SCICheckSequence _SISCI_EXPANDE_FUNCTION_NAME(SCICheckSequence) -DLL sci_sequence_status_t SCICheckSequence(sci_sequence_t sequence, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I S T O R E B A R R I E R * - * * - * Flags * - * None. * - * * - * * - * * - *********************************************************************************/ -#define SCIStoreBarrier _SISCI_EXPANDE_FUNCTION_NAME(SCIStoreBarrier) -DLL void SCIStoreBarrier(sci_sequence_t sequence, - unsigned int flags); - - - - -/********************************************************************************* - * * - * S C I F L U S H R E A D B U F F E R S * - * * - *********************************************************************************/ -#define SCIFlushReadBuffers _SISCI_EXPANDE_FUNCTION_NAME(SCIFlushReadBuffers) -DLL void SCIFlushReadBuffers(sci_sequence_t sequence); - - - - -/********************************************************************************* - * * - * S C I P R O B E N O D E * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_NO_LINK_ACCESS - It was not possible to communicate via the * - * local adapter. * - * SCI_ERR_NO_REMOTE_LINK_ACCESS - It was not possible to communicate via a * - * remote switch port. * - * * - *********************************************************************************/ -#define SCIProbeNode _SISCI_EXPANDE_FUNCTION_NAME(SCIProbeNode) -DLL int SCIProbeNode(sci_desc_t sd, - unsigned int localAdapterNo, - unsigned int nodeId, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I G E T C S R R E G I S T E R * - * * - * SISCI Priveleged function * - * * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_NO_LINK_ACCESS - It was not possible to communicate via the * - * local adapter. * - * SCI_ERR_NO_REMOTE_LINK_ACCESS - It was not possible to communicate via a * - * remote switch port. * - * * - *********************************************************************************/ -#define SCIGetCSRRegister _SISCI_EXPANDE_FUNCTION_NAME(SCIGetCSRRegister) -DLL unsigned int SCIGetCSRRegister(sci_desc_t sd, - unsigned int localAdapterNo, - unsigned int SCINodeId, - unsigned int CSROffset, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I S E T C S R R E G I S T E R * - * * - * SISCI Priveleged function * - * * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_NO_LINK_ACCESS - It was not possible to communicate via the * - * local adapter. * - * SCI_ERR_NO_REMOTE_LINK_ACCESS - It was not possible to communicate via a * - * remote switch port. * - * * - *********************************************************************************/ -#define SCISetCSRRegister _SISCI_EXPANDE_FUNCTION_NAME(SCISetCSRRegister) -DLL void SCISetCSRRegister(sci_desc_t sd, - unsigned int localAdapterNo, - unsigned int SCINodeId, - unsigned int CSROffset, - unsigned int CSRValue, - unsigned int flags, - sci_error_t *error); - - -/********************************************************************************* - * * - * S C I G E T L O C A L C S R * - * * - * SISCI Priveleged function * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * * - *********************************************************************************/ -#define SCIGetLocalCSR _SISCI_EXPANDE_FUNCTION_NAME(SCIGetLocalCSR) -DLL unsigned int SCIGetLocalCSR(sci_desc_t sd, - unsigned int localAdapterNo, - unsigned int CSROffset, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I S E T L O C A L C S R * - * * - * SISCI Priveleged function - * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * * - *********************************************************************************/ -#define SCISetLocalCSR _SISCI_EXPANDE_FUNCTION_NAME(SCISetLocalCSR) -DLL void SCISetLocalCSR(sci_desc_t sd, - unsigned int localAdapterNo, - unsigned int CSROffset, - unsigned int CSRValue, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I A T T A C H P H Y S I C A L M E M O R Y * - * * - * SISCI Priveleged function * - * * - * Description: * - * * - * This function enables usage of physical devices and memory regions where the * - * Physical PCI bus address ( and mapped CPU address ) are already known. * - * The function will register the physical memory as a SISCI segment which can * - * be connected and mapped as a regular SISCI segment. * - * * - * Requirements: * - * * - * SCICreateSegment() with flag SCI_FLAG_EMPTY must have been called in advance * - * * - * Parameter description: * - * sci_ioaddr_t ioaddress : This is the address on the PCI bus that a PCI bus * - * master has to use to write to the specified memory * - * void * address : This is the (mapped) virtual address that the * - * application has to use to access the device. * - * This means that the device has to be mapped in * - * advance bye the devices own driver. * - * If the device is not to be accessed by the local * - * CPU, the address pointer shold be set to NULL * - * Flags * - * * - * None * - * * - * * - * Specific error codes for this function: * - * * - * * - *********************************************************************************/ -#define SCIAttachPhysicalMemory _SISCI_EXPANDE_FUNCTION_NAME(SCIAttachPhysicalMemory) -DLL void SCIAttachPhysicalMemory(sci_ioaddr_t ioaddress, - void *address, - unsigned int busNo, - unsigned int size, - sci_local_segment_t segment, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I Q U E R Y * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_ILLEGAL_QUERY - Unrecognized command. * - * * - *********************************************************************************/ -#define SCIQuery _SISCI_EXPANDE_FUNCTION_NAME(SCIQuery) -DLL void SCIQuery(unsigned int command, - void *data, - unsigned int flags, - sci_error_t *error); - - -/* MAJOR QUERY COMMANDS */ - -/* This command requires a pointer to a structure of type */ -/* "sci_query_string". The string will be filled in by the query. */ -#define SCI_Q_VENDORID _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_VENDORID) -extern const unsigned int SCI_Q_VENDORID; - - -/* Same as for SCI_VENDOR_ID */ -#define SCI_Q_API _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_API) -extern const unsigned int SCI_Q_API; - - -/* User passes a pointer to an allocated object of the */ -/* "sci_query_adapter" struct. */ -#define SCI_Q_ADAPTER _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER) -extern const unsigned int SCI_Q_ADAPTER; - - -/* User passes a pointer to an allocated object of the */ -/* "sci_query_system" struct. */ -#define SCI_Q_SYSTEM _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_SYSTEM) -extern const unsigned int SCI_Q_SYSTEM; - -#define SCI_Q_LOCAL_SEGMENT _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_LOCAL_SEGMENT) -extern const unsigned int SCI_Q_LOCAL_SEGMENT; - -#define SCI_Q_REMOTE_SEGMENT _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_REMOTE_SEGMENT) -extern const unsigned int SCI_Q_REMOTE_SEGMENT; - -#define SCI_Q_MAP _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_MAP) -extern const unsigned int SCI_Q_MAP; - -typedef struct { - char *str; /* Pointer to a string of minimum "length" characters */ - unsigned int length; -} sci_query_string_t; - - -typedef struct { - unsigned int localAdapterNo; /* The adapter no. that the query concern. */ - unsigned int portNo; /* The SCI Link port number that the query concern. */ - unsigned int subcommand; /* A subcommand as specified below. */ - void *data; /* A pointer to an unsigned int that will return */ - /* the response to the query. */ -} sci_query_adapter_t; - - -typedef struct { - unsigned int subcommand; /* A subcommand as specified below. */ - void *data; /* A pointer to an unsigned int that will return */ - /* the response to the query. */ -} sci_query_system_t; - -typedef struct { - sci_local_segment_t segment; - unsigned int subcommand; - union { - sci_ioaddr_t ioaddr; - } data; -} sci_query_local_segment_t; - -typedef struct { - sci_remote_segment_t segment; - unsigned int subcommand; - union { - sci_ioaddr_t ioaddr; - } data; -} sci_query_remote_segment_t; - -typedef struct { - sci_map_t map; - unsigned int subcommand; - unsigned int data; -} sci_query_map_t; - -/* Minor query commands (sub-commands) for adapter specific information SCI_ADAPTER */ -#define SCI_Q_ADAPTER_DMA_SIZE_ALIGNMENT _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_DMA_SIZE_ALIGNMENT) -extern const unsigned int SCI_Q_ADAPTER_DMA_SIZE_ALIGNMENT; - -#define SCI_Q_ADAPTER_DMA_OFFSET_ALIGNMENT _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_DMA_OFFSET_ALIGNMENT) -extern const unsigned int SCI_Q_ADAPTER_DMA_OFFSET_ALIGNMENT; - -#define SCI_Q_ADAPTER_DMA_MTU _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_DMA_MTU) -extern const unsigned int SCI_Q_ADAPTER_DMA_MTU; - -#define SCI_Q_ADAPTER_SUGGESTED_MIN_DMA_SIZE _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_SUGGESTED_MIN_DMA_SIZE) -extern const unsigned int SCI_Q_ADAPTER_SUGGESTED_MIN_DMA_SIZE; - -#define SCI_Q_ADAPTER_SUGGESTED_MIN_BLOCK_SIZE _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_SUGGESTED_MIN_BLOCK_SIZE) -extern const unsigned int SCI_Q_ADAPTER_SUGGESTED_MIN_BLOCK_SIZE; - -#define SCI_Q_ADAPTER_NODEID _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_NODEID) -extern const unsigned int SCI_Q_ADAPTER_NODEID; - -#define SCI_Q_ADAPTER_SERIAL_NUMBER _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_SERIAL_NUMBER) -extern const unsigned int SCI_Q_ADAPTER_SERIAL_NUMBER; - -#define SCI_Q_ADAPTER_CARD_TYPE _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_CARD_TYPE) -extern const unsigned int SCI_Q_ADAPTER_CARD_TYPE; - -#define SCI_Q_ADAPTER_NUMBER_OF_STREAMS _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_NUMBER_OF_STREAMS) -extern const unsigned int SCI_Q_ADAPTER_NUMBER_OF_STREAMS; - -#define SCI_Q_ADAPTER_STREAM_BUFFER_SIZE _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_STREAM_BUFFER_SIZE) -extern const unsigned int SCI_Q_ADAPTER_STREAM_BUFFER_SIZE; - -#define SCI_Q_ADAPTER_CONFIGURED _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_CONFIGURED) -extern const unsigned int SCI_Q_ADAPTER_CONFIGURED; - -#define SCI_Q_ADAPTER_LINK_OPERATIONAL _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_LINK_OPERATIONAL) -extern const unsigned int SCI_Q_ADAPTER_LINK_OPERATIONAL; - -#define SCI_Q_ADAPTER_HW_LINK_STATUS_IS_OK _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_HW_LINK_STATUS_IS_OK) -extern const unsigned int SCI_Q_ADAPTER_HW_LINK_STATUS_IS_OK; - -#define SCI_Q_ADAPTER_NUMBER _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_NUMBER) -extern const unsigned int SCI_Q_ADAPTER_NUMBER; - -#define SCI_Q_ADAPTER_INSTANCE_NUMBER _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_INSTANCE_NUMBER) -extern const unsigned int SCI_Q_ADAPTER_INSTANCE_NUMBER; - -#define SCI_Q_ADAPTER_FIRMWARE_OK _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_FIRMWARE_OK) -extern const unsigned int SCI_Q_ADAPTER_FIRMWARE_OK; - -#define SCI_Q_ADAPTER_CONNECTED_TO_SWITCH _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_CONNECTED_TO_SWITCH) -extern const unsigned int SCI_Q_ADAPTER_CONNECTED_TO_SWITCH; - -#define SCI_Q_ADAPTER_LOCAL_SWITCH_TYPE _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_LOCAL_SWITCH_TYPE) -extern const unsigned int SCI_Q_ADAPTER_LOCAL_SWITCH_TYPE; - -#define SCI_Q_ADAPTER_LOCAL_SWITCH_PORT_NUMBER _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_LOCAL_SWITCH_PORT_NUMBER) -extern const unsigned int SCI_Q_ADAPTER_LOCAL_SWITCH_PORT_NUMBER; - -#define SCI_Q_ADAPTER_CONNECTED_TO_EXPECTED_SWITCH_PORT _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_CONNECTED_TO_EXPECTED_SWITCH_PORT) -extern const unsigned int SCI_Q_ADAPTER_CONNECTED_TO_EXPECTED_SWITCH_PORT; - -#define SCI_Q_ADAPTER_ATT_PAGE_SIZE _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_ATT_PAGE_SIZE) -extern const unsigned int SCI_Q_ADAPTER_ATT_PAGE_SIZE; - -#define SCI_Q_ADAPTER_ATT_NUMBER_OF_ENTRIES _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_ATT_NUMBER_OF_ENTRIES) -extern const unsigned int SCI_Q_ADAPTER_ATT_NUMBER_OF_ENTRIES; - -#define SCI_Q_ADAPTER_ATT_AVAILABLE_ENTRIES _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_ATT_AVAILABLE_ENTRIES) -extern const unsigned int SCI_Q_ADAPTER_ATT_AVAILABLE_ENTRIES; - -#define SCI_Q_ADAPTER_PHYS_MEM_NODEID _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_SCI_Q_ADAPTER_PHYS_MEM_NODEID) -extern const unsigned int SCI_Q_ADAPTER_PHYS_MEM_NODEID; - -#define SCI_Q_ADAPTER_PHYS_MBX_NODEID _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_SCI_Q_ADAPTER_PHYS_MBX_NODEID) -extern const unsigned int SCI_Q_ADAPTER_PHYS_MBX_NODEID; - -#define SCI_Q_ADAPTER_PHYS_LINK_PORT_NODEID _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_PHYS_LINK_PORT_NODEID) -extern const unsigned int SCI_Q_ADAPTER_PHYS_LINK_PORT_NODEID; - -#define SCI_Q_ADAPTER_SCI_LINK_FREQUENCY _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_SCI_LINK_FREQUENCY) -extern const unsigned int SCI_Q_ADAPTER_SCI_LINK_FREQUENCY; - -#define SCI_Q_ADAPTER_B_LINK_FREQUENCY _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_B_LINK_FREQUENCY) -extern const unsigned int SCI_Q_ADAPTER_B_LINK_FREQUENCY; - -#define SCI_Q_ADAPTER_IO_BUS_FREQUENCY _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_IO_BUS_FREQUENCY) -extern const unsigned int SCI_Q_ADAPTER_IO_BUS_FREQUENCY; - -/* Minor query commands (sub-commands) for adapter specific information SCI_SYSTEM */ -#define SCI_Q_SYSTEM_HOSTBRIDGE _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_SYSTEM_HOSTBRIDGE) -extern const unsigned int SCI_Q_SYSTEM_HOSTBRIDGE; - -#define SCI_Q_SYSTEM_WRITE_POSTING_ENABLED _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_SYSTEM_WRITE_POSTING_ENABLED) -extern const unsigned int SCI_Q_SYSTEM_WRITE_POSTING_ENABLED; - -#define SCI_Q_SYSTEM_WRITE_COMBINING_ENABLED _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_SYSTEM_WRITE_COMBINING_ENABLED) -extern const unsigned int SCI_Q_SYSTEM_WRITE_COMBINING_ENABLED; - -#define SCI_Q_LOCAL_SEGMENT_IOADDR _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_LOCAL_SEGMENT_IOADDR) -extern const unsigned int SCI_Q_LOCAL_SEGMENT_IOADDR; - -#define SCI_Q_REMOTE_SEGMENT_IOADDR _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_REMOTE_SEGMENT_IOADDR) -extern const unsigned int SCI_Q_REMOTE_SEGMENT_IOADDR; - -#define SCI_Q_MAP_MAPPED_TO_LOCAL_TARGET _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_MAP_MAPPED_TO_LOCAL_TARGET) -extern const unsigned int SCI_Q_MAP_MAPPED_TO_LOCAL_TARGET; - -#define SCI_Q_MAP_QUERY_REMOTE_MAPPED_TO_LOCAL_TARGET _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_MAP_QUERY_REMOTE_MAPPED_TO_LOCAL_TARGET) -extern const unsigned int SCI_Q_MAP_QUERY_REMOTE_MAPPED_TO_LOCAL_TARGET; - -#define HOSTBRIDGE_NOT_AVAILABLE _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_NOT_AVAILABLE) -extern const unsigned int HOSTBRIDGE_NOT_AVAILABLE; - -#define HOSTBRIDGE_UNKNOWN _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_UNKNOWN) -extern const unsigned int HOSTBRIDGE_UNKNOWN; - -#define HOSTBRIDGE_440FX _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_440FX) -extern const unsigned int HOSTBRIDGE_440FX; - -#define HOSTBRIDGE_440LX _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_440LX) -extern const unsigned int HOSTBRIDGE_440LX; - -#define HOSTBRIDGE_440BX_A _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_440BX_A) -extern const unsigned int HOSTBRIDGE_440BX_A; - -#define HOSTBRIDGE_440BX_B _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_440BX_B) -extern const unsigned int HOSTBRIDGE_440BX_B; - -#define HOSTBRIDGE_440GX _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_440GX) -extern const unsigned int HOSTBRIDGE_440GX; - -#define HOSTBRIDGE_450KX _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_450KX) -extern const unsigned int HOSTBRIDGE_450KX; - -#define HOSTBRIDGE_430NX _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_430NX) -extern const unsigned int HOSTBRIDGE_430NX; - -#define HOSTBRIDGE_450NX _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_450NX) -extern const unsigned int HOSTBRIDGE_450NX; - -#define HOSTBRIDGE_450NX_MICO _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_450NX_MICO) -extern const unsigned int HOSTBRIDGE_450NX_MICO; - -#define HOSTBRIDGE_450NX_PXB _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_450NX_PXB) -extern const unsigned int HOSTBRIDGE_450NX_PXB; - -#define HOSTBRIDGE_I810 _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_I810) -extern const unsigned int HOSTBRIDGE_I810; - -#define HOSTBRIDGE_I810_DC100 _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_I810_DC100) -extern const unsigned int HOSTBRIDGE_I810_DC100; - -#define HOSTBRIDGE_I810E _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_I810E) -extern const unsigned int HOSTBRIDGE_I810E; - -#define HOSTBRIDGE_I815 _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_I815) -extern const unsigned int HOSTBRIDGE_I815; - -#define HOSTBRIDGE_I840 _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_I840) -extern const unsigned int HOSTBRIDGE_I840; - -#define HOSTBRIDGE_I850 _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_I850) -extern const unsigned int HOSTBRIDGE_I850; - -#define HOSTBRIDGE_I860 _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_I860) -extern const unsigned int HOSTBRIDGE_I860; - -#define HOSTBRIDGE_VIA_KT133 _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_VIA_KT133) -extern const unsigned int HOSTBRIDGE_VIA_KT133; - -#define HOSTBRIDGE_VIA_KX133 _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_VIA_KX133) -extern const unsigned int HOSTBRIDGE_VIA_KX133; - -#define HOSTBRIDGE_VIA_APOLLO_PRO_133A _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_VIA_APOLLO_PRO_133A) -extern const unsigned int HOSTBRIDGE_VIA_APOLLO_PRO_133A; - -#define HOSTBRIDGE_VIA_APOLLO_PRO_266 _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_VIA_APOLLO_PRO_266) -extern const unsigned int HOSTBRIDGE_VIA_APOLLO_PRO_266; - -#define HOSTBRIDGE_AMD_760_MP _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_AMD_760_MP) -extern const unsigned int HOSTBRIDGE_AMD_760_MP; - -#define HOSTBRIDGE_SERVERWORKS_HE _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_SERVERWORKS_HE) -extern const unsigned int HOSTBRIDGE_SERVERWORKS_HE; - -#define HOSTBRIDGE_SERVERWORKS_HE_B _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_SERVERWORKS_HE_B) -extern const unsigned int HOSTBRIDGE_SERVERWORKS_HE_B; - -#define HOSTBRIDGE_SERVERWORKS_LE _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_SERVERWORKS_LE) -extern const unsigned int HOSTBRIDGE_SERVERWORKS_LE; - - - -#define HOSTBRIDGE_WRITE_POSTING_DISABLED _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_WRITE_POSTING_DISABLED) -extern const unsigned int HOSTBRIDGE_WRITE_POSTING_DISABLED; - -#define HOSTBRIDGE_WRITE_POSTING_ENABLED _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_WRITE_POSTING_ENABLED) -extern const unsigned int HOSTBRIDGE_WRITE_POSTING_ENABLED; - - - - -/********************************************************************************* - * * - * S C I C R E A T E D M A Q U E U E * - * * - * Flags * - * * - * SCI_FLAG_DMA_PHDMA : Create physical DMA queue. Please note that this is an * - * priveleged operation. * - * * - * * - * * - * Specific error codes for this function: * - * * - *********************************************************************************/ -#define SCICreateDMAQueue _SISCI_EXPANDE_FUNCTION_NAME(SCICreateDMAQueue) -DLL void SCICreateDMAQueue(sci_desc_t sd, - sci_dma_queue_t *dq, - unsigned int localAdapterNo, - unsigned int maxEntries, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I R E M O V E D M A Q U E U E * - * * - * Flags * - * None. * * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_ILLEGAL_OPERATION - Not allowed in this queue state. * - * * - *********************************************************************************/ -#define SCIRemoveDMAQueue _SISCI_EXPANDE_FUNCTION_NAME(SCIRemoveDMAQueue) -DLL void SCIRemoveDMAQueue(sci_dma_queue_t dq, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I E N Q U E U E D M A T R A N S F E R * - * * - * Flags: * - * * - * SCI_FLAG_DMA_READ - The DMA will be remote --> local * - * (default is local --> remote) * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_OUT_OF_RANGE - The sum of the offset and size is larger * - * than the segment size or larger than max * - * DMA size. * - * SCI_ERR_MAX_ENTRIES - The DMA queue is full * - * SCI_ERR_ILLEGAL_OPERATION - Illegal operation * - * SCI_ERR_SIZE_ALIGNMENT - Size is not correctly aligned as required * - * by the implementation. * - * SCI_ERR_OFFSET_ALIGNMENT - Offset is not correctly aligned as required * - * by the implementation. * - * SCI_ERR_SEGMENT_NOT_PREPARED - The local segment has not been prepared for * - * access from the adapter associated with the * - * queue. * - * SCI_ERR_SEGMENT_NOT_CONNECTED - The remote segment is not connected through * - * the adapter associated with the queue. * - *********************************************************************************/ -#define SCIEnqueueDMATransfer _SISCI_EXPANDE_FUNCTION_NAME(SCIEnqueueDMATransfer) -DLL sci_dma_queue_state_t SCIEnqueueDMATransfer(sci_dma_queue_t dq, - sci_local_segment_t localSegment, - sci_remote_segment_t remoteSegment, - unsigned int localOffset, - unsigned int remoteOffset, - unsigned int size, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I P O S T D M A Q U E U E * - * * - * Flags: * - * * - * SCI_FLAG_USE_CALLBACK - The end of the transfer will cause the callback * - * function to be invoked. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_ILLEGAL_OPERATION - Illegal operation * - * * - *********************************************************************************/ -#define SCIPostDMAQueue _SISCI_EXPANDE_FUNCTION_NAME(SCIPostDMAQueue) -DLL void SCIPostDMAQueue(sci_dma_queue_t dq, - sci_cb_dma_t callback, - void *callbackArg, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I A B O R T D M A Q U E U E * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_ILLEGAL_OPERATION - Illegal operation * - * * - *********************************************************************************/ -#define SCIAbortDMAQueue _SISCI_EXPANDE_FUNCTION_NAME(SCIAbortDMAQueue) -DLL void SCIAbortDMAQueue(sci_dma_queue_t dq, - unsigned int flags, - sci_error_t *error); - - -/********************************************************************************* - * * - * S C I R E S E T D M A Q U E U E * - * * - * Flags * - * None. * * - * * - * * - * Specific error codes for this function: * - * * - * * - *********************************************************************************/ -#define SCIResetDMAQueue _SISCI_EXPANDE_FUNCTION_NAME(SCIResetDMAQueue) -DLL void SCIResetDMAQueue(sci_dma_queue_t dq, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I D M A Q U E U E S T A T E * - * * - *********************************************************************************/ -#define SCIDMAQueueState _SISCI_EXPANDE_FUNCTION_NAME(SCIDMAQueueState) -DLL sci_dma_queue_state_t SCIDMAQueueState(sci_dma_queue_t dq); - - - -/********************************************************************************* - * * - * S C I W A I T F O R D M A Q U E U E * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_ILLEGAL_OPERATION - Illegal operation * - * SCI_ERR_TIMEOUT - The function timed out after specified * - * timeout value. * - * * - *********************************************************************************/ -#define SCIWaitForDMAQueue _SISCI_EXPANDE_FUNCTION_NAME(SCIWaitForDMAQueue) -DLL sci_dma_queue_state_t SCIWaitForDMAQueue(sci_dma_queue_t dq, - unsigned int timeout, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I P H D M A E N Q U E U E * - * * - * SISCI Priveleged function * - * * - * Flags * - * * - * SCI_FLAG_DMA_READ * - * * - * Specific error codes for this function: * - * * - *********************************************************************************/ -#define SCIphDmaEnqueue _SISCI_EXPANDE_FUNCTION_NAME(SCIphDmaEnqueue) -DLL void SCIphDmaEnqueue(sci_dma_queue_t dmaqueue, - unsigned int size, - sci_ioaddr_t localBusAddr, - unsigned int remote_nodeid, - unsigned int remote_highaddr, - unsigned int remote_lowaddr, - unsigned int flags, - sci_error_t *error); - -/********************************************************************************* - * * - * S C I P H D M A S T A R T * - * * - * Flags * - * * - * SCI_FLAG_DMA_WAIT * - * SCI_FLAG_USE_CALLBACK * - * SCI_FLAG_DMA_RESET * - * * - * Specific error codes for this function: * - * * - *********************************************************************************/ -#define SCIphDmaStart _SISCI_EXPANDE_FUNCTION_NAME(SCIphDmaStart) -DLL sci_dma_queue_state_t SCIphDmaStart(sci_dma_queue_t dmaqueue, - sci_cb_dma_t callback, - void *callbackArg, - unsigned int flags, - sci_error_t *error); - -/********************************************************************************* - * * - * S C I C R E A T E I N T E R R U P T * - * * - * Flags * - * * - * SCI_FLAG_USE_CALLBACK * - * SCI_FLAG_FIXED_INTNO * - * SCI_FLAG_SHARED_INT * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_INTNO_USED - This interrupt number is already used. * - * * - *********************************************************************************/ -#define SCICreateInterrupt _SISCI_EXPANDE_FUNCTION_NAME(SCICreateInterrupt) -DLL void SCICreateInterrupt(sci_desc_t sd, - sci_local_interrupt_t *interrupt, - unsigned int localAdapterNo, - unsigned int *interruptNo, - sci_cb_interrupt_t callback, - void *callbackArg, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I R E M O V E I N T E R R U P T * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - *********************************************************************************/ -#define SCIRemoveInterrupt _SISCI_EXPANDE_FUNCTION_NAME(SCIRemoveInterrupt) -DLL void SCIRemoveInterrupt(sci_local_interrupt_t interrupt, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I W A I T F O R I N T E R R U P T * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_TIMEOUT - The function timed out after specified timeout value. * - * SCI_ERR_CANCELLED - The wait was interrupted by a call to * - * SCIRemoveInterrupt. * - * The handle is invalid when this error code is returned.* - * * - *********************************************************************************/ -#define SCIWaitForInterrupt _SISCI_EXPANDE_FUNCTION_NAME(SCIWaitForInterrupt) -DLL void SCIWaitForInterrupt(sci_local_interrupt_t interrupt, - unsigned int timeout, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I C O N N E C T I N T E R R U P T * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_NO_SUCH_INTNO - No such interrupt number. * - * SCI_ERR_CONNECTION_REFUSED - Connection attempt refused by remote node. * - * SCI_ERR_TIMEOUT - The function timed out after specified * - * timeout value. * - * * - *********************************************************************************/ -#define SCIConnectInterrupt _SISCI_EXPANDE_FUNCTION_NAME(SCIConnectInterrupt) -DLL void SCIConnectInterrupt(sci_desc_t sd, - sci_remote_interrupt_t *interrupt, - unsigned int nodeId, - unsigned int localAdapterNo, - unsigned int interruptNo, - unsigned int timeout, - unsigned int flags, - sci_error_t *error); - - -/********************************************************************************* - * * - * S C I D I S C O N N E C T I N T E R R U P T * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * * - *********************************************************************************/ -#define SCIDisconnectInterrupt _SISCI_EXPANDE_FUNCTION_NAME(SCIDisconnectInterrupt) -DLL void SCIDisconnectInterrupt(sci_remote_interrupt_t interrupt, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I T R I G G E R I N T E R R U P T * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * * - *********************************************************************************/ -#define SCITriggerInterrupt _SISCI_EXPANDE_FUNCTION_NAME(SCITriggerInterrupt) -DLL void SCITriggerInterrupt(sci_remote_interrupt_t interrupt, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I R E G I S T E R I N T E R R U P T F L A G * - * * - * * - * This function register an "interrupt flag" that is identified as an unique * - * location within a local segment. If successful, the resulting interrupt * - * handle will have been associated with the specified local segment. * - * * - * It is up to the (remote) client(s) to set up an "interrupt mapping" for the * - * corresponding segment offset using either the * - * * - * - SCI_FLAG_CONDITIONAL_INTERRUPT_MAP * - * * - * or the * - * * - * - SCI_FLAG_UNCONDITIONAL_DATA_INTERRUPT_MAP * - * * - * option to "SCIMapRemoteSegment()". - I.e. after having established a * - * connection to the corresponding segment. A trigger operation can then * - * be implemented using a store operation via the relevant "interrupt map". * - * * - * * - * * - * * - * * - * Flags: * - * * - * SCI_FLAG_CONDITIONAL_INTERRUPT - Triggering is to take place using * - * "conditional interrupts". * - * * - * * - * * - * Specific error codes for this function: * - * None. * - * * - *********************************************************************************/ -#define SCIRegisterInterruptFlag _SISCI_EXPANDE_FUNCTION_NAME(SCIRegisterInterruptFlag) -DLL void SCIRegisterInterruptFlag( - unsigned int localAdapterNo, - sci_local_interrupt_t *interrupt, - sci_local_segment_t segment, - unsigned int offset, - sci_cb_interrupt_t callback, - void *callbackArg, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I E N A B L E C O N D I T I O N A L I N T E R R U P T * - * * - * * - * This function make sure that another HW interrupt will take place the next * - * time the corresponding interrupt flag is triggered by a * - * "conditional interrupt" operation. * - * * - * Default semantics: * - * * - * When successful, the client can rely on that the first subsequent trigger * - * operation will cause a HW interrupt and subsequently cause the client * - * handler function to be invoked. * - * * - * If an interrupt was triggered in parallell with the enable operation, then * - * the operation will fail (SCI_ERR_COND_INT_RACE_PROBLEM), and the client can * - * not rely on another trigger operation will lead to handler invocation. * - * Hence, any state checking normally associated with handling the * - * corresponding interrupt should take place before attempting to enable * - * again. * - * * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_COND_INT_RACE_PROBLEM - The enable operation failed because an * - * incomming trigger operation happened * - * concurrently. * - * * - *********************************************************************************/ -#define SCIEnableConditionalInterrupt _SISCI_EXPANDE_FUNCTION_NAME(SCIEnableConditionalInterrupt) -DLL void SCIEnableConditionalInterrupt( - sci_local_interrupt_t interrupt, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I D I S A B L E C O N D I T I O N A L I N T E R R U P T * - * * - * * - * Prevent subsequent "conditional interrupt"trigger operations for * - * the specified interupt flag from causing HW interrupt and handler * - * invocations. * - * * - * * - * Default semantics: * - * * - * If successful, no subsequent HW interrupts will take place, but handler * - * invocations that have already been scheduled may still take place. * - * * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * * - *********************************************************************************/ -#define SCIDisableConditionalInterrupt _SISCI_EXPANDE_FUNCTION_NAME(SCIDisableConditionalInterrupt) -DLL void SCIDisableConditionalInterrupt( - sci_local_interrupt_t interrupt, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I G E T C O N D I T I O N A L I N T E R R U P T C O U N T E R * - * * - * * - * Returns a value that indicates the number of times this flag has * - * been trigged since the last time it was enabled or disabled. * - * Calling the SCIEnableConditionalInterrupt / SCIDisableConditionalInterrupt * - * functions will reset the counter value. * - * * - * Default semantics: * - * * - * If successful, the current trig count is returned in the * - * interruptTrigCounter parameter. * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_OVERFLOW - The number of trig operations have exceeded the range * - * that can be counted. * - *********************************************************************************/ -#define SCIGetConditionalInterruptTrigCounter _SISCI_EXPANDE_FUNCTION_NAME(SCIGetConditionalInterruptTrigCounter) -DLL void SCIGetConditionalInterruptTrigCounter( - sci_local_interrupt_t interrupt, - unsigned int *interruptTrigCounter, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I T R A N S F E R B L O C K * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_OUT_OF_RANGE - The sum of the size and offset is larger * - * than the corresponding map size. * - * SCI_ERR_SIZE_ALIGNMENT - Size is not correctly aligned as required * - * by the implementation. * - * SCI_ERR_OFFSET_ALIGNMENT - Offset is not correctly aligned as required * - * by the implementation. * - * SCI_ERR_TRANSFER_FAILED - The data transfer failed. * - * * - *********************************************************************************/ -#define SCITransferBlock _SISCI_EXPANDE_FUNCTION_NAME(SCITransferBlock) -DLL void SCITransferBlock(sci_map_t sourceMap, - unsigned int sourceOffset, - sci_map_t destinationMap, - unsigned int destinationOffset, - unsigned int size, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I T R A N S F E R B L O C K A S Y N C * - * * - * Flags * - * * - * SCI_FLAG_BLOCK_READ * - * SCI_FLAG_USE_CALLBACK * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_OUT_OF_RANGE - The sum of the size and offset is larger than * - * the corresponding map size. * - * SCI_ERR_SIZE_ALIGNMENT - Size is not correctly aligned as required by * - * the implementation. * - * SCI_ERR_OFFSET_ALIGNMENT - Offset is not correctly aligned as required * - * by the implementation. * - * SCI_ERR_TRANSFER_FAILED - The data transfer failed. * - * * - *********************************************************************************/ -#define SCITransferBlockAsync _SISCI_EXPANDE_FUNCTION_NAME(SCITransferBlockAsync) -DLL void SCITransferBlockAsync(sci_map_t sourceMap, - unsigned int sourceOffset, - sci_map_t destinationMap, - unsigned int destinationOffset, - unsigned int size, - sci_block_transfer_t *block, - sci_cb_block_transfer_t callback, - void *callbackArg, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I W A I T F O R B L O C K T R A N S F E R * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_ILLEGAL_OPERATION - Illegal operation * - * SCI_ERR_TIMEOUT - The function timed out after specified * - * timeout value. * - * * - *********************************************************************************/ -#define SCIWaitForBlockTransfer _SISCI_EXPANDE_FUNCTION_NAME(SCIWaitForBlockTransfer) -DLL void SCIWaitForBlockTransfer(sci_block_transfer_t block, - unsigned int timeout, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I A B O R T B L O C K T R A N S F E R * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_ILLEGAL_OPERATION - Illegal operation * - * * - *********************************************************************************/ -#define SCIAbortBlockTransfer _SISCI_EXPANDE_FUNCTION_NAME(SCIAbortBlockTransfer) -DLL void SCIAbortBlockTransfer(sci_block_transfer_t block, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I M E M C P Y * - * * - * Flags: * - * SCI_FLAG_BLOCK_READ * - * SCI_FLAG_ERROR_CHECK * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_OUT_OF_RANGE - The sum of the size and offset is larger * - * than the corresponding map size. * - * SCI_ERR_SIZE_ALIGNMENT - Size is not correctly aligned as required * - * by the implementation. * - * SCI_ERR_OFFSET_ALIGNMENT - Offset is not correctly aligned as required * - * by the implementation. * - * SCI_ERR_TRANSFER_FAILED - The data transfer failed. * - * * - *********************************************************************************/ - -#define SCIMemCpy _SISCI_EXPANDE_FUNCTION_NAME(SCIMemCpy) -DLL void SCIMemCpy(sci_sequence_t sequence, - void *memAddr, - sci_map_t remoteMap, - unsigned int remoteOffset, - unsigned int size, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I M E M C O P Y * - * * - * Flags: * - * SCI_FLAG_BLOCK_READ * - * SCI_FLAG_ERROR_CHECK * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_OUT_OF_RANGE - The sum of the size and offset is larger * - * than the corresponding map size. * - * SCI_ERR_SIZE_ALIGNMENT - Size is not correctly aligned as required * - * by the implementation. * - * SCI_ERR_OFFSET_ALIGNMENT - Offset is not correctly aligned as required * - * by the implementation. * - * SCI_ERR_TRANSFER_FAILED - The data transfer failed. * - * * - *********************************************************************************/ - - -#define SCIMemCopy _SISCI_EXPANDE_FUNCTION_NAME(SCIMemCopy) -DLL void SCIMemCopy(void *memAddr, - sci_map_t remoteMap, - unsigned int remoteOffset, - unsigned int size, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I R E G I S T E R S E G M E N T M E M O R Y * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_SIZE_ALIGNMENT - Size is not correctly aligned as required by * - * the implementation. * - * SCI_ERR_ILLEGAL_ADDRESS - Illegal address. * - * SCI_ERR_OUT_OF_RANGE - Size is larger than the maximum size for the * - * local segment. * - * * - *********************************************************************************/ -#define SCIRegisterSegmentMemory _SISCI_EXPANDE_FUNCTION_NAME(SCIRegisterSegmentMemory) -DLL void SCIRegisterSegmentMemory(void *address, - unsigned int size, - sci_local_segment_t segment, - unsigned int flags, - sci_error_t *error); - - - - - -/********************************************************************************* - * * - * S C I C O N N E C T S C I S P A C E * - * * - * SISCI Priveleged function * - * * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_SIZE_ALIGNMENT - Size is not correctly aligned as required * - * by the implementation. * - * SCI_ERR_CONNECTION_REFUSED - Connection attempt refused by remote node. * - * * - *********************************************************************************/ -#define SCIConnectSCISpace _SISCI_EXPANDE_FUNCTION_NAME(SCIConnectSCISpace) -DLL void SCIConnectSCISpace(sci_desc_t sd, - unsigned int localAdapterNo, - sci_remote_segment_t *segment, - sci_address_t address, - unsigned int size, - unsigned int flags, - sci_error_t *error); - - - -/* - * ===================================================================================== - * - * S C I A T T A C H L O C A L S E G M E N T - * Description: - * - * SCIAttachLocalSegment() permits an application to "attach" to an already existing - * local segment, implying that two or more application want - * share the same local segment. The prerequest, is that the - * application which originally created the segment ("owner") has - * preformed a SCIShareSegment() in order to mark the segment - * "shareable". - * - * - * Flags: - * - * SCI_FLAG_USE_CALLBACK - The callback function will be invoked for events - * on this segment. - * - * - * Specific error codes for this function: - * - * SCI_ERR_ACCESS - No such shared segment - * SCI_ERR_NO_SUCH_SEGMENT - No such segment - * Note: Current implenentation will return SCI_ERR_ACCESS for both cases. This will - * change from next release. Application should handle both cases. - * - * ===================================================================================== - */ -#define SCIAttachLocalSegment _SISCI_EXPANDE_FUNCTION_NAME(SCIAttachLocalSegment) - -DLL void -SCIAttachLocalSegment(sci_desc_t sd, - sci_local_segment_t *segment, - unsigned int segmentId, - unsigned int *size, - sci_cb_local_segment_t callback, - void *callbackArg, - unsigned int flags, - sci_error_t *error); -/* - * ===================================================================================== - * - * S C I S H A R E S E G M E N T - * - * Description: - * - * SCIShareSegment() permits other application to "attach" to an already existing - * local segment, implying that two or more application want - * share the same local segment. The prerequest, is that the - * application which originally created the segment ("owner") has - * preformed a SCIShareSegment() in order to mark the segment - * "shareable". - * - * - * Flags: - * none - * - * Specific error codes for this function: - * - * - * - * ===================================================================================== - */ -#define SCIShareSegment _SISCI_EXPANDE_FUNCTION_NAME(SCIShareSegment) - -DLL void -SCIShareSegment(sci_local_segment_t segment, - unsigned int flags, - sci_error_t *error); - - -/********************************************************************************* - * * - * S C I F L U S H * - * * - * This function will flush the CPU buffers and the PSB buffers. * - * * - * Flags * - * SCI_FLAG_FLUSH_CPU_BUFFERS_ONLY : * - * Only flush CPU buffers ( Write combining * - * etc buffers). * - * * - *********************************************************************************/ - -#define SCIFlush _SISCI_EXPANDE_FUNCTION_NAME(SCIFlush) -DLL void SCIFlush(sci_sequence_t sequence, - unsigned int flags); - -#if defined(CPLUSPLUS) || defined(__cplusplus) -} -#endif - - -#endif - - - - - - - - - - - diff --git a/ndb/src/external/SOLARIS.SPARC/sci/include/sisci_error.h b/ndb/src/external/SOLARIS.SPARC/sci/include/sisci_error.h deleted file mode 100644 index aab7c136d3a..00000000000 --- a/ndb/src/external/SOLARIS.SPARC/sci/include/sisci_error.h +++ /dev/null @@ -1,89 +0,0 @@ -/* $Id: sisci_error.h,v 1.1 2002/12/13 12:17:22 hin Exp $ */ - -/******************************************************************************* - * * - * Copyright (C) 1993 - 2000 * - * Dolphin Interconnect Solutions AS * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, * - * or (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * * - * * - *******************************************************************************/ - - - - -#ifndef _SISCI_ERROR_H_ -#define _SISCI_ERROR_H_ - - -/* SCI Error return values always have 30 bit set */ -#define SCI_ERR_MASK 0x40000000 -#define SCI_ERR_REMOTE_MASK 0x01 /* Remote errors should have bit 0 set */ - -#define SCI_ERR(u) ((unsigned32)(u)&0x7FFFFFFF ) - -/* Error codes */ -typedef enum { - SCI_ERR_OK = 0x000, - - - SCI_ERR_BUSY = (0x900 | SCI_ERR_MASK), - SCI_ERR_FLAG_NOT_IMPLEMENTED = (0x901 | SCI_ERR_MASK), - SCI_ERR_ILLEGAL_FLAG = (0x902 | SCI_ERR_MASK), - SCI_ERR_NOSPC = (0x904 | SCI_ERR_MASK), - SCI_ERR_API_NOSPC = (0x905 | SCI_ERR_MASK), - SCI_ERR_HW_NOSPC = (0x906 | SCI_ERR_MASK), - SCI_ERR_NOT_IMPLEMENTED = (0x907 | SCI_ERR_MASK), - SCI_ERR_ILLEGAL_ADAPTERNO = (0x908 | SCI_ERR_MASK), - SCI_ERR_NO_SUCH_ADAPTERNO = (0x909 | SCI_ERR_MASK), - SCI_ERR_TIMEOUT = (0x90A | SCI_ERR_MASK), - SCI_ERR_OUT_OF_RANGE = (0x90B | SCI_ERR_MASK), - SCI_ERR_NO_SUCH_SEGMENT = (0x90C | SCI_ERR_MASK), - SCI_ERR_ILLEGAL_NODEID = (0x90D | SCI_ERR_MASK), - SCI_ERR_CONNECTION_REFUSED = (0x90E | SCI_ERR_MASK), - SCI_ERR_SEGMENT_NOT_CONNECTED = (0x90F | SCI_ERR_MASK), - SCI_ERR_SIZE_ALIGNMENT = (0x910 | SCI_ERR_MASK), - SCI_ERR_OFFSET_ALIGNMENT = (0x911 | SCI_ERR_MASK), - SCI_ERR_ILLEGAL_PARAMETER = (0x912 | SCI_ERR_MASK), - SCI_ERR_MAX_ENTRIES = (0x913 | SCI_ERR_MASK), - SCI_ERR_SEGMENT_NOT_PREPARED = (0x914 | SCI_ERR_MASK), - SCI_ERR_ILLEGAL_ADDRESS = (0x915 | SCI_ERR_MASK), - SCI_ERR_ILLEGAL_OPERATION = (0x916 | SCI_ERR_MASK), - SCI_ERR_ILLEGAL_QUERY = (0x917 | SCI_ERR_MASK), - SCI_ERR_SEGMENTID_USED = (0x918 | SCI_ERR_MASK), - SCI_ERR_SYSTEM = (0x919 | SCI_ERR_MASK), - SCI_ERR_CANCELLED = (0x91A | SCI_ERR_MASK), - SCI_ERR_NOT_CONNECTED = (0x91B | SCI_ERR_MASK), - SCI_ERR_NOT_AVAILABLE = (0x91C | SCI_ERR_MASK), - SCI_ERR_INCONSISTENT_VERSIONS = (0x91D | SCI_ERR_MASK), - SCI_ERR_COND_INT_RACE_PROBLEM = (0x91E | SCI_ERR_MASK), - SCI_ERR_OVERFLOW = (0x91F | SCI_ERR_MASK), - SCI_ERR_NOT_INITIALIZED = (0x920 | SCI_ERR_MASK), - - SCI_ERR_ACCESS = (0x921 | SCI_ERR_MASK), - - SCI_ERR_NO_SUCH_NODEID = (0xA00 | SCI_ERR_MASK), - SCI_ERR_NODE_NOT_RESPONDING = (0xA02 | SCI_ERR_MASK), - SCI_ERR_NO_REMOTE_LINK_ACCESS = (0xA04 | SCI_ERR_MASK), - SCI_ERR_NO_LINK_ACCESS = (0xA05 | SCI_ERR_MASK), - SCI_ERR_TRANSFER_FAILED = (0xA06 | SCI_ERR_MASK) -} sci_error_t; - - -#endif /* _SCI_ERROR_H_ */ - - - diff --git a/ndb/src/external/SOLARIS.SPARC/sci/include/sisci_types.h b/ndb/src/external/SOLARIS.SPARC/sci/include/sisci_types.h deleted file mode 100644 index 77989ffca59..00000000000 --- a/ndb/src/external/SOLARIS.SPARC/sci/include/sisci_types.h +++ /dev/null @@ -1,133 +0,0 @@ -/* $Id: sisci_types.h,v 1.1 2002/12/13 12:17:22 hin Exp $ */ - -/******************************************************************************* - * * - * Copyright (C) 1993 - 2000 * - * Dolphin Interconnect Solutions AS * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, * - * or (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * * - * * - *******************************************************************************/ - - -#ifndef _SISCI_TYPES_H -#define _SISCI_TYPES_H - -#include "sisci_error.h" - -#ifndef IN -#define IN -#endif - -#ifndef OUT -#define OUT -#endif - -#ifndef IN_OUT -#define IN_OUT -#endif - -/* Opaque data types for descriptors/handles */ -typedef struct sci_desc *sci_desc_t; -typedef struct sci_local_segment *sci_local_segment_t; -typedef struct sci_remote_segment *sci_remote_segment_t; - -typedef struct sci_map *sci_map_t; -typedef struct sci_sequence *sci_sequence_t; -#ifndef KERNEL -typedef struct sci_dma_queue *sci_dma_queue_t; -#endif -typedef struct sci_remote_interrupt *sci_remote_interrupt_t; -typedef struct sci_local_interrupt *sci_local_interrupt_t; -typedef struct sci_block_transfer *sci_block_transfer_t; - -/* - * Constants defining reasons for segment callbacks: - */ - -typedef enum { - SCI_CB_CONNECT = 1, - SCI_CB_DISCONNECT, - SCI_CB_NOT_OPERATIONAL, - SCI_CB_OPERATIONAL, - SCI_CB_LOST -} sci_segment_cb_reason_t; - -#define MAX_CB_REASON SCI_CB_LOST - -/* dma_queue_states is identical to the dma_queue_state_t in genif.h, they must be consistent.*/ -typedef enum { - SCI_DMAQUEUE_IDLE, - SCI_DMAQUEUE_GATHER, - SCI_DMAQUEUE_POSTED, - SCI_DMAQUEUE_DONE, - SCI_DMAQUEUE_ABORTED, - SCI_DMAQUEUE_ERROR -} sci_dma_queue_state_t; - - -typedef enum { - SCI_SEQ_OK, - SCI_SEQ_RETRIABLE, - SCI_SEQ_NOT_RETRIABLE, - SCI_SEQ_PENDING -} sci_sequence_status_t; - - -typedef struct { - unsigned short nodeId; /* SCI Address bit 63 - 48 */ - unsigned short offsHi; /* SCI Address bit 47 - 32 */ - unsigned int offsLo; /* SCI Address bit 31 - 0 */ -} sci_address_t; - - -typedef unsigned int sci_ioaddr_t; - -typedef enum { - SCI_CALLBACK_CANCEL = 1, - SCI_CALLBACK_CONTINUE -} sci_callback_action_t; - -#ifndef KERNEL -typedef sci_callback_action_t (*sci_cb_local_segment_t)(void *arg, - sci_local_segment_t segment, - sci_segment_cb_reason_t reason, - unsigned int nodeId, - unsigned int localAdapterNo, - sci_error_t error); - -typedef sci_callback_action_t (*sci_cb_remote_segment_t)(void *arg, - sci_remote_segment_t segment, - sci_segment_cb_reason_t reason, - sci_error_t status); - - -typedef sci_callback_action_t (*sci_cb_dma_t)(void IN *arg, - sci_dma_queue_t queue, - sci_error_t status); - - -typedef int (*sci_cb_block_transfer_t)(void *arg, - sci_block_transfer_t block, - sci_error_t status); - - -typedef sci_callback_action_t (*sci_cb_interrupt_t)(void *arg, - sci_local_interrupt_t interrupt, - sci_error_t status); - -#endif /* KERNEL */ -#endif diff --git a/ndb/src/external/SOLARIS.SPARC/sci/include/sisci_version.h b/ndb/src/external/SOLARIS.SPARC/sci/include/sisci_version.h deleted file mode 100644 index c2fccb9ec33..00000000000 --- a/ndb/src/external/SOLARIS.SPARC/sci/include/sisci_version.h +++ /dev/null @@ -1,91 +0,0 @@ -/* $Id: sisci_version.h,v 1.1 2002/12/13 12:17:22 hin Exp $ */ - -/******************************************************************************* - * * - * Copyright (C) 1993 - 2000 * - * Dolphin Interconnect Solutions AS * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License as published by * - * the Free Software Foundation; either version 2.1 of the License, * - * or (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * * - * * - *******************************************************************************/ - - -#ifndef SISCI_VERSION_H -#define SISCI_VERSION_H - - -#define SISCI_API_VER_MAJOR 1 -#define SISCI_API_VER_MAJORC "1" - -#define SISCI_API_VER_MINOR 10 -#define SISCI_API_VER_MINORC "10" -#define SISCI_API_VER_MICRO 4 -#define SISCI_API_VER_MICROC "4" - -#define SISCI_SIGN_VERSION_MASK 0xfffff000 /* used to mask off API_VER_MICRO */ - -#define SISCI_API_VERSION (SISCI_API_VER_MAJOR << 24 | SISCI_API_VER_MINOR << 12 | SISCI_API_VER_MICRO) - -/* the rules are: - * - * Changes in API_VER_MICRO should be binary compatible, New flags, functions added. No changes to user code - * required if new features is not needed. - * - * Changes in API_VER_MINOR requires recompilation of user code. - * - * Changes in the API_VER_MAJOR will most likely require changes to user code. This should not happen very - * often... - * - */ - -#ifndef BUILD_DATE -#define BUILD_DATE __DATE__ -#endif - -#ifndef BUILD_NAME -#define BUILD_NAME "" -#endif - -#define API_VERSION "SISCI API version " SISCI_API_VER_MAJORC "." SISCI_API_VER_MINORC "."SISCI_API_VER_MICROC " ( "BUILD_NAME" "BUILD_DATE" )" - -#endif - - -/* Version info: */ -/* */ -/* 1.5.2 First SISCI version */ -/* 1.5.3 Some bug fixes */ -/* 1.5.4 Some bug fixes */ -/* 1.5.5 No release */ -/* 1.5.6 Lock flag implemented in function SCIConnectSegment */ -/* 1.5.7 Expanded query functionality */ -/* 1.5.8 Updated error checking (sequence) functionality for D320 */ -/* 1.6.0 Updated error checking (sequence) D320 and IRM 1.9 support */ -/* 1.9.0 Ported to Solaris_sparc, Solaris_x86 and Linux. IRM 1.9. */ -/* 1.9.1 Some bug fixes */ -/* 1.9.2 Added more adapter queries */ -/* 1.9.3 Bug fix in SCIMapLocalSegment and SCIMapRemoteSegment */ -/* 1.9.4 NT Release Developers Kit 2.40 */ -/* 1.9.5 Added flush after data transfer in SCIMemCopy() */ -/* 1.9.5 NT Release Developers Kit 2.44 */ -/* 1.10.0: - * New SCIInitialize(), SCITerminate() functions. - * Support for D330 - * - * - */ - - diff --git a/ndb/src/external/WIN32.x86/sci/include/rmlib.h b/ndb/src/external/WIN32.x86/sci/include/rmlib.h deleted file mode 100644 index 87ba20db99f..00000000000 --- a/ndb/src/external/WIN32.x86/sci/include/rmlib.h +++ /dev/null @@ -1,212 +0,0 @@ -/* $Id: rmlib.h,v 1.1 2002/12/13 12:17:23 hin Exp $ */ - -/********************************************************************************* - * * - * Copyright (C) 1993 - 2000 * - * Dolphin Interconnect Solutions AS * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License as published by * - * the Free Software Foundation; either version 2.1 of the License, * - * or (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * * - * * - *********************************************************************************/ - -/********************************************************************************/ -/* This header file contains the declarations of the SCI Reflective Memory */ -/* library rmlib. The implementation of the library functions is in rmlib.c. */ -/* The library contains all the functions that operate on the reflective */ -/* memory. */ -/* */ -/* NB! */ -/* */ -/* DOLPHIN'S SCI REFLECTIVE MEMORY FILES ARE UNDER DEVELOPMENT AND MAY CHANGE. */ -/* PLEASE CONTACT DOLPHIN FOR FURTHER INFORMATION. */ -/* */ -/* */ -/********************************************************************************/ - -#include "sisci_error.h" -#include "sisci_api.h" -#include "sisci_demolib.h" -#include "sisci_types.h" - -unsigned int seqerr, syncseqerr; - -#ifndef _RMLIB_H -#define _RMLIB_H - - -#if defined(_REENTRANT) - -#define _RMLIB_EXPAND_NAME(name) _RMLIB_MT_ ## name - -#else - -#define _RMLIB_EXPAND_NAME(name) _RMLIB_ST_ ## name - -#endif - -#ifdef __sparc -#define CACHE_SIZE 2097152 -#else -#define CACHE_SIZE 8192 -#endif - -/*********************************************************************************/ -/* FLAG VALUES */ -/*********************************************************************************/ - -#define REFLECT_ERRCHECK 0x2 - -struct ReflectiveMemorySpace { - unsigned int localAdapterNo; - unsigned int localNodeId; - unsigned int remoteNodeId; - sci_desc_t sd; - sci_desc_t syncsd; - sci_map_t localMap; - sci_map_t remoteMap; - unsigned int localSegmentId; - unsigned int remoteSegmentId; - unsigned int syncSegmentId; - unsigned int sync_rSegmentId; - unsigned int segmentSize; - unsigned int *localMapAddr; - volatile unsigned int *remoteMapAddr; - sci_local_segment_t localSegment; - sci_remote_segment_t remoteSegment; - sci_local_segment_t syncSegment; - sci_remote_segment_t sync_rSegment; - sci_map_t syncMap; - sci_map_t sync_rMap; - sci_sequence_t syncsequence; - sci_sequence_t sequence; - unsigned int protection; - unsigned int retry_value; - sci_sequence_status_t sequenceStatus, syncsequenceStatus; - volatile unsigned int *syncMapAddr; - volatile unsigned int *sync_rMapAddr; -}; - -/*********************************************************************************/ -/* P R I N T R E F L E C T I V E M E M O R Y S P A C E */ -/* */ -/*********************************************************************************/ -#define ReflectPrintParameters _RMLIB_EXPAND_NAME(ReflectPrintParameters) -void ReflectPrintParameters(FILE *stream, struct ReflectiveMemorySpace RM_space); - -/*********************************************************************************/ -/* R E F L E C T D M A S E T U P */ -/* */ -/*********************************************************************************/ -#define ReflectDmaSetup _RMLIB_EXPAND_NAME(ReflectDmaSetup) -sci_error_t ReflectDmaSetup(struct ReflectiveMemorySpace RM_space, sci_dma_queue_t *dmaQueue); - -/*********************************************************************************/ -/* R E F L E C T D M A R E M O V E */ -/* */ -/*********************************************************************************/ -#define ReflectDmaRemove _RMLIB_EXPAND_NAME(ReflectDmaRemove) -sci_error_t ReflectDmaRemove(sci_dma_queue_t dmaQueue); - -/*********************************************************************************/ -/* R E F L E C T D M A R U N */ -/* */ -/*********************************************************************************/ -#define ReflectDmaRun _RMLIB_EXPAND_NAME(ReflectDmaRun) -sci_error_t ReflectDmaRun(struct ReflectiveMemorySpace RM_space, - unsigned int* privateSrc, - unsigned int size, - unsigned int offset, - sci_dma_queue_t dmaQueue); -/*********************************************************************************/ -/* C L O S E R E F L E C T I V E M E M O R Y S P A C E */ -/* */ -/*********************************************************************************/ -#define ReflectClose _RMLIB_EXPAND_NAME(ReflectClose) -sci_error_t ReflectClose(struct ReflectiveMemorySpace RM_space, unsigned int segment_no); - -/*********************************************************************************/ -/* O P E N R E F L E C T I V E M E M O R Y S P A C E */ -/* */ -/*********************************************************************************/ -#define ReflectOpen _RMLIB_EXPAND_NAME(ReflectOpen) -sci_error_t ReflectOpen(struct ReflectiveMemorySpace *RM_space, - unsigned int size, - unsigned int segment_no, - unsigned int localAdapterNo, - unsigned int remoteNodeId, - unsigned int protection, - unsigned int retry_value); - -/*********************************************************************************/ -/* R E F L E C T G E T A C C E S S */ -/* */ -/*********************************************************************************/ -#define ReflectGetAccess _RMLIB_EXPAND_NAME(ReflectGetAccess) -sci_error_t ReflectGetAccess(struct ReflectiveMemorySpace *RM_space); - -/*********************************************************************************/ -/* R E F L E C T R E L E A S E A C C E S S */ -/* */ -/*********************************************************************************/ -#define ReflectReleaseAccess _RMLIB_EXPAND_NAME(ReflectReleaseAccess) -sci_error_t ReflectReleaseAccess(struct ReflectiveMemorySpace *RM_space); - -/*********************************************************************************/ -/* R E F L E C T D M A */ -/* */ -/*********************************************************************************/ -#define ReflectDma _RMLIB_EXPAND_NAME(ReflectDma) -sci_error_t ReflectDma(struct ReflectiveMemorySpace RM_space, - unsigned int* privateSrc, - unsigned int size, - unsigned int offset); - -/*********************************************************************************/ -/* R E F L E C T M E M C O P Y */ -/* */ -/*********************************************************************************/ -#define ReflectMemCopy _RMLIB_EXPAND_NAME(ReflectMemCopy) -sci_error_t ReflectMemCopy(struct ReflectiveMemorySpace RM_space, - unsigned int* privateSrc, - unsigned int size, - unsigned int offset, - unsigned int flags); - -/*********************************************************************************/ -/* R E F L E C T S E T */ -/* */ -/*********************************************************************************/ -#define ReflectSet _RMLIB_EXPAND_NAME(ReflectSet) -sci_error_t ReflectSet(struct ReflectiveMemorySpace RM_space, - unsigned int value, - unsigned int size, - unsigned int offset, - unsigned int flags - ); - -/*********************************************************************************/ -/* R E F L E C T P R I N T */ -/* */ -/*********************************************************************************/ -#define ReflectPrint _RMLIB_EXPAND_NAME(ReflectPrint) -sci_error_t ReflectPrint(FILE *stream, - struct ReflectiveMemorySpace RM_space, - unsigned int size, - unsigned int offset - ); - - -#endif diff --git a/ndb/src/external/WIN32.x86/sci/include/scilib.h b/ndb/src/external/WIN32.x86/sci/include/scilib.h deleted file mode 100644 index d1501082bab..00000000000 --- a/ndb/src/external/WIN32.x86/sci/include/scilib.h +++ /dev/null @@ -1,330 +0,0 @@ -/* $Id: scilib.h,v 1.1 2002/12/13 12:17:23 hin Exp $ */ - -/******************************************************************************* - * * - * Copyright (C) 2002 * - * Dolphin Interconnect Solutions AS * - * * - *******************************************************************************/ - - -#if defined(_REENTRANT) -#define _SCIL_EXPANDE_FUNCTION_NAME(name) _SCIL_PUBLIC_FUNC_MT_ ## name -#define _SCIL_EXPANDE_VARIABLE_NAME(name) _SCIL_PUBLIC_VAR_MT_ ## name -#else -#define _SCIL_EXPANDE_FUNCTION_NAME(name) _SCIL_PUBLIC_FUNC_ST_ ## name -#define _SCIL_EXPANDE_VARIABLE_NAME(name) _SCIL_PUBLIC_VAR_ST_ ## name -#endif -#define _SCIL_EXPANDE_CONSTANT_NAME(name) _SCIL_PUBLIC_CONST_ ## name - -#include "sisci_api.h" - -#if defined(CPLUSPLUS) || defined(__cplusplus) -extern "C" { -#endif - - -/* - * SISCI segment id pollution: - * =========================== - * The SISCI library uses regular SISCI segmens internally. - * The MSG_QUEUE_LIB_IDENTIFIER_MASK is a mask which is used by the SISCI - * library to identify internal SISCI segments ids, from segments used directly - * by the user. - * - * Future versions of the library may have its own namespace. - * - */ - -#define MSG_QUEUE_LIB_IDENTIFIER_MASK 0x10000000 - - -/*********************************************************************************/ -/* FLAG VALUES */ -/*********************************************************************************/ - -#define SCIL_FLAG_ERROR_CHECK_DATA _SCIL_EXPANDE_CONSTANT_NAME(SCIL_FLAG_ERROR_CHECK_DATA) -extern const unsigned int SCIL_FLAG_ERROR_CHECK_DATA; - -#define SCIL_FLAG_ERROR_CHECK_PROT _SCIL_EXPANDE_CONSTANT_NAME(SCIL_FLAG_ERROR_CHECK_PROT) -extern const unsigned int SCIL_FLAG_ERROR_CHECK_PROT; - -#define SCIL_FLAG_FULL_ERROR_CHECK _SCIL_EXPANDE_CONSTANT_NAME(SCIL_FLAG_FULL_ERROR_CHECK) -extern const unsigned int SCIL_FLAG_FULL_ERROR_CHECK; - - - - - -typedef struct sci_msq_queue *sci_msq_queue_t; - - -/********************************************************************************* - * * - * S C I L C r e a t e M s g Q u e u e * - * * - * Parameters: * - * * - * Creates a message queue. The message queue identifier object will be allocated* - * if the sci_msq_queue_t * msg pointer is NULL. The function will create a * - * remote connection. If this connection times out, the function shoud be * - * repeated until connection is established. SCILRemoveMsgQueue() must be called * - * to remove the connection and deallocate the message queue identifier. * - * * - * sci_msq_queue_t *msq : Message queue identifier * - * The function must be called with a null pointer * - * the first time. * - * unsigned int localAdapterNo: Local Adapter Number * - * unsigned int remoteNodeId : Remote nodeId * - * unsigned int msqId : Message queue number * - * unsigned int maxMsgCount : The maximum count of messages in queue * - * unsigned int maxMsgSize, : The maximum size of each messages in queue * - * unsigned int timeout : Time to wait for successful connection * - * unsigned int flags : Flags. * - * * - * Flags * - * * - * None * - * * - * Specific error codes for this function: * - * * - * None. Normal SISIC error codes. * - * * - *********************************************************************************/ -#define SCILCreateMsgQueue _SCIL_EXPANDE_FUNCTION_NAME(SCILCreateMsgQueue) -DLL sci_error_t SCILCreateMsgQueue(sci_msq_queue_t *msq, - unsigned int localAdapterNo, - unsigned int remoteNodeId, - unsigned int msqId, - unsigned int maxMsgCount, - unsigned int maxMsgSize, - unsigned int timeout, - unsigned int flags); - - -/********************************************************************************* - * * - * S C I L R e c e i v e M s g * - * * - * * - * Receives a message from the queue. * - * * - * Paremeters * - * * - * sci_msq_queue_t msq : message queue identifier * - * void *msg : Location to store received data * - * unsigned int size : Size of message to read * - * unsigned int *sizeLeft: Bytes left in buffer, after current receive. This is * - * just a hint. There may be more. * - * * - * Flags * - * * - * SCIL_FLAG_ERROR_CHECK_PROT: The internal buffer management is done using full* - * error checking. - * * - * Specific error codes for this function: * - * * - * SCI_ERR_EWOULD_BLOCK : There is not enough data in the message buffer * - * to read the specified number of bytes. * - * . * - * SCI_ERR_NOT_CONNECTED : The connection is not established. * - * * - *********************************************************************************/ -#define SCILReceiveMsg _SCIL_EXPANDE_FUNCTION_NAME(SCILReceiveMsg) -DLL sci_error_t SCILReceiveMsg( - sci_msq_queue_t msq, - void *msg, - unsigned int size, - unsigned int *sizeLeft, - unsigned int flags); - - - -/********************************************************************************* - * * - * S C I L S e n d M s g * - * * - * * - * Sends a message to the queue. * - * * - * Paremeters * - * * - * sci_msq_queue_t msq : Message queue identifier * - * void *msg : Send data * - * unsigned int size : Size of message to send * - * unsigned int *sizeFree: Bytes free in buffer, after current send. This is * - * just a hint. There may be more. * - * * - * Flags * - * * - * SCIL_FLAG_ERROR_CHECK_DATA: The data is transmitted using full error checking* - * SCIL_FLAG_ERROR_CHECK_PROT: The internal buffer management is done using full* - * error checking. * - * SCIL_FLSG_FULL_ERROR_CHECK: This flag is an combination of both above. * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_EWOULD_BLOCK : There is not enough data in the message buffer * - * to send the specified number of bytes. * - * . * - * SCI_ERR_NOT_CONNECTED : The connection is not established. * - * * - *********************************************************************************/ -#define SCILSendMsg _SCIL_EXPANDE_FUNCTION_NAME(SCILSendMsg) -DLL sci_error_t SCILSendMsg( - sci_msq_queue_t msq, - void *msg, - unsigned int size, - unsigned int *sizeFree, - unsigned int flags); - - -/********************************************************************************* - * * - * S C I L R e m o v e M s g Q u e ue * - * * - * * - * Removes a message queue. * - * * - * sci_msq_queue_t msq : Message queue identifier * - * * - * Flags * - * * - * None * - * * - * Specific error codes for this function: * - * * - * None * - * * - *********************************************************************************/ -#define SCILRemoveMsgQueue _SCIL_EXPANDE_FUNCTION_NAME(SCILRemoveMsgQueue) -DLL sci_error_t SCILRemoveMsgQueue( - sci_msq_queue_t *msq, - unsigned int flags); - - - -/********************************************************************************* - * * - * S C I L I n i t * - * * - * * - * Initializes the SCI library. This function must be called before any other * - * function in the library. * - * * - * Flags * - * * - * None * - * * - * Specific error codes for this function: * - * * - * None * - * . * - *********************************************************************************/ -#define SCILInit _SCIL_EXPANDE_FUNCTION_NAME(SCILInit) -DLL sci_error_t SCILInit(unsigned int flags); - - - -/********************************************************************************* - * * - * S C I L D e s t r o y * - * * - * * - * Removes internal resources allocated by the SCI Library. No other library * - * function should be called after this function. * - * * - * Flags * - * * - * None * - * * - * Specific error codes for this function: * - * * - * None * - * * - *********************************************************************************/ -#define SCILDestroy _SCIL_EXPANDE_FUNCTION_NAME(SCILDestroy) -DLL sci_error_t SCILDestroy(unsigned int flags); - - - -/********************************************************************************* - * * - * S C I L C o n n e c t M s g Q u e u e * - * * - * * - * Makes a connection to a remote message queue. This must be done before * - * SCILSendMsg() is called. * - * * - * Parameters: * - * * - * sci_msq_queue_t *msq : Message queue identifier * - * unsigned int localAdapterNo: Local Adapter Number * - * unsigned int remoteNodeId : Remote nodeId * - * unsigned int msqId : Message queue number * - * unsigned int maxMsgCount : The maximum count of messages in queue * - * unsigned int maxMsgSize, : The maximum size of each messages in queue * - * unsigned int timeout : Time to wait for successful connection * - * unsigned int flags : Flags. * - * * - * Flags * - * * - * None * - * * - * Specific error codes for this function: * - * * - * None. Normal SISIC error codes. * - * * - *********************************************************************************/ -#define SCILConnectMsgQueue _SCIL_EXPANDE_FUNCTION_NAME(SCILConnectMsgQueue) -DLL sci_error_t SCILConnectMsgQueue(sci_msq_queue_t *msq, - unsigned int localAdapterNo, - unsigned int remoteNodeId, - unsigned int rmsgId, - unsigned int maxMsgCount, - unsigned int maxMsgSize, - unsigned int timeout, - unsigned int flags); - - - - -/********************************************************************************* - * * - * S C I L D i s c o n n e c t M s g Q u e u e * - * * - * * - * Disconnects from a remote message queue. * - * * - * Parameters: * - * * - * sci_msq_queue_t *msq : Message queue identifier * - * * - * Flags * - * * - * None * - * * - * Specific error codes for this function: * - * * - * None * - * * - *********************************************************************************/ -#define SCILDisconnectMsgQueue _SCIL_EXPANDE_FUNCTION_NAME(SCILDisconnectMsgQueue) -DLL sci_error_t SCILDisconnectMsgQueue(sci_msq_queue_t *msq, - unsigned int flags); - - - -#if defined(CPLUSPLUS) || defined(__cplusplus) -} -#endif - - - - - - - - - - diff --git a/ndb/src/external/WIN32.x86/sci/include/sisci_api.h b/ndb/src/external/WIN32.x86/sci/include/sisci_api.h deleted file mode 100644 index 9f4a1ddffb3..00000000000 --- a/ndb/src/external/WIN32.x86/sci/include/sisci_api.h +++ /dev/null @@ -1,2217 +0,0 @@ -/* $Id: sisci_api.h,v 1.1 2002/12/13 12:17:23 hin Exp $ */ -/******************************************************************************* - * * - * Copyright (C) 1993 - 2001 * - * Dolphin Interconnect Solutions AS * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License as published by * - * the Free Software Foundation; either version 2.1 of the License, * - * or (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * * - * * - *******************************************************************************/ - -#ifndef _SISCI_API_H -#define _SISCI_API_H - -#include "sisci_types.h" -#include "sisci_error.h" - - -#ifdef WIN32 -#ifdef API_DLL -#define DLL __declspec(dllexport) -#elif CLIENT_DLL -#define DLL __declspec(dllimport) -#endif -#endif /* WIN32 */ - - -#ifndef DLL -#define DLL -#endif - -#if defined(_REENTRANT) -#define _SISCI_EXPANDE_FUNCTION_NAME(name) _SISCI_PUBLIC_FUNC_MT_ ## name -#define _SISCI_EXPANDE_VARIABLE_NAME(name) _SISCI_PUBLIC_VAR_MT_ ## name -#else -#define _SISCI_EXPANDE_FUNCTION_NAME(name) _SISCI_PUBLIC_FUNC_ST_ ## name -#define _SISCI_EXPANDE_VARIABLE_NAME(name) _SISCI_PUBLIC_VAR_ST_ ## name -#endif -#define _SISCI_EXPANDE_CONSTANT_NAME(name) _SISCI_PUBLIC_CONST_ ## name - -#if defined(CPLUSPLUS) || defined(__cplusplus) -extern "C" { -#endif - - -/*********************************************************************************/ -/* FLAG VALUES */ -/*********************************************************************************/ - -#define SCI_FLAG_FIXED_INTNO _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_FIXED_INTNO) -extern const unsigned int SCI_FLAG_FIXED_INTNO; - -#define SCI_FLAG_SHARED_INT _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_SHARED_INT) -extern const unsigned int SCI_FLAG_SHARED_INT; - -#define SCI_FLAG_COUNTING_INT _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_COUNTING_INT) -extern const unsigned int SCI_FLAG_COUNTING_INT; - -#define SCI_FLAG_FIXED_MAP_ADDR _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_FIXED_MAP_ADDR) -extern const unsigned int SCI_FLAG_FIXED_MAP_ADDR; - -#define SCI_FLAG_READONLY_MAP _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_READONLY_MAP) -extern const unsigned int SCI_FLAG_READONLY_MAP; - -#define SCI_FLAG_USE_CALLBACK _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_USE_CALLBACK) -extern const unsigned int SCI_FLAG_USE_CALLBACK; - -#define SCI_FLAG_BLOCK_READ _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_BLOCK_READ) -extern const unsigned int SCI_FLAG_BLOCK_READ; - -#define SCI_FLAG_THREAD_SAFE _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_THREAD_SAFE) -extern const unsigned int SCI_FLAG_THREAD_SAFE; - -#define SCI_FLAG_ASYNCHRONOUS_CONNECT _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_ASYNCHRONOUS_CONNECT) -extern const unsigned int SCI_FLAG_ASYNCHRONOUS_CONNECT; - -#define SCI_FLAG_EMPTY _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_EMPTY) -extern const unsigned int SCI_FLAG_EMPTY; - -#define SCI_FLAG_PRIVATE _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_PRIVATE) -extern const unsigned int SCI_FLAG_PRIVATE; - -#define SCI_FLAG_FORCE_DISCONNECT _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_FORCE_DISCONNECT) -extern const unsigned int SCI_FLAG_FORCE_DISCONNECT; - -#define SCI_FLAG_NOTIFY _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_NOTIFY) -extern const unsigned int SCI_FLAG_NOTIFY; - -#define SCI_FLAG_DMA_READ _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_DMA_READ) -extern const unsigned int SCI_FLAG_DMA_READ; - -#define SCI_FLAG_DMA_POST _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_DMA_POST) -extern const unsigned int SCI_FLAG_DMA_POST; - -#define SCI_FLAG_DMA_WAIT _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_DMA_WAIT) -extern const unsigned int SCI_FLAG_DMA_WAIT; - -#define SCI_FLAG_DMA_RESET _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_DMA_RESET) -extern const unsigned int SCI_FLAG_DMA_RESET; - -#define SCI_FLAG_NO_FLUSH _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_NO_FLUSH) -extern const unsigned int SCI_FLAG_NO_FLUSH; - -#define SCI_FLAG_NO_STORE_BARRIER _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_NO_STORE_BARRIER) -extern const unsigned int SCI_FLAG_NO_STORE_BARRIER; - -#define SCI_FLAG_FAST_BARRIER _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_FAST_BARRIER) -extern const unsigned int SCI_FLAG_FAST_BARRIER; - -#define SCI_FLAG_ERROR_CHECK _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_ERROR_CHECK) -extern const unsigned int SCI_FLAG_ERROR_CHECK; - -#define SCI_FLAG_FLUSH_CPU_BUFFERS_ONLY _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_FLUSH_CPU_BUFFERS_ONLY) -extern const unsigned int SCI_FLAG_FLUSH_CPU_BUFFERS_ONLY; - -/* the FLUSH_CPU_BUFFERS_ONLY flag is for backwards compabillity only and should never be used */ -#define FLUSH_CPU_BUFFERS_ONLY _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_FLUSH_CPU_BUFFERS_ONLY) - -#define SCI_FLAG_LOCK_OPERATION _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_LOCK_OPERATION) -extern const unsigned int SCI_FLAG_LOCK_OPERATION; - -#define SCI_FLAG_READ_PREFETCH_AGGR_HOLD_MAP _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_READ_PREFETCH_AGGR_HOLD_MAP) -extern const unsigned int SCI_FLAG_READ_PREFETCH_AGGR_HOLD_MAP; - -#define SCI_FLAG_READ_PREFETCH_NO_HOLD_MAP _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_READ_PREFETCH_NO_HOLD_MAP) -extern const unsigned int SCI_FLAG_READ_PREFETCH_NO_HOLD_MAP; - -#define SCI_FLAG_IO_MAP_IOSPACE _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_IO_MAP_IOSPACE) -extern const unsigned int SCI_FLAG_IO_MAP_IOSPACE; - -#define SCI_FLAG_DMOVE_MAP _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_DMOVE_MAP) -extern const unsigned int SCI_FLAG_DMOVE_MAP; - -#define SCI_FLAG_WRITES_DISABLE_GATHER_MAP _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_WRITES_DISABLE_GATHER_MAP) -extern const unsigned int SCI_FLAG_WRITES_DISABLE_GATHER_MAP; - -#define SCI_FLAG_DISABLE_128_BYTES_PACKETS _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_DISABLE_128_BYTES_PACKETS) -extern const unsigned int SCI_FLAG_DISABLE_128_BYTES_PACKETS; - -#define SCI_FLAG_SHARED_MAP _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_SHARED_MAP) -extern const unsigned int SCI_FLAG_SHARED_MAP; - -#define SCI_FLAG_DMA_SOURCE_ONLY _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_DMA_SOURCE_ONLY) -extern const unsigned int SCI_FLAG_DMA_SOURCE_ONLY; - -#define SCI_FLAG_CONDITIONAL_INTERRUPT _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_CONDITIONAL_INTERRUPT) -extern const unsigned int SCI_FLAG_CONDITIONAL_INTERRUPT; - -#define SCI_FLAG_CONDITIONAL_INTERRUPT_MAP _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_CONDITIONAL_INTERRUPT_MAP) -extern const unsigned int SCI_FLAG_CONDITIONAL_INTERRUPT_MAP; - -#define SCI_FLAG_UNCONDITIONAL_DATA_INTERRUPT_MAP _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_UNCONDITIONAL_DATA_INTERRUPT_MAP) -extern const unsigned int SCI_FLAG_UNCONDITIONAL_DATA_INTERRUPT_MAP; - -#define SCI_FLAG_NO_MEMORY_LOOPBACK_MAP _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_NO_MEMORY_LOOPBACK_MAP) -extern const unsigned int SCI_FLAG_NO_MEMORY_LOOPBACK_MAP; - -#if defined(OS_IS_LYNXOS) || defined(OS_IS_VXWORKS) -#define SCI_FLAG_WRITE_BACK_CACHE_MAP _SISCI_EXPANDE_CONSTANT_NAME(WRITE_BACK_CACHE_MAP) -extern const unsigned int SCI_FLAG_WRITE_BACK_CACHE_MAP; -#endif - -#define SCI_FLAG_DMA_PHDMA _SISCI_EXPANDE_CONSTANT_NAME(SCI_FLAG_DMA_PHDMA) -extern const unsigned int SCI_FLAG_DMA_PHDMA; - -/*********************************************************************************/ -/* GENERAL VALUES */ -/*********************************************************************************/ -#define SCI_LOCAL_HOST _SISCI_EXPANDE_CONSTANT_NAME(SCI_LOCAL_HOST) -extern const unsigned int SCI_LOCAL_HOST; - -#define SCI_INFINITE_TIMEOUT _SISCI_EXPANDE_CONSTANT_NAME(SCI_INFINITE_TIMEOUT) -extern const unsigned int SCI_INFINITE_TIMEOUT; - -/*********************************************************************************/ -/* GENERAL ERROR CODES */ -/* */ -/* SCI_ERR_ILLEGAL_FLAG - Illegal flag value. */ -/* SCI_ERR_FLAG_NOT_IMPLEMENTED - Flag legal but flag feature not implemented. */ -/* SCI_ERR_NOT_IMPLEMENTED - Function not implemented. */ -/* SCI_ERR_SYSTEM - A system error. Check errno. */ -/* SCI_ERR_NOSPC - Unable to allocate OS resources. */ -/* SCI_ERR_API_NOSPC - Unable to allocate API resources. */ -/* SCI_ERR_HW_NOSPC - Unable to allocate HW resources (Hardware) */ -/* */ -/*********************************************************************************/ - - -/*********************************************************************************/ -/* GENERAL "ADAPTER" ERROR CODES */ -/* */ -/* SCI_ERR_NO_SUCH_ADAPTERNO - Adapter number is legal but does not exist. */ -/* SCI_ERR_ILLEGAL_ADAPTERNO - Illegal local adapter number (i.e. outside */ -/* legal range). */ -/* */ -/*********************************************************************************/ - - -/*********************************************************************************/ -/* GENERAL "NODEID" ERROR CODES */ -/* */ -/* SCI_ERR_NO_SUCH_NODEID - The remote adapter identified by nodeId does */ -/* not respond, but the intermediate link(s) */ -/* seem(s) to be operational. */ -/* SCI_ERR_ILLEGAL_NODEID - Illegal NodeId. */ -/* */ -/*********************************************************************************/ - - - -/********************************************************************************* - * * - * S C I I N I T I A L I Z E * - * * - * This function initializes the SISCI library. * - * The function must be called before SCIOpen(). * - * * - * Flags: * - * None * - * * - * Specific error codes for this function: * - * * - * None * - * * - *********************************************************************************/ -#define SCIInitialize _SISCI_EXPANDE_FUNCTION_NAME(SCIInitialize) -DLL void SCIInitialize(unsigned int flags, - sci_error_t *error); -#if 0 -unsigned int __Internal_SISCI_version_var; -#endif - -/********************************************************************************* - * * - * S C I T E R M I N A T E * - * * - * This function terminates the SISCI library. * - * The function must be called after SCIClose(). * - * * - * * - *********************************************************************************/ -#define SCITerminate _SISCI_EXPANDE_FUNCTION_NAME(SCITerminate) -DLL void SCITerminate(void); - -/********************************************************************************* - * * - * S C I O P E N * - * * - * * - * Opens a SCI virtual device. * - * Caller must supply a pointer to a variable of type sci_desc_t to be * - * initialized. * - * * - * Flags * - * SCI_FLAG_THREAD_SAFE - Operations on resources associated with this * - * descriptor will be performed in a multithread-safe * - * manner. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_INCONSISTENT_VERSIONS - Inconsistency between the SISCI library * - * and the SISCI driver versions. * - * * - * * - *********************************************************************************/ -#define SCIOpen _SISCI_EXPANDE_FUNCTION_NAME(SCIOpen) -DLL void SCIOpen(sci_desc_t *sd, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I C L O S E * - * * - * This function closes an open SCI virtual device. * - * * - * Flags: * - * None * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_BUSY - All resources are not deallocated. * - * * - *********************************************************************************/ -#define SCIClose _SISCI_EXPANDE_FUNCTION_NAME(SCIClose) -DLL void SCIClose(sci_desc_t sd, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I C O N N E C T S E G M E N T * - * * - * Connects to a remote shared memory segment located at with the * - * identifier . * - * The user may then call SCIMapRemoteSegment() to map shared memory * - * into user space. * - * * - * Flags * - * SCI_FLAG_USE_CALLBACK * - * SCI_FLAG_ASYNCHRONOUS_CONNECT * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_NO_SUCH_SEGMENT - Could not find the remote segment with the * - * given segmentId. * - * SCI_ERR_CONNECTION_REFUSED - Connection attempt refused by remote node. * - * SCI_ERR_TIMEOUT - The function timed out after specified * - * timeout value. * - * SCI_ERR_NO_LINK_ACCESS - It was not possible to communicate via the * - * local adapter. * - * SCI_ERR_NO_REMOTE_LINK_ACCESS - It was not possible to communicate via a * - * remote switch port. * - * * - *********************************************************************************/ -#define SCIConnectSegment _SISCI_EXPANDE_FUNCTION_NAME(SCIConnectSegment) -DLL void SCIConnectSegment(sci_desc_t sd, - sci_remote_segment_t *segment, - unsigned int nodeId, - unsigned int segmentId, - unsigned int localAdapterNo, - sci_cb_remote_segment_t callback, - void *callbackArg, - unsigned int timeout, - unsigned int flags, - sci_error_t *error); - - -/********************************************************************************* - * * - * S C I D I S C O N N E C T S E G M E N T * - * * - * Disconnects from the give mapped shared memory segment * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_BUSY - The segment is currently mapped or in use. * - * * - *********************************************************************************/ -#define SCIDisconnectSegment _SISCI_EXPANDE_FUNCTION_NAME(SCIDisconnectSegment) -DLL void SCIDisconnectSegment(sci_remote_segment_t segment, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I G E T R E M O T E S E G M E N T S I Z E * - * * - *********************************************************************************/ -#define SCIGetRemoteSegmentSize _SISCI_EXPANDE_FUNCTION_NAME(SCIGetRemoteSegmentSize) -DLL unsigned int SCIGetRemoteSegmentSize(sci_remote_segment_t segment); - - - -/********************************************************************************* - * * - * S C I W A I T F O R R E M O T E S E G M E N T E V E N T * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_TIMEOUT - The function timed out after specified * - * timeout value. * - * SCI_ERR_ILLEGAL_OPERATION - Illegal operation. * - * SCI_ERR_CANCELLED - The wait operation has been cancelled du * - * to a SCIDisconnectSegment() on the same * - * handle. The handle is invalid when this * - * error is returned. * - * * - *********************************************************************************/ -#define SCIWaitForRemoteSegmentEvent _SISCI_EXPANDE_FUNCTION_NAME(SCIWaitForRemoteSegmentEvent) -DLL sci_segment_cb_reason_t SCIWaitForRemoteSegmentEvent( - sci_remote_segment_t segment, - sci_error_t *status, - unsigned int timeout, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I M A P R E M O T E S E G M E N T * - * * - * This function is used to include a shared memory segment in the virtual * - * address space of the application. * - * * - * Flags: * - * * - * SCI_FLAG_SHARED_MAP - The low level physical map may be shared by * - * other applications. * - * * - * SCI_FLAG_FIXED_MAP_ADDR - Map at the suggested virtual address * - * SCI_FLAG_READONLY_MAP - The segment is mapped in read-only mode * - * SCI_FLAG_LOCK_OPERATION - Enable Lock operations (fetch and add) * - * SCI_FLAG_READ_PREFETCH_AGGR_HOLD_MAP * - * - Enable aggressive prefetch with speculative * - * hold. * - * * - * SCI_FLAG_READ_PREFETCH_NO_HOLD_MAP * - * - The PSB66 will prefetch 64 bytes. As soon * - * as the PCI read retry has been accepted, * - * the stream will change state to FREE, even * - * if less than 64 bytes were actually read. * - * * - * SCI_FLAG_IO_MAP_IOSPACE - Enable No Prefetch, no speculative hold. * - * * - * SCI_FLAG_DMOVE_MAP - Enable DMOVE packet type. The stream will be * - * set into FREE state immediately. * - * * - * SCI_FLAG_WRITES_DISABLE_GATHER_MAP * - * - Disable use of gather. * - * * - * SCI_FLAG_DISABLE_128_BYTES_PACKETS * - * - Disable use of 128-Byte packets * - * * - * SCI_FLAG_CONDITIONAL_INTERRUPT_MAP * - * - Write operations through this map will cause * - * an atomic "fetch-and-add-one" operation on * - * remote memory, but in addition an interrupt * - * will be generated if the target memory * - * location contained a "null value" before the * - * add operation was carried out. * - * The conditional interrupt flag must also be * - * specified in the SCIRegisterInterruptFlag() * - * function. * - * * - * SCI_FLAG_UNCONDITIONAL_INTERRUPT_MAP * - * - Write operations through this map will cause * - * an interrupt for the remote adapter * - * "in addition to" updating the corresponding * - * remote memory location with the data being * - * written. * - * The unconditional interrupt flag must also * - * be specified in the * - * SCIRegisterInterruptFlag() function. * - * * - * SCI_FLAG_WRITE_BACK_CACHE_MAP * - * - Enable cacheing of the mapped region. * - * Writes through this map will be written to a * - * write back cache, hence no remote SCI updates* - * until the cache line is flushed. The * - * application is responsible for the cache * - * flush operation. * - * The SCImemCopy() function will handle this * - * correctly by doing cache flushes internally. * - * This feature is architechture dependent and * - * not be available on all plattforms. * - * * - * SCI_FLAG_NO_MEMORY_LOOPBACK_MAP * - * - Forces a map to a remote segment located * - * in the local machine to be mapped using * - * SCI loopback. This is useful i.e. if you * - * want to use a regular map access to be * - * serialized with lock operations. * - * The default behaviour is to access a remte * - * segment located in the local machine as a * - * local MMU operation. * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_OUT_OF_RANGE - The sum of the offset and size is * - * larger than the segment size. * - * SCI_ERR_SIZE_ALIGNMENT - Size is not correctly aligned as * - * required by the implementation. * - * SCI_ERR_OFFSET_ALIGNMENT - Offset is not correctly aligned as * - * required by the implementation. * - * * - *********************************************************************************/ -#define SCIMapRemoteSegment _SISCI_EXPANDE_FUNCTION_NAME(SCIMapRemoteSegment) -DLL volatile void *SCIMapRemoteSegment( - sci_remote_segment_t segment, - sci_map_t *map, - unsigned int offset, - unsigned int size, - void *addr, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I M A P L O C A L S E G M E N T * - * * - * Flags * - * * - * SCI_FLAG_FIXED_MAP_ADDR * - * SCI_FLAG_READONLY_MAP * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_OUT_OF_RANGE - The sum of the offset and size is * - * larger than the segment size. * - * SCI_ERR_SIZE_ALIGNMENT - Size is not correctly aligned as * - * required by the implementation. * - * SCI_ERR_OFFSET_ALIGNMENT - Offset is not correctly aligned as * - * required by the implementation. * - * * - *********************************************************************************/ -#define SCIMapLocalSegment _SISCI_EXPANDE_FUNCTION_NAME(SCIMapLocalSegment) -DLL void *SCIMapLocalSegment(sci_local_segment_t segment, - sci_map_t *map, - unsigned int offset, - unsigned int size, - void *addr, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I U N M A P S E G M E N T * - * * - * This function unmaps pages of shared memory from the callers virtual * - * address space. * - * * - * Flags * - * None. * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_BUSY - The map is currently in use. * - * * - *********************************************************************************/ -#define SCIUnmapSegment _SISCI_EXPANDE_FUNCTION_NAME(SCIUnmapSegment) -DLL void SCIUnmapSegment(sci_map_t map, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I C R E A T E S E G M E N T * - * * - * Make the specified segment available for connections via the specified * - * adapter. If successful, the segment can be accessed from remote nodes * - * via the specified adapter. * - * * - * Flags: * - * * - * SCI_FLAG_USE_CALLBACK - The callback function will be invoked for events * - * on this segment. * - * SCI_FLAG_EMPTY - No memory will be allocated for the segment. * - * SCI_FLAG_PRIVATE - The segment will be private meaning it will never * - * be any connections to it. * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_SEGMENTID_USED - The segment with this segmentId is already used * - * SCI_ERR_SIZE_ALIGNMENT - Size is not correctly aligned as required * - * by the implementation. * - * * - *********************************************************************************/ -#define SCICreateSegment _SISCI_EXPANDE_FUNCTION_NAME(SCICreateSegment) -DLL void SCICreateSegment(sci_desc_t sd, - sci_local_segment_t *segment, - unsigned int segmentId, - unsigned int size, - sci_cb_local_segment_t callback, - void *callbackArg, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I W A I T F O R L O C A L S E G M E N T E V E N T * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_TIMEOUT - The function timed out after specified timeout value. * - * SCI_ERR_CANCELLED - The wait operation has been cancelled du to a * - * SCIRemoveSegment() on the same handle. * - * The handle is invalid when this error is returned. * - * * - *********************************************************************************/ -#define SCIWaitForLocalSegmentEvent _SISCI_EXPANDE_FUNCTION_NAME(SCIWaitForLocalSegmentEvent) -DLL sci_segment_cb_reason_t SCIWaitForLocalSegmentEvent( - sci_local_segment_t segment, - unsigned int *sourcenodeId, - unsigned int *localAdapterNo, - unsigned int timeout, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I P R E P A R E S E G M E N T * - * * - * Flags * - * * - * SCI_FLAG_DMA_SOURCE_ONLY - The segment will be used as a source segment * - * for DMA operations. On some system types this * - * will enable the SISCI driver to use performance * - * improving features. * - * * - * Specific error codes for this function: * - * * - * * - *********************************************************************************/ -#define SCIPrepareSegment _SISCI_EXPANDE_FUNCTION_NAME(SCIPrepareSegment) -DLL void SCIPrepareSegment(sci_local_segment_t segment, - unsigned int localAdapterNo, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I R E M O V E S E G M E N T * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_BUSY - Unable to remove the segment. The segment is currently * - * in use. * - * * - *********************************************************************************/ -#define SCIRemoveSegment _SISCI_EXPANDE_FUNCTION_NAME(SCIRemoveSegment) -DLL void SCIRemoveSegment(sci_local_segment_t segment, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I S E T S E G M E N T A V A I L A B L E * - * * - * Flags * - * None. * - * * - * * - * SCI_ERR_SEGMENT_NOT_PREPARED - The segment has not been prepared for access * - * from this adapter. * - * SCI_ERR_ILLEGAL_OPERATION - The segment is created with the * - * SCI_FLAG_PRIVATE flag specified and * - * therefore has no segmentId. * - * * - *********************************************************************************/ -#define SCISetSegmentAvailable _SISCI_EXPANDE_FUNCTION_NAME(SCISetSegmentAvailable) -DLL void SCISetSegmentAvailable(sci_local_segment_t segment, - unsigned int localAdapterNo, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I S E T S E G M E N T U N A V A I L A B L E * - * * - * Flags * - * * - * SCI_FLAG_FORCE_DISCONNECT * - * SCI_FLAG_NOTIFY * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_ILLEGAL_OPERATION - Illegal operation. * - * * - *********************************************************************************/ -#define SCISetSegmentUnavailable _SISCI_EXPANDE_FUNCTION_NAME(SCISetSegmentUnavailable) -DLL void SCISetSegmentUnavailable(sci_local_segment_t segment, - unsigned int localAdapterNo, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I C R E A T E M A P S E Q U E N C E * - * * - * Flags: * - * * - * SCI_FLAG_FAST_BARRIER * - * * - * * - * Specific error codes for this function: * - * * - *********************************************************************************/ -#define SCICreateMapSequence _SISCI_EXPANDE_FUNCTION_NAME(SCICreateMapSequence) -DLL void SCICreateMapSequence(sci_map_t map, - sci_sequence_t *sequence, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I R E M O V E S E Q U E N C E * - * * - * Flags: * - * None * - * * - * Specific error codes for this function: * - * * - *********************************************************************************/ -#define SCIRemoveSequence _SISCI_EXPANDE_FUNCTION_NAME(SCIRemoveSequence) -DLL void SCIRemoveSequence(sci_sequence_t sequence, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I S T A R T S E Q U E N C E * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * * - *********************************************************************************/ -#define SCIStartSequence _SISCI_EXPANDE_FUNCTION_NAME(SCIStartSequence) -DLL sci_sequence_status_t SCIStartSequence(sci_sequence_t sequence, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I C H E C K S E Q U E N CE * - * * - * Flags * - * * - * SCI_FLAG_NO_FLUSH * - * SCI_FLAG_NO_STORE_BARRIER * - * * - * * - * Specific error codes for this function: * - * * - *********************************************************************************/ -#define SCICheckSequence _SISCI_EXPANDE_FUNCTION_NAME(SCICheckSequence) -DLL sci_sequence_status_t SCICheckSequence(sci_sequence_t sequence, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I S T O R E B A R R I E R * - * * - * Flags * - * None. * - * * - * * - * * - *********************************************************************************/ -#define SCIStoreBarrier _SISCI_EXPANDE_FUNCTION_NAME(SCIStoreBarrier) -DLL void SCIStoreBarrier(sci_sequence_t sequence, - unsigned int flags); - - - - -/********************************************************************************* - * * - * S C I F L U S H R E A D B U F F E R S * - * * - *********************************************************************************/ -#define SCIFlushReadBuffers _SISCI_EXPANDE_FUNCTION_NAME(SCIFlushReadBuffers) -DLL void SCIFlushReadBuffers(sci_sequence_t sequence); - - - - -/********************************************************************************* - * * - * S C I P R O B E N O D E * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_NO_LINK_ACCESS - It was not possible to communicate via the * - * local adapter. * - * SCI_ERR_NO_REMOTE_LINK_ACCESS - It was not possible to communicate via a * - * remote switch port. * - * * - *********************************************************************************/ -#define SCIProbeNode _SISCI_EXPANDE_FUNCTION_NAME(SCIProbeNode) -DLL int SCIProbeNode(sci_desc_t sd, - unsigned int localAdapterNo, - unsigned int nodeId, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I G E T C S R R E G I S T E R * - * * - * SISCI Priveleged function * - * * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_NO_LINK_ACCESS - It was not possible to communicate via the * - * local adapter. * - * SCI_ERR_NO_REMOTE_LINK_ACCESS - It was not possible to communicate via a * - * remote switch port. * - * * - *********************************************************************************/ -#define SCIGetCSRRegister _SISCI_EXPANDE_FUNCTION_NAME(SCIGetCSRRegister) -DLL unsigned int SCIGetCSRRegister(sci_desc_t sd, - unsigned int localAdapterNo, - unsigned int SCINodeId, - unsigned int CSROffset, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I S E T C S R R E G I S T E R * - * * - * SISCI Priveleged function * - * * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_NO_LINK_ACCESS - It was not possible to communicate via the * - * local adapter. * - * SCI_ERR_NO_REMOTE_LINK_ACCESS - It was not possible to communicate via a * - * remote switch port. * - * * - *********************************************************************************/ -#define SCISetCSRRegister _SISCI_EXPANDE_FUNCTION_NAME(SCISetCSRRegister) -DLL void SCISetCSRRegister(sci_desc_t sd, - unsigned int localAdapterNo, - unsigned int SCINodeId, - unsigned int CSROffset, - unsigned int CSRValue, - unsigned int flags, - sci_error_t *error); - - -/********************************************************************************* - * * - * S C I G E T L O C A L C S R * - * * - * SISCI Priveleged function * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * * - *********************************************************************************/ -#define SCIGetLocalCSR _SISCI_EXPANDE_FUNCTION_NAME(SCIGetLocalCSR) -DLL unsigned int SCIGetLocalCSR(sci_desc_t sd, - unsigned int localAdapterNo, - unsigned int CSROffset, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I S E T L O C A L C S R * - * * - * SISCI Priveleged function - * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * * - *********************************************************************************/ -#define SCISetLocalCSR _SISCI_EXPANDE_FUNCTION_NAME(SCISetLocalCSR) -DLL void SCISetLocalCSR(sci_desc_t sd, - unsigned int localAdapterNo, - unsigned int CSROffset, - unsigned int CSRValue, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I A T T A C H P H Y S I C A L M E M O R Y * - * * - * SISCI Priveleged function * - * * - * Description: * - * * - * This function enables usage of physical devices and memory regions where the * - * Physical PCI bus address ( and mapped CPU address ) are already known. * - * The function will register the physical memory as a SISCI segment which can * - * be connected and mapped as a regular SISCI segment. * - * * - * Requirements: * - * * - * SCICreateSegment() with flag SCI_FLAG_EMPTY must have been called in advance * - * * - * Parameter description: * - * sci_ioaddr_t ioaddress : This is the address on the PCI bus that a PCI bus * - * master has to use to write to the specified memory * - * void * address : This is the (mapped) virtual address that the * - * application has to use to access the device. * - * This means that the device has to be mapped in * - * advance bye the devices own driver. * - * If the device is not to be accessed by the local * - * CPU, the address pointer shold be set to NULL * - * Flags * - * * - * None * - * * - * * - * Specific error codes for this function: * - * * - * * - *********************************************************************************/ -#define SCIAttachPhysicalMemory _SISCI_EXPANDE_FUNCTION_NAME(SCIAttachPhysicalMemory) -DLL void SCIAttachPhysicalMemory(sci_ioaddr_t ioaddress, - void *address, - unsigned int busNo, - unsigned int size, - sci_local_segment_t segment, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I Q U E R Y * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_ILLEGAL_QUERY - Unrecognized command. * - * * - *********************************************************************************/ -#define SCIQuery _SISCI_EXPANDE_FUNCTION_NAME(SCIQuery) -DLL void SCIQuery(unsigned int command, - void *data, - unsigned int flags, - sci_error_t *error); - - -/* MAJOR QUERY COMMANDS */ - -/* This command requires a pointer to a structure of type */ -/* "sci_query_string". The string will be filled in by the query. */ -#define SCI_Q_VENDORID _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_VENDORID) -extern const unsigned int SCI_Q_VENDORID; - - -/* Same as for SCI_VENDOR_ID */ -#define SCI_Q_API _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_API) -extern const unsigned int SCI_Q_API; - - -/* User passes a pointer to an allocated object of the */ -/* "sci_query_adapter" struct. */ -#define SCI_Q_ADAPTER _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER) -extern const unsigned int SCI_Q_ADAPTER; - - -/* User passes a pointer to an allocated object of the */ -/* "sci_query_system" struct. */ -#define SCI_Q_SYSTEM _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_SYSTEM) -extern const unsigned int SCI_Q_SYSTEM; - -#define SCI_Q_LOCAL_SEGMENT _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_LOCAL_SEGMENT) -extern const unsigned int SCI_Q_LOCAL_SEGMENT; - -#define SCI_Q_REMOTE_SEGMENT _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_REMOTE_SEGMENT) -extern const unsigned int SCI_Q_REMOTE_SEGMENT; - -#define SCI_Q_MAP _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_MAP) -extern const unsigned int SCI_Q_MAP; - -typedef char* sci_semaphoreId_t; - -#ifdef WIN32 -struct _semaphoreid { - char *semaphoreName; -}; -#endif /*WIN32*/ - -typedef struct { - char *str; /* Pointer to a string of minimum "length" characters */ - unsigned int length; -} sci_query_string_t; - - -typedef struct { - unsigned int localAdapterNo; /* The adapter no. that the query concern. */ - unsigned int portNo; /* The SCI Link port number that the query concern. */ - unsigned int subcommand; /* A subcommand as specified below. */ - void *data; /* A pointer to an unsigned int that will return */ - /* the response to the query. */ -} sci_query_adapter_t; - - -typedef struct { - unsigned int subcommand; /* A subcommand as specified below. */ - void *data; /* A pointer to an unsigned int that will return */ - /* the response to the query. */ -} sci_query_system_t; - -typedef struct { - sci_local_segment_t segment; - unsigned int subcommand; - union { - sci_ioaddr_t ioaddr; - } data; -} sci_query_local_segment_t; - -typedef struct { - sci_remote_segment_t segment; - unsigned int subcommand; - union { - sci_ioaddr_t ioaddr; - } data; -} sci_query_remote_segment_t; - -typedef struct { - sci_map_t map; - unsigned int subcommand; - unsigned int data; -} sci_query_map_t; - -/* Minor query commands (sub-commands) for adapter specific information SCI_ADAPTER */ -#define SCI_Q_ADAPTER_DMA_SIZE_ALIGNMENT _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_DMA_SIZE_ALIGNMENT) -extern const unsigned int SCI_Q_ADAPTER_DMA_SIZE_ALIGNMENT; - -#define SCI_Q_ADAPTER_DMA_OFFSET_ALIGNMENT _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_DMA_OFFSET_ALIGNMENT) -extern const unsigned int SCI_Q_ADAPTER_DMA_OFFSET_ALIGNMENT; - -#define SCI_Q_ADAPTER_DMA_MTU _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_DMA_MTU) -extern const unsigned int SCI_Q_ADAPTER_DMA_MTU; - -#define SCI_Q_ADAPTER_SUGGESTED_MIN_DMA_SIZE _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_SUGGESTED_MIN_DMA_SIZE) -extern const unsigned int SCI_Q_ADAPTER_SUGGESTED_MIN_DMA_SIZE; - -#define SCI_Q_ADAPTER_SUGGESTED_MIN_BLOCK_SIZE _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_SUGGESTED_MIN_BLOCK_SIZE) -extern const unsigned int SCI_Q_ADAPTER_SUGGESTED_MIN_BLOCK_SIZE; - -#define SCI_Q_ADAPTER_NODEID _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_NODEID) -extern const unsigned int SCI_Q_ADAPTER_NODEID; - -#define SCI_Q_ADAPTER_SERIAL_NUMBER _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_SERIAL_NUMBER) -extern const unsigned int SCI_Q_ADAPTER_SERIAL_NUMBER; - -#define SCI_Q_ADAPTER_CARD_TYPE _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_CARD_TYPE) -extern const unsigned int SCI_Q_ADAPTER_CARD_TYPE; - -#define SCI_Q_ADAPTER_NUMBER_OF_STREAMS _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_NUMBER_OF_STREAMS) -extern const unsigned int SCI_Q_ADAPTER_NUMBER_OF_STREAMS; - -#define SCI_Q_ADAPTER_STREAM_BUFFER_SIZE _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_STREAM_BUFFER_SIZE) -extern const unsigned int SCI_Q_ADAPTER_STREAM_BUFFER_SIZE; - -#define SCI_Q_ADAPTER_CONFIGURED _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_CONFIGURED) -extern const unsigned int SCI_Q_ADAPTER_CONFIGURED; - -#define SCI_Q_ADAPTER_LINK_OPERATIONAL _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_LINK_OPERATIONAL) -extern const unsigned int SCI_Q_ADAPTER_LINK_OPERATIONAL; - -#define SCI_Q_ADAPTER_HW_LINK_STATUS_IS_OK _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_HW_LINK_STATUS_IS_OK) -extern const unsigned int SCI_Q_ADAPTER_HW_LINK_STATUS_IS_OK; - -#define SCI_Q_ADAPTER_NUMBER _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_NUMBER) -extern const unsigned int SCI_Q_ADAPTER_NUMBER; - -#define SCI_Q_ADAPTER_INSTANCE_NUMBER _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_INSTANCE_NUMBER) -extern const unsigned int SCI_Q_ADAPTER_INSTANCE_NUMBER; - -#define SCI_Q_ADAPTER_FIRMWARE_OK _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_FIRMWARE_OK) -extern const unsigned int SCI_Q_ADAPTER_FIRMWARE_OK; - -#define SCI_Q_ADAPTER_CONNECTED_TO_SWITCH _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_CONNECTED_TO_SWITCH) -extern const unsigned int SCI_Q_ADAPTER_CONNECTED_TO_SWITCH; - -#define SCI_Q_ADAPTER_LOCAL_SWITCH_TYPE _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_LOCAL_SWITCH_TYPE) -extern const unsigned int SCI_Q_ADAPTER_LOCAL_SWITCH_TYPE; - -#define SCI_Q_ADAPTER_LOCAL_SWITCH_PORT_NUMBER _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_LOCAL_SWITCH_PORT_NUMBER) -extern const unsigned int SCI_Q_ADAPTER_LOCAL_SWITCH_PORT_NUMBER; - -#define SCI_Q_ADAPTER_CONNECTED_TO_EXPECTED_SWITCH_PORT _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_CONNECTED_TO_EXPECTED_SWITCH_PORT) -extern const unsigned int SCI_Q_ADAPTER_CONNECTED_TO_EXPECTED_SWITCH_PORT; - -#define SCI_Q_ADAPTER_ATT_PAGE_SIZE _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_ATT_PAGE_SIZE) -extern const unsigned int SCI_Q_ADAPTER_ATT_PAGE_SIZE; - -#define SCI_Q_ADAPTER_ATT_NUMBER_OF_ENTRIES _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_ATT_NUMBER_OF_ENTRIES) -extern const unsigned int SCI_Q_ADAPTER_ATT_NUMBER_OF_ENTRIES; - -#define SCI_Q_ADAPTER_ATT_AVAILABLE_ENTRIES _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_ATT_AVAILABLE_ENTRIES) -extern const unsigned int SCI_Q_ADAPTER_ATT_AVAILABLE_ENTRIES; - -#define SCI_Q_ADAPTER_PHYS_MEM_NODEID _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_SCI_Q_ADAPTER_PHYS_MEM_NODEID) -extern const unsigned int SCI_Q_ADAPTER_PHYS_MEM_NODEID; - -#define SCI_Q_ADAPTER_PHYS_MBX_NODEID _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_SCI_Q_ADAPTER_PHYS_MBX_NODEID) -extern const unsigned int SCI_Q_ADAPTER_PHYS_MBX_NODEID; - -#define SCI_Q_ADAPTER_PHYS_LINK_PORT_NODEID _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_PHYS_LINK_PORT_NODEID) -extern const unsigned int SCI_Q_ADAPTER_PHYS_LINK_PORT_NODEID; - -#define SCI_Q_ADAPTER_SCI_LINK_FREQUENCY _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_SCI_LINK_FREQUENCY) -extern const unsigned int SCI_Q_ADAPTER_SCI_LINK_FREQUENCY; - -#define SCI_Q_ADAPTER_B_LINK_FREQUENCY _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_B_LINK_FREQUENCY) -extern const unsigned int SCI_Q_ADAPTER_B_LINK_FREQUENCY; - -#define SCI_Q_ADAPTER_IO_BUS_FREQUENCY _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_ADAPTER_IO_BUS_FREQUENCY) -extern const unsigned int SCI_Q_ADAPTER_IO_BUS_FREQUENCY; - -/* Minor query commands (sub-commands) for adapter specific information SCI_SYSTEM */ -#define SCI_Q_SYSTEM_HOSTBRIDGE _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_SYSTEM_HOSTBRIDGE) -extern const unsigned int SCI_Q_SYSTEM_HOSTBRIDGE; - -#define SCI_Q_SYSTEM_WRITE_POSTING_ENABLED _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_SYSTEM_WRITE_POSTING_ENABLED) -extern const unsigned int SCI_Q_SYSTEM_WRITE_POSTING_ENABLED; - -#define SCI_Q_SYSTEM_WRITE_COMBINING_ENABLED _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_SYSTEM_WRITE_COMBINING_ENABLED) -extern const unsigned int SCI_Q_SYSTEM_WRITE_COMBINING_ENABLED; - -#define SCI_Q_LOCAL_SEGMENT_IOADDR _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_LOCAL_SEGMENT_IOADDR) -extern const unsigned int SCI_Q_LOCAL_SEGMENT_IOADDR; - -#define SCI_Q_REMOTE_SEGMENT_IOADDR _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_REMOTE_SEGMENT_IOADDR) -extern const unsigned int SCI_Q_REMOTE_SEGMENT_IOADDR; - -#define SCI_Q_MAP_MAPPED_TO_LOCAL_TARGET _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_MAP_MAPPED_TO_LOCAL_TARGET) -extern const unsigned int SCI_Q_MAP_MAPPED_TO_LOCAL_TARGET; - -#define SCI_Q_MAP_QUERY_REMOTE_MAPPED_TO_LOCAL_TARGET _SISCI_EXPANDE_CONSTANT_NAME(SCI_Q_MAP_QUERY_REMOTE_MAPPED_TO_LOCAL_TARGET) -extern const unsigned int SCI_Q_MAP_QUERY_REMOTE_MAPPED_TO_LOCAL_TARGET; - -#define HOSTBRIDGE_NOT_AVAILABLE _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_NOT_AVAILABLE) -extern const unsigned int HOSTBRIDGE_NOT_AVAILABLE; - -#define HOSTBRIDGE_UNKNOWN _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_UNKNOWN) -extern const unsigned int HOSTBRIDGE_UNKNOWN; - -#define HOSTBRIDGE_440FX _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_440FX) -extern const unsigned int HOSTBRIDGE_440FX; - -#define HOSTBRIDGE_440LX _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_440LX) -extern const unsigned int HOSTBRIDGE_440LX; - -#define HOSTBRIDGE_440BX_A _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_440BX_A) -extern const unsigned int HOSTBRIDGE_440BX_A; - -#define HOSTBRIDGE_440BX_B _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_440BX_B) -extern const unsigned int HOSTBRIDGE_440BX_B; - -#define HOSTBRIDGE_440GX _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_440GX) -extern const unsigned int HOSTBRIDGE_440GX; - -#define HOSTBRIDGE_450KX _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_450KX) -extern const unsigned int HOSTBRIDGE_450KX; - -#define HOSTBRIDGE_430NX _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_430NX) -extern const unsigned int HOSTBRIDGE_430NX; - -#define HOSTBRIDGE_450NX _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_450NX) -extern const unsigned int HOSTBRIDGE_450NX; - -#define HOSTBRIDGE_450NX_MICO _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_450NX_MICO) -extern const unsigned int HOSTBRIDGE_450NX_MICO; - -#define HOSTBRIDGE_450NX_PXB _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_450NX_PXB) -extern const unsigned int HOSTBRIDGE_450NX_PXB; - -#define HOSTBRIDGE_I810 _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_I810) -extern const unsigned int HOSTBRIDGE_I810; - -#define HOSTBRIDGE_I810_DC100 _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_I810_DC100) -extern const unsigned int HOSTBRIDGE_I810_DC100; - -#define HOSTBRIDGE_I810E _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_I810E) -extern const unsigned int HOSTBRIDGE_I810E; - -#define HOSTBRIDGE_I815 _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_I815) -extern const unsigned int HOSTBRIDGE_I815; - -#define HOSTBRIDGE_I840 _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_I840) -extern const unsigned int HOSTBRIDGE_I840; - -#define HOSTBRIDGE_I850 _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_I850) -extern const unsigned int HOSTBRIDGE_I850; - -#define HOSTBRIDGE_I860 _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_I860) -extern const unsigned int HOSTBRIDGE_I860; - -#define HOSTBRIDGE_INTEL_E7500 _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_INTEL_E7500) -extern const unsigned int HOSTBRIDGE_INTEL_E7500; - -#define HOSTBRIDGE_VIA_KT133 _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_VIA_KT133) -extern const unsigned int HOSTBRIDGE_VIA_KT133; - -#define HOSTBRIDGE_VIA_KX133 _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_VIA_KX133) -extern const unsigned int HOSTBRIDGE_VIA_KX133; - -#define HOSTBRIDGE_VIA_APOLLO_PRO_133A _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_VIA_APOLLO_PRO_133A) -extern const unsigned int HOSTBRIDGE_VIA_APOLLO_PRO_133A; - -#define HOSTBRIDGE_VIA_APOLLO_PRO_266 _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_VIA_APOLLO_PRO_266) -extern const unsigned int HOSTBRIDGE_VIA_APOLLO_PRO_266; - -#define HOSTBRIDGE_AMD_760_MP _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_AMD_760_MP) -extern const unsigned int HOSTBRIDGE_AMD_760_MP; - -#define HOSTBRIDGE_AMD_HAMMER _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_AMD_HAMMER) -extern const unsigned int HOSTBRIDGE_AMD_HAMMER; - -#define HOSTBRIDGE_SERVERWORKS_HE _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_SERVERWORKS_HE) -extern const unsigned int HOSTBRIDGE_SERVERWORKS_HE; - -#define HOSTBRIDGE_SERVERWORKS_HE_B _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_SERVERWORKS_HE_B) -extern const unsigned int HOSTBRIDGE_SERVERWORKS_HE_B; - -#define HOSTBRIDGE_SERVERWORKS_LE _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_SERVERWORKS_LE) -extern const unsigned int HOSTBRIDGE_SERVERWORKS_LE; - -#define HOSTBRIDGE_SERVERWORKS_GC_HE _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_SERVERWORKS_GC_HE) -extern const unsigned int HOSTBRIDGE_SERVERWORKS_GC_HE; - -#define HOSTBRIDGE_SERVERWORKS_GC_LE _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_SERVERWORKS_GC_LE) -extern const unsigned int HOSTBRIDGE_SERVERWORKS_GC_LE; - -#define HOSTBRIDGE_SERVERWORKS_GC_WS _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_SERVERWORKS_GC_WS) -extern const unsigned int HOSTBRIDGE_SERVERWORKS_GC_WS; - -#define HOSTBRIDGE_SERVERWORKS_GC_SL _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_SERVERWORKS_GC_SL) -extern const unsigned int HOSTBRIDGE_SERVERWORKS_GC_SL; - - -#define HOSTBRIDGE_WRITE_POSTING_DISABLED _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_WRITE_POSTING_DISABLED) -extern const unsigned int HOSTBRIDGE_WRITE_POSTING_DISABLED; - -#define HOSTBRIDGE_WRITE_POSTING_ENABLED _SISCI_EXPANDE_CONSTANT_NAME(HOSTBRIDGE_WRITE_POSTING_ENABLED) -extern const unsigned int HOSTBRIDGE_WRITE_POSTING_ENABLED; - - - - -/********************************************************************************* - * * - * S C I C R E A T E D M A Q U E U E * - * * - * Flags * - * * - * SCI_FLAG_DMA_PHDMA : Create physical DMA queue. Please note that this is an * - * priveleged operation. * - * * - * * - * * - * Specific error codes for this function: * - * * - *********************************************************************************/ -#define SCICreateDMAQueue _SISCI_EXPANDE_FUNCTION_NAME(SCICreateDMAQueue) -DLL void SCICreateDMAQueue(sci_desc_t sd, - sci_dma_queue_t *dq, - unsigned int localAdapterNo, - unsigned int maxEntries, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I R E M O V E D M A Q U E U E * - * * - * Flags * - * None. * * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_ILLEGAL_OPERATION - Not allowed in this queue state. * - * * - *********************************************************************************/ -#define SCIRemoveDMAQueue _SISCI_EXPANDE_FUNCTION_NAME(SCIRemoveDMAQueue) -DLL void SCIRemoveDMAQueue(sci_dma_queue_t dq, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I E N Q U E U E D M A T R A N S F E R * - * * - * Flags: * - * * - * SCI_FLAG_DMA_READ - The DMA will be remote --> local * - * (default is local --> remote) * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_OUT_OF_RANGE - The sum of the offset and size is larger * - * than the segment size or larger than max * - * DMA size. * - * SCI_ERR_MAX_ENTRIES - The DMA queue is full * - * SCI_ERR_ILLEGAL_OPERATION - Illegal operation * - * SCI_ERR_SIZE_ALIGNMENT - Size is not correctly aligned as required * - * by the implementation. * - * SCI_ERR_OFFSET_ALIGNMENT - Offset is not correctly aligned as required * - * by the implementation. * - * SCI_ERR_SEGMENT_NOT_PREPARED - The local segment has not been prepared for * - * access from the adapter associated with the * - * queue. * - * SCI_ERR_SEGMENT_NOT_CONNECTED - The remote segment is not connected through * - * the adapter associated with the queue. * - *********************************************************************************/ -#define SCIEnqueueDMATransfer _SISCI_EXPANDE_FUNCTION_NAME(SCIEnqueueDMATransfer) -DLL sci_dma_queue_state_t SCIEnqueueDMATransfer(sci_dma_queue_t dq, - sci_local_segment_t localSegment, - sci_remote_segment_t remoteSegment, - unsigned int localOffset, - unsigned int remoteOffset, - unsigned int size, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I P O S T D M A Q U E U E * - * * - * Flags: * - * * - * SCI_FLAG_USE_CALLBACK - The end of the transfer will cause the callback * - * function to be invoked. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_ILLEGAL_OPERATION - Illegal operation * - * * - *********************************************************************************/ -#define SCIPostDMAQueue _SISCI_EXPANDE_FUNCTION_NAME(SCIPostDMAQueue) -DLL void SCIPostDMAQueue(sci_dma_queue_t dq, - sci_cb_dma_t callback, - void *callbackArg, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I A B O R T D M A Q U E U E * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_ILLEGAL_OPERATION - Illegal operation * - * * - *********************************************************************************/ -#define SCIAbortDMAQueue _SISCI_EXPANDE_FUNCTION_NAME(SCIAbortDMAQueue) -DLL void SCIAbortDMAQueue(sci_dma_queue_t dq, - unsigned int flags, - sci_error_t *error); - - -/********************************************************************************* - * * - * S C I R E S E T D M A Q U E U E * - * * - * Flags * - * None. * * - * * - * * - * Specific error codes for this function: * - * * - * * - *********************************************************************************/ -#define SCIResetDMAQueue _SISCI_EXPANDE_FUNCTION_NAME(SCIResetDMAQueue) -DLL void SCIResetDMAQueue(sci_dma_queue_t dq, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I D M A Q U E U E S T A T E * - * * - *********************************************************************************/ -#define SCIDMAQueueState _SISCI_EXPANDE_FUNCTION_NAME(SCIDMAQueueState) -DLL sci_dma_queue_state_t SCIDMAQueueState(sci_dma_queue_t dq); - - - -/********************************************************************************* - * * - * S C I W A I T F O R D M A Q U E U E * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_ILLEGAL_OPERATION - Illegal operation * - * SCI_ERR_TIMEOUT - The function timed out after specified * - * timeout value. * - * * - *********************************************************************************/ -#define SCIWaitForDMAQueue _SISCI_EXPANDE_FUNCTION_NAME(SCIWaitForDMAQueue) -DLL sci_dma_queue_state_t SCIWaitForDMAQueue(sci_dma_queue_t dq, - unsigned int timeout, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I P H D M A E N Q U E U E * - * * - * SISCI Priveleged function * - * * - * Flags * - * * - * SCI_FLAG_DMA_READ * - * * - * Specific error codes for this function: * - * * - *********************************************************************************/ -#define SCIphDmaEnqueue _SISCI_EXPANDE_FUNCTION_NAME(SCIphDmaEnqueue) -DLL void SCIphDmaEnqueue(sci_dma_queue_t dmaqueue, - unsigned int size, - sci_ioaddr_t localBusAddr, - unsigned int remote_nodeid, - unsigned int remote_highaddr, - unsigned int remote_lowaddr, - unsigned int flags, - sci_error_t *error); - -/********************************************************************************* - * * - * S C I P H D M A S T A R T * - * * - * Flags * - * * - * SCI_FLAG_DMA_WAIT * - * SCI_FLAG_USE_CALLBACK * - * SCI_FLAG_DMA_RESET * - * * - * Specific error codes for this function: * - * * - *********************************************************************************/ -#define SCIphDmaStart _SISCI_EXPANDE_FUNCTION_NAME(SCIphDmaStart) -DLL sci_dma_queue_state_t SCIphDmaStart(sci_dma_queue_t dmaqueue, - sci_cb_dma_t callback, - void *callbackArg, - unsigned int flags, - sci_error_t *error); - -#ifdef WIN32 -/********************************************************************************* - * * - * S C I C R E A T E N A M E D I N T E R R U P T * - * * - * Flags * - * * - * SCI_FLAG_USE_CALLBACK * - * SCI_FLAG_FIXED_INTNO * - * SCI_FLAG_SHARED_INT * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_INTNO_USED - This interrupt number is already used. * - * * - *********************************************************************************/ -#define SCICreateNamedInterrupt _SISCI_EXPANDE_FUNCTION_NAME(SCICreateNamedInterrupt) -DLL void SCICreateNamedInterrupt(sci_desc_t sd, - sci_local_interrupt_t *interrupt, - unsigned int localAdapterNo, - unsigned int *interruptNo, - sci_cb_interrupt_t callback, - void *callbackArg, - unsigned int flags, - sci_semaphoreId_t semId, - sci_error_t *error); -#endif /*WIN32*/ - -/********************************************************************************* - * * - * S C I C R E A T E I N T E R R U P T * - * * - * Flags * - * * - * SCI_FLAG_USE_CALLBACK * - * SCI_FLAG_FIXED_INTNO * - * SCI_FLAG_SHARED_INT * - * SCI_FLAG_COUNTING_INT: This flag will enable counting interrupts. This means * - * that the number of trigged interrupts is equal to the * - * number of received interrupts. * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_INTNO_USED - This interrupt number is already used. * - * * - *********************************************************************************/ -#define SCICreateInterrupt _SISCI_EXPANDE_FUNCTION_NAME(SCICreateInterrupt) -DLL void SCICreateInterrupt(sci_desc_t sd, - sci_local_interrupt_t *interrupt, - unsigned int localAdapterNo, - unsigned int *interruptNo, - sci_cb_interrupt_t callback, - void *callbackArg, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I R E M O V E I N T E R R U P T * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - *********************************************************************************/ -#define SCIRemoveInterrupt _SISCI_EXPANDE_FUNCTION_NAME(SCIRemoveInterrupt) -DLL void SCIRemoveInterrupt(sci_local_interrupt_t interrupt, - unsigned int flags, - sci_error_t *error); - - -/********************************************************************************* - * * - * S C I W A I T F O R I N T E R R U P T * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_TIMEOUT - The function timed out after specified timeout value. * - * SCI_ERR_CANCELLED - The wait was interrupted by a call to * - * SCIRemoveInterrupt. * - * The handle is invalid when this error code is returned.* - * * - *********************************************************************************/ -#define SCIWaitForInterrupt _SISCI_EXPANDE_FUNCTION_NAME(SCIWaitForInterrupt) -DLL void SCIWaitForInterrupt(sci_local_interrupt_t interrupt, - unsigned int timeout, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I C O N N E C T I N T E R R U P T * - * * - * Flags * - * * - * SCI_FLAG_COUNTING_INT: This flag will enable counting interrupts. This means * - * that the number of trigged interrupts is equal to the * - * number of received interrupts. * - * if SCI_FLAG_COUNTING_INT is not used, the interface * - * guarentees that there always will be an remote * - * interrupt generated after the first and after the last* - * trigger. If interupts is triggered faster than the * - * remote interrupt handler can handle, interrupts may be* - * lost. * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_NO_SUCH_INTNO - No such interrupt number. * - * SCI_ERR_CONNECTION_REFUSED - Connection attempt refused by remote node. * - * SCI_ERR_TIMEOUT - The function timed out after specified * - * timeout value. * - * * - *********************************************************************************/ -#define SCIConnectInterrupt _SISCI_EXPANDE_FUNCTION_NAME(SCIConnectInterrupt) -DLL void SCIConnectInterrupt(sci_desc_t sd, - sci_remote_interrupt_t *interrupt, - unsigned int nodeId, - unsigned int localAdapterNo, - unsigned int interruptNo, - unsigned int timeout, - unsigned int flags, - sci_error_t *error); - - -/********************************************************************************* - * * - * S C I D I S C O N N E C T I N T E R R U P T * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * * - *********************************************************************************/ -#define SCIDisconnectInterrupt _SISCI_EXPANDE_FUNCTION_NAME(SCIDisconnectInterrupt) -DLL void SCIDisconnectInterrupt(sci_remote_interrupt_t interrupt, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I T R I G G E R I N T E R R U P T * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * * - *********************************************************************************/ -#define SCITriggerInterrupt _SISCI_EXPANDE_FUNCTION_NAME(SCITriggerInterrupt) -DLL void SCITriggerInterrupt(sci_remote_interrupt_t interrupt, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I R E G I S T E R I N T E R R U P T F L A G * - * * - * * - * This function register an "interrupt flag" that is identified as an unique * - * location within a local segment. If successful, the resulting interrupt * - * handle will have been associated with the specified local segment. * - * * - * It is up to the (remote) client(s) to set up an "interrupt mapping" for the * - * corresponding segment offset using either the * - * * - * - SCI_FLAG_CONDITIONAL_INTERRUPT_MAP * - * * - * or the * - * * - * - SCI_FLAG_UNCONDITIONAL_DATA_INTERRUPT_MAP * - * * - * option to "SCIMapRemoteSegment()". - I.e. after having established a * - * connection to the corresponding segment. A trigger operation can then * - * be implemented using a store operation via the relevant "interrupt map". * - * * - * * - * * - * * - * * - * Flags: * - * * - * SCI_FLAG_CONDITIONAL_INTERRUPT - Triggering is to take place using * - * "conditional interrupts". * - * * - * * - * * - * Specific error codes for this function: * - * None. * - * * - *********************************************************************************/ -#define SCIRegisterInterruptFlag _SISCI_EXPANDE_FUNCTION_NAME(SCIRegisterInterruptFlag) -DLL void SCIRegisterInterruptFlag( - unsigned int localAdapterNo, - sci_local_interrupt_t *interrupt, - sci_local_segment_t segment, - unsigned int offset, - sci_cb_interrupt_t callback, - void *callbackArg, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I E N A B L E C O N D I T I O N A L I N T E R R U P T * - * * - * * - * This function make sure that another HW interrupt will take place the next * - * time the corresponding interrupt flag is triggered by a * - * "conditional interrupt" operation. * - * * - * Default semantics: * - * * - * When successful, the client can rely on that the first subsequent trigger * - * operation will cause a HW interrupt and subsequently cause the client * - * handler function to be invoked. * - * * - * If an interrupt was triggered in parallell with the enable operation, then * - * the operation will fail (SCI_ERR_COND_INT_RACE_PROBLEM), and the client can * - * not rely on another trigger operation will lead to handler invocation. * - * Hence, any state checking normally associated with handling the * - * corresponding interrupt should take place before attempting to enable * - * again. * - * * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_COND_INT_RACE_PROBLEM - The enable operation failed because an * - * incomming trigger operation happened * - * concurrently. * - * * - *********************************************************************************/ -#define SCIEnableConditionalInterrupt _SISCI_EXPANDE_FUNCTION_NAME(SCIEnableConditionalInterrupt) -DLL void SCIEnableConditionalInterrupt( - sci_local_interrupt_t interrupt, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I D I S A B L E C O N D I T I O N A L I N T E R R U P T * - * * - * * - * Prevent subsequent "conditional interrupt"trigger operations for * - * the specified interupt flag from causing HW interrupt and handler * - * invocations. * - * * - * * - * Default semantics: * - * * - * If successful, no subsequent HW interrupts will take place, but handler * - * invocations that have already been scheduled may still take place. * - * * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * * - *********************************************************************************/ -#define SCIDisableConditionalInterrupt _SISCI_EXPANDE_FUNCTION_NAME(SCIDisableConditionalInterrupt) -DLL void SCIDisableConditionalInterrupt( - sci_local_interrupt_t interrupt, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I G E T C O N D I T I O N A L I N T E R R U P T C O U N T E R * - * * - * * - * Returns a value that indicates the number of times this flag has * - * been trigged since the last time it was enabled or disabled. * - * Calling the SCIEnableConditionalInterrupt / SCIDisableConditionalInterrupt * - * functions will reset the counter value. * - * * - * Default semantics: * - * * - * If successful, the current trig count is returned in the * - * interruptTrigCounter parameter. * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_OVERFLOW - The number of trig operations have exceeded the range * - * that can be counted. * - *********************************************************************************/ -#define SCIGetConditionalInterruptTrigCounter _SISCI_EXPANDE_FUNCTION_NAME(SCIGetConditionalInterruptTrigCounter) -DLL void SCIGetConditionalInterruptTrigCounter( - sci_local_interrupt_t interrupt, - unsigned int *interruptTrigCounter, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I T R A N S F E R B L O C K * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_OUT_OF_RANGE - The sum of the size and offset is larger * - * than the corresponding map size. * - * SCI_ERR_SIZE_ALIGNMENT - Size is not correctly aligned as required * - * by the implementation. * - * SCI_ERR_OFFSET_ALIGNMENT - Offset is not correctly aligned as required * - * by the implementation. * - * SCI_ERR_TRANSFER_FAILED - The data transfer failed. * - * * - *********************************************************************************/ -#define SCITransferBlock _SISCI_EXPANDE_FUNCTION_NAME(SCITransferBlock) -DLL void SCITransferBlock(sci_map_t sourceMap, - unsigned int sourceOffset, - sci_map_t destinationMap, - unsigned int destinationOffset, - unsigned int size, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I T R A N S F E R B L O C K A S Y N C * - * * - * Flags * - * * - * SCI_FLAG_BLOCK_READ * - * SCI_FLAG_USE_CALLBACK * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_OUT_OF_RANGE - The sum of the size and offset is larger than * - * the corresponding map size. * - * SCI_ERR_SIZE_ALIGNMENT - Size is not correctly aligned as required by * - * the implementation. * - * SCI_ERR_OFFSET_ALIGNMENT - Offset is not correctly aligned as required * - * by the implementation. * - * SCI_ERR_TRANSFER_FAILED - The data transfer failed. * - * * - *********************************************************************************/ -#define SCITransferBlockAsync _SISCI_EXPANDE_FUNCTION_NAME(SCITransferBlockAsync) -DLL void SCITransferBlockAsync(sci_map_t sourceMap, - unsigned int sourceOffset, - sci_map_t destinationMap, - unsigned int destinationOffset, - unsigned int size, - sci_block_transfer_t *block, - sci_cb_block_transfer_t callback, - void *callbackArg, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I W A I T F O R B L O C K T R A N S F E R * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_ILLEGAL_OPERATION - Illegal operation * - * SCI_ERR_TIMEOUT - The function timed out after specified * - * timeout value. * - * * - *********************************************************************************/ -#define SCIWaitForBlockTransfer _SISCI_EXPANDE_FUNCTION_NAME(SCIWaitForBlockTransfer) -DLL void SCIWaitForBlockTransfer(sci_block_transfer_t block, - unsigned int timeout, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I A B O R T B L O C K T R A N S F E R * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_ILLEGAL_OPERATION - Illegal operation * - * * - *********************************************************************************/ -#define SCIAbortBlockTransfer _SISCI_EXPANDE_FUNCTION_NAME(SCIAbortBlockTransfer) -DLL void SCIAbortBlockTransfer(sci_block_transfer_t block, - unsigned int flags, - sci_error_t *error); - - - - -/********************************************************************************* - * * - * S C I M E M C P Y * - * * - * Flags: * - * SCI_FLAG_BLOCK_READ * - * SCI_FLAG_ERROR_CHECK * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_OUT_OF_RANGE - The sum of the size and offset is larger * - * than the corresponding map size. * - * SCI_ERR_SIZE_ALIGNMENT - Size is not correctly aligned as required * - * by the implementation. * - * SCI_ERR_OFFSET_ALIGNMENT - Offset is not correctly aligned as required * - * by the implementation. * - * SCI_ERR_TRANSFER_FAILED - The data transfer failed. * - * * - *********************************************************************************/ - -#define SCIMemCpy _SISCI_EXPANDE_FUNCTION_NAME(SCIMemCpy) -DLL void SCIMemCpy(sci_sequence_t sequence, - void *memAddr, - sci_map_t remoteMap, - unsigned int remoteOffset, - unsigned int size, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I M E M C O P Y * - * * - * Flags: * - * SCI_FLAG_BLOCK_READ * - * SCI_FLAG_ERROR_CHECK * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_OUT_OF_RANGE - The sum of the size and offset is larger * - * than the corresponding map size. * - * SCI_ERR_SIZE_ALIGNMENT - Size is not correctly aligned as required * - * by the implementation. * - * SCI_ERR_OFFSET_ALIGNMENT - Offset is not correctly aligned as required * - * by the implementation. * - * SCI_ERR_TRANSFER_FAILED - The data transfer failed. * - * * - *********************************************************************************/ - - -#define SCIMemCopy _SISCI_EXPANDE_FUNCTION_NAME(SCIMemCopy) -DLL void SCIMemCopy(void *memAddr, - sci_map_t remoteMap, - unsigned int remoteOffset, - unsigned int size, - unsigned int flags, - sci_error_t *error); - - - -/********************************************************************************* - * * - * S C I R E G I S T E R S E G M E N T M E M O R Y * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_SIZE_ALIGNMENT - Size is not correctly aligned as required by * - * the implementation. * - * SCI_ERR_ILLEGAL_ADDRESS - Illegal address. * - * SCI_ERR_OUT_OF_RANGE - Size is larger than the maximum size for the * - * local segment. * - * * - *********************************************************************************/ -#define SCIRegisterSegmentMemory _SISCI_EXPANDE_FUNCTION_NAME(SCIRegisterSegmentMemory) -DLL void SCIRegisterSegmentMemory(void *address, - unsigned int size, - sci_local_segment_t segment, - unsigned int flags, - sci_error_t *error); - - - - - -/********************************************************************************* - * * - * S C I C O N N E C T S C I S P A C E * - * * - * SISCI Priveleged function * - * * - * * - * Flags * - * None. * - * * - * * - * Specific error codes for this function: * - * * - * SCI_ERR_SIZE_ALIGNMENT - Size is not correctly aligned as required * - * by the implementation. * - * SCI_ERR_CONNECTION_REFUSED - Connection attempt refused by remote node. * - * * - *********************************************************************************/ -#define SCIConnectSCISpace _SISCI_EXPANDE_FUNCTION_NAME(SCIConnectSCISpace) -DLL void SCIConnectSCISpace(sci_desc_t sd, - unsigned int localAdapterNo, - sci_remote_segment_t *segment, - sci_address_t address, - unsigned int size, - unsigned int flags, - sci_error_t *error); - - - -/* - * ===================================================================================== - * - * S C I A T T A C H L O C A L S E G M E N T - * Description: - * - * SCIAttachLocalSegment() permits an application to "attach" to an already existing - * local segment, implying that two or more application want - * share the same local segment. The prerequest, is that the - * application which originally created the segment ("owner") has - * preformed a SCIShareSegment() in order to mark the segment - * "shareable". - * - * - * Flags: - * - * SCI_FLAG_USE_CALLBACK - The callback function will be invoked for events - * on this segment. - * - * - * Specific error codes for this function: - * - * SCI_ERR_ACCESS - No such shared segment - * SCI_ERR_NO_SUCH_SEGMENT - No such segment - * Note: Current implenentation will return SCI_ERR_ACCESS for both cases. This will - * change from next release. Application should handle both cases. - * - * ===================================================================================== - */ -#define SCIAttachLocalSegment _SISCI_EXPANDE_FUNCTION_NAME(SCIAttachLocalSegment) - -DLL void -SCIAttachLocalSegment(sci_desc_t sd, - sci_local_segment_t *segment, - unsigned int segmentId, - unsigned int *size, - sci_cb_local_segment_t callback, - void *callbackArg, - unsigned int flags, - sci_error_t *error); -/* - * ===================================================================================== - * - * S C I S H A R E S E G M E N T - * - * Description: - * - * SCIShareSegment() permits other application to "attach" to an already existing - * local segment, implying that two or more application want - * share the same local segment. The prerequest, is that the - * application which originally created the segment ("owner") has - * preformed a SCIShareSegment() in order to mark the segment - * "shareable". - * - * - * Flags: - * none - * - * Specific error codes for this function: - * - * - * - * ===================================================================================== - */ -#define SCIShareSegment _SISCI_EXPANDE_FUNCTION_NAME(SCIShareSegment) - -DLL void -SCIShareSegment(sci_local_segment_t segment, - unsigned int flags, - sci_error_t *error); - - -/********************************************************************************* - * * - * S C I F L U S H * - * * - * This function will flush the CPU buffers and the PSB buffers. * - * * - * Flags * - * SCI_FLAG_FLUSH_CPU_BUFFERS_ONLY : * - * Only flush CPU buffers ( Write combining * - * etc buffers). * - * * - *********************************************************************************/ - -#define SCIFlush _SISCI_EXPANDE_FUNCTION_NAME(SCIFlush) -DLL void SCIFlush(sci_sequence_t sequence, - unsigned int flags); - -#if defined(CPLUSPLUS) || defined(__cplusplus) -} -#endif - - -#endif - - - - - - - - - - - diff --git a/ndb/src/external/WIN32.x86/sci/include/sisci_demolib.h b/ndb/src/external/WIN32.x86/sci/include/sisci_demolib.h deleted file mode 100644 index ce5bb2aec8e..00000000000 --- a/ndb/src/external/WIN32.x86/sci/include/sisci_demolib.h +++ /dev/null @@ -1,226 +0,0 @@ -/* $Id: sisci_demolib.h,v 1.1 2002/12/13 12:17:23 hin Exp $ */ - -/******************************************************************************* - * * - * Copyright (C) 1993 - 2000 * - * Dolphin Interconnect Solutions AS * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, * - * or (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * * - * * - *******************************************************************************/ - -#ifndef _SISCI_DEMOLIB_H -#define _SISCI_DEMOLIB_H - - -#if defined(_REENTRANT) - -#define _SISCI_DEMOLIB_EXPAND_NAME(name) _SISCI_DEMOLIB_MT_ ## name - -#else - -#define _SISCI_DEMOLIB_EXPAND_NAME(name) _SISCI_DEMOLIB_ST_ ## name - -#endif - -/*********************************************************************************/ -/* Q U E R Y A D A P T E R */ -/* */ -/*********************************************************************************/ - -#define QueryAdapter _SISCI_DEMOLIB_EXPAND_NAME(QueryAdapter) - -sci_error_t QueryAdapter( - unsigned int subcommand, - unsigned int localAdapterNo, - unsigned int portNo, - unsigned int *data); - - -/*********************************************************************************/ -/* Q U E R Y S Y S T E M */ -/* */ -/*********************************************************************************/ - -#define QuerySystem _SISCI_DEMOLIB_EXPAND_NAME(QuerySystem) - -sci_error_t QuerySystem( - unsigned int subcommand, - unsigned int *data); - - -/*********************************************************************************/ -/* D E T E C T F I R S T A D A P T E R C A R D */ -/* */ -/*********************************************************************************/ - -#define DetectFirstAdapterCard _SISCI_DEMOLIB_EXPAND_NAME(DetectFirstAdapterCard) - -sci_error_t DetectFirstAdapterCard( - unsigned int *localAdapterNo, - unsigned int *localNodeId); - - -/*********************************************************************************/ -/* G E T A D A P T E R T Y P E */ -/* */ -/*********************************************************************************/ - -#define GetAdapterType _SISCI_DEMOLIB_EXPAND_NAME(GetAdapterType) - -sci_error_t GetAdapterType(unsigned int localAdapterNo, - unsigned int *adapterType); - - -/*********************************************************************************/ -/* G E T L O C A L N O D E I D */ -/* */ -/*********************************************************************************/ - -#define GetLocalNodeId _SISCI_DEMOLIB_EXPAND_NAME(GetLocalNodeId) - -sci_error_t GetLocalNodeId( - unsigned int localAdapterNo, - unsigned int *localNodeId); - - -/*********************************************************************************/ -/* G E T A D A P T E R S E R I A L N U M B E R */ -/* */ -/*********************************************************************************/ - -#define GetAdapterSerialNumber _SISCI_DEMOLIB_EXPAND_NAME(GetAdapterSerialNumber) - -sci_error_t GetAdapterSerialNumber( - unsigned int localAdapterNo, - unsigned int *serialNo); - - - -/*********************************************************************************/ -/* G E T H O S T B R I D G E T Y P E */ -/* */ -/*********************************************************************************/ - -#define GetHostbridgeType _SISCI_DEMOLIB_EXPAND_NAME(GetHostbridgeType) - -sci_error_t GetHostbridgeType(unsigned int *hostbridgeType); - - - -/*********************************************************************************/ -/* P R I N T H O S T B R I D G E T Y P E */ -/* */ -/*********************************************************************************/ - -#define PrintHostbridgeType _SISCI_DEMOLIB_EXPAND_NAME(PrintHostbridgeType) - -void PrintHostbridgeType(unsigned int hostbridge); - - - -/*********************************************************************************/ -/* G E T A P I V E R S I O N S T R I N G */ -/* */ -/*********************************************************************************/ - -#define GetAPIVersionString _SISCI_DEMOLIB_EXPAND_NAME(GetAPIVersionString) - -sci_error_t GetAPIVersionString(char str[], unsigned int strLength); - - - -/*********************************************************************************/ -/* G E T A D A P T E R I O B U S F R E Q U E N C Y */ -/* */ -/*********************************************************************************/ - -sci_error_t GetAdapterIoBusFrequency(unsigned int localAdapterNo, - unsigned int *ioBusFrequency); - - - -/*********************************************************************************/ -/* G E T A D A P T E R S C I L I N K F R E Q U E N C Y */ -/* */ -/*********************************************************************************/ - -sci_error_t GetAdapterSciLinkFrequency(unsigned int localAdapterNo, - unsigned int *sciLinkFrequency); - - - -/*********************************************************************************/ -/* G E T A D A P T E R B L I N K F R E Q U E N C Y */ -/* */ -/*********************************************************************************/ - -sci_error_t GetAdapterBlinkFrequency(unsigned int localAdapterNo, - unsigned int *bLinkFrequency); - - -/*********************************************************************************/ -/* S E N D I N T E R R U P T */ -/* */ -/*********************************************************************************/ - -#define SendInterrupt _SISCI_DEMOLIB_EXPAND_NAME(SendInterrupt) - -sci_error_t SendInterrupt( - sci_desc_t sd, - unsigned int localAdapterNo, - unsigned int localNodeId, - unsigned int remoteNodeId, - unsigned int interruptNo); - - -/*********************************************************************************/ -/* R E C E I V E I N T E R R U P T */ -/* */ -/*********************************************************************************/ - -#define ReceiveInterrupt _SISCI_DEMOLIB_EXPAND_NAME(ReceiveInterrupt) - -sci_error_t ReceiveInterrupt( - sci_desc_t sd, - unsigned int localAdapterNo, - unsigned int localNodeId, - unsigned int interruptNo); - - -/*********************************************************************************/ -/* E N D I A N S W A P */ -/* */ -/*********************************************************************************/ - -#define EndianSwap _SISCI_DEMOLIB_EXPAND_NAME(EndianSwap) - -unsigned int EndianSwap (unsigned int value); - - -/*********************************************************************************/ -/* S L E E P M I L L I S E C O N D S */ -/* */ -/*********************************************************************************/ - -#define SleepMilliseconds _SISCI_DEMOLIB_EXPAND_NAME(SleepMilliseconds) - -void SleepMilliseconds(int milliseconds); - - - - -#endif diff --git a/ndb/src/external/WIN32.x86/sci/include/sisci_error.h b/ndb/src/external/WIN32.x86/sci/include/sisci_error.h deleted file mode 100644 index 56fa0d18b3a..00000000000 --- a/ndb/src/external/WIN32.x86/sci/include/sisci_error.h +++ /dev/null @@ -1,94 +0,0 @@ -/* $Id: sisci_error.h,v 1.1 2002/12/13 12:17:23 hin Exp $ */ - -/******************************************************************************* - * * - * Copyright (C) 1993 - 2000 * - * Dolphin Interconnect Solutions AS * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, * - * or (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * * - * * - *******************************************************************************/ - - - - -#ifndef _SISCI_ERROR_H_ -#define _SISCI_ERROR_H_ - - -/* SCI Error return values always have 30 bit set */ -#define SCI_ERR_MASK 0x40000000 -#define SCI_ERR_REMOTE_MASK 0x01 /* Remote errors should have bit 0 set */ - -#define SCI_ERR(u) ((unsigned32)(u)&0x7FFFFFFF ) - -/* Error codes */ -typedef enum { - SCI_ERR_OK = 0x000, - - - SCI_ERR_BUSY = (0x900 | SCI_ERR_MASK), - SCI_ERR_FLAG_NOT_IMPLEMENTED = (0x901 | SCI_ERR_MASK), - SCI_ERR_ILLEGAL_FLAG = (0x902 | SCI_ERR_MASK), - SCI_ERR_NOSPC = (0x904 | SCI_ERR_MASK), - SCI_ERR_API_NOSPC = (0x905 | SCI_ERR_MASK), - SCI_ERR_HW_NOSPC = (0x906 | SCI_ERR_MASK), - SCI_ERR_NOT_IMPLEMENTED = (0x907 | SCI_ERR_MASK), - SCI_ERR_ILLEGAL_ADAPTERNO = (0x908 | SCI_ERR_MASK), - SCI_ERR_NO_SUCH_ADAPTERNO = (0x909 | SCI_ERR_MASK), - SCI_ERR_TIMEOUT = (0x90A | SCI_ERR_MASK), - SCI_ERR_OUT_OF_RANGE = (0x90B | SCI_ERR_MASK), - SCI_ERR_NO_SUCH_SEGMENT = (0x90C | SCI_ERR_MASK), - SCI_ERR_ILLEGAL_NODEID = (0x90D | SCI_ERR_MASK), - SCI_ERR_CONNECTION_REFUSED = (0x90E | SCI_ERR_MASK), - SCI_ERR_SEGMENT_NOT_CONNECTED = (0x90F | SCI_ERR_MASK), - SCI_ERR_SIZE_ALIGNMENT = (0x910 | SCI_ERR_MASK), - SCI_ERR_OFFSET_ALIGNMENT = (0x911 | SCI_ERR_MASK), - SCI_ERR_ILLEGAL_PARAMETER = (0x912 | SCI_ERR_MASK), - SCI_ERR_MAX_ENTRIES = (0x913 | SCI_ERR_MASK), - SCI_ERR_SEGMENT_NOT_PREPARED = (0x914 | SCI_ERR_MASK), - SCI_ERR_ILLEGAL_ADDRESS = (0x915 | SCI_ERR_MASK), - SCI_ERR_ILLEGAL_OPERATION = (0x916 | SCI_ERR_MASK), - SCI_ERR_ILLEGAL_QUERY = (0x917 | SCI_ERR_MASK), - SCI_ERR_SEGMENTID_USED = (0x918 | SCI_ERR_MASK), - SCI_ERR_SYSTEM = (0x919 | SCI_ERR_MASK), - SCI_ERR_CANCELLED = (0x91A | SCI_ERR_MASK), - SCI_ERR_NOT_CONNECTED = (0x91B | SCI_ERR_MASK), - SCI_ERR_NOT_AVAILABLE = (0x91C | SCI_ERR_MASK), - SCI_ERR_INCONSISTENT_VERSIONS = (0x91D | SCI_ERR_MASK), - SCI_ERR_COND_INT_RACE_PROBLEM = (0x91E | SCI_ERR_MASK), - SCI_ERR_OVERFLOW = (0x91F | SCI_ERR_MASK), - SCI_ERR_NOT_INITIALIZED = (0x920 | SCI_ERR_MASK), - - SCI_ERR_ACCESS = (0x921 | SCI_ERR_MASK), - - SCI_ERR_NO_SUCH_NODEID = (0xA00 | SCI_ERR_MASK), - SCI_ERR_NODE_NOT_RESPONDING = (0xA02 | SCI_ERR_MASK), - SCI_ERR_NO_REMOTE_LINK_ACCESS = (0xA04 | SCI_ERR_MASK), - SCI_ERR_NO_LINK_ACCESS = (0xA05 | SCI_ERR_MASK), - SCI_ERR_TRANSFER_FAILED = (0xA06 | SCI_ERR_MASK), - - SCI_ERR_EWOULD_BLOCK = ( 0xB00 | SCI_ERR_MASK), - SCI_ERR_SEMAPHORE_COUNT_EXCEEDED = ( 0xB01 | SCI_ERR_MASK), - SCI_ERR_IRQL_ILLEGAL = ( 0xB02 | SCI_ERR_MASK) - -} sci_error_t; - - -#endif /* _SCI_ERROR_H_ */ - - - diff --git a/ndb/src/external/WIN32.x86/sci/include/sisci_types.h b/ndb/src/external/WIN32.x86/sci/include/sisci_types.h deleted file mode 100644 index 03e7957c3f2..00000000000 --- a/ndb/src/external/WIN32.x86/sci/include/sisci_types.h +++ /dev/null @@ -1,133 +0,0 @@ -/* $Id: sisci_types.h,v 1.1 2002/12/13 12:17:23 hin Exp $ */ - -/******************************************************************************* - * * - * Copyright (C) 1993 - 2000 * - * Dolphin Interconnect Solutions AS * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, * - * or (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the Free Software * - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * * - * * - *******************************************************************************/ - - -#ifndef _SISCI_TYPES_H -#define _SISCI_TYPES_H - -#include "sisci_error.h" - -#ifndef IN -#define IN -#endif - -#ifndef OUT -#define OUT -#endif - -#ifndef IN_OUT -#define IN_OUT -#endif - -/* Opaque data types for descriptors/handles */ -typedef struct sci_desc *sci_desc_t; -typedef struct sci_local_segment *sci_local_segment_t; -typedef struct sci_remote_segment *sci_remote_segment_t; - -typedef struct sci_map *sci_map_t; -typedef struct sci_sequence *sci_sequence_t; -#ifndef KERNEL -typedef struct sci_dma_queue *sci_dma_queue_t; -#endif -typedef struct sci_remote_interrupt *sci_remote_interrupt_t; -typedef struct sci_local_interrupt *sci_local_interrupt_t; -typedef struct sci_block_transfer *sci_block_transfer_t; - -/* - * Constants defining reasons for segment callbacks: - */ - -typedef enum { - SCI_CB_CONNECT = 1, - SCI_CB_DISCONNECT, - SCI_CB_NOT_OPERATIONAL, - SCI_CB_OPERATIONAL, - SCI_CB_LOST -} sci_segment_cb_reason_t; - -#define MAX_CB_REASON SCI_CB_LOST - -/* dma_queue_states is identical to the dma_queue_state_t in genif.h, they must be consistent.*/ -typedef enum { - SCI_DMAQUEUE_IDLE, - SCI_DMAQUEUE_GATHER, - SCI_DMAQUEUE_POSTED, - SCI_DMAQUEUE_DONE, - SCI_DMAQUEUE_ABORTED, - SCI_DMAQUEUE_ERROR -} sci_dma_queue_state_t; - - -typedef enum { - SCI_SEQ_OK, - SCI_SEQ_RETRIABLE, - SCI_SEQ_NOT_RETRIABLE, - SCI_SEQ_PENDING -} sci_sequence_status_t; - - -typedef struct { - unsigned short nodeId; /* SCI Address bit 63 - 48 */ - unsigned short offsHi; /* SCI Address bit 47 - 32 */ - unsigned int offsLo; /* SCI Address bit 31 - 0 */ -} sci_address_t; - - -typedef unsigned int sci_ioaddr_t; - -typedef enum { - SCI_CALLBACK_CANCEL = 1, - SCI_CALLBACK_CONTINUE -} sci_callback_action_t; - -#ifndef KERNEL -typedef sci_callback_action_t (*sci_cb_local_segment_t)(void *arg, - sci_local_segment_t segment, - sci_segment_cb_reason_t reason, - unsigned int nodeId, - unsigned int localAdapterNo, - sci_error_t error); - -typedef sci_callback_action_t (*sci_cb_remote_segment_t)(void *arg, - sci_remote_segment_t segment, - sci_segment_cb_reason_t reason, - sci_error_t status); - - -typedef sci_callback_action_t (*sci_cb_dma_t)(void IN *arg, - sci_dma_queue_t queue, - sci_error_t status); - - -typedef int (*sci_cb_block_transfer_t)(void *arg, - sci_block_transfer_t block, - sci_error_t status); - - -typedef sci_callback_action_t (*sci_cb_interrupt_t)(void *arg, - sci_local_interrupt_t interrupt, - sci_error_t status); - -#endif /* KERNEL */ -#endif diff --git a/ndb/test/odbc/tpcb/Makefile b/ndb/test/odbc/tpcb/Makefile deleted file mode 100644 index 8ab429c8ea1..00000000000 --- a/ndb/test/odbc/tpcb/Makefile +++ /dev/null @@ -1,30 +0,0 @@ -include .defs.mk - -TYPE = * - -BIN_TARGET = tpcb - -SOURCES = ttTime.c tpcb.cpp - -CCFLAGS_LOC += \ - -I$(NDB_TOP)/include \ - -I$(NDB_TOP)/include/ndbapi \ - -I$(NDB_TOP)/include/portlib \ - -I$(NDB_TOP)/include/util \ - -I$(NDB_TOP)/test/include \ - -I/usr/local/include - -CCFLAGS_WARNINGS += -Wno-unused -Wno-sign-compare -Wformat - -CCFLAGS_TOP += -DndbODBC - -BIN_TARGET_LIBS = NDB_API_pic NDB_ODBC_pic NDBT - -ifeq ($(NDB_OS),SOLARIS) -BIN_TARGET_LIBS += dmallocthcxx -CCFLAGS_TOP += -DDMALLOC -endif - -include $(NDB_TOP)/Epilogue.mk - -$(BIN_DIR)$(BIN_TARGET): Makefile diff --git a/ndb/test/odbc/tpcb/Makefile_mysql b/ndb/test/odbc/tpcb/Makefile_mysql deleted file mode 100644 index 4e1b9a25fe2..00000000000 --- a/ndb/test/odbc/tpcb/Makefile_mysql +++ /dev/null @@ -1,33 +0,0 @@ -include $(NDB_TOP)/Defs.mk - -TYPE = odbcclient - -BIN_TARGET = tpcb - -SOURCES = ttTime.c tpcb.cpp - -CCFLAGS_LOC += -I/usr/local/include \ - -I$(NDB_TOP)/test/include \ - -I$(NDB_TOP)/include \ - -I$(NDB_TOP)/include/util \ - -I$(NDB_TOP)/src/client/odbc/common - - - - -#CCFLAGS_WARNINGS += -Wno-unused - -LIBS_LOC += -L/usr/local/lib -BIN_TARGET_LIBS_DIRS += /usr/local/lib -BIN_TARGET_LIBS += odbc odbcinst - -#LIBS_SPEC += -pg -# -lNDBT \ -# -lodbc \ -# -lodbcinst \ -# -lportlib - - - -include $(NDB_TOP)/Epilogue.mk - diff --git a/ndb/test/odbc/tpcb/Makefile_ndb b/ndb/test/odbc/tpcb/Makefile_ndb deleted file mode 100644 index 85960413ef0..00000000000 --- a/ndb/test/odbc/tpcb/Makefile_ndb +++ /dev/null @@ -1,30 +0,0 @@ -include $(NDB_TOP)/Defs.mk - -TYPE = * - -BIN_TARGET = tpcb - -SOURCES = ttTime.c tpcb.cpp - -CCFLAGS_LOC += \ - -I$(NDB_TOP)/include \ - -I$(NDB_TOP)/include/ndbapi \ - -I$(NDB_TOP)/include/portlib \ - -I$(NDB_TOP)/include/util \ - -I$(NDB_TOP)/test/include \ - -I/usr/local/include - -CCFLAGS_WARNINGS += -Wno-unused -Wno-sign-compare -Wformat - -CCFLAGS_TOP += -DndbODBC - -BIN_TARGET_LIBS = NDB_API_pic NDB_ODBC_pic NDBT - -ifeq ($(NDB_OS),SOLARIS) -BIN_TARGET_LIBS += dmallocthcxx -CCFLAGS_TOP += -DDMALLOC -endif - -include $(NDB_TOP)/Epilogue.mk - -$(BIN_DIR)$(BIN_TARGET): Makefile diff --git a/ndb/test/odbc/tpcb/readme.txt b/ndb/test/odbc/tpcb/readme.txt deleted file mode 100644 index 008cafb9d2f..00000000000 --- a/ndb/test/odbc/tpcb/readme.txt +++ /dev/null @@ -1,15 +0,0 @@ -'tpcb' requires an .odbc.ini file in -/etc/ -or in -/home/user/ - -The .odbc.ini file must contain a DSN entry called ndb: - -#--------- .odbc.ini example -------------------- - -[ndb] -Driver = /path_to_installation/lib/libNDB_ODBC.so - -#--------- End of example ----------------------- - - diff --git a/ndb/test/odbc/tpcb/timesten.h b/ndb/test/odbc/tpcb/timesten.h deleted file mode 100644 index 45579f9d277..00000000000 --- a/ndb/test/odbc/tpcb/timesten.h +++ /dev/null @@ -1,188 +0,0 @@ -/* Copyright (C) 2003 MySQL AB - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - -/* - * $Revision: 1.1 $ - * (c) Copyright 1997-2003, TimesTen, Inc. - * All rights reserved. - */ - -#ifndef TIMESTEN_H_INCLUDED -#define TIMESTEN_H_INCLUDED - -#ifdef _WIN32 -#include -#endif - -#include -#include -#include -/* - * TimesTen extension to application data types; only usable - * when application directly linked to the TimesTen driver. - */ -#define SQL_C_ADDR 100 - -#ifndef SQL_C_SBIGINT -#if (ODBCVER < 0x0300) -#define SQL_C_SBIGINT (SQL_BIGINT+SQL_SIGNED_OFFSET) -#define SQL_C_UBIGINT (SQL_BIGINT+SQL_UNSIGNED_OFFSET) -#endif -#endif - -#define SQL_C_BIGINT SQL_C_SBIGINT - -#if (ODBCVER < 0x0300) -#ifdef _WIN32 -typedef __int64 SQLBIGINT; -/* On Unix platforms SQLBIGINT is defined in odbcinclude directory*/ -#endif -#endif - -#define BIGINT SQLBIGINT - -#ifdef _WIN32 -#define UBIGINT unsigned __int64 -#else -#define UBIGINT unsigned long long -#endif - - -#define SQL_WCHAR (-8) -#define SQL_WVARCHAR (-9) -#define SQL_WLONGVARCHAR (-10) -#define SQL_C_WCHAR SQL_WCHAR - -/* SQLGetInfo() InfoTypes */ -#define SQL_CONVERT_WCHAR 122 -#define SQL_CONVERT_WLONGVARCHAR 125 -#define SQL_CONVERT_WVARCHAR 126 - -/* TimesTen specific SQLGetInfo types */ -#define TT_REPLICATION_INVALID (SQL_INFO_DRIVER_START + 2000) - -/* SQLGetInfo() return value bitmasks */ -#ifndef SQL_CVT_WCHAR -/* -** These definitions differ from Microsoft in that they are not -** specified as long (e.g. 0x00200000L), hence they are protected -** by the ifndef above. -*/ -#define SQL_CVT_WCHAR 0x00200000 -#define SQL_CVT_WLONGVARCHAR 0x00400000 -#define SQL_CVT_WVARCHAR 0x00800000 -#endif - -/* -** The Microsoft Driver Manager SQLBindParameter() will not pass SQL_WCHAR -** through. Use this hack to get around it. -*/ -#define SQL_WCHAR_DM_SQLBINDPARAMETER_BYPASS -888 - -/* This is an extension to ODBC's isolation levels. It reflects an - * earlier implementation of read-committed that released locks on - * next fetch, rather than releasing locks before returning value to - * application. */ -#define SQL_TXN_CURSOR_STABILITY 0x00001000 -#define SQL_TXN_NOBLOCK_DELETE 0x00002000 - -/* TimesTen-specific connection option */ -#define TT_PREFETCH_CLOSE 10001 -#define TT_PREFETCH_CLOSE_OFF 0 -#define TT_PREFETCH_CLOSE_ON 1 - -/* Adding a new sql connection option */ -#define TT_PREFETCH_COUNT 10003 -#define TT_PREFETCH_COUNT_MAX 128 - -/* - * Platform specific data types for integers that scale - * with pointer size - */ - -#ifdef _IA64_ -typedef signed __int64 tt_ptrint; -typedef unsigned __int64 tt_uptrint; -#else -#ifdef _WIN32 -typedef signed long tt_ptrint; -typedef unsigned long tt_uptrint; -#else -typedef signed long tt_ptrint; -typedef unsigned long tt_uptrint; -#endif -#endif - -#ifdef _WIN32 -typedef signed __int64 tt_int8; -typedef unsigned __int64 tt_uint8; -#else -typedef signed long long tt_int8; -typedef unsigned long long tt_uint8; -#endif - -/* printf formats for pointer-sized integers */ -#ifdef _IA64_ /* 64-bit NT */ -#define PTRINT_FMT "I64d" -#define UPTRINT_FMT "I64u" -#define xPTRINT_FMT "I64x" -#define XPTRINT_FMT "I64X" -#else -#ifdef _WIN32 /* 32-bit NT */ -#define PTRINT_FMT "ld" -#define UPTRINT_FMT "lu" -#define xPTRINT_FMT "lx" -#define XPTRINT_FMT "lX" -#else /* 32 and 64-bit UNIX */ -#define PTRINT_FMT "ld" -#define UPTRINT_FMT "lu" -#define xPTRINT_FMT "lx" -#define XPTRINT_FMT "lX" -#endif -#endif - -/* printf formats for 8-byte integers */ -#ifndef INT8_FMT_DEFINED -#ifdef _WIN32 /* 32 and 64-bit NT */ -#define INT8_FMT "I64d" -#define UINT8_FMT "I64u" -#define xINT8_FMT "I64x" -#define XINT8_FMT "I64X" -#else /* 32 and 64-bit UNIX */ -#define INT8_FMT "lld" -#define UINT8_FMT "llu" -#define xINT8_FMT "llx" -#define XINT8_FMT "llX" -#endif -#define INT8_FMT_DEFINED 1 -#endif - -/* The following types are defined in the newer odbc include files - from Microsoft -*/ -#if defined (_WIN32) && !defined (_IA64_) -#ifndef SQLROWSETSIZE -#define SQLROWSETSIZE SQLUINTEGER -#define SQLLEN SQLINTEGER -#define SQLROWOFFSET SQLINTEGER -#define SQLROWCOUNT SQLUINTEGER -#define SQLULEN SQLUINTEGER -#define SQLSETPOSIROW SQLUSMALLINT -#endif -#endif - - -#endif diff --git a/ndb/test/odbc/tpcb/tpcb.cpp b/ndb/test/odbc/tpcb/tpcb.cpp deleted file mode 100644 index 60d746e7844..00000000000 --- a/ndb/test/odbc/tpcb/tpcb.cpp +++ /dev/null @@ -1,1415 +0,0 @@ -/* Copyright (C) 2003 MySQL AB - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - -static const volatile char cvsid[] = "$Id: tpcb.cpp,v 1.4 2003/09/26 09:04:34 johan Exp $"; -/* - * $Revision: 1.4 $ - * (c) Copyright 1996-2003, TimesTen, Inc. - * All rights reserved. - */ - -/* This source is best displayed with a tabstop of 4 */ - -#define NDB - -//#define MYSQL - -#ifdef WIN32 -#include -#include "ttRand.h" -#else -#if !defined NDB && !defined MYSQL -#include -#endif -#include -#include -#include -#ifdef SB_P_OS_CHORUS -#include "ttRand.h" -#endif -#endif - -#include -#include -#include -#include -#include -#include - -#if !defined NDB && !defined MYSQL -#include "ttTime.h" -#include "utils.h" -#include "tt_version.h" -#include "timesten.h" -#endif - -#if defined NDB || defined MYSQL -#include -#include - -#include -#include -extern "C" { -#include "ttTime.h" -#include "timesten.h" - void ttGetWallClockTime(ttWallClockTime* timeP); - void ttCalcElapsedWallClockTime(ttWallClockTime* beforeP, - ttWallClockTime* afterP, - double* nmillisecondsP); - void ttGetThreadTimes(ttThreadTimes * endRes); - void ttCalcElapsedThreadTimes(ttThreadTimes* startRes, - ttThreadTimes * endRes, - double * kernel, - double * user); -} - -#define app_exit exit -#define status_msg0 ndbout_c -#define status_msg1 ndbout_c -#define status_msg2 ndbout_c -#define err_msg0 ndbout_c -#define err_msg1 ndbout_c -#define err_msg3 ndbout_c -#define out_msg0 ndbout_c -#define out_msg1 ndbout_c -#define out_msg3 ndbout_c -#define CONN_STR_LEN 255 -#define DBMS_TIMESTEN 1 -#define DBMS_MSSQL 2 -#define DBMS_UNKNOWN 3 -#define ABORT_DISCONNECT_EXIT 1 -#define NO_EXIT 0 -#define ERROR_EXIT 1 -#define DISCONNECT_EXIT 2 -#endif - -#define VERBOSE_NOMSGS 0 -/* this value is used for results (and err msgs) only */ -#define VERBOSE_RESULTS 1 -/* this value is the default for the cmdline demo */ -#define VERBOSE_DFLT 2 -#define VERBOSE_ALL 3 - -#ifdef MYSQL -#define DSNNAME "DSN=myodbc3" -#elif defined NDB -#define DSNNAME "DSN=ndb" -#else -#define DSNNAME "DSN=" -#endif - -/* number of branches, tellers, and accounts */ - -#define NumBranches 1 -#define TellersPerBranch 10 -#define AccountsPerBranch 10000 - -/* number of transactions to execute */ - -#define NumXacts 25000 - -/* starting seed value for the random number generator */ - -#define SeedVal 84773 - -/* for MS SQL, the drop, create and use database statements */ - -#define DatabaseDropStmt "drop database tpcbDB;" -#ifdef MYSQL -#define DatabaseCreateStmt "create database tpcbDB;" -#else -#define DatabaseCreateStmt "create database tpcbDB ON DEFAULT = %d;" -#endif -#define DatabaseUseStmt "use tpcbDB;" - -/* - * Specifications of table columns. - * Fillers of 80, 80, 84, and 24 bytes, respectively, are used - * to ensure that rows are the width required by the benchmark. - * - * Note: The TimesTen and MS SQL CREATE TABLE statements for the - * accounts, tellers and branches tables are different. - * - */ - -#define TuplesPerPage 256 - - -#ifdef MYSQL - -#define AccountCrTblStmt "create table accounts \ -(number integer not null primary key, \ -branchnum integer not null, \ -balance float not null, \ -filler char(80));" - -#define TellerCrTblStmt "create table tellers \ -(number integer not null primary key, \ -branchnum integer not null, \ -balance float not null, \ -filler char(80));" - -#define BranchCrTblStmt "create table branches \ -(number integer not null primary key, \ -balance float not null, \ -filler char(84));" - -#endif - - -#ifdef NDB -#define AccountCrTblStmt "create table accounts \ -(number integer not null primary key, \ -branchnum integer not null, \ -balance float not null, \ -filler char(80)) nologging" - -#define TellerCrTblStmt "create table tellers \ -(number integer not null primary key, \ -branchnum integer not null, \ -balance float not null, \ -filler char(80)) nologging" - -#define BranchCrTblStmt "create table branches \ -(number integer not null primary key, \ -balance float not null, \ -filler char(84)) nologging" -#endif - -#ifdef NDB - -#define HistoryCrTblStmt "create table History \ -(tellernum integer not null, \ -branchnum integer not null, \ -accountnum integer not null, \ -delta float not null, \ -createtime integer not null, \ -filler char(24), \ -primary key (tellernum, branchnum, accountnum, delta, createtime)) nologging" - -#else - -#ifdef MYSQL - -#define HistoryCrTblStmt "create table History \ -(tellernum integer not null, \ -branchnum integer not null, \ -accountnum integer not null, \ -delta float(53) not null, \ -createtime integer not null, \ -filler char(24))" -#endif - -#define HistoryCrTblStmt "create table History \ -(tellernum integer not null, \ -branchnum integer not null, \ -accountnum integer not null, \ -delta float(53) not null, \ -createtime integer not null, \ -filler char(24));" -#endif - -#define TTAccountCrTblStmt "create table accounts \ -(number integer not null primary key, \ -branchnum integer not null, \ -balance float(53) not null, \ -filler char(80)) unique hash on (number) pages = %" PTRINT_FMT ";" - -#define TTTellerCrTblStmt "create table tellers \ -(number integer not null primary key, \ -branchnum integer not null, \ -balance float(53) not null, \ -filler char(80)) unique hash on (number) pages = %" PTRINT_FMT ";" - -#define TTBranchCrTblStmt "create table branches \ -(number integer not null primary key, \ -balance float(53) not null, \ -filler char(84)) unique hash on (number) pages = %" PTRINT_FMT ";" - - -/* Insertion statements used to populate the tables */ - -#define NumInsStmts 3 -char* insStmt[NumInsStmts] = { - "insert into branches values (?, 0.0, NULL)", - "insert into tellers values (?, ?, 0.0, NULL)", - "insert into accounts values (?, ?, 0.0, NULL)" -}; - -/* Transaction statements used to update the tables */ - -#define NumXactStmts 5 - -#ifdef NDB -char* tpcbXactStmt[NumXactStmts] = { - "update accounts \ -set balance = balance + ? \ -where number = ?", - - "select balance \ -from accounts \ -where number = ?", - - "update tellers \ -set balance = balance + ? \ -where number = ?", - - "update branches \ -set balance = balance + ? \ -where number = ?", - - "insert into History(tellernum, branchnum, \ -accountnum, delta, createtime, filler) \ -values (?, ?, ?, ?, ?, NULL)" -}; - -#else -char* tpcbXactStmt[NumXactStmts] = { - "update accounts \ -set balance = balance + ? \ -where number = ?;", - - "select balance \ -from accounts \ -where number = ?;", - - "update tellers \ -set balance = balance + ? \ -where number = ?;", - - "update branches \ -set balance = balance + ? \ -where number = ?;", - - "insert into History \ -values (?, ?, ?, ?, ?, NULL);" -}; - - -#endif - -/* Global parameters and flags (typically set by parse_args()) */ - -int tabFlag = 0; /* Default is NOT tab output mode */ -char szConnStrIn[CONN_STR_LEN]; /* ODBC Connection String */ -int printXactTimes = 0; /* Transaction statistics - * gathering flag */ -char statFile[FILENAME_MAX]; /* Transaction statistics filename */ -int scaleFactor = 2; /* Default TPS scale factor */ -int numBranchTups; /* Number of branches */ -int numTellerTups; /* Number of tellers */ -int numAccountTups; /* Number of accounts */ -int numNonLocalAccountTups; /* Number of local accounts */ -int numXacts = NumXacts; /* Default number of transactions */ -int verbose = VERBOSE_DFLT; /* Verbose level */ -FILE *statusfp; /* File for status messages */ - - - -int DBMSType; /* DBMS type (DBMS_TIMESTEN, DBMS_MSSQL...) */ - - -SQLHENV henv; /* Environment handle */ - - - - - - - -void handle_errors( SQLHDBC hdbc, SQLHSTMT hstmt, int errcode, int action, char * msg, - char * file, int line) { - - if (errcode == SQL_SUCCESS) - return; - - if(errcode == SQL_ERROR) { - int ret; - long diagCount=0; - short length=0; - SQLCHAR state[10] = ""; - SQLCHAR message[200] = ""; - long native = 0; - if(hstmt != 0) { - ret = SQLGetDiagField(SQL_HANDLE_STMT, hstmt, 0, SQL_DIAG_NUMBER, &diagCount, SQL_IS_INTEGER, 0); - - for(long i = 0; i < diagCount; i++) { - ret = SQLGetDiagRec(SQL_HANDLE_STMT, hstmt, i, (SQLCHAR*)state, &native, (SQLCHAR*)message, 200, &length); - ndbout_c("GetDiagRec: Message : %s ", message); - } - } - } - - if(errcode != SQL_SUCCESS) { - ndbout_c("Message: %s", msg); - switch(errcode) { - case SQL_SUCCESS_WITH_INFO: - ndbout_c("SQL_SUCCESS_WITH_INFO"); - break; - case SQL_STILL_EXECUTING: - ndbout_c("SQL_STILL_EXECUTING"); - break; - case SQL_ERROR: - ndbout_c("SQL_ERROR"); - break; - case SQL_INVALID_HANDLE: - ndbout_c("SQL_INVALID_HANDLE"); - break; - default: - ndbout_c("Some other error"); - } - exit(1); - } - - -} - - - - - -/********************************************************************* - * FUNCTION: usage - * - * DESCRIPTION: This function prints a usage message describing - * the command line options of the program. - * - * PARAMETERS: char* prog full program path name - * - * RETURNS: void - * - * NOTES: NONE - * - *********************************************************************/ - -static void usage(char *prog) -{ - char *progname; - - /* Get the name of the program (sans path). */ - -#ifdef WIN32 - progname = strrchr(prog, '\\'); -#else - progname = strrchr(prog, '/'); -#endif - if (progname == 0) - progname = prog; - else - ++progname; - - /* Print the usage message */ - - fprintf(stderr, - "Usage:\t%s [-h] [-help] [-V] [-connStr ] [-v ]\n" - "\t\t[-xact ] [-scale ] [-tabs] [-s ]\n\n" - " -h Prints this message and exits.\n" - " -help Same as -h.\n" - " -V Prints version number and exits.\n" - " -connStr Specifies an ODBC connection string to replace the\n" - " default DSN for the program. The default is\n" - " \"DSN=TpcbData;OverWrite=1\".\n" - " -v Verbose level\n" - " 0 = errors only\n" - " 1 = results only\n" - " 2 = results and some status messages (default)\n" - " 3 = all messages\n" - " -xact Specifies the number of transactions to be run\n" - " The default is 25000 transactions.\n" - " -scale Specifies a scale factor which determines the\n" - " number of branches (scale), tellers (scale x 10),\n" - " accounts (scale x 10000) and non-local accounts\n" - " ((scale-1) x 10000. The default scale factor is 2.\n" - " -tabs Specifies that the output be a tab-separated\n" - " format suitable for import into a spreadsheet.\n" - " Results only go to stdout; status and other\n" - " messages go to stderr.\n" - " -s Prints individual transaction times to .\n", - progname); -} - -/********************************************************************* - * - * FUNCTION: parse_args - * - * DESCRIPTION: This function parses the command line arguments - * passed to main(), setting the appropriate global - * variables and issuing a usage message for - * invalid arguments. - * - * PARAMETERS: int argc # of arguments from main() - * char *argv[] arguments from main() - * - * RETURNS: void - * - * NOTES: NONE - * - *********************************************************************/ - -void -parse_args(int argc, char *argv[]) -{ - int i = 1; - - *szConnStrIn = 0; - - while (i < argc) { - - if ( !strcmp(argv[i], "-h") || !strcmp(argv[i], "-help") ) { - usage(argv[0]); - app_exit(0); - } - /* - if (!strcmp(argv[i], "-V")) { - printf("%s\n", TTVERSION_STRING); - app_exit(0); - } - */ - if (strcmp(argv[i], "-s") == 0) { - if (argc < i+2 ) { - usage(argv[0]); - app_exit(1); - } - if (sscanf(argv[i+1], "%s", statFile) == 0) { - usage(argv[0]); - app_exit(1); - } - printXactTimes = 1; - i += 2; - } - else if (!strcmp(argv[i], "-connStr")) { - if (argc < i+2 ) { - usage(argv[0]); - app_exit(1); - } - strcpy(szConnStrIn, argv[i+1]); - i += 2; - continue; - } - else if (strcmp("-v", argv[i]) == 0) { - if (argc < i+2 ) { - usage(argv[0]); - app_exit(1); - } - if (sscanf(argv[i+1], "%d", &verbose) == -1 || - verbose < 0 || verbose > 3) { - fprintf(stderr, "-v flag requires an integer parameter (0-3)\n"); - usage(argv[0]); - app_exit(1); - } - i += 2; - } - else if (strcmp("-xact",argv[i]) == 0) { - if (argc < i+2 ) { - usage(argv[0]); - app_exit(1); - } - - if (sscanf(argv[i+1], "%" PTRINT_FMT, &numXacts) == -1 || numXacts < 0) { - fprintf(stderr, "-xact flag requires a non-negative integer argument\n"); - usage(argv[0]); - app_exit(1); - } - - i += 2; - } - else if (strcmp("-scale",argv[i]) == 0) { - if (argc < i+2 ) { - usage(argv[0]); - app_exit(1); - } - if (sscanf(argv[i+1], "%d", &scaleFactor) == -1 || scaleFactor < 1) { - fprintf(stderr, "-scale flag requires an integer argument >= 1\n"); - usage(argv[0]); - app_exit(1); - } - /* Calculate tuple sizes */ - numBranchTups = NumBranches * scaleFactor; - numTellerTups = TellersPerBranch * scaleFactor; - numAccountTups = AccountsPerBranch * scaleFactor; - numNonLocalAccountTups = AccountsPerBranch * (scaleFactor-1); - i += 2; - } - else if (strcmp("-tabs",argv[i]) == 0) { - tabFlag = 1; - statusfp = stderr; - i += 1; - } - else { - usage(argv[0]); - app_exit(1); - } - } -} - -/********************************************************************* - * - * FUNCTION: doImmed - * - * DESCRIPTION: This function executes and frees the specified - * statement. It is used as a direct means to - * create the tables used by this benchmark, - * - * PARAMETERS: SQLHDBC hdbc SQL Connection handle - * SQLHSTMT hs SQL Statement handle - * char* cmd SQL Statement text - * - * RETURNS: void - * - * NOTES: NONE - * - *********************************************************************/ - -void -doImmed(SQLHDBC hdbc, SQLHSTMT hs, char* cmd) -{ - SQLRETURN rc; - - /* Execute the command */ - - rc = SQLExecDirect(hs, (SQLCHAR *) cmd, SQL_NTS); - handle_errors(hdbc, hs, rc, ABORT_DISCONNECT_EXIT, - "Error executing statement", __FILE__, __LINE__); - - /* Close associated cursor and drop pending results */ - - rc = SQLFreeStmt(hs, SQL_CLOSE); - handle_errors(hdbc, hs, rc, ABORT_DISCONNECT_EXIT, - "closing statement handle", - __FILE__, __LINE__); - -} - - -/********************************************************************* - * - * FUNCTION: main - * - * DESCRIPTION: This is the main function of the tpcb benchmark. - * It connects to an ODBC data source, creates and - * populates tables, updates the tables in a user- - * specified number of transactions and reports on - * on the transaction times. - * - * PARAMETERS: int argc # of command line arguments - * char *argv[] command line arguments - * - * RETURNS: void - * - * NOTES: NONE - * - *********************************************************************/ - -int -main(int argc, char *argv[]) -{ - - /* variables used for setting up the tables */ - - char cmdStr[1024]; - char errstr[4096]; - - /* variables used during transactions */ - - int accountNum; - int tellerNum; - int branchNum; - int timeStamp; - double delta; - unsigned int lrand; - unsigned short *srands, localLimit; - int lp64; - - /* variables used for timing and statistics */ - - int warmup; - double kernel, user, real; - ttThreadTimes startRes, endRes; - ttWallClockTime startT, endT; - ttWallClockTime** rtStart; - ttWallClockTime** rtEnd; - double** resTime; - double maxTime, totTime; - int i; - int j; - int numLocalXacts=0, numRemoteXacts=0; - - /* variables for ODBC */ - - SQLHDBC hdbc; - SQLHSTMT hstmt; - SQLHSTMT txstmt[NumXactStmts]; - SQLRETURN rc; - char DBMSName[32]; - char DBMSVersion[32]; - int databaseSize; - - int fThreadTime = 1; - -#ifdef WIN32 - OSVERSIONINFO sysInfo; - - sysInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); - GetVersionEx (&sysInfo); - - /* GetThreadTimes is not supported on 95/98. Hence, - we do not support Resource/User/System times */ - if (sysInfo.dwPlatformId != VER_PLATFORM_WIN32_NT) - fThreadTime = 0; -#endif -#if defined(TTCLIENTSERVER) && defined(__hpux) && !defined(__LP64__) - /* HP requires this for C main programs that call aC++ shared libs */ - _main(); -#endif /* hpux32 */ - - /* Set up default signal handlers */ - -#ifndef NDB - /* StopRequestClear(); - if (HandleSignals() != 0) { - err_msg0("Unable to set signal handlers\n"); - return 1; - } - */ -#endif - /* set IO mode for demo */ - /* set_io_mode(); */ - - /* initialize the file for status messages */ - statusfp = stdout; - - /* set variable for 8-byte longs */ - lp64 = (sizeof(lrand) == 8); - - /* set the default tuple sizes */ - - numBranchTups = NumBranches * scaleFactor; - numTellerTups = TellersPerBranch * scaleFactor; - numAccountTups = AccountsPerBranch * scaleFactor; - numNonLocalAccountTups = AccountsPerBranch * (scaleFactor-1); - - /* parse the command arguments */ - parse_args(argc, argv); - - /* allocate the transaction-based variables */ - - rtStart = (ttWallClockTime**) malloc(numXacts * sizeof(ttWallClockTime*)); - if (!rtStart) { - err_msg0("Cannot allocate the transaction timing structures"); - app_exit(1); - } - for (i = 0; i < numXacts; i++) { - rtStart[i] = (ttWallClockTime*) malloc(sizeof(ttWallClockTime)); - if (!rtStart[i]) { - err_msg0("Cannot allocate the transaction timing structures"); - app_exit(1); - } - } - - rtEnd = (ttWallClockTime**) malloc(numXacts * sizeof(ttWallClockTime*)); - if (!rtEnd) { - err_msg0("Cannot allocate the transaction timing structures"); - app_exit(1); - } - for (i = 0; i < numXacts; i++) { - rtEnd[i] = (ttWallClockTime*) malloc(sizeof(ttWallClockTime)); - if (!rtEnd[i]) { - err_msg0("Cannot allocate the transaction timing structures"); - app_exit(1); - } - } - - resTime = (double**) malloc(numXacts * sizeof(double*)); - if (!resTime) { - err_msg0("Cannot allocate the transaction timing structures"); - app_exit(1); - } - for (i = 0; i < numXacts; i++) { - resTime[i] = (double*) malloc(sizeof(double)); - if (!resTime[i]) { - err_msg0("Cannot allocate the transaction timing structures"); - app_exit(1); - } - } - - /* ODBC initialization */ - - rc = SQLAllocEnv(&henv); - if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) { - /* error occurred -- don't bother calling handle_errors, since handle - * is not valid so SQLError won't work */ - err_msg3("ERROR in %s, line %d: %s\n", - __FILE__, __LINE__, "allocating an environment handle"); - app_exit(1); - } - SQLSetEnvAttr(henv, SQL_ATTR_ODBC_VERSION, (SQLPOINTER)SQL_OV_ODBC3, SQL_IS_INTEGER); - - /* call this in case of warning */ - handle_errors(NULL, NULL, rc, NO_EXIT, - "allocating execution environment", - __FILE__, __LINE__); - - rc = SQLAllocConnect(henv, &hdbc); - handle_errors(NULL, NULL, rc, ERROR_EXIT, - "allocating connection handle", - __FILE__, __LINE__); - - /* Connect to data store */ - - status_msg0("Connecting to the data source...\n"); - - /* Set up the connection options if not specified on the command line - * (default to TimesTen settings). - */ - - if ( !*szConnStrIn ) { - /* Running the benchmark with a scale factor creates (scale) branches, - * (scale x 10) tellers, (scale x 10000) accounts and ((scale-1) x 10000) - * non-local accounts. The size of the table rows are branches (141) - * tellers (141) and accounts (141). Therefore the data size requirements - * of this benchmark is: - * size ~= 141 * ((scale * 20011) - 10000) (bytes) - * - * Multiply data size by 20% to account for additional DB overhead (e.g. - * indexes), and round up the nearest 10Mb for safety. - */ - - int est_size = (int) (3.6 * scaleFactor + 10.0); - est_size = est_size - (est_size % 10); - - sprintf(szConnStrIn,"OverWrite=1;PermSize=%d;%s", - est_size, DSNNAME); - status_msg0("Connecting to the data source... %s \n", szConnStrIn); - } - - rc = SQLDriverConnect(hdbc, NULL, (SQLCHAR *) szConnStrIn, SQL_NTS, - NULL, 0, NULL, - SQL_DRIVER_NOPROMPT); - - status_msg0("Connected to the data source...\n"); - sprintf(errstr, "connecting to driver (connect string %s)\n", - szConnStrIn); - handle_errors(hdbc, NULL, rc, ERROR_EXIT, - errstr, __FILE__, __LINE__); - - /* Turn auto-commit off */ - - rc = SQLSetConnectOption(hdbc, SQL_AUTOCOMMIT, SQL_AUTOCOMMIT_OFF); - handle_errors(hdbc, NULL, rc, DISCONNECT_EXIT, - "switching off the AUTO_COMMIT option", - __FILE__, __LINE__); - - /* Allocate a statement handle */ - - rc = SQLAllocStmt(hdbc, &hstmt); - handle_errors(hdbc, NULL, rc, DISCONNECT_EXIT, - "allocating a statement handle", - __FILE__, __LINE__); - - /* (Implicit) Transaction begin */ - - /* Determine the DBMS Type*/ - - DBMSName[0] = '\0'; - rc = SQLGetInfo(hdbc, SQL_DBMS_NAME, (PTR) &DBMSName, - sizeof(DBMSName), NULL); - rc = SQLGetInfo(hdbc, SQL_DRIVER_VER, (PTR) &DBMSVersion, - sizeof(DBMSVersion), NULL); - - if (strcmp(DBMSName, "TimesTen") == 0) - DBMSType = DBMS_TIMESTEN; - else if (strcmp(DBMSName, "Microsoft SQL Server") == 0) - DBMSType = DBMS_MSSQL; - else DBMSType = DBMS_UNKNOWN; - - /* if not TimesTen: delete (if it exists), create & use the new database */ - - if (DBMSType != DBMS_TIMESTEN) { - status_msg0("Deleting the database...\n"); - rc = SQLExecDirect(hstmt, (SQLCHAR *) DatabaseDropStmt, SQL_NTS); - - /* estimate database size, size = data space + log space - * data space = (#tuples)/(tuples per page) * 2K bytes/page - * tuples per page = useable page size / row size (no index) = 2016/(96+2) - * log space = #transactions * average log size for the program transaction mix - * database size is in MB - */ - - databaseSize = (int) ceil((((numBranchTups + numTellerTups + numAccountTups)/ - (2016/98)) * 2048 + (numXacts * 600)) / 1000000.0); - - status_msg1("Creating the database (%dMB)...\n", databaseSize); -#ifndef NDB - sprintf(cmdStr, DatabaseCreateStmt, databaseSize); - doImmed(hdbc, hstmt, cmdStr); - strcpy(cmdStr, DatabaseUseStmt); - doImmed(hdbc, hstmt, cmdStr); -#endif - } - - status_msg2("Connected to '%s' version '%s'...\n", DBMSName, DBMSVersion); - - /* create branches table */ - status_msg0("Creating tasddbles...\n"); -#ifndef NDB - if (DBMSType == DBMS_TIMESTEN) - sprintf(cmdStr, TTBranchCrTblStmt, numBranchTups/TuplesPerPage + 1); - else -#endif - sprintf(cmdStr, BranchCrTblStmt); - doImmed(hdbc, hstmt, cmdStr); - - /* create tellers table */ -#ifndef NDB - if (DBMSType == DBMS_TIMESTEN) - sprintf(cmdStr, TTTellerCrTblStmt, numTellerTups/TuplesPerPage + 1); - - else -#endif - sprintf(cmdStr, TellerCrTblStmt); - doImmed(hdbc, hstmt, cmdStr); - - /* create accounts table */ -#ifndef NDB - if (DBMSType == DBMS_TIMESTEN) - sprintf(cmdStr, TTAccountCrTblStmt, numAccountTups/TuplesPerPage + 1); - else -#endif - sprintf(cmdStr, AccountCrTblStmt); - doImmed(hdbc, hstmt, cmdStr); - - /* create History table */ - - doImmed(hdbc, hstmt, HistoryCrTblStmt); - - /* lock the database during population */ -#ifndef NDB - if ( DBMSType == DBMS_TIMESTEN ) { - rc = SQLExecDirect(hstmt, (SQLCHAR *)"call ttlocklevel('DS')", SQL_NTS); - handle_errors(hdbc, hstmt, rc, ABORT_DISCONNECT_EXIT, - "specifying dbs lock usage", - __FILE__, __LINE__); - /* make sure dbs lock take effect in next transaction */ - rc = SQLTransact(henv,hdbc,SQL_COMMIT); - if ( rc != SQL_SUCCESS) { - handle_errors(hdbc, SQL_NULL_HSTMT, rc, ERROR_EXIT, - "committing transaction", - __FILE__, __LINE__); - } - } -#endif - /* populate branches table */ - - - rc = SQLPrepare(hstmt, (SQLCHAR *) insStmt[0], SQL_NTS); - handle_errors(hdbc, hstmt, rc, ABORT_DISCONNECT_EXIT, - "preparing statement", - __FILE__, __LINE__); - - rc = SQLBindParameter(hstmt, 1, SQL_PARAM_INPUT, SQL_C_SLONG, SQL_INTEGER, 10, 0, &branchNum, sizeof branchNum, NULL); - - handle_errors(hdbc, hstmt, rc, ABORT_DISCONNECT_EXIT, - "binding parameter", - __FILE__, __LINE__); - - - status_msg1("Populating branches table (%" PTRINT_FMT " rows)...\n", - numBranchTups); - - - for (i=0; i= 0; warmup--) { - - int max_i = (warmup ? numXacts/10 : numXacts); - - /* Execute tpcb transaction max_i times.*/ - - if (warmup) { - status_msg1("\nWarming up with %d tpcb transactions...\n", max_i); - } - else { - status_msg1("Executing and timing %d tpcb transactions...\n", max_i); - } - - ttGetWallClockTime(&startT); - ttGetThreadTimes(&startRes); - - for (i = 0; i < max_i; i++) { - - lrand = lrand48(); - srands = (unsigned short *)(&lrand); - if (lp64) srands += 2; /* skip high half -- all zero */ - - /* randomly choose a teller */ - - tellerNum = srands[0] % numTellerTups; - - /* compute branch */ - - branchNum = (tellerNum / TellersPerBranch); - - /* randomly choose an account */ - - if (srands[1] < localLimit || numBranchTups == 1) { - - /* choose account local to selected branch */ - - accountNum = branchNum * AccountsPerBranch + - (lrand48() % AccountsPerBranch); - - ++numLocalXacts; - - } - else { - /* choose account not local to selected branch */ - - /* first select account in range [0,numNonLocalAccountTups) */ - - accountNum = lrand48() % numNonLocalAccountTups; - - /* if branch number of selected account is at least as big - * as local branch number, then increment account number - * by AccountsPerBranch to skip over local accounts - */ - - if ((accountNum/AccountsPerBranch) >= branchNum) - accountNum += AccountsPerBranch; - - ++numRemoteXacts; - } - - /* select delta amount, -999,999 to +999,999 */ - - delta = ((lrand48() % 1999999) - 999999); - - - /* begin timing the "residence time" */ - - ttGetWallClockTime(rtStart[i]); - - for ( j = 0; j < NumXactStmts - 2; j++) { - rc = SQLExecute(txstmt[j]); - handle_errors(hdbc, txstmt[j], rc, ABORT_DISCONNECT_EXIT, - "Error executing statement1", - __FILE__, __LINE__); - - /* Close the handle after the SELECT statement - * (txstmt[1]) for non TimesTen DBMS' */ - - if ((DBMSType != DBMS_TIMESTEN) && (j == 1)) { - SQLFreeStmt(txstmt[1], SQL_CLOSE); - } - - - } - - /* note that time must be taken within the */ - timeStamp = time(NULL); - - rc = SQLExecute(txstmt[NumXactStmts - 1]); - handle_errors(hdbc, txstmt[NumXactStmts - 1], rc, - ABORT_DISCONNECT_EXIT, "Error executing statement2", - __FILE__, __LINE__); - - rc = SQLTransact(henv, hdbc, SQL_COMMIT); - handle_errors(hdbc, NULL, rc, ERROR_EXIT, - "Error committing transaction", - __FILE__, __LINE__); - - ttGetWallClockTime(rtEnd[i]); - - } /* end fortransaction loop */ - - - - - ttGetThreadTimes(&endRes); - ttGetWallClockTime(&endT); - ttCalcElapsedThreadTimes(&startRes, &endRes, &kernel, &user); - ttCalcElapsedWallClockTime(&startT, &endT, &real); - - if (warmup) { - if (!tabFlag) { - if (verbose) { - if (fThreadTime) { - out_msg0(" time user system\n"); - - out_msg3("Warmup time (sec): %12.3f %12.3f %12.3f\n\n", - real/1000.0, user, kernel); - } else { - out_msg1("Warmup time (sec): %12.3f\n\n", real/1000.0); - } - } - } else { - if (verbose) { - if (fThreadTime) { - out_msg0("\ttime\tuser\tsystem\n"); - - out_msg3("Warmup time (sec):\t%12.3f\t%12.3f\t%12.3f\n", - real/1000.0, user, kernel); - } else { - out_msg1("Warmup time (sec):\t%12.3f\n", real/1000.0); - } - } - } - } - } - - status_msg0("\nExecution completed...\n"); - - /* Compute and report timing statistics */ - - maxTime = 0.0; - totTime = 0.0; - - for (i = 0; i < numXacts; i++) { - ttCalcElapsedWallClockTime(rtStart[i], rtEnd[i], resTime[i]); - totTime += *(resTime[i]); - - if (*(resTime[i]) > maxTime) maxTime = *(resTime[i]); - } - - if (!tabFlag) { - if (verbose) { - if (fThreadTime) { - out_msg0(" time user system\n"); - out_msg3("Total time (sec): %12.3f %12.3f %12.3f\n", - real/1000.0, user, kernel); - } else { - out_msg1("Total time (sec): %12.3f\n", real/1000.0); - } - } - - if (verbose) - out_msg1("\nAverage transaction time (msec):%12.3f\n", - totTime/numXacts); - if (verbose) - out_msg1("Maximum transaction time (msec):%12.3f\n", maxTime); - if (verbose) - out_msg1("\nLocal transactions: %7" PTRINT_FMT "\n", numLocalXacts); - if (verbose) - out_msg1("Remote transactions: %7" PTRINT_FMT "\n", numRemoteXacts); - - } else { - if (verbose) { - if (fThreadTime) { - out_msg0("\ttime\tuser\tsystem\n"); - out_msg3("Total time (sec):\t%12.3f\t%12.3f\t%12.3f\n", - real/1000.0, user, kernel); - } else { - out_msg1("Total time (sec):\t%12.3f\n", real/1000.0); - } - } - - if (verbose) - out_msg1("\nAverage transaction time (msec):\t%12.3f\n", - totTime/numXacts); - if (verbose) - out_msg1("Maximum transaction time (msec):\t%12.3f\n", maxTime); - if (verbose) - out_msg1("Local transactions:\t%7" PTRINT_FMT "\n", numLocalXacts); - - if (verbose) - out_msg1("Remote transactions:\t%7" PTRINT_FMT "\n", numRemoteXacts); - - - - } - - /* If the statfile option is selected, print each transaction's time */ - - if (printXactTimes) { - FILE * fp; - if ( (fp = fopen (statFile, "w")) == NULL ) { - err_msg1("Unable to open stat file %s for writing\n\n", statFile); - } else { - for (int i = 0; i < numXacts; i++) - fprintf(fp,"%6d: %12.3f\n", i, *(resTime[i])); - fclose(fp); - } - } - - /* Disconnect and return */ - - rc = SQLFreeStmt(hstmt, SQL_DROP); - handle_errors(hdbc, hstmt, rc, ABORT_DISCONNECT_EXIT, - "dropping the statement handle", - __FILE__, __LINE__); - - for (int i=0; i= VERBOSE_DFLT) - status_msg0("Disconnecting from the data source...\n"); - - rc = SQLDisconnect(hdbc); - handle_errors(hdbc, NULL, rc, ERROR_EXIT, - "disconnecting", - __FILE__, __LINE__); - - rc = SQLFreeConnect(hdbc); - handle_errors(hdbc, NULL, rc, ERROR_EXIT, - "freeing connection handle", - __FILE__, __LINE__); - - rc = SQLFreeEnv(henv); - handle_errors(NULL, NULL, rc, ERROR_EXIT, - "freeing environment handle", - __FILE__, __LINE__); - - app_exit(0); - return 0; -} - - - - - -/* Emacs variable settings */ -/* Local Variables: */ -/* tab-width:8 */ -/* indent-tabs-mode:nil */ -/* c-basic-offset:2 */ -/* End: */ - - - diff --git a/ndb/test/odbc/tpcb/ttTime.c b/ndb/test/odbc/tpcb/ttTime.c deleted file mode 100644 index 8f10b0c6b91..00000000000 --- a/ndb/test/odbc/tpcb/ttTime.c +++ /dev/null @@ -1,366 +0,0 @@ -/* Copyright (C) 2003 MySQL AB - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - -static const volatile char cvsid[] = "$Id: ttTime.c,v 1.1 2003/09/23 12:43:46 johan Exp $"; -/* - * $Revision: 1.1 $ - * (c) Copyright 1996-2003, TimesTen, Inc. - * All rights reserved. - * - */ - - -/* Contains functions for performing elapsed-time calculations - in a portable manner */ - -#include "ttTime.h" - -#ifdef WIN32 - -#include -#include - -/*------------*/ -/* NT VERSION */ -/*------------*/ - -/********************************************************************* - * - * FUNCTION: ttGetThreadTimes - * - * DESCRIPTION: This function sets the supplied parameter's - * user and kernel time for the current thread. - * - * PARAMETERS: ttThreadTimes* timesP thread time structure - * - * RETURNS: void - * - * NOTES: NONE - * - *********************************************************************/ - -void -ttGetThreadTimes(ttThreadTimes* timesP) -{ - BOOL rc; - HANDLE curThread; - FILETIME creationTime; - FILETIME exitTime; - FILETIME kTime; - FILETIME uTime; - - memset (&kTime, 0, sizeof (FILETIME)); - memset (&uTime, 0, sizeof (FILETIME)); - - curThread = GetCurrentThread(); - rc = GetThreadTimes(curThread, - &creationTime, - &exitTime, - &kTime, - &uTime); - - timesP->kernelTime = kTime; - timesP->userTime = uTime; - -} - -/********************************************************************* - * - * FUNCTION: ttCalcElapsedThreadTimes - * - * DESCRIPTION: This function calculates the user and kernel - * time deltas. - * - * PARAMETERS: ttThreadTimes* beforeP beginning timestamp (IN) - * ttThreadTimes* afterP ending timestamp (IN) - * double* kernelDeltaP kernel time delta (OUT) - * double* userDeltaP user time delta (OUT) - * - * RETURNS: void - * - * NOTES: NONE - * - *********************************************************************/ - -void -ttCalcElapsedThreadTimes(ttThreadTimes* beforeP, - ttThreadTimes* afterP, - double* kernelDeltaP, - double* userDeltaP) -{ - static const double secPerHi = (double) 4.294967296; /* 2**32 * 10**-9 */ - FILETIME *before, *after; - - before = &beforeP->kernelTime; - after = &afterP->kernelTime; - *kernelDeltaP = (double) ((after->dwHighDateTime - before->dwHighDateTime) * secPerHi - + (after->dwLowDateTime - before->dwLowDateTime) * 100e-9); - before = &beforeP->userTime; - after = &afterP->userTime; - *userDeltaP = (double) ((after->dwHighDateTime - before->dwHighDateTime) * secPerHi - + (after->dwLowDateTime - before->dwLowDateTime) * 100e-9); -} - -/********************************************************************* - * - * FUNCTION: ttGetWallClockTime - * - * DESCRIPTION: This function gets the current wall-clock time. - * - * PARAMETERS: ttWallClockTime* timeP tms time structure (OUT) - * - * RETURNS: void - * - * NOTES: NONE - * - *********************************************************************/ - -void -ttGetWallClockTime(ttWallClockTime* timeP) -{ - LARGE_INTEGER frequency; - if ( QueryPerformanceFrequency(&frequency) ) { - QueryPerformanceCounter(&(timeP->time64)); - } - else { - _ftime(&(timeP->notSoLargeTime)); - } -} - -/********************************************************************* - * - * FUNCTION: ttCalcElapsedWallClockTime - * - * DESCRIPTION: This function calculates the elapsed wall-clock - * time in msec. - * - * PARAMETERS: ttWallClockTime* beforeP starting timestamp - * ttWallClockTime* afterP ending timestamp - * double* nmillisecondsP elapsed time (OUT) - * - * RETURNS: void - * - * NOTES: NONE - * - *********************************************************************/ - -void -ttCalcElapsedWallClockTime(ttWallClockTime* beforeP, - ttWallClockTime* afterP, - double* nmillisecondsP) -{ - LARGE_INTEGER frequency; - - if ( QueryPerformanceFrequency(&frequency) ) { - *nmillisecondsP = 1000 * ((double) (afterP->time64.QuadPart - - beforeP->time64.QuadPart)) - / frequency.QuadPart; - - } - else { - double start; - double end; - - start = (double) beforeP->notSoLargeTime.time * 1000. + - (double) beforeP->notSoLargeTime.millitm; - end = (double) afterP->notSoLargeTime.time * 1000. + - (double) afterP->notSoLargeTime.millitm; - - *nmillisecondsP = (double) (end - start); - } -} - -#elif defined (RTSYS_VXWORKS) - -/*-----------------*/ -/* VxWorks VERSION */ -/*-----------------*/ - -/* - * The TimeBase registers have a period of 60ns, i.e. - * 0.00000006 or (6e-8) seconds. - */ -#define TIMER_MSEC_PER_CYC (6e-5) - -void -ttGetWallClockTime(ttWallClockTime* timeP) -{ - vxTimeBaseGet(&timeP->sep.upper32, &timeP->sep.lower32); -} - - -void -ttCalcElapsedWallClockTime(ttWallClockTime* beforeP, - ttWallClockTime* afterP, - double* nmillisecondsP) -{ - *nmillisecondsP = (double)(afterP->val - beforeP->val) * TIMER_MSEC_PER_CYC; -} - - -#else - -/*--------------*/ -/* UNIX VERSION */ -/*--------------*/ - -#include - -/********************************************************************* - * - * FUNCTION: ttGetThreadTimes - * - * DESCRIPTION: This function sets the supplied parameter's - * tms structure. - * - * PARAMETERS: ttThreadTimes* timesP tms time structure - * - * RETURNS: void - * - * NOTES: NONE - * - *********************************************************************/ - -#ifdef SB_P_OS_CHORUS -void ttGetThreadTimes(ttThreadTimes* timesP) -{ - KnCap actorCap; - - if (acap (agetId(), &actorCap) == -1) { - timesP->ins.tmSec = 0; - timesP->ins.tmNSec = 0; - timesP->ext.tmSec = 0; - timesP->ext.tmNSec = 0; - } - else { - (void) threadTimes (&actorCap, K_ALLACTORTHREADS, - ×P->ins, ×P->ext); - } -} -#else -void ttGetThreadTimes(ttThreadTimes* timesP) -{ - (void) times(timesP); -} -#endif - -/********************************************************************* - * - * FUNCTION: ttCalcElapsedThreadTimes - * - * DESCRIPTION: This function calculates the user and kernel - * time deltas. - * - * PARAMETERS: ttThreadTimes* beforeP beginning timestamp (IN) - * ttThreadTimes* afterP ending timestamp (IN) - * double* kernelDeltaP kernel time delta (OUT) - * double* userDeltaP user time delta (OUT) - * - * RETURNS: void - * - * NOTES: NONE - * - *********************************************************************/ - -#ifdef SB_P_OS_CHORUS -void -ttCalcElapsedThreadTimes(ttThreadTimes* beforeP, - ttThreadTimes* afterP, - double* kernelDeltaP, - double* userDeltaP) -{ - double kernelBefore; - double kernelAfter; - double userBefore; - double userAfter; - - kernelBefore = (beforeP->ext.tmSec) + (beforeP->ext.tmNSec / 1e9); - kernelAfter = (afterP->ext.tmSec) + (afterP->ext.tmNSec / 1e9); - *kernelDeltaP = kernelAfter - kernelBefore; - - userBefore = (beforeP->ins.tmSec) + (beforeP->ins.tmNSec / 1e9); - userAfter = (afterP->ins.tmSec) + (afterP->ins.tmNSec / 1e9); - *userDeltaP = userAfter - userBefore; - -} -#else -void -ttCalcElapsedThreadTimes(ttThreadTimes* beforeP, - ttThreadTimes* afterP, - double* kernelDeltaP, - double* userDeltaP) -{ - double ticks = (double)sysconf(_SC_CLK_TCK); - - *kernelDeltaP = (afterP->tms_stime - beforeP->tms_stime) / ticks; - *userDeltaP = (afterP->tms_utime - beforeP->tms_utime) / ticks; -} -#endif - -/********************************************************************* - * - * FUNCTION: ttGetWallClockTime - * - * DESCRIPTION: This function gets the current wall-clock time. - * - * PARAMETERS: ttWallClockTime* timeP tms time structure (OUT) - * - * RETURNS: void - * - * NOTES: NONE - * - *********************************************************************/ - -void -ttGetWallClockTime(ttWallClockTime* timeP) -{ - gettimeofday(timeP, NULL); -} - -/********************************************************************* - * - * FUNCTION: ttCalcElapsedWallClockTime - * - * DESCRIPTION: This function calculates the elapsed wall-clock - * time is msec. - * - * PARAMETERS: ttWallClockTime* beforeP starting timestamp - * ttWallClockTime* afterP ending timestamp - * double* nmillisecondsP elapsed time (OUT) - * - * RETURNS: void - * - * NOTES: NONE - * - *********************************************************************/ - -void -ttCalcElapsedWallClockTime(ttWallClockTime* beforeP, - ttWallClockTime* afterP, - double* nmillisP) -{ - *nmillisP = (afterP->tv_sec - beforeP->tv_sec)*1000.0 + - (afterP->tv_usec - beforeP->tv_usec)/1000.0; -} - -#endif - -/* Emacs variable settings */ -/* Local Variables: */ -/* tab-width:8 */ -/* indent-tabs-mode:nil */ -/* c-basic-offset:2 */ -/* End: */ diff --git a/ndb/test/odbc/tpcb/ttTime.h b/ndb/test/odbc/tpcb/ttTime.h deleted file mode 100644 index f78b71667fe..00000000000 --- a/ndb/test/odbc/tpcb/ttTime.h +++ /dev/null @@ -1,125 +0,0 @@ -/* Copyright (C) 2003 MySQL AB - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - -/* - * $Revision: 1.1 $ - * (c) Copyright 1996-2003, TimesTen, Inc. - * All rights reserved. - * - */ - -#ifndef __TT_TIME -#define __TT_TIME - - -#ifdef WIN32 - -#include -#include -#include - -typedef struct { - FILETIME kernelTime; - FILETIME userTime; -} ttThreadTimes; - - -typedef union { - LARGE_INTEGER time64; - struct _timeb notSoLargeTime; -} ttWallClockTime; - -#elif defined(RTSYS_VXWORKS) - -#define srand48(x) sb_srand48((x)) -#define drand48() sb_drand48() - -#ifdef SB_P_OS_VXPPC -/* For little-endian switch the lower, upper fields */ -typedef union { - struct { - unsigned int upper32; - unsigned int lower32; - } sep; - long long val; -} ttWallClockTime; - -/* - * This is a VxWorks private function to read the PPC's 64 bit Time Base - * Register. This is the assembler dump of this function. - 001126e4 7cad42e6 mftb r5, TBU - 001126e8 7ccc42e6 mftb r6, TBL - 001126ec 7ced42e6 mftb r7, TBU - 001126f0 7c053800 cmp crf0, 0, r5, r7 - 001126f4 4082fff0 bc 0x4, 0x2, vxTimeBaseGet - 001126f8 90a30000 stw r5, 0x0(r3) - 001126fc 90c40000 stw r6, 0x0(r4) - 00112700 4e800020 blr - * This is a fine grained timer with a period of 60ns. - */ -void vxTimeBaseGet(unsigned int* pUpper32, unsigned int* pLower32); -#endif /* SB_P_OS_VXPPC */ - -#elif defined(SB_P_OS_CHORUS) -#include -#include -#include - -#include - -struct chrTimes { - KnTimeVal ins; - KnTimeVal ext; -}; -typedef struct chrTimes ttThreadTimes; - -typedef struct timeval ttWallClockTime; - -#else -/* UNIX version */ - -#include -#include - -typedef struct tms ttThreadTimes; - -typedef struct timeval ttWallClockTime; - -#endif /* NT, VxWorks, Chorus, Unix */ - - -#ifndef RTSYS_VXWORKS -void ttGetThreadTimes(ttThreadTimes* timesP); -void ttCalcElapsedThreadTimes(ttThreadTimes* beforeP, ttThreadTimes* afterP, - double* kernelDeltaP, double* userDeltaP); -#endif /* ! VXWORKS */ -void ttGetWallClockTime(ttWallClockTime* timeP); -void ttCalcElapsedWallClockTime(ttWallClockTime* beforeP, - ttWallClockTime* afterP, - double* nmillisecondsP); - - - - - -#endif /* __TT_TIME */ - -/* Emacs variable settings */ -/* Local Variables: */ -/* tab-width:8 */ -/* indent-tabs-mode:nil */ -/* c-basic-offset:2 */ -/* End: */ From 3f07afbea005900c185a769ea23381f1bba0ef23 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 6 Nov 2004 09:37:30 +0400 Subject: [PATCH 0129/1063] A fix (bug #6441: Aggregate UDF in multi-table query crashes MySQL when returning multiple rows). sql/item_func.cc: A fix (bug #6441: Aggregate UDF in multi-table query crashes MySQL when returning multiple rows). Do nothing in the udf_handler destructor if not_original flag is set. sql/item_sum.h: A fix (bug #6441: Aggregate UDF in multi-table query crashes MySQL when returning multiple rows). Set udf.not_original flag if we create an Item from the existent one. sql/sql_udf.h: A fix (bug #6441: Aggregate UDF in multi-table query crashes MySQL when returning multiple rows). not_original flag added. --- sql/item_func.cc | 19 +++++++++++-------- sql/item_sum.h | 2 +- sql/sql_udf.h | 3 ++- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/sql/item_func.cc b/sql/item_func.cc index 09d7e50eaa3..32708ecb4ca 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -1602,18 +1602,21 @@ longlong Item_func_bit_count::val_int() udf_handler::~udf_handler() { - if (initialized) + if (!not_original) { - if (u_d->func_deinit != NULL) + if (initialized) { - void (*deinit)(UDF_INIT *) = (void (*)(UDF_INIT*)) - u_d->func_deinit; - (*deinit)(&initid); + if (u_d->func_deinit != NULL) + { + void (*deinit)(UDF_INIT *) = (void (*)(UDF_INIT*)) + u_d->func_deinit; + (*deinit)(&initid); + } + free_udf(u_d); } - free_udf(u_d); + if (buffers) // Because of bug in ecc + delete [] buffers; } - if (buffers) // Because of bug in ecc - delete [] buffers; } diff --git a/sql/item_sum.h b/sql/item_sum.h index 5aa0d37190b..74c28765f8d 100644 --- a/sql/item_sum.h +++ b/sql/item_sum.h @@ -532,7 +532,7 @@ public: :Item_sum( list ), udf(udf_arg) { quick_group=0;} Item_udf_sum(THD *thd, Item_udf_sum *item) - :Item_sum(thd, item), udf(item->udf) {} + :Item_sum(thd, item), udf(item->udf) { udf.not_original= TRUE; } const char *func_name() const { return udf.name(); } bool fix_fields(THD *thd, TABLE_LIST *tables, Item **ref) { diff --git a/sql/sql_udf.h b/sql/sql_udf.h index 7b10b80f148..d1f99a6d232 100644 --- a/sql/sql_udf.h +++ b/sql/sql_udf.h @@ -56,8 +56,9 @@ class udf_handler :public Sql_alloc public: table_map used_tables_cache; bool const_item_cache; + bool not_original; udf_handler(udf_func *udf_arg) :u_d(udf_arg), buffers(0), error(0), - is_null(0), initialized(0) + is_null(0), initialized(0), not_original(0) {} ~udf_handler(); const char *name() const { return u_d ? u_d->name.str : "?"; } From 9bd7def36943eca0be244a5da30d9a007f8aa935 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 5 Nov 2004 22:15:24 -0800 Subject: [PATCH 0130/1063] join_outer.result, join_outer.test: Added cases for bugs #6307 and #6460. sql_select.cc: Fixed the problem of bug reports #6307 and #6460. The reported wrong result sets were due to the fact that the added call of the fix_fields method for the built AND condition that joined WHERE and ON conditions broke ON expression, as it removed extra AND levels in the built condition. It looks like that no attributes of the built condition are needed, so we don't have to call fix_fields here. sql/sql_select.cc: Fixed the problem of bug report #6307 and #6460. The reported wrong result sets were due to the fact that the added call of the fix_fields method for the built AND condition that joined WHERE and ON conditions broke ON expression. It looks like that no attributes of the built condition are needed, so we don't have to call fix_fields here. mysql-test/t/join_outer.test: Added cases for bugs #6307 and #6460. mysql-test/r/join_outer.result: Added cases for bugs #6307 and #6460. --- mysql-test/r/join_outer.result | 65 +++++++++++++++++++++++++++++ mysql-test/t/join_outer.test | 76 ++++++++++++++++++++++++++++++++++ sql/sql_select.cc | 11 ++++- 3 files changed, 151 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/join_outer.result b/mysql-test/r/join_outer.result index 75bf96cb401..c045aa0d00a 100644 --- a/mysql-test/r/join_outer.result +++ b/mysql-test/r/join_outer.result @@ -751,3 +751,68 @@ player_id match_1_h * match_id home UUX 7 4 * 1 2 2 3 3 * 1 2 1 drop table t1, t2; +create table t1 (a int, b int, unique index idx (a, b)); +create table t2 (a int, b int, c int, unique index idx (a, b)); +insert into t1 values (1, 10), (1,11), (2,10), (2,11); +insert into t2 values (1,10,3); +select t1.a, t1.b, t2.c from t1 left join t2 +on t1.a=t2.a and t1.b=t2.b and t2.c=3 +where t1.a=1 and t2.c is null; +a b c +1 11 NULL +drop table t1, t2; +CREATE TABLE t1 ( +ts_id bigint(20) default NULL, +inst_id tinyint(4) default NULL, +flag_name varchar(64) default NULL, +flag_value text, +UNIQUE KEY ts_id (ts_id,inst_id,flag_name) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +CREATE TABLE t2 ( +ts_id bigint(20) default NULL, +inst_id tinyint(4) default NULL, +flag_name varchar(64) default NULL, +flag_value text, +UNIQUE KEY ts_id (ts_id,inst_id,flag_name) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +INSERT INTO t1 VALUES +(111056548820001, 0, 'flag1', NULL), +(111056548820001, 0, 'flag2', NULL), +(2, 0, 'other_flag', NULL); +INSERT INTO t2 VALUES +(111056548820001, 3, 'flag1', 'sss'); +SELECT t1.flag_name,t2.flag_value +FROM t1 LEFT JOIN t2 +ON (t1.ts_id = t2.ts_id AND t1.flag_name = t2.flag_name AND +t2.inst_id = 3) +WHERE t1.inst_id = 0 AND t1.ts_id=111056548820001 AND +t2.flag_value IS NULL; +flag_name flag_value +flag2 NULL +DROP TABLE t1,t2; +CREATE TABLE invoice ( +id int(11) unsigned NOT NULL auto_increment, +text_id int(10) unsigned default NULL, +PRIMARY KEY (id) +); +INSERT INTO invoice VALUES("1", "0"); +INSERT INTO invoice VALUES("2", "10"); +CREATE TABLE text_table ( +text_id char(3) NOT NULL default '', +language_id char(3) NOT NULL default '', +text_data text, +PRIMARY KEY (text_id,language_id) +); +INSERT INTO text_table VALUES("0", "EN", "0-EN"); +INSERT INTO text_table VALUES("0", "SV", "0-SV"); +INSERT INTO text_table VALUES("10", "EN", "10-EN"); +INSERT INTO text_table VALUES("10", "SV", "10-SV"); +SELECT invoice.id, invoice.text_id, text_table.text_data +FROM invoice LEFT JOIN text_table +ON invoice.text_id = text_table.text_id +AND text_table.language_id = 'SV' + WHERE (invoice.id LIKE '%' OR text_table.text_data LIKE '%'); +id text_id text_data +1 0 0-SV +2 10 10-SV +DROP TABLE invoice, text_table; diff --git a/mysql-test/t/join_outer.test b/mysql-test/t/join_outer.test index bc96318ae2e..d177a68e685 100644 --- a/mysql-test/t/join_outer.test +++ b/mysql-test/t/join_outer.test @@ -506,3 +506,79 @@ select s.*, '*', m.*, (s.match_1_h - m.home) UUX from order by UUX desc; drop table t1, t2; + +# Tests for bugs #6307 and 6460 + +create table t1 (a int, b int, unique index idx (a, b)); +create table t2 (a int, b int, c int, unique index idx (a, b)); + +insert into t1 values (1, 10), (1,11), (2,10), (2,11); +insert into t2 values (1,10,3); + +select t1.a, t1.b, t2.c from t1 left join t2 + on t1.a=t2.a and t1.b=t2.b and t2.c=3 + where t1.a=1 and t2.c is null; + +drop table t1, t2; + +CREATE TABLE t1 ( + ts_id bigint(20) default NULL, + inst_id tinyint(4) default NULL, + flag_name varchar(64) default NULL, + flag_value text, + UNIQUE KEY ts_id (ts_id,inst_id,flag_name) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +CREATE TABLE t2 ( + ts_id bigint(20) default NULL, + inst_id tinyint(4) default NULL, + flag_name varchar(64) default NULL, + flag_value text, + UNIQUE KEY ts_id (ts_id,inst_id,flag_name) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +INSERT INTO t1 VALUES + (111056548820001, 0, 'flag1', NULL), + (111056548820001, 0, 'flag2', NULL), + (2, 0, 'other_flag', NULL); + +INSERT INTO t2 VALUES + (111056548820001, 3, 'flag1', 'sss'); + +SELECT t1.flag_name,t2.flag_value + FROM t1 LEFT JOIN t2 + ON (t1.ts_id = t2.ts_id AND t1.flag_name = t2.flag_name AND + t2.inst_id = 3) + WHERE t1.inst_id = 0 AND t1.ts_id=111056548820001 AND + t2.flag_value IS NULL; + +DROP TABLE t1,t2; + +CREATE TABLE invoice ( + id int(11) unsigned NOT NULL auto_increment, + text_id int(10) unsigned default NULL, + PRIMARY KEY (id) +); + +INSERT INTO invoice VALUES("1", "0"); +INSERT INTO invoice VALUES("2", "10"); + +CREATE TABLE text_table ( + text_id char(3) NOT NULL default '', + language_id char(3) NOT NULL default '', + text_data text, + PRIMARY KEY (text_id,language_id) +); + +INSERT INTO text_table VALUES("0", "EN", "0-EN"); +INSERT INTO text_table VALUES("0", "SV", "0-SV"); +INSERT INTO text_table VALUES("10", "EN", "10-EN"); +INSERT INTO text_table VALUES("10", "SV", "10-SV"); + +SELECT invoice.id, invoice.text_id, text_table.text_data + FROM invoice LEFT JOIN text_table + ON invoice.text_id = text_table.text_id + AND text_table.language_id = 'SV' + WHERE (invoice.id LIKE '%' OR text_table.text_data LIKE '%'); + +DROP TABLE invoice, text_table; diff --git a/sql/sql_select.cc b/sql/sql_select.cc index df74a946b5c..0a921ddb235 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -3507,8 +3507,17 @@ make_join_select(JOIN *join,SQL_SELECT *select,COND *cond) /* Join with outer join condition */ COND *orig_cond=sel->cond; sel->cond= and_conds(sel->cond, tab->on_expr); + + /* + We can't call sel->cond->fix_fields, + as it will break tab->on_expr if it's AND condition + (fix_fields currently removes extra AND/OR levels). + Yet attributes of the just built condition are not needed. + Thus we call sel->cond->quick_fix_field for safety. + */ if (sel->cond && !sel->cond->fixed) - sel->cond->fix_fields(join->thd, 0, &sel->cond); + sel->cond->quick_fix_field(); + if (sel->test_quick_select(join->thd, tab->keys, used_tables & ~ current_map, (join->select_options & From 7c927251645138beaf42f06c762f7d85c07682c5 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 6 Nov 2004 14:01:27 +0100 Subject: [PATCH 0131/1063] mysql_test_run_new.c: Included header fnmatch.h on Unix Changed C++ comments to C comments Corrected indentation of code written on Windows Split up lines to fit into 80 columns Initiated some variables to avoid warnings Added __attribute__((unused)) to unused function parameters Replace tab characters with space Put space after 'for', 'while' etc Added value to 'return' from non void function removef() On Unix strlwr() was incorrectly declared and a no op, replaced it with a macro that does nothing Split several statements on the same line Other minor changes to conform to coding standard mysql-test/mysql_test_run_new.c: Included header fnmatch.h on Unix Changed C++ comments to C comments Corrected indentation of code written on Windows Split up lines to fit into 80 columns Initiated some variables to avoid warnings Added __attribute__((unused)) to unused function parameters Replace tab characters with space Put space after 'for', 'while' etc Added value to 'return' from non void function removef() On Unix strlwr() was incorrectly declared and a no op, replaced it with a macro that does nothing Split several statements on the same line Other minor changes to conform to coding standard --- mysql-test/my_manage.c | 527 +++++++++--------- mysql-test/my_manage.h | 26 +- mysql-test/mysql_test_run_new.c | 913 +++++++++++++++++--------------- 3 files changed, 750 insertions(+), 716 deletions(-) diff --git a/mysql-test/my_manage.c b/mysql-test/my_manage.c index e23d4f2227e..ba5c674d105 100644 --- a/mysql-test/my_manage.c +++ b/mysql-test/my_manage.c @@ -30,6 +30,7 @@ #ifndef __WIN__ #include #include +#include #else #include #include @@ -52,36 +53,37 @@ extern char **environ; /****************************************************************************** - macros - + macros + ******************************************************************************/ /****************************************************************************** - global variables - + global variables + ******************************************************************************/ /****************************************************************************** - functions - + functions + ******************************************************************************/ /****************************************************************************** - init_args() - - Init an argument list. + init_args() + + Init an argument list. ******************************************************************************/ + void init_args(arg_list_t *al) { ASSERT(al != NULL); - - al->argc = 0; - al->size = ARG_BUF; - al->argv = malloc(al->size * sizeof(char *)); + + al->argc= 0; + al->size= ARG_BUF; + al->argv= malloc(al->size * sizeof(char *)); ASSERT(al->argv != NULL); return; @@ -89,11 +91,12 @@ void init_args(arg_list_t *al) /****************************************************************************** - add_arg() - - Add an argument to a list. + add_arg() + + Add an argument to a list. ******************************************************************************/ + void add_arg(arg_list_t *al, const char *format, ...) { va_list ap; @@ -101,11 +104,11 @@ void add_arg(arg_list_t *al, const char *format, ...) ASSERT(al != NULL); - // increase size + /* increase size */ if (al->argc >= (int)al->size) { - al->size += ARG_BUF; - al->argv = realloc(al->argv, al->size * sizeof(char *)); + al->size+= ARG_BUF; + al->argv= realloc(al->argv, al->size * sizeof(char *)); ASSERT(al->argv != NULL); } @@ -115,7 +118,7 @@ void add_arg(arg_list_t *al, const char *format, ...) vsprintf(temp, format, ap); va_end(ap); - al->argv[al->argc] = malloc(strlen(temp)+1); + al->argv[al->argc]= malloc(strlen(temp)+1); ASSERT(al->argv[al->argc] != NULL); strcpy(al->argv[al->argc], temp); @@ -123,7 +126,7 @@ void add_arg(arg_list_t *al, const char *format, ...) } else { - al->argv[al->argc] = NULL; + al->argv[al->argc]= NULL; } return; @@ -131,102 +134,108 @@ void add_arg(arg_list_t *al, const char *format, ...) /****************************************************************************** - free_args() - - Free an argument list. + free_args() + + Free an argument list. ******************************************************************************/ + void free_args(arg_list_t *al) { int i; ASSERT(al != NULL); - for(i = 0; i < al->argc; i++) + for (i= 0; i < al->argc; i++) { ASSERT(al->argv[i] != NULL); free(al->argv[i]); - al->argv[i] = NULL; + al->argv[i]= NULL; } free(al->argv); - al->argc = 0; - al->argv = NULL; + al->argc= 0; + al->argv= NULL; return; } /****************************************************************************** - sleep_until_file_deleted() - - Sleep until the given file is no longer found. + sleep_until_file_deleted() + + Sleep until the given file is no longer found. ******************************************************************************/ + #ifndef __WIN__ int sleep_until_file_deleted(char *pid_file) #else int sleep_until_file_deleted(HANDLE pid_file) #endif { - int err; + int err= 0; /* Initiate to supress warning */ #ifndef __WIN__ - struct stat buf; - int i; - - for(i = 0; (i < TRY_MAX) && (err = !stat(pid_file, &buf)); i++) sleep(1); - - if (err != 0) err = errno; + struct stat buf; + int i; + + for (i= 0; (i < TRY_MAX) && (err= !stat(pid_file, &buf)); i++) sleep(1); + + if (err != 0) err= errno; #else err= (WaitForSingleObject(pid_file, TRY_MAX*1000) == WAIT_TIMEOUT); #endif - return err; + return err; } /****************************************************************************** - sleep_until_file_exists() + sleep_until_file_exists() - Sleep until the given file exists. + Sleep until the given file exists. ******************************************************************************/ + #ifndef __WIN__ int sleep_until_file_exists(char *pid_file) #else int sleep_until_file_exists(HANDLE pid_file) #endif { - int err; + int err= 0; /* Initiate to supress warning */ #ifndef __WIN__ - struct stat buf; - int i; - - for(i = 0; (i < TRY_MAX) && (err = stat(pid_file, &buf)); i++) sleep(1); - - if (err != 0) err = errno; + struct stat buf; + int i; + + for (i= 0; (i < TRY_MAX) && (err= stat(pid_file, &buf)); i++) sleep(1); + + if (err != 0) err= errno; #else err= (WaitForSingleObject(pid_file, TRY_MAX*1000) == WAIT_TIMEOUT); #endif - return err; + return err; } /****************************************************************************** - wait_for_server_start() - - Wait for the server on the given port to start. + wait_for_server_start() + + Wait for the server on the given port to start. ******************************************************************************/ -int wait_for_server_start(char *bin_dir, char *mysqladmin_file, char *user, char *password, int port,char *tmp_dir) + +int wait_for_server_start(char *bin_dir __attribute__((unused)), + char *mysqladmin_file, + char *user, char *password, int port,char *tmp_dir) { arg_list_t al; - int err, i; + int err= 0, i; char trash[PATH_MAX]; - - // mysqladmin file + + /* mysqladmin file */ snprintf(trash, PATH_MAX, "%s/trash.out",tmp_dir); - - // args + + /* args */ init_args(&al); add_arg(&al, "%s", mysqladmin_file); add_arg(&al, "--no-defaults"); @@ -235,7 +244,7 @@ int wait_for_server_start(char *bin_dir, char *mysqladmin_file, char *user, char add_arg(&al, "--password=%s", password); add_arg(&al, "--silent"); -//#ifdef NOT_USED +/* #ifdef NOT_USED */ #ifndef __NETWARE__ add_arg(&al, "-O"); add_arg(&al, "connect_timeout=10"); @@ -245,20 +254,22 @@ int wait_for_server_start(char *bin_dir, char *mysqladmin_file, char *user, char add_arg(&al, "--host=localhost"); #ifndef __NETWARE__ add_arg(&al, "--protocol=tcp"); -#endif +#endif add_arg(&al, "ping"); - // NetWare does not support the connect timeout in the TCP/IP stack - // -- we will try the ping multiple times + /* + NetWare does not support the connect timeout in the TCP/IP stack + -- we will try the ping multiple times + */ #ifndef __WIN__ - for(i = 0; (i < TRY_MAX) - && (err = spawn(mysqladmin_file, &al, TRUE, NULL, - trash, NULL, NULL)); i++) sleep(1); + for (i= 0; (i < TRY_MAX) + && (err= spawn(mysqladmin_file, &al, TRUE, NULL, + trash, NULL, NULL)); i++) sleep(1); #else - err = spawn(mysqladmin_file, &al, TRUE, NULL,trash, NULL, NULL); + err= spawn(mysqladmin_file, &al, TRUE, NULL,trash, NULL, NULL); #endif - // free args + /* free args */ free_args(&al); return err; @@ -266,38 +277,39 @@ int wait_for_server_start(char *bin_dir, char *mysqladmin_file, char *user, char /****************************************************************************** - spawn() - - Spawn the given path with the given arguments. + spawn() + + Spawn the given path with the given arguments. ******************************************************************************/ + #ifdef __NETWARE__ int spawn(char *path, arg_list_t *al, int join, char *input, char *output, char *error, char *pid_file) { - pid_t pid; - int result = 0; - wiring_t wiring = { FD_UNUSED, FD_UNUSED, FD_UNUSED }; - unsigned long flags = PROC_CURRENT_SPACE | PROC_INHERIT_CWD; + pid_t pid; + int result= 0; + wiring_t wiring= { FD_UNUSED, FD_UNUSED, FD_UNUSED }; + unsigned long flags= PROC_CURRENT_SPACE | PROC_INHERIT_CWD; - // open wiring + /* open wiring */ if (input) - wiring.infd = open(input, O_RDONLY); + wiring.infd= open(input, O_RDONLY); if (output) - wiring.outfd = open(output, O_WRONLY | O_CREAT | O_TRUNC); + wiring.outfd= open(output, O_WRONLY | O_CREAT | O_TRUNC); if (error) - wiring.errfd = open(error, O_WRONLY | O_CREAT | O_TRUNC); + wiring.errfd= open(error, O_WRONLY | O_CREAT | O_TRUNC); - // procve requires a NULL + /* procve requires a NULL */ add_arg(al, NULL); - // go - pid = procve(path, flags, NULL, &wiring, NULL, NULL, 0, - NULL, (const char **)al->argv); + /* go */ + pid= procve(path, flags, NULL, &wiring, NULL, NULL, 0, + NULL, (const char **)al->argv); - // close wiring + /* close wiring */ if (wiring.infd != -1) close(wiring.infd); @@ -307,7 +319,7 @@ int spawn(char *path, arg_list_t *al, int join, char *input, if (wiring.errfd != -1) close(wiring.errfd); - return result; + return result; } #elif __WIN__ @@ -322,18 +334,16 @@ int spawn(char *path, arg_list_t *al, int join, char *input, char win_args[1024]= ""; char command_line[1024]= ""; - /* - Skip the first parameter - */ - for(i = 1; i < al->argc; i++) + /* Skip the first parameter */ + for (i= 1; i < al->argc; i++) { ASSERT(al->argv[i] != NULL); strcat(win_args,al->argv[i]); strcat(win_args," "); - } + } memset(&startup_info,0,sizeof(STARTUPINFO)); - startup_info.cb = sizeof(STARTUPINFO); + startup_info.cb= sizeof(STARTUPINFO); if (input) freopen(input, "rb", stdin); @@ -361,7 +371,8 @@ int spawn(char *path, arg_list_t *al, int join, char *input, { if (join) { - if (WaitForSingleObject(process_information.hProcess, mysqld_timeout) == WAIT_TIMEOUT) + if (WaitForSingleObject(process_information.hProcess, mysqld_timeout) + == WAIT_TIMEOUT) { exit_code= -1; } @@ -393,76 +404,60 @@ int spawn(char *path, arg_list_t *al, int join, char *input, } #else int spawn(char *path, arg_list_t *al, int join, char *input, - char *output, char *error, char *pid_file) + char *output, char *error, char *pid_file __attribute__((unused))) { pid_t pid; - int res_exec = 0; - int result = 0; - - pid = fork(); - + int res_exec= 0; + int result= 0; + + pid= fork(); + if (pid == -1) { fprintf(stderr, "fork was't created\n"); - /* - We can't create the fork...exit with error - */ - return EXIT_FAILURE; + /* We can't create the fork...exit with error */ + return EXIT_FAILURE; } - + if (pid > 0) { - /* - The parent process is waiting for child process if join is not zero - */ + /* The parent process is waiting for child process if join is not zero */ if (join) { - waitpid(pid, &result, 0); - if (WIFEXITED(result) != 0) - { - result = WEXITSTATUS(result); - } - else - { - result = EXIT_FAILURE; - } - } + waitpid(pid, &result, 0); + if (WIFEXITED(result) != 0) + { + result= WEXITSTATUS(result); + } + else + { + result= EXIT_FAILURE; + } + } } else { - - /* - Child process - */ - add_arg(al, NULL); + /* Child process */ + add_arg(al, NULL); - - /* - Reassign streams - */ + /* Reassign streams */ if (input) - freopen(input, "r", stdin); - + freopen(input, "r", stdin); if (output) freopen(output, "w", stdout); - if (error) freopen(error, "w", stderr); /* Spawn the process */ - if ((res_exec = execve(path, al->argv, environ)) < 0) - { + if ((res_exec= execve(path, al->argv, environ)) < 0) exit(EXIT_FAILURE); - } - /* - Restore streams - */ + /* Restore streams */ if (input) - freopen("/dev/tty", "r", stdin); + freopen("/dev/tty", "r", stdin); if (output) freopen("/dev/tty", "w", stdout); @@ -472,32 +467,34 @@ int spawn(char *path, arg_list_t *al, int join, char *input, exit(0); } - + return result; } #endif /****************************************************************************** - stop_server() - - Stop the server with the given port and pid file. + stop_server() + + Stop the server with the given port and pid file. ******************************************************************************/ + +int stop_server(char *bin_dir __attribute__((unused)), char *mysqladmin_file, + char *user, char *password, int port, #ifndef __WIN__ -int stop_server(char *bin_dir, char *mysqladmin_file, char *user, char *password, int port, - char *pid_file,char *tmp_dir) + char *pid_file, #else -int stop_server(char *bin_dir, char *mysqladmin_file, char *user, char *password, int port, - HANDLE pid_file,char *tmp_dir) + HANDLE pid_file, #endif + char *tmp_dir) { arg_list_t al; - int err = 0; + int err= 0; char trash[PATH_MAX]; - + snprintf(trash, PATH_MAX, "%s/trash.out",tmp_dir); - - // args + + /* args */ init_args(&al); add_arg(&al, "%s", mysqladmin_file); add_arg(&al, "--no-defaults"); @@ -508,33 +505,33 @@ int stop_server(char *bin_dir, char *mysqladmin_file, char *user, char *password add_arg(&al, "shutdown_timeout=20"); #ifndef __NETWARE__ add_arg(&al, "--protocol=tcp"); -#endif +#endif add_arg(&al, "shutdown"); - // spawn - if ((err = spawn(mysqladmin_file, &al, TRUE, NULL, - trash, NULL, NULL)) == 0) + /* spawn */ + if ((err= spawn(mysqladmin_file, &al, TRUE, NULL, + trash, NULL, NULL)) == 0) { sleep_until_file_deleted(pid_file); } else { #ifndef __WIN__ - pid_t pid = get_server_pid(pid_file); - - // shutdown failed - kill server + pid_t pid= get_server_pid(pid_file); + + /* shutdown failed - kill server */ kill_server(pid); - + sleep(TRY_MAX); - - // remove pid file if possible - err = remove(pid_file); + + /* remove pid file if possible */ + err= remove(pid_file); #else TerminateProcess(pid_file,err); #endif } - - // free args + + /* free args */ free_args(&al); return err; @@ -542,57 +539,59 @@ int stop_server(char *bin_dir, char *mysqladmin_file, char *user, char *password /****************************************************************************** - get_server_pid() - - Get the VM id with the given pid file. + get_server_pid() + + Get the VM id with the given pid file. ******************************************************************************/ + #ifndef __WIN__ pid_t get_server_pid(char *pid_file) { char buf[PATH_MAX]; int fd, err; char *p; - pid_t id = 0; - - // discover id - fd = open(pid_file, O_RDONLY); - - err = read(fd, buf, PATH_MAX); - - close(fd); - - if (err > 0) - { - // terminate string - if ((p = strchr(buf, '\n')) != NULL) - { - *p = '\0'; - - // check for a '\r' - if ((p = strchr(buf, '\r')) != NULL) - { - *p = '\0'; - } - } - else - { - buf[err] = '\0'; - } - - id = strtol(buf, NULL, 0); - } - + pid_t id= 0; + + /* discover id */ + fd= open(pid_file, O_RDONLY); + + err= read(fd, buf, PATH_MAX); + + close(fd); + + if (err > 0) + { + /* terminate string */ + if ((p= strchr(buf, '\n')) != NULL) + { + *p= '\0'; + + /* check for a '\r' */ + if ((p= strchr(buf, '\r')) != NULL) + { + *p= '\0'; + } + } + else + { + buf[err]= '\0'; + } + + id= strtol(buf, NULL, 0); + } + return id; } /****************************************************************************** - kill_server() - - Force a kill of the server with the given pid. + kill_server() + + Force a kill of the server with the given pid. ******************************************************************************/ + void kill_server(pid_t pid) { if (pid > 0) @@ -603,51 +602,52 @@ void kill_server(pid_t pid) #else /* __NETWARE__ */ /* destroy vm */ NXVmDestroy(pid); -#endif +#endif } } #endif /****************************************************************************** - del_tree() - - Delete the directory and subdirectories. + del_tree() + + Delete the directory and subdirectories. ******************************************************************************/ + void del_tree(char *dir) { #ifndef __WIN__ - DIR *parent = opendir(dir); + DIR *parent= opendir(dir); struct dirent *entry; char temp[PATH_MAX]; - + if (parent == NULL) { return; } - while((entry = readdir(parent)) != NULL) + while ((entry= readdir(parent)) != NULL) { - // create long name + /* create long name */ snprintf(temp, PATH_MAX, "%s/%s", dir, entry->d_name); if (entry->d_name[0] == '.') { - // Skip + /* Skip */ } - else + else if (S_ISDIR(entry->d_type)) { - // delete subdirectory + /* delete subdirectory */ del_tree(temp); } else { - // remove file + /* remove file */ remove(temp); } } - // remove directory + /* remove directory */ rmdir(dir); #else struct _finddata_t parent; @@ -664,50 +664,51 @@ void del_tree(char *dir) do { - // create long name - snprintf(temp, PATH_MAX, "%s/%s", dir, parent.name); + /* create long name */ + snprintf(temp, PATH_MAX, "%s/%s", dir, parent.name); if (parent.name[0] == '.') { - // Skip + /* Skip */ } - else + else if (parent.attrib & _A_SUBDIR) { - // delete subdirectory + /* delete subdirectory */ del_tree(temp); } else { - // remove file + /* remove file */ remove(temp); } } while (_findnext(handle,&parent) == 0); _findclose(handle); - // remove directory + /* remove directory */ _rmdir(dir); #endif } /****************************************************************************** - removef() - + removef() + ******************************************************************************/ + int removef(const char *format, ...) { -#ifdef __NETWARE__ +#ifdef __NETWARE__ va_list ap; char path[PATH_MAX]; - + va_start(ap, format); vsnprintf(path, PATH_MAX, format, ap); - + va_end(ap); return remove(path); - + #eldef __WIN__ { va_list ap; @@ -716,25 +717,23 @@ int removef(const char *format, ...) intptr_t handle; char temp[PATH_MAX]; char *p; - + va_start(ap, format); vsnprintf(path, PATH_MAX, format, ap); - + va_end(ap); - - p = path + strlen(path); + + p= path + strlen(path); while (*p != '\\' && *p != '/' && p > path) p--; if ((handle=_findfirst(path,&parent)) == -1L) { - /* - if there is not files....it's ok. - */ + /* if there is not files....it's ok */ return 0; } - *p = '\0'; + *p= '\0'; do { @@ -754,89 +753,80 @@ int removef(const char *format, ...) va_list ap; char path[PATH_MAX]; char *p; - /* - Get path with mask - */ + /* Get path with mask */ va_start(ap, format); vsnprintf(path, PATH_MAX, format, ap); - + va_end(ap); - - p = path + strlen(path); + + p= path + strlen(path); while (*p != '\\' && *p != '/' && p > path) p--; - *p = '\0'; + *p= '\0'; p++; - - parent = opendir(path); + + parent= opendir(path); if (parent == NULL) { - return; + return 1; /* Error, directory missing */ } - - while((entry = readdir(parent)) != NULL) + + while ((entry= readdir(parent)) != NULL) { - /* - entry is not directory and entry matches with mask - */ + /* entry is not directory and entry matches with mask */ if (!S_ISDIR(entry->d_type) && !fnmatch(p, entry->d_name,0)) { - // create long name + /* create long name */ snprintf(temp, PATH_MAX, "%s/%s", path, entry->d_name); - // Delete only files + /* Delete only files */ remove(temp); } } #endif - return 0; + return 0; } /****************************************************************************** - get_basedir() - + get_basedir() + ******************************************************************************/ + void get_basedir(char *argv0, char *basedir) { char temp[PATH_MAX]; char *p; int position; - + ASSERT(argv0 != NULL); ASSERT(basedir != NULL); strcpy(temp, strlwr(argv0)); - while((p = strchr(temp, '\\')) != NULL) *p = '/'; - - if ((position = strinstr(temp, "/bin/")) != 0) + while ((p= strchr(temp, '\\')) != NULL) *p= '/'; + + if ((position= strinstr(temp, "/bin/")) != 0) { - p = temp + position; - *p = '\0'; + p= temp + position; + *p= '\0'; strcpy(basedir, temp); } } -#if !defined(__NETWARE__) && !defined(__WIN__) -char *strlwr(const char *s) -{ - return s; -} -#endif - uint strinstr(reg1 const char *str,reg4 const char *search) { reg2 my_string i,j; - my_string start = (my_string) str; + my_string start= (my_string) str; skipp: while (*str != '\0') { if (*str++ == *search) { - i=(my_string) str; j= (my_string) search+1; + i=(my_string) str; + j= (my_string) search+1; while (*j) - if (*i++ != *j++) goto skipp; + if (*i++ != *j++) goto skipp; return ((uint) (str - start)); } } @@ -845,13 +835,14 @@ uint strinstr(reg1 const char *str,reg4 const char *search) /****************************************************************************** - remove_empty_file() - + remove_empty_file() + ******************************************************************************/ + void remove_empty_file(const char *file_name) { struct stat file; - + if (!stat(file_name,&file)) { if (!file.st_size) diff --git a/mysql-test/my_manage.h b/mysql-test/my_manage.h index 56ba7ce0496..a61c693c22c 100644 --- a/mysql-test/my_manage.h +++ b/mysql-test/my_manage.h @@ -21,8 +21,8 @@ /****************************************************************************** - includes - + includes + ******************************************************************************/ #include @@ -36,7 +36,7 @@ #ifndef __WIN__ #define strnicmp strncasecmp -char *strlwr(const char *s); +#define strlwr(STRARG) (STRARG) #else int my_vsnprintf_(char *to, size_t n, const char* value, ...); #endif @@ -44,12 +44,12 @@ int my_vsnprintf_(char *to, size_t n, const char* value, ...); /****************************************************************************** - macros - + macros + ******************************************************************************/ -#define ARG_BUF 10 -#define TRY_MAX 5 +#define ARG_BUF 10 +#define TRY_MAX 5 #ifdef __WIN__ #define PATH_MAX _MAX_PATH @@ -71,8 +71,8 @@ bool skip_first_param; /****************************************************************************** - structures - + structures + ******************************************************************************/ typedef struct @@ -90,14 +90,14 @@ typedef int pid_t; #endif /****************************************************************************** - global variables - + global variables + ******************************************************************************/ /****************************************************************************** - prototypes - + prototypes + ******************************************************************************/ void init_args(arg_list_t *); diff --git a/mysql-test/mysql_test_run_new.c b/mysql-test/mysql_test_run_new.c index 6f388fc4a45..1e8a1dded51 100644 --- a/mysql-test/mysql_test_run_new.c +++ b/mysql-test/mysql_test_run_new.c @@ -21,7 +21,7 @@ #include #ifndef __WIN__ #include -#endif +#endif #include #ifdef __NETWARE__ #include @@ -46,51 +46,52 @@ /****************************************************************************** macros - + ******************************************************************************/ #define HEADER "TEST RESULT \n" #define DASH "-------------------------------------------------------\n" -#define NW_TEST_SUFFIX ".nw-test" -#define NW_RESULT_SUFFIX ".nw-result" -#define TEST_SUFFIX ".test" -#define RESULT_SUFFIX ".result" -#define REJECT_SUFFIX ".reject" -#define OUT_SUFFIX ".out" -#define ERR_SUFFIX ".err" +#define NW_TEST_SUFFIX ".nw-test" +#define NW_RESULT_SUFFIX ".nw-result" +#define TEST_SUFFIX ".test" +#define RESULT_SUFFIX ".result" +#define REJECT_SUFFIX ".reject" +#define OUT_SUFFIX ".out" +#define ERR_SUFFIX ".err" -const char *TEST_PASS = "[ pass ]"; -const char *TEST_SKIP = "[ skip ]"; -const char *TEST_FAIL = "[ fail ]"; -const char *TEST_BAD = "[ bad ]"; -const char *TEST_IGNORE = "[ignore]"; +const char *TEST_PASS= "[ pass ]"; +const char *TEST_SKIP= "[ skip ]"; +const char *TEST_FAIL= "[ fail ]"; +const char *TEST_BAD= "[ bad ]"; +const char *TEST_IGNORE= "[ignore]"; /****************************************************************************** global variables - -******************************************************************************/ -#ifdef __NETWARE__ -static char base_dir[PATH_MAX] = "sys:/mysql"; -#else -static char base_dir[PATH_MAX] = ".."; -#endif -static char db[PATH_MAX] = "test"; -static char user[PATH_MAX] = "root"; -static char password[PATH_MAX] = ""; -int master_port = 9306; -int slave_port = 9307; +******************************************************************************/ + +#ifdef __NETWARE__ +static char base_dir[PATH_MAX]= "sys:/mysql"; +#else +static char base_dir[PATH_MAX]= ".."; +#endif +static char db[PATH_MAX]= "test"; +static char user[PATH_MAX]= "root"; +static char password[PATH_MAX]= ""; + +int master_port= 9306; +int slave_port= 9307; #if !defined(__NETWARE__) && !defined(__WIN__) -static char master_socket[PATH_MAX] = "./var/tmp/master.sock"; -static char slave_socket[PATH_MAX] = "./var/tmp/slave.sock"; +static char master_socket[PATH_MAX]= "./var/tmp/master.sock"; +static char slave_socket[PATH_MAX]= "./var/tmp/slave.sock"; #endif -// comma delimited list of tests to skip or empty string +/* comma delimited list of tests to skip or empty string */ #ifndef __WIN__ -static char skip_test[PATH_MAX] = " lowercase_table3 , system_mysql_db_fix "; +static char skip_test[PATH_MAX]= " lowercase_table3 , system_mysql_db_fix "; #else /* The most ignore testes contain the calls of system command @@ -109,9 +110,20 @@ static char skip_test[PATH_MAX] = " lowercase_table3 , system_mysql_db_fix "; mysqldump contains a command system rpl000001 makes non-exit loop...temporary skiped */ -static char skip_test[PATH_MAX] = " lowercase_table3 , system_mysql_db_fix , sp , rpl_EE_error , rpl_loaddatalocal , ndb_autodiscover , rpl_rotate_logs , repair , rpl_trunc_binlog , mysqldump , rpl000001 "; +static char skip_test[PATH_MAX]= +" lowercase_table3 ," +" system_mysql_db_fix ," +" sp ," +" rpl_EE_error ," +" rpl_loaddatalocal ," +" ndb_autodiscover ," +" rpl_rotate_logs ," +" repair ," +" rpl_trunc_binlog ," +" mysqldump ," +" rpl000001 "; #endif -static char ignore_test[PATH_MAX] = ""; +static char ignore_test[PATH_MAX]= ""; static char bin_dir[PATH_MAX]; static char mysql_test_dir[PATH_MAX]; @@ -129,54 +141,54 @@ static char mysqltest_file[PATH_MAX]; #ifndef __WIN__ static char master_pid[PATH_MAX]; static char slave_pid[PATH_MAX]; -static char sh_file[PATH_MAX] = "/bin/sh"; +static char sh_file[PATH_MAX]= "/bin/sh"; #else static HANDLE master_pid; static HANDLE slave_pid; #endif -static char master_opt[PATH_MAX] = ""; -static char slave_opt[PATH_MAX] = ""; +static char master_opt[PATH_MAX]= ""; +static char slave_opt[PATH_MAX]= ""; -static char slave_master_info[PATH_MAX] = ""; +static char slave_master_info[PATH_MAX]= ""; -static char master_init_script[PATH_MAX] = ""; -static char slave_init_script[PATH_MAX] = ""; +static char master_init_script[PATH_MAX]= ""; +static char slave_init_script[PATH_MAX]= ""; -// OpenSSL +/* OpenSSL */ static char ca_cert[PATH_MAX]; static char server_cert[PATH_MAX]; static char server_key[PATH_MAX]; static char client_cert[PATH_MAX]; static char client_key[PATH_MAX]; -int total_skip = 0; -int total_pass = 0; -int total_fail = 0; -int total_test = 0; +int total_skip= 0; +int total_pass= 0; +int total_fail= 0; +int total_test= 0; -int total_ignore = 0; +int total_ignore= 0; -int use_openssl = FALSE; -int master_running = FALSE; -int slave_running = FALSE; -int skip_slave = TRUE; -int single_test = TRUE; +int use_openssl= FALSE; +int master_running= FALSE; +int slave_running= FALSE; +int skip_slave= TRUE; +int single_test= TRUE; -int restarts = 0; +int restarts= 0; -FILE *log_fd = NULL; +FILE *log_fd= NULL; /****************************************************************************** functions - + ******************************************************************************/ /****************************************************************************** prototypes - + ******************************************************************************/ void report_stats(); @@ -205,10 +217,11 @@ void run_init_script(const char *script_name); /****************************************************************************** report_stats() - + Report the gathered statistics. ******************************************************************************/ + void report_stats() { if (total_fail == 0) @@ -217,24 +230,26 @@ void report_stats() } else { - double percent = ((double)total_pass / total_test) * 100; - + double percent= ((double)total_pass / total_test) * 100; + mlog("\nFailed %u/%u test(s), %.02f%% successful.\n", - total_fail, total_test, percent); - mlog("\nThe .out and .err files in %s may give you some\n", result_dir); - mlog("hint of what when wrong.\n"); - mlog("\nIf you want to report this error, please first read the documentation\n"); - mlog("at: http://www.mysql.com/doc/M/y/MySQL_test_suite.html\n"); + total_fail, total_test, percent); + mlog("\nThe .out and .err files in %s may give you some\n", result_dir); + mlog("hint of what when wrong.\n"); + mlog("\nIf you want to report this error, please first read " + "the documentation\n"); + mlog("at: http://www.mysql.com/doc/M/y/MySQL_test_suite.html\n"); } } /****************************************************************************** install_db() - + Install the a database. ******************************************************************************/ + void install_db(char *datadir) { arg_list_t al; @@ -243,16 +258,16 @@ void install_db(char *datadir) char output[PATH_MAX]; char error[PATH_MAX]; - // input file -#ifdef __NETWARE__ + /* input file */ +#ifdef __NETWARE__ snprintf(input, PATH_MAX, "%s/bin/init_db.sql", base_dir); #else snprintf(input, PATH_MAX, "%s/mysql-test/init_db.sql", base_dir); -#endif +#endif snprintf(output, PATH_MAX, "%s/install.out", datadir); snprintf(error, PATH_MAX, "%s/install.err", datadir); - - // args + + /* args */ init_args(&al); add_arg(&al, mysqld_file); add_arg(&al, "--no-defaults"); @@ -265,39 +280,40 @@ void install_db(char *datadir) #ifndef __NETWARE__ add_arg(&al, "--character-sets-dir=%s", char_dir); add_arg(&al, "--language=%s", lang_dir); -#endif +#endif - // spawn - if ((err = spawn(mysqld_file, &al, TRUE, input, output, error, NULL)) != 0) + /* spawn */ + if ((err= spawn(mysqld_file, &al, TRUE, input, output, error, NULL)) != 0) { die("Unable to create database."); } - - // free args + + /* free args */ free_args(&al); } /****************************************************************************** mysql_install_db() - + Install the test databases. ******************************************************************************/ + void mysql_install_db() { char temp[PATH_MAX]; - - // var directory + + /* var directory */ snprintf(temp, PATH_MAX, "%s/var", mysql_test_dir); - - // clean up old direcotry + + /* clean up old direcotry */ del_tree(temp); - - // create var directory + + /* create var directory */ #ifndef __WIN__ mkdir(temp, S_IRWXU); - // create subdirectories + /* create subdirectories */ mlog("Creating test-suite folders...\n"); snprintf(temp, PATH_MAX, "%s/var/run", mysql_test_dir); mkdir(temp, S_IRWXU); @@ -317,7 +333,7 @@ void mysql_install_db() mkdir(temp, S_IRWXU); #else mkdir(temp); - // create subdirectories + /* create subdirectories */ mlog("Creating test-suite folders...\n"); snprintf(temp, PATH_MAX, "%s/var/run", mysql_test_dir); mkdir(temp); @@ -337,7 +353,7 @@ void mysql_install_db() mkdir(temp); #endif - // install databases + /* install databases */ mlog("Creating test databases for master... \n"); install_db(master_dir); mlog("Creating test databases for slave... \n"); @@ -347,49 +363,50 @@ void mysql_install_db() /****************************************************************************** start_master() - + Start the master server. ******************************************************************************/ + void start_master() { arg_list_t al; int err; char master_out[PATH_MAX]; char master_err[PATH_MAX]; -// char temp[PATH_MAX]; +/* char temp[PATH_MAX]; */ char temp2[PATH_MAX]; - // remove old berkeley db log files that can confuse the server + /* remove old berkeley db log files that can confuse the server */ removef("%s/log.*", master_dir); - // remove stale binary logs + /* remove stale binary logs */ removef("%s/var/log/*-bin.*", mysql_test_dir); - // remove stale binary logs + /* remove stale binary logs */ removef("%s/var/log/*.index", mysql_test_dir); - // remove master.info file + /* remove master.info file */ removef("%s/master.info", master_dir); - // remove relay files + /* remove relay files */ removef("%s/var/log/*relay*", mysql_test_dir); - // remove relay-log.info file + /* remove relay-log.info file */ removef("%s/relay-log.info", master_dir); - // init script + /* init script */ if (master_init_script[0] != 0) { #ifdef __NETWARE__ - // TODO: use the scripts + /* TODO: use the scripts */ if (strinstr(master_init_script, "repair_part2-master.sh") != 0) { FILE *fp; - // create an empty index file + /* create an empty index file */ snprintf(temp, PATH_MAX, "%s/test/t1.MYI", master_dir); - fp = fopen(temp, "wb+"); + fp= fopen(temp, "wb+"); fputs("1", fp); @@ -397,10 +414,10 @@ void start_master() } #elif !defined(__WIN__) run_init_script(master_init_script); -#endif +#endif } - // redirection files + /* redirection files */ snprintf(master_out, PATH_MAX, "%s/var/run/master%u.out", mysql_test_dir, restarts); snprintf(master_err, PATH_MAX, "%s/var/run/master%u.err", @@ -416,7 +433,7 @@ void start_master() snprintf(temp2,PATH_MAX,"%s/var/log",mysql_test_dir); mkdir(temp2); #endif - // args + /* args */ init_args(&al); add_arg(&al, "%s", mysqld_file); add_arg(&al, "--no-defaults"); @@ -426,7 +443,7 @@ void start_master() add_arg(&al, "--port=%u", master_port); #if !defined(__NETWARE__) && !defined(__WIN__) add_arg(&al, "--socket=%s",master_socket); -#endif +#endif add_arg(&al, "--local-infile"); add_arg(&al, "--core"); add_arg(&al, "--datadir=%s", master_dir); @@ -436,7 +453,7 @@ void start_master() add_arg(&al, "--character-sets-dir=%s", char_dir); add_arg(&al, "--tmpdir=%s", mysql_tmp_dir); add_arg(&al, "--language=%s", lang_dir); -#ifdef DEBUG //only for debug builds +#ifdef DEBUG /* only for debug builds */ add_arg(&al, "--debug"); #endif @@ -447,11 +464,11 @@ void start_master() add_arg(&al, "--ssl-key=%s", server_key); } - // $MASTER_40_ARGS + /* $MASTER_40_ARGS */ add_arg(&al, "--rpl-recovery-rank=1"); add_arg(&al, "--init-rpl-role=master"); - // $SMALL_SERVER + /* $SMALL_SERVER */ add_arg(&al, "-O"); add_arg(&al, "key_buffer_size=1M"); add_arg(&al, "-O"); @@ -459,44 +476,46 @@ void start_master() add_arg(&al, "-O"); add_arg(&al, "max_heap_table_size=1M"); - // $EXTRA_MASTER_OPT + /* $EXTRA_MASTER_OPT */ if (master_opt[0] != 0) { char *p; - p = (char *)str_tok(master_opt, " \t"); + p= (char *)str_tok(master_opt, " \t"); if (!strstr(master_opt, "timezone")) { while (p) { add_arg(&al, "%s", p); - p = (char *)str_tok(NULL, " \t"); + p= (char *)str_tok(NULL, " \t"); } } } - // remove the pid file if it exists + /* remove the pid file if it exists */ #ifndef __WIN__ remove(master_pid); #endif - // spawn + /* spawn */ #ifdef __WIN__ - if ((err= spawn(mysqld_file, &al, FALSE, NULL, master_out, master_err, &master_pid)) == 0) + if ((err= spawn(mysqld_file, &al, FALSE, NULL, + master_out, master_err, &master_pid)) == 0) #else - if ((err= spawn(mysqld_file, &al, FALSE, NULL, master_out, master_err, master_pid)) == 0) -#endif + if ((err= spawn(mysqld_file, &al, FALSE, NULL, + master_out, master_err, master_pid)) == 0) +#endif { sleep_until_file_exists(master_pid); - if ((err = wait_for_server_start(bin_dir, mysqladmin_file, user, password, master_port, - mysql_tmp_dir)) == 0) + if ((err= wait_for_server_start(bin_dir, mysqladmin_file, user, password, + master_port, mysql_tmp_dir)) == 0) { - master_running = TRUE; + master_running= TRUE; } else { - log_error("The master server went down early."); + log_error("The master server went down early."); } } else @@ -504,17 +523,18 @@ void start_master() log_error("Unable to start master server."); } - // free_args + /* free_args */ free_args(&al); } /****************************************************************************** start_slave() - + Start the slave server. ******************************************************************************/ + void start_slave() { arg_list_t al; @@ -522,43 +542,43 @@ void start_slave() char slave_out[PATH_MAX]; char slave_err[PATH_MAX]; - // skip? + /* skip? */ if (skip_slave) return; - // remove stale binary logs + /* remove stale binary logs */ removef("%s/*-bin.*", slave_dir); - // remove stale binary logs + /* remove stale binary logs */ removef("%s/*.index", slave_dir); - // remove master.info file + /* remove master.info file */ removef("%s/master.info", slave_dir); - // remove relay files + /* remove relay files */ removef("%s/var/log/*relay*", mysql_test_dir); - // remove relay-log.info file + /* remove relay-log.info file */ removef("%s/relay-log.info", slave_dir); - // init script + /* init script */ if (slave_init_script[0] != 0) { #ifdef __NETWARE__ - // TODO: use the scripts + /* TODO: use the scripts */ if (strinstr(slave_init_script, "rpl000016-slave.sh") != 0) { - // create empty master.info file + /* create empty master.info file */ snprintf(temp, PATH_MAX, "%s/master.info", slave_dir); close(open(temp, O_WRONLY | O_CREAT,S_IRWXU|S_IRWXG|S_IRWXO)); } else if (strinstr(slave_init_script, "rpl000017-slave.sh") != 0) { FILE *fp; - - // create a master.info file + + /* create a master.info file */ snprintf(temp, PATH_MAX, "%s/master.info", slave_dir); - fp = fopen(temp, "wb+"); - + fp= fopen(temp, "wb+"); + fputs("master-bin.000001\n", fp); fputs("4\n", fp); fputs("127.0.0.1\n", fp); @@ -572,22 +592,22 @@ void start_slave() } else if (strinstr(slave_init_script, "rpl_rotate_logs-slave.sh") != 0) { - // create empty master.info file + /* create empty master.info file */ snprintf(temp, PATH_MAX, "%s/master.info", slave_dir); close(open(temp, O_WRONLY | O_CREAT,S_IRWXU|S_IRWXG|S_IRWXO)); } -#elif !defined(__WIN__) +#elif !defined(__WIN__) run_init_script(slave_init_script); -#endif +#endif } - // redirection files + /* redirection files */ snprintf(slave_out, PATH_MAX, "%s/var/run/slave%u.out", mysql_test_dir, restarts); snprintf(slave_err, PATH_MAX, "%s/var/run/slave%u.err", mysql_test_dir, restarts); - - // args + + /* args */ init_args(&al); add_arg(&al, "%s", mysqld_file); add_arg(&al, "--no-defaults"); @@ -597,7 +617,7 @@ void start_slave() add_arg(&al, "--port=%u", slave_port); #if !defined(__NETWARE__) && !defined(__WIN__) add_arg(&al, "--socket=%s",slave_socket); -#endif +#endif add_arg(&al, "--datadir=%s", slave_dir); #ifndef __WIN__ add_arg(&al, "--pid-file=%s", slave_pid); @@ -613,7 +633,7 @@ void start_slave() add_arg(&al, "--skip-innodb"); add_arg(&al, "--skip-slave-start"); add_arg(&al, "--slave-load-tmpdir=../../var/tmp"); - + add_arg(&al, "--report-user=%s", user); add_arg(&al, "--report-host=127.0.0.1"); add_arg(&al, "--report-port=%u", slave_port); @@ -621,7 +641,7 @@ void start_slave() add_arg(&al, "--master-retry-count=10"); add_arg(&al, "-O"); add_arg(&al, "slave_net_timeout=10"); -#ifdef DEBUG //only for debug builds +#ifdef DEBUG /* only for debug builds */ add_arg(&al, "--debug"); #endif @@ -632,18 +652,17 @@ void start_slave() add_arg(&al, "--ssl-key=%s", server_key); } - // slave master info + /* slave master info */ if (slave_master_info[0] != 0) { char *p; - p = (char *)str_tok(slave_master_info, " \t"); + p= (char *)str_tok(slave_master_info, " \t"); - while(p) + while (p) { add_arg(&al, "%s", p); - - p = (char *)str_tok(NULL, " \t"); + p= (char *)str_tok(NULL, " \t"); } } else @@ -656,8 +675,8 @@ void start_slave() add_arg(&al, "--server-id=2"); add_arg(&al, "--rpl-recovery-rank=2"); } - - // small server + + /* small server */ add_arg(&al, "-O"); add_arg(&al, "key_buffer_size=1M"); add_arg(&al, "-O"); @@ -666,38 +685,39 @@ void start_slave() add_arg(&al, "max_heap_table_size=1M"); - // opt args + /* opt args */ if (slave_opt[0] != 0) { char *p; - p = (char *)str_tok(slave_opt, " \t"); + p= (char *)str_tok(slave_opt, " \t"); - while(p) + while (p) { add_arg(&al, "%s", p); - - p = (char *)str_tok(NULL, " \t"); + p= (char *)str_tok(NULL, " \t"); } } - - // remove the pid file if it exists + + /* remove the pid file if it exists */ #ifndef __WIN__ remove(slave_pid); #endif - // spawn -#ifdef __WIN__ - if ((err = spawn(mysqld_file, &al, FALSE, NULL, slave_out, slave_err, &slave_pid)) == 0) + /* spawn */ +#ifdef __WIN__ + if ((err= spawn(mysqld_file, &al, FALSE, NULL, + slave_out, slave_err, &slave_pid)) == 0) #else - if ((err = spawn(mysqld_file, &al, FALSE, NULL, slave_out, slave_err, slave_pid)) == 0) -#endif + if ((err= spawn(mysqld_file, &al, FALSE, NULL, + slave_out, slave_err, slave_pid)) == 0) +#endif { sleep_until_file_exists(slave_pid); - - if ((err = wait_for_server_start(bin_dir, mysqladmin_file, user, password, slave_port, - mysql_tmp_dir)) == 0) + + if ((err= wait_for_server_start(bin_dir, mysqladmin_file, user, password, + slave_port, mysql_tmp_dir)) == 0) { - slave_running = TRUE; + slave_running= TRUE; } else { @@ -708,29 +728,30 @@ void start_slave() { log_error("Unable to start slave server."); } - - // free args + + /* free args */ free_args(&al); } /****************************************************************************** mysql_start() - + Start the mysql servers. ******************************************************************************/ + void mysql_start() { -// log_info("Starting the MySQL server(s): %u", ++restarts); +/* log_info("Starting the MySQL server(s): %u", ++restarts); */ start_master(); start_slave(); - // activate the test screen -#ifdef __NETWARE__ + /* activate the test screen */ +#ifdef __NETWARE__ ActivateScreen(getscreenhandle()); -#endif +#endif } /****************************************************************************** @@ -740,18 +761,19 @@ void mysql_start() Stop the slave server. ******************************************************************************/ + void stop_slave() { int err; - // running? + /* running? */ if (!slave_running) return; - // stop - if ((err = stop_server(bin_dir, mysqladmin_file, user, password, slave_port, slave_pid, - mysql_tmp_dir)) == 0) + /* stop */ + if ((err= stop_server(bin_dir, mysqladmin_file, user, password, + slave_port, slave_pid, mysql_tmp_dir)) == 0) { - slave_running = FALSE; + slave_running= FALSE; } else { @@ -766,17 +788,18 @@ void stop_slave() Stop the master server. ******************************************************************************/ + void stop_master() { int err; - // running? + /* running? */ if (!master_running) return; - if ((err = stop_server(bin_dir, mysqladmin_file, user, password, master_port, master_pid, - mysql_tmp_dir)) == 0) + if ((err= stop_server(bin_dir, mysqladmin_file, user, password, + master_port, master_pid, mysql_tmp_dir)) == 0) { - master_running = FALSE; + master_running= FALSE; } else { @@ -791,6 +814,7 @@ void stop_master() Stop the mysql servers. ******************************************************************************/ + void mysql_stop() { @@ -798,10 +822,10 @@ void mysql_stop() stop_slave(); - // activate the test screen -#ifdef __NETWARE__ + /* activate the test screen */ +#ifdef __NETWARE__ ActivateScreen(getscreenhandle()); -#endif +#endif } /****************************************************************************** @@ -811,9 +835,10 @@ void mysql_stop() Restart the mysql servers. ******************************************************************************/ + void mysql_restart() { -// log_info("Restarting the MySQL server(s): %u", ++restarts); +/* log_info("Restarting the MySQL server(s): %u", ++restarts); */ mysql_stop(); @@ -829,55 +854,52 @@ void mysql_restart() Read the option file. ******************************************************************************/ + int read_option(char *opt_file, char *opt) { int fd, err; char *p; char buf[PATH_MAX]; - // copy current option + /* copy current option */ strncpy(buf, opt, PATH_MAX); - // open options file - fd = open(opt_file, O_RDONLY); - - err = read(fd, opt, PATH_MAX); - + /* open options file */ + fd= open(opt_file, O_RDONLY); + err= read(fd, opt, PATH_MAX); close(fd); - + if (err > 0) { - // terminate string - if ((p = strchr(opt, '\n')) != NULL) + /* terminate string */ + if ((p= strchr(opt, '\n')) != NULL) { - *p = 0; - - // check for a '\r' - if ((p = strchr(opt, '\r')) != NULL) + *p= 0; + + /* check for a '\r' */ + if ((p= strchr(opt, '\r')) != NULL) { - *p = 0; + *p= 0; } } else { - opt[err] = 0; + opt[err]= 0; } - // check for $MYSQL_TEST_DIR - if ((p = strstr(opt, "$MYSQL_TEST_DIR")) != NULL) + /* check for $MYSQL_TEST_DIR */ + if ((p= strstr(opt, "$MYSQL_TEST_DIR")) != NULL) { char temp[PATH_MAX]; - - *p = 0; - + + *p= 0; + strcpy(temp, p + strlen("$MYSQL_TEST_DIR")); - strcat(opt, mysql_test_dir); - strcat(opt, temp); } - // Check for double backslash and replace it with single bakslash - if ((p = strstr(opt, "\\\\")) != NULL) + /* Check for double backslash and replace it with single bakslash */ + if ((p= strstr(opt, "\\\\")) != NULL) { /* bmove is guranteed to work byte by byte */ bmove(p, p+1, strlen(p+1)); @@ -885,54 +907,55 @@ int read_option(char *opt_file, char *opt) } else { - // clear option - *opt = 0; + /* clear option */ + *opt= 0; } - - // compare current option with previous + + /* compare current option with previous */ return strcmp(opt, buf); } /****************************************************************************** run_test() - + Run the given test case. ******************************************************************************/ + void run_test(char *test) { char temp[PATH_MAX]; const char *rstr; - int skip = FALSE, ignore=FALSE; - int restart = FALSE; - int flag = FALSE; + int skip= FALSE, ignore=FALSE; + int restart= FALSE; + int flag= FALSE; struct stat info; - - // skip tests in the skip list + + /* skip tests in the skip list */ snprintf(temp, PATH_MAX, " %s ", test); - skip = (strinstr(skip_test, temp) != 0); + skip= (strinstr(skip_test, temp) != 0); if (skip == FALSE) - ignore = (strinstr(ignore_test, temp) != 0); + ignore= (strinstr(ignore_test, temp) != 0); snprintf(master_init_script, PATH_MAX, "%s/%s-master.sh", test_dir, test); snprintf(slave_init_script, PATH_MAX, "%s/%s-slave.sh", test_dir, test); -#ifdef __WIN__ +#ifdef __WIN__ if (! stat(master_init_script, &info)) - skip = TRUE; + skip= TRUE; if (!stat(slave_init_script, &info)) - skip = TRUE; + skip= TRUE; #endif if (ignore) { - // show test + /* show test */ mlog("%-46s ", test); - - // ignore - rstr = TEST_IGNORE; + + /* ignore */ + rstr= TEST_IGNORE; ++total_ignore; - } - else if (!skip) // skip test? + } + else if (!skip) /* skip test? */ { char test_file[PATH_MAX]; char master_opt_file[PATH_MAX]; @@ -945,29 +968,29 @@ void run_test(char *test) int err; arg_list_t al; #ifdef __WIN__ - /* - Clean test database - */ + /* Clean test database */ removef("%s/test/*.*", master_dir); removef("%s/test/*.*", slave_dir); removef("%s/mysqltest/*.*", master_dir); removef("%s/mysqltest/*.*", slave_dir); #endif - // skip slave? - flag = skip_slave; - skip_slave = (strncmp(test, "rpl", 3) != 0); - if (flag != skip_slave) restart = TRUE; - - // create files + /* skip slave? */ + flag= skip_slave; + skip_slave= (strncmp(test, "rpl", 3) != 0); + if (flag != skip_slave) restart= TRUE; + + /* create files */ snprintf(master_opt_file, PATH_MAX, "%s/%s-master.opt", test_dir, test); snprintf(slave_opt_file, PATH_MAX, "%s/%s-slave.opt", test_dir, test); - snprintf(slave_master_info_file, PATH_MAX, "%s/%s.slave-mi", test_dir, test); - snprintf(reject_file, PATH_MAX, "%s/%s%s", result_dir, test, REJECT_SUFFIX); + snprintf(slave_master_info_file, PATH_MAX, "%s/%s.slave-mi", + test_dir, test); + snprintf(reject_file, PATH_MAX, "%s/%s%s", + result_dir, test, REJECT_SUFFIX); snprintf(out_file, PATH_MAX, "%s/%s%s", result_dir, test, OUT_SUFFIX); snprintf(err_file, PATH_MAX, "%s/%s%s", result_dir, test, ERR_SUFFIX); - - // netware specific files + + /* netware specific files */ snprintf(test_file, PATH_MAX, "%s/%s%s", test_dir, test, NW_TEST_SUFFIX); if (stat(test_file, &info)) { @@ -979,45 +1002,46 @@ void run_test(char *test) } } - snprintf(result_file, PATH_MAX, "%s/%s%s", result_dir, test, NW_RESULT_SUFFIX); + snprintf(result_file, PATH_MAX, "%s/%s%s", + result_dir, test, NW_RESULT_SUFFIX); if (stat(result_file, &info)) { - snprintf(result_file, PATH_MAX, "%s/%s%s", result_dir, test, RESULT_SUFFIX); + snprintf(result_file, PATH_MAX, "%s/%s%s", + result_dir, test, RESULT_SUFFIX); } - // init scripts + /* init scripts */ if (stat(master_init_script, &info)) - master_init_script[0] = 0; + master_init_script[0]= 0; else - restart = TRUE; - - if (stat(slave_init_script, &info)) - slave_init_script[0] = 0; - else - restart = TRUE; + restart= TRUE; - // read options - if (read_option(master_opt_file, master_opt)) restart = TRUE; - if (read_option(slave_opt_file, slave_opt)) restart = TRUE; - if (read_option(slave_master_info_file, slave_master_info)) restart = TRUE; - - // cleanup previous run + if (stat(slave_init_script, &info)) + slave_init_script[0]= 0; + else + restart= TRUE; + + /* read options */ + if (read_option(master_opt_file, master_opt)) restart= TRUE; + if (read_option(slave_opt_file, slave_opt)) restart= TRUE; + if (read_option(slave_master_info_file, slave_master_info)) restart= TRUE; + + /* cleanup previous run */ remove(reject_file); remove(out_file); remove(err_file); - - // start or restart? + + /* start or restart? */ if (!master_running) mysql_start(); else if (restart) mysql_restart(); - - // let the system stabalize + + /* let the system stabalize */ sleep(1); - // show test + /* show test */ mlog("%-46s ", test); - - - // args + + /* args */ init_args(&al); add_arg(&al, "%s", mysqltest_file); add_arg(&al, "--no-defaults"); @@ -1025,7 +1049,7 @@ void run_test(char *test) #if !defined(__NETWARE__) && !defined(__WIN__) add_arg(&al, "--socket=%s", master_socket); add_arg(&al, "--tmpdir=%s", mysql_tmp_dir); -#endif +#endif add_arg(&al, "--database=%s", db); add_arg(&al, "--user=%s", user); add_arg(&al, "--password=%s", password); @@ -1043,70 +1067,71 @@ void run_test(char *test) add_arg(&al, "--ssl-key=%s", client_key); } - // spawn - err = spawn(mysqltest_file, &al, TRUE, test_file, out_file, err_file, NULL); - - // free args + /* spawn */ + err= spawn(mysqltest_file, &al, TRUE, test_file, out_file, err_file, NULL); + + /* free args */ free_args(&al); - remove_empty_file(out_file); - remove_empty_file(err_file); - + remove_empty_file(out_file); + remove_empty_file(err_file); + if (err == 0) { - // pass - rstr = TEST_PASS; + /* pass */ + rstr= TEST_PASS; ++total_pass; - - // increment total + + /* increment total */ ++total_test; } else if (err == 2) { - // skip - rstr = TEST_SKIP; + /* skip */ + rstr= TEST_SKIP; ++total_skip; } else if (err == 1) { - // fail - rstr = TEST_FAIL; + /* fail */ + rstr= TEST_FAIL; ++total_fail; - // increment total + /* increment total */ ++total_test; } else { - rstr = TEST_BAD; + rstr= TEST_BAD; } } - else // early skips + else /* early skips */ { - // show test + /* show test */ mlog("%-46s ", test); - - // skip - rstr = TEST_SKIP; + + /* skip */ + rstr= TEST_SKIP; ++total_skip; } - // result + /* result */ mlog("%-14s\n", rstr); } /****************************************************************************** vlog() - + Log the message. ******************************************************************************/ + void vlog(const char *format, va_list ap) { vfprintf(stdout, format, ap); fflush(stdout); - + if (log_fd) { vfprintf(log_fd, format, ap); @@ -1117,10 +1142,11 @@ void vlog(const char *format, va_list ap) /****************************************************************************** log() - + Log the message. ******************************************************************************/ + void mlog(const char *format, ...) { va_list ap; @@ -1128,21 +1154,22 @@ void mlog(const char *format, ...) va_start(ap, format); vlog(format, ap); - + va_end(ap); } /****************************************************************************** log_info() - + Log the given information. ******************************************************************************/ + void log_info(const char *format, ...) { va_list ap; - + va_start(ap, format); mlog("-- INFO : "); @@ -1155,14 +1182,15 @@ void log_info(const char *format, ...) /****************************************************************************** log_error() - + Log the given error. ******************************************************************************/ + void log_error(const char *format, ...) { va_list ap; - + va_start(ap, format); mlog("-- ERROR: "); @@ -1175,14 +1203,15 @@ void log_error(const char *format, ...) /****************************************************************************** log_errno() - + Log the given error and errno. ******************************************************************************/ + void log_errno(const char *format, ...) { va_list ap; - + va_start(ap, format); mlog("-- ERROR: (%003u) ", errno); @@ -1195,10 +1224,11 @@ void log_errno(const char *format, ...) /****************************************************************************** die() - + Exit the application. ******************************************************************************/ + void die(const char *msg) { log_error(msg); @@ -1211,48 +1241,49 @@ void die(const char *msg) /****************************************************************************** setup() - + Setup the mysql test enviornment. ******************************************************************************/ -void setup(char *file) + +void setup(char *file __attribute__((unused))) { char temp[PATH_MAX]; char file_path[PATH_MAX*2]; char *p; int position; - // set the timezone for the timestamp test + /* set the timezone for the timestamp test */ #ifdef __WIN__ _putenv( "TZ=GMT-3" ); #else setenv("TZ", "GMT-3", TRUE); #endif - // find base dir -#ifdef __NETWARE__ + /* find base dir */ +#ifdef __NETWARE__ strcpy(temp, strlwr(file)); - while((p = strchr(temp, '\\')) != NULL) *p = '/'; -#else + while ((p= strchr(temp, '\\')) != NULL) *p= '/'; +#else getcwd(temp, PATH_MAX); - position = strlen(temp); - temp[position] = '/'; - temp[position+1] = 0; + position= strlen(temp); + temp[position]= '/'; + temp[position+1]= 0; #ifdef __WIN__ - while((p = strchr(temp, '\\')) != NULL) *p = '/'; + while ((p= strchr(temp, '\\')) != NULL) *p= '/'; +#endif #endif -#endif - if ((position = strinstr(temp, "/mysql-test/")) != 0) + if ((position= strinstr(temp, "/mysql-test/")) != 0) { - p = temp + position - 1; - *p = 0; + p= temp + position - 1; + *p= 0; strcpy(base_dir, temp); - } + } log_info("Currect directory: %s",base_dir); #ifdef __NETWARE__ - // setup paths + /* setup paths */ snprintf(bin_dir, PATH_MAX, "%s/bin", base_dir); snprintf(mysql_test_dir, PATH_MAX, "%s/mysql-test", base_dir); snprintf(test_dir, PATH_MAX, "%s/t", mysql_test_dir); @@ -1264,24 +1295,24 @@ void setup(char *file) snprintf(char_dir, PATH_MAX, "%s/share/charsets", base_dir); #ifdef HAVE_OPENSSL - use_openssl = TRUE; -#endif // HAVE_OPENSSL + use_openssl= TRUE; +#endif /* HAVE_OPENSSL */ - // OpenSSL paths + /* OpenSSL paths */ snprintf(ca_cert, PATH_MAX, "%s/SSL/cacert.pem", base_dir); snprintf(server_cert, PATH_MAX, "%s/SSL/server-cert.pem", base_dir); snprintf(server_key, PATH_MAX, "%s/SSL/server-key.pem", base_dir); snprintf(client_cert, PATH_MAX, "%s/SSL/client-cert.pem", base_dir); snprintf(client_key, PATH_MAX, "%s/SSL/client-key.pem", base_dir); - // setup files + /* setup files */ snprintf(mysqld_file, PATH_MAX, "%s/mysqld", bin_dir); snprintf(mysqltest_file, PATH_MAX, "%s/mysqltest", bin_dir); snprintf(mysqladmin_file, PATH_MAX, "%s/mysqladmin", bin_dir); snprintf(master_pid, PATH_MAX, "%s/var/run/master.pid", mysql_test_dir); snprintf(slave_pid, PATH_MAX, "%s/var/run/slave.pid", mysql_test_dir); #elif __WIN__ - // setup paths + /* setup paths */ #ifdef _DEBUG snprintf(bin_dir, PATH_MAX, "%s/client_debug", base_dir); #else @@ -1297,22 +1328,22 @@ void setup(char *file) snprintf(char_dir, PATH_MAX, "%s/share/charsets", base_dir); #ifdef HAVE_OPENSSL - use_openssl = TRUE; -#endif // HAVE_OPENSSL + use_openssl= TRUE; +#endif /* HAVE_OPENSSL */ - // OpenSSL paths + /* OpenSSL paths */ snprintf(ca_cert, PATH_MAX, "%s/SSL/cacert.pem", base_dir); snprintf(server_cert, PATH_MAX, "%s/SSL/server-cert.pem", base_dir); snprintf(server_key, PATH_MAX, "%s/SSL/server-key.pem", base_dir); snprintf(client_cert, PATH_MAX, "%s/SSL/client-cert.pem", base_dir); snprintf(client_key, PATH_MAX, "%s/SSL/client-key.pem", base_dir); - // setup files + /* setup files */ snprintf(mysqld_file, PATH_MAX, "%s/mysqld.exe", bin_dir); snprintf(mysqltest_file, PATH_MAX, "%s/mysqltest.exe", bin_dir); snprintf(mysqladmin_file, PATH_MAX, "%s/mysqladmin.exe", bin_dir); -#else - // setup paths +#else + /* setup paths */ snprintf(bin_dir, PATH_MAX, "%s/client", base_dir); snprintf(mysql_test_dir, PATH_MAX, "%s/mysql-test", base_dir); snprintf(test_dir, PATH_MAX, "%s/t", mysql_test_dir); @@ -1324,60 +1355,72 @@ void setup(char *file) snprintf(char_dir, PATH_MAX, "%s/sql/share/charsets", base_dir); #ifdef HAVE_OPENSSL - use_openssl = TRUE; -#endif // HAVE_OPENSSL + use_openssl= TRUE; +#endif /* HAVE_OPENSSL */ - // OpenSSL paths + /* OpenSSL paths */ snprintf(ca_cert, PATH_MAX, "%s/SSL/cacert.pem", base_dir); snprintf(server_cert, PATH_MAX, "%s/SSL/server-cert.pem", base_dir); snprintf(server_key, PATH_MAX, "%s/SSL/server-key.pem", base_dir); snprintf(client_cert, PATH_MAX, "%s/SSL/client-cert.pem", base_dir); snprintf(client_key, PATH_MAX, "%s/SSL/client-key.pem", base_dir); - // setup files + /* setup files */ snprintf(mysqld_file, PATH_MAX, "%s/sql/mysqld", base_dir); snprintf(mysqltest_file, PATH_MAX, "%s/mysqltest", bin_dir); snprintf(mysqladmin_file, PATH_MAX, "%s/mysqladmin", bin_dir); snprintf(master_pid, PATH_MAX, "%s/var/run/master.pid", mysql_test_dir); snprintf(slave_pid, PATH_MAX, "%s/var/run/slave.pid", mysql_test_dir); - + snprintf(master_socket,PATH_MAX, "%s/var/tmp/master.sock", mysql_test_dir); snprintf(slave_socket,PATH_MAX, "%s/var/tmp/slave.sock", mysql_test_dir); #endif - // create log file + /* create log file */ snprintf(temp, PATH_MAX, "%s/mysql-test-run.log", mysql_test_dir); - if ((log_fd = fopen(temp, "w+")) == NULL) + if ((log_fd= fopen(temp, "w+")) == NULL) { log_errno("Unable to create log file."); } - // prepare skip test list - while((p = strchr(skip_test, ',')) != NULL) *p = ' '; + /* prepare skip test list */ + while ((p= strchr(skip_test, ',')) != NULL) *p= ' '; strcpy(temp, strlwr(skip_test)); snprintf(skip_test, PATH_MAX, " %s ", temp); - // environment -#ifdef __NETWARE__ + /* environment */ +#ifdef __NETWARE__ setenv("MYSQL_TEST_DIR", mysql_test_dir, 1); - snprintf(file_path, PATH_MAX*2, "%s/client/mysqldump --no-defaults -u root --port=%u", bin_dir, master_port); + snprintf(file_path, PATH_MAX*2, + "%s/client/mysqldump --no-defaults -u root --port=%u", + bin_dir, master_port); setenv("MYSQL_DUMP", file_path, 1); - snprintf(file_path, PATH_MAX*2, "%s/client/mysqlbinlog --no-defaults --local-load=%s", bin_dir, mysql_tmp_dir); + snprintf(file_path, PATH_MAX*2, + "%s/client/mysqlbinlog --no-defaults --local-load=%s", + bin_dir, mysql_tmp_dir); setenv("MYSQL_BINLOG", file_path, 1); #elif __WIN__ snprintf(file_path,MAX_PATH,"MYSQL_TEST_DIR=%s",mysql_test_dir); _putenv(file_path); - snprintf(file_path, PATH_MAX*2, "MYSQL_DUMP=%s/mysqldump.exe --no-defaults -u root --port=%u", bin_dir, master_port); + snprintf(file_path, PATH_MAX*2, + "MYSQL_DUMP=%s/mysqldump.exe --no-defaults -u root --port=%u", + bin_dir, master_port); _putenv(file_path); - snprintf(file_path, PATH_MAX*2, "MYSQL_BINLOG=%s/mysqlbinlog.exe --no-defaults --local-load=%s", bin_dir, mysql_tmp_dir); + snprintf(file_path, PATH_MAX*2, + "MYSQL_BINLOG=%s/mysqlbinlog.exe --no-defaults --local-load=%s", + bin_dir, mysql_tmp_dir); _putenv(file_path); #else setenv("MYSQL_TEST_DIR", mysql_test_dir, 1); - snprintf(file_path, PATH_MAX*2, "%s/mysqldump --no-defaults -u root --port=%u --socket=%s", bin_dir, master_port, master_socket); + snprintf(file_path, PATH_MAX*2, + "%s/mysqldump --no-defaults -u root --port=%u --socket=%s", + bin_dir, master_port, master_socket); setenv("MYSQL_DUMP", file_path, 1); - snprintf(file_path, PATH_MAX*2, "%s/mysqlbinlog --no-defaults --local-load=%s", bin_dir, mysql_tmp_dir); + snprintf(file_path, PATH_MAX*2, + "%s/mysqlbinlog --no-defaults --local-load=%s", + bin_dir, mysql_tmp_dir); setenv("MYSQL_BINLOG", file_path, 1); -#endif +#endif #ifndef __WIN__ setenv("MASTER_MYPORT", "9306", 1); @@ -1394,21 +1437,23 @@ void setup(char *file) /****************************************************************************** main() - + ******************************************************************************/ + int main(int argc, char **argv) { - int is_ignore_list = 0; - // setup + int is_ignore_list= 0; + /* setup */ setup(argv[0]); - - /* The --ignore option is comma saperated list of test cases to skip and - should be very first command line option to the test suite. - The usage is now: - mysql_test_run --ignore=test1,test2 test3 test4 - where test1 and test2 are test cases to ignore - and test3 and test4 are test cases to run. + /* + The --ignore option is comma saperated list of test cases to skip and + should be very first command line option to the test suite. + + The usage is now: + mysql_test_run --ignore=test1,test2 test3 test4 + where test1 and test2 are test cases to ignore + and test3 and test4 are test cases to run. */ if (argc >= 2 && !strnicmp(argv[1], "--ignore=", sizeof("--ignore=")-1)) { @@ -1425,22 +1470,22 @@ int main(int argc, char **argv) } } free(temp); - is_ignore_list = 1; + is_ignore_list= 1; } - // header + /* header */ #ifndef __WIN__ mlog("MySQL Server %s, for %s (%s)\n\n", VERSION, SYSTEM_TYPE, MACHINE_TYPE); #else mlog("MySQL Server ---, for %s (%s)\n\n", SYSTEM_TYPE, MACHINE_TYPE); #endif - + mlog("Initializing Tests...\n"); - - // install test databases + + /* install test databases */ mysql_install_db(); - + mlog("Starting Tests...\n"); - + mlog("\n"); mlog(HEADER); mlog(DASH); @@ -1449,46 +1494,46 @@ int main(int argc, char **argv) { int i; - // single test - single_test = TRUE; + /* single test */ + single_test= TRUE; - for (i = 1 + is_ignore_list; i < argc; i++) + for (i= 1 + is_ignore_list; i < argc; i++) { - // run given test + /* run given test */ run_test(argv[i]); } } else { - // run all tests + /* run all tests */ #ifndef __WIN__ struct dirent **namelist; int i,n; char test[NAME_MAX]; char *p; int position; - - n = scandir(test_dir, &namelist, 0, alphasort); + + n= scandir(test_dir, &namelist, 0, alphasort); if (n < 0) die("Unable to open tests directory."); - else + else { - for (i = 0; i < n; i++) + for (i= 0; i < n; i++) { - strcpy(test, strlwr(namelist[i]->d_name)); - // find the test suffix - if ((position = strinstr(test, TEST_SUFFIX)) != 0) + strcpy(test, strlwr(namelist[i]->d_name)); + /* find the test suffix */ + if ((position= strinstr(test, TEST_SUFFIX)) != 0) { - p = test + position - 1; - // null terminate at the suffix - *p = 0; - // run test + p= test + position - 1; + /* null terminate at the suffix */ + *p= 0; + /* run test */ run_test(test); } free(namelist[n]); - } + } free(namelist); - } + } #else struct _finddata_t dir; intptr_t handle; @@ -1496,52 +1541,52 @@ int main(int argc, char **argv) char mask[PATH_MAX]; char *p; int position; - char **names = 0; - char **testes = 0; + char **names= 0; + char **testes= 0; int name_index; int index; - - // single test - single_test = FALSE; + + /* single test */ + single_test= FALSE; snprintf(mask,MAX_PATH,"%s/*.test",test_dir); - + if ((handle=_findfirst(mask,&dir)) == -1L) { die("Unable to open tests directory."); } - names = malloc(MAX_COUNT_TESTES*4); - testes = names; - name_index = 0; + names= malloc(MAX_COUNT_TESTES*4); + testes= names; + name_index= 0; do { - if (!(dir.attrib & _A_SUBDIR)) + if (!(dir.attrib & _A_SUBDIR)) { strcpy(test, strlwr(dir.name)); - - // find the test suffix - if ((position = strinstr(test, TEST_SUFFIX)) != 0) - { - p = test + position - 1; - // null terminate at the suffix - *p = 0; - // insert test - *names = malloc(PATH_MAX); + /* find the test suffix */ + if ((position= strinstr(test, TEST_SUFFIX)) != 0) + { + p= test + position - 1; + /* null terminate at the suffix */ + *p= 0; + + /* insert test */ + *names= malloc(PATH_MAX); strcpy(*names,test); names++; name_index++; } - } + } }while (_findnext(handle,&dir) == 0); _findclose(handle); qsort( (void *)testes, name_index, sizeof( char * ), compare ); - for (index = 0; index <= name_index; index++) + for (index= 0; index <= name_index; index++) { run_test(testes[index]); free(testes[index]); @@ -1551,7 +1596,7 @@ int main(int argc, char **argv) #endif } - // stop server + /* stop server */ mysql_stop(); mlog(DASH); @@ -1559,14 +1604,14 @@ int main(int argc, char **argv) mlog("Ending Tests...\n"); - // report stats + /* report stats */ report_stats(); - // close log + /* close log */ if (log_fd) fclose(log_fd); - // keep results up -#ifdef __NETWARE__ + /* keep results up */ +#ifdef __NETWARE__ pressanykey(); #endif return 0; @@ -1577,12 +1622,12 @@ int main(int argc, char **argv) Synopsis: This function breaks the string into a sequence of tokens. The difference between this function and strtok is that it respects the quoted string i.e. - it skips any delimiter character within the quoted part of the string. + it skips any delimiter character within the quoted part of the string. It return tokens by eliminating quote character. It modifies the input string passed. It will work with whitespace delimeter but may not work properly with other delimeter. If the delimeter will contain any quote character, then function will not tokenize and will return null string. - e.g. if input string is + e.g. if input string is --init-slave="set global max_connections=500" --skip-external-locking then the output will two string i.e. --init-slave=set global max_connections=500 @@ -1595,7 +1640,6 @@ Output: return the null terminated token of NULL. */ - char *str_tok(char *string, const char *delim) { char *token; /* current token received from strtok */ @@ -1607,40 +1651,38 @@ char *str_tok(char *string, const char *delim) char *ptr_token=NULL; /* pointer to the quote character in the token from strtok */ char *ptr_quote=NULL; - + /* See if the delimeter contains any quote character */ if (strchr(delim,'\'') || strchr(delim,'\"')) return NULL; /* repeate till we are getting some token from strtok */ - while ((token = (char*)strtok(string, delim) ) != NULL) + while ((token= (char*)strtok(string, delim) ) != NULL) { /* make the input string NULL so that next time onward strtok can be called with NULL input string. */ - string = NULL; - /* - We don't need to remove any quote character for Windows version - */ + string= NULL; + /* We don't need to remove any quote character for Windows version */ #ifndef __WIN__ /* check if the current token contain double quote character*/ - if ((ptr_quote = (char*)strchr(token,'\"')) != NULL) + if ((ptr_quote= (char*)strchr(token,'\"')) != NULL) { /* get the matching the matching double quote in the remaining input string */ - qt_token = (char*)strtok(NULL,"\""); + qt_token= (char*)strtok(NULL,"\""); } /* check if the current token contain single quote character*/ - else if ((ptr_quote = (char*)strchr(token,'\'')) != NULL) + else if ((ptr_quote= (char*)strchr(token,'\'')) != NULL) { /* get the matching the matching single quote in the remaining input string */ - qt_token = (char*)strtok(NULL,"\'"); + qt_token= (char*)strtok(NULL,"\'"); } #endif /* @@ -1663,7 +1705,7 @@ char *str_tok(char *string, const char *delim) and hence quote will be removed */ *ptr_quote= 0; - + /* check if ptr_token has been initialized or not */ if (ptr_token == NULL) { @@ -1678,18 +1720,18 @@ char *str_tok(char *string, const char *delim) copy the current token and entire string between matching pair of quote */ - if (qt_token == NULL) - { - sprintf(ptr_token+strlen(ptr_token),"%s%s", token, ptr_quote+1); - } - else - { - sprintf(ptr_token+strlen(ptr_token),"%s%s %s", token, ptr_quote+1, - qt_token ); - } + if (qt_token == NULL) + { + sprintf(ptr_token+strlen(ptr_token),"%s%s", token, ptr_quote+1); + } + else + { + sprintf(ptr_token+strlen(ptr_token),"%s%s %s", token, ptr_quote+1, + qt_token ); + } } } - + /* return the concatenated token */ return ptr_token; } @@ -1706,23 +1748,24 @@ Arguments: Output: nothing */ + void run_init_script(const char *script_name) { arg_list_t al; int err; - - // args + + /* args */ init_args(&al); add_arg(&al, sh_file); add_arg(&al, script_name); - - // spawn - if ((err = spawn(sh_file, &al, TRUE, NULL, NULL, NULL, NULL)) != 0) + + /* spawn */ + if ((err= spawn(sh_file, &al, TRUE, NULL, NULL, NULL, NULL)) != 0) { die("Unable to run script."); } - - // free args + + /* free args */ free_args(&al); } #endif From 28986c7f92ab164e73f969581a7653d65958673e Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 7 Nov 2004 09:42:27 +0000 Subject: [PATCH 0132/1063] wrong copyright --- ndb/src/common/editline/complete.c | 16 ---------------- ndb/src/common/editline/editline.c | 16 ---------------- ndb/src/common/editline/editline_internal.h | 16 ---------------- ndb/src/common/editline/sysunix.c | 16 ---------------- ndb/src/common/editline/unix.h | 16 ---------------- 5 files changed, 80 deletions(-) diff --git a/ndb/src/common/editline/complete.c b/ndb/src/common/editline/complete.c index d1f8b1d3ff4..c524a88c678 100644 --- a/ndb/src/common/editline/complete.c +++ b/ndb/src/common/editline/complete.c @@ -1,19 +1,3 @@ -/* Copyright (C) 2003 MySQL AB - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - /* -*- c-basic-offset: 4; -*- ** $Revision: 1.8 $ ** diff --git a/ndb/src/common/editline/editline.c b/ndb/src/common/editline/editline.c index 1e4c1ecba76..886dac2793b 100644 --- a/ndb/src/common/editline/editline.c +++ b/ndb/src/common/editline/editline.c @@ -1,19 +1,3 @@ -/* Copyright (C) 2003 MySQL AB - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - /* -*- c-basic-offset: 4; -*- ** $Revision: 1.6 $ ** diff --git a/ndb/src/common/editline/editline_internal.h b/ndb/src/common/editline/editline_internal.h index 5ed2b32a873..d82fa91c44b 100644 --- a/ndb/src/common/editline/editline_internal.h +++ b/ndb/src/common/editline/editline_internal.h @@ -1,19 +1,3 @@ -/* Copyright (C) 2003 MySQL AB - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - /* $Revision: 1.2 $ ** ** Internal header file for editline library. diff --git a/ndb/src/common/editline/sysunix.c b/ndb/src/common/editline/sysunix.c index d7437f6a9c7..b0242fb99ce 100644 --- a/ndb/src/common/editline/sysunix.c +++ b/ndb/src/common/editline/sysunix.c @@ -1,19 +1,3 @@ -/* Copyright (C) 2003 MySQL AB - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - /* $Revision: 1.4 $ ** ** Unix system-dependant routines for editline library. diff --git a/ndb/src/common/editline/unix.h b/ndb/src/common/editline/unix.h index 37f461b471d..c2fde7547b3 100644 --- a/ndb/src/common/editline/unix.h +++ b/ndb/src/common/editline/unix.h @@ -1,19 +1,3 @@ -/* Copyright (C) 2003 MySQL AB - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - /* $Revision: 1.3 $ ** ** Editline system header file for Unix. From 435b20aa6897b142f90267ea3ed7a7cef1cc385a Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 8 Nov 2004 01:13:54 +0200 Subject: [PATCH 0133/1063] Simpler arena swapping code Now thd->mem_root is a pointer to thd->main_mem_root and THR_MALLOC is a pointer to thd->mem_root. This gives us the following benefits: - Allow us to easily detect if arena has already been swapped before (this fixes a bug in setup_conds() where arena was swaped twice in some cases) - Faster swaps of arenas (as we don't have to copy the whole MEM_ROOT) - We don't anymore have to call my_pthread_setspecific_ptr(THR_MALLOC,...) to change where memory is alloced. Now it's enough to set thd->mem_root client/mysqltest.c: Remove some not needed defines (Things like this should be done in config-win.h) include/config-win.h: Added popen() and pclose() compatibility macros mysql-test/t/rpl_failed_optimize-master.opt: Portability fix sql/ha_berkeley.cc: New thd->memroot handling sql/item_cmpfunc.cc: Simpler arena swapping code sql/item_func.cc: Simpler arena swapping code sql/item_subselect.cc: Simpler arena swapping code New thd->mem_root handling sql/item_sum.cc: New thd->mem_root handling sql/item_timefunc.cc: Fixed not-initalized usage errors found by valgrind sql/log_event.cc: New thd->mem_root handling sql/mysql_priv.h: New thd->mem_root handling sql/mysqld.cc: New thd->mem_root handling sql/opt_range.cc: New thd->mem_root handling sql/repl_failsafe.cc: New thd->mem_root handling sql/set_var.cc: New thd->mem_root handling sql/sql_acl.cc: New thd->mem_root handling sql/sql_base.cc: Simpler arena swapping code New thd->mem_root handling sql/sql_class.cc: New thd->mem_root handling sql/sql_class.h: Simpler arena swapping code New thd->mem_root handling sql/sql_db.cc: New thd->mem_root handling sql/sql_error.cc: New thd->mem_root handling sql/sql_help.cc: New thd->mem_root handling sql/sql_insert.cc: New thd->mem_root handling sql/sql_parse.cc: New thd->mem_root handling Added some extra checking of return value of new sql/sql_prepare.cc: New thd->mem_root handling sql/sql_select.cc: New thd->mem_root handling sql/sql_select.h: New thd->mem_root handling sql/sql_union.cc: Simpler arena swapping code sql/sql_yacc.yy: New thd->mem_root handling sql/table.cc: New thd->mem_root handling sql/thr_malloc.cc: New thd->mem_root handling tests/client_test.c: Added drop table to some tests Changed some table names to 't1' --- client/mysqltest.c | 8 -- include/config-win.h | 2 + mysql-test/t/rpl_failed_optimize-master.opt | 2 +- sql/ha_berkeley.cc | 10 ++- sql/item_cmpfunc.cc | 8 +- sql/item_func.cc | 7 +- sql/item_subselect.cc | 44 +++++------ sql/item_sum.cc | 30 +++---- sql/item_timefunc.cc | 6 +- sql/log_event.cc | 8 +- sql/mysql_priv.h | 2 +- sql/mysqld.cc | 2 +- sql/opt_range.cc | 15 ++-- sql/repl_failsafe.cc | 2 +- sql/set_var.cc | 2 +- sql/sql_acl.cc | 10 ++- sql/sql_base.cc | 49 ++++++------ sql/sql_class.cc | 22 +++--- sql/sql_class.h | 32 ++++++-- sql/sql_db.cc | 2 +- sql/sql_error.cc | 6 +- sql/sql_help.cc | 14 ++-- sql/sql_insert.cc | 4 +- sql/sql_parse.cc | 24 +++--- sql/sql_prepare.cc | 6 +- sql/sql_select.cc | 8 +- sql/sql_select.h | 2 +- sql/sql_union.cc | 14 ++-- sql/sql_yacc.yy | 16 ++-- sql/table.cc | 14 ++-- sql/thr_malloc.cc | 2 +- tests/client_test.c | 86 ++++++++++++--------- 32 files changed, 243 insertions(+), 216 deletions(-) diff --git a/client/mysqltest.c b/client/mysqltest.c index df80fc7bb66..a207da21af5 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -949,11 +949,7 @@ static void do_exec(struct st_query* q) while (fgets(buf, sizeof(buf), res_file)) replace_dynstr_append_mem(ds, buf, strlen(buf)); } -#ifndef __WIN__ error= pclose(res_file); -#else - error= _pclose(res_file); -#endif if (error != 0) die("command \"%s\" failed", cmd); @@ -4610,11 +4606,7 @@ FILE *my_popen(const char *cmd, const char *mode __attribute__((unused))) FILE *res_file; subst_cmd= subst_env_var(cmd); -#ifndef __WIN__ res_file= popen(subst_cmd, "r0"); -#else - res_file= _popen(subst_cmd, "r0"); -#endif my_free(subst_cmd, MYF(0)); return res_file; } diff --git a/include/config-win.h b/include/config-win.h index d28bb25cd09..946a91d7d42 100644 --- a/include/config-win.h +++ b/include/config-win.h @@ -175,6 +175,8 @@ typedef uint rf_SetTimer; #define sigset(A,B) signal((A),(B)) #define finite(A) _finite(A) #define sleep(A) Sleep((A)*1000) +#define popen(A) popen(A,B) _popen((A),(B)) +#define pclose(A) _pclose(A) #ifndef __BORLANDC__ #define access(A,B) _access(A,B) diff --git a/mysql-test/t/rpl_failed_optimize-master.opt b/mysql-test/t/rpl_failed_optimize-master.opt index a6ef074a120..3f82baff598 100644 --- a/mysql-test/t/rpl_failed_optimize-master.opt +++ b/mysql-test/t/rpl_failed_optimize-master.opt @@ -1 +1 @@ ---innodb-lock-wait-timeout=1 +--loose-innodb-lock-wait-timeout=1 diff --git a/sql/ha_berkeley.cc b/sql/ha_berkeley.cc index 09b3e340d1f..2c7cce4bcd0 100644 --- a/sql/ha_berkeley.cc +++ b/sql/ha_berkeley.cc @@ -234,13 +234,13 @@ int berkeley_show_logs(Protocol *protocol) { char **all_logs, **free_logs, **a, **f; int error=1; - MEM_ROOT show_logs_root; - MEM_ROOT *old_root=my_pthread_getspecific_ptr(MEM_ROOT*,THR_MALLOC); + MEM_ROOT **root_ptr= my_pthread_getspecific_ptr(MEM_ROOT**,THR_MALLOC); + MEM_ROOT show_logs_root, *old_mem_root= *root_ptr; DBUG_ENTER("berkeley_show_logs"); init_sql_alloc(&show_logs_root, BDB_LOG_ALLOC_BLOCK_SIZE, BDB_LOG_ALLOC_BLOCK_SIZE); - my_pthread_setspecific_ptr(THR_MALLOC,&show_logs_root); + *root_ptr= &show_logs_root; if ((error= db_env->log_archive(db_env, &all_logs, DB_ARCH_ABS | DB_ARCH_LOG)) || @@ -277,15 +277,17 @@ int berkeley_show_logs(Protocol *protocol) } err: free_root(&show_logs_root,MYF(0)); - my_pthread_setspecific_ptr(THR_MALLOC,old_root); + *root_ptr= old_mem_root; DBUG_RETURN(error); } + static void berkeley_print_error(const char *db_errpfx, char *buffer) { sql_print_error("%s: %s",db_errpfx,buffer); /* purecov: tested */ } + static void berkeley_noticecall(DB_ENV *db_env, db_notices notice) { switch (notice) diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index a28f0f5d4a9..c36f2d191c7 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -1744,9 +1744,9 @@ void Item_func_in::fix_length_and_dec() Conversion is possible: All IN arguments are constants. */ - Item_arena *arena= thd->current_arena, backup; - if (arena->is_stmt_prepare()) - thd->set_n_backup_item_arena(arena, &backup); + Item_arena *arena, backup; + arena= thd->change_arena_if_needed(&backup); + for (arg= args+1, arg_end= args+arg_count; arg < arg_end; arg++) { if (!arg[0]->null_value && @@ -1764,7 +1764,7 @@ void Item_func_in::fix_length_and_dec() arg[0]= conv; } } - if (arena->is_stmt_prepare()) + if (arena) thd->restore_backup_item_arena(arena, &backup); } } diff --git a/sql/item_func.cc b/sql/item_func.cc index b382dbf7bf9..bf85e5b378a 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -160,14 +160,13 @@ bool Item_func::agg_arg_charsets(DTCollation &coll, } THD *thd= current_thd; - Item_arena *arena= thd->current_arena, backup; + Item_arena *arena, backup; bool res= FALSE; /* In case we're in statement prepare, create conversion item in its memory: it will be reused on each execute. */ - if (arena->is_stmt_prepare()) - thd->set_n_backup_item_arena(arena, &backup); + arena= thd->change_arena_if_needed(&backup); for (arg= args, last= args + nargs; arg < last; arg++) { @@ -193,7 +192,7 @@ bool Item_func::agg_arg_charsets(DTCollation &coll, conv->fix_fields(thd, 0, &conv); *arg= conv; } - if (arena->is_stmt_prepare()) + if (arena) thd->restore_backup_item_arena(arena, &backup); return res; } diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index 401d4dee20f..62cd016b0df 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -190,15 +190,16 @@ bool Item_subselect::fix_fields(THD *thd_param, TABLE_LIST *tables, Item **ref) bool Item_subselect::exec() { int res; - MEM_ROOT *old_root= my_pthread_getspecific_ptr(MEM_ROOT*, THR_MALLOC); - if (&thd->mem_root != old_root) - { - my_pthread_setspecific_ptr(THR_MALLOC, &thd->mem_root); - res= engine->exec(); - my_pthread_setspecific_ptr(THR_MALLOC, old_root); - } - else - res= engine->exec(); + MEM_ROOT *old_root= thd->mem_root; + + /* + As this is execution, all objects should be allocated through the main + mem root + */ + thd->mem_root= &thd->main_mem_root; + res= engine->exec(); + thd->mem_root= old_root; + if (engine_changed) { engine_changed= 0; @@ -312,7 +313,6 @@ Item_singlerow_subselect::select_transformer(JOIN *join) /* Juggle with current arena only if we're in prepared statement prepare */ Item_arena *arena= join->thd->current_arena; - Item_arena backup; if (!select_lex->master_unit()->first_select()->next_select() && !select_lex->table_list.elements && @@ -655,11 +655,9 @@ Item_in_subselect::single_value_transformer(JOIN *join, } SELECT_LEX *select_lex= join->select_lex; - Item_arena *arena= join->thd->current_arena, backup; - + Item_arena *arena, backup; + arena= thd->change_arena_if_needed(&backup); thd->where= "scalar IN/ALL/ANY subquery"; - if (arena->is_stmt_prepare()) - thd->set_n_backup_item_arena(arena, &backup); /* Check that the right part of the subselect contains no more than one @@ -892,7 +890,7 @@ Item_in_subselect::single_value_transformer(JOIN *join, push_warning(thd, MYSQL_ERROR::WARN_LEVEL_NOTE, ER_SELECT_REDUCED, warn_buff); } - if (arena->is_stmt_prepare()) + if (arena) thd->restore_backup_item_arena(arena, &backup); DBUG_RETURN(RES_REDUCE); } @@ -900,13 +898,13 @@ Item_in_subselect::single_value_transformer(JOIN *join, } ok: - if (arena->is_stmt_prepare()) + if (arena) thd->restore_backup_item_arena(arena, &backup); thd->where= save_where; DBUG_RETURN(RES_OK); err: - if (arena->is_stmt_prepare()) + if (arena) thd->restore_backup_item_arena(arena, &backup); DBUG_RETURN(RES_ERROR); } @@ -922,14 +920,12 @@ Item_in_subselect::row_value_transformer(JOIN *join) { DBUG_RETURN(RES_OK); } - Item_arena *arena= join->thd->current_arena, backup; + Item_arena *arena, backup; Item *item= 0; + SELECT_LEX *select_lex= join->select_lex; thd->where= "row IN/ALL/ANY subquery"; - if (arena->is_stmt_prepare()) - thd->set_n_backup_item_arena(arena, &backup); - - SELECT_LEX *select_lex= join->select_lex; + arena= thd->change_arena_if_needed(&backup); if (select_lex->item_list.elements != left_expr->cols()) { @@ -1006,13 +1002,13 @@ Item_in_subselect::row_value_transformer(JOIN *join) if (join->conds->fix_fields(thd, join->tables_list, 0)) goto err; } - if (arena->is_stmt_prepare()) + if (arena) thd->restore_backup_item_arena(arena, &backup); thd->where= save_where; DBUG_RETURN(RES_OK); err: - if (arena->is_stmt_prepare()) + if (arena) thd->restore_backup_item_arena(arena, &backup); DBUG_RETURN(RES_ERROR); } diff --git a/sql/item_sum.cc b/sql/item_sum.cc index e6c96dd6a9a..3b3a6083725 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -254,7 +254,7 @@ Item_sum_hybrid::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref) Item *Item_sum_sum::copy_or_same(THD* thd) { - return new (&thd->mem_root) Item_sum_sum(thd, this); + return new (thd->mem_root) Item_sum_sum(thd, this); } @@ -282,7 +282,7 @@ double Item_sum_sum::val() Item *Item_sum_count::copy_or_same(THD* thd) { - return new (&thd->mem_root) Item_sum_count(thd, this); + return new (thd->mem_root) Item_sum_count(thd, this); } @@ -327,7 +327,7 @@ void Item_sum_count::cleanup() Item *Item_sum_avg::copy_or_same(THD* thd) { - return new (&thd->mem_root) Item_sum_avg(thd, this); + return new (thd->mem_root) Item_sum_avg(thd, this); } @@ -374,7 +374,7 @@ double Item_sum_std::val() Item *Item_sum_std::copy_or_same(THD* thd) { - return new (&thd->mem_root) Item_sum_std(thd, this); + return new (thd->mem_root) Item_sum_std(thd, this); } @@ -384,7 +384,7 @@ Item *Item_sum_std::copy_or_same(THD* thd) Item *Item_sum_variance::copy_or_same(THD* thd) { - return new (&thd->mem_root) Item_sum_variance(thd, this); + return new (thd->mem_root) Item_sum_variance(thd, this); } @@ -546,7 +546,7 @@ void Item_sum_hybrid::cleanup() Item *Item_sum_min::copy_or_same(THD* thd) { - return new (&thd->mem_root) Item_sum_min(thd, this); + return new (thd->mem_root) Item_sum_min(thd, this); } @@ -599,7 +599,7 @@ bool Item_sum_min::add() Item *Item_sum_max::copy_or_same(THD* thd) { - return new (&thd->mem_root) Item_sum_max(thd, this); + return new (thd->mem_root) Item_sum_max(thd, this); } @@ -666,7 +666,7 @@ void Item_sum_bit::clear() Item *Item_sum_or::copy_or_same(THD* thd) { - return new (&thd->mem_root) Item_sum_or(thd, this); + return new (thd->mem_root) Item_sum_or(thd, this); } @@ -680,7 +680,7 @@ bool Item_sum_or::add() Item *Item_sum_xor::copy_or_same(THD* thd) { - return new (&thd->mem_root) Item_sum_xor(thd, this); + return new (thd->mem_root) Item_sum_xor(thd, this); } @@ -694,7 +694,7 @@ bool Item_sum_xor::add() Item *Item_sum_and::copy_or_same(THD* thd) { - return new (&thd->mem_root) Item_sum_and(thd, this); + return new (thd->mem_root) Item_sum_and(thd, this); } @@ -1337,7 +1337,7 @@ int Item_sum_count_distinct::tree_to_myisam() Item *Item_sum_count_distinct::copy_or_same(THD* thd) { - return new (&thd->mem_root) Item_sum_count_distinct(thd, this); + return new (thd->mem_root) Item_sum_count_distinct(thd, this); } @@ -1438,7 +1438,7 @@ bool Item_udf_sum::add() Item *Item_sum_udf_float::copy_or_same(THD* thd) { - return new (&thd->mem_root) Item_sum_udf_float(thd, this); + return new (thd->mem_root) Item_sum_udf_float(thd, this); } double Item_sum_udf_float::val() @@ -1463,7 +1463,7 @@ String *Item_sum_udf_float::val_str(String *str) Item *Item_sum_udf_int::copy_or_same(THD* thd) { - return new (&thd->mem_root) Item_sum_udf_int(thd, this); + return new (thd->mem_root) Item_sum_udf_int(thd, this); } @@ -1501,7 +1501,7 @@ void Item_sum_udf_str::fix_length_and_dec() Item *Item_sum_udf_str::copy_or_same(THD* thd) { - return new (&thd->mem_root) Item_sum_udf_str(thd, this); + return new (thd->mem_root) Item_sum_udf_str(thd, this); } @@ -1815,7 +1815,7 @@ Item_func_group_concat::~Item_func_group_concat() Item *Item_func_group_concat::copy_or_same(THD* thd) { - return new (&thd->mem_root) Item_func_group_concat(thd, this); + return new (thd->mem_root) Item_func_group_concat(thd, this); } diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index f621953a5bc..41418c0094d 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -164,10 +164,10 @@ static bool extract_date_time(DATE_TIME_FORMAT *format, CHARSET_INFO *cs= &my_charset_bin; int error= 0; bool usa_time= 0; - bool sunday_first_n_first_week_non_iso; + bool sunday_first_n_first_week_non_iso= -2; bool strict_week_number; int strict_week_number_year= -1; - bool strict_week_number_year_type; + bool strict_week_number_year_type= -1; int frac_part; const char *val_begin= val; const char *val_end= val + length; @@ -175,9 +175,7 @@ static bool extract_date_time(DATE_TIME_FORMAT *format, const char *end= ptr + format->format.length; DBUG_ENTER("extract_date_time"); - LINT_INIT(sunday_first_n_first_week_non_iso); LINT_INIT(strict_week_number); - LINT_INIT(strict_week_number_year_type); if (!sub_pattern_end) bzero((char*) l_time, sizeof(*l_time)); diff --git a/sql/log_event.cc b/sql/log_event.cc index 326f2fc5c59..8e7f8062014 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -1090,7 +1090,7 @@ end: thd->query_length= thd->db_length =0; VOID(pthread_mutex_unlock(&LOCK_thread_count)); close_thread_tables(thd); - free_root(&thd->mem_root,MYF(MY_KEEP_PREALLOC)); + free_root(thd->mem_root,MYF(MY_KEEP_PREALLOC)); /* If there was an error we stop. Otherwise we increment positions. Note that we will not increment group* positions if we are just after a SET @@ -1888,10 +1888,10 @@ Slave: load data infile on table '%s' at log position %s in log \ slave_print_error(rli,sql_errno,"\ Error '%s' running LOAD DATA INFILE on table '%s'. Default database: '%s'", err, (char*)table_name, print_slave_db_safe(db)); - free_root(&thd->mem_root,MYF(MY_KEEP_PREALLOC)); + free_root(thd->mem_root,MYF(MY_KEEP_PREALLOC)); return 1; } - free_root(&thd->mem_root,MYF(MY_KEEP_PREALLOC)); + free_root(thd->mem_root,MYF(MY_KEEP_PREALLOC)); if (thd->is_fatal_error) { @@ -2505,7 +2505,7 @@ int User_var_log_event::exec_event(struct st_relay_log_info* rli) */ e.fix_fields(thd, 0, 0); e.update_hash(val, val_len, type, charset, DERIVATION_NONE); - free_root(&thd->mem_root,0); + free_root(thd->mem_root,0); rli->inc_event_relay_log_pos(get_event_len()); return 0; diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 770b7057661..3f55a88b262 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -910,7 +910,7 @@ extern char *default_tz_name; extern MYSQL_LOG mysql_log,mysql_update_log,mysql_slow_log,mysql_bin_log; extern FILE *bootstrap_file; -extern pthread_key(MEM_ROOT*,THR_MALLOC); +extern pthread_key(MEM_ROOT**,THR_MALLOC); extern pthread_mutex_t LOCK_mysql_create_db,LOCK_Acl,LOCK_open, LOCK_thread_count,LOCK_mapped_file,LOCK_user_locks, LOCK_status, LOCK_error_log, LOCK_delayed_insert, LOCK_uuid_generator, diff --git a/sql/mysqld.cc b/sql/mysqld.cc index af6f25c1400..078ee19fe6a 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -374,7 +374,7 @@ SHOW_COMP_OPTION have_crypt, have_compress; /* Thread specific variables */ -pthread_key(MEM_ROOT*,THR_MALLOC); +pthread_key(MEM_ROOT**,THR_MALLOC); pthread_key(THD*, THR_THD); pthread_mutex_t LOCK_mysql_create_db, LOCK_Acl, LOCK_open, LOCK_thread_count, LOCK_mapped_file, LOCK_status, diff --git a/sql/opt_range.cc b/sql/opt_range.cc index c9528af7d98..d25901e56b1 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -400,7 +400,7 @@ QUICK_SELECT::QUICK_SELECT(THD *thd, TABLE *table, uint key_nr, bool no_alloc) { // Allocates everything through the internal memroot init_sql_alloc(&alloc, thd->variables.range_alloc_block_size, 0); - my_pthread_setspecific_ptr(THR_MALLOC,&alloc); + thd->mem_root= &alloc; } else bzero((char*) &alloc,sizeof(alloc)); @@ -668,8 +668,8 @@ int SQL_SELECT::test_quick_select(THD *thd, key_map keys_to_use, DBUG_RETURN(0); // Can't use range } key_parts= param.key_parts; - old_root=my_pthread_getspecific_ptr(MEM_ROOT*,THR_MALLOC); - my_pthread_setspecific_ptr(THR_MALLOC,&alloc); + old_root= thd->mem_root; + thd->mem_root= &alloc; key_info= head->key_info; for (idx=0 ; idx < head->keys ; idx++, key_info++) @@ -769,7 +769,7 @@ int SQL_SELECT::test_quick_select(THD *thd, key_map keys_to_use, } } free_root(&alloc,MYF(0)); // Return memory & allocator - my_pthread_setspecific_ptr(THR_MALLOC,old_root); + thd->mem_root= old_root; thd->no_errors=0; } DBUG_EXECUTE("info",print_quick(quick,&needed_reg);); @@ -2563,7 +2563,8 @@ static bool null_part_in_key(KEY_PART *key_part, const char *key, uint length) QUICK_SELECT *get_quick_select_for_ref(THD *thd, TABLE *table, TABLE_REF *ref) { - MEM_ROOT *old_root= my_pthread_getspecific_ptr(MEM_ROOT*, THR_MALLOC); + MEM_ROOT *old_root= thd->mem_root; + /* The following call may change thd->mem_root */ QUICK_SELECT *quick= new QUICK_SELECT(thd, table, ref->key); KEY *key_info = &table->key_info[ref->key]; KEY_PART *key_part; @@ -2624,11 +2625,11 @@ QUICK_SELECT *get_quick_select_for_ref(THD *thd, TABLE *table, TABLE_REF *ref) } ok: - my_pthread_setspecific_ptr(THR_MALLOC, old_root); + thd->mem_root= old_root; return quick; err: - my_pthread_setspecific_ptr(THR_MALLOC, old_root); + thd->mem_root= old_root; delete quick; return 0; } diff --git a/sql/repl_failsafe.cc b/sql/repl_failsafe.cc index 83fceca80ef..720e82f414e 100644 --- a/sql/repl_failsafe.cc +++ b/sql/repl_failsafe.cc @@ -92,7 +92,7 @@ static int init_failsafe_rpl_thread(THD* thd) VOID(pthread_sigmask(SIG_UNBLOCK,&set,&thd->block_signals)); #endif - thd->mem_root.free=thd->mem_root.used=0; + thd->mem_root->free= thd->mem_root->used= 0; if (thd->variables.max_join_size == HA_POS_ERROR) thd->options|= OPTION_BIG_SELECTS; diff --git a/sql/set_var.cc b/sql/set_var.cc index 905bffac29a..a97506ad07c 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -1165,7 +1165,7 @@ static void fix_max_connections(THD *thd, enum_var_type type) static void fix_thd_mem_root(THD *thd, enum_var_type type) { if (type != OPT_GLOBAL) - reset_root_defaults(&thd->mem_root, + reset_root_defaults(thd->mem_root, thd->variables.query_alloc_block_size, thd->variables.query_prealloc_size); } diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index ff2dfedc30b..98dde1071c3 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -2309,8 +2309,8 @@ int mysql_table_grant(THD *thd, TABLE_LIST *table_list, create_new_users= test_if_create_new_users(thd); int result=0; rw_wrlock(&LOCK_grant); - MEM_ROOT *old_root=my_pthread_getspecific_ptr(MEM_ROOT*,THR_MALLOC); - my_pthread_setspecific_ptr(THR_MALLOC,&memex); + MEM_ROOT *old_root= thd->mem_root; + thd->mem_root= &memex; while ((Str = str_list++)) { @@ -2415,7 +2415,7 @@ int mysql_table_grant(THD *thd, TABLE_LIST *table_list, } } grant_option=TRUE; - my_pthread_setspecific_ptr(THR_MALLOC,old_root); + thd->mem_root= old_root; rw_unlock(&LOCK_grant); if (!result) send_ok(thd); @@ -2549,6 +2549,7 @@ my_bool grant_init(THD *org_thd) THD *thd; TABLE_LIST tables[2]; MYSQL_LOCK *lock; + MEM_ROOT *memex_ptr; my_bool return_val= 1; TABLE *t_table, *c_table; bool check_no_resolve= specialflag & SPECIAL_NO_RESOLVE; @@ -2596,7 +2597,8 @@ my_bool grant_init(THD *org_thd) grant_option= TRUE; /* Will be restored by org_thd->store_globals() */ - my_pthread_setspecific_ptr(THR_MALLOC,&memex); + memex_ptr= &memex; + my_pthread_setspecific_ptr(THR_MALLOC, &memex_ptr); do { GRANT_TABLE *mem_check; diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 839b92e7e7f..a5db02478ac 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -499,7 +499,7 @@ void close_temporary_tables(THD *thd) */ query_buf_size+= table->key_length+1; - if ((query = alloc_root(&thd->mem_root, query_buf_size))) + if ((query = alloc_root(thd->mem_root, query_buf_size))) // Better add "if exists", in case a RESET MASTER has been done end=strmov(query, "DROP /*!40005 TEMPORARY */ TABLE IF EXISTS "); @@ -2311,18 +2311,16 @@ int setup_wild(THD *thd, TABLE_LIST *tables, List &fields, if (!wild_num) DBUG_RETURN(0); - Item_arena *arena= thd->current_arena, backup; - + reg2 Item *item; + List_iterator it(fields); + Item_arena *arena, backup; /* If we are in preparing prepared statement phase then we have change temporary mem_root to statement mem root to save changes of SELECT list */ - if ((is_stmt_prepare= arena->is_stmt_prepare())) - thd->set_n_backup_item_arena(arena, &backup); + arena= thd->change_arena_if_needed(&backup); - reg2 Item *item; - List_iterator it(fields); - while ( wild_num && (item= it++)) + while (wild_num && (item= it++)) { if (item->type() == Item::FIELD_ITEM && ((Item_field*) item)->field_name && @@ -2344,7 +2342,7 @@ int setup_wild(THD *thd, TABLE_LIST *tables, List &fields, else if (insert_fields(thd,tables,((Item_field*) item)->db_name, ((Item_field*) item)->table_name, &it)) { - if (is_stmt_prepare) + if (arena) thd->restore_backup_item_arena(arena, &backup); DBUG_RETURN(-1); } @@ -2360,7 +2358,7 @@ int setup_wild(THD *thd, TABLE_LIST *tables, List &fields, wild_num--; } } - if (is_stmt_prepare) + if (arena) thd->restore_backup_item_arena(arena, &backup); DBUG_RETURN(0); } @@ -2589,11 +2587,10 @@ insert_fields(THD *thd,TABLE_LIST *tables, const char *db_name, int setup_conds(THD *thd,TABLE_LIST *tables,COND **conds) { table_map not_null_tables= 0; - Item_arena *arena= thd->current_arena, backup; - bool is_stmt_prepare= arena->is_stmt_prepare(); + Item_arena *arena= 0, backup; DBUG_ENTER("setup_conds"); + thd->set_query_id=1; - thd->lex->current_select->cond_count= 0; if (*conds) { @@ -2628,12 +2625,14 @@ int setup_conds(THD *thd,TABLE_LIST *tables,COND **conds) !(specialflag & SPECIAL_NO_NEW_FUNC))) { table->outer_join= 0; - if (is_stmt_prepare) - thd->set_n_backup_item_arena(arena, &backup); + arena= thd->change_arena_if_needed(&backup); *conds= and_conds(*conds, table->on_expr); table->on_expr=0; - if (is_stmt_prepare) + if (arena) + { thd->restore_backup_item_arena(arena, &backup); + arena= 0; // Safety if goto err + } if ((*conds) && !(*conds)->fixed && (*conds)->fix_fields(thd, tables, conds)) DBUG_RETURN(1); @@ -2641,8 +2640,7 @@ int setup_conds(THD *thd,TABLE_LIST *tables,COND **conds) } if (table->natural_join) { - if (is_stmt_prepare) - thd->set_n_backup_item_arena(arena, &backup); + arena= thd->change_arena_if_needed(&backup); /* Make a join of all fields with have the same name */ TABLE *t1= table->table; TABLE *t2= table->natural_join->table; @@ -2683,7 +2681,7 @@ int setup_conds(THD *thd,TABLE_LIST *tables,COND **conds) { *conds= and_conds(*conds, cond_and); // fix_fields() should be made with temporary memory pool - if (is_stmt_prepare) + if (arena) thd->restore_backup_item_arena(arena, &backup); if (*conds && !(*conds)->fixed) { @@ -2695,7 +2693,7 @@ int setup_conds(THD *thd,TABLE_LIST *tables,COND **conds) { table->on_expr= and_conds(table->on_expr, cond_and); // fix_fields() should be made with temporary memory pool - if (is_stmt_prepare) + if (arena) thd->restore_backup_item_arena(arena, &backup); if (table->on_expr && !table->on_expr->fixed) { @@ -2704,12 +2702,15 @@ int setup_conds(THD *thd,TABLE_LIST *tables,COND **conds) } } } - else if (is_stmt_prepare) + else if (arena) + { thd->restore_backup_item_arena(arena, &backup); + arena= 0; // Safety if goto err + } } } - if (is_stmt_prepare) + if (thd->current_arena->is_stmt_prepare()) { /* We are in prepared statement preparation code => we should store @@ -2722,8 +2723,8 @@ int setup_conds(THD *thd,TABLE_LIST *tables,COND **conds) DBUG_RETURN(test(thd->net.report_error)); err: - if (is_stmt_prepare) - thd->restore_backup_item_arena(arena, &backup); + if (arena) + thd->restore_backup_item_arena(arena, &backup); DBUG_RETURN(1); } diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 7ad20967de0..eda60b5cfdb 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -305,7 +305,7 @@ void THD::init_for_queries() { ha_enable_transaction(this,TRUE); - reset_root_defaults(&mem_root, variables.query_alloc_block_size, + reset_root_defaults(mem_root, variables.query_alloc_block_size, variables.query_prealloc_size); reset_root_defaults(&transaction.mem_root, variables.trans_alloc_block_size, @@ -411,7 +411,7 @@ THD::~THD() dbug_sentry = THD_SENTRY_GONE; #endif /* Reset stmt_backup.mem_root to not double-free memory from thd.mem_root */ - clear_alloc_root(&stmt_backup.mem_root); + clear_alloc_root(&stmt_backup.main_mem_root); DBUG_VOID_RETURN; } @@ -1394,10 +1394,10 @@ void select_dumpvar::cleanup() for memory root initialization. */ Item_arena::Item_arena(THD* thd) - :free_list(0), - state(INITIALIZED) + :free_list(0), mem_root(&main_mem_root), + state(INITIALIZED) { - init_sql_alloc(&mem_root, + init_sql_alloc(&main_mem_root, thd->variables.query_alloc_block_size, thd->variables.query_prealloc_size); } @@ -1420,11 +1420,11 @@ Item_arena::Item_arena(THD* thd) statements. */ Item_arena::Item_arena(bool init_mem_root) - :free_list(0), + :free_list(0), mem_root(&main_mem_root), state(CONVENTIONAL_EXECUTION) { if (init_mem_root) - init_sql_alloc(&mem_root, ALLOC_ROOT_MIN_BLOCK_SIZE, 0); + init_sql_alloc(&main_mem_root, ALLOC_ROOT_MIN_BLOCK_SIZE, 0); } @@ -1518,13 +1518,16 @@ void THD::end_statement() void Item_arena::set_n_backup_item_arena(Item_arena *set, Item_arena *backup) { + DBUG_ENTER("Item_arena::set_n_backup_item_arena"); backup->set_item_arena(this); set_item_arena(set); + DBUG_VOID_RETURN; } void Item_arena::restore_backup_item_arena(Item_arena *set, Item_arena *backup) { + DBUG_ENTER("Item_arena::restore_backup_item_arena"); set->set_item_arena(this); set_item_arena(backup); #ifdef NOT_NEEDED_NOW @@ -1537,18 +1540,19 @@ void Item_arena::restore_backup_item_arena(Item_arena *set, Item_arena *backup) */ clear_alloc_root(&backup->mem_root); #endif + DBUG_VOID_RETURN; } void Item_arena::set_item_arena(Item_arena *set) { - mem_root= set->mem_root; + mem_root= set->mem_root; free_list= set->free_list; state= set->state; } Statement::~Statement() { - free_root(&mem_root, MYF(0)); + free_root(&main_mem_root, MYF(0)); } C_MODE_START diff --git a/sql/sql_class.h b/sql/sql_class.h index e73b35966a9..df6be559df2 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -429,7 +429,8 @@ public: itself to the list on creation (see Item::Item() for details)) */ Item *free_list; - MEM_ROOT mem_root; + MEM_ROOT main_mem_root; + MEM_ROOT *mem_root; // Pointer to current memroot enum enum_state { INITIALIZED= 0, PREPARED= 1, EXECUTED= 3, CONVENTIONAL_EXECUTION= 2, @@ -468,24 +469,24 @@ public: { return state == PREPARED || state == EXECUTED; } inline bool is_conventional_execution() const { return state == CONVENTIONAL_EXECUTION; } - inline gptr alloc(unsigned int size) { return alloc_root(&mem_root,size); } + inline gptr alloc(unsigned int size) { return alloc_root(mem_root,size); } inline gptr calloc(unsigned int size) { gptr ptr; - if ((ptr=alloc_root(&mem_root,size))) + if ((ptr=alloc_root(mem_root,size))) bzero((char*) ptr,size); return ptr; } inline char *strdup(const char *str) - { return strdup_root(&mem_root,str); } + { return strdup_root(mem_root,str); } inline char *strmake(const char *str, uint size) - { return strmake_root(&mem_root,str,size); } + { return strmake_root(mem_root,str,size); } inline char *memdup(const char *str, uint size) - { return memdup_root(&mem_root,str,size); } + { return memdup_root(mem_root,str,size); } inline char *memdup_w_gap(const char *str, uint size, uint gap) { gptr ptr; - if ((ptr=alloc_root(&mem_root,size+gap))) + if ((ptr=alloc_root(mem_root,size+gap))) memcpy(ptr,str,size); return ptr; } @@ -1052,11 +1053,26 @@ public: inline CHARSET_INFO *charset() { return variables.character_set_client; } void update_charset(); + inline Item_arena *change_arena_if_needed(Item_arena *backup) + { + /* + use new arena if we are in a prepared statements and we have not + already changed to use this arena. + */ + if (current_arena->is_stmt_prepare() && + mem_root != ¤t_arena->main_mem_root) + { + set_n_backup_item_arena(current_arena, backup); + return current_arena; + } + return 0; + } + void change_item_tree(Item **place, Item *new_value) { /* TODO: check for OOM condition here */ if (!current_arena->is_conventional_execution()) - nocheck_register_item_tree_change(place, *place, &mem_root); + nocheck_register_item_tree_change(place, *place, mem_root); *place= new_value; } void nocheck_register_item_tree_change(Item **place, Item *old_value, diff --git a/sql/sql_db.cc b/sql/sql_db.cc index eb851e79d2e..e50796f2a33 100644 --- a/sql/sql_db.cc +++ b/sql/sql_db.cc @@ -725,7 +725,7 @@ static long mysql_rm_known_files(THD *thd, MY_DIR *dirp, const char *db, if ((mysql_rm_known_files(thd, new_dirp, NullS, newpath,1)) < 0) goto err; if (!(copy_of_path= thd->memdup(newpath, length+1)) || - !(dir= new (&thd->mem_root) String(copy_of_path, length, + !(dir= new (thd->mem_root) String(copy_of_path, length, &my_charset_bin)) || raid_dirs.push_back(dir)) goto err; diff --git a/sql/sql_error.cc b/sql/sql_error.cc index 87644300535..eab5ec890df 100644 --- a/sql/sql_error.cc +++ b/sql/sql_error.cc @@ -113,12 +113,12 @@ MYSQL_ERROR *push_warning(THD *thd, MYSQL_ERROR::enum_warning_level level, The following code is here to change the allocation to not use the thd->mem_root, which is freed after each query */ - MEM_ROOT *old_root=my_pthread_getspecific_ptr(MEM_ROOT*,THR_MALLOC); - my_pthread_setspecific_ptr(THR_MALLOC, &thd->warn_root); + MEM_ROOT *old_root= thd->mem_root; + thd->mem_root= &thd->warn_root; err= new MYSQL_ERROR(thd, code, level, msg); if (err) thd->warn_list.push_back(err); - my_pthread_setspecific_ptr(THR_MALLOC, old_root); + thd->mem_root= old_root; } thd->warn_count[(uint) level]++; thd->total_warn_count++; diff --git a/sql/sql_help.cc b/sql/sql_help.cc index ffaaafc26e6..04ecbbd43b9 100644 --- a/sql/sql_help.cc +++ b/sql/sql_help.cc @@ -127,7 +127,7 @@ void memorize_variant_topic(THD *thd, TABLE *topics, int count, String *name, String *description, String *example) { DBUG_ENTER("memorize_variant_topic"); - MEM_ROOT *mem_root= &thd->mem_root; + MEM_ROOT *mem_root= thd->mem_root; if (count==0) { get_field(mem_root,find_fields[help_topic_name].field, name); @@ -138,7 +138,7 @@ void memorize_variant_topic(THD *thd, TABLE *topics, int count, { if (count == 1) names->push_back(name); - String *new_name= new (&thd->mem_root) String; + String *new_name= new (thd->mem_root) String; get_field(mem_root,find_fields[help_topic_name].field,new_name); names->push_back(new_name); } @@ -351,8 +351,8 @@ int search_categories(THD *thd, TABLE *categories, { if (select && !select->cond->val_int()) continue; - String *lname= new (&thd->mem_root) String; - get_field(&thd->mem_root,pfname,lname); + String *lname= new (thd->mem_root) String; + get_field(thd->mem_root,pfname,lname); if (++count == 1 && res_id) *res_id= (int16) pcat_id->val_int(); names->push_back(lname); @@ -385,8 +385,8 @@ void get_all_items_for_category(THD *thd, TABLE *items, Field *pfname, { if (!select->cond->val_int()) continue; - String *name= new (&thd->mem_root) String(); - get_field(&thd->mem_root,pfname,name); + String *name= new (thd->mem_root) String(); + get_field(thd->mem_root,pfname,name); res->push_back(name); } end_read_record(&read_record_info); @@ -638,7 +638,7 @@ int mysqld_help(THD *thd, const char *mask) String name, description, example; int res, count_topics, count_categories, error; uint mlen= strlen(mask); - MEM_ROOT *mem_root= &thd->mem_root; + MEM_ROOT *mem_root= thd->mem_root; if (open_and_lock_tables(thd, tables)) { diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 648549ca3ac..822ce622b1b 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -202,7 +202,7 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list, { /* it should be allocated before Item::fix_fields() */ table->insert_values= - (byte *)alloc_root(&thd->mem_root, table->rec_buff_length); + (byte *)alloc_root(thd->mem_root, table->rec_buff_length); if (!table->insert_values) goto abort; } @@ -924,7 +924,7 @@ TABLE *delayed_insert::get_local_table(THD* client_thd) found_next_number_field=table->found_next_number_field; for (org_field=table->field ; *org_field ; org_field++,field++) { - if (!(*field= (*org_field)->new_field(&client_thd->mem_root,copy))) + if (!(*field= (*org_field)->new_field(client_thd->mem_root,copy))) return 0; (*field)->orig_table= copy; // Remove connection (*field)->move_field(adjust_ptrs); // Point at copy->record[0] diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index f5b9bc0638f..2bf977804af 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -1026,7 +1026,7 @@ pthread_handler_decl(handle_one_connection,arg) } if (thd->user_connect) decrease_user_connections(thd->user_connect); - free_root(&thd->mem_root,MYF(0)); + free_root(thd->mem_root,MYF(0)); if (net->error && net->vio != 0 && net->report_error) { if (!thd->killed && thd->variables.log_warnings > 1) @@ -1121,14 +1121,14 @@ extern "C" pthread_handler_decl(handle_bootstrap,arg) { thd->net.error = 0; close_thread_tables(thd); // Free tables - free_root(&thd->mem_root,MYF(MY_KEEP_PREALLOC)); + free_root(thd->mem_root,MYF(MY_KEEP_PREALLOC)); break; } mysql_parse(thd,thd->query,length); close_thread_tables(thd); // Free tables if (thd->is_fatal_error) break; - free_root(&thd->mem_root,MYF(MY_KEEP_PREALLOC)); + free_root(thd->mem_root,MYF(MY_KEEP_PREALLOC)); free_root(&thd->transaction.mem_root,MYF(MY_KEEP_PREALLOC)); } @@ -1681,7 +1681,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd, #endif close_connection(thd, 0, 1); close_thread_tables(thd); // Free before kill - free_root(&thd->mem_root,MYF(0)); + free_root(thd->mem_root,MYF(0)); free_root(&thd->transaction.mem_root,MYF(0)); kill_mysql(); error=TRUE; @@ -1808,7 +1808,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd, thread_running--; VOID(pthread_mutex_unlock(&LOCK_thread_count)); thd->packet.shrink(thd->variables.net_buffer_length); // Reclaim some memory - free_root(&thd->mem_root,MYF(MY_KEEP_PREALLOC)); + free_root(thd->mem_root,MYF(MY_KEEP_PREALLOC)); DBUG_RETURN(error); } @@ -2062,7 +2062,7 @@ mysql_execute_command(THD *thd) query_len= need_conversion? (pstr->length() * to_cs->mbmaxlen) : pstr->length(); - if (!(query_str= alloc_root(&thd->mem_root, query_len+1))) + if (!(query_str= alloc_root(thd->mem_root, query_len+1))) { res= -1; break; // EOM (error should be reported by allocator) @@ -3937,8 +3937,8 @@ mysql_init_select(LEX *lex) bool mysql_new_select(LEX *lex, bool move_down) { - SELECT_LEX *select_lex = new(&lex->thd->mem_root) SELECT_LEX(); - if (!select_lex) + SELECT_LEX *select_lex; + if (!(select_lex= new(lex->thd->mem_root) SELECT_LEX())) return 1; select_lex->select_number= ++lex->thd->select_number; select_lex->init_query(); @@ -3946,9 +3946,10 @@ mysql_new_select(LEX *lex, bool move_down) if (move_down) { /* first select_lex of subselect or derived table */ - SELECT_LEX_UNIT *unit= new(&lex->thd->mem_root) SELECT_LEX_UNIT(); - if (!unit) + SELECT_LEX_UNIT *unit; + if (!(unit= new(lex->thd->mem_root) SELECT_LEX_UNIT())) return 1; + unit->init_query(); unit->init_select(); unit->thd= lex->thd; @@ -3970,7 +3971,8 @@ mysql_new_select(LEX *lex, bool move_down) as far as we included SELECT_LEX for UNION unit should have fake SELECT_LEX for UNION processing */ - fake= unit->fake_select_lex= new(&lex->thd->mem_root) SELECT_LEX(); + if (!(fake= unit->fake_select_lex= new(lex->thd->mem_root) SELECT_LEX())) + return 1; fake->include_standalone(unit, (SELECT_LEX_NODE**)&unit->fake_select_lex); fake->select_number= INT_MAX; diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index 4ae69e40342..d81ed2cd014 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -1065,7 +1065,7 @@ static int mysql_test_select(Prepared_statement *stmt, DBUG_RETURN(1); #endif - if (!lex->result && !(lex->result= new (&stmt->mem_root) select_send)) + if (!lex->result && !(lex->result= new (stmt->mem_root) select_send)) { send_error(thd); goto err; @@ -1503,7 +1503,7 @@ static bool init_param_array(Prepared_statement *stmt) List_iterator param_iterator(lex->param_list); /* Use thd->mem_root as it points at statement mem_root */ stmt->param_array= (Item_param **) - alloc_root(&stmt->thd->mem_root, + alloc_root(stmt->thd->mem_root, sizeof(Item_param*) * stmt->param_count); if (!stmt->param_array) { @@ -1569,7 +1569,7 @@ int mysql_stmt_prepare(THD *thd, char *packet, uint packet_length, if (name) { stmt->name.length= name->length; - if (!(stmt->name.str= memdup_root(&stmt->mem_root, (char*)name->str, + if (!(stmt->name.str= memdup_root(stmt->mem_root, (char*)name->str, name->length))) { delete stmt; diff --git a/sql/sql_select.cc b/sql/sql_select.cc index df74a946b5c..089bb150bbd 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -4603,7 +4603,7 @@ static Field* create_tmp_field_from_field(THD *thd, Field* org_field, org_field->field_name, table, org_field->charset()); else - new_field= org_field->new_field(&thd->mem_root, table); + new_field= org_field->new_field(thd->mem_root, table); if (new_field) { if (modify_item) @@ -5206,7 +5206,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List &fields, if (!using_unique_constraint) { group->buff=(char*) group_buff; - if (!(group->field=field->new_field(&thd->mem_root,table))) + if (!(group->field=field->new_field(thd->mem_root,table))) goto err; /* purecov: inspected */ if (maybe_null) { @@ -8499,7 +8499,7 @@ setup_copy_fields(THD *thd, TMP_TABLE_PARAM *param, saved value */ Field *field= item->field; - item->result_field=field->new_field(&thd->mem_root,field->table); + item->result_field=field->new_field(thd->mem_root,field->table); char *tmp=(char*) sql_alloc(field->pack_length()+1); if (!tmp) goto err; @@ -8942,7 +8942,7 @@ bool JOIN::rollup_init() return 1; rollup.ref_pointer_arrays= (Item***) (rollup.fields + send_group_parts); ref_array= (Item**) (rollup.ref_pointer_arrays+send_group_parts); - rollup.item_null= new (&thd->mem_root) Item_null(); + rollup.item_null= new (thd->mem_root) Item_null(); /* Prepare space for field list for the different levels diff --git a/sql/sql_select.h b/sql/sql_select.h index 34eaa7e272d..bbd169d1850 100644 --- a/sql/sql_select.h +++ b/sql/sql_select.h @@ -354,7 +354,7 @@ class store_key :public Sql_alloc field_arg->table, field_arg->charset()); else { - to_field=field_arg->new_field(&thd->mem_root,field_arg->table); + to_field=field_arg->new_field(thd->mem_root,field_arg->table); if (to_field) to_field->move_field(ptr, (uchar*) null, 1); } diff --git a/sql/sql_union.cc b/sql/sql_union.cc index 0be554f58a2..e0e8f8d42c5 100644 --- a/sql/sql_union.cc +++ b/sql/sql_union.cc @@ -313,24 +313,24 @@ int st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result, We're in statement prepare or in execution of a conventional statement. */ - Item_arena backup; - if (arena->is_stmt_prepare()) - thd->set_n_backup_item_arena(arena, &backup); + Item_arena *tmp_arena,backup; + tmp_arena= thd->change_arena_if_needed(&backup); + Field **field; for (field= table->field; *field; field++) { Item_field *item= new Item_field(*field); if (!item || item_list.push_back(item)) { - if (arena->is_stmt_prepare()) - thd->restore_backup_item_arena(arena, &backup); + if (tmp_arena) + thd->restore_backup_item_arena(tmp_arena, &backup); DBUG_RETURN(-1); } } + if (tmp_arena) + thd->restore_backup_item_arena(tmp_arena, &backup); if (arena->is_stmt_prepare()) { - thd->restore_backup_item_arena(arena, &backup); - /* prepare fake select to initialize it correctly */ ulong options_tmp= init_prepare_fake_select_lex(thd); if (!(fake_select_lex->join= new JOIN(thd, item_list, thd->options, diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 4538cb6e6ac..94c0fe3cf0c 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -3297,7 +3297,7 @@ opt_distinct: |DISTINCT { $$ = 1; }; opt_gconcat_separator: - /* empty */ { $$ = new (&YYTHD->mem_root) String(",",1,default_charset_info); } + /* empty */ { $$ = new (YYTHD->mem_root) String(",",1,default_charset_info); } |SEPARATOR_SYM text_string { $$ = $2; }; @@ -3551,15 +3551,15 @@ key_list_or_empty: key_usage_list2: key_usage_list2 ',' ident { Select-> - interval_list.push_back(new (&YYTHD->mem_root) String((const char*) $3.str, $3.length, + interval_list.push_back(new (YYTHD->mem_root) String((const char*) $3.str, $3.length, system_charset_info)); } | ident { Select-> - interval_list.push_back(new (&YYTHD->mem_root) String((const char*) $1.str, $1.length, + interval_list.push_back(new (YYTHD->mem_root) String((const char*) $1.str, $1.length, system_charset_info)); } | PRIMARY_SYM { Select-> - interval_list.push_back(new (&YYTHD->mem_root) String("PRIMARY", 7, + interval_list.push_back(new (YYTHD->mem_root) String("PRIMARY", 7, system_charset_info)); }; using_list: @@ -4507,7 +4507,7 @@ opt_db: wild: /* empty */ | LIKE TEXT_STRING_sys - { Lex->wild= new (&YYTHD->mem_root) String($2.str, $2.length, + { Lex->wild= new (YYTHD->mem_root) String($2.str, $2.length, system_charset_info); }; opt_full: @@ -4561,7 +4561,7 @@ opt_describe_column: /* empty */ {} | text_string { Lex->wild= $1; } | ident - { Lex->wild= new (&YYTHD->mem_root) String((const char*) $1.str,$1.length,system_charset_info); }; + { Lex->wild= new (YYTHD->mem_root) String((const char*) $1.str,$1.length,system_charset_info); }; /* flush things */ @@ -4802,7 +4802,7 @@ text_literal: text_string: TEXT_STRING_literal - { $$= new (&YYTHD->mem_root) String($1.str,$1.length,YYTHD->variables.collation_connection); } + { $$= new (YYTHD->mem_root) String($1.str,$1.length,YYTHD->variables.collation_connection); } | HEX_NUM { Item *tmp = new Item_varbinary($1.str,$1.length); @@ -5821,7 +5821,7 @@ column_list: column_list_id: ident { - String *new_str = new (&YYTHD->mem_root) String((const char*) $1.str,$1.length,system_charset_info); + String *new_str = new (YYTHD->mem_root) String((const char*) $1.str,$1.length,system_charset_info); List_iterator iter(Lex->columns); class LEX_COLUMN *point; LEX *lex=Lex; diff --git a/sql/table.cc b/sql/table.cc index 3ae3d668407..20ac714020d 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -81,6 +81,7 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag, uchar *null_pos; uint null_bit, new_frm_ver, field_pack_length; SQL_CRYPT *crypted=0; + MEM_ROOT **root_ptr, *old_root; DBUG_ENTER("openfrm"); DBUG_PRINT("enter",("name: '%s' form: %lx",name,outparam)); @@ -91,8 +92,9 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag, error=1; init_sql_alloc(&outparam->mem_root, TABLE_ALLOC_BLOCK_SIZE, 0); - MEM_ROOT *old_root=my_pthread_getspecific_ptr(MEM_ROOT*,THR_MALLOC); - my_pthread_setspecific_ptr(THR_MALLOC,&outparam->mem_root); + root_ptr= my_pthread_getspecific_ptr(MEM_ROOT**, THR_MALLOC); + old_root= *root_ptr; + *root_ptr= &outparam->mem_root; outparam->real_name=strdup_root(&outparam->mem_root, name+dirname_length(name)); @@ -251,9 +253,9 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag, #ifdef HAVE_CRYPTED_FRM else if (*(head+26) == 2) { - my_pthread_setspecific_ptr(THR_MALLOC,old_root); + *root_ptr= old_root crypted=get_crypt_for_frm(); - my_pthread_setspecific_ptr(THR_MALLOC,&outparam->mem_root); + *root_ptr= &outparam->mem_root; outparam->crypted=1; } #endif @@ -736,7 +738,7 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag, } outparam->db_low_byte_first=outparam->file->low_byte_first(); - my_pthread_setspecific_ptr(THR_MALLOC,old_root); + *root_ptr= old_root; opened_tables++; #ifndef DBUG_OFF if (use_hash) @@ -751,7 +753,7 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag, err_end: /* Here when no file */ delete crypted; - my_pthread_setspecific_ptr(THR_MALLOC,old_root); + *root_ptr= old_root; frm_error(error,outparam,name,ME_ERROR+ME_WAITTANG); delete outparam->file; outparam->file=0; // For easyer errorchecking diff --git a/sql/thr_malloc.cc b/sql/thr_malloc.cc index 0df60858bcb..3a9ca397bba 100644 --- a/sql/thr_malloc.cc +++ b/sql/thr_malloc.cc @@ -38,7 +38,7 @@ void init_sql_alloc(MEM_ROOT *mem_root, uint block_size, uint pre_alloc) gptr sql_alloc(uint Size) { - MEM_ROOT *root=my_pthread_getspecific_ptr(MEM_ROOT*,THR_MALLOC); + MEM_ROOT *root= *my_pthread_getspecific_ptr(MEM_ROOT**,THR_MALLOC); char *ptr= (char*) alloc_root(root,Size); return ptr; } diff --git a/tests/client_test.c b/tests/client_test.c index 004f076c6df..1578f8c7d95 100644 --- a/tests/client_test.c +++ b/tests/client_test.c @@ -97,11 +97,12 @@ void die(const char *file, int line, const char *expr) #define myerror(msg) print_error(msg) #define mysterror(stmt, msg) print_st_error(stmt, msg) -#define myquery(r) \ +#define myquery(RES) \ { \ -if (r) \ - myerror(NULL); \ - DIE_UNLESS(r == 0); \ + int r= (RES); \ + if (r) \ + myerror(NULL); \ + DIE_UNLESS(r == 0); \ } #define myquery_r(r) \ @@ -282,38 +283,40 @@ static void client_query() myheader("client_query"); - rc= mysql_query(mysql, "DROP TABLE IF EXISTS myclient_test"); + rc= mysql_query(mysql, "DROP TABLE IF EXISTS t1"); myquery(rc); - rc= mysql_query(mysql, "CREATE TABLE myclient_test(" + rc= mysql_query(mysql, "CREATE TABLE t1(" "id int primary key auto_increment, " "name varchar(20))"); myquery(rc); - rc= mysql_query(mysql, "CREATE TABLE myclient_test(id int, name varchar(20))"); + rc= mysql_query(mysql, "CREATE TABLE t1(id int, name varchar(20))"); myquery_r(rc); - rc= mysql_query(mysql, "INSERT INTO myclient_test(name) VALUES('mysql')"); + rc= mysql_query(mysql, "INSERT INTO t1(name) VALUES('mysql')"); myquery(rc); - rc= mysql_query(mysql, "INSERT INTO myclient_test(name) VALUES('monty')"); + rc= mysql_query(mysql, "INSERT INTO t1(name) VALUES('monty')"); myquery(rc); - rc= mysql_query(mysql, "INSERT INTO myclient_test(name) VALUES('venu')"); + rc= mysql_query(mysql, "INSERT INTO t1(name) VALUES('venu')"); myquery(rc); - rc= mysql_query(mysql, "INSERT INTO myclient_test(name) VALUES('deleted')"); + rc= mysql_query(mysql, "INSERT INTO t1(name) VALUES('deleted')"); myquery(rc); - rc= mysql_query(mysql, "INSERT INTO myclient_test(name) VALUES('deleted')"); + rc= mysql_query(mysql, "INSERT INTO t1(name) VALUES('deleted')"); myquery(rc); - rc= mysql_query(mysql, "UPDATE myclient_test SET name= 'updated' " + rc= mysql_query(mysql, "UPDATE t1 SET name= 'updated' " "WHERE name= 'deleted'"); myquery(rc); - rc= mysql_query(mysql, "UPDATE myclient_test SET id= 3 WHERE name= 'updated'"); + rc= mysql_query(mysql, "UPDATE t1 SET id= 3 WHERE name= 'updated'"); myquery_r(rc); + + myquery(mysql_query(mysql, "drop table t1")); } @@ -743,7 +746,7 @@ static void client_store_result() myheader("client_store_result"); - rc= mysql_query(mysql, "SELECT * FROM myclient_test"); + rc= mysql_query(mysql, "SELECT * FROM t1"); myquery(rc); /* get the result */ @@ -763,7 +766,7 @@ static void client_use_result() int rc; myheader("client_use_result"); - rc= mysql_query(mysql, "SELECT * FROM myclient_test"); + rc= mysql_query(mysql, "SELECT * FROM t1"); myquery(rc); /* get the result */ @@ -7537,17 +7540,17 @@ static void test_fetch_seek() char c2[11], c3[20]; myheader("test_fetch_seek"); + rc= mysql_query(mysql, "drop table if exists t1"); - rc= mysql_query(mysql, "drop table if exists test_seek"); myquery(rc); - rc= mysql_query(mysql, "create table test_seek(c1 int primary key auto_increment, c2 char(10), c3 timestamp(14))"); + rc= mysql_query(mysql, "create table t1(c1 int primary key auto_increment, c2 char(10), c3 timestamp(14))"); myquery(rc); - rc= mysql_query(mysql, "insert into test_seek(c2) values('venu'), ('mysql'), ('open'), ('source')"); + rc= mysql_query(mysql, "insert into t1(c2) values('venu'), ('mysql'), ('open'), ('source')"); myquery(rc); - stmt= mysql_simple_prepare(mysql, "select * from test_seek"); + stmt= mysql_simple_prepare(mysql, "select * from t1"); check_stmt(stmt); bind[0].buffer_type= MYSQL_TYPE_LONG; @@ -7620,6 +7623,7 @@ static void test_fetch_seek() DIE_UNLESS(rc == MYSQL_NO_DATA); mysql_stmt_close(stmt); + myquery(mysql_query(mysql, "drop table t1")); } @@ -7637,16 +7641,16 @@ static void test_fetch_offset() myheader("test_fetch_offset"); - rc= mysql_query(mysql, "drop table if exists test_column"); + rc= mysql_query(mysql, "drop table if exists t1"); myquery(rc); - rc= mysql_query(mysql, "create table test_column(a char(10))"); + rc= mysql_query(mysql, "create table t1(a char(10))"); myquery(rc); - rc= mysql_query(mysql, "insert into test_column values('abcdefghij'), (null)"); + rc= mysql_query(mysql, "insert into t1 values('abcdefghij'), (null)"); myquery(rc); - stmt= mysql_simple_prepare(mysql, "select * from test_column"); + stmt= mysql_simple_prepare(mysql, "select * from t1"); check_stmt(stmt); bind[0].buffer_type= MYSQL_TYPE_STRING; @@ -7706,6 +7710,8 @@ static void test_fetch_offset() check_execute_r(stmt, rc); mysql_stmt_close(stmt); + + myquery(mysql_query(mysql, "drop table t1")); } @@ -7721,16 +7727,16 @@ static void test_fetch_column() myheader("test_fetch_column"); - rc= mysql_query(mysql, "drop table if exists test_column"); + rc= mysql_query(mysql, "drop table if exists t1"); myquery(rc); - rc= mysql_query(mysql, "create table test_column(c1 int primary key auto_increment, c2 char(10))"); + rc= mysql_query(mysql, "create table t1(c1 int primary key auto_increment, c2 char(10))"); myquery(rc); - rc= mysql_query(mysql, "insert into test_column(c2) values('venu'), ('mysql')"); + rc= mysql_query(mysql, "insert into t1(c2) values('venu'), ('mysql')"); myquery(rc); - stmt= mysql_simple_prepare(mysql, "select * from test_column order by c2 desc"); + stmt= mysql_simple_prepare(mysql, "select * from t1 order by c2 desc"); check_stmt(stmt); bind[0].buffer_type= MYSQL_TYPE_LONG; @@ -7841,6 +7847,7 @@ static void test_fetch_column() check_execute_r(stmt, rc); mysql_stmt_close(stmt); + myquery(mysql_query(mysql, "drop table t1")); } @@ -7852,27 +7859,28 @@ static void test_list_fields() int rc; myheader("test_list_fields"); - rc= mysql_query(mysql, "drop table if exists test_list_fields"); + rc= mysql_query(mysql, "drop table if exists t1"); myquery(rc); - rc= mysql_query(mysql, "create table test_list_fields(c1 int primary key auto_increment, c2 char(10) default 'mysql')"); + rc= mysql_query(mysql, "create table t1(c1 int primary key auto_increment, c2 char(10) default 'mysql')"); myquery(rc); - result= mysql_list_fields(mysql, "test_list_fields", NULL); + result= mysql_list_fields(mysql, "t1", NULL); mytest(result); rc= my_process_result_set(result); DIE_UNLESS(rc == 0); verify_prepare_field(result, 0, "c1", "c1", MYSQL_TYPE_LONG, - "test_list_fields", "test_list_fields", + "t1", "t1", current_db, 11, "0"); verify_prepare_field(result, 1, "c2", "c2", MYSQL_TYPE_STRING, - "test_list_fields", "test_list_fields", + "t1", "t1", current_db, 10, "mysql"); mysql_free_result(result); + myquery(mysql_query(mysql, "drop table t1")); } @@ -11140,11 +11148,13 @@ static void test_bug4172() res= mysql_store_result(mysql); row= mysql_fetch_row(res); - printf("Binary protocol: float=%s, double=%s, decimal(10,4)=%s\n", - f, d, e); - printf("Text protocol: float=%s, double=%s, decimal(10,4)=%s\n", - row[0], row[1], row[2]); - + if (!opt_silent) + { + printf("Binary protocol: float=%s, double=%s, decimal(10,4)=%s\n", + f, d, e); + printf("Text protocol: float=%s, double=%s, decimal(10,4)=%s\n", + row[0], row[1], row[2]); + } DIE_UNLESS(!strcmp(f, row[0]) && !strcmp(d, row[1]) && !strcmp(e, row[2])); mysql_free_result(res); From bf14010d517460de1e6fa4b342b93917135c0818 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 8 Nov 2004 13:15:01 +0400 Subject: [PATCH 0134/1063] ctype_ujis.result, ctype_ujis.test, field.cc: Bug#6345 Unexpected behaviour with partial indices sql/field.cc: Bug#6345 Unexpected behaviour with partial indices mysql-test/t/ctype_ujis.test: Bug#6345 Unexpected behaviour with partial indices mysql-test/r/ctype_ujis.result: Bug#6345 Unexpected behaviour with partial indices --- mysql-test/r/ctype_ujis.result | 40 ++++++++++++++++++++++++++++++++++ mysql-test/t/ctype_ujis.test | 36 ++++++++++++++++++++++++++++++ sql/field.cc | 8 +++++-- 3 files changed, 82 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/ctype_ujis.result b/mysql-test/r/ctype_ujis.result index 7c3ae52cbc9..d02ac0062f8 100644 --- a/mysql-test/r/ctype_ujis.result +++ b/mysql-test/r/ctype_ujis.result @@ -126,3 +126,43 @@ Field Type Null Key Default Extra a char(1) b enum('¤¢','¤¤') YES NULL DROP TABLE t1; +CREATE TABLE t1 +( +a INTEGER NOT NULL, +b VARCHAR(50) NOT NULL DEFAULT '', +PRIMARY KEY (a), +KEY b (b(10)) +) TYPE=InnoDB CHARACTER SET 'ujis' COLLATE 'ujis_japanese_ci'; +INSERT INTO t1 (a, b) VALUES (0, 'aaabbbcccddd'); +INSERT INTO t1 (a, b) VALUES (1, 'eeefffggghhh'); +INSERT INTO t1 (a, b) VALUES (2, 'iiijjjkkkl'); +SELECT t1.* FROM t1 WHERE b='aaabbbcccddd' ORDER BY a; +a b +0 aaabbbcccddd +SELECT t1.* FROM t1 WHERE b='eeefffggghhh' ORDER BY a; +a b +1 eeefffggghhh +SELECT t1.* FROM t1 WHERE b='iiijjjkkkl' ORDER BY a; +a b +2 iiijjjkkkl +DROP TABLE t1; +CREATE TABLE t1 +( +a INTEGER NOT NULL, +b VARCHAR(50) NOT NULL DEFAULT '', +PRIMARY KEY (a), +KEY b (b(10)) +) TYPE=MyISAM CHARACTER SET 'ujis' COLLATE 'ujis_japanese_ci'; +INSERT INTO t1 (a, b) VALUES (0, 'aaabbbcccddd'); +INSERT INTO t1 (a, b) VALUES (1, 'eeefffggghhh'); +INSERT INTO t1 (a, b) VALUES (2, 'iiijjjkkkl'); +SELECT t1.* FROM t1 WHERE b='aaabbbcccddd' ORDER BY a; +a b +0 aaabbbcccddd +SELECT t1.* FROM t1 WHERE b='eeefffggghhh' ORDER BY a; +a b +1 eeefffggghhh +SELECT t1.* FROM t1 WHERE b='iiijjjkkkl' ORDER BY a; +a b +2 iiijjjkkkl +DROP TABLE t1; diff --git a/mysql-test/t/ctype_ujis.test b/mysql-test/t/ctype_ujis.test index e5405d9f1bd..9cfb6b14d7e 100644 --- a/mysql-test/t/ctype_ujis.test +++ b/mysql-test/t/ctype_ujis.test @@ -83,3 +83,39 @@ CREATE TABLE t1 ( SHOW CREATE TABLE t1; SHOW COLUMNS FROM t1; DROP TABLE t1; + +# +# Bug #6345 Unexpected behaviour with partial indices +# +--disable_warnings +CREATE TABLE t1 +( + a INTEGER NOT NULL, + b VARCHAR(50) NOT NULL DEFAULT '', + PRIMARY KEY (a), + KEY b (b(10)) +) TYPE=InnoDB CHARACTER SET 'ujis' COLLATE 'ujis_japanese_ci'; +--enable_warnings +INSERT INTO t1 (a, b) VALUES (0, 'aaabbbcccddd'); +INSERT INTO t1 (a, b) VALUES (1, 'eeefffggghhh'); +INSERT INTO t1 (a, b) VALUES (2, 'iiijjjkkkl'); +SELECT t1.* FROM t1 WHERE b='aaabbbcccddd' ORDER BY a; +SELECT t1.* FROM t1 WHERE b='eeefffggghhh' ORDER BY a; +SELECT t1.* FROM t1 WHERE b='iiijjjkkkl' ORDER BY a; +DROP TABLE t1; +--disable_warnings +CREATE TABLE t1 +( + a INTEGER NOT NULL, + b VARCHAR(50) NOT NULL DEFAULT '', + PRIMARY KEY (a), + KEY b (b(10)) +) TYPE=MyISAM CHARACTER SET 'ujis' COLLATE 'ujis_japanese_ci'; +--enable_warnings +INSERT INTO t1 (a, b) VALUES (0, 'aaabbbcccddd'); +INSERT INTO t1 (a, b) VALUES (1, 'eeefffggghhh'); +INSERT INTO t1 (a, b) VALUES (2, 'iiijjjkkkl'); +SELECT t1.* FROM t1 WHERE b='aaabbbcccddd' ORDER BY a; +SELECT t1.* FROM t1 WHERE b='eeefffggghhh' ORDER BY a; +SELECT t1.* FROM t1 WHERE b='iiijjjkkkl' ORDER BY a; +DROP TABLE t1; diff --git a/sql/field.cc b/sql/field.cc index 24bd0c48c92..1111e47bc38 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -4401,10 +4401,14 @@ int Field_string::cmp(const char *a_ptr, const char *b_ptr) (const uchar*) b_ptr, field_length); } - return my_strnncoll(field_charset,(const uchar*) a_ptr, field_length, - (const uchar*) b_ptr, field_length); + uint char_len= field_length/field_charset->mbmaxlen; + uint a_len= my_charpos(field_charset, a_ptr, a_ptr + field_length, char_len); + uint b_len= my_charpos(field_charset, b_ptr, b_ptr + field_length, char_len); + return my_strnncoll(field_charset,(const uchar*) a_ptr, a_len, + (const uchar*) b_ptr, b_len); } + void Field_string::sort_string(char *to,uint length) { uint tmp=my_strnxfrm(field_charset, From 3b38a854e0fed2edaf6ab848959a2795445624f5 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 8 Nov 2004 11:06:36 +0100 Subject: [PATCH 0135/1063] ndb: bug#6451 1) fix so that missing blob tables don't prevent table from being dropped 2) decrease size of blob part if record length exceeds max length 3) add test case for table wo/ corresponding blob table 4) init scan counters when sending scan_tabreq mysql-test/r/ndb_autodiscover.result: testcase for table wo/ corresponding blob tables mysql-test/r/ndb_autodiscover2.result: testcase for table wo/ corresponding blob tables mysql-test/t/ndb_autodiscover.test: testcase for table wo/ corresponding blob tables mysql-test/t/ndb_autodiscover2.test: testcase for table wo/ corresponding blob tables ndb/include/ndbapi/NdbDictionary.hpp: Add non-const get column ndb/src/ndbapi/NdbDictionary.cpp: Add non-const get column ndb/src/ndbapi/NdbDictionaryImpl.hpp: Allow "partially" getTable, which enables dropping of tables that fails to create blob tables ndb/src/ndbapi/NdbScanOperation.cpp: Init counter when sending SCAN_TABREQ sql/ha_ndbcluster.cc: Make sure that blob don't have to big part size --- mysql-test/r/ndb_autodiscover.result | 7 ++++- mysql-test/r/ndb_autodiscover2.result | 3 +++ mysql-test/t/ndb_autodiscover.test | 8 +++++- mysql-test/t/ndb_autodiscover2.test | 3 +++ ndb/include/ndbapi/NdbDictionary.hpp | 14 +++++++++- ndb/src/ndbapi/NdbDictionary.cpp | 12 +++++++++ ndb/src/ndbapi/NdbDictionaryImpl.hpp | 8 +++--- ndb/src/ndbapi/NdbScanOperation.cpp | 15 ++++++----- sql/ha_ndbcluster.cc | 37 ++++++++++++++++++++++++++- 9 files changed, 92 insertions(+), 15 deletions(-) diff --git a/mysql-test/r/ndb_autodiscover.result b/mysql-test/r/ndb_autodiscover.result index 23f089b9bc0..b7afb5918a4 100644 --- a/mysql-test/r/ndb_autodiscover.result +++ b/mysql-test/r/ndb_autodiscover.result @@ -1,4 +1,4 @@ -drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9,t10; flush status; create table t1( id int not null primary key, @@ -363,3 +363,8 @@ a int NOT NULL PRIMARY KEY, b int ) engine=ndb; insert t9 values(1, 2), (2,3), (3, 4), (4, 5); +create table t10 ( +a int not null primary key, +b blob +) engine=ndb; +insert into t10 values (1, 'kalle'); diff --git a/mysql-test/r/ndb_autodiscover2.result b/mysql-test/r/ndb_autodiscover2.result index 08803d997a5..91f018b5d02 100644 --- a/mysql-test/r/ndb_autodiscover2.result +++ b/mysql-test/r/ndb_autodiscover2.result @@ -8,3 +8,6 @@ show status like 'handler_discover%'; Variable_name Value Handler_discover 1 drop table t9; +select * from t10; +ERROR HY000: Got error 4263 'Invalid blob attributes or invalid blob parts table' from ndbcluster +drop table t10; diff --git a/mysql-test/t/ndb_autodiscover.test b/mysql-test/t/ndb_autodiscover.test index 95b616fc7b2..fd7fe0e60d8 100644 --- a/mysql-test/t/ndb_autodiscover.test +++ b/mysql-test/t/ndb_autodiscover.test @@ -1,7 +1,7 @@ -- source include/have_ndb.inc --disable_warnings -drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9,t10; --enable_warnings ################################################ @@ -472,5 +472,11 @@ system rm var/master-data/test/t9.frm ; # MySQL Server will have been restarted because it has a # ndb_autodiscover2-master.opt file. +create table t10 ( + a int not null primary key, + b blob +) engine=ndb; +insert into t10 values (1, 'kalle'); +--exec $NDB_TOOLS_DIR/ndb_drop_table -d test `$NDB_TOOLS_DIR/ndb_show_tables | grep BLOB` > /dev/null 2>&1 || true diff --git a/mysql-test/t/ndb_autodiscover2.test b/mysql-test/t/ndb_autodiscover2.test index cce75d5ca4f..11e1cc204f7 100644 --- a/mysql-test/t/ndb_autodiscover2.test +++ b/mysql-test/t/ndb_autodiscover2.test @@ -13,4 +13,7 @@ show status like 'handler_discover%'; drop table t9; +--error 1296 +select * from t10; +drop table t10; diff --git a/ndb/include/ndbapi/NdbDictionary.hpp b/ndb/include/ndbapi/NdbDictionary.hpp index 51a6895648f..a3115076624 100644 --- a/ndb/include/ndbapi/NdbDictionary.hpp +++ b/ndb/include/ndbapi/NdbDictionary.hpp @@ -369,7 +369,7 @@ public: */ bool getDistributionKey() const; /** @} *******************************************************************/ - + #ifndef DOXYGEN_SHOULD_SKIP_INTERNAL void setTupleKey(bool); bool getTupleKey() const; @@ -486,6 +486,18 @@ public: */ const Column* getColumn(const char * name) const; + /** + * Get column definition via index in table. + * @return null if none existing name + */ + Column* getColumn(const int attributeId); + + /** + * Get column definition via name. + * @return null if none existing name + */ + Column* getColumn(const char * name); + /** * Get column definition via index in table. * @return null if none existing name diff --git a/ndb/src/ndbapi/NdbDictionary.cpp b/ndb/src/ndbapi/NdbDictionary.cpp index c8414ec16a3..2fd0975ac17 100644 --- a/ndb/src/ndbapi/NdbDictionary.cpp +++ b/ndb/src/ndbapi/NdbDictionary.cpp @@ -343,6 +343,18 @@ NdbDictionary::Table::getColumn(const int attrId) const { return m_impl.getColumn(attrId); } +NdbDictionary::Column* +NdbDictionary::Table::getColumn(const char * name) +{ + return m_impl.getColumn(name); +} + +NdbDictionary::Column* +NdbDictionary::Table::getColumn(const int attrId) +{ + return m_impl.getColumn(attrId); +} + void NdbDictionary::Table::setLogging(bool val){ m_impl.m_logging = val; diff --git a/ndb/src/ndbapi/NdbDictionaryImpl.hpp b/ndb/src/ndbapi/NdbDictionaryImpl.hpp index 12f0946ab67..62d2a951f28 100644 --- a/ndb/src/ndbapi/NdbDictionaryImpl.hpp +++ b/ndb/src/ndbapi/NdbDictionaryImpl.hpp @@ -637,11 +637,9 @@ NdbDictionaryImpl::get_local_table_info(const char * internalTableName, return 0; } } - if (do_add_blob_tables && - info->m_table_impl->m_noOfBlobs && - addBlobTables(*(info->m_table_impl))) { - return 0; - } + if (do_add_blob_tables && info->m_table_impl->m_noOfBlobs) + addBlobTables(*(info->m_table_impl)); + return info; // autoincrement already initialized } diff --git a/ndb/src/ndbapi/NdbScanOperation.cpp b/ndb/src/ndbapi/NdbScanOperation.cpp index 86bac7deb16..373fec1a2b0 100644 --- a/ndb/src/ndbapi/NdbScanOperation.cpp +++ b/ndb/src/ndbapi/NdbScanOperation.cpp @@ -850,6 +850,14 @@ NdbScanOperation::doSendScan(int aProcessorId) tSignal = tSignal->next(); } theStatus = WaitResponse; + + m_sent_receivers_count = theParallelism; + if(m_ordered) + { + m_current_api_receiver = theParallelism; + m_api_receivers_count = theParallelism; + } + return tSignalCount; }//NdbOperation::doSendScan() @@ -1507,13 +1515,8 @@ NdbScanOperation::reset_receivers(Uint32 parallell, Uint32 ordered){ m_api_receivers_count = 0; m_current_api_receiver = 0; - m_sent_receivers_count = parallell; + m_sent_receivers_count = 0; m_conf_receivers_count = 0; - - if(ordered){ - m_current_api_receiver = parallell; - m_api_receivers_count = parallell; - } } int diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 838cf69855a..ddc073f79eb 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -3307,7 +3307,7 @@ int ha_ndbcluster::create(const char *name, { NDBTAB tab; NDBCOL col; - uint pack_length, length, i; + uint pack_length, length, i, pk_length= 0; const void *data, *pack_data; const char **key_names= form->keynames.type_names; char name2[FN_HEADLEN]; @@ -3354,6 +3354,8 @@ int ha_ndbcluster::create(const char *name, if ((my_errno= create_ndb_column(col, field, info))) DBUG_RETURN(my_errno); tab.addColumn(col); + if(col.getPrimaryKey()) + pk_length += (field->pack_length() + 3) / 4; } // No primary key, create shadow key as 64 bit, auto increment @@ -3367,6 +3369,39 @@ int ha_ndbcluster::create(const char *name, col.setPrimaryKey(TRUE); col.setAutoIncrement(TRUE); tab.addColumn(col); + pk_length += 2; + } + + // Make sure that blob tables don't have to big part size + for (i= 0; i < form->fields; i++) + { + /** + * The extra +7 concists + * 2 - words from pk in blob table + * 5 - from extra words added by tup/dict?? + */ + switch (form->field[i]->real_type()) { + case MYSQL_TYPE_BLOB: + case MYSQL_TYPE_MEDIUM_BLOB: + case MYSQL_TYPE_LONG_BLOB: + { + NdbDictionary::Column * col = tab.getColumn(i); + int size = pk_length + (col->getPartSize()+3)/4 + 7; + if(size > NDB_MAX_TUPLE_SIZE_IN_WORDS && + (pk_length+7) < NDB_MAX_TUPLE_SIZE_IN_WORDS) + { + size = NDB_MAX_TUPLE_SIZE_IN_WORDS - pk_length - 7; + col->setPartSize(4*size); + } + /** + * If size > NDB_MAX and pk_length+7 >= NDB_MAX + * then the table can't be created anyway, so skip + * changing part size, and have error later + */ + } + default: + break; + } } if ((my_errno= check_ndb_connection())) From 7240a4d317cca5ccc08f7c1fb10f71d9b8f23d55 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 8 Nov 2004 11:11:49 +0100 Subject: [PATCH 0136/1063] ndb: bug#6435 fix null handling in ha_ndbcluster when using ordered index mysql-test/r/ndb_index_ordered.result: bug#6435 mysql-test/t/ndb_index_ordered.test: bug#6435 sql/ha_ndbcluster.cc: Fix null handling in ordered index code --- mysql-test/r/ndb_index_ordered.result | 37 ++++++++++++++++++++++++++- mysql-test/t/ndb_index_ordered.test | 28 +++++++++++++++++++- sql/ha_ndbcluster.cc | 5 ++-- 3 files changed, 65 insertions(+), 5 deletions(-) diff --git a/mysql-test/r/ndb_index_ordered.result b/mysql-test/r/ndb_index_ordered.result index 2dc260ec43d..50f904af750 100644 --- a/mysql-test/r/ndb_index_ordered.result +++ b/mysql-test/r/ndb_index_ordered.result @@ -1,4 +1,4 @@ -drop table if exists t1; +drop table if exists t1, test1, test2; CREATE TABLE t1 ( a int unsigned NOT NULL PRIMARY KEY, b int unsigned not null, @@ -275,3 +275,38 @@ a b c 1 1 1 4 4 NULL drop table t1; +CREATE TABLE test1 ( +SubscrID int(11) NOT NULL auto_increment, +UsrID int(11) NOT NULL default '0', +PRIMARY KEY (SubscrID), +KEY idx_usrid (UsrID) +) ENGINE=ndbcluster DEFAULT CHARSET=latin1; +INSERT INTO test1 VALUES (2,224),(3,224),(1,224); +CREATE TABLE test2 ( +SbclID int(11) NOT NULL auto_increment, +SbcrID int(11) NOT NULL default '0', +PRIMARY KEY (SbclID), +KEY idx_sbcrid (SbcrID) +) ENGINE=ndbcluster DEFAULT CHARSET=latin1; +INSERT INTO test2 VALUES (3,2),(1,1),(2,1),(4,2); +select * from test1 order by 1; +SubscrID UsrID +1 224 +2 224 +3 224 +select * from test2 order by 1; +SbclID SbcrID +1 1 +2 1 +3 2 +4 2 +SELECT s.SubscrID,l.SbclID FROM test1 s left JOIN test2 l ON +l.SbcrID=s.SubscrID WHERE s.UsrID=224 order by 1, 2; +SubscrID SbclID +1 1 +1 2 +2 3 +2 4 +3 NULL +drop table test1; +drop table test2; diff --git a/mysql-test/t/ndb_index_ordered.test b/mysql-test/t/ndb_index_ordered.test index 64291c8ab97..53177511bc6 100644 --- a/mysql-test/t/ndb_index_ordered.test +++ b/mysql-test/t/ndb_index_ordered.test @@ -1,7 +1,7 @@ -- source include/have_ndb.inc --disable_warnings -drop table if exists t1; +drop table if exists t1, test1, test2; --enable_warnings # @@ -146,3 +146,29 @@ select * from t1 use index (bc) where b IS NULL and c = 2 order by a; select * from t1 use index (bc) where b < 4 order by a; select * from t1 use index (bc) where b IS NOT NULL order by a; drop table t1; + +# +# Bug #6435 +CREATE TABLE test1 ( +SubscrID int(11) NOT NULL auto_increment, +UsrID int(11) NOT NULL default '0', +PRIMARY KEY (SubscrID), +KEY idx_usrid (UsrID) +) ENGINE=ndbcluster DEFAULT CHARSET=latin1; + +INSERT INTO test1 VALUES (2,224),(3,224),(1,224); + +CREATE TABLE test2 ( +SbclID int(11) NOT NULL auto_increment, +SbcrID int(11) NOT NULL default '0', +PRIMARY KEY (SbclID), +KEY idx_sbcrid (SbcrID) +) ENGINE=ndbcluster DEFAULT CHARSET=latin1; + +INSERT INTO test2 VALUES (3,2),(1,1),(2,1),(4,2); +select * from test1 order by 1; +select * from test2 order by 1; +SELECT s.SubscrID,l.SbclID FROM test1 s left JOIN test2 l ON +l.SbcrID=s.SubscrID WHERE s.UsrID=224 order by 1, 2; +drop table test1; +drop table test2; diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index ddc073f79eb..893a6a022cd 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -1290,7 +1290,6 @@ int ha_ndbcluster::set_bounds(NdbIndexScanOperation *op, Field *field= key_part->field; uint part_len= key_part->length; uint part_store_len= key_part->store_length; - bool part_nullable= (bool) key_part->null_bit; // Info about each key part struct part_st { bool part_last; @@ -1312,9 +1311,9 @@ int ha_ndbcluster::set_bounds(NdbIndexScanOperation *op, p.part_last= (tot_len + part_store_len >= key_tot_len[j]); p.key= keys[j]; p.part_ptr= &p.key->key[tot_len]; - p.part_null= (field->maybe_null() && *p.part_ptr); + p.part_null= key_part->null_bit && *p.part_ptr; p.bound_ptr= (const char *) - p.part_null ? 0 : part_nullable ? p.part_ptr + 1 : p.part_ptr; + p.part_null ? 0 : key_part->null_bit ? p.part_ptr + 1 : p.part_ptr; if (j == 0) { From 5fb792ec40e438e9cd7918da37379ffc7b939f57 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 8 Nov 2004 10:21:39 +0000 Subject: [PATCH 0137/1063] removed editline and replaced with mysql readline created new facade object for CommandInterpreter removed CPC #if 0 code removed editline from mgmtsrver, no replace with readline since interface is obsolete anyways BitKeeper/deleted/.del-MANIFEST~e8c948c4a4413f8d: Delete: ndb/src/common/editline/MANIFEST BitKeeper/deleted/.del-Makefile.am~dfbe493d6e2d25f4: Delete: ndb/src/common/editline/Makefile.am BitKeeper/deleted/.del-Makefile_old~90ac19a1668ecdd5: Delete: ndb/src/common/editline/Makefile_old BitKeeper/deleted/.del-README~3f39f9b8294466e8: Delete: ndb/src/common/editline/README BitKeeper/deleted/.del-complete.c~a1bc3055fd90e27f: Delete: ndb/src/common/editline/complete.c BitKeeper/deleted/.del-editline.3~1f9bb4274cf4381: Delete: ndb/src/common/editline/editline.3 BitKeeper/deleted/.del-editline.c~5b759f3e5fd3c196: Delete: ndb/src/common/editline/editline.c BitKeeper/deleted/.del-editline_internal.h~96ca8d53fb758586: Delete: ndb/src/common/editline/editline_internal.h BitKeeper/deleted/.del-editline_win32.c~45b257bec279826e: Delete: ndb/src/common/editline/editline_win32.c BitKeeper/deleted/.del-sysunix.c~8e7a6901783efd17: Delete: ndb/src/common/editline/sysunix.c BitKeeper/deleted/.del-unix.h~1c244c1d4ba6c6fb: Delete: ndb/src/common/editline/unix.h BitKeeper/deleted/.del-Makefile~46cecfa6cd1a4e6b: Delete: ndb/src/common/editline/test/Makefile BitKeeper/deleted/.del-testit.c~82837111b1876e44: Delete: ndb/src/common/editline/test/testit.c BitKeeper/deleted/.del-Makefile_old~59409aa4debaeb90: Delete: ndb/src/common/Makefile_old BitKeeper/deleted/.del-Makefile_old~92af3f5a7f24caf: Delete: ndb/src/mgmclient/Makefile_old ndb/test/src/CpcClient.cpp: Rename: ndb/src/mgmclient/CpcClient.cpp -> ndb/test/src/CpcClient.cpp ndb/test/include/CpcClient.hpp: Rename: ndb/src/mgmclient/CpcClient.hpp -> ndb/test/include/CpcClient.hpp configure.in: removed editline ndb/src/common/Makefile.am: removed editline ndb/src/mgmclient/CommandInterpreter.cpp: removed editline and replaced with mysql readline created new facade object for CommandInterpreter removed CPC #if 0 code ndb/src/mgmclient/Makefile.am: removed editline and replaced with mysql readline created new facade object for CommandInterpreter removed CPC #if 0 code ndb/src/mgmclient/main.cpp: removed editline and replaced with mysql readline created new facade object for CommandInterpreter removed CPC #if 0 code ndb/src/mgmclient/ndb_mgmclient.hpp: new facade object for CommandInterpreter ndb/src/mgmsrv/CommandInterpreter.hpp: removed editline from mgmtsrver, no replace with readline since interface is obsolete anyways ndb/src/mgmsrv/Makefile.am: removed editline from mgmtsrver, no replace with readline since interface is obsolete anyways ndb/test/run-test/Makefile.am: moved cpc code to test ndb/test/src/Makefile.am: moved cpc code to test ndb/test/tools/Makefile.am: moved cpc code to test --- configure.in | 1 - ndb/src/common/Makefile.am | 2 +- ndb/src/common/Makefile_old | 15 - ndb/src/common/editline/MANIFEST | 15 - ndb/src/common/editline/Makefile.am | 10 - ndb/src/common/editline/Makefile_old | 18 - ndb/src/common/editline/README | 53 - ndb/src/common/editline/complete.c | 195 --- ndb/src/common/editline/editline.3 | 178 -- ndb/src/common/editline/editline.c | 1498 ----------------- ndb/src/common/editline/editline_internal.h | 30 - ndb/src/common/editline/sysunix.c | 132 -- ndb/src/common/editline/test/Makefile | 10 - ndb/src/common/editline/test/testit.c | 55 - ndb/src/common/editline/unix.h | 9 - ndb/src/mgmclient/CommandInterpreter.cpp | 402 +++-- ndb/src/mgmclient/CommandInterpreter.hpp | 197 --- ndb/src/mgmclient/Makefile.am | 13 +- ndb/src/mgmclient/Makefile_old | 25 - ndb/src/mgmclient/main.cpp | 8 +- .../ndb_mgmclient.hpp} | 27 +- ndb/src/mgmsrv/CommandInterpreter.hpp | 28 +- ndb/src/mgmsrv/Makefile.am | 1 - .../mgmclient => test/include}/CpcClient.hpp | 0 ndb/test/run-test/Makefile.am | 5 +- ndb/{src/mgmclient => test/src}/CpcClient.cpp | 0 ndb/test/src/Makefile.am | 3 +- ndb/test/tools/Makefile.am | 4 +- 28 files changed, 272 insertions(+), 2662 deletions(-) delete mode 100644 ndb/src/common/Makefile_old delete mode 100644 ndb/src/common/editline/MANIFEST delete mode 100644 ndb/src/common/editline/Makefile.am delete mode 100644 ndb/src/common/editline/Makefile_old delete mode 100644 ndb/src/common/editline/README delete mode 100644 ndb/src/common/editline/complete.c delete mode 100644 ndb/src/common/editline/editline.3 delete mode 100644 ndb/src/common/editline/editline.c delete mode 100644 ndb/src/common/editline/editline_internal.h delete mode 100644 ndb/src/common/editline/sysunix.c delete mode 100644 ndb/src/common/editline/test/Makefile delete mode 100644 ndb/src/common/editline/test/testit.c delete mode 100644 ndb/src/common/editline/unix.h delete mode 100644 ndb/src/mgmclient/CommandInterpreter.hpp delete mode 100644 ndb/src/mgmclient/Makefile_old rename ndb/src/{common/editline/editline_win32.c => mgmclient/ndb_mgmclient.hpp} (68%) rename ndb/{src/mgmclient => test/include}/CpcClient.hpp (100%) rename ndb/{src/mgmclient => test/src}/CpcClient.cpp (100%) diff --git a/configure.in b/configure.in index 71adaa747f5..cd2daf10690 100644 --- a/configure.in +++ b/configure.in @@ -3093,7 +3093,6 @@ AC_CONFIG_FILES(ndb/Makefile ndb/include/Makefile dnl ndb/src/common/logger/Makefile dnl ndb/src/common/transporter/Makefile dnl ndb/src/common/mgmcommon/Makefile dnl - ndb/src/common/editline/Makefile dnl ndb/src/kernel/Makefile dnl ndb/src/kernel/error/Makefile dnl ndb/src/kernel/blocks/Makefile dnl diff --git a/ndb/src/common/Makefile.am b/ndb/src/common/Makefile.am index 7fcf2cab636..8733205eca2 100644 --- a/ndb/src/common/Makefile.am +++ b/ndb/src/common/Makefile.am @@ -1,4 +1,4 @@ -SUBDIRS = portlib debugger util logger transporter mgmcommon editline +SUBDIRS = portlib debugger util logger transporter mgmcommon noinst_LTLIBRARIES = libcommon.la diff --git a/ndb/src/common/Makefile_old b/ndb/src/common/Makefile_old deleted file mode 100644 index ebde75bf3ec..00000000000 --- a/ndb/src/common/Makefile_old +++ /dev/null @@ -1,15 +0,0 @@ -include .defs.mk - -LIB_DIRS := \ - portlib \ - debugger \ - util \ - logger - -ifneq ($(USE_EDITLINE), N) -LIB_DIRS += editline -endif - -DIRS := transporter mgmcommon - -include $(NDB_TOP)/Epilogue.mk diff --git a/ndb/src/common/editline/MANIFEST b/ndb/src/common/editline/MANIFEST deleted file mode 100644 index dc8b4b36f88..00000000000 --- a/ndb/src/common/editline/MANIFEST +++ /dev/null @@ -1,15 +0,0 @@ -File Name Description --------------------------------------------------------- -README Release notes and copyright -MANIFEST This shipping list -Make.os9 OS-9 makefile -Makefile Unix makefile -complete.c Filename completion routines -editline.3 Manual page for editline library -editline.c Line-editing routines -editline_internal.h Internal library header file -os9.h OS-9-specific declarations -sysos9.c OS-9-specific routines -sysunix.c Unix-specific routines -testit.c Test driver -unix.h Unix-specific declarations diff --git a/ndb/src/common/editline/Makefile.am b/ndb/src/common/editline/Makefile.am deleted file mode 100644 index 4f53bdc6326..00000000000 --- a/ndb/src/common/editline/Makefile.am +++ /dev/null @@ -1,10 +0,0 @@ - -noinst_LIBRARIES = libeditline.a - -libeditline_a_SOURCES = complete.c editline.c sysunix.c - -INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/ndb/include -DEFS = -DANSI_ARROWS -DHAVE_TCGETATTR -DSYS_UNIX - -# Don't update the files from bitkeeper -%::SCCS/s.% diff --git a/ndb/src/common/editline/Makefile_old b/ndb/src/common/editline/Makefile_old deleted file mode 100644 index 800df8f0f31..00000000000 --- a/ndb/src/common/editline/Makefile_old +++ /dev/null @@ -1,18 +0,0 @@ -include .defs.mk - -TYPE := - -ARCHIVE_TARGET := editline - -CFLAGS += -DANSI_ARROWS -DHAVE_TCGETATTR -DSYS_UNIX - -ifeq ($(NDB_OS), WIN32) -SOURCES = editline_win32.c -else -SOURCES = complete.c editline.c sysunix.c -endif - -DIRS := test - -include $(NDB_TOP)/Epilogue.mk - diff --git a/ndb/src/common/editline/README b/ndb/src/common/editline/README deleted file mode 100644 index 537c7bd8611..00000000000 --- a/ndb/src/common/editline/README +++ /dev/null @@ -1,53 +0,0 @@ --- -NOTE: This version has been modified by Ericsson/Alzato. Please -see the cvs changelog for more details. --- - -$Revision: 1.2 $ - -This is a line-editing library. It can be linked into almost any -program to provide command-line editing and recall. - -It is call-compatible with the FSF readline library, but it is a -fraction of the size (and offers fewer features). It does not use -standard I/O. It is distributed under a "C News-like" copyright. - -Configuration is done in the Makefile. Type "make testit" to get -a small slow shell for testing. - -This contains some changes since the posting to comp.sources.misc: - - Bugfix for completion on absolute pathnames. - - Better handling of M-n versus showing raw 8bit chars. - - Better signal handling. - - Now supports termios/termio/sgttyb ioctl's. - - Add M-m command to toggle how 8bit data is displayed. -The following changes, made since the last public release, come from -J.G. Vons : - - History-searching no longer redraws the line wrong - - Added ESC-ESC as synonym for ESC-? - - SIGQUIT (normally ^\) now sends a signal, not indicating EOF. - - Fixed some typo's and unclear wording in the manpage. - - Fixed completion when all entries shared a common prefix. - - Fixed some meta-char line-redrawing bugs. - -Enjoy, - Rich $alz - - - Copyright 1992,1993 Simmule Turner and Rich Salz. All rights reserved. - - This software is not subject to any license of the American Telephone - and Telegraph Company or of the Regents of the University of California. - - Permission is granted to anyone to use this software for any purpose on - any computer system, and to alter it and redistribute it freely, subject - to the following restrictions: - 1. The authors are not responsible for the consequences of use of this - software, no matter how awful, even if they arise from flaws in it. - 2. The origin of this software must not be misrepresented, either by - explicit claim or by omission. Since few users ever read sources, - credits must appear in the documentation. - 3. Altered versions must be plainly marked as such, and must not be - misrepresented as being the original software. Since few users - ever read sources, credits must appear in the documentation. - 4. This notice may not be removed or altered. diff --git a/ndb/src/common/editline/complete.c b/ndb/src/common/editline/complete.c deleted file mode 100644 index c524a88c678..00000000000 --- a/ndb/src/common/editline/complete.c +++ /dev/null @@ -1,195 +0,0 @@ -/* -*- c-basic-offset: 4; -*- -** $Revision: 1.8 $ -** -** History and file completion functions for editline library. -*/ -#include "editline_internal.h" - - -/* -** strcmp-like sorting predicate for qsort. -*/ -static int -compare(const void *p1, const void *p2) -{ - const char **v1; - const char **v2; - - v1 = (const char **)p1; - v2 = (const char **)p2; - return strcmp(*v1, *v2); -} - -/* -** Fill in *avp with an array of names that match file, up to its length. -** Ignore . and .. . -*/ -static int -FindMatches(char *dir, char *file, char ***avp) -{ - char **av; - char **new; - char *p; - DIR *dp; - struct dirent *ep; - size_t ac; - size_t len; - - if ((dp = opendir(dir)) == NULL) - return 0; - - av = NULL; - ac = 0; - len = strlen(file); - while ((ep = readdir(dp)) != NULL) { - p = ep->d_name; - if (p[0] == '.' && (p[1] == '\0' || (p[1] == '.' && p[2] == '\0'))) - continue; - if (len && strncmp(p, file, len) != 0) - continue; - - if ((ac % MEM_INC) == 0) { - if ((new = malloc(sizeof(char*) * (ac + MEM_INC))) == NULL) - break; - if (ac) { - memcpy(new, av, ac * sizeof (char **)); - free(av); - } - *avp = av = new; - } - - if ((av[ac] = strdup(p)) == NULL) { - if (ac == 0) - free(av); - break; - } - ac++; - } - - /* Clean up and return. */ - (void)closedir(dp); - if (ac) - qsort(av, ac, sizeof (char **), compare); - return ac; -} - -/* -** Split a pathname into allocated directory and trailing filename parts. -*/ -static int -SplitPath(char *path, char **dirpart, char ** filepart) -{ - static char DOT[] = "."; - char *dpart; - char *fpart; - - if ((fpart = strrchr(path, '/')) == NULL) { - if ((dpart = strdup(DOT)) == NULL) - return -1; - if ((fpart = strdup(path)) == NULL) { - free(dpart); - return -1; - } - } - else { - if ((dpart = strdup(path)) == NULL) - return -1; - dpart[fpart - path + 1] = '\0'; - if ((fpart = strdup(++fpart)) == NULL) { - free(dpart); - return -1; - } - } - *dirpart = dpart; - *filepart = fpart; - return 0; -} - -/* -** Attempt to complete the pathname, returning an allocated copy. -** Fill in *unique if we completed it, or set it to 0 if ambiguous. -*/ -char * -rl_complete(char *pathname,int *unique) -{ - char **av; - char *dir; - char *file; - char *new; - char *p; - size_t ac; - size_t end; - size_t i; - size_t j; - size_t len; - size_t new_len; - size_t p_len; - - if (SplitPath(pathname, &dir, &file) < 0) - return NULL; - if ((ac = FindMatches(dir, file, &av)) == 0) { - free(dir); - free(file); - return NULL; - } - - p = NULL; - len = strlen(file); - if (ac == 1) { - /* Exactly one match -- finish it off. */ - *unique = 1; - j = strlen(av[0]) - len + 2; - p_len = sizeof(char) * (j + 1); - if ((p = malloc(p_len)) != NULL) { - memcpy(p, av[0] + len, j); - new_len = sizeof(char) * (strlen(dir) + strlen(av[0]) + 2); - new = malloc(new_len); - if(new != NULL) { - snprintf(new, new_len, "%s/%s", dir, av[0]); - rl_add_slash(new, p, p_len); - free(new); - } - } - } - else { - /* Find largest matching substring. */ - for (*unique = 0, i = len, end = strlen(av[0]); i < end; i++) - for (j = 1; j < ac; j++) - if (av[0][i] != av[j][i]) - goto breakout; -breakout: - if (i > len) { - j = i - len + 1; - if ((p = malloc(sizeof(char) * j)) != NULL) { - memcpy(p, av[0] + len, j); - p[j - 1] = '\0'; - } - } - } - - /* Clean up and return. */ - free(dir); - free(file); - for (i = 0; i < ac; i++) - free(av[i]); - free(av); - return p; -} - -/* -** Return all possible completions. -*/ -int -rl_list_possib(char *pathname, char ***avp) -{ - char *dir; - char *file; - int ac; - - if (SplitPath(pathname, &dir, &file) < 0) - return 0; - ac = FindMatches(dir, file, avp); - free(dir); - free(file); - return ac; -} diff --git a/ndb/src/common/editline/editline.3 b/ndb/src/common/editline/editline.3 deleted file mode 100644 index 159cc7f87bb..00000000000 --- a/ndb/src/common/editline/editline.3 +++ /dev/null @@ -1,178 +0,0 @@ -.\" $Revision: 1.1 $ -.TH EDITLINE 3 -.SH NAME -editline \- command-line editing library with history -.SH SYNOPSIS -.nf -.B "char *" -.B "readline(prompt)" -.B " char *prompt;" - -.B "void" -.B "add_history(line)" -.B " char *line;" -.fi -.SH DESCRIPTION -.I Editline -is a library that provides an line-editing interface with text recall. -It is intended to be compatible with the -.I readline -library provided by the Free Software Foundation, but much smaller. -The bulk of this manual page describes the user interface. -.PP -The -.I readline -routine returns a line of text with the trailing newline removed. -The data is returned in a buffer allocated with -.IR malloc (3), -so the space should be released with -.IR free (3) -when the calling program is done with it. -Before accepting input from the user, the specified -.I prompt -is displayed on the terminal. -.PP -The -.I add_history -routine makes a copy of the specified -.I line -and adds it to the internal history list. -.SS "User Interface" -A program that uses this library provides a simple emacs-like editing -interface to its users. -A line may be edited before it is sent to the calling program by typing either -control characters or escape sequences. -A control character, shown as a caret followed by a letter, is typed by -holding down the ``control'' key while the letter is typed. -For example, ``^A'' is a control-A. -An escape sequence is entered by typing the ``escape'' key followed by one or -more characters. -The escape key is abbreviated as ``ESC''. -Note that unlike control keys, case matters in escape sequences; ``ESC\ F'' -is not the same as ``ESC\ f''. -.PP -An editing command may be typed anywhere on the line, not just at the -beginning. -In addition, a return may also be typed anywhere on the line, not just at -the end. -.PP -Most editing commands may be given a repeat count, -.IR n , -where -.I n -is a number. -To enter a repeat count, type the escape key, the number, and then -the command to execute. -For example, ``ESC\ 4\ ^f'' moves forward four characters. -If a command may be given a repeat count then the text ``[n]'' is given at the -end of its description. -.PP -The following control characters are accepted: -.RS -.nf -.ta \w'ESC DEL 'u -^A Move to the beginning of the line -^B Move left (backwards) [n] -^D Delete character [n] -^E Move to end of line -^F Move right (forwards) [n] -^G Ring the bell -^H Delete character before cursor (backspace key) [n] -^I Complete filename (tab key); see below -^J Done with line (return key) -^K Kill to end of line (or column [n]) -^L Redisplay line -^M Done with line (alternate return key) -^N Get next line from history [n] -^P Get previous line from history [n] -^R Search backward (forward if [n]) through history for text; -\& prefixing the string with a caret (^) forces it to -\& match only at the beginning of a history line -^T Transpose characters -^V Insert next character, even if it is an edit command -^W Wipe to the mark -^X^X Exchange current location and mark -^Y Yank back last killed text -^[ Start an escape sequence (escape key) -^]c Move forward to next character ``c'' -^? Delete character before cursor (delete key) [n] -.fi -.RE -.PP -The following escape sequences are provided. -.RS -.nf -.ta \w'ESC DEL 'u -ESC\ ^H Delete previous word (backspace key) [n] -ESC\ DEL Delete previous word (delete key) [n] -ESC\ ESC Show possible completions; see below -ESC\ SP Set the mark (space key); see ^X^X and ^Y above -ESC\ . Get the last (or [n]'th) word from previous line -ESC\ ? Show possible completions; see below -ESC\ < Move to start of history -ESC\ > Move to end of history -ESC\ b Move backward a word [n] -ESC\ d Delete word under cursor [n] -ESC\ f Move forward a word [n] -ESC\ l Make word lowercase [n] -ESC\ m Toggle if 8bit chars display as themselves or with -\& an ``M\-'' prefix -ESC\ u Make word uppercase [n] -ESC\ y Yank back last killed text -ESC\ w Make area up to mark yankable -ESC\ nn Set repeat count to the number nn -ESC\ C Read from environment variable ``_C_'', where C is -\& an uppercase letter -.fi -.RE -.PP -The -.I editline -library has a small macro facility. -If you type the escape key followed by an uppercase letter, -.IR C , -then the contents of the environment variable -.I _C_ -are read in as if you had typed them at the keyboard. -For example, if the variable -.I _L_ -contains the following: -.RS -^A^Kecho '^V^[[H^V^[[2J'^M -.RE -Then typing ``ESC L'' will move to the beginning of the line, kill the -entire line, enter the echo command needed to clear the terminal (if your -terminal is like a VT-100), and send the line back to the shell. -.PP -The -.I editline -library also does filename completion. -Suppose the root directory has the following files in it: -.RS -.nf -.ta \w'core 'u -bin vmunix -core vmunix.old -.fi -.RE -If you type ``rm\ /v'' and then the tab key. -.I Editline -will then finish off as much of the name as possible by adding ``munix''. -Because the name is not unique, it will then beep. -If you type the escape key followed by either a question mark or another -escape, it will display the two choices. -If you then type a period and a tab, the library will finish off the filename -for you: -.RS -.nf -.RI "rm /v[TAB]" munix ".[TAB]" old -.fi -.RE -The tab key is shown by ``[TAB]'' and the automatically-entered text -is shown in italics. -.SH "BUGS AND LIMITATIONS" -Cannot handle lines more than 80 columns. -.SH AUTHORS -Simmule R. Turner -and Rich $alz . -Original manual page by DaviD W. Sanderson . diff --git a/ndb/src/common/editline/editline.c b/ndb/src/common/editline/editline.c deleted file mode 100644 index 886dac2793b..00000000000 --- a/ndb/src/common/editline/editline.c +++ /dev/null @@ -1,1498 +0,0 @@ -/* -*- c-basic-offset: 4; -*- -** $Revision: 1.6 $ -** -** Main editing routines for editline library. -*/ -#include - -#include "editline_internal.h" -#include - -/* -** Manifest constants. -*/ -#define SCREEN_WIDTH 80 -#define SCREEN_ROWS 24 -#define NO_ARG (-1) -#define DEL 127 -#define TAB '\t' -#define CTL(x) ((x) & 0x1F) -#define ISCTL(x) ((x) && (x) < ' ') -#define UNCTL(x) ((x) + 64) -#define META(x) ((x) | 0x80) -#define ISMETA(x) ((x) & 0x80) -#define UNMETA(x) ((x) & 0x7F) -#define MAPSIZE 32 -#define METAMAPSIZE 16 -#if !defined(HIST_SIZE) -#define HIST_SIZE 20 -#endif /* !defined(HIST_SIZE) */ - -/* -** Command status codes. -*/ -typedef enum _STATUS { - CSdone, CSeof, CSmove, CSdispatch, CSstay, CSsignal -} STATUS; - -/* -** The type of case-changing to perform. -*/ -typedef enum _CASE { - TOupper, TOlower -} CASE; - -/* -** Key to command mapping. -*/ -typedef struct _KEYMAP { - char Key; - char Active; - STATUS (*Function)(); -} KEYMAP; - -/* -** Command history structure. -*/ -typedef struct _HISTORY { - int Size; - int Pos; - char *Lines[HIST_SIZE]; -} HISTORY; - -/* -** Globals. -*/ -int rl_eof; -int rl_erase; -int rl_intr; -int rl_kill; -int rl_quit; -#if defined(DO_SIGTSTP) -int rl_susp; -#endif /* defined(DO_SIGTSTP) */ - -static char NIL[] = ""; -static const char *Input = NIL; -static char *Line; -static const char *Prompt; -static char *Yanked; -static char *Screen; -static char NEWLINE[]= CRLF; -static HISTORY H; -static int Repeat; -static int End; -static int Mark; -static int OldPoint; -static int Point; -static int PushBack; -static int Pushed; -static int Signal; -static KEYMAP Map[MAPSIZE]; -static KEYMAP MetaMap[METAMAPSIZE]; -static size_t Length; -static size_t ScreenCount; -static size_t ScreenSize; -static char *backspace; -static int TTYwidth; -static int TTYrows; - -/* Display print 8-bit chars as `M-x' or as the actual 8-bit char? */ -int rl_meta_chars = 1; - -/* -** Declarations. -*/ -static char *editinput(); - -#if defined(USE_TERMCAP) -extern char *getenv(); -extern char *tgetstr(); -extern int tgetent(); -extern int tgetnum(); -#endif /* defined(USE_TERMCAP) */ - -/* -** TTY input/output functions. -*/ - -static void -TTYflush() -{ - if (ScreenCount) { - (void)write(1, Screen, ScreenCount); - ScreenCount = 0; - } -} - -static void -TTYput(const char c) -{ - Screen[ScreenCount] = c; - if (++ScreenCount >= ScreenSize - 1) { - ScreenSize += SCREEN_INC; - Screen = realloc(Screen, sizeof(char) * ScreenSize); - /* XXX what to do if realloc failes? */ - } -} - -static void -TTYputs(const char *p) -{ - while (*p) - TTYput(*p++); -} - -static void -TTYshow(char c) -{ - if (c == DEL) { - TTYput('^'); - TTYput('?'); - } - else if (c == TAB) { - /* XXX */ - } - else if (ISCTL(c)) { - TTYput('^'); - TTYput(UNCTL(c)); - } - else if (rl_meta_chars && ISMETA(c)) { - TTYput('M'); - TTYput('-'); - TTYput(UNMETA(c)); - } - else - TTYput(c); -} - -static void -TTYstring(char *p) -{ - while (*p) - TTYshow(*p++); -} - -static int -TTYget() -{ - char c; - - TTYflush(); - if (Pushed) { - Pushed = 0; - return PushBack; - } - if (*Input) - return *Input++; - return read(0, &c, (size_t)1) == 1 ? c : EOF; -} - -#define TTYback() (backspace ? TTYputs((const char *)backspace) : TTYput('\b')) - -static void -TTYbackn(int n) -{ - while (--n >= 0) - TTYback(); -} - -static void -TTYinfo() -{ - static int init; -#if defined(USE_TERMCAP) - char *term; - char buff[2048]; - char *bp; - char *p; -#endif /* defined(USE_TERMCAP) */ -#if defined(TIOCGWINSZ) - struct winsize W; -#endif /* defined(TIOCGWINSZ) */ - - if (init) { -#if defined(TIOCGWINSZ) - /* Perhaps we got resized. */ - if (ioctl(0, TIOCGWINSZ, &W) >= 0 - && W.ws_col > 0 && W.ws_row > 0) { - TTYwidth = (int)W.ws_col; - TTYrows = (int)W.ws_row; - } -#endif /* defined(TIOCGWINSZ) */ - return; - } - init++; - - TTYwidth = TTYrows = 0; -#if defined(USE_TERMCAP) - bp = &buff[0]; - if ((term = getenv("TERM")) == NULL) - term = "dumb"; - if (tgetent(buff, term) < 0) { - TTYwidth = SCREEN_WIDTH; - TTYrows = SCREEN_ROWS; - return; - } - p = tgetstr("le", &bp); - backspace = p ? strdup(p) : NULL; - TTYwidth = tgetnum("co"); - TTYrows = tgetnum("li"); -#endif /* defined(USE_TERMCAP) */ - -#if defined(TIOCGWINSZ) - if (ioctl(0, TIOCGWINSZ, &W) >= 0) { - TTYwidth = (int)W.ws_col; - TTYrows = (int)W.ws_row; - } -#endif /* defined(TIOCGWINSZ) */ - - if (TTYwidth <= 0 || TTYrows <= 0) { - TTYwidth = SCREEN_WIDTH; - TTYrows = SCREEN_ROWS; - } -} - - -/* -** Print an array of words in columns. -*/ -static void -columns(int ac, char **av) -{ - char *p; - int i; - int j; - int k; - int len; - int skip; - int longest; - int cols; - - /* Find longest name, determine column count from that. */ - for (longest = 0, i = 0; i < ac; i++) - if ((j = strlen((char *)av[i])) > longest) - longest = j; - cols = TTYwidth / (longest + 3); - - TTYputs((const char *)NEWLINE); - for (skip = ac / cols + 1, i = 0; i < skip; i++) { - for (j = i; j < ac; j += skip) { - for (p = av[j], len = strlen((char *)p), k = len; --k >= 0; p++) - TTYput(*p); - if (j + skip < ac) - while (++len < longest + 3) - TTYput(' '); - } - TTYputs((const char *)NEWLINE); - } -} - -static void -reposition() -{ - int i; - char *p; - - TTYput('\r'); - TTYputs((const char *)Prompt); - for (i = Point, p = Line; --i >= 0; p++) - TTYshow(*p); -} - -static void -left(STATUS Change) -{ - char c; - - TTYback(); - if (Point) { - c = Line[Point - 1]; - if (c == TAB) { - /* XXX */ - } - else if (ISCTL(c)) - TTYback(); - else if (rl_meta_chars && ISMETA(c)) { - TTYback(); - TTYback(); - } - } - if (Change == CSmove) - Point--; -} - -static void -right(STATUS Change) -{ - TTYshow(Line[Point]); - if (Change == CSmove) - Point++; -} - -static STATUS -ring_bell() -{ - TTYput('\07'); - TTYflush(); - return CSstay; -} - -static STATUS -do_macro(int c) -{ - char name[4]; - - name[0] = '_'; - name[1] = c; - name[2] = '_'; - name[3] = '\0'; - - if ((Input = (char *)getenv((char *)name)) == NULL) { - Input = NIL; - return ring_bell(); - } - return CSstay; -} - -static STATUS -do_forward(STATUS move) -{ - int i; - char *p; - - i = 0; - do { - p = &Line[Point]; - for ( ; Point < End && (*p == ' ' || !isalnum((int)*p)); Point++, p++) - if (move == CSmove) - right(CSstay); - - for (; Point < End && isalnum((int)*p); Point++, p++) - if (move == CSmove) - right(CSstay); - - if (Point == End) - break; - } while (++i < Repeat); - - return CSstay; -} - -static STATUS -do_case(CASE type) -{ - int i; - int end; - int count; - char *p; - - (void)do_forward(CSstay); - if (OldPoint != Point) { - if ((count = Point - OldPoint) < 0) - count = -count; - Point = OldPoint; - if ((end = Point + count) > End) - end = End; - for (i = Point, p = &Line[i]; i < end; i++, p++) { - if (type == TOupper) { - if (islower((int)*p)) - *p = toupper((int)*p); - } - else if (isupper((int)*p)) - *p = tolower((int)*p); - right(CSmove); - } - } - return CSstay; -} - -static STATUS -case_down_word() -{ - return do_case(TOlower); -} - -static STATUS -case_up_word() -{ - return do_case(TOupper); -} - -static void -ceol() -{ - int extras; - int i; - char *p; - - for (extras = 0, i = Point, p = &Line[i]; i <= End; i++, p++) { - TTYput(' '); - if (*p == TAB) { - /* XXX */ - } - else if (ISCTL(*p)) { - TTYput(' '); - extras++; - } - else if (rl_meta_chars && ISMETA(*p)) { - TTYput(' '); - TTYput(' '); - extras += 2; - } - } - - for (i += extras; i > Point; i--) - TTYback(); -} - -static void -clear_line() -{ - Point = -strlen(Prompt); - TTYput('\r'); - ceol(); - Point = 0; - End = 0; - Line[0] = '\0'; -} - -static STATUS -insert_string(char *p) -{ - size_t len; - int i; - char *new; - char *q; - - len = strlen((char *)p); - if (End + len >= Length) { - if ((new = malloc(sizeof(char) * (Length + len + MEM_INC))) == NULL) - return CSstay; - if (Length) { - memcpy(new, Line, Length); - free(Line); - } - Line = new; - Length += len + MEM_INC; - } - - for (q = &Line[Point], i = End - Point; --i >= 0; ) - q[len + i] = q[i]; - memcpy(&Line[Point], p, len); - End += len; - Line[End] = '\0'; - TTYstring(&Line[Point]); - Point += len; - - return Point == End ? CSstay : CSmove; -} - -static STATUS -redisplay() -{ - TTYputs((const char *)NEWLINE); - TTYputs((const char *)Prompt); - TTYstring(Line); - return CSmove; -} - -static STATUS -redisplay_no_nl() -{ - TTYput('\r'); - TTYputs((const char *)Prompt); - TTYstring(Line); - return CSmove; -} - -static STATUS -toggle_meta_mode() -{ - rl_meta_chars = !rl_meta_chars; - return redisplay(); -} - - -static char * -next_hist() -{ - return H.Pos >= H.Size - 1 ? NULL : H.Lines[++H.Pos]; -} - -static char * -prev_hist() -{ - return H.Pos == 0 ? NULL : H.Lines[--H.Pos]; -} - -static STATUS -do_insert_hist(char *p) -{ - if (p == NULL) - return ring_bell(); - Point = 0; - reposition(); - ceol(); - End = 0; - return insert_string(p); -} - -static STATUS -do_hist(char *(*move)()) -{ - char *p; - int i; - - i = 0; - do { - if ((p = (*move)()) == NULL) - return ring_bell(); - } while (++i < Repeat); - return do_insert_hist(p); -} - -static STATUS -h_next() -{ - return do_hist(next_hist); -} - -static STATUS -h_prev() -{ - return do_hist(prev_hist); -} - -static STATUS -h_first() -{ - return do_insert_hist(H.Lines[H.Pos = 0]); -} - -static STATUS -h_last() -{ - return do_insert_hist(H.Lines[H.Pos = H.Size - 1]); -} - -/* -** Return zero if pat appears as a substring in text. -*/ -static int -substrcmp(char *text, char *pat,int len) -{ - char c; - - if ((c = *pat) == '\0') - return *text == '\0'; - for ( ; *text; text++) - if (*text == c && strncmp(text, pat, len) == 0) - return 0; - return 1; -} - -static char * -search_hist(char *search,char *(*move)()) -{ - static char *old_search; - int len; - int pos; - int (*match)(); - char *pat; - - /* Save or get remembered search pattern. */ - if (search && *search) { - if (old_search) - free(old_search); - old_search = strdup(search); - } - else { - if (old_search == NULL || *old_search == '\0') - return NULL; - search = old_search; - } - - /* Set up pattern-finder. */ - if (*search == '^') { - match = strncmp; - pat = (char *)(search + 1); - } - else { - match = substrcmp; - pat = (char *)search; - } - len = strlen(pat); - - for (pos = H.Pos; (*move)() != NULL; ) - if ((*match)((char *)H.Lines[H.Pos], pat, len) == 0) - return H.Lines[H.Pos]; - H.Pos = pos; - return NULL; -} - -static STATUS -h_search() -{ - static int Searching; - const char *old_prompt; - char *(*move)(); - char *p; - - if (Searching) - return ring_bell(); - Searching = 1; - - clear_line(); - old_prompt = Prompt; - Prompt = "Search: "; - TTYputs((const char *)Prompt); - move = Repeat == NO_ARG ? prev_hist : next_hist; - p = editinput(); - Searching = 0; - if (p == NULL && Signal > 0) { - Signal = 0; - clear_line(); - Prompt = old_prompt; - return redisplay_no_nl(); - } - p = search_hist(p, move); - clear_line(); - Prompt = old_prompt; - if (p == NULL) { - (void)ring_bell(); - return redisplay_no_nl(); - } - return do_insert_hist(p); -} - -static STATUS -fd_char() -{ - int i; - - i = 0; - do { - if (Point >= End) - break; - right(CSmove); - } while (++i < Repeat); - return CSstay; -} - -static void -save_yank(int begin, int i) -{ - if (Yanked) { - free(Yanked); - Yanked = NULL; - } - - if (i < 1) - return; - - if ((Yanked = malloc(sizeof(char) * (i + 1))) != NULL) { - memcpy(Yanked, &Line[begin], i); - Yanked[i] = '\0'; - } -} - -static STATUS -delete_string(int count) -{ - int i; - char *p; - - if (count <= 0 || End == Point) - return ring_bell(); - - if (count == 1 && Point == End - 1) { - /* Optimize common case of delete at end of line. */ - End--; - p = &Line[Point]; - i = 1; - TTYput(' '); - if (*p == TAB) { - /* XXX */ - } - else if (ISCTL(*p)) { - i = 2; - TTYput(' '); - } - else if (rl_meta_chars && ISMETA(*p)) { - i = 3; - TTYput(' '); - TTYput(' '); - } - TTYbackn(i); - *p = '\0'; - return CSmove; - } - if (Point + count > End && (count = End - Point) <= 0) - return CSstay; - - if (count > 1) - save_yank(Point, count); - - ceol(); - for (p = &Line[Point], i = End - (Point + count) + 1; --i >= 0; p++) - p[0] = p[count]; - End -= count; - TTYstring(&Line[Point]); - return CSmove; -} - -static STATUS -bk_char() -{ - int i; - - i = 0; - do { - if (Point == 0) - break; - left(CSmove); - } while (++i < Repeat); - - return CSstay; -} - -static STATUS -bk_del_char() -{ - int i; - - i = 0; - do { - if (Point == 0) - break; - left(CSmove); - } while (++i < Repeat); - - return delete_string(i); -} - -static STATUS -kill_line() -{ - int i; - - if (Repeat != NO_ARG) { - if (Repeat < Point) { - i = Point; - Point = Repeat; - reposition(); - (void)delete_string(i - Point); - } - else if (Repeat > Point) { - right(CSmove); - (void)delete_string(Repeat - Point - 1); - } - return CSmove; - } - - save_yank(Point, End - Point); - ceol(); - Line[Point] = '\0'; - End = Point; - return CSstay; -} - -static STATUS -insert_char(int c) -{ - STATUS s; - char buff[2]; - char *p; - char *q; - int i; - - if (Repeat == NO_ARG || Repeat < 2) { - buff[0] = c; - buff[1] = '\0'; - return insert_string(buff); - } - - if ((p = malloc(sizeof(char) * (Repeat + 1))) == NULL) - return CSstay; - for (i = Repeat, q = p; --i >= 0; ) - *q++ = c; - *q = '\0'; - Repeat = 0; - s = insert_string(p); - free(p); - return s; -} - -static STATUS -meta() -{ - int c; - KEYMAP *kp; - - if ((c = TTYget()) == EOF) - return CSeof; -#if defined(ANSI_ARROWS) - /* Also include VT-100 arrows. */ - if (c == '[' || c == 'O') - switch ((int)(c = TTYget())) { - default: return ring_bell(); - case EOF: return CSeof; - case 'A': return h_prev(); - case 'B': return h_next(); - case 'C': return fd_char(); - case 'D': return bk_char(); - } -#endif /* defined(ANSI_ARROWS) */ - - if (isdigit(c)) { - for (Repeat = c - '0'; (c = TTYget()) != EOF && isdigit(c); ) - Repeat = Repeat * 10 + c - '0'; - Pushed = 1; - PushBack = c; - return CSstay; - } - - if (isupper(c)) - return do_macro(c); - for (OldPoint = Point, kp = MetaMap; kp < &MetaMap[METAMAPSIZE]; kp++) - if (kp->Key == c && kp->Active) - return (*kp->Function)(); - - return ring_bell(); -} - -static STATUS -emacs(int c) -{ - STATUS s; - KEYMAP *kp; - -#if 0 - /* This test makes it impossible to enter eight-bit characters when - * meta-char mode is enabled. */ - if (rl_meta_chars && ISMETA(c)) { - Pushed = 1; - PushBack = UNMETA(c); - return meta(); - } -#endif /* 0 */ - for (kp = Map; kp < &Map[MAPSIZE]; kp++) - if (kp->Key == c && kp->Active) - break; - s = kp < &Map[MAPSIZE] ? (*kp->Function)() : insert_char((int)c); - if (!Pushed) - /* No pushback means no repeat count; hacky, but true. */ - Repeat = NO_ARG; - return s; -} - -static STATUS -TTYspecial(int c) -{ - if (rl_meta_chars && ISMETA(c)) - return CSdispatch; - - if (c == rl_erase || c == DEL) - return bk_del_char(); - if (c == rl_kill) { - if (Point != 0) { - Point = 0; - reposition(); - } - Repeat = NO_ARG; - return kill_line(); - } - if (c == rl_eof && Point == 0 && End == 0) - return CSeof; - if (c == rl_intr) { - Signal = SIGINT; - return CSsignal; - } - if (c == rl_quit) { - Signal = SIGQUIT; - return CSsignal; - } -#if defined(DO_SIGTSTP) - if (c == rl_susp) { - Signal = SIGTSTP; - return CSsignal; - } -#endif /* defined(DO_SIGTSTP) */ - - return CSdispatch; -} - -static char * -editinput() -{ - int c; - - Repeat = NO_ARG; - OldPoint = Point = Mark = End = 0; - Line[0] = '\0'; - - Signal = -1; - while ((c = TTYget()) != EOF) - switch (TTYspecial(c)) { - case CSdone: - return Line; - case CSeof: - return NULL; - case CSsignal: - return (char *)""; - case CSmove: - reposition(); - break; - case CSdispatch: - switch (emacs(c)) { - case CSdone: - return Line; - case CSeof: - return NULL; - case CSsignal: - return (char *)""; - case CSmove: - reposition(); - break; - case CSdispatch: - case CSstay: - break; - } - break; - case CSstay: - break; - } - return NULL; -} - -static void -hist_add(char *p) -{ - int i; - - if ((p = strdup(p)) == NULL) - return; - if (H.Size < HIST_SIZE) - H.Lines[H.Size++] = p; - else { - free(H.Lines[0]); - for (i = 0; i < HIST_SIZE - 1; i++) - H.Lines[i] = H.Lines[i + 1]; - H.Lines[i] = p; - } - H.Pos = H.Size - 1; -} - -static char * -read_redirected() -{ - int size; - char *p; - char *line; - char *end; - - for (size = MEM_INC, p = line = malloc(sizeof(char) * size), end = p + size; ; p++) { - if (p == end) { - size += MEM_INC; - p = line = realloc(line, size); - end = p + size; - } - if (read(0, p, 1) <= 0) { - /* Ignore "incomplete" lines at EOF, just like we do for a tty. */ - free(line); - return NULL; - } - if (*p == '\n') - break; - } - *p = '\0'; - return line; -} - -/* -** For compatibility with FSF readline. -*/ -/* ARGSUSED0 */ -void -rl_reset_terminal(char *p) -{ - (void)p; /* Suppress warning */ -} - -void -rl_initialize() -{ -} - -int -rl_insert(int count, int c) -{ - if (count > 0) { - Repeat = count; - (void)insert_char(c); - (void)redisplay_no_nl(); - } - return 0; -} - -int (*rl_event_hook)(); - -int -rl_key_action(int c, char flag) -{ - KEYMAP *kp; - int size; - - (void)flag; /* Suppress warning */ - - if (ISMETA(c)) { - kp = MetaMap; - size = METAMAPSIZE; - } - else { - kp = Map; - size = MAPSIZE; - } - for ( ; --size >= 0; kp++) - if (kp->Key == c) { - kp->Active = c ? 1 : 0; - return 1; - } - return -1; -} - -char * -readline(const char *prompt) -{ - char *line; - int s; - - if (!isatty(0)) { - TTYflush(); - return read_redirected(); - } - - if (Line == NULL) { - Length = MEM_INC; - if ((Line = malloc(sizeof(char) * Length)) == NULL) - return NULL; - } - - TTYinfo(); - rl_ttyset(0); - hist_add(NIL); - ScreenSize = SCREEN_INC; - Screen = malloc(sizeof(char) * ScreenSize); - Prompt = prompt ? prompt : (char *)NIL; - TTYputs((const char *)Prompt); - if ((line = editinput()) != NULL) { - line = strdup(line); - TTYputs((const char *)NEWLINE); - TTYflush(); - } - rl_ttyset(1); - free(Screen); - free(H.Lines[--H.Size]); - if (Signal > 0) { - s = Signal; - Signal = 0; - (void)kill(getpid(), s); - } - return (char *)line; -} - -void -add_history(char *p) -{ - if (p == NULL || *p == '\0') - return; - -#if defined(UNIQUE_HISTORY) - if (H.Size && strcmp(p, H.Lines[H.Size - 1]) == 0) - return; -#endif /* defined(UNIQUE_HISTORY) */ - hist_add((char *)p); -} - - -static STATUS -beg_line() -{ - if (Point) { - Point = 0; - return CSmove; - } - return CSstay; -} - -static STATUS -del_char() -{ - return delete_string(Repeat == NO_ARG ? 1 : Repeat); -} - -static STATUS -end_line() -{ - if (Point != End) { - Point = End; - return CSmove; - } - return CSstay; -} - -/* -** Return allocated copy of word under cursor, moving cursor after the -** word. -*/ -static char * -find_word() -{ - static char SEPS[] = "\"#;&|^$=`'{}()<>\n\t "; - char *p; - char *new; - size_t len; - - /* Move forward to end of word. */ - p = &Line[Point]; - for ( ; Point < End && strchr(SEPS, (char)*p) == NULL; Point++, p++) - right(CSstay); - - /* Back up to beginning of word. */ - for (p = &Line[Point]; p > Line && strchr(SEPS, (char)p[-1]) == NULL; p--) - continue; - len = Point - (p - Line) + 1; - if ((new = malloc(sizeof(char) * len)) == NULL) - return NULL; - memcpy(new, p, len); - new[len - 1] = '\0'; - return new; -} - -static STATUS -c_complete() -{ - char *p; - char *word; - int unique; - - word = find_word(); - p = (char *)rl_complete((char *)word, &unique); - if (word) - free(word); - if (p && *p) { - (void)insert_string(p); - if (!unique) - (void)ring_bell(); - free(p); - return redisplay_no_nl(); - } - return ring_bell(); -} - -static STATUS -c_possible() -{ - char **av; - char *word; - int ac; - - word = find_word(); - ac = rl_list_possib((char *)word, (char ***)&av); - if (word) - free(word); - if (ac) { - columns(ac, av); - while (--ac >= 0) - free(av[ac]); - free(av); - return redisplay_no_nl(); - } - return ring_bell(); -} - -static STATUS -accept_line() -{ - Line[End] = '\0'; - return CSdone; -} - -static STATUS -transpose() -{ - char c; - - if (Point) { - if (Point == End) - left(CSmove); - c = Line[Point - 1]; - left(CSstay); - Line[Point - 1] = Line[Point]; - TTYshow(Line[Point - 1]); - Line[Point++] = c; - TTYshow(c); - } - return CSstay; -} - -static STATUS -quote() -{ - int c; - - return (c = TTYget()) == EOF ? CSeof : insert_char((int)c); -} - -static STATUS -wipe() -{ - int i; - - if (Mark > End) - return ring_bell(); - - if (Point > Mark) { - i = Point; - Point = Mark; - Mark = i; - reposition(); - } - - return delete_string(Mark - Point); -} - -static STATUS -mk_set() -{ - Mark = Point; - return CSstay; -} - -static STATUS -exchange() -{ - int c; - - if ((c = TTYget()) != CTL('X')) - return c == EOF ? CSeof : ring_bell(); - - if ((c = Mark) <= End) { - Mark = Point; - Point = c; - return CSmove; - } - return CSstay; -} - -static STATUS -yank() -{ - if (Yanked && *Yanked) - return insert_string(Yanked); - return CSstay; -} - -static STATUS -copy_region() -{ - if (Mark > End) - return ring_bell(); - - if (Point > Mark) - save_yank(Mark, Point - Mark); - else - save_yank(Point, Mark - Point); - - return CSstay; -} - -static STATUS -move_to_char() -{ - int c; - int i; - char *p; - - if ((c = TTYget()) == EOF) - return CSeof; - for (i = Point + 1, p = &Line[i]; i < End; i++, p++) - if (*p == c) { - Point = i; - return CSmove; - } - return CSstay; -} - -static STATUS -fd_word() -{ - return do_forward(CSmove); -} - -static STATUS -fd_kill_word() -{ - int i; - - (void)do_forward(CSstay); - if (OldPoint != Point) { - i = Point - OldPoint; - Point = OldPoint; - return delete_string(i); - } - return CSstay; -} - -static STATUS -bk_word() -{ - int i; - char *p; - - i = 0; - do { - for (p = &Line[Point]; p > Line && !isalnum((int)p[-1]); p--) - left(CSmove); - - for (; p > Line && p[-1] != ' ' && isalnum((int)p[-1]); p--) - left(CSmove); - - if (Point == 0) - break; - } while (++i < Repeat); - - return CSstay; -} - -static STATUS -bk_kill_word() -{ - (void)bk_word(); - if (OldPoint != Point) - return delete_string(OldPoint - Point); - return CSstay; -} - -static int -argify(char *line, char ***avp) -{ - char *c; - char **p; - char **new; - int ac; - int i; - - i = MEM_INC; - if ((*avp = p = malloc(sizeof(char*) * i))== NULL) - return 0; - - for (c = line; isspace((int)*c); c++) - continue; - if (*c == '\n' || *c == '\0') - return 0; - - for (ac = 0, p[ac++] = c; *c && *c != '\n'; ) { - if (isspace((int)*c)) { - *c++ = '\0'; - if (*c && *c != '\n') { - if (ac + 1 == i) { - new = malloc(sizeof(char*) * (i + MEM_INC)); - if (new == NULL) { - p[ac] = NULL; - return ac; - } - memcpy(new, p, i * sizeof (char **)); - i += MEM_INC; - free(p); - *avp = p = new; - } - p[ac++] = c; - } - } - else - c++; - } - *c = '\0'; - p[ac] = NULL; - return ac; -} - -static STATUS -last_argument() -{ - char **av; - char *p; - STATUS s; - int ac; - - if (H.Size == 1 || (p = H.Lines[H.Size - 2]) == NULL) - return ring_bell(); - - if ((p = strdup(p)) == NULL) - return CSstay; - ac = argify(p, &av); - - if (Repeat != NO_ARG) - s = Repeat < ac ? insert_string(av[Repeat]) : ring_bell(); - else - s = ac ? insert_string(av[ac - 1]) : CSstay; - - if (ac) - free(av); - free(p); - return s; -} - -static KEYMAP Map[MAPSIZE] = { - { CTL('@'), 1, ring_bell }, - { CTL('A'), 1, beg_line }, - { CTL('B'), 1, bk_char }, - { CTL('D'), 1, del_char }, - { CTL('E'), 1, end_line }, - { CTL('F'), 1, fd_char }, - { CTL('G'), 1, ring_bell }, - { CTL('H'), 1, bk_del_char }, - { CTL('I'), 1, c_complete }, - { CTL('J'), 1, accept_line }, - { CTL('K'), 1, kill_line }, - { CTL('L'), 1, redisplay }, - { CTL('M'), 1, accept_line }, - { CTL('N'), 1, h_next }, - { CTL('O'), 1, ring_bell }, - { CTL('P'), 1, h_prev }, - { CTL('Q'), 1, ring_bell }, - { CTL('R'), 1, h_search }, - { CTL('S'), 1, ring_bell }, - { CTL('T'), 1, transpose }, - { CTL('U'), 1, ring_bell }, - { CTL('V'), 1, quote }, - { CTL('W'), 1, wipe }, - { CTL('X'), 1, exchange }, - { CTL('Y'), 1, yank }, - { CTL('Z'), 1, ring_bell }, - { CTL('['), 1, meta }, - { CTL(']'), 1, move_to_char }, - { CTL('^'), 1, ring_bell }, - { CTL('_'), 1, ring_bell }, -}; - -static KEYMAP MetaMap[16]= { - { CTL('H'), 1, bk_kill_word }, - { CTL('['), 1, c_possible }, - { DEL, 1, bk_kill_word }, - { ' ', 1, mk_set }, - { '.', 1, last_argument }, - { '<', 1, h_first }, - { '>', 1, h_last }, - { '?', 1, c_possible }, - { 'b', 1, bk_word }, - { 'd', 1, fd_kill_word }, - { 'f', 1, fd_word }, - { 'l', 1, case_down_word }, - { 'm', 1, toggle_meta_mode}, - { 'u', 1, case_up_word }, - { 'y', 1, yank }, - { 'w', 1, copy_region }, -}; diff --git a/ndb/src/common/editline/editline_internal.h b/ndb/src/common/editline/editline_internal.h deleted file mode 100644 index d82fa91c44b..00000000000 --- a/ndb/src/common/editline/editline_internal.h +++ /dev/null @@ -1,30 +0,0 @@ -/* $Revision: 1.2 $ -** -** Internal header file for editline library. -*/ - -#include - -#if defined(SYS_UNIX) -#include "unix.h" -#endif /* defined(SYS_UNIX) */ - -#define MEM_INC 64 -#define SCREEN_INC 256 - -/* -** Variables and routines internal to this package. -*/ -extern int rl_eof; -extern int rl_erase; -extern int rl_intr; -extern int rl_kill; -extern int rl_quit; -#if defined(DO_SIGTSTP) -extern int rl_susp; -#endif /* defined(DO_SIGTSTP) */ -extern char *rl_complete(); -extern int rl_list_possib(); -extern void rl_ttyset(); -extern void rl_add_slash(); - diff --git a/ndb/src/common/editline/sysunix.c b/ndb/src/common/editline/sysunix.c deleted file mode 100644 index b0242fb99ce..00000000000 --- a/ndb/src/common/editline/sysunix.c +++ /dev/null @@ -1,132 +0,0 @@ -/* $Revision: 1.4 $ -** -** Unix system-dependant routines for editline library. -*/ -#include "editline_internal.h" - -#if defined(HAVE_TCGETATTR) -#include - -void -rl_ttyset(int Reset) -{ - static struct termios old; - struct termios new; - - if (Reset == 0) { - if (tcgetattr(0, &old) < 0) perror("tcgetattr"); - rl_erase = old.c_cc[VERASE]; - rl_kill = old.c_cc[VKILL]; - rl_eof = old.c_cc[VEOF]; - rl_intr = old.c_cc[VINTR]; - rl_quit = old.c_cc[VQUIT]; -#if defined(DO_SIGTSTP) - rl_susp = old.c_cc[VSUSP]; -#endif /* defined(DO_SIGTSTP) */ - - new = old; - new.c_lflag &= ~(ECHO | ICANON | ISIG); - new.c_iflag &= ~(ISTRIP | INPCK); - new.c_cc[VMIN] = 1; - new.c_cc[VTIME] = 0; - if (tcsetattr(0, TCSADRAIN, &new) < 0) perror("tcsetattr"); - } - else - (void)tcsetattr(0, TCSADRAIN, &old); -} - -#else -#if defined(HAVE_TERMIO) -#include - -void -rl_ttyset(int Reset) -{ - static struct termio old; - struct termio new; - - if (Reset == 0) { - (void)ioctl(0, TCGETA, &old); - rl_erase = old.c_cc[VERASE]; - rl_kill = old.c_cc[VKILL]; - rl_eof = old.c_cc[VEOF]; - rl_intr = old.c_cc[VINTR]; - rl_quit = old.c_cc[VQUIT]; -#if defined(DO_SIGTSTP) - rl_susp = old.c_cc[VSUSP]; -#endif /* defined(DO_SIGTSTP) */ - - new = old; - new.c_lflag &= ~(ECHO | ICANON | ISIG); - new.c_iflag &= ~(ISTRIP | INPCK); - new.c_cc[VMIN] = 1; - new.c_cc[VTIME] = 0; - (void)ioctl(0, TCSETAW, &new); - } - else - (void)ioctl(0, TCSETAW, &old); -} - -#else -#include - -void -rl_ttyset(int Reset) -{ - static struct sgttyb old_sgttyb; - static struct tchars old_tchars; - struct sgttyb new_sgttyb; - struct tchars new_tchars; -#if defined(DO_SIGTSTP) - struct ltchars old_ltchars; -#endif /* defined(DO_SIGTSTP) */ - - if (Reset == 0) { - (void)ioctl(0, TIOCGETP, &old_sgttyb); - rl_erase = old_sgttyb.sg_erase; - rl_kill = old_sgttyb.sg_kill; - - (void)ioctl(0, TIOCGETC, &old_tchars); - rl_eof = old_tchars.t_eofc; - rl_intr = old_tchars.t_intrc; - rl_quit = old_tchars.t_quitc; - -#if defined(DO_SIGTSTP) - (void)ioctl(0, TIOCGLTC, &old_ltchars); - rl_susp = old_ltchars.t_suspc; -#endif /* defined(DO_SIGTSTP) */ - - new_sgttyb = old_sgttyb; - new_sgttyb.sg_flags &= ~ECHO; - new_sgttyb.sg_flags |= RAW; -#if defined(PASS8) - new_sgttyb.sg_flags |= PASS8; -#endif /* defined(PASS8) */ - (void)ioctl(0, TIOCSETP, &new_sgttyb); - - new_tchars = old_tchars; - new_tchars.t_intrc = -1; - new_tchars.t_quitc = -1; - (void)ioctl(0, TIOCSETC, &new_tchars); - } - else { - (void)ioctl(0, TIOCSETP, &old_sgttyb); - (void)ioctl(0, TIOCSETC, &old_tchars); - } -} -#endif /* defined(HAVE_TERMIO) */ -#endif /* defined(HAVE_TCGETATTR) */ - -void -rl_add_slash(char *path, char *p, size_t p_len) -{ - struct stat Sb; - - if (stat(path, &Sb) >= 0) { - size_t len= strlen(p); - if (len+1 < p_len) { - p[len]= S_ISDIR(Sb.st_mode) ? '/' : ' '; - p[len+1]= 0; - } - } -} diff --git a/ndb/src/common/editline/test/Makefile b/ndb/src/common/editline/test/Makefile deleted file mode 100644 index 20229d0aa62..00000000000 --- a/ndb/src/common/editline/test/Makefile +++ /dev/null @@ -1,10 +0,0 @@ -include .defs.mk - -TYPE := util - -BIN_TARGET := editline_test -BIN_TARGET_ARCHIVES := editline - -SOURCES = testit.c - -include $(NDB_TOP)/Epilogue.mk diff --git a/ndb/src/common/editline/test/testit.c b/ndb/src/common/editline/test/testit.c deleted file mode 100644 index 4058f8ae660..00000000000 --- a/ndb/src/common/editline/test/testit.c +++ /dev/null @@ -1,55 +0,0 @@ -/* Copyright (C) 2003 MySQL AB - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - -/* -*- c-basic-offset: 4; -*- -** $Revision: 1.5 $ -** -** A "micro-shell" to test editline library. -** If given any arguments, commands aren't executed. -*/ -#include -#include - -int -main(int argc, char **argv) -{ - char *prompt; - char *p; - int doit; - - (void)argv; /* Suppress warning */ - - doit = argc == 1; - if ((prompt = getenv("TESTPROMPT")) == NULL) - prompt = "testit> "; - - while ((p = readline(prompt)) != NULL) { - (void)printf("\t\t\t|%s|\n", p); - if (doit) { - if (strncmp(p, "cd ", 3) == 0) { - if (chdir(&p[3]) < 0) - perror(&p[3]); - } else { - if (system(p) != 0) - perror(p); - } - } - add_history(p); - free(p); - } - - return 0; -} diff --git a/ndb/src/common/editline/unix.h b/ndb/src/common/editline/unix.h deleted file mode 100644 index c2fde7547b3..00000000000 --- a/ndb/src/common/editline/unix.h +++ /dev/null @@ -1,9 +0,0 @@ -/* $Revision: 1.3 $ -** -** Editline system header file for Unix. -*/ - -#define CRLF "\r\n" - -#include -#include diff --git a/ndb/src/mgmclient/CommandInterpreter.cpp b/ndb/src/mgmclient/CommandInterpreter.cpp index e0935c2104e..e802ffff5ce 100644 --- a/ndb/src/mgmclient/CommandInterpreter.cpp +++ b/ndb/src/mgmclient/CommandInterpreter.cpp @@ -17,7 +17,195 @@ #include #include -#include "CommandInterpreter.hpp" +// copied from mysql.cc to get readline +extern "C" { +#if defined( __WIN__) || defined(OS2) +#include +#elif !defined(__NETWARE__) +#include +extern "C" int add_history(const char *command); /* From readline directory */ +#define HAVE_READLINE +#endif +} + +//#define HAVE_GLOBAL_REPLICATION + +#include +#ifdef HAVE_GLOBAL_REPLICATION +#include "../rep/repapi/repapi.h" +#endif + +#include + +class MgmtSrvr; + +/** + * @class CommandInterpreter + * @brief Reads command line in management client + * + * This class has one public method which reads a command line + * from a stream. It then interpret that commmand line and calls a suitable + * method in the MgmtSrvr class which executes the command. + * + * For command syntax, see the HELP command. + */ +class CommandInterpreter { +public: + /** + * Constructor + * @param mgmtSrvr: Management server to use when executing commands + */ + CommandInterpreter(const char *); + ~CommandInterpreter(); + + /** + * Reads one line from the stream, parse the line to find + * a command and then calls a suitable method which executes + * the command. + * + * @return true until quit/bye/exit has been typed + */ + int readAndExecute(int _try_reconnect=-1); + int execute(const char *_line, int _try_reconnect=-1); + +private: + void printError(); + + /** + * Analyse the command line, after the first token. + * + * @param processId: DB process id to send command to or -1 if + * command will be sent to all DB processes. + * @param allAfterFirstToken: What the client gave after the + * first token on the command line + */ + void analyseAfterFirstToken(int processId, char* allAfterFirstTokenCstr); + + /** + * Parse the block specification part of the LOG* commands, + * things after LOG*: [BLOCK = {ALL|+}] + * + * @param allAfterLog: What the client gave after the second token + * (LOG*) on the command line + * @param blocks, OUT: ALL or name of all the blocks + * @return: true if correct syntax, otherwise false + */ + bool parseBlockSpecification(const char* allAfterLog, + Vector& blocks); + + /** + * A bunch of execute functions: Executes one of the commands + * + * @param processId: DB process id to send command to + * @param parameters: What the client gave after the command name + * on the command line. + * For example if complete input from user is: "1 LOGLEVEL 22" then the + * parameters argument is the string with everything after LOGLEVEL, in + * this case "22". Each function is responsible to check the parameters + * argument. + */ + void executeHelp(char* parameters); + void executeShow(char* parameters); + void executeShutdown(char* parameters); + void executeRun(char* parameters); + void executeInfo(char* parameters); + void executeClusterLog(char* parameters); + +public: + void executeStop(int processId, const char* parameters, bool all); + void executeEnterSingleUser(char* parameters); + void executeExitSingleUser(char* parameters); + void executeStart(int processId, const char* parameters, bool all); + void executeRestart(int processId, const char* parameters, bool all); + void executeLogLevel(int processId, const char* parameters, bool all); + void executeError(int processId, const char* parameters, bool all); + void executeTrace(int processId, const char* parameters, bool all); + void executeLog(int processId, const char* parameters, bool all); + void executeLogIn(int processId, const char* parameters, bool all); + void executeLogOut(int processId, const char* parameters, bool all); + void executeLogOff(int processId, const char* parameters, bool all); + void executeTestOn(int processId, const char* parameters, bool all); + void executeTestOff(int processId, const char* parameters, bool all); + void executeSet(int processId, const char* parameters, bool all); + void executeGetStat(int processId, const char* parameters, bool all); + void executeStatus(int processId, const char* parameters, bool all); + void executeEventReporting(int processId, const char* parameters, bool all); + void executeDumpState(int processId, const char* parameters, bool all); + void executeStartBackup(char * parameters); + void executeAbortBackup(char * parameters); + + void executeRep(char* parameters); + + void executeCpc(char * parameters); + +public: + bool connect(); + bool disconnect(); + + /** + * A execute function definition + */ +public: + typedef void (CommandInterpreter::* ExecuteFunction)(int processId, + const char * param, + bool all); + + struct CommandFunctionPair { + const char * command; + ExecuteFunction executeFunction; + }; +private: + /** + * + */ + void executeForAll(const char * cmd, + ExecuteFunction fun, + const char * param); + + NdbMgmHandle m_mgmsrv; + bool connected; + const char *host; + int try_reconnect; +#ifdef HAVE_GLOBAL_REPLICATION + NdbRepHandle m_repserver; + const char *rep_host; + bool rep_connected; +#endif +}; + + +/* + * Facade object for CommandInterpreter + */ + +#include "ndb_mgmclient.hpp" + +Ndb_mgmclient::Ndb_mgmclient(const char *host) +{ + m_cmd= new CommandInterpreter(host); +} +Ndb_mgmclient::~Ndb_mgmclient() +{ + delete m_cmd; +} +int Ndb_mgmclient::read_and_execute(int _try_reconnect) +{ + return m_cmd->readAndExecute(_try_reconnect); +} +int Ndb_mgmclient::execute(const char *_line, int _try_reconnect) +{ + return m_cmd->execute(_line,_try_reconnect); +} +int +Ndb_mgmclient::disconnect() +{ + return m_cmd->disconnect(); +} + + +/* + * The CommandInterpreter + */ #include #include @@ -33,7 +221,10 @@ #endif // HAVE_GLOBAL_REPLICATION #include "MgmtErrorReporter.hpp" -#include "CpcClient.hpp" +#include +#include +#include +#include /***************************************************************************** @@ -201,7 +392,7 @@ CommandInterpreter::~CommandInterpreter() host = NULL; } -bool +static bool emptyString(const char* s) { if (s == NULL) { @@ -265,17 +456,47 @@ CommandInterpreter::disconnect() int CommandInterpreter::readAndExecute(int _try_reconnect) +{ + static char *line_read = (char *)NULL; + + /* If the buffer has already been allocated, return the memory + to the free pool. */ + if (line_read) + { + free (line_read); + line_read = (char *)NULL; + } +#ifdef HAVE_READLINE + /* Get a line from the user. */ + line_read = readline ("ndb_mgm> "); + /* If the line has any text in it, save it on the history. */ + if (line_read && *line_read) + add_history (line_read); +#else + static char linebuffer[254]; + fputs("ndb_mgm> ", stdout); + linebuffer[sizeof(linebuffer)-1]=0; + line_read = fgets(linebuffer, sizeof(linebuffer)-1, stdin); + if (line_read == linebuffer) { + char *q=linebuffer; + while (*q > 31) q++; + *q=0; + line_read= strdup(linebuffer); + } +#endif + return execute(line_read,_try_reconnect); +} + +int +CommandInterpreter::execute(const char *_line, int _try_reconnect) { if (_try_reconnect >= 0) try_reconnect=_try_reconnect; - - char* _line = readline_gets(); char * line; if(_line == NULL) { // ndbout << endl; return false; } - line = my_strdup(_line,MYF(MY_WME)); My_auto_ptr ptr(line); @@ -349,10 +570,6 @@ CommandInterpreter::readAndExecute(int _try_reconnect) strcmp(firstToken, "BYE") == 0) && allAfterFirstToken == NULL){ return false; -#if 0 - } else if(strcmp(firstToken, "CPC") == 0) { - executeCpc(allAfterFirstToken); -#endif } else { /** * First token should be a digit, node ID @@ -1903,169 +2120,4 @@ CommandInterpreter::executeRep(char* parameters) } #endif // HAVE_GLOBAL_REPLICATION - -/***************************************************************************** - * CPC - *****************************************************************************/ - -#if 0 - -#if 0 -//#ifdef NDB_SOLARIS // XXX fix me -static char* strsep(char** x, const char* y) { return 0; } -#endif - -// Note this code has not been verified -#if 0 -static char * my_strsep(char **stringp, const char *delim) -{ - char *tmp= *stringp; - if (tmp == 0) - return 0; - *stringp = strtok(tmp, delim); - return tmp; -} -#endif - -void -CommandInterpreter::executeCpc(char *parameters) -{ - char *host_str = NULL, *port_str = NULL, *end; - long port = 1234; /* XXX */ - - while((host_str = my_strsep(¶meters, " \t:")) != NULL && - host_str[0] == '\0'); - - if(parameters && parameters[0] != '\0') { - while((port_str = my_strsep(¶meters, " \t:")) != NULL && - port_str[0] == '\0'); - - errno = 0; - port = strtol(port_str, &end, 0); - if(end[0] != '\0') - goto error; - if((port == LONG_MAX || port == LONG_MIN) && - errno == ERANGE) - goto error; - } - - { - SimpleCpcClient cpc(host_str, port); - bool done = false; - - if(cpc.connect() < 0) { - ndbout_c("Cannot connect to %s:%d.", cpc.getHost(), cpc.getPort()); - switch(errno) { - case ENOENT: - ndbout << ": " << "No such host" << endl; - break; - default: - ndbout << ": " << strerror(errno) << endl; - break; - } - return; - } - - while(!done) { - char *line = readline("CPC> "); - if(line != NULL) { - add_history(line); - - char *cmd = strtok(line, " "); - char *arg = strtok(NULL, ""); - - if(arg != NULL) { - while(arg[0] == ' ') - arg++; - if(strlen(arg) == 0) - arg = NULL; - } - - if(cmd != NULL) { - if(strcmp(cmd, "exit") == 0) - done = true; - else if(strcmp(cmd, "list") == 0) - cpc.cmd_list(arg); - else if(strcmp(cmd, "start") == 0) - cpc.cmd_start(arg); - else if(strcmp(cmd, "stop") == 0) - cpc.cmd_stop(arg); - else if(strcmp(cmd, "help") == 0) - cpc.cmd_help(arg); - } - } else { - done = true; - ndbout << endl; - } - } - } - return; - - error: - ndbout << "Error: expected a tcp port number, got '" << port_str << "'." - << endl; - return; -} -#endif - -#if 0 -static -void -CmdBackupCallback(const MgmtSrvr::BackupEvent & event){ - char str[255]; - - ndbout << endl; - - bool ok = false; - switch(event.Event){ - case MgmtSrvr::BackupEvent::BackupStarted: - ok = true; - BaseString::snprintf(str, sizeof(str), - "Backup %d started", event.Started.BackupId); - break; - case MgmtSrvr::BackupEvent::BackupFailedToStart: - ok = true; - BaseString::snprintf(str, sizeof(str), - "Backup failed to start (Error %d)", - event.FailedToStart.ErrorCode); - break; - case MgmtSrvr::BackupEvent::BackupCompleted: - ok = true; - BaseString::snprintf(str, sizeof(str), - "Backup %d completed", - event.Completed.BackupId); - ndbout << str << endl; - - BaseString::snprintf(str, sizeof(str), - " StartGCP: %d StopGCP: %d", - event.Completed.startGCP, event.Completed.stopGCP); - ndbout << str << endl; - - BaseString::snprintf(str, sizeof(str), - " #Records: %d #LogRecords: %d", - event.Completed.NoOfRecords, event.Completed.NoOfLogRecords); - ndbout << str << endl; - - BaseString::snprintf(str, sizeof(str), - " Data: %d bytes Log: %d bytes", - event.Completed.NoOfBytes, event.Completed.NoOfLogBytes); - break; - case MgmtSrvr::BackupEvent::BackupAborted: - ok = true; - BaseString::snprintf(str, sizeof(str), - "Backup %d has been aborted reason %d", - event.Aborted.BackupId, - event.Aborted.Reason); - break; - } - if(!ok){ - BaseString::snprintf(str, sizeof(str), - "Unknown backup event: %d", - event.Event); - - } - ndbout << str << endl; -} -#endif - template class Vector; diff --git a/ndb/src/mgmclient/CommandInterpreter.hpp b/ndb/src/mgmclient/CommandInterpreter.hpp deleted file mode 100644 index eecc48a739e..00000000000 --- a/ndb/src/mgmclient/CommandInterpreter.hpp +++ /dev/null @@ -1,197 +0,0 @@ -/* Copyright (C) 2003 MySQL AB - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - -#ifndef CommandInterpreter_H -#define CommandInterpreter_H - -//#define HAVE_GLOBAL_REPLICATION -//***************************************************************************** -// Author: Peter Lind -//***************************************************************************** - -#include -#include -#include - -#ifdef HAVE_GLOBAL_REPLICATION -#include "../rep/repapi/repapi.h" -#endif - -#include - -class MgmtSrvr; - -/** - * @class CommandInterpreter - * @brief Reads command line in management client - * - * This class has one public method which reads a command line - * from a stream. It then interpret that commmand line and calls a suitable - * method in the MgmtSrvr class which executes the command. - * - * For command syntax, see the HELP command. - */ -class CommandInterpreter { -public: - /** - * Constructor - * @param mgmtSrvr: Management server to use when executing commands - */ - CommandInterpreter(const char *); - ~CommandInterpreter(); - - /** - * Reads one line from the stream, parse the line to find - * a command and then calls a suitable method which executes - * the command. - * - * @return true until quit/bye/exit has been typed - */ - int readAndExecute(int _try_reconnect=-1); - -private: - /** - * Read a string, and return a pointer to it. - * - * @return NULL on EOF. - */ - char *readline_gets () - { - static char *line_read = (char *)NULL; - - /* If the buffer has already been allocated, return the memory - to the free pool. */ - if (line_read) - { - free (line_read); - line_read = (char *)NULL; - } - - /* Get a line from the user. */ - line_read = readline ("NDB> "); - - /* If the line has any text in it, save it on the history. */ - if (line_read && *line_read) - add_history (line_read); - - return (line_read); - } - - void printError(); - - /** - * Analyse the command line, after the first token. - * - * @param processId: DB process id to send command to or -1 if - * command will be sent to all DB processes. - * @param allAfterFirstToken: What the client gave after the - * first token on the command line - */ - void analyseAfterFirstToken(int processId, char* allAfterFirstTokenCstr); - - /** - * Parse the block specification part of the LOG* commands, - * things after LOG*: [BLOCK = {ALL|+}] - * - * @param allAfterLog: What the client gave after the second token - * (LOG*) on the command line - * @param blocks, OUT: ALL or name of all the blocks - * @return: true if correct syntax, otherwise false - */ - bool parseBlockSpecification(const char* allAfterLog, - Vector& blocks); - - /** - * A bunch of execute functions: Executes one of the commands - * - * @param processId: DB process id to send command to - * @param parameters: What the client gave after the command name - * on the command line. - * For example if complete input from user is: "1 LOGLEVEL 22" then the - * parameters argument is the string with everything after LOGLEVEL, in - * this case "22". Each function is responsible to check the parameters - * argument. - */ - void executeHelp(char* parameters); - void executeShow(char* parameters); - void executeShutdown(char* parameters); - void executeRun(char* parameters); - void executeInfo(char* parameters); - void executeClusterLog(char* parameters); - -public: - void executeStop(int processId, const char* parameters, bool all); - void executeEnterSingleUser(char* parameters); - void executeExitSingleUser(char* parameters); - void executeStart(int processId, const char* parameters, bool all); - void executeRestart(int processId, const char* parameters, bool all); - void executeLogLevel(int processId, const char* parameters, bool all); - void executeError(int processId, const char* parameters, bool all); - void executeTrace(int processId, const char* parameters, bool all); - void executeLog(int processId, const char* parameters, bool all); - void executeLogIn(int processId, const char* parameters, bool all); - void executeLogOut(int processId, const char* parameters, bool all); - void executeLogOff(int processId, const char* parameters, bool all); - void executeTestOn(int processId, const char* parameters, bool all); - void executeTestOff(int processId, const char* parameters, bool all); - void executeSet(int processId, const char* parameters, bool all); - void executeGetStat(int processId, const char* parameters, bool all); - void executeStatus(int processId, const char* parameters, bool all); - void executeEventReporting(int processId, const char* parameters, bool all); - void executeDumpState(int processId, const char* parameters, bool all); - void executeStartBackup(char * parameters); - void executeAbortBackup(char * parameters); - - void executeRep(char* parameters); - - void executeCpc(char * parameters); - -public: - bool connect(); - bool disconnect(); - - /** - * A execute function definition - */ -public: - typedef void (CommandInterpreter::* ExecuteFunction)(int processId, - const char * param, - bool all); - - struct CommandFunctionPair { - const char * command; - ExecuteFunction executeFunction; - }; -private: - /** - * - */ - void executeForAll(const char * cmd, - ExecuteFunction fun, - const char * param); - - NdbMgmHandle m_mgmsrv; - bool connected; - const char *host; - int try_reconnect; -#ifdef HAVE_GLOBAL_REPLICATION - NdbRepHandle m_repserver; - const char *rep_host; - bool rep_connected; -#endif -}; - -#endif // CommandInterpreter_H diff --git a/ndb/src/mgmclient/Makefile.am b/ndb/src/mgmclient/Makefile.am index e271c7bed53..e3f0b23a79a 100644 --- a/ndb/src/mgmclient/Makefile.am +++ b/ndb/src/mgmclient/Makefile.am @@ -1,18 +1,19 @@ ndbtools_PROGRAMS = ndb_mgm +noinst_LTLIBRARIES = libndbmgmclient.la -ndb_mgm_SOURCES = \ - main.cpp \ - CommandInterpreter.cpp \ - CpcClient.cpp +libndbmgmclient_la_SOURCES = CommandInterpreter.cpp + +ndb_mgm_SOURCES = main.cpp include $(top_srcdir)/ndb/config/common.mk.am include $(top_srcdir)/ndb/config/type_ndbapi.mk.am INCLUDES += -I$(top_srcdir)/ndb/include/mgmapi -I$(top_srcdir)/ndb/src/common/mgmcommon -LDADD_LOC = $(top_builddir)/ndb/src/libndbclient.la \ - $(top_builddir)/ndb/src/common/editline/libeditline.a \ +LDADD_LOC = $(top_builddir)/ndb/src/mgmclient/libndbmgmclient.la \ + @readline_link@ \ + $(top_builddir)/ndb/src/libndbclient.la \ $(top_builddir)/dbug/libdbug.a \ $(top_builddir)/mysys/libmysys.a \ $(top_builddir)/strings/libmystrings.a \ diff --git a/ndb/src/mgmclient/Makefile_old b/ndb/src/mgmclient/Makefile_old deleted file mode 100644 index d1b2d60a52a..00000000000 --- a/ndb/src/mgmclient/Makefile_old +++ /dev/null @@ -1,25 +0,0 @@ -include .defs.mk - -TYPE := ndbapi - -BIN_TARGET := mgmtclient -BIN_TARGET_LIBS := -BIN_TARGET_ARCHIVES := trace logger mgmapi general mgmsrvcommon portlib repapi - -BIN_TARGET_ARCHIVES += editline - -DIRS = test_cpcd - -# Source files of non-templated classes (.cpp files) -SOURCES = \ - main.cpp \ - CommandInterpreter.cpp \ - CpcClient.cpp - -CCFLAGS_LOC += -I$(call fixpath,$(NDB_TOP)/include/mgmapi) \ - -I$(call fixpath,$(NDB_TOP)/src/common/mgmcommon) - -include $(NDB_TOP)/Epilogue.mk - -_bins_mkconfig : $(NDB_TOP)/bin/$(BIN_TARGET) - diff --git a/ndb/src/mgmclient/main.cpp b/ndb/src/mgmclient/main.cpp index a37214d366b..3415ede1985 100644 --- a/ndb/src/mgmclient/main.cpp +++ b/ndb/src/mgmclient/main.cpp @@ -23,12 +23,12 @@ #include #include -#include "CommandInterpreter.hpp" +#include "ndb_mgmclient.hpp" const char *progname = "ndb_mgm"; -static CommandInterpreter* com; +static Ndb_mgmclient* com; extern "C" void @@ -127,8 +127,8 @@ int main(int argc, char** argv){ signal(SIGPIPE, handler); - com = new CommandInterpreter(buf); - while(com->readAndExecute(_try_reconnect)); + com = new Ndb_mgmclient(buf); + while(com->read_and_execute(_try_reconnect)); delete com; return 0; diff --git a/ndb/src/common/editline/editline_win32.c b/ndb/src/mgmclient/ndb_mgmclient.hpp similarity index 68% rename from ndb/src/common/editline/editline_win32.c rename to ndb/src/mgmclient/ndb_mgmclient.hpp index 5083edb7fae..2f021a0f2b6 100644 --- a/ndb/src/common/editline/editline_win32.c +++ b/ndb/src/mgmclient/ndb_mgmclient.hpp @@ -14,19 +14,20 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#ifndef Ndb_mgmclient_h +#define Ndb_mgmclient_h -#include - - -char* readline(const char* prompt) +class CommandInterpreter; +class Ndb_mgmclient { - char* szBuf; - printf(prompt); - szBuf = (char*)malloc(256); - return gets(szBuf); -} - -void add_history(char* pch) -{ -} +public: + Ndb_mgmclient(const char*); + ~Ndb_mgmclient(); + int read_and_execute(int _try_reconnect=-1); + int execute(const char *_line, int _try_reconnect=-1); + int disconnect(); +private: + CommandInterpreter *m_cmd; +}; +#endif // Ndb_mgmclient_h diff --git a/ndb/src/mgmsrv/CommandInterpreter.hpp b/ndb/src/mgmsrv/CommandInterpreter.hpp index 3466ee76226..db23f76a5bd 100644 --- a/ndb/src/mgmsrv/CommandInterpreter.hpp +++ b/ndb/src/mgmsrv/CommandInterpreter.hpp @@ -23,7 +23,6 @@ #include #include -#include #include class MgmtSrvr; @@ -63,26 +62,27 @@ private: */ char *readline_gets () { + static char linebuffer[254]; static char *line_read = (char *)NULL; - // Disable the default file-name completion action of TAB - // rl_bind_key ('\t', rl_insert); - /* If the buffer has already been allocated, return the memory to the free pool. */ if (line_read) - { - free (line_read); - line_read = (char *)NULL; - } + { + free (line_read); + line_read = (char *)NULL; + } /* Get a line from the user. */ - line_read = readline ("NDB> "); - - /* If the line has any text in it, save it on the history. */ - if (line_read && *line_read) - add_history (line_read); - + fputs("ndb_mgmd> ", stdout); + linebuffer[sizeof(linebuffer)-1]=0; + line_read = fgets(linebuffer, sizeof(linebuffer)-1, stdin); + if (line_read == linebuffer) { + char *q=linebuffer; + while (*q > 31) q++; + *q=0; + line_read= strdup(linebuffer); + } return (line_read); } diff --git a/ndb/src/mgmsrv/Makefile.am b/ndb/src/mgmsrv/Makefile.am index 3b57b027827..4cb164d48fe 100644 --- a/ndb/src/mgmsrv/Makefile.am +++ b/ndb/src/mgmsrv/Makefile.am @@ -24,7 +24,6 @@ INCLUDES_LOC = -I$(top_srcdir)/ndb/src/ndbapi \ -I$(top_srcdir)/ndb/src/common/mgmcommon LDADD_LOC = $(top_builddir)/ndb/src/libndbclient.la \ - $(top_builddir)/ndb/src/common/editline/libeditline.a \ $(top_builddir)/dbug/libdbug.a \ $(top_builddir)/mysys/libmysys.a \ $(top_builddir)/strings/libmystrings.a @NDB_SCI_LIBS@ diff --git a/ndb/src/mgmclient/CpcClient.hpp b/ndb/test/include/CpcClient.hpp similarity index 100% rename from ndb/src/mgmclient/CpcClient.hpp rename to ndb/test/include/CpcClient.hpp diff --git a/ndb/test/run-test/Makefile.am b/ndb/test/run-test/Makefile.am index 1eac96e7ac7..c890536dcc6 100644 --- a/ndb/test/run-test/Makefile.am +++ b/ndb/test/run-test/Makefile.am @@ -11,9 +11,8 @@ test_SCRIPTS=atrt-analyze-result.sh atrt-gather-result.sh atrt-setup.sh \ atrt-clear-result.sh make-config.sh make-index.sh make-html-reports.sh atrt_SOURCES = main.cpp -INCLUDES_LOC = -I$(top_srcdir)/ndb/test/include -I$(top_srcdir)/ndb/src/mgmclient -LDADD_LOC = $(top_builddir)/ndb/src/mgmclient/CpcClient.o \ - $(top_builddir)/ndb/test/src/libNDBT.a \ +INCLUDES_LOC = -I$(top_srcdir)/ndb/test/include +LDADD_LOC = $(top_builddir)/ndb/test/src/libNDBT.a \ $(top_builddir)/ndb/src/libndbclient.la \ $(top_builddir)/dbug/libdbug.a \ $(top_builddir)/mysys/libmysys.a \ diff --git a/ndb/src/mgmclient/CpcClient.cpp b/ndb/test/src/CpcClient.cpp similarity index 100% rename from ndb/src/mgmclient/CpcClient.cpp rename to ndb/test/src/CpcClient.cpp diff --git a/ndb/test/src/Makefile.am b/ndb/test/src/Makefile.am index a8f34a0ea22..56f3d6a1ec6 100644 --- a/ndb/test/src/Makefile.am +++ b/ndb/test/src/Makefile.am @@ -9,7 +9,8 @@ libNDBT_a_SOURCES = \ HugoAsynchTransactions.cpp UtilTransactions.cpp \ NdbRestarter.cpp NdbRestarts.cpp NDBT_Output.cpp \ NdbBackup.cpp NdbConfig.cpp NdbGrep.cpp NDBT_Table.cpp \ - NdbSchemaCon.cpp NdbSchemaOp.cpp getarg.c + NdbSchemaCon.cpp NdbSchemaOp.cpp getarg.c \ + CpcClient.cpp INCLUDES_LOC = -I$(top_srcdir)/ndb/src/common/mgmcommon -I$(top_srcdir)/ndb/include/mgmcommon -I$(top_srcdir)/ndb/include/kernel -I$(top_srcdir)/ndb/src/mgmapi diff --git a/ndb/test/tools/Makefile.am b/ndb/test/tools/Makefile.am index 8d94c21b721..3255267b636 100644 --- a/ndb/test/tools/Makefile.am +++ b/ndb/test/tools/Makefile.am @@ -20,12 +20,10 @@ copy_tab_SOURCES = copy_tab.cpp create_index_SOURCES = create_index.cpp ndb_cpcc_SOURCES = cpcc.cpp -INCLUDES_LOC = -I$(top_srcdir)/ndb/src/mgmclient - include $(top_srcdir)/ndb/config/common.mk.am include $(top_srcdir)/ndb/config/type_ndbapitest.mk.am -ndb_cpcc_LDADD = $(LDADD) $(top_builddir)/ndb/src/mgmclient/CpcClient.o +ndb_cpcc_LDADD = $(LDADD) # Don't update the files from bitkeeper %::SCCS/s.% From 06cf873d8f14b6963e2cccf5ca4a214caeb94977 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 8 Nov 2004 14:23:14 +0400 Subject: [PATCH 0138/1063] alter_table.result, alter_table.test, field_conv.cc: Bug #6479 ALTER TABLE ... changing charset fails for TEXT columns Fix: use do_conv_blob rather than do_copy_blob if the column's character sets are different. sql/field_conv.cc: Bug #6479 ALTER TABLE ... changing charset fails for TEXT columns Fix: use do_conv_blob rather than do_copy_blob if the column's character sets are different. mysql-test/t/alter_table.test: Bug #6479 ALTER TABLE ... changing charset fails for TEXT columns Fix: use do_conv_blob rather than do_copy_blob if the column's character sets are different. mysql-test/r/alter_table.result: Bug #6479 ALTER TABLE ... changing charset fails for TEXT columns Fix: use do_conv_blob rather than do_copy_blob if the column's character sets are different. --- mysql-test/r/alter_table.result | 10 ++++++++++ mysql-test/t/alter_table.test | 12 ++++++++++++ sql/field_conv.cc | 2 ++ 3 files changed, 24 insertions(+) diff --git a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result index 89b8bd66848..9e14ca85a29 100644 --- a/mysql-test/r/alter_table.result +++ b/mysql-test/r/alter_table.result @@ -483,3 +483,13 @@ ERROR 42000: Incorrect table name 't1\\' rename table t1 to `t1\\`; ERROR 42000: Incorrect table name 't1\\' drop table t1; +create table t1 (a text) character set koi8r; +insert into t1 values (_koi8r'ÔÅÓÔ'); +select hex(a) from t1; +hex(a) +D4C5D3D4 +alter table t1 convert to character set cp1251; +select hex(a) from t1; +hex(a) +F2E5F1F2 +drop table t1; diff --git a/mysql-test/t/alter_table.test b/mysql-test/t/alter_table.test index e46027ae8d9..66a4adc90fe 100644 --- a/mysql-test/t/alter_table.test +++ b/mysql-test/t/alter_table.test @@ -324,3 +324,15 @@ alter table t1 rename to `t1\\`; rename table t1 to `t1\\`; drop table t1; +# +# Bug #6479 ALTER TABLE ... changing charset fails for TEXT columns +# +# The column's character set was changed but the actual data was not +# modified. In other words, the values were reinterpreted +# as UTF8 instead of being converted. +create table t1 (a text) character set koi8r; +insert into t1 values (_koi8r'ÔÅÓÔ'); +select hex(a) from t1; +alter table t1 convert to character set cp1251; +select hex(a) from t1; +drop table t1; diff --git a/sql/field_conv.cc b/sql/field_conv.cc index 890687fc925..8a36fcd153c 100644 --- a/sql/field_conv.cc +++ b/sql/field_conv.cc @@ -475,6 +475,8 @@ void (*Copy_field::get_copy_func(Field *to,Field *from))(Copy_field*) { if (!(from->flags & BLOB_FLAG)) return do_conv_blob; + if (from->charset() != to->charset()) + return do_conv_blob; if (from_length != to_length || to->table->db_low_byte_first != from->table->db_low_byte_first) { From d03f2330aa5dfb3116696b5b2c74fc654e7fa1e7 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 8 Nov 2004 10:35:23 +0000 Subject: [PATCH 0139/1063] Makefile.am: changed make order .del-Makefile_old~dde91b00b37d2a06: Delete: ndb/tools/Makefile_old .del-Makefile_old~70d769657921a760: Delete: ndb/test/tools/Makefile_old .del-Makefile_old~58f0559822147dd9: Delete: ndb/test/tools/old_dirs/waiter/Makefile_old .del-Makefile_old~4fdb3c92ebd2eb29: Delete: ndb/test/run-test/Makefile_old .del-Makefile_old~1497f81a0c2125e: Delete: ndb/test/src/Makefile_old .del-Makefile_old~fbd3934fabdfe550: Delete: ndb/test/ndbapi/Makefile_old .del-Makefile_old~ec8e48326d4aa09: Delete: ndb/test/ndbapi/old_dirs/flexBench/Makefile_old .del-Makefile_old~1046c9ce93ef1fb8: Delete: ndb/test/ndbapi/bank/Makefile_old .del-Makefile_old~7c98d8f1d275983f: Delete: ndb/src/ndbapi/Makefile_old .del-Makefile_old~4463cf06fc2fceb9: Delete: ndb/src/mgmapi/Makefile_old .del-Makefile_old~274925c960801993: Delete: ndb/src/mgmsrv/Makefile_old .del-Makefile_old~b3d33fdde8bc12c0: Delete: ndb/src/kernel/Makefile_old .del-Makefile_old~6dbe2defc7237d4d: Delete: ndb/src/kernel/vm/Makefile_old .del-Makefile_old~cf05571c99011360: Delete: ndb/src/kernel/error/Makefile_old .del-Makefile_old~29a955a7e17d650e: Delete: ndb/src/kernel/blocks/Makefile_old .del-Makefile_old~f8b2a47eb434d43: Delete: ndb/src/kernel/blocks/suma/Makefile_old .del-Makefile_old~f0c05bb23d5c23ca: Delete: ndb/src/kernel/blocks/grep/Makefile_old .del-Makefile_old~a6fd2e579249f6e0: Delete: ndb/src/kernel/blocks/ndbcntr/Makefile_old .del-Makefile_old~7e8d8b4e2b1fa8f7: Delete: ndb/src/kernel/blocks/ndbfs/Makefile_old .del-Makefile_old~73c174fc712803c5: Delete: ndb/src/kernel/blocks/qmgr/Makefile_old .del-Makefile_old~16de31311951fc04: Delete: ndb/src/kernel/blocks/trix/Makefile_old .del-Makefile_old~788c80e5e758ac7: Delete: ndb/src/kernel/blocks/dbutil/Makefile_old .del-Makefile_old~5ebf2b4f85ab09cf: Delete: ndb/src/kernel/blocks/dbtux/Makefile_old .del-Makefile_old~530f9e0bc038a62: Delete: ndb/src/kernel/blocks/dbtup/Makefile_old .del-Makefile_old~315b927180484020: Delete: ndb/src/kernel/blocks/dbtc/Makefile_old .del-Makefile_old~d013a228cad86ba0: Delete: ndb/src/kernel/blocks/dbacc/Makefile_old .del-Makefile_old~c2e33f043b8aa45e: Delete: ndb/src/kernel/blocks/cmvmi/Makefile_old .del-Makefile_old~bdf406f5fb4696cb: Delete: ndb/src/kernel/blocks/dblqh/Makefile_old .del-Makefile_old~38a24016d2ad8aa7: Delete: ndb/src/kernel/blocks/dbdict/Makefile_old .del-Makefile_old~2804044250a6fd91: Delete: ndb/src/kernel/blocks/dbdih/Makefile_old .del-Makefile_old~e58eec87cd8dc79e: Delete: ndb/src/cw/Makefile_old .del-Makefile_old~b50c85b8eb69aacb: Delete: ndb/src/kernel/blocks/backup/Makefile_old .del-Makefile_old~16e186623106985e: Delete: ndb/src/cw/cpcd/Makefile_old .del-Makefile_old~f03f74238d640d5: Delete: ndb/src/common/mgmcommon/Makefile_old .del-Makefile_old~a8e9765b520b7c68: Delete: ndb/src/common/util/Makefile_old .del-Makefile_old~9f275aed83c8652b: Delete: ndb/src/common/transporter/Makefile_old .del-Makefile_old~8d901a664eca1ec: Delete: ndb/src/common/portlib/Makefile_old .del-Makefile_old~19643559613c75c7: Delete: ndb/src/common/portlib/old_dirs/unix/Makefile_old .del-Makefile_old~a3f6fc0e1411bb28: Delete: ndb/src/common/logger/Makefile_old .del-Makefile_old~754f27fab7d4da3b: Delete: ndb/src/common/debugger/signaldata/Makefile_old .del-Makefile_old~54ca8df95719e59f: Delete: ndb/src/common/debugger/Makefile_old BitKeeper/deleted/.del-Makefile_old~54ca8df95719e59f: Delete: ndb/src/common/debugger/Makefile_old BitKeeper/deleted/.del-Makefile_old~754f27fab7d4da3b: Delete: ndb/src/common/debugger/signaldata/Makefile_old BitKeeper/deleted/.del-Makefile_old~a3f6fc0e1411bb28: Delete: ndb/src/common/logger/Makefile_old BitKeeper/deleted/.del-Makefile_old~19643559613c75c7: Delete: ndb/src/common/portlib/old_dirs/unix/Makefile_old BitKeeper/deleted/.del-Makefile_old~8d901a664eca1ec: Delete: ndb/src/common/portlib/Makefile_old BitKeeper/deleted/.del-Makefile_old~9f275aed83c8652b: Delete: ndb/src/common/transporter/Makefile_old BitKeeper/deleted/.del-Makefile_old~a8e9765b520b7c68: Delete: ndb/src/common/util/Makefile_old BitKeeper/deleted/.del-Makefile_old~f03f74238d640d5: Delete: ndb/src/common/mgmcommon/Makefile_old BitKeeper/deleted/.del-Makefile_old~16e186623106985e: Delete: ndb/src/cw/cpcd/Makefile_old BitKeeper/deleted/.del-Makefile_old~b50c85b8eb69aacb: Delete: ndb/src/kernel/blocks/backup/Makefile_old BitKeeper/deleted/.del-Makefile_old~e58eec87cd8dc79e: Delete: ndb/src/cw/Makefile_old BitKeeper/deleted/.del-Makefile_old~2804044250a6fd91: Delete: ndb/src/kernel/blocks/dbdih/Makefile_old BitKeeper/deleted/.del-Makefile_old~38a24016d2ad8aa7: Delete: ndb/src/kernel/blocks/dbdict/Makefile_old BitKeeper/deleted/.del-Makefile_old~bdf406f5fb4696cb: Delete: ndb/src/kernel/blocks/dblqh/Makefile_old BitKeeper/deleted/.del-Makefile_old~c2e33f043b8aa45e: Delete: ndb/src/kernel/blocks/cmvmi/Makefile_old BitKeeper/deleted/.del-Makefile_old~d013a228cad86ba0: Delete: ndb/src/kernel/blocks/dbacc/Makefile_old BitKeeper/deleted/.del-Makefile_old~315b927180484020: Delete: ndb/src/kernel/blocks/dbtc/Makefile_old BitKeeper/deleted/.del-Makefile_old~530f9e0bc038a62: Delete: ndb/src/kernel/blocks/dbtup/Makefile_old BitKeeper/deleted/.del-Makefile_old~5ebf2b4f85ab09cf: Delete: ndb/src/kernel/blocks/dbtux/Makefile_old BitKeeper/deleted/.del-Makefile_old~788c80e5e758ac7: Delete: ndb/src/kernel/blocks/dbutil/Makefile_old BitKeeper/deleted/.del-Makefile_old~16de31311951fc04: Delete: ndb/src/kernel/blocks/trix/Makefile_old BitKeeper/deleted/.del-Makefile_old~73c174fc712803c5: Delete: ndb/src/kernel/blocks/qmgr/Makefile_old BitKeeper/deleted/.del-Makefile_old~7e8d8b4e2b1fa8f7: Delete: ndb/src/kernel/blocks/ndbfs/Makefile_old BitKeeper/deleted/.del-Makefile_old~a6fd2e579249f6e0: Delete: ndb/src/kernel/blocks/ndbcntr/Makefile_old BitKeeper/deleted/.del-Makefile_old~f0c05bb23d5c23ca: Delete: ndb/src/kernel/blocks/grep/Makefile_old BitKeeper/deleted/.del-Makefile_old~f8b2a47eb434d43: Delete: ndb/src/kernel/blocks/suma/Makefile_old BitKeeper/deleted/.del-Makefile_old~29a955a7e17d650e: Delete: ndb/src/kernel/blocks/Makefile_old BitKeeper/deleted/.del-Makefile_old~cf05571c99011360: Delete: ndb/src/kernel/error/Makefile_old BitKeeper/deleted/.del-Makefile_old~6dbe2defc7237d4d: Delete: ndb/src/kernel/vm/Makefile_old BitKeeper/deleted/.del-Makefile_old~b3d33fdde8bc12c0: Delete: ndb/src/kernel/Makefile_old BitKeeper/deleted/.del-Makefile_old~274925c960801993: Delete: ndb/src/mgmsrv/Makefile_old BitKeeper/deleted/.del-Makefile_old~4463cf06fc2fceb9: Delete: ndb/src/mgmapi/Makefile_old BitKeeper/deleted/.del-Makefile_old~7c98d8f1d275983f: Delete: ndb/src/ndbapi/Makefile_old BitKeeper/deleted/.del-Makefile_old~1046c9ce93ef1fb8: Delete: ndb/test/ndbapi/bank/Makefile_old BitKeeper/deleted/.del-Makefile_old~ec8e48326d4aa09: Delete: ndb/test/ndbapi/old_dirs/flexBench/Makefile_old BitKeeper/deleted/.del-Makefile_old~fbd3934fabdfe550: Delete: ndb/test/ndbapi/Makefile_old BitKeeper/deleted/.del-Makefile_old~1497f81a0c2125e: Delete: ndb/test/src/Makefile_old BitKeeper/deleted/.del-Makefile_old~4fdb3c92ebd2eb29: Delete: ndb/test/run-test/Makefile_old BitKeeper/deleted/.del-Makefile_old~58f0559822147dd9: Delete: ndb/test/tools/old_dirs/waiter/Makefile_old BitKeeper/deleted/.del-Makefile_old~70d769657921a760: Delete: ndb/test/tools/Makefile_old BitKeeper/deleted/.del-Makefile_old~dde91b00b37d2a06: Delete: ndb/tools/Makefile_old ndb/src/mgmclient/Makefile.am: changed make order --- ndb/src/common/debugger/Makefile_old | 11 ---- .../common/debugger/signaldata/Makefile_old | 33 ---------- ndb/src/common/logger/Makefile_old | 27 --------- ndb/src/common/mgmcommon/Makefile_old | 29 --------- ndb/src/common/portlib/Makefile_old | 21 ------- .../common/portlib/old_dirs/unix/Makefile_old | 27 --------- ndb/src/common/transporter/Makefile_old | 43 ------------- ndb/src/common/util/Makefile_old | 28 --------- ndb/src/cw/Makefile_old | 6 -- ndb/src/cw/cpcd/Makefile_old | 11 ---- ndb/src/kernel/Makefile_old | 5 -- ndb/src/kernel/blocks/Makefile_old | 28 --------- ndb/src/kernel/blocks/backup/Makefile_old | 18 ------ ndb/src/kernel/blocks/cmvmi/Makefile_old | 9 --- ndb/src/kernel/blocks/dbacc/Makefile_old | 11 ---- ndb/src/kernel/blocks/dbdict/Makefile_old | 12 ---- ndb/src/kernel/blocks/dbdih/Makefile_old | 13 ---- ndb/src/kernel/blocks/dblqh/Makefile_old | 12 ---- ndb/src/kernel/blocks/dbtc/Makefile_old | 11 ---- ndb/src/kernel/blocks/dbtup/Makefile_old | 26 -------- ndb/src/kernel/blocks/dbtux/Makefile_old | 17 ------ ndb/src/kernel/blocks/dbutil/Makefile_old | 8 --- ndb/src/kernel/blocks/grep/Makefile_old | 9 --- ndb/src/kernel/blocks/ndbcntr/Makefile_old | 12 ---- ndb/src/kernel/blocks/ndbfs/Makefile_old | 14 ----- ndb/src/kernel/blocks/qmgr/Makefile_old | 11 ---- ndb/src/kernel/blocks/suma/Makefile_old | 10 ---- ndb/src/kernel/blocks/trix/Makefile_old | 8 --- ndb/src/kernel/error/Makefile_old | 12 ---- ndb/src/kernel/vm/Makefile_old | 30 ---------- ndb/src/mgmapi/Makefile_old | 27 --------- ndb/src/mgmclient/Makefile.am | 2 +- ndb/src/mgmsrv/Makefile_old | 41 ------------- ndb/src/ndbapi/Makefile_old | 60 ------------------- ndb/test/ndbapi/Makefile_old | 49 --------------- ndb/test/ndbapi/bank/Makefile_old | 12 ---- .../ndbapi/old_dirs/flexBench/Makefile_old | 11 ---- ndb/test/run-test/Makefile_old | 22 ------- ndb/test/src/Makefile_old | 33 ---------- ndb/test/tools/Makefile_old | 9 --- ndb/test/tools/old_dirs/waiter/Makefile_old | 11 ---- ndb/tools/Makefile_old | 12 ---- 42 files changed, 1 insertion(+), 800 deletions(-) delete mode 100644 ndb/src/common/debugger/Makefile_old delete mode 100644 ndb/src/common/debugger/signaldata/Makefile_old delete mode 100644 ndb/src/common/logger/Makefile_old delete mode 100644 ndb/src/common/mgmcommon/Makefile_old delete mode 100644 ndb/src/common/portlib/Makefile_old delete mode 100644 ndb/src/common/portlib/old_dirs/unix/Makefile_old delete mode 100644 ndb/src/common/transporter/Makefile_old delete mode 100644 ndb/src/common/util/Makefile_old delete mode 100644 ndb/src/cw/Makefile_old delete mode 100644 ndb/src/cw/cpcd/Makefile_old delete mode 100644 ndb/src/kernel/Makefile_old delete mode 100644 ndb/src/kernel/blocks/Makefile_old delete mode 100644 ndb/src/kernel/blocks/backup/Makefile_old delete mode 100644 ndb/src/kernel/blocks/cmvmi/Makefile_old delete mode 100644 ndb/src/kernel/blocks/dbacc/Makefile_old delete mode 100644 ndb/src/kernel/blocks/dbdict/Makefile_old delete mode 100644 ndb/src/kernel/blocks/dbdih/Makefile_old delete mode 100644 ndb/src/kernel/blocks/dblqh/Makefile_old delete mode 100644 ndb/src/kernel/blocks/dbtc/Makefile_old delete mode 100644 ndb/src/kernel/blocks/dbtup/Makefile_old delete mode 100644 ndb/src/kernel/blocks/dbtux/Makefile_old delete mode 100644 ndb/src/kernel/blocks/dbutil/Makefile_old delete mode 100644 ndb/src/kernel/blocks/grep/Makefile_old delete mode 100644 ndb/src/kernel/blocks/ndbcntr/Makefile_old delete mode 100644 ndb/src/kernel/blocks/ndbfs/Makefile_old delete mode 100644 ndb/src/kernel/blocks/qmgr/Makefile_old delete mode 100644 ndb/src/kernel/blocks/suma/Makefile_old delete mode 100644 ndb/src/kernel/blocks/trix/Makefile_old delete mode 100644 ndb/src/kernel/error/Makefile_old delete mode 100644 ndb/src/kernel/vm/Makefile_old delete mode 100644 ndb/src/mgmapi/Makefile_old delete mode 100644 ndb/src/mgmsrv/Makefile_old delete mode 100644 ndb/src/ndbapi/Makefile_old delete mode 100644 ndb/test/ndbapi/Makefile_old delete mode 100644 ndb/test/ndbapi/bank/Makefile_old delete mode 100644 ndb/test/ndbapi/old_dirs/flexBench/Makefile_old delete mode 100644 ndb/test/run-test/Makefile_old delete mode 100644 ndb/test/src/Makefile_old delete mode 100644 ndb/test/tools/Makefile_old delete mode 100644 ndb/test/tools/old_dirs/waiter/Makefile_old delete mode 100644 ndb/tools/Makefile_old diff --git a/ndb/src/common/debugger/Makefile_old b/ndb/src/common/debugger/Makefile_old deleted file mode 100644 index ac3a4475a54..00000000000 --- a/ndb/src/common/debugger/Makefile_old +++ /dev/null @@ -1,11 +0,0 @@ -include .defs.mk - -TYPE := kernel -DIRS := signaldata - -PIC_ARCHIVE := Y -ARCHIVE_TARGET := trace - -SOURCES = SignalLoggerManager.cpp DebuggerNames.cpp BlockNames.cpp LogLevel.cpp EventLogger.cpp GrepError.cpp - -include $(NDB_TOP)/Epilogue.mk diff --git a/ndb/src/common/debugger/signaldata/Makefile_old b/ndb/src/common/debugger/signaldata/Makefile_old deleted file mode 100644 index bd00667b482..00000000000 --- a/ndb/src/common/debugger/signaldata/Makefile_old +++ /dev/null @@ -1,33 +0,0 @@ -include .defs.mk - -TYPE := ndbapi - -PIC_ARCHIVE := Y -ARCHIVE_TARGET := signaldataprint - -SOURCES = TcKeyReq.cpp TcKeyConf.cpp TcKeyRef.cpp \ - TcRollbackRep.cpp \ - TupKey.cpp TupCommit.cpp LqhKey.cpp \ - FsOpenReq.cpp FsCloseReq.cpp FsRef.cpp FsConf.cpp FsReadWriteReq.cpp\ - SignalDataPrint.cpp SignalNames.cpp \ - ContinueB.cpp DihContinueB.cpp NdbfsContinueB.cpp \ - CloseComReqConf.cpp PackedSignal.cpp PrepFailReqRef.cpp \ - GCPSave.cpp DictTabInfo.cpp \ - AlterTable.cpp AlterTab.cpp \ - CreateTrig.cpp AlterTrig.cpp DropTrig.cpp \ - FireTrigOrd.cpp TrigAttrInfo.cpp \ - CreateIndx.cpp AlterIndx.cpp DropIndx.cpp TcIndx.cpp \ - IndxKeyInfo.cpp IndxAttrInfo.cpp \ - FsAppendReq.cpp ScanTab.cpp \ - BackupImpl.cpp BackupSignalData.cpp \ - UtilSequence.cpp UtilPrepare.cpp UtilDelete.cpp UtilExecute.cpp \ - LqhFrag.cpp DropTab.cpp PrepDropTab.cpp LCP.cpp MasterLCP.cpp \ - CopyGCI.cpp SystemError.cpp StartRec.cpp NFCompleteRep.cpp \ - FailRep.cpp DisconnectRep.cpp SignalDroppedRep.cpp \ - SumaImpl.cpp NdbSttor.cpp CreateFragmentation.cpp \ - CntrStart.cpp ReadNodesConf.cpp \ - UtilLock.cpp TuxMaint.cpp TupAccess.cpp AccLock.cpp \ - LqhTrans.cpp - -include $(NDB_TOP)/Epilogue.mk - diff --git a/ndb/src/common/logger/Makefile_old b/ndb/src/common/logger/Makefile_old deleted file mode 100644 index 994eb86ba35..00000000000 --- a/ndb/src/common/logger/Makefile_old +++ /dev/null @@ -1,27 +0,0 @@ -include .defs.mk - -TYPE := ndbapi - -PIC_ARCHIVE := Y -ARCHIVE_TARGET := logger - -DIRS := loggertest - -SOURCES := Logger.cpp LogHandlerList.cpp LogHandler.cpp \ - ConsoleLogHandler.cpp FileLogHandler.cpp - -ifeq ($(NDB_OS), OSE) -NO_SYSLOG := Y -endif - -ifeq ($(NDB_OS), WIN32) -NO_SYSLOG := Y -endif - -ifneq ($(NO_SYSLOG), Y) -SOURCES += SysLogHandler.cpp -endif - -include $(NDB_TOP)/Epilogue.mk - - diff --git a/ndb/src/common/mgmcommon/Makefile_old b/ndb/src/common/mgmcommon/Makefile_old deleted file mode 100644 index c7bfda7e3bf..00000000000 --- a/ndb/src/common/mgmcommon/Makefile_old +++ /dev/null @@ -1,29 +0,0 @@ -include .defs.mk - -TYPE := ndbapi mgmapiclient - -PIC_ARCHIVE := Y -ARCHIVE_TARGET := mgmsrvcommon - -# Removed temporary -DIRS := printConfig - -SOURCES = \ - LocalConfig.cpp \ - Config.cpp \ - ConfigInfo.cpp \ - ConfigRetriever.cpp \ - InitConfigFileParser.cpp \ - IPCConfig.cpp - -SOURCES.c = NdbConfig.c - -CFLAGS_IPCConfig.cpp := -I$(call fixpath,$(NDB_TOP)/src/mgmapi) - -include $(NDB_TOP)/Epilogue.mk - - - - - - diff --git a/ndb/src/common/portlib/Makefile_old b/ndb/src/common/portlib/Makefile_old deleted file mode 100644 index 48f4929a839..00000000000 --- a/ndb/src/common/portlib/Makefile_old +++ /dev/null @@ -1,21 +0,0 @@ -include .defs.mk - -DIRS := - -ifeq ($(NDB_OS), SOFTOSE) -DIRS += ose -else -ifeq ($(NDB_OS), OSE) -DIRS += ose -else -ifeq ($(NDB_OS), WIN32) -DIRS += win32 -else -DIRS += unix -endif -endif -endif - - -include $(NDB_TOP)/Epilogue.mk - diff --git a/ndb/src/common/portlib/old_dirs/unix/Makefile_old b/ndb/src/common/portlib/old_dirs/unix/Makefile_old deleted file mode 100644 index 452196d9f08..00000000000 --- a/ndb/src/common/portlib/old_dirs/unix/Makefile_old +++ /dev/null @@ -1,27 +0,0 @@ -include .defs.mk - -TYPE := util - -PIC_ARCHIVE := Y -ARCHIVE_TARGET := portlib - -SOURCES.c = NdbCondition.c \ - NdbMutex.c \ - NdbSleep.c \ - NdbTick.c \ - NdbEnv.c \ - NdbThread.c \ - NdbHost.c \ - NdbTCP.c \ - NdbDaemon.c - -ifeq ($(NDB_OS), SOFTOSE) - SOURCES += NdbMem_SoftOse.cpp -else - SOURCES.c += NdbMem.c -endif - -include $(NDB_TOP)/Epilogue.mk - -testNdbDaemon: NdbDaemon.c - $(CC) -o $@ NdbDaemon.c $(CCFLAGS) -DNDB_DAEMON_TEST -L$(NDB_TOP)/lib diff --git a/ndb/src/common/transporter/Makefile_old b/ndb/src/common/transporter/Makefile_old deleted file mode 100644 index 372bf640566..00000000000 --- a/ndb/src/common/transporter/Makefile_old +++ /dev/null @@ -1,43 +0,0 @@ -include .defs.mk - -TYPE := util - -PIC_ARCHIVE := Y -ARCHIVE_TARGET := transporter -DIRS := basictest perftest - -# Source files of non-templated classes (.cpp files) -SOURCES = \ - Transporter.cpp \ - SendBuffer.cpp \ - TCP_Transporter.cpp \ - TransporterRegistry.cpp \ - Packer.cpp - -DIRS := basictest perftest - -CCFLAGS_LOC += -I$(call fixpath,$(NDB_TOP)/include/kernel) \ - -I$(call fixpath,$(NDB_TOP)/include/transporter) - - -ifeq ($(NDB_SHM), Y) -SOURCES += SHM_Transporter.cpp -ifeq ($(NDB_OS), WIN32) -SOURCES += SHM_Transporter.win32.cpp -else -SOURCES += SHM_Transporter.unix.cpp -endif -endif - -ifeq ($(NDB_SCI), Y) -SOURCES += SCI_Transporter.cpp -endif - -ifneq ($(findstring OSE, $(NDB_OS)),) - SOURCES += OSE_Transporter.cpp - SOURCES += OSE_Receiver.cpp -endif - - - -include $(NDB_TOP)/Epilogue.mk diff --git a/ndb/src/common/util/Makefile_old b/ndb/src/common/util/Makefile_old deleted file mode 100644 index 65093396246..00000000000 --- a/ndb/src/common/util/Makefile_old +++ /dev/null @@ -1,28 +0,0 @@ -include .defs.mk - -TYPE := util - -PIC_ARCHIVE := Y -ARCHIVE_TARGET := general - -SOURCES = File.cpp md5_hash.cpp Properties.cpp socket_io.cpp \ - SimpleProperties.cpp Parser.cpp InputStream.cpp SocketServer.cpp \ - OutputStream.cpp NdbOut.cpp BaseString.cpp Base64.cpp \ - NdbSqlUtil.cpp ConfigValues.cpp new.cpp - -SOURCES.c = uucode.c random.c getarg.c version.c - -ifeq ($(NDB_OS), OSE) - SOURCES += NdbErrHnd.cpp -endif -ifeq ($(NDB_OS), OSE) - SOURCES += NdbErrHnd.cpp -endif - SOURCES.c += strdup.c strlcat.c strlcpy.c - -DIRS := testSimpleProperties testProperties testConfigValues - -include $(NDB_TOP)/Epilogue.mk - -testNdbSqlUtil: NdbSqlUtil.cpp - $(CC) -o $@ NdbSqlUtil.cpp $(CCFLAGS) -DNDB_SQL_UTIL_TEST -L$(NDB_TOP)/lib -lportlib -lgeneral diff --git a/ndb/src/cw/Makefile_old b/ndb/src/cw/Makefile_old deleted file mode 100644 index e710c1e244d..00000000000 --- a/ndb/src/cw/Makefile_old +++ /dev/null @@ -1,6 +0,0 @@ -include .defs.mk - -DIRS := cpcd - -include $(NDB_TOP)/Epilogue.mk - diff --git a/ndb/src/cw/cpcd/Makefile_old b/ndb/src/cw/cpcd/Makefile_old deleted file mode 100644 index f214fb087d2..00000000000 --- a/ndb/src/cw/cpcd/Makefile_old +++ /dev/null @@ -1,11 +0,0 @@ -include .defs.mk - -TYPE := util -BIN_TARGET := ndb_cpcd - -# Source files of non-templated classes (.cpp files) -SOURCES = main.cpp CPCD.cpp Process.cpp APIService.cpp Monitor.cpp common.cpp - -BIN_TARGET_LIBS += logger - -include $(NDB_TOP)/Epilogue.mk diff --git a/ndb/src/kernel/Makefile_old b/ndb/src/kernel/Makefile_old deleted file mode 100644 index d1f1741aca4..00000000000 --- a/ndb/src/kernel/Makefile_old +++ /dev/null @@ -1,5 +0,0 @@ -include .defs.mk - -DIRS := error vm ndb-main blocks - -include $(NDB_TOP)/Epilogue.mk diff --git a/ndb/src/kernel/blocks/Makefile_old b/ndb/src/kernel/blocks/Makefile_old deleted file mode 100644 index ce554dfc3b8..00000000000 --- a/ndb/src/kernel/blocks/Makefile_old +++ /dev/null @@ -1,28 +0,0 @@ -#-------------------------------------------------------------------------- -# -# Name Makefile -# -# -# -# List subdirectories to be travered -include .defs.mk - -DIRS := \ - cmvmi \ - dbacc \ - dbdict \ - dbdih \ - dblqh \ - dbtc \ - dbtup \ - ndbfs \ - ndbcntr \ - qmgr \ - trix \ - backup \ - dbutil \ - suma \ - grep \ - dbtux - -include ${NDB_TOP}/Epilogue.mk diff --git a/ndb/src/kernel/blocks/backup/Makefile_old b/ndb/src/kernel/blocks/backup/Makefile_old deleted file mode 100644 index 989199cbe02..00000000000 --- a/ndb/src/kernel/blocks/backup/Makefile_old +++ /dev/null @@ -1,18 +0,0 @@ -include .defs.mk - -TYPE := kernel - -#ifneq ($(MYSQLCLUSTER_TOP),) -DIRS := restore -#endif - -ARCHIVE_TARGET := backup - -SOURCES = Backup.cpp BackupInit.cpp - -include $(NDB_TOP)/Epilogue.mk - -$(NDB_TOP)/bin/readBackupFile: read.o - $(C++) -o $@ read.o \ - $(NDB_TOP)/lib/libportlib.a $(NDB_TOP)/lib/libgeneral.a - diff --git a/ndb/src/kernel/blocks/cmvmi/Makefile_old b/ndb/src/kernel/blocks/cmvmi/Makefile_old deleted file mode 100644 index d75e5dbf08b..00000000000 --- a/ndb/src/kernel/blocks/cmvmi/Makefile_old +++ /dev/null @@ -1,9 +0,0 @@ -include .defs.mk - -TYPE := kernel - -ARCHIVE_TARGET := cmvmi - -SOURCES = Cmvmi.cpp - -include $(NDB_TOP)/Epilogue.mk diff --git a/ndb/src/kernel/blocks/dbacc/Makefile_old b/ndb/src/kernel/blocks/dbacc/Makefile_old deleted file mode 100644 index 93a830cec95..00000000000 --- a/ndb/src/kernel/blocks/dbacc/Makefile_old +++ /dev/null @@ -1,11 +0,0 @@ -include .defs.mk - -TYPE := kernel - -ARCHIVE_TARGET := dbacc - -SOURCES = \ - DbaccInit.cpp \ - DbaccMain.cpp - -include $(NDB_TOP)/Epilogue.mk diff --git a/ndb/src/kernel/blocks/dbdict/Makefile_old b/ndb/src/kernel/blocks/dbdict/Makefile_old deleted file mode 100644 index 46d938114fb..00000000000 --- a/ndb/src/kernel/blocks/dbdict/Makefile_old +++ /dev/null @@ -1,12 +0,0 @@ -include .defs.mk - -TYPE := kernel - -ARCHIVE_TARGET := dbdict - -SOURCES = \ - Dbdict.cpp - -DIRS := printSchemafile - -include $(NDB_TOP)/Epilogue.mk diff --git a/ndb/src/kernel/blocks/dbdih/Makefile_old b/ndb/src/kernel/blocks/dbdih/Makefile_old deleted file mode 100644 index 83c1b95b5c4..00000000000 --- a/ndb/src/kernel/blocks/dbdih/Makefile_old +++ /dev/null @@ -1,13 +0,0 @@ -include .defs.mk - -TYPE := kernel - -ARCHIVE_TARGET := dbdih - -DIRS := printSysfile - -SOURCES = \ - DbdihInit.cpp \ - DbdihMain.cpp - -include $(NDB_TOP)/Epilogue.mk diff --git a/ndb/src/kernel/blocks/dblqh/Makefile_old b/ndb/src/kernel/blocks/dblqh/Makefile_old deleted file mode 100644 index 520486d8058..00000000000 --- a/ndb/src/kernel/blocks/dblqh/Makefile_old +++ /dev/null @@ -1,12 +0,0 @@ -include .defs.mk - -TYPE := kernel - -ARCHIVE_TARGET := dblqh -DIRS := redoLogReader - -SOURCES = \ - DblqhInit.cpp \ - DblqhMain.cpp - -include $(NDB_TOP)/Epilogue.mk diff --git a/ndb/src/kernel/blocks/dbtc/Makefile_old b/ndb/src/kernel/blocks/dbtc/Makefile_old deleted file mode 100644 index ae876ab1f84..00000000000 --- a/ndb/src/kernel/blocks/dbtc/Makefile_old +++ /dev/null @@ -1,11 +0,0 @@ -include .defs.mk - -TYPE := kernel - -ARCHIVE_TARGET := dbtc -SOURCES = \ - DbtcInit.cpp \ - DbtcMain.cpp - -include $(NDB_TOP)/Epilogue.mk - diff --git a/ndb/src/kernel/blocks/dbtup/Makefile_old b/ndb/src/kernel/blocks/dbtup/Makefile_old deleted file mode 100644 index 87146f4b441..00000000000 --- a/ndb/src/kernel/blocks/dbtup/Makefile_old +++ /dev/null @@ -1,26 +0,0 @@ -include .defs.mk - -TYPE := kernel - -ARCHIVE_TARGET := dbtup -SOURCES = \ - DbtupExecQuery.cpp \ - DbtupBuffer.cpp \ - DbtupRoutines.cpp \ - DbtupCommit.cpp \ - DbtupFixAlloc.cpp \ - DbtupTrigger.cpp \ - DbtupAbort.cpp \ - DbtupLCP.cpp \ - DbtupUndoLog.cpp \ - DbtupPageMap.cpp \ - DbtupPagMan.cpp \ - DbtupStoredProcDef.cpp \ - DbtupMeta.cpp \ - DbtupTabDesMan.cpp \ - DbtupGen.cpp \ - DbtupSystemRestart.cpp \ - DbtupIndex.cpp \ - DbtupDebug.cpp - -include $(NDB_TOP)/Epilogue.mk diff --git a/ndb/src/kernel/blocks/dbtux/Makefile_old b/ndb/src/kernel/blocks/dbtux/Makefile_old deleted file mode 100644 index 30927c31848..00000000000 --- a/ndb/src/kernel/blocks/dbtux/Makefile_old +++ /dev/null @@ -1,17 +0,0 @@ -include .defs.mk - -TYPE = kernel - -ARCHIVE_TARGET = dbtux - -SOURCES = \ - DbtuxGen.cpp \ - DbtuxMeta.cpp \ - DbtuxMaint.cpp \ - DbtuxNode.cpp \ - DbtuxTree.cpp \ - DbtuxScan.cpp \ - DbtuxCmp.cpp \ - DbtuxDebug.cpp - -include $(NDB_TOP)/Epilogue.mk diff --git a/ndb/src/kernel/blocks/dbutil/Makefile_old b/ndb/src/kernel/blocks/dbutil/Makefile_old deleted file mode 100644 index 54b7326e4e5..00000000000 --- a/ndb/src/kernel/blocks/dbutil/Makefile_old +++ /dev/null @@ -1,8 +0,0 @@ -include .defs.mk - -TYPE := kernel - -ARCHIVE_TARGET := dbutil -SOURCES = DbUtil.cpp - -include $(NDB_TOP)/Epilogue.mk diff --git a/ndb/src/kernel/blocks/grep/Makefile_old b/ndb/src/kernel/blocks/grep/Makefile_old deleted file mode 100644 index 5ad5a0bce3b..00000000000 --- a/ndb/src/kernel/blocks/grep/Makefile_old +++ /dev/null @@ -1,9 +0,0 @@ -include .defs.mk - -TYPE := kernel - -ARCHIVE_TARGET := grep - -SOURCES = Grep.cpp GrepInit.cpp - -include $(NDB_TOP)/Epilogue.mk diff --git a/ndb/src/kernel/blocks/ndbcntr/Makefile_old b/ndb/src/kernel/blocks/ndbcntr/Makefile_old deleted file mode 100644 index 8e9c4f01027..00000000000 --- a/ndb/src/kernel/blocks/ndbcntr/Makefile_old +++ /dev/null @@ -1,12 +0,0 @@ -include .defs.mk - -TYPE := kernel - -ARCHIVE_TARGET := ndbcntr - -SOURCES = \ - NdbcntrInit.cpp \ - NdbcntrSysTable.cpp \ - NdbcntrMain.cpp - -include $(NDB_TOP)/Epilogue.mk diff --git a/ndb/src/kernel/blocks/ndbfs/Makefile_old b/ndb/src/kernel/blocks/ndbfs/Makefile_old deleted file mode 100644 index 58e1458bf16..00000000000 --- a/ndb/src/kernel/blocks/ndbfs/Makefile_old +++ /dev/null @@ -1,14 +0,0 @@ -include .defs.mk - -TYPE := kernel - -ARCHIVE_TARGET := ndbfs - -SOURCES = \ - AsyncFile.cpp \ - Ndbfs.cpp VoidFs.cpp \ - Filename.cpp \ - CircularIndex.cpp - -include $(NDB_TOP)/Epilogue.mk - diff --git a/ndb/src/kernel/blocks/qmgr/Makefile_old b/ndb/src/kernel/blocks/qmgr/Makefile_old deleted file mode 100644 index cd15643ea60..00000000000 --- a/ndb/src/kernel/blocks/qmgr/Makefile_old +++ /dev/null @@ -1,11 +0,0 @@ -include .defs.mk - -TYPE := kernel - -ARCHIVE_TARGET := qmgr - -SOURCES = \ - QmgrInit.cpp \ - QmgrMain.cpp - -include $(NDB_TOP)/Epilogue.mk diff --git a/ndb/src/kernel/blocks/suma/Makefile_old b/ndb/src/kernel/blocks/suma/Makefile_old deleted file mode 100644 index 20014c94670..00000000000 --- a/ndb/src/kernel/blocks/suma/Makefile_old +++ /dev/null @@ -1,10 +0,0 @@ -include .defs.mk - -TYPE := kernel - -ARCHIVE_TARGET := suma - -SOURCES = Suma.cpp SumaInit.cpp - -include $(NDB_TOP)/Epilogue.mk - diff --git a/ndb/src/kernel/blocks/trix/Makefile_old b/ndb/src/kernel/blocks/trix/Makefile_old deleted file mode 100644 index 5ac0da11f33..00000000000 --- a/ndb/src/kernel/blocks/trix/Makefile_old +++ /dev/null @@ -1,8 +0,0 @@ -include .defs.mk - -TYPE := kernel - -ARCHIVE_TARGET := trix -SOURCES = Trix.cpp - -include $(NDB_TOP)/Epilogue.mk diff --git a/ndb/src/kernel/error/Makefile_old b/ndb/src/kernel/error/Makefile_old deleted file mode 100644 index 0fe81f083ce..00000000000 --- a/ndb/src/kernel/error/Makefile_old +++ /dev/null @@ -1,12 +0,0 @@ -include .defs.mk - -TYPE := kernel - -ARCHIVE_TARGET := error - -SOURCES = \ - TimeModule.cpp \ - ErrorReporter.cpp \ - ErrorMessages.cpp - -include $(NDB_TOP)/Epilogue.mk diff --git a/ndb/src/kernel/vm/Makefile_old b/ndb/src/kernel/vm/Makefile_old deleted file mode 100644 index a162f3672ce..00000000000 --- a/ndb/src/kernel/vm/Makefile_old +++ /dev/null @@ -1,30 +0,0 @@ -include .defs.mk - -TYPE := kernel - -ARCHIVE_TARGET := kernel - -SOURCES = \ - SimulatedBlock.cpp \ - FastScheduler.cpp \ - TimeQueue.cpp \ - VMSignal.cpp \ - ThreadConfig.cpp \ - TransporterCallback.cpp \ - Emulator.cpp \ - Configuration.cpp \ - WatchDog.cpp \ - SimplePropertiesSection.cpp \ - SectionReader.cpp \ - MetaData.cpp \ - Mutex.cpp SafeCounter.cpp - -CFLAGS_Configuration.cpp := -I$(call fixpath,$(NDB_TOP)/src/mgmapi) - -DIRS := testCopy testDataBuffer testSimplePropertiesSection - -ifneq ($(USE_EDITLINE), N) -DIRS += testLongSig -endif - -include $(NDB_TOP)/Epilogue.mk diff --git a/ndb/src/mgmapi/Makefile_old b/ndb/src/mgmapi/Makefile_old deleted file mode 100644 index fa734f998e6..00000000000 --- a/ndb/src/mgmapi/Makefile_old +++ /dev/null @@ -1,27 +0,0 @@ -include .defs.mk - -TYPE := util - -PIC_ARCHIVE := Y -ARCHIVE_TARGET := mgmapi - -A_LIB := Y -SO_LIB := Y -PIC_LIB := Y - -#DIRS := test - -LIB_TARGET := MGM_API -LIB_TARGET_ARCHIVES := $(ARCHIVE_TARGET) general portlib - -# Source files of non-templated classes (.C files) -SOURCES = mgmapi.cpp mgmapi_configuration.cpp - -CCFLAGS_LOC += -I$(call fixpath,$(NDB_TOP)/include/mgmapi) \ - -I$(call fixpath,$(NDB_TOP)/src/common/mgmcommon) - -CCFLAGS += -DNO_DEBUG_MESSAGES - -# -I$(NDB_TOP)/src/common/mgmcommon - -include $(NDB_TOP)/Epilogue.mk diff --git a/ndb/src/mgmclient/Makefile.am b/ndb/src/mgmclient/Makefile.am index e3f0b23a79a..41a7f00ba15 100644 --- a/ndb/src/mgmclient/Makefile.am +++ b/ndb/src/mgmclient/Makefile.am @@ -1,6 +1,6 @@ -ndbtools_PROGRAMS = ndb_mgm noinst_LTLIBRARIES = libndbmgmclient.la +ndbtools_PROGRAMS = ndb_mgm libndbmgmclient_la_SOURCES = CommandInterpreter.cpp diff --git a/ndb/src/mgmsrv/Makefile_old b/ndb/src/mgmsrv/Makefile_old deleted file mode 100644 index c99875ae8b6..00000000000 --- a/ndb/src/mgmsrv/Makefile_old +++ /dev/null @@ -1,41 +0,0 @@ -include .defs.mk - -TYPE := ndbapi mgmapiclient - -BIN_TARGET := mgmtsrvr -BIN_TARGET_LIBS := -BIN_TARGET_ARCHIVES := NDB_API mgmsrvcommon mgmapi general - -ifneq ($(USE_EDITLINE), N) -BIN_TARGET_ARCHIVES += editline -DIRS := mkconfig -endif -BIN_TARGET_ARCHIVES += general - -BIN_FLAGS += $(TERMCAP_LIB) - -# Source files of non-templated classes (.cpp files) -SOURCES = \ - MgmtSrvr.cpp \ - MgmtSrvrGeneralSignalHandling.cpp \ - main.cpp \ - Services.cpp \ - convertStrToInt.cpp \ - NodeLogLevel.cpp \ - NodeLogLevelList.cpp \ - SignalQueue.cpp \ - MgmtSrvrConfig.cpp - -ifeq ($(findstring OSE, $(NDB_OS)),) -SOURCES += CommandInterpreter.cpp -endif - -CCFLAGS_LOC += -I$(call fixpath,$(NDB_TOP)/src/ndbapi) \ - -I$(call fixpath,$(NDB_TOP)/src/mgmapi) \ - -I$(call fixpath,$(NDB_TOP)/include/mgmapi) \ - -I$(call fixpath,$(NDB_TOP)/src/common/mgmcommon) - -include $(NDB_TOP)/Epilogue.mk - -_bins_mkconfig : $(NDB_TOP)/bin/$(BIN_TARGET) - diff --git a/ndb/src/ndbapi/Makefile_old b/ndb/src/ndbapi/Makefile_old deleted file mode 100644 index 54de9ba96f4..00000000000 --- a/ndb/src/ndbapi/Makefile_old +++ /dev/null @@ -1,60 +0,0 @@ -include .defs.mk - -TYPE := ndbapi - -PIC_ARCHIVE := Y -NONPIC_ARCHIVE := Y -ARCHIVE_TARGET := ndbapi - -A_LIB := Y -SO_LIB := Y -PIC_LIB := Y -LIB_TARGET := NDB_API - -LIB_TARGET_ARCHIVES := $(ARCHIVE_TARGET) \ - transporter \ - general \ - signaldataprint \ - mgmapi mgmsrvcommon \ - portlib \ - logger \ - trace - -DIRS := signal-sender - -CFLAGS_TransporterFacade.cpp := -I$(call fixpath,$(NDB_TOP)/src/mgmapi) -CFLAGS_ClusterMgr.cpp := -I$(call fixpath,$(NDB_TOP)/src/mgmapi) - -# Source files of non-templated classes (.cpp files) -SOURCES = \ - TransporterFacade.cpp \ - ClusterMgr.cpp \ - Ndb.cpp \ - NdbPoolImpl.cpp NdbPool.cpp \ - Ndblist.cpp \ - Ndbif.cpp \ - Ndbinit.cpp \ - ndberror.c Ndberr.cpp NdbErrorOut.cpp \ - NdbConnection.cpp \ - NdbConnectionScan.cpp \ - NdbOperation.cpp \ - NdbOperationSearch.cpp \ - NdbOperationInt.cpp \ - NdbOperationDefine.cpp \ - NdbOperationExec.cpp \ - NdbResultSet.cpp \ - NdbScanOperation.cpp NdbScanFilter.cpp \ - NdbIndexOperation.cpp \ - NdbEventOperation.cpp \ - NdbEventOperationImpl.cpp \ - NdbApiSignal.cpp \ - NdbRecAttr.cpp \ - NdbUtil.cpp \ - NdbReceiver.cpp \ - NdbDictionary.cpp NdbDictionaryImpl.cpp DictCache.cpp - NdbBlob.cpp - -include $(NDB_TOP)/Epilogue.mk - -### -# Backward compatible diff --git a/ndb/test/ndbapi/Makefile_old b/ndb/test/ndbapi/Makefile_old deleted file mode 100644 index c3198096ec0..00000000000 --- a/ndb/test/ndbapi/Makefile_old +++ /dev/null @@ -1,49 +0,0 @@ -include .defs.mk - - -ifeq ($(NDB_OS), OSE) -DIRS = basic flexBench flexAsynch -else -DIRS = lmc-bench ronja -BIN_DIRS = \ - flexAsynch \ - flexBench \ - flexHammer \ - flexTT \ - create_tab \ - create_all_tabs \ - drop_all_tabs \ - bulk_copy \ - restarter2 restarter \ - restarts testScan testNdbApi \ - testScanInterpreter testIndex \ - testInterpreter \ - testOIBasic \ - testBackup \ - testBasic \ - basicAsynch \ - testNodeRestart \ - testOperations testTransactions \ - testSystemRestart \ - testTimeout \ - testMgm \ - testRestartGci \ - testDataBuffers \ - testDict \ - acid \ - telco \ - indexTest \ - test_event \ - indexTest2 \ - testGrep \ - testBlobs - -ifeq ($(NDB_OS), SOLARIS) -ifeq ($(NDB_COMPILER), FORTE6) - DIRS += flexTimedAsynch -endif -endif -endif - -include ${NDB_TOP}/Epilogue.mk - diff --git a/ndb/test/ndbapi/bank/Makefile_old b/ndb/test/ndbapi/bank/Makefile_old deleted file mode 100644 index f710f9e6612..00000000000 --- a/ndb/test/ndbapi/bank/Makefile_old +++ /dev/null @@ -1,12 +0,0 @@ -include .defs.mk - -DIRS = src bankCreator \ - bankSumAccounts \ - bankTransactionMaker \ - bankValidateAllGLs \ - bankMakeGL \ - bankTimer \ - testBank - - -include $(NDB_TOP)/Epilogue.mk diff --git a/ndb/test/ndbapi/old_dirs/flexBench/Makefile_old b/ndb/test/ndbapi/old_dirs/flexBench/Makefile_old deleted file mode 100644 index bfff5cd161a..00000000000 --- a/ndb/test/ndbapi/old_dirs/flexBench/Makefile_old +++ /dev/null @@ -1,11 +0,0 @@ -include .defs.mk - -TYPE := ndbapitest - -BIN_TARGET := flexBench - -# Source files of non-templated classes (.C files) -SOURCES = flexBench.cpp - -include $(NDB_TOP)/Epilogue.mk - diff --git a/ndb/test/run-test/Makefile_old b/ndb/test/run-test/Makefile_old deleted file mode 100644 index 6b4689b2dbb..00000000000 --- a/ndb/test/run-test/Makefile_old +++ /dev/null @@ -1,22 +0,0 @@ -include .defs.mk - -TYPE := util - -BIN_TARGET := atrt -BIN_TARGET_LIBS := mgmapi - -SOURCES = main.cpp -SCRIPTS = atrt-analyze-result.sh atrt-gather-result.sh atrt-setup.sh \ - atrt-clear-result.sh make-config.sh - -OBJECTS_LOC = $(call fixpath,$(NDB_TOP)/src/mgmclient/CpcClient.o) - -CFLAGS_main.cpp := -I$(call fixpath,$(NDB_TOP)/src/mgmclient) -CCFLAGS_LOC += -I$(call fixpath,$(NDB_TOP)/include/mgmapi) - -include $(NDB_TOP)/Epilogue.mk - -_bins:: - -rm -f $(SCRIPTS:%=$(NDB_TOP)/bin/%) - cp $(SCRIPTS) $(NDB_TOP)/bin - diff --git a/ndb/test/src/Makefile_old b/ndb/test/src/Makefile_old deleted file mode 100644 index 2738ce1aba2..00000000000 --- a/ndb/test/src/Makefile_old +++ /dev/null @@ -1,33 +0,0 @@ -include .defs.mk - -TYPE := ndbapitest - -ARCHIVE_TARGET := NDBT - -SOURCES = NDBT_ReturnCodes.cpp \ - NDBT_Error.cpp NDBT_Tables.cpp NDBT_ResultRow.cpp \ - NDBT_Test.cpp HugoCalculator.cpp \ - HugoOperations.cpp HugoTransactions.cpp \ - HugoAsynchTransactions.cpp UtilTransactions.cpp \ - NdbRestarter.cpp NdbRestarts.cpp NDBT_Output.cpp \ - NdbBackup.cpp NdbConfig.cpp NdbGrep.cpp NDBT_Table.cpp - -SOURCES.c = - -CFLAGS_NdbRestarter.cpp := -I$(call fixpath,$(NDB_TOP)/src/common/mgmcommon) -CFLAGS_NdbConfig.cpp := -I$(call fixpath,$(NDB_TOP)/include/mgmcommon) \ - -I$(call fixpath,$(NDB_TOP)/src/mgmapi) -CFLAGS_NdbRestarts.cpp := -I$(call fixpath,$(NDB_TOP)/include/kernel) -CFLAGS_NdbBackup.cpp := -I$(call fixpath,$(NDB_TOP)/include/mgmcommon) \ - -I$(call fixpath,$(NDB_TOP)/src/mgmapi) \ - -I$(call fixpath,$(NDB_TOP)/include/kernel) -CFLAGS_NdbGrep.cpp += -I$(call fixpath,$(NDB_TOP)/include/kernel) -I$(call fixpath,$(NDB_TOP)/include/mgmcommon) - -include $(NDB_TOP)/Epilogue.mk - - - - - - - diff --git a/ndb/test/tools/Makefile_old b/ndb/test/tools/Makefile_old deleted file mode 100644 index b8e90ae207f..00000000000 --- a/ndb/test/tools/Makefile_old +++ /dev/null @@ -1,9 +0,0 @@ -include .defs.mk - -DIRS := hugoCalculator hugoFill hugoLoad hugoLockRecords \ - hugoPkDelete hugoPkRead hugoPkReadRecord hugoPkUpdate \ - hugoScanRead hugoScanUpdate restart waiter - -include $(NDB_TOP)/Epilogue.mk - -_bins_ndbapi : _libs_src diff --git a/ndb/test/tools/old_dirs/waiter/Makefile_old b/ndb/test/tools/old_dirs/waiter/Makefile_old deleted file mode 100644 index da2c9daff00..00000000000 --- a/ndb/test/tools/old_dirs/waiter/Makefile_old +++ /dev/null @@ -1,11 +0,0 @@ -include .defs.mk - -TYPE := ndbapitest - -BIN_TARGET := waiter - -# Source files of non-templated classes (.C files) -SOURCES = waiter.cpp - -include $(NDB_TOP)/Epilogue.mk - diff --git a/ndb/tools/Makefile_old b/ndb/tools/Makefile_old deleted file mode 100644 index b9dc6883e18..00000000000 --- a/ndb/tools/Makefile_old +++ /dev/null @@ -1,12 +0,0 @@ -include .defs.mk - -BIN_DIRS = select_all select_count desc list_tables \ - drop_tab delete_all copy_tab \ - create_index drop_index verify_index cpcc - -ifneq ($(NDB_ODBC),N) -BIN_DIRS += ndbsql -endif - -include $(NDB_TOP)/Epilogue.mk - From 61838e4c372bbea279ad086ac26d3097196e4bdf Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 8 Nov 2004 10:41:59 +0000 Subject: [PATCH 0140/1063] Makefile.am: remove mysql_test_run_new for now, it breaks the make mysql-test/Makefile.am: remove mysql_test_run_new for now, it breaks the make --- mysql-test/Makefile.am | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mysql-test/Makefile.am b/mysql-test/Makefile.am index ad02d304d1b..8ae0c256148 100644 --- a/mysql-test/Makefile.am +++ b/mysql-test/Makefile.am @@ -37,9 +37,10 @@ test_DATA = std_data/client-key.pem std_data/client-cert.pem std_data/cacert.pem CLEANFILES = $(test_SCRIPTS) $(test_DATA) INCLUDES = -I$(srcdir)/../include -I../include -I.. -bin_PROGRAMS = mysql_test_run_new +# remove mysql_test_run_new for now, it breaks the make +#bin_PROGRAMS = mysql_test_run_new noinst_HEADERS = my_manage.h -mysql_test_run_new_SOURCES= mysql_test_run_new.c my_manage.c +#mysql_test_run_new_SOURCES= mysql_test_run_new.c my_manage.c dist-hook: From 2ab265d0eb1bd8d662bac7acec8a6f5717f1fb71 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 8 Nov 2004 10:53:48 +0000 Subject: [PATCH 0141/1063] Makefile.am: added so that it is possible to make mysql_test_run_new but not done for target all do: make mysql_test_run_new mysql-test/Makefile.am: added so that it is possible to make mysql_test_run_new but not done for target all do: make mysql_test_run_new --- mysql-test/Makefile.am | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mysql-test/Makefile.am b/mysql-test/Makefile.am index 8ae0c256148..fcf352f46e6 100644 --- a/mysql-test/Makefile.am +++ b/mysql-test/Makefile.am @@ -37,10 +37,9 @@ test_DATA = std_data/client-key.pem std_data/client-cert.pem std_data/cacert.pem CLEANFILES = $(test_SCRIPTS) $(test_DATA) INCLUDES = -I$(srcdir)/../include -I../include -I.. -# remove mysql_test_run_new for now, it breaks the make -#bin_PROGRAMS = mysql_test_run_new +EXTRA_PROGRAMS = mysql_test_run_new noinst_HEADERS = my_manage.h -#mysql_test_run_new_SOURCES= mysql_test_run_new.c my_manage.c +mysql_test_run_new_SOURCES= mysql_test_run_new.c my_manage.c dist-hook: From 369845a46c34f3d2567467819de0632fc8937ba6 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 8 Nov 2004 11:28:57 +0000 Subject: [PATCH 0142/1063] Makefile.am: fix to make make -jN work ndb/src/mgmclient/Makefile.am: fix to make make -jN work --- ndb/src/mgmclient/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ndb/src/mgmclient/Makefile.am b/ndb/src/mgmclient/Makefile.am index 41a7f00ba15..cd6ddb0ad57 100644 --- a/ndb/src/mgmclient/Makefile.am +++ b/ndb/src/mgmclient/Makefile.am @@ -11,7 +11,7 @@ include $(top_srcdir)/ndb/config/type_ndbapi.mk.am INCLUDES += -I$(top_srcdir)/ndb/include/mgmapi -I$(top_srcdir)/ndb/src/common/mgmcommon -LDADD_LOC = $(top_builddir)/ndb/src/mgmclient/libndbmgmclient.la \ +LDADD_LOC = $(noinst_LTLIBRARIES) \ @readline_link@ \ $(top_builddir)/ndb/src/libndbclient.la \ $(top_builddir)/dbug/libdbug.a \ From 2f182b3eb0b9402ed5e946caf6e2a94451e1d6b8 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 8 Nov 2004 13:59:04 +0100 Subject: [PATCH 0143/1063] compile fix for ndbapi test program on irix (variable scope) ndb/test/include/NDBT_Test.hpp: compile fix for ndbapi test program on irix ndb/test/ndbapi/ScanFunctions.hpp: compile fix for ndbapi test program on irix ndb/test/ndbapi/testDataBuffers.cpp: compile fix for ndbapi test program on irix ndb/test/ndbapi/testDeadlock.cpp: compile fix for ndbapi test program on irix ndb/test/ndbapi/testDict.cpp: compile fix for ndbapi test program on irix ndb/test/ndbapi/testIndex.cpp: compile fix for ndbapi test program on irix ndb/test/ndbapi/testLcp.cpp: compile fix for ndbapi test program on irix ndb/test/ndbapi/testNdbApi.cpp: compile fix for ndbapi test program on irix ndb/test/ndbapi/testOIBasic.cpp: compile fix for ndbapi test program on irix ndb/test/ndbapi/testReadPerf.cpp: compile fix for ndbapi test program on irix ndb/test/ndbapi/testRestartGci.cpp: compile fix for ndbapi test program on irix ndb/test/ndbapi/testScanPerf.cpp: compile fix for ndbapi test program on irix ndb/test/ndbapi/testSystemRestart.cpp: compile fix for ndbapi test program on irix --- ndb/test/include/NDBT_Test.hpp | 4 +-- ndb/test/ndbapi/ScanFunctions.hpp | 20 +++++------ ndb/test/ndbapi/testDataBuffers.cpp | 50 +++++++++++++++------------ ndb/test/ndbapi/testDeadlock.cpp | 7 ++-- ndb/test/ndbapi/testDict.cpp | 5 +-- ndb/test/ndbapi/testIndex.cpp | 24 +++++++------ ndb/test/ndbapi/testLcp.cpp | 7 ++-- ndb/test/ndbapi/testNdbApi.cpp | 16 ++++----- ndb/test/ndbapi/testOIBasic.cpp | 19 +++++----- ndb/test/ndbapi/testReadPerf.cpp | 5 +-- ndb/test/ndbapi/testRestartGci.cpp | 5 +-- ndb/test/ndbapi/testScanPerf.cpp | 5 +-- ndb/test/ndbapi/testSystemRestart.cpp | 12 +++---- 13 files changed, 97 insertions(+), 82 deletions(-) diff --git a/ndb/test/include/NDBT_Test.hpp b/ndb/test/include/NDBT_Test.hpp index b0b5fe15960..8b69faebde8 100644 --- a/ndb/test/include/NDBT_Test.hpp +++ b/ndb/test/include/NDBT_Test.hpp @@ -392,10 +392,10 @@ C##suitname():NDBT_TestSuite(#suitname){ \ // Add a number of equal steps to the testcase #define STEPS(stepfunc, num) \ - for (int i = 0; i < num; i++){ \ + { int i; for (i = 0; i < num; i++){ \ pts = new NDBT_ParallelStep(pt, #stepfunc, stepfunc); \ pt->addStep(pts);\ - } + } } #define VERIFIER(stepfunc) \ ptv = new NDBT_Verifier(pt, #stepfunc, stepfunc); \ diff --git a/ndb/test/ndbapi/ScanFunctions.hpp b/ndb/test/ndbapi/ScanFunctions.hpp index 2ff4b751c33..6964f8c73a8 100644 --- a/ndb/test/ndbapi/ScanFunctions.hpp +++ b/ndb/test/ndbapi/ScanFunctions.hpp @@ -286,36 +286,36 @@ void AttribList::buildAttribList(const NdbDictionary::Table* pTab){ attr = new Attrib; attr->numAttribs = 0; attriblist.push_back(attr); - - for(int i = 1; i < pTab->getNoOfColumns(); i++){ + int i; + for(i = 1; i < pTab->getNoOfColumns(); i++){ attr = new Attrib; attr->numAttribs = i; for(int a = 0; aattribs[a] = a; attriblist.push_back(attr); } - for(int i = pTab->getNoOfColumns()-1; i > 0; i--){ + for(i = pTab->getNoOfColumns()-1; i > 0; i--){ attr = new Attrib; attr->numAttribs = i; for(int a = 0; aattribs[a] = a; attriblist.push_back(attr); } - for(int i = pTab->getNoOfColumns(); i > 0; i--){ + for(i = pTab->getNoOfColumns(); i > 0; i--){ attr = new Attrib; attr->numAttribs = pTab->getNoOfColumns() - i; for(int a = 0; agetNoOfColumns() - i; a++) attr->attribs[a] = pTab->getNoOfColumns()-a-1; attriblist.push_back(attr); } - for(int i = 1; i < pTab->getNoOfColumns(); i++){ + for(i = 1; i < pTab->getNoOfColumns(); i++){ attr = new Attrib; attr->numAttribs = pTab->getNoOfColumns() - i; for(int a = 0; agetNoOfColumns() - i; a++) attr->attribs[a] = pTab->getNoOfColumns()-a-1; attriblist.push_back(attr); } - for(int i = 1; i < pTab->getNoOfColumns(); i++){ + for(i = 1; i < pTab->getNoOfColumns(); i++){ attr = new Attrib; attr->numAttribs = 2; for(int a = 0; a<2; a++){ @@ -345,11 +345,11 @@ void AttribList::buildAttribList(const NdbDictionary::Table* pTab){ attriblist.push_back(attr); #if 1 - for(size_t i = 0; i < attriblist.size(); i++){ + for(size_t j = 0; j < attriblist.size(); j++){ - g_info << attriblist[i]->numAttribs << ": " ; - for(int a = 0; a < attriblist[i]->numAttribs; a++) - g_info << attriblist[i]->attribs[a] << ", "; + g_info << attriblist[j]->numAttribs << ": " ; + for(int a = 0; a < attriblist[j]->numAttribs; a++) + g_info << attriblist[j]->attribs[a] << ", "; g_info << endl; } #endif diff --git a/ndb/test/ndbapi/testDataBuffers.cpp b/ndb/test/ndbapi/testDataBuffers.cpp index 04602f51d5f..03d52252334 100644 --- a/ndb/test/ndbapi/testDataBuffers.cpp +++ b/ndb/test/ndbapi/testDataBuffers.cpp @@ -123,15 +123,15 @@ chkerror(char const* fmt, ...) // alignment of addresses and data sizes -static bool isAligned(unsigned x) +static bool isAligned(UintPtr x) { return ((x & 3) == 0); } static bool isAligned(char* p) { - return isAligned(unsigned(p)); + return isAligned(UintPtr(p)); } -static unsigned toAligned(unsigned x) +static unsigned toAligned(UintPtr x) { while (! isAligned(x)) x++; @@ -223,10 +223,10 @@ testcase(int flag) noRandom = ! (flag & 8); ndbout << (noRandom ? "simple sizes" : "randomize sizes") << endl; - int smax = 0, stot = 0; + int smax = 0, stot = 0, i; if (xverbose) ndbout << "- define table " << tab << endl; - for (int i = 0; i < attrcnt; i++) { + for (i = 0; i < attrcnt; i++) { col& c = ccol[i]; memset(&c, 0, sizeof(c)); sprintf(c.aAttrName, "C%d", i); @@ -266,7 +266,7 @@ testcase(int flag) return ndberror("getNdbSchemaOp"); if (top->createTable(tab) < 0) return ndberror("createTable"); - for (int i = 0; i < attrcnt; i++) { + for (i = 0; i < attrcnt; i++) { col& c = ccol[i]; if (top->createAttribute( c.aAttrName, @@ -299,7 +299,7 @@ testcase(int flag) return ndberror("getNdbOperation key=%d", key); if (op->deleteTuple() < 0) return ndberror("deleteTuple key=%d", key); - for (int i = 0; i < attrcnt; i++) { + for (i = 0; i < attrcnt; i++) { col& c = ccol[i]; if (i == 0) { if (op->equal(c.aAttrName, (char*)&key, sizeof(key)) < 0) @@ -329,7 +329,7 @@ testcase(int flag) return ndberror("getNdbOperation key=%d", key); if (op->insertTuple() < 0) return ndberror("insertTuple key=%d", key); - for (int i = 0; i < attrcnt; i++) { + for (i = 0; i < attrcnt; i++) { col& c = ccol[i]; if (i == 0) { if (op->equal(c.aAttrName, (char*)&key, sizeof(key)) < 0) @@ -362,7 +362,7 @@ testcase(int flag) return ndberror("getNdbOperation key=%d", key); if (op->readTuple() < 0) return ndberror("readTuple key=%d", key); - for (int i = 0; i < attrcnt; i++) { + for (i = 0; i < attrcnt; i++) { col& c = ccol[i]; if (i == 0) { if (op->equal(c.aAttrName, (char*)&key, sizeof(key)) < 0) @@ -371,7 +371,7 @@ testcase(int flag) if (xverbose) { char tmp[20]; if (useBuf) - sprintf(tmp, "0x%x", int(c.buf + off)); + sprintf(tmp, "0x%p", c.buf + off); else strcpy(tmp, "ndbapi"); ndbout << "--- column " << i << " addr=" << tmp << endl; @@ -388,23 +388,24 @@ testcase(int flag) } if (con->execute(Commit) != 0) return ndberror("execute key=%d", key); - for (int i = 0; i < attrcnt; i++) { + for (i = 0; i < attrcnt; i++) { col& c = ccol[i]; if (i == 0) { } else if (useBuf) { - for (int j = 0; j < off; j++) { + int j; + for (j = 0; j < off; j++) { if (c.buf[j] != 'B') { return chkerror("mismatch before key=%d col=%d pos=%d ok=%02x bad=%02x", key, i, j, 'B', c.buf[j]); } } - for (int j = 0; j < c.aArraySize; j++) { + for (j = 0; j < c.aArraySize; j++) { if (c.buf[j + off] != byteVal(key, i, j)) { return chkerror("mismatch key=%d col=%d pos=%d ok=%02x bad=%02x", key, i, j, byteVal(key, i, j), c.buf[j]); } } - for (int j = c.aArraySize + off; j < c.bufsiz; j++) { + for (j = c.aArraySize + off; j < c.bufsiz; j++) { if (c.buf[j] != 'B') { return chkerror("mismatch after key=%d col=%d pos=%d ok=%02x bad=%02x", key, i, j, 'B', c.buf[j]); @@ -431,7 +432,8 @@ testcase(int flag) if (xverbose) ndbout << "- scan" << endl; char found[MaxOper]; - for (int k = 0; k < opercnt; k++) + int k; + for (k = 0; k < opercnt; k++) found[k] = 0; for (key = 0; key < opercnt; key++) { int off = makeOff(key); @@ -459,7 +461,7 @@ testcase(int flag) if (op->interpret_exit_ok() < 0) return ndberror("interpret_exit_ok"); } - for (int i = 0; i < attrcnt; i++) { + for (i = 0; i < attrcnt; i++) { col& c = ccol[i]; if (i == 0) { if (op->getValue(c.aAttrName, (char*)&newkey) < 0) @@ -468,7 +470,7 @@ testcase(int flag) if (xverbose) { char tmp[20]; if (useBuf) - sprintf(tmp, "0x%x", int(c.buf + off)); + sprintf(tmp, "0x%p", c.buf + off); else strcpy(tmp, "ndbapi"); ndbout << "--- column " << i << " addr=" << tmp << endl; @@ -489,22 +491,23 @@ testcase(int flag) while ((ret = rs->nextResult()) == 0) { if (key != newkey) return ndberror("unexpected key=%d newkey=%d", key, newkey); - for (int i = 1; i < attrcnt; i++) { + for (i = 1; i < attrcnt; i++) { col& c = ccol[i]; if (useBuf) { - for (int j = 0; j < off; j++) { + int j; + for (j = 0; j < off; j++) { if (c.buf[j] != 'C') { return chkerror("mismatch before key=%d col=%d pos=%d ok=%02x bad=%02x", key, i, j, 'C', c.buf[j]); } } - for (int j = 0; j < c.aArraySize; j++) { + for (j = 0; j < c.aArraySize; j++) { if (c.buf[j + off] != byteVal(key, i, j)) { return chkerror("mismatch key=%d col=%d pos=%d ok=%02x bad=%02x", key, i, j, byteVal(key, i, j), c.buf[j]); } } - for (int j = c.aArraySize + off; j < c.bufsiz; j++) { + for (j = c.aArraySize + off; j < c.bufsiz; j++) { if (c.buf[j] != 'C') { return chkerror("mismatch after key=%d col=%d pos=%d ok=%02x bad=%02x", key, i, j, 'C', c.buf[j]); @@ -533,7 +536,7 @@ testcase(int flag) } con = 0; op = 0; - for (int k = 0; k < opercnt; k++) + for (k = 0; k < opercnt; k++) if (! found[k]) return ndberror("key %d not found", k); ndbout << "scanned " << key << endl; @@ -545,6 +548,7 @@ testcase(int flag) NDB_COMMAND(testDataBuffers, "testDataBuffers", "testDataBuffers", "testDataBuffers", 65535) { + int i; ndb_init(); while (++argv, --argc > 0) { char const* p = argv[0]; @@ -602,7 +606,7 @@ NDB_COMMAND(testDataBuffers, "testDataBuffers", "testDataBuffers", "testDataBuff } } unsigned ok = true; - for (int i = 1; 0 == loopcnt || i <= loopcnt; i++) { + for (i = 1; 0 == loopcnt || i <= loopcnt; i++) { ndbout << "=== loop " << i << " ===" << endl; for (int flag = 0; flag < (1< cols; Vector tabs; + int i; Ndb* pNdb = GETNDB(step); const Uint32 count = NDBT_Tables::getNumTables(); - for (int i=0; i < count; i++){ + for (i=0; i < count; i++){ const NdbDictionary::Table * tab = NDBT_Tables::getTable(i); pNdb->getDictionary()->createTable(* tab); @@ -1458,7 +1459,7 @@ runTestDictionaryPerf(NDBT_Context* ctx, NDBT_Step* step){ Uint32 size = cols.size() / 2; char ** columns = &cols[0]; Uint64 start = NdbTick_CurrentMillisecond(); - for(int i = 0; igetNoOfColumns(); i++){ + int i; + + for(i = 1; i <= pTab->getNoOfColumns(); i++){ attr = new Attrib; attr->numAttribs = i; for(int a = 0; agetNoOfColumns()-1; i > 0; i--){ + for(i = pTab->getNoOfColumns()-1; i > 0; i--){ attr = new Attrib; attr->numAttribs = i; b++; @@ -74,21 +76,21 @@ void AttribList::buildAttribList(const NdbDictionary::Table* pTab){ attr->attribs[a] = a+b; attriblist.push_back(attr); } - for(int i = pTab->getNoOfColumns(); i > 0; i--){ + for(i = pTab->getNoOfColumns(); i > 0; i--){ attr = new Attrib; attr->numAttribs = pTab->getNoOfColumns() - i; for(int a = 0; agetNoOfColumns() - i; a++) attr->attribs[a] = pTab->getNoOfColumns()-a-1; attriblist.push_back(attr); } - for(int i = 1; i < pTab->getNoOfColumns(); i++){ + for(i = 1; i < pTab->getNoOfColumns(); i++){ attr = new Attrib; attr->numAttribs = pTab->getNoOfColumns() - i; for(int a = 0; agetNoOfColumns() - i; a++) attr->attribs[a] = pTab->getNoOfColumns()-a-1; attriblist.push_back(attr); } - for(int i = 1; i < pTab->getNoOfColumns(); i++){ + for(i = 1; i < pTab->getNoOfColumns(); i++){ attr = new Attrib; attr->numAttribs = 2; for(int a = 0; a<2; a++){ @@ -226,8 +228,8 @@ int runCreateIndexes(NDBT_Context* ctx, NDBT_Step* step){ while (l < loops && result == NDBT_OK){ - - for (unsigned int i = 0; i < attrList.attriblist.size(); i++){ + unsigned int i; + for (i = 0; i < attrList.attriblist.size(); i++){ // Try to create index if (create_index(ctx, i, pTab, pNdb, attrList.attriblist[i], logged) == NDBT_FAILED) @@ -235,7 +237,7 @@ int runCreateIndexes(NDBT_Context* ctx, NDBT_Step* step){ } // Now drop all indexes that where created - for (unsigned int i = 0; i < attrList.attriblist.size(); i++){ + for (i = 0; i < attrList.attriblist.size(); i++){ // Try to drop index if (drop_index(i, pNdb, pTab, attrList.attriblist[i]) != NDBT_OK) @@ -1083,8 +1085,8 @@ runUniqueNullTransactions(NDBT_Context* ctx, NDBT_Step* step){ else pIdx.setType(NdbDictionary::Index::UniqueHashIndex); pIdx.setStoredIndex(logged); - - for (int c = 0; c< pTab->getNoOfColumns(); c++){ + int c; + for (c = 0; c< pTab->getNoOfColumns(); c++){ const NdbDictionary::Column * col = pTab->getColumn(c); if(col->getPrimaryKey()){ pIdx.addIndexColumn(col->getName()); @@ -1093,7 +1095,7 @@ runUniqueNullTransactions(NDBT_Context* ctx, NDBT_Step* step){ } int colId = -1; - for (int c = 0; c< pTab->getNoOfColumns(); c++){ + for (c = 0; c< pTab->getNoOfColumns(); c++){ const NdbDictionary::Column * col = pTab->getColumn(c); if(col->getNullable()){ pIdx.addIndexColumn(col->getName()); diff --git a/ndb/test/ndbapi/testLcp.cpp b/ndb/test/ndbapi/testLcp.cpp index c92be091a97..d11692db761 100644 --- a/ndb/test/ndbapi/testLcp.cpp +++ b/ndb/test/ndbapi/testLcp.cpp @@ -85,7 +85,8 @@ main(int argc, char ** argv){ g_info << " where ZLCP_OP_WRITE_RT_BREAK is finished before SAVE_PAGES" << endl; require(!pause_lcp()); - for(size_t j = 0; jcloseTransaction(conVector[i]); + for(size_t j = 0; j < conVector.size(); j++){ + pNdb->closeTransaction(conVector[j]); } conVector.clear(); l++; @@ -537,8 +537,8 @@ int runTestDeleteNdb(NDBT_Context* ctx, NDBT_Step* step){ } // Delete the ndb objects - for(size_t i = 0; i < ndbVector.size(); i++) - delete ndbVector[i]; + for(size_t j = 0; j < ndbVector.size(); j++) + delete ndbVector[j]; ndbVector.clear(); l++; } diff --git a/ndb/test/ndbapi/testOIBasic.cpp b/ndb/test/ndbapi/testOIBasic.cpp index 21862e02328..41f0686e63b 100644 --- a/ndb/test/ndbapi/testOIBasic.cpp +++ b/ndb/test/ndbapi/testOIBasic.cpp @@ -407,10 +407,11 @@ Col::verify(const void* addr) const const unsigned char* p = (const unsigned char*)addr; unsigned n = (p[0] << 8) | p[1]; assert(n <= m_length); - for (unsigned i = 0; i < n; i++) { + unsigned i; + for (i = 0; i < n; i++) { assert(p[2 + i] != 0); } - for (unsigned i = n; i < m_length; i++) { + for (i = n; i < m_length; i++) { assert(p[2 + i] == 0); } } @@ -3021,7 +3022,8 @@ runstep(Par par, const char* fname, TFunc func, unsigned mode) { LL2(fname); const int threads = (mode & ST ? 1 : par.m_threads); - for (int n = 0; n < threads; n++) { + int n; + for (n = 0; n < threads; n++) { LL4("start " << n); Thr& thr = *g_thrlist[n]; thr.m_par.m_tab = par.m_tab; @@ -3033,7 +3035,7 @@ runstep(Par par, const char* fname, TFunc func, unsigned mode) thr.start(); } unsigned errs = 0; - for (int n = threads - 1; n >= 0; n--) { + for (n = threads - 1; n >= 0; n--) { LL4("stop " << n); Thr& thr = *g_thrlist[n]; thr.stopped(); @@ -3301,10 +3303,11 @@ runtest(Par par) CHK(con.connect() == 0); par.m_con = &con; g_thrlist = new Thr* [par.m_threads]; - for (unsigned n = 0; n < par.m_threads; n++) { + unsigned n; + for (n = 0; n < par.m_threads; n++) { g_thrlist[n] = 0; } - for (unsigned n = 0; n < par.m_threads; n++) { + for (n = 0; n < par.m_threads; n++) { g_thrlist[n] = new Thr(par, n); Thr& thr = *g_thrlist[n]; assert(thr.m_thread != 0); @@ -3330,11 +3333,11 @@ runtest(Par par) } } } - for (unsigned n = 0; n < par.m_threads; n++) { + for (n = 0; n < par.m_threads; n++) { Thr& thr = *g_thrlist[n]; thr.exit(); } - for (unsigned n = 0; n < par.m_threads; n++) { + for (n = 0; n < par.m_threads; n++) { Thr& thr = *g_thrlist[n]; thr.join(); delete &thr; diff --git a/ndb/test/ndbapi/testReadPerf.cpp b/ndb/test/ndbapi/testReadPerf.cpp index 8d0d78cbe8c..380a809ad00 100644 --- a/ndb/test/ndbapi/testReadPerf.cpp +++ b/ndb/test/ndbapi/testReadPerf.cpp @@ -99,7 +99,8 @@ main(int argc, const char** argv){ { "verbose", 'v', arg_flag, &verbose, "Print verbose status", "verbose" } }; const int num_args = 1 + P_MAX; - for(int i = 0; i nodeIds; - for(Uint32 i = 0; i nodeIds; - for(Uint32 i = 0; i nodeIds; - for(Uint32 i = 0; i nodeIds; - for(Uint32 i = 0; i nodeIds; - for(Uint32 i = 0; i nodeIds; - for(Uint32 i = 0; i Date: Mon, 8 Nov 2004 13:33:10 +0000 Subject: [PATCH 0144/1063] added ndb test platform test --- mysql-test/ndb/ndbcluster.sh | 7 +++ ndb/tools/Makefile.am | 3 ++ ndb/tools/ndb_test_platform.cpp | 93 +++++++++++++++++++++++++++++++++ 3 files changed, 103 insertions(+) create mode 100644 ndb/tools/ndb_test_platform.cpp diff --git a/mysql-test/ndb/ndbcluster.sh b/mysql-test/ndb/ndbcluster.sh index 9c6b6093b93..f5757a11056 100644 --- a/mysql-test/ndb/ndbcluster.sh +++ b/mysql-test/ndb/ndbcluster.sh @@ -22,6 +22,7 @@ if [ -d ../sql ] ; then exec_ndb=$ndbtop/src/kernel/ndbd exec_mgmtsrvr=$ndbtop/src/mgmsrv/ndb_mgmd exec_waiter=$ndbtop/tools/ndb_waiter + exec_test=$ndbtop/tools/ndb_test_platform exec_mgmtclient=$ndbtop/src/mgmclient/ndb_mgm else BINARY_DIST=1 @@ -34,9 +35,15 @@ else exec_mgmtsrvr=$BASEDIR/bin/ndb_mgmd fi exec_waiter=$BASEDIR/bin/ndb_waiter + exec_waiter=$BASEDIR/bin/ndb_test_platform exec_mgmtclient=$BASEDIR/bin/ndb_mgm fi +if $exec_test ; then :; else + echo "ndb not correctly compiled to support this platform" + exit 1 +fi + pidfile=ndbcluster.pid cfgfile=Ndb.cfg stop_ndb= diff --git a/ndb/tools/Makefile.am b/ndb/tools/Makefile.am index 64625f69ea2..fad9bf9ff84 100644 --- a/ndb/tools/Makefile.am +++ b/ndb/tools/Makefile.am @@ -1,5 +1,6 @@ ndbtools_PROGRAMS = \ + ndb_test_platform \ ndb_waiter \ ndb_drop_table \ ndb_delete_all \ @@ -11,6 +12,7 @@ ndbtools_PROGRAMS = \ tools_common_sources = ../test/src/NDBT_ReturnCodes.cpp ../test/src/NDBT_Table.cpp ../test/src/NDBT_Output.cpp +ndb_test_platform_SOURCES = ndb_test_platform.cpp ndb_waiter_SOURCES = waiter.cpp $(tools_common_sources) ndb_delete_all_SOURCES = delete_all.cpp $(tools_common_sources) ndb_desc_SOURCES = desc.cpp $(tools_common_sources) @@ -23,6 +25,7 @@ ndb_select_count_SOURCES = select_count.cpp $(tools_common_sources) include $(top_srcdir)/ndb/config/common.mk.am include $(top_srcdir)/ndb/config/type_ndbapitools.mk.am +ndb_test_platform_LDFLAGS = @ndb_bin_am_ldflags@ ndb_waiter_LDFLAGS = @ndb_bin_am_ldflags@ ndb_drop_table_LDFLAGS = @ndb_bin_am_ldflags@ ndb_delete_all_LDFLAGS = @ndb_bin_am_ldflags@ diff --git a/ndb/tools/ndb_test_platform.cpp b/ndb/tools/ndb_test_platform.cpp new file mode 100644 index 00000000000..2b8bbd0274b --- /dev/null +++ b/ndb/tools/ndb_test_platform.cpp @@ -0,0 +1,93 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + + +#include +#include +#include + +/* + * Test BaseString::snprintf + */ + +static +int test_snprintf(const char * fmt, int buf_sz, int result) +{ + int ret; + char buf[100]; + ret = BaseString::snprintf(buf, buf_sz, fmt); + + if(ret < 0) + { + printf("BaseString::snprint returns %d\n", ret); + return -1; + } + + if(ret+1 == buf_sz) + { + printf("BaseString::snprint truncates\n"); + return -1; + } + + if(ret != result) + { + printf("BaseString::snprint returns incorrect value: %d != %d\n", + ret, result); + return -1; + } + + for(ret = 0; ret+1 < buf_sz && ret < result; ret++) + { + if(buf[ret] != fmt[ret]) + { + printf("BaseString::snprint Incorrect value in output buffer: " + "%d %d %d %d %d\n", + buf_sz, result, ret, buf[ret], fmt[ret]); + return -1; + } + } + return 0; +} + +int +main(void) +{ + /* + * Test BaseString::snprintf + */ + + if(test_snprintf("test", 1, 4)) + return -1; + + if(test_snprintf("test", 0, 4)) + return -1; + + if(test_snprintf("test", 100, 4)) + return -1; + + /* + * Test UintPtr + */ + + if (sizeof(UintPtr) != sizeof(Uint32*)) + { + printf("sizeof(UintPtr)=%d != sizeof(Uint32*)=%d\n", + sizeof(UintPtr), sizeof(Uint32*)); + return -1; + } + + return 0; +} From 01c80f55884e1695b4f2e16da9a2c10f9e9c9cbc Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 9 Nov 2004 00:19:39 +0400 Subject: [PATCH 0145/1063] mysql.h: Adding a prototype for the new function. include/mysql.h: Adding a prototype for the new function. --- include/mysql.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/mysql.h b/include/mysql.h index 8abeb86e32a..08ea2da2e58 100644 --- a/include/mysql.h +++ b/include/mysql.h @@ -392,6 +392,8 @@ unsigned long * STDCALL mysql_fetch_lengths(MYSQL_RES *result); MYSQL_FIELD * STDCALL mysql_fetch_field(MYSQL_RES *result); unsigned long STDCALL mysql_escape_string(char *to,const char *from, unsigned long from_length); +unsigned long STDCALL mysql_hex_string(char *to,const char *from, + unsigned long from_length); unsigned long STDCALL mysql_real_escape_string(MYSQL *mysql, char *to,const char *from, unsigned long length); From c4d04e9ec112e5df429844934507488c2c3990b9 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 8 Nov 2004 21:45:23 +0100 Subject: [PATCH 0146/1063] As rollback can be 30 times slower than insert in InnoDB, and user may not know there's rollback (if it's because of a dupl row), better warn that it's happening. It can also be of use for a DBA killing a connection and wondering what this connection is still doing now. Example: | 5 | root | localhost | test | Killed | 10 | Rolling back | insert into i select * from j | sql/handler.cc: As rollback can be 30 times slower than insert in InnoDB, and user may not know there's rollback (if it's because of a dupl row), better warn. --- sql/handler.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sql/handler.cc b/sql/handler.cc index f7a1a6ef0bf..cb88ab463d8 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -581,6 +581,12 @@ int ha_rollback_trans(THD *thd, THD_TRANS *trans) if (opt_using_transactions) { bool operation_done=0; + /* + As rollback can be 30 times slower than insert in InnoDB, and user may + not know there's rollback (if it's because of a dupl row), better warn. + */ + const char *save_proc_info= thd->proc_info; + thd->proc_info= "Rolling back"; #ifdef HAVE_NDBCLUSTER_DB if (trans->ndb_tid) { @@ -652,6 +658,7 @@ int ha_rollback_trans(THD *thd, THD_TRANS *trans) thd->variables.tx_isolation=thd->session_tx_isolation; if (operation_done) statistic_increment(ha_rollback_count,&LOCK_status); + thd->proc_info= save_proc_info; } #endif /* USING_TRANSACTIONS */ DBUG_RETURN(error); From 8e8c1a4756f04b582893965af0b780c2d32536f9 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 9 Nov 2004 03:20:58 +0200 Subject: [PATCH 0147/1063] Simple optimization --- sql/field.cc | 13 ++++++++++--- sql/field_conv.cc | 4 +--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/sql/field.cc b/sql/field.cc index 1111e47bc38..deb38048d42 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -4390,6 +4390,8 @@ String *Field_string::val_str(String *val_buffer __attribute__((unused)), int Field_string::cmp(const char *a_ptr, const char *b_ptr) { + uint a_len, b_len; + if (field_charset->strxfrm_multiply > 1) { /* @@ -4401,9 +4403,14 @@ int Field_string::cmp(const char *a_ptr, const char *b_ptr) (const uchar*) b_ptr, field_length); } - uint char_len= field_length/field_charset->mbmaxlen; - uint a_len= my_charpos(field_charset, a_ptr, a_ptr + field_length, char_len); - uint b_len= my_charpos(field_charset, b_ptr, b_ptr + field_length, char_len); + if (field_charset->mbmaxlen != 1) + { + uint char_len= field_length/field_charset->mbmaxlen; + a_len= my_charpos(field_charset, a_ptr, a_ptr + field_length, char_len); + b_len= my_charpos(field_charset, b_ptr, b_ptr + field_length, char_len); + } + else + a_len= b_len= field_length; return my_strnncoll(field_charset,(const uchar*) a_ptr, a_len, (const uchar*) b_ptr, b_len); } diff --git a/sql/field_conv.cc b/sql/field_conv.cc index 8a36fcd153c..61a5a28f47b 100644 --- a/sql/field_conv.cc +++ b/sql/field_conv.cc @@ -473,9 +473,7 @@ void (*Copy_field::get_copy_func(Field *to,Field *from))(Copy_field*) { if (to->flags & BLOB_FLAG) { - if (!(from->flags & BLOB_FLAG)) - return do_conv_blob; - if (from->charset() != to->charset()) + if (!(from->flags & BLOB_FLAG) || from->charset() != to->charset()) return do_conv_blob; if (from_length != to_length || to->table->db_low_byte_first != from->table->db_low_byte_first) From be0933aa7d45b2ce8849d5b293617731e9fd27ac Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 9 Nov 2004 11:59:28 +0100 Subject: [PATCH 0148/1063] ndb: compile fix for hpita2-64 bit - remove a bunch of includes --- .../debugger/signaldata/SignalDataPrint.cpp | 64 ++----------------- 1 file changed, 5 insertions(+), 59 deletions(-) diff --git a/ndb/src/common/debugger/signaldata/SignalDataPrint.cpp b/ndb/src/common/debugger/signaldata/SignalDataPrint.cpp index 188468e1c31..a4cee38e06f 100644 --- a/ndb/src/common/debugger/signaldata/SignalDataPrint.cpp +++ b/ndb/src/common/debugger/signaldata/SignalDataPrint.cpp @@ -16,65 +16,9 @@ -#include "GlobalSignalNumbers.h" -#include "signaldata/SignalDataPrint.hpp" -#include "signaldata/TcKeyReq.hpp" -#include "signaldata/TcKeyConf.hpp" -#include "signaldata/TcKeyRef.hpp" -#include "signaldata/LqhKey.hpp" -#include "signaldata/TupKey.hpp" -#include "signaldata/TupCommit.hpp" -#include "signaldata/FsOpenReq.hpp" -#include "signaldata/FsCloseReq.hpp" -#include "signaldata/FsReadWriteReq.hpp" -#include "signaldata/FsRef.hpp" -#include "signaldata/FsConf.hpp" -#include "signaldata/CloseComReqConf.hpp" -#include "signaldata/PackedSignal.hpp" -#include "signaldata/PrepFailReqRef.hpp" -#include "signaldata/DictTabInfo.hpp" -#include "signaldata/AlterTable.hpp" -#include "signaldata/AlterTab.hpp" -#include "signaldata/CreateTrig.hpp" -#include "signaldata/AlterTrig.hpp" -#include "signaldata/DropTrig.hpp" -#include "signaldata/FireTrigOrd.hpp" -#include "signaldata/TrigAttrInfo.hpp" -#include "signaldata/CreateIndx.hpp" -#include "signaldata/AlterIndx.hpp" -#include "signaldata/DropIndx.hpp" -#include "signaldata/TcIndx.hpp" -#include "signaldata/IndxKeyInfo.hpp" -#include "signaldata/IndxAttrInfo.hpp" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include /** * This is the register @@ -254,6 +198,8 @@ SignalDataPrintFunctions[] = { ,{ 0, 0 } }; +#include + template struct BitmaskPOD<1>; template struct BitmaskPOD<2>; template struct BitmaskPOD<4>; From a9c7e3179cb9b0861943f0b0c4c9d38614c44536 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 9 Nov 2004 14:46:26 +0200 Subject: [PATCH 0149/1063] Fix for valgrind/purify for variables that the compiler touches but that doesn't affect the outcome of the tests --- include/my_global.h | 6 ++++++ sql/item_timefunc.cc | 13 ++++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/include/my_global.h b/include/my_global.h index f6200830ee3..07d4d8dc1cc 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -370,6 +370,12 @@ int __void__; #define LINT_INIT(var) #endif +#if defined(_lint) || defined(FORCE_INIT_OF_VARS) || defined(HAVE_purify) +#define PURIFY_OR_LINT_INIT(var) var=0 +#else +#define PURIFY_OR_LINT_INIT(var) +#endif + /* Define some useful general macros */ #if defined(__cplusplus) && defined(__GNUC__) #define max(a, b) ((a) >? (b)) diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index 41418c0094d..d8142352e70 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -161,21 +161,24 @@ static bool extract_date_time(DATE_TIME_FORMAT *format, { int weekday= 0, yearday= 0, daypart= 0; int week_number= -1; - CHARSET_INFO *cs= &my_charset_bin; int error= 0; - bool usa_time= 0; - bool sunday_first_n_first_week_non_iso= -2; - bool strict_week_number; int strict_week_number_year= -1; - bool strict_week_number_year_type= -1; int frac_part; + bool usa_time= 0; + bool sunday_first_n_first_week_non_iso; + bool strict_week_number; + bool strict_week_number_year_type; const char *val_begin= val; const char *val_end= val + length; const char *ptr= format->format.str; const char *end= ptr + format->format.length; + CHARSET_INFO *cs= &my_charset_bin; DBUG_ENTER("extract_date_time"); LINT_INIT(strict_week_number); + /* Remove valgrind varnings when using gcc 3.3 and -O1 */ + PURIFY_OR_LINT_INIT(strict_week_number_year_type); + PURIFY_OR_LINT_INIT(sunday_first_n_first_week_non_iso); if (!sub_pattern_end) bzero((char*) l_time, sizeof(*l_time)); From cbd92676dd1a298d615132f48425daa418ee3a4c Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 9 Nov 2004 15:59:45 +0200 Subject: [PATCH 0150/1063] dict0dict.ic: Fix a bug in InnoDB code that fortunately was never used: row id is stored in a record always as a 6-byte unsigned integer, in a 'non-compressed' form innobase/include/dict0dict.ic: Fix a bug in InnoDB code that fortunately was never used: row id is stored in a record always as a 6-byte unsigned integer, in a 'non-compressed' form --- innobase/include/dict0dict.ic | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/innobase/include/dict0dict.ic b/innobase/include/dict0dict.ic index 0f7cc8973db..85e4aaf1a05 100644 --- a/innobase/include/dict0dict.ic +++ b/innobase/include/dict0dict.ic @@ -342,13 +342,16 @@ dict_index_rec_get_sys_col( ut_ad(len == 7); return(trx_read_roll_ptr(field)); - } else if ((type == DATA_ROW_ID) || (type == DATA_MIX_ID)) { + } else if (type == DATA_TRX_ID) { + + return(trx_read_trx_id(field)); + } else if (type == DATA_MIX_ID) { return(mach_dulint_read_compressed(field)); } else { - ut_ad(type == DATA_TRX_ID); + ut_a(type == DATA_ROW_ID); - return(trx_read_trx_id(field)); + return(mach_read_from_6(field)); } } From d3605294f6cb7e31a691bb29427e0da6b51869d9 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 9 Nov 2004 11:03:02 -0600 Subject: [PATCH 0151/1063] Alphabetize some out-of-order options in option structure. Revise the --hex-blob help message string. (This will need revising after merge to 4.1, too, but the CHAR BINARY and VARCHAR BINARY data types will be BINARY and VARBINRY.) --- client/mysqldump.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/client/mysqldump.c b/client/mysqldump.c index 0e840512ba0..58d601654a4 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -114,6 +114,9 @@ static struct my_option my_long_options[] = {"character-sets-dir", OPT_CHARSETS_DIR, "Directory where character sets are", (gptr*) &charsets_dir, (gptr*) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"comments", 'i', "Write additional information.", + (gptr*) &opt_comments, (gptr*) &opt_comments, 0, GET_BOOL, NO_ARG, + 1, 0, 0, 0, 0, 0}, {"complete-insert", 'c', "Use complete insert statements.", (gptr*) &cFlag, (gptr*) &cFlag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"compress", 'C', "Use compression in server/client protocol.", @@ -166,6 +169,9 @@ static struct my_option my_long_options[] = 0, 0, 0, 0, 0, 0}, {"help", '?', "Display this help message and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"hex-blob", OPT_HEXBLOB, "Dump binary strings (CHAR BINARY, " + "VARCHAR BINARY, BLOB) in hexadecimal format.", + (gptr*) &opt_hex_blob, (gptr*) &opt_hex_blob, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"host", 'h', "Connect to host.", (gptr*) ¤t_host, (gptr*) ¤t_host, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"lines-terminated-by", OPT_LTB, "Lines in the i.file are terminated by ...", @@ -180,10 +186,6 @@ static struct my_option my_long_options[] = "Wrap tables with autocommit/commit statements.", (gptr*) &opt_autocommit, (gptr*) &opt_autocommit, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"single-transaction", OPT_TRANSACTION, - "Dump all tables in single transaction to get consistent snapshot. Mutually exclusive with --lock-tables.", - (gptr*) &opt_single_transaction, (gptr*) &opt_single_transaction, 0, GET_BOOL, NO_ARG, - 0, 0, 0, 0, 0, 0}, {"no-create-db", 'n', "'CREATE DATABASE /*!32312 IF NOT EXISTS*/ db_name;' will not be put in the output. The above line will be added otherwise, if --databases or --all-databases option was given.}", (gptr*) &opt_create_db, (gptr*) &opt_create_db, 0, GET_BOOL, NO_ARG, 0, 0, @@ -192,9 +194,6 @@ static struct my_option my_long_options[] = (gptr*) &tFlag, (gptr*) &tFlag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"no-data", 'd', "No row information.", (gptr*) &dFlag, (gptr*) &dFlag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"set-variable", 'O', - "Change the value of a variable. Please note that this option is deprecated; you can set variables directly with --variable-name=value.", - 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"opt", OPT_OPTIMIZE, "Same as --add-drop-table --add-locks --all --quick --extended-insert --lock-tables --disable-keys", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, @@ -216,6 +215,13 @@ static struct my_option my_long_options[] = {"result-file", 'r', "Direct output to a given file. This option should be used in MSDOS, because it prevents new line '\\n' from being converted to '\\r\\n' (carriage return + line feed).", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"set-variable", 'O', + "Change the value of a variable. Please note that this option is deprecated; you can set variables directly with --variable-name=value.", + 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"single-transaction", OPT_TRANSACTION, + "Dump all tables in single transaction to get consistent snapshot. Mutually exclusive with --lock-tables.", + (gptr*) &opt_single_transaction, (gptr*) &opt_single_transaction, 0, GET_BOOL, NO_ARG, + 0, 0, 0, 0, 0, 0}, {"socket", 'S', "Socket file to use for connection.", (gptr*) &opt_mysql_unix_port, (gptr*) &opt_mysql_unix_port, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, @@ -246,11 +252,6 @@ static struct my_option my_long_options[] = (gptr*) &opt_net_buffer_length, (gptr*) &opt_net_buffer_length, 0, GET_ULONG, REQUIRED_ARG, 1024*1024L-1025, 4096, 16*1024L*1024L, MALLOC_OVERHEAD-1024, 1024, 0}, - {"comments", 'i', "Write additional information.", - (gptr*) &opt_comments, (gptr*) &opt_comments, 0, GET_BOOL, NO_ARG, - 1, 0, 0, 0, 0, 0}, - {"hex-blob", OPT_HEXBLOB, "Dump BLOBs in HEX.", - (gptr*) &opt_hex_blob, (gptr*) &opt_hex_blob, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} }; From ce8236432652333ed39a93f6646ff8d191fcf564 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 9 Nov 2004 20:21:37 +0100 Subject: [PATCH 0152/1063] mysql_test_run_new.c, my_manage.h, my_manage.c: Added Solaris compatibility mysql-test/my_manage.c: Added Solaris compatibility mysql-test/my_manage.h: Added Solaris compatibility mysql-test/mysql_test_run_new.c: Added Solaris compatibility --- mysql-test/my_manage.c | 92 +++++--- mysql-test/my_manage.h | 2 - mysql-test/mysql_test_run_new.c | 398 ++++++++++++++++---------------- 3 files changed, 257 insertions(+), 235 deletions(-) diff --git a/mysql-test/my_manage.c b/mysql-test/my_manage.c index ba5c674d105..cc27558f131 100644 --- a/mysql-test/my_manage.c +++ b/mysql-test/my_manage.c @@ -30,7 +30,8 @@ #ifndef __WIN__ #include #include -#include +#include +#include /* FIXME HAVE_FNMATCH_H or something */ #else #include #include @@ -100,7 +101,7 @@ void init_args(arg_list_t *al) void add_arg(arg_list_t *al, const char *format, ...) { va_list ap; - char temp[PATH_MAX]; + char temp[FN_REFLEN]; ASSERT(al != NULL); @@ -230,10 +231,10 @@ int wait_for_server_start(char *bin_dir __attribute__((unused)), { arg_list_t al; int err= 0, i; - char trash[PATH_MAX]; + char trash[FN_REFLEN]; /* mysqladmin file */ - snprintf(trash, PATH_MAX, "%s/trash.out",tmp_dir); + snprintf(trash, FN_REFLEN, "%s/trash.out",tmp_dir); /* args */ init_args(&al); @@ -490,9 +491,9 @@ int stop_server(char *bin_dir __attribute__((unused)), char *mysqladmin_file, { arg_list_t al; int err= 0; - char trash[PATH_MAX]; + char trash[FN_REFLEN]; - snprintf(trash, PATH_MAX, "%s/trash.out",tmp_dir); + snprintf(trash, FN_REFLEN, "%s/trash.out",tmp_dir); /* args */ init_args(&al); @@ -548,7 +549,7 @@ int stop_server(char *bin_dir __attribute__((unused)), char *mysqladmin_file, #ifndef __WIN__ pid_t get_server_pid(char *pid_file) { - char buf[PATH_MAX]; + char buf[FN_REFLEN]; int fd, err; char *p; pid_t id= 0; @@ -556,7 +557,7 @@ pid_t get_server_pid(char *pid_file) /* discover id */ fd= open(pid_file, O_RDONLY); - err= read(fd, buf, PATH_MAX); + err= read(fd, buf, FN_REFLEN); close(fd); @@ -619,7 +620,7 @@ void del_tree(char *dir) #ifndef __WIN__ DIR *parent= opendir(dir); struct dirent *entry; - char temp[PATH_MAX]; + char temp[FN_REFLEN]; if (parent == NULL) { @@ -629,22 +630,36 @@ void del_tree(char *dir) while ((entry= readdir(parent)) != NULL) { /* create long name */ - snprintf(temp, PATH_MAX, "%s/%s", dir, entry->d_name); + snprintf(temp, FN_REFLEN, "%s/%s", dir, entry->d_name); if (entry->d_name[0] == '.') { /* Skip */ } else - if (S_ISDIR(entry->d_type)) { - /* delete subdirectory */ - del_tree(temp); - } - else - { - /* remove file */ - remove(temp); +/* FIXME missing test in acinclude.m4 */ +#ifndef STRUCT_DIRENT_HAS_D_TYPE + struct stat st; + + if (lstat(entry->d_name, &st) == -1) + { + /* FIXME error */ + return; + } + if (S_ISDIR(st.st_mode)) +#else + if (S_ISDIR(entry->d_type)) +#endif + { + /* delete subdirectory */ + del_tree(temp); + } + else + { + /* remove file */ + remove(temp); + } } } /* remove directory */ @@ -652,10 +667,10 @@ void del_tree(char *dir) #else struct _finddata_t parent; intptr_t handle; - char temp[PATH_MAX]; - char mask[PATH_MAX]; + char temp[FN_REFLEN]; + char mask[FN_REFLEN]; - snprintf(mask,MAX_PATH,"%s/*.*",dir); + snprintf(mask,FN_REFLEN,"%s/*.*",dir); if ((handle=_findfirst(mask,&parent)) == -1L) { @@ -665,7 +680,7 @@ void del_tree(char *dir) do { /* create long name */ - snprintf(temp, PATH_MAX, "%s/%s", dir, parent.name); + snprintf(temp, FN_REFLEN, "%s/%s", dir, parent.name); if (parent.name[0] == '.') { /* Skip */ @@ -700,11 +715,11 @@ int removef(const char *format, ...) { #ifdef __NETWARE__ va_list ap; - char path[PATH_MAX]; + char path[FN_REFLEN]; va_start(ap, format); - vsnprintf(path, PATH_MAX, format, ap); + vsnprintf(path, FN_REFLEN, format, ap); va_end(ap); return remove(path); @@ -712,15 +727,15 @@ int removef(const char *format, ...) #eldef __WIN__ { va_list ap; - char path[PATH_MAX]; + char path[FN_REFLEN]; struct _finddata_t parent; intptr_t handle; - char temp[PATH_MAX]; + char temp[FN_REFLEN]; char *p; va_start(ap, format); - vsnprintf(path, PATH_MAX, format, ap); + vsnprintf(path, FN_REFLEN, format, ap); va_end(ap); @@ -739,7 +754,7 @@ int removef(const char *format, ...) { if (! (parent.attrib & _A_SUBDIR)) { - snprintf(temp, PATH_MAX, "%s/%s", path, parent.name); + snprintf(temp, FN_REFLEN, "%s/%s", path, parent.name); remove(temp); } }while (_findnext(handle,&parent) == 0); @@ -749,14 +764,14 @@ int removef(const char *format, ...) #else DIR *parent; struct dirent *entry; - char temp[PATH_MAX]; + char temp[FN_REFLEN]; va_list ap; - char path[PATH_MAX]; + char path[FN_REFLEN]; char *p; /* Get path with mask */ va_start(ap, format); - vsnprintf(path, PATH_MAX, format, ap); + vsnprintf(path, FN_REFLEN, format, ap); va_end(ap); @@ -775,10 +790,21 @@ int removef(const char *format, ...) while ((entry= readdir(parent)) != NULL) { /* entry is not directory and entry matches with mask */ +#ifndef STRUCT_DIRENT_HAS_D_TYPE + struct stat st; + + if (lstat(entry->d_name, &st) == -1) + { + return 1; + } + + if (!S_ISDIR(st.st_mode) && !fnmatch(p, entry->d_name,0)) +#else if (!S_ISDIR(entry->d_type) && !fnmatch(p, entry->d_name,0)) +#endif { /* create long name */ - snprintf(temp, PATH_MAX, "%s/%s", path, entry->d_name); + snprintf(temp, FN_REFLEN, "%s/%s", path, entry->d_name); /* Delete only files */ remove(temp); } @@ -795,7 +821,7 @@ int removef(const char *format, ...) void get_basedir(char *argv0, char *basedir) { - char temp[PATH_MAX]; + char temp[FN_REFLEN]; char *p; int position; diff --git a/mysql-test/my_manage.h b/mysql-test/my_manage.h index a61c693c22c..7e371d36ab1 100644 --- a/mysql-test/my_manage.h +++ b/mysql-test/my_manage.h @@ -52,8 +52,6 @@ int my_vsnprintf_(char *to, size_t n, const char* value, ...); #define TRY_MAX 5 #ifdef __WIN__ -#define PATH_MAX _MAX_PATH -#define NAME_MAX _MAX_FNAME #define kill(A,B) TerminateProcess((HANDLE)A,0) #define NOT_NEED_PID 0 #define MASTER_PID 1 diff --git a/mysql-test/mysql_test_run_new.c b/mysql-test/mysql_test_run_new.c index 1e8a1dded51..d8bf731b398 100644 --- a/mysql-test/mysql_test_run_new.c +++ b/mysql-test/mysql_test_run_new.c @@ -73,25 +73,25 @@ const char *TEST_IGNORE= "[ignore]"; ******************************************************************************/ #ifdef __NETWARE__ -static char base_dir[PATH_MAX]= "sys:/mysql"; +static char base_dir[FN_REFLEN]= "sys:/mysql"; #else -static char base_dir[PATH_MAX]= ".."; +static char base_dir[FN_REFLEN]= ".."; #endif -static char db[PATH_MAX]= "test"; -static char user[PATH_MAX]= "root"; -static char password[PATH_MAX]= ""; +static char db[FN_LEN]= "test"; +static char user[FN_LEN]= "root"; +static char password[FN_LEN]= ""; int master_port= 9306; int slave_port= 9307; #if !defined(__NETWARE__) && !defined(__WIN__) -static char master_socket[PATH_MAX]= "./var/tmp/master.sock"; -static char slave_socket[PATH_MAX]= "./var/tmp/slave.sock"; +static char master_socket[FN_REFLEN]= "./var/tmp/master.sock"; +static char slave_socket[FN_REFLEN]= "./var/tmp/slave.sock"; #endif /* comma delimited list of tests to skip or empty string */ #ifndef __WIN__ -static char skip_test[PATH_MAX]= " lowercase_table3 , system_mysql_db_fix "; +static char skip_test[FN_REFLEN]= " lowercase_table3 , system_mysql_db_fix "; #else /* The most ignore testes contain the calls of system command @@ -110,7 +110,7 @@ static char skip_test[PATH_MAX]= " lowercase_table3 , system_mysql_db_fix "; mysqldump contains a command system rpl000001 makes non-exit loop...temporary skiped */ -static char skip_test[PATH_MAX]= +static char skip_test[FN_REFLEN]= " lowercase_table3 ," " system_mysql_db_fix ," " sp ," @@ -123,44 +123,44 @@ static char skip_test[PATH_MAX]= " mysqldump ," " rpl000001 "; #endif -static char ignore_test[PATH_MAX]= ""; +static char ignore_test[FN_REFLEN]= ""; -static char bin_dir[PATH_MAX]; -static char mysql_test_dir[PATH_MAX]; -static char test_dir[PATH_MAX]; -static char mysql_tmp_dir[PATH_MAX]; -static char result_dir[PATH_MAX]; -static char master_dir[PATH_MAX]; -static char slave_dir[PATH_MAX]; -static char lang_dir[PATH_MAX]; -static char char_dir[PATH_MAX]; +static char bin_dir[FN_REFLEN]; +static char mysql_test_dir[FN_REFLEN]; +static char test_dir[FN_REFLEN]; +static char mysql_tmp_dir[FN_REFLEN]; +static char result_dir[FN_REFLEN]; +static char master_dir[FN_REFLEN]; +static char slave_dir[FN_REFLEN]; +static char lang_dir[FN_REFLEN]; +static char char_dir[FN_REFLEN]; -static char mysqladmin_file[PATH_MAX]; -static char mysqld_file[PATH_MAX]; -static char mysqltest_file[PATH_MAX]; +static char mysqladmin_file[FN_REFLEN]; +static char mysqld_file[FN_REFLEN]; +static char mysqltest_file[FN_REFLEN]; #ifndef __WIN__ -static char master_pid[PATH_MAX]; -static char slave_pid[PATH_MAX]; -static char sh_file[PATH_MAX]= "/bin/sh"; +static char master_pid[FN_REFLEN]; +static char slave_pid[FN_REFLEN]; +static char sh_file[FN_REFLEN]= "/bin/sh"; #else static HANDLE master_pid; static HANDLE slave_pid; #endif -static char master_opt[PATH_MAX]= ""; -static char slave_opt[PATH_MAX]= ""; +static char master_opt[FN_REFLEN]= ""; +static char slave_opt[FN_REFLEN]= ""; -static char slave_master_info[PATH_MAX]= ""; +static char slave_master_info[FN_REFLEN]= ""; -static char master_init_script[PATH_MAX]= ""; -static char slave_init_script[PATH_MAX]= ""; +static char master_init_script[FN_REFLEN]= ""; +static char slave_init_script[FN_REFLEN]= ""; /* OpenSSL */ -static char ca_cert[PATH_MAX]; -static char server_cert[PATH_MAX]; -static char server_key[PATH_MAX]; -static char client_cert[PATH_MAX]; -static char client_key[PATH_MAX]; +static char ca_cert[FN_REFLEN]; +static char server_cert[FN_REFLEN]; +static char server_key[FN_REFLEN]; +static char client_cert[FN_REFLEN]; +static char client_key[FN_REFLEN]; int total_skip= 0; int total_pass= 0; @@ -254,18 +254,18 @@ void install_db(char *datadir) { arg_list_t al; int err; - char input[PATH_MAX]; - char output[PATH_MAX]; - char error[PATH_MAX]; + char input[FN_REFLEN]; + char output[FN_REFLEN]; + char error[FN_REFLEN]; /* input file */ #ifdef __NETWARE__ - snprintf(input, PATH_MAX, "%s/bin/init_db.sql", base_dir); + snprintf(input, FN_REFLEN, "%s/bin/init_db.sql", base_dir); #else - snprintf(input, PATH_MAX, "%s/mysql-test/init_db.sql", base_dir); + snprintf(input, FN_REFLEN, "%s/mysql-test/init_db.sql", base_dir); #endif - snprintf(output, PATH_MAX, "%s/install.out", datadir); - snprintf(error, PATH_MAX, "%s/install.err", datadir); + snprintf(output, FN_REFLEN, "%s/install.out", datadir); + snprintf(error, FN_REFLEN, "%s/install.err", datadir); /* args */ init_args(&al); @@ -302,10 +302,10 @@ void install_db(char *datadir) void mysql_install_db() { - char temp[PATH_MAX]; + char temp[FN_REFLEN]; /* var directory */ - snprintf(temp, PATH_MAX, "%s/var", mysql_test_dir); + snprintf(temp, FN_REFLEN, "%s/var", mysql_test_dir); /* clean up old direcotry */ del_tree(temp); @@ -315,41 +315,41 @@ void mysql_install_db() mkdir(temp, S_IRWXU); /* create subdirectories */ mlog("Creating test-suite folders...\n"); - snprintf(temp, PATH_MAX, "%s/var/run", mysql_test_dir); + snprintf(temp, FN_REFLEN, "%s/var/run", mysql_test_dir); mkdir(temp, S_IRWXU); - snprintf(temp, PATH_MAX, "%s/var/tmp", mysql_test_dir); + snprintf(temp, FN_REFLEN, "%s/var/tmp", mysql_test_dir); mkdir(temp, S_IRWXU); - snprintf(temp, PATH_MAX, "%s/var/master-data", mysql_test_dir); + snprintf(temp, FN_REFLEN, "%s/var/master-data", mysql_test_dir); mkdir(temp, S_IRWXU); - snprintf(temp, PATH_MAX, "%s/var/master-data/mysql", mysql_test_dir); + snprintf(temp, FN_REFLEN, "%s/var/master-data/mysql", mysql_test_dir); mkdir(temp, S_IRWXU); - snprintf(temp, PATH_MAX, "%s/var/master-data/test", mysql_test_dir); + snprintf(temp, FN_REFLEN, "%s/var/master-data/test", mysql_test_dir); mkdir(temp, S_IRWXU); - snprintf(temp, PATH_MAX, "%s/var/slave-data", mysql_test_dir); + snprintf(temp, FN_REFLEN, "%s/var/slave-data", mysql_test_dir); mkdir(temp, S_IRWXU); - snprintf(temp, PATH_MAX, "%s/var/slave-data/mysql", mysql_test_dir); + snprintf(temp, FN_REFLEN, "%s/var/slave-data/mysql", mysql_test_dir); mkdir(temp, S_IRWXU); - snprintf(temp, PATH_MAX, "%s/var/slave-data/test", mysql_test_dir); + snprintf(temp, FN_REFLEN, "%s/var/slave-data/test", mysql_test_dir); mkdir(temp, S_IRWXU); #else mkdir(temp); /* create subdirectories */ mlog("Creating test-suite folders...\n"); - snprintf(temp, PATH_MAX, "%s/var/run", mysql_test_dir); + snprintf(temp, FN_REFLEN, "%s/var/run", mysql_test_dir); mkdir(temp); - snprintf(temp, PATH_MAX, "%s/var/tmp", mysql_test_dir); + snprintf(temp, FN_REFLEN, "%s/var/tmp", mysql_test_dir); mkdir(temp); - snprintf(temp, PATH_MAX, "%s/var/master-data", mysql_test_dir); + snprintf(temp, FN_REFLEN, "%s/var/master-data", mysql_test_dir); mkdir(temp); - snprintf(temp, PATH_MAX, "%s/var/master-data/mysql", mysql_test_dir); + snprintf(temp, FN_REFLEN, "%s/var/master-data/mysql", mysql_test_dir); mkdir(temp); - snprintf(temp, PATH_MAX, "%s/var/master-data/test", mysql_test_dir); + snprintf(temp, FN_REFLEN, "%s/var/master-data/test", mysql_test_dir); mkdir(temp); - snprintf(temp, PATH_MAX, "%s/var/slave-data", mysql_test_dir); + snprintf(temp, FN_REFLEN, "%s/var/slave-data", mysql_test_dir); mkdir(temp); - snprintf(temp, PATH_MAX, "%s/var/slave-data/mysql", mysql_test_dir); + snprintf(temp, FN_REFLEN, "%s/var/slave-data/mysql", mysql_test_dir); mkdir(temp); - snprintf(temp, PATH_MAX, "%s/var/slave-data/test", mysql_test_dir); + snprintf(temp, FN_REFLEN, "%s/var/slave-data/test", mysql_test_dir); mkdir(temp); #endif @@ -372,10 +372,10 @@ void start_master() { arg_list_t al; int err; - char master_out[PATH_MAX]; - char master_err[PATH_MAX]; -/* char temp[PATH_MAX]; */ - char temp2[PATH_MAX]; + char master_out[FN_REFLEN]; + char master_err[FN_REFLEN]; +/* char temp[FN_REFLEN]; */ + char temp2[FN_REFLEN]; /* remove old berkeley db log files that can confuse the server */ removef("%s/log.*", master_dir); @@ -405,7 +405,7 @@ void start_master() FILE *fp; /* create an empty index file */ - snprintf(temp, PATH_MAX, "%s/test/t1.MYI", master_dir); + snprintf(temp, FN_REFLEN, "%s/test/t1.MYI", master_dir); fp= fopen(temp, "wb+"); fputs("1", fp); @@ -418,19 +418,19 @@ void start_master() } /* redirection files */ - snprintf(master_out, PATH_MAX, "%s/var/run/master%u.out", + snprintf(master_out, FN_REFLEN, "%s/var/run/master%u.out", mysql_test_dir, restarts); - snprintf(master_err, PATH_MAX, "%s/var/run/master%u.err", + snprintf(master_err, FN_REFLEN, "%s/var/run/master%u.err", mysql_test_dir, restarts); #ifndef __WIN__ - snprintf(temp2,PATH_MAX,"%s/var",mysql_test_dir); + snprintf(temp2,FN_REFLEN,"%s/var",mysql_test_dir); mkdir(temp2,S_IRWXU); - snprintf(temp2,PATH_MAX,"%s/var/log",mysql_test_dir); + snprintf(temp2,FN_REFLEN,"%s/var/log",mysql_test_dir); mkdir(temp2,S_IRWXU); #else - snprintf(temp2,PATH_MAX,"%s/var",mysql_test_dir); + snprintf(temp2,FN_REFLEN,"%s/var",mysql_test_dir); mkdir(temp2); - snprintf(temp2,PATH_MAX,"%s/var/log",mysql_test_dir); + snprintf(temp2,FN_REFLEN,"%s/var/log",mysql_test_dir); mkdir(temp2); #endif /* args */ @@ -539,8 +539,8 @@ void start_slave() { arg_list_t al; int err; - char slave_out[PATH_MAX]; - char slave_err[PATH_MAX]; + char slave_out[FN_REFLEN]; + char slave_err[FN_REFLEN]; /* skip? */ if (skip_slave) return; @@ -568,7 +568,7 @@ void start_slave() if (strinstr(slave_init_script, "rpl000016-slave.sh") != 0) { /* create empty master.info file */ - snprintf(temp, PATH_MAX, "%s/master.info", slave_dir); + snprintf(temp, FN_REFLEN, "%s/master.info", slave_dir); close(open(temp, O_WRONLY | O_CREAT,S_IRWXU|S_IRWXG|S_IRWXO)); } else if (strinstr(slave_init_script, "rpl000017-slave.sh") != 0) @@ -576,7 +576,7 @@ void start_slave() FILE *fp; /* create a master.info file */ - snprintf(temp, PATH_MAX, "%s/master.info", slave_dir); + snprintf(temp, FN_REFLEN, "%s/master.info", slave_dir); fp= fopen(temp, "wb+"); fputs("master-bin.000001\n", fp); @@ -593,7 +593,7 @@ void start_slave() else if (strinstr(slave_init_script, "rpl_rotate_logs-slave.sh") != 0) { /* create empty master.info file */ - snprintf(temp, PATH_MAX, "%s/master.info", slave_dir); + snprintf(temp, FN_REFLEN, "%s/master.info", slave_dir); close(open(temp, O_WRONLY | O_CREAT,S_IRWXU|S_IRWXG|S_IRWXO)); } #elif !defined(__WIN__) @@ -602,9 +602,9 @@ void start_slave() } /* redirection files */ - snprintf(slave_out, PATH_MAX, "%s/var/run/slave%u.out", + snprintf(slave_out, FN_REFLEN, "%s/var/run/slave%u.out", mysql_test_dir, restarts); - snprintf(slave_err, PATH_MAX, "%s/var/run/slave%u.err", + snprintf(slave_err, FN_REFLEN, "%s/var/run/slave%u.err", mysql_test_dir, restarts); /* args */ @@ -859,14 +859,14 @@ int read_option(char *opt_file, char *opt) { int fd, err; char *p; - char buf[PATH_MAX]; + char buf[FN_REFLEN]; /* copy current option */ - strncpy(buf, opt, PATH_MAX); + strncpy(buf, opt, FN_REFLEN); /* open options file */ fd= open(opt_file, O_RDONLY); - err= read(fd, opt, PATH_MAX); + err= read(fd, opt, FN_REFLEN); close(fd); if (err > 0) @@ -890,7 +890,7 @@ int read_option(char *opt_file, char *opt) /* check for $MYSQL_TEST_DIR */ if ((p= strstr(opt, "$MYSQL_TEST_DIR")) != NULL) { - char temp[PATH_MAX]; + char temp[FN_REFLEN]; *p= 0; @@ -925,7 +925,7 @@ int read_option(char *opt_file, char *opt) void run_test(char *test) { - char temp[PATH_MAX]; + char temp[FN_REFLEN]; const char *rstr; int skip= FALSE, ignore=FALSE; int restart= FALSE; @@ -933,13 +933,13 @@ void run_test(char *test) struct stat info; /* skip tests in the skip list */ - snprintf(temp, PATH_MAX, " %s ", test); + snprintf(temp, FN_REFLEN, " %s ", test); skip= (strinstr(skip_test, temp) != 0); if (skip == FALSE) ignore= (strinstr(ignore_test, temp) != 0); - snprintf(master_init_script, PATH_MAX, "%s/%s-master.sh", test_dir, test); - snprintf(slave_init_script, PATH_MAX, "%s/%s-slave.sh", test_dir, test); + snprintf(master_init_script, FN_REFLEN, "%s/%s-master.sh", test_dir, test); + snprintf(slave_init_script, FN_REFLEN, "%s/%s-slave.sh", test_dir, test); #ifdef __WIN__ if (! stat(master_init_script, &info)) skip= TRUE; @@ -957,14 +957,14 @@ void run_test(char *test) } else if (!skip) /* skip test? */ { - char test_file[PATH_MAX]; - char master_opt_file[PATH_MAX]; - char slave_opt_file[PATH_MAX]; - char slave_master_info_file[PATH_MAX]; - char result_file[PATH_MAX]; - char reject_file[PATH_MAX]; - char out_file[PATH_MAX]; - char err_file[PATH_MAX]; + char test_file[FN_REFLEN]; + char master_opt_file[FN_REFLEN]; + char slave_opt_file[FN_REFLEN]; + char slave_master_info_file[FN_REFLEN]; + char result_file[FN_REFLEN]; + char reject_file[FN_REFLEN]; + char out_file[FN_REFLEN]; + char err_file[FN_REFLEN]; int err; arg_list_t al; #ifdef __WIN__ @@ -981,20 +981,20 @@ void run_test(char *test) if (flag != skip_slave) restart= TRUE; /* create files */ - snprintf(master_opt_file, PATH_MAX, "%s/%s-master.opt", test_dir, test); - snprintf(slave_opt_file, PATH_MAX, "%s/%s-slave.opt", test_dir, test); - snprintf(slave_master_info_file, PATH_MAX, "%s/%s.slave-mi", + snprintf(master_opt_file, FN_REFLEN, "%s/%s-master.opt", test_dir, test); + snprintf(slave_opt_file, FN_REFLEN, "%s/%s-slave.opt", test_dir, test); + snprintf(slave_master_info_file, FN_REFLEN, "%s/%s.slave-mi", test_dir, test); - snprintf(reject_file, PATH_MAX, "%s/%s%s", + snprintf(reject_file, FN_REFLEN, "%s/%s%s", result_dir, test, REJECT_SUFFIX); - snprintf(out_file, PATH_MAX, "%s/%s%s", result_dir, test, OUT_SUFFIX); - snprintf(err_file, PATH_MAX, "%s/%s%s", result_dir, test, ERR_SUFFIX); + snprintf(out_file, FN_REFLEN, "%s/%s%s", result_dir, test, OUT_SUFFIX); + snprintf(err_file, FN_REFLEN, "%s/%s%s", result_dir, test, ERR_SUFFIX); /* netware specific files */ - snprintf(test_file, PATH_MAX, "%s/%s%s", test_dir, test, NW_TEST_SUFFIX); + snprintf(test_file, FN_REFLEN, "%s/%s%s", test_dir, test, NW_TEST_SUFFIX); if (stat(test_file, &info)) { - snprintf(test_file, PATH_MAX, "%s/%s%s", test_dir, test, TEST_SUFFIX); + snprintf(test_file, FN_REFLEN, "%s/%s%s", test_dir, test, TEST_SUFFIX); if (access(test_file,0)) { printf("Invalid test name %s, %s file not found\n",test,test_file); @@ -1002,11 +1002,11 @@ void run_test(char *test) } } - snprintf(result_file, PATH_MAX, "%s/%s%s", + snprintf(result_file, FN_REFLEN, "%s/%s%s", result_dir, test, NW_RESULT_SUFFIX); if (stat(result_file, &info)) { - snprintf(result_file, PATH_MAX, "%s/%s%s", + snprintf(result_file, FN_REFLEN, "%s/%s%s", result_dir, test, RESULT_SUFFIX); } @@ -1248,8 +1248,8 @@ void die(const char *msg) void setup(char *file __attribute__((unused))) { - char temp[PATH_MAX]; - char file_path[PATH_MAX*2]; + char temp[FN_REFLEN]; + char file_path[FN_REFLEN*2]; char *p; int position; @@ -1257,14 +1257,14 @@ void setup(char *file __attribute__((unused))) #ifdef __WIN__ _putenv( "TZ=GMT-3" ); #else - setenv("TZ", "GMT-3", TRUE); + putenv((char *)"TZ=GMT-3"); #endif /* find base dir */ #ifdef __NETWARE__ strcpy(temp, strlwr(file)); while ((p= strchr(temp, '\\')) != NULL) *p= '/'; #else - getcwd(temp, PATH_MAX); + getcwd(temp, FN_REFLEN); position= strlen(temp); temp[position]= '/'; temp[position+1]= 0; @@ -1284,100 +1284,100 @@ void setup(char *file __attribute__((unused))) #ifdef __NETWARE__ /* setup paths */ - snprintf(bin_dir, PATH_MAX, "%s/bin", base_dir); - snprintf(mysql_test_dir, PATH_MAX, "%s/mysql-test", base_dir); - snprintf(test_dir, PATH_MAX, "%s/t", mysql_test_dir); - snprintf(mysql_tmp_dir, PATH_MAX, "%s/var/tmp", mysql_test_dir); - snprintf(result_dir, PATH_MAX, "%s/r", mysql_test_dir); - snprintf(master_dir, PATH_MAX, "%s/var/master-data", mysql_test_dir); - snprintf(slave_dir, PATH_MAX, "%s/var/slave-data", mysql_test_dir); - snprintf(lang_dir, PATH_MAX, "%s/share/english", base_dir); - snprintf(char_dir, PATH_MAX, "%s/share/charsets", base_dir); + snprintf(bin_dir, FN_REFLEN, "%s/bin", base_dir); + snprintf(mysql_test_dir, FN_REFLEN, "%s/mysql-test", base_dir); + snprintf(test_dir, FN_REFLEN, "%s/t", mysql_test_dir); + snprintf(mysql_tmp_dir, FN_REFLEN, "%s/var/tmp", mysql_test_dir); + snprintf(result_dir, FN_REFLEN, "%s/r", mysql_test_dir); + snprintf(master_dir, FN_REFLEN, "%s/var/master-data", mysql_test_dir); + snprintf(slave_dir, FN_REFLEN, "%s/var/slave-data", mysql_test_dir); + snprintf(lang_dir, FN_REFLEN, "%s/share/english", base_dir); + snprintf(char_dir, FN_REFLEN, "%s/share/charsets", base_dir); #ifdef HAVE_OPENSSL use_openssl= TRUE; #endif /* HAVE_OPENSSL */ /* OpenSSL paths */ - snprintf(ca_cert, PATH_MAX, "%s/SSL/cacert.pem", base_dir); - snprintf(server_cert, PATH_MAX, "%s/SSL/server-cert.pem", base_dir); - snprintf(server_key, PATH_MAX, "%s/SSL/server-key.pem", base_dir); - snprintf(client_cert, PATH_MAX, "%s/SSL/client-cert.pem", base_dir); - snprintf(client_key, PATH_MAX, "%s/SSL/client-key.pem", base_dir); + snprintf(ca_cert, FN_REFLEN, "%s/SSL/cacert.pem", base_dir); + snprintf(server_cert, FN_REFLEN, "%s/SSL/server-cert.pem", base_dir); + snprintf(server_key, FN_REFLEN, "%s/SSL/server-key.pem", base_dir); + snprintf(client_cert, FN_REFLEN, "%s/SSL/client-cert.pem", base_dir); + snprintf(client_key, FN_REFLEN, "%s/SSL/client-key.pem", base_dir); /* setup files */ - snprintf(mysqld_file, PATH_MAX, "%s/mysqld", bin_dir); - snprintf(mysqltest_file, PATH_MAX, "%s/mysqltest", bin_dir); - snprintf(mysqladmin_file, PATH_MAX, "%s/mysqladmin", bin_dir); - snprintf(master_pid, PATH_MAX, "%s/var/run/master.pid", mysql_test_dir); - snprintf(slave_pid, PATH_MAX, "%s/var/run/slave.pid", mysql_test_dir); + snprintf(mysqld_file, FN_REFLEN, "%s/mysqld", bin_dir); + snprintf(mysqltest_file, FN_REFLEN, "%s/mysqltest", bin_dir); + snprintf(mysqladmin_file, FN_REFLEN, "%s/mysqladmin", bin_dir); + snprintf(master_pid, FN_REFLEN, "%s/var/run/master.pid", mysql_test_dir); + snprintf(slave_pid, FN_REFLEN, "%s/var/run/slave.pid", mysql_test_dir); #elif __WIN__ /* setup paths */ #ifdef _DEBUG - snprintf(bin_dir, PATH_MAX, "%s/client_debug", base_dir); + snprintf(bin_dir, FN_REFLEN, "%s/client_debug", base_dir); #else - snprintf(bin_dir, PATH_MAX, "%s/client_release", base_dir); + snprintf(bin_dir, FN_REFLEN, "%s/client_release", base_dir); #endif - snprintf(mysql_test_dir, PATH_MAX, "%s/mysql-test", base_dir); - snprintf(test_dir, PATH_MAX, "%s/t", mysql_test_dir); - snprintf(mysql_tmp_dir, PATH_MAX, "%s/var/tmp", mysql_test_dir); - snprintf(result_dir, PATH_MAX, "%s/r", mysql_test_dir); - snprintf(master_dir, PATH_MAX, "%s/var/master-data", mysql_test_dir); - snprintf(slave_dir, PATH_MAX, "%s/var/slave-data", mysql_test_dir); - snprintf(lang_dir, PATH_MAX, "%s/share/english", base_dir); - snprintf(char_dir, PATH_MAX, "%s/share/charsets", base_dir); + snprintf(mysql_test_dir, FN_REFLEN, "%s/mysql-test", base_dir); + snprintf(test_dir, FN_REFLEN, "%s/t", mysql_test_dir); + snprintf(mysql_tmp_dir, FN_REFLEN, "%s/var/tmp", mysql_test_dir); + snprintf(result_dir, FN_REFLEN, "%s/r", mysql_test_dir); + snprintf(master_dir, FN_REFLEN, "%s/var/master-data", mysql_test_dir); + snprintf(slave_dir, FN_REFLEN, "%s/var/slave-data", mysql_test_dir); + snprintf(lang_dir, FN_REFLEN, "%s/share/english", base_dir); + snprintf(char_dir, FN_REFLEN, "%s/share/charsets", base_dir); #ifdef HAVE_OPENSSL use_openssl= TRUE; #endif /* HAVE_OPENSSL */ /* OpenSSL paths */ - snprintf(ca_cert, PATH_MAX, "%s/SSL/cacert.pem", base_dir); - snprintf(server_cert, PATH_MAX, "%s/SSL/server-cert.pem", base_dir); - snprintf(server_key, PATH_MAX, "%s/SSL/server-key.pem", base_dir); - snprintf(client_cert, PATH_MAX, "%s/SSL/client-cert.pem", base_dir); - snprintf(client_key, PATH_MAX, "%s/SSL/client-key.pem", base_dir); + snprintf(ca_cert, FN_REFLEN, "%s/SSL/cacert.pem", base_dir); + snprintf(server_cert, FN_REFLEN, "%s/SSL/server-cert.pem", base_dir); + snprintf(server_key, FN_REFLEN, "%s/SSL/server-key.pem", base_dir); + snprintf(client_cert, FN_REFLEN, "%s/SSL/client-cert.pem", base_dir); + snprintf(client_key, FN_REFLEN, "%s/SSL/client-key.pem", base_dir); /* setup files */ - snprintf(mysqld_file, PATH_MAX, "%s/mysqld.exe", bin_dir); - snprintf(mysqltest_file, PATH_MAX, "%s/mysqltest.exe", bin_dir); - snprintf(mysqladmin_file, PATH_MAX, "%s/mysqladmin.exe", bin_dir); + snprintf(mysqld_file, FN_REFLEN, "%s/mysqld.exe", bin_dir); + snprintf(mysqltest_file, FN_REFLEN, "%s/mysqltest.exe", bin_dir); + snprintf(mysqladmin_file, FN_REFLEN, "%s/mysqladmin.exe", bin_dir); #else /* setup paths */ - snprintf(bin_dir, PATH_MAX, "%s/client", base_dir); - snprintf(mysql_test_dir, PATH_MAX, "%s/mysql-test", base_dir); - snprintf(test_dir, PATH_MAX, "%s/t", mysql_test_dir); - snprintf(mysql_tmp_dir, PATH_MAX, "%s/var/tmp", mysql_test_dir); - snprintf(result_dir, PATH_MAX, "%s/r", mysql_test_dir); - snprintf(master_dir, PATH_MAX, "%s/var/master-data", mysql_test_dir); - snprintf(slave_dir, PATH_MAX, "%s/var/slave-data", mysql_test_dir); - snprintf(lang_dir, PATH_MAX, "%s/sql/share/english", base_dir); - snprintf(char_dir, PATH_MAX, "%s/sql/share/charsets", base_dir); + snprintf(bin_dir, FN_REFLEN, "%s/client", base_dir); + snprintf(mysql_test_dir, FN_REFLEN, "%s/mysql-test", base_dir); + snprintf(test_dir, FN_REFLEN, "%s/t", mysql_test_dir); + snprintf(mysql_tmp_dir, FN_REFLEN, "%s/var/tmp", mysql_test_dir); + snprintf(result_dir, FN_REFLEN, "%s/r", mysql_test_dir); + snprintf(master_dir, FN_REFLEN, "%s/var/master-data", mysql_test_dir); + snprintf(slave_dir, FN_REFLEN, "%s/var/slave-data", mysql_test_dir); + snprintf(lang_dir, FN_REFLEN, "%s/sql/share/english", base_dir); + snprintf(char_dir, FN_REFLEN, "%s/sql/share/charsets", base_dir); #ifdef HAVE_OPENSSL use_openssl= TRUE; #endif /* HAVE_OPENSSL */ /* OpenSSL paths */ - snprintf(ca_cert, PATH_MAX, "%s/SSL/cacert.pem", base_dir); - snprintf(server_cert, PATH_MAX, "%s/SSL/server-cert.pem", base_dir); - snprintf(server_key, PATH_MAX, "%s/SSL/server-key.pem", base_dir); - snprintf(client_cert, PATH_MAX, "%s/SSL/client-cert.pem", base_dir); - snprintf(client_key, PATH_MAX, "%s/SSL/client-key.pem", base_dir); + snprintf(ca_cert, FN_REFLEN, "%s/SSL/cacert.pem", base_dir); + snprintf(server_cert, FN_REFLEN, "%s/SSL/server-cert.pem", base_dir); + snprintf(server_key, FN_REFLEN, "%s/SSL/server-key.pem", base_dir); + snprintf(client_cert, FN_REFLEN, "%s/SSL/client-cert.pem", base_dir); + snprintf(client_key, FN_REFLEN, "%s/SSL/client-key.pem", base_dir); /* setup files */ - snprintf(mysqld_file, PATH_MAX, "%s/sql/mysqld", base_dir); - snprintf(mysqltest_file, PATH_MAX, "%s/mysqltest", bin_dir); - snprintf(mysqladmin_file, PATH_MAX, "%s/mysqladmin", bin_dir); - snprintf(master_pid, PATH_MAX, "%s/var/run/master.pid", mysql_test_dir); - snprintf(slave_pid, PATH_MAX, "%s/var/run/slave.pid", mysql_test_dir); + snprintf(mysqld_file, FN_REFLEN, "%s/sql/mysqld", base_dir); + snprintf(mysqltest_file, FN_REFLEN, "%s/mysqltest", bin_dir); + snprintf(mysqladmin_file, FN_REFLEN, "%s/mysqladmin", bin_dir); + snprintf(master_pid, FN_REFLEN, "%s/var/run/master.pid", mysql_test_dir); + snprintf(slave_pid, FN_REFLEN, "%s/var/run/slave.pid", mysql_test_dir); - snprintf(master_socket,PATH_MAX, "%s/var/tmp/master.sock", mysql_test_dir); - snprintf(slave_socket,PATH_MAX, "%s/var/tmp/slave.sock", mysql_test_dir); + snprintf(master_socket,FN_REFLEN, "%s/var/tmp/master.sock", mysql_test_dir); + snprintf(slave_socket,FN_REFLEN, "%s/var/tmp/slave.sock", mysql_test_dir); #endif /* create log file */ - snprintf(temp, PATH_MAX, "%s/mysql-test-run.log", mysql_test_dir); + snprintf(temp, FN_REFLEN, "%s/mysql-test-run.log", mysql_test_dir); if ((log_fd= fopen(temp, "w+")) == NULL) { log_errno("Unable to create log file."); @@ -1386,46 +1386,47 @@ void setup(char *file __attribute__((unused))) /* prepare skip test list */ while ((p= strchr(skip_test, ',')) != NULL) *p= ' '; strcpy(temp, strlwr(skip_test)); - snprintf(skip_test, PATH_MAX, " %s ", temp); + snprintf(skip_test, FN_REFLEN, " %s ", temp); /* environment */ #ifdef __NETWARE__ setenv("MYSQL_TEST_DIR", mysql_test_dir, 1); - snprintf(file_path, PATH_MAX*2, + snprintf(file_path, FN_REFLEN*2, "%s/client/mysqldump --no-defaults -u root --port=%u", bin_dir, master_port); setenv("MYSQL_DUMP", file_path, 1); - snprintf(file_path, PATH_MAX*2, + snprintf(file_path, FN_REFLEN*2, "%s/client/mysqlbinlog --no-defaults --local-load=%s", bin_dir, mysql_tmp_dir); setenv("MYSQL_BINLOG", file_path, 1); #elif __WIN__ - snprintf(file_path,MAX_PATH,"MYSQL_TEST_DIR=%s",mysql_test_dir); + snprintf(file_path,FN_REFLEN,"MYSQL_TEST_DIR=%s",mysql_test_dir); _putenv(file_path); - snprintf(file_path, PATH_MAX*2, + snprintf(file_path, FN_REFLEN*2, "MYSQL_DUMP=%s/mysqldump.exe --no-defaults -u root --port=%u", bin_dir, master_port); _putenv(file_path); - snprintf(file_path, PATH_MAX*2, + snprintf(file_path, FN_REFLEN*2, "MYSQL_BINLOG=%s/mysqlbinlog.exe --no-defaults --local-load=%s", bin_dir, mysql_tmp_dir); _putenv(file_path); #else - setenv("MYSQL_TEST_DIR", mysql_test_dir, 1); - snprintf(file_path, PATH_MAX*2, - "%s/mysqldump --no-defaults -u root --port=%u --socket=%s", + snprintf(file_path,FN_REFLEN,"MYSQL_TEST_DIR=%s",mysql_test_dir); + putenv(file_path); + snprintf(file_path, FN_REFLEN*2, + "MYSQL_DUMP=%s/mysqldump --no-defaults -u root --port=%u --socket=%s", bin_dir, master_port, master_socket); - setenv("MYSQL_DUMP", file_path, 1); - snprintf(file_path, PATH_MAX*2, - "%s/mysqlbinlog --no-defaults --local-load=%s", + putenv(file_path); + snprintf(file_path, FN_REFLEN*2, + "MYSQL_BINLOG=%s/mysqlbinlog --no-defaults --local-load=%s", bin_dir, mysql_tmp_dir); - setenv("MYSQL_BINLOG", file_path, 1); + putenv(file_path); #endif #ifndef __WIN__ - setenv("MASTER_MYPORT", "9306", 1); - setenv("SLAVE_MYPORT", "9307", 1); - setenv("MYSQL_TCP_PORT", "3306", 1); + putenv((char *)"MASTER_MYPORT=9306"); + putenv((char *)"SLAVE_MYPORT=9307"); + putenv((char *)"MYSQL_TCP_PORT=3306"); #else _putenv("MASTER_MYPORT=9306"); _putenv("SLAVE_MYPORT=9307"); @@ -1461,7 +1462,7 @@ int main(int argc, char **argv) temp= strdup(strchr(argv[1],'=') + 1); for (token=str_tok(temp, ","); token != NULL; token=str_tok(NULL, ",")) { - if (strlen(ignore_test) + strlen(token) + 2 <= PATH_MAX-1) + if (strlen(ignore_test) + strlen(token) + 2 <= FN_REFLEN-1) sprintf(ignore_test+strlen(ignore_test), " %s ", token); else { @@ -1507,38 +1508,35 @@ int main(int argc, char **argv) { /* run all tests */ #ifndef __WIN__ - struct dirent **namelist; - int i,n; - char test[NAME_MAX]; - char *p; + struct dirent *entry; + DIR *parent; + char test[FN_LEN]; int position; - n= scandir(test_dir, &namelist, 0, alphasort); - if (n < 0) + /* FIXME are we sure the list is sorted if using readdir()? */ + if ((parent= opendir(test_dir)) == NULL) /* Not thread safe */ die("Unable to open tests directory."); else { - for (i= 0; i < n; i++) + while ((entry= readdir(parent)) != NULL) /* Not thread safe */ { - strcpy(test, strlwr(namelist[i]->d_name)); + strcpy(test, strlwr(entry->d_name)); /* find the test suffix */ if ((position= strinstr(test, TEST_SUFFIX)) != 0) { - p= test + position - 1; /* null terminate at the suffix */ - *p= 0; + *(test + position - 1)= '\0'; /* run test */ run_test(test); } - free(namelist[n]); } - free(namelist); + closedir(parent); } #else struct _finddata_t dir; intptr_t handle; - char test[NAME_MAX]; - char mask[PATH_MAX]; + char test[FN_LEN]; + char mask[FN_REFLEN]; char *p; int position; char **names= 0; @@ -1549,7 +1547,7 @@ int main(int argc, char **argv) /* single test */ single_test= FALSE; - snprintf(mask,MAX_PATH,"%s/*.test",test_dir); + snprintf(mask,FN_REFLEN,"%s/*.test",test_dir); if ((handle=_findfirst(mask,&dir)) == -1L) { @@ -1574,7 +1572,7 @@ int main(int argc, char **argv) *p= 0; /* insert test */ - *names= malloc(PATH_MAX); + *names= malloc(FN_REFLEN); strcpy(*names,test); names++; name_index++; From 4c26186b4723f8cb9c44b1c9b0314d54d532f826 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 9 Nov 2004 19:39:29 +0000 Subject: [PATCH 0153/1063] added management function to purge stale sessions in the management server ndb/include/util/Bitmask.hpp: added bitXORC ndb/include/util/SocketServer.hpp: added method to apply function on each session ndb/src/common/util/SocketServer.cpp: added method to apply function on each session --- ndb/include/mgmapi/mgmapi.h | 1 + ndb/include/util/Bitmask.hpp | 34 +++++++++ ndb/include/util/SocketServer.hpp | 4 +- ndb/src/common/util/SocketServer.cpp | 15 +++- ndb/src/mgmapi/mgmapi.cpp | 42 +++++++++++ ndb/src/mgmclient/CommandInterpreter.cpp | 46 +++++++++++++ ndb/src/mgmsrv/MgmtSrvr.cpp | 88 +++++++++++++++++++++--- ndb/src/mgmsrv/MgmtSrvr.hpp | 11 ++- ndb/src/mgmsrv/Services.cpp | 42 +++++++++++ ndb/src/mgmsrv/Services.hpp | 6 +- ndb/src/mgmsrv/main.cpp | 3 +- 11 files changed, 274 insertions(+), 18 deletions(-) diff --git a/ndb/include/mgmapi/mgmapi.h b/ndb/include/mgmapi/mgmapi.h index 6dcf58b44e2..f1ef357421b 100644 --- a/ndb/include/mgmapi/mgmapi.h +++ b/ndb/include/mgmapi/mgmapi.h @@ -733,6 +733,7 @@ extern "C" { int param, unsigned long long * value); int ndb_mgm_get_string_parameter(const ndb_mgm_configuration_iterator*, int param, const char ** value); + int ndb_mgm_purge_stale_sessions(NdbMgmHandle handle, char **); #ifdef __cplusplus } #endif diff --git a/ndb/include/util/Bitmask.hpp b/ndb/include/util/Bitmask.hpp index bb217adab5f..19aa604e4a1 100644 --- a/ndb/include/util/Bitmask.hpp +++ b/ndb/include/util/Bitmask.hpp @@ -104,6 +104,11 @@ public: */ static void bitXOR(unsigned size, Uint32 data[], const Uint32 data2[]); + /** + * bitXORC - Bitwise (x ^ ~y) into first operand. + */ + static void bitXORC(unsigned size, Uint32 data[], const Uint32 data2[]); + /** * contains - Check if all bits set in data2 are set in data */ @@ -261,6 +266,14 @@ BitmaskImpl::bitXOR(unsigned size, Uint32 data[], const Uint32 data2[]) } } +inline void +BitmaskImpl::bitXORC(unsigned size, Uint32 data[], const Uint32 data2[]) +{ + for (unsigned i = 0; i < size; i++) { + data[i] ^= ~data2[i]; + } +} + inline bool BitmaskImpl::contains(unsigned size, Uint32 data[], const Uint32 data2[]) { @@ -451,6 +464,12 @@ public: static void bitXOR(Uint32 data[], const Uint32 data2[]); BitmaskPOD& bitXOR(const BitmaskPOD& mask2); + /** + * bitXORC - Bitwise (x ^ ~y) into first operand. + */ + static void bitXORC(Uint32 data[], const Uint32 data2[]); + BitmaskPOD& bitXORC(const BitmaskPOD& mask2); + /** * contains - Check if all bits set in data2 (that) are also set in data (this) */ @@ -712,6 +731,21 @@ BitmaskPOD::bitXOR(const BitmaskPOD& mask2) return *this; } +template +inline void +BitmaskPOD::bitXORC(Uint32 data[], const Uint32 data2[]) +{ + BitmaskImpl::bitXORC(size,data, data2); +} + +template +inline BitmaskPOD& +BitmaskPOD::bitXORC(const BitmaskPOD& mask2) +{ + BitmaskPOD::bitXORC(rep.data, mask2.rep.data); + return *this; +} + template char * BitmaskPOD::getText(const Uint32 data[], char* buf) diff --git a/ndb/include/util/SocketServer.hpp b/ndb/include/util/SocketServer.hpp index 3860b9ca84b..2fad991e5f8 100644 --- a/ndb/include/util/SocketServer.hpp +++ b/ndb/include/util/SocketServer.hpp @@ -37,7 +37,7 @@ public: public: virtual ~Session() {} virtual void runSession(){} - virtual void stopSession(){} + virtual void stopSession(){ m_stop = true; } protected: friend class SocketServer; friend void* sessionThread_C(void*); @@ -98,6 +98,8 @@ public: */ void stopSessions(bool wait = false); + void foreachSession(void (*f)(SocketServer::Session*, void*), void *data); + private: struct SessionInstance { Service * m_service; diff --git a/ndb/src/common/util/SocketServer.cpp b/ndb/src/common/util/SocketServer.cpp index c3cffa1399b..8bee256684d 100644 --- a/ndb/src/common/util/SocketServer.cpp +++ b/ndb/src/common/util/SocketServer.cpp @@ -258,6 +258,15 @@ transfer(NDB_SOCKET_TYPE sock){ return true; } +void +SocketServer::foreachSession(void (*func)(SocketServer::Session*, void *), void *data) +{ + for(int i = m_sessions.size() - 1; i >= 0; i--){ + (*func)(m_sessions[i].m_session, data); + } + checkSessions(); +} + void SocketServer::checkSessions(){ for(int i = m_sessions.size() - 1; i >= 0; i--){ @@ -278,8 +287,10 @@ void SocketServer::stopSessions(bool wait){ int i; for(i = m_sessions.size() - 1; i>=0; i--) - m_sessions[i].m_session->m_stop = true; - + { + m_sessions[i].m_session->stopSession(); + m_sessions[i].m_session->m_stop = true; // to make sure + } for(i = m_services.size() - 1; i>=0; i--) m_services[i].m_service->stopSessions(); diff --git a/ndb/src/mgmapi/mgmapi.cpp b/ndb/src/mgmapi/mgmapi.cpp index 4b62df968b3..66f0dbb1842 100644 --- a/ndb/src/mgmapi/mgmapi.cpp +++ b/ndb/src/mgmapi/mgmapi.cpp @@ -1834,4 +1834,46 @@ ndb_mgm_set_string_parameter(NdbMgmHandle handle, return res; } +extern "C" +int +ndb_mgm_purge_stale_sessions(NdbMgmHandle handle, char **purged){ + CHECK_HANDLE(handle, 0); + CHECK_CONNECTED(handle, 0); + + Properties args; + + const ParserRow reply[]= { + MGM_CMD("purge stale sessions reply", NULL, ""), + MGM_ARG("purged", String, Optional, ""), + MGM_ARG("result", String, Mandatory, "Error message"), + MGM_END() + }; + + const Properties *prop; + prop= ndb_mgm_call(handle, reply, "purge stale sessions", &args); + + if(prop == NULL) { + SET_ERROR(handle, EIO, "Unable to purge stale sessions"); + return -1; + } + + int res= -1; + do { + const char * buf; + if(!prop->get("result", &buf) || strcmp(buf, "Ok") != 0){ + ndbout_c("ERROR Message: %s\n", buf); + break; + } + if (purged) { + if (prop->get("purged", &buf)) + *purged= strdup(buf); + else + *purged= 0; + } + res= 0; + } while(0); + delete prop; + return res; +} + template class Vector*>; diff --git a/ndb/src/mgmclient/CommandInterpreter.cpp b/ndb/src/mgmclient/CommandInterpreter.cpp index e802ffff5ce..523c271ed9e 100644 --- a/ndb/src/mgmclient/CommandInterpreter.cpp +++ b/ndb/src/mgmclient/CommandInterpreter.cpp @@ -106,6 +106,7 @@ private: */ void executeHelp(char* parameters); void executeShow(char* parameters); + void executePurge(char* parameters); void executeShutdown(char* parameters); void executeRun(char* parameters); void executeInfo(char* parameters); @@ -264,6 +265,7 @@ static const char* helpText = #ifdef HAVE_GLOBAL_REPLICATION "REP CONNECT Connect to REP server on host:port\n" #endif +"PURGE STALE SESSIONS Reset reserved nodeid's in the mgmt server\n" "QUIT Quit management client\n" ; @@ -541,6 +543,10 @@ CommandInterpreter::execute(const char *_line, int _try_reconnect) executeAbortBackup(allAfterFirstToken); return true; } + else if (strcmp(firstToken, "PURGE") == 0) { + executePurge(allAfterFirstToken); + return true; + } #ifdef HAVE_GLOBAL_REPLICATION else if(strcmp(firstToken, "REPLICATION") == 0 || strcmp(firstToken, "REP") == 0) { @@ -982,6 +988,46 @@ print_nodes(ndb_mgm_cluster_state *state, ndb_mgm_configuration_iterator *it, ndbout << endl; } +void +CommandInterpreter::executePurge(char* parameters) +{ + int command_ok= 0; + do { + if (emptyString(parameters)) + break; + char* firstToken = strtok(parameters, " "); + char* nextToken = strtok(NULL, " \0"); + if (strcmp(firstToken,"STALE") == 0 && + nextToken && + strcmp(nextToken, "SESSIONS") == 0) { + command_ok= 1; + break; + } + } while(0); + + if (!command_ok) { + ndbout_c("Unexpected command, expected: PURGE STALE SESSIONS"); + return; + } + + int i; + char *str; + connect(); + + if (ndb_mgm_purge_stale_sessions(m_mgmsrv, &str)) { + ndbout_c("Command failed"); + return; + } + if (str) { + ndbout_c("Purged sessions with node id's: %s", str); + free(str); + } + else + { + ndbout_c("No sessions purged"); + } +} + void CommandInterpreter::executeShow(char* parameters) { diff --git a/ndb/src/mgmsrv/MgmtSrvr.cpp b/ndb/src/mgmsrv/MgmtSrvr.cpp index 2e30d73290b..a49b29af275 100644 --- a/ndb/src/mgmsrv/MgmtSrvr.cpp +++ b/ndb/src/mgmsrv/MgmtSrvr.cpp @@ -400,11 +400,13 @@ MgmtSrvr::getPort() const { /* Constructor */ MgmtSrvr::MgmtSrvr(NodeId nodeId, + SocketServer *socket_server, const BaseString &configFilename, LocalConfig &local_config, Config * config): _blockNumber(1), // Hard coded block number since it makes it easy to send // signals to other management servers. + m_socket_server(socket_server), _ownReference(0), m_local_config(local_config), theSignalIdleList(NULL), @@ -2094,6 +2096,25 @@ MgmtSrvr::getNodeType(NodeId nodeId) const return nodeTypes[nodeId]; } +void +MgmtSrvr::get_connected_nodes(NodeBitmask &connected_nodes) const +{ + if (theFacade && theFacade->theClusterMgr) + { + for(Uint32 i = 0; i < MAX_NODES; i++) + { + if (getNodeType(i) == NDB_MGM_NODE_TYPE_NDB) + { + const ClusterMgr::Node &node= theFacade->theClusterMgr->getNodeInfo(i); + if (node.connected) + { + connected_nodes.bitOR(node.m_state.m_connected_nodes); + } + } + } + } +} + bool MgmtSrvr::alloc_node_id(NodeId * nodeId, enum ndb_mgm_node_type type, @@ -2106,7 +2127,7 @@ MgmtSrvr::alloc_node_id(NodeId * nodeId, *nodeId, type, client_addr)); if (g_no_nodeid_checks) { if (*nodeId == 0) { - error_string.appfmt("no-nodeid-ckecks set in manegment server.\n" + error_string.appfmt("no-nodeid-checks set in management server.\n" "node id must be set explicitly in connectstring"); DBUG_RETURN(false); } @@ -2115,16 +2136,11 @@ MgmtSrvr::alloc_node_id(NodeId * nodeId, Guard g(m_node_id_mutex); int no_mgm= 0; NodeBitmask connected_nodes(m_reserved_nodes); - for(Uint32 i = 0; i < MAX_NODES; i++) + get_connected_nodes(connected_nodes); { - if (getNodeType(i) == NDB_MGM_NODE_TYPE_NDB && - theFacade && theFacade->theClusterMgr) { - const ClusterMgr::Node &node= theFacade->theClusterMgr->getNodeInfo(i); - if (node.connected) { - connected_nodes.bitOR(node.m_state.m_connected_nodes); - } - } else if (getNodeType(i) == NDB_MGM_NODE_TYPE_MGM) - no_mgm++; + for(Uint32 i = 0; i < MAX_NODES; i++) + if (getNodeType(i) == NDB_MGM_NODE_TYPE_MGM) + no_mgm++; } bool found_matching_id= false; bool found_matching_type= false; @@ -2227,6 +2243,10 @@ MgmtSrvr::alloc_node_id(NodeId * nodeId, m_connect_address[id_found].s_addr= 0; } m_reserved_nodes.set(id_found); + char tmp_str[128]; + m_reserved_nodes.getText(tmp_str); + g_EventLogger.info("Mgmt server state: nodeid %d reserved for ip %s, m_reserved_nodes %s.", + id_found, get_connect_address(id_found), tmp_str); DBUG_RETURN(true); } @@ -2283,6 +2303,36 @@ MgmtSrvr::alloc_node_id(NodeId * nodeId, error_string.appfmt("No node defined with id=%d in config file.", *nodeId); } + + g_EventLogger.warning("Allocate nodeid (%d) failed. Connection from ip %s. " + "Returned error string \"%s\"", + *nodeId, + client_addr != 0 ? inet_ntoa(((struct sockaddr_in *)(client_addr))->sin_addr) : "", + error_string.c_str()); + + NodeBitmask connected_nodes2; + get_connected_nodes(connected_nodes2); + { + BaseString tmp_connected, tmp_not_connected; + for(Uint32 i = 0; i < MAX_NODES; i++) + { + if (connected_nodes2.get(i)) + { + if (!m_reserved_nodes.get(i)) + tmp_connected.appfmt(" %d", i); + } + else if (m_reserved_nodes.get(i)) + { + tmp_not_connected.appfmt(" %d", i); + } + } + if (tmp_connected.length() > 0) + g_EventLogger.info("Mgmt server state: node id's %s connected but not reserved", + tmp_connected.c_str()); + if (tmp_not_connected.length() > 0) + g_EventLogger.info("Mgmt server state: node id's %s not connected but reserved", + tmp_not_connected.c_str()); + } DBUG_RETURN(false); } @@ -2531,10 +2581,15 @@ MgmtSrvr::Allocated_resources::~Allocated_resources() { Guard g(m_mgmsrv.m_node_id_mutex); if (!m_reserved_nodes.isclear()) { + m_mgmsrv.m_reserved_nodes.bitANDC(m_reserved_nodes); // node has been reserved, force update signal to ndb nodes global_flag_send_heartbeat_now= 1; + + char tmp_str[128]; + m_mgmsrv.m_reserved_nodes.getText(tmp_str); + g_EventLogger.info("Mgmt server state: nodeid %d freed, m_reserved_nodes %s.", + get_nodeid(), tmp_str); } - m_mgmsrv.m_reserved_nodes.bitANDC(m_reserved_nodes); } void @@ -2543,6 +2598,17 @@ MgmtSrvr::Allocated_resources::reserve_node(NodeId id) m_reserved_nodes.set(id); } +NodeId +MgmtSrvr::Allocated_resources::get_nodeid() const +{ + for(Uint32 i = 0; i < MAX_NODES; i++) + { + if (m_reserved_nodes.get(i)) + return i; + } + return 0; +} + int MgmtSrvr::setDbParameter(int node, int param, const char * value, BaseString& msg){ diff --git a/ndb/src/mgmsrv/MgmtSrvr.hpp b/ndb/src/mgmsrv/MgmtSrvr.hpp index c796e1e9219..b3257491123 100644 --- a/ndb/src/mgmsrv/MgmtSrvr.hpp +++ b/ndb/src/mgmsrv/MgmtSrvr.hpp @@ -96,7 +96,10 @@ public: // methods to reserve/allocate resources which // will be freed when running destructor void reserve_node(NodeId id); - bool is_reserved(NodeId nodeId) { return m_reserved_nodes.get(nodeId);} + bool is_reserved(NodeId nodeId) { return m_reserved_nodes.get(nodeId); } + bool is_reserved(NodeBitmask mask) { return !mask.bitAND(m_reserved_nodes).isclear(); } + bool isclear() { return m_reserved_nodes.isclear(); } + NodeId get_nodeid() const; private: MgmtSrvr &m_mgmsrv; NodeBitmask m_reserved_nodes; @@ -173,6 +176,7 @@ public: /* Constructor */ MgmtSrvr(NodeId nodeId, /* Local nodeid */ + SocketServer *socket_server, const BaseString &config_filename, /* Where to save config */ LocalConfig &local_config, /* Ndb.cfg filename */ Config * config); @@ -499,6 +503,9 @@ public: int setDbParameter(int node, int parameter, const char * value, BaseString&); const char *get_connect_address(Uint32 node_id) { return inet_ntoa(m_connect_address[node_id]); } + void get_connected_nodes(NodeBitmask &connected_nodes) const; + SocketServer *get_socket_server() { return m_socket_server; } + //************************************************************************** private: //************************************************************************** @@ -525,6 +532,8 @@ private: int _blockNumber; NodeId _ownNodeId; + SocketServer *m_socket_server; + BlockReference _ownReference; NdbMutex *m_configMutex; const Config * _config; diff --git a/ndb/src/mgmsrv/Services.cpp b/ndb/src/mgmsrv/Services.cpp index 2672d8c9d4b..0394c4e80bb 100644 --- a/ndb/src/mgmsrv/Services.cpp +++ b/ndb/src/mgmsrv/Services.cpp @@ -242,6 +242,8 @@ ParserRow commands[] = { MGM_ARG("node", Int, Optional, "Node"), MGM_ARG("filter", String, Mandatory, "Event category"), + MGM_CMD("purge stale sessions", &MgmApiSession::purge_stale_sessions, ""), + MGM_END() }; @@ -1412,6 +1414,46 @@ done: m_output->println(""); } +struct PurgeStruct +{ + NodeBitmask free_nodes;/* free nodes as reported + * by ndbd in apiRegReqConf + */ + BaseString *str; +}; + +void +MgmApiSession::stop_session_if_not_connected(SocketServer::Session *_s, void *data) +{ + MgmApiSession *s= (MgmApiSession *)_s; + struct PurgeStruct &ps= *(struct PurgeStruct *)data; + if (s->m_allocated_resources->is_reserved(ps.free_nodes)) + { + ps.str->appfmt(" %d", s->m_allocated_resources->get_nodeid()); + s->stopSession(); + } +} + +void +MgmApiSession::purge_stale_sessions(Parser_t::Context &ctx, + const class Properties &args) +{ + struct PurgeStruct ps; + BaseString str; + ps.str = &str; + + m_mgmsrv.get_connected_nodes(ps.free_nodes); + ps.free_nodes.bitXORC(NodeBitmask()); // invert connected_nodes to get free nodes + + m_mgmsrv.get_socket_server()->foreachSession(stop_session_if_not_connected,&ps); + + m_output->println("purge stale sessions reply"); + if (str.length() > 0) + m_output->println("purged:%s",str.c_str()); + m_output->println("result: Ok"); + m_output->println(""); +} + template class MutexVector; template class Vector const*>; template class Vector; diff --git a/ndb/src/mgmsrv/Services.hpp b/ndb/src/mgmsrv/Services.hpp index e47820826b6..bfc915f18f1 100644 --- a/ndb/src/mgmsrv/Services.hpp +++ b/ndb/src/mgmsrv/Services.hpp @@ -28,7 +28,9 @@ /** Undefine this to remove backwards compatibility for "GET CONFIG". */ #define MGM_GET_CONFIG_BACKWARDS_COMPAT -class MgmApiSession : public SocketServer::Session { +class MgmApiSession : public SocketServer::Session +{ + static void stop_session_if_not_connected(SocketServer::Session *_s, void *data); private: typedef Parser Parser_t; @@ -84,6 +86,8 @@ public: void setParameter(Parser_t::Context &ctx, const class Properties &args); void listen_event(Parser_t::Context &ctx, const class Properties &args); + + void purge_stale_sessions(Parser_t::Context &ctx, const class Properties &args); void repCommand(Parser_t::Context &ctx, const class Properties &args); }; diff --git a/ndb/src/mgmsrv/main.cpp b/ndb/src/mgmsrv/main.cpp index 15767e4766d..7a57fdeb77a 100644 --- a/ndb/src/mgmsrv/main.cpp +++ b/ndb/src/mgmsrv/main.cpp @@ -83,7 +83,6 @@ struct MgmGlobals { int g_no_nodeid_checks= 0; static MgmGlobals glob; - /****************************************************************************** * Function prototypes ******************************************************************************/ @@ -226,7 +225,7 @@ int main(int argc, char** argv) if (!readGlobalConfig()) goto error_end; - glob.mgmObject = new MgmtSrvr(glob.localNodeId, + glob.mgmObject = new MgmtSrvr(glob.localNodeId, glob.socketServer, BaseString(glob.config_filename), local_config, glob.cluster_config); From f0614a9fec597ea478bf7c1c82a8532948ecc2e1 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 10 Nov 2004 00:03:01 +0100 Subject: [PATCH 0154/1063] wl1744 - ndb on windows Add rules for creating dsp-files --- ndb/Makefile.am | 5 + ndb/config/win-includes | 8 + ndb/config/win-lib.am | 159 ++++++++++++++++++ ndb/config/win-libraries | 42 +++++ ndb/config/win-name | 7 + ndb/config/win-sources | 8 + ndb/docs/Makefile.am | 2 + ndb/include/Makefile.am | 2 + ndb/src/Makefile.am | 14 ++ ndb/src/common/Makefile.am | 2 + ndb/src/common/debugger/Makefile.am | 14 ++ .../common/debugger/signaldata/Makefile.am | 13 ++ ndb/src/common/logger/Makefile.am | 13 ++ ndb/src/common/mgmcommon/Makefile.am | 14 ++ ndb/src/common/portlib/Makefile.am | 14 ++ ndb/src/common/transporter/Makefile.am | 14 ++ ndb/src/common/util/Makefile.am | 14 ++ ndb/src/cw/Makefile.am | 3 + ndb/src/cw/cpcd/Makefile.am | 14 ++ ndb/src/kernel/Makefile.am | 14 ++ ndb/src/kernel/blocks/Makefile.am | 2 + ndb/src/kernel/blocks/backup/Makefile.am | 14 ++ .../kernel/blocks/backup/restore/Makefile.am | 14 ++ ndb/src/kernel/blocks/cmvmi/Makefile.am | 14 ++ ndb/src/kernel/blocks/dbacc/Makefile.am | 14 ++ ndb/src/kernel/blocks/dbdict/Makefile.am | 14 ++ ndb/src/kernel/blocks/dbdih/Makefile.am | 14 ++ ndb/src/kernel/blocks/dblqh/Makefile.am | 14 ++ ndb/src/kernel/blocks/dbtc/Makefile.am | 14 ++ ndb/src/kernel/blocks/dbtup/Makefile.am | 14 ++ ndb/src/kernel/blocks/dbtux/Makefile.am | 14 ++ ndb/src/kernel/blocks/dbutil/Makefile.am | 14 ++ ndb/src/kernel/blocks/grep/Makefile.am | 14 ++ ndb/src/kernel/blocks/ndbcntr/Makefile.am | 14 ++ ndb/src/kernel/blocks/ndbfs/Makefile.am | 14 ++ ndb/src/kernel/blocks/qmgr/Makefile.am | 14 ++ ndb/src/kernel/blocks/suma/Makefile.am | 14 ++ ndb/src/kernel/blocks/trix/Makefile.am | 14 ++ ndb/src/kernel/error/Makefile.am | 14 ++ ndb/src/kernel/vm/Makefile.am | 14 ++ ndb/src/mgmapi/Makefile.am | 14 ++ ndb/src/mgmclient/Makefile.am | 2 + ndb/src/mgmsrv/Makefile.am | 14 ++ ndb/src/ndbapi/Makefile.am | 14 ++ ndb/test/Makefile.am | 2 + ndb/test/ndbapi/Makefile.am | 2 +- ndb/test/ndbapi/bank/Makefile.am | 2 + ndb/test/run-test/Makefile.am | 14 ++ ndb/test/src/Makefile.am | 14 ++ ndb/test/tools/Makefile.am | 2 + ndb/tools/Makefile.am | 2 + scripts/make_win_src_distribution.sh | 9 +- 52 files changed, 732 insertions(+), 3 deletions(-) create mode 100755 ndb/config/win-includes create mode 100644 ndb/config/win-lib.am create mode 100755 ndb/config/win-libraries create mode 100755 ndb/config/win-name create mode 100755 ndb/config/win-sources diff --git a/ndb/Makefile.am b/ndb/Makefile.am index 82f424fcfb4..abff73359fa 100644 --- a/ndb/Makefile.am +++ b/ndb/Makefile.am @@ -17,3 +17,8 @@ dist-hook: done; \ fi; \ done + +windoze: + for i in `find . -name 'Makefile.am'`; do make -C `dirname $$i` windoze-dsp; done + +windoze-dsp: diff --git a/ndb/config/win-includes b/ndb/config/win-includes new file mode 100755 index 00000000000..fa5984fd25e --- /dev/null +++ b/ndb/config/win-includes @@ -0,0 +1,8 @@ +#!/bin/sh + +dst=$1 +shift + +out=`echo $* | sed 's/-I\([^ ]*\)/\/I "\1"/g'` +sed -e "s!@includes@!$out!g" $dst > /tmp/$dst.$$ +mv /tmp/$dst.$$ $dst diff --git a/ndb/config/win-lib.am b/ndb/config/win-lib.am new file mode 100644 index 00000000000..cae10b9e8d0 --- /dev/null +++ b/ndb/config/win-lib.am @@ -0,0 +1,159 @@ +# Microsoft Developer Studio Project File - Name="@name@" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Static Library" 0x0104 + +CFG=@name@ - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "@name@.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "@name@.mak" CFG="@name@ - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "@name@ - Win32 Release" (based on "Win32 (x86) Static Library") +!MESSAGE "@name@ - Win32 Debug" (based on "Win32 (x86) Static Library") +!MESSAGE "@name@ - Win32 TLS_DEBUG" (based on "Win32 (x86) Static Library") +!MESSAGE "@name@ - Win32 TLS" (based on "Win32 (x86) Static Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=xicl6.exe +RSC=rc.exe + +!IF "$(CFG)" == "@name@ - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "release" +# PROP Intermediate_Dir "release" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /D "WIN32" /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /FD /c +# ADD BASE CPP @includes@ +# ADD CPP @includes@ +# SUBTRACT CPP /YX +# ADD BASE RSC /l 0x409 +# ADD RSC /l 0x409 +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=xilink6.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo /out:"..\lib_release\@name@.lib" +@release_libs@ + +!ELSEIF "$(CFG)" == "@name@ - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "debug" +# PROP Intermediate_Dir "debug" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c +# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /Gf /D "WIN32" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /FD /c +# ADD BASE CPP @includes@ +# ADD CPP @includes@ +# SUBTRACT CPP /YX +# ADD BASE RSC /l 0x409 +# ADD RSC /l 0x409 +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=xilink6.exe -lib +# ADD BASE LIB32 /nologo +# ADD LIB32 /nologo /out:"..\lib_debug\@name@.lib" +@debug_libs@ + +!ELSEIF "$(CFG)" == "@name@ - Win32 TLS_DEBUG" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "@name@___Win32_TLS_DEBUG" +# PROP BASE Intermediate_Dir "@name@___Win32_TLS_DEBUG" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "@name@___Win32_TLS_DEBUG" +# PROP Intermediate_Dir "@name@___Win32_TLS_DEBUG" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /G6 /MTd /W3 /Z7 /Od /Gf /D "WIN32" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /FD /c +# SUBTRACT BASE CPP /YX +# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /Gf /D "WIN32" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /D "USE_TLS" /FD /c +# ADD BASE CPP @includes@ +# ADD CPP @includes@ +# ADD BASE RSC /l 0x409 +# ADD RSC /l 0x409 +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo /out:"..\lib_debug\@name@_tls.lib" +# ADD LIB32 /nologo /out:"..\lib_debug\@name@_tls.lib" +@tls_debug_libs@ + +!ELSEIF "$(CFG)" == "@name@ - Win32 TLS" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "@name@___Win32_TLS" +# PROP BASE Intermediate_Dir "@name@___Win32_TLS" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "@name@___Win32_TLS" +# PROP Intermediate_Dir "@name@___Win32_TLS" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /D "WIN32" /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /FD /c +# SUBTRACT BASE CPP /YX +# ADD CPP /nologo /G6 /MT /W3 /O2 /D "WIN32" /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /D "USE_TLS" /FD /c +# ADD BASE CPP @includes@ +# ADD CPP @includes@ +# SUBTRACT CPP /YX +# ADD BASE RSC /l 0x409 +# ADD RSC /l 0x409 +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LIB32=link.exe -lib +# ADD BASE LIB32 /nologo /out:"..\lib_release\@name@_tls.lib" +# ADD LIB32 /nologo /out:"..\lib_release\@name@_tls.lib" +@tls_release_libs@ + +!ENDIF + +# Begin Target + +# Name "@name@ - Win32 Release" +# Name "@name@ - Win32 Debug" +# Name "@name@ - Win32 TLS_DEBUG" +# Name "@name@ - Win32 TLS" + +# Begin Group "Source Files" +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" + +@sources@ + +# End Group + +# End Target +# End Project diff --git a/ndb/config/win-libraries b/ndb/config/win-libraries new file mode 100755 index 00000000000..91951957340 --- /dev/null +++ b/ndb/config/win-libraries @@ -0,0 +1,42 @@ +#!/bin/sh + +dst=$1 +shift + +add_lib(){ + echo `dirname $2`/$1/`basename $2 | sed "s/\.[l]*a/$3.lib/g"` +} + +out_rel= +out_deb= +out_tls_rel= +out_tls_deb= +for i in $* +do + if [ `echo $i | grep -c gcc` -eq 0 ] + then + out_rel="${out_rel} `add_lib lib_release $i`" + out_deb="${out_deb} `add_lib lib_debug $i`" + out_tls_rel="${out_tls_rel} `add_lib lib_release $i _tls`" + out_tls_deb="${out_tls_deb} `add_lib lib_debug $i _tls`" + fi +done + +fix(){ + echo "# ADD BASE LIB32 $*\n# ADD LIB32 $*\n" +} + +if [ "$out_rel" ] +then + out_rel=`fix $out_rel` + out_deb=`fix $out_deb` + out_tls_rel=`fix $out_tls_rel` + out_tls_deb=`fix $out_tls_deb` +fi + +sed -e "s!@release_libs@!$out_rel!g" \ + -e "s!@debug_libs@!$out_deb!g" \ + -e "s!@tls_release_libs@!$out_tls_rel!g" \ + -e "s!@tls_debug_libs@!$out_tls_deb!g" \ + $dst > !tmp!$dst.$$ +mv !tmp!$dst.$$ $dst diff --git a/ndb/config/win-name b/ndb/config/win-name new file mode 100755 index 00000000000..036f2b9cc2e --- /dev/null +++ b/ndb/config/win-name @@ -0,0 +1,7 @@ +#!/bin/sh + +dst=$1 +shift + +sed -e "s/@name@/`echo $1 | sed 's/\.[l]*a//g'`/g" $dst > /tmp/$dst.$$ +mv /tmp/$dst.$$ $dst diff --git a/ndb/config/win-sources b/ndb/config/win-sources new file mode 100755 index 00000000000..688ecb8ebc4 --- /dev/null +++ b/ndb/config/win-sources @@ -0,0 +1,8 @@ +#!/bin/sh + +dst=$1 +shift + +out=`echo $* | sed 's!\([^ ]*\)!# Begin Source File\\\nSOURCE=\1\\\n# End Source File\\\n!g'` +sed -e "s/@sources@/$out/g" $dst > /tmp/$dst.$$ +mv /tmp/$dst.$$ $dst diff --git a/ndb/docs/Makefile.am b/ndb/docs/Makefile.am index 554b2fb256e..c7e344b3dee 100644 --- a/ndb/docs/Makefile.am +++ b/ndb/docs/Makefile.am @@ -100,3 +100,5 @@ odbcdoc: DUMMY testdoc: DUMMY mkdir -p $(OUTDIR) cd $(top_srcdir)/ndb ; $(DOXYGEN) $(DOXYDIR)/Doxyfile.test + +windoze-dsp: diff --git a/ndb/include/Makefile.am b/ndb/include/Makefile.am index 7b3f80b5560..56f71ae6d0b 100644 --- a/ndb/include/Makefile.am +++ b/ndb/include/Makefile.am @@ -42,3 +42,5 @@ portlib transporter util dist-hook: -rm -rf `find $(distdir) -type d -name SCCS` + +windoze-dsp: diff --git a/ndb/src/Makefile.am b/ndb/src/Makefile.am index bed43438e91..07f6ea5d8d4 100644 --- a/ndb/src/Makefile.am +++ b/ndb/src/Makefile.am @@ -16,3 +16,17 @@ libndbclient_la_LIBADD = \ common/logger/liblogger.la \ common/portlib/libportlib.la \ common/util/libgeneral.la + +windoze-dsp: libndbclient.dsp + +libndbclient.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(ndblib_LTLIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(libndbclient_la_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ $(libndbclient_la_LIBADD) diff --git a/ndb/src/common/Makefile.am b/ndb/src/common/Makefile.am index 8733205eca2..0059f3fb210 100644 --- a/ndb/src/common/Makefile.am +++ b/ndb/src/common/Makefile.am @@ -11,3 +11,5 @@ libcommon_la_LIBADD = \ portlib/libportlib.la \ logger/liblogger.la \ util/libgeneral.la + +windoze-dsp: diff --git a/ndb/src/common/debugger/Makefile.am b/ndb/src/common/debugger/Makefile.am index d0fb30717cd..08251eb9155 100644 --- a/ndb/src/common/debugger/Makefile.am +++ b/ndb/src/common/debugger/Makefile.am @@ -9,3 +9,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: libtrace.dsp + +libtrace.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LTLIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(libtrace_la_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) diff --git a/ndb/src/common/debugger/signaldata/Makefile.am b/ndb/src/common/debugger/signaldata/Makefile.am index c855c5f8a18..bc18e17fbb0 100644 --- a/ndb/src/common/debugger/signaldata/Makefile.am +++ b/ndb/src/common/debugger/signaldata/Makefile.am @@ -32,3 +32,16 @@ include $(top_srcdir)/ndb/config/type_ndbapi.mk.am # Don't update the files from bitkeeper %::SCCS/s.% +windoze-dsp: libsignaldataprint.dsp + +libsignaldataprint.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LTLIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(libsignaldataprint_la_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) diff --git a/ndb/src/common/logger/Makefile.am b/ndb/src/common/logger/Makefile.am index 0a48214c37c..90f3346b414 100644 --- a/ndb/src/common/logger/Makefile.am +++ b/ndb/src/common/logger/Makefile.am @@ -9,3 +9,16 @@ include $(top_srcdir)/ndb/config/type_ndbapi.mk.am # Don't update the files from bitkeeper %::SCCS/s.% +windoze-dsp: liblogger.dsp + +liblogger.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LTLIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(liblogger_la_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) diff --git a/ndb/src/common/mgmcommon/Makefile.am b/ndb/src/common/mgmcommon/Makefile.am index ed6a526eb47..88b042af845 100644 --- a/ndb/src/common/mgmcommon/Makefile.am +++ b/ndb/src/common/mgmcommon/Makefile.am @@ -15,3 +15,17 @@ include $(top_srcdir)/ndb/config/type_mgmapiclient.mk.am # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: libmgmsrvcommon.dsp + +libmgmsrvcommon.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LTLIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(libmgmsrvcommon_la_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) diff --git a/ndb/src/common/portlib/Makefile.am b/ndb/src/common/portlib/Makefile.am index 6f3a3fe01a9..fe69ef7346a 100644 --- a/ndb/src/common/portlib/Makefile.am +++ b/ndb/src/common/portlib/Makefile.am @@ -16,3 +16,17 @@ PortLibTest_SOURCES = NdbPortLibTest.cpp munmaptest_SOURCES = munmaptest.cpp # Don't update the files from bitkeeper + +windoze-dsp: libportlib.dsp + +libportlib.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LTLIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(libportlib_la_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) diff --git a/ndb/src/common/transporter/Makefile.am b/ndb/src/common/transporter/Makefile.am index 9d91a210d46..3204a9a9254 100644 --- a/ndb/src/common/transporter/Makefile.am +++ b/ndb/src/common/transporter/Makefile.am @@ -20,3 +20,17 @@ include $(top_srcdir)/ndb/config/type_util.mk.am # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: libtransporter.dsp + +libtransporter.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LTLIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(libtransporter_la_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) diff --git a/ndb/src/common/util/Makefile.am b/ndb/src/common/util/Makefile.am index 61fd7992002..cbc849a49f9 100644 --- a/ndb/src/common/util/Makefile.am +++ b/ndb/src/common/util/Makefile.am @@ -16,3 +16,17 @@ include $(top_srcdir)/ndb/config/type_util.mk.am # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: libgeneral.dsp + +libgeneral.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LTLIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(libgeneral_la_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) diff --git a/ndb/src/cw/Makefile.am b/ndb/src/cw/Makefile.am index b530922a3a7..7348fc9eab6 100644 --- a/ndb/src/cw/Makefile.am +++ b/ndb/src/cw/Makefile.am @@ -1 +1,4 @@ SUBDIRS = cpcd + +windoze-dsp: + diff --git a/ndb/src/cw/cpcd/Makefile.am b/ndb/src/cw/cpcd/Makefile.am index 6af44a359fc..20ac8e6e578 100644 --- a/ndb/src/cw/cpcd/Makefile.am +++ b/ndb/src/cw/cpcd/Makefile.am @@ -16,3 +16,17 @@ ndb_cpcd_LDFLAGS = @ndb_bin_am_ldflags@ # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: ndb_cpcd.dsp + +ndb_cpcd.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(ndbbin_PROGRAMS) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(ndb_cpcd_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) diff --git a/ndb/src/kernel/Makefile.am b/ndb/src/kernel/Makefile.am index 493ab4f9982..5b975d9d0eb 100644 --- a/ndb/src/kernel/Makefile.am +++ b/ndb/src/kernel/Makefile.am @@ -59,3 +59,17 @@ LDADD += \ # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: ndbd.dsp + +ndbd.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(ndbbin_PROGRAMS) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(ndbd_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) diff --git a/ndb/src/kernel/blocks/Makefile.am b/ndb/src/kernel/blocks/Makefile.am index 0b2bc3b8c88..7ee90e6239f 100644 --- a/ndb/src/kernel/blocks/Makefile.am +++ b/ndb/src/kernel/blocks/Makefile.am @@ -15,3 +15,5 @@ SUBDIRS = \ suma \ grep \ dbtux + +windoze-dsp: diff --git a/ndb/src/kernel/blocks/backup/Makefile.am b/ndb/src/kernel/blocks/backup/Makefile.am index 85bf5b12415..4726f291d01 100644 --- a/ndb/src/kernel/blocks/backup/Makefile.am +++ b/ndb/src/kernel/blocks/backup/Makefile.am @@ -10,3 +10,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: libbackup.dsp + +libbackup.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(libbackup_a_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) diff --git a/ndb/src/kernel/blocks/backup/restore/Makefile.am b/ndb/src/kernel/blocks/backup/restore/Makefile.am index 16550f13546..3a9baea8fbc 100644 --- a/ndb/src/kernel/blocks/backup/restore/Makefile.am +++ b/ndb/src/kernel/blocks/backup/restore/Makefile.am @@ -14,3 +14,17 @@ include $(top_srcdir)/ndb/config/common.mk.am INCLUDES += -I.. -I$(top_srcdir)/include -I$(top_srcdir)/ndb/include -I$(top_srcdir)/ndb/src/ndbapi -I$(top_srcdir)/ndb/include/ndbapi -I$(top_srcdir)/ndb/include/util -I$(top_srcdir)/ndb/include/portlib -I$(top_srcdir)/ndb/include/kernel ndb_restore_LDFLAGS = @ndb_bin_am_ldflags@ + +windoze-dsp: ndb_restore.dsp + +ndb_restore.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LTLIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(ndb_restore_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) diff --git a/ndb/src/kernel/blocks/cmvmi/Makefile.am b/ndb/src/kernel/blocks/cmvmi/Makefile.am index fdd43932682..f806183338f 100644 --- a/ndb/src/kernel/blocks/cmvmi/Makefile.am +++ b/ndb/src/kernel/blocks/cmvmi/Makefile.am @@ -8,3 +8,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: libcmvmi.dsp + +libcmvmi.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(libcmvmi_a_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) diff --git a/ndb/src/kernel/blocks/dbacc/Makefile.am b/ndb/src/kernel/blocks/dbacc/Makefile.am index 7ccfbe22f76..40b0ecdee1f 100644 --- a/ndb/src/kernel/blocks/dbacc/Makefile.am +++ b/ndb/src/kernel/blocks/dbacc/Makefile.am @@ -8,3 +8,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: libdbacc.dsp + +libdbacc.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(libdbacc_a_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) diff --git a/ndb/src/kernel/blocks/dbdict/Makefile.am b/ndb/src/kernel/blocks/dbdict/Makefile.am index dc4c4fe4734..c97dcb62ba5 100644 --- a/ndb/src/kernel/blocks/dbdict/Makefile.am +++ b/ndb/src/kernel/blocks/dbdict/Makefile.am @@ -9,3 +9,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: libdbdict.dsp + +libdbdict.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(libdbdict_a_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) diff --git a/ndb/src/kernel/blocks/dbdih/Makefile.am b/ndb/src/kernel/blocks/dbdih/Makefile.am index 2ee8017ec13..86eb4df5df1 100644 --- a/ndb/src/kernel/blocks/dbdih/Makefile.am +++ b/ndb/src/kernel/blocks/dbdih/Makefile.am @@ -7,3 +7,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: libdbdih.dsp + +libdbdih.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(libdbdih_a_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) diff --git a/ndb/src/kernel/blocks/dblqh/Makefile.am b/ndb/src/kernel/blocks/dblqh/Makefile.am index 3a58dba742e..3ea54b29659 100644 --- a/ndb/src/kernel/blocks/dblqh/Makefile.am +++ b/ndb/src/kernel/blocks/dblqh/Makefile.am @@ -9,3 +9,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: libdblqh.dsp + +libdblqh.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(libdblqh_a_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) diff --git a/ndb/src/kernel/blocks/dbtc/Makefile.am b/ndb/src/kernel/blocks/dbtc/Makefile.am index 4aa514c0aba..cf8f7c36fd3 100644 --- a/ndb/src/kernel/blocks/dbtc/Makefile.am +++ b/ndb/src/kernel/blocks/dbtc/Makefile.am @@ -7,3 +7,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: libdbtc.dsp + +libdbtc.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(libdbtc_a_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) diff --git a/ndb/src/kernel/blocks/dbtup/Makefile.am b/ndb/src/kernel/blocks/dbtup/Makefile.am index 7e94a01d43b..a1cf3f0d234 100644 --- a/ndb/src/kernel/blocks/dbtup/Makefile.am +++ b/ndb/src/kernel/blocks/dbtup/Makefile.am @@ -25,3 +25,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: libdbtup.dsp + +libdbtup.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(libdbtup_a_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) diff --git a/ndb/src/kernel/blocks/dbtux/Makefile.am b/ndb/src/kernel/blocks/dbtux/Makefile.am index 7d012924522..a6bcad10a76 100644 --- a/ndb/src/kernel/blocks/dbtux/Makefile.am +++ b/ndb/src/kernel/blocks/dbtux/Makefile.am @@ -18,3 +18,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: libdbtux.dsp + +libdbtux.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(libdbtux_a_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) diff --git a/ndb/src/kernel/blocks/dbutil/Makefile.am b/ndb/src/kernel/blocks/dbutil/Makefile.am index 763875d578f..24ed1d48086 100644 --- a/ndb/src/kernel/blocks/dbutil/Makefile.am +++ b/ndb/src/kernel/blocks/dbutil/Makefile.am @@ -7,3 +7,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: libutil.dsp + +libutil.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(libutil_a_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) diff --git a/ndb/src/kernel/blocks/grep/Makefile.am b/ndb/src/kernel/blocks/grep/Makefile.am index 31081c7b6a0..cbb1c1721c1 100644 --- a/ndb/src/kernel/blocks/grep/Makefile.am +++ b/ndb/src/kernel/blocks/grep/Makefile.am @@ -7,3 +7,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: libgrep.dsp + +libgrep.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(libgrep_a_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) diff --git a/ndb/src/kernel/blocks/ndbcntr/Makefile.am b/ndb/src/kernel/blocks/ndbcntr/Makefile.am index 9230b55b374..de5e24e6be8 100644 --- a/ndb/src/kernel/blocks/ndbcntr/Makefile.am +++ b/ndb/src/kernel/blocks/ndbcntr/Makefile.am @@ -10,3 +10,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: libndbcntr.dsp + +libndbcntr.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(libndbcntr_a_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) diff --git a/ndb/src/kernel/blocks/ndbfs/Makefile.am b/ndb/src/kernel/blocks/ndbfs/Makefile.am index c2b663c5042..b33508f6bee 100644 --- a/ndb/src/kernel/blocks/ndbfs/Makefile.am +++ b/ndb/src/kernel/blocks/ndbfs/Makefile.am @@ -11,3 +11,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: libndbfs.dsp + +libndbfs.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(libndbfs_a_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) diff --git a/ndb/src/kernel/blocks/qmgr/Makefile.am b/ndb/src/kernel/blocks/qmgr/Makefile.am index 52cadb3bd3d..280fd7caeec 100644 --- a/ndb/src/kernel/blocks/qmgr/Makefile.am +++ b/ndb/src/kernel/blocks/qmgr/Makefile.am @@ -9,3 +9,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: libqmgr.dsp + +libqmgr.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(libqmgr_a_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) diff --git a/ndb/src/kernel/blocks/suma/Makefile.am b/ndb/src/kernel/blocks/suma/Makefile.am index 4dacb22af51..1101aa78c73 100644 --- a/ndb/src/kernel/blocks/suma/Makefile.am +++ b/ndb/src/kernel/blocks/suma/Makefile.am @@ -7,3 +7,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: libsuma.dsp + +libsuma.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(libsuma_a_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) diff --git a/ndb/src/kernel/blocks/trix/Makefile.am b/ndb/src/kernel/blocks/trix/Makefile.am index 803da815cf0..85ff101b496 100644 --- a/ndb/src/kernel/blocks/trix/Makefile.am +++ b/ndb/src/kernel/blocks/trix/Makefile.am @@ -7,3 +7,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: libtrix.dsp + +libtrix.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(libtrix_a_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) diff --git a/ndb/src/kernel/error/Makefile.am b/ndb/src/kernel/error/Makefile.am index 4514d2d105c..fe78667caba 100644 --- a/ndb/src/kernel/error/Makefile.am +++ b/ndb/src/kernel/error/Makefile.am @@ -9,3 +9,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: liberror.dsp + +liberror.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(liberror_a_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) diff --git a/ndb/src/kernel/vm/Makefile.am b/ndb/src/kernel/vm/Makefile.am index 4e9dbe36c78..038ea882dce 100644 --- a/ndb/src/kernel/vm/Makefile.am +++ b/ndb/src/kernel/vm/Makefile.am @@ -27,3 +27,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: libkernel.dsp + +libkernel.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(libkernel_a_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) diff --git a/ndb/src/mgmapi/Makefile.am b/ndb/src/mgmapi/Makefile.am index 0f0e1cea5d8..fab9f5d762d 100644 --- a/ndb/src/mgmapi/Makefile.am +++ b/ndb/src/mgmapi/Makefile.am @@ -13,3 +13,17 @@ include $(top_srcdir)/ndb/config/type_util.mk.am # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: libmgmapi.dsp + +libmgmapi.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LTLIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(libmgmapi_la_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) diff --git a/ndb/src/mgmclient/Makefile.am b/ndb/src/mgmclient/Makefile.am index cd6ddb0ad57..88bd3c4f529 100644 --- a/ndb/src/mgmclient/Makefile.am +++ b/ndb/src/mgmclient/Makefile.am @@ -23,3 +23,5 @@ ndb_mgm_LDFLAGS = @ndb_bin_am_ldflags@ # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: diff --git a/ndb/src/mgmsrv/Makefile.am b/ndb/src/mgmsrv/Makefile.am index 4cb164d48fe..a78c4a85fd3 100644 --- a/ndb/src/mgmsrv/Makefile.am +++ b/ndb/src/mgmsrv/Makefile.am @@ -42,3 +42,17 @@ ndb_mgmd_LDFLAGS = @ndb_bin_am_ldflags@ # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: ndb_mgmd.dsp + +ndb_mgmd.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(ndbbin_PROGRAMS) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(ndb_mgmd_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) diff --git a/ndb/src/ndbapi/Makefile.am b/ndb/src/ndbapi/Makefile.am index 06128e047b6..e3dcd682bba 100644 --- a/ndb/src/ndbapi/Makefile.am +++ b/ndb/src/ndbapi/Makefile.am @@ -47,3 +47,17 @@ include $(top_srcdir)/ndb/config/type_ndbapi.mk.am # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: libndbapi.dsp + +libndbapi.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LTLIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(libndbapi_la_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) diff --git a/ndb/test/Makefile.am b/ndb/test/Makefile.am index 2e0f30df9d4..b8753668c60 100644 --- a/ndb/test/Makefile.am +++ b/ndb/test/Makefile.am @@ -4,3 +4,5 @@ EXTRA_DIST = include dist-hook: -rm -rf `find $(distdir) -type d -name SCCS` + +windoze-dsp: diff --git a/ndb/test/ndbapi/Makefile.am b/ndb/test/ndbapi/Makefile.am index 787589dd9b6..310854edf77 100644 --- a/ndb/test/ndbapi/Makefile.am +++ b/ndb/test/ndbapi/Makefile.am @@ -84,4 +84,4 @@ testBackup_LDADD = $(LDADD) bank/libbank.a # Don't update the files from bitkeeper %::SCCS/s.% - +windoze-dsp: diff --git a/ndb/test/ndbapi/bank/Makefile.am b/ndb/test/ndbapi/bank/Makefile.am index 886d664aefb..d4f82a7f9c4 100644 --- a/ndb/test/ndbapi/bank/Makefile.am +++ b/ndb/test/ndbapi/bank/Makefile.am @@ -20,3 +20,5 @@ include $(top_srcdir)/ndb/config/type_ndbapitest.mk.am # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: diff --git a/ndb/test/run-test/Makefile.am b/ndb/test/run-test/Makefile.am index c890536dcc6..bc245a1413f 100644 --- a/ndb/test/run-test/Makefile.am +++ b/ndb/test/run-test/Makefile.am @@ -23,3 +23,17 @@ wrappers_SCRIPTS=atrt-testBackup atrt-mysql-test-run # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: atrt.dsp + +atrt.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(test_PROGRAMS) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(atrt_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) diff --git a/ndb/test/src/Makefile.am b/ndb/test/src/Makefile.am index 56f3d6a1ec6..7d5904d897b 100644 --- a/ndb/test/src/Makefile.am +++ b/ndb/test/src/Makefile.am @@ -19,3 +19,17 @@ include $(top_srcdir)/ndb/config/type_ndbapitest.mk.am # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: libNDBT.dsp + +libNDBT.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(libNDBT_a_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) diff --git a/ndb/test/tools/Makefile.am b/ndb/test/tools/Makefile.am index 3255267b636..a6a013bb263 100644 --- a/ndb/test/tools/Makefile.am +++ b/ndb/test/tools/Makefile.am @@ -27,3 +27,5 @@ ndb_cpcc_LDADD = $(LDADD) # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: diff --git a/ndb/tools/Makefile.am b/ndb/tools/Makefile.am index fad9bf9ff84..59fc5c124be 100644 --- a/ndb/tools/Makefile.am +++ b/ndb/tools/Makefile.am @@ -37,3 +37,5 @@ ndb_select_count_LDFLAGS = @ndb_bin_am_ldflags@ # Don't update the files from bitkeeper %::SCCS/s.% + +windoze-dsp: diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh index fd7884068ba..d9144ab3dce 100644 --- a/scripts/make_win_src_distribution.sh +++ b/scripts/make_win_src_distribution.sh @@ -188,7 +188,7 @@ copy_dir_files() print_debug "Creating directory '$arg'" mkdir $BASE/$arg fi - for i in *.c *.cpp *.h *.ih *.i *.ic *.asm *.def \ + for i in *.c *.cpp *.h *.ih *.i *.ic *.asm *.def *.hpp *.dsp \ README INSTALL* LICENSE do if [ -f $i ] @@ -243,11 +243,16 @@ do copy_dir_files $i done +# +# Create project files for ndb +# +make -C ndb windoze + # # Input directories to be copied recursively # -for i in bdb innobase +for i in bdb innobase ndb do copy_dir_dirs $i done From 59ee75bd57b989cbfd9ccd8b986f00cdcbc599b5 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 10 Nov 2004 00:13:26 +0100 Subject: [PATCH 0155/1063] wl1744 - fix compiler problems ndb/include/debugger/GrepError.hpp: prexif ndb/include/kernel/LogLevel.hpp: fix correct type prototype ndb/include/kernel/signaldata/FsCloseReq.hpp: remove usage of true ndb/include/mgmapi/mgmapi.h: use Uint64 instead of long long ndb/include/mgmcommon/IPCConfig.hpp: correct type ndb/include/portlib/NdbTCP.h: fix #elif ndb/include/transporter/TransporterRegistry.hpp: correct type ndb/include/util/Parser.hpp: correct type made stuff public as vc++ couldn't handle template friends ndb/include/util/SimpleProperties.hpp: correct type ndb/src/common/debugger/EventLogger.cpp: Prefix GrepError::Code as GrepError::GE_Code ndb/src/common/debugger/GrepError.cpp: Prefix GrepError::Code as GrepError::GE_Code ndb/src/common/debugger/signaldata/FsCloseReq.cpp: removed usage of true ndb/src/common/debugger/signaldata/FsReadWriteReq.cpp: removed usage of true ndb/src/common/logger/LogHandlerList.hpp: use ndb_global ndb/src/common/mgmcommon/ConfigRetriever.cpp: removed ConfigRetriever::get_config(file) from windows ndb/src/common/transporter/TransporterRegistry.cpp: interface is a reserved word in vc++ ndb/src/kernel/blocks/grep/Grep.hpp: Prefix GrepError::Code as GrepError::GE_Code ndb/src/kernel/vm/Configuration.cpp: Use BaseString::snprintf ndb/src/kernel/vm/Configuration.hpp: correct type ndb/src/kernel/vm/SimplePropertiesSection.cpp: correct type ndb/src/mgmapi/mgmapi_configuration.cpp: use Uin6t4 ndb/src/mgmapi/mgmapi_configuration.hpp: use Uin6t4 ndb/src/mgmsrv/ConfigInfo.cpp: Prefix ndb/src/mgmsrv/ConfigInfo.hpp: prefix ndb/src/ndbapi/Ndb.cpp: removed usued include ndb/src/ndbapi/NdbImpl.hpp: prefix ndb/src/ndbapi/ObjectMap.hpp: Better typecast --- ndb/include/debugger/GrepError.hpp | 8 +- ndb/include/kernel/LogLevel.hpp | 2 +- ndb/include/kernel/signaldata/FsCloseReq.hpp | 2 +- ndb/include/mgmapi/mgmapi.h | 2 +- ndb/include/mgmcommon/IPCConfig.hpp | 2 +- ndb/include/portlib/NdbTCP.h | 2 +- .../transporter/TransporterRegistry.hpp | 2 +- ndb/include/util/Parser.hpp | 6 +- ndb/include/util/SimpleProperties.hpp | 20 +- ndb/src/common/debugger/EventLogger.cpp | 30 +- ndb/src/common/debugger/GrepError.cpp | 4 +- .../common/debugger/signaldata/FsCloseReq.cpp | 2 +- .../debugger/signaldata/FsReadWriteReq.cpp | 2 +- ndb/src/common/logger/LogHandlerList.hpp | 1 + ndb/src/common/mgmcommon/ConfigRetriever.cpp | 7 +- .../transporter/TransporterRegistry.cpp | 18 +- ndb/src/kernel/blocks/grep/Grep.hpp | 8 +- ndb/src/kernel/vm/Configuration.cpp | 2 +- ndb/src/kernel/vm/Configuration.hpp | 2 +- ndb/src/kernel/vm/SimplePropertiesSection.cpp | 4 +- ndb/src/mgmapi/mgmapi_configuration.cpp | 3 +- ndb/src/mgmapi/mgmapi_configuration.hpp | 2 +- ndb/src/mgmsrv/ConfigInfo.cpp | 716 +++++++++--------- ndb/src/mgmsrv/ConfigInfo.hpp | 10 +- ndb/src/ndbapi/Ndb.cpp | 2 +- ndb/src/ndbapi/NdbImpl.hpp | 2 +- ndb/src/ndbapi/ObjectMap.hpp | 2 +- 27 files changed, 434 insertions(+), 429 deletions(-) diff --git a/ndb/include/debugger/GrepError.hpp b/ndb/include/debugger/GrepError.hpp index ab6a7b272a5..beedbd95c80 100644 --- a/ndb/include/debugger/GrepError.hpp +++ b/ndb/include/debugger/GrepError.hpp @@ -24,8 +24,8 @@ */ class GrepError { public: - enum Code { - NO_ERROR = 0, + enum GE_Code { + GE_NO_ERROR = 0, SUBSCRIPTION_ID_NOMEM = 1, SUBSCRIPTION_ID_NOT_FOUND = 2, SUBSCRIPTION_ID_NOT_UNIQUE = 3, @@ -82,12 +82,12 @@ public: }; struct ErrorDescription { - Code errCode; + GE_Code errCode; const char * name; }; static const ErrorDescription errorDescriptions[]; static const Uint32 noOfErrorDescs; - static const char * getErrorDesc(GrepError::Code err); + static const char * getErrorDesc(GrepError::GE_Code err); }; diff --git a/ndb/include/kernel/LogLevel.hpp b/ndb/include/kernel/LogLevel.hpp index 467f0604edd..5981ca4701a 100644 --- a/ndb/include/kernel/LogLevel.hpp +++ b/ndb/include/kernel/LogLevel.hpp @@ -89,7 +89,7 @@ public: return memcmp(this, &l, sizeof(* this)) == 0; } - LogLevel& operator=(const class EventSubscribeReq & req); + LogLevel& operator=(const struct EventSubscribeReq & req); private: /** diff --git a/ndb/include/kernel/signaldata/FsCloseReq.hpp b/ndb/include/kernel/signaldata/FsCloseReq.hpp index c42afa143e6..10d094fb30b 100644 --- a/ndb/include/kernel/signaldata/FsCloseReq.hpp +++ b/ndb/include/kernel/signaldata/FsCloseReq.hpp @@ -75,7 +75,7 @@ inline void FsCloseReq::setRemoveFileFlag(UintR & fileflag, bool removefile){ // ASSERT_BOOL(removefile, "FsCloseReq::setRemoveFileFlag"); - if (removefile == true) + if (removefile) fileflag = 1; else fileflag = 0; diff --git a/ndb/include/mgmapi/mgmapi.h b/ndb/include/mgmapi/mgmapi.h index 6dcf58b44e2..582e8f1a3e6 100644 --- a/ndb/include/mgmapi/mgmapi.h +++ b/ndb/include/mgmapi/mgmapi.h @@ -730,7 +730,7 @@ extern "C" { int ndb_mgm_get_int_parameter(const ndb_mgm_configuration_iterator*, int param, unsigned * value); int ndb_mgm_get_int64_parameter(const ndb_mgm_configuration_iterator*, - int param, unsigned long long * value); + int param, Uint64 * value); int ndb_mgm_get_string_parameter(const ndb_mgm_configuration_iterator*, int param, const char ** value); #ifdef __cplusplus diff --git a/ndb/include/mgmcommon/IPCConfig.hpp b/ndb/include/mgmcommon/IPCConfig.hpp index ebe65b53b59..1e23cdf9807 100644 --- a/ndb/include/mgmcommon/IPCConfig.hpp +++ b/ndb/include/mgmcommon/IPCConfig.hpp @@ -59,7 +59,7 @@ public: void print() const { props->print(); } static Uint32 configureTransporters(Uint32 nodeId, - const class ndb_mgm_configuration &, + const struct ndb_mgm_configuration &, class TransporterRegistry &); private: diff --git a/ndb/include/portlib/NdbTCP.h b/ndb/include/portlib/NdbTCP.h index 4dc8435eef1..8138a2ef354 100644 --- a/ndb/include/portlib/NdbTCP.h +++ b/ndb/include/portlib/NdbTCP.h @@ -40,7 +40,7 @@ typedef int socklen_t; #define InetErrno (* inet_errno()) -#elif NDB_WIN32 +#elif defined NDB_WIN32 /** * Include files needed diff --git a/ndb/include/transporter/TransporterRegistry.hpp b/ndb/include/transporter/TransporterRegistry.hpp index ac6291f9e57..a2014ffe8d4 100644 --- a/ndb/include/transporter/TransporterRegistry.hpp +++ b/ndb/include/transporter/TransporterRegistry.hpp @@ -224,7 +224,7 @@ public: const char *m_interface; }; Vector m_transporter_interface; - void add_transporter_interface(const char *interface, unsigned short port); + void add_transporter_interface(const char *interf, unsigned short port); protected: private: diff --git a/ndb/include/util/Parser.hpp b/ndb/include/util/Parser.hpp index 65cf24db633..c117498e1ba 100644 --- a/ndb/include/util/Parser.hpp +++ b/ndb/include/util/Parser.hpp @@ -23,7 +23,7 @@ #include "NdbOut.hpp" class ParserImpl; -template class ParserRow; +template struct ParserRow; //#define PARSER_DEBUG #ifdef PARSER_DEBUG @@ -130,11 +130,11 @@ public: * The void* equivalent implementation */ class ParserImpl { +public: class Dummy {}; typedef ParserRow DummyRow; typedef Parser::Context Context; - template friend class Parser; -private: + ParserImpl(const DummyRow rows[], class InputStream & in, bool b_cmd, bool b_empty, bool b_iarg); diff --git a/ndb/include/util/SimpleProperties.hpp b/ndb/include/util/SimpleProperties.hpp index d5ebb16bb09..356f3406f38 100644 --- a/ndb/include/util/SimpleProperties.hpp +++ b/ndb/include/util/SimpleProperties.hpp @@ -38,20 +38,20 @@ public: /** * Value types */ - enum ValueType { + enum ValueType { Uint32Value = 0, StringValue = 1, BinaryValue = 2, InvalidValue = 3 - }; - + }; + /** * Struct for defining mapping to be used with unpack */ struct SP2StructMapping { Uint16 Key; Uint32 Offset; - SimpleProperties::ValueType Type; + ValueType Type; Uint32 minValue; Uint32 maxValue; Uint32 Length_Offset; // Offset used for looking up length of @@ -233,7 +233,7 @@ private: */ class SimplePropertiesSectionReader : public SimpleProperties::Reader { public: - SimplePropertiesSectionReader(class SegmentedSectionPtr &, + SimplePropertiesSectionReader(struct SegmentedSectionPtr &, class SectionSegmentPool &); virtual void reset(); @@ -248,8 +248,8 @@ private: Uint32 m_pos; Uint32 m_len; class SectionSegmentPool & m_pool; - class SectionSegment * m_head; - class SectionSegment * m_currentSegment; + struct SectionSegment * m_head; + struct SectionSegment * m_currentSegment; }; inline @@ -275,15 +275,15 @@ public: /** * This "unlinks" the writer from the memory */ - void getPtr(class SegmentedSectionPtr & dst); + void getPtr(struct SegmentedSectionPtr & dst); private: Int32 m_pos; Uint32 m_sz; class SectionSegmentPool & m_pool; - class SectionSegment * m_head; + struct SectionSegment * m_head; Uint32 m_prevPtrI; // Prev to m_currentSegment - class SectionSegment * m_currentSegment; + struct SectionSegment * m_currentSegment; }; #endif diff --git a/ndb/src/common/debugger/EventLogger.cpp b/ndb/src/common/debugger/EventLogger.cpp index 8a09be9a0a7..8f186a9efe7 100644 --- a/ndb/src/common/debugger/EventLogger.cpp +++ b/ndb/src/common/debugger/EventLogger.cpp @@ -1028,7 +1028,7 @@ EventLogger::getText(char * m_text, size_t m_text_len, "Grep::SSCoord:Error code: %d Error message: %s" " (subId=%d,SubKey=%d)", err, - GrepError::getErrorDesc((GrepError::Code)err), + GrepError::getErrorDesc((GrepError::GE_Code)err), subId, subKey); break; @@ -1045,7 +1045,7 @@ EventLogger::getText(char * m_text, size_t m_text_len, subId, subKey, err, - GrepError::getErrorDesc((GrepError::Code)err)); + GrepError::getErrorDesc((GrepError::GE_Code)err)); break; } case GrepEvent::GrepSS_SubStartMetaRef: @@ -1061,7 +1061,7 @@ EventLogger::getText(char * m_text, size_t m_text_len, subId, subKey, err, - GrepError::getErrorDesc((GrepError::Code)err)); + GrepError::getErrorDesc((GrepError::GE_Code)err)); break; } case GrepEvent::GrepSS_SubStartDataRef: @@ -1076,7 +1076,7 @@ EventLogger::getText(char * m_text, size_t m_text_len, subId, subKey, err, - GrepError::getErrorDesc((GrepError::Code)err)); + GrepError::getErrorDesc((GrepError::GE_Code)err)); break; } case GrepEvent::GrepSS_SubSyncMetaRef: @@ -1091,7 +1091,7 @@ EventLogger::getText(char * m_text, size_t m_text_len, subId, subKey, err, - GrepError::getErrorDesc((GrepError::Code)err)); + GrepError::getErrorDesc((GrepError::GE_Code)err)); break; } case GrepEvent::GrepSS_SubSyncDataRef: @@ -1108,7 +1108,7 @@ EventLogger::getText(char * m_text, size_t m_text_len, subKey, gci, err, - GrepError::getErrorDesc((GrepError::Code)err)); + GrepError::getErrorDesc((GrepError::GE_Code)err)); break; } case GrepEvent::GrepSS_SubRemoveRef: @@ -1123,7 +1123,7 @@ EventLogger::getText(char * m_text, size_t m_text_len, subId, subKey, err, - GrepError::getErrorDesc((GrepError::Code)err) + GrepError::getErrorDesc((GrepError::GE_Code)err) ); break; } @@ -1137,7 +1137,7 @@ EventLogger::getText(char * m_text, size_t m_text_len, "Grep::PSCoord: Error code: %d Error Message: %s" " (subId=%d,SubKey=%d)", err, - GrepError::getErrorDesc((GrepError::Code)err), + GrepError::getErrorDesc((GrepError::GE_Code)err), subId, subKey); break; @@ -1154,7 +1154,7 @@ EventLogger::getText(char * m_text, size_t m_text_len, subId, subKey, err, - GrepError::getErrorDesc((GrepError::Code)err)); + GrepError::getErrorDesc((GrepError::GE_Code)err)); break; } case GrepEvent::GrepPS_SubStartMetaRef: @@ -1170,7 +1170,7 @@ EventLogger::getText(char * m_text, size_t m_text_len, subId, subKey, err, - GrepError::getErrorDesc((GrepError::Code)err)); + GrepError::getErrorDesc((GrepError::GE_Code)err)); break; } case GrepEvent::GrepPS_SubStartDataRef: @@ -1185,7 +1185,7 @@ EventLogger::getText(char * m_text, size_t m_text_len, subId, subKey, err, - GrepError::getErrorDesc((GrepError::Code)err)); + GrepError::getErrorDesc((GrepError::GE_Code)err)); break; } case GrepEvent::GrepPS_SubSyncMetaRef: @@ -1200,7 +1200,7 @@ EventLogger::getText(char * m_text, size_t m_text_len, subId, subKey, err, - GrepError::getErrorDesc((GrepError::Code)err)); + GrepError::getErrorDesc((GrepError::GE_Code)err)); break; } case GrepEvent::GrepPS_SubSyncDataRef: @@ -1217,7 +1217,7 @@ EventLogger::getText(char * m_text, size_t m_text_len, subKey, gci, err, - GrepError::getErrorDesc((GrepError::Code)err)); + GrepError::getErrorDesc((GrepError::GE_Code)err)); break; } case GrepEvent::GrepPS_SubRemoveRef: @@ -1232,7 +1232,7 @@ EventLogger::getText(char * m_text, size_t m_text_len, subId, subKey, err, - GrepError::getErrorDesc((GrepError::Code)err)); + GrepError::getErrorDesc((GrepError::GE_Code)err)); break; } case GrepEvent::Rep_Disconnect: @@ -1244,7 +1244,7 @@ EventLogger::getText(char * m_text, size_t m_text_len, " Error code: %d Error Message: %s", nodeId, err, - GrepError::getErrorDesc((GrepError::Code)err)); + GrepError::getErrorDesc((GrepError::GE_Code)err)); break; } diff --git a/ndb/src/common/debugger/GrepError.cpp b/ndb/src/common/debugger/GrepError.cpp index ec0c26a5855..20aeaa6dd77 100644 --- a/ndb/src/common/debugger/GrepError.cpp +++ b/ndb/src/common/debugger/GrepError.cpp @@ -21,7 +21,7 @@ */ const GrepError::ErrorDescription GrepError::errorDescriptions[] = { - { GrepError::NO_ERROR, + { GrepError::GE_NO_ERROR, "No error" }, { GrepError::SUBSCRIPTION_ID_NOMEM, "Not enough resources to allocate the subscription" }, @@ -119,7 +119,7 @@ GrepError::noOfErrorDescs = sizeof(GrepError::errorDescriptions) / * gets the corresponding error message to an err code */ const char * -GrepError::getErrorDesc(GrepError::Code err) { +GrepError::getErrorDesc(GrepError::GE_Code err) { for(Uint32 i = 0; iuserReference); fprintf(output, " Flags: H\'%.8x, ", sig->fileFlag); - if (sig->getRemoveFileFlag(sig->fileFlag) == true) + if (sig->getRemoveFileFlag(sig->fileFlag)) fprintf(output, "Remove file"); else fprintf(output, "Don't remove file"); diff --git a/ndb/src/common/debugger/signaldata/FsReadWriteReq.cpp b/ndb/src/common/debugger/signaldata/FsReadWriteReq.cpp index 9b32fab87ba..a9f240d3cb4 100644 --- a/ndb/src/common/debugger/signaldata/FsReadWriteReq.cpp +++ b/ndb/src/common/debugger/signaldata/FsReadWriteReq.cpp @@ -31,7 +31,7 @@ printFSREADWRITEREQ(FILE * output, const Uint32 * theData, fprintf(output, " UserReference: H\'%.8x", sig->userReference); fprintf(output, " Operation flag: H\'%.8x (", sig->operationFlag); - if (sig->getSyncFlag(sig->operationFlag) == true) + if (sig->getSyncFlag(sig->operationFlag)) fprintf(output, "Sync,"); else fprintf(output, "No sync,"); diff --git a/ndb/src/common/logger/LogHandlerList.hpp b/ndb/src/common/logger/LogHandlerList.hpp index 7c001a28a76..21344023560 100644 --- a/ndb/src/common/logger/LogHandlerList.hpp +++ b/ndb/src/common/logger/LogHandlerList.hpp @@ -18,6 +18,7 @@ #define LOGHANDLERLIST_H class LogHandler; +#include /** * Provides a simple linked list of log handlers. diff --git a/ndb/src/common/mgmcommon/ConfigRetriever.cpp b/ndb/src/common/mgmcommon/ConfigRetriever.cpp index d8417ac146a..d03d6fbdb6e 100644 --- a/ndb/src/common/mgmcommon/ConfigRetriever.cpp +++ b/ndb/src/common/mgmcommon/ConfigRetriever.cpp @@ -178,9 +178,10 @@ ConfigRetriever::getConfig(NdbMgmHandle m_handle){ return conf; } - + ndb_mgm_configuration * ConfigRetriever::getConfig(const char * filename){ +#ifndef NDB_WIN32 struct stat sbuf; const int res = stat(filename, &sbuf); @@ -217,8 +218,10 @@ ConfigRetriever::getConfig(const char * filename){ return 0; } delete [] buf2; - return (ndb_mgm_configuration*)cvf.m_cfg; +#else + return 0; +#endif } void diff --git a/ndb/src/common/transporter/TransporterRegistry.cpp b/ndb/src/common/transporter/TransporterRegistry.cpp index cacbbed00f1..4dbd9588512 100644 --- a/ndb/src/common/transporter/TransporterRegistry.cpp +++ b/ndb/src/common/transporter/TransporterRegistry.cpp @@ -1167,31 +1167,31 @@ TransporterRegistry::stop_clients() } void -TransporterRegistry::add_transporter_interface(const char *interface, unsigned short port) +TransporterRegistry::add_transporter_interface(const char *interf, unsigned short port) { DBUG_ENTER("TransporterRegistry::add_transporter_interface"); - DBUG_PRINT("enter",("interface=%s, port= %d", interface, port)); - if (interface && strlen(interface) == 0) - interface= 0; + DBUG_PRINT("enter",("interface=%s, port= %d", interf, port)); + if (interf && strlen(interf) == 0) + interf= 0; for (unsigned i= 0; i < m_transporter_interface.size(); i++) { Transporter_interface &tmp= m_transporter_interface[i]; if (port != tmp.m_service_port) continue; - if (interface != 0 && tmp.m_interface != 0 && - strcmp(interface, tmp.m_interface) == 0) + if (interf != 0 && tmp.m_interface != 0 && + strcmp(interf, tmp.m_interface) == 0) { DBUG_VOID_RETURN; // found match, no need to insert } - if (interface == 0 && tmp.m_interface == 0) + if (interf == 0 && tmp.m_interface == 0) { DBUG_VOID_RETURN; // found match, no need to insert } } Transporter_interface t; t.m_service_port= port; - t.m_interface= interface; + t.m_interface= interf; m_transporter_interface.push_back(t); DBUG_PRINT("exit",("interface and port added")); DBUG_VOID_RETURN; @@ -1200,7 +1200,7 @@ TransporterRegistry::add_transporter_interface(const char *interface, unsigned s bool TransporterRegistry::start_service(SocketServer& socket_server) { - if (m_transporter_interface.size() > 0 && nodeIdSpecified != true) + if (m_transporter_interface.size() > 0 && !nodeIdSpecified) { ndbout_c("TransporterRegistry::startReceiving: localNodeId not specified"); return false; diff --git a/ndb/src/kernel/blocks/grep/Grep.hpp b/ndb/src/kernel/blocks/grep/Grep.hpp index eeabac36966..7d3dd916ecc 100644 --- a/ndb/src/kernel/blocks/grep/Grep.hpp +++ b/ndb/src/kernel/blocks/grep/Grep.hpp @@ -380,16 +380,16 @@ public: Uint32 subId, Uint32 subKey, BlockReference to, - GrepError::Code err); + GrepError::GE_Code err); void sendSubRemoveRef_SS(Signal * signal, SubCoordinator sub, - GrepError::Code err); + GrepError::GE_Code err); void sendRefToSS(Signal * signal, SubCoordinator sub, - GrepError::Code err, + GrepError::GE_Code err, SubscriptionData::Part part = (SubscriptionData::Part)0); void setRepRef(BlockReference rr) { m_repRef = rr; }; @@ -496,7 +496,7 @@ public: void sendRefToPSCoord(Signal * signal, Subscription sub, - GrepError::Code err, + GrepError::GE_Code err, SubscriptionData::Part part = (SubscriptionData::Part)0); //protected: diff --git a/ndb/src/kernel/vm/Configuration.cpp b/ndb/src/kernel/vm/Configuration.cpp index b3a436275f7..795670a1322 100644 --- a/ndb/src/kernel/vm/Configuration.cpp +++ b/ndb/src/kernel/vm/Configuration.cpp @@ -556,7 +556,7 @@ Configuration::calcSizeAlt(ConfigValues * ownConfig){ noOfDBNodes++; // No of NDB processes if(nodeId > MAX_NDB_NODES){ - snprintf(buf, sizeof(buf), "Maximum node id for a ndb node is: %d", + BaseString::snprintf(buf, sizeof(buf), "Maximum node id for a ndb node is: %d", MAX_NDB_NODES); ERROR_SET(fatal, ERR_INVALID_CONFIG, msg, buf); } diff --git a/ndb/src/kernel/vm/Configuration.hpp b/ndb/src/kernel/vm/Configuration.hpp index e4cd64f5ca8..34e70ca3121 100644 --- a/ndb/src/kernel/vm/Configuration.hpp +++ b/ndb/src/kernel/vm/Configuration.hpp @@ -21,7 +21,7 @@ #include class ConfigRetriever; -class LocalConfig; +struct LocalConfig; class Configuration { public: diff --git a/ndb/src/kernel/vm/SimplePropertiesSection.cpp b/ndb/src/kernel/vm/SimplePropertiesSection.cpp index d442ff2e698..070563be36b 100644 --- a/ndb/src/kernel/vm/SimplePropertiesSection.cpp +++ b/ndb/src/kernel/vm/SimplePropertiesSection.cpp @@ -19,7 +19,7 @@ #include "LongSignal.hpp" SimplePropertiesSectionReader::SimplePropertiesSectionReader -(class SegmentedSectionPtr & ptr, class SectionSegmentPool & pool) +(struct SegmentedSectionPtr & ptr, class SectionSegmentPool & pool) : m_pool(pool) { if(ptr.p == 0){ @@ -190,7 +190,7 @@ SimplePropertiesSectionWriter::putWords(const Uint32 * src, Uint32 len){ } void -SimplePropertiesSectionWriter::getPtr(class SegmentedSectionPtr & dst){ +SimplePropertiesSectionWriter::getPtr(struct SegmentedSectionPtr & dst){ // Set last ptr and size if(m_pos >= 0){ dst.p = m_head; diff --git a/ndb/src/mgmapi/mgmapi_configuration.cpp b/ndb/src/mgmapi/mgmapi_configuration.cpp index ae7fe2c294c..7bac2d10b92 100644 --- a/ndb/src/mgmapi/mgmapi_configuration.cpp +++ b/ndb/src/mgmapi/mgmapi_configuration.cpp @@ -1,3 +1,4 @@ +#include #include #include "mgmapi_configuration.hpp" #include @@ -138,7 +139,7 @@ ndb_mgm_get_int_parameter(const ndb_mgm_configuration_iterator* iter, extern "C" int ndb_mgm_get_int64_parameter(const ndb_mgm_configuration_iterator* iter, - int param, unsigned long long * value){ + int param, Uint64 * value){ return iter->get(param, value); } diff --git a/ndb/src/mgmapi/mgmapi_configuration.hpp b/ndb/src/mgmapi/mgmapi_configuration.hpp index c7feffd3a4e..9e94b3311bf 100644 --- a/ndb/src/mgmapi/mgmapi_configuration.hpp +++ b/ndb/src/mgmapi/mgmapi_configuration.hpp @@ -21,7 +21,7 @@ struct ndb_mgm_configuration_iterator { int find(int param, unsigned value); int get(int param, unsigned * value) const ; - int get(int param, unsigned long long * value) const ; + int get(int param, Uint64 * value) const ; int get(int param, const char ** value) const ; // diff --git a/ndb/src/mgmsrv/ConfigInfo.cpp b/ndb/src/mgmsrv/ConfigInfo.cpp index ad346b30ead..5f1f0cccb23 100644 --- a/ndb/src/mgmsrv/ConfigInfo.cpp +++ b/ndb/src/mgmsrv/ConfigInfo.cpp @@ -256,9 +256,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "COMPUTER", "COMPUTER", "Computer section", - ConfigInfo::INTERNAL, + ConfigInfo::CI_INTERNAL, false, - ConfigInfo::SECTION, + ConfigInfo::CI_SECTION, 0, 0, 0 }, @@ -267,9 +267,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "Id", "COMPUTER", "Name of computer", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, MANDATORY, 0, 0 }, @@ -278,9 +278,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "HostName", "COMPUTER", "Hostname of computer (e.g. mysql.com)", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, MANDATORY, 0, 0 }, @@ -289,9 +289,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "ByteOrder", "COMPUTER", 0, - ConfigInfo::DEPRICATED, + ConfigInfo::CI_DEPRICATED, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, UNDEFINED, 0, 0 }, @@ -304,9 +304,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "SYSTEM", "SYSTEM", "System section", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::SECTION, + ConfigInfo::CI_SECTION, (const char *)CFG_SECTION_SYSTEM, 0, 0 }, @@ -315,9 +315,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "Name", "SYSTEM", "Name of system (NDB Cluster)", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, MANDATORY, 0, 0 }, @@ -326,9 +326,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "ReplicationRole", "SYSTEM", "Role in Global Replication (None, Primary, or Standby)", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, UNDEFINED, 0, 0 }, @@ -337,9 +337,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "PrimaryMGMNode", "SYSTEM", "Node id of Primary "MGM_TOKEN_PRINT" node", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "0", "0", STR_VALUE(MAX_INT_RNIL) }, @@ -349,9 +349,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "ConfigGenerationNumber", "SYSTEM", "Configuration generation number", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "0", "0", STR_VALUE(MAX_INT_RNIL) }, @@ -364,9 +364,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { DB_TOKEN, DB_TOKEN, "Node section", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::SECTION, + ConfigInfo::CI_SECTION, (const char *)NODE_TYPE_DB, 0, 0 }, @@ -376,9 +376,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "HostName", DB_TOKEN, "Name of computer for this node", - ConfigInfo::INTERNAL, + ConfigInfo::CI_INTERNAL, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, UNDEFINED, 0, 0 }, @@ -387,9 +387,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "System", DB_TOKEN, "Name of system for this node", - ConfigInfo::INTERNAL, + ConfigInfo::CI_INTERNAL, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, UNDEFINED, 0, 0 }, @@ -398,9 +398,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "Id", DB_TOKEN, "Number identifying the database node ("DB_TOKEN_PRINT")", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, MANDATORY, "1", STR_VALUE(MAX_NODES) }, @@ -410,9 +410,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "ServerPort", DB_TOKEN, "Port used to setup transporter", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, UNDEFINED, "1", STR_VALUE(MAX_INT_RNIL) }, @@ -422,9 +422,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "NoOfReplicas", DB_TOKEN, "Number of copies of all data in the database (1-4)", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, MANDATORY, "1", "4" }, @@ -434,9 +434,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "MaxNoOfAttributes", DB_TOKEN, "Total number of attributes stored in database. I.e. sum over all tables", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "1000", "32", STR_VALUE(MAX_INT_RNIL) }, @@ -446,9 +446,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "MaxNoOfTables", DB_TOKEN, "Total number of tables stored in the database", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "128", "8", STR_VALUE(MAX_INT_RNIL) }, @@ -458,9 +458,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "MaxNoOfOrderedIndexes", DB_TOKEN, "Total number of ordered indexes that can be defined in the system", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "128", "0", STR_VALUE(MAX_INT_RNIL) }, @@ -470,9 +470,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "MaxNoOfUniqueHashIndexes", DB_TOKEN, "Total number of unique hash indexes that can be defined in the system", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "64", "0", STR_VALUE(MAX_INT_RNIL) }, @@ -482,9 +482,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "MaxNoOfIndexes", DB_TOKEN, "Total number of indexes that can be defined in the system", - ConfigInfo::DEPRICATED, + ConfigInfo::CI_DEPRICATED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "128", "0", STR_VALUE(MAX_INT_RNIL) }, @@ -494,9 +494,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "MaxNoOfConcurrentIndexOperations", DB_TOKEN, "Total number of index operations that can execute simultaneously on one "DB_TOKEN_PRINT" node", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "8K", "0", STR_VALUE(MAX_INT_RNIL) @@ -507,9 +507,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "MaxNoOfTriggers", DB_TOKEN, "Total number of triggers that can be defined in the system", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "768", "0", STR_VALUE(MAX_INT_RNIL) }, @@ -519,9 +519,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "MaxNoOfFiredTriggers", DB_TOKEN, "Total number of triggers that can fire simultaneously in one "DB_TOKEN_PRINT" node", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "4000", "0", STR_VALUE(MAX_INT_RNIL) }, @@ -531,9 +531,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "ExecuteOnComputer", DB_TOKEN, "String referencing an earlier defined COMPUTER", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, UNDEFINED, 0, 0 }, @@ -542,9 +542,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "MaxNoOfSavedMessages", DB_TOKEN, "Max number of error messages in error log and max number of trace files", - ConfigInfo::USED, + ConfigInfo::CI_USED, true, - ConfigInfo::INT, + ConfigInfo::CI_INT, "25", "0", STR_VALUE(MAX_INT_RNIL) }, @@ -554,9 +554,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "LockPagesInMainMemory", DB_TOKEN, "If set to yes, then NDB Cluster data will not be swapped out to disk", - ConfigInfo::USED, + ConfigInfo::CI_USED, true, - ConfigInfo::BOOL, + ConfigInfo::CI_BOOL, "false", "false", "true" }, @@ -566,9 +566,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "TimeBetweenWatchDogCheck", DB_TOKEN, "Time between execution checks inside a database node", - ConfigInfo::USED, + ConfigInfo::CI_USED, true, - ConfigInfo::INT, + ConfigInfo::CI_INT, "6000", "70", STR_VALUE(MAX_INT_RNIL) }, @@ -578,9 +578,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "StopOnError", DB_TOKEN, "If set to N, "DB_TOKEN_PRINT" automatically restarts/recovers in case of node failure", - ConfigInfo::USED, + ConfigInfo::CI_USED, true, - ConfigInfo::BOOL, + ConfigInfo::CI_BOOL, "true", "false", "true" }, @@ -590,9 +590,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "RestartOnErrorInsert", DB_TOKEN, "See src/kernel/vm/Emulator.hpp NdbRestartType for details", - ConfigInfo::INTERNAL, + ConfigInfo::CI_INTERNAL, true, - ConfigInfo::INT, + ConfigInfo::CI_INT, "2", "0", "4" }, @@ -602,9 +602,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "MaxNoOfConcurrentOperations", DB_TOKEN, "Max number of operation records in transaction coordinator", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "32k", "32", STR_VALUE(MAX_INT_RNIL) }, @@ -614,9 +614,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "MaxNoOfLocalOperations", DB_TOKEN, "Max number of operation records defined in the local storage node", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, UNDEFINED, "32", STR_VALUE(MAX_INT_RNIL) }, @@ -626,9 +626,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "MaxNoOfLocalScans", DB_TOKEN, "Max number of fragment scans in parallel in the local storage node", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, UNDEFINED, "32", STR_VALUE(MAX_INT_RNIL) }, @@ -638,9 +638,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "BatchSizePerLocalScan", DB_TOKEN, "Used to calculate the number of lock records for scan with hold lock", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, STR_VALUE(DEF_BATCH_SIZE), "1", STR_VALUE(MAX_PARALLEL_OP_PER_SCAN) }, @@ -650,9 +650,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "MaxNoOfConcurrentTransactions", DB_TOKEN, "Max number of transaction executing concurrently on the "DB_TOKEN_PRINT" node", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "4096", "32", STR_VALUE(MAX_INT_RNIL) }, @@ -662,9 +662,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "MaxNoOfConcurrentScans", DB_TOKEN, "Max number of scans executing concurrently on the "DB_TOKEN_PRINT" node", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "256", "2", "500" }, @@ -674,9 +674,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "TransactionBufferMemory", DB_TOKEN, "Dynamic buffer space (in bytes) for key and attribute data allocated for each "DB_TOKEN_PRINT" node", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "1M", "1K", STR_VALUE(MAX_INT_RNIL) }, @@ -686,9 +686,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "IndexMemory", DB_TOKEN, "Number bytes on each "DB_TOKEN_PRINT" node allocated for storing indexes", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT64, + ConfigInfo::CI_INT64, "18M", "1M", "1024G" }, @@ -698,9 +698,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "DataMemory", DB_TOKEN, "Number bytes on each "DB_TOKEN_PRINT" node allocated for storing data", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT64, + ConfigInfo::CI_INT64, "80M", "1M", "1024G" }, @@ -710,9 +710,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "UndoIndexBuffer", DB_TOKEN, "Number bytes on each "DB_TOKEN_PRINT" node allocated for writing UNDO logs for index part", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "2M", "1M", STR_VALUE(MAX_INT_RNIL)}, @@ -722,9 +722,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "UndoDataBuffer", DB_TOKEN, "Number bytes on each "DB_TOKEN_PRINT" node allocated for writing UNDO logs for data part", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "16M", "1M", STR_VALUE(MAX_INT_RNIL)}, @@ -734,9 +734,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "RedoBuffer", DB_TOKEN, "Number bytes on each "DB_TOKEN_PRINT" node allocated for writing REDO logs", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "8M", "1M", STR_VALUE(MAX_INT_RNIL)}, @@ -746,9 +746,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "LongMessageBuffer", DB_TOKEN, "Number bytes on each "DB_TOKEN_PRINT" node allocated for internal long messages", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "1M", "512k", STR_VALUE(MAX_INT_RNIL)}, @@ -758,9 +758,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "StartPartialTimeout", DB_TOKEN, "Time to wait before trying to start wo/ all nodes. 0=Wait forever", - ConfigInfo::USED, + ConfigInfo::CI_USED, true, - ConfigInfo::INT, + ConfigInfo::CI_INT, "30000", "0", STR_VALUE(MAX_INT_RNIL) }, @@ -770,9 +770,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "StartPartitionedTimeout", DB_TOKEN, "Time to wait before trying to start partitioned. 0=Wait forever", - ConfigInfo::USED, + ConfigInfo::CI_USED, true, - ConfigInfo::INT, + ConfigInfo::CI_INT, "60000", "0", STR_VALUE(MAX_INT_RNIL) }, @@ -782,9 +782,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "StartFailureTimeout", DB_TOKEN, "Time to wait before terminating. 0=Wait forever", - ConfigInfo::USED, + ConfigInfo::CI_USED, true, - ConfigInfo::INT, + ConfigInfo::CI_INT, "0", "0", STR_VALUE(MAX_INT_RNIL) }, @@ -794,9 +794,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "HeartbeatIntervalDbDb", DB_TOKEN, "Time between "DB_TOKEN_PRINT"-"DB_TOKEN_PRINT" heartbeats. "DB_TOKEN_PRINT" considered dead after 3 missed HBs", - ConfigInfo::USED, + ConfigInfo::CI_USED, true, - ConfigInfo::INT, + ConfigInfo::CI_INT, "1500", "10", STR_VALUE(MAX_INT_RNIL) }, @@ -806,9 +806,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "HeartbeatIntervalDbApi", DB_TOKEN, "Time between "API_TOKEN_PRINT"-"DB_TOKEN_PRINT" heartbeats. "API_TOKEN_PRINT" connection closed after 3 missed HBs", - ConfigInfo::USED, + ConfigInfo::CI_USED, true, - ConfigInfo::INT, + ConfigInfo::CI_INT, "1500", "100", STR_VALUE(MAX_INT_RNIL) }, @@ -818,9 +818,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "TimeBetweenLocalCheckpoints", DB_TOKEN, "Time between taking snapshots of the database (expressed in 2log of bytes)", - ConfigInfo::USED, + ConfigInfo::CI_USED, true, - ConfigInfo::INT, + ConfigInfo::CI_INT, "20", "0", "31" }, @@ -830,9 +830,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "TimeBetweenGlobalCheckpoints", DB_TOKEN, "Time between doing group commit of transactions to disk", - ConfigInfo::USED, + ConfigInfo::CI_USED, true, - ConfigInfo::INT, + ConfigInfo::CI_INT, "2000", "10", "32000" }, @@ -842,9 +842,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "NoOfFragmentLogFiles", DB_TOKEN, "No of 16 Mbyte Redo log files in each of 4 file sets belonging to "DB_TOKEN_PRINT" node", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "8", "1", STR_VALUE(MAX_INT_RNIL) }, @@ -854,9 +854,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "MaxNoOfOpenFiles", DB_TOKEN, "Max number of files open per "DB_TOKEN_PRINT" node.(One thread is created per file)", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "40", "20", "256" }, @@ -867,9 +867,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "TimeBetweenInactiveTransactionAbortCheck", DB_TOKEN, "Time between inactive transaction checks", - ConfigInfo::USED, + ConfigInfo::CI_USED, true, - ConfigInfo::INT, + ConfigInfo::CI_INT, "1000", "1000", STR_VALUE(MAX_INT_RNIL) }, @@ -883,9 +883,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "to execute or send another part (query, statement) of the transaction.\n" "If the application takes too long time, the transaction gets aborted.\n" "Timeout set to 0 means that we don't timeout at all on application wait.", - ConfigInfo::USED, + ConfigInfo::CI_USED, true, - ConfigInfo::INT, + ConfigInfo::CI_INT, STR_VALUE(MAX_INT_RNIL), "0", STR_VALUE(MAX_INT_RNIL) }, @@ -898,9 +898,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "This is the time the transaction coordinator waits for each database node\n" "of the transaction to execute a request. If the database node takes too\n" "long time, the transaction gets aborted.", - ConfigInfo::USED, + ConfigInfo::CI_USED, true, - ConfigInfo::INT, + ConfigInfo::CI_INT, "1200", "50", STR_VALUE(MAX_INT_RNIL) }, @@ -910,9 +910,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "NoOfDiskPagesToDiskDuringRestartTUP", DB_TOKEN, "?", - ConfigInfo::USED, + ConfigInfo::CI_USED, true, - ConfigInfo::INT, + ConfigInfo::CI_INT, "40", "1", STR_VALUE(MAX_INT_RNIL) }, @@ -922,9 +922,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "NoOfDiskPagesToDiskAfterRestartTUP", DB_TOKEN, "?", - ConfigInfo::USED, + ConfigInfo::CI_USED, true, - ConfigInfo::INT, + ConfigInfo::CI_INT, "40", "1", STR_VALUE(MAX_INT_RNIL) }, @@ -934,9 +934,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "NoOfDiskPagesToDiskDuringRestartACC", DB_TOKEN, "?", - ConfigInfo::USED, + ConfigInfo::CI_USED, true, - ConfigInfo::INT, + ConfigInfo::CI_INT, "20", "1", STR_VALUE(MAX_INT_RNIL) }, @@ -946,9 +946,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "NoOfDiskPagesToDiskAfterRestartACC", DB_TOKEN, "?", - ConfigInfo::USED, + ConfigInfo::CI_USED, true, - ConfigInfo::INT, + ConfigInfo::CI_INT, "20", "1", STR_VALUE(MAX_INT_RNIL) }, @@ -959,9 +959,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "Diskless", DB_TOKEN, "Run wo/ disk", - ConfigInfo::USED, + ConfigInfo::CI_USED, true, - ConfigInfo::BOOL, + ConfigInfo::CI_BOOL, "false", "false", "true"}, @@ -971,9 +971,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "Discless", DB_TOKEN, "Diskless", - ConfigInfo::DEPRICATED, + ConfigInfo::CI_DEPRICATED, true, - ConfigInfo::BOOL, + ConfigInfo::CI_BOOL, "false", "false", "true"}, @@ -985,9 +985,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "ArbitrationTimeout", DB_TOKEN, "Max time (milliseconds) database partion waits for arbitration signal", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "3000", "10", STR_VALUE(MAX_INT_RNIL) }, @@ -997,9 +997,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "DataDir", DB_TOKEN, "Data directory for this node", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, MYSQLCLUSTERDIR, 0, 0 }, @@ -1008,9 +1008,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "FileSystemPath", DB_TOKEN, "Path to directory where the "DB_TOKEN_PRINT" node stores its data (directory must exist)", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, UNDEFINED, 0, 0 }, @@ -1019,9 +1019,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "LogLevelStartup", DB_TOKEN, "Node startup info printed on stdout", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "1", "0", "15" }, @@ -1031,9 +1031,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "LogLevelShutdown", DB_TOKEN, "Node shutdown info printed on stdout", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "0", "0", "15" }, @@ -1043,9 +1043,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "LogLevelStatistic", DB_TOKEN, "Transaction, operation, transporter info printed on stdout", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "0", "0", "15" }, @@ -1055,9 +1055,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "LogLevelCheckpoint", DB_TOKEN, "Local and Global checkpoint info printed on stdout", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "0", "0", "15" }, @@ -1067,9 +1067,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "LogLevelNodeRestart", DB_TOKEN, "Node restart, node failure info printed on stdout", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "0", "0", "15" }, @@ -1079,9 +1079,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "LogLevelConnection", DB_TOKEN, "Node connect/disconnect info printed on stdout", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "0", "0", "15" }, @@ -1091,9 +1091,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "LogLevelError", DB_TOKEN, "Transporter, heartbeat errors printed on stdout", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "0", "0", "15" }, @@ -1103,9 +1103,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "LogLevelInfo", DB_TOKEN, "Heartbeat and log info printed on stdout", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "0", "0", "15" }, @@ -1118,9 +1118,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "ParallelBackups", DB_TOKEN, "Maximum number of parallel backups", - ConfigInfo::NOTIMPLEMENTED, + ConfigInfo::CI_NOTIMPLEMENTED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "1", "1", "1" }, @@ -1130,9 +1130,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "BackupDataDir", DB_TOKEN, "Path to where to store backups", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, UNDEFINED, 0, 0 }, @@ -1141,9 +1141,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "BackupMemory", DB_TOKEN, "Total memory allocated for backups per node (in bytes)", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "4M", // sum of BackupDataBufferSize and BackupLogBufferSize "0", STR_VALUE(MAX_INT_RNIL) }, @@ -1153,9 +1153,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "BackupDataBufferSize", DB_TOKEN, "Default size of databuffer for a backup (in bytes)", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "2M", // remember to change BackupMemory "0", STR_VALUE(MAX_INT_RNIL) }, @@ -1165,9 +1165,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "BackupLogBufferSize", DB_TOKEN, "Default size of logbuffer for a backup (in bytes)", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "2M", // remember to change BackupMemory "0", STR_VALUE(MAX_INT_RNIL) }, @@ -1177,9 +1177,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "BackupWriteSize", DB_TOKEN, "Default size of filesystem writes made by backup (in bytes)", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "32K", "0", STR_VALUE(MAX_INT_RNIL) }, @@ -1192,9 +1192,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "REP", "REP", "Node section", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::SECTION, + ConfigInfo::CI_SECTION, (const char *)NODE_TYPE_REP, 0, 0 }, @@ -1204,9 +1204,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "HostName", "REP", "Name of computer for this node", - ConfigInfo::INTERNAL, + ConfigInfo::CI_INTERNAL, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, UNDEFINED, 0, 0 }, @@ -1215,9 +1215,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "System", "REP", "Name of system for this node", - ConfigInfo::INTERNAL, + ConfigInfo::CI_INTERNAL, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, UNDEFINED, 0, 0 }, @@ -1226,9 +1226,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "Id", "REP", "Number identifying replication node (REP)", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, MANDATORY, "1", STR_VALUE(MAX_NODES) }, @@ -1238,9 +1238,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "ExecuteOnComputer", "REP", "String referencing an earlier defined COMPUTER", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, MANDATORY, 0, 0 }, @@ -1249,9 +1249,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "HeartbeatIntervalRepRep", "REP", "Time between REP-REP heartbeats. Connection closed after 3 missed HBs", - ConfigInfo::USED, + ConfigInfo::CI_USED, true, - ConfigInfo::INT, + ConfigInfo::CI_INT, "3000", "100", STR_VALUE(MAX_INT_RNIL) }, @@ -1264,9 +1264,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { API_TOKEN, API_TOKEN, "Node section", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::SECTION, + ConfigInfo::CI_SECTION, (const char *)NODE_TYPE_API, 0, 0 }, @@ -1276,9 +1276,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "HostName", API_TOKEN, "Name of computer for this node", - ConfigInfo::INTERNAL, + ConfigInfo::CI_INTERNAL, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, UNDEFINED, 0, 0 }, @@ -1287,9 +1287,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "System", API_TOKEN, "Name of system for this node", - ConfigInfo::INTERNAL, + ConfigInfo::CI_INTERNAL, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, UNDEFINED, 0, 0 }, @@ -1298,9 +1298,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "Id", API_TOKEN, "Number identifying application node ("API_TOKEN_PRINT")", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, MANDATORY, "1", STR_VALUE(MAX_NODES) }, @@ -1310,9 +1310,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "ExecuteOnComputer", API_TOKEN, "String referencing an earlier defined COMPUTER", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, UNDEFINED, 0, 0 }, @@ -1321,9 +1321,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "ArbitrationRank", API_TOKEN, "If 0, then "API_TOKEN_PRINT" is not arbitrator. Kernel selects arbitrators in order 1, 2", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "0", "0", "2" }, @@ -1333,9 +1333,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "ArbitrationDelay", API_TOKEN, "When asked to arbitrate, arbitrator waits this long before voting (msec)", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "0", "0", STR_VALUE(MAX_INT_RNIL) }, @@ -1345,9 +1345,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "MaxScanBatchSize", "API", "The maximum collective batch size for one scan", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, STR_VALUE(MAX_SCAN_BATCH_SIZE), "32k", "16M" }, @@ -1357,9 +1357,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "BatchByteSize", "API", "The default batch size in bytes", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, STR_VALUE(SCAN_BATCH_SIZE), "1k", "1M" }, @@ -1369,9 +1369,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "BatchSize", "API", "The default batch size in number of records", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, STR_VALUE(DEF_BATCH_SIZE), "1", STR_VALUE(MAX_PARALLEL_OP_PER_SCAN) }, @@ -1384,9 +1384,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { MGM_TOKEN, MGM_TOKEN, "Node section", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::SECTION, + ConfigInfo::CI_SECTION, (const char *)NODE_TYPE_MGM, 0, 0 }, @@ -1396,9 +1396,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "HostName", MGM_TOKEN, "Name of computer for this node", - ConfigInfo::INTERNAL, + ConfigInfo::CI_INTERNAL, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, UNDEFINED, 0, 0 }, @@ -1407,9 +1407,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "DataDir", MGM_TOKEN, "Data directory for this node", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, MYSQLCLUSTERDIR, 0, 0 }, @@ -1418,9 +1418,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "System", MGM_TOKEN, "Name of system for this node", - ConfigInfo::INTERNAL, + ConfigInfo::CI_INTERNAL, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, UNDEFINED, 0, 0 }, @@ -1429,9 +1429,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "Id", MGM_TOKEN, "Number identifying the management server node ("MGM_TOKEN_PRINT")", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, MANDATORY, "1", STR_VALUE(MAX_NODES) }, @@ -1441,9 +1441,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "LogDestination", MGM_TOKEN, "String describing where logmessages are sent", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, 0, 0, 0 }, @@ -1452,9 +1452,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "ExecuteOnComputer", MGM_TOKEN, "String referencing an earlier defined COMPUTER", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, 0, 0, 0 }, @@ -1463,9 +1463,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "MaxNoOfSavedEvents", MGM_TOKEN, "", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "100", "0", STR_VALUE(MAX_INT_RNIL) }, @@ -1475,9 +1475,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "PortNumber", MGM_TOKEN, "Port number to give commands to/fetch configurations from management server", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, NDB_BASE_PORT, "0", STR_VALUE(MAX_INT_RNIL) }, @@ -1487,9 +1487,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "PortNumberStats", MGM_TOKEN, "Port number used to get statistical information from a management server", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "2199", "0", STR_VALUE(MAX_INT_RNIL) }, @@ -1499,9 +1499,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "ArbitrationRank", MGM_TOKEN, "If 0, then "MGM_TOKEN_PRINT" is not arbitrator. Kernel selects arbitrators in order 1, 2", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "1", "0", "2" }, @@ -1511,9 +1511,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "ArbitrationDelay", MGM_TOKEN, "", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "0", "0", STR_VALUE(MAX_INT_RNIL) }, @@ -1526,9 +1526,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "TCP", "TCP", "Connection section", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::SECTION, + ConfigInfo::CI_SECTION, (const char *)CONNECTION_TYPE_TCP, 0, 0 }, @@ -1538,9 +1538,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "HostName1", "TCP", "Name/IP of computer on one side of the connection", - ConfigInfo::INTERNAL, + ConfigInfo::CI_INTERNAL, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, UNDEFINED, 0, 0 }, @@ -1549,9 +1549,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "HostName2", "TCP", "Name/IP of computer on one side of the connection", - ConfigInfo::INTERNAL, + ConfigInfo::CI_INTERNAL, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, UNDEFINED, 0, 0 }, @@ -1560,9 +1560,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "NodeId1", "TCP", "Id of node ("DB_TOKEN_PRINT", "API_TOKEN_PRINT" or "MGM_TOKEN_PRINT") on one side of the connection", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, MANDATORY, 0, 0 }, @@ -1571,9 +1571,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "NodeId2", "TCP", "Id of node ("DB_TOKEN_PRINT", "API_TOKEN_PRINT" or "MGM_TOKEN_PRINT") on one side of the connection", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, MANDATORY, 0, 0 }, @@ -1582,9 +1582,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "SendSignalId", "TCP", "Sends id in each signal. Used in trace files.", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::BOOL, + ConfigInfo::CI_BOOL, "true", "false", "true" }, @@ -1595,9 +1595,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "Checksum", "TCP", "If checksum is enabled, all signals between nodes are checked for errors", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::BOOL, + ConfigInfo::CI_BOOL, "false", "false", "true" }, @@ -1607,9 +1607,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "PortNumber", "TCP", "Port used for this transporter", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, MANDATORY, "0", STR_VALUE(MAX_INT_RNIL) }, @@ -1619,9 +1619,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "SendBufferMemory", "TCP", "Bytes of buffer for signals sent from this node", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "256K", "16K", STR_VALUE(MAX_INT_RNIL) }, @@ -1631,9 +1631,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "ReceiveBufferMemory", "TCP", "Bytes of buffer for signals received by this node", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "64K", "16K", STR_VALUE(MAX_INT_RNIL) }, @@ -1643,9 +1643,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "Proxy", "TCP", "", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, UNDEFINED, 0, 0 }, @@ -1654,9 +1654,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "NodeId1_System", "TCP", "System for node 1 in connection", - ConfigInfo::INTERNAL, + ConfigInfo::CI_INTERNAL, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, UNDEFINED, 0, 0 }, @@ -1665,9 +1665,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "NodeId2_System", "TCP", "System for node 2 in connection", - ConfigInfo::INTERNAL, + ConfigInfo::CI_INTERNAL, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, UNDEFINED, 0, 0 }, @@ -1680,9 +1680,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "SHM", "SHM", "Connection section", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::SECTION, + ConfigInfo::CI_SECTION, (const char *)CONNECTION_TYPE_SHM, 0, 0 }, @@ -1691,9 +1691,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "NodeId1", "SHM", "Id of node ("DB_TOKEN_PRINT", "API_TOKEN_PRINT" or "MGM_TOKEN_PRINT") on one side of the connection", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, MANDATORY, 0, 0 }, @@ -1702,9 +1702,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "PortNumber", "SHM", "Port used for this transporter", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, MANDATORY, "0", STR_VALUE(MAX_INT_RNIL) }, @@ -1714,9 +1714,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "NodeId2", "SHM", "Id of node ("DB_TOKEN_PRINT", "API_TOKEN_PRINT" or "MGM_TOKEN_PRINT") on one side of the connection", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, MANDATORY, 0, 0 }, @@ -1725,9 +1725,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "SendSignalId", "SHM", "Sends id in each signal. Used in trace files.", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::BOOL, + ConfigInfo::CI_BOOL, "false", "false", "true" }, @@ -1738,9 +1738,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "Checksum", "SHM", "If checksum is enabled, all signals between nodes are checked for errors", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::BOOL, + ConfigInfo::CI_BOOL, "true", "false", "true" }, @@ -1750,9 +1750,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "ShmKey", "SHM", "A shared memory key", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, MANDATORY, "0", STR_VALUE(MAX_INT_RNIL) }, @@ -1762,9 +1762,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "ShmSize", "SHM", "Size of shared memory segment", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "1M", "4K", STR_VALUE(MAX_INT_RNIL) }, @@ -1774,9 +1774,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "NodeId1_System", "SHM", "System for node 1 in connection", - ConfigInfo::INTERNAL, + ConfigInfo::CI_INTERNAL, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, UNDEFINED, 0, 0 }, @@ -1785,9 +1785,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "NodeId2_System", "SHM", "System for node 2 in connection", - ConfigInfo::INTERNAL, + ConfigInfo::CI_INTERNAL, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, UNDEFINED, 0, 0 }, @@ -1799,9 +1799,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "SCI", "SCI", "Connection section", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::SECTION, + ConfigInfo::CI_SECTION, (const char *)CONNECTION_TYPE_SCI, 0, 0 }, @@ -1811,9 +1811,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "NodeId1", "SCI", "Id of node ("DB_TOKEN_PRINT", "API_TOKEN_PRINT" or "MGM_TOKEN_PRINT") on one side of the connection", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, MANDATORY, "0", STR_VALUE(MAX_INT_RNIL) }, @@ -1823,9 +1823,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "NodeId2", "SCI", "Id of node ("DB_TOKEN_PRINT", "API_TOKEN_PRINT" or "MGM_TOKEN_PRINT") on one side of the connection", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, MANDATORY, "0", STR_VALUE(MAX_INT_RNIL) }, @@ -1835,9 +1835,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "HostName1", "SCI", "Name/IP of computer on one side of the connection", - ConfigInfo::INTERNAL, + ConfigInfo::CI_INTERNAL, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, UNDEFINED, 0, 0 }, @@ -1846,9 +1846,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "HostName2", "SCI", "Name/IP of computer on one side of the connection", - ConfigInfo::INTERNAL, + ConfigInfo::CI_INTERNAL, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, UNDEFINED, 0, 0 }, @@ -1857,9 +1857,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "PortNumber", "SCI", "Port used for this transporter", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, MANDATORY, "0", STR_VALUE(MAX_INT_RNIL) }, @@ -1869,9 +1869,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "Host1SciId0", "SCI", "SCI-node id for adapter 0 on Host1 (a computer can have two adapters)", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, MANDATORY, "0", STR_VALUE(MAX_INT_RNIL) }, @@ -1881,9 +1881,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "Host1SciId1", "SCI", "SCI-node id for adapter 1 on Host1 (a computer can have two adapters)", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "0", "0", STR_VALUE(MAX_INT_RNIL) }, @@ -1893,9 +1893,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "Host2SciId0", "SCI", "SCI-node id for adapter 0 on Host2 (a computer can have two adapters)", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, MANDATORY, "0", STR_VALUE(MAX_INT_RNIL) }, @@ -1905,9 +1905,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "Host2SciId1", "SCI", "SCI-node id for adapter 1 on Host2 (a computer can have two adapters)", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "0", "0", STR_VALUE(MAX_INT_RNIL) }, @@ -1917,9 +1917,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "SendSignalId", "SCI", "Sends id in each signal. Used in trace files.", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::BOOL, + ConfigInfo::CI_BOOL, "true", "false", "true" }, @@ -1929,9 +1929,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "Checksum", "SCI", "If checksum is enabled, all signals between nodes are checked for errors", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::BOOL, + ConfigInfo::CI_BOOL, "false", "false", "true" }, @@ -1941,9 +1941,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "SendLimit", "SCI", "Transporter send buffer contents are sent when this no of bytes is buffered", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "8K", "128", "32K" }, @@ -1953,9 +1953,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "SharedBufferSize", "SCI", "Size of shared memory segment", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "1M", "64K", STR_VALUE(MAX_INT_RNIL) }, @@ -1965,9 +1965,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "NodeId1_System", "SCI", "System for node 1 in connection", - ConfigInfo::INTERNAL, + ConfigInfo::CI_INTERNAL, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, UNDEFINED, 0, 0 }, @@ -1976,9 +1976,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "NodeId2_System", "SCI", "System for node 2 in connection", - ConfigInfo::INTERNAL, + ConfigInfo::CI_INTERNAL, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, UNDEFINED, 0, 0 }, @@ -1990,9 +1990,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "OSE", "OSE", "Connection section", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::SECTION, + ConfigInfo::CI_SECTION, (const char *)CONNECTION_TYPE_OSE, 0, 0 }, @@ -2002,9 +2002,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "HostName1", "OSE", "Name of computer on one side of the connection", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, UNDEFINED, 0, 0 }, @@ -2013,9 +2013,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "HostName2", "OSE", "Name of computer on one side of the connection", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, UNDEFINED, 0, 0 }, @@ -2024,9 +2024,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "NodeId1", "OSE", "Id of node ("DB_TOKEN_PRINT", "API_TOKEN_PRINT" or "MGM_TOKEN_PRINT") on one side of the connection", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, MANDATORY, "0", STR_VALUE(MAX_INT_RNIL) }, @@ -2036,9 +2036,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "NodeId2", "OSE", "Id of node ("DB_TOKEN_PRINT", "API_TOKEN_PRINT" or "MGM_TOKEN_PRINT") on one side of the connection", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, UNDEFINED, "0", STR_VALUE(MAX_INT_RNIL) }, @@ -2048,9 +2048,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "SendSignalId", "OSE", "Sends id in each signal. Used in trace files.", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::BOOL, + ConfigInfo::CI_BOOL, "true", "false", "true" }, @@ -2060,9 +2060,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "Checksum", "OSE", "If checksum is enabled, all signals between nodes are checked for errors", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::BOOL, + ConfigInfo::CI_BOOL, "false", "false", "true" }, @@ -2072,9 +2072,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "PrioASignalSize", "OSE", "Size of priority A signals (in bytes)", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "1000", "0", STR_VALUE(MAX_INT_RNIL) }, @@ -2084,9 +2084,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "PrioBSignalSize", "OSE", "Size of priority B signals (in bytes)", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "1000", "0", STR_VALUE(MAX_INT_RNIL) }, @@ -2096,9 +2096,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "ReceiveArraySize", "OSE", "Number of OSE signals checked for correct ordering (in no of OSE signals)", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::INT, + ConfigInfo::CI_INT, "10", "0", STR_VALUE(MAX_INT_RNIL) }, @@ -2108,9 +2108,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "NodeId1_System", "OSE", "System for node 1 in connection", - ConfigInfo::INTERNAL, + ConfigInfo::CI_INTERNAL, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, UNDEFINED, 0, 0 }, @@ -2119,9 +2119,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "NodeId2_System", "OSE", "System for node 2 in connection", - ConfigInfo::INTERNAL, + ConfigInfo::CI_INTERNAL, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, UNDEFINED, 0, 0 }, }; @@ -2169,7 +2169,7 @@ ConfigInfo::ConfigInfo() } switch (param._type) { - case BOOL: + case CI_BOOL: { bool tmp_bool; require(InitConfigFileParser::convertStringToBool(param._min, tmp_bool)); @@ -2178,8 +2178,8 @@ ConfigInfo::ConfigInfo() pinfo.put64("Max", tmp_bool); break; } - case INT: - case INT64: + case CI_INT: + case CI_INT64: { Uint64 tmp_uint64; require(InitConfigFileParser::convertStringToUint64(param._min, tmp_uint64)); @@ -2188,10 +2188,10 @@ ConfigInfo::ConfigInfo() pinfo.put64("Max", tmp_uint64); break; } - case SECTION: + case CI_SECTION: pinfo.put("SectionType", (Uint32)UintPtr(param._default)); break; - case STRING: + case CI_STRING: break; } @@ -2209,7 +2209,7 @@ ConfigInfo::ConfigInfo() // Replace section with modified section m_info.put(param._section, section, true); - if(param._type != ConfigInfo::SECTION){ + if(param._type != ConfigInfo::CI_SECTION){ Properties * p; if(!m_systemDefaults.getCopy(param._section, &p)){ p = new Properties(true); @@ -2218,20 +2218,20 @@ ConfigInfo::ConfigInfo() param._default != MANDATORY){ switch (param._type) { - case SECTION: + case CI_SECTION: break; - case STRING: + case CI_STRING: require(p->put(param._fname, param._default)); break; - case BOOL: + case CI_BOOL: { bool tmp_bool; require(InitConfigFileParser::convertStringToBool(param._default, default_bool)); require(p->put(param._fname, default_bool)); break; } - case INT: - case INT64: + case CI_INT: + case CI_INT64: { Uint64 tmp_uint64; require(InitConfigFileParser::convertStringToUint64(param._default, default_uint64)); @@ -2253,7 +2253,7 @@ ConfigInfo::ConfigInfo() exit(-1); } - if(m_ParamInfo[i]._type == ConfigInfo::SECTION) + if(m_ParamInfo[i]._type == ConfigInfo::CI_SECTION) continue; const Properties * p = getInfo(m_ParamInfo[i]._section); @@ -2272,12 +2272,12 @@ ConfigInfo::ConfigInfo() * Getters ****************************************************************************/ inline void warning(const char * src, const char * arg){ - ndbout << "Illegal call to ConfigInfo::" << src << "() - " << arg << endl; + ndbout << "Illegal call to ConfigInfo::CI_" << src << "() - " << arg << endl; abort(); } const Properties * -ConfigInfo::getInfo(const char * section) const { +ConfigInfo::CI_getInfo(const char * section) const { const Properties * p; if(!m_info.get(section, &p)){ return 0; @@ -2391,41 +2391,41 @@ ConfigInfo::getType(const Properties * section, const char* fname) const { return (ConfigInfo::Type) getInfoInt(section, fname, "Type"); } -ConfigInfo::Status -ConfigInfo::getStatus(const Properties * section, const char* fname) const { - return (ConfigInfo::Status) getInfoInt(section, fname, "Status"); +ConfigInfo::CI_Status +ConfigInfo::CI_getStatus(const Properties * section, const char* fname) const { + return (ConfigInfo::CI_Status) getInfoInt(section, fname, "Status"); } /**************************************************************************** * Printers ****************************************************************************/ -void ConfigInfo::print() const { +void ConfigInfo::CI_print() const { Properties::Iterator it(&m_info); for (const char* n = it.first(); n != NULL; n = it.next()) { print(n); } } -void ConfigInfo::print(const char* section) const { +void ConfigInfo::CI_print(const char* section) const { ndbout << "****** " << section << " ******" << endl << endl; const Properties * sec = getInfo(section); Properties::Iterator it(sec); for (const char* n = it.first(); n != NULL; n = it.next()) { // Skip entries with different F- and P-names - if (getStatus(sec, n) == ConfigInfo::INTERNAL) continue; - if (getStatus(sec, n) == ConfigInfo::DEPRICATED) continue; - if (getStatus(sec, n) == ConfigInfo::NOTIMPLEMENTED) continue; + if (getStatus(sec, n) == ConfigInfo::CI_INTERNAL) continue; + if (getStatus(sec, n) == ConfigInfo::CI_DEPRICATED) continue; + if (getStatus(sec, n) == ConfigInfo::CI_NOTIMPLEMENTED) continue; print(sec, n); } } -void ConfigInfo::print(const Properties * section, +void ConfigInfo::CI_print(const Properties * section, const char* parameter) const { ndbout << parameter; // ndbout << getDescription(section, parameter) << endl; switch (getType(section, parameter)) { - case ConfigInfo::BOOL: + case ConfigInfo::CI_BOOL: ndbout << " (Boolean value)" << endl; ndbout << getDescription(section, parameter) << endl; if (getDefault(section, parameter) == false) { @@ -2440,8 +2440,8 @@ void ConfigInfo::print(const Properties * section, ndbout << endl; break; - case ConfigInfo::INT: - case ConfigInfo::INT64: + case ConfigInfo::CI_INT: + case ConfigInfo::CI_INT64: ndbout << " (Non-negative Integer)" << endl; ndbout << getDescription(section, parameter) << endl; if (getDefault(section, parameter) == (UintPtr)MANDATORY) { @@ -2456,7 +2456,7 @@ void ConfigInfo::print(const Properties * section, ndbout << endl; break; - case ConfigInfo::STRING: + case ConfigInfo::CI_STRING: ndbout << " (String)" << endl; ndbout << getDescription(section, parameter) << endl; if (getDefault(section, parameter) == (UintPtr)MANDATORY) { @@ -2466,7 +2466,7 @@ void ConfigInfo::print(const Properties * section, } ndbout << endl; break; - case ConfigInfo::SECTION: + case ConfigInfo::CI_SECTION: break; } } @@ -2743,29 +2743,29 @@ applyDefaultValues(InitConfigFileParser::Context & ctx, Properties::Iterator it(defaults); for(const char * name = it.first(); name != NULL; name = it.next()){ - ConfigInfo::Status st = ctx.m_info->getStatus(ctx.m_currentInfo, name); + ConfigInfo::CI_Status st = ctx.m_info->getStatus(ctx.m_currentInfo, name); if(!ctx.m_currentSection->contains(name)){ switch (ctx.m_info->getType(ctx.m_currentInfo, name)){ - case ConfigInfo::INT: - case ConfigInfo::BOOL:{ + case ConfigInfo::CI_INT: + case ConfigInfo::CI_BOOL:{ Uint32 val = 0; ::require(defaults->get(name, &val)); ctx.m_currentSection->put(name, val); break; } - case ConfigInfo::INT64:{ + case ConfigInfo::CI_INT64:{ Uint64 val = 0; ::require(defaults->get(name, &val)); ctx.m_currentSection->put64(name, val); break; } - case ConfigInfo::STRING:{ + case ConfigInfo::CI_STRING:{ const char * val; ::require(defaults->get(name, &val)); ctx.m_currentSection->put(name, val); break; } - case ConfigInfo::SECTION: + case ConfigInfo::CI_SECTION: break; } } @@ -3163,9 +3163,9 @@ transform(InitConfigFileParser::Context & ctx, PropertiesType oldType; require(ctx.m_currentSection->getTypeOf(oldName, &oldType)); - ConfigInfo::Type newType = ctx.m_info->getType(ctx.m_currentInfo, newName); + ConfigInfo::CI_Type newType = ctx.m_info->getType(ctx.m_currentInfo, newName); if(!((oldType == PropertiesType_Uint32 || oldType == PropertiesType_Uint64) - && (newType == ConfigInfo::INT || newType == ConfigInfo::INT64 || newType == ConfigInfo::BOOL))){ + && (newType == ConfigInfo::CI_INT || newType == ConfigInfo::CI_INT64 || newType == ConfigInfo::CI_BOOL))){ ndbout << "oldType: " << (int)oldType << ", newType: " << (int)newType << endl; ctx.reportError("Unable to handle type conversion w.r.t deprication %s %s" "- [%s] starting at line: %d", @@ -3185,9 +3185,9 @@ transform(InitConfigFileParser::Context & ctx, return false; } - if(newType == ConfigInfo::INT || newType == ConfigInfo::BOOL){ + if(newType == ConfigInfo::CI_INT || newType == ConfigInfo::CI_BOOL){ require(dst.put(newName, (Uint32)newVal)); - } else if(newType == ConfigInfo::INT64) { + } else if(newType == ConfigInfo::CI_INT64) { require(dst.put64(newName, newVal)); } return true; @@ -3269,7 +3269,7 @@ saveInConfigValues(InitConfigFileParser::Context & ctx, const char * data){ require(sec->get("Status", &status)); require(sec->get("SectionType", &typeVal)); - if(id == KEY_INTERNAL || status == ConfigInfo::INTERNAL){ + if(id == KEY_INTERNAL || status == ConfigInfo::CI_INTERNAL){ ndbout_c("skipping section %s", ctx.fname); break; } @@ -3326,7 +3326,7 @@ saveInConfigValues(InitConfigFileParser::Context & ctx, const char * data){ } static bool -sanity_checks(Vector§ions, +sanity_checks(Vector§ions, struct InitConfigFileParser::Context &ctx, const char * rule_data) { @@ -3349,7 +3349,7 @@ sanity_checks(Vector§ions, } static bool -add_node_connections(Vector§ions, +add_node_connections(Vector§ions, struct InitConfigFileParser::Context &ctx, const char * rule_data) { @@ -3401,7 +3401,7 @@ add_node_connections(Vector§ions, for (Uint32 j= i+1;; j++){ if(!p_db_nodes.get("", j, &nodeId2)) break; if(!p_connections2.get("", nodeId1+nodeId2<<16, &dummy)) { - ConfigInfo::ConfigRuleSection s; + ConfigInfo::CI_ConfigRuleSection s; s.m_sectionType= BaseString("TCP"); s.m_sectionData= new Properties(true); char buf[16]; @@ -3418,7 +3418,7 @@ add_node_connections(Vector§ions, if(!p_connections.get("", nodeId1, &dummy)) { for (Uint32 j= 0;; j++){ if(!p_db_nodes.get("", j, &nodeId2)) break; - ConfigInfo::ConfigRuleSection s; + ConfigInfo::CI_ConfigRuleSection s; s.m_sectionType= BaseString("TCP"); s.m_sectionData= new Properties(true); char buf[16]; @@ -3435,7 +3435,7 @@ add_node_connections(Vector§ions, } -static bool add_server_ports(Vector§ions, +static bool add_server_ports(Vector§ions, struct InitConfigFileParser::Context &ctx, const char * rule_data) { @@ -3475,7 +3475,7 @@ static bool add_server_ports(Vector§ions, } static bool -check_node_vs_replicas(Vector§ions, +check_node_vs_replicas(Vector§ions, struct InitConfigFileParser::Context &ctx, const char * rule_data) { @@ -3602,4 +3602,4 @@ check_node_vs_replicas(Vector§ions, return true; } -template class Vector; +template class Vector; diff --git a/ndb/src/mgmsrv/ConfigInfo.hpp b/ndb/src/mgmsrv/ConfigInfo.hpp index 512505cbd30..dff8b34bf4a 100644 --- a/ndb/src/mgmsrv/ConfigInfo.hpp +++ b/ndb/src/mgmsrv/ConfigInfo.hpp @@ -38,11 +38,11 @@ static const char* UNDEFINED = 0; // Default value for undefined */ class ConfigInfo { public: - enum Type { BOOL, INT, INT64, STRING, SECTION }; - enum Status { USED, ///< Active - DEPRICATED, ///< Can be, but shouldn't - NOTIMPLEMENTED, ///< Is ignored. - INTERNAL ///< Not configurable by the user + enum Type { CI_BOOL, CI_INT, CI_INT64, CI_STRING, CI_SECTION }; + enum Status { CI_USED, ///< Active + CI_DEPRICATED, ///< Can be, but shouldn't + CI_NOTIMPLEMENTED, ///< Is ignored. + CI_INTERNAL ///< Not configurable by the user }; /** diff --git a/ndb/src/ndbapi/Ndb.cpp b/ndb/src/ndbapi/Ndb.cpp index 75ae539fc8b..06aa7365179 100644 --- a/ndb/src/ndbapi/Ndb.cpp +++ b/ndb/src/ndbapi/Ndb.cpp @@ -22,7 +22,7 @@ Name: Ndb.cpp ******************************************************************************/ #include -#include + #include "NdbApiSignal.hpp" #include "NdbImpl.hpp" diff --git a/ndb/src/ndbapi/NdbImpl.hpp b/ndb/src/ndbapi/NdbImpl.hpp index 1fb1969b589..04446491cb6 100644 --- a/ndb/src/ndbapi/NdbImpl.hpp +++ b/ndb/src/ndbapi/NdbImpl.hpp @@ -107,7 +107,7 @@ Uint32 convertEndian(Uint32 Data); enum WaitSignalType { NO_WAIT = 0, WAIT_NODE_FAILURE = 1, // Node failure during wait - WAIT_TIMEOUT = 2, // Timeout during wait + WST_WAIT_TIMEOUT = 2, // Timeout during wait WAIT_TC_SEIZE = 3, WAIT_TC_RELEASE = 4, diff --git a/ndb/src/ndbapi/ObjectMap.hpp b/ndb/src/ndbapi/ObjectMap.hpp index 12bede3aa3f..21407279f0b 100644 --- a/ndb/src/ndbapi/ObjectMap.hpp +++ b/ndb/src/ndbapi/ObjectMap.hpp @@ -29,7 +29,7 @@ class NdbObjectIdMap //: NdbLockable { public: - STATIC_CONST( InvalidId = ~0 ); + STATIC_CONST( InvalidId = ~(Uint32)0 ); NdbObjectIdMap(Uint32 initalSize = 128, Uint32 expandSize = 10); ~NdbObjectIdMap(); From 6049821cd0db658d96122ba4c54b39c2b3de8d35 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 10 Nov 2004 00:39:12 +0100 Subject: [PATCH 0156/1063] wl1744 - win compile fixes ndb/include/kernel/signaldata/RepImpl.hpp: more win-compile-fixes ndb/include/mgmapi/mgmapi.h: more win-compile-fixes ndb/include/ndbapi/NdbConnection.hpp: more win-compile-fixes ndb/src/common/util/Properties.cpp: more win-compile-fixes ndb/src/kernel/blocks/dbdict/Dbdict.cpp: more win-compile-fixes ndb/src/kernel/blocks/dbdict/Dbdict.hpp: more win-compile-fixes ndb/src/kernel/blocks/dbdih/Dbdih.hpp: more win-compile-fixes ndb/src/kernel/blocks/dbtc/DbtcMain.cpp: more win-compile-fixes ndb/src/kernel/blocks/grep/Grep.cpp: more win-compile-fixes ndb/src/mgmsrv/Config.cpp: more win-compile-fixes ndb/src/mgmsrv/ConfigInfo.cpp: more win-compile-fixes ndb/src/mgmsrv/InitConfigFileParser.cpp: more win-compile-fixes ndb/src/ndbapi/NdbBlob.cpp: more win-compile-fixes ndb/src/ndbapi/NdbConnection.cpp: more win-compile-fixes ndb/src/ndbapi/NdbImpl.hpp: more win-compile-fixes ndb/src/ndbapi/NdbOperationExec.cpp: more win-compile-fixes ndb/test/ndbapi/testOperations.cpp: more win-compile-fixes sql/ha_ndbcluster.cc: more win-compile-fixes --- ndb/include/kernel/signaldata/RepImpl.hpp | 12 ++++---- ndb/include/mgmapi/mgmapi.h | 1 + ndb/include/ndbapi/NdbConnection.hpp | 2 +- ndb/src/common/util/Properties.cpp | 2 +- ndb/src/kernel/blocks/dbdict/Dbdict.cpp | 6 ++-- ndb/src/kernel/blocks/dbdict/Dbdict.hpp | 2 +- ndb/src/kernel/blocks/dbdih/Dbdih.hpp | 2 +- ndb/src/kernel/blocks/dbtc/DbtcMain.cpp | 2 +- ndb/src/kernel/blocks/grep/Grep.cpp | 36 +++++++++++------------ ndb/src/mgmsrv/Config.cpp | 16 +++++----- ndb/src/mgmsrv/ConfigInfo.cpp | 34 ++++++++++----------- ndb/src/mgmsrv/InitConfigFileParser.cpp | 16 +++++----- ndb/src/ndbapi/NdbBlob.cpp | 6 ++-- ndb/src/ndbapi/NdbConnection.cpp | 4 +-- ndb/src/ndbapi/NdbImpl.hpp | 2 +- ndb/src/ndbapi/NdbOperationExec.cpp | 6 ++-- ndb/test/ndbapi/testOperations.cpp | 2 +- sql/ha_ndbcluster.cc | 2 +- 18 files changed, 77 insertions(+), 76 deletions(-) diff --git a/ndb/include/kernel/signaldata/RepImpl.hpp b/ndb/include/kernel/signaldata/RepImpl.hpp index affffe46f9c..0de1389a4a9 100644 --- a/ndb/include/kernel/signaldata/RepImpl.hpp +++ b/ndb/include/kernel/signaldata/RepImpl.hpp @@ -93,7 +93,7 @@ public: Uint32 subscriptionId; Uint32 subscriptionKey; Uint32 senderNodeId; - GrepError::Code err; + GrepError::GE_Code err; }; class RepGetGciReq @@ -151,7 +151,7 @@ public: Uint32 lastPSGCI; Uint32 firstSSGCI; Uint32 lastSSGCI; - GrepError::Code err; + GrepError::GE_Code err; }; class RepGetGciBufferReq { @@ -213,7 +213,7 @@ public: Uint32 lastSSGCI; Uint32 currentGCIBuffer; Uint32 nodeGrp; - GrepError::Code err; + GrepError::GE_Code err; }; class RepInsertGciBufferReq @@ -252,7 +252,7 @@ public: Uint32 nodeGrp; Uint32 tableId; Uint32 force; - GrepError::Code err; + GrepError::GE_Code err; }; class RepInsertGciBufferConf @@ -310,7 +310,7 @@ public: Uint32 lastGCI; Uint32 currentGCI; Uint32 nodeGrp; - GrepError::Code err; + GrepError::GE_Code err; }; class RepClearPSGciBufferConf @@ -367,7 +367,7 @@ public: Uint32 lastGCI; Uint32 currentGCI; Uint32 nodeGrp; - GrepError::Code err; + GrepError::GE_Code err; }; class RepClearSSGciBufferConf diff --git a/ndb/include/mgmapi/mgmapi.h b/ndb/include/mgmapi/mgmapi.h index 582e8f1a3e6..ad98de1e322 100644 --- a/ndb/include/mgmapi/mgmapi.h +++ b/ndb/include/mgmapi/mgmapi.h @@ -49,6 +49,7 @@ * @{ */ +#include #include "mgmapi_config_parameters.h" #ifdef __cplusplus diff --git a/ndb/include/ndbapi/NdbConnection.hpp b/ndb/include/ndbapi/NdbConnection.hpp index 7af5d27b922..5043cb0e26d 100644 --- a/ndb/include/ndbapi/NdbConnection.hpp +++ b/ndb/include/ndbapi/NdbConnection.hpp @@ -50,7 +50,7 @@ enum AbortOption { TryCommit = 0, ///< Missing explanation #endif AbortOnError = 0, ///< Abort transaction on failed operation - IgnoreError = 2 ///< Transaction continues on failed operation + AO_IgnoreError = 2 ///< Transaction continues on failed operation }; typedef AbortOption CommitType; diff --git a/ndb/src/common/util/Properties.cpp b/ndb/src/common/util/Properties.cpp index 4443fd45bba..0edcda0e726 100644 --- a/ndb/src/common/util/Properties.cpp +++ b/ndb/src/common/util/Properties.cpp @@ -881,7 +881,7 @@ PropertiesImpl::unpack(const Uint32 * buf, Uint32 &bufLen, Properties * top, case PropertiesType_Properties: assert(0); } - if(res3 != true){ + if(!res3){ return false; } _items--; diff --git a/ndb/src/kernel/blocks/dbdict/Dbdict.cpp b/ndb/src/kernel/blocks/dbdict/Dbdict.cpp index 882557daae1..35ea878f94b 100644 --- a/ndb/src/kernel/blocks/dbdict/Dbdict.cpp +++ b/ndb/src/kernel/blocks/dbdict/Dbdict.cpp @@ -528,7 +528,7 @@ Dbdict::writeTableFile(Signal* signal, Uint32 tableId, Uint32 sz = tabInfoPtr.sz + ZPAGE_HEADER_SIZE; c_writeTableRecord.noOfPages = DIV(sz, ZSIZE_OF_PAGES_IN_WORDS); - c_writeTableRecord.tableWriteState = WriteTableRecord::CALLBACK; + c_writeTableRecord.tableWriteState = WriteTableRecord::TWR_CALLBACK; c_writeTableRecord.m_callback = * callback; c_writeTableRecord.pageId = 0; @@ -647,7 +647,7 @@ void Dbdict::closeWriteTableConf(Signal* signal, case WriteTableRecord::WRITE_RESTART_FROM_OWN : ndbrequire(false); break; - case WriteTableRecord::CALLBACK: + case WriteTableRecord::TWR_CALLBACK: jam(); execute(signal, c_writeTableRecord.m_callback, 0); return; @@ -2381,7 +2381,7 @@ Dbdict::restartCreateTab_readTableConf(Signal* signal, ndbrequire(c_writeTableRecord.tableWriteState == WriteTableRecord::IDLE); c_writeTableRecord.noOfPages = c_readTableRecord.noOfPages; c_writeTableRecord.pageId = c_readTableRecord.pageId; - c_writeTableRecord.tableWriteState = WriteTableRecord::CALLBACK; + c_writeTableRecord.tableWriteState = WriteTableRecord::TWR_CALLBACK; c_writeTableRecord.m_callback.m_callbackData = callbackData; c_writeTableRecord.m_callback.m_callbackFunction = safe_cast(&Dbdict::restartCreateTab_writeTableConf); diff --git a/ndb/src/kernel/blocks/dbdict/Dbdict.hpp b/ndb/src/kernel/blocks/dbdict/Dbdict.hpp index 19c03a86e22..5a61c0739a6 100644 --- a/ndb/src/kernel/blocks/dbdict/Dbdict.hpp +++ b/ndb/src/kernel/blocks/dbdict/Dbdict.hpp @@ -639,7 +639,7 @@ private: WRITE_ADD_TABLE_SLAVE = 2, WRITE_RESTART_FROM_MASTER = 3, WRITE_RESTART_FROM_OWN = 4, - CALLBACK = 5 + TWR_CALLBACK = 5 }; TableWriteState tableWriteState; Callback m_callback; diff --git a/ndb/src/kernel/blocks/dbdih/Dbdih.hpp b/ndb/src/kernel/blocks/dbdih/Dbdih.hpp index 14fa262f871..66acdf32059 100644 --- a/ndb/src/kernel/blocks/dbdih/Dbdih.hpp +++ b/ndb/src/kernel/blocks/dbdih/Dbdih.hpp @@ -1469,7 +1469,7 @@ private: Uint32 c_blockCommitNo; bool getBlockCommit() const { - return c_blockCommit == true || cgckptflag == true; + return c_blockCommit || cgckptflag; } /** diff --git a/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp b/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp index d8b3ee10532..e7aec9e670c 100644 --- a/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp +++ b/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp @@ -6366,7 +6366,7 @@ void Dbtc::sendAbortedAfterTimeout(Signal* signal, int Tcheck) *------------------------------------------------------------------*/ char buf[96]; buf[0] = 0; char buf2[96]; - snprintf(buf, sizeof(buf), "TC %d: %d ops:", + BaseString::snprintf(buf, sizeof(buf), "TC %d: %d ops:", __LINE__, apiConnectptr.i); for(Uint32 i = 0; igetDataPtr(); Uint32 subData = ref->subscriberData; - GrepError::Code err; + GrepError::GE_Code err; Uint32 sendersBlockRef = signal->getSendersBlockRef(); if(sendersBlockRef == SUMA_REF) @@ -624,7 +624,7 @@ Grep::PSCoord::execCREATE_SUBID_REF(Signal* signal) { ndbrequire(false); /* Added since errorcode err unhandled * TODO: fix correct errorcode */ - err= GrepError::NO_ERROR; // remove compiler warning + err= GrepError::GE_NO_ERROR; // remove compiler warning } SubCoordinatorPtr subPtr; @@ -824,7 +824,7 @@ Grep::PSPart::execSUB_CREATE_REF(Signal* signal) jamEntry(); SubCreateRef * const ref = (SubCreateRef *)signal->getDataPtr(); Uint32 subData = ref->subscriberData; - GrepError::Code err = (GrepError::Code)ref->err; + GrepError::GE_Code err = (GrepError::GE_Code)ref->err; SubscriptionPtr subPtr; c_subscriptions.getPtr(subPtr, subData); sendRefToPSCoord(signal, *subPtr.p, err /*error*/); @@ -867,7 +867,7 @@ Grep::PSCoord::execGREP_CREATE_CONF(Signal* signal) GrepEvent::GrepPS_SubCreateConf, subId, subKey, - (Uint32)GrepError::NO_ERROR); + (Uint32)GrepError::GE_NO_ERROR); c_subCoordinatorPool.release(subPtr); @@ -889,7 +889,7 @@ Grep::PSCoord::execGREP_CREATE_REF(Signal* signal) SubCoordinatorPtr subPtr; c_runningSubscriptions.getPtr(subPtr, subData); - sendRefToSS(signal, *subPtr.p, (GrepError::Code)err /*error*/); + sendRefToSS(signal, *subPtr.p, (GrepError::GE_Code)err /*error*/); } @@ -1046,7 +1046,7 @@ Grep::PSPart::execSUB_START_REF(Signal* signal) { SubStartRef * const ref = (SubStartRef *)signal->getDataPtr(); Uint32 subData = ref->subscriberData; - GrepError::Code err = (GrepError::Code)ref->err; + GrepError::GE_Code err = (GrepError::GE_Code)ref->err; SubscriptionData::Part part = (SubscriptionData::Part)ref->part; SubscriptionPtr subPtr; c_subscriptions.getPtr(subPtr, subData); @@ -1102,7 +1102,7 @@ Grep::PSCoord::execGREP_START_CONF(Signal* signal) EventReport::GrepSubscriptionInfo, GrepEvent::GrepPS_SubStartMetaConf, subId, subKey, - (Uint32)GrepError::NO_ERROR); + (Uint32)GrepError::GE_NO_ERROR); c_subCoordinatorPool.release(subPtr); break; @@ -1118,7 +1118,7 @@ Grep::PSCoord::execGREP_START_CONF(Signal* signal) EventReport::GrepSubscriptionInfo, GrepEvent::GrepPS_SubStartDataConf, subId, subKey, - (Uint32)GrepError::NO_ERROR); + (Uint32)GrepError::GE_NO_ERROR); c_subCoordinatorPool.release(subPtr); @@ -1145,7 +1145,7 @@ Grep::PSCoord::execGREP_START_REF(Signal* signal) jamEntry(); GrepStartRef * const ref = (GrepStartRef *)signal->getDataPtr(); Uint32 subData = ref->senderData; - GrepError::Code err = (GrepError::Code)ref->err; + GrepError::GE_Code err = (GrepError::GE_Code)ref->err; SubscriptionData::Part part = (SubscriptionData::Part)ref->part; SubCoordinatorPtr subPtr; @@ -1301,7 +1301,7 @@ Grep::PSPart::execSUB_REMOVE_REF(Signal* signal) jamEntry(); SubRemoveRef * const ref = (SubRemoveRef *)signal->getDataPtr(); Uint32 subData = ref->subscriberData; - /* GrepError::Code err = (GrepError::Code)ref->err;*/ + /* GrepError::GE_Code err = (GrepError::GE_Code)ref->err;*/ SubscriptionPtr subPtr; c_subscriptions.getPtr(subPtr, subData); @@ -1342,7 +1342,7 @@ Grep::PSCoord::execGREP_REMOVE_CONF(Signal* signal) EventReport::GrepSubscriptionInfo, GrepEvent::GrepPS_SubRemoveConf, subId, subKey, - GrepError::NO_ERROR); + GrepError::GE_NO_ERROR); GrepSubRemoveConf * grepConf = (GrepSubRemoveConf *) conf; grepConf->subscriptionId = subId; @@ -1375,7 +1375,7 @@ Grep::PSCoord::execGREP_REMOVE_REF(Signal* signal) subPtr.p = c_runningSubscriptions.getPtr(subPtr.i); if(subData == subPtr.i) { - sendRefToSS(signal, *subPtr.p, (GrepError::Code)err /*error*/); + sendRefToSS(signal, *subPtr.p, (GrepError::GE_Code)err /*error*/); c_runningSubscriptions.release(subPtr); return; } @@ -1633,7 +1633,7 @@ Grep::PSPart::execSUB_SYNC_REF(Signal* signal) { jamEntry(); SubSyncRef * const ref = (SubSyncRef *)signal->getDataPtr(); Uint32 subData = ref->subscriberData; - GrepError::Code err = (GrepError::Code)ref->err; + GrepError::GE_Code err = (GrepError::GE_Code)ref->err; SubscriptionData::Part part = (SubscriptionData::Part)ref->part; SubscriptionPtr subPtr; @@ -1677,7 +1677,7 @@ Grep::PSCoord::execGREP_SYNC_CONF(Signal* signal) /* @todo Johan: Add firstGCI here. /Lars */ m_grep->sendEventRep(signal, EventReport::GrepSubscriptionInfo, event, subId, subKey, - (Uint32)GrepError::NO_ERROR, + (Uint32)GrepError::GE_NO_ERROR, lastGCI); /************************* @@ -1707,7 +1707,7 @@ Grep::PSCoord::execGREP_SYNC_REF(Signal* signal) { GrepSyncRef * const ref = (GrepSyncRef *)signal->getDataPtr(); Uint32 subData = ref->senderData; SubscriptionData::Part part = (SubscriptionData::Part)ref->part; - GrepError::Code err = (GrepError::Code)ref->err; + GrepError::GE_Code err = (GrepError::GE_Code)ref->err; SubCoordinatorPtr subPtr; c_runningSubscriptions.getPtr(subPtr, subData); sendRefToSS(signal, *subPtr.p, err /*error*/, part); @@ -1718,7 +1718,7 @@ Grep::PSCoord::execGREP_SYNC_REF(Signal* signal) { void Grep::PSCoord::sendRefToSS(Signal * signal, SubCoordinator sub, - GrepError::Code err, + GrepError::GE_Code err, SubscriptionData::Part part) { /** @@ -1843,7 +1843,7 @@ Grep::PSCoord::sendRefToSS(Signal * signal, void Grep::PSPart::sendRefToPSCoord(Signal * signal, Subscription sub, - GrepError::Code err, + GrepError::GE_Code err, SubscriptionData::Part part) { jam(); diff --git a/ndb/src/mgmsrv/Config.cpp b/ndb/src/mgmsrv/Config.cpp index f9c6a23f909..5ff9cbe04ad 100644 --- a/ndb/src/mgmsrv/Config.cpp +++ b/ndb/src/mgmsrv/Config.cpp @@ -53,27 +53,27 @@ Config::printAllNameValuePairs(NdbOut &out, if(!section->contains(n)) continue; - if (m_info.getStatus(section, n) == ConfigInfo::INTERNAL) + if (m_info.getStatus(section, n) == ConfigInfo::CI_INTERNAL) continue; - if (m_info.getStatus(section, n) == ConfigInfo::DEPRICATED) + if (m_info.getStatus(section, n) == ConfigInfo::CI_DEPRICATED) continue; - if (m_info.getStatus(section, n) == ConfigInfo::NOTIMPLEMENTED) + if (m_info.getStatus(section, n) == ConfigInfo::CI_NOTIMPLEMENTED) continue; out << n << ": "; switch (m_info.getType(section, n)) { - case ConfigInfo::INT: + case ConfigInfo::CI_INT: MGM_REQUIRE(prop->get(n, &int_value)); out << int_value; break; - case ConfigInfo::INT64: + case ConfigInfo::CI_INT64: MGM_REQUIRE(prop->get(n, &int_64)); out << int_64; break; - case ConfigInfo::BOOL: + case ConfigInfo::CI_BOOL: MGM_REQUIRE(prop->get(n, &int_value)); if (int_value) { out << "Y"; @@ -81,11 +81,11 @@ Config::printAllNameValuePairs(NdbOut &out, out << "N"; } break; - case ConfigInfo::STRING: + case ConfigInfo::CI_STRING: MGM_REQUIRE(prop->get(n, &str_value)); out << str_value; break; - case ConfigInfo::SECTION: + case ConfigInfo::CI_SECTION: out << "SECTION"; break; } diff --git a/ndb/src/mgmsrv/ConfigInfo.cpp b/ndb/src/mgmsrv/ConfigInfo.cpp index 5f1f0cccb23..0a41db0e044 100644 --- a/ndb/src/mgmsrv/ConfigInfo.cpp +++ b/ndb/src/mgmsrv/ConfigInfo.cpp @@ -2272,12 +2272,12 @@ ConfigInfo::ConfigInfo() * Getters ****************************************************************************/ inline void warning(const char * src, const char * arg){ - ndbout << "Illegal call to ConfigInfo::CI_" << src << "() - " << arg << endl; + ndbout << "Illegal call to ConfigInfo::" << src << "() - " << arg << endl; abort(); } const Properties * -ConfigInfo::CI_getInfo(const char * section) const { +ConfigInfo::getInfo(const char * section) const { const Properties * p; if(!m_info.get(section, &p)){ return 0; @@ -2391,23 +2391,23 @@ ConfigInfo::getType(const Properties * section, const char* fname) const { return (ConfigInfo::Type) getInfoInt(section, fname, "Type"); } -ConfigInfo::CI_Status -ConfigInfo::CI_getStatus(const Properties * section, const char* fname) const { - return (ConfigInfo::CI_Status) getInfoInt(section, fname, "Status"); +ConfigInfo::Status +ConfigInfo::getStatus(const Properties * section, const char* fname) const { + return (ConfigInfo::Status) getInfoInt(section, fname, "Status"); } /**************************************************************************** * Printers ****************************************************************************/ -void ConfigInfo::CI_print() const { +void ConfigInfo::print() const { Properties::Iterator it(&m_info); for (const char* n = it.first(); n != NULL; n = it.next()) { print(n); } } -void ConfigInfo::CI_print(const char* section) const { +void ConfigInfo::print(const char* section) const { ndbout << "****** " << section << " ******" << endl << endl; const Properties * sec = getInfo(section); Properties::Iterator it(sec); @@ -2420,7 +2420,7 @@ void ConfigInfo::CI_print(const char* section) const { } } -void ConfigInfo::CI_print(const Properties * section, +void ConfigInfo::print(const Properties * section, const char* parameter) const { ndbout << parameter; // ndbout << getDescription(section, parameter) << endl; @@ -2743,7 +2743,7 @@ applyDefaultValues(InitConfigFileParser::Context & ctx, Properties::Iterator it(defaults); for(const char * name = it.first(); name != NULL; name = it.next()){ - ConfigInfo::CI_Status st = ctx.m_info->getStatus(ctx.m_currentInfo, name); + ConfigInfo::Status st = ctx.m_info->getStatus(ctx.m_currentInfo, name); if(!ctx.m_currentSection->contains(name)){ switch (ctx.m_info->getType(ctx.m_currentInfo, name)){ case ConfigInfo::CI_INT: @@ -3163,7 +3163,7 @@ transform(InitConfigFileParser::Context & ctx, PropertiesType oldType; require(ctx.m_currentSection->getTypeOf(oldName, &oldType)); - ConfigInfo::CI_Type newType = ctx.m_info->getType(ctx.m_currentInfo, newName); + ConfigInfo::Type newType = ctx.m_info->getType(ctx.m_currentInfo, newName); if(!((oldType == PropertiesType_Uint32 || oldType == PropertiesType_Uint64) && (newType == ConfigInfo::CI_INT || newType == ConfigInfo::CI_INT64 || newType == ConfigInfo::CI_BOOL))){ ndbout << "oldType: " << (int)oldType << ", newType: " << (int)newType << endl; @@ -3326,7 +3326,7 @@ saveInConfigValues(InitConfigFileParser::Context & ctx, const char * data){ } static bool -sanity_checks(Vector§ions, +sanity_checks(Vector§ions, struct InitConfigFileParser::Context &ctx, const char * rule_data) { @@ -3349,7 +3349,7 @@ sanity_checks(Vector§ions, } static bool -add_node_connections(Vector§ions, +add_node_connections(Vector§ions, struct InitConfigFileParser::Context &ctx, const char * rule_data) { @@ -3401,7 +3401,7 @@ add_node_connections(Vector§ions, for (Uint32 j= i+1;; j++){ if(!p_db_nodes.get("", j, &nodeId2)) break; if(!p_connections2.get("", nodeId1+nodeId2<<16, &dummy)) { - ConfigInfo::CI_ConfigRuleSection s; + ConfigInfo::ConfigRuleSection s; s.m_sectionType= BaseString("TCP"); s.m_sectionData= new Properties(true); char buf[16]; @@ -3418,7 +3418,7 @@ add_node_connections(Vector§ions, if(!p_connections.get("", nodeId1, &dummy)) { for (Uint32 j= 0;; j++){ if(!p_db_nodes.get("", j, &nodeId2)) break; - ConfigInfo::CI_ConfigRuleSection s; + ConfigInfo::ConfigRuleSection s; s.m_sectionType= BaseString("TCP"); s.m_sectionData= new Properties(true); char buf[16]; @@ -3435,7 +3435,7 @@ add_node_connections(Vector§ions, } -static bool add_server_ports(Vector§ions, +static bool add_server_ports(Vector§ions, struct InitConfigFileParser::Context &ctx, const char * rule_data) { @@ -3475,7 +3475,7 @@ static bool add_server_ports(Vector§ions, } static bool -check_node_vs_replicas(Vector§ions, +check_node_vs_replicas(Vector§ions, struct InitConfigFileParser::Context &ctx, const char * rule_data) { @@ -3602,4 +3602,4 @@ check_node_vs_replicas(Vector§ions, return true; } -template class Vector; +template class Vector; diff --git a/ndb/src/mgmsrv/InitConfigFileParser.cpp b/ndb/src/mgmsrv/InitConfigFileParser.cpp index fdfe7823fc2..bf74f220b58 100644 --- a/ndb/src/mgmsrv/InitConfigFileParser.cpp +++ b/ndb/src/mgmsrv/InitConfigFileParser.cpp @@ -260,10 +260,10 @@ bool InitConfigFileParser::parseNameValuePair(Context& ctx, const char* line) { return false; } ConfigInfo::Status status = m_info->getStatus(ctx.m_currentInfo, fname); - if (status == ConfigInfo::NOTIMPLEMENTED) { + if (status == ConfigInfo::CI_NOTIMPLEMENTED) { ctx.reportWarning("[%s] %s not yet implemented", ctx.fname, fname); } - if (status == ConfigInfo::DEPRICATED) { + if (status == ConfigInfo::CI_DEPRICATED) { const char * desc = m_info->getDescription(ctx.m_currentInfo, fname); if(desc){ ctx.reportWarning("[%s] %s is depricated, use %s instead", @@ -316,7 +316,7 @@ InitConfigFileParser::storeNameValuePair(Context& ctx, const ConfigInfo::Type type = m_info->getType(ctx.m_currentInfo, fname); switch(type){ - case ConfigInfo::BOOL: { + case ConfigInfo::CI_BOOL: { bool value_bool; if (!convertStringToBool(value, value_bool)) { ctx.reportError("Illegal boolean value for parameter %s", fname); @@ -325,8 +325,8 @@ InitConfigFileParser::storeNameValuePair(Context& ctx, MGM_REQUIRE(ctx.m_currentSection->put(pname, value_bool)); break; } - case ConfigInfo::INT: - case ConfigInfo::INT64:{ + case ConfigInfo::CI_INT: + case ConfigInfo::CI_INT64:{ Uint64 value_int; if (!convertStringToUint64(value, value_int)) { ctx.reportError("Illegal integer value for parameter %s", fname); @@ -339,17 +339,17 @@ InitConfigFileParser::storeNameValuePair(Context& ctx, m_info->getMax(ctx.m_currentInfo, fname)); return false; } - if(type == ConfigInfo::INT){ + if(type == ConfigInfo::CI_INT){ MGM_REQUIRE(ctx.m_currentSection->put(pname, (Uint32)value_int)); } else { MGM_REQUIRE(ctx.m_currentSection->put64(pname, value_int)); } break; } - case ConfigInfo::STRING: + case ConfigInfo::CI_STRING: MGM_REQUIRE(ctx.m_currentSection->put(pname, value)); break; - case ConfigInfo::SECTION: + case ConfigInfo::CI_SECTION: abort(); } return true; diff --git a/ndb/src/ndbapi/NdbBlob.cpp b/ndb/src/ndbapi/NdbBlob.cpp index 53c0a0e07f9..da0a4f73c3e 100644 --- a/ndb/src/ndbapi/NdbBlob.cpp +++ b/ndb/src/ndbapi/NdbBlob.cpp @@ -975,7 +975,7 @@ NdbBlob::deletePartsUnknown(Uint32 part) setErrorCode(tOp); return -1; } - tOp->m_abortOption = IgnoreError; + tOp->m_abortOption = AO_IgnoreError; n++; } DBG("deletePartsUnknown: executeNoBlobs [in] bat=" << bat); @@ -1223,7 +1223,7 @@ NdbBlob::preExecute(ExecType anExecType, bool& batch) return -1; } if (isWriteOp()) { - tOp->m_abortOption = IgnoreError; + tOp->m_abortOption = AO_IgnoreError; } theHeadInlineReadOp = tOp; // execute immediately @@ -1269,7 +1269,7 @@ NdbBlob::preExecute(ExecType anExecType, bool& batch) return -1; } if (isWriteOp()) { - tOp->m_abortOption = IgnoreError; + tOp->m_abortOption = AO_IgnoreError; } theHeadInlineReadOp = tOp; // execute immediately diff --git a/ndb/src/ndbapi/NdbConnection.cpp b/ndb/src/ndbapi/NdbConnection.cpp index 4f6468eb4ae..7710a3354d3 100644 --- a/ndb/src/ndbapi/NdbConnection.cpp +++ b/ndb/src/ndbapi/NdbConnection.cpp @@ -1578,7 +1578,7 @@ from other transactions. (theLastExecOpInList->theCommitIndicator == 1)){ - if (m_abortOption == IgnoreError && theError.code != 0){ + if (m_abortOption == AO_IgnoreError && theError.code != 0){ /** * There's always a TCKEYCONF when using IgnoreError */ @@ -1832,7 +1832,7 @@ NdbConnection::OpCompleteFailure(Uint8 abortOption, bool setFailure) //decide the success of the whole transaction since a simple //operation is not really part of that transaction. //------------------------------------------------------------------------ - if (abortOption == IgnoreError){ + if (abortOption == AO_IgnoreError){ /** * There's always a TCKEYCONF when using IgnoreError */ diff --git a/ndb/src/ndbapi/NdbImpl.hpp b/ndb/src/ndbapi/NdbImpl.hpp index 04446491cb6..baac0ee2846 100644 --- a/ndb/src/ndbapi/NdbImpl.hpp +++ b/ndb/src/ndbapi/NdbImpl.hpp @@ -146,7 +146,7 @@ NdbWaiter::wait(int waitTime) NdbCondition_Wait(m_condition, (NdbMutex*)m_mutex); } else { if (waitTime <= 0) { - m_state = WAIT_TIMEOUT; + m_state = WST_WAIT_TIMEOUT; break; } NdbCondition_WaitTimeout(m_condition, (NdbMutex*)m_mutex, waitTime); diff --git a/ndb/src/ndbapi/NdbOperationExec.cpp b/ndb/src/ndbapi/NdbOperationExec.cpp index cccc3b6409f..afa3609e11c 100644 --- a/ndb/src/ndbapi/NdbOperationExec.cpp +++ b/ndb/src/ndbapi/NdbOperationExec.cpp @@ -199,7 +199,7 @@ NdbOperation::prepareSend(Uint32 aTC_ConnectPtr, Uint64 aTransId) tcKeyReq->setKeyLength(tReqInfo, tTupKeyLen); // A simple read is always ignore error - abortOption = tSimpleIndicator ? IgnoreError : abortOption; + abortOption = tSimpleIndicator ? AO_IgnoreError : abortOption; tcKeyReq->setAbortOption(tReqInfo, abortOption); Uint8 tDistrKeyIndicator = theDistrKeyIndicator; @@ -548,14 +548,14 @@ NdbOperation::receiveTCKEYREF( NdbApiSignal* aSignal) theStatus = Finished; // blobs want this - if (m_abortOption != IgnoreError) + if (m_abortOption != AO_IgnoreError) theNdbCon->theReturnStatus = NdbConnection::ReturnFailure; theError.code = aSignal->readData(4); theNdbCon->setOperationErrorCodeAbort(aSignal->readData(4), m_abortOption); if(theOperationType != ReadRequest || !theSimpleIndicator) // not simple read - return theNdbCon->OpCompleteFailure(ao, m_abortOption != IgnoreError); + return theNdbCon->OpCompleteFailure(ao, m_abortOption != AO_IgnoreError); /** * If TCKEYCONF has arrived diff --git a/ndb/test/ndbapi/testOperations.cpp b/ndb/test/ndbapi/testOperations.cpp index f31906dd737..949f08281a5 100644 --- a/ndb/test/ndbapi/testOperations.cpp +++ b/ndb/test/ndbapi/testOperations.cpp @@ -171,7 +171,7 @@ runTwoOperations(NDBT_Context* ctx, NDBT_Step* step){ // Insert, read CHECK(hugoOps.startTransaction(pNdb) == 0); CHECK(runOp(hugoOps, pNdb, op1, val1) == 0); - AbortOption oa = (res1 == 0) ? AbortOnError : IgnoreError; + AbortOption oa = (res1 == 0) ? AbortOnError : AO_IgnoreError; CHECK(hugoOps.execute_NoCommit(pNdb, oa) == res1); CHECK(checkVal(hugoOps, op1, val1, res1) == 0); diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 0d2b1676e3a..ba59772ca9b 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -183,7 +183,7 @@ int execute_no_commit_ie(ha_ndbcluster *h, NdbConnection *trans) if (m_batch_execute) return 0; #endif - return trans->execute(NoCommit,IgnoreError,1); + return trans->execute(NoCommit, AO_IgnoreError,1); } /* From 7d09ee39b00a34d798b1a4082cec3798cf12952b Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 10 Nov 2004 11:02:51 +0100 Subject: [PATCH 0157/1063] bug#6538 ndb: Fix return value in index_last wo/ rows sql/ha_ndbcluster.cc: Return correct when not finding any row from index_last --- sql/ha_ndbcluster.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 0d2b1676e3a..5971c1a6c2a 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -2318,7 +2318,7 @@ int ha_ndbcluster::index_last(byte *buf) DBUG_RETURN(0); } } - DBUG_RETURN(1); + DBUG_RETURN(res); } From 297abcb8cdfe96964afc3b38e9127358cc052ed7 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 10 Nov 2004 15:03:59 +0500 Subject: [PATCH 0158/1063] replaced init_db.sql mysql-test/init_db.sql: replaced old init_db.sql on new one --- mysql-test/init_db.sql | 54 +++++++++++++++++++++++++++++++++--------- 1 file changed, 43 insertions(+), 11 deletions(-) diff --git a/mysql-test/init_db.sql b/mysql-test/init_db.sql index 4613e5c0274..63483af00d6 100644 --- a/mysql-test/init_db.sql +++ b/mysql-test/init_db.sql @@ -3,24 +3,56 @@ CREATE DATABASE test; USE mysql; -CREATE TABLE db (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL, References_priv enum('N','Y') DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db,User), KEY User (User)) comment='Database privileges'; +CREATE TABLE db (Host char(60) binary DEFAULT '' NOT NULL,Db char(64) binary DEFAULT '' NOT NULL,User char(16) binary DEFAULT '' NOT NULL,Select_priv enum('N','Y') DEFAULT 'N' NOT NULL,Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL,Update_priv enum('N','Y') DEFAULT 'N' NOT NULL,Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL,Create_priv enum('N','Y') DEFAULT 'N' NOT NULL,Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL,Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL,References_priv enum('N','Y') DEFAULT 'N' NOT NULL,Index_priv enum('N','Y') DEFAULT 'N' NOT NULL,Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL,Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL,Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL,PRIMARY KEY Host (Host,Db,User),KEY User (User)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Database privileges'; + INSERT INTO db VALUES ('%','test','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y'); INSERT INTO db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y'); - -CREATE TABLE host (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL, References_priv enum('N','Y') DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db)) comment='Host privileges; Merged with database privileges'; -CREATE TABLE user (Host char(60) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Password char(45) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL, Reload_priv enum('N','Y') DEFAULT 'N' NOT NULL, Shutdown_priv enum('N','Y') DEFAULT 'N' NOT NULL, Process_priv enum('N','Y') DEFAULT 'N' NOT NULL, File_priv enum('N','Y') DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL, References_priv enum('N','Y') DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL, Show_db_priv enum('N','Y') DEFAULT 'N' NOT NULL, Super_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') DEFAULT 'N' NOT NULL, Repl_slave_priv enum('N','Y') DEFAULT 'N' NOT NULL, Repl_client_priv enum('N','Y') DEFAULT 'N' NOT NULL, ssl_type enum('','ANY','X509', 'SPECIFIED') DEFAULT '' NOT NULL, ssl_cipher BLOB NOT NULL, x509_issuer BLOB NOT NULL, x509_subject BLOB NOT NULL, max_questions int(11) unsigned DEFAULT 0 NOT NULL, max_updates int(11) unsigned DEFAULT 0 NOT NULL, max_connections int(11) unsigned DEFAULT 0 NOT NULL, PRIMARY KEY Host (Host,User)) comment='Users and global privileges'; -INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); -INSERT INTO user VALUES ('','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); +CREATE TABLE host (Host char(60) binary DEFAULT '' NOT NULL,Db char(64) binary DEFAULT '' NOT NULL,Select_priv enum('N','Y') DEFAULT 'N' NOT NULL,Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL,Update_priv enum('N','Y') DEFAULT 'N' NOT NULL,Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL,Create_priv enum('N','Y') DEFAULT 'N' NOT NULL,Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL,Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL,References_priv enum('N','Y') DEFAULT 'N' NOT NULL,Index_priv enum('N','Y') DEFAULT 'N' NOT NULL,Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL,Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL,Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL,PRIMARY KEY Host (Host,Db)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Host privileges; Merged with database privileges'; -INSERT INTO user (host,user) values ('localhost',''); -INSERT INTO user (host,user) values ('',''); +CREATE TABLE user (Host char(60) binary DEFAULT '' NOT NULL,User char(16) binary DEFAULT '' NOT NULL,Password char(41) binary DEFAULT '' NOT NULL,Select_priv enum('N','Y') DEFAULT 'N' NOT NULL,Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL,Update_priv enum('N','Y') DEFAULT 'N' NOT NULL,Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL,Create_priv enum('N','Y') DEFAULT 'N' NOT NULL,Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL,Reload_priv enum('N','Y') DEFAULT 'N' NOT NULL,Shutdown_priv enum('N','Y') DEFAULT 'N' NOT NULL,Process_priv enum('N','Y') DEFAULT 'N' NOT NULL,File_priv enum('N','Y') DEFAULT 'N' NOT NULL,Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL,References_priv enum('N','Y') DEFAULT 'N' NOT NULL,Index_priv enum('N','Y') DEFAULT 'N' NOT NULL,Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL,Show_db_priv enum('N','Y') DEFAULT 'N' NOT NULL,Super_priv enum('N','Y') DEFAULT 'N' NOT NULL,Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL,Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL,Execute_priv enum('N','Y') DEFAULT 'N' NOT NULL,Repl_slave_priv enum('N','Y') DEFAULT 'N' NOT NULL,Repl_client_priv enum('N','Y') DEFAULT 'N' NOT NULL,ssl_type enum('','ANY','X509', 'SPECIFIED') DEFAULT '' NOT NULL,ssl_cipher BLOB NOT NULL,x509_issuer BLOB NOT NULL,x509_subject BLOB NOT NULL,max_questions int(11) unsigned DEFAULT 0 NOT NULL,max_updates int(11) unsigned DEFAULT 0 NOT NULL,max_connections int(11) unsigned DEFAULT 0 NOT NULL,PRIMARY KEY Host (Host,User)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Users and global privileges'; -CREATE TABLE func (name char(64) binary DEFAULT '' NOT NULL, ret tinyint(1) DEFAULT '0' NOT NULL, dl char(128) DEFAULT '' NOT NULL, type enum ('function','aggregate') NOT NULL, PRIMARY KEY (name)) comment='User defined functions'; +INSERT INTO user VALUES ('%','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); +INSERT INTO user VALUES ('localhost','','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); +INSERT INTO user VALUES ('%','','','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','','','','',0,0,0); -CREATE TABLE tables_priv (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Table_name char(60) binary DEFAULT '' NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Timestamp timestamp(14), Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') DEFAULT '' NOT NULL, Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name), KEY Grantor (Grantor)) comment='Table privileges'; +CREATE TABLE func (name char(64) binary DEFAULT '' NOT NULL,ret tinyint(1) DEFAULT '0' NOT NULL,dl char(128) DEFAULT '' NOT NULL,type enum ('function','aggregate') NOT NULL,PRIMARY KEY (name)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='User defined functions'; + +CREATE TABLE tables_priv (Host char(60) binary DEFAULT '' NOT NULL,Db char(64) binary DEFAULT '' NOT NULL,User char(16) binary DEFAULT '' NOT NULL,Table_name char(64) binary DEFAULT '' NOT NULL,Grantor char(77) DEFAULT '' NOT NULL,Timestamp timestamp(14),Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') DEFAULT '' NOT NULL,Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL,PRIMARY KEY (Host,Db,User,Table_name),KEY Grantor (Grantor)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Table privileges'; + +CREATE TABLE columns_priv (Host char(60) binary DEFAULT '' NOT NULL,Db char(64) binary DEFAULT '' NOT NULL,User char(16) binary DEFAULT '' NOT NULL,Table_name char(64) binary DEFAULT '' NOT NULL,Column_name char(64) binary DEFAULT '' NOT NULL,Timestamp timestamp(14),Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL,PRIMARY KEY (Host,Db,User,Table_name,Column_name)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Column privileges'; + +CREATE TABLE help_topic (help_topic_id int unsigned not null,name varchar(64) not null,help_category_id smallint unsigned not null,description text not null,example text not null,url varchar(128) not null,primary key (help_topic_id),unique index (name)) engine=MyISAM CHARACTER SET utf8 comment='help topics'; + +CREATE TABLE help_category (help_category_id smallint unsigned not null,name varchar(64) not null,parent_category_id smallint unsigned null,url varchar(128) not null,primary key (help_category_id),unique index (name)) engine=MyISAM CHARACTER SET utf8 comment='help categories'; + +CREATE TABLE help_keyword (help_keyword_id int unsigned not null,name varchar(64) not null,primary key (help_keyword_id),unique index (name)) engine=MyISAM CHARACTER SET utf8 comment='help keywords'; + +CREATE TABLE help_relation (help_topic_id int unsigned not null references help_topic,help_keyword_id int unsigned not null references help_keyword,primary key (help_keyword_id, help_topic_id)) engine=MyISAM CHARACTER SET utf8 comment='keyword-topic relation'; + +CREATE TABLE time_zone_name (Name char(64) NOT NULL,Time_zone_id int unsigned NOT NULL,PRIMARY KEY Name (Name)) engine=MyISAM CHARACTER SET utf8 comment='Time zone names'; + +INSERT INTO time_zone_name (Name, Time_Zone_id) VALUES ('MET', 1), ('UTC', 2), ('Universal', 2), ('Europe/Moscow',3), ('leap/Europe/Moscow',4), ('Japan', 5); + + +CREATE TABLE time_zone (Time_zone_id int unsigned NOT NULL auto_increment,Use_leap_seconds enum('Y','N') DEFAULT 'N' NOT NULL,PRIMARY KEY TzId (Time_zone_id)) engine=MyISAM CHARACTER SET utf8 comment='Time zones'; + +INSERT INTO time_zone (Time_zone_id, Use_leap_seconds) VALUES (1,'N'), (2,'N'), (3,'N'), (4,'Y'), (5,'N'); + + +CREATE TABLE time_zone_transition (Time_zone_id int unsigned NOT NULL,Transition_time bigint signed NOT NULL,Transition_type_id int unsigned NOT NULL,PRIMARY KEY TzIdTranTime (Time_zone_id, Transition_time)) engine=MyISAM CHARACTER SET utf8 comment='Time zone transitions'; + +INSERT INTO time_zone_transition (Time_zone_id, Transition_time, Transition_type_id) VALUES (1, -1693706400, 0) ,(1, -1680483600, 1),(1, -1663455600, 2) ,(1, -1650150000, 3),(1, -1632006000, 2) ,(1, -1618700400, 3),(1, -938905200, 2) ,(1, -857257200, 3),(1, -844556400, 2) ,(1, -828226800, 3),(1, -812502000, 2) ,(1, -796777200, 3),(1, 228877200, 2) ,(1, 243997200, 3),(1, 260326800, 2) ,(1, 276051600, 3),(1, 291776400, 2) ,(1, 307501200, 3),(1, 323830800, 2) ,(1, 338950800, 3),(1, 354675600, 2) ,(1, 370400400, 3),(1, 386125200, 2) ,(1, 401850000, 3),(1, 417574800, 2) ,(1, 433299600, 3),(1, 449024400, 2) ,(1, 465354000, 3),(1, 481078800, 2) ,(1, 496803600, 3),(1, 512528400, 2) ,(1, 528253200, 3),(1, 543978000, 2) ,(1, 559702800, 3),(1, 575427600, 2) ,(1, 591152400, 3),(1, 606877200, 2) ,(1, 622602000, 3),(1, 638326800, 2) ,(1, 654656400, 3),(1, 670381200, 2) ,(1, 686106000, 3),(1, 701830800, 2) ,(1, 717555600, 3),(1, 733280400, 2) ,(1, 749005200, 3),(1, 764730000, 2) ,(1, 780454800, 3),(1, 796179600, 2) ,(1, 811904400, 3),(1, 828234000, 2) ,(1, 846378000, 3),(1, 859683600, 2) ,(1, 877827600, 3),(1, 891133200, 2) ,(1, 909277200, 3),(1, 922582800, 2) ,(1, 941331600, 3),(1, 954032400, 2) ,(1, 972781200, 3),(1, 985482000, 2) ,(1, 1004230800, 3),(1, 1017536400, 2) ,(1, 1035680400, 3),(1, 1048986000, 2) ,(1, 1067130000, 3),(1, 1080435600, 2) ,(1, 1099184400, 3),(1, 1111885200, 2) ,(1, 1130634000, 3),(1, 1143334800, 2) ,(1, 1162083600, 3),(1, 1174784400, 2) ,(1, 1193533200, 3),(1, 1206838800, 2) ,(1, 1224982800, 3),(1, 1238288400, 2) ,(1, 1256432400, 3),(1, 1269738000, 2) ,(1, 1288486800, 3),(1, 1301187600, 2) ,(1, 1319936400, 3),(1, 1332637200, 2) ,(1, 1351386000, 3),(1, 1364691600, 2) ,(1, 1382835600, 3),(1, 1396141200, 2) ,(1, 1414285200, 3),(1, 1427590800, 2) ,(1, 1445734800, 3),(1, 1459040400, 2) ,(1, 1477789200, 3),(1, 1490490000, 2) ,(1, 1509238800, 3),(1, 1521939600, 2) ,(1, 1540688400, 3),(1, 1553994000, 2) ,(1, 1572138000, 3),(1, 1585443600, 2) ,(1, 1603587600, 3),(1, 1616893200, 2) ,(1, 1635642000, 3),(1, 1648342800, 2) ,(1, 1667091600, 3),(1, 1679792400, 2) ,(1, 1698541200, 3),(1, 1711846800, 2) ,(1, 1729990800, 3),(1, 1743296400, 2) ,(1, 1761440400, 3),(1, 1774746000, 2) ,(1, 1792890000, 3),(1, 1806195600, 2) ,(1, 1824944400, 3),(1, 1837645200, 2) ,(1, 1856394000, 3),(1, 1869094800, 2) ,(1, 1887843600, 3),(1, 1901149200, 2) ,(1, 1919293200, 3),(1, 1932598800, 2) ,(1, 1950742800, 3),(1, 1964048400, 2) ,(1, 1982797200, 3),(1, 1995498000, 2) ,(1, 2014246800, 3),(1, 2026947600, 2) ,(1, 2045696400, 3),(1, 2058397200, 2) ,(1, 2077146000, 3),(1, 2090451600, 2) ,(1, 2108595600, 3),(1, 2121901200, 2) ,(1, 2140045200, 3),(3, -1688265000, 2) ,(3, -1656819048, 1),(3, -1641353448, 2) ,(3, -1627965048, 3),(3, -1618716648, 1) ,(3, -1596429048, 3),(3, -1593829848, 5) ,(3, -1589860800, 4),(3, -1542427200, 5) ,(3, -1539493200, 6),(3, -1525323600, 5) ,(3, -1522728000, 4),(3, -1491188400, 7) ,(3, -1247536800, 4),(3, 354920400, 5) ,(3, 370728000, 4),(3, 386456400, 5) ,(3, 402264000, 4),(3, 417992400, 5) ,(3, 433800000, 4),(3, 449614800, 5) ,(3, 465346800, 8),(3, 481071600, 9) ,(3, 496796400, 8),(3, 512521200, 9) ,(3, 528246000, 8),(3, 543970800, 9) ,(3, 559695600, 8),(3, 575420400, 9) ,(3, 591145200, 8),(3, 606870000, 9) ,(3, 622594800, 8),(3, 638319600, 9) ,(3, 654649200, 8),(3, 670374000, 10) ,(3, 686102400, 11),(3, 695779200, 8) ,(3, 701812800, 5),(3, 717534000, 4) ,(3, 733273200, 9),(3, 748998000, 8) ,(3, 764722800, 9),(3, 780447600, 8) ,(3, 796172400, 9),(3, 811897200, 8) ,(3, 828226800, 9),(3, 846370800, 8) ,(3, 859676400, 9),(3, 877820400, 8) ,(3, 891126000, 9),(3, 909270000, 8) ,(3, 922575600, 9),(3, 941324400, 8) ,(3, 954025200, 9),(3, 972774000, 8) ,(3, 985474800, 9),(3, 1004223600, 8) ,(3, 1017529200, 9),(3, 1035673200, 8) ,(3, 1048978800, 9),(3, 1067122800, 8) ,(3, 1080428400, 9),(3, 1099177200, 8) ,(3, 1111878000, 9),(3, 1130626800, 8) ,(3, 1143327600, 9),(3, 1162076400, 8) ,(3, 1174777200, 9),(3, 1193526000, 8) ,(3, 1206831600, 9),(3, 1224975600, 8) ,(3, 1238281200, 9),(3, 1256425200, 8) ,(3, 1269730800, 9),(3, 1288479600, 8) ,(3, 1301180400, 9),(3, 1319929200, 8) ,(3, 1332630000, 9),(3, 1351378800, 8) ,(3, 1364684400, 9),(3, 1382828400, 8) ,(3, 1396134000, 9),(3, 1414278000, 8) ,(3, 1427583600, 9),(3, 1445727600, 8) ,(3, 1459033200, 9),(3, 1477782000, 8) ,(3, 1490482800, 9),(3, 1509231600, 8) ,(3, 1521932400, 9),(3, 1540681200, 8) ,(3, 1553986800, 9),(3, 1572130800, 8) ,(3, 1585436400, 9),(3, 1603580400, 8) ,(3, 1616886000, 9),(3, 1635634800, 8) ,(3, 1648335600, 9),(3, 1667084400, 8) ,(3, 1679785200, 9),(3, 1698534000, 8) ,(3, 1711839600, 9),(3, 1729983600, 8) ,(3, 1743289200, 9),(3, 1761433200, 8) ,(3, 1774738800, 9),(3, 1792882800, 8) ,(3, 1806188400, 9),(3, 1824937200, 8) ,(3, 1837638000, 9),(3, 1856386800, 8) ,(3, 1869087600, 9),(3, 1887836400, 8) ,(3, 1901142000, 9),(3, 1919286000, 8) ,(3, 1932591600, 9),(3, 1950735600, 8) ,(3, 1964041200, 9),(3, 1982790000, 8) ,(3, 1995490800, 9),(3, 2014239600, 8) ,(3, 2026940400, 9),(3, 2045689200, 8) ,(3, 2058390000, 9),(3, 2077138800, 8) ,(3, 2090444400, 9),(3, 2108588400, 8) ,(3, 2121894000, 9),(3, 2140038000, 8),(4, -1688265000, 2) ,(4, -1656819048, 1),(4, -1641353448, 2) ,(4, -1627965048, 3),(4, -1618716648, 1) ,(4, -1596429048, 3),(4, -1593829848, 5) ,(4, -1589860800, 4),(4, -1542427200, 5) ,(4, -1539493200, 6),(4, -1525323600, 5) ,(4, -1522728000, 4),(4, -1491188400, 7) ,(4, -1247536800, 4),(4, 354920409, 5) ,(4, 370728010, 4),(4, 386456410, 5) ,(4, 402264011, 4),(4, 417992411, 5) ,(4, 433800012, 4),(4, 449614812, 5) ,(4, 465346812, 8),(4, 481071612, 9) ,(4, 496796413, 8),(4, 512521213, 9) ,(4, 528246013, 8),(4, 543970813, 9) ,(4, 559695613, 8),(4, 575420414, 9) ,(4, 591145214, 8),(4, 606870014, 9) ,(4, 622594814, 8),(4, 638319615, 9) ,(4, 654649215, 8),(4, 670374016, 10) ,(4, 686102416, 11),(4, 695779216, 8) ,(4, 701812816, 5),(4, 717534017, 4) ,(4, 733273217, 9),(4, 748998018, 8) ,(4, 764722818, 9),(4, 780447619, 8) ,(4, 796172419, 9),(4, 811897219, 8) ,(4, 828226820, 9),(4, 846370820, 8) ,(4, 859676420, 9),(4, 877820421, 8) ,(4, 891126021, 9),(4, 909270021, 8) ,(4, 922575622, 9),(4, 941324422, 8) ,(4, 954025222, 9),(4, 972774022, 8) ,(4, 985474822, 9),(4, 1004223622, 8) ,(4, 1017529222, 9),(4, 1035673222, 8) ,(4, 1048978822, 9),(4, 1067122822, 8) ,(4, 1080428422, 9),(4, 1099177222, 8) ,(4, 1111878022, 9),(4, 1130626822, 8) ,(4, 1143327622, 9),(4, 1162076422, 8) ,(4, 1174777222, 9),(4, 1193526022, 8) ,(4, 1206831622, 9),(4, 1224975622, 8) ,(4, 1238281222, 9),(4, 1256425222, 8) ,(4, 1269730822, 9),(4, 1288479622, 8) ,(4, 1301180422, 9),(4, 1319929222, 8) ,(4, 1332630022, 9),(4, 1351378822, 8) ,(4, 1364684422, 9),(4, 1382828422, 8) ,(4, 1396134022, 9),(4, 1414278022, 8) ,(4, 1427583622, 9),(4, 1445727622, 8) ,(4, 1459033222, 9),(4, 1477782022, 8) ,(4, 1490482822, 9),(4, 1509231622, 8) ,(4, 1521932422, 9),(4, 1540681222, 8) ,(4, 1553986822, 9),(4, 1572130822, 8) ,(4, 1585436422, 9),(4, 1603580422, 8) ,(4, 1616886022, 9),(4, 1635634822, 8) ,(4, 1648335622, 9),(4, 1667084422, 8) ,(4, 1679785222, 9),(4, 1698534022, 8) ,(4, 1711839622, 9),(4, 1729983622, 8) ,(4, 1743289222, 9),(4, 1761433222, 8) ,(4, 1774738822, 9),(4, 1792882822, 8) ,(4, 1806188422, 9),(4, 1824937222, 8) ,(4, 1837638022, 9),(4, 1856386822, 8) ,(4, 1869087622, 9),(4, 1887836422, 8) ,(4, 1901142022, 9),(4, 1919286022, 8) ,(4, 1932591622, 9),(4, 1950735622, 8) ,(4, 1964041222, 9),(4, 1982790022, 8) ,(4, 1995490822, 9),(4, 2014239622, 8) ,(4, 2026940422, 9),(4, 2045689222, 8) ,(4, 2058390022, 9),(4, 2077138822, 8) ,(4, 2090444422, 9),(4, 2108588422, 8) ,(4, 2121894022, 9),(4, 2140038022, 8); + + +CREATE TABLE time_zone_transition_type (Time_zone_id int unsigned NOT NULL,Transition_type_id int unsigned NOT NULL,Offset int signed DEFAULT 0 NOT NULL,Is_DST tinyint unsigned DEFAULT 0 NOT NULL,Abbreviation char(8) DEFAULT '' NOT NULL,PRIMARY KEY TzIdTrTId (Time_zone_id, Transition_type_id)) engine=MyISAM CHARACTER SET utf8 comment='Time zone transition types'; + +INSERT INTO time_zone_transition_type (Time_zone_id,Transition_type_id, Offset, Is_DST, Abbreviation) VALUES (1, 0, 7200, 1, 'MEST') ,(1, 1, 3600, 0, 'MET') ,(1, 2, 7200, 1, 'MEST') ,(1, 3, 3600, 0, 'MET') ,(2, 0, 0, 0, 'UTC') ,(3, 0, 9000, 0, 'MMT') ,(3, 1, 12648, 1, 'MST') ,(3, 2, 9048, 0, 'MMT') ,(3, 3, 16248, 1, 'MDST') ,(3, 4, 10800, 0, 'MSK') ,(3, 5, 14400, 1, 'MSD') ,(3, 6, 18000, 1, 'MSD') ,(3, 7, 7200, 0, 'EET') ,(3, 8, 10800, 0, 'MSK') ,(3, 9, 14400, 1, 'MSD') ,(3, 10, 10800, 1, 'EEST') ,(3, 11, 7200, 0, 'EET') ,(4, 0, 9000, 0, 'MMT') ,(4, 1, 12648, 1, 'MST') ,(4, 2, 9048, 0, 'MMT') ,(4, 3, 16248, 1, 'MDST') ,(4, 4, 10800, 0, 'MSK') ,(4, 5, 14400, 1, 'MSD') ,(4, 6, 18000, 1, 'MSD') ,(4, 7, 7200, 0, 'EET') ,(4, 8, 10800, 0, 'MSK') ,(4, 9, 14400, 1, 'MSD') ,(4, 10, 10800, 1, 'EEST') ,(4, 11, 7200, 0, 'EET') ,(5, 0, 32400, 0, 'CJT') ,(5, 1, 32400, 0, 'JST'); + +CREATE TABLE time_zone_leap_second (Transition_time bigint signed NOT NULL,Correction int signed NOT NULL,PRIMARY KEY TranTime (Transition_time)) engine=MyISAM CHARACTER SET utf8 comment='Leap seconds information for time zones'; + +INSERT INTO time_zone_leap_second (Transition_time, Correction) VALUES (78796800, 1) ,(94694401, 2) ,(126230402, 3) ,(157766403, 4) ,(189302404, 5) ,(220924805, 6) ,(252460806, 7) ,(283996807, 8) ,(315532808, 9) ,(362793609, 10) ,(394329610, 11) ,(425865611, 12) ,(489024012, 13) ,(567993613, 14) ,(631152014, 15) ,(662688015, 16) ,(709948816, 17) ,(741484817, 18) ,(773020818, 19) ,(820454419, 20) ,(867715220, 21) ,(915148821, 22); -CREATE TABLE columns_priv (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Column_name char(64) binary DEFAULT '' NOT NULL, Timestamp timestamp(14), Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name,Column_name)) comment='Column privileges'; From c5e6941e75454a01953ff542ceda7e4aeb1c22ae Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 10 Nov 2004 14:05:28 +0400 Subject: [PATCH 0159/1063] 1. When mixing NULL to a character string, the result takes its charset/collation attributes from the character string, e.g. SELECT func(NULL, _latin2'string') now returns a latin2 result. This is done by introducing a new derivation (aka coercibility) level DERIVATION_IGNORABLE, which is used with Item_null. 2. 'Pure' NULL is now BINARY(0), not CHAR(0). I.e. NULL is now more typeless. mysql-test/r/metadata.result: Fixing test results: CHAR(0) -> BINARY(0) for NULLs mysql-test/r/null.result: Testing mixing NULL with a character string with a number of functions. mysql-test/r/ps_2myisam.result: Fixing test results: CHAR(0) -> BINARY(0) for NULLs mysql-test/r/ps_3innodb.result: Fixing test results: CHAR(0) -> BINARY(0) for NULLs mysql-test/r/ps_4heap.result: Fixing test results: CHAR(0) -> BINARY(0) for NULLs mysql-test/r/ps_5merge.result: Fixing test results: CHAR(0) -> BINARY(0) for NULLs mysql-test/r/ps_6bdb.result: Fixing test results: CHAR(0) -> BINARY(0) for NULLs mysql-test/r/ps_7ndb.result: Fixing test results: CHAR(0) -> BINARY(0) for NULLs mysql-test/t/null.test: Testing mixing NULL with a character string with a number of functions. sql/item.cc: New derivation level. sql/item.h: New derivation level. --- mysql-test/r/metadata.result | 2 +- mysql-test/r/null.result | 94 ++++++++++++++++++++++++++++++++++ mysql-test/r/ps_2myisam.result | 4 +- mysql-test/r/ps_3innodb.result | 4 +- mysql-test/r/ps_4heap.result | 4 +- mysql-test/r/ps_5merge.result | 8 +-- mysql-test/r/ps_6bdb.result | 4 +- mysql-test/r/ps_7ndb.result | 4 +- mysql-test/t/null.test | 67 ++++++++++++++++++++++++ sql/item.cc | 4 +- sql/item.h | 3 ++ 11 files changed, 181 insertions(+), 17 deletions(-) diff --git a/mysql-test/r/metadata.result b/mysql-test/r/metadata.result index ced3ca61f80..2321a8998ac 100644 --- a/mysql-test/r/metadata.result +++ b/mysql-test/r/metadata.result @@ -5,7 +5,7 @@ def 1 8 1 1 N 32769 0 8 def 1.0 5 3 3 N 32769 1 8 def -1 8 1 2 N 32769 0 8 def hello 254 5 5 N 1 31 8 -def NULL 6 0 0 Y 32768 0 8 +def NULL 6 0 0 Y 32896 0 63 1 1.0 -1 hello NULL 1 1.0 -1 hello NULL create table t1 (a tinyint, b smallint, c mediumint, d int, e bigint, f float(3,2), g double(4,3), h decimal(5,4), i year, j date, k timestamp, l datetime, m enum('a','b'), n set('a','b'), o char(10)); diff --git a/mysql-test/r/null.result b/mysql-test/r/null.result index bd90b3fe3f3..3e233eb512a 100644 --- a/mysql-test/r/null.result +++ b/mysql-test/r/null.result @@ -175,3 +175,97 @@ explain select * from t1 where i=2 or i is null; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ref i i 4 const 7 Using where; Using index drop table t1; +set names latin2; +create table t1 select +null as c00, +if(1, null, 'string') as c01, +if(0, null, 'string') as c02, +ifnull(null, 'string') as c03, +ifnull('string', null) as c04, +case when 0 then null else 'string' end as c05, +case when 1 then null else 'string' end as c06, +coalesce(null, 'string') as c07, +coalesce('string', null) as c08, +least('string',null) as c09, +least(null, 'string') as c10, +greatest('string',null) as c11, +greatest(null, 'string') as c12, +nullif('string', null) as c13, +nullif(null, 'string') as c14, +trim('string' from null) as c15, +trim(null from 'string') as c16, +substring_index('string', null, 1) as c17, +substring_index(null, 'string', 1) as c18, +elt(1, null, 'string') as c19, +elt(1, 'string', null) as c20, +concat('string', null) as c21, +concat(null, 'string') as c22, +concat_ws('sep', 'string', null) as c23, +concat_ws('sep', null, 'string') as c24, +concat_ws(null, 'string', 'string') as c25, +make_set(3, 'string', null) as c26, +make_set(3, null, 'string') as c27, +export_set(3, null, 'off', 'sep') as c29, +export_set(3, 'on', null, 'sep') as c30, +export_set(3, 'on', 'off', null) as c31, +replace(null, 'from', 'to') as c32, +replace('str', null, 'to') as c33, +replace('str', 'from', null) as c34, +insert('str', 1, 2, null) as c35, +insert(null, 1, 2, 'str') as c36, +lpad('str', 10, null) as c37, +rpad(null, 10, 'str') as c38; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c00` binary(0) default NULL, + `c01` varchar(6) character set latin2 default NULL, + `c02` varchar(6) character set latin2 default NULL, + `c03` varchar(6) character set latin2 NOT NULL default '', + `c04` varchar(6) character set latin2 default NULL, + `c05` varchar(6) character set latin2 default NULL, + `c06` varchar(6) character set latin2 default NULL, + `c07` varchar(6) character set latin2 default NULL, + `c08` varchar(6) character set latin2 default NULL, + `c09` varchar(6) character set latin2 NOT NULL default '', + `c10` varchar(6) character set latin2 NOT NULL default '', + `c11` varchar(6) character set latin2 NOT NULL default '', + `c12` varchar(6) character set latin2 NOT NULL default '', + `c13` varchar(6) character set latin2 default NULL, + `c14` char(0) character set latin2 default NULL, + `c15` char(0) character set latin2 default NULL, + `c16` varchar(6) character set latin2 default NULL, + `c17` varchar(6) character set latin2 default NULL, + `c18` char(0) character set latin2 default NULL, + `c19` varchar(6) character set latin2 default NULL, + `c20` varchar(6) character set latin2 default NULL, + `c21` varchar(6) character set latin2 default NULL, + `c22` varchar(6) character set latin2 default NULL, + `c23` varchar(9) character set latin2 default NULL, + `c24` varchar(9) character set latin2 default NULL, + `c25` varchar(12) character set latin2 default NULL, + `c26` varchar(7) character set latin2 default NULL, + `c27` varchar(7) character set latin2 default NULL, + `c29` longtext character set latin2, + `c30` longtext character set latin2, + `c31` varchar(192) character set latin2 default NULL, + `c32` char(0) character set latin2 default NULL, + `c33` char(3) character set latin2 default NULL, + `c34` char(3) character set latin2 default NULL, + `c35` char(3) character set latin2 default NULL, + `c36` char(3) character set latin2 default NULL, + `c37` varchar(10) character set latin2 default NULL, + `c38` varchar(10) character set latin2 default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select +case 'str' when 'STR' then 'str' when null then 'null' end as c01, +case 'str' when null then 'null' when 'STR' then 'str' end as c02, +field(null, 'str1', 'str2') as c03, +field('str1','STR1', null) as c04, +field('str1', null, 'STR1') as c05, +'string' in ('STRING', null) as c08, +'string' in (null, 'STRING') as c09; +c01 c02 c03 c04 c05 c08 c09 +str str 0 1 2 1 1 +set names latin1; diff --git a/mysql-test/r/ps_2myisam.result b/mysql-test/r/ps_2myisam.result index 345929d8104..42b4580643e 100644 --- a/mysql-test/r/ps_2myisam.result +++ b/mysql-test/r/ps_2myisam.result @@ -1790,7 +1790,7 @@ t5 CREATE TABLE `t5` ( `param10` bigint(20) default NULL, `const11` int(4) default NULL, `param11` bigint(20) default NULL, - `const12` char(0) default NULL, + `const12` binary(0) default NULL, `param12` bigint(20) default NULL, `param13` double default NULL, `param14` longtext, @@ -1820,7 +1820,7 @@ def test t5 t5 const10 const10 3 10 9 N 32769 0 63 def test t5 t5 param10 param10 8 20 9 Y 32768 0 63 def test t5 t5 const11 const11 3 4 4 Y 32768 0 63 def test t5 t5 param11 param11 8 20 4 Y 32768 0 63 -def test t5 t5 const12 const12 254 0 0 Y 0 0 8 +def test t5 t5 const12 const12 254 0 0 Y 128 0 63 def test t5 t5 param12 param12 8 20 0 Y 32768 0 63 def test t5 t5 param13 param13 5 20 0 Y 32768 31 63 def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8 diff --git a/mysql-test/r/ps_3innodb.result b/mysql-test/r/ps_3innodb.result index 45a3af8e6fa..bb001fe9e02 100644 --- a/mysql-test/r/ps_3innodb.result +++ b/mysql-test/r/ps_3innodb.result @@ -1773,7 +1773,7 @@ t5 CREATE TABLE `t5` ( `param10` bigint(20) default NULL, `const11` int(4) default NULL, `param11` bigint(20) default NULL, - `const12` char(0) default NULL, + `const12` binary(0) default NULL, `param12` bigint(20) default NULL, `param13` double default NULL, `param14` longtext, @@ -1803,7 +1803,7 @@ def test t5 t5 const10 const10 3 10 9 N 32769 0 63 def test t5 t5 param10 param10 8 20 9 Y 32768 0 63 def test t5 t5 const11 const11 3 4 4 Y 32768 0 63 def test t5 t5 param11 param11 8 20 4 Y 32768 0 63 -def test t5 t5 const12 const12 254 0 0 Y 0 0 8 +def test t5 t5 const12 const12 254 0 0 Y 128 0 63 def test t5 t5 param12 param12 8 20 0 Y 32768 0 63 def test t5 t5 param13 param13 5 20 0 Y 32768 31 63 def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8 diff --git a/mysql-test/r/ps_4heap.result b/mysql-test/r/ps_4heap.result index 995224fcd21..263b389ffa4 100644 --- a/mysql-test/r/ps_4heap.result +++ b/mysql-test/r/ps_4heap.result @@ -1774,7 +1774,7 @@ t5 CREATE TABLE `t5` ( `param10` bigint(20) default NULL, `const11` int(4) default NULL, `param11` bigint(20) default NULL, - `const12` char(0) default NULL, + `const12` binary(0) default NULL, `param12` bigint(20) default NULL, `param13` double default NULL, `param14` longtext, @@ -1804,7 +1804,7 @@ def test t5 t5 const10 const10 3 10 9 N 32769 0 63 def test t5 t5 param10 param10 8 20 9 Y 32768 0 63 def test t5 t5 const11 const11 3 4 4 Y 32768 0 63 def test t5 t5 param11 param11 8 20 4 Y 32768 0 63 -def test t5 t5 const12 const12 254 0 0 Y 0 0 8 +def test t5 t5 const12 const12 254 0 0 Y 128 0 63 def test t5 t5 param12 param12 8 20 0 Y 32768 0 63 def test t5 t5 param13 param13 5 20 0 Y 32768 31 63 def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8 diff --git a/mysql-test/r/ps_5merge.result b/mysql-test/r/ps_5merge.result index 7a0191b186a..0ec296717e0 100644 --- a/mysql-test/r/ps_5merge.result +++ b/mysql-test/r/ps_5merge.result @@ -1713,7 +1713,7 @@ t5 CREATE TABLE `t5` ( `param10` bigint(20) default NULL, `const11` int(4) default NULL, `param11` bigint(20) default NULL, - `const12` char(0) default NULL, + `const12` binary(0) default NULL, `param12` bigint(20) default NULL, `param13` double default NULL, `param14` longtext, @@ -1743,7 +1743,7 @@ def test t5 t5 const10 const10 3 10 9 N 32769 0 63 def test t5 t5 param10 param10 8 20 9 Y 32768 0 63 def test t5 t5 const11 const11 3 4 4 Y 32768 0 63 def test t5 t5 param11 param11 8 20 4 Y 32768 0 63 -def test t5 t5 const12 const12 254 0 0 Y 0 0 8 +def test t5 t5 const12 const12 254 0 0 Y 128 0 63 def test t5 t5 param12 param12 8 20 0 Y 32768 0 63 def test t5 t5 param13 param13 5 20 0 Y 32768 31 63 def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8 @@ -4723,7 +4723,7 @@ t5 CREATE TABLE `t5` ( `param10` bigint(20) default NULL, `const11` int(4) default NULL, `param11` bigint(20) default NULL, - `const12` char(0) default NULL, + `const12` binary(0) default NULL, `param12` bigint(20) default NULL, `param13` double default NULL, `param14` longtext, @@ -4753,7 +4753,7 @@ def test t5 t5 const10 const10 3 10 9 N 32769 0 63 def test t5 t5 param10 param10 8 20 9 Y 32768 0 63 def test t5 t5 const11 const11 3 4 4 Y 32768 0 63 def test t5 t5 param11 param11 8 20 4 Y 32768 0 63 -def test t5 t5 const12 const12 254 0 0 Y 0 0 8 +def test t5 t5 const12 const12 254 0 0 Y 128 0 63 def test t5 t5 param12 param12 8 20 0 Y 32768 0 63 def test t5 t5 param13 param13 5 20 0 Y 32768 31 63 def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8 diff --git a/mysql-test/r/ps_6bdb.result b/mysql-test/r/ps_6bdb.result index d0549503bfe..bb28abeda69 100644 --- a/mysql-test/r/ps_6bdb.result +++ b/mysql-test/r/ps_6bdb.result @@ -1773,7 +1773,7 @@ t5 CREATE TABLE `t5` ( `param10` bigint(20) default NULL, `const11` int(4) default NULL, `param11` bigint(20) default NULL, - `const12` char(0) default NULL, + `const12` binary(0) default NULL, `param12` bigint(20) default NULL, `param13` double default NULL, `param14` longtext, @@ -1803,7 +1803,7 @@ def test t5 t5 const10 const10 3 10 9 N 32769 0 63 def test t5 t5 param10 param10 8 20 9 Y 32768 0 63 def test t5 t5 const11 const11 3 4 4 Y 32768 0 63 def test t5 t5 param11 param11 8 20 4 Y 32768 0 63 -def test t5 t5 const12 const12 254 0 0 Y 0 0 8 +def test t5 t5 const12 const12 254 0 0 Y 128 0 63 def test t5 t5 param12 param12 8 20 0 Y 32768 0 63 def test t5 t5 param13 param13 5 20 0 Y 32768 31 63 def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8 diff --git a/mysql-test/r/ps_7ndb.result b/mysql-test/r/ps_7ndb.result index e90eff5d1cd..70118509d0b 100644 --- a/mysql-test/r/ps_7ndb.result +++ b/mysql-test/r/ps_7ndb.result @@ -1749,7 +1749,7 @@ t5 CREATE TABLE `t5` ( `param10` bigint(20) default NULL, `const11` int(4) default NULL, `param11` bigint(20) default NULL, - `const12` char(0) default NULL, + `const12` binary(0) default NULL, `param12` bigint(20) default NULL, `param13` double default NULL, `param14` longtext, @@ -1779,7 +1779,7 @@ def test t5 t5 const10 const10 3 10 9 N 32769 0 63 def test t5 t5 param10 param10 8 20 9 Y 32768 0 63 def test t5 t5 const11 const11 3 4 4 Y 32768 0 63 def test t5 t5 param11 param11 8 20 4 Y 32768 0 63 -def test t5 t5 const12 const12 254 0 0 Y 0 0 8 +def test t5 t5 const12 const12 254 0 0 Y 128 0 63 def test t5 t5 param12 param12 8 20 0 Y 32768 0 63 def test t5 t5 param13 param13 5 20 0 Y 32768 31 63 def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8 diff --git a/mysql-test/t/null.test b/mysql-test/t/null.test index 7d30fd06ba7..9ddef252d67 100644 --- a/mysql-test/t/null.test +++ b/mysql-test/t/null.test @@ -119,3 +119,70 @@ alter table t1 change i i int not null; explain select * from t1 where i=2 or i is null; drop table t1; +# +# NULL has its own type BINARY(0) by default. +# But NULL should be weaker than a constant +# when mixing charsets/collations +# +set names latin2; +# Check that result type is taken from a non-null string +create table t1 select + null as c00, + if(1, null, 'string') as c01, + if(0, null, 'string') as c02, + ifnull(null, 'string') as c03, + ifnull('string', null) as c04, + case when 0 then null else 'string' end as c05, + case when 1 then null else 'string' end as c06, + coalesce(null, 'string') as c07, + coalesce('string', null) as c08, + least('string',null) as c09, + least(null, 'string') as c10, + greatest('string',null) as c11, + greatest(null, 'string') as c12, + nullif('string', null) as c13, + nullif(null, 'string') as c14, + trim('string' from null) as c15, + trim(null from 'string') as c16, + substring_index('string', null, 1) as c17, + substring_index(null, 'string', 1) as c18, + elt(1, null, 'string') as c19, + elt(1, 'string', null) as c20, + concat('string', null) as c21, + concat(null, 'string') as c22, + concat_ws('sep', 'string', null) as c23, + concat_ws('sep', null, 'string') as c24, + concat_ws(null, 'string', 'string') as c25, + make_set(3, 'string', null) as c26, + make_set(3, null, 'string') as c27, + export_set(3, null, 'off', 'sep') as c29, + export_set(3, 'on', null, 'sep') as c30, + export_set(3, 'on', 'off', null) as c31, + replace(null, 'from', 'to') as c32, + replace('str', null, 'to') as c33, + replace('str', 'from', null) as c34, + insert('str', 1, 2, null) as c35, + insert(null, 1, 2, 'str') as c36, + lpad('str', 10, null) as c37, + rpad(null, 10, 'str') as c38; + +show create table t1; +drop table t1; + +# +# Check that comparison is done according to +# non-null string collation, i.e. case insensitively, +# rather than according to NULL's collation, i.e. case sensitively +# +-- in field +select + case 'str' when 'STR' then 'str' when null then 'null' end as c01, + case 'str' when null then 'null' when 'STR' then 'str' end as c02, + field(null, 'str1', 'str2') as c03, + field('str1','STR1', null) as c04, + field('str1', null, 'STR1') as c05, + 'string' in ('STRING', null) as c08, + 'string' in (null, 'STRING') as c09; + +# Restore charset to the default value. +set names latin1; diff --git a/sql/item.cc b/sql/item.cc index b4e7322b7cc..0e7a2b50b51 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -376,13 +376,13 @@ bool DTCollation::aggregate(DTCollation &dt, uint flags) } else if ((flags & MY_COLL_ALLOW_COERCIBLE_CONV) && derivation < dt.derivation && - dt.derivation == DERIVATION_COERCIBLE) + dt.derivation >= DERIVATION_COERCIBLE) { // Do nothing; } else if ((flags & MY_COLL_ALLOW_COERCIBLE_CONV) && dt.derivation < derivation && - derivation == DERIVATION_COERCIBLE) + derivation >= DERIVATION_COERCIBLE) { set(dt); strong= nagg; diff --git a/sql/item.h b/sql/item.h index fea3aa010a8..547577a7ee0 100644 --- a/sql/item.h +++ b/sql/item.h @@ -31,6 +31,7 @@ void item_init(void); /* Init item functions */ enum Derivation { + DERIVATION_IGNORABLE= 4, DERIVATION_COERCIBLE= 3, DERIVATION_IMPLICIT= 2, DERIVATION_NONE= 1, @@ -98,6 +99,7 @@ public: { switch(derivation) { + case DERIVATION_IGNORABLE: return "IGNORABLE"; case DERIVATION_COERCIBLE: return "COERCIBLE"; case DERIVATION_IMPLICIT: return "IMPLICIT"; case DERIVATION_EXPLICIT: return "EXPLICIT"; @@ -440,6 +442,7 @@ public: max_length= 0; name= name_par ? name_par : (char*) "NULL"; fixed= 1; + collation.set(&my_charset_bin, DERIVATION_IGNORABLE); } enum Type type() const { return NULL_ITEM; } bool eq(const Item *item, bool binary_cmp) const; From 81880bab136d5df8cfdc47a953cff1442adb11f6 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 10 Nov 2004 14:13:38 +0400 Subject: [PATCH 0160/1063] Adding new function prototype --- include/mysql.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/mysql.h b/include/mysql.h index 156d749234b..2c0197e2300 100644 --- a/include/mysql.h +++ b/include/mysql.h @@ -490,6 +490,8 @@ MYSQL_RES * STDCALL mysql_list_fields(MYSQL *mysql, const char *table, const char *wild); unsigned long STDCALL mysql_escape_string(char *to,const char *from, unsigned long from_length); +unsigned long STDCALL mysql_hex_string(char *to,const char *from, + unsigned long from_length); unsigned long STDCALL mysql_real_escape_string(MYSQL *mysql, char *to,const char *from, unsigned long length); From 63b4095284d7dfbf8ae7233ad9bcebe260ec92ed Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 10 Nov 2004 14:18:49 +0100 Subject: [PATCH 0161/1063] wl1744 - nbd windoze port ndb/include/logger/SysLogHandler.hpp: win-port ndb/include/ndb_global.h: win-port ndb/include/portlib/PortDefs.h: win-port ndb/src/common/mgmcommon/NdbConfig.c: win-port ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp: win-port ndb/src/kernel/blocks/dbdih/DbdihMain.cpp: win-port ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp: win-port ndb/src/kernel/main.cpp: win-port ndb/src/kernel/vm/Configuration.cpp: win-port ndb/src/kernel/vm/Emulator.cpp: win-port ndb/src/mgmsrv/CommandInterpreter.cpp: win-port ndb/src/mgmsrv/main.cpp: win-port scripts/make_win_src_distribution.sh: win-port --- ndb/include/logger/SysLogHandler.hpp | 4 +- ndb/include/ndb_global.h | 47 +++++++++++------------ ndb/include/portlib/PortDefs.h | 43 --------------------- ndb/src/common/mgmcommon/NdbConfig.c | 23 +++++------ ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp | 2 + ndb/src/kernel/blocks/dbdih/DbdihMain.cpp | 4 +- ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp | 2 +- ndb/src/kernel/main.cpp | 20 +++++++--- ndb/src/kernel/vm/Configuration.cpp | 8 ++-- ndb/src/kernel/vm/Emulator.cpp | 4 +- ndb/src/mgmsrv/CommandInterpreter.cpp | 9 +++-- ndb/src/mgmsrv/main.cpp | 4 +- scripts/make_win_src_distribution.sh | 2 +- 13 files changed, 72 insertions(+), 100 deletions(-) diff --git a/ndb/include/logger/SysLogHandler.hpp b/ndb/include/logger/SysLogHandler.hpp index 4f13308d61b..0dfc1cb2d43 100644 --- a/ndb/include/logger/SysLogHandler.hpp +++ b/ndb/include/logger/SysLogHandler.hpp @@ -18,7 +18,9 @@ #define SYSLOGHANDLER_H #include "LogHandler.hpp" +#ifndef NDB_WIN32 #include +#endif /** * Logs messages to syslog. The default identity is 'NDB'. @@ -62,7 +64,7 @@ public: * @param pIdentity a syslog identity. * @param facility syslog facility, defaults to LOG_USER */ - SysLogHandler(const char* pIdentity, int facility = LOG_USER); + SysLogHandler(const char* pIdentity, int facility); /** * Destructor. diff --git a/ndb/include/ndb_global.h b/ndb/include/ndb_global.h index bdd4e503cc5..775d69b38e5 100644 --- a/ndb/include/ndb_global.h +++ b/ndb/include/ndb_global.h @@ -2,16 +2,23 @@ #ifndef NDBGLOBAL_H #define NDBGLOBAL_H -#include - -/** signal & SIG_PIPE */ -#include +#include #if defined(_WIN32) || defined(_WIN64) || defined(__WIN32__) || defined(WIN32) #define NDB_WIN32 +#include +#include +#include + +#define PATH_MAX 256 +#define DIR_SEPARATOR "\\" + +#pragma warning(disable: 4503 4786) + #else #undef NDB_WIN32 -#endif +#include +#include #ifdef _AIX #undef _H_STRINGS @@ -47,23 +54,22 @@ #include #endif -#ifdef NDB_WIN32 -#include -#include - -#define DIR_SEPARATOR "\\" -#define PATH_MAX 256 - -#pragma warning(disable: 4503 4786) -#else - #define DIR_SEPARATOR "/" #endif +#ifndef HAVE_STRDUP +extern char * strdup(const char *s); +#endif + +#ifndef HAVE_STRCASECMP +extern int strcasecmp(const char *s1, const char *s2); +extern int strncasecmp(const char *s1, const char *s2, size_t n); +#endif + static const char table_name_separator = '/'; -#if defined(_AIX) || defined(NDB_VC98) +#if defined(_AIX) || defined(WIN32) || defined(NDB_VC98) #define STATIC_CONST(x) enum { x } #else #define STATIC_CONST(x) static const Uint32 x @@ -84,15 +90,6 @@ extern int ndb_init(void); extern void ndb_end(int); #define NDB_INIT(prog_name) {my_progname=(prog_name); ndb_init();} -#ifndef HAVE_STRDUP -extern char * strdup(const char *s); -#endif - -#ifndef HAVE_STRCASECMP -extern int strcasecmp(const char *s1, const char *s2); -extern int strncasecmp(const char *s1, const char *s2, size_t n); -#endif - #ifdef SCO #ifndef PATH_MAX diff --git a/ndb/include/portlib/PortDefs.h b/ndb/include/portlib/PortDefs.h index b61bb627e65..a115c60cfe1 100644 --- a/ndb/include/portlib/PortDefs.h +++ b/ndb/include/portlib/PortDefs.h @@ -22,55 +22,12 @@ $Id: PortDefs.h,v 1.5 2003/10/07 07:59:59 mikael Exp $ */ -#ifdef NDB_WIN32 -#include - - -struct tms -{ - time_t tms_utime; /* user time */ - time_t tms_stime; /* system time */ - time_t tms_cutime; /* user time of children */ - time_t tms_cstime; /* system time of children */ -}; - -struct timespec -{ - long tv_sec; /* Seconds */ - long tv_nsec; /* Nanoseconds */ -}; - -#define strcasecmp(a,b) _strcmpi(a,b) - -/* Exports a WIN32 getopt function */ -extern int optind; -extern char *optarg; -int getopt(int, char **, char *opts); -#endif /* NDB_WIN32 */ #ifdef NDB_ALPHA #ifdef NDB_GCC /* only for NDB_ALPHA */ extern int gnuShouldNotUseRPCC(); #define RPCC() gnuShouldNotUseRPCC(); #else -#ifdef NDB_WIN32 -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - u_int64 __asm(char *, ...); - double __dasm(char *, ...); - float __fasm(char *, ...); - void _AcquireSpinLock(long *); - void _ReleaseSpinLock(long *); - int __ADD_ATOMIC_LONG2(void *, int); -#ifdef __cplusplus -}; -#endif /* __cplusplus */ -#pragma intrinsic (__asm, __dasm, __fasm) -#pragma intrinsic(_ReleaseSpinLock, _AcquireSpinLock) -#pragma intrinsic(__ADD_ATOMIC_LONG2) -#endif /* NDB_WIN32 */ - #define RPCC() ((int)__asm(" rpcc v0;")) #define MB() __asm(" mb;"); #define WMB() __asm(" wmb;"); diff --git a/ndb/src/common/mgmcommon/NdbConfig.c b/ndb/src/common/mgmcommon/NdbConfig.c index e92f8fa8392..15dbcff8a56 100644 --- a/ndb/src/common/mgmcommon/NdbConfig.c +++ b/ndb/src/common/mgmcommon/NdbConfig.c @@ -18,6 +18,7 @@ #include #include #include +#include static const char *datadir_path= 0; @@ -48,7 +49,7 @@ NdbConfig_AllocHomePath(int _len) const char *path= NdbConfig_get_path(&path_len); int len= _len+path_len; char *buf= NdbMem_Allocate(len); - snprintf(buf, len, "%s%s", path, DIR_SEPARATOR); + basestring_snprintf(buf, len, "%s%s", path, DIR_SEPARATOR); return buf; } @@ -67,7 +68,7 @@ NdbConfig_NdbCfgName(int with_ndb_home){ len= strlen(buf); } else buf= NdbMem_Allocate(128); - snprintf(buf+len, 128, "Ndb.cfg"); + basestring_snprintf(buf+len, 128, "Ndb.cfg"); return buf; } @@ -77,9 +78,9 @@ char *get_prefix_buf(int len, int node_id) char tmp_buf[sizeof("ndb_pid#########")+1]; char *buf; if (node_id > 0) - snprintf(tmp_buf, sizeof(tmp_buf), "ndb_%u", node_id); + basestring_snprintf(tmp_buf, sizeof(tmp_buf), "ndb_%u", node_id); else - snprintf(tmp_buf, sizeof(tmp_buf), "ndb_pid%u", getpid()); + basestring_snprintf(tmp_buf, sizeof(tmp_buf), "ndb_pid%u", getpid()); tmp_buf[sizeof(tmp_buf)-1]= 0; buf= NdbConfig_AllocHomePath(len+strlen(tmp_buf)); @@ -91,7 +92,7 @@ char* NdbConfig_ErrorFileName(int node_id){ char *buf= get_prefix_buf(128, node_id); int len= strlen(buf); - snprintf(buf+len, 128, "_error.log"); + basestring_snprintf(buf+len, 128, "_error.log"); return buf; } @@ -99,7 +100,7 @@ char* NdbConfig_ClusterLogFileName(int node_id){ char *buf= get_prefix_buf(128, node_id); int len= strlen(buf); - snprintf(buf+len, 128, "_cluster.log"); + basestring_snprintf(buf+len, 128, "_cluster.log"); return buf; } @@ -107,7 +108,7 @@ char* NdbConfig_SignalLogFileName(int node_id){ char *buf= get_prefix_buf(128, node_id); int len= strlen(buf); - snprintf(buf+len, 128, "_signal.log"); + basestring_snprintf(buf+len, 128, "_signal.log"); return buf; } @@ -115,7 +116,7 @@ char* NdbConfig_TraceFileName(int node_id, int file_no){ char *buf= get_prefix_buf(128, node_id); int len= strlen(buf); - snprintf(buf+len, 128, "_trace.log.%u", file_no); + basestring_snprintf(buf+len, 128, "_trace.log.%u", file_no); return buf; } @@ -123,7 +124,7 @@ char* NdbConfig_NextTraceFileName(int node_id){ char *buf= get_prefix_buf(128, node_id); int len= strlen(buf); - snprintf(buf+len, 128, "_trace.log.next"); + basestring_snprintf(buf+len, 128, "_trace.log.next"); return buf; } @@ -131,7 +132,7 @@ char* NdbConfig_PidFileName(int node_id){ char *buf= get_prefix_buf(128, node_id); int len= strlen(buf); - snprintf(buf+len, 128, ".pid"); + basestring_snprintf(buf+len, 128, ".pid"); return buf; } @@ -139,6 +140,6 @@ char* NdbConfig_StdoutFileName(int node_id){ char *buf= get_prefix_buf(128, node_id); int len= strlen(buf); - snprintf(buf+len, 128, "_out.log"); + basestring_snprintf(buf+len, 128, "_out.log"); return buf; } diff --git a/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp b/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp index 234d832655c..c4127ba9283 100644 --- a/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp +++ b/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp @@ -150,6 +150,7 @@ void Cmvmi::execNDB_TAMPER(Signal* signal) ndbrequire(false); } +#ifndef NDB_WIN32 if(ERROR_INSERTED(9996)){ simulate_error_during_shutdown= SIGSEGV; ndbrequire(false); @@ -159,6 +160,7 @@ void Cmvmi::execNDB_TAMPER(Signal* signal) simulate_error_during_shutdown= SIGSEGV; kill(getpid(), SIGABRT); } +#endif }//execNDB_TAMPER() void Cmvmi::execSET_LOGLEVELORD(Signal* signal) diff --git a/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp b/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp index 76aa745c3e0..9fd69378359 100644 --- a/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp +++ b/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp @@ -12944,7 +12944,7 @@ Dbdih::execDUMP_STATE_ORD(Signal* signal) Uint32 nodeOrder[MAX_REPLICAS]; const Uint32 noOfReplicas = extractNodeInfo(fragPtr.p, nodeOrder); char buf[100]; - snprintf(buf, sizeof(buf), " Table %d Fragment %d - ", tabPtr.i, j); + BaseString::snprintf(buf, sizeof(buf), " Table %d Fragment %d - ", tabPtr.i, j); for(Uint32 k = 0; k < noOfReplicas; k++){ char tmp[100]; BaseString::snprintf(tmp, sizeof(tmp), "%d ", nodeOrder[k]); @@ -13155,7 +13155,7 @@ Dbdih::execDUMP_STATE_ORD(Signal* signal) getFragstore(tabPtr.p, fid, fragPtr); char buf[100], buf2[100]; - snprintf(buf, sizeof(buf), " Fragment %d: noLcpReplicas==%d ", + BaseString::snprintf(buf, sizeof(buf), " Fragment %d: noLcpReplicas==%d ", fid, fragPtr.p->noLcpReplicas); Uint32 num=0; diff --git a/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp b/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp index 56e3d3abbed..21b0a2cb54f 100644 --- a/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp +++ b/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp @@ -730,7 +730,7 @@ Ndbfs::scanIPC(Signal* signal) jam(); report(request, signal); theRequestPool->put(request); - return &request; + return true; } return false; } diff --git a/ndb/src/kernel/main.cpp b/ndb/src/kernel/main.cpp index 926647838c9..2901320633c 100644 --- a/ndb/src/kernel/main.cpp +++ b/ndb/src/kernel/main.cpp @@ -77,11 +77,13 @@ int main(int argc, char** argv) } { // Do configuration - signal(SIGPIPE, SIG_IGN); +#ifndef NDB_WIN32 + signal(SIGPIPE, SIG_IGN); +#endif theConfig->fetch_configuration(local_config); } - - chdir(NdbConfig_get_path(0)); + + my_setwd(NdbConfig_get_path(0), MYF(0)); if (theConfig->getDaemonMode()) { // Become a daemon @@ -95,6 +97,7 @@ int main(int argc, char** argv) } } +#ifndef NDB_WIN32 for(pid_t child = fork(); child != 0; child = fork()){ /** * Parent @@ -145,6 +148,9 @@ int main(int argc, char** argv) } g_eventLogger.info("Angel pid: %d ndb pid: %d", getppid(), getpid()); +#else + g_eventLogger.info("Ndb started"); +#endif theConfig->setupConfiguration(); systemInfo(* theConfig, * theConfig->m_logLevel); @@ -276,7 +282,7 @@ systemInfo(const Configuration & config, const LogLevel & logLevel){ void catchsigs(bool ignore){ -#if ! defined NDB_SOFTOSE && !defined NDB_OSE +#if !defined NDB_WIN32 && !defined NDB_SOFTOSE && !defined NDB_OSE static const int signals_shutdown[] = { #ifdef SIGBREAK @@ -318,7 +324,6 @@ catchsigs(bool ignore){ SIGTRAP #endif }; -#endif static const int signals_ignore[] = { SIGPIPE @@ -331,6 +336,7 @@ catchsigs(bool ignore){ handler_register(signals_error[i], handler_error, ignore); for(i = 0; i < sizeof(signals_ignore)/sizeof(signals_ignore[0]); i++) handler_register(signals_ignore[i], SIG_IGN, ignore); +#endif } extern "C" @@ -349,8 +355,10 @@ handler_error(int signum){ if (thread_id != 0 && thread_id == my_thread_id()) { // Shutdown thread received signal - signal(signum, SIG_DFL); +#ifndef NDB_WIN32 + signal(signum, SIG_DFL); kill(getpid(), signum); +#endif while(true) NdbSleep_MilliSleep(10); } diff --git a/ndb/src/kernel/vm/Configuration.cpp b/ndb/src/kernel/vm/Configuration.cpp index 795670a1322..05a5aaf1c76 100644 --- a/ndb/src/kernel/vm/Configuration.cpp +++ b/ndb/src/kernel/vm/Configuration.cpp @@ -278,13 +278,13 @@ static char * get_and_validate_path(ndb_mgm_configuration_iterator &iter, memset(buf2, 0,sizeof(buf2)); #ifdef NDB_WIN32 char* szFilePart; - if(!GetFullPathName(path, sizeof(buf2), buf2, &szFilePart) - || (::GetFileAttributes(alloc_path)&FILE_ATTRIBUTE_READONLY)) + if(!GetFullPathName(path, sizeof(buf2), buf2, &szFilePart) || + (GetFileAttributes(buf2) & FILE_ATTRIBUTE_READONLY)); #else - if((::realpath(path, buf2) == NULL)|| + if((::realpath(path, buf2) == NULL)|| (::access(buf2, W_OK) != 0)) #endif - { + { ERROR_SET(fatal, AFS_ERROR_INVALIDPATH, path, " Filename::init()"); } diff --git a/ndb/src/kernel/vm/Emulator.cpp b/ndb/src/kernel/vm/Emulator.cpp index a5897cd4064..adf3c438945 100644 --- a/ndb/src/kernel/vm/Emulator.cpp +++ b/ndb/src/kernel/vm/Emulator.cpp @@ -179,12 +179,14 @@ NdbShutdown(NdbShutdownType type, exit(-1); #endif } - + +#ifndef NDB_WIN32 if (simulate_error_during_shutdown) { kill(getpid(), simulate_error_during_shutdown); while(true) NdbSleep_MilliSleep(10); } +#endif globalEmulatorData.theWatchDog->doStop(); diff --git a/ndb/src/mgmsrv/CommandInterpreter.cpp b/ndb/src/mgmsrv/CommandInterpreter.cpp index 2a054a01f1e..c6ea9f662bb 100644 --- a/ndb/src/mgmsrv/CommandInterpreter.cpp +++ b/ndb/src/mgmsrv/CommandInterpreter.cpp @@ -28,7 +28,7 @@ #include "ConfigInfo.hpp" #include - +#include static const char* helpTexts[] = { "HELP Print help text", @@ -492,7 +492,7 @@ void CommandInterpreter::executeClusterLog(char* parameters) { noArgs = true; } while (item != NULL) { - snprintf(name, 12, item); + BaseString::snprintf(name, 12, item); if (strcmp(item, "ALL") == 0) { severity = 7; @@ -740,9 +740,10 @@ CommandInterpreter::executeDumpState(int processId, const char* parameters, char * tmpString = strdup(parameters); char * tmpPtr = 0; char * item = strtok_r(tmpString, " ", &tmpPtr); + int error; while(item != NULL){ - if (0x0 <= strtoll(item, NULL, 0) && strtoll(item, NULL, 0) <= 0xffffffff) { - pars[no] = strtoll(item, NULL, 0); + if (0x0 <= my_strtoll10(item, NULL, &error) && my_strtoll10(item, NULL, &error) <= 0xffffffff) { + pars[no] = my_strtoll10(item, NULL, &error); } else { ndbout << "Illegal value in argument to signal." << endl << "(Value must be between 0 and 0xffffffff.)" diff --git a/ndb/src/mgmsrv/main.cpp b/ndb/src/mgmsrv/main.cpp index 15767e4766d..5712ade8ea1 100644 --- a/ndb/src/mgmsrv/main.cpp +++ b/ndb/src/mgmsrv/main.cpp @@ -231,7 +231,7 @@ int main(int argc, char** argv) local_config, glob.cluster_config); - chdir(NdbConfig_get_path(0)); + my_setwd(NdbConfig_get_path(0), MYF(0)); glob.cluster_config = 0; glob.localNodeId= glob.mgmObject->getOwnNodeId(); @@ -294,7 +294,9 @@ int main(int argc, char** argv) } } +#ifndef NDB_WIN32 signal(SIGPIPE, SIG_IGN); +#endif { BaseString error_string; if(!glob.mgmObject->start(error_string)){ diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh index d9144ab3dce..62a9fb54b59 100644 --- a/scripts/make_win_src_distribution.sh +++ b/scripts/make_win_src_distribution.sh @@ -246,7 +246,7 @@ done # # Create project files for ndb # -make -C ndb windoze +make -C $SOURCE/ndb windoze # # Input directories to be copied recursively From 12fbc41f5f76b84cf6b7f174f0b9d27e187d104b Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 10 Nov 2004 15:07:55 +0100 Subject: [PATCH 0162/1063] Fix for BUG#6522 "Replication fails due to a rolled back transaction in the binlog" When we are writing a transaction to the binlog, we log BEGIN/COMMIT with zero error code. Example: all statements of trans succeeded, connection lost and so implicit rollback: we don't want ER_NET* errors to be logged in the BEGIN/ROLLBACK events, while statement events have 0. If there was really a serious error code, it's already in the statement events. sql/log.cc: When we write the cached binlog segment to disk binlog at COMMIT/ROLLBACK time: imagine this is rollback due to net timeout, after all statements of the transaction succeeded. Then we want a zero-error code in BEGIN. In other words, if there was a really serious error code it's already in the transaction's statement events. sql/sql_table.cc: out of date comment --- sql/log.cc | 9 +++++++++ sql/sql_table.cc | 1 - 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/sql/log.cc b/sql/log.cc index aa5d9d8753b..b2d015c1a14 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -1370,6 +1370,14 @@ bool MYSQL_LOG::write(THD *thd, IO_CACHE *cache, bool commit_or_rollback) */ { Query_log_event qinfo(thd, "BEGIN", 5, TRUE); + /* + Imagine this is rollback due to net timeout, after all statements of + the transaction succeeded. Then we want a zero-error code in BEGIN. + In other words, if there was a really serious error code it's already + in the statement's events. + This is safer than thd->clear_error() against kills at shutdown. + */ + qinfo.error_code= 0; /* Now this Query_log_event has artificial log_pos 0. It must be adjusted to reflect the real position in the log. Not doing it would confuse the @@ -1403,6 +1411,7 @@ bool MYSQL_LOG::write(THD *thd, IO_CACHE *cache, bool commit_or_rollback) commit_or_rollback ? "COMMIT" : "ROLLBACK", commit_or_rollback ? 6 : 8, TRUE); + qinfo.error_code= 0; qinfo.set_log_pos(this); if (qinfo.write(&log_file) || flush_io_cache(&log_file)) goto err; diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 65690e56039..1e5237b1428 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -911,7 +911,6 @@ TABLE *create_table_from_items(THD *thd, HA_CREATE_INFO *create_info, } table->file->extra(HA_EXTRA_WRITE_CACHE); DBUG_RETURN(table); - /* Note that leaving the function resets binlogging properties */ } From 97af0a0e8f3353cc849b33bf5b733764da7cb202 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 10 Nov 2004 15:07:11 +0000 Subject: [PATCH 0163/1063] Bug#6031 - To drop database you have to execute DROP DATABASE command twice. DROP DATABASE failed because of file ext not in TYPELIB of known extensions. General solution - construct a TYPELIB at runtime instead of a static list. mysql-test/r/ndb_basic.result: Bug#6031 New test for bug mysql-test/t/ndb_basic.test: Bug#6031 New test for bug sql/ha_ndbcluster.cc: Cosmetic fix sql/handler.cc: Bug#6031 New function - ha_known_exts() We can construct TYPELIB of known db file extensions. sql/handler.h: Bug#6031 New function - ha_known_exts() sql/sql_db.cc: Bug#6031 We use a constructed list of known extensions instead of a static list --- mysql-test/r/ndb_basic.result | 7 +++++ mysql-test/t/ndb_basic.test | 15 ++++++++++ sql/ha_ndbcluster.cc | 2 +- sql/handler.cc | 56 +++++++++++++++++++++++++++++++++++ sql/handler.h | 2 +- sql/sql_db.cc | 7 +---- 6 files changed, 81 insertions(+), 8 deletions(-) diff --git a/mysql-test/r/ndb_basic.result b/mysql-test/r/ndb_basic.result index ba8ee820ad9..6ec5338acbe 100644 --- a/mysql-test/r/ndb_basic.result +++ b/mysql-test/r/ndb_basic.result @@ -400,6 +400,13 @@ b attr1 9413 9412 drop table test.t1, t2; drop database mysqltest; +drop database if exists ndbtest1; +create database ndbtest1; +use ndbtest1; +create table t1(id int) engine=ndbcluster; +drop database ndbtest1; +drop database ndbtest1; +ERROR HY000: Can't drop database 'ndbtest1'; database doesn't exist use test; create table t1 (a int primary key, b char(0)); insert into t1 values (1,""); diff --git a/mysql-test/t/ndb_basic.test b/mysql-test/t/ndb_basic.test index b62d2a8e0e1..2671223ada8 100644 --- a/mysql-test/t/ndb_basic.test +++ b/mysql-test/t/ndb_basic.test @@ -360,6 +360,21 @@ select b,test.t1.attr1 from test.t1, t2 where test.t1.pk1 < a; drop table test.t1, t2; drop database mysqltest; +# +# BUG#6031 - DROP DATABASE doesn't drop database on first try +# + +--disable_warnings +drop database if exists ndbtest1; +--enable_warnings + +create database ndbtest1; +use ndbtest1; +create table t1(id int) engine=ndbcluster; +drop database ndbtest1; +--error 1008 +drop database ndbtest1; + # # test support of char(0) # diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 5971c1a6c2a..d9545d5cbb8 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -2777,7 +2777,7 @@ int ha_ndbcluster::reset() const char **ha_ndbcluster::bas_ext() const -{ static const char *ext[]= { ".ndb", NullS }; return ext; } +{ static const char *ext[]= { ha_ndb_ext, NullS }; return ext; } /* diff --git a/sql/handler.cc b/sql/handler.cc index f7a1a6ef0bf..2c274c7989e 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -109,6 +109,8 @@ const char *tx_isolation_names[] = TYPELIB tx_isolation_typelib= {array_elements(tx_isolation_names)-1,"", tx_isolation_names, NULL}; +static TYPELIB known_extensions= {0,"known_exts", NULL, NULL}; + enum db_type ha_resolve_by_name(const char *name, uint namelen) { THD *thd=current_thd; @@ -1633,3 +1635,57 @@ int handler::index_read_idx(byte * buf, uint index, const byte * key, return error; } +/* + Returns a list of all known extensions. + + SYNOPSIS + ha_known_exts() + + NOTES + No mutexes, worst case race is a minor surplus memory allocation + + RETURN VALUE + pointer pointer to TYPELIB structure +*/ +TYPELIB *ha_known_exts(void) +{ + if (!known_extensions.type_names) + { + show_table_type_st *types; + List found_exts; + List_iterator_fast it(found_exts); + const char *e, **ext; + + found_exts.push_back(".db"); + for (types= sys_table_types; types->type; types++) + { + if (*types->value == SHOW_OPTION_YES) + { + handler *file= get_new_handler(0,(enum db_type) types->db_type); + for (ext= file->bas_ext(); *ext; ext++) + { + while (e=it++) + if (e == *ext) + break; + + if (!e) + found_exts.push_back((char *)*ext); + + it.rewind(); + } + delete file; + } + } + ext= (const char **)my_once_alloc(sizeof(char *)* + (found_exts.elements+1), MYF(MY_WME)); + + DBUG_ASSERT(ext); + for (uint i=0; e=it++; i++) + ext[i]= e; + ext[found_exts.elements]= 0; + + known_extensions.count= found_exts.elements; + known_extensions.type_names= ext; + } + return &known_extensions; +} diff --git a/sql/handler.h b/sql/handler.h index a7ce4e708fd..54a416d80ad 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -567,5 +567,5 @@ int ha_discover(THD* thd, const char* dbname, const char* name, int ha_find_files(THD *thd,const char *db,const char *path, const char *wild, bool dir,List* files); int ha_table_exists(THD* thd, const char* db, const char* name); - +TYPELIB *ha_known_exts(void); diff --git a/sql/sql_db.cc b/sql/sql_db.cc index e50796f2a33..350a7432990 100644 --- a/sql/sql_db.cc +++ b/sql/sql_db.cc @@ -30,11 +30,6 @@ const char *del_exts[]= {".frm", ".BAK", ".TMD",".opt", NullS}; static TYPELIB deletable_extentions= {array_elements(del_exts)-1,"del_exts", del_exts, NULL}; -const char *known_exts[]= -{".ISM",".ISD",".ISM",".MRG",".MYI",".MYD",".db", ".ibd", NullS}; -static TYPELIB known_extentions= -{array_elements(known_exts)-1,"known_exts", known_exts, NULL}; - static long mysql_rm_known_files(THD *thd, MY_DIR *dirp, const char *db, const char *path, uint level); @@ -737,7 +732,7 @@ static long mysql_rm_known_files(THD *thd, MY_DIR *dirp, const char *db, extension= fn_ext(file->name); if (find_type(extension, &deletable_extentions,1+2) <= 0) { - if (find_type(extension, &known_extentions,1+2) <= 0) + if (find_type(extension, ha_known_exts(),1+2) <= 0) found_other_files++; continue; } From c3a066e4035a16a666e71a55f47c14c29649e580 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 10 Nov 2004 18:16:58 +0300 Subject: [PATCH 0164/1063] Fix for bug #6077: Problem with make test from 4.1.7 and bk portability fix(UnixWare) mysql-test/r/ps_1general.result: portability fix(UnixWare) mysql-test/t/key_cache.test: portability fix(UnixWare) mysql-test/t/ps_1general.test: portability fix(UnixWare) sql/field.cc: portability fix(UnixWare) --- mysql-test/r/ps_1general.result | 4 ++-- mysql-test/t/key_cache.test | 6 +++--- mysql-test/t/ps_1general.test | 4 ++-- sql/field.cc | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/mysql-test/r/ps_1general.result b/mysql-test/r/ps_1general.result index ccf2945d488..8cf03653b4d 100644 --- a/mysql-test/r/ps_1general.result +++ b/mysql-test/r/ps_1general.result @@ -272,11 +272,11 @@ t2 1 t2_idx 1 b A NULL NULL NULL YES BTREE prepare stmt4 from ' show table status from test like ''t2%'' '; execute stmt4; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment -t2 MyISAM 9 Fixed 0 0 0 64424509439 1024 0 NULL # # # latin1_swedish_ci NULL +t2 MyISAM 9 Fixed 0 0 # # # 0 NULL # # # latin1_swedish_ci NULL prepare stmt4 from ' show table status from test like ''t9%'' '; execute stmt4; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment -t9 MyISAM 9 Dynamic 2 220 440 4294967295 2048 0 NULL # # # latin1_swedish_ci NULL +t9 MyISAM 9 Dynamic 2 220 # # # 0 NULL # # # latin1_swedish_ci NULL prepare stmt4 from ' show status like ''Threads_running'' '; execute stmt4; Variable_name Value diff --git a/mysql-test/t/key_cache.test b/mysql-test/t/key_cache.test index 9d3125efa61..3b0dcfb9198 100644 --- a/mysql-test/t/key_cache.test +++ b/mysql-test/t/key_cache.test @@ -71,7 +71,7 @@ show status like 'key_blocks_used'; # Following results differs on 64 and 32 bit systems because of different # pointer sizes, which takes up different amount of space in key cache ---replace_result 1812 KEY_BLOCKS_UNUSED 1793 KEY_BLOCKS_UNUSED 1674 KEY_BLOCKS_UNUSED 1818 KEY_BLOCKS_UNUSED +--replace_result 1812 KEY_BLOCKS_UNUSED 1793 KEY_BLOCKS_UNUSED 1674 KEY_BLOCKS_UNUSED 1818 KEY_BLOCKS_UNUSED 1824 KEY_BLOCKS_UNUSED show status like 'key_blocks_unused'; insert into t1 values (1, 'qqqq'), (11, 'yyyy'); @@ -84,7 +84,7 @@ update t1 set p=2 where p=1; update t2 set i=2 where i=1; show status like 'key_blocks_used'; ---replace_result 1808 KEY_BLOCKS_UNUSED 1789 KEY_BLOCKS_UNUSED 1670 KEY_BLOCKS_UNUSED 1814 KEY_BLOCKS_UNUSED +--replace_result 1808 KEY_BLOCKS_UNUSED 1789 KEY_BLOCKS_UNUSED 1670 KEY_BLOCKS_UNUSED 1814 KEY_BLOCKS_UNUSED 1820 KEY_BLOCKS_UNUSED show status like 'key_blocks_unused'; cache index t1 key (`primary`) in keycache1; @@ -146,7 +146,7 @@ cache index t1,t2 in default; drop table t1,t2,t3; show status like 'key_blocks_used'; ---replace_result 1812 KEY_BLOCKS_UNUSED 1793 KEY_BLOCKS_UNUSED 1674 KEY_BLOCKS_UNUSED 1818 KEY_BLOCKS_UNUSED +--replace_result 1812 KEY_BLOCKS_UNUSED 1793 KEY_BLOCKS_UNUSED 1674 KEY_BLOCKS_UNUSED 1818 KEY_BLOCKS_UNUSED 1824 KEY_BLOCKS_UNUSED show status like 'key_blocks_unused'; # Cleanup diff --git a/mysql-test/t/ps_1general.test b/mysql-test/t/ps_1general.test index 9e4acc2bf24..dd1036f683d 100644 --- a/mysql-test/t/ps_1general.test +++ b/mysql-test/t/ps_1general.test @@ -289,13 +289,13 @@ prepare stmt4 from ' show index from t2 from test '; execute stmt4; prepare stmt4 from ' show table status from test like ''t2%'' '; # egalize date and time values ---replace_column 12 # 13 # 14 # +--replace_column 7 # 8 # 9 # 12 # 13 # 14 # # Bug#4288 : prepared statement 'show table status ..', wrong output on execute execute stmt4; # try the same with the big table prepare stmt4 from ' show table status from test like ''t9%'' '; # egalize date and time values ---replace_column 12 # 13 # 14 # +--replace_column 7 # 8 # 9 # 12 # 13 # 14 # # Bug#4288 execute stmt4; prepare stmt4 from ' show status like ''Threads_running'' '; diff --git a/sql/field.cc b/sql/field.cc index deb38048d42..569d11eb758 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -2145,7 +2145,7 @@ int Field_longlong::store(double nr) set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } - else if (nr >= (double) LONGLONG_MAX) + else if (nr >= (double) (ulonglong) LONGLONG_MAX) { res=(longlong) LONGLONG_MAX; set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); From b6ed85ba5a884145723058344571b682de3f4c9e Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 10 Nov 2004 16:05:28 +0000 Subject: [PATCH 0165/1063] added configure switch for ndb port number added new variable for ndb port 1186 changed meaning of ndb_port_base to be default tcp port setting changed to use split between port and port_base for ndbcluster so that ndb_port and ndb_port_base are propagated to startscript for ndbcluster added larger space to pid print moved readAndExecute out of CommandInterpreter to avoid linking lib with readline added c-api to Ndb_mgmclient pass also ndb_port to make acinclude.m4: added configure switch for ndb port number configure.in: added new variable for ndb port 1186 changed meaning of ndb_port_base to be default tcp port setting mysql-test/mysql-test-run.sh: changed to use split between port and port_base for ndbcluster mysql-test/ndb/Makefile.am: so that ndb_port and ndb_port_base are propagated to startscript for ndbcluster mysql-test/ndb/ndbcluster.sh: so that ndb_port and ndb_port_base are propagated to startscript for ndbcluster ndb/src/common/mgmcommon/LocalConfig.cpp: so that ndb_port and ndb_port_base are propagated to startscript for ndbcluster ndb/src/common/mgmcommon/Makefile.am: so that ndb_port and ndb_port_base are propagated to startscript for ndbcluster ndb/src/common/mgmcommon/NdbConfig.c: added larger space to pid print ndb/src/mgmclient/CommandInterpreter.cpp: moved readAndExecute out of CommandInterpreter to avoid linking lib with readline added c-api to Ndb_mgmclient ndb/src/mgmclient/main.cpp: moved readAndExecute out of CommandInterpreter to avoid linking lib with readline ndb/src/mgmclient/ndb_mgmclient.hpp: moved readAndExecute out of CommandInterpreter to avoid linking lib with readline ndb/src/mgmsrv/ConfigInfo.cpp: moved readAndExecute out of CommandInterpreter to avoid linking lib with readline ndb/src/mgmsrv/Makefile.am: pass also ndb_port to make --- acinclude.m4 | 7 ++- configure.in | 8 ++- mysql-test/mysql-test-run.sh | 11 ++-- mysql-test/ndb/Makefile.am | 2 + mysql-test/ndb/ndbcluster.sh | 16 ++--- ndb/src/common/mgmcommon/LocalConfig.cpp | 6 +- ndb/src/common/mgmcommon/Makefile.am | 2 +- ndb/src/common/mgmcommon/NdbConfig.c | 2 +- ndb/src/mgmclient/CommandInterpreter.cpp | 76 ++++++++---------------- ndb/src/mgmclient/main.cpp | 46 +++++++++++++- ndb/src/mgmclient/ndb_mgmclient.h | 33 ++++++++++ ndb/src/mgmclient/ndb_mgmclient.hpp | 8 +-- ndb/src/mgmsrv/ConfigInfo.cpp | 8 +-- ndb/src/mgmsrv/Makefile.am | 1 + 14 files changed, 148 insertions(+), 78 deletions(-) create mode 100644 ndb/src/mgmclient/ndb_mgmclient.h diff --git a/acinclude.m4 b/acinclude.m4 index 671e279a9f3..448bf7a2653 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -1614,9 +1614,14 @@ AC_DEFUN([MYSQL_CHECK_NDB_OPTIONS], [ --with-ndb-docs Include the NDB Cluster ndbapi and mgmapi documentation], [ndb_docs="$withval"], [ndb_docs=no]) + AC_ARG_WITH([ndb-port], + [ + --with-ndb-port Port for NDB Cluster management server], + [ndb_port="$withval"], + [ndb_port="default"]) AC_ARG_WITH([ndb-port-base], [ - --with-ndb-port-base Base port for NDB Cluster], + --with-ndb-port-base Base port for NDB Cluster transporters], [ndb_port_base="$withval"], [ndb_port_base="default"]) diff --git a/configure.in b/configure.in index cd2daf10690..764261c6933 100644 --- a/configure.in +++ b/configure.in @@ -3052,9 +3052,15 @@ AC_SUBST([NDB_DEFS]) AC_SUBST([ndb_cxxflags_fix]) +if test X"$ndb_port" = Xdefault +then + ndb_port="1186" +fi +AC_SUBST([ndb_port]) + if test X"$ndb_port_base" = Xdefault then - ndb_port_base="2200" + ndb_port_base="2202" fi AC_SUBST([ndb_port_base]) diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index 65be9bf9c8e..fcb9e5eee2d 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -457,6 +457,9 @@ SMALL_SERVER="--key_buffer_size=1M --sort_buffer=256K --max_heap_table_size=1M" export MASTER_MYPORT MASTER_MYPORT1 SLAVE_MYPORT MYSQL_TCP_PORT MASTER_MYSOCK MASTER_MYSOCK1 +NDBCLUSTER_BASE_PORT=`expr $NDBCLUSTER_PORT + 2` +NDBCLUSTER_OPTS="--port=$NDBCLUSTER_PORT --port-base=$NDBCLUSTER_BASE_PORT --data-dir=$MYSQL_TEST_DIR/var" + if [ x$SOURCE_DIST = x1 ] ; then MY_BASEDIR=$MYSQL_TEST_DIR else @@ -939,11 +942,11 @@ start_ndbcluster() echo "Starting ndbcluster" if [ "$DO_BENCH" = 1 ] then - NDBCLUSTER_OPTS="" + NDBCLUSTER_EXTRA_OPTS="" else - NDBCLUSTER_OPTS="--small" + NDBCLUSTER_EXTRA_OPTS="--small" fi - ./ndb/ndbcluster --port-base=$NDBCLUSTER_PORT $NDBCLUSTER_OPTS --diskless --initial --data-dir=$MYSQL_TEST_DIR/var || exit 1 + ./ndb/ndbcluster $NDBCLUSTER_OPTS $NDBCLUSTER_EXTRA_OPTS --diskless --initial || exit 1 NDB_CONNECTSTRING="host=localhost:$NDBCLUSTER_PORT" else NDB_CONNECTSTRING="$USE_RUNNING_NDBCLUSTER" @@ -961,7 +964,7 @@ stop_ndbcluster() if [ -z "$USE_RUNNING_NDBCLUSTER" ] then # Kill any running ndbcluster stuff - ./ndb/ndbcluster --data-dir=$MYSQL_TEST_DIR/var --port-base=$NDBCLUSTER_PORT --stop + ./ndb/ndbcluster $NDBCLUSTER_OPTS --stop fi fi } diff --git a/mysql-test/ndb/Makefile.am b/mysql-test/ndb/Makefile.am index 3ed222344a6..502ccee099e 100644 --- a/mysql-test/ndb/Makefile.am +++ b/mysql-test/ndb/Makefile.am @@ -13,6 +13,8 @@ SUFFIXES = .sh .sh: @RM@ -f $@ $@-t @SED@ \ + -e 's!@''ndb_port''@!$(ndb_port)!g' \ + -e 's!@''ndb_port_base''@!$(ndb_port_base)!g' \ -e 's!@''ndbbindir''@!$(ndbbindir)!g' \ -e 's!@''ndbtoolsdir''@!$(ndbtoolsdir)!g' \ $< > $@-t diff --git a/mysql-test/ndb/ndbcluster.sh b/mysql-test/ndb/ndbcluster.sh index f5757a11056..3486a879eec 100644 --- a/mysql-test/ndb/ndbcluster.sh +++ b/mysql-test/ndb/ndbcluster.sh @@ -5,7 +5,8 @@ # This scripts starts the table handler ndbcluster # configurable parameters, make sure to change in mysqlcluterd as well -port_base="2200" +port=@ndb_port@ +port_base=@ndb_port_base@ fsdir=`pwd` # end configurable parameters @@ -84,6 +85,9 @@ while test $# -gt 0; do --data-dir=*) fsdir=`echo "$1" | sed -e "s;--data-dir=;;"` ;; + --port=*) + port=`echo "$1" | sed -e "s;--port=;;"` + ;; --port-base=*) port_base=`echo "$1" | sed -e "s;--port-base=;;"` ;; @@ -94,7 +98,7 @@ while test $# -gt 0; do shift done -fs_ndb="$fsdir/ndbcluster-$port_base" +fs_ndb="$fsdir/ndbcluster-$port" NDB_HOME= if [ ! -x "$fsdir" ]; then @@ -120,7 +124,7 @@ exec_ndb="$exec_ndb --no-defaults" exec_waiter="$exec_waiter --no-defaults" ndb_host="localhost" -ndb_mgmd_port=$port_base +ndb_mgmd_port=$port NDB_CONNECTSTRING="host=$ndb_host:$ndb_mgmd_port" export NDB_CONNECTSTRING @@ -158,10 +162,6 @@ if [ -d "$fs_ndb" ]; then :; else exit 1 fi -# set som help variables - -port_transporter=`expr $ndb_mgmd_port + 2` - # Start management server as deamon # Edit file system path and ports in config file @@ -176,7 +176,7 @@ sed \ -e s,"CHOOSE_HOSTNAME_".*,"$ndb_host",g \ -e s,"CHOOSE_FILESYSTEM","$fs_ndb",g \ -e s,"CHOOSE_PORT_MGM","$ndb_mgmd_port",g \ - -e s,"CHOOSE_PORT_TRANSPORTER","$port_transporter",g \ + -e s,"CHOOSE_PORT_TRANSPORTER","$port_base",g \ < ndb/ndb_config_2_node.ini \ > "$fs_ndb/config.ini" fi diff --git a/ndb/src/common/mgmcommon/LocalConfig.cpp b/ndb/src/common/mgmcommon/LocalConfig.cpp index 3cd4341c6b7..679de716be0 100644 --- a/ndb/src/common/mgmcommon/LocalConfig.cpp +++ b/ndb/src/common/mgmcommon/LocalConfig.cpp @@ -90,7 +90,7 @@ LocalConfig::init(const char *connectString, //7. Check { char buf[256]; - BaseString::snprintf(buf, sizeof(buf), "host=localhost:%s", NDB_BASE_PORT); + BaseString::snprintf(buf, sizeof(buf), "host=localhost:%s", NDB_PORT); if(readConnectString(buf, "default connect string")) return true; } @@ -124,12 +124,12 @@ void LocalConfig::printUsage() const { ndbout << "1. Put a Ndb.cfg file in the directory where you start"<export NDB_CONNECTSTRING=\"host=localhost:"<export NDB_CONNECTSTRING=\"host=localhost:"< 0) snprintf(tmp_buf, sizeof(tmp_buf), "ndb_%u", node_id); diff --git a/ndb/src/mgmclient/CommandInterpreter.cpp b/ndb/src/mgmclient/CommandInterpreter.cpp index 523c271ed9e..f1a953769b8 100644 --- a/ndb/src/mgmclient/CommandInterpreter.cpp +++ b/ndb/src/mgmclient/CommandInterpreter.cpp @@ -17,17 +17,6 @@ #include #include -// copied from mysql.cc to get readline -extern "C" { -#if defined( __WIN__) || defined(OS2) -#include -#elif !defined(__NETWARE__) -#include -extern "C" int add_history(const char *command); /* From readline directory */ -#define HAVE_READLINE -#endif -} - //#define HAVE_GLOBAL_REPLICATION #include @@ -65,7 +54,6 @@ public: * * @return true until quit/bye/exit has been typed */ - int readAndExecute(int _try_reconnect=-1); int execute(const char *_line, int _try_reconnect=-1); private: @@ -180,6 +168,7 @@ private: */ #include "ndb_mgmclient.hpp" +#include "ndb_mgmclient.h" Ndb_mgmclient::Ndb_mgmclient(const char *host) { @@ -189,10 +178,6 @@ Ndb_mgmclient::~Ndb_mgmclient() { delete m_cmd; } -int Ndb_mgmclient::read_and_execute(int _try_reconnect) -{ - return m_cmd->readAndExecute(_try_reconnect); -} int Ndb_mgmclient::execute(const char *_line, int _try_reconnect) { return m_cmd->execute(_line,_try_reconnect); @@ -203,7 +188,20 @@ Ndb_mgmclient::disconnect() return m_cmd->disconnect(); } - +extern "C" { + Ndb_mgmclient_handle ndb_mgmclient_handle_create(const char *connect_string) + { + return (Ndb_mgmclient_handle) new Ndb_mgmclient(connect_string); + } + int ndb_mgmclient_execute(Ndb_mgmclient_handle h, int argc, const char** argv) + { + return ((Ndb_mgmclient*)h)->execute(argc, argv, 1); + } + int ndb_mgmclient_handle_destroy(Ndb_mgmclient_handle h) + { + delete (Ndb_mgmclient*)h; + } +} /* * The CommandInterpreter */ @@ -227,6 +225,17 @@ Ndb_mgmclient::disconnect() #include #include +int Ndb_mgmclient::execute(int argc, const char** argv, int _try_reconnect) +{ + if (argc <= 0) + return 0; + BaseString _line(argv[0]); + for (int i= 1; i < argc; i++) + { + _line.appfmt(" %s", argv[i]); + } + return m_cmd->execute(_line.c_str(),_try_reconnect); +} /***************************************************************************** * HELP @@ -456,39 +465,6 @@ CommandInterpreter::disconnect() //***************************************************************************** //***************************************************************************** -int -CommandInterpreter::readAndExecute(int _try_reconnect) -{ - static char *line_read = (char *)NULL; - - /* If the buffer has already been allocated, return the memory - to the free pool. */ - if (line_read) - { - free (line_read); - line_read = (char *)NULL; - } -#ifdef HAVE_READLINE - /* Get a line from the user. */ - line_read = readline ("ndb_mgm> "); - /* If the line has any text in it, save it on the history. */ - if (line_read && *line_read) - add_history (line_read); -#else - static char linebuffer[254]; - fputs("ndb_mgm> ", stdout); - linebuffer[sizeof(linebuffer)-1]=0; - line_read = fgets(linebuffer, sizeof(linebuffer)-1, stdin); - if (line_read == linebuffer) { - char *q=linebuffer; - while (*q > 31) q++; - *q=0; - line_read= strdup(linebuffer); - } -#endif - return execute(line_read,_try_reconnect); -} - int CommandInterpreter::execute(const char *_line, int _try_reconnect) { diff --git a/ndb/src/mgmclient/main.cpp b/ndb/src/mgmclient/main.cpp index 3415ede1985..8f5d9e6656c 100644 --- a/ndb/src/mgmclient/main.cpp +++ b/ndb/src/mgmclient/main.cpp @@ -17,6 +17,17 @@ #include #include +// copied from mysql.cc to get readline +extern "C" { +#if defined( __WIN__) || defined(OS2) +#include +#elif !defined(__NETWARE__) +#include +extern "C" int add_history(const char *command); /* From readline directory */ +#define HAVE_READLINE +#endif +} + #include #include #include @@ -90,6 +101,39 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), return 0; } +static int +read_and_execute(int _try_reconnect) +{ + static char *line_read = (char *)NULL; + + /* If the buffer has already been allocated, return the memory + to the free pool. */ + if (line_read) + { + free (line_read); + line_read = (char *)NULL; + } +#ifdef HAVE_READLINE + /* Get a line from the user. */ + line_read = readline ("ndb_mgm> "); + /* If the line has any text in it, save it on the history. */ + if (line_read && *line_read) + add_history (line_read); +#else + static char linebuffer[254]; + fputs("ndb_mgm> ", stdout); + linebuffer[sizeof(linebuffer)-1]=0; + line_read = fgets(linebuffer, sizeof(linebuffer)-1, stdin); + if (line_read == linebuffer) { + char *q=linebuffer; + while (*q > 31) q++; + *q=0; + line_read= strdup(linebuffer); + } +#endif + return com->execute(line_read,_try_reconnect); +} + int main(int argc, char** argv){ NDB_INIT(argv[0]); const char *_host = 0; @@ -128,7 +172,7 @@ int main(int argc, char** argv){ signal(SIGPIPE, handler); com = new Ndb_mgmclient(buf); - while(com->read_and_execute(_try_reconnect)); + while(read_and_execute(_try_reconnect)); delete com; return 0; diff --git a/ndb/src/mgmclient/ndb_mgmclient.h b/ndb/src/mgmclient/ndb_mgmclient.h new file mode 100644 index 00000000000..265e6bc67ec --- /dev/null +++ b/ndb/src/mgmclient/ndb_mgmclient.h @@ -0,0 +1,33 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef Ndb_mgmclient_h +#define Ndb_mgmclient_h + +#ifdef __cplusplus +extern "C" { +#endif + +typedef void* Ndb_mgmclient_handle; +Ndb_mgmclient_handle ndb_mgmclient_handle_create(const char *connect_string); +int ndb_mgmclient_execute(Ndb_mgmclient_handle, int argc, const char** argv); +int ndb_mgmclient_handle_destroy(Ndb_mgmclient_handle); + +#ifdef __cplusplus +} +#endif + +#endif /* Ndb_mgmclient_h */ diff --git a/ndb/src/mgmclient/ndb_mgmclient.hpp b/ndb/src/mgmclient/ndb_mgmclient.hpp index 2f021a0f2b6..933d1bab5ce 100644 --- a/ndb/src/mgmclient/ndb_mgmclient.hpp +++ b/ndb/src/mgmclient/ndb_mgmclient.hpp @@ -14,8 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef Ndb_mgmclient_h -#define Ndb_mgmclient_h +#ifndef Ndb_mgmclient_hpp +#define Ndb_mgmclient_hpp class CommandInterpreter; class Ndb_mgmclient @@ -23,11 +23,11 @@ class Ndb_mgmclient public: Ndb_mgmclient(const char*); ~Ndb_mgmclient(); - int read_and_execute(int _try_reconnect=-1); int execute(const char *_line, int _try_reconnect=-1); + int execute(int argc, const char** argv, int _try_reconnect=-1); int disconnect(); private: CommandInterpreter *m_cmd; }; -#endif // Ndb_mgmclient_h +#endif // Ndb_mgmclient_hpp diff --git a/ndb/src/mgmsrv/ConfigInfo.cpp b/ndb/src/mgmsrv/ConfigInfo.cpp index ad346b30ead..4af1556a0c0 100644 --- a/ndb/src/mgmsrv/ConfigInfo.cpp +++ b/ndb/src/mgmsrv/ConfigInfo.cpp @@ -1478,7 +1478,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ConfigInfo::USED, false, ConfigInfo::INT, - NDB_BASE_PORT, + NDB_PORT, "0", STR_VALUE(MAX_INT_RNIL) }, @@ -1490,7 +1490,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ConfigInfo::USED, false, ConfigInfo::INT, - "2199", + UNDEFINED, "0", STR_VALUE(MAX_INT_RNIL) }, @@ -3010,7 +3010,7 @@ fixPortNumber(InitConfigFileParser::Context & ctx, const char * data){ if(!(ctx.m_userDefaults && ctx.m_userDefaults->get("PortNumber", &base)) && !ctx.m_systemDefaults->get("PortNumber", &base)) { - base= strtoll(NDB_BASE_PORT,0,0)+2; + base= strtoll(NDB_BASE_PORT,0,0); // ctx.reportError("Cannot retrieve base port number"); // return false; } @@ -3442,7 +3442,7 @@ static bool add_server_ports(Vector§ions, #if 0 Properties * props= ctx.m_config; Properties computers(true); - Uint32 port_base = NDB_BASE_PORT+2; + Uint32 port_base = NDB_BASE_PORT; Uint32 nNodes; ctx.m_userProperties.get("NoOfNodes", &nNodes); diff --git a/ndb/src/mgmsrv/Makefile.am b/ndb/src/mgmsrv/Makefile.am index 4cb164d48fe..ee5220ef9f8 100644 --- a/ndb/src/mgmsrv/Makefile.am +++ b/ndb/src/mgmsrv/Makefile.am @@ -33,6 +33,7 @@ DEFS_LOC = -DDEFAULT_MYSQL_HOME="\"$(MYSQLBASEdir)\"" \ -DDATADIR="\"$(MYSQLDATAdir)\"" \ -DSHAREDIR="\"$(MYSQLSHAREdir)\"" \ -DMYSQLCLUSTERDIR="\"$(MYSQLCLUSTERdir)\"" \ + -DNDB_PORT="\"@ndb_port@\"" \ -DNDB_BASE_PORT="\"@ndb_port_base@\"" include $(top_srcdir)/ndb/config/common.mk.am From 69bce9c68d2dd38bc4cb58b19fbf609aca11e5dd Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 10 Nov 2004 18:07:39 +0200 Subject: [PATCH 0166/1063] More debugging Print position in normal log for Binlog dump dbug/dbug.c: Added DBUG_OUTPUT() to temporary start/stop trace-file output Optimized alignment of CODE_STATE structure include/my_dbug.h: Added DBUG_OUTPUT() to temporary start/stop trace-file output sql/field.cc: Safety fix when used with future 5.0 .frm tables sql/log.cc: More debugging sql/mysqld.cc: Fixed type sql/slave.cc: Fixed wrong cast (not a bug) sql/sql_class.h: More DBUG output sql/sql_parse.cc: Print position in normal log for Binlog dump --- dbug/dbug.c | 56 ++++++++++++++++++++++++++++++++++------------- include/my_dbug.h | 3 +++ sql/field.cc | 10 +++++++-- sql/log.cc | 32 +++++++++++++++++++-------- sql/mysqld.cc | 2 +- sql/slave.cc | 2 +- sql/sql_class.h | 2 +- sql/sql_parse.cc | 11 ++++++---- 8 files changed, 85 insertions(+), 33 deletions(-) diff --git a/dbug/dbug.c b/dbug/dbug.c index 1796d883c5e..02175f8b091 100644 --- a/dbug/dbug.c +++ b/dbug/dbug.c @@ -227,14 +227,15 @@ static my_bool init_done = FALSE; /* Set to TRUE when initialization done */ static struct state *stack=0; typedef struct st_code_state { - int lineno; /* Current debugger output line number */ - int level; /* Current function nesting level */ const char *func; /* Name of current user function */ const char *file; /* Name of current user file */ char **framep; /* Pointer to current frame */ - int jmplevel; /* Remember nesting level at setjmp () */ const char *jmpfunc; /* Remember current function for setjmp */ const char *jmpfile; /* Remember current file for setjmp */ + int lineno; /* Current debugger output line number */ + int level; /* Current function nesting level */ + int disable_output; /* Set to it if output is disabled */ + int jmplevel; /* Remember nesting level at setjmp () */ /* * The following variables are used to hold the state information @@ -247,8 +248,8 @@ typedef struct st_code_state { */ uint u_line; /* User source code line number */ - const char *u_keyword; /* Keyword for current macro */ int locked; /* If locked with _db_lock_file */ + const char *u_keyword; /* Keyword for current macro */ } CODE_STATE; /* Parse a debug command string */ @@ -370,8 +371,10 @@ static CODE_STATE *code_state(void) #define code_state() (&static_code_state) #define pthread_mutex_lock(A) {} #define pthread_mutex_unlock(A) {} -static CODE_STATE static_code_state = { 0,0,"?func","?file",NULL,0,NULL, - NULL,0,"?",0}; +static CODE_STATE static_code_state= +{ + "?func", "?file", NULL, NullS, NullS, 0,0,0,0,0,0, NullS +}; #endif @@ -728,9 +731,12 @@ char ***_sframep_ __attribute__((unused))) if (DoProfile ()) { long stackused; - if (*state->framep == NULL) { + if (*state->framep == NULL) + { stackused = 0; - } else { + } + else + { stackused = ((long)(*state->framep)) - ((long)(state->framep)); stackused = stackused > 0 ? stackused : -stackused; } @@ -744,7 +750,7 @@ char ***_sframep_ __attribute__((unused))) (void) fflush (_db_pfp_); } #endif - if (DoTrace (state)) + if (DoTrace(state)) { if (!state->locked) pthread_mutex_lock(&THR_LOCK_dbug); @@ -754,7 +760,7 @@ char ***_sframep_ __attribute__((unused))) dbug_flush (state); /* This does a unlock */ } #ifdef SAFEMALLOC - if (stack -> flags & SANITY_CHECK_ON) + if (stack->flags & SANITY_CHECK_ON && !state->disable_output) if (_sanity(_file_,_line_)) /* Check of safemalloc */ stack -> flags &= ~SANITY_CHECK_ON; #endif @@ -809,9 +815,11 @@ uint *_slevel_) else { #ifdef SAFEMALLOC - if (stack -> flags & SANITY_CHECK_ON) + if (stack->flags & SANITY_CHECK_ON && !state->disable_output) + { if (_sanity(*_sfile_,_line_)) stack->flags &= ~SANITY_CHECK_ON; + } #endif #ifndef THREAD if (DoProfile ()) @@ -954,7 +962,6 @@ uint length) int pos; char dbuff[90]; CODE_STATE *state; - /* Sasha: pre-my_thread_init() safety */ if (!(state=code_state())) return; @@ -994,6 +1001,25 @@ uint length) } } + +/* + Enable/Disable output for this thread + + SYNOPSIS + _db_output_() + flag 1 = enable output, 0 = disable_output + +*/ + +void _db_output_(uint flag) +{ + CODE_STATE *state; + if (!(state=code_state())) + return; + state->disable_output= !flag; +} + + /* * FUNCTION * @@ -1159,7 +1185,7 @@ static BOOLEAN DoTrace (CODE_STATE *state) { reg2 BOOLEAN trace=FALSE; - if (TRACING && + if (TRACING && !state->disable_output && state->level <= stack -> maxdepth && InList (stack -> functions, state->func) && InList (stack -> processes, _db_process_)) @@ -1195,7 +1221,7 @@ static BOOLEAN DoProfile () state=code_state(); profile = FALSE; - if (PROFILING && + if (PROFILING && !state->disable_output && state->level <= stack -> maxdepth && InList (stack -> p_functions, state->func) && InList (stack -> processes, _db_process_)) @@ -1242,7 +1268,7 @@ const char *keyword) if (!(state=code_state())) return FALSE; result = FALSE; - if (DEBUGGING && + if (DEBUGGING && !state->disable_output && state->level <= stack -> maxdepth && InList (stack -> functions, state->func) && InList (stack -> keywords, keyword) && diff --git a/include/my_dbug.h b/include/my_dbug.h index 9174a8b1ef9..711ece4335c 100644 --- a/include/my_dbug.h +++ b/include/my_dbug.h @@ -38,6 +38,7 @@ extern void _db_pargs_(uint _line_,const char *keyword); extern void _db_doprnt_ _VARARGS((const char *format,...)); extern void _db_dump_(uint _line_,const char *keyword,const char *memory, uint length); +extern void _db_output_(); extern void _db_lock_file(); extern void _db_unlock_file(); @@ -66,6 +67,7 @@ extern void _db_unlock_file(); #define DEBUGGER_ON _no_db_=0 #define DBUG_LOCK_FILE { _db_lock_file(); } #define DBUG_UNLOCK_FILE { _db_unlock_file(); } +#define DBUG_OUTPUT(A) { _db_output_(A); } #define DBUG_ASSERT(A) assert(A) #else /* No debugger */ @@ -86,6 +88,7 @@ extern void _db_unlock_file(); #define DEBUGGER_ON #define DBUG_LOCK_FILE #define DBUG_UNLOCK_FILE +#define DBUG_OUTPUT(A) #define DBUG_ASSERT(A) {} #endif #ifdef __cplusplus diff --git a/sql/field.cc b/sql/field.cc index deb38048d42..f70a23e889a 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -5941,8 +5941,14 @@ Field *make_field(char *ptr, uint32 field_length, if (f_is_alpha(pack_flag)) { if (!f_is_packed(pack_flag)) - return new Field_string(ptr,field_length,null_pos,null_bit, - unireg_check, field_name, table, field_charset); + { + if (field_type == FIELD_TYPE_STRING || + field_type == FIELD_TYPE_VAR_STRING) + return new Field_string(ptr,field_length,null_pos,null_bit, + unireg_check, field_name, table, + field_charset); + return 0; // Error + } uint pack_length=calc_pack_length((enum_field_types) f_packtype(pack_flag), diff --git a/sql/log.cc b/sql/log.cc index ef57a57d3b4..bcd99326501 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -1703,6 +1703,8 @@ bool MYSQL_LOG::write(THD *thd,const char *query, uint query_length, time_t current_time; if (!is_open()) return 0; + DBUG_ENTER("MYSQL_LOG::write"); + VOID(pthread_mutex_lock(&LOCK_log)); if (is_open()) { // Safety agains reopen @@ -1712,7 +1714,7 @@ bool MYSQL_LOG::write(THD *thd,const char *query, uint query_length, if (!(thd->options & OPTION_UPDATE_LOG)) { VOID(pthread_mutex_unlock(&LOCK_log)); - return 0; + DBUG_RETURN(0); } if (!(specialflag & SPECIAL_SHORT_LOG_FORMAT) || query_start_arg) { @@ -1812,7 +1814,7 @@ bool MYSQL_LOG::write(THD *thd,const char *query, uint query_length, } } VOID(pthread_mutex_unlock(&LOCK_log)); - return error; + DBUG_RETURN(error); } @@ -1832,16 +1834,19 @@ bool MYSQL_LOG::write(THD *thd,const char *query, uint query_length, THD::enter_cond() (see NOTES in sql_class.h). */ -void MYSQL_LOG:: wait_for_update(THD* thd, bool master_or_slave) +void MYSQL_LOG::wait_for_update(THD* thd, bool master_or_slave) { - const char* old_msg = thd->enter_cond(&update_cond, &LOCK_log, - master_or_slave ? - "Has read all relay log; waiting for \ -the slave I/O thread to update it" : - "Has sent all binlog to slave; \ -waiting for binlog to be updated"); + const char *old_msg; + DBUG_ENTER("wait_for_update"); + old_msg= thd->enter_cond(&update_cond, &LOCK_log, + master_or_slave ? + "Has read all relay log; waiting for the slave I/O " + "thread to update it" : + "Has sent all binlog to slave; waiting for binlog " + "to be updated"); pthread_cond_wait(&update_cond, &LOCK_log); thd->exit_cond(old_msg); + DBUG_VOID_RETURN; } @@ -2198,6 +2203,15 @@ void MYSQL_LOG::report_pos_in_innodb() DBUG_VOID_RETURN; } + +void MYSQL_LOG::signal_update() +{ + DBUG_ENTER("MYSQL_LOG::signal_update"); + pthread_cond_broadcast(&update_cond); + DBUG_VOID_RETURN; +} + + #ifdef __NT__ void print_buffer_to_nt_eventlog(enum loglevel level, char *buff, uint length, int buffLen) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 078ee19fe6a..5622ac50a7b 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -540,7 +540,7 @@ static void close_connections(void) struct timespec abstime; int error; LINT_INIT(error); - DBUG_PRINT("info",("Waiting for select_thread")); + DBUG_PRINT("info",("Waiting for select thread")); #ifndef DONT_USE_THR_ALARM if (pthread_kill(select_thread,THR_CLIENT_ALARM)) diff --git a/sql/slave.cc b/sql/slave.cc index 4ef8715f1e6..ea1f3cceaf4 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -2632,7 +2632,7 @@ static int request_dump(MYSQL* mysql, MASTER_INFO* mi, DBUG_ENTER("request_dump"); // TODO if big log files: Change next to int8store() - int4store(buf, (longlong) mi->master_log_pos); + int4store(buf, (ulong) mi->master_log_pos); int2store(buf + 4, binlog_flags); int4store(buf + 6, server_id); len = (uint) strlen(logname); diff --git a/sql/sql_class.h b/sql/sql_class.h index df6be559df2..312d9de9794 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -131,7 +131,7 @@ public: DBUG_VOID_RETURN; } void set_max_size(ulong max_size_arg); - void signal_update() { pthread_cond_broadcast(&update_cond);} + void signal_update(); void wait_for_update(THD* thd, bool master_or_slave); void set_need_start_event() { need_start_event = 1; } void init(enum_log_type log_type_arg, diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 2bf977804af..226ead71ada 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -1610,15 +1610,15 @@ bool dispatch_command(enum enum_server_command command, THD *thd, #ifndef EMBEDDED_LIBRARY case COM_BINLOG_DUMP: { + ulong pos; + ushort flags; + uint32 slave_server_id; + statistic_increment(com_other,&LOCK_status); thd->slow_command = TRUE; if (check_global_access(thd, REPL_SLAVE_ACL)) break; - mysql_log.write(thd,command, 0); - ulong pos; - ushort flags; - uint32 slave_server_id; /* TODO: The following has to be changed to an 8 byte integer */ pos = uint4korr(packet); flags = uint2korr(packet + 4); @@ -1626,6 +1626,9 @@ bool dispatch_command(enum enum_server_command command, THD *thd, if ((slave_server_id= uint4korr(packet+6))) // mysqlbinlog.server_id==0 kill_zombie_dump_threads(slave_server_id); thd->server_id = slave_server_id; + + mysql_log.write(thd, command, "Log: '%s' Pos: %ld", packet+10, + (long) pos); mysql_binlog_send(thd, thd->strdup(packet + 10), (my_off_t) pos, flags); unregister_slave(thd,1,1); // fake COM_QUIT -- if we get here, the thread needs to terminate From 313ce62f7036d1626f248bc8cbb197ffc4a9001c Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 10 Nov 2004 17:56:45 +0100 Subject: [PATCH 0167/1063] WL#1596 "make mysqldump --master-data --single-transaction able to do online dump of InnoDB AND report reliable binlog coordinates corresponding to the dump". The good news is that now mysqldump can be used to get an online backup of InnoDB *which works for point-in-time recovery and replication slave creation*. Formerly, mysqldump --master-data --single-transaction used to call in fact mysqldump --master-data, so the dump was not an online dump (took big lock all time of dump). The only lock which is now taken in this patch is at the beginning of the dump: mysqldump does: FLUSH TABLES WITH READ LOCK; START TRANSACTION WITH CONSISTENT SNAPSHOT; SHOW MASTER STATUS; UNLOCK TABLES; so the lock time is in fact the time FLUSH TABLES WITH READ LOCK takes to return (can be 0 or very long, if a table is undergoing a huge update). I have done some more minor changes listed in the paragraph of mysqldump.c. WL#2237 "WITH CONSISTENT SNAPSHOT clause for START TRANSACTION": it's a START TRANSACTION which additionally starts a consistent read on all capable storage engine (i.e. InnoDB). So, can serve as a replacement for BEGIN; SELECT * FROM some_innodb_table LIMIT 1; which starts a consistent read too. client/mysqldump.c: Main change: mysqldump --single-transaction --master-data is now able to, at the same time, take an online dump of InnoDB (using consistent read) AND get the binlog position corresponding to this dump (before, using the two options used to silently cancel --single-transaction). This uses the new START TRANSACTION WITH CONSISTENT SNAPSHOT syntax. Additional changes: a) cleanup: - DBerror calls exit() so some code was unneeded - no need to call COMMIT at end, leave disconnection do the job - mysql_query_with_error_report() b) requirements I had heard from colleagues: - --master-data now requires an argument, to comment out ("--") the CHANGE MASTER or not (commenting had been asked for point-in-time recovery when replication is not necessary). - --first-slave is renamed to --lock-all-tables c) more sensible behaviours (has been discussed internally): - if used with --master-data, --flush-logs is probably intended to get a flush synchronous with the dump, not one random flush per dumped db. - disabled automatic reconnection as, at least, SQL_MODE would be lost (and also, depending on options, LOCK TABLES, BEGIN, FLUSH TABLES WITH READ LOCK). include/mysqld_error.h: an error if START TRANSACTION WITH CONSISTENT SNAPSHOT is called and there is no consistent-read capable storage engine (idea ((C) PeterG) is that it's a bit like CREATE TABLE ENGINE=InnoDB when there is no support for InnoDB). sql/handler.cc: new ha_start_consistent_snapshot(), which, inside an existing transaction, starts a consistent read (offers an alternative to SELECTing any InnoDB table). Does something only for InnoDB. Warning if no suitable engine supported. sql/handler.h: declarations sql/lex.h: symbols for lex sql/share/czech/errmsg.txt: new message sql/share/danish/errmsg.txt: new message sql/share/dutch/errmsg.txt: new message sql/share/english/errmsg.txt: new message sql/share/estonian/errmsg.txt: new message sql/share/french/errmsg.txt: new message sql/share/german/errmsg.txt: new message sql/share/greek/errmsg.txt: new message sql/share/hungarian/errmsg.txt: new message sql/share/italian/errmsg.txt: new message sql/share/japanese/errmsg.txt: new message sql/share/korean/errmsg.txt: new message sql/share/norwegian-ny/errmsg.txt: new message sql/share/norwegian/errmsg.txt: new message sql/share/polish/errmsg.txt: new message sql/share/portuguese/errmsg.txt: new message sql/share/romanian/errmsg.txt: new message sql/share/russian/errmsg.txt: new message sql/share/serbian/errmsg.txt: new message sql/share/slovak/errmsg.txt: new message sql/share/spanish/errmsg.txt: new message sql/share/swedish/errmsg.txt: new message sql/share/ukrainian/errmsg.txt: new message sql/sql_lex.h: new option in lex (transaction options) sql/sql_parse.cc: warning comment (never make UNLOCK TABLES commit a transaction, please); support for starting consistent snapshot. sql/sql_yacc.yy: new clause WITH CONSISTENT SNAPSHOT (syntax ok'd by PeterG) for START TRANSACTION. --- client/mysqldump.c | 331 ++++++++++++++---------- include/mysqld_error.h | 3 +- mysql-test/r/consistent_snapshot.result | 15 ++ mysql-test/t/consistent_snapshot.test | 41 +++ sql/handler.cc | 18 ++ sql/handler.h | 5 +- sql/lex.h | 2 + sql/share/czech/errmsg.txt | 1 + sql/share/danish/errmsg.txt | 1 + sql/share/dutch/errmsg.txt | 1 + sql/share/english/errmsg.txt | 1 + sql/share/estonian/errmsg.txt | 1 + sql/share/french/errmsg.txt | 1 + sql/share/german/errmsg.txt | 1 + sql/share/greek/errmsg.txt | 1 + sql/share/hungarian/errmsg.txt | 1 + sql/share/italian/errmsg.txt | 1 + sql/share/japanese/errmsg.txt | 1 + sql/share/korean/errmsg.txt | 1 + sql/share/norwegian-ny/errmsg.txt | 1 + sql/share/norwegian/errmsg.txt | 1 + sql/share/polish/errmsg.txt | 1 + sql/share/portuguese/errmsg.txt | 1 + sql/share/romanian/errmsg.txt | 1 + sql/share/russian/errmsg.txt | 1 + sql/share/serbian/errmsg.txt | 1 + sql/share/slovak/errmsg.txt | 1 + sql/share/spanish/errmsg.txt | 1 + sql/share/swedish/errmsg.txt | 1 + sql/share/ukrainian/errmsg.txt | 1 + sql/sql_lex.h | 2 +- sql/sql_parse.cc | 10 +- sql/sql_yacc.yy | 21 +- 33 files changed, 328 insertions(+), 143 deletions(-) create mode 100644 mysql-test/r/consistent_snapshot.result create mode 100644 mysql-test/t/consistent_snapshot.test diff --git a/client/mysqldump.c b/client/mysqldump.c index 1686278096b..8ee30d39f01 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -37,7 +37,7 @@ ** 10 Jun 2003: SET NAMES and --no-set-names by Alexander Barkov */ -#define DUMP_VERSION "10.8" +#define DUMP_VERSION "10.9" #include #include @@ -78,8 +78,8 @@ static my_bool verbose=0,tFlag=0,cFlag=0,dFlag=0,quick= 1, extended_insert= 1, lock_tables=1,ignore_errors=0,flush_logs=0,replace=0, ignore=0,opt_drop=1,opt_keywords=0,opt_lock=1,opt_compress=0, opt_delayed=0,create_options=1,opt_quoted=0,opt_databases=0, - opt_alldbs=0,opt_create_db=0,opt_first_slave=0,opt_set_charset, - opt_autocommit=0,opt_master_data,opt_disable_keys=1,opt_xml=0, + opt_alldbs=0,opt_create_db=0,opt_lock_all_tables=0,opt_set_charset, + opt_autocommit=0,opt_disable_keys=1,opt_xml=0, opt_delete_master_logs=0, tty_password=0, opt_single_transaction=0, opt_comments= 0, opt_compact= 0, opt_hex_blob=0; @@ -93,7 +93,9 @@ static char insert_pat[12 * 1024],*opt_password=0,*current_user=0, *err_ptr= 0; static char compatible_mode_normal_str[255]; static ulong opt_compatible_mode= 0; -static uint opt_mysql_port= 0, err_len= 0; +#define MYSQL_OPT_MASTER_DATA_EFFECTIVE_SQL 1 +#define MYSQL_OPT_MASTER_DATA_COMMENTED_SQL 2 +static uint opt_mysql_port= 0, err_len= 0, opt_master_data; static my_string opt_mysql_unix_port=0; static int first_error=0; static DYNAMIC_STRING extended_row; @@ -183,8 +185,9 @@ static struct my_option my_long_options[] = (gptr*) &opt_delayed, (gptr*) &opt_delayed, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"delete-master-logs", OPT_DELETE_MASTER_LOGS, - "Delete logs on master after backup. This automatically enables --first-slave.", - 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, + "Delete logs on master after backup. This automatically enables --master-data.", + (gptr*) &opt_delete_master_logs, (gptr*) &opt_delete_master_logs, 0, + GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"disable-keys", 'K', "'/*!40000 ALTER TABLE tb_name DISABLE KEYS */; and '/*!40000 ALTER TABLE tb_name ENABLE KEYS */; will be put in the output.", (gptr*) &opt_disable_keys, (gptr*) &opt_disable_keys, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, @@ -203,13 +206,18 @@ static struct my_option my_long_options[] = (gptr*) &opt_enclosed, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0 ,0, 0}, {"fields-escaped-by", OPT_ESC, "Fields in the i.file are escaped by ...", (gptr*) &escaped, (gptr*) &escaped, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"first-slave", 'x', "Locks all tables across all databases.", - (gptr*) &opt_first_slave, (gptr*) &opt_first_slave, 0, GET_BOOL, NO_ARG, + {"first-slave", 'x', "Deprecated, renamed to --lock-all-tables.", + (gptr*) &opt_lock_all_tables, (gptr*) &opt_lock_all_tables, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"flush-logs", 'F', "Flush logs file in server before starting dump. " - "Note that if you dump many databases at once (using the option " - "--databases= or --all-databases), the logs will be flushed for " - "each database dumped.", + "Note that if you dump many databases at once (using the option " + "--databases= or --all-databases), the logs will be flushed for " + "each database dumped. The exception is when using --lock-all-tables " + "or --master-data: " + "in this case the logs will be flushed only once, corresponding " + "to the moment all tables are locked. So if you want your dump and " + "the log flush to happen at the same exact moment you should use " + "--lock-all-tables or --master-data with --flush-logs", (gptr*) &flush_logs, (gptr*) &flush_logs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"force", 'f', "Continue even if we get an sql-error.", @@ -222,17 +230,40 @@ static struct my_option my_long_options[] = {"lines-terminated-by", OPT_LTB, "Lines in the i.file are terminated by ...", (gptr*) &lines_terminated, (gptr*) &lines_terminated, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"lock-all-tables", 'x', "Locks all tables across all databases. This " + "is achieved by taking a global read lock for the duration of the whole " + "dump. Automatically turns --single-transaction and --lock-tables off.", + (gptr*) &opt_lock_all_tables, (gptr*) &opt_lock_all_tables, 0, GET_BOOL, NO_ARG, + 0, 0, 0, 0, 0, 0}, {"lock-tables", 'l', "Lock all tables for read.", (gptr*) &lock_tables, (gptr*) &lock_tables, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, {"master-data", OPT_MASTER_DATA, - "This causes the master position and filename to be appended to your output. This automatically enables --first-slave.", - 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, + "This causes the binary log position and filename to be appended to the " + "output. If equal to 1, will print it as a CHANGE MASTER command; if equal" + " to 2, that command will be prefixed with a comment symbol. " + "This option will turn --lock-all-tables on, unless " + "--single-transaction is specified too (in which case a " + "global read lock is only taken a short time at the beginning of the dump " + "- don't forget to read about --single-transaction below). In all cases " + "any action on logs will happen at the exact moment of the dump." + "Option automatically turns --lock-tables off.", + (gptr*) &opt_master_data, (gptr*) &opt_master_data, 0, + GET_UINT, REQUIRED_ARG, 0, 0, MYSQL_OPT_MASTER_DATA_COMMENTED_SQL, 0, 0, 0}, {"no-autocommit", OPT_AUTOCOMMIT, "Wrap tables with autocommit/commit statements.", (gptr*) &opt_autocommit, (gptr*) &opt_autocommit, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + /* + Note that the combination --single-transaction --master-data + will give bullet-proof binlog position only if server >=4.1.3. That's the + old "FLUSH TABLES WITH READ LOCK does not block commit" fixed bug. + */ {"single-transaction", OPT_TRANSACTION, - "Dump all tables in single transaction to get consistent snapshot. Mutually exclusive with --lock-tables.", + "Creates a consistent snapshot by dumping all tables in a single " + "transaction. Works ONLY for tables stored in storage engines which " + "support multiversioning (currently only InnoDB does); the dump is NOT " + "guaranteed to be consistent for other storage engines. Option " + "automatically turns off --lock-tables.", (gptr*) &opt_single_transaction, (gptr*) &opt_single_transaction, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"no-create-db", 'n', @@ -472,14 +503,6 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), char *argument) { switch (optid) { - case OPT_MASTER_DATA: - opt_master_data=1; - opt_first_slave=1; - break; - case OPT_DELETE_MASTER_LOGS: - opt_delete_master_logs=1; - opt_first_slave=1; - break; case 'p': if (argument) { @@ -527,7 +550,6 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), case (int) OPT_OPTIMIZE: extended_insert= opt_drop= opt_lock= quick= create_options= opt_disable_keys= lock_tables= opt_set_charset= 1; - if (opt_single_transaction) lock_tables=0; break; case (int) OPT_SKIP_OPTIMIZATION: extended_insert= opt_drop= opt_lock= quick= create_options= @@ -623,7 +645,19 @@ static int get_options(int *argc, char ***argv) "%s: You must use option --tab with --fields-...\n", my_progname); return(1); } - if (opt_single_transaction) + + /* Ensure consistency of the set of binlog & locking options */ + if (opt_delete_master_logs && !opt_master_data) + opt_master_data= MYSQL_OPT_MASTER_DATA_COMMENTED_SQL; + if (opt_single_transaction && opt_lock_all_tables) + { + fprintf(stderr, "%s: You can't use --single-transaction and " + "--lock-all-tables at the same time.\n", my_progname); + return(1); + } + if (opt_master_data) + opt_lock_all_tables= !opt_single_transaction; + if (opt_single_transaction || opt_lock_all_tables) lock_tables= 0; if (enclosed && opt_enclosed) { @@ -670,6 +704,36 @@ static void DBerror(MYSQL *mysql, const char *when) } /* DBerror */ +/* + Sends a query to server, optionally reads result, prints error message if + some. + + SYNOPSIS + mysql_query_with_error_report() + mysql_con connection to use + res if non zero, result will be put there with mysql_store_result + query query to send to server + + RETURN VALUES + 0 query sending and (if res!=0) result reading went ok + 1 error +*/ + +static int mysql_query_with_error_report(MYSQL *mysql_con, MYSQL_RES **res, + const char *query) +{ + if (mysql_query(mysql_con, query) || + (res && !((*res)= mysql_store_result(mysql_con)))) + { + my_printf_error(0, "%s: Couldn't execute '%s': %s (%d)", + MYF(0), my_progname, query, + mysql_error(mysql_con), mysql_errno(mysql_con)); + return 1; + } + return 0; +} + + static void safe_exit(int error) { if (!first_error) @@ -717,12 +781,15 @@ static int dbConnect(char *host, char *user,char *passwd) DBerror(&mysql_connection, "when trying to connect"); return 1; } + /* + As we're going to set SQL_MODE, it would be lost on reconnect, so we + cannot reconnect. + */ + sock->reconnect= 0; sprintf(buff, "/*!40100 SET @@SQL_MODE=\"%s\" */", compatible_mode_normal_str); - if (mysql_query(sock, buff)) + if (mysql_query_with_error_report(sock, 0, buff)) { - fprintf(stderr, "%s: Can't set the compatible mode %s (error %s)\n", - my_progname, compatible_mode_normal_str, mysql_error(sock)); mysql_close(sock); safe_exit(EX_MYSQLERR); return 1; @@ -961,7 +1028,7 @@ static uint getTableStructure(char *table, char* db) result_table= quote_name(table, table_buff, 1); opt_quoted_table= quote_name(table, table_buff2, 0); - if (!opt_xml && !mysql_query(sock,insert_pat)) + if (!opt_xml && !mysql_query_with_error_report(sock, 0, insert_pat)) { /* using SHOW CREATE statement */ if (!tFlag) @@ -970,10 +1037,8 @@ static uint getTableStructure(char *table, char* db) char buff[20+FN_REFLEN]; sprintf(buff,"show create table %s", result_table); - if (mysql_query(sock, buff)) + if (mysql_query_with_error_report(sock, 0, buff)) { - fprintf(stderr, "%s: Can't get CREATE TABLE for table %s (%s)\n", - my_progname, result_table, mysql_error(sock)); safe_exit(EX_MYSQLERR); DBUG_RETURN(0); } @@ -1010,10 +1075,8 @@ static uint getTableStructure(char *table, char* db) mysql_free_result(tableRes); } sprintf(insert_pat,"show fields from %s", result_table); - if (mysql_query(sock,insert_pat) || !(tableRes=mysql_store_result(sock))) + if (mysql_query_with_error_report(sock, &tableRes, insert_pat)) { - fprintf(stderr, "%s: Can't get info about table: %s\nerror: %s\n", - my_progname, result_table, mysql_error(sock)); if (path) my_fclose(sql_file, MYF(MY_WME)); safe_exit(EX_MYSQLERR); @@ -1053,10 +1116,8 @@ static uint getTableStructure(char *table, char* db) my_progname, mysql_error(sock)); sprintf(insert_pat,"show fields from %s", result_table); - if (mysql_query(sock,insert_pat) || !(tableRes=mysql_store_result(sock))) + if (mysql_query_with_error_report(sock, &tableRes, insert_pat)) { - fprintf(stderr, "%s: Can't get info about table: %s\nerror: %s\n", - my_progname, result_table, mysql_error(sock)); safe_exit(EX_MYSQLERR); DBUG_RETURN(0); } @@ -1150,17 +1211,14 @@ static uint getTableStructure(char *table, char* db) char buff[20+FN_REFLEN]; uint keynr,primary_key; sprintf(buff,"show keys from %s", result_table); - if (mysql_query(sock, buff)) + if (mysql_query_with_error_report(sock, &tableRes, buff)) { - fprintf(stderr, "%s: Can't get keys for table %s (%s)\n", - my_progname, result_table, mysql_error(sock)); if (path) my_fclose(sql_file, MYF(MY_WME)); safe_exit(EX_MYSQLERR); DBUG_RETURN(0); } - tableRes=mysql_store_result(sock); /* Find first which key is primary key */ keynr=0; primary_key=INT_MAX; @@ -1224,7 +1282,7 @@ static uint getTableStructure(char *table, char* db) char show_name_buff[FN_REFLEN]; sprintf(buff,"show table status like %s", quote_for_like(table, show_name_buff)); - if (mysql_query(sock, buff)) + if (mysql_query_with_error_report(sock, &tableRes, buff)) { if (mysql_errno(sock) != ER_PARSE_ERROR) { /* If old MySQL version */ @@ -1234,8 +1292,7 @@ static uint getTableStructure(char *table, char* db) result_table,mysql_error(sock)); } } - else if (!(tableRes=mysql_store_result(sock)) || - !(row=mysql_fetch_row(tableRes))) + else if (!(row=mysql_fetch_row(tableRes))) { fprintf(stderr, "Error: Couldn't read status information for table %s (%s)\n", @@ -1439,22 +1496,14 @@ static void dumpTable(uint numFields, char *table) fputs("\n", md_result_file); check_io(md_result_file); } - if (mysql_query(sock, query)) - { + if (mysql_query_with_error_report(sock, 0, query)) DBerror(sock, "when retrieving data from server"); - error= EX_CONSCHECK; - goto err; - } if (quick) res=mysql_use_result(sock); else res=mysql_store_result(sock); if (!res) - { DBerror(sock, "when retrieving data from server"); - error= EX_CONSCHECK; - goto err; - } if (verbose) fprintf(stderr, "-- Retrieving rows...\n"); if (mysql_num_fields(res) != numFields) @@ -1784,13 +1833,8 @@ static int dump_all_databases() MYSQL_RES *tableres; int result=0; - if (mysql_query(sock, "SHOW DATABASES") || - !(tableres = mysql_store_result(sock))) - { - my_printf_error(0, "Error: Couldn't execute 'SHOW DATABASES': %s", - MYF(0), mysql_error(sock)); + if (mysql_query_with_error_report(sock, &tableres, "SHOW DATABASES")) return 1; - } while ((row = mysql_fetch_row(tableres))) { if (dump_all_tables_in_db(row[0])) @@ -1843,7 +1887,7 @@ static int init_dumping(char *database) sprintf(qbuf,"SHOW CREATE DATABASE WITH IF NOT EXISTS %s", qdatabase); - if (mysql_query(sock, qbuf) || !(dbinfo = mysql_store_result(sock))) + if (mysql_query_with_error_report(sock, &dbinfo, qbuf)) { /* Old server version, dump generic CREATE DATABASE */ fprintf(md_result_file, @@ -1912,7 +1956,7 @@ static int dump_all_tables_in_db(char *database) check_io(md_result_file); } if (lock_tables) - mysql_query(sock,"UNLOCK TABLES"); + mysql_query_with_error_report(sock, 0, "UNLOCK TABLES"); return 0; } /* dump_all_tables_in_db */ @@ -1961,11 +2005,76 @@ static int dump_selected_tables(char *db, char **table_names, int tables) check_io(md_result_file); } if (lock_tables) - mysql_query(sock,"UNLOCK TABLES"); + mysql_query_with_error_report(sock, 0, "UNLOCK TABLES"); return 0; } /* dump_selected_tables */ +static int do_show_master_status(MYSQL *mysql_con) +{ + MYSQL_ROW row; + MYSQL_RES *master; + const char *comment_prefix= + (opt_master_data == MYSQL_OPT_MASTER_DATA_COMMENTED_SQL) ? "-- " : ""; + if (mysql_query_with_error_report(mysql_con, &master, "SHOW MASTER STATUS")) + { + my_printf_error(0, "Error: Couldn't execute 'SHOW MASTER STATUS': %s", + MYF(0), mysql_error(mysql_con)); + return 1; + } + else + { + row = mysql_fetch_row(master); + if (row && row[0] && row[1]) + { + if (opt_comments) + fprintf(md_result_file, + "\n--\n-- Position to start replication or point-in-time " + "recovery from\n--\n\n"); + fprintf(md_result_file, + "%sCHANGE MASTER TO MASTER_LOG_FILE='%s', MASTER_LOG_POS=%s;\n", + comment_prefix, row[0], row[1]); + check_io(md_result_file); + } + mysql_free_result(master); + } + return 0; +} + + +static int do_flush_tables_read_lock(MYSQL *mysql_con) +{ + return + mysql_query_with_error_report(mysql_con, 0, "FLUSH TABLES WITH READ LOCK"); +} + + +static int do_unlock_tables(MYSQL *mysql_con) +{ + return mysql_query_with_error_report(mysql_con, 0, "UNLOCK TABLES"); +} + + +static int do_reset_master(MYSQL *mysql_con) +{ + return mysql_query_with_error_report(mysql_con, 0, "RESET MASTER"); +} + + +static int start_transaction(MYSQL *mysql_con, my_bool consistent_read_now) +{ + /* + We use BEGIN for old servers. --single-transaction --master-data will fail + on old servers, but that's ok as it was already silently broken (it didn't + do a consistent read, so better tell people frankly, with the error). + */ + return (mysql_query_with_error_report(mysql_con, 0, + consistent_read_now ? + "START TRANSACTION " + "WITH CONSISTENT SNAPSHOT" : + "BEGIN")); +} + static ulong find_set(TYPELIB *lib, const char *x, uint length, char **err_pos, uint *err_len) @@ -2063,7 +2172,7 @@ static const char *check_if_ignore_table(const char *table_name) sprintf(buff,"show table status like %s", quote_for_like(table_name, show_name_buff)); - if (mysql_query(sock, buff)) + if (mysql_query_with_error_report(sock, &res, buff)) { if (mysql_errno(sock) != ER_PARSE_ERROR) { /* If old MySQL version */ @@ -2074,8 +2183,7 @@ static const char *check_if_ignore_table(const char *table_name) return 0; /* assume table is ok */ } } - if (!(res= mysql_store_result(sock)) || - !(row= mysql_fetch_row(res))) + if (!(row= mysql_fetch_row(res))) { fprintf(stderr, "Error: Couldn't read status information for table %s (%s)\n", @@ -2094,8 +2202,6 @@ static const char *check_if_ignore_table(const char *table_name) int main(int argc, char **argv) { - MYSQL_ROW row; - MYSQL_RES *master; compatible_mode_normal_str[0]= 0; MY_INIT(argv[0]); @@ -2109,28 +2215,24 @@ int main(int argc, char **argv) if (!path) write_header(md_result_file, *argv); - if (opt_first_slave) + if ((opt_lock_all_tables || opt_master_data) && + do_flush_tables_read_lock(sock)) + goto err; + if (opt_single_transaction && start_transaction(sock, test(opt_master_data))) + goto err; + if (opt_delete_master_logs && do_reset_master(sock)) + goto err; + if (opt_lock_all_tables || opt_master_data) { - lock_tables=0; /* No other locks needed */ - if (mysql_query(sock, "FLUSH TABLES WITH READ LOCK")) - { - my_printf_error(0, "Error: Couldn't execute 'FLUSH TABLES WITH READ LOCK': %s", - MYF(0), mysql_error(sock)); - my_end(0); - return(first_error); - } - } - else if (opt_single_transaction) - { - /* There is no sense to start transaction if all tables are locked */ - if (mysql_query(sock, "BEGIN")) - { - my_printf_error(0, "Error: Couldn't execute 'BEGIN': %s", - MYF(0), mysql_error(sock)); - my_end(0); - return(first_error); - } + if (flush_logs && mysql_refresh(sock, REFRESH_LOG)) + goto err; + flush_logs= 0; /* not anymore; that would not be sensible */ } + if (opt_master_data && do_show_master_status(sock)) + goto err; + if (opt_single_transaction && do_unlock_tables(sock)) // unlock but no commit! + goto err; + if (opt_alldbs) dump_all_databases(); else if (argc > 1 && !opt_databases) @@ -2143,57 +2245,16 @@ int main(int argc, char **argv) /* One or more databases, all tables */ dump_databases(argv); } - - if (opt_first_slave) - { - if (opt_delete_master_logs && mysql_query(sock, "FLUSH MASTER")) - { - my_printf_error(0, "Error: Couldn't execute 'FLUSH MASTER': %s", - MYF(0), mysql_error(sock)); - } - if (opt_master_data) - { - if (mysql_query(sock, "SHOW MASTER STATUS") || - !(master = mysql_store_result(sock))) - my_printf_error(0, "Error: Couldn't execute 'SHOW MASTER STATUS': %s", - MYF(0), mysql_error(sock)); - else - { - row = mysql_fetch_row(master); - if (row && row[0] && row[1]) - { - if (opt_comments) - fprintf(md_result_file, - "\n--\n-- Position to start replication from\n--\n\n"); - fprintf(md_result_file, - "CHANGE MASTER TO MASTER_LOG_FILE='%s', \ -MASTER_LOG_POS=%s ;\n",row[0],row[1]); - check_io(md_result_file); - } - mysql_free_result(master); - } - } - if (mysql_query(sock, "UNLOCK TABLES")) - my_printf_error(0, "Error: Couldn't execute 'UNLOCK TABLES': %s", - MYF(0), mysql_error(sock)); - } - else if (opt_single_transaction) /* Just to make it beautiful enough */ #ifdef HAVE_SMEM my_free(shared_memory_base_name,MYF(MY_ALLOW_ZERO_PTR)); #endif - { - /* - In case we were locking all tables, we did not start transaction - so there is no need to commit it. - */ - - /* This should just free locks as we did not change anything */ - if (mysql_query(sock, "COMMIT")) - { - my_printf_error(0, "Error: Couldn't execute 'COMMIT': %s", - MYF(0), mysql_error(sock)); - } - } + /* + No reason to explicitely COMMIT the transaction, neither to explicitely + UNLOCK TABLES: these will be automatically be done by the server when we + disconnect now. Saves some code here, some network trips, adds nothing to + server. + */ +err: dbDisconnect(current_host); if (!path) write_footer(md_result_file); diff --git a/include/mysqld_error.h b/include/mysqld_error.h index 776869ff045..67c2b0aba73 100644 --- a/include/mysqld_error.h +++ b/include/mysqld_error.h @@ -319,4 +319,5 @@ #define ER_INVALID_CHARACTER_STRING 1300 #define ER_WARN_ALLOWED_PACKET_OVERFLOWED 1301 #define ER_CONFLICTING_DECLARATIONS 1302 -#define ER_ERROR_MESSAGES 303 +#define ER_NO_CONS_READ_ENGINE 1303 +#define ER_ERROR_MESSAGES 304 diff --git a/mysql-test/r/consistent_snapshot.result b/mysql-test/r/consistent_snapshot.result new file mode 100644 index 00000000000..90606abbe4e --- /dev/null +++ b/mysql-test/r/consistent_snapshot.result @@ -0,0 +1,15 @@ +drop table if exists t1; +create table t1 (a int) engine=innodb; +start transaction with consistent snapshot; +insert into t1 values(1); +select * from t1; +a +commit; +delete from t1; +start transaction; +insert into t1 values(1); +select * from t1; +a +1 +commit; +drop table t1; diff --git a/mysql-test/t/consistent_snapshot.test b/mysql-test/t/consistent_snapshot.test new file mode 100644 index 00000000000..7afdae36325 --- /dev/null +++ b/mysql-test/t/consistent_snapshot.test @@ -0,0 +1,41 @@ +-- source include/have_innodb.inc + +--disable_warnings +drop table if exists t1; +--enable_warnings + +connect (con1,localhost,root,,); +connect (con2,localhost,root,,); + +### Test 1: +### - While a consistent snapshot transaction is executed, +### no external inserts should be visible to the transaction. + +connection con1; +create table t1 (a int) engine=innodb; +start transaction with consistent snapshot; + +connection con2; +insert into t1 values(1); + +connection con1; +select * from t1; # if consistent snapshot was set as expected, we +# should see nothing. +commit; + +### Test 2: +### - For any non-consistent snapshot transaction, external +### committed inserts should be visible to the transaction. + +delete from t1; +start transaction; # Now we omit WITH CONSISTENT SNAPSHOT + +connection con2; +insert into t1 values(1); + +connection con1; +select * from t1; # if consistent snapshot was not set, as expected, we +# should see 1. +commit; + +drop table t1; diff --git a/sql/handler.cc b/sql/handler.cc index cb88ab463d8..0c12579cbfd 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -771,6 +771,24 @@ int ha_savepoint(THD *thd, char *savepoint_name) DBUG_RETURN(error); } + +int ha_start_consistent_snapshot(THD *thd) +{ +#ifdef HAVE_INNOBASE_DB + if ((have_innodb == SHOW_OPTION_YES) && + !innobase_start_trx_and_assign_read_view(thd)) + return 0; +#endif + /* + Same idea as when one wants to CREATE TABLE in one engine which does not + exist: + */ + push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, + ER_NO_CONS_READ_ENGINE, ER(ER_NO_CONS_READ_ENGINE)); + return 0; +} + + bool ha_flush_logs() { bool result=0; diff --git a/sql/handler.h b/sql/handler.h index a7ce4e708fd..fa19f136abf 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -138,6 +138,8 @@ #define HA_CACHE_TBL_ASKTRANSACT 2 #define HA_CACHE_TBL_TRANSACT 4 +/* Options of START TRANSACTION statement (and later of SET TRANSACTION stmt) */ +#define MYSQL_START_TRANS_OPT_WITH_CONS_SNAPSHOT 1 enum db_type { @@ -567,5 +569,4 @@ int ha_discover(THD* thd, const char* dbname, const char* name, int ha_find_files(THD *thd,const char *db,const char *path, const char *wild, bool dir,List* files); int ha_table_exists(THD* thd, const char* db, const char* name); - - +int ha_start_consistent_snapshot(THD *thd); diff --git a/sql/lex.h b/sql/lex.h index c64a7069c32..325d052de90 100644 --- a/sql/lex.h +++ b/sql/lex.h @@ -114,6 +114,7 @@ static SYMBOL symbols[] = { { "COMMITTED", SYM(COMMITTED_SYM)}, { "COMPRESSED", SYM(COMPRESSED_SYM)}, { "CONCURRENT", SYM(CONCURRENT)}, + { "CONSISTENT", SYM(CONSISTENT_SYM)}, { "CONSTRAINT", SYM(CONSTRAINT)}, { "CONVERT", SYM(CONVERT_SYM)}, { "CREATE", SYM(CREATE)}, @@ -382,6 +383,7 @@ static SYMBOL symbols[] = { { "SIGNED", SYM(SIGNED_SYM)}, { "SIMPLE", SYM(SIMPLE_SYM)}, { "SLAVE", SYM(SLAVE)}, + { "SNAPSHOT", SYM(SNAPSHOT_SYM)}, { "SMALLINT", SYM(SMALLINT)}, { "SOME", SYM(ANY_SYM)}, { "SONAME", SYM(UDF_SONAME_SYM)}, diff --git a/sql/share/czech/errmsg.txt b/sql/share/czech/errmsg.txt index 022a624c921..d352a6e82f7 100644 --- a/sql/share/czech/errmsg.txt +++ b/sql/share/czech/errmsg.txt @@ -331,3 +331,4 @@ character-set=latin2 "Invalid %s character string: '%.64s'", "Result of %s() was larger than max_allowed_packet (%ld) - truncated" "Conflicting declarations: '%s%s' and '%s%s'" +"This MySQL server does not support any consistent-read capable storage engine" diff --git a/sql/share/danish/errmsg.txt b/sql/share/danish/errmsg.txt index 18ebe5712f8..e84ee22d5cf 100644 --- a/sql/share/danish/errmsg.txt +++ b/sql/share/danish/errmsg.txt @@ -322,3 +322,4 @@ character-set=latin1 "Invalid %s character string: '%.64s'", "Result of %s() was larger than max_allowed_packet (%ld) - truncated" "Conflicting declarations: '%s%s' and '%s%s'" +"This MySQL server does not support any consistent-read capable storage engine" diff --git a/sql/share/dutch/errmsg.txt b/sql/share/dutch/errmsg.txt index 54377b5949a..d9d33c3bf59 100644 --- a/sql/share/dutch/errmsg.txt +++ b/sql/share/dutch/errmsg.txt @@ -331,3 +331,4 @@ character-set=latin1 "Invalid %s character string: '%.64s'", "Result of %s() was larger than max_allowed_packet (%ld) - truncated" "Conflicting declarations: '%s%s' and '%s%s'" +"This MySQL server does not support any consistent-read capable storage engine" diff --git a/sql/share/english/errmsg.txt b/sql/share/english/errmsg.txt index 8ede3f61a0b..fd43a2c10c5 100644 --- a/sql/share/english/errmsg.txt +++ b/sql/share/english/errmsg.txt @@ -319,3 +319,4 @@ character-set=latin1 "Invalid %s character string: '%.64s'", "Result of %s() was larger than max_allowed_packet (%ld) - truncated" "Conflicting declarations: '%s%s' and '%s%s'" +"This MySQL server does not support any consistent-read capable storage engine" diff --git a/sql/share/estonian/errmsg.txt b/sql/share/estonian/errmsg.txt index 5aab524e0d9..ae4d5279f35 100644 --- a/sql/share/estonian/errmsg.txt +++ b/sql/share/estonian/errmsg.txt @@ -324,3 +324,4 @@ character-set=latin7 "Invalid %s character string: '%.64s'", "Result of %s() was larger than max_allowed_packet (%ld) - truncated" "Conflicting declarations: '%s%s' and '%s%s'" +"This MySQL server does not support any consistent-read capable storage engine" diff --git a/sql/share/french/errmsg.txt b/sql/share/french/errmsg.txt index 355e784b156..5217133274b 100644 --- a/sql/share/french/errmsg.txt +++ b/sql/share/french/errmsg.txt @@ -319,3 +319,4 @@ character-set=latin1 "Invalid %s character string: '%.64s'", "Result of %s() was larger than max_allowed_packet (%ld) - truncated" "Conflicting declarations: '%s%s' and '%s%s'" +"This MySQL server does not support any consistent-read capable storage engine" diff --git a/sql/share/german/errmsg.txt b/sql/share/german/errmsg.txt index 03e838dd805..15f98d36e87 100644 --- a/sql/share/german/errmsg.txt +++ b/sql/share/german/errmsg.txt @@ -332,3 +332,4 @@ character-set=latin1 "Invalid %s character string: '%.64s'", "Result of %s() was larger than max_allowed_packet (%ld) - truncated" "Conflicting declarations: '%s%s' and '%s%s'" +"This MySQL server does not support any consistent-read capable storage engine" diff --git a/sql/share/greek/errmsg.txt b/sql/share/greek/errmsg.txt index 06f31a79a73..fae5c508320 100644 --- a/sql/share/greek/errmsg.txt +++ b/sql/share/greek/errmsg.txt @@ -319,3 +319,4 @@ character-set=greek "Invalid %s character string: '%.64s'", "Result of %s() was larger than max_allowed_packet (%ld) - truncated" "Conflicting declarations: '%s%s' and '%s%s'" +"This MySQL server does not support any consistent-read capable storage engine" diff --git a/sql/share/hungarian/errmsg.txt b/sql/share/hungarian/errmsg.txt index af10c33ee2d..6f83de7a64d 100644 --- a/sql/share/hungarian/errmsg.txt +++ b/sql/share/hungarian/errmsg.txt @@ -324,3 +324,4 @@ character-set=latin2 "Invalid %s character string: '%.64s'", "Result of %s() was larger than max_allowed_packet (%ld) - truncated" "Conflicting declarations: '%s%s' and '%s%s'" +"This MySQL server does not support any consistent-read capable storage engine" diff --git a/sql/share/italian/errmsg.txt b/sql/share/italian/errmsg.txt index cd66f15db5f..7df71e92fc4 100644 --- a/sql/share/italian/errmsg.txt +++ b/sql/share/italian/errmsg.txt @@ -319,3 +319,4 @@ character-set=latin1 "Invalid %s character string: '%.64s'", "Result of %s() was larger than max_allowed_packet (%ld) - truncated" "Conflicting declarations: '%s%s' and '%s%s'" +"This MySQL server does not support any consistent-read capable storage engine" diff --git a/sql/share/japanese/errmsg.txt b/sql/share/japanese/errmsg.txt index eaab58d8403..9fc2ead10d6 100644 --- a/sql/share/japanese/errmsg.txt +++ b/sql/share/japanese/errmsg.txt @@ -323,3 +323,4 @@ character-set=ujis "Invalid %s character string: '%.64s'", "Result of %s() was larger than max_allowed_packet (%ld) - truncated" "Conflicting declarations: '%s%s' and '%s%s'" +"This MySQL server does not support any consistent-read capable storage engine" diff --git a/sql/share/korean/errmsg.txt b/sql/share/korean/errmsg.txt index 1cff50432e9..4e40ffc6264 100644 --- a/sql/share/korean/errmsg.txt +++ b/sql/share/korean/errmsg.txt @@ -319,3 +319,4 @@ character-set=euckr "Invalid %s character string: '%.64s'", "Result of %s() was larger than max_allowed_packet (%ld) - truncated" "Conflicting declarations: '%s%s' and '%s%s'" +"This MySQL server does not support any consistent-read capable storage engine" diff --git a/sql/share/norwegian-ny/errmsg.txt b/sql/share/norwegian-ny/errmsg.txt index 27f7a18f029..d78c59357f1 100644 --- a/sql/share/norwegian-ny/errmsg.txt +++ b/sql/share/norwegian-ny/errmsg.txt @@ -321,3 +321,4 @@ character-set=latin1 "Invalid %s character string: '%.64s'", "Result of %s() was larger than max_allowed_packet (%ld) - truncated" "Conflicting declarations: '%s%s' and '%s%s'" +"This MySQL server does not support any consistent-read capable storage engine" diff --git a/sql/share/norwegian/errmsg.txt b/sql/share/norwegian/errmsg.txt index 772f30e5d94..d0a282c444d 100644 --- a/sql/share/norwegian/errmsg.txt +++ b/sql/share/norwegian/errmsg.txt @@ -321,3 +321,4 @@ character-set=latin1 "Invalid %s character string: '%.64s'", "Result of %s() was larger than max_allowed_packet (%ld) - truncated" "Conflicting declarations: '%s%s' and '%s%s'" +"This MySQL server does not support any consistent-read capable storage engine" diff --git a/sql/share/polish/errmsg.txt b/sql/share/polish/errmsg.txt index 634a4d93f42..de812697482 100644 --- a/sql/share/polish/errmsg.txt +++ b/sql/share/polish/errmsg.txt @@ -324,3 +324,4 @@ character-set=latin2 "Invalid %s character string: '%.64s'", "Result of %s() was larger than max_allowed_packet (%ld) - truncated" "Conflicting declarations: '%s%s' and '%s%s'" +"This MySQL server does not support any consistent-read capable storage engine" diff --git a/sql/share/portuguese/errmsg.txt b/sql/share/portuguese/errmsg.txt index c79c346008e..262c472a4fa 100644 --- a/sql/share/portuguese/errmsg.txt +++ b/sql/share/portuguese/errmsg.txt @@ -321,3 +321,4 @@ character-set=latin1 "Invalid %s character string: '%.64s'", "Result of %s() was larger than max_allowed_packet (%ld) - truncated" "Conflicting declarations: '%s%s' and '%s%s'" +"This MySQL server does not support any consistent-read capable storage engine" diff --git a/sql/share/romanian/errmsg.txt b/sql/share/romanian/errmsg.txt index 7cb0427dc3f..377ebfbf698 100644 --- a/sql/share/romanian/errmsg.txt +++ b/sql/share/romanian/errmsg.txt @@ -324,3 +324,4 @@ character-set=latin2 "Invalid %s character string: '%.64s'", "Result of %s() was larger than max_allowed_packet (%ld) - truncated" "Conflicting declarations: '%s%s' and '%s%s'" +"This MySQL server does not support any consistent-read capable storage engine" diff --git a/sql/share/russian/errmsg.txt b/sql/share/russian/errmsg.txt index df354d5797f..4edfd39c836 100644 --- a/sql/share/russian/errmsg.txt +++ b/sql/share/russian/errmsg.txt @@ -324,3 +324,4 @@ character-set=koi8r "Invalid %s character string: '%.64s'", "Result of %s() was larger than max_allowed_packet (%ld) - truncated" "Conflicting declarations: '%s%s' and '%s%s'" +"This MySQL server does not support any consistent-read capable storage engine" diff --git a/sql/share/serbian/errmsg.txt b/sql/share/serbian/errmsg.txt index 45b56c8269c..e18fa6d2811 100644 --- a/sql/share/serbian/errmsg.txt +++ b/sql/share/serbian/errmsg.txt @@ -312,3 +312,4 @@ character-set=cp1250 "Invalid %s character string: '%.64s'", "Result of %s() was larger than max_allowed_packet (%ld) - truncated" "Conflicting declarations: '%s%s' and '%s%s'" +"This MySQL server does not support any consistent-read capable storage engine" diff --git a/sql/share/slovak/errmsg.txt b/sql/share/slovak/errmsg.txt index 12c3eb2b6af..d935439a1ba 100644 --- a/sql/share/slovak/errmsg.txt +++ b/sql/share/slovak/errmsg.txt @@ -327,3 +327,4 @@ character-set=latin2 "Invalid %s character string: '%.64s'", "Result of %s() was larger than max_allowed_packet (%ld) - truncated" "Conflicting declarations: '%s%s' and '%s%s'" +"This MySQL server does not support any consistent-read capable storage engine" diff --git a/sql/share/spanish/errmsg.txt b/sql/share/spanish/errmsg.txt index bd2439c44a6..97fb1bf0be5 100644 --- a/sql/share/spanish/errmsg.txt +++ b/sql/share/spanish/errmsg.txt @@ -323,3 +323,4 @@ character-set=latin1 "Invalid %s character string: '%.64s'", "Result of %s() was larger than max_allowed_packet (%ld) - truncated" "Conflicting declarations: '%s%s' and '%s%s'" +"This MySQL server does not support any consistent-read capable storage engine" diff --git a/sql/share/swedish/errmsg.txt b/sql/share/swedish/errmsg.txt index da75e4fcede..8de68600509 100644 --- a/sql/share/swedish/errmsg.txt +++ b/sql/share/swedish/errmsg.txt @@ -319,3 +319,4 @@ character-set=latin1 "Invalid %s character string: '%.64s'", "Result of %s() was larger than max_allowed_packet (%ld) - truncated" "Conflicting declarations: '%s%s' and '%s%s'" +"This MySQL server does not support any consistent-read capable storage engine" diff --git a/sql/share/ukrainian/errmsg.txt b/sql/share/ukrainian/errmsg.txt index a19cf946cb1..cf44fea6553 100644 --- a/sql/share/ukrainian/errmsg.txt +++ b/sql/share/ukrainian/errmsg.txt @@ -325,3 +325,4 @@ character-set=koi8u "Invalid %s character string: '%.64s'", "Result of %s() was larger than max_allowed_packet (%ld) - truncated" "Conflicting declarations: '%s%s' and '%s%s'" +"This MySQL server does not support any consistent-read capable storage engine" diff --git a/sql/sql_lex.h b/sql/sql_lex.h index 268198f74a2..90c020b3e93 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -613,7 +613,7 @@ typedef struct st_lex uint uint_geom_type; uint grant, grant_tot_col, which_columns; uint fk_delete_opt, fk_update_opt, fk_match_option; - uint slave_thd_opt; + uint slave_thd_opt, start_transaction_opt; uint8 describe; bool drop_if_exists, drop_temporary, local_file, one_shot_set; bool in_comment, ignore_space, verbose, no_write_to_binlog; diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index f5b9bc0638f..d58fe027acf 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -3076,6 +3076,12 @@ purposes internal to the MySQL server", MYF(0)); } case SQLCOM_UNLOCK_TABLES: + /* + It is critical for mysqldump --single-transaction --master-data that + UNLOCK TABLES does not implicitely commit a connection which has only + done FLUSH TABLES WITH READ LOCK + BEGIN. If this assumption becomes + false, mysqldump will not work. + */ unlock_locked_tables(thd); if (thd->options & OPTION_TABLE_LOCK) { @@ -3462,7 +3468,9 @@ purposes internal to the MySQL server", MYF(0)); thd->options= ((thd->options & (ulong) ~(OPTION_STATUS_NO_TRANS_UPDATE)) | OPTION_BEGIN); thd->server_status|= SERVER_STATUS_IN_TRANS; - send_ok(thd); + if (!(lex->start_transaction_opt & MYSQL_START_TRANS_OPT_WITH_CONS_SNAPSHOT) || + !(res= ha_start_consistent_snapshot(thd))) + send_ok(thd); } break; case SQLCOM_COMMIT: diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 4538cb6e6ac..1ef91bcb257 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -131,6 +131,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize); %token CLIENT_SYM %token COMMENT_SYM %token COMMIT_SYM +%token CONSISTENT_SYM %token COUNT_SYM %token CREATE %token CROSS @@ -165,6 +166,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize); %token SELECT_SYM %token SHOW %token SLAVE +%token SNAPSHOT_SYM %token SQL_THREAD %token START_SYM %token STD_SYM @@ -618,6 +620,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize); table_option opt_if_not_exists opt_no_write_to_binlog opt_var_type opt_var_ident_type delete_option opt_temporary all_or_any opt_distinct opt_ignore_leaves fulltext_options spatial_type union_option + start_transaction_opts %type ULONG_NUM raid_types merge_insert_types @@ -2095,10 +2098,20 @@ slave: start: - START_SYM TRANSACTION_SYM { Lex->sql_command = SQLCOM_BEGIN;} - {} + START_SYM TRANSACTION_SYM start_transaction_opts + { + Lex->sql_command = SQLCOM_BEGIN; + Lex->start_transaction_opt= $3; + } ; +start_transaction_opts: + /*empty*/ { $$ = 0; } + | WITH CONSISTENT_SYM SNAPSHOT_SYM + { + $$= MYSQL_START_TRANS_OPT_WITH_CONS_SNAPSHOT; + } + slave_thread_opts: { Lex->slave_thd_opt= 0; } slave_thread_opt_list @@ -5122,6 +5135,7 @@ keyword: | COMMIT_SYM {} | COMPRESSED_SYM {} | CONCURRENT {} + | CONSISTENT_SYM {} | CUBE_SYM {} | DATA_SYM {} | DATETIME {} @@ -5262,6 +5276,7 @@ keyword: | SHARE_SYM {} | SHUTDOWN {} | SLAVE {} + | SNAPSHOT_SYM {} | SOUNDS_SYM {} | SQL_CACHE_SYM {} | SQL_BUFFER_RESULT {} @@ -5888,7 +5903,7 @@ grant_option: ; begin: - BEGIN_SYM { Lex->sql_command = SQLCOM_BEGIN;} opt_work {} + BEGIN_SYM { Lex->sql_command = SQLCOM_BEGIN; Lex->start_transaction_opt= 0;} opt_work {} ; opt_work: From c2e3f7cf86ee257b7c95119580fc5bf52c6a5465 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 10 Nov 2004 18:53:16 +0000 Subject: [PATCH 0168/1063] Bug#6469 - REVOKE ALL synonymy bug --- sql/sql_yacc.yy | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 94c0fe3cf0c..2c1416e1bfd 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -5612,7 +5612,7 @@ revoke_command: grant_privileges ON opt_table FROM user_list {} | - ALL PRIVILEGES ',' GRANT OPTION FROM user_list + ALL opt_privileges ',' GRANT OPTION FROM user_list { Lex->sql_command = SQLCOM_REVOKE_ALL; } @@ -5638,10 +5638,14 @@ grant: grant_privileges: grant_privilege_list {} - | ALL PRIVILEGES { Lex->grant = GLOBAL_ACLS;} - | ALL { Lex->grant = GLOBAL_ACLS;} + | ALL opt_privileges { Lex->grant = GLOBAL_ACLS;} ; +opt_privileges: + /* empty */ + | PRIVILEGES + ; + grant_privilege_list: grant_privilege | grant_privilege_list ',' grant_privilege; From fe2a47b24061b80f9e43c418294184abdcf7ab06 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 10 Nov 2004 21:31:41 +0100 Subject: [PATCH 0169/1063] wl1744 - ndb windoze port ndb/include/ndb_types.h: ndb windoze ndb/src/common/util/version.c: ndb windoze ndb/src/mgmsrv/ConfigInfo.cpp: ndb windoze ndb/src/ndbapi/ndberror.c: ndb windoze --- ndb/include/ndb_types.h | 8 +++++--- ndb/src/common/util/version.c | 5 +++-- ndb/src/mgmsrv/ConfigInfo.cpp | 1 + ndb/src/ndbapi/ndberror.c | 3 ++- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/ndb/include/ndb_types.h b/ndb/include/ndb_types.h index 64b3f517934..b5db23946f0 100644 --- a/ndb/include/ndb_types.h +++ b/ndb/include/ndb_types.h @@ -40,15 +40,17 @@ typedef __SIZE_TYPE__ UintPtr; #ifdef HAVE_INTTYPES_H #include #endif -typedef uintptr_t UintPtr; -#endif - #if defined(WIN32) || defined(NDB_WIN32) typedef unsigned __int64 Uint64; typedef signed __int64 Int64; +typedef Uint32 UintPtr; +typedef UintPtr ssize_t; #else typedef unsigned long long Uint64; typedef signed long long Int64; +typedef uintptr_t UintPtr; +#endif #endif + #endif diff --git a/ndb/src/common/util/version.c b/ndb/src/common/util/version.c index 82acd949c46..dc549457d14 100644 --- a/ndb/src/common/util/version.c +++ b/ndb/src/common/util/version.c @@ -17,6 +17,7 @@ #include #include #include +#include Uint32 getMajor(Uint32 version) { return (version >> 16) & 0xFF; @@ -38,14 +39,14 @@ Uint32 makeVersion(Uint32 major, Uint32 minor, Uint32 build) { const char * getVersionString(Uint32 version, const char * status) { char buff[100]; if (status && status[0] != 0) - snprintf(buff, sizeof(buff), + basestring_snprintf(buff, sizeof(buff), "Version %d.%d.%d (%s)", getMajor(version), getMinor(version), getBuild(version), status); else - snprintf(buff, sizeof(buff), + basestring_snprintf(buff, sizeof(buff), "Version %d.%d.%d", getMajor(version), getMinor(version), diff --git a/ndb/src/mgmsrv/ConfigInfo.cpp b/ndb/src/mgmsrv/ConfigInfo.cpp index 0a41db0e044..16721b560f0 100644 --- a/ndb/src/mgmsrv/ConfigInfo.cpp +++ b/ndb/src/mgmsrv/ConfigInfo.cpp @@ -21,6 +21,7 @@ #include #include #include "InitConfigFileParser.hpp" +#include #define MAX_LINE_LENGTH 255 #define KEY_INTERNAL 0 diff --git a/ndb/src/ndbapi/ndberror.c b/ndb/src/ndbapi/ndberror.c index 17a80082023..d293df0303b 100644 --- a/ndb/src/ndbapi/ndberror.c +++ b/ndb/src/ndbapi/ndberror.c @@ -17,6 +17,7 @@ #include #include +#include typedef struct ErrorBundle { int code; @@ -594,7 +595,7 @@ int ndb_error_string(int err_no, char *str, unsigned int size) ndberror_update(&error); len = - snprintf(str, size-1, "%s: %s: %s", error.message, + basestring_snprintf(str, size-1, "%s: %s: %s", error.message, ndberror_status_message(error.status), ndberror_classification_message(error.classification)); str[size-1]= '\0'; From 78f9a1fc1cae1bb6c67a4645cc2ac6003a8070a6 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 10 Nov 2004 21:43:12 +0100 Subject: [PATCH 0170/1063] wl1744 - ndb windows port move versing handling into ndb_version.h.in (from config.h) configure.in: generate ndb/include/ndb_version.h during configure ndb/Makefile.am: extra target for just creating dsp files --- configure.in | 1 + ndb/Makefile.am | 3 ++ ndb/include/ndb_version.h.in | 53 ++++++++++++++++++++++++++++++++++++ 3 files changed, 57 insertions(+) create mode 100644 ndb/include/ndb_version.h.in diff --git a/configure.in b/configure.in index cd2daf10690..8f5bbaf0c19 100644 --- a/configure.in +++ b/configure.in @@ -3147,6 +3147,7 @@ AC_CONFIG_FILES(Makefile extra/Makefile mysys/Makefile dnl support-files/MacOSX/Makefile mysql-test/Makefile dnl netware/Makefile dnl include/mysql_version.h dnl + ndb/include/ndb_version.h dnl cmd-line-utils/Makefile dnl cmd-line-utils/libedit/Makefile dnl zlib/Makefile dnl diff --git a/ndb/Makefile.am b/ndb/Makefile.am index abff73359fa..e4f21ac8040 100644 --- a/ndb/Makefile.am +++ b/ndb/Makefile.am @@ -22,3 +22,6 @@ windoze: for i in `find . -name 'Makefile.am'`; do make -C `dirname $$i` windoze-dsp; done windoze-dsp: + +all-windoze-dsp: windoze + tar cvfz ndb-win-dsp.tar.gz `find . -name '*.dsp'` diff --git a/ndb/include/ndb_version.h.in b/ndb/include/ndb_version.h.in new file mode 100644 index 00000000000..d7f43eae40a --- /dev/null +++ b/ndb/include/ndb_version.h.in @@ -0,0 +1,53 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef NDB_VERSION_H +#define NDB_VERSION_H + +#include +#include + +/* NDB build version */ +#define NDB_VERSION_BUILD @NDB_VERSION_BUILD@ + +/* NDB major version */ +#define NDB_VERSION_MAJOR @NDB_VERSION_MAJOR@ + +/* NDB minor version */ +#define NDB_VERSION_MINOR @NDB_VERSION_MINOR@ + +/* NDB status version */ +#define NDB_VERSION_STATUS "@NDB_VERSION_STATUS@" + + +#define MAKE_VERSION(A,B,C) (((A) << 16) | ((B) << 8) | ((C) << 0)) + +#define NDB_VERSION_D MAKE_VERSION(NDB_VERSION_MAJOR, NDB_VERSION_MINOR, NDB_VERSION_BUILD) + +#define NDB_VERSION_STRING (getVersionString(NDB_VERSION, NDB_VERSION_STATUS)) + +#define NDB_VERSION ndbGetOwnVersion() + +/** + * Version id + * + * Used by transporter and when communicating with + * managment server + */ +/*#define NDB_VERSION_ID 0*/ + +#endif + From 5205078ef93edb0b9752285a98aa3616057aad35 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 11 Nov 2004 00:36:18 +0200 Subject: [PATCH 0171/1063] Added possibility to detect if libmysqld is restarted (Needed to check if memory allocated with mysql_once_init() has been freed) include/my_sys.h: Added possibility to detect if libmysqld is restarted mysys/my_init.c: Added possibility to detect if libmysqld is restarted sql/handler.cc: Detect if libmysqld is restarted Simple optimization of ha_known_exts() --- include/my_sys.h | 1 + mysys/my_init.c | 7 ++++--- sql/handler.cc | 38 +++++++++++++++++++++++--------------- 3 files changed, 28 insertions(+), 18 deletions(-) diff --git a/include/my_sys.h b/include/my_sys.h index 01a7482e4d0..a8e21ea2f98 100644 --- a/include/my_sys.h +++ b/include/my_sys.h @@ -214,6 +214,7 @@ extern ulong my_cache_w_requests, my_cache_write, my_cache_r_requests, my_cache_read; extern ulong my_blocks_used, my_blocks_changed; extern ulong my_file_opened,my_stream_opened, my_tmp_file_created; +extern uint mysys_usage_id; extern my_bool my_init_done; /* Point to current my_message() */ diff --git a/mysys/my_init.c b/mysys/my_init.c index 0ef938b434c..e9a61b1833c 100644 --- a/mysys/my_init.c +++ b/mysys/my_init.c @@ -42,8 +42,8 @@ static void netware_init(); #define netware_init() #endif - -my_bool my_init_done=0; +my_bool my_init_done= 0; +uint mysys_usage_id= 0; /* Incremented for each my_init() */ static ulong atoi_octal(const char *str) { @@ -51,7 +51,7 @@ static ulong atoi_octal(const char *str) while (*str && my_isspace(&my_charset_latin1, *str)) str++; str2int(str, - (*str == '0' ? 8 : 10), /* Octalt or decimalt */ + (*str == '0' ? 8 : 10), /* Octalt or decimalt */ 0, INT_MAX, &tmp); return (ulong) tmp; } @@ -74,6 +74,7 @@ my_bool my_init(void) if (my_init_done) return 0; my_init_done=1; + mysys_usage_id++; #if defined(THREAD) && defined(SAFE_MUTEX) safe_mutex_global_init(); /* Must be called early */ #endif diff --git a/sql/handler.cc b/sql/handler.cc index 2c274c7989e..34a903cf2c0 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -110,6 +110,7 @@ TYPELIB tx_isolation_typelib= {array_elements(tx_isolation_names)-1,"", tx_isolation_names, NULL}; static TYPELIB known_extensions= {0,"known_exts", NULL, NULL}; +uint known_extensions_id= 0; enum db_type ha_resolve_by_name(const char *name, uint namelen) { @@ -1635,6 +1636,7 @@ int handler::index_read_idx(byte * buf, uint index, const byte * key, return error; } + /* Returns a list of all known extensions. @@ -1643,20 +1645,24 @@ int handler::index_read_idx(byte * buf, uint index, const byte * key, NOTES No mutexes, worst case race is a minor surplus memory allocation + We have to recreate the extension map if mysqld is restarted (for example + within libmysqld) RETURN VALUE pointer pointer to TYPELIB structure */ + TYPELIB *ha_known_exts(void) { - if (!known_extensions.type_names) + if (!known_extensions.type_names || mysys_usage_id != known_extensions_id) { show_table_type_st *types; List found_exts; List_iterator_fast it(found_exts); - const char *e, **ext; - - found_exts.push_back(".db"); + const char **ext, *old_ext; + + known_extensions_id= mysys_usage_id; + found_exts.push_back((char*) ".db"); for (types= sys_table_types; types->type; types++) { if (*types->value == SHOW_OPTION_YES) @@ -1664,28 +1670,30 @@ TYPELIB *ha_known_exts(void) handler *file= get_new_handler(0,(enum db_type) types->db_type); for (ext= file->bas_ext(); *ext; ext++) { - while (e=it++) - if (e == *ext) + while ((old_ext= it++)) + { + if (!strcmp(old_ext, *ext)) break; - - if (!e) - found_exts.push_back((char *)*ext); + } + if (!old_ext) + found_exts.push_back((char *) *ext); it.rewind(); } delete file; } } - ext= (const char **)my_once_alloc(sizeof(char *)* - (found_exts.elements+1), MYF(MY_WME)); + ext= (const char **) my_once_alloc(sizeof(char *)* + (found_exts.elements+1), + MYF(MY_WME | MY_FAE)); DBUG_ASSERT(ext); - for (uint i=0; e=it++; i++) - ext[i]= e; - ext[found_exts.elements]= 0; - known_extensions.count= found_exts.elements; known_extensions.type_names= ext; + + while ((old_ext= it++)) + *ext++= old_ext; + *ext= 0; } return &known_extensions; } From b6eb77f73d09c5feb249b6622db461c47afb7c05 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 11 Nov 2004 00:00:17 +0100 Subject: [PATCH 0172/1063] no new message in 4.1 (causes merge issues with 5.0). Using ER_UNKNOW_ERROR and hardcoded message string instead. include/mysqld_error.h: no new message in 4.1 (causes merge issues with 5.0) sql/handler.cc: no new message in 4.1 (causes merge issues with 5.0) sql/share/czech/errmsg.txt: no new message in 4.1 (causes merge issues with 5.0) sql/share/danish/errmsg.txt: no new message in 4.1 (causes merge issues with 5.0) sql/share/dutch/errmsg.txt: no new message in 4.1 (causes merge issues with 5.0) sql/share/english/errmsg.txt: no new message in 4.1 (causes merge issues with 5.0) sql/share/estonian/errmsg.txt: no new message in 4.1 (causes merge issues with 5.0) sql/share/french/errmsg.txt: no new message in 4.1 (causes merge issues with 5.0) sql/share/german/errmsg.txt: no new message in 4.1 (causes merge issues with 5.0) sql/share/greek/errmsg.txt: no new message in 4.1 (causes merge issues with 5.0) sql/share/hungarian/errmsg.txt: no new message in 4.1 (causes merge issues with 5.0) sql/share/italian/errmsg.txt: no new message in 4.1 (causes merge issues with 5.0) sql/share/japanese/errmsg.txt: no new message in 4.1 (causes merge issues with 5.0) sql/share/korean/errmsg.txt: no new message in 4.1 (causes merge issues with 5.0) sql/share/norwegian-ny/errmsg.txt: no new message in 4.1 (causes merge issues with 5.0) sql/share/norwegian/errmsg.txt: no new message in 4.1 (causes merge issues with 5.0) sql/share/polish/errmsg.txt: no new message in 4.1 (causes merge issues with 5.0) sql/share/portuguese/errmsg.txt: no new message in 4.1 (causes merge issues with 5.0) sql/share/romanian/errmsg.txt: no new message in 4.1 (causes merge issues with 5.0) sql/share/russian/errmsg.txt: no new message in 4.1 (causes merge issues with 5.0) sql/share/serbian/errmsg.txt: no new message in 4.1 (causes merge issues with 5.0) sql/share/slovak/errmsg.txt: no new message in 4.1 (causes merge issues with 5.0) sql/share/spanish/errmsg.txt: no new message in 4.1 (causes merge issues with 5.0) sql/share/swedish/errmsg.txt: no new message in 4.1 (causes merge issues with 5.0) sql/share/ukrainian/errmsg.txt: no new message in 4.1 (causes merge issues with 5.0) --- include/mysqld_error.h | 3 +-- sql/handler.cc | 5 +++-- sql/share/czech/errmsg.txt | 1 - sql/share/danish/errmsg.txt | 1 - sql/share/dutch/errmsg.txt | 1 - sql/share/english/errmsg.txt | 1 - sql/share/estonian/errmsg.txt | 1 - sql/share/french/errmsg.txt | 1 - sql/share/german/errmsg.txt | 1 - sql/share/greek/errmsg.txt | 1 - sql/share/hungarian/errmsg.txt | 1 - sql/share/italian/errmsg.txt | 1 - sql/share/japanese/errmsg.txt | 1 - sql/share/korean/errmsg.txt | 1 - sql/share/norwegian-ny/errmsg.txt | 1 - sql/share/norwegian/errmsg.txt | 1 - sql/share/polish/errmsg.txt | 1 - sql/share/portuguese/errmsg.txt | 1 - sql/share/romanian/errmsg.txt | 1 - sql/share/russian/errmsg.txt | 1 - sql/share/serbian/errmsg.txt | 1 - sql/share/slovak/errmsg.txt | 1 - sql/share/spanish/errmsg.txt | 1 - sql/share/swedish/errmsg.txt | 1 - sql/share/ukrainian/errmsg.txt | 1 - 25 files changed, 4 insertions(+), 27 deletions(-) diff --git a/include/mysqld_error.h b/include/mysqld_error.h index 67c2b0aba73..776869ff045 100644 --- a/include/mysqld_error.h +++ b/include/mysqld_error.h @@ -319,5 +319,4 @@ #define ER_INVALID_CHARACTER_STRING 1300 #define ER_WARN_ALLOWED_PACKET_OVERFLOWED 1301 #define ER_CONFLICTING_DECLARATIONS 1302 -#define ER_NO_CONS_READ_ENGINE 1303 -#define ER_ERROR_MESSAGES 304 +#define ER_ERROR_MESSAGES 303 diff --git a/sql/handler.cc b/sql/handler.cc index 32f5ad6ff1d..c1a105a4633 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -785,8 +785,9 @@ int ha_start_consistent_snapshot(THD *thd) Same idea as when one wants to CREATE TABLE in one engine which does not exist: */ - push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, - ER_NO_CONS_READ_ENGINE, ER(ER_NO_CONS_READ_ENGINE)); + push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, ER_UNKNOWN_ERROR, + "This MySQL server does not support any " + "consistent-read capable storage engine"); return 0; } diff --git a/sql/share/czech/errmsg.txt b/sql/share/czech/errmsg.txt index d352a6e82f7..022a624c921 100644 --- a/sql/share/czech/errmsg.txt +++ b/sql/share/czech/errmsg.txt @@ -331,4 +331,3 @@ character-set=latin2 "Invalid %s character string: '%.64s'", "Result of %s() was larger than max_allowed_packet (%ld) - truncated" "Conflicting declarations: '%s%s' and '%s%s'" -"This MySQL server does not support any consistent-read capable storage engine" diff --git a/sql/share/danish/errmsg.txt b/sql/share/danish/errmsg.txt index e84ee22d5cf..18ebe5712f8 100644 --- a/sql/share/danish/errmsg.txt +++ b/sql/share/danish/errmsg.txt @@ -322,4 +322,3 @@ character-set=latin1 "Invalid %s character string: '%.64s'", "Result of %s() was larger than max_allowed_packet (%ld) - truncated" "Conflicting declarations: '%s%s' and '%s%s'" -"This MySQL server does not support any consistent-read capable storage engine" diff --git a/sql/share/dutch/errmsg.txt b/sql/share/dutch/errmsg.txt index d9d33c3bf59..54377b5949a 100644 --- a/sql/share/dutch/errmsg.txt +++ b/sql/share/dutch/errmsg.txt @@ -331,4 +331,3 @@ character-set=latin1 "Invalid %s character string: '%.64s'", "Result of %s() was larger than max_allowed_packet (%ld) - truncated" "Conflicting declarations: '%s%s' and '%s%s'" -"This MySQL server does not support any consistent-read capable storage engine" diff --git a/sql/share/english/errmsg.txt b/sql/share/english/errmsg.txt index fd43a2c10c5..8ede3f61a0b 100644 --- a/sql/share/english/errmsg.txt +++ b/sql/share/english/errmsg.txt @@ -319,4 +319,3 @@ character-set=latin1 "Invalid %s character string: '%.64s'", "Result of %s() was larger than max_allowed_packet (%ld) - truncated" "Conflicting declarations: '%s%s' and '%s%s'" -"This MySQL server does not support any consistent-read capable storage engine" diff --git a/sql/share/estonian/errmsg.txt b/sql/share/estonian/errmsg.txt index ae4d5279f35..5aab524e0d9 100644 --- a/sql/share/estonian/errmsg.txt +++ b/sql/share/estonian/errmsg.txt @@ -324,4 +324,3 @@ character-set=latin7 "Invalid %s character string: '%.64s'", "Result of %s() was larger than max_allowed_packet (%ld) - truncated" "Conflicting declarations: '%s%s' and '%s%s'" -"This MySQL server does not support any consistent-read capable storage engine" diff --git a/sql/share/french/errmsg.txt b/sql/share/french/errmsg.txt index 5217133274b..355e784b156 100644 --- a/sql/share/french/errmsg.txt +++ b/sql/share/french/errmsg.txt @@ -319,4 +319,3 @@ character-set=latin1 "Invalid %s character string: '%.64s'", "Result of %s() was larger than max_allowed_packet (%ld) - truncated" "Conflicting declarations: '%s%s' and '%s%s'" -"This MySQL server does not support any consistent-read capable storage engine" diff --git a/sql/share/german/errmsg.txt b/sql/share/german/errmsg.txt index 15f98d36e87..03e838dd805 100644 --- a/sql/share/german/errmsg.txt +++ b/sql/share/german/errmsg.txt @@ -332,4 +332,3 @@ character-set=latin1 "Invalid %s character string: '%.64s'", "Result of %s() was larger than max_allowed_packet (%ld) - truncated" "Conflicting declarations: '%s%s' and '%s%s'" -"This MySQL server does not support any consistent-read capable storage engine" diff --git a/sql/share/greek/errmsg.txt b/sql/share/greek/errmsg.txt index fae5c508320..06f31a79a73 100644 --- a/sql/share/greek/errmsg.txt +++ b/sql/share/greek/errmsg.txt @@ -319,4 +319,3 @@ character-set=greek "Invalid %s character string: '%.64s'", "Result of %s() was larger than max_allowed_packet (%ld) - truncated" "Conflicting declarations: '%s%s' and '%s%s'" -"This MySQL server does not support any consistent-read capable storage engine" diff --git a/sql/share/hungarian/errmsg.txt b/sql/share/hungarian/errmsg.txt index 6f83de7a64d..af10c33ee2d 100644 --- a/sql/share/hungarian/errmsg.txt +++ b/sql/share/hungarian/errmsg.txt @@ -324,4 +324,3 @@ character-set=latin2 "Invalid %s character string: '%.64s'", "Result of %s() was larger than max_allowed_packet (%ld) - truncated" "Conflicting declarations: '%s%s' and '%s%s'" -"This MySQL server does not support any consistent-read capable storage engine" diff --git a/sql/share/italian/errmsg.txt b/sql/share/italian/errmsg.txt index 7df71e92fc4..cd66f15db5f 100644 --- a/sql/share/italian/errmsg.txt +++ b/sql/share/italian/errmsg.txt @@ -319,4 +319,3 @@ character-set=latin1 "Invalid %s character string: '%.64s'", "Result of %s() was larger than max_allowed_packet (%ld) - truncated" "Conflicting declarations: '%s%s' and '%s%s'" -"This MySQL server does not support any consistent-read capable storage engine" diff --git a/sql/share/japanese/errmsg.txt b/sql/share/japanese/errmsg.txt index 9fc2ead10d6..eaab58d8403 100644 --- a/sql/share/japanese/errmsg.txt +++ b/sql/share/japanese/errmsg.txt @@ -323,4 +323,3 @@ character-set=ujis "Invalid %s character string: '%.64s'", "Result of %s() was larger than max_allowed_packet (%ld) - truncated" "Conflicting declarations: '%s%s' and '%s%s'" -"This MySQL server does not support any consistent-read capable storage engine" diff --git a/sql/share/korean/errmsg.txt b/sql/share/korean/errmsg.txt index 4e40ffc6264..1cff50432e9 100644 --- a/sql/share/korean/errmsg.txt +++ b/sql/share/korean/errmsg.txt @@ -319,4 +319,3 @@ character-set=euckr "Invalid %s character string: '%.64s'", "Result of %s() was larger than max_allowed_packet (%ld) - truncated" "Conflicting declarations: '%s%s' and '%s%s'" -"This MySQL server does not support any consistent-read capable storage engine" diff --git a/sql/share/norwegian-ny/errmsg.txt b/sql/share/norwegian-ny/errmsg.txt index d78c59357f1..27f7a18f029 100644 --- a/sql/share/norwegian-ny/errmsg.txt +++ b/sql/share/norwegian-ny/errmsg.txt @@ -321,4 +321,3 @@ character-set=latin1 "Invalid %s character string: '%.64s'", "Result of %s() was larger than max_allowed_packet (%ld) - truncated" "Conflicting declarations: '%s%s' and '%s%s'" -"This MySQL server does not support any consistent-read capable storage engine" diff --git a/sql/share/norwegian/errmsg.txt b/sql/share/norwegian/errmsg.txt index d0a282c444d..772f30e5d94 100644 --- a/sql/share/norwegian/errmsg.txt +++ b/sql/share/norwegian/errmsg.txt @@ -321,4 +321,3 @@ character-set=latin1 "Invalid %s character string: '%.64s'", "Result of %s() was larger than max_allowed_packet (%ld) - truncated" "Conflicting declarations: '%s%s' and '%s%s'" -"This MySQL server does not support any consistent-read capable storage engine" diff --git a/sql/share/polish/errmsg.txt b/sql/share/polish/errmsg.txt index de812697482..634a4d93f42 100644 --- a/sql/share/polish/errmsg.txt +++ b/sql/share/polish/errmsg.txt @@ -324,4 +324,3 @@ character-set=latin2 "Invalid %s character string: '%.64s'", "Result of %s() was larger than max_allowed_packet (%ld) - truncated" "Conflicting declarations: '%s%s' and '%s%s'" -"This MySQL server does not support any consistent-read capable storage engine" diff --git a/sql/share/portuguese/errmsg.txt b/sql/share/portuguese/errmsg.txt index 262c472a4fa..c79c346008e 100644 --- a/sql/share/portuguese/errmsg.txt +++ b/sql/share/portuguese/errmsg.txt @@ -321,4 +321,3 @@ character-set=latin1 "Invalid %s character string: '%.64s'", "Result of %s() was larger than max_allowed_packet (%ld) - truncated" "Conflicting declarations: '%s%s' and '%s%s'" -"This MySQL server does not support any consistent-read capable storage engine" diff --git a/sql/share/romanian/errmsg.txt b/sql/share/romanian/errmsg.txt index 377ebfbf698..7cb0427dc3f 100644 --- a/sql/share/romanian/errmsg.txt +++ b/sql/share/romanian/errmsg.txt @@ -324,4 +324,3 @@ character-set=latin2 "Invalid %s character string: '%.64s'", "Result of %s() was larger than max_allowed_packet (%ld) - truncated" "Conflicting declarations: '%s%s' and '%s%s'" -"This MySQL server does not support any consistent-read capable storage engine" diff --git a/sql/share/russian/errmsg.txt b/sql/share/russian/errmsg.txt index 4edfd39c836..df354d5797f 100644 --- a/sql/share/russian/errmsg.txt +++ b/sql/share/russian/errmsg.txt @@ -324,4 +324,3 @@ character-set=koi8r "Invalid %s character string: '%.64s'", "Result of %s() was larger than max_allowed_packet (%ld) - truncated" "Conflicting declarations: '%s%s' and '%s%s'" -"This MySQL server does not support any consistent-read capable storage engine" diff --git a/sql/share/serbian/errmsg.txt b/sql/share/serbian/errmsg.txt index e18fa6d2811..45b56c8269c 100644 --- a/sql/share/serbian/errmsg.txt +++ b/sql/share/serbian/errmsg.txt @@ -312,4 +312,3 @@ character-set=cp1250 "Invalid %s character string: '%.64s'", "Result of %s() was larger than max_allowed_packet (%ld) - truncated" "Conflicting declarations: '%s%s' and '%s%s'" -"This MySQL server does not support any consistent-read capable storage engine" diff --git a/sql/share/slovak/errmsg.txt b/sql/share/slovak/errmsg.txt index d935439a1ba..12c3eb2b6af 100644 --- a/sql/share/slovak/errmsg.txt +++ b/sql/share/slovak/errmsg.txt @@ -327,4 +327,3 @@ character-set=latin2 "Invalid %s character string: '%.64s'", "Result of %s() was larger than max_allowed_packet (%ld) - truncated" "Conflicting declarations: '%s%s' and '%s%s'" -"This MySQL server does not support any consistent-read capable storage engine" diff --git a/sql/share/spanish/errmsg.txt b/sql/share/spanish/errmsg.txt index 97fb1bf0be5..bd2439c44a6 100644 --- a/sql/share/spanish/errmsg.txt +++ b/sql/share/spanish/errmsg.txt @@ -323,4 +323,3 @@ character-set=latin1 "Invalid %s character string: '%.64s'", "Result of %s() was larger than max_allowed_packet (%ld) - truncated" "Conflicting declarations: '%s%s' and '%s%s'" -"This MySQL server does not support any consistent-read capable storage engine" diff --git a/sql/share/swedish/errmsg.txt b/sql/share/swedish/errmsg.txt index 8de68600509..da75e4fcede 100644 --- a/sql/share/swedish/errmsg.txt +++ b/sql/share/swedish/errmsg.txt @@ -319,4 +319,3 @@ character-set=latin1 "Invalid %s character string: '%.64s'", "Result of %s() was larger than max_allowed_packet (%ld) - truncated" "Conflicting declarations: '%s%s' and '%s%s'" -"This MySQL server does not support any consistent-read capable storage engine" diff --git a/sql/share/ukrainian/errmsg.txt b/sql/share/ukrainian/errmsg.txt index cf44fea6553..a19cf946cb1 100644 --- a/sql/share/ukrainian/errmsg.txt +++ b/sql/share/ukrainian/errmsg.txt @@ -325,4 +325,3 @@ character-set=koi8u "Invalid %s character string: '%.64s'", "Result of %s() was larger than max_allowed_packet (%ld) - truncated" "Conflicting declarations: '%s%s' and '%s%s'" -"This MySQL server does not support any consistent-read capable storage engine" From bdea2dc949a30a8f9a3a9b28a8f9ffe0e8c32029 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 10 Nov 2004 22:43:09 -0600 Subject: [PATCH 0173/1063] fill_help_tables.sh: Handle some additional Texinfo tags that were being missed. scripts/fill_help_tables.sh: Handle some additional Texinfo tags that were being missed. --- scripts/fill_help_tables.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/fill_help_tables.sh b/scripts/fill_help_tables.sh index cb5437f7178..1f44e9fa488 100644 --- a/scripts/fill_help_tables.sh +++ b/scripts/fill_help_tables.sh @@ -197,6 +197,9 @@ sub prepare_name $a =~ s/(\@node(.*?)\n)/ /g; $a =~ s/(\@tab)/\t/g; $a =~ s/\@item/ /g; + $a =~ s/\@minus\{\}/-/g; + $a =~ s/\@var\{((.|\n)+?)\}/$1/go; + $a =~ s/\@command\{((.|\n)+?)\}/$1/go; $a =~ s/\@code\{((.|\n)+?)\}/$1/go; $a =~ s/\@strong\{(.+?)\}/$1/go; $a =~ s/\@samp\{(.+?)\}/$1/go; @@ -244,6 +247,9 @@ sub prepare_description $a =~ s/(\@item)/ /g; $a =~ s/(\@tindex\s(.*?)\n)//g; $a =~ s/(\@c\s(.*?)\n)//g; + $a =~ s/\@minus\{\}/-/g; + $a =~ s/\@var\{((.|\n)+?)\}/$1/go; + $a =~ s/\@command\{((.|\n)+?)\}/$1/go; $a =~ s/\@code\{((.|\n)+?)\}/$1/go; $a =~ s/\@strong\{(.+?)\}/$1/go; $a =~ s/\@samp\{(.+?)\}/$1/go; @@ -273,6 +279,7 @@ sub prepare_example $a =~ s/(^\@c for_help_topic(.*?)\n)//g; + $a =~ s/\@var\{((.|\n)+?)\}/$1/go; $a =~ s/\\/\\\\/g; $a =~ s/(\@{)/{/g; $a =~ s/(\@})/}/g; From 02d8fa295202649863fef5f9d6eadde8dee51a06 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 11 Nov 2004 10:50:46 +0400 Subject: [PATCH 0174/1063] Added ending ';' for the start_transaction_opts: --- sql/sql_yacc.yy | 1 + 1 file changed, 1 insertion(+) diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 1852101fcfb..7fa6549686b 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -2111,6 +2111,7 @@ start_transaction_opts: { $$= MYSQL_START_TRANS_OPT_WITH_CONS_SNAPSHOT; } + ; slave_thread_opts: { Lex->slave_thd_opt= 0; } From d55be176d78a9cf853a92280b577fd2d33869bfb Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 11 Nov 2004 08:15:52 +0100 Subject: [PATCH 0175/1063] wl1744- ndb windows move ports into ndb_global BitKeeper/deleted/.del-ndb_version.h~c759dd144f698ea: Delete: ndb/include/ndb_version.h BitKeeper/deleted/.del-ndb_global.h~c4762a8c8f5136c6: Delete: ndb/include/ndb_global.h configure.in: also generate ndb_global ndb/include/ndb_types.h: fix ndb/src/common/mgmcommon/Makefile.am: put port into ndb_global ndb/src/mgmsrv/ConfigInfo.cpp: win ndb/src/mgmsrv/Makefile.am: moved ports into ndb_global ndb/src/ndbapi/ndberror.c: use my_snprintf --- configure.in | 2 +- ndb/include/{ndb_global.h => ndb_global.h.in} | 4 ++ ndb/include/ndb_types.h | 14 ++++--- ndb/include/ndb_version.h | 42 ------------------- ndb/src/common/mgmcommon/Makefile.am | 2 - ndb/src/mgmsrv/ConfigInfo.cpp | 4 +- ndb/src/mgmsrv/Makefile.am | 4 +- ndb/src/ndbapi/ndberror.c | 9 ++-- 8 files changed, 21 insertions(+), 60 deletions(-) rename ndb/include/{ndb_global.h => ndb_global.h.in} (93%) delete mode 100644 ndb/include/ndb_version.h diff --git a/configure.in b/configure.in index 4d7640f206f..55cd7edfca8 100644 --- a/configure.in +++ b/configure.in @@ -3132,6 +3132,7 @@ AC_CONFIG_FILES(ndb/Makefile ndb/include/Makefile dnl ndb/test/ndbapi/bank/Makefile dnl ndb/test/tools/Makefile dnl ndb/test/run-test/Makefile mysql-test/ndb/Makefile dnl + ndb/include/ndb_version.h ndb/include/ndb_global.h dnl ) fi @@ -3153,7 +3154,6 @@ AC_CONFIG_FILES(Makefile extra/Makefile mysys/Makefile dnl support-files/MacOSX/Makefile mysql-test/Makefile dnl netware/Makefile dnl include/mysql_version.h dnl - ndb/include/ndb_version.h dnl cmd-line-utils/Makefile dnl cmd-line-utils/libedit/Makefile dnl zlib/Makefile dnl diff --git a/ndb/include/ndb_global.h b/ndb/include/ndb_global.h.in similarity index 93% rename from ndb/include/ndb_global.h rename to ndb/include/ndb_global.h.in index 775d69b38e5..af7f9383461 100644 --- a/ndb/include/ndb_global.h +++ b/ndb/include/ndb_global.h.in @@ -4,6 +4,9 @@ #include +#define NDB_PORT "@ndb_port@" +#define NDB_TCP_BASE_PORT "@ndb_port_base@" + #if defined(_WIN32) || defined(_WIN64) || defined(__WIN32__) || defined(WIN32) #define NDB_WIN32 #include @@ -12,6 +15,7 @@ #define PATH_MAX 256 #define DIR_SEPARATOR "\\" +#define MYSQLCLUSTERDIR "c:\\mysql\\mysql-cluster" #pragma warning(disable: 4503 4786) diff --git a/ndb/include/ndb_types.h b/ndb/include/ndb_types.h index b5db23946f0..0d603cc2ab3 100644 --- a/ndb/include/ndb_types.h +++ b/ndb/include/ndb_types.h @@ -41,16 +41,20 @@ typedef __SIZE_TYPE__ UintPtr; #include #endif #if defined(WIN32) || defined(NDB_WIN32) -typedef unsigned __int64 Uint64; -typedef signed __int64 Int64; typedef Uint32 UintPtr; -typedef UintPtr ssize_t; #else -typedef unsigned long long Uint64; -typedef signed long long Int64; typedef uintptr_t UintPtr; #endif #endif +#if defined(WIN32) || defined(NDB_WIN32) +typedef unsigned __int64 Uint64; +typedef signed __int64 Int64; +typedef UintPtr ssize_t; +#else +typedef unsigned long long Uint64; +typedef signed long long Int64; +#endif + #endif diff --git a/ndb/include/ndb_version.h b/ndb/include/ndb_version.h deleted file mode 100644 index 56362020ebf..00000000000 --- a/ndb/include/ndb_version.h +++ /dev/null @@ -1,42 +0,0 @@ -/* Copyright (C) 2003 MySQL AB - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - -#ifndef NDB_VERSION_H -#define NDB_VERSION_H - -#include -#include - -#define MAKE_VERSION(A,B,C) (((A) << 16) | ((B) << 8) | ((C) << 0)) - -#define NDB_VERSION_D MAKE_VERSION(NDB_VERSION_MAJOR, NDB_VERSION_MINOR, NDB_VERSION_BUILD) - -#define NDB_VERSION_STRING (getVersionString(NDB_VERSION, NDB_VERSION_STATUS)) - -#define NDB_VERSION_TAG_STRING "$Name: $" - -#define NDB_VERSION ndbGetOwnVersion() - -/** - * Version id - * - * Used by transporter and when communicating with - * managment server - */ -/*#define NDB_VERSION_ID 0*/ - -#endif - diff --git a/ndb/src/common/mgmcommon/Makefile.am b/ndb/src/common/mgmcommon/Makefile.am index 995fda3654d..ebb89f8a251 100644 --- a/ndb/src/common/mgmcommon/Makefile.am +++ b/ndb/src/common/mgmcommon/Makefile.am @@ -7,8 +7,6 @@ libmgmsrvcommon_la_SOURCES = \ INCLUDES_LOC = -I$(top_srcdir)/ndb/src/mgmapi -I$(top_srcdir)/ndb/src/mgmsrv -DEFS_LOC = -DNDB_PORT="\"@ndb_port@\"" - include $(top_srcdir)/ndb/config/common.mk.am include $(top_srcdir)/ndb/config/type_ndbapi.mk.am include $(top_srcdir)/ndb/config/type_mgmapiclient.mk.am diff --git a/ndb/src/mgmsrv/ConfigInfo.cpp b/ndb/src/mgmsrv/ConfigInfo.cpp index e88e487b689..41280b907c4 100644 --- a/ndb/src/mgmsrv/ConfigInfo.cpp +++ b/ndb/src/mgmsrv/ConfigInfo.cpp @@ -3011,7 +3011,7 @@ fixPortNumber(InitConfigFileParser::Context & ctx, const char * data){ if(!(ctx.m_userDefaults && ctx.m_userDefaults->get("PortNumber", &base)) && !ctx.m_systemDefaults->get("PortNumber", &base)) { - base= strtoll(NDB_BASE_PORT,0,0); + base= strtoll(NDB_TCP_BASE_PORT,0,0); // ctx.reportError("Cannot retrieve base port number"); // return false; } @@ -3443,7 +3443,7 @@ static bool add_server_ports(Vector§ions, #if 0 Properties * props= ctx.m_config; Properties computers(true); - Uint32 port_base = NDB_BASE_PORT; + Uint32 port_base = NDB_TCP_BASE_PORT; Uint32 nNodes; ctx.m_userProperties.get("NoOfNodes", &nNodes); diff --git a/ndb/src/mgmsrv/Makefile.am b/ndb/src/mgmsrv/Makefile.am index a6000c24d97..4b66e3cc7bc 100644 --- a/ndb/src/mgmsrv/Makefile.am +++ b/ndb/src/mgmsrv/Makefile.am @@ -32,9 +32,7 @@ LDADD_LOC = $(top_builddir)/ndb/src/libndbclient.la \ DEFS_LOC = -DDEFAULT_MYSQL_HOME="\"$(MYSQLBASEdir)\"" \ -DDATADIR="\"$(MYSQLDATAdir)\"" \ -DSHAREDIR="\"$(MYSQLSHAREdir)\"" \ - -DMYSQLCLUSTERDIR="\"$(MYSQLCLUSTERdir)\"" \ - -DNDB_PORT="\"@ndb_port@\"" \ - -DNDB_BASE_PORT="\"@ndb_port_base@\"" + -DMYSQLCLUSTERDIR="\"$(MYSQLCLUSTERdir)\"" include $(top_srcdir)/ndb/config/common.mk.am include $(top_srcdir)/ndb/config/type_ndbapi.mk.am diff --git a/ndb/src/ndbapi/ndberror.c b/ndb/src/ndbapi/ndberror.c index d293df0303b..750ed720f78 100644 --- a/ndb/src/ndbapi/ndberror.c +++ b/ndb/src/ndbapi/ndberror.c @@ -17,7 +17,6 @@ #include #include -#include typedef struct ErrorBundle { int code; @@ -595,10 +594,10 @@ int ndb_error_string(int err_no, char *str, unsigned int size) ndberror_update(&error); len = - basestring_snprintf(str, size-1, "%s: %s: %s", error.message, - ndberror_status_message(error.status), - ndberror_classification_message(error.classification)); + my_snprintf(str, size-1, "%s: %s: %s", error.message, + ndberror_status_message(error.status), + ndberror_classification_message(error.classification)); str[size-1]= '\0'; - + return len; } From d2a3420dd363eba298f4544bb58a8b9860477bb5 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 11 Nov 2004 12:35:55 +0400 Subject: [PATCH 0176/1063] A fix (bug #6551: UMASK_DIR & UMASK not taken into account (mysqld.cc my_init.c inconsistency)). my_umask and my_umask_dir initialization has been moved to the my_init() func. mysys/my_init.c: A fix (bug #6551: UMASK_DIR & UMASK not taken into account (mysqld.cc my_init.c inconsistency)) sql/mysqld.cc: A fix (bug #6551: UMASK_DIR & UMASK not taken into account (mysqld.cc my_init.c inconsistency)) --- mysys/my_init.c | 2 ++ sql/mysqld.cc | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mysys/my_init.c b/mysys/my_init.c index e9a61b1833c..c32fcfe6a09 100644 --- a/mysys/my_init.c +++ b/mysys/my_init.c @@ -75,6 +75,8 @@ my_bool my_init(void) return 0; my_init_done=1; mysys_usage_id++; + my_umask= 0660; /* Default umask for new files */ + my_umask_dir= 0700; /* Default umask for new directories */ #if defined(THREAD) && defined(SAFE_MUTEX) safe_mutex_global_init(); /* Must be called early */ #endif diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 5622ac50a7b..4b70e8552b5 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -2305,8 +2305,6 @@ bool init_global_datetime_format(timestamp_type format_type, static int init_common_variables(const char *conf_file_name, int argc, char **argv, const char **groups) { - my_umask=0660; // Default umask for new files - my_umask_dir=0700; // Default umask for new directories umask(((~my_umask) & 0666)); tzset(); // Set tzname From f1b82eb2fa9fe39827154ac61c0d47ad4240e6c2 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 11 Nov 2004 10:24:16 +0100 Subject: [PATCH 0177/1063] Fix for autobuild failure: forgotten ';' (bison 1.875 accepts if it's not there, but 1.75 does not) sql/sql_yacc.yy: forgotten ';' (bison 1.875 accepts if it's not there, but 1.75 does not) --- sql/sql_yacc.yy | 1 + 1 file changed, 1 insertion(+) diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 1852101fcfb..7fa6549686b 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -2111,6 +2111,7 @@ start_transaction_opts: { $$= MYSQL_START_TRANS_OPT_WITH_CONS_SNAPSHOT; } + ; slave_thread_opts: { Lex->slave_thd_opt= 0; } From 8d072e64d25ae638abaeec7cd76a4e138884c260 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 11 Nov 2004 10:05:28 +0000 Subject: [PATCH 0178/1063] added ndb error codes and better explanations --- ndb/src/ndbapi/ndberror.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/ndb/src/ndbapi/ndberror.c b/ndb/src/ndbapi/ndberror.c index 17a80082023..b0e59e9ead2 100644 --- a/ndb/src/ndbapi/ndberror.c +++ b/ndb/src/ndbapi/ndberror.c @@ -124,7 +124,8 @@ ErrorBundle ErrorCodes[] = { { 217, TR, "217" }, { 218, TR, "218" }, { 219, TR, "219" }, - { 233, TR, "Out of operation records in transaction coordinator" }, + { 233, TR, + "Out of operation records in transaction coordinator (increase MaxNoOfConcurrentOperations)" }, { 275, TR, "275" }, { 279, TR, "Out of transaction markers in transaction coordinator" }, { 414, TR, "414" }, @@ -137,7 +138,7 @@ ErrorBundle ErrorCodes[] = { { 830, TR, "Out of add fragment operation records" }, { 873, TR, "Out of attrinfo records for scan in tuple manager" }, { 1217, TR, "1217" }, - { 1219, TR, "Out of operation records in local data manager" }, + { 1219, TR, "Out of operation records in local data manager (increase MaxNoOfLocalOperations)" }, { 1220, TR, "1220" }, { 1222, TR, "Out of transaction markers in LQH" }, { 4021, TR, "Out of Send Buffer space in NDB API" }, @@ -149,9 +150,10 @@ ErrorBundle ErrorCodes[] = { */ { 623, IS, "623" }, { 624, IS, "624" }, - { 625, IS, "Out of memory in Ndb Kernel, index part" }, + { 625, IS, "Out of memory in Ndb Kernel, index part (increase IndexMemory)" }, + { 800, IS, "Too many ordered indexes (increase MaxNoOfOrderedIndexes)" }, { 826, IS, "Too many tables and attributes (increase MaxNoOfAttributes)" }, - { 827, IS, "Out of memory in Ndb Kernel, data part" }, + { 827, IS, "Out of memory in Ndb Kernel, data part (increase DataMemory)" }, { 832, IS, "832" }, /** @@ -168,10 +170,10 @@ ErrorBundle ErrorCodes[] = { * OverloadError */ { 410, OL, "Out of log file space temporarily" }, - { 677, OL, "Index UNDO buffers overloaded" }, - { 891, OL, "Data UNDO buffers overloaded" }, - { 1221, OL, "REDO log buffers overloaded" }, - { 4006, OL, "Connect failure - out of connection objects" }, + { 677, OL, "Index UNDO buffers overloaded (increase UndoIndexBuffer)" }, + { 891, OL, "Data UNDO buffers overloaded (increase UndoDataBuffer)" }, + { 1221, OL, "REDO log buffers overloaded (increase RedoBuffer)" }, + { 4006, OL, "Connect failure - out of connection objects (increase MaxNoOfConcurrentTransactions)" }, @@ -241,9 +243,9 @@ ErrorBundle ErrorCodes[] = { { 884, AE, "Stack overflow in interpreter" }, { 885, AE, "Stack underflow in interpreter" }, { 886, AE, "More than 65535 instructions executed in interpreter" }, - { 4256, AE, "Must call Ndb::init() before this function" }, + { 4256, AE, "Must call Ndb::init() before this function" }, { 880, AE, "Tried to read too much - too many getValue calls" }, - { 4257, AE, "Tried to read too much - too many getValue calls" }, + { 4257, AE, "Tried to read too much - too many getValue calls" }, /** * Scan application errors From 784a9a9fdac59fa5683754c6e952e9d939183bee Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 11 Nov 2004 11:08:37 +0000 Subject: [PATCH 0179/1063] ndbcluster.sh: fixed typo mysql-test/ndb/ndbcluster.sh: fixed typo --- mysql-test/ndb/ndbcluster.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/ndb/ndbcluster.sh b/mysql-test/ndb/ndbcluster.sh index 3486a879eec..60188705857 100644 --- a/mysql-test/ndb/ndbcluster.sh +++ b/mysql-test/ndb/ndbcluster.sh @@ -36,7 +36,7 @@ else exec_mgmtsrvr=$BASEDIR/bin/ndb_mgmd fi exec_waiter=$BASEDIR/bin/ndb_waiter - exec_waiter=$BASEDIR/bin/ndb_test_platform + exec_test=$BASEDIR/bin/ndb_test_platform exec_mgmtclient=$BASEDIR/bin/ndb_mgm fi From ac083bb68886305a2e28964c08b8217a60ac2432 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 11 Nov 2004 14:59:13 +0200 Subject: [PATCH 0180/1063] Write fatal errors even if silent is used in client_test mysql-test/t/client_test.test: Fix crash when user has a conflicting defaults file tests/client_test.c: Write fatal errors even if silent is used --- mysql-test/t/client_test.test | 2 +- tests/client_test.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/mysql-test/t/client_test.test b/mysql-test/t/client_test.test index 830c5f1b8a2..66f5e69eb36 100644 --- a/mysql-test/t/client_test.test +++ b/mysql-test/t/client_test.test @@ -1,2 +1,2 @@ --disable_result_log ---exec $TESTS_BINDIR/client_test --testcase --user=root --socket=$MASTER_MYSOCK --port=$MYSQL_TCP_PORT --silent +--exec $TESTS_BINDIR/client_test --no-defaults --testcase --user=root --socket=$MASTER_MYSOCK --port=$MYSQL_TCP_PORT --silent diff --git a/tests/client_test.c b/tests/client_test.c index 3c5598ee75a..45d66a92977 100644 --- a/tests/client_test.c +++ b/tests/client_test.c @@ -215,6 +215,7 @@ static void client_connect() if (!(mysql= mysql_init(NULL))) { + opt_silent= 0; myerror("mysql_init() failed"); exit(1); } @@ -223,6 +224,7 @@ static void client_connect() opt_password, opt_db ? opt_db:"test", opt_port, opt_unix_socket, 0))) { + opt_silent= 0; myerror("connection failed"); mysql_close(mysql); fprintf(stdout, "\n Check the connection options using --help or -?\n"); From 3048dc0fa263ee1654d94753cf048212d565d7b4 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 11 Nov 2004 13:22:33 +0000 Subject: [PATCH 0181/1063] forgot a return 0 removed some errorcodes not used ndb/src/mgmclient/CommandInterpreter.cpp: forgot a return 0 ndb/src/ndbapi/ndberror.c: removed some errorcodes not used --- ndb/src/mgmclient/CommandInterpreter.cpp | 1 + ndb/src/ndbapi/ndberror.c | 10 ++-------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/ndb/src/mgmclient/CommandInterpreter.cpp b/ndb/src/mgmclient/CommandInterpreter.cpp index f1a953769b8..fde4e5a2e91 100644 --- a/ndb/src/mgmclient/CommandInterpreter.cpp +++ b/ndb/src/mgmclient/CommandInterpreter.cpp @@ -200,6 +200,7 @@ extern "C" { int ndb_mgmclient_handle_destroy(Ndb_mgmclient_handle h) { delete (Ndb_mgmclient*)h; + return 0; } } /* diff --git a/ndb/src/ndbapi/ndberror.c b/ndb/src/ndbapi/ndberror.c index b0e59e9ead2..1a0d8132d71 100644 --- a/ndb/src/ndbapi/ndberror.c +++ b/ndb/src/ndbapi/ndberror.c @@ -152,7 +152,7 @@ ErrorBundle ErrorCodes[] = { { 624, IS, "624" }, { 625, IS, "Out of memory in Ndb Kernel, index part (increase IndexMemory)" }, { 800, IS, "Too many ordered indexes (increase MaxNoOfOrderedIndexes)" }, - { 826, IS, "Too many tables and attributes (increase MaxNoOfAttributes)" }, + { 826, IS, "Too many tables and attributes (increase MaxNoOfAttributes or MaxNoOfTables)" }, { 827, IS, "Out of memory in Ndb Kernel, data part (increase DataMemory)" }, { 832, IS, "832" }, @@ -290,7 +290,7 @@ ErrorBundle ErrorCodes[] = { { 283, SE, "Table is being dropped" }, { 284, SE, "Table not defined in transaction coordinator" }, { 285, SE, "Unknown table error in transaction coordinator" }, - { 881, SE, "Unable to create table, out of data pages" }, + { 881, SE, "Unable to create table, out of data pages (increase DataMemory) " }, { 1225, SE, "Table not defined in local query handler" }, { 1226, SE, "Table is being dropped" }, { 1228, SE, "Cannot use drop table for drop index" }, @@ -346,17 +346,11 @@ ErrorBundle ErrorCodes[] = { { 4327, AE, "Distribution Group with 1 byte attribute is not allowed" }, { 4328, AE, "Disk memory attributes not yet supported" }, { 4329, AE, "Variable stored attributes not yet supported" }, - { 4330, AE, "Table names limited to 127 bytes" }, - { 4331, AE, "Attribute names limited to 31 bytes" }, - { 4332, AE, "Maximum 2000 attributes in a table" }, - { 4333, AE, "Maximum 4092 bytes long keys allowed" }, - { 4334, AE, "Attribute properties length limited to 127 bytes" }, { 4400, AE, "Status Error in NdbSchemaCon" }, { 4401, AE, "Only one schema operation per schema transaction" }, { 4402, AE, "No schema operation defined before calling execute" }, - { 4500, AE, "Cannot handle more than 2048 tables in NdbApi" }, { 4501, AE, "Insert in hash table failed when getting table information from Ndb" }, { 4502, AE, "GetValue not allowed in Update operation" }, { 4503, AE, "GetValue not allowed in Insert operation" }, From ce62fb28c0d101ecf1971f388dcdfce1b3145158 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 11 Nov 2004 16:20:39 +0200 Subject: [PATCH 0182/1063] Removed check for .ini file elsewhere, except on Windows. --- mysys/default.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mysys/default.c b/mysys/default.c index 416de09b661..d260dd4b370 100644 --- a/mysys/default.c +++ b/mysys/default.c @@ -60,7 +60,11 @@ DATADIR, NullS, }; +#ifdef __WIN__ static const char *f_extensions[]= { ".ini", ".cnf", 0 }; +#else +static const char *f_extensions[]= { ".cnf", 0 }; +#endif static int search_default_file(DYNAMIC_ARRAY *args,MEM_ROOT *alloc, const char *dir, const char *config_file, From baf1c89e3d66bd4d66555b3662d522adbabca505 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 11 Nov 2004 18:20:40 +0400 Subject: [PATCH 0183/1063] A fix (bug #6564: QUOTE(NULL) returns NULL, not the string 'NULL') --- mysql-test/r/func_str.result | 5 ++++- mysql-test/t/func_str.test | 6 ++++++ sql/item_strfunc.cc | 14 +++++++++++--- 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result index b4d1be5bd54..d38a2edfa1a 100644 --- a/mysql-test/r/func_str.result +++ b/mysql-test/r/func_str.result @@ -167,6 +167,9 @@ length(quote(concat(char(0),"test"))) select hex(quote(concat(char(224),char(227),char(230),char(231),char(232),char(234),char(235)))); hex(quote(concat(char(224),char(227),char(230),char(231),char(232),char(234),char(235)))) 27E0E3E6E7E8EAEB27 +select concat('a', quote(NULL)); +concat('a', quote(NULL)) +aNULL select reverse(""); reverse("") @@ -278,7 +281,7 @@ insert into t1 values ('one'),(NULL),('two'),('four'); select a, quote(a), isnull(quote(a)), quote(a) is null, ifnull(quote(a), 'n') from t1; a quote(a) isnull(quote(a)) quote(a) is null ifnull(quote(a), 'n') one 'one' 0 0 'one' -NULL NULL 1 1 n +NULL NULL 0 0 NULL two 'two' 0 0 'two' four 'four' 0 0 'four' drop table t1; diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test index ba6a8b55236..1ae4db3a42a 100644 --- a/mysql-test/t/func_str.test +++ b/mysql-test/t/func_str.test @@ -69,6 +69,12 @@ select quote(1/0), quote('\0\Z'); select length(quote(concat(char(0),"test"))); select hex(quote(concat(char(224),char(227),char(230),char(231),char(232),char(234),char(235)))); +# +# Bug #6564: QUOTE(NULL +# + +select concat('a', quote(NULL)); + # # Wrong usage of functions # diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 9248cbc0217..53a9d3fe219 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -2142,9 +2142,12 @@ String* Item_func_inet_ntoa::val_str(String* str) This function is very useful when you want to generate SQL statements - RETURN VALUES + NOTE + QUOTE(NULL) returns the string 'NULL' (4 letters, without quotes). + + RETURN VALUES str Quoted string - NULL Argument to QUOTE() was NULL or out of memory. + NULL Out of memory. */ #define get_esc_bit(mask, num) (1 & (*((mask) + ((num) >> 3))) >> ((num) & 7)) @@ -2168,7 +2171,12 @@ String *Item_func_quote::val_str(String *str) String *arg= args[0]->val_str(str); uint arg_length, new_length; if (!arg) // Null argument - goto null; + { + str->copy("NULL", 4); // Return the string 'NULL' + null_value= 0; + return str; + } + arg_length= arg->length(); new_length= arg_length+2; /* for beginning and ending ' signs */ From 98b31cd63c5fe671d7a3bc7b8e4f2daf20b7ee51 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 11 Nov 2004 16:59:36 +0200 Subject: [PATCH 0184/1063] Some code clean-up and optimization. --- mysys/default.c | 90 ++++++++++++++++++++++++++++++++----------------- 1 file changed, 60 insertions(+), 30 deletions(-) diff --git a/mysys/default.c b/mysys/default.c index d260dd4b370..16e166a3ca5 100644 --- a/mysys/default.c +++ b/mysys/default.c @@ -68,7 +68,12 @@ static const char *f_extensions[]= { ".cnf", 0 }; static int search_default_file(DYNAMIC_ARRAY *args,MEM_ROOT *alloc, const char *dir, const char *config_file, - const char *ext, TYPELIB *group); + TYPELIB *group); + +static int search_default_file_with_ext(DYNAMIC_ARRAY *args, MEM_ROOT *alloc, + const char *dir, const char *ext, + const char *config_file, + TYPELIB *group); static char *remove_end_comment(char *ptr); @@ -164,15 +169,16 @@ int load_defaults(const char *conf_file, const char **groups, goto err; if (forced_default_file) { - if ((error= search_default_file(&args, &alloc, "", - forced_default_file, "", &group)) < 0) + if ((error= search_default_file_with_ext(&args, &alloc, "", "", + forced_default_file, + &group)) < 0) goto err; } else if (dirname_length(conf_file)) { for (ext= (char**) f_extensions; *ext; *ext++) if ((error= search_default_file(&args, &alloc, NullS, conf_file, - *ext, &group)) < 0) + &group)) < 0) goto err; } else @@ -180,33 +186,31 @@ int load_defaults(const char *conf_file, const char **groups, #ifdef __WIN__ char system_dir[FN_REFLEN]; GetWindowsDirectory(system_dir,sizeof(system_dir)); - for (ext= (char**) f_extensions; *ext; *ext++) - if ((search_default_file(&args, &alloc, system_dir, conf_file, - *ext, &group))) - goto err; + if ((search_default_file(&args, &alloc, system_dir, conf_file, &group))) + goto err; #endif #if defined(__EMX__) || defined(OS2) - for (ext= (char**) f_extensions; *ext; *ext++) - if (getenv("ETC") && - (search_default_file(&args, &alloc, getenv("ETC"), conf_file, - *ext, &group)) < 0) - goto err; + { + const char *etc; + if ((etc= getenv("ETC")) && + (search_default_file(&args, &alloc, etc, conf_file, + &group)) < 0) + goto err; + } #endif for (dirs=default_directories ; *dirs; dirs++) { if (**dirs) { - for (ext= (char**) f_extensions; *ext; *ext++) - if (search_default_file(&args, &alloc, *dirs, conf_file, - *ext, &group) < 0) - goto err; + if (search_default_file(&args, &alloc, *dirs, conf_file, + &group) < 0) + goto err; } else if (defaults_extra_file) { - for (ext= (char**) f_extensions; *ext; *ext++) - if (search_default_file(&args, &alloc, NullS, defaults_extra_file, - *ext, &group) < 0) - goto err; /* Fatal error */ + if (search_default_file(&args, &alloc, NullS, defaults_extra_file, + &group) < 0) + goto err; /* Fatal error */ } } } @@ -267,11 +271,28 @@ void free_defaults(char **argv) } +static int search_default_file(DYNAMIC_ARRAY *args, MEM_ROOT *alloc, + const char *dir, + const char *config_file, TYPELIB *group) +{ + char **ext; + + for (ext= (char**) f_extensions; *ext; *ext++) + { + int error; + if ((error= search_default_file_with_ext(args, alloc, dir, *ext, + config_file, group)) < 0) + return error; + } + return 0; +} + + /* Open a configuration file (if exists) and read given options from it SYNOPSIS - search_default_file() + search_default_file_with_ext() args Store pointer to found options here alloc Allocate strings in this object dir directory to read @@ -286,9 +307,10 @@ void free_defaults(char **argv) 2 File is not a regular file (Warning) */ -static int search_default_file(DYNAMIC_ARRAY *args, MEM_ROOT *alloc, - const char *dir, const char *config_file, - const char *ext, TYPELIB *group) +static int search_default_file_with_ext(DYNAMIC_ARRAY *args, MEM_ROOT *alloc, + const char *dir, const char *ext, + const char *config_file, + TYPELIB *group) { char name[FN_REFLEN+10],buff[4096],*ptr,*end,*value,*tmp; FILE *fp; @@ -482,7 +504,7 @@ static char *remove_end_comment(char *ptr) void print_defaults(const char *conf_file, const char **groups) { #ifdef __WIN__ - bool have_ext=fn_ext(conf_file)[0] != 0; + my_bool have_ext= fn_ext(conf_file)[0] != 0; #endif char name[FN_REFLEN], **ext; const char **dirs; @@ -495,16 +517,24 @@ void print_defaults(const char *conf_file, const char **groups) { #ifdef __WIN__ GetWindowsDirectory(name,sizeof(name)); - if (have_ext) + if (!have_ext) + { for (ext= (char**) f_extensions; *ext; *ext++) printf("%s\\%s%s ", name, conf_file, *ext); + } else printf("%s\\%s ", name, conf_file); #endif #if defined(__EMX__) || defined(OS2) - for (ext= (char**) f_extensions; *ext; *ext++) - if (getenv("ETC")) - printf("%s\\%s%s ", getenv("ETC"), conf_file, *ext); + { + const char *etc; + + if ((etc= getenv("ETC"))) + { + for (ext= (char**) f_extensions; *ext; *ext++) + printf("%s\\%s%s ", etc, conf_file, *ext); + } + } #endif for (dirs=default_directories ; *dirs; dirs++) { From 9fe89939d07837c84e3874a4fc97b444560f4575 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 11 Nov 2004 15:53:33 +0000 Subject: [PATCH 0185/1063] basestring_vsnprintf fix for size==0 --- ndb/src/common/util/basestring_vsnprintf.c | 32 +++++++++++++++++----- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/ndb/src/common/util/basestring_vsnprintf.c b/ndb/src/common/util/basestring_vsnprintf.c index 1b4d88679c1..8a58ca0fe5c 100644 --- a/ndb/src/common/util/basestring_vsnprintf.c +++ b/ndb/src/common/util/basestring_vsnprintf.c @@ -20,6 +20,10 @@ #include #include + +/* + #define SNPRINTF_RETURN_TRUNC +*/ int basestring_snprintf(char *str, size_t size, const char *format, ...) { @@ -47,13 +51,27 @@ static char basestring_vsnprintf_buf[16*1024]; int basestring_vsnprintf(char *str, size_t size, const char *format, va_list ap) { - int ret= BASESTRING_VSNPRINTF_FUNC(str, size, format, ap); + if (size == 0) + { #ifdef SNPRINTF_RETURN_TRUNC - if (ret == size-1 || ret == -1) { - ret= BASESTRING_VSNPRINTF_FUNC(basestring_vsnprintf_buf, - sizeof(basestring_vsnprintf_buf), - format, ap); - } + return BASESTRING_VSNPRINTF_FUNC(basestring_vsnprintf_buf, + sizeof(basestring_vsnprintf_buf), + format, ap); +#else + char buf[1]; + return BASESTRING_VSNPRINTF_FUNC(buf, 1, format, ap); #endif - return ret; + } + { + int ret= BASESTRING_VSNPRINTF_FUNC(str, size, format, ap); +#ifdef SNPRINTF_RETURN_TRUNC + if (ret == size-1 || ret == -1) + { + ret= BASESTRING_VSNPRINTF_FUNC(basestring_vsnprintf_buf, + sizeof(basestring_vsnprintf_buf), + format, ap); + } +#endif + return ret; + } } From 75f9f5f154e56f046f5769682ed6c7c31d72b947 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 11 Nov 2004 16:06:47 +0000 Subject: [PATCH 0186/1063] mysql-test-run.sh: made sleep time for second master larger so that it has time to start mysql-test/mysql-test-run.sh: made sleep time for second master larger so that it has time to start --- mysql-test/mysql-test-run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index fcb9e5eee2d..27eae89922c 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -227,7 +227,7 @@ DO_CLIENT_GDB="" SLEEP_TIME_AFTER_RESTART=1 SLEEP_TIME_FOR_DELETE=10 SLEEP_TIME_FOR_FIRST_MASTER=400 # Enough time to create innodb tables -SLEEP_TIME_FOR_SECOND_MASTER=30 +SLEEP_TIME_FOR_SECOND_MASTER=400 SLEEP_TIME_FOR_FIRST_SLAVE=400 SLEEP_TIME_FOR_SECOND_SLAVE=30 CHARACTER_SET=latin1 From 0fa48ea490b020c5538dcaf567c102c56f472417 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 11 Nov 2004 16:38:15 +0000 Subject: [PATCH 0187/1063] waiter.cpp: fixed so that connectring option works ndb/tools/waiter.cpp: fixed so that connectring option works --- ndb/tools/waiter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ndb/tools/waiter.cpp b/ndb/tools/waiter.cpp index c9e76bb8ed3..be572d7c275 100644 --- a/ndb/tools/waiter.cpp +++ b/ndb/tools/waiter.cpp @@ -86,7 +86,7 @@ int main(int argc, char** argv){ if (_hostName == NULL){ LocalConfig lcfg; - if(!lcfg.init()) + if(!lcfg.init(opt_connect_str, 0)) { lcfg.printError(); lcfg.printUsage(); From df6f09881393a00f7f33c9dade44868b835171f0 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 11 Nov 2004 16:51:38 +0000 Subject: [PATCH 0188/1063] ndb_test_platform.cpp: better printouts in ndb_test_platform ndb/tools/ndb_test_platform.cpp: better printouts in ndb_test_platform --- ndb/tools/ndb_test_platform.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ndb/tools/ndb_test_platform.cpp b/ndb/tools/ndb_test_platform.cpp index 2b8bbd0274b..72dd146dacd 100644 --- a/ndb/tools/ndb_test_platform.cpp +++ b/ndb/tools/ndb_test_platform.cpp @@ -32,19 +32,21 @@ int test_snprintf(const char * fmt, int buf_sz, int result) if(ret < 0) { - printf("BaseString::snprint returns %d\n", ret); + printf("BaseString::snprint returns %d with size=%d and strlen(fmt)=%d\n", + ret, buf_sz, strlen(fmt)); return -1; } if(ret+1 == buf_sz) { - printf("BaseString::snprint truncates\n"); + printf("BaseString::snprint truncates returns %d with size=%d and strlen(fmt)=%d\n", + ret, buf_sz, strlen(fmt)); return -1; } if(ret != result) { - printf("BaseString::snprint returns incorrect value: %d != %d\n", + printf("BaseString::snprint returns incorrect value: returned=%d != expected=%d\n", ret, result); return -1; } @@ -54,7 +56,7 @@ int test_snprintf(const char * fmt, int buf_sz, int result) if(buf[ret] != fmt[ret]) { printf("BaseString::snprint Incorrect value in output buffer: " - "%d %d %d %d %d\n", + "size=%d returned=expected=%d at pos=%d result=%d != expected=%d\n", buf_sz, result, ret, buf[ret], fmt[ret]); return -1; } From 3a98b7831826418d656f8dc4d8f9ca2592e51c36 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 11 Nov 2004 20:12:12 +0100 Subject: [PATCH 0189/1063] Result of WL#2225 Extend the test cases for PS + develop a basic test routine for PS The basic test routine mysql-test/include/patchwork-check.inc Test cases for the the basic test routine mysql-test/t/tool_test.test mysql-test/r/tool_test.result Test cases for prepared statements with functions mysql-test/t/ps_12func.test mysql-test/r/ps_12func.result Some statements are set to comment, because of open bugs. Fresh MySQL V4.1 and V5.0 souces produce in the moment (~11-Nov-2004) the same result files. --- mysql-test/include/patchwork-check.inc | 330 ++ mysql-test/r/ps_12func.result | 4748 ++++++++++++++++++++++++ mysql-test/r/tool_test.result | 223 ++ mysql-test/t/ps_12func.test | 867 +++++ mysql-test/t/tool_test.test | 105 + 5 files changed, 6273 insertions(+) create mode 100644 mysql-test/include/patchwork-check.inc create mode 100644 mysql-test/r/ps_12func.result create mode 100644 mysql-test/r/tool_test.result create mode 100644 mysql-test/t/ps_12func.test create mode 100644 mysql-test/t/tool_test.test diff --git a/mysql-test/include/patchwork-check.inc b/mysql-test/include/patchwork-check.inc new file mode 100644 index 00000000000..b11db7fa50d --- /dev/null +++ b/mysql-test/include/patchwork-check.inc @@ -0,0 +1,330 @@ +###################### patchwork-check.inc ############################# +# # +# Basic routine for the generation and execution of prepared and non # +# prepared SQL statements. # +# # +# Purpose: Simplify the check of complex statements with different # +# sets of parameters (data type, value) # +# # +######################################################################## + +# +# NOTE: PLEASE BE VERY CAREFULL, WHEN CHANGING OR USING ;-) THIS ROUTINE. +# +# Please be aware, that this routine +# - will be sourced by several test case files stored within the +# directory 'mysql-test/t'. So every change here will affect +# several test cases. +# - does not check its own prequisites +# - modifies the content and the data type of the +# uservariables @var_1 ... @var_ +# +# Please preserve the '___' naming of the the auxiliary variables. +# These names should avoid that a test case writer accidently creates a +# variable with the same name. +# + +# naming conventions: +# stmt_c_ --> statement with constants like "select 1 " +# stmt_uv_ --> statement with uservariables like "select @var_1 " +# stmt_ph_ --> prepared statement with placeholders like "select ? " + + +# +# Explanation how to use this routine by an example: +# +# Content of the caller script: +# .... +# set @stmt_part1= 'SELECT f1 + ' +# set @stmt_part2= ' from t1 where f2= ' ; +# set @stmt_part3= '' ; +# set @string_1= "1"; set @type_1= "BIGINT"; +# set @string_2= "-2.3E-4"; set @type_2= "DOUBLE"; +# set @max_var_number= 2; +# --source include/patchwork-check.inc +# +# # The next testing rounds could start with +# set @string_1= "NULL"; set @type_1= "BIGINT"; +# set @string_2= "-2.3E-4"; set @type_2= "DOUBLE"; +# --source include/patchwork-check.inc +# +# set @string_1= "1"; set @type_1= "BIGINT"; +# set @string_2= "NULL"; set @type_2= "LONGTEXT"; +# --source include/patchwork-check.inc +# +# Statements and uservariables to be produced and executed by this routine +# 1. Statements with constants +# 1.1 stmt1= SELECT f1 + 1 from t1 where f2= -2.3E-4 ; +# 1.2 stmt1 as prepared statement +# 2. Statements with uservariables +# @var_n should be of data type @type_n (if possible) and have the +# content @string_n . +# 2.1 stmt2= SELECT f1 + @var_1 from t1 where f2= @var_2 +# 2.2 stmt2 as prepared statement +# 3. prepared statement with placeholders +# prepare stmt1 from 'SELECT f1 + ? from t1 where f2= ?' +# execute stmt1 using @var_1, @var_2 +# +# Every prepared statement variant of the "patchwork" is 3 times executed. +# +# +# Please have also also a look into +# - t/tooltest.test , which checks or +# - t/ps_12func.test , which contains test cases using +# this routine. +# + + +############## +# +# Prerequisites: +# +# The caller script must set the following uservariables: +# +# The statement pieces: @stmt_part1, @stmt_part2, ... , @stmt_part +# +# The parameter values: @string_1, ... , @string_ +# The parameter value should fit to the data type ! +# UPPER(@stmt_part1) = 'NULL' will cause (SQL) NULL as content. +# +# The parameter data types: @type_1, ... , @type_ +# valid types are: BIGINT, DOUBLE, LONGTEXT, LONGBLOB +# +# Attention: All other type assignments will lead to a +# uservariable of type LONGTEXT !! +# +# The number of parameter values must be published via +# set @max_var_number= ; +# +# Attention: This routine does not perform any check of the content +# of these variables. +# + +############## +# +# How is intended uservariable generated: +# +# Step 1: generate a uservariable of the intended type +# +# UPPER(@type_) statement +# BIGINT set @var_= 0 +# DOUBLE' set @var_idx_= 0.0 +# LONGTEXT' set @var_= "INIT" +# LONGBLOB' set @var_= CAST("INIT" AS BINARY) +# set @var_= "INIT" +# +# Step 2: assign the value to the uservariable +# +# IF ( UPPER(@string_) != 'NULL') +# UPPER(@type_) +# BIGINT set @var_= CEIL(@string_) +# DOUBLE set @var_= @string_ + 0.0 +# LONGTEXT set @var_= @string_ +# LONGBLOB set @var_= CAST(@string_ AS BINARY) +# set @var_= @string_ +# ELSE +# set @var_= NULL +# + + +# +# How to debug this routine if something goes wrong: +# +# 1. Put the line '--disable_abort_on_error' into the caller script +# --> There will be no abort of mysqltest, if a statement fails. +# You will get a protocol (in most cases). +# 2. Put the line 'set $__debug_= 1 ;' into the caller script . +# The next call of patchwork-check.inc will print +# the type and content of generated uservariables and statements. +# 3. disable the '--disable_query_log' option some lines below +# +# and please be patient towards this routine, it is far away from being perfect. +# + + +# Suppress the majority of the huge output concerning the statement and +# uservariable generation +--disable_query_log + +let $__idx_= 1 ; +eval set @__stmt_c_= @stmt_part_$__idx_ ; +# If the number of variables is greater 0, we need also +# - the statement with uservariables (stmt_uv) and +# - the prepared statement with placeholders (stmt_ph) and +# - the execute for the prepared statement with placeholders (execute_stmt_ph) +let $__with_var_= `select @max_var_number > 0`; +while ($__with_var_) +{ + eval set @__stmt_uv_= @stmt_part_$__idx_ ; + eval set @__stmt_ph_= @stmt_part_$__idx_ ; + set @__execute_stmt_ph= 'execute __stmt_ph_ using ' ; + let $__num_= `select @max_var_number`; + while ($__num_) + { + ##### Generate the Uservariables + eval set @__my_init_= CASE UPPER(@type_$__idx_) + WHEN 'BIGINT' THEN 'set @var_$__idx_= 0' + WHEN 'DOUBLE' THEN 'set @var_$__idx_= 0.0' + WHEN 'LONGTEXT' THEN 'set @var_$__idx_= "INIT"' + WHEN 'LONGBLOB' THEN 'set @var_$__idx_= CAST("INIT" AS BINARY)' + ELSE 'set @var_$__idx_= "INIT"' END; + # select @__my_init_ as "@__my_init_ is: " ; + let $__my_init_= `select @__my_init_`; + eval $__my_init_ ; + + eval set @__my_init_= CASE UPPER(@type_$__idx_) + WHEN 'BIGINT' THEN + "set @var_$__idx_= IF(UPPER(@string_$__idx_)!='NULL',CEIL(@string_$__idx_),NULL)" + WHEN 'DOUBLE' THEN + "set @var_$__idx_= IF(UPPER(@string_$__idx_)!='NULL',@string_$__idx_ + 0.0,NULL)" + WHEN 'LONGTEXT' THEN + "set @var_$__idx_= IF(UPPER(@string_$__idx_)!='NULL',@string_$__idx_,NULL)" + WHEN 'LONGBLOB' THEN + "set @var_$__idx_= IF(UPPER(@string_$__idx_)!='NULL',CAST(@string_$__idx_ AS BINARY),NULL)" + ELSE + "set @var_$__idx_= IF(UPPER(@string_$__idx_)!='NULL',@string_$__idx_,NULL)" END; + let $__my_init_= `select @__my_init_`; + eval $__my_init_ ; + + ##### concat the variable to the statements + ## with Constants + # 1. replace ugly NULLs like 'NuLl' with 'NULL' for better readability + # 2. Strings to be inserted into the statement must be quoted + eval set @__stmt_c_= concat( + @__stmt_c_, + IF(UPPER(@string_$__idx_)='NULL','NULL', + IF(UPPER(@type_$__idx_)='LONGTEXT' or UPPER(@type_$__idx_)='LONGBLOB', + concat('''',@string_$__idx_,''''), @string_$__idx_ + ))) ; + ## with Uservariables + eval set @__stmt_uv_= concat(@__stmt_uv_, '@var_$__idx_') ; + ## with placeholders + eval set @__stmt_ph_= concat(@__stmt_ph_, '?') ; + + ##### complete the execute for the prepared statement with placeholders + eval set @__execute_stmt_ph= concat(@__execute_stmt_ph, '@var_$__idx_,') ; + + inc $__idx_ ; + ##### concat the next part of the statement to the statements + eval set @__stmt_c_= concat(@__stmt_c_, @stmt_part_$__idx_ ); + eval set @__stmt_uv_= concat(@__stmt_uv_, @stmt_part_$__idx_ ); + eval set @__stmt_ph_= concat(@__stmt_ph_, @stmt_part_$__idx_ ); + + dec $__num_ ; + } + # @__execute_stmt_ph contains a trailing ',' which must be cut away + set @__execute_stmt_ph= substr(@__execute_stmt_ph,1,length(@__execute_stmt_ph) - 1); + dec $__with_var_ ; +} + +while ($__debug_) +{ + ### Print debug informations for patchwork with variables + let $__with_var_= `select @max_var_number > 0`; + while ($__with_var_) + { + ### Print out the content of the statement variables + eval select "--------------------------------------" + as "the content of the statement variables" + union select concat('@__stmt_c_ is: ',@__stmt_c_) + union select concat('@__stmt_uv_ is: ',@__stmt_uv_) + union select concat('@__stmt_ph_ is: ',@__stmt_ph_) + union select concat('@__execute_stmt_ph is: ',@__execute_stmt_ph); + + + ### Print out the content of the uservariables + select '--------------------------------------' + as "the content of the parameter variables"; + set @__parameter_= 'select '; + let $__num_= `select @max_var_number`; + let $__idx_= 1 ; + while ($__num_) + { + eval select @type_$__idx_ as type, + @string_$__idx_ as string, + @var_$__idx_ as uservariable ; + eval set @__parameter_= concat(@__parameter_, '@var_$__idx_ ,'); + inc $__idx_ ; + + dec $__num_ ; + } + # @__parameter_ contains a trailing ',' which must be cut away + set @__parameter_= substr(@__parameter_,1,length(@__parameter_) - 1); + let $__aux_= `select @__parameter_` ; + eval $__aux_ ; + + + ### Create a table from the uservariables and print out the column types + let $__aux_= `select concat('CREATE TABLE t9 AS ',@__parameter_)` ; + --disable_warnings + drop table if exists t9; + --enable_warnings + eval $__aux_ ; + show create table t9; + drop table t9; + + dec $__with_var_ ; + } + ### Print debug informations for patchwork without variables + ### stmt_uv, stmt_ph, execute_stmt_ph and uservariables do NOT exist + let $__with_var_= `select @max_var_number = 0`; + while ($__with_var_) + { + ### Print out the content of the statement variables + eval select "--------------------------------------" + as "the content of the statement variable" + union select concat('@__stmt_c_ is: ',@__stmt_c_) ; + + dec $__with_var_ ; + } + + + dec $__debug_ ; +} + +## copy the statements and the execute into $variables +# (__stmt_ph_ is not needed) +## + generate the prepared statements +--enable_query_log +let $__stmt_c_= `select @__stmt_c_`; +eval prepare __stmt_c_ from @__stmt_c_ ; +let $__with_var_= `select @max_var_number > 0`; +while ($__with_var_) +{ + let $__stmt_uv_= `select @__stmt_uv_`; + eval prepare __stmt_uv_ from @__stmt_uv_ ; + let $__execute_ph= `select @__execute_stmt_ph`; + eval prepare __stmt_ph_ from @__stmt_ph_ ; + dec $__with_var_ ; +} + + +##### The execution of all statements +## statement with Constants +eval $__stmt_c_ ; +## prepared statement with Constants +execute __stmt_c_ ; +# Try to detect if the prior executes damaged the parse tree by +# two additional executes . +execute __stmt_c_ ; +execute __stmt_c_ ; +let $__with_var_= `select @max_var_number > 0`; +while ($__with_var_) +{ + ## statement with Uservariables + eval $__stmt_uv_ ; + ## prepared statement with Uservariables + execute __stmt_uv_ ; + # Try to detect if the prior executes damaged the parse tree by + # two additional executes . + execute __stmt_uv_ ; + execute __stmt_uv_ ; + ## prepared statement with placeholders + eval $__execute_ph ; + # Try to detect if the prior executes damaged the parse tree by + # two additional executes . + eval $__execute_ph ; + eval $__execute_ph ; + + dec $__with_var_ ; +} diff --git a/mysql-test/r/ps_12func.result b/mysql-test/r/ps_12func.result new file mode 100644 index 00000000000..881d5392edd --- /dev/null +++ b/mysql-test/r/ps_12func.result @@ -0,0 +1,4748 @@ +use test; + +###### Variations on ROUND(X,D) ###### + +set @stmt_part_1= 'select ROUND(' ; +set @stmt_part_2= ',' ; +set @stmt_part_3= ') as my_col' ; +set @max_var_number= 2; +set @string_1= '11.298' ; +set @type_1= 'DOUBLE' ; +set @type_2= 'BIGINT' ; +set @string_2= '1' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(11.298,1) as my_col ; +my_col +11.3 +execute __stmt_c_ ; +my_col +11.3 +execute __stmt_c_ ; +my_col +11.3 +execute __stmt_c_ ; +my_col +11.3 +select ROUND(@var_1 ,@var_2) as my_col ; +my_col +11.3 +execute __stmt_uv_ ; +my_col +11.3 +execute __stmt_uv_ ; +my_col +11.3 +execute __stmt_uv_ ; +my_col +11.3 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +11.3 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +11.3 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +11.3 +set @string_2= '3' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(11.298,3) as my_col ; +my_col +11.298 +execute __stmt_c_ ; +my_col +11.298 +execute __stmt_c_ ; +my_col +11.298 +execute __stmt_c_ ; +my_col +11.298 +select ROUND(@var_1 ,@var_2) as my_col ; +my_col +11.298 +execute __stmt_uv_ ; +my_col +11.298 +execute __stmt_uv_ ; +my_col +11.298 +execute __stmt_uv_ ; +my_col +11.298 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +11.298 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +11.298 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +11.298 +set @string_2= '4' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(11.298,4) as my_col ; +my_col +11.2980 +execute __stmt_c_ ; +my_col +11.2980 +execute __stmt_c_ ; +my_col +11.2980 +execute __stmt_c_ ; +my_col +11.2980 +select ROUND(@var_1 ,@var_2) as my_col ; +my_col +11.2980 +execute __stmt_uv_ ; +my_col +11.2980 +execute __stmt_uv_ ; +my_col +11.2980 +execute __stmt_uv_ ; +my_col +11.2980 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +11.2980 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +11.2980 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +11.2980 +set @string_2= '0' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(11.298,0) as my_col ; +my_col +11 +execute __stmt_c_ ; +my_col +11 +execute __stmt_c_ ; +my_col +11 +execute __stmt_c_ ; +my_col +11 +select ROUND(@var_1 ,@var_2) as my_col ; +my_col +11 +execute __stmt_uv_ ; +my_col +11 +execute __stmt_uv_ ; +my_col +11 +execute __stmt_uv_ ; +my_col +11 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +11 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +11 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +11 +set @string_2= '-1' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(11.298,-1) as my_col ; +my_col +10 +execute __stmt_c_ ; +my_col +10 +execute __stmt_c_ ; +my_col +10 +execute __stmt_c_ ; +my_col +10 +select ROUND(@var_1 ,@var_2) as my_col ; +my_col +10 +execute __stmt_uv_ ; +my_col +10 +execute __stmt_uv_ ; +my_col +10 +execute __stmt_uv_ ; +my_col +10 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +10 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +10 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +10 +set @string_2= '-2' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(11.298,-2) as my_col ; +my_col +0 +execute __stmt_c_ ; +my_col +0 +execute __stmt_c_ ; +my_col +0 +execute __stmt_c_ ; +my_col +0 +select ROUND(@var_1 ,@var_2) as my_col ; +my_col +0 +execute __stmt_uv_ ; +my_col +0 +execute __stmt_uv_ ; +my_col +0 +execute __stmt_uv_ ; +my_col +0 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +0 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +0 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +0 +set @string_2= '-3' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(11.298,-3) as my_col ; +my_col +0 +execute __stmt_c_ ; +my_col +0 +execute __stmt_c_ ; +my_col +0 +execute __stmt_c_ ; +my_col +0 +select ROUND(@var_1 ,@var_2) as my_col ; +my_col +0 +execute __stmt_uv_ ; +my_col +0 +execute __stmt_uv_ ; +my_col +0 +execute __stmt_uv_ ; +my_col +0 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +0 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +0 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +0 +set @string_2= 'NULL' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(11.298,NULL) as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select ROUND(@var_1 ,@var_2) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +set @type_2= 'DOUBLE' ; +set @string_2= '1.0' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(11.298,1.0) as my_col ; +my_col +11.3 +execute __stmt_c_ ; +my_col +11.3 +execute __stmt_c_ ; +my_col +11.3 +execute __stmt_c_ ; +my_col +11.3 +select ROUND(@var_1 ,@var_2) as my_col ; +my_col +11.3 +execute __stmt_uv_ ; +my_col +11.3 +execute __stmt_uv_ ; +my_col +11.3 +execute __stmt_uv_ ; +my_col +11.3 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +11.3 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +11.3 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +11.3 +set @string_2= '3.0' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(11.298,3.0) as my_col ; +my_col +11.298 +execute __stmt_c_ ; +my_col +11.298 +execute __stmt_c_ ; +my_col +11.298 +execute __stmt_c_ ; +my_col +11.298 +select ROUND(@var_1 ,@var_2) as my_col ; +my_col +11.298 +execute __stmt_uv_ ; +my_col +11.298 +execute __stmt_uv_ ; +my_col +11.298 +execute __stmt_uv_ ; +my_col +11.298 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +11.298 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +11.298 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +11.298 +set @string_2= '4.0' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(11.298,4.0) as my_col ; +my_col +11.2980 +execute __stmt_c_ ; +my_col +11.2980 +execute __stmt_c_ ; +my_col +11.2980 +execute __stmt_c_ ; +my_col +11.2980 +select ROUND(@var_1 ,@var_2) as my_col ; +my_col +11.2980 +execute __stmt_uv_ ; +my_col +11.2980 +execute __stmt_uv_ ; +my_col +11.2980 +execute __stmt_uv_ ; +my_col +11.2980 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +11.2980 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +11.2980 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +11.2980 +set @string_2= '0.0' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(11.298,0.0) as my_col ; +my_col +11 +execute __stmt_c_ ; +my_col +11 +execute __stmt_c_ ; +my_col +11 +execute __stmt_c_ ; +my_col +11 +select ROUND(@var_1 ,@var_2) as my_col ; +my_col +11 +execute __stmt_uv_ ; +my_col +11 +execute __stmt_uv_ ; +my_col +11 +execute __stmt_uv_ ; +my_col +11 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +11 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +11 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +11 +set @string_2= '-1.0' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(11.298,-1.0) as my_col ; +my_col +10 +execute __stmt_c_ ; +my_col +10 +execute __stmt_c_ ; +my_col +10 +execute __stmt_c_ ; +my_col +10 +select ROUND(@var_1 ,@var_2) as my_col ; +my_col +10 +execute __stmt_uv_ ; +my_col +10 +execute __stmt_uv_ ; +my_col +10 +execute __stmt_uv_ ; +my_col +10 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +10 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +10 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +10 +set @string_2= '-2.0' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(11.298,-2.0) as my_col ; +my_col +0 +execute __stmt_c_ ; +my_col +0 +execute __stmt_c_ ; +my_col +0 +execute __stmt_c_ ; +my_col +0 +select ROUND(@var_1 ,@var_2) as my_col ; +my_col +0 +execute __stmt_uv_ ; +my_col +0 +execute __stmt_uv_ ; +my_col +0 +execute __stmt_uv_ ; +my_col +0 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +0 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +0 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +0 +set @string_2= '-3.0' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(11.298,-3.0) as my_col ; +my_col +0 +execute __stmt_c_ ; +my_col +0 +execute __stmt_c_ ; +my_col +0 +execute __stmt_c_ ; +my_col +0 +select ROUND(@var_1 ,@var_2) as my_col ; +my_col +0 +execute __stmt_uv_ ; +my_col +0 +execute __stmt_uv_ ; +my_col +0 +execute __stmt_uv_ ; +my_col +0 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +0 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +0 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +0 +set @string_2= '1.1' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(11.298,1.1) as my_col ; +my_col +11.3 +execute __stmt_c_ ; +my_col +11.3 +execute __stmt_c_ ; +my_col +11.3 +execute __stmt_c_ ; +my_col +11.3 +select ROUND(@var_1 ,@var_2) as my_col ; +my_col +11.3 +execute __stmt_uv_ ; +my_col +11.3 +execute __stmt_uv_ ; +my_col +11.3 +execute __stmt_uv_ ; +my_col +11.3 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +11.3 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +11.3 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +11.3 +set @string_2= '1.9' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(11.298,1.9) as my_col ; +my_col +11.30 +execute __stmt_c_ ; +my_col +11.30 +execute __stmt_c_ ; +my_col +11.30 +execute __stmt_c_ ; +my_col +11.30 +select ROUND(@var_1 ,@var_2) as my_col ; +my_col +11.3 +execute __stmt_uv_ ; +my_col +11.3 +execute __stmt_uv_ ; +my_col +11.3 +execute __stmt_uv_ ; +my_col +11.3 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +11.30 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +11.30 +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +11.30 +set @string_2= 'NULL' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(11.298,NULL) as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select ROUND(@var_1 ,@var_2) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +set @type_2= 'LONGBLOB' ; +set @string_2= 'NULL' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(11.298,NULL) as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select ROUND(@var_1 ,@var_2) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +set @string_1= 'NULL' ; +set @type_1= 'BIGINT' ; +set @type_2= 'BIGINT' ; +set @string_2= '2' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(NULL,2) as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select ROUND(@var_1 ,@var_2) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +set @string_2= '-2' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(NULL,-2) as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select ROUND(@var_1 ,@var_2) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +set @string_2= 'NULL' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(NULL,NULL) as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select ROUND(@var_1 ,@var_2) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +set @type_2= 'DOUBLE' ; +set @string_2= '2.0' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(NULL,2.0) as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select ROUND(@var_1 ,@var_2) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +set @string_2= '-2.0' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(NULL,-2.0) as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select ROUND(@var_1 ,@var_2) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +set @string_2= 'NULL' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(NULL,NULL) as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select ROUND(@var_1 ,@var_2) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +set @type_2= 'LONGBLOB' ; +set @string_2= 'NULL' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(NULL,NULL) as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select ROUND(@var_1 ,@var_2) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +set @string_1= 'NULL' ; +set @type_1= 'DOUBLE' ; +set @type_2= 'BIGINT' ; +set @string_2= '2' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(NULL,2) as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select ROUND(@var_1 ,@var_2) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +set @string_2= '-2' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(NULL,-2) as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select ROUND(@var_1 ,@var_2) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +set @string_2= 'NULL' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(NULL,NULL) as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select ROUND(@var_1 ,@var_2) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +set @type_2= 'DOUBLE' ; +set @string_2= '2.0' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(NULL,2.0) as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select ROUND(@var_1 ,@var_2) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +set @string_2= '-2.0' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(NULL,-2.0) as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select ROUND(@var_1 ,@var_2) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +set @string_2= 'NULL' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(NULL,NULL) as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select ROUND(@var_1 ,@var_2) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +set @type_2= 'LONGBLOB' ; +set @string_2= 'NULL' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(NULL,NULL) as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select ROUND(@var_1 ,@var_2) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +set @string_1= 'NULL' ; +set @type_1= 'LONGBLOB' ; +set @type_2= 'BIGINT' ; +set @string_2= '2' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(NULL,2) as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select ROUND(@var_1 ,@var_2) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +set @string_2= '-2' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(NULL,-2) as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select ROUND(@var_1 ,@var_2) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +set @string_2= 'NULL' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(NULL,NULL) as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select ROUND(@var_1 ,@var_2) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +set @type_2= 'DOUBLE' ; +set @string_2= '2.0' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(NULL,2.0) as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select ROUND(@var_1 ,@var_2) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +set @string_2= '-2.0' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(NULL,-2.0) as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select ROUND(@var_1 ,@var_2) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +set @string_2= 'NULL' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(NULL,NULL) as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select ROUND(@var_1 ,@var_2) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +set @type_2= 'LONGBLOB' ; +set @string_2= 'NULL' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(NULL,NULL) as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select ROUND(@var_1 ,@var_2) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2 ; +my_col +NULL +set @stmt_part_1= 'select ROUND(' ; +set @stmt_part_2= ') as my_col' ; +set @max_var_number= 1; +set @string_1= '11' ; +set @type_1= 'BIGINT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(11) as my_col ; +my_col +11 +execute __stmt_c_ ; +my_col +11 +execute __stmt_c_ ; +my_col +11 +execute __stmt_c_ ; +my_col +11 +select ROUND(@var_1 ) as my_col ; +my_col +11 +execute __stmt_uv_ ; +my_col +11 +execute __stmt_uv_ ; +my_col +11 +execute __stmt_uv_ ; +my_col +11 +execute __stmt_ph_ using @var_1 ; +my_col +11 +execute __stmt_ph_ using @var_1 ; +my_col +11 +execute __stmt_ph_ using @var_1 ; +my_col +11 +set @string_1= '-11' ; +set @type_1= 'BIGINT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(-11) as my_col ; +my_col +-11 +execute __stmt_c_ ; +my_col +-11 +execute __stmt_c_ ; +my_col +-11 +execute __stmt_c_ ; +my_col +-11 +select ROUND(@var_1 ) as my_col ; +my_col +-11 +execute __stmt_uv_ ; +my_col +-11 +execute __stmt_uv_ ; +my_col +-11 +execute __stmt_uv_ ; +my_col +-11 +execute __stmt_ph_ using @var_1 ; +my_col +-11 +execute __stmt_ph_ using @var_1 ; +my_col +-11 +execute __stmt_ph_ using @var_1 ; +my_col +-11 +set @string_1= '0' ; +set @type_1= 'BIGINT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(0) as my_col ; +my_col +0 +execute __stmt_c_ ; +my_col +0 +execute __stmt_c_ ; +my_col +0 +execute __stmt_c_ ; +my_col +0 +select ROUND(@var_1 ) as my_col ; +my_col +0 +execute __stmt_uv_ ; +my_col +0 +execute __stmt_uv_ ; +my_col +0 +execute __stmt_uv_ ; +my_col +0 +execute __stmt_ph_ using @var_1 ; +my_col +0 +execute __stmt_ph_ using @var_1 ; +my_col +0 +execute __stmt_ph_ using @var_1 ; +my_col +0 +set @string_1= 'NULL' ; +set @type_1= 'BIGINT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(NULL) as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select ROUND(@var_1 ) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ; +my_col +NULL +set @string_1= '11.49' ; +set @type_1= 'DOUBLE' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(11.49) as my_col ; +my_col +11 +execute __stmt_c_ ; +my_col +11 +execute __stmt_c_ ; +my_col +11 +execute __stmt_c_ ; +my_col +11 +select ROUND(@var_1 ) as my_col ; +my_col +11 +execute __stmt_uv_ ; +my_col +11 +execute __stmt_uv_ ; +my_col +11 +execute __stmt_uv_ ; +my_col +11 +execute __stmt_ph_ using @var_1 ; +my_col +11 +execute __stmt_ph_ using @var_1 ; +my_col +11 +execute __stmt_ph_ using @var_1 ; +my_col +11 +set @string_1= '10.51' ; +set @type_1= 'DOUBLE' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(10.51) as my_col ; +my_col +11 +execute __stmt_c_ ; +my_col +11 +execute __stmt_c_ ; +my_col +11 +execute __stmt_c_ ; +my_col +11 +select ROUND(@var_1 ) as my_col ; +my_col +11 +execute __stmt_uv_ ; +my_col +11 +execute __stmt_uv_ ; +my_col +11 +execute __stmt_uv_ ; +my_col +11 +execute __stmt_ph_ using @var_1 ; +my_col +11 +execute __stmt_ph_ using @var_1 ; +my_col +11 +execute __stmt_ph_ using @var_1 ; +my_col +11 +set @string_1= '0.0' ; +set @type_1= 'DOUBLE' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(0.0) as my_col ; +my_col +0 +execute __stmt_c_ ; +my_col +0 +execute __stmt_c_ ; +my_col +0 +execute __stmt_c_ ; +my_col +0 +select ROUND(@var_1 ) as my_col ; +my_col +0 +execute __stmt_uv_ ; +my_col +0 +execute __stmt_uv_ ; +my_col +0 +execute __stmt_uv_ ; +my_col +0 +execute __stmt_ph_ using @var_1 ; +my_col +0 +execute __stmt_ph_ using @var_1 ; +my_col +0 +execute __stmt_ph_ using @var_1 ; +my_col +0 +set @string_1= 'NULL' ; +set @type_1= 'DOUBLE' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(NULL) as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select ROUND(@var_1 ) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ; +my_col +NULL +set @string_1= '-11.49' ; +set @type_1= 'DOUBLE' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(-11.49) as my_col ; +my_col +-11 +execute __stmt_c_ ; +my_col +-11 +execute __stmt_c_ ; +my_col +-11 +execute __stmt_c_ ; +my_col +-11 +select ROUND(@var_1 ) as my_col ; +my_col +-11 +execute __stmt_uv_ ; +my_col +-11 +execute __stmt_uv_ ; +my_col +-11 +execute __stmt_uv_ ; +my_col +-11 +execute __stmt_ph_ using @var_1 ; +my_col +-11 +execute __stmt_ph_ using @var_1 ; +my_col +-11 +execute __stmt_ph_ using @var_1 ; +my_col +-11 +set @string_1= '-10.51' ; +set @type_1= 'DOUBLE' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select ROUND(-10.51) as my_col ; +my_col +-11 +execute __stmt_c_ ; +my_col +-11 +execute __stmt_c_ ; +my_col +-11 +execute __stmt_c_ ; +my_col +-11 +select ROUND(@var_1 ) as my_col ; +my_col +-11 +execute __stmt_uv_ ; +my_col +-11 +execute __stmt_uv_ ; +my_col +-11 +execute __stmt_uv_ ; +my_col +-11 +execute __stmt_ph_ using @var_1 ; +my_col +-11 +execute __stmt_ph_ using @var_1 ; +my_col +-11 +execute __stmt_ph_ using @var_1 ; +my_col +-11 +set @stmt_part_2= 'select ROUND() as my_col' ; +set @max_var_number= 0; +prepare __stmt_c_ from @__stmt_c_ ; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 +select ROUND( ; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 +execute __stmt_c_ ; +ERROR HY000: Unknown prepared statement handler (__stmt_c_) given to EXECUTE +execute __stmt_c_ ; +ERROR HY000: Unknown prepared statement handler (__stmt_c_) given to EXECUTE +execute __stmt_c_ ; +ERROR HY000: Unknown prepared statement handler (__stmt_c_) given to EXECUTE + +###### Variations on CONCAT_WS(separator,str1,str2,...) ###### + +set @stmt_part_1= 'select CONCAT_WS(' ; +set @stmt_part_2= ',' ; +set @stmt_part_3= ',' ; +set @stmt_part_4= ') as my_col' ; +set @max_var_number= 3; +set @string_1= 'S' ; +set @type_1= 'LONGTEXT' ; +set @string_2= 'My' ; +set @type_2= 'LONGTEXT' ; +set @string_3= 'QL' ; +set @type_3= 'LONGTEXT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select CONCAT_WS('S','My','QL') as my_col ; +my_col +MySQL +execute __stmt_c_ ; +my_col +MySQL +execute __stmt_c_ ; +my_col +MySQL +execute __stmt_c_ ; +my_col +MySQL +select CONCAT_WS(@var_1 ,@var_2,@var_3) as my_col ; +my_col +MySQL +execute __stmt_uv_ ; +my_col +MySQL +execute __stmt_uv_ ; +my_col +MySQL +execute __stmt_uv_ ; +my_col +MySQL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +MySQL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +MySQL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +MySQL +set @string_1= 'NULL' ; +set @type_1= 'LONGBLOB' ; +set @string_2= 'My' ; +set @type_2= 'LONGTEXT' ; +set @string_3= 'QL' ; +set @type_3= 'LONGTEXT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select CONCAT_WS(NULL,'My','QL') as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select CONCAT_WS(@var_1 ,@var_2,@var_3) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL +set @type_1= 'BIGINT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select CONCAT_WS(NULL,'My','QL') as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select CONCAT_WS(@var_1 ,@var_2,@var_3) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL +set @type_1= 'DOUBLE' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select CONCAT_WS(NULL,'My','QL') as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select CONCAT_WS(@var_1 ,@var_2,@var_3) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL +set @string_1= 'S' ; +set @type_1= 'LONGTEXT' ; +set @string_2= 'NULL' ; +set @type_2= 'LONGBLOB' ; +set @string_3= 'QL' ; +set @type_3= 'LONGTEXT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select CONCAT_WS('S',NULL,'QL') as my_col ; +my_col +QL +execute __stmt_c_ ; +my_col +QL +execute __stmt_c_ ; +my_col +QL +execute __stmt_c_ ; +my_col +QL +select CONCAT_WS(@var_1 ,@var_2,@var_3) as my_col ; +my_col +QL +execute __stmt_uv_ ; +my_col +QL +execute __stmt_uv_ ; +my_col +QL +execute __stmt_uv_ ; +my_col +QL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +QL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +QL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +QL +set @type_2= 'BIGINT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select CONCAT_WS('S',NULL,'QL') as my_col ; +my_col +QL +execute __stmt_c_ ; +my_col +QL +execute __stmt_c_ ; +my_col +QL +execute __stmt_c_ ; +my_col +QL +select CONCAT_WS(@var_1 ,@var_2,@var_3) as my_col ; +my_col +QL +execute __stmt_uv_ ; +my_col +QL +execute __stmt_uv_ ; +my_col +QL +execute __stmt_uv_ ; +my_col +QL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +QL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +QL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +QL +set @type_2= 'DOUBLE' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select CONCAT_WS('S',NULL,'QL') as my_col ; +my_col +QL +execute __stmt_c_ ; +my_col +QL +execute __stmt_c_ ; +my_col +QL +execute __stmt_c_ ; +my_col +QL +select CONCAT_WS(@var_1 ,@var_2,@var_3) as my_col ; +my_col +QL +execute __stmt_uv_ ; +my_col +QL +execute __stmt_uv_ ; +my_col +QL +execute __stmt_uv_ ; +my_col +QL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +QL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +QL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +QL +set @string_1= 'S' ; +set @type_1= 'LONGTEXT' ; +set @string_2= 'My' ; +set @type_2= 'LONGTEXT' ; +set @string_3= 'NULL' ; +set @type_3= 'LONGTEXT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select CONCAT_WS('S','My',NULL) as my_col ; +my_col +My +execute __stmt_c_ ; +my_col +My +execute __stmt_c_ ; +my_col +My +execute __stmt_c_ ; +my_col +My +select CONCAT_WS(@var_1 ,@var_2,@var_3) as my_col ; +my_col +My +execute __stmt_uv_ ; +my_col +My +execute __stmt_uv_ ; +my_col +My +execute __stmt_uv_ ; +my_col +My +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +My +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +My +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +My +set @type_3= 'BIGINT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select CONCAT_WS('S','My',NULL) as my_col ; +my_col +My +execute __stmt_c_ ; +my_col +My +execute __stmt_c_ ; +my_col +My +execute __stmt_c_ ; +my_col +My +select CONCAT_WS(@var_1 ,@var_2,@var_3) as my_col ; +my_col +My +execute __stmt_uv_ ; +my_col +My +execute __stmt_uv_ ; +my_col +My +execute __stmt_uv_ ; +my_col +My +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +My +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +My +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +My +set @type_3= 'DOUBLE' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select CONCAT_WS('S','My',NULL) as my_col ; +my_col +My +execute __stmt_c_ ; +my_col +My +execute __stmt_c_ ; +my_col +My +execute __stmt_c_ ; +my_col +My +select CONCAT_WS(@var_1 ,@var_2,@var_3) as my_col ; +my_col +My +execute __stmt_uv_ ; +my_col +My +execute __stmt_uv_ ; +my_col +My +execute __stmt_uv_ ; +my_col +My +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +My +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +My +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +My +set @stmt_part_1= "select CONCAT_WS('S',IF(" ; +set @stmt_part_2= ' IS NULL, ' ; +set @stmt_part_3= ' , ' ; +set @stmt_part_4= "),'QL') as my_col" ; +set @max_var_number= 3; +set @string_1= 'My' ; +set @type_1= 'LONGTEXT' ; +set @string_2= 'X' ; +set @type_2= 'LONGTEXT' ; +set @string_3= 'My' ; +set @type_3= 'LONGTEXT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select CONCAT_WS('S',IF('My' IS NULL, 'X' , 'My'),'QL') as my_col ; +my_col +MySQL +execute __stmt_c_ ; +my_col +MySQL +execute __stmt_c_ ; +my_col +MySQL +execute __stmt_c_ ; +my_col +MySQL +select CONCAT_WS('S',IF(@var_1 IS NULL, @var_2 , @var_3),'QL') as my_col ; +my_col +MySQL +execute __stmt_uv_ ; +my_col +MySQL +execute __stmt_uv_ ; +my_col +MySQL +execute __stmt_uv_ ; +my_col +MySQL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +MySQL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +MySQL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +MySQL +set @string_1= 'NULL' ; +set @type_1= 'LONGBLOB' ; +set @string_2= 'X' ; +set @type_2= 'LONGTEXT' ; +set @string_3= 'My' ; +set @type_3= 'LONGTEXT' ; + +###### Variations on CHAR(N,...) ###### + +set @stmt_part_1= 'select CHAR(' ; +set @stmt_part_2= ',' ; +set @stmt_part_3= ',' ; +set @stmt_part_4= ',' ; +set @stmt_part_5= ',' ; +set @stmt_part_6= ') as my_col' ; +set @max_var_number= 5; +set @string_1= '77' ; +set @type_1= 'BIGINT' ; +set @string_2= '121' ; +set @type_2= 'BIGINT' ; +set @string_3= '83' ; +set @type_3= 'BIGINT' ; +set @string_4= '81' ; +set @type_4= 'BIGINT' ; +set @string_5= '76' ; +set @type_5= 'BIGINT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select CHAR(77,121,83,81,76) as my_col ; +my_col +MySQL +execute __stmt_c_ ; +my_col +MySQL +execute __stmt_c_ ; +my_col +MySQL +execute __stmt_c_ ; +my_col +MySQL +select CHAR(@var_1 ,@var_2,@var_3,@var_4,@var_5) as my_col ; +my_col +MySQL +execute __stmt_uv_ ; +my_col +MySQL +execute __stmt_uv_ ; +my_col +MySQL +execute __stmt_uv_ ; +my_col +MySQL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4,@var_5 ; +my_col +MySQL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4,@var_5 ; +my_col +MySQL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4,@var_5 ; +my_col +MySQL +set @string_1= 'NULL' ; +set @type_1= 'BIGINT' ; +set @string_1= '77' ; +set @type_1= 'BIGINT' ; +set @string_2= '121' ; +set @type_2= 'BIGINT' ; +set @string_3= 'NULL' ; +set @type_3= 'BIGINT' ; +set @string_4= '81' ; +set @type_4= 'BIGINT' ; +set @string_5= '76' ; +set @type_5= 'BIGINT' ; +set @string_1= '77' ; +set @type_1= 'BIGINT' ; +set @string_2= '121' ; +set @type_2= 'BIGINT' ; +set @string_3= 'NULL' ; +set @type_3= 'BIGINT' ; +set @string_4= 'NULL' ; +set @type_4= 'BIGINT' ; +set @string_5= '76' ; +set @type_5= 'BIGINT' ; +set @string_1= '77' ; +set @type_1= 'BIGINT' ; +set @string_2= '121' ; +set @type_2= 'BIGINT' ; +set @string_3= '83' ; +set @type_3= 'BIGINT' ; +set @string_4= '81' ; +set @type_4= 'BIGINT' ; +set @string_5= 'NULL' ; +set @type_5= 'BIGINT' ; +set @string_1= 'NULL' ; +set @type_1= 'LONGBLOB' ; +set @string_2= '121' ; +set @type_2= 'BIGINT' ; +set @string_3= '83' ; +set @type_3= 'BIGINT' ; +set @string_4= '81' ; +set @type_4= 'BIGINT' ; +set @string_5= '76' ; +set @type_5= 'BIGINT' ; + +###### Variations on CHAR_LENGTH ###### + +set @stmt_part_1= 'select CHAR_LENGTH(' ; +set @stmt_part_2= ') as my_col' ; +set @max_var_number= 1; +set @string_1= 'MySQL' ; +set @type_1= 'LONGTEXT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select CHAR_LENGTH('MySQL') as my_col ; +my_col +5 +execute __stmt_c_ ; +my_col +5 +execute __stmt_c_ ; +my_col +5 +execute __stmt_c_ ; +my_col +5 +select CHAR_LENGTH(@var_1 ) as my_col ; +my_col +5 +execute __stmt_uv_ ; +my_col +5 +execute __stmt_uv_ ; +my_col +5 +execute __stmt_uv_ ; +my_col +5 +execute __stmt_ph_ using @var_1 ; +my_col +5 +execute __stmt_ph_ using @var_1 ; +my_col +5 +execute __stmt_ph_ using @var_1 ; +my_col +5 +set @string_1= 'NULL' ; +set @type_1= 'LONGTEXT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select CHAR_LENGTH(NULL) as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select CHAR_LENGTH(@var_1 ) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ; +my_col +NULL +set @type_1= 'BIGINT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select CHAR_LENGTH(NULL) as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select CHAR_LENGTH(@var_1 ) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ; +my_col +NULL +set @type_1= 'DOUBLE' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select CHAR_LENGTH(NULL) as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select CHAR_LENGTH(@var_1 ) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ; +my_col +NULL + +###### Variations on FIELD(str,str1,str2,str3,...) ###### + +set @stmt_part_1= 'select FIELD(' ; +set @stmt_part_2= ',' ; +set @stmt_part_3= ',' ; +set @stmt_part_4= ',' ; +set @stmt_part_5= ') as my_col' ; +set @max_var_number= 4; +set @string_1= 'Hit' ; +set @type_1= 'LONGTEXT' ; +set @string_2= '1it' ; +set @type_2= 'LONGTEXT' ; +set @string_3= 'Hit' ; +set @type_3= 'LONGTEXT' ; +set @string_4= '3it' ; +set @type_4= 'LONGTEXT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select FIELD('Hit','1it','Hit','3it') as my_col ; +my_col +2 +execute __stmt_c_ ; +my_col +2 +execute __stmt_c_ ; +my_col +2 +execute __stmt_c_ ; +my_col +2 +select FIELD(@var_1 ,@var_2,@var_3,@var_4) as my_col ; +my_col +2 +execute __stmt_uv_ ; +my_col +2 +execute __stmt_uv_ ; +my_col +2 +execute __stmt_uv_ ; +my_col +2 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +2 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +2 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +2 +set @string_1= 'NULL' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select FIELD(NULL,'1it','Hit','3it') as my_col ; +my_col +0 +execute __stmt_c_ ; +my_col +0 +execute __stmt_c_ ; +my_col +0 +execute __stmt_c_ ; +my_col +0 +select FIELD(@var_1 ,@var_2,@var_3,@var_4) as my_col ; +my_col +0 +execute __stmt_uv_ ; +my_col +0 +execute __stmt_uv_ ; +my_col +0 +execute __stmt_uv_ ; +my_col +0 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +0 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +0 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +0 +set @string_3= 'NULL' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select FIELD(NULL,'1it',NULL,'3it') as my_col ; +my_col +0 +execute __stmt_c_ ; +my_col +0 +execute __stmt_c_ ; +my_col +0 +execute __stmt_c_ ; +my_col +0 +select FIELD(@var_1 ,@var_2,@var_3,@var_4) as my_col ; +my_col +0 +execute __stmt_uv_ ; +my_col +0 +execute __stmt_uv_ ; +my_col +0 +execute __stmt_uv_ ; +my_col +0 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +0 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +0 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +0 + +###### Variations on INSERT(str,pos,len,newstr) ###### + +set @stmt_part_1= "select INSERT(" ; +set @stmt_part_2= ',' ; +set @stmt_part_3= ',' ; +set @stmt_part_4= ',' ; +set @stmt_part_5= ") as my_col" ; +set @max_var_number= 4; +set @string_1= 'ABCDEFGHI' ; +set @type_1= 'LONGTEXT' ; +set @string_2= '3' ; +set @type_2= 'BIGINT' ; +set @string_3= '4' ; +set @type_3= 'BIGINT' ; +set @string_4= '1234' ; +set @type_4= 'LONGTEXT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select INSERT('ABCDEFGHI',3,4,'1234') as my_col ; +my_col +AB1234GHI +execute __stmt_c_ ; +my_col +AB1234GHI +execute __stmt_c_ ; +my_col +AB1234GHI +execute __stmt_c_ ; +my_col +AB1234GHI +select INSERT(@var_1 ,@var_2,@var_3,@var_4) as my_col ; +my_col +AB1234GHI +execute __stmt_uv_ ; +my_col +AB1234GHI +execute __stmt_uv_ ; +my_col +AB1234GHI +execute __stmt_uv_ ; +my_col +AB1234GHI +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +AB1234GHI +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +AB1234GHI +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +AB1234GHI +set @string_2= '+30.0E-1' ; +set @type_2= 'DOUBLE' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select INSERT('ABCDEFGHI',+30.0E-1,4,'1234') as my_col ; +my_col +AB1234GHI +execute __stmt_c_ ; +my_col +AB1234GHI +execute __stmt_c_ ; +my_col +AB1234GHI +execute __stmt_c_ ; +my_col +AB1234GHI +select INSERT(@var_1 ,@var_2,@var_3,@var_4) as my_col ; +my_col +AB1234GHI +execute __stmt_uv_ ; +my_col +AB1234GHI +execute __stmt_uv_ ; +my_col +AB1234GHI +execute __stmt_uv_ ; +my_col +AB1234GHI +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +AB1234GHI +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +AB1234GHI +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +AB1234GHI +set @string_2= '3' ; +set @type_2= 'BIGINT' ; +set @string_3= '+40.0E-1' ; +set @type_3= 'DOUBLE' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select INSERT('ABCDEFGHI',3,+40.0E-1,'1234') as my_col ; +my_col +AB1234GHI +execute __stmt_c_ ; +my_col +AB1234GHI +execute __stmt_c_ ; +my_col +AB1234GHI +execute __stmt_c_ ; +my_col +AB1234GHI +select INSERT(@var_1 ,@var_2,@var_3,@var_4) as my_col ; +my_col +AB1234GHI +execute __stmt_uv_ ; +my_col +AB1234GHI +execute __stmt_uv_ ; +my_col +AB1234GHI +execute __stmt_uv_ ; +my_col +AB1234GHI +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +AB1234GHI +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +AB1234GHI +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +AB1234GHI +set @string_1= 'NULL' ; +set @type_1= 'LONGTEXT' ; +set @string_2= '3' ; +set @type_2= 'BIGINT' ; +set @string_3= '4' ; +set @type_3= 'BIGINT' ; +set @string_4= '1234' ; +set @type_4= 'LONGTEXT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select INSERT(NULL,3,4,'1234') as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select INSERT(@var_1 ,@var_2,@var_3,@var_4) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +NULL +set @string_1= 'ABCDEFGHI' ; +set @type_1= 'LONGTEXT' ; +set @string_2= 'NULL' ; +set @type_2= 'BIGINT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select INSERT('ABCDEFGHI',NULL,4,'1234') as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select INSERT(@var_1 ,@var_2,@var_3,@var_4) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +NULL +set @string_2= '3' ; +set @type_2= 'BIGINT' ; +set @string_3= 'NULL' ; +set @type_3= 'BIGINT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select INSERT('ABCDEFGHI',3,NULL,'1234') as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select INSERT(@var_1 ,@var_2,@var_3,@var_4) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +NULL +set @string_3= '4' ; +set @type_3= 'BIGINT' ; +set @string_4= 'NULL' ; +set @type_4= 'LONGTEXT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select INSERT('ABCDEFGHI',3,4,NULL) as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select INSERT(@var_1 ,@var_2,@var_3,@var_4) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +NULL +set @string_1= 'ABCDEFGHI' ; +set @type_1= 'LONGTEXT' ; +set @string_2= '3' ; +set @type_2= 'BIGINT' ; +set @string_3= '4' ; +set @type_3= 'BIGINT' ; +set @string_4= '1234' ; +set @type_4= 'LONGTEXT' ; +set @string_2= '15' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select INSERT('ABCDEFGHI',15,4,'1234') as my_col ; +my_col +ABCDEFGHI +execute __stmt_c_ ; +my_col +ABCDEFGHI +execute __stmt_c_ ; +my_col +ABCDEFGHI +execute __stmt_c_ ; +my_col +ABCDEFGHI +select INSERT(@var_1 ,@var_2,@var_3,@var_4) as my_col ; +my_col +ABCDEFGHI +execute __stmt_uv_ ; +my_col +ABCDEFGHI +execute __stmt_uv_ ; +my_col +ABCDEFGHI +execute __stmt_uv_ ; +my_col +ABCDEFGHI +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +ABCDEFGHI +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +ABCDEFGHI +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +ABCDEFGHI +set @string_2= '0' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select INSERT('ABCDEFGHI',0,4,'1234') as my_col ; +my_col +ABCDEFGHI +execute __stmt_c_ ; +my_col +ABCDEFGHI +execute __stmt_c_ ; +my_col +ABCDEFGHI +execute __stmt_c_ ; +my_col +ABCDEFGHI +select INSERT(@var_1 ,@var_2,@var_3,@var_4) as my_col ; +my_col +ABCDEFGHI +execute __stmt_uv_ ; +my_col +ABCDEFGHI +execute __stmt_uv_ ; +my_col +ABCDEFGHI +execute __stmt_uv_ ; +my_col +ABCDEFGHI +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +ABCDEFGHI +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +ABCDEFGHI +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +ABCDEFGHI +set @string_2= '-1' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select INSERT('ABCDEFGHI',-1,4,'1234') as my_col ; +my_col +ABCDEFGHI +execute __stmt_c_ ; +my_col +ABCDEFGHI +execute __stmt_c_ ; +my_col +ABCDEFGHI +execute __stmt_c_ ; +my_col +ABCDEFGHI +select INSERT(@var_1 ,@var_2,@var_3,@var_4) as my_col ; +my_col +ABCDEFGHI +execute __stmt_uv_ ; +my_col +ABCDEFGHI +execute __stmt_uv_ ; +my_col +ABCDEFGHI +execute __stmt_uv_ ; +my_col +ABCDEFGHI +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +ABCDEFGHI +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +ABCDEFGHI +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +ABCDEFGHI +set @string_1= 'ABCDEFGHI' ; +set @type_1= 'LONGTEXT' ; +set @string_2= '3' ; +set @type_2= 'BIGINT' ; +set @string_3= '4' ; +set @type_3= 'BIGINT' ; +set @string_4= '1234' ; +set @type_4= 'LONGTEXT' ; +set @string_3= '10' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select INSERT('ABCDEFGHI',3,10,'1234') as my_col ; +my_col +AB1234 +execute __stmt_c_ ; +my_col +AB1234 +execute __stmt_c_ ; +my_col +AB1234 +execute __stmt_c_ ; +my_col +AB1234 +select INSERT(@var_1 ,@var_2,@var_3,@var_4) as my_col ; +my_col +AB1234 +execute __stmt_uv_ ; +my_col +AB1234 +execute __stmt_uv_ ; +my_col +AB1234 +execute __stmt_uv_ ; +my_col +AB1234 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +AB1234 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +AB1234 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +AB1234 +set @string_3= '5' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select INSERT('ABCDEFGHI',3,5,'1234') as my_col ; +my_col +AB1234HI +execute __stmt_c_ ; +my_col +AB1234HI +execute __stmt_c_ ; +my_col +AB1234HI +execute __stmt_c_ ; +my_col +AB1234HI +select INSERT(@var_1 ,@var_2,@var_3,@var_4) as my_col ; +my_col +AB1234HI +execute __stmt_uv_ ; +my_col +AB1234HI +execute __stmt_uv_ ; +my_col +AB1234HI +execute __stmt_uv_ ; +my_col +AB1234HI +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +AB1234HI +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +AB1234HI +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +AB1234HI +set @string_3= '0' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select INSERT('ABCDEFGHI',3,0,'1234') as my_col ; +my_col +AB1234CDEFGHI +execute __stmt_c_ ; +my_col +AB1234CDEFGHI +execute __stmt_c_ ; +my_col +AB1234CDEFGHI +execute __stmt_c_ ; +my_col +AB1234CDEFGHI +select INSERT(@var_1 ,@var_2,@var_3,@var_4) as my_col ; +my_col +AB1234CDEFGHI +execute __stmt_uv_ ; +my_col +AB1234CDEFGHI +execute __stmt_uv_ ; +my_col +AB1234CDEFGHI +execute __stmt_uv_ ; +my_col +AB1234CDEFGHI +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +AB1234CDEFGHI +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +AB1234CDEFGHI +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +AB1234CDEFGHI +set @string_3= '-1' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select INSERT('ABCDEFGHI',3,-1,'1234') as my_col ; +my_col +AB1234 +execute __stmt_c_ ; +my_col +AB1234 +execute __stmt_c_ ; +my_col +AB1234 +execute __stmt_c_ ; +my_col +AB1234 +select INSERT(@var_1 ,@var_2,@var_3,@var_4) as my_col ; +my_col +AB1234 +execute __stmt_uv_ ; +my_col +AB1234 +execute __stmt_uv_ ; +my_col +AB1234 +execute __stmt_uv_ ; +my_col +AB1234 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +AB1234 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +AB1234 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; +my_col +AB1234 + +###### Variations on BIN(N) ###### + +set @stmt_part_1= "select BIN(" ; +set @stmt_part_2= ") as my_col" ; +set @max_var_number= 1; +set @string_1= '12' ; +set @type_1= 'BIGINT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select BIN(12) as my_col ; +my_col +1100 +execute __stmt_c_ ; +my_col +1100 +execute __stmt_c_ ; +my_col +1100 +execute __stmt_c_ ; +my_col +1100 +select BIN(@var_1 ) as my_col ; +my_col +1100 +execute __stmt_uv_ ; +my_col +1100 +execute __stmt_uv_ ; +my_col +1100 +execute __stmt_uv_ ; +my_col +1100 +execute __stmt_ph_ using @var_1 ; +my_col +1100 +execute __stmt_ph_ using @var_1 ; +my_col +1100 +execute __stmt_ph_ using @var_1 ; +my_col +1100 +set @string_1= 'NULL' ; +set @type_1= 'BIGINT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select BIN(NULL) as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select BIN(@var_1 ) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ; +my_col +NULL +set @string_1= '2147483648' ; +set @type_1= 'BIGINT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select BIN(2147483648) as my_col ; +my_col +10000000000000000000000000000000 +execute __stmt_c_ ; +my_col +10000000000000000000000000000000 +execute __stmt_c_ ; +my_col +10000000000000000000000000000000 +execute __stmt_c_ ; +my_col +10000000000000000000000000000000 +select BIN(@var_1 ) as my_col ; +my_col +10000000000000000000000000000000 +execute __stmt_uv_ ; +my_col +10000000000000000000000000000000 +execute __stmt_uv_ ; +my_col +10000000000000000000000000000000 +execute __stmt_uv_ ; +my_col +10000000000000000000000000000000 +execute __stmt_ph_ using @var_1 ; +my_col +10000000000000000000000000000000 +execute __stmt_ph_ using @var_1 ; +my_col +10000000000000000000000000000000 +execute __stmt_ph_ using @var_1 ; +my_col +10000000000000000000000000000000 +set @string_1= '0' ; +set @type_1= 'BIGINT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select BIN(0) as my_col ; +my_col +0 +execute __stmt_c_ ; +my_col +0 +execute __stmt_c_ ; +my_col +0 +execute __stmt_c_ ; +my_col +0 +select BIN(@var_1 ) as my_col ; +my_col +0 +execute __stmt_uv_ ; +my_col +0 +execute __stmt_uv_ ; +my_col +0 +execute __stmt_uv_ ; +my_col +0 +execute __stmt_ph_ using @var_1 ; +my_col +0 +execute __stmt_ph_ using @var_1 ; +my_col +0 +execute __stmt_ph_ using @var_1 ; +my_col +0 +set @string_1= '-1' ; +set @type_1= 'BIGINT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select BIN(-1) as my_col ; +my_col +1111111111111111111111111111111111111111111111111111111111111111 +execute __stmt_c_ ; +my_col +1111111111111111111111111111111111111111111111111111111111111111 +execute __stmt_c_ ; +my_col +1111111111111111111111111111111111111111111111111111111111111111 +execute __stmt_c_ ; +my_col +1111111111111111111111111111111111111111111111111111111111111111 +select BIN(@var_1 ) as my_col ; +my_col +1111111111111111111111111111111111111111111111111111111111111111 +execute __stmt_uv_ ; +my_col +1111111111111111111111111111111111111111111111111111111111111111 +execute __stmt_uv_ ; +my_col +1111111111111111111111111111111111111111111111111111111111111111 +execute __stmt_uv_ ; +my_col +1111111111111111111111111111111111111111111111111111111111111111 +execute __stmt_ph_ using @var_1 ; +my_col +1111111111111111111111111111111111111111111111111111111111111111 +execute __stmt_ph_ using @var_1 ; +my_col +1111111111111111111111111111111111111111111111111111111111111111 +execute __stmt_ph_ using @var_1 ; +my_col +1111111111111111111111111111111111111111111111111111111111111111 +set @string_1= '9000000000000000000' ; +set @type_1= 'BIGINT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select BIN(9000000000000000000) as my_col ; +my_col +111110011100110011011000101000011100010100001000000000000000000 +execute __stmt_c_ ; +my_col +111110011100110011011000101000011100010100001000000000000000000 +execute __stmt_c_ ; +my_col +111110011100110011011000101000011100010100001000000000000000000 +execute __stmt_c_ ; +my_col +111110011100110011011000101000011100010100001000000000000000000 +select BIN(@var_1 ) as my_col ; +my_col +111110011100110011011000101000011100010100001000000000000000000 +execute __stmt_uv_ ; +my_col +111110011100110011011000101000011100010100001000000000000000000 +execute __stmt_uv_ ; +my_col +111110011100110011011000101000011100010100001000000000000000000 +execute __stmt_uv_ ; +my_col +111110011100110011011000101000011100010100001000000000000000000 +execute __stmt_ph_ using @var_1 ; +my_col +111110011100110011011000101000011100010100001000000000000000000 +execute __stmt_ph_ using @var_1 ; +my_col +111110011100110011011000101000011100010100001000000000000000000 +execute __stmt_ph_ using @var_1 ; +my_col +111110011100110011011000101000011100010100001000000000000000000 +set @string_1= '12.9E-0' ; +set @type_1= 'DOUBLE' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select BIN(12.9E-0) as my_col ; +my_col +1100 +execute __stmt_c_ ; +my_col +1100 +execute __stmt_c_ ; +my_col +1100 +execute __stmt_c_ ; +my_col +1100 +select BIN(@var_1 ) as my_col ; +my_col +1100 +execute __stmt_uv_ ; +my_col +1100 +execute __stmt_uv_ ; +my_col +1100 +execute __stmt_uv_ ; +my_col +1100 +execute __stmt_ph_ using @var_1 ; +my_col +1100 +execute __stmt_ph_ using @var_1 ; +my_col +1100 +execute __stmt_ph_ using @var_1 ; +my_col +1100 +set @string_1= '0.129E+2' ; +set @type_1= 'DOUBLE' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select BIN(0.129E+2) as my_col ; +my_col +1100 +execute __stmt_c_ ; +my_col +1100 +execute __stmt_c_ ; +my_col +1100 +execute __stmt_c_ ; +my_col +1100 +select BIN(@var_1 ) as my_col ; +my_col +1100 +execute __stmt_uv_ ; +my_col +1100 +execute __stmt_uv_ ; +my_col +1100 +execute __stmt_uv_ ; +my_col +1100 +execute __stmt_ph_ using @var_1 ; +my_col +1100 +execute __stmt_ph_ using @var_1 ; +my_col +1100 +execute __stmt_ph_ using @var_1 ; +my_col +1100 + +###### Variations on BIT_LENGT(str) ###### + +set @stmt_part_1= "select BIT_LENGTH(" ; +set @stmt_part_2= ") as my_col" ; +set @max_var_number= 1; +set @string_1= 'text' ; +set @type_1= 'LONGTEXT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select BIT_LENGTH('text') as my_col ; +my_col +32 +execute __stmt_c_ ; +my_col +32 +execute __stmt_c_ ; +my_col +32 +execute __stmt_c_ ; +my_col +32 +select BIT_LENGTH(@var_1 ) as my_col ; +my_col +32 +execute __stmt_uv_ ; +my_col +32 +execute __stmt_uv_ ; +my_col +32 +execute __stmt_uv_ ; +my_col +32 +execute __stmt_ph_ using @var_1 ; +my_col +32 +execute __stmt_ph_ using @var_1 ; +my_col +32 +execute __stmt_ph_ using @var_1 ; +my_col +32 +set @string_1= 'NULL' ; +set @type_1= 'LONGTEXT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select BIT_LENGTH(NULL) as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select BIT_LENGTH(@var_1 ) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ; +my_col +NULL + +###### Variations on CONV(N,from_base,to_base) ###### + +set @stmt_part_1= "select CONV(" ; +set @stmt_part_2= "," ; +set @stmt_part_3= "," ; +set @stmt_part_4= ") as my_col" ; +set @max_var_number= 3; +set @string_1= '37' ; +set @type_1= 'BIGINT' ; +set @string_2= '10' ; +set @type_2= 'BIGINT' ; +set @string_3= '10' ; +set @type_3= 'BIGINT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select CONV(37,10,10) as my_col ; +my_col +37 +execute __stmt_c_ ; +my_col +37 +execute __stmt_c_ ; +my_col +37 +execute __stmt_c_ ; +my_col +37 +select CONV(@var_1 ,@var_2,@var_3) as my_col ; +my_col +37 +execute __stmt_uv_ ; +my_col +37 +execute __stmt_uv_ ; +my_col +37 +execute __stmt_uv_ ; +my_col +37 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +37 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +37 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +37 +set @string_1= '-37' ; +set @type_1= 'BIGINT' ; +set @string_2= '10' ; +set @type_2= 'BIGINT' ; +set @string_3= '10' ; +set @type_3= 'BIGINT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select CONV(-37,10,10) as my_col ; +my_col +18446744073709551579 +execute __stmt_c_ ; +my_col +18446744073709551579 +execute __stmt_c_ ; +my_col +18446744073709551579 +execute __stmt_c_ ; +my_col +18446744073709551579 +select CONV(@var_1 ,@var_2,@var_3) as my_col ; +my_col +18446744073709551579 +execute __stmt_uv_ ; +my_col +18446744073709551579 +execute __stmt_uv_ ; +my_col +18446744073709551579 +execute __stmt_uv_ ; +my_col +18446744073709551579 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +18446744073709551579 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +18446744073709551579 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +18446744073709551579 +set @string_1= CAST(CAST(-37 AS unsigned INTEGER) AS CHAR); +set @type_1= 'LONGTEXT' ; +set @string_2= '10' ; +set @type_2= 'BIGINT' ; +set @string_3= '10' ; +set @type_3= 'BIGINT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select CONV('18446744073709551579',10,10) as my_col ; +my_col +18446744073709551579 +execute __stmt_c_ ; +my_col +18446744073709551579 +execute __stmt_c_ ; +my_col +18446744073709551579 +execute __stmt_c_ ; +my_col +18446744073709551579 +select CONV(@var_1 ,@var_2,@var_3) as my_col ; +my_col +18446744073709551579 +execute __stmt_uv_ ; +my_col +18446744073709551579 +execute __stmt_uv_ ; +my_col +18446744073709551579 +execute __stmt_uv_ ; +my_col +18446744073709551579 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +18446744073709551579 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +18446744073709551579 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +18446744073709551579 +set @string_1= '37' ; +set @type_1= 'BIGINT' ; +set @string_2= '10' ; +set @type_2= 'BIGINT' ; +set @string_3= '-10' ; +set @type_3= 'BIGINT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select CONV(37,10,-10) as my_col ; +my_col +37 +execute __stmt_c_ ; +my_col +37 +execute __stmt_c_ ; +my_col +37 +execute __stmt_c_ ; +my_col +37 +select CONV(@var_1 ,@var_2,@var_3) as my_col ; +my_col +37 +execute __stmt_uv_ ; +my_col +37 +execute __stmt_uv_ ; +my_col +37 +execute __stmt_uv_ ; +my_col +37 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +37 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +37 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +37 +set @string_1= '-37' ; +set @type_1= 'BIGINT' ; +set @string_2= '10' ; +set @type_2= 'BIGINT' ; +set @string_3= '-10' ; +set @type_3= 'BIGINT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select CONV(-37,10,-10) as my_col ; +my_col +-37 +execute __stmt_c_ ; +my_col +-37 +execute __stmt_c_ ; +my_col +-37 +execute __stmt_c_ ; +my_col +-37 +select CONV(@var_1 ,@var_2,@var_3) as my_col ; +my_col +-37 +execute __stmt_uv_ ; +my_col +-37 +execute __stmt_uv_ ; +my_col +-37 +execute __stmt_uv_ ; +my_col +-37 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +-37 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +-37 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +-37 +set @string_1= '9' ; +set @type_1= 'BIGINT' ; +set @string_2= '10' ; +set @type_2= 'BIGINT' ; +set @string_3= '11' ; +set @type_3= 'BIGINT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select CONV(9,10,11) as my_col ; +my_col +9 +execute __stmt_c_ ; +my_col +9 +execute __stmt_c_ ; +my_col +9 +execute __stmt_c_ ; +my_col +9 +select CONV(@var_1 ,@var_2,@var_3) as my_col ; +my_col +9 +execute __stmt_uv_ ; +my_col +9 +execute __stmt_uv_ ; +my_col +9 +execute __stmt_uv_ ; +my_col +9 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +9 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +9 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +9 +set @string_1= '9' ; +set @type_1= 'BIGINT' ; +set @string_2= '11' ; +set @type_2= 'BIGINT' ; +set @string_3= '10' ; +set @type_3= 'BIGINT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select CONV(9,11,10) as my_col ; +my_col +9 +execute __stmt_c_ ; +my_col +9 +execute __stmt_c_ ; +my_col +9 +execute __stmt_c_ ; +my_col +9 +select CONV(@var_1 ,@var_2,@var_3) as my_col ; +my_col +9 +execute __stmt_uv_ ; +my_col +9 +execute __stmt_uv_ ; +my_col +9 +execute __stmt_uv_ ; +my_col +9 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +9 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +9 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +9 +set @string_1= '10' ; +set @type_1= 'BIGINT' ; +set @string_2= '10' ; +set @type_2= 'BIGINT' ; +set @string_3= '11' ; +set @type_3= 'BIGINT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select CONV(10,10,11) as my_col ; +my_col +A +execute __stmt_c_ ; +my_col +A +execute __stmt_c_ ; +my_col +A +execute __stmt_c_ ; +my_col +A +select CONV(@var_1 ,@var_2,@var_3) as my_col ; +my_col +A +execute __stmt_uv_ ; +my_col +A +execute __stmt_uv_ ; +my_col +A +execute __stmt_uv_ ; +my_col +A +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +A +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +A +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +A +set @string_1= 'A' ; +set @type_1= 'LONGTEXT' ; +set @string_2= '11' ; +set @type_2= 'BIGINT' ; +set @string_3= '10' ; +set @type_3= 'BIGINT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select CONV('A',11,10) as my_col ; +my_col +10 +execute __stmt_c_ ; +my_col +10 +execute __stmt_c_ ; +my_col +10 +execute __stmt_c_ ; +my_col +10 +select CONV(@var_1 ,@var_2,@var_3) as my_col ; +my_col +10 +execute __stmt_uv_ ; +my_col +10 +execute __stmt_uv_ ; +my_col +10 +execute __stmt_uv_ ; +my_col +10 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +10 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +10 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +10 +set @string_1= '11' ; +set @type_1= 'BIGINT' ; +set @string_2= '10' ; +set @type_2= 'BIGINT' ; +set @string_3= '11' ; +set @type_3= 'BIGINT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select CONV(11,10,11) as my_col ; +my_col +10 +execute __stmt_c_ ; +my_col +10 +execute __stmt_c_ ; +my_col +10 +execute __stmt_c_ ; +my_col +10 +select CONV(@var_1 ,@var_2,@var_3) as my_col ; +my_col +10 +execute __stmt_uv_ ; +my_col +10 +execute __stmt_uv_ ; +my_col +10 +execute __stmt_uv_ ; +my_col +10 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +10 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +10 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +10 +set @string_1= '10' ; +set @type_1= 'BIGINT' ; +set @string_2= '11' ; +set @type_2= 'BIGINT' ; +set @string_3= '10' ; +set @type_3= 'BIGINT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select CONV(10,11,10) as my_col ; +my_col +11 +execute __stmt_c_ ; +my_col +11 +execute __stmt_c_ ; +my_col +11 +execute __stmt_c_ ; +my_col +11 +select CONV(@var_1 ,@var_2,@var_3) as my_col ; +my_col +11 +execute __stmt_uv_ ; +my_col +11 +execute __stmt_uv_ ; +my_col +11 +execute __stmt_uv_ ; +my_col +11 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +11 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +11 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +11 +set @string_1= '37' ; +set @type_1= 'BIGINT' ; +set @string_2= '10' ; +set @type_2= 'BIGINT' ; +set @string_3= '36' ; +set @type_3= 'BIGINT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select CONV(37,10,36) as my_col ; +my_col +11 +execute __stmt_c_ ; +my_col +11 +execute __stmt_c_ ; +my_col +11 +execute __stmt_c_ ; +my_col +11 +select CONV(@var_1 ,@var_2,@var_3) as my_col ; +my_col +11 +execute __stmt_uv_ ; +my_col +11 +execute __stmt_uv_ ; +my_col +11 +execute __stmt_uv_ ; +my_col +11 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +11 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +11 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +11 +set @string_1= '11' ; +set @type_1= 'BIGINT' ; +set @string_2= '36' ; +set @type_2= 'BIGINT' ; +set @string_3= '10' ; +set @type_3= 'BIGINT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select CONV(11,36,10) as my_col ; +my_col +37 +execute __stmt_c_ ; +my_col +37 +execute __stmt_c_ ; +my_col +37 +execute __stmt_c_ ; +my_col +37 +select CONV(@var_1 ,@var_2,@var_3) as my_col ; +my_col +37 +execute __stmt_uv_ ; +my_col +37 +execute __stmt_uv_ ; +my_col +37 +execute __stmt_uv_ ; +my_col +37 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +37 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +37 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +37 +set @string_1= 'NULL' ; +set @type_1= 'BIGINT' ; +set @string_2= '10' ; +set @type_2= 'BIGINT' ; +set @string_3= '10' ; +set @type_3= 'BIGINT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select CONV(NULL,10,10) as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select CONV(@var_1 ,@var_2,@var_3) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL +set @string_1= '37' ; +set @string_2= 'NULL' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select CONV(37,NULL,10) as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select CONV(@var_1 ,@var_2,@var_3) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL +set @string_2= '10' ; +set @string_3= 'NULL' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select CONV(37,10,NULL) as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select CONV(@var_1 ,@var_2,@var_3) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL +set @string_3= '10' ; +set @string_1= '9' ; +set @type_1= 'BIGINT' ; +set @string_2= '37' ; +set @type_2= 'BIGINT' ; +set @string_3= '10' ; +set @type_3= 'BIGINT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select CONV(9,37,10) as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select CONV(@var_1 ,@var_2,@var_3) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL +set @string_1= '9' ; +set @type_1= 'BIGINT' ; +set @string_2= '1' ; +set @type_2= 'BIGINT' ; +set @string_3= '10' ; +set @type_3= 'BIGINT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select CONV(9,1,10) as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select CONV(@var_1 ,@var_2,@var_3) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL +set @string_1= '9' ; +set @type_1= 'BIGINT' ; +set @string_2= '0' ; +set @type_2= 'BIGINT' ; +set @string_3= '10' ; +set @type_3= 'BIGINT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select CONV(9,0,10) as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select CONV(@var_1 ,@var_2,@var_3) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL +set @string_1= '9' ; +set @type_1= 'BIGINT' ; +set @string_2= '-1' ; +set @type_2= 'BIGINT' ; +set @string_3= '10' ; +set @type_3= 'BIGINT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select CONV(9,-1,10) as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select CONV(@var_1 ,@var_2,@var_3) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL +set @string_1= '9' ; +set @type_1= 'BIGINT' ; +set @string_2= '10' ; +set @type_2= 'BIGINT' ; +set @string_3= '37' ; +set @type_3= 'BIGINT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select CONV(9,10,37) as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select CONV(@var_1 ,@var_2,@var_3) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL +set @string_1= '9' ; +set @type_1= 'BIGINT' ; +set @string_2= '10' ; +set @type_2= 'BIGINT' ; +set @string_3= '1' ; +set @type_3= 'BIGINT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select CONV(9,10,1) as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select CONV(@var_1 ,@var_2,@var_3) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL +set @string_1= '9' ; +set @type_1= 'BIGINT' ; +set @string_2= '0' ; +set @type_2= 'BIGINT' ; +set @string_3= '0' ; +set @type_3= 'BIGINT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select CONV(9,0,0) as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select CONV(@var_1 ,@var_2,@var_3) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL +set @string_1= '9' ; +set @type_1= 'BIGINT' ; +set @string_2= '10' ; +set @type_2= 'BIGINT' ; +set @string_3= '-1' ; +set @type_3= 'BIGINT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select CONV(9,10,-1) as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select CONV(@var_1 ,@var_2,@var_3) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL +set @string_1= '9' ; +set @type_1= 'BIGINT' ; +set @string_2= '10' ; +set @type_2= 'BIGINT' ; +set @string_3= '-37' ; +set @type_3= 'BIGINT' ; +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +select CONV(9,10,-37) as my_col ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +execute __stmt_c_ ; +my_col +NULL +select CONV(@var_1 ,@var_2,@var_3) as my_col ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_uv_ ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; +my_col +NULL diff --git a/mysql-test/r/tool_test.result b/mysql-test/r/tool_test.result new file mode 100644 index 00000000000..7be7645d8eb --- /dev/null +++ b/mysql-test/r/tool_test.result @@ -0,0 +1,223 @@ +use test ; +set @stmt_part_1= 'SELECT 1 as "my_fine_statement"' ; +set @max_var_number= 0; +the content of the statement variable +-------------------------------------- +@__stmt_c_ is: SELECT 1 as "my_fine_statement" +prepare __stmt_c_ from @__stmt_c_ ; +SELECT 1 as "my_fine_statement" ; +my_fine_statement +1 +execute __stmt_c_ ; +my_fine_statement +1 +execute __stmt_c_ ; +my_fine_statement +1 +execute __stmt_c_ ; +my_fine_statement +1 +set @stmt_part_1= 'SELECT ' ; +set @stmt_part_2= ' + ' ; +set @stmt_part_3= ' + ' ; +set @stmt_part_4= ' + ' ; +set @stmt_part_5= ' + ' ; +set @stmt_part_6= ' + ' ; +set @stmt_part_7= ' + ' ; +set @stmt_part_8= ' + ' ; +set @stmt_part_9= ' as "my_fine_statement"' ; +set @max_var_number= 8; +set @string_1= '1' ; +set @type_1= 'BIGINT' ; +set @string_2= 'nULL' ; +set @type_2= 'BIGINT' ; +set @string_3= '2.0' ; +set @type_3= 'DOUBLE' ; +set @string_4= 'NuLL' ; +set @type_4= 'DOUBLE' ; +set @string_5= 'TEXT' ; +set @type_5= 'LONGTEXT' ; +set @string_6= 'NUlL' ; +set @type_6= 'LONGTEXT' ; +set @string_7= 'BLOB' ; +set @type_7= 'LONGBLOB' ; +set @string_8= 'NULl' ; +set @type_8= 'LONGBLOB' ; +set @var_1= 'YYYYYYYY' ; +set @var_2= 'YYYYYYYY' ; +set @var_3= 'YYYYYYYY' ; +set @var_4= 'YYYYYYYY' ; +set @var_5= 'YYYYYYYY' ; +set @var_6= 'YYYYYYYY' ; +set @var_7= 'YYYYYYYY' ; +set @var_8= 'YYYYYYYY' ; +the content of the statement variables +-------------------------------------- +@__stmt_c_ is: SELECT 1 + NULL + 2.0 + NULL + 'TEXT' + NULL + 'BLOB' + NULL as "my_fine_statement" +@__stmt_uv_ is: SELECT @var_1 + @var_2 + @var_3 + @var_4 + @var_5 + @var_6 + @var_7 + @var_8 as "my_fine_statement" +@__stmt_ph_ is: SELECT ? + ? + ? + ? + ? + ? + ? + ? as "my_fine_statement" +@__execute_stmt_ph is: execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4,@var_5,@var_6,@var_7,@var_8 +the content of the parameter variables +-------------------------------------- +type string uservariable +BIGINT 1 1 +type string uservariable +BIGINT nULL NULL +type string uservariable +DOUBLE 2.0 2 +type string uservariable +DOUBLE NuLL NULL +type string uservariable +LONGTEXT TEXT TEXT +type string uservariable +LONGTEXT NUlL NULL +type string uservariable +LONGBLOB BLOB BLOB +type string uservariable +LONGBLOB NULl NULL +@var_1 @var_2 @var_3 @var_4 @var_5 @var_6 @var_7 @var_8 +1 NULL 2 NULL TEXT NULL BLOB NULL +Table Create Table +t9 CREATE TABLE `t9` ( + `@var_1` bigint(20) default NULL, + `@var_2` bigint(20) default NULL, + `@var_3` double default NULL, + `@var_4` double default NULL, + `@var_5` longtext, + `@var_6` longtext, + `@var_7` longblob, + `@var_8` longblob +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +SELECT 1 + NULL + 2.0 + NULL + 'TEXT' + NULL + 'BLOB' + NULL as "my_fine_statement" ; +my_fine_statement +NULL +execute __stmt_c_ ; +my_fine_statement +NULL +execute __stmt_c_ ; +my_fine_statement +NULL +execute __stmt_c_ ; +my_fine_statement +NULL +SELECT @var_1 + @var_2 + @var_3 + @var_4 + @var_5 + @var_6 + @var_7 + @var_8 as "my_fine_statement" ; +my_fine_statement +NULL +execute __stmt_uv_ ; +my_fine_statement +NULL +execute __stmt_uv_ ; +my_fine_statement +NULL +execute __stmt_uv_ ; +my_fine_statement +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4,@var_5,@var_6,@var_7,@var_8 ; +my_fine_statement +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4,@var_5,@var_6,@var_7,@var_8 ; +my_fine_statement +NULL +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4,@var_5,@var_6,@var_7,@var_8 ; +my_fine_statement +NULL +set @string_1= '1.0' ; +set @type_1= 'DOUBLE' ; +set @string_2= '3.0' ; +set @type_2= 'DOUBLE' ; +set @string_3= '2' ; +set @type_3= 'BIGINT' ; +set @string_4= '4' ; +set @type_4= 'BIGINT' ; +set @string_5= '5' ; +set @type_5= 'BIGINT' ; +set @string_6= '6' ; +set @type_6= 'DOUBLE' ; +set @string_7= '7' ; +set @type_7= 'DOUBLE' ; +set @string_8= '8' ; +set @type_8= 'DOUBLE' ; +set @var_1= 'YYYYYYYY' ; +set @var_2= 'YYYYYYYY' ; +set @var_3= 'YYYYYYYY' ; +set @var_4= 'YYYYYYYY' ; +set @var_5= 'YYYYYYYY' ; +set @var_6= 'YYYYYYYY' ; +set @var_7= 'YYYYYYYY' ; +set @var_8= 'YYYYYYYY' ; +the content of the statement variables +-------------------------------------- +@__stmt_c_ is: SELECT 1.0 + 3.0 + 2 + 4 + 5 + 6 + 7 + 8 as "my_fine_statement" +@__stmt_uv_ is: SELECT @var_1 + @var_2 + @var_3 + @var_4 + @var_5 + @var_6 + @var_7 + @var_8 as "my_fine_statement" +@__stmt_ph_ is: SELECT ? + ? + ? + ? + ? + ? + ? + ? as "my_fine_statement" +@__execute_stmt_ph is: execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4,@var_5,@var_6,@var_7,@var_8 +the content of the parameter variables +-------------------------------------- +type string uservariable +DOUBLE 1.0 1 +type string uservariable +DOUBLE 3.0 3 +type string uservariable +BIGINT 2 2 +type string uservariable +BIGINT 4 4 +type string uservariable +BIGINT 5 5 +type string uservariable +DOUBLE 6 6 +type string uservariable +DOUBLE 7 7 +type string uservariable +DOUBLE 8 8 +@var_1 @var_2 @var_3 @var_4 @var_5 @var_6 @var_7 @var_8 +1 3 2 4 5 6 7 8 +Table Create Table +t9 CREATE TABLE `t9` ( + `@var_1` double default NULL, + `@var_2` double default NULL, + `@var_3` bigint(20) default NULL, + `@var_4` bigint(20) default NULL, + `@var_5` bigint(20) default NULL, + `@var_6` double default NULL, + `@var_7` double default NULL, + `@var_8` double default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +prepare __stmt_c_ from @__stmt_c_ ; +prepare __stmt_uv_ from @__stmt_uv_ ; +prepare __stmt_ph_ from @__stmt_ph_ ; +SELECT 1.0 + 3.0 + 2 + 4 + 5 + 6 + 7 + 8 as "my_fine_statement" ; +my_fine_statement +36.0 +execute __stmt_c_ ; +my_fine_statement +36.0 +execute __stmt_c_ ; +my_fine_statement +36.0 +execute __stmt_c_ ; +my_fine_statement +36.0 +SELECT @var_1 + @var_2 + @var_3 + @var_4 + @var_5 + @var_6 + @var_7 + @var_8 as "my_fine_statement" ; +my_fine_statement +36 +execute __stmt_uv_ ; +my_fine_statement +36 +execute __stmt_uv_ ; +my_fine_statement +36 +execute __stmt_uv_ ; +my_fine_statement +36 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4,@var_5,@var_6,@var_7,@var_8 ; +my_fine_statement +36 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4,@var_5,@var_6,@var_7,@var_8 ; +my_fine_statement +36 +execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4,@var_5,@var_6,@var_7,@var_8 ; +my_fine_statement +36 diff --git a/mysql-test/t/ps_12func.test b/mysql-test/t/ps_12func.test new file mode 100644 index 00000000000..65abffe946c --- /dev/null +++ b/mysql-test/t/ps_12func.test @@ -0,0 +1,867 @@ +##################### ps_12func.test ##################### +# # +# Prepared Statement tests of functions # +# # +# Non prepared variants are also checked # +# # +# Checked functions: # +# # +# ROUND(X,D) and ROUND(X) # +# CONCAT_WS(separator,str1,str2,...) # +# CHAR(N,...) # +# CHAR_LENGTH(str) # +# FIELD(str,str1,str2,str3,...) # +# INSERT(str,pos,len,newstr) # +# BIN(N) # +# BIT_LENGTH(str) # +# CONV(N,from_base,to_base) # +# # +########################################################## + +use test; + +# "--disable_abort_on_error" is definitely needed, because there are some tests +# which intentional produce statements with wrong syntax and it is not +# possible to put a "--error " just before the execution calls +# within patchwork-test.inc . +--disable_abort_on_error + +##### ROUND(X,D) +--disable_query_log +select concat('###### Variations on ROUND(X,D) ######') as '' +union select ''; +--enable_query_log +set @stmt_part_1= 'select ROUND(' ; +set @stmt_part_2= ',' ; +set @stmt_part_3= ') as my_col' ; +set @max_var_number= 2; + + +#------------------------------------------------------------------ +# first parameter 11.298 (DOUBLE) , ROUND( m.n , p ) m = 2 ; n = 3 +# Variations on parameter2 +#------------------------------------------------------------------ +set @string_1= '11.298' ; +set @type_1= 'DOUBLE' ; +## data type BIGINT, if possible +set @type_2= 'BIGINT' ; +# p < n +set @string_2= '1' ; +--source include/patchwork-check.inc +# p = n +set @string_2= '3' ; +--source include/patchwork-check.inc +# p > n +set @string_2= '4' ; +--source include/patchwork-check.inc +# p = 0 +set @string_2= '0' ; +--source include/patchwork-check.inc +# -p < m +set @string_2= '-1' ; +--source include/patchwork-check.inc +# -p = m +set @string_2= '-2' ; +--source include/patchwork-check.inc +# -p > m +set @string_2= '-3' ; +--source include/patchwork-check.inc +# -p = NULL +set @string_2= 'NULL' ; +--source include/patchwork-check.inc + +## data type DOUBLE, if possible +set @type_2= 'DOUBLE' ; +# p < n +set @string_2= '1.0' ; +--source include/patchwork-check.inc +# p = n +set @string_2= '3.0' ; +--source include/patchwork-check.inc +# p > n +set @string_2= '4.0' ; +--source include/patchwork-check.inc +# p = 0 +set @string_2= '0.0' ; +--source include/patchwork-check.inc +# -p < m +set @string_2= '-1.0' ; +--source include/patchwork-check.inc +# -p = m +set @string_2= '-2.0' ; +--source include/patchwork-check.inc +# -p > m +set @string_2= '-3.0' ; +--source include/patchwork-check.inc +# ugly values +set @string_2= '1.1' ; +--source include/patchwork-check.inc +set @string_2= '1.9' ; +--source include/patchwork-check.inc +# -p = NULL +set @string_2= 'NULL' ; +--source include/patchwork-check.inc + +## data type LONGBLOB, content NULL +set @type_2= 'LONGBLOB' ; +set @string_2= 'NULL' ; +--source include/patchwork-check.inc + + +#------------------------------------------------------------------ +# first parameter data type BIGINT, content NULL +# Variations on parameter2 +#------------------------------------------------------------------ +set @string_1= 'NULL' ; +set @type_1= 'BIGINT' ; + +set @type_2= 'BIGINT' ; +set @string_2= '2' ; +--source include/patchwork-check.inc +set @string_2= '-2' ; +--source include/patchwork-check.inc +set @string_2= 'NULL' ; +--source include/patchwork-check.inc + +set @type_2= 'DOUBLE' ; +set @string_2= '2.0' ; +--source include/patchwork-check.inc +set @string_2= '-2.0' ; +--source include/patchwork-check.inc +set @string_2= 'NULL' ; +--source include/patchwork-check.inc + +set @type_2= 'LONGBLOB' ; +set @string_2= 'NULL' ; +--source include/patchwork-check.inc + + +#------------------------------------------------------------------ +# first parameter data type DOUBLE, content NULL +# Variations on parameter2 +#------------------------------------------------------------------ +set @string_1= 'NULL' ; +set @type_1= 'DOUBLE' ; + +set @type_2= 'BIGINT' ; +set @string_2= '2' ; +--source include/patchwork-check.inc +set @string_2= '-2' ; +--source include/patchwork-check.inc +set @string_2= 'NULL' ; +--source include/patchwork-check.inc + +set @type_2= 'DOUBLE' ; +set @string_2= '2.0' ; +--source include/patchwork-check.inc +set @string_2= '-2.0' ; +--source include/patchwork-check.inc +set @string_2= 'NULL' ; +--source include/patchwork-check.inc + +set @type_2= 'LONGBLOB' ; +set @string_2= 'NULL' ; +--source include/patchwork-check.inc + + +#------------------------------------------------------------------ +# first parameter data type LONGBLOB, content NULL +# Variations on parameter2 +#------------------------------------------------------------------ +set @string_1= 'NULL' ; +set @type_1= 'LONGBLOB' ; + +set @type_2= 'BIGINT' ; +set @string_2= '2' ; +--source include/patchwork-check.inc +set @string_2= '-2' ; +--source include/patchwork-check.inc +set @string_2= 'NULL' ; +--source include/patchwork-check.inc + +set @type_2= 'DOUBLE' ; +set @string_2= '2.0' ; +--source include/patchwork-check.inc +set @string_2= '-2.0' ; +--source include/patchwork-check.inc +set @string_2= 'NULL' ; +--source include/patchwork-check.inc + +set @type_2= 'LONGBLOB' ; +set @string_2= 'NULL' ; +--source include/patchwork-check.inc + +#------------------------------------------------------------------ +# ROUND(D) Returns the argument X, rounded to the nearest integer. +#------------------------------------------------------------------ +set @stmt_part_1= 'select ROUND(' ; +set @stmt_part_2= ') as my_col' ; +set @max_var_number= 1; +## test cases with BIGINT +set @string_1= '11' ; +set @type_1= 'BIGINT' ; +--source include/patchwork-check.inc +set @string_1= '-11' ; +set @type_1= 'BIGINT' ; +--source include/patchwork-check.inc +set @string_1= '0' ; +set @type_1= 'BIGINT' ; +--source include/patchwork-check.inc +set @string_1= 'NULL' ; +set @type_1= 'BIGINT' ; +--source include/patchwork-check.inc +## test cases with BIGINT +set @string_1= '11.49' ; +set @type_1= 'DOUBLE' ; +--source include/patchwork-check.inc +set @string_1= '10.51' ; +set @type_1= 'DOUBLE' ; +--source include/patchwork-check.inc +set @string_1= '0.0' ; +set @type_1= 'DOUBLE' ; +--source include/patchwork-check.inc +set @string_1= 'NULL' ; +set @type_1= 'DOUBLE' ; +--source include/patchwork-check.inc +set @string_1= '-11.49' ; +set @type_1= 'DOUBLE' ; +--source include/patchwork-check.inc +set @string_1= '-10.51' ; +set @type_1= 'DOUBLE' ; +--source include/patchwork-check.inc +## Incomplete statement +set @stmt_part_2= 'select ROUND() as my_col' ; +set @max_var_number= 0; +--source include/patchwork-check.inc + +##### CONCAT_WS(separator,str1,str2,...) +# Example: CONCAT_WS('S','My','QL') +--disable_query_log +select concat('###### Variations on CONCAT_WS(separator,str1,str2,...) ######') +as '' union select ''; +--enable_query_log +set @stmt_part_1= 'select CONCAT_WS(' ; +set @stmt_part_2= ',' ; +set @stmt_part_3= ',' ; +set @stmt_part_4= ') as my_col' ; +set @max_var_number= 3; + +### common case +set @string_1= 'S' ; +set @type_1= 'LONGTEXT' ; +set @string_2= 'My' ; +set @type_2= 'LONGTEXT' ; +set @string_3= 'QL' ; +set @type_3= 'LONGTEXT' ; +--source include/patchwork-check.inc + +#------------------------------------------------------------------ +# NULL at different parameter positions +#------------------------------------------------------------------ +### The separator (first parameter) is NULL. +set @string_1= 'NULL' ; +set @type_1= 'LONGBLOB' ; +set @string_2= 'My' ; +set @type_2= 'LONGTEXT' ; +set @string_3= 'QL' ; +set @type_3= 'LONGTEXT' ; +--source include/patchwork-check.inc +set @type_1= 'BIGINT' ; +--source include/patchwork-check.inc +set @type_1= 'DOUBLE' ; +--source include/patchwork-check.inc + +### The first string (second parameter) is NULL. +set @string_1= 'S' ; +set @type_1= 'LONGTEXT' ; +set @string_2= 'NULL' ; +set @type_2= 'LONGBLOB' ; +set @string_3= 'QL' ; +set @type_3= 'LONGTEXT' ; +--source include/patchwork-check.inc +set @type_2= 'BIGINT' ; +--source include/patchwork-check.inc +set @type_2= 'DOUBLE' ; +--source include/patchwork-check.inc + +### The second string (third parameter) is NULL. +set @string_1= 'S' ; +set @type_1= 'LONGTEXT' ; +set @string_2= 'My' ; +set @type_2= 'LONGTEXT' ; +set @string_3= 'NULL' ; +set @type_3= 'LONGTEXT' ; +--source include/patchwork-check.inc +set @type_3= 'BIGINT' ; +--source include/patchwork-check.inc +set @type_3= 'DOUBLE' ; +--source include/patchwork-check.inc + +#------------------------------------------------------------------ +# some complicated things +#------------------------------------------------------------------ +# select concat_ws('S',IF(parameter1=NULL,parameter2,parameter3),'QL') +set @stmt_part_1= "select CONCAT_WS('S',IF(" ; +set @stmt_part_2= ' IS NULL, ' ; +set @stmt_part_3= ' , ' ; +set @stmt_part_4= "),'QL') as my_col" ; +set @max_var_number= 3; + +# common case +set @string_1= 'My' ; +set @type_1= 'LONGTEXT' ; +set @string_2= 'X' ; +set @type_2= 'LONGTEXT' ; +set @string_3= 'My' ; +set @type_3= 'LONGTEXT' ; +--source include/patchwork-check.inc + +set @string_1= 'NULL' ; +set @type_1= 'LONGBLOB' ; +set @string_2= 'X' ; +set @type_2= 'LONGTEXT' ; +set @string_3= 'My' ; +set @type_3= 'LONGTEXT' ; +# deactivated because of +# Bug#6297 : prepared statement, wrong handling of IS NULL +# let $__debug_= 1; +# --source include/patchwork-check.inc + +##### CHAR(N,...) +# Example(Manual): SELECT CHAR(77,121,83,81,'76'); +--disable_query_log +select concat('###### Variations on CHAR(N,...) ######') as '' +union select ''; +--enable_query_log +set @stmt_part_1= 'select CHAR(' ; +set @stmt_part_2= ',' ; +set @stmt_part_3= ',' ; +set @stmt_part_4= ',' ; +set @stmt_part_5= ',' ; +set @stmt_part_6= ') as my_col' ; +set @max_var_number= 5; + +### common case +set @string_1= '77' ; +set @type_1= 'BIGINT' ; +set @string_2= '121' ; +set @type_2= 'BIGINT' ; +set @string_3= '83' ; +set @type_3= 'BIGINT' ; +set @string_4= '81' ; +set @type_4= 'BIGINT' ; +set @string_5= '76' ; +set @type_5= 'BIGINT' ; +--source include/patchwork-check.inc + +#------------------------------------------------------------------ +# NULL at different parameter positions +#------------------------------------------------------------------ +# Only the first parameter is NULL. +set @string_1= 'NULL' ; +set @type_1= 'BIGINT' ; +##### ugly maybe wrong result +# Bug#6317: string function CHAR, parameter is NULL, wrong result +#--source include/patchwork-check.inc + +## Only one non first/last parameter is NULL. +set @string_1= '77' ; +set @type_1= 'BIGINT' ; +set @string_2= '121' ; +set @type_2= 'BIGINT' ; +set @string_3= 'NULL' ; +set @type_3= 'BIGINT' ; +set @string_4= '81' ; +set @type_4= 'BIGINT' ; +set @string_5= '76' ; +set @type_5= 'BIGINT' ; +# Bug#6317: string function CHAR, parameter is NULL, wrong result +#--source include/patchwork-check.inc + +## Two neighbour parameters in the middle are NULL. +set @string_1= '77' ; +set @type_1= 'BIGINT' ; +set @string_2= '121' ; +set @type_2= 'BIGINT' ; +set @string_3= 'NULL' ; +set @type_3= 'BIGINT' ; +set @string_4= 'NULL' ; +set @type_4= 'BIGINT' ; +set @string_5= '76' ; +set @type_5= 'BIGINT' ; +# Bug#6317: string function CHAR, parameter is NULL, wrong result +#--source include/patchwork-check.inc + +## Only the last parameter is NULL. +set @string_1= '77' ; +set @type_1= 'BIGINT' ; +set @string_2= '121' ; +set @type_2= 'BIGINT' ; +set @string_3= '83' ; +set @type_3= 'BIGINT' ; +set @string_4= '81' ; +set @type_4= 'BIGINT' ; +set @string_5= 'NULL' ; +set @type_5= 'BIGINT' ; +# Bug#6317: string function CHAR, parameter is NULL, wrong result +#--source include/patchwork-check.inc + +## The first parameter is NULL with bad type. +set @string_1= 'NULL' ; +set @type_1= 'LONGBLOB' ; +set @string_2= '121' ; +set @type_2= 'BIGINT' ; +set @string_3= '83' ; +set @type_3= 'BIGINT' ; +set @string_4= '81' ; +set @type_4= 'BIGINT' ; +set @string_5= '76' ; +set @type_5= 'BIGINT' ; +# Bug#6317: string function CHAR, parameter is NULL, wrong result +#--source include/patchwork-check.inc + + +##### CHAR_LENGTH(str) +--disable_query_log +select concat('###### Variations on CHAR_LENGTH ######') as '' +union select ''; +--enable_query_log +set @stmt_part_1= 'select CHAR_LENGTH(' ; +set @stmt_part_2= ') as my_col' ; +set @max_var_number= 1; + +### common case +set @string_1= 'MySQL' ; +set @type_1= 'LONGTEXT' ; +--source include/patchwork-check.inc + +#------------------------------------------------------------------ +# NULL at different parameter positions +#------------------------------------------------------------------ +set @string_1= 'NULL' ; +set @type_1= 'LONGTEXT' ; +--source include/patchwork-check.inc +set @type_1= 'BIGINT' ; +--source include/patchwork-check.inc +set @type_1= 'DOUBLE' ; +--source include/patchwork-check.inc + + +##### FIELD(str,str1,str2,str3,...) +--disable_query_log +select concat('###### Variations on FIELD(str,str1,str2,str3,...) ######') as '' +union select ''; +--enable_query_log +set @stmt_part_1= 'select FIELD(' ; +set @stmt_part_2= ',' ; +set @stmt_part_3= ',' ; +set @stmt_part_4= ',' ; +set @stmt_part_5= ') as my_col' ; +set @max_var_number= 4; + +### common case +set @string_1= 'Hit' ; +set @type_1= 'LONGTEXT' ; +set @string_2= '1it' ; +set @type_2= 'LONGTEXT' ; +set @string_3= 'Hit' ; +set @type_3= 'LONGTEXT' ; +set @string_4= '3it' ; +set @type_4= 'LONGTEXT' ; +--source include/patchwork-check.inc + +#------------------------------------------------------------------ +# NULL at different parameter positions +#------------------------------------------------------------------ +# string to search for is NULL, all other strings not NULL +set @string_1= 'NULL' ; +# Bug#6321: strange error, string function FIELD(, .. +--source include/patchwork-check.inc +# string to search for and one of the other is NULL +set @string_3= 'NULL' ; +# Bug#6321: strange error, string function FIELD(, .. +--source include/patchwork-check.inc + + +##### INSERT(str,pos,len,newstr) +# Manual Example: SELECT INSERT('Quadratic', 3, 4, 'What') -> 'QuWhattic' +--disable_query_log +select concat('###### Variations on INSERT(str,pos,len,newstr) ######') as '' +union select ''; +--enable_query_log +set @stmt_part_1= "select INSERT(" ; +set @stmt_part_2= ',' ; +set @stmt_part_3= ',' ; +set @stmt_part_4= ',' ; +set @stmt_part_5= ") as my_col" ; +set @max_var_number= 4; + +### common case (modified manual example) +set @string_1= 'ABCDEFGHI' ; +set @type_1= 'LONGTEXT' ; +set @string_2= '3' ; +set @type_2= 'BIGINT' ; +set @string_3= '4' ; +set @type_3= 'BIGINT' ; +set @string_4= '1234' ; +set @type_4= 'LONGTEXT' ; +--source include/patchwork-check.inc + +#------------------------------------------------------------------ +# Try DOUBLE instead of BIGINT for pos and len +#------------------------------------------------------------------ +set @string_2= '+30.0E-1' ; +set @type_2= 'DOUBLE' ; +--source include/patchwork-check.inc +set @string_2= '3' ; +set @type_2= 'BIGINT' ; +set @string_3= '+40.0E-1' ; +set @type_3= 'DOUBLE' ; +--source include/patchwork-check.inc + +#------------------------------------------------------------------ +# NULL at different parameter positions +#------------------------------------------------------------------ +set @string_1= 'NULL' ; +set @type_1= 'LONGTEXT' ; +set @string_2= '3' ; +set @type_2= 'BIGINT' ; +set @string_3= '4' ; +set @type_3= 'BIGINT' ; +set @string_4= '1234' ; +set @type_4= 'LONGTEXT' ; +--source include/patchwork-check.inc +set @string_1= 'ABCDEFGHI' ; +set @type_1= 'LONGTEXT' ; +set @string_2= 'NULL' ; +set @type_2= 'BIGINT' ; +--source include/patchwork-check.inc +set @string_2= '3' ; +set @type_2= 'BIGINT' ; +set @string_3= 'NULL' ; +set @type_3= 'BIGINT' ; +--source include/patchwork-check.inc +set @string_3= '4' ; +set @type_3= 'BIGINT' ; +set @string_4= 'NULL' ; +set @type_4= 'LONGTEXT' ; +--source include/patchwork-check.inc + +#------------------------------------------------------------------ +# Variations on the second parameter (start position) +#------------------------------------------------------------------ +set @string_1= 'ABCDEFGHI' ; +set @type_1= 'LONGTEXT' ; +set @string_2= '3' ; +set @type_2= 'BIGINT' ; +set @string_3= '4' ; +set @type_3= 'BIGINT' ; +set @string_4= '1234' ; +set @type_4= 'LONGTEXT' ; +# start position > length of the first string (9) +set @string_2= '15' ; +--source include/patchwork-check.inc +# start position = 0 +set @string_2= '0' ; +--source include/patchwork-check.inc +# start position < 0 +set @string_2= '-1' ; +--source include/patchwork-check.inc + +#------------------------------------------------------------------ +# Variations on the third parameter (# of chars of string one to be replaced) +#------------------------------------------------------------------ +set @string_1= 'ABCDEFGHI' ; +set @type_1= 'LONGTEXT' ; +set @string_2= '3' ; +set @type_2= 'BIGINT' ; +set @string_3= '4' ; +set @type_3= 'BIGINT' ; +set @string_4= '1234' ; +set @type_4= 'LONGTEXT' ; +## chars to be replaced > length of the second string +# start pos (3) + replace length(10) > length of first string(9) +set @string_3= '10' ; +--source include/patchwork-check.inc +# start pos (3) + chars to be replaced (5) < length of first string(9) +set @string_3= '5' ; +--source include/patchwork-check.inc +# chars to be replaced = 0 +set @string_3= '0' ; +--source include/patchwork-check.inc +# chars to be replaced < 0 +set @string_3= '-1' ; +--source include/patchwork-check.inc + + +##### BIN(N) +# manual example: SELECT BIN(12); -> '1100' +--disable_query_log +select concat('###### Variations on BIN(N) ######') as '' +union select ''; +--enable_query_log +set @stmt_part_1= "select BIN(" ; +set @stmt_part_2= ") as my_col" ; +set @max_var_number= 1; + +set @string_1= '12' ; +set @type_1= 'BIGINT' ; +--source include/patchwork-check.inc +#### Variations on the parameter +set @string_1= 'NULL' ; +set @type_1= 'BIGINT' ; +--source include/patchwork-check.inc +set @string_1= '2147483648' ; +set @type_1= 'BIGINT' ; +--source include/patchwork-check.inc +set @string_1= '0' ; +set @type_1= 'BIGINT' ; +--source include/patchwork-check.inc +set @string_1= '-1' ; +set @type_1= 'BIGINT' ; +--source include/patchwork-check.inc +set @string_1= '9000000000000000000' ; +set @type_1= 'BIGINT' ; +--source include/patchwork-check.inc +set @string_1= '12.9E-0' ; +set @type_1= 'DOUBLE' ; +--source include/patchwork-check.inc +set @string_1= '0.129E+2' ; +set @type_1= 'DOUBLE' ; +--source include/patchwork-check.inc + +##### BIT_LENGTH(str) +# Manual example: SELECT BIT_LENGTH('text'); -> 32 +--disable_query_log +select concat('###### Variations on BIT_LENGT(str) ######') as '' +union select ''; +--enable_query_log +set @stmt_part_1= "select BIT_LENGTH(" ; +set @stmt_part_2= ") as my_col" ; +set @max_var_number= 1; + +set @string_1= 'text' ; +set @type_1= 'LONGTEXT' ; +--source include/patchwork-check.inc + +# try NULL +set @string_1= 'NULL' ; +set @type_1= 'LONGTEXT' ; +--source include/patchwork-check.inc + + +##### CONV(N,from_base,to_base) +# Manual example: SELECT CONV(-17,10,-18); -> '-H' +--disable_query_log +select concat('###### Variations on CONV(N,from_base,to_base) ######') as '' +union select ''; +--enable_query_log +set @stmt_part_1= "select CONV(" ; +set @stmt_part_2= "," ; +set @stmt_part_3= "," ; +set @stmt_part_4= ") as my_col" ; +set @max_var_number= 3; + +#------------------------------------------------------------------ +# Manual: If to_base is a negative number, N is regarded as a signed number. +# Otherwise, N is treated as unsigned. +# Experiments with positive/negative number/to_base +#------------------------------------------------------------------ +# number positive written, to_base positive +set @string_1= '37' ; +set @type_1= 'BIGINT' ; +set @string_2= '10' ; +set @type_2= 'BIGINT' ; +set @string_3= '10' ; +set @type_3= 'BIGINT' ; +--source include/patchwork-check.inc +# number negative written, to_base positive +set @string_1= '-37' ; +set @type_1= 'BIGINT' ; +set @string_2= '10' ; +set @type_2= 'BIGINT' ; +set @string_3= '10' ; +set @type_3= 'BIGINT' ; +--source include/patchwork-check.inc +# The last result (unsigned) BIGINT 18446744073709551579 might be surprising. +# The next statements could give an explanation. +set @string_1= CAST(CAST(-37 AS unsigned INTEGER) AS CHAR); +set @type_1= 'LONGTEXT' ; +set @string_2= '10' ; +set @type_2= 'BIGINT' ; +set @string_3= '10' ; +set @type_3= 'BIGINT' ; +--source include/patchwork-check.inc +# number positive written, to_base negative +set @string_1= '37' ; +set @type_1= 'BIGINT' ; +set @string_2= '10' ; +set @type_2= 'BIGINT' ; +set @string_3= '-10' ; +set @type_3= 'BIGINT' ; +--source include/patchwork-check.inc +# number negative written, to_base negative +set @string_1= '-37' ; +set @type_1= 'BIGINT' ; +set @string_2= '10' ; +set @type_2= 'BIGINT' ; +set @string_3= '-10' ; +set @type_3= 'BIGINT' ; +--source include/patchwork-check.inc + +#------------------------------------------------------------------ +# conversions to and from the exotic 11 based number system +#------------------------------------------------------------------ +set @string_1= '9' ; +set @type_1= 'BIGINT' ; +set @string_2= '10' ; +set @type_2= 'BIGINT' ; +set @string_3= '11' ; +set @type_3= 'BIGINT' ; +--source include/patchwork-check.inc +set @string_1= '9' ; +set @type_1= 'BIGINT' ; +set @string_2= '11' ; +set @type_2= 'BIGINT' ; +set @string_3= '10' ; +set @type_3= 'BIGINT' ; +--source include/patchwork-check.inc +set @string_1= '10' ; +set @type_1= 'BIGINT' ; +set @string_2= '10' ; +set @type_2= 'BIGINT' ; +set @string_3= '11' ; +set @type_3= 'BIGINT' ; +--source include/patchwork-check.inc +set @string_1= 'A' ; +set @type_1= 'LONGTEXT' ; +set @string_2= '11' ; +set @type_2= 'BIGINT' ; +set @string_3= '10' ; +set @type_3= 'BIGINT' ; +--source include/patchwork-check.inc +set @string_1= '11' ; +set @type_1= 'BIGINT' ; +set @string_2= '10' ; +set @type_2= 'BIGINT' ; +set @string_3= '11' ; +set @type_3= 'BIGINT' ; +--source include/patchwork-check.inc +set @string_1= '10' ; +set @type_1= 'BIGINT' ; +set @string_2= '11' ; +set @type_2= 'BIGINT' ; +set @string_3= '10' ; +set @type_3= 'BIGINT' ; +--source include/patchwork-check.inc + +#------------------------------------------------------------------ +# Try the maximum base value 36 +#------------------------------------------------------------------ +set @string_1= '37' ; +set @type_1= 'BIGINT' ; +set @string_2= '10' ; +set @type_2= 'BIGINT' ; +set @string_3= '36' ; +set @type_3= 'BIGINT' ; +--source include/patchwork-check.inc +set @string_1= '11' ; +set @type_1= 'BIGINT' ; +set @string_2= '36' ; +set @type_2= 'BIGINT' ; +set @string_3= '10' ; +set @type_3= 'BIGINT' ; +--source include/patchwork-check.inc + +#------------------------------------------------------------------ +# NULL at different parameter positions +#------------------------------------------------------------------ +set @string_1= 'NULL' ; +set @type_1= 'BIGINT' ; +set @string_2= '10' ; +set @type_2= 'BIGINT' ; +set @string_3= '10' ; +set @type_3= 'BIGINT' ; +--source include/patchwork-check.inc +set @string_1= '37' ; +set @string_2= 'NULL' ; +--source include/patchwork-check.inc +set @string_2= '10' ; +set @string_3= 'NULL' ; +--source include/patchwork-check.inc +set @string_3= '10' ; + +#------------------------------------------------------------------ +# The rule for from_base is: 2 <= from_base <= 36 +# Try values outside of this range. +#------------------------------------------------------------------ +set @string_1= '9' ; +set @type_1= 'BIGINT' ; +set @string_2= '37' ; +set @type_2= 'BIGINT' ; +set @string_3= '10' ; +set @type_3= 'BIGINT' ; +--source include/patchwork-check.inc +set @string_1= '9' ; +set @type_1= 'BIGINT' ; +set @string_2= '1' ; +set @type_2= 'BIGINT' ; +set @string_3= '10' ; +set @type_3= 'BIGINT' ; +--source include/patchwork-check.inc +set @string_1= '9' ; +set @type_1= 'BIGINT' ; +set @string_2= '0' ; +set @type_2= 'BIGINT' ; +set @string_3= '10' ; +set @type_3= 'BIGINT' ; +--source include/patchwork-check.inc +set @string_1= '9' ; +set @type_1= 'BIGINT' ; +set @string_2= '-1' ; +set @type_2= 'BIGINT' ; +set @string_3= '10' ; +set @type_3= 'BIGINT' ; +--source include/patchwork-check.inc + +#------------------------------------------------------------------ +# The rule for to_base is: 2<= ABS(to_base) <= 36 +# Try values outside of this range. +#------------------------------------------------------------------ +set @string_1= '9' ; +set @type_1= 'BIGINT' ; +set @string_2= '10' ; +set @type_2= 'BIGINT' ; +set @string_3= '37' ; +set @type_3= 'BIGINT' ; +--source include/patchwork-check.inc +set @string_1= '9' ; +set @type_1= 'BIGINT' ; +set @string_2= '10' ; +set @type_2= 'BIGINT' ; +set @string_3= '1' ; +set @type_3= 'BIGINT' ; +--source include/patchwork-check.inc +set @string_1= '9' ; +set @type_1= 'BIGINT' ; +set @string_2= '0' ; +set @type_2= 'BIGINT' ; +set @string_3= '0' ; +set @type_3= 'BIGINT' ; +--source include/patchwork-check.inc +set @string_1= '9' ; +set @type_1= 'BIGINT' ; +set @string_2= '10' ; +set @type_2= 'BIGINT' ; +set @string_3= '-1' ; +set @type_3= 'BIGINT' ; +--source include/patchwork-check.inc +set @string_1= '9' ; +set @type_1= 'BIGINT' ; +set @string_2= '10' ; +set @type_2= 'BIGINT' ; +set @string_3= '-37' ; +set @type_3= 'BIGINT' ; +--source include/patchwork-check.inc + + diff --git a/mysql-test/t/tool_test.test b/mysql-test/t/tool_test.test new file mode 100644 index 00000000000..b28eae2c17d --- /dev/null +++ b/mysql-test/t/tool_test.test @@ -0,0 +1,105 @@ +########################### tool_test.test ############################# +# # +# Test sequences for the check of mysqltest based test tools # +# # +# Checked routines: # +# include/patchwork-check.inc # +# # +######################################################################## + +##### Check of include/patchwork-check.inc +# +use test ; +--disable_abort_on_error + +#----------------------------------------------------------------------- +# Simple test (special case): +# The statement is made of only one piece and does not contain variables. +#----------------------------------------------------------------------- +set @stmt_part_1= 'SELECT 1 as "my_fine_statement"' ; +set @max_var_number= 0; +# switch debug output on (Attention: patchwork-check.inc will switch it off) +let $__debug_= 1; +--source include/patchwork-check.inc + +#----------------------------------------------------------------------- +# Test case with many statement pieces and variables of all in +# include/patchwork-check.inc available data types. +#----------------------------------------------------------------------- +set @stmt_part_1= 'SELECT ' ; +set @stmt_part_2= ' + ' ; +set @stmt_part_3= ' + ' ; +set @stmt_part_4= ' + ' ; +set @stmt_part_5= ' + ' ; +set @stmt_part_6= ' + ' ; +set @stmt_part_7= ' + ' ; +set @stmt_part_8= ' + ' ; +set @stmt_part_9= ' as "my_fine_statement"' ; +set @max_var_number= 8; + +set @string_1= '1' ; +set @type_1= 'BIGINT' ; +set @string_2= 'nULL' ; +set @type_2= 'BIGINT' ; +set @string_3= '2.0' ; +set @type_3= 'DOUBLE' ; +set @string_4= 'NuLL' ; +set @type_4= 'DOUBLE' ; +set @string_5= 'TEXT' ; +set @type_5= 'LONGTEXT' ; +set @string_6= 'NUlL' ; +set @type_6= 'LONGTEXT' ; +set @string_7= 'BLOB' ; +set @type_7= 'LONGBLOB' ; +set @string_8= 'NULl' ; +set @type_8= 'LONGBLOB' ; + +# Initialization of all uservariables to the data type LONGTEXT and content, +# which will not be repeated within the following tests. +# 'include/patchwork-check.inc' MUST destroy all these settings. +# That is why this initialization is NOT needed within test cases +# calling include/patchwork-check.inc . +set @var_1= 'YYYYYYYY' ; +set @var_2= 'YYYYYYYY' ; +set @var_3= 'YYYYYYYY' ; +set @var_4= 'YYYYYYYY' ; +set @var_5= 'YYYYYYYY' ; +set @var_6= 'YYYYYYYY' ; +set @var_7= 'YYYYYYYY' ; +set @var_8= 'YYYYYYYY' ; + +# switch debug output on (Attention: patchwork-check.inc will switch it off) +let $__debug_= 1; +--source include/patchwork-check.inc + +### Execute the statement with more useful content of the variables. +set @string_1= '1.0' ; +set @type_1= 'DOUBLE' ; +set @string_2= '3.0' ; +set @type_2= 'DOUBLE' ; +set @string_3= '2' ; +set @type_3= 'BIGINT' ; +set @string_4= '4' ; +set @type_4= 'BIGINT' ; +set @string_5= '5' ; +set @type_5= 'BIGINT' ; +set @string_6= '6' ; +set @type_6= 'DOUBLE' ; +set @string_7= '7' ; +set @type_7= 'DOUBLE' ; +set @string_8= '8' ; +set @type_8= 'DOUBLE' ; + +# Initialization +set @var_1= 'YYYYYYYY' ; +set @var_2= 'YYYYYYYY' ; +set @var_3= 'YYYYYYYY' ; +set @var_4= 'YYYYYYYY' ; +set @var_5= 'YYYYYYYY' ; +set @var_6= 'YYYYYYYY' ; +set @var_7= 'YYYYYYYY' ; +set @var_8= 'YYYYYYYY' ; + +# switch debug output on (Attention: include/patchwork-check.inc switches it off) +let $__debug_= 1; +--source include/patchwork-check.inc From 946f042dd330ebec085cb1e24fdc4ab16bc33c1c Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 11 Nov 2004 21:17:44 +0200 Subject: [PATCH 0190/1063] trx0purge.c: Remove duplicated innodb max purge lag code innobase/trx/trx0purge.c: Remove duplicated innodb max purge lag code --- innobase/trx/trx0purge.c | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/innobase/trx/trx0purge.c b/innobase/trx/trx0purge.c index 6726d7ca609..5c62640e011 100644 --- a/innobase/trx/trx0purge.c +++ b/innobase/trx/trx0purge.c @@ -1069,30 +1069,6 @@ trx_purge(void) } } - /* Determine how much data manipulation language (DML) statements - need to be delayed in order to reduce the lagging of the purge - thread. */ - srv_dml_needed_delay = 0; /* in microseconds; default: no delay */ - - /* If we cannot advance the 'purge view' because of an old - 'consistent read view', then the DML statements cannot be delayed. - Also, srv_max_purge_lag <= 0 means 'infinity'. */ - if (srv_max_purge_lag > 0 - && !UT_LIST_GET_LAST(trx_sys->view_list)) { - float ratio = (float) trx_sys->rseg_history_len - / srv_max_purge_lag; - if (ratio > ULINT_MAX / 10000) { - /* Avoid overflow: maximum delay is 4295 seconds */ - srv_dml_needed_delay = ULINT_MAX; - } else if (ratio > 1) { - /* If the history list length exceeds the - innodb_max_purge_lag, the - data manipulation statements are delayed - by at least 5000 microseconds. */ - srv_dml_needed_delay = (ulint) ((ratio - .5) * 10000); - } - } - purge_sys->view = read_view_oldest_copy_or_open_new(NULL, purge_sys->heap); mutex_exit(&kernel_mutex); From 44af4e4a99e866dd6ee29809a1f1efd4f18ce3f8 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 11 Nov 2004 21:25:55 +0100 Subject: [PATCH 0191/1063] wl1744 - ndb on windoze ndb/Makefile.am: ndb-windows ndb/src/Makefile.am: ndb-windows ndb/src/common/debugger/Makefile.am: ndb-windows ndb/src/common/debugger/signaldata/Makefile.am: ndb-windows ndb/src/common/logger/Makefile.am: ndb-windows ndb/src/common/mgmcommon/Makefile.am: ndb-windows ndb/src/common/portlib/Makefile.am: ndb-windows ndb/src/common/transporter/Makefile.am: ndb-windows ndb/src/common/util/File.cpp: ndb-windows ndb/src/common/util/Makefile.am: ndb-windows ndb/src/cw/cpcd/Makefile.am: ndb-windows ndb/src/kernel/Makefile.am: ndb-windows ndb/src/kernel/blocks/backup/Makefile.am: ndb-windows ndb/src/kernel/blocks/backup/restore/Makefile.am: ndb-windows ndb/src/kernel/blocks/cmvmi/Makefile.am: ndb-windows ndb/src/kernel/blocks/dbacc/Makefile.am: ndb-windows ndb/src/kernel/blocks/dbdict/Makefile.am: ndb-windows ndb/src/kernel/blocks/dbdih/Makefile.am: ndb-windows ndb/src/kernel/blocks/dblqh/Makefile.am: ndb-windows ndb/src/kernel/blocks/dbtc/Makefile.am: ndb-windows ndb/src/kernel/blocks/dbtup/Makefile.am: ndb-windows ndb/src/kernel/blocks/dbtux/Makefile.am: ndb-windows ndb/src/kernel/blocks/dbutil/Makefile.am: ndb-windows ndb/src/kernel/blocks/grep/Makefile.am: ndb-windows ndb/src/kernel/blocks/ndbcntr/Makefile.am: ndb-windows ndb/src/kernel/blocks/ndbfs/Makefile.am: ndb-windows ndb/src/kernel/blocks/qmgr/Makefile.am: ndb-windows ndb/src/kernel/blocks/suma/Makefile.am: ndb-windows ndb/src/kernel/blocks/trix/Makefile.am: ndb-windows ndb/src/kernel/error/Makefile.am: ndb-windows ndb/src/kernel/vm/Makefile.am: ndb-windows ndb/src/mgmapi/Makefile.am: ndb-windows ndb/src/mgmsrv/InitConfigFileParser.cpp: ndb-windows ndb/src/mgmsrv/Makefile.am: ndb-windows ndb/src/mgmsrv/MgmtSrvr.cpp: ndb-windows ndb/src/ndbapi/Makefile.am: ndb-windows ndb/src/ndbapi/ndberror.c: ndb-windows ndb/test/include/NdbSchemaOp.hpp: ndb-windows ndb/test/run-test/Makefile.am: ndb-windows ndb/test/src/CpcClient.cpp: ndb-windows ndb/test/src/Makefile.am: ndb-windows ndb/test/src/NdbRestarter.cpp: ndb-windows ndb/test/src/getarg.c: ndb-windows --- ndb/Makefile.am | 4 +- ndb/src/Makefile.am | 5 +- ndb/src/common/debugger/Makefile.am | 2 +- .../common/debugger/signaldata/Makefile.am | 2 +- ndb/src/common/logger/Makefile.am | 9 +- ndb/src/common/mgmcommon/Makefile.am | 2 +- ndb/src/common/portlib/Makefile.am | 14 +- ndb/src/common/portlib/win32/NdbCondition.c | 184 ++++++++++++++ ndb/src/common/portlib/win32/NdbDaemon.c | 44 ++++ ndb/src/common/portlib/win32/NdbEnv.c | 33 +++ ndb/src/common/portlib/win32/NdbHost.c | 53 ++++ ndb/src/common/portlib/win32/NdbMem.c | 237 ++++++++++++++++++ ndb/src/common/portlib/win32/NdbMutex.c | 78 ++++++ ndb/src/common/portlib/win32/NdbSleep.c | 35 +++ ndb/src/common/portlib/win32/NdbTCP.c | 39 +++ ndb/src/common/portlib/win32/NdbThread.c | 118 +++++++++ ndb/src/common/portlib/win32/NdbTick.c | 64 +++++ ndb/src/common/transporter/Makefile.am | 2 +- ndb/src/common/util/File.cpp | 11 +- ndb/src/common/util/Makefile.am | 2 +- ndb/src/cw/cpcd/Makefile.am | 14 +- ndb/src/kernel/Makefile.am | 6 +- ndb/src/kernel/blocks/backup/Makefile.am | 2 +- .../kernel/blocks/backup/restore/Makefile.am | 8 +- ndb/src/kernel/blocks/cmvmi/Makefile.am | 2 +- ndb/src/kernel/blocks/dbacc/Makefile.am | 2 +- ndb/src/kernel/blocks/dbdict/Makefile.am | 2 +- ndb/src/kernel/blocks/dbdih/Makefile.am | 2 +- ndb/src/kernel/blocks/dblqh/Makefile.am | 2 +- ndb/src/kernel/blocks/dbtc/Makefile.am | 2 +- ndb/src/kernel/blocks/dbtup/Makefile.am | 2 +- ndb/src/kernel/blocks/dbtux/Makefile.am | 2 +- ndb/src/kernel/blocks/dbutil/Makefile.am | 8 +- ndb/src/kernel/blocks/grep/Makefile.am | 2 +- ndb/src/kernel/blocks/ndbcntr/Makefile.am | 2 +- ndb/src/kernel/blocks/ndbfs/Makefile.am | 2 +- ndb/src/kernel/blocks/qmgr/Makefile.am | 2 +- ndb/src/kernel/blocks/suma/Makefile.am | 2 +- ndb/src/kernel/blocks/trix/Makefile.am | 2 +- ndb/src/kernel/error/Makefile.am | 2 +- ndb/src/kernel/vm/Makefile.am | 2 +- ndb/src/mgmapi/Makefile.am | 2 +- ndb/src/mgmsrv/InitConfigFileParser.cpp | 1 + ndb/src/mgmsrv/Makefile.am | 6 +- ndb/src/mgmsrv/MgmtSrvr.cpp | 1 + ndb/src/ndbapi/Makefile.am | 2 +- ndb/src/ndbapi/ndberror.c | 1 + ndb/test/include/NdbSchemaOp.hpp | 2 + ndb/test/run-test/Makefile.am | 14 +- ndb/test/src/CpcClient.cpp | 3 - ndb/test/src/Makefile.am | 2 +- ndb/test/src/NdbRestarter.cpp | 2 +- ndb/test/src/getarg.c | 2 +- 53 files changed, 964 insertions(+), 82 deletions(-) create mode 100644 ndb/src/common/portlib/win32/NdbCondition.c create mode 100644 ndb/src/common/portlib/win32/NdbDaemon.c create mode 100644 ndb/src/common/portlib/win32/NdbEnv.c create mode 100644 ndb/src/common/portlib/win32/NdbHost.c create mode 100644 ndb/src/common/portlib/win32/NdbMem.c create mode 100644 ndb/src/common/portlib/win32/NdbMutex.c create mode 100644 ndb/src/common/portlib/win32/NdbSleep.c create mode 100644 ndb/src/common/portlib/win32/NdbTCP.c create mode 100644 ndb/src/common/portlib/win32/NdbThread.c create mode 100644 ndb/src/common/portlib/win32/NdbTick.c diff --git a/ndb/Makefile.am b/ndb/Makefile.am index e4f21ac8040..a0b8efa7bb4 100644 --- a/ndb/Makefile.am +++ b/ndb/Makefile.am @@ -24,4 +24,6 @@ windoze: windoze-dsp: all-windoze-dsp: windoze - tar cvfz ndb-win-dsp.tar.gz `find . -name '*.dsp'` + find . -name '*.dsp' | xargs unix2dos + $(top_srcdir)/ndb/config/make-win-dsw.sh | unix2dos > ndb.dsw + tar cvfz ndb-win-dsp.tar.gz ndb.dsw `find . -name '*.dsp'` diff --git a/ndb/src/Makefile.am b/ndb/src/Makefile.am index 07f6ea5d8d4..6f3ca744b0e 100644 --- a/ndb/src/Makefile.am +++ b/ndb/src/Makefile.am @@ -28,5 +28,6 @@ libndbclient.dsp: Makefile \ cat $(top_srcdir)/ndb/config/win-lib.am > $@ @$(top_srcdir)/ndb/config/win-name $@ $(ndblib_LTLIBRARIES) @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) - @$(top_srcdir)/ndb/config/win-sources $@ $(libndbclient_la_SOURCES) - @$(top_srcdir)/ndb/config/win-libraries $@ $(libndbclient_la_LIBADD) + @$(top_srcdir)/ndb/config/win-sources $@ dummy.cpp + @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(libndbclient_la_LIBADD) + @touch dummy.cpp diff --git a/ndb/src/common/debugger/Makefile.am b/ndb/src/common/debugger/Makefile.am index 08251eb9155..e25a11c9bee 100644 --- a/ndb/src/common/debugger/Makefile.am +++ b/ndb/src/common/debugger/Makefile.am @@ -22,4 +22,4 @@ libtrace.dsp: Makefile \ @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LTLIBRARIES) @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) @$(top_srcdir)/ndb/config/win-sources $@ $(libtrace_la_SOURCES) - @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD) diff --git a/ndb/src/common/debugger/signaldata/Makefile.am b/ndb/src/common/debugger/signaldata/Makefile.am index bc18e17fbb0..9146d552568 100644 --- a/ndb/src/common/debugger/signaldata/Makefile.am +++ b/ndb/src/common/debugger/signaldata/Makefile.am @@ -44,4 +44,4 @@ libsignaldataprint.dsp: Makefile \ @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LTLIBRARIES) @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) @$(top_srcdir)/ndb/config/win-sources $@ $(libsignaldataprint_la_SOURCES) - @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD) diff --git a/ndb/src/common/logger/Makefile.am b/ndb/src/common/logger/Makefile.am index 90f3346b414..0af21f9fbde 100644 --- a/ndb/src/common/logger/Makefile.am +++ b/ndb/src/common/logger/Makefile.am @@ -1,8 +1,9 @@ noinst_LTLIBRARIES = liblogger.la -liblogger_la_SOURCES = Logger.cpp LogHandlerList.cpp LogHandler.cpp \ - ConsoleLogHandler.cpp FileLogHandler.cpp SysLogHandler.cpp +SOURCE_WIN = Logger.cpp LogHandlerList.cpp LogHandler.cpp \ + ConsoleLogHandler.cpp FileLogHandler.cpp +liblogger_la_SOURCES = $(SOURCE_WIN) SysLogHandler.cpp include $(top_srcdir)/ndb/config/common.mk.am include $(top_srcdir)/ndb/config/type_ndbapi.mk.am @@ -20,5 +21,5 @@ liblogger.dsp: Makefile \ cat $(top_srcdir)/ndb/config/win-lib.am > $@ @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LTLIBRARIES) @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) - @$(top_srcdir)/ndb/config/win-sources $@ $(liblogger_la_SOURCES) - @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) + @$(top_srcdir)/ndb/config/win-sources $@ $(SOURCE_WIN) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD) diff --git a/ndb/src/common/mgmcommon/Makefile.am b/ndb/src/common/mgmcommon/Makefile.am index ebb89f8a251..b322af03268 100644 --- a/ndb/src/common/mgmcommon/Makefile.am +++ b/ndb/src/common/mgmcommon/Makefile.am @@ -26,4 +26,4 @@ libmgmsrvcommon.dsp: Makefile \ @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LTLIBRARIES) @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) @$(top_srcdir)/ndb/config/win-sources $@ $(libmgmsrvcommon_la_SOURCES) - @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD) diff --git a/ndb/src/common/portlib/Makefile.am b/ndb/src/common/portlib/Makefile.am index fe69ef7346a..7717e1fcc27 100644 --- a/ndb/src/common/portlib/Makefile.am +++ b/ndb/src/common/portlib/Makefile.am @@ -16,6 +16,16 @@ PortLibTest_SOURCES = NdbPortLibTest.cpp munmaptest_SOURCES = munmaptest.cpp # Don't update the files from bitkeeper +WIN_src = win32/NdbCondition.c \ + win32/NdbDaemon.c \ + win32/NdbEnv.c \ + win32/NdbHost.c \ + win32/NdbMem.c \ + win32/NdbMutex.c \ + win32/NdbSleep.c \ + win32/NdbTCP.c \ + win32/NdbThread.c \ + win32/NdbTick.c windoze-dsp: libportlib.dsp @@ -28,5 +38,5 @@ libportlib.dsp: Makefile \ cat $(top_srcdir)/ndb/config/win-lib.am > $@ @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LTLIBRARIES) @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) - @$(top_srcdir)/ndb/config/win-sources $@ $(libportlib_la_SOURCES) - @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) + @$(top_srcdir)/ndb/config/win-sources $@ $(WIN_src) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD) diff --git a/ndb/src/common/portlib/win32/NdbCondition.c b/ndb/src/common/portlib/win32/NdbCondition.c new file mode 100644 index 00000000000..12b508cf33b --- /dev/null +++ b/ndb/src/common/portlib/win32/NdbCondition.c @@ -0,0 +1,184 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + + +#include +#include +#include +#include +#include + +#include "NdbCondition.h" +#include + + +struct NdbCondition +{ + long nWaiters; + NdbMutex* pNdbMutexWaitersLock; + HANDLE hSemaphore; + HANDLE hEventWaitersDone; + int bWasBroadcast; +}; + + +struct NdbCondition* +NdbCondition_Create(void) +{ + int result = 0; + struct NdbCondition* pNdbCondition = (struct NdbCondition*)malloc(sizeof(struct NdbCondition)); + if(!pNdbCondition) + return 0; + + pNdbCondition->nWaiters = 0; + pNdbCondition->bWasBroadcast = 0; + if(!(pNdbCondition->hSemaphore = CreateSemaphore(0, 0, MAXLONG, 0))) + result = -1; + else if(!(pNdbCondition->pNdbMutexWaitersLock = NdbMutex_Create())) + result = -1; + else if(!(pNdbCondition->hEventWaitersDone = CreateEvent(0, 0, 0, 0))) + result = -1; + + assert(!result); + return pNdbCondition; +} + + +int +NdbCondition_Wait(struct NdbCondition* p_cond, + NdbMutex* p_mutex) +{ + int result; + int bLastWaiter; + if(!p_cond || !p_mutex) + return 1; + + NdbMutex_Lock(p_cond->pNdbMutexWaitersLock); + p_cond->nWaiters++; + NdbMutex_Unlock(p_cond->pNdbMutexWaitersLock); + + if(NdbMutex_Unlock(p_mutex)) + return -1; + result = WaitForSingleObject (p_cond->hSemaphore, INFINITE); + + NdbMutex_Lock(p_cond->pNdbMutexWaitersLock); + p_cond->nWaiters--; + bLastWaiter = (p_cond->bWasBroadcast && p_cond->nWaiters==0); + NdbMutex_Unlock(p_cond->pNdbMutexWaitersLock); + + if(result==WAIT_OBJECT_0 && bLastWaiter) + SetEvent(p_cond->hEventWaitersDone); + + NdbMutex_Lock(p_mutex); + return result; +} + + +int +NdbCondition_WaitTimeout(struct NdbCondition* p_cond, + NdbMutex* p_mutex, + int msecs) +{ + int result; + int bLastWaiter; + if (!p_cond || !p_mutex) + return 1; + + NdbMutex_Lock(p_cond->pNdbMutexWaitersLock); + p_cond->nWaiters++; + NdbMutex_Unlock(p_cond->pNdbMutexWaitersLock); + if(msecs<0) + msecs = 0; + + if(NdbMutex_Unlock(p_mutex)) + return -1; + result = WaitForSingleObject(p_cond->hSemaphore, msecs); + + NdbMutex_Lock(p_cond->pNdbMutexWaitersLock); + p_cond->nWaiters--; + bLastWaiter = (p_cond->bWasBroadcast && p_cond->nWaiters==0); + NdbMutex_Unlock(p_cond->pNdbMutexWaitersLock); + + if(result!=WAIT_OBJECT_0) + result = -1; + + if(bLastWaiter) + SetEvent(p_cond->hEventWaitersDone); + + NdbMutex_Lock(p_mutex); + return result; +} + + +int +NdbCondition_Signal(struct NdbCondition* p_cond) +{ + int bHaveWaiters; + if(!p_cond) + return 1; + + NdbMutex_Lock(p_cond->pNdbMutexWaitersLock); + bHaveWaiters = (p_cond->nWaiters > 0); + NdbMutex_Unlock(p_cond->pNdbMutexWaitersLock); + + if(bHaveWaiters) + return (ReleaseSemaphore(p_cond->hSemaphore, 1, 0) ? 0 : -1); + else + return 0; +} + + +int NdbCondition_Broadcast(struct NdbCondition* p_cond) +{ + int bHaveWaiters; + int result = 0; + if(!p_cond) + return 1; + + NdbMutex_Lock(p_cond->pNdbMutexWaitersLock); + bHaveWaiters = 0; + if(p_cond->nWaiters > 0) + { + p_cond->bWasBroadcast = !0; + bHaveWaiters = 1; + } + NdbMutex_Unlock(p_cond->pNdbMutexWaitersLock); + if(bHaveWaiters) + { + if(!ReleaseSemaphore(p_cond->hSemaphore, p_cond->nWaiters, 0)) + result = -1; + else if(WaitForSingleObject (p_cond->hEventWaitersDone, INFINITE) != WAIT_OBJECT_0) + result = -1; + p_cond->bWasBroadcast = 0; + } + return result; +} + + +int NdbCondition_Destroy(struct NdbCondition* p_cond) +{ + int result; + if(!p_cond) + return 1; + + CloseHandle(p_cond->hEventWaitersDone); + NdbMutex_Destroy(p_cond->pNdbMutexWaitersLock); + result = (CloseHandle(p_cond->hSemaphore) ? 0 : -1); + + free(p_cond); + return 0; +} + diff --git a/ndb/src/common/portlib/win32/NdbDaemon.c b/ndb/src/common/portlib/win32/NdbDaemon.c new file mode 100644 index 00000000000..b96d4c20260 --- /dev/null +++ b/ndb/src/common/portlib/win32/NdbDaemon.c @@ -0,0 +1,44 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "NdbDaemon.h" + +#define NdbDaemon_ErrorSize 500 +long NdbDaemon_DaemonPid; +int NdbDaemon_ErrorCode; +char NdbDaemon_ErrorText[NdbDaemon_ErrorSize]; + +int +NdbDaemon_Make(const char* lockfile, const char* logfile, unsigned flags) +{ + // XXX do something + return 0; +} + +#ifdef NDB_DAEMON_TEST + +int +main() +{ + if (NdbDaemon_Make("test.pid", "test.log", 0) == -1) { + fprintf(stderr, "NdbDaemon_Make: %s\n", NdbDaemon_ErrorText); + return 1; + } + sleep(10); + return 0; +} + +#endif diff --git a/ndb/src/common/portlib/win32/NdbEnv.c b/ndb/src/common/portlib/win32/NdbEnv.c new file mode 100644 index 00000000000..0df703a5e97 --- /dev/null +++ b/ndb/src/common/portlib/win32/NdbEnv.c @@ -0,0 +1,33 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + + +#include "NdbEnv.h" +#include +#include + +const char* NdbEnv_GetEnv(const char* name, char * buf, int buflen) +{ + char* p = NULL; + p = getenv(name); + + if (p != NULL && buf != NULL){ + strncpy(buf, p, buflen); + buf[buflen-1] = 0; + } + return p; +} + diff --git a/ndb/src/common/portlib/win32/NdbHost.c b/ndb/src/common/portlib/win32/NdbHost.c new file mode 100644 index 00000000000..f91dd1a531c --- /dev/null +++ b/ndb/src/common/portlib/win32/NdbHost.c @@ -0,0 +1,53 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + + +#include "NdbHost.h" +#include +#include + + +int NdbHost_GetHostName(char* buf) +{ + /* We must initialize TCP/IP if we want to call gethostname */ + WORD wVersionRequested; + WSADATA wsaData; + int err; + + wVersionRequested = MAKEWORD( 2, 0 ); + err = WSAStartup( wVersionRequested, &wsaData ); + if ( err != 0 ) { + /** + * Tell the user that we couldn't find a usable + * WinSock DLL. + */ + return -1; + } + + /* Get host name */ + if(gethostname(buf, MAXHOSTNAMELEN)) + { + return -1; + } + return 0; +} + + +int NdbHost_GetProcessId(void) +{ + return _getpid(); +} + diff --git a/ndb/src/common/portlib/win32/NdbMem.c b/ndb/src/common/portlib/win32/NdbMem.c new file mode 100644 index 00000000000..274dc31353f --- /dev/null +++ b/ndb/src/common/portlib/win32/NdbMem.c @@ -0,0 +1,237 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + + +#include +#include +#include + +#include "NdbMem.h" + + +struct AWEINFO +{ + SIZE_T dwSizeInBytesRequested; + ULONG_PTR nNumberOfPagesRequested; + ULONG_PTR nNumberOfPagesActual; + ULONG_PTR nNumberOfPagesFreed; + ULONG_PTR* pnPhysicalMemoryPageArray; + void* pRegionReserved; +}; + +const size_t cNdbMem_nMaxAWEinfo = 256; +size_t gNdbMem_nAWEinfo = 0; + +struct AWEINFO* gNdbMem_pAWEinfo = 0; + + +void ShowLastError(const char* szContext, const char* szFunction) +{ + DWORD dwError = GetLastError(); + LPVOID lpMsgBuf; + FormatMessage( + FORMAT_MESSAGE_ALLOCATE_BUFFER | + FORMAT_MESSAGE_FROM_SYSTEM | + FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, + dwError, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language + (LPTSTR)&lpMsgBuf, + 0, + NULL + ); + printf("%s : %s failed : %lu : %s\n", szContext, szFunction, dwError, (char*)lpMsgBuf); + LocalFree(lpMsgBuf); +} + + + +void NdbMem_Create() +{ + // Address Windowing Extensions + struct PRIVINFO + { + DWORD Count; + LUID_AND_ATTRIBUTES Privilege[1]; + } Info; + + HANDLE hProcess = GetCurrentProcess(); + HANDLE hToken; + if(!OpenProcessToken(hProcess, TOKEN_ADJUST_PRIVILEGES, &hToken)) + { + ShowLastError("NdbMem_Create", "OpenProcessToken"); + } + + Info.Count = 1; + Info.Privilege[0].Attributes = SE_PRIVILEGE_ENABLED; + if(!LookupPrivilegeValue(0, SE_LOCK_MEMORY_NAME, &(Info.Privilege[0].Luid))) + { + ShowLastError("NdbMem_Create", "LookupPrivilegeValue"); + } + + if(!AdjustTokenPrivileges(hToken, FALSE, (PTOKEN_PRIVILEGES)&Info, 0, 0, 0)) + { + ShowLastError("NdbMem_Create", "AdjustTokenPrivileges"); + } + + if(!CloseHandle(hToken)) + { + ShowLastError("NdbMem_Create", "CloseHandle"); + } + + return; +} + +void NdbMem_Destroy() +{ + /* Do nothing */ + return; +} + +void* NdbMem_Allocate(size_t size) +{ + // Address Windowing Extensions + struct AWEINFO* pAWEinfo; + HANDLE hProcess; + SYSTEM_INFO sysinfo; + + if(!gNdbMem_pAWEinfo) + { + gNdbMem_pAWEinfo = VirtualAlloc(0, + sizeof(struct AWEINFO)*cNdbMem_nMaxAWEinfo, + MEM_COMMIT|MEM_RESERVE, PAGE_READWRITE); + } + + assert(gNdbMem_nAWEinfo < cNdbMem_nMaxAWEinfo); + pAWEinfo = gNdbMem_pAWEinfo+gNdbMem_nAWEinfo++; + + hProcess = GetCurrentProcess(); + GetSystemInfo(&sysinfo); + pAWEinfo->nNumberOfPagesRequested = (size+sysinfo.dwPageSize-1)/sysinfo.dwPageSize; + pAWEinfo->pnPhysicalMemoryPageArray = VirtualAlloc(0, + sizeof(ULONG_PTR)*pAWEinfo->nNumberOfPagesRequested, + MEM_COMMIT|MEM_RESERVE, PAGE_READWRITE); + pAWEinfo->nNumberOfPagesActual = pAWEinfo->nNumberOfPagesRequested; + if(!AllocateUserPhysicalPages(hProcess, &(pAWEinfo->nNumberOfPagesActual), pAWEinfo->pnPhysicalMemoryPageArray)) + { + ShowLastError("NdbMem_Allocate", "AllocateUserPhysicalPages"); + return 0; + } + if(pAWEinfo->nNumberOfPagesRequested != pAWEinfo->nNumberOfPagesActual) + { + ShowLastError("NdbMem_Allocate", "nNumberOfPagesRequested != nNumberOfPagesActual"); + return 0; + } + + pAWEinfo->dwSizeInBytesRequested = size; + pAWEinfo->pRegionReserved = VirtualAlloc(0, pAWEinfo->dwSizeInBytesRequested, MEM_RESERVE | MEM_PHYSICAL, PAGE_READWRITE); + if(!pAWEinfo->pRegionReserved) + { + ShowLastError("NdbMem_Allocate", "VirtualAlloc"); + return 0; + } + + if(!MapUserPhysicalPages(pAWEinfo->pRegionReserved, pAWEinfo->nNumberOfPagesActual, pAWEinfo->pnPhysicalMemoryPageArray)) + { + ShowLastError("NdbMem_Allocate", "MapUserPhysicalPages"); + return 0; + } + + /* + printf("allocate AWE memory: %lu bytes, %lu pages, address %lx\n", + pAWEinfo->dwSizeInBytesRequested, + pAWEinfo->nNumberOfPagesActual, + pAWEinfo->pRegionReserved); + */ + return pAWEinfo->pRegionReserved; +} + + +void* NdbMem_AllocateAlign(size_t size, size_t alignment) +{ + /* + return (void*)memalign(alignment, size); + TEMP fix + */ + return NdbMem_Allocate(size); +} + + +void NdbMem_Free(void* ptr) +{ + // VirtualFree(ptr, 0, MEM_DECOMMIT|MEM_RELEASE); + + // Address Windowing Extensions + struct AWEINFO* pAWEinfo = 0; + size_t i; + HANDLE hProcess; + + for(i=0; inNumberOfPagesActual, 0)) + { + ShowLastError("NdbMem_Free", "MapUserPhysicalPages"); + } + + if(!VirtualFree(ptr, 0, MEM_RELEASE)) + { + ShowLastError("NdbMem_Free", "VirtualFree"); + } + + pAWEinfo->nNumberOfPagesFreed = pAWEinfo->nNumberOfPagesActual; + if(!FreeUserPhysicalPages(hProcess, &(pAWEinfo->nNumberOfPagesFreed), pAWEinfo->pnPhysicalMemoryPageArray)) + { + ShowLastError("NdbMem_Free", "FreeUserPhysicalPages"); + } + + VirtualFree(pAWEinfo->pnPhysicalMemoryPageArray, 0, MEM_DECOMMIT|MEM_RELEASE); +} + + +int NdbMem_MemLockAll() +{ + /* + HANDLE hProcess = GetCurrentProcess(); + SIZE_T nMinimumWorkingSetSize; + SIZE_T nMaximumWorkingSetSize; + GetProcessWorkingSetSize(hProcess, &nMinimumWorkingSetSize, &nMaximumWorkingSetSize); + ndbout << "nMinimumWorkingSetSize=" << nMinimumWorkingSetSize << ", nMaximumWorkingSetSize=" << nMaximumWorkingSetSize << endl; + + SetProcessWorkingSetSize(hProcess, 50000000, 100000000); + + GetProcessWorkingSetSize(hProcess, &nMinimumWorkingSetSize, &nMaximumWorkingSetSize); + ndbout << "nMinimumWorkingSetSize=" << nMinimumWorkingSetSize << ", nMaximumWorkingSetSize=" << nMaximumWorkingSetSize << endl; + */ + return -1; +} + +int NdbMem_MemUnlockAll() +{ + //VirtualUnlock(); + return -1; +} + diff --git a/ndb/src/common/portlib/win32/NdbMutex.c b/ndb/src/common/portlib/win32/NdbMutex.c new file mode 100644 index 00000000000..c93384d91db --- /dev/null +++ b/ndb/src/common/portlib/win32/NdbMutex.c @@ -0,0 +1,78 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + + +#include +#include +#include +#include +#include + +#include "NdbMutex.h" + + +NdbMutex* NdbMutex_Create(void) +{ + NdbMutex* pNdbMutex = (NdbMutex*)malloc(sizeof(NdbMutex)); + if(!pNdbMutex) + return 0; + + InitializeCriticalSection(pNdbMutex); + return pNdbMutex; +} + + +int NdbMutex_Destroy(NdbMutex* p_mutex) +{ + if(!p_mutex) + return -1; + + DeleteCriticalSection(p_mutex); + free(p_mutex); + return 0; +} + + +int NdbMutex_Lock(NdbMutex* p_mutex) +{ + if(!p_mutex) + return -1; + + EnterCriticalSection (p_mutex); + return 0; +} + + +int NdbMutex_Unlock(NdbMutex* p_mutex) +{ + if(!p_mutex) + return -1; + + LeaveCriticalSection(p_mutex); + return 0; +} + + +int NdbMutex_Trylock(NdbMutex* p_mutex) +{ + int result = -1; + if(p_mutex) + { + result = (TryEnterCriticalSection(p_mutex) ? 0 : -1); + } + return result; +} + diff --git a/ndb/src/common/portlib/win32/NdbSleep.c b/ndb/src/common/portlib/win32/NdbSleep.c new file mode 100644 index 00000000000..ac0f44dd07f --- /dev/null +++ b/ndb/src/common/portlib/win32/NdbSleep.c @@ -0,0 +1,35 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + + +#include "NdbSleep.h" + +#include + + +int +NdbSleep_MilliSleep(int milliseconds) +{ + Sleep(milliseconds); + return 0; +} + +int +NdbSleep_SecSleep(int seconds) +{ + return NdbSleep_MilliSleep(seconds*1000); +} + diff --git a/ndb/src/common/portlib/win32/NdbTCP.c b/ndb/src/common/portlib/win32/NdbTCP.c new file mode 100644 index 00000000000..483a53bd606 --- /dev/null +++ b/ndb/src/common/portlib/win32/NdbTCP.c @@ -0,0 +1,39 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + + +#include "NdbTCP.h" + +int +Ndb_getInAddr(struct in_addr * dst, const char *address) +{ + struct hostent * hostPtr; + + /* Try it as aaa.bbb.ccc.ddd. */ + dst->s_addr = inet_addr(address); + if (dst->s_addr != -1) { + return 0; + } + + hostPtr = gethostbyname(address); + if (hostPtr != NULL) { + dst->s_addr = ((struct in_addr *) *hostPtr->h_addr_list)->s_addr; + return 0; + } + + return -1; +} + diff --git a/ndb/src/common/portlib/win32/NdbThread.c b/ndb/src/common/portlib/win32/NdbThread.c new file mode 100644 index 00000000000..ae3c74be70d --- /dev/null +++ b/ndb/src/common/portlib/win32/NdbThread.c @@ -0,0 +1,118 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + + +#include +#include +#include + +#include "NdbThread.h" + + +#define MAX_THREAD_NAME 16 + +typedef unsigned (WINAPI* NDB_WIN32_THREAD_FUNC)(void*); + + +struct NdbThread +{ + HANDLE hThread; + unsigned nThreadId; + char thread_name[MAX_THREAD_NAME]; +}; + + +struct NdbThread* NdbThread_Create(NDB_THREAD_FUNC *p_thread_func, + NDB_THREAD_ARG *p_thread_arg, + const NDB_THREAD_STACKSIZE thread_stack_size, + const char* p_thread_name, + NDB_THREAD_PRIO thread_prio) +{ + struct NdbThread* tmpThread; + unsigned initflag; + int nPriority = 0; + + if(!p_thread_func) + return 0; + + tmpThread = (struct NdbThread*)malloc(sizeof(struct NdbThread)); + if(!tmpThread) + return 0; + + strncpy((char*)&tmpThread->thread_name, p_thread_name, MAX_THREAD_NAME); + + switch(thread_prio) + { + case NDB_THREAD_PRIO_HIGHEST: nPriority=THREAD_PRIORITY_HIGHEST; break; + case NDB_THREAD_PRIO_HIGH: nPriority=THREAD_PRIORITY_ABOVE_NORMAL; break; + case NDB_THREAD_PRIO_MEAN: nPriority=THREAD_PRIORITY_NORMAL; break; + case NDB_THREAD_PRIO_LOW: nPriority=THREAD_PRIORITY_BELOW_NORMAL; break; + case NDB_THREAD_PRIO_LOWEST: nPriority=THREAD_PRIORITY_LOWEST; break; + } + initflag = (nPriority ? CREATE_SUSPENDED : 0); + + tmpThread->hThread = (HANDLE)_beginthreadex(0, thread_stack_size, + (NDB_WIN32_THREAD_FUNC)p_thread_func, p_thread_arg, + initflag, &tmpThread->nThreadId); + + if(nPriority && tmpThread->hThread) + { + SetThreadPriority(tmpThread->hThread, nPriority); + ResumeThread (tmpThread->hThread); + } + + assert(tmpThread->hThread); + return tmpThread; +} + + +void NdbThread_Destroy(struct NdbThread** p_thread) +{ + CloseHandle((*p_thread)->hThread); + (*p_thread)->hThread = 0; + free(*p_thread); + *p_thread = 0; +} + + +int NdbThread_WaitFor(struct NdbThread* p_wait_thread, void** status) +{ + void *local_status = 0; + if (status == 0) + status = &local_status; + + if(WaitForSingleObject(p_wait_thread->hThread, INFINITE) == WAIT_OBJECT_0 + && GetExitCodeThread(p_wait_thread->hThread, (LPDWORD)status)) + { + CloseHandle(p_wait_thread->hThread); + p_wait_thread->hThread = 0; + return 0; + } + return -1; +} + + +void NdbThread_Exit(int status) +{ + _endthreadex((DWORD) status); +} + + +int NdbThread_SetConcurrencyLevel(int level) +{ + return 0; +} + diff --git a/ndb/src/common/portlib/win32/NdbTick.c b/ndb/src/common/portlib/win32/NdbTick.c new file mode 100644 index 00000000000..e3a67d8437d --- /dev/null +++ b/ndb/src/common/portlib/win32/NdbTick.c @@ -0,0 +1,64 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + + +#include +#include "NdbTick.h" + +/* +#define FILETIME_PER_MICROSEC 10 +#define FILETIME_PER_MILLISEC 10000 +#define FILETIME_PER_SEC 10000000 + + +NDB_TICKS NdbTick_CurrentMillisecond(void) +{ + ULONGLONG ullTime; + GetSystemTimeAsFileTime((LPFILETIME)&ullTime); + return (ullTime / FILETIME_PER_MILLISEC); +} + +int +NdbTick_CurrentMicrosecond(NDB_TICKS * secs, Uint32 * micros) +{ + ULONGLONG ullTime; + GetSystemTimeAsFileTime((LPFILETIME)&ullTime); + *secs = (ullTime / FILETIME_PER_SEC); + *micros = (Uint32)((ullTime % FILETIME_PER_SEC) / FILETIME_PER_MICROSEC); + return 0; +} +*/ + + +NDB_TICKS NdbTick_CurrentMillisecond(void) +{ + LARGE_INTEGER liCount, liFreq; + QueryPerformanceCounter(&liCount); + QueryPerformanceFrequency(&liFreq); + return (liCount.QuadPart*1000) / liFreq.QuadPart; +} + +int +NdbTick_CurrentMicrosecond(NDB_TICKS * secs, Uint32 * micros) +{ + LARGE_INTEGER liCount, liFreq; + QueryPerformanceCounter(&liCount); + QueryPerformanceFrequency(&liFreq); + *secs = liCount.QuadPart / liFreq.QuadPart; + liCount.QuadPart -= *secs * liFreq.QuadPart; + *micros = (liCount.QuadPart*1000000) / liFreq.QuadPart; + return 0; +} diff --git a/ndb/src/common/transporter/Makefile.am b/ndb/src/common/transporter/Makefile.am index 3204a9a9254..d76b1b6048b 100644 --- a/ndb/src/common/transporter/Makefile.am +++ b/ndb/src/common/transporter/Makefile.am @@ -33,4 +33,4 @@ libtransporter.dsp: Makefile \ @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LTLIBRARIES) @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) @$(top_srcdir)/ndb/config/win-sources $@ $(libtransporter_la_SOURCES) - @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD) diff --git a/ndb/src/common/util/File.cpp b/ndb/src/common/util/File.cpp index f3faa8c4f7f..15698db3bc9 100644 --- a/ndb/src/common/util/File.cpp +++ b/ndb/src/common/util/File.cpp @@ -17,8 +17,8 @@ #include #include - #include +#include // // PUBLIC @@ -28,9 +28,14 @@ bool File_class::exists(const char* aFileName) { bool rc = true; - + +#ifdef USE_MY_STAT_STRUCT + struct my_stat stmp; +#else struct stat stmp; - if (::stat(aFileName, &stmp) != 0) +#endif + + if (my_stat(aFileName, &stmp, MYF(0)) != 0) { rc = false; } diff --git a/ndb/src/common/util/Makefile.am b/ndb/src/common/util/Makefile.am index cbc849a49f9..a62c8186174 100644 --- a/ndb/src/common/util/Makefile.am +++ b/ndb/src/common/util/Makefile.am @@ -29,4 +29,4 @@ libgeneral.dsp: Makefile \ @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LTLIBRARIES) @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) @$(top_srcdir)/ndb/config/win-sources $@ $(libgeneral_la_SOURCES) - @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD) diff --git a/ndb/src/cw/cpcd/Makefile.am b/ndb/src/cw/cpcd/Makefile.am index 20ac8e6e578..75f557b2af7 100644 --- a/ndb/src/cw/cpcd/Makefile.am +++ b/ndb/src/cw/cpcd/Makefile.am @@ -17,16 +17,4 @@ ndb_cpcd_LDFLAGS = @ndb_bin_am_ldflags@ # Don't update the files from bitkeeper %::SCCS/s.% -windoze-dsp: ndb_cpcd.dsp - -ndb_cpcd.dsp: Makefile \ - $(top_srcdir)/ndb/config/win-lib.am \ - $(top_srcdir)/ndb/config/win-name \ - $(top_srcdir)/ndb/config/win-includes \ - $(top_srcdir)/ndb/config/win-sources \ - $(top_srcdir)/ndb/config/win-libraries - cat $(top_srcdir)/ndb/config/win-lib.am > $@ - @$(top_srcdir)/ndb/config/win-name $@ $(ndbbin_PROGRAMS) - @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) - @$(top_srcdir)/ndb/config/win-sources $@ $(ndb_cpcd_SOURCES) - @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) +windoze-dsp: diff --git a/ndb/src/kernel/Makefile.am b/ndb/src/kernel/Makefile.am index 5b975d9d0eb..55d3c5a578f 100644 --- a/ndb/src/kernel/Makefile.am +++ b/ndb/src/kernel/Makefile.am @@ -63,13 +63,13 @@ LDADD += \ windoze-dsp: ndbd.dsp ndbd.dsp: Makefile \ - $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-prg.am \ $(top_srcdir)/ndb/config/win-name \ $(top_srcdir)/ndb/config/win-includes \ $(top_srcdir)/ndb/config/win-sources \ $(top_srcdir)/ndb/config/win-libraries - cat $(top_srcdir)/ndb/config/win-lib.am > $@ + cat $(top_srcdir)/ndb/config/win-prg.am > $@ @$(top_srcdir)/ndb/config/win-name $@ $(ndbbin_PROGRAMS) @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) @$(top_srcdir)/ndb/config/win-sources $@ $(ndbd_SOURCES) - @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) + @$(top_srcdir)/ndb/config/win-libraries $@ LINK $(LDADD) diff --git a/ndb/src/kernel/blocks/backup/Makefile.am b/ndb/src/kernel/blocks/backup/Makefile.am index 4726f291d01..a1f8ff31746 100644 --- a/ndb/src/kernel/blocks/backup/Makefile.am +++ b/ndb/src/kernel/blocks/backup/Makefile.am @@ -23,4 +23,4 @@ libbackup.dsp: Makefile \ @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) @$(top_srcdir)/ndb/config/win-sources $@ $(libbackup_a_SOURCES) - @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD) diff --git a/ndb/src/kernel/blocks/backup/restore/Makefile.am b/ndb/src/kernel/blocks/backup/restore/Makefile.am index 3a9baea8fbc..e172b9ea323 100644 --- a/ndb/src/kernel/blocks/backup/restore/Makefile.am +++ b/ndb/src/kernel/blocks/backup/restore/Makefile.am @@ -18,13 +18,13 @@ ndb_restore_LDFLAGS = @ndb_bin_am_ldflags@ windoze-dsp: ndb_restore.dsp ndb_restore.dsp: Makefile \ - $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-prg.am \ $(top_srcdir)/ndb/config/win-name \ $(top_srcdir)/ndb/config/win-includes \ $(top_srcdir)/ndb/config/win-sources \ $(top_srcdir)/ndb/config/win-libraries - cat $(top_srcdir)/ndb/config/win-lib.am > $@ - @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LTLIBRARIES) + cat $(top_srcdir)/ndb/config/win-prg.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(ndbtools_PROGRAMS) @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) @$(top_srcdir)/ndb/config/win-sources $@ $(ndb_restore_SOURCES) - @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) + @$(top_srcdir)/ndb/config/win-libraries $@ LINK $(LDADD) diff --git a/ndb/src/kernel/blocks/cmvmi/Makefile.am b/ndb/src/kernel/blocks/cmvmi/Makefile.am index f806183338f..dc2e12746fd 100644 --- a/ndb/src/kernel/blocks/cmvmi/Makefile.am +++ b/ndb/src/kernel/blocks/cmvmi/Makefile.am @@ -21,4 +21,4 @@ libcmvmi.dsp: Makefile \ @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) @$(top_srcdir)/ndb/config/win-sources $@ $(libcmvmi_a_SOURCES) - @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD) diff --git a/ndb/src/kernel/blocks/dbacc/Makefile.am b/ndb/src/kernel/blocks/dbacc/Makefile.am index 40b0ecdee1f..e44524c3edd 100644 --- a/ndb/src/kernel/blocks/dbacc/Makefile.am +++ b/ndb/src/kernel/blocks/dbacc/Makefile.am @@ -21,4 +21,4 @@ libdbacc.dsp: Makefile \ @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) @$(top_srcdir)/ndb/config/win-sources $@ $(libdbacc_a_SOURCES) - @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD) diff --git a/ndb/src/kernel/blocks/dbdict/Makefile.am b/ndb/src/kernel/blocks/dbdict/Makefile.am index c97dcb62ba5..9a0d68f8148 100644 --- a/ndb/src/kernel/blocks/dbdict/Makefile.am +++ b/ndb/src/kernel/blocks/dbdict/Makefile.am @@ -22,4 +22,4 @@ libdbdict.dsp: Makefile \ @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) @$(top_srcdir)/ndb/config/win-sources $@ $(libdbdict_a_SOURCES) - @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD) diff --git a/ndb/src/kernel/blocks/dbdih/Makefile.am b/ndb/src/kernel/blocks/dbdih/Makefile.am index 86eb4df5df1..d6ad380b806 100644 --- a/ndb/src/kernel/blocks/dbdih/Makefile.am +++ b/ndb/src/kernel/blocks/dbdih/Makefile.am @@ -20,4 +20,4 @@ libdbdih.dsp: Makefile \ @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) @$(top_srcdir)/ndb/config/win-sources $@ $(libdbdih_a_SOURCES) - @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD) diff --git a/ndb/src/kernel/blocks/dblqh/Makefile.am b/ndb/src/kernel/blocks/dblqh/Makefile.am index 3ea54b29659..854860b269c 100644 --- a/ndb/src/kernel/blocks/dblqh/Makefile.am +++ b/ndb/src/kernel/blocks/dblqh/Makefile.am @@ -22,4 +22,4 @@ libdblqh.dsp: Makefile \ @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) @$(top_srcdir)/ndb/config/win-sources $@ $(libdblqh_a_SOURCES) - @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD) diff --git a/ndb/src/kernel/blocks/dbtc/Makefile.am b/ndb/src/kernel/blocks/dbtc/Makefile.am index cf8f7c36fd3..98ee2639bac 100644 --- a/ndb/src/kernel/blocks/dbtc/Makefile.am +++ b/ndb/src/kernel/blocks/dbtc/Makefile.am @@ -20,4 +20,4 @@ libdbtc.dsp: Makefile \ @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) @$(top_srcdir)/ndb/config/win-sources $@ $(libdbtc_a_SOURCES) - @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD) diff --git a/ndb/src/kernel/blocks/dbtup/Makefile.am b/ndb/src/kernel/blocks/dbtup/Makefile.am index a1cf3f0d234..e51410e6be3 100644 --- a/ndb/src/kernel/blocks/dbtup/Makefile.am +++ b/ndb/src/kernel/blocks/dbtup/Makefile.am @@ -38,4 +38,4 @@ libdbtup.dsp: Makefile \ @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) @$(top_srcdir)/ndb/config/win-sources $@ $(libdbtup_a_SOURCES) - @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD) diff --git a/ndb/src/kernel/blocks/dbtux/Makefile.am b/ndb/src/kernel/blocks/dbtux/Makefile.am index a6bcad10a76..b5951e8ed37 100644 --- a/ndb/src/kernel/blocks/dbtux/Makefile.am +++ b/ndb/src/kernel/blocks/dbtux/Makefile.am @@ -31,4 +31,4 @@ libdbtux.dsp: Makefile \ @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) @$(top_srcdir)/ndb/config/win-sources $@ $(libdbtux_a_SOURCES) - @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD) diff --git a/ndb/src/kernel/blocks/dbutil/Makefile.am b/ndb/src/kernel/blocks/dbutil/Makefile.am index 24ed1d48086..925356c2f76 100644 --- a/ndb/src/kernel/blocks/dbutil/Makefile.am +++ b/ndb/src/kernel/blocks/dbutil/Makefile.am @@ -8,9 +8,9 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am # Don't update the files from bitkeeper %::SCCS/s.% -windoze-dsp: libutil.dsp +windoze-dsp: libdbutil.dsp -libutil.dsp: Makefile \ +libdbutil.dsp: Makefile \ $(top_srcdir)/ndb/config/win-lib.am \ $(top_srcdir)/ndb/config/win-name \ $(top_srcdir)/ndb/config/win-includes \ @@ -19,5 +19,5 @@ libutil.dsp: Makefile \ cat $(top_srcdir)/ndb/config/win-lib.am > $@ @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) - @$(top_srcdir)/ndb/config/win-sources $@ $(libutil_a_SOURCES) - @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) + @$(top_srcdir)/ndb/config/win-sources $@ $(libdbutil_a_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD) diff --git a/ndb/src/kernel/blocks/grep/Makefile.am b/ndb/src/kernel/blocks/grep/Makefile.am index cbb1c1721c1..6d2b422784b 100644 --- a/ndb/src/kernel/blocks/grep/Makefile.am +++ b/ndb/src/kernel/blocks/grep/Makefile.am @@ -20,4 +20,4 @@ libgrep.dsp: Makefile \ @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) @$(top_srcdir)/ndb/config/win-sources $@ $(libgrep_a_SOURCES) - @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD) diff --git a/ndb/src/kernel/blocks/ndbcntr/Makefile.am b/ndb/src/kernel/blocks/ndbcntr/Makefile.am index de5e24e6be8..3f24675b2b3 100644 --- a/ndb/src/kernel/blocks/ndbcntr/Makefile.am +++ b/ndb/src/kernel/blocks/ndbcntr/Makefile.am @@ -23,4 +23,4 @@ libndbcntr.dsp: Makefile \ @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) @$(top_srcdir)/ndb/config/win-sources $@ $(libndbcntr_a_SOURCES) - @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD) diff --git a/ndb/src/kernel/blocks/ndbfs/Makefile.am b/ndb/src/kernel/blocks/ndbfs/Makefile.am index b33508f6bee..a22386f8612 100644 --- a/ndb/src/kernel/blocks/ndbfs/Makefile.am +++ b/ndb/src/kernel/blocks/ndbfs/Makefile.am @@ -24,4 +24,4 @@ libndbfs.dsp: Makefile \ @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) @$(top_srcdir)/ndb/config/win-sources $@ $(libndbfs_a_SOURCES) - @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD) diff --git a/ndb/src/kernel/blocks/qmgr/Makefile.am b/ndb/src/kernel/blocks/qmgr/Makefile.am index 280fd7caeec..278af2a7865 100644 --- a/ndb/src/kernel/blocks/qmgr/Makefile.am +++ b/ndb/src/kernel/blocks/qmgr/Makefile.am @@ -22,4 +22,4 @@ libqmgr.dsp: Makefile \ @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) @$(top_srcdir)/ndb/config/win-sources $@ $(libqmgr_a_SOURCES) - @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD) diff --git a/ndb/src/kernel/blocks/suma/Makefile.am b/ndb/src/kernel/blocks/suma/Makefile.am index 1101aa78c73..5a74dbb74eb 100644 --- a/ndb/src/kernel/blocks/suma/Makefile.am +++ b/ndb/src/kernel/blocks/suma/Makefile.am @@ -20,4 +20,4 @@ libsuma.dsp: Makefile \ @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) @$(top_srcdir)/ndb/config/win-sources $@ $(libsuma_a_SOURCES) - @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD) diff --git a/ndb/src/kernel/blocks/trix/Makefile.am b/ndb/src/kernel/blocks/trix/Makefile.am index 85ff101b496..343063a6283 100644 --- a/ndb/src/kernel/blocks/trix/Makefile.am +++ b/ndb/src/kernel/blocks/trix/Makefile.am @@ -20,4 +20,4 @@ libtrix.dsp: Makefile \ @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) @$(top_srcdir)/ndb/config/win-sources $@ $(libtrix_a_SOURCES) - @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD) diff --git a/ndb/src/kernel/error/Makefile.am b/ndb/src/kernel/error/Makefile.am index fe78667caba..54f3de2d76d 100644 --- a/ndb/src/kernel/error/Makefile.am +++ b/ndb/src/kernel/error/Makefile.am @@ -22,4 +22,4 @@ liberror.dsp: Makefile \ @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) @$(top_srcdir)/ndb/config/win-sources $@ $(liberror_a_SOURCES) - @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD) diff --git a/ndb/src/kernel/vm/Makefile.am b/ndb/src/kernel/vm/Makefile.am index 038ea882dce..0dce9285ae3 100644 --- a/ndb/src/kernel/vm/Makefile.am +++ b/ndb/src/kernel/vm/Makefile.am @@ -40,4 +40,4 @@ libkernel.dsp: Makefile \ @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) @$(top_srcdir)/ndb/config/win-sources $@ $(libkernel_a_SOURCES) - @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD) diff --git a/ndb/src/mgmapi/Makefile.am b/ndb/src/mgmapi/Makefile.am index fab9f5d762d..f03bf155c6e 100644 --- a/ndb/src/mgmapi/Makefile.am +++ b/ndb/src/mgmapi/Makefile.am @@ -26,4 +26,4 @@ libmgmapi.dsp: Makefile \ @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LTLIBRARIES) @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) @$(top_srcdir)/ndb/config/win-sources $@ $(libmgmapi_la_SOURCES) - @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD) diff --git a/ndb/src/mgmsrv/InitConfigFileParser.cpp b/ndb/src/mgmsrv/InitConfigFileParser.cpp index bf74f220b58..adbcd8c4256 100644 --- a/ndb/src/mgmsrv/InitConfigFileParser.cpp +++ b/ndb/src/mgmsrv/InitConfigFileParser.cpp @@ -21,6 +21,7 @@ #include "MgmtErrorReporter.hpp" #include #include "ConfigInfo.hpp" +#include const int MAX_LINE_LENGTH = 1024; // Max length of line of text in config file static void trim(char *); diff --git a/ndb/src/mgmsrv/Makefile.am b/ndb/src/mgmsrv/Makefile.am index 4b66e3cc7bc..50e0b6023ad 100644 --- a/ndb/src/mgmsrv/Makefile.am +++ b/ndb/src/mgmsrv/Makefile.am @@ -45,13 +45,13 @@ ndb_mgmd_LDFLAGS = @ndb_bin_am_ldflags@ windoze-dsp: ndb_mgmd.dsp ndb_mgmd.dsp: Makefile \ - $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-prg.am \ $(top_srcdir)/ndb/config/win-name \ $(top_srcdir)/ndb/config/win-includes \ $(top_srcdir)/ndb/config/win-sources \ $(top_srcdir)/ndb/config/win-libraries - cat $(top_srcdir)/ndb/config/win-lib.am > $@ + cat $(top_srcdir)/ndb/config/win-prg.am > $@ @$(top_srcdir)/ndb/config/win-name $@ $(ndbbin_PROGRAMS) @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) @$(top_srcdir)/ndb/config/win-sources $@ $(ndb_mgmd_SOURCES) - @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) + @$(top_srcdir)/ndb/config/win-libraries $@ LINK $(LDADD) diff --git a/ndb/src/mgmsrv/MgmtSrvr.cpp b/ndb/src/mgmsrv/MgmtSrvr.cpp index a49b29af275..2bd2a564223 100644 --- a/ndb/src/mgmsrv/MgmtSrvr.cpp +++ b/ndb/src/mgmsrv/MgmtSrvr.cpp @@ -52,6 +52,7 @@ #include #include #include +#include //#define MGM_SRV_DEBUG #ifdef MGM_SRV_DEBUG diff --git a/ndb/src/ndbapi/Makefile.am b/ndb/src/ndbapi/Makefile.am index e3dcd682bba..9f8a851b995 100644 --- a/ndb/src/ndbapi/Makefile.am +++ b/ndb/src/ndbapi/Makefile.am @@ -60,4 +60,4 @@ libndbapi.dsp: Makefile \ @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LTLIBRARIES) @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) @$(top_srcdir)/ndb/config/win-sources $@ $(libndbapi_la_SOURCES) - @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD) diff --git a/ndb/src/ndbapi/ndberror.c b/ndb/src/ndbapi/ndberror.c index 750ed720f78..3815bbc79c2 100644 --- a/ndb/src/ndbapi/ndberror.c +++ b/ndb/src/ndbapi/ndberror.c @@ -17,6 +17,7 @@ #include #include +#include typedef struct ErrorBundle { int code; diff --git a/ndb/test/include/NdbSchemaOp.hpp b/ndb/test/include/NdbSchemaOp.hpp index 43f76c8c253..ac859f8abe8 100644 --- a/ndb/test/include/NdbSchemaOp.hpp +++ b/ndb/test/include/NdbSchemaOp.hpp @@ -303,6 +303,7 @@ public: * * @deprecated do not use! */ +#ifndef NDB_WIN32 inline int createTable( const char* aTableName, Uint32 aTableSize, KeyType aTupleKey, @@ -324,6 +325,7 @@ public: aMemoryType, (aStoredTable == 1 ? true : false)); } +#endif /** * Add a new attribute to a database table. diff --git a/ndb/test/run-test/Makefile.am b/ndb/test/run-test/Makefile.am index bc245a1413f..83dcb3dbbcf 100644 --- a/ndb/test/run-test/Makefile.am +++ b/ndb/test/run-test/Makefile.am @@ -24,16 +24,4 @@ wrappers_SCRIPTS=atrt-testBackup atrt-mysql-test-run # Don't update the files from bitkeeper %::SCCS/s.% -windoze-dsp: atrt.dsp - -atrt.dsp: Makefile \ - $(top_srcdir)/ndb/config/win-lib.am \ - $(top_srcdir)/ndb/config/win-name \ - $(top_srcdir)/ndb/config/win-includes \ - $(top_srcdir)/ndb/config/win-sources \ - $(top_srcdir)/ndb/config/win-libraries - cat $(top_srcdir)/ndb/config/win-lib.am > $@ - @$(top_srcdir)/ndb/config/win-name $@ $(test_PROGRAMS) - @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) - @$(top_srcdir)/ndb/config/win-sources $@ $(atrt_SOURCES) - @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) +windoze-dsp: diff --git a/ndb/test/src/CpcClient.cpp b/ndb/test/src/CpcClient.cpp index d407ba65312..2ef23528360 100644 --- a/ndb/test/src/CpcClient.cpp +++ b/ndb/test/src/CpcClient.cpp @@ -15,9 +15,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include -#include - -#include #include #include diff --git a/ndb/test/src/Makefile.am b/ndb/test/src/Makefile.am index 7d5904d897b..53a1df04c62 100644 --- a/ndb/test/src/Makefile.am +++ b/ndb/test/src/Makefile.am @@ -32,4 +32,4 @@ libNDBT.dsp: Makefile \ @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) @$(top_srcdir)/ndb/config/win-sources $@ $(libNDBT_a_SOURCES) - @$(top_srcdir)/ndb/config/win-libraries $@ $(LDADD) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD) diff --git a/ndb/test/src/NdbRestarter.cpp b/ndb/test/src/NdbRestarter.cpp index 4d6d3ddc001..14976b561e8 100644 --- a/ndb/test/src/NdbRestarter.cpp +++ b/ndb/test/src/NdbRestarter.cpp @@ -57,7 +57,7 @@ NdbRestarter::NdbRestarter(const char* _addr): switch(m->type){ case MgmId_TCP: char buf[255]; - snprintf(buf, 255, "%s:%d", m->name.c_str(), m->port); + BaseString::snprintf(buf, 255, "%s:%d", m->name.c_str(), m->port); addr.assign(buf); host.assign(m->name.c_str()); port = m->port; diff --git a/ndb/test/src/getarg.c b/ndb/test/src/getarg.c index 9f03af69824..58e33e81470 100644 --- a/ndb/test/src/getarg.c +++ b/ndb/test/src/getarg.c @@ -293,7 +293,7 @@ arg_printusage (struct getargs *args, col += fprintf(stderr, " %s", buf); } if (args[i].short_name) { - snprintf(buf, sizeof(buf), "[-%c", args[i].short_name); + BaseString::snprintf(buf, sizeof(buf), "[-%c", args[i].short_name); len += 2; len += print_arg(buf + strlen(buf), sizeof(buf) - strlen(buf), 0, 0, &args[i]); From 9ae3dde8b5796bdcd6f8c6c2add8ded3a489f14e Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 11 Nov 2004 21:26:24 +0100 Subject: [PATCH 0192/1063] mi_write: fix for ft2 when found word (in the tree) has different length as the word to insert myisam/mi_check.c: one more correctness check for CHECK of fulltext indexes --- myisam/mi_check.c | 8 ++++++++ myisam/mi_write.c | 1 + 2 files changed, 9 insertions(+) diff --git a/myisam/mi_check.c b/myisam/mi_check.c index 1df518a2712..bf684270c0a 100644 --- a/myisam/mi_check.c +++ b/myisam/mi_check.c @@ -656,6 +656,14 @@ static int chk_index(MI_CHECK *param, MI_INFO *info, MI_KEYDEF *keyinfo, if (chk_index_down(param,info,&info->s->ft2_keyinfo,record, temp_buff,&tmp_keys,key_checksum,1)) goto err; + if (tmp_keys + subkeys) + { + mi_check_print_error(param,"Number of words in the 2nd level tree " + "does not match the number in the header. " + "Parent word in on the page %s, offset %d", + llstr(page,llbuff), old_keypos-buff); + goto err; + } (*keys)+=tmp_keys-1; continue; } diff --git a/myisam/mi_write.c b/myisam/mi_write.c index dc596672a84..e059bbb569f 100644 --- a/myisam/mi_write.c +++ b/myisam/mi_write.c @@ -372,6 +372,7 @@ static int w_search(register MI_INFO *info, register MI_KEYDEF *keyinfo, /* popular word. two-level tree. going down */ my_off_t root=info->dupp_key_pos; keyinfo=&info->s->ft2_keyinfo; + get_key_full_length_rdonly(off, key); key+=off; keypos-=keyinfo->keylength+nod_flag; /* we'll modify key entry 'in vivo' */ error=_mi_ck_real_write_btree(info, keyinfo, key, 0, From f2cbfb80a7642eccae891aba6a50e52b4edcfda1 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 11 Nov 2004 21:38:42 +0100 Subject: [PATCH 0193/1063] wl1744 - ndb win-port ndb/include/ndbapi/NdbDictionary.hpp: win-port ndb/include/ndbapi/ndb_cluster_connection.hpp: win-port ndb/include/util/SocketServer.hpp: win-port ndb/src/common/portlib/win32/NdbCondition.c: win-port ndb/src/common/portlib/win32/NdbEnv.c: win-port ndb/src/common/portlib/win32/NdbHost.c: win-port ndb/src/common/portlib/win32/NdbMem.c: win-port ndb/src/common/portlib/win32/NdbMutex.c: win-port ndb/src/common/portlib/win32/NdbSleep.c: win-port ndb/src/common/portlib/win32/NdbTCP.c: win-port ndb/src/common/portlib/win32/NdbThread.c: win-port ndb/src/common/portlib/win32/NdbTick.c: win-port ndb/src/common/util/File.cpp: win-port ndb/src/mgmsrv/ConfigInfo.cpp: win-port ndb/src/mgmsrv/InitConfigFileParser.cpp: win-port ndb/src/mgmsrv/MgmtSrvr.cpp: win-port ndb/src/mgmsrv/MgmtSrvr.hpp: win-port ndb/src/mgmsrv/Services.cpp: win-port ndb/src/mgmsrv/Services.hpp: win-port ndb/src/mgmsrv/SignalQueue.hpp: win-port ndb/src/ndbapi/NdbDictionaryImpl.hpp: win-port ndb/test/src/NdbRestarts.cpp: win-port --- ndb/include/ndbapi/NdbDictionary.hpp | 2 +- ndb/include/ndbapi/ndb_cluster_connection.hpp | 4 +- ndb/include/util/SocketServer.hpp | 2 +- ndb/src/common/portlib/win32/NdbCondition.c | 8 +-- ndb/src/common/portlib/win32/NdbEnv.c | 4 +- ndb/src/common/portlib/win32/NdbHost.c | 3 +- ndb/src/common/portlib/win32/NdbMem.c | 58 +++++++++++++++++-- ndb/src/common/portlib/win32/NdbMutex.c | 8 +-- ndb/src/common/portlib/win32/NdbSleep.c | 5 +- ndb/src/common/portlib/win32/NdbTCP.c | 2 +- ndb/src/common/portlib/win32/NdbThread.c | 8 +-- ndb/src/common/portlib/win32/NdbTick.c | 4 +- ndb/src/common/util/File.cpp | 3 +- ndb/src/mgmsrv/ConfigInfo.cpp | 2 +- ndb/src/mgmsrv/InitConfigFileParser.cpp | 2 +- ndb/src/mgmsrv/MgmtSrvr.cpp | 6 +- ndb/src/mgmsrv/MgmtSrvr.hpp | 2 +- ndb/src/mgmsrv/Services.cpp | 6 +- ndb/src/mgmsrv/Services.hpp | 2 +- ndb/src/mgmsrv/SignalQueue.hpp | 12 ++-- ndb/src/ndbapi/NdbDictionaryImpl.hpp | 2 +- ndb/test/src/NdbRestarts.cpp | 2 +- 22 files changed, 85 insertions(+), 62 deletions(-) diff --git a/ndb/include/ndbapi/NdbDictionary.hpp b/ndb/include/ndbapi/NdbDictionary.hpp index a3115076624..217243071d0 100644 --- a/ndb/include/ndbapi/NdbDictionary.hpp +++ b/ndb/include/ndbapi/NdbDictionary.hpp @@ -710,7 +710,7 @@ public: /** * Get a specific column in the index */ - const NdbDictionary::Column * getColumn(unsigned no) const ; + const Column * getColumn(unsigned no) const ; /** * Get a specific column name in the index diff --git a/ndb/include/ndbapi/ndb_cluster_connection.hpp b/ndb/include/ndbapi/ndb_cluster_connection.hpp index f8e6f25ce73..6e24e084f58 100644 --- a/ndb/include/ndbapi/ndb_cluster_connection.hpp +++ b/ndb/include/ndbapi/ndb_cluster_connection.hpp @@ -19,9 +19,9 @@ #define CLUSTER_CONNECTION_HPP class TransporterFacade; -class LocalConfig; +struct LocalConfig; class ConfigRetriever; -class NdbThread; +struct NdbThread; extern "C" { void* run_ndb_cluster_connection_connect_thread(void*); diff --git a/ndb/include/util/SocketServer.hpp b/ndb/include/util/SocketServer.hpp index 2fad991e5f8..9d8af204391 100644 --- a/ndb/include/util/SocketServer.hpp +++ b/ndb/include/util/SocketServer.hpp @@ -98,7 +98,7 @@ public: */ void stopSessions(bool wait = false); - void foreachSession(void (*f)(SocketServer::Session*, void*), void *data); + void foreachSession(void (*f)(Session*, void*), void *data); private: struct SessionInstance { diff --git a/ndb/src/common/portlib/win32/NdbCondition.c b/ndb/src/common/portlib/win32/NdbCondition.c index 12b508cf33b..4046db1d60a 100644 --- a/ndb/src/common/portlib/win32/NdbCondition.c +++ b/ndb/src/common/portlib/win32/NdbCondition.c @@ -15,16 +15,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include -#include -#include -#include - +#include #include "NdbCondition.h" #include - struct NdbCondition { long nWaiters; diff --git a/ndb/src/common/portlib/win32/NdbEnv.c b/ndb/src/common/portlib/win32/NdbEnv.c index 0df703a5e97..f42e685fe15 100644 --- a/ndb/src/common/portlib/win32/NdbEnv.c +++ b/ndb/src/common/portlib/win32/NdbEnv.c @@ -14,10 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - +#include #include "NdbEnv.h" -#include -#include const char* NdbEnv_GetEnv(const char* name, char * buf, int buflen) { diff --git a/ndb/src/common/portlib/win32/NdbHost.c b/ndb/src/common/portlib/win32/NdbHost.c index f91dd1a531c..7df96c45991 100644 --- a/ndb/src/common/portlib/win32/NdbHost.c +++ b/ndb/src/common/portlib/win32/NdbHost.c @@ -15,9 +15,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include "NdbHost.h" -#include -#include int NdbHost_GetHostName(char* buf) diff --git a/ndb/src/common/portlib/win32/NdbMem.c b/ndb/src/common/portlib/win32/NdbMem.c index 274dc31353f..313ca9dff66 100644 --- a/ndb/src/common/portlib/win32/NdbMem.c +++ b/ndb/src/common/portlib/win32/NdbMem.c @@ -14,14 +14,10 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - -#include -#include -#include - +#include #include "NdbMem.h" - +#if 0 struct AWEINFO { SIZE_T dwSizeInBytesRequested; @@ -235,3 +231,53 @@ int NdbMem_MemUnlockAll() return -1; } +#endif + +void NdbMem_Create() +{ + /* Do nothing */ + return; +} + +void NdbMem_Destroy() +{ + /* Do nothing */ + return; +} + + +void* NdbMem_Allocate(size_t size) +{ + void* mem_allocated; + assert(size > 0); + mem_allocated= (void*)malloc(size); + return mem_allocated; +} + +void* NdbMem_AllocateAlign(size_t size, size_t alignment) +{ + (void)alignment; /* remove warning for unused parameter */ + /* + return (void*)memalign(alignment, size); + TEMP fix + */ + return (void*)malloc(size); +} + + +void NdbMem_Free(void* ptr) +{ + free(ptr); +} + + +int NdbMem_MemLockAll() +{ + return 0; +} + +int NdbMem_MemUnlockAll() +{ + return 0; +} + diff --git a/ndb/src/common/portlib/win32/NdbMutex.c b/ndb/src/common/portlib/win32/NdbMutex.c index c93384d91db..83c126abd4d 100644 --- a/ndb/src/common/portlib/win32/NdbMutex.c +++ b/ndb/src/common/portlib/win32/NdbMutex.c @@ -15,15 +15,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include -#include -#include -#include - +#include #include "NdbMutex.h" - NdbMutex* NdbMutex_Create(void) { NdbMutex* pNdbMutex = (NdbMutex*)malloc(sizeof(NdbMutex)); diff --git a/ndb/src/common/portlib/win32/NdbSleep.c b/ndb/src/common/portlib/win32/NdbSleep.c index ac0f44dd07f..8f5bdc49acd 100644 --- a/ndb/src/common/portlib/win32/NdbSleep.c +++ b/ndb/src/common/portlib/win32/NdbSleep.c @@ -14,12 +14,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - +#include #include "NdbSleep.h" -#include - - int NdbSleep_MilliSleep(int milliseconds) { diff --git a/ndb/src/common/portlib/win32/NdbTCP.c b/ndb/src/common/portlib/win32/NdbTCP.c index 483a53bd606..b936cd2db6c 100644 --- a/ndb/src/common/portlib/win32/NdbTCP.c +++ b/ndb/src/common/portlib/win32/NdbTCP.c @@ -14,7 +14,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - +#include #include "NdbTCP.h" int diff --git a/ndb/src/common/portlib/win32/NdbThread.c b/ndb/src/common/portlib/win32/NdbThread.c index ae3c74be70d..98db0d5c287 100644 --- a/ndb/src/common/portlib/win32/NdbThread.c +++ b/ndb/src/common/portlib/win32/NdbThread.c @@ -14,13 +14,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - -#include -#include -#include - +#include #include "NdbThread.h" - +#include #define MAX_THREAD_NAME 16 diff --git a/ndb/src/common/portlib/win32/NdbTick.c b/ndb/src/common/portlib/win32/NdbTick.c index e3a67d8437d..4430cbf419b 100644 --- a/ndb/src/common/portlib/win32/NdbTick.c +++ b/ndb/src/common/portlib/win32/NdbTick.c @@ -14,9 +14,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - -#include +#include #include "NdbTick.h" +//#include /* #define FILETIME_PER_MICROSEC 10 diff --git a/ndb/src/common/util/File.cpp b/ndb/src/common/util/File.cpp index 15698db3bc9..937b8c0fa59 100644 --- a/ndb/src/common/util/File.cpp +++ b/ndb/src/common/util/File.cpp @@ -17,6 +17,7 @@ #include #include + #include #include @@ -28,13 +29,11 @@ bool File_class::exists(const char* aFileName) { bool rc = true; - #ifdef USE_MY_STAT_STRUCT struct my_stat stmp; #else struct stat stmp; #endif - if (my_stat(aFileName, &stmp, MYF(0)) != 0) { rc = false; diff --git a/ndb/src/mgmsrv/ConfigInfo.cpp b/ndb/src/mgmsrv/ConfigInfo.cpp index 41280b907c4..486e152819a 100644 --- a/ndb/src/mgmsrv/ConfigInfo.cpp +++ b/ndb/src/mgmsrv/ConfigInfo.cpp @@ -3177,7 +3177,7 @@ transform(InitConfigFileParser::Context & ctx, Uint64 oldVal; require(ctx.m_currentSection->get(oldName, &oldVal)); - Uint64 newVal = (Uint64)(oldVal * mul + add); + Uint64 newVal = (Uint64)((Int64)oldVal * mul + add); if(!ctx.m_info->verify(ctx.m_currentInfo, newName, newVal)){ ctx.reportError("Unable to handle deprication, new value not within bounds" "%s %s - [%s] starting at line: %d", diff --git a/ndb/src/mgmsrv/InitConfigFileParser.cpp b/ndb/src/mgmsrv/InitConfigFileParser.cpp index adbcd8c4256..01d5afae381 100644 --- a/ndb/src/mgmsrv/InitConfigFileParser.cpp +++ b/ndb/src/mgmsrv/InitConfigFileParser.cpp @@ -386,7 +386,7 @@ bool InitConfigFileParser::convertStringToUint64(const char* s, errno = 0; char* p; - long long v = strtoll(s, &p, log10base); + Int64 v = strtoll(s, &p, log10base); if (errno != 0) return false; diff --git a/ndb/src/mgmsrv/MgmtSrvr.cpp b/ndb/src/mgmsrv/MgmtSrvr.cpp index 2bd2a564223..e86cfcb8e4b 100644 --- a/ndb/src/mgmsrv/MgmtSrvr.cpp +++ b/ndb/src/mgmsrv/MgmtSrvr.cpp @@ -124,7 +124,7 @@ MgmtSrvr::signalRecvThreadRun() while(!_isStopThread) { SigMatch *handler = NULL; NdbApiSignal *signal = NULL; - if(m_signalRecvQueue.waitFor(siglist, handler, signal, DEFAULT_TIMEOUT)) { + if(m_signalRecvQueue.waitFor(siglist, &handler, &signal, DEFAULT_TIMEOUT)) { if(handler->function != 0) (this->*handler->function)(signal); } @@ -2652,7 +2652,7 @@ MgmtSrvr::setDbParameter(int node, int param, const char * value, int p_type; unsigned val_32; - unsigned long long val_64; + Uint64 val_64; const char * val_char; do { p_type = 0; @@ -2714,7 +2714,7 @@ MgmtSrvr::setDbParameter(int node, int param, const char * value, template class Vector; #if __SUNPRO_CC != 0x560 -template bool SignalQueue::waitFor(Vector&, SigMatch*&, NdbApiSignal*&, unsigned); +template bool SignalQueue::waitFor(Vector&, SigMatch**, NdbApiSignal**, unsigned); #endif template class MutexVector; diff --git a/ndb/src/mgmsrv/MgmtSrvr.hpp b/ndb/src/mgmsrv/MgmtSrvr.hpp index b3257491123..c70b6a0a90f 100644 --- a/ndb/src/mgmsrv/MgmtSrvr.hpp +++ b/ndb/src/mgmsrv/MgmtSrvr.hpp @@ -663,7 +663,7 @@ private: */ static void signalReceivedNotification(void* mgmtSrvr, NdbApiSignal* signal, - class LinearSectionPtr ptr[3]); + struct LinearSectionPtr ptr[3]); /** * Called from "outside" of MgmtSrvr when a DB process has died. diff --git a/ndb/src/mgmsrv/Services.cpp b/ndb/src/mgmsrv/Services.cpp index 0394c4e80bb..47dde6c11d3 100644 --- a/ndb/src/mgmsrv/Services.cpp +++ b/ndb/src/mgmsrv/Services.cpp @@ -29,7 +29,7 @@ #include #include - +#include #include "Services.hpp" extern bool g_StopServer; @@ -282,8 +282,8 @@ MgmApiSession::runSession() { /* Backwards compatibility for old NDBs that still use * the old "GET CONFIG" command. */ - - for(size_t i=0; i bool waitFor(Vector &t, - T *&handler, - NdbApiSignal *&signal, + T **handler, + NdbApiSignal **signal, Uint32 timeout = DEFAULT_TIMEOUT); private: NdbMutex *m_mutex; /* Locks all data in SignalQueue */ @@ -75,8 +75,8 @@ private: template bool SignalQueue::waitFor(Vector &t, - T *&handler, - NdbApiSignal *&signal, + T **handler, + NdbApiSignal **signal, Uint32 timeout) { Guard g(m_mutex); @@ -88,8 +88,8 @@ SignalQueue::waitFor(Vector &t, for(size_t i = 0; i < t.size(); i++) { if(t[i].check(m_signalQueueHead->signal)) { - handler = &t[i]; - signal = pop(); + * handler = &t[i]; + * signal = pop(); return true; } } diff --git a/ndb/src/ndbapi/NdbDictionaryImpl.hpp b/ndb/src/ndbapi/NdbDictionaryImpl.hpp index 62d2a951f28..a47dae1bbb1 100644 --- a/ndb/src/ndbapi/NdbDictionaryImpl.hpp +++ b/ndb/src/ndbapi/NdbDictionaryImpl.hpp @@ -321,7 +321,7 @@ private: friend class Ndb; static void execSignal(void* dictImpl, class NdbApiSignal* signal, - class LinearSectionPtr ptr[3]); + struct LinearSectionPtr ptr[3]); static void execNodeStatus(void* dictImpl, Uint32, bool alive, bool nfCompleted); diff --git a/ndb/test/src/NdbRestarts.cpp b/ndb/test/src/NdbRestarts.cpp index b649a60d98b..607e48c4126 100644 --- a/ndb/test/src/NdbRestarts.cpp +++ b/ndb/test/src/NdbRestarts.cpp @@ -445,7 +445,7 @@ int twoNodeFailure(NdbRestarter& _restarter, << ") secs " << endl; NdbSleep_SecSleep(seconds); - randomId = (random() % _restarter.getNumDbNodes()); + randomId = (rand() % _restarter.getNumDbNodes()); nodeId = _restarter.getDbNodeId(randomId); g_info << _restart->m_name << ": node = "<< nodeId << endl; From 72c53dadfd805e2dba03c42b01b2e0984c781faa Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 11 Nov 2004 14:55:55 -0600 Subject: [PATCH 0194/1063] mysqldump.c: Reorder options, revise --hex-blob help string. client/mysqldump.c: Reorder options, revise --hex-blob help string. --- client/mysqldump.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/client/mysqldump.c b/client/mysqldump.c index dbc11f1ab90..864fe38a204 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -150,6 +150,9 @@ static struct my_option my_long_options[] = {"character-sets-dir", OPT_CHARSETS_DIR, "Directory where character sets are.", (gptr*) &charsets_dir, (gptr*) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"comments", 'i', "Write additional information.", + (gptr*) &opt_comments, (gptr*) &opt_comments, 0, GET_BOOL, NO_ARG, + 1, 0, 0, 0, 0, 0}, {"compatible", OPT_COMPATIBLE, "Change the dump to be compatible with a given mode. By default tables are dumped in a format optimized for MySQL. Legal modes are: ansi, mysql323, mysql40, postgresql, oracle, mssql, db2, maxdb, no_key_options, no_table_options, no_field_options. One can use several modes separated by commas. Note: Requires MySQL server version 4.1.0 or higher. This option is ignored with earlier server versions.", (gptr*) &opt_compatible_mode_str, (gptr*) &opt_compatible_mode_str, 0, @@ -225,6 +228,9 @@ static struct my_option my_long_options[] = 0, 0, 0, 0, 0, 0}, {"help", '?', "Display this help message and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"hex-blob", OPT_HEXBLOB, "Dump binary strings (BINARY, " + "VARBINARY, BLOB) in hexadecimal format.", + (gptr*) &opt_hex_blob, (gptr*) &opt_hex_blob, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"host", 'h', "Connect to host.", (gptr*) ¤t_host, (gptr*) ¤t_host, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"lines-terminated-by", OPT_LTB, "Lines in the i.file are terminated by ...", @@ -344,13 +350,7 @@ static struct my_option my_long_options[] = {"net_buffer_length", OPT_NET_BUFFER_LENGTH, "", (gptr*) &opt_net_buffer_length, (gptr*) &opt_net_buffer_length, 0, GET_ULONG, REQUIRED_ARG, 1024*1024L-1025, 4096, 16*1024L*1024L, - MALLOC_OVERHEAD-1024, 1024, 0}, - {"comments", 'i', "Write additional information.", - (gptr*) &opt_comments, (gptr*) &opt_comments, 0, GET_BOOL, NO_ARG, - 1, 0, 0, 0, 0, 0}, - {"hex-blob", OPT_HEXBLOB, "Dump BLOBs in HEX.", - (gptr*) &opt_hex_blob, (gptr*) &opt_hex_blob, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, - {0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} + MALLOC_OVERHEAD-1024, 1024, 0} }; static const char *load_default_groups[]= { "mysqldump","client",0 }; From b19eb67f08d04de3af744097e72023d550329035 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 11 Nov 2004 20:59:03 +0000 Subject: [PATCH 0195/1063] Bug#6123 - GRANT USAGE creates useless mysql.db row Prevent creation of a row which grants no rights Test included mysql-test/r/grant.result: Test for Bug#6123 mysql-test/t/grant.test: Test for Bug#6123 sql/sql_acl.cc: Bug#6123 Prevent creation of useless row --- mysql-test/r/grant.result | 6 ++++++ mysql-test/t/grant.test | 9 +++++++++ sql/sql_acl.cc | 3 ++- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/grant.result b/mysql-test/r/grant.result index d4d8dd1f026..f0e5d16e916 100644 --- a/mysql-test/r/grant.result +++ b/mysql-test/r/grant.result @@ -150,3 +150,9 @@ GRANT SELECT ON `ab%`.* TO 'test11'@'localhost' GRANT SELECT ON `a%`.* TO 'test11'@'localhost' delete from mysql.user where user='test11'; delete from mysql.db where user='test11'; +create database db6123; +grant usage on db6123.* to test6123 identified by 'magic123'; +select host,db,user,select_priv,insert_priv from mysql.db where db="db6123"; +host db user select_priv insert_priv +delete from mysql.user where user='test6123'; +drop database db6123; diff --git a/mysql-test/t/grant.test b/mysql-test/t/grant.test index a278b9d5928..21173a356ce 100644 --- a/mysql-test/t/grant.test +++ b/mysql-test/t/grant.test @@ -105,3 +105,12 @@ flush privileges; show grants for test11@localhost; delete from mysql.user where user='test11'; delete from mysql.db where user='test11'; + +# +# Bug#6123: GRANT USAGE inserts useless Db row +# +create database db6123; +grant usage on db6123.* to test6123 identified by 'magic123'; +select host,db,user,select_priv,insert_priv from mysql.db where db="db6123"; +delete from mysql.user where user='test6123'; +drop database db6123; diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index b3bc5a1e4f2..67ca62357ec 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -1587,7 +1587,7 @@ static int replace_db_table(TABLE *table, const char *db, goto table_error; /* purecov: deadcode */ } } - else if ((error=table->file->write_row(table->record[0]))) + else if (rights && (error=table->file->write_row(table->record[0]))) { if (error && error != HA_ERR_FOUND_DUPP_KEY) /* purecov: inspected */ goto table_error; /* purecov: deadcode */ @@ -1597,6 +1597,7 @@ static int replace_db_table(TABLE *table, const char *db, if (old_row_exists) acl_update_db(combo.user.str,combo.host.str,db,rights); else + if (rights) acl_insert_db(combo.user.str,combo.host.str,db,rights); table->file->index_end(); DBUG_RETURN(0); From c87d525f6a504767de56103486871ed2ce2c9f5b Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 11 Nov 2004 22:39:24 +0100 Subject: [PATCH 0196/1063] wl1744 - ndb win port improve ndb_global.h configure.in: check for some more includes ndb/include/ndb_global.h.in: better ndb_global.h.in --- configure.in | 2 +- ndb/include/ndb_global.h.in | 38 +++++++++++++++++++++++-------------- 2 files changed, 25 insertions(+), 15 deletions(-) diff --git a/configure.in b/configure.in index 55cd7edfca8..a4dfdfb9333 100644 --- a/configure.in +++ b/configure.in @@ -771,7 +771,7 @@ AC_CHECK_HEADERS(fcntl.h float.h floatingpoint.h ieeefp.h limits.h \ strings.h string.h synch.h sys/mman.h sys/socket.h netinet/in.h arpa/inet.h \ sys/timeb.h sys/types.h sys/un.h sys/vadvise.h sys/wait.h term.h \ unistd.h utime.h sys/utime.h termio.h termios.h sched.h crypt.h alloca.h \ - sys/ioctl.h malloc.h sys/malloc.h linux/config.h) + sys/ioctl.h malloc.h sys/malloc.h linux/config.h sys/resource.h sys/param.h) #-------------------------------------------------------------------- # Check for system libraries. Adds the library to $LIBS diff --git a/ndb/include/ndb_global.h.in b/ndb/include/ndb_global.h.in index af7f9383461..d89bf9c29d2 100644 --- a/ndb/include/ndb_global.h.in +++ b/ndb/include/ndb_global.h.in @@ -10,17 +10,20 @@ #if defined(_WIN32) || defined(_WIN64) || defined(__WIN32__) || defined(WIN32) #define NDB_WIN32 #include -#include -#include - #define PATH_MAX 256 #define DIR_SEPARATOR "\\" #define MYSQLCLUSTERDIR "c:\\mysql\\mysql-cluster" - +#define snprintf _snprintf +#define vsnprintf _vsnprintf +#define HAVE_STRCASECMP +#define strcasecmp(a,b) _strcmpi(a,b) +#define strncasecmp(a,b) _strncmpi(a,b) #pragma warning(disable: 4503 4786) - #else #undef NDB_WIN32 +#define DIR_SEPARATOR "/" +#endif + #include #include @@ -29,18 +32,24 @@ #endif #include #include -#include #include + #ifdef HAVE_STDARG_H #include #endif + #ifdef TIME_WITH_SYS_TIME #include #endif + #ifdef HAVE_FCNTL_H #include #endif + +#ifdef HAVE_SYS_PARAM_H #include +#endif + #ifdef HAVE_SYS_STAT_H #if defined(__cplusplus) && defined(_APP32_64BIT_OFF_T) && defined(_INCLUDE_AES_SOURCE) #undef _INCLUDE_AES_SOURCE @@ -50,18 +59,19 @@ #include #endif #endif + +#ifdef HAVE_SYS_RESOURCE_H #include +#endif + #ifdef HAVE_SYS_WAIT_H #include #endif + #ifdef HAVE_SYS_MMAN_H #include #endif -#define DIR_SEPARATOR "/" - -#endif - #ifndef HAVE_STRDUP extern char * strdup(const char *s); #endif @@ -94,6 +104,10 @@ extern int ndb_init(void); extern void ndb_end(int); #define NDB_INIT(prog_name) {my_progname=(prog_name); ndb_init();} +#ifdef __cplusplus +} +#endif + #ifdef SCO #ifndef PATH_MAX @@ -102,8 +116,4 @@ extern void ndb_end(int); #endif /* SCO */ -#ifdef __cplusplus -} -#endif - #endif From 4d51f987bdf155caeeedb0075cf8d69a258311d7 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 12 Nov 2004 08:48:31 +0100 Subject: [PATCH 0197/1063] wl1744 - ndb on windoze ndb/test/src/getarg.c: fix --- ndb/config/win-prg.am | 98 +++++++++++++++++++++++++++++++++++++++++++ ndb/test/src/getarg.c | 3 +- 2 files changed, 100 insertions(+), 1 deletion(-) create mode 100644 ndb/config/win-prg.am diff --git a/ndb/config/win-prg.am b/ndb/config/win-prg.am new file mode 100644 index 00000000000..10a8cfbca02 --- /dev/null +++ b/ndb/config/win-prg.am @@ -0,0 +1,98 @@ +# Microsoft Developer Studio Project File - Name="mysqld" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=@name@ - Win32 Release +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "@name@.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "@name@.mak" CFG="@name@ - Win32 Release" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "@name@ - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "@name@ - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=xicl6.exe +RSC=rc.exe + +!IF "$(CFG)" == "@name@ - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "release" +# PROP Intermediate_Dir "release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "NDB_WIN32" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /G6 /MT /W3 /O2 /D "NDB_WIN32" /I "../zlib" /I "../include" /I "../regex" /D "NDEBUG" /D "DBUG_OFF" /D "HAVE_INNOBASE_DB" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "HAVE_DLOPEN" /FD /c +# ADD BASE CPP @includes@ +# ADD CPP @includes@ +# SUBTRACT CPP /YX +# ADD BASE RSC /l 0x410 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=xilink6.exe +@release_libs@ +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib /nologo /subsystem:console /pdb:none /machine:I386 /out:"release/@name@-opt.exe" +# SUBTRACT LINK32 /debug + +!ELSEIF "$(CFG)" == "@name@ - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "debug" +# PROP Intermediate_Dir "debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "NDB_WIN32" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /D "NDB_WIN32" /I "../bdb/build_win32" /I "../include" /I "../regex" /I "../zlib" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "HAVE_INNOBASE_DB" /D "HAVE_BERKELEY_DB" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "HAVE_DLOPEN" /FD /c +# ADD BASE CPP @includes@ +# ADD CPP @includes@ +# SUBTRACT CPP /Fr /YX +# ADD BASE RSC /l 0x410 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=xilink6.exe +@debug_libs@ +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"debug/@name@.exe" /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "@name@ - Win32 Release" +# Name "@name@ - Win32 Debug" + +@sources@ + +# End Target +# End Project diff --git a/ndb/test/src/getarg.c b/ndb/test/src/getarg.c index 58e33e81470..5b67eb6343d 100644 --- a/ndb/test/src/getarg.c +++ b/ndb/test/src/getarg.c @@ -35,6 +35,7 @@ #include #include "getarg.h" +#include #ifndef HAVE_STRLCPY static size_t @@ -293,7 +294,7 @@ arg_printusage (struct getargs *args, col += fprintf(stderr, " %s", buf); } if (args[i].short_name) { - BaseString::snprintf(buf, sizeof(buf), "[-%c", args[i].short_name); + basestring_snprintf(buf, sizeof(buf), "[-%c", args[i].short_name); len += 2; len += print_arg(buf + strlen(buf), sizeof(buf) - strlen(buf), 0, 0, &args[i]); From 48b47b41c51de6ce4d0995f01aa9408c7c43d778 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 12 Nov 2004 09:18:26 +0100 Subject: [PATCH 0198/1063] wl1744 - more script fixes ndb/Makefile.am: remove SCCS-files --- ndb/Makefile.am | 4 ++-- ndb/config/make-win-dsw.sh | 42 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 2 deletions(-) create mode 100755 ndb/config/make-win-dsw.sh diff --git a/ndb/Makefile.am b/ndb/Makefile.am index a0b8efa7bb4..32c821383e6 100644 --- a/ndb/Makefile.am +++ b/ndb/Makefile.am @@ -24,6 +24,6 @@ windoze: windoze-dsp: all-windoze-dsp: windoze - find . -name '*.dsp' | xargs unix2dos + find . -name '*.dsp' | grep -v SCCS | xargs unix2dos $(top_srcdir)/ndb/config/make-win-dsw.sh | unix2dos > ndb.dsw - tar cvfz ndb-win-dsp.tar.gz ndb.dsw `find . -name '*.dsp'` + tar cvfz ndb-win-dsp.tar.gz ndb.dsw `find . -name '*.dsp' | grep -v SCCS` diff --git a/ndb/config/make-win-dsw.sh b/ndb/config/make-win-dsw.sh new file mode 100755 index 00000000000..b0613620f8a --- /dev/null +++ b/ndb/config/make-win-dsw.sh @@ -0,0 +1,42 @@ + +cat < + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +EOF +done + +cat< +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + +EOF From c63ae27eb81b7a55d8c941b0e38efdafc5833db5 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 12 Nov 2004 10:59:00 +0100 Subject: [PATCH 0199/1063] wl1744 - recommit stuff lost in corrupt clone ndb/config/win-libraries: recommit stuff lost in corrupt clone ndb/config/win-sources: recommit stuff lost in corrupt clone --- ndb/config/win-libraries | 24 +++++++++++++++++++----- ndb/config/win-sources | 2 +- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/ndb/config/win-libraries b/ndb/config/win-libraries index 91951957340..c7a6fb696ee 100755 --- a/ndb/config/win-libraries +++ b/ndb/config/win-libraries @@ -3,6 +3,9 @@ dst=$1 shift +type=$1 +shift + add_lib(){ echo `dirname $2`/$1/`basename $2 | sed "s/\.[l]*a/$3.lib/g"` } @@ -13,17 +16,28 @@ out_tls_rel= out_tls_deb= for i in $* do +# mysql VC++ project files have for some unknown reason +# choosen NOT to put libdbug.lib in $(topdir)./dbug but rather in $(topdir) +# the same goes for mysys and strings + lib=$i + case $i in + *libdbug.a | *libmysys.a | *libmystrings.a) + lib=`echo $i | sed s'!dbug\/lib!!' | sed 's!mysys\/lib!!' | sed 's!strings\/libmy!!'` + echo "Changing from $i to $lib" + ;; + esac + if [ `echo $i | grep -c gcc` -eq 0 ] then - out_rel="${out_rel} `add_lib lib_release $i`" - out_deb="${out_deb} `add_lib lib_debug $i`" - out_tls_rel="${out_tls_rel} `add_lib lib_release $i _tls`" - out_tls_deb="${out_tls_deb} `add_lib lib_debug $i _tls`" + out_rel="${out_rel} `add_lib lib_release $lib`" + out_deb="${out_deb} `add_lib lib_debug $lib`" + out_tls_rel="${out_tls_rel} `add_lib lib_release $lib _tls`" + out_tls_deb="${out_tls_deb} `add_lib lib_debug $lib _tls`" fi done fix(){ - echo "# ADD BASE LIB32 $*\n# ADD LIB32 $*\n" + echo "# ADD BASE ${type}32 $*\n# ADD ${type}32 $*\n" } if [ "$out_rel" ] diff --git a/ndb/config/win-sources b/ndb/config/win-sources index 688ecb8ebc4..a383bb0e613 100755 --- a/ndb/config/win-sources +++ b/ndb/config/win-sources @@ -4,5 +4,5 @@ dst=$1 shift out=`echo $* | sed 's!\([^ ]*\)!# Begin Source File\\\nSOURCE=\1\\\n# End Source File\\\n!g'` -sed -e "s/@sources@/$out/g" $dst > /tmp/$dst.$$ +sed -e "s!@sources@!$out!g" $dst > /tmp/$dst.$$ mv /tmp/$dst.$$ $dst From c1400a8421299f7933a2d46ebe6261db587848d8 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 12 Nov 2004 07:13:46 -0600 Subject: [PATCH 0200/1063] mysqldump.c: Add missing sentinel. client/mysqldump.c: Add missing sentinel. --- client/mysqldump.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/mysqldump.c b/client/mysqldump.c index 864fe38a204..a8c1d3c692b 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -350,7 +350,8 @@ static struct my_option my_long_options[] = {"net_buffer_length", OPT_NET_BUFFER_LENGTH, "", (gptr*) &opt_net_buffer_length, (gptr*) &opt_net_buffer_length, 0, GET_ULONG, REQUIRED_ARG, 1024*1024L-1025, 4096, 16*1024L*1024L, - MALLOC_OVERHEAD-1024, 1024, 0} + MALLOC_OVERHEAD-1024, 1024, 0}, + {0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} }; static const char *load_default_groups[]= { "mysqldump","client",0 }; From 5cc4a6e928ebb3026c45745bbc1c4cd0d18194b0 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 12 Nov 2004 08:45:58 -0600 Subject: [PATCH 0201/1063] fill_help_tables.sh: Recognize another Texinfo tag. scripts/fill_help_tables.sh: Recognize another Texinfo tag. --- scripts/fill_help_tables.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/fill_help_tables.sh b/scripts/fill_help_tables.sh index 1f44e9fa488..78dfe7b6088 100644 --- a/scripts/fill_help_tables.sh +++ b/scripts/fill_help_tables.sh @@ -198,6 +198,7 @@ sub prepare_name $a =~ s/(\@tab)/\t/g; $a =~ s/\@item/ /g; $a =~ s/\@minus\{\}/-/g; + $a =~ s/\@dots\{\}/.../g; $a =~ s/\@var\{((.|\n)+?)\}/$1/go; $a =~ s/\@command\{((.|\n)+?)\}/$1/go; $a =~ s/\@code\{((.|\n)+?)\}/$1/go; @@ -248,6 +249,7 @@ sub prepare_description $a =~ s/(\@tindex\s(.*?)\n)//g; $a =~ s/(\@c\s(.*?)\n)//g; $a =~ s/\@minus\{\}/-/g; + $a =~ s/\@dots\{\}/.../g; $a =~ s/\@var\{((.|\n)+?)\}/$1/go; $a =~ s/\@command\{((.|\n)+?)\}/$1/go; $a =~ s/\@code\{((.|\n)+?)\}/$1/go; @@ -280,6 +282,7 @@ sub prepare_example $a =~ s/(^\@c for_help_topic(.*?)\n)//g; $a =~ s/\@var\{((.|\n)+?)\}/$1/go; + $a =~ s/\@dots\{\}/.../g; $a =~ s/\\/\\\\/g; $a =~ s/(\@{)/{/g; $a =~ s/(\@})/}/g; From 2c6a3b97733a6e22fba947adb9052e677ef21838 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 12 Nov 2004 16:41:53 +0100 Subject: [PATCH 0202/1063] typos in error messages fixed sql/share/french/errmsg.txt: typos fixed sql/share/greek/errmsg.txt: typos fixed sql/share/portuguese/errmsg.txt: typos fixed sql/share/romanian/errmsg.txt: typos fixed sql/share/serbian/errmsg.txt: typos fixed sql/share/spanish/errmsg.txt: typos fixed sql/share/swedish/errmsg.txt: typos fixed --- sql/share/french/errmsg.txt | 2 +- sql/share/greek/errmsg.txt | 2 +- sql/share/portuguese/errmsg.txt | 2 +- sql/share/romanian/errmsg.txt | 2 +- sql/share/serbian/errmsg.txt | 2 +- sql/share/spanish/errmsg.txt | 6 +++--- sql/share/swedish/errmsg.txt | 4 ++-- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/sql/share/french/errmsg.txt b/sql/share/french/errmsg.txt index 355e784b156..bb2bd29171a 100644 --- a/sql/share/french/errmsg.txt +++ b/sql/share/french/errmsg.txt @@ -209,7 +209,7 @@ character-set=latin1 "Erreur d'écriture réseau reçue du maître", "Impossible de trouver un index FULLTEXT correspondant à cette liste de colonnes", "Impossible d'exécuter la commande car vous avez des tables verrouillées ou une transaction active", -"Variable système '%-.64' inconnue", +"Variable système '%-.64s' inconnue", "La table '%-.64s' est marquée 'crashed' et devrait être réparée", "La table '%-.64s' est marquée 'crashed' et le dernier 'repair' a échoué", "Attention: certaines tables ne supportant pas les transactions ont été changées et elles ne pourront pas être restituées", diff --git a/sql/share/greek/errmsg.txt b/sql/share/greek/errmsg.txt index 06f31a79a73..87168431595 100644 --- a/sql/share/greek/errmsg.txt +++ b/sql/share/greek/errmsg.txt @@ -168,7 +168,7 @@ character-set=greek "You have an error in your SQL syntax", "Delayed insert thread couldn't get requested lock for table %-.64s", "Too many delayed threads in use", -"Aborted connection %ld to db: '%-.64s' user: '%-32s' (%-.64s)", +"Aborted connection %ld to db: '%-.64s' user: '%-.32s' (%-.64s)", "Got a packet bigger than 'max_allowed_packet' bytes", "Got a read error from the connection pipe", "Got an error from fcntl()", diff --git a/sql/share/portuguese/errmsg.txt b/sql/share/portuguese/errmsg.txt index c79c346008e..65d80918072 100644 --- a/sql/share/portuguese/errmsg.txt +++ b/sql/share/portuguese/errmsg.txt @@ -211,7 +211,7 @@ character-set=latin1 "Erro de rede gravando no 'master'", "Não pode encontrar um índice para o texto todo que combine com a lista de colunas", "Não pode executar o comando dado porque você tem tabelas ativas travadas ou uma transação ativa", -"Variável de sistema '%-.64' desconhecida", +"Variável de sistema '%-.64s' desconhecida", "Tabela '%-.64s' está marcada como danificada e deve ser reparada", "Tabela '%-.64s' está marcada como danificada e a última reparação (automática?) falhou", "Aviso: Algumas tabelas não-transacionais alteradas não puderam ser reconstituídas (rolled back)", diff --git a/sql/share/romanian/errmsg.txt b/sql/share/romanian/errmsg.txt index 7cb0427dc3f..01c22f00119 100644 --- a/sql/share/romanian/errmsg.txt +++ b/sql/share/romanian/errmsg.txt @@ -173,7 +173,7 @@ character-set=latin2 "Aveti o eroare in sintaxa RSQL", "Thread-ul pentru inserarea aminata nu a putut obtine lacatul (lock) pentru tabela %-.64s", "Prea multe threaduri aminate care sint in uz", -"Conectie terminata %ld la baza de date: '%-.64s' utilizator: '%-32s' (%-.64s)", +"Conectie terminata %ld la baza de date: '%-.64s' utilizator: '%-.32s' (%-.64s)", "Un packet mai mare decit 'max_allowed_packet' a fost primit", "Eroare la citire din cauza lui 'connection pipe'", "Eroare obtinuta de la fcntl()", diff --git a/sql/share/serbian/errmsg.txt b/sql/share/serbian/errmsg.txt index 45b56c8269c..06270f621e4 100644 --- a/sql/share/serbian/errmsg.txt +++ b/sql/share/serbian/errmsg.txt @@ -202,7 +202,7 @@ character-set=cp1250 "Greška u slanju mrežnih paketa na glavni server u klasteru", "Ne mogu da pronaðem 'FULLTEXT' indeks koli odgovara listi kolona", "Ne mogu da izvršim datu komandu zbog toga što su tabele zakljuèane ili je transakcija u toku", -"Nepoznata sistemska promenljiva '%-.64'", +"Nepoznata sistemska promenljiva '%-.64s'", "Tabela '%-.64s' je markirana kao ošteæena i trebala bi biti popravljena", "Tabela '%-.64s' je markirana kao ošteæena, a zadnja (automatska?) popravka je bila neuspela", "Upozorenje: Neke izmenjene tabele ne podržavaju komandu 'ROLLBACK'", diff --git a/sql/share/spanish/errmsg.txt b/sql/share/spanish/errmsg.txt index bd2439c44a6..c5b4fd34eca 100644 --- a/sql/share/spanish/errmsg.txt +++ b/sql/share/spanish/errmsg.txt @@ -238,9 +238,9 @@ character-set=latin1 "No puede adicionar clave extranjera constraint", "No puede adicionar una línea hijo: falla de clave extranjera constraint", "No puede deletar una línea padre: falla de clave extranjera constraint", -"Error de coneccion a master: %-128s", -"Error executando el query en master: %-128%", -"Error de %s: %-128%", +"Error de coneccion a master: %-.128s", +"Error executando el query en master: %-.128s", +"Error de %s: %-.128s", "Equivocado uso de %s y %s", "El comando SELECT usado tiene diferente número de columnas", "No puedo ejecutar el query porque usted tiene conflicto de traba de lectura", diff --git a/sql/share/swedish/errmsg.txt b/sql/share/swedish/errmsg.txt index da75e4fcede..4dc42389d89 100644 --- a/sql/share/swedish/errmsg.txt +++ b/sql/share/swedish/errmsg.txt @@ -101,7 +101,7 @@ character-set=latin1 "Tabellen '%-.64s' har inget index som motsvarar det angivna i CREATE INDEX. Skapa om tabellen", "Fältseparatorerna är vad som förväntades. Kontrollera mot manualen", "Man kan inte använda fast radlängd med blobs. Använd 'fields terminated by'", -"Textfilen '%' måste finnas i databasbiblioteket eller vara läsbar för alla", +"Textfilen '%.64s' måste finnas i databasbiblioteket eller vara läsbar för alla", "Filen '%-.64s' existerar redan", "Rader: %ld Bortagna: %ld Dubletter: %ld Varningar: %ld", "Rader: %ld Dubletter: %ld", @@ -200,7 +200,7 @@ character-set=latin1 "Fick fel %d vid ROLLBACK", "Fick fel %d vid FLUSH_LOGS", "Fick fel %d vid CHECKPOINT", -"Avbröt länken för tråd %ld till db '%-.64s', användare '%-.32s', host '%-.64s' (%.-64s)", +"Avbröt länken för tråd %ld till db '%-.64s', användare '%-.32s', host '%-.64s' (%-.64s)", "Tabellhanteraren klarar inte en binär kopiering av tabellen", "Binärloggen stängdes medan FLUSH MASTER utfördes", "Failed rebuilding the index of dumped table '%-.64s'", From 55ae2e788088067fe539020c5162f4cfd96dfe43 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 12 Nov 2004 17:44:17 +0200 Subject: [PATCH 0203/1063] After merge fixes client/mysqldump.c: Merge with 4.0 (and reordering of options) client/mysqltest.c: Added DB as a user variable myisam/mi_check.c: Trivial cleanup mysql-test/r/grant.result: Move test to be in same order as in 4.0 mysql-test/r/mix_innodb_myisam_binlog.result: Updated results mysql-test/r/ps_1general.result: Updated tests to work after privilege fixes mysql-test/r/timezone3.result: Updated results to 4.1 mysql-test/t/ps_1general.test: Updated tests to work after privilege fixes sql-common/my_time.c: Applied sub-second patch from 4.0 sql/sql_acl.cc: More debugging --- client/mysqldump.c | 18 +++---- client/mysqltest.c | 3 +- myisam/mi_check.c | 9 ++-- mysql-test/r/grant.result | 50 ++++++++++---------- mysql-test/r/mix_innodb_myisam_binlog.result | 2 +- mysql-test/r/ps_1general.result | 42 ++++++++-------- mysql-test/r/timezone3.result | 4 +- mysql-test/t/ps_1general.test | 35 +++++++++----- sql-common/my_time.c | 23 +++++++-- sql/sql_acl.cc | 7 ++- 10 files changed, 112 insertions(+), 81 deletions(-) diff --git a/client/mysqldump.c b/client/mysqldump.c index a501370f306..83967d62813 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -255,6 +255,14 @@ static struct my_option my_long_options[] = "Option automatically turns --lock-tables off.", (gptr*) &opt_master_data, (gptr*) &opt_master_data, 0, GET_UINT, REQUIRED_ARG, 0, 0, MYSQL_OPT_MASTER_DATA_COMMENTED_SQL, 0, 0, 0}, + {"max_allowed_packet", OPT_MAX_ALLOWED_PACKET, "", + (gptr*) &opt_max_allowed_packet, (gptr*) &opt_max_allowed_packet, 0, + GET_ULONG, REQUIRED_ARG, 24*1024*1024, 4096, + (longlong) 2L*1024L*1024L*1024L, MALLOC_OVERHEAD, 1024, 0}, + {"net_buffer_length", OPT_NET_BUFFER_LENGTH, "", + (gptr*) &opt_net_buffer_length, (gptr*) &opt_net_buffer_length, 0, + GET_ULONG, REQUIRED_ARG, 1024*1024L-1025, 4096, 16*1024L*1024L, + MALLOC_OVERHEAD-1024, 1024, 0}, {"no-autocommit", OPT_AUTOCOMMIT, "Wrap tables with autocommit/commit statements.", (gptr*) &opt_autocommit, (gptr*) &opt_autocommit, 0, GET_BOOL, NO_ARG, @@ -343,14 +351,7 @@ static struct my_option my_long_options[] = (gptr*) &where, (gptr*) &where, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"xml", 'X', "Dump a database as well formed XML.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"max_allowed_packet", OPT_MAX_ALLOWED_PACKET, "", - (gptr*) &opt_max_allowed_packet, (gptr*) &opt_max_allowed_packet, 0, - GET_ULONG, REQUIRED_ARG, 24*1024*1024, 4096, - (longlong) 2L*1024L*1024L*1024L, MALLOC_OVERHEAD, 1024, 0}, - {"net_buffer_length", OPT_NET_BUFFER_LENGTH, "", - (gptr*) &opt_net_buffer_length, (gptr*) &opt_net_buffer_length, 0, - GET_ULONG, REQUIRED_ARG, 1024*1024L-1025, 4096, 16*1024L*1024L, - MALLOC_OVERHEAD-1024, 1024, 0} + { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} }; static const char *load_default_groups[]= { "mysqldump","client",0 }; @@ -1679,7 +1680,6 @@ static void dumpTable(uint numFields, char *table) else if (opt_hex_blob && is_blob) { /* sakaik got the idea to to provide blob's in hex notation. */ - ulong counter; unsigned char *ptr= row[i], *end= ptr+ lengths[i]; fputs("0x", md_result_file); for (; ptr < end ; ptr++) diff --git a/client/mysqltest.c b/client/mysqltest.c index a207da21af5..dfaf48dd60e 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -3351,7 +3351,8 @@ static void init_var_hash(MYSQL *mysql) my_hash_insert(&var_hash, (byte*) v); v= var_init(0,"SERVER_VERSION", 0, mysql_get_server_info(mysql), 0); my_hash_insert(&var_hash, (byte*) v); - + v= var_init(0,"DB", 2, db, 0); + my_hash_insert(&var_hash, (byte*) v); DBUG_VOID_RETURN; } diff --git a/myisam/mi_check.c b/myisam/mi_check.c index bf684270c0a..2999482549c 100644 --- a/myisam/mi_check.c +++ b/myisam/mi_check.c @@ -658,10 +658,11 @@ static int chk_index(MI_CHECK *param, MI_INFO *info, MI_KEYDEF *keyinfo, goto err; if (tmp_keys + subkeys) { - mi_check_print_error(param,"Number of words in the 2nd level tree " - "does not match the number in the header. " - "Parent word in on the page %s, offset %d", - llstr(page,llbuff), old_keypos-buff); + mi_check_print_error(param, + "Number of words in the 2nd level tree " + "does not match the number in the header. " + "Parent word in on the page %s, offset %u", + llstr(page,llbuff), (uint) (old_keypos-buff)); goto err; } (*keys)+=tmp_keys-1; diff --git a/mysql-test/r/grant.result b/mysql-test/r/grant.result index df3669e5927..f903e35fa1f 100644 --- a/mysql-test/r/grant.result +++ b/mysql-test/r/grant.result @@ -134,6 +134,31 @@ ERROR HY000: Incorrect usage of DB GRANT and GLOBAL PRIVILEGES select 1; 1 1 +insert into mysql.user (host, user) values ('localhost', 'test11'); +insert into mysql.db (host, db, user, select_priv) values +('localhost', 'a%', 'test11', 'Y'), ('localhost', 'ab%', 'test11', 'Y'); +alter table mysql.db order by db asc; +flush privileges; +show grants for test11@localhost; +Grants for test11@localhost +GRANT USAGE ON *.* TO 'test11'@'localhost' +GRANT SELECT ON `ab%`.* TO 'test11'@'localhost' +GRANT SELECT ON `a%`.* TO 'test11'@'localhost' +alter table mysql.db order by db desc; +flush privileges; +show grants for test11@localhost; +Grants for test11@localhost +GRANT USAGE ON *.* TO 'test11'@'localhost' +GRANT SELECT ON `ab%`.* TO 'test11'@'localhost' +GRANT SELECT ON `a%`.* TO 'test11'@'localhost' +delete from mysql.user where user='test11'; +delete from mysql.db where user='test11'; +create database mysqltest1; +grant usage on mysqltest1.* to test6123 identified by 'magic123'; +select host,db,user,select_priv,insert_priv from mysql.db where db="mysqltest1"; +host db user select_priv insert_priv +delete from mysql.user where user='test6123'; +drop database mysqltest1; create table t1 (a int); grant ALL PRIVILEGES on *.* to drop_user2@localhost with GRANT OPTION; show grants for drop_user2@localhost; @@ -229,31 +254,6 @@ GRANT SELECT ( REVOKE SELECT (ËÏÌ) ON ÂÄ.ÔÁÂ FROM ÀÚÅÒ@localhost; DROP DATABASE ÂÄ; SET NAMES latin1; -insert into mysql.user (host, user) values ('localhost', 'test11'); -insert into mysql.db (host, db, user, select_priv) values -('localhost', 'a%', 'test11', 'Y'), ('localhost', 'ab%', 'test11', 'Y'); -alter table mysql.db order by db asc; -flush privileges; -show grants for test11@localhost; -Grants for test11@localhost -GRANT USAGE ON *.* TO 'test11'@'localhost' -GRANT SELECT ON `ab%`.* TO 'test11'@'localhost' -GRANT SELECT ON `a%`.* TO 'test11'@'localhost' -alter table mysql.db order by db desc; -flush privileges; -show grants for test11@localhost; -Grants for test11@localhost -GRANT USAGE ON *.* TO 'test11'@'localhost' -GRANT SELECT ON `ab%`.* TO 'test11'@'localhost' -GRANT SELECT ON `a%`.* TO 'test11'@'localhost' -delete from mysql.user where user='test11'; -delete from mysql.db where user='test11'; -create database db6123; -grant usage on db6123.* to test6123 identified by 'magic123'; -select host,db,user,select_priv,insert_priv from mysql.db where db="db6123"; -host db user select_priv insert_priv -delete from mysql.user where user='test6123'; -drop database db6123; USE test; CREATE TABLE t1 (a int ); CREATE TABLE t2 LIKE t1; diff --git a/mysql-test/r/mix_innodb_myisam_binlog.result b/mysql-test/r/mix_innodb_myisam_binlog.result index a2717c68a4f..72288d1027b 100644 --- a/mysql-test/r/mix_innodb_myisam_binlog.result +++ b/mysql-test/r/mix_innodb_myisam_binlog.result @@ -194,7 +194,7 @@ select (@before:=unix_timestamp())*0; begin; select * from t1 for update; insert into t2 values (20); -Lock wait timeout exceeded; Try restarting transaction +ERROR HY000: Lock wait timeout exceeded; try restarting transaction select (@after:=unix_timestamp())*0; (@after:=unix_timestamp())*0 0 diff --git a/mysql-test/r/ps_1general.result b/mysql-test/r/ps_1general.result index ccf2945d488..5f8cb2597c6 100644 --- a/mysql-test/r/ps_1general.result +++ b/mysql-test/r/ps_1general.result @@ -1,4 +1,5 @@ -use test; +drop table if exists t5, t6, t7, t8; +drop database if exists mysqltest ; test_sequence ------ basic tests ------ drop table if exists t1, t9 ; @@ -558,7 +559,6 @@ execute stmt3; ERROR 42S01: Table 'new_t2' already exists rename table new_t2 to t2; drop table t2; -drop table if exists t5, t6, t7, t8 ; prepare stmt1 from ' rename table t5 to t6, t7 to t8 ' ; create table t5 (a int) ; execute stmt1 ; @@ -810,21 +810,24 @@ test_sequence ------ grant/revoke/drop affects a parallel session test ------ show grants for second_user@localhost ; ERROR 42000: There is no such grant defined for user 'second_user' on host 'localhost' -grant usage on test.* to second_user@localhost +create database mysqltest; +use mysqltest; +use test; +grant usage on mysqltest.* to second_user@localhost identified by 'looser' ; -grant select on test.t9 to second_user@localhost +grant select on mysqltest.t9 to second_user@localhost identified by 'looser' ; show grants for second_user@localhost ; Grants for second_user@localhost GRANT USAGE ON *.* TO 'second_user'@'localhost' IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3' -GRANT SELECT ON `test`.`t9` TO 'second_user'@'localhost' +GRANT SELECT ON `mysqltest`.`t9` TO 'second_user'@'localhost' select current_user(); current_user() second_user@localhost show grants for current_user(); Grants for second_user@localhost GRANT USAGE ON *.* TO 'second_user'@'localhost' IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3' -GRANT SELECT ON `test`.`t9` TO 'second_user'@'localhost' +GRANT SELECT ON `mysqltest`.`t9` TO 'second_user'@'localhost' prepare s_t9 from 'select c1 as my_col from t9 where c1= 1' ; execute s_t9 ; @@ -832,24 +835,24 @@ my_col 1 select a as my_col from t1; ERROR 42000: select command denied to user 'second_user'@'localhost' for table 't1' -grant select on test.t1 to second_user@localhost +grant select on mysqltest.t1 to second_user@localhost identified by 'looser' ; show grants for second_user@localhost ; Grants for second_user@localhost GRANT USAGE ON *.* TO 'second_user'@'localhost' IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3' -GRANT SELECT ON `test`.`t1` TO 'second_user'@'localhost' -GRANT SELECT ON `test`.`t9` TO 'second_user'@'localhost' -drop table t9 ; +GRANT SELECT ON `mysqltest`.`t9` TO 'second_user'@'localhost' +GRANT SELECT ON `mysqltest`.`t1` TO 'second_user'@'localhost' +drop table mysqltest.t9 ; show grants for second_user@localhost ; Grants for second_user@localhost GRANT USAGE ON *.* TO 'second_user'@'localhost' IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3' -GRANT SELECT ON `test`.`t1` TO 'second_user'@'localhost' -GRANT SELECT ON `test`.`t9` TO 'second_user'@'localhost' +GRANT SELECT ON `mysqltest`.`t9` TO 'second_user'@'localhost' +GRANT SELECT ON `mysqltest`.`t1` TO 'second_user'@'localhost' show grants for second_user@localhost ; Grants for second_user@localhost GRANT USAGE ON *.* TO 'second_user'@'localhost' IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3' -GRANT SELECT ON `test`.`t1` TO 'second_user'@'localhost' -GRANT SELECT ON `test`.`t9` TO 'second_user'@'localhost' +GRANT SELECT ON `mysqltest`.`t9` TO 'second_user'@'localhost' +GRANT SELECT ON `mysqltest`.`t1` TO 'second_user'@'localhost' prepare s_t1 from 'select a as my_col from t1' ; execute s_t1 ; my_col @@ -858,17 +861,17 @@ my_col 3 4 execute s_t9 ; -ERROR 42S02: Table 'test.t9' doesn't exist -revoke all privileges on test.t1 from second_user@localhost +ERROR 42S02: Table 'mysqltest.t9' doesn't exist +revoke all privileges on mysqltest.t1 from second_user@localhost identified by 'looser' ; show grants for second_user@localhost ; Grants for second_user@localhost GRANT USAGE ON *.* TO 'second_user'@'localhost' IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3' -GRANT SELECT ON `test`.`t9` TO 'second_user'@'localhost' +GRANT SELECT ON `mysqltest`.`t9` TO 'second_user'@'localhost' show grants for second_user@localhost ; Grants for second_user@localhost GRANT USAGE ON *.* TO 'second_user'@'localhost' IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3' -GRANT SELECT ON `test`.`t9` TO 'second_user'@'localhost' +GRANT SELECT ON `mysqltest`.`t9` TO 'second_user'@'localhost' execute s_t1 ; ERROR 42000: select command denied to user 'second_user'@'localhost' for table 't1' revoke all privileges, grant option from second_user@localhost ; @@ -879,4 +882,5 @@ drop user second_user@localhost ; commit ; show grants for second_user@localhost ; ERROR 42000: There is no such grant defined for user 'second_user' on host 'localhost' -drop table t1 ; +drop table t1,t9 ; +drop database mysqltest; diff --git a/mysql-test/r/timezone3.result b/mysql-test/r/timezone3.result index 2135dd33511..ec0b6045f93 100644 --- a/mysql-test/r/timezone3.result +++ b/mysql-test/r/timezone3.result @@ -36,6 +36,6 @@ create table t1 (ts timestamp); insert into t1 values (19730101235900), (20040101235900); select * from t1; ts -19730101235900 -20040101235900 +1973-01-01 23:59:00 +2004-01-01 23:59:00 drop table t1; diff --git a/mysql-test/t/ps_1general.test b/mysql-test/t/ps_1general.test index 9e4acc2bf24..baa37dbf41d 100644 --- a/mysql-test/t/ps_1general.test +++ b/mysql-test/t/ps_1general.test @@ -8,7 +8,11 @@ # NOTE: PLEASE SEE THE DETAILED DESCRIPTION AT THE BOTTOM OF THIS FILE # BEFORE ADDING NEW TEST CASES HERE !!! -use test; +--disable_warnings +drop table if exists t5, t6, t7, t8; +drop database if exists mysqltest ; +--enable_warnings + --disable_query_log select '------ basic tests ------' as test_sequence ; --enable_query_log @@ -590,12 +594,9 @@ rename table new_t2 to t2; drop table t2; ## RENAME more than on TABLE within one statement # cases derived from client_test.c: test_rename() ---disable_warnings -drop table if exists t5, t6, t7, t8 ; ---enable_warnings prepare stmt1 from ' rename table t5 to t6, t7 to t8 ' ; create table t5 (a int) ; -# rename must fail, tc does not exist +# rename must fail, t7 does not exist --error 1017 execute stmt1 ; create table t7 (a int) ; @@ -864,15 +865,23 @@ select '------ grant/revoke/drop affects a parallel session test ------' --error 1141 show grants for second_user@localhost ; ## create a new user account by using GRANT statements on t9 -grant usage on test.* to second_user@localhost +create database mysqltest; +# create the tables (t1 and t9) used in many tests +use mysqltest; +--disable_query_log +--source include/ps_create.inc +--source include/ps_renew.inc +--enable_query_log +eval use $DB; +grant usage on mysqltest.* to second_user@localhost identified by 'looser' ; -grant select on test.t9 to second_user@localhost +grant select on mysqltest.t9 to second_user@localhost identified by 'looser' ; show grants for second_user@localhost ; #### establish a second session to the new user account -connect (con3,localhost,second_user,looser,test); +connect (con3,localhost,second_user,looser,mysqltest); ## switch to the second session connection con3; # Who am I ? @@ -890,10 +899,10 @@ select a as my_col from t1; #### give access rights to t1 and drop table t9 ## switch back to the first session connection default; -grant select on test.t1 to second_user@localhost +grant select on mysqltest.t1 to second_user@localhost identified by 'looser' ; show grants for second_user@localhost ; -drop table t9 ; +drop table mysqltest.t9 ; show grants for second_user@localhost ; @@ -912,7 +921,7 @@ execute s_t9 ; #### revoke the access rights to t1 ## switch back to the first session connection default; -revoke all privileges on test.t1 from second_user@localhost +revoke all privileges on mysqltest.t1 from second_user@localhost identified by 'looser' ; show grants for second_user@localhost ; @@ -937,8 +946,8 @@ commit ; --error 1141 show grants for second_user@localhost ; - -drop table t1 ; +drop table t1,t9 ; +drop database mysqltest; ##### RULES OF THUMB TO PRESERVE THE SYSTEMATICS OF THE PS TEST CASES ##### diff --git a/sql-common/my_time.c b/sql-common/my_time.c index 6c020466e1e..d1a36a75a5a 100644 --- a/sql-common/my_time.c +++ b/sql-common/my_time.c @@ -664,6 +664,10 @@ my_system_gmt_sec(const MYSQL_TIME *t, long *my_timezone, bool *in_dst_time_gap) I couldn't come up with a better way to get a repeatable result :( We can't use mktime() as it's buggy on many platforms and not thread safe. + + Note: this code assumes that our time_t estimation is not too far away + from real value (we assume that localtime_r(tmp) will return something + within 24 hrs from t) which is probably true for all current time zones. */ tmp=(time_t) (((calc_daynr((uint) t->year,(uint) t->month,(uint) t->day) - (long) days_at_timestart)*86400L + (long) t->hour*3600L + @@ -676,7 +680,8 @@ my_system_gmt_sec(const MYSQL_TIME *t, long *my_timezone, bool *in_dst_time_gap) for (loop=0; loop < 2 && (t->hour != (uint) l_time->tm_hour || - t->minute != (uint) l_time->tm_min); + t->minute != (uint) l_time->tm_min || + t->second != (uint) l_time->tm_sec); loop++) { /* One check should be enough ? */ /* Get difference in days */ @@ -686,15 +691,22 @@ my_system_gmt_sec(const MYSQL_TIME *t, long *my_timezone, bool *in_dst_time_gap) else if (days > 1) days= -1; diff=(3600L*(long) (days*24+((int) t->hour - (int) l_time->tm_hour)) + - (long) (60*((int) t->minute - (int) l_time->tm_min))); + (long) (60*((int) t->minute - (int) l_time->tm_min)) + + (long) ((int) t->second - (int) l_time->tm_sec)); current_timezone+= diff+3600; /* Compensate for -3600 above */ tmp+= (time_t) diff; localtime_r(&tmp,&tm_tmp); l_time=&tm_tmp; } /* - Fix that if we are in the not existing daylight saving time hour - we move the start of the next real hour + Fix that if we are in the non existing daylight saving time hour + we move the start of the next real hour. + + This code doesn't handle such exotical thing as time-gaps whose length + is more than one hour or non-integer (latter can theoretically happen + if one of seconds will be removed due leap correction, or because of + general time correction like it happened for Africa/Monrovia time zone + in year 1972). */ if (loop == 2 && t->hour != (uint) l_time->tm_hour) { @@ -704,7 +716,8 @@ my_system_gmt_sec(const MYSQL_TIME *t, long *my_timezone, bool *in_dst_time_gap) else if (days > 1) days= -1; diff=(3600L*(long) (days*24+((int) t->hour - (int) l_time->tm_hour))+ - (long) (60*((int) t->minute - (int) l_time->tm_min))); + (long) (60*((int) t->minute - (int) l_time->tm_min)) + + (long) ((int) t->second - (int) l_time->tm_sec)); if (diff == 3600) tmp+=3600 - t->minute*60 - t->second; /* Move to next hour */ else if (diff == -3600) diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 9067d01a06d..98af43e17a7 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -970,6 +970,7 @@ ulong acl_get(const char *host, const char *ip, db_access=0; host_access= ~0; char key[ACL_KEY_LENGTH],*tmp_db,*end; acl_entry *entry; + DBUG_ENTER("acl_get"); VOID(pthread_mutex_lock(&acl_cache->lock)); end=strmov((tmp_db=strmov(strmov(key, ip ? ip : "")+1,user)+1),db); @@ -983,7 +984,8 @@ ulong acl_get(const char *host, const char *ip, { db_access=entry->access; VOID(pthread_mutex_unlock(&acl_cache->lock)); - return db_access; + DBUG_PRINT("exit", ("access: 0x%lx", db_access)); + DBUG_RETURN(db_access); } /* @@ -1035,7 +1037,8 @@ exit: acl_cache->add(entry); } VOID(pthread_mutex_unlock(&acl_cache->lock)); - return (db_access & host_access); + DBUG_PRINT("exit", ("access: 0x%lx", db_access & host_access)); + DBUG_RETURN(db_access & host_access); } /* From a046b88e1e1f9d7e030c870e221646b7ffc9987f Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 12 Nov 2004 18:30:30 +0200 Subject: [PATCH 0204/1063] Added possibility to run only certain tests by giving the test name(s) as argument(s) after options. Added option -T to display all current test names. --- tests/client_test.c | 405 ++++++++++++++++++++++++-------------------- 1 file changed, 217 insertions(+), 188 deletions(-) diff --git a/tests/client_test.c b/tests/client_test.c index 3c5598ee75a..aa9e62fa588 100644 --- a/tests/client_test.c +++ b/tests/client_test.c @@ -27,7 +27,7 @@ #include #include -#define VER "2.0" +#define VER "2.1" #define MAX_TEST_QUERY_LENGTH 300 /* MAX QUERY BUFFER LENGTH */ /* set default options */ @@ -52,6 +52,12 @@ static double total_time; const char *default_dbug_option= "d:t:o,/tmp/client_test.trace"; +struct my_tests_st +{ + const char *name; + void (*function)(); +}; + #define myheader(str) \ if (opt_silent < 2) \ { \ @@ -11239,31 +11245,35 @@ static char **defaults_argv; static struct my_option client_test_long_options[] = { - {"help", '?', "Display this help and exit", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, - 0, 0, 0, 0, 0}, + {"count", 't', "Number of times test to be executed", (char **) &opt_count, + (char **) &opt_count, 0, GET_UINT, REQUIRED_ARG, 1, 0, 0, 0, 0, 0}, {"database", 'D', "Database to use", (char **) &opt_db, (char **) &opt_db, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"debug", '#', "Output debug log", (gptr*) &default_dbug_option, (gptr*) &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, - {"host", 'h', "Connect to host", (char **) &opt_host, (char **) &opt_host, 0, GET_STR_ALLOC, - REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"help", '?', "Display this help and exit", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, + 0, 0, 0, 0, 0}, + {"host", 'h', "Connect to host", (char **) &opt_host, (char **) &opt_host, + 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"password", 'p', "Password to use when connecting to server. If password is not given it's asked from the tty.", 0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, + {"port", 'P', "Port number to use for connection", (char **) &opt_port, + (char **) &opt_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"show-tests", 'T', "Show all tests' names", 0, 0, 0, GET_NO_ARG, NO_ARG, + 0, 0, 0, 0, 0, 0}, + {"silent", 's', "Be more silent", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, + 0}, + {"socket", 'S', "Socket file to use for connection", + (char **) &opt_unix_socket, (char **) &opt_unix_socket, 0, GET_STR, + REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"testcase", 'c', + "May disable some code when runs as mysql-test-run testcase.", + 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, #ifndef DONT_ALLOW_USER_CHANGE {"user", 'u', "User for login if not current user", (char **) &opt_user, (char **) &opt_user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, #endif - {"port", 'P', "Port number to use for connection", (char **) &opt_port, - (char **) &opt_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"silent", 's', "Be more silent", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, - 0}, - {"socket", 'S', "Socket file to use for connection", (char **) &opt_unix_socket, - (char **) &opt_unix_socket, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"testcase", 'c', "May disable some code when runs as mysql-test-run testcase.", - 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"count", 't', "Number of times test to be executed", (char **) &opt_count, - (char **) &opt_count, 0, GET_UINT, REQUIRED_ARG, 1, 0, 0, 0, 0, 0}, { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} }; @@ -11279,13 +11289,160 @@ static void usage(void) Copyright (C) 2002-2004 MySQL AB\n\ This software comes with ABSOLUTELY NO WARRANTY. This is free software,\n\ and you are welcome to modify and redistribute it under the GPL license\n"); - printf("Usage: %s [OPTIONS]\n", my_progname); + printf("Usage: %s [OPTIONS] [TESTNAME1 TESTNAME2...]\n", my_progname); my_print_help(client_test_long_options); print_defaults("my", client_test_load_default_groups); my_print_variables(client_test_long_options); } +static struct my_tests_st my_tests[]= { + { "client_query", client_query }, +#if NOT_YET_WORKING + { "test_drop_temp", test_drop_temp }, +#endif + { "test_fetch_seek", test_fetch_seek }, + { "test_fetch_nobuffs", test_fetch_nobuffs }, + { "test_open_direct", test_open_direct }, + { "test_fetch_null", test_fetch_null }, + { "test_ps_null_param", test_ps_null_param }, + { "test_fetch_date", test_fetch_date }, + { "test_fetch_str", test_fetch_str }, + { "test_fetch_long", test_fetch_long }, + { "test_fetch_short", test_fetch_short }, + { "test_fetch_tiny", test_fetch_tiny }, + { "test_fetch_bigint", test_fetch_bigint }, + { "test_fetch_float", test_fetch_float }, + { "test_fetch_double", test_fetch_double }, + { "test_bind_result_ext", test_bind_result_ext }, + { "test_bind_result_ext1", test_bind_result_ext1 }, + { "test_select_direct", test_select_direct }, + { "test_select_prepare", test_select_prepare }, + { "test_select", test_select }, + { "test_select_version", test_select_version }, + { "test_ps_conj_select", test_ps_conj_select }, + { "test_select_show_table", test_select_show_table }, + { "test_func_fields", test_func_fields }, + { "test_long_data", test_long_data }, + { "test_insert", test_insert }, + { "test_set_variable", test_set_variable }, + { "test_select_show", test_select_show }, + { "test_prepare_noparam", test_prepare_noparam }, + { "test_bind_result", test_bind_result }, + { "test_prepare_simple", test_prepare_simple }, + { "test_prepare", test_prepare }, + { "test_null", test_null }, + { "test_debug_example", test_debug_example }, + { "test_update", test_update }, + { "test_simple_update", test_simple_update }, + { "test_simple_delete", test_simple_delete }, + { "test_double_compare", test_double_compare }, + { "client_store_result", client_store_result }, + { "client_use_result", client_use_result }, + { "test_tran_bdb", test_tran_bdb }, + { "test_tran_innodb", test_tran_innodb }, + { "test_prepare_ext", test_prepare_ext }, + { "test_prepare_syntax", test_prepare_syntax }, + { "test_field_names", test_field_names }, + { "test_field_flags", test_field_flags }, + { "test_long_data_str", test_long_data_str }, + { "test_long_data_str1", test_long_data_str1 }, + { "test_long_data_bin", test_long_data_bin }, + { "test_warnings", test_warnings }, + { "test_errors", test_errors }, + { "test_prepare_resultset", test_prepare_resultset }, + { "test_stmt_close", test_stmt_close }, + { "test_prepare_field_result", test_prepare_field_result }, + { "test_multi_stmt", test_multi_stmt }, + { "test_multi_statements", test_multi_statements }, + { "test_prepare_multi_statements", test_prepare_multi_statements }, + { "test_store_result", test_store_result }, + { "test_store_result1", test_store_result1 }, + { "test_store_result2", test_store_result2 }, + { "test_subselect", test_subselect }, + { "test_date", test_date }, + { "test_date_date", test_date_date }, + { "test_date_time", test_date_time }, + { "test_date_ts", test_date_ts }, + { "test_date_dt", test_date_dt }, + { "test_prepare_alter", test_prepare_alter }, + { "test_manual_sample", test_manual_sample }, + { "test_pure_coverage", test_pure_coverage }, + { "test_buffers", test_buffers }, + { "test_ushort_bug", test_ushort_bug }, + { "test_sshort_bug", test_sshort_bug }, + { "test_stiny_bug", test_stiny_bug }, + { "test_field_misc", test_field_misc }, + { "test_set_option", test_set_option }, +#ifndef EMBEDDED_LIBRARY + { "test_prepare_grant", test_prepare_grant }, +#endif + { "test_frm_bug", test_frm_bug }, + { "test_explain_bug", test_explain_bug }, + { "test_decimal_bug", test_decimal_bug }, + { "test_nstmts", test_nstmts }, + { "test_logs;", test_logs }, + { "test_cuted_rows", test_cuted_rows }, + { "test_fetch_offset", test_fetch_offset }, + { "test_fetch_column", test_fetch_column }, + { "test_mem_overun", test_mem_overun }, + { "test_list_fields", test_list_fields }, + { "test_free_result", test_free_result }, + { "test_free_store_result", test_free_store_result }, + { "test_sqlmode", test_sqlmode }, + { "test_ts", test_ts }, + { "test_bug1115", test_bug1115 }, + { "test_bug1180", test_bug1180 }, + { "test_bug1500", test_bug1500 }, + { "test_bug1644", test_bug1644 }, + { "test_bug1946", test_bug1946 }, + { "test_bug2248", test_bug2248 }, + { "test_parse_error_and_bad_length", test_parse_error_and_bad_length }, + { "test_bug2247", test_bug2247 }, + { "test_subqueries", test_subqueries }, + { "test_bad_union", test_bad_union }, + { "test_distinct", test_distinct }, + { "test_subqueries_ref", test_subqueries_ref }, + { "test_union", test_union }, + { "test_bug3117", test_bug3117 }, + { "test_join", test_join }, + { "test_selecttmp", test_selecttmp }, + { "test_create_drop", test_create_drop }, + { "test_rename", test_rename }, + { "test_do_set", test_do_set }, + { "test_multi", test_multi }, + { "test_insert_select", test_insert_select }, + { "test_bind_nagative", test_bind_nagative }, + { "test_derived", test_derived }, + { "test_xjoin", test_xjoin }, + { "test_bug3035", test_bug3035 }, + { "test_union2", test_union2 }, + { "test_bug1664", test_bug1664 }, + { "test_union_param", test_union_param }, + { "test_order_param", test_order_param }, + { "test_ps_i18n", test_ps_i18n }, + { "test_bug3796", test_bug3796 }, + { "test_bug4026", test_bug4026 }, + { "test_bug4079", test_bug4079 }, + { "test_bug4236", test_bug4236 }, + { "test_bug4030", test_bug4030 }, + { "test_bug5126", test_bug5126 }, + { "test_bug4231", test_bug4231 }, + { "test_bug5399", test_bug5399 }, + { "test_bug5194", test_bug5194 }, + { "test_bug5315", test_bug5315 }, + { "test_bug6049", test_bug6049 }, + { "test_bug6058", test_bug6058 }, + { "test_bug6059", test_bug6059 }, + { "test_bug6046", test_bug6046 }, + { "test_bug6081", test_bug6081 }, + { "test_bug6096", test_bug6096 }, + { "test_bug4172", test_bug4172 }, + { "test_conversion", test_conversion }, + { 0, 0 } +}; + + static my_bool get_one_option(int optid, const struct my_option *opt __attribute__((unused)), char *argument) @@ -11316,6 +11473,16 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), else opt_silent++; break; + case 'T': + { + struct my_tests_st *fptr; + + printf("All possible test names:\n\n"); + for (fptr= my_tests; fptr->name; fptr++) + printf("%s\n", fptr->name); + exit(0); + break; + } case '?': case 'I': /* Info */ usage(); @@ -11362,11 +11529,14 @@ static void print_test_output() main routine ***************************************************************************/ + int main(int argc, char **argv) { + struct my_tests_st *fptr; + DEBUGGER_OFF; MY_INIT(argv[0]); - + load_defaults("my", client_test_load_default_groups, &argc, &argv); defaults_argv= argv; get_options(argc, argv); @@ -11378,180 +11548,39 @@ int main(int argc, char **argv) { /* Start of tests */ test_count= 1; - start_time= time((time_t *)0); - client_query(); /* simple client query test */ -#if NOT_YET_WORKING - /* Used for internal new development debugging */ - test_drop_temp(); /* Test DROP TEMPORARY TABLE Access checks */ -#endif - test_fetch_seek(); /* Test stmt seek() functions */ - test_fetch_nobuffs(); /* to fecth without prior bound buffers */ - test_open_direct(); /* direct execution in the middle of open stmts */ - test_fetch_null(); /* to fetch null data */ - test_ps_null_param(); /* Fetch value of null parameter */ - test_fetch_date(); /* to fetch date, time and timestamp */ - test_fetch_str(); /* to fetch string to all types */ - test_fetch_long(); /* to fetch long to all types */ - test_fetch_short(); /* to fetch short to all types */ - test_fetch_tiny(); /* to fetch tiny to all types */ - test_fetch_bigint(); /* to fetch bigint to all types */ - test_fetch_float(); /* to fetch float to all types */ - test_fetch_double(); /* to fetch double to all types */ - test_bind_result_ext(); /* result bind test - extension */ - test_bind_result_ext1(); /* result bind test - extension */ - test_select_direct(); /* direct select - protocol_simple debug */ - test_select_prepare(); /* prepare select - protocol_prep debug */ - test_select(); /* simple select test */ - test_select_version(); /* select with variables */ - test_ps_conj_select(); /* prepare select with "where a=? or b=?" */ - test_select_show_table();/* simple show prepare */ -#if NOT_USED - /* - Enable this tests from 4.1.1 when mysql_param_result() is - supported - */ - test_select_meta(); /* select param meta information */ - test_update_meta(); /* update param meta information */ - test_insert_meta(); /* insert param meta information */ -#endif - test_func_fields(); /* test for new 4.1 MYSQL_FIELD members */ - test_long_data(); /* test for sending text data in chunks */ - test_insert(); /* simple insert test - prepare */ - test_set_variable(); /* prepare with set variables */ - test_select_show(); /* prepare - show test */ - test_prepare_noparam(); /* prepare without parameters */ - test_bind_result(); /* result bind test */ - test_prepare_simple(); /* simple prepare */ - test_prepare(); /* prepare test */ - test_null(); /* test null data handling */ - test_debug_example(); /* some debugging case */ - test_update(); /* prepare-update test */ - test_simple_update(); /* simple prepare with update */ - test_simple_delete(); /* prepare with delete */ - test_double_compare(); /* float comparision */ - client_store_result(); /* usage of mysql_store_result() */ - client_use_result(); /* usage of mysql_use_result() */ - test_tran_bdb(); /* transaction test on BDB table type */ - test_tran_innodb(); /* transaction test on InnoDB table type */ - test_prepare_ext(); /* test prepare with all types - conversion -- TODO */ - test_prepare_syntax(); /* syntax check for prepares */ - test_field_names(); /* test for field names */ - test_field_flags(); /* test to help .NET provider team */ - test_long_data_str(); /* long data handling */ - test_long_data_str1(); /* yet another long data handling */ - test_long_data_bin(); /* long binary insertion */ - test_warnings(); /* show warnings test */ - test_errors(); /* show errors test */ - test_prepare_resultset();/* prepare meta info test */ - test_stmt_close(); /* mysql_stmt_close() test -- hangs */ - test_prepare_field_result(); /* prepare meta info */ - test_multi_stmt(); /* multi stmt test */ - test_multi_statements();/* test multi statement execution */ - test_prepare_multi_statements(); /* check that multi statements are - disabled in PS */ - test_store_result(); /* test the store_result */ - test_store_result1(); /* test store result without buffers */ - test_store_result2(); /* test store result for misc case */ - test_subselect(); /* test subselect prepare -TODO*/ - test_date(); /* test the MYSQL_TIME conversion */ - test_date_date(); /* test conversion from DATE to all */ - test_date_time(); /* test conversion from TIME to all */ - test_date_ts() ; /* test conversion from TIMESTAMP to all */ - test_date_dt() ; /* test conversion from DATETIME to all */ - test_prepare_alter(); /* change table schema in middle of prepare */ - test_manual_sample(); /* sample in the manual */ - test_pure_coverage(); /* keep pure coverage happy */ - test_buffers(); /* misc buffer handling */ - test_ushort_bug(); /* test a simple conv bug from php */ - test_sshort_bug(); /* test a simple conv bug from php */ - test_stiny_bug(); /* test a simple conv bug from php */ - test_field_misc(); /* check the field info for misc case, bug: #74 */ - test_set_option(); /* test the SET OPTION feature, bug #85 */ - /*TODO HF: here should be NO_EMBEDDED_ACCESS_CHECKS*/ -#ifndef EMBEDDED_LIBRARY - test_prepare_grant(); /* Test the GRANT command, bug #89 */ -#endif - test_frm_bug(); /* test the crash when .frm is invalid, bug #93 */ - test_explain_bug(); /* test for the EXPLAIN, bug #115 */ - test_decimal_bug(); /* test for the decimal bug */ - test_nstmts(); /* test n statements */ - test_logs(); ; /* Test logs */ - test_cuted_rows(); /* Test for WARNINGS from cuted rows */ - test_fetch_offset(); /* Test mysql_stmt_fetch_column with offset */ - test_fetch_column(); /* Test mysql_stmt_fetch_column */ - test_mem_overun(); /* test DBD ovverun bug */ - test_list_fields(); /* test COM_LIST_FIELDS for DEFAULT */ - test_free_result(); /* test mysql_stmt_free_result() */ - test_free_store_result(); /* test to make sure stmt results are cleared - during stmt_free_result() */ - test_sqlmode(); /* test for SQL_MODE */ - test_ts(); /* test for timestamp BR#819 */ - test_bug1115(); /* BUG#1115 */ - test_bug1180(); /* BUG#1180 */ - test_bug1500(); /* BUG#1500 */ - test_bug1644(); /* BUG#1644 */ - test_bug1946(); /* test that placeholders are allowed only in - prepared queries */ - test_bug2248(); /* BUG#2248 */ - test_parse_error_and_bad_length(); /* test if bad length param in - mysql_stmt_prepare() triggers error */ - test_bug2247(); /* test that mysql_stmt_affected_rows() returns - number of rows affected by last prepared - statement execution */ - test_subqueries(); /* repeatable subqueries */ - test_bad_union(); /* correct setup of UNION */ - test_distinct(); /* distinct aggregate functions */ - test_subqueries_ref(); /* outer reference in subqueries converted - Item_field -> Item_ref */ - test_union(); /* test union with prepared statements */ - test_bug3117(); /* BUG#3117: LAST_INSERT_ID() */ - test_join(); /* different kinds of join, BUG#2794 */ - test_selecttmp(); /* temporary table used in select execution */ - test_create_drop(); /* some table manipulation BUG#2811 */ - test_rename(); /* rename test */ - test_do_set(); /* DO & SET commands test BUG#3393 */ - test_multi(); /* test of multi delete & update */ - test_insert_select(); /* test INSERT ... SELECT */ - test_bind_nagative(); /* bind negative to unsigned BUG#3223 */ - test_derived(); /* derived table with parameter BUG#3020 */ - test_xjoin(); /* complex join test */ - test_bug3035(); /* inserts of INT32_MAX/UINT32_MAX */ - test_union2(); /* repeatable execution of union (Bug #3577) */ - test_bug1664(); /* test for bugs in mysql_stmt_send_long_data() - call (Bug #1664) */ - test_union_param(); - test_order_param(); /* ORDER BY with parameters in select list - (Bug #3686 */ - test_ps_i18n(); /* test for i18n support in binary protocol */ - test_bug3796(); /* test for select concat(?, ) */ - test_bug4026(); /* test microseconds precision of time types */ - test_bug4079(); /* erroneous subquery in prepared statement */ - test_bug4236(); /* init -> execute */ - test_bug4030(); /* test conversion string -> time types in - libmysql */ - test_bug5126(); /* support for mediumint type in libmysql */ - test_bug4231(); /* proper handling of all-zero times and - dates in the server */ - test_bug5399(); /* check that statement id uniquely identifies - statement */ - test_bug5194(); /* bulk inserts in prepared mode */ - test_bug5315(); /* check that mysql_change_user closes all - prepared statements */ - test_bug6049(); /* check support for negative TIME values */ - test_bug6058(); /* check support for 0000-00-00 dates */ - test_bug6059(); /* correct metadata for SELECT ... INTO OUTFILE */ - test_bug6046(); /* NATURAL JOIN transformation works in PS */ - test_bug6081(); /* test of mysql_create_db()/mysql_rm_db() */ - test_bug6096(); /* max_length for numeric columns */ - test_bug4172(); /* floating point conversions in libmysql */ + int i, name_ok; + if (!argv[1]) + { + for (fptr= my_tests; fptr->name; fptr++) + (*fptr->function)(); + } + else + { + for (i= 1; argv[i]; i++) + { + name_ok= 0; + for (fptr= my_tests; fptr->name; fptr++) + { + if (!strcmp(fptr->name, argv[i])) + { + name_ok= 1; + (*fptr->function)(); + } + } + if (!name_ok) + { + printf("\n\nGiven test not found: '%s'\n", argv[i]); + printf("See legal test names with %s -T\n\nAborting!\n", + my_progname); + client_disconnect(); + free_defaults(defaults_argv); + exit(1); + } + } + } - test_conversion(); /* placeholder value is not converted to - character set of column if character set - of connection equals to character set of - client */ /* XXX: PLEASE RUN THIS PROGRAM UNDER VALGRIND AND VERIFY THAT YOUR TEST DOESN'T CONTAIN WARNINGS/ERRORS BEFORE YOU PUSH. From 7dad39859f26bac7b042c0b58089102be5c7269e Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 12 Nov 2004 19:01:49 +0200 Subject: [PATCH 0205/1063] Fix to allow usage of 4.0 tables with 4.1 --- sql/field.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/sql/field.cc b/sql/field.cc index f70a23e889a..bbd21247b8e 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -5943,6 +5943,7 @@ Field *make_field(char *ptr, uint32 field_length, if (!f_is_packed(pack_flag)) { if (field_type == FIELD_TYPE_STRING || + field_type == FIELD_TYPE_DECIMAL || // 3.23 or 4.0 string field_type == FIELD_TYPE_VAR_STRING) return new Field_string(ptr,field_length,null_pos,null_bit, unireg_check, field_name, table, From c7b66f9ddefb95050c21a9938578a0f56d9dd0d0 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 12 Nov 2004 19:22:58 +0200 Subject: [PATCH 0206/1063] Removed an unneccessary for() and variable. --- mysys/default.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/mysys/default.c b/mysys/default.c index 16e166a3ca5..364b2037f67 100644 --- a/mysys/default.c +++ b/mysys/default.c @@ -120,7 +120,7 @@ int load_defaults(const char *conf_file, const char **groups, uint args_used=0; int error= 0; MEM_ROOT alloc; - char *ptr, **res, **ext; + char *ptr, **res; DBUG_ENTER("load_defaults"); @@ -176,10 +176,9 @@ int load_defaults(const char *conf_file, const char **groups, } else if (dirname_length(conf_file)) { - for (ext= (char**) f_extensions; *ext; *ext++) - if ((error= search_default_file(&args, &alloc, NullS, conf_file, - &group)) < 0) - goto err; + if ((error= search_default_file(&args, &alloc, NullS, conf_file, + &group)) < 0) + goto err; } else { From d605d887978b185fa8a9f09836978443f9fd02db Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 12 Nov 2004 19:54:25 +0200 Subject: [PATCH 0207/1063] Code cleanup and some optimizations. --- tests/client_test.c | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/tests/client_test.c b/tests/client_test.c index 89034012d5b..2f28da6d00d 100644 --- a/tests/client_test.c +++ b/tests/client_test.c @@ -11494,11 +11494,11 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), return 0; } -static void get_options(int argc, char **argv) +static void get_options(int *argc, char ***argv) { int ho_error; - if ((ho_error= handle_options(&argc, &argv, client_test_long_options, + if ((ho_error= handle_options(argc, argv, client_test_long_options, get_one_option))) exit(ho_error); @@ -11541,7 +11541,7 @@ int main(int argc, char **argv) load_defaults("my", client_test_load_default_groups, &argc, &argv); defaults_argv= argv; - get_options(argc, argv); + get_options(&argc, &argv); client_connect(); /* connect to server */ @@ -11552,30 +11552,28 @@ int main(int argc, char **argv) test_count= 1; start_time= time((time_t *)0); - int i, name_ok; - if (!argv[1]) + if (!argc) { for (fptr= my_tests; fptr->name; fptr++) (*fptr->function)(); } else { - for (i= 1; argv[i]; i++) + for ( ; *argv ; argv++) { - name_ok= 0; for (fptr= my_tests; fptr->name; fptr++) { - if (!strcmp(fptr->name, argv[i])) + if (!strcmp(fptr->name, *argv)) { - name_ok= 1; (*fptr->function)(); + break; } } - if (!name_ok) + if (!fptr->name) { - printf("\n\nGiven test not found: '%s'\n", argv[i]); - printf("See legal test names with %s -T\n\nAborting!\n", - my_progname); + fprintf(stderr, "\n\nGiven test not found: '%s'\n", *argv); + fprintf(stderr, "See legal test names with %s -T\n\nAborting!\n", + my_progname); client_disconnect(); free_defaults(defaults_argv); exit(1); From c77cb0a3210106772e59e78059461a4eb4d69e54 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 12 Nov 2004 20:47:41 +0200 Subject: [PATCH 0208/1063] Fixed a function call. --- sql/item_strfunc.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 3f659964a6c..5a23eec5a1b 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -2593,7 +2593,7 @@ String *Item_func_quote::val_str(String *str) uint arg_length, new_length; if (!arg) // Null argument { - str->copy("NULL", 4); // Return the string 'NULL' + str->copy("NULL", 4, collation.collation); // Return the string 'NULL' null_value= 0; return str; } From 0f3b604dbfe396f52f5f07bfb04ea2aaf32c33a7 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 12 Nov 2004 14:15:06 -0600 Subject: [PATCH 0209/1063] Makefile.am: Add -acc flag for texi2html to handle accented characters. Docs/Makefile.am: Add -acc flag for texi2html to handle accented characters. --- Docs/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Docs/Makefile.am b/Docs/Makefile.am index e53ea195d94..2f32dfca1b4 100644 --- a/Docs/Makefile.am +++ b/Docs/Makefile.am @@ -9,7 +9,7 @@ # If you know how to fix any of this more elegantly please mail # docs@mysql.com -TEXI2HTML_FLAGS = -iso -number +TEXI2HTML_FLAGS = -iso -number -acc DVIPS = dvips MAKEINFO = @MAKEINFO@ TEXINFO_TEX = Support/texinfo.tex From 40e25a305d4a85252edb412057a28d9956414997 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 12 Nov 2004 22:55:00 +0100 Subject: [PATCH 0210/1063] wrong constant fixed - boolean fulltext searches like "+something +smth*" were stopping at docid 0xffffffff --- myisam/ft_boolean_search.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/myisam/ft_boolean_search.c b/myisam/ft_boolean_search.c index 13f46849210..97dfb18e5f9 100644 --- a/myisam/ft_boolean_search.c +++ b/myisam/ft_boolean_search.c @@ -161,7 +161,7 @@ static void _ftb_parse_query(FTB *ftb, byte **start, byte *end, if (param.trunc) ftbw->flags|=FTB_FLAG_TRUNC; ftbw->weight=weight; ftbw->up=up; - ftbw->docid[0]=ftbw->docid[1]=HA_POS_ERROR; + ftbw->docid[0]=ftbw->docid[1]=HA_OFFSET_ERROR; ftbw->ndepth= (param.yesno<0) + depth; memcpy(ftbw->word+1, w.pos, w.len); ftbw->word[0]=w.len; @@ -177,7 +177,7 @@ static void _ftb_parse_query(FTB *ftb, byte **start, byte *end, ftbe->weight=weight; ftbe->up=up; ftbe->ythresh=ftbe->yweaks=0; - ftbe->docid[0]=ftbe->docid[1]=HA_POS_ERROR; + ftbe->docid[0]=ftbe->docid[1]=HA_OFFSET_ERROR; if ((ftbe->quot=param.quot)) ftb->with_scan|=2; if (param.yesno > 0) up->ythresh++; _ftb_parse_query(ftb, start, end, ftbe, depth+1); @@ -245,7 +245,7 @@ static void _ftb_init_index_search(FT_INFO *ftb) ftbe->up->ythresh - ftbe->up->yweaks >1) /* 1 */ { FTB_EXPR *top_ftbe=ftbe->up->up; - ftbw->docid[0]=HA_POS_ERROR; + ftbw->docid[0]=HA_OFFSET_ERROR; for (ftbe=ftbw->up; ftbe != top_ftbe; ftbe=ftbe->up) if (ftbe->flags & FTB_FLAG_YES) ftbe->yweaks++; @@ -319,7 +319,7 @@ FT_INFO * ft_init_boolean_search(MI_INFO *info, uint keynr, byte *query, default_charset_info : info->s->keyinfo[keynr].seg->charset); ftb->with_scan=0; - ftb->lastpos=HA_POS_ERROR; + ftb->lastpos=HA_OFFSET_ERROR; bzero(& ftb->no_dupes, sizeof(TREE)); init_alloc_root(&ftb->mem_root, 1024, 1024); @@ -342,7 +342,7 @@ FT_INFO * ft_init_boolean_search(MI_INFO *info, uint keynr, byte *query, ftbe->quot=0; ftbe->up=0; ftbe->ythresh=ftbe->yweaks=0; - ftbe->docid[0]=ftbe->docid[1]=HA_POS_ERROR; + ftbe->docid[0]=ftbe->docid[1]=HA_OFFSET_ERROR; ftb->root=ftbe; _ftb_parse_query(ftb, &query, query+query_len, ftbe, 0); ftb->list=(FTB_WORD **)alloc_root(&ftb->mem_root, @@ -496,7 +496,7 @@ int ft_boolean_read_next(FT_INFO *ftb, char *record) while (ftb->state == INDEX_SEARCH && (curdoc=((FTB_WORD *)queue_top(& ftb->queue))->docid[0]) != - HA_POS_ERROR) + HA_OFFSET_ERROR) { while (curdoc==(ftbw=(FTB_WORD *)queue_top(& ftb->queue))->docid[0]) { @@ -521,7 +521,7 @@ int ft_boolean_read_next(FT_INFO *ftb, char *record) } if (r) /* not found */ { - ftbw->docid[0]=HA_POS_ERROR; + ftbw->docid[0]=HA_OFFSET_ERROR; if (ftbw->flags&FTB_FLAG_YES && ftbw->up->up==0) { /* @@ -580,7 +580,7 @@ float ft_boolean_find_relevance(FT_INFO *ftb, byte *record, uint length) const byte *end; my_off_t docid=ftb->info->lastpos; - if (docid == HA_POS_ERROR) + if (docid == HA_OFFSET_ERROR) return -2.0; if (!ftb->queue.elements) return 0; @@ -592,9 +592,9 @@ float ft_boolean_find_relevance(FT_INFO *ftb, byte *record, uint length) for (i=0; i < ftb->queue.elements; i++) { - ftb->list[i]->docid[1]=HA_POS_ERROR; + ftb->list[i]->docid[1]=HA_OFFSET_ERROR; for (x=ftb->list[i]->up; x; x=x->up) - x->docid[1]=HA_POS_ERROR; + x->docid[1]=HA_OFFSET_ERROR; } } From 7a7ee30cb5a26f8e0f2edb560be36e6219e6a4a8 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 13 Nov 2004 17:34:34 +0100 Subject: [PATCH 0211/1063] ndb: fix bug-4644 Err Out of fragment operations sql/ha_ndbcluster.cc: compile fix in DBUG code ndb/src/kernel/blocks/dbtux/DbtuxGen.cpp: fix count of metadata pages ndb/include/kernel/signaldata/TupFrag.hpp: bug-4644 fix ndb/src/kernel/blocks/ERROR_codes.txt: bug-4644 fix ndb/src/kernel/blocks/dblqh/Dblqh.hpp: bug-4644 fix ndb/src/kernel/blocks/dblqh/DblqhMain.cpp: bug-4644 fix ndb/src/kernel/blocks/dbtup/Dbtup.hpp: bug-4644 fix ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp: bug-4644 fix ndb/src/kernel/blocks/dbtux/Dbtux.hpp: bug-4644 fix ndb/src/kernel/blocks/dbtux/DbtuxDebug.cpp: bug-4644 fix ndb/src/kernel/blocks/dbtux/DbtuxMeta.cpp: bug-4644 fix ndb/test/ndbapi/testDict.cpp: bug-4644 fix --- ndb/include/kernel/signaldata/TupFrag.hpp | 6 +- ndb/src/kernel/blocks/ERROR_codes.txt | 10 +- ndb/src/kernel/blocks/dblqh/Dblqh.hpp | 2 +- ndb/src/kernel/blocks/dblqh/DblqhMain.cpp | 105 ++++++++++++++++++++- ndb/src/kernel/blocks/dbtup/Dbtup.hpp | 2 + ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp | 54 +++++++++-- ndb/src/kernel/blocks/dbtux/Dbtux.hpp | 2 + ndb/src/kernel/blocks/dbtux/DbtuxDebug.cpp | 13 +++ ndb/src/kernel/blocks/dbtux/DbtuxGen.cpp | 9 +- ndb/src/kernel/blocks/dbtux/DbtuxMeta.cpp | 88 ++++++++++++++--- ndb/test/ndbapi/testDict.cpp | 67 +++++++++++++ sql/ha_ndbcluster.cc | 11 +-- 12 files changed, 328 insertions(+), 41 deletions(-) diff --git a/ndb/include/kernel/signaldata/TupFrag.hpp b/ndb/include/kernel/signaldata/TupFrag.hpp index c1e861c5dff..c132b19c50a 100644 --- a/ndb/include/kernel/signaldata/TupFrag.hpp +++ b/ndb/include/kernel/signaldata/TupFrag.hpp @@ -132,9 +132,10 @@ class TupAddAttrConf { friend class Dblqh; friend class Dbtup; public: - STATIC_CONST( SignalLength = 1 ); + STATIC_CONST( SignalLength = 2 ); private: Uint32 userPtr; + Uint32 lastAttr; // bool: got last attr and closed frag op }; class TupAddAttrRef { @@ -171,9 +172,10 @@ class TuxAddAttrConf { friend class Dblqh; friend class Dbtux; public: - STATIC_CONST( SignalLength = 1 ); + STATIC_CONST( SignalLength = 2 ); private: Uint32 userPtr; + Uint32 lastAttr; // bool: got last attr and closed frag op }; class TuxAddAttrRef { diff --git a/ndb/src/kernel/blocks/ERROR_codes.txt b/ndb/src/kernel/blocks/ERROR_codes.txt index 70f11c33cd7..7ff03684cff 100644 --- a/ndb/src/kernel/blocks/ERROR_codes.txt +++ b/ndb/src/kernel/blocks/ERROR_codes.txt @@ -2,7 +2,7 @@ Next QMGR 1 Next NDBCNTR 1000 Next NDBFS 2000 Next DBACC 3001 -Next DBTUP 4007 +Next DBTUP 4013 Next DBLQH 5042 Next DBDICT 6006 Next DBDIH 7174 @@ -10,7 +10,7 @@ Next DBTC 8035 Next CMVMI 9000 Next BACKUP 10022 Next DBUTIL 11002 -Next DBTUX 12001 +Next DBTUX 12007 Next SUMA 13001 TESTING NODE FAILURE, ARBITRATION @@ -393,6 +393,12 @@ Failed Create Table: -------------------- 7173: Create table failed due to not sufficient number of fragment or replica records. +4007 12001: Fail create 1st fragment +4008 12002: Fail create 2nd fragment +4009 12003: Fail create 1st attribute in 1st fragment +4010 12004: Fail create last attribute in 1st fragment +4011 12005: Fail create 1st attribute in 2nd fragment +4012 12006: Fail create last attribute in 2nd fragment Drop Table/Index: ----------------- diff --git a/ndb/src/kernel/blocks/dblqh/Dblqh.hpp b/ndb/src/kernel/blocks/dblqh/Dblqh.hpp index d6987f3e478..739c3c741fb 100644 --- a/ndb/src/kernel/blocks/dblqh/Dblqh.hpp +++ b/ndb/src/kernel/blocks/dblqh/Dblqh.hpp @@ -2474,7 +2474,7 @@ private: void sendExecFragRefLab(Signal* signal); void fragrefLab(Signal* signal, BlockReference retRef, Uint32 retPtr, Uint32 errorCode); - void accFragRefLab(Signal* signal); + void abortAddFragOps(Signal* signal); void rwConcludedLab(Signal* signal); void sendsttorryLab(Signal* signal); void initialiseRecordsLab(Signal* signal, Uint32 data, Uint32, Uint32); diff --git a/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp b/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp index af1131e5e55..5622706a96c 100644 --- a/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp +++ b/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp @@ -912,6 +912,10 @@ void Dblqh::execREAD_CONFIG_REQ(Signal* signal) /* *********************************************************> */ /* LQHFRAGREQ: Create new fragments for a table. Sender DICT */ /* *********************************************************> */ + +// this unbelievable mess could be replaced by one signal to LQH +// and execute direct to local DICT to get everything at once + void Dblqh::execLQHFRAGREQ(Signal* signal) { jamEntry(); @@ -1049,6 +1053,11 @@ void Dblqh::execLQHFRAGREQ(Signal* signal) addfragptr.p->lh3DistrBits = tlhstar; addfragptr.p->tableType = tableType; addfragptr.p->primaryTableId = primaryTableId; + // + addfragptr.p->tup1Connectptr = RNIL; + addfragptr.p->tup2Connectptr = RNIL; + addfragptr.p->tux1Connectptr = RNIL; + addfragptr.p->tux2Connectptr = RNIL; if (DictTabInfo::isTable(tableType) || DictTabInfo::isHashIndex(tableType)) { @@ -1329,15 +1338,21 @@ void Dblqh::execTUP_ADD_ATTCONF(Signal* signal) { jamEntry(); addfragptr.i = signal->theData[0]; + // implies that operation was released on the other side + const bool lastAttr = signal->theData[1]; ptrCheckGuard(addfragptr, caddfragrecFileSize, addFragRecord); switch (addfragptr.p->addfragStatus) { case AddFragRecord::TUP_ATTR_WAIT1: jam(); + if (lastAttr) + addfragptr.p->tup1Connectptr = RNIL; addfragptr.p->addfragStatus = AddFragRecord::TUP_ATTR_WAIT2; sendAddAttrReq(signal); break; case AddFragRecord::TUP_ATTR_WAIT2: jam(); + if (lastAttr) + addfragptr.p->tup2Connectptr = RNIL; if (DictTabInfo::isOrderedIndex(addfragptr.p->tableType)) { addfragptr.p->addfragStatus = AddFragRecord::TUX_ATTR_WAIT1; sendAddAttrReq(signal); @@ -1347,11 +1362,15 @@ void Dblqh::execTUP_ADD_ATTCONF(Signal* signal) break; case AddFragRecord::TUX_ATTR_WAIT1: jam(); + if (lastAttr) + addfragptr.p->tux1Connectptr = RNIL; addfragptr.p->addfragStatus = AddFragRecord::TUX_ATTR_WAIT2; sendAddAttrReq(signal); break; case AddFragRecord::TUX_ATTR_WAIT2: jam(); + if (lastAttr) + addfragptr.p->tux2Connectptr = RNIL; goto done_with_attr; break; done_with_attr: @@ -1455,6 +1474,7 @@ Dblqh::sendAddAttrReq(Signal* signal) jam(); TupAddAttrConf* tupconf = (TupAddAttrConf*)signal->getDataPtrSend(); tupconf->userPtr = addfragptr.i; + tupconf->lastAttr = false; sendSignal(reference(), GSN_TUP_ADD_ATTCONF, signal, TupAddAttrConf::SignalLength, JBB); return; @@ -1485,6 +1505,7 @@ Dblqh::sendAddAttrReq(Signal* signal) jam(); TuxAddAttrConf* tuxconf = (TuxAddAttrConf*)signal->getDataPtrSend(); tuxconf->userPtr = addfragptr.i; + tuxconf->lastAttr = false; sendSignal(reference(), GSN_TUX_ADD_ATTRCONF, signal, TuxAddAttrConf::SignalLength, JBB); return; @@ -1549,6 +1570,40 @@ void Dblqh::fragrefLab(Signal* signal, return; }//Dblqh::fragrefLab() +/* + * Abort on-going ops. + */ +void Dblqh::abortAddFragOps(Signal* signal) +{ + fragptr.i = addfragptr.p->fragmentPtr; + ptrCheckGuard(fragptr, cfragrecFileSize, fragrecord); + signal->theData[0] = (Uint32)-1; + if (addfragptr.p->tup1Connectptr != RNIL) { + jam(); + signal->theData[1] = addfragptr.p->tup1Connectptr; + sendSignal(fragptr.p->tupBlockref, GSN_TUPFRAGREQ, signal, 2, JBB); + addfragptr.p->tup1Connectptr = RNIL; + } + if (addfragptr.p->tup2Connectptr != RNIL) { + jam(); + signal->theData[1] = addfragptr.p->tup2Connectptr; + sendSignal(fragptr.p->tupBlockref, GSN_TUPFRAGREQ, signal, 2, JBB); + addfragptr.p->tup2Connectptr = RNIL; + } + if (addfragptr.p->tux1Connectptr != RNIL) { + jam(); + signal->theData[1] = addfragptr.p->tux1Connectptr; + sendSignal(fragptr.p->tuxBlockref, GSN_TUXFRAGREQ, signal, 2, JBB); + addfragptr.p->tux1Connectptr = RNIL; + } + if (addfragptr.p->tux2Connectptr != RNIL) { + jam(); + signal->theData[1] = addfragptr.p->tux2Connectptr; + sendSignal(fragptr.p->tuxBlockref, GSN_TUXFRAGREQ, signal, 2, JBB); + addfragptr.p->tux2Connectptr = RNIL; + } +} + /* ************>> */ /* ACCFRAGREF > */ /* ************>> */ @@ -1582,6 +1637,27 @@ void Dblqh::execTUPFRAGREF(Signal* signal) fragptr.i = addfragptr.p->fragmentPtr; ptrCheckGuard(fragptr, cfragrecFileSize, fragrecord); addfragptr.p->addfragErrorCode = terrorCode; + + // no operation to release, just add some jams + switch (addfragptr.p->addfragStatus) { + case AddFragRecord::WAIT_TWO_TUP: + jam(); + break; + case AddFragRecord::WAIT_ONE_TUP: + jam(); + break; + case AddFragRecord::WAIT_TWO_TUX: + jam(); + break; + case AddFragRecord::WAIT_ONE_TUX: + jam(); + break; + default: + ndbrequire(false); + break; + } + abortAddFragOps(signal); + const Uint32 ref = addfragptr.p->dictBlockref; const Uint32 senderData = addfragptr.p->dictConnectptr; const Uint32 errorCode = addfragptr.p->addfragErrorCode; @@ -1605,11 +1681,38 @@ void Dblqh::execTUXFRAGREF(Signal* signal) void Dblqh::execTUP_ADD_ATTRREF(Signal* signal) { jamEntry(); - addfragptr.i = signal->theData[0]; ptrCheckGuard(addfragptr, caddfragrecFileSize, addFragRecord); terrorCode = signal->theData[1]; addfragptr.p->addfragErrorCode = terrorCode; + + // operation was released on the other side + switch (addfragptr.p->addfragStatus) { + case AddFragRecord::TUP_ATTR_WAIT1: + jam(); + ndbrequire(addfragptr.p->tup1Connectptr != RNIL); + addfragptr.p->tup1Connectptr = RNIL; + break; + case AddFragRecord::TUP_ATTR_WAIT2: + jam(); + ndbrequire(addfragptr.p->tup2Connectptr != RNIL); + addfragptr.p->tup2Connectptr = RNIL; + break; + case AddFragRecord::TUX_ATTR_WAIT1: + jam(); + ndbrequire(addfragptr.p->tux1Connectptr != RNIL); + addfragptr.p->tux1Connectptr = RNIL; + break; + case AddFragRecord::TUX_ATTR_WAIT2: + jam(); + ndbrequire(addfragptr.p->tux2Connectptr != RNIL); + addfragptr.p->tux2Connectptr = RNIL; + break; + default: + ndbrequire(false); + break; + } + abortAddFragOps(signal); const Uint32 Ref = addfragptr.p->dictBlockref; const Uint32 senderData = addfragptr.p->dictConnectptr; diff --git a/ndb/src/kernel/blocks/dbtup/Dbtup.hpp b/ndb/src/kernel/blocks/dbtup/Dbtup.hpp index 55ad1d0910a..b48546576f9 100644 --- a/ndb/src/kernel/blocks/dbtup/Dbtup.hpp +++ b/ndb/src/kernel/blocks/dbtup/Dbtup.hpp @@ -504,6 +504,7 @@ struct Fragoperrec { Uint32 noOfNewAttrCount; Uint32 charsetIndex; BlockReference lqhBlockrefFrag; + bool inUse; }; typedef Ptr FragoperrecPtr; @@ -1936,6 +1937,7 @@ private: void setUpKeyArray(Tablerec* const regTabPtr); bool addfragtotab(Tablerec* const regTabPtr, Uint32 fragId, Uint32 fragIndex); void deleteFragTab(Tablerec* const regTabPtr, Uint32 fragId); + void abortAddFragOp(Signal* signal); void releaseTabDescr(Tablerec* const regTabPtr); void getFragmentrec(FragrecordPtr& regFragPtr, Uint32 fragId, Tablerec* const regTabPtr); diff --git a/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp b/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp index efea312b865..914dba00674 100644 --- a/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp +++ b/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp @@ -39,11 +39,18 @@ /* ---------------------------------------------------------------- */ void Dbtup::execTUPFRAGREQ(Signal* signal) { + ljamEntry(); + + if (signal->theData[0] == (Uint32)-1) { + ljam(); + abortAddFragOp(signal); + return; + } + FragoperrecPtr fragOperPtr; FragrecordPtr regFragPtr; TablerecPtr regTabPtr; - ljamEntry(); Uint32 userptr = signal->theData[0]; Uint32 userblockref = signal->theData[1]; Uint32 reqinfo = signal->theData[2]; @@ -132,6 +139,15 @@ void Dbtup::execTUPFRAGREQ(Signal* signal) return; }//if + if (ERROR_INSERTED(4007) && regTabPtr.p->fragid[0] == fragId || + ERROR_INSERTED(4008) && regTabPtr.p->fragid[1] == fragId) { + ljam(); + terrorCode = 1; + fragrefuse4Lab(signal, fragOperPtr, regFragPtr, regTabPtr.p, fragId); + CLEAR_ERROR_INSERT_VALUE; + return; + } + if (regTabPtr.p->tableStatus == NOT_DEFINED) { ljam(); //------------------------------------------------------------------------------------- @@ -243,6 +259,7 @@ void Dbtup::seizeFragoperrec(FragoperrecPtr& fragOperPtr) ptrCheckGuard(fragOperPtr, cnoOfFragoprec, fragoperrec); cfirstfreeFragopr = fragOperPtr.p->nextFragoprec; fragOperPtr.p->nextFragoprec = RNIL; + fragOperPtr.p->inUse = true; }//Dbtup::seizeFragoperrec() /* **************************************************************** */ @@ -273,6 +290,7 @@ void Dbtup::execTUP_ADD_ATTRREQ(Signal* signal) ndbrequire(fragOperPtr.p->attributeCount > 0); fragOperPtr.p->attributeCount--; + const bool lastAttr = (fragOperPtr.p->attributeCount == 0); if ((regTabPtr.p->tableStatus == DEFINING) && (fragOperPtr.p->definingFragment)) { @@ -346,20 +364,30 @@ void Dbtup::execTUP_ADD_ATTRREQ(Signal* signal) addattrrefuseLab(signal, regFragPtr, fragOperPtr, regTabPtr.p, fragId); return; }//if - if ((fragOperPtr.p->attributeCount == 0) && - (fragOperPtr.p->freeNullBit != 0)) { + if (lastAttr && (fragOperPtr.p->freeNullBit != 0)) { ljam(); terrorCode = ZINCONSISTENT_NULL_ATTRIBUTE_COUNT; addattrrefuseLab(signal, regFragPtr, fragOperPtr, regTabPtr.p, fragId); return; }//if }//if + if (ERROR_INSERTED(4009) && regTabPtr.p->fragid[0] == fragId && attrId == 0 || + ERROR_INSERTED(4010) && regTabPtr.p->fragid[0] == fragId && lastAttr || + ERROR_INSERTED(4011) && regTabPtr.p->fragid[1] == fragId && attrId == 0 || + ERROR_INSERTED(4012) && regTabPtr.p->fragid[1] == fragId && lastAttr) { + ljam(); + terrorCode = 1; + addattrrefuseLab(signal, regFragPtr, fragOperPtr, regTabPtr.p, fragId); + CLEAR_ERROR_INSERT_VALUE; + return; + } /* **************************************************************** */ /* ************** TUP_ADD_ATTCONF ****************** */ /* **************************************************************** */ signal->theData[0] = fragOperPtr.p->lqhPtrFrag; - sendSignal(fragOperPtr.p->lqhBlockrefFrag, GSN_TUP_ADD_ATTCONF, signal, 1, JBB); - if (fragOperPtr.p->attributeCount > 0) { + signal->theData[1] = lastAttr; + sendSignal(fragOperPtr.p->lqhBlockrefFrag, GSN_TUP_ADD_ATTCONF, signal, 2, JBB); + if (! lastAttr) { ljam(); return; /* EXIT AND WAIT FOR MORE */ }//if @@ -491,11 +519,11 @@ void Dbtup::fragrefuseLab(Signal* signal, FragoperrecPtr fragOperPtr) void Dbtup::releaseFragoperrec(FragoperrecPtr fragOperPtr) { + fragOperPtr.p->inUse = false; fragOperPtr.p->nextFragoprec = cfirstfreeFragopr; cfirstfreeFragopr = fragOperPtr.i; }//Dbtup::releaseFragoperrec() - void Dbtup::deleteFragTab(Tablerec* const regTabPtr, Uint32 fragId) { for (Uint32 i = 0; i < (2 * MAX_FRAG_PER_NODE); i++) { @@ -510,6 +538,20 @@ void Dbtup::deleteFragTab(Tablerec* const regTabPtr, Uint32 fragId) ndbrequire(false); }//Dbtup::deleteFragTab() +/* + * LQH aborts on-going create table operation. The table is later + * dropped by DICT. + */ +void Dbtup::abortAddFragOp(Signal* signal) +{ + FragoperrecPtr fragOperPtr; + + fragOperPtr.i = signal->theData[1]; + ptrCheckGuard(fragOperPtr, cnoOfFragoprec, fragoperrec); + ndbrequire(fragOperPtr.p->inUse); + releaseFragoperrec(fragOperPtr); +} + void Dbtup::execDROP_TAB_REQ(Signal* signal) { diff --git a/ndb/src/kernel/blocks/dbtux/Dbtux.hpp b/ndb/src/kernel/blocks/dbtux/Dbtux.hpp index 8896324f793..8f49b7fa6d6 100644 --- a/ndb/src/kernel/blocks/dbtux/Dbtux.hpp +++ b/ndb/src/kernel/blocks/dbtux/Dbtux.hpp @@ -575,6 +575,7 @@ private: void execDROP_TAB_REQ(Signal* signal); bool allocDescEnt(IndexPtr indexPtr); void freeDescEnt(IndexPtr indexPtr); + void abortAddFragOp(Signal* signal); void dropIndex(Signal* signal, IndexPtr indexPtr, Uint32 senderRef, Uint32 senderData); /* @@ -684,6 +685,7 @@ private: friend class NdbOut& operator<<(NdbOut&, const ScanOp&); friend class NdbOut& operator<<(NdbOut&, const Index&); friend class NdbOut& operator<<(NdbOut&, const Frag&); + friend class NdbOut& operator<<(NdbOut&, const FragOp&); friend class NdbOut& operator<<(NdbOut&, const NodeHandle&); FILE* debugFile; NdbOut debugOut; diff --git a/ndb/src/kernel/blocks/dbtux/DbtuxDebug.cpp b/ndb/src/kernel/blocks/dbtux/DbtuxDebug.cpp index c5c22264460..1e1b0d1d5b6 100644 --- a/ndb/src/kernel/blocks/dbtux/DbtuxDebug.cpp +++ b/ndb/src/kernel/blocks/dbtux/DbtuxDebug.cpp @@ -403,6 +403,19 @@ operator<<(NdbOut& out, const Dbtux::Frag& frag) return out; } +NdbOut& +operator<<(NdbOut& out, const Dbtux::FragOp& fragOp) +{ + out << "[FragOp " << hex << &fragOp; + out << " [userPtr " << dec << fragOp.m_userPtr << "]"; + out << " [indexId " << dec << fragOp.m_indexId << "]"; + out << " [fragId " << dec << fragOp.m_fragId << "]"; + out << " [fragNo " << dec << fragOp.m_fragNo << "]"; + out << " numAttrsRecvd " << dec << fragOp.m_numAttrsRecvd << "]"; + out << "]"; + return out; +} + NdbOut& operator<<(NdbOut& out, const Dbtux::NodeHandle& node) { diff --git a/ndb/src/kernel/blocks/dbtux/DbtuxGen.cpp b/ndb/src/kernel/blocks/dbtux/DbtuxGen.cpp index ded02696a89..18aa914de05 100644 --- a/ndb/src/kernel/blocks/dbtux/DbtuxGen.cpp +++ b/ndb/src/kernel/blocks/dbtux/DbtuxGen.cpp @@ -24,12 +24,7 @@ Dbtux::Dbtux(const Configuration& conf) : #ifdef VM_TRACE debugFile(0), debugOut(*new NullOutputStream()), - // until ndb_mgm supports dump -#ifdef DBTUX_DEBUG_TREE - debugFlags(DebugTree), -#else debugFlags(0), -#endif #endif c_internalStartPhase(0), c_typeOfStart(NodeState::ST_ILLEGAL_TYPE), @@ -86,7 +81,7 @@ Dbtux::execCONTINUEB(Signal* signal) jamEntry(); const Uint32* data = signal->getDataPtr(); switch (data[0]) { - case TuxContinueB::DropIndex: + case TuxContinueB::DropIndex: // currently unused { IndexPtr indexPtr; c_indexPool.getPtr(indexPtr, data[1]); @@ -174,7 +169,7 @@ Dbtux::execREAD_CONFIG_REQ(Signal* signal) ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_TUX_ATTRIBUTE, &nAttribute)); ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_TUX_SCAN_OP, &nScanOp)); - const Uint32 nDescPage = (nIndex + nAttribute + DescPageSize - 1) / DescPageSize; + const Uint32 nDescPage = (nIndex * DescHeadSize + nAttribute * DescAttrSize + DescPageSize - 1) / DescPageSize; const Uint32 nScanBoundWords = nScanOp * ScanBoundSegmentSize * 4; c_indexPool.setSize(nIndex); diff --git a/ndb/src/kernel/blocks/dbtux/DbtuxMeta.cpp b/ndb/src/kernel/blocks/dbtux/DbtuxMeta.cpp index 1577c5045e0..b7526593a08 100644 --- a/ndb/src/kernel/blocks/dbtux/DbtuxMeta.cpp +++ b/ndb/src/kernel/blocks/dbtux/DbtuxMeta.cpp @@ -29,6 +29,11 @@ void Dbtux::execTUXFRAGREQ(Signal* signal) { jamEntry(); + if (signal->theData[0] == (Uint32)-1) { + jam(); + abortAddFragOp(signal); + return; + } const TuxFragReq reqCopy = *(const TuxFragReq*)signal->getDataPtr(); const TuxFragReq* const req = &reqCopy; IndexPtr indexPtr; @@ -61,6 +66,11 @@ Dbtux::execTUXFRAGREQ(Signal* signal) fragOpPtr.p->m_fragId = req->fragId; fragOpPtr.p->m_fragNo = indexPtr.p->m_numFrags; fragOpPtr.p->m_numAttrsRecvd = 0; +#ifdef VM_TRACE + if (debugFlags & DebugMeta) { + debugOut << "Seize frag op " << fragOpPtr.i << " " << *fragOpPtr.p << endl; + } +#endif // check if index has place for more fragments ndbrequire(indexPtr.p->m_numFrags < MaxIndexFragments); // seize new fragment record @@ -129,6 +139,14 @@ Dbtux::execTUXFRAGREQ(Signal* signal) debugOut << "Add frag " << fragPtr.i << " " << *fragPtr.p << endl; } #endif + // error inserts + if (ERROR_INSERTED(12001) && fragOpPtr.p->m_fragNo == 0 || + ERROR_INSERTED(12002) && fragOpPtr.p->m_fragNo == 1) { + jam(); + errorCode = (TuxFragRef::ErrorCode)1; + CLEAR_ERROR_INSERT_VALUE; + break; + } // success TuxFragConf* const conf = (TuxFragConf*)signal->getDataPtrSend(); conf->userPtr = req->userPtr; @@ -145,10 +163,18 @@ Dbtux::execTUXFRAGREQ(Signal* signal) ref->errorCode = errorCode; sendSignal(req->userRef, GSN_TUXFRAGREF, signal, TuxFragRef::SignalLength, JBB); - if (fragOpPtr.i != RNIL) + if (fragOpPtr.i != RNIL) { +#ifdef VM_TRACE + if (debugFlags & DebugMeta) { + debugOut << "Release on frag error frag op " << fragOpPtr.i << " " << *fragOpPtr.p << endl; + } +#endif c_fragOpPool.release(fragOpPtr); - if (indexPtr.i != RNIL) - dropIndex(signal, indexPtr, 0, 0); + } + if (indexPtr.i != RNIL) { + jam(); + // let DICT drop the unfinished index + } } void @@ -203,7 +229,16 @@ Dbtux::execTUX_ADD_ATTRREQ(Signal* signal) } } #endif - if (indexPtr.p->m_numAttrs == fragOpPtr.p->m_numAttrsRecvd) { + const bool lastAttr = (indexPtr.p->m_numAttrs == fragOpPtr.p->m_numAttrsRecvd); + if (ERROR_INSERTED(12003) && fragOpPtr.p->m_fragNo == 0 && attrId == 0 || + ERROR_INSERTED(12004) && fragOpPtr.p->m_fragNo == 0 && lastAttr || + ERROR_INSERTED(12005) && fragOpPtr.p->m_fragNo == 1 && attrId == 0 || + ERROR_INSERTED(12006) && fragOpPtr.p->m_fragNo == 1 && lastAttr) { + errorCode = (TuxAddAttrRef::ErrorCode)1; + CLEAR_ERROR_INSERT_VALUE; + break; + } + if (lastAttr) { jam(); // initialize tree header TreeHead& tree = fragPtr.p->m_tree; @@ -246,11 +281,17 @@ Dbtux::execTUX_ADD_ATTRREQ(Signal* signal) } #endif // fragment is defined +#ifdef VM_TRACE + if (debugFlags & DebugMeta) { + debugOut << "Release frag op " << fragOpPtr.i << " " << *fragOpPtr.p << endl; + } +#endif c_fragOpPool.release(fragOpPtr); } // success TuxAddAttrConf* conf = (TuxAddAttrConf*)signal->getDataPtrSend(); conf->userPtr = fragOpPtr.p->m_userPtr; + conf->lastAttr = lastAttr; sendSignal(fragOpPtr.p->m_userRef, GSN_TUX_ADD_ATTRCONF, signal, TuxAddAttrConf::SignalLength, JBB); return; @@ -261,8 +302,32 @@ Dbtux::execTUX_ADD_ATTRREQ(Signal* signal) ref->errorCode = errorCode; sendSignal(fragOpPtr.p->m_userRef, GSN_TUX_ADD_ATTRREF, signal, TuxAddAttrRef::SignalLength, JBB); +#ifdef VM_TRACE + if (debugFlags & DebugMeta) { + debugOut << "Release on attr error frag op " << fragOpPtr.i << " " << *fragOpPtr.p << endl; + } +#endif c_fragOpPool.release(fragOpPtr); - dropIndex(signal, indexPtr, 0, 0); + // let DICT drop the unfinished index +} + +/* + * LQH aborts on-going create index operation. + */ +void +Dbtux::abortAddFragOp(Signal* signal) +{ + FragOpPtr fragOpPtr; + IndexPtr indexPtr; + c_fragOpPool.getPtr(fragOpPtr, signal->theData[1]); + c_indexPool.getPtr(indexPtr, fragOpPtr.p->m_indexId); +#ifdef VM_TRACE + if (debugFlags & DebugMeta) { + debugOut << "Release on abort frag op " << fragOpPtr.i << " " << *fragOpPtr.p << endl; + } +#endif + c_fragOpPool.release(fragOpPtr); + // let DICT drop the unfinished index } /* @@ -341,20 +406,13 @@ Dbtux::dropIndex(Signal* signal, IndexPtr indexPtr, Uint32 senderRef, Uint32 sen { jam(); indexPtr.p->m_state = Index::Dropping; - // drop one fragment at a time - if (indexPtr.p->m_numFrags > 0) { + // drop fragments + while (indexPtr.p->m_numFrags > 0) { jam(); - unsigned i = --indexPtr.p->m_numFrags; + Uint32 i = --indexPtr.p->m_numFrags; FragPtr fragPtr; c_fragPool.getPtr(fragPtr, indexPtr.p->m_fragPtrI[i]); c_fragPool.release(fragPtr); - // the real time break is not used for anything currently - signal->theData[0] = TuxContinueB::DropIndex; - signal->theData[1] = indexPtr.i; - signal->theData[2] = senderRef; - signal->theData[3] = senderData; - sendSignal(reference(), GSN_CONTINUEB, signal, 4, JBB); - return; } // drop attributes if (indexPtr.p->m_descPage != RNIL) { diff --git a/ndb/test/ndbapi/testDict.cpp b/ndb/test/ndbapi/testDict.cpp index 9552e321f00..b832cb7039b 100644 --- a/ndb/test/ndbapi/testDict.cpp +++ b/ndb/test/ndbapi/testDict.cpp @@ -1479,6 +1479,69 @@ runTestDictionaryPerf(NDBT_Context* ctx, NDBT_Step* step){ return NDBT_OK; } +int runFailAddFragment(NDBT_Context* ctx, NDBT_Step* step){ + static int tuplst[] = { 4007, 4008, 4009, 4010, 4011, 4012 }; + static int tuxlst[] = { 12001, 12002, 12003, 12004, 12005, 12006 }; + static unsigned tupcnt = sizeof(tuplst)/sizeof(tuplst[0]); + static unsigned tuxcnt = sizeof(tuxlst)/sizeof(tuxlst[0]); + + NdbRestarter restarter; + int nodeId = restarter.getMasterNodeId(); + Ndb* pNdb = GETNDB(step); + NdbDictionary::Dictionary* pDic = pNdb->getDictionary(); + NdbDictionary::Table tab(*ctx->getTab()); + tab.setFragmentType(NdbDictionary::Object::FragAllLarge); + + // ordered index on first few columns + NdbDictionary::Index idx("X"); + idx.setTable(tab.getName()); + idx.setType(NdbDictionary::Index::OrderedIndex); + idx.setLogging(false); + for (int i_hate_broken_compilers = 0; + i_hate_broken_compilers < 3 && + i_hate_broken_compilers < tab.getNoOfColumns(); + i_hate_broken_compilers++) { + idx.addColumn(*tab.getColumn(i_hate_broken_compilers)); + } + + const int loops = ctx->getNumLoops(); + int result = NDBT_OK; + (void)pDic->dropTable(tab.getName()); + + for (int l = 0; l < loops; l++) { + for (unsigned i = 0; i < tupcnt; i++) { + unsigned j = (l == 0 ? i : myRandom48(tupcnt)); + int errval = tuplst[j]; + g_info << "insert error node=" << nodeId << " value=" << errval << endl; + CHECK2(restarter.insertErrorInNode(nodeId, errval) == 0, + "failed to set error insert"); + CHECK2(pDic->createTable(tab) != 0, + "failed to fail after error insert " << errval); + CHECK2(pDic->createTable(tab) == 0, + pDic->getNdbError()); + CHECK2(pDic->dropTable(tab.getName()) == 0, + pDic->getNdbError()); + } + for (unsigned i = 0; i < tuxcnt; i++) { + unsigned j = (l == 0 ? i : myRandom48(tuxcnt)); + int errval = tuxlst[j]; + g_info << "insert error node=" << nodeId << " value=" << errval << endl; + CHECK2(restarter.insertErrorInNode(nodeId, errval) == 0, + "failed to set error insert"); + CHECK2(pDic->createTable(tab) == 0, + pDic->getNdbError()); + CHECK2(pDic->createIndex(idx) != 0, + "failed to fail after error insert " << errval); + CHECK2(pDic->createIndex(idx) == 0, + pDic->getNdbError()); + CHECK2(pDic->dropTable(tab.getName()) == 0, + pDic->getNdbError()); + } + } +end: + return result; +} + NDBT_TESTSUITE(testDict); TESTCASE("CreateAndDrop", "Try to create and drop the table loop number of times\n"){ @@ -1574,6 +1637,10 @@ TESTCASE("DictionaryPerf", ""){ INITIALIZER(runTestDictionaryPerf); } +TESTCASE("FailAddFragment", + "Fail add fragment or attribute in TUP or TUX\n"){ + INITIALIZER(runFailAddFragment); +} NDBT_TESTSUITE_END(testDict); int main(int argc, const char** argv){ diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index d9545d5cbb8..6c4870817e3 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -2144,22 +2144,19 @@ void ha_ndbcluster::print_results() } case NdbDictionary::Column::Decimal: { char *value= field->ptr; - fprintf(DBUG_FILE, "Decimal\t'%-*s'", field->pack_length(), value); break; } case NdbDictionary::Column::Char:{ - char buf[field->pack_length()+1]; - char *value= (char *) field->ptr; - snprintf(buf, field->pack_length(), "%s", value); - fprintf(DBUG_FILE, "Char\t'%s'", buf); + const char *value= (char *) field->ptr; + fprintf(DBUG_FILE, "Char\t'%.*s'", field->pack_length(), value); break; } case NdbDictionary::Column::Varchar: case NdbDictionary::Column::Binary: case NdbDictionary::Column::Varbinary: { - char *value= (char *) field->ptr; - fprintf(DBUG_FILE, "'%s'", value); + const char *value= (char *) field->ptr; + fprintf(DBUG_FILE, "Var\t'%.*s'", field->pack_length(), value); break; } case NdbDictionary::Column::Datetime: { From 03d6e2453b3a421a6ab97ec1abd84cc22c9fa158 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 13 Nov 2004 17:49:20 +0100 Subject: [PATCH 0212/1063] ndb: minor ndb/test/ndbapi/testDict.cpp: compile fix --- ndb/test/ndbapi/testDict.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ndb/test/ndbapi/testDict.cpp b/ndb/test/ndbapi/testDict.cpp index b832cb7039b..712ab2e4d25 100644 --- a/ndb/test/ndbapi/testDict.cpp +++ b/ndb/test/ndbapi/testDict.cpp @@ -1509,8 +1509,8 @@ int runFailAddFragment(NDBT_Context* ctx, NDBT_Step* step){ (void)pDic->dropTable(tab.getName()); for (int l = 0; l < loops; l++) { - for (unsigned i = 0; i < tupcnt; i++) { - unsigned j = (l == 0 ? i : myRandom48(tupcnt)); + for (unsigned i1 = 0; i1 < tupcnt; i1++) { + unsigned j = (l == 0 ? i1 : myRandom48(tupcnt)); int errval = tuplst[j]; g_info << "insert error node=" << nodeId << " value=" << errval << endl; CHECK2(restarter.insertErrorInNode(nodeId, errval) == 0, @@ -1522,8 +1522,8 @@ int runFailAddFragment(NDBT_Context* ctx, NDBT_Step* step){ CHECK2(pDic->dropTable(tab.getName()) == 0, pDic->getNdbError()); } - for (unsigned i = 0; i < tuxcnt; i++) { - unsigned j = (l == 0 ? i : myRandom48(tuxcnt)); + for (unsigned i2 = 0; i2 < tuxcnt; i2++) { + unsigned j = (l == 0 ? i2 : myRandom48(tuxcnt)); int errval = tuxlst[j]; g_info << "insert error node=" << nodeId << " value=" << errval << endl; CHECK2(restarter.insertErrorInNode(nodeId, errval) == 0, From 20cfd8fd4e4167ddc5b0b7b1d447fa7f3ed0be6a Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 14 Nov 2004 10:25:38 +0200 Subject: [PATCH 0213/1063] fixed incorrect using of THD::is_fatal_error --- sql/sql_parse.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 9d755731cb7..7420f9de100 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -1106,7 +1106,7 @@ extern "C" pthread_handler_decl(handle_bootstrap,arg) if (buff[length-1]!='\n' && !feof(file)) { send_error(thd,ER_NET_PACKET_TOO_LARGE, NullS); - thd->is_fatal_error= 1; + thd->fatal_error(); break; } while (length && (my_isspace(thd->charset(), buff[length-1]) || From bbe9e857e6aff7116bd816d2c2e3f39905abee43 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 14 Nov 2004 11:02:06 +0000 Subject: [PATCH 0214/1063] moved ndb_restore together with rest of the ndb tools kernel includes needed by ndb_restore changed link order moved LocalConfig to mgmapi Moved NdbConfig to Portlib mgmapi to use LocalConfig for connectstring parsing instead of it's own enable usage of "NULL" connectstring for default new ndbmgmclient lib that can be used by e.g. mysqladmin later LocalConfig no longer needed here, now in mgmapi Send connectstring to mgmapi instead added valid connectstring to be with only host without port i.e. valid connectstring =host1,host2,host3 default port will be added ndb/src/common/portlib/NdbConfig.c: Rename: ndb/src/common/mgmcommon/NdbConfig.c -> ndb/src/common/portlib/NdbConfig.c ndb/include/portlib/NdbConfig.h: Rename: ndb/include/mgmcommon/NdbConfig.h -> ndb/include/portlib/NdbConfig.h ndb/include/mgmapi/LocalConfig.hpp: Rename: ndb/include/mgmcommon/LocalConfig.hpp -> ndb/include/mgmapi/LocalConfig.hpp ndb/tools/restore/Makefile.am: Rename: ndb/src/kernel/blocks/backup/restore/Makefile.am -> ndb/tools/restore/Makefile.am ndb/tools/restore/consumer.cpp: Rename: ndb/src/kernel/blocks/backup/restore/consumer.cpp -> ndb/tools/restore/consumer.cpp ndb/tools/restore/consumer.hpp: Rename: ndb/src/kernel/blocks/backup/restore/consumer.hpp -> ndb/tools/restore/consumer.hpp ndb/tools/restore/consumer_printer.hpp: Rename: ndb/src/kernel/blocks/backup/restore/consumer_printer.hpp -> ndb/tools/restore/consumer_printer.hpp ndb/tools/restore/consumer_printer.cpp: Rename: ndb/src/kernel/blocks/backup/restore/consumer_printer.cpp -> ndb/tools/restore/consumer_printer.cpp ndb/tools/restore/consumer_restore.hpp: Rename: ndb/src/kernel/blocks/backup/restore/consumer_restore.hpp -> ndb/tools/restore/consumer_restore.hpp ndb/tools/restore/main.cpp: Rename: ndb/src/kernel/blocks/backup/restore/main.cpp -> ndb/tools/restore/main.cpp ndb/tools/restore/consumer_restorem.cpp: Rename: ndb/src/kernel/blocks/backup/restore/consumer_restorem.cpp -> ndb/tools/restore/consumer_restorem.cpp configure.in: moved ndb_restore together with rest of the ndb tools ndb/config/type_ndbapitools.mk.am: kernel includes needed by ndb_restore ndb/src/Makefile.am: changed link order ndb/src/common/mgmcommon/Makefile.am: mived LocalConfig to mgmapi ndb/src/common/portlib/Makefile.am: Moved NdbConfig to Portlib ndb/src/kernel/blocks/backup/Makefile.am: moved restore together with rest of ndb tools ndb/src/mgmapi/LocalConfig.cpp: added valid connectstring to be with only host without port i.e. valid connectstring =host1,host2,host3 default port will be added ndb/src/mgmapi/Makefile.am: LocalConfig part of the libmgmapi ndb/src/mgmapi/mgmapi.cpp: mgmapi to use LocalConfig for connectstring parsing instead of it's own ndb/src/mgmclient/CommandInterpreter.cpp: enable usage of "NULL" connectstring for default ndb/src/mgmclient/Makefile.am: new ndbmgmclient lib that can be used by e.g. mysqladmin later ndb/src/mgmclient/main.cpp: LocalConfig no longer needed here, now in mgmapi Send connectstring to mgmapi instead ndb/tools/Makefile.am: add ndb_restore to make of tools ndb/tools/restore/Restore.cpp: moved include BackupFormat and NdbDictionaryImpl to Restore.hpp ndb/tools/restore/Restore.hpp: moved include BackupFormat and NdbDictionaryImpl to Restore.hpp ndb/tools/restore/consumer_restore.cpp: moved include BackupFormat and NdbDictionaryImpl to Restore.hpp ndb/tools/waiter.cpp: LocalConfig moved --- configure.in | 1 - ndb/config/type_ndbapitools.mk.am | 3 +- .../{mgmcommon => mgmapi}/LocalConfig.hpp | 0 .../{mgmcommon => portlib}/NdbConfig.h | 0 ndb/src/Makefile.am | 2 +- ndb/src/common/mgmcommon/Makefile.am | 5 +- ndb/src/common/portlib/Makefile.am | 3 +- .../common/{mgmcommon => portlib}/NdbConfig.c | 0 ndb/src/kernel/blocks/backup/Makefile.am | 2 - .../mgmcommon => mgmapi}/LocalConfig.cpp | 28 +++--- ndb/src/mgmapi/Makefile.am | 7 +- ndb/src/mgmapi/mgmapi.cpp | 86 ++++++++----------- ndb/src/mgmclient/CommandInterpreter.cpp | 8 +- ndb/src/mgmclient/Makefile.am | 11 ++- ndb/src/mgmclient/main.cpp | 30 ++----- ndb/tools/Makefile.am | 17 +++- .../backup => tools}/restore/Makefile.am | 0 .../backup => tools}/restore/Restore.cpp | 4 - .../backup => tools}/restore/Restore.hpp | 3 +- .../backup => tools}/restore/consumer.cpp | 0 .../backup => tools}/restore/consumer.hpp | 0 .../restore/consumer_printer.cpp | 0 .../restore/consumer_printer.hpp | 0 .../restore/consumer_restore.cpp | 1 - .../restore/consumer_restore.hpp | 0 .../restore/consumer_restorem.cpp | 0 .../blocks/backup => tools}/restore/main.cpp | 0 ndb/tools/waiter.cpp | 5 +- 28 files changed, 107 insertions(+), 109 deletions(-) rename ndb/include/{mgmcommon => mgmapi}/LocalConfig.hpp (100%) rename ndb/include/{mgmcommon => portlib}/NdbConfig.h (100%) rename ndb/src/common/{mgmcommon => portlib}/NdbConfig.c (100%) rename ndb/src/{common/mgmcommon => mgmapi}/LocalConfig.cpp (92%) rename ndb/{src/kernel/blocks/backup => tools}/restore/Makefile.am (100%) rename ndb/{src/kernel/blocks/backup => tools}/restore/Restore.cpp (99%) rename ndb/{src/kernel/blocks/backup => tools}/restore/Restore.hpp (98%) rename ndb/{src/kernel/blocks/backup => tools}/restore/consumer.cpp (100%) rename ndb/{src/kernel/blocks/backup => tools}/restore/consumer.hpp (100%) rename ndb/{src/kernel/blocks/backup => tools}/restore/consumer_printer.cpp (100%) rename ndb/{src/kernel/blocks/backup => tools}/restore/consumer_printer.hpp (100%) rename ndb/{src/kernel/blocks/backup => tools}/restore/consumer_restore.cpp (99%) rename ndb/{src/kernel/blocks/backup => tools}/restore/consumer_restore.hpp (100%) rename ndb/{src/kernel/blocks/backup => tools}/restore/consumer_restorem.cpp (100%) rename ndb/{src/kernel/blocks/backup => tools}/restore/main.cpp (100%) diff --git a/configure.in b/configure.in index d4688d70484..1fcba6b8f5f 100644 --- a/configure.in +++ b/configure.in @@ -3114,7 +3114,6 @@ AC_CONFIG_FILES(ndb/Makefile ndb/include/Makefile dnl ndb/src/kernel/blocks/qmgr/Makefile dnl ndb/src/kernel/blocks/trix/Makefile dnl ndb/src/kernel/blocks/backup/Makefile dnl - ndb/src/kernel/blocks/backup/restore/Makefile dnl ndb/src/kernel/blocks/dbutil/Makefile dnl ndb/src/kernel/blocks/suma/Makefile dnl ndb/src/kernel/blocks/grep/Makefile dnl diff --git a/ndb/config/type_ndbapitools.mk.am b/ndb/config/type_ndbapitools.mk.am index ed6d8699e05..d4eb090112d 100644 --- a/ndb/config/type_ndbapitools.mk.am +++ b/ndb/config/type_ndbapitools.mk.am @@ -11,4 +11,5 @@ INCLUDES += -I$(srcdir) -I$(top_srcdir)/include \ -I$(top_srcdir)/ndb/include/util \ -I$(top_srcdir)/ndb/include/portlib \ -I$(top_srcdir)/ndb/test/include \ - -I$(top_srcdir)/ndb/include/mgmapi + -I$(top_srcdir)/ndb/include/mgmapi \ + -I$(top_srcdir)/ndb/include/kernel diff --git a/ndb/include/mgmcommon/LocalConfig.hpp b/ndb/include/mgmapi/LocalConfig.hpp similarity index 100% rename from ndb/include/mgmcommon/LocalConfig.hpp rename to ndb/include/mgmapi/LocalConfig.hpp diff --git a/ndb/include/mgmcommon/NdbConfig.h b/ndb/include/portlib/NdbConfig.h similarity index 100% rename from ndb/include/mgmcommon/NdbConfig.h rename to ndb/include/portlib/NdbConfig.h diff --git a/ndb/src/Makefile.am b/ndb/src/Makefile.am index bed43438e91..36a4c3f247f 100644 --- a/ndb/src/Makefile.am +++ b/ndb/src/Makefile.am @@ -11,8 +11,8 @@ libndbclient_la_LIBADD = \ common/transporter/libtransporter.la \ common/debugger/libtrace.la \ common/debugger/signaldata/libsignaldataprint.la \ - common/mgmcommon/libmgmsrvcommon.la \ mgmapi/libmgmapi.la \ + common/mgmcommon/libmgmsrvcommon.la \ common/logger/liblogger.la \ common/portlib/libportlib.la \ common/util/libgeneral.la diff --git a/ndb/src/common/mgmcommon/Makefile.am b/ndb/src/common/mgmcommon/Makefile.am index b787da51ab9..a0aca3e68f1 100644 --- a/ndb/src/common/mgmcommon/Makefile.am +++ b/ndb/src/common/mgmcommon/Makefile.am @@ -1,14 +1,11 @@ noinst_LTLIBRARIES = libmgmsrvcommon.la libmgmsrvcommon_la_SOURCES = \ - LocalConfig.cpp \ ConfigRetriever.cpp \ - IPCConfig.cpp NdbConfig.c + IPCConfig.cpp INCLUDES_LOC = -I$(top_srcdir)/ndb/src/mgmapi -I$(top_srcdir)/ndb/src/mgmsrv -DEFS_LOC = -DNDB_PORT="\"@ndb_port@\"" - include $(top_srcdir)/ndb/config/common.mk.am include $(top_srcdir)/ndb/config/type_ndbapi.mk.am include $(top_srcdir)/ndb/config/type_mgmapiclient.mk.am diff --git a/ndb/src/common/portlib/Makefile.am b/ndb/src/common/portlib/Makefile.am index 6f3a3fe01a9..73125ad918d 100644 --- a/ndb/src/common/portlib/Makefile.am +++ b/ndb/src/common/portlib/Makefile.am @@ -5,7 +5,8 @@ noinst_LTLIBRARIES = libportlib.la libportlib_la_SOURCES = \ NdbCondition.c NdbMutex.c NdbSleep.c NdbTick.c \ NdbEnv.c NdbThread.c NdbHost.c NdbTCP.cpp \ - NdbDaemon.c NdbMem.c + NdbDaemon.c NdbMem.c \ + NdbConfig.c include $(top_srcdir)/ndb/config/common.mk.am include $(top_srcdir)/ndb/config/type_util.mk.am diff --git a/ndb/src/common/mgmcommon/NdbConfig.c b/ndb/src/common/portlib/NdbConfig.c similarity index 100% rename from ndb/src/common/mgmcommon/NdbConfig.c rename to ndb/src/common/portlib/NdbConfig.c diff --git a/ndb/src/kernel/blocks/backup/Makefile.am b/ndb/src/kernel/blocks/backup/Makefile.am index 85bf5b12415..e669febdc0d 100644 --- a/ndb/src/kernel/blocks/backup/Makefile.am +++ b/ndb/src/kernel/blocks/backup/Makefile.am @@ -1,6 +1,4 @@ -SUBDIRS = restore - noinst_LIBRARIES = libbackup.a libbackup_a_SOURCES = Backup.cpp BackupInit.cpp diff --git a/ndb/src/common/mgmcommon/LocalConfig.cpp b/ndb/src/mgmapi/LocalConfig.cpp similarity index 92% rename from ndb/src/common/mgmcommon/LocalConfig.cpp rename to ndb/src/mgmapi/LocalConfig.cpp index 679de716be0..d0ff97cdedf 100644 --- a/ndb/src/common/mgmcommon/LocalConfig.cpp +++ b/ndb/src/mgmapi/LocalConfig.cpp @@ -14,7 +14,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "LocalConfig.hpp" +#include #include #include #include @@ -164,17 +164,25 @@ LocalConfig::parseNodeId(const char * buf){ bool LocalConfig::parseHostName(const char * buf){ char tempString[1024]; + char tempString2[1024]; int port; - for(int i = 0; hostNameTokens[i] != 0; i++) { - if (sscanf(buf, hostNameTokens[i], tempString, &port) == 2) { - MgmtSrvrId mgmtSrvrId; - mgmtSrvrId.type = MgmId_TCP; - mgmtSrvrId.name.assign(tempString); - mgmtSrvrId.port = port; - ids.push_back(mgmtSrvrId); - return true; + do { + for(int i = 0; hostNameTokens[i] != 0; i++) { + if (sscanf(buf, hostNameTokens[i], tempString, &port) == 2) { + MgmtSrvrId mgmtSrvrId; + mgmtSrvrId.type = MgmId_TCP; + mgmtSrvrId.name.assign(tempString); + mgmtSrvrId.port = port; + ids.push_back(mgmtSrvrId); + return true; + } } - } + if (buf == tempString2) + break; + // try to add default port to see if it works + snprintf(tempString2, sizeof(tempString2),"%s:%s", buf, NDB_PORT); + buf= tempString2; + } while(1); return false; } diff --git a/ndb/src/mgmapi/Makefile.am b/ndb/src/mgmapi/Makefile.am index 0f0e1cea5d8..d64216b56c0 100644 --- a/ndb/src/mgmapi/Makefile.am +++ b/ndb/src/mgmapi/Makefile.am @@ -1,10 +1,11 @@ noinst_LTLIBRARIES = libmgmapi.la -libmgmapi_la_SOURCES = mgmapi.cpp mgmapi_configuration.cpp +libmgmapi_la_SOURCES = mgmapi.cpp mgmapi_configuration.cpp LocalConfig.cpp -INCLUDES_LOC = -I$(top_srcdir)/ndb/include/mgmapi -I$(top_srcdir)/ndb/src/common/mgmcommon -DEFS_LOC = -DNO_DEBUG_MESSAGES +INCLUDES_LOC = -I$(top_srcdir)/ndb/include/mgmapi + +DEFS_LOC = -DNO_DEBUG_MESSAGES -DNDB_PORT="\"@ndb_port@\"" include $(top_srcdir)/ndb/config/common.mk.am include $(top_srcdir)/ndb/config/type_util.mk.am diff --git a/ndb/src/mgmapi/mgmapi.cpp b/ndb/src/mgmapi/mgmapi.cpp index 66f0dbb1842..51f2d7cee01 100644 --- a/ndb/src/mgmapi/mgmapi.cpp +++ b/ndb/src/mgmapi/mgmapi.cpp @@ -17,6 +17,7 @@ #include #include +#include #include #include @@ -94,6 +95,8 @@ struct ndb_mgm_handle { NDB_SOCKET_TYPE socket; + char cfg_ptr[sizeof(LocalConfig)]; + #ifdef MGMAPI_LOG FILE* logfile; #endif @@ -146,10 +149,12 @@ ndb_mgm_create_handle() h->last_error = 0; h->last_error_line = 0; h->hostname = 0; - h->socket = -1; + h->socket = NDB_INVALID_SOCKET; h->read_timeout = 50000; h->write_timeout = 100; + new (h->cfg_ptr) LocalConfig; + strncpy(h->last_error_desc, "No error", NDB_MGM_MAX_ERR_DESC_SIZE); #ifdef MGMAPI_LOG h->logfile = 0; @@ -177,6 +182,7 @@ ndb_mgm_destroy_handle(NdbMgmHandle * handle) (* handle)->logfile = 0; } #endif + ((LocalConfig*)((*handle)->cfg_ptr))->~LocalConfig(); my_free((char*)* handle,MYF(MY_ALLOW_ZERO_PTR)); * handle = 0; } @@ -220,42 +226,6 @@ ndb_mgm_get_latest_error_msg(const NdbMgmHandle h) return "Error"; // Unknown Error message } -static -int -parse_connect_string(const char * connect_string, - NdbMgmHandle handle) -{ - if(connect_string == 0){ - SET_ERROR(handle, NDB_MGM_ILLEGAL_CONNECT_STRING, ""); - return -1; - } - - char * line = my_strdup(connect_string,MYF(MY_WME)); - My_auto_ptr ap1(line); - if(line == 0){ - SET_ERROR(handle, NDB_MGM_OUT_OF_MEMORY, ""); - return -1; - } - - char * tmp = strchr(line, ':'); - if(tmp == 0){ - SET_ERROR(handle, NDB_MGM_OUT_OF_MEMORY, ""); - return -1; - } - * tmp = 0; tmp++; - - int port = 0; - if(sscanf(tmp, "%d", &port) != 1){ - SET_ERROR(handle, NDB_MGM_ILLEGAL_PORT_NUMBER, ""); - return -1; - } - - my_free(handle->hostname,MYF(MY_ALLOW_ZERO_PTR)); - handle->hostname = my_strdup(line,MYF(MY_WME)); - handle->port = port; - return 0; -} - /* * Call an operation, and return the reply */ @@ -348,11 +318,6 @@ ndb_mgm_connect(NdbMgmHandle handle, const char * mgmsrv) { SET_ERROR(handle, NDB_MGM_NO_ERROR, "Executing: ndb_mgm_connect"); CHECK_HANDLE(handle, -1); - - if(parse_connect_string(mgmsrv, handle) != 0) { - SET_ERROR(handle, NDB_MGM_ILLEGAL_CONNECT_STRING, ""); - return -1; - } #ifdef MGMAPI_LOG /** @@ -366,14 +331,37 @@ ndb_mgm_connect(NdbMgmHandle handle, const char * mgmsrv) /** * Do connect */ - SocketClient s(handle->hostname, handle->port); - const NDB_SOCKET_TYPE sockfd = s.connect(); - if (sockfd < 0) { - setError(handle, NDB_MGM_COULD_NOT_CONNECT_TO_SOCKET, __LINE__, - "Unable to connect to %s", mgmsrv); + LocalConfig *cfg= (LocalConfig*)(handle->cfg_ptr); + new (cfg) LocalConfig; + if (!cfg->init(mgmsrv, 0) || + cfg->ids.size() == 0) + { + SET_ERROR(handle, NDB_MGM_ILLEGAL_CONNECT_STRING, ""); return -1; } - + + NDB_SOCKET_TYPE sockfd= NDB_INVALID_SOCKET; + Uint32 i; + for (i = 0; i < cfg->ids.size(); i++) + { + if (cfg->ids[i].type != MgmId_TCP) + continue; + SocketClient s(cfg->ids[i].name.c_str(), cfg->ids[i].port); + sockfd = s.connect(); + if (sockfd != NDB_INVALID_SOCKET) + break; + } + if (sockfd == NDB_INVALID_SOCKET) + { + setError(handle, NDB_MGM_COULD_NOT_CONNECT_TO_SOCKET, __LINE__, + "Unable to connect using connectstring %s", mgmsrv); + return -1; + } + + my_free(handle->hostname,MYF(MY_ALLOW_ZERO_PTR)); + handle->hostname = my_strdup(cfg->ids[i].name.c_str(),MYF(MY_WME)); + handle->port = cfg->ids[i].port; + handle->socket = sockfd; handle->connected = 1; @@ -392,7 +380,7 @@ ndb_mgm_disconnect(NdbMgmHandle handle) CHECK_CONNECTED(handle, -1); NDB_CLOSE_SOCKET(handle->socket); - handle->socket = -1; + handle->socket = NDB_INVALID_SOCKET; handle->connected = 0; return 0; diff --git a/ndb/src/mgmclient/CommandInterpreter.cpp b/ndb/src/mgmclient/CommandInterpreter.cpp index fde4e5a2e91..d940f6e165a 100644 --- a/ndb/src/mgmclient/CommandInterpreter.cpp +++ b/ndb/src/mgmclient/CommandInterpreter.cpp @@ -384,8 +384,10 @@ CommandInterpreter::CommandInterpreter(const char *_host) connected = false; try_reconnect = 0; - - host = my_strdup(_host,MYF(MY_WME)); + if (_host) + host= my_strdup(_host,MYF(MY_WME)); + else + host= 0; #ifdef HAVE_GLOBAL_REPLICATION rep_host = NULL; m_repserver = NULL; @@ -400,7 +402,7 @@ CommandInterpreter::~CommandInterpreter() { connected = false; ndb_mgm_destroy_handle(&m_mgmsrv); - my_free((char *)host,MYF(0)); + my_free((char *)host,MYF(MY_ALLOW_ZERO_PTR)); host = NULL; } diff --git a/ndb/src/mgmclient/Makefile.am b/ndb/src/mgmclient/Makefile.am index cd6ddb0ad57..b8f9f82e501 100644 --- a/ndb/src/mgmclient/Makefile.am +++ b/ndb/src/mgmclient/Makefile.am @@ -3,17 +3,24 @@ noinst_LTLIBRARIES = libndbmgmclient.la ndbtools_PROGRAMS = ndb_mgm libndbmgmclient_la_SOURCES = CommandInterpreter.cpp +libndbmgmclient_la_LIBADD = ../mgmapi/libmgmapi.la \ + ../common/logger/liblogger.la \ + ../common/portlib/libportlib.la \ + ../common/util/libgeneral.la \ + ../common/portlib/libportlib.la + ndb_mgm_SOURCES = main.cpp include $(top_srcdir)/ndb/config/common.mk.am include $(top_srcdir)/ndb/config/type_ndbapi.mk.am -INCLUDES += -I$(top_srcdir)/ndb/include/mgmapi -I$(top_srcdir)/ndb/src/common/mgmcommon +INCLUDES += -I$(top_srcdir)/ndb/include/mgmapi \ + -I$(top_srcdir)/ndb/src/common/mgmcommon LDADD_LOC = $(noinst_LTLIBRARIES) \ + ../common/portlib/libportlib.la \ @readline_link@ \ - $(top_builddir)/ndb/src/libndbclient.la \ $(top_builddir)/dbug/libdbug.a \ $(top_builddir)/mysys/libmysys.a \ $(top_builddir)/strings/libmystrings.a \ diff --git a/ndb/src/mgmclient/main.cpp b/ndb/src/mgmclient/main.cpp index 8f5d9e6656c..401a9198f30 100644 --- a/ndb/src/mgmclient/main.cpp +++ b/ndb/src/mgmclient/main.cpp @@ -145,33 +145,21 @@ int main(int argc, char** argv){ if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option))) exit(ho_error); - LocalConfig cfg; - - if(argc >= 1) { - _host = argv[0]; - if(argc >= 2) { - _port = atoi(argv[1]); - } - } else { - if(cfg.init(opt_connect_str, 0) && cfg.ids.size() > 0 && cfg.ids[0].type == MgmId_TCP){ - _host = cfg.ids[0].name.c_str(); - _port = cfg.ids[0].port; - } else { - cfg.printError(); - cfg.printUsage(); - return 1; - } - } - char buf[MAXHOSTNAMELEN+10]; - BaseString::snprintf(buf, sizeof(buf), "%s:%d", _host, _port); + if(argc == 1) { + BaseString::snprintf(buf, sizeof(buf), "%s", argv[0]); + opt_connect_str= buf; + } else if (argc >= 2) { + BaseString::snprintf(buf, sizeof(buf), "%s:%s", argv[0], argv[1]); + opt_connect_str= buf; + } ndbout << "-- NDB Cluster -- Management Client --" << endl; - printf("Connecting to Management Server: %s\n", buf); + printf("Connecting to Management Server: %s\n", opt_connect_str ? opt_connect_str : "default"); signal(SIGPIPE, handler); - com = new Ndb_mgmclient(buf); + com = new Ndb_mgmclient(opt_connect_str); while(read_and_execute(_try_reconnect)); delete com; diff --git a/ndb/tools/Makefile.am b/ndb/tools/Makefile.am index fad9bf9ff84..9c086d665c1 100644 --- a/ndb/tools/Makefile.am +++ b/ndb/tools/Makefile.am @@ -8,9 +8,12 @@ ndbtools_PROGRAMS = \ ndb_drop_index \ ndb_show_tables \ ndb_select_all \ - ndb_select_count + ndb_select_count \ + ndb_restore -tools_common_sources = ../test/src/NDBT_ReturnCodes.cpp ../test/src/NDBT_Table.cpp ../test/src/NDBT_Output.cpp +tools_common_sources = ../test/src/NDBT_ReturnCodes.cpp \ + ../test/src/NDBT_Table.cpp \ + ../test/src/NDBT_Output.cpp ndb_test_platform_SOURCES = ndb_test_platform.cpp ndb_waiter_SOURCES = waiter.cpp $(tools_common_sources) @@ -19,8 +22,15 @@ ndb_desc_SOURCES = desc.cpp $(tools_common_sources) ndb_drop_index_SOURCES = drop_index.cpp $(tools_common_sources) ndb_drop_table_SOURCES = drop_tab.cpp $(tools_common_sources) ndb_show_tables_SOURCES = listTables.cpp $(tools_common_sources) -ndb_select_all_SOURCES = select_all.cpp ../test/src/NDBT_ResultRow.cpp $(tools_common_sources) +ndb_select_all_SOURCES = select_all.cpp \ + ../test/src/NDBT_ResultRow.cpp \ + $(tools_common_sources) ndb_select_count_SOURCES = select_count.cpp $(tools_common_sources) +ndb_restore_SOURCES = restore/main.cpp \ + restore/consumer.cpp \ + restore/consumer_restore.cpp \ + restore/consumer_printer.cpp \ + restore/Restore.cpp include $(top_srcdir)/ndb/config/common.mk.am include $(top_srcdir)/ndb/config/type_ndbapitools.mk.am @@ -34,6 +44,7 @@ ndb_drop_index_LDFLAGS = @ndb_bin_am_ldflags@ ndb_show_tables_LDFLAGS = @ndb_bin_am_ldflags@ ndb_select_all_LDFLAGS = @ndb_bin_am_ldflags@ ndb_select_count_LDFLAGS = @ndb_bin_am_ldflags@ +ndb_restore_LDFLAGS = @ndb_bin_am_ldflags@ # Don't update the files from bitkeeper %::SCCS/s.% diff --git a/ndb/src/kernel/blocks/backup/restore/Makefile.am b/ndb/tools/restore/Makefile.am similarity index 100% rename from ndb/src/kernel/blocks/backup/restore/Makefile.am rename to ndb/tools/restore/Makefile.am diff --git a/ndb/src/kernel/blocks/backup/restore/Restore.cpp b/ndb/tools/restore/Restore.cpp similarity index 99% rename from ndb/src/kernel/blocks/backup/restore/Restore.cpp rename to ndb/tools/restore/Restore.cpp index fb3bde6bdef..6e2fcaed3af 100644 --- a/ndb/src/kernel/blocks/backup/restore/Restore.cpp +++ b/ndb/tools/restore/Restore.cpp @@ -15,7 +15,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "Restore.hpp" -#include "BackupFormat.hpp" #include #include #include @@ -25,9 +24,6 @@ #include #include -// from src/ndbapi -#include - Uint16 Twiddle16(Uint16 in); // Byte shift 16-bit data Uint32 Twiddle32(Uint32 in); // Byte shift 32-bit data Uint64 Twiddle64(Uint64 in); // Byte shift 64-bit data diff --git a/ndb/src/kernel/blocks/backup/restore/Restore.hpp b/ndb/tools/restore/Restore.hpp similarity index 98% rename from ndb/src/kernel/blocks/backup/restore/Restore.hpp rename to ndb/tools/restore/Restore.hpp index 0ec1ab852e9..82fcdcdb183 100644 --- a/ndb/src/kernel/blocks/backup/restore/Restore.hpp +++ b/ndb/tools/restore/Restore.hpp @@ -19,7 +19,8 @@ #include #include -#include +#include "../src/kernel/blocks/backup/BackupFormat.hpp" +#include "../src/ndbapi/NdbDictionaryImpl.hpp" #include #include diff --git a/ndb/src/kernel/blocks/backup/restore/consumer.cpp b/ndb/tools/restore/consumer.cpp similarity index 100% rename from ndb/src/kernel/blocks/backup/restore/consumer.cpp rename to ndb/tools/restore/consumer.cpp diff --git a/ndb/src/kernel/blocks/backup/restore/consumer.hpp b/ndb/tools/restore/consumer.hpp similarity index 100% rename from ndb/src/kernel/blocks/backup/restore/consumer.hpp rename to ndb/tools/restore/consumer.hpp diff --git a/ndb/src/kernel/blocks/backup/restore/consumer_printer.cpp b/ndb/tools/restore/consumer_printer.cpp similarity index 100% rename from ndb/src/kernel/blocks/backup/restore/consumer_printer.cpp rename to ndb/tools/restore/consumer_printer.cpp diff --git a/ndb/src/kernel/blocks/backup/restore/consumer_printer.hpp b/ndb/tools/restore/consumer_printer.hpp similarity index 100% rename from ndb/src/kernel/blocks/backup/restore/consumer_printer.hpp rename to ndb/tools/restore/consumer_printer.hpp diff --git a/ndb/src/kernel/blocks/backup/restore/consumer_restore.cpp b/ndb/tools/restore/consumer_restore.cpp similarity index 99% rename from ndb/src/kernel/blocks/backup/restore/consumer_restore.cpp rename to ndb/tools/restore/consumer_restore.cpp index a35d9d22c65..e2c55e5a0b1 100644 --- a/ndb/src/kernel/blocks/backup/restore/consumer_restore.cpp +++ b/ndb/tools/restore/consumer_restore.cpp @@ -16,7 +16,6 @@ #include "consumer_restore.hpp" #include -#include extern FilteredNdbOut err; extern FilteredNdbOut info; diff --git a/ndb/src/kernel/blocks/backup/restore/consumer_restore.hpp b/ndb/tools/restore/consumer_restore.hpp similarity index 100% rename from ndb/src/kernel/blocks/backup/restore/consumer_restore.hpp rename to ndb/tools/restore/consumer_restore.hpp diff --git a/ndb/src/kernel/blocks/backup/restore/consumer_restorem.cpp b/ndb/tools/restore/consumer_restorem.cpp similarity index 100% rename from ndb/src/kernel/blocks/backup/restore/consumer_restorem.cpp rename to ndb/tools/restore/consumer_restorem.cpp diff --git a/ndb/src/kernel/blocks/backup/restore/main.cpp b/ndb/tools/restore/main.cpp similarity index 100% rename from ndb/src/kernel/blocks/backup/restore/main.cpp rename to ndb/tools/restore/main.cpp diff --git a/ndb/tools/waiter.cpp b/ndb/tools/waiter.cpp index be572d7c275..e24164ea807 100644 --- a/ndb/tools/waiter.cpp +++ b/ndb/tools/waiter.cpp @@ -23,12 +23,13 @@ #include #include #include -#include "../include/mgmcommon/LocalConfig.hpp" +#include #include int -waitClusterStatus(const char* _addr, ndb_mgm_node_status _status, unsigned int _timeout); +waitClusterStatus(const char* _addr, ndb_mgm_node_status _status, + unsigned int _timeout); static const char* opt_connect_str= 0; static int _no_contact = 0; From 6a8bfdbe106c9f61abb765f0b4703339c8f4d1ab Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 14 Nov 2004 17:18:31 +0100 Subject: [PATCH 0215/1063] allowing --master-data without arg to be compatible with < 4.1.8 mysqldump. --- client/mysqldump.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/client/mysqldump.c b/client/mysqldump.c index 83967d62813..540f0d78c50 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -254,7 +254,7 @@ static struct my_option my_long_options[] = "any action on logs will happen at the exact moment of the dump." "Option automatically turns --lock-tables off.", (gptr*) &opt_master_data, (gptr*) &opt_master_data, 0, - GET_UINT, REQUIRED_ARG, 0, 0, MYSQL_OPT_MASTER_DATA_COMMENTED_SQL, 0, 0, 0}, + GET_UINT, OPT_ARG, 0, 0, MYSQL_OPT_MASTER_DATA_COMMENTED_SQL, 0, 0, 0}, {"max_allowed_packet", OPT_MAX_ALLOWED_PACKET, "", (gptr*) &opt_max_allowed_packet, (gptr*) &opt_max_allowed_packet, 0, GET_ULONG, REQUIRED_ARG, 24*1024*1024, 4096, @@ -548,6 +548,10 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), case '?': usage(); exit(0); + case (int) OPT_MASTER_DATA: + if (!argument) /* work like in old versions */ + opt_master_data= MYSQL_OPT_MASTER_DATA_EFFECTIVE_SQL; + break; case (int) OPT_OPTIMIZE: extended_insert= opt_drop= opt_lock= quick= create_options= opt_disable_keys= lock_tables= opt_set_charset= 1; From ce85816690ce8a7cc52a4010463bf33a8d231a0f Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 14 Nov 2004 17:45:37 +0100 Subject: [PATCH 0216/1063] Try to lower the probability of a stall of mysqldump AND most client connections, when mysqldump does a FLUSH TABLES WITH READ LOCK (doing FLUSH TABLES first). client/mysqldump.c: try to lower the probability of a stall of mysqldump AND most client connections, when mysqldump does a FLUSH TABLES WITH READ LOCK (doing FLUSH TABLES first). --- client/mysqldump.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/client/mysqldump.c b/client/mysqldump.c index 540f0d78c50..498a10041a9 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -2050,8 +2050,18 @@ static int do_show_master_status(MYSQL *mysql_con) static int do_flush_tables_read_lock(MYSQL *mysql_con) { + /* + We do first a FLUSH TABLES. If a long update is running, the FLUSH TABLES + will wait but will not stall the whole mysqld, and when the long update is + done the FLUSH TABLES WITH READ LOCK will start and succeed quickly. So, + FLUSH TABLES is to lower the probability of a stage where both mysqldump + and most client connections are stalled. Of course, if a second long + update starts between the two FLUSHes, we have that bad stall. + */ return - mysql_query_with_error_report(mysql_con, 0, "FLUSH TABLES WITH READ LOCK"); + ( mysql_query_with_error_report(mysql_con, 0, "FLUSH TABLES") || + mysql_query_with_error_report(mysql_con, 0, + "FLUSH TABLES WITH READ LOCK") ); } From 8f145e4cbd5151155132a127434390218c0cf2e8 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 15 Nov 2004 10:43:17 +0100 Subject: [PATCH 0217/1063] wl1744 - ndb on windows ndb/config/win-lib.am: removed TLS stuff (which I don't know what it is) ndb/include/kernel/signaldata/UtilLock.hpp: Made stuff public ndb/include/ndb_global.h.in: better defines for strcasecmp ndb/src/common/transporter/Transporter.cpp: Use NDB_INVALID_SOCKET ndb/src/common/util/SocketClient.cpp: Use NDB_INVALID_SOCKET ndb/src/kernel/vm/Callback.hpp: Move callback into SimulatedBlock as it for some mysterious reason otherwise got sizeof()=0 on windows ndb/src/kernel/vm/Configuration.cpp: Removed extra (bug) semi-colon ndb/src/kernel/vm/Mutex.cpp: Move callback into SimulatedBlock as it for some mysterious reason otherwise got sizeof()=0 on windows ndb/src/kernel/vm/Mutex.hpp: Move callback into SimulatedBlock as it for some mysterious reason otherwise got sizeof()=0 on windows ndb/src/kernel/vm/SectionReader.cpp: Use correct struct-type ndb/src/kernel/vm/SectionReader.hpp: Use correct struct-type ndb/src/kernel/vm/SimulatedBlock.cpp: Move callback into SimulatedBlock as it for some mysterious reason otherwise got sizeof()=0 on windows ndb/src/kernel/vm/SimulatedBlock.hpp: Move callback into SimulatedBlock as it for some mysterious reason otherwise got sizeof()=0 on windows ndb/src/mgmclient/Makefile.am: Add mgm client to windoze ndb/test/src/Makefile.am: Fix lib --- ndb/config/win-lib.am | 63 +------------ ndb/include/kernel/signaldata/UtilLock.hpp | 24 ++--- ndb/include/ndb_global.h.in | 4 +- ndb/src/common/transporter/Transporter.cpp | 2 +- ndb/src/common/util/SocketClient.cpp | 20 ++-- ndb/src/kernel/vm/Callback.hpp | 7 -- ndb/src/kernel/vm/Configuration.cpp | 10 +- ndb/src/kernel/vm/Mutex.cpp | 53 ++++++----- ndb/src/kernel/vm/Mutex.hpp | 102 +++++---------------- ndb/src/kernel/vm/SectionReader.cpp | 2 +- ndb/src/kernel/vm/SectionReader.hpp | 2 +- ndb/src/kernel/vm/SimulatedBlock.cpp | 2 +- ndb/src/kernel/vm/SimulatedBlock.hpp | 69 +++++++++++++- ndb/src/mgmclient/Makefile.am | 26 +++++- ndb/test/src/Makefile.am | 2 +- 15 files changed, 181 insertions(+), 207 deletions(-) diff --git a/ndb/config/win-lib.am b/ndb/config/win-lib.am index cae10b9e8d0..05ac1ec8a40 100644 --- a/ndb/config/win-lib.am +++ b/ndb/config/win-lib.am @@ -19,8 +19,6 @@ CFG=@name@ - Win32 Debug !MESSAGE !MESSAGE "@name@ - Win32 Release" (based on "Win32 (x86) Static Library") !MESSAGE "@name@ - Win32 Debug" (based on "Win32 (x86) Static Library") -!MESSAGE "@name@ - Win32 TLS_DEBUG" (based on "Win32 (x86) Static Library") -!MESSAGE "@name@ - Win32 TLS" (based on "Win32 (x86) Static Library") !MESSAGE # Begin Project @@ -54,7 +52,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LIB32=xilink6.exe -lib # ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"..\lib_release\@name@.lib" +# ADD LIB32 /nologo /out:".\lib_release\@name@.lib" @release_libs@ !ELSEIF "$(CFG)" == "@name@ - Win32 Debug" @@ -81,72 +79,15 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LIB32=xilink6.exe -lib # ADD BASE LIB32 /nologo -# ADD LIB32 /nologo /out:"..\lib_debug\@name@.lib" +# ADD LIB32 /nologo /out:".\lib_debug\@name@.lib" @debug_libs@ -!ELSEIF "$(CFG)" == "@name@ - Win32 TLS_DEBUG" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "@name@___Win32_TLS_DEBUG" -# PROP BASE Intermediate_Dir "@name@___Win32_TLS_DEBUG" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "@name@___Win32_TLS_DEBUG" -# PROP Intermediate_Dir "@name@___Win32_TLS_DEBUG" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /G6 /MTd /W3 /Z7 /Od /Gf /D "WIN32" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /FD /c -# SUBTRACT BASE CPP /YX -# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /Gf /D "WIN32" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /D "USE_TLS" /FD /c -# ADD BASE CPP @includes@ -# ADD CPP @includes@ -# ADD BASE RSC /l 0x409 -# ADD RSC /l 0x409 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\lib_debug\@name@_tls.lib" -# ADD LIB32 /nologo /out:"..\lib_debug\@name@_tls.lib" -@tls_debug_libs@ - -!ELSEIF "$(CFG)" == "@name@ - Win32 TLS" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "@name@___Win32_TLS" -# PROP BASE Intermediate_Dir "@name@___Win32_TLS" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "@name@___Win32_TLS" -# PROP Intermediate_Dir "@name@___Win32_TLS" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /D "WIN32" /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /FD /c -# SUBTRACT BASE CPP /YX -# ADD CPP /nologo /G6 /MT /W3 /O2 /D "WIN32" /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /D "USE_TLS" /FD /c -# ADD BASE CPP @includes@ -# ADD CPP @includes@ -# SUBTRACT CPP /YX -# ADD BASE RSC /l 0x409 -# ADD RSC /l 0x409 -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LIB32=link.exe -lib -# ADD BASE LIB32 /nologo /out:"..\lib_release\@name@_tls.lib" -# ADD LIB32 /nologo /out:"..\lib_release\@name@_tls.lib" -@tls_release_libs@ - !ENDIF # Begin Target # Name "@name@ - Win32 Release" # Name "@name@ - Win32 Debug" -# Name "@name@ - Win32 TLS_DEBUG" -# Name "@name@ - Win32 TLS" # Begin Group "Source Files" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" diff --git a/ndb/include/kernel/signaldata/UtilLock.hpp b/ndb/include/kernel/signaldata/UtilLock.hpp index 1cac467daa0..318024fd706 100644 --- a/ndb/include/kernel/signaldata/UtilLock.hpp +++ b/ndb/include/kernel/signaldata/UtilLock.hpp @@ -39,7 +39,7 @@ public: enum RequestInfo { TryLock = 1 }; -private: +public: Uint32 senderData; Uint32 senderRef; Uint32 lockId; @@ -63,7 +63,7 @@ class UtilLockConf { public: STATIC_CONST( SignalLength = 4 ); -private: +public: Uint32 senderData; Uint32 senderRef; Uint32 lockId; @@ -95,7 +95,7 @@ public: LockAlreadyHeld = 4 }; -private: +public: Uint32 senderData; Uint32 senderRef; Uint32 lockId; @@ -119,7 +119,7 @@ class UtilUnlockReq { public: STATIC_CONST( SignalLength = 4 ); -private: +public: Uint32 senderData; Uint32 senderRef; Uint32 lockId; @@ -143,7 +143,7 @@ class UtilUnlockConf { public: STATIC_CONST( SignalLength = 3 ); -private: +public: Uint32 senderData; Uint32 senderRef; Uint32 lockId; @@ -171,7 +171,7 @@ public: NoSuchLock = 1, NotLockOwner = 2 }; -private: +public: Uint32 senderData; Uint32 senderRef; Uint32 lockId; @@ -200,7 +200,7 @@ public: STATIC_CONST( SignalLength = 4 ); -private: +public: Uint32 senderData; Uint32 senderRef; Uint32 lockId; @@ -229,7 +229,7 @@ public: STATIC_CONST( SignalLength = 4 ); -private: +public: Uint32 senderData; Uint32 senderRef; Uint32 lockId; @@ -251,7 +251,7 @@ class UtilCreateLockConf { public: STATIC_CONST( SignalLength = 3 ); -private: +public: Uint32 senderData; Uint32 senderRef; Uint32 lockId; @@ -275,7 +275,7 @@ class UtilDestroyLockReq { public: STATIC_CONST( SignalLength = 4 ); -private: +public: Uint32 senderData; Uint32 senderRef; Uint32 lockId; @@ -303,7 +303,7 @@ public: STATIC_CONST( SignalLength = 4 ); -private: +public: Uint32 senderData; Uint32 senderRef; Uint32 lockId; @@ -325,7 +325,7 @@ class UtilDestroyLockConf { public: STATIC_CONST( SignalLength = 3 ); -private: +public: Uint32 senderData; Uint32 senderRef; Uint32 lockId; diff --git a/ndb/include/ndb_global.h.in b/ndb/include/ndb_global.h.in index d89bf9c29d2..e1169ded02b 100644 --- a/ndb/include/ndb_global.h.in +++ b/ndb/include/ndb_global.h.in @@ -16,8 +16,8 @@ #define snprintf _snprintf #define vsnprintf _vsnprintf #define HAVE_STRCASECMP -#define strcasecmp(a,b) _strcmpi(a,b) -#define strncasecmp(a,b) _strncmpi(a,b) +#define strcasecmp _strcmpi +#define strncasecmp _strncmpi #pragma warning(disable: 4503 4786) #else #undef NDB_WIN32 diff --git a/ndb/src/common/transporter/Transporter.cpp b/ndb/src/common/transporter/Transporter.cpp index e68bc86718e..ee25d97feef 100644 --- a/ndb/src/common/transporter/Transporter.cpp +++ b/ndb/src/common/transporter/Transporter.cpp @@ -95,7 +95,7 @@ Transporter::connect_client() { return true; NDB_SOCKET_TYPE sockfd = m_socket_client->connect(); - if (sockfd < 0) + if (sockfd == NDB_INVALID_SOCKET) return false; // send info about own id diff --git a/ndb/src/common/util/SocketClient.cpp b/ndb/src/common/util/SocketClient.cpp index 50e60956b94..38df1417eb8 100644 --- a/ndb/src/common/util/SocketClient.cpp +++ b/ndb/src/common/util/SocketClient.cpp @@ -26,14 +26,14 @@ SocketClient::SocketClient(const char *server_name, unsigned short port, SocketA m_auth= sa; m_port= port; m_server_name= strdup(server_name); - m_sockfd= -1; + m_sockfd= NDB_INVALID_SOCKET; } SocketClient::~SocketClient() { if (m_server_name) free(m_server_name); - if (m_sockfd >= 0) + if (m_sockfd != NDB_INVALID_SOCKET) NDB_CLOSE_SOCKET(m_sockfd); if (m_auth) delete m_auth; @@ -42,7 +42,7 @@ SocketClient::~SocketClient() bool SocketClient::init() { - if (m_sockfd >= 0) + if (m_sockfd != NDB_INVALID_SOCKET) NDB_CLOSE_SOCKET(m_sockfd); memset(&m_servaddr, 0, sizeof(m_servaddr)); @@ -63,32 +63,32 @@ SocketClient::init() NDB_SOCKET_TYPE SocketClient::connect() { - if (m_sockfd < 0) + if (m_sockfd == NDB_INVALID_SOCKET) { if (!init()) { #ifdef VM_TRACE ndbout << "SocketClient::connect() failed " << m_server_name << " " << m_port << endl; #endif - return -1; + return NDB_INVALID_SOCKET; } } const int r = ::connect(m_sockfd, (struct sockaddr*) &m_servaddr, sizeof(m_servaddr)); if (r == -1) { NDB_CLOSE_SOCKET(m_sockfd); - m_sockfd= -1; - return -1; + m_sockfd= NDB_INVALID_SOCKET; + return NDB_INVALID_SOCKET; } if (m_auth) { if (!m_auth->client_authenticate(m_sockfd)) { NDB_CLOSE_SOCKET(m_sockfd); - m_sockfd= -1; - return -1; + m_sockfd= NDB_INVALID_SOCKET; + return NDB_INVALID_SOCKET; } } NDB_SOCKET_TYPE sockfd= m_sockfd; - m_sockfd= -1; + m_sockfd= NDB_INVALID_SOCKET; return sockfd; } diff --git a/ndb/src/kernel/vm/Callback.hpp b/ndb/src/kernel/vm/Callback.hpp index bf1ae5968d3..6a619ba7859 100644 --- a/ndb/src/kernel/vm/Callback.hpp +++ b/ndb/src/kernel/vm/Callback.hpp @@ -20,12 +20,5 @@ /** * Block callbacks */ -typedef void (SimulatedBlock::* CallbackFunction)(class Signal*, - Uint32 callbackData, - Uint32 returnCode); -struct Callback { - CallbackFunction m_callbackFunction; - Uint32 m_callbackData; -}; #endif diff --git a/ndb/src/kernel/vm/Configuration.cpp b/ndb/src/kernel/vm/Configuration.cpp index 05a5aaf1c76..aecb5581d06 100644 --- a/ndb/src/kernel/vm/Configuration.cpp +++ b/ndb/src/kernel/vm/Configuration.cpp @@ -279,18 +279,18 @@ static char * get_and_validate_path(ndb_mgm_configuration_iterator &iter, #ifdef NDB_WIN32 char* szFilePart; if(!GetFullPathName(path, sizeof(buf2), buf2, &szFilePart) || - (GetFileAttributes(buf2) & FILE_ATTRIBUTE_READONLY)); + (GetFileAttributes(buf2) & FILE_ATTRIBUTE_READONLY)) #else if((::realpath(path, buf2) == NULL)|| (::access(buf2, W_OK) != 0)) #endif { - ERROR_SET(fatal, AFS_ERROR_INVALIDPATH, path, " Filename::init()"); - } - + ERROR_SET(fatal, AFS_ERROR_INVALIDPATH, path, " Filename::init()"); + } + if (strcmp(&buf2[strlen(buf2) - 1], DIR_SEPARATOR)) strcat(buf2, DIR_SEPARATOR); - + return strdup(buf2); } diff --git a/ndb/src/kernel/vm/Mutex.cpp b/ndb/src/kernel/vm/Mutex.cpp index 1dbc6e7ec4a..aab9e74312b 100644 --- a/ndb/src/kernel/vm/Mutex.cpp +++ b/ndb/src/kernel/vm/Mutex.cpp @@ -19,48 +19,51 @@ #include "Mutex.hpp" #include -MutexManager::MutexManager(class SimulatedBlock & block) +SimulatedBlock::MutexManager::MutexManager(class SimulatedBlock & block) : m_block(block), m_activeMutexes(m_mutexPool) { } bool -MutexManager::setSize(Uint32 maxNoOfActiveMutexes){ +SimulatedBlock::MutexManager::setSize(Uint32 maxNoOfActiveMutexes){ return m_mutexPool.setSize(maxNoOfActiveMutexes); } Uint32 -MutexManager::getSize() const { +SimulatedBlock::MutexManager::getSize() const { return m_mutexPool.getSize(); } bool -MutexManager::seize(ActiveMutexPtr& ptr){ +SimulatedBlock::MutexManager::seize(ActiveMutexPtr& ptr){ return m_activeMutexes.seize(ptr); } void -MutexManager::release(Uint32 activeMutexPtrI){ +SimulatedBlock::MutexManager::release(Uint32 activeMutexPtrI){ m_activeMutexes.release(activeMutexPtrI); } void -MutexManager::getPtr(ActiveMutexPtr& ptr){ +SimulatedBlock::MutexManager::getPtr(ActiveMutexPtr& ptr){ m_activeMutexes.getPtr(ptr); } BlockReference -MutexManager::reference() const { +SimulatedBlock::MutexManager::reference() const { return m_block.reference(); } void -MutexManager::progError(int line, int err_code, const char* extra) { +SimulatedBlock::MutexManager::progError(int line, + int err_code, + const char* extra) +{ m_block.progError(line, err_code, extra); } void -MutexManager::create(Signal* signal, ActiveMutexPtr& ptr){ +SimulatedBlock::MutexManager::create(Signal* signal, ActiveMutexPtr& ptr){ UtilCreateLockReq * req = (UtilCreateLockReq*)signal->getDataPtrSend(); req->senderData = ptr.i; @@ -78,7 +81,7 @@ MutexManager::create(Signal* signal, ActiveMutexPtr& ptr){ } void -MutexManager::execUTIL_CREATE_LOCK_REF(Signal* signal){ +SimulatedBlock::MutexManager::execUTIL_CREATE_LOCK_REF(Signal* signal){ UtilCreateLockRef * ref = (UtilCreateLockRef*)signal->getDataPtr(); ActiveMutexPtr ptr; @@ -91,7 +94,7 @@ MutexManager::execUTIL_CREATE_LOCK_REF(Signal* signal){ } void -MutexManager::execUTIL_CREATE_LOCK_CONF(Signal* signal){ +SimulatedBlock::MutexManager::execUTIL_CREATE_LOCK_CONF(Signal* signal){ UtilCreateLockConf * conf = (UtilCreateLockConf*)signal->getDataPtr(); ActiveMutexPtr ptr; @@ -105,7 +108,7 @@ MutexManager::execUTIL_CREATE_LOCK_CONF(Signal* signal){ void -MutexManager::destroy(Signal* signal, ActiveMutexPtr& ptr){ +SimulatedBlock::MutexManager::destroy(Signal* signal, ActiveMutexPtr& ptr){ UtilDestroyLockReq * req = (UtilDestroyLockReq*)signal->getDataPtrSend(); req->senderData = ptr.i; @@ -123,7 +126,7 @@ MutexManager::destroy(Signal* signal, ActiveMutexPtr& ptr){ } void -MutexManager::execUTIL_DESTORY_LOCK_REF(Signal* signal){ +SimulatedBlock::MutexManager::execUTIL_DESTORY_LOCK_REF(Signal* signal){ UtilDestroyLockRef * ref = (UtilDestroyLockRef*)signal->getDataPtr(); ActiveMutexPtr ptr; m_activeMutexes.getPtr(ptr, ref->senderData); @@ -135,7 +138,7 @@ MutexManager::execUTIL_DESTORY_LOCK_REF(Signal* signal){ } void -MutexManager::execUTIL_DESTORY_LOCK_CONF(Signal* signal){ +SimulatedBlock::MutexManager::execUTIL_DESTORY_LOCK_CONF(Signal* signal){ UtilDestroyLockConf * conf = (UtilDestroyLockConf*)signal->getDataPtr(); ActiveMutexPtr ptr; m_activeMutexes.getPtr(ptr, conf->senderData); @@ -148,7 +151,7 @@ MutexManager::execUTIL_DESTORY_LOCK_CONF(Signal* signal){ void -MutexManager::lock(Signal* signal, ActiveMutexPtr& ptr){ +SimulatedBlock::MutexManager::lock(Signal* signal, ActiveMutexPtr& ptr){ UtilLockReq * req = (UtilLockReq*)signal->getDataPtrSend(); req->senderData = ptr.i; @@ -166,7 +169,7 @@ MutexManager::lock(Signal* signal, ActiveMutexPtr& ptr){ } void -MutexManager::trylock(Signal* signal, ActiveMutexPtr& ptr){ +SimulatedBlock::MutexManager::trylock(Signal* signal, ActiveMutexPtr& ptr){ UtilLockReq * req = (UtilLockReq*)signal->getDataPtrSend(); req->senderData = ptr.i; @@ -184,7 +187,7 @@ MutexManager::trylock(Signal* signal, ActiveMutexPtr& ptr){ } void -MutexManager::execUTIL_LOCK_REF(Signal* signal){ +SimulatedBlock::MutexManager::execUTIL_LOCK_REF(Signal* signal){ UtilLockRef * ref = (UtilLockRef*)signal->getDataPtr(); ActiveMutexPtr ptr; m_activeMutexes.getPtr(ptr, ref->senderData); @@ -196,7 +199,7 @@ MutexManager::execUTIL_LOCK_REF(Signal* signal){ } void -MutexManager::execUTIL_LOCK_CONF(Signal* signal){ +SimulatedBlock::MutexManager::execUTIL_LOCK_CONF(Signal* signal){ UtilLockConf * conf = (UtilLockConf*)signal->getDataPtr(); ActiveMutexPtr ptr; m_activeMutexes.getPtr(ptr, conf->senderData); @@ -210,7 +213,7 @@ MutexManager::execUTIL_LOCK_CONF(Signal* signal){ } void -MutexManager::unlock(Signal* signal, ActiveMutexPtr& ptr){ +SimulatedBlock::MutexManager::unlock(Signal* signal, ActiveMutexPtr& ptr){ UtilUnlockReq * req = (UtilUnlockReq*)signal->getDataPtrSend(); req->senderData = ptr.i; req->senderRef = m_block.reference(); @@ -227,7 +230,7 @@ MutexManager::unlock(Signal* signal, ActiveMutexPtr& ptr){ } void -MutexManager::execUTIL_UNLOCK_REF(Signal* signal){ +SimulatedBlock::MutexManager::execUTIL_UNLOCK_REF(Signal* signal){ UtilUnlockRef * ref = (UtilUnlockRef*)signal->getDataPtr(); ActiveMutexPtr ptr; m_activeMutexes.getPtr(ptr, ref->senderData); @@ -239,7 +242,7 @@ MutexManager::execUTIL_UNLOCK_REF(Signal* signal){ } void -MutexManager::execUTIL_UNLOCK_CONF(Signal* signal){ +SimulatedBlock::MutexManager::execUTIL_UNLOCK_CONF(Signal* signal){ UtilUnlockConf * conf = (UtilUnlockConf*)signal->getDataPtr(); ActiveMutexPtr ptr; m_activeMutexes.getPtr(ptr, conf->senderData); @@ -251,8 +254,9 @@ MutexManager::execUTIL_UNLOCK_CONF(Signal* signal){ } void -Mutex::release(MutexManager& mgr, Uint32 activePtrI, Uint32 mutexId){ - MutexManager::ActiveMutexPtr ptr; +Mutex::release(SimulatedBlock::MutexManager& mgr, + Uint32 activePtrI, Uint32 mutexId){ + SimulatedBlock::MutexManager::ActiveMutexPtr ptr; ptr.i = activePtrI; mgr.getPtr(ptr); if(ptr.p->m_gsn == 0 && ptr.p->m_mutexId == mutexId){ @@ -272,7 +276,8 @@ Mutex::unlock(){ if(!m_ptr.isNull()){ m_mgr.getPtr(m_ptr); if(m_ptr.p->m_mutexId == m_mutexId){ - Callback c = { &SimulatedBlock::ignoreMutexUnlockCallback, m_ptr.i }; + SimulatedBlock::Callback c = + { &SimulatedBlock::ignoreMutexUnlockCallback, m_ptr.i }; m_ptr.p->m_callback = c; m_mgr.unlock(m_signal, m_ptr); m_ptr.setNull(); // Remove reference diff --git a/ndb/src/kernel/vm/Mutex.hpp b/ndb/src/kernel/vm/Mutex.hpp index 40e3fb56b4f..7a16046188c 100644 --- a/ndb/src/kernel/vm/Mutex.hpp +++ b/ndb/src/kernel/vm/Mutex.hpp @@ -22,63 +22,6 @@ class Mutex; -class MutexManager { - friend class Mutex; - friend class SimulatedBlock; - friend class DbUtil; -public: - MutexManager(class SimulatedBlock &); - - bool setSize(Uint32 maxNoOfActiveMutexes); - Uint32 getSize() const ; // Get maxNoOfActiveMutexes - -private: - /** - * core interface - */ - struct ActiveMutex { - Uint32 m_gsn; // state - Uint32 m_mutexId; - Uint32 m_mutexKey; - Callback m_callback; - union { - Uint32 nextPool; - Uint32 nextList; - }; - Uint32 prevList; - }; - typedef Ptr ActiveMutexPtr; - - bool seize(ActiveMutexPtr& ptr); - void release(Uint32 activeMutexPtrI); - - void getPtr(ActiveMutexPtr& ptr); - - void create(Signal*, ActiveMutexPtr&); - void destroy(Signal*, ActiveMutexPtr&); - void lock(Signal*, ActiveMutexPtr&); - void trylock(Signal*, ActiveMutexPtr&); - void unlock(Signal*, ActiveMutexPtr&); - -private: - void execUTIL_CREATE_LOCK_REF(Signal* signal); - void execUTIL_CREATE_LOCK_CONF(Signal* signal); - void execUTIL_DESTORY_LOCK_REF(Signal* signal); - void execUTIL_DESTORY_LOCK_CONF(Signal* signal); - void execUTIL_LOCK_REF(Signal* signal); - void execUTIL_LOCK_CONF(Signal* signal); - void execUTIL_UNLOCK_REF(Signal* signal); - void execUTIL_UNLOCK_CONF(Signal* signal); - - SimulatedBlock & m_block; - ArrayPool m_mutexPool; - DLList m_activeMutexes; - - BlockReference reference() const; - void progError(int line, int err_code, const char* extra = 0); -}; - - /** * MutexHandle - A "reference" to a mutex * - Should be used together with Mutex @@ -89,7 +32,7 @@ public: MutexHandle(Uint32 id); bool isNull() const; - void release(MutexManager & mgr); + void release(SimulatedBlock::MutexManager & mgr); private: const Uint32 m_mutexId; @@ -106,7 +49,7 @@ public: MutexHandle2(); bool isNull() const; - void release(MutexManager & mgr); + void release(SimulatedBlock::MutexManager & mgr); private: Uint32 m_activeMutexPtrI; @@ -117,33 +60,34 @@ private: */ class Mutex { public: - Mutex(Signal*, MutexManager & mgr, MutexHandle &); + Mutex(Signal*, SimulatedBlock::MutexManager & mgr, MutexHandle &); template - Mutex(Signal*, MutexManager & mgr, MutexHandle2 &); + Mutex(Signal*, SimulatedBlock::MutexManager & mgr, MutexHandle2 &); ~Mutex(); void release(); bool isNull() const ; - bool lock(Callback & callback); - bool trylock(Callback & callback); - void unlock(Callback & callback); + bool lock(SimulatedBlock::Callback & callback); + bool trylock(SimulatedBlock::Callback & callback); + void unlock(SimulatedBlock::Callback & callback); void unlock(); // Ignore callback - bool create(Callback & callback); - bool destroy(Callback & callback); + bool create(SimulatedBlock::Callback & callback); + bool destroy(SimulatedBlock::Callback & callback); private: Signal* m_signal; - MutexManager & m_mgr; + SimulatedBlock::MutexManager & m_mgr; const Uint32 m_mutexId; Uint32 & m_srcPtrI; - MutexManager::ActiveMutexPtr m_ptr; + SimulatedBlock::MutexManager::ActiveMutexPtr m_ptr; public: - static void release(MutexManager&, Uint32 activePtrI, Uint32 mutexId); + static void release(SimulatedBlock::MutexManager&, + Uint32 activePtrI, Uint32 mutexId); }; inline @@ -159,7 +103,7 @@ MutexHandle::isNull() const { inline void -MutexHandle::release(MutexManager & mgr){ +MutexHandle::release(SimulatedBlock::MutexManager & mgr){ if(!isNull()){ Mutex::release(mgr, m_activeMutexPtrI, m_mutexId); m_activeMutexPtrI = RNIL; @@ -183,7 +127,7 @@ MutexHandle2::isNull() const { template inline void -MutexHandle2::release(MutexManager & mgr){ +MutexHandle2::release(SimulatedBlock::MutexManager & mgr){ if(!isNull()){ Mutex::release(mgr, m_activeMutexPtrI, MutexId); m_activeMutexPtrI = RNIL; @@ -192,7 +136,8 @@ MutexHandle2::release(MutexManager & mgr){ inline -Mutex::Mutex(Signal* signal, MutexManager & mgr, MutexHandle & mh) +Mutex::Mutex(Signal* signal, SimulatedBlock::MutexManager & mgr, + MutexHandle & mh) : m_signal(signal), m_mgr(mgr), m_mutexId(mh.m_mutexId), @@ -204,7 +149,8 @@ Mutex::Mutex(Signal* signal, MutexManager & mgr, MutexHandle & mh) template inline -Mutex::Mutex(Signal* signal, MutexManager & mgr, MutexHandle2 & mh) +Mutex::Mutex(Signal* signal, SimulatedBlock::MutexManager & mgr, + MutexHandle2 & mh) : m_signal(signal), m_mgr(mgr), m_mutexId(MutexId), @@ -236,7 +182,7 @@ Mutex::isNull() const { inline bool -Mutex::lock(Callback & callback){ +Mutex::lock(SimulatedBlock::Callback & callback){ if(m_ptr.isNull()){ if(m_mgr.seize(m_ptr)){ m_ptr.p->m_mutexId = m_mutexId; @@ -253,7 +199,7 @@ Mutex::lock(Callback & callback){ inline bool -Mutex::trylock(Callback & callback){ +Mutex::trylock(SimulatedBlock::Callback & callback){ if(m_ptr.isNull()){ if(m_mgr.seize(m_ptr)){ m_ptr.p->m_mutexId = m_mutexId; @@ -270,7 +216,7 @@ Mutex::trylock(Callback & callback){ inline void -Mutex::unlock(Callback & callback){ +Mutex::unlock(SimulatedBlock::Callback & callback){ if(!m_ptr.isNull()){ m_mgr.getPtr(m_ptr); if(m_ptr.p->m_mutexId == m_mutexId){ @@ -285,7 +231,7 @@ Mutex::unlock(Callback & callback){ inline bool -Mutex::create(Callback & callback){ +Mutex::create(SimulatedBlock::Callback & callback){ if(m_ptr.isNull()){ if(m_mgr.seize(m_ptr)){ m_ptr.p->m_mutexId = m_mutexId; @@ -302,7 +248,7 @@ Mutex::create(Callback & callback){ inline bool -Mutex::destroy(Callback & callback){ +Mutex::destroy(SimulatedBlock::Callback & callback){ if(m_ptr.isNull()){ if(m_mgr.seize(m_ptr)){ m_ptr.p->m_mutexId = m_mutexId; diff --git a/ndb/src/kernel/vm/SectionReader.cpp b/ndb/src/kernel/vm/SectionReader.cpp index 9e1cbc855e6..dd474a49e50 100644 --- a/ndb/src/kernel/vm/SectionReader.cpp +++ b/ndb/src/kernel/vm/SectionReader.cpp @@ -26,7 +26,7 @@ #endif SectionReader::SectionReader -(class SegmentedSectionPtr & ptr, class SectionSegmentPool & pool) +(struct SegmentedSectionPtr & ptr, class SectionSegmentPool & pool) : m_pool(pool) { if(ptr.p == 0){ diff --git a/ndb/src/kernel/vm/SectionReader.hpp b/ndb/src/kernel/vm/SectionReader.hpp index 17eade24a66..b51006b6128 100644 --- a/ndb/src/kernel/vm/SectionReader.hpp +++ b/ndb/src/kernel/vm/SectionReader.hpp @@ -21,7 +21,7 @@ class SectionReader { public: - SectionReader(class SegmentedSectionPtr &, + SectionReader(struct SegmentedSectionPtr &, class SectionSegmentPool &); void reset(); diff --git a/ndb/src/kernel/vm/SimulatedBlock.cpp b/ndb/src/kernel/vm/SimulatedBlock.cpp index e6b97771d36..94fd5769406 100644 --- a/ndb/src/kernel/vm/SimulatedBlock.cpp +++ b/ndb/src/kernel/vm/SimulatedBlock.cpp @@ -1598,7 +1598,7 @@ SimulatedBlock::sendFragmentedSignal(NodeReceiverGroup rg, } } -Callback SimulatedBlock::TheEmptyCallback = {0, 0}; +SimulatedBlock::Callback SimulatedBlock::TheEmptyCallback = {0, 0}; void SimulatedBlock::sendFragmentedSignal(BlockReference ref, diff --git a/ndb/src/kernel/vm/SimulatedBlock.hpp b/ndb/src/kernel/vm/SimulatedBlock.hpp index 7972cb39746..fd59fef49db 100644 --- a/ndb/src/kernel/vm/SimulatedBlock.hpp +++ b/ndb/src/kernel/vm/SimulatedBlock.hpp @@ -41,7 +41,6 @@ #include "ArrayPool.hpp" #include "DLHashTable.hpp" #include "Callback.hpp" -#include "Mutex.hpp" #include "SafeCounter.hpp" #include "MetaData.hpp" @@ -104,6 +103,14 @@ public: * */ inline void executeFunction(GlobalSignalNumber gsn, Signal* signal); +public: + typedef void (SimulatedBlock::* CallbackFunction)(class Signal*, + Uint32 callbackData, + Uint32 returnCode); + struct Callback { + CallbackFunction m_callbackFunction; + Uint32 m_callbackData; + }; protected: static Callback TheEmptyCallback; void execute(Signal* signal, Callback & c, Uint32 returnCode); @@ -405,7 +412,63 @@ private: DLList c_linearFragmentSendList; DLList c_segmentedFragmentSendList; -public: +public: + class MutexManager { + friend class Mutex; + friend class SimulatedBlock; + friend class DbUtil; + public: + MutexManager(class SimulatedBlock &); + + bool setSize(Uint32 maxNoOfActiveMutexes); + Uint32 getSize() const ; // Get maxNoOfActiveMutexes + + private: + /** + * core interface + */ + struct ActiveMutex { + Uint32 m_gsn; // state + Uint32 m_mutexId; + Uint32 m_mutexKey; + Callback m_callback; + union { + Uint32 nextPool; + Uint32 nextList; + }; + Uint32 prevList; + }; + typedef Ptr ActiveMutexPtr; + + bool seize(ActiveMutexPtr& ptr); + void release(Uint32 activeMutexPtrI); + + void getPtr(ActiveMutexPtr& ptr); + + void create(Signal*, ActiveMutexPtr&); + void destroy(Signal*, ActiveMutexPtr&); + void lock(Signal*, ActiveMutexPtr&); + void trylock(Signal*, ActiveMutexPtr&); + void unlock(Signal*, ActiveMutexPtr&); + + private: + void execUTIL_CREATE_LOCK_REF(Signal* signal); + void execUTIL_CREATE_LOCK_CONF(Signal* signal); + void execUTIL_DESTORY_LOCK_REF(Signal* signal); + void execUTIL_DESTORY_LOCK_CONF(Signal* signal); + void execUTIL_LOCK_REF(Signal* signal); + void execUTIL_LOCK_CONF(Signal* signal); + void execUTIL_UNLOCK_REF(Signal* signal); + void execUTIL_UNLOCK_CONF(Signal* signal); + + SimulatedBlock & m_block; + ArrayPool m_mutexPool; + DLList m_activeMutexes; + + BlockReference reference() const; + void progError(int line, int err_code, const char* extra = 0); + }; + MutexManager c_mutexMgr; void ignoreMutexUnlockCallback(Signal* signal, Uint32 ptrI, Uint32 retVal); @@ -688,5 +751,7 @@ BLOCK::addRecSignal(GlobalSignalNumber gsn, ExecSignalLocal f, bool force){ \ addRecSignalImpl(gsn, (ExecFunction)f, force);\ } +#include "Mutex.hpp" + #endif diff --git a/ndb/src/mgmclient/Makefile.am b/ndb/src/mgmclient/Makefile.am index 88bd3c4f529..e4242b4cd80 100644 --- a/ndb/src/mgmclient/Makefile.am +++ b/ndb/src/mgmclient/Makefile.am @@ -24,4 +24,28 @@ ndb_mgm_LDFLAGS = @ndb_bin_am_ldflags@ # Don't update the files from bitkeeper %::SCCS/s.% -windoze-dsp: +windoze-dsp: ndb_mgm.dsp libndbmgmclient.dsp + +ndb_mgm.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-prg.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-prg.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(ndbtools_PROGRAMS) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(ndb_mgm_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ LINK $(LDADD) + +libndbmgmclient.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-lib.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-lib.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LTLIBRARIES) + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(libndbmgmclient_la_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB diff --git a/ndb/test/src/Makefile.am b/ndb/test/src/Makefile.am index 53a1df04c62..289633b060a 100644 --- a/ndb/test/src/Makefile.am +++ b/ndb/test/src/Makefile.am @@ -32,4 +32,4 @@ libNDBT.dsp: Makefile \ @$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES) @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) @$(top_srcdir)/ndb/config/win-sources $@ $(libNDBT_a_SOURCES) - @$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD) + @$(top_srcdir)/ndb/config/win-libraries $@ LIB From fe37a1472c22b0a48244b932664925cad68f3e96 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 15 Nov 2004 12:20:05 +0000 Subject: [PATCH 0218/1063] always let traffic through to api cluster manager in transporter print some info event on api connects with wrong versions BitKeeper/deleted/.del-Makefile.am~91c159ff4011609: Delete: ndb/tools/restore/Makefile.am ndb/src/common/transporter/TransporterRegistry.cpp: let traffic through to api cluster manager as well ndb/src/kernel/blocks/qmgr/QmgrMain.cpp: print some info event on api connects with wrong versions --- .../common/transporter/TransporterRegistry.cpp | 12 +++++++----- ndb/src/kernel/blocks/qmgr/QmgrMain.cpp | 14 ++++++++++++-- ndb/tools/restore/Makefile.am | 16 ---------------- 3 files changed, 19 insertions(+), 23 deletions(-) delete mode 100644 ndb/tools/restore/Makefile.am diff --git a/ndb/src/common/transporter/TransporterRegistry.cpp b/ndb/src/common/transporter/TransporterRegistry.cpp index cacbbed00f1..a2fab8f9806 100644 --- a/ndb/src/common/transporter/TransporterRegistry.cpp +++ b/ndb/src/common/transporter/TransporterRegistry.cpp @@ -467,8 +467,9 @@ TransporterRegistry::prepareSend(const SignalHeader * const signalHeader, Transporter *t = theTransporters[nodeId]; if(t != NULL && (((ioStates[nodeId] != HaltOutput) && (ioStates[nodeId] != HaltIO)) || - (signalHeader->theReceiversBlockNumber == 252))) { - + ((signalHeader->theReceiversBlockNumber == 252) || + (signalHeader->theReceiversBlockNumber == 4002)))) { + if(t->isConnected()){ Uint32 lenBytes = t->m_packer.getMessageLength(signalHeader, ptr); if(lenBytes <= MAX_MESSAGE_SIZE){ @@ -538,8 +539,9 @@ TransporterRegistry::prepareSend(const SignalHeader * const signalHeader, Transporter *t = theTransporters[nodeId]; if(t != NULL && (((ioStates[nodeId] != HaltOutput) && (ioStates[nodeId] != HaltIO)) || - (signalHeader->theReceiversBlockNumber == 252))) { - + ((signalHeader->theReceiversBlockNumber == 252)|| + (signalHeader->theReceiversBlockNumber == 4002)))) { + if(t->isConnected()){ Uint32 lenBytes = t->m_packer.getMessageLength(signalHeader, ptr); if(lenBytes <= MAX_MESSAGE_SIZE){ @@ -550,7 +552,7 @@ TransporterRegistry::prepareSend(const SignalHeader * const signalHeader, return SEND_OK; } - + /** * @note: on linux/i386 the granularity is 10ms * so sleepTime = 2 generates a 10 ms sleep. diff --git a/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp b/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp index 41deb3403c8..a433d72744e 100644 --- a/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp +++ b/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp @@ -1934,17 +1934,27 @@ void Qmgr::execAPI_REGREQ(Signal* signal) switch(getNodeInfo(apiNodePtr.i).getType()){ case NodeInfo::API: compatability_check = ndbCompatible_ndb_api(NDB_VERSION, version); + if (!compatability_check) + infoEvent("Connection attempt from api or mysqld id=%d with %s " + "incompatible with %s", apiNodePtr.i, + getVersionString(version,""), NDB_VERSION_STRING); break; case NodeInfo::MGM: compatability_check = ndbCompatible_ndb_mgmt(NDB_VERSION, version); + if (!compatability_check) + infoEvent("Connection attempt from management server id=%d with %s " + "incompatible with %s", apiNodePtr.i, + getVersionString(version,""), NDB_VERSION_STRING); break; case NodeInfo::REP: - compatability_check = ndbCompatible_ndb_api(NDB_VERSION, version); - break; + // compatability_check = ndbCompatible_ndb_api(NDB_VERSION, version); + // break; case NodeInfo::DB: case NodeInfo::INVALID: default: sendApiRegRef(signal, ref, ApiRegRef::WrongType); + infoEvent("Invalid connection attempt with type %d", + getNodeInfo(apiNodePtr.i).getType()); return; } diff --git a/ndb/tools/restore/Makefile.am b/ndb/tools/restore/Makefile.am deleted file mode 100644 index 16550f13546..00000000000 --- a/ndb/tools/restore/Makefile.am +++ /dev/null @@ -1,16 +0,0 @@ - -ndbtools_PROGRAMS = ndb_restore - -ndb_restore_SOURCES = main.cpp consumer.cpp consumer_restore.cpp consumer_printer.cpp Restore.cpp - -LDADD_LOC = \ - $(top_builddir)/ndb/src/libndbclient.la \ - $(top_builddir)/dbug/libdbug.a \ - $(top_builddir)/mysys/libmysys.a \ - $(top_builddir)/strings/libmystrings.a @NDB_SCI_LIBS@ - -include $(top_srcdir)/ndb/config/common.mk.am - -INCLUDES += -I.. -I$(top_srcdir)/include -I$(top_srcdir)/ndb/include -I$(top_srcdir)/ndb/src/ndbapi -I$(top_srcdir)/ndb/include/ndbapi -I$(top_srcdir)/ndb/include/util -I$(top_srcdir)/ndb/include/portlib -I$(top_srcdir)/ndb/include/kernel - -ndb_restore_LDFLAGS = @ndb_bin_am_ldflags@ From b685909d6a9e928885ee3e8fb266077718660f3e Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 15 Nov 2004 14:37:40 +0200 Subject: [PATCH 0219/1063] moved procedure list initialization (BUG#6517) mysql-test/r/subselect.result: Subselect in non-select command just after connection mysql-test/t/subselect.test: Subselect in non-select command just after connection sql/sql_lex.cc: moved procedure initialization sql/sql_parse.cc: moved procedure initialization --- mysql-test/r/subselect.result | 1 + mysql-test/t/subselect.test | 7 +++++++ sql/sql_lex.cc | 1 + sql/sql_parse.cc | 1 - 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index 32d482f5a32..9c8a237468a 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -1990,3 +1990,4 @@ ac 700 NULL drop tables t1,t2; +set @got_val= (SELECT 1 FROM (SELECT 'A' as my_col) as T1 ) ; diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test index e0f6fcbf515..19803f6e3ba 100644 --- a/mysql-test/t/subselect.test +++ b/mysql-test/t/subselect.test @@ -1282,3 +1282,10 @@ INSERT INTO `t2` VALUES (6,5,12,7,'a'),(12,0,0,7,'a'),(12,1,0,7,'a'),(12,5,5,7,' SELECT b.sc FROM (SELECT (SELECT a.access FROM t1 a WHERE a.map = op.map AND a.slave = op.pid AND a.master = 1) ac FROM t2 op WHERE op.id = 12 AND op.map = 0) b; SELECT b.ac FROM (SELECT (SELECT a.access FROM t1 a WHERE a.map = op.map AND a.slave = op.pid AND a.master = 1) ac FROM t2 op WHERE op.id = 12 AND op.map = 0) b; drop tables t1,t2; + +# +# Subselect in non-select command just after connection +# +connect (root,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK); +connection root; +set @got_val= (SELECT 1 FROM (SELECT 'A' as my_col) as T1 ) ; diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index 679ffb2140e..b5cb8735875 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -157,6 +157,7 @@ void lex_start(THD *thd, uchar *buf,uint length) lex->ignore_space=test(thd->variables.sql_mode & MODE_IGNORE_SPACE); lex->sql_command=SQLCOM_END; lex->duplicates= DUP_ERROR; + lex->proc_list.first= 0; } void lex_end(LEX *lex) diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 7420f9de100..078333c9552 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -3940,7 +3940,6 @@ mysql_init_select(LEX *lex) { DBUG_ASSERT(lex->result == 0); lex->exchange= 0; - lex->proc_list.first= 0; } } From 595d467d0c8052c507894fce843a39fdca3070ce Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 15 Nov 2004 12:40:32 +0000 Subject: [PATCH 0220/1063] changed compile order, mysqladmin with ndbcluster extensions needs ndb to be compiled first added libs variable for ndbmgmclient used by mysqladmin add linkage with @ndb_mgmclient_libs@ additional options for ndbcluster added support for managing the cluster to mysqladmin added DEFINE_CXA_PURE_VIRTUAL flag to CFLAGS to enable linkage with c++ libs use macros for C_MODE_START/END so that define of FIX_GCC_LINKING_PROBLEM works in c-programs Makefile.am: changed compile order, mysqladming with ndbcluster extensions needs ndb to be compiled first acinclude.m4: added libs variable for ndbmgmclient used by mysqladmin client/Makefile.am: add linkage with @ndb_mgmclient_libs@ client/client_priv.h: additional options for ndbcluster client/mysqladmin.c: added support for managing the cluster to mysqladmin configure.in: added DEFINE_CXA_PURE_VIRTUAL flag to CFLAGS to enable linkage with c++ libs include/my_global.h: use macros for C_MODE_START/END so that define of FIX_GCC_LINKING_PROBLEM works in c-programs --- Makefile.am | 8 ++++---- acinclude.m4 | 3 +++ client/Makefile.am | 3 ++- client/client_priv.h | 3 +++ client/mysqladmin.c | 47 +++++++++++++++++++++++++++++++++++++++++++- configure.in | 1 + include/my_global.h | 4 ++-- 7 files changed, 61 insertions(+), 8 deletions(-) diff --git a/Makefile.am b/Makefile.am index 0dbb5032e15..0770854f176 100644 --- a/Makefile.am +++ b/Makefile.am @@ -22,15 +22,15 @@ AUTOMAKE_OPTIONS = foreign EXTRA_DIST = INSTALL-SOURCE README COPYING EXCEPTIONS-CLIENT SUBDIRS = . include @docs_dirs@ @zlib_dir@ \ @readline_topdir@ sql-common \ - @thread_dirs@ pstack @sql_client_dirs@ \ - @sql_server_dirs@ scripts man tests \ + @thread_dirs@ pstack \ + @sql_server_dirs@ @sql_client_dirs@ scripts man tests \ netware @libmysqld_dirs@ \ @bench_dirs@ support-files @fs_dirs@ @tools_dirs@ DIST_SUBDIRS = . include @docs_dirs@ zlib \ @readline_topdir@ sql-common \ - @thread_dirs@ pstack @sql_client_dirs@ \ - @sql_server_dirs@ scripts @man_dirs@ tests SSL\ + @thread_dirs@ pstack \ + @sql_server_dirs@ @sql_client_dirs@ scripts @man_dirs@ tests SSL\ BUILD netware os2 @libmysqld_dirs@ \ @bench_dirs@ support-files @fs_dirs@ @tools_dirs@ diff --git a/acinclude.m4 b/acinclude.m4 index 448bf7a2653..81917372206 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -1678,6 +1678,7 @@ AC_DEFUN([MYSQL_CHECK_NDBCLUSTER], [ have_ndbcluster=no ndbcluster_includes= ndbcluster_libs= + ndb_mgmclient_libs= case "$ndbcluster" in yes ) AC_MSG_RESULT([Using NDB Cluster]) @@ -1686,6 +1687,7 @@ AC_DEFUN([MYSQL_CHECK_NDBCLUSTER], [ ndbcluster_includes="-I../ndb/include -I../ndb/include/ndbapi" ndbcluster_libs="\$(top_builddir)/ndb/src/.libs/libndbclient.a" ndbcluster_system_libs="" + ndb_mgmclient_libs="\$(top_builddir)/ndb/src/mgmclient/libndbmgmclient.la" MYSQL_CHECK_NDB_OPTIONS ;; * ) @@ -1697,6 +1699,7 @@ AC_DEFUN([MYSQL_CHECK_NDBCLUSTER], [ AC_SUBST(ndbcluster_includes) AC_SUBST(ndbcluster_libs) AC_SUBST(ndbcluster_system_libs) + AC_SUBST(ndb_mgmclient_libs) ]) dnl --------------------------------------------------------------------------- diff --git a/client/Makefile.am b/client/Makefile.am index a9da284a753..58398548b75 100644 --- a/client/Makefile.am +++ b/client/Makefile.am @@ -20,7 +20,8 @@ INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/regex \ $(openssl_includes) LIBS = @CLIENT_LIBS@ -DEPLIB= ../libmysql/libmysqlclient.la +DEPLIB= ../libmysql/libmysqlclient.la \ + @ndb_mgmclient_libs@ LDADD = @CLIENT_EXTRA_LDFLAGS@ $(DEPLIB) bin_PROGRAMS = mysql mysqladmin mysqlcheck mysqlshow \ mysqldump mysqlimport mysqltest mysqlbinlog mysqlmanagerc mysqlmanager-pwgen diff --git a/client/client_priv.h b/client/client_priv.h index f16ec0e802b..184eed241ed 100644 --- a/client/client_priv.h +++ b/client/client_priv.h @@ -46,4 +46,7 @@ enum options_client OPT_OPEN_FILES_LIMIT, OPT_SET_CHARSET, OPT_CREATE_OPTIONS, OPT_START_POSITION, OPT_STOP_POSITION, OPT_START_DATETIME, OPT_STOP_DATETIME, OPT_SIGINT_IGNORE, OPT_HEXBLOB +#ifdef HAVE_NDBCLUSTER_DB + ,OPT_NDBCLUSTER,OPT_NDB_CONNECTSTRING +#endif }; diff --git a/client/mysqladmin.c b/client/mysqladmin.c index 6258b9685a5..a32dfa14d28 100644 --- a/client/mysqladmin.c +++ b/client/mysqladmin.c @@ -16,7 +16,6 @@ /* maintaince of mysql databases */ - #include "client_priv.h" #include #ifdef THREAD @@ -25,6 +24,10 @@ #include #include +#ifdef HAVE_NDBCLUSTER_DB +#include "../ndb/src/mgmclient/ndb_mgmclient.h" +#endif + #define ADMIN_VERSION "8.41" #define MAX_MYSQL_VAR 256 #define SHUTDOWN_DEF_TIMEOUT 3600 /* Wait for shutdown */ @@ -42,6 +45,10 @@ static uint tcp_port = 0, option_wait = 0, option_silent=0, nr_iterations, opt_count_iterations= 0; static ulong opt_connect_timeout, opt_shutdown_timeout; static my_string unix_port=0; +#ifdef HAVE_NDBCLUSTER_DB +static my_bool opt_ndbcluster=0; +static char *opt_ndb_connectstring=0; +#endif #ifdef HAVE_SMEM static char *shared_memory_base_name=0; @@ -94,6 +101,9 @@ enum commands { ADMIN_PING, ADMIN_EXTENDED_STATUS, ADMIN_FLUSH_STATUS, ADMIN_FLUSH_PRIVILEGES, ADMIN_START_SLAVE, ADMIN_STOP_SLAVE, ADMIN_FLUSH_THREADS, ADMIN_OLD_PASSWORD +#ifdef HAVE_NDBCLUSTER_DB + ,ADMIN_NDB_MGM +#endif }; static const char *command_names[]= { "create", "drop", "shutdown", @@ -104,6 +114,9 @@ static const char *command_names[]= { "ping", "extended-status", "flush-status", "flush-privileges", "start-slave", "stop-slave", "flush-threads","old-password", +#ifdef HAVE_NDBCLUSTER_DB + "ndb-mgm", +#endif NullS }; @@ -184,6 +197,14 @@ static struct my_option my_long_options[] = {"shutdown_timeout", OPT_SHUTDOWN_TIMEOUT, "", (gptr*) &opt_shutdown_timeout, (gptr*) &opt_shutdown_timeout, 0, GET_ULONG, REQUIRED_ARG, SHUTDOWN_DEF_TIMEOUT, 0, 3600*12, 0, 1, 0}, +#ifdef HAVE_NDBCLUSTER_DB + {"ndbcluster", OPT_NDBCLUSTER, "" + "", (gptr*) &opt_ndbcluster, + (gptr*) &opt_ndbcluster, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"ndb-connectstring", OPT_NDB_CONNECTSTRING, "" + "", (gptr*) &opt_ndb_connectstring, + (gptr*) &opt_ndb_connectstring, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, +#endif { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} }; @@ -882,6 +903,24 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv) } mysql->reconnect=1; /* Automatic reconnect is default */ break; +#ifdef HAVE_NDBCLUSTER_DB + case ADMIN_NDB_MGM: + { + if (argc < 2) + { + my_printf_error(0,"Too few arguments to ndb-mgm",MYF(ME_BELL)); + return 1; + } + { + Ndb_mgmclient_handle cmd= + ndb_mgmclient_handle_create(opt_ndb_connectstring); + ndb_mgmclient_execute(cmd, --argc, ++argv); + ndb_mgmclient_handle_destroy(cmd); + } + argc= 0; + } + break; +#endif default: my_printf_error(0,"Unknown command: '%-.60s'",MYF(ME_BELL),argv[0]); return 1; @@ -1248,3 +1287,9 @@ static my_bool wait_pidfile(char *pidfile, time_t last_modified, } DBUG_RETURN(error); } +#ifdef HAVE_NDBCLUSTER_DB +/* lib linked in contains c++ code */ +#ifdef __GNUC__ +FIX_GCC_LINKING_PROBLEM +#endif +#endif diff --git a/configure.in b/configure.in index 1fcba6b8f5f..f360ee46453 100644 --- a/configure.in +++ b/configure.in @@ -399,6 +399,7 @@ then then if $CXX -v 2>&1 | grep 'version 3' > /dev/null 2>&1 then + CFLAGS="$CFLAGS -DDEFINE_CXA_PURE_VIRTUAL" CXXFLAGS="$CXXFLAGS -DUSE_MYSYS_NEW -DDEFINE_CXA_PURE_VIRTUAL" fi fi diff --git a/include/my_global.h b/include/my_global.h index 07d4d8dc1cc..ff59f7bfc55 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -194,10 +194,10 @@ C_MODE_END /* Fix problem when linking c++ programs with gcc 3.x */ #ifdef DEFINE_CXA_PURE_VIRTUAL #define FIX_GCC_LINKING_PROBLEM \ -extern "C" { int __cxa_pure_virtual() {\ +C_MODE_START int __cxa_pure_virtual() {\ DBUG_ASSERT("Pure virtual method called." == "Aborted");\ return 0;\ -} } +} C_MODE_END #else #define FIX_GCC_LINKING_PROBLEM #endif From 5d9f7edd6dfb0d6759a5374ac61c0153db48b1f7 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 15 Nov 2004 15:44:29 +0300 Subject: [PATCH 0221/1063] Fix for bug #6266 "Invalid DATETIME value is not handled properly". In server we assume that datetime values stored in MYSQL_TIME struct are normalized (and year is not greater than 9999), so we should perform range checks in all places then we convert something to MYSQL_TIME. include/my_time.h: Added one more argument to set_zero_time() function to make it more convinient. Added comment clarifying why MAX_DATE_STRING_REP_LENGTH value is 30. include/mysql_time.h: Documented MySQL's internal assumptions for members of MYSQL_TIME structure. libmysql/libmysql.c: It does not make sense to set MYSQL_TIME::time_type twice in case of errors. mysql-test/r/type_datetime.result: Added test for bug #6266 "Invalid DATETIME value not handled properly". mysql-test/t/type_datetime.test: Added test for bug #6266 "Invalid DATETIME value not handled properly". sql-common/my_time.c: str_to_datetime(): Added missing check for too big year values. set_zero_time(): added time_type argument, since MYSQL_TIMESTAMP_NONE is not the value that we want in most cases. sql/field.cc: Field_datetime::store_time(): clarified why we don't perform any range checks here. sql/item.cc: Item_param::set_time(): Added comment describing this method and range checking for TIME values. sql/sql_prepare.cc: Removed comments about range checking for TIME values in prepared statements, which are no longer true. set_zero_time() has one more argument now. tests/client_test.c: Added test for bug #6266 "Invalid DATETIME value not handled properly" --- include/my_time.h | 5 +- include/mysql_time.h | 12 +++ libmysql/libmysql.c | 13 +-- mysql-test/r/type_datetime.result | 11 ++- mysql-test/t/type_datetime.test | 7 +- sql-common/my_time.c | 7 +- sql/field.cc | 4 + sql/item.cc | 26 ++++++ sql/sql_prepare.cc | 23 +---- tests/client_test.c | 135 ++++++++++++++++++++++++++++++ 10 files changed, 209 insertions(+), 34 deletions(-) diff --git a/include/my_time.h b/include/my_time.h index dab17904b2d..94701e159c4 100644 --- a/include/my_time.h +++ b/include/my_time.h @@ -58,14 +58,15 @@ void init_time(void); my_time_t my_system_gmt_sec(const MYSQL_TIME *t, long *my_timezone, bool *in_dst_time_gap); -void set_zero_time(MYSQL_TIME *tm); +void set_zero_time(MYSQL_TIME *tm, enum enum_mysql_timestamp_type time_type); /* Required buffer length for my_time_to_str, my_date_to_str, my_datetime_to_str and TIME_to_string functions. Note, that the caller is still responsible to check that given TIME structure has values in valid ranges, otherwise size of the buffer could - be not enough. + be not enough. We also rely on the fact that even wrong values + sent using binary protocol fit in this buffer. */ #define MAX_DATE_STRING_REP_LENGTH 30 diff --git a/include/mysql_time.h b/include/mysql_time.h index ec67d60dea5..5f4fc12c005 100644 --- a/include/mysql_time.h +++ b/include/mysql_time.h @@ -33,6 +33,18 @@ enum enum_mysql_timestamp_type }; +/* + Structure which is used to represent datetime values inside MySQL. + + We assume that values in this structure are normalized, i.e. year <= 9999, + month <= 12, day <= 31, hour <= 23, hour <= 59, hour <= 59. Many functions + in server such as my_system_gmt_sec() or make_time() family of functions + rely on this (actually now usage of make_*() family relies on a bit weaker + restriction). Also functions that produce MYSQL_TIME as result ensure this. + There is one exception to this rule though if this structure holds time + value (time_type == MYSQL_TIMESTAMP_TIME) days and hour member can hold + bigger values. +*/ typedef struct st_mysql_time { unsigned int year, month, day, hour, minute, second; diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index 88f46ce19e7..bfbfd9670ca 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -3256,11 +3256,12 @@ static void read_binary_time(MYSQL_TIME *tm, uchar **pos) tm->hour+= tm->day*24; tm->day= 0; } + tm->time_type= MYSQL_TIMESTAMP_TIME; + *pos+= length; } else - set_zero_time(tm); - tm->time_type= MYSQL_TIMESTAMP_TIME; + set_zero_time(tm, MYSQL_TIMESTAMP_TIME); } static void read_binary_datetime(MYSQL_TIME *tm, uchar **pos) @@ -3285,12 +3286,12 @@ static void read_binary_datetime(MYSQL_TIME *tm, uchar **pos) else tm->hour= tm->minute= tm->second= 0; tm->second_part= (length > 7) ? (ulong) sint4korr(to+7) : 0; + tm->time_type= MYSQL_TIMESTAMP_DATETIME; *pos+= length; } else - set_zero_time(tm); - tm->time_type= MYSQL_TIMESTAMP_DATETIME; + set_zero_time(tm, MYSQL_TIMESTAMP_DATETIME); } static void read_binary_date(MYSQL_TIME *tm, uchar **pos) @@ -3307,12 +3308,12 @@ static void read_binary_date(MYSQL_TIME *tm, uchar **pos) tm->hour= tm->minute= tm->second= 0; tm->second_part= 0; tm->neg= 0; + tm->time_type= MYSQL_TIMESTAMP_DATE; *pos+= length; } else - set_zero_time(tm); - tm->time_type= MYSQL_TIMESTAMP_DATE; + set_zero_time(tm, MYSQL_TIMESTAMP_DATE); } diff --git a/mysql-test/r/type_datetime.result b/mysql-test/r/type_datetime.result index 524bc9c50d4..127a54e087b 100644 --- a/mysql-test/r/type_datetime.result +++ b/mysql-test/r/type_datetime.result @@ -97,13 +97,15 @@ select * from t1 where a is null or b is null; a b drop table t1; create table t1 (t datetime); -insert into t1 values (20030102030460),(20030102036301),(20030102240401),(20030132030401),(20031302030460); +insert into t1 values (20030102030460),(20030102036301),(20030102240401), +(20030132030401),(20031302030401),(100001202030401); Warnings: Warning 1265 Data truncated for column 't' at row 1 Warning 1265 Data truncated for column 't' at row 2 Warning 1265 Data truncated for column 't' at row 3 Warning 1265 Data truncated for column 't' at row 4 Warning 1265 Data truncated for column 't' at row 5 +Warning 1265 Data truncated for column 't' at row 6 select * from t1; t 0000-00-00 00:00:00 @@ -111,14 +113,18 @@ t 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 +0000-00-00 00:00:00 delete from t1; -insert into t1 values ("20030102030460"),("20030102036301"),("20030102240401"),("20030132030401"),("20031302030460"); +insert into t1 values +("2003-01-02 03:04:60"),("2003-01-02 03:63:01"),("2003-01-02 24:04:01"), +("2003-01-32 03:04:01"),("2003-13-02 03:04:01"), ("10000-12-02 03:04:00"); Warnings: Warning 1264 Data truncated; out of range for column 't' at row 1 Warning 1264 Data truncated; out of range for column 't' at row 2 Warning 1264 Data truncated; out of range for column 't' at row 3 Warning 1264 Data truncated; out of range for column 't' at row 4 Warning 1264 Data truncated; out of range for column 't' at row 5 +Warning 1264 Data truncated; out of range for column 't' at row 6 select * from t1; t 0000-00-00 00:00:00 @@ -126,6 +132,7 @@ t 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 +0000-00-00 00:00:00 delete from t1; insert into t1 values ("0000-00-00 00:00:00 some trailer"),("2003-01-01 00:00:00 some trailer"); Warnings: diff --git a/mysql-test/t/type_datetime.test b/mysql-test/t/type_datetime.test index 47866058524..04e4a73554a 100644 --- a/mysql-test/t/type_datetime.test +++ b/mysql-test/t/type_datetime.test @@ -77,10 +77,13 @@ drop table t1; # warnings (for both strings and numbers) # create table t1 (t datetime); -insert into t1 values (20030102030460),(20030102036301),(20030102240401),(20030132030401),(20031302030460); +insert into t1 values (20030102030460),(20030102036301),(20030102240401), + (20030132030401),(20031302030401),(100001202030401); select * from t1; delete from t1; -insert into t1 values ("20030102030460"),("20030102036301"),("20030102240401"),("20030132030401"),("20031302030460"); +insert into t1 values + ("2003-01-02 03:04:60"),("2003-01-02 03:63:01"),("2003-01-02 24:04:01"), + ("2003-01-32 03:04:01"),("2003-13-02 03:04:01"), ("10000-12-02 03:04:00"); select * from t1; delete from t1; insert into t1 values ("0000-00-00 00:00:00 some trailer"),("2003-01-01 00:00:00 some trailer"); diff --git a/sql-common/my_time.c b/sql-common/my_time.c index 6c020466e1e..6b305944154 100644 --- a/sql-common/my_time.c +++ b/sql-common/my_time.c @@ -343,7 +343,8 @@ str_to_datetime(const char *str, uint length, MYSQL_TIME *l_time, (l_time->month || l_time->day)) l_time->year+= (l_time->year < YY_PART_YEAR ? 2000 : 1900); - if (number_of_fields < 3 || l_time->month > 12 || + if (number_of_fields < 3 || + l_time->year > 9999 || l_time->month > 12 || l_time->day > 31 || l_time->hour > 23 || l_time->minute > 59 || l_time->second > 59 || (!(flags & TIME_FUZZY_DATE) && (l_time->month == 0 || l_time->day == 0))) @@ -720,10 +721,10 @@ my_system_gmt_sec(const MYSQL_TIME *t, long *my_timezone, bool *in_dst_time_gap) /* Set MYSQL_TIME structure to 0000-00-00 00:00:00.000000 */ -void set_zero_time(MYSQL_TIME *tm) +void set_zero_time(MYSQL_TIME *tm, enum enum_mysql_timestamp_type time_type) { bzero((void*) tm, sizeof(*tm)); - tm->time_type= MYSQL_TIMESTAMP_NONE; + tm->time_type= time_type; } diff --git a/sql/field.cc b/sql/field.cc index 24bd0c48c92..7d1627ef521 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -4086,6 +4086,10 @@ int Field_datetime::store(longlong nr) void Field_datetime::store_time(TIME *ltime,timestamp_type type) { longlong tmp; + /* + We don't perform range checking here since values stored in TIME + structure always fit into DATETIME range. + */ if (type == MYSQL_TIMESTAMP_DATE || type == MYSQL_TIMESTAMP_DATETIME) tmp=((ltime->year*10000L+ltime->month*100+ltime->day)*LL(1000000)+ (ltime->hour*10000L+ltime->minute*100+ltime->second)); diff --git a/sql/item.cc b/sql/item.cc index 7dc7e9e542c..382b85f9dc1 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -837,6 +837,21 @@ void Item_param::set_double(double d) } +/* + Set parameter value from TIME value. + + SYNOPSIS + set_time() + tm - datetime value to set (time_type is ignored) + type - type of datetime value + max_length_arg - max length of datetime value as string + + NOTE + If we value to be stored is not normalized, zero value will be stored + instead and proper warning will be produced. This function relies on + the fact that even wrong value sent over binary protocol fits into + MAX_DATE_STRING_REP_LENGTH buffer. +*/ void Item_param::set_time(TIME *tm, timestamp_type type, uint32 max_length_arg) { DBUG_ENTER("Item_param::set_time"); @@ -844,6 +859,17 @@ void Item_param::set_time(TIME *tm, timestamp_type type, uint32 max_length_arg) value.time= *tm; value.time.time_type= type; + if (value.time.year > 9999 || value.time.month > 12 || + value.time.day > 31 || + type != MYSQL_TIMESTAMP_TIME && value.time.hour > 23 || + value.time.minute > 59 || value.time.second > 59) + { + char buff[MAX_DATE_STRING_REP_LENGTH]; + uint length= my_TIME_to_str(&value.time, buff); + make_truncated_value_warning(current_thd, buff, length, type); + set_zero_time(&value.time, MYSQL_TIMESTAMP_ERROR); + } + state= TIME_VALUE; maybe_null= 0; max_length= max_length_arg; diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index 4ae69e40342..089853456e4 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -349,12 +349,6 @@ static void set_param_time(Item_param *param, uchar **pos, ulong len) tm.neg= (bool) to[0]; day= (uint) sint4korr(to+1); - /* - Note, that though ranges of hour, minute and second are not checked - here we rely on them being < 256: otherwise - we'll get buffer overflow in make_{date,time} functions, - which are called when time value is converted to string. - */ tm.hour= (uint) to[5] + day * 24; tm.minute= (uint) to[6]; tm.second= (uint) to[7]; @@ -369,7 +363,7 @@ static void set_param_time(Item_param *param, uchar **pos, ulong len) tm.day= tm.year= tm.month= 0; } else - set_zero_time(&tm); + set_zero_time(&tm, MYSQL_TIMESTAMP_TIME); param->set_time(&tm, MYSQL_TIMESTAMP_TIME, MAX_TIME_WIDTH * MY_CHARSET_BIN_MB_MAXLEN); *pos+= length; @@ -388,11 +382,6 @@ static void set_param_datetime(Item_param *param, uchar **pos, ulong len) tm.year= (uint) sint2korr(to); tm.month= (uint) to[2]; tm.day= (uint) to[3]; - /* - Note, that though ranges of hour, minute and second are not checked - here we rely on them being < 256: otherwise - we'll get buffer overflow in make_{date,time} functions. - */ if (length > 4) { tm.hour= (uint) to[4]; @@ -405,7 +394,7 @@ static void set_param_datetime(Item_param *param, uchar **pos, ulong len) tm.second_part= (length > 7) ? (ulong) sint4korr(to+7) : 0; } else - set_zero_time(&tm); + set_zero_time(&tm, MYSQL_TIMESTAMP_DATETIME); param->set_time(&tm, MYSQL_TIMESTAMP_DATETIME, MAX_DATETIME_WIDTH * MY_CHARSET_BIN_MB_MAXLEN); *pos+= length; @@ -419,11 +408,7 @@ static void set_param_date(Item_param *param, uchar **pos, ulong len) if (length >= 4) { uchar *to= *pos; - /* - Note, that though ranges of hour, minute and second are not checked - here we rely on them being < 256: otherwise - we'll get buffer overflow in make_{date,time} functions. - */ + tm.year= (uint) sint2korr(to); tm.month= (uint) to[2]; tm.day= (uint) to[3]; @@ -433,7 +418,7 @@ static void set_param_date(Item_param *param, uchar **pos, ulong len) tm.neg= 0; } else - set_zero_time(&tm); + set_zero_time(&tm, MYSQL_TIMESTAMP_DATE); param->set_time(&tm, MYSQL_TIMESTAMP_DATE, MAX_DATE_WIDTH * MY_CHARSET_BIN_MB_MAXLEN); *pos+= length; diff --git a/tests/client_test.c b/tests/client_test.c index 227f7e29ef2..bf0b69f9354 100644 --- a/tests/client_test.c +++ b/tests/client_test.c @@ -11088,6 +11088,139 @@ static void test_bug6096() } +/* + Test of basic checks that are performed in server for components + of MYSQL_TIME parameters. + */ +static void test_datetime_ranges() +{ + const char *stmt_text; + int rc, i; + MYSQL_STMT *stmt; + MYSQL_BIND bind[6]; + MYSQL_TIME tm[6]; + + myheader("test_datetime_ranges"); + + stmt_text= "drop table if exists t1"; + rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text)); + myquery(rc); + + stmt_text= "create table t1 (year datetime, month datetime, day datetime, " + "hour datetime, min datetime, sec datetime)"; + rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text)); + myquery(rc); + + stmt= mysql_simple_prepare(mysql, + "INSERT INTO t1 VALUES (?, ?, ?, ?, ?, ?)"); + check_stmt(stmt); + verify_param_count(stmt, 6); + + bzero(bind, sizeof(bind)); + for (i= 0; i < 6; i++) + { + bind[i].buffer_type= MYSQL_TYPE_DATETIME; + bind[i].buffer= &tm[i]; + } + rc= mysql_stmt_bind_param(stmt, bind); + check_execute(stmt, rc); + + tm[0].year= 2004; tm[0].month= 11; tm[0].day= 10; + tm[0].hour= 12; tm[0].minute= 30; tm[0].second= 30; + tm[0].second_part= 0; tm[0].neg= 0; + + tm[5]= tm[4]= tm[3]= tm[2]= tm[1]= tm[0]; + tm[0].year= 10000; tm[1].month= 13; tm[2].day= 32; + tm[3].hour= 24; tm[4].minute= 60; tm[5].second= 60; + + rc= mysql_stmt_execute(stmt); + check_execute(stmt, rc); + DIE_UNLESS(mysql_warning_count(mysql) != 6); + + verify_col_data("t1", "year", "0000-00-00 00:00:00"); + verify_col_data("t1", "month", "0000-00-00 00:00:00"); + verify_col_data("t1", "day", "0000-00-00 00:00:00"); + verify_col_data("t1", "hour", "0000-00-00 00:00:00"); + verify_col_data("t1", "min", "0000-00-00 00:00:00"); + verify_col_data("t1", "sec", "0000-00-00 00:00:00"); + + mysql_stmt_close(stmt); + + stmt_text= "delete from t1"; + rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text)); + myquery(rc); + + stmt= mysql_simple_prepare(mysql, "INSERT INTO t1 (year, month, day) " + "VALUES (?, ?, ?)"); + check_stmt(stmt); + verify_param_count(stmt, 3); + + /* + We reuse contents of bind and tm arrays left from previous part of test. + */ + for (i= 0; i < 3; i++) + bind[i].buffer_type= MYSQL_TYPE_DATE; + + rc= mysql_stmt_bind_param(stmt, bind); + check_execute(stmt, rc); + + rc= mysql_stmt_execute(stmt); + check_execute(stmt, rc); + DIE_UNLESS(mysql_warning_count(mysql) != 3); + + verify_col_data("t1", "year", "0000-00-00 00:00:00"); + verify_col_data("t1", "month", "0000-00-00 00:00:00"); + verify_col_data("t1", "day", "0000-00-00 00:00:00"); + + mysql_stmt_close(stmt); + + stmt_text= "drop table t1"; + rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text)); + myquery(rc); + + stmt_text= "create table t1 (day_ovfl time, day time, hour time, min time, sec time)"; + rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text)); + myquery(rc); + + stmt= mysql_simple_prepare(mysql, + "INSERT INTO t1 VALUES (?, ?, ?, ?, ?)"); + check_stmt(stmt); + verify_param_count(stmt, 5); + + /* + Again we reuse what we can from previous part of test. + */ + for (i= 0; i < 5; i++) + bind[i].buffer_type= MYSQL_TYPE_TIME; + + rc= mysql_stmt_bind_param(stmt, bind); + check_execute(stmt, rc); + + tm[0].year= 0; tm[0].month= 0; tm[0].day= 10; + tm[0].hour= 12; tm[0].minute= 30; tm[0].second= 30; + tm[0].second_part= 0; tm[0].neg= 0; + + tm[4]= tm[3]= tm[2]= tm[1]= tm[0]; + tm[0].day= 35; tm[1].day= 34; tm[2].hour= 30; tm[3].minute= 60; tm[4].second= 60; + + rc= mysql_stmt_execute(stmt); + check_execute(stmt, rc); + DIE_UNLESS(mysql_warning_count(mysql) != 2); + + verify_col_data("t1", "day_ovfl", "838:59:59"); + verify_col_data("t1", "day", "828:30:30"); + verify_col_data("t1", "hour", "270:30:30"); + verify_col_data("t1", "min", "00:00:00"); + verify_col_data("t1", "sec", "00:00:00"); + + mysql_stmt_close(stmt); + + stmt_text= "drop table t1"; + rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text)); + myquery(rc); +} + + /* Read and parse arguments and MySQL options from my.cnf */ @@ -11404,6 +11537,8 @@ int main(int argc, char **argv) test_bug6046(); /* NATURAL JOIN transformation works in PS */ test_bug6081(); /* test of mysql_create_db()/mysql_rm_db() */ test_bug6096(); /* max_length for numeric columns */ + test_datetime_ranges(); /* Test if basic checks are performed for + components of MYSQL_TIME parameters */ /* XXX: PLEASE RUN THIS PROGRAM UNDER VALGRIND AND VERIFY THAT YOUR TEST DOESN'T CONTAIN WARNINGS/ERRORS BEFORE YOU PUSH. From e1509cf78105e95f7e335f33bd3349ea77a099ac Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 15 Nov 2004 16:11:13 +0300 Subject: [PATCH 0222/1063] Proposed fix for bug #6439 "from_unixtime() function returns wrong datetime values for too big argument". Added range checking for from_unixtime() argument, cleaned up code a bit. mysql-test/r/func_time.result: Test for bug #6439 "from_unixtime() function returns wrong datetime values for too big argument". mysql-test/t/func_time.test: Test for bug #6439 "from_unixtime() function returns wrong datetime values for too big argument". sql/item_timefunc.cc: Item_func_from_unixtime: Added error range checking for function argument + small code clean up. --- mysql-test/r/func_time.result | 6 ++++ mysql-test/t/func_time.test | 7 +++++ sql/item_timefunc.cc | 57 ++++++++++++++--------------------- 3 files changed, 36 insertions(+), 34 deletions(-) diff --git a/mysql-test/r/func_time.result b/mysql-test/r/func_time.result index 877ca0e2d51..32034bf289d 100644 --- a/mysql-test/r/func_time.result +++ b/mysql-test/r/func_time.result @@ -470,3 +470,9 @@ unix_timestamp(@a) select unix_timestamp('1969-12-01 19:00:01'); unix_timestamp('1969-12-01 19:00:01') 0 +select from_unixtime(0); +from_unixtime(0) +NULL +select from_unixtime(2145916800); +from_unixtime(2145916800) +NULL diff --git a/mysql-test/t/func_time.test b/mysql-test/t/func_time.test index fffda12c14e..da18269cf6a 100644 --- a/mysql-test/t/func_time.test +++ b/mysql-test/t/func_time.test @@ -225,3 +225,10 @@ drop table t1,t2,t3; select @a:=FROM_UNIXTIME(1); select unix_timestamp(@a); select unix_timestamp('1969-12-01 19:00:01'); + +# +# Test for bug #6439 "unix_timestamp() function returns wrong datetime +# values for too big argument". It should return error instead. +# +select from_unixtime(0); +select from_unixtime(2145916800); diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index ed950a33166..d188310be24 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -919,21 +919,14 @@ String *Item_func_date_format::val_str(String *str) String *Item_func_from_unixtime::val_str(String *str) { - struct tm tm_tmp,*start; - time_t tmp=(time_t) args[0]->val_int(); - if ((null_value=args[0]->null_value)) + TIME ltime; + if (get_date(<ime, 0)) return 0; - localtime_r(&tmp,&tm_tmp); - start=&tm_tmp; if (str->alloc(20)) return str; /* purecov: inspected */ sprintf((char*) str->ptr(),"%04d-%02d-%02d %02d:%02d:%02d", - (int) start->tm_year+1900, - (int) start->tm_mon+1, - (int) start->tm_mday, - (int) start->tm_hour, - (int) start->tm_min, - (int) start->tm_sec); + (int) ltime.year, (int) ltime.month, (int) ltime.day, + (int) ltime.hour, (int) ltime.minute, (int) ltime.second); str->length(19); return str; } @@ -941,37 +934,33 @@ String *Item_func_from_unixtime::val_str(String *str) longlong Item_func_from_unixtime::val_int() { - time_t tmp=(time_t) (ulong) args[0]->val_int(); - if ((null_value=args[0]->null_value)) + TIME ltime; + if (get_date(<ime, 0)) return 0; - struct tm tm_tmp,*start; - localtime_r(&tmp,&tm_tmp); - start= &tm_tmp; - return ((longlong) ((ulong) ((uint) start->tm_year+1900)*10000L+ - (((uint) start->tm_mon+1)*100+ - (uint) start->tm_mday))*LL(1000000)+ - (longlong) ((ulong) ((uint) start->tm_hour)*10000L+ - (ulong) (((uint) start->tm_min)*100L+ - (uint) start->tm_sec))); + return ((longlong)(ltime.year*10000L+ltime.month*100+ltime.day)*LL(1000000)+ + (longlong)(ltime.hour*10000L+ltime.minute*100+ltime.second)); } bool Item_func_from_unixtime::get_date(TIME *ltime, bool fuzzy_date __attribute__((unused))) { - time_t tmp=(time_t) (ulong) args[0]->val_int(); - if ((null_value=args[0]->null_value)) + struct tm tm_tmp; + time_t tmp; + longlong arg= args[0]->val_int(); + if ((null_value= (args[0]->null_value || + arg < TIMESTAMP_MIN_VALUE || + arg > TIMESTAMP_MAX_VALUE))) return 1; - struct tm tm_tmp,*start; + tmp= arg; localtime_r(&tmp,&tm_tmp); - start= &tm_tmp; - ltime->year= start->tm_year+1900; - ltime->month= start->tm_mon+1; - ltime->day= start->tm_mday; - ltime->hour= start->tm_hour; - ltime->minute=start->tm_min; - ltime->second=start->tm_sec; - ltime->second_part=0; - ltime->neg=0; + ltime->year= tm_tmp.tm_year+1900; + ltime->month= tm_tmp.tm_mon+1; + ltime->day= tm_tmp.tm_mday; + ltime->hour= tm_tmp.tm_hour; + ltime->minute= tm_tmp.tm_min; + ltime->second= tm_tmp.tm_sec; + ltime->second_part= 0; + ltime->neg= 0; return 0; } From 58f984add28bba67add38efb0c19d67a154b47ea Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 15 Nov 2004 17:03:54 +0100 Subject: [PATCH 0223/1063] BUG#6353 V2: Replication using replicate-rewrite-db did not work for LOAD DATA INFILE. Now is does. There was one place in the code that used current database instead of the rewrite database. mysql-test/r/rpl_rewrite_db.result: New tests mysql-test/t/rpl_rewrite_db-slave.opt: New tests mysql-test/t/rpl_rewrite_db.test: New tests sql/log_event.cc: Added db to set_fields function so that current db is used. sql/log_event.h: Added db to set_fields function so that current db is used. --- mysql-test/r/rpl_rewrite_db.result | 70 +++++++++++++++++++++++++++ mysql-test/t/rpl_rewrite_db-slave.opt | 2 +- mysql-test/t/rpl_rewrite_db.test | 58 ++++++++++++++++++++++ sql/log_event.cc | 26 ++++++---- sql/log_event.h | 2 +- 5 files changed, 146 insertions(+), 12 deletions(-) diff --git a/mysql-test/r/rpl_rewrite_db.result b/mysql-test/r/rpl_rewrite_db.result index 2804b98dea1..a2c8706e3e1 100644 --- a/mysql-test/r/rpl_rewrite_db.result +++ b/mysql-test/r/rpl_rewrite_db.result @@ -20,3 +20,73 @@ a 9 drop table t1; drop database mysqltest1; +drop database if exists rewrite; +create database rewrite; +use test; +create table t1 (a date, b date, c date not null, d date); +load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ','; +Warnings: +Warning 1265 Data truncated for column 'a' at row 1 +Warning 1265 Data truncated for column 'c' at row 1 +Warning 1265 Data truncated for column 'd' at row 1 +Warning 1265 Data truncated for column 'a' at row 2 +Warning 1265 Data truncated for column 'b' at row 2 +Warning 1265 Data truncated for column 'd' at row 2 +load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ',' IGNORE 2 LINES; +select * from rewrite.t1; +a b c d +0000-00-00 NULL 0000-00-00 0000-00-00 +0000-00-00 0000-00-00 0000-00-00 0000-00-00 +2003-03-03 2003-03-03 2003-03-03 NULL +2003-03-03 2003-03-03 2003-03-03 NULL +truncate table t1; +load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ',' LINES STARTING BY ',' (b,c,d); +Warnings: +Warning 1265 Data truncated for column 'c' at row 1 +Warning 1265 Data truncated for column 'd' at row 1 +Warning 1265 Data truncated for column 'b' at row 2 +Warning 1265 Data truncated for column 'd' at row 2 +select * from rewrite.t1; +a b c d +NULL NULL 0000-00-00 0000-00-00 +NULL 0000-00-00 0000-00-00 0000-00-00 +NULL 2003-03-03 2003-03-03 NULL +drop table t1; +create table t1 (a text, b text); +load data infile '../../std_data/loaddata2.dat' into table t1 fields terminated by ',' enclosed by ''''; +Warnings: +Warning 1261 Row 3 doesn't contain data for all columns +select concat('|',a,'|'), concat('|',b,'|') from rewrite.t1; +concat('|',a,'|') concat('|',b,'|') +|Field A| |Field B| +|Field 1| |Field 2' +Field 3,'Field 4| +|Field 5' ,'Field 6| NULL +|Field 6| | 'Field 7'| +drop table t1; +create table t1 (a int, b char(10)); +load data infile '../../std_data/loaddata3.dat' into table t1 fields terminated by '' enclosed by '' ignore 1 lines; +Warnings: +Warning 1265 Data truncated for column 'a' at row 3 +Warning 1262 Row 3 was truncated; it contained more data than there were input columns +Warning 1265 Data truncated for column 'a' at row 5 +Warning 1262 Row 5 was truncated; it contained more data than there were input columns +select * from rewrite.t1; +a b +1 row 1 +2 row 2 +0 1234567890 +3 row 3 +0 1234567890 +truncate table t1; +load data infile '../../std_data/loaddata4.dat' into table t1 fields terminated by '' enclosed by '' lines terminated by '' ignore 1 lines; +Warnings: +Warning 1265 Data truncated for column 'a' at row 4 +Warning 1261 Row 4 doesn't contain data for all columns +select * from rewrite.t1; +a b +1 row 1 +2 row 2 +3 row 3 +0 +drop table t1; diff --git a/mysql-test/t/rpl_rewrite_db-slave.opt b/mysql-test/t/rpl_rewrite_db-slave.opt index b9cd29e9205..a462ad19ba0 100644 --- a/mysql-test/t/rpl_rewrite_db-slave.opt +++ b/mysql-test/t/rpl_rewrite_db-slave.opt @@ -1 +1 @@ -"--replicate-rewrite-db=mysqltest1->test" +"--replicate-rewrite-db=test->rewrite" "--replicate-rewrite-db=mysqltest1->test" diff --git a/mysql-test/t/rpl_rewrite_db.test b/mysql-test/t/rpl_rewrite_db.test index 4cc8ae4b676..b6118854037 100644 --- a/mysql-test/t/rpl_rewrite_db.test +++ b/mysql-test/t/rpl_rewrite_db.test @@ -17,3 +17,61 @@ drop table t1; drop database mysqltest1; sync_slave_with_master; +# +# BUG#6353: +# Option --replicate-rewrite-db should work together with LOAD DATA INFILE +# + +connection slave; +--disable_warnings +drop database if exists rewrite; +--enable_warnings +create database rewrite; + +connection master; +use test; +create table t1 (a date, b date, c date not null, d date); +load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ','; +load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ',' IGNORE 2 LINES; +sync_slave_with_master; + +connection slave; +select * from rewrite.t1; + +connection master; +truncate table t1; +load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ',' LINES STARTING BY ',' (b,c,d); +sync_slave_with_master; + +connection slave; +select * from rewrite.t1; + +connection master; +drop table t1; +create table t1 (a text, b text); +load data infile '../../std_data/loaddata2.dat' into table t1 fields terminated by ',' enclosed by ''''; +sync_slave_with_master; + +connection slave; +select concat('|',a,'|'), concat('|',b,'|') from rewrite.t1; + +connection master; +drop table t1; +create table t1 (a int, b char(10)); +load data infile '../../std_data/loaddata3.dat' into table t1 fields terminated by '' enclosed by '' ignore 1 lines; +sync_slave_with_master; + +connection slave; +select * from rewrite.t1; + +connection master; +truncate table t1; +load data infile '../../std_data/loaddata4.dat' into table t1 fields terminated by '' enclosed by '' lines terminated by '' ignore 1 lines; +sync_slave_with_master; + +connection slave; +# The empty line last comes from the end line field in the file +select * from rewrite.t1; + +connection master; +drop table t1; diff --git a/sql/log_event.cc b/sql/log_event.cc index 091566c5d90..301c8ec222c 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -1655,16 +1655,22 @@ void Load_log_event::print(FILE* file, bool short_form, char* last_db, /* Load_log_event::set_fields() + + Note that this function can not use the member variable + for the database, since LOAD DATA INFILE on the slave + can be for a different database than the current one. + This is the reason for the affected_db argument to this method. */ #ifndef MYSQL_CLIENT -void Load_log_event::set_fields(List &field_list) +void Load_log_event::set_fields(const char* affected_db, + List &field_list) { uint i; const char* field = fields; for (i= 0; i < num_fields; i++) { - field_list.push_back(new Item_field(db, table_name, field)); + field_list.push_back(new Item_field(affected_db, table_name, field)); field+= field_lens[i] + 1; } } @@ -1820,7 +1826,7 @@ int Load_log_event::exec_event(NET* net, struct st_relay_log_info* rli, ex.skip_lines = skip_lines; List field_list; - set_fields(field_list); + set_fields(thd->db,field_list); thd->variables.pseudo_thread_id= thread_id; if (net) { @@ -1837,13 +1843,13 @@ int Load_log_event::exec_event(NET* net, struct st_relay_log_info* rli, if (thd->cuted_fields) { /* log_pos is the position of the LOAD event in the master log */ - sql_print_error("\ -Slave: load data infile on table '%s' at log position %s in log \ -'%s' produced %ld warning(s). Default database: '%s'", - (char*) table_name, - llstr(log_pos,llbuff), RPL_LOG_NAME, - (ulong) thd->cuted_fields, - print_slave_db_safe(thd->db)); + sql_print_warning("Slave: load data infile on table '%s' at " + "log position %s in log '%s' produced %ld " + "warning(s). Default database: '%s'", + (char*) table_name, + llstr(log_pos,llbuff), RPL_LOG_NAME, + (ulong) thd->cuted_fields, + print_slave_db_safe(thd->db)); } if (net) net->pkt_nr= thd->net.pkt_nr; diff --git a/sql/log_event.h b/sql/log_event.h index 8070c334d8b..1606659e21e 100644 --- a/sql/log_event.h +++ b/sql/log_event.h @@ -587,7 +587,7 @@ public: const char* table_name_arg, List& fields_arg, enum enum_duplicates handle_dup, bool using_trans); - void set_fields(List &fields_arg); + void set_fields(const char* db, List &fields_arg); const char* get_db() { return db; } #ifdef HAVE_REPLICATION void pack_info(Protocol* protocol); From b478635110d05f644c7fcca476f5cfc6c9ba1e40 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 15 Nov 2004 21:26:16 +0400 Subject: [PATCH 0224/1063] Bug#6608: MySQL server crash in some query with tis620 character set. The bug was that the function allocates 'a', then changes the value of 'a' with the operator ++, and then tries to free 'a'! --- mysql-test/r/ctype_tis620.result | 38 ++++++++++++++++++++++++++++++++ mysql-test/t/ctype_tis620.test | 35 +++++++++++++++++++++++++++++ strings/ctype-tis620.c | 10 +++------ 3 files changed, 76 insertions(+), 7 deletions(-) diff --git a/mysql-test/r/ctype_tis620.result b/mysql-test/r/ctype_tis620.result index 1fece515f9f..fa99c2d1318 100644 --- a/mysql-test/r/ctype_tis620.result +++ b/mysql-test/r/ctype_tis620.result @@ -2899,3 +2899,41 @@ hex(a) STRCMP(a,'a') STRCMP(a,'a ') 6109 -1 -1 61 0 0 DROP TABLE t1; +CREATE TABLE t1 ( +`id` int(11) NOT NULL auto_increment, +`url` varchar(200) NOT NULL default '', +`name` varchar(250) NOT NULL default '', +`type` int(11) NOT NULL default '0', +`website` varchar(250) NOT NULL default '', +`adddate` date NOT NULL default '0000-00-00', +`size` varchar(20) NOT NULL default '', +`movieid` int(11) NOT NULL default '0', +`musicid` int(11) NOT NULL default '0', +`star` varchar(20) NOT NULL default '', +`download` int(11) NOT NULL default '0', +`lastweek` int(11) NOT NULL default '0', +`thisweek` int(11) NOT NULL default '0', +`page` varchar(250) NOT NULL default '', +PRIMARY KEY (`id`), +UNIQUE KEY `url` (`url`) +) CHARACTER SET tis620; +INSERT INTO t1 VALUES +(1,'http://www.siamzone.com/download/download/000001-frodo_1024.jpg','The Lord +of the Rings +Wallpapers',1,'http://www.lordoftherings.net','2002-01-22','',448,0,'',3805,0,0, +''); +INSERT INTO t1 VALUES (2,'http://www.othemovie.com/OScreenSaver1.EXE','O +Screensaver',2,'','2002-01-22','',491,0,'',519,0,0,''); +INSERT INTO t1 VALUES +(3,'http://www.siamzone.com/download/download/000003-jasonx2(800x600).jpg','Jaso +n X Wallpapers',1,'','2002-05-31','',579,0,'',1091,0,0,''); +select * from t1 order by id; +id url name type website adddate size movieid musicid star download lastweek thisweek page +1 http://www.siamzone.com/download/download/000001-frodo_1024.jpg The Lord +of the Rings +Wallpapers 1 http://www.lordoftherings.net 2002-01-22 448 0 3805 0 0 +2 http://www.othemovie.com/OScreenSaver1.EXE O +Screensaver 2 2002-01-22 491 0 519 0 0 +3 http://www.siamzone.com/download/download/000003-jasonx2(800x600).jpg Jaso +n X Wallpapers 1 2002-05-31 579 0 1091 0 0 +DROP TABLE t1; diff --git a/mysql-test/t/ctype_tis620.test b/mysql-test/t/ctype_tis620.test index 92a9eada05f..21ec314dca7 100644 --- a/mysql-test/t/ctype_tis620.test +++ b/mysql-test/t/ctype_tis620.test @@ -116,3 +116,38 @@ CREATE TABLE t1 (a char(10) not null) CHARACTER SET tis620; INSERT INTO t1 VALUES ('a'),('a\0'),('a\t'),('a '); SELECT hex(a),STRCMP(a,'a'), STRCMP(a,'a ') FROM t1; DROP TABLE t1; + +# +# Bug#6608 +# +CREATE TABLE t1 ( + `id` int(11) NOT NULL auto_increment, + `url` varchar(200) NOT NULL default '', + `name` varchar(250) NOT NULL default '', + `type` int(11) NOT NULL default '0', + `website` varchar(250) NOT NULL default '', + `adddate` date NOT NULL default '0000-00-00', + `size` varchar(20) NOT NULL default '', + `movieid` int(11) NOT NULL default '0', + `musicid` int(11) NOT NULL default '0', + `star` varchar(20) NOT NULL default '', + `download` int(11) NOT NULL default '0', + `lastweek` int(11) NOT NULL default '0', + `thisweek` int(11) NOT NULL default '0', + `page` varchar(250) NOT NULL default '', + PRIMARY KEY (`id`), + UNIQUE KEY `url` (`url`) +) CHARACTER SET tis620; + +INSERT INTO t1 VALUES +(1,'http://www.siamzone.com/download/download/000001-frodo_1024.jpg','The Lord +of the Rings +Wallpapers',1,'http://www.lordoftherings.net','2002-01-22','',448,0,'',3805,0,0, +''); +INSERT INTO t1 VALUES (2,'http://www.othemovie.com/OScreenSaver1.EXE','O +Screensaver',2,'','2002-01-22','',491,0,'',519,0,0,''); +INSERT INTO t1 VALUES +(3,'http://www.siamzone.com/download/download/000003-jasonx2(800x600).jpg','Jaso +n X Wallpapers',1,'','2002-05-31','',579,0,'',1091,0,0,''); +select * from t1 order by id; +DROP TABLE t1; diff --git a/strings/ctype-tis620.c b/strings/ctype-tis620.c index a2ba4783591..68bfefafe6a 100644 --- a/strings/ctype-tis620.c +++ b/strings/ctype-tis620.c @@ -562,17 +562,13 @@ int my_strnncollsp_tis620(CHARSET_INFO * cs __attribute__((unused)), const uchar *b0, uint b_length) { uchar buf[80] ; - uchar *end, *a, *b; + uchar *end, *a, *b, *alloced= NULL; uint length; int res= 0; - int alloced= 0; a= buf; if ((a_length + b_length +2) > (int) sizeof(buf)) - { - a= (uchar*) malloc(a_length+b_length); - alloced= 1; - } + alloced= a= (uchar*) malloc(a_length+b_length); b= a + a_length+1; memcpy((char*) a, (char*) a0, a_length); @@ -618,7 +614,7 @@ int my_strnncollsp_tis620(CHARSET_INFO * cs __attribute__((unused)), ret: if (alloced) - free(a); + free(alloced); return res; } From dd93baa00da5e27f1a27df5762fe112f777f53c1 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 16 Nov 2004 00:16:04 +0200 Subject: [PATCH 0225/1063] fixed joincleunup to avoid double deletin tables, and too earlyfull cleanup in case of EXPLAIN fixed cleunup of TMP_TABLE_PARAM (BUG#6406) mysql-test/r/subselect.result: primary query with temporary table and subquery with groupping mysql-test/t/subselect.test: primary query with temporary table and subquery with groupping sql/sql_class.h: fixed cleunup of TMP_TABLE_PARAM sql/sql_select.cc: uncacheable test made simplier fixed joincleunup to avoid double deletin tables, and too earlyfull cleanup in case of EXPLAIN --- mysql-test/r/subselect.result | 12 ++++++++++++ mysql-test/t/subselect.test | 10 ++++++++++ sql/sql_class.h | 2 +- sql/sql_select.cc | 6 ++++-- 4 files changed, 27 insertions(+), 3 deletions(-) diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index 9c8a237468a..2d686285050 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -1991,3 +1991,15 @@ ac NULL drop tables t1,t2; set @got_val= (SELECT 1 FROM (SELECT 'A' as my_col) as T1 ) ; +create table t1 (a int, b int); +create table t2 (a int, b int); +insert into t1 values (1,1),(1,2),(1,3),(2,4),(2,5); +insert into t2 values (1,3),(2,1); +select distinct a,b, (select max(b) from t2 where t1.b=t2.a) from t1 order by t1.b; +a b (select max(b) from t2 where t1.b=t2.a) +1 1 3 +1 2 1 +1 3 NULL +2 4 NULL +2 5 NULL +drop table t1, t2; diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test index 19803f6e3ba..976ce7bf6b0 100644 --- a/mysql-test/t/subselect.test +++ b/mysql-test/t/subselect.test @@ -1289,3 +1289,13 @@ drop tables t1,t2; connect (root,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK); connection root; set @got_val= (SELECT 1 FROM (SELECT 'A' as my_col) as T1 ) ; + +# +# primary query with temporary table and subquery with groupping +# +create table t1 (a int, b int); +create table t2 (a int, b int); +insert into t1 values (1,1),(1,2),(1,3),(2,4),(2,5); +insert into t2 values (1,3),(2,1); +select distinct a,b, (select max(b) from t2 where t1.b=t2.a) from t1 order by t1.b; +drop table t1, t2; diff --git a/sql/sql_class.h b/sql/sql_class.h index 312d9de9794..6d77b75d70f 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -1305,7 +1305,7 @@ public: if (copy_field) /* Fix for Intel compiler */ { delete [] copy_field; - copy_field=0; + save_copy_field= copy_field= 0; } } }; diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 9162cd30d63..06731d26073 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -936,7 +936,7 @@ JOIN::optimize() } } - if (select_lex->master_unit()->uncacheable) + if (select_lex->uncacheable) { if (!(tmp_join= (JOIN*)thd->alloc(sizeof(JOIN)))) DBUG_RETURN(-1); @@ -3833,7 +3833,8 @@ JOIN::join_free(bool full) JOIN_TAB *tab,*end; DBUG_ENTER("JOIN::join_free"); - full= full || !select_lex->uncacheable; + full= full || (!select_lex->uncacheable && + !thd->lex->describe); if (table) { @@ -3862,6 +3863,7 @@ JOIN::join_free(bool full) for (tab= join_tab, end= tab+tables; tab != end; tab++) tab->cleanup(); table= 0; + tables= 0; } else { From 546e2d3192ed0b5745bf22cbc61f9aec44b426a8 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 16 Nov 2004 00:10:32 +0100 Subject: [PATCH 0226/1063] compilation failures fixes. mysqldump now compiles on AIX 4.3. client/mysqldump.c: row[i] is char* so some compilers don't want to put it into a unsigned char*. A C++ comment. --- client/mysqldump.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/mysqldump.c b/client/mysqldump.c index 498a10041a9..cfe93a11024 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -1684,7 +1684,7 @@ static void dumpTable(uint numFields, char *table) else if (opt_hex_blob && is_blob) { /* sakaik got the idea to to provide blob's in hex notation. */ - unsigned char *ptr= row[i], *end= ptr+ lengths[i]; + char *ptr= row[i], *end= ptr+ lengths[i]; fputs("0x", md_result_file); for (; ptr < end ; ptr++) fprintf(md_result_file, "%02X", *ptr); @@ -2246,7 +2246,7 @@ int main(int argc, char **argv) } if (opt_master_data && do_show_master_status(sock)) goto err; - if (opt_single_transaction && do_unlock_tables(sock)) // unlock but no commit! + if (opt_single_transaction && do_unlock_tables(sock)) /* unlock but no commit! */ goto err; if (opt_alldbs) From 1f947d4ba8fb3870d9f5b2334a69c9ea5116ba69 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 16 Nov 2004 07:20:30 +0100 Subject: [PATCH 0227/1063] wl1744 - ndb on windows ndb/include/ndb_global.h.in: remove defines and put them into basestring ndb/src/common/logger/FileLogHandler.cpp: fix ndb/src/common/logger/Logger.cpp: fix ndb/src/common/portlib/win32/NdbMutex.c: fix ndb/src/common/util/basestring_vsnprintf.c: fix ndb/src/mgmapi/mgmapi.cpp: fix ndb/src/mgmsrv/MgmtSrvr.cpp: fix ndb/src/mgmsrv/Services.cpp: fix ndb/test/ndbapi/Makefile.am: fix ndb/tools/Makefile.am: fix --- ndb/include/ndb_global.h.in | 3 - ndb/src/common/logger/FileLogHandler.cpp | 4 +- ndb/src/common/logger/Logger.cpp | 10 +- ndb/src/common/portlib/win32/NdbMutex.c | 3 +- ndb/src/common/util/basestring_vsnprintf.c | 34 +++---- ndb/src/mgmapi/mgmapi.cpp | 4 +- ndb/src/mgmsrv/MgmtSrvr.cpp | 2 +- ndb/src/mgmsrv/Services.cpp | 6 +- ndb/test/ndbapi/Makefile.am | 63 +++++++++++- ndb/tools/Makefile.am | 106 ++++++++++++++++++++- 10 files changed, 197 insertions(+), 38 deletions(-) diff --git a/ndb/include/ndb_global.h.in b/ndb/include/ndb_global.h.in index e1169ded02b..aefb319730c 100644 --- a/ndb/include/ndb_global.h.in +++ b/ndb/include/ndb_global.h.in @@ -13,11 +13,8 @@ #define PATH_MAX 256 #define DIR_SEPARATOR "\\" #define MYSQLCLUSTERDIR "c:\\mysql\\mysql-cluster" -#define snprintf _snprintf -#define vsnprintf _vsnprintf #define HAVE_STRCASECMP #define strcasecmp _strcmpi -#define strncasecmp _strncmpi #pragma warning(disable: 4503 4786) #else #undef NDB_WIN32 diff --git a/ndb/src/common/logger/FileLogHandler.cpp b/ndb/src/common/logger/FileLogHandler.cpp index 29172ff93ad..98b2848feba 100644 --- a/ndb/src/common/logger/FileLogHandler.cpp +++ b/ndb/src/common/logger/FileLogHandler.cpp @@ -206,9 +206,9 @@ FileLogHandler::setMaxSize(const BaseString &size) { long val = strtol(size.c_str(), &end, 0); /* XXX */ if(size.c_str() == end) return false; - if(strncasecmp("M", end, 1) == 0) + if(end[0] == 'M') val *= 1024*1024; - if(strncasecmp("k", end, 1) == 0) + if(end[0] == 'k') val *= 1024; m_maxFileSize = val; diff --git a/ndb/src/common/logger/Logger.cpp b/ndb/src/common/logger/Logger.cpp index 00a2fae67bc..0e2d204cefa 100644 --- a/ndb/src/common/logger/Logger.cpp +++ b/ndb/src/common/logger/Logger.cpp @@ -183,13 +183,17 @@ Logger::addHandler(const BaseString &logstring) { LogHandler *handler = NULL; - if(type == "SYSLOG") { +#ifndef NDB_WIN32 + if(type == "SYSLOG") + { handler = new SysLogHandler(); - } else if(type == "FILE") + } else +#endif + if(type == "FILE") handler = new FileLogHandler(); else if(type == "CONSOLE") handler = new ConsoleLogHandler(); - + if(handler == NULL) return false; if(!handler->parseParams(params)) diff --git a/ndb/src/common/portlib/win32/NdbMutex.c b/ndb/src/common/portlib/win32/NdbMutex.c index 83c126abd4d..e6d1f081e9a 100644 --- a/ndb/src/common/portlib/win32/NdbMutex.c +++ b/ndb/src/common/portlib/win32/NdbMutex.c @@ -65,7 +65,8 @@ int NdbMutex_Trylock(NdbMutex* p_mutex) int result = -1; if(p_mutex) { - result = (TryEnterCriticalSection(p_mutex) ? 0 : -1); + result = NdbMutex_Lock(p_mutex); + //(TryEnterCriticalSection(p_mutex) ? 0 : -1); } return result; } diff --git a/ndb/src/common/util/basestring_vsnprintf.c b/ndb/src/common/util/basestring_vsnprintf.c index 8a58ca0fe5c..58203e33bd1 100644 --- a/ndb/src/common/util/basestring_vsnprintf.c +++ b/ndb/src/common/util/basestring_vsnprintf.c @@ -20,10 +20,12 @@ #include #include +#ifdef _WINDOWS +#define SNPRINTF_RETURN_TRUNC +#define snprintf _snprintf +#define vsnprintf _vsnprintf +#endif -/* - #define SNPRINTF_RETURN_TRUNC -*/ int basestring_snprintf(char *str, size_t size, const char *format, ...) { @@ -35,16 +37,6 @@ basestring_snprintf(char *str, size_t size, const char *format, ...) return(ret); } -#ifdef HAVE_SNPRINTF - #define BASESTRING_VSNPRINTF_FUNC(a,b,c,d) vsnprintf(a,b,c,d) -#else - #define SNPRINTF_RETURN_TRUNC - /* #define BASESTRING_VSNPRINTF_FUNC(a,b,c,d) my_vsnprintf(a,b,c,d) - * we would like to use my_vsnprintf but it does not have enough features - * Let's hope vsnprintf works anyways - */ - #define BASESTRING_VSNPRINTF_FUNC(a,b,c,d) vsnprintf(a,b,c,d) -#endif #ifdef SNPRINTF_RETURN_TRUNC static char basestring_vsnprintf_buf[16*1024]; #endif @@ -54,22 +46,22 @@ basestring_vsnprintf(char *str, size_t size, const char *format, va_list ap) if (size == 0) { #ifdef SNPRINTF_RETURN_TRUNC - return BASESTRING_VSNPRINTF_FUNC(basestring_vsnprintf_buf, - sizeof(basestring_vsnprintf_buf), - format, ap); + return vsnprintf(basestring_vsnprintf_buf, + sizeof(basestring_vsnprintf_buf), + format, ap); #else char buf[1]; - return BASESTRING_VSNPRINTF_FUNC(buf, 1, format, ap); + return vsnprintf(buf, 1, format, ap); #endif } { - int ret= BASESTRING_VSNPRINTF_FUNC(str, size, format, ap); + int ret= vsnprintf(str, size, format, ap); #ifdef SNPRINTF_RETURN_TRUNC if (ret == size-1 || ret == -1) { - ret= BASESTRING_VSNPRINTF_FUNC(basestring_vsnprintf_buf, - sizeof(basestring_vsnprintf_buf), - format, ap); + ret= vsnprintf(basestring_vsnprintf_buf, + sizeof(basestring_vsnprintf_buf), + format, ap); } #endif return ret; diff --git a/ndb/src/mgmapi/mgmapi.cpp b/ndb/src/mgmapi/mgmapi.cpp index 66f0dbb1842..22abc4f7f4c 100644 --- a/ndb/src/mgmapi/mgmapi.cpp +++ b/ndb/src/mgmapi/mgmapi.cpp @@ -368,7 +368,7 @@ ndb_mgm_connect(NdbMgmHandle handle, const char * mgmsrv) */ SocketClient s(handle->hostname, handle->port); const NDB_SOCKET_TYPE sockfd = s.connect(); - if (sockfd < 0) { + if (sockfd == NDB_INVALID_SOCKET) { setError(handle, NDB_MGM_COULD_NOT_CONNECT_TO_SOCKET, __LINE__, "Unable to connect to %s", mgmsrv); return -1; @@ -1082,7 +1082,7 @@ ndb_mgm_listen_event(NdbMgmHandle handle, int filter[]) SocketClient s(handle->hostname, handle->port); const NDB_SOCKET_TYPE sockfd = s.connect(); - if (sockfd < 0) { + if (sockfd == NDB_INVALID_SOCKET) { setError(handle, NDB_MGM_COULD_NOT_CONNECT_TO_SOCKET, __LINE__, "Unable to connect to"); return -1; diff --git a/ndb/src/mgmsrv/MgmtSrvr.cpp b/ndb/src/mgmsrv/MgmtSrvr.cpp index e86cfcb8e4b..8306b4d92f1 100644 --- a/ndb/src/mgmsrv/MgmtSrvr.cpp +++ b/ndb/src/mgmsrv/MgmtSrvr.cpp @@ -532,7 +532,7 @@ MgmtSrvr::MgmtSrvr(NodeId nodeId, { MgmStatService::StatListener se; - se.m_socket = -1; + se.m_socket = NDB_INVALID_SOCKET; for(size_t t = 0; t= 0; i--){ if(threshold <= m_clients[i].m_logLevel.getLogLevel(cat)){ - if(m_clients[i].m_socket >= 0 && + if(m_clients[i].m_socket != NDB_INVALID_SOCKET && println_socket(m_clients[i].m_socket, MAX_WRITE_TIMEOUT, m_text) == -1){ copy.push_back(m_clients[i].m_socket); @@ -1318,7 +1318,7 @@ MgmStatService::add_listener(const StatListener& client){ void MgmStatService::stopSessions(){ for(int i = m_clients.size() - 1; i >= 0; i--){ - if(m_clients[i].m_socket >= 0){ + if(m_clients[i].m_socket != NDB_INVALID_SOCKET){ NDB_CLOSE_SOCKET(m_clients[i].m_socket); m_clients.erase(i); } @@ -1404,7 +1404,7 @@ MgmApiSession::listen_event(Parser::Context & ctx, m_mgmsrv.m_statisticsListner.add_listener(le); m_stop = true; - m_socket = -1; + m_socket = NDB_INVALID_SOCKET; done: m_output->println("listen event"); diff --git a/ndb/test/ndbapi/Makefile.am b/ndb/test/ndbapi/Makefile.am index 310854edf77..33744cc0f51 100644 --- a/ndb/test/ndbapi/Makefile.am +++ b/ndb/test/ndbapi/Makefile.am @@ -84,4 +84,65 @@ testBackup_LDADD = $(LDADD) bank/libbank.a # Don't update the files from bitkeeper %::SCCS/s.% -windoze-dsp: +windoze-dsp: flexBench.dsp testBasic.dsp testBlobs.dsp \ + testScan.dsp + +flexBench.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-prg.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-prg.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ flexBench + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(flexBench_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ LINK $(LDADD) + +testBasic.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-prg.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-prg.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ testBasic + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(testBasic_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ LINK $(LDADD) + +testOIBasic.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-prg.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-prg.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ testOIBasic + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(testOIBasic_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ LINK $(LDADD) + +testBlobs.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-prg.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-prg.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ testBlobs + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(testBlobs_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ LINK $(LDADD) + +testScan.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-prg.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-prg.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ testScan + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(testScan_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ LINK $(LDADD) diff --git a/ndb/tools/Makefile.am b/ndb/tools/Makefile.am index 59fc5c124be..cf78eeadac7 100644 --- a/ndb/tools/Makefile.am +++ b/ndb/tools/Makefile.am @@ -38,4 +38,108 @@ ndb_select_count_LDFLAGS = @ndb_bin_am_ldflags@ # Don't update the files from bitkeeper %::SCCS/s.% -windoze-dsp: +windoze-dsp: \ + ndb_waiter.dsp \ + ndb_drop_table.dsp \ + ndb_delete_all.dsp \ + ndb_desc.dsp \ + ndb_drop_index.dsp \ + ndb_show_tables.dsp \ + ndb_select_all.dsp \ + ndb_select_count.dsp + +ndb_waiter.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-prg.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-prg.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ ndb_waiter + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(ndb_waiter_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ LINK $(LDADD) + +ndb_drop_table.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-prg.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-prg.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ ndb_drop_table + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(ndb_drop_table_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ LINK $(LDADD) + +ndb_delete_all.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-prg.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-prg.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ ndb_delete_all + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(ndb_delete_all_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ LINK $(LDADD) + +ndb_desc.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-prg.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-prg.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ ndb_desc + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(ndb_desc_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ LINK $(LDADD) + +ndb_drop_index.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-prg.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-prg.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ ndb_drop_index + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(ndb_drop_index_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ LINK $(LDADD) + +ndb_show_tables.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-prg.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-prg.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ ndb_show_tables + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(ndb_show_tables_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ LINK $(LDADD) + +ndb_select_all.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-prg.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-prg.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ ndb_select_all + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(ndb_select_all_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ LINK $(LDADD) + +ndb_select_count.dsp: Makefile \ + $(top_srcdir)/ndb/config/win-prg.am \ + $(top_srcdir)/ndb/config/win-name \ + $(top_srcdir)/ndb/config/win-includes \ + $(top_srcdir)/ndb/config/win-sources \ + $(top_srcdir)/ndb/config/win-libraries + cat $(top_srcdir)/ndb/config/win-prg.am > $@ + @$(top_srcdir)/ndb/config/win-name $@ ndb_select_count + @$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES) + @$(top_srcdir)/ndb/config/win-sources $@ $(ndb_select_count_SOURCES) + @$(top_srcdir)/ndb/config/win-libraries $@ LINK $(LDADD) From 1a9a113201f255be7b39252df6cb47dbbf643a88 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 16 Nov 2004 07:24:11 +0000 Subject: [PATCH 0228/1063] provided better error printout for mismatch of node types in configuratoin fetch fixed to that mgmt server actually uses the connectsring ndb/src/common/mgmcommon/ConfigRetriever.cpp: provided better error printout ndb/src/mgmsrv/main.cpp: fixed to that mgmt server actually uses the connectsring --- ndb/src/common/mgmcommon/ConfigRetriever.cpp | 13 ++++++++++--- ndb/src/mgmsrv/main.cpp | 2 +- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/ndb/src/common/mgmcommon/ConfigRetriever.cpp b/ndb/src/common/mgmcommon/ConfigRetriever.cpp index d8417ac146a..a1b979f62d8 100644 --- a/ndb/src/common/mgmcommon/ConfigRetriever.cpp +++ b/ndb/src/common/mgmcommon/ConfigRetriever.cpp @@ -238,7 +238,8 @@ ConfigRetriever::verifyConfig(const struct ndb_mgm_configuration * conf, Uint32 char buf[255]; ndb_mgm_configuration_iterator * it; - it = ndb_mgm_create_configuration_iterator((struct ndb_mgm_configuration *)conf, CFG_SECTION_NODE); + it = ndb_mgm_create_configuration_iterator((struct ndb_mgm_configuration *)conf, + CFG_SECTION_NODE); if(it == 0){ BaseString::snprintf(buf, 255, "Unable to create config iterator"); @@ -284,8 +285,14 @@ ConfigRetriever::verifyConfig(const struct ndb_mgm_configuration * conf, Uint32 } if(_type != m_node_type){ - BaseString::snprintf(buf, 255, "Supplied node type(%d) and config node type(%d) " - " don't match", m_node_type, _type); + const char *type_s, *alias_s, *type_s2, *alias_s2; + alias_s= ndb_mgm_get_node_type_alias_string((enum ndb_mgm_node_type)m_node_type, + &type_s); + alias_s2= ndb_mgm_get_node_type_alias_string((enum ndb_mgm_node_type)_type, + &type_s2); + BaseString::snprintf(buf, 255, "This node type %s(%s) and config " + "node type %s(%s) don't match for nodeid %d", + alias_s, type_s, alias_s2, type_s2, nodeid); setError(CR_ERROR, buf); return false; } diff --git a/ndb/src/mgmsrv/main.cpp b/ndb/src/mgmsrv/main.cpp index 7a57fdeb77a..76f0679b069 100644 --- a/ndb/src/mgmsrv/main.cpp +++ b/ndb/src/mgmsrv/main.cpp @@ -216,7 +216,7 @@ int main(int argc, char** argv) * Read configuration files * ****************************/ LocalConfig local_config; - if(!local_config.init(0,glob.local_config_filename)){ + if(!local_config.init(opt_connect_str,glob.local_config_filename)){ local_config.printError(); goto error_end; } From b670ccac133f8ff678d6721fef28397250c14cda Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 16 Nov 2004 12:05:13 +0400 Subject: [PATCH 0229/1063] Bug #6552 CHAR column w/o length is legal, BINARY w/o length is not --- mysql-test/r/binary.result | 7 +++++++ mysql-test/t/binary.test | 7 +++++++ sql/sql_yacc.yy | 3 +++ 3 files changed, 17 insertions(+) diff --git a/mysql-test/r/binary.result b/mysql-test/r/binary.result index 405de1158d6..5b5f673b071 100644 --- a/mysql-test/r/binary.result +++ b/mysql-test/r/binary.result @@ -134,3 +134,10 @@ select * from t1 where firstname='john' and firstname like binary 'John'; firstname lastname John Doe drop table t1; +create table t1 (a binary); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` binary(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; diff --git a/mysql-test/t/binary.test b/mysql-test/t/binary.test index 3e702fd5257..54ad8e92237 100644 --- a/mysql-test/t/binary.test +++ b/mysql-test/t/binary.test @@ -80,3 +80,10 @@ select * from t1 where firstname='john' and firstname = binary 'john'; select * from t1 where firstname='John' and firstname like binary 'john'; select * from t1 where firstname='john' and firstname like binary 'John'; drop table t1; + +# +# Bug #6552 CHAR column w/o length is legal, BINARY w/o length is not +# +create table t1 (a binary); +show create table t1; +drop table t1; diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index d842b4b66bb..521196085bb 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -1402,6 +1402,9 @@ type: | BINARY '(' NUM ')' { Lex->length=$3.str; Lex->charset=&my_charset_bin; $$=FIELD_TYPE_STRING; } + | BINARY { Lex->length= (char*) "1"; + Lex->charset=&my_charset_bin; + $$=FIELD_TYPE_STRING; } | varchar '(' NUM ')' opt_binary { Lex->length=$3.str; $$=FIELD_TYPE_VAR_STRING; } | nvarchar '(' NUM ')' { Lex->length=$3.str; From 0babddfd79b8fcc3ffcb2544f12d1114c37145aa Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 16 Nov 2004 09:10:29 +0000 Subject: [PATCH 0230/1063] Makefile.am: changed link order to fix linking problems client/Makefile.am: changed link order to fix linking problems --- client/Makefile.am | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/Makefile.am b/client/Makefile.am index 58398548b75..1c552036f9b 100644 --- a/client/Makefile.am +++ b/client/Makefile.am @@ -20,8 +20,8 @@ INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/regex \ $(openssl_includes) LIBS = @CLIENT_LIBS@ -DEPLIB= ../libmysql/libmysqlclient.la \ - @ndb_mgmclient_libs@ +DEPLIB= @ndb_mgmclient_libs@ \ + ../libmysql/libmysqlclient.la LDADD = @CLIENT_EXTRA_LDFLAGS@ $(DEPLIB) bin_PROGRAMS = mysql mysqladmin mysqlcheck mysqlshow \ mysqldump mysqlimport mysqltest mysqlbinlog mysqlmanagerc mysqlmanager-pwgen From 0f9f2b02c1f87eef80b1ff0a6873be28ddcfc3fe Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 16 Nov 2004 14:36:25 +0400 Subject: [PATCH 0231/1063] A fix (bug #6449: DO server-crashing bug). sql/sql_yacc.yy: A fix (bug #6449: DO server-crashing bug). expr_list is used for DO command. --- mysql-test/r/select.result | 4 ++++ mysql-test/t/select.test | 9 +++++++++ sql/sql_yacc.yy | 9 +++++---- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result index ba0a80331b1..3417c7ecb85 100644 --- a/mysql-test/r/select.result +++ b/mysql-test/r/select.result @@ -2057,6 +2057,10 @@ t2 1 fld3 1 fld3 A NULL NULL NULL BTREE drop table t4, t3, t2, t1; DO 1; DO benchmark(100,1+1),1,1; +do default; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 +do foobar; +ERROR 42S22: Unknown column 'foobar' in 'field list' CREATE TABLE t1 ( id mediumint(8) unsigned NOT NULL auto_increment, pseudo varchar(35) NOT NULL default '', diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test index 5bae44796dc..3b36ba6bfb2 100644 --- a/mysql-test/t/select.test +++ b/mysql-test/t/select.test @@ -1756,6 +1756,15 @@ drop table t4, t3, t2, t1; DO 1; DO benchmark(100,1+1),1,1; +# +# Bug #6449: do default; +# + +--error 1064 +do default; +--error 1054 +do foobar; + # # random in WHERE clause # diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 521196085bb..8cbfaf3f99b 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -3932,11 +3932,12 @@ do: DO_SYM { LEX *lex=Lex; lex->sql_command = SQLCOM_DO; - if (!(lex->insert_list = new List_item)) - YYABORT; + mysql_init_select(lex); + } + expr_list + { + Lex->insert_list= $3; } - values - {} ; /* From 9ae173c4ff5f4aab480ac7d1d5f32d2ef24fdb25 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 16 Nov 2004 12:10:44 +0000 Subject: [PATCH 0232/1063] Also print warning if there is an ndb->mysql errorcode mapping, this since the warning provides valuable info to the user --- sql/ha_ndbcluster.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index d9545d5cbb8..bc1c887bfab 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -144,10 +144,17 @@ static int ndb_to_mysql_error(const NdbError *err) // Push the NDB error message as warning push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR, ER_GET_ERRMSG, ER(ER_GET_ERRMSG), - err->code, err->message, "NDB"); + err->code, err->message, "NDB"); return err->code; } } + // Push the NDB error message as warning + // this since e.g. HA_ERR_RECORD_FILE_FULL maps to + // several error codes in NDB, and the uses needs + // to know which one it is + push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR, + ER_GET_ERRMSG, ER(ER_GET_ERRMSG), + err->code, err->message, "NDB"); return err_map[i].my_err; } From b226bebcc81b820c10c8cadafbf9fc0483f780e3 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 16 Nov 2004 16:45:47 +0400 Subject: [PATCH 0233/1063] ctype-tis620.c: Space allocated didn't take in account trailing '\0' bytes. strings/ctype-tis620.c: Space allocated didn't take in account trailing '\0' bytes. --- strings/ctype-tis620.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/strings/ctype-tis620.c b/strings/ctype-tis620.c index 68bfefafe6a..5d37aa965d9 100644 --- a/strings/ctype-tis620.c +++ b/strings/ctype-tis620.c @@ -541,7 +541,7 @@ int my_strnncoll_tis620(CHARSET_INFO *cs __attribute__((unused)), tc1= buf; if ((len1 + len2 +2) > (int) sizeof(buf)) - tc1= (uchar*) malloc(len1+len2); + tc1= (uchar*) malloc(len1+len2+2); tc2= tc1 + len1+1; memcpy((char*) tc1, (char*) s1, len1); tc1[len1]= 0; /* if length(s1)> len1, need to put 'end of string' */ @@ -568,7 +568,7 @@ int my_strnncollsp_tis620(CHARSET_INFO * cs __attribute__((unused)), a= buf; if ((a_length + b_length +2) > (int) sizeof(buf)) - alloced= a= (uchar*) malloc(a_length+b_length); + alloced= a= (uchar*) malloc(a_length+b_length+2); b= a + a_length+1; memcpy((char*) a, (char*) a0, a_length); From c9a09e12db31c530ffa763e9657dd502db26c5d7 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 16 Nov 2004 13:56:25 +0000 Subject: [PATCH 0234/1063] ha_ndbcluster.cc: reverting previous patch sql/ha_ndbcluster.cc: reverting previous patch --- sql/ha_ndbcluster.cc | 7 ------- 1 file changed, 7 deletions(-) diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index bc1c887bfab..cdbf2eb3d6a 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -148,13 +148,6 @@ static int ndb_to_mysql_error(const NdbError *err) return err->code; } } - // Push the NDB error message as warning - // this since e.g. HA_ERR_RECORD_FILE_FULL maps to - // several error codes in NDB, and the uses needs - // to know which one it is - push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR, - ER_GET_ERRMSG, ER(ER_GET_ERRMSG), - err->code, err->message, "NDB"); return err_map[i].my_err; } From 16d735adb0cc7776da40838dd11810a1817f76ff Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 16 Nov 2004 20:37:42 +0200 Subject: [PATCH 0235/1063] ha_innodb.cc: Fix InnoDB bug #6287: if one uses INSERT IGNORE to insert several rows at a time, and the first inserts are ignored because of a duplicate key collision, then InnoDB in a replication slave assigns AUTO_INCREMENT values 1 bigger than in the master sql/ha_innodb.cc: Fix InnoDB bug #6287: if one uses INSERT IGNORE to insert several rows at a time, and the first inserts are ignored because of a duplicate key collision, then InnoDB in a replication slave assigns AUTO_INCREMENT values 1 bigger than in the master --- sql/ha_innodb.cc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index d57a9f73c91..91f92c8cadb 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -2172,8 +2172,9 @@ ha_innobase::write_row( same SQL statement! */ if (auto_inc == 0 && user_thd->next_insert_id != 0) { - auto_inc = user_thd->next_insert_id; - auto_inc_counter_for_this_stat = auto_inc; + + auto_inc_counter_for_this_stat + = user_thd->next_insert_id; } if (auto_inc == 0 && auto_inc_counter_for_this_stat) { @@ -2181,14 +2182,14 @@ ha_innobase::write_row( this SQL statement with SET INSERT_ID. We must assign sequential values from the counter. */ - auto_inc_counter_for_this_stat++; - incremented_auto_inc_for_stat = TRUE; - auto_inc = auto_inc_counter_for_this_stat; /* We give MySQL a new value to place in the auto-inc column */ user_thd->next_insert_id = auto_inc; + + auto_inc_counter_for_this_stat++; + incremented_auto_inc_for_stat = TRUE; } if (auto_inc != 0) { From 7d074100d34faca504e95e68bd89da4012cd9d4d Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 16 Nov 2004 20:45:52 +0200 Subject: [PATCH 0236/1063] ha_innodb.cc: Manually ported this bug fix from 4.0: Fix InnoDB bug #6287: if one uses INSERT IGNORE to insert several rows at a time, and the first inserts are ignored because of a duplicate key collision, then InnoDB in a replication slave assigns AUTO_INCREMENT values 1 bigger than in the master sql/ha_innodb.cc: Fix InnoDB bug #6287: if one uses INSERT IGNORE to insert several rows at a time, and the first inserts are ignored because of a duplicate key collision, then InnoDB in a replication slave assigns AUTO_INCREMENT values 1 bigger than in the master --- sql/ha_innodb.cc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index 6e08fc680b2..8e9e5fd9ed0 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -2390,8 +2390,9 @@ ha_innobase::write_row( same SQL statement! */ if (auto_inc == 0 && user_thd->next_insert_id != 0) { - auto_inc = user_thd->next_insert_id; - auto_inc_counter_for_this_stat = auto_inc; + + auto_inc_counter_for_this_stat + = user_thd->next_insert_id; } if (auto_inc == 0 && auto_inc_counter_for_this_stat) { @@ -2399,14 +2400,14 @@ ha_innobase::write_row( this SQL statement with SET INSERT_ID. We must assign sequential values from the counter. */ - auto_inc_counter_for_this_stat++; - incremented_auto_inc_for_stat = TRUE; - auto_inc = auto_inc_counter_for_this_stat; /* We give MySQL a new value to place in the auto-inc column */ user_thd->next_insert_id = auto_inc; + + auto_inc_counter_for_this_stat++; + incremented_auto_inc_for_stat = TRUE; } if (auto_inc != 0) { From a710ebb41347be2985027f279bc1533203be6ec9 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 16 Nov 2004 23:27:31 +0300 Subject: [PATCH 0237/1063] Fix comment. sql/item_func.cc: Fix comment (used_table_cache is completely different from used_tables_cache :) --- sql/item_func.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/item_func.cc b/sql/item_func.cc index bf85e5b378a..c07e9f23ea2 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -264,7 +264,7 @@ Item_func::Item_func(THD *thd, Item_func *item) Sets as a side effect the following class variables: maybe_null Set if any argument may return NULL with_sum_func Set if any of the arguments contains a sum function - used_table_cache Set to union of the arguments used table + used_tables_cache Set to union of the tables used by arguments str_value.charset If this is a string function, set this to the character set for the first argument. From d711df11f558547b2351097cc8cc7e8b2d2b7344 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 16 Nov 2004 22:49:28 +0200 Subject: [PATCH 0238/1063] ha_innodb.cc: Anthony's http://lists.mysql.com/internals/18505 patch for DROP DATABASE broke caused it to return errno if .ibd files were present (bas_ext() was obsolete in ha_innodb.cc); fix this sql/ha_innodb.cc: Anthony's http://lists.mysql.com/internals/18505 patch for DROP DATABASE broke caused it to return errno if .ibd files were present (bas_ext() was obsolete in ha_innodb.cc); fix this --- sql/ha_innodb.cc | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index 8e9e5fd9ed0..07d8da63733 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -1505,17 +1505,14 @@ innobase_close_connection( *****************************************************************************/ /******************************************************************** -This function is not relevant since we store the tables and indexes -into our own tablespace, not as files, whose extension this function would -give. */ +Gives the file extension of an InnoDB single-table tablespace. */ const char** ha_innobase::bas_ext() const /*========================*/ - /* out: file extension strings, currently not - used */ + /* out: file extension string */ { - static const char* ext[] = {".InnoDB", NullS}; + static const char* ext[] = {".ibd", NullS}; return(ext); } From 70ed3160d97d66da74ab031dde64217d501abd6e Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 16 Nov 2004 22:58:02 +0200 Subject: [PATCH 0239/1063] backport Serg's fix of FT interface (BUG#6523) mysql-test/r/subselect.result: subqueries with full text search mysql-test/t/subselect.test: subqueries with full text search sql/ha_myisam.h: backport Serg's fix of FT interface sql/handler.h: backport Serg's fix of FT interface sql/opt_range.h: backport Serg's fix of FT interface sql/sql_select.cc: comment for previous patch --- mysql-test/r/subselect.result | 8 ++++++++ mysql-test/t/subselect.test | 10 ++++++++++ sql/ha_myisam.h | 1 - sql/handler.h | 1 + sql/opt_range.h | 2 +- sql/sql_select.cc | 2 +- 6 files changed, 21 insertions(+), 3 deletions(-) diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index 2d686285050..f3c4be847ea 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -2003,3 +2003,11 @@ a b (select max(b) from t2 where t1.b=t2.a) 2 4 NULL 2 5 NULL drop table t1, t2; +create table t1 (id int); +create table t2 (id int, body text, fulltext (body)); +insert into t1 values(1),(2),(3); +insert into t2 values (1,'test'), (2,'mysql'), (3,'test'), (4,'test'); +select count(distinct id) from t1 where id in (select id from t2 where match(body) against ('mysql' in boolean mode)); +count(distinct id) +1 +drop table t2,t1; diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test index 976ce7bf6b0..18f7d96b236 100644 --- a/mysql-test/t/subselect.test +++ b/mysql-test/t/subselect.test @@ -1299,3 +1299,13 @@ insert into t1 values (1,1),(1,2),(1,3),(2,4),(2,5); insert into t2 values (1,3),(2,1); select distinct a,b, (select max(b) from t2 where t1.b=t2.a) from t1 order by t1.b; drop table t1, t2; + +# +# subqueries with full text search +# +create table t1 (id int); +create table t2 (id int, body text, fulltext (body)); +insert into t1 values(1),(2),(3); +insert into t2 values (1,'test'), (2,'mysql'), (3,'test'), (4,'test'); +select count(distinct id) from t1 where id in (select id from t2 where match(body) against ('mysql' in boolean mode)); +drop table t2,t1; diff --git a/sql/ha_myisam.h b/sql/ha_myisam.h index 6fde84d6f6f..972d6b18e19 100644 --- a/sql/ha_myisam.h +++ b/sql/ha_myisam.h @@ -81,7 +81,6 @@ class ha_myisam: public handler int index_first(byte * buf); int index_last(byte * buf); int index_next_same(byte *buf, const byte *key, uint keylen); - int index_end() { ft_handler=NULL; return 0; } int ft_init() { if (!ft_handler) diff --git a/sql/handler.h b/sql/handler.h index 252861e5c37..245defe61e0 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -372,6 +372,7 @@ public: virtual int read_range_next(); int compare_key(key_range *range); virtual int ft_init() { return HA_ERR_WRONG_COMMAND; } + void ft_end() { ft_handler=NULL; } virtual FT_INFO *ft_init_ext(uint flags,uint inx,const byte *key, uint keylen) { return NULL; } diff --git a/sql/opt_range.h b/sql/opt_range.h index 9b2e9e45bac..5a2044a59f4 100644 --- a/sql/opt_range.h +++ b/sql/opt_range.h @@ -154,7 +154,7 @@ class FT_SELECT: public QUICK_SELECT { public: FT_SELECT(THD *thd, TABLE *table, uint key): QUICK_SELECT (thd, table, key, 1) { init(); } - + ~FT_SELECT() { file->ft_end(); } int init() { return error= file->ft_init(); } int get_next() { return error= file->ft_read(record); } }; diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 06731d26073..5809bd2b7be 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -3834,7 +3834,7 @@ JOIN::join_free(bool full) DBUG_ENTER("JOIN::join_free"); full= full || (!select_lex->uncacheable && - !thd->lex->describe); + !thd->lex->describe); // do not cleanup too early on EXPLAIN if (table) { From 2094d80b48a33e2cf79b9ac13b7bcd0ba7c33ca9 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 16 Nov 2004 13:58:49 -0800 Subject: [PATCH 0240/1063] key_cache.result, key_cache.test: Added a test case for bug #6447. mf_keycache.c: Fixed bug #6447. Erronious code in the key_cache_read function caused problems when reading key blocks with offset>0 into key cache. The code of key_cache_insert and key_cache_write was modified similarly. mysys/mf_keycache.c: Fixed bug #6447. Erronious code in the key_cache_read function caused problems when reading key blocks with offset>0 into key cache. The code of key_cache_insert and key_cache_write was modified similarly. mysql-test/t/key_cache.test: Added a test case for bug #6447. mysql-test/r/key_cache.result: Added a test case for bug #6447. --- mysql-test/r/key_cache.result | 10 ++++++++++ mysql-test/t/key_cache.test | 11 +++++++++++ mysys/mf_keycache.c | 25 +++++++++++++------------ 3 files changed, 34 insertions(+), 12 deletions(-) diff --git a/mysql-test/r/key_cache.result b/mysql-test/r/key_cache.result index fe8708f882d..79b5a6e84b2 100644 --- a/mysql-test/r/key_cache.result +++ b/mysql-test/r/key_cache.result @@ -277,3 +277,13 @@ Key_blocks_unused KEY_BLOCKS_UNUSED set global keycache2.key_buffer_size=0; set global keycache3.key_buffer_size=100; set global keycache3.key_buffer_size=0; +create table t1 (mytext text, FULLTEXT (mytext)); +insert t1 values ('aaabbb'); +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK +set GLOBAL key_cache_block_size=2048; +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK +drop table t1; diff --git a/mysql-test/t/key_cache.test b/mysql-test/t/key_cache.test index 9d3125efa61..6dee87ec5a6 100644 --- a/mysql-test/t/key_cache.test +++ b/mysql-test/t/key_cache.test @@ -156,3 +156,14 @@ set global keycache2.key_buffer_size=0; # Test to set up a too small size for a key cache (bug #2064) set global keycache3.key_buffer_size=100; set global keycache3.key_buffer_size=0; + +# Test case for buf 6447 + +create table t1 (mytext text, FULLTEXT (mytext)); +insert t1 values ('aaabbb'); + +check table t1; +set GLOBAL key_cache_block_size=2048; +check table t1; + +drop table t1; diff --git a/mysys/mf_keycache.c b/mysys/mf_keycache.c index 11aadbed6c1..052d6c79ab9 100644 --- a/mysys/mf_keycache.c +++ b/mysys/mf_keycache.c @@ -1699,11 +1699,12 @@ byte *key_cache_read(KEY_CACHE *keycache, keycache_pthread_mutex_unlock(&keycache->cache_lock); goto no_key_cache; } - read_length= length > keycache->key_cache_block_size ? - keycache->key_cache_block_size : length; - KEYCACHE_DBUG_ASSERT(read_length > 0); offset= (uint) (filepos & (keycache->key_cache_block_size-1)); filepos-= offset; + read_length= length; + set_if_smaller(read_length, keycache->key_cache_block_size-offset); + KEYCACHE_DBUG_ASSERT(read_length > 0); + #ifndef THREAD if (block_length > keycache->key_cache_block_size || offset) return_buffer=0; @@ -1773,7 +1774,7 @@ byte *key_cache_read(KEY_CACHE *keycache, return (block->buffer); #endif buff+= read_length; - filepos+= read_length; + filepos+= read_length+offset; } while ((length-= read_length)); DBUG_RETURN(start); @@ -1835,12 +1836,12 @@ int key_cache_insert(KEY_CACHE *keycache, keycache_pthread_mutex_unlock(&keycache->cache_lock); DBUG_RETURN(0); } - read_length= length > keycache->key_cache_block_size ? - keycache->key_cache_block_size : length; - KEYCACHE_DBUG_ASSERT(read_length > 0); offset= (uint) (filepos & (keycache->key_cache_block_size-1)); /* Read data into key cache from buff in key_cache_block_size incr. */ filepos-= offset; + read_length= length; + set_if_smaller(read_length, keycache->key_cache_block_size-offset); + KEYCACHE_DBUG_ASSERT(read_length > 0); inc_counter_for_resize_op(keycache); keycache->global_cache_r_requests++; @@ -1882,7 +1883,7 @@ int key_cache_insert(KEY_CACHE *keycache, DBUG_RETURN(1); buff+= read_length; - filepos+= read_length; + filepos+= read_length+offset; } while ((length-= read_length)); } @@ -1959,12 +1960,12 @@ int key_cache_write(KEY_CACHE *keycache, keycache_pthread_mutex_unlock(&keycache->cache_lock); goto no_key_cache; } - read_length= length > keycache->key_cache_block_size ? - keycache->key_cache_block_size : length; - KEYCACHE_DBUG_ASSERT(read_length > 0); offset= (uint) (filepos & (keycache->key_cache_block_size-1)); /* Write data in key_cache_block_size increments */ filepos-= offset; + read_length= length; + set_if_smaller(read_length, keycache->key_cache_block_size-offset); + KEYCACHE_DBUG_ASSERT(read_length > 0); inc_counter_for_resize_op(keycache); keycache->global_cache_w_requests++; @@ -2032,7 +2033,7 @@ int key_cache_write(KEY_CACHE *keycache, next_block: buff+= read_length; - filepos+= read_length; + filepos+= read_length+offset; offset= 0; } while ((length-= read_length)); From e0b0c0763291f5063255d4cc3f412fc37ac90a46 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 16 Nov 2004 23:45:24 +0100 Subject: [PATCH 0241/1063] Add --order-by-primary option, which adds an ORDER BY clause the the SELECT statement used to dump the data for any table which has a primary or unique key. This is useful for dumping MyISAM tables which will be later imported into InnoDB tables. client/client_priv.h: add option OPT_ORDER_BY_PRIMARY --- client/client_priv.h | 2 +- client/mysqldump.c | 149 ++++++++++++++++++++++++++++++++++++------- 2 files changed, 126 insertions(+), 25 deletions(-) diff --git a/client/client_priv.h b/client/client_priv.h index f16ec0e802b..39ecd32068e 100644 --- a/client/client_priv.h +++ b/client/client_priv.h @@ -45,5 +45,5 @@ enum options_client OPT_COMPATIBLE, OPT_RECONNECT, OPT_DELIMITER, OPT_SECURE_AUTH, OPT_OPEN_FILES_LIMIT, OPT_SET_CHARSET, OPT_CREATE_OPTIONS, OPT_START_POSITION, OPT_STOP_POSITION, OPT_START_DATETIME, OPT_STOP_DATETIME, - OPT_SIGINT_IGNORE, OPT_HEXBLOB + OPT_SIGINT_IGNORE, OPT_HEXBLOB, OPT_ORDER_BY_PRIMARY }; diff --git a/client/mysqldump.c b/client/mysqldump.c index 1686278096b..ba903ec1796 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -75,20 +75,20 @@ static ulong find_set(TYPELIB *lib, const char *x, uint length, static char *field_escape(char *to,const char *from,uint length); static my_bool verbose=0,tFlag=0,cFlag=0,dFlag=0,quick= 1, extended_insert= 1, - lock_tables=1,ignore_errors=0,flush_logs=0,replace=0, - ignore=0,opt_drop=1,opt_keywords=0,opt_lock=1,opt_compress=0, + lock_tables=1,ignore_errors=0,flush_logs=0, + opt_drop=1,opt_keywords=0,opt_lock=1,opt_compress=0, opt_delayed=0,create_options=1,opt_quoted=0,opt_databases=0, opt_alldbs=0,opt_create_db=0,opt_first_slave=0,opt_set_charset, opt_autocommit=0,opt_master_data,opt_disable_keys=1,opt_xml=0, opt_delete_master_logs=0, tty_password=0, opt_single_transaction=0, opt_comments= 0, opt_compact= 0, - opt_hex_blob=0; + opt_hex_blob=0, opt_order_by_primary=0; static ulong opt_max_allowed_packet, opt_net_buffer_length; static MYSQL mysql_connection,*sock=0; static char insert_pat[12 * 1024],*opt_password=0,*current_user=0, *current_host=0,*path=0,*fields_terminated=0, *lines_terminated=0, *enclosed=0, *opt_enclosed=0, *escaped=0, - *where=0, + *where=0, *order_by=0, *opt_compatible_mode_str= 0, *err_ptr= 0; static char compatible_mode_normal_str[255]; @@ -287,6 +287,9 @@ static struct my_option my_long_options[] = {"socket", 'S', "Socket file to use for connection.", (gptr*) &opt_mysql_unix_port, (gptr*) &opt_mysql_unix_port, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"order-by-primary", OPT_ORDER_BY_PRIMARY, + "Sorts each table's rows by primary key, or first unique key, if such a key exists. Useful if dump will be loaded into an InnoDB table.", + 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, #include {"tab",'T', "Creates tab separated textfile for each table to given path. (creates .sql and .txt files). NOTE: This only works if mysqldump is run on the same machine as the mysqld daemon.", @@ -336,6 +339,7 @@ static int dump_databases(char **); static int dump_all_databases(); static char *quote_name(const char *name, char *buff, my_bool force); static const char *check_if_ignore_table(const char *table_name); +static char *primary_key_fields(const char *table_name); #include @@ -539,6 +543,9 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), opt_comments= opt_drop= opt_disable_keys= opt_lock= 0; opt_set_charset= 0; } + case (int) OPT_ORDER_BY_PRIMARY: + opt_order_by_primary = 1; + break; case (int) OPT_TABLES: opt_databases=0; break; @@ -630,11 +637,6 @@ static int get_options(int *argc, char ***argv) fprintf(stderr, "%s: You can't use ..enclosed.. and ..optionally-enclosed.. at the same time.\n", my_progname); return(1); } - if (replace && ignore) - { - fprintf(stderr, "%s: You can't use --ignore (-i) and --replace (-r) at the same time.\n",my_progname); - return(1); - } if ((opt_databases || opt_alldbs) && path) { fprintf(stderr, @@ -685,7 +687,6 @@ static void safe_exit(int error) /* ** dbConnect -- connects to the host and selects DB. -** Also checks whether the tablename is a valid table name. */ static int dbConnect(char *host, char *user,char *passwd) { @@ -820,7 +821,7 @@ static char *quote_for_like(const char *name, char *buff) len - its length DESCRIPTION - Quote '<' '>' '&' '\"' singns and print a string to the xml_file. + Quote '<' '>' '&' '\"' chars and print a string to the xml_file. */ static void print_quoted_xml(FILE *xml_file, const char *str, ulong len) @@ -961,6 +962,10 @@ static uint getTableStructure(char *table, char* db) result_table= quote_name(table, table_buff, 1); opt_quoted_table= quote_name(table, table_buff2, 0); + + if (opt_order_by_primary) + order_by = primary_key_fields(opt_quoted_table); + if (!opt_xml && !mysql_query(sock,insert_pat)) { /* using SHOW CREATE statement */ @@ -1387,10 +1392,6 @@ static void dumpTable(uint numFields, char *table) sprintf(query, "SELECT /*!40001 SQL_NO_CACHE */ * INTO OUTFILE '%s'", filename); end= strend(query); - if (replace) - end= strmov(end, " REPLACE"); - if (ignore) - end= strmov(end, " IGNORE"); if (fields_terminated || enclosed || opt_enclosed || escaped) end= strmov(end, " FIELDS"); @@ -1403,10 +1404,17 @@ static void dumpTable(uint numFields, char *table) sprintf(buff," FROM %s", result_table); end= strmov(end,buff); - if (where) + if (where || order_by) { - query= alloc_query_str((ulong) (strlen(where) + (end - query) + 10)); - end= strxmov(query, query_buf, " WHERE ", where, NullS); + query = alloc_query_str((ulong) ((end - query) + 1 + + (where ? strlen(where) + 7 : 0) + + (order_by ? strlen(order_by) + 10 : 0))); + end = strmov(query, query_buf); + + if (where) + end = strxmov(end, " WHERE ", where, NullS); + if (order_by) + end = strxmov(end, " ORDER BY ", order_by, NullS); } if (mysql_real_query(sock, query, (uint) (end - query))) { @@ -1424,21 +1432,38 @@ static void dumpTable(uint numFields, char *table) } sprintf(query, "SELECT /*!40001 SQL_NO_CACHE */ * FROM %s", result_table); - if (where) + if (where || order_by) { - if (!opt_xml && opt_comments) + query = alloc_query_str((ulong) (strlen(query) + 1 + + (where ? strlen(where) + 7 : 0) + + (order_by ? strlen(order_by) + 10 : 0))); + end = strmov(query, query_buf); + + if (where) { - fprintf(md_result_file,"-- WHERE: %s\n",where); - check_io(md_result_file); + if (!opt_xml && opt_comments) + { + fprintf(md_result_file, "-- WHERE: %s\n", where); + check_io(md_result_file); + } + end = strxmov(end, " WHERE ", where, NullS); + } + if (order_by) + { + if (!opt_xml && opt_comments) + { + fprintf(md_result_file, "-- ORDER BY: %s\n", order_by); + check_io(md_result_file); + } + end = strxmov(end, " ORDER BY ", order_by, NullS); } - query= alloc_query_str((ulong) (strlen(where) + strlen(query) + 10)); - strxmov(query, query_buf, " WHERE ", where, NullS); } if (!opt_xml && !opt_compact) { fputs("\n", md_result_file); check_io(md_result_file); } + fprintf(stderr, "-- [%s]\n", query); if (mysql_query(sock, query)) { DBerror(sock, "when retrieving data from server"); @@ -1749,6 +1774,8 @@ static void dumpTable(uint numFields, char *table) err: if (query != query_buf) my_free(query, MYF(MY_ALLOW_ZERO_PTR)); + if (order_by) + my_free(order_by, MYF(0)); safe_exit(error); return; } /* dumpTable */ @@ -2091,6 +2118,80 @@ static const char *check_if_ignore_table(const char *table_name) return result; } +/* + Get string of comma-separated primary key field names + + SYNOPSIS + char *primary_key_fields(const char *table_name) + RETURNS pointer to allocated buffer (must be freed by caller) + table_name quoted table name + + DESCRIPTION + Use SHOW KEYS FROM table_name, allocate a buffer to hold the + field names, and then build that string and return the pointer + to that buffer. + + Returns NULL if there is no PRIMARY or UNIQUE key on the table, + or if there is some failure. It is better to continue to dump + the table unsorted, rather than exit without dumping the data. +*/ +static char *primary_key_fields(const char *table_name) +{ + MYSQL_RES *res = NULL; + MYSQL_ROW row; + /* SHOW KEYS FROM + table name * 2 (escaped) + 2 quotes + \0 */ + char show_keys_buff[15 + 64 * 2 + 3]; + uint result_length = 0, first_unique_pos = 0; + char *result = 0; + + sprintf(show_keys_buff, "SHOW KEYS FROM %s", table_name); + if (mysql_query(sock, show_keys_buff) || + !(res = mysql_store_result(sock))) + { + fprintf(stderr, "Warning: Couldn't read keys from table %s;" + " records are NOT sorted (%s)\n", + table_name, mysql_error(sock)); + /* Don't exit, because it's better to print out unsorted records */ + goto cleanup; + } + + /* Figure out the length of the ORDER BY clause result */ + while ((row = mysql_fetch_row(res))) + { + if (atoi(row[1]) == 0) /* Key is unique */ + { + do + result_length += strlen(row[4]) + 1; /* + 1 for ',' or \0 */ + while ((row = mysql_fetch_row(res)) && atoi(row[3]) > 1); + + break; + } + ++first_unique_pos; + } + + /* Build the ORDER BY clause result */ + if (result_length) { + char *end; + /* result (terminating \0 is already in result_length) */ + result = my_malloc(result_length + 10, MYF(MY_WME)); + if (!result) { + fprintf(stderr, "Error: Not enough memory to store ORDER BY clause\n"); + goto cleanup; + } + mysql_data_seek(res, first_unique_pos); + row = mysql_fetch_row(res); + end = strmov(result, row[4]); + while ((row = mysql_fetch_row(res)) && atoi(row[3]) > 1) + end = strxmov(end, ",", row[4], NullS); + } + +cleanup: + if (res) + mysql_free_result(res); + + return result; +} + int main(int argc, char **argv) { From 692311f53c08b99b3d9353e8f50927df445a0dc5 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 17 Nov 2004 08:10:26 +0000 Subject: [PATCH 0242/1063] enabled having system tables in ndb --- sql/sql_acl.cc | 37 +++++++++++++++++++++++++++---------- 1 file changed, 27 insertions(+), 10 deletions(-) diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 98af43e17a7..d6f52fed1d2 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -1384,8 +1384,10 @@ static bool update_user_table(THD *thd, const char *host, const char *user, table->field[0]->store(host,(uint) strlen(host), &my_charset_latin1); table->field[1]->store(user,(uint) strlen(user), &my_charset_latin1); + table->file->extra(HA_EXTRA_RETRIEVE_ALL_COLS); if (table->file->index_read_idx(table->record[0],0, - (byte*) table->field[0]->ptr,0, + (byte*) table->field[0]->ptr, + table->key_info[0].key_length, HA_READ_KEY_EXACT)) { my_error(ER_PASSWORD_NO_MATCH,MYF(0)); /* purecov: deadcode */ @@ -1463,9 +1465,11 @@ static int replace_user_table(THD *thd, TABLE *table, const LEX_USER &combo, table->field[0]->store(combo.host.str,combo.host.length, &my_charset_latin1); table->field[1]->store(combo.user.str,combo.user.length, &my_charset_latin1); + table->file->extra(HA_EXTRA_RETRIEVE_ALL_COLS); if (table->file->index_read_idx(table->record[0], 0, - (byte*) table->field[0]->ptr,0, - HA_READ_KEY_EXACT)) + (byte*) table->field[0]->ptr, + table->key_info[0].key_length, + HA_READ_KEY_EXACT)) { if (!create_user) { @@ -1568,6 +1572,7 @@ static int replace_user_table(THD *thd, TABLE *table, const LEX_USER &combo, We should NEVER delete from the user table, as a uses can still use mysqld even if he doesn't have any privileges in the user table! */ + table->file->extra(HA_EXTRA_RETRIEVE_ALL_COLS); if (cmp_record(table,record[1]) && (error=table->file->update_row(table->record[1],table->record[0]))) { // This should never happen @@ -1645,8 +1650,11 @@ static int replace_db_table(TABLE *table, const char *db, table->field[0]->store(combo.host.str,combo.host.length, &my_charset_latin1); table->field[1]->store(db,(uint) strlen(db), &my_charset_latin1); table->field[2]->store(combo.user.str,combo.user.length, &my_charset_latin1); - if (table->file->index_read_idx(table->record[0],0,(byte*) table->field[0]->ptr,0, - HA_READ_KEY_EXACT)) + table->file->extra(HA_EXTRA_RETRIEVE_ALL_COLS); + if (table->file->index_read_idx(table->record[0],0, + (byte*) table->field[0]->ptr, + table->key_info[0].key_length, + HA_READ_KEY_EXACT)) { if (what == 'N') { // no row, no revoke @@ -1679,6 +1687,7 @@ static int replace_db_table(TABLE *table, const char *db, /* update old existing row */ if (rights) { + table->file->extra(HA_EXTRA_RETRIEVE_ALL_COLS); if ((error=table->file->update_row(table->record[1],table->record[0]))) goto table_error; /* purecov: deadcode */ } @@ -1953,8 +1962,10 @@ static int replace_column_table(GRANT_TABLE *g_t, table->field[4]->store(xx->column.ptr(),xx->column.length(), &my_charset_latin1); + table->file->extra(HA_EXTRA_RETRIEVE_ALL_COLS); if (table->file->index_read(table->record[0],(byte*) table->field[0]->ptr, - 0, HA_READ_KEY_EXACT)) + table->key_info[0].key_length, + HA_READ_KEY_EXACT)) { if (revoke_grant) { @@ -2022,8 +2033,10 @@ static int replace_column_table(GRANT_TABLE *g_t, if (revoke_grant) { + table->file->extra(HA_EXTRA_RETRIEVE_ALL_COLS); if (table->file->index_read(table->record[0], (byte*) table->field[0]->ptr, - key_length, HA_READ_KEY_EXACT)) + table->key_info[0].key_length, + HA_READ_KEY_EXACT)) goto end; /* Scan through all rows with the same host,db,user and table */ @@ -2112,9 +2125,10 @@ static int replace_table_table(THD *thd, GRANT_TABLE *grant_table, table->field[2]->store(combo.user.str,combo.user.length, &my_charset_latin1); table->field[3]->store(table_name,(uint) strlen(table_name), &my_charset_latin1); store_record(table,record[1]); // store at pos 1 - + table->file->extra(HA_EXTRA_RETRIEVE_ALL_COLS); if (table->file->index_read_idx(table->record[0],0, - (byte*) table->field[0]->ptr,0, + (byte*) table->field[0]->ptr, + table->key_info[0].key_length, HA_READ_KEY_EXACT)) { /* @@ -3571,9 +3585,12 @@ int mysql_drop_user(THD *thd, List &list) tables[0].table->field[1]->store(user_name->user.str,(uint) user_name->user.length, system_charset_info); + tables[0].table->file->extra(HA_EXTRA_RETRIEVE_ALL_COLS); if (!tables[0].table->file->index_read_idx(tables[0].table->record[0],0, (byte*) tables[0].table-> - field[0]->ptr,0, + field[0]->ptr, + tables[0].table-> + key_info[0].key_length, HA_READ_KEY_EXACT)) { int error; From c617037b2308181bc82d6c36b8b9b718d54af17d Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 17 Nov 2004 08:15:53 +0000 Subject: [PATCH 0243/1063] Enabled usage of new system variables for ndb - ndb_use_exact_count - ndb_autoincrement_prefetch_sz - ndb_use_transactions - ndb_force_send moved "inlined" functions to .cc file since they are virtual anyways enabled printout od ndb errors in warnings even if mapping existst to mysql error code sql/ha_ndbcluster.h: Enabled usage of new system variables for ndb - ndb_use_exact_count - ndb_autoincrement_prefetch_sz - ndb_use_transactions - ndb_force_send moved "inlined" functions to .cc file since they are virtual anyways sql/mysqld.cc: Enabled usage of new system variables for ndb - ndb_use_exact_count - ndb_autoincrement_prefetch_sz - ndb_use_transactions - ndb_force_send sql/set_var.cc: Enabled usage of new system variables for ndb - ndb_use_exact_count - ndb_autoincrement_prefetch_sz - ndb_use_transactions - ndb_force_send sql/sql_class.h: Enabled usage of new system variables for ndb - ndb_use_exact_count - ndb_autoincrement_prefetch_sz - ndb_use_transactions - ndb_force_send --- sql/ha_ndbcluster.cc | 194 +++++++++++++++++++++++++++++++------------ sql/ha_ndbcluster.h | 46 ++++------ sql/mysqld.cc | 34 +++++++- sql/set_var.cc | 32 ++++++- sql/sql_class.h | 6 ++ 5 files changed, 223 insertions(+), 89 deletions(-) diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index bc1c887bfab..8ef24ad5af1 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -39,9 +39,6 @@ static const int parallelism= 240; // createable against NDB from this handler static const int max_transactions= 256; -// Default value for prefetch of autoincrement values -static const ha_rows autoincrement_prefetch= 32; - // connectstring to cluster if given by mysqld const char *ndbcluster_connectstring= 0; @@ -103,58 +100,52 @@ struct err_code_mapping { int ndb_err; int my_err; + int show_warning; }; static const err_code_mapping err_map[]= { - { 626, HA_ERR_KEY_NOT_FOUND }, - { 630, HA_ERR_FOUND_DUPP_KEY }, - { 893, HA_ERR_FOUND_DUPP_UNIQUE }, - { 721, HA_ERR_TABLE_EXIST }, - { 4244, HA_ERR_TABLE_EXIST }, + { 626, HA_ERR_KEY_NOT_FOUND, 0 }, + { 630, HA_ERR_FOUND_DUPP_KEY, 0 }, + { 893, HA_ERR_FOUND_DUPP_UNIQUE, 0 }, + { 721, HA_ERR_TABLE_EXIST, 1 }, + { 4244, HA_ERR_TABLE_EXIST, 1 }, - { 709, HA_ERR_NO_SUCH_TABLE }, - { 284, HA_ERR_NO_SUCH_TABLE }, + { 709, HA_ERR_NO_SUCH_TABLE, 1 }, + { 284, HA_ERR_NO_SUCH_TABLE, 1 }, - { 266, HA_ERR_LOCK_WAIT_TIMEOUT }, - { 274, HA_ERR_LOCK_WAIT_TIMEOUT }, - { 296, HA_ERR_LOCK_WAIT_TIMEOUT }, - { 297, HA_ERR_LOCK_WAIT_TIMEOUT }, - { 237, HA_ERR_LOCK_WAIT_TIMEOUT }, + { 266, HA_ERR_LOCK_WAIT_TIMEOUT, 1 }, + { 274, HA_ERR_LOCK_WAIT_TIMEOUT, 1 }, + { 296, HA_ERR_LOCK_WAIT_TIMEOUT, 1 }, + { 297, HA_ERR_LOCK_WAIT_TIMEOUT, 1 }, + { 237, HA_ERR_LOCK_WAIT_TIMEOUT, 1 }, - { 623, HA_ERR_RECORD_FILE_FULL }, - { 624, HA_ERR_RECORD_FILE_FULL }, - { 625, HA_ERR_RECORD_FILE_FULL }, - { 826, HA_ERR_RECORD_FILE_FULL }, - { 827, HA_ERR_RECORD_FILE_FULL }, - { 832, HA_ERR_RECORD_FILE_FULL }, + { 623, HA_ERR_RECORD_FILE_FULL, 1 }, + { 624, HA_ERR_RECORD_FILE_FULL, 1 }, + { 625, HA_ERR_RECORD_FILE_FULL, 1 }, + { 826, HA_ERR_RECORD_FILE_FULL, 1 }, + { 827, HA_ERR_RECORD_FILE_FULL, 1 }, + { 832, HA_ERR_RECORD_FILE_FULL, 1 }, - { 0, 1 }, + { 0, 1, 0 }, - { -1, -1 } + { -1, -1, 1 } }; static int ndb_to_mysql_error(const NdbError *err) { uint i; - for (i=0 ; err_map[i].ndb_err != err->code ; i++) + for (i=0; err_map[i].ndb_err != err->code && err_map[i].my_err != -1; i++); + if (err_map[i].show_warning) { - if (err_map[i].my_err == -1){ - // Push the NDB error message as warning - push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR, - ER_GET_ERRMSG, ER(ER_GET_ERRMSG), - err->code, err->message, "NDB"); - return err->code; - } + // Push the NDB error message as warning + push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR, + ER_GET_ERRMSG, ER(ER_GET_ERRMSG), + err->code, err->message, "NDB"); } - // Push the NDB error message as warning - // this since e.g. HA_ERR_RECORD_FILE_FULL maps to - // several error codes in NDB, and the uses needs - // to know which one it is - push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR, - ER_GET_ERRMSG, ER(ER_GET_ERRMSG), - err->code, err->message, "NDB"); + if (err_map[i].my_err == -1) + return err->code; return err_map[i].my_err; } @@ -168,7 +159,7 @@ int execute_no_commit(ha_ndbcluster *h, NdbConnection *trans) if (m_batch_execute) return 0; #endif - return trans->execute(NoCommit,AbortOnError,1); + return trans->execute(NoCommit,AbortOnError,h->m_force_send); } inline @@ -179,7 +170,18 @@ int execute_commit(ha_ndbcluster *h, NdbConnection *trans) if (m_batch_execute) return 0; #endif - return trans->execute(Commit,AbortOnError,1); + return trans->execute(Commit,AbortOnError,h->m_force_send); +} + +inline +int execute_commit(THD *thd, NdbConnection *trans) +{ + int m_batch_execute= 0; +#ifdef NOT_USED + if (m_batch_execute) + return 0; +#endif + return trans->execute(Commit,AbortOnError,thd->variables.ndb_force_send); } inline @@ -190,7 +192,7 @@ int execute_no_commit_ie(ha_ndbcluster *h, NdbConnection *trans) if (m_batch_execute) return 0; #endif - return trans->execute(NoCommit,IgnoreError,1); + return trans->execute(NoCommit,IgnoreError,h->m_force_send); } /* @@ -233,6 +235,8 @@ void ha_ndbcluster::set_rec_per_key() void ha_ndbcluster::records_update() { + if (m_ha_not_exact_count) + return; DBUG_ENTER("ha_ndbcluster::records_update"); struct Ndb_table_local_info *info= (struct Ndb_table_local_info *)m_table_info; DBUG_PRINT("info", ("id=%d, no_uncommitted_rows_count=%d", @@ -256,6 +260,8 @@ void ha_ndbcluster::records_update() void ha_ndbcluster::no_uncommitted_rows_execute_failure() { + if (m_ha_not_exact_count) + return; DBUG_ENTER("ha_ndbcluster::no_uncommitted_rows_execute_failure"); THD *thd= current_thd; ((Thd_ndb*)(thd->transaction.thd_ndb))->error= 1; @@ -264,6 +270,8 @@ void ha_ndbcluster::no_uncommitted_rows_execute_failure() void ha_ndbcluster::no_uncommitted_rows_init(THD *thd) { + if (m_ha_not_exact_count) + return; DBUG_ENTER("ha_ndbcluster::no_uncommitted_rows_init"); struct Ndb_table_local_info *info= (struct Ndb_table_local_info *)m_table_info; Thd_ndb *thd_ndb= (Thd_ndb *)thd->transaction.thd_ndb; @@ -281,6 +289,8 @@ void ha_ndbcluster::no_uncommitted_rows_init(THD *thd) void ha_ndbcluster::no_uncommitted_rows_update(int c) { + if (m_ha_not_exact_count) + return; DBUG_ENTER("ha_ndbcluster::no_uncommitted_rows_update"); struct Ndb_table_local_info *info= (struct Ndb_table_local_info *)m_table_info; @@ -293,6 +303,8 @@ void ha_ndbcluster::no_uncommitted_rows_update(int c) void ha_ndbcluster::no_uncommitted_rows_reset(THD *thd) { + if (m_ha_not_exact_count) + return; DBUG_ENTER("ha_ndbcluster::no_uncommitted_rows_reset"); ((Thd_ndb*)(thd->transaction.thd_ndb))->count++; ((Thd_ndb*)(thd->transaction.thd_ndb))->error= 0; @@ -1229,7 +1241,8 @@ inline int ha_ndbcluster::next_result(byte *buf) DBUG_PRINT("info", ("ops_pending: %d", m_ops_pending)); if (m_ops_pending) { - if (current_thd->transaction.on) + // if (current_thd->transaction.on) + if (m_transaction_on) { if (execute_no_commit(this,trans) != 0) DBUG_RETURN(ndb_err(trans)); @@ -1715,7 +1728,8 @@ int ha_ndbcluster::write_row(byte *record) (int)m_rows_inserted, (int)m_bulk_insert_rows)); m_bulk_insert_not_flushed= FALSE; - if (thd->transaction.on) + // if (thd->transaction.on) + if (m_transaction_on) { if (execute_no_commit(this,trans) != 0) { @@ -1888,7 +1902,7 @@ int ha_ndbcluster::update_row(const byte *old_data, byte *new_data) for (i= 0; i < table->fields; i++) { Field *field= table->field[i]; - if ((thd->query_id == field->query_id) && + if (((thd->query_id == field->query_id) || m_retrieve_all_fields) && (!(field->flags & PRI_KEY_FLAG)) && set_ndb_value(op, field, i)) ERR_RETURN(op->getNdbError()); @@ -2547,14 +2561,17 @@ void ha_ndbcluster::info(uint flag) DBUG_PRINT("info", ("HA_STATUS_VARIABLE")); if (m_table_info) { - records_update(); + if (m_ha_not_exact_count) + records= 100; + else + records_update(); } else { - Uint64 rows; - if(ndb_get_table_statistics(m_ndb, m_tabname, &rows, 0) == 0){ - records= rows; - } + Uint64 rows= 100; + if (current_thd->variables.ndb_use_exact_count) + ndb_get_table_statistics(m_ndb, m_tabname, &rows, 0); + records= rows; } } if (flag & HA_STATUS_CONST) @@ -2943,6 +2960,15 @@ int ha_ndbcluster::external_lock(THD *thd, int lock_type) pointer to point to the NDB transaction. */ + // store thread specific data first to set the right context + m_force_send= thd->variables.ndb_force_send; + m_ha_not_exact_count= !thd->variables.ndb_use_exact_count; + m_autoincrement_prefetch= thd->variables.ndb_autoincrement_prefetch_sz; + if (!thd->transaction.on) + m_transaction_on= FALSE; + else + m_transaction_on= thd->variables.ndb_use_transactions; + m_active_trans= thd->transaction.all.ndb_tid ? (NdbConnection*)thd->transaction.all.ndb_tid: (NdbConnection*)thd->transaction.stmt.ndb_tid; @@ -3063,7 +3089,7 @@ int ndbcluster_commit(THD *thd, void *ndb_transaction) "stmt" : "all")); DBUG_ASSERT(ndb && trans); - if (execute_commit(0,trans) != 0) + if (execute_commit(thd,trans) != 0) { const NdbError err= trans->getNdbError(); const NdbOperation *error_op= trans->getNdbErrorOperation(); @@ -3617,11 +3643,11 @@ longlong ha_ndbcluster::get_auto_increment() DBUG_ENTER("get_auto_increment"); DBUG_PRINT("enter", ("m_tabname: %s", m_tabname)); int cache_size= - (m_rows_to_insert - m_rows_inserted < autoincrement_prefetch) ? + (m_rows_to_insert - m_rows_inserted < m_autoincrement_prefetch) ? m_rows_to_insert - m_rows_inserted - : (m_rows_to_insert > autoincrement_prefetch) ? + : (m_rows_to_insert > m_autoincrement_prefetch) ? m_rows_to_insert - : autoincrement_prefetch; + : m_autoincrement_prefetch; Uint64 auto_value= (m_skip_auto_increment) ? m_ndb->readAutoIncrementValue((const NDBTAB *) m_table) @@ -3659,7 +3685,11 @@ ha_ndbcluster::ha_ndbcluster(TABLE *table_arg): m_blobs_pending(0), m_blobs_buffer(0), m_blobs_buffer_size(0), - m_dupkey((uint) -1) + m_dupkey((uint) -1), + m_ha_not_exact_count(FALSE), + m_force_send(TRUE), + m_autoincrement_prefetch(32), + m_transaction_on(TRUE) { int i; @@ -4309,6 +4339,62 @@ ha_ndbcluster::records_in_range(uint inx, key_range *min_key, DBUG_RETURN(10); /* Good guess when you don't know anything */ } +ulong ha_ndbcluster::table_flags(void) const +{ + if (m_ha_not_exact_count) + return m_table_flags | HA_NOT_EXACT_COUNT; + else + return m_table_flags; +} +const char * ha_ndbcluster::table_type() const +{ + return("ndbcluster"); +} +uint ha_ndbcluster::max_supported_record_length() const +{ + return NDB_MAX_TUPLE_SIZE; +} +uint ha_ndbcluster::max_supported_keys() const +{ + return MAX_KEY; +} +uint ha_ndbcluster::max_supported_key_parts() const +{ + return NDB_MAX_NO_OF_ATTRIBUTES_IN_KEY; +} +uint ha_ndbcluster::max_supported_key_length() const +{ + return NDB_MAX_KEY_SIZE; +} +bool ha_ndbcluster::low_byte_first() const +{ +#ifdef WORDS_BIGENDIAN + return FALSE; +#else + return TRUE; +#endif +} +bool ha_ndbcluster::has_transactions() +{ + return TRUE; +} +const char* ha_ndbcluster::index_type(uint key_number) +{ + switch (get_index_type(key_number)) { + case ORDERED_INDEX: + case UNIQUE_ORDERED_INDEX: + case PRIMARY_KEY_ORDERED_INDEX: + return "BTREE"; + case UNIQUE_INDEX: + case PRIMARY_KEY_INDEX: + default: + return "HASH"; + } +} +uint8 ha_ndbcluster::table_cache_type() +{ + return HA_CACHE_TBL_NOCACHE; +} /* Handling the shared NDB_SHARE structure that is needed to diff --git a/sql/ha_ndbcluster.h b/sql/ha_ndbcluster.h index 2121228a869..6c51d1f0af7 100644 --- a/sql/ha_ndbcluster.h +++ b/sql/ha_ndbcluster.h @@ -118,15 +118,14 @@ class ha_ndbcluster: public handler int reset(); int external_lock(THD *thd, int lock_type); int start_stmt(THD *thd); - const char * table_type() const { return("ndbcluster");} + const char * table_type() const; const char ** bas_ext() const; - ulong table_flags(void) const { return m_table_flags; } + ulong table_flags(void) const; ulong index_flags(uint idx, uint part, bool all_parts) const; - uint max_supported_record_length() const { return NDB_MAX_TUPLE_SIZE; }; - uint max_supported_keys() const { return MAX_KEY; } - uint max_supported_key_parts() const - { return NDB_MAX_NO_OF_ATTRIBUTES_IN_KEY; }; - uint max_supported_key_length() const { return NDB_MAX_KEY_SIZE;}; + uint max_supported_record_length() const; + uint max_supported_keys() const; + uint max_supported_key_parts() const; + uint max_supported_key_length() const; int rename_table(const char *from, const char *to); int delete_table(const char *name); @@ -135,28 +134,9 @@ class ha_ndbcluster: public handler THR_LOCK_DATA **to, enum thr_lock_type lock_type); - bool low_byte_first() const - { -#ifdef WORDS_BIGENDIAN - return FALSE; -#else - return TRUE; -#endif - } - bool has_transactions() { return TRUE; } - - const char* index_type(uint key_number) { - switch (get_index_type(key_number)) { - case ORDERED_INDEX: - case UNIQUE_ORDERED_INDEX: - case PRIMARY_KEY_ORDERED_INDEX: - return "BTREE"; - case UNIQUE_INDEX: - case PRIMARY_KEY_INDEX: - default: - return "HASH"; - } - } + bool low_byte_first() const; + bool has_transactions(); + const char* index_type(uint key_number); double scan_time(); ha_rows records_in_range(uint inx, key_range *min_key, key_range *max_key); @@ -165,7 +145,7 @@ class ha_ndbcluster: public handler static Thd_ndb* seize_thd_ndb(); static void release_thd_ndb(Thd_ndb* thd_ndb); - uint8 table_cache_type() { return HA_CACHE_TBL_NOCACHE; } + uint8 table_cache_type(); private: int alter_table_name(const char *from, const char *to); @@ -256,6 +236,10 @@ class ha_ndbcluster: public handler char *m_blobs_buffer; uint32 m_blobs_buffer_size; uint m_dupkey; + bool m_ha_not_exact_count; + bool m_force_send; + ha_rows m_autoincrement_prefetch; + bool m_transaction_on; void set_rec_per_key(); void records_update(); @@ -265,6 +249,8 @@ class ha_ndbcluster: public handler void no_uncommitted_rows_reset(THD *); friend int execute_no_commit(ha_ndbcluster*, NdbConnection*); + friend int execute_commit(ha_ndbcluster*, NdbConnection*); + friend int execute_no_commit_ie(ha_ndbcluster*, NdbConnection*); }; bool ndbcluster_init(void); diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 1da5359bae0..5ee52326276 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -3947,7 +3947,11 @@ enum options_mysqld OPT_INNODB_FILE_PER_TABLE, OPT_CRASH_BINLOG_INNODB, OPT_INNODB_LOCKS_UNSAFE_FOR_BINLOG, OPT_SAFE_SHOW_DB, OPT_INNODB_SAFE_BINLOG, - OPT_INNODB, OPT_ISAM, OPT_NDBCLUSTER, OPT_NDB_CONNECTSTRING, OPT_SKIP_SAFEMALLOC, + OPT_INNODB, OPT_ISAM, + OPT_NDBCLUSTER, OPT_NDB_CONNECTSTRING, OPT_NDB_USE_EXACT_COUNT, + OPT_NDB_FORCE_SEND, OPT_NDB_AUTOINCREMENT_PREFETCH_SZ, + OPT_NDB_USE_TRANSACTIONS, + OPT_SKIP_SAFEMALLOC, OPT_TEMP_POOL, OPT_TX_ISOLATION, OPT_SKIP_STACK_TRACE, OPT_SKIP_SYMLINKS, OPT_MAX_BINLOG_DUMP_EVENTS, OPT_SPORADIC_BINLOG_DUMP_FAIL, @@ -4386,9 +4390,31 @@ Disable with --skip-ndbcluster (will save memory).", (gptr*) &opt_ndbcluster, (gptr*) &opt_ndbcluster, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, #ifdef HAVE_NDBCLUSTER_DB - {"ndb-connectstring", OPT_NDB_CONNECTSTRING, "Connect string for ndbcluster.", - (gptr*) &ndbcluster_connectstring, (gptr*) &ndbcluster_connectstring, 0, GET_STR, - REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"ndb-connectstring", OPT_NDB_CONNECTSTRING, + "Connect string for ndbcluster.", + (gptr*) &ndbcluster_connectstring, (gptr*) &ndbcluster_connectstring, + 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"ndb_autoincrement_prefetch_sz", OPT_NDB_AUTOINCREMENT_PREFETCH_SZ, + "Specify number of autoincrement values that are prefetched", + (gptr*) &global_system_variables.ndb_autoincrement_prefetch_sz, + (gptr*) &global_system_variables.ndb_autoincrement_prefetch_sz, + 0, GET_INT, REQUIRED_ARG, 32, 1, 256, 0, 0, 0}, + {"ndb_force_send", OPT_NDB_FORCE_SEND, + "Force send of buffers to ndb immediately without waiting for other threads", + (gptr*) &global_system_variables.ndb_force_send, + (gptr*) &global_system_variables.ndb_force_send, + 0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0}, + {"ndb_use_exact_count", OPT_NDB_USE_EXACT_COUNT, + "Use exact records count during query planning and for " + "fast select count(*)", + (gptr*) &global_system_variables.ndb_use_exact_count, + (gptr*) &global_system_variables.ndb_use_exact_count, + 0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0}, + {"ndb_use_transactions", OPT_NDB_USE_TRANSACTIONS, + "Use transactions in ndb", + (gptr*) &global_system_variables.ndb_use_transactions, + (gptr*) &global_system_variables.ndb_use_transactions, + 0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0}, #endif {"new", 'n', "Use very new possible 'unsafe' functions.", (gptr*) &global_system_variables.new_mode, diff --git a/sql/set_var.cc b/sql/set_var.cc index a97506ad07c..f1973b53e49 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -359,6 +359,23 @@ sys_var_thd_bool sys_innodb_table_locks("innodb_table_locks", sys_var_long_ptr sys_innodb_autoextend_increment("innodb_autoextend_increment", &srv_auto_extend_increment); #endif +#ifdef HAVE_NDBCLUSTER_DB +// ndb thread specific variable settings +sys_var_thd_ulong +sys_ndb_autoincrement_prefetch_sz("ndb_autoincrement_prefetch_sz", + &SV::ndb_autoincrement_prefetch_sz); +sys_var_thd_bool +sys_ndb_force_send("ndb_force_send", + &SV::ndb_force_send); +sys_var_thd_bool +sys_ndb_use_exact_count("ndb_use_exact_count", + &SV::ndb_use_exact_count); +sys_var_thd_bool +sys_ndb_use_transactions("ndb_use_transactions", + &SV::ndb_use_transactions); +// ndb server global variable settings +// none +#endif /* Time/date/datetime formats */ @@ -612,7 +629,13 @@ sys_var *sys_variables[]= &sys_innodb_table_locks, &sys_innodb_max_purge_lag, &sys_innodb_autoextend_increment, -#endif +#endif +#ifdef HAVE_NDBCLUSTER_DB + &sys_ndb_autoincrement_prefetch_sz, + &sys_ndb_force_send, + &sys_ndb_use_exact_count, + &sys_ndb_use_transactions, +#endif &sys_unique_checks, &sys_warning_count }; @@ -772,6 +795,13 @@ struct show_var_st init_vars[]= { {sys_myisam_sort_buffer_size.name, (char*) &sys_myisam_sort_buffer_size, SHOW_SYS}, #ifdef __NT__ {"named_pipe", (char*) &opt_enable_named_pipe, SHOW_MY_BOOL}, +#endif +#ifdef HAVE_NDBCLUSTER_DB + {sys_ndb_autoincrement_prefetch_sz.name, + (char*) &sys_ndb_autoincrement_prefetch_sz, SHOW_SYS}, + {sys_ndb_force_send.name, (char*) &sys_ndb_force_send, SHOW_SYS}, + {sys_ndb_use_exact_count.name,(char*) &sys_ndb_use_exact_count, SHOW_SYS}, + {sys_ndb_use_transactions.name,(char*) &sys_ndb_use_transactions, SHOW_SYS}, #endif {sys_net_buffer_length.name,(char*) &sys_net_buffer_length, SHOW_SYS}, {sys_net_read_timeout.name, (char*) &sys_net_read_timeout, SHOW_SYS}, diff --git a/sql/sql_class.h b/sql/sql_class.h index 312d9de9794..d0d9afc7746 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -399,6 +399,12 @@ struct system_variables #ifdef HAVE_INNOBASE_DB my_bool innodb_table_locks; #endif /* HAVE_INNOBASE_DB */ +#ifdef HAVE_NDBCLUSTER_DB + ulong ndb_autoincrement_prefetch_sz; + my_bool ndb_force_send; + my_bool ndb_use_exact_count; + my_bool ndb_use_transactions; +#endif /* HAVE_NDBCLUSTER_DB */ my_bool old_passwords; /* Only charset part of these variables is sensible */ From 835e0159b68e62656a549fb05549632f123fe98f Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 17 Nov 2004 13:38:35 +0100 Subject: [PATCH 0244/1063] test for bug#5528 --- mysql-test/r/fulltext.result | 9 +++++++++ mysql-test/t/fulltext.test | 10 ++++++++++ 2 files changed, 19 insertions(+) diff --git a/mysql-test/r/fulltext.result b/mysql-test/r/fulltext.result index 19bd355f537..31be1881897 100644 --- a/mysql-test/r/fulltext.result +++ b/mysql-test/r/fulltext.result @@ -298,3 +298,12 @@ t1_id name t2_id t1_id name select * from t2 where match name against ('a* b* c* d* e* f*' in boolean mode); t2_id t1_id name drop table t1,t2; +CREATE TABLE t1 (h text, FULLTEXT (h)); +INSERT INTO t1 VALUES ('Jesses Hasse Ling and his syncopators of Swing'); +REPAIR TABLE t1; +Table Op Msg_type Msg_text +test.t1 repair status OK +select count(*) from t1; +count(*) +1 +drop table t1; diff --git a/mysql-test/t/fulltext.test b/mysql-test/t/fulltext.test index bd887bc63ee..e46399bb876 100644 --- a/mysql-test/t/fulltext.test +++ b/mysql-test/t/fulltext.test @@ -240,3 +240,13 @@ select * from t2 where match name against ('a* b* c* d* e* f*' in boolean mode); drop table t1,t2; +# +# icc -ip bug (ip = interprocedural optimization) +# bug#5528 +# +CREATE TABLE t1 (h text, FULLTEXT (h)); +INSERT INTO t1 VALUES ('Jesses Hasse Ling and his syncopators of Swing'); +REPAIR TABLE t1; +select count(*) from t1; +drop table t1; + From ab51882b772b92876de8295ee6d0a09bf085c749 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 17 Nov 2004 16:41:30 +0100 Subject: [PATCH 0245/1063] Fixes for compilation errors in Windows (casts from uint32* to uint*) in repl and charset code. Moving the part of user_var.test using UCS2 to ctype_ucs.test mysql-test/r/ctype_ucs.result: result update mysql-test/r/user_var.result: result update mysql-test/t/ctype_ucs.test: importing test piece from user_var.test mysql-test/t/user_var.test: using UCS2 in this test fails on non-USC2-capable binaries, so let's move this piece to ctype_ucs.test. sql/slave.cc: changing arg type to uint32* (as what is used in this arg is &thd->db_length which is uint32*) sql/slave.h: changing arg type to uint32* sql/sql_parse.cc: changing arg types to uint32, as what is used in these args is a create_field::length which is uint32. --- mysql-test/r/ctype_ucs.result | 14 ++++++++++++++ mysql-test/r/user_var.result | 13 +------------ mysql-test/t/ctype_ucs.test | 15 +++++++++++++++ mysql-test/t/user_var.test | 5 +---- sql/slave.cc | 4 ++-- sql/slave.h | 2 +- sql/sql_parse.cc | 8 ++++---- 7 files changed, 38 insertions(+), 23 deletions(-) diff --git a/mysql-test/r/ctype_ucs.result b/mysql-test/r/ctype_ucs.result index 0e36b00a670..56830153fd0 100644 --- a/mysql-test/r/ctype_ucs.result +++ b/mysql-test/r/ctype_ucs.result @@ -487,3 +487,17 @@ prepare stmt1 from @str2; execute stmt1 using @ivar; ? 1234 +create table t2 (c char(30)) charset=ucs2; +set @v=convert('abc' using ucs2); +reset master; +insert into t2 values (@v); +show binlog events from 79; +Log_name Pos Event_type Server_id Orig_log_pos Info +master-bin.000001 79 User var 1 79 @`v`=_ucs2 0x006100620063 COLLATE ucs2_general_ci +master-bin.000001 119 Query 1 119 use `test`; insert into t2 values (@v) +/*!40019 SET @@session.max_insert_delayed_threads=0*/; +SET @`v`:=_ucs2 0x006100620063 COLLATE ucs2_general_ci; +use test; +SET TIMESTAMP=1100684975; +insert into t2 values (@v); +drop table t2; diff --git a/mysql-test/r/user_var.result b/mysql-test/r/user_var.result index 659c392e153..4f521143d97 100644 --- a/mysql-test/r/user_var.result +++ b/mysql-test/r/user_var.result @@ -169,18 +169,12 @@ SET @`a b`='hello'; INSERT INTO t1 VALUES(@`a b`); set @var1= "';aaa"; insert into t1 values (@var1); -create table t2 (c char(30)) charset=ucs2; -set @v=convert('abc' using ucs2); -insert into t2 values (@v); show binlog events from 79; Log_name Pos Event_type Server_id Orig_log_pos Info master-bin.000001 79 User var 1 79 @`a b`=_latin1 0x68656C6C6F COLLATE latin1_swedish_ci master-bin.000001 120 Query 1 120 use `test`; INSERT INTO t1 VALUES(@`a b`) master-bin.000001 184 User var 1 184 @`var1`=_latin1 0x273B616161 COLLATE latin1_swedish_ci master-bin.000001 226 Query 1 226 use `test`; insert into t1 values (@var1) -master-bin.000001 290 Query 1 290 use `test`; create table t2 (c char(30)) charset=ucs2 -master-bin.000001 366 User var 1 366 @`v`=_ucs2 0x006100620063 COLLATE ucs2_general_ci -master-bin.000001 406 Query 1 406 use `test`; insert into t2 values (@v) /*!40019 SET @@session.max_insert_delayed_threads=0*/; SET @`a b`:=_latin1 0x68656C6C6F COLLATE latin1_swedish_ci; use test; @@ -189,12 +183,7 @@ INSERT INTO t1 VALUES(@`a b`); SET @`var1`:=_latin1 0x273B616161 COLLATE latin1_swedish_ci; SET TIMESTAMP=10000; insert into t1 values (@var1); -SET TIMESTAMP=10000; -create table t2 (c char(30)) charset=ucs2; -SET @`v`:=_ucs2 0x006100620063 COLLATE ucs2_general_ci; -SET TIMESTAMP=10000; -insert into t2 values (@v); -drop table t1, t2; +drop table t1; set @var= NULL ; select FIELD( @var,'1it','Hit') as my_column; my_column diff --git a/mysql-test/t/ctype_ucs.test b/mysql-test/t/ctype_ucs.test index 4c6d1bbebef..909638042c2 100644 --- a/mysql-test/t/ctype_ucs.test +++ b/mysql-test/t/ctype_ucs.test @@ -323,3 +323,18 @@ set @str1 = 'select ?'; set @str2 = convert(@str1 using ucs2); prepare stmt1 from @str2; execute stmt1 using @ivar; + +# +# Check correct binlogging of UCS2 user variables (BUG#3875) +# +create table t2 (c char(30)) charset=ucs2; +set @v=convert('abc' using ucs2); +reset master; +insert into t2 values (@v); +show binlog events from 79; +# more important than SHOW BINLOG EVENTS, mysqlbinlog (where we +# absolutely need variables names to be quoted and strings to be +# escaped). +--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR +--exec $MYSQL_BINLOG --short-form $MYSQL_TEST_DIR/var/log/master-bin.000001 +drop table t2; diff --git a/mysql-test/t/user_var.test b/mysql-test/t/user_var.test index 3816af42c55..d985be05b94 100644 --- a/mysql-test/t/user_var.test +++ b/mysql-test/t/user_var.test @@ -108,16 +108,13 @@ SET @`a b`='hello'; INSERT INTO t1 VALUES(@`a b`); set @var1= "';aaa"; insert into t1 values (@var1); -create table t2 (c char(30)) charset=ucs2; -set @v=convert('abc' using ucs2); -insert into t2 values (@v); show binlog events from 79; # more important than SHOW BINLOG EVENTS, mysqlbinlog (where we # absolutely need variables names to be quoted and strings to be # escaped). --replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR --exec $MYSQL_BINLOG --short-form $MYSQL_TEST_DIR/var/log/master-bin.000001 -drop table t1, t2; +drop table t1; # diff --git a/sql/slave.cc b/sql/slave.cc index b6ad35573ff..6bc977e8d41 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -1032,7 +1032,7 @@ bool net_request_file(NET* net, const char* fname) } -const char *rewrite_db(const char* db, uint *new_len) +const char *rewrite_db(const char* db, uint32 *new_len) { if (replicate_rewrite_db.is_empty() || !db) return db; @@ -1043,7 +1043,7 @@ const char *rewrite_db(const char* db, uint *new_len) { if (!strcmp(tmp->key, db)) { - *new_len= strlen(tmp->val); + *new_len= (uint32)strlen(tmp->val); return tmp->val; } } diff --git a/sql/slave.h b/sql/slave.h index 97f197fb50a..c6cb81699a2 100644 --- a/sql/slave.h +++ b/sql/slave.h @@ -510,7 +510,7 @@ int add_table_rule(HASH* h, const char* table_spec); int add_wild_table_rule(DYNAMIC_ARRAY* a, const char* table_spec); void init_table_rule_hash(HASH* h, bool* h_inited); void init_table_rule_array(DYNAMIC_ARRAY* a, bool* a_inited); -const char *rewrite_db(const char* db, uint *new_db_len); +const char *rewrite_db(const char* db, uint32 *new_db_len); const char *print_slave_db_safe(const char *db); int check_expected_error(THD* thd, RELAY_LOG_INFO* rli, int error_code); void skip_load_data_infile(NET* net); diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 7420f9de100..e066e447345 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -4123,7 +4123,7 @@ bool mysql_test_parse_for_slave(THD *thd, char *inBuf, uint length) - SET uses tot_length. */ void calculate_interval_lengths(THD *thd, TYPELIB *interval, - uint *max_length, uint *tot_length) + uint32 *max_length, uint32 *tot_length) { const char **pos; uint *len; @@ -4135,7 +4135,7 @@ void calculate_interval_lengths(THD *thd, TYPELIB *interval, *len= (uint) strip_sp((char*) *pos); uint length= cs->cset->numchars(cs, *pos, *pos + *len); *tot_length+= length; - set_if_bigger(*max_length, length); + set_if_bigger(*max_length, (uint32)length); } } @@ -4454,7 +4454,7 @@ bool add_field_to_list(THD *thd, char *field_name, enum_field_types type, if (new_field->pack_length > 4) new_field->pack_length=8; new_field->interval=interval; - uint dummy_max_length; + uint32 dummy_max_length; calculate_interval_lengths(thd, interval, &dummy_max_length, &new_field->length); new_field->length+= (interval->count - 1); @@ -4484,7 +4484,7 @@ bool add_field_to_list(THD *thd, char *field_name, enum_field_types type, new_field->interval=interval; new_field->pack_length=interval->count < 256 ? 1 : 2; // Should be safe - uint dummy_tot_length; + uint32 dummy_tot_length; calculate_interval_lengths(thd, interval, &new_field->length, &dummy_tot_length); set_if_smaller(new_field->length,MAX_FIELD_WIDTH-1); From d1e4a1f1719a662166fb835ac018cd097cabd4bc Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 17 Nov 2004 17:06:24 +0100 Subject: [PATCH 0246/1063] time independent test mysql-test/r/ctype_ucs.result: result update mysql-test/t/ctype_ucs.test: time independent --- mysql-test/r/ctype_ucs.result | 3 ++- mysql-test/t/ctype_ucs.test | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/ctype_ucs.result b/mysql-test/r/ctype_ucs.result index 56830153fd0..6394bc28c6e 100644 --- a/mysql-test/r/ctype_ucs.result +++ b/mysql-test/r/ctype_ucs.result @@ -487,6 +487,7 @@ prepare stmt1 from @str2; execute stmt1 using @ivar; ? 1234 +SET TIMESTAMP=10000; create table t2 (c char(30)) charset=ucs2; set @v=convert('abc' using ucs2); reset master; @@ -498,6 +499,6 @@ master-bin.000001 119 Query 1 119 use `test`; insert into t2 values (@v) /*!40019 SET @@session.max_insert_delayed_threads=0*/; SET @`v`:=_ucs2 0x006100620063 COLLATE ucs2_general_ci; use test; -SET TIMESTAMP=1100684975; +SET TIMESTAMP=10000; insert into t2 values (@v); drop table t2; diff --git a/mysql-test/t/ctype_ucs.test b/mysql-test/t/ctype_ucs.test index 909638042c2..0b8678ef59b 100644 --- a/mysql-test/t/ctype_ucs.test +++ b/mysql-test/t/ctype_ucs.test @@ -327,6 +327,7 @@ execute stmt1 using @ivar; # # Check correct binlogging of UCS2 user variables (BUG#3875) # +SET TIMESTAMP=10000; create table t2 (c char(30)) charset=ucs2; set @v=convert('abc' using ucs2); reset master; From 2267ea3e029cb2b450a4ca6a67f0ae036ff709f4 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 18 Nov 2004 08:42:26 +0000 Subject: [PATCH 0247/1063] ifdef'd unused table reorg code --- ndb/src/kernel/blocks/dbdict/Dbdict.cpp | 12 ++++++++++-- ndb/src/kernel/blocks/dbdict/Dbdict.hpp | 4 ++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/ndb/src/kernel/blocks/dbdict/Dbdict.cpp b/ndb/src/kernel/blocks/dbdict/Dbdict.cpp index 882557daae1..2b9072ab042 100644 --- a/ndb/src/kernel/blocks/dbdict/Dbdict.cpp +++ b/ndb/src/kernel/blocks/dbdict/Dbdict.cpp @@ -239,7 +239,11 @@ Dbdict::packTableIntoPagesImpl(SimpleProperties::Writer & w, w.add(DictTabInfo::TableName, tablePtr.p->tableName); w.add(DictTabInfo::TableId, tablePtr.i); +#ifdef HAVE_TABLE_REORG w.add(DictTabInfo::SecondTableId, tablePtr.p->secondTable); +#else + w.add(DictTabInfo::SecondTableId, (Uint32)0); +#endif w.add(DictTabInfo::TableVersion, tablePtr.p->tableVersion); w.add(DictTabInfo::NoOfKeyAttr, tablePtr.p->noOfPrimkey); w.add(DictTabInfo::NoOfAttributes, tablePtr.p->noOfAttributes); @@ -1436,6 +1440,7 @@ Uint32 Dbdict::getFreeTableRecord(Uint32 primaryTableId) jam(); return RNIL; }//if +#ifdef HAVE_TABLE_REORG bool secondFound = false; for (tablePtr.i = firstTablePtr.i + 1; tablePtr.i < tabSize ; tablePtr.i++) { jam(); @@ -1455,6 +1460,7 @@ Uint32 Dbdict::getFreeTableRecord(Uint32 primaryTableId) firstTablePtr.p->tabState = TableRecord::NOT_DEFINED; return RNIL; }//if +#endif return firstTablePtr.i; }//Dbdict::getFreeTableRecord() @@ -4623,7 +4629,7 @@ void Dbdict::handleTabInfoInit(SimpleProperties::Reader & it, jam(); tablePtr.p->tabState = TableRecord::DEFINING; }//if - +#ifdef HAVE_TABLE_REORG /* ---------------------------------------------------------------- */ // Get id of second table id and check that table doesn't already exist // and set up links between first and second table. @@ -4637,7 +4643,7 @@ void Dbdict::handleTabInfoInit(SimpleProperties::Reader & it, secondTablePtr.p->tabState = TableRecord::REORG_TABLE_PREPARED; secondTablePtr.p->secondTable = tablePtr.i; tablePtr.p->secondTable = secondTablePtr.i; - +#endif /* ---------------------------------------------------------------- */ // Set table version /* ---------------------------------------------------------------- */ @@ -5535,10 +5541,12 @@ void Dbdict::releaseTableObject(Uint32 tableId, bool removeFromHash) nextAttrRecord = attrPtr.p->nextAttrInTable; c_attributeRecordPool.release(attrPtr); }//if +#ifdef HAVE_TABLE_REORG Uint32 secondTableId = tablePtr.p->secondTable; initialiseTableRecord(tablePtr); c_tableRecordPool.getPtr(tablePtr, secondTableId); initialiseTableRecord(tablePtr); +#endif return; }//releaseTableObject() diff --git a/ndb/src/kernel/blocks/dbdict/Dbdict.hpp b/ndb/src/kernel/blocks/dbdict/Dbdict.hpp index 19c03a86e22..af80bcf5f94 100644 --- a/ndb/src/kernel/blocks/dbdict/Dbdict.hpp +++ b/ndb/src/kernel/blocks/dbdict/Dbdict.hpp @@ -151,10 +151,10 @@ public: /* Temporary record used during add/drop table */ Uint32 myConnect; - +#ifdef HAVE_TABLE_REORG /* Second table used by this table (for table reorg) */ Uint32 secondTable; - +#endif /* Next record in Pool */ Uint32 nextPool; From 9615e9becf2af5d3f5184115e390d1a10c0ce261 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 18 Nov 2004 11:48:21 +0100 Subject: [PATCH 0248/1063] ndb: charset fix from Bar (strxfrm_multiply can be 0) ndb/src/common/util/NdbSqlUtil.cpp: charset fix from Bar (strxfrm_multiply can be 0) ndb/src/ndbapi/NdbIndexOperation.cpp: charset fix from Bar (strxfrm_multiply can be 0) ndb/src/ndbapi/NdbOperationSearch.cpp: charset fix from Bar (strxfrm_multiply can be 0) ndb/src/ndbapi/NdbScanOperation.cpp: charset fix from Bar (strxfrm_multiply can be 0) --- ndb/src/common/util/NdbSqlUtil.cpp | 6 +++--- ndb/src/ndbapi/NdbIndexOperation.cpp | 2 +- ndb/src/ndbapi/NdbOperationSearch.cpp | 2 +- ndb/src/ndbapi/NdbScanOperation.cpp | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ndb/src/common/util/NdbSqlUtil.cpp b/ndb/src/common/util/NdbSqlUtil.cpp index 6e4e5919e43..5b2381df50a 100644 --- a/ndb/src/common/util/NdbSqlUtil.cpp +++ b/ndb/src/common/util/NdbSqlUtil.cpp @@ -582,7 +582,7 @@ NdbSqlUtil::usable_in_pk(Uint32 typeId, const void* info) cs->cset != 0 && cs->coll != 0 && cs->coll->strnxfrm != 0 && - cs->strxfrm_multiply == 1; // current limitation + cs->strxfrm_multiply <= 1; // current limitation } break; case Type::Varchar: @@ -618,7 +618,7 @@ NdbSqlUtil::usable_in_ordered_index(Uint32 typeId, const void* info) cs->coll != 0 && cs->coll->strnxfrm != 0 && cs->coll->strnncollsp != 0 && - cs->strxfrm_multiply == 1; // current limitation + cs->strxfrm_multiply <= 1; // current limitation } break; case Type::Varchar: @@ -633,7 +633,7 @@ NdbSqlUtil::usable_in_ordered_index(Uint32 typeId, const void* info) cs->coll != 0 && cs->coll->strnxfrm != 0 && cs->coll->strnncollsp != 0 && - cs->strxfrm_multiply == 1; // current limitation + cs->strxfrm_multiply <= 1; // current limitation } break; default: diff --git a/ndb/src/ndbapi/NdbIndexOperation.cpp b/ndb/src/ndbapi/NdbIndexOperation.cpp index 3f174a61b64..23af646c4c7 100644 --- a/ndb/src/ndbapi/NdbIndexOperation.cpp +++ b/ndb/src/ndbapi/NdbIndexOperation.cpp @@ -272,7 +272,7 @@ int NdbIndexOperation::equal_impl(const NdbColumnImpl* tAttrInfo, CHARSET_INFO* cs = tAttrInfo->m_cs; if (cs != 0) { // current limitation: strxfrm does not increase length - assert(cs->strxfrm_multiply == 1); + assert(cs->strxfrm_multiply <= 1); unsigned n = (*cs->coll->strnxfrm)(cs, (uchar*)xfrmData, sizeof(xfrmData), diff --git a/ndb/src/ndbapi/NdbOperationSearch.cpp b/ndb/src/ndbapi/NdbOperationSearch.cpp index 69b4e803acd..28a70abcb9b 100644 --- a/ndb/src/ndbapi/NdbOperationSearch.cpp +++ b/ndb/src/ndbapi/NdbOperationSearch.cpp @@ -142,7 +142,7 @@ NdbOperation::equal_impl(const NdbColumnImpl* tAttrInfo, CHARSET_INFO* cs = tAttrInfo->m_cs; if (cs != 0) { // current limitation: strxfrm does not increase length - assert(cs->strxfrm_multiply == 1); + assert(cs->strxfrm_multiply <= 1); unsigned n = (*cs->coll->strnxfrm)(cs, (uchar*)xfrmData, sizeof(xfrmData), diff --git a/ndb/src/ndbapi/NdbScanOperation.cpp b/ndb/src/ndbapi/NdbScanOperation.cpp index 373fec1a2b0..4b10ebb10cd 100644 --- a/ndb/src/ndbapi/NdbScanOperation.cpp +++ b/ndb/src/ndbapi/NdbScanOperation.cpp @@ -1091,7 +1091,7 @@ NdbIndexScanOperation::setBound(const NdbColumnImpl* tAttrInfo, Uint32 xfrmData[2000]; if (cs != NULL && aValue != NULL) { // current limitation: strxfrm does not increase length - assert(cs->strxfrm_multiply == 1); + assert(cs->strxfrm_multiply <= 1); unsigned n = (*cs->coll->strnxfrm)(cs, (uchar*)xfrmData, sizeof(xfrmData), From be5b6f4d4b29e2393b73f7c9f6a8d17ad7a95422 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 18 Nov 2004 12:11:56 +0100 Subject: [PATCH 0249/1063] Fix for bug#4312 ndb table, wrong behaviour on insert .. on duplicate key .. --- mysql-test/r/ndb_charset.result | 4 +- mysql-test/r/ndb_index_unique.result | 8 ++-- mysql-test/r/ndb_insert.result | 45 +++++++++++++------ mysql-test/t/ndb_charset.test | 4 +- mysql-test/t/ndb_index_unique.test | 8 ++-- mysql-test/t/ndb_insert.test | 36 ++++++++++----- sql/ha_ndbcluster.cc | 66 ++++++++++++++++++++++------ sql/ha_ndbcluster.h | 4 +- sql/sql_insert.cc | 7 ++- 9 files changed, 130 insertions(+), 52 deletions(-) diff --git a/mysql-test/r/ndb_charset.result b/mysql-test/r/ndb_charset.result index 93429a1fcb0..501bec99ea3 100644 --- a/mysql-test/r/ndb_charset.result +++ b/mysql-test/r/ndb_charset.result @@ -78,9 +78,9 @@ unique key(a) ) engine=ndb; insert into t1 values(1, 'aAa'); insert into t1 values(2, 'aaa'); -ERROR 23000: Can't write, because of unique constraint, to table 't1' +ERROR 23000: Duplicate entry '2' for key 1 insert into t1 values(3, 'AAA'); -ERROR 23000: Can't write, because of unique constraint, to table 't1' +ERROR 23000: Duplicate entry '3' for key 1 select * from t1 order by p; p a 1 aAa diff --git a/mysql-test/r/ndb_index_unique.result b/mysql-test/r/ndb_index_unique.result index f1407dfe78d..af9b84022ed 100644 --- a/mysql-test/r/ndb_index_unique.result +++ b/mysql-test/r/ndb_index_unique.result @@ -22,7 +22,7 @@ select * from t1 where b = 4 order by a; a b c 3 4 6 insert into t1 values(8, 2, 3); -ERROR 23000: Can't write, because of unique constraint, to table 't1' +ERROR 23000: Duplicate entry '8' for key 1 select * from t1 order by a; a b c 1 2 3 @@ -65,7 +65,7 @@ select * from t2 where b = 4 order by a; a b c 3 4 6 insert into t2 values(8, 2, 3); -ERROR 23000: Can't write, because of unique constraint, to table 't2' +ERROR 23000: Duplicate entry '8' for key 1 select * from t2 order by a; a b c 1 2 3 @@ -123,7 +123,7 @@ pk a 3 NULL 4 4 insert into t1 values (5,0); -ERROR 23000: Can't write, because of unique constraint, to table 't1' +ERROR 23000: Duplicate entry '5' for key 1 select * from t1 order by pk; pk a -1 NULL @@ -156,7 +156,7 @@ pk a b c 0 NULL 18 NULL 1 3 19 abc insert into t2 values(2,3,19,'abc'); -ERROR 23000: Can't write, because of unique constraint, to table 't2' +ERROR 23000: Duplicate entry '2' for key 1 select * from t2 order by pk; pk a b c -1 1 17 NULL diff --git a/mysql-test/r/ndb_insert.result b/mysql-test/r/ndb_insert.result index 16c76f39680..7503010a66b 100644 --- a/mysql-test/r/ndb_insert.result +++ b/mysql-test/r/ndb_insert.result @@ -535,27 +535,46 @@ count(*) 2000 insert into t1 select * from t1 where b < 10 order by pk1; ERROR 23000: Duplicate entry '9' for key 1 +DELETE FROM t1 WHERE pk1=2; begin; -INSERT IGNORE INTO t1 VALUES(1,2,3); -ERROR HY000: Table storage engine for 't1' doesn't have this option -commit; -select * from t1 where pk1=1; +INSERT IGNORE INTO t1 VALUES(1,2,3),(2,3,4); +select * from t1 where pk1 < 3 order by pk1; pk1 b c +0 0 0 1 1 1 -INSERT IGNORE INTO t1 VALUES(1,2,3); -ERROR HY000: Table storage engine for 't1' doesn't have this option -select * from t1 where pk1=1; +2 3 4 +rollback; +INSERT IGNORE INTO t1 VALUES(1,2,3),(2,3,4); +select * from t1 where pk1 < 3 order by pk1; pk1 b c +0 0 0 1 1 1 -REPLACE INTO t1 values(1, 2, 3); +2 3 4 +REPLACE INTO t1 values(1, 78, 3); select * from t1 where pk1=1; pk1 b c -1 2 3 -INSERT INTO t1 VALUES(1,1,1) ON DUPLICATE KEY UPDATE b=79; -ERROR HY000: Table storage engine for 't1' doesn't have this option -select * from t1 where pk1=1; +1 78 3 +INSERT INTO t1 VALUES(1,1,1),(3,4,5) ON DUPLICATE KEY UPDATE b=79; +select * from t1 where pk1 < 4 order by pk1; pk1 b c -1 2 3 +0 0 0 +1 79 3 +2 3 4 +3 79 3 +INSERT INTO t1 VALUES(1,1,1),(3,4,5) ON DUPLICATE KEY UPDATE b=pk1+c; +select * from t1 where pk1 < 4 order by pk1; +pk1 b c +0 0 0 +1 4 3 +2 3 4 +3 6 3 +DELETE FROM t1 WHERE pk1 = 2 OR pk1 = 4 OR pk1 = 6; +INSERT INTO t1 VALUES(1,1,1),(2,2,17),(3,4,5) ON DUPLICATE KEY UPDATE pk1=b; +select * from t1 where pk1 = b and b != c order by pk1; +pk1 b c +2 2 17 +4 4 3 +6 6 3 DROP TABLE t1; CREATE TABLE t1(a INT) ENGINE=ndb; INSERT IGNORE INTO t1 VALUES (1); diff --git a/mysql-test/t/ndb_charset.test b/mysql-test/t/ndb_charset.test index b9f28ed0faf..f1ec0485e12 100644 --- a/mysql-test/t/ndb_charset.test +++ b/mysql-test/t/ndb_charset.test @@ -86,9 +86,9 @@ create table t1 ( # ok insert into t1 values(1, 'aAa'); # fail ---error 1169 +--error 1062 insert into t1 values(2, 'aaa'); ---error 1169 +--error 1062 insert into t1 values(3, 'AAA'); # 1 select * from t1 order by p; diff --git a/mysql-test/t/ndb_index_unique.test b/mysql-test/t/ndb_index_unique.test index 4a0c689bafb..bdb23949763 100644 --- a/mysql-test/t/ndb_index_unique.test +++ b/mysql-test/t/ndb_index_unique.test @@ -21,7 +21,7 @@ select * from t1 where b = 4 order by b; insert into t1 values(7,8,3); select * from t1 where b = 4 order by a; --- error 1169 +-- error 1062 insert into t1 values(8, 2, 3); select * from t1 order by a; delete from t1 where a = 1; @@ -49,7 +49,7 @@ select * from t2 where c = 6; insert into t2 values(7,8,3); select * from t2 where b = 4 order by a; --- error 1169 +-- error 1062 insert into t2 values(8, 2, 3); select * from t2 order by a; delete from t2 where a = 1; @@ -92,7 +92,7 @@ insert into t1 values (-1,NULL), (0,0), (1,NULL),(2,2),(3,NULL),(4,4); select * from t1 order by pk; ---error 1169 +--error 1062 insert into t1 values (5,0); select * from t1 order by pk; delete from t1 where a = 0; @@ -111,7 +111,7 @@ insert into t2 values (-1,1,17,NULL),(0,NULL,18,NULL),(1,3,19,'abc'); select * from t2 order by pk; ---error 1169 +--error 1062 insert into t2 values(2,3,19,'abc'); select * from t2 order by pk; delete from t2 where c IS NOT NULL; diff --git a/mysql-test/t/ndb_insert.test b/mysql-test/t/ndb_insert.test index c3da4641014..611df3d84e9 100644 --- a/mysql-test/t/ndb_insert.test +++ b/mysql-test/t/ndb_insert.test @@ -564,23 +564,37 @@ select count(*) from t1; --error 1062 insert into t1 select * from t1 where b < 10 order by pk1; +DELETE FROM t1 WHERE pk1=2; begin; ---error 1031 -INSERT IGNORE INTO t1 VALUES(1,2,3); -commit; +INSERT IGNORE INTO t1 VALUES(1,2,3),(2,3,4); +select * from t1 where pk1 < 3 order by pk1; +rollback; + +INSERT IGNORE INTO t1 VALUES(1,2,3),(2,3,4); +select * from t1 where pk1 < 3 order by pk1; + +REPLACE INTO t1 values(1, 78, 3); select * from t1 where pk1=1; ---error 1031 -INSERT IGNORE INTO t1 VALUES(1,2,3); -select * from t1 where pk1=1; +INSERT INTO t1 VALUES(1,1,1),(3,4,5) ON DUPLICATE KEY UPDATE b=79; +select * from t1 where pk1 < 4 order by pk1; -REPLACE INTO t1 values(1, 2, 3); -select * from t1 where pk1=1; +INSERT INTO t1 VALUES(1,1,1),(3,4,5) ON DUPLICATE KEY UPDATE b=pk1+c; +select * from t1 where pk1 < 4 order by pk1; ---error 1031 -INSERT INTO t1 VALUES(1,1,1) ON DUPLICATE KEY UPDATE b=79; -select * from t1 where pk1=1; +DELETE FROM t1 WHERE pk1 = 2 OR pk1 = 4 OR pk1 = 6; +INSERT INTO t1 VALUES(1,1,1),(2,2,17),(3,4,5) ON DUPLICATE KEY UPDATE pk1=b; +select * from t1 where pk1 = b and b != c order by pk1; + +# The following test case currently does not work +#DELETE FROM t1; +#CREATE UNIQUE INDEX bi ON t1(b); +#INSERT INTO t1 VALUES +#(1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5), +#(6,6,6),(7,7,7),(8,8,8),(9,9,9),(10,10,10); +#INSERT INTO t1 VALUES(0,1,0),(21,21,21) ON DUPLICATE KEY UPDATE pk1=b+10,c=b+10; +#select * from t1 order by pk1; DROP TABLE t1; diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index cdbf2eb3d6a..84d1b2468d5 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -109,7 +109,7 @@ static const err_code_mapping err_map[]= { { 626, HA_ERR_KEY_NOT_FOUND }, { 630, HA_ERR_FOUND_DUPP_KEY }, - { 893, HA_ERR_FOUND_DUPP_UNIQUE }, + { 893, HA_ERR_FOUND_DUPP_KEY }, // Unique constraint { 721, HA_ERR_TABLE_EXIST }, { 4244, HA_ERR_TABLE_EXIST }, @@ -144,7 +144,7 @@ static int ndb_to_mysql_error(const NdbError *err) // Push the NDB error message as warning push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR, ER_GET_ERRMSG, ER(ER_GET_ERRMSG), - err->code, err->message, "NDB"); + err->code, err->message, "NDB"); return err->code; } } @@ -1018,7 +1018,8 @@ int ha_ndbcluster::pk_read(const byte *key, uint key_len, byte *buf) { Field *field= table->field[i]; if ((thd->query_id == field->query_id) || - m_retrieve_all_fields) + m_retrieve_all_fields || + (field->flags & PRI_KEY_FLAG) && m_retrieve_primary_key) { if (get_ndb_value(op, field, i, buf)) ERR_RETURN(trans->getNdbError()); @@ -1029,7 +1030,6 @@ int ha_ndbcluster::pk_read(const byte *key, uint key_len, byte *buf) m_value[i].ptr= NULL; } } - if (execute_no_commit_ie(this,trans) != 0) { table->status= STATUS_NOT_FOUND; @@ -1093,6 +1093,34 @@ int ha_ndbcluster::complemented_pk_read(const byte *old_data, byte *new_data) DBUG_RETURN(0); } +/* + Peek to check if a particular row already exists +*/ + +int ha_ndbcluster::peek_row() +{ + NdbConnection *trans= m_active_trans; + NdbOperation *op; + THD *thd= current_thd; + DBUG_ENTER("peek_row"); + + NdbOperation::LockMode lm= + (NdbOperation::LockMode)get_ndb_lock_type(m_lock.type); + if (!(op= trans->getNdbOperation((const NDBTAB *) m_table)) || + op->readTuple(lm) != 0) + ERR_RETURN(trans->getNdbError()); + + int res; + if ((res= set_primary_key(op))) + ERR_RETURN(trans->getNdbError()); + + if (execute_no_commit_ie(this,trans) != 0) + { + table->status= STATUS_NOT_FOUND; + DBUG_RETURN(ndb_err(trans)); + } + DBUG_RETURN(0); +} /* Read one record from NDB using unique secondary index @@ -1138,7 +1166,7 @@ int ha_ndbcluster::unique_index_read(const byte *key, { Field *field= table->field[i]; if ((thd->query_id == field->query_id) || - (field->flags & PRI_KEY_FLAG)) + (field->flags & PRI_KEY_FLAG)) // && m_retrieve_primary_key ?? { if (get_ndb_value(op, field, i, buf)) ERR_RETURN(op->getNdbError()); @@ -1566,7 +1594,7 @@ int ha_ndbcluster::filtered_scan(const byte *key, uint key_len, Field* field= key_part->field; uint ndb_fieldnr= key_part->fieldnr-1; DBUG_PRINT("key_part", ("fieldnr: %d", ndb_fieldnr)); - // const NDBCOL *col= tab->getColumn(ndb_fieldnr); + //const NDBCOL *col= ((const NDBTAB *) m_table)->getColumn(ndb_fieldnr); uint32 field_len= field->pack_length(); DBUG_DUMP("key", (char*)key, field_len); @@ -1635,9 +1663,17 @@ int ha_ndbcluster::write_row(byte *record) int res; DBUG_ENTER("write_row"); - if(m_ignore_dup_key_not_supported) + if(m_ignore_dup_key && table->primary_key != MAX_KEY) { - DBUG_RETURN(HA_ERR_WRONG_COMMAND); + int peek_res= peek_row(); + + if (!peek_res) + { + m_dupkey= table->primary_key; + DBUG_RETURN(HA_ERR_FOUND_DUPP_KEY); + } + if (peek_res != HA_ERR_KEY_NOT_FOUND) + DBUG_RETURN(peek_res); } statistic_increment(ha_write_count,&LOCK_status); @@ -1791,7 +1827,7 @@ int ha_ndbcluster::update_row(const byte *old_data, byte *new_data) NdbOperation *op; uint i; DBUG_ENTER("update_row"); - + statistic_increment(ha_update_count,&LOCK_status); if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_UPDATE) table->timestamp_field->set_time(); @@ -2653,15 +2689,15 @@ int ha_ndbcluster::extra(enum ha_extra_function operation) m_use_write= TRUE; } else { - if (table->keys) - m_ignore_dup_key_not_supported= TRUE; + DBUG_PRINT("info", ("Ignoring duplicate key")); + m_ignore_dup_key= TRUE; } break; case HA_EXTRA_NO_IGNORE_DUP_KEY: DBUG_PRINT("info", ("HA_EXTRA_NO_IGNORE_DUP_KEY")); DBUG_PRINT("info", ("Turning OFF use of write instead of insert")); m_use_write= FALSE; - m_ignore_dup_key_not_supported= FALSE; + m_ignore_dup_key= FALSE; break; case HA_EXTRA_RETRIEVE_ALL_COLS: /* Retrieve all columns, not just those where field->query_id is the same as @@ -2680,6 +2716,7 @@ int ha_ndbcluster::extra(enum ha_extra_function operation) break; case HA_EXTRA_RETRIEVE_PRIMARY_KEY: DBUG_PRINT("info", ("HA_EXTRA_RETRIEVE_PRIMARY_KEY")); + m_retrieve_primary_key= TRUE; break; case HA_EXTRA_CHANGE_KEY_TO_UNIQUE: DBUG_PRINT("info", ("HA_EXTRA_CHANGE_KEY_TO_UNIQUE")); @@ -2942,6 +2979,7 @@ int ha_ndbcluster::external_lock(THD *thd, int lock_type) DBUG_ASSERT(m_active_trans); // Start of transaction m_retrieve_all_fields= FALSE; + m_retrieve_primary_key= FALSE; m_ops_pending= 0; { NDBDICT *dict= m_ndb->getDictionary(); @@ -3034,6 +3072,7 @@ int ha_ndbcluster::start_stmt(THD *thd) // Start of statement m_retrieve_all_fields= FALSE; + m_retrieve_primary_key= FALSE; m_ops_pending= 0; DBUG_RETURN(error); @@ -3640,9 +3679,10 @@ ha_ndbcluster::ha_ndbcluster(TABLE *table_arg): HA_NO_PREFIX_CHAR_KEYS), m_share(0), m_use_write(FALSE), - m_ignore_dup_key_not_supported(FALSE), + m_ignore_dup_key(FALSE), m_primary_key_update(FALSE), m_retrieve_all_fields(FALSE), + m_retrieve_primary_key(FALSE), m_rows_to_insert(1), m_rows_inserted(0), m_bulk_insert_rows(1024), diff --git a/sql/ha_ndbcluster.h b/sql/ha_ndbcluster.h index 2121228a869..c6c233c013c 100644 --- a/sql/ha_ndbcluster.h +++ b/sql/ha_ndbcluster.h @@ -183,6 +183,7 @@ class ha_ndbcluster: public handler int pk_read(const byte *key, uint key_len, byte *buf); int complemented_pk_read(const byte *old_data, byte *new_data); + int peek_row(); int unique_index_read(const byte *key, uint key_len, byte *buf); int ordered_index_scan(const key_range *start_key, @@ -242,9 +243,10 @@ class ha_ndbcluster: public handler typedef union { NdbRecAttr *rec; NdbBlob *blob; void *ptr; } NdbValue; NdbValue m_value[NDB_MAX_ATTRIBUTES_IN_TABLE]; bool m_use_write; - bool m_ignore_dup_key_not_supported; + bool m_ignore_dup_key; bool m_primary_key_update; bool m_retrieve_all_fields; + bool m_retrieve_primary_key; ha_rows m_rows_to_insert; ha_rows m_rows_inserted; ha_rows m_bulk_insert_rows; diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 822ce622b1b..d590d3b5093 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -453,8 +453,8 @@ int mysql_prepare_insert(THD *thd, TABLE_LIST *table_list, setup_tables(insert_table_list) || setup_fields(thd, 0, insert_table_list, *values, 0, 0, 0) || (duplic == DUP_UPDATE && - (setup_fields(thd, 0, insert_table_list, update_fields, 0, 0, 0) || - setup_fields(thd, 0, insert_table_list, update_values, 0, 0, 0)))) + (setup_fields(thd, 0, insert_table_list, update_fields, 1, 0, 0) || + setup_fields(thd, 0, insert_table_list, update_values, 1, 0, 0)))) DBUG_RETURN(-1); if (find_real_table_in_list(table_list->next, table_list->db, table_list->real_name)) @@ -462,6 +462,9 @@ int mysql_prepare_insert(THD *thd, TABLE_LIST *table_list, my_error(ER_UPDATE_TABLE_USED, MYF(0), table_list->real_name); DBUG_RETURN(-1); } + if (duplic == DUP_UPDATE || duplic == DUP_REPLACE) + table->file->extra(HA_EXTRA_RETRIEVE_PRIMARY_KEY); + DBUG_RETURN(0); } From 8453693a0552528808d4bb985be991de01f40ccb Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 18 Nov 2004 16:15:48 +0400 Subject: [PATCH 0250/1063] Check that the third UNION part with COLLATE clause resolves collation conflict for the first and the second parts pair. --- mysql-test/r/union.result | 10 ++++++++++ mysql-test/t/union.test | 6 ++++++ 2 files changed, 16 insertions(+) diff --git a/mysql-test/r/union.result b/mysql-test/r/union.result index 7820cd1d6ff..49a2907f571 100644 --- a/mysql-test/r/union.result +++ b/mysql-test/r/union.result @@ -1110,4 +1110,14 @@ t1 CREATE TABLE `t1` ( `a` char(1) character set latin1 collate latin1_german1_ci default NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; +create table t1 as +(select a from t2) union +(select b from t2) union +(select 'c' collate latin1_german1_ci from t2); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` char(1) character set latin1 collate latin1_german1_ci default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; drop table t2; diff --git a/mysql-test/t/union.test b/mysql-test/t/union.test index 36027e8c4cb..468a88b83db 100644 --- a/mysql-test/t/union.test +++ b/mysql-test/t/union.test @@ -652,5 +652,11 @@ create table t1 as (select b collate latin1_german1_ci from t2); show create table t1; drop table t1; +create table t1 as +(select a from t2) union +(select b from t2) union +(select 'c' collate latin1_german1_ci from t2); +show create table t1; +drop table t1; drop table t2; From 1faf1d2349c2ccc29cc17e66bd24906cfcd3dd57 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 18 Nov 2004 16:52:45 +0200 Subject: [PATCH 0251/1063] correct name of function in synopsis BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted --- BitKeeper/etc/logging_ok | 1 + mysys/mf_keycaches.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok index 1f1918027e2..1c1a3efc542 100644 --- a/BitKeeper/etc/logging_ok +++ b/BitKeeper/etc/logging_ok @@ -199,6 +199,7 @@ tim@siva.hindu.god tim@threads.polyesthetic.msg tim@white.box tim@work.mysql.com +timour@mysql.com tom@basil-firewall.home.com tomas@mc05.(none) tomas@poseidon.(none) diff --git a/mysys/mf_keycaches.c b/mysys/mf_keycaches.c index 20465f3d23b..8bf203e249f 100644 --- a/mysys/mf_keycaches.c +++ b/mysys/mf_keycaches.c @@ -309,7 +309,7 @@ void multi_keycache_free(void) Get a key cache to be used for a specific table. SYNOPSIS - multi_key_cache_get() + multi_key_cache_search() key key to find (usually table path) uint length Length of key. From 9039cff65dac4ebed5a67d9f2245fec7774d9cc2 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 18 Nov 2004 17:01:33 +0200 Subject: [PATCH 0252/1063] row0ins.c: row_ins_scan_sec_index_for_duplicate(), row_ins_duplicate_error_in_clust(): remove unused variables "ptr" innobase/row/row0ins.c: row_ins_scan_sec_index_for_duplicate(), row_ins_duplicate_error_in_clust(): remove unused variables "ptr" --- innobase/row/row0ins.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/innobase/row/row0ins.c b/innobase/row/row0ins.c index c45818ddd26..6d1482b6720 100644 --- a/innobase/row/row0ins.c +++ b/innobase/row/row0ins.c @@ -1509,7 +1509,6 @@ row_ins_scan_sec_index_for_duplicate( ibool moved; mtr_t mtr; trx_t* trx; - const char* ptr; n_unique = dict_index_get_n_unique(index); @@ -1630,7 +1629,6 @@ row_ins_duplicate_error_in_clust( page_t* page; ulint n_unique; trx_t* trx = thr_get_trx(thr); - const char* ptr; UT_NOT_USED(mtr); From 50ef2cc1a5592d08cc91cb9a2b98f060d4707db4 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 18 Nov 2004 16:44:50 +0100 Subject: [PATCH 0253/1063] ndb: new arbitrator behaviour for >=3-way: < 1/2 nodes can survive ndb/include/kernel/signaldata/ArbitSignalData.hpp: new arbitrator behaviour for >=3-way: < 1/2 nodes can survive ndb/src/common/debugger/EventLogger.cpp: new arbitrator behaviour for >=3-way: < 1/2 nodes can survive ndb/src/kernel/blocks/qmgr/QmgrMain.cpp: new arbitrator behaviour for >=3-way: < 1/2 nodes can survive --- .../kernel/signaldata/ArbitSignalData.hpp | 15 +++++----- ndb/src/common/debugger/EventLogger.cpp | 5 ++++ ndb/src/kernel/blocks/qmgr/QmgrMain.cpp | 29 +++++++++++++------ 3 files changed, 33 insertions(+), 16 deletions(-) diff --git a/ndb/include/kernel/signaldata/ArbitSignalData.hpp b/ndb/include/kernel/signaldata/ArbitSignalData.hpp index f255b8dcbbe..34b73644a13 100644 --- a/ndb/include/kernel/signaldata/ArbitSignalData.hpp +++ b/ndb/include/kernel/signaldata/ArbitSignalData.hpp @@ -94,13 +94,14 @@ public: // arbitration result LoseNodes = 41, // lose on ndb node count - WinGroups = 42, // we win, no need for arbitration - LoseGroups = 43, // we lose, missing node group - Partitioning = 44, // possible network partitioning - WinChoose = 45, // positive reply - LoseChoose = 46, // negative reply - LoseNorun = 47, // arbitrator required but not running - LoseNocfg = 48, // arbitrator required but none configured + WinNodes = 42, // win on ndb node count + WinGroups = 43, // we win, no need for arbitration + LoseGroups = 44, // we lose, missing node group + Partitioning = 45, // possible network partitioning + WinChoose = 46, // positive reply + LoseChoose = 47, // negative reply + LoseNorun = 48, // arbitrator required but not running + LoseNocfg = 49, // arbitrator required but none configured // general error codes ErrTicket = 91, // invalid arbitrator-ticket diff --git a/ndb/src/common/debugger/EventLogger.cpp b/ndb/src/common/debugger/EventLogger.cpp index 8a09be9a0a7..59be0affcb4 100644 --- a/ndb/src/common/debugger/EventLogger.cpp +++ b/ndb/src/common/debugger/EventLogger.cpp @@ -421,6 +421,11 @@ EventLogger::getText(char * m_text, size_t m_text_len, "%sArbitration check lost - less than 1/2 nodes left", theNodeId); break; + case ArbitCode::WinNodes: + BaseString::snprintf(m_text, m_text_len, + "%sArbitration check won - all node groups and more than 1/2 nodes left", + theNodeId); + break; case ArbitCode::WinGroups: BaseString::snprintf(m_text, m_text_len, "%sArbitration check won - node group majority", diff --git a/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp b/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp index a433d72744e..da8596076ec 100644 --- a/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp +++ b/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp @@ -2946,6 +2946,12 @@ void Qmgr::sendPrepFailReq(Signal* signal, Uint16 aNode) * the "handle" routines. */ +/** + * Should < 1/2 nodes die unconditionally. Affects only >= 3-way + * replication. + */ +static const bool g_ndb_arbit_one_half_rule = false; + /** * Config signals are logically part of CM_INIT. */ @@ -3157,7 +3163,8 @@ Qmgr::handleArbitCheck(Signal* signal) ndbrequire(cpresident == getOwnNodeId()); NodeBitmask ndbMask; computeArbitNdbMask(ndbMask); - if (2 * ndbMask.count() < cnoOfNodes) { + if (g_ndb_arbit_one_half_rule && + 2 * ndbMask.count() < cnoOfNodes) { jam(); arbitRec.code = ArbitCode::LoseNodes; } else { @@ -3181,6 +3188,11 @@ Qmgr::handleArbitCheck(Signal* signal) case CheckNodeGroups::Partitioning: jam(); arbitRec.code = ArbitCode::Partitioning; + if (g_ndb_arbit_one_half_rule && + 2 * ndbMask.count() > cnoOfNodes) { + jam(); + arbitRec.code = ArbitCode::WinNodes; + } break; default: ndbrequire(false); @@ -3190,8 +3202,12 @@ Qmgr::handleArbitCheck(Signal* signal) switch (arbitRec.code) { case ArbitCode::LoseNodes: jam(); + case ArbitCode::LoseGroups: + jam(); goto crashme; - case ArbitCode::WinGroups: + case ArbitCode::WinNodes: + jam(); + case ArbitCode::WinGroups: jam(); if (arbitRec.state == ARBIT_RUN) { jam(); @@ -3200,9 +3216,6 @@ Qmgr::handleArbitCheck(Signal* signal) arbitRec.state = ARBIT_INIT; arbitRec.newstate = true; break; - case ArbitCode::LoseGroups: - jam(); - goto crashme; case ArbitCode::Partitioning: if (arbitRec.state == ARBIT_RUN) { jam(); @@ -3762,8 +3775,7 @@ Qmgr::execARBIT_CHOOSEREF(Signal* signal) } /** - * Handle CRASH state. We must crash immediately. But it - * would be nice to wait until event reports have been sent. + * Handle CRASH state. We must crash immediately. * XXX tell other nodes in our party to crash too. */ void @@ -3773,12 +3785,11 @@ Qmgr::stateArbitCrash(Signal* signal) if (arbitRec.newstate) { jam(); CRASH_INSERTION((Uint32)910 + arbitRec.state); - arbitRec.setTimestamp(); arbitRec.code = 0; arbitRec.newstate = false; } -#if 0 +#ifdef ndb_arbit_crash_wait_for_event_report_to_get_out if (! (arbitRec.getTimediff() > getArbitTimeout())) return; #endif From 9438c2ca766a176d9b03ebdba466bef37c6e1b40 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 18 Nov 2004 18:10:07 +0200 Subject: [PATCH 0254/1063] reporting empty result added in case of max/min optimisation of ALL/ANY/SOME subqueries fixed null processing in NOT operation used in ALL subquery (Bug #6247) mysql-test/r/subselect.result: new tests of ALL/ANY wiews mysql-test/t/subselect.test: new tests of ALL/ANY wiews sql/item_cmpfunc.cc: fixed special NOT ALL processing fixed processing max/min optimized subqueries with empty results (added methods to detect empty results) and special NOP operation to process them for SOME/ANY sobqueries sql/item_cmpfunc.h: fixed processing max/min optimized subqueries with empty results (added methods to detect empty results) and special NOP operation to process them for SOME/ANY sobqueries sql/item_subselect.cc: reporting empty result added for max/min subqueries sql/item_subselect.h: reporting empty result added for max/min subqueries sql/item_sum.cc: reporting empty result added fox max/min aggregate functions sql/item_sum.h: reporting empty result added fox max/min aggregate functions sql/sql_class.cc: reporting empty result added for max/min subqueries sql/sql_parse.cc: reporting empty result added for max/min subqueries sql/sql_union.cc: reporting empty result added for max/min subqueries --- mysql-test/r/subselect.result | 76 ++++++++++++++++++++++++++++++++++- mysql-test/t/subselect.test | 24 ++++++++++- sql/item_cmpfunc.cc | 46 +++++++++++++++++---- sql/item_cmpfunc.h | 24 ++++++++++- sql/item_subselect.cc | 35 ++++++++++++---- sql/item_subselect.h | 20 +++++++-- sql/item_sum.cc | 13 ++++++ sql/item_sum.h | 9 ++++- sql/sql_class.cc | 3 +- sql/sql_parse.cc | 4 +- sql/sql_union.cc | 2 + 11 files changed, 230 insertions(+), 26 deletions(-) diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index 32d482f5a32..58539abf68c 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -269,7 +269,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 3 Using where 2 SUBQUERY t2 ALL NULL NULL NULL NULL 3 Warnings: -Note 1003 select test.t3.a AS `a` from test.t3 where (test.t3.a >= (select min(test.t2.b) from test.t2)) +Note 1003 select test.t3.a AS `a` from test.t3 where ((test.t3.a >= (select min(test.t2.b) from test.t2))) select * from t3 where a >= all (select b from t2); a 7 @@ -1488,6 +1488,71 @@ id select_type table type possible_keys key key_len ref rows Extra 2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found Warnings: Note 1003 select test.t3.a AS `a` from test.t3 where ((test.t3.a < (select max(test.t2.b) from test.t2))) +select * from t3 where a >= some (select b from t2); +a +6 +7 +3 +explain extended select * from t3 where a >= some (select b from t2); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t3 ALL NULL NULL NULL NULL 3 Using where +2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found +Warnings: +Note 1003 select test.t3.a AS `a` from test.t3 where ((test.t3.a >= (select min(test.t2.b) from test.t2))) +select * from t3 where a >= all (select b from t2 group by 1); +a +6 +7 +3 +explain extended select * from t3 where a >= all (select b from t2 group by 1); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t3 ALL NULL NULL NULL NULL 3 Using where +2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found +Warnings: +Note 1003 select test.t3.a AS `a` from test.t3 where ((test.t3.a < (select test.t2.b AS `b` from test.t2 group by test.t2.b))) +select * from t3 where a >= some (select b from t2 group by 1); +a +6 +7 +3 +explain extended select * from t3 where a >= some (select b from t2 group by 1); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t3 ALL NULL NULL NULL NULL 3 Using where +2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found +Warnings: +Note 1003 select test.t3.a AS `a` from test.t3 where ((test.t3.a >= (select test.t2.b AS `b` from test.t2 group by test.t2.b))) +select * from t3 where NULL >= any (select b from t2); +a +explain extended select * from t3 where NULL >= any (select b from t2); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found +Warnings: +Note 1003 select test.t3.a AS `a` from test.t3 +select * from t3 where NULL >= any (select b from t2 group by 1); +a +explain extended select * from t3 where NULL >= any (select b from t2 group by 1); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found +Warnings: +Note 1003 select test.t3.a AS `a` from test.t3 +select * from t3 where NULL >= some (select b from t2); +a +explain extended select * from t3 where NULL >= some (select b from t2); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found +Warnings: +Note 1003 select test.t3.a AS `a` from test.t3 +select * from t3 where NULL >= some (select b from t2 group by 1); +a +explain extended select * from t3 where NULL >= some (select b from t2 group by 1); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +2 SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found +Warnings: +Note 1003 select test.t3.a AS `a` from test.t3 insert into t2 values (2,2), (2,1), (3,3), (3,1); select * from t3 where a > all (select max(b) from t2 group by a); a @@ -1990,3 +2055,12 @@ ac 700 NULL drop tables t1,t2; +create table t1 (s1 int); +insert into t1 values (1),(null); +select * from t1 where s1 < all (select s1 from t1); +s1 +select s1, s1 < all (select s1 from t1) from t1; +s1 s1 < all (select s1 from t1) +1 0 +NULL NULL +drop table t1; diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test index e0f6fcbf515..ace1b28ef8f 100644 --- a/mysql-test/t/subselect.test +++ b/mysql-test/t/subselect.test @@ -911,7 +911,20 @@ create table t3 (a int); insert into t3 values (6),(7),(3); select * from t3 where a >= all (select b from t2); explain extended select * from t3 where a >= all (select b from t2); - +select * from t3 where a >= some (select b from t2); +explain extended select * from t3 where a >= some (select b from t2); +select * from t3 where a >= all (select b from t2 group by 1); +explain extended select * from t3 where a >= all (select b from t2 group by 1); +select * from t3 where a >= some (select b from t2 group by 1); +explain extended select * from t3 where a >= some (select b from t2 group by 1); +select * from t3 where NULL >= any (select b from t2); +explain extended select * from t3 where NULL >= any (select b from t2); +select * from t3 where NULL >= any (select b from t2 group by 1); +explain extended select * from t3 where NULL >= any (select b from t2 group by 1); +select * from t3 where NULL >= some (select b from t2); +explain extended select * from t3 where NULL >= some (select b from t2); +select * from t3 where NULL >= some (select b from t2 group by 1); +explain extended select * from t3 where NULL >= some (select b from t2 group by 1); # # optimized static ALL/ANY with grouping # @@ -1282,3 +1295,12 @@ INSERT INTO `t2` VALUES (6,5,12,7,'a'),(12,0,0,7,'a'),(12,1,0,7,'a'),(12,5,5,7,' SELECT b.sc FROM (SELECT (SELECT a.access FROM t1 a WHERE a.map = op.map AND a.slave = op.pid AND a.master = 1) ac FROM t2 op WHERE op.id = 12 AND op.map = 0) b; SELECT b.ac FROM (SELECT (SELECT a.access FROM t1 a WHERE a.map = op.map AND a.slave = op.pid AND a.master = 1) ac FROM t2 op WHERE op.id = 12 AND op.map = 0) b; drop tables t1,t2; + +# +# ALL/ANY with NULL +# +create table t1 (s1 int); +insert into t1 values (1),(null); +select * from t1 where s1 < all (select s1 from t1); +select s1, s1 < all (select s1 from t1) from t1; +drop table t1; diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index c36f2d191c7..d3c9cfc2c58 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -106,7 +106,7 @@ longlong Item_func_not::val_int() DBUG_ASSERT(fixed == 1); double value=args[0]->val(); null_value=args[0]->null_value; - return !null_value && value == 0 ? 1 : 0; + return ((!null_value && value == 0) ? 1 : 0); } /* @@ -117,13 +117,23 @@ longlong Item_func_not_all::val_int() { DBUG_ASSERT(fixed == 1); double value= args[0]->val(); - if (abort_on_null) - { - null_value= 0; - return (args[0]->null_value || value == 0) ? 1 : 0; - } + + /* + return TRUE if there was records in underlaying select in max/min + optimisation + */ + if (empty_underlying_subquery()) + return 1; + null_value= args[0]->null_value; - return (!null_value && value == 0) ? 1 : 0; + return ((!null_value && value == 0) ? 1 : 0); +} + + +bool Item_func_not_all::empty_underlying_subquery() +{ + return ((test_sum_item && !test_sum_item->any_value()) || + (test_sub_item && !test_sub_item->any_value())); } void Item_func_not_all::print(String *str) @@ -134,6 +144,28 @@ void Item_func_not_all::print(String *str) args[0]->print(str); } + +/* + special NOP for ALL subquery +*/ + +longlong Item_func_nop_all::val_int() +{ + DBUG_ASSERT(fixed == 1); + double value= args[0]->val(); + + /* + return TRUE if there was records in underlaying select in max/min + optimisation + */ + if (empty_underlying_subquery()) + return 1; + + null_value= args[0]->null_value; + return (null_value || value == 0) ? 0 : 1; +} + + /* Convert a constant expression or string to an integer. This is done when comparing DATE's of different formats and diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h index 69528099aa1..6834799688d 100644 --- a/sql/item_cmpfunc.h +++ b/sql/item_cmpfunc.h @@ -229,21 +229,43 @@ public: Item *neg_transformer(THD *thd); }; +class Item_maxmin_subselect; class Item_func_not_all :public Item_func_not { + /* allow to check presence od values in max/min optimisation */ + Item_sum_hybrid *test_sum_item; + Item_maxmin_subselect *test_sub_item; + bool abort_on_null; public: bool show; - Item_func_not_all(Item *a) :Item_func_not(a), abort_on_null(0), show(0) {} + Item_func_not_all(Item *a) + :Item_func_not(a), test_sum_item(0), test_sub_item(0), abort_on_null(0), + show(0) + {} virtual void top_level_item() { abort_on_null= 1; } bool top_level() { return abort_on_null; } longlong val_int(); enum Functype functype() const { return NOT_ALL_FUNC; } const char *func_name() const { return ""; } void print(String *str); + void set_sum_test(Item_sum_hybrid *item) { test_sum_item= item; }; + void set_sub_test(Item_maxmin_subselect *item) { test_sub_item= item; }; + bool empty_underlying_subquery(); }; + +class Item_func_nop_all :public Item_func_not_all +{ +public: + + Item_func_nop_all(Item *a) :Item_func_not_all(a) {} + longlong val_int(); + const char *func_name() const { return ""; } +}; + + class Item_func_eq :public Item_bool_rowready_func2 { public: diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index 62cd016b0df..b263b06c91f 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -271,7 +271,7 @@ Item_singlerow_subselect::Item_singlerow_subselect(st_select_lex *select_lex) Item_maxmin_subselect::Item_maxmin_subselect(Item_subselect *parent, st_select_lex *select_lex, bool max_arg) - :Item_singlerow_subselect() + :Item_singlerow_subselect(), was_values(TRUE) { DBUG_ENTER("Item_maxmin_subselect::Item_maxmin_subselect"); max= max_arg; @@ -290,12 +290,26 @@ Item_maxmin_subselect::Item_maxmin_subselect(Item_subselect *parent, DBUG_VOID_RETURN; } +void Item_maxmin_subselect::cleanup() +{ + /* + By default is is TRUE to avoid TRUE reporting by + Item_func_not_all/Item_func_nop_all if this item was never called. + + Engine exec() set it to FALSE by reset_value_registration() call. + */ + + was_values= TRUE; +} + + void Item_maxmin_subselect::print(String *str) { str->append(max?"":"", 5); Item_singlerow_subselect::print(str); } + void Item_singlerow_subselect::reset() { null_value= 1; @@ -303,6 +317,7 @@ void Item_singlerow_subselect::reset() value->null_value= 1; } + Item_subselect::trans_res Item_singlerow_subselect::select_transformer(JOIN *join) { @@ -519,7 +534,7 @@ bool Item_in_subselect::test_limit(SELECT_LEX_UNIT *unit) Item_in_subselect::Item_in_subselect(Item * left_exp, st_select_lex *select_lex): - Item_exists_subselect(), transformed(0), upper_not(0) + Item_exists_subselect(), transformed(0), upper_item(0) { DBUG_ENTER("Item_in_subselect::Item_in_subselect"); left_expr= left_exp; @@ -680,7 +695,7 @@ Item_in_subselect::single_value_transformer(JOIN *join, NULL/IS NOT NULL functions). If so, we rewrite ALL/ANY with NOT EXISTS later in this method. */ - if ((abort_on_null || (upper_not && upper_not->top_level())) && + if ((abort_on_null || (upper_item && upper_item->top_level())) && !select_lex->master_unit()->uncacheable && !func->eqne_op()) { if (substitution) @@ -694,7 +709,7 @@ Item_in_subselect::single_value_transformer(JOIN *join, !select_lex->with_sum_func && !(select_lex->next_select())) { - Item *item; + Item_sum_hybrid *item; if (func->l_op()) { /* @@ -711,6 +726,8 @@ Item_in_subselect::single_value_transformer(JOIN *join, */ item= new Item_sum_min(*select_lex->ref_pointer_array); } + if (upper_item) + upper_item->set_sum_test(item); *select_lex->ref_pointer_array= item; { List_iterator it(select_lex->item_list); @@ -731,10 +748,13 @@ Item_in_subselect::single_value_transformer(JOIN *join, } else { + Item_maxmin_subselect *item; // remove LIMIT placed by ALL/ANY subquery select_lex->master_unit()->global_parameters->select_limit= HA_POS_ERROR; - subs= new Item_maxmin_subselect(this, select_lex, func->l_op()); + subs= item= new Item_maxmin_subselect(this, select_lex, func->l_op()); + if (upper_item) + upper_item->set_sub_test(item); } // left expression belong to outer select SELECT_LEX *current= thd->lex->current_select, *up; @@ -1041,8 +1061,8 @@ Item_subselect::trans_res Item_allany_subselect::select_transformer(JOIN *join) { transformed= 1; - if (upper_not) - upper_not->show= 1; + if (upper_item) + upper_item->show= 1; return single_value_transformer(join, func); } @@ -1247,6 +1267,7 @@ int subselect_single_select_engine::exec() } if (!executed) { + item->reset_value_registration(); join->exec(); executed= 1; join->thd->where= save_where; diff --git a/sql/item_subselect.h b/sql/item_subselect.h index 764c41f33b4..bd6ede49255 100644 --- a/sql/item_subselect.h +++ b/sql/item_subselect.h @@ -93,7 +93,7 @@ public: return null_value; } bool fix_fields(THD *thd, TABLE_LIST *tables, Item **ref); - bool exec(); + virtual bool exec(); virtual void fix_length_and_dec(); table_map used_tables() const; bool const_item() const; @@ -109,6 +109,11 @@ public: engine_changed= 1; return eng == 0; } + /* + Used by max/min subquery to initialize value presence registration + mechanism. Engine call this method before rexecution query. + */ + virtual void reset_value_registration() {} friend class select_subselect; friend class Item_in_optimizer; @@ -150,13 +155,20 @@ public: }; /* used in static ALL/ANY optimisation */ +class select_max_min_finder_subselect; class Item_maxmin_subselect :public Item_singlerow_subselect { +protected: bool max; + bool was_values; // was checked at least some values public: Item_maxmin_subselect(Item_subselect *parent, st_select_lex *select_lex, bool max); void print(String *str); + void cleanup(); + bool any_value() { return was_values; } + void register_value() { was_values= TRUE; } + void reset_value_registration() { was_values= FALSE; } }; /* exists subselect */ @@ -204,11 +216,11 @@ protected: bool abort_on_null; bool transformed; public: - Item_func_not_all *upper_not; // point on NOT before ALL subquery + Item_func_not_all *upper_item; // point on NOT/NOP before ALL/SOME subquery Item_in_subselect(Item * left_expr, st_select_lex *select_lex); Item_in_subselect() - :Item_exists_subselect(), abort_on_null(0), transformed(0), upper_not(0) + :Item_exists_subselect(), abort_on_null(0), transformed(0), upper_item(0) {} @@ -249,7 +261,7 @@ public: st_select_lex *select_lex, bool all); // only ALL subquery has upper not - subs_type substype() { return upper_not?ALL_SUBS:ANY_SUBS; } + subs_type substype() { return all?ALL_SUBS:ANY_SUBS; } trans_res select_transformer(JOIN *join); void print(String *str); }; diff --git a/sql/item_sum.cc b/sql/item_sum.cc index 3b3a6083725..cf07e136034 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -540,9 +540,22 @@ void Item_sum_hybrid::cleanup() DBUG_ENTER("Item_sum_hybrid::cleanup"); Item_sum::cleanup(); used_table_cache= ~(table_map) 0; + /* + by default is is TRUE to avoid TRUE reporting by + Item_func_not_all/Item_func_nop_all if this item was never called. + + no_rows_in_result() set it to FALSE if was not results found. + */ + was_values= TRUE; DBUG_VOID_RETURN; } +void Item_sum_hybrid::no_rows_in_result() +{ + Item_sum::no_rows_in_result(); + was_values= FALSE; +} + Item *Item_sum_min::copy_or_same(THD* thd) { diff --git a/sql/item_sum.h b/sql/item_sum.h index 5aa0d37190b..9993ce1bb12 100644 --- a/sql/item_sum.h +++ b/sql/item_sum.h @@ -403,19 +403,22 @@ class Item_sum_hybrid :public Item_sum int cmp_sign; table_map used_table_cache; CHARSET_INFO *cmp_charset; + bool was_values; // was checked at least some values (for max/min only) public: Item_sum_hybrid(Item *item_par,int sign) :Item_sum(item_par), sum(0.0), sum_int(0), hybrid_type(INT_RESULT), hybrid_field_type(FIELD_TYPE_LONGLONG), cmp_sign(sign), used_table_cache(~(table_map) 0), - cmp_charset(&my_charset_bin) + cmp_charset(&my_charset_bin), was_values(TRUE) {} Item_sum_hybrid(THD *thd, Item_sum_hybrid *item): Item_sum(thd, item), value(item->value), sum(item->sum), sum_int(item->sum_int), hybrid_type(item->hybrid_type), hybrid_field_type(item->hybrid_field_type),cmp_sign(item->cmp_sign), - used_table_cache(item->used_table_cache), cmp_charset(item->cmp_charset) {} + used_table_cache(item->used_table_cache), cmp_charset(item->cmp_charset), + was_values(TRUE) + {} bool fix_fields(THD *, TABLE_LIST *, Item **); table_map used_tables() const { return used_table_cache; } bool const_item() const { return !used_table_cache; } @@ -434,6 +437,8 @@ class Item_sum_hybrid :public Item_sum void min_max_update_real_field(); void min_max_update_int_field(); void cleanup(); + bool any_value() { return was_values; } + void no_rows_in_result(); }; diff --git a/sql/sql_class.cc b/sql/sql_class.cc index eda60b5cfdb..e99e7ccaaeb 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -1241,9 +1241,10 @@ bool select_singlerow_subselect::send_data(List &items) bool select_max_min_finder_subselect::send_data(List &items) { DBUG_ENTER("select_max_min_finder_subselect::send_data"); - Item_singlerow_subselect *it= (Item_singlerow_subselect *)item; + Item_maxmin_subselect *it= (Item_maxmin_subselect *)item; List_iterator_fast li(items); Item *val_item= li++; + it->register_value(); if (it->assigned()) { cache->store(val_item); diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 7420f9de100..a760956d9de 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -5114,9 +5114,9 @@ Item * all_any_subquery_creator(Item *left_expr, Item_allany_subselect *it= new Item_allany_subselect(left_expr, (*cmp)(all), select_lex, all); if (all) - return it->upper_not= new Item_func_not_all(it); /* ALL */ + return it->upper_item= new Item_func_not_all(it); /* ALL */ - return it; /* ANY/SOME */ + return it->upper_item= new Item_func_nop_all(it); /* ANY/SOME */ } diff --git a/sql/sql_union.cc b/sql/sql_union.cc index e0e8f8d42c5..b35209faeb2 100644 --- a/sql/sql_union.cc +++ b/sql/sql_union.cc @@ -394,6 +394,8 @@ int st_select_lex_unit::exec() if (uncacheable || !item || !item->assigned() || describe) { + if (item) + item->reset_value_registration(); if (optimized && item) { if (item->assigned()) From 22b56d235427b435fd29b054c23d9fd4db8cbf0b Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 18 Nov 2004 18:38:38 +0000 Subject: [PATCH 0255/1063] changed mysqladmin.c to mysqladmin.cc no need for dvlags to have DEFINE_CXA_PURE_VIRTUAL anymore aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes removed all dependencies of LocalConfig, except for mgmapi internals enabled multiple management servrs to fetch data configurations from eachother client/Makefile.am: changed mysqladmin.c to mysqladmin.cc client/mysqladmin.cc: changed mysqladmin.c to mysqladmin.cc configure.in: no need for dvlags to have DEFINE_CXA_PURE_VIRTUAL anymore ndb/include/mgmapi/mgmapi.h: aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes removed all dependencies of LocalConfig, except for mgmapi internals ndb/include/mgmcommon/ConfigRetriever.hpp: aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes removed all dependencies of LocalConfig, except for mgmapi internals ndb/include/ndbapi/ndb_cluster_connection.hpp: aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes removed all dependencies of LocalConfig, except for mgmapi internals ndb/src/common/mgmcommon/ConfigRetriever.cpp: aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes removed all dependencies of LocalConfig, except for mgmapi internals ndb/src/kernel/main.cpp: aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes removed all dependencies of LocalConfig, except for mgmapi internals ndb/src/kernel/vm/Configuration.cpp: aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes removed all dependencies of LocalConfig, except for mgmapi internals changed to config setting to always use noOfMetaTables to make sure we don't overflow arrays ndb/src/kernel/vm/Configuration.hpp: aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes removed all dependencies of LocalConfig, except for mgmapi internals ndb/src/mgmapi/LocalConfig.cpp: aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes removed all dependencies of LocalConfig, except for mgmapi internals ndb/src/mgmapi/LocalConfig.hpp: aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes removed all dependencies of LocalConfig, except for mgmapi internals ndb/src/mgmapi/mgmapi.cpp: aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes removed all dependencies of LocalConfig, except for mgmapi internals ndb/src/mgmclient/CommandInterpreter.cpp: aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes removed all dependencies of LocalConfig, except for mgmapi internals ndb/src/mgmclient/main.cpp: aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes removed all dependencies of LocalConfig, except for mgmapi internals ndb/src/mgmclient/ndb_mgmclient.hpp: aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes removed all dependencies of LocalConfig, except for mgmapi internals ndb/src/mgmclient/ndb_mgmclient.h: aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes removed all dependencies of LocalConfig, except for mgmapi internals ndb/src/mgmsrv/MgmtSrvr.cpp: aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes removed all dependencies of LocalConfig, except for mgmapi internals enabled multiple management servrs to fetch data configurations from eachother ndb/src/mgmsrv/MgmtSrvr.hpp: aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes removed all dependencies of LocalConfig, except for mgmapi internals ndb/src/mgmsrv/MgmtSrvrConfig.cpp: aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes removed all dependencies of LocalConfig, except for mgmapi internals ndb/src/mgmsrv/main.cpp: aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes removed all dependencies of LocalConfig, except for mgmapi internals ndb/src/ndbapi/ndb_cluster_connection.cpp: aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes removed all dependencies of LocalConfig, except for mgmapi internals ndb/tools/waiter.cpp: aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes removed all dependencies of LocalConfig, except for mgmapi internals --- client/Makefile.am | 1 + client/{mysqladmin.c => mysqladmin.cc} | 3 - configure.in | 1 - ndb/include/mgmapi/mgmapi.h | 30 +++- ndb/include/mgmcommon/ConfigRetriever.hpp | 26 +-- ndb/include/ndbapi/ndb_cluster_connection.hpp | 2 - ndb/src/common/mgmcommon/ConfigRetriever.cpp | 163 ++++++++---------- ndb/src/kernel/main.cpp | 12 +- ndb/src/kernel/vm/Configuration.cpp | 34 ++-- ndb/src/kernel/vm/Configuration.hpp | 3 +- ndb/src/mgmapi/LocalConfig.cpp | 17 +- ndb/{include => src}/mgmapi/LocalConfig.hpp | 1 + ndb/src/mgmapi/mgmapi.cpp | 138 ++++++++++----- ndb/src/mgmclient/CommandInterpreter.cpp | 30 +--- ndb/src/mgmclient/main.cpp | 3 +- ndb/src/mgmclient/ndb_mgmclient.h | 2 +- ndb/src/mgmclient/ndb_mgmclient.hpp | 2 +- ndb/src/mgmsrv/MgmtSrvr.cpp | 109 +++++++----- ndb/src/mgmsrv/MgmtSrvr.hpp | 13 +- ndb/src/mgmsrv/MgmtSrvrConfig.cpp | 18 +- ndb/src/mgmsrv/main.cpp | 54 +----- ndb/src/ndbapi/ndb_cluster_connection.cpp | 30 ++-- ndb/tools/waiter.cpp | 46 ++--- 23 files changed, 358 insertions(+), 380 deletions(-) rename client/{mysqladmin.c => mysqladmin.cc} (99%) rename ndb/{include => src}/mgmapi/LocalConfig.hpp (97%) diff --git a/client/Makefile.am b/client/Makefile.am index 1c552036f9b..07167d97df5 100644 --- a/client/Makefile.am +++ b/client/Makefile.am @@ -28,6 +28,7 @@ bin_PROGRAMS = mysql mysqladmin mysqlcheck mysqlshow \ noinst_HEADERS = sql_string.h completion_hash.h my_readline.h \ client_priv.h mysql_SOURCES = mysql.cc readline.cc sql_string.cc completion_hash.cc +mysqladmin_SOURCES = mysqladmin.cc mysql_LDADD = @readline_link@ @TERMCAP_LIB@ $(LDADD) $(CXXLDFLAGS) mysqlbinlog_LDADD = $(LDADD) $(CXXLDFLAGS) mysql_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES) $(DEPLIB) diff --git a/client/mysqladmin.c b/client/mysqladmin.cc similarity index 99% rename from client/mysqladmin.c rename to client/mysqladmin.cc index a32dfa14d28..a9fc3f31d03 100644 --- a/client/mysqladmin.c +++ b/client/mysqladmin.cc @@ -1287,9 +1287,6 @@ static my_bool wait_pidfile(char *pidfile, time_t last_modified, } DBUG_RETURN(error); } -#ifdef HAVE_NDBCLUSTER_DB -/* lib linked in contains c++ code */ #ifdef __GNUC__ FIX_GCC_LINKING_PROBLEM #endif -#endif diff --git a/configure.in b/configure.in index f360ee46453..1fcba6b8f5f 100644 --- a/configure.in +++ b/configure.in @@ -399,7 +399,6 @@ then then if $CXX -v 2>&1 | grep 'version 3' > /dev/null 2>&1 then - CFLAGS="$CFLAGS -DDEFINE_CXA_PURE_VIRTUAL" CXXFLAGS="$CXXFLAGS -DUSE_MYSYS_NEW -DDEFINE_CXA_PURE_VIRTUAL" fi fi diff --git a/ndb/include/mgmapi/mgmapi.h b/ndb/include/mgmapi/mgmapi.h index f1ef357421b..a4e1fc1d1a8 100644 --- a/ndb/include/mgmapi/mgmapi.h +++ b/ndb/include/mgmapi/mgmapi.h @@ -356,11 +356,28 @@ extern "C" { /** * Create a handle to a management server * - * @return A management handle
- * or NULL if no management handle could be created. + * @param connect_string Connect string to the management server, + * + * @return A management handle
+ * or NULL if no management handle could be created. */ NdbMgmHandle ndb_mgm_create_handle(); + /** + * Set connecst string to management server + * + * @param handle Management handle + * @param connect_string Connect string to the management server, + * + * @return -1 on error. + */ + int ndb_mgm_set_connectstring(NdbMgmHandle handle, + const char *connect_string); + + int ndb_mgm_get_configuration_nodeid(NdbMgmHandle handle); + int ndb_mgm_get_connected_port(NdbMgmHandle handle); + const char *ndb_mgm_get_connected_host(NdbMgmHandle handle); + /** * Destroy a management server handle * @@ -378,11 +395,10 @@ extern "C" { * Connect to a management server * * @param handle Management handle. - * @param mgmsrv Hostname and port of the management server, - * "hostname:port". * @return -1 on error. */ - int ndb_mgm_connect(NdbMgmHandle handle, const char * mgmsrv); + int ndb_mgm_connect(NdbMgmHandle handle, int no_retries, + int retry_delay_in_seconds, int verbose); /** * Disconnect from a management server @@ -709,9 +725,7 @@ extern "C" { void ndb_mgm_destroy_configuration(struct ndb_mgm_configuration *); int ndb_mgm_alloc_nodeid(NdbMgmHandle handle, - unsigned version, - unsigned *pnodeid, - int nodetype); + unsigned version, int nodetype); /** * Config iterator */ diff --git a/ndb/include/mgmcommon/ConfigRetriever.hpp b/ndb/include/mgmcommon/ConfigRetriever.hpp index 6c32255e921..80449628867 100644 --- a/ndb/include/mgmcommon/ConfigRetriever.hpp +++ b/ndb/include/mgmcommon/ConfigRetriever.hpp @@ -20,7 +20,6 @@ #include #include #include -#include /** * @class ConfigRetriever @@ -28,10 +27,11 @@ */ class ConfigRetriever { public: - ConfigRetriever(LocalConfig &local_config, Uint32 version, Uint32 nodeType); + ConfigRetriever(const char * _connect_string, + Uint32 version, Uint32 nodeType); ~ConfigRetriever(); - int do_connect(int exit_on_connect_failure= false); + int do_connect(int no_retries, int retry_delay_in_seconds, int verbose); /** * Get configuration for current node. @@ -46,12 +46,14 @@ public: */ struct ndb_mgm_configuration * getConfig(); + void resetError(); + int hasError(); const char * getErrorString(); /** * @return Node id of this node (as stated in local config or connectString) */ - Uint32 allocNodeId(); + Uint32 allocNodeId(int no_retries, int retry_delay_in_seconds); /** * Get config using socket @@ -68,22 +70,26 @@ public: */ bool verifyConfig(const struct ndb_mgm_configuration *, Uint32 nodeid); - Uint32 get_mgmd_port() const {return m_mgmd_port;}; - const char *get_mgmd_host() const {return m_mgmd_host;}; + Uint32 get_mgmd_port() const; + const char *get_mgmd_host() const; + + Uint32 get_configuration_nodeid() const; private: BaseString errorString; enum ErrorType { - CR_ERROR = 0, - CR_RETRY = 1 + CR_NO_ERROR = 0, + CR_ERROR = 1, + CR_RETRY = 2 }; ErrorType latestErrorType; void setError(ErrorType, const char * errorMsg); - struct LocalConfig& _localConfig; - Uint32 _ownNodeId; + Uint32 _ownNodeId; + /* Uint32 m_mgmd_port; const char *m_mgmd_host; + */ Uint32 m_version; Uint32 m_node_type; diff --git a/ndb/include/ndbapi/ndb_cluster_connection.hpp b/ndb/include/ndbapi/ndb_cluster_connection.hpp index f8e6f25ce73..59d5a038844 100644 --- a/ndb/include/ndbapi/ndb_cluster_connection.hpp +++ b/ndb/include/ndbapi/ndb_cluster_connection.hpp @@ -19,7 +19,6 @@ #define CLUSTER_CONNECTION_HPP class TransporterFacade; -class LocalConfig; class ConfigRetriever; class NdbThread; @@ -38,7 +37,6 @@ private: void connect_thread(); char *m_connect_string; TransporterFacade *m_facade; - LocalConfig *m_local_config; ConfigRetriever *m_config_retriever; NdbThread *m_connect_thread; int (*m_connect_callback)(void); diff --git a/ndb/src/common/mgmcommon/ConfigRetriever.cpp b/ndb/src/common/mgmcommon/ConfigRetriever.cpp index a1b979f62d8..0af5eb2f83c 100644 --- a/ndb/src/common/mgmcommon/ConfigRetriever.cpp +++ b/ndb/src/common/mgmcommon/ConfigRetriever.cpp @@ -20,7 +20,6 @@ #include #include -#include "LocalConfig.hpp" #include #include @@ -45,90 +44,62 @@ //**************************************************************************** //**************************************************************************** -ConfigRetriever::ConfigRetriever(LocalConfig &local_config, +ConfigRetriever::ConfigRetriever(const char * _connect_string, Uint32 version, Uint32 node_type) - : _localConfig(local_config) { - m_handle= 0; m_version = version; m_node_type = node_type; - _ownNodeId = _localConfig._ownNodeId; + _ownNodeId= 0; + + m_handle= ndb_mgm_create_handle(); + + if (m_handle == 0) { + setError(CR_ERROR, "Unable to allocate mgm handle"); + return; + } + + if (ndb_mgm_set_connectstring(m_handle, _connect_string)) + { + setError(CR_ERROR, ndb_mgm_get_latest_error_desc(m_handle)); + return; + } + resetError(); } -ConfigRetriever::~ConfigRetriever(){ - +ConfigRetriever::~ConfigRetriever() +{ if (m_handle) { ndb_mgm_disconnect(m_handle); ndb_mgm_destroy_handle(&m_handle); } } +Uint32 +ConfigRetriever::get_configuration_nodeid() const +{ + return ndb_mgm_get_configuration_nodeid(m_handle); +} + +Uint32 ConfigRetriever::get_mgmd_port() const +{ + return ndb_mgm_get_connected_port(m_handle); +} + +const char *ConfigRetriever::get_mgmd_host() const +{ + return ndb_mgm_get_connected_host(m_handle); +} //**************************************************************************** //**************************************************************************** int -ConfigRetriever::do_connect(int exit_on_connect_failure){ - - m_mgmd_port= 0; - m_mgmd_host= 0; - - if(!m_handle) - m_handle= ndb_mgm_create_handle(); - - if (m_handle == 0) { - setError(CR_ERROR, "Unable to allocate mgm handle"); - return -1; - } - - int retry = 1; - int retry_max = 12; // Max number of retry attempts - int retry_interval= 5; // Seconds between each retry - while(retry < retry_max){ - Uint32 type = CR_ERROR; - BaseString tmp; - for (unsigned int i = 0; i<_localConfig.ids.size(); i++){ - MgmtSrvrId * m = &_localConfig.ids[i]; - DBUG_PRINT("info",("trying %s:%d", - m->name.c_str(), - m->port)); - switch(m->type){ - case MgmId_TCP: - tmp.assfmt("%s:%d", m->name.c_str(), m->port); - if (ndb_mgm_connect(m_handle, tmp.c_str()) == 0) { - m_mgmd_port= m->port; - m_mgmd_host= m->name.c_str(); - DBUG_PRINT("info",("connected to ndb_mgmd at %s:%d", - m_mgmd_host, - m_mgmd_port)); - return 0; - } - setError(CR_RETRY, ndb_mgm_get_latest_error_desc(m_handle)); - case MgmId_File: - break; - } - } - if(latestErrorType == CR_RETRY){ - DBUG_PRINT("info",("CR_RETRY")); - if (exit_on_connect_failure) - return 1; - REPORT_WARNING("Failed to retrieve cluster configuration"); - ndbout << "(Cause of failure: " << getErrorString() << ")" << endl; - ndbout << "Attempt " << retry << " of " << retry_max << ". " - << "Trying again in "<< retry_interval <<" seconds..." - << endl << endl; - NdbSleep_SecSleep(retry_interval); - } else { - break; - } - retry++; - } - - ndb_mgm_destroy_handle(&m_handle); - m_handle= 0; - m_mgmd_port= 0; - m_mgmd_host= 0; - return -1; +ConfigRetriever::do_connect(int no_retries, + int retry_delay_in_seconds, int verbose) +{ + return + (ndb_mgm_connect(m_handle,no_retries,retry_delay_in_seconds,verbose)==0) ? + 0 : -1; } //**************************************************************************** @@ -140,22 +111,9 @@ ConfigRetriever::getConfig() { struct ndb_mgm_configuration * p = 0; - if(m_handle != 0){ + if(m_handle != 0) p = getConfig(m_handle); - } else { - for (unsigned int i = 0; i<_localConfig.ids.size(); i++){ - MgmtSrvrId * m = &_localConfig.ids[i]; - switch(m->type){ - case MgmId_File: - p = getConfig(m->name.c_str()); - break; - case MgmId_TCP: - break; - } - if(p) - break; - } - } + if(p == 0) return 0; @@ -227,6 +185,16 @@ ConfigRetriever::setError(ErrorType et, const char * s){ latestErrorType = et; } +void +ConfigRetriever::resetError(){ + setError(CR_NO_ERROR,0); +} + +int +ConfigRetriever::hasError() +{ + return latestErrorType != CR_NO_ERROR; +} const char * ConfigRetriever::getErrorString(){ @@ -341,16 +309,23 @@ ConfigRetriever::verifyConfig(const struct ndb_mgm_configuration * conf, Uint32 } Uint32 -ConfigRetriever::allocNodeId(){ - unsigned nodeid= _ownNodeId; - - if(m_handle != 0){ - int res= ndb_mgm_alloc_nodeid(m_handle, m_version, &nodeid, m_node_type); - if(res != 0) { - setError(CR_ERROR, ndb_mgm_get_latest_error_desc(m_handle)); - return 0; +ConfigRetriever::allocNodeId(int no_retries, int retry_delay_in_seconds) +{ + _ownNodeId= 0; + if(m_handle != 0) + { + while (1) + { + int res= ndb_mgm_alloc_nodeid(m_handle, m_version, m_node_type); + if(res >= 0) + return _ownNodeId= (Uint32)res; + if (no_retries == 0) + break; + no_retries--; + NdbSleep_SecSleep(retry_delay_in_seconds); } - } - - return _ownNodeId= nodeid; + setError(CR_ERROR, ndb_mgm_get_latest_error_desc(m_handle)); + } else + setError(CR_ERROR, "management server handle not initialized"); + return 0; } diff --git a/ndb/src/kernel/main.cpp b/ndb/src/kernel/main.cpp index 926647838c9..f34e16318cd 100644 --- a/ndb/src/kernel/main.cpp +++ b/ndb/src/kernel/main.cpp @@ -19,7 +19,6 @@ #include #include "Configuration.hpp" -#include #include #include "vm/SimBlockList.hpp" @@ -69,16 +68,9 @@ int main(int argc, char** argv) return NRT_Default; } - LocalConfig local_config; - if (!local_config.init(theConfig->getConnectString(),0)){ - local_config.printError(); - local_config.printUsage(); - return NRT_Default; - } - { // Do configuration signal(SIGPIPE, SIG_IGN); - theConfig->fetch_configuration(local_config); + theConfig->fetch_configuration(); } chdir(NdbConfig_get_path(0)); @@ -141,7 +133,7 @@ int main(int argc, char** argv) exit(0); } g_eventLogger.info("Ndb has terminated (pid %d) restarting", child); - theConfig->fetch_configuration(local_config); + theConfig->fetch_configuration(); } g_eventLogger.info("Angel pid: %d ndb pid: %d", getppid(), getpid()); diff --git a/ndb/src/kernel/vm/Configuration.cpp b/ndb/src/kernel/vm/Configuration.cpp index b3a436275f7..9019782f4db 100644 --- a/ndb/src/kernel/vm/Configuration.cpp +++ b/ndb/src/kernel/vm/Configuration.cpp @@ -17,7 +17,6 @@ #include #include -#include #include "Configuration.hpp" #include #include "GlobalData.hpp" @@ -189,7 +188,7 @@ Configuration::closeConfiguration(){ } void -Configuration::fetch_configuration(LocalConfig &local_config){ +Configuration::fetch_configuration(){ /** * Fetch configuration from management server */ @@ -199,8 +198,17 @@ Configuration::fetch_configuration(LocalConfig &local_config){ m_mgmd_port= 0; m_mgmd_host= 0; - m_config_retriever= new ConfigRetriever(local_config, NDB_VERSION, NODE_TYPE_DB); - if(m_config_retriever->do_connect() == -1){ + m_config_retriever= new ConfigRetriever(getConnectString(), + NDB_VERSION, NODE_TYPE_DB); + + if (m_config_retriever->hasError()) + { + ERROR_SET(fatal, ERR_INVALID_CONFIG, + "Could not connect initialize handle to management server", + m_config_retriever->getErrorString()); + } + + if(m_config_retriever->do_connect(12,5,1) == -1){ const char * s = m_config_retriever->getErrorString(); if(s == 0) s = "No error given!"; @@ -215,13 +223,7 @@ Configuration::fetch_configuration(LocalConfig &local_config){ ConfigRetriever &cr= *m_config_retriever; - if((globalData.ownId = cr.allocNodeId()) == 0){ - for(Uint32 i = 0; i<3; i++){ - NdbSleep_SecSleep(3); - if((globalData.ownId = cr.allocNodeId()) != 0) - break; - } - } + globalData.ownId = cr.allocNodeId(2 /*retry*/,3 /*delay*/); if(globalData.ownId == 0){ ERROR_SET(fatal, ERR_INVALID_CONFIG, @@ -599,7 +601,8 @@ Configuration::calcSizeAlt(ConfigValues * ownConfig){ Uint32 noOfTCScanRecords = noOfScanRecords; { - Uint32 noOfAccTables= noOfTables + noOfUniqueHashIndexes; + Uint32 noOfAccTables= noOfTables + noOfUniqueHashIndexes * + noOfOrderedIndexes /* should be removed */; /** * Acc Size Alt values */ @@ -758,13 +761,14 @@ Configuration::calcSizeAlt(ConfigValues * ownConfig){ * Tux Size Alt values */ cfg.put(CFG_TUX_INDEX, - noOfOrderedIndexes); + noOfMetaTables /*noOfOrderedIndexes*/); cfg.put(CFG_TUX_FRAGMENT, - 2 * NO_OF_FRAG_PER_NODE * noOfOrderedIndexes * noOfReplicas); + 2 * NO_OF_FRAG_PER_NODE * noOfMetaTables /*noOfOrderedIndexes*/ * + noOfReplicas); cfg.put(CFG_TUX_ATTRIBUTE, - noOfOrderedIndexes * 4); + noOfMetaTables /*noOfOrderedIndexes*/ * 4); cfg.put(CFG_TUX_SCAN_OP, noOfLocalScanRecords); } diff --git a/ndb/src/kernel/vm/Configuration.hpp b/ndb/src/kernel/vm/Configuration.hpp index e4cd64f5ca8..acf0e163a84 100644 --- a/ndb/src/kernel/vm/Configuration.hpp +++ b/ndb/src/kernel/vm/Configuration.hpp @@ -21,7 +21,6 @@ #include class ConfigRetriever; -class LocalConfig; class Configuration { public: @@ -33,7 +32,7 @@ public: */ bool init(int argc, char** argv); - void fetch_configuration(LocalConfig &local_config); + void fetch_configuration(); void setupConfiguration(); void closeConfiguration(); diff --git a/ndb/src/mgmapi/LocalConfig.cpp b/ndb/src/mgmapi/LocalConfig.cpp index d0ff97cdedf..8f1e2ee8100 100644 --- a/ndb/src/mgmapi/LocalConfig.cpp +++ b/ndb/src/mgmapi/LocalConfig.cpp @@ -14,7 +14,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include +#include "LocalConfig.hpp" #include #include #include @@ -294,4 +294,19 @@ LocalConfig::readConnectString(const char * connectString, return return_value; } +char * +LocalConfig::makeConnectString(char *buf, int sz) +{ + int p= BaseString::snprintf(buf,sz,"nodeid=%d", _ownNodeId); + for (int i = 0; (i < ids.size()) && (sz-p > 0); i++) + { + if (ids[i].type != MgmId_TCP) + continue; + p+=BaseString::snprintf(buf+p,sz-p,",%s:%d", + ids[i].name.c_str(), ids[i].port); + } + buf[sz-1]=0; + return buf; +} + template class Vector; diff --git a/ndb/include/mgmapi/LocalConfig.hpp b/ndb/src/mgmapi/LocalConfig.hpp similarity index 97% rename from ndb/include/mgmapi/LocalConfig.hpp rename to ndb/src/mgmapi/LocalConfig.hpp index 9ceeffdba36..c415ec1be91 100644 --- a/ndb/include/mgmapi/LocalConfig.hpp +++ b/ndb/src/mgmapi/LocalConfig.hpp @@ -61,6 +61,7 @@ struct LocalConfig { bool parseHostName(const char *buf); bool parseFileName(const char *buf); bool parseString(const char *buf, BaseString &err); + char * makeConnectString(char *buf, int sz); }; #endif // LocalConfig_H diff --git a/ndb/src/mgmapi/mgmapi.cpp b/ndb/src/mgmapi/mgmapi.cpp index 51f2d7cee01..ca3a2a2186d 100644 --- a/ndb/src/mgmapi/mgmapi.cpp +++ b/ndb/src/mgmapi/mgmapi.cpp @@ -20,6 +20,7 @@ #include #include +#include #include #include "mgmapi.h" #include "mgmapi_debug.h" @@ -83,8 +84,8 @@ typedef Parser Parser_t; #define NDB_MGM_MAX_ERR_DESC_SIZE 256 struct ndb_mgm_handle { - char * hostname; - unsigned short port; + char * connectstring; + int cfg_i; int connected; int last_error; @@ -95,7 +96,7 @@ struct ndb_mgm_handle { NDB_SOCKET_TYPE socket; - char cfg_ptr[sizeof(LocalConfig)]; + LocalConfig cfg; #ifdef MGMAPI_LOG FILE* logfile; @@ -148,14 +149,16 @@ ndb_mgm_create_handle() h->connected = 0; h->last_error = 0; h->last_error_line = 0; - h->hostname = 0; h->socket = NDB_INVALID_SOCKET; h->read_timeout = 50000; h->write_timeout = 100; - - new (h->cfg_ptr) LocalConfig; + h->cfg_i = 0; strncpy(h->last_error_desc, "No error", NDB_MGM_MAX_ERR_DESC_SIZE); + + new (&(h->cfg)) LocalConfig; + h->cfg.init(0, 0); + #ifdef MGMAPI_LOG h->logfile = 0; #endif @@ -163,6 +166,23 @@ ndb_mgm_create_handle() return h; } +extern "C" +int +ndb_mgm_set_connectstring(NdbMgmHandle handle, const char * mgmsrv) +{ + new (&(handle->cfg)) LocalConfig; + if (!handle->cfg.init(mgmsrv, 0) || + handle->cfg.ids.size() == 0) + { + new (&(handle->cfg)) LocalConfig; + handle->cfg.init(0, 0); /* reset the LocalCongig */ + SET_ERROR(handle, NDB_MGM_ILLEGAL_CONNECT_STRING, ""); + return -1; + } + handle->cfg_i= 0; + return 0; +} + /** * Destroy a handle */ @@ -175,14 +195,13 @@ ndb_mgm_destroy_handle(NdbMgmHandle * handle) if((* handle)->connected){ ndb_mgm_disconnect(* handle); } - my_free((* handle)->hostname,MYF(MY_ALLOW_ZERO_PTR)); #ifdef MGMAPI_LOG if ((* handle)->logfile != 0){ fclose((* handle)->logfile); (* handle)->logfile = 0; } #endif - ((LocalConfig*)((*handle)->cfg_ptr))->~LocalConfig(); + (*handle)->cfg.~LocalConfig(); my_free((char*)* handle,MYF(MY_ALLOW_ZERO_PTR)); * handle = 0; } @@ -314,7 +333,8 @@ ndb_mgm_call(NdbMgmHandle handle, const ParserRow *command_reply, */ extern "C" int -ndb_mgm_connect(NdbMgmHandle handle, const char * mgmsrv) +ndb_mgm_connect(NdbMgmHandle handle, int no_retries, + int retry_delay_in_seconds, int verbose) { SET_ERROR(handle, NDB_MGM_NO_ERROR, "Executing: ndb_mgm_connect"); CHECK_HANDLE(handle, -1); @@ -331,36 +351,48 @@ ndb_mgm_connect(NdbMgmHandle handle, const char * mgmsrv) /** * Do connect */ - LocalConfig *cfg= (LocalConfig*)(handle->cfg_ptr); - new (cfg) LocalConfig; - if (!cfg->init(mgmsrv, 0) || - cfg->ids.size() == 0) - { - SET_ERROR(handle, NDB_MGM_ILLEGAL_CONNECT_STRING, ""); - return -1; - } - + LocalConfig &cfg= handle->cfg; NDB_SOCKET_TYPE sockfd= NDB_INVALID_SOCKET; Uint32 i; - for (i = 0; i < cfg->ids.size(); i++) + while (sockfd == NDB_INVALID_SOCKET) { - if (cfg->ids[i].type != MgmId_TCP) - continue; - SocketClient s(cfg->ids[i].name.c_str(), cfg->ids[i].port); - sockfd = s.connect(); + // do all the mgmt servers + for (i = 0; i < cfg.ids.size(); i++) + { + if (cfg.ids[i].type != MgmId_TCP) + continue; + SocketClient s(cfg.ids[i].name.c_str(), cfg.ids[i].port); + sockfd = s.connect(); + if (sockfd != NDB_INVALID_SOCKET) + break; + } if (sockfd != NDB_INVALID_SOCKET) break; - } - if (sockfd == NDB_INVALID_SOCKET) - { - setError(handle, NDB_MGM_COULD_NOT_CONNECT_TO_SOCKET, __LINE__, - "Unable to connect using connectstring %s", mgmsrv); - return -1; + if (verbose > 0) { + char buf[1024]; + ndbout_c("Unable to connect with connect string: %s", + cfg.makeConnectString(buf,sizeof(buf))); + verbose= -1; + } + if (no_retries == 0) { + char buf[1024]; + setError(handle, NDB_MGM_COULD_NOT_CONNECT_TO_SOCKET, __LINE__, + "Unable to connect with connect string: %s", + cfg.makeConnectString(buf,sizeof(buf))); + return -1; + } + if (verbose == -1) { + ndbout << "retrying every " << retry_delay_in_seconds << " seconds:"; + verbose= -2; + } + NdbSleep_SecSleep(retry_delay_in_seconds); + if (verbose == -2) { + ndbout << " " << no_retries; + } + no_retries--; } - my_free(handle->hostname,MYF(MY_ALLOW_ZERO_PTR)); - handle->hostname = my_strdup(cfg->ids[i].name.c_str(),MYF(MY_WME)); - handle->port = cfg->ids[i].port; + handle->cfg_i = i; handle->socket = sockfd; handle->connected = 1; @@ -1068,7 +1100,9 @@ ndb_mgm_listen_event(NdbMgmHandle handle, int filter[]) }; CHECK_HANDLE(handle, -1); - SocketClient s(handle->hostname, handle->port); + const char *hostname= ndb_mgm_get_connected_host(handle); + int port= ndb_mgm_get_connected_port(handle); + SocketClient s(hostname, port); const NDB_SOCKET_TYPE sockfd = s.connect(); if (sockfd < 0) { setError(handle, NDB_MGM_COULD_NOT_CONNECT_TO_SOCKET, __LINE__, @@ -1613,16 +1647,37 @@ ndb_mgm_destroy_configuration(struct ndb_mgm_configuration *cfg) extern "C" int -ndb_mgm_alloc_nodeid(NdbMgmHandle handle, unsigned int version, unsigned *pnodeid, int nodetype) +ndb_mgm_get_configuration_nodeid(NdbMgmHandle handle) { + CHECK_HANDLE(handle, 0); + return handle->cfg._ownNodeId; +} +extern "C" +int ndb_mgm_get_connected_port(NdbMgmHandle handle) +{ + return handle->cfg.ids[handle->cfg_i].port; +} + +extern "C" +const char *ndb_mgm_get_connected_host(NdbMgmHandle handle) +{ + return handle->cfg.ids[handle->cfg_i].name.c_str(); +} + +extern "C" +int +ndb_mgm_alloc_nodeid(NdbMgmHandle handle, unsigned int version, int nodetype) +{ CHECK_HANDLE(handle, 0); CHECK_CONNECTED(handle, 0); + int nodeid= handle->cfg._ownNodeId; + Properties args; args.put("version", version); args.put("nodetype", nodetype); - args.put("nodeid", *pnodeid); + args.put("nodeid", nodeid); args.put("user", "mysqld"); args.put("password", "mysqld"); args.put("public key", "a public key"); @@ -1638,26 +1693,29 @@ ndb_mgm_alloc_nodeid(NdbMgmHandle handle, unsigned int version, unsigned *pnodei prop= ndb_mgm_call(handle, reply, "get nodeid", &args); CHECK_REPLY(prop, -1); - int res= -1; + nodeid= -1; do { const char * buf; if(!prop->get("result", &buf) || strcmp(buf, "Ok") != 0){ + const char *hostname= ndb_mgm_get_connected_host(handle); + unsigned port= ndb_mgm_get_connected_port(handle); BaseString err; err.assfmt("Could not alloc node id at %s port %d: %s", - handle->hostname, handle->port, buf); + hostname, port, buf); setError(handle, NDB_MGM_COULD_NOT_CONNECT_TO_SOCKET, __LINE__, err.c_str()); break; } - if(!prop->get("nodeid", pnodeid) != 0){ + Uint32 _nodeid; + if(!prop->get("nodeid", &_nodeid) != 0){ ndbout_c("ERROR Message: \n"); break; } - res= 0; + nodeid= _nodeid; }while(0); delete prop; - return res; + return nodeid; } /***************************************************************************** diff --git a/ndb/src/mgmclient/CommandInterpreter.cpp b/ndb/src/mgmclient/CommandInterpreter.cpp index d940f6e165a..00e0a8c1919 100644 --- a/ndb/src/mgmclient/CommandInterpreter.cpp +++ b/ndb/src/mgmclient/CommandInterpreter.cpp @@ -153,7 +153,6 @@ private: NdbMgmHandle m_mgmsrv; bool connected; - const char *host; int try_reconnect; #ifdef HAVE_GLOBAL_REPLICATION NdbRepHandle m_repserver; @@ -193,7 +192,7 @@ extern "C" { { return (Ndb_mgmclient_handle) new Ndb_mgmclient(connect_string); } - int ndb_mgmclient_execute(Ndb_mgmclient_handle h, int argc, const char** argv) + int ndb_mgmclient_execute(Ndb_mgmclient_handle h, int argc, char** argv) { return ((Ndb_mgmclient*)h)->execute(argc, argv, 1); } @@ -226,7 +225,7 @@ extern "C" { #include #include -int Ndb_mgmclient::execute(int argc, const char** argv, int _try_reconnect) +int Ndb_mgmclient::execute(int argc, char** argv, int _try_reconnect) { if (argc <= 0) return 0; @@ -379,15 +378,16 @@ CommandInterpreter::CommandInterpreter(const char *_host) m_mgmsrv = ndb_mgm_create_handle(); if(m_mgmsrv == NULL) { ndbout_c("Cannot create handle to management server."); + exit(-1); + } + if (ndb_mgm_set_connectstring(m_mgmsrv, _host)) + { printError(); + exit(-1); } connected = false; try_reconnect = 0; - if (_host) - host= my_strdup(_host,MYF(MY_WME)); - else - host= 0; #ifdef HAVE_GLOBAL_REPLICATION rep_host = NULL; m_repserver = NULL; @@ -402,8 +402,6 @@ CommandInterpreter::~CommandInterpreter() { connected = false; ndb_mgm_destroy_handle(&m_mgmsrv); - my_free((char *)host,MYF(MY_ALLOW_ZERO_PTR)); - host = NULL; } static bool @@ -438,18 +436,8 @@ bool CommandInterpreter::connect() { if(!connected) { - int tries = try_reconnect; // tries == 0 => infinite - while(!connected) { - if(ndb_mgm_connect(m_mgmsrv, host) == -1) { - ndbout << "Cannot connect to management server (" << host << ")."; - tries--; - if (tries == 0) - break; - ndbout << "Retrying in 5 seconds." << endl; - NdbSleep_SecSleep(5); - } else - connected = true; - } + if(!ndb_mgm_connect(m_mgmsrv, try_reconnect-1, 5, 1)) + connected = true; } return connected; } diff --git a/ndb/src/mgmclient/main.cpp b/ndb/src/mgmclient/main.cpp index 401a9198f30..e2de4b277a9 100644 --- a/ndb/src/mgmclient/main.cpp +++ b/ndb/src/mgmclient/main.cpp @@ -30,9 +30,10 @@ extern "C" int add_history(const char *command); /* From readline directory */ #include #include +#include +#include #include #include -#include #include "ndb_mgmclient.hpp" diff --git a/ndb/src/mgmclient/ndb_mgmclient.h b/ndb/src/mgmclient/ndb_mgmclient.h index 265e6bc67ec..b62a33999a3 100644 --- a/ndb/src/mgmclient/ndb_mgmclient.h +++ b/ndb/src/mgmclient/ndb_mgmclient.h @@ -23,7 +23,7 @@ extern "C" { typedef void* Ndb_mgmclient_handle; Ndb_mgmclient_handle ndb_mgmclient_handle_create(const char *connect_string); -int ndb_mgmclient_execute(Ndb_mgmclient_handle, int argc, const char** argv); +int ndb_mgmclient_execute(Ndb_mgmclient_handle, int argc, char** argv); int ndb_mgmclient_handle_destroy(Ndb_mgmclient_handle); #ifdef __cplusplus diff --git a/ndb/src/mgmclient/ndb_mgmclient.hpp b/ndb/src/mgmclient/ndb_mgmclient.hpp index 933d1bab5ce..f6bcebc3896 100644 --- a/ndb/src/mgmclient/ndb_mgmclient.hpp +++ b/ndb/src/mgmclient/ndb_mgmclient.hpp @@ -24,7 +24,7 @@ public: Ndb_mgmclient(const char*); ~Ndb_mgmclient(); int execute(const char *_line, int _try_reconnect=-1); - int execute(int argc, const char** argv, int _try_reconnect=-1); + int execute(int argc, char** argv, int _try_reconnect=-1); int disconnect(); private: CommandInterpreter *m_cmd; diff --git a/ndb/src/mgmsrv/MgmtSrvr.cpp b/ndb/src/mgmsrv/MgmtSrvr.cpp index a49b29af275..81b5eb9dfb3 100644 --- a/ndb/src/mgmsrv/MgmtSrvr.cpp +++ b/ndb/src/mgmsrv/MgmtSrvr.cpp @@ -399,16 +399,20 @@ MgmtSrvr::getPort() const { } /* Constructor */ -MgmtSrvr::MgmtSrvr(NodeId nodeId, - SocketServer *socket_server, - const BaseString &configFilename, - LocalConfig &local_config, - Config * config): +int MgmtSrvr::init() +{ + if ( _ownNodeId > 0) + return 0; + return -1; +} + +MgmtSrvr::MgmtSrvr(SocketServer *socket_server, + const char *config_filename, + const char *connect_string) : _blockNumber(1), // Hard coded block number since it makes it easy to send // signals to other management servers. m_socket_server(socket_server), _ownReference(0), - m_local_config(local_config), theSignalIdleList(NULL), theWaitState(WAIT_SUBSCRIBE_CONF), m_statisticsListner(this) @@ -416,6 +420,8 @@ MgmtSrvr::MgmtSrvr(NodeId nodeId, DBUG_ENTER("MgmtSrvr::MgmtSrvr"); + _ownNodeId= 0; + _config = NULL; _isStopThread = false; @@ -426,12 +432,43 @@ MgmtSrvr::MgmtSrvr(NodeId nodeId, theFacade = 0; m_newConfig = NULL; - m_configFilename = configFilename; + m_configFilename.assign(config_filename); m_nextConfigGenerationNumber = 0; - _config = (config == 0 ? readConfig() : config); - + m_config_retriever= new ConfigRetriever(connect_string, + NDB_VERSION, NDB_MGM_NODE_TYPE_MGM); + + // first try to allocate nodeid from another management server + if(m_config_retriever->do_connect(0,0,0) == 0) + { + int tmp_nodeid= 0; + tmp_nodeid= m_config_retriever->allocNodeId(0 /*retry*/,0 /*delay*/); + if (tmp_nodeid == 0) + { + ndbout_c(m_config_retriever->getErrorString()); + exit(-1); + } + // read config from other managent server + _config= fetchConfig(); + if (_config == 0) + { + ndbout << m_config_retriever->getErrorString() << endl; + exit(-1); + } + _ownNodeId= tmp_nodeid; + } + + if (_ownNodeId == 0) + { + // read config locally + _config= readConfig(); + if (_config == 0) { + ndbout << "Unable to read config file" << endl; + exit(-1); + } + } + theMgmtWaitForResponseCondPtr = NdbCondition_Create(); m_configMutex = NdbMutex_Create(); @@ -443,9 +480,11 @@ MgmtSrvr::MgmtSrvr(NodeId nodeId, nodeTypes[i] = (enum ndb_mgm_node_type)-1; m_connect_address[i].s_addr= 0; } + { - ndb_mgm_configuration_iterator * iter = ndb_mgm_create_configuration_iterator - (config->m_configValues, CFG_SECTION_NODE); + ndb_mgm_configuration_iterator + *iter = ndb_mgm_create_configuration_iterator(_config->m_configValues, + CFG_SECTION_NODE); for(ndb_mgm_first(iter); ndb_mgm_valid(iter); ndb_mgm_next(iter)){ unsigned type, id; if(ndb_mgm_get_int_parameter(iter, CFG_TYPE_OF_SECTION, &type) != 0) @@ -478,8 +517,6 @@ MgmtSrvr::MgmtSrvr(NodeId nodeId, } _props = NULL; - _ownNodeId= 0; - NodeId tmp= nodeId; BaseString error_string; if ((m_node_id_mutex = NdbMutex_Create()) == 0) @@ -488,43 +525,25 @@ MgmtSrvr::MgmtSrvr(NodeId nodeId, exit(-1); } -#if 0 - char my_hostname[256]; - struct sockaddr_in tmp_addr; - SOCKET_SIZE_TYPE addrlen= sizeof(tmp_addr); - if (!g_no_nodeid_checks) { - if (gethostname(my_hostname, sizeof(my_hostname))) { - ndbout << "error: gethostname() - " << strerror(errno) << endl; - exit(-1); - } - if (Ndb_getInAddr(&(((sockaddr_in*)&tmp_addr)->sin_addr),my_hostname)) { - ndbout << "error: Ndb_getInAddr(" << my_hostname << ") - " - << strerror(errno) << endl; + if (_ownNodeId == 0) // we did not get node id from other server + { + NodeId tmp= m_config_retriever->get_configuration_nodeid(); + + if (!alloc_node_id(&tmp, NDB_MGM_NODE_TYPE_MGM, + 0, 0, error_string)){ + ndbout << "Unable to obtain requested nodeid: " + << error_string.c_str() << endl; exit(-1); } + _ownNodeId = tmp; } - if (!alloc_node_id(&tmp, NDB_MGM_NODE_TYPE_MGM, - (struct sockaddr *)&tmp_addr, - &addrlen, error_string)){ - ndbout << "Unable to obtain requested nodeid: " - << error_string.c_str() << endl; - exit(-1); - } -#else - if (!alloc_node_id(&tmp, NDB_MGM_NODE_TYPE_MGM, - 0, 0, error_string)){ - ndbout << "Unable to obtain requested nodeid: " - << error_string.c_str() << endl; - exit(-1); - } -#endif - _ownNodeId = tmp; { DBUG_PRINT("info", ("verifyConfig")); - ConfigRetriever cr(m_local_config, NDB_VERSION, NDB_MGM_NODE_TYPE_MGM); - if (!cr.verifyConfig(config->m_configValues, _ownNodeId)) { - ndbout << cr.getErrorString() << endl; + if (!m_config_retriever->verifyConfig(_config->m_configValues, + _ownNodeId)) + { + ndbout << m_config_retriever->getErrorString() << endl; exit(-1); } } @@ -657,6 +676,8 @@ MgmtSrvr::~MgmtSrvr() NdbThread_WaitFor(m_signalRecvThread, &res); NdbThread_Destroy(&m_signalRecvThread); } + if (m_config_retriever) + delete m_config_retriever; } //**************************************************************************** diff --git a/ndb/src/mgmsrv/MgmtSrvr.hpp b/ndb/src/mgmsrv/MgmtSrvr.hpp index b3257491123..2ab11250d81 100644 --- a/ndb/src/mgmsrv/MgmtSrvr.hpp +++ b/ndb/src/mgmsrv/MgmtSrvr.hpp @@ -175,11 +175,10 @@ public: /* Constructor */ - MgmtSrvr(NodeId nodeId, /* Local nodeid */ - SocketServer *socket_server, - const BaseString &config_filename, /* Where to save config */ - LocalConfig &local_config, /* Ndb.cfg filename */ - Config * config); + MgmtSrvr(SocketServer *socket_server, + const char *config_filename, /* Where to save config */ + const char *connect_string); + int init(); NodeId getOwnNodeId() const {return _ownNodeId;}; /** @@ -538,7 +537,6 @@ private: NdbMutex *m_configMutex; const Config * _config; Config * m_newConfig; - LocalConfig &m_local_config; BaseString m_configFilename; Uint32 m_nextConfigGenerationNumber; @@ -755,6 +753,9 @@ private: Config *_props; int send(class NdbApiSignal* signal, Uint32 node, Uint32 node_type); + + ConfigRetriever *m_config_retriever; + public: /** * This method does not exist diff --git a/ndb/src/mgmsrv/MgmtSrvrConfig.cpp b/ndb/src/mgmsrv/MgmtSrvrConfig.cpp index 1d51061e909..6c4b4e9ae3c 100644 --- a/ndb/src/mgmsrv/MgmtSrvrConfig.cpp +++ b/ndb/src/mgmsrv/MgmtSrvrConfig.cpp @@ -272,30 +272,20 @@ MgmtSrvr::saveConfig(const Config *conf) { Config * MgmtSrvr::readConfig() { - Config *conf = NULL; - if(m_configFilename.length() != 0) { - /* Use config file */ - InitConfigFileParser parser; - conf = parser.parseConfig(m_configFilename.c_str()); - - if(conf == NULL) { - /* Try to get configuration from other MGM server */ - return fetchConfig(); - } - } + Config *conf; + InitConfigFileParser parser; + conf = parser.parseConfig(m_configFilename.c_str()); return conf; } Config * MgmtSrvr::fetchConfig() { - ConfigRetriever cr(m_local_config, NDB_VERSION, NODE_TYPE_MGM); - struct ndb_mgm_configuration * tmp = cr.getConfig(); + struct ndb_mgm_configuration * tmp = m_config_retriever->getConfig(); if(tmp != 0){ Config * conf = new Config(); conf->m_configValues = tmp; return conf; } - return 0; } diff --git a/ndb/src/mgmsrv/main.cpp b/ndb/src/mgmsrv/main.cpp index 76f0679b069..625a303f7c0 100644 --- a/ndb/src/mgmsrv/main.cpp +++ b/ndb/src/mgmsrv/main.cpp @@ -62,7 +62,6 @@ struct MgmGlobals { int non_interactive; int interactive; const char * config_filename; - const char * local_config_filename; /** Stuff found in environment or in local config */ NodeId localNodeId; @@ -70,9 +69,6 @@ struct MgmGlobals { char * interface_name; int port; - /** The configuration of the cluster */ - Config * cluster_config; - /** The Mgmt Server */ MgmtSrvr * mgmObject; @@ -86,9 +82,6 @@ static MgmGlobals glob; /****************************************************************************** * Function prototypes ******************************************************************************/ -static bool readLocalConfig(); -static bool readGlobalConfig(); - /** * Global variables */ @@ -122,9 +115,6 @@ static struct my_option my_long_options[] = { "daemon", 'd', "Run ndb_mgmd in daemon mode (default)", (gptr*) &glob.daemon, (gptr*) &glob.daemon, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0 }, - { "l", 'l', "Specify configuration file connect string (default Ndb.cfg if available)", - (gptr*) &glob.local_config_filename, (gptr*) &glob.local_config_filename, 0, - GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, { "interactive", 256, "Run interactive. Not supported but provided for testing purposes", (gptr*) &glob.interactive, (gptr*) &glob.interactive, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 }, @@ -212,29 +202,16 @@ int main(int argc, char** argv) MgmApiService * mapi = new MgmApiService(); - /**************************** - * Read configuration files * - ****************************/ - LocalConfig local_config; - if(!local_config.init(opt_connect_str,glob.local_config_filename)){ - local_config.printError(); - goto error_end; - } - glob.localNodeId = local_config._ownNodeId; + glob.mgmObject = new MgmtSrvr(glob.socketServer, + glob.config_filename, + opt_connect_str); - if (!readGlobalConfig()) + if (glob.mgmObject->init()) goto error_end; - glob.mgmObject = new MgmtSrvr(glob.localNodeId, glob.socketServer, - BaseString(glob.config_filename), - local_config, - glob.cluster_config); - chdir(NdbConfig_get_path(0)); - glob.cluster_config = 0; glob.localNodeId= glob.mgmObject->getOwnNodeId(); - if (glob.localNodeId == 0) { goto error_end; } @@ -345,9 +322,7 @@ MgmGlobals::MgmGlobals(){ // Default values port = 0; config_filename = NULL; - local_config_filename = NULL; interface_name = 0; - cluster_config = 0; daemon = 1; non_interactive = 0; interactive = 0; @@ -360,27 +335,6 @@ MgmGlobals::~MgmGlobals(){ delete socketServer; if (mgmObject) delete mgmObject; - if (cluster_config) - delete cluster_config; if (interface_name) free(interface_name); } - -/** - * @fn readGlobalConfig - * @param glob : Global variables - * @return true if success, false otherwise. - */ -static bool -readGlobalConfig() { - if(glob.config_filename == NULL) - return false; - - /* Use config file */ - InitConfigFileParser parser; - glob.cluster_config = parser.parseConfig(glob.config_filename); - if(glob.cluster_config == 0){ - return false; - } - return true; -} diff --git a/ndb/src/ndbapi/ndb_cluster_connection.cpp b/ndb/src/ndbapi/ndb_cluster_connection.cpp index 4c42fe1aeef..b2043b2c2c1 100644 --- a/ndb/src/ndbapi/ndb_cluster_connection.cpp +++ b/ndb/src/ndbapi/ndb_cluster_connection.cpp @@ -45,7 +45,6 @@ Ndb_cluster_connection::Ndb_cluster_connection(const char *connect_string) else m_connect_string= 0; m_config_retriever= 0; - m_local_config= 0; m_connect_thread= 0; m_connect_callback= 0; @@ -125,38 +124,31 @@ int Ndb_cluster_connection::connect(int reconnect) do { if (m_config_retriever == 0) { - if (m_local_config == 0) { - m_local_config= new LocalConfig(); - if (!m_local_config->init(m_connect_string,0)) { - ndbout_c("Configuration error: Unable to retrieve local config"); - m_local_config->printError(); - m_local_config->printUsage(); - DBUG_RETURN(-1); - } - } m_config_retriever= - new ConfigRetriever(*m_local_config, NDB_VERSION, NODE_TYPE_API); + new ConfigRetriever(m_connect_string, NDB_VERSION, NODE_TYPE_API); + if (m_config_retriever->hasError()) + { + printf("Could not connect initialize handle to management server", + m_config_retriever->getErrorString()); + DBUG_RETURN(-1); + } } else if (reconnect == 0) DBUG_RETURN(0); if (reconnect) { - int r= m_config_retriever->do_connect(1); + int r= m_config_retriever->do_connect(0,0,0); if (r == 1) DBUG_RETURN(1); // mgmt server not up yet if (r == -1) break; } else - if(m_config_retriever->do_connect() == -1) + if(m_config_retriever->do_connect(12,5,1) == -1) break; - Uint32 nodeId = m_config_retriever->allocNodeId(); - for(Uint32 i = 0; nodeId == 0 && i<5; i++){ - NdbSleep_SecSleep(3); - nodeId = m_config_retriever->allocNodeId(); - } + Uint32 nodeId = m_config_retriever->allocNodeId(4/*retries*/,3/*delay*/); if(nodeId == 0) break; ndb_mgm_configuration * props = m_config_retriever->getConfig(); @@ -200,8 +192,6 @@ Ndb_cluster_connection::~Ndb_cluster_connection() my_free(m_connect_string,MYF(MY_ALLOW_ZERO_PTR)); if (m_config_retriever) delete m_config_retriever; - if (m_local_config) - delete m_local_config; DBUG_VOID_RETURN; } diff --git a/ndb/tools/waiter.cpp b/ndb/tools/waiter.cpp index e24164ea807..cb694ae5877 100644 --- a/ndb/tools/waiter.cpp +++ b/ndb/tools/waiter.cpp @@ -23,7 +23,6 @@ #include #include #include -#include #include @@ -85,39 +84,8 @@ int main(int argc, char** argv){ char buf[255]; _hostName = argv[0]; - if (_hostName == NULL){ - LocalConfig lcfg; - if(!lcfg.init(opt_connect_str, 0)) - { - lcfg.printError(); - lcfg.printUsage(); - g_err << "Error parsing local config file" << endl; - return NDBT_ProgramExit(NDBT_FAILED); - } - - for (unsigned i = 0; itype){ - case MgmId_TCP: - snprintf(buf, 255, "%s:%d", m->name.c_str(), m->port); - _hostName = buf; - break; - case MgmId_File: - break; - default: - break; - } - if (_hostName != NULL) - break; - } - if (_hostName == NULL) - { - g_err << "No management servers configured in local config file" << endl; - return NDBT_ProgramExit(NDBT_FAILED); - } - } + if (_hostName == 0) + _hostName= opt_connect_str; if (_no_contact) { if (waitClusterStatus(_hostName, NDB_MGM_NODE_STATUS_NO_CONTACT, _timeout) != 0) @@ -210,13 +178,19 @@ waitClusterStatus(const char* _addr, int _nodes[MAX_NDB_NODES]; int _num_nodes = 0; - handle = ndb_mgm_create_handle(); + handle = ndb_mgm_create_handle(); if (handle == NULL){ g_err << "handle == NULL" << endl; return -1; } g_info << "Connecting to mgmsrv at " << _addr << endl; - if (ndb_mgm_connect(handle, _addr) == -1) { + if (ndb_mgm_set_connectstring(handle, _addr)) + { + MGMERR(handle); + g_err << "Connectstring " << _addr << " invalid" << endl; + return -1; + } + if (ndb_mgm_connect(handle,0,0,1)) { MGMERR(handle); g_err << "Connection to " << _addr << " failed" << endl; return -1; From 57b6bfc9cff184daf6f44a89dbbb9084a8e92032 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 18 Nov 2004 19:07:14 +0000 Subject: [PATCH 0256/1063] bug#6684, error messages id wrong settings --- ndb/tools/restore/main.cpp | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/ndb/tools/restore/main.cpp b/ndb/tools/restore/main.cpp index 482212911cb..064fbad43a3 100644 --- a/ndb/tools/restore/main.cpp +++ b/ndb/tools/restore/main.cpp @@ -74,7 +74,7 @@ static struct my_option my_long_options[] = "No of parallel transactions during restore of data." "(parallelism can be 1 to 1024)", (gptr*) &ga_nParallelism, (gptr*) &ga_nParallelism, 0, - GET_INT, REQUIRED_ARG, 128, 0, 0, 0, 0, 0 }, + GET_INT, REQUIRED_ARG, 128, 1, 1024, 0, 1, 0 }, { "print", 256, "Print data and log to stdout", (gptr*) &_print, (gptr*) &_print, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 }, @@ -120,6 +120,18 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), case 'V': print_version(); exit(0); + case 'n': + if (ga_nodeId == 0) + { + printf("Error in --nodeid|-n setting, see --help\n"); + exit(1); + } + case 'b': + if (ga_backupId == 0) + { + printf("Error in --backupid|-b setting, see --help\n"); + exit(1); + } case '?': usage(); exit(0); @@ -131,11 +143,8 @@ readArguments(int *pargc, char*** pargv) { const char *load_default_groups[]= { "ndb_tools","ndb_restore",0 }; load_defaults("my",load_default_groups,pargc,pargv); - if (handle_options(pargc, pargv, my_long_options, get_one_option) || - ga_nodeId == 0 || - ga_backupId == 0 || - ga_nParallelism < 1 || - ga_nParallelism >1024) { + if (handle_options(pargc, pargv, my_long_options, get_one_option)) + { exit(1); } @@ -343,7 +352,8 @@ main(int argc, char** argv) if (res < 0) { - err << "Restore: An error occured while restoring data. Exiting... res=" << res << endl; + err << "Restore: An error occured while restoring data. Exiting... " + << "res=" << res << endl; return -1; } @@ -369,7 +379,8 @@ main(int argc, char** argv) } if (res < 0) { - err << "Restore: An restoring the data log. Exiting... res=" << res << endl; + err << "Restore: An restoring the data log. Exiting... res=" + << res << endl; return -1; } logIter.validateFooter(); //not implemented From 6a87e0060d7e137e5d306237676ed07c44adf3ce Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 18 Nov 2004 20:54:35 +0100 Subject: [PATCH 0257/1063] wl2077 moved inline to .hpp file --- ndb/src/kernel/blocks/dblqh/Dblqh.hpp | 19 +++ ndb/src/kernel/blocks/dblqh/DblqhMain.cpp | 54 +++---- ndb/src/kernel/blocks/dbtc/Dbtc.hpp | 11 +- ndb/src/kernel/blocks/dbtc/DbtcMain.cpp | 80 ++++++---- ndb/src/kernel/blocks/suma/Suma.cpp | 2 +- ndb/src/ndbapi/NdbConnection.cpp | 6 - ndb/src/ndbapi/NdbConnectionScan.cpp | 24 +-- ndb/src/ndbapi/NdbScanOperation.cpp | 135 ++++++++++++----- ndb/test/include/HugoTransactions.hpp | 16 +- ndb/test/include/UtilTransactions.hpp | 4 +- ndb/test/ndbapi/testScan.cpp | 9 +- ndb/test/src/HugoTransactions.cpp | 170 ++++++++++++++++++++-- ndb/test/src/UtilTransactions.cpp | 23 +-- ndb/test/tools/create_index.cpp | 2 +- ndb/test/tools/hugoScanRead.cpp | 50 ++++++- ndb/tools/select_all.cpp | 7 +- 16 files changed, 439 insertions(+), 173 deletions(-) diff --git a/ndb/src/kernel/blocks/dblqh/Dblqh.hpp b/ndb/src/kernel/blocks/dblqh/Dblqh.hpp index d6987f3e478..983fda9b7be 100644 --- a/ndb/src/kernel/blocks/dblqh/Dblqh.hpp +++ b/ndb/src/kernel/blocks/dblqh/Dblqh.hpp @@ -2925,4 +2925,23 @@ Dblqh::ScanRecord::check_scan_batch_completed() const (max_bytes > 0 && (m_curr_batch_size_bytes >= max_bytes)); } +inline +void +Dblqh::i_get_acc_ptr(ScanRecord* scanP, Uint32* &acc_ptr, Uint32 index) +{ + if (index == 0) { + acc_ptr= (Uint32*)&scanP->scan_acc_op_ptr[0]; + } else { + Uint32 attr_buf_index, attr_buf_rec; + + AttrbufPtr regAttrPtr; + jam(); + attr_buf_rec= (index + 31) / 32; + attr_buf_index= (index - 1) & 31; + regAttrPtr.i= scanP->scan_acc_op_ptr[attr_buf_rec]; + ptrCheckGuard(regAttrPtr, cattrinbufFileSize, attrbuf); + acc_ptr= (Uint32*)®AttrPtr.p->attrbuf[attr_buf_index]; + } +} + #endif diff --git a/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp b/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp index cd15ad0c3b2..e9e81d55488 100644 --- a/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp +++ b/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp @@ -7058,10 +7058,7 @@ void Dblqh::continueScanNextReqLab(Signal* signal) // Update timer on tcConnectRecord tcConnectptr.p->tcTimer = cLqhTimeOutCount; - init_acc_ptr_list(scanptr.p); - scanptr.p->m_curr_batch_size_rows = 0; - scanptr.p->m_curr_batch_size_bytes= 0; scanptr.p->scanFlag = NextScanReq::ZSCAN_NEXT; scanNextLoopLab(signal); }//Dblqh::continueScanNextReqLab() @@ -7260,22 +7257,32 @@ void Dblqh::scanLockReleasedLab(Signal* signal) tcConnectptr.i = scanptr.p->scanTcrec; ptrCheckGuard(tcConnectptr, ctcConnectrecFileSize, tcConnectionrec); releaseActiveFrag(signal); + if (scanptr.p->scanReleaseCounter == scanptr.p->m_curr_batch_size_rows) { if ((scanptr.p->scanErrorCounter > 0) || (scanptr.p->scanCompletedStatus == ZTRUE)) { jam(); + scanptr.p->m_curr_batch_size_rows = 0; + scanptr.p->m_curr_batch_size_bytes = 0; closeScanLab(signal); } else if (scanptr.p->check_scan_batch_completed() && scanptr.p->scanLockHold != ZTRUE) { jam(); scanptr.p->scanState = ScanRecord::WAIT_SCAN_NEXTREQ; sendScanFragConf(signal, ZFALSE); + } else if (scanptr.p->m_last_row && !scanptr.p->scanLockHold) { + jam(); + closeScanLab(signal); + return; } else { jam(); /* - We came here after releasing locks after receiving SCAN_NEXTREQ from TC. We only - come here when scanHoldLock == ZTRUE - */ + * We came here after releasing locks after + * receiving SCAN_NEXTREQ from TC. We only come here + * when scanHoldLock == ZTRUE + */ + scanptr.p->m_curr_batch_size_rows = 0; + scanptr.p->m_curr_batch_size_bytes = 0; continueScanNextReqLab(signal); }//if } else if (scanptr.p->scanReleaseCounter < scanptr.p->m_curr_batch_size_rows) { @@ -7362,25 +7369,6 @@ Dblqh::init_acc_ptr_list(ScanRecord* scanP) scanP->scan_acc_index = 0; } -inline -void -Dblqh::i_get_acc_ptr(ScanRecord* scanP, Uint32* &acc_ptr, Uint32 index) -{ - if (index == 0) { - acc_ptr= (Uint32*)&scanP->scan_acc_op_ptr[0]; - } else { - Uint32 attr_buf_index, attr_buf_rec; - - AttrbufPtr regAttrPtr; - jam(); - attr_buf_rec= (index + 31) / 32; - attr_buf_index= (index - 1) & 31; - regAttrPtr.i= scanP->scan_acc_op_ptr[attr_buf_rec]; - ptrCheckGuard(regAttrPtr, cattrinbufFileSize, attrbuf); - acc_ptr= (Uint32*)®AttrPtr.p->attrbuf[attr_buf_index]; - } -} - Uint32 Dblqh::get_acc_ptr_from_scan_record(ScanRecord* scanP, Uint32 index, @@ -7904,6 +7892,13 @@ void Dblqh::nextScanConfScanLab(Signal* signal) /************************************************************* * STOP THE SCAN PROCESS IF THIS HAS BEEN REQUESTED. ************************************************************ */ + if (!scanptr.p->scanLockHold) + { + jam(); + closeScanLab(signal); + return; + } + if (scanptr.p->scanCompletedStatus == ZTRUE) { if ((scanptr.p->scanLockHold == ZTRUE) && (scanptr.p->m_curr_batch_size_rows > 0)) { @@ -8404,8 +8399,6 @@ void Dblqh::tupScanCloseConfLab(Signal* signal) ScanFragRef::SignalLength, JBB); } else { jam(); - scanptr.p->m_curr_batch_size_rows = 0; - scanptr.p->m_curr_batch_size_bytes= 0; sendScanFragConf(signal, ZSCAN_FRAG_CLOSED); }//if finishScanrec(signal); @@ -8809,6 +8802,13 @@ void Dblqh::sendScanFragConf(Signal* signal, Uint32 scanCompleted) conf->total_len= total_len; sendSignal(tcConnectptr.p->clientBlockref, GSN_SCAN_FRAGCONF, signal, ScanFragConf::SignalLength, JBB); + + if(!scanptr.p->scanLockHold) + { + jam(); + scanptr.p->m_curr_batch_size_rows = 0; + scanptr.p->m_curr_batch_size_bytes= 0; + } }//Dblqh::sendScanFragConf() /* ######################################################################### */ diff --git a/ndb/src/kernel/blocks/dbtc/Dbtc.hpp b/ndb/src/kernel/blocks/dbtc/Dbtc.hpp index a209df24c44..fb90ccc8c90 100644 --- a/ndb/src/kernel/blocks/dbtc/Dbtc.hpp +++ b/ndb/src/kernel/blocks/dbtc/Dbtc.hpp @@ -1054,9 +1054,8 @@ public: // Id of the ScanRecord this fragment scan belongs to Uint32 scanRec; - // The maximum number of operations that can be scanned before - // returning to TC - Uint16 scanFragConcurrency; + // The value of fragmentCompleted in the last received SCAN_FRAGCONF + Uint8 m_scan_frag_conf_status; inline void startFragTimer(Uint32 timeVal){ scanFragTimer = timeVal; @@ -1193,8 +1192,10 @@ public: // Number of operation records per scanned fragment // Number of operations in first batch // Max number of bytes per batch - Uint16 noOprecPerFrag; - Uint16 first_batch_size; + union { + Uint16 first_batch_size_rows; + Uint16 batch_size_rows; + }; Uint32 batch_byte_size; Uint32 scanRequestInfo; // ScanFrag format diff --git a/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp b/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp index d8b3ee10532..c7f467484bd 100644 --- a/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp +++ b/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp @@ -8646,9 +8646,9 @@ void Dbtc::initScanrec(ScanRecordPtr scanptr, scanptr.p->scanTableref = tabptr.i; scanptr.p->scanSchemaVersion = scanTabReq->tableSchemaVersion; scanptr.p->scanParallel = scanParallel; - scanptr.p->noOprecPerFrag = noOprecPerFrag; - scanptr.p->first_batch_size= scanTabReq->first_batch_size; - scanptr.p->batch_byte_size= scanTabReq->batch_byte_size; + scanptr.p->first_batch_size_rows = scanTabReq->first_batch_size; + scanptr.p->batch_byte_size = scanTabReq->batch_byte_size; + scanptr.p->batch_size_rows = noOprecPerFrag; Uint32 tmp = 0; const UintR ri = scanTabReq->requestInfo; @@ -8672,7 +8672,6 @@ void Dbtc::initScanrec(ScanRecordPtr scanptr, ndbrequire(list.seize(ptr)); ptr.p->scanRec = scanptr.i; ptr.p->scanFragId = 0; - ptr.p->scanFragConcurrency = noOprecPerFrag; ptr.p->m_apiPtr = cdata[i]; }//for @@ -9141,6 +9140,7 @@ void Dbtc::execSCAN_FRAGCONF(Signal* signal) const ScanFragConf * const conf = (ScanFragConf*)&signal->theData[0]; const Uint32 noCompletedOps = conf->completedOps; + const Uint32 status = conf->fragmentCompleted; scanFragptr.i = conf->senderData; c_scan_frag_pool.getPtr(scanFragptr); @@ -9163,11 +9163,9 @@ void Dbtc::execSCAN_FRAGCONF(Signal* signal) ndbrequire(scanFragptr.p->scanFragState == ScanFragRec::LQH_ACTIVE); - const Uint32 status = conf->fragmentCompleted; - if(scanptr.p->scanState == ScanRecord::CLOSING_SCAN){ jam(); - if(status == ZFALSE){ + if(status == 0){ /** * We have started closing = we sent a close -> ignore this */ @@ -9184,11 +9182,11 @@ void Dbtc::execSCAN_FRAGCONF(Signal* signal) return; } - if(status == ZCLOSED && scanptr.p->scanNextFragId < scanptr.p->scanNoFrag){ + if(noCompletedOps == 0 && status != 0 && + scanptr.p->scanNextFragId < scanptr.p->scanNoFrag){ /** * Start on next fragment */ - ndbrequire(noCompletedOps == 0); scanFragptr.p->scanFragState = ScanFragRec::WAIT_GET_PRIMCONF; scanFragptr.p->startFragTimer(ctcTimer); @@ -9218,6 +9216,7 @@ void Dbtc::execSCAN_FRAGCONF(Signal* signal) scanptr.p->m_queued_count++; } + scanFragptr.p->m_scan_frag_conf_status = status; scanFragptr.p->m_ops = noCompletedOps; scanFragptr.p->m_totalLen = total_len; scanFragptr.p->scanFragState = ScanFragRec::QUEUED_FOR_DELIVERY; @@ -9330,11 +9329,12 @@ void Dbtc::execSCAN_NEXTREQ(Signal* signal) // Copy op ptrs so I dont overwrite them when sending... memcpy(signal->getDataPtrSend()+25, signal->getDataPtr()+4, 4 * len); - ScanFragNextReq * nextReq = (ScanFragNextReq*)&signal->theData[0]; - nextReq->closeFlag = ZFALSE; - nextReq->transId1 = apiConnectptr.p->transid[0]; - nextReq->transId2 = apiConnectptr.p->transid[1]; - nextReq->batch_size_bytes= scanP->batch_byte_size; + ScanFragNextReq tmp; + tmp.closeFlag = ZFALSE; + tmp.transId1 = apiConnectptr.p->transid[0]; + tmp.transId2 = apiConnectptr.p->transid[1]; + tmp.batch_size_rows = scanP->batch_size_rows; + tmp.batch_size_bytes = scanP->batch_byte_size; ScanFragList running(c_scan_frag_pool, scanP->m_running_scan_frags); ScanFragList delivered(c_scan_frag_pool, scanP->m_delivered_scan_frags); @@ -9344,15 +9344,37 @@ void Dbtc::execSCAN_NEXTREQ(Signal* signal) c_scan_frag_pool.getPtr(scanFragptr); ndbrequire(scanFragptr.p->scanFragState == ScanFragRec::DELIVERED); - scanFragptr.p->scanFragState = ScanFragRec::LQH_ACTIVE; scanFragptr.p->startFragTimer(ctcTimer); - scanFragptr.p->m_ops = 0; - nextReq->senderData = scanFragptr.i; - nextReq->batch_size_rows= scanFragptr.p->scanFragConcurrency; - sendSignal(scanFragptr.p->lqhBlockref, GSN_SCAN_NEXTREQ, signal, - ScanFragNextReq::SignalLength, JBB); + if(scanFragptr.p->m_scan_frag_conf_status) + { + /** + * last scan was complete + */ + jam(); + ndbrequire(scanptr.p->scanNextFragId < scanptr.p->scanNoFrag); + scanFragptr.p->scanFragState = ScanFragRec::WAIT_GET_PRIMCONF; + + tcConnectptr.i = scanptr.p->scanTcrec; + ptrCheckGuard(tcConnectptr, ctcConnectFilesize, tcConnectRecord); + scanFragptr.p->scanFragId = scanptr.p->scanNextFragId++; + signal->theData[0] = tcConnectptr.p->dihConnectptr; + signal->theData[1] = scanFragptr.i; + signal->theData[2] = scanptr.p->scanTableref; + signal->theData[3] = scanFragptr.p->scanFragId; + sendSignal(cdihblockref, GSN_DIGETPRIMREQ, signal, 4, JBB); + } + else + { + jam(); + scanFragptr.p->scanFragState = ScanFragRec::LQH_ACTIVE; + ScanFragNextReq * req = (ScanFragNextReq*)signal->getDataPtrSend(); + * req = tmp; + req->senderData = scanFragptr.i; + sendSignal(scanFragptr.p->lqhBlockref, GSN_SCAN_NEXTREQ, signal, + ScanFragNextReq::SignalLength, JBB); + } delivered.remove(scanFragptr); running.add(scanFragptr); }//for @@ -9551,7 +9573,7 @@ void Dbtc::sendScanFragReq(Signal* signal, req->transId1 = apiConnectptr.p->transid[0]; req->transId2 = apiConnectptr.p->transid[1]; req->clientOpPtr = scanFragP->m_apiPtr; - req->batch_size_rows= scanFragP->scanFragConcurrency; + req->batch_size_rows= scanP->batch_size_rows; req->batch_size_bytes= scanP->batch_byte_size; sendSignal(scanFragP->lqhBlockref, GSN_SCAN_FRAGREQ, signal, ScanFragReq::SignalLength, JBB); @@ -9573,6 +9595,8 @@ void Dbtc::sendScanTabConf(Signal* signal, ScanRecordPtr scanPtr) { jam(); ops += 21; } + + Uint32 left = scanPtr.p->scanNoFrag - scanPtr.p->scanNextFragId; ScanTabConf * conf = (ScanTabConf*)&signal->theData[0]; conf->apiConnectPtr = apiConnectptr.p->ndbapiConnect; @@ -9588,24 +9612,25 @@ void Dbtc::sendScanTabConf(Signal* signal, ScanRecordPtr scanPtr) { ScanFragRecPtr curr = ptr; // Remove while iterating... queued.next(ptr); + bool done = curr.p->m_scan_frag_conf_status && --left; + * ops++ = curr.p->m_apiPtr; - * ops++ = curr.i; + * ops++ = done ? RNIL : curr.i; * ops++ = (curr.p->m_totalLen << 10) + curr.p->m_ops; queued.remove(curr); - if(curr.p->m_ops > 0){ + if(!done){ delivered.add(curr); curr.p->scanFragState = ScanFragRec::DELIVERED; curr.p->stopFragTimer(); } else { - (* --ops) = ScanTabConf::EndOfData; ops++; c_scan_frag_pool.release(curr); curr.p->scanFragState = ScanFragRec::COMPLETED; curr.p->stopFragTimer(); } } } - + if(scanPtr.p->m_delivered_scan_frags.isEmpty() && scanPtr.p->m_running_scan_frags.isEmpty()){ conf->requestInfo = op_count | ScanTabConf::EndOfData; @@ -10424,9 +10449,8 @@ Dbtc::execDUMP_STATE_ORD(Signal* signal) sfp.i, sfp.p->scanFragState, sfp.p->scanFragId); - infoEvent(" nodeid=%d, concurr=%d, timer=%d", + infoEvent(" nodeid=%d, timer=%d", refToNode(sfp.p->lqhBlockref), - sfp.p->scanFragConcurrency, sfp.p->scanFragTimer); } @@ -10504,7 +10528,7 @@ Dbtc::execDUMP_STATE_ORD(Signal* signal) sp.p->scanAiLength, sp.p->scanParallel, sp.p->scanReceivedOperations, - sp.p->noOprecPerFrag); + sp.p->batch_size_rows); infoEvent(" schv=%d, tab=%d, sproc=%d", sp.p->scanSchemaVersion, sp.p->scanTableref, diff --git a/ndb/src/kernel/blocks/suma/Suma.cpp b/ndb/src/kernel/blocks/suma/Suma.cpp index d11d5f7176a..f6d9a0ac35a 100644 --- a/ndb/src/kernel/blocks/suma/Suma.cpp +++ b/ndb/src/kernel/blocks/suma/Suma.cpp @@ -1888,7 +1888,7 @@ SumaParticipant::SyncRecord::nextScan(Signal* signal){ req->requestInfo = 0; req->savePointId = 0; ScanFragReq::setLockMode(req->requestInfo, 0); - ScanFragReq::setHoldLockFlag(req->requestInfo, 0); + ScanFragReq::setHoldLockFlag(req->requestInfo, 1); ScanFragReq::setKeyinfoFlag(req->requestInfo, 0); ScanFragReq::setAttrLen(req->requestInfo, attrLen); req->fragmentNoKeyLen = fd.m_fragDesc.m_fragmentNo; diff --git a/ndb/src/ndbapi/NdbConnection.cpp b/ndb/src/ndbapi/NdbConnection.cpp index c21a85fd24d..aecc7124d15 100644 --- a/ndb/src/ndbapi/NdbConnection.cpp +++ b/ndb/src/ndbapi/NdbConnection.cpp @@ -1577,9 +1577,6 @@ from other transactions. /** * There's always a TCKEYCONF when using IgnoreError */ -#ifdef VM_TRACE - ndbout_c("Not completing transaction 2"); -#endif return -1; } /**********************************************************************/ @@ -1831,9 +1828,6 @@ NdbConnection::OpCompleteFailure(Uint8 abortOption, bool setFailure) /** * There's always a TCKEYCONF when using IgnoreError */ -#ifdef VM_TRACE - ndbout_c("Not completing transaction"); -#endif return -1; } diff --git a/ndb/src/ndbapi/NdbConnectionScan.cpp b/ndb/src/ndbapi/NdbConnectionScan.cpp index 3fe8993a42b..a7a8f1350b1 100644 --- a/ndb/src/ndbapi/NdbConnectionScan.cpp +++ b/ndb/src/ndbapi/NdbConnectionScan.cpp @@ -97,7 +97,7 @@ NdbConnection::receiveSCAN_TABCONF(NdbApiSignal* aSignal, theScanningOp->execCLOSE_SCAN_REP(); return 0; } - + for(Uint32 i = 0; iint2void(ptrI); assert(tPtr); // For now NdbReceiver* tOp = theNdb->void2rec(tPtr); - if (tOp && tOp->checkMagicNumber()){ - if(tOp->execSCANOPCONF(tcPtrI, totalLen, opCount)){ - /** - * - */ - theScanningOp->receiver_delivered(tOp); - } else if(info == ScanTabConf::EndOfData){ + if (tOp && tOp->checkMagicNumber()) + { + if (tcPtrI == RNIL && opCount == 0) theScanningOp->receiver_completed(tOp); - } - } - } - if (conf->requestInfo & ScanTabConf::EndOfData) { - if(theScanningOp->m_ordered) - theScanningOp->m_api_receivers_count = 0; - if(theScanningOp->m_api_receivers_count + - theScanningOp->m_conf_receivers_count + - theScanningOp->m_sent_receivers_count){ - abort(); + else if (tOp->execSCANOPCONF(tcPtrI, totalLen, opCount)) + theScanningOp->receiver_delivered(tOp); } } return 0; diff --git a/ndb/src/ndbapi/NdbScanOperation.cpp b/ndb/src/ndbapi/NdbScanOperation.cpp index 373fec1a2b0..30b596d7098 100644 --- a/ndb/src/ndbapi/NdbScanOperation.cpp +++ b/ndb/src/ndbapi/NdbScanOperation.cpp @@ -35,6 +35,8 @@ #include #include +#define DEBUG_NEXT_RESULT 0 + NdbScanOperation::NdbScanOperation(Ndb* aNdb) : NdbOperation(aNdb), m_resultSet(0), @@ -275,6 +277,9 @@ NdbScanOperation::fix_receivers(Uint32 parallel){ void NdbScanOperation::receiver_delivered(NdbReceiver* tRec){ if(theError.code == 0){ + if(DEBUG_NEXT_RESULT) + ndbout_c("receiver_delivered"); + Uint32 idx = tRec->m_list_index; Uint32 last = m_sent_receivers_count - 1; if(idx != last){ @@ -298,6 +303,9 @@ NdbScanOperation::receiver_delivered(NdbReceiver* tRec){ void NdbScanOperation::receiver_completed(NdbReceiver* tRec){ if(theError.code == 0){ + if(DEBUG_NEXT_RESULT) + ndbout_c("receiver_completed"); + Uint32 idx = tRec->m_list_index; Uint32 last = m_sent_receivers_count - 1; if(idx != last){ @@ -445,8 +453,6 @@ NdbScanOperation::executeCursor(int nodeId){ return -1; } -#define DEBUG_NEXT_RESULT 0 - int NdbScanOperation::nextResult(bool fetchAllowed) { if(m_ordered) @@ -579,7 +585,8 @@ int NdbScanOperation::nextResult(bool fetchAllowed) int NdbScanOperation::send_next_scan(Uint32 cnt, bool stopScanFlag){ - if(cnt > 0 || stopScanFlag){ + if(cnt > 0) + { NdbApiSignal tSignal(theNdb->theMyRef); tSignal.setSignal(GSN_SCAN_NEXTREQ); @@ -595,33 +602,40 @@ NdbScanOperation::send_next_scan(Uint32 cnt, bool stopScanFlag){ */ Uint32 last = m_sent_receivers_count; Uint32 * prep_array = (cnt > 21 ? m_prepared_receivers : theData + 4); + Uint32 sent = 0; for(Uint32 i = 0; im_list_index = last+i; - prep_array[i] = tRec->m_tcPtrI; - tRec->prepareSend(); + if((prep_array[sent] = tRec->m_tcPtrI) != RNIL) + { + m_sent_receivers[last+sent] = tRec; + tRec->m_list_index = last+sent; + tRec->prepareSend(); + sent++; + } } memcpy(&m_api_receivers[0], &m_api_receivers[cnt], cnt * sizeof(char*)); - Uint32 nodeId = theNdbCon->theDBnode; - TransporterFacade * tp = TransporterFacade::instance(); - int ret; - if(cnt > 21){ - tSignal.setLength(4); - LinearSectionPtr ptr[3]; - ptr[0].p = prep_array; - ptr[0].sz = cnt; - ret = tp->sendSignal(&tSignal, nodeId, ptr, 1); - } else { - tSignal.setLength(4+cnt); - ret = tp->sendSignal(&tSignal, nodeId); + int ret = 0; + if(sent) + { + Uint32 nodeId = theNdbCon->theDBnode; + TransporterFacade * tp = TransporterFacade::instance(); + if(cnt > 21 && !stopScanFlag){ + tSignal.setLength(4); + LinearSectionPtr ptr[3]; + ptr[0].p = prep_array; + ptr[0].sz = sent; + ret = tp->sendSignal(&tSignal, nodeId, ptr, 1); + } else { + tSignal.setLength(4+(stopScanFlag ? 0 : sent)); + ret = tp->sendSignal(&tSignal, nodeId); + } } - - m_sent_receivers_count = last + cnt + stopScanFlag; + + m_sent_receivers_count = last + sent; m_api_receivers_count -= cnt; m_current_api_receiver = 0; - + return ret; } return 0; @@ -1412,10 +1426,22 @@ NdbIndexScanOperation::send_next_scan_ordered(Uint32 idx){ if(idx == theParallelism) return 0; + NdbReceiver* tRec = m_api_receivers[idx]; NdbApiSignal tSignal(theNdb->theMyRef); tSignal.setSignal(GSN_SCAN_NEXTREQ); + Uint32 last = m_sent_receivers_count; Uint32* theData = tSignal.getDataPtrSend(); + Uint32* prep_array = theData + 4; + + m_current_api_receiver = idx + 1; + if((prep_array[0] = tRec->m_tcPtrI) == RNIL) + { + if(DEBUG_NEXT_RESULT) + ndbout_c("receiver completed, don't send"); + return 0; + } + theData[0] = theNdbCon->theTCConPtr; theData[1] = 0; Uint64 transId = theNdbCon->theTransactionId; @@ -1425,17 +1451,10 @@ NdbIndexScanOperation::send_next_scan_ordered(Uint32 idx){ /** * Prepare ops */ - Uint32 last = m_sent_receivers_count; - Uint32 * prep_array = theData + 4; - - NdbReceiver * tRec = m_api_receivers[idx]; m_sent_receivers[last] = tRec; tRec->m_list_index = last; - prep_array[0] = tRec->m_tcPtrI; tRec->prepareSend(); - m_sent_receivers_count = last + 1; - m_current_api_receiver = idx + 1; Uint32 nodeId = theNdbCon->theDBnode; TransporterFacade * tp = TransporterFacade::instance(); @@ -1448,12 +1467,17 @@ NdbScanOperation::close_impl(TransporterFacade* tp){ Uint32 seq = theNdbCon->theNodeSequence; Uint32 nodeId = theNdbCon->theDBnode; - if(seq != tp->getNodeSequence(nodeId)){ + if(seq != tp->getNodeSequence(nodeId)) + { theNdbCon->theReleaseOnClose = true; return -1; } - while(theError.code == 0 && m_sent_receivers_count){ + /** + * Wait for outstanding + */ + while(theError.code == 0 && m_sent_receivers_count) + { theNdb->theWaiter.m_node = nodeId; theNdb->theWaiter.m_state = WAIT_SCAN; int return_code = theNdb->receiveResponse(WAITFOR_SCAN_TIMEOUT); @@ -1471,18 +1495,52 @@ NdbScanOperation::close_impl(TransporterFacade* tp){ } } - if(m_api_receivers_count+m_conf_receivers_count){ - // Send close scan - if(send_next_scan(0, true) == -1){ // Close scan - theNdbCon->theReleaseOnClose = true; - return -1; - } + /** + * move all conf'ed into api + * so that send_next_scan can check if they needs to be closed + */ + Uint32 api = m_api_receivers_count; + Uint32 conf = m_conf_receivers_count; + + if(m_ordered) + { + /** + * Ordered scan, keep the m_api_receivers "to the right" + */ + memmove(m_api_receivers, m_api_receivers+m_current_api_receiver, + (theParallelism - m_current_api_receiver) * sizeof(char*)); + api = (theParallelism - m_current_api_receiver); + m_api_receivers_count = api; + } + + if(DEBUG_NEXT_RESULT) + ndbout_c("close_impl: [order api conf sent curr parr] %d %d %d %d %d %d", + m_ordered, api, conf, + m_sent_receivers_count, m_current_api_receiver, theParallelism); + + if(api+conf) + { + /** + * There's something to close + * setup m_api_receivers (for send_next_scan) + */ + memcpy(m_api_receivers+api, m_conf_receivers, conf * sizeof(char*)); + m_api_receivers_count = api + conf; + m_conf_receivers_count = 0; + } + + // Send close scan + if(send_next_scan(api+conf, true) == -1) + { + theNdbCon->theReleaseOnClose = true; + return -1; } /** * wait for close scan conf */ - while(m_sent_receivers_count+m_api_receivers_count+m_conf_receivers_count){ + while(m_sent_receivers_count+m_api_receivers_count+m_conf_receivers_count) + { theNdb->theWaiter.m_node = nodeId; theNdb->theWaiter.m_state = WAIT_SCAN; int return_code = theNdb->receiveResponse(WAITFOR_SCAN_TIMEOUT); @@ -1499,6 +1557,7 @@ NdbScanOperation::close_impl(TransporterFacade* tp){ return -1; } } + return 0; } diff --git a/ndb/test/include/HugoTransactions.hpp b/ndb/test/include/HugoTransactions.hpp index 19e4cb43336..b833f2ac629 100644 --- a/ndb/test/include/HugoTransactions.hpp +++ b/ndb/test/include/HugoTransactions.hpp @@ -36,15 +36,21 @@ public: bool allowConstraintViolation = true, int doSleep = 0, bool oneTrans = false); + int scanReadRecords(Ndb*, int records, int abort = 0, int parallelism = 0, - bool committed = false); - int scanReadCommittedRecords(Ndb*, - int records, - int abort = 0, - int parallelism = 0); + NdbOperation::LockMode = NdbOperation::LM_Read); + + int scanReadRecords(Ndb*, + const NdbDictionary::Index*, + int records, + int abort = 0, + int parallelism = 0, + NdbOperation::LockMode = NdbOperation::LM_Read, + bool sorted = false); + int pkReadRecords(Ndb*, int records, int batchsize = 1, diff --git a/ndb/test/include/UtilTransactions.hpp b/ndb/test/include/UtilTransactions.hpp index 37cd99550a5..23902f3b317 100644 --- a/ndb/test/include/UtilTransactions.hpp +++ b/ndb/test/include/UtilTransactions.hpp @@ -53,11 +53,11 @@ public: int selectCount(Ndb*, int parallelism = 0, int* count_rows = NULL, - ScanLock lock = SL_Read, + NdbOperation::LockMode lm = NdbOperation::LM_CommittedRead, NdbConnection* pTrans = NULL); int scanReadRecords(Ndb*, int parallelism, - bool exclusive, + NdbOperation::LockMode lm, int records, int noAttribs, int* attrib_list, diff --git a/ndb/test/ndbapi/testScan.cpp b/ndb/test/ndbapi/testScan.cpp index 0cd30dfefde..51913e8fbf9 100644 --- a/ndb/test/ndbapi/testScan.cpp +++ b/ndb/test/ndbapi/testScan.cpp @@ -242,8 +242,9 @@ int runScanReadCommitted(NDBT_Context* ctx, NDBT_Step* step){ HugoTransactions hugoTrans(*ctx->getTab()); while (iisTestStopped()) { g_info << i << ": "; - if (hugoTrans.scanReadCommittedRecords(GETNDB(step), records, - abort, parallelism) != 0){ + if (hugoTrans.scanReadRecords(GETNDB(step), records, + abort, parallelism, + NdbOperation::LM_CommittedRead) != 0){ return NDBT_FAILED; } i++; @@ -639,7 +640,7 @@ int runCheckGetValue(NDBT_Context* ctx, NDBT_Step* step){ g_info << (unsigned)i << endl; if(utilTrans.scanReadRecords(GETNDB(step), parallelism, - false, + NdbOperation::LM_Read, records, alist.attriblist[i]->numAttribs, alist.attriblist[i]->attribs) != 0){ @@ -647,7 +648,7 @@ int runCheckGetValue(NDBT_Context* ctx, NDBT_Step* step){ } if(utilTrans.scanReadRecords(GETNDB(step), parallelism, - true, + NdbOperation::LM_Read, records, alist.attriblist[i]->numAttribs, alist.attriblist[i]->attribs) != 0){ diff --git a/ndb/test/src/HugoTransactions.cpp b/ndb/test/src/HugoTransactions.cpp index 456bfffbb77..096f5406bbf 100644 --- a/ndb/test/src/HugoTransactions.cpp +++ b/ndb/test/src/HugoTransactions.cpp @@ -29,20 +29,13 @@ HugoTransactions::~HugoTransactions(){ deallocRows(); } - -int HugoTransactions::scanReadCommittedRecords(Ndb* pNdb, - int records, - int abortPercent, - int parallelism){ - return scanReadRecords(pNdb, records, abortPercent, parallelism, true); -} - int HugoTransactions::scanReadRecords(Ndb* pNdb, int records, int abortPercent, int parallelism, - bool committed){ + NdbOperation::LockMode lm) +{ int retryAttempt = 0; const int retryMax = 100; @@ -80,8 +73,163 @@ HugoTransactions::scanReadRecords(Ndb* pNdb, } NdbResultSet * rs; - rs = pOp ->readTuples(committed ? NdbScanOperation::LM_CommittedRead : - NdbScanOperation::LM_Read); + rs = pOp ->readTuples(lm); + + if( rs == 0 ) { + ERR(pTrans->getNdbError()); + pNdb->closeTransaction(pTrans); + return NDBT_FAILED; + } + + check = pOp->interpret_exit_ok(); + if( check == -1 ) { + ERR(pTrans->getNdbError()); + pNdb->closeTransaction(pTrans); + return NDBT_FAILED; + } + + for(a = 0; agetValue(tab.getColumn(a)->getName())) == 0) { + ERR(pTrans->getNdbError()); + pNdb->closeTransaction(pTrans); + return NDBT_FAILED; + } + } + + check = pTrans->execute(NoCommit); + if( check == -1 ) { + const NdbError err = pTrans->getNdbError(); + if (err.status == NdbError::TemporaryError){ + ERR(err); + pNdb->closeTransaction(pTrans); + NdbSleep_MilliSleep(50); + retryAttempt++; + continue; + } + ERR(err); + pNdb->closeTransaction(pTrans); + return NDBT_FAILED; + } + + // Abort after 1-100 or 1-records rows + int ranVal = rand(); + int abortCount = ranVal % (records == 0 ? 100 : records); + bool abortTrans = false; + if (abort > 0){ + // Abort if abortCount is less then abortPercent + if (abortCount < abortPercent) + abortTrans = true; + } + + int eof; + int rows = 0; + while((eof = rs->nextResult(true)) == 0){ + rows++; + if (calc.verifyRowValues(&row) != 0){ + pNdb->closeTransaction(pTrans); + return NDBT_FAILED; + } + + if (abortCount == rows && abortTrans == true){ + ndbout << "Scan is aborted" << endl; + g_info << "Scan is aborted" << endl; + rs->close(); + if( check == -1 ) { + ERR(pTrans->getNdbError()); + pNdb->closeTransaction(pTrans); + return NDBT_FAILED; + } + + pNdb->closeTransaction(pTrans); + return NDBT_OK; + } + } + if (eof == -1) { + const NdbError err = pTrans->getNdbError(); + + if (err.status == NdbError::TemporaryError){ + ERR_INFO(err); + pNdb->closeTransaction(pTrans); + NdbSleep_MilliSleep(50); + switch (err.code){ + case 488: + case 245: + case 490: + // Too many active scans, no limit on number of retry attempts + break; + default: + retryAttempt++; + } + continue; + } + ERR(err); + pNdb->closeTransaction(pTrans); + return NDBT_FAILED; + } + + pNdb->closeTransaction(pTrans); + + g_info << rows << " rows have been read" << endl; + if (records != 0 && rows != records){ + g_err << "Check expected number of records failed" << endl + << " expected=" << records <<", " << endl + << " read=" << rows << endl; + return NDBT_FAILED; + } + + return NDBT_OK; + } + return NDBT_FAILED; +} + +int +HugoTransactions::scanReadRecords(Ndb* pNdb, + const NdbDictionary::Index * pIdx, + int records, + int abortPercent, + int parallelism, + NdbOperation::LockMode lm, + bool sorted) +{ + + int retryAttempt = 0; + const int retryMax = 100; + int check, a; + NdbConnection *pTrans; + NdbIndexScanOperation *pOp; + + while (true){ + + if (retryAttempt >= retryMax){ + g_err << "ERROR: has retried this operation " << retryAttempt + << " times, failing!" << endl; + return NDBT_FAILED; + } + + pTrans = pNdb->startTransaction(); + if (pTrans == NULL) { + const NdbError err = pNdb->getNdbError(); + + if (err.status == NdbError::TemporaryError){ + ERR(err); + NdbSleep_MilliSleep(50); + retryAttempt++; + continue; + } + ERR(err); + return NDBT_FAILED; + } + + pOp = pTrans->getNdbIndexScanOperation(pIdx->getName(), tab.getName()); + if (pOp == NULL) { + ERR(pTrans->getNdbError()); + pNdb->closeTransaction(pTrans); + return NDBT_FAILED; + } + + NdbResultSet * rs; + rs = pOp ->readTuples(lm, 0, parallelism, sorted); if( rs == 0 ) { ERR(pTrans->getNdbError()); diff --git a/ndb/test/src/UtilTransactions.cpp b/ndb/test/src/UtilTransactions.cpp index c0e6effd244..869f7fc76cb 100644 --- a/ndb/test/src/UtilTransactions.cpp +++ b/ndb/test/src/UtilTransactions.cpp @@ -619,7 +619,7 @@ UtilTransactions::addRowToInsert(Ndb* pNdb, int UtilTransactions::scanReadRecords(Ndb* pNdb, int parallelism, - bool exclusive, + NdbOperation::LockMode lm, int records, int noAttribs, int *attrib_list, @@ -669,10 +669,7 @@ UtilTransactions::scanReadRecords(Ndb* pNdb, return NDBT_FAILED; } - NdbResultSet * rs = pOp->readTuples(exclusive ? - NdbScanOperation::LM_Exclusive : - NdbScanOperation::LM_Read, - 0, parallelism); + NdbResultSet * rs = pOp->readTuples(lm, 0, parallelism); if( rs == 0 ) { ERR(pTrans->getNdbError()); pNdb->closeTransaction(pTrans); @@ -761,7 +758,7 @@ int UtilTransactions::selectCount(Ndb* pNdb, int parallelism, int* count_rows, - ScanLock lock, + NdbOperation::LockMode lm, NdbConnection* pTrans){ int retryAttempt = 0; @@ -785,19 +782,7 @@ UtilTransactions::selectCount(Ndb* pNdb, return NDBT_FAILED; } - NdbResultSet * rs; - switch(lock){ - case SL_ReadHold: - rs = pOp->readTuples(NdbScanOperation::LM_Read); - break; - case SL_Exclusive: - rs = pOp->readTuples(NdbScanOperation::LM_Exclusive); - break; - case SL_Read: - default: - rs = pOp->readTuples(NdbScanOperation::LM_CommittedRead); - } - + NdbResultSet * rs = pOp->readTuples(lm); if( rs == 0) { ERR(pTrans->getNdbError()); pNdb->closeTransaction(pTrans); diff --git a/ndb/test/tools/create_index.cpp b/ndb/test/tools/create_index.cpp index 75a657522f6..6e4c5377f4a 100644 --- a/ndb/test/tools/create_index.cpp +++ b/ndb/test/tools/create_index.cpp @@ -30,7 +30,7 @@ main(int argc, const char** argv){ const char* _dbname = "TEST_DB"; int _help = 0; - int _ordered, _pk; + int _ordered = 0, _pk = 1; struct getargs args[] = { { "database", 'd', arg_string, &_dbname, "dbname", diff --git a/ndb/test/tools/hugoScanRead.cpp b/ndb/test/tools/hugoScanRead.cpp index cdfdcea4654..42180207a8a 100644 --- a/ndb/test/tools/hugoScanRead.cpp +++ b/ndb/test/tools/hugoScanRead.cpp @@ -35,13 +35,17 @@ int main(int argc, const char** argv){ int _parallelism = 1; const char* _tabname = NULL; int _help = 0; - + int lock = NdbOperation::LM_Read; + int sorted = 0; + struct getargs args[] = { { "aborts", 'a', arg_integer, &_abort, "percent of transactions that are aborted", "abort%" }, { "loops", 'l', arg_integer, &_loops, "number of times to run this program(0=infinite loop)", "loops" }, { "parallelism", 'p', arg_integer, &_parallelism, "parallelism(1-240)", "para" }, { "records", 'r', arg_integer, &_records, "Number of records", "recs" }, - { "usage", '?', arg_flag, &_help, "Print help", "" } + { "usage", '?', arg_flag, &_help, "Print help", "" }, + { "lock", 'm', arg_integer, &lock, "lock mode", "" }, + { "sorted", 's', arg_flag, &sorted, "sorted", "" } }; int num_args = sizeof(args) / sizeof(args[0]); int optind = 0; @@ -73,16 +77,48 @@ int main(int argc, const char** argv){ ndbout << " Table " << _tabname << " does not exist!" << endl; return NDBT_ProgramExit(NDBT_WRONGARGS); } + + const NdbDictionary::Index * pIdx = 0; + if(optind+1 < argc) + { + pIdx = MyNdb.getDictionary()->getIndex(argv[optind+1], _tabname); + if(!pIdx) + ndbout << " Index " << argv[optind+1] << " not found" << endl; + else + if(pIdx->getType() != NdbDictionary::Index::UniqueOrderedIndex && + pIdx->getType() != NdbDictionary::Index::OrderedIndex) + { + ndbout << " Index " << argv[optind+1] << " is not scannable" << endl; + pIdx = 0; + } + } HugoTransactions hugoTrans(*pTab); int i = 0; while (i<_loops || _loops==0) { ndbout << i << ": "; - if(hugoTrans.scanReadRecords(&MyNdb, - 0, - _abort, - _parallelism) != 0){ - return NDBT_ProgramExit(NDBT_FAILED); + if(!pIdx) + { + if(hugoTrans.scanReadRecords(&MyNdb, + 0, + _abort, + _parallelism, + (NdbOperation::LockMode)lock) != 0) + { + return NDBT_ProgramExit(NDBT_FAILED); + } + } + else + { + if(hugoTrans.scanReadRecords(&MyNdb, pIdx, + 0, + _abort, + _parallelism, + (NdbOperation::LockMode)lock, + sorted) != 0) + { + return NDBT_ProgramExit(NDBT_FAILED); + } } i++; } diff --git a/ndb/tools/select_all.cpp b/ndb/tools/select_all.cpp index 758c1e48c88..9c944c8c93e 100644 --- a/ndb/tools/select_all.cpp +++ b/ndb/tools/select_all.cpp @@ -133,13 +133,18 @@ int main(int argc, char** argv){ const NdbDictionary::Table* pTab = NDBT_Table::discoverTableFromDb(&MyNdb, _tabname); const NdbDictionary::Index * pIdx = 0; if(argc > 1){ - pIdx = MyNdb.getDictionary()->getIndex(argv[0], _tabname); + pIdx = MyNdb.getDictionary()->getIndex(argv[1], _tabname); } if(pTab == NULL){ ndbout << " Table " << _tabname << " does not exist!" << endl; return NDBT_ProgramExit(NDBT_WRONGARGS); } + + if(argc > 1 && pIdx == 0) + { + ndbout << " Index " << argv[1] << " does not exists" << endl; + } if(_order && pIdx == NULL){ ndbout << " Order flag given without an index" << endl; From 75431a2e1678004b63d9119ac88df2dddd59b2e8 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 18 Nov 2004 20:28:36 +0000 Subject: [PATCH 0258/1063] fix for mysqladmin link problem .c -> .cc fix source dist problem for ndb fix type check problem for mysqladmin client/Makefile.am: fix for mysqladmin link problem .c -> .cc client/mysqladmin.cc: fix for mysqladmin link problem .c -> .cc configure.in: fix for mysqladmin link problem .c -> .cc ndb/include/Makefile.am: fix source dist problem for ndb ndb/src/mgmclient/CommandInterpreter.cpp: fix type check problem ndb/src/mgmclient/ndb_mgmclient.hpp: fix type check problem ndb/src/mgmclient/ndb_mgmclient.h: fix type check problem --- client/Makefile.am | 1 + client/{mysqladmin.c => mysqladmin.cc} | 3 --- configure.in | 1 - ndb/include/Makefile.am | 1 + ndb/src/mgmclient/CommandInterpreter.cpp | 4 ++-- ndb/src/mgmclient/ndb_mgmclient.h | 2 +- ndb/src/mgmclient/ndb_mgmclient.hpp | 2 +- 7 files changed, 6 insertions(+), 8 deletions(-) rename client/{mysqladmin.c => mysqladmin.cc} (99%) diff --git a/client/Makefile.am b/client/Makefile.am index 1c552036f9b..5034dd5bf51 100644 --- a/client/Makefile.am +++ b/client/Makefile.am @@ -27,6 +27,7 @@ bin_PROGRAMS = mysql mysqladmin mysqlcheck mysqlshow \ mysqldump mysqlimport mysqltest mysqlbinlog mysqlmanagerc mysqlmanager-pwgen noinst_HEADERS = sql_string.h completion_hash.h my_readline.h \ client_priv.h +mysqladmin_SOURCES = mysqladmin.cc mysql_SOURCES = mysql.cc readline.cc sql_string.cc completion_hash.cc mysql_LDADD = @readline_link@ @TERMCAP_LIB@ $(LDADD) $(CXXLDFLAGS) mysqlbinlog_LDADD = $(LDADD) $(CXXLDFLAGS) diff --git a/client/mysqladmin.c b/client/mysqladmin.cc similarity index 99% rename from client/mysqladmin.c rename to client/mysqladmin.cc index a32dfa14d28..a9fc3f31d03 100644 --- a/client/mysqladmin.c +++ b/client/mysqladmin.cc @@ -1287,9 +1287,6 @@ static my_bool wait_pidfile(char *pidfile, time_t last_modified, } DBUG_RETURN(error); } -#ifdef HAVE_NDBCLUSTER_DB -/* lib linked in contains c++ code */ #ifdef __GNUC__ FIX_GCC_LINKING_PROBLEM #endif -#endif diff --git a/configure.in b/configure.in index f360ee46453..1fcba6b8f5f 100644 --- a/configure.in +++ b/configure.in @@ -399,7 +399,6 @@ then then if $CXX -v 2>&1 | grep 'version 3' > /dev/null 2>&1 then - CFLAGS="$CFLAGS -DDEFINE_CXA_PURE_VIRTUAL" CXXFLAGS="$CXXFLAGS -DUSE_MYSYS_NEW -DDEFINE_CXA_PURE_VIRTUAL" fi fi diff --git a/ndb/include/Makefile.am b/ndb/include/Makefile.am index 7b3f80b5560..ca2e8152352 100644 --- a/ndb/include/Makefile.am +++ b/ndb/include/Makefile.am @@ -28,6 +28,7 @@ ndbapi/NdbIndexScanOperation.hpp \ ndbapi/ndberror.h mgmapiinclude_HEADERS = \ +mgmapi/LocalConfig.hpp \ mgmapi/mgmapi.h \ mgmapi/mgmapi_debug.h diff --git a/ndb/src/mgmclient/CommandInterpreter.cpp b/ndb/src/mgmclient/CommandInterpreter.cpp index d940f6e165a..a36263395ec 100644 --- a/ndb/src/mgmclient/CommandInterpreter.cpp +++ b/ndb/src/mgmclient/CommandInterpreter.cpp @@ -193,7 +193,7 @@ extern "C" { { return (Ndb_mgmclient_handle) new Ndb_mgmclient(connect_string); } - int ndb_mgmclient_execute(Ndb_mgmclient_handle h, int argc, const char** argv) + int ndb_mgmclient_execute(Ndb_mgmclient_handle h, int argc, char** argv) { return ((Ndb_mgmclient*)h)->execute(argc, argv, 1); } @@ -226,7 +226,7 @@ extern "C" { #include #include -int Ndb_mgmclient::execute(int argc, const char** argv, int _try_reconnect) +int Ndb_mgmclient::execute(int argc, char** argv, int _try_reconnect) { if (argc <= 0) return 0; diff --git a/ndb/src/mgmclient/ndb_mgmclient.h b/ndb/src/mgmclient/ndb_mgmclient.h index 265e6bc67ec..b62a33999a3 100644 --- a/ndb/src/mgmclient/ndb_mgmclient.h +++ b/ndb/src/mgmclient/ndb_mgmclient.h @@ -23,7 +23,7 @@ extern "C" { typedef void* Ndb_mgmclient_handle; Ndb_mgmclient_handle ndb_mgmclient_handle_create(const char *connect_string); -int ndb_mgmclient_execute(Ndb_mgmclient_handle, int argc, const char** argv); +int ndb_mgmclient_execute(Ndb_mgmclient_handle, int argc, char** argv); int ndb_mgmclient_handle_destroy(Ndb_mgmclient_handle); #ifdef __cplusplus diff --git a/ndb/src/mgmclient/ndb_mgmclient.hpp b/ndb/src/mgmclient/ndb_mgmclient.hpp index 933d1bab5ce..f6bcebc3896 100644 --- a/ndb/src/mgmclient/ndb_mgmclient.hpp +++ b/ndb/src/mgmclient/ndb_mgmclient.hpp @@ -24,7 +24,7 @@ public: Ndb_mgmclient(const char*); ~Ndb_mgmclient(); int execute(const char *_line, int _try_reconnect=-1); - int execute(int argc, const char** argv, int _try_reconnect=-1); + int execute(int argc, char** argv, int _try_reconnect=-1); int disconnect(); private: CommandInterpreter *m_cmd; From 6aab88c9169960da307d39eb7b9977f215c63508 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 18 Nov 2004 22:28:37 +0200 Subject: [PATCH 0259/1063] fil0fil.h, fil0fil.c: Fix bug introduced in 4.1.1: InnoDB no longer respected the data file max size given in :autoextend:max: innobase/fil/fil0fil.c: Fix bug introduced in 4.1.1: InnoDB no longer respected the data file max size given in :autoextend:max: innobase/include/fil0fil.h: Fix bug introduced in 4.1.1: InnoDB no longer respected the data file max size given in :autoextend:max: --- innobase/fil/fil0fil.c | 19 ++++++++++++++++--- innobase/include/fil0fil.h | 2 +- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/innobase/fil/fil0fil.c b/innobase/fil/fil0fil.c index 7d57468f632..de528355182 100644 --- a/innobase/fil/fil0fil.c +++ b/innobase/fil/fil0fil.c @@ -106,7 +106,7 @@ struct fil_node_struct { device or a raw disk partition */ ulint size; /* size of the file in database pages, 0 if not known yet; the possible last incomplete - megabyte is ignored if space == 0 */ + megabyte may be ignored if space == 0 */ ulint n_pending; /* count of pending i/o's on this file; closing of the file is not allowed if @@ -160,7 +160,9 @@ struct fil_space_struct { UT_LIST_BASE_NODE_T(fil_node_t) chain; /* base node for the file chain */ ulint size; /* space size in pages; 0 if a single-table - tablespace whose size we do not know yet */ + tablespace whose size we do not know yet; + last incomplete megabytes in data files may be + ignored if space == 0 */ ulint n_reserved_extents; /* number of reserved free extents for ongoing operations like B-tree page split */ @@ -3255,7 +3257,7 @@ fil_extend_space_to_desired_size( ulint* actual_size, /* out: size of the space after extension; if we ran out of disk space this may be lower than the desired size */ - ulint space_id, /* in: space id, must be != 0 */ + ulint space_id, /* in: space id */ ulint size_after_extend)/* in: desired size in pages after the extension; if the current space size is bigger than this already, the function does nothing */ @@ -3352,6 +3354,17 @@ fil_extend_space_to_desired_size( fil_node_complete_io(node, system, OS_FILE_WRITE); *actual_size = space->size; + + if (space_id == 0) { + ulint pages_per_mb = (1024 * 1024) / UNIV_PAGE_SIZE; + + /* Keep the last data file size info up to date, rounded to + full megabytes */ + + srv_data_file_sizes[srv_n_data_files - 1] = + (node->size / pages_per_mb) * pages_per_mb; + } + /* printf("Extended %s to %lu, actual size %lu pages\n", space->name, size_after_extend, *actual_size); */ diff --git a/innobase/include/fil0fil.h b/innobase/include/fil0fil.h index 5a5db77073a..43327aab9d2 100644 --- a/innobase/include/fil0fil.h +++ b/innobase/include/fil0fil.h @@ -478,7 +478,7 @@ fil_extend_space_to_desired_size( ulint* actual_size, /* out: size of the space after extension; if we ran out of disk space this may be lower than the desired size */ - ulint space_id, /* in: space id, must be != 0 */ + ulint space_id, /* in: space id */ ulint size_after_extend);/* in: desired size in pages after the extension; if the current space size is bigger than this already, the function does nothing */ From 18f12ee494d96a7e2caf6ab5d725fe6d371f9cba Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 18 Nov 2004 20:35:19 +0000 Subject: [PATCH 0260/1063] adopted testprograms to changes in mgmapi --- ndb/test/run-test/main.cpp | 22 ++++++++++-------- ndb/test/src/NdbBackup.cpp | 10 ++++---- ndb/test/src/NdbRestarter.cpp | 43 ++++++++--------------------------- 3 files changed, 27 insertions(+), 48 deletions(-) diff --git a/ndb/test/run-test/main.cpp b/ndb/test/run-test/main.cpp index e5f73bc6a5c..ac7710d9546 100644 --- a/ndb/test/run-test/main.cpp +++ b/ndb/test/run-test/main.cpp @@ -538,15 +538,19 @@ connect_ndb_mgm(atrt_process & proc){ } BaseString tmp = proc.m_hostname; tmp.appfmt(":%d", proc.m_ndb_mgm_port); - time_t start = time(0); - const time_t max_connect_time = 30; - do { - if(ndb_mgm_connect(handle, tmp.c_str()) != -1){ - proc.m_ndb_mgm_handle = handle; - return true; - } - sleep(1); - } while(time(0) < (start + max_connect_time)); + + if (ndb_mgm_set_connectstring(handle,tmp.c_str())) + { + g_logger.critical("Unable to create parse connectstring"); + return false; + } + + if(ndb_mgm_connect(handle, 30, 1, 0) != -1) + { + proc.m_ndb_mgm_handle = handle; + return true; + } + g_logger.critical("Unable to connect to ndb mgm %s", tmp.c_str()); return false; } diff --git a/ndb/test/src/NdbBackup.cpp b/ndb/test/src/NdbBackup.cpp index 1ce48d495a5..398a7c32fc4 100644 --- a/ndb/test/src/NdbBackup.cpp +++ b/ndb/test/src/NdbBackup.cpp @@ -69,16 +69,14 @@ NdbBackup::getBackupDataDirForNode(int _node_id){ /** * Fetch configuration from management server */ - LocalConfig lc; - if (!lc.init(0,0)) { - abort(); - } - ConfigRetriever cr(lc, 0, NODE_TYPE_API); + ConfigRetriever cr(0, 0, NODE_TYPE_API); ndb_mgm_configuration * p = 0; BaseString tmp; tmp.assfmt("%s:%d", host.c_str(), port); NdbMgmHandle handle = ndb_mgm_create_handle(); - if(handle == 0 || ndb_mgm_connect(handle, tmp.c_str()) != 0 || + if(handle == 0 || + ndb_mgm_set_connectstring(handle,tmp.c_str()) != 0 || + ndb_mgm_connect(handle,0,0,0) != 0 || (p = ndb_mgm_get_configuration(handle, 0)) == 0){ const char * s = 0; diff --git a/ndb/test/src/NdbRestarter.cpp b/ndb/test/src/NdbRestarter.cpp index 4d6d3ddc001..e1802f36e82 100644 --- a/ndb/test/src/NdbRestarter.cpp +++ b/ndb/test/src/NdbRestarter.cpp @@ -18,7 +18,6 @@ #include #include #include -#include #include #include #include @@ -38,37 +37,7 @@ NdbRestarter::NdbRestarter(const char* _addr): m_config(0) { if (_addr == NULL){ - LocalConfig lcfg; - if(!lcfg.init()){ - lcfg.printError(); - lcfg.printUsage(); - g_err << "NdbRestarter - Error parsing local config file" << endl; - return; - } - - if (lcfg.ids.size() == 0){ - g_err << "NdbRestarter - No management servers configured in local config file" << endl; - return; - } - - for (int i = 0; itype){ - case MgmId_TCP: - char buf[255]; - snprintf(buf, 255, "%s:%d", m->name.c_str(), m->port); - addr.assign(buf); - host.assign(m->name.c_str()); - port = m->port; - return; - break; - case MgmId_File: - break; - default: - break; - } - } + addr.assign(""); } else { addr.assign(_addr); } @@ -397,7 +366,15 @@ NdbRestarter::connect(){ return -1; } g_info << "Connecting to mgmsrv at " << addr.c_str() << endl; - if (ndb_mgm_connect(handle, addr.c_str()) == -1) { + if (ndb_mgm_set_connectstring(handle,addr.c_str())) + { + MGMERR(handle); + g_err << "Connection to " << addr.c_str() << " failed" << endl; + return -1; + } + + if (ndb_mgm_connect(handle, 0, 0, 0) == -1) + { MGMERR(handle); g_err << "Connection to " << addr.c_str() << " failed" << endl; return -1; From a8ba534cee918abd55df54be7136385b57155044 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 18 Nov 2004 23:35:45 +0300 Subject: [PATCH 0261/1063] Some comments regarding Bug#6275 ""client_test" fail in 4.1.7 make test" --- tests/client_test.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/tests/client_test.c b/tests/client_test.c index 2f28da6d00d..0ada98d44b0 100644 --- a/tests/client_test.c +++ b/tests/client_test.c @@ -635,12 +635,15 @@ static void verify_prepare_field(MYSQL_RES *result, unsigned long length, const char *def) { MYSQL_FIELD *field; + CHARSET_INFO *cs; if (!(field= mysql_fetch_field_direct(result, no))) { fprintf(stdout, "\n *** ERROR: FAILED TO GET THE RESULT ***"); exit(1); } + cs= get_charset(field->charsetnr, 0); + DIE_UNLESS(cs); if (!opt_silent) { fprintf(stdout, "\n field[%d]:", no); @@ -654,7 +657,7 @@ static void verify_prepare_field(MYSQL_RES *result, field->org_table, org_table); fprintf(stdout, "\n database :`%s`\t(expected: `%s`)", field->db, db); fprintf(stdout, "\n length :`%ld`\t(expected: `%ld`)", - field->length, length); + field->length, length * cs->mbmaxlen); fprintf(stdout, "\n maxlength:`%ld`", field->max_length); fprintf(stdout, "\n charsetnr:`%d`", field->charsetnr); fprintf(stdout, "\n default :`%s`\t(expected: `%s`)", @@ -663,11 +666,24 @@ static void verify_prepare_field(MYSQL_RES *result, } DIE_UNLESS(strcmp(field->name, name) == 0); DIE_UNLESS(strcmp(field->org_name, org_name) == 0); - DIE_UNLESS(field->type == type); + /* + XXX: silent column specification change works based on number of + bytes a column occupies. So CHAR -> VARCHAR upgrade is possible even + for CHAR(2) column if its character set is multibyte. + VARCHAR -> CHAR downgrade won't work for VARCHAR(3) as one would + expect. + */ + if (cs->mbmaxlen == 1) + DIE_UNLESS(field->type == type); DIE_UNLESS(strcmp(field->table, table) == 0); DIE_UNLESS(strcmp(field->org_table, org_table) == 0); DIE_UNLESS(strcmp(field->db, db) == 0); - DIE_UNLESS(field->length == length); + /* + Character set should be taken into account for multibyte encodings, such + as utf8. Field length is calculated as number of characters * maximum + number of bytes a character can occupy. + */ + DIE_UNLESS(field->length == length * cs->mbmaxlen); if (def) DIE_UNLESS(strcmp(field->def, def) == 0); } From ebe7fe1481da8429d6f273a63c9297cdf2969df4 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 18 Nov 2004 21:15:18 +0000 Subject: [PATCH 0262/1063] bug#6677 bug#6684 --- ndb/src/mgmclient/CommandInterpreter.cpp | 7 +++++- ndb/tools/restore/main.cpp | 27 +++++++++++++++++------- 2 files changed, 25 insertions(+), 9 deletions(-) diff --git a/ndb/src/mgmclient/CommandInterpreter.cpp b/ndb/src/mgmclient/CommandInterpreter.cpp index a36263395ec..bdeb885ed8b 100644 --- a/ndb/src/mgmclient/CommandInterpreter.cpp +++ b/ndb/src/mgmclient/CommandInterpreter.cpp @@ -1386,7 +1386,7 @@ void CommandInterpreter::executeDumpState(int processId, const char* parameters, bool all) { - if(parameters == 0 || strlen(parameters) == 0){ + if(emptyString(parameters)){ ndbout << "Expected argument" << endl; return; } @@ -1806,6 +1806,10 @@ CommandInterpreter::executeEventReporting(int processId, const char* parameters, bool all) { + if (emptyString(parameters)) { + ndbout << "Expected argument" << endl; + return; + } connect(); BaseString tmp(parameters); @@ -1906,6 +1910,7 @@ void CommandInterpreter::executeAbortBackup(char* parameters) { connect(); + strtok(parameters, " "); struct ndb_mgm_reply reply; char* id = strtok(NULL, "\0"); diff --git a/ndb/tools/restore/main.cpp b/ndb/tools/restore/main.cpp index 482212911cb..064fbad43a3 100644 --- a/ndb/tools/restore/main.cpp +++ b/ndb/tools/restore/main.cpp @@ -74,7 +74,7 @@ static struct my_option my_long_options[] = "No of parallel transactions during restore of data." "(parallelism can be 1 to 1024)", (gptr*) &ga_nParallelism, (gptr*) &ga_nParallelism, 0, - GET_INT, REQUIRED_ARG, 128, 0, 0, 0, 0, 0 }, + GET_INT, REQUIRED_ARG, 128, 1, 1024, 0, 1, 0 }, { "print", 256, "Print data and log to stdout", (gptr*) &_print, (gptr*) &_print, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 }, @@ -120,6 +120,18 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), case 'V': print_version(); exit(0); + case 'n': + if (ga_nodeId == 0) + { + printf("Error in --nodeid|-n setting, see --help\n"); + exit(1); + } + case 'b': + if (ga_backupId == 0) + { + printf("Error in --backupid|-b setting, see --help\n"); + exit(1); + } case '?': usage(); exit(0); @@ -131,11 +143,8 @@ readArguments(int *pargc, char*** pargv) { const char *load_default_groups[]= { "ndb_tools","ndb_restore",0 }; load_defaults("my",load_default_groups,pargc,pargv); - if (handle_options(pargc, pargv, my_long_options, get_one_option) || - ga_nodeId == 0 || - ga_backupId == 0 || - ga_nParallelism < 1 || - ga_nParallelism >1024) { + if (handle_options(pargc, pargv, my_long_options, get_one_option)) + { exit(1); } @@ -343,7 +352,8 @@ main(int argc, char** argv) if (res < 0) { - err << "Restore: An error occured while restoring data. Exiting... res=" << res << endl; + err << "Restore: An error occured while restoring data. Exiting... " + << "res=" << res << endl; return -1; } @@ -369,7 +379,8 @@ main(int argc, char** argv) } if (res < 0) { - err << "Restore: An restoring the data log. Exiting... res=" << res << endl; + err << "Restore: An restoring the data log. Exiting... res=" + << res << endl; return -1; } logIter.validateFooter(); //not implemented From f080e78f628b9f2bc0613f35de5f5cd298ed73ce Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 18 Nov 2004 22:41:31 +0100 Subject: [PATCH 0263/1063] wl2077 - ndb scan optimizations ndb/test/ndbapi/testScanPerf.cpp: Add reset_bounds option Impl. eq bound queries --- ndb/test/ndbapi/testScanPerf.cpp | 78 ++++++++++++++++++++++---------- 1 file changed, 54 insertions(+), 24 deletions(-) diff --git a/ndb/test/ndbapi/testScanPerf.cpp b/ndb/test/ndbapi/testScanPerf.cpp index c1334125978..fca67c6abcb 100644 --- a/ndb/test/ndbapi/testScanPerf.cpp +++ b/ndb/test/ndbapi/testScanPerf.cpp @@ -39,8 +39,9 @@ struct Parameter { #define P_LOOPS 8 #define P_CREATE 9 #define P_LOAD 10 +#define P_RESET 11 -#define P_MAX 11 +#define P_MAX 12 static Parameter @@ -55,7 +56,8 @@ g_paramters[] = { { "size", 1000000, 1, ~0 }, { "iterations", 3, 1, ~0 }, { "create_drop", 1, 0, 1 }, - { "data", 1, 0, 1 } + { "data", 1, 0, 1 }, + { "q-reset bounds", 0, 1, 0 } }; static Ndb* g_ndb = 0; @@ -218,21 +220,29 @@ run_scan(){ NDB_TICKS start1, stop; int sum_time= 0; + int sample_rows = 0; + NDB_TICKS sample_start = NdbTick_CurrentMillisecond(); + Uint32 tot = g_paramters[P_ROWS].value; + if(g_paramters[P_BOUND].value == 2 || g_paramters[P_FILT].value == 2) + iter *= g_paramters[P_ROWS].value; + + NdbScanOperation * pOp = 0; + NdbIndexScanOperation * pIOp = 0; + NdbConnection * pTrans = 0; + NdbResultSet * rs = 0; + int check = 0; + for(int i = 0; istartTransaction(); + pTrans = pTrans ? pTrans : g_ndb->startTransaction(); if(!pTrans){ g_err << "Failed to start transaction" << endl; err(g_ndb->getNdbError()); return -1; } - NdbScanOperation * pOp; - NdbIndexScanOperation * pIOp; - - NdbResultSet * rs; int par = g_paramters[P_PARRA].value; int bat = g_paramters[P_BATCH].value; NdbScanOperation::LockMode lm; @@ -255,9 +265,17 @@ run_scan(){ assert(pOp); rs = pOp->readTuples(lm, bat, par); } else { - pOp = pIOp = pTrans->getNdbIndexScanOperation(g_indexname, g_tablename); - bool ord = g_paramters[P_ACCESS].value == 2; - rs = pIOp->readTuples(lm, bat, par, ord); + if(g_paramters[P_RESET].value == 0 || pIOp == 0) + { + pOp= pIOp= pTrans->getNdbIndexScanOperation(g_indexname, g_tablename); + bool ord = g_paramters[P_ACCESS].value == 2; + rs = pIOp->readTuples(lm, bat, par, ord); + } + else + { + pIOp->reset_bounds(); + } + switch(g_paramters[P_BOUND].value){ case 0: // All break; @@ -267,20 +285,22 @@ run_scan(){ case 2: { // 1 row default: assert(g_table->getNoOfPrimaryKeys() == 1); // only impl. so far - abort(); -#if 0 int tot = g_paramters[P_ROWS].value; int row = rand() % tot; +#if 0 fix_eq_bound(pIOp, row); +#else + pIOp->setBound((Uint32)0, NdbIndexScanOperation::BoundEQ, &row); #endif break; } } + if(g_paramters[P_RESET].value == 1) + goto execute; } assert(pOp); assert(rs); - int check = 0; switch(g_paramters[P_FILT].value){ case 0: // All check = pOp->interpret_exit_ok(); @@ -312,7 +332,7 @@ run_scan(){ for(int i = 0; igetNoOfColumns(); i++){ pOp->getValue(i); } - +execute: int rows = 0; check = pTrans->execute(NoCommit); assert(check == 0); @@ -333,19 +353,29 @@ run_scan(){ return -1; } assert(check == 1); - g_info << "Found " << rows << " rows" << endl; - - pTrans->close(); - + if(g_paramters[P_RESET].value == 0) + { + pTrans->close(); + pTrans = 0; + } stop = NdbTick_CurrentMillisecond(); + int time_passed= (int)(stop - start1); - g_err.println("Time: %d ms = %u rows/sec", time_passed, - (1000*tot)/time_passed); + sample_rows += rows; sum_time+= time_passed; + + if(sample_rows >= tot) + { + int sample_time = (int)(stop - sample_start); + g_info << "Found " << sample_rows << " rows" << endl; + g_err.println("Time: %d ms = %u rows/sec", sample_time, + (1000*sample_rows)/sample_time); + sample_rows = 0; + sample_start = stop; + } } - sum_time= sum_time / iter; - - g_err.println("Avg time: %d ms = %u rows/sec", sum_time, - (1000*tot)/sum_time); + + g_err.println("Avg time: %d ms = %u rows/sec", sum_time/iter, + (1000*tot*iter)/sum_time); return 0; } From 13710e869fb66e6dc9f21a974b43a3c0dd821535 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 18 Nov 2004 21:42:25 +0000 Subject: [PATCH 0264/1063] change file name to avoid conflict corrected mistake in previous patch ndb/tools/Makefile.am: change file name to avoid conflict ndb/tools/restore/restore_main.cpp: corrected mistake in previous patch --- ndb/tools/Makefile.am | 2 +- ndb/tools/restore/{main.cpp => restore_main.cpp} | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) rename ndb/tools/restore/{main.cpp => restore_main.cpp} (98%) diff --git a/ndb/tools/Makefile.am b/ndb/tools/Makefile.am index 9c086d665c1..7a61a9b1be5 100644 --- a/ndb/tools/Makefile.am +++ b/ndb/tools/Makefile.am @@ -26,7 +26,7 @@ ndb_select_all_SOURCES = select_all.cpp \ ../test/src/NDBT_ResultRow.cpp \ $(tools_common_sources) ndb_select_count_SOURCES = select_count.cpp $(tools_common_sources) -ndb_restore_SOURCES = restore/main.cpp \ +ndb_restore_SOURCES = restore/restore_main.cpp \ restore/consumer.cpp \ restore/consumer_restore.cpp \ restore/consumer_printer.cpp \ diff --git a/ndb/tools/restore/main.cpp b/ndb/tools/restore/restore_main.cpp similarity index 98% rename from ndb/tools/restore/main.cpp rename to ndb/tools/restore/restore_main.cpp index 064fbad43a3..c43791c6723 100644 --- a/ndb/tools/restore/main.cpp +++ b/ndb/tools/restore/restore_main.cpp @@ -123,15 +123,17 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), case 'n': if (ga_nodeId == 0) { - printf("Error in --nodeid|-n setting, see --help\n"); + printf("Error in --nodeid,-n setting, see --help\n"); exit(1); } + break; case 'b': if (ga_backupId == 0) { - printf("Error in --backupid|-b setting, see --help\n"); + printf("Error in --backupid,-b setting, see --help\n"); exit(1); } + break; case '?': usage(); exit(0); From f336c62a4480d4175942a6ed23fa5fe09f411b15 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 18 Nov 2004 22:59:17 +0100 Subject: [PATCH 0265/1063] When mysqlbinlog prints LOAD DATA INFILE, let it print the thread id. Some customer would have benefited much from this in his recovery. All this change does is adding one commented (#) line before the LOAD DATA command, so it is quite innocuous. --- sql/log_event.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/log_event.cc b/sql/log_event.cc index f707eabebd5..007bb6e7b85 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -1612,7 +1612,7 @@ void Create_file_log_event::print(FILE* file, bool short_form, if (enable_local) { - Load_log_event::print(file, 1, last_db, !check_fname_outside_temp_buf()); + Load_log_event::print(file, short_form, last_db, !check_fname_outside_temp_buf()); /* That one is for "file_id: etc" below: in mysqlbinlog we want the #, in SHOW BINLOG EVENTS we don't. From f3374eec82129fe4e258c0fd825c1e0dc66c3a37 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 18 Nov 2004 22:44:34 +0000 Subject: [PATCH 0266/1063] merge error --- ndb/include/Makefile.am | 1 - 1 file changed, 1 deletion(-) diff --git a/ndb/include/Makefile.am b/ndb/include/Makefile.am index ca2e8152352..7b3f80b5560 100644 --- a/ndb/include/Makefile.am +++ b/ndb/include/Makefile.am @@ -28,7 +28,6 @@ ndbapi/NdbIndexScanOperation.hpp \ ndbapi/ndberror.h mgmapiinclude_HEADERS = \ -mgmapi/LocalConfig.hpp \ mgmapi/mgmapi.h \ mgmapi/mgmapi_debug.h From 3ef38a3732a832f91d1ab5db62659a36a081646e Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 18 Nov 2004 22:45:48 +0000 Subject: [PATCH 0267/1063] moved ndb_use_transactions out of opts and to be set default true in THD::init --- sql/mysqld.cc | 6 ------ sql/sql_class.cc | 3 +++ 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 5ee52326276..5033c42ac69 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -3950,7 +3950,6 @@ enum options_mysqld OPT_INNODB, OPT_ISAM, OPT_NDBCLUSTER, OPT_NDB_CONNECTSTRING, OPT_NDB_USE_EXACT_COUNT, OPT_NDB_FORCE_SEND, OPT_NDB_AUTOINCREMENT_PREFETCH_SZ, - OPT_NDB_USE_TRANSACTIONS, OPT_SKIP_SAFEMALLOC, OPT_TEMP_POOL, OPT_TX_ISOLATION, OPT_SKIP_STACK_TRACE, OPT_SKIP_SYMLINKS, @@ -4410,11 +4409,6 @@ Disable with --skip-ndbcluster (will save memory).", (gptr*) &global_system_variables.ndb_use_exact_count, (gptr*) &global_system_variables.ndb_use_exact_count, 0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0}, - {"ndb_use_transactions", OPT_NDB_USE_TRANSACTIONS, - "Use transactions in ndb", - (gptr*) &global_system_variables.ndb_use_transactions, - (gptr*) &global_system_variables.ndb_use_transactions, - 0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0}, #endif {"new", 'n', "Use very new possible 'unsafe' functions.", (gptr*) &global_system_variables.new_mode, diff --git a/sql/sql_class.cc b/sql/sql_class.cc index eda60b5cfdb..bab81d785c3 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -280,6 +280,9 @@ void THD::init(void) variables.date_format); variables.datetime_format= date_time_format_copy((THD*) 0, variables.datetime_format); +#ifdef HAVE_NDBCLUSTER_DB + variables.ndb_use_transactions= 1; +#endif pthread_mutex_unlock(&LOCK_global_system_variables); server_status= SERVER_STATUS_AUTOCOMMIT; options= thd_startup_options; From fb36bc2a43b910ed5a46dba72153e2cc795b51b2 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 19 Nov 2004 00:57:26 +0100 Subject: [PATCH 0268/1063] log_event.cc: post-conflict-merge fix (duplicate comment) sql/log_event.cc: post-conflict-merge fix (duplicate comment) --- sql/log_event.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/sql/log_event.cc b/sql/log_event.cc index 31b02a5a29a..2fdc89504d7 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -1,4 +1,3 @@ -/* Copyright (C) 2000-2004 MySQL AB /* Copyright (C) 2000-2004 MySQL AB This program is free software; you can redistribute it and/or modify From bd51cf30d27dab3cb240c6f0f45e2c40080618c6 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 19 Nov 2004 09:17:36 +0000 Subject: [PATCH 0269/1063] ndb_grant.result, ndb_grant.test: new file --- mysql-test/r/ndb_grant.result | 416 ++++++++++++++++++++++++++++++++++ mysql-test/t/ndb_grant.test | 374 ++++++++++++++++++++++++++++++ 2 files changed, 790 insertions(+) create mode 100644 mysql-test/r/ndb_grant.result create mode 100644 mysql-test/t/ndb_grant.test diff --git a/mysql-test/r/ndb_grant.result b/mysql-test/r/ndb_grant.result new file mode 100644 index 00000000000..6583065a0c4 --- /dev/null +++ b/mysql-test/r/ndb_grant.result @@ -0,0 +1,416 @@ +drop table if exists t1; +SET NAMES binary; +use mysql; +alter table columns_priv engine=ndb; +alter table db engine=ndb; +alter table func engine=ndb; +alter table help_category engine=ndb; +alter table help_keyword engine=ndb; +alter table help_relation engine=ndb; +alter table help_topic engine=ndb; +alter table host engine=ndb; +alter table tables_priv engine=ndb; +alter table time_zone engine=ndb; +alter table time_zone_leap_second engine=ndb; +alter table time_zone_name engine=ndb; +alter table time_zone_transition engine=ndb; +alter table time_zone_transition_type engine=ndb; +alter table user engine=ndb; +use test; +delete from mysql.user where user='mysqltest_1'; +delete from mysql.db where user='mysqltest_1'; +flush privileges; +begin; +grant select on mysqltest.* to mysqltest_1@localhost require cipher "EDH-RSA-DES-CBC3-SHA"; +commit; +show grants for mysqltest_1@localhost; +Grants for mysqltest_1@localhost +GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' REQUIRE CIPHER 'EDH-RSA-DES-CBC3-SHA' +GRANT SELECT ON `mysqltest`.* TO 'mysqltest_1'@'localhost' +begin; +grant delete on mysqltest.* to mysqltest_1@localhost; +commit; +select * from mysql.user where user="mysqltest_1"; +Host User Password Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Reload_priv Shutdown_priv Process_priv File_priv Grant_priv References_priv Index_priv Alter_priv Show_db_priv Super_priv Create_tmp_table_priv Lock_tables_priv Execute_priv Repl_slave_priv Repl_client_priv ssl_type ssl_cipher x509_issuer x509_subject max_questions max_updates max_connections +localhost mysqltest_1 N N N N N N N N N N N N N N N N N N N N N SPECIFIED EDH-RSA-DES-CBC3-SHA 0 0 0 +show grants for mysqltest_1@localhost; +Grants for mysqltest_1@localhost +GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' REQUIRE CIPHER 'EDH-RSA-DES-CBC3-SHA' +GRANT SELECT, DELETE ON `mysqltest`.* TO 'mysqltest_1'@'localhost' +begin; +revoke delete on mysqltest.* from mysqltest_1@localhost; +commit; +show grants for mysqltest_1@localhost; +Grants for mysqltest_1@localhost +GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' REQUIRE CIPHER 'EDH-RSA-DES-CBC3-SHA' +GRANT SELECT ON `mysqltest`.* TO 'mysqltest_1'@'localhost' +begin; +grant select on mysqltest.* to mysqltest_1@localhost require NONE; +commit; +show grants for mysqltest_1@localhost; +Grants for mysqltest_1@localhost +GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' +GRANT SELECT ON `mysqltest`.* TO 'mysqltest_1'@'localhost' +begin; +grant USAGE on mysqltest.* to mysqltest_1@localhost require cipher "EDH-RSA-DES-CBC3-SHA" AND SUBJECT "testsubject" ISSUER "MySQL AB"; +commit; +show grants for mysqltest_1@localhost; +Grants for mysqltest_1@localhost +GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' REQUIRE ISSUER 'MySQL AB' SUBJECT 'testsubject' CIPHER 'EDH-RSA-DES-CBC3-SHA' +GRANT SELECT ON `mysqltest`.* TO 'mysqltest_1'@'localhost' +begin; +revoke all privileges on mysqltest.* from mysqltest_1@localhost; +commit; +show grants for mysqltest_1@localhost; +Grants for mysqltest_1@localhost +GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' REQUIRE ISSUER 'MySQL AB' SUBJECT 'testsubject' CIPHER 'EDH-RSA-DES-CBC3-SHA' +delete from mysql.user where user='mysqltest_1'; +flush privileges; +begin; +grant CREATE TEMPORARY TABLES, LOCK TABLES on mysqltest.* to mysqltest_1@localhost; +commit; +show grants for mysqltest_1@localhost; +Grants for mysqltest_1@localhost +GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' +GRANT CREATE TEMPORARY TABLES, LOCK TABLES ON `mysqltest`.* TO 'mysqltest_1'@'localhost' +flush privileges; +show grants for mysqltest_1@localhost; +Grants for mysqltest_1@localhost +GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' +GRANT CREATE TEMPORARY TABLES, LOCK TABLES ON `mysqltest`.* TO 'mysqltest_1'@'localhost' +begin; +revoke CREATE TEMPORARY TABLES on mysqltest.* from mysqltest_1@localhost; +commit; +show grants for mysqltest_1@localhost; +Grants for mysqltest_1@localhost +GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' +GRANT LOCK TABLES ON `mysqltest`.* TO 'mysqltest_1'@'localhost' +begin; +grant ALL PRIVILEGES on mysqltest.* to mysqltest_1@localhost with GRANT OPTION; +commit; +flush privileges; +show grants for mysqltest_1@localhost; +Grants for mysqltest_1@localhost +GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' +GRANT ALL PRIVILEGES ON `mysqltest`.* TO 'mysqltest_1'@'localhost' WITH GRANT OPTION +begin; +revoke LOCK TABLES, ALTER on mysqltest.* from mysqltest_1@localhost; +commit; +show grants for mysqltest_1@localhost; +Grants for mysqltest_1@localhost +GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' +GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, CREATE TEMPORARY TABLES ON `mysqltest`.* TO 'mysqltest_1'@'localhost' WITH GRANT OPTION +begin; +revoke all privileges on mysqltest.* from mysqltest_1@localhost; +commit; +delete from mysql.user where user='mysqltest_1'; +flush privileges; +begin; +grant usage on test.* to mysqltest_1@localhost with grant option; +commit; +show grants for mysqltest_1@localhost; +Grants for mysqltest_1@localhost +GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' +GRANT USAGE ON `mysqltest`.* TO 'mysqltest_1'@'localhost' WITH GRANT OPTION +GRANT USAGE ON `test`.* TO 'mysqltest_1'@'localhost' WITH GRANT OPTION +delete from mysql.user where user='mysqltest_1'; +delete from mysql.db where user='mysqltest_1'; +delete from mysql.tables_priv where user='mysqltest_1'; +delete from mysql.columns_priv where user='mysqltest_1'; +flush privileges; +show grants for mysqltest_1@localhost; +ERROR 42000: There is no such grant defined for user 'mysqltest_1' on host 'localhost' +create table t1 (a int); +begin; +GRANT select,update,insert on t1 to mysqltest_1@localhost; +GRANT select (a), update (a),insert(a), references(a) on t1 to mysqltest_1@localhost; +commit; +show grants for mysqltest_1@localhost; +Grants for mysqltest_1@localhost +GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' +GRANT SELECT, SELECT (a), INSERT, INSERT (a), UPDATE, UPDATE (a), REFERENCES (a) ON `test`.`t1` TO 'mysqltest_1'@'localhost' +select table_priv,column_priv from mysql.tables_priv where user="mysqltest_1"; +table_priv column_priv +Select,Insert,Update Select,Insert,Update,References +begin; +REVOKE select (a), update on t1 from mysqltest_1@localhost; +commit; +show grants for mysqltest_1@localhost; +Grants for mysqltest_1@localhost +GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' +GRANT SELECT, INSERT, INSERT (a), REFERENCES (a) ON `test`.`t1` TO 'mysqltest_1'@'localhost' +begin; +REVOKE select,update,insert,insert (a) on t1 from mysqltest_1@localhost; +commit; +show grants for mysqltest_1@localhost; +Grants for mysqltest_1@localhost +GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' +GRANT REFERENCES (a) ON `test`.`t1` TO 'mysqltest_1'@'localhost' +begin; +GRANT select,references on t1 to mysqltest_1@localhost; +commit; +select table_priv,column_priv from mysql.tables_priv where user="mysqltest_1"; +table_priv column_priv +Select,References References +begin; +grant all on test.* to mysqltest_3@localhost with grant option; +revoke all on test.* from mysqltest_3@localhost; +commit; +show grants for mysqltest_3@localhost; +Grants for mysqltest_3@localhost +GRANT USAGE ON *.* TO 'mysqltest_3'@'localhost' +GRANT USAGE ON `test`.* TO 'mysqltest_3'@'localhost' WITH GRANT OPTION +begin; +revoke grant option on test.* from mysqltest_3@localhost; +commit; +show grants for mysqltest_3@localhost; +Grants for mysqltest_3@localhost +GRANT USAGE ON *.* TO 'mysqltest_3'@'localhost' +begin; +grant all on test.t1 to mysqltest_2@localhost with grant option; +revoke all on test.t1 from mysqltest_2@localhost; +commit; +show grants for mysqltest_2@localhost; +Grants for mysqltest_2@localhost +GRANT USAGE ON *.* TO 'mysqltest_2'@'localhost' +GRANT USAGE ON `test`.`t1` TO 'mysqltest_2'@'localhost' WITH GRANT OPTION +begin; +revoke grant option on test.t1 from mysqltest_2@localhost; +commit; +show grants for mysqltest_2@localhost; +Grants for mysqltest_2@localhost +GRANT USAGE ON *.* TO 'mysqltest_2'@'localhost' +delete from mysql.user where user='mysqltest_1' or user="mysqltest_2" or user="mysqltest_3"; +delete from mysql.db where user='mysqltest_1' or user="mysqltest_2" or user="mysqltest_3"; +delete from mysql.tables_priv where user='mysqltest_1' or user="mysqltest_2" or user="mysqltest_3"; +delete from mysql.columns_priv where user='mysqltest_1' or user="mysqltest_2" or user="mysqltest_3"; +flush privileges; +drop table t1; +begin; +GRANT FILE on mysqltest.* to mysqltest_1@localhost; +ERROR HY000: Incorrect usage of DB GRANT and GLOBAL PRIVILEGES +commit; +select 1; +1 +1 +create database mysqltest1; +begin; +grant usage on mysqltest1.* to test6123 identified by 'magic123'; +commit; +select host,db,user,select_priv,insert_priv from mysql.db where db="mysqltest1"; +host db user select_priv insert_priv +delete from mysql.user where user='test6123'; +drop database mysqltest1; +create table t1 (a int); +begin; +grant ALL PRIVILEGES on *.* to drop_user2@localhost with GRANT OPTION; +commit; +show grants for drop_user2@localhost; +Grants for drop_user2@localhost +GRANT ALL PRIVILEGES ON *.* TO 'drop_user2'@'localhost' WITH GRANT OPTION +begin; +revoke all privileges, grant option from drop_user2@localhost; +commit; +drop user drop_user2@localhost; +begin; +grant ALL PRIVILEGES on *.* to drop_user@localhost with GRANT OPTION; +grant ALL PRIVILEGES on test.* to drop_user@localhost with GRANT OPTION; +grant select(a) on test.t1 to drop_user@localhost; +commit; +show grants for drop_user@localhost; +Grants for drop_user@localhost +GRANT ALL PRIVILEGES ON *.* TO 'drop_user'@'localhost' WITH GRANT OPTION +GRANT ALL PRIVILEGES ON `test`.* TO 'drop_user'@'localhost' WITH GRANT OPTION +GRANT SELECT (a) ON `test`.`t1` TO 'drop_user'@'localhost' +set sql_mode=ansi_quotes; +show grants for drop_user@localhost; +Grants for drop_user@localhost +GRANT ALL PRIVILEGES ON *.* TO 'drop_user'@'localhost' WITH GRANT OPTION +GRANT ALL PRIVILEGES ON "test".* TO 'drop_user'@'localhost' WITH GRANT OPTION +GRANT SELECT (a) ON "test"."t1" TO 'drop_user'@'localhost' +set sql_mode=default; +set sql_quote_show_create=0; +show grants for drop_user@localhost; +Grants for drop_user@localhost +GRANT ALL PRIVILEGES ON *.* TO 'drop_user'@'localhost' WITH GRANT OPTION +GRANT ALL PRIVILEGES ON test.* TO 'drop_user'@'localhost' WITH GRANT OPTION +GRANT SELECT (a) ON test.t1 TO 'drop_user'@'localhost' +set sql_mode="ansi_quotes"; +show grants for drop_user@localhost; +Grants for drop_user@localhost +GRANT ALL PRIVILEGES ON *.* TO 'drop_user'@'localhost' WITH GRANT OPTION +GRANT ALL PRIVILEGES ON test.* TO 'drop_user'@'localhost' WITH GRANT OPTION +GRANT SELECT (a) ON test.t1 TO 'drop_user'@'localhost' +set sql_quote_show_create=1; +show grants for drop_user@localhost; +Grants for drop_user@localhost +GRANT ALL PRIVILEGES ON *.* TO 'drop_user'@'localhost' WITH GRANT OPTION +GRANT ALL PRIVILEGES ON "test".* TO 'drop_user'@'localhost' WITH GRANT OPTION +GRANT SELECT (a) ON "test"."t1" TO 'drop_user'@'localhost' +set sql_mode=""; +show grants for drop_user@localhost; +Grants for drop_user@localhost +GRANT ALL PRIVILEGES ON *.* TO 'drop_user'@'localhost' WITH GRANT OPTION +GRANT ALL PRIVILEGES ON `test`.* TO 'drop_user'@'localhost' WITH GRANT OPTION +GRANT SELECT (a) ON `test`.`t1` TO 'drop_user'@'localhost' +revoke all privileges, grant option from drop_user@localhost; +show grants for drop_user@localhost; +Grants for drop_user@localhost +GRANT USAGE ON *.* TO 'drop_user'@'localhost' +drop user drop_user@localhost; +begin; +revoke all privileges, grant option from drop_user@localhost; +ERROR HY000: Can't revoke all privileges, grant for one or more of the requested users +commit; +begin; +grant select(a) on test.t1 to drop_user1@localhost; +commit; +flush privileges; +begin; +grant select on test.t1 to drop_user2@localhost; +grant select on test.* to drop_user3@localhost; +grant select on *.* to drop_user4@localhost; +commit; +drop user drop_user1@localhost, drop_user2@localhost, drop_user3@localhost, +drop_user4@localhost; +ERROR HY000: Can't drop one or more of the requested users +begin; +revoke all privileges, grant option from drop_user1@localhost, drop_user2@localhost, +drop_user3@localhost, drop_user4@localhost; +commit; +drop user drop_user1@localhost, drop_user2@localhost, drop_user3@localhost, +drop_user4@localhost; +drop table t1; +begin; +grant usage on *.* to mysqltest_1@localhost identified by "password"; +grant select, update, insert on test.* to mysqltest@localhost; +commit; +show grants for mysqltest_1@localhost; +Grants for mysqltest_1@localhost +GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' IDENTIFIED BY PASSWORD '*2470C0C06DEE42FD1618BB99005ADCA2EC9D1E19' +drop user mysqltest_1@localhost; +SET NAMES koi8r; +CREATE DATABASE ÂÄ; +USE ÂÄ; +CREATE TABLE ÔÁÂ (ËÏÌ int); +begin; +GRANT SELECT ON ÂÄ.* TO ÀÚÅÒ@localhost; +commit; +SHOW GRANTS FOR ÀÚÅÒ@localhost; +Grants for ÀÚÅÒ@localhost +GRANT USAGE ON *.* TO 'ÀÚÅÒ'@'localhost' +GRANT SELECT ON `ÂÄ`.* TO 'ÀÚÅÒ'@'localhost' +begin; +REVOKE SELECT ON ÂÄ.* FROM ÀÚÅÒ@localhost; +commit; +begin; +GRANT SELECT ON ÂÄ.ÔÁÂ TO ÀÚÅÒ@localhost; +commit; +SHOW GRANTS FOR ÀÚÅÒ@localhost; +Grants for ÀÚÅÒ@localhost +GRANT USAGE ON *.* TO 'ÀÚÅÒ'@'localhost' +GRANT SELECT ON `ÂÄ`.`ÔÁÂ` TO 'ÀÚÅÒ'@'localhost' +begin; +REVOKE SELECT ON ÂÄ.ÔÁÂ FROM ÀÚÅÒ@localhost; +commit; +begin; +GRANT SELECT (ËÏÌ) ON ÂÄ.ÔÁÂ TO ÀÚÅÒ@localhost; +commit; +SHOW GRANTS FOR ÀÚÅÒ@localhost; +Grants for ÀÚÅÒ@localhost +GRANT USAGE ON *.* TO 'ÀÚÅÒ'@'localhost' +GRANT SELECT (ËÏÌ) ON `ÂÄ`.`ÔÁÂ` TO 'ÀÚÅÒ'@'localhost' +begin; +REVOKE SELECT (ËÏÌ) ON ÂÄ.ÔÁÂ FROM ÀÚÅÒ@localhost; +commit; +DROP DATABASE ÂÄ; +SET NAMES latin1; +USE test; +CREATE TABLE t1 (a int ); +CREATE TABLE t2 LIKE t1; +CREATE TABLE t3 LIKE t1; +CREATE TABLE t4 LIKE t1; +CREATE TABLE t5 LIKE t1; +CREATE TABLE t6 LIKE t1; +CREATE TABLE t7 LIKE t1; +CREATE TABLE t8 LIKE t1; +CREATE TABLE t9 LIKE t1; +CREATE TABLE t10 LIKE t1; +CREATE DATABASE testdb1; +CREATE DATABASE testdb2; +CREATE DATABASE testdb3; +CREATE DATABASE testdb4; +CREATE DATABASE testdb5; +CREATE DATABASE testdb6; +CREATE DATABASE testdb7; +CREATE DATABASE testdb8; +CREATE DATABASE testdb9; +CREATE DATABASE testdb10; +begin; +GRANT ALL ON testdb1.* TO testuser@localhost; +GRANT ALL ON testdb2.* TO testuser@localhost; +GRANT ALL ON testdb3.* TO testuser@localhost; +GRANT ALL ON testdb4.* TO testuser@localhost; +GRANT ALL ON testdb5.* TO testuser@localhost; +GRANT ALL ON testdb6.* TO testuser@localhost; +GRANT ALL ON testdb7.* TO testuser@localhost; +GRANT ALL ON testdb8.* TO testuser@localhost; +GRANT ALL ON testdb9.* TO testuser@localhost; +GRANT ALL ON testdb10.* TO testuser@localhost; +GRANT SELECT ON test.t1 TO testuser@localhost; +GRANT SELECT ON test.t2 TO testuser@localhost; +GRANT SELECT ON test.t3 TO testuser@localhost; +GRANT SELECT ON test.t4 TO testuser@localhost; +GRANT SELECT ON test.t5 TO testuser@localhost; +GRANT SELECT ON test.t6 TO testuser@localhost; +GRANT SELECT ON test.t7 TO testuser@localhost; +GRANT SELECT ON test.t8 TO testuser@localhost; +GRANT SELECT ON test.t9 TO testuser@localhost; +GRANT SELECT ON test.t10 TO testuser@localhost; +GRANT SELECT (a) ON test.t1 TO testuser@localhost; +GRANT SELECT (a) ON test.t2 TO testuser@localhost; +GRANT SELECT (a) ON test.t3 TO testuser@localhost; +GRANT SELECT (a) ON test.t4 TO testuser@localhost; +GRANT SELECT (a) ON test.t5 TO testuser@localhost; +GRANT SELECT (a) ON test.t6 TO testuser@localhost; +GRANT SELECT (a) ON test.t7 TO testuser@localhost; +GRANT SELECT (a) ON test.t8 TO testuser@localhost; +GRANT SELECT (a) ON test.t9 TO testuser@localhost; +GRANT SELECT (a) ON test.t10 TO testuser@localhost; +commit; +begin; +REVOKE ALL PRIVILEGES, GRANT OPTION FROM testuser@localhost; +commit; +SHOW GRANTS FOR testuser@localhost; +Grants for testuser@localhost +GRANT USAGE ON *.* TO 'testuser'@'localhost' +DROP USER testuser@localhost; +DROP TABLE t1,t2,t3,t4,t5,t6,t7,t8,t9,t10; +DROP DATABASE testdb1; +DROP DATABASE testdb2; +DROP DATABASE testdb3; +DROP DATABASE testdb4; +DROP DATABASE testdb5; +DROP DATABASE testdb6; +DROP DATABASE testdb7; +DROP DATABASE testdb8; +DROP DATABASE testdb9; +DROP DATABASE testdb10; +use mysql; +alter table columns_priv engine=myisam; +alter table db engine=myisam; +alter table func engine=myisam; +alter table help_category engine=myisam; +alter table help_keyword engine=myisam; +alter table help_relation engine=myisam; +alter table help_topic engine=myisam; +alter table host engine=myisam; +alter table tables_priv engine=myisam; +alter table time_zone engine=myisam; +alter table time_zone_leap_second engine=myisam; +alter table time_zone_name engine=myisam; +alter table time_zone_transition engine=myisam; +alter table time_zone_transition_type engine=myisam; +alter table user engine=myisam; +use test; +flush privileges; diff --git a/mysql-test/t/ndb_grant.test b/mysql-test/t/ndb_grant.test new file mode 100644 index 00000000000..d3899d9972f --- /dev/null +++ b/mysql-test/t/ndb_grant.test @@ -0,0 +1,374 @@ +-- source include/have_ndb.inc +# Test of GRANT commands + +# Cleanup +--disable_warnings +drop table if exists t1; +--enable_warnings + +SET NAMES binary; + +# +# Alter mysql system tables to ndb +# make sure you alter all back in the end +# +use mysql; +alter table columns_priv engine=ndb; +alter table db engine=ndb; +alter table func engine=ndb; +alter table help_category engine=ndb; +alter table help_keyword engine=ndb; +alter table help_relation engine=ndb; +alter table help_topic engine=ndb; +alter table host engine=ndb; +alter table tables_priv engine=ndb; +alter table time_zone engine=ndb; +alter table time_zone_leap_second engine=ndb; +alter table time_zone_name engine=ndb; +alter table time_zone_transition engine=ndb; +alter table time_zone_transition_type engine=ndb; +alter table user engine=ndb; +use test; + +# +# Test that SSL options works properly +# +delete from mysql.user where user='mysqltest_1'; +delete from mysql.db where user='mysqltest_1'; +flush privileges; +begin; +grant select on mysqltest.* to mysqltest_1@localhost require cipher "EDH-RSA-DES-CBC3-SHA"; +commit; +show grants for mysqltest_1@localhost; +begin; +grant delete on mysqltest.* to mysqltest_1@localhost; +commit; +select * from mysql.user where user="mysqltest_1"; +show grants for mysqltest_1@localhost; +begin; +revoke delete on mysqltest.* from mysqltest_1@localhost; +commit; +show grants for mysqltest_1@localhost; +begin; +grant select on mysqltest.* to mysqltest_1@localhost require NONE; +commit; +show grants for mysqltest_1@localhost; +begin; +grant USAGE on mysqltest.* to mysqltest_1@localhost require cipher "EDH-RSA-DES-CBC3-SHA" AND SUBJECT "testsubject" ISSUER "MySQL AB"; +commit; +show grants for mysqltest_1@localhost; +begin; +revoke all privileges on mysqltest.* from mysqltest_1@localhost; +commit; +show grants for mysqltest_1@localhost; +delete from mysql.user where user='mysqltest_1'; +flush privileges; + +# +# Test that the new db privileges are stored/retrieved correctly +# + +begin; +grant CREATE TEMPORARY TABLES, LOCK TABLES on mysqltest.* to mysqltest_1@localhost; +commit; +show grants for mysqltest_1@localhost; +flush privileges; +show grants for mysqltest_1@localhost; +begin; +revoke CREATE TEMPORARY TABLES on mysqltest.* from mysqltest_1@localhost; +commit; +show grants for mysqltest_1@localhost; +begin; +grant ALL PRIVILEGES on mysqltest.* to mysqltest_1@localhost with GRANT OPTION; +commit; +flush privileges; +show grants for mysqltest_1@localhost; +begin; +revoke LOCK TABLES, ALTER on mysqltest.* from mysqltest_1@localhost; +commit; +show grants for mysqltest_1@localhost; +begin; +revoke all privileges on mysqltest.* from mysqltest_1@localhost; +commit; +delete from mysql.user where user='mysqltest_1'; +flush privileges; +begin; +grant usage on test.* to mysqltest_1@localhost with grant option; +commit; +show grants for mysqltest_1@localhost; +delete from mysql.user where user='mysqltest_1'; +delete from mysql.db where user='mysqltest_1'; +delete from mysql.tables_priv where user='mysqltest_1'; +delete from mysql.columns_priv where user='mysqltest_1'; +flush privileges; +--error 1141 +show grants for mysqltest_1@localhost; + +# +# Test what happens when you have same table and colum level grants +# + +create table t1 (a int); +begin; +GRANT select,update,insert on t1 to mysqltest_1@localhost; +GRANT select (a), update (a),insert(a), references(a) on t1 to mysqltest_1@localhost; +commit; +show grants for mysqltest_1@localhost; +select table_priv,column_priv from mysql.tables_priv where user="mysqltest_1"; +begin; +REVOKE select (a), update on t1 from mysqltest_1@localhost; +commit; +show grants for mysqltest_1@localhost; +begin; +REVOKE select,update,insert,insert (a) on t1 from mysqltest_1@localhost; +commit; +show grants for mysqltest_1@localhost; +begin; +GRANT select,references on t1 to mysqltest_1@localhost; +commit; +select table_priv,column_priv from mysql.tables_priv where user="mysqltest_1"; +begin; +grant all on test.* to mysqltest_3@localhost with grant option; +revoke all on test.* from mysqltest_3@localhost; +commit; +show grants for mysqltest_3@localhost; +begin; +revoke grant option on test.* from mysqltest_3@localhost; +commit; +show grants for mysqltest_3@localhost; +begin; +grant all on test.t1 to mysqltest_2@localhost with grant option; +revoke all on test.t1 from mysqltest_2@localhost; +commit; +show grants for mysqltest_2@localhost; +begin; +revoke grant option on test.t1 from mysqltest_2@localhost; +commit; +show grants for mysqltest_2@localhost; +delete from mysql.user where user='mysqltest_1' or user="mysqltest_2" or user="mysqltest_3"; +delete from mysql.db where user='mysqltest_1' or user="mysqltest_2" or user="mysqltest_3"; +delete from mysql.tables_priv where user='mysqltest_1' or user="mysqltest_2" or user="mysqltest_3"; +delete from mysql.columns_priv where user='mysqltest_1' or user="mysqltest_2" or user="mysqltest_3"; +flush privileges; +drop table t1; + +# +# Test some error conditions +# +begin; +--error 1221 +GRANT FILE on mysqltest.* to mysqltest_1@localhost; +commit; +select 1; -- To test that the previous command didn't cause problems + +# +# Bug#6123: GRANT USAGE inserts useless Db row +# +create database mysqltest1; +begin; +grant usage on mysqltest1.* to test6123 identified by 'magic123'; +commit; +select host,db,user,select_priv,insert_priv from mysql.db where db="mysqltest1"; +delete from mysql.user where user='test6123'; +drop database mysqltest1; + +# +# Test for 'drop user', 'revoke privileges, grant' +# + +create table t1 (a int); +begin; +grant ALL PRIVILEGES on *.* to drop_user2@localhost with GRANT OPTION; +commit; +show grants for drop_user2@localhost; +begin; +revoke all privileges, grant option from drop_user2@localhost; +commit; +drop user drop_user2@localhost; + +begin; +grant ALL PRIVILEGES on *.* to drop_user@localhost with GRANT OPTION; +grant ALL PRIVILEGES on test.* to drop_user@localhost with GRANT OPTION; +grant select(a) on test.t1 to drop_user@localhost; +commit; +show grants for drop_user@localhost; + +# +# Bug3086 +# +set sql_mode=ansi_quotes; +show grants for drop_user@localhost; +set sql_mode=default; + +set sql_quote_show_create=0; +show grants for drop_user@localhost; +set sql_mode="ansi_quotes"; +show grants for drop_user@localhost; +set sql_quote_show_create=1; +show grants for drop_user@localhost; +set sql_mode=""; +show grants for drop_user@localhost; + +revoke all privileges, grant option from drop_user@localhost; +show grants for drop_user@localhost; +drop user drop_user@localhost; +begin; +--error 1269 +revoke all privileges, grant option from drop_user@localhost; +commit; + +begin; +grant select(a) on test.t1 to drop_user1@localhost; +commit; +flush privileges; +begin; +grant select on test.t1 to drop_user2@localhost; +grant select on test.* to drop_user3@localhost; +grant select on *.* to drop_user4@localhost; +commit; +--error 1268 +drop user drop_user1@localhost, drop_user2@localhost, drop_user3@localhost, +drop_user4@localhost; +begin; +revoke all privileges, grant option from drop_user1@localhost, drop_user2@localhost, +drop_user3@localhost, drop_user4@localhost; +commit; +drop user drop_user1@localhost, drop_user2@localhost, drop_user3@localhost, +drop_user4@localhost; +drop table t1; +begin; +grant usage on *.* to mysqltest_1@localhost identified by "password"; +grant select, update, insert on test.* to mysqltest@localhost; +commit; +show grants for mysqltest_1@localhost; +drop user mysqltest_1@localhost; + +# +# Bug #3403 Wrong encodin in SHOW GRANTS output +# +SET NAMES koi8r; +CREATE DATABASE ÂÄ; +USE ÂÄ; +CREATE TABLE ÔÁÂ (ËÏÌ int); + +begin; +GRANT SELECT ON ÂÄ.* TO ÀÚÅÒ@localhost; +commit; +SHOW GRANTS FOR ÀÚÅÒ@localhost; +begin; +REVOKE SELECT ON ÂÄ.* FROM ÀÚÅÒ@localhost; +commit; + +begin; +GRANT SELECT ON ÂÄ.ÔÁÂ TO ÀÚÅÒ@localhost; +commit; +SHOW GRANTS FOR ÀÚÅÒ@localhost; +begin; +REVOKE SELECT ON ÂÄ.ÔÁÂ FROM ÀÚÅÒ@localhost; +commit; + +begin; +GRANT SELECT (ËÏÌ) ON ÂÄ.ÔÁÂ TO ÀÚÅÒ@localhost; +commit; +SHOW GRANTS FOR ÀÚÅÒ@localhost; +begin; +REVOKE SELECT (ËÏÌ) ON ÂÄ.ÔÁÂ FROM ÀÚÅÒ@localhost; +commit; + +DROP DATABASE ÂÄ; +SET NAMES latin1; + +# +# Bug #5831: REVOKE ALL PRIVILEGES, GRANT OPTION does not revoke everything +# +USE test; +CREATE TABLE t1 (a int ); +CREATE TABLE t2 LIKE t1; +CREATE TABLE t3 LIKE t1; +CREATE TABLE t4 LIKE t1; +CREATE TABLE t5 LIKE t1; +CREATE TABLE t6 LIKE t1; +CREATE TABLE t7 LIKE t1; +CREATE TABLE t8 LIKE t1; +CREATE TABLE t9 LIKE t1; +CREATE TABLE t10 LIKE t1; +CREATE DATABASE testdb1; +CREATE DATABASE testdb2; +CREATE DATABASE testdb3; +CREATE DATABASE testdb4; +CREATE DATABASE testdb5; +CREATE DATABASE testdb6; +CREATE DATABASE testdb7; +CREATE DATABASE testdb8; +CREATE DATABASE testdb9; +CREATE DATABASE testdb10; +begin; +GRANT ALL ON testdb1.* TO testuser@localhost; +GRANT ALL ON testdb2.* TO testuser@localhost; +GRANT ALL ON testdb3.* TO testuser@localhost; +GRANT ALL ON testdb4.* TO testuser@localhost; +GRANT ALL ON testdb5.* TO testuser@localhost; +GRANT ALL ON testdb6.* TO testuser@localhost; +GRANT ALL ON testdb7.* TO testuser@localhost; +GRANT ALL ON testdb8.* TO testuser@localhost; +GRANT ALL ON testdb9.* TO testuser@localhost; +GRANT ALL ON testdb10.* TO testuser@localhost; +GRANT SELECT ON test.t1 TO testuser@localhost; +GRANT SELECT ON test.t2 TO testuser@localhost; +GRANT SELECT ON test.t3 TO testuser@localhost; +GRANT SELECT ON test.t4 TO testuser@localhost; +GRANT SELECT ON test.t5 TO testuser@localhost; +GRANT SELECT ON test.t6 TO testuser@localhost; +GRANT SELECT ON test.t7 TO testuser@localhost; +GRANT SELECT ON test.t8 TO testuser@localhost; +GRANT SELECT ON test.t9 TO testuser@localhost; +GRANT SELECT ON test.t10 TO testuser@localhost; +GRANT SELECT (a) ON test.t1 TO testuser@localhost; +GRANT SELECT (a) ON test.t2 TO testuser@localhost; +GRANT SELECT (a) ON test.t3 TO testuser@localhost; +GRANT SELECT (a) ON test.t4 TO testuser@localhost; +GRANT SELECT (a) ON test.t5 TO testuser@localhost; +GRANT SELECT (a) ON test.t6 TO testuser@localhost; +GRANT SELECT (a) ON test.t7 TO testuser@localhost; +GRANT SELECT (a) ON test.t8 TO testuser@localhost; +GRANT SELECT (a) ON test.t9 TO testuser@localhost; +GRANT SELECT (a) ON test.t10 TO testuser@localhost; +commit; +begin; +REVOKE ALL PRIVILEGES, GRANT OPTION FROM testuser@localhost; +commit; +SHOW GRANTS FOR testuser@localhost; +DROP USER testuser@localhost; +DROP TABLE t1,t2,t3,t4,t5,t6,t7,t8,t9,t10; +DROP DATABASE testdb1; +DROP DATABASE testdb2; +DROP DATABASE testdb3; +DROP DATABASE testdb4; +DROP DATABASE testdb5; +DROP DATABASE testdb6; +DROP DATABASE testdb7; +DROP DATABASE testdb8; +DROP DATABASE testdb9; +DROP DATABASE testdb10; + +# +# Alter mysql system tables back to myisam +# +use mysql; +alter table columns_priv engine=myisam; +alter table db engine=myisam; +alter table func engine=myisam; +alter table help_category engine=myisam; +alter table help_keyword engine=myisam; +alter table help_relation engine=myisam; +alter table help_topic engine=myisam; +alter table host engine=myisam; +alter table tables_priv engine=myisam; +alter table time_zone engine=myisam; +alter table time_zone_leap_second engine=myisam; +alter table time_zone_name engine=myisam; +alter table time_zone_transition engine=myisam; +alter table time_zone_transition_type engine=myisam; +alter table user engine=myisam; +use test; +flush privileges; From d6407c760e753fb53bfaa1ad5b3174d424edffd9 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 19 Nov 2004 09:27:16 +0000 Subject: [PATCH 0270/1063] ha_ndbcluster.cc: merge error sql/ha_ndbcluster.cc: merge error --- sql/ha_ndbcluster.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index fd8660b29d2..bec4dfd9401 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -107,7 +107,7 @@ static const err_code_mapping err_map[]= { { 626, HA_ERR_KEY_NOT_FOUND, 0 }, { 630, HA_ERR_FOUND_DUPP_KEY, 0 }, - { 893, HA_ERR_FOUND_DUPP_UNIQUE, 0 }, + { 893, HA_ERR_FOUND_DUPP_KEY, 0 }, { 721, HA_ERR_TABLE_EXIST, 1 }, { 4244, HA_ERR_TABLE_EXIST, 1 }, From b140e465f442f13483102582fa40deecfbc5fcec Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 19 Nov 2004 09:35:12 +0000 Subject: [PATCH 0271/1063] added to ignore list BitKeeper/etc/ignore: added ../ndb/tools/ndb_restore --- .bzrignore | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.bzrignore b/.bzrignore index e794d7d51cc..f98e9f7e6b6 100644 --- a/.bzrignore +++ b/.bzrignore @@ -924,3 +924,18 @@ Docs/Images/mydsn.txt Docs/Images/myflowchart.txt mysql-test/mysql_test_run_new ndb/tools/ndb_test_platform +help +ndbcluster-1186 +ndbcluster-1186/SCCS +ndbcluster-1186/config.ini +ndbcluster-1186/ndb_1.pid +ndbcluster-1186/ndb_1_out.log +ndbcluster-1186/ndb_1_signal.log +ndbcluster-1186/ndb_2.pid +ndbcluster-1186/ndb_2_out.log +ndbcluster-1186/ndb_2_signal.log +ndbcluster-1186/ndb_3.pid +ndbcluster-1186/ndb_3_cluster.log +ndbcluster-1186/ndb_3_out.log +ndbcluster-1186/ndbcluster.pid +../ndb/tools/ndb_restore From ac9891722a5bfe26ab268ec6e33d91befc80f016 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 19 Nov 2004 09:38:41 +0000 Subject: [PATCH 0272/1063] ignore fix --- .bzrignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.bzrignore b/.bzrignore index f98e9f7e6b6..670d46db613 100644 --- a/.bzrignore +++ b/.bzrignore @@ -938,4 +938,4 @@ ndbcluster-1186/ndb_3.pid ndbcluster-1186/ndb_3_cluster.log ndbcluster-1186/ndb_3_out.log ndbcluster-1186/ndbcluster.pid -../ndb/tools/ndb_restore +ndb/tools/ndb_restore From e136b462502804bb7345e5a65ee253228ff4d4ca Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 19 Nov 2004 14:25:25 +0400 Subject: [PATCH 0273/1063] Incorrect response with partial utf8 index strings/ctype-mb.c: Incorrect response with partial utf8 index: Fill the max string with max_sort_char up to res_length bytes. strings/ctype-uca.c: Incorrect response with partial utf8 index. Typo fixes for UTF8 collations. --- mysql-test/include/ctype_common.inc | 56 +++++++++++++++++++++ mysql-test/r/ctype_uca.result | 57 ++++++++++++++++++++++ mysql-test/t/ctype_uca.test | 4 ++ strings/ctype-mb.c | 75 +++++++++++++++++------------ strings/ctype-uca.c | 32 ++++++------ 5 files changed, 178 insertions(+), 46 deletions(-) create mode 100644 mysql-test/include/ctype_common.inc diff --git a/mysql-test/include/ctype_common.inc b/mysql-test/include/ctype_common.inc new file mode 100644 index 00000000000..77937bdb854 --- /dev/null +++ b/mysql-test/include/ctype_common.inc @@ -0,0 +1,56 @@ +# +# Common tests for all character sets and collations. +# Include this file from a test with @test_characrer_set +# and @test_collation set to desired values. +# +# Please don't use SHOW CREATE TABLE in this file, +# we want it to be HANDLER independent. You can +# use SHOW FULL COLUMNS instead. +# +# Please surround all CREATE TABLE with --disable_warnings +# and --enable_warnings to be able to set storage_engine +# without having to check if the hanlder exists. + +SET @safe_character_set_server= @@character_set_server; +SET @safe_collation_server= @@collation_server; +SET character_set_server= @test_character_set; +SET collation_server= @test_collation; +CREATE DATABASE d1; +USE d1; + +# +# Bug 1883: LIKE did not work in some cases with a key. +# +--disable_warnings +CREATE TABLE t1 (c CHAR(10), KEY(c)); +--enable_warnings +# check the column was created with the expected charset/collation +SHOW FULL COLUMNS FROM t1; +INSERT INTO t1 VALUES ('aaa'),('aaaa'),('aaaaa'); +SELECT c as want3results FROM t1 WHERE c LIKE 'aaa%'; +DROP TABLE t1; + +# +# Bug 6643 incorrect response with partial utf8 index +# +--disable_warnings +CREATE TABLE t1 (c1 varchar(15), KEY c1 (c1(2))); +--enable_warnings +# check the column was created with the expected charset/collation +SHOW FULL COLUMNS FROM t1; +INSERT INTO t1 VALUES ('location'),('loberge'),('lotre'),('boabab'); +SELECT c1 as want3results from t1 where c1 like 'l%'; +SELECT c1 as want3results from t1 where c1 like 'lo%'; +SELECT c1 as want1result from t1 where c1 like 'loc%'; +SELECT c1 as want1result from t1 where c1 like 'loca%'; +SELECT c1 as want1result from t1 where c1 like 'locat%'; +SELECT c1 as want1result from t1 where c1 like 'locati%'; +SELECT c1 as want1result from t1 where c1 like 'locatio%'; +SELECT c1 as want1result from t1 where c1 like 'location%'; +DROP TABLE t1; + +DROP DATABASE d1; +# Restore settings +USE test; +SET character_set_server= @safe_character_set_server; +SET collation_server= @safe_collation_server; diff --git a/mysql-test/r/ctype_uca.result b/mysql-test/r/ctype_uca.result index 90681795513..7620b18eea6 100644 --- a/mysql-test/r/ctype_uca.result +++ b/mysql-test/r/ctype_uca.result @@ -2315,3 +2315,60 @@ HEX(CONVERT(col1 USING ucs2)) 064A06A9062F064A06AF0631 064A06A9064A DROP TABLE t1; +SET @test_character_set= 'utf8'; +SET @test_collation= 'utf8_swedish_ci'; +SET @safe_character_set_server= @@character_set_server; +SET @safe_collation_server= @@collation_server; +SET character_set_server= @test_character_set; +SET collation_server= @test_collation; +CREATE DATABASE d1; +USE d1; +CREATE TABLE t1 (c CHAR(10), KEY(c)); +SHOW FULL COLUMNS FROM t1; +Field Type Collation Null Key Default Extra Privileges Comment +c char(10) utf8_swedish_ci YES MUL NULL select,insert,update,references +INSERT INTO t1 VALUES ('aaa'),('aaaa'),('aaaaa'); +SELECT c as want3results FROM t1 WHERE c LIKE 'aaa%'; +want3results +aaa +aaaa +aaaaa +DROP TABLE t1; +CREATE TABLE t1 (c1 varchar(15), KEY c1 (c1(2))); +SHOW FULL COLUMNS FROM t1; +Field Type Collation Null Key Default Extra Privileges Comment +c1 varchar(15) utf8_swedish_ci YES MUL NULL select,insert,update,references +INSERT INTO t1 VALUES ('location'),('loberge'),('lotre'),('boabab'); +SELECT c1 as want3results from t1 where c1 like 'l%'; +want3results +location +loberge +lotre +SELECT c1 as want3results from t1 where c1 like 'lo%'; +want3results +location +loberge +lotre +SELECT c1 as want1result from t1 where c1 like 'loc%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'loca%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'locat%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'locati%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'locatio%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'location%'; +want1result +location +DROP TABLE t1; +DROP DATABASE d1; +USE test; +SET character_set_server= @safe_character_set_server; +SET collation_server= @safe_collation_server; diff --git a/mysql-test/t/ctype_uca.test b/mysql-test/t/ctype_uca.test index 708a31d637e..e640e6b53dc 100644 --- a/mysql-test/t/ctype_uca.test +++ b/mysql-test/t/ctype_uca.test @@ -435,3 +435,7 @@ INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06280648062F0646062F USING utf8)); INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06450647064506270646 USING utf8)); SELECT HEX(CONVERT(col1 USING ucs2)) FROM t1 ORDER BY col1 COLLATE utf8_persian_ci, col1 COLLATE utf8_bin; DROP TABLE t1; + +SET @test_character_set= 'utf8'; +SET @test_collation= 'utf8_swedish_ci'; +-- source include/ctype_common.inc diff --git a/strings/ctype-mb.c b/strings/ctype-mb.c index 7d81766c4cb..3cdf7f460cd 100644 --- a/strings/ctype-mb.c +++ b/strings/ctype-mb.c @@ -443,6 +443,37 @@ static void my_hash_sort_mb_bin(CHARSET_INFO *cs __attribute__((unused)), } } + +/* + Write max key: create a buffer with multibyte + representation of the max_sort_char character, + and copy it into max_str in a loop. +*/ +static void pad_max_char(CHARSET_INFO *cs, char *str, char *end) +{ + char buf[10]; + char buflen= cs->cset->wc_mb(cs, cs->max_sort_char, (uchar*) buf, + (uchar*) buf + sizeof(buf)); + DBUG_ASSERT(buflen > 0); + do + { + if ((str + buflen) < end) + { + /* Enough space for the characer */ + memcpy(str, buf, buflen); + str+= buflen; + } + else + { + /* + There is no space for whole multibyte + character, then add trailing spaces. + */ + *str++= ' '; + } + } while (str < end); +} + /* ** Calculate min_str and max_str that ranges a LIKE string. ** Arguments: @@ -467,10 +498,15 @@ my_bool my_like_range_mb(CHARSET_INFO *cs, char *min_str,char *max_str, uint *min_length,uint *max_length) { - const char *end=ptr+ptr_length; - char *min_org=min_str; - char *min_end=min_str+res_length; - char *max_end=max_str+res_length; + const char *end; + char *min_org= min_str; + char *min_end= min_str + res_length; + char *max_end= max_str + res_length; + uint charlen= my_charpos(cs, ptr, ptr+ptr_length, res_length/cs->mbmaxlen); + + if (charlen < ptr_length) + ptr_length= charlen; + end= ptr + ptr_length; for (; ptr != end && min_str != min_end ; ptr++) { @@ -482,16 +518,14 @@ my_bool my_like_range_mb(CHARSET_INFO *cs, } if (*ptr == w_one || *ptr == w_many) /* '_' and '%' in SQL */ { - char buf[10]; - uint buflen; - uint charlen= my_charpos(cs, min_org, min_str, res_length/cs->mbmaxlen); + charlen= my_charpos(cs, min_org, min_str, res_length/cs->mbmaxlen); if (charlen < (uint) (min_str - min_org)) min_str= min_org + charlen; /* Write min key */ *min_length= (uint) (min_str - min_org); - *max_length=res_length; + *max_length= res_length; do { *min_str++= (char) cs->min_sort_char; @@ -502,27 +536,7 @@ my_bool my_like_range_mb(CHARSET_INFO *cs, representation of the max_sort_char character, and copy it into max_str in a loop. */ - buflen= cs->cset->wc_mb(cs, cs->max_sort_char, (uchar*) buf, - (uchar*) buf + sizeof(buf)); - DBUG_ASSERT(buflen > 0); - do - { - if ((max_str + buflen) <= max_end) - { - /* Enough space for max characer */ - memcpy(max_str, buf, buflen); - max_str+= buflen; - } - else - { - /* - There is no space for whole multibyte - character, then add trailing spaces. - */ - - *max_str++= ' '; - } - } while (max_str != max_end); + pad_max_char(cs, max_str, max_end); return 0; } *min_str++= *max_str++ = *ptr; @@ -530,7 +544,8 @@ my_bool my_like_range_mb(CHARSET_INFO *cs, *min_length= *max_length = (uint) (min_str - min_org); while (min_str != min_end) - *min_str++ = *max_str++ = ' '; /* Because if key compression */ + *min_str++= ' '; /* Because if key compression */ + pad_max_char(cs, max_str, max_end); return 0; } diff --git a/strings/ctype-uca.c b/strings/ctype-uca.c index 91af7af0c54..8df5b3277c1 100644 --- a/strings/ctype-uca.c +++ b/strings/ctype-uca.c @@ -8567,7 +8567,7 @@ CHARSET_INFO my_charset_utf8_icelandic_uca_ci= NULL, /* ident_map */ 8, /* strxfrm_multiply */ 1, /* mbminlen */ - 2, /* mbmaxlen */ + 3, /* mbmaxlen */ 9, /* min_sort_char */ 0xFFFF, /* max_sort_char */ &my_charset_utf8_handler, @@ -8594,7 +8594,7 @@ CHARSET_INFO my_charset_utf8_latvian_uca_ci= NULL, /* ident_map */ 8, /* strxfrm_multiply */ 1, /* mbminlen */ - 2, /* mbmaxlen */ + 3, /* mbmaxlen */ 9, /* min_sort_char */ 0xFFFF, /* max_sort_char */ &my_charset_utf8_handler, @@ -8621,7 +8621,7 @@ CHARSET_INFO my_charset_utf8_romanian_uca_ci= NULL, /* ident_map */ 8, /* strxfrm_multiply */ 1, /* mbminlen */ - 2, /* mbmaxlen */ + 3, /* mbmaxlen */ 9, /* min_sort_char */ 0xFFFF, /* max_sort_char */ &my_charset_utf8_handler, @@ -8648,7 +8648,7 @@ CHARSET_INFO my_charset_utf8_slovenian_uca_ci= NULL, /* ident_map */ 8, /* strxfrm_multiply */ 1, /* mbminlen */ - 2, /* mbmaxlen */ + 3, /* mbmaxlen */ 9, /* min_sort_char */ 0xFFFF, /* max_sort_char */ &my_charset_utf8_handler, @@ -8675,7 +8675,7 @@ CHARSET_INFO my_charset_utf8_polish_uca_ci= NULL, /* ident_map */ 8, /* strxfrm_multiply */ 1, /* mbminlen */ - 2, /* mbmaxlen */ + 3, /* mbmaxlen */ 9, /* min_sort_char */ 0xFFFF, /* max_sort_char */ &my_charset_utf8_handler, @@ -8702,7 +8702,7 @@ CHARSET_INFO my_charset_utf8_estonian_uca_ci= NULL, /* ident_map */ 8, /* strxfrm_multiply */ 1, /* mbminlen */ - 2, /* mbmaxlen */ + 3, /* mbmaxlen */ 9, /* min_sort_char */ 0xFFFF, /* max_sort_char */ &my_charset_utf8_handler, @@ -8729,7 +8729,7 @@ CHARSET_INFO my_charset_utf8_spanish_uca_ci= NULL, /* ident_map */ 8, /* strxfrm_multiply */ 1, /* mbminlen */ - 2, /* mbmaxlen */ + 3, /* mbmaxlen */ 9, /* min_sort_char */ 0xFFFF, /* max_sort_char */ &my_charset_utf8_handler, @@ -8756,7 +8756,7 @@ CHARSET_INFO my_charset_utf8_swedish_uca_ci= NULL, /* ident_map */ 8, /* strxfrm_multiply */ 1, /* mbminlen */ - 2, /* mbmaxlen */ + 3, /* mbmaxlen */ 9, /* min_sort_char */ 0xFFFF, /* max_sort_char */ &my_charset_utf8_handler, @@ -8783,7 +8783,7 @@ CHARSET_INFO my_charset_utf8_turkish_uca_ci= NULL, /* ident_map */ 8, /* strxfrm_multiply */ 1, /* mbminlen */ - 2, /* mbmaxlen */ + 3, /* mbmaxlen */ 9, /* min_sort_char */ 0xFFFF, /* max_sort_char */ &my_charset_utf8_handler, @@ -8810,7 +8810,7 @@ CHARSET_INFO my_charset_utf8_czech_uca_ci= NULL, /* ident_map */ 8, /* strxfrm_multiply */ 1, /* mbminlen */ - 2, /* mbmaxlen */ + 3, /* mbmaxlen */ 9, /* min_sort_char */ 0xFFFF, /* max_sort_char */ &my_charset_utf8_handler, @@ -8838,7 +8838,7 @@ CHARSET_INFO my_charset_utf8_danish_uca_ci= NULL, /* ident_map */ 8, /* strxfrm_multiply */ 1, /* mbminlen */ - 2, /* mbmaxlen */ + 3, /* mbmaxlen */ 9, /* min_sort_char */ 0xFFFF, /* max_sort_char */ &my_charset_utf8_handler, @@ -8865,7 +8865,7 @@ CHARSET_INFO my_charset_utf8_lithuanian_uca_ci= NULL, /* ident_map */ 8, /* strxfrm_multiply */ 1, /* mbminlen */ - 2, /* mbmaxlen */ + 3, /* mbmaxlen */ 9, /* min_sort_char */ 0xFFFF, /* max_sort_char */ &my_charset_utf8_handler, @@ -8892,7 +8892,7 @@ CHARSET_INFO my_charset_utf8_slovak_uca_ci= NULL, /* ident_map */ 8, /* strxfrm_multiply */ 1, /* mbminlen */ - 2, /* mbmaxlen */ + 3, /* mbmaxlen */ 9, /* min_sort_char */ 0xFFFF, /* max_sort_char */ &my_charset_utf8_handler, @@ -8919,7 +8919,7 @@ CHARSET_INFO my_charset_utf8_spanish2_uca_ci= NULL, /* ident_map */ 8, /* strxfrm_multiply */ 1, /* mbminlen */ - 2, /* mbmaxlen */ + 3, /* mbmaxlen */ 9, /* min_sort_char */ 0xFFFF, /* max_sort_char */ &my_charset_utf8_handler, @@ -8946,7 +8946,7 @@ CHARSET_INFO my_charset_utf8_roman_uca_ci= NULL, /* ident_map */ 8, /* strxfrm_multiply */ 1, /* mbminlen */ - 2, /* mbmaxlen */ + 3, /* mbmaxlen */ 9, /* min_sort_char */ 0xFFFF, /* max_sort_char */ &my_charset_utf8_handler, @@ -8973,7 +8973,7 @@ CHARSET_INFO my_charset_utf8_persian_uca_ci= NULL, /* ident_map */ 8, /* strxfrm_multiply */ 1, /* mbminlen */ - 2, /* mbmaxlen */ + 3, /* mbmaxlen */ 9, /* min_sort_char */ 0xFFFF, /* max_sort_char */ &my_charset_utf8_handler, From c3211458aca33f32e1849b4309d22aa6d8e5b184 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 19 Nov 2004 11:31:20 +0100 Subject: [PATCH 0274/1063] wl2077 - ndb scan optimizations ndb/src/kernel/blocks/dbdih/Dbdih.hpp: remove unused variable ndb/src/kernel/blocks/dbdih/DbdihMain.cpp: Always supply all nodes ndb/src/kernel/blocks/dbtc/DbtcMain.cpp: Enable scanning of backup fragments when read committed ndb/test/ndbapi/testReadPerf.cpp: Better printout --- ndb/src/kernel/blocks/dbdih/Dbdih.hpp | 1 - ndb/src/kernel/blocks/dbdih/DbdihMain.cpp | 20 +++++++++----------- ndb/src/kernel/blocks/dbtc/DbtcMain.cpp | 14 ++++++++++++++ ndb/test/ndbapi/testReadPerf.cpp | 11 +++++++++-- 4 files changed, 32 insertions(+), 14 deletions(-) diff --git a/ndb/src/kernel/blocks/dbdih/Dbdih.hpp b/ndb/src/kernel/blocks/dbdih/Dbdih.hpp index 14fa262f871..0a2d50cb876 100644 --- a/ndb/src/kernel/blocks/dbdih/Dbdih.hpp +++ b/ndb/src/kernel/blocks/dbdih/Dbdih.hpp @@ -147,7 +147,6 @@ public: Uint32 nfConnect; Uint32 table; Uint32 userpointer; - Uint32 nodeCount; BlockReference userblockref; }; typedef Ptr ConnectRecordPtr; diff --git a/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp b/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp index 76aa745c3e0..4592b121c7e 100644 --- a/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp +++ b/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp @@ -7080,24 +7080,22 @@ void Dbdih::execDIGETPRIMREQ(Signal* signal) ndbrequire(tabPtr.p->tabStatus == TabRecord::TS_ACTIVE); connectPtr.i = signal->theData[0]; - if(connectPtr.i != RNIL){ + if(connectPtr.i != RNIL) + { jam(); ptrCheckGuard(connectPtr, cconnectFileSize, connectRecord); - ndbrequire(connectPtr.p->connectState == ConnectRecord::INUSE); - getFragstore(tabPtr.p, fragId, fragPtr); - connectPtr.p->nodeCount = extractNodeInfo(fragPtr.p, connectPtr.p->nodes); signal->theData[0] = connectPtr.p->userpointer; - signal->theData[1] = passThrough; - signal->theData[2] = connectPtr.p->nodes[0]; - sendSignal(connectPtr.p->userblockref, GSN_DIGETPRIMCONF, signal, 3, JBB); - return; - }//if - //connectPtr.i == RNIL -> question without connect record + } + else + { + jam(); + signal->theData[0] = RNIL; + } + Uint32 nodes[MAX_REPLICAS]; getFragstore(tabPtr.p, fragId, fragPtr); Uint32 count = extractNodeInfo(fragPtr.p, nodes); - signal->theData[0] = RNIL; signal->theData[1] = passThrough; signal->theData[2] = nodes[0]; signal->theData[3] = nodes[1]; diff --git a/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp b/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp index c7f467484bd..8c663b42cbe 100644 --- a/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp +++ b/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp @@ -8944,6 +8944,20 @@ void Dbtc::execDIGETPRIMCONF(Signal* signal) scanptr.i = scanFragptr.p->scanRec; ptrCheckGuard(scanptr, cscanrecFileSize, scanRecord); + if(ScanFragReq::getReadCommittedFlag(scanptr.p->scanRequestInfo)) + { + jam(); + Uint32 max = 3+signal->theData[6]; + Uint32 nodeid = getOwnNodeId(); + for(Uint32 i = 3; itheData[i] == nodeid) + { + jam(); + tnodeid = nodeid; + break; + } + } + { /** * Check table diff --git a/ndb/test/ndbapi/testReadPerf.cpp b/ndb/test/ndbapi/testReadPerf.cpp index 380a809ad00..3adcb5a2d9b 100644 --- a/ndb/test/ndbapi/testReadPerf.cpp +++ b/ndb/test/ndbapi/testReadPerf.cpp @@ -391,8 +391,15 @@ run_read(){ void print_result(){ + int tmp = 1; + tmp *= g_paramters[P_RANGE].value; + tmp *= g_paramters[P_LOOPS].value; + + int t, t2; for(int i = 0; i Date: Fri, 19 Nov 2004 14:33:55 +0400 Subject: [PATCH 0275/1063] Reuse ctype_common.inc instead of retyping the same queries. --- mysql-test/r/ctype_big5.result | 56 +++++++++++++++++++++++++++++++--- mysql-test/t/ctype_big5.test | 12 ++------ 2 files changed, 55 insertions(+), 13 deletions(-) diff --git a/mysql-test/r/ctype_big5.result b/mysql-test/r/ctype_big5.result index 44fad0cd96a..789b6e586ad 100644 --- a/mysql-test/r/ctype_big5.result +++ b/mysql-test/r/ctype_big5.result @@ -1,10 +1,58 @@ drop table if exists t1; -SET NAMES big5; -CREATE TABLE t1 (c CHAR(10) CHARACTER SET big5, KEY(c)); +SET @test_character_set= 'big5'; +SET @test_collation= 'big5_chinese_ci'; +SET @safe_character_set_server= @@character_set_server; +SET @safe_collation_server= @@collation_server; +SET character_set_server= @test_character_set; +SET collation_server= @test_collation; +CREATE DATABASE d1; +USE d1; +CREATE TABLE t1 (c CHAR(10), KEY(c)); +SHOW FULL COLUMNS FROM t1; +Field Type Collation Null Key Default Extra Privileges Comment +c char(10) big5_chinese_ci YES MUL NULL select,insert,update,references INSERT INTO t1 VALUES ('aaa'),('aaaa'),('aaaaa'); -SELECT * FROM t1 WHERE c LIKE 'aaa%'; -c +SELECT c as want3results FROM t1 WHERE c LIKE 'aaa%'; +want3results aaa aaaa aaaaa DROP TABLE t1; +CREATE TABLE t1 (c1 varchar(15), KEY c1 (c1(2))); +SHOW FULL COLUMNS FROM t1; +Field Type Collation Null Key Default Extra Privileges Comment +c1 varchar(15) big5_chinese_ci YES MUL NULL select,insert,update,references +INSERT INTO t1 VALUES ('location'),('loberge'),('lotre'),('boabab'); +SELECT c1 as want3results from t1 where c1 like 'l%'; +want3results +location +loberge +lotre +SELECT c1 as want3results from t1 where c1 like 'lo%'; +want3results +location +loberge +lotre +SELECT c1 as want1result from t1 where c1 like 'loc%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'loca%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'locat%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'locati%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'locatio%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'location%'; +want1result +location +DROP TABLE t1; +DROP DATABASE d1; +USE test; +SET character_set_server= @safe_character_set_server; +SET collation_server= @safe_collation_server; diff --git a/mysql-test/t/ctype_big5.test b/mysql-test/t/ctype_big5.test index 9bf1808636e..b1d71a6af15 100644 --- a/mysql-test/t/ctype_big5.test +++ b/mysql-test/t/ctype_big5.test @@ -7,12 +7,6 @@ drop table if exists t1; --enable_warnings -SET NAMES big5; - -# -# Bug 1883: LIKE did not work in some cases with a key. -# -CREATE TABLE t1 (c CHAR(10) CHARACTER SET big5, KEY(c)); -INSERT INTO t1 VALUES ('aaa'),('aaaa'),('aaaaa'); -SELECT * FROM t1 WHERE c LIKE 'aaa%'; -DROP TABLE t1; +SET @test_character_set= 'big5'; +SET @test_collation= 'big5_chinese_ci'; +-- source include/ctype_common.inc From 018cac958838511ae0fbed9441aa08c16bd3bd8c Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 19 Nov 2004 11:37:16 +0100 Subject: [PATCH 0276/1063] wl2077 - scan optimizations (recommit in clean clone) ndb/src/kernel/blocks/dbdih/Dbdih.hpp: removed unused variable ndb/src/kernel/blocks/dbdih/DbdihMain.cpp: Always give all nodes in DIGETPRIMREQ ndb/src/kernel/blocks/dbtc/DbtcMain.cpp: Allow readcommited-scans to scan backup fragments ndb/test/ndbapi/testReadPerf.cpp: better printous --- ndb/docs/wl2077.txt | 35 +++++++++++++++++++++++ ndb/src/kernel/blocks/dbdih/Dbdih.hpp | 1 - ndb/src/kernel/blocks/dbdih/DbdihMain.cpp | 20 ++++++------- ndb/src/kernel/blocks/dbtc/DbtcMain.cpp | 14 +++++++++ ndb/test/ndbapi/testReadPerf.cpp | 11 +++++-- 5 files changed, 67 insertions(+), 14 deletions(-) create mode 100644 ndb/docs/wl2077.txt diff --git a/ndb/docs/wl2077.txt b/ndb/docs/wl2077.txt new file mode 100644 index 00000000000..5a77c18aa2a --- /dev/null +++ b/ndb/docs/wl2077.txt @@ -0,0 +1,35 @@ + +100' * (select 1 from T1 (1M rows) where key = rand()); +1 host, 1 ndbd, api co-hosted +results in 1000 rows / sec + + wo/reset bounds w/ rb +4.1-read committed a) 4.9 b) 7.4 +4.1-read hold lock c) 4.7 d) 6.7 + +wl2077-read committed 6.4 (+30%) 10.8 (+45%) +wl2077-read hold lock 4.6 (-1%) 6.7 (+ 0%) + +-- Comparision e) +serial pk: 10.9' +batched (1000): 59' +serial uniq index: 8.4' +batched (1000): 33' +index range (1000): 186' + +---- + +load) testScanPerf -c 1 -d 1 T1 +a) testScanPerf -s 100000 -c 0 -d 0 -a 1 -l 0 -r 2 -q 0 T1 +b) testScanPerf -s 100000 -c 0 -d 0 -a 1 -l 0 -r 2 -q 1 T1 +c) testScanPerf -s 100000 -c 0 -d 0 -a 1 -l 1 -r 2 -q 0 T1 +d) testScanPerf -s 100000 -c 0 -d 0 -a 1 -l 1 -r 2 -q 1 T1 +e) testReadPerf -i 25 -c 0 -d 0 T1 + +--- music join 1db-co 2db-co + +4.1 13s 14s +4.1 wo/ blobs 1.7s 3.2s + +wl2077 12s 14s +wl2077 wo/ blobs 1.2s (-30%) 2.5s (-22%) diff --git a/ndb/src/kernel/blocks/dbdih/Dbdih.hpp b/ndb/src/kernel/blocks/dbdih/Dbdih.hpp index 14fa262f871..0a2d50cb876 100644 --- a/ndb/src/kernel/blocks/dbdih/Dbdih.hpp +++ b/ndb/src/kernel/blocks/dbdih/Dbdih.hpp @@ -147,7 +147,6 @@ public: Uint32 nfConnect; Uint32 table; Uint32 userpointer; - Uint32 nodeCount; BlockReference userblockref; }; typedef Ptr ConnectRecordPtr; diff --git a/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp b/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp index 76aa745c3e0..4592b121c7e 100644 --- a/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp +++ b/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp @@ -7080,24 +7080,22 @@ void Dbdih::execDIGETPRIMREQ(Signal* signal) ndbrequire(tabPtr.p->tabStatus == TabRecord::TS_ACTIVE); connectPtr.i = signal->theData[0]; - if(connectPtr.i != RNIL){ + if(connectPtr.i != RNIL) + { jam(); ptrCheckGuard(connectPtr, cconnectFileSize, connectRecord); - ndbrequire(connectPtr.p->connectState == ConnectRecord::INUSE); - getFragstore(tabPtr.p, fragId, fragPtr); - connectPtr.p->nodeCount = extractNodeInfo(fragPtr.p, connectPtr.p->nodes); signal->theData[0] = connectPtr.p->userpointer; - signal->theData[1] = passThrough; - signal->theData[2] = connectPtr.p->nodes[0]; - sendSignal(connectPtr.p->userblockref, GSN_DIGETPRIMCONF, signal, 3, JBB); - return; - }//if - //connectPtr.i == RNIL -> question without connect record + } + else + { + jam(); + signal->theData[0] = RNIL; + } + Uint32 nodes[MAX_REPLICAS]; getFragstore(tabPtr.p, fragId, fragPtr); Uint32 count = extractNodeInfo(fragPtr.p, nodes); - signal->theData[0] = RNIL; signal->theData[1] = passThrough; signal->theData[2] = nodes[0]; signal->theData[3] = nodes[1]; diff --git a/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp b/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp index c7f467484bd..8c663b42cbe 100644 --- a/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp +++ b/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp @@ -8944,6 +8944,20 @@ void Dbtc::execDIGETPRIMCONF(Signal* signal) scanptr.i = scanFragptr.p->scanRec; ptrCheckGuard(scanptr, cscanrecFileSize, scanRecord); + if(ScanFragReq::getReadCommittedFlag(scanptr.p->scanRequestInfo)) + { + jam(); + Uint32 max = 3+signal->theData[6]; + Uint32 nodeid = getOwnNodeId(); + for(Uint32 i = 3; itheData[i] == nodeid) + { + jam(); + tnodeid = nodeid; + break; + } + } + { /** * Check table diff --git a/ndb/test/ndbapi/testReadPerf.cpp b/ndb/test/ndbapi/testReadPerf.cpp index 8d0d78cbe8c..f8ecc6192dc 100644 --- a/ndb/test/ndbapi/testReadPerf.cpp +++ b/ndb/test/ndbapi/testReadPerf.cpp @@ -390,8 +390,15 @@ run_read(){ void print_result(){ + int tmp = 1; + tmp *= g_paramters[P_RANGE].value; + tmp *= g_paramters[P_LOOPS].value; + + int t, t2; for(int i = 0; i Date: Fri, 19 Nov 2004 11:19:27 +0000 Subject: [PATCH 0277/1063] fixed error messages for some error codes --- ndb/src/ndbapi/ndberror.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/ndb/src/ndbapi/ndberror.c b/ndb/src/ndbapi/ndberror.c index 1a0d8132d71..e08b80f2433 100644 --- a/ndb/src/ndbapi/ndberror.c +++ b/ndb/src/ndbapi/ndberror.c @@ -53,6 +53,9 @@ typedef struct ErrorBundle { #define NI ndberror_cl_function_not_implemented #define UE ndberror_cl_unknown_error_code +static const char REDO_BUFFER_MSG[]= +"REDO log buffers overloaded, consult online manual (increase RedoBuffer, and|or decrease TimeBetweenLocalCheckpoints, and|or increase NoOfFragmentLogFiles)"; + static const char* empty_string = ""; static @@ -137,9 +140,8 @@ ErrorBundle ErrorCodes[] = { { 805, TR, "Out of attrinfo records in tuple manager" }, { 830, TR, "Out of add fragment operation records" }, { 873, TR, "Out of attrinfo records for scan in tuple manager" }, - { 1217, TR, "1217" }, - { 1219, TR, "Out of operation records in local data manager (increase MaxNoOfLocalOperations)" }, - { 1220, TR, "1220" }, + { 1217, TR, "Out of operation records in local data manager (increase MaxNoOfLocalOperations)" }, + { 1220, TR, REDO_BUFFER_MSG }, { 1222, TR, "Out of transaction markers in LQH" }, { 4021, TR, "Out of Send Buffer space in NDB API" }, { 4022, TR, "Out of Send Buffer space in NDB API" }, @@ -165,14 +167,13 @@ ErrorBundle ErrorCodes[] = { { 297, TO, "Time-out in NDB, probably caused by deadlock" }, /* Scan trans timeout, temporary!! */ { 237, TO, "Transaction had timed out when trying to commit it" }, - /** * OverloadError */ - { 410, OL, "Out of log file space temporarily" }, + { 410, OL, REDO_BUFFER_MSG }, { 677, OL, "Index UNDO buffers overloaded (increase UndoIndexBuffer)" }, { 891, OL, "Data UNDO buffers overloaded (increase UndoDataBuffer)" }, - { 1221, OL, "REDO log buffers overloaded (increase RedoBuffer)" }, + { 1221, OL, REDO_BUFFER_MSG }, { 4006, OL, "Connect failure - out of connection objects (increase MaxNoOfConcurrentTransactions)" }, From eed2b972dec510b54b20a29006db0db8a093a439 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 19 Nov 2004 13:52:01 +0100 Subject: [PATCH 0278/1063] wl2077: ndb, disable scanning of backup fragments (temporary) --- ndb/src/kernel/blocks/dbtc/DbtcMain.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp b/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp index 8c663b42cbe..9af770db5b7 100644 --- a/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp +++ b/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp @@ -8944,7 +8944,12 @@ void Dbtc::execDIGETPRIMCONF(Signal* signal) scanptr.i = scanFragptr.p->scanRec; ptrCheckGuard(scanptr, cscanrecFileSize, scanRecord); - if(ScanFragReq::getReadCommittedFlag(scanptr.p->scanRequestInfo)) + /** + * This must be false as select count(*) otherwise + * can "pass" committing on backup fragments and + * get incorrect row count + */ + if(false && ScanFragReq::getReadCommittedFlag(scanptr.p->scanRequestInfo)) { jam(); Uint32 max = 3+signal->theData[6]; From f85b20aa7843d29d169bf4d0bca8288cbb9c113a Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 19 Nov 2004 13:52:21 +0000 Subject: [PATCH 0279/1063] set sizes array sizes correctly in ndb blocks configuration --- ndb/src/kernel/vm/Configuration.cpp | 36 ++++++++++++++++------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/ndb/src/kernel/vm/Configuration.cpp b/ndb/src/kernel/vm/Configuration.cpp index b3a436275f7..c2f47adff29 100644 --- a/ndb/src/kernel/vm/Configuration.cpp +++ b/ndb/src/kernel/vm/Configuration.cpp @@ -590,6 +590,23 @@ Configuration::calcSizeAlt(ConfigValues * ownConfig){ */ ConfigValuesFactory cfg(ownConfig); + Uint32 noOfMetaTables= noOfTables + noOfOrderedIndexes + + noOfUniqueHashIndexes; + if (noOfMetaTables > MAX_TABLES) + noOfMetaTables= MAX_TABLES; + + { + /** + * Dict Size Alt values + */ + cfg.put(CFG_DICT_ATTRIBUTE, + noOfAttributes); + + cfg.put(CFG_DICT_TABLE, + noOfMetaTables); + } + + if (noOfLocalScanRecords == 0) { noOfLocalScanRecords = (noOfDBNodes * noOfScanRecords) + 1; } @@ -599,7 +616,7 @@ Configuration::calcSizeAlt(ConfigValues * ownConfig){ Uint32 noOfTCScanRecords = noOfScanRecords; { - Uint32 noOfAccTables= noOfTables + noOfUniqueHashIndexes; + Uint32 noOfAccTables= noOfMetaTables/*noOfTables+noOfUniqueHashIndexes*/; /** * Acc Size Alt values */ @@ -641,19 +658,6 @@ Configuration::calcSizeAlt(ConfigValues * ownConfig){ cfg.put(CFG_ACC_SCAN, noOfLocalScanRecords); } - Uint32 noOfMetaTables= noOfTables + noOfOrderedIndexes + - noOfUniqueHashIndexes; - { - /** - * Dict Size Alt values - */ - cfg.put(CFG_DICT_ATTRIBUTE, - noOfAttributes); - - cfg.put(CFG_DICT_TABLE, - noOfMetaTables); - } - { /** * Dih Size Alt values @@ -758,9 +762,9 @@ Configuration::calcSizeAlt(ConfigValues * ownConfig){ * Tux Size Alt values */ cfg.put(CFG_TUX_INDEX, - noOfOrderedIndexes); + noOfMetaTables /*noOfOrderedIndexes*/); - cfg.put(CFG_TUX_FRAGMENT, + cfg.put(CFG_TUX_FRAGMENT, 2 * NO_OF_FRAG_PER_NODE * noOfOrderedIndexes * noOfReplicas); cfg.put(CFG_TUX_ATTRIBUTE, From 77c163c3e3bdfb884e96f89bfb90e277ecfc816e Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 19 Nov 2004 15:35:35 +0000 Subject: [PATCH 0280/1063] correct some linking problem --- acinclude.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/acinclude.m4 b/acinclude.m4 index 81917372206..58e24dcbc5e 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -1687,7 +1687,7 @@ AC_DEFUN([MYSQL_CHECK_NDBCLUSTER], [ ndbcluster_includes="-I../ndb/include -I../ndb/include/ndbapi" ndbcluster_libs="\$(top_builddir)/ndb/src/.libs/libndbclient.a" ndbcluster_system_libs="" - ndb_mgmclient_libs="\$(top_builddir)/ndb/src/mgmclient/libndbmgmclient.la" + ndb_mgmclient_libs="\$(top_builddir)/ndb/src/mgmclient/libndbmgmclient.la \$(top_builddir)/mysys/libmysys.a" MYSQL_CHECK_NDB_OPTIONS ;; * ) From aa6785d7a8a8c70ff9335bb4c875d3ae9db9db6a Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 19 Nov 2004 19:35:36 +0400 Subject: [PATCH 0281/1063] Bug #6658 MAX(column) returns incorrect coercibility Also, Item_sum_hybrid->charset was removed as redundant, and switched to use collation.collation instead. mysql-test/r/func_group.result: Bug #6658 MAX(column) returns incorrect coercibility mysql-test/r/func_str.result: Bug #6658 MAX(column) returns incorrect coercibility mysql-test/t/func_group.test: Bug #6658 MAX(column) returns incorrect coercibility sql/item_func.cc: Bug #6658 MAX(column) returns incorrect coercibility sql/item_sum.cc: Bug #6658 MAX(column) returns incorrect coercibility sql/item_sum.h: Bug #6658 MAX(column) returns incorrect coercibility --- mysql-test/r/func_group.result | 16 +++++++++++++++- mysql-test/r/func_str.result | 14 ++++++++++++++ mysql-test/t/func_group.test | 11 +++++++++++ sql/item_func.cc | 1 + sql/item_sum.cc | 9 +++------ sql/item_sum.h | 9 ++++----- 6 files changed, 48 insertions(+), 12 deletions(-) diff --git a/mysql-test/r/func_group.result b/mysql-test/r/func_group.result index c25f89d4df3..4bb79a1cb41 100644 --- a/mysql-test/r/func_group.result +++ b/mysql-test/r/func_group.result @@ -637,8 +637,22 @@ create table t1 (a char(10)); insert into t1 values ('a'),('b'),('c'); select coercibility(max(a)) from t1; coercibility(max(a)) -3 +2 drop table t1; +create table t1 (a char character set latin2); +insert into t1 values ('a'),('b'); +select charset(max(a)), coercibility(max(a)), +charset(min(a)), coercibility(min(a)) from t1; +charset(max(a)) coercibility(max(a)) charset(min(a)) coercibility(min(a)) +latin2 2 latin2 2 +create table t2 select max(a),min(a) from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `max(a)` char(1) character set latin2 default NULL, + `min(a)` char(1) character set latin2 default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t2,t1; create table t1 (a int); insert into t1 values (1); select max(a) as b from t1 having b=1; diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result index 8d49d55be39..083f85ee6fa 100644 --- a/mysql-test/r/func_str.result +++ b/mysql-test/r/func_str.result @@ -614,6 +614,20 @@ t1 CREATE TABLE `t1` ( `encode('abcd','ab')` binary(4) NOT NULL default '' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; +create table t1 (a char character set latin2); +insert into t1 values ('a'),('b'); +select charset(max(a)), coercibility(max(a)), +charset(min(a)), coercibility(min(a)) from t1; +charset(max(a)) coercibility(max(a)) charset(min(a)) coercibility(min(a)) +latin2 2 latin2 2 +create table t2 select max(a),min(a) from t1; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `max(a)` char(1) character set latin2 default NULL, + `min(a)` char(1) character set latin2 default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t2,t1; select SUBSTR('abcdefg',3,2); SUBSTR('abcdefg',3,2) cd diff --git a/mysql-test/t/func_group.test b/mysql-test/t/func_group.test index 8d8779e9d1b..79d6112e6de 100644 --- a/mysql-test/t/func_group.test +++ b/mysql-test/t/func_group.test @@ -383,6 +383,17 @@ insert into t1 values ('a'),('b'),('c'); select coercibility(max(a)) from t1; drop table t1; +# +# Bug #6658 MAX(column) returns incorrect coercibility +# +create table t1 (a char character set latin2); +insert into t1 values ('a'),('b'); +select charset(max(a)), coercibility(max(a)), + charset(min(a)), coercibility(min(a)) from t1; +create table t2 select max(a),min(a) from t1; +show create table t2; +drop table t2,t1; + # # aggregate functions on static tables # diff --git a/sql/item_func.cc b/sql/item_func.cc index c07e9f23ea2..3fb5bcd01c6 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -350,6 +350,7 @@ void Item_func::split_sum_func(THD *thd, Item **ref_pointer_array, { uint el= fields.elements; Item *new_item= new Item_ref(ref_pointer_array + el, 0, item->name); + new_item->collation.set(item->collation); fields.push_front(item); ref_pointer_array[el]= item; thd->change_item_tree(arg, new_item); diff --git a/sql/item_sum.cc b/sql/item_sum.cc index 3b3a6083725..c43a7d87f8f 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -218,16 +218,13 @@ Item_sum_hybrid::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref) hybrid_type= item->result_type(); if (hybrid_type == INT_RESULT) { - cmp_charset= &my_charset_bin; max_length=20; } else if (hybrid_type == REAL_RESULT) { - cmp_charset= &my_charset_bin; max_length=float_length(decimals); }else { - cmp_charset= item->collation.collation; max_length=item->max_length; } decimals=item->decimals; @@ -557,7 +554,7 @@ bool Item_sum_min::add() { String *result=args[0]->val_str(&tmp_value); if (!args[0]->null_value && - (null_value || sortcmp(&value,result,cmp_charset) > 0)) + (null_value || sortcmp(&value,result,collation.collation) > 0)) { value.copy(*result); null_value=0; @@ -610,7 +607,7 @@ bool Item_sum_max::add() { String *result=args[0]->val_str(&tmp_value); if (!args[0]->null_value && - (null_value || sortcmp(&value,result,cmp_charset) < 0)) + (null_value || sortcmp(&value,result,collation.collation) < 0)) { value.copy(*result); null_value=0; @@ -921,7 +918,7 @@ Item_sum_hybrid::min_max_update_str_field() result_field->val_str(&tmp_value); if (result_field->is_null() || - (cmp_sign * sortcmp(res_str,&tmp_value,cmp_charset)) < 0) + (cmp_sign * sortcmp(res_str,&tmp_value,collation.collation)) < 0) result_field->store(res_str->ptr(),res_str->length(),res_str->charset()); result_field->set_notnull(); } diff --git a/sql/item_sum.h b/sql/item_sum.h index 5aa0d37190b..f9c48304795 100644 --- a/sql/item_sum.h +++ b/sql/item_sum.h @@ -402,20 +402,19 @@ class Item_sum_hybrid :public Item_sum enum_field_types hybrid_field_type; int cmp_sign; table_map used_table_cache; - CHARSET_INFO *cmp_charset; public: Item_sum_hybrid(Item *item_par,int sign) :Item_sum(item_par), sum(0.0), sum_int(0), hybrid_type(INT_RESULT), hybrid_field_type(FIELD_TYPE_LONGLONG), - cmp_sign(sign), used_table_cache(~(table_map) 0), - cmp_charset(&my_charset_bin) - {} + cmp_sign(sign), used_table_cache(~(table_map) 0) + { collation.set(&my_charset_bin); } Item_sum_hybrid(THD *thd, Item_sum_hybrid *item): Item_sum(thd, item), value(item->value), sum(item->sum), sum_int(item->sum_int), hybrid_type(item->hybrid_type), hybrid_field_type(item->hybrid_field_type),cmp_sign(item->cmp_sign), - used_table_cache(item->used_table_cache), cmp_charset(item->cmp_charset) {} + used_table_cache(item->used_table_cache) + { collation.set(item->collation); } bool fix_fields(THD *, TABLE_LIST *, Item **); table_map used_tables() const { return used_table_cache; } bool const_item() const { return !used_table_cache; } From 716b401817b05e2bfebf11471e8a61740bff8a3e Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 19 Nov 2004 18:35:36 +0300 Subject: [PATCH 0282/1063] Added --disable-log-bin option to the mysqlbinlog (WL1787) BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted --- BitKeeper/etc/logging_ok | 1 + client/mysqlbinlog.cc | 17 ++++++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok index 1c1a3efc542..8fcec769a0c 100644 --- a/BitKeeper/etc/logging_ok +++ b/BitKeeper/etc/logging_ok @@ -163,6 +163,7 @@ pem@mysql.com peter@linux.local peter@mysql.com peterg@mysql.com +petr@mysql.com pgulutzan@linux.local ram@deer.(none) ram@gw.mysql.r18.ru diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index 8015871428e..de53831c43d 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -44,7 +44,7 @@ static const char *load_default_groups[]= { "mysqlbinlog","client",0 }; void sql_print_error(const char *format, ...); -static bool one_database=0, to_last_remote_log= 0; +static bool one_database=0, to_last_remote_log= 0, disable_log_bin= 0; static const char* database= 0; static my_bool force_opt= 0, short_form= 0, remote_opt= 0; static ulonglong offset = 0; @@ -438,6 +438,13 @@ static struct my_option my_long_options[] = {"database", 'd', "List entries for just this database (local log only).", (gptr*) &database, (gptr*) &database, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"disable-log-bin", 'D', "Disable binary log. This is useful, if you " + "enabled --to-last-log and are sending the output to the same MySQL server. " + "This way you could avoid an endless loop. You would also like to use it " + "when restoring after a crash to avoid duplication of the statements you " + "already have. NOTE: you will need a SUPER privilege to use this option.", + (gptr*) &disable_log_bin, (gptr*) &disable_log_bin, 0, GET_BOOL, + NO_ARG, 0, 0, 0, 0, 0, 0}, {"force-read", 'f', "Force reading unknown binlog events.", (gptr*) &force_opt, (gptr*) &force_opt, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, @@ -1068,6 +1075,11 @@ int main(int argc, char** argv) fprintf(result_file, "/*!40019 SET @@session.max_insert_delayed_threads=0*/;\n"); + + if (disable_log_bin) + fprintf(result_file, + "/*!32316 SET @OLD_SQL_LOG_BIN=@@SQL_LOG_BIN, SQL_LOG_BIN=0*/;\n"); + for (save_stop_position= stop_position, stop_position= ~(my_off_t)0 ; (--argc >= 0) && !stop_passed ; ) { @@ -1082,6 +1094,9 @@ int main(int argc, char** argv) start_position= BIN_LOG_HEADER_SIZE; } + if (disable_log_bin) + fprintf(result_file, "/*!32316 SET SQL_LOG_BIN=@OLD_SQL_LOG_BIN*/;\n"); + if (tmpdir.list) free_tmpdir(&tmpdir); if (result_file != stdout) From 42fb5937829c9da540087f1a4e0dd05b99bde5b3 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 19 Nov 2004 19:35:37 +0400 Subject: [PATCH 0283/1063] func_str.result: This test was moved into func_group. mysql-test/r/func_str.result: This test was moved into func_group. --- mysql-test/r/func_str.result | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result index 083f85ee6fa..8d49d55be39 100644 --- a/mysql-test/r/func_str.result +++ b/mysql-test/r/func_str.result @@ -614,20 +614,6 @@ t1 CREATE TABLE `t1` ( `encode('abcd','ab')` binary(4) NOT NULL default '' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; -create table t1 (a char character set latin2); -insert into t1 values ('a'),('b'); -select charset(max(a)), coercibility(max(a)), -charset(min(a)), coercibility(min(a)) from t1; -charset(max(a)) coercibility(max(a)) charset(min(a)) coercibility(min(a)) -latin2 2 latin2 2 -create table t2 select max(a),min(a) from t1; -show create table t2; -Table Create Table -t2 CREATE TABLE `t2` ( - `max(a)` char(1) character set latin2 default NULL, - `min(a)` char(1) character set latin2 default NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 -drop table t2,t1; select SUBSTR('abcdefg',3,2); SUBSTR('abcdefg',3,2) cd From 79d806693f3d0e06328e7d67b6216b03af8fa91c Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 19 Nov 2004 16:49:17 +0100 Subject: [PATCH 0284/1063] ndb: do not crash on config mismatch if release compiled ndb/src/kernel/blocks/ERROR_codes.txt: do not crash on config mismatch if release compiled ndb/src/kernel/blocks/dbacc/DbaccMain.cpp: do not crash on config mismatch if release compiled ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp: do not crash on config mismatch if release compiled ndb/test/ndbapi/testDict.cpp: do not crash on config mismatch if release compiled --- ndb/src/kernel/blocks/ERROR_codes.txt | 3 ++- ndb/src/kernel/blocks/dbacc/DbaccMain.cpp | 14 ++++++++++++++ ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp | 11 +++++++++++ ndb/test/ndbapi/testDict.cpp | 19 ++++++++++++++++--- 4 files changed, 43 insertions(+), 4 deletions(-) diff --git a/ndb/src/kernel/blocks/ERROR_codes.txt b/ndb/src/kernel/blocks/ERROR_codes.txt index 7ff03684cff..5193d3eae9d 100644 --- a/ndb/src/kernel/blocks/ERROR_codes.txt +++ b/ndb/src/kernel/blocks/ERROR_codes.txt @@ -1,7 +1,7 @@ Next QMGR 1 Next NDBCNTR 1000 Next NDBFS 2000 -Next DBACC 3001 +Next DBACC 3002 Next DBTUP 4013 Next DBLQH 5042 Next DBDICT 6006 @@ -393,6 +393,7 @@ Failed Create Table: -------------------- 7173: Create table failed due to not sufficient number of fragment or replica records. +3001: Fail create 1st fragment 4007 12001: Fail create 1st fragment 4008 12002: Fail create 2nd fragment 4009 12003: Fail create 1st attribute in 1st fragment diff --git a/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp b/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp index c275e5382f7..5c7cc597672 100644 --- a/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp +++ b/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp @@ -1062,7 +1062,21 @@ void Dbacc::execACCFRAGREQ(Signal* signal) { const AccFragReq * const req = (AccFragReq*)&signal->theData[0]; jamEntry(); + if (ERROR_INSERTED(3001)) { + jam(); + addFragRefuse(signal, 1); + CLEAR_ERROR_INSERT_VALUE; + return; + } tabptr.i = req->tableId; +#ifndef VM_TRACE + // config mismatch - do not crash if release compiled + if (tabptr.i >= ctablesize) { + jam(); + addFragRefuse(signal, 800); + return; + } +#endif ptrCheckGuard(tabptr, ctablesize, tabrec); ndbrequire((req->reqInfo & 0xF) == ZADDFRAG); ndbrequire(!getrootfragmentrec(signal, rootfragrecptr, req->fragId)); diff --git a/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp b/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp index 914dba00674..405f790954e 100644 --- a/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp +++ b/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp @@ -69,6 +69,17 @@ void Dbtup::execTUPFRAGREQ(Signal* signal) Uint32 noOfAttributeGroups = signal->theData[12]; Uint32 globalCheckpointIdIndicator = signal->theData[13]; +#ifndef VM_TRACE + // config mismatch - do not crash if release compiled + if (regTabPtr.i >= cnoOfTablerec) { + ljam(); + signal->theData[0] = userptr; + signal->theData[1] = 800; + sendSignal(userblockref, GSN_TUPFRAGREF, signal, 2, JBB); + return; + } +#endif + ptrCheckGuard(regTabPtr, cnoOfTablerec, tablerec); if (cfirstfreeFragopr == RNIL) { ljam(); diff --git a/ndb/test/ndbapi/testDict.cpp b/ndb/test/ndbapi/testDict.cpp index 712ab2e4d25..0a43bb02fff 100644 --- a/ndb/test/ndbapi/testDict.cpp +++ b/ndb/test/ndbapi/testDict.cpp @@ -1480,8 +1480,10 @@ runTestDictionaryPerf(NDBT_Context* ctx, NDBT_Step* step){ } int runFailAddFragment(NDBT_Context* ctx, NDBT_Step* step){ + static int acclst[] = { 3001 }; static int tuplst[] = { 4007, 4008, 4009, 4010, 4011, 4012 }; static int tuxlst[] = { 12001, 12002, 12003, 12004, 12005, 12006 }; + static unsigned acccnt = sizeof(acclst)/sizeof(acclst[0]); static unsigned tupcnt = sizeof(tuplst)/sizeof(tuplst[0]); static unsigned tuxcnt = sizeof(tuxlst)/sizeof(tuxlst[0]); @@ -1509,6 +1511,19 @@ int runFailAddFragment(NDBT_Context* ctx, NDBT_Step* step){ (void)pDic->dropTable(tab.getName()); for (int l = 0; l < loops; l++) { + for (unsigned i0 = 0; i0 < acccnt; i0++) { + unsigned j = (l == 0 ? i0 : myRandom48(acccnt)); + int errval = acclst[j]; + g_info << "insert error node=" << nodeId << " value=" << errval << endl; + CHECK2(restarter.insertErrorInNode(nodeId, errval) == 0, + "failed to set error insert"); + CHECK2(pDic->createTable(tab) != 0, + "failed to fail after error insert " << errval); + CHECK2(pDic->createTable(tab) == 0, + pDic->getNdbError()); + CHECK2(pDic->dropTable(tab.getName()) == 0, + pDic->getNdbError()); + } for (unsigned i1 = 0; i1 < tupcnt; i1++) { unsigned j = (l == 0 ? i1 : myRandom48(tupcnt)); int errval = tuplst[j]; @@ -1638,7 +1653,7 @@ TESTCASE("DictionaryPerf", INITIALIZER(runTestDictionaryPerf); } TESTCASE("FailAddFragment", - "Fail add fragment or attribute in TUP or TUX\n"){ + "Fail add fragment or attribute in ACC or TUP or TUX\n"){ INITIALIZER(runFailAddFragment); } NDBT_TESTSUITE_END(testDict); @@ -1650,5 +1665,3 @@ int main(int argc, const char** argv){ myRandom48Init(NdbTick_CurrentMillisecond()); return testDict.execute(argc, argv); } - - From d831ff2648b54efb1f0ab012a6326410141250e7 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 19 Nov 2004 16:58:02 +0000 Subject: [PATCH 0285/1063] corrected some erroneous size calculations in tup fixed erroneous error message - set auto increment was done even if create table failed so real error message got lost behind "table not found" and simplified code a bit ndb/src/kernel/vm/Configuration.cpp: corrected some erroneous size calculations ndb/src/ndbapi/NdbDictionaryImpl.cpp: fixed erroneous error message - set auto increment was done even if create table failed so real error message got lost behind "table not found" and simplified code a bit --- ndb/src/kernel/vm/Configuration.cpp | 4 +-- ndb/src/ndbapi/NdbDictionaryImpl.cpp | 42 +++++++++++++++------------- 2 files changed, 25 insertions(+), 21 deletions(-) diff --git a/ndb/src/kernel/vm/Configuration.cpp b/ndb/src/kernel/vm/Configuration.cpp index c2f47adff29..aac035fe1b7 100644 --- a/ndb/src/kernel/vm/Configuration.cpp +++ b/ndb/src/kernel/vm/Configuration.cpp @@ -750,8 +750,8 @@ Configuration::calcSizeAlt(ConfigValues * ownConfig){ noOfMetaTables); cfg.put(CFG_TUP_TABLE_DESC, - 4 * NO_OF_FRAG_PER_NODE * noOfAttributes* noOfReplicas + - 12 * NO_OF_FRAG_PER_NODE * noOfMetaTables* noOfReplicas ); + 2 * 6 * NO_OF_FRAG_PER_NODE * noOfAttributes * noOfReplicas + + 2 * 10 * NO_OF_FRAG_PER_NODE * noOfMetaTables * noOfReplicas ); cfg.put(CFG_TUP_STORED_PROC, noOfLocalScanRecords); diff --git a/ndb/src/ndbapi/NdbDictionaryImpl.cpp b/ndb/src/ndbapi/NdbDictionaryImpl.cpp index 304d1b904d4..345f2caac89 100644 --- a/ndb/src/ndbapi/NdbDictionaryImpl.cpp +++ b/ndb/src/ndbapi/NdbDictionaryImpl.cpp @@ -1571,7 +1571,13 @@ NdbDictInterface::createOrAlterTable(Ndb & ndb, NdbApiSignal tSignal(m_reference); tSignal.theReceiversBlockNumber = DBDICT; - if (alter) { + + LinearSectionPtr ptr[3]; + ptr[0].p = (Uint32*)m_buffer.get_data(); + ptr[0].sz = m_buffer.length() / 4; + int ret; + if (alter) + { AlterTableReq * const req = CAST_PTR(AlterTableReq, tSignal.getDataPtrSend()); @@ -1582,8 +1588,10 @@ NdbDictInterface::createOrAlterTable(Ndb & ndb, req->tableVersion = impl.m_version;; tSignal.theVerId_signalNumber = GSN_ALTER_TABLE_REQ; tSignal.theLength = AlterTableReq::SignalLength; + ret= alterTable(&tSignal, ptr); } - else { + else + { CreateTableReq * const req = CAST_PTR(CreateTableReq, tSignal.getDataPtrSend()); @@ -1591,25 +1599,21 @@ NdbDictInterface::createOrAlterTable(Ndb & ndb, req->senderData = 0; tSignal.theVerId_signalNumber = GSN_CREATE_TABLE_REQ; tSignal.theLength = CreateTableReq::SignalLength; - } - - LinearSectionPtr ptr[3]; - ptr[0].p = (Uint32*)m_buffer.get_data(); - ptr[0].sz = m_buffer.length() / 4; + ret= createTable(&tSignal, ptr); - int ret = (alter) ? - alterTable(&tSignal, ptr) - : createTable(&tSignal, ptr); + if (ret) + return ret; - if (!alter && haveAutoIncrement) { - if (!ndb.setAutoIncrementValue(impl.m_externalName.c_str(), - autoIncrementValue)) { - if (ndb.theError.code == 0) { - m_error.code = 4336; - ndb.theError = m_error; - } else - m_error= ndb.theError; - ret = -1; // errorcode set in initialize_autoincrement + if (haveAutoIncrement) { + if (!ndb.setAutoIncrementValue(impl.m_externalName.c_str(), + autoIncrementValue)) { + if (ndb.theError.code == 0) { + m_error.code = 4336; + ndb.theError = m_error; + } else + m_error= ndb.theError; + ret = -1; // errorcode set in initialize_autoincrement + } } } return ret; From 2d5f9f57cef5546d56d2838c5a2e29bb389b0ff3 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 19 Nov 2004 17:18:46 +0000 Subject: [PATCH 0286/1063] acinclude.m4: reverting my last fix acinclude.m4: reverting my last fix --- acinclude.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/acinclude.m4 b/acinclude.m4 index 58e24dcbc5e..81917372206 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -1687,7 +1687,7 @@ AC_DEFUN([MYSQL_CHECK_NDBCLUSTER], [ ndbcluster_includes="-I../ndb/include -I../ndb/include/ndbapi" ndbcluster_libs="\$(top_builddir)/ndb/src/.libs/libndbclient.a" ndbcluster_system_libs="" - ndb_mgmclient_libs="\$(top_builddir)/ndb/src/mgmclient/libndbmgmclient.la \$(top_builddir)/mysys/libmysys.a" + ndb_mgmclient_libs="\$(top_builddir)/ndb/src/mgmclient/libndbmgmclient.la" MYSQL_CHECK_NDB_OPTIONS ;; * ) From 724697f54cc97d2bf726840ae957cdd9c8761e2b Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 19 Nov 2004 17:21:27 +0000 Subject: [PATCH 0287/1063] Makefile.am, mysqladmin.cc: reverting linking ndbclisnt to mysqladmin.cc client/mysqladmin.cc: reverting linking ndbclisnt to mysqladmin.cc client/Makefile.am: reverting linking ndbclisnt to mysqladmin.cc --- client/Makefile.am | 3 +-- client/mysqladmin.cc | 12 ++++++------ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/client/Makefile.am b/client/Makefile.am index 5034dd5bf51..514ed7fdf51 100644 --- a/client/Makefile.am +++ b/client/Makefile.am @@ -20,8 +20,7 @@ INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/regex \ $(openssl_includes) LIBS = @CLIENT_LIBS@ -DEPLIB= @ndb_mgmclient_libs@ \ - ../libmysql/libmysqlclient.la +DEPLIB= ../libmysql/libmysqlclient.la LDADD = @CLIENT_EXTRA_LDFLAGS@ $(DEPLIB) bin_PROGRAMS = mysql mysqladmin mysqlcheck mysqlshow \ mysqldump mysqlimport mysqltest mysqlbinlog mysqlmanagerc mysqlmanager-pwgen diff --git a/client/mysqladmin.cc b/client/mysqladmin.cc index a9fc3f31d03..eec0dcb90fe 100644 --- a/client/mysqladmin.cc +++ b/client/mysqladmin.cc @@ -24,7 +24,7 @@ #include #include -#ifdef HAVE_NDBCLUSTER_DB +#ifdef LATER_HAVE_NDBCLUSTER_DB #include "../ndb/src/mgmclient/ndb_mgmclient.h" #endif @@ -45,7 +45,7 @@ static uint tcp_port = 0, option_wait = 0, option_silent=0, nr_iterations, opt_count_iterations= 0; static ulong opt_connect_timeout, opt_shutdown_timeout; static my_string unix_port=0; -#ifdef HAVE_NDBCLUSTER_DB +#ifdef LATER_HAVE_NDBCLUSTER_DB static my_bool opt_ndbcluster=0; static char *opt_ndb_connectstring=0; #endif @@ -101,7 +101,7 @@ enum commands { ADMIN_PING, ADMIN_EXTENDED_STATUS, ADMIN_FLUSH_STATUS, ADMIN_FLUSH_PRIVILEGES, ADMIN_START_SLAVE, ADMIN_STOP_SLAVE, ADMIN_FLUSH_THREADS, ADMIN_OLD_PASSWORD -#ifdef HAVE_NDBCLUSTER_DB +#ifdef LATER_HAVE_NDBCLUSTER_DB ,ADMIN_NDB_MGM #endif }; @@ -114,7 +114,7 @@ static const char *command_names[]= { "ping", "extended-status", "flush-status", "flush-privileges", "start-slave", "stop-slave", "flush-threads","old-password", -#ifdef HAVE_NDBCLUSTER_DB +#ifdef LATER_HAVE_NDBCLUSTER_DB "ndb-mgm", #endif NullS @@ -197,7 +197,7 @@ static struct my_option my_long_options[] = {"shutdown_timeout", OPT_SHUTDOWN_TIMEOUT, "", (gptr*) &opt_shutdown_timeout, (gptr*) &opt_shutdown_timeout, 0, GET_ULONG, REQUIRED_ARG, SHUTDOWN_DEF_TIMEOUT, 0, 3600*12, 0, 1, 0}, -#ifdef HAVE_NDBCLUSTER_DB +#ifdef LATER_HAVE_NDBCLUSTER_DB {"ndbcluster", OPT_NDBCLUSTER, "" "", (gptr*) &opt_ndbcluster, (gptr*) &opt_ndbcluster, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, @@ -903,7 +903,7 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv) } mysql->reconnect=1; /* Automatic reconnect is default */ break; -#ifdef HAVE_NDBCLUSTER_DB +#ifdef LATER_HAVE_NDBCLUSTER_DB case ADMIN_NDB_MGM: { if (argc < 2) From 99d2d10097da69f33637ec43fce22b1a70c6ad85 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 19 Nov 2004 14:53:40 -0600 Subject: [PATCH 0288/1063] mysql.cc: Tweak some help text. client/mysql.cc: Tweak some help text. --- client/mysql.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/mysql.cc b/client/mysql.cc index 358b13e652b..8e9dd84c8f0 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -1609,7 +1609,7 @@ static void print_help_item(MYSQL_ROW *cur, int num_name, int num_cat, char *las char ccat= (*cur)[num_cat][0]; if (*last_char != ccat) { - put_info(ccat == 'Y' ? "categories :" : "topics :", INFO_INFO); + put_info(ccat == 'Y' ? "categories:" : "topics:", INFO_INFO); *last_char= ccat; } tee_fprintf(PAGER, " %s\n", (*cur)[num_name]); @@ -1676,8 +1676,8 @@ static int com_server_help(String *buffer __attribute__((unused)), if (num_fields == 2) { - put_info("Many help items for your request exist", INFO_INFO); - put_info("To make a more specific request, please type 'help ',\nwhere item is one of next", INFO_INFO); + put_info("Many help items for your request exist.", INFO_INFO); + put_info("To make a more specific request, please type 'help ',\nwhere item is one of the following", INFO_INFO); num_name= 0; num_cat= 1; last_char= '_'; From 3507a52e60a20b01dd1d200f5a4f8b601cb0f55b Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 21 Nov 2004 12:04:27 +0300 Subject: [PATCH 0289/1063] A fix and test case for Bug#6297 "prepared statement, wrong handling of IS NULL": we must not only set Item::null_value in Item_param, but implement Item_param::is_null() to work well with IS NULL/IS NOT NULL clauses. mysql-test/r/ps.result: Test case for Bug#6297: test results fixed. mysql-test/t/ps.test: A test case for Bug#6297 "prepared statement, wrong handling of IS NULL" sql/item.h: A fix for Bug#6297: we must not only set null_value in Item_param, but also implement Item_param::is_null() to work well with IS NULL/ IS NOT NULL. Item::is_null() commented. --- mysql-test/r/ps.result | 21 +++++++++++++++++++++ mysql-test/t/ps.test | 14 ++++++++++++++ sql/item.h | 10 ++++++++++ 3 files changed, 45 insertions(+) diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result index 6d9cfabb5a7..4a4c8fe22e4 100644 --- a/mysql-test/r/ps.result +++ b/mysql-test/r/ps.result @@ -450,3 +450,24 @@ PREPARE stmt FROM 'UPDATE t1 AS P1 INNER JOIN (SELECT N FROM t1 GROUP BY N HAVIN EXECUTE stmt; DEALLOCATE PREPARE stmt; DROP TABLE t1; +prepare stmt from "select ? is null, ? is not null, ?"; +select @no_such_var is null, @no_such_var is not null, @no_such_var; +@no_such_var is null @no_such_var is not null @no_such_var +1 0 NULL +execute stmt using @no_such_var, @no_such_var, @no_such_var; +? is null ? is not null ? +1 0 NULL +set @var='abc'; +select @var is null, @var is not null, @var; +@var is null @var is not null @var +0 1 abc +execute stmt using @var, @var, @var; +? is null ? is not null ? +0 1 abc +set @var=null; +select @var is null, @var is not null, @var; +@var is null @var is not null @var +1 0 NULL +execute stmt using @var, @var, @var; +? is null ? is not null ? +1 0 NULL diff --git a/mysql-test/t/ps.test b/mysql-test/t/ps.test index 2b3e961fc28..7fe88ad0ddc 100644 --- a/mysql-test/t/ps.test +++ b/mysql-test/t/ps.test @@ -458,3 +458,17 @@ EXECUTE stmt; DEALLOCATE PREPARE stmt; DROP TABLE t1; +# +# Bug#6297 "prepared statement, wrong handling of IS NULL" +# Test that placeholders work with IS NULL/IS NOT NULL clauses. +# +prepare stmt from "select ? is null, ? is not null, ?"; +select @no_such_var is null, @no_such_var is not null, @no_such_var; +execute stmt using @no_such_var, @no_such_var, @no_such_var; +set @var='abc'; +select @var is null, @var is not null, @var; +execute stmt using @var, @var, @var; +set @var=null; +select @var is null, @var is not null, @var; +execute stmt using @var, @var, @var; + diff --git a/sql/item.h b/sql/item.h index 547577a7ee0..ccb0fda1c49 100644 --- a/sql/item.h +++ b/sql/item.h @@ -266,6 +266,14 @@ public: virtual bool get_time(TIME *ltime); virtual bool get_date_result(TIME *ltime,uint fuzzydate) { return get_date(ltime,fuzzydate); } + /* + This function is used only in Item_func_isnull/Item_func_isnotnull + (implementations of IS NULL/IS NOT NULL clauses). Item_func_is{not}null + calls this method instead of one of val/result*() methods, which + normally will set null_value. This allows to determine nullness of + a complex expression without fully evaluating it. + Any new item which can be NULL must implement this call. + */ virtual bool is_null() { return 0; } /* it is "top level" item of WHERE clause and we do not need correct NULL @@ -573,6 +581,8 @@ public: void print(String *str) { str->append('?'); } /* parameter never equal to other parameter of other item */ bool eq(const Item *item, bool binary_cmp) const { return 0; } + bool is_null() + { DBUG_ASSERT(state != NO_VALUE); return state == NULL_VALUE; } }; class Item_int :public Item_num From 5a7198f54d1a11ac7ef70a55c6a9b9044147df54 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 21 Nov 2004 17:38:15 +0200 Subject: [PATCH 0290/1063] trx0undo.c, trx0purge.c: Print a warning to the .err log if the InnoDB history list length is > 20 000 even though purge reaches the list head; this is to track corruption reported on the MySQL mailing list Nov 9, 2004 lock0lock.c: Let SHOW INNODB STATUS print the history list length innobase/lock/lock0lock.c: Let SHOW INNODB STATUS print the history list length innobase/trx/trx0purge.c: Print a warning to the .err log if the InnoDB history list length is > 20 000 even though purge reaches the list head; this is to track corruption reported on the MySQL mailing list Nov 9, 2004 innobase/trx/trx0undo.c: Print a warning to the .err log if the InnoDB history list length is > 20 000 even though purge reaches the list head; this is to track corruption reported on the MySQL mailing list Nov 9, 2004 --- innobase/lock/lock0lock.c | 3 +++ innobase/trx/trx0purge.c | 23 ++++++++++++++++++++++- innobase/trx/trx0undo.c | 2 +- 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/innobase/lock/lock0lock.c b/innobase/lock/lock0lock.c index 6f2d58b72c3..78a78c9dd95 100644 --- a/innobase/lock/lock0lock.c +++ b/innobase/lock/lock0lock.c @@ -4063,6 +4063,9 @@ lock_print_info( (ulong) ut_dulint_get_high(purge_sys->purge_undo_no), (ulong) ut_dulint_get_low(purge_sys->purge_undo_no)); + fprintf(file, + "History list length %lu\n", (ulong) trx_sys->rseg_history_len); + fprintf(file, "Total number of lock structs in row lock hash table %lu\n", (ulong) lock_get_n_rec_locks()); diff --git a/innobase/trx/trx0purge.c b/innobase/trx/trx0purge.c index 5c62640e011..3df34111281 100644 --- a/innobase/trx/trx0purge.c +++ b/innobase/trx/trx0purge.c @@ -289,7 +289,7 @@ trx_purge_add_update_undo_to_history( flst_get_len(seg_header + TRX_UNDO_PAGE_LIST, mtr)); mlog_write_ulint(rseg_header + TRX_RSEG_HISTORY_SIZE, - hist_size + undo->size, MLOG_4BYTES, mtr); + hist_size + undo->size, MLOG_4BYTES, mtr); } /* Add the log as the first in the history list */ @@ -646,6 +646,27 @@ trx_purge_rseg_get_next_history_log( mutex_exit(&(rseg->mutex)); mtr_commit(&mtr); + mutex_enter(&kernel_mutex); + + /* Add debug code to track history list corruption reported + on the MySQL mailing list on Nov 9, 2004. The fut0lst.c + file-based list was corrupt. The prev node pointer was + FIL_NULL, even though the list length was over 8 million nodes! + We assume that purge truncates the history list in moderate + size pieces, and if we here reach the head of the list, the + list cannot be longer than 20 000 undo logs now. */ + + if (trx_sys->rseg_history_len > 20000) { + ut_print_timestamp(stderr); + fprintf(stderr, +" InnoDB: Warning: purge reached the head of the history list,\n" +"InnoDB: but its length is still reported as %lu! Make a detailed bug\n" +"InnoDB: report, and post it to bugs.mysql.com\n", + (ulong)trx_sys->rseg_history_len); + } + + mutex_exit(&kernel_mutex); + return; } diff --git a/innobase/trx/trx0undo.c b/innobase/trx/trx0undo.c index c1edc223cbc..8d1518753dd 100644 --- a/innobase/trx/trx0undo.c +++ b/innobase/trx/trx0undo.c @@ -1241,7 +1241,7 @@ trx_undo_lists_init( if (page_no != FIL_NULL && srv_force_recovery < SRV_FORCE_NO_UNDO_LOG_SCAN) { - + undo = trx_undo_mem_create_at_db_start(rseg, i, page_no, &mtr); size += undo->size; From 9e26c327a0530ea104e32960cef7a407dad060dc Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 21 Nov 2004 22:15:44 +0100 Subject: [PATCH 0291/1063] wl2077 - ndb close scan - fix introduced bugs wrt premature close of scan ndb/src/common/debugger/signaldata/ScanTab.cpp: Fix printout ndb/src/kernel/blocks/dbtc/DbtcMain.cpp: Handle already closed fragments ndb/src/ndbapi/NdbConnectionScan.cpp: Better handling of SCAN_TABREF ndb/src/ndbapi/NdbScanOperation.cpp: Removed some special cases by setting up them instead ndb/test/src/NDBT_Test.cpp: Fix createTable(false) ndb/tools/select_all.cpp: Use full scan as default --- ndb/src/common/debugger/signaldata/ScanTab.cpp | 5 +++-- ndb/src/kernel/blocks/dbtc/DbtcMain.cpp | 3 +-- ndb/src/ndbapi/NdbConnectionScan.cpp | 10 ++++++++-- ndb/src/ndbapi/NdbScanOperation.cpp | 8 +++++--- ndb/test/src/NDBT_Test.cpp | 4 +--- ndb/tools/select_all.cpp | 2 +- 6 files changed, 19 insertions(+), 13 deletions(-) diff --git a/ndb/src/common/debugger/signaldata/ScanTab.cpp b/ndb/src/common/debugger/signaldata/ScanTab.cpp index 72a4d9f94b9..0755ee0a856 100644 --- a/ndb/src/common/debugger/signaldata/ScanTab.cpp +++ b/ndb/src/common/debugger/signaldata/ScanTab.cpp @@ -30,13 +30,14 @@ printSCANTABREQ(FILE * output, const Uint32 * theData, Uint32 len, Uint16 receiv fprintf(output, " apiConnectPtr: H\'%.8x", sig->apiConnectPtr); fprintf(output, " requestInfo: H\'%.8x:\n", requestInfo); - fprintf(output, " Parallellism: %u, Batch: %u LockMode: %u, Keyinfo: %u Holdlock: %u, RangeScan: %u\n", + fprintf(output, " Parallellism: %u, Batch: %u LockMode: %u, Keyinfo: %u Holdlock: %u, RangeScan: %u ReadCommitted: %u\n", sig->getParallelism(requestInfo), sig->getScanBatch(requestInfo), sig->getLockMode(requestInfo), + sig->getKeyinfoFlag(requestInfo), sig->getHoldLockFlag(requestInfo), sig->getRangeScanFlag(requestInfo), - sig->getKeyinfoFlag(requestInfo)); + sig->getReadCommittedFlag(requestInfo)); Uint32 keyLen = (sig->attrLenKeyLen >> 16); Uint32 attrLen = (sig->attrLenKeyLen & 0xFFFF); diff --git a/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp b/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp index 9af770db5b7..07dbb370ec6 100644 --- a/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp +++ b/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp @@ -9329,7 +9329,6 @@ void Dbtc::execSCAN_NEXTREQ(Signal* signal) /********************************************************************* * APPLICATION IS CLOSING THE SCAN. **********************************************************************/ - ndbrequire(len == 0); close_scan_req(signal, scanptr, true); return; }//if @@ -9457,7 +9456,7 @@ Dbtc::close_scan_req(Signal* signal, ScanRecordPtr scanPtr, bool req_received){ ndbrequire(curr.p->scanFragState == ScanFragRec::DELIVERED); delivered.remove(curr); - if(curr.p->m_ops > 0){ + if(curr.p->m_ops > 0 && curr.p->m_scan_frag_conf_status == 0){ jam(); running.add(curr); curr.p->scanFragState = ScanFragRec::LQH_ACTIVE; diff --git a/ndb/src/ndbapi/NdbConnectionScan.cpp b/ndb/src/ndbapi/NdbConnectionScan.cpp index a7a8f1350b1..a1a220caacf 100644 --- a/ndb/src/ndbapi/NdbConnectionScan.cpp +++ b/ndb/src/ndbapi/NdbConnectionScan.cpp @@ -57,12 +57,18 @@ NdbConnection::receiveSCAN_TABREF(NdbApiSignal* aSignal){ if(checkState_TransId(&ref->transId1)){ theScanningOp->theError.code = ref->errorCode; + theScanningOp->execCLOSE_SCAN_REP(); if(!ref->closeNeeded){ - theScanningOp->execCLOSE_SCAN_REP(); return 0; } - assert(theScanningOp->m_sent_receivers_count); + + /** + * Setup so that close_impl will actually perform a close + * and not "close scan"-optimze it away + */ theScanningOp->m_conf_receivers_count++; + theScanningOp->m_conf_receivers[0] = theScanningOp->m_receivers[0]; + theScanningOp->m_conf_receivers[0]->m_tcPtrI = ~0; return 0; } else { #ifdef NDB_NO_DROPPED_SIGNAL diff --git a/ndb/src/ndbapi/NdbScanOperation.cpp b/ndb/src/ndbapi/NdbScanOperation.cpp index 30b596d7098..0fe68c5bab8 100644 --- a/ndb/src/ndbapi/NdbScanOperation.cpp +++ b/ndb/src/ndbapi/NdbScanOperation.cpp @@ -613,21 +613,22 @@ NdbScanOperation::send_next_scan(Uint32 cnt, bool stopScanFlag){ sent++; } } - memcpy(&m_api_receivers[0], &m_api_receivers[cnt], cnt * sizeof(char*)); + memmove(m_api_receivers, m_api_receivers+cnt, + (theParallelism-cnt) * sizeof(char*)); int ret = 0; if(sent) { Uint32 nodeId = theNdbCon->theDBnode; TransporterFacade * tp = TransporterFacade::instance(); - if(cnt > 21 && !stopScanFlag){ + if(cnt > 21){ tSignal.setLength(4); LinearSectionPtr ptr[3]; ptr[0].p = prep_array; ptr[0].sz = sent; ret = tp->sendSignal(&tSignal, nodeId, ptr, 1); } else { - tSignal.setLength(4+(stopScanFlag ? 0 : sent)); + tSignal.setLength(4+sent); ret = tp->sendSignal(&tSignal, nodeId); } } @@ -687,6 +688,7 @@ NdbScanOperation::execCLOSE_SCAN_REP(){ m_api_receivers_count = 0; m_conf_receivers_count = 0; m_sent_receivers_count = 0; + m_current_api_receiver = theParallelism; } void NdbScanOperation::release() diff --git a/ndb/test/src/NDBT_Test.cpp b/ndb/test/src/NDBT_Test.cpp index 367223f8c98..10233cb5859 100644 --- a/ndb/test/src/NDBT_Test.cpp +++ b/ndb/test/src/NDBT_Test.cpp @@ -839,9 +839,7 @@ void NDBT_TestSuite::execute(Ndb* ndb, const NdbDictionary::Table* pTab, continue; } pTab2 = pDict->getTable(pTab->getName()); - } else { - pTab2 = pTab; - } + } ctx = new NDBT_Context(); ctx->setTab(pTab2); diff --git a/ndb/tools/select_all.cpp b/ndb/tools/select_all.cpp index 9c944c8c93e..a670a2ed49a 100644 --- a/ndb/tools/select_all.cpp +++ b/ndb/tools/select_all.cpp @@ -50,7 +50,7 @@ static struct my_option my_long_options[] = GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, { "parallelism", 'p', "parallelism", (gptr*) &_parallelism, (gptr*) &_parallelism, 0, - GET_INT, REQUIRED_ARG, 240, 0, 0, 0, 0, 0 }, + GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, { "lock", 'l', "Read(0), Read-hold(1), Exclusive(2)", (gptr*) &_lock, (gptr*) &_lock, 0, GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, From 9db732ebe6e73bc5c61ceadf92d8fd1582c94e33 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 22 Nov 2004 07:22:08 +0100 Subject: [PATCH 0292/1063] wl2077 - ndb, fix testDict --- ndb/test/src/NDBT_Test.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ndb/test/src/NDBT_Test.cpp b/ndb/test/src/NDBT_Test.cpp index 10233cb5859..1434617c988 100644 --- a/ndb/test/src/NDBT_Test.cpp +++ b/ndb/test/src/NDBT_Test.cpp @@ -839,6 +839,8 @@ void NDBT_TestSuite::execute(Ndb* ndb, const NdbDictionary::Table* pTab, continue; } pTab2 = pDict->getTable(pTab->getName()); + } else if(!pTab2) { + pTab2 = pTab; } ctx = new NDBT_Context(); From 6d6b38c27fcac1da19a11fa07a5f02c2c22635fe Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 22 Nov 2004 11:58:40 +0400 Subject: [PATCH 0293/1063] Bug #6737: REGEXP gives wrong result with case sensitive collation: - A new flag MY_CS_CSSORT was introduced for case sensitivity. - Item_func_regexp doesn't substiture ICASE not only for binary collations but for case sensitive collations as well. --- include/m_ctype.h | 2 +- mysql-test/r/ctype_latin1.result | 9 +++++++++ mysql-test/t/ctype_latin1.test | 7 +++++++ mysys/charset.c | 11 +++++++++++ sql/item_cmpfunc.cc | 20 +++++++++++--------- strings/ctype-czech.c | 12 ++++++------ strings/ctype-win1250ch.c | 12 ++++++------ 7 files changed, 51 insertions(+), 22 deletions(-) diff --git a/include/m_ctype.h b/include/m_ctype.h index ddc21070547..26e285b9683 100644 --- a/include/m_ctype.h +++ b/include/m_ctype.h @@ -63,7 +63,7 @@ typedef struct unicase_info_st #define MY_CS_UNICODE 128 /* is a charset is full unicode */ #define MY_CS_READY 256 /* if a charset is initialized */ #define MY_CS_AVAILABLE 512 /* If either compiled-in or loaded*/ - +#define MY_CS_CSSORT 1024 /* if case sensitive sort order */ #define MY_CHARSET_UNDEFINED 0 diff --git a/mysql-test/r/ctype_latin1.result b/mysql-test/r/ctype_latin1.result index a8182438ac4..355f53b63a5 100644 --- a/mysql-test/r/ctype_latin1.result +++ b/mysql-test/r/ctype_latin1.result @@ -296,3 +296,12 @@ FD C3BD FD 1 FE C3BE FE 1 FF C3BF FF 1 DROP TABLE t1; +select 'a' regexp 'A' collate latin1_general_ci; +'a' regexp 'A' collate latin1_general_ci +1 +select 'a' regexp 'A' collate latin1_general_cs; +'a' regexp 'A' collate latin1_general_cs +0 +select 'a' regexp 'A' collate latin1_bin; +'a' regexp 'A' collate latin1_bin +0 diff --git a/mysql-test/t/ctype_latin1.test b/mysql-test/t/ctype_latin1.test index 14062437428..677acd9faa9 100644 --- a/mysql-test/t/ctype_latin1.test +++ b/mysql-test/t/ctype_latin1.test @@ -53,3 +53,10 @@ SELECT hex(@l:=convert(@u using latin1)), a=@l FROM t1; DROP TABLE t1; + +# +# Bug #6737: REGEXP gives wrong result with case sensitive collation +# +select 'a' regexp 'A' collate latin1_general_ci; +select 'a' regexp 'A' collate latin1_general_cs; +select 'a' regexp 'A' collate latin1_bin; diff --git a/mysys/charset.c b/mysys/charset.c index 1388fc40c6d..cb2379f8723 100644 --- a/mysys/charset.c +++ b/mysys/charset.c @@ -228,6 +228,7 @@ static int add_collation(CHARSET_INFO *cs) } else { + uchar *sort_order= all_charsets[cs->number]->sort_order; simple_cs_init_functions(all_charsets[cs->number]); new->mbminlen= 1; new->mbmaxlen= 1; @@ -236,6 +237,16 @@ static int add_collation(CHARSET_INFO *cs) all_charsets[cs->number]->state |= MY_CS_LOADED; } all_charsets[cs->number]->state|= MY_CS_AVAILABLE; + + /* + Check if case sensitive sort order: A < a < B. + We need MY_CS_FLAG for regex library, and for + case sensitivity flag for 5.0 client protocol, + to support isCaseSensitive() method in JDBC driver + */ + if (sort_order && sort_order['A'] < sort_order['a'] && + sort_order['a'] < sort_order['B']) + all_charsets[cs->number]->state|= MY_CS_CSSORT; } } else diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index c36f2d191c7..4970517de87 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -2364,11 +2364,12 @@ Item_func_regex::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref) return 0; } int error; - if ((error=regcomp(&preg,res->c_ptr(), - (cmp_collation.collation->state & MY_CS_BINSORT) ? - REG_EXTENDED | REG_NOSUB : - REG_EXTENDED | REG_NOSUB | REG_ICASE, - cmp_collation.collation))) + if ((error= regcomp(&preg,res->c_ptr(), + ((cmp_collation.collation->state & MY_CS_BINSORT) || + (cmp_collation.collation->state & MY_CS_CSSORT)) ? + REG_EXTENDED | REG_NOSUB : + REG_EXTENDED | REG_NOSUB | REG_ICASE, + cmp_collation.collation))) { (void) regerror(error,&preg,buff,sizeof(buff)); my_printf_error(ER_REGEXP_ERROR,ER(ER_REGEXP_ERROR),MYF(0),buff); @@ -2416,10 +2417,11 @@ longlong Item_func_regex::val_int() regex_compiled=0; } if (regcomp(&preg,res2->c_ptr(), - (cmp_collation.collation->state & MY_CS_BINSORT) ? - REG_EXTENDED | REG_NOSUB : - REG_EXTENDED | REG_NOSUB | REG_ICASE, - cmp_collation.collation)) + ((cmp_collation.collation->state & MY_CS_BINSORT) || + (cmp_collation.collation->state & MY_CS_CSSORT)) ? + REG_EXTENDED | REG_NOSUB : + REG_EXTENDED | REG_NOSUB | REG_ICASE, + cmp_collation.collation)) { null_value=1; return 0; diff --git a/strings/ctype-czech.c b/strings/ctype-czech.c index 6f9e9f74d35..2177a18504e 100644 --- a/strings/ctype-czech.c +++ b/strings/ctype-czech.c @@ -589,12 +589,12 @@ static MY_COLLATION_HANDLER my_collation_latin2_czech_ci_handler = CHARSET_INFO my_charset_latin2_czech_ci = { - 2,0,0, /* number */ - MY_CS_COMPILED|MY_CS_STRNXFRM, /* state */ - "latin2", /* cs name */ - "latin2_czech_cs", /* name */ - "", /* comment */ - NULL, /* tailoring */ + 2,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_CSSORT, /* state */ + "latin2", /* cs name */ + "latin2_czech_cs", /* name */ + "", /* comment */ + NULL, /* tailoring */ ctype_czech, to_lower_czech, to_upper_czech, diff --git a/strings/ctype-win1250ch.c b/strings/ctype-win1250ch.c index b4dbda3e8ed..4ada3d47bf5 100644 --- a/strings/ctype-win1250ch.c +++ b/strings/ctype-win1250ch.c @@ -624,12 +624,12 @@ static MY_COLLATION_HANDLER my_collation_czech_ci_handler = CHARSET_INFO my_charset_cp1250_czech_ci = { - 34,0,0, /* number */ - MY_CS_COMPILED|MY_CS_STRNXFRM, /* state */ - "cp1250", /* cs name */ - "cp1250_czech_cs", /* name */ - "", /* comment */ - NULL, /* tailoring */ + 34,0,0, /* number */ + MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_CSSORT, /* state */ + "cp1250", /* cs name */ + "cp1250_czech_cs", /* name */ + "", /* comment */ + NULL, /* tailoring */ ctype_win1250ch, to_lower_win1250ch, to_upper_win1250ch, From 3e779698ab519aaec70fe1292ff5a7565e8d533a Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 22 Nov 2004 08:06:39 +0000 Subject: [PATCH 0294/1063] aligned connect string option on all cluster executables, --ndb-connectstring is now supported by all enabled new section in my.cnf [mysql_cluster], which is read by all executables, where connect string can be put for all cluster executables --- ndb/include/util/ndb_opts.h | 18 ++++++++++++------ ndb/src/kernel/vm/Configuration.cpp | 2 +- ndb/src/mgmclient/main.cpp | 2 +- ndb/src/mgmsrv/main.cpp | 12 ++++++++---- ndb/tools/delete_all.cpp | 2 +- ndb/tools/desc.cpp | 2 +- ndb/tools/drop_index.cpp | 2 +- ndb/tools/drop_tab.cpp | 2 +- ndb/tools/listTables.cpp | 2 +- ndb/tools/restore/restore_main.cpp | 2 +- ndb/tools/select_all.cpp | 2 +- ndb/tools/select_count.cpp | 2 +- ndb/tools/waiter.cpp | 2 +- 13 files changed, 31 insertions(+), 21 deletions(-) diff --git a/ndb/include/util/ndb_opts.h b/ndb/include/util/ndb_opts.h index 6cba9c04449..f7ae3b5489e 100644 --- a/ndb/include/util/ndb_opts.h +++ b/ndb/include/util/ndb_opts.h @@ -32,10 +32,13 @@ 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 }, \ { "version", 'V', "Output version information and exit.", 0, 0, 0, \ GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 }, \ - { "connect-string", 'c', \ + { "ndb-connectstring", 'c', \ "Set connect string for connecting to ndb_mgmd. " \ - "=\"host=[;nodeid=]\". " \ - "Overides specifying entries in NDB_CONNECTSTRING and config file", \ + "Syntax: \"[nodeid=;][host=][:]\". " \ + "Overides specifying entries in NDB_CONNECTSTRING and Ndb.cfg", \ + (gptr*) &opt_connect_str, (gptr*) &opt_connect_str, 0, \ + GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },\ + { "connect-string", 'c', "same as --ndb-connectstring",\ (gptr*) &opt_connect_str, (gptr*) &opt_connect_str, 0, \ GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 } #else @@ -46,11 +49,14 @@ 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 }, \ { "version", 'V', "Output version information and exit.", 0, 0, 0, \ GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 }, \ - { "connect-string", 'c', \ + { "ndb-connectstring", 'c', \ "Set connect string for connecting to ndb_mgmd. " \ - "=\"host=[;nodeid=]\". " \ - "Overides specifying entries in NDB_CONNECTSTRING and config file", \ + "Syntax: \"[nodeid=;][host=][:]\". " \ + "Overides specifying entries in NDB_CONNECTSTRING and Ndb.cfg", \ (gptr*) &opt_connect_str, (gptr*) &opt_connect_str, 0, \ + GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },\ + { "connect-string", 'c', "same as --ndb-connectstring",\ + (gptr*) &opt_connect_str, (gptr*) &opt_connect_str, 0,\ GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 } #endif diff --git a/ndb/src/kernel/vm/Configuration.cpp b/ndb/src/kernel/vm/Configuration.cpp index aac035fe1b7..61615c85337 100644 --- a/ndb/src/kernel/vm/Configuration.cpp +++ b/ndb/src/kernel/vm/Configuration.cpp @@ -108,7 +108,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), bool Configuration::init(int argc, char** argv) { - const char *load_default_groups[]= { "ndbd",0 }; + const char *load_default_groups[]= { "mysql_cluster","ndbd",0 }; load_defaults("my",load_default_groups,&argc,&argv); int ho_error; diff --git a/ndb/src/mgmclient/main.cpp b/ndb/src/mgmclient/main.cpp index 401a9198f30..8cdba854fc4 100644 --- a/ndb/src/mgmclient/main.cpp +++ b/ndb/src/mgmclient/main.cpp @@ -138,7 +138,7 @@ int main(int argc, char** argv){ NDB_INIT(argv[0]); const char *_host = 0; int _port = 0; - const char *load_default_groups[]= { "ndb_mgm",0 }; + const char *load_default_groups[]= { "mysql_cluster","ndb_mgm",0 }; load_defaults("my",load_default_groups,&argc,&argv); int ho_error; diff --git a/ndb/src/mgmsrv/main.cpp b/ndb/src/mgmsrv/main.cpp index 76f0679b069..85bcb849d0e 100644 --- a/ndb/src/mgmsrv/main.cpp +++ b/ndb/src/mgmsrv/main.cpp @@ -110,10 +110,14 @@ static struct my_option my_long_options[] = 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 }, { "version", 'V', "Output version information and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 }, - { "connect-string", 1023, + { "ndb-connectstring", 1023, "Set connect string for connecting to ndb_mgmd. " - "=\"host=[;nodeid=]\". " - "Overides specifying entries in NDB_CONNECTSTRING and config file", + "Syntax: \"[nodeid=;][host=][:]\". " + "Overides specifying entries in NDB_CONNECTSTRING and Ndb.cfg", + (gptr*) &opt_connect_str, (gptr*) &opt_connect_str, 0, + GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, + { "connect-string", 1023, + "same as --ndb-connectstring.", (gptr*) &opt_connect_str, (gptr*) &opt_connect_str, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, { "config-file", 'f', "Specify cluster configuration file", @@ -196,7 +200,7 @@ int main(int argc, char** argv) global_mgmt_server_check = 1; glob.config_filename= "config.ini"; - const char *load_default_groups[]= { "ndb_mgmd",0 }; + const char *load_default_groups[]= { "mysql_cluster","ndb_mgmd",0 }; load_defaults("my",load_default_groups,&argc,&argv); int ho_error; diff --git a/ndb/tools/delete_all.cpp b/ndb/tools/delete_all.cpp index a4fd73a5128..046ac8005d2 100644 --- a/ndb/tools/delete_all.cpp +++ b/ndb/tools/delete_all.cpp @@ -67,7 +67,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), int main(int argc, char** argv){ NDB_INIT(argv[0]); - const char *load_default_groups[]= { "ndb_tools",0 }; + const char *load_default_groups[]= { "mysql_cluster",0 }; load_defaults("my",load_default_groups,&argc,&argv); int ho_error; if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option))) diff --git a/ndb/tools/desc.cpp b/ndb/tools/desc.cpp index 8f7a2031ef0..c5e9efdfa8a 100644 --- a/ndb/tools/desc.cpp +++ b/ndb/tools/desc.cpp @@ -67,7 +67,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), int main(int argc, char** argv){ NDB_INIT(argv[0]); - const char *load_default_groups[]= { "ndb_tools",0 }; + const char *load_default_groups[]= { "mysql_cluster",0 }; load_defaults("my",load_default_groups,&argc,&argv); int ho_error; if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option))) diff --git a/ndb/tools/drop_index.cpp b/ndb/tools/drop_index.cpp index 1d4b454682f..6600811e0c4 100644 --- a/ndb/tools/drop_index.cpp +++ b/ndb/tools/drop_index.cpp @@ -64,7 +64,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), int main(int argc, char** argv){ NDB_INIT(argv[0]); - const char *load_default_groups[]= { "ndb_tools",0 }; + const char *load_default_groups[]= { "mysql_cluster",0 }; load_defaults("my",load_default_groups,&argc,&argv); int ho_error; if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option))) diff --git a/ndb/tools/drop_tab.cpp b/ndb/tools/drop_tab.cpp index 3362c7de47b..0661a8c599b 100644 --- a/ndb/tools/drop_tab.cpp +++ b/ndb/tools/drop_tab.cpp @@ -64,7 +64,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), int main(int argc, char** argv){ NDB_INIT(argv[0]); - const char *load_default_groups[]= { "ndb_tools",0 }; + const char *load_default_groups[]= { "mysql_cluster",0 }; load_defaults("my",load_default_groups,&argc,&argv); int ho_error; if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option))) diff --git a/ndb/tools/listTables.cpp b/ndb/tools/listTables.cpp index 05e864a35c4..b923207a4fe 100644 --- a/ndb/tools/listTables.cpp +++ b/ndb/tools/listTables.cpp @@ -220,7 +220,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), int main(int argc, char** argv){ NDB_INIT(argv[0]); const char* _tabname; - const char *load_default_groups[]= { "ndb_tools",0 }; + const char *load_default_groups[]= { "mysql_cluster",0 }; load_defaults("my",load_default_groups,&argc,&argv); int ho_error; if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option))) diff --git a/ndb/tools/restore/restore_main.cpp b/ndb/tools/restore/restore_main.cpp index c43791c6723..409ebd54764 100644 --- a/ndb/tools/restore/restore_main.cpp +++ b/ndb/tools/restore/restore_main.cpp @@ -143,7 +143,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), bool readArguments(int *pargc, char*** pargv) { - const char *load_default_groups[]= { "ndb_tools","ndb_restore",0 }; + const char *load_default_groups[]= { "mysql_cluster","ndb_restore",0 }; load_defaults("my",load_default_groups,pargc,pargv); if (handle_options(pargc, pargv, my_long_options, get_one_option)) { diff --git a/ndb/tools/select_all.cpp b/ndb/tools/select_all.cpp index 758c1e48c88..77e5e14548e 100644 --- a/ndb/tools/select_all.cpp +++ b/ndb/tools/select_all.cpp @@ -105,7 +105,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), int main(int argc, char** argv){ NDB_INIT(argv[0]); - const char *load_default_groups[]= { "ndb_tools",0 }; + const char *load_default_groups[]= { "mysql_cluster",0 }; load_defaults("my",load_default_groups,&argc,&argv); const char* _tabname; int ho_error; diff --git a/ndb/tools/select_count.cpp b/ndb/tools/select_count.cpp index 6ee49ddbff0..c3491f842d8 100644 --- a/ndb/tools/select_count.cpp +++ b/ndb/tools/select_count.cpp @@ -83,7 +83,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), int main(int argc, char** argv){ NDB_INIT(argv[0]); - const char *load_default_groups[]= { "ndb_tools",0 }; + const char *load_default_groups[]= { "mysql_cluster",0 }; load_defaults("my",load_default_groups,&argc,&argv); int ho_error; if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option))) diff --git a/ndb/tools/waiter.cpp b/ndb/tools/waiter.cpp index e24164ea807..753e56cabde 100644 --- a/ndb/tools/waiter.cpp +++ b/ndb/tools/waiter.cpp @@ -75,7 +75,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), int main(int argc, char** argv){ NDB_INIT(argv[0]); - const char *load_default_groups[]= { "ndb_tools",0 }; + const char *load_default_groups[]= { "mysql_cluster",0 }; load_defaults("my",load_default_groups,&argc,&argv); const char* _hostName = NULL; int ho_error; From d2d4b48876fd1d4785495ea2daaa709e2b3036a0 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 22 Nov 2004 10:34:29 +0200 Subject: [PATCH 0295/1063] Fixed BUG #6747: innodb_locks_unsafe_for_binlog still uses next-key locking. innobase/row/row0sel.c: Fixed bug: innodb_locks_unsafe_for_binlog still uses next-key locking (BUG #6747). We do not take gap type locks when using InnoDB startup option innodb_locks_unsafe_for_binlog. Some code polishing also done. --- innobase/row/row0sel.c | 128 ++++++++++++++++++++++------------------- 1 file changed, 69 insertions(+), 59 deletions(-) diff --git a/innobase/row/row0sel.c b/innobase/row/row0sel.c index 740241fa210..5b7d068d0c1 100644 --- a/innobase/row/row0sel.c +++ b/innobase/row/row0sel.c @@ -638,23 +638,24 @@ row_sel_get_clust_rec( if (!node->read_view) { /* Try to place a lock on the index record */ - /* If innodb_locks_unsafe_for_binlog option is used, - we lock only the record, i.e. next-key locking is - not used. - */ - if ( srv_locks_unsafe_for_binlog ) - { - err = lock_clust_rec_read_check_and_lock(0, clust_rec, - index,node->row_lock_mode, LOCK_REC_NOT_GAP, thr); - } - else - { - err = lock_clust_rec_read_check_and_lock(0, clust_rec, index, - node->row_lock_mode, LOCK_ORDINARY, thr); + /* If innodb_locks_unsafe_for_binlog option is used, + we lock only the record, i.e. next-key locking is + not used. + */ - } + if (srv_locks_unsafe_for_binlog) { + err = lock_clust_rec_read_check_and_lock(0, + clust_rec, + index, node->row_lock_mode, + LOCK_REC_NOT_GAP, thr); + } else { + err = lock_clust_rec_read_check_and_lock(0, + clust_rec, + index, node->row_lock_mode, + LOCK_ORDINARY, thr); + } - if (err != DB_SUCCESS) { + if (err != DB_SUCCESS) { return(err); } @@ -1205,22 +1206,24 @@ rec_loop: if (!consistent_read) { - /* If innodb_locks_unsafe_for_binlog option is used, - we lock only the record, i.e. next-key locking is - not used. - */ + /* If innodb_locks_unsafe_for_binlog option is used, + we lock only the record, i.e. next-key locking is + not used. + */ - if ( srv_locks_unsafe_for_binlog ) - { - err = sel_set_rec_lock(page_rec_get_next(rec), index, - node->row_lock_mode, LOCK_REC_NOT_GAP, thr); - } - else - { - err = sel_set_rec_lock(page_rec_get_next(rec), index, - node->row_lock_mode, LOCK_ORDINARY, thr); - } - if (err != DB_SUCCESS) { + if (srv_locks_unsafe_for_binlog) { + err = sel_set_rec_lock(page_rec_get_next(rec), + index, + node->row_lock_mode, + LOCK_REC_NOT_GAP, thr); + } else { + err = sel_set_rec_lock(page_rec_get_next(rec), + index, + node->row_lock_mode, + LOCK_ORDINARY, thr); + } + + if (err != DB_SUCCESS) { /* Note that in this case we will store in pcur the PREDECESSOR of the record we are waiting the lock for */ @@ -1245,21 +1248,18 @@ rec_loop: if (!consistent_read) { /* Try to place a lock on the index record */ - /* If innodb_locks_unsafe_for_binlog option is used, - we lock only the record, i.e. next-key locking is - not used. - */ + /* If innodb_locks_unsafe_for_binlog option is used, + we lock only the record, i.e. next-key locking is + not used. + */ - if ( srv_locks_unsafe_for_binlog ) - { - err = sel_set_rec_lock(rec, index, node->row_lock_mode, + if (srv_locks_unsafe_for_binlog) { + err = sel_set_rec_lock(rec, index, node->row_lock_mode, LOCK_REC_NOT_GAP, thr); - } - else - { - err = sel_set_rec_lock(rec, index, node->row_lock_mode, + } else { + err = sel_set_rec_lock(rec, index, node->row_lock_mode, LOCK_ORDINARY, thr); - } + } if (err != DB_SUCCESS) { @@ -3209,8 +3209,7 @@ rec_loop: we do not lock gaps. Supremum record is really a gap and therefore we do not set locks there. */ - if ( srv_locks_unsafe_for_binlog == FALSE ) - { + if (srv_locks_unsafe_for_binlog == FALSE) { err = sel_set_rec_lock(rec, index, prebuilt->select_lock_type, LOCK_ORDINARY, thr); @@ -3312,11 +3311,18 @@ rec_loop: if (prebuilt->select_lock_type != LOCK_NONE && set_also_gap_locks) { - /* Try to place a lock on the index record */ - err = sel_set_rec_lock(rec, index, + /* Try to place a gap lock on the index + record only if innodb_locks_unsafe_for_binlog + option is not set */ + + if (srv_locks_unsafe_for_binlog == FALSE) { + + err = sel_set_rec_lock(rec, index, prebuilt->select_lock_type, LOCK_GAP, thr); + } + if (err != DB_SUCCESS) { goto lock_wait_or_error; @@ -3338,11 +3344,18 @@ rec_loop: if (prebuilt->select_lock_type != LOCK_NONE && set_also_gap_locks) { - /* Try to place a lock on the index record */ - err = sel_set_rec_lock(rec, index, + /* Try to place a gap lock on the index + record only if innodb_locks_unsafe_for_binlog + option is not set */ + + if (srv_locks_unsafe_for_binlog == FALSE) { + + err = sel_set_rec_lock(rec, index, prebuilt->select_lock_type, LOCK_GAP, thr); + } + if (err != DB_SUCCESS) { goto lock_wait_or_error; @@ -3376,19 +3389,16 @@ rec_loop: prebuilt->select_lock_type, LOCK_REC_NOT_GAP, thr); } else { - /* If innodb_locks_unsafe_for_binlog option is used, - we lock only the record, i.e. next-key locking is - not used. - */ - if ( srv_locks_unsafe_for_binlog ) - { - err = sel_set_rec_lock(rec, index, + /* If innodb_locks_unsafe_for_binlog option is used, + we lock only the record, i.e. next-key locking is + not used. */ + + if (srv_locks_unsafe_for_binlog) { + err = sel_set_rec_lock(rec, index, prebuilt->select_lock_type, LOCK_REC_NOT_GAP, thr); - } - else - { - err = sel_set_rec_lock(rec, index, + } else { + err = sel_set_rec_lock(rec, index, prebuilt->select_lock_type, LOCK_ORDINARY, thr); } From abb53b6f99ffdabb41b71dca70f93701bea9c772 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 22 Nov 2004 13:02:27 +0400 Subject: [PATCH 0296/1063] uca-dump.c: Mofidications to dump secondary and tertiary weigthts And some minor improvements strings/uca-dump.c: Mofidications to dump secondary and tertiary weigthts And some minor improvements --- strings/uca-dump.c | 80 ++++++++++++++++++++++++++++++++-------------- 1 file changed, 56 insertions(+), 24 deletions(-) diff --git a/strings/uca-dump.c b/strings/uca-dump.c index 6836c321526..c9642598c3c 100644 --- a/strings/uca-dump.c +++ b/strings/uca-dump.c @@ -23,13 +23,14 @@ struct uca_item_st #define MY_UCA_PSHIFT 8 #endif +static char *pname[]= {"", "2", "3"}; + int main(int ac, char **av) { char str[256]; char *weights[64]; struct uca_item_st uca[64*1024]; - size_t code, page, w; - int pagemaxlen[MY_UCA_NPAGES]; + size_t code, w; int pageloaded[MY_UCA_NPAGES]; bzero(uca, sizeof(uca)); @@ -155,14 +156,20 @@ int main(int ac, char **av) printf("#define MY_UCA_CMASK %d\n",MY_UCA_CMASK); printf("#define MY_UCA_PSHIFT %d\n",MY_UCA_PSHIFT); - for (w=0; w<1; w++) + for (w=0; w<3; w++) { + size_t page; + int pagemaxlen[MY_UCA_NPAGES]; + for (page=0; page < MY_UCA_NPAGES; page++) { size_t offs; size_t maxnum= 0; size_t nchars= 0; size_t mchars; + size_t ndefs= 0; + + pagemaxlen[page]= 0; /* Skip this page if no weights were loaded @@ -183,15 +190,37 @@ int main(int ac, char **av) code= page*MY_UCA_NCHARS+offs; /* Calculate only non-zero weights */ - num=0; - for (i=0; i < uca[code].num; i++) + for (num=0, i=0; i < uca[code].num; i++) if (uca[code].weight[w][i]) num++; maxnum= maxnum < num ? num : maxnum; + + /* Check if default weight */ + if (w == 1 && num == 1) + { + /* 0020 0000 ... */ + if (uca[code].weight[w][0] == 0x0020) + ndefs++; + } + else if (w == 2 && num == 1) + { + /* 0002 0000 ... */ + if (uca[code].weight[w][0] == 0x0002) + ndefs++; + } } maxnum++; + /* + If the page have only default weights + then no needs to dump it, skip. + */ + if (ndefs == MY_UCA_NCHARS) + { + printf("/* Don't dump w=%d pg=%3X: ndefs=%d */\n",w, page, ndefs); + continue; + } switch (maxnum) { case 0: mchars= 8; break; @@ -210,8 +239,8 @@ int main(int ac, char **av) */ - printf("uint16 page%03Xdata[]= { /* %04X (%d weights per char) */\n", - page, page*MY_UCA_NCHARS, maxnum); + printf("uint16 page%03Xdata%s[]= { /* %04X (%d weights per char) */\n", + page, pname[w], page*MY_UCA_NCHARS, maxnum); for (offs=0; offs < MY_UCA_NCHARS; offs++) { @@ -251,25 +280,28 @@ int main(int ac, char **av) } printf("};\n\n"); } + + printf("uchar ucal%s[%d]={\n", pname[w], MY_UCA_NPAGES); + for (page=0; page < MY_UCA_NPAGES; page++) + { + printf("%d%s%s",pagemaxlen[page],page Date: Mon, 22 Nov 2004 10:35:03 +0100 Subject: [PATCH 0297/1063] Added checks for NOT NULL for all fields in UNIQUE INDEX (USING HASH) --- mysql-test/r/ndb_index_unique.result | 7 +++++++ mysql-test/t/ndb_index_unique.test | 8 ++++++++ sql/ha_ndbcluster.cc | 23 ++++++++++++++++++++++- sql/ha_ndbcluster.h | 3 ++- 4 files changed, 39 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/ndb_index_unique.result b/mysql-test/r/ndb_index_unique.result index af9b84022ed..9754be84b17 100644 --- a/mysql-test/r/ndb_index_unique.result +++ b/mysql-test/r/ndb_index_unique.result @@ -87,6 +87,13 @@ a b c 7 8 3 8 2 3 drop table t2; +CREATE TABLE t2 ( +a int unsigned NOT NULL PRIMARY KEY, +b int unsigned not null, +c int unsigned, +UNIQUE USING HASH (b, c) +) engine=ndbcluster; +ERROR 42000: Column 'c' is used with UNIQUE or INDEX but is not defined as NOT NULL CREATE TABLE t3 ( a int unsigned NOT NULL, b int unsigned not null, diff --git a/mysql-test/t/ndb_index_unique.test b/mysql-test/t/ndb_index_unique.test index bdb23949763..3b7cecf6a69 100644 --- a/mysql-test/t/ndb_index_unique.test +++ b/mysql-test/t/ndb_index_unique.test @@ -58,6 +58,14 @@ select * from t2 order by a; drop table t2; +-- error 1121 +CREATE TABLE t2 ( + a int unsigned NOT NULL PRIMARY KEY, + b int unsigned not null, + c int unsigned, + UNIQUE USING HASH (b, c) +) engine=ndbcluster; + # # Show use of PRIMARY KEY USING HASH indexes # diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index bec4dfd9401..77cc7ce5bc4 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -796,7 +796,8 @@ int ha_ndbcluster::build_index_list(TABLE *tab, enum ILBP phase) error= create_unique_index(unique_index_name, key_info); break; case UNIQUE_INDEX: - error= create_unique_index(unique_index_name, key_info); + if (!(error= check_index_fields_not_null(i))) + error= create_unique_index(unique_index_name, key_info); break; case ORDERED_INDEX: error= create_ordered_index(index_name, key_info); @@ -848,6 +849,26 @@ NDB_INDEX_TYPE ha_ndbcluster::get_index_type_from_table(uint inx) const ORDERED_INDEX); } +int ha_ndbcluster::check_index_fields_not_null(uint inx) +{ + KEY* key_info= table->key_info + inx; + KEY_PART_INFO* key_part= key_info->key_part; + KEY_PART_INFO* end= key_part+key_info->key_parts; + DBUG_ENTER("check_index_fields_not_null"); + + for (; key_part != end; key_part++) + { + Field* field= key_part->field; + if (field->maybe_null()) + { + my_printf_error(ER_NULL_COLUMN_IN_INDEX,ER(ER_NULL_COLUMN_IN_INDEX), + MYF(0),field->field_name); + DBUG_RETURN(ER_NULL_COLUMN_IN_INDEX); + } + } + + DBUG_RETURN(0); +} void ha_ndbcluster::release_metadata() { diff --git a/sql/ha_ndbcluster.h b/sql/ha_ndbcluster.h index 9d7cba459cb..1b49aca81e6 100644 --- a/sql/ha_ndbcluster.h +++ b/sql/ha_ndbcluster.h @@ -160,7 +160,8 @@ class ha_ndbcluster: public handler void release_metadata(); NDB_INDEX_TYPE get_index_type(uint idx_no) const; NDB_INDEX_TYPE get_index_type_from_table(uint index_no) const; - + int check_index_fields_not_null(uint index_no); + int pk_read(const byte *key, uint key_len, byte *buf); int complemented_pk_read(const byte *old_data, byte *new_data); int peek_row(); From 4389be7557d4367cbdc9ec64c4ce4494e54e2822 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 22 Nov 2004 13:05:10 +0300 Subject: [PATCH 0298/1063] Fix for bug #6462 "Same request on same data returns different results." a.k.a. "Proper cleanup of subqueries is missing for SET and DO statements". (Version #2 with after-review fixes). To perform proper cleanup for statements that can contain subqueries but don't have main select we must call free_undelaid_joins(). mysql-test/r/subselect.result: Added test for bug #6462 "Same request on same data returns different results." a.k.a. "Proper cleanup of subqueries is missing for SET and DO statements". mysql-test/t/subselect.test: Added test for bug #6462 "Same request on same data returns different results." a.k.a. "Proper cleanup of subqueries is missing for SET and DO statements". sql/set_var.cc: Added missing cleanup of joins used in subqueries to SET statement. sql/sql_do.cc: Added missing cleanup of joins used in subqueries to DO statement. --- mysql-test/r/subselect.result | 15 +++++++++++++++ mysql-test/t/subselect.test | 19 +++++++++++++++++++ sql/set_var.cc | 17 +++++++++++------ sql/sql_do.cc | 1 + 4 files changed, 46 insertions(+), 6 deletions(-) diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index 32d482f5a32..53b92fe50f1 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -1990,3 +1990,18 @@ ac 700 NULL drop tables t1,t2; +create table t1 (a int not null, b int not null, c int, primary key (a,b)); +insert into t1 values (1,1,1), (2,2,2), (3,3,3); +set @b:= 0; +explain select sum(a) from t1 where b > @b; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL PRIMARY 8 NULL 3 Using where; Using index +set @a:= (select sum(a) from t1 where b > @b); +explain select a from t1 where c=2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using where +do @a:= (select sum(a) from t1 where b > @b); +explain select a from t1 where c=2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using where +drop table t1; diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test index e0f6fcbf515..19bfaa6194a 100644 --- a/mysql-test/t/subselect.test +++ b/mysql-test/t/subselect.test @@ -1282,3 +1282,22 @@ INSERT INTO `t2` VALUES (6,5,12,7,'a'),(12,0,0,7,'a'),(12,1,0,7,'a'),(12,5,5,7,' SELECT b.sc FROM (SELECT (SELECT a.access FROM t1 a WHERE a.map = op.map AND a.slave = op.pid AND a.master = 1) ac FROM t2 op WHERE op.id = 12 AND op.map = 0) b; SELECT b.ac FROM (SELECT (SELECT a.access FROM t1 a WHERE a.map = op.map AND a.slave = op.pid AND a.master = 1) ac FROM t2 op WHERE op.id = 12 AND op.map = 0) b; drop tables t1,t2; + +# +# Test for bug #6462. "Same request on same data returns different +# results." a.k.a. "Proper cleanup of subqueries is missing for +# SET and DO statements". +# +create table t1 (a int not null, b int not null, c int, primary key (a,b)); +insert into t1 values (1,1,1), (2,2,2), (3,3,3); +set @b:= 0; +# Let us check that subquery will use covering index +explain select sum(a) from t1 where b > @b; +# This should not crash -debug server due to failing assertion +set @a:= (select sum(a) from t1 where b > @b); +# And this should not falsely report index usage +explain select a from t1 where c=2; +# Same for DO statement +do @a:= (select sum(a) from t1 where b > @b); +explain select a from t1 where c=2; +drop table t1; diff --git a/sql/set_var.cc b/sql/set_var.cc index a97506ad07c..bc0f2c2a02c 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -2703,13 +2703,18 @@ int sql_set_variables(THD *thd, List *var_list) while ((var=it++)) { if ((error=var->check(thd))) - DBUG_RETURN(error); + goto err; } - if (thd->net.report_error) - DBUG_RETURN(1); - it.rewind(); - while ((var=it++)) - error|= var->update(thd); // Returns 0, -1 or 1 + if (!thd->net.report_error) + { + it.rewind(); + while ((var= it++)) + error|= var->update(thd); // Returns 0, -1 or 1 + } + else + error= 1; +err: + free_underlaid_joins(thd, &thd->lex->select_lex); DBUG_RETURN(error); } diff --git a/sql/sql_do.cc b/sql/sql_do.cc index 25a8359f3d2..0d4529fb29e 100644 --- a/sql/sql_do.cc +++ b/sql/sql_do.cc @@ -29,6 +29,7 @@ int mysql_do(THD *thd, List &values) DBUG_RETURN(-1); while ((value = li++)) value->val_int(); + free_underlaid_joins(thd, &thd->lex->select_lex); thd->clear_error(); // DO always is OK send_ok(thd); DBUG_RETURN(0); From 404b1524857330187a01209465758e2e02ad8bdb Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 22 Nov 2004 10:47:59 +0000 Subject: [PATCH 0299/1063] removed unused variables assigned "localhost" as default connectstring added a disconnect() first in connect() removed double implementation of connect code, use connect() in NdbRestarter removed extra "host=" in connectstring ndb/include/mgmapi/mgmapi.h: removed wrong comment ndb/test/include/NdbRestarter.hpp: removed unused variables ndb/test/src/NdbBackup.cpp: removed double implementation of connect code, use connect() in NdbRestarter removed extra "host=" in connectstring ndb/test/src/NdbRestarter.cpp: removed unused variables assigned "localhost" as default connectstring added a disconnect() first in connect() --- ndb/include/mgmapi/mgmapi.h | 2 -- ndb/test/include/NdbRestarter.hpp | 2 -- ndb/test/src/NdbBackup.cpp | 31 ++++++++++++------------------- ndb/test/src/NdbRestarter.cpp | 4 ++-- 4 files changed, 14 insertions(+), 25 deletions(-) diff --git a/ndb/include/mgmapi/mgmapi.h b/ndb/include/mgmapi/mgmapi.h index a4e1fc1d1a8..a23417f153a 100644 --- a/ndb/include/mgmapi/mgmapi.h +++ b/ndb/include/mgmapi/mgmapi.h @@ -356,8 +356,6 @@ extern "C" { /** * Create a handle to a management server * - * @param connect_string Connect string to the management server, - * * @return A management handle
* or NULL if no management handle could be created. */ diff --git a/ndb/test/include/NdbRestarter.hpp b/ndb/test/include/NdbRestarter.hpp index 114726f6a2b..19a88b4f8ad 100644 --- a/ndb/test/include/NdbRestarter.hpp +++ b/ndb/test/include/NdbRestarter.hpp @@ -87,8 +87,6 @@ protected: bool connected; BaseString addr; - BaseString host; - int port; NdbMgmHandle handle; ndb_mgm_configuration * m_config; protected: diff --git a/ndb/test/src/NdbBackup.cpp b/ndb/test/src/NdbBackup.cpp index 398a7c32fc4..655fdda7c95 100644 --- a/ndb/test/src/NdbBackup.cpp +++ b/ndb/test/src/NdbBackup.cpp @@ -69,26 +69,19 @@ NdbBackup::getBackupDataDirForNode(int _node_id){ /** * Fetch configuration from management server */ - ConfigRetriever cr(0, 0, NODE_TYPE_API); - ndb_mgm_configuration * p = 0; + ndb_mgm_configuration *p; + if (connect()) + return NULL; - BaseString tmp; tmp.assfmt("%s:%d", host.c_str(), port); - NdbMgmHandle handle = ndb_mgm_create_handle(); - if(handle == 0 || - ndb_mgm_set_connectstring(handle,tmp.c_str()) != 0 || - ndb_mgm_connect(handle,0,0,0) != 0 || - (p = ndb_mgm_get_configuration(handle, 0)) == 0){ - - const char * s = 0; - if(p == 0 && handle != 0){ - s = ndb_mgm_get_latest_error_msg(handle); - if(s == 0) - s = "No error given!"; + if ((p = ndb_mgm_get_configuration(handle, 0)) == 0) + { + const char * s= ndb_mgm_get_latest_error_msg(handle); + if(s == 0) + s = "No error given!"; - ndbout << "Could not fetch configuration" << endl; - ndbout << s << endl; - return NULL; - } + ndbout << "Could not fetch configuration" << endl; + ndbout << s << endl; + return NULL; } /** @@ -153,7 +146,7 @@ NdbBackup::execRestore(bool _restore_data, ndbout << "scp res: " << res << endl; - BaseString::snprintf(buf, 255, "%sndb_restore -c \"host=%s\" -n %d -b %d %s %s .", + BaseString::snprintf(buf, 255, "%sndb_restore -c \"%s\" -n %d -b %d %s %s .", #if 1 "", #else diff --git a/ndb/test/src/NdbRestarter.cpp b/ndb/test/src/NdbRestarter.cpp index e1802f36e82..1c5fbbabb42 100644 --- a/ndb/test/src/NdbRestarter.cpp +++ b/ndb/test/src/NdbRestarter.cpp @@ -32,12 +32,11 @@ NdbRestarter::NdbRestarter(const char* _addr): connected(false), - port(-1), handle(NULL), m_config(0) { if (_addr == NULL){ - addr.assign(""); + addr.assign("localhost"); } else { addr.assign(_addr); } @@ -360,6 +359,7 @@ NdbRestarter::isConnected(){ int NdbRestarter::connect(){ + disconnect(); handle = ndb_mgm_create_handle(); if (handle == NULL){ g_err << "handle == NULL" << endl; From e112166f00c8303af15ba4548c182e53156752a8 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 22 Nov 2004 14:17:04 +0300 Subject: [PATCH 0300/1063] Backport of fix making myisam test results repeatable --- mysql-test/r/myisam.result | 1 + mysql-test/t/myisam.test | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/myisam.result b/mysql-test/r/myisam.result index 31b14f9b822..d155a14bb60 100644 --- a/mysql-test/r/myisam.result +++ b/mysql-test/r/myisam.result @@ -529,6 +529,7 @@ show keys from t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment t1 1 a 1 a A NULL NULL NULL YES BTREE disabled create table t2 (a int); +set @@rand_seed1=31415926,@@rand_seed2=2718281828; insert t1 select * from t2; show keys from t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment diff --git a/mysql-test/t/myisam.test b/mysql-test/t/myisam.test index f9081e8769b..c8ed7910b76 100644 --- a/mysql-test/t/myisam.test +++ b/mysql-test/t/myisam.test @@ -498,11 +498,12 @@ alter table t1 disable keys; show keys from t1; create table t2 (a int); let $i=1000; +set @@rand_seed1=31415926,@@rand_seed2=2718281828; --disable_query_log while ($i) { dec $i; - eval insert t2 values (rand()*100000); + insert t2 values (rand()*100000); } --enable_query_log insert t1 select * from t2; From bbbfd3e29726efce1536d5fd78670636e4ddca44 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 22 Nov 2004 13:58:11 +0100 Subject: [PATCH 0301/1063] Added NULL value tests for UNIQUE index --- mysql-test/r/ndb_index_unique.result | 45 ++++++++++++++++++++++++++++ mysql-test/t/ndb_index_unique.test | 26 ++++++++++++++++ 2 files changed, 71 insertions(+) diff --git a/mysql-test/r/ndb_index_unique.result b/mysql-test/r/ndb_index_unique.result index 9754be84b17..31b258c0a6f 100644 --- a/mysql-test/r/ndb_index_unique.result +++ b/mysql-test/r/ndb_index_unique.result @@ -44,6 +44,51 @@ a b c 7 8 3 8 2 3 drop table t1; +CREATE TABLE t1 ( +a int unsigned NOT NULL PRIMARY KEY, +b int unsigned, +c int unsigned, +UNIQUE bc(b,c) +) engine = ndb; +insert into t1 values(1,1,1),(2,NULL,2),(3,NULL,NULL),(4,4,NULL); +select * from t1 use index (bc) where b IS NULL order by a; +a b c +2 NULL 2 +3 NULL NULL +select * from t1 use index (bc)order by a; +a b c +1 1 1 +2 NULL 2 +3 NULL NULL +4 4 NULL +select * from t1 use index (bc) order by a; +a b c +1 1 1 +2 NULL 2 +3 NULL NULL +4 4 NULL +select * from t1 use index (PRIMARY) where b IS NULL order by a; +a b c +2 NULL 2 +3 NULL NULL +select * from t1 use index (bc) where b IS NULL order by a; +a b c +2 NULL 2 +3 NULL NULL +select * from t1 use index (bc) where b IS NULL and c IS NULL order by a; +a b c +select * from t1 use index (bc) where b IS NULL and c = 2 order by a; +a b c +select * from t1 use index (bc) where b < 4 order by a; +a b c +1 1 1 +select * from t1 use index (bc) where b IS NOT NULL order by a; +a b c +1 1 1 +4 4 NULL +insert into t1 values(5,1,1); +ERROR 23000: Duplicate entry '5' for key 1 +drop table t1; CREATE TABLE t2 ( a int unsigned NOT NULL PRIMARY KEY, b int unsigned not null, diff --git a/mysql-test/t/ndb_index_unique.test b/mysql-test/t/ndb_index_unique.test index 3b7cecf6a69..397a2c45a9f 100644 --- a/mysql-test/t/ndb_index_unique.test +++ b/mysql-test/t/ndb_index_unique.test @@ -30,6 +30,32 @@ select * from t1 order by a; drop table t1; +# +# Indexing NULL values +# + +CREATE TABLE t1 ( + a int unsigned NOT NULL PRIMARY KEY, + b int unsigned, + c int unsigned, + UNIQUE bc(b,c) +) engine = ndb; + +insert into t1 values(1,1,1),(2,NULL,2),(3,NULL,NULL),(4,4,NULL); +select * from t1 use index (bc) where b IS NULL order by a; + +select * from t1 use index (bc)order by a; +select * from t1 use index (bc) order by a; +select * from t1 use index (PRIMARY) where b IS NULL order by a; +select * from t1 use index (bc) where b IS NULL order by a; +select * from t1 use index (bc) where b IS NULL and c IS NULL order by a; +select * from t1 use index (bc) where b IS NULL and c = 2 order by a; +select * from t1 use index (bc) where b < 4 order by a; +select * from t1 use index (bc) where b IS NOT NULL order by a; +-- error 1062 +insert into t1 values(5,1,1); +drop table t1; + # # Show use of UNIQUE USING HASH indexes From cfca008544454203b914c5e2888acd0034a0df20 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 22 Nov 2004 13:41:46 +0000 Subject: [PATCH 0302/1063] added force send interface to scan prepared for using query cache in ndb ndb/include/ndbapi/NdbIndexScanOperation.hpp: added force send interface to scan ndb/include/ndbapi/NdbResultSet.hpp: added force send interface to scan ndb/include/ndbapi/NdbScanOperation.hpp: added force send interface to scan ndb/src/ndbapi/NdbResultSet.cpp: added force send interface to scan ndb/src/ndbapi/NdbScanOperation.cpp: added force send interface to scan --- ndb/include/ndbapi/NdbIndexScanOperation.hpp | 6 +-- ndb/include/ndbapi/NdbResultSet.hpp | 6 +-- ndb/include/ndbapi/NdbScanOperation.hpp | 11 +++-- ndb/src/ndbapi/NdbResultSet.cpp | 12 ++--- ndb/src/ndbapi/NdbScanOperation.cpp | 50 +++++++++++++------- sql/ha_ndbcluster.cc | 33 ++++++++----- sql/ha_ndbcluster.h | 2 + 7 files changed, 74 insertions(+), 46 deletions(-) diff --git a/ndb/include/ndbapi/NdbIndexScanOperation.hpp b/ndb/include/ndbapi/NdbIndexScanOperation.hpp index 66b3fc9d43b..a3388f62f58 100644 --- a/ndb/include/ndbapi/NdbIndexScanOperation.hpp +++ b/ndb/include/ndbapi/NdbIndexScanOperation.hpp @@ -113,7 +113,7 @@ public: * Reset bounds and put operation in list that will be * sent on next execute */ - int reset_bounds(); + int reset_bounds(bool forceSend = false); bool getSorted() const { return m_ordered; } private: @@ -127,8 +127,8 @@ private: virtual NdbRecAttr* getValue_impl(const NdbColumnImpl*, char*); void fix_get_values(); - int next_result_ordered(bool fetchAllowed); - int send_next_scan_ordered(Uint32 idx); + int next_result_ordered(bool fetchAllowed, bool forceSend = false); + int send_next_scan_ordered(Uint32 idx, bool forceSend = false); int compare(Uint32 key, Uint32 cols, const NdbReceiver*, const NdbReceiver*); Uint32 m_sort_columns; diff --git a/ndb/include/ndbapi/NdbResultSet.hpp b/ndb/include/ndbapi/NdbResultSet.hpp index 478daf8aad2..dc0288a380c 100644 --- a/ndb/include/ndbapi/NdbResultSet.hpp +++ b/ndb/include/ndbapi/NdbResultSet.hpp @@ -89,17 +89,17 @@ public: * - 1: if there are no more tuples to scan. * - 2: if there are no more cached records in NdbApi */ - int nextResult(bool fetchAllowed = true); + int nextResult(bool fetchAllowed = true, bool forceSend = false); /** * Close result set (scan) */ - void close(); + void close(bool forceSend = false); /** * Restart */ - int restart(); + int restart(bool forceSend = false); /** * Transfer scan operation to an updating transaction. Use this function diff --git a/ndb/include/ndbapi/NdbScanOperation.hpp b/ndb/include/ndbapi/NdbScanOperation.hpp index 2e4d173ac75..3c95c79e776 100644 --- a/ndb/include/ndbapi/NdbScanOperation.hpp +++ b/ndb/include/ndbapi/NdbScanOperation.hpp @@ -90,11 +90,11 @@ protected: NdbScanOperation(Ndb* aNdb); virtual ~NdbScanOperation(); - int nextResult(bool fetchAllowed = true); + int nextResult(bool fetchAllowed = true, bool forceSend = false); virtual void release(); - void closeScan(); - int close_impl(class TransporterFacade*); + void closeScan(bool forceSend = false); + int close_impl(class TransporterFacade*, bool forceSend = false); // Overloaded methods from NdbCursorOperation int executeCursor(int ProcessorId); @@ -103,6 +103,7 @@ protected: int init(const NdbTableImpl* tab, NdbConnection* myConnection); int prepareSend(Uint32 TC_ConnectPtr, Uint64 TransactionId); int doSend(int ProcessorId); + void checkForceSend(bool forceSend); virtual void setErrorCode(int aErrorCode); virtual void setErrorCodeAbort(int aErrorCode); @@ -138,7 +139,7 @@ protected: Uint32 m_sent_receivers_count; // NOTE needs mutex to access NdbReceiver** m_sent_receivers; // receive thread puts them here - int send_next_scan(Uint32 cnt, bool close); + int send_next_scan(Uint32 cnt, bool close, bool forceSend = false); void receiver_delivered(NdbReceiver*); void receiver_completed(NdbReceiver*); void execCLOSE_SCAN_REP(); @@ -148,7 +149,7 @@ protected: Uint32 m_ordered; - int restart(); + int restart(bool forceSend = false); }; inline diff --git a/ndb/src/ndbapi/NdbResultSet.cpp b/ndb/src/ndbapi/NdbResultSet.cpp index f270584d227..d9d71464026 100644 --- a/ndb/src/ndbapi/NdbResultSet.cpp +++ b/ndb/src/ndbapi/NdbResultSet.cpp @@ -44,10 +44,10 @@ void NdbResultSet::init() { } -int NdbResultSet::nextResult(bool fetchAllowed) +int NdbResultSet::nextResult(bool fetchAllowed, bool forceSend) { int res; - if ((res = m_operation->nextResult(fetchAllowed)) == 0) { + if ((res = m_operation->nextResult(fetchAllowed, forceSend)) == 0) { // handle blobs NdbBlob* tBlob = m_operation->theBlobList; while (tBlob != 0) { @@ -67,9 +67,9 @@ int NdbResultSet::nextResult(bool fetchAllowed) return res; } -void NdbResultSet::close() +void NdbResultSet::close(bool forceSend) { - m_operation->closeScan(); + m_operation->closeScan(forceSend); } NdbOperation* @@ -98,6 +98,6 @@ NdbResultSet::deleteTuple(NdbConnection * takeOverTrans){ } int -NdbResultSet::restart(){ - return m_operation->restart(); +NdbResultSet::restart(bool forceSend){ + return m_operation->restart(forceSend); } diff --git a/ndb/src/ndbapi/NdbScanOperation.cpp b/ndb/src/ndbapi/NdbScanOperation.cpp index 4b10ebb10cd..33fa826e470 100644 --- a/ndb/src/ndbapi/NdbScanOperation.cpp +++ b/ndb/src/ndbapi/NdbScanOperation.cpp @@ -447,10 +447,11 @@ NdbScanOperation::executeCursor(int nodeId){ #define DEBUG_NEXT_RESULT 0 -int NdbScanOperation::nextResult(bool fetchAllowed) +int NdbScanOperation::nextResult(bool fetchAllowed, bool forceSend) { if(m_ordered) - return ((NdbIndexScanOperation*)this)->next_result_ordered(fetchAllowed); + return ((NdbIndexScanOperation*)this)->next_result_ordered(fetchAllowed, + forceSend); /** * Check current receiver @@ -487,7 +488,8 @@ int NdbScanOperation::nextResult(bool fetchAllowed) TransporterFacade* tp = TransporterFacade::instance(); Guard guard(tp->theMutexPtr); Uint32 seq = theNdbCon->theNodeSequence; - if(seq == tp->getNodeSequence(nodeId) && send_next_scan(idx, false) == 0){ + if(seq == tp->getNodeSequence(nodeId) && send_next_scan(idx, false, + forceSend) == 0){ idx = m_current_api_receiver; last = m_api_receivers_count; @@ -578,7 +580,8 @@ int NdbScanOperation::nextResult(bool fetchAllowed) } int -NdbScanOperation::send_next_scan(Uint32 cnt, bool stopScanFlag){ +NdbScanOperation::send_next_scan(Uint32 cnt, bool stopScanFlag, + bool forceSend){ if(cnt > 0 || stopScanFlag){ NdbApiSignal tSignal(theNdb->theMyRef); tSignal.setSignal(GSN_SCAN_NEXTREQ); @@ -618,6 +621,8 @@ NdbScanOperation::send_next_scan(Uint32 cnt, bool stopScanFlag){ ret = tp->sendSignal(&tSignal, nodeId); } + if (!ret) checkForceSend(forceSend); + m_sent_receivers_count = last + cnt + stopScanFlag; m_api_receivers_count -= cnt; m_current_api_receiver = 0; @@ -627,6 +632,15 @@ NdbScanOperation::send_next_scan(Uint32 cnt, bool stopScanFlag){ return 0; } +void NdbScanOperation::checkForceSend(bool forceSend) +{ + if (forceSend) { + TransporterFacade::instance()->forceSend(theNdb->theNdbBlockNumber); + } else { + TransporterFacade::instance()->checkForceSend(theNdb->theNdbBlockNumber); + }//if +} + int NdbScanOperation::prepareSend(Uint32 TC_ConnectPtr, Uint64 TransactionId) { @@ -642,7 +656,7 @@ NdbScanOperation::doSend(int ProcessorId) return 0; } -void NdbScanOperation::closeScan() +void NdbScanOperation::closeScan(bool forceSend) { if(m_transConnection){ if(DEBUG_NEXT_RESULT) @@ -657,7 +671,7 @@ void NdbScanOperation::closeScan() TransporterFacade* tp = TransporterFacade::instance(); Guard guard(tp->theMutexPtr); - close_impl(tp); + close_impl(tp, forceSend); } while(0); @@ -1293,7 +1307,8 @@ NdbIndexScanOperation::compare(Uint32 skip, Uint32 cols, } int -NdbIndexScanOperation::next_result_ordered(bool fetchAllowed){ +NdbIndexScanOperation::next_result_ordered(bool fetchAllowed, + bool forceSend){ Uint32 u_idx = 0, u_last = 0; Uint32 s_idx = m_current_api_receiver; // first sorted @@ -1319,7 +1334,8 @@ NdbIndexScanOperation::next_result_ordered(bool fetchAllowed){ Guard guard(tp->theMutexPtr); Uint32 seq = theNdbCon->theNodeSequence; Uint32 nodeId = theNdbCon->theDBnode; - if(seq == tp->getNodeSequence(nodeId) && !send_next_scan_ordered(s_idx)){ + if(seq == tp->getNodeSequence(nodeId) && + !send_next_scan_ordered(s_idx, forceSend)){ Uint32 tmp = m_sent_receivers_count; s_idx = m_current_api_receiver; while(m_sent_receivers_count > 0 && !theError.code){ @@ -1408,7 +1424,7 @@ NdbIndexScanOperation::next_result_ordered(bool fetchAllowed){ } int -NdbIndexScanOperation::send_next_scan_ordered(Uint32 idx){ +NdbIndexScanOperation::send_next_scan_ordered(Uint32 idx, bool forceSend){ if(idx == theParallelism) return 0; @@ -1440,11 +1456,13 @@ NdbIndexScanOperation::send_next_scan_ordered(Uint32 idx){ Uint32 nodeId = theNdbCon->theDBnode; TransporterFacade * tp = TransporterFacade::instance(); tSignal.setLength(4+1); - return tp->sendSignal(&tSignal, nodeId); + int ret= tp->sendSignal(&tSignal, nodeId); + if (!ret) checkForceSend(forceSend); + return ret; } int -NdbScanOperation::close_impl(TransporterFacade* tp){ +NdbScanOperation::close_impl(TransporterFacade* tp, bool forceSend){ Uint32 seq = theNdbCon->theNodeSequence; Uint32 nodeId = theNdbCon->theDBnode; @@ -1473,7 +1491,7 @@ NdbScanOperation::close_impl(TransporterFacade* tp){ if(m_api_receivers_count+m_conf_receivers_count){ // Send close scan - if(send_next_scan(0, true) == -1){ // Close scan + if(send_next_scan(0, true, forceSend) == -1){ // Close scan theNdbCon->theReleaseOnClose = true; return -1; } @@ -1520,7 +1538,7 @@ NdbScanOperation::reset_receivers(Uint32 parallell, Uint32 ordered){ } int -NdbScanOperation::restart() +NdbScanOperation::restart(bool forceSend) { TransporterFacade* tp = TransporterFacade::instance(); @@ -1529,7 +1547,7 @@ NdbScanOperation::restart() { int res; - if((res= close_impl(tp))) + if((res= close_impl(tp, forceSend))) { return res; } @@ -1548,13 +1566,13 @@ NdbScanOperation::restart() } int -NdbIndexScanOperation::reset_bounds(){ +NdbIndexScanOperation::reset_bounds(bool forceSend){ int res; { TransporterFacade* tp = TransporterFacade::instance(); Guard guard(tp->theMutexPtr); - res= close_impl(tp); + res= close_impl(tp, forceSend); } if(!res) diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index bec4dfd9401..6f7940caf75 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -1247,7 +1247,7 @@ inline int ha_ndbcluster::next_result(byte *buf) m_ops_pending= 0; m_blobs_pending= FALSE; } - check= cursor->nextResult(contact_ndb); + check= cursor->nextResult(contact_ndb, m_force_send); if (check == 0) { // One more record found @@ -1540,7 +1540,7 @@ int ha_ndbcluster::ordered_index_scan(const key_range *start_key, DBUG_ASSERT(op->getSorted() == sorted); DBUG_ASSERT(op->getLockMode() == (NdbOperation::LockMode)get_ndb_lock_type(m_lock.type)); - if(op->reset_bounds()) + if(op->reset_bounds(m_force_send)) DBUG_RETURN(ndb_err(m_active_trans)); } @@ -2367,7 +2367,7 @@ int ha_ndbcluster::index_last(byte *buf) int res; if((res= ordered_index_scan(0, 0, TRUE, buf)) == 0){ NdbResultSet *cursor= m_active_cursor; - while((res= cursor->nextResult(TRUE)) == 0); + while((res= cursor->nextResult(TRUE, m_force_send)) == 0); if(res == 1){ unpack_record(buf); table->status= 0; @@ -2453,7 +2453,7 @@ int ha_ndbcluster::rnd_init(bool scan) { if (!scan) DBUG_RETURN(1); - int res= cursor->restart(); + int res= cursor->restart(m_force_send); DBUG_ASSERT(res == 0); } index_init(table->primary_key); @@ -2484,7 +2484,7 @@ int ha_ndbcluster::close_scan() m_ops_pending= 0; } - cursor->close(); + cursor->close(m_force_send); m_active_cursor= NULL; DBUG_RETURN(0); } @@ -3004,6 +3004,7 @@ int ha_ndbcluster::external_lock(THD *thd, int lock_type) m_transaction_on= FALSE; else m_transaction_on= thd->variables.ndb_use_transactions; + // m_use_local_query_cache= thd->variables.ndb_use_local_query_cache; m_active_trans= thd->transaction.all.ndb_tid ? (NdbConnection*)thd->transaction.all.ndb_tid: @@ -3728,7 +3729,8 @@ ha_ndbcluster::ha_ndbcluster(TABLE *table_arg): m_ha_not_exact_count(FALSE), m_force_send(TRUE), m_autoincrement_prefetch(32), - m_transaction_on(TRUE) + m_transaction_on(TRUE), + m_use_local_query_cache(FALSE) { int i; @@ -4415,7 +4417,7 @@ bool ha_ndbcluster::low_byte_first() const } bool ha_ndbcluster::has_transactions() { - return TRUE; + return m_transaction_on; } const char* ha_ndbcluster::index_type(uint key_number) { @@ -4432,7 +4434,10 @@ const char* ha_ndbcluster::index_type(uint key_number) } uint8 ha_ndbcluster::table_cache_type() { - return HA_CACHE_TBL_NOCACHE; + if (m_use_local_query_cache) + return HA_CACHE_TBL_TRANSACT; + else + return HA_CACHE_TBL_NOCACHE; } /* @@ -4600,13 +4605,12 @@ ndb_get_table_statistics(Ndb* ndb, const char * table, { DBUG_ENTER("ndb_get_table_statistics"); DBUG_PRINT("enter", ("table: %s", table)); - + NdbConnection* pTrans= ndb->startTransaction(); do { - NdbConnection* pTrans= ndb->startTransaction(); if (pTrans == NULL) break; - + NdbScanOperation* pOp= pTrans->getNdbScanOperation(table); if (pOp == NULL) break; @@ -4623,13 +4627,13 @@ ndb_get_table_statistics(Ndb* ndb, const char * table, pOp->getValue(NdbDictionary::Column::ROW_COUNT, (char*)&rows); pOp->getValue(NdbDictionary::Column::COMMIT_COUNT, (char*)&commits); - check= pTrans->execute(NoCommit); + check= pTrans->execute(NoCommit, AbortOnError, TRUE); if (check == -1) break; Uint64 sum_rows= 0; Uint64 sum_commits= 0; - while((check= rs->nextResult(TRUE)) == 0) + while((check= rs->nextResult(TRUE, TRUE)) == 0) { sum_rows+= rows; sum_commits+= commits; @@ -4638,6 +4642,8 @@ ndb_get_table_statistics(Ndb* ndb, const char * table, if (check == -1) break; + rs->close(TRUE); + ndb->closeTransaction(pTrans); if(row_count) * row_count= sum_rows; @@ -4647,6 +4653,7 @@ ndb_get_table_statistics(Ndb* ndb, const char * table, DBUG_RETURN(0); } while(0); + ndb->closeTransaction(pTrans); DBUG_PRINT("exit", ("failed")); DBUG_RETURN(-1); } diff --git a/sql/ha_ndbcluster.h b/sql/ha_ndbcluster.h index 9d7cba459cb..6b878681c05 100644 --- a/sql/ha_ndbcluster.h +++ b/sql/ha_ndbcluster.h @@ -238,10 +238,12 @@ class ha_ndbcluster: public handler char *m_blobs_buffer; uint32 m_blobs_buffer_size; uint m_dupkey; + // set from thread variables at external lock bool m_ha_not_exact_count; bool m_force_send; ha_rows m_autoincrement_prefetch; bool m_transaction_on; + bool m_use_local_query_cache; void set_rec_per_key(); void records_update(); From 01604355acd5ae2da25ed654c52b4c788a35603b Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 22 Nov 2004 14:53:18 +0100 Subject: [PATCH 0303/1063] Bug #6748 heap_rfirst() doesn't work (and never did!) range for BETWEEN typo fixed extra/perror.c: meaningless error message fixed heap/hp_rfirst.c: Bug #6748 heap_rfirst() doesn't work (and never did!) mysql-test/r/heap.result: Bug #6748 heap_rfirst() doesn't work (and never did!) mysql-test/r/range.result: range for BETWEEN typo fixed mysql-test/t/heap.test: Bug #6748 heap_rfirst() doesn't work (and never did!) sql/handler.cc: Bug #6748 heap_rfirst() doesn't work (and never did!) sql/sql_select.cc: range for BETWEEN typo fixed --- extra/perror.c | 2 +- heap/hp_rfirst.c | 1 + mysql-test/r/heap.result | 7 +++++++ mysql-test/r/range.result | 4 ++-- mysql-test/t/heap.test | 11 +++++++++++ sql/handler.cc | 4 +++- sql/sql_select.cc | 2 +- 7 files changed, 26 insertions(+), 5 deletions(-) diff --git a/extra/perror.c b/extra/perror.c index a28626fd873..1bd4b203120 100644 --- a/extra/perror.c +++ b/extra/perror.c @@ -69,7 +69,7 @@ static HA_ERRORS ha_errlist[]= { { 120,"Didn't find key on read or update" }, { 121,"Duplicate key on write or update" }, - { 123,"Someone has changed the row since it was read; Update with is recoverable" }, + { 123,"Someone has changed the row since it was read (while the table was locked to prevent it)" }, { 124,"Wrong index given to function" }, { 126,"Index file is crashed" }, { 127,"Record-file is crashed" }, diff --git a/heap/hp_rfirst.c b/heap/hp_rfirst.c index 1668376ed1c..85548fea212 100644 --- a/heap/hp_rfirst.c +++ b/heap/hp_rfirst.c @@ -52,6 +52,7 @@ int heap_rfirst(HP_INFO *info, byte *record, int inx) my_errno=HA_ERR_END_OF_FILE; DBUG_RETURN(my_errno); } + DBUG_ASSERT(0); /* TODO fix it */ info->current_record=0; info->current_hash_ptr=0; info->update=HA_STATE_PREV_FOUND; diff --git a/mysql-test/r/heap.result b/mysql-test/r/heap.result index 4950799137a..1f994b100e2 100644 --- a/mysql-test/r/heap.result +++ b/mysql-test/r/heap.result @@ -233,3 +233,10 @@ SELECT * FROM t1 WHERE B is not null; a B 1 1 DROP TABLE t1; +CREATE TABLE t1 (pseudo char(35) PRIMARY KEY, date int(10) unsigned NOT NULL) ENGINE=HEAP; +INSERT INTO t1 VALUES ('massecot',1101106491),('altec',1101106492),('stitch+',1101106304),('Seb Corgan',1101106305),('beerfilou',1101106263),('flaker',1101106529),('joce8',5),('M4vrick',1101106418),('gabay008',1101106525),('Vamp irX',1101106291),('ZoomZip',1101106546),('rip666',1101106502),('CBP ',1101106397),('guezpard',1101106496); +DELETE FROM t1 WHERE date<1101106546; +SELECT * FROM t1; +pseudo date +ZoomZip 1101106546 +DROP TABLE t1; diff --git a/mysql-test/r/range.result b/mysql-test/r/range.result index 17ed9513653..fc2b4a78469 100644 --- a/mysql-test/r/range.result +++ b/mysql-test/r/range.result @@ -221,7 +221,7 @@ update t1 set y=x; explain select * from t1, t1 t2 where t1.y = 2 and t2.x between 7 and t1.y+0; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ref y y 5 const 1 Using where -1 SIMPLE t2 range x x 5 NULL 4 Using where +1 SIMPLE t2 range x x 5 NULL 4 Range checked for each record (index map: 0x1) explain select * from t1, t1 t2 where t1.y = 2 and t2.x >= 7 and t2.x <= t1.y+0; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ref y y 5 const 1 Using where @@ -237,7 +237,7 @@ id select_type table type possible_keys key key_len ref rows Extra explain select * from t1, t1 t2 where t1.y = 2 and t2.x between 0 and t1.y; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ref y y 5 const 1 Using where -1 SIMPLE t2 ALL x NULL NULL NULL 9 Using where +1 SIMPLE t2 ALL x NULL NULL NULL 9 Range checked for each record (index map: 0x1) explain select * from t1, t1 t2 where t1.y = 2 and t2.x >= 0 and t2.x <= t1.y; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ref y y 5 const 1 Using where diff --git a/mysql-test/t/heap.test b/mysql-test/t/heap.test index e1776245d9e..2eff36f3317 100644 --- a/mysql-test/t/heap.test +++ b/mysql-test/t/heap.test @@ -174,3 +174,14 @@ CREATE TABLE t1 (a INT NOT NULL, B INT, KEY(B)) ENGINE=HEAP; INSERT INTO t1 VALUES(1,1), (1,NULL); SELECT * FROM t1 WHERE B is not null; DROP TABLE t1; + +# +# Bug #6748 +# heap_rfirst() doesn't work (and never did!) +# +CREATE TABLE t1 (pseudo char(35) PRIMARY KEY, date int(10) unsigned NOT NULL) ENGINE=HEAP; +INSERT INTO t1 VALUES ('massecot',1101106491),('altec',1101106492),('stitch+',1101106304),('Seb Corgan',1101106305),('beerfilou',1101106263),('flaker',1101106529),('joce8',5),('M4vrick',1101106418),('gabay008',1101106525),('Vamp irX',1101106291),('ZoomZip',1101106546),('rip666',1101106502),('CBP ',1101106397),('guezpard',1101106496); +DELETE FROM t1 WHERE date<1101106546; +SELECT * FROM t1; +DROP TABLE t1; + diff --git a/sql/handler.cc b/sql/handler.cc index 5dae7950390..7ddd7b80a34 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -953,8 +953,10 @@ int handler::read_first_row(byte * buf, uint primary_key) /* If there is very few deleted rows in the table, find the first row by scanning the table. + TODO remove the test for HA_READ_ORDER */ - if (deleted < 10 || primary_key >= MAX_KEY) + if (deleted < 10 || primary_key >= MAX_KEY || + !(index_flags(primary_key, 0, 0) & HA_READ_ORDER)) { (void) ha_rnd_init(1); while ((error= rnd_next(buf)) == HA_ERR_RECORD_DELETED) ; diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 9162cd30d63..40dae434c5e 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -2154,7 +2154,7 @@ add_key_field(KEY_FIELD **key_fields,uint and_level, COND *cond, bool is_const=1; for (uint i=0; iconst_item(); + is_const&= value[i]->const_item(); if (is_const) stat[0].const_keys.merge(possible_keys); /* From 8984d00706a4268744bf5b19f2098bcbfcb99814 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 22 Nov 2004 18:17:41 +0400 Subject: [PATCH 0304/1063] uca-dump.c: Better variable names in dump. Dump tertiary weight in reverse order, to sort upper letters before their lower counterparts. strings/uca-dump.c: Better variable names in dump. Dump tertiary weight in reverse order, to sort upper letters before their lower counterparts. --- strings/uca-dump.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/strings/uca-dump.c b/strings/uca-dump.c index c9642598c3c..db5cb7e999a 100644 --- a/strings/uca-dump.c +++ b/strings/uca-dump.c @@ -218,7 +218,6 @@ int main(int ac, char **av) */ if (ndefs == MY_UCA_NCHARS) { - printf("/* Don't dump w=%d pg=%3X: ndefs=%d */\n",w, page, ndefs); continue; } switch (maxnum) @@ -263,7 +262,17 @@ int main(int ac, char **av) for (i=0; i < maxnum; i++) { - printf("0x%04X",(int)weight[i]); + /* + Invert weights for secondary level to + sort upper case letters before their + lower case counter part. + */ + int tmp= weight[i]; + if (w == 2 && tmp) + tmp= (int)(0x100 - weight[i]); + + + printf("0x%04X", tmp); if ((offs+1 != MY_UCA_NCHARS) || (i+1!=maxnum)) printf(","); nchars++; @@ -281,7 +290,7 @@ int main(int ac, char **av) printf("};\n\n"); } - printf("uchar ucal%s[%d]={\n", pname[w], MY_UCA_NPAGES); + printf("uchar uca_length%s[%d]={\n", pname[w], MY_UCA_NPAGES); for (page=0; page < MY_UCA_NPAGES; page++) { printf("%d%s%s",pagemaxlen[page],page Date: Mon, 22 Nov 2004 15:27:28 +0100 Subject: [PATCH 0305/1063] wl2077 - bug fix for SCAN_TABREF ndb/src/ndbapi/NdbScanOperation.cpp: 1 more fix of premature scan closure --- ndb/src/ndbapi/NdbScanOperation.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ndb/src/ndbapi/NdbScanOperation.cpp b/ndb/src/ndbapi/NdbScanOperation.cpp index c037fe732fc..282b831f8fd 100644 --- a/ndb/src/ndbapi/NdbScanOperation.cpp +++ b/ndb/src/ndbapi/NdbScanOperation.cpp @@ -688,7 +688,7 @@ NdbScanOperation::execCLOSE_SCAN_REP(){ m_api_receivers_count = 0; m_conf_receivers_count = 0; m_sent_receivers_count = 0; - m_current_api_receiver = theParallelism; + m_current_api_receiver = m_ordered ? theParallelism : 0; } void NdbScanOperation::release() From a2aa366e6e8db9e64278d7d7e256e2d294c839d7 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 22 Nov 2004 15:05:51 +0000 Subject: [PATCH 0306/1063] added --no-defaults to ndb_drop_table in autodiscover test --- mysql-test/t/ndb_autodiscover.test | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/mysql-test/t/ndb_autodiscover.test b/mysql-test/t/ndb_autodiscover.test index fd7fe0e60d8..6551732adba 100644 --- a/mysql-test/t/ndb_autodiscover.test +++ b/mysql-test/t/ndb_autodiscover.test @@ -199,7 +199,7 @@ insert into t4 values (1, "Automatic"); select * from t4; # Remove the table from NDB -system exec $NDB_TOOLS_DIR/ndb_drop_table -d test t4 > /dev/null ; +system exec $NDB_TOOLS_DIR/ndb_drop_table --no-defaults -d test t4 > /dev/null ; # # Test that correct error is returned @@ -230,7 +230,7 @@ select * from t4; flush tables; # Remove the table from NDB -system exec $NDB_TOOLS_DIR/ndb_drop_table -d test t4 > /dev/null ; +system exec $NDB_TOOLS_DIR/ndb_drop_table --no-defaults -d test t4 > /dev/null ; SHOW TABLES; @@ -264,8 +264,8 @@ insert into t8 values (8, "myisam table 8"); insert into t9 values (9); # Remove t3, t5 from NDB -system exec $NDB_TOOLS_DIR/ndb_drop_table -d test t3 > /dev/null ; -system exec $NDB_TOOLS_DIR/ndb_drop_table -d test t5 > /dev/null ; +system exec $NDB_TOOLS_DIR/ndb_drop_table --no-defaults -d test t3 > /dev/null ; +system exec $NDB_TOOLS_DIR/ndb_drop_table --no-defaults -d test t5 > /dev/null ; # Remove t6, t7 from disk system rm var/master-data/test/t6.frm > /dev/null ; system rm var/master-data/test/t7.frm > /dev/null ; @@ -306,8 +306,8 @@ insert into t8 values (8, "myisam table 8"); insert into t9 values (9); # Remove t3, t5 from NDB -system exec $NDB_TOOLS_DIR/ndb_drop_table -d test t3 > /dev/null ; -system exec $NDB_TOOLS_DIR/ndb_drop_table -d test t5 > /dev/null ; +system exec $NDB_TOOLS_DIR/ndb_drop_table --no-defaults -d test t3 > /dev/null ; +system exec $NDB_TOOLS_DIR/ndb_drop_table --no-defaults -d test t5 > /dev/null ; # Remove t6, t7 from disk system rm var/master-data/test/t6.frm > /dev/null ; system rm var/master-data/test/t7.frm > /dev/null ; @@ -479,4 +479,4 @@ create table t10 ( insert into t10 values (1, 'kalle'); ---exec $NDB_TOOLS_DIR/ndb_drop_table -d test `$NDB_TOOLS_DIR/ndb_show_tables | grep BLOB` > /dev/null 2>&1 || true +--exec $NDB_TOOLS_DIR/ndb_drop_table --no-defaults -d test `$NDB_TOOLS_DIR/ndb_show_tables --no-defaults | grep BLOB` > /dev/null 2>&1 || true From 77305900805c18791b60060e676b848500e25651 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 22 Nov 2004 17:08:06 +0100 Subject: [PATCH 0307/1063] - renamed mysqladmin.c -> mysqladmin.cpp to fix the Windows builds BitKeeper/etc/ignore: Added ac_available_languages_fragment to the ignore list --- .bzrignore | 1 + VC++Files/client/mysqladmin.dsp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.bzrignore b/.bzrignore index 670d46db613..10388d79013 100644 --- a/.bzrignore +++ b/.bzrignore @@ -939,3 +939,4 @@ ndbcluster-1186/ndb_3_cluster.log ndbcluster-1186/ndb_3_out.log ndbcluster-1186/ndbcluster.pid ndb/tools/ndb_restore +ac_available_languages_fragment diff --git a/VC++Files/client/mysqladmin.dsp b/VC++Files/client/mysqladmin.dsp index a7e4404e253..7a0b3bec1a7 100644 --- a/VC++Files/client/mysqladmin.dsp +++ b/VC++Files/client/mysqladmin.dsp @@ -115,7 +115,7 @@ LINK32=xilink6.exe # Name "mysqladmin - Win32 classic" # Begin Source File -SOURCE=.\mysqladmin.c +SOURCE=.\mysqladmin.cpp # End Source File # End Target # End Project From 2934e7ebe6919de487415b52d3d42ac28c156562 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 22 Nov 2004 18:37:30 +0100 Subject: [PATCH 0308/1063] ft_boolean_search.c: bug#6705 - (+trunc1* +trunc2*) fulltext.test, fulltext.result: bug#6705 mysql-test/r/fulltext.result: bug#6705 mysql-test/t/fulltext.test: bug#6705 myisam/ft_boolean_search.c: bug#6705 - (+trunc1* +trunc2*) --- myisam/ft_boolean_search.c | 4 ++-- mysql-test/r/fulltext.result | 8 ++++++++ mysql-test/t/fulltext.test | 2 ++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/myisam/ft_boolean_search.c b/myisam/ft_boolean_search.c index 97dfb18e5f9..1958619c2dd 100644 --- a/myisam/ft_boolean_search.c +++ b/myisam/ft_boolean_search.c @@ -247,7 +247,7 @@ static void _ftb_init_index_search(FT_INFO *ftb) FTB_EXPR *top_ftbe=ftbe->up->up; ftbw->docid[0]=HA_OFFSET_ERROR; for (ftbe=ftbw->up; ftbe != top_ftbe; ftbe=ftbe->up) - if (ftbe->flags & FTB_FLAG_YES) + if (!(ftbe->flags & FTB_FLAG_NO)) ftbe->yweaks++; ftbe=0; break; @@ -255,7 +255,7 @@ static void _ftb_init_index_search(FT_INFO *ftb) } if (!ftbe) continue; - /* 3 */ + /* 4 */ if (!is_tree_inited(& ftb->no_dupes)) init_tree(& ftb->no_dupes,0,0,sizeof(my_off_t), _ftb_no_dupes_cmp,0,0,0); diff --git a/mysql-test/r/fulltext.result b/mysql-test/r/fulltext.result index 31be1881897..50f0a1dc120 100644 --- a/mysql-test/r/fulltext.result +++ b/mysql-test/r/fulltext.result @@ -162,6 +162,14 @@ a select * from t1 where match a against ("+aaa10 +(bbb*)" in boolean mode); a aaa10 bbb20 +select * from t1 where match a against ("+(+aaa* +bbb1*)" in boolean mode); +a +aaa20 bbb15 +aaa30 bbb10 +select * from t1 where match a against ("(+aaa* +bbb1*)" in boolean mode); +a +aaa20 bbb15 +aaa30 bbb10 drop table t1; CREATE TABLE t1 ( id int(11), diff --git a/mysql-test/t/fulltext.test b/mysql-test/t/fulltext.test index e46399bb876..b44854860f9 100644 --- a/mysql-test/t/fulltext.test +++ b/mysql-test/t/fulltext.test @@ -87,6 +87,8 @@ select * from t1 where match a against ("+aaa* +bbb*" in boolean mode); select * from t1 where match a against ("+aaa* +bbb1*" in boolean mode); select * from t1 where match a against ("+aaa* +ccc*" in boolean mode); select * from t1 where match a against ("+aaa10 +(bbb*)" in boolean mode); +select * from t1 where match a against ("+(+aaa* +bbb1*)" in boolean mode); +select * from t1 where match a against ("(+aaa* +bbb1*)" in boolean mode); drop table t1; # From f74af1b7cbe738225baf2cfe1e5ff59c27e0b70c Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 22 Nov 2004 18:54:06 +0100 Subject: [PATCH 0309/1063] ndb: fix blob performance in long transactions ndb/include/ndbapi/NdbConnection.hpp: fix blob performance in long transactions ndb/src/ndbapi/NdbConnection.cpp: fix blob performance in long transactions ndb/test/ndbapi/testBlobs.cpp: fix blob performance in long transactions --- ndb/include/ndbapi/NdbConnection.hpp | 4 +- ndb/src/ndbapi/NdbConnection.cpp | 36 ++++ ndb/test/ndbapi/testBlobs.cpp | 303 ++++++++++++++++++++++++++- 3 files changed, 340 insertions(+), 3 deletions(-) diff --git a/ndb/include/ndbapi/NdbConnection.hpp b/ndb/include/ndbapi/NdbConnection.hpp index 7af5d27b922..256199dced7 100644 --- a/ndb/include/ndbapi/NdbConnection.hpp +++ b/ndb/include/ndbapi/NdbConnection.hpp @@ -607,8 +607,8 @@ private: NdbOperation* theLastExecOpInList; // Last executing operation in list. - NdbOperation* theCompletedFirstOp; // First operation in completed - // operation list. + NdbOperation* theCompletedFirstOp; // First & last operation in completed + NdbOperation* theCompletedLastOp; // operation list. Uint32 theNoOfOpSent; // How many operations have been sent Uint32 theNoOfOpCompleted; // How many operations have completed diff --git a/ndb/src/ndbapi/NdbConnection.cpp b/ndb/src/ndbapi/NdbConnection.cpp index 4f6468eb4ae..719c5bef49e 100644 --- a/ndb/src/ndbapi/NdbConnection.cpp +++ b/ndb/src/ndbapi/NdbConnection.cpp @@ -55,6 +55,7 @@ NdbConnection::NdbConnection( Ndb* aNdb ) : theFirstExecOpInList(NULL), theLastExecOpInList(NULL), theCompletedFirstOp(NULL), + theCompletedLastOp(NULL), theNoOfOpSent(0), theNoOfOpCompleted(0), theNoOfOpFetched(0), @@ -124,6 +125,7 @@ NdbConnection::init() theLastExecOpInList = NULL; theCompletedFirstOp = NULL; + theCompletedLastOp = NULL; theGlobalCheckpointId = 0; theCommitStatus = Started; @@ -256,6 +258,8 @@ NdbConnection::handleExecuteCompletion() if (tLastExecOp != NULL) { tLastExecOp->next(theCompletedFirstOp); theCompletedFirstOp = tFirstExecOp; + if (theCompletedLastOp == NULL) + theCompletedLastOp = tLastExecOp; theFirstExecOpInList = NULL; theLastExecOpInList = NULL; }//if @@ -292,6 +296,8 @@ NdbConnection::execute(ExecType aTypeOfExec, ExecType tExecType; NdbOperation* tPrepOp; + NdbOperation* tCompletedFirstOp = NULL; + NdbOperation* tCompletedLastOp = NULL; int ret = 0; do { @@ -314,6 +320,7 @@ NdbConnection::execute(ExecType aTypeOfExec, } tPrepOp = tPrepOp->next(); } + // save rest of prepared ops if batch NdbOperation* tRestOp= 0; NdbOperation* tLastOp= 0; @@ -323,6 +330,7 @@ NdbConnection::execute(ExecType aTypeOfExec, tLastOp = theLastOpInList; theLastOpInList = tPrepOp; } + if (tExecType == Commit) { NdbOperation* tOp = theCompletedFirstOp; while (tOp != NULL) { @@ -338,6 +346,19 @@ NdbConnection::execute(ExecType aTypeOfExec, } } + // completed ops are in unspecified order + if (theCompletedFirstOp != NULL) { + if (tCompletedFirstOp == NULL) { + tCompletedFirstOp = theCompletedFirstOp; + tCompletedLastOp = theCompletedLastOp; + } else { + tCompletedLastOp->next(theCompletedFirstOp); + tCompletedLastOp = theCompletedLastOp; + } + theCompletedFirstOp = NULL; + theCompletedLastOp = NULL; + } + if (executeNoBlobs(tExecType, abortOption, forceSend) == -1) ret = -1; #ifndef VM_TRACE @@ -362,6 +383,7 @@ NdbConnection::execute(ExecType aTypeOfExec, tOp = tOp->next(); } } + // add saved prepared ops if batch if (tPrepOp != NULL && tRestOp != NULL) { if (theFirstOpInList == NULL) @@ -373,6 +395,18 @@ NdbConnection::execute(ExecType aTypeOfExec, assert(theFirstOpInList == NULL || tExecType == NoCommit); } while (theFirstOpInList != NULL || tExecType != aTypeOfExec); + if (tCompletedFirstOp != NULL) { + tCompletedLastOp->next(theCompletedFirstOp); + theCompletedFirstOp = tCompletedFirstOp; + if (theCompletedLastOp == NULL) + theCompletedLastOp = tCompletedLastOp; + } +#if ndb_api_count_completed_ops_after_blob_execute + { NdbOperation* tOp; unsigned n = 0; + for (tOp = theCompletedFirstOp; tOp != NULL; tOp = tOp->next()) n++; + ndbout << "completed ops: " << n << endl; + } +#endif DBUG_RETURN(ret); } @@ -894,6 +928,7 @@ NdbConnection::releaseOperations() releaseOps(theFirstExecOpInList); theCompletedFirstOp = NULL; + theCompletedLastOp = NULL; theFirstOpInList = NULL; theFirstExecOpInList = NULL; theLastOpInList = NULL; @@ -909,6 +944,7 @@ NdbConnection::releaseCompletedOperations() { releaseOps(theCompletedFirstOp); theCompletedFirstOp = NULL; + theCompletedLastOp = NULL; }//NdbConnection::releaseOperations() /****************************************************************************** diff --git a/ndb/test/ndbapi/testBlobs.cpp b/ndb/test/ndbapi/testBlobs.cpp index efa0811aa39..4b532856709 100644 --- a/ndb/test/ndbapi/testBlobs.cpp +++ b/ndb/test/ndbapi/testBlobs.cpp @@ -22,6 +22,7 @@ #include #include #include +#include struct Bcol { bool m_nullable; @@ -59,6 +60,9 @@ struct Opt { bool m_oneblob; Bcol m_blob1; Bcol m_blob2; + // perf + const char* m_tnameperf; + unsigned m_rowsperf; // bugs int m_bug; int (*m_bugtest)(); @@ -84,6 +88,9 @@ struct Opt { m_oneblob(false), m_blob1(false, 7, 1137, 10), m_blob2(true, 99, 55, 1), + // perf + m_tnameperf("TBLOB2"), + m_rowsperf(10000), // bugs m_bug(0), m_bugtest(0) { @@ -107,6 +114,7 @@ printusage() << " -loop N loop N times 0=forever [" << d.m_loop << "]" << endl << " -parts N max parts in blob value [" << d.m_parts << "]" << endl << " -rows N number of rows [" << d.m_rows << "]" << endl + << " -rowsperf N rows for performace test [" << d.m_rowsperf << "]" << endl << " -seed N random seed 0=loop number [" << d.m_seed << "]" << endl << " -skip xxx skip given tests (see list) [no tests]" << endl << " -test xxx only given tests (see list) [all tests]" << endl @@ -118,6 +126,7 @@ printusage() << " i hash index ops" << endl << " s table scans" << endl << " r ordered index scans" << endl + << " p performance test" << endl << "additional flags for test/skip" << endl << " u update existing blob value" << endl << " n normal insert and update" << endl @@ -1381,6 +1390,292 @@ testmain() return 0; } +// separate performance test + +struct Tmr { // stolen from testOIBasic + Tmr() { + clr(); + } + void clr() { + m_on = m_ms = m_cnt = m_time[0] = m_text[0] = 0; + } + void on() { + assert(m_on == 0); + m_on = NdbTick_CurrentMillisecond(); + } + void off(unsigned cnt = 0) { + NDB_TICKS off = NdbTick_CurrentMillisecond(); + assert(m_on != 0 && off >= m_on); + m_ms += off - m_on; + m_cnt += cnt; + m_on = 0; + } + const char* time() { + if (m_cnt == 0) + sprintf(m_time, "%u ms", m_ms); + else + sprintf(m_time, "%u ms per %u ( %u ms per 1000 )", m_ms, m_cnt, (1000 * m_ms) / m_cnt); + return m_time; + } + const char* pct (const Tmr& t1) { + if (0 < t1.m_ms) + sprintf(m_text, "%u pct", (100 * m_ms) / t1.m_ms); + else + sprintf(m_text, "[cannot measure]"); + return m_text; + } + const char* over(const Tmr& t1) { + if (0 < t1.m_ms) { + if (t1.m_ms <= m_ms) + sprintf(m_text, "%u pct", (100 * (m_ms - t1.m_ms)) / t1.m_ms); + else + sprintf(m_text, "-%u pct", (100 * (t1.m_ms - m_ms)) / t1.m_ms); + } else + sprintf(m_text, "[cannot measure]"); + return m_text; + } + NDB_TICKS m_on; + unsigned m_ms; + unsigned m_cnt; + char m_time[100]; + char m_text[100]; +}; + +static int +testperf() +{ + if (! testcase('p')) + return 0; + DBG("=== perf test ==="); + g_ndb = new Ndb("TEST_DB"); + CHK(g_ndb->init() == 0); + CHK(g_ndb->waitUntilReady() == 0); + g_dic = g_ndb->getDictionary(); + NdbDictionary::Table tab(g_opt.m_tnameperf); + if (g_dic->getTable(tab.getName()) != 0) + CHK(g_dic->dropTable(tab) == 0); + // col A - pk + { NdbDictionary::Column col("A"); + col.setType(NdbDictionary::Column::Unsigned); + col.setPrimaryKey(true); + tab.addColumn(col); + } + // col B - char 20 + { NdbDictionary::Column col("B"); + col.setType(NdbDictionary::Column::Char); + col.setLength(20); + col.setNullable(true); + tab.addColumn(col); + } + // col C - text + { NdbDictionary::Column col("C"); + col.setType(NdbDictionary::Column::Text); + col.setInlineSize(20); + col.setPartSize(512); + col.setStripeSize(1); + col.setNullable(true); + tab.addColumn(col); + } + // create + CHK(g_dic->createTable(tab) == 0); + Uint32 cA = 0, cB = 1, cC = 2; + // timers + Tmr t1; + Tmr t2; + // insert char (one trans) + { + DBG("--- insert char ---"); + t1.on(); + CHK((g_con = g_ndb->startTransaction()) != 0); + for (Uint32 k = 0; k < g_opt.m_rowsperf; k++) { + CHK((g_opr = g_con->getNdbOperation(tab.getName())) != 0); + CHK(g_opr->insertTuple() == 0); + CHK(g_opr->equal(cA, (char*)&k) == 0); + CHK(g_opr->setValue(cB, "b") == 0); + CHK(g_con->execute(NoCommit) == 0); + } + t1.off(g_opt.m_rowsperf); + CHK(g_con->execute(Rollback) == 0); + DBG(t1.time()); + g_opr = 0; + g_con = 0; + } + // insert text (one trans) + { + DBG("--- insert text ---"); + t2.on(); + CHK((g_con = g_ndb->startTransaction()) != 0); + for (Uint32 k = 0; k < g_opt.m_rowsperf; k++) { + CHK((g_opr = g_con->getNdbOperation(tab.getName())) != 0); + CHK(g_opr->insertTuple() == 0); + CHK(g_opr->equal(cA, (char*)&k) == 0); + CHK((g_bh1 = g_opr->getBlobHandle(cC)) != 0); + CHK((g_bh1->setValue("c", 1) == 0)); + CHK(g_con->execute(NoCommit) == 0); + } + t2.off(g_opt.m_rowsperf); + CHK(g_con->execute(Rollback) == 0); + DBG(t2.time()); + g_bh1 = 0; + g_opr = 0; + g_con = 0; + } + // insert overhead + DBG("insert overhead: " << t2.over(t1)); + t1.clr(); + t2.clr(); + // insert + { + DBG("--- insert for read test ---"); + unsigned n = 0; + CHK((g_con = g_ndb->startTransaction()) != 0); + for (Uint32 k = 0; k < g_opt.m_rowsperf; k++) { + CHK((g_opr = g_con->getNdbOperation(tab.getName())) != 0); + CHK(g_opr->insertTuple() == 0); + CHK(g_opr->equal(cA, (char*)&k) == 0); + CHK(g_opr->setValue(cB, "b") == 0); + CHK((g_bh1 = g_opr->getBlobHandle(cC)) != 0); + CHK((g_bh1->setValue("c", 1) == 0)); + if (++n == g_opt.m_batch) { + CHK(g_con->execute(Commit) == 0); + g_ndb->closeTransaction(g_con); + CHK((g_con = g_ndb->startTransaction()) != 0); + n = 0; + } + } + if (n != 0) { + CHK(g_con->execute(Commit) == 0); + n = 0; + } + g_bh1 = 0; + g_opr = 0; + g_con = 0; + } + // pk read char (one trans) + { + DBG("--- pk read char ---"); + CHK((g_con = g_ndb->startTransaction()) != 0); + Uint32 a; + char b[20]; + t1.on(); + for (Uint32 k = 0; k < g_opt.m_rowsperf; k++) { + CHK((g_opr = g_con->getNdbOperation(tab.getName())) != 0); + CHK(g_opr->readTuple() == 0); + CHK(g_opr->equal(cA, (char*)&k) == 0); + CHK(g_opr->getValue(cA, (char*)&a) != 0); + CHK(g_opr->getValue(cB, b) != 0); + a = (Uint32)-1; + b[0] = 0; + CHK(g_con->execute(NoCommit) == 0); + CHK(a == k && strcmp(b, "b") == 0); + } + CHK(g_con->execute(Commit) == 0); + t1.off(g_opt.m_rowsperf); + DBG(t1.time()); + g_opr = 0; + g_con = 0; + } + // pk read text (one trans) + { + DBG("--- pk read text ---"); + CHK((g_con = g_ndb->startTransaction()) != 0); + Uint32 a; + char c[20]; + t2.on(); + for (Uint32 k = 0; k < g_opt.m_rowsperf; k++) { + CHK((g_opr = g_con->getNdbOperation(tab.getName())) != 0); + CHK(g_opr->readTuple() == 0); + CHK(g_opr->equal(cA, (char*)&k) == 0); + CHK(g_opr->getValue(cA, (char*)&a) != 0); + CHK((g_bh1 = g_opr->getBlobHandle(cC)) != 0); + a = (Uint32)-1; + c[0] = 0; + CHK(g_con->execute(NoCommit) == 0); + Uint32 m = 20; + CHK(g_bh1->readData(c, m) == 0); + CHK(a == k && m == 1 && strcmp(c, "c") == 0); + } + CHK(g_con->execute(Commit) == 0); + t2.off(g_opt.m_rowsperf); + DBG(t2.time()); + g_opr = 0; + g_con = 0; + } + // pk read overhead + DBG("pk read overhead: " << t2.over(t1)); + t1.clr(); + t2.clr(); + // scan read char + { + DBG("--- scan read char ---"); + NdbResultSet* rs; + Uint32 a; + char b[20]; + CHK((g_con = g_ndb->startTransaction()) != 0); + CHK((g_ops = g_con->getNdbScanOperation(tab.getName())) != 0); + CHK((rs = g_ops->readTuples(NdbScanOperation::LM_Read)) != 0); + CHK(g_ops->getValue(cA, (char*)&a) != 0); + CHK(g_ops->getValue(cB, b) != 0); + CHK(g_con->execute(NoCommit) == 0); + unsigned n = 0; + t1.on(); + while (1) { + a = (Uint32)-1; + b[0] = 0; + int ret; + CHK((ret = rs->nextResult(true)) == 0 || ret == 1); + if (ret == 1) + break; + CHK(a < g_opt.m_rowsperf && strcmp(b, "b") == 0); + n++; + } + CHK(n == g_opt.m_rowsperf); + t1.off(g_opt.m_rowsperf); + DBG(t1.time()); + g_ops = 0; + g_con = 0; + } + // scan read text + { + DBG("--- read text ---"); + NdbResultSet* rs; + Uint32 a; + char c[20]; + CHK((g_con = g_ndb->startTransaction()) != 0); + CHK((g_ops = g_con->getNdbScanOperation(tab.getName())) != 0); + CHK((rs = g_ops->readTuples(NdbScanOperation::LM_Read)) != 0); + CHK(g_ops->getValue(cA, (char*)&a) != 0); + CHK((g_bh1 = g_ops->getBlobHandle(cC)) != 0); + CHK(g_con->execute(NoCommit) == 0); + unsigned n = 0; + t2.on(); + while (1) { + a = (Uint32)-1; + c[0] = 0; + int ret; + CHK((ret = rs->nextResult(true)) == 0 || ret == 1); + if (ret == 1) + break; + Uint32 m = 20; + CHK(g_bh1->readData(c, m) == 0); + CHK(a < g_opt.m_rowsperf && m == 1 && strcmp(c, "c") == 0); + n++; + } + CHK(n == g_opt.m_rowsperf); + t2.off(g_opt.m_rowsperf); + DBG(t2.time()); + g_bh1 = 0; + g_ops = 0; + g_con = 0; + } + // scan read overhead + DBG("scan read overhead: " << t2.over(t1)); + t1.clr(); + t2.clr(); + delete g_ndb; + return 0; +} + // bug tests static int @@ -1498,6 +1793,12 @@ NDB_COMMAND(testOdbcDriver, "testBlobs", "testBlobs", "testBlobs", 65535) continue; } } + if (strcmp(arg, "-rowsperf") == 0) { + if (++argv, --argc > 0) { + g_opt.m_rowsperf = atoi(argv[0]); + continue; + } + } if (strcmp(arg, "-seed") == 0) { if (++argv, --argc > 0) { g_opt.m_seed = atoi(argv[0]); @@ -1558,7 +1859,7 @@ NDB_COMMAND(testOdbcDriver, "testBlobs", "testBlobs", "testBlobs", 65535) strcat(b, "r"); g_opt.m_skip = strdup(b); } - if (testmain() == -1) { + if (testmain() == -1 || testperf() == -1) { ndbout << "line " << __LINE__ << " FAIL loop=" << g_loop << endl; return NDBT_ProgramExit(NDBT_FAILED); } From 1dc1ad9c9a5ac128a9f03f3729075b1dac21d347 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 22 Nov 2004 18:07:04 +0000 Subject: [PATCH 0310/1063] Bug#6252 - Duplicate columns in keys should fail Added check for duplicate column in key Added tests and fixed tests which exploit bug mysql-test/r/delete.result: Fix test as it exploited Bug#6252 mysql-test/r/innodb.result: Test for Bug#6126 mysql-test/r/key.result: Test for Bug#6126/6252 mysql-test/r/type_blob.result: Fix test as it exploited Bug#6252 mysql-test/t/delete.test: Fix test as it exploited Bug#6252 mysql-test/t/innodb.test: Test for Bug#6126 mysql-test/t/key.test: Test for Bug#6126/6252 mysql-test/t/type_blob.test: Fix test as it exploited Bug#6252 sql/sql_table.cc: Bug#6252 - Duplicate columns in keys should fail Added check for duplicate column. --- mysql-test/r/delete.result | 30 ++++++++++++++++++++++++++---- mysql-test/r/innodb.result | 18 ++++++++++++++++++ mysql-test/r/key.result | 18 ++++++++++++++++++ mysql-test/r/type_blob.result | 4 ++-- mysql-test/t/delete.test | 30 ++++++++++++++++++++++++++---- mysql-test/t/innodb.test | 22 ++++++++++++++++++++++ mysql-test/t/key.test | 23 +++++++++++++++++++++++ mysql-test/t/type_blob.test | 4 ++-- sql/sql_table.cc | 15 ++++++++++++++- 9 files changed, 151 insertions(+), 13 deletions(-) diff --git a/mysql-test/r/delete.result b/mysql-test/r/delete.result index 5575ee1bf98..f1fba87c70b 100644 --- a/mysql-test/r/delete.result +++ b/mysql-test/r/delete.result @@ -16,12 +16,34 @@ SET AUTOCOMMIT=0; DELETE from t1; SET AUTOCOMMIT=1; drop table t1; -create table t1 (a bigint not null, primary key (a,a,a,a,a,a,a,a,a,a)); -insert into t1 values (2),(4),(6),(8),(10),(12),(14),(16),(18),(20),(22),(24),(26),(23); +create table t1 ( +a bigint not null, +b bigint not null default 0, +c bigint not null default 0, +d bigint not null default 0, +e bigint not null default 0, +f bigint not null default 0, +g bigint not null default 0, +h bigint not null default 0, +i bigint not null default 0, +j bigint not null default 0, +primary key (a,b,c,d,e,f,g,h,i,j)); +insert into t1 (a) values (2),(4),(6),(8),(10),(12),(14),(16),(18),(20),(22),(24),(26),(23); delete from t1 where a=26; drop table t1; -create table t1 (a bigint not null, primary key (a,a,a,a,a,a,a,a,a,a)); -insert into t1 values (2),(4),(6),(8),(10),(12),(14),(16),(18),(20),(22),(24),(26),(23),(27); +create table t1 ( +a bigint not null, +b bigint not null default 0, +c bigint not null default 0, +d bigint not null default 0, +e bigint not null default 0, +f bigint not null default 0, +g bigint not null default 0, +h bigint not null default 0, +i bigint not null default 0, +j bigint not null default 0, +primary key (a,b,c,d,e,f,g,h,i,j)); +insert into t1 (a) values (2),(4),(6),(8),(10),(12),(14),(16),(18),(20),(22),(24),(26),(23),(27); delete from t1 where a=27; drop table t1; CREATE TABLE `t1` ( diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result index 9d830367745..009432ec3ab 100644 --- a/mysql-test/r/innodb.result +++ b/mysql-test/r/innodb.result @@ -1630,3 +1630,21 @@ show status like "binlog_cache_disk_use"; Variable_name Value Binlog_cache_disk_use 1 drop table t1; +create table t1 (c char(10), index (c,c)) engine=innodb; +ERROR 42S21: Duplicate column name 'c' +create table t1 (c1 char(10), c2 char(10), index (c1,c2,c1)) engine=innodb; +ERROR 42S21: Duplicate column name 'c1' +create table t1 (c1 char(10), c2 char(10), index (c1,c1,c2)) engine=innodb; +ERROR 42S21: Duplicate column name 'c1' +create table t1 (c1 char(10), c2 char(10), index (c2,c1,c1)) engine=innodb; +ERROR 42S21: Duplicate column name 'c1' +create table t1 (c1 char(10), c2 char(10)) engine=innodb; +alter table t1 add key (c1,c1); +ERROR 42S21: Duplicate column name 'c1' +alter table t1 add key (c2,c1,c1); +ERROR 42S21: Duplicate column name 'c1' +alter table t1 add key (c1,c2,c1); +ERROR 42S21: Duplicate column name 'c1' +alter table t1 add key (c1,c1,c2); +ERROR 42S21: Duplicate column name 'c1' +drop table t1; diff --git a/mysql-test/r/key.result b/mysql-test/r/key.result index e74bda23da9..cceaf393a60 100644 --- a/mysql-test/r/key.result +++ b/mysql-test/r/key.result @@ -307,3 +307,21 @@ test.t1 check status OK drop table t1; create table t1 (c char(10), index (c(0))); ERROR HY000: Key part 'c' length cannot be 0 +create table t1 (c char(10), index (c,c)); +ERROR 42S21: Duplicate column name 'c' +create table t1 (c1 char(10), c2 char(10), index (c1,c2,c1)); +ERROR 42S21: Duplicate column name 'c1' +create table t1 (c1 char(10), c2 char(10), index (c1,c1,c2)); +ERROR 42S21: Duplicate column name 'c1' +create table t1 (c1 char(10), c2 char(10), index (c2,c1,c1)); +ERROR 42S21: Duplicate column name 'c1' +create table t1 (c1 char(10), c2 char(10)); +alter table t1 add key (c1,c1); +ERROR 42S21: Duplicate column name 'c1' +alter table t1 add key (c2,c1,c1); +ERROR 42S21: Duplicate column name 'c1' +alter table t1 add key (c1,c2,c1); +ERROR 42S21: Duplicate column name 'c1' +alter table t1 add key (c1,c1,c2); +ERROR 42S21: Duplicate column name 'c1' +drop table t1; diff --git a/mysql-test/r/type_blob.result b/mysql-test/r/type_blob.result index 95bba1d4ec7..8a0c74b3ae5 100644 --- a/mysql-test/r/type_blob.result +++ b/mysql-test/r/type_blob.result @@ -682,8 +682,8 @@ id txt 3 NULL 1 Chevy drop table t1; -CREATE TABLE t1 ( i int(11) NOT NULL default '0', c text NOT NULL, PRIMARY KEY (i), KEY (c(1),c(1))); -INSERT t1 VALUES (1,''),(2,''),(3,'asdfh'),(4,''); +CREATE TABLE t1 ( i int(11) NOT NULL default '0', c text NOT NULL, d varchar(1) NOT NULL DEFAULT ' ', PRIMARY KEY (i), KEY (c(1),d)); +INSERT t1 (i, c) VALUES (1,''),(2,''),(3,'asdfh'),(4,''); select max(i) from t1 where c = ''; max(i) 4 diff --git a/mysql-test/t/delete.test b/mysql-test/t/delete.test index 5f60445d765..0bf7187865d 100644 --- a/mysql-test/t/delete.test +++ b/mysql-test/t/delete.test @@ -29,12 +29,34 @@ drop table t1; # (This assumes a block size of 1024) # -create table t1 (a bigint not null, primary key (a,a,a,a,a,a,a,a,a,a)); -insert into t1 values (2),(4),(6),(8),(10),(12),(14),(16),(18),(20),(22),(24),(26),(23); +create table t1 ( + a bigint not null, + b bigint not null default 0, + c bigint not null default 0, + d bigint not null default 0, + e bigint not null default 0, + f bigint not null default 0, + g bigint not null default 0, + h bigint not null default 0, + i bigint not null default 0, + j bigint not null default 0, + primary key (a,b,c,d,e,f,g,h,i,j)); +insert into t1 (a) values (2),(4),(6),(8),(10),(12),(14),(16),(18),(20),(22),(24),(26),(23); delete from t1 where a=26; drop table t1; -create table t1 (a bigint not null, primary key (a,a,a,a,a,a,a,a,a,a)); -insert into t1 values (2),(4),(6),(8),(10),(12),(14),(16),(18),(20),(22),(24),(26),(23),(27); +create table t1 ( + a bigint not null, + b bigint not null default 0, + c bigint not null default 0, + d bigint not null default 0, + e bigint not null default 0, + f bigint not null default 0, + g bigint not null default 0, + h bigint not null default 0, + i bigint not null default 0, + j bigint not null default 0, + primary key (a,b,c,d,e,f,g,h,i,j)); +insert into t1 (a) values (2),(4),(6),(8),(10),(12),(14),(16),(18),(20),(22),(24),(26),(23),(27); delete from t1 where a=27; drop table t1; diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test index a452f79f949..cf7be4f882c 100644 --- a/mysql-test/t/innodb.test +++ b/mysql-test/t/innodb.test @@ -1158,3 +1158,25 @@ show status like "binlog_cache_use"; show status like "binlog_cache_disk_use"; drop table t1; + +# +# Bug #6126: Duplicate columns in keys gives misleading error message +# +--error 1060 +create table t1 (c char(10), index (c,c)) engine=innodb; +--error 1060 +create table t1 (c1 char(10), c2 char(10), index (c1,c2,c1)) engine=innodb; +--error 1060 +create table t1 (c1 char(10), c2 char(10), index (c1,c1,c2)) engine=innodb; +--error 1060 +create table t1 (c1 char(10), c2 char(10), index (c2,c1,c1)) engine=innodb; +create table t1 (c1 char(10), c2 char(10)) engine=innodb; +--error 1060 +alter table t1 add key (c1,c1); +--error 1060 +alter table t1 add key (c2,c1,c1); +--error 1060 +alter table t1 add key (c1,c2,c1); +--error 1060 +alter table t1 add key (c1,c1,c2); +drop table t1; diff --git a/mysql-test/t/key.test b/mysql-test/t/key.test index 5ee2f68ab83..a0a291fdf3c 100644 --- a/mysql-test/t/key.test +++ b/mysql-test/t/key.test @@ -297,3 +297,26 @@ drop table t1; --error 1105 create table t1 (c char(10), index (c(0))); + +# +# Bug #6126: Duplicate columns in keys should fail +# Bug #6252: (dup) +# +--error 1060 +create table t1 (c char(10), index (c,c)); +--error 1060 +create table t1 (c1 char(10), c2 char(10), index (c1,c2,c1)); +--error 1060 +create table t1 (c1 char(10), c2 char(10), index (c1,c1,c2)); +--error 1060 +create table t1 (c1 char(10), c2 char(10), index (c2,c1,c1)); +create table t1 (c1 char(10), c2 char(10)); +--error 1060 +alter table t1 add key (c1,c1); +--error 1060 +alter table t1 add key (c2,c1,c1); +--error 1060 +alter table t1 add key (c1,c2,c1); +--error 1060 +alter table t1 add key (c1,c1,c2); +drop table t1; diff --git a/mysql-test/t/type_blob.test b/mysql-test/t/type_blob.test index b67fa7a552d..f70193ddbe0 100644 --- a/mysql-test/t/type_blob.test +++ b/mysql-test/t/type_blob.test @@ -369,8 +369,8 @@ explain select * from t1 where txt='Chevy' or txt is NULL order by txt; select * from t1 where txt='Chevy' or txt is NULL order by txt; drop table t1; -CREATE TABLE t1 ( i int(11) NOT NULL default '0', c text NOT NULL, PRIMARY KEY (i), KEY (c(1),c(1))); -INSERT t1 VALUES (1,''),(2,''),(3,'asdfh'),(4,''); +CREATE TABLE t1 ( i int(11) NOT NULL default '0', c text NOT NULL, d varchar(1) NOT NULL DEFAULT ' ', PRIMARY KEY (i), KEY (c(1),d)); +INSERT t1 (i, c) VALUES (1,''),(2,''),(3,'asdfh'),(4,''); select max(i) from t1 where c = ''; drop table t1; diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 3a242dc6547..eedd9388877 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -835,7 +835,7 @@ int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info, #endif } - List_iterator cols(key->columns); + List_iterator cols(key->columns), cols2(key->columns); CHARSET_INFO *ft_key_charset=0; // for FULLTEXT for (uint column_nr=0 ; (column=cols++) ; column_nr++) { @@ -853,6 +853,19 @@ int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info, column->field_name); DBUG_RETURN(-1); } + for (uint dup_nr= 0; dup_nr < column_nr; dup_nr++) + { + key_part_spec *dup_column= cols2++; + if (!my_strcasecmp(system_charset_info, + column->field_name, dup_column->field_name)) + { + my_printf_error(ER_DUP_FIELDNAME, + ER(ER_DUP_FIELDNAME),MYF(0), + column->field_name); + DBUG_RETURN(-1); + } + } + cols2.rewind(); /* for fulltext keys keyseg length is 1 for blobs (it's ignored in ft code anyway, and 0 (set to column width later) for char's. it has to be correct col width for char's, as char data are not From 158d655cc06baf3768cf94c3ce182ec57012ce37 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 22 Nov 2004 19:18:35 +0100 Subject: [PATCH 0311/1063] "Table file %s was created in MySQL 4.1+" is an error, not a warning --- myisam/mi_open.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/myisam/mi_open.c b/myisam/mi_open.c index 944a8af01e9..339ce2de291 100644 --- a/myisam/mi_open.c +++ b/myisam/mi_open.c @@ -188,7 +188,11 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags) share->state_diff_length=len-MI_STATE_INFO_SIZE; if (share->state.header.fulltext_keys) + { fprintf(stderr, "Warning: table file %s was created in MySQL 4.1+, use REPAIR TABLE ... USE_FRM to recreate it as a valid MySQL 4.0 table\n", name_buff); + my_errno=HA_ERR_UNSUPPORTED; + goto err; + } mi_state_info_read(disk_cache, &share->state); len= mi_uint2korr(share->state.header.base_info_length); From 0b6f218e710ce1a3822a2c5e960bc8ce0de6704d Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 23 Nov 2004 09:12:56 +0000 Subject: [PATCH 0312/1063] small bug fix for ndb restarter --- ndb/test/src/NdbBackup.cpp | 5 +++-- ndb/test/src/NdbRestarter.cpp | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ndb/test/src/NdbBackup.cpp b/ndb/test/src/NdbBackup.cpp index 655fdda7c95..09f52bf0bed 100644 --- a/ndb/test/src/NdbBackup.cpp +++ b/ndb/test/src/NdbBackup.cpp @@ -146,13 +146,14 @@ NdbBackup::execRestore(bool _restore_data, ndbout << "scp res: " << res << endl; - BaseString::snprintf(buf, 255, "%sndb_restore -c \"%s\" -n %d -b %d %s %s .", + BaseString::snprintf(buf, 255, "%sndb_restore -c \"%s:%d\" -n %d -b %d %s %s .", #if 1 "", #else "valgrind --leak-check=yes -v " #endif - addr.c_str(), + ndb_mgm_get_connected_host(handle), + ndb_mgm_get_connected_port(handle), _node_id, _backup_id, _restore_data?"-r":"", diff --git a/ndb/test/src/NdbRestarter.cpp b/ndb/test/src/NdbRestarter.cpp index 1c5fbbabb42..91c0963feae 100644 --- a/ndb/test/src/NdbRestarter.cpp +++ b/ndb/test/src/NdbRestarter.cpp @@ -36,7 +36,7 @@ NdbRestarter::NdbRestarter(const char* _addr): m_config(0) { if (_addr == NULL){ - addr.assign("localhost"); + addr.assign(""); } else { addr.assign(_addr); } From 14769b681c57b1fd4c57f342c9f87006b14e9eef Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 23 Nov 2004 17:55:07 +0500 Subject: [PATCH 0313/1063] rename event_connect_request to smem_event_connect_request --- sql/mysqld.cc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 89b0a035e6c..ea4d52359f1 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -468,7 +468,7 @@ Query_cache query_cache; #ifdef HAVE_SMEM char *shared_memory_base_name= default_shared_memory_base_name; bool opt_enable_shared_memory; -HANDLE event_connect_request= 0; +HANDLE smem_event_connect_request= 0; #endif #include "sslopt-vars.h" @@ -746,11 +746,11 @@ void kill_mysql(void) } #ifdef HAVE_SMEM /* - Send event to event_connect_request for aborting + Send event to smem_event_connect_request for aborting */ - if (!SetEvent(event_connect_request)) + if (!SetEvent(smem_event_connect_request)) { - DBUG_PRINT("error",("Got error: %ld from SetEvent of event_connect_request",GetLastError())); + DBUG_PRINT("error",("Got error: %ld from SetEvent of smem_event_connect_request",GetLastError())); } #endif #endif @@ -3737,7 +3737,7 @@ pthread_handler_decl(handle_connections_shared_memory,arg) */ suffix_pos= strxmov(tmp,shared_memory_base_name,"_",NullS); strmov(suffix_pos, "CONNECT_REQUEST"); - if ((event_connect_request= CreateEvent(0,FALSE,FALSE,tmp)) == 0) + if ((smem_event_connect_request= CreateEvent(0,FALSE,FALSE,tmp)) == 0) { errmsg= "Could not create request event"; goto error; @@ -3768,7 +3768,7 @@ pthread_handler_decl(handle_connections_shared_memory,arg) while (!abort_loop) { /* Wait a request from client */ - WaitForSingleObject(event_connect_request,INFINITE); + WaitForSingleObject(smem_event_connect_request,INFINITE); /* it can be after shutdown command @@ -3899,7 +3899,7 @@ error: if (handle_connect_map) UnmapViewOfFile(handle_connect_map); if (handle_connect_file_map) CloseHandle(handle_connect_file_map); if (event_connect_answer) CloseHandle(event_connect_answer); - if (event_connect_request) CloseHandle(event_connect_request); + if (smem_event_connect_request) CloseHandle(smem_event_connect_request); decrement_handler_count(); DBUG_RETURN(0); From 1860466b7b125e5b169e99e22294cb25f08f4b98 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 23 Nov 2004 18:05:13 +0500 Subject: [PATCH 0314/1063] Delete: mysql-test/mysql_test_run.c --- mysql-test/mysql_test_run.c | 1728 ----------------------------------- 1 file changed, 1728 deletions(-) delete mode 100644 mysql-test/mysql_test_run.c diff --git a/mysql-test/mysql_test_run.c b/mysql-test/mysql_test_run.c deleted file mode 100644 index 6f388fc4a45..00000000000 --- a/mysql-test/mysql_test_run.c +++ /dev/null @@ -1,1728 +0,0 @@ -/* - Copyright (c) 2002, 2003 Novell, Inc. All Rights Reserved. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -#include -#include -#include -#ifndef __WIN__ -#include -#endif -#include -#ifdef __NETWARE__ -#include -#include -#endif -#include -#include -#ifndef __WIN__ -#include -#endif -#include -#ifdef __NETWARE__ -#include -#endif -#ifdef __WIN__ -#include -#include -#endif - -#include "my_manage.h" - -/****************************************************************************** - - macros - -******************************************************************************/ - -#define HEADER "TEST RESULT \n" -#define DASH "-------------------------------------------------------\n" - -#define NW_TEST_SUFFIX ".nw-test" -#define NW_RESULT_SUFFIX ".nw-result" -#define TEST_SUFFIX ".test" -#define RESULT_SUFFIX ".result" -#define REJECT_SUFFIX ".reject" -#define OUT_SUFFIX ".out" -#define ERR_SUFFIX ".err" - -const char *TEST_PASS = "[ pass ]"; -const char *TEST_SKIP = "[ skip ]"; -const char *TEST_FAIL = "[ fail ]"; -const char *TEST_BAD = "[ bad ]"; -const char *TEST_IGNORE = "[ignore]"; - -/****************************************************************************** - - global variables - -******************************************************************************/ -#ifdef __NETWARE__ -static char base_dir[PATH_MAX] = "sys:/mysql"; -#else -static char base_dir[PATH_MAX] = ".."; -#endif -static char db[PATH_MAX] = "test"; -static char user[PATH_MAX] = "root"; -static char password[PATH_MAX] = ""; - -int master_port = 9306; -int slave_port = 9307; - -#if !defined(__NETWARE__) && !defined(__WIN__) -static char master_socket[PATH_MAX] = "./var/tmp/master.sock"; -static char slave_socket[PATH_MAX] = "./var/tmp/slave.sock"; -#endif - -// comma delimited list of tests to skip or empty string -#ifndef __WIN__ -static char skip_test[PATH_MAX] = " lowercase_table3 , system_mysql_db_fix "; -#else -/* - The most ignore testes contain the calls of system command -*/ -#define MAX_COUNT_TESTES 1024 -/* - lowercase_table3 is disabled by Gerg - system_mysql_db_fix is disabled by Gerg - sp contains a command system - rpl_EE_error contains a command system - rpl_loaddatalocal contains a command system - ndb_autodiscover contains a command system - rpl_rotate_logs contains a command system - repair contains a command system - rpl_trunc_binlog contains a command system - mysqldump contains a command system - rpl000001 makes non-exit loop...temporary skiped -*/ -static char skip_test[PATH_MAX] = " lowercase_table3 , system_mysql_db_fix , sp , rpl_EE_error , rpl_loaddatalocal , ndb_autodiscover , rpl_rotate_logs , repair , rpl_trunc_binlog , mysqldump , rpl000001 "; -#endif -static char ignore_test[PATH_MAX] = ""; - -static char bin_dir[PATH_MAX]; -static char mysql_test_dir[PATH_MAX]; -static char test_dir[PATH_MAX]; -static char mysql_tmp_dir[PATH_MAX]; -static char result_dir[PATH_MAX]; -static char master_dir[PATH_MAX]; -static char slave_dir[PATH_MAX]; -static char lang_dir[PATH_MAX]; -static char char_dir[PATH_MAX]; - -static char mysqladmin_file[PATH_MAX]; -static char mysqld_file[PATH_MAX]; -static char mysqltest_file[PATH_MAX]; -#ifndef __WIN__ -static char master_pid[PATH_MAX]; -static char slave_pid[PATH_MAX]; -static char sh_file[PATH_MAX] = "/bin/sh"; -#else -static HANDLE master_pid; -static HANDLE slave_pid; -#endif - -static char master_opt[PATH_MAX] = ""; -static char slave_opt[PATH_MAX] = ""; - -static char slave_master_info[PATH_MAX] = ""; - -static char master_init_script[PATH_MAX] = ""; -static char slave_init_script[PATH_MAX] = ""; - -// OpenSSL -static char ca_cert[PATH_MAX]; -static char server_cert[PATH_MAX]; -static char server_key[PATH_MAX]; -static char client_cert[PATH_MAX]; -static char client_key[PATH_MAX]; - -int total_skip = 0; -int total_pass = 0; -int total_fail = 0; -int total_test = 0; - -int total_ignore = 0; - -int use_openssl = FALSE; -int master_running = FALSE; -int slave_running = FALSE; -int skip_slave = TRUE; -int single_test = TRUE; - -int restarts = 0; - -FILE *log_fd = NULL; - -/****************************************************************************** - - functions - -******************************************************************************/ - -/****************************************************************************** - - prototypes - -******************************************************************************/ - -void report_stats(); -void install_db(char *); -void mysql_install_db(); -void start_master(); -void start_slave(); -void mysql_start(); -void stop_slave(); -void stop_master(); -void mysql_stop(); -void mysql_restart(); -int read_option(char *, char *); -void run_test(char *); -void setup(char *); -void vlog(const char *, va_list); -void mlog(const char *, ...); -void log_info(const char *, ...); -void log_error(const char *, ...); -void log_errno(const char *, ...); -void die(const char *); -char *str_tok(char *string, const char *delim); -#ifndef __WIN__ -void run_init_script(const char *script_name); -#endif -/****************************************************************************** - - report_stats() - - Report the gathered statistics. - -******************************************************************************/ -void report_stats() -{ - if (total_fail == 0) - { - mlog("\nAll %d test(s) were successful.\n", total_test); - } - else - { - double percent = ((double)total_pass / total_test) * 100; - - mlog("\nFailed %u/%u test(s), %.02f%% successful.\n", - total_fail, total_test, percent); - mlog("\nThe .out and .err files in %s may give you some\n", result_dir); - mlog("hint of what when wrong.\n"); - mlog("\nIf you want to report this error, please first read the documentation\n"); - mlog("at: http://www.mysql.com/doc/M/y/MySQL_test_suite.html\n"); - } -} - -/****************************************************************************** - - install_db() - - Install the a database. - -******************************************************************************/ -void install_db(char *datadir) -{ - arg_list_t al; - int err; - char input[PATH_MAX]; - char output[PATH_MAX]; - char error[PATH_MAX]; - - // input file -#ifdef __NETWARE__ - snprintf(input, PATH_MAX, "%s/bin/init_db.sql", base_dir); -#else - snprintf(input, PATH_MAX, "%s/mysql-test/init_db.sql", base_dir); -#endif - snprintf(output, PATH_MAX, "%s/install.out", datadir); - snprintf(error, PATH_MAX, "%s/install.err", datadir); - - // args - init_args(&al); - add_arg(&al, mysqld_file); - add_arg(&al, "--no-defaults"); - add_arg(&al, "--bootstrap"); - add_arg(&al, "--skip-grant-tables"); - add_arg(&al, "--basedir=%s", base_dir); - add_arg(&al, "--datadir=%s", datadir); - add_arg(&al, "--skip-innodb"); - add_arg(&al, "--skip-bdb"); -#ifndef __NETWARE__ - add_arg(&al, "--character-sets-dir=%s", char_dir); - add_arg(&al, "--language=%s", lang_dir); -#endif - - // spawn - if ((err = spawn(mysqld_file, &al, TRUE, input, output, error, NULL)) != 0) - { - die("Unable to create database."); - } - - // free args - free_args(&al); -} - -/****************************************************************************** - - mysql_install_db() - - Install the test databases. - -******************************************************************************/ -void mysql_install_db() -{ - char temp[PATH_MAX]; - - // var directory - snprintf(temp, PATH_MAX, "%s/var", mysql_test_dir); - - // clean up old direcotry - del_tree(temp); - - // create var directory -#ifndef __WIN__ - mkdir(temp, S_IRWXU); - // create subdirectories - mlog("Creating test-suite folders...\n"); - snprintf(temp, PATH_MAX, "%s/var/run", mysql_test_dir); - mkdir(temp, S_IRWXU); - snprintf(temp, PATH_MAX, "%s/var/tmp", mysql_test_dir); - mkdir(temp, S_IRWXU); - snprintf(temp, PATH_MAX, "%s/var/master-data", mysql_test_dir); - mkdir(temp, S_IRWXU); - snprintf(temp, PATH_MAX, "%s/var/master-data/mysql", mysql_test_dir); - mkdir(temp, S_IRWXU); - snprintf(temp, PATH_MAX, "%s/var/master-data/test", mysql_test_dir); - mkdir(temp, S_IRWXU); - snprintf(temp, PATH_MAX, "%s/var/slave-data", mysql_test_dir); - mkdir(temp, S_IRWXU); - snprintf(temp, PATH_MAX, "%s/var/slave-data/mysql", mysql_test_dir); - mkdir(temp, S_IRWXU); - snprintf(temp, PATH_MAX, "%s/var/slave-data/test", mysql_test_dir); - mkdir(temp, S_IRWXU); -#else - mkdir(temp); - // create subdirectories - mlog("Creating test-suite folders...\n"); - snprintf(temp, PATH_MAX, "%s/var/run", mysql_test_dir); - mkdir(temp); - snprintf(temp, PATH_MAX, "%s/var/tmp", mysql_test_dir); - mkdir(temp); - snprintf(temp, PATH_MAX, "%s/var/master-data", mysql_test_dir); - mkdir(temp); - snprintf(temp, PATH_MAX, "%s/var/master-data/mysql", mysql_test_dir); - mkdir(temp); - snprintf(temp, PATH_MAX, "%s/var/master-data/test", mysql_test_dir); - mkdir(temp); - snprintf(temp, PATH_MAX, "%s/var/slave-data", mysql_test_dir); - mkdir(temp); - snprintf(temp, PATH_MAX, "%s/var/slave-data/mysql", mysql_test_dir); - mkdir(temp); - snprintf(temp, PATH_MAX, "%s/var/slave-data/test", mysql_test_dir); - mkdir(temp); -#endif - - // install databases - mlog("Creating test databases for master... \n"); - install_db(master_dir); - mlog("Creating test databases for slave... \n"); - install_db(slave_dir); -} - -/****************************************************************************** - - start_master() - - Start the master server. - -******************************************************************************/ -void start_master() -{ - arg_list_t al; - int err; - char master_out[PATH_MAX]; - char master_err[PATH_MAX]; -// char temp[PATH_MAX]; - char temp2[PATH_MAX]; - - // remove old berkeley db log files that can confuse the server - removef("%s/log.*", master_dir); - - // remove stale binary logs - removef("%s/var/log/*-bin.*", mysql_test_dir); - - // remove stale binary logs - removef("%s/var/log/*.index", mysql_test_dir); - - // remove master.info file - removef("%s/master.info", master_dir); - - // remove relay files - removef("%s/var/log/*relay*", mysql_test_dir); - - // remove relay-log.info file - removef("%s/relay-log.info", master_dir); - - // init script - if (master_init_script[0] != 0) - { -#ifdef __NETWARE__ - // TODO: use the scripts - if (strinstr(master_init_script, "repair_part2-master.sh") != 0) - { - FILE *fp; - - // create an empty index file - snprintf(temp, PATH_MAX, "%s/test/t1.MYI", master_dir); - fp = fopen(temp, "wb+"); - - fputs("1", fp); - - fclose(fp); - } -#elif !defined(__WIN__) - run_init_script(master_init_script); -#endif - } - - // redirection files - snprintf(master_out, PATH_MAX, "%s/var/run/master%u.out", - mysql_test_dir, restarts); - snprintf(master_err, PATH_MAX, "%s/var/run/master%u.err", - mysql_test_dir, restarts); -#ifndef __WIN__ - snprintf(temp2,PATH_MAX,"%s/var",mysql_test_dir); - mkdir(temp2,S_IRWXU); - snprintf(temp2,PATH_MAX,"%s/var/log",mysql_test_dir); - mkdir(temp2,S_IRWXU); -#else - snprintf(temp2,PATH_MAX,"%s/var",mysql_test_dir); - mkdir(temp2); - snprintf(temp2,PATH_MAX,"%s/var/log",mysql_test_dir); - mkdir(temp2); -#endif - // args - init_args(&al); - add_arg(&al, "%s", mysqld_file); - add_arg(&al, "--no-defaults"); - add_arg(&al, "--log-bin=%s/var/log/master-bin",mysql_test_dir); - add_arg(&al, "--server-id=1"); - add_arg(&al, "--basedir=%s", base_dir); - add_arg(&al, "--port=%u", master_port); -#if !defined(__NETWARE__) && !defined(__WIN__) - add_arg(&al, "--socket=%s",master_socket); -#endif - add_arg(&al, "--local-infile"); - add_arg(&al, "--core"); - add_arg(&al, "--datadir=%s", master_dir); -#ifndef __WIN__ - add_arg(&al, "--pid-file=%s", master_pid); -#endif - add_arg(&al, "--character-sets-dir=%s", char_dir); - add_arg(&al, "--tmpdir=%s", mysql_tmp_dir); - add_arg(&al, "--language=%s", lang_dir); -#ifdef DEBUG //only for debug builds - add_arg(&al, "--debug"); -#endif - - if (use_openssl) - { - add_arg(&al, "--ssl-ca=%s", ca_cert); - add_arg(&al, "--ssl-cert=%s", server_cert); - add_arg(&al, "--ssl-key=%s", server_key); - } - - // $MASTER_40_ARGS - add_arg(&al, "--rpl-recovery-rank=1"); - add_arg(&al, "--init-rpl-role=master"); - - // $SMALL_SERVER - add_arg(&al, "-O"); - add_arg(&al, "key_buffer_size=1M"); - add_arg(&al, "-O"); - add_arg(&al, "sort_buffer=256K"); - add_arg(&al, "-O"); - add_arg(&al, "max_heap_table_size=1M"); - - // $EXTRA_MASTER_OPT - if (master_opt[0] != 0) - { - char *p; - - p = (char *)str_tok(master_opt, " \t"); - if (!strstr(master_opt, "timezone")) - { - while (p) - { - add_arg(&al, "%s", p); - p = (char *)str_tok(NULL, " \t"); - } - } - } - - // remove the pid file if it exists -#ifndef __WIN__ - remove(master_pid); -#endif - - // spawn -#ifdef __WIN__ - if ((err= spawn(mysqld_file, &al, FALSE, NULL, master_out, master_err, &master_pid)) == 0) -#else - if ((err= spawn(mysqld_file, &al, FALSE, NULL, master_out, master_err, master_pid)) == 0) -#endif - { - sleep_until_file_exists(master_pid); - - if ((err = wait_for_server_start(bin_dir, mysqladmin_file, user, password, master_port, - mysql_tmp_dir)) == 0) - { - master_running = TRUE; - } - else - { - log_error("The master server went down early."); - } - } - else - { - log_error("Unable to start master server."); - } - - // free_args - free_args(&al); -} - -/****************************************************************************** - - start_slave() - - Start the slave server. - -******************************************************************************/ -void start_slave() -{ - arg_list_t al; - int err; - char slave_out[PATH_MAX]; - char slave_err[PATH_MAX]; - - // skip? - if (skip_slave) return; - - // remove stale binary logs - removef("%s/*-bin.*", slave_dir); - - // remove stale binary logs - removef("%s/*.index", slave_dir); - - // remove master.info file - removef("%s/master.info", slave_dir); - - // remove relay files - removef("%s/var/log/*relay*", mysql_test_dir); - - // remove relay-log.info file - removef("%s/relay-log.info", slave_dir); - - // init script - if (slave_init_script[0] != 0) - { -#ifdef __NETWARE__ - // TODO: use the scripts - if (strinstr(slave_init_script, "rpl000016-slave.sh") != 0) - { - // create empty master.info file - snprintf(temp, PATH_MAX, "%s/master.info", slave_dir); - close(open(temp, O_WRONLY | O_CREAT,S_IRWXU|S_IRWXG|S_IRWXO)); - } - else if (strinstr(slave_init_script, "rpl000017-slave.sh") != 0) - { - FILE *fp; - - // create a master.info file - snprintf(temp, PATH_MAX, "%s/master.info", slave_dir); - fp = fopen(temp, "wb+"); - - fputs("master-bin.000001\n", fp); - fputs("4\n", fp); - fputs("127.0.0.1\n", fp); - fputs("replicate\n", fp); - fputs("aaaaaaaaaaaaaaab\n", fp); - fputs("9306\n", fp); - fputs("1\n", fp); - fputs("0\n", fp); - - fclose(fp); - } - else if (strinstr(slave_init_script, "rpl_rotate_logs-slave.sh") != 0) - { - // create empty master.info file - snprintf(temp, PATH_MAX, "%s/master.info", slave_dir); - close(open(temp, O_WRONLY | O_CREAT,S_IRWXU|S_IRWXG|S_IRWXO)); - } -#elif !defined(__WIN__) - run_init_script(slave_init_script); -#endif - } - - // redirection files - snprintf(slave_out, PATH_MAX, "%s/var/run/slave%u.out", - mysql_test_dir, restarts); - snprintf(slave_err, PATH_MAX, "%s/var/run/slave%u.err", - mysql_test_dir, restarts); - - // args - init_args(&al); - add_arg(&al, "%s", mysqld_file); - add_arg(&al, "--no-defaults"); - add_arg(&al, "--log-bin=slave-bin"); - add_arg(&al, "--relay_log=slave-relay-bin"); - add_arg(&al, "--basedir=%s", base_dir); - add_arg(&al, "--port=%u", slave_port); -#if !defined(__NETWARE__) && !defined(__WIN__) - add_arg(&al, "--socket=%s",slave_socket); -#endif - add_arg(&al, "--datadir=%s", slave_dir); -#ifndef __WIN__ - add_arg(&al, "--pid-file=%s", slave_pid); -#endif - add_arg(&al, "--character-sets-dir=%s", char_dir); - add_arg(&al, "--core"); - add_arg(&al, "--tmpdir=%s", mysql_tmp_dir); - add_arg(&al, "--language=%s", lang_dir); - - add_arg(&al, "--exit-info=256"); - add_arg(&al, "--log-slave-updates"); - add_arg(&al, "--init-rpl-role=slave"); - add_arg(&al, "--skip-innodb"); - add_arg(&al, "--skip-slave-start"); - add_arg(&al, "--slave-load-tmpdir=../../var/tmp"); - - add_arg(&al, "--report-user=%s", user); - add_arg(&al, "--report-host=127.0.0.1"); - add_arg(&al, "--report-port=%u", slave_port); - - add_arg(&al, "--master-retry-count=10"); - add_arg(&al, "-O"); - add_arg(&al, "slave_net_timeout=10"); -#ifdef DEBUG //only for debug builds - add_arg(&al, "--debug"); -#endif - - if (use_openssl) - { - add_arg(&al, "--ssl-ca=%s", ca_cert); - add_arg(&al, "--ssl-cert=%s", server_cert); - add_arg(&al, "--ssl-key=%s", server_key); - } - - // slave master info - if (slave_master_info[0] != 0) - { - char *p; - - p = (char *)str_tok(slave_master_info, " \t"); - - while(p) - { - add_arg(&al, "%s", p); - - p = (char *)str_tok(NULL, " \t"); - } - } - else - { - add_arg(&al, "--master-user=%s", user); - add_arg(&al, "--master-password=%s", password); - add_arg(&al, "--master-host=127.0.0.1"); - add_arg(&al, "--master-port=%u", master_port); - add_arg(&al, "--master-connect-retry=1"); - add_arg(&al, "--server-id=2"); - add_arg(&al, "--rpl-recovery-rank=2"); - } - - // small server - add_arg(&al, "-O"); - add_arg(&al, "key_buffer_size=1M"); - add_arg(&al, "-O"); - add_arg(&al, "sort_buffer=256K"); - add_arg(&al, "-O"); - add_arg(&al, "max_heap_table_size=1M"); - - - // opt args - if (slave_opt[0] != 0) - { - char *p; - - p = (char *)str_tok(slave_opt, " \t"); - - while(p) - { - add_arg(&al, "%s", p); - - p = (char *)str_tok(NULL, " \t"); - } - } - - // remove the pid file if it exists -#ifndef __WIN__ - remove(slave_pid); -#endif - // spawn -#ifdef __WIN__ - if ((err = spawn(mysqld_file, &al, FALSE, NULL, slave_out, slave_err, &slave_pid)) == 0) -#else - if ((err = spawn(mysqld_file, &al, FALSE, NULL, slave_out, slave_err, slave_pid)) == 0) -#endif - { - sleep_until_file_exists(slave_pid); - - if ((err = wait_for_server_start(bin_dir, mysqladmin_file, user, password, slave_port, - mysql_tmp_dir)) == 0) - { - slave_running = TRUE; - } - else - { - log_error("The slave server went down early."); - } - } - else - { - log_error("Unable to start slave server."); - } - - // free args - free_args(&al); -} - -/****************************************************************************** - - mysql_start() - - Start the mysql servers. - -******************************************************************************/ -void mysql_start() -{ -// log_info("Starting the MySQL server(s): %u", ++restarts); - start_master(); - - start_slave(); - - // activate the test screen -#ifdef __NETWARE__ - ActivateScreen(getscreenhandle()); -#endif -} - -/****************************************************************************** - - stop_slave() - - Stop the slave server. - -******************************************************************************/ -void stop_slave() -{ - int err; - - // running? - if (!slave_running) return; - - // stop - if ((err = stop_server(bin_dir, mysqladmin_file, user, password, slave_port, slave_pid, - mysql_tmp_dir)) == 0) - { - slave_running = FALSE; - } - else - { - log_error("Unable to stop slave server."); - } -} - -/****************************************************************************** - - stop_master() - - Stop the master server. - -******************************************************************************/ -void stop_master() -{ - int err; - - // running? - if (!master_running) return; - - if ((err = stop_server(bin_dir, mysqladmin_file, user, password, master_port, master_pid, - mysql_tmp_dir)) == 0) - { - master_running = FALSE; - } - else - { - log_error("Unable to stop master server."); - } -} - -/****************************************************************************** - - mysql_stop() - - Stop the mysql servers. - -******************************************************************************/ -void mysql_stop() -{ - - stop_master(); - - stop_slave(); - - // activate the test screen -#ifdef __NETWARE__ - ActivateScreen(getscreenhandle()); -#endif -} - -/****************************************************************************** - - mysql_restart() - - Restart the mysql servers. - -******************************************************************************/ -void mysql_restart() -{ -// log_info("Restarting the MySQL server(s): %u", ++restarts); - - mysql_stop(); - - mlog(DASH); - - mysql_start(); -} - -/****************************************************************************** - - read_option() - - Read the option file. - -******************************************************************************/ -int read_option(char *opt_file, char *opt) -{ - int fd, err; - char *p; - char buf[PATH_MAX]; - - // copy current option - strncpy(buf, opt, PATH_MAX); - - // open options file - fd = open(opt_file, O_RDONLY); - - err = read(fd, opt, PATH_MAX); - - close(fd); - - if (err > 0) - { - // terminate string - if ((p = strchr(opt, '\n')) != NULL) - { - *p = 0; - - // check for a '\r' - if ((p = strchr(opt, '\r')) != NULL) - { - *p = 0; - } - } - else - { - opt[err] = 0; - } - - // check for $MYSQL_TEST_DIR - if ((p = strstr(opt, "$MYSQL_TEST_DIR")) != NULL) - { - char temp[PATH_MAX]; - - *p = 0; - - strcpy(temp, p + strlen("$MYSQL_TEST_DIR")); - - strcat(opt, mysql_test_dir); - - strcat(opt, temp); - } - // Check for double backslash and replace it with single bakslash - if ((p = strstr(opt, "\\\\")) != NULL) - { - /* bmove is guranteed to work byte by byte */ - bmove(p, p+1, strlen(p+1)); - } - } - else - { - // clear option - *opt = 0; - } - - // compare current option with previous - return strcmp(opt, buf); -} - -/****************************************************************************** - - run_test() - - Run the given test case. - -******************************************************************************/ -void run_test(char *test) -{ - char temp[PATH_MAX]; - const char *rstr; - int skip = FALSE, ignore=FALSE; - int restart = FALSE; - int flag = FALSE; - struct stat info; - - // skip tests in the skip list - snprintf(temp, PATH_MAX, " %s ", test); - skip = (strinstr(skip_test, temp) != 0); - if (skip == FALSE) - ignore = (strinstr(ignore_test, temp) != 0); - - snprintf(master_init_script, PATH_MAX, "%s/%s-master.sh", test_dir, test); - snprintf(slave_init_script, PATH_MAX, "%s/%s-slave.sh", test_dir, test); -#ifdef __WIN__ - if (! stat(master_init_script, &info)) - skip = TRUE; - if (!stat(slave_init_script, &info)) - skip = TRUE; -#endif - if (ignore) - { - // show test - mlog("%-46s ", test); - - // ignore - rstr = TEST_IGNORE; - ++total_ignore; - } - else if (!skip) // skip test? - { - char test_file[PATH_MAX]; - char master_opt_file[PATH_MAX]; - char slave_opt_file[PATH_MAX]; - char slave_master_info_file[PATH_MAX]; - char result_file[PATH_MAX]; - char reject_file[PATH_MAX]; - char out_file[PATH_MAX]; - char err_file[PATH_MAX]; - int err; - arg_list_t al; -#ifdef __WIN__ - /* - Clean test database - */ - removef("%s/test/*.*", master_dir); - removef("%s/test/*.*", slave_dir); - removef("%s/mysqltest/*.*", master_dir); - removef("%s/mysqltest/*.*", slave_dir); - -#endif - // skip slave? - flag = skip_slave; - skip_slave = (strncmp(test, "rpl", 3) != 0); - if (flag != skip_slave) restart = TRUE; - - // create files - snprintf(master_opt_file, PATH_MAX, "%s/%s-master.opt", test_dir, test); - snprintf(slave_opt_file, PATH_MAX, "%s/%s-slave.opt", test_dir, test); - snprintf(slave_master_info_file, PATH_MAX, "%s/%s.slave-mi", test_dir, test); - snprintf(reject_file, PATH_MAX, "%s/%s%s", result_dir, test, REJECT_SUFFIX); - snprintf(out_file, PATH_MAX, "%s/%s%s", result_dir, test, OUT_SUFFIX); - snprintf(err_file, PATH_MAX, "%s/%s%s", result_dir, test, ERR_SUFFIX); - - // netware specific files - snprintf(test_file, PATH_MAX, "%s/%s%s", test_dir, test, NW_TEST_SUFFIX); - if (stat(test_file, &info)) - { - snprintf(test_file, PATH_MAX, "%s/%s%s", test_dir, test, TEST_SUFFIX); - if (access(test_file,0)) - { - printf("Invalid test name %s, %s file not found\n",test,test_file); - return; - } - } - - snprintf(result_file, PATH_MAX, "%s/%s%s", result_dir, test, NW_RESULT_SUFFIX); - if (stat(result_file, &info)) - { - snprintf(result_file, PATH_MAX, "%s/%s%s", result_dir, test, RESULT_SUFFIX); - } - - // init scripts - if (stat(master_init_script, &info)) - master_init_script[0] = 0; - else - restart = TRUE; - - if (stat(slave_init_script, &info)) - slave_init_script[0] = 0; - else - restart = TRUE; - - // read options - if (read_option(master_opt_file, master_opt)) restart = TRUE; - if (read_option(slave_opt_file, slave_opt)) restart = TRUE; - if (read_option(slave_master_info_file, slave_master_info)) restart = TRUE; - - // cleanup previous run - remove(reject_file); - remove(out_file); - remove(err_file); - - // start or restart? - if (!master_running) mysql_start(); - else if (restart) mysql_restart(); - - // let the system stabalize - sleep(1); - - // show test - mlog("%-46s ", test); - - - // args - init_args(&al); - add_arg(&al, "%s", mysqltest_file); - add_arg(&al, "--no-defaults"); - add_arg(&al, "--port=%u", master_port); -#if !defined(__NETWARE__) && !defined(__WIN__) - add_arg(&al, "--socket=%s", master_socket); - add_arg(&al, "--tmpdir=%s", mysql_tmp_dir); -#endif - add_arg(&al, "--database=%s", db); - add_arg(&al, "--user=%s", user); - add_arg(&al, "--password=%s", password); - add_arg(&al, "--silent"); - add_arg(&al, "--basedir=%s/", mysql_test_dir); - add_arg(&al, "--host=127.0.0.1"); - add_arg(&al, "-v"); - add_arg(&al, "-R"); - add_arg(&al, "%s", result_file); - - if (use_openssl) - { - add_arg(&al, "--ssl-ca=%s", ca_cert); - add_arg(&al, "--ssl-cert=%s", client_cert); - add_arg(&al, "--ssl-key=%s", client_key); - } - - // spawn - err = spawn(mysqltest_file, &al, TRUE, test_file, out_file, err_file, NULL); - - // free args - free_args(&al); - - remove_empty_file(out_file); - remove_empty_file(err_file); - - if (err == 0) - { - // pass - rstr = TEST_PASS; - ++total_pass; - - // increment total - ++total_test; - } - else if (err == 2) - { - // skip - rstr = TEST_SKIP; - ++total_skip; - } - else if (err == 1) - { - // fail - rstr = TEST_FAIL; - ++total_fail; - - // increment total - ++total_test; - } - else - { - rstr = TEST_BAD; - } - } - else // early skips - { - // show test - mlog("%-46s ", test); - - // skip - rstr = TEST_SKIP; - ++total_skip; - } - - // result - mlog("%-14s\n", rstr); -} - -/****************************************************************************** - - vlog() - - Log the message. - -******************************************************************************/ -void vlog(const char *format, va_list ap) -{ - vfprintf(stdout, format, ap); - fflush(stdout); - - if (log_fd) - { - vfprintf(log_fd, format, ap); - fflush(log_fd); - } -} - -/****************************************************************************** - - log() - - Log the message. - -******************************************************************************/ -void mlog(const char *format, ...) -{ - va_list ap; - - va_start(ap, format); - - vlog(format, ap); - - va_end(ap); -} - -/****************************************************************************** - - log_info() - - Log the given information. - -******************************************************************************/ -void log_info(const char *format, ...) -{ - va_list ap; - - va_start(ap, format); - - mlog("-- INFO : "); - vlog(format, ap); - mlog("\n"); - - va_end(ap); -} - -/****************************************************************************** - - log_error() - - Log the given error. - -******************************************************************************/ -void log_error(const char *format, ...) -{ - va_list ap; - - va_start(ap, format); - - mlog("-- ERROR: "); - vlog(format, ap); - mlog("\n"); - - va_end(ap); -} - -/****************************************************************************** - - log_errno() - - Log the given error and errno. - -******************************************************************************/ -void log_errno(const char *format, ...) -{ - va_list ap; - - va_start(ap, format); - - mlog("-- ERROR: (%003u) ", errno); - vlog(format, ap); - mlog("\n"); - - va_end(ap); -} - -/****************************************************************************** - - die() - - Exit the application. - -******************************************************************************/ -void die(const char *msg) -{ - log_error(msg); -#ifdef __NETWARE__ - pressanykey(); -#endif - exit(-1); -} - -/****************************************************************************** - - setup() - - Setup the mysql test enviornment. - -******************************************************************************/ -void setup(char *file) -{ - char temp[PATH_MAX]; - char file_path[PATH_MAX*2]; - char *p; - int position; - - // set the timezone for the timestamp test -#ifdef __WIN__ - _putenv( "TZ=GMT-3" ); -#else - setenv("TZ", "GMT-3", TRUE); -#endif - // find base dir -#ifdef __NETWARE__ - strcpy(temp, strlwr(file)); - while((p = strchr(temp, '\\')) != NULL) *p = '/'; -#else - getcwd(temp, PATH_MAX); - position = strlen(temp); - temp[position] = '/'; - temp[position+1] = 0; -#ifdef __WIN__ - while((p = strchr(temp, '\\')) != NULL) *p = '/'; -#endif -#endif - - if ((position = strinstr(temp, "/mysql-test/")) != 0) - { - p = temp + position - 1; - *p = 0; - strcpy(base_dir, temp); - } - - log_info("Currect directory: %s",base_dir); - -#ifdef __NETWARE__ - // setup paths - snprintf(bin_dir, PATH_MAX, "%s/bin", base_dir); - snprintf(mysql_test_dir, PATH_MAX, "%s/mysql-test", base_dir); - snprintf(test_dir, PATH_MAX, "%s/t", mysql_test_dir); - snprintf(mysql_tmp_dir, PATH_MAX, "%s/var/tmp", mysql_test_dir); - snprintf(result_dir, PATH_MAX, "%s/r", mysql_test_dir); - snprintf(master_dir, PATH_MAX, "%s/var/master-data", mysql_test_dir); - snprintf(slave_dir, PATH_MAX, "%s/var/slave-data", mysql_test_dir); - snprintf(lang_dir, PATH_MAX, "%s/share/english", base_dir); - snprintf(char_dir, PATH_MAX, "%s/share/charsets", base_dir); - -#ifdef HAVE_OPENSSL - use_openssl = TRUE; -#endif // HAVE_OPENSSL - - // OpenSSL paths - snprintf(ca_cert, PATH_MAX, "%s/SSL/cacert.pem", base_dir); - snprintf(server_cert, PATH_MAX, "%s/SSL/server-cert.pem", base_dir); - snprintf(server_key, PATH_MAX, "%s/SSL/server-key.pem", base_dir); - snprintf(client_cert, PATH_MAX, "%s/SSL/client-cert.pem", base_dir); - snprintf(client_key, PATH_MAX, "%s/SSL/client-key.pem", base_dir); - - // setup files - snprintf(mysqld_file, PATH_MAX, "%s/mysqld", bin_dir); - snprintf(mysqltest_file, PATH_MAX, "%s/mysqltest", bin_dir); - snprintf(mysqladmin_file, PATH_MAX, "%s/mysqladmin", bin_dir); - snprintf(master_pid, PATH_MAX, "%s/var/run/master.pid", mysql_test_dir); - snprintf(slave_pid, PATH_MAX, "%s/var/run/slave.pid", mysql_test_dir); -#elif __WIN__ - // setup paths -#ifdef _DEBUG - snprintf(bin_dir, PATH_MAX, "%s/client_debug", base_dir); -#else - snprintf(bin_dir, PATH_MAX, "%s/client_release", base_dir); -#endif - snprintf(mysql_test_dir, PATH_MAX, "%s/mysql-test", base_dir); - snprintf(test_dir, PATH_MAX, "%s/t", mysql_test_dir); - snprintf(mysql_tmp_dir, PATH_MAX, "%s/var/tmp", mysql_test_dir); - snprintf(result_dir, PATH_MAX, "%s/r", mysql_test_dir); - snprintf(master_dir, PATH_MAX, "%s/var/master-data", mysql_test_dir); - snprintf(slave_dir, PATH_MAX, "%s/var/slave-data", mysql_test_dir); - snprintf(lang_dir, PATH_MAX, "%s/share/english", base_dir); - snprintf(char_dir, PATH_MAX, "%s/share/charsets", base_dir); - -#ifdef HAVE_OPENSSL - use_openssl = TRUE; -#endif // HAVE_OPENSSL - - // OpenSSL paths - snprintf(ca_cert, PATH_MAX, "%s/SSL/cacert.pem", base_dir); - snprintf(server_cert, PATH_MAX, "%s/SSL/server-cert.pem", base_dir); - snprintf(server_key, PATH_MAX, "%s/SSL/server-key.pem", base_dir); - snprintf(client_cert, PATH_MAX, "%s/SSL/client-cert.pem", base_dir); - snprintf(client_key, PATH_MAX, "%s/SSL/client-key.pem", base_dir); - - // setup files - snprintf(mysqld_file, PATH_MAX, "%s/mysqld.exe", bin_dir); - snprintf(mysqltest_file, PATH_MAX, "%s/mysqltest.exe", bin_dir); - snprintf(mysqladmin_file, PATH_MAX, "%s/mysqladmin.exe", bin_dir); -#else - // setup paths - snprintf(bin_dir, PATH_MAX, "%s/client", base_dir); - snprintf(mysql_test_dir, PATH_MAX, "%s/mysql-test", base_dir); - snprintf(test_dir, PATH_MAX, "%s/t", mysql_test_dir); - snprintf(mysql_tmp_dir, PATH_MAX, "%s/var/tmp", mysql_test_dir); - snprintf(result_dir, PATH_MAX, "%s/r", mysql_test_dir); - snprintf(master_dir, PATH_MAX, "%s/var/master-data", mysql_test_dir); - snprintf(slave_dir, PATH_MAX, "%s/var/slave-data", mysql_test_dir); - snprintf(lang_dir, PATH_MAX, "%s/sql/share/english", base_dir); - snprintf(char_dir, PATH_MAX, "%s/sql/share/charsets", base_dir); - -#ifdef HAVE_OPENSSL - use_openssl = TRUE; -#endif // HAVE_OPENSSL - - // OpenSSL paths - snprintf(ca_cert, PATH_MAX, "%s/SSL/cacert.pem", base_dir); - snprintf(server_cert, PATH_MAX, "%s/SSL/server-cert.pem", base_dir); - snprintf(server_key, PATH_MAX, "%s/SSL/server-key.pem", base_dir); - snprintf(client_cert, PATH_MAX, "%s/SSL/client-cert.pem", base_dir); - snprintf(client_key, PATH_MAX, "%s/SSL/client-key.pem", base_dir); - - // setup files - snprintf(mysqld_file, PATH_MAX, "%s/sql/mysqld", base_dir); - snprintf(mysqltest_file, PATH_MAX, "%s/mysqltest", bin_dir); - snprintf(mysqladmin_file, PATH_MAX, "%s/mysqladmin", bin_dir); - snprintf(master_pid, PATH_MAX, "%s/var/run/master.pid", mysql_test_dir); - snprintf(slave_pid, PATH_MAX, "%s/var/run/slave.pid", mysql_test_dir); - - snprintf(master_socket,PATH_MAX, "%s/var/tmp/master.sock", mysql_test_dir); - snprintf(slave_socket,PATH_MAX, "%s/var/tmp/slave.sock", mysql_test_dir); - -#endif - // create log file - snprintf(temp, PATH_MAX, "%s/mysql-test-run.log", mysql_test_dir); - if ((log_fd = fopen(temp, "w+")) == NULL) - { - log_errno("Unable to create log file."); - } - - // prepare skip test list - while((p = strchr(skip_test, ',')) != NULL) *p = ' '; - strcpy(temp, strlwr(skip_test)); - snprintf(skip_test, PATH_MAX, " %s ", temp); - - // environment -#ifdef __NETWARE__ - setenv("MYSQL_TEST_DIR", mysql_test_dir, 1); - snprintf(file_path, PATH_MAX*2, "%s/client/mysqldump --no-defaults -u root --port=%u", bin_dir, master_port); - setenv("MYSQL_DUMP", file_path, 1); - snprintf(file_path, PATH_MAX*2, "%s/client/mysqlbinlog --no-defaults --local-load=%s", bin_dir, mysql_tmp_dir); - setenv("MYSQL_BINLOG", file_path, 1); -#elif __WIN__ - snprintf(file_path,MAX_PATH,"MYSQL_TEST_DIR=%s",mysql_test_dir); - _putenv(file_path); - snprintf(file_path, PATH_MAX*2, "MYSQL_DUMP=%s/mysqldump.exe --no-defaults -u root --port=%u", bin_dir, master_port); - _putenv(file_path); - snprintf(file_path, PATH_MAX*2, "MYSQL_BINLOG=%s/mysqlbinlog.exe --no-defaults --local-load=%s", bin_dir, mysql_tmp_dir); - _putenv(file_path); -#else - setenv("MYSQL_TEST_DIR", mysql_test_dir, 1); - snprintf(file_path, PATH_MAX*2, "%s/mysqldump --no-defaults -u root --port=%u --socket=%s", bin_dir, master_port, master_socket); - setenv("MYSQL_DUMP", file_path, 1); - snprintf(file_path, PATH_MAX*2, "%s/mysqlbinlog --no-defaults --local-load=%s", bin_dir, mysql_tmp_dir); - setenv("MYSQL_BINLOG", file_path, 1); -#endif - -#ifndef __WIN__ - setenv("MASTER_MYPORT", "9306", 1); - setenv("SLAVE_MYPORT", "9307", 1); - setenv("MYSQL_TCP_PORT", "3306", 1); -#else - _putenv("MASTER_MYPORT=9306"); - _putenv("SLAVE_MYPORT=9307"); - _putenv("MYSQL_TCP_PORT=3306"); -#endif - -} - -/****************************************************************************** - - main() - -******************************************************************************/ -int main(int argc, char **argv) -{ - int is_ignore_list = 0; - // setup - setup(argv[0]); - - /* The --ignore option is comma saperated list of test cases to skip and - should be very first command line option to the test suite. - - The usage is now: - mysql_test_run --ignore=test1,test2 test3 test4 - where test1 and test2 are test cases to ignore - and test3 and test4 are test cases to run. - */ - if (argc >= 2 && !strnicmp(argv[1], "--ignore=", sizeof("--ignore=")-1)) - { - char *temp, *token; - temp= strdup(strchr(argv[1],'=') + 1); - for (token=str_tok(temp, ","); token != NULL; token=str_tok(NULL, ",")) - { - if (strlen(ignore_test) + strlen(token) + 2 <= PATH_MAX-1) - sprintf(ignore_test+strlen(ignore_test), " %s ", token); - else - { - free(temp); - die("ignore list too long."); - } - } - free(temp); - is_ignore_list = 1; - } - // header -#ifndef __WIN__ - mlog("MySQL Server %s, for %s (%s)\n\n", VERSION, SYSTEM_TYPE, MACHINE_TYPE); -#else - mlog("MySQL Server ---, for %s (%s)\n\n", SYSTEM_TYPE, MACHINE_TYPE); -#endif - - mlog("Initializing Tests...\n"); - - // install test databases - mysql_install_db(); - - mlog("Starting Tests...\n"); - - mlog("\n"); - mlog(HEADER); - mlog(DASH); - - if ( argc > 1 + is_ignore_list ) - { - int i; - - // single test - single_test = TRUE; - - for (i = 1 + is_ignore_list; i < argc; i++) - { - // run given test - run_test(argv[i]); - } - } - else - { - // run all tests -#ifndef __WIN__ - struct dirent **namelist; - int i,n; - char test[NAME_MAX]; - char *p; - int position; - - n = scandir(test_dir, &namelist, 0, alphasort); - if (n < 0) - die("Unable to open tests directory."); - else - { - for (i = 0; i < n; i++) - { - strcpy(test, strlwr(namelist[i]->d_name)); - // find the test suffix - if ((position = strinstr(test, TEST_SUFFIX)) != 0) - { - p = test + position - 1; - // null terminate at the suffix - *p = 0; - // run test - run_test(test); - } - free(namelist[n]); - } - free(namelist); - } -#else - struct _finddata_t dir; - intptr_t handle; - char test[NAME_MAX]; - char mask[PATH_MAX]; - char *p; - int position; - char **names = 0; - char **testes = 0; - int name_index; - int index; - - // single test - single_test = FALSE; - - snprintf(mask,MAX_PATH,"%s/*.test",test_dir); - - if ((handle=_findfirst(mask,&dir)) == -1L) - { - die("Unable to open tests directory."); - } - - names = malloc(MAX_COUNT_TESTES*4); - testes = names; - name_index = 0; - - do - { - if (!(dir.attrib & _A_SUBDIR)) - { - strcpy(test, strlwr(dir.name)); - - // find the test suffix - if ((position = strinstr(test, TEST_SUFFIX)) != 0) - { - p = test + position - 1; - // null terminate at the suffix - *p = 0; - - // insert test - *names = malloc(PATH_MAX); - strcpy(*names,test); - names++; - name_index++; - } - } - }while (_findnext(handle,&dir) == 0); - - _findclose(handle); - - qsort( (void *)testes, name_index, sizeof( char * ), compare ); - - for (index = 0; index <= name_index; index++) - { - run_test(testes[index]); - free(testes[index]); - } - - free(testes); -#endif - } - - // stop server - mysql_stop(); - - mlog(DASH); - mlog("\n"); - - mlog("Ending Tests...\n"); - - // report stats - report_stats(); - - // close log - if (log_fd) fclose(log_fd); - - // keep results up -#ifdef __NETWARE__ - pressanykey(); -#endif - return 0; -} - - -/* - Synopsis: - This function breaks the string into a sequence of tokens. The difference - between this function and strtok is that it respects the quoted string i.e. - it skips any delimiter character within the quoted part of the string. - It return tokens by eliminating quote character. It modifies the input string - passed. It will work with whitespace delimeter but may not work properly with - other delimeter. If the delimeter will contain any quote character, then - function will not tokenize and will return null string. - e.g. if input string is - --init-slave="set global max_connections=500" --skip-external-locking - then the output will two string i.e. - --init-slave=set global max_connections=500 - --skip-external-locking - -Arguments: - string: input string - delim: set of delimiter character -Output: - return the null terminated token of NULL. -*/ - - -char *str_tok(char *string, const char *delim) -{ - char *token; /* current token received from strtok */ - char *qt_token; /* token delimeted by the matching pair of quote */ - /* - if there are any quote chars found in the token then this variable - will hold the concatenated string to return to the caller - */ - char *ptr_token=NULL; - /* pointer to the quote character in the token from strtok */ - char *ptr_quote=NULL; - - /* See if the delimeter contains any quote character */ - if (strchr(delim,'\'') || strchr(delim,'\"')) - return NULL; - - /* repeate till we are getting some token from strtok */ - while ((token = (char*)strtok(string, delim) ) != NULL) - { - /* - make the input string NULL so that next time onward strtok can - be called with NULL input string. - */ - string = NULL; - /* - We don't need to remove any quote character for Windows version - */ -#ifndef __WIN__ - /* check if the current token contain double quote character*/ - if ((ptr_quote = (char*)strchr(token,'\"')) != NULL) - { - /* - get the matching the matching double quote in the remaining - input string - */ - qt_token = (char*)strtok(NULL,"\""); - } - /* check if the current token contain single quote character*/ - else if ((ptr_quote = (char*)strchr(token,'\'')) != NULL) - { - /* - get the matching the matching single quote in the remaining - input string - */ - qt_token = (char*)strtok(NULL,"\'"); - } -#endif - /* - if the current token does not contains any quote character then - return to the caller. - */ - if (ptr_quote == NULL) - { - /* - if there is any earlier token i.e. ptr_token then append the - current token in it and return it else return the current - token directly - */ - return ptr_token ? strcat(ptr_token,token) : token; - } - - /* - remove the quote character i.e. make NULL so that the token will - be devided in two part and later both part can be concatenated - and hence quote will be removed - */ - *ptr_quote= 0; - - /* check if ptr_token has been initialized or not */ - if (ptr_token == NULL) - { - /* initialize the ptr_token with current token */ - ptr_token= token; - /* copy entire string between matching pair of quote*/ - sprintf(ptr_token+strlen(ptr_token),"%s %s", ptr_quote+1, qt_token); - } - else - { - /* - copy the current token and entire string between matching pair - of quote - */ - if (qt_token == NULL) - { - sprintf(ptr_token+strlen(ptr_token),"%s%s", token, ptr_quote+1); - } - else - { - sprintf(ptr_token+strlen(ptr_token),"%s%s %s", token, ptr_quote+1, - qt_token ); - } - } - } - - /* return the concatenated token */ - return ptr_token; -} - -#ifndef __WIN__ - -/* - Synopsis: - This function run scripts files on Linux and Netware - -Arguments: - script_name: name of script file - -Output: - nothing -*/ -void run_init_script(const char *script_name) -{ - arg_list_t al; - int err; - - // args - init_args(&al); - add_arg(&al, sh_file); - add_arg(&al, script_name); - - // spawn - if ((err = spawn(sh_file, &al, TRUE, NULL, NULL, NULL, NULL)) != 0) - { - die("Unable to run script."); - } - - // free args - free_args(&al); -} -#endif From 892197ca362e1cde261422d3d693efa0988fdcad Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 23 Nov 2004 15:03:16 +0100 Subject: [PATCH 0315/1063] use FT_MAX_WORD_LEN_FOR_SORT instead of HA_FT_MAXBYTELEN when calculating preferred key block length for ft index --- myisam/mi_create.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/myisam/mi_create.c b/myisam/mi_create.c index 7fc7cc4edf1..f99a2c655d2 100644 --- a/myisam/mi_create.c +++ b/myisam/mi_create.c @@ -16,7 +16,7 @@ /* Create a MyISAM table */ -#include "fulltext.h" +#include "ftdefs.h" #include "sp_defs.h" #if defined(MSDOS) || defined(__WIN__) @@ -41,7 +41,7 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs, File dfile,file; int errpos,save_errno; myf create_flag; - uint fields,length,max_key_length,packed,pointer, + uint fields,length,max_key_length,packed,pointer,real_length_diff, key_length,info_length,key_segs,options,min_key_length_skip, base_pos,varchar_count,long_varchar_count,varchar_length, max_key_block_length,unique_key_parts,fulltext_keys,offset; @@ -238,7 +238,7 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs, { share.state.key_root[i]= HA_OFFSET_ERROR; - min_key_length_skip=length=0; + min_key_length_skip=length=real_length_diff=0; key_length=pointer; if (keydef->flag & HA_SPATIAL) { @@ -297,6 +297,7 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs, key_length+= HA_FT_MAXBYTELEN+HA_FT_WLEN; length++; /* At least one length byte */ min_key_length_skip+=HA_FT_MAXBYTELEN; + real_length_diff=HA_FT_MAXBYTELEN-FT_MAX_WORD_LEN_FOR_SORT; } else { @@ -397,7 +398,8 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs, key_segs) share.state.rec_per_key_part[key_segs-1]=1L; length+=key_length; - keydef->block_length= MI_BLOCK_SIZE(length,pointer,MI_MAX_KEYPTR_SIZE); + keydef->block_length= MI_BLOCK_SIZE(length-real_length_diff, + pointer,MI_MAX_KEYPTR_SIZE); if (keydef->block_length > MI_MAX_KEY_BLOCK_LENGTH || length >= MI_MAX_KEY_BUFF) { From a9aff01ebdf9e1ea27c6e7cc0fef8c1c406df454 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 23 Nov 2004 17:18:41 +0100 Subject: [PATCH 0316/1063] Change "Do-compile" to make automatic build log analysis easier and to run the standard tests with "--force" (default, can be switched off). Build-tools/Do-compile: 1) For an automated log analysis, we need a clear marker in the build log whether compile + link succeeded: Write it after successful "make". 2) Ensure the standard tests are run with "--force" in the default case, but allow the old behaviour by an option "--one-error". 3) Correct a typing error in the usage message. --- Build-tools/Do-compile | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/Build-tools/Do-compile b/Build-tools/Do-compile index f92af463a0a..af03f3209aa 100755 --- a/Build-tools/Do-compile +++ b/Build-tools/Do-compile @@ -10,7 +10,7 @@ use Sys::Hostname; $opt_distribution=$opt_user=$opt_config_env=$opt_config_extra_env=""; $opt_dbd_options=$opt_perl_options=$opt_config_options=$opt_make_options=$opt_suffix=""; $opt_tmp=$opt_version_suffix=""; -$opt_help=$opt_delete=$opt_debug=$opt_stage=$opt_no_test=$opt_no_perl=$opt_with_low_memory=$opt_fast_benchmark=$opt_static_client=$opt_static_server=$opt_static_perl=$opt_sur=$opt_with_small_disk=$opt_local_perl=$opt_tcpip=$opt_build_thread=$opt_use_old_distribution=$opt_enable_shared=$opt_no_crash_me=$opt_no_strip=$opt_with_debug=$opt_no_benchmark=$opt_no_mysqltest=$opt_without_embedded=0; +$opt_help=$opt_delete=$opt_debug=$opt_stage=$opt_no_test=$opt_no_perl=$opt_one_error=$opt_with_low_memory=$opt_fast_benchmark=$opt_static_client=$opt_static_server=$opt_static_perl=$opt_sur=$opt_with_small_disk=$opt_local_perl=$opt_tcpip=$opt_build_thread=$opt_use_old_distribution=$opt_enable_shared=$opt_no_crash_me=$opt_no_strip=$opt_with_debug=$opt_no_benchmark=$opt_no_mysqltest=$opt_without_embedded=0; $opt_innodb=$opt_bdb=$opt_raid=$opt_libwrap=$opt_clearlogs=$opt_without_ndbcluster=0; GetOptions( @@ -36,6 +36,7 @@ GetOptions( "no-test", "no-mysqltest", "no-benchmark", + "one-error", "perl-files=s", "perl-options=s", "raid", @@ -298,6 +299,7 @@ if ($opt_stage <= 2) $command=$make; $command.= " $opt_make_options" if (defined($opt_make_options) && $opt_make_options ne ""); safe_system($command); + print LOG "Do-compile: Build successful\n"; } # @@ -358,10 +360,16 @@ $ENV{"LD_LIBRARY_PATH"}= ("$test_dir/lib" . # if ($opt_stage <= 5 && !$opt_no_test && !$opt_no_mysqltest) { + my $force= ""; + if (!$opt_one_error) + { + $force= "--force"; # default + } log_timestamp(); system("mkdir $bench_tmpdir") if (! -d $bench_tmpdir); safe_cd("${test_dir}/mysql-test"); - check_system("./mysql-test-run --tmpdir=$bench_tmpdir --master_port=$mysql_tcp_port --slave_port=$slave_port --manager-port=$manager_port --no-manager --sleep=10", "tests were successful"); + check_system("./mysql-test-run $force --tmpdir=$bench_tmpdir --master_port=$mysql_tcp_port --slave_port=$slave_port --manager-port=$manager_port --no-manager --sleep=10", "tests were successful"); + # 'mysql-test-run' writes its own final message for log evaluation. } # @@ -535,7 +543,10 @@ Do not run any tests. Do not run the benchmark test (written in perl) --no-mysqltest -Do not run the the mysql-test-run test (Same as 'make test') +Do not run the mysql-test-run test (Same as 'make test') + +--one-error +Terminate the mysql-test-run test after the first difference (default: use '--force') --perl-files=list of files Compile and install the given perl modules. From 343b645ba2b038e8f545057672f3f22e0a9bcce8 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 24 Nov 2004 09:36:49 +0100 Subject: [PATCH 0317/1063] ndb - debug printout ndb/src/kernel/blocks/dblqh/DblqhMain.cpp: print state on rare crash --- ndb/src/kernel/blocks/dblqh/DblqhMain.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp b/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp index 5622706a96c..a40c7842fcd 100644 --- a/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp +++ b/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp @@ -3084,6 +3084,7 @@ void Dblqh::execATTRINFO(Signal* signal) return; break; default: + ndbout_c("%d", regTcPtr->transactionState); ndbrequire(false); break; }//switch From e26a5dbc6a4a9cd24f12d20bf08c3988ee5d0527 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 24 Nov 2004 09:39:05 +0100 Subject: [PATCH 0318/1063] ndb - Add testcase to autotest ndb/src/kernel/blocks/dblqh/DblqhMain.cpp: print on state on rare crash ndb/test/run-test/daily-basic-tests.txt: more test cases --- ndb/src/kernel/blocks/dblqh/DblqhMain.cpp | 1 + ndb/test/run-test/daily-basic-tests.txt | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp b/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp index fc0f39a4f5f..432bb1511aa 100644 --- a/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp +++ b/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp @@ -3084,6 +3084,7 @@ void Dblqh::execATTRINFO(Signal* signal) return; break; default: + ndbout_c("%d", regTcPtr->transactionState); ndbrequire(false); break; }//switch diff --git a/ndb/test/run-test/daily-basic-tests.txt b/ndb/test/run-test/daily-basic-tests.txt index 8d7e8a06c72..aa38fb4763c 100644 --- a/ndb/test/run-test/daily-basic-tests.txt +++ b/ndb/test/run-test/daily-basic-tests.txt @@ -222,6 +222,10 @@ max-time: 500 cmd: testScan args: -n ScanRead488 -l 10 T6 +max-time: 500 +cmd: testScan +args: -n ScanRead488Timeout -l 10 T6 + max-time: 600 cmd: testScan args: -n ScanRead40 -l 100 T2 From 135cdcef24a41e07495baae1b5e01f7ba897e031 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 24 Nov 2004 13:28:48 +0400 Subject: [PATCH 0319/1063] uca-dump.c: Use less wide spaces on the primary level, to avoid big diff for ctype-uca.c. strings/uca-dump.c: Use less wide spaces on the primary level, to avoid big diff for ctype-uca.c. --- strings/uca-dump.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/strings/uca-dump.c b/strings/uca-dump.c index db5cb7e999a..dd3b74a55e8 100644 --- a/strings/uca-dump.c +++ b/strings/uca-dump.c @@ -269,7 +269,7 @@ int main(int ac, char **av) */ int tmp= weight[i]; if (w == 2 && tmp) - tmp= (int)(0x100 - weight[i]); + tmp= (int)(0x20 - weight[i]); printf("0x%04X", tmp); @@ -304,7 +304,7 @@ int main(int ac, char **av) const char *comma= page < MY_UCA_NPAGES-1 ? "," : ""; const char *nline= (page+1) % 4 ? "" : "\n"; if (!pagemaxlen[page]) - printf("NULL %s%s", comma , nline); + printf("NULL %s%s%s", w ? " ": "", comma , nline); else printf("page%03Xdata%s%s%s", page, pname[w], comma, nline); } From 5909722f04b80ad9ac9eb0d44a723e2a75c9d860 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 24 Nov 2004 11:01:54 +0100 Subject: [PATCH 0320/1063] harmless "buffer overflow" fixed --- myisam/mi_test3.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/myisam/mi_test3.c b/myisam/mi_test3.c index dca04a9a64b..27d23317b5c 100644 --- a/myisam/mi_test3.c +++ b/myisam/mi_test3.c @@ -40,7 +40,7 @@ #endif -const char *filename= "test3.MSI"; +const char *filename= "test3"; uint tests=10,forks=10,key_cacheing=0,use_log=0; static void get_options(int argc, char *argv[]); @@ -363,7 +363,7 @@ int test_write(MI_INFO *file,int id,int lock_type) } sprintf(record.id,"%7d",getpid()); - strmov(record.text,"Testing..."); + strnmov(record.text,"Testing...", sizeof(record.text)); tries=(uint) rnd(100)+10; for (i=count=0 ; i < tries ; i++) From 1b9ea9b3c835cdfc3f473273f47cb30f72d21b1b Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 24 Nov 2004 11:03:54 +0100 Subject: [PATCH 0321/1063] ndb - 4.1.8 is not online software upgradable with 4.1.7 (due to close scan optimizations) ndb/src/common/util/version.c: 4.1.8 is not online software upgradable with 4.1.7 (due to close scan optimizations) --- ndb/src/common/util/version.c | 1 - 1 file changed, 1 deletion(-) diff --git a/ndb/src/common/util/version.c b/ndb/src/common/util/version.c index 82acd949c46..f2b3d5bd522 100644 --- a/ndb/src/common/util/version.c +++ b/ndb/src/common/util/version.c @@ -70,7 +70,6 @@ struct NdbUpGradeCompatible { #ifndef TEST_VERSION struct NdbUpGradeCompatible ndbCompatibleTable_full[] = { { MAKE_VERSION(3,5,2), MAKE_VERSION(3,5,1), UG_Exact }, - { MAKE_VERSION(4,1,8), MAKE_VERSION(3,5,4), UG_Exact }, /* Aligned version with MySQL */ { 0, 0, UG_Null } }; From 3a56452c77ac116082d7734fa6e7f7f9ccc4b557 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 24 Nov 2004 12:33:09 +0100 Subject: [PATCH 0322/1063] merge error --- client/Makefile.am | 1 - 1 file changed, 1 deletion(-) diff --git a/client/Makefile.am b/client/Makefile.am index 0b261b1b105..fa317367f71 100644 --- a/client/Makefile.am +++ b/client/Makefile.am @@ -26,7 +26,6 @@ bin_PROGRAMS = mysql mysqladmin mysqlcheck mysqlshow \ mysqldump mysqlimport mysqltest mysqlbinlog mysqlmanagerc mysqlmanager-pwgen noinst_HEADERS = sql_string.h completion_hash.h my_readline.h \ client_priv.h -mysqladmin_SOURCES = mysqladmin.cc mysql_SOURCES = mysql.cc readline.cc sql_string.cc completion_hash.cc mysqladmin_SOURCES = mysqladmin.cc mysql_LDADD = @readline_link@ @TERMCAP_LIB@ $(LDADD) $(CXXLDFLAGS) From 15edb7fc15fe78041409b3512f724913f57709d9 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 24 Nov 2004 13:59:03 +0000 Subject: [PATCH 0323/1063] added mgmapi/mgmapi_config_parameters.h, mgmapi/mgmapi_config_parameters_debug.h to distribution --- ndb/include/Makefile.am | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ndb/include/Makefile.am b/ndb/include/Makefile.am index 7b3f80b5560..61f55cf9d61 100644 --- a/ndb/include/Makefile.am +++ b/ndb/include/Makefile.am @@ -29,13 +29,13 @@ ndbapi/ndberror.h mgmapiinclude_HEADERS = \ mgmapi/mgmapi.h \ -mgmapi/mgmapi_debug.h +mgmapi/mgmapi_debug.h \ +mgmapi/mgmapi_config_parameters.h \ +mgmapi/mgmapi_config_parameters_debug.h noinst_HEADERS = \ ndb_global.h \ -ndb_net.h \ -mgmapi/mgmapi_config_parameters.h \ -mgmapi/mgmapi_config_parameters_debug.h +ndb_net.h EXTRA_DIST = debugger editline kernel logger mgmcommon \ portlib transporter util From 55ea7c8b0eb65d7834995774b1607011c0fd65f1 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 24 Nov 2004 15:24:23 +0100 Subject: [PATCH 0324/1063] Ensure consistent sources up to 5.0 where a C++ problem occurs. client/mysqladmin.c: Cast to overcome a C vs. C++ signature problem, occurring in 5.0 where this is a C++ file. --- client/mysqladmin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/mysqladmin.c b/client/mysqladmin.c index 153fcdde96d..978e0c7e88b 100644 --- a/client/mysqladmin.c +++ b/client/mysqladmin.c @@ -554,7 +554,7 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv) { char *pos,buff[40]; ulong sec; - pos=strchr(status,' '); + pos= (char*) strchr(status,' '); *pos++=0; printf("%s\t\t\t",status); /* print label */ if ((status=str2int(pos,10,0,LONG_MAX,(long*) &sec))) From 98de7e010f6f3dda87a07b680a28beffbe75872f Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 24 Nov 2004 16:36:18 +0100 Subject: [PATCH 0325/1063] bug#6775 - ndb Queue scan on real fragment. Index fragment for range scans Table fragment for table scans ndb/src/kernel/blocks/dblqh/Dblqh.hpp: Document meaning of fragPtrI and how it differs from scanTcRec->fragmentptr ndb/src/kernel/blocks/dblqh/DblqhMain.cpp: Queue scan on real fragment. Index fragment for range scans Table fragment for table scans ndb/src/ndbapi/NdbConnection.cpp: Check tOp before assigning --- ndb/src/kernel/blocks/dblqh/Dblqh.hpp | 5 +++ ndb/src/kernel/blocks/dblqh/DblqhMain.cpp | 41 ++++++++++++----------- ndb/src/ndbapi/NdbConnection.cpp | 7 ++-- 3 files changed, 31 insertions(+), 22 deletions(-) diff --git a/ndb/src/kernel/blocks/dblqh/Dblqh.hpp b/ndb/src/kernel/blocks/dblqh/Dblqh.hpp index 6c8c2bb2dae..0c63cb5fe17 100644 --- a/ndb/src/kernel/blocks/dblqh/Dblqh.hpp +++ b/ndb/src/kernel/blocks/dblqh/Dblqh.hpp @@ -550,6 +550,11 @@ public: UintR scanErrorCounter; UintR scanLocalFragid; UintR scanSchemaVersion; + + /** + * This is _always_ main table, even in range scan + * in which case scanTcrec->fragmentptr is different + */ Uint32 fragPtrI; UintR scanStoredProcId; ScanState scanState; diff --git a/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp b/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp index 432bb1511aa..88e8f25b004 100644 --- a/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp +++ b/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp @@ -7703,6 +7703,9 @@ void Dblqh::abort_scan(Signal* signal, Uint32 scan_ptr_i, Uint32 errcode){ jam(); scanptr.i = scan_ptr_i; c_scanRecordPool.getPtr(scanptr); + + fragptr.i = tcConnectptr.p->fragmentptr; + ptrCheckGuard(fragptr, cfragrecFileSize, fragrecord); finishScanrec(signal); releaseScanrec(signal); tcConnectptr.p->transactionState = TcConnectionrec::IDLE; @@ -8570,10 +8573,12 @@ Uint32 Dblqh::initScanrec(const ScanFragReq* scanFragReq) /** * Used for scan take over */ - FragrecordPtr tFragPtr; - tFragPtr.i = fragptr.p->tableFragptr; - ptrCheckGuard(tFragPtr, cfragrecFileSize, fragrecord); - scanptr.p->fragPtrI = fragptr.p->tableFragptr; + { + FragrecordPtr tFragPtr; + tFragPtr.i = fragptr.p->tableFragptr; + ptrCheckGuard(tFragPtr, cfragrecFileSize, fragrecord); + scanptr.p->fragPtrI = fragptr.p->tableFragptr; + } /** * !idx uses 1 - (MAX_PARALLEL_SCANS_PER_FRAG - 1) = 1-11 @@ -8582,8 +8587,8 @@ Uint32 Dblqh::initScanrec(const ScanFragReq* scanFragReq) Uint32 start = (idx ? MAX_PARALLEL_SCANS_PER_FRAG : 1 ); Uint32 stop = (idx ? MAX_PARALLEL_INDEX_SCANS_PER_FRAG : MAX_PARALLEL_SCANS_PER_FRAG - 1); stop += start; - Uint32 free = tFragPtr.p->m_scanNumberMask.find(start); - + Uint32 free = fragptr.p->m_scanNumberMask.find(start); + if(free == Fragrecord::ScanNumberMask::NotFound || free >= stop){ jam(); @@ -8597,16 +8602,16 @@ Uint32 Dblqh::initScanrec(const ScanFragReq* scanFragReq) */ scanptr.p->scanState = ScanRecord::IN_QUEUE; LocalDLFifoList queue(c_scanRecordPool, - tFragPtr.p->m_queuedScans); + fragptr.p->m_queuedScans); queue.add(scanptr); return ZOK; } - + scanptr.p->scanNumber = free; - tFragPtr.p->m_scanNumberMask.clear(free);// Update mask + fragptr.p->m_scanNumberMask.clear(free);// Update mask - LocalDLList active(c_scanRecordPool, tFragPtr.p->m_activeScans); + LocalDLList active(c_scanRecordPool, fragptr.p->m_activeScans); active.add(scanptr); if(scanptr.p->scanKeyinfoFlag){ jam(); @@ -8666,12 +8671,8 @@ void Dblqh::finishScanrec(Signal* signal) { release_acc_ptr_list(scanptr.p); - FragrecordPtr tFragPtr; - tFragPtr.i = scanptr.p->fragPtrI; - ptrCheckGuard(tFragPtr, cfragrecFileSize, fragrecord); - LocalDLFifoList queue(c_scanRecordPool, - tFragPtr.p->m_queuedScans); + fragptr.p->m_queuedScans); if(scanptr.p->scanState == ScanRecord::IN_QUEUE){ jam(); @@ -8689,11 +8690,11 @@ void Dblqh::finishScanrec(Signal* signal) ndbrequire(tmp.p == scanptr.p); } - LocalDLList scans(c_scanRecordPool, tFragPtr.p->m_activeScans); + LocalDLList scans(c_scanRecordPool, fragptr.p->m_activeScans); scans.release(scanptr); const Uint32 scanNumber = scanptr.p->scanNumber; - ndbrequire(!tFragPtr.p->m_scanNumberMask.get(scanNumber)); + ndbrequire(!fragptr.p->m_scanNumberMask.get(scanNumber)); ScanRecordPtr restart; /** @@ -8701,13 +8702,13 @@ void Dblqh::finishScanrec(Signal* signal) */ if(scanNumber == NR_ScanNo || !queue.first(restart)){ jam(); - tFragPtr.p->m_scanNumberMask.set(scanNumber); + fragptr.p->m_scanNumberMask.set(scanNumber); return; } if(ERROR_INSERTED(5034)){ jam(); - tFragPtr.p->m_scanNumberMask.set(scanNumber); + fragptr.p->m_scanNumberMask.set(scanNumber); return; } @@ -8718,7 +8719,7 @@ void Dblqh::finishScanrec(Signal* signal) ptrCheckGuard(tcConnectptr, ctcConnectrecFileSize, tcConnectionrec); restart.p->scanNumber = scanNumber; restart.p->scanState = ScanRecord::WAIT_ACC_SCAN; - + queue.remove(restart); scans.add(restart); if(restart.p->scanKeyinfoFlag){ diff --git a/ndb/src/ndbapi/NdbConnection.cpp b/ndb/src/ndbapi/NdbConnection.cpp index 6284ae8ce6e..f3ddc68245a 100644 --- a/ndb/src/ndbapi/NdbConnection.cpp +++ b/ndb/src/ndbapi/NdbConnection.cpp @@ -1086,8 +1086,11 @@ NdbConnection::getNdbIndexScanOperation(const NdbIndexImpl* index, if (indexTable != 0){ NdbIndexScanOperation* tOp = getNdbScanOperation((NdbTableImpl *) indexTable); - tOp->m_currentTable = table; - if(tOp) tOp->m_cursor_type = NdbScanOperation::IndexCursor; + if(tOp) + { + tOp->m_currentTable = table; + tOp->m_cursor_type = NdbScanOperation::IndexCursor; + } return tOp; } else { setOperationErrorCodeAbort(theNdb->theError.code); From 61dbdff2a6f80e15721e245d168f5f276d78b0b5 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 24 Nov 2004 15:51:59 +0000 Subject: [PATCH 0326/1063] calculation of noOfTriggers --- ndb/src/kernel/vm/Configuration.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/ndb/src/kernel/vm/Configuration.cpp b/ndb/src/kernel/vm/Configuration.cpp index 31853b7a3b7..92b09891a2f 100644 --- a/ndb/src/kernel/vm/Configuration.cpp +++ b/ndb/src/kernel/vm/Configuration.cpp @@ -34,6 +34,7 @@ #include #include +#include #include "pc.hpp" #include #include @@ -454,6 +455,7 @@ Configuration::calcSizeAlt(ConfigValues * ownConfig){ unsigned int noOfTables = 0; unsigned int noOfUniqueHashIndexes = 0; unsigned int noOfOrderedIndexes = 0; + unsigned int noOfTriggers = 0; unsigned int noOfReplicas = 0; unsigned int noOfDBNodes = 0; unsigned int noOfAPINodes = 0; @@ -478,6 +480,7 @@ Configuration::calcSizeAlt(ConfigValues * ownConfig){ { CFG_DB_NO_TABLES, &noOfTables, false }, { CFG_DB_NO_ORDERED_INDEXES, &noOfOrderedIndexes, false }, { CFG_DB_NO_UNIQUE_HASH_INDEXES, &noOfUniqueHashIndexes, false }, + { CFG_DB_NO_TRIGGERS, &noOfTriggers, true }, { CFG_DB_NO_REPLICAS, &noOfReplicas, false }, { CFG_DB_NO_ATTRIBUTES, &noOfAttributes, false }, { CFG_DB_NO_OPS, &noOfOperations, false }, @@ -586,6 +589,16 @@ Configuration::calcSizeAlt(ConfigValues * ownConfig){ ConfigValues::Iterator it2(*ownConfig, db.m_config); it2.set(CFG_DB_NO_TABLES, noOfTables); it2.set(CFG_DB_NO_ATTRIBUTES, noOfAttributes); + { + Uint32 neededNoOfTriggers = + 3 * (noOfUniqueHashIndexes + NDB_MAX_ACTIVE_EVENTS)+ + noOfOrderedIndexes; + if (noOfTriggers < neededNoOfTriggers) + { + noOfTriggers= neededNoOfTriggers; + it2.set(CFG_DB_NO_TRIGGERS, noOfTriggers); + } + } /** * Do size calculations From f4db89ea85fdadbf32d4c24eb8c7b92fd84c0bc0 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 24 Nov 2004 16:04:11 +0000 Subject: [PATCH 0327/1063] also backup needs triggers --- ndb/src/kernel/vm/Configuration.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ndb/src/kernel/vm/Configuration.cpp b/ndb/src/kernel/vm/Configuration.cpp index 92b09891a2f..931b4da5a17 100644 --- a/ndb/src/kernel/vm/Configuration.cpp +++ b/ndb/src/kernel/vm/Configuration.cpp @@ -590,9 +590,11 @@ Configuration::calcSizeAlt(ConfigValues * ownConfig){ it2.set(CFG_DB_NO_TABLES, noOfTables); it2.set(CFG_DB_NO_ATTRIBUTES, noOfAttributes); { - Uint32 neededNoOfTriggers = - 3 * (noOfUniqueHashIndexes + NDB_MAX_ACTIVE_EVENTS)+ - noOfOrderedIndexes; + Uint32 neededNoOfTriggers = /* types: Insert/Update/Delete/Custom */ + 3 * noOfUniqueHashIndexes + /* for unique hash indexes, I/U/D */ + 3 * NDB_MAX_ACTIVE_EVENTS + /* for events in suma, I/U/D */ + 3 * noOfTables + /* for backup, I/U/D */ + noOfOrderedIndexes; /* for ordered indexes, C */ if (noOfTriggers < neededNoOfTriggers) { noOfTriggers= neededNoOfTriggers; From 03cba628f6fdfaf66d4d737a87086aa360c6edf5 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 24 Nov 2004 20:09:54 +0400 Subject: [PATCH 0328/1063] Bug#6787 LIKE not working properly with _ and utf8 data --- mysql-test/r/ctype_uca.result | 3 +++ mysql-test/r/ctype_utf8.result | 3 +++ mysql-test/t/ctype_uca.test | 5 +++++ mysql-test/t/ctype_utf8.test | 6 ++++++ strings/ctype-uca.c | 4 +++- strings/ctype-utf8.c | 26 ++++++++++++++------------ 6 files changed, 34 insertions(+), 13 deletions(-) diff --git a/mysql-test/r/ctype_uca.result b/mysql-test/r/ctype_uca.result index 7620b18eea6..cb060ad7ee4 100644 --- a/mysql-test/r/ctype_uca.result +++ b/mysql-test/r/ctype_uca.result @@ -19,6 +19,9 @@ select 'a ' = 'a\t', 'a ' < 'a\t', 'a ' > 'a\t'; select 'a a' > 'a', 'a \t' < 'a'; 'a a' > 'a' 'a \t' < 'a' 1 1 +select 'c' like '\_' as want0; +want0 +0 CREATE TABLE t ( c char(20) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result index 945ec8eae99..599d49208e7 100644 --- a/mysql-test/r/ctype_utf8.result +++ b/mysql-test/r/ctype_utf8.result @@ -814,3 +814,6 @@ t2 CREATE TABLE `t2` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t2; drop table t1; +select 'c' like '\_' as want0; +want0 +0 diff --git a/mysql-test/t/ctype_uca.test b/mysql-test/t/ctype_uca.test index e640e6b53dc..11833ba9bc7 100644 --- a/mysql-test/t/ctype_uca.test +++ b/mysql-test/t/ctype_uca.test @@ -24,6 +24,11 @@ select 'a ' = 'a\t', 'a ' < 'a\t', 'a ' > 'a\t'; select 'a a' > 'a', 'a \t' < 'a'; +# +# Bug #6787 LIKE not working properly with _ and utf8 data +# +select 'c' like '\_' as want0; + # # Bug #5679 utf8_unicode_ci LIKE--trailing % doesn't equal zero characters # diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test index c75b1dee63c..42031be8f3c 100644 --- a/mysql-test/t/ctype_utf8.test +++ b/mysql-test/t/ctype_utf8.test @@ -660,3 +660,9 @@ create table t2 select concat(a,_utf8'') as a, concat(b,_utf8'')as b from t1; show create table t2; drop table t2; drop table t1; + +# +# Bug #6787 LIKE not working properly with _ and utf8 data +# +select 'c' like '\_' as want0; + diff --git a/strings/ctype-uca.c b/strings/ctype-uca.c index 8df5b3277c1..89c876ad10c 100644 --- a/strings/ctype-uca.c +++ b/strings/ctype-uca.c @@ -7288,6 +7288,7 @@ int my_wildcmp_uca(CHARSET_INFO *cs, { while (1) { + my_bool escaped= 0; if ((scan= mb_wc(cs, &w_wc, (const uchar*)wildstr, (const uchar*)wildend)) <= 0) return 1; @@ -7305,6 +7306,7 @@ int my_wildcmp_uca(CHARSET_INFO *cs, (const uchar*)wildend)) <= 0) return 1; wildstr+= scan; + escaped= 1; } if ((scan= mb_wc(cs, &s_wc, (const uchar*)str, @@ -7312,7 +7314,7 @@ int my_wildcmp_uca(CHARSET_INFO *cs, return 1; str+= scan; - if (w_wc == (my_wc_t)w_one) + if (!escaped && w_wc == (my_wc_t)w_one) { result= 1; /* Found an anchor char */ } diff --git a/strings/ctype-utf8.c b/strings/ctype-utf8.c index b3097649158..ce9346eb475 100644 --- a/strings/ctype-utf8.c +++ b/strings/ctype-utf8.c @@ -1545,31 +1545,33 @@ int my_wildcmp_unicode(CHARSET_INFO *cs, { while (1) { + my_bool escaped= 0; if ((scan= mb_wc(cs, &w_wc, (const uchar*)wildstr, (const uchar*)wildend)) <= 0) return 1; - - if (w_wc == (my_wc_t)escape) - { - wildstr+= scan; - if ((scan= mb_wc(cs,&w_wc, (const uchar*)wildstr, - (const uchar*)wildend)) <= 0) - return 1; - } - + if (w_wc == (my_wc_t)w_many) { result= 1; /* Found an anchor char */ break; } - + wildstr+= scan; + if (w_wc == (my_wc_t)escape) + { + if ((scan= mb_wc(cs, &w_wc, (const uchar*)wildstr, + (const uchar*)wildend)) <= 0) + return 1; + wildstr+= scan; + escaped= 1; + } + if ((scan= mb_wc(cs, &s_wc, (const uchar*)str, - (const uchar*)str_end)) <=0) + (const uchar*)str_end)) <= 0) return 1; str+= scan; - if (w_wc == (my_wc_t)w_one) + if (!escaped && w_wc == (my_wc_t)w_one) { result= 1; /* Found an anchor char */ } From 2f36bf74186fcb0129f576b01f3753ae0fa10d31 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 24 Nov 2004 17:40:40 +0000 Subject: [PATCH 0329/1063] added explanation of error code 4335 --- ndb/src/ndbapi/ndberror.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ndb/src/ndbapi/ndberror.c b/ndb/src/ndbapi/ndberror.c index e08b80f2433..bc49358cc63 100644 --- a/ndb/src/ndbapi/ndberror.c +++ b/ndb/src/ndbapi/ndberror.c @@ -426,7 +426,8 @@ ErrorBundle ErrorCodes[] = { { 4267, IE, "Corrupted blob value" }, { 4268, IE, "Error in blob head update forced rollback of transaction" }, { 4268, IE, "Unknown blob error" }, - { 4269, IE, "No connection to ndb management server" } + { 4269, IE, "No connection to ndb management server" }, + { 4335, AE, "Only one autoincrement column allowed per table. Having a table without primary key uses an autoincremented hidden key, i.e. a table without a primary key can not have an autoincremented column" } }; static From c3272ae7186bb59a406a671080b98766dc8e4064 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 24 Nov 2004 19:41:38 +0200 Subject: [PATCH 0330/1063] configure.in: Fix linking error in 5.0: the build system for Linux/S390 does not have inlining working in the compiler; remove inlining on that system innobase/configure.in: Fix linking error in 5.0: the build system for Linux/S390 does not have inlining working in the compiler; remove inlining on that system --- innobase/configure.in | 3 +++ 1 file changed, 3 insertions(+) diff --git a/innobase/configure.in b/innobase/configure.in index 652291f1f38..d83da9fdc5c 100644 --- a/innobase/configure.in +++ b/innobase/configure.in @@ -110,6 +110,9 @@ esac case "$target" in i[[4567]]86-*-*) CFLAGS="$CFLAGS -DUNIV_INTEL_X86";; + # The compiler on Linux/S390 does not seem to have inlining + s390-*-*) + CFLAGS="$CFLAGS -DUNIV_MUST_NOT_INLINE";; esac AC_OUTPUT(Makefile os/Makefile ut/Makefile btr/Makefile dnl From 6429a0c59897e94e7d467209bd5bd903fd3a5b9a Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 24 Nov 2004 23:16:16 +0100 Subject: [PATCH 0331/1063] bug#6784 mi_flush_bulk_insert (on dup key error in mi_write) was mangling info->dupp_key_pos --- myisam/mi_write.c | 16 ++++++---------- mysql-test/r/fulltext.result | 6 ++++++ mysql-test/t/fulltext.test | 13 +++++++++++++ 3 files changed, 25 insertions(+), 10 deletions(-) diff --git a/myisam/mi_write.c b/myisam/mi_write.c index e059bbb569f..303e924118f 100644 --- a/myisam/mi_write.c +++ b/myisam/mi_write.c @@ -165,12 +165,7 @@ err: { uint j; for (j=0 ; j < share->base.keys ; j++) - { - if (is_tree_inited(&info->bulk_insert[j])) - { - reset_tree(&info->bulk_insert[j]); - } - } + mi_flush_bulk_insert(info, j); } info->errkey= (int) i; while ( i-- > 0) @@ -329,7 +324,7 @@ static int w_search(register MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *temp_buff,*keypos; uchar keybuff[MI_MAX_KEY_BUFF]; my_bool was_last_key; - my_off_t next_page; + my_off_t next_page, dupp_key_pos; DBUG_ENTER("w_search"); DBUG_PRINT("enter",("page: %ld",page)); @@ -349,9 +344,9 @@ static int w_search(register MI_INFO *info, register MI_KEYDEF *keyinfo, /* get position to record with duplicated key */ tmp_key_length=(*keyinfo->get_key)(keyinfo,nod_flag,&keypos,keybuff); if (tmp_key_length) - info->dupp_key_pos=_mi_dpos(info,0,keybuff+tmp_key_length); + dupp_key_pos=_mi_dpos(info,0,keybuff+tmp_key_length); else - info->dupp_key_pos= HA_OFFSET_ERROR; + dupp_key_pos= HA_OFFSET_ERROR; if (keyinfo->flag & HA_FULLTEXT) { uint off; @@ -370,7 +365,7 @@ static int w_search(register MI_INFO *info, register MI_KEYDEF *keyinfo, else { /* popular word. two-level tree. going down */ - my_off_t root=info->dupp_key_pos; + my_off_t root=dupp_key_pos; keyinfo=&info->s->ft2_keyinfo; get_key_full_length_rdonly(off, key); key+=off; @@ -389,6 +384,7 @@ static int w_search(register MI_INFO *info, register MI_KEYDEF *keyinfo, } else /* not HA_FULLTEXT, normal HA_NOSAME key */ { + info->dupp_key_pos= dupp_key_pos; my_afree((byte*) temp_buff); my_errno=HA_ERR_FOUND_DUPP_KEY; DBUG_RETURN(-1); diff --git a/mysql-test/r/fulltext.result b/mysql-test/r/fulltext.result index cff43a821b3..7acc8a2d23f 100644 --- a/mysql-test/r/fulltext.result +++ b/mysql-test/r/fulltext.result @@ -399,3 +399,9 @@ select count(*) from t1; count(*) 1 drop table t1; +create table t1 (a int primary key, b text, fulltext(b)); +create table t2 (a int, b text); +insert t1 values (1, "aaaa"), (2, "bbbb"); +insert t2 values (10, "aaaa"), (2, "cccc"); +replace t1 select * from t2; +drop table t1, t2; diff --git a/mysql-test/t/fulltext.test b/mysql-test/t/fulltext.test index 41fbf3f27ac..008e965297f 100644 --- a/mysql-test/t/fulltext.test +++ b/mysql-test/t/fulltext.test @@ -308,3 +308,16 @@ REPAIR TABLE t1; select count(*) from t1; drop table t1; +# +# bug#6784 +# mi_flush_bulk_insert (on dup key error in mi_write) +# was mangling info->dupp_key_pos +# + +create table t1 (a int primary key, b text, fulltext(b)); +create table t2 (a int, b text); +insert t1 values (1, "aaaa"), (2, "bbbb"); +insert t2 values (10, "aaaa"), (2, "cccc"); +replace t1 select * from t2; +drop table t1, t2; + From 6f2cf12aa63a3b88ebf363576550ec5ae4954978 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 25 Nov 2004 09:26:45 +0100 Subject: [PATCH 0332/1063] Fix for Bug#6148. Only rewind read position in binary log when the slave SQL thread is started. sql/slave.cc: Adding threads to init as parameter to init_master_info. Only rewind read position when starting SQL thread. sql/slave.h: Adding threads to init as parameter to init_master_info. Only rewind read position when starting SQL thread. sql/sql_repl.cc: Adding threads to init as parameter to init_master_info. Only rewind read position when starting SQL thread. sql/repl_failsafe.cc: Adding threads to init as parameter to init_master_info. Only rewind read position when starting SQL thread. --- mysql-test/r/rpl_start_stop_slave.result | 12 +++++++++ mysql-test/t/rpl_start_stop_slave.test | 34 ++++++++++++++++++++++++ sql/repl_failsafe.cc | 3 ++- sql/slave.cc | 14 +++++++--- sql/slave.h | 3 ++- sql/sql_repl.cc | 6 +++-- 6 files changed, 65 insertions(+), 7 deletions(-) create mode 100644 mysql-test/r/rpl_start_stop_slave.result create mode 100644 mysql-test/t/rpl_start_stop_slave.test diff --git a/mysql-test/r/rpl_start_stop_slave.result b/mysql-test/r/rpl_start_stop_slave.result new file mode 100644 index 00000000000..1b4d87124d1 --- /dev/null +++ b/mysql-test/r/rpl_start_stop_slave.result @@ -0,0 +1,12 @@ +slave stop; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +slave start; +stop slave; +create table t1(n int); +start slave; +stop slave io_thread; +start slave io_thread; +drop table t1; diff --git a/mysql-test/t/rpl_start_stop_slave.test b/mysql-test/t/rpl_start_stop_slave.test new file mode 100644 index 00000000000..903ff204194 --- /dev/null +++ b/mysql-test/t/rpl_start_stop_slave.test @@ -0,0 +1,34 @@ +source include/master-slave.inc; + +# +# Bug#6148 () +# +connection slave; +stop slave; + +# Let the master do lots of insertions +connection master; +create table t1(n int); +let $1=5000; +disable_query_log; +while ($1) +{ + eval insert into t1 values($1); + dec $1; +} +enable_query_log; +save_master_pos; + +connection slave; +start slave; +sleep 1; +stop slave io_thread; +start slave io_thread; +sync_with_master; + +connection master; +drop table t1; +save_master_pos; + +connection slave; +sync_with_master; diff --git a/sql/repl_failsafe.cc b/sql/repl_failsafe.cc index 9fa6ea843f1..84640fbc968 100644 --- a/sql/repl_failsafe.cc +++ b/sql/repl_failsafe.cc @@ -892,7 +892,8 @@ int load_master_data(THD* thd) setting active_mi, because init_master_info() sets active_mi with defaults. */ - if (init_master_info(active_mi, master_info_file, relay_log_info_file, 0)) + if (init_master_info(active_mi, master_info_file, relay_log_info_file, + 0, (SLAVE_IO | SLAVE_SQL))) send_error(&thd->net, ER_MASTER_INFO); strmake(active_mi->master_log_name, row[0], sizeof(active_mi->master_log_name)); diff --git a/sql/slave.cc b/sql/slave.cc index 18e0ec5929f..7e544572755 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -137,7 +137,7 @@ int init_slave() } if (init_master_info(active_mi,master_info_file,relay_log_info_file, - !master_host)) + !master_host, (SLAVE_IO | SLAVE_SQL))) { sql_print_error("Failed to initialize the master info structure"); goto err; @@ -1616,7 +1616,8 @@ void clear_last_slave_error(RELAY_LOG_INFO* rli) int init_master_info(MASTER_INFO* mi, const char* master_info_fname, const char* slave_info_fname, - bool abort_if_no_master_info_file) + bool abort_if_no_master_info_file, + int thread_mask) { int fd,error; char fname[FN_REFLEN+128]; @@ -1630,8 +1631,15 @@ int init_master_info(MASTER_INFO* mi, const char* master_info_fname, last time. If this case pos_in_file would be set and we would get a crash when trying to read the signature for the binary relay log. + + We only rewind the read position if we are starting the SQL + thread. The handle_slave_sql thread assumes that the read + position is at the beginning of the file, and will read the + "signature" and then fast-forward to the last position read. */ - my_b_seek(mi->rli.cur_log, (my_off_t) 0); + if (thread_mask & SLAVE_SQL) { + my_b_seek(mi->rli.cur_log, (my_off_t) 0); + } DBUG_RETURN(0); } diff --git a/sql/slave.h b/sql/slave.h index eb54e258a96..a01ff93b4af 100644 --- a/sql/slave.h +++ b/sql/slave.h @@ -411,7 +411,8 @@ void init_master_info_with_options(MASTER_INFO* mi); void clear_last_slave_error(RELAY_LOG_INFO* rli); int init_master_info(MASTER_INFO* mi, const char* master_info_fname, const char* slave_info_fname, - bool abort_if_no_master_info_file); + bool abort_if_no_master_info_file, + int thread_mask); void end_master_info(MASTER_INFO* mi); int init_relay_log_info(RELAY_LOG_INFO* rli, const char* info_fname); void end_relay_log_info(RELAY_LOG_INFO* rli); diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc index 514fed226d2..9485031c144 100644 --- a/sql/sql_repl.cc +++ b/sql/sql_repl.cc @@ -662,7 +662,8 @@ int start_slave(THD* thd , MASTER_INFO* mi, bool net_report) thread_mask &= thd->lex.slave_thd_opt; if (thread_mask) { - if (init_master_info(mi,master_info_file,relay_log_info_file, 0)) + if (init_master_info(mi,master_info_file,relay_log_info_file, 0, + thread_mask)) slave_errno=ER_MASTER_INFO; else if (server_id_supplied && *mi->host) slave_errno = start_slave_threads(0 /*no mutex */, @@ -867,7 +868,8 @@ int change_master(THD* thd, MASTER_INFO* mi) thd->proc_info = "Changing master"; LEX_MASTER_INFO* lex_mi = &thd->lex.mi; // TODO: see if needs re-write - if (init_master_info(mi, master_info_file, relay_log_info_file, 0)) + if (init_master_info(mi, master_info_file, relay_log_info_file, 0, + thread_mask)) { send_error(&thd->net, ER_MASTER_INFO); unlock_slave_threads(mi); From 5aaffe9b3cb36846b77d81a51814dd1c334d724c Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 25 Nov 2004 10:38:46 +0100 Subject: [PATCH 0333/1063] bug#6775 - ndb - fix bug introduced by bug fix ndb/src/kernel/blocks/dblqh/DblqhMain.cpp: Scan number allocation must be on table even in case of range scan Otherwise scan takeover won't work as LQHKEYREQ contains table --- ndb/src/kernel/blocks/dblqh/DblqhMain.cpp | 33 ++++++++++++----------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp b/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp index 88e8f25b004..c106a6ddfac 100644 --- a/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp +++ b/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp @@ -8573,13 +8573,11 @@ Uint32 Dblqh::initScanrec(const ScanFragReq* scanFragReq) /** * Used for scan take over */ - { - FragrecordPtr tFragPtr; - tFragPtr.i = fragptr.p->tableFragptr; - ptrCheckGuard(tFragPtr, cfragrecFileSize, fragrecord); - scanptr.p->fragPtrI = fragptr.p->tableFragptr; - } - + FragrecordPtr tFragPtr; + tFragPtr.i = fragptr.p->tableFragptr; + ptrCheckGuard(tFragPtr, cfragrecFileSize, fragrecord); + scanptr.p->fragPtrI = fragptr.p->tableFragptr; + /** * !idx uses 1 - (MAX_PARALLEL_SCANS_PER_FRAG - 1) = 1-11 * idx uses from MAX_PARALLEL_SCANS_PER_FRAG - MAX = 12-42) @@ -8587,11 +8585,11 @@ Uint32 Dblqh::initScanrec(const ScanFragReq* scanFragReq) Uint32 start = (idx ? MAX_PARALLEL_SCANS_PER_FRAG : 1 ); Uint32 stop = (idx ? MAX_PARALLEL_INDEX_SCANS_PER_FRAG : MAX_PARALLEL_SCANS_PER_FRAG - 1); stop += start; - Uint32 free = fragptr.p->m_scanNumberMask.find(start); - + Uint32 free = tFragPtr.p->m_scanNumberMask.find(start); + if(free == Fragrecord::ScanNumberMask::NotFound || free >= stop){ jam(); - + if(scanPrio == 0){ jam(); return ScanFragRef::ZTOO_MANY_ACTIVE_SCAN_ERROR; @@ -8607,10 +8605,9 @@ Uint32 Dblqh::initScanrec(const ScanFragReq* scanFragReq) return ZOK; } - scanptr.p->scanNumber = free; - fragptr.p->m_scanNumberMask.clear(free);// Update mask - + tFragPtr.p->m_scanNumberMask.clear(free);// Update mask + LocalDLList active(c_scanRecordPool, fragptr.p->m_activeScans); active.add(scanptr); if(scanptr.p->scanKeyinfoFlag){ @@ -8693,8 +8690,12 @@ void Dblqh::finishScanrec(Signal* signal) LocalDLList scans(c_scanRecordPool, fragptr.p->m_activeScans); scans.release(scanptr); + FragrecordPtr tFragPtr; + tFragPtr.i = scanptr.p->fragPtrI; + ptrCheckGuard(tFragPtr, cfragrecFileSize, fragrecord); + const Uint32 scanNumber = scanptr.p->scanNumber; - ndbrequire(!fragptr.p->m_scanNumberMask.get(scanNumber)); + ndbrequire(!tFragPtr.p->m_scanNumberMask.get(scanNumber)); ScanRecordPtr restart; /** @@ -8702,13 +8703,13 @@ void Dblqh::finishScanrec(Signal* signal) */ if(scanNumber == NR_ScanNo || !queue.first(restart)){ jam(); - fragptr.p->m_scanNumberMask.set(scanNumber); + tFragPtr.p->m_scanNumberMask.set(scanNumber); return; } if(ERROR_INSERTED(5034)){ jam(); - fragptr.p->m_scanNumberMask.set(scanNumber); + tFragPtr.p->m_scanNumberMask.set(scanNumber); return; } From 45f941cb5c05077900c4842627b3d579d5d009b4 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 25 Nov 2004 12:14:15 +0000 Subject: [PATCH 0334/1063] ndb/src/common/logger/LogHandler.cpp changed so that error is returned if format is wrong in logger param parsing ndb/src/common/logger/Logger.cpp some debuf printout added ndb/src/mgmsrv/InitConfigFileParser.cpp rewrote parsing on parseNameValuePair, was buggy ndb/src/common/logger/LogHandler.cpp: changed so that error is returned if format is wrong in logger param parsing ndb/src/common/logger/Logger.cpp: some debuf printout added ndb/src/mgmsrv/InitConfigFileParser.cpp: rewrote parsing on parseNameValuePair, was buggy --- ndb/src/common/logger/LogHandler.cpp | 7 ++- ndb/src/common/logger/Logger.cpp | 9 ++-- ndb/src/mgmsrv/InitConfigFileParser.cpp | 68 +++++++++---------------- 3 files changed, 33 insertions(+), 51 deletions(-) diff --git a/ndb/src/common/logger/LogHandler.cpp b/ndb/src/common/logger/LogHandler.cpp index 4fab957fc50..a76cb622878 100644 --- a/ndb/src/common/logger/LogHandler.cpp +++ b/ndb/src/common/logger/LogHandler.cpp @@ -117,10 +117,9 @@ LogHandler::parseParams(const BaseString &_params) { _params.split(v_args, ","); for(size_t i=0; i < v_args.size(); i++) { Vector v_param_value; - - v_args[i].split(v_param_value, "=", 2); - if(v_param_value.size() == 2 && - !setParam(v_param_value[0], v_param_value[1])) + if(v_args[i].split(v_param_value, "=", 2) != 2) + ret = false; + else if (!setParam(v_param_value[0], v_param_value[1])) ret = false; } diff --git a/ndb/src/common/logger/Logger.cpp b/ndb/src/common/logger/Logger.cpp index 00a2fae67bc..1dc3bd43716 100644 --- a/ndb/src/common/logger/Logger.cpp +++ b/ndb/src/common/logger/Logger.cpp @@ -169,10 +169,13 @@ Logger::addHandler(const BaseString &logstring) { size_t i; Vector logdest; Vectorloghandlers; + DBUG_ENTER("Logger::addHandler"); logstring.split(logdest, ";"); for(i = 0; i < logdest.size(); i++) { + DBUG_PRINT("info",("adding: %s",logdest[i])); + Vector v_type_args; logdest[i].split(v_type_args, ":", 2); @@ -191,16 +194,16 @@ Logger::addHandler(const BaseString &logstring) { handler = new ConsoleLogHandler(); if(handler == NULL) - return false; + DBUG_RETURN(false); if(!handler->parseParams(params)) - return false; + DBUG_RETURN(false); loghandlers.push_back(handler); } for(i = 0; i < loghandlers.size(); i++) addHandler(loghandlers[i]); - return true; /* @todo handle errors */ + DBUG_RETURN(true); /* @todo handle errors */ } bool diff --git a/ndb/src/mgmsrv/InitConfigFileParser.cpp b/ndb/src/mgmsrv/InitConfigFileParser.cpp index fdfe7823fc2..05102255eaa 100644 --- a/ndb/src/mgmsrv/InitConfigFileParser.cpp +++ b/ndb/src/mgmsrv/InitConfigFileParser.cpp @@ -213,48 +213,41 @@ InitConfigFileParser::parseConfig(FILE * file) { // Parse Name-Value Pair //**************************************************************************** -bool InitConfigFileParser::parseNameValuePair(Context& ctx, const char* line) { - - char tmpLine[MAX_LINE_LENGTH]; - char fname[MAX_LINE_LENGTH], rest[MAX_LINE_LENGTH]; - char* t; - const char *separator_list[]= {":", "=", 0}; - const char *separator= 0; - +bool InitConfigFileParser::parseNameValuePair(Context& ctx, const char* line) +{ if (ctx.m_currentSection == NULL){ ctx.reportError("Value specified outside section"); return false; } - strncpy(tmpLine, line, MAX_LINE_LENGTH); - // ************************************* - // Check if a separator exists in line + // Split string at first occurrence of + // '=' or ':' // ************************************* - for(int i= 0; separator_list[i] != 0; i++) { - if(strchr(tmpLine, separator_list[i][0])) { - separator= separator_list[i]; - break; - } - } - if (separator == 0) { + Vector tmp_string_split; + if (BaseString(line).split(tmp_string_split, + BaseString("=:"), + 2) != 2) + { ctx.reportError("Parse error"); return false; } - // ******************************************* - // Get pointer to substring before separator - // ******************************************* - t = strtok(tmpLine, separator); - - // ***************************************** - // Count number of tokens before separator - // ***************************************** - if (sscanf(t, "%120s%120s", fname, rest) != 1) { - ctx.reportError("Multiple names before \'%c\'", separator[0]); - return false; + // ************************************* + // Remove leading and trailing chars + // ************************************* + { + for (int i = 0; i < 2; i++) + tmp_string_split[i].trim("\r\n \t"); } + + // ************************************* + // First in split is fname + // ************************************* + + const char *fname= tmp_string_split[0].c_str(); + if (!ctx.m_currentInfo->contains(fname)) { ctx.reportError("[%s] Unknown parameter: %s", ctx.fname, fname); return false; @@ -273,24 +266,11 @@ bool InitConfigFileParser::parseNameValuePair(Context& ctx, const char* line) { } } - // ****************************************** - // Get pointer to substring after separator - // ****************************************** - t = strtok(NULL, "\0"); - if (t == NULL) { - ctx.reportError("No value for parameter"); - return false; - } - - // ****************************************** - // Remove prefix and postfix spaces and tabs - // ******************************************* - trim(t); - // *********************** // Store name-value pair // *********************** - return storeNameValuePair(ctx, fname, t); + + return storeNameValuePair(ctx, fname, tmp_string_split[1].c_str()); } From 26339663b87159075a37899f05231aedefa61d2e Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 25 Nov 2004 16:18:47 +0400 Subject: [PATCH 0335/1063] table.cc: Bug #6802 MySQL 4.0's VARCHAR(NN) BINARY is interpreted as VARBINARY(NN) in 4.1 sql/table.cc: Bug #6802 MySQL 4.0's VARCHAR(NN) BINARY is interpreted as VARBINARY(NN) in 4.1 --- sql/table.cc | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/sql/table.cc b/sql/table.cc index 20ac714020d..cb565097c0b 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -463,7 +463,26 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag, /* old frm file */ field_type= (enum_field_types) f_packtype(pack_flag); - charset=f_is_binary(pack_flag) ? &my_charset_bin : outparam->table_charset; + if (f_is_binary(pack_flag)) + { + /* + Try to choose the best 4.1 type: + - for 4.0 "CHAR(N) BINARY" or "VARCHAR(N) BINARY" + try to find a binary collation for character set. + - for other types (e.g. BLOB) just use my_charset_bin. + */ + if (!f_is_blob(pack_flag)) + { + // 3.23 or 4.0 string + if (!(charset= get_charset_by_csname(outparam->table_charset->csname, + MY_CS_BINSORT, MYF(0)))) + charset= &my_charset_bin; + } + else + charset= &my_charset_bin; + } + else + charset= outparam->table_charset; bzero((char*) &comment, sizeof(comment)); } *field_ptr=reg_field= From 8127cea5124e44444370df61f0483c18f8c2dcab Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 25 Nov 2004 22:54:49 +0200 Subject: [PATCH 0336/1063] init values to avoid junk returning in case of null value asking without assigning value (BUG#6806) mysql-test/r/subselect.result: Equal operation under row and empty subquery mysql-test/t/subselect.test: Equal operation under row and empty subquery sql/item.h: init values to avoid junk returning in case of null value asking without assigning value --- mysql-test/r/subselect.result | 5 +++++ mysql-test/t/subselect.test | 8 ++++++++ sql/item.h | 6 +++--- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index 53b92fe50f1..4ad234244bf 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -2005,3 +2005,8 @@ explain select a from t1 where c=2; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using where drop table t1; +create table t1 (s1 int,s2 int); +insert into t1 values (20,15); +select * from t1 where (('a',null) <=> (select 'a',s2 from t1 where s1 = 0)); +s1 s2 +drop table t1; diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test index 19bfaa6194a..c3a10a835e2 100644 --- a/mysql-test/t/subselect.test +++ b/mysql-test/t/subselect.test @@ -1301,3 +1301,11 @@ explain select a from t1 where c=2; do @a:= (select sum(a) from t1 where b > @b); explain select a from t1 where c=2; drop table t1; + +# +# Equal operation under row and empty subquery +# +create table t1 (s1 int,s2 int); +insert into t1 values (20,15); +select * from t1 where (('a',null) <=> (select 'a',s2 from t1 where s1 = 0)); +drop table t1; diff --git a/sql/item.h b/sql/item.h index ccb0fda1c49..3c4f80e3857 100644 --- a/sql/item.h +++ b/sql/item.h @@ -1127,7 +1127,7 @@ class Item_cache_int: public Item_cache { longlong value; public: - Item_cache_int(): Item_cache() {} + Item_cache_int(): Item_cache(), value(0) {} void store(Item *item); double val() { DBUG_ASSERT(fixed == 1); return (double) value; } @@ -1145,7 +1145,7 @@ class Item_cache_real: public Item_cache { double value; public: - Item_cache_real(): Item_cache() {} + Item_cache_real(): Item_cache(), value(0) {} void store(Item *item); double val() { DBUG_ASSERT(fixed == 1); return value; } @@ -1167,7 +1167,7 @@ class Item_cache_str: public Item_cache char buffer[80]; String *value, value_buff; public: - Item_cache_str(): Item_cache() { } + Item_cache_str(): Item_cache(), value(0) { } void store(Item *item); double val(); From 00534590af2c4bd9b6ab5bd068f381b12676fb49 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 25 Nov 2004 21:29:59 +0000 Subject: [PATCH 0337/1063] moved default setting to config.ini to MgmtSrvr only try to connect to other ndb_mgmd if connect_string explicitly given or config_file not given ndb/src/mgmsrv/main.cpp: moved default setting to config.ini to MgmtSrvr --- ndb/src/mgmsrv/MgmtSrvr.cpp | 11 ++++++++--- ndb/src/mgmsrv/main.cpp | 1 - 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ndb/src/mgmsrv/MgmtSrvr.cpp b/ndb/src/mgmsrv/MgmtSrvr.cpp index 81b5eb9dfb3..986da71a8e8 100644 --- a/ndb/src/mgmsrv/MgmtSrvr.cpp +++ b/ndb/src/mgmsrv/MgmtSrvr.cpp @@ -432,15 +432,20 @@ MgmtSrvr::MgmtSrvr(SocketServer *socket_server, theFacade = 0; m_newConfig = NULL; - m_configFilename.assign(config_filename); + if (config_filename) + m_configFilename.assign(config_filename); + else + m_configFilename.assign("config.ini"); m_nextConfigGenerationNumber = 0; m_config_retriever= new ConfigRetriever(connect_string, NDB_VERSION, NDB_MGM_NODE_TYPE_MGM); - + // if connect_string explicitly given or + // no config filename is given then // first try to allocate nodeid from another management server - if(m_config_retriever->do_connect(0,0,0) == 0) + if ((connect_string || config_filename == NULL) && + (m_config_retriever->do_connect(0,0,0) == 0)) { int tmp_nodeid= 0; tmp_nodeid= m_config_retriever->allocNodeId(0 /*retry*/,0 /*delay*/); diff --git a/ndb/src/mgmsrv/main.cpp b/ndb/src/mgmsrv/main.cpp index 1ab8cc0635e..400a5301a19 100644 --- a/ndb/src/mgmsrv/main.cpp +++ b/ndb/src/mgmsrv/main.cpp @@ -188,7 +188,6 @@ int main(int argc, char** argv) #endif global_mgmt_server_check = 1; - glob.config_filename= "config.ini"; const char *load_default_groups[]= { "mysql_cluster","ndb_mgmd",0 }; load_defaults("my",load_default_groups,&argc,&argv); From a560f0fa3888902e14378d3f8ee4416d2e1eab3b Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 26 Nov 2004 00:12:50 +0200 Subject: [PATCH 0338/1063] Many files: Fix bug #6817 and bug #6827 : do not crash the server if the buffer pool becomes filled by the locks of ONE huge transaction, return error 1206 instead; do not crash the server, but return error if we cannot allocate memory for the buffer pool at a mysqld startup innobase/buf/buf0buf.c: Fix bug #6817 and bug #6827 : do not crash the server if the buffer pool becomes filled by the locks of ONE huge transaction, return error 1206 instead; do not crash the server, but return error if we cannot allocate memory for the buffer pool at a mysqld startup innobase/buf/buf0lru.c: Fix bug #6817 and bug #6827 : do not crash the server if the buffer pool becomes filled by the locks of ONE huge transaction, return error 1206 instead; do not crash the server, but return error if we cannot allocate memory for the buffer pool at a mysqld startup innobase/include/buf0lru.h: Fix bug #6817 and bug #6827 : do not crash the server if the buffer pool becomes filled by the locks of ONE huge transaction, return error 1206 instead; do not crash the server, but return error if we cannot allocate memory for the buffer pool at a mysqld startup innobase/include/db0err.h: Fix bug #6817 and bug #6827 : do not crash the server if the buffer pool becomes filled by the locks of ONE huge transaction, return error 1206 instead; do not crash the server, but return error if we cannot allocate memory for the buffer pool at a mysqld startup innobase/include/row0sel.h: Fix bug #6817 and bug #6827 : do not crash the server if the buffer pool becomes filled by the locks of ONE huge transaction, return error 1206 instead; do not crash the server, but return error if we cannot allocate memory for the buffer pool at a mysqld startup innobase/include/ut0mem.h: Fix bug #6817 and bug #6827 : do not crash the server if the buffer pool becomes filled by the locks of ONE huge transaction, return error 1206 instead; do not crash the server, but return error if we cannot allocate memory for the buffer pool at a mysqld startup innobase/mem/mem0pool.c: Fix bug #6817 and bug #6827 : do not crash the server if the buffer pool becomes filled by the locks of ONE huge transaction, return error 1206 instead; do not crash the server, but return error if we cannot allocate memory for the buffer pool at a mysqld startup innobase/row/row0mysql.c: Fix bug #6817 and bug #6827 : do not crash the server if the buffer pool becomes filled by the locks of ONE huge transaction, return error 1206 instead; do not crash the server, but return error if we cannot allocate memory for the buffer pool at a mysqld startup innobase/row/row0sel.c: Fix bug #6817 and bug #6827 : do not crash the server if the buffer pool becomes filled by the locks of ONE huge transaction, return error 1206 instead; do not crash the server, but return error if we cannot allocate memory for the buffer pool at a mysqld startup innobase/srv/srv0start.c: Fix bug #6817 and bug #6827 : do not crash the server if the buffer pool becomes filled by the locks of ONE huge transaction, return error 1206 instead; do not crash the server, but return error if we cannot allocate memory for the buffer pool at a mysqld startup innobase/ut/ut0mem.c: Fix bug #6817 and bug #6827 : do not crash the server if the buffer pool becomes filled by the locks of ONE huge transaction, return error 1206 instead; do not crash the server, but return error if we cannot allocate memory for the buffer pool at a mysqld startup --- innobase/buf/buf0buf.c | 5 +++-- innobase/buf/buf0lru.c | 41 ++++++++++++++++++++++++++++++++++---- innobase/include/buf0lru.h | 10 ++++++++++ innobase/include/db0err.h | 6 +++++- innobase/include/row0sel.h | 1 + innobase/include/ut0mem.h | 4 +++- innobase/mem/mem0pool.c | 2 +- innobase/row/row0mysql.c | 3 ++- innobase/row/row0sel.c | 11 ++++++++++ innobase/srv/srv0start.c | 3 +++ innobase/ut/ut0mem.c | 20 +++++++++++++------ 11 files changed, 90 insertions(+), 16 deletions(-) diff --git a/innobase/buf/buf0buf.c b/innobase/buf/buf0buf.c index adb69f3c3a7..699ad5fb42e 100644 --- a/innobase/buf/buf0buf.c +++ b/innobase/buf/buf0buf.c @@ -547,8 +547,9 @@ buf_pool_init( } /*----------------------------------------*/ } else { - buf_pool->frame_mem = ut_malloc( - UNIV_PAGE_SIZE * (n_frames + 1)); + buf_pool->frame_mem = ut_malloc_low( + UNIV_PAGE_SIZE * (n_frames + 1), + TRUE, FALSE); } if (buf_pool->frame_mem == NULL) { diff --git a/innobase/buf/buf0lru.c b/innobase/buf/buf0lru.c index 796311f0157..f3fb19ae183 100644 --- a/innobase/buf/buf0lru.c +++ b/innobase/buf/buf0lru.c @@ -42,6 +42,10 @@ initial segment in buf_LRU_get_recent_limit */ #define BUF_LRU_INITIAL_RATIO 8 +/* If we switch on the InnoDB monitor because there are too few available +frames in the buffer pool, we set this to TRUE */ +ibool buf_lru_switched_on_innodb_mon = FALSE; + /********************************************************************** Takes a block out of the LRU list and page hash table and sets the block state to BUF_BLOCK_REMOVE_HASH. */ @@ -287,6 +291,32 @@ buf_LRU_try_free_flushed_blocks(void) mutex_exit(&(buf_pool->mutex)); } +/********************************************************************** +Returns TRUE if less than 15 % of the buffer pool is available. This can be +used in heuristics to prevent huge transactions eating up the whole buffer +pool for their locks. */ + +ibool +buf_LRU_buf_pool_running_out(void) +/*==============================*/ + /* out: TRUE if less than 15 % of buffer pool + left */ +{ + ibool ret = FALSE; + + mutex_enter(&(buf_pool->mutex)); + + if (!recv_recovery_on && UT_LIST_GET_LEN(buf_pool->free) + + UT_LIST_GET_LEN(buf_pool->LRU) < buf_pool->max_size / 7) { + + ret = TRUE; + } + + mutex_exit(&(buf_pool->mutex)); + + return(ret); +} + /********************************************************************** Returns a free block from buf_pool. The block is taken off the free list. If it is empty, blocks are moved from the end of the LRU list to the free @@ -325,7 +355,8 @@ loop: } else if (!recv_recovery_on && UT_LIST_GET_LEN(buf_pool->free) + UT_LIST_GET_LEN(buf_pool->LRU) < buf_pool->max_size / 5) { - if (!srv_print_innodb_monitor) { + + if (!buf_lru_switched_on_innodb_mon) { /* Over 80 % of the buffer pool is occupied by lock heaps or the adaptive hash index. This may be a memory @@ -342,16 +373,18 @@ loop: "InnoDB: lock heap and hash index sizes.\n", (ulong) (buf_pool->curr_size / (1024 * 1024 / UNIV_PAGE_SIZE))); + buf_lru_switched_on_innodb_mon = TRUE; srv_print_innodb_monitor = TRUE; os_event_set(srv_lock_timeout_thread_event); } - } else if (!recv_recovery_on && UT_LIST_GET_LEN(buf_pool->free) - + UT_LIST_GET_LEN(buf_pool->LRU) < buf_pool->max_size / 4) { + } else if (buf_lru_switched_on_innodb_mon) { /* Switch off the InnoDB Monitor; this is a simple way to stop the monitor if the situation becomes less urgent, - but may also surprise users! */ + but may also surprise users if the user also switched on the + monitor! */ + buf_lru_switched_on_innodb_mon = FALSE; srv_print_innodb_monitor = FALSE; } diff --git a/innobase/include/buf0lru.h b/innobase/include/buf0lru.h index 69a376f8cab..45164dd561e 100644 --- a/innobase/include/buf0lru.h +++ b/innobase/include/buf0lru.h @@ -25,6 +25,16 @@ wasted. */ void buf_LRU_try_free_flushed_blocks(void); /*==================================*/ +/********************************************************************** +Returns TRUE if less than 15 % of the buffer pool is available. This can be +used in heuristics to prevent huge transactions eating up the whole buffer +pool for their locks. */ + +ibool +buf_LRU_buf_pool_running_out(void); +/*==============================*/ + /* out: TRUE if less than 15 % of buffer pool + left */ /*####################################################################### These are low-level functions diff --git a/innobase/include/db0err.h b/innobase/include/db0err.h index be7667bfd0c..de5ac44e73f 100644 --- a/innobase/include/db0err.h +++ b/innobase/include/db0err.h @@ -53,7 +53,11 @@ Created 5/24/1996 Heikki Tuuri name already exists */ #define DB_TABLESPACE_DELETED 44 /* tablespace does not exist or is being dropped right now */ - +#define DB_LOCK_TABLE_FULL 45 /* lock structs have exhausted the + buffer pool (for big transactions, + InnoDB stores the lock structs in the + buffer pool) */ + /* The following are partial failure codes */ #define DB_FAIL 1000 #define DB_OVERFLOW 1001 diff --git a/innobase/include/row0sel.h b/innobase/include/row0sel.h index bb6fb70ca86..8d5187bfc1c 100644 --- a/innobase/include/row0sel.h +++ b/innobase/include/row0sel.h @@ -120,6 +120,7 @@ row_search_for_mysql( /* out: DB_SUCCESS, DB_RECORD_NOT_FOUND, DB_END_OF_INDEX, DB_DEADLOCK, + DB_LOCK_TABLE_FULL, or DB_TOO_BIG_RECORD */ byte* buf, /* in/out: buffer for the fetched row in the MySQL format */ diff --git a/innobase/include/ut0mem.h b/innobase/include/ut0mem.h index 73ecb25101a..74357f6bf13 100644 --- a/innobase/include/ut0mem.h +++ b/innobase/include/ut0mem.h @@ -38,8 +38,10 @@ ut_malloc_low( /*==========*/ /* out, own: allocated memory */ ulint n, /* in: number of bytes to allocate */ - ibool set_to_zero); /* in: TRUE if allocated memory should be set + ibool set_to_zero, /* in: TRUE if allocated memory should be set to zero if UNIV_SET_MEM_TO_ZERO is defined */ + ibool assert_on_error); /* in: if TRUE, we crash mysqld if the memory + cannot be allocated */ /************************************************************************** Allocates memory. Sets it also to zero if UNIV_SET_MEM_TO_ZERO is defined. */ diff --git a/innobase/mem/mem0pool.c b/innobase/mem/mem0pool.c index 023369e8ec5..cb891a03092 100644 --- a/innobase/mem/mem0pool.c +++ b/innobase/mem/mem0pool.c @@ -199,7 +199,7 @@ mem_pool_create( but only when allocated at a higher level in mem0mem.c. This is to avoid masking useful Purify warnings. */ - pool->buf = ut_malloc_low(size, FALSE); + pool->buf = ut_malloc_low(size, FALSE, TRUE); pool->size = size; mutex_create(&(pool->mutex)); diff --git a/innobase/row/row0mysql.c b/innobase/row/row0mysql.c index 17747ae2a8e..9613da2e286 100644 --- a/innobase/row/row0mysql.c +++ b/innobase/row/row0mysql.c @@ -308,7 +308,8 @@ handle_new_error: return(TRUE); - } else if (err == DB_DEADLOCK || err == DB_LOCK_WAIT_TIMEOUT) { + } else if (err == DB_DEADLOCK || err == DB_LOCK_WAIT_TIMEOUT + || err == DB_LOCK_TABLE_FULL) { /* Roll back the whole transaction; this resolution was added to version 3.23.43 */ diff --git a/innobase/row/row0sel.c b/innobase/row/row0sel.c index 5b7d068d0c1..edaa555c555 100644 --- a/innobase/row/row0sel.c +++ b/innobase/row/row0sel.c @@ -730,8 +730,18 @@ sel_set_rec_lock( ulint type, /* in: LOCK_ORDINARY, LOCK_GAP, or LOC_REC_NOT_GAP */ que_thr_t* thr) /* in: query thread */ { + trx_t* trx; ulint err; + trx = thr_get_trx(thr); + + if (UT_LIST_GET_LEN(trx->trx_locks) > 10000) { + if (buf_LRU_buf_pool_running_out()) { + + return(DB_LOCK_TABLE_FULL); + } + } + if (index->type & DICT_CLUSTERED) { err = lock_clust_rec_read_check_and_lock(0, rec, index, mode, type, thr); @@ -2765,6 +2775,7 @@ row_search_for_mysql( /* out: DB_SUCCESS, DB_RECORD_NOT_FOUND, DB_END_OF_INDEX, DB_DEADLOCK, + DB_LOCK_TABLE_FULL, or DB_TOO_BIG_RECORD */ byte* buf, /* in/out: buffer for the fetched row in the MySQL format */ diff --git a/innobase/srv/srv0start.c b/innobase/srv/srv0start.c index 9709f5235de..69341a1d7d1 100644 --- a/innobase/srv/srv0start.c +++ b/innobase/srv/srv0start.c @@ -1172,6 +1172,9 @@ NetWare. */ } if (ret == NULL) { + fprintf(stderr, +"InnoDB: Fatal error: cannot allocate the memory for the buffer pool\n"); + return(DB_ERROR); } diff --git a/innobase/ut/ut0mem.c b/innobase/ut/ut0mem.c index a6002d7fd83..6ed61b0b5de 100644 --- a/innobase/ut/ut0mem.c +++ b/innobase/ut/ut0mem.c @@ -61,8 +61,10 @@ ut_malloc_low( /*==========*/ /* out, own: allocated memory */ ulint n, /* in: number of bytes to allocate */ - ibool set_to_zero) /* in: TRUE if allocated memory should be set + ibool set_to_zero, /* in: TRUE if allocated memory should be set to zero if UNIV_SET_MEM_TO_ZERO is defined */ + ibool assert_on_error) /* in: if TRUE, we crash mysqld if the memory + cannot be allocated */ { void* ret; @@ -86,9 +88,7 @@ ut_malloc_low( "InnoDB: Check if you should increase the swap file or\n" "InnoDB: ulimits of your operating system.\n" "InnoDB: On FreeBSD check you have compiled the OS with\n" - "InnoDB: a big enough maximum process size.\n" - "InnoDB: We now intentionally generate a seg fault so that\n" - "InnoDB: on Linux we get a stack trace.\n", + "InnoDB: a big enough maximum process size.\n", (ulong) n, (ulong) ut_total_allocated_memory, #ifdef __WIN__ (ulong) GetLastError() @@ -110,7 +110,15 @@ ut_malloc_low( /* Intentional segfault on NetWare causes an abend. Avoid this by graceful exit handling in ut_a(). */ #if (!defined __NETWARE__) - if (*ut_mem_null_ptr) ut_mem_null_ptr = 0; + if (assert_on_error) { + fprintf(stderr, + "InnoDB: We now intentionally generate a seg fault so that\n" + "InnoDB: on Linux we get a stack trace.\n"); + + if (*ut_mem_null_ptr) ut_mem_null_ptr = 0; + } else { + return(NULL); + } #else ut_a(0); #endif @@ -144,7 +152,7 @@ ut_malloc( /* out, own: allocated memory */ ulint n) /* in: number of bytes to allocate */ { - return(ut_malloc_low(n, TRUE)); + return(ut_malloc_low(n, TRUE, TRUE)); } /************************************************************************** From 5557ae747efdb8a1a8fe8841397231ee8265dfac Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 26 Nov 2004 00:26:35 +0200 Subject: [PATCH 0339/1063] ha_innodb.cc: Add conversion of the InnoDB error DB_LOCK_TABLE_FULL to the corresponding MySQL error sql/ha_innodb.cc: Add conversion of the InnoDB error DB_LOCK_TABLE_FULL to the corresponding MySQL error --- sql/ha_innodb.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index 07d8da63733..2515b4956d0 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -331,6 +331,9 @@ convert_error_code_to_mysql( } else if (error == (int) DB_NO_SAVEPOINT) { return(HA_ERR_NO_SAVEPOINT); + } else if (error == (int) DB_LOCK_TABLE_FULL) { + + return(HA_ERR_LOCK_TABLE_FULL); } else { return(-1); // Unknown error } From 60af920628c435a5990c3ef7a753d0f374fc12cc Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 26 Nov 2004 02:31:22 +0200 Subject: [PATCH 0340/1063] Fixes while reviewing code (Cleanups and better bug fixes) mysql-test/r/select.result: Fixed test after wrong merge mysql-test/t/select.test: Fixed test after wrong merge scripts/mysql_fix_privilege_tables.sh: Don't read defaults files sql/item_cmpfunc.cc: Fix wrong value for not_null_tables_cache sql/item_cmpfunc.h: Remove wrong patch (flags are set in fix_length_and_dec()) sql/item_func.h: Fix wrong value for not_null_tables_cache sql/slave.cc: Fixed indentation --- mysql-test/r/select.result | 32 +++++++++++++-------------- mysql-test/t/select.test | 2 +- scripts/mysql_fix_privilege_tables.sh | 2 +- sql/item_cmpfunc.cc | 7 +++--- sql/item_cmpfunc.h | 3 --- sql/item_func.h | 2 +- sql/slave.cc | 3 ++- 7 files changed, 25 insertions(+), 26 deletions(-) diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result index 3dd0603ed09..cc90547722f 100644 --- a/mysql-test/r/select.result +++ b/mysql-test/r/select.result @@ -2327,22 +2327,6 @@ select * from t2,t3 where t2.s = t3.s; s s two two drop table t1, t2, t3; -CREATE TABLE t1 ( -i int(11) NOT NULL default '0', -c char(10) NOT NULL default '', -PRIMARY KEY (i), -UNIQUE KEY c (c) -) TYPE=MyISAM; -INSERT INTO t1 VALUES (1,'a'); -INSERT INTO t1 VALUES (2,'b'); -INSERT INTO t1 VALUES (3,'c'); -EXPLAIN SELECT i FROM t1 WHERE i=1; -table type possible_keys key key_len ref rows Extra -t1 const PRIMARY PRIMARY 4 const 1 Using index -EXPLAIN SELECT i FROM t1 WHERE i=1; -table type possible_keys key key_len ref rows Extra -t1 const PRIMARY PRIMARY 4 const 1 Using index -DROP TABLE t1; create table t1 (a integer, b integer, index(a), index(b)); create table t2 (c integer, d integer, index(c), index(d)); insert into t1 values (1,2), (2,2), (3,2), (4,2); @@ -2364,3 +2348,19 @@ a b c d 3 2 3 4 4 2 4 4 drop table t1, t2; +CREATE TABLE t1 ( +i int(11) NOT NULL default '0', +c char(10) NOT NULL default '', +PRIMARY KEY (i), +UNIQUE KEY c (c) +) TYPE=MyISAM; +INSERT INTO t1 VALUES (1,'a'); +INSERT INTO t1 VALUES (2,'b'); +INSERT INTO t1 VALUES (3,'c'); +EXPLAIN SELECT i FROM t1 WHERE i=1; +table type possible_keys key key_len ref rows Extra +t1 const PRIMARY PRIMARY 4 const 1 Using index +EXPLAIN SELECT i FROM t1 WHERE i=1; +table type possible_keys key key_len ref rows Extra +t1 const PRIMARY PRIMARY 4 const 1 Using index +DROP TABLE t1; diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test index f897703789b..e6b1ffbe8d7 100644 --- a/mysql-test/t/select.test +++ b/mysql-test/t/select.test @@ -1887,7 +1887,7 @@ explain select * from t1 left join t2 on a=c where d in (4); select * from t1 left join t2 on a=c where d in (4); explain select * from t1 left join t2 on a=c where d = 4; select * from t1 left join t2 on a=c where d = 4; -drop table t1, t2;R +drop table t1, t2; # # Covering index is mentioned in EXPLAIN output for const tables (bug #5333) diff --git a/scripts/mysql_fix_privilege_tables.sh b/scripts/mysql_fix_privilege_tables.sh index 2fbcd76c318..381cf599e32 100644 --- a/scripts/mysql_fix_privilege_tables.sh +++ b/scripts/mysql_fix_privilege_tables.sh @@ -74,7 +74,7 @@ parse_arguments() parse_arguments "$@" if test -z "$cmd"; then - cmd="$bindir/mysql -f --user=$user --host=$host" + cmd="$bindir/mysql --no-defaults --force --user=$user --host=$host" if test ! -z "$root_password"; then cmd="$cmd --password=$root_password" fi diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index fbc1ad97e76..107a17815ae 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -293,9 +293,9 @@ void Item_func_interval::fix_length_and_dec() } maybe_null=0; max_length=2; used_tables_cache|= item->used_tables(); - not_null_tables_cache&= item->not_null_tables(); + not_null_tables_cache= item->not_null_tables(); with_sum_func= with_sum_func || item->with_sum_func; - const_item_cache&=item->const_item(); + const_item_cache&= item->const_item(); } @@ -1087,7 +1087,8 @@ void Item_func_in::fix_length_and_dec() maybe_null= item->maybe_null; max_length=2; used_tables_cache|= item->used_tables(); - not_null_tables_cache&= item->not_null_tables(); + /* not_null_tables_cache is only dependent on the argument to in */ + not_null_tables_cache= item->not_null_tables(); const_item_cache&= item->const_item(); } diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h index d36429ab61e..8f1aa525190 100644 --- a/sql/item_cmpfunc.h +++ b/sql/item_cmpfunc.h @@ -432,9 +432,6 @@ class Item_func_in :public Item_int_func { bool res= (item->fix_fields(thd,tlist) || Item_func::fix_fields(thd,tlist)); with_sum_func= with_sum_func || item->with_sum_func; - used_tables_cache|= item->used_tables(); - not_null_tables_cache|= item->not_null_tables(); - const_item_cache&= item->const_item(); return res; } void fix_length_and_dec(); diff --git a/sql/item_func.h b/sql/item_func.h index 8a013f42c05..3627af4ebb1 100644 --- a/sql/item_func.h +++ b/sql/item_func.h @@ -600,7 +600,7 @@ public: { maybe_null=0; max_length=3; used_tables_cache|= item->used_tables(); - not_null_tables_cache&= item->not_null_tables(); + not_null_tables_cache= item->not_null_tables(); const_item_cache&= item->const_item(); with_sum_func= with_sum_func || item->with_sum_func; } diff --git a/sql/slave.cc b/sql/slave.cc index 7e544572755..b0f911e7013 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -1637,7 +1637,8 @@ int init_master_info(MASTER_INFO* mi, const char* master_info_fname, position is at the beginning of the file, and will read the "signature" and then fast-forward to the last position read. */ - if (thread_mask & SLAVE_SQL) { + if (thread_mask & SLAVE_SQL) + { my_b_seek(mi->rli.cur_log, (my_off_t) 0); } DBUG_RETURN(0); From 8d1171742ce6196875b45f1b9c1462c72101f902 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 26 Nov 2004 10:00:33 +0100 Subject: [PATCH 0341/1063] ndb - bugfix testScanPerf ndb/test/ndbapi/testScanPerf.cpp: 1) Fix so that values are read even when using -q 2) Divide by correct number --- ndb/test/ndbapi/testScanPerf.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/ndb/test/ndbapi/testScanPerf.cpp b/ndb/test/ndbapi/testScanPerf.cpp index ee2a92e88a9..45f0468bc70 100644 --- a/ndb/test/ndbapi/testScanPerf.cpp +++ b/ndb/test/ndbapi/testScanPerf.cpp @@ -222,6 +222,7 @@ run_scan(){ int sum_time= 0; int sample_rows = 0; + int tot_rows = 0; NDB_TICKS sample_start = NdbTick_CurrentMillisecond(); Uint32 tot = g_paramters[P_ROWS].value; @@ -296,7 +297,7 @@ run_scan(){ break; } } - if(g_paramters[P_RESET].value == 1) + if(g_paramters[P_RESET].value == 2) goto execute; } assert(pOp); @@ -330,6 +331,9 @@ run_scan(){ } assert(check == 0); + if(g_paramters[P_RESET].value == 1) + g_paramters[P_RESET].value = 2; + for(int i = 0; igetNoOfColumns(); i++){ pOp->getValue(i); } @@ -364,6 +368,7 @@ execute: int time_passed= (int)(stop - start1); sample_rows += rows; sum_time+= time_passed; + tot_rows+= rows; if(sample_rows >= tot) { @@ -375,8 +380,8 @@ execute: sample_start = stop; } } - - g_err.println("Avg time: %d ms = %u rows/sec", sum_time/iter, - (1000*tot*iter)/sum_time); + + g_err.println("Avg time: %d ms = %u rows/sec", sum_time/tot_rows, + (1000*tot_rows)/sum_time); return 0; } From 33d654d7e1dce86bf2dbbea6dda4979c4f2ff497 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 26 Nov 2004 09:44:57 +0000 Subject: [PATCH 0342/1063] cleaned up code a bit added command CONNECT in management client added some verbose printouts removed prompt printout on !isatty(0) ndb/src/mgmapi/mgmapi.cpp: improved verbose printouts on connecting to management server ndb/src/mgmclient/CommandInterpreter.cpp: cleaned up code a bit added command CONNECT in management client added some verbose printouts ndb/src/mgmclient/main.cpp: removed prompt printout on !isatty(0) ndb/src/mgmclient/ndb_mgmclient.hpp: added verbose opotion --- ndb/src/mgmapi/mgmapi.cpp | 22 ++++-- ndb/src/mgmclient/CommandInterpreter.cpp | 97 +++++++++++++----------- ndb/src/mgmclient/main.cpp | 19 +++-- ndb/src/mgmclient/ndb_mgmclient.hpp | 2 +- 4 files changed, 81 insertions(+), 59 deletions(-) diff --git a/ndb/src/mgmapi/mgmapi.cpp b/ndb/src/mgmapi/mgmapi.cpp index ca3a2a2186d..831d14eac52 100644 --- a/ndb/src/mgmapi/mgmapi.cpp +++ b/ndb/src/mgmapi/mgmapi.cpp @@ -379,18 +379,30 @@ ndb_mgm_connect(NdbMgmHandle handle, int no_retries, setError(handle, NDB_MGM_COULD_NOT_CONNECT_TO_SOCKET, __LINE__, "Unable to connect with connect string: %s", cfg.makeConnectString(buf,sizeof(buf))); + if (verbose == -2) + ndbout << ", failed." << endl; return -1; } if (verbose == -1) { - ndbout << "retrying every " << retry_delay_in_seconds << " seconds:"; + ndbout << "Retrying every " << retry_delay_in_seconds << " seconds"; + if (no_retries > 0) + ndbout << ". Attempts left:"; + else + ndbout << ", until connected.";; + ndbout << flush; verbose= -2; } - NdbSleep_SecSleep(retry_delay_in_seconds); - if (verbose == -2) { - ndbout << " " << no_retries; + if (no_retries > 0) { + if (verbose == -2) { + ndbout << " " << no_retries; + ndbout << flush; + } + no_retries--; } - no_retries--; + NdbSleep_SecSleep(retry_delay_in_seconds); } + if (verbose == -2) + ndbout << endl; handle->cfg_i = i; diff --git a/ndb/src/mgmclient/CommandInterpreter.cpp b/ndb/src/mgmclient/CommandInterpreter.cpp index 54beaa49d3f..bfe8b6786b4 100644 --- a/ndb/src/mgmclient/CommandInterpreter.cpp +++ b/ndb/src/mgmclient/CommandInterpreter.cpp @@ -44,7 +44,7 @@ public: * Constructor * @param mgmtSrvr: Management server to use when executing commands */ - CommandInterpreter(const char *); + CommandInterpreter(const char *, int verbose); ~CommandInterpreter(); /** @@ -94,6 +94,7 @@ private: */ void executeHelp(char* parameters); void executeShow(char* parameters); + void executeConnect(char* parameters); void executePurge(char* parameters); void executeShutdown(char* parameters); void executeRun(char* parameters); @@ -153,6 +154,7 @@ private: NdbMgmHandle m_mgmsrv; bool connected; + int m_verbose; int try_reconnect; #ifdef HAVE_GLOBAL_REPLICATION NdbRepHandle m_repserver; @@ -169,9 +171,9 @@ private: #include "ndb_mgmclient.hpp" #include "ndb_mgmclient.h" -Ndb_mgmclient::Ndb_mgmclient(const char *host) +Ndb_mgmclient::Ndb_mgmclient(const char *host,int verbose) { - m_cmd= new CommandInterpreter(host); + m_cmd= new CommandInterpreter(host,verbose); } Ndb_mgmclient::~Ndb_mgmclient() { @@ -275,6 +277,7 @@ static const char* helpText = "REP CONNECT Connect to REP server on host:port\n" #endif "PURGE STALE SESSIONS Reset reserved nodeid's in the mgmt server\n" +"CONNECT Connect to management server (reconnect if already connected)\n" "QUIT Quit management client\n" ; @@ -373,7 +376,8 @@ convert(const char* s, int& val) { /* * Constructor */ -CommandInterpreter::CommandInterpreter(const char *_host) +CommandInterpreter::CommandInterpreter(const char *_host,int verbose) + : m_verbose(verbose) { m_mgmsrv = ndb_mgm_create_handle(); if(m_mgmsrv == NULL) { @@ -437,7 +441,15 @@ CommandInterpreter::connect() { if(!connected) { if(!ndb_mgm_connect(m_mgmsrv, try_reconnect-1, 5, 1)) + { connected = true; + if (m_verbose) + { + printf("Connected to Management Server at: %s:%d\n", + ndb_mgm_get_connected_host(m_mgmsrv), + ndb_mgm_get_connected_port(m_mgmsrv)); + } + } } return connected; } @@ -445,7 +457,7 @@ CommandInterpreter::connect() bool CommandInterpreter::disconnect() { - if (ndb_mgm_disconnect(m_mgmsrv) == -1) { + if (connected && (ndb_mgm_disconnect(m_mgmsrv) == -1)) { ndbout_c("Could not disconnect from management server"); printError(); } @@ -459,18 +471,21 @@ CommandInterpreter::disconnect() int CommandInterpreter::execute(const char *_line, int _try_reconnect) { + DBUG_ENTER("CommandInterpreter::execute"); + DBUG_PRINT("info",("line=\"%s\"",_line)); + if (_try_reconnect >= 0) try_reconnect=_try_reconnect; char * line; if(_line == NULL) { // ndbout << endl; - return false; + DBUG_RETURN(false); } line = my_strdup(_line,MYF(MY_WME)); My_auto_ptr ptr(line); if (emptyString(line)) { - return true; + DBUG_RETURN(true); } for (unsigned int i = 0; i < strlen(line); ++i) { @@ -484,41 +499,49 @@ CommandInterpreter::execute(const char *_line, int _try_reconnect) if (strcmp(firstToken, "HELP") == 0 || strcmp(firstToken, "?") == 0) { executeHelp(allAfterFirstToken); - return true; + DBUG_RETURN(true); } - else if (strcmp(firstToken, "SHOW") == 0) { + else if (strcmp(firstToken, "CONNECT") == 0) { + executeConnect(allAfterFirstToken); + DBUG_RETURN(true); + } + + if (!connect()) + DBUG_RETURN(true); + + if (strcmp(firstToken, "SHOW") == 0) { executeShow(allAfterFirstToken); - return true; + DBUG_RETURN(true); } else if (strcmp(firstToken, "SHUTDOWN") == 0) { executeShutdown(allAfterFirstToken); - return true; + DBUG_RETURN(true); } else if (strcmp(firstToken, "CLUSTERLOG") == 0){ executeClusterLog(allAfterFirstToken); - return true; + DBUG_RETURN(true); } else if(strcmp(firstToken, "START") == 0 && allAfterFirstToken != NULL && strncmp(allAfterFirstToken, "BACKUP", sizeof("BACKUP") - 1) == 0){ executeStartBackup(allAfterFirstToken); - return true; + DBUG_RETURN(true); } else if(strcmp(firstToken, "ABORT") == 0 && allAfterFirstToken != NULL && strncmp(allAfterFirstToken, "BACKUP", sizeof("BACKUP") - 1) == 0){ executeAbortBackup(allAfterFirstToken); - return true; + DBUG_RETURN(true); } else if (strcmp(firstToken, "PURGE") == 0) { executePurge(allAfterFirstToken); - return true; + DBUG_RETURN(true); } #ifdef HAVE_GLOBAL_REPLICATION else if(strcmp(firstToken, "REPLICATION") == 0 || strcmp(firstToken, "REP") == 0) { executeRep(allAfterFirstToken); - return true; + DBUG_RETURN(true); } #endif // HAVE_GLOBAL_REPLICATION else if(strcmp(firstToken, "ENTER") == 0 && @@ -526,14 +549,14 @@ CommandInterpreter::execute(const char *_line, int _try_reconnect) strncmp(allAfterFirstToken, "SINGLE USER MODE ", sizeof("SINGLE USER MODE") - 1) == 0){ executeEnterSingleUser(allAfterFirstToken); - return true; + DBUG_RETURN(true); } else if(strcmp(firstToken, "EXIT") == 0 && allAfterFirstToken != NULL && strncmp(allAfterFirstToken, "SINGLE USER MODE ", sizeof("SINGLE USER MODE") - 1) == 0){ executeExitSingleUser(allAfterFirstToken); - return true; + DBUG_RETURN(true); } else if (strcmp(firstToken, "ALL") == 0) { analyseAfterFirstToken(-1, allAfterFirstToken); @@ -542,7 +565,7 @@ CommandInterpreter::execute(const char *_line, int _try_reconnect) strcmp(firstToken, "EXIT") == 0 || strcmp(firstToken, "BYE") == 0) && allAfterFirstToken == NULL){ - return false; + DBUG_RETURN(false); } else { /** * First token should be a digit, node ID @@ -552,18 +575,18 @@ CommandInterpreter::execute(const char *_line, int _try_reconnect) if (! convert(firstToken, nodeId)) { ndbout << "Invalid command: " << line << endl; ndbout << "Type HELP for help." << endl << endl; - return true; + DBUG_RETURN(true); } if (nodeId < 0) { ndbout << "Invalid node ID: " << firstToken << "." << endl; - return true; + DBUG_RETURN(true); } analyseAfterFirstToken(nodeId, allAfterFirstToken); } - return true; + DBUG_RETURN(true); } @@ -692,7 +715,6 @@ CommandInterpreter::executeForAll(const char * cmd, ExecuteFunction fun, ndbout_c("Trying to start all nodes of system."); ndbout_c("Use ALL STATUS to see the system start-up phases."); } else { - connect(); struct ndb_mgm_cluster_state *cl= ndb_mgm_get_status(m_mgmsrv); if(cl == 0){ ndbout_c("Unable get status from management server"); @@ -826,8 +848,6 @@ CommandInterpreter::executeHelp(char* parameters) void CommandInterpreter::executeShutdown(char* parameters) { - connect(); - ndb_mgm_cluster_state *state = ndb_mgm_get_status(m_mgmsrv); if(state == NULL) { ndbout_c("Could not get status"); @@ -979,7 +999,6 @@ CommandInterpreter::executePurge(char* parameters) int i; char *str; - connect(); if (ndb_mgm_purge_stale_sessions(m_mgmsrv, &str)) { ndbout_c("Command failed"); @@ -999,7 +1018,6 @@ void CommandInterpreter::executeShow(char* parameters) { int i; - connect(); if (emptyString(parameters)) { ndbout << "Cluster Configuration" << endl << "---------------------" << endl; @@ -1087,6 +1105,12 @@ CommandInterpreter::executeShow(char* parameters) } } +void +CommandInterpreter::executeConnect(char* parameters) +{ + disconnect(); + connect(); +} //***************************************************************************** //***************************************************************************** @@ -1094,7 +1118,6 @@ void CommandInterpreter::executeClusterLog(char* parameters) { int i; - connect(); if (parameters != 0 && strlen(parameters) != 0) { enum ndb_mgm_clusterlog_level severity = NDB_MGM_CLUSTERLOG_ALL; int isOk = true; @@ -1240,7 +1263,6 @@ CommandInterpreter::executeClusterLog(char* parameters) void CommandInterpreter::executeStop(int processId, const char *, bool all) { - connect(); int result = 0; if(all) { result = ndb_mgm_stop(m_mgmsrv, 0, 0); @@ -1262,7 +1284,6 @@ CommandInterpreter::executeStop(int processId, const char *, bool all) void CommandInterpreter::executeEnterSingleUser(char* parameters) { - connect(); strtok(parameters, " "); struct ndb_mgm_reply reply; char* id = strtok(NULL, " "); @@ -1289,7 +1310,6 @@ CommandInterpreter::executeEnterSingleUser(char* parameters) void CommandInterpreter::executeExitSingleUser(char* parameters) { - connect(); int result = ndb_mgm_exit_single_user(m_mgmsrv, 0); if (result != 0) { ndbout_c("Exiting single user mode failed."); @@ -1304,7 +1324,6 @@ void CommandInterpreter::executeStart(int processId, const char* parameters, bool all) { - connect(); int result; if(all) { result = ndb_mgm_start(m_mgmsrv, 0, 0); @@ -1328,7 +1347,6 @@ void CommandInterpreter::executeRestart(int processId, const char* parameters, bool all) { - connect(); int result; int nostart = 0; int initialstart = 0; @@ -1378,7 +1396,6 @@ CommandInterpreter::executeDumpState(int processId, const char* parameters, ndbout << "Expected argument" << endl; return; } - connect(); Uint32 no = 0; int pars[25]; @@ -1418,7 +1435,6 @@ CommandInterpreter::executeStatus(int processId, return; } - connect(); ndb_mgm_node_status status; Uint32 startPhase, version; bool system; @@ -1469,7 +1485,6 @@ void CommandInterpreter::executeLogLevel(int processId, const char* parameters, bool all) { - connect(); (void) all; BaseString tmp(parameters); @@ -1525,7 +1540,6 @@ void CommandInterpreter::executeError(int processId, return; } - connect(); // Copy parameters since strtok will modify it char* newpar = my_strdup(parameters,MYF(MY_WME)); My_auto_ptr ap1(newpar); @@ -1589,7 +1603,6 @@ void CommandInterpreter::executeLog(int processId, const char* parameters, bool all) { - connect(); struct ndb_mgm_reply reply; Vector blocks; if (! parseBlockSpecification(parameters, blocks)) { @@ -1657,7 +1670,6 @@ CommandInterpreter::executeTestOn(int processId, ndbout << "No parameters expected to this command." << endl; return; } - connect(); struct ndb_mgm_reply reply; int result = ndb_mgm_start_signallog(m_mgmsrv, processId, &reply); if (result != 0) { @@ -1676,7 +1688,6 @@ CommandInterpreter::executeTestOff(int processId, ndbout << "No parameters expected to this command." << endl; return; } - connect(); struct ndb_mgm_reply reply; int result = ndb_mgm_stop_signallog(m_mgmsrv, processId, &reply); if (result != 0) { @@ -1798,8 +1809,6 @@ CommandInterpreter::executeEventReporting(int processId, ndbout << "Expected argument" << endl; return; } - connect(); - BaseString tmp(parameters); Vector spec; tmp.split(spec, "="); @@ -1850,7 +1859,6 @@ CommandInterpreter::executeEventReporting(int processId, void CommandInterpreter::executeStartBackup(char* /*parameters*/) { - connect(); struct ndb_mgm_reply reply; unsigned int backupId; @@ -1897,8 +1905,6 @@ CommandInterpreter::executeStartBackup(char* /*parameters*/) void CommandInterpreter::executeAbortBackup(char* parameters) { - connect(); - strtok(parameters, " "); struct ndb_mgm_reply reply; char* id = strtok(NULL, "\0"); @@ -1952,7 +1958,6 @@ CommandInterpreter::executeRep(char* parameters) return; } - connect(); char * line = my_strdup(parameters,MYF(MY_WME)); My_auto_ptr ap1((char*)line); char * firstToken = strtok(line, " "); diff --git a/ndb/src/mgmclient/main.cpp b/ndb/src/mgmclient/main.cpp index f32cc683296..08d5d60cfab 100644 --- a/ndb/src/mgmclient/main.cpp +++ b/ndb/src/mgmclient/main.cpp @@ -56,17 +56,18 @@ handler(int sig){ } } - +static const char default_prompt[]= "ndb_mgm> "; static unsigned _try_reconnect; static char *opt_connect_str= 0; +static const char *prompt= default_prompt; static struct my_option my_long_options[] = { NDB_STD_OPTS("ndb_mgm"), { "try-reconnect", 't', - "Specify number of retries for connecting to ndb_mgmd, default infinite", + "Specify number of tries for connecting to ndb_mgmd (0 = infinite)", (gptr*) &_try_reconnect, (gptr*) &_try_reconnect, 0, - GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, + GET_UINT, REQUIRED_ARG, 3, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} }; static void short_usage_sub(void) @@ -116,13 +117,13 @@ read_and_execute(int _try_reconnect) } #ifdef HAVE_READLINE /* Get a line from the user. */ - line_read = readline ("ndb_mgm> "); + line_read = readline (prompt); /* If the line has any text in it, save it on the history. */ if (line_read && *line_read) add_history (line_read); #else static char linebuffer[254]; - fputs("ndb_mgm> ", stdout); + fputs(prompt, stdout); linebuffer[sizeof(linebuffer)-1]=0; line_read = fgets(linebuffer, sizeof(linebuffer)-1, stdin); if (line_read == linebuffer) { @@ -155,12 +156,16 @@ int main(int argc, char** argv){ opt_connect_str= buf; } + if (!isatty(0)) + { + prompt= 0; + } + ndbout << "-- NDB Cluster -- Management Client --" << endl; - printf("Connecting to Management Server: %s\n", opt_connect_str ? opt_connect_str : "default"); signal(SIGPIPE, handler); - com = new Ndb_mgmclient(opt_connect_str); + com = new Ndb_mgmclient(opt_connect_str,1); while(read_and_execute(_try_reconnect)); delete com; diff --git a/ndb/src/mgmclient/ndb_mgmclient.hpp b/ndb/src/mgmclient/ndb_mgmclient.hpp index f6bcebc3896..ea592dfdf4e 100644 --- a/ndb/src/mgmclient/ndb_mgmclient.hpp +++ b/ndb/src/mgmclient/ndb_mgmclient.hpp @@ -21,7 +21,7 @@ class CommandInterpreter; class Ndb_mgmclient { public: - Ndb_mgmclient(const char*); + Ndb_mgmclient(const char*,int verbose=0); ~Ndb_mgmclient(); int execute(const char *_line, int _try_reconnect=-1); int execute(int argc, char** argv, int _try_reconnect=-1); From 59abcd447cc373c1c3dfc0184f12642aa6d2ab70 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 26 Nov 2004 13:16:37 +0200 Subject: [PATCH 0343/1063] srv0srv.c: srv_lock_timeout_and_monitor_thread(): write to srv_monitor_file only if --innodb_status_file=1 innobase/srv/srv0srv.c: srv_lock_timeout_and_monitor_thread(): write to srv_monitor_file only if --innodb_status_file=1 --- innobase/srv/srv0srv.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/innobase/srv/srv0srv.c b/innobase/srv/srv0srv.c index 0a814268a36..99a2db57d79 100644 --- a/innobase/srv/srv0srv.c +++ b/innobase/srv/srv0srv.c @@ -1617,11 +1617,13 @@ loop: srv_printf_innodb_monitor(stderr); } - mutex_enter(&srv_monitor_file_mutex); - rewind(srv_monitor_file); - srv_printf_innodb_monitor(srv_monitor_file); - os_file_set_eof(srv_monitor_file); - mutex_exit(&srv_monitor_file_mutex); + if (srv_innodb_status) { + mutex_enter(&srv_monitor_file_mutex); + rewind(srv_monitor_file); + srv_printf_innodb_monitor(srv_monitor_file); + os_file_set_eof(srv_monitor_file); + mutex_exit(&srv_monitor_file_mutex); + } if (srv_print_innodb_tablespace_monitor && difftime(current_time, last_table_monitor_time) > 60) { From b0d586e5648e78981c63e68059c6c836a228a082 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 26 Nov 2004 13:20:48 +0000 Subject: [PATCH 0344/1063] added error code message for 897 --- ndb/src/ndbapi/ndberror.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ndb/src/ndbapi/ndberror.c b/ndb/src/ndbapi/ndberror.c index bc49358cc63..6744f4c1640 100644 --- a/ndb/src/ndbapi/ndberror.c +++ b/ndb/src/ndbapi/ndberror.c @@ -241,11 +241,12 @@ ErrorBundle ErrorCodes[] = { { 877, AE, "877" }, { 878, AE, "878" }, { 879, AE, "879" }, + { 880, AE, "Tried to read too much - too many getValue calls" }, { 884, AE, "Stack overflow in interpreter" }, { 885, AE, "Stack underflow in interpreter" }, { 886, AE, "More than 65535 instructions executed in interpreter" }, + { 897, AE, "Update attempt of primary key via ndbcluster internal api (if this occurs via the MySQL server it is a bug, please report)" }, { 4256, AE, "Must call Ndb::init() before this function" }, - { 880, AE, "Tried to read too much - too many getValue calls" }, { 4257, AE, "Tried to read too much - too many getValue calls" }, /** From 346dce93c2a63757540ed15e660dd07d41f7f20d Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 27 Nov 2004 00:45:01 +0200 Subject: [PATCH 0345/1063] InnoDB: Make intermediate COMMITs in ALTER TABLE more robust (Bug #6633) innobase/include/lock0lock.h: Replaced lock_get_ix_table() with lock_get_table(). innobase/lock/lock0lock.c: Replaced lock_get_ix_table() with lock_get_table(). innobase/include/row0mysql.h: row_lock_table_for_mysql(): Added parameter mode. innobase/row/row0mysql.c: row_lock_table_for_mysql(): Added parameter mode. sql/ha_innodb.cc: ha_innobase::write_row(): Make ALTER TABLE commits more robust: account for conversions from non-InnoDB format, do not attempt to commit if there are other than a single IX or IS lock on the source table, and the source table is in InnoDB format. This prohibits intermediate commits for OPTIMIZE TABLE if the table contains an auto_increment field. --- innobase/include/lock0lock.h | 14 ++++++--- innobase/include/row0mysql.h | 4 ++- innobase/lock/lock0lock.c | 52 +++++++++++++++++++++++-------- innobase/row/row0mysql.c | 5 +-- sql/ha_innodb.cc | 60 ++++++++++++++++++++++++++++-------- 5 files changed, 102 insertions(+), 33 deletions(-) diff --git a/innobase/include/lock0lock.h b/innobase/include/lock0lock.h index f8435e14d97..fb44acc14f7 100644 --- a/innobase/include/lock0lock.h +++ b/innobase/include/lock0lock.h @@ -463,13 +463,17 @@ lock_rec_hash( ulint space, /* in: space */ ulint page_no);/* in: page number */ /************************************************************************* -Gets the table covered by an IX table lock. */ +Gets the table covered by an IX or IS table lock, if there are no +other locks on the table. */ dict_table_t* -lock_get_ix_table( -/*==============*/ - /* out: the table covered by the lock */ - lock_t* lock); /* in: table lock */ +lock_get_table( +/*===========*/ + /* out: the table covered by the lock, + or NULL if it is not an IX or IS table lock, + or there are other locks on the table */ + lock_t* lock, /* in: lock */ + ulint* mode); /* out: lock mode of table */ /************************************************************************* Checks that a transaction id is sensible, i.e., not in the future. */ diff --git a/innobase/include/row0mysql.h b/innobase/include/row0mysql.h index 73f41dea0da..f47ce74ce37 100644 --- a/innobase/include/row0mysql.h +++ b/innobase/include/row0mysql.h @@ -177,10 +177,12 @@ row_lock_table_for_mysql( /* out: error code or DB_SUCCESS */ row_prebuilt_t* prebuilt, /* in: prebuilt struct in the MySQL table handle */ - dict_table_t* table); /* in: table to LOCK_IX, or NULL + dict_table_t* table, /* in: table to lock, or NULL if prebuilt->table should be locked as LOCK_TABLE_EXP | prebuilt->select_lock_type */ + ulint mode); /* in: lock mode of table */ + /************************************************************************* Does an insert for MySQL. */ diff --git a/innobase/lock/lock0lock.c b/innobase/lock/lock0lock.c index 78a78c9dd95..d9a10eb60c0 100644 --- a/innobase/lock/lock0lock.c +++ b/innobase/lock/lock0lock.c @@ -395,19 +395,6 @@ lock_rec_get_nth_bit( return(ut_bit_get_nth(b, bit_index)); } -/************************************************************************* -Gets the table covered by an IX table lock. */ - -dict_table_t* -lock_get_ix_table( -/*==============*/ - /* out: the table covered by the lock */ - lock_t* lock) /* in: table lock */ -{ - ut_a(lock->type_mode == (LOCK_TABLE | LOCK_IX)); - return(lock->un_member.tab_lock.table); -} - /*************************************************************************/ #define lock_mutex_enter_kernel() mutex_enter(&kernel_mutex) @@ -614,6 +601,45 @@ lock_get_wait( return(FALSE); } +/************************************************************************* +Gets the table covered by an IX or IS table lock, if there are no +other locks on the table. */ + +dict_table_t* +lock_get_table( +/*===========*/ + /* out: the table covered by the lock, + or NULL if it is not an IX or IS table lock, + or there are other locks on the table */ + lock_t* lock, /* in: lock */ + ulint* mode) /* out: lock mode of table */ +{ + dict_table_t* table; + ulint lock_mode; + + table = NULL; + *mode = LOCK_NONE; + + if (lock_get_type(lock) != LOCK_TABLE) { + return(table); + } + + lock_mode = lock_get_mode(lock); + switch (lock_mode) { + case LOCK_IS: + case LOCK_IX: + *mode = lock_mode; + table = lock->un_member.tab_lock.table; + if (UT_LIST_GET_LEN(table->locks) != 1 || + UT_LIST_GET_FIRST(table->locks) != lock) { + /* We only support the case when + there is only one lock on this table. */ + table = NULL; + } + } + return(table); +} + /************************************************************************* Sets the wait flag of a lock and the back pointer in trx to lock. */ UNIV_INLINE diff --git a/innobase/row/row0mysql.c b/innobase/row/row0mysql.c index 9613da2e286..dec2b19559c 100644 --- a/innobase/row/row0mysql.c +++ b/innobase/row/row0mysql.c @@ -782,10 +782,11 @@ row_lock_table_for_mysql( /* out: error code or DB_SUCCESS */ row_prebuilt_t* prebuilt, /* in: prebuilt struct in the MySQL table handle */ - dict_table_t* table) /* in: table to LOCK_IX, or NULL + dict_table_t* table, /* in: table to lock, or NULL if prebuilt->table should be locked as LOCK_TABLE_EXP | prebuilt->select_lock_type */ + ulint mode) /* in: lock mode of table */ { trx_t* trx = prebuilt->trx; que_thr_t* thr; @@ -819,7 +820,7 @@ run_again: trx_start_if_not_started(trx); if (table) { - err = lock_table(0, table, LOCK_IX, thr); + err = lock_table(0, table, mode, thr); } else { err = lock_table(LOCK_TABLE_EXP, prebuilt->table, prebuilt->select_lock_type, thr); diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index 2515b4956d0..2aaf69bd208 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -2324,20 +2324,55 @@ ha_innobase::write_row( position in the source table need not be adjusted after the intermediate COMMIT, since writes by other transactions are being blocked by a MySQL table lock TL_WRITE_ALLOW_READ. */ - ut_a(prebuilt->trx->mysql_n_tables_locked == 2); - ut_a(UT_LIST_GET_LEN(prebuilt->trx->trx_locks) >= 2); - dict_table_t* table = lock_get_ix_table( - UT_LIST_GET_FIRST(prebuilt->trx->trx_locks)); + + dict_table_t* table; + ibool mode; + num_write_row = 0; + /* Commit the transaction. This will release the table locks, so they have to be acquired again. */ - innobase_commit(user_thd, prebuilt->trx); - /* Note that this transaction is still active. */ - user_thd->transaction.all.innodb_active_trans = 1; - /* Re-acquire the IX table lock on the source table. */ - row_lock_table_for_mysql(prebuilt, table); - /* We will need an IX lock on the destination table. */ - prebuilt->sql_stat_start = TRUE; + switch (prebuilt->trx->mysql_n_tables_locked) { + case 1: + /* Altering to InnoDB format */ + innobase_commit(user_thd, prebuilt->trx); + /* Note that this transaction is still active. */ + user_thd->transaction.all.innodb_active_trans = 1; + /* We will need an IX lock on the destination table. */ + prebuilt->sql_stat_start = TRUE; + break; + case 2: + /* Altering an InnoDB table */ + ut_a(UT_LIST_GET_LEN(prebuilt->trx->trx_locks) >= 2); + table = lock_get_table( + UT_LIST_GET_FIRST(prebuilt->trx->trx_locks), + &mode); + if (!table) { + goto no_commit; + } + + /* Commit the transaction. This will release the table + locks, so they have to be acquired again. */ + innobase_commit(user_thd, prebuilt->trx); + /* Note that this transaction is still active. */ + user_thd->transaction.all.innodb_active_trans = 1; + /* Re-acquire the table lock on the source table. */ + row_lock_table_for_mysql(prebuilt, table, mode); + /* We will need an IX lock on the destination table. */ + prebuilt->sql_stat_start = TRUE; + break; + default: + no_commit: + /* Unknown situation: do nothing (no commit) */ + /* + ut_print_timestamp(stderr); + fprintf(stderr, + " InnoDB error: ALTER TABLE is holding lock" + " on %lu tables!\n", + prebuilt->trx->mysql_n_tables_locked); + */ + break; + } } num_write_row++; @@ -5015,7 +5050,8 @@ ha_innobase::external_lock( if (thd->in_lock_tables && thd->variables.innodb_table_locks) { ulint error; - error = row_lock_table_for_mysql(prebuilt, 0); + error = row_lock_table_for_mysql(prebuilt, + NULL, LOCK_TABLE_EXP); if (error != DB_SUCCESS) { error = convert_error_code_to_mysql( From 8f60d95ce34ba15c72bfbf4b1a46e0c7ac17a378 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 28 Nov 2004 15:45:12 +0100 Subject: [PATCH 0346/1063] configure.in: A work-around for SCO, disable use of clock_gettime configure.in: A work-around for SCO, disable use of clock_gettime --- configure.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 1fcba6b8f5f..0d6e797f571 100644 --- a/configure.in +++ b/configure.in @@ -1931,9 +1931,11 @@ AC_CHECK_FUNCS(alarm bcmp bfill bmove bzero chsize cuserid fchmod fcntl \ # # case "$target" in - *-*-aix4*) + *-*-aix4* | *-*-sco*) # (grr) aix 4.3 has a stub for clock_gettime, (returning ENOSYS) # and using AC_TRY_RUN is hard when cross-compiling + # We also disable for SCO for the time being, the headers for the + # thread library we use conflicts with other headers. ;; *) AC_CHECK_FUNCS(clock_gettime) ;; From 1a7783e0f6fd2bbb0cfe9705184d58dab389e606 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 28 Nov 2004 16:31:14 +0100 Subject: [PATCH 0347/1063] skip last compress test if we're short of RAM --- mysql-test/r/func_compress.result | 4 ++-- mysql-test/t/func_compress.test | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/mysql-test/r/func_compress.result b/mysql-test/r/func_compress.result index 11dbcca9431..9bc8e417e19 100644 --- a/mysql-test/r/func_compress.result +++ b/mysql-test/r/func_compress.result @@ -69,6 +69,6 @@ Error 1259 ZLIB: Input data corrupted Error 1256 Uncompressed data size too large; the maximum size is 1048576 (probably, length of uncompressed data was corrupted) drop table t1; set @@max_allowed_packet=1048576*100; -select compress(repeat('aaaaaaaaaa', 10000000)) is null; -compress(repeat('aaaaaaaaaa', 10000000)) is null +select compress(repeat('aaaaaaaaaa', IF(XXX, 10, 10000000))) is null; +compress(repeat('aaaaaaaaaa', IF(XXX, 10, 10000000))) is null 0 diff --git a/mysql-test/t/func_compress.test b/mysql-test/t/func_compress.test index 7b70289d2c0..f46589e9e0e 100644 --- a/mysql-test/t/func_compress.test +++ b/mysql-test/t/func_compress.test @@ -38,7 +38,10 @@ drop table t1; # # Bug #5497: a problem with large strings +# note that when LOW_MEMORY is set the "test" below is meaningless # set @@max_allowed_packet=1048576*100; -select compress(repeat('aaaaaaaaaa', 10000000)) is null; +--replace_result "''" XXX "'1'" XXX +eval select compress(repeat('aaaaaaaaaa', IF('$LOW_MEMORY', 10, 10000000))) is null; + From 5607539c5b5dee4809e8e370527d3542387e27a4 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 28 Nov 2004 17:06:40 +0100 Subject: [PATCH 0348/1063] bad merge fixed --- mysql-test/r/rpl_start_stop_slave.result | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/rpl_start_stop_slave.result b/mysql-test/r/rpl_start_stop_slave.result index 1b4d87124d1..1fcb586d1fb 100644 --- a/mysql-test/r/rpl_start_stop_slave.result +++ b/mysql-test/r/rpl_start_stop_slave.result @@ -1,9 +1,9 @@ -slave stop; +stop slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -slave start; +start slave; stop slave; create table t1(n int); start slave; From 1b898a22460a369b8ca21f573973a8a0518e85d4 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 28 Nov 2004 19:48:41 +0100 Subject: [PATCH 0349/1063] post-merge fix --- mysql-test/r/select.result | 62 +++++++++++++------------------------- mysql-test/t/select.test | 2 -- 2 files changed, 21 insertions(+), 43 deletions(-) diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result index 79af86777dc..a05b379ed88 100644 --- a/mysql-test/r/select.result +++ b/mysql-test/r/select.result @@ -2353,6 +2353,27 @@ select * from t2,t3 where t2.s = t3.s; s s two two drop table t1, t2, t3; +create table t1 (a integer, b integer, index(a), index(b)); +create table t2 (c integer, d integer, index(c), index(d)); +insert into t1 values (1,2), (2,2), (3,2), (4,2); +insert into t2 values (1,3), (2,3), (3,4), (4,4); +explain select * from t1 left join t2 on a=c where d in (4); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ref c,d d 5 const 2 Using where +1 SIMPLE t1 ALL a NULL NULL NULL 3 Using where +select * from t1 left join t2 on a=c where d in (4); +a b c d +3 2 3 4 +4 2 4 4 +explain select * from t1 left join t2 on a=c where d = 4; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ref c,d d 5 const 2 Using where +1 SIMPLE t1 ALL a NULL NULL NULL 3 Using where +select * from t1 left join t2 on a=c where d = 4; +a b c d +3 2 3 4 +4 2 4 4 +drop table t1, t2; CREATE TABLE t1 ( i int(11) NOT NULL default '0', c char(10) NOT NULL default '', @@ -2365,45 +2386,4 @@ INSERT INTO t1 VALUES (3,'c'); EXPLAIN SELECT i FROM t1 WHERE i=1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1 Using index -EXPLAIN SELECT i FROM t1 WHERE i=1; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1 Using index -DROP TABLE t1; -create table t1 (a integer, b integer, index(a), index(b)); -create table t2 (c integer, d integer, index(c), index(d)); -insert into t1 values (1,2), (2,2), (3,2), (4,2); -insert into t2 values (1,3), (2,3), (3,4), (4,4); -explain select * from t1 left join t2 on a=c where d in (4); -table type possible_keys key key_len ref rows Extra -t2 ref c,d d 5 const 2 Using where -t1 ALL a NULL NULL NULL 3 Using where -select * from t1 left join t2 on a=c where d in (4); -a b c d -3 2 3 4 -4 2 4 4 -explain select * from t1 left join t2 on a=c where d = 4; -table type possible_keys key key_len ref rows Extra -t2 ref c,d d 5 const 2 Using where -t1 ALL a NULL NULL NULL 3 Using where -select * from t1 left join t2 on a=c where d = 4; -a b c d -3 2 3 4 -4 2 4 4 -drop table t1, t2; -CREATE TABLE t1 ( -i int(11) NOT NULL default '0', -c char(10) NOT NULL default '', -PRIMARY KEY (i), -UNIQUE KEY c (c) -) TYPE=MyISAM; -INSERT INTO t1 VALUES (1,'a'); -INSERT INTO t1 VALUES (2,'b'); -INSERT INTO t1 VALUES (3,'c'); -EXPLAIN SELECT i FROM t1 WHERE i=1; -table type possible_keys key key_len ref rows Extra -t1 const PRIMARY PRIMARY 4 const 1 Using index -EXPLAIN SELECT i FROM t1 WHERE i=1; -table type possible_keys key key_len ref rows Extra -t1 const PRIMARY PRIMARY 4 const 1 Using index ->>>>>>> DROP TABLE t1; diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test index 84aab132503..9bbd26a9c1c 100644 --- a/mysql-test/t/select.test +++ b/mysql-test/t/select.test @@ -1929,6 +1929,4 @@ INSERT INTO t1 VALUES (3,'c'); EXPLAIN SELECT i FROM t1 WHERE i=1; -EXPLAIN SELECT i FROM t1 WHERE i=1; - DROP TABLE t1; From f0af808fccf656febcfb884047aa465bd5b005be Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 28 Nov 2004 22:28:36 +0100 Subject: [PATCH 0350/1063] Fix for Bug #6794 Wrong outcome of update operation of ndb table --- mysql-test/r/ndb_update.result | 12 ++++++++++++ mysql-test/t/ndb_update.test | 22 ++++++++++++++++++++++ sql/sql_update.cc | 3 ++- 3 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 mysql-test/r/ndb_update.result create mode 100644 mysql-test/t/ndb_update.test diff --git a/mysql-test/r/ndb_update.result b/mysql-test/r/ndb_update.result new file mode 100644 index 00000000000..829e722faaa --- /dev/null +++ b/mysql-test/r/ndb_update.result @@ -0,0 +1,12 @@ +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 ( +pk1 INT NOT NULL PRIMARY KEY, +b INT NOT NULL, +c INT NOT NULL +) ENGINE=ndbcluster; +INSERT INTO t1 VALUES (0, 0, 0),(1,1,1); +UPDATE t1 set b = c; +select * from t1 order by pk1; +pk1 b c +0 0 0 +1 1 1 diff --git a/mysql-test/t/ndb_update.test b/mysql-test/t/ndb_update.test new file mode 100644 index 00000000000..186e4a99ad3 --- /dev/null +++ b/mysql-test/t/ndb_update.test @@ -0,0 +1,22 @@ +-- source include/have_ndb.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +# +# Basic test of INSERT in NDB +# + +# +# Create a normal table with primary key +# +CREATE TABLE t1 ( + pk1 INT NOT NULL PRIMARY KEY, + b INT NOT NULL, + c INT NOT NULL +) ENGINE=ndbcluster; + +INSERT INTO t1 VALUES (0, 0, 0),(1,1,1); +UPDATE t1 set b = c; +select * from t1 order by pk1; diff --git a/sql/sql_update.cc b/sql/sql_update.cc index d3597f274dc..7bcf9440bec 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -110,7 +110,8 @@ int mysql_update(THD *thd, #ifndef NO_EMBEDDED_ACCESS_CHECKS table->grant.want_privilege=want_privilege; #endif - if (setup_fields(thd, 0, update_table_list, fields, 1, 0, 0)) + if (setup_fields(thd, 0, update_table_list, fields, 1, 0, 0) || + setup_fields(thd, 0, update_table_list, values, 1, 0, 0)) DBUG_RETURN(-1); /* purecov: inspected */ if (table->timestamp_field) { From 6f2e694df0b59e21ca3a40400eea8f35bd05d90f Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 28 Nov 2004 22:33:01 +0100 Subject: [PATCH 0351/1063] Added better test for Bug #6794 Wrong outcome of update operation of ndb table --- mysql-test/r/ndb_update.result | 7 ++++--- mysql-test/t/ndb_update.test | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/mysql-test/r/ndb_update.result b/mysql-test/r/ndb_update.result index 829e722faaa..5df5c861cfb 100644 --- a/mysql-test/r/ndb_update.result +++ b/mysql-test/r/ndb_update.result @@ -4,9 +4,10 @@ pk1 INT NOT NULL PRIMARY KEY, b INT NOT NULL, c INT NOT NULL ) ENGINE=ndbcluster; -INSERT INTO t1 VALUES (0, 0, 0),(1,1,1); +INSERT INTO t1 VALUES (0, 0, 1),(1,1,2),(2,2,3); UPDATE t1 set b = c; select * from t1 order by pk1; pk1 b c -0 0 0 -1 1 1 +0 1 1 +1 2 2 +2 3 3 diff --git a/mysql-test/t/ndb_update.test b/mysql-test/t/ndb_update.test index 186e4a99ad3..3b0e84e2344 100644 --- a/mysql-test/t/ndb_update.test +++ b/mysql-test/t/ndb_update.test @@ -17,6 +17,6 @@ CREATE TABLE t1 ( c INT NOT NULL ) ENGINE=ndbcluster; -INSERT INTO t1 VALUES (0, 0, 0),(1,1,1); +INSERT INTO t1 VALUES (0, 0, 1),(1,1,2),(2,2,3); UPDATE t1 set b = c; select * from t1 order by pk1; From 7ea16212077eb53bdc8161af1d132deae8f030ff Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 29 Nov 2004 06:51:30 +0300 Subject: [PATCH 0352/1063] Fix and testcase for BUG#6699 myisam/mi_rnext_same.c: Fix for BUG#6699: MERGE handler now uses mi_rnext_same() with priority queue, so skip record unpacking if buf==NULL myisammrg/myrg_rnext_same.c: Fix for BUG#6699: make myrg_rnext_same sort always sort records and return them in key order. mysql-test/r/merge.result: Test for BUG#6699 mysql-test/t/merge.test: Test for BUG#6699 --- myisam/mi_rnext_same.c | 4 ++++ myisammrg/myrg_rnext_same.c | 33 ++++++++++++++++++++++----------- mysql-test/r/merge.result | 25 +++++++++++++++++++++++++ mysql-test/t/merge.test | 18 ++++++++++++++++++ 4 files changed, 69 insertions(+), 11 deletions(-) diff --git a/myisam/mi_rnext_same.c b/myisam/mi_rnext_same.c index 1342718d6aa..a50c578e081 100644 --- a/myisam/mi_rnext_same.c +++ b/myisam/mi_rnext_same.c @@ -88,6 +88,10 @@ int mi_rnext_same(MI_INFO *info, byte *buf) if (my_errno == HA_ERR_KEY_NOT_FOUND) my_errno=HA_ERR_END_OF_FILE; } + else if (!buf) + { + DBUG_RETURN(info->lastpos==HA_OFFSET_ERROR ? my_errno : 0); + } else if (!(*info->read_record)(info,info->lastpos,buf)) { info->update|= HA_STATE_AKTIV; /* Record is read */ diff --git a/myisammrg/myrg_rnext_same.c b/myisammrg/myrg_rnext_same.c index b569459b77d..997e4100acd 100644 --- a/myisammrg/myrg_rnext_same.c +++ b/myisammrg/myrg_rnext_same.c @@ -16,25 +16,36 @@ #include "myrg_def.h" + int myrg_rnext_same(MYRG_INFO *info, byte *buf) { - uint err; + int err; MI_INFO *mi; if (!info->current_table) return (HA_ERR_KEY_NOT_FOUND); - err=mi_rnext_same(info->current_table->table,buf); - if (err == HA_ERR_END_OF_FILE) + /* at first, do rnext for the table found before */ + if ((err=mi_rnext_same(info->current_table->table,NULL))) { - queue_remove(&(info->by_key),0); - if (!info->by_key.elements) - return HA_ERR_END_OF_FILE; - - mi=(info->current_table=(MYRG_TABLE *)queue_top(&(info->by_key)))->table; - mi->once_flags|= RRND_PRESERVE_LASTINX; - return mi_rrnd(mi,buf,mi->lastpos); + if (err == HA_ERR_END_OF_FILE) + { + queue_remove(&(info->by_key),0); + if (!info->by_key.elements) + return HA_ERR_END_OF_FILE; + } + else + return err; } - return err; + else + { + /* Found here, adding to queue */ + queue_top(&(info->by_key))=(byte *)(info->current_table); + queue_replaced(&(info->by_key)); + } + + /* now, mymerge's read_next is as simple as one queue_top */ + mi=(info->current_table=(MYRG_TABLE *)queue_top(&(info->by_key)))->table; + return _myrg_mi_read_record(mi,buf); } diff --git a/mysql-test/r/merge.result b/mysql-test/r/merge.result index 5755033190b..f71626221cb 100644 --- a/mysql-test/r/merge.result +++ b/mysql-test/r/merge.result @@ -651,3 +651,28 @@ ERROR HY000: You can't specify target table 't1' for update in FROM clause create table t3 engine=merge union=(t1, t2) select * from t2; ERROR HY000: You can't specify target table 't2' for update in FROM clause drop table t1, t2; +create table t1 (a int,b int,c int, index (a,b,c)); +create table t2 (a int,b int,c int, index (a,b,c)); +create table t3 (a int,b int,c int, index (a,b,c)) +engine=merge union=(t1 ,t2); +insert into t1 (a,b,c) values (1,1,0),(1,2,0); +insert into t2 (a,b,c) values (1,1,1),(1,2,1); +explain select a,b,c from t3 force index (a) where a=1 order by a,b,c; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t3 ref a a 5 const 2 Using where; Using index +select a,b,c from t3 force index (a) where a=1 order by a,b,c; +a b c +1 1 0 +1 1 1 +1 2 0 +1 2 1 +explain select a,b,c from t3 force index (a) where a=1 order by a desc, b desc, c desc; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t3 ref a a 5 const 2 Using where; Using index +select a,b,c from t3 force index (a) where a=1 order by a desc, b desc, c desc; +a b c +1 2 1 +1 2 0 +1 1 1 +1 1 0 +drop table t1, t2, t3; diff --git a/mysql-test/t/merge.test b/mysql-test/t/merge.test index 9580c1ab44c..b628cb07f7b 100644 --- a/mysql-test/t/merge.test +++ b/mysql-test/t/merge.test @@ -285,3 +285,21 @@ create table t3 engine=merge union=(t1, t2) select * from t1; --error 1093 create table t3 engine=merge union=(t1, t2) select * from t2; drop table t1, t2; + +# BUG#6699 : no sorting on 'ref' retrieval +create table t1 (a int,b int,c int, index (a,b,c)); +create table t2 (a int,b int,c int, index (a,b,c)); +create table t3 (a int,b int,c int, index (a,b,c)) + engine=merge union=(t1 ,t2); +insert into t1 (a,b,c) values (1,1,0),(1,2,0); +insert into t2 (a,b,c) values (1,1,1),(1,2,1); + +explain select a,b,c from t3 force index (a) where a=1 order by a,b,c; +select a,b,c from t3 force index (a) where a=1 order by a,b,c; + +# this actually wasn't affected: +explain select a,b,c from t3 force index (a) where a=1 order by a desc, b desc, c desc; +select a,b,c from t3 force index (a) where a=1 order by a desc, b desc, c desc; + +drop table t1, t2, t3; + From d212891f6f0c0de275190f52672f3346979e07c0 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 29 Nov 2004 09:00:39 +0100 Subject: [PATCH 0353/1063] ndb - scan bug fix + more test cases ndb/include/ndbapi/NdbScanOperation.hpp: Improved doc. a bit ndb/src/ndbapi/NdbConnectionScan.cpp: Set error code ndb/src/ndbapi/NdbScanOperation.cpp: Check error directly after taking mutex ndb/test/ndbapi/testScan.cpp: new scan test with lots of threads ndb/test/run-test/daily-basic-tests.txt: Added two more scan tests Collapsed testTransactions & testOperations --- ndb/include/ndbapi/NdbScanOperation.hpp | 11 +- ndb/src/ndbapi/NdbConnectionScan.cpp | 2 +- ndb/src/ndbapi/NdbScanOperation.cpp | 35 +- ndb/test/ndbapi/testScan.cpp | 130 ++++++- ndb/test/run-test/daily-basic-tests.txt | 496 +----------------------- 5 files changed, 172 insertions(+), 502 deletions(-) diff --git a/ndb/include/ndbapi/NdbScanOperation.hpp b/ndb/include/ndbapi/NdbScanOperation.hpp index 2e4d173ac75..5689b62526c 100644 --- a/ndb/include/ndbapi/NdbScanOperation.hpp +++ b/ndb/include/ndbapi/NdbScanOperation.hpp @@ -127,14 +127,23 @@ protected: NdbReceiver** m_receivers; // All receivers Uint32* m_prepared_receivers; // These are to be sent - + + /** + * owned by API/user thread + */ Uint32 m_current_api_receiver; Uint32 m_api_receivers_count; NdbReceiver** m_api_receivers; // These are currently used by api + /** + * owned by receiver thread + */ Uint32 m_conf_receivers_count; // NOTE needs mutex to access NdbReceiver** m_conf_receivers; // receive thread puts them here + /** + * owned by receiver thread + */ Uint32 m_sent_receivers_count; // NOTE needs mutex to access NdbReceiver** m_sent_receivers; // receive thread puts them here diff --git a/ndb/src/ndbapi/NdbConnectionScan.cpp b/ndb/src/ndbapi/NdbConnectionScan.cpp index a1a220caacf..b0c546c512a 100644 --- a/ndb/src/ndbapi/NdbConnectionScan.cpp +++ b/ndb/src/ndbapi/NdbConnectionScan.cpp @@ -56,7 +56,7 @@ NdbConnection::receiveSCAN_TABREF(NdbApiSignal* aSignal){ const ScanTabRef * ref = CAST_CONSTPTR(ScanTabRef, aSignal->getDataPtr()); if(checkState_TransId(&ref->transId1)){ - theScanningOp->theError.code = ref->errorCode; + theScanningOp->setErrorCode(ref->errorCode); theScanningOp->execCLOSE_SCAN_REP(); if(!ref->closeNeeded){ return 0; diff --git a/ndb/src/ndbapi/NdbScanOperation.cpp b/ndb/src/ndbapi/NdbScanOperation.cpp index 282b831f8fd..6eb5167e385 100644 --- a/ndb/src/ndbapi/NdbScanOperation.cpp +++ b/ndb/src/ndbapi/NdbScanOperation.cpp @@ -277,9 +277,9 @@ NdbScanOperation::fix_receivers(Uint32 parallel){ void NdbScanOperation::receiver_delivered(NdbReceiver* tRec){ if(theError.code == 0){ - if(DEBUG_NEXT_RESULT) - ndbout_c("receiver_delivered"); - + if(DEBUG_NEXT_RESULT) + ndbout_c("receiver_delivered"); + Uint32 idx = tRec->m_list_index; Uint32 last = m_sent_receivers_count - 1; if(idx != last){ @@ -492,6 +492,9 @@ int NdbScanOperation::nextResult(bool fetchAllowed) Uint32 nodeId = theNdbCon->theDBnode; TransporterFacade* tp = TransporterFacade::instance(); Guard guard(tp->theMutexPtr); + if(theError.code) + return -1; + Uint32 seq = theNdbCon->theNodeSequence; if(seq == tp->getNodeSequence(nodeId) && send_next_scan(idx, false) == 0){ @@ -685,10 +688,8 @@ void NdbScanOperation::closeScan() void NdbScanOperation::execCLOSE_SCAN_REP(){ - m_api_receivers_count = 0; m_conf_receivers_count = 0; m_sent_receivers_count = 0; - m_current_api_receiver = m_ordered ? theParallelism : 0; } void NdbScanOperation::release() @@ -1333,6 +1334,8 @@ NdbIndexScanOperation::next_result_ordered(bool fetchAllowed){ if(DEBUG_NEXT_RESULT) ndbout_c("performing fetch..."); TransporterFacade* tp = TransporterFacade::instance(); Guard guard(tp->theMutexPtr); + if(theError.code) + return -1; Uint32 seq = theNdbCon->theNodeSequence; Uint32 nodeId = theNdbCon->theDBnode; if(seq == tp->getNodeSequence(nodeId) && !send_next_scan_ordered(s_idx)){ @@ -1346,6 +1349,13 @@ NdbIndexScanOperation::next_result_ordered(bool fetchAllowed){ continue; } if(DEBUG_NEXT_RESULT) ndbout_c("return -1"); + setErrorCode(4028); + return -1; + } + + if(theError.code){ + setErrorCode(theError.code); + if(DEBUG_NEXT_RESULT) ndbout_c("return -1"); return -1; } @@ -1355,11 +1365,9 @@ NdbIndexScanOperation::next_result_ordered(bool fetchAllowed){ memcpy(arr, m_conf_receivers, u_last * sizeof(char*)); if(DEBUG_NEXT_RESULT) ndbout_c("sent: %d recv: %d", tmp, u_last); - if(theError.code){ - setErrorCode(theError.code); - if(DEBUG_NEXT_RESULT) ndbout_c("return -1"); - return -1; - } + } else { + setErrorCode(4028); + return -1; } } else { if(DEBUG_NEXT_RESULT) ndbout_c("return 2"); @@ -1497,6 +1505,13 @@ NdbScanOperation::close_impl(TransporterFacade* tp){ } } + if(theError.code) + { + m_api_receivers_count = 0; + m_current_api_receiver = m_ordered ? theParallelism : 0; + } + + /** * move all conf'ed into api * so that send_next_scan can check if they needs to be closed diff --git a/ndb/test/ndbapi/testScan.cpp b/ndb/test/ndbapi/testScan.cpp index 51913e8fbf9..22ec3fff327 100644 --- a/ndb/test/ndbapi/testScan.cpp +++ b/ndb/test/ndbapi/testScan.cpp @@ -90,11 +90,59 @@ int runLoadAllTables(NDBT_Context* ctx, NDBT_Step* step){ return NDBT_OK; } +char orderedPkIdxName[255]; + +int createOrderedPkIndex(NDBT_Context* ctx, NDBT_Step* step){ + + const NdbDictionary::Table* pTab = ctx->getTab(); + Ndb* pNdb = GETNDB(step); + + // Create index + BaseString::snprintf(orderedPkIdxName, sizeof(orderedPkIdxName), + "IDC_O_PK_%s", pTab->getName()); + NdbDictionary::Index pIdx(orderedPkIdxName); + pIdx.setTable(pTab->getName()); + pIdx.setType(NdbDictionary::Index::OrderedIndex); + pIdx.setLogging(false); + + for (int c = 0; c< pTab->getNoOfColumns(); c++){ + const NdbDictionary::Column * col = pTab->getColumn(c); + if(col->getPrimaryKey()){ + pIdx.addIndexColumn(col->getName()); + } + } + + if (pNdb->getDictionary()->createIndex(pIdx) != 0){ + ndbout << "FAILED! to create index" << endl; + const NdbError err = pNdb->getDictionary()->getNdbError(); + ERR(err); + return NDBT_FAILED; + } + + return NDBT_OK; +} + +int createOrderedPkIndex_Drop(NDBT_Context* ctx, NDBT_Step* step){ + const NdbDictionary::Table* pTab = ctx->getTab(); + Ndb* pNdb = GETNDB(step); + + // Drop index + if (pNdb->getDictionary()->dropIndex(orderedPkIdxName, + pTab->getName()) != 0){ + ndbout << "FAILED! to drop index" << endl; + ERR(pNdb->getDictionary()->getNdbError()); + return NDBT_FAILED; + } + + return NDBT_OK; +} + + int runScanReadRandomTable(NDBT_Context* ctx, NDBT_Step* step){ int loops = ctx->getNumLoops(); int records = ctx->getNumRecords(); int parallelism = ctx->getProperty("Parallelism", 240); - int abort = ctx->getProperty("AbortProb"); + int abort = ctx->getProperty("AbortProb", 5); int i = 0; while (igetNumLoops(); int records = ctx->getNumRecords(); int parallelism = ctx->getProperty("Parallelism", 240); - int abort = ctx->getProperty("AbortProb"); + int abort = ctx->getProperty("AbortProb", 5); int i = 0; HugoTransactions hugoTrans(*ctx->getTab()); @@ -232,11 +280,58 @@ int runScanRead(NDBT_Context* ctx, NDBT_Step* step){ return NDBT_OK; } +int runRandScanRead(NDBT_Context* ctx, NDBT_Step* step){ + int loops = ctx->getNumLoops(); + int records = ctx->getNumRecords(); + int parallelism = ctx->getProperty("Parallelism", 240); + int abort = ctx->getProperty("AbortProb", 5); + + int i = 0; + HugoTransactions hugoTrans(*ctx->getTab()); + while (iisTestStopped()) { + g_info << i << ": "; + NdbOperation::LockMode lm = (NdbOperation::LockMode)(rand() % 3); + if (hugoTrans.scanReadRecords(GETNDB(step), + records, abort, parallelism, + lm) != 0){ + return NDBT_FAILED; + } + i++; + } + return NDBT_OK; +} + +int runScanReadIndex(NDBT_Context* ctx, NDBT_Step* step){ + int loops = ctx->getNumLoops(); + int records = ctx->getNumRecords(); + int parallelism = ctx->getProperty("Parallelism", 240); + int abort = ctx->getProperty("AbortProb", 5); + const NdbDictionary::Index * pIdx = + GETNDB(step)->getDictionary()->getIndex(orderedPkIdxName, + ctx->getTab()->getName()); + + int i = 0; + HugoTransactions hugoTrans(*ctx->getTab()); + while (pIdx && iisTestStopped()) { + g_info << i << ": "; + bool sort = (rand() % 100) > 50 ? true : false; + NdbOperation::LockMode lm = (NdbOperation::LockMode)(rand() % 3); + if (hugoTrans.scanReadRecords(GETNDB(step), pIdx, + records, abort, parallelism, + lm, + sort) != 0){ + return NDBT_FAILED; + } + i++; + } + return NDBT_OK; +} + int runScanReadCommitted(NDBT_Context* ctx, NDBT_Step* step){ int loops = ctx->getNumLoops(); int records = ctx->getNumRecords(); int parallelism = ctx->getProperty("Parallelism", 240); - int abort = ctx->getProperty("AbortProb"); + int abort = ctx->getProperty("AbortProb", 5); int i = 0; HugoTransactions hugoTrans(*ctx->getTab()); @@ -425,7 +520,7 @@ int runScanUpdate(NDBT_Context* ctx, NDBT_Step* step){ int loops = ctx->getNumLoops(); int records = ctx->getNumRecords(); int parallelism = ctx->getProperty("Parallelism", 1); - int abort = ctx->getProperty("AbortProb"); + int abort = ctx->getProperty("AbortProb", 5); int i = 0; HugoTransactions hugoTrans(*ctx->getTab()); while (igetNumLoops(); int records = ctx->getNumRecords(); int parallelism = ctx->getProperty("Parallelism", 240); - int abort = ctx->getProperty("AbortProb"); + int abort = ctx->getProperty("AbortProb", 5); int i = 0; HugoTransactions hugoTrans(*ctx->getTab()); while (i Date: Mon, 29 Nov 2004 08:06:53 +0000 Subject: [PATCH 0354/1063] ndb_grant.later: Rename: mysql-test/t/ndb_grant.test -> mysql-test/t/ndb_grant.later mysql-test/t/ndb_grant.later: Rename: mysql-test/t/ndb_grant.test -> mysql-test/t/ndb_grant.later --- mysql-test/t/{ndb_grant.test => ndb_grant.later} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename mysql-test/t/{ndb_grant.test => ndb_grant.later} (100%) diff --git a/mysql-test/t/ndb_grant.test b/mysql-test/t/ndb_grant.later similarity index 100% rename from mysql-test/t/ndb_grant.test rename to mysql-test/t/ndb_grant.later From f03c61cdd45df07da483178899e0d7fe09432584 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 29 Nov 2004 10:24:40 +0100 Subject: [PATCH 0355/1063] rpl_start_stop_slave.result: Syntax change between 4.0 and 4.1. mysql-test/r/rpl_start_stop_slave.result: Syntax change. --- mysql-test/r/rpl_start_stop_slave.result | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/rpl_start_stop_slave.result b/mysql-test/r/rpl_start_stop_slave.result index 1b4d87124d1..1fcb586d1fb 100644 --- a/mysql-test/r/rpl_start_stop_slave.result +++ b/mysql-test/r/rpl_start_stop_slave.result @@ -1,9 +1,9 @@ -slave stop; +stop slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -slave start; +start slave; stop slave; create table t1(n int); start slave; From 3d3ad211d8dbe1789f0888dc1a34181f27e19726 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 29 Nov 2004 15:14:43 +0000 Subject: [PATCH 0356/1063] aligned backup errorcodes with rest of ndb error codes giving it range from 1300 added new error type "configuration or application error" Added check if backup is issued during diskless mode, backup refuse returned added possibility to get error code as a result from management client addded possibility to set connecstring with CONNECT command changed to use strcasecmp instead of strcmp added possibility to run one command on cammand client to ndb_mgm and get an errorcode of command fails made thread safe veriosn of getErrorText in management server aligned backup errorcodes with rest of ndb error codes giving it range from 1300 print error message from regular ndberror struct added new arrer type "cofiguration or application error" commented on allocaded ranges for errors ndb/include/kernel/signaldata/BackupImpl.hpp: aligned backup errorcodes with rest of ndb error codes giving it range from 1300 ndb/include/kernel/signaldata/BackupSignalData.hpp: aligned backup errorcodes with rest of ndb error codes giving it range from 1300 ndb/include/ndbapi/ndberror.h: added new error type "configuration or application error" ndb/src/kernel/blocks/backup/Backup.cpp: Added check if backup is issued during diskless mode, backup refuse returned ndb/src/kernel/blocks/backup/Backup.hpp: member variable in backup block to indicate diskless or not ndb/src/kernel/blocks/backup/BackupInit.cpp: Added check if backup is issued during diskless mode, backup refuse returned ndb/src/mgmclient/CommandInterpreter.cpp: added possibility to get error code as a result from management client addded possibility to set connecstring with CONNECT command changed to use strcasecmp instead of strcmp ndb/src/mgmclient/main.cpp: added possibility to run one command on cammand client to ndb_mgm and get an errorcode of command fails ndb/src/mgmclient/ndb_mgmclient.hpp: added possibility to get error code as a result from management client ndb/src/mgmsrv/CommandInterpreter.cpp: made thread safe veriosn of getErrorText in management server ndb/src/mgmsrv/CommandInterpreter.hpp: made thread safe veriosn of getErrorText in management server ndb/src/mgmsrv/MgmtSrvr.cpp: aligned backup errorcodes with rest of ndb error codes giving it range from 1300 print error message from regular ndberror struct ndb/src/mgmsrv/MgmtSrvr.hpp: made thread safe veriosn of getErrorText in management server ndb/src/mgmsrv/Services.cpp: made thread safe veriosn of getErrorText in management server ndb/src/mgmsrv/Services.hpp: made thread safe veriosn of getErrorText in management server ndb/src/ndbapi/ndberror.c: added new arrer type "cofiguration or application error" commented on allocaded ranges for errors aligned backup errors with rest of errors --- ndb/include/kernel/signaldata/BackupImpl.hpp | 18 +- .../kernel/signaldata/BackupSignalData.hpp | 27 +- ndb/include/ndbapi/ndberror.h | 3 +- ndb/src/kernel/blocks/backup/Backup.cpp | 7 + ndb/src/kernel/blocks/backup/Backup.hpp | 1 + ndb/src/kernel/blocks/backup/BackupInit.cpp | 1 + ndb/src/mgmclient/CommandInterpreter.cpp | 236 ++++++++++-------- ndb/src/mgmclient/main.cpp | 23 +- ndb/src/mgmclient/ndb_mgmclient.hpp | 4 +- ndb/src/mgmsrv/CommandInterpreter.cpp | 47 ++-- ndb/src/mgmsrv/CommandInterpreter.hpp | 3 + ndb/src/mgmsrv/MgmtSrvr.cpp | 27 +- ndb/src/mgmsrv/MgmtSrvr.hpp | 2 +- ndb/src/mgmsrv/Services.cpp | 34 +-- ndb/src/mgmsrv/Services.hpp | 3 + ndb/src/ndbapi/ndberror.c | 53 ++++ 16 files changed, 295 insertions(+), 194 deletions(-) diff --git a/ndb/include/kernel/signaldata/BackupImpl.hpp b/ndb/include/kernel/signaldata/BackupImpl.hpp index 1872069daa7..2ac91570aad 100644 --- a/ndb/include/kernel/signaldata/BackupImpl.hpp +++ b/ndb/include/kernel/signaldata/BackupImpl.hpp @@ -78,15 +78,15 @@ public: STATIC_CONST( SignalLength = 3 ); enum ErrorCode { - Undefined = 200, - FailedToAllocateBuffers = 202, - FailedToSetupFsBuffers = 203, - FailedToAllocateTables = 204, - FailedInsertFileHeader = 205, - FailedInsertTableList = 206, - FailedAllocateTableMem = 207, - FailedToAllocateFileRecord = 208, - FailedToAllocateAttributeRecord = 209 + Undefined = 1340, + FailedToAllocateBuffers = 1342, + FailedToSetupFsBuffers = 1343, + FailedToAllocateTables = 1344, + FailedInsertFileHeader = 1345, + FailedInsertTableList = 1346, + FailedAllocateTableMem = 1347, + FailedToAllocateFileRecord = 1348, + FailedToAllocateAttributeRecord = 1349 }; private: Uint32 backupId; diff --git a/ndb/include/kernel/signaldata/BackupSignalData.hpp b/ndb/include/kernel/signaldata/BackupSignalData.hpp index 42eb8464d53..fb018026a49 100644 --- a/ndb/include/kernel/signaldata/BackupSignalData.hpp +++ b/ndb/include/kernel/signaldata/BackupSignalData.hpp @@ -119,12 +119,13 @@ public: private: enum ErrorCodes { - Undefined = 100, - IAmNotMaster = 101, - OutOfBackupRecord = 102, - OutOfResources = 103, - SequenceFailure = 104, - BackupDefinitionNotImplemented = 105 + Undefined = 1300, + IAmNotMaster = 1301, + OutOfBackupRecord = 1302, + OutOfResources = 1303, + SequenceFailure = 1304, + BackupDefinitionNotImplemented = 1305, + CannotBackupDiskless = 1306 }; Uint32 senderData; Uint32 errorCode; @@ -232,13 +233,13 @@ public: STATIC_CONST( SignalLength = 3 ); enum RequestType { - ClientAbort = 1, - BackupComplete = 2, - BackupFailure = 3, // General backup failure coordinator -> slave - LogBufferFull = 4, // slave -> coordinator - FileOrScanError = 5, // slave -> coordinator - BackupFailureDueToNodeFail = 6, // slave -> slave - OkToClean = 7 // master -> slave + ClientAbort = 1321, + BackupComplete = 1322, + BackupFailure = 1323, // General backup failure coordinator -> slave + LogBufferFull = 1324, // slave -> coordinator + FileOrScanError = 1325, // slave -> coordinator + BackupFailureDueToNodeFail = 1326, // slave -> slave + OkToClean = 1327 // master -> slave }; private: Uint32 requestType; diff --git a/ndb/include/ndbapi/ndberror.h b/ndb/include/ndbapi/ndberror.h index 5c2d85b82a6..ceb1881a4cc 100644 --- a/ndb/include/ndbapi/ndberror.h +++ b/ndb/include/ndbapi/ndberror.h @@ -46,7 +46,8 @@ typedef enum ndberror_cl_internal_error = 12, ndberror_cl_function_not_implemented = 13, ndberror_cl_unknown_error_code = 14, - ndberror_cl_node_shutdown = 15 + ndberror_cl_node_shutdown = 15, + ndberror_cl_configuration = 16 } ndberror_classification_enum; diff --git a/ndb/src/kernel/blocks/backup/Backup.cpp b/ndb/src/kernel/blocks/backup/Backup.cpp index e6fe63d9014..9fc00883792 100644 --- a/ndb/src/kernel/blocks/backup/Backup.cpp +++ b/ndb/src/kernel/blocks/backup/Backup.cpp @@ -863,6 +863,13 @@ Backup::execBACKUP_REQ(Signal* signal) sendBackupRef(senderRef, signal, senderData, BackupRef::IAmNotMaster); return; }//if + + if (m_diskless) + { + sendBackupRef(senderRef, signal, senderData, + BackupRef::CannotBackupDiskless); + return; + } if(dataLen32 != 0) { jam(); diff --git a/ndb/src/kernel/blocks/backup/Backup.hpp b/ndb/src/kernel/blocks/backup/Backup.hpp index 4dc2cd13ae0..fb29cb03b96 100644 --- a/ndb/src/kernel/blocks/backup/Backup.hpp +++ b/ndb/src/kernel/blocks/backup/Backup.hpp @@ -526,6 +526,7 @@ public: NdbNodeBitmask c_aliveNodes; DLList c_backups; Config c_defaults; + Uint32 m_diskless; STATIC_CONST(NO_OF_PAGES_META_FILE = 2); diff --git a/ndb/src/kernel/blocks/backup/BackupInit.cpp b/ndb/src/kernel/blocks/backup/BackupInit.cpp index 8daad05558b..d98541f2ea8 100644 --- a/ndb/src/kernel/blocks/backup/BackupInit.cpp +++ b/ndb/src/kernel/blocks/backup/BackupInit.cpp @@ -42,6 +42,7 @@ Backup::Backup(const Configuration & conf) : ndbrequire(p != 0); Uint32 noBackups = 0, noTables = 0, noAttribs = 0; + ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_DB_DISCLESS, &m_diskless)); ndb_mgm_get_int_parameter(p, CFG_DB_PARALLEL_BACKUPS, &noBackups); ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_DB_NO_TABLES, &noTables)); ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_DB_NO_ATTRIBUTES, &noAttribs)); diff --git a/ndb/src/mgmclient/CommandInterpreter.cpp b/ndb/src/mgmclient/CommandInterpreter.cpp index bfe8b6786b4..0fc9ada408e 100644 --- a/ndb/src/mgmclient/CommandInterpreter.cpp +++ b/ndb/src/mgmclient/CommandInterpreter.cpp @@ -54,10 +54,11 @@ public: * * @return true until quit/bye/exit has been typed */ - int execute(const char *_line, int _try_reconnect=-1); + int execute(const char *_line, int _try_reconnect=-1, int *error= 0); private: void printError(); + int execute_impl(const char *_line); /** * Analyse the command line, after the first token. @@ -121,7 +122,7 @@ public: void executeStatus(int processId, const char* parameters, bool all); void executeEventReporting(int processId, const char* parameters, bool all); void executeDumpState(int processId, const char* parameters, bool all); - void executeStartBackup(char * parameters); + int executeStartBackup(char * parameters); void executeAbortBackup(char * parameters); void executeRep(char* parameters); @@ -156,6 +157,7 @@ private: bool connected; int m_verbose; int try_reconnect; + int m_error; #ifdef HAVE_GLOBAL_REPLICATION NdbRepHandle m_repserver; const char *rep_host; @@ -179,9 +181,9 @@ Ndb_mgmclient::~Ndb_mgmclient() { delete m_cmd; } -int Ndb_mgmclient::execute(const char *_line, int _try_reconnect) +int Ndb_mgmclient::execute(const char *_line, int _try_reconnect, int *error) { - return m_cmd->execute(_line,_try_reconnect); + return m_cmd->execute(_line,_try_reconnect,error); } int Ndb_mgmclient::disconnect() @@ -227,7 +229,7 @@ extern "C" { #include #include -int Ndb_mgmclient::execute(int argc, char** argv, int _try_reconnect) +int Ndb_mgmclient::execute(int argc, char** argv, int _try_reconnect, int *error) { if (argc <= 0) return 0; @@ -236,7 +238,7 @@ int Ndb_mgmclient::execute(int argc, char** argv, int _try_reconnect) { _line.appfmt(" %s", argv[i]); } - return m_cmd->execute(_line.c_str(),_try_reconnect); + return m_cmd->execute(_line.c_str(),_try_reconnect, error); } /***************************************************************************** @@ -277,7 +279,7 @@ static const char* helpText = "REP CONNECT Connect to REP server on host:port\n" #endif "PURGE STALE SESSIONS Reset reserved nodeid's in the mgmt server\n" -"CONNECT Connect to management server (reconnect if already connected)\n" +"CONNECT [] Connect to management server (reconnect if already connected)\n" "QUIT Quit management client\n" ; @@ -469,13 +471,24 @@ CommandInterpreter::disconnect() //***************************************************************************** int -CommandInterpreter::execute(const char *_line, int _try_reconnect) +CommandInterpreter::execute(const char *_line, int _try_reconnect, + int *error) { - DBUG_ENTER("CommandInterpreter::execute"); - DBUG_PRINT("info",("line=\"%s\"",_line)); - if (_try_reconnect >= 0) try_reconnect=_try_reconnect; + int result= execute_impl(_line); + if (error) + *error= m_error; + return result; +} + +int +CommandInterpreter::execute_impl(const char *_line) +{ + DBUG_ENTER("CommandInterpreter::execute_impl"); + DBUG_PRINT("enter",("line=\"%s\"",_line)); + m_error= 0; + char * line; if(_line == NULL) { // ndbout << endl; @@ -488,20 +501,16 @@ CommandInterpreter::execute(const char *_line, int _try_reconnect) DBUG_RETURN(true); } - for (unsigned int i = 0; i < strlen(line); ++i) { - line[i] = toupper(line[i]); - } - // if there is anything in the line proceed char* firstToken = strtok(line, " "); char* allAfterFirstToken = strtok(NULL, ""); - if (strcmp(firstToken, "HELP") == 0 || - strcmp(firstToken, "?") == 0) { + if (strcasecmp(firstToken, "HELP") == 0 || + strcasecmp(firstToken, "?") == 0) { executeHelp(allAfterFirstToken); DBUG_RETURN(true); } - else if (strcmp(firstToken, "CONNECT") == 0) { + else if (strcasecmp(firstToken, "CONNECT") == 0) { executeConnect(allAfterFirstToken); DBUG_RETURN(true); } @@ -509,61 +518,61 @@ CommandInterpreter::execute(const char *_line, int _try_reconnect) if (!connect()) DBUG_RETURN(true); - if (strcmp(firstToken, "SHOW") == 0) { + if (strcasecmp(firstToken, "SHOW") == 0) { executeShow(allAfterFirstToken); DBUG_RETURN(true); } - else if (strcmp(firstToken, "SHUTDOWN") == 0) { + else if (strcasecmp(firstToken, "SHUTDOWN") == 0) { executeShutdown(allAfterFirstToken); DBUG_RETURN(true); } - else if (strcmp(firstToken, "CLUSTERLOG") == 0){ + else if (strcasecmp(firstToken, "CLUSTERLOG") == 0){ executeClusterLog(allAfterFirstToken); DBUG_RETURN(true); } - else if(strcmp(firstToken, "START") == 0 && + else if(strcasecmp(firstToken, "START") == 0 && allAfterFirstToken != NULL && - strncmp(allAfterFirstToken, "BACKUP", sizeof("BACKUP") - 1) == 0){ - executeStartBackup(allAfterFirstToken); + strncasecmp(allAfterFirstToken, "BACKUP", sizeof("BACKUP") - 1) == 0){ + m_error= executeStartBackup(allAfterFirstToken); DBUG_RETURN(true); } - else if(strcmp(firstToken, "ABORT") == 0 && + else if(strcasecmp(firstToken, "ABORT") == 0 && allAfterFirstToken != NULL && - strncmp(allAfterFirstToken, "BACKUP", sizeof("BACKUP") - 1) == 0){ + strncasecmp(allAfterFirstToken, "BACKUP", sizeof("BACKUP") - 1) == 0){ executeAbortBackup(allAfterFirstToken); DBUG_RETURN(true); } - else if (strcmp(firstToken, "PURGE") == 0) { + else if (strcasecmp(firstToken, "PURGE") == 0) { executePurge(allAfterFirstToken); DBUG_RETURN(true); } #ifdef HAVE_GLOBAL_REPLICATION - else if(strcmp(firstToken, "REPLICATION") == 0 || - strcmp(firstToken, "REP") == 0) { + else if(strcasecmp(firstToken, "REPLICATION") == 0 || + strcasecmp(firstToken, "REP") == 0) { executeRep(allAfterFirstToken); DBUG_RETURN(true); } #endif // HAVE_GLOBAL_REPLICATION - else if(strcmp(firstToken, "ENTER") == 0 && + else if(strcasecmp(firstToken, "ENTER") == 0 && allAfterFirstToken != NULL && - strncmp(allAfterFirstToken, "SINGLE USER MODE ", + strncasecmp(allAfterFirstToken, "SINGLE USER MODE ", sizeof("SINGLE USER MODE") - 1) == 0){ executeEnterSingleUser(allAfterFirstToken); DBUG_RETURN(true); } - else if(strcmp(firstToken, "EXIT") == 0 && + else if(strcasecmp(firstToken, "EXIT") == 0 && allAfterFirstToken != NULL && - strncmp(allAfterFirstToken, "SINGLE USER MODE ", + strncasecmp(allAfterFirstToken, "SINGLE USER MODE ", sizeof("SINGLE USER MODE") - 1) == 0){ executeExitSingleUser(allAfterFirstToken); DBUG_RETURN(true); } - else if (strcmp(firstToken, "ALL") == 0) { + else if (strcasecmp(firstToken, "ALL") == 0) { analyseAfterFirstToken(-1, allAfterFirstToken); } - else if((strcmp(firstToken, "QUIT") == 0 || - strcmp(firstToken, "EXIT") == 0 || - strcmp(firstToken, "BYE") == 0) && + else if((strcasecmp(firstToken, "QUIT") == 0 || + strcasecmp(firstToken, "EXIT") == 0 || + strcasecmp(firstToken, "BYE") == 0) && allAfterFirstToken == NULL){ DBUG_RETURN(false); } else { @@ -573,12 +582,12 @@ CommandInterpreter::execute(const char *_line, int _try_reconnect) int nodeId; if (! convert(firstToken, nodeId)) { - ndbout << "Invalid command: " << line << endl; + ndbout << "Invalid command: " << _line << endl; ndbout << "Type HELP for help." << endl << endl; DBUG_RETURN(true); } - if (nodeId < 0) { + if (nodeId <= 0) { ndbout << "Invalid node ID: " << firstToken << "." << endl; DBUG_RETURN(true); } @@ -639,7 +648,7 @@ CommandInterpreter::analyseAfterFirstToken(int processId, ExecuteFunction fun = 0; const char * command = 0; for(int i = 0; i*fun)(processId, allAfterSecondToken, false); ndbout << endl; @@ -705,10 +714,10 @@ CommandInterpreter::executeForAll(const char * cmd, ExecuteFunction fun, const char * allAfterSecondToken) { int nodeId = 0; - if(strcmp(cmd, "STOP") == 0) { + if(strcasecmp(cmd, "STOP") == 0) { ndbout_c("Executing STOP on all nodes."); (this->*fun)(nodeId, allAfterSecondToken, true); - } else if(strcmp(cmd, "RESTART") == 0) { + } else if(strcasecmp(cmd, "RESTART") == 0) { ndbout_c("Executing RESTART on all nodes."); ndbout_c("Starting shutdown. This may take a while. Please wait..."); (this->*fun)(nodeId, allAfterSecondToken, true); @@ -723,7 +732,7 @@ CommandInterpreter::executeForAll(const char * cmd, ExecuteFunction fun, } NdbAutoPtr ap1((char*)cl); while(get_next_nodeid(cl, &nodeId, NDB_MGM_NODE_TYPE_NDB)) { - if(strcmp(cmd, "STATUS") != 0) + if(strcasecmp(cmd, "STATUS") != 0) ndbout_c("Executing %s on node %d.", cmd, nodeId); (this->*fun)(nodeId, allAfterSecondToken, true); ndbout << endl; @@ -751,7 +760,7 @@ CommandInterpreter::parseBlockSpecification(const char* allAfterLog, firstTokenAfterLog[i] = toupper(firstTokenAfterLog[i]); } - if (strcmp(firstTokenAfterLog, "BLOCK") != 0) { + if (strcasecmp(firstTokenAfterLog, "BLOCK") != 0) { ndbout << "Unexpected value: " << firstTokenAfterLog << ". Expected BLOCK." << endl; return false; @@ -764,7 +773,7 @@ CommandInterpreter::parseBlockSpecification(const char* allAfterLog, } char* secondTokenAfterLog = strtok(allAfterFirstToken, " "); - if (strcmp(secondTokenAfterLog, "=") != 0) { + if (strcasecmp(secondTokenAfterLog, "=") != 0) { ndbout << "Unexpected value: " << secondTokenAfterLog << ". Expected =." << endl; return false; @@ -772,7 +781,7 @@ CommandInterpreter::parseBlockSpecification(const char* allAfterLog, char* blockName = strtok(NULL, " "); bool all = false; - if (blockName != NULL && (strcmp(blockName, "ALL") == 0)) { + if (blockName != NULL && (strcasecmp(blockName, "ALL") == 0)) { all = true; } while (blockName != NULL) { @@ -823,15 +832,15 @@ CommandInterpreter::executeHelp(char* parameters) ndbout << " = " << "0 - 15" << endl; ndbout << " = " << "ALL | Any database node id" << endl; ndbout << endl; - } else if (strcmp(parameters, "SHOW") == 0) { + } else if (strcasecmp(parameters, "SHOW") == 0) { ndbout << helpTextShow; #ifdef HAVE_GLOBAL_REPLICATION - } else if (strcmp(parameters, "REPLICATION") == 0 || - strcmp(parameters, "REP") == 0) { + } else if (strcasecmp(parameters, "REPLICATION") == 0 || + strcasecmp(parameters, "REP") == 0) { ndbout << helpTextRep; #endif // HAVE_GLOBAL_REPLICATION #ifdef VM_TRACE // DEBUG ONLY - } else if (strcmp(parameters, "DEBUG") == 0) { + } else if (strcasecmp(parameters, "DEBUG") == 0) { ndbout << helpTextDebug; #endif } else { @@ -939,7 +948,7 @@ print_nodes(ndb_mgm_cluster_state *state, ndb_mgm_configuration_iterator *it, const char *hostname= node_state->connect_address; if (hostname == 0 || strlen(hostname) == 0 - || strcmp(hostname,"0.0.0.0") == 0) + || strcasecmp(hostname,"0.0.0.0") == 0) ndbout << " "; else ndbout << "\t@" << hostname; @@ -984,9 +993,9 @@ CommandInterpreter::executePurge(char* parameters) break; char* firstToken = strtok(parameters, " "); char* nextToken = strtok(NULL, " \0"); - if (strcmp(firstToken,"STALE") == 0 && + if (strcasecmp(firstToken,"STALE") == 0 && nextToken && - strcmp(nextToken, "SESSIONS") == 0) { + strcasecmp(nextToken, "SESSIONS") == 0) { command_ok= 1; break; } @@ -1086,17 +1095,17 @@ CommandInterpreter::executeShow(char* parameters) print_nodes(state, it, "mysqld", api_nodes, NDB_MGM_NODE_TYPE_API, 0); // ndbout << helpTextShow; return; - } else if (strcmp(parameters, "PROPERTIES") == 0 || - strcmp(parameters, "PROP") == 0) { + } else if (strcasecmp(parameters, "PROPERTIES") == 0 || + strcasecmp(parameters, "PROP") == 0) { ndbout << "SHOW PROPERTIES is not yet implemented." << endl; // ndbout << "_mgmtSrvr.getConfig()->print();" << endl; /* XXX */ - } else if (strcmp(parameters, "CONFIGURATION") == 0 || - strcmp(parameters, "CONFIG") == 0){ + } else if (strcasecmp(parameters, "CONFIGURATION") == 0 || + strcasecmp(parameters, "CONFIG") == 0){ ndbout << "SHOW CONFIGURATION is not yet implemented." << endl; //nbout << "_mgmtSrvr.getConfig()->printConfigFile();" << endl; /* XXX */ - } else if (strcmp(parameters, "PARAMETERS") == 0 || - strcmp(parameters, "PARAMS") == 0 || - strcmp(parameters, "PARAM") == 0) { + } else if (strcasecmp(parameters, "PARAMETERS") == 0 || + strcasecmp(parameters, "PARAMS") == 0 || + strcasecmp(parameters, "PARAM") == 0) { ndbout << "SHOW PARAMETERS is not yet implemented." << endl; // ndbout << "_mgmtSrvr.getConfig()->getConfigInfo()->print();" // << endl; /* XXX */ @@ -1109,6 +1118,14 @@ void CommandInterpreter::executeConnect(char* parameters) { disconnect(); + if (!emptyString(parameters)) { + if (ndb_mgm_set_connectstring(m_mgmsrv, + BaseString(parameters).trim().c_str())) + { + printError(); + return; + } + } connect(); } @@ -1132,7 +1149,7 @@ CommandInterpreter::executeClusterLog(char* parameters) /******************** * CLUSTERLOG FILTER ********************/ - if (strcmp(item, "FILTER") == 0) { + if (strcasecmp(item, "FILTER") == 0) { item = strtok_r(NULL, " ", &tmpPtr); if (item == NULL) { @@ -1141,21 +1158,21 @@ CommandInterpreter::executeClusterLog(char* parameters) while (item != NULL) { snprintf(name, sizeof(name), item); - if (strcmp(item, "ALL") == 0) { + if (strcasecmp(item, "ALL") == 0) { severity = NDB_MGM_CLUSTERLOG_ALL; - } else if (strcmp(item, "ALERT") == 0) { + } else if (strcasecmp(item, "ALERT") == 0) { severity = NDB_MGM_CLUSTERLOG_ALERT; - } else if (strcmp(item, "CRITICAL") == 0) { + } else if (strcasecmp(item, "CRITICAL") == 0) { severity = NDB_MGM_CLUSTERLOG_CRITICAL; - } else if (strcmp(item, "ERROR") == 0) { + } else if (strcasecmp(item, "ERROR") == 0) { severity = NDB_MGM_CLUSTERLOG_ERROR; - } else if (strcmp(item, "WARNING") == 0) { + } else if (strcasecmp(item, "WARNING") == 0) { severity = NDB_MGM_CLUSTERLOG_WARNING; - } else if (strcmp(item, "INFO") == 0) { + } else if (strcasecmp(item, "INFO") == 0) { severity = NDB_MGM_CLUSTERLOG_INFO; - } else if (strcmp(item, "DEBUG") == 0) { + } else if (strcasecmp(item, "DEBUG") == 0) { severity = NDB_MGM_CLUSTERLOG_DEBUG; - } else if (strcmp(item, "OFF") == 0) { + } else if (strcasecmp(item, "OFF") == 0) { severity = NDB_MGM_CLUSTERLOG_OFF; } else { isOk = false; @@ -1168,17 +1185,17 @@ CommandInterpreter::executeClusterLog(char* parameters) ndbout << "Missing argument(s)." << endl; } else if (isOk) { if(ndb_mgm_filter_clusterlog(m_mgmsrv, severity, NULL)) { - if(strcmp(name, "ALL") == 0 || strcmp(name, "all") == 0) { + if(strcasecmp(name, "ALL") == 0) { ndbout << "All severities levels enabled." << endl; - } else if(strcmp(name, "OFF") == 0 || strcmp(name, "off") == 0) { + } else if(strcasecmp(name, "OFF") == 0) { ndbout << "Cluster logging enabled." << endl; } else { ndbout << name << " events disabled." << endl; } } else { - if(strcmp(name, "ALL") == 0) { + if(strcasecmp(name, "ALL") == 0) { ndbout << "All severities levels disabled." << endl; - } else if(strcmp(name, "OFF") == 0) { + } else if(strcasecmp(name, "OFF") == 0) { ndbout << "Cluster logging disabled." << endl; } else { ndbout << name << " events enabled." << endl; @@ -1191,7 +1208,7 @@ CommandInterpreter::executeClusterLog(char* parameters) /******************** * CLUSTERLOG INFO ********************/ - } else if (strcmp(item, "INFO") == 0) { + } else if (strcasecmp(item, "INFO") == 0) { Uint32 *enabled = ndb_mgm_get_logfilter(m_mgmsrv); if(enabled == NULL) { ndbout << "Couldn't get status" << endl; @@ -1216,7 +1233,7 @@ CommandInterpreter::executeClusterLog(char* parameters) /******************** * CLUSTERLOG OFF ********************/ - } else if (strcmp(item, "OFF") == 0) { + } else if (strcasecmp(item, "OFF") == 0) { Uint32 *enabled = ndb_mgm_get_logfilter(m_mgmsrv); if(enabled == NULL) { ndbout << "Couldn't get status" << endl; @@ -1234,7 +1251,7 @@ CommandInterpreter::executeClusterLog(char* parameters) /******************** * CLUSTERLOG ON ********************/ - } else if (strcmp(item, "ON") == 0) { + } else if (strcasecmp(item, "ON") == 0) { Uint32 *enabled = ndb_mgm_get_logfilter(m_mgmsrv); if(enabled == NULL) { ndbout << "Could not get status" << endl; @@ -1358,11 +1375,11 @@ CommandInterpreter::executeRestart(int processId, const char* parameters, char * tmpPtr = 0; char * item = strtok_r(tmpString, " ", &tmpPtr); while(item != NULL){ - if(strcmp(item, "-N") == 0) + if(strcasecmp(item, "-N") == 0) nostart = 1; - if(strcmp(item, "-I") == 0) + if(strcasecmp(item, "-I") == 0) initialstart = 1; - if(strcmp(item, "-A") == 0) + if(strcasecmp(item, "-A") == 0) abort = 1; item = strtok_r(NULL, " ", &tmpPtr); } @@ -1591,7 +1608,7 @@ CommandInterpreter::executeTrace(int /*processId*/, int result = _mgmtSrvr.setTraceNo(processId, traceNo); if (result != 0) { - ndbout << _mgmtSrvr.getErrorText(result) << endl; + ndbout << get_error_text(result) << endl; } #endif } @@ -1751,7 +1768,7 @@ CommandInterpreter::executeSet(int /*processId*/, } } else { - ndbout << _mgmtSrvr.getErrorText(result) << endl; + ndbout << get_error_text(result) << endl; if (configBackupFileUpdated && configPrimaryFileUpdated) { ndbout << "The configuration files are however updated and " << "the value will be used next time the process is restarted." @@ -1786,7 +1803,7 @@ void CommandInterpreter::executeGetStat(int /*processId*/, MgmtSrvr::Statistics statistics; int result = _mgmtSrvr.getStatistics(processId, statistics); if (result != 0) { - ndbout << _mgmtSrvr.getErrorText(result) << endl; + ndbout << get_error_text(result) << endl; return; } #endif @@ -1856,7 +1873,7 @@ CommandInterpreter::executeEventReporting(int processId, /***************************************************************************** * Backup *****************************************************************************/ -void +int CommandInterpreter::executeStartBackup(char* /*parameters*/) { struct ndb_mgm_reply reply; @@ -1869,7 +1886,7 @@ CommandInterpreter::executeStartBackup(char* /*parameters*/) ndbout << "Start of backup failed" << endl; printError(); close(fd); - return; + return result; } char *tmp; @@ -1900,6 +1917,7 @@ CommandInterpreter::executeStartBackup(char* /*parameters*/) } while(tmp && tmp[0] != 0); close(fd); + return 0; } void @@ -1966,7 +1984,7 @@ CommandInterpreter::executeRep(char* parameters) unsigned int repId; - if (!strcmp(firstToken, "CONNECT")) { + if (!strcasecmp(firstToken, "CONNECT")) { char * host = strtok(NULL, "\0"); for (unsigned int i = 0; i < strlen(host); ++i) { host[i] = tolower(host[i]); @@ -2001,30 +2019,30 @@ CommandInterpreter::executeRep(char* parameters) /******** * START ********/ - if (!strcmp(firstToken, "START")) { + if (!strcasecmp(firstToken, "START")) { unsigned int req; char *startType = strtok(NULL, "\0"); if (startType == NULL) { req = GrepReq::START; - } else if (!strcmp(startType, "SUBSCRIPTION")) { + } else if (!strcasecmp(startType, "SUBSCRIPTION")) { req = GrepReq::START_SUBSCR; - } else if (!strcmp(startType, "METALOG")) { + } else if (!strcasecmp(startType, "METALOG")) { req = GrepReq::START_METALOG; - } else if (!strcmp(startType, "METASCAN")) { + } else if (!strcasecmp(startType, "METASCAN")) { req = GrepReq::START_METASCAN; - } else if (!strcmp(startType, "DATALOG")) { + } else if (!strcasecmp(startType, "DATALOG")) { req = GrepReq::START_DATALOG; - } else if (!strcmp(startType, "DATASCAN")) { + } else if (!strcasecmp(startType, "DATASCAN")) { req = GrepReq::START_DATASCAN; - } else if (!strcmp(startType, "REQUESTOR")) { + } else if (!strcasecmp(startType, "REQUESTOR")) { req = GrepReq::START_REQUESTOR; - } else if (!strcmp(startType, "TRANSFER")) { + } else if (!strcasecmp(startType, "TRANSFER")) { req = GrepReq::START_TRANSFER; - } else if (!strcmp(startType, "APPLY")) { + } else if (!strcasecmp(startType, "APPLY")) { req = GrepReq::START_APPLY; - } else if (!strcmp(startType, "DELETE")) { + } else if (!strcasecmp(startType, "DELETE")) { req = GrepReq::START_DELETE; } else { ndbout_c("Illegal argument to command 'REPLICATION START'"); @@ -2044,7 +2062,7 @@ CommandInterpreter::executeRep(char* parameters) /******** * STOP ********/ - if (!strcmp(firstToken, "STOP")) { + if (!strcasecmp(firstToken, "STOP")) { unsigned int req; char *startType = strtok(NULL, " "); unsigned int epoch = 0; @@ -2054,7 +2072,7 @@ CommandInterpreter::executeRep(char* parameters) * Stop immediately */ req = GrepReq::STOP; - } else if (!strcmp(startType, "EPOCH")) { + } else if (!strcasecmp(startType, "EPOCH")) { char *strEpoch = strtok(NULL, "\0"); if(strEpoch == NULL) { ndbout_c("Epoch expected!"); @@ -2062,23 +2080,23 @@ CommandInterpreter::executeRep(char* parameters) } req = GrepReq::STOP; epoch=atoi(strEpoch); - } else if (!strcmp(startType, "SUBSCRIPTION")) { + } else if (!strcasecmp(startType, "SUBSCRIPTION")) { req = GrepReq::STOP_SUBSCR; - } else if (!strcmp(startType, "METALOG")) { + } else if (!strcasecmp(startType, "METALOG")) { req = GrepReq::STOP_METALOG; - } else if (!strcmp(startType, "METASCAN")) { + } else if (!strcasecmp(startType, "METASCAN")) { req = GrepReq::STOP_METASCAN; - } else if (!strcmp(startType, "DATALOG")) { + } else if (!strcasecmp(startType, "DATALOG")) { req = GrepReq::STOP_DATALOG; - } else if (!strcmp(startType, "DATASCAN")) { + } else if (!strcasecmp(startType, "DATASCAN")) { req = GrepReq::STOP_DATASCAN; - } else if (!strcmp(startType, "REQUESTOR")) { + } else if (!strcasecmp(startType, "REQUESTOR")) { req = GrepReq::STOP_REQUESTOR; - } else if (!strcmp(startType, "TRANSFER")) { + } else if (!strcasecmp(startType, "TRANSFER")) { req = GrepReq::STOP_TRANSFER; - } else if (!strcmp(startType, "APPLY")) { + } else if (!strcasecmp(startType, "APPLY")) { req = GrepReq::STOP_APPLY; - } else if (!strcmp(startType, "DELETE")) { + } else if (!strcasecmp(startType, "DELETE")) { req = GrepReq::STOP_DELETE; } else { ndbout_c("Illegal argument to command 'REPLICATION STOP'"); @@ -2097,7 +2115,7 @@ CommandInterpreter::executeRep(char* parameters) /********* * STATUS *********/ - if (!strcmp(firstToken, "STATUS")) { + if (!strcasecmp(firstToken, "STATUS")) { struct rep_state repstate; int result = ndb_rep_get_status(m_repserver, &repId, &reply, &repstate); @@ -2117,7 +2135,7 @@ CommandInterpreter::executeRep(char* parameters) /********* * QUERY (see repapi.h for querable counters) *********/ - if (!strcmp(firstToken, "QUERY")) { + if (!strcasecmp(firstToken, "QUERY")) { char *query = strtok(NULL, "\0"); int queryCounter=-1; if(query != NULL) { diff --git a/ndb/src/mgmclient/main.cpp b/ndb/src/mgmclient/main.cpp index 08d5d60cfab..84e27790705 100644 --- a/ndb/src/mgmclient/main.cpp +++ b/ndb/src/mgmclient/main.cpp @@ -60,10 +60,15 @@ static const char default_prompt[]= "ndb_mgm> "; static unsigned _try_reconnect; static char *opt_connect_str= 0; static const char *prompt= default_prompt; +static char *opt_execute_str= 0; static struct my_option my_long_options[] = { NDB_STD_OPTS("ndb_mgm"), + { "execute", 'e', + "execute command and exit", + (gptr*) &opt_execute_str, (gptr*) &opt_execute_str, 0, + GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, { "try-reconnect", 't', "Specify number of tries for connecting to ndb_mgmd (0 = infinite)", (gptr*) &_try_reconnect, (gptr*) &_try_reconnect, 0, @@ -156,19 +161,25 @@ int main(int argc, char** argv){ opt_connect_str= buf; } - if (!isatty(0)) + if (!isatty(0) || opt_execute_str) { prompt= 0; } - ndbout << "-- NDB Cluster -- Management Client --" << endl; - signal(SIGPIPE, handler); - com = new Ndb_mgmclient(opt_connect_str,1); - while(read_and_execute(_try_reconnect)); + int ret= 0; + if (!opt_execute_str) + { + ndbout << "-- NDB Cluster -- Management Client --" << endl; + while(read_and_execute(_try_reconnect)); + } + else + { + com->execute(opt_execute_str,_try_reconnect, &ret); + } delete com; - return 0; + return ret; } diff --git a/ndb/src/mgmclient/ndb_mgmclient.hpp b/ndb/src/mgmclient/ndb_mgmclient.hpp index ea592dfdf4e..bffdf69f920 100644 --- a/ndb/src/mgmclient/ndb_mgmclient.hpp +++ b/ndb/src/mgmclient/ndb_mgmclient.hpp @@ -23,8 +23,8 @@ class Ndb_mgmclient public: Ndb_mgmclient(const char*,int verbose=0); ~Ndb_mgmclient(); - int execute(const char *_line, int _try_reconnect=-1); - int execute(int argc, char** argv, int _try_reconnect=-1); + int execute(const char *_line, int _try_reconnect=-1, int *error= 0); + int execute(int argc, char** argv, int _try_reconnect=-1, int *error= 0); int disconnect(); private: CommandInterpreter *m_cmd; diff --git a/ndb/src/mgmsrv/CommandInterpreter.cpp b/ndb/src/mgmsrv/CommandInterpreter.cpp index 2a054a01f1e..02bf24f1d9c 100644 --- a/ndb/src/mgmsrv/CommandInterpreter.cpp +++ b/ndb/src/mgmsrv/CommandInterpreter.cpp @@ -113,6 +113,11 @@ private: void * m_ptr; }; +const char *CommandInterpreter::get_error_text(int err_no) +{ + return _mgmtSrvr.getErrorText(err_no, m_err_str, sizeof(m_err_str)); +} + //***************************************************************************** //***************************************************************************** int CommandInterpreter::readAndExecute() { @@ -600,8 +605,9 @@ stopCallback(int nodeId, void * anyData, int errCode){ ndbout << "\nNode " << nodeId << " has shutdown" << endl; } else { MgmtSrvr * mgm = (MgmtSrvr *)anyData; + char err_str[1024]; ndbout << "Node " << nodeId << " has not shutdown: " - << mgm->getErrorText(errCode) << endl; + << mgm->getErrorText(errCode,err_str,sizeof(err_str)) << endl; } } @@ -653,7 +659,8 @@ versionCallback(int nodeId, int version, void * anyData, int errCode){ } else { MgmtSrvr * mgm = (MgmtSrvr *)anyData; - ndbout << mgm->getErrorText(errCode) << endl; + char err_str[1024]; + ndbout << mgm->getErrorText(errCode,err_str,sizeof(err_str)) << endl; } } @@ -671,7 +678,7 @@ void CommandInterpreter::executeStop(int processId, result = _mgmtSrvr.stopNode(processId, false, stopCallback, this); if(result != 0) - ndbout << _mgmtSrvr.getErrorText(result) << endl; + ndbout << get_error_text(result) << endl; } @@ -686,7 +693,7 @@ void CommandInterpreter::executeStart(int processId, const char* parameters, int result = _mgmtSrvr.start(processId); if (result != 0) { - ndbout << _mgmtSrvr.getErrorText(result) << endl; + ndbout << get_error_text(result) << endl; } } @@ -719,7 +726,7 @@ CommandInterpreter::executeRestart(int processId, const char* parameters, stopCallback, this); if (result != 0) { - ndbout << _mgmtSrvr.getErrorText(result) << endl; + ndbout << get_error_text(result) << endl; } } @@ -760,7 +767,7 @@ CommandInterpreter::executeDumpState(int processId, const char* parameters, free(tmpString); int result = _mgmtSrvr.dumpState(processId, pars, no); if (result != 0) { - ndbout << _mgmtSrvr.getErrorText(result) << endl; + ndbout << get_error_text(result) << endl; } } @@ -781,7 +788,7 @@ void CommandInterpreter::executeStatus(int processId, &status, &version, &startPhase, &system, &dynamicId, &nodeGroup, &connectCount); if(result != 0){ - ndbout << _mgmtSrvr.getErrorText(result) << endl; + ndbout << get_error_text(result) << endl; return; } @@ -875,7 +882,7 @@ void CommandInterpreter::executeLogLevel(int processId, int result = _mgmtSrvr.setNodeLogLevel(processId, logLevel); if (result != 0) { - ndbout << _mgmtSrvr.getErrorText(result) << endl; + ndbout << get_error_text(result) << endl; } #endif } @@ -913,7 +920,7 @@ void CommandInterpreter::executeError(int processId, int result = _mgmtSrvr.insertError(processId, errorNo); if (result != 0) { - ndbout << _mgmtSrvr.getErrorText(result) << endl; + ndbout << get_error_text(result) << endl; } free(newpar); } @@ -953,7 +960,7 @@ void CommandInterpreter::executeTrace(int processId, int result = _mgmtSrvr.setTraceNo(processId, traceNo); if (result != 0) { - ndbout << _mgmtSrvr.getErrorText(result) << endl; + ndbout << get_error_text(result) << endl; } free(newpar); } @@ -974,7 +981,7 @@ void CommandInterpreter::executeLog(int processId, int result = _mgmtSrvr.setSignalLoggingMode(processId, MgmtSrvr::InOut, blocks); if (result != 0) { - ndbout << _mgmtSrvr.getErrorText(result) << endl; + ndbout << get_error_text(result) << endl; } } @@ -995,7 +1002,7 @@ void CommandInterpreter::executeLogIn(int processId, int result = _mgmtSrvr.setSignalLoggingMode(processId, MgmtSrvr::In, blocks); if (result != 0) { - ndbout << _mgmtSrvr.getErrorText(result) << endl; + ndbout << get_error_text(result) << endl; } } @@ -1014,7 +1021,7 @@ void CommandInterpreter::executeLogOut(int processId, int result = _mgmtSrvr.setSignalLoggingMode(processId, MgmtSrvr::Out, blocks); if (result != 0) { - ndbout << _mgmtSrvr.getErrorText(result) << endl; + ndbout << get_error_text(result) << endl; } } @@ -1035,7 +1042,7 @@ void CommandInterpreter::executeLogOff(int processId, int result = _mgmtSrvr.setSignalLoggingMode(processId, MgmtSrvr::Off, blocks); if (result != 0) { - ndbout << _mgmtSrvr.getErrorText(result) << endl; + ndbout << get_error_text(result) << endl; } } @@ -1054,7 +1061,7 @@ void CommandInterpreter::executeTestOn(int processId, int result = _mgmtSrvr.startSignalTracing(processId); if (result != 0) { - ndbout << _mgmtSrvr.getErrorText(result) << endl; + ndbout << get_error_text(result) << endl; } } @@ -1073,7 +1080,7 @@ void CommandInterpreter::executeTestOff(int processId, int result = _mgmtSrvr.stopSignalTracing(processId); if (result != 0) { - ndbout << _mgmtSrvr.getErrorText(result) << endl; + ndbout << get_error_text(result) << endl; } } @@ -1126,7 +1133,7 @@ void CommandInterpreter::executeEventReporting(int processId, ndbout_c("processId %d", processId); int result = _mgmtSrvr.setEventReportingLevel(processId, logLevel); if (result != 0) { - ndbout << _mgmtSrvr.getErrorText(result) << endl; + ndbout << get_error_text(result) << endl; } #endif } @@ -1136,7 +1143,7 @@ CommandInterpreter::executeStartBackup(char* parameters) { Uint32 backupId; int result = _mgmtSrvr.startBackup(backupId); if (result != 0) { - ndbout << _mgmtSrvr.getErrorText(result) << endl; + ndbout << get_error_text(result) << endl; } else { // ndbout << "Start of backup ordered" << endl; } @@ -1153,7 +1160,7 @@ CommandInterpreter::executeAbortBackup(char* parameters) { } int result = _mgmtSrvr.abortBackup(bid); if (result != 0) { - ndbout << _mgmtSrvr.getErrorText(result) << endl; + ndbout << get_error_text(result) << endl; } else { ndbout << "Abort of backup " << bid << " ordered" << endl; } @@ -1174,7 +1181,7 @@ CommandInterpreter::executeEnterSingleUser(char* parameters) { } int result = _mgmtSrvr.enterSingleUser(0, nodeId,0,0); if (result != 0) { - ndbout << _mgmtSrvr.getErrorText(result) << endl; + ndbout << get_error_text(result) << endl; } else { ndbout << "Entering single user mode, granting access for node " << nodeId << " OK." << endl; diff --git a/ndb/src/mgmsrv/CommandInterpreter.hpp b/ndb/src/mgmsrv/CommandInterpreter.hpp index db23f76a5bd..1a5184361d6 100644 --- a/ndb/src/mgmsrv/CommandInterpreter.hpp +++ b/ndb/src/mgmsrv/CommandInterpreter.hpp @@ -55,6 +55,9 @@ public: int readAndExecute(); private: + char m_err_str[1024]; + const char *get_error_text(int err_no); + /** * Read a string, and return a pointer to it. * diff --git a/ndb/src/mgmsrv/MgmtSrvr.cpp b/ndb/src/mgmsrv/MgmtSrvr.cpp index 986da71a8e8..061aa2e0cb8 100644 --- a/ndb/src/mgmsrv/MgmtSrvr.cpp +++ b/ndb/src/mgmsrv/MgmtSrvr.cpp @@ -49,6 +49,8 @@ #include +#include + #include #include #include @@ -264,16 +266,6 @@ MgmtSrvr::isEventLogFilterEnabled(int severity) static ErrorItem errorTable[] = { - {200, "Backup undefined error"}, - {202, "Backup failed to allocate buffers (check configuration)"}, - {203, "Backup failed to setup fs buffers (check configuration)"}, - {204, "Backup failed to allocate tables (check configuration)"}, - {205, "Backup failed to insert file header (check configuration)"}, - {206, "Backup failed to insert table list (check configuration)"}, - {207, "Backup failed to allocate table memory (check configuration)"}, - {208, "Backup failed to allocate file record (check configuration)"}, - {209, "Backup failed to allocate attribute record (check configuration)"}, - {MgmtSrvr::NO_CONTACT_WITH_PROCESS, "No contact with the process (dead ?)."}, {MgmtSrvr::PROCESS_NOT_CONFIGURED, "The process is not configured."}, {MgmtSrvr::WRONG_PROCESS_TYPE, @@ -1856,18 +1848,21 @@ MgmtSrvr::dumpState(int processId, const Uint32 args[], Uint32 no) //**************************************************************************** //**************************************************************************** -const char* MgmtSrvr::getErrorText(int errorCode) +const char* MgmtSrvr::getErrorText(int errorCode, char *buf, int buf_sz) { - static char text[255]; for (int i = 0; i < noOfErrorCodes; ++i) { if (errorCode == errorTable[i]._errorCode) { - return errorTable[i]._errorText; + BaseString::snprintf(buf, buf_sz, errorTable[i]._errorText); + buf[buf_sz-1]= 0; + return buf; } } - - BaseString::snprintf(text, 255, "Unknown management server error code %d", errorCode); - return text; + + ndb_error_string(errorCode, buf, buf_sz); + buf[buf_sz-1]= 0; + + return buf; } void diff --git a/ndb/src/mgmsrv/MgmtSrvr.hpp b/ndb/src/mgmsrv/MgmtSrvr.hpp index 2ab11250d81..1afb0848ecc 100644 --- a/ndb/src/mgmsrv/MgmtSrvr.hpp +++ b/ndb/src/mgmsrv/MgmtSrvr.hpp @@ -466,7 +466,7 @@ public: * @param errorCode: Error code to get a match error text for. * @return The error text. */ - const char* getErrorText(int errorCode); + const char* getErrorText(int errorCode, char *buf, int buf_sz); /** * Get configuration diff --git a/ndb/src/mgmsrv/Services.cpp b/ndb/src/mgmsrv/Services.cpp index 0394c4e80bb..0208805b2d3 100644 --- a/ndb/src/mgmsrv/Services.cpp +++ b/ndb/src/mgmsrv/Services.cpp @@ -579,7 +579,7 @@ MgmApiSession::insertError(Parser::Context &, m_output->println("insert error reply"); if(result != 0) - m_output->println("result: %s", m_mgmsrv.getErrorText(result)); + m_output->println("result: %s", get_error_text(result)); else m_output->println("result: Ok"); m_output->println(""); @@ -597,7 +597,7 @@ MgmApiSession::setTrace(Parser::Context &, m_output->println("set trace reply"); if(result != 0) - m_output->println("result: %s", m_mgmsrv.getErrorText(result)); + m_output->println("result: %s", get_error_text(result)); else m_output->println("result: Ok"); m_output->println(""); @@ -665,7 +665,7 @@ MgmApiSession::startBackup(Parser::Context &, m_output->println("start backup reply"); if(result != 0) - m_output->println("result: %s(%d)", m_mgmsrv.getErrorText(result), result); + m_output->println("result: %s(%d)", get_error_text(result), result); else{ m_output->println("result: Ok"); m_output->println("id: %d", backupId); @@ -685,7 +685,7 @@ MgmApiSession::startBackup(Parser::Context &, m_output->println("start backup reply"); if(result != 0) - m_output->println("result: %s", m_mgmsrv.getErrorText(result)); + m_output->println("result: %s", get_error_text(result)); else{ m_output->println("result: Ok"); m_output->println("id: %d", backupId); @@ -705,7 +705,7 @@ MgmApiSession::abortBackup(Parser::Context &, m_output->println("abort backup reply"); if(result != 0) - m_output->println("result: %s", m_mgmsrv.getErrorText(result)); + m_output->println("result: %s", get_error_text(result)); else m_output->println("result: Ok"); m_output->println(""); @@ -727,7 +727,7 @@ MgmApiSession::repCommand(Parser::Context &, m_output->println("global replication reply"); if(result != 0) - m_output->println("result: %s", m_mgmsrv.getErrorText(result)); + m_output->println("result: %s", get_error_text(result)); else{ m_output->println("result: Ok"); m_output->println("id: %d", repReqId); @@ -749,7 +749,7 @@ MgmApiSession::dumpState(Parser::Context &, int result = m_mgmsrv.dumpState(node, args_str.c_str()); m_output->println("dump state reply"); if(result != 0) - m_output->println("result: %s", m_mgmsrv.getErrorText(result)); + m_output->println("result: %s", get_error_text(result)); else m_output->println("result: Ok"); m_output->println(""); @@ -834,7 +834,7 @@ MgmApiSession::stopSignalLog(Parser::Context &, m_output->println("stop signallog"); if(result != 0) - m_output->println("result: %s", m_mgmsrv.getErrorText(result)); + m_output->println("result: %s", get_error_text(result)); else m_output->println("result: Ok"); m_output->println(""); @@ -874,7 +874,7 @@ MgmApiSession::restart(Parser::Context &, m_output->println("restart reply"); if(result != 0){ - m_output->println("result: %d-%s", result, m_mgmsrv.getErrorText(result)); + m_output->println("result: %d-%s", result, get_error_text(result)); } else m_output->println("result: Ok"); m_output->println("restarted: %d", restarted); @@ -898,7 +898,7 @@ MgmApiSession::restartAll(Parser::Context &, m_output->println("restart reply"); if(result != 0) - m_output->println("result: %s", m_mgmsrv.getErrorText(result)); + m_output->println("result: %s", get_error_text(result)); else m_output->println("result: Ok"); m_output->println("restarted: %d", count); @@ -1029,7 +1029,7 @@ MgmApiSession::stop(Parser::Context &, m_output->println("stop reply"); if(result != 0) - m_output->println("result: %s", m_mgmsrv.getErrorText(result)); + m_output->println("result: %s", get_error_text(result)); else m_output->println("result: Ok"); m_output->println("stopped: %d", stopped); @@ -1051,7 +1051,7 @@ MgmApiSession::stopAll(Parser::Context &, m_output->println("stop reply"); if(result != 0) - m_output->println("result: %s", m_mgmsrv.getErrorText(result)); + m_output->println("result: %s", get_error_text(result)); else m_output->println("result: Ok"); m_output->println("stopped: %d", stopped); @@ -1067,7 +1067,7 @@ MgmApiSession::enterSingleUser(Parser::Context &, int result = m_mgmsrv.enterSingleUser(&stopped, nodeId); m_output->println("enter single user reply"); if(result != 0) { - m_output->println("result: %s", m_mgmsrv.getErrorText(result)); + m_output->println("result: %s", get_error_text(result)); } else { m_output->println("result: Ok"); @@ -1082,7 +1082,7 @@ MgmApiSession::exitSingleUser(Parser::Context &, int result = m_mgmsrv.exitSingleUser(&stopped, false); m_output->println("exit single user reply"); if(result != 0) - m_output->println("result: %s", m_mgmsrv.getErrorText(result)); + m_output->println("result: %s", get_error_text(result)); else m_output->println("result: Ok"); m_output->println(""); @@ -1100,7 +1100,7 @@ MgmApiSession::startSignalLog(Parser::Context &, m_output->println("start signallog reply"); if(result != 0) - m_output->println("result: %s", m_mgmsrv.getErrorText(result)); + m_output->println("result: %s", get_error_text(result)); else m_output->println("result: Ok"); m_output->println(""); @@ -1145,7 +1145,7 @@ MgmApiSession::logSignals(Parser::Context &, m_output->println("log signals reply"); if(result != 0) - m_output->println("result: %s", m_mgmsrv.getErrorText(result)); + m_output->println("result: %s", get_error_text(result)); else m_output->println("result: Ok"); m_output->println(""); @@ -1162,7 +1162,7 @@ MgmApiSession::start(Parser::Context &, m_output->println("start reply"); if(result != 0) - m_output->println("result: %s", m_mgmsrv.getErrorText(result)); + m_output->println("result: %s", get_error_text(result)); else m_output->println("result: Ok"); m_output->println(""); diff --git a/ndb/src/mgmsrv/Services.hpp b/ndb/src/mgmsrv/Services.hpp index bfc915f18f1..7d614d6241c 100644 --- a/ndb/src/mgmsrv/Services.hpp +++ b/ndb/src/mgmsrv/Services.hpp @@ -39,10 +39,13 @@ private: OutputStream *m_output; Parser_t *m_parser; MgmtSrvr::Allocated_resources *m_allocated_resources; + char m_err_str[1024]; void getConfig_common(Parser_t::Context &ctx, const class Properties &args, bool compat = false); + const char *get_error_text(int err_no) + { return m_mgmsrv.getErrorText(err_no, m_err_str, sizeof(m_err_str)); } public: MgmApiSession(class MgmtSrvr & mgm, NDB_SOCKET_TYPE sock); diff --git a/ndb/src/ndbapi/ndberror.c b/ndb/src/ndbapi/ndberror.c index 6744f4c1640..c0a6b6ba122 100644 --- a/ndb/src/ndbapi/ndberror.c +++ b/ndb/src/ndbapi/ndberror.c @@ -35,6 +35,7 @@ typedef struct ErrorBundle { #define NE ndberror_cl_none #define AE ndberror_cl_application +#define CE ndberror_cl_configuration #define ND ndberror_cl_no_data_found #define CV ndberror_cl_constraint_violation #define SE ndberror_cl_schema_error @@ -58,6 +59,27 @@ static const char REDO_BUFFER_MSG[]= static const char* empty_string = ""; +/* + * Error code ranges are reserved for respective block + * + * 200 - TC + * 300 - DIH + * 400 - LQH + * 600 - ACC + * 700 - DICT + * 800 - TUP + * 1200 - LQH + * 1300 - BACKUP + * 4000 - API + * 4100 - "" + * 4200 - "" + * 4300 - "" + * 4400 - "" + * 4500 - "" + * 4600 - "" + * 5000 - Management server + */ + static const ErrorBundle ErrorCodes[] = { @@ -303,6 +325,36 @@ ErrorBundle ErrorCodes[] = { */ { 4003, NI, "Function not implemented yet" }, + /** + * Backup error codes + */ + + { 1300, IE, "Undefined error" }, + { 1301, IE, "Backup issued to not master (reissue command to master)" }, + { 1302, IE, "Out of backup record" }, + { 1303, IS, "Out of resources" }, + { 1304, IE, "Sequence failure" }, + { 1305, IE, "Backup definition not implemented" }, + { 1306, AE, "Backup not supported in diskless mode (change Diskless)" }, + + { 1321, IE, "Backup aborted by application" }, + { 1322, IE, "Backup already completed" }, + { 1323, IE, "1323" }, + { 1324, IE, "Backup log buffer full" }, + { 1325, IE, "File or scan error" }, + { 1326, IE, "Backup abortet due to node failure" }, + { 1327, IE, "1327" }, + + { 1340, IE, "Backup undefined error" }, + { 1342, AE, "Backup failed to allocate buffers (check configuration)" }, + { 1343, AE, "Backup failed to setup fs buffers (check configuration)" }, + { 1344, AE, "Backup failed to allocate tables (check configuration)" }, + { 1345, AE, "Backup failed to insert file header (check configuration)" }, + { 1346, AE, "Backup failed to insert table list (check configuration)" }, + { 1347, AE, "Backup failed to allocate table memory (check configuration)" }, + { 1348, AE, "Backup failed to allocate file record (check configuration)" }, + { 1349, AE, "Backup failed to allocate attribute record (check configuration)" }, + /** * Still uncategorized */ @@ -467,6 +519,7 @@ const ErrorStatusClassification StatusClassificationMapping[] = { { ST_S, NE, "No error"}, { ST_P, AE, "Application error"}, + { ST_P, CE, "Configuration or application error"}, { ST_P, ND, "No data found"}, { ST_P, CV, "Constraint violation"}, { ST_P, SE, "Schema error"}, From 41ade141aa5f134711eadbfd45183634049842cb Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 29 Nov 2004 17:41:47 +0200 Subject: [PATCH 0357/1063] Applied some Netware related patches. client/mysqladmin.cc: Added option to mysqladmin for Netware. netware/comp_err.def: Copyright notice update, for Netware. netware/isamchk.def: Copyright notice update, for Netware. netware/isamlog.def: Copyright notice update, for Netware. netware/libmysql.def: Copyright notice update, for Netware. netware/my_print_defaults.def: Copyright notice update, for Netware. netware/myisam_ftdump.def: Copyright notice update, for Netware. netware/myisamchk.def: Copyright notice update, for Netware. netware/myisamlog.def: Copyright notice update, for Netware. netware/myisampack.def: Copyright notice update, for Netware. netware/mysql.def: Copyright notice update, for Netware. netware/mysql_install.def: Copyright notice update, for Netware. netware/mysql_install_db.def: Copyright notice update, for Netware. netware/mysql_test_run.def: Copyright notice update, for Netware. netware/mysql_waitpid.def: Copyright notice update, for Netware. netware/mysqladmin.def: Copyright notice update, for Netware. netware/mysqlbinlog.def: Copyright notice update, for Netware. netware/mysqlcheck.def: Copyright notice update, for Netware. netware/mysqld.def: Copyright notice update, for Netware. netware/mysqld_safe.def: Copyright notice update, for Netware. netware/mysqldump.def: Copyright notice update, for Netware. netware/mysqlimport.def: Copyright notice update, for Netware. netware/mysqlshow.def: Copyright notice update, for Netware. netware/mysqltest.def: Copyright notice update, for Netware. netware/pack_isam.def: Copyright notice update, for Netware. netware/perror.def: Copyright notice update, for Netware. netware/replace.def: Copyright notice update, for Netware. netware/resolve_stack_dump.def: Copyright notice update, for Netware. netware/resolveip.def: Copyright notice update, for Netware. sql/mysqld.cc: Changes to fix the abend on NetWare on recieving the server down and volume deactivation events. Do not join for the main thread if these events occur --- client/mysqladmin.cc | 9 +++++++++ netware/comp_err.def | 2 +- netware/isamchk.def | 2 +- netware/isamlog.def | 2 +- netware/libmysql.def | 2 +- netware/my_print_defaults.def | 2 +- netware/myisam_ftdump.def | 2 +- netware/myisamchk.def | 2 +- netware/myisamlog.def | 2 +- netware/myisampack.def | 2 +- netware/mysql.def | 2 +- netware/mysql_install.def | 2 +- netware/mysql_install_db.def | 2 +- netware/mysql_test_run.def | 2 +- netware/mysql_waitpid.def | 2 +- netware/mysqladmin.def | 2 +- netware/mysqlbinlog.def | 2 +- netware/mysqlcheck.def | 2 +- netware/mysqld.def | 2 +- netware/mysqld_safe.def | 2 +- netware/mysqldump.def | 2 +- netware/mysqlimport.def | 2 +- netware/mysqlshow.def | 2 +- netware/mysqltest.def | 2 +- netware/pack_isam.def | 2 +- netware/perror.def | 2 +- netware/replace.def | 2 +- netware/resolve_stack_dump.def | 2 +- netware/resolveip.def | 2 +- sql/mysqld.cc | 25 +++++++++++++++---------- 30 files changed, 52 insertions(+), 38 deletions(-) diff --git a/client/mysqladmin.cc b/client/mysqladmin.cc index 8491d0df7b5..b95ad83f7e8 100644 --- a/client/mysqladmin.cc +++ b/client/mysqladmin.cc @@ -125,6 +125,10 @@ static TYPELIB command_typelib= static struct my_option my_long_options[] = { +#ifdef __NETWARE__ + {"autoclose", 'a', " Auto close the screen on exit for NetWare", + 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, +#endif {"count", 'c', "Number of iterations to make. This works with -i (--sleep) only.", (gptr*) &nr_iterations, (gptr*) &nr_iterations, 0, GET_UINT, @@ -218,6 +222,11 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), int error = 0; switch(optid) { +#ifdef __NETWARE__ + case 'a': + setscreenmode(SCR_AUTOCLOSE_ON_EXIT); // auto close the screen / + break; +#endif case 'c': opt_count_iterations= 1; break; diff --git a/netware/comp_err.def b/netware/comp_err.def index d694c07174a..f27b40c7b78 100644 --- a/netware/comp_err.def +++ b/netware/comp_err.def @@ -2,7 +2,7 @@ # MySQL Error File Compiler #------------------------------------------------------------------------------ MODULE libc.nlm -COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." +COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." DESCRIPTION "MySQL Error File Compiler" VERSION 4, 0 XDCDATA ../netware/mysql.xdc diff --git a/netware/isamchk.def b/netware/isamchk.def index 69e8ac0405b..31cf3fc569a 100644 --- a/netware/isamchk.def +++ b/netware/isamchk.def @@ -3,7 +3,7 @@ #------------------------------------------------------------------------------ MODULE libc.nlm SCREENNAME "MySQL ISAM Table Check Tool" -COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." +COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." DESCRIPTION "MySQL ISAM Table Check Tool" VERSION 4, 0 STACKSIZE 65536 diff --git a/netware/isamlog.def b/netware/isamlog.def index bb8312066ef..52f9de0d928 100644 --- a/netware/isamlog.def +++ b/netware/isamlog.def @@ -2,7 +2,7 @@ # ISAM Log #------------------------------------------------------------------------------ MODULE libc.nlm -COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." +COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." DESCRIPTION "MySQL ISAM Table Log Tool" VERSION 4, 0 XDCDATA ../netware/mysql.xdc diff --git a/netware/libmysql.def b/netware/libmysql.def index 7804c4468a5..fea117dedd1 100644 --- a/netware/libmysql.def +++ b/netware/libmysql.def @@ -3,7 +3,7 @@ #------------------------------------------------------------------------------ MODULE libc.nlm EXPORT @libmysql.imp -COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." +COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." DESCRIPTION "MySQL Client Library" VERSION 4, 0 AUTOUNLOAD diff --git a/netware/my_print_defaults.def b/netware/my_print_defaults.def index 49f167341ae..826981256b5 100644 --- a/netware/my_print_defaults.def +++ b/netware/my_print_defaults.def @@ -2,7 +2,7 @@ # My Print Defaults #------------------------------------------------------------------------------ MODULE libc.nlm -COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." +COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." DESCRIPTION "MySQL Print Defaults Tool" VERSION 4, 0 XDCDATA ../netware/mysql.xdc diff --git a/netware/myisam_ftdump.def b/netware/myisam_ftdump.def index 259d6617445..9639404b53b 100644 --- a/netware/myisam_ftdump.def +++ b/netware/myisam_ftdump.def @@ -3,7 +3,7 @@ #------------------------------------------------------------------------------ MODULE libc.nlm SCREENNAME "MySQL MyISAM Table Dump Tool" -COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." +COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." DESCRIPTION "MySQL MyISAM Table Dump Tool" VERSION 4, 0 STACKSIZE 65536 diff --git a/netware/myisamchk.def b/netware/myisamchk.def index cdfe186058f..eaa01730872 100644 --- a/netware/myisamchk.def +++ b/netware/myisamchk.def @@ -3,7 +3,7 @@ #------------------------------------------------------------------------------ MODULE libc.nlm SCREENNAME "MySQL MyISAM Table Check Tool" -COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." +COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." DESCRIPTION "MySQL MyISAM Table Check Tool" VERSION 4, 0 STACKSIZE 65536 diff --git a/netware/myisamlog.def b/netware/myisamlog.def index 5c4cbb23361..3580c870c10 100644 --- a/netware/myisamlog.def +++ b/netware/myisamlog.def @@ -3,7 +3,7 @@ #------------------------------------------------------------------------------ MODULE libc.nlm SCREENNAME "MySQL MyISAM Table Log Tool" -COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." +COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." DESCRIPTION "MySQL MyISAM Table Log Tool" VERSION 4, 0 XDCDATA ../netware/mysql.xdc diff --git a/netware/myisampack.def b/netware/myisampack.def index 9111538c2c0..a6946982236 100644 --- a/netware/myisampack.def +++ b/netware/myisampack.def @@ -3,7 +3,7 @@ #------------------------------------------------------------------------------ MODULE libc.nlm SCREENNAME "MySQL MyISAM Table Pack Tool" -COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." +COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." DESCRIPTION "MySQL MyISAM Table Pack Tool" VERSION 4, 0 XDCDATA ../netware/mysql.xdc diff --git a/netware/mysql.def b/netware/mysql.def index 9b4424ed4fb..5ae8dc102a0 100644 --- a/netware/mysql.def +++ b/netware/mysql.def @@ -3,7 +3,7 @@ #------------------------------------------------------------------------------ MODULE libc.nlm SCREENNAME "MySQL Monitor" -COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." +COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." DESCRIPTION "MySQL Monitor" VERSION 4, 0 MULTIPLE diff --git a/netware/mysql_install.def b/netware/mysql_install.def index 87fc76919f9..3392afb7298 100644 --- a/netware/mysql_install.def +++ b/netware/mysql_install.def @@ -2,7 +2,7 @@ # My Print Defaults #------------------------------------------------------------------------------ MODULE libc.nlm -COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." +COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." DESCRIPTION "MySQL Install Tool" VERSION 4, 0 XDCDATA ../netware/mysql.xdc diff --git a/netware/mysql_install_db.def b/netware/mysql_install_db.def index 4653638b5ad..1657b7c17af 100644 --- a/netware/mysql_install_db.def +++ b/netware/mysql_install_db.def @@ -3,7 +3,7 @@ #------------------------------------------------------------------------------ MODULE libc.nlm SCREENNAME "MySQL Install" -COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." +COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." DESCRIPTION "MySQL Initial Database Installer" VERSION 4, 0 XDCDATA ../netware/mysql.xdc diff --git a/netware/mysql_test_run.def b/netware/mysql_test_run.def index b34f62a1f91..d4d4baee168 100644 --- a/netware/mysql_test_run.def +++ b/netware/mysql_test_run.def @@ -4,7 +4,7 @@ MODULE libc.nlm STACKSIZE 65536 SCREENNAME "MySQL Test Run" -COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." +COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." DESCRIPTION "MySQL Test Run" VERSION 4, 0 XDCDATA ../netware/mysql.xdc diff --git a/netware/mysql_waitpid.def b/netware/mysql_waitpid.def index 4d56d29c42f..da0884ccba3 100644 --- a/netware/mysql_waitpid.def +++ b/netware/mysql_waitpid.def @@ -3,7 +3,7 @@ #------------------------------------------------------------------------------ MODULE libc.nlm #SCREENNAME "MySQL Tool - Wait for a Program to Terminate" -COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." +COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." DESCRIPTION "MySQL Tool - Wait for a Program to Terminate" VERSION 4, 0 STACKSIZE 65536 diff --git a/netware/mysqladmin.def b/netware/mysqladmin.def index 0ace36992b1..46f90d531fa 100644 --- a/netware/mysqladmin.def +++ b/netware/mysqladmin.def @@ -3,7 +3,7 @@ #------------------------------------------------------------------------------ MODULE libc.nlm SCREENNAME "MySQL Admin" -COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." +COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." DESCRIPTION "MySQL Admin Tool" VERSION 4, 0 XDCDATA ../netware/mysql.xdc diff --git a/netware/mysqlbinlog.def b/netware/mysqlbinlog.def index 89677b4a353..25a470e7353 100644 --- a/netware/mysqlbinlog.def +++ b/netware/mysqlbinlog.def @@ -3,7 +3,7 @@ #------------------------------------------------------------------------------ MODULE libc.nlm SCREENNAME "MySQL Binary Log Dump Tool" -COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." +COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." DESCRIPTION "MySQL Binary Log Dump Tool" VERSION 4, 0 XDCDATA ../netware/mysql.xdc diff --git a/netware/mysqlcheck.def b/netware/mysqlcheck.def index 8820e9aae8e..7067b1d1729 100644 --- a/netware/mysqlcheck.def +++ b/netware/mysqlcheck.def @@ -3,7 +3,7 @@ #------------------------------------------------------------------------------ MODULE libc.nlm SCREENNAME "MySQL Check Tool" -COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." +COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." DESCRIPTION "MySQL Check Tool" VERSION 4, 0 XDCDATA ../netware/mysql.xdc diff --git a/netware/mysqld.def b/netware/mysqld.def index 6856aefe56c..42c2d176a1b 100644 --- a/netware/mysqld.def +++ b/netware/mysqld.def @@ -2,7 +2,7 @@ # MySQL Server #------------------------------------------------------------------------------ MODULE libc.nlm -COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." +COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." DESCRIPTION "MySQL Database Server" VERSION 4, 0 MULTIPLE diff --git a/netware/mysqld_safe.def b/netware/mysqld_safe.def index 9080ef783c9..2a9ef04b47d 100644 --- a/netware/mysqld_safe.def +++ b/netware/mysqld_safe.def @@ -3,7 +3,7 @@ #------------------------------------------------------------------------------ MODULE libc.nlm SCREENNAME "MySQL Database Server" -COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." +COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." DESCRIPTION "MySQL Database Server Monitor" VERSION 4, 0 MULTIPLE diff --git a/netware/mysqldump.def b/netware/mysqldump.def index 901c9b262dc..ddacf7bc0d5 100644 --- a/netware/mysqldump.def +++ b/netware/mysqldump.def @@ -3,7 +3,7 @@ #------------------------------------------------------------------------------ MODULE libc.nlm SCREENNAME "MySQL Dump Tool" -COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." +COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." DESCRIPTION "MySQL Dump Tool" VERSION 4, 0 XDCDATA ../netware/mysql.xdc diff --git a/netware/mysqlimport.def b/netware/mysqlimport.def index d6f7fcb6bbd..5253da42567 100644 --- a/netware/mysqlimport.def +++ b/netware/mysqlimport.def @@ -3,7 +3,7 @@ #------------------------------------------------------------------------------ MODULE libc.nlm SCREENNAME "MySQL Import" -COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." +COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." DESCRIPTION "MySQL Import Tool" VERSION 4, 0 XDCDATA ../netware/mysql.xdc diff --git a/netware/mysqlshow.def b/netware/mysqlshow.def index 2b41386f643..0b61b81dcf9 100644 --- a/netware/mysqlshow.def +++ b/netware/mysqlshow.def @@ -3,7 +3,7 @@ #------------------------------------------------------------------------------ MODULE libc.nlm SCREENNAME "MySQL Show" -COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." +COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." DESCRIPTION "MySQL Show Tool" VERSION 4, 0 XDCDATA ../netware/mysql.xdc diff --git a/netware/mysqltest.def b/netware/mysqltest.def index d98f6436a4a..e134acede07 100644 --- a/netware/mysqltest.def +++ b/netware/mysqltest.def @@ -2,7 +2,7 @@ # MySQL Admin #------------------------------------------------------------------------------ MODULE libc.nlm -COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." +COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." DESCRIPTION "MySQL Test Case Tool" VERSION 4, 0 XDCDATA ../netware/mysql.xdc diff --git a/netware/pack_isam.def b/netware/pack_isam.def index f0f5a7e328a..b93cfdffbeb 100644 --- a/netware/pack_isam.def +++ b/netware/pack_isam.def @@ -2,7 +2,7 @@ # Pack ISAM #------------------------------------------------------------------------------ MODULE libc.nlm -COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." +COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." DESCRIPTION "MySQL ISAM Table Pack Tool" VERSION 4, 0 XDCDATA ../netware/mysql.xdc diff --git a/netware/perror.def b/netware/perror.def index f1d23715f55..18c95d8b236 100644 --- a/netware/perror.def +++ b/netware/perror.def @@ -2,7 +2,7 @@ # PERROR #------------------------------------------------------------------------------ MODULE libc.nlm -COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." +COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." DESCRIPTION "MySQL Error Code Description Tool" VERSION 4, 0 XDCDATA ../netware/mysql.xdc diff --git a/netware/replace.def b/netware/replace.def index b55690152b9..19348ee4245 100644 --- a/netware/replace.def +++ b/netware/replace.def @@ -2,7 +2,7 @@ # Replace #------------------------------------------------------------------------------ MODULE libc.nlm -COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." +COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." DESCRIPTION "MySQL Text Replacement Tool" VERSION 4, 0 XDCDATA ../netware/mysql.xdc diff --git a/netware/resolve_stack_dump.def b/netware/resolve_stack_dump.def index 21fd177fbc7..01042699d61 100644 --- a/netware/resolve_stack_dump.def +++ b/netware/resolve_stack_dump.def @@ -3,7 +3,7 @@ #------------------------------------------------------------------------------ MODULE libc.nlm #SCREENNAME "MySQL Stack Dump Resolve Tool" -COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." +COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." DESCRIPTION "MySQL Stack Dump Resolve Tool" VERSION 4, 0 STACKSIZE 65536 diff --git a/netware/resolveip.def b/netware/resolveip.def index 10b99304e22..244f52bb969 100644 --- a/netware/resolveip.def +++ b/netware/resolveip.def @@ -2,7 +2,7 @@ # Resolve IP #------------------------------------------------------------------------------ MODULE libc.nlm -COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." +COPYRIGHT "(c) 2003-2005 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved." DESCRIPTION "MySQL IP/Hostname Resolve Tool" VERSION 4, 0 XDCDATA ../netware/mysql.xdc diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 43407b345fa..46de547e665 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -146,6 +146,7 @@ static VolumeID_t datavolid; static event_handle_t eh; static Report_t ref; static void *refneb= NULL; +my_bool event_flag= FALSE; static int volumeid= -1; /* NEB event callback */ @@ -815,7 +816,8 @@ static void __cdecl kill_server(int sig_ptr) else unireg_end(); #ifdef __NETWARE__ - pthread_join(select_thread, NULL); // wait for main thread + if (!event_flag) + pthread_join(select_thread, NULL); // wait for main thread #endif /* __NETWARE__ */ pthread_exit(0); /* purecov: deadcode */ @@ -1525,20 +1527,20 @@ static void check_data_home(const char *path) // down server event callback void mysql_down_server_cb(void *, void *) { + event_flag = TRUE; kill_server(0); } // destroy callback resources void mysql_cb_destroy(void *) -{ - UnRegisterEventNotification(eh); // cleanup down event notification +{ + UnRegisterEventNotification(eh); // cleanup down event notification NX_UNWRAP_INTERFACE(ref); - - /* Deregister NSS volume deactivation event */ - NX_UNWRAP_INTERFACE(refneb); + /* Deregister NSS volume deactivation event */ + NX_UNWRAP_INTERFACE(refneb); if (neb_consumer_id) - UnRegisterConsumer(neb_consumer_id, NULL); + UnRegisterConsumer(neb_consumer_id, NULL); } @@ -1558,7 +1560,7 @@ void mysql_cb_init() Register for volume deactivation event Wrap the callback function, as it is called by non-LibC thread */ - (void)NX_WRAP_INTERFACE(neb_event_callback, 1, &refneb); + (void *) NX_WRAP_INTERFACE(neb_event_callback, 1, &refneb); registerwithneb(); NXVmRegisterExitHandler(mysql_cb_destroy, NULL); // clean-up @@ -1655,7 +1657,9 @@ ulong neb_event_callback(struct EventBlock *eblock) { consoleprintf("MySQL data volume is deactivated, shutting down MySQL Server \n"); nw_panic = TRUE; + event_flag= TRUE; kill_server(0); + } } return 0; @@ -1729,8 +1733,8 @@ static void init_signals(void) for (uint i=0 ; i < sizeof(signals)/sizeof(int) ; i++) signal(signals[i], kill_server); mysql_cb_init(); // initialize callbacks -} +} static void start_signal_handler(void) { @@ -3008,7 +3012,7 @@ we force server id to 2, but this MySQL server will not act as a slave."); #endif /* __NT__ */ /* (void) pthread_attr_destroy(&connection_attrib); */ - + DBUG_PRINT("quit",("Exiting main thread")); #ifndef __WIN__ @@ -3058,6 +3062,7 @@ we force server id to 2, but this MySQL server will not act as a slave."); #endif clean_up_mutexes(); my_end(opt_endinfo ? MY_CHECK_ERROR | MY_GIVE_INFO : 0); + exit(0); return(0); /* purecov: deadcode */ } From b4779bbb8c1951e99b62d5f7c70ac9169fb3251a Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 30 Nov 2004 02:26:24 +0100 Subject: [PATCH 0358/1063] mysqldump.c: minor cleanup to the --order-by-primary feature code client/mysqldump.c: minor cleanup to the --order-by-primary feature code --- client/mysqldump.c | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/client/mysqldump.c b/client/mysqldump.c index ba903ec1796..d68ae6cefed 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -288,8 +288,8 @@ static struct my_option my_long_options[] = (gptr*) &opt_mysql_unix_port, (gptr*) &opt_mysql_unix_port, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"order-by-primary", OPT_ORDER_BY_PRIMARY, - "Sorts each table's rows by primary key, or first unique key, if such a key exists. Useful if dump will be loaded into an InnoDB table.", - 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, + "Sorts each table's rows by primary key, or first unique key, if such a key exists. Useful when dumping a MyISAM table to be loaded into an InnoDB table, but will make the dump itself take considerably longer.", + (gptr*) &opt_order_by_primary, (gptr*) &opt_order_by_primary, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, #include {"tab",'T', "Creates tab separated textfile for each table to given path. (creates .sql and .txt files). NOTE: This only works if mysqldump is run on the same machine as the mysqld daemon.", @@ -543,9 +543,6 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), opt_comments= opt_drop= opt_disable_keys= opt_lock= 0; opt_set_charset= 0; } - case (int) OPT_ORDER_BY_PRIMARY: - opt_order_by_primary = 1; - break; case (int) OPT_TABLES: opt_databases=0; break; @@ -1463,7 +1460,6 @@ static void dumpTable(uint numFields, char *table) fputs("\n", md_result_file); check_io(md_result_file); } - fprintf(stderr, "-- [%s]\n", query); if (mysql_query(sock, query)) { DBerror(sock, "when retrieving data from server"); @@ -2141,7 +2137,7 @@ static char *primary_key_fields(const char *table_name) MYSQL_ROW row; /* SHOW KEYS FROM + table name * 2 (escaped) + 2 quotes + \0 */ char show_keys_buff[15 + 64 * 2 + 3]; - uint result_length = 0, first_unique_pos = 0; + uint result_length = 0; char *result = 0; sprintf(show_keys_buff, "SHOW KEYS FROM %s", table_name); @@ -2155,18 +2151,18 @@ static char *primary_key_fields(const char *table_name) goto cleanup; } - /* Figure out the length of the ORDER BY clause result */ - while ((row = mysql_fetch_row(res))) + /* + * Figure out the length of the ORDER BY clause result. + * Note that SHOW KEYS is ordered: a PRIMARY key is always the first + * row, and UNIQUE keys come before others. So we only need to check + * the first key, not all keys. + */ + if ((row = mysql_fetch_row(res)) && atoi(row[1]) == 0) { - if (atoi(row[1]) == 0) /* Key is unique */ - { - do - result_length += strlen(row[4]) + 1; /* + 1 for ',' or \0 */ - while ((row = mysql_fetch_row(res)) && atoi(row[3]) > 1); - - break; - } - ++first_unique_pos; + /* Key is unique */ + do + result_length += strlen(row[4]) + 1; /* + 1 for ',' or \0 */ + while ((row = mysql_fetch_row(res)) && atoi(row[3]) > 1); } /* Build the ORDER BY clause result */ @@ -2178,7 +2174,7 @@ static char *primary_key_fields(const char *table_name) fprintf(stderr, "Error: Not enough memory to store ORDER BY clause\n"); goto cleanup; } - mysql_data_seek(res, first_unique_pos); + mysql_data_seek(res, 0); row = mysql_fetch_row(res); end = strmov(result, row[4]); while ((row = mysql_fetch_row(res)) && atoi(row[3]) > 1) From 94a5379fbee59545e6c71aaeb4731e88cf25bece Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 30 Nov 2004 07:41:26 +0100 Subject: [PATCH 0359/1063] ndb - fixed long overdue problems with unique indexes and null values mysql-test/r/ndb_index_unique.result: Test of unique index and null mysql-test/t/ndb_index_unique.test: Test of unique index and null sql/ha_ndbcluster.cc: Fixed long overdue problems with unique indexes and null values --- mysql-test/r/ndb_index_unique.result | 36 +++++++++++++++++++++++ mysql-test/t/ndb_index_unique.test | 20 +++++++++++++ sql/ha_ndbcluster.cc | 44 ++++++++++++++++++++++++---- 3 files changed, 94 insertions(+), 6 deletions(-) diff --git a/mysql-test/r/ndb_index_unique.result b/mysql-test/r/ndb_index_unique.result index af9b84022ed..9a5ef4dcca7 100644 --- a/mysql-test/r/ndb_index_unique.result +++ b/mysql-test/r/ndb_index_unique.result @@ -522,3 +522,39 @@ uid gid rid cid 1 1 2 3 1 1 2 4 drop table t1,t2,t3,t4,t5,t6,t7; +CREATE TABLE t1 ( +a int unsigned NOT NULL PRIMARY KEY, +b int unsigned, +c int unsigned, +UNIQUE bc(b,c) ) engine = ndb; +insert into t1 values(1,1,1),(2,NULL,2),(3,NULL,NULL),(4,4,NULL); +select * from t1 where b=1 and c=1; +a b c +1 1 1 +select * from t1 where b is null and c is null; +a b c +3 NULL NULL +select * from t1 where b is null and c = 2; +a b c +2 NULL 2 +select * from t1 where b = 4 and c is null; +a b c +4 4 NULL +create table t8 as +select * from t1 where (b = 1 and c = 1) +or (b is null and c is null) +or (b is null and c = 2) +or (b = 4 and c is null); +select * from t8 order by a; +a b c +1 1 1 +2 NULL 2 +3 NULL NULL +4 4 NULL +select * from t1 order by a; +a b c +1 1 1 +2 NULL 2 +3 NULL NULL +4 4 NULL +drop table t1, t8; diff --git a/mysql-test/t/ndb_index_unique.test b/mysql-test/t/ndb_index_unique.test index bdb23949763..5cfc069d75f 100644 --- a/mysql-test/t/ndb_index_unique.test +++ b/mysql-test/t/ndb_index_unique.test @@ -231,4 +231,24 @@ select * from t4 where rid = 2 order by cid; drop table t1,t2,t3,t4,t5,t6,t7; +# test null in indexes +CREATE TABLE t1 ( + a int unsigned NOT NULL PRIMARY KEY, + b int unsigned, + c int unsigned, + UNIQUE bc(b,c) ) engine = ndb; + +insert into t1 values(1,1,1),(2,NULL,2),(3,NULL,NULL),(4,4,NULL); +select * from t1 where b=1 and c=1; +select * from t1 where b is null and c is null; +select * from t1 where b is null and c = 2; +select * from t1 where b = 4 and c is null; +create table t8 as +select * from t1 where (b = 1 and c = 1) + or (b is null and c is null) + or (b is null and c = 2) + or (b = 4 and c is null); +select * from t8 order by a; +select * from t1 order by a; +drop table t1, t8; diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 1962065d617..77adf0d7ed3 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -1156,9 +1156,10 @@ int ha_ndbcluster::unique_index_read(const byte *key, for (i= 0; key_part != end; key_part++, i++) { - if (set_ndb_key(op, key_part->field, i, key_ptr)) + if (set_ndb_key(op, key_part->field, i, + key_part->null_bit ? key_ptr + 1 : key_ptr)) ERR_RETURN(trans->getNdbError()); - key_ptr+= key_part->length; + key_ptr+= key_part->store_length; } // Get non-index attribute(s) @@ -2243,6 +2244,28 @@ int ha_ndbcluster::index_end() DBUG_RETURN(close_scan()); } +/** + * Check if key contains null + */ +static +int +check_null_in_key(const KEY* key_info, const byte *key, uint key_len) +{ + KEY_PART_INFO *curr_part, *end_part; + const byte* end_ptr = key + key_len; + curr_part= key_info->key_part; + end_part= curr_part + key_info->key_parts; + + + for (; curr_part != end_part && key < end_ptr; curr_part++) + { + if(curr_part->null_bit && *key) + return 1; + + key += curr_part->store_length; + } + return 0; +} int ha_ndbcluster::index_read(byte *buf, const byte *key, uint key_len, @@ -2260,6 +2283,8 @@ int ha_ndbcluster::index_read(byte *buf, case PRIMARY_KEY_INDEX: if (find_flag == HA_READ_KEY_EXACT && key_info->key_length == key_len) { + if(m_active_cursor && (error= close_scan())) + DBUG_RETURN(error); DBUG_RETURN(pk_read(key, key_len, buf)); } else if (type == PRIMARY_KEY_INDEX) @@ -2269,8 +2294,11 @@ int ha_ndbcluster::index_read(byte *buf, break; case UNIQUE_ORDERED_INDEX: case UNIQUE_INDEX: - if (find_flag == HA_READ_KEY_EXACT && key_info->key_length == key_len) + if (find_flag == HA_READ_KEY_EXACT && key_info->key_length == key_len && + !check_null_in_key(key_info, key, key_len)) { + if(m_active_cursor && (error= close_scan())) + DBUG_RETURN(error); DBUG_RETURN(unique_index_read(key, key_len, buf)); } else if (type == UNIQUE_INDEX) @@ -2374,6 +2402,8 @@ int ha_ndbcluster::read_range_first_to_buf(const key_range *start_key, start_key->length == key_info->key_length && start_key->flag == HA_READ_KEY_EXACT) { + if(m_active_cursor && (error= close_scan())) + DBUG_RETURN(error); error= pk_read(start_key->key, start_key->length, buf); DBUG_RETURN(error == HA_ERR_KEY_NOT_FOUND ? HA_ERR_END_OF_FILE : error); } @@ -2381,10 +2411,12 @@ int ha_ndbcluster::read_range_first_to_buf(const key_range *start_key, case UNIQUE_ORDERED_INDEX: case UNIQUE_INDEX: key_info= table->key_info + active_index; - if (start_key && - start_key->length == key_info->key_length && - start_key->flag == HA_READ_KEY_EXACT) + if (start_key && start_key->length == key_info->key_length && + start_key->flag == HA_READ_KEY_EXACT && + !check_null_in_key(key_info, start_key->key, start_key->length)) { + if(m_active_cursor && (error= close_scan())) + DBUG_RETURN(error); error= unique_index_read(start_key->key, start_key->length, buf); DBUG_RETURN(error == HA_ERR_KEY_NOT_FOUND ? HA_ERR_END_OF_FILE : error); } From 828cefb37d2c2a89d7079045cbc2f96a2e166dda Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 30 Nov 2004 08:41:16 +0000 Subject: [PATCH 0360/1063] added use of mysql_cluster in mysqld (e.g. for ndb-connectstring) added warning printout if --ndbcluster switch is given in a "non-cluster" binary --- sql/mysqld.cc | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 43407b345fa..da9bbb161ab 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -2237,7 +2237,13 @@ extern "C" pthread_handler_decl(handle_shutdown,arg) #endif -const char *load_default_groups[]= { "mysqld","server",MYSQL_BASE_VERSION,0,0}; +const char *load_default_groups[]= { +#ifdef HAVE_NDBCLUSTER_DB +"mysql_cluster", +#endif +"mysqld","server",MYSQL_BASE_VERSION,0,0}; +static const int load_default_groups_sz= +sizeof(load_default_groups)/sizeof(load_default_groups[0]); bool open_log(MYSQL_LOG *log, const char *hostname, const char *opt_name, const char *extension, @@ -2813,6 +2819,7 @@ int win_main(int argc, char **argv) int main(int argc, char **argv) #endif { + DEBUGGER_OFF; MY_INIT(argv[0]); // init my_sys library & pthreads @@ -3184,7 +3191,7 @@ int main(int argc, char **argv) and we are now stuck with it. */ if (my_strcasecmp(system_charset_info, argv[1],"mysql")) - load_default_groups[3]= argv[1]; + load_default_groups[load_default_groups_sz-2]= argv[1]; start_mode= 1; Service.Init(argv[1], mysql_service); return 0; @@ -3205,7 +3212,7 @@ int main(int argc, char **argv) opt_argv=argv; start_mode= 1; if (my_strcasecmp(system_charset_info, argv[2],"mysql")) - load_default_groups[3]= argv[2]; + load_default_groups[load_default_groups_sz-2]= argv[2]; Service.Init(argv[2], mysql_service); return 0; } @@ -6109,6 +6116,9 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), have_ndbcluster= SHOW_OPTION_YES; else have_ndbcluster= SHOW_OPTION_DISABLED; +#else + push_warning(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR, + 0,"this binary does not contain ndbcluster storage engine"); #endif break; case OPT_INNODB: From f2c1ccb4165aee222e2d92397e11bdbc3e99c0f0 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 30 Nov 2004 13:19:35 +0400 Subject: [PATCH 0361/1063] An additional test for 'CREATE DATABASE' with non-default character set. --- mysql-test/r/mysqldump.result | 22 ++++++++++++++++++++++ mysql-test/t/mysqldump.test | 4 ++++ 2 files changed, 26 insertions(+) diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index 5d6fbd713e8..239418733ba 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -352,3 +352,25 @@ USE `test`; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +create database mysqldump_test_db character set latin2 collate latin2_bin; + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */; + +CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqldump_test_db` /*!40100 DEFAULT CHARACTER SET latin2 COLLATE latin2_bin */; + +USE `mysqldump_test_db`; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; + +drop database mysqldump_test_db; diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test index 3d8f417bad0..295658f21a8 100644 --- a/mysql-test/t/mysqldump.test +++ b/mysql-test/t/mysqldump.test @@ -133,3 +133,7 @@ drop table t1; # --exec $MYSQL_DUMP --skip-comments --databases test + +create database mysqldump_test_db character set latin2 collate latin2_bin; +--exec $MYSQL_DUMP --skip-comments --databases mysqldump_test_db; +drop database mysqldump_test_db; From 736875513aea14b264c3afdad85b0f3d8413d04c Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 30 Nov 2004 09:22:33 +0000 Subject: [PATCH 0362/1063] add warnings for INNODB,BDB,ISAM being unavailable if switch to use is supplied, i.e. --bdb,--isam,--innodb --- sql/mysqld.cc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index f253ee682e6..0e0ce2cb179 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -6105,6 +6105,9 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), have_berkeley_db= SHOW_OPTION_YES; else have_berkeley_db= SHOW_OPTION_DISABLED; +#else + push_warning(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR, + 0,"this binary does not contain DBD storage engine"); #endif break; case OPT_ISAM: @@ -6113,6 +6116,9 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), have_isam= SHOW_OPTION_YES; else have_isam= SHOW_OPTION_DISABLED; +#else + push_warning(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR, + 0,"this binary does not contain ISAM storage engine"); #endif break; case OPT_NDBCLUSTER: @@ -6123,7 +6129,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), have_ndbcluster= SHOW_OPTION_DISABLED; #else push_warning(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR, - 0,"this binary does not contain ndbcluster storage engine"); + 0,"this binary does not contain NDBCLUSTER storage engine"); #endif break; case OPT_INNODB: @@ -6132,6 +6138,9 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), have_innodb= SHOW_OPTION_YES; else have_innodb= SHOW_OPTION_DISABLED; +#else + push_warning(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR, + 0,"this binary does not contain INNODB storage engine"); #endif break; case OPT_INNODB_DATA_FILE_PATH: From 45968d1ff72ca70635d871642758b193e4ca1127 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 30 Nov 2004 10:19:49 +0000 Subject: [PATCH 0363/1063] fixed bug/compiler warning rewrote safer added return value to shutdown nicer printouts removed exit at shutdown ndb/src/common/logger/Logger.cpp: fixed bug/compiler warning ndb/src/mgmapi/LocalConfig.cpp: removed compiler warning rewrote safer ndb/src/mgmclient/CommandInterpreter.cpp: added return value to shutdown nicer printouts removed exit at shutdown ndb/src/ndbapi/ndb_cluster_connection.cpp: fixed compiler warning --- ndb/src/common/logger/Logger.cpp | 2 +- ndb/src/mgmapi/LocalConfig.cpp | 22 ++++++++++++++------- ndb/src/mgmclient/CommandInterpreter.cpp | 24 ++++++++++++----------- ndb/src/ndbapi/ndb_cluster_connection.cpp | 2 +- 4 files changed, 30 insertions(+), 20 deletions(-) diff --git a/ndb/src/common/logger/Logger.cpp b/ndb/src/common/logger/Logger.cpp index 1dc3bd43716..f6f70fbeff7 100644 --- a/ndb/src/common/logger/Logger.cpp +++ b/ndb/src/common/logger/Logger.cpp @@ -174,7 +174,7 @@ Logger::addHandler(const BaseString &logstring) { logstring.split(logdest, ";"); for(i = 0; i < logdest.size(); i++) { - DBUG_PRINT("info",("adding: %s",logdest[i])); + DBUG_PRINT("info",("adding: %s",logdest[i].c_str())); Vector v_type_args; logdest[i].split(v_type_args, ":", 2); diff --git a/ndb/src/mgmapi/LocalConfig.cpp b/ndb/src/mgmapi/LocalConfig.cpp index 8f1e2ee8100..1dc805557ee 100644 --- a/ndb/src/mgmapi/LocalConfig.cpp +++ b/ndb/src/mgmapi/LocalConfig.cpp @@ -298,13 +298,21 @@ char * LocalConfig::makeConnectString(char *buf, int sz) { int p= BaseString::snprintf(buf,sz,"nodeid=%d", _ownNodeId); - for (int i = 0; (i < ids.size()) && (sz-p > 0); i++) - { - if (ids[i].type != MgmId_TCP) - continue; - p+=BaseString::snprintf(buf+p,sz-p,",%s:%d", - ids[i].name.c_str(), ids[i].port); - } + if (p < sz) + for (unsigned i = 0; i < ids.size(); i++) + { + if (ids[i].type != MgmId_TCP) + continue; + int new_p= p+BaseString::snprintf(buf+p,sz-p,",%s:%d", + ids[i].name.c_str(), ids[i].port); + if (new_p < sz) + p= new_p; + else + { + buf[p]= 0; + break; + } + } buf[sz-1]=0; return buf; } diff --git a/ndb/src/mgmclient/CommandInterpreter.cpp b/ndb/src/mgmclient/CommandInterpreter.cpp index 0fc9ada408e..ce8bafc36c5 100644 --- a/ndb/src/mgmclient/CommandInterpreter.cpp +++ b/ndb/src/mgmclient/CommandInterpreter.cpp @@ -97,7 +97,7 @@ private: void executeShow(char* parameters); void executeConnect(char* parameters); void executePurge(char* parameters); - void executeShutdown(char* parameters); + int executeShutdown(char* parameters); void executeRun(char* parameters); void executeInfo(char* parameters); void executeClusterLog(char* parameters); @@ -523,7 +523,7 @@ CommandInterpreter::execute_impl(const char *_line) DBUG_RETURN(true); } else if (strcasecmp(firstToken, "SHUTDOWN") == 0) { - executeShutdown(allAfterFirstToken); + m_error= executeShutdown(allAfterFirstToken); DBUG_RETURN(true); } else if (strcasecmp(firstToken, "CLUSTERLOG") == 0){ @@ -854,23 +854,23 @@ CommandInterpreter::executeHelp(char* parameters) * SHUTDOWN *****************************************************************************/ -void +int CommandInterpreter::executeShutdown(char* parameters) { ndb_mgm_cluster_state *state = ndb_mgm_get_status(m_mgmsrv); if(state == NULL) { ndbout_c("Could not get status"); printError(); - return; + return 1; } NdbAutoPtr ap1((char*)state); int result = 0; result = ndb_mgm_stop(m_mgmsrv, 0, 0); if (result < 0) { - ndbout << "Shutdown failed." << endl; + ndbout << "Shutdown off NDB Cluster storage node(s) failed." << endl; printError(); - return; + return result; } ndbout << result << " NDB Cluster storage node(s) have shutdown." << endl; @@ -885,21 +885,23 @@ CommandInterpreter::executeShutdown(char* parameters) ndbout << "Unable to locate management server, " << "shutdown manually with STOP" << endl; - return; + return 1; } } } - result = 0; result = ndb_mgm_stop(m_mgmsrv, 1, &mgm_id); if (result <= 0) { - ndbout << "Shutdown failed." << endl; + ndbout << "Shutdown of NDB Cluster management server failed." << endl; printError(); - return; + if (result == 0) + return 1; + return result; } + connected = false; ndbout << "NDB Cluster management server shutdown." << endl; - exit(0); + return 0; } /***************************************************************************** diff --git a/ndb/src/ndbapi/ndb_cluster_connection.cpp b/ndb/src/ndbapi/ndb_cluster_connection.cpp index b2043b2c2c1..8a5a61df171 100644 --- a/ndb/src/ndbapi/ndb_cluster_connection.cpp +++ b/ndb/src/ndbapi/ndb_cluster_connection.cpp @@ -128,7 +128,7 @@ int Ndb_cluster_connection::connect(int reconnect) new ConfigRetriever(m_connect_string, NDB_VERSION, NODE_TYPE_API); if (m_config_retriever->hasError()) { - printf("Could not connect initialize handle to management server", + printf("Could not connect initialize handle to management server: %s", m_config_retriever->getErrorString()); DBUG_RETURN(-1); } From 3eada05db21329d7a295994c075241927e58fc83 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 30 Nov 2004 10:22:50 +0000 Subject: [PATCH 0364/1063] mysqld.cc: fixed typo sql/mysqld.cc: fixed typo --- sql/mysqld.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 0e0ce2cb179..bb1a6bc25ba 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -6107,7 +6107,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), have_berkeley_db= SHOW_OPTION_DISABLED; #else push_warning(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR, - 0,"this binary does not contain DBD storage engine"); + 0,"this binary does not contain BDB storage engine"); #endif break; case OPT_ISAM: From 32fa7e0f4de03fe9ab118394644c50e0c8ae5da2 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 30 Nov 2004 15:10:48 +0400 Subject: [PATCH 0365/1063] Portability fix. Why not to use UINT_MAX32 here? --- sql/field.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/field.cc b/sql/field.cc index 72c27b6adf9..db4b8f352c7 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -1860,9 +1860,9 @@ int Field_long::store(double nr) set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } - else if (nr > (double) (ulong) ~0L) + else if (nr > (double) UINT_MAX32) { - res=(int32) (uint32) ~0L; + res= UINT_MAX32; set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); error= 1; } From 07ed8294fa83e1c5acd3ecc4691667690e578581 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 30 Nov 2004 12:02:53 +0000 Subject: [PATCH 0366/1063] added check connection mgmapi method added ndb_mgm_check_connection when error is printed ndb/include/mgmapi/mgmapi.h: added check connection mgmapi method ndb/src/mgmapi/mgmapi.cpp: added check connection mgmapi method ndb/src/mgmclient/CommandInterpreter.cpp: added mgm_check_check_connection when error is printed ndb/src/mgmsrv/Services.cpp: added check connection mgmapi method ndb/src/mgmsrv/Services.hpp: added check connection mgmapi method --- ndb/include/mgmapi/mgmapi.h | 1 + ndb/src/mgmapi/mgmapi.cpp | 34 ++++++++++++++++++++++++ ndb/src/mgmclient/CommandInterpreter.cpp | 7 ++--- ndb/src/mgmsrv/Services.cpp | 11 ++++++++ ndb/src/mgmsrv/Services.hpp | 1 + 5 files changed, 51 insertions(+), 3 deletions(-) diff --git a/ndb/include/mgmapi/mgmapi.h b/ndb/include/mgmapi/mgmapi.h index a23417f153a..26add86a468 100644 --- a/ndb/include/mgmapi/mgmapi.h +++ b/ndb/include/mgmapi/mgmapi.h @@ -746,6 +746,7 @@ extern "C" { int ndb_mgm_get_string_parameter(const ndb_mgm_configuration_iterator*, int param, const char ** value); int ndb_mgm_purge_stale_sessions(NdbMgmHandle handle, char **); + int ndb_mgm_check_connection(NdbMgmHandle handle); #ifdef __cplusplus } #endif diff --git a/ndb/src/mgmapi/mgmapi.cpp b/ndb/src/mgmapi/mgmapi.cpp index 831d14eac52..e6328604c1b 100644 --- a/ndb/src/mgmapi/mgmapi.cpp +++ b/ndb/src/mgmapi/mgmapi.cpp @@ -1934,4 +1934,38 @@ ndb_mgm_purge_stale_sessions(NdbMgmHandle handle, char **purged){ return res; } +extern "C" +int +ndb_mgm_check_connection(NdbMgmHandle handle){ + CHECK_HANDLE(handle, 0); + CHECK_CONNECTED(handle, 0); + SocketOutputStream out(handle->socket); + SocketInputStream in(handle->socket, handle->read_timeout); + char buf[32]; + + if (out.println("check connection")) + goto ndb_mgm_check_connection_error; + + if (out.println("")) + goto ndb_mgm_check_connection_error; + + in.gets(buf, sizeof(buf)); + if(strcmp("check connection reply\n", buf)) + goto ndb_mgm_check_connection_error; + + in.gets(buf, sizeof(buf)); + if(strcmp("result: Ok\n", buf)) + goto ndb_mgm_check_connection_error; + + in.gets(buf, sizeof(buf)); + if(strcmp("\n", buf)) + goto ndb_mgm_check_connection_error; + + return 0; + +ndb_mgm_check_connection_error: + ndb_mgm_disconnect(handle); + return -1; +} + template class Vector*>; diff --git a/ndb/src/mgmclient/CommandInterpreter.cpp b/ndb/src/mgmclient/CommandInterpreter.cpp index ce8bafc36c5..f36dddf815d 100644 --- a/ndb/src/mgmclient/CommandInterpreter.cpp +++ b/ndb/src/mgmclient/CommandInterpreter.cpp @@ -429,6 +429,8 @@ emptyString(const char* s) void CommandInterpreter::printError() { + if (ndb_mgm_check_connection(m_mgmsrv)) + connected= false; ndbout_c("* %5d: %s", ndb_mgm_get_latest_error(m_mgmsrv), ndb_mgm_get_latest_error_msg(m_mgmsrv)); @@ -1030,9 +1032,6 @@ CommandInterpreter::executeShow(char* parameters) { int i; if (emptyString(parameters)) { - ndbout << "Cluster Configuration" << endl - << "---------------------" << endl; - ndb_mgm_cluster_state *state = ndb_mgm_get_status(m_mgmsrv); if(state == NULL) { ndbout_c("Could not get status"); @@ -1092,6 +1091,8 @@ CommandInterpreter::executeShow(char* parameters) } } + ndbout << "Cluster Configuration" << endl + << "---------------------" << endl; print_nodes(state, it, "ndbd", ndb_nodes, NDB_MGM_NODE_TYPE_NDB, master_id); print_nodes(state, it, "ndb_mgmd", mgm_nodes, NDB_MGM_NODE_TYPE_MGM, 0); print_nodes(state, it, "mysqld", api_nodes, NDB_MGM_NODE_TYPE_API, 0); diff --git a/ndb/src/mgmsrv/Services.cpp b/ndb/src/mgmsrv/Services.cpp index 0208805b2d3..5834d40cc78 100644 --- a/ndb/src/mgmsrv/Services.cpp +++ b/ndb/src/mgmsrv/Services.cpp @@ -244,6 +244,8 @@ ParserRow commands[] = { MGM_CMD("purge stale sessions", &MgmApiSession::purge_stale_sessions, ""), + MGM_CMD("check connection", &MgmApiSession::check_connection, ""), + MGM_END() }; @@ -1454,6 +1456,15 @@ MgmApiSession::purge_stale_sessions(Parser_t::Context &ctx, m_output->println(""); } +void +MgmApiSession::check_connection(Parser_t::Context &ctx, + const class Properties &args) +{ + m_output->println("check connection reply"); + m_output->println("result: Ok"); + m_output->println(""); +} + template class MutexVector; template class Vector const*>; template class Vector; diff --git a/ndb/src/mgmsrv/Services.hpp b/ndb/src/mgmsrv/Services.hpp index 7d614d6241c..6a5f06a659e 100644 --- a/ndb/src/mgmsrv/Services.hpp +++ b/ndb/src/mgmsrv/Services.hpp @@ -91,6 +91,7 @@ public: void listen_event(Parser_t::Context &ctx, const class Properties &args); void purge_stale_sessions(Parser_t::Context &ctx, const class Properties &args); + void check_connection(Parser_t::Context &ctx, const class Properties &args); void repCommand(Parser_t::Context &ctx, const class Properties &args); }; From cb6007ceb61a3733af011b1f0ff96e3951155f5b Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 30 Nov 2004 14:52:05 +0000 Subject: [PATCH 0367/1063] mysqld.cc: fixed erroneous previous push sql/mysqld.cc: fixed erroneous previous push --- sql/mysqld.cc | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index bb1a6bc25ba..f3c89b110af 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -6106,8 +6106,9 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), else have_berkeley_db= SHOW_OPTION_DISABLED; #else - push_warning(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR, - 0,"this binary does not contain BDB storage engine"); + if (opt_bdb) + push_warning(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR, + 0,"this binary does not contain BDB storage engine"); #endif break; case OPT_ISAM: @@ -6117,8 +6118,9 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), else have_isam= SHOW_OPTION_DISABLED; #else - push_warning(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR, - 0,"this binary does not contain ISAM storage engine"); + if (opt_isam) + push_warning(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR, + 0,"this binary does not contain ISAM storage engine"); #endif break; case OPT_NDBCLUSTER: @@ -6128,8 +6130,9 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), else have_ndbcluster= SHOW_OPTION_DISABLED; #else - push_warning(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR, - 0,"this binary does not contain NDBCLUSTER storage engine"); + if (opt_ndbcluster) + push_warning(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR, + 0,"this binary does not contain NDBCLUSTER storage engine"); #endif break; case OPT_INNODB: @@ -6139,8 +6142,9 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), else have_innodb= SHOW_OPTION_DISABLED; #else - push_warning(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR, - 0,"this binary does not contain INNODB storage engine"); + if (opt_innodb) + push_warning(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR, + 0,"this binary does not contain INNODB storage engine"); #endif break; case OPT_INNODB_DATA_FILE_PATH: From ea6614855fb2bc5a7e18e608524209d4546f0913 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 30 Nov 2004 15:08:26 +0000 Subject: [PATCH 0368/1063] ps_7ndb.result, ps_7ndb.test: ndb now runs ps tests just like the others mysql-test/t/ps_7ndb.test: ndb now runs ps tests just like the others mysql-test/r/ps_7ndb.result: ndb now runs ps tests just like the others --- mysql-test/r/ps_7ndb.result | 154 +++++++++------- mysql-test/t/ps_7ndb.test | 358 +----------------------------------- 2 files changed, 91 insertions(+), 421 deletions(-) diff --git a/mysql-test/r/ps_7ndb.result b/mysql-test/r/ps_7ndb.result index 70118509d0b..4fe7f57973f 100644 --- a/mysql-test/r/ps_7ndb.result +++ b/mysql-test/r/ps_7ndb.result @@ -2,20 +2,19 @@ use test; drop table if exists t1, t9 ; create table t1 ( -a int not null, b varchar(30), +a int, b varchar(30), primary key(a) ) engine = 'NDB' ; -drop table if exists t9; create table t9 ( -c1 tinyint not null, c2 smallint, c3 mediumint, c4 int, +c1 tinyint, c2 smallint, c3 mediumint, c4 int, c5 integer, c6 bigint, c7 float, c8 double, c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4), c13 date, c14 datetime, c15 timestamp(14), c16 time, c17 year, c18 bit, c19 bool, c20 char, -c21 char(10), c22 varchar(30), c23 char(100), c24 char(100), -c25 char(100), c26 char(100), c27 char(100), c28 char(100), -c29 char(100), c30 char(100), c31 enum('one', 'two', 'three'), +c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext, +c25 blob, c26 text, c27 mediumblob, c28 mediumtext, +c29 longblob, c30 longtext, c31 enum('one', 'two', 'three'), c32 set('monday', 'tuesday', 'wednesday'), primary key(c1) ) engine = 'NDB' ; @@ -72,14 +71,14 @@ def test t9 t9 c19 c19 1 1 1 Y 32768 0 63 def test t9 t9 c20 c20 254 1 1 Y 0 0 8 def test t9 t9 c21 c21 253 10 10 Y 0 0 8 def test t9 t9 c22 c22 253 30 30 Y 0 0 8 -def test t9 t9 c23 c23 253 100 8 Y 0 0 8 -def test t9 t9 c24 c24 253 100 8 Y 0 0 8 -def test t9 t9 c25 c25 253 100 4 Y 0 0 8 -def test t9 t9 c26 c26 253 100 4 Y 0 0 8 -def test t9 t9 c27 c27 253 100 10 Y 0 0 8 -def test t9 t9 c28 c28 253 100 10 Y 0 0 8 -def test t9 t9 c29 c29 253 100 8 Y 0 0 8 -def test t9 t9 c30 c30 253 100 8 Y 0 0 8 +def test t9 t9 c23 c23 252 255 8 Y 144 0 63 +def test t9 t9 c24 c24 252 255 8 Y 16 0 8 +def test t9 t9 c25 c25 252 65535 4 Y 144 0 63 +def test t9 t9 c26 c26 252 65535 4 Y 16 0 8 +def test t9 t9 c27 c27 252 16777215 10 Y 144 0 63 +def test t9 t9 c28 c28 252 16777215 10 Y 16 0 8 +def test t9 t9 c29 c29 252 16777215 8 Y 144 0 63 +def test t9 t9 c30 c30 252 16777215 8 Y 16 0 8 def test t9 t9 c31 c31 254 5 3 Y 256 0 8 def test t9 t9 c32 c32 254 24 7 Y 2048 0 8 c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32 @@ -1188,7 +1187,7 @@ c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; commit ; prepare stmt1 from 'delete from t1 where a=2' ; execute stmt1; -select a,b from t1 where a=2 order by b; +select a,b from t1 where a=2; a b execute stmt1; insert into t1 values(0,NULL); @@ -1270,18 +1269,23 @@ execute stmt1 using @arg00, @arg00; select a,b from t1 where a=@arg00; a b 2 two +execute stmt1 using @arg01, @arg00; select a,b from t1 where a=@arg01; a b +22 two execute stmt1 using @arg00, @arg01; select a,b from t1 where a=@arg00; a b 2 two set @arg00=NULL; set @arg01=2; +execute stmt1 using @arg00, @arg01; +Warnings: +Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 1 select a,b from t1 order by a; a b +0 two 1 one -2 two 3 three 4 four set @arg00=0; @@ -1302,15 +1306,19 @@ create table t2 as select a,b from t1 ; prepare stmt1 from 'update t1 set a=? where b=? and a in (select ? from t2 where b = ? or a = ?)'; +execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04 ; +affected rows: 1 +info: Rows matched: 1 Changed: 1 Warnings: 0 select a,b from t1 where a = @arg00 ; a b +23 two prepare stmt1 from 'update t1 set a=? where b=? and a not in (select ? from t2 where b = ? or a = ?)'; execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ; -affected rows: 0 -info: Rows matched: 0 Changed: 0 Warnings: 0 -select a,b from t1 order by a; +affected rows: 1 +info: Rows matched: 1 Changed: 1 Warnings: 0 +select a,b from t1 order by a ; a b 1 one 2 two @@ -1319,21 +1327,25 @@ a b drop table t2 ; create table t2 ( -a int not null, b varchar(30), +a int, b varchar(30), primary key(a) ) engine = 'NDB' ; insert into t2(a,b) select a, b from t1 ; prepare stmt1 from 'update t1 set a=? where b=? and a in (select ? from t2 where b = ? or a = ?)'; +execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04 ; +affected rows: 1 +info: Rows matched: 1 Changed: 1 Warnings: 0 select a,b from t1 where a = @arg00 ; a b +23 two prepare stmt1 from 'update t1 set a=? where b=? and a not in (select ? from t2 where b = ? or a = ?)'; execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ; -affected rows: 0 -info: Rows matched: 0 Changed: 0 Warnings: 0 +affected rows: 1 +info: Rows matched: 1 Changed: 1 Warnings: 0 select a,b from t1 order by a ; a b 1 one @@ -1474,7 +1486,7 @@ set @arg02=82 ; set @arg03='8-2' ; prepare stmt1 from 'insert into t1 values(?,?),(?,?)'; execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; -select a,b from t1 where a in (@arg00,@arg02) order by a ; +select a,b from t1 where a in (@arg00,@arg02) ; a b 81 8-1 82 8-2 @@ -1489,6 +1501,7 @@ set @arg00=6 ; set @arg01=1 ; prepare stmt1 from 'insert into t1 set a=?, b=''sechs'' on duplicate key update a=a + ?, b=concat(b,''modified'') '; +execute stmt1 using @arg00, @arg01; select * from t1 order by a; a b 0 NULL @@ -1497,13 +1510,15 @@ a b 3 three 4 four 5 five -6 six +7 sixmodified 8 eight 9 nine 81 8-1 82 8-2 set @arg00=81 ; set @arg01=1 ; +execute stmt1 using @arg00, @arg01; +ERROR 23000: Duplicate entry '82' for key 1 drop table if exists t2 ; create table t2 (id int auto_increment primary key) ENGINE= 'NDB' ; @@ -1526,23 +1541,32 @@ set @x1100="x1100" ; set @100=100 ; set @updated="updated" ; insert into t1 values(1000,'x1000_1') ; +insert into t1 values(@1000,@x1000_2),(@1000,@x1000_3) +on duplicate key update a = a + @100, b = concat(b,@updated) ; select a,b from t1 where a >= 1000 order by a ; a b -1000 x1000_1 +1000 x1000_3 +1100 x1000_1updated delete from t1 where a >= 1000 ; insert into t1 values(1000,'x1000_1') ; prepare stmt1 from ' insert into t1 values(?,?),(?,?) on duplicate key update a = a + ?, b = concat(b,?) '; +execute stmt1 using @1000, @x1000_2, @1000, @x1000_3, @100, @updated ; select a,b from t1 where a >= 1000 order by a ; a b -1000 x1000_1 +1000 x1000_3 +1100 x1000_1updated delete from t1 where a >= 1000 ; insert into t1 values(1000,'x1000_1') ; +execute stmt1 using @1000, @x1000_2, @1100, @x1000_3, @100, @updated ; select a,b from t1 where a >= 1000 order by a ; a b -1000 x1000_1 +1200 x1000_1updatedupdated delete from t1 where a >= 1000 ; prepare stmt1 from ' replace into t1 (a,b) select 100, ''hundred'' '; +execute stmt1; +execute stmt1; +execute stmt1; test_sequence ------ multi table tests ------ delete from t1 ; @@ -1891,13 +1915,13 @@ def @arg19 254 20 1 Y 128 31 63 def @arg20 254 8192 1 Y 0 31 8 def @arg21 254 8192 10 Y 0 31 8 def @arg22 254 8192 30 Y 0 31 8 -def @arg23 254 8192 8 Y 0 31 8 +def @arg23 254 8192 8 Y 128 31 63 def @arg24 254 8192 8 Y 0 31 8 -def @arg25 254 8192 4 Y 0 31 8 +def @arg25 254 8192 4 Y 128 31 63 def @arg26 254 8192 4 Y 0 31 8 -def @arg27 254 8192 10 Y 0 31 8 +def @arg27 254 8192 10 Y 128 31 63 def @arg28 254 8192 10 Y 0 31 8 -def @arg29 254 8192 8 Y 0 31 8 +def @arg29 254 8192 8 Y 128 31 63 def @arg30 254 8192 8 Y 0 31 8 def @arg31 254 8192 3 Y 0 31 8 def @arg32 254 8192 6 Y 128 31 63 @@ -1938,13 +1962,13 @@ def @arg19 254 20 0 Y 128 31 63 def @arg20 254 8192 0 Y 0 31 8 def @arg21 254 8192 0 Y 0 31 8 def @arg22 254 8192 0 Y 0 31 8 -def @arg23 254 8192 0 Y 0 31 8 +def @arg23 254 8192 0 Y 128 31 63 def @arg24 254 8192 0 Y 0 31 8 -def @arg25 254 8192 0 Y 0 31 8 +def @arg25 254 8192 0 Y 128 31 63 def @arg26 254 8192 0 Y 0 31 8 -def @arg27 254 8192 0 Y 0 31 8 +def @arg27 254 8192 0 Y 128 31 63 def @arg28 254 8192 0 Y 0 31 8 -def @arg29 254 8192 0 Y 0 31 8 +def @arg29 254 8192 0 Y 128 31 63 def @arg30 254 8192 0 Y 0 31 8 def @arg31 254 8192 0 Y 0 31 8 def @arg32 254 8192 0 Y 0 31 8 @@ -1988,13 +2012,13 @@ def @arg19 254 20 1 Y 128 31 63 def @arg20 254 8192 1 Y 0 31 8 def @arg21 254 8192 10 Y 0 31 8 def @arg22 254 8192 30 Y 0 31 8 -def @arg23 254 8192 8 Y 0 31 8 +def @arg23 254 8192 8 Y 128 31 63 def @arg24 254 8192 8 Y 0 31 8 -def @arg25 254 8192 4 Y 0 31 8 +def @arg25 254 8192 4 Y 128 31 63 def @arg26 254 8192 4 Y 0 31 8 -def @arg27 254 8192 10 Y 0 31 8 +def @arg27 254 8192 10 Y 128 31 63 def @arg28 254 8192 10 Y 0 31 8 -def @arg29 254 8192 8 Y 0 31 8 +def @arg29 254 8192 8 Y 128 31 63 def @arg30 254 8192 8 Y 0 31 8 def @arg31 254 8192 3 Y 0 31 8 def @arg32 254 8192 6 Y 128 31 63 @@ -2028,13 +2052,13 @@ def @arg19 254 20 0 Y 128 31 63 def @arg20 254 8192 0 Y 0 31 8 def @arg21 254 8192 0 Y 0 31 8 def @arg22 254 8192 0 Y 0 31 8 -def @arg23 254 8192 0 Y 0 31 8 +def @arg23 254 8192 0 Y 128 31 63 def @arg24 254 8192 0 Y 0 31 8 -def @arg25 254 8192 0 Y 0 31 8 +def @arg25 254 8192 0 Y 128 31 63 def @arg26 254 8192 0 Y 0 31 8 -def @arg27 254 8192 0 Y 0 31 8 +def @arg27 254 8192 0 Y 128 31 63 def @arg28 254 8192 0 Y 0 31 8 -def @arg29 254 8192 0 Y 0 31 8 +def @arg29 254 8192 0 Y 128 31 63 def @arg30 254 8192 0 Y 0 31 8 def @arg31 254 8192 0 Y 0 31 8 def @arg32 254 8192 0 Y 0 31 8 @@ -2076,13 +2100,13 @@ def @arg19 254 20 1 Y 128 31 63 def @arg20 254 8192 1 Y 0 31 8 def @arg21 254 8192 10 Y 0 31 8 def @arg22 254 8192 30 Y 0 31 8 -def @arg23 254 8192 8 Y 0 31 8 +def @arg23 254 8192 8 Y 128 31 63 def @arg24 254 8192 8 Y 0 31 8 -def @arg25 254 8192 4 Y 0 31 8 +def @arg25 254 8192 4 Y 128 31 63 def @arg26 254 8192 4 Y 0 31 8 -def @arg27 254 8192 10 Y 0 31 8 +def @arg27 254 8192 10 Y 128 31 63 def @arg28 254 8192 10 Y 0 31 8 -def @arg29 254 8192 8 Y 0 31 8 +def @arg29 254 8192 8 Y 128 31 63 def @arg30 254 8192 8 Y 0 31 8 def @arg31 254 8192 3 Y 0 31 8 def @arg32 254 8192 6 Y 128 31 63 @@ -2120,13 +2144,13 @@ def @arg19 254 20 0 Y 128 31 63 def @arg20 254 8192 0 Y 0 31 8 def @arg21 254 8192 0 Y 0 31 8 def @arg22 254 8192 0 Y 0 31 8 -def @arg23 254 8192 0 Y 0 31 8 +def @arg23 254 8192 0 Y 128 31 63 def @arg24 254 8192 0 Y 0 31 8 -def @arg25 254 8192 0 Y 0 31 8 +def @arg25 254 8192 0 Y 128 31 63 def @arg26 254 8192 0 Y 0 31 8 -def @arg27 254 8192 0 Y 0 31 8 +def @arg27 254 8192 0 Y 128 31 63 def @arg28 254 8192 0 Y 0 31 8 -def @arg29 254 8192 0 Y 0 31 8 +def @arg29 254 8192 0 Y 128 31 63 def @arg30 254 8192 0 Y 0 31 8 def @arg31 254 8192 0 Y 0 31 8 def @arg32 254 8192 0 Y 0 31 8 @@ -2166,13 +2190,13 @@ def @arg19 254 20 1 Y 128 31 63 def @arg20 254 8192 1 Y 0 31 8 def @arg21 254 8192 10 Y 0 31 8 def @arg22 254 8192 30 Y 0 31 8 -def @arg23 254 8192 8 Y 0 31 8 +def @arg23 254 8192 8 Y 128 31 63 def @arg24 254 8192 8 Y 0 31 8 -def @arg25 254 8192 4 Y 0 31 8 +def @arg25 254 8192 4 Y 128 31 63 def @arg26 254 8192 4 Y 0 31 8 -def @arg27 254 8192 10 Y 0 31 8 +def @arg27 254 8192 10 Y 128 31 63 def @arg28 254 8192 10 Y 0 31 8 -def @arg29 254 8192 8 Y 0 31 8 +def @arg29 254 8192 8 Y 128 31 63 def @arg30 254 8192 8 Y 0 31 8 def @arg31 254 8192 3 Y 0 31 8 def @arg32 254 8192 6 Y 128 31 63 @@ -2204,13 +2228,13 @@ def @arg19 254 20 0 Y 128 31 63 def @arg20 254 8192 0 Y 0 31 8 def @arg21 254 8192 0 Y 0 31 8 def @arg22 254 8192 0 Y 0 31 8 -def @arg23 254 8192 0 Y 0 31 8 +def @arg23 254 8192 0 Y 128 31 63 def @arg24 254 8192 0 Y 0 31 8 -def @arg25 254 8192 0 Y 0 31 8 +def @arg25 254 8192 0 Y 128 31 63 def @arg26 254 8192 0 Y 0 31 8 -def @arg27 254 8192 0 Y 0 31 8 +def @arg27 254 8192 0 Y 128 31 63 def @arg28 254 8192 0 Y 0 31 8 -def @arg29 254 8192 0 Y 0 31 8 +def @arg29 254 8192 0 Y 128 31 63 def @arg30 254 8192 0 Y 0 31 8 def @arg31 254 8192 0 Y 0 31 8 def @arg32 254 8192 0 Y 0 31 8 @@ -2770,14 +2794,14 @@ c1 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 41 4 41 41 41 41 41 41 41 41 41 41 42 4 42 42 42 42 42 42 42 42 42 42 43 4 43 43 43 43 43 43 43 43 43 43 -50 5 50 50 50 50 50 50 50 50 50 50 +50 5 50 50 50.00 50.00 50.00 50.00 50.00 50.00 50.00 50.00 51 5 51 51 51 51 51 51 51 51 51 51 -52 5 52 52 52 52 52 52 52 52 52 52 -53 5 53 53 53 53 53 53 53 53 53 53 -54 5 54 54 54 54 54 54 54 54 54 54 +52 5 52 52 52.00 52.00 52.00 52.00 52.00 52.00 52.00 52.00 +53 5 53 53 53.00 53.00 53.00 53.00 53.00 53.00 53.00 53.00 +54 5 54 54 54.00 54.00 54.00 54.00 54.00 54.00 54.00 54.00 55 5 55 55 55 55 55 55 55 55 55 55 -56 6 56 56 56 56 56 56 56 56 56 56 -57 6 57 57 57 57 57 57 57 57 57 57 +56 6 56 56 56.00 56.00 56.00 56.00 56.00 56.00 56.00 56.00 +57 6 57 57 57.00 57.00 57.00 57.00 57.00 57.00 57.00 57.00 60 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 61 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 62 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL diff --git a/mysql-test/t/ps_7ndb.test b/mysql-test/t/ps_7ndb.test index 22370a7f3ac..b558f2f3c21 100644 --- a/mysql-test/t/ps_7ndb.test +++ b/mysql-test/t/ps_7ndb.test @@ -12,365 +12,11 @@ use test; -- source include/have_ndb.inc let $type= 'NDB' ; ---disable_warnings -drop table if exists t1, t9 ; ---enable_warnings -eval create table t1 -( - a int not null, b varchar(30), - primary key(a) -) engine = $type ; - ---disable_warnings -drop table if exists t9; ---enable_warnings -# The used table type doesn't support BLOB/TEXT columns. -# (The server would send error 1163 .) -# So we use char(100) instead. -eval create table t9 -( - c1 tinyint not null, c2 smallint, c3 mediumint, c4 int, - c5 integer, c6 bigint, c7 float, c8 double, - c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4), - c13 date, c14 datetime, c15 timestamp(14), c16 time, - c17 year, c18 bit, c19 bool, c20 char, - c21 char(10), c22 varchar(30), c23 char(100), c24 char(100), - c25 char(100), c26 char(100), c27 char(100), c28 char(100), - c29 char(100), c30 char(100), c31 enum('one', 'two', 'three'), - c32 set('monday', 'tuesday', 'wednesday'), - primary key(c1) -) engine = $type ; +-- source include/ps_create.inc -- source include/ps_renew.inc -- source include/ps_query.inc -# The following line is deactivated, because the ndb storage engine is not able -# to do primary key column updates . -#-- source include/ps_modify.inc -# let's include all statements which will work ---disable_query_log -select '------ delete tests ------' as test_sequence ; ---enable_query_log ---source include/ps_renew.inc - -## delete without parameter -prepare stmt1 from 'delete from t1 where a=2' ; -execute stmt1; -select a,b from t1 where a=2 order by b; -# delete with row not found -execute stmt1; - -## delete with one parameter in the where clause -insert into t1 values(0,NULL); -set @arg00=NULL; -prepare stmt1 from 'delete from t1 where b=?' ; -execute stmt1 using @arg00; -select a,b from t1 where b is NULL ; -set @arg00='one'; -execute stmt1 using @arg00; -select a,b from t1 where b=@arg00; - -## truncate a table ---error 1295 -prepare stmt1 from 'truncate table t1' ; - - ---disable_query_log -select '------ update tests ------' as test_sequence ; ---enable_query_log ---source include/ps_renew.inc - -## update without parameter -prepare stmt1 from 'update t1 set b=''a=two'' where a=2' ; -execute stmt1; -select a,b from t1 where a=2; -# dummy update -execute stmt1; -select a,b from t1 where a=2; - -## update with one parameter in the set clause -set @arg00=NULL; -prepare stmt1 from 'update t1 set b=? where a=2' ; -execute stmt1 using @arg00; -select a,b from t1 where a=2; -set @arg00='two'; -execute stmt1 using @arg00; -select a,b from t1 where a=2; - -## update with one parameter in the where cause -set @arg00=2; -prepare stmt1 from 'update t1 set b=NULL where a=?' ; -execute stmt1 using @arg00; -select a,b from t1 where a=@arg00; -update t1 set b='two' where a=@arg00; -# row not found in update -set @arg00=2000; -execute stmt1 using @arg00; -select a,b from t1 where a=@arg00; - -## update on primary key column (two parameters) -set @arg00=2; -set @arg01=22; -prepare stmt1 from 'update t1 set a=? where a=?' ; -# dummy update -execute stmt1 using @arg00, @arg00; -select a,b from t1 where a=@arg00; -# deactivated primary key column update -# execute stmt1 using @arg01, @arg00; -select a,b from t1 where a=@arg01; -execute stmt1 using @arg00, @arg01; -select a,b from t1 where a=@arg00; -set @arg00=NULL; -set @arg01=2; -# deactivated primary key column update -# execute stmt1 using @arg00, @arg01; -select a,b from t1 order by a; -set @arg00=0; -execute stmt1 using @arg01, @arg00; -select a,b from t1 order by a; - -## update with subquery and several parameters -set @arg00=23; -set @arg01='two'; -set @arg02=2; -set @arg03='two'; -set @arg04=2; ---disable_warnings -drop table if exists t2; ---enable_warnings -# t2 will be of table type 'MYISAM' -create table t2 as select a,b from t1 ; -prepare stmt1 from 'update t1 set a=? where b=? - and a in (select ? from t2 - where b = ? or a = ?)'; ---enable_info -# deactivated primary key column update -# execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04 ; ---disable_info -select a,b from t1 where a = @arg00 ; -prepare stmt1 from 'update t1 set a=? where b=? - and a not in (select ? from t2 - where b = ? or a = ?)'; ---enable_info -execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ; ---disable_info -select a,b from t1 order by a; -drop table t2 ; -# t2 is now of table type '$type' -# The test battery for table type 'MERGE' gets here only a 'MYISAM' table -eval create table t2 -( - a int not null, b varchar(30), - primary key(a) -) engine = $type ; -insert into t2(a,b) select a, b from t1 ; -prepare stmt1 from 'update t1 set a=? where b=? - and a in (select ? from t2 - where b = ? or a = ?)'; ---enable_info -# deactivated primary key column update -# execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04 ; ---disable_info -select a,b from t1 where a = @arg00 ; -prepare stmt1 from 'update t1 set a=? where b=? - and a not in (select ? from t2 - where b = ? or a = ?)'; ---enable_info -execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ; ---disable_info -select a,b from t1 order by a ; -drop table t2 ; - -## update with parameters in limit -set @arg00=1; -prepare stmt1 from 'update t1 set b=''bla'' -where a=2 -limit 1'; -execute stmt1 ; -select a,b from t1 where b = 'bla' ; -# currently (May 2004, Version 4.1) it is impossible --- error 1064 -prepare stmt1 from 'update t1 set b=''bla'' -where a=2 -limit ?'; - ---disable_query_log -select '------ insert tests ------' as test_sequence ; ---enable_query_log ---source include/ps_renew.inc - -## insert without parameter -prepare stmt1 from 'insert into t1 values(5, ''five'' )'; -execute stmt1; -select a,b from t1 where a = 5; - -## insert with one parameter in values part -set @arg00='six' ; -prepare stmt1 from 'insert into t1 values(6, ? )'; -execute stmt1 using @arg00; -select a,b from t1 where b = @arg00; -# the second insert fails, because the first column is primary key ---error 1062 -execute stmt1 using @arg00; -set @arg00=NULL ; -prepare stmt1 from 'insert into t1 values(0, ? )'; -execute stmt1 using @arg00; -select a,b from t1 where b is NULL; - -## insert with two parameter in values part -set @arg00=8 ; -set @arg01='eight' ; -prepare stmt1 from 'insert into t1 values(?, ? )'; -execute stmt1 using @arg00, @arg01 ; -select a,b from t1 where b = @arg01; -# cases derived from client_test.c: test_null() -set @NULL= null ; -set @arg00= 'abc' ; -# execute must fail, because first column is primary key (-> not null) ---error 1048 -execute stmt1 using @NULL, @NULL ; ---error 1048 -execute stmt1 using @NULL, @NULL ; ---error 1048 -execute stmt1 using @NULL, @arg00 ; ---error 1048 -execute stmt1 using @NULL, @arg00 ; -let $1 = 2; -while ($1) -{ - eval set @arg01= 10000 + $1 ; - execute stmt1 using @arg01, @arg00 ; - dec $1; -} -select * from t1 where a > 10000 order by a ; -delete from t1 where a > 10000 ; -let $1 = 2; -while ($1) -{ - eval set @arg01= 10000 + $1 ; - execute stmt1 using @arg01, @NULL ; - dec $1; -} -select * from t1 where a > 10000 order by a ; -delete from t1 where a > 10000 ; -let $1 = 10; -while ($1) -{ - eval set @arg01= 10000 + $1 ; - execute stmt1 using @arg01, @arg01 ; - dec $1; -} -select * from t1 where a > 10000 order by a ; -delete from t1 where a > 10000 ; - - -## insert with two rows in values part -set @arg00=81 ; -set @arg01='8-1' ; -set @arg02=82 ; -set @arg03='8-2' ; -prepare stmt1 from 'insert into t1 values(?,?),(?,?)'; -execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; -select a,b from t1 where a in (@arg00,@arg02) order by a ; - -## insert with two parameter in the set part -set @arg00=9 ; -set @arg01='nine' ; -prepare stmt1 from 'insert into t1 set a=?, b=? '; -execute stmt1 using @arg00, @arg01 ; -select a,b from t1 where a = @arg00 ; - -## insert with parameters in the ON DUPLICATE KEY part -set @arg00=6 ; -set @arg01=1 ; -prepare stmt1 from 'insert into t1 set a=?, b=''sechs'' - on duplicate key update a=a + ?, b=concat(b,''modified'') '; -# There is no primary key collision, so there will be no key column update -# If a key column update would be necessary occurs BUG#4312 -# deactivated, activate when BUG#4312: is solved -# execute stmt1 using @arg00, @arg01; -select * from t1 order by a; -set @arg00=81 ; -set @arg01=1 ; -# deactivated, activate when BUG#4312: is solved -# execute stmt1 using @arg00, @arg01; - -## insert, autoincrement column and ' SELECT LAST_INSERT_ID() ' -# cases derived from client_test.c: test_bug3117() ---disable_warnings -drop table if exists t2 ; ---enable_warnings -# The test battery for table type 'MERGE' gets here only a 'MYISAM' table -eval create table t2 (id int auto_increment primary key) -ENGINE= $type ; -prepare stmt1 from ' select last_insert_id() ' ; -insert into t2 values (NULL) ; -execute stmt1 ; -insert into t2 values (NULL) ; -execute stmt1 ; -drop table t2 ; - -## many parameters -set @1000=1000 ; -set @x1000_2="x1000_2" ; -set @x1000_3="x1000_3" ; - -set @x1000="x1000" ; -set @1100=1100 ; -set @x1100="x1100" ; -set @100=100 ; -set @updated="updated" ; -insert into t1 values(1000,'x1000_1') ; -# deactivated, activate when BUG#4312: is solved -# insert into t1 values(@1000,@x1000_2),(@1000,@x1000_3) -# on duplicate key update a = a + @100, b = concat(b,@updated) ; -select a,b from t1 where a >= 1000 order by a ; -delete from t1 where a >= 1000 ; -insert into t1 values(1000,'x1000_1') ; -prepare stmt1 from ' insert into t1 values(?,?),(?,?) - on duplicate key update a = a + ?, b = concat(b,?) '; -# deactivated, activate when BUG#4312: is solved -# execute stmt1 using @1000, @x1000_2, @1000, @x1000_3, @100, @updated ; -select a,b from t1 where a >= 1000 order by a ; -delete from t1 where a >= 1000 ; -insert into t1 values(1000,'x1000_1') ; -# deactivated, activate when BUG#4312: is solved -# execute stmt1 using @1000, @x1000_2, @1100, @x1000_3, @100, @updated ; -select a,b from t1 where a >= 1000 order by a ; -delete from t1 where a >= 1000 ; - -## replace -prepare stmt1 from ' replace into t1 (a,b) select 100, ''hundred'' '; ---error 1031 - -## multi table statements ---disable_query_log -select '------ multi table tests ------' as test_sequence ; ---enable_query_log -# cases derived from client_test.c: test_multi -delete from t1 ; -delete from t9 ; -insert into t1(a,b) values (1, 'one'), (2, 'two'), (3, 'three') ; -insert into t9 (c1,c21) - values (1, 'one'), (2, 'two'), (3, 'three') ; -prepare stmt_delete from " delete t1, t9 - from t1, t9 where t1.a=t9.c1 and t1.b='updated' "; -prepare stmt_update from " update t1, t9 - set t1.b='updated', t9.c21='updated' - where t1.a=t9.c1 and t1.a=? "; -prepare stmt_select1 from " select a, b from t1 order by a" ; -prepare stmt_select2 from " select c1, c21 from t9 order by c1" ; -set @arg00= 1 ; -let $1= 3 ; -while ($1) -{ - execute stmt_update using @arg00 ; - execute stmt_delete ; - execute stmt_select1 ; - execute stmt_select2 ; - set @arg00= @arg00 + 1 ; - dec $1 ; -} - +-- source include/ps_modify.inc -- source include/ps_modify1.inc -- source include/ps_conv.inc From d6180d37be0fb11c5e1a5b9a090506e015934368 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 30 Nov 2004 17:34:37 +0200 Subject: [PATCH 0369/1063] InnoDB: Allow ALTER TABLE to do intermediate COMMIT also when the table contains auto_increment columns. (Bug #6633) innobase/include/lock0lock.h: Replaced lock_get_table() with lock_get_src_table() and lock_is_table_exclusive() innobase/lock/lock0lock.c: Replaced lock_get_table() with lock_get_src_table() and lock_is_table_exclusive() sql/ha_innodb.cc: ha_innobase::write_row(): Improve the ALTER TABLE optimization (do intermediate COMMIT also if table contains auto_increment columns) --- innobase/include/lock0lock.h | 33 ++++++--- innobase/lock/lock0lock.c | 137 ++++++++++++++++++++++++++++------- sql/ha_innodb.cc | 51 +++++++------ 3 files changed, 161 insertions(+), 60 deletions(-) diff --git a/innobase/include/lock0lock.h b/innobase/include/lock0lock.h index fb44acc14f7..ff5b6aae02e 100644 --- a/innobase/include/lock0lock.h +++ b/innobase/include/lock0lock.h @@ -463,17 +463,32 @@ lock_rec_hash( ulint space, /* in: space */ ulint page_no);/* in: page number */ /************************************************************************* -Gets the table covered by an IX or IS table lock, if there are no -other locks on the table. */ +Gets the source table of an ALTER TABLE transaction. The table must be +covered by an IX or IS table lock. */ dict_table_t* -lock_get_table( -/*===========*/ - /* out: the table covered by the lock, - or NULL if it is not an IX or IS table lock, - or there are other locks on the table */ - lock_t* lock, /* in: lock */ - ulint* mode); /* out: lock mode of table */ +lock_get_src_table( +/*===============*/ + /* out: the source table of transaction, + if it is covered by an IX or IS table lock; + dest if there is no source table, and + NULL if the transaction is locking more than + two tables or an inconsistency is found */ + trx_t* trx, /* in: transaction */ + dict_table_t* dest, /* in: destination of ALTER TABLE */ + ulint* mode); /* out: lock mode of the source table */ +/************************************************************************* +Determine if the given table is exclusively "owned" by the given +transaction, i.e., transaction holds LOCK_IX and possibly LOCK_AUTO_INC +on the table. */ + +ibool +lock_table_exclusive( +/*=================*/ + /* out: TRUE if table is only locked by trx, + with LOCK_IX, and possibly LOCK_AUTO_INC */ + dict_table_t* table, /* in: table */ + trx_t* trx); /* in: transaction */ /************************************************************************* Checks that a transaction id is sensible, i.e., not in the future. */ diff --git a/innobase/lock/lock0lock.c b/innobase/lock/lock0lock.c index d9a10eb60c0..16c4ddfd96d 100644 --- a/innobase/lock/lock0lock.c +++ b/innobase/lock/lock0lock.c @@ -602,42 +602,125 @@ lock_get_wait( } /************************************************************************* -Gets the table covered by an IX or IS table lock, if there are no -other locks on the table. */ +Gets the source table of an ALTER TABLE transaction. The table must be +covered by an IX or IS table lock. */ dict_table_t* -lock_get_table( -/*===========*/ - /* out: the table covered by the lock, - or NULL if it is not an IX or IS table lock, - or there are other locks on the table */ - lock_t* lock, /* in: lock */ - ulint* mode) /* out: lock mode of table */ +lock_get_src_table( +/*===============*/ + /* out: the source table of transaction, + if it is covered by an IX or IS table lock; + dest if there is no source table, and + NULL if the transaction is locking more than + two tables or an inconsistency is found */ + trx_t* trx, /* in: transaction */ + dict_table_t* dest, /* in: destination of ALTER TABLE */ + ulint* mode) /* out: lock mode of the source table */ { - dict_table_t* table; - ulint lock_mode; + dict_table_t* src; + lock_t* lock; - table = NULL; + src = NULL; *mode = LOCK_NONE; - if (lock_get_type(lock) != LOCK_TABLE) { - return(table); - } + for (lock = UT_LIST_GET_FIRST(trx->trx_locks); + lock; + lock = UT_LIST_GET_NEXT(trx_locks, lock)) { + lock_table_t* tab_lock; + ulint lock_mode; + if (!(lock_get_type(lock) & LOCK_TABLE)) { + /* We are only interested in table locks. */ + continue; + } + tab_lock = &lock->un_member.tab_lock; + if (dest == tab_lock->table) { + /* We are not interested in the destination table. */ + continue; + } else if (!src) { + /* This presumably is the source table. */ + src = tab_lock->table; + if (UT_LIST_GET_LEN(src->locks) != 1 || + UT_LIST_GET_FIRST(src->locks) != lock) { + /* We only support the case when + there is only one lock on this table. */ + return(NULL); + } + } else if (src != tab_lock->table) { + /* The transaction is locking more than + two tables (src and dest): abort */ + return(NULL); + } - lock_mode = lock_get_mode(lock); - switch (lock_mode) { - case LOCK_IS: - case LOCK_IX: - *mode = lock_mode; - table = lock->un_member.tab_lock.table; - if (UT_LIST_GET_LEN(table->locks) != 1 || - UT_LIST_GET_FIRST(table->locks) != lock) { - /* We only support the case when - there is only one lock on this table. */ - table = NULL; + /* Check that the source table is locked by + LOCK_IX or LOCK_IS. */ + lock_mode = lock_get_mode(lock); + switch (lock_mode) { + case LOCK_IX: + case LOCK_IS: + if (*mode != LOCK_NONE && *mode != lock_mode) { + /* There are multiple locks on src. */ + return(NULL); + } + *mode = lock_mode; + break; } } - return(table); + + if (!src) { + /* No source table lock found: flag the situation to caller */ + src = dest; + } + + return(src); +} + +/************************************************************************* +Determine if the given table is exclusively "owned" by the given +transaction, i.e., transaction holds LOCK_IX and possibly LOCK_AUTO_INC +on the table. */ + +ibool +lock_is_table_exclusive( +/*====================*/ + /* out: TRUE if table is only locked by trx, + with LOCK_IX, and possibly LOCK_AUTO_INC */ + dict_table_t* table, /* in: table */ + trx_t* trx) /* in: transaction */ +{ + lock_t* lock; + bool ok = FALSE; + + ut_ad(table && trx); + + for (lock = UT_LIST_GET_FIRST(table->locks); + lock; + lock = UT_LIST_GET_NEXT(locks, &lock->un_member.tab_lock)) { + if (lock->trx != trx) { + /* A lock on the table is held + by some other transaction. */ + return(FALSE); + } + + if (!(lock_get_type(lock) & LOCK_TABLE)) { + /* We are interested in table locks only. */ + continue; + } + + switch (lock_get_mode(lock)) { + case LOCK_IX: + ok = TRUE; + break; + case LOCK_AUTO_INC: + /* It is allowed for trx to hold an + auto_increment lock. */ + break; + default: + /* Other table locks than LOCK_IX are not allowed. */ + return(FALSE); + } + } + + return(ok); } /************************************************************************* diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index 2aaf69bd208..cc69762cbdb 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -2325,29 +2325,44 @@ ha_innobase::write_row( intermediate COMMIT, since writes by other transactions are being blocked by a MySQL table lock TL_WRITE_ALLOW_READ. */ - dict_table_t* table; + dict_table_t* src_table; ibool mode; num_write_row = 0; /* Commit the transaction. This will release the table locks, so they have to be acquired again. */ - switch (prebuilt->trx->mysql_n_tables_locked) { - case 1: + + /* Altering an InnoDB table */ + /* Get the source table. */ + src_table = lock_get_src_table( + prebuilt->trx, prebuilt->table, &mode); + if (!src_table) { + no_commit: + /* Unknown situation: do not commit */ + /* + ut_print_timestamp(stderr); + fprintf(stderr, + " InnoDB error: ALTER TABLE is holding lock" + " on %lu tables!\n", + prebuilt->trx->mysql_n_tables_locked); + */ + ; + } else if (src_table == prebuilt->table) { + /* Source table is not in InnoDB format: + no need to re-acquire locks on it. */ + /* Altering to InnoDB format */ innobase_commit(user_thd, prebuilt->trx); /* Note that this transaction is still active. */ user_thd->transaction.all.innodb_active_trans = 1; /* We will need an IX lock on the destination table. */ prebuilt->sql_stat_start = TRUE; - break; - case 2: - /* Altering an InnoDB table */ - ut_a(UT_LIST_GET_LEN(prebuilt->trx->trx_locks) >= 2); - table = lock_get_table( - UT_LIST_GET_FIRST(prebuilt->trx->trx_locks), - &mode); - if (!table) { + } else { + /* Ensure that there are no other table locks than + LOCK_IX and LOCK_AUTO_INC on the destination table. */ + if (!lock_is_table_exclusive(prebuilt->table, + prebuilt->trx)) { goto no_commit; } @@ -2357,21 +2372,9 @@ ha_innobase::write_row( /* Note that this transaction is still active. */ user_thd->transaction.all.innodb_active_trans = 1; /* Re-acquire the table lock on the source table. */ - row_lock_table_for_mysql(prebuilt, table, mode); + row_lock_table_for_mysql(prebuilt, src_table, mode); /* We will need an IX lock on the destination table. */ prebuilt->sql_stat_start = TRUE; - break; - default: - no_commit: - /* Unknown situation: do nothing (no commit) */ - /* - ut_print_timestamp(stderr); - fprintf(stderr, - " InnoDB error: ALTER TABLE is holding lock" - " on %lu tables!\n", - prebuilt->trx->mysql_n_tables_locked); - */ - break; } } From fc157af39d03b902b5dc8abda768c96e9df728d6 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 30 Nov 2004 15:48:29 +0000 Subject: [PATCH 0370/1063] use sql_print_warning instead of push_warning in mysqld.cc --- sql/mysqld.cc | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index f3c89b110af..57ca15e3b4c 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -6107,8 +6107,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), have_berkeley_db= SHOW_OPTION_DISABLED; #else if (opt_bdb) - push_warning(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR, - 0,"this binary does not contain BDB storage engine"); + sql_print_warning("this binary does not contain BDB storage engine"); #endif break; case OPT_ISAM: @@ -6119,8 +6118,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), have_isam= SHOW_OPTION_DISABLED; #else if (opt_isam) - push_warning(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR, - 0,"this binary does not contain ISAM storage engine"); + sql_print_warning("this binary does not contain ISAM storage engine"); #endif break; case OPT_NDBCLUSTER: @@ -6131,8 +6129,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), have_ndbcluster= SHOW_OPTION_DISABLED; #else if (opt_ndbcluster) - push_warning(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR, - 0,"this binary does not contain NDBCLUSTER storage engine"); + sql_print_warning("this binary does not contain NDBCLUSTER storage engine"); #endif break; case OPT_INNODB: @@ -6143,8 +6140,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), have_innodb= SHOW_OPTION_DISABLED; #else if (opt_innodb) - push_warning(current_thd, MYSQL_ERROR::WARN_LEVEL_ERROR, - 0,"this binary does not contain INNODB storage engine"); + sql_print_warning("this binary does not contain INNODB storage engine"); #endif break; case OPT_INNODB_DATA_FILE_PATH: From 668d61b946d6487829c28a2860ecff7df7637d09 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 30 Nov 2004 17:48:30 +0200 Subject: [PATCH 0371/1063] row0sel.c: Remove compiler warning as I had forgotten an include file innobase/row/row0sel.c: Remove compiler warning as I had forgotten an include file --- innobase/row/row0sel.c | 1 + 1 file changed, 1 insertion(+) diff --git a/innobase/row/row0sel.c b/innobase/row/row0sel.c index edaa555c555..ce76f48e7a7 100644 --- a/innobase/row/row0sel.c +++ b/innobase/row/row0sel.c @@ -31,6 +31,7 @@ Created 12/19/1997 Heikki Tuuri #include "pars0pars.h" #include "row0mysql.h" #include "read0read.h" +#include "buf0lru.h" /* Maximum number of rows to prefetch; MySQL interface has another parameter */ #define SEL_MAX_N_PREFETCH 16 From 93d5f62e38fbbb43db406fabb52daed45c1cedf7 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 30 Nov 2004 17:51:10 +0200 Subject: [PATCH 0372/1063] lock0lock.c: If UNIV_DEBUG is defined, lock_get_type() was called before function definition: fix this innobase/lock/lock0lock.c: If UNIV_DEBUG is defined, lock_get_type() was called before function definition: fix this --- innobase/lock/lock0lock.c | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/innobase/lock/lock0lock.c b/innobase/lock/lock0lock.c index 78a78c9dd95..da1cb9d33cd 100644 --- a/innobase/lock/lock0lock.c +++ b/innobase/lock/lock0lock.c @@ -365,6 +365,21 @@ lock_deadlock_recursive( ulint* cost); /* in/out: number of calculation steps thus far: if this exceeds LOCK_MAX_N_STEPS_... we return TRUE */ + +/************************************************************************* +Gets the type of a lock. */ +UNIV_INLINE +ulint +lock_get_type( +/*==========*/ + /* out: LOCK_TABLE or LOCK_REC */ + lock_t* lock) /* in: lock */ +{ + ut_ad(lock); + + return(lock->type_mode & LOCK_TYPE_MASK); +} + /************************************************************************* Gets the nth bit of a record lock. */ UNIV_INLINE @@ -581,20 +596,6 @@ lock_get_mode( return(lock->type_mode & LOCK_MODE_MASK); } -/************************************************************************* -Gets the type of a lock. */ -UNIV_INLINE -ulint -lock_get_type( -/*==========*/ - /* out: LOCK_TABLE or LOCK_REC */ - lock_t* lock) /* in: lock */ -{ - ut_ad(lock); - - return(lock->type_mode & LOCK_TYPE_MASK); -} - /************************************************************************* Gets the wait flag of a lock. */ UNIV_INLINE From be733ad13f5f6c196e9cd465cd32baf3e2faa75b Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 30 Nov 2004 17:47:47 +0000 Subject: [PATCH 0373/1063] fixed error in test result added extra calls to retrieve connectstring used reengineered connect somewhat to make retries etc explicit mysql-test/r/ndb_index_unique.result: fixed error in test result ndb/include/mgmapi/mgmapi.h: added extra calls to retrieve connectstring used ndb/include/mgmcommon/ConfigRetriever.hpp: added extra calls to retrieve connectstring used ndb/include/ndbapi/ndb_cluster_connection.hpp: added extra calls to retrieve connectstring used reengineered connect somewhat to make retries etc explicit ndb/src/common/mgmcommon/ConfigRetriever.cpp: added extra calls to retrieve connectstring used ndb/src/mgmapi/mgmapi.cpp: added extra calls to retrieve connectstring used ndb/src/mgmclient/CommandInterpreter.cpp: moved parse of quit to avoid connect before ndb/src/ndbapi/Ndbinit.cpp: reengineered connect somewhat to make retries etc explicit ndb/src/ndbapi/ndb_cluster_connection.cpp: added extra calls to retrieve connectstring used reengineered connect somewhat to make retries etc explicit ndb/tools/listTables.cpp: reengineered connect somewhat to make retries etc explicit sql/ha_ndbcluster.cc: added extra calls to retrieve connectstring used reengineered connect somewhat to make retries etc explicit --- mysql-test/r/ndb_index_unique.result | 2 + ndb/include/mgmapi/mgmapi.h | 1 + ndb/include/mgmcommon/ConfigRetriever.hpp | 1 + ndb/include/ndbapi/ndb_cluster_connection.hpp | 6 +- ndb/src/common/mgmcommon/ConfigRetriever.cpp | 5 ++ ndb/src/mgmapi/mgmapi.cpp | 7 +- ndb/src/mgmclient/CommandInterpreter.cpp | 12 ++-- ndb/src/ndbapi/Ndbinit.cpp | 2 +- ndb/src/ndbapi/ndb_cluster_connection.cpp | 69 ++++++++++--------- ndb/tools/listTables.cpp | 3 +- sql/ha_ndbcluster.cc | 23 +++++-- 11 files changed, 82 insertions(+), 49 deletions(-) diff --git a/mysql-test/r/ndb_index_unique.result b/mysql-test/r/ndb_index_unique.result index 7ec1319a579..f9cc89ee4cc 100644 --- a/mysql-test/r/ndb_index_unique.result +++ b/mysql-test/r/ndb_index_unique.result @@ -77,8 +77,10 @@ a b c 3 NULL NULL select * from t1 use index (bc) where b IS NULL and c IS NULL order by a; a b c +3 NULL NULL select * from t1 use index (bc) where b IS NULL and c = 2 order by a; a b c +2 NULL 2 select * from t1 use index (bc) where b < 4 order by a; a b c 1 1 1 diff --git a/ndb/include/mgmapi/mgmapi.h b/ndb/include/mgmapi/mgmapi.h index 26add86a468..dc4f745adb2 100644 --- a/ndb/include/mgmapi/mgmapi.h +++ b/ndb/include/mgmapi/mgmapi.h @@ -375,6 +375,7 @@ extern "C" { int ndb_mgm_get_configuration_nodeid(NdbMgmHandle handle); int ndb_mgm_get_connected_port(NdbMgmHandle handle); const char *ndb_mgm_get_connected_host(NdbMgmHandle handle); + const char *ndb_mgm_get_connectstring(NdbMgmHandle handle, char *buf, int buf_sz); /** * Destroy a management server handle diff --git a/ndb/include/mgmcommon/ConfigRetriever.hpp b/ndb/include/mgmcommon/ConfigRetriever.hpp index 80449628867..8461658748e 100644 --- a/ndb/include/mgmcommon/ConfigRetriever.hpp +++ b/ndb/include/mgmcommon/ConfigRetriever.hpp @@ -72,6 +72,7 @@ public: Uint32 get_mgmd_port() const; const char *get_mgmd_host() const; + const char *get_connectstring(char *buf, int buf_sz) const; Uint32 get_configuration_nodeid() const; private: diff --git a/ndb/include/ndbapi/ndb_cluster_connection.hpp b/ndb/include/ndbapi/ndb_cluster_connection.hpp index 59d5a038844..6fa25caf5d0 100644 --- a/ndb/include/ndbapi/ndb_cluster_connection.hpp +++ b/ndb/include/ndbapi/ndb_cluster_connection.hpp @@ -30,12 +30,14 @@ class Ndb_cluster_connection { public: Ndb_cluster_connection(const char * connect_string = 0); ~Ndb_cluster_connection(); - int connect(int reconnect= 0); + int connect(int no_retries, int retry_delay_in_seconds, int verbose); int start_connect_thread(int (*connect_callback)(void)= 0); + const char *get_connectstring(char *buf, int buf_sz) const; + int get_connected_port() const; + const char *get_connected_host() const; private: friend void* run_ndb_cluster_connection_connect_thread(void*); void connect_thread(); - char *m_connect_string; TransporterFacade *m_facade; ConfigRetriever *m_config_retriever; NdbThread *m_connect_thread; diff --git a/ndb/src/common/mgmcommon/ConfigRetriever.cpp b/ndb/src/common/mgmcommon/ConfigRetriever.cpp index 0af5eb2f83c..744412870f5 100644 --- a/ndb/src/common/mgmcommon/ConfigRetriever.cpp +++ b/ndb/src/common/mgmcommon/ConfigRetriever.cpp @@ -90,6 +90,11 @@ const char *ConfigRetriever::get_mgmd_host() const return ndb_mgm_get_connected_host(m_handle); } +const char *ConfigRetriever::get_connectstring(char *buf, int buf_sz) const +{ + return ndb_mgm_get_connectstring(m_handle, buf, buf_sz); +} + //**************************************************************************** //**************************************************************************** diff --git a/ndb/src/mgmapi/mgmapi.cpp b/ndb/src/mgmapi/mgmapi.cpp index e6328604c1b..651a4a8a725 100644 --- a/ndb/src/mgmapi/mgmapi.cpp +++ b/ndb/src/mgmapi/mgmapi.cpp @@ -84,7 +84,6 @@ typedef Parser Parser_t; #define NDB_MGM_MAX_ERR_DESC_SIZE 256 struct ndb_mgm_handle { - char * connectstring; int cfg_i; int connected; @@ -1677,6 +1676,12 @@ const char *ndb_mgm_get_connected_host(NdbMgmHandle handle) return handle->cfg.ids[handle->cfg_i].name.c_str(); } +extern "C" +const char *ndb_mgm_get_connectstring(NdbMgmHandle handle, char *buf, int buf_sz) +{ + return handle->cfg.makeConnectString(buf,buf_sz); +} + extern "C" int ndb_mgm_alloc_nodeid(NdbMgmHandle handle, unsigned int version, int nodetype) diff --git a/ndb/src/mgmclient/CommandInterpreter.cpp b/ndb/src/mgmclient/CommandInterpreter.cpp index f36dddf815d..7ef62da9bb3 100644 --- a/ndb/src/mgmclient/CommandInterpreter.cpp +++ b/ndb/src/mgmclient/CommandInterpreter.cpp @@ -516,6 +516,12 @@ CommandInterpreter::execute_impl(const char *_line) executeConnect(allAfterFirstToken); DBUG_RETURN(true); } + else if((strcasecmp(firstToken, "QUIT") == 0 || + strcasecmp(firstToken, "EXIT") == 0 || + strcasecmp(firstToken, "BYE") == 0) && + allAfterFirstToken == NULL){ + DBUG_RETURN(false); + } if (!connect()) DBUG_RETURN(true); @@ -571,12 +577,6 @@ CommandInterpreter::execute_impl(const char *_line) } else if (strcasecmp(firstToken, "ALL") == 0) { analyseAfterFirstToken(-1, allAfterFirstToken); - } - else if((strcasecmp(firstToken, "QUIT") == 0 || - strcasecmp(firstToken, "EXIT") == 0 || - strcasecmp(firstToken, "BYE") == 0) && - allAfterFirstToken == NULL){ - DBUG_RETURN(false); } else { /** * First token should be a digit, node ID diff --git a/ndb/src/ndbapi/Ndbinit.cpp b/ndb/src/ndbapi/Ndbinit.cpp index 698bbcde4c6..48e62c36a5f 100644 --- a/ndb/src/ndbapi/Ndbinit.cpp +++ b/ndb/src/ndbapi/Ndbinit.cpp @@ -58,7 +58,7 @@ Ndb::Ndb( const char* aDataBase , const char* aSchema) { theNoOfNdbObjects++; if (global_ndb_cluster_connection == 0) { global_ndb_cluster_connection= new Ndb_cluster_connection(ndbConnectString); - global_ndb_cluster_connection->connect(); + global_ndb_cluster_connection->connect(12,5,1); } setup(global_ndb_cluster_connection, aDataBase, aSchema); DBUG_VOID_RETURN; diff --git a/ndb/src/ndbapi/ndb_cluster_connection.cpp b/ndb/src/ndbapi/ndb_cluster_connection.cpp index 8a5a61df171..f436ee56ede 100644 --- a/ndb/src/ndbapi/ndb_cluster_connection.cpp +++ b/ndb/src/ndbapi/ndb_cluster_connection.cpp @@ -40,10 +40,7 @@ Ndb_cluster_connection::Ndb_cluster_connection(const char *connect_string) DBUG_ENTER("Ndb_cluster_connection"); DBUG_PRINT("enter",("Ndb_cluster_connection this=0x%x", this)); m_facade= TransporterFacade::theFacadeInstance= new TransporterFacade(); - if (connect_string) - m_connect_string= my_strdup(connect_string,MYF(MY_WME)); - else - m_connect_string= 0; + m_config_retriever= 0; m_connect_thread= 0; m_connect_callback= 0; @@ -58,9 +55,39 @@ Ndb_cluster_connection::Ndb_cluster_connection(const char *connect_string) ndb_print_state_mutex= NdbMutex_Create(); } #endif + m_config_retriever= + new ConfigRetriever(connect_string, NDB_VERSION, NODE_TYPE_API); + if (m_config_retriever->hasError()) + { + printf("Could not connect initialize handle to management server: %s", + m_config_retriever->getErrorString()); + delete m_config_retriever; + m_config_retriever= 0; + } DBUG_VOID_RETURN; } +int Ndb_cluster_connection::get_connected_port() const +{ + if (m_config_retriever) + return m_config_retriever->get_mgmd_port(); + return -1; +} + +const char *Ndb_cluster_connection::get_connected_host() const +{ + if (m_config_retriever) + return m_config_retriever->get_mgmd_host(); + return 0; +} + +const char *Ndb_cluster_connection::get_connectstring(char *buf, int buf_sz) const +{ + if (m_config_retriever) + return m_config_retriever->get_connectstring(buf,buf_sz); + return 0; +} + extern "C" pthread_handler_decl(run_ndb_cluster_connection_connect_thread, me) { my_thread_init(); @@ -77,7 +104,7 @@ void Ndb_cluster_connection::connect_thread() int r; do { NdbSleep_SecSleep(1); - if ((r = connect(1)) == 0) + if ((r = connect(0,0,0)) == 0) break; if (r == -1) { printf("Ndb_cluster_connection::connect_thread error\n"); @@ -98,7 +125,7 @@ int Ndb_cluster_connection::start_connect_thread(int (*connect_callback)(void)) int r; DBUG_ENTER("Ndb_cluster_connection::start_connect_thread"); m_connect_callback= connect_callback; - if ((r = connect(1)) == 1) + if ((r = connect(0,0,0)) == 1) { DBUG_PRINT("info",("starting thread")); m_connect_thread= @@ -117,36 +144,15 @@ int Ndb_cluster_connection::start_connect_thread(int (*connect_callback)(void)) DBUG_RETURN(0); } -int Ndb_cluster_connection::connect(int reconnect) +int Ndb_cluster_connection::connect(int no_retries, int retry_delay_in_seconds, int verbose) { DBUG_ENTER("Ndb_cluster_connection::connect"); const char* error = 0; do { if (m_config_retriever == 0) - { - m_config_retriever= - new ConfigRetriever(m_connect_string, NDB_VERSION, NODE_TYPE_API); - if (m_config_retriever->hasError()) - { - printf("Could not connect initialize handle to management server: %s", - m_config_retriever->getErrorString()); - DBUG_RETURN(-1); - } - } - else - if (reconnect == 0) - DBUG_RETURN(0); - if (reconnect) - { - int r= m_config_retriever->do_connect(0,0,0); - if (r == 1) - DBUG_RETURN(1); // mgmt server not up yet - if (r == -1) - break; - } - else - if(m_config_retriever->do_connect(12,5,1) == -1) - break; + DBUG_RETURN(-1); + if (m_config_retriever->do_connect(no_retries,retry_delay_in_seconds,verbose)) + DBUG_RETURN(1); // mgmt server not up yet Uint32 nodeId = m_config_retriever->allocNodeId(4/*retries*/,3/*delay*/); if(nodeId == 0) @@ -189,7 +195,6 @@ Ndb_cluster_connection::~Ndb_cluster_connection() abort(); TransporterFacade::theFacadeInstance= 0; } - my_free(m_connect_string,MYF(MY_ALLOW_ZERO_PTR)); if (m_config_retriever) delete m_config_retriever; DBUG_VOID_RETURN; diff --git a/ndb/tools/listTables.cpp b/ndb/tools/listTables.cpp index b923207a4fe..ccb6967e2dc 100644 --- a/ndb/tools/listTables.cpp +++ b/ndb/tools/listTables.cpp @@ -228,10 +228,11 @@ int main(int argc, char** argv){ _tabname = argv[0]; ndb_cluster_connection = new Ndb_cluster_connection(opt_connect_str); + if (ndb_cluster_connection->connect(12,5,1)) + fatal("unable to connect"); ndb = new Ndb(ndb_cluster_connection, _dbname); if (ndb->init() != 0) fatal("init"); - ndb_cluster_connection->connect(); if (ndb->waitUntilReady(30) < 0) fatal("waitUntilReady"); dic = ndb->getDictionary(); diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index ee68f8d8974..6c609cd54ac 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -4231,7 +4231,7 @@ bool ndbcluster_init() new Ndb_cluster_connection(ndbcluster_connectstring)) == 0) { DBUG_PRINT("error",("Ndb_cluster_connection(%s)",ndbcluster_connectstring)); - DBUG_RETURN(TRUE); + goto ndbcluster_init_error; } // Create a Ndb object to open the connection to NDB @@ -4240,25 +4240,33 @@ bool ndbcluster_init() if (g_ndb->init() != 0) { ERR_PRINT (g_ndb->getNdbError()); - DBUG_RETURN(TRUE); + goto ndbcluster_init_error; } - if ((res= g_ndb_cluster_connection->connect(1)) == 0) + if ((res= g_ndb_cluster_connection->connect(0,0,0)) == 0) { + DBUG_PRINT("info",("NDBCLUSTER storage engine at %s on port %d", + g_ndb_cluster_connection->get_connected_host(), + g_ndb_cluster_connection->get_connected_port())); g_ndb->waitUntilReady(10); } else if(res == 1) { if (g_ndb_cluster_connection->start_connect_thread()) { DBUG_PRINT("error", ("g_ndb_cluster_connection->start_connect_thread()")); - DBUG_RETURN(TRUE); + goto ndbcluster_init_error; + } + { + char buf[1024]; + DBUG_PRINT("info",("NDBCLUSTER storage engine not started, will connect using %s", + g_ndb_cluster_connection->get_connectstring(buf,sizeof(buf)))); } } else { DBUG_ASSERT(res == -1); DBUG_PRINT("error", ("permanent error")); - DBUG_RETURN(TRUE); + goto ndbcluster_init_error; } (void) hash_init(&ndbcluster_open_tables,system_charset_info,32,0,0, @@ -4268,9 +4276,12 @@ bool ndbcluster_init() ndbcluster_inited= 1; #ifdef USE_DISCOVER_ON_STARTUP if (ndb_discover_tables() != 0) - DBUG_RETURN(TRUE); + goto ndbcluster_init_error; #endif DBUG_RETURN(FALSE); + ndbcluster_init_error: + ndbcluster_end(); + DBUG_RETURN(TRUE); } From a49025d2c86adefcb61517ff75434479b75b8d02 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 30 Nov 2004 21:41:12 +0200 Subject: [PATCH 0374/1063] now we create temporary join for all queries with subqueries to make correct cleunup of tables and avoid too early unlock (BUG#6841) mysql-test/t/subselect_innodb.test: possible early unlock sql/sql_lex.cc: subqueries presence flag sql/sql_lex.h: subqueries presence flag sql/sql_parse.cc: subqueries presence flag sql/sql_select.cc: removed some too optimistic optimisation, now we create temporary join for all queries with subqueries to make correct cleunup of tables and avoid too early unlock --- mysql-test/t/subselect_innodb.test | 9 +++++++++ sql/sql_lex.cc | 2 +- sql/sql_lex.h | 1 + sql/sql_parse.cc | 1 + sql/sql_select.cc | 3 ++- 5 files changed, 14 insertions(+), 2 deletions(-) diff --git a/mysql-test/t/subselect_innodb.test b/mysql-test/t/subselect_innodb.test index 5f4badb3624..54c56e640dc 100644 --- a/mysql-test/t/subselect_innodb.test +++ b/mysql-test/t/subselect_innodb.test @@ -125,3 +125,12 @@ INSERT INTO `t2` VALUES ('yy','xx'); SELECT R.unit, R.ingredient FROM t1 R WHERE R.ingredient IN (SELECT N.ingredient FROM t2 N WHERE N.unit = R.unit); drop table t1, t2; + +# +# possible early unlock +# +CREATE TABLE t1 ( id INT NOT NULL auto_increment, date1 DATE, coworkerid INT, description VARCHAR(255), sum_used DOUBLE, sum_remaining DOUBLE, comments VARCHAR(255), PRIMARY KEY(id)) engine=innodb; +insert into t1 values (NULL, '1999-01-01', 1,'test', 22, 33, 'comment'), (NULL, '1999-01-01', 1,'test', 22, 33, 'comment'), (NULL, '1999-01-01', 1,'test', 22, 33, 'comment'), (NULL, '1998-01-01', 1,'test', 22, 33, 'comment'), (NULL, '1998-01-01', 1,'test', 22, 33, 'comment'), (NULL, '2004-01-01', 1,'test', 22, 33, 'comment'), (NULL, '2004-01-01', 1,'test', 22, 33, 'comment'); +SELECT DISTINCT (SELECT sum(sum_used) FROM t1 WHERE sum_used > 0 AND year(date1) <= '2004') as somallontvangsten, (SELECT sum(sum_used) FROM t1 WHERE sum_used < 0 AND year(date1) <= '2004') as somalluitgaven FROM t1; +select * from t1; +drop table t1; diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index b5cb8735875..1d9afcc94a4 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -135,7 +135,7 @@ void lex_start(THD *thd, uchar *buf,uint length) lex->select_lex.link_prev= (st_select_lex_node**)&(lex->all_selects_list); lex->select_lex.options= 0; lex->describe= 0; - lex->derived_tables= FALSE; + lex->subqueries= lex->derived_tables= FALSE; lex->lock_option= TL_READ; lex->found_colon= 0; lex->safe_to_cache_query= 1; diff --git a/sql/sql_lex.h b/sql/sql_lex.h index 90c020b3e93..123e855061a 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -619,6 +619,7 @@ typedef struct st_lex bool in_comment, ignore_space, verbose, no_write_to_binlog; bool derived_tables; bool safe_to_cache_query; + bool subqueries; ALTER_INFO alter_info; /* Prepared statements SQL syntax:*/ LEX_STRING prepared_stmt_name; /* Statement name (in all queries) */ diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 078333c9552..ad68402aeab 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -3955,6 +3955,7 @@ mysql_new_select(LEX *lex, bool move_down) select_lex->init_select(); if (move_down) { + lex->subqueries= TRUE; /* first select_lex of subselect or derived table */ SELECT_LEX_UNIT *unit; if (!(unit= new(lex->thd->mem_root) SELECT_LEX_UNIT())) diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 5809bd2b7be..ec7ea9091be 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -936,7 +936,7 @@ JOIN::optimize() } } - if (select_lex->uncacheable) + if (thd->lex->subqueries) { if (!(tmp_join= (JOIN*)thd->alloc(sizeof(JOIN)))) DBUG_RETURN(-1); @@ -3834,6 +3834,7 @@ JOIN::join_free(bool full) DBUG_ENTER("JOIN::join_free"); full= full || (!select_lex->uncacheable && + !thd->lex->subqueries && !thd->lex->describe); // do not cleanup too early on EXPLAIN if (table) From 928d2a8b806cc2929964c287ca53e15d9556cca0 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 30 Nov 2004 21:17:03 +0100 Subject: [PATCH 0375/1063] typo fixed --- innobase/include/lock0lock.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/innobase/include/lock0lock.h b/innobase/include/lock0lock.h index ff5b6aae02e..db8dd24973d 100644 --- a/innobase/include/lock0lock.h +++ b/innobase/include/lock0lock.h @@ -483,7 +483,7 @@ transaction, i.e., transaction holds LOCK_IX and possibly LOCK_AUTO_INC on the table. */ ibool -lock_table_exclusive( +lock_is_table_exclusive( /*=================*/ /* out: TRUE if table is only locked by trx, with LOCK_IX, and possibly LOCK_AUTO_INC */ From ac2072938f7eb2d808453dc02241d485117e4d10 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 30 Nov 2004 20:51:57 +0000 Subject: [PATCH 0376/1063] fixed so that warning on missing support for engine only printed once even if option given multiple times --- sql/mysqld.cc | 62 +++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 45 insertions(+), 17 deletions(-) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 57ca15e3b4c..baab3017623 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -36,6 +36,28 @@ #ifdef HAVE_NDBCLUSTER_DB #include "ha_ndbcluster.h" #endif + +#ifdef HAVE_INNOBASE_DB +#define OPT_INNODB_DEFAULT 1 +#else +#define OPT_INNODB_DEFAULT 0 +#endif +#ifdef HAVE_BERKLEY_DB +#define OPT_BDB_DEFAULT 1 +#else +#define OPT_BDB_DEFAULT 0 +#endif +#ifdef HAVE_ISAM_DB +#define OPT_ISAM_DEFAULT 1 +#else +#define OPT_ISAM_DEFAULT 0 +#endif +#ifdef HAVE_NDBCLUSTER_DB +#define OPT_NDBCLUSTER_DEFAULT 0 +#else +#define OPT_NDBCLUSTER_DEFAULT 0 +#endif + #include #include #include @@ -4089,7 +4111,7 @@ struct my_option my_long_options[] = 0, 0, 0, 0, 0, 0}, {"bdb", OPT_BDB, "Enable Berkeley DB (if this version of MySQL supports it). \ Disable with --skip-bdb (will save memory).", - (gptr*) &opt_bdb, (gptr*) &opt_bdb, 0, GET_BOOL, NO_ARG, 1, 0, 0, + (gptr*) &opt_bdb, (gptr*) &opt_bdb, 0, GET_BOOL, NO_ARG, OPT_BDB_DEFAULT, 0, 0, 0, 0, 0}, #ifdef HAVE_BERKELEY_DB {"bdb-home", OPT_BDB_HOME, "Berkeley home directory.", (gptr*) &berkeley_home, @@ -4226,7 +4248,7 @@ Disable with --skip-bdb (will save memory).", REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"innodb", OPT_INNODB, "Enable InnoDB (if this version of MySQL supports it). \ Disable with --skip-innodb (will save memory).", - (gptr*) &opt_innodb, (gptr*) &opt_innodb, 0, GET_BOOL, NO_ARG, 1, 0, 0, + (gptr*) &opt_innodb, (gptr*) &opt_innodb, 0, GET_BOOL, NO_ARG, OPT_INNODB_DEFAULT, 0, 0, 0, 0, 0}, {"innodb_data_file_path", OPT_INNODB_DATA_FILE_PATH, "Path to individual files and their sizes.", @@ -4286,7 +4308,7 @@ Disable with --skip-innodb (will save memory).", #endif /* End HAVE_INNOBASE_DB */ {"isam", OPT_ISAM, "Enable ISAM (if this version of MySQL supports it). \ Disable with --skip-isam.", - (gptr*) &opt_isam, (gptr*) &opt_isam, 0, GET_BOOL, NO_ARG, 1, 0, 0, + (gptr*) &opt_isam, (gptr*) &opt_isam, 0, GET_BOOL, NO_ARG, OPT_ISAM_DEFAULT, 0, 0, 0, 0, 0}, {"language", 'L', "Client error messages in given language. May be given as a full path.", @@ -4413,8 +4435,8 @@ master-ssl", GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, {"ndbcluster", OPT_NDBCLUSTER, "Enable NDB Cluster (if this version of MySQL supports it). \ Disable with --skip-ndbcluster (will save memory).", - (gptr*) &opt_ndbcluster, (gptr*) &opt_ndbcluster, 0, GET_BOOL, NO_ARG, 1, 0, 0, - 0, 0, 0}, + (gptr*) &opt_ndbcluster, (gptr*) &opt_ndbcluster, 0, GET_BOOL, NO_ARG, + OPT_NDBCLUSTER_DEFAULT, 0, 0, 0, 0, 0}, #ifdef HAVE_NDBCLUSTER_DB {"ndb-connectstring", OPT_NDB_CONNECTSTRING, "Connect string for ndbcluster.", @@ -6105,9 +6127,6 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), have_berkeley_db= SHOW_OPTION_YES; else have_berkeley_db= SHOW_OPTION_DISABLED; -#else - if (opt_bdb) - sql_print_warning("this binary does not contain BDB storage engine"); #endif break; case OPT_ISAM: @@ -6116,9 +6135,6 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), have_isam= SHOW_OPTION_YES; else have_isam= SHOW_OPTION_DISABLED; -#else - if (opt_isam) - sql_print_warning("this binary does not contain ISAM storage engine"); #endif break; case OPT_NDBCLUSTER: @@ -6127,9 +6143,6 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), have_ndbcluster= SHOW_OPTION_YES; else have_ndbcluster= SHOW_OPTION_DISABLED; -#else - if (opt_ndbcluster) - sql_print_warning("this binary does not contain NDBCLUSTER storage engine"); #endif break; case OPT_INNODB: @@ -6138,9 +6151,6 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), have_innodb= SHOW_OPTION_YES; else have_innodb= SHOW_OPTION_DISABLED; -#else - if (opt_innodb) - sql_print_warning("this binary does not contain INNODB storage engine"); #endif break; case OPT_INNODB_DATA_FILE_PATH: @@ -6260,6 +6270,24 @@ static void get_options(int argc,char **argv) if ((ho_error= handle_options(&argc, &argv, my_long_options, get_one_option))) exit(ho_error); + +#ifndef HAVE_NDBCLUSTER_DB + if (opt_ndbcluster) + sql_print_warning("this binary does not contain NDBCLUSTER storage engine"); +#endif +#ifndef HAVE_INNOBASE_DB + if (opt_innodb) + sql_print_warning("this binary does not contain INNODB storage engine"); +#endif +#ifndef HAVE_ISAM + if (opt_isam) + sql_print_warning("this binary does not contain ISAM storage engine"); +#endif +#ifndef HAVE_BERKELEY_DB + if (opt_bdb) + sql_print_warning("this binary does not contain BDB storage engine"); +#endif + if (argc > 0) { fprintf(stderr, "%s: Too many arguments (first extra is '%s').\nUse --help to get a list of available options\n", my_progname, *argv); From 1983ff72777b4030331e0f0da94c9a2539cf87bc Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 30 Nov 2004 23:10:17 +0200 Subject: [PATCH 0377/1063] lock0lock.h: Rename lock_table_exclusive to lock_is_table_exclusive (somehow this change was omitted from last changeset) innobase/include/lock0lock.h: Rename lock_table_exclusive to lock_is_table_exclusive (somehow this change was omitted from last changeset) --- innobase/include/lock0lock.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/innobase/include/lock0lock.h b/innobase/include/lock0lock.h index ff5b6aae02e..1fd7492d517 100644 --- a/innobase/include/lock0lock.h +++ b/innobase/include/lock0lock.h @@ -483,8 +483,8 @@ transaction, i.e., transaction holds LOCK_IX and possibly LOCK_AUTO_INC on the table. */ ibool -lock_table_exclusive( -/*=================*/ +lock_is_table_exclusive( +/*====================*/ /* out: TRUE if table is only locked by trx, with LOCK_IX, and possibly LOCK_AUTO_INC */ dict_table_t* table, /* in: table */ From 0a6699d6855ba6c5763af0df20e626a6e0091b5c Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 30 Nov 2004 22:17:43 +0100 Subject: [PATCH 0378/1063] mysqld_safe.sh: Fix calls to my_print_defaults. Some how, --loose-verbose had been added before --no-defaults/defaults-file, which must be the first option. NOTE: this may make some installations behave differently, if they depend on this broken behavior. scripts/mysqld_safe.sh: Fix calls to my_print_defaults. Some how, --loose-verbose had been added before --no-defaults/defaults-file, which must be the first option. NOTE: this may make some installations behave differently, if they depend on this broken behavior. --- scripts/mysqld_safe.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index da7e06f6c05..1f4d17f8885 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -141,12 +141,12 @@ fi args= SET_USER=2 -parse_arguments `$print_defaults --loose-verbose $defaults mysqld server` +parse_arguments `$print_defaults $defaults --loose-verbose mysqld server` if test $SET_USER -eq 2 then SET_USER=0 fi -parse_arguments `$print_defaults --loose-verbose $defaults mysqld_safe safe_mysqld` +parse_arguments `$print_defaults $defaults --loose-verbose mysqld_safe safe_mysqld` parse_arguments PICK-ARGS-FROM-ARGV "$@" safe_mysql_unix_port=${mysql_unix_port:-${MYSQL_UNIX_PORT:-@MYSQL_UNIX_ADDR@}} From 352ad8156cc7bd8dc728715569a3bc350108513e Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 30 Nov 2004 22:20:52 +0100 Subject: [PATCH 0379/1063] two-line fix for BUG#6732 "FLUSH TABLES WITH READ LOCK + COMMIT makes next FLUSH...LOCK hang forever" (originally reported as "second run of innobackup hangs forever and can even hang server"). Plus testcase for the bugfix and comments about global read locks. mysql-test/r/flush_block_commit.result: result update mysql-test/t/flush_block_commit.test: testing bugfix (originally: second run of innobackup hangs) sql/lock.cc: When we are in start_waiting_global_read_lock(), if we ourselves have the global read lock, there is nothing to start. This makes a pair with how wait_if_global_read_lock() behaves when we ourselves have the global read lock. Previously, start_waiting_global_read_lock() decremented protect... whereas wait_if_global_read_lock() hadn't incremented it => very wrong => hangs. Descriptive comments on how global read lock works. --- mysql-test/r/flush_block_commit.result | 8 +++ mysql-test/t/flush_block_commit.test | 14 ++++++ sql/lock.cc | 69 +++++++++++++++++++++++--- 3 files changed, 85 insertions(+), 6 deletions(-) diff --git a/mysql-test/r/flush_block_commit.result b/mysql-test/r/flush_block_commit.result index 3205dd9dad9..20917147e4d 100644 --- a/mysql-test/r/flush_block_commit.result +++ b/mysql-test/r/flush_block_commit.result @@ -20,4 +20,12 @@ commit; a 1 unlock tables; +commit; +begin; +insert into t1 values(10); +flush tables with read lock; +commit; +unlock tables; +flush tables with read lock; +unlock tables; drop table t1; diff --git a/mysql-test/t/flush_block_commit.test b/mysql-test/t/flush_block_commit.test index 20ecec1361c..8b99a59c979 100644 --- a/mysql-test/t/flush_block_commit.test +++ b/mysql-test/t/flush_block_commit.test @@ -45,5 +45,19 @@ reap; connection con3; reap; unlock tables; + +# BUG#6732 FLUSH TABLES WITH READ LOCK + COMMIT hangs later FLUSH TABLES +# WITH READ LOCK + +connection con2; +commit; # unlock InnoDB row locks to allow insertions connection con1; +begin; +insert into t1 values(10); +flush tables with read lock; +commit; +unlock tables; +connection con2; +flush tables with read lock; # bug caused hang here +unlock tables; drop table t1; diff --git a/sql/lock.cc b/sql/lock.cc index bf0160291f8..c7e6ebfda83 100644 --- a/sql/lock.cc +++ b/sql/lock.cc @@ -665,15 +665,70 @@ static void print_lock_error(int error) /**************************************************************************** Handling of global read locks - The global locks are handled through the global variables: - global_read_lock - global_read_lock_blocks_commit - waiting_for_read_lock - protect_against_global_read_lock - Taking the global read lock is TWO steps (2nd step is optional; without it, COMMIT of existing transactions will be allowed): lock_global_read_lock() THEN make_global_read_lock_block_commit(). + + The global locks are handled through the global variables: + global_read_lock + count of threads which have the global read lock (i.e. have completed at + least the first step above) + global_read_lock_blocks_commit + count of threads which have the global read lock and block + commits (i.e. have completed the second step above) + waiting_for_read_lock + count of threads which want to take a global read lock but cannot + protect_against_global_read_lock + count of threads which have set protection against global read lock. + + How blocking of threads by global read lock is achieved: that's + advisory. Any piece of code which should be blocked by global read lock must + be designed like this: + - call to wait_if_global_read_lock(). When this returns 0, no global read + lock is owned; if argument abort_on_refresh was 0, none can be obtained. + - job + - if abort_on_refresh was 0, call to start_waiting_global_read_lock() to + allow other threads to get the global read lock. I.e. removal of the + protection. + (Note: it's a bit like an implementation of rwlock). + + [ I am sorry to mention some SQL syntaxes below I know I shouldn't but found + no better descriptive way ] + + Why does FLUSH TABLES WITH READ LOCK need to block COMMIT: because it's used + to read a non-moving SHOW MASTER STATUS, and a COMMIT writes to the binary + log. + + Why getting the global read lock is two steps and not one. Because FLUSH + TABLES WITH READ LOCK needs to insert one other step between the two: + flushing tables. So the order is + 1) lock_global_read_lock() (prevents any new table write locks, i.e. stalls + all new updates) + 2) close_cached_tables() (the FLUSH TABLES), which will wait for tables + currently opened and being updated to close (so it's possible that there is + a moment where all new updates of server are stalled *and* FLUSH TABLES WITH + READ LOCK is, too). + 3) make_global_read_lock_block_commit(). + If we have merged 1) and 3) into 1), we would have had this deadlock: + imagine thread 1 and 2, in non-autocommit mode, thread 3, and an InnoDB + table t. + thd1: SELECT * FROM t FOR UPDATE; + thd2: UPDATE t SET a=1; # blocked by row-level locks of thd1 + thd3: FLUSH TABLES WITH READ LOCK; # blocked in close_cached_tables() by the + table instance of thd2 + thd1: COMMIT; # blocked by thd3. + thd1 blocks thd2 which blocks thd3 which blocks thd1: deadlock. + + Note that we need to support that one thread does + FLUSH TABLES WITH READ LOCK; and then COMMIT; + (that's what innobackup does, for some good reason). + So in this exceptional case the COMMIT should not be blocked by the FLUSH + TABLES WITH READ LOCK. + + TODO in MySQL 5.x: make_global_read_lock_block_commit() should be + killable. Normally CPU does not spend a long time in this function (COMMITs + are quite fast), but it would still be nice. + ****************************************************************************/ volatile uint global_read_lock=0; @@ -783,6 +838,8 @@ void start_waiting_global_read_lock(THD *thd) { bool tmp; DBUG_ENTER("start_waiting_global_read_lock"); + if (unlikely(thd->global_read_lock)) + DBUG_VOID_RETURN; (void) pthread_mutex_lock(&LOCK_open); tmp= (!--protect_against_global_read_lock && waiting_for_read_lock); (void) pthread_mutex_unlock(&LOCK_open); From 4386e0c3484ae892107243c51188bfe51fcf53d1 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 1 Dec 2004 02:35:02 +0100 Subject: [PATCH 0380/1063] openssl_1.result, have_openssl_1.require, openssl_1.test: Update SSL Cipher so that 'openssl_1' test passes (BUG#6152) mysql-test/t/openssl_1.test: Update SSL Cipher so that 'openssl_1' test passes (BUG#6152) mysql-test/r/have_openssl_1.require: Update SSL Cipher so that 'openssl_1' test passes (BUG#6152) mysql-test/r/openssl_1.result: Update SSL Cipher so that 'openssl_1' test passes (BUG#6152) BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted --- BitKeeper/etc/logging_ok | 1 + mysql-test/r/have_openssl_1.require | 2 +- mysql-test/r/openssl_1.result | 6 +++--- mysql-test/t/openssl_1.test | 6 +++--- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok index 0483e6b4fa3..00f4c86d319 100644 --- a/BitKeeper/etc/logging_ok +++ b/BitKeeper/etc/logging_ok @@ -140,6 +140,7 @@ msvensson@build.mysql.com mwagner@cash.mwagner.org mwagner@evoq.mwagner.org mwagner@here.mwagner.org +mwagner@mysql.com mwagner@work.mysql.com mydev@mysql.com mysql@home.(none) diff --git a/mysql-test/r/have_openssl_1.require b/mysql-test/r/have_openssl_1.require index 032b60d544a..b33a1d2854f 100644 --- a/mysql-test/r/have_openssl_1.require +++ b/mysql-test/r/have_openssl_1.require @@ -1,2 +1,2 @@ Variable_name Value -Ssl_cipher EDH-RSA-DES-CBC3-SHA +Ssl_cipher DHE-RSA-AES256-SHA diff --git a/mysql-test/r/openssl_1.result b/mysql-test/r/openssl_1.result index a87d0c33559..f7cb17a1a74 100644 --- a/mysql-test/r/openssl_1.result +++ b/mysql-test/r/openssl_1.result @@ -2,9 +2,9 @@ drop table if exists t1; create table t1(f1 int); insert into t1 values (5); grant select on test.* to ssl_user1@localhost require SSL; -grant select on test.* to ssl_user2@localhost require cipher "EDH-RSA-DES-CBC3-SHA"; -grant select on test.* to ssl_user3@localhost require cipher "EDH-RSA-DES-CBC3-SHA" AND SUBJECT "/C=SE/L=Uppsala/O=MySQL AB/CN=MySQL Client/Email=abstract.mysql.developer@mysql.com"; -grant select on test.* to ssl_user4@localhost require cipher "EDH-RSA-DES-CBC3-SHA" AND SUBJECT "/C=SE/L=Uppsala/O=MySQL AB/CN=MySQL Client/Email=abstract.mysql.developer@mysql.com" ISSUER "/C=SE/L=Uppsala/O=MySQL AB/CN=Abstract MySQL Developer/Email=abstract.mysql.developer@mysql.com"; +grant select on test.* to ssl_user2@localhost require cipher "DHE-RSA-AES256-SHA"; +grant select on test.* to ssl_user3@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/L=Uppsala/O=MySQL AB/CN=MySQL Client/Email=abstract.mysql.developer@mysql.com"; +grant select on test.* to ssl_user4@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/L=Uppsala/O=MySQL AB/CN=MySQL Client/Email=abstract.mysql.developer@mysql.com" ISSUER "/C=SE/L=Uppsala/O=MySQL AB/CN=Abstract MySQL Developer/Email=abstract.mysql.developer@mysql.com"; flush privileges; select * from t1; f1 diff --git a/mysql-test/t/openssl_1.test b/mysql-test/t/openssl_1.test index 39612f680f3..912c9fb9bec 100644 --- a/mysql-test/t/openssl_1.test +++ b/mysql-test/t/openssl_1.test @@ -9,9 +9,9 @@ create table t1(f1 int); insert into t1 values (5); grant select on test.* to ssl_user1@localhost require SSL; -grant select on test.* to ssl_user2@localhost require cipher "EDH-RSA-DES-CBC3-SHA"; -grant select on test.* to ssl_user3@localhost require cipher "EDH-RSA-DES-CBC3-SHA" AND SUBJECT "/C=SE/L=Uppsala/O=MySQL AB/CN=MySQL Client/Email=abstract.mysql.developer@mysql.com"; -grant select on test.* to ssl_user4@localhost require cipher "EDH-RSA-DES-CBC3-SHA" AND SUBJECT "/C=SE/L=Uppsala/O=MySQL AB/CN=MySQL Client/Email=abstract.mysql.developer@mysql.com" ISSUER "/C=SE/L=Uppsala/O=MySQL AB/CN=Abstract MySQL Developer/Email=abstract.mysql.developer@mysql.com"; +grant select on test.* to ssl_user2@localhost require cipher "DHE-RSA-AES256-SHA"; +grant select on test.* to ssl_user3@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/L=Uppsala/O=MySQL AB/CN=MySQL Client/Email=abstract.mysql.developer@mysql.com"; +grant select on test.* to ssl_user4@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/L=Uppsala/O=MySQL AB/CN=MySQL Client/Email=abstract.mysql.developer@mysql.com" ISSUER "/C=SE/L=Uppsala/O=MySQL AB/CN=Abstract MySQL Developer/Email=abstract.mysql.developer@mysql.com"; flush privileges; connect (con1,localhost,ssl_user1,,); connect (con2,localhost,ssl_user2,,); From 62e7f1cae96c6f9f1c65bb19209776174549a352 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 1 Dec 2004 10:04:49 +0100 Subject: [PATCH 0381/1063] bug#6871 - ndb replace with charsets check update of primary key wo/ normalizing ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp: Make sure tXfrmFlag is false when checking for update of primary key --- ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp b/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp index e6cc6f68842..cbb165c3eb1 100644 --- a/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp +++ b/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp @@ -706,7 +706,10 @@ Dbtup::checkUpdateOfPrimaryKey(Uint32* updateBuffer, Tablerec* const regTabPtr) tOutBufIndex = 0; tMaxRead = MAX_KEY_SIZE_IN_WORDS; + bool tmp = tXfrmFlag; + tXfrmFlag = false; ndbrequire((this->*f)(&keyReadBuffer[0], ahOut, attrDescriptor, attributeOffset)); + tXfrmFlag = tmp; ndbrequire(tOutBufIndex == ahOut->getDataSize()); if (ahIn.getDataSize() != ahOut->getDataSize()) { ljam(); From e4dbc32f632a85c0668d999a19226d53b413fc95 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 1 Dec 2004 10:13:18 +0100 Subject: [PATCH 0382/1063] testcase for bug#6871, ndb, replace with collations mysql-test/r/ndb_charset.result: testcase for bug#6871 mysql-test/t/ndb_charset.test: testcase for bug#6871 --- mysql-test/r/ndb_charset.result | 10 ++++++++++ mysql-test/t/ndb_charset.test | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/mysql-test/r/ndb_charset.result b/mysql-test/r/ndb_charset.result index 501bec99ea3..00bc36a7c0d 100644 --- a/mysql-test/r/ndb_charset.result +++ b/mysql-test/r/ndb_charset.result @@ -189,3 +189,13 @@ p a 5 aaa 6 AAA drop table t1; +create table t1 ( +a varchar(10) primary key +) engine=ndb; +insert into t1 values ('jonas % '); +replace into t1 values ('jonas % '); +replace into t1 values ('jonas % '); +select * from t1; +a +jonas % +drop table t1; diff --git a/mysql-test/t/ndb_charset.test b/mysql-test/t/ndb_charset.test index f1ec0485e12..1b9e7e8bfcc 100644 --- a/mysql-test/t/ndb_charset.test +++ b/mysql-test/t/ndb_charset.test @@ -157,3 +157,13 @@ select * from t1 where a = 'AaA' order by p; # 6 select * from t1 where a = 'AAA' order by p; drop table t1; + +# bug +create table t1 ( + a varchar(10) primary key +) engine=ndb; +insert into t1 values ('jonas % '); +replace into t1 values ('jonas % '); +replace into t1 values ('jonas % '); +select * from t1; +drop table t1; From 561ee8fd3713ddd713c7cc420b8c03265855de51 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 1 Dec 2004 19:25:05 +0400 Subject: [PATCH 0383/1063] Move common trailing space checks into an include file. Check UCS2 trailing spaces. mysql-test/r/ctype_ucs.result: Move common trailing space checks into an include file. Check UCS2 trailing spaces. Fix UCS2 to handle trailing spaces in PAD way. mysql-test/t/ctype_ucs.test: Move common trailing space checks into an include file. Check UCS2 trailing spaces. Fix UCS2 to handle trailing spaces in PAD way. mysql-test/t/endspace.test: Move common trailing space checks into an include file. Check UCS2 trailing spaces. Fix UCS2 to handle trailing spaces in PAD way. strings/ctype-ucs2.c: Move common trailing space checks into an include file. Check UCS2 trailing spaces. Fix UCS2 to handle trailing spaces in PAD way. --- mysql-test/include/endspace.inc | 7 ++++ mysql-test/r/ctype_ucs.result | 23 +++++++++++ mysql-test/t/ctype_ucs.test | 4 ++ mysql-test/t/endspace.test | 8 +--- strings/ctype-ucs2.c | 73 +++++++++++++++++++++++++++++++-- 5 files changed, 105 insertions(+), 10 deletions(-) create mode 100644 mysql-test/include/endspace.inc diff --git a/mysql-test/include/endspace.inc b/mysql-test/include/endspace.inc new file mode 100644 index 00000000000..1692a258bde --- /dev/null +++ b/mysql-test/include/endspace.inc @@ -0,0 +1,7 @@ +select 'a' = 'a', 'a' = 'a ', 'a ' = 'a'; +select 'a\0' = 'a', 'a\0' < 'a', 'a\0' > 'a'; +select 'a' = 'a\0', 'a' < 'a\0', 'a' > 'a\0'; +select 'a\0' = 'a ', 'a\0' < 'a ', 'a\0' > 'a '; +select 'a ' = 'a\0', 'a ' < 'a\0', 'a ' > 'a\0'; +select 'a a' > 'a', 'a \0' < 'a'; +select binary 'a a' > 'a', binary 'a \0' > 'a', binary 'a\0' > 'a'; diff --git a/mysql-test/r/ctype_ucs.result b/mysql-test/r/ctype_ucs.result index 6394bc28c6e..70a66ddd924 100644 --- a/mysql-test/r/ctype_ucs.result +++ b/mysql-test/r/ctype_ucs.result @@ -1,4 +1,27 @@ DROP TABLE IF EXISTS t1; +SET NAMES latin1; +SET character_set_connection=ucs2; +select 'a' = 'a', 'a' = 'a ', 'a ' = 'a'; +'a' = 'a' 'a' = 'a ' 'a ' = 'a' +1 1 1 +select 'a\0' = 'a', 'a\0' < 'a', 'a\0' > 'a'; +'a\0' = 'a' 'a\0' < 'a' 'a\0' > 'a' +0 1 0 +select 'a' = 'a\0', 'a' < 'a\0', 'a' > 'a\0'; +'a' = 'a\0' 'a' < 'a\0' 'a' > 'a\0' +0 0 1 +select 'a\0' = 'a ', 'a\0' < 'a ', 'a\0' > 'a '; +'a\0' = 'a ' 'a\0' < 'a ' 'a\0' > 'a ' +0 1 0 +select 'a ' = 'a\0', 'a ' < 'a\0', 'a ' > 'a\0'; +'a ' = 'a\0' 'a ' < 'a\0' 'a ' > 'a\0' +0 0 1 +select 'a a' > 'a', 'a \0' < 'a'; +'a a' > 'a' 'a \0' < 'a' +1 1 +select binary 'a a' > 'a', binary 'a \0' > 'a', binary 'a\0' > 'a'; +binary 'a a' > 'a' binary 'a \0' > 'a' binary 'a\0' > 'a' +1 1 1 SET CHARACTER SET koi8r; CREATE TABLE t1 (word VARCHAR(64) CHARACTER SET ucs2); INSERT INTO t1 VALUES (_koi8r'ò'), (X'2004'); diff --git a/mysql-test/t/ctype_ucs.test b/mysql-test/t/ctype_ucs.test index 0b8678ef59b..b1d872c58a5 100644 --- a/mysql-test/t/ctype_ucs.test +++ b/mysql-test/t/ctype_ucs.test @@ -4,6 +4,10 @@ DROP TABLE IF EXISTS t1; --enable_warnings +SET NAMES latin1; +SET character_set_connection=ucs2; +-- source include/endspace.inc + SET CHARACTER SET koi8r; # diff --git a/mysql-test/t/endspace.test b/mysql-test/t/endspace.test index 9ee5e32967a..462bc3083e1 100644 --- a/mysql-test/t/endspace.test +++ b/mysql-test/t/endspace.test @@ -7,13 +7,7 @@ drop table if exists t1; --enable_warnings -select 'a' = 'a', 'a' = 'a ', 'a ' = 'a'; -select 'a\0' = 'a', 'a\0' < 'a', 'a\0' > 'a'; -select 'a' = 'a\0', 'a' < 'a\0', 'a' > 'a\0'; -select 'a\0' = 'a ', 'a\0' < 'a ', 'a\0' > 'a '; -select 'a ' = 'a\0', 'a ' < 'a\0', 'a ' > 'a\0'; -select 'a a' > 'a', 'a \0' < 'a'; -select binary 'a a' > 'a', binary 'a \0' > 'a', binary 'a\0' > 'a'; +-- source include/endspace.inc # # Test MyISAM tables. diff --git a/strings/ctype-ucs2.c b/strings/ctype-ucs2.c index 851c2044f47..403d31aa15b 100644 --- a/strings/ctype-ucs2.c +++ b/strings/ctype-ucs2.c @@ -218,11 +218,78 @@ static int my_strnncoll_ucs2(CHARSET_INFO *cs, return t_is_prefix ? t-te : ((se-s) - (te-t)); } -static int my_strnncollsp_ucs2(CHARSET_INFO *cs, - const uchar *s, uint slen, +/* + Compare strings, discarding end space + + SYNOPSIS + my_strnncollsp_ucs2() + cs character set handler + a First string to compare + a_length Length of 'a' + b Second string to compare + b_length Length of 'b' + + IMPLEMENTATION + If one string is shorter as the other, then we space extend the other + so that the strings have equal length. + + This will ensure that the following things hold: + + "a" == "a " + "a\0" < "a" + "a\0" < "a " + + RETURN + < 0 a < b + = 0 a == b + > 0 a > b +*/ + +static int my_strnncollsp_ucs2(CHARSET_INFO *cs __attribute__((unused)), + const uchar *s, uint slen, const uchar *t, uint tlen) { - return my_strnncoll_ucs2(cs,s,slen,t,tlen,0); + const uchar *se, *te; + uint minlen; + + /* extra safety to make sure the lengths are even numbers */ + slen= (slen >> 1) << 1; + tlen= (tlen >> 1) << 1; + + se= s + slen; + te= t + tlen; + + for (minlen= min(slen, tlen); minlen; minlen-= 2) + { + int s_wc = uni_plane[s[0]] ? (int) uni_plane[s[0]][s[1]].sort : + (((int) s[0]) << 8) + (int) s[1]; + + int t_wc = uni_plane[t[0]] ? (int) uni_plane[t[0]][t[1]].sort : + (((int) t[0]) << 8) + (int) t[1]; + if ( s_wc != t_wc ) + return s_wc - t_wc; + + s+= 2; + t+= 2; + } + + if (slen != tlen) + { + int swap= 0; + if (slen < tlen) + { + s= t; + se= te; + swap= -1; + } + + for ( ; s < se ; s+= 2) + { + if (s[0] || s[1] != ' ') + return (((int)s[0] << 8) + (int) s[1] - (int) ' ') ^ swap; + } + } + return 0; } From befcff9ba5ec37fdf8ccc1aac31ac3ab9dab8ac3 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 1 Dec 2004 18:02:34 +0200 Subject: [PATCH 0384/1063] configure.in: Let MySQL check the existence of readdir_r with 3 arguments; Solaris seems to have just 2 args Check the existence of readdir_r and localtime_r; even though MySQL does check these too, we need our own check for Hot Backup code os0file.c: Use re-entrant readdir_r where available ut0ut.c: Make a function to use thread-safe localtime_r where available; that particular function was not called from anywhere, though innobase/ut/ut0ut.c: Make a function to use thread-safe localtime_r where available; the function was not called from anywhere, though innobase/os/os0file.c: Use re-entrant readdir_r where available innobase/configure.in: Let MySQL check the existence of readdir_r with 3 arguments; Solaris seems to have just 2 args --- innobase/configure.in | 4 +++- innobase/os/os0file.c | 30 +++++++++++++++++++++++++++++- innobase/ut/ut0ut.c | 7 ++++++- 3 files changed, 38 insertions(+), 3 deletions(-) diff --git a/innobase/configure.in b/innobase/configure.in index d83da9fdc5c..baf11272ab9 100644 --- a/innobase/configure.in +++ b/innobase/configure.in @@ -41,7 +41,9 @@ AC_CHECK_SIZEOF(long, 4) AC_CHECK_SIZEOF(void*, 4) AC_CHECK_FUNCS(sched_yield) AC_CHECK_FUNCS(fdatasync) -#AC_CHECK_FUNCS(localtime_r) # Already checked by MySQL +AC_CHECK_FUNCS(localtime_r) +#AC_CHECK_FUNCS(readdir_r) MySQL checks that it has also the right args. +# Some versions of Unix only take 2 arguments. #AC_C_INLINE Already checked in MySQL AC_C_BIGENDIAN diff --git a/innobase/os/os0file.c b/innobase/os/os0file.c index 5c140e4b798..8b9a0582781 100644 --- a/innobase/os/os0file.c +++ b/innobase/os/os0file.c @@ -711,13 +711,41 @@ http://www.mysql.com/doc/en/Windows_symbolic_links.html */ char* full_path; int ret; struct stat statinfo; +#ifdef HAVE_READDIR_R + char dirent_buf[sizeof(struct dirent) + _POSIX_PATH_MAX + + 100]; + /* In /mysys/my_lib.c, _POSIX_PATH_MAX + 1 is used as + the max file name len; but in most standards, the + length is NAME_MAX; we add 100 to be even safer */ +#endif + next_file: - ent = readdir(dir); + +#ifdef HAVE_READDIR_R + ret = readdir_r(dir, (struct dirent*)dirent_buf, &ent); + + if (ret != 0) { + fprintf(stderr, +"InnoDB: cannot read directory %s, error %lu\n", dirname, (ulong)ret); + + return(-1); + } if (ent == NULL) { + /* End of directory */ + return(1); } + ut_a(strlen(ent->d_name) < _POSIX_PATH_MAX + 100 - 1); +#else + ent = readdir(dir); + + if (ent == NULL) { + + return(1); + } +#endif ut_a(strlen(ent->d_name) < OS_FILE_MAX_PATH); if (strcmp(ent->d_name, ".") == 0 || strcmp(ent->d_name, "..") == 0) { diff --git a/innobase/ut/ut0ut.c b/innobase/ut/ut0ut.c index b67be77b29e..732380bcb1f 100644 --- a/innobase/ut/ut0ut.c +++ b/innobase/ut/ut0ut.c @@ -235,13 +235,18 @@ ut_get_year_month_day( *month = (ulint)cal_tm.wMonth; *day = (ulint)cal_tm.wDay; #else + struct tm cal_tm; struct tm* cal_tm_ptr; time_t tm; time(&tm); +#ifdef HAVE_LOCALTIME_R + localtime_r(&tm, &cal_tm); + cal_tm_ptr = &cal_tm; +#else cal_tm_ptr = localtime(&tm); - +#endif *year = (ulint)cal_tm_ptr->tm_year + 1900; *month = (ulint)cal_tm_ptr->tm_mon + 1; *day = (ulint)cal_tm_ptr->tm_mday; From dd59a2d7eabf3466bf9396950dd12f071420c720 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 1 Dec 2004 22:46:39 +0100 Subject: [PATCH 0385/1063] one more test for corrupted compressed MyISAM table --- myisam/mi_packrec.c | 47 ++++++++++++++++++++++++++++----------------- 1 file changed, 29 insertions(+), 18 deletions(-) diff --git a/myisam/mi_packrec.c b/myisam/mi_packrec.c index 94eb2de17e2..c2cc6e17df6 100644 --- a/myisam/mi_packrec.c +++ b/myisam/mi_packrec.c @@ -43,7 +43,7 @@ pos+= *pos -static void read_huff_table(MI_BIT_BUFF *bit_buff,MI_DECODE_TREE *decode_tree, +static uint read_huff_table(MI_BIT_BUFF *bit_buff,MI_DECODE_TREE *decode_tree, uint16 **decode_table,byte **intervall_buff, uint16 *tmp_buff); static void make_quick_table(uint16 *to_table,uint16 *decode_table, @@ -146,12 +146,12 @@ my_bool _mi_read_pack_info(MI_INFO *info, pbool fix_keys) { if (!my_errno) my_errno=HA_ERR_END_OF_FILE; - DBUG_RETURN(1); + goto err0; } if (memcmp((byte*) header,(byte*) myisam_pack_file_magic,4)) { my_errno=HA_ERR_WRONG_IN_RECORD; - DBUG_RETURN(1); + goto err0; } share->pack.header_length= uint4korr(header+4); share->min_pack_length=(uint) uint4korr(header+8); @@ -173,7 +173,7 @@ my_bool _mi_read_pack_info(MI_INFO *info, pbool fix_keys) my_malloc((uint) (trees*sizeof(MI_DECODE_TREE)+ intervall_length*sizeof(byte)), MYF(MY_WME)))) - DBUG_RETURN(1); + goto err0; intervall_buff=(byte*) (share->decode_trees+trees); length=(uint) (elements*2+trees*(1 << myisam_quick_table_bits)); @@ -183,7 +183,7 @@ my_bool _mi_read_pack_info(MI_INFO *info, pbool fix_keys) MYF(MY_WME | MY_ZEROFILL)))) { my_free((gptr) share->decode_trees,MYF(0)); - DBUG_RETURN(1); + goto err1; } tmp_buff=share->decode_tables+length; disk_cache=(byte*) (tmp_buff+512); @@ -194,7 +194,7 @@ my_bool _mi_read_pack_info(MI_INFO *info, pbool fix_keys) { my_free((gptr) share->decode_trees,MYF(0)); my_free((gptr) share->decode_tables,MYF(0)); - DBUG_RETURN(1); + goto err2; } huff_tree_bits=max_bit(trees ? trees-1 : 0); @@ -213,8 +213,9 @@ my_bool _mi_read_pack_info(MI_INFO *info, pbool fix_keys) skip_to_next_byte(&bit_buff); decode_table=share->decode_tables; for (i=0 ; i < trees ; i++) - read_huff_table(&bit_buff,share->decode_trees+i,&decode_table, - &intervall_buff,tmp_buff); + if (read_huff_table(&bit_buff,share->decode_trees+i,&decode_table, + &intervall_buff,tmp_buff)) + goto err3; decode_table=(uint16*) my_realloc((gptr) share->decode_tables, (uint) ((byte*) decode_table - (byte*) share->decode_tables), @@ -224,8 +225,7 @@ my_bool _mi_read_pack_info(MI_INFO *info, pbool fix_keys) share->decode_tables=decode_table; for (i=0 ; i < trees ; i++) share->decode_trees[i].table=ADD_TO_PTR(share->decode_trees[i].table, - diff, - uint16*); + diff, uint16*); } /* Fix record-ref-length for keys */ @@ -242,19 +242,24 @@ my_bool _mi_read_pack_info(MI_INFO *info, pbool fix_keys) } if (bit_buff.error || bit_buff.pos < bit_buff.end) - { /* info_length was wrong */ - my_errno=HA_ERR_WRONG_IN_RECORD; - my_free((gptr) share->decode_trees,MYF(0)); - my_free((gptr) share->decode_tables,MYF(0)); - DBUG_RETURN(1); - } + goto err3; + DBUG_RETURN(0); + +err3: + my_errno=HA_ERR_WRONG_IN_RECORD; +err2: + my_free((gptr) share->decode_tables,MYF(0)); +err1: + my_free((gptr) share->decode_trees,MYF(0)); +err0: + DBUG_RETURN(1); } /* Read on huff-code-table from datafile */ -static void read_huff_table(MI_BIT_BUFF *bit_buff, MI_DECODE_TREE *decode_tree, +static uint read_huff_table(MI_BIT_BUFF *bit_buff, MI_DECODE_TREE *decode_tree, uint16 **decode_table, byte **intervall_buff, uint16 *tmp_buff) { @@ -298,6 +303,8 @@ static void read_huff_table(MI_BIT_BUFF *bit_buff, MI_DECODE_TREE *decode_tree, if (! intervall_length) { table_bits=find_longest_bitstream(tmp_buff); + if (table_bits == (uint) ~0) + return 1; if (table_bits > myisam_quick_table_bits) table_bits=myisam_quick_table_bits; next_free_offset= (1 << table_bits); @@ -315,7 +322,7 @@ static void read_huff_table(MI_BIT_BUFF *bit_buff, MI_DECODE_TREE *decode_tree, bit_buff->pos+=intervall_length; bit_buff->bits=0; } - return; + return 0; } @@ -393,9 +400,13 @@ static uint copy_decode_table(uint16 *to_pos, uint offset, static uint find_longest_bitstream(uint16 *table) { uint length=1,length2; + if (*table > 512) + return ~0; if (!(*table & IS_CHAR)) length=find_longest_bitstream(table+ *table)+1; table++; + if (*table > 512) + return ~0; if (!(*table & IS_CHAR)) { length2=find_longest_bitstream(table+ *table)+1; From ef13523dbc01c5be7587f62c311d762bbd4c3aed Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 2 Dec 2004 11:39:50 +0400 Subject: [PATCH 0386/1063] Bug #6815 SHOW CREATE TABLE hangs after upgrading to 4.1 A test doesn't seem to be possible. --- sql/sql_show.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sql/sql_show.cc b/sql/sql_show.cc index bda490e2916..ff0d943a717 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -1169,6 +1169,15 @@ append_identifier(THD *thd, String *packet, const char *name, uint length) { uchar chr= (uchar) *name; length= my_mbcharlen(system_charset_info, chr); + /* + my_mbcharlen can retur 0 on a wrong multibyte + sequence. It is possible when upgrading from 4.0, + and identifier contains some accented characters. + The manual says it does not work. So we'll just + change length to 1 not to hang in the endless loop. + */ + if (!length) + length= 1; if (length == 1 && chr == (uchar) quote_char) packet->append("e_char, 1, system_charset_info); packet->append(name, length, packet->charset()); From 51e220927eda902eec82389fa9637880b8a8bf0f Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 2 Dec 2004 09:44:03 +0100 Subject: [PATCH 0387/1063] - added some BUILD/compile-ppc* build scripts to ease building on LinuxPPC - added ppc_cflags to BUILD/SETUP.sh BUILD/SETUP.sh: - added ppc_cflags for compiling on Linux/PPC --- BUILD/SETUP.sh | 1 + BUILD/compile-ppc | 10 ++++++++++ BUILD/compile-ppc-debug | 13 +++++++++++++ BUILD/compile-ppc-debug-max | 13 +++++++++++++ BUILD/compile-ppc-max | 13 +++++++++++++ 5 files changed, 50 insertions(+) create mode 100644 BUILD/compile-ppc create mode 100644 BUILD/compile-ppc-debug create mode 100644 BUILD/compile-ppc-debug-max create mode 100644 BUILD/compile-ppc-max diff --git a/BUILD/SETUP.sh b/BUILD/SETUP.sh index f8baf317e72..5f4233b8371 100644 --- a/BUILD/SETUP.sh +++ b/BUILD/SETUP.sh @@ -43,6 +43,7 @@ cxx_warnings="$global_warnings -Woverloaded-virtual -Wsign-promo -Wreorder -Wcto alpha_cflags="-mcpu=ev6 -Wa,-mev6" # Not used yet pentium_cflags="-mcpu=pentiumpro" +ppc_cflags="-mpowerpc -mcpu=powerpc" sparc_cflags="" # be as fast as we can be without losing our ability to backtrace diff --git a/BUILD/compile-ppc b/BUILD/compile-ppc new file mode 100644 index 00000000000..d248ecf2677 --- /dev/null +++ b/BUILD/compile-ppc @@ -0,0 +1,10 @@ +#! /bin/sh + +path=`dirname $0` +. "$path/SETUP.sh" + +extra_flags="$ppc_cflags $fast_cflags" +extra_configs="$static_link" +strip=yes + +. "$path/FINISH.sh" diff --git a/BUILD/compile-ppc-debug b/BUILD/compile-ppc-debug new file mode 100644 index 00000000000..2be11eaaf22 --- /dev/null +++ b/BUILD/compile-ppc-debug @@ -0,0 +1,13 @@ +#! /bin/sh + +path=`dirname $0` +. "$path/SETUP.sh" + +extra_flags="$ppc_cflags $debug_cflags" +c_warnings="$c_warnings $debug_extra_warnings" +cxx_warnings="$cxx_warnings $debug_extra_warnings" +extra_configs="$debug_configs " + +extra_configs="$extra_configs" + +. "$path/FINISH.sh" diff --git a/BUILD/compile-ppc-debug-max b/BUILD/compile-ppc-debug-max new file mode 100644 index 00000000000..9d67b46601a --- /dev/null +++ b/BUILD/compile-ppc-debug-max @@ -0,0 +1,13 @@ +#! /bin/sh + +path=`dirname $0` +. "$path/SETUP.sh" + +extra_flags="$ppc_cflags $debug_cflags" +c_warnings="$c_warnings $debug_extra_warnings" +cxx_warnings="$cxx_warnings $debug_extra_warnings" +extra_configs="$debug_configs" + +extra_configs="$extra_configs --with-berkeley-db --with-innodb --without-isam --with-embedded-server --with-openssl --with-raid --with-vio --with-ndbcluster" + +. "$path/FINISH.sh" diff --git a/BUILD/compile-ppc-max b/BUILD/compile-ppc-max new file mode 100644 index 00000000000..f7193eb8aca --- /dev/null +++ b/BUILD/compile-ppc-max @@ -0,0 +1,13 @@ +#! /bin/sh + +path=`dirname $0` +. "$path/SETUP.sh" + +extra_flags="$ppc_cflags $fast_cflags -g" +#strip=yes + +extra_configs="$extra_configs --with-innodb --with-berkeley-db \ + --with-embedded-server --enable-thread-safe-client \ + --with-openssl --with-vio --with-raid --with-ndbcluster" + +. "$path/FINISH.sh" From 5167b5f0ce57368d99d73e3299e8d891e5fb322a Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 2 Dec 2004 12:48:43 +0400 Subject: [PATCH 0388/1063] Bug #6379: ENUM values are incorrectly converted - add_field_to_list() now uses String instead of TYPELIB to be able to distinguish literals 'aaa' and hex literals 0xaabbcc. - move some code from add_field_to_list() where we don't know column charset yet, to mysql_prepare_table(), where we do. --- mysql-test/r/type_enum.result | 32 +++++++++ mysql-test/t/type_enum.test | 28 ++++++++ sql/field.h | 1 + sql/mysql_priv.h | 3 +- sql/sql_lex.h | 1 - sql/sql_parse.cc | 97 +++++++-------------------- sql/sql_table.cc | 120 ++++++++++++++++++++++++++++++++++ sql/sql_yacc.yy | 20 ++---- 8 files changed, 214 insertions(+), 88 deletions(-) diff --git a/mysql-test/r/type_enum.result b/mysql-test/r/type_enum.result index da85ffe6495..15f16e4d02d 100644 --- a/mysql-test/r/type_enum.result +++ b/mysql-test/r/type_enum.result @@ -1693,3 +1693,35 @@ oe ue ss DROP TABLE t1; +CREATE TABLE t1 ( +a ENUM('ä','ö','ü') character set utf8 default 'ü' +); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` enum('ä','ö','ü') character set utf8 default 'ü' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('ä'), ('ö'), ('ü'); +select a from t1 order by a; +a +ä +ö +ü +drop table t1; +set names utf8; +CREATE TABLE t1 ( +a ENUM('ä','ö','ü') character set latin1 default 'ü' +); +insert into t1 values ('ä'),('ö'),('ü'); +set names latin1; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` enum('ä','ö','ü') default 'ü' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select a from t1 order by a; +a +ä +ö +ü +drop table t1; diff --git a/mysql-test/t/type_enum.test b/mysql-test/t/type_enum.test index dc2e4d0f469..2c4bbdf8355 100644 --- a/mysql-test/t/type_enum.test +++ b/mysql-test/t/type_enum.test @@ -72,3 +72,31 @@ CREATE TABLE t1 (c enum('ae','oe','ue','ss') collate latin1_german2_ci); INSERT INTO t1 VALUES ('ä'),('ö'),('ü'),('ß'); SELECT * FROM t1; DROP TABLE t1; + +# +# Bug #6379: ENUM values are incorrectly converted +# +# Check latin1 -> utf8 conversion +# +CREATE TABLE t1 ( + a ENUM('ä','ö','ü') character set utf8 default 'ü' +); +show create table t1; +insert into t1 values ('ä'), ('ö'), ('ü'); +select a from t1 order by a; +drop table t1; + +# +# Now check utf8 -> latin1 conversion +# This test emulates loading a script generated with mysqldump +# +set names utf8; +CREATE TABLE t1 ( + a ENUM('ä','ö','ü') character set latin1 default 'ü' +); +insert into t1 values ('ä'),('ö'),('ü'); +# Now check what has been loaded +set names latin1; +show create table t1; +select a from t1 order by a; +drop table t1; diff --git a/sql/field.h b/sql/field.h index 8887da1dc0f..bb999222381 100644 --- a/sql/field.h +++ b/sql/field.h @@ -1198,6 +1198,7 @@ public: uint decimals,flags,pack_length; Field::utype unireg_check; TYPELIB *interval; // Which interval to use + List interval_list; CHARSET_INFO *charset; Field::geometry_type geom_type; Field *field; // For alter table diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 3f55a88b262..3a19a903e00 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -688,7 +688,8 @@ bool add_field_to_list(THD *thd, char *field_name, enum enum_field_types type, uint type_modifier, Item *default_value, Item *on_update_value, LEX_STRING *comment, - char *change, TYPELIB *interval,CHARSET_INFO *cs, + char *change, List *interval_list, + CHARSET_INFO *cs, uint uint_geom_type); void store_position_for_column(const char *name); bool add_to_list(THD *thd, SQL_LIST &list,Item *group,bool asc=0); diff --git a/sql/sql_lex.h b/sql/sql_lex.h index 90c020b3e93..68a5ac29254 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -592,7 +592,6 @@ typedef struct st_lex List var_list; List param_list; SQL_LIST proc_list, auxilliary_table_list, save_list; - TYPELIB *interval; create_field *last_field; char *savepoint_name; // Transaction savepoint id udf_func udf; diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index e066e447345..990e52d05ce 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -4115,31 +4115,6 @@ bool mysql_test_parse_for_slave(THD *thd, char *inBuf, uint length) #endif -/* - Calculate interval lengths. - Strip trailing spaces from all strings. - After this function call: - - ENUM uses max_length - - SET uses tot_length. -*/ -void calculate_interval_lengths(THD *thd, TYPELIB *interval, - uint32 *max_length, uint32 *tot_length) -{ - const char **pos; - uint *len; - CHARSET_INFO *cs= thd->variables.character_set_client; - *max_length= *tot_length= 0; - for (pos= interval->type_names, len= interval->type_lengths; - *pos ; pos++, len++) - { - *len= (uint) strip_sp((char*) *pos); - uint length= cs->cset->numchars(cs, *pos, *pos + *len); - *tot_length+= length; - set_if_bigger(*max_length, (uint32)length); - } -} - - /***************************************************************************** ** Store field definition for create ** Return 0 if ok @@ -4150,7 +4125,8 @@ bool add_field_to_list(THD *thd, char *field_name, enum_field_types type, uint type_modifier, Item *default_value, Item *on_update_value, LEX_STRING *comment, - char *change, TYPELIB *interval, CHARSET_INFO *cs, + char *change, + List *interval_list, CHARSET_INFO *cs, uint uint_geom_type) { register create_field *new_field; @@ -4445,62 +4421,39 @@ bool add_field_to_list(THD *thd, char *field_name, enum_field_types type, break; case FIELD_TYPE_SET: { - if (interval->count > sizeof(longlong)*8) + if (interval_list->elements > sizeof(longlong)*8) { - net_printf(thd,ER_TOO_BIG_SET,field_name); /* purecov: inspected */ - DBUG_RETURN(1); /* purecov: inspected */ + net_printf(thd,ER_TOO_BIG_SET,field_name); /* purecov: inspected */ + DBUG_RETURN(1); /* purecov: inspected */ } - new_field->pack_length=(interval->count+7)/8; + new_field->pack_length= (interval_list->elements + 7) / 8; if (new_field->pack_length > 4) - new_field->pack_length=8; - new_field->interval=interval; - uint32 dummy_max_length; - calculate_interval_lengths(thd, interval, - &dummy_max_length, &new_field->length); - new_field->length+= (interval->count - 1); - set_if_smaller(new_field->length,MAX_FIELD_WIDTH-1); - if (default_value) - { - char *not_used; - uint not_used2; - bool not_used3; + new_field->pack_length=8; - thd->cuted_fields=0; - String str,*res; - res=default_value->val_str(&str); - (void) find_set(interval, res->ptr(), res->length(), - &my_charset_bin, - ¬_used, ¬_used2, ¬_used3); - if (thd->cuted_fields) - { - net_printf(thd,ER_INVALID_DEFAULT,field_name); - DBUG_RETURN(1); - } - } + List_iterator it(*interval_list); + String *tmp; + while ((tmp= it++)) + new_field->interval_list.push_back(tmp); + /* + Set fake length to 1 to pass the below conditions. + Real length will be set in mysql_prepare_table() + when we know the character set of the column + */ + new_field->length= 1; } break; case FIELD_TYPE_ENUM: { - new_field->interval=interval; - new_field->pack_length=interval->count < 256 ? 1 : 2; // Should be safe + // Should be safe + new_field->pack_length= interval_list->elements < 256 ? 1 : 2; - uint32 dummy_tot_length; - calculate_interval_lengths(thd, interval, - &new_field->length, &dummy_tot_length); - set_if_smaller(new_field->length,MAX_FIELD_WIDTH-1); - if (default_value) - { - String str,*res; - res=default_value->val_str(&str); - res->strip_sp(); - if (!find_type(interval, res->ptr(), res->length(), 0)) - { - net_printf(thd,ER_INVALID_DEFAULT,field_name); - DBUG_RETURN(1); - } - } - break; + List_iterator it(*interval_list); + String *tmp; + while ((tmp= it++)) + new_field->interval_list.push_back(tmp); + new_field->length= 1; // See comment for FIELD_TYPE_SET above. } + break; } if ((new_field->length > MAX_FIELD_CHARLENGTH && type != FIELD_TYPE_SET && diff --git a/sql/sql_table.cc b/sql/sql_table.cc index eedd9388877..a304e821ecd 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -392,6 +392,41 @@ void check_duplicates_in_interval(const char *set_or_name, } } + +/* + Check TYPELIB (set or enum) max and total lengths + + SYNOPSIS + calculate_interval_lengths() + cs charset+collation pair of the interval + typelib list of values for the column + max_length length of the longest item + tot_length sum of the item lengths + + DESCRIPTION + After this function call: + - ENUM uses max_length + - SET uses tot_length. + + RETURN VALUES + void +*/ +void calculate_interval_lengths(CHARSET_INFO *cs, TYPELIB *interval, + uint32 *max_length, uint32 *tot_length) +{ + const char **pos; + uint *len; + *max_length= *tot_length= 0; + for (pos= interval->type_names, len= interval->type_lengths; + *pos ; pos++, len++) + { + uint length= cs->cset->numchars(cs, *pos, *pos + *len); + *tot_length+= length; + set_if_bigger(*max_length, (uint32)length); + } +} + + /* Preparation for table creation @@ -455,6 +490,91 @@ int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info, DBUG_RETURN(-1); } + if ((sql_field->sql_type == FIELD_TYPE_SET || + sql_field->sql_type == FIELD_TYPE_ENUM) && !sql_field->interval) + { + uint32 dummy; + CHARSET_INFO *cs= sql_field->charset; + TYPELIB *interval; + + /* + Create typelib from interval_list, and if necessary + convert strings from client character set to the + column character set. + */ + + interval= sql_field->interval= typelib(sql_field->interval_list); + List_iterator it(sql_field->interval_list); + String conv, *tmp; + for (uint i= 0; (tmp= it++); i++) + { + if (String::needs_conversion(tmp->length(), tmp->charset(), cs, &dummy)) + { + uint cnv_errs; + conv.copy(tmp->ptr(), tmp->length(), tmp->charset(), cs, &cnv_errs); + char *buf= (char*) sql_alloc(conv.length()+1); + memcpy(buf, conv.ptr(), conv.length()); + buf[conv.length()]= '\0'; + interval->type_names[i]= buf; + interval->type_lengths[i]= conv.length(); + } + + // Strip trailing spaces. + uint lengthsp= cs->cset->lengthsp(cs, interval->type_names[i], + interval->type_lengths[i]); + interval->type_lengths[i]= lengthsp; + ((uchar *)interval->type_names[i])[lengthsp]= '\0'; + } + sql_field->interval_list.empty(); // Don't need interval_list anymore + + + /* + Convert the default value from client character + set into the column character set if necessary. + */ + if (sql_field->def) + { + sql_field->def= + sql_field->def->safe_charset_converter(cs); + } + + if (sql_field->sql_type == FIELD_TYPE_SET) + { + if (sql_field->def) + { + char *not_used; + uint not_used2; + bool not_found= 0; + String str, *def= sql_field->def->val_str(&str); + def->length(cs->cset->lengthsp(cs, def->ptr(), def->length())); + (void) find_set(interval, def->ptr(), def->length(), + cs, ¬_used, ¬_used2, ¬_found); + if (not_found) + { + my_error(ER_INVALID_DEFAULT, MYF(0), sql_field->field_name); + DBUG_RETURN(-1); + } + } + calculate_interval_lengths(cs, interval, &dummy, &sql_field->length); + sql_field->length+= (interval->count - 1); + } + else /* FIELD_TYPE_ENUM */ + { + if (sql_field->def) + { + String str, *def= sql_field->def->val_str(&str); + def->length(cs->cset->lengthsp(cs, def->ptr(), def->length())); + if (!find_type2(interval, def->ptr(), def->length(), cs)) + { + my_error(ER_INVALID_DEFAULT, MYF(0), sql_field->field_name); + DBUG_RETURN(-1); + } + } + calculate_interval_lengths(cs, interval, &sql_field->length, &dummy); + } + set_if_smaller(sql_field->length, MAX_FIELD_WIDTH-1); + } + sql_field->create_length_to_internal_length(); /* Don't pack keys in old tables if the user has requested this */ diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 8cbfaf3f99b..49e567ab54b 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -1361,7 +1361,7 @@ field_spec: field_ident { LEX *lex=Lex; - lex->length=lex->dec=0; lex->type=0; lex->interval=0; + lex->length=lex->dec=0; lex->type=0; lex->default_value= lex->on_update_value= 0; lex->comment=0; lex->charset=NULL; @@ -1374,7 +1374,7 @@ field_spec: lex->length,lex->dec,lex->type, lex->default_value, lex->on_update_value, lex->comment, - lex->change,lex->interval,lex->charset, + lex->change,&lex->interval_list,lex->charset, lex->uint_geom_type)) YYABORT; }; @@ -1471,17 +1471,9 @@ type: | FIXED_SYM float_options field_options { $$=FIELD_TYPE_DECIMAL;} | ENUM {Lex->interval_list.empty();} '(' string_list ')' opt_binary - { - LEX *lex=Lex; - lex->interval=typelib(lex->interval_list); - $$=FIELD_TYPE_ENUM; - } + { $$=FIELD_TYPE_ENUM; } | SET { Lex->interval_list.empty();} '(' string_list ')' opt_binary - { - LEX *lex=Lex; - lex->interval=typelib(lex->interval_list); - $$=FIELD_TYPE_SET; - } + { $$=FIELD_TYPE_SET; } | LONG_SYM opt_binary { $$=FIELD_TYPE_MEDIUM_BLOB; } | SERIAL_SYM { @@ -1925,7 +1917,7 @@ alter_list_item: | MODIFY_SYM opt_column field_ident { LEX *lex=Lex; - lex->length=lex->dec=0; lex->type=0; lex->interval=0; + lex->length=lex->dec=0; lex->type=0; lex->default_value= lex->on_update_value= 0; lex->comment=0; lex->charset= NULL; @@ -1940,7 +1932,7 @@ alter_list_item: lex->length,lex->dec,lex->type, lex->default_value, lex->on_update_value, lex->comment, - $3.str, lex->interval, lex->charset, + $3.str, &lex->interval_list, lex->charset, lex->uint_geom_type)) YYABORT; } From c59d473b02a72365fce14e184d258c5b36cba3f9 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 2 Dec 2004 10:11:28 +0100 Subject: [PATCH 0389/1063] - fixed file permissions (need execute bits set) BUILD/compile-ppc-debug-max: Change mode to -rwxrwxr-x BUILD/compile-ppc-debug: Change mode to -rwxrwxr-x BUILD/compile-ppc-max: Change mode to -rwxrwxr-x BUILD/compile-ppc: Change mode to -rwxrwxr-x --- BUILD/compile-ppc | 0 BUILD/compile-ppc-debug | 0 BUILD/compile-ppc-debug-max | 0 BUILD/compile-ppc-max | 0 4 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 BUILD/compile-ppc mode change 100644 => 100755 BUILD/compile-ppc-debug mode change 100644 => 100755 BUILD/compile-ppc-debug-max mode change 100644 => 100755 BUILD/compile-ppc-max diff --git a/BUILD/compile-ppc b/BUILD/compile-ppc old mode 100644 new mode 100755 diff --git a/BUILD/compile-ppc-debug b/BUILD/compile-ppc-debug old mode 100644 new mode 100755 diff --git a/BUILD/compile-ppc-debug-max b/BUILD/compile-ppc-debug-max old mode 100644 new mode 100755 diff --git a/BUILD/compile-ppc-max b/BUILD/compile-ppc-max old mode 100644 new mode 100755 From 39d62ccc93c23f31db81459c4844133a49e19047 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 2 Dec 2004 09:34:27 +0000 Subject: [PATCH 0390/1063] mgmapi.cpp: bug #6919 ndb/src/mgmapi/mgmapi.cpp: bug #6919 --- ndb/src/mgmapi/mgmapi.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ndb/src/mgmapi/mgmapi.cpp b/ndb/src/mgmapi/mgmapi.cpp index 651a4a8a725..e22ceffe773 100644 --- a/ndb/src/mgmapi/mgmapi.cpp +++ b/ndb/src/mgmapi/mgmapi.cpp @@ -574,7 +574,9 @@ cmp_state(const void *_a, const void *_b) a = (struct ndb_mgm_node_state *)_a; b = (struct ndb_mgm_node_state *)_b; - return a->node_id > b->node_id; + if (a->node_id > b->node_id) + return 1; + return -1; } extern "C" From 491a3d90a99c3849c220592b4f8ff29de8484de9 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 2 Dec 2004 13:34:30 +0400 Subject: [PATCH 0391/1063] Fixes (bug #6932: 'revoke all privileges...' doesn't remove all proper columns from columns_priv bug #6933: error in the tests/grant.pl test). mysql-test/r/grant.result: A fix (bug #6932: 'revoke all privileges...' doesn't remove all proper columns from columns_priv). mysql-test/t/grant.test: A fix (bug #6932: 'revoke all privileges...' doesn't remove all proper columns from columns_priv). sql/sql_acl.cc: A fix (bug #6932: 'revoke all privileges...' doesn't remove all proper columns from columns_priv). The problem is that we use whole key length (including 'Column_name' keypart) during scanning the 'columns_priv' table in case of revoke_grant. tests/grant.pl: A fix (bug #6933: error in the tests/grant.pl test). --- mysql-test/r/grant.result | 20 ++++++++++++++++++++ mysql-test/t/grant.test | 13 +++++++++++++ sql/sql_acl.cc | 2 +- tests/grant.pl | 4 ++-- 4 files changed, 36 insertions(+), 3 deletions(-) diff --git a/mysql-test/r/grant.result b/mysql-test/r/grant.result index f903e35fa1f..d163e1033fc 100644 --- a/mysql-test/r/grant.result +++ b/mysql-test/r/grant.result @@ -321,3 +321,23 @@ DROP DATABASE testdb7; DROP DATABASE testdb8; DROP DATABASE testdb9; DROP DATABASE testdb10; +create table t1(a int, b int, c int, d int); +grant insert(b), insert(c), insert(d), insert(a) on t1 to grant_user@localhost; +show grants for grant_user@localhost; +Grants for grant_user@localhost +GRANT USAGE ON *.* TO 'grant_user'@'localhost' +GRANT INSERT (a, d, c, b) ON `test`.`t1` TO 'grant_user'@'localhost' +select Host,Db,User,Table_name,Column_name,Column_priv from mysql.columns_priv; +Host Db User Table_name Column_name Column_priv +localhost test grant_user t1 c Insert +localhost test grant_user t1 b Insert +localhost test grant_user t1 a Insert +localhost test grant_user t1 d Insert +revoke ALL PRIVILEGES on t1 from grant_user@localhost; +show grants for grant_user@localhost; +Grants for grant_user@localhost +GRANT USAGE ON *.* TO 'grant_user'@'localhost' +select Host,Db,User,Table_name,Column_name,Column_priv from mysql.columns_priv; +Host Db User Table_name Column_name Column_priv +drop user grant_user@localhost; +drop table t1; diff --git a/mysql-test/t/grant.test b/mysql-test/t/grant.test index 963b9ae5080..169dd03ad86 100644 --- a/mysql-test/t/grant.test +++ b/mysql-test/t/grant.test @@ -267,3 +267,16 @@ DROP DATABASE testdb8; DROP DATABASE testdb9; DROP DATABASE testdb10; +# +# Bug #6932: a problem with 'revoke ALL PRIVILEGES' +# + +create table t1(a int, b int, c int, d int); +grant insert(b), insert(c), insert(d), insert(a) on t1 to grant_user@localhost; +show grants for grant_user@localhost; +select Host,Db,User,Table_name,Column_name,Column_priv from mysql.columns_priv; +revoke ALL PRIVILEGES on t1 from grant_user@localhost; +show grants for grant_user@localhost; +select Host,Db,User,Table_name,Column_name,Column_priv from mysql.columns_priv; +drop user grant_user@localhost; +drop table t1; diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index d6f52fed1d2..f1698dcc911 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -2035,7 +2035,7 @@ static int replace_column_table(GRANT_TABLE *g_t, { table->file->extra(HA_EXTRA_RETRIEVE_ALL_COLS); if (table->file->index_read(table->record[0], (byte*) table->field[0]->ptr, - table->key_info[0].key_length, + key_length, HA_READ_KEY_EXACT)) goto end; diff --git a/tests/grant.pl b/tests/grant.pl index eb2d00f3e1d..cd6a2eb80de 100644 --- a/tests/grant.pl +++ b/tests/grant.pl @@ -74,9 +74,9 @@ safe_query("revoke select(user) on mysql.user from $user"); safe_query("grant select on *.* to $user"); safe_query("set password FOR ${opt_user}2\@$opt_host = password('test')",1); -safe_query("set password FOR $opt_user=password('test')"); +safe_query("set password FOR $opt_user\@$opt_host=password('test')"); user_connect(1); -safe_query("set password FOR $opt_user=''"); +safe_query("set password FOR $opt_user\@$opt_host=''"); user_connect(0); user_query("select * from mysql.user where user = '$opt_user'"); user_query("select * from mysql.db where user = '$opt_user'"); From a845e882fd31c1b6e52d2a19017c8a2bd6f9c66c Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 2 Dec 2004 14:34:53 +0400 Subject: [PATCH 0392/1063] A fix (bug #6878: Crash with engine=memory). heap/hp_open.c: A fix (bug #6878: Crash with engine=memory). Record length should be >= sizeof(byte*). --- heap/hp_open.c | 7 +++++++ mysql-test/r/heap.result | 9 +++++++++ mysql-test/t/heap.test | 11 +++++++++++ 3 files changed, 27 insertions(+) diff --git a/heap/hp_open.c b/heap/hp_open.c index 3bf2881667a..9cb087e3bad 100644 --- a/heap/hp_open.c +++ b/heap/hp_open.c @@ -41,6 +41,13 @@ HP_INFO *heap_open(const char *name, int mode, uint keys, HP_KEYDEF *keydef, { DBUG_PRINT("info",("Initializing new table")); implicit_emptied= 1; + + /* + We have to store sometimes byte* del_link in records, + so the record length should be at least sizeof(byte*) + */ + set_if_bigger(reclength, sizeof (byte*)); + for (i=key_segs=max_length=0 ; i < keys ; i++) { key_segs+= keydef[i].keysegs; diff --git a/mysql-test/r/heap.result b/mysql-test/r/heap.result index 11958f0a619..ef64c3a562f 100644 --- a/mysql-test/r/heap.result +++ b/mysql-test/r/heap.result @@ -227,3 +227,12 @@ SELECT MAX(job_title_id) FROM job_titles; MAX(job_title_id) NULL DROP TABLE job_titles; +create table t1(a char(2)) type=heap; +insert into t1 values (NULL), (NULL); +delete from t1 where a is null; +insert into t1 values ('2'), ('3'); +select * from t1; +a +3 +2 +drop table t1; diff --git a/mysql-test/t/heap.test b/mysql-test/t/heap.test index 87518798a36..943910b7872 100644 --- a/mysql-test/t/heap.test +++ b/mysql-test/t/heap.test @@ -161,3 +161,14 @@ CREATE TABLE `job_titles` ( SELECT MAX(job_title_id) FROM job_titles; DROP TABLE job_titles; + +# +# Bug #6878: a problem with small length records +# + +create table t1(a char(2)) type=heap; +insert into t1 values (NULL), (NULL); +delete from t1 where a is null; +insert into t1 values ('2'), ('3'); +select * from t1; +drop table t1; From d0a47dbf72e4a6dee4d061c16183c933ff35e8f6 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 2 Dec 2004 12:40:25 +0200 Subject: [PATCH 0393/1063] mysqld.cc: innodb_autoextend_increment: set a maximum limit of 1000 (Bug #6904) sql/mysqld.cc: innodb_autoextend_increment: set a maximum limit of 1000 (Bug #6904) --- sql/mysqld.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index baab3017623..da834080bc0 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -4801,7 +4801,7 @@ replicating a LOAD DATA INFILE command.", "Data file autoextend increment in megabytes", (gptr*) &srv_auto_extend_increment, (gptr*) &srv_auto_extend_increment, - 0, GET_LONG, REQUIRED_ARG, 8L, 1L, ~0L, 0, 1L, 0}, + 0, GET_LONG, REQUIRED_ARG, 8L, 1L, 1000L, 0, 1L, 0}, {"innodb_buffer_pool_awe_mem_mb", OPT_INNODB_BUFFER_POOL_AWE_MEM_MB, "If Windows AWE is used, the size of InnoDB buffer pool allocated from the AWE memory.", (gptr*) &innobase_buffer_pool_awe_mem_mb, (gptr*) &innobase_buffer_pool_awe_mem_mb, 0, From 33a4b35ec8199af03eb1b5b64e47c9e940f253b1 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 2 Dec 2004 15:06:15 +0400 Subject: [PATCH 0394/1063] A fix (bug #6878: Crash with engine=memory). heap/hp_create.c: A fix (bug #6878: Crash with engine=memory). Record length should be >= sizeof(byte*). --- heap/hp_create.c | 7 +++++++ mysql-test/r/heap.result | 9 +++++++++ mysql-test/t/heap.test | 10 ++++++++++ 3 files changed, 26 insertions(+) diff --git a/heap/hp_create.c b/heap/hp_create.c index d1783118c0d..fdfe78a1e09 100644 --- a/heap/hp_create.c +++ b/heap/hp_create.c @@ -41,6 +41,13 @@ int heap_create(const char *name, uint keys, HP_KEYDEF *keydef, { HP_KEYDEF *keyinfo; DBUG_PRINT("info",("Initializing new table")); + + /* + We have to store sometimes byte* del_link in records, + so the record length should be at least sizeof(byte*) + */ + set_if_bigger(reclength, sizeof (byte*)); + for (i= key_segs= max_length= 0, keyinfo= keydef; i < keys; i++, keyinfo++) { bzero((char*) &keyinfo->block,sizeof(keyinfo->block)); diff --git a/mysql-test/r/heap.result b/mysql-test/r/heap.result index 1f994b100e2..b1cd17b444c 100644 --- a/mysql-test/r/heap.result +++ b/mysql-test/r/heap.result @@ -240,3 +240,12 @@ SELECT * FROM t1; pseudo date ZoomZip 1101106546 DROP TABLE t1; +create table t1(a char(2)) engine=memory; +insert into t1 values (NULL), (NULL); +delete from t1 where a is null; +insert into t1 values ('2'), ('3'); +select * from t1; +a +3 +2 +drop table t1; diff --git a/mysql-test/t/heap.test b/mysql-test/t/heap.test index 2eff36f3317..bc0b28370ec 100644 --- a/mysql-test/t/heap.test +++ b/mysql-test/t/heap.test @@ -185,3 +185,13 @@ DELETE FROM t1 WHERE date<1101106546; SELECT * FROM t1; DROP TABLE t1; +# +# Bug #6878: a problem with small length records +# + +create table t1(a char(2)) engine=memory; +insert into t1 values (NULL), (NULL); +delete from t1 where a is null; +insert into t1 values ('2'), ('3'); +select * from t1; +drop table t1; From 29b3ae4dd4017239058a6280b713cf2f18457bf5 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 2 Dec 2004 14:28:59 +0300 Subject: [PATCH 0395/1063] Fix for Bug#6377 "Password Generation Discrepancy" client/mysqladmin.cc: Fix for Bug#6377 "Password Generation Discrepancy": this is not a MySQL bug. The problem is that Windows command line client doesn't trim single quotes from arguments, as any UNIX shell does. The fix just checks for this condition and gives a warning if it is true. --- client/mysqladmin.cc | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/client/mysqladmin.cc b/client/mysqladmin.cc index b95ad83f7e8..2e8b3cd588a 100644 --- a/client/mysqladmin.cc +++ b/client/mysqladmin.cc @@ -825,10 +825,17 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv) } if (argv[1][0]) { + char *pw= argv[1]; +#ifdef __WIN__ + uint pw_len= strlen(pw); + if (pw_len > 1 && pw[0] == '\'' && pw[pw_len-1] == '\'') + printf("Warning: single quotes were not trimmed from the password by" + " your command\nline client, as you might have expected.\n"); +#endif if (find_type(argv[0], &command_typelib, 2) == ADMIN_OLD_PASSWORD) - make_scrambled_password_323(crypted_pw, argv[1]); + make_scrambled_password_323(crypted_pw, pw); else - make_scrambled_password(crypted_pw, argv[1]); + make_scrambled_password(crypted_pw, pw); } else crypted_pw[0]=0; /* No password */ From d3c5c4997ca71610abf7e94b0c66f27278e3341e Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 2 Dec 2004 16:08:17 +0400 Subject: [PATCH 0396/1063] Fixes to make mysql-test-run --embedded-server working mysql-test/mysql-test-run.sh: Tests that can't be fixed now showed in the ignore-list mysql-test/r/query_cache.result.es: test result renewed mysql-test/r/select.result.es: test result renewed mysql-test/r/type_blob.result.es: test result renewed mysql-test/r/type_float.result.es: test result renewed sql/sql_prepare.cc: time values sending fixed tests/client_test.c: that doesnt work in embedded server BitKeeper/etc/ignore: Added libmysqld/ha_archive.cc libmysqld/ha_example.cc libmysqld/ha_tina.cc to the ignore list --- .bzrignore | 3 + mysql-test/mysql-test-run.sh | 7 + mysql-test/r/ctype_big5.result.es | 58 + mysql-test/r/ctype_recoding.result.es | 242 + mysql-test/r/ctype_uca.result.es | 2377 ++++++++++ mysql-test/r/func_test.result.es | 185 + mysql-test/r/innodb.result.es | 1653 +++++++ mysql-test/r/myisam-blob.result.es | 59 + mysql-test/r/ps_2myisam.result.es | 3130 +++++++++++++ mysql-test/r/ps_3innodb.result.es | 3113 +++++++++++++ mysql-test/r/ps_4heap.result.es | 3114 +++++++++++++ mysql-test/r/ps_5merge.result.es | 6064 +++++++++++++++++++++++++ mysql-test/r/ps_6bdb.result.es | 3113 +++++++++++++ mysql-test/r/query_cache.result.es | 15 + mysql-test/r/select.result.es | 29 +- mysql-test/r/type_blob.result.es | 4 +- mysql-test/r/type_float.result.es | 6 +- mysql-test/t/bdb-deadlock.tminus | 57 + sql/sql_prepare.cc | 13 +- tests/client_test.c | 2 + 20 files changed, 23235 insertions(+), 9 deletions(-) create mode 100644 mysql-test/r/ctype_big5.result.es create mode 100644 mysql-test/r/ctype_recoding.result.es create mode 100644 mysql-test/r/ctype_uca.result.es create mode 100644 mysql-test/r/func_test.result.es create mode 100644 mysql-test/r/innodb.result.es create mode 100644 mysql-test/r/myisam-blob.result.es create mode 100644 mysql-test/r/ps_2myisam.result.es create mode 100644 mysql-test/r/ps_3innodb.result.es create mode 100644 mysql-test/r/ps_4heap.result.es create mode 100644 mysql-test/r/ps_5merge.result.es create mode 100644 mysql-test/r/ps_6bdb.result.es create mode 100644 mysql-test/t/bdb-deadlock.tminus diff --git a/.bzrignore b/.bzrignore index 10388d79013..80079b02026 100644 --- a/.bzrignore +++ b/.bzrignore @@ -940,3 +940,6 @@ ndbcluster-1186/ndb_3_out.log ndbcluster-1186/ndbcluster.pid ndb/tools/ndb_restore ac_available_languages_fragment +libmysqld/ha_archive.cc +libmysqld/ha_example.cc +libmysqld/ha_tina.cc diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index 27eae89922c..09d3511fec8 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -1387,13 +1387,18 @@ run_testcase () # script soon anyway so it is not worth it spending the time if [ "x$USE_EMBEDDED_SERVER" = "x1" -a -z "$DO_TEST" ] ; then for t in \ + "alter_table" \ "bdb-deadlock" \ "connect" \ + "ctype_latin1_de" \ + "ctype_ucs" \ "flush_block_commit" \ "grant2" \ "grant_cache" \ "grant" \ "init_connect" \ + "init_file" \ + "innodb" \ "innodb-deadlock" \ "innodb-lock" \ "mix_innodb_myisam_binlog" \ @@ -1401,10 +1406,12 @@ run_testcase () "mysqlbinlog" \ "mysqldump" \ "mysql_protocols" \ + "packet" \ "ps_1general" \ "rename" \ "show_check" \ "system_mysql_db_fix" \ + "timezone2" \ "user_var" \ "variables" do diff --git a/mysql-test/r/ctype_big5.result.es b/mysql-test/r/ctype_big5.result.es new file mode 100644 index 00000000000..9b9fcbccbe0 --- /dev/null +++ b/mysql-test/r/ctype_big5.result.es @@ -0,0 +1,58 @@ +drop table if exists t1; +SET @test_character_set= 'big5'; +SET @test_collation= 'big5_chinese_ci'; +SET @safe_character_set_server= @@character_set_server; +SET @safe_collation_server= @@collation_server; +SET character_set_server= @test_character_set; +SET collation_server= @test_collation; +CREATE DATABASE d1; +USE d1; +CREATE TABLE t1 (c CHAR(10), KEY(c)); +SHOW FULL COLUMNS FROM t1; +Field Type Collation Null Key Default Extra Privileges Comment +c char(10) big5_chinese_ci YES MUL NULL +INSERT INTO t1 VALUES ('aaa'),('aaaa'),('aaaaa'); +SELECT c as want3results FROM t1 WHERE c LIKE 'aaa%'; +want3results +aaa +aaaa +aaaaa +DROP TABLE t1; +CREATE TABLE t1 (c1 varchar(15), KEY c1 (c1(2))); +SHOW FULL COLUMNS FROM t1; +Field Type Collation Null Key Default Extra Privileges Comment +c1 varchar(15) big5_chinese_ci YES MUL NULL +INSERT INTO t1 VALUES ('location'),('loberge'),('lotre'),('boabab'); +SELECT c1 as want3results from t1 where c1 like 'l%'; +want3results +location +loberge +lotre +SELECT c1 as want3results from t1 where c1 like 'lo%'; +want3results +location +loberge +lotre +SELECT c1 as want1result from t1 where c1 like 'loc%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'loca%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'locat%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'locati%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'locatio%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'location%'; +want1result +location +DROP TABLE t1; +DROP DATABASE d1; +USE test; +SET character_set_server= @safe_character_set_server; +SET collation_server= @safe_collation_server; diff --git a/mysql-test/r/ctype_recoding.result.es b/mysql-test/r/ctype_recoding.result.es new file mode 100644 index 00000000000..27425a69872 --- /dev/null +++ b/mysql-test/r/ctype_recoding.result.es @@ -0,0 +1,242 @@ +SET CHARACTER SET koi8r; +DROP TABLE IF EXISTS ÔÁÂÌÉÃÁ, t1, t2; +SET CHARACTER SET koi8r; +CREATE TABLE t1 (a CHAR(10) CHARACTER SET cp1251) SELECT _koi8r'ÐÒÏÂÁ' AS a; +CREATE TABLE t2 (a CHAR(10) CHARACTER SET utf8); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` char(10) character set cp1251 default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SELECT a FROM t1; +a +ÐÒÏÂÁ +SELECT HEX(a) FROM t1; +HEX(a) +EFF0EEE1E0 +INSERT t2 SELECT * FROM t1; +SELECT HEX(a) FROM t2; +HEX(a) +D0BFD180D0BED0B1D0B0 +DROP TABLE t1, t2; +CREATE TABLE t1 (description text character set cp1250 NOT NULL); +INSERT INTO t1 (description) VALUES (_latin2'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaasssssssssssaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddde'); +SELECT description FROM t1; +description +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaasssssssssssaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddde +DROP TABLE t1; +CREATE TABLE t1 (a TEXT CHARACTER SET cp1251) SELECT _koi8r'ÐÒÏÂÁ' AS a; +CREATE TABLE t2 (a TEXT CHARACTER SET utf8); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` text character set cp1251 +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SELECT HEX(a) FROM t1; +HEX(a) +EFF0EEE1E0 +INSERT t2 SELECT * FROM t1; +SELECT HEX(a) FROM t2; +HEX(a) +D0BFD180D0BED0B1D0B0 +DROP TABLE t1, t2; +CREATE TABLE `ÔÁÂÌÉÃÁ` +( +ÐÏÌÅ CHAR(32) CHARACTER SET koi8r NOT NULL COMMENT "ËÏÍÍÅÎÔÁÒÉÊ ÐÏÌÑ" +) COMMENT "ËÏÍÍÅÎÔÁÒÉÊ ÔÁÂÌÉÃÙ"; +SHOW TABLES; +Tables_in_test +ÔÁÂÌÉÃÁ +SHOW CREATE TABLE ÔÁÂÌÉÃÁ; +Table Create Table +ÔÁÂÌÉÃÁ CREATE TABLE `ÔÁÂÌÉÃÁ` ( + `ÐÏÌÅ` char(32) character set koi8r NOT NULL default '' COMMENT 'ËÏÍÍÅÎÔÁÒÉÊ ÐÏÌÑ' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='ËÏÍÍÅÎÔÁÒÉÊ ÔÁÂÌÉÃÙ' +SHOW FIELDS FROM ÔÁÂÌÉÃÁ; +Field Type Null Key Default Extra +ÐÏÌÅ char(32) +SET CHARACTER SET cp1251; +SHOW TABLES; +Tables_in_test +òàáëèöà +SHOW CREATE TABLE òàáëèöà; +Table Create Table +òàáëèöà CREATE TABLE `òàáëèöà` ( + `ïîëå` char(32) character set koi8r NOT NULL default '' COMMENT 'êîììåíòàðèé ïîëÿ' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='êîììåíòàðèé òàáëèöû' +SHOW FIELDS FROM òàáëèöà; +Field Type Null Key Default Extra +ïîëå char(32) +SET CHARACTER SET utf8; +SHOW TABLES; +Tables_in_test +таблица +SHOW CREATE TABLE таблица; +Table Create Table +таблица CREATE TABLE `таблица` ( + `поле` char(32) character set koi8r NOT NULL default '' COMMENT 'комментарий полÑ' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='комментарий таблицы' +SHOW FIELDS FROM таблица; +Field Type Null Key Default Extra +поле char(32) +SET CHARACTER SET koi8r; +DROP TABLE ÔÁÂÌÉÃÁ; +SET CHARACTER SET default; +SET NAMES UTF8; +CREATE TABLE t1 (t text) DEFAULT CHARSET UTF8; +INSERT INTO t1 (t) VALUES ('x'); +SELECT 1 FROM t1 WHERE CONCAT(_latin1'x') = t; +1 +1 +DROP TABLE t1; +SET CHARACTER SET koi8r; +CREATE DATABASE ÔÅÓÔ; +USE ÔÅÓÔ; +SHOW TABLES; +Tables_in_теÑÑ‚ +SHOW TABLES IN ÔÅÓÔ; +Tables_in_теÑÑ‚ +SET CHARACTER SET cp1251; +SHOW TABLES; +Tables_in_теÑÑ‚ +SHOW TABLES IN òåñò; +Tables_in_теÑÑ‚ +SET CHARACTER SET koi8r; +DROP DATABASE ÔÅÓÔ; +SET NAMES koi8r; +SELECT hex('ÔÅÓÔ'); +hex('теÑÑ‚') +D4C5D3D4 +SET character_set_connection=cp1251; +SELECT hex('ÔÅÓÔ'); +hex('теÑÑ‚') +F2E5F1F2 +USE test; +SET NAMES binary; +CREATE TABLE `теÑÑ‚` (`теÑÑ‚` int); +SHOW CREATE TABLE `теÑÑ‚`; +Table Create Table +теÑÑ‚ CREATE TABLE `теÑÑ‚` ( + `теÑÑ‚` int(11) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SET NAMES utf8; +SHOW CREATE TABLE `теÑÑ‚`; +Table Create Table +теÑÑ‚ CREATE TABLE `теÑÑ‚` ( + `теÑÑ‚` int(11) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE `теÑÑ‚`; +SET NAMES binary; +SET character_set_connection=utf8; +SELECT 'теÑÑ‚' as s; +s +теÑÑ‚ +SET NAMES utf8; +SET character_set_connection=binary; +SELECT 'теÑÑ‚' as s; +s +теÑÑ‚ +SET NAMES latin1; +CREATE TABLE t1 (`ä` CHAR(128) DEFAULT 'ä', `ä1` ENUM('ä1','ä2') DEFAULT 'ä2'); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `ä` char(128) default 'ä', + `ä1` enum('ä1','ä2') default 'ä2' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SHOW COLUMNS FROM t1; +Field Type Null Key Default Extra +ä char(128) YES ä +ä1 enum('ä1','ä2') YES ä2 +SET NAMES binary; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `ä` char(128) default 'ä', + `ä1` enum('ä1','ä2') default 'ä2' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SHOW COLUMNS FROM t1; +Field Type Null Key Default Extra +ä char(128) YES ä +ä1 enum('ä1','ä2') YES ä2 +DROP TABLE t1; +SET NAMES binary; +CREATE TABLE `goodÐÌÏÈÏ` (a int); +ERROR HY000: Invalid utf8 character string: 'ÐÌÏÈÏ' +SET NAMES utf8; +CREATE TABLE `goodÐÌÏÈÏ` (a int); +ERROR HY000: Invalid utf8 character string: 'ÐÌÏÈÏ` (a int)' +set names latin1; +create table t1 (a char(10) character set koi8r, b text character set koi8r); +insert into t1 values ('test','test'); +insert into t1 values ('ÊÃÕË','ÊÃÕË'); +Warnings: +Warning 1265 Data truncated for column 'a' at row 1 +Warning 1265 Data truncated for column 'b' at row 1 +drop table t1; +set names koi8r; +create table t1 (a char(10) character set cp1251); +insert into t1 values (_koi8r'×ÁÓÑ'); +select * from t1 where a=_koi8r'×ÁÓÑ'; +a +×ÁÓÑ +select * from t1 where a=concat(_koi8r'×ÁÓÑ'); +ERROR HY000: Illegal mix of collations (cp1251_general_ci,IMPLICIT) and (koi8r_general_ci,COERCIBLE) for operation '=' +select * from t1 where a=_latin1'×ÁÓÑ'; +ERROR HY000: Illegal mix of collations (cp1251_general_ci,IMPLICIT) and (latin1_swedish_ci,COERCIBLE) for operation '=' +drop table t1; +set names latin1; +set names koi8r; +create table t1 (c1 char(10) character set cp1251); +insert into t1 values ('ß'); +select c1 from t1 where c1 between 'ß' and 'ß'; +c1 +ß +select ifnull(c1,'ß'), ifnull(null,c1) from t1; +ifnull(c1,'ÑŠ') ifnull(null,c1) +ß ß +select if(1,c1,'ö'), if(0,c1,'ö') from t1; +if(1,c1,'Ж') if(0,c1,'Ж') +ß ö +select coalesce('ö',c1), coalesce(null,c1) from t1; +coalesce('Ж',c1) coalesce(null,c1) +ö ß +select least(c1,'ö'), greatest(c1,'ö') from t1; +least(c1,'Ж') greatest(c1,'Ж') +ö ß +select locate(c1,'ß'), locate('ß',c1) from t1; +locate(c1,'ÑŠ') locate('ÑŠ',c1) +1 1 +select field(c1,'ß'),field('ß',c1) from t1; +field(c1,'ÑŠ') field('ÑŠ',c1) +1 1 +select concat(c1,'ö'), concat('ö',c1) from t1; +concat(c1,'Ж') concat('Ж',c1) +ßö öß +select concat_ws(c1,'ö','ß'), concat_ws('ö',c1,'ß') from t1; +concat_ws(c1,'Ж','ÑŠ') concat_ws('Ж',c1,'ÑŠ') +ößß ßöß +select replace(c1,'ß','ö'), replace('ß',c1,'ö') from t1; +replace(c1,'ÑŠ','Ж') replace('ÑŠ',c1,'Ж') +ö ö +select substring_index(c1,'öößß',2) from t1; +substring_index(c1,'ЖЖъъ',2) +ß +select elt(1,c1,'ö'),elt(1,'ö',c1) from t1; +elt(1,c1,'Ж') elt(1,'Ж',c1) +ß ö +select make_set(3,c1,'ö'), make_set(3,'ö',c1) from t1; +make_set(3,c1,'Ж') make_set(3,'Ж',c1) +ß,ö ö,ß +select insert(c1,1,2,'ö'),insert('ö',1,2,c1) from t1; +insert(c1,1,2,'Ж') insert('Ж',1,2,c1) +ö ß +select trim(c1 from 'ß'),trim('ß' from c1) from t1; +trim(c1 from 'ÑŠ') trim('ÑŠ' from c1) + +select lpad(c1,3,'ö'), lpad('ö',3,c1) from t1; +lpad(c1,3,'Ж') lpad('Ж',3,c1) +ööß ßßö +select rpad(c1,3,'ö'), rpad('ö',3,c1) from t1; +rpad(c1,3,'Ж') rpad('Ж',3,c1) +ßöö ößß diff --git a/mysql-test/r/ctype_uca.result.es b/mysql-test/r/ctype_uca.result.es new file mode 100644 index 00000000000..1f86376def6 --- /dev/null +++ b/mysql-test/r/ctype_uca.result.es @@ -0,0 +1,2377 @@ +DROP TABLE IF EXISTS t1; +set names utf8; +set collation_connection=utf8_unicode_ci; +select 'a' = 'a', 'a' = 'a ', 'a ' = 'a'; +'a' = 'a' 'a' = 'a ' 'a ' = 'a' +1 1 1 +select 'a\t' = 'a' , 'a\t' < 'a' , 'a\t' > 'a'; +'a\t' = 'a' 'a\t' < 'a' 'a\t' > 'a' +0 1 0 +select 'a\t' = 'a ', 'a\t' < 'a ', 'a\t' > 'a '; +'a\t' = 'a ' 'a\t' < 'a ' 'a\t' > 'a ' +0 1 0 +select 'a' = 'a\t', 'a' < 'a\t', 'a' > 'a\t'; +'a' = 'a\t' 'a' < 'a\t' 'a' > 'a\t' +0 0 1 +select 'a ' = 'a\t', 'a ' < 'a\t', 'a ' > 'a\t'; +'a ' = 'a\t' 'a ' < 'a\t' 'a ' > 'a\t' +0 0 1 +select 'a a' > 'a', 'a \t' < 'a'; +'a a' > 'a' 'a \t' < 'a' +1 1 +select 'c' like '\_' as want0; +want0 +0 +CREATE TABLE t ( +c char(20) NOT NULL +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; +INSERT INTO t VALUES ('a'),('ab'),('aba'); +ALTER TABLE t ADD INDEX (c); +SELECT c FROM t WHERE c LIKE 'a%'; +c +a +ab +aba +DROP TABLE t; +create table t1 (c1 char(10) character set utf8 collate utf8_bin); +insert into t1 values ('A'),('a'); +insert into t1 values ('B'),('b'); +insert into t1 values ('C'),('c'); +insert into t1 values ('D'),('d'); +insert into t1 values ('E'),('e'); +insert into t1 values ('F'),('f'); +insert into t1 values ('G'),('g'); +insert into t1 values ('H'),('h'); +insert into t1 values ('I'),('i'); +insert into t1 values ('J'),('j'); +insert into t1 values ('K'),('k'); +insert into t1 values ('L'),('l'); +insert into t1 values ('M'),('m'); +insert into t1 values ('N'),('n'); +insert into t1 values ('O'),('o'); +insert into t1 values ('P'),('p'); +insert into t1 values ('Q'),('q'); +insert into t1 values ('R'),('r'); +insert into t1 values ('S'),('s'); +insert into t1 values ('T'),('t'); +insert into t1 values ('U'),('u'); +insert into t1 values ('V'),('v'); +insert into t1 values ('W'),('w'); +insert into t1 values ('X'),('x'); +insert into t1 values ('Y'),('y'); +insert into t1 values ('Z'),('z'); +insert into t1 values (_ucs2 0x00e0),(_ucs2 0x00c0); +insert into t1 values (_ucs2 0x00e1),(_ucs2 0x00c1); +insert into t1 values (_ucs2 0x00e2),(_ucs2 0x00c2); +insert into t1 values (_ucs2 0x00e3),(_ucs2 0x00c3); +insert into t1 values (_ucs2 0x00e4),(_ucs2 0x00c4); +insert into t1 values (_ucs2 0x00e5),(_ucs2 0x00c5); +insert into t1 values (_ucs2 0x00e6),(_ucs2 0x00c6); +insert into t1 values (_ucs2 0x00e7),(_ucs2 0x00c7); +insert into t1 values (_ucs2 0x00e8),(_ucs2 0x00c8); +insert into t1 values (_ucs2 0x00e9),(_ucs2 0x00c9); +insert into t1 values (_ucs2 0x00ea),(_ucs2 0x00ca); +insert into t1 values (_ucs2 0x00eb),(_ucs2 0x00cb); +insert into t1 values (_ucs2 0x00ec),(_ucs2 0x00cc); +insert into t1 values (_ucs2 0x00ed),(_ucs2 0x00cd); +insert into t1 values (_ucs2 0x00ee),(_ucs2 0x00ce); +insert into t1 values (_ucs2 0x00ef),(_ucs2 0x00cf); +insert into t1 values (_ucs2 0x00f0),(_ucs2 0x00d0); +insert into t1 values (_ucs2 0x00f1),(_ucs2 0x00d1); +insert into t1 values (_ucs2 0x00f2),(_ucs2 0x00d2); +insert into t1 values (_ucs2 0x00f3),(_ucs2 0x00d3); +insert into t1 values (_ucs2 0x00f4),(_ucs2 0x00d4); +insert into t1 values (_ucs2 0x00f5),(_ucs2 0x00d5); +insert into t1 values (_ucs2 0x00f6),(_ucs2 0x00d6); +insert into t1 values (_ucs2 0x00f7),(_ucs2 0x00d7); +insert into t1 values (_ucs2 0x00f8),(_ucs2 0x00d8); +insert into t1 values (_ucs2 0x00f9),(_ucs2 0x00d9); +insert into t1 values (_ucs2 0x00fa),(_ucs2 0x00da); +insert into t1 values (_ucs2 0x00fb),(_ucs2 0x00db); +insert into t1 values (_ucs2 0x00fc),(_ucs2 0x00dc); +insert into t1 values (_ucs2 0x00fd),(_ucs2 0x00dd); +insert into t1 values (_ucs2 0x00fe),(_ucs2 0x00de); +insert into t1 values (_ucs2 0x00ff),(_ucs2 0x00df); +insert into t1 values (_ucs2 0x0100),(_ucs2 0x0101),(_ucs2 0x0102),(_ucs2 0x0103); +insert into t1 values (_ucs2 0x0104),(_ucs2 0x0105),(_ucs2 0x0106),(_ucs2 0x0107); +insert into t1 values (_ucs2 0x0108),(_ucs2 0x0109),(_ucs2 0x010a),(_ucs2 0x010b); +insert into t1 values (_ucs2 0x010c),(_ucs2 0x010d),(_ucs2 0x010e),(_ucs2 0x010f); +insert into t1 values (_ucs2 0x0110),(_ucs2 0x0111),(_ucs2 0x0112),(_ucs2 0x0113); +insert into t1 values (_ucs2 0x0114),(_ucs2 0x0115),(_ucs2 0x0116),(_ucs2 0x0117); +insert into t1 values (_ucs2 0x0118),(_ucs2 0x0119),(_ucs2 0x011a),(_ucs2 0x011b); +insert into t1 values (_ucs2 0x011c),(_ucs2 0x011d),(_ucs2 0x011e),(_ucs2 0x011f); +insert into t1 values (_ucs2 0x0120),(_ucs2 0x0121),(_ucs2 0x0122),(_ucs2 0x0123); +insert into t1 values (_ucs2 0x0124),(_ucs2 0x0125),(_ucs2 0x0126),(_ucs2 0x0127); +insert into t1 values (_ucs2 0x0128),(_ucs2 0x0129),(_ucs2 0x012a),(_ucs2 0x012b); +insert into t1 values (_ucs2 0x012c),(_ucs2 0x012d),(_ucs2 0x012e),(_ucs2 0x012f); +insert into t1 values (_ucs2 0x0130),(_ucs2 0x0131),(_ucs2 0x0132),(_ucs2 0x0133); +insert into t1 values (_ucs2 0x0134),(_ucs2 0x0135),(_ucs2 0x0136),(_ucs2 0x0137); +insert into t1 values (_ucs2 0x0138),(_ucs2 0x0139),(_ucs2 0x013a),(_ucs2 0x013b); +insert into t1 values (_ucs2 0x013c),(_ucs2 0x013d),(_ucs2 0x013e),(_ucs2 0x013f); +insert into t1 values (_ucs2 0x0140),(_ucs2 0x0141),(_ucs2 0x0142),(_ucs2 0x0143); +insert into t1 values (_ucs2 0x0144),(_ucs2 0x0145),(_ucs2 0x0146),(_ucs2 0x0147); +insert into t1 values (_ucs2 0x0148),(_ucs2 0x0149),(_ucs2 0x014a),(_ucs2 0x014b); +insert into t1 values (_ucs2 0x014c),(_ucs2 0x014d),(_ucs2 0x014e),(_ucs2 0x014f); +insert into t1 values (_ucs2 0x0150),(_ucs2 0x0151),(_ucs2 0x0152),(_ucs2 0x0153); +insert into t1 values (_ucs2 0x0154),(_ucs2 0x0155),(_ucs2 0x0156),(_ucs2 0x0157); +insert into t1 values (_ucs2 0x0158),(_ucs2 0x0159),(_ucs2 0x015a),(_ucs2 0x015b); +insert into t1 values (_ucs2 0x015c),(_ucs2 0x015d),(_ucs2 0x015e),(_ucs2 0x015f); +insert into t1 values (_ucs2 0x0160),(_ucs2 0x0161),(_ucs2 0x0162),(_ucs2 0x0163); +insert into t1 values (_ucs2 0x0164),(_ucs2 0x0165),(_ucs2 0x0166),(_ucs2 0x0167); +insert into t1 values (_ucs2 0x0168),(_ucs2 0x0169),(_ucs2 0x016a),(_ucs2 0x016b); +insert into t1 values (_ucs2 0x016c),(_ucs2 0x016d),(_ucs2 0x016e),(_ucs2 0x016f); +insert into t1 values (_ucs2 0x0170),(_ucs2 0x0171),(_ucs2 0x0172),(_ucs2 0x0173); +insert into t1 values (_ucs2 0x0174),(_ucs2 0x0175),(_ucs2 0x0176),(_ucs2 0x0177); +insert into t1 values (_ucs2 0x0178),(_ucs2 0x0179),(_ucs2 0x017a),(_ucs2 0x017b); +insert into t1 values (_ucs2 0x017c),(_ucs2 0x017d),(_ucs2 0x017e),(_ucs2 0x017f); +insert into t1 values (_ucs2 0x0180),(_ucs2 0x0181),(_ucs2 0x0182),(_ucs2 0x0183); +insert into t1 values (_ucs2 0x0184),(_ucs2 0x0185),(_ucs2 0x0186),(_ucs2 0x0187); +insert into t1 values (_ucs2 0x0188),(_ucs2 0x0189),(_ucs2 0x018a),(_ucs2 0x018b); +insert into t1 values (_ucs2 0x018c),(_ucs2 0x018d),(_ucs2 0x018e),(_ucs2 0x018f); +insert into t1 values (_ucs2 0x0190),(_ucs2 0x0191),(_ucs2 0x0192),(_ucs2 0x0193); +insert into t1 values (_ucs2 0x0194),(_ucs2 0x0195),(_ucs2 0x0196),(_ucs2 0x0197); +insert into t1 values (_ucs2 0x0198),(_ucs2 0x0199),(_ucs2 0x019a),(_ucs2 0x019b); +insert into t1 values (_ucs2 0x019c),(_ucs2 0x019d),(_ucs2 0x019e),(_ucs2 0x019f); +insert into t1 values (_ucs2 0x01a0),(_ucs2 0x01a1),(_ucs2 0x01a2),(_ucs2 0x01a3); +insert into t1 values (_ucs2 0x01a4),(_ucs2 0x01a5),(_ucs2 0x01a6),(_ucs2 0x01a7); +insert into t1 values (_ucs2 0x01a8),(_ucs2 0x01a9),(_ucs2 0x01aa),(_ucs2 0x01ab); +insert into t1 values (_ucs2 0x01ac),(_ucs2 0x01ad),(_ucs2 0x01ae),(_ucs2 0x01af); +insert into t1 values (_ucs2 0x01b0),(_ucs2 0x01b1),(_ucs2 0x01b2),(_ucs2 0x01b3); +insert into t1 values (_ucs2 0x01b4),(_ucs2 0x01b5),(_ucs2 0x01b6),(_ucs2 0x01b7); +insert into t1 values (_ucs2 0x01b8),(_ucs2 0x01b9),(_ucs2 0x01ba),(_ucs2 0x01bb); +insert into t1 values (_ucs2 0x01bc),(_ucs2 0x01bd),(_ucs2 0x01be),(_ucs2 0x01bf); +insert into t1 values (_ucs2 0x01c0),(_ucs2 0x01c1),(_ucs2 0x01c2),(_ucs2 0x01c3); +insert into t1 values (_ucs2 0x01c4),(_ucs2 0x01c5),(_ucs2 0x01c6),(_ucs2 0x01c7); +insert into t1 values (_ucs2 0x01c8),(_ucs2 0x01c9),(_ucs2 0x01ca),(_ucs2 0x01cb); +insert into t1 values (_ucs2 0x01cc),(_ucs2 0x01cd),(_ucs2 0x01ce),(_ucs2 0x01cf); +insert into t1 values (_ucs2 0x01d0),(_ucs2 0x01d1),(_ucs2 0x01d2),(_ucs2 0x01d3); +insert into t1 values (_ucs2 0x01d4),(_ucs2 0x01d5),(_ucs2 0x01d6),(_ucs2 0x01d7); +insert into t1 values (_ucs2 0x01d8),(_ucs2 0x01d9),(_ucs2 0x01da),(_ucs2 0x01db); +insert into t1 values (_ucs2 0x01dc),(_ucs2 0x01dd),(_ucs2 0x01de),(_ucs2 0x01df); +insert into t1 values (_ucs2 0x01e0),(_ucs2 0x01e1),(_ucs2 0x01e2),(_ucs2 0x01e3); +insert into t1 values (_ucs2 0x01e4),(_ucs2 0x01e5),(_ucs2 0x01e6),(_ucs2 0x01e7); +insert into t1 values (_ucs2 0x01e8),(_ucs2 0x01e9),(_ucs2 0x01ea),(_ucs2 0x01eb); +insert into t1 values (_ucs2 0x01ec),(_ucs2 0x01ed),(_ucs2 0x01ee),(_ucs2 0x01ef); +insert into t1 values (_ucs2 0x01f0),(_ucs2 0x01f1),(_ucs2 0x01f2),(_ucs2 0x01f3); +insert into t1 values (_ucs2 0x01f4),(_ucs2 0x01f5),(_ucs2 0x01f6),(_ucs2 0x01f7); +insert into t1 values (_ucs2 0x01f8),(_ucs2 0x01f9),(_ucs2 0x01fa),(_ucs2 0x01fb); +insert into t1 values (_ucs2 0x01fc),(_ucs2 0x01fd),(_ucs2 0x01fe),(_ucs2 0x01ff); +insert into t1 values ('AA'),('Aa'),('aa'),('aA'); +insert into t1 values ('CH'),('Ch'),('ch'),('cH'); +insert into t1 values ('DZ'),('Dz'),('dz'),('dZ'); +insert into t1 values ('IJ'),('Ij'),('ij'),('iJ'); +insert into t1 values ('LJ'),('Lj'),('lj'),('lJ'); +insert into t1 values ('LL'),('Ll'),('ll'),('lL'); +insert into t1 values ('NJ'),('Nj'),('nj'),('nJ'); +insert into t1 values ('OE'),('Oe'),('oe'),('oE'); +insert into t1 values ('SS'),('Ss'),('ss'),('sS'); +insert into t1 values ('RR'),('Rr'),('rr'),('rR'); +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_unicode_ci; +group_concat(c1 order by c1) +÷ +× +A,a,À,Ã,Â,Ã,Ä,Ã…,à,á,â,ã,ä,Ã¥,Ä€,Ä,Ä‚,ă,Ä„,Ä…,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç» +AA,Aa,aA,aa +Æ,æ,Ç¢,Ç£,Ǽ,ǽ +B,b +Æ€ +Æ +Æ‚,ƃ +C,c,Ç,ç,Ć,ć,Ĉ,ĉ,ÄŠ,Ä‹,ÄŒ,Ä +CH,Ch,cH,ch +Ƈ,ƈ +D,d,ÄŽ,Ä +DZ,Dz,dZ,dz,Ç„,Ç…,dž,DZ,Dz,dz +Ä,Ä‘ +Ɖ +ÆŠ +Æ‹,ÆŒ +Ã,ð +E,e,È,É,Ê,Ë,è,é,ê,ë,Ä’,Ä“,Ä”,Ä•,Ä–,Ä—,Ę,Ä™,Äš,Ä› +ÆŽ,Ç +Æ +Æ +F,f +Æ‘,Æ’ +G,g,Äœ,Ä,Äž,ÄŸ,Ä ,Ä¡,Ä¢,Ä£,Ǧ,ǧ,Ç´,ǵ +Ǥ,Ç¥ +Æ“ +Æ” +Æ¢,Æ£ +H,h,Ĥ,Ä¥ +Æ•,Ƕ +Ħ,ħ +I,i,ÃŒ,Ã,ÃŽ,Ã,ì,í,î,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä­,Ä®,į,İ,Ç,Ç +IJ,Ij,iJ,ij,IJ,ij +ı +Æ— +Æ– +J,j,Ä´,ĵ,ǰ +K,k,Ķ,Ä·,Ǩ,Ç© +Ƙ,Æ™ +L,l,Ĺ,ĺ,Ä»,ļ,Ľ,ľ +Ä¿,Å€ +LJ,Lj,lJ,lj,LJ,Lj,lj +LL,Ll,lL,ll +Å,Å‚ +Æš +Æ› +M,m +N,n,Ñ,ñ,Ń,Å„,Å…,ņ,Ň,ň,Ǹ,ǹ +NJ,Nj,nJ,nj,ÇŠ,Ç‹,ÇŒ +Æ +Æž +ÅŠ,Å‹ +O,o,Ã’,Ó,Ô,Õ,Ö,ò,ó,ô,õ,ö,ÅŒ,Å,ÅŽ,Å,Å,Å‘,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç­ +OE,Oe,oE,oe,Å’,Å“ +Ø,ø,Ǿ,Ç¿ +Ɔ +ÆŸ +P,p +Ƥ,Æ¥ +Q,q +ĸ +R,r,Å”,Å•,Å–,Å—,Ř,Å™ +RR,Rr,rR,rr +Ʀ +S,s,Åš,Å›,Åœ,Å,Åž,ÅŸ,Å ,Å¡,Å¿ +SS,Ss,sS,ss,ß +Æ© +ƪ +T,t,Å¢,Å£,Ť,Å¥ +ƾ +Ŧ,ŧ +Æ« +Ƭ,Æ­ +Æ® +U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,Å©,Ū,Å«,Ŭ,Å­,Å®,ů,Ű,ű,Ų,ų,Ư,ư,Ç“,Ç”,Ç•,Ç–,Ç—,ǘ,Ç™,Çš,Ç›,Çœ +Æœ +Ʊ +V,v +Ʋ +W,w,Å´,ŵ +X,x +Y,y,Ã,ý,ÿ,Ŷ,Å·,Ÿ +Ƴ,Æ´ +Z,z,Ź,ź,Å»,ż,Ž,ž +Æ +Ƶ,ƶ +Æ·,Ç®,ǯ +Ƹ,ƹ +ƺ +Þ,þ +Æ¿,Ç· +Æ» +Ƨ,ƨ +Ƽ,ƽ +Æ„,Æ… +ʼn +Ç€ +Ç +Ç‚ +ǃ +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_icelandic_ci; +group_concat(c1 order by c1) +÷ +× +A,a,À,Â,Ã,à,â,ã,Ä€,Ä,Ä‚,ă,Ä„,Ä…,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç» +AA,Aa,aA,aa +Ã,á +Ç¢,Ç£,Ǽ,ǽ +B,b +Æ€ +Æ +Æ‚,ƃ +C,c,Ç,ç,Ć,ć,Ĉ,ĉ,ÄŠ,Ä‹,ÄŒ,Ä +CH,Ch,cH,ch +Ƈ,ƈ +D,d,ÄŽ,Ä +DZ,Dz,dZ,dz,Ç„,Ç…,dž,DZ,Dz,dz +Ã,ð +Ä,Ä‘ +Ɖ +ÆŠ +Æ‹,ÆŒ +E,e,È,Ê,Ë,è,ê,ë,Ä’,Ä“,Ä”,Ä•,Ä–,Ä—,Ę,Ä™,Äš,Ä› +É,é +ÆŽ,Ç +Æ +Æ +F,f +Æ‘,Æ’ +G,g,Äœ,Ä,Äž,ÄŸ,Ä ,Ä¡,Ä¢,Ä£,Ǧ,ǧ,Ç´,ǵ +Ǥ,Ç¥ +Æ“ +Æ” +Æ¢,Æ£ +H,h,Ĥ,Ä¥ +Æ•,Ƕ +Ħ,ħ +I,i,ÃŒ,ÃŽ,Ã,ì,î,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä­,Ä®,į,İ,Ç,Ç +IJ,Ij,iJ,ij,IJ,ij +Ã,í +ı +Æ— +Æ– +J,j,Ä´,ĵ,ǰ +K,k,Ķ,Ä·,Ǩ,Ç© +Ƙ,Æ™ +L,l,Ĺ,ĺ,Ä»,ļ,Ľ,ľ +Ä¿,Å€ +LJ,Lj,lJ,lj,LJ,Lj,lj +LL,Ll,lL,ll +Å,Å‚ +Æš +Æ› +M,m +N,n,Ñ,ñ,Ń,Å„,Å…,ņ,Ň,ň,Ǹ,ǹ +NJ,Nj,nJ,nj,ÇŠ,Ç‹,ÇŒ +Æ +Æž +ÅŠ,Å‹ +O,o,Ã’,Ô,Õ,ò,ô,õ,ÅŒ,Å,ÅŽ,Å,Å,Å‘,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç­ +OE,Oe,oE,oe,Å’,Å“ +Ó,ó +Ǿ,Ç¿ +Ɔ +ÆŸ +P,p +Ƥ,Æ¥ +Q,q +ĸ +R,r,Å”,Å•,Å–,Å—,Ř,Å™ +RR,Rr,rR,rr +Ʀ +S,s,Åš,Å›,Åœ,Å,Åž,ÅŸ,Å ,Å¡,Å¿ +SS,Ss,sS,ss,ß +Æ© +ƪ +T,t,Å¢,Å£,Ť,Å¥ +ƾ +Ŧ,ŧ +Æ« +Ƭ,Æ­ +Æ® +U,u,Ù,Û,Ü,ù,û,ü,Ũ,Å©,Ū,Å«,Ŭ,Å­,Å®,ů,Ű,ű,Ų,ų,Ư,ư,Ç“,Ç”,Ç•,Ç–,Ç—,ǘ,Ç™,Çš,Ç›,Çœ +Ú,ú +Æœ +Ʊ +V,v +Ʋ +W,w,Å´,ŵ +X,x +Y,y,ÿ,Ŷ,Å·,Ÿ +Ã,ý +Ƴ,Æ´ +Z,z,Ź,ź,Å»,ż,Ž,ž +Æ +Þ,þ +Ä,Æ,ä,æ +Ö,Ø,ö,ø +Ã…,Ã¥ +Ƶ,ƶ +Æ·,Ç®,ǯ +Ƹ,ƹ +ƺ +Æ¿,Ç· +Æ» +Ƨ,ƨ +Ƽ,ƽ +Æ„,Æ… +ʼn +Ç€ +Ç +Ç‚ +ǃ +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_latvian_ci; +group_concat(c1 order by c1) +÷ +× +A,a,À,Ã,Â,Ã,Ä,Ã…,à,á,â,ã,ä,Ã¥,Ä€,Ä,Ä‚,ă,Ä„,Ä…,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç» +AA,Aa,aA,aa +Æ,æ,Ç¢,Ç£,Ǽ,ǽ +B,b +Æ€ +Æ +Æ‚,ƃ +C,c,Ç,ç,Ć,ć,Ĉ,ĉ,ÄŠ,Ä‹ +CH,Ch,cH,ch +ÄŒ,Ä +Ƈ,ƈ +D,d,ÄŽ,Ä +DZ,Dz,dZ,dz,Ç„,Ç…,dž,DZ,Dz,dz +Ä,Ä‘ +Ɖ +ÆŠ +Æ‹,ÆŒ +Ã,ð +E,e,È,É,Ê,Ë,è,é,ê,ë,Ä’,Ä“,Ä”,Ä•,Ä–,Ä—,Ę,Ä™,Äš,Ä› +ÆŽ,Ç +Æ +Æ +F,f +Æ‘,Æ’ +G,g,Äœ,Ä,Äž,ÄŸ,Ä ,Ä¡,Ǧ,ǧ,Ç´,ǵ +Ä¢,Ä£ +Ǥ,Ç¥ +Æ“ +Æ” +Æ¢,Æ£ +H,h,Ĥ,Ä¥ +Æ•,Ƕ +Ħ,ħ +I,i,ÃŒ,Ã,ÃŽ,Ã,ì,í,î,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä­,Ä®,į,İ,Ç,Ç +IJ,Ij,iJ,ij,IJ,ij +Y,y +ı +Æ— +Æ– +J,j,Ä´,ĵ,ǰ +K,k,Ǩ,Ç© +Ķ,Ä· +Ƙ,Æ™ +L,l,Ĺ,ĺ,Ľ,ľ +Ä¿,Å€ +LJ,Lj,lJ,lj,LJ,Lj,lj +LL,Ll,lL,ll +Ä»,ļ +Å,Å‚ +Æš +Æ› +M,m +N,n,Ñ,ñ,Ń,Å„,Ň,ň,Ǹ,ǹ +NJ,Nj,nJ,nj,ÇŠ,Ç‹,ÇŒ +Å…,ņ +Æ +Æž +ÅŠ,Å‹ +O,o,Ã’,Ó,Ô,Õ,Ö,ò,ó,ô,õ,ö,ÅŒ,Å,ÅŽ,Å,Å,Å‘,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç­ +OE,Oe,oE,oe,Å’,Å“ +Ø,ø,Ǿ,Ç¿ +Ɔ +ÆŸ +P,p +Ƥ,Æ¥ +Q,q +ĸ +R,r,Å”,Å•,Ř,Å™ +RR,Rr,rR,rr +Å–,Å— +Ʀ +S,s,Åš,Å›,Åœ,Å,Åž,ÅŸ,Å¿ +SS,Ss,sS,ss,ß +Å ,Å¡ +Æ© +ƪ +T,t,Å¢,Å£,Ť,Å¥ +ƾ +Ŧ,ŧ +Æ« +Ƭ,Æ­ +Æ® +U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,Å©,Ū,Å«,Ŭ,Å­,Å®,ů,Ű,ű,Ų,ų,Ư,ư,Ç“,Ç”,Ç•,Ç–,Ç—,ǘ,Ç™,Çš,Ç›,Çœ +Æœ +Ʊ +V,v +Ʋ +W,w,Å´,ŵ +X,x +Ã,ý,ÿ,Ŷ,Å·,Ÿ +Ƴ,Æ´ +Z,z,Ź,ź,Å»,ż +Æ +Ž,ž +Ƶ,ƶ +Æ·,Ç®,ǯ +Ƹ,ƹ +ƺ +Þ,þ +Æ¿,Ç· +Æ» +Ƨ,ƨ +Ƽ,ƽ +Æ„,Æ… +ʼn +Ç€ +Ç +Ç‚ +ǃ +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_romanian_ci; +group_concat(c1 order by c1) +÷ +× +A,a,À,Ã,Ã,Ä,Ã…,à,á,ã,ä,Ã¥,Ä€,Ä,Ä„,Ä…,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç» +AA,Aa,aA,aa +Ä‚,ă +Â,â +Æ,æ,Ç¢,Ç£,Ǽ,ǽ +B,b +Æ€ +Æ +Æ‚,ƃ +C,c,Ç,ç,Ć,ć,Ĉ,ĉ,ÄŠ,Ä‹,ÄŒ,Ä +CH,Ch,cH,ch +Ƈ,ƈ +D,d,ÄŽ,Ä +DZ,Dz,dZ,dz,Ç„,Ç…,dž,DZ,Dz,dz +Ä,Ä‘ +Ɖ +ÆŠ +Æ‹,ÆŒ +Ã,ð +E,e,È,É,Ê,Ë,è,é,ê,ë,Ä’,Ä“,Ä”,Ä•,Ä–,Ä—,Ę,Ä™,Äš,Ä› +ÆŽ,Ç +Æ +Æ +F,f +Æ‘,Æ’ +G,g,Äœ,Ä,Äž,ÄŸ,Ä ,Ä¡,Ä¢,Ä£,Ǧ,ǧ,Ç´,ǵ +Ǥ,Ç¥ +Æ“ +Æ” +Æ¢,Æ£ +H,h,Ĥ,Ä¥ +Æ•,Ƕ +Ħ,ħ +I,i,ÃŒ,Ã,Ã,ì,í,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä­,Ä®,į,İ,Ç,Ç +IJ,Ij,iJ,ij,IJ,ij +ÃŽ,î +ı +Æ— +Æ– +J,j,Ä´,ĵ,ǰ +K,k,Ķ,Ä·,Ǩ,Ç© +Ƙ,Æ™ +L,l,Ĺ,ĺ,Ä»,ļ,Ľ,ľ +Ä¿,Å€ +LJ,Lj,lJ,lj,LJ,Lj,lj +LL,Ll,lL,ll +Å,Å‚ +Æš +Æ› +M,m +N,n,Ñ,ñ,Ń,Å„,Å…,ņ,Ň,ň,Ǹ,ǹ +NJ,Nj,nJ,nj,ÇŠ,Ç‹,ÇŒ +Æ +Æž +ÅŠ,Å‹ +O,o,Ã’,Ó,Ô,Õ,Ö,ò,ó,ô,õ,ö,ÅŒ,Å,ÅŽ,Å,Å,Å‘,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç­ +OE,Oe,oE,oe,Å’,Å“ +Ø,ø,Ǿ,Ç¿ +Ɔ +ÆŸ +P,p +Ƥ,Æ¥ +Q,q +ĸ +R,r,Å”,Å•,Å–,Å—,Ř,Å™ +RR,Rr,rR,rr +Ʀ +S,s,Åš,Å›,Åœ,Å,Å ,Å¡,Å¿ +SS,Ss,sS,ss,ß +Åž,ÅŸ +Æ© +ƪ +T,t,Ť,Å¥ +ƾ +Å¢,Å£ +Ŧ,ŧ +Æ« +Ƭ,Æ­ +Æ® +U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,Å©,Ū,Å«,Ŭ,Å­,Å®,ů,Ű,ű,Ų,ų,Ư,ư,Ç“,Ç”,Ç•,Ç–,Ç—,ǘ,Ç™,Çš,Ç›,Çœ +Æœ +Ʊ +V,v +Ʋ +W,w,Å´,ŵ +X,x +Y,y,Ã,ý,ÿ,Ŷ,Å·,Ÿ +Ƴ,Æ´ +Z,z,Ź,ź,Å»,ż,Ž,ž +Æ +Ƶ,ƶ +Æ·,Ç®,ǯ +Ƹ,ƹ +ƺ +Þ,þ +Æ¿,Ç· +Æ» +Ƨ,ƨ +Ƽ,ƽ +Æ„,Æ… +ʼn +Ç€ +Ç +Ç‚ +ǃ +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_slovenian_ci; +group_concat(c1 order by c1) +÷ +× +A,a,À,Ã,Â,Ã,Ä,Ã…,à,á,â,ã,ä,Ã¥,Ä€,Ä,Ä‚,ă,Ä„,Ä…,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç» +AA,Aa,aA,aa +Æ,æ,Ç¢,Ç£,Ǽ,ǽ +B,b +Æ€ +Æ +Æ‚,ƃ +C,c,Ç,ç,Ć,ć,Ĉ,ĉ,ÄŠ,Ä‹ +CH,Ch,cH,ch +ÄŒ,Ä +Ƈ,ƈ +D,d,ÄŽ,Ä +DZ,Dz,dZ,dz,Ç„,Ç…,dž,DZ,Dz,dz +Ä,Ä‘ +Ɖ +ÆŠ +Æ‹,ÆŒ +Ã,ð +E,e,È,É,Ê,Ë,è,é,ê,ë,Ä’,Ä“,Ä”,Ä•,Ä–,Ä—,Ę,Ä™,Äš,Ä› +ÆŽ,Ç +Æ +Æ +F,f +Æ‘,Æ’ +G,g,Äœ,Ä,Äž,ÄŸ,Ä ,Ä¡,Ä¢,Ä£,Ǧ,ǧ,Ç´,ǵ +Ǥ,Ç¥ +Æ“ +Æ” +Æ¢,Æ£ +H,h,Ĥ,Ä¥ +Æ•,Ƕ +Ħ,ħ +I,i,ÃŒ,Ã,ÃŽ,Ã,ì,í,î,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä­,Ä®,į,İ,Ç,Ç +IJ,Ij,iJ,ij,IJ,ij +ı +Æ— +Æ– +J,j,Ä´,ĵ,ǰ +K,k,Ķ,Ä·,Ǩ,Ç© +Ƙ,Æ™ +L,l,Ĺ,ĺ,Ä»,ļ,Ľ,ľ +Ä¿,Å€ +LJ,Lj,lJ,lj,LJ,Lj,lj +LL,Ll,lL,ll +Å,Å‚ +Æš +Æ› +M,m +N,n,Ñ,ñ,Ń,Å„,Å…,ņ,Ň,ň,Ǹ,ǹ +NJ,Nj,nJ,nj,ÇŠ,Ç‹,ÇŒ +Æ +Æž +ÅŠ,Å‹ +O,o,Ã’,Ó,Ô,Õ,Ö,ò,ó,ô,õ,ö,ÅŒ,Å,ÅŽ,Å,Å,Å‘,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç­ +OE,Oe,oE,oe,Å’,Å“ +Ø,ø,Ǿ,Ç¿ +Ɔ +ÆŸ +P,p +Ƥ,Æ¥ +Q,q +ĸ +R,r,Å”,Å•,Å–,Å—,Ř,Å™ +RR,Rr,rR,rr +Ʀ +S,s,Åš,Å›,Åœ,Å,Åž,ÅŸ,Å¿ +SS,Ss,sS,ss,ß +Å ,Å¡ +Æ© +ƪ +T,t,Å¢,Å£,Ť,Å¥ +ƾ +Ŧ,ŧ +Æ« +Ƭ,Æ­ +Æ® +U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,Å©,Ū,Å«,Ŭ,Å­,Å®,ů,Ű,ű,Ų,ų,Ư,ư,Ç“,Ç”,Ç•,Ç–,Ç—,ǘ,Ç™,Çš,Ç›,Çœ +Æœ +Ʊ +V,v +Ʋ +W,w,Å´,ŵ +X,x +Y,y,Ã,ý,ÿ,Ŷ,Å·,Ÿ +Ƴ,Æ´ +Z,z,Ź,ź,Å»,ż +Æ +Ž,ž +Ƶ,ƶ +Æ·,Ç®,ǯ +Ƹ,ƹ +ƺ +Þ,þ +Æ¿,Ç· +Æ» +Ƨ,ƨ +Ƽ,ƽ +Æ„,Æ… +ʼn +Ç€ +Ç +Ç‚ +ǃ +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_polish_ci; +group_concat(c1 order by c1) +÷ +× +A,a,À,Ã,Â,Ã,Ä,Ã…,à,á,â,ã,ä,Ã¥,Ä€,Ä,Ä‚,ă,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç» +AA,Aa,aA,aa +Ä„,Ä… +Æ,æ,Ç¢,Ç£,Ǽ,ǽ +B,b +Æ€ +Æ +Æ‚,ƃ +C,c,Ç,ç,Ĉ,ĉ,ÄŠ,Ä‹,ÄŒ,Ä +CH,Ch,cH,ch +Ć,ć +Ƈ,ƈ +D,d,ÄŽ,Ä +DZ,Dz,dZ,dz,Ç„,Ç…,dž,DZ,Dz,dz +Ä,Ä‘ +Ɖ +ÆŠ +Æ‹,ÆŒ +Ã,ð +E,e,È,É,Ê,Ë,è,é,ê,ë,Ä’,Ä“,Ä”,Ä•,Ä–,Ä—,Äš,Ä› +Ę,Ä™ +ÆŽ,Ç +Æ +Æ +F,f +Æ‘,Æ’ +G,g,Äœ,Ä,Äž,ÄŸ,Ä ,Ä¡,Ä¢,Ä£,Ǧ,ǧ,Ç´,ǵ +Ǥ,Ç¥ +Æ“ +Æ” +Æ¢,Æ£ +H,h,Ĥ,Ä¥ +Æ•,Ƕ +Ħ,ħ +I,i,ÃŒ,Ã,ÃŽ,Ã,ì,í,î,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä­,Ä®,į,İ,Ç,Ç +IJ,Ij,iJ,ij,IJ,ij +ı +Æ— +Æ– +J,j,Ä´,ĵ,ǰ +K,k,Ķ,Ä·,Ǩ,Ç© +Ƙ,Æ™ +L,l,Ĺ,ĺ,Ä»,ļ,Ľ,ľ +Ä¿,Å€ +LJ,Lj,lJ,lj,LJ,Lj,lj +LL,Ll,lL,ll +Å,Å‚ +Æš +Æ› +M,m +N,n,Ñ,ñ,Å…,ņ,Ň,ň,Ǹ,ǹ +NJ,Nj,nJ,nj,ÇŠ,Ç‹,ÇŒ +Ń,Å„ +Æ +Æž +ÅŠ,Å‹ +O,o,Ã’,Ô,Õ,Ö,ò,ô,õ,ö,ÅŒ,Å,ÅŽ,Å,Å,Å‘,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç­ +OE,Oe,oE,oe,Å’,Å“ +Ó,ó +Ø,ø,Ǿ,Ç¿ +Ɔ +ÆŸ +P,p +Ƥ,Æ¥ +Q,q +ĸ +R,r,Å”,Å•,Å–,Å—,Ř,Å™ +RR,Rr,rR,rr +Ʀ +S,s,Åœ,Å,Åž,ÅŸ,Å ,Å¡,Å¿ +SS,Ss,sS,ss,ß +Åš,Å› +Æ© +ƪ +T,t,Å¢,Å£,Ť,Å¥ +ƾ +Ŧ,ŧ +Æ« +Ƭ,Æ­ +Æ® +U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,Å©,Ū,Å«,Ŭ,Å­,Å®,ů,Ű,ű,Ų,ų,Ư,ư,Ç“,Ç”,Ç•,Ç–,Ç—,ǘ,Ç™,Çš,Ç›,Çœ +Æœ +Ʊ +V,v +Ʋ +W,w,Å´,ŵ +X,x +Y,y,Ã,ý,ÿ,Ŷ,Å·,Ÿ +Ƴ,Æ´ +Z,z,Ž,ž +Æ +Ź,ź +Å»,ż +Ƶ,ƶ +Æ·,Ç®,ǯ +Ƹ,ƹ +ƺ +Þ,þ +Æ¿,Ç· +Æ» +Ƨ,ƨ +Ƽ,ƽ +Æ„,Æ… +ʼn +Ç€ +Ç +Ç‚ +ǃ +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_estonian_ci; +group_concat(c1 order by c1) +÷ +× +A,a,À,Ã,Â,Ã,Ã…,à,á,â,ã,Ã¥,Ä€,Ä,Ä‚,ă,Ä„,Ä…,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç» +AA,Aa,aA,aa +Æ,æ,Ç¢,Ç£,Ǽ,ǽ +B,b +Æ€ +Æ +Æ‚,ƃ +C,c,Ç,ç,Ć,ć,Ĉ,ĉ,ÄŠ,Ä‹,ÄŒ,Ä +CH,Ch,cH,ch +Ƈ,ƈ +D,d,ÄŽ,Ä +DZ,Dz,dZ,dz +Ç„,Ç…,dž,DZ,Dz,dz +Ä,Ä‘ +Ɖ +ÆŠ +Æ‹,ÆŒ +Ã,ð +E,e,È,É,Ê,Ë,è,é,ê,ë,Ä’,Ä“,Ä”,Ä•,Ä–,Ä—,Ę,Ä™,Äš,Ä› +ÆŽ,Ç +Æ +Æ +F,f +Æ‘,Æ’ +G,g,Äœ,Ä,Äž,ÄŸ,Ä ,Ä¡,Ä¢,Ä£,Ǧ,ǧ,Ç´,ǵ +Ǥ,Ç¥ +Æ“ +Æ” +Æ¢,Æ£ +H,h,Ĥ,Ä¥ +Æ•,Ƕ +Ħ,ħ +I,i,ÃŒ,Ã,ÃŽ,Ã,ì,í,î,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä­,Ä®,į,İ,Ç,Ç +IJ,Ij,iJ,ij,IJ,ij +ı +Æ— +Æ– +J,j,Ä´,ĵ,ǰ +K,k,Ķ,Ä·,Ǩ,Ç© +Ƙ,Æ™ +L,l,Ĺ,ĺ,Ä»,ļ,Ľ,ľ +Ä¿,Å€ +LJ,Lj,lJ,lj,LJ,Lj,lj +LL,Ll,lL,ll +Å,Å‚ +Æš +Æ› +M,m +N,n,Ñ,ñ,Ń,Å„,Å…,ņ,Ň,ň,Ǹ,ǹ +NJ,Nj,nJ,nj,ÇŠ,Ç‹,ÇŒ +Æ +Æž +ÅŠ,Å‹ +O,o,Ã’,Ó,Ô,ò,ó,ô,ÅŒ,Å,ÅŽ,Å,Å,Å‘,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç­ +OE,Oe,oE,oe,Å’,Å“ +Ø,ø,Ǿ,Ç¿ +Ɔ +ÆŸ +P,p +Ƥ,Æ¥ +Q,q +ĸ +R,r,Å”,Å•,Å–,Å—,Ř,Å™ +RR,Rr,rR,rr +Ʀ +S,s,Åš,Å›,Åœ,Å,Åž,ÅŸ,Å¿ +SS,Ss,sS,ss,ß +Å ,Å¡ +Z,z +Ž,ž +Æ© +ƪ +T,t,Å¢,Å£,Ť,Å¥ +ƾ +Ŧ,ŧ +Æ« +Ƭ,Æ­ +Æ® +U,u,Ù,Ú,Û,ù,ú,û,Ũ,Å©,Ū,Å«,Ŭ,Å­,Å®,ů,Ű,ű,Ų,ų,Ư,ư,Ç“,Ç”,Ç•,Ç–,Ç—,ǘ,Ç™,Çš,Ç›,Çœ +Æœ +Ʊ +V,v +Ʋ +W,w,Å´,ŵ +Õ,õ +Ä,ä +Ö,ö +Ü,ü +X,x +Y,y,Ã,ý,ÿ,Ŷ,Å·,Ÿ +Ƴ,Æ´ +Ź,ź,Å»,ż +Æ +Ƶ,ƶ +Æ·,Ç®,ǯ +Ƹ,ƹ +ƺ +Þ,þ +Æ¿,Ç· +Æ» +Ƨ,ƨ +Ƽ,ƽ +Æ„,Æ… +ʼn +Ç€ +Ç +Ç‚ +ǃ +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_spanish_ci; +group_concat(c1 order by c1) +÷ +× +A,a,À,Ã,Â,Ã,Ä,Ã…,à,á,â,ã,ä,Ã¥,Ä€,Ä,Ä‚,ă,Ä„,Ä…,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç» +AA,Aa,aA,aa +Æ,æ,Ç¢,Ç£,Ǽ,ǽ +B,b +Æ€ +Æ +Æ‚,ƃ +C,c,Ç,ç,Ć,ć,Ĉ,ĉ,ÄŠ,Ä‹,ÄŒ,Ä +CH,Ch,cH,ch +Ƈ,ƈ +D,d,ÄŽ,Ä +DZ,Dz,dZ,dz,Ç„,Ç…,dž,DZ,Dz,dz +Ä,Ä‘ +Ɖ +ÆŠ +Æ‹,ÆŒ +Ã,ð +E,e,È,É,Ê,Ë,è,é,ê,ë,Ä’,Ä“,Ä”,Ä•,Ä–,Ä—,Ę,Ä™,Äš,Ä› +ÆŽ,Ç +Æ +Æ +F,f +Æ‘,Æ’ +G,g,Äœ,Ä,Äž,ÄŸ,Ä ,Ä¡,Ä¢,Ä£,Ǧ,ǧ,Ç´,ǵ +Ǥ,Ç¥ +Æ“ +Æ” +Æ¢,Æ£ +H,h,Ĥ,Ä¥ +Æ•,Ƕ +Ħ,ħ +I,i,ÃŒ,Ã,ÃŽ,Ã,ì,í,î,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä­,Ä®,į,İ,Ç,Ç +IJ,Ij,iJ,ij,IJ,ij +ı +Æ— +Æ– +J,j,Ä´,ĵ,ǰ +K,k,Ķ,Ä·,Ǩ,Ç© +Ƙ,Æ™ +L,l,Ĺ,ĺ,Ä»,ļ,Ľ,ľ +Ä¿,Å€ +LJ,Lj,lJ,lj,LJ,Lj,lj +LL,Ll,lL,ll +Å,Å‚ +Æš +Æ› +M,m +N,n,Ń,Å„,Å…,ņ,Ň,ň,Ǹ,ǹ +NJ,Nj,nJ,nj,ÇŠ,Ç‹,ÇŒ +Ñ,ñ +Æ +Æž +ÅŠ,Å‹ +O,o,Ã’,Ó,Ô,Õ,Ö,ò,ó,ô,õ,ö,ÅŒ,Å,ÅŽ,Å,Å,Å‘,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç­ +OE,Oe,oE,oe,Å’,Å“ +Ø,ø,Ǿ,Ç¿ +Ɔ +ÆŸ +P,p +Ƥ,Æ¥ +Q,q +ĸ +R,r,Å”,Å•,Å–,Å—,Ř,Å™ +RR,Rr,rR,rr +Ʀ +S,s,Åš,Å›,Åœ,Å,Åž,ÅŸ,Å ,Å¡,Å¿ +SS,Ss,sS,ss,ß +Æ© +ƪ +T,t,Å¢,Å£,Ť,Å¥ +ƾ +Ŧ,ŧ +Æ« +Ƭ,Æ­ +Æ® +U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,Å©,Ū,Å«,Ŭ,Å­,Å®,ů,Ű,ű,Ų,ų,Ư,ư,Ç“,Ç”,Ç•,Ç–,Ç—,ǘ,Ç™,Çš,Ç›,Çœ +Æœ +Ʊ +V,v +Ʋ +W,w,Å´,ŵ +X,x +Y,y,Ã,ý,ÿ,Ŷ,Å·,Ÿ +Ƴ,Æ´ +Z,z,Ź,ź,Å»,ż,Ž,ž +Æ +Ƶ,ƶ +Æ·,Ç®,ǯ +Ƹ,ƹ +ƺ +Þ,þ +Æ¿,Ç· +Æ» +Ƨ,ƨ +Ƽ,ƽ +Æ„,Æ… +ʼn +Ç€ +Ç +Ç‚ +ǃ +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_swedish_ci; +group_concat(c1 order by c1) +÷ +× +A,a,À,Ã,Â,Ã,à,á,â,ã,Ä€,Ä,Ä‚,ă,Ä„,Ä…,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç» +AA,Aa,aA,aa +Ç¢,Ç£,Ǽ,ǽ +B,b +Æ€ +Æ +Æ‚,ƃ +C,c,Ç,ç,Ć,ć,Ĉ,ĉ,ÄŠ,Ä‹,ÄŒ,Ä +CH,Ch,cH,ch +Ƈ,ƈ +D,d,ÄŽ,Ä +DZ,Dz,dZ,dz,Ç„,Ç…,dž,DZ,Dz,dz +Ä,Ä‘ +Ɖ +ÆŠ +Æ‹,ÆŒ +Ã,ð +E,e,È,É,Ê,Ë,è,é,ê,ë,Ä’,Ä“,Ä”,Ä•,Ä–,Ä—,Ę,Ä™,Äš,Ä› +ÆŽ,Ç +Æ +Æ +F,f +Æ‘,Æ’ +G,g,Äœ,Ä,Äž,ÄŸ,Ä ,Ä¡,Ä¢,Ä£,Ǧ,ǧ,Ç´,ǵ +Ǥ,Ç¥ +Æ“ +Æ” +Æ¢,Æ£ +H,h,Ĥ,Ä¥ +Æ•,Ƕ +Ħ,ħ +I,i,ÃŒ,Ã,ÃŽ,Ã,ì,í,î,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä­,Ä®,į,İ,Ç,Ç +IJ,Ij,iJ,ij,IJ,ij +ı +Æ— +Æ– +J,j,Ä´,ĵ,ǰ +K,k,Ķ,Ä·,Ǩ,Ç© +Ƙ,Æ™ +L,l,Ĺ,ĺ,Ä»,ļ,Ľ,ľ +Ä¿,Å€ +LJ,Lj,lJ,lj,LJ,Lj,lj +LL,Ll,lL,ll +Å,Å‚ +Æš +Æ› +M,m +N,n,Ñ,ñ,Ń,Å„,Å…,ņ,Ň,ň,Ǹ,ǹ +NJ,Nj,nJ,nj,ÇŠ,Ç‹,ÇŒ +Æ +Æž +ÅŠ,Å‹ +O,o,Ã’,Ó,Ô,Õ,ò,ó,ô,õ,ÅŒ,Å,ÅŽ,Å,Å,Å‘,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç­ +OE,Oe,oE,oe,Å’,Å“ +Ǿ,Ç¿ +Ɔ +ÆŸ +P,p +Ƥ,Æ¥ +Q,q +ĸ +R,r,Å”,Å•,Å–,Å—,Ř,Å™ +RR,Rr,rR,rr +Ʀ +S,s,Åš,Å›,Åœ,Å,Åž,ÅŸ,Å ,Å¡,Å¿ +SS,Ss,sS,ss,ß +Æ© +ƪ +T,t,Å¢,Å£,Ť,Å¥ +ƾ +Ŧ,ŧ +Æ« +Ƭ,Æ­ +Æ® +U,u,Ù,Ú,Û,ù,ú,û,Ũ,Å©,Ū,Å«,Ŭ,Å­,Å®,ů,Ű,ű,Ų,ų,Ư,ư,Ç“,Ç”,Ç•,Ç–,Ç—,ǘ,Ç™,Çš,Ç›,Çœ +Æœ +Ʊ +V,v +Ʋ +W,w,Å´,ŵ +X,x +Y,y,Ü,Ã,ü,ý,ÿ,Ŷ,Å·,Ÿ +Ƴ,Æ´ +Z,z,Ź,ź,Å»,ż,Ž,ž +Æ +Ã…,Ã¥ +Ä,Æ,ä,æ +Ö,Ø,ö,ø +Ƶ,ƶ +Æ·,Ç®,ǯ +Ƹ,ƹ +ƺ +Þ,þ +Æ¿,Ç· +Æ» +Ƨ,ƨ +Ƽ,ƽ +Æ„,Æ… +ʼn +Ç€ +Ç +Ç‚ +ǃ +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_turkish_ci; +group_concat(c1 order by c1) +÷ +× +A,a,À,Ã,Â,Ã,Ä,Ã…,à,á,â,ã,ä,Ã¥,Ä€,Ä,Ä‚,ă,Ä„,Ä…,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç» +AA,Aa,aA,aa +Æ,æ,Ç¢,Ç£,Ǽ,ǽ +B,b +Æ€ +Æ +Æ‚,ƃ +C,c,Ć,ć,Ĉ,ĉ,ÄŠ,Ä‹,ÄŒ,Ä +CH,Ch,cH,ch +Ç,ç +Ƈ,ƈ +D,d,ÄŽ,Ä +DZ,Dz,dZ,dz,Ç„,Ç…,dž,DZ,Dz,dz +Ä,Ä‘ +Ɖ +ÆŠ +Æ‹,ÆŒ +Ã,ð +E,e,È,É,Ê,Ë,è,é,ê,ë,Ä’,Ä“,Ä”,Ä•,Ä–,Ä—,Ę,Ä™,Äš,Ä› +ÆŽ,Ç +Æ +Æ +F,f +Æ‘,Æ’ +G,g,Äœ,Ä,Ä ,Ä¡,Ä¢,Ä£,Ǧ,ǧ,Ç´,ǵ +Äž,ÄŸ +Ǥ,Ç¥ +Æ“ +Æ” +Æ¢,Æ£ +H,h,Ĥ,Ä¥ +I,ı +IJ,Ij +Æ•,Ƕ +Ħ,ħ +i,ÃŒ,Ã,ÃŽ,Ã,ì,í,î,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä­,Ä®,į,İ,Ç,Ç +iJ,ij,IJ,ij +Æ— +Æ– +J,j,Ä´,ĵ,ǰ +K,k,Ķ,Ä·,Ǩ,Ç© +Ƙ,Æ™ +L,l,Ĺ,ĺ,Ä»,ļ,Ľ,ľ +Ä¿,Å€ +LJ,Lj,lJ,lj,LJ,Lj,lj +LL,Ll,lL,ll +Å,Å‚ +Æš +Æ› +M,m +N,n,Ñ,ñ,Ń,Å„,Å…,ņ,Ň,ň,Ǹ,ǹ +NJ,Nj,nJ,nj,ÇŠ,Ç‹,ÇŒ +Æ +Æž +ÅŠ,Å‹ +O,o,Ã’,Ó,Ô,Õ,ò,ó,ô,õ,ÅŒ,Å,ÅŽ,Å,Å,Å‘,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç­ +OE,Oe,oE,oe,Å’,Å“ +Ö,ö +Ø,ø,Ǿ,Ç¿ +Ɔ +ÆŸ +P,p +Ƥ,Æ¥ +Q,q +ĸ +R,r,Å”,Å•,Å–,Å—,Ř,Å™ +RR,Rr,rR,rr +Ʀ +S,s,Åš,Å›,Åœ,Å,Å ,Å¡,Å¿ +SS,Ss,sS,ss,ß +Åž,ÅŸ +Æ© +ƪ +T,t,Å¢,Å£,Ť,Å¥ +ƾ +Ŧ,ŧ +Æ« +Ƭ,Æ­ +Æ® +U,u,Ù,Ú,Û,ù,ú,û,Ũ,Å©,Ū,Å«,Ŭ,Å­,Å®,ů,Ű,ű,Ų,ų,Ư,ư,Ç“,Ç”,Ç•,Ç–,Ç—,ǘ,Ç™,Çš,Ç›,Çœ +Ü,ü +Æœ +Ʊ +V,v +Ʋ +W,w,Å´,ŵ +X,x +Y,y,Ã,ý,ÿ,Ŷ,Å·,Ÿ +Ƴ,Æ´ +Z,z,Ź,ź,Å»,ż,Ž,ž +Æ +Ƶ,ƶ +Æ·,Ç®,ǯ +Ƹ,ƹ +ƺ +Þ,þ +Æ¿,Ç· +Æ» +Ƨ,ƨ +Ƽ,ƽ +Æ„,Æ… +ʼn +Ç€ +Ç +Ç‚ +ǃ +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_czech_ci; +group_concat(c1 order by c1) +÷ +× +A,a,À,Ã,Â,Ã,Ä,Ã…,à,á,â,ã,ä,Ã¥,Ä€,Ä,Ä‚,ă,Ä„,Ä…,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç» +AA,Aa,aA,aa +Æ,æ,Ç¢,Ç£,Ǽ,ǽ +B,b +Æ€ +Æ +Æ‚,ƃ +C,c,Ç,ç,Ć,ć,Ĉ,ĉ,ÄŠ,Ä‹ +cH +ÄŒ,Ä +Ƈ,ƈ +D,d,ÄŽ,Ä +DZ,Dz,dZ,dz,Ç„,Ç…,dž,DZ,Dz,dz +Ä,Ä‘ +Ɖ +ÆŠ +Æ‹,ÆŒ +Ã,ð +E,e,È,É,Ê,Ë,è,é,ê,ë,Ä’,Ä“,Ä”,Ä•,Ä–,Ä—,Ę,Ä™,Äš,Ä› +ÆŽ,Ç +Æ +Æ +F,f +Æ‘,Æ’ +G,g,Äœ,Ä,Äž,ÄŸ,Ä ,Ä¡,Ä¢,Ä£,Ǧ,ǧ,Ç´,ǵ +Ǥ,Ç¥ +Æ“ +Æ” +Æ¢,Æ£ +H,h,Ĥ,Ä¥ +CH,Ch,ch +Æ•,Ƕ +Ħ,ħ +I,i,ÃŒ,Ã,ÃŽ,Ã,ì,í,î,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä­,Ä®,į,İ,Ç,Ç +IJ,Ij,iJ,ij,IJ,ij +ı +Æ— +Æ– +J,j,Ä´,ĵ,ǰ +K,k,Ķ,Ä·,Ǩ,Ç© +Ƙ,Æ™ +L,l,Ĺ,ĺ,Ä»,ļ,Ľ,ľ +Ä¿,Å€ +LJ,Lj,lJ,lj,LJ,Lj,lj +LL,Ll,lL,ll +Å,Å‚ +Æš +Æ› +M,m +N,n,Ñ,ñ,Ń,Å„,Å…,ņ,Ň,ň,Ǹ,ǹ +NJ,Nj,nJ,nj,ÇŠ,Ç‹,ÇŒ +Æ +Æž +ÅŠ,Å‹ +O,o,Ã’,Ó,Ô,Õ,Ö,ò,ó,ô,õ,ö,ÅŒ,Å,ÅŽ,Å,Å,Å‘,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç­ +OE,Oe,oE,oe,Å’,Å“ +Ø,ø,Ǿ,Ç¿ +Ɔ +ÆŸ +P,p +Ƥ,Æ¥ +Q,q +ĸ +R,r,Å”,Å•,Å–,Å— +RR,Rr,rR,rr +Ř,Å™ +Ʀ +S,s,Åš,Å›,Åœ,Å,Åž,ÅŸ,Å¿ +SS,Ss,sS,ss,ß +Å ,Å¡ +Æ© +ƪ +T,t,Å¢,Å£,Ť,Å¥ +ƾ +Ŧ,ŧ +Æ« +Ƭ,Æ­ +Æ® +U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,Å©,Ū,Å«,Ŭ,Å­,Å®,ů,Ű,ű,Ų,ų,Ư,ư,Ç“,Ç”,Ç•,Ç–,Ç—,ǘ,Ç™,Çš,Ç›,Çœ +Æœ +Ʊ +V,v +Ʋ +W,w,Å´,ŵ +X,x +Y,y,Ã,ý,ÿ,Ŷ,Å·,Ÿ +Ƴ,Æ´ +Z,z,Ź,ź,Å»,ż +Æ +Ž,ž +Ƶ,ƶ +Æ·,Ç®,ǯ +Ƹ,ƹ +ƺ +Þ,þ +Æ¿,Ç· +Æ» +Ƨ,ƨ +Ƽ,ƽ +Æ„,Æ… +ʼn +Ç€ +Ç +Ç‚ +ǃ +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_danish_ci; +group_concat(c1 order by c1) +÷ +× +A,a,À,Ã,Â,Ã,à,á,â,ã,Ä€,Ä,Ä‚,ă,Ä„,Ä…,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç» +aA +Ç¢,Ç£,Ǽ,ǽ +B,b +Æ€ +Æ +Æ‚,ƃ +C,c,Ç,ç,Ć,ć,Ĉ,ĉ,ÄŠ,Ä‹,ÄŒ,Ä +CH,Ch,cH,ch +Ƈ,ƈ +D,d,ÄŽ,Ä +DZ,Dz,dZ,dz,Ç„,Ç…,dž,DZ,Dz,dz +Ä,Ä‘ +Ɖ +ÆŠ +Æ‹,ÆŒ +Ã,ð +E,e,È,É,Ê,Ë,è,é,ê,ë,Ä’,Ä“,Ä”,Ä•,Ä–,Ä—,Ę,Ä™,Äš,Ä› +ÆŽ,Ç +Æ +Æ +F,f +Æ‘,Æ’ +G,g,Äœ,Ä,Äž,ÄŸ,Ä ,Ä¡,Ä¢,Ä£,Ǧ,ǧ,Ç´,ǵ +Ǥ,Ç¥ +Æ“ +Æ” +Æ¢,Æ£ +H,h,Ĥ,Ä¥ +Æ•,Ƕ +Ħ,ħ +I,i,ÃŒ,Ã,ÃŽ,Ã,ì,í,î,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä­,Ä®,į,İ,Ç,Ç +IJ,Ij,iJ,ij,IJ,ij +ı +Æ— +Æ– +J,j,Ä´,ĵ,ǰ +K,k,Ķ,Ä·,Ǩ,Ç© +Ƙ,Æ™ +L,l,Ĺ,ĺ,Ä»,ļ,Ľ,ľ +Ä¿,Å€ +LJ,Lj,lJ,lj,LJ,Lj,lj +LL,Ll,lL,ll +Å,Å‚ +Æš +Æ› +M,m +N,n,Ñ,ñ,Ń,Å„,Å…,ņ,Ň,ň,Ǹ,ǹ +NJ,Nj,nJ,nj,ÇŠ,Ç‹,ÇŒ +Æ +Æž +ÅŠ,Å‹ +O,o,Ã’,Ó,Ô,Õ,ò,ó,ô,õ,ÅŒ,Å,ÅŽ,Å,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç­ +OE,Oe,oE,oe,Å’,Å“ +Ǿ,Ç¿ +Ɔ +ÆŸ +P,p +Ƥ,Æ¥ +Q,q +ĸ +R,r,Å”,Å•,Å–,Å—,Ř,Å™ +RR,Rr,rR,rr +Ʀ +S,s,Åš,Å›,Åœ,Å,Åž,ÅŸ,Å ,Å¡,Å¿ +SS,Ss,sS,ss,ß +Æ© +ƪ +T,t,Å¢,Å£,Ť,Å¥ +ƾ +Ŧ,ŧ +Æ« +Ƭ,Æ­ +Æ® +U,u,Ù,Ú,Û,ù,ú,û,Ũ,Å©,Ū,Å«,Ŭ,Å­,Å®,ů,Ų,ų,Ư,ư,Ç“,Ç”,Ç•,Ç–,Ç—,ǘ,Ç™,Çš,Ç›,Çœ +Æœ +Ʊ +V,v +Ʋ +W,w,Å´,ŵ +X,x +Y,y,Ü,Ã,ü,ý,ÿ,Ű,ű,Ŷ,Å·,Ÿ +Ƴ,Æ´ +Z,z,Ź,ź,Å»,ż,Ž,ž +Æ +Ä,Æ,ä,æ +Ö,Ø,ö,ø,Å,Å‘ +AA,Aa,aa,Ã…,Ã¥ +Ƶ,ƶ +Æ·,Ç®,ǯ +Ƹ,ƹ +ƺ +Þ,þ +Æ¿,Ç· +Æ» +Ƨ,ƨ +Ƽ,ƽ +Æ„,Æ… +ʼn +Ç€ +Ç +Ç‚ +ǃ +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_lithuanian_ci; +group_concat(c1 order by c1) +÷ +× +A,a,À,Ã,Â,Ã,Ä,Ã…,à,á,â,ã,ä,Ã¥,Ä€,Ä,Ä‚,ă,Ä„,Ä…,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç» +AA,Aa,aA,aa +Æ,æ,Ç¢,Ç£,Ǽ,ǽ +B,b +Æ€ +Æ +Æ‚,ƃ +C,CH,Ch,c,ch,Ç,ç,Ć,ć,Ĉ,ĉ,ÄŠ,Ä‹ +cH +ÄŒ,Ä +Ƈ,ƈ +D,d,ÄŽ,Ä +DZ,Dz,dZ,dz,Ç„,Ç…,dž,DZ,Dz,dz +Ä,Ä‘ +Ɖ +ÆŠ +Æ‹,ÆŒ +Ã,ð +E,e,È,É,Ê,Ë,è,é,ê,ë,Ä’,Ä“,Ä”,Ä•,Ä–,Ä—,Ę,Ä™,Äš,Ä› +ÆŽ,Ç +Æ +Æ +F,f +Æ‘,Æ’ +G,g,Äœ,Ä,Äž,ÄŸ,Ä ,Ä¡,Ä¢,Ä£,Ǧ,ǧ,Ç´,ǵ +Ǥ,Ç¥ +Æ“ +Æ” +Æ¢,Æ£ +H,h,Ĥ,Ä¥ +Æ•,Ƕ +Ħ,ħ +I,Y,i,y,ÃŒ,Ã,ÃŽ,Ã,ì,í,î,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä­,Ä®,į,İ,Ç,Ç +IJ,Ij,iJ,ij,IJ,ij +ı +Æ— +Æ– +J,j,Ä´,ĵ,ǰ +K,k,Ķ,Ä·,Ǩ,Ç© +Ƙ,Æ™ +L,l,Ĺ,ĺ,Ä»,ļ,Ľ,ľ +Ä¿,Å€ +LJ,Lj,lJ,lj,LJ,Lj,lj +LL,Ll,lL,ll +Å,Å‚ +Æš +Æ› +M,m +N,n,Ñ,ñ,Ń,Å„,Å…,ņ,Ň,ň,Ǹ,ǹ +NJ,Nj,nJ,nj,ÇŠ,Ç‹,ÇŒ +Æ +Æž +ÅŠ,Å‹ +O,o,Ã’,Ó,Ô,Õ,Ö,ò,ó,ô,õ,ö,ÅŒ,Å,ÅŽ,Å,Å,Å‘,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç­ +OE,Oe,oE,oe,Å’,Å“ +Ø,ø,Ǿ,Ç¿ +Ɔ +ÆŸ +P,p +Ƥ,Æ¥ +Q,q +ĸ +R,r,Å”,Å•,Å–,Å—,Ř,Å™ +RR,Rr,rR,rr +Ʀ +S,s,Åš,Å›,Åœ,Å,Åž,ÅŸ,Å¿ +SS,Ss,sS,ss,ß +Å ,Å¡ +Æ© +ƪ +T,t,Å¢,Å£,Ť,Å¥ +ƾ +Ŧ,ŧ +Æ« +Ƭ,Æ­ +Æ® +U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,Å©,Ū,Å«,Ŭ,Å­,Å®,ů,Ű,ű,Ų,ų,Ư,ư,Ç“,Ç”,Ç•,Ç–,Ç—,ǘ,Ç™,Çš,Ç›,Çœ +Æœ +Ʊ +V,v +Ʋ +W,w,Å´,ŵ +X,x +Ã,ý,ÿ,Ŷ,Å·,Ÿ +Ƴ,Æ´ +Z,z,Ź,ź,Å»,ż +Æ +Ž,ž +Ƶ,ƶ +Æ·,Ç®,ǯ +Ƹ,ƹ +ƺ +Þ,þ +Æ¿,Ç· +Æ» +Ƨ,ƨ +Ƽ,ƽ +Æ„,Æ… +ʼn +Ç€ +Ç +Ç‚ +ǃ +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_slovak_ci; +group_concat(c1 order by c1) +÷ +× +A,a,À,Ã,Â,Ã,Ã…,à,á,â,ã,Ã¥,Ä€,Ä,Ä‚,ă,Ä„,Ä…,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç» +AA,Aa,aA,aa +Ä,ä +Æ,æ,Ç¢,Ç£,Ǽ,ǽ +B,b +Æ€ +Æ +Æ‚,ƃ +C,c,Ç,ç,Ć,ć,Ĉ,ĉ,ÄŠ,Ä‹ +cH +ÄŒ,Ä +Ƈ,ƈ +D,d,ÄŽ,Ä +DZ,Dz,dZ,dz,Ç„,Ç…,dž,DZ,Dz,dz +Ä,Ä‘ +Ɖ +ÆŠ +Æ‹,ÆŒ +Ã,ð +E,e,È,É,Ê,Ë,è,é,ê,ë,Ä’,Ä“,Ä”,Ä•,Ä–,Ä—,Ę,Ä™,Äš,Ä› +ÆŽ,Ç +Æ +Æ +F,f +Æ‘,Æ’ +G,g,Äœ,Ä,Äž,ÄŸ,Ä ,Ä¡,Ä¢,Ä£,Ǧ,ǧ,Ç´,ǵ +Ǥ,Ç¥ +Æ“ +Æ” +Æ¢,Æ£ +H,h,Ĥ,Ä¥ +CH,Ch,ch +Æ•,Ƕ +Ħ,ħ +I,i,ÃŒ,Ã,ÃŽ,Ã,ì,í,î,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä­,Ä®,į,İ,Ç,Ç +IJ,Ij,iJ,ij,IJ,ij +ı +Æ— +Æ– +J,j,Ä´,ĵ,ǰ +K,k,Ķ,Ä·,Ǩ,Ç© +Ƙ,Æ™ +L,l,Ĺ,ĺ,Ä»,ļ,Ľ,ľ +Ä¿,Å€ +LJ,Lj,lJ,lj,LJ,Lj,lj +LL,Ll,lL,ll +Å,Å‚ +Æš +Æ› +M,m +N,n,Ñ,ñ,Ń,Å„,Å…,ņ,Ň,ň,Ǹ,ǹ +NJ,Nj,nJ,nj,ÇŠ,Ç‹,ÇŒ +Æ +Æž +ÅŠ,Å‹ +O,o,Ã’,Ó,Õ,Ö,ò,ó,õ,ö,ÅŒ,Å,ÅŽ,Å,Å,Å‘,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç­ +OE,Oe,oE,oe,Å’,Å“ +Ô,ô +Ø,ø,Ǿ,Ç¿ +Ɔ +ÆŸ +P,p +Ƥ,Æ¥ +Q,q +ĸ +R,r,Å”,Å•,Å–,Å—,Ř,Å™ +RR,Rr,rR,rr +Ʀ +S,s,Åš,Å›,Åœ,Å,Åž,ÅŸ,Å¿ +SS,Ss,sS,ss,ß +Å ,Å¡ +Æ© +ƪ +T,t,Å¢,Å£,Ť,Å¥ +ƾ +Ŧ,ŧ +Æ« +Ƭ,Æ­ +Æ® +U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,Å©,Ū,Å«,Ŭ,Å­,Å®,ů,Ű,ű,Ų,ų,Ư,ư,Ç“,Ç”,Ç•,Ç–,Ç—,ǘ,Ç™,Çš,Ç›,Çœ +Æœ +Ʊ +V,v +Ʋ +W,w,Å´,ŵ +X,x +Y,y,Ã,ý,ÿ,Ŷ,Å·,Ÿ +Ƴ,Æ´ +Z,z,Ź,ź,Å»,ż +Æ +Ž,ž +Ƶ,ƶ +Æ·,Ç®,ǯ +Ƹ,ƹ +ƺ +Þ,þ +Æ¿,Ç· +Æ» +Ƨ,ƨ +Ƽ,ƽ +Æ„,Æ… +ʼn +Ç€ +Ç +Ç‚ +ǃ +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_spanish2_ci; +group_concat(c1 order by c1) +÷ +× +A,a,À,Ã,Â,Ã,Ä,Ã…,à,á,â,ã,ä,Ã¥,Ä€,Ä,Ä‚,ă,Ä„,Ä…,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç» +AA,Aa,aA,aa +Æ,æ,Ç¢,Ç£,Ǽ,ǽ +B,b +Æ€ +Æ +Æ‚,ƃ +C,c,Ç,ç,Ć,ć,Ĉ,ĉ,ÄŠ,Ä‹,ÄŒ,Ä +cH +CH,Ch,ch +Ƈ,ƈ +D,d,ÄŽ,Ä +DZ,Dz,dZ,dz,Ç„,Ç…,dž,DZ,Dz,dz +Ä,Ä‘ +Ɖ +ÆŠ +Æ‹,ÆŒ +Ã,ð +E,e,È,É,Ê,Ë,è,é,ê,ë,Ä’,Ä“,Ä”,Ä•,Ä–,Ä—,Ę,Ä™,Äš,Ä› +ÆŽ,Ç +Æ +Æ +F,f +Æ‘,Æ’ +G,g,Äœ,Ä,Äž,ÄŸ,Ä ,Ä¡,Ä¢,Ä£,Ǧ,ǧ,Ç´,ǵ +Ǥ,Ç¥ +Æ“ +Æ” +Æ¢,Æ£ +H,h,Ĥ,Ä¥ +Æ•,Ƕ +Ħ,ħ +I,i,ÃŒ,Ã,ÃŽ,Ã,ì,í,î,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä­,Ä®,į,İ,Ç,Ç +IJ,Ij,iJ,ij,IJ,ij +ı +Æ— +Æ– +J,j,Ä´,ĵ,ǰ +K,k,Ķ,Ä·,Ǩ,Ç© +Ƙ,Æ™ +L,l,Ĺ,ĺ,Ä»,ļ,Ľ,ľ +Ä¿,Å€ +LJ,Lj,lJ,lj,LJ,Lj,lj +lL +LL,Ll,ll +Å,Å‚ +Æš +Æ› +M,m +N,n,Ń,Å„,Å…,ņ,Ň,ň,Ǹ,ǹ +NJ,Nj,nJ,nj,ÇŠ,Ç‹,ÇŒ +Ñ,ñ +Æ +Æž +ÅŠ,Å‹ +O,o,Ã’,Ó,Ô,Õ,Ö,ò,ó,ô,õ,ö,ÅŒ,Å,ÅŽ,Å,Å,Å‘,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç­ +OE,Oe,oE,oe,Å’,Å“ +Ø,ø,Ǿ,Ç¿ +Ɔ +ÆŸ +P,p +Ƥ,Æ¥ +Q,q +ĸ +R,RR,Rr,r,rr,Å”,Å•,Å–,Å—,Ř,Å™ +rR +Ʀ +S,s,Åš,Å›,Åœ,Å,Åž,ÅŸ,Å ,Å¡,Å¿ +SS,Ss,sS,ss,ß +Æ© +ƪ +T,t,Å¢,Å£,Ť,Å¥ +ƾ +Ŧ,ŧ +Æ« +Ƭ,Æ­ +Æ® +U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,Å©,Ū,Å«,Ŭ,Å­,Å®,ů,Ű,ű,Ų,ų,Ư,ư,Ç“,Ç”,Ç•,Ç–,Ç—,ǘ,Ç™,Çš,Ç›,Çœ +Æœ +Ʊ +V,v +Ʋ +W,w,Å´,ŵ +X,x +Y,y,Ã,ý,ÿ,Ŷ,Å·,Ÿ +Ƴ,Æ´ +Z,z,Ź,ź,Å»,ż,Ž,ž +Æ +Ƶ,ƶ +Æ·,Ç®,ǯ +Ƹ,ƹ +ƺ +Þ,þ +Æ¿,Ç· +Æ» +Ƨ,ƨ +Ƽ,ƽ +Æ„,Æ… +ʼn +Ç€ +Ç +Ç‚ +ǃ +select group_concat(c1 order by c1) from t1 group by c1 collate utf8_roman_ci; +group_concat(c1 order by c1) +÷ +× +A,a,À,Ã,Â,Ã,Ä,Ã…,à,á,â,ã,ä,Ã¥,Ä€,Ä,Ä‚,ă,Ä„,Ä…,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç» +AA,Aa,aA,aa +Æ,æ,Ç¢,Ç£,Ǽ,ǽ +B,b +Æ€ +Æ +Æ‚,ƃ +C,c,Ç,ç,Ć,ć,Ĉ,ĉ,ÄŠ,Ä‹,ÄŒ,Ä +CH,Ch,cH,ch +Ƈ,ƈ +D,d,ÄŽ,Ä +DZ,Dz,dZ,dz,Ç„,Ç…,dž,DZ,Dz,dz +Ä,Ä‘ +Ɖ +ÆŠ +Æ‹,ÆŒ +Ã,ð +E,e,È,É,Ê,Ë,è,é,ê,ë,Ä’,Ä“,Ä”,Ä•,Ä–,Ä—,Ę,Ä™,Äš,Ä› +ÆŽ,Ç +Æ +Æ +F,f +Æ‘,Æ’ +G,g,Äœ,Ä,Äž,ÄŸ,Ä ,Ä¡,Ä¢,Ä£,Ǧ,ǧ,Ç´,ǵ +Ǥ,Ç¥ +Æ“ +Æ” +Æ¢,Æ£ +H,h,Ĥ,Ä¥ +Æ•,Ƕ +Ħ,ħ +I,J,i,j,ÃŒ,Ã,ÃŽ,Ã,ì,í,î,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä­,Ä®,į,İ,Ç,Ç +IJ,Ij,iJ,ij +IJ,ij +ı +Æ— +Æ– +Ä´,ĵ,ǰ +K,k,Ķ,Ä·,Ǩ,Ç© +Ƙ,Æ™ +L,l,Ĺ,ĺ,Ä»,ļ,Ľ,ľ +Ä¿,Å€ +LJ,Lj,lJ,lj +LJ,Lj,lj +LL,Ll,lL,ll +Å,Å‚ +Æš +Æ› +M,m +N,n,Ñ,ñ,Ń,Å„,Å…,ņ,Ň,ň,Ǹ,ǹ +NJ,Nj,nJ,nj +ÇŠ,Ç‹,ÇŒ +Æ +Æž +ÅŠ,Å‹ +O,o,Ã’,Ó,Ô,Õ,Ö,ò,ó,ô,õ,ö,ÅŒ,Å,ÅŽ,Å,Å,Å‘,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç­ +OE,Oe,oE,oe,Å’,Å“ +Ø,ø,Ǿ,Ç¿ +Ɔ +ÆŸ +P,p +Ƥ,Æ¥ +Q,q +ĸ +R,r,Å”,Å•,Å–,Å—,Ř,Å™ +RR,Rr,rR,rr +Ʀ +S,s,Åš,Å›,Åœ,Å,Åž,ÅŸ,Å ,Å¡,Å¿ +SS,Ss,sS,ss,ß +Æ© +ƪ +T,t,Å¢,Å£,Ť,Å¥ +ƾ +Ŧ,ŧ +Æ« +Ƭ,Æ­ +Æ® +Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,Å©,Ū,Å«,Ŭ,Å­,Å®,ů,Ű,ű,Ų,ų,Ư,ư,Ç“,Ç”,Ç•,Ç–,Ç—,ǘ,Ç™,Çš,Ç›,Çœ +Æœ +Ʊ +U,V,u,v +Ʋ +W,w,Å´,ŵ +X,x +Y,y,Ã,ý,ÿ,Ŷ,Å·,Ÿ +Ƴ,Æ´ +Z,z,Ź,ź,Å»,ż,Ž,ž +Æ +Ƶ,ƶ +Æ·,Ç®,ǯ +Ƹ,ƹ +ƺ +Þ,þ +Æ¿,Ç· +Æ» +Ƨ,ƨ +Ƽ,ƽ +Æ„,Æ… +ʼn +Ç€ +Ç +Ç‚ +ǃ +drop table t1; +SET NAMES utf8; +CREATE TABLE t1 (c varchar(255) NOT NULL COLLATE utf8_general_ci, INDEX (c)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x039C03C903B403B11F770308 USING utf8)); +SELECT * FROM t1 WHERE c LIKE CONVERT(_ucs2 0x039C0025 USING utf8) +COLLATE utf8_general_ci; +c +Μωδαί̈ +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x039C03C903B4 USING utf8)); +SELECT * FROM t1 WHERE c LIKE CONVERT(_ucs2 0x039C0025 USING utf8) +COLLATE utf8_general_ci ORDER BY c; +c +Μωδ +Μωδαί̈ +DROP TABLE t1; +CREATE TABLE t1 (c varchar(255) NOT NULL COLLATE ucs2_unicode_ci, INDEX (c)); +INSERT INTO t1 VALUES (_ucs2 0x039C03C903B403B11F770308); +SELECT * FROM t1 WHERE c LIKE _ucs2 0x039C0025 COLLATE ucs2_unicode_ci; +c +Μωδαί̈ +INSERT INTO t1 VALUES (_ucs2 0x039C03C903B4); +SELECT * FROM t1 WHERE c LIKE _ucs2 0x039C0025 +COLLATE ucs2_unicode_ci ORDER BY c; +c +Μωδ +Μωδαί̈ +DROP TABLE t1; +CREATE TABLE t1 (c varchar(255) NOT NULL COLLATE utf8_unicode_ci, INDEX (c)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x039C03C903B403B11F770308 USING utf8)); +SELECT * FROM t1 WHERE c LIKE CONVERT(_ucs2 0x039C0025 USING utf8) COLLATE utf8_unicode_ci; +c +Μωδαί̈ +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x039C03C903B4 USING utf8)); +SELECT * FROM t1 WHERE c LIKE CONVERT(_ucs2 0x039C0025 USING utf8) +COLLATE utf8_unicode_ci ORDER BY c; +c +Μωδ +Μωδαί̈ +DROP TABLE t1; +CREATE TABLE t1 ( +col1 CHAR(32) CHARACTER SET utf8 NOT NULL +); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0041004100410627 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0041004100410628 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0041004100410647 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0041004100410648 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0633064A0651062F USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062D06330646 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A0642064A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06320627062F0647 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062806310627064A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064706450647 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F062706460634062C0648064A06270646064A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06A90647 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A06270631064A062E USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062706460642064406270628 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627064A0631062706460650 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627062F064806270631062F USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06280631062706480646200C06310627 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062E064806270646062F0647 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0648 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A062D062A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A0623062B064A0631 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06220646 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0642063106270631 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06AF06310641062A0647 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06270646062F USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0634062E0635064A0651062A064A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0628062706310632 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06270633062A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x063906A90633 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06270648060C USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F0631 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062D062F0648062F USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0628064A0633062A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0648067E0646062C USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06330627064406AF064A060C USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x063306270644 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064606450627064A0646062F0647 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A06280631064A0632 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0645062C06440633 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06280648062F060C USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0628064A0646 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06350641062D0627062A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627064A0646 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06A9062A06270628 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06280647 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x068606340645 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0645064A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062E06480631062F USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0686064706310647 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627064A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06420648064A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06450635064506510645 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06310627 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0646063406270646 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0645064A200C062F0647062F060C USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0647063106860646062F USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06390645064400BB USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06A9064806340634 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0628 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064706500646064A064606AF USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627062D063306270646 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064A062706310634062706370631 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06450646062A06340631 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0634062F0647 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F0633062A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A064806270646 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0647064506270646 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627064806510644 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A0634062E064A0635 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F0627062F USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06280627 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A064106270648062A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062D06270644062A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A064106A906510631 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x063A064406280647 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F06270631062F USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064A06A9064A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06270632 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x063106470628063106270646 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064606470636062A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064506340631064806370647 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627064A063106270646 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0646064A0632 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064A06A9 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0645062D064206510642 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0637063106270632 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064106310647064606AF USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A0645062F06510646 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627064A063106270646064A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06280648062F USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06A90627063106470627064A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06270648 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0639063106350647 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627064506480631 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0633064A06270633064A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627064A063106270646060C USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062D064806320647 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x063906440645 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F062706460634 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06450642062706440627062A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F064A06AF0631 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0648064A06980647 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0646062706450647 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064506480631062F USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0628062D062B USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0628063106310633064A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064606480634062A0647 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06450646 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A064606470627 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0622064606860647 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F064806310647 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627064206270645062A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x067E0631062F062706320645 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0698062706460648064A0647 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0648064A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F06390648062A0650 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x063306500631 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F0646064A0633064F0646 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x063106270633 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0647064A0626062A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0639064406480645200C063406310642064A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06280639062F0627064B USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0645062F063106330647 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062206410631064A06420627064A064A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F06270646063406AF06270647 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06440646062F0646 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x067E064A06480633062A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0647064606AF06270645064A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x067E0633 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0622063A06270632 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062C064606AF USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062C064706270646 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F064806510645 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x063406470631 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06A9064506280631064A062C USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06450646062A06420644 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06A90631062F0646062F USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06470645 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06310641062A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06220646062C0627 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064506270646062F USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A0627 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062706A9062A06280631 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064606380631 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F06480644062A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F06480628062706310647 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064606330628062A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0645063306270639062F USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0634062F USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06480632064A0631 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0645062E062A06270631 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06330641064A0631 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627064606AF0644064A0633 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A0642064A200C06320627062F0647 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06280627063206AF0634062A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0647064506330631 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06220644064506270646064A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06270634 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06220645062F0647 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06A906270631064A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x067E0631062F0627062E062A0647 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x063906440645064A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627062F0628064A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062D062F0651 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064606280648062F060C USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06480644064A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x063906480636060C USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06340627064A062F USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064506470645 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A0631 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06220646060C USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06470645063306310634 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06A90627064606480646 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062E0627064606480627062F06AF064A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06AF06310645064A USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06280648062C0648062F USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062206480631062F USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F0648 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06A90627064506440627064B USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064A06A9062F064A06AF0631 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06AF USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F064406280633062A0647 USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06280648062F0646062F USING utf8)); +INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06450647064506270646 USING utf8)); +SELECT HEX(CONVERT(col1 USING ucs2)) FROM t1 ORDER BY col1 COLLATE utf8_persian_ci, col1 COLLATE utf8_bin; +HEX(CONVERT(col1 USING ucs2)) +0041004100410627 +0041004100410628 +0041004100410648 +0041004100410647 +0622063A06270632 +062206410631064A06420627064A064A +06220644064506270646064A +06220645062F0647 +06220646 +06220646060C +06220646062C0627 +0622064606860647 +062206480631062F +0627062D063306270646 +0627062F0628064A +0627062F064806270631062F +06270632 +06270633062A +06270634 +0627064206270645062A +062706A9062A06280631 +0627064506480631 +06270646062F +062706460642064406270628 +0627064606AF0644064A0633 +06270648 +06270648060C +0627064806510644 +0627064A +0627064A063106270646 +0627064A063106270646060C +0627064A0631062706460650 +0627064A063106270646064A +0627064A0646 +0628 +06280627 +0628062706310632 +06280627063206AF0634062A +0628062D062B +06280631062706480646200C06310627 +062806310627064A +0628063106310633064A +06280639062F0627064B +06280648062C0648062F +06280648062F +06280648062F060C +06280648062F0646062F +06280647 +0628064A0633062A +0628064A0646 +067E0631062F0627062E062A0647 +067E0631062F062706320645 +067E0633 +067E064A06480633062A +062A0627 +062A06270631064A062E +062A0623062B064A0631 +062A06280631064A0632 +062A062D062A +062A0631 +062A0634062E064A0635 +062A064106270648062A +062A064106A906510631 +062A0642064A +062A0642064A200C06320627062F0647 +062A0645062F06510646 +062A064606470627 +062A064806270646 +062C064606AF +062C064706270646 +068606340645 +0686064706310647 +062D06270644062A +062D062F0651 +062D062F0648062F +062D06330646 +062D064806320647 +062E0627064606480627062F06AF064A +062E064806270646062F0647 +062E06480631062F +062F0627062F +062F06270631062F +062F062706460634 +062F062706460634062C0648064A06270646064A +062F06270646063406AF06270647 +062F0631 +062F0633062A +062F06390648062A0650 +062F064406280633062A0647 +062F0646064A0633064F0646 +062F0648 +062F06480628062706310647 +062F064806310647 +062F06480644062A +062F064806510645 +062F064A06AF0631 +06310627 +063106270633 +06310641062A +063106470628063106270646 +06320627062F0647 +0698062706460648064A0647 +063306500631 +063306270644 +06330627064406AF064A060C +06330641064A0631 +0633064A06270633064A +0633064A0651062F +06340627064A062F +0634062E0635064A0651062A064A +0634062F +0634062F0647 +063406470631 +06350641062D0627062A +0637063106270632 +0639063106350647 +063906A90633 +063906440645 +063906440645064A +0639064406480645200C063406310642064A +06390645064400BB +063906480636060C +063A064406280647 +064106310647064606AF +0642063106270631 +06420648064A +06A90627063106470627064A +06A906270631064A +06A90627064506440627064B +06A90627064606480646 +06A9062A06270628 +06A90631062F0646062F +06A9064506280631064A062C +06A9064806340634 +06A90647 +06AF +06AF06310641062A0647 +06AF06310645064A +06440646062F0646 +064506270646062F +0645062C06440633 +0645062D064206510642 +0645062E062A06270631 +0645062F063106330647 +0645063306270639062F +064506340631064806370647 +06450635064506510645 +06450642062706440627062A +06450646 +06450646062A06340631 +06450646062A06420644 +064506480631062F +064506470645 +06450647064506270646 +0645064A +0645064A200C062F0647062F060C +0646062706450647 +064606280648062F060C +064606330628062A +0646063406270646 +064606380631 +064606450627064A0646062F0647 +064606480634062A0647 +064606470636062A +0646064A0632 +0648 +0648067E0646062C +06480632064A0631 +06480644064A +0648064A +0648064A06980647 +064706500646064A064606AF +0647063106860646062F +06470645 +0647064506270646 +0647064506330631 +06470645063306310634 +064706450647 +0647064606AF06270645064A +0647064A0626062A +064A062706310634062706370631 +064A06A9 +064A06A9062F064A06AF0631 +064A06A9064A +DROP TABLE t1; +SET @test_character_set= 'utf8'; +SET @test_collation= 'utf8_swedish_ci'; +SET @safe_character_set_server= @@character_set_server; +SET @safe_collation_server= @@collation_server; +SET character_set_server= @test_character_set; +SET collation_server= @test_collation; +CREATE DATABASE d1; +USE d1; +CREATE TABLE t1 (c CHAR(10), KEY(c)); +SHOW FULL COLUMNS FROM t1; +Field Type Collation Null Key Default Extra Privileges Comment +c char(10) utf8_swedish_ci YES MUL NULL +INSERT INTO t1 VALUES ('aaa'),('aaaa'),('aaaaa'); +SELECT c as want3results FROM t1 WHERE c LIKE 'aaa%'; +want3results +aaa +aaaa +aaaaa +DROP TABLE t1; +CREATE TABLE t1 (c1 varchar(15), KEY c1 (c1(2))); +SHOW FULL COLUMNS FROM t1; +Field Type Collation Null Key Default Extra Privileges Comment +c1 varchar(15) utf8_swedish_ci YES MUL NULL +INSERT INTO t1 VALUES ('location'),('loberge'),('lotre'),('boabab'); +SELECT c1 as want3results from t1 where c1 like 'l%'; +want3results +location +loberge +lotre +SELECT c1 as want3results from t1 where c1 like 'lo%'; +want3results +location +loberge +lotre +SELECT c1 as want1result from t1 where c1 like 'loc%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'loca%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'locat%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'locati%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'locatio%'; +want1result +location +SELECT c1 as want1result from t1 where c1 like 'location%'; +want1result +location +DROP TABLE t1; +DROP DATABASE d1; +USE test; +SET character_set_server= @safe_character_set_server; +SET collation_server= @safe_collation_server; diff --git a/mysql-test/r/func_test.result.es b/mysql-test/r/func_test.result.es new file mode 100644 index 00000000000..380f96835d0 --- /dev/null +++ b/mysql-test/r/func_test.result.es @@ -0,0 +1,185 @@ +drop table if exists t1,t2; +select 0=0,1>0,1>=1,1<0,1<=0,1!=0,strcmp("abc","abcd"),strcmp("b","a"),strcmp("a","a") ; +0=0 1>0 1>=1 1<0 1<=0 1!=0 strcmp("abc","abcd") strcmp("b","a") strcmp("a","a") +1 1 1 0 0 1 -1 1 0 +select "a"<"b","a"<="b","b">="a","b">"a","a"="A","a"<>"b"; +"a"<"b" "a"<="b" "b">="a" "b">"a" "a"="A" "a"<>"b" +1 1 1 1 1 1 +select "a "="A", "A "="a", "a " <= "A b"; +"a "="A" "A "="a" "a " <= "A b" +1 1 1 +select "abc" like "a%", "abc" not like "%d%", "a%" like "a\%","abc%" like "a%\%","abcd" like "a%b_%d", "a" like "%%a","abcde" like "a%_e","abc" like "abc%"; +"abc" like "a%" "abc" not like "%d%" "a%" like "a\%" "abc%" like "a%\%" "abcd" like "a%b_%d" "a" like "%%a" "abcde" like "a%_e" "abc" like "abc%" +1 1 1 1 1 1 1 1 +select "a" like "%%b","a" like "%%ab","ab" like "a\%", "ab" like "_", "ab" like "ab_", "abc" like "%_d", "abc" like "abc%d"; +"a" like "%%b" "a" like "%%ab" "ab" like "a\%" "ab" like "_" "ab" like "ab_" "abc" like "%_d" "abc" like "abc%d" +0 0 0 0 0 0 0 +select '?' like '|%', '?' like '|%' ESCAPE '|', '%' like '|%', '%' like '|%' ESCAPE '|', '%' like '%'; +'?' like '|%' '?' like '|%' ESCAPE '|' '%' like '|%' '%' like '|%' ESCAPE '|' '%' like '%' +0 0 0 1 1 +select 'abc' like '%c','abcabc' like '%c', "ab" like "", "ab" like "a", "ab" like "ab"; +'abc' like '%c' 'abcabc' like '%c' "ab" like "" "ab" like "a" "ab" like "ab" +1 1 0 0 1 +select "Det här är svenska" regexp "h[[:alpha:]]+r", "aba" regexp "^(a|b)*$"; +"Det här är svenska" regexp "h[[:alpha:]]+r" "aba" regexp "^(a|b)*$" +1 1 +select "aba" regexp concat("^","a"); +"aba" regexp concat("^","a") +1 +select !0,NOT 0=1,!(0=0),1 AND 1,1 && 0,0 OR 1,1 || NULL, 1=1 or 1=1 and 1=0; +!0 NOT 0=1 !(0=0) 1 AND 1 1 && 0 0 OR 1 1 || NULL 1=1 or 1=1 and 1=0 +1 1 0 1 0 1 1 1 +select 2 between 1 and 3, "monty" between "max" and "my",2=2 and "monty" between "max" and "my" and 3=3; +2 between 1 and 3 "monty" between "max" and "my" 2=2 and "monty" between "max" and "my" and 3=3 +1 1 1 +select 'b' between 'a' and 'c', 'B' between 'a' and 'c'; +'b' between 'a' and 'c' 'B' between 'a' and 'c' +1 1 +select 2 in (3,2,5,9,5,1),"monty" in ("david","monty","allan"), 1.2 in (1.4,1.2,1.0); +2 in (3,2,5,9,5,1) "monty" in ("david","monty","allan") 1.2 in (1.4,1.2,1.0) +1 1 1 +select -1.49 or -1.49,0.6 or 0.6; +-1.49 or -1.49 0.6 or 0.6 +1 1 +select 3 ^ 11, 1 ^ 1, 1 ^ 0, 1 ^ NULL, NULL ^ 1; +3 ^ 11 1 ^ 1 1 ^ 0 1 ^ NULL NULL ^ 1 +8 0 1 NULL NULL +explain extended select 3 ^ 11, 1 ^ 1, 1 ^ 0, 1 ^ NULL, NULL ^ 1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select (3 ^ 11) AS `3 ^ 11`,(1 ^ 1) AS `1 ^ 1`,(1 ^ 0) AS `1 ^ 0`,(1 ^ NULL) AS `1 ^ NULL`,(NULL ^ 1) AS `NULL ^ 1` +select 1 XOR 1, 1 XOR 0, 0 XOR 1, 0 XOR 0, NULL XOR 1, 1 XOR NULL, 0 XOR NULL; +1 XOR 1 1 XOR 0 0 XOR 1 0 XOR 0 NULL XOR 1 1 XOR NULL 0 XOR NULL +0 1 1 0 NULL NULL NULL +select 1 like 2 xor 2 like 1; +1 like 2 xor 2 like 1 +0 +select 10 % 7, 10 mod 7, 10 div 3; +10 % 7 10 mod 7 10 div 3 +3 3 3 +explain extended select 10 % 7, 10 mod 7, 10 div 3; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select (10 % 7) AS `10 % 7`,(10 % 7) AS `10 mod 7`,(10 DIV 3) AS `10 div 3` +select (1 << 64)-1, ((1 << 64)-1) DIV 1, ((1 << 64)-1) DIV 2; +(1 << 64)-1 ((1 << 64)-1) DIV 1 ((1 << 64)-1) DIV 2 +18446744073709551615 18446744073709551615 9223372036854775807 +explain extended select (1 << 64)-1, ((1 << 64)-1) DIV 1, ((1 << 64)-1) DIV 2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select ((1 << 64) - 1) AS `(1 << 64)-1`,(((1 << 64) - 1) DIV 1) AS `((1 << 64)-1) DIV 1`,(((1 << 64) - 1) DIV 2) AS `((1 << 64)-1) DIV 2` +create table t1 (a int); +insert t1 values (1); +select * from t1 where 1 xor 1; +a +explain extended select * from t1 where 1 xor 1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables +Warnings: +Note 1003 select test.t1.a AS `a` from test.t1 where (1 xor 1) +select - a from t1; +- a +-1 +explain extended select - a from t1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 system NULL NULL NULL NULL 1 +Warnings: +Note 1003 select -(test.t1.a) AS `- a` from test.t1 +drop table t1; +select 5 between 0 and 10 between 0 and 1,(5 between 0 and 10) between 0 and 1; +5 between 0 and 10 between 0 and 1 (5 between 0 and 10) between 0 and 1 +0 1 +select 1 and 2 between 2 and 10, 2 between 2 and 10 and 1; +1 and 2 between 2 and 10 2 between 2 and 10 and 1 +1 1 +select 1 and 0 or 2, 2 or 1 and 0; +1 and 0 or 2 2 or 1 and 0 +1 1 +select _koi8r'a' = _koi8r'A'; +_koi8r'a' = _koi8r'A' +1 +select _koi8r'a' = _koi8r'A' COLLATE koi8r_general_ci; +_koi8r'a' = _koi8r'A' COLLATE koi8r_general_ci +1 +explain extended select _koi8r'a' = _koi8r'A' COLLATE koi8r_general_ci; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used +Warnings: +Note 1003 select (_koi8r'a' = (_koi8r'A' collate _latin1'koi8r_general_ci')) AS `_koi8r'a' = _koi8r'A' COLLATE koi8r_general_ci` +select _koi8r'a' = _koi8r'A' COLLATE koi8r_bin; +_koi8r'a' = _koi8r'A' COLLATE koi8r_bin +0 +select _koi8r'a' COLLATE koi8r_general_ci = _koi8r'A'; +_koi8r'a' COLLATE koi8r_general_ci = _koi8r'A' +1 +select _koi8r'a' COLLATE koi8r_bin = _koi8r'A'; +_koi8r'a' COLLATE koi8r_bin = _koi8r'A' +0 +select _koi8r'a' COLLATE koi8r_bin = _koi8r'A' COLLATE koi8r_general_ci; +ERROR HY000: Illegal mix of collations (koi8r_bin,EXPLICIT) and (koi8r_general_ci,EXPLICIT) for operation '=' +select _koi8r'a' = _latin1'A'; +ERROR HY000: Illegal mix of collations (koi8r_general_ci,COERCIBLE) and (latin1_swedish_ci,COERCIBLE) for operation '=' +select strcmp(_koi8r'a', _koi8r'A'); +strcmp(_koi8r'a', _koi8r'A') +0 +select strcmp(_koi8r'a', _koi8r'A' COLLATE koi8r_general_ci); +strcmp(_koi8r'a', _koi8r'A' COLLATE koi8r_general_ci) +0 +select strcmp(_koi8r'a', _koi8r'A' COLLATE koi8r_bin); +strcmp(_koi8r'a', _koi8r'A' COLLATE koi8r_bin) +1 +select strcmp(_koi8r'a' COLLATE koi8r_general_ci, _koi8r'A'); +strcmp(_koi8r'a' COLLATE koi8r_general_ci, _koi8r'A') +0 +select strcmp(_koi8r'a' COLLATE koi8r_bin, _koi8r'A'); +strcmp(_koi8r'a' COLLATE koi8r_bin, _koi8r'A') +1 +select strcmp(_koi8r'a' COLLATE koi8r_general_ci, _koi8r'A' COLLATE koi8r_bin); +ERROR HY000: Illegal mix of collations (koi8r_general_ci,EXPLICIT) and (koi8r_bin,EXPLICIT) for operation 'strcmp' +select strcmp(_koi8r'a', _latin1'A'); +ERROR HY000: Illegal mix of collations (koi8r_general_ci,COERCIBLE) and (latin1_swedish_ci,COERCIBLE) for operation 'strcmp' +select _koi8r'a' LIKE _koi8r'A'; +_koi8r'a' LIKE _koi8r'A' +1 +select _koi8r'a' LIKE _koi8r'A' COLLATE koi8r_general_ci; +_koi8r'a' LIKE _koi8r'A' COLLATE koi8r_general_ci +1 +select _koi8r'a' LIKE _koi8r'A' COLLATE koi8r_bin; +_koi8r'a' LIKE _koi8r'A' COLLATE koi8r_bin +0 +select _koi8r'a' COLLATE koi8r_general_ci LIKE _koi8r'A'; +_koi8r'a' COLLATE koi8r_general_ci LIKE _koi8r'A' +1 +select _koi8r'a' COLLATE koi8r_bin LIKE _koi8r'A'; +_koi8r'a' COLLATE koi8r_bin LIKE _koi8r'A' +0 +select _koi8r'a' COLLATE koi8r_general_ci LIKE _koi8r'A' COLLATE koi8r_bin; +ERROR HY000: Illegal mix of collations (koi8r_general_ci,EXPLICIT) and (koi8r_bin,EXPLICIT) for operation 'like' +select _koi8r'a' LIKE _latin1'A'; +ERROR HY000: Illegal mix of collations (koi8r_general_ci,COERCIBLE) and (latin1_swedish_ci,COERCIBLE) for operation 'like' +CREATE TABLE t1 ( faq_group_id int(11) NOT NULL default '0', faq_id int(11) NOT NULL default '0', title varchar(240) default NULL, keywords text, description longblob, solution longblob, status tinyint(4) NOT NULL default '0', access_id smallint(6) default NULL, lang_id smallint(6) NOT NULL default '0', created datetime NOT NULL default '0000-00-00 00:00:00', updated datetime default NULL, last_access datetime default NULL, last_notify datetime default NULL, solved_count int(11) NOT NULL default '0', static_solved int(11) default NULL, solved_1 int(11) default NULL, solved_2 int(11) default NULL, solved_3 int(11) default NULL, solved_4 int(11) default NULL, solved_5 int(11) default NULL, expires datetime default NULL, notes text, assigned_to smallint(6) default NULL, assigned_group smallint(6) default NULL, last_edited_by smallint(6) default NULL, orig_ref_no varchar(15) binary default NULL, c$fundstate smallint(6) default NULL, c$contributor smallint(6) default NULL, UNIQUE KEY t1$faq_id (faq_id), KEY t1$group_id$faq_id (faq_group_id,faq_id), KEY t1$c$fundstate (c$fundstate) ) ENGINE=MyISAM; +INSERT INTO t1 VALUES (82,82,'How to use the DynaVox Usage Counts Feature','usages count, number, corner, white, box, button','\r\n\r\n \r\n \r\n \r\n \r\n
 \r\n

How \r\n To: \r\n Display or Hide the Usage Counts to find out how many times each button is being selected.

\r\n
','\r\n \r\n \r\n \r\n \r\n\r\n \r\n
  \r\n \r\n

1. Select \r\n the On/Setup button to access the DynaVox Setup Menu.
\r\n 2. Select Button Features.
\r\n 3. Below the OK button is the Usage Counts button.
\r\n a. If it says \"Hidden\" then the Usage Counts will not be displayed.
\r\n b. If it says \"Displayed\" then the Usage Counts will be shown.
\r\n c. Select the Usage Counts Option Ring once and it will toggle \r\n to the alternative option.
\r\n 4. Once the correct setting has been chosen, select OK to leave the Button \r\n Features menu.
\r\n 5. Select OK out of the Setup menu and return to the communication \r\n page.

\r\n

For \r\n further information on Usage Counts, see the Button Features \r\n Menu Entry in the DynaVox/DynaMyte Reference Manual.

\r\n
',4,1,1,'2001-11-16 16:43:34','2002-11-25 12:09:43','2003-07-24 01:04:48',NULL,11,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,11,NULL,NULL,NULL); +CREATE TABLE t2 ( access_id smallint(6) NOT NULL default '0', name varchar(20) binary default NULL, rank smallint(6) NOT NULL default '0', KEY t2$access_id (access_id) ) ENGINE=MyISAM; +INSERT INTO t2 VALUES (1,'Everyone',2),(2,'Help',3),(3,'Customer Support',1); +SELECT f_acc.rank, a1.rank, a2.rank FROM t1 LEFT JOIN t1 f1 ON (f1.access_id=1 AND f1.faq_group_id = t1.faq_group_id) LEFT JOIN t2 a1 ON (a1.access_id = f1.access_id) LEFT JOIN t1 f2 ON (f2.access_id=3 AND f2.faq_group_id = t1.faq_group_id) LEFT JOIN t2 a2 ON (a2.access_id = f2.access_id), t2 f_acc WHERE LEAST(a1.rank,a2.rank) = f_acc.rank; +rank rank rank +2 2 NULL +DROP TABLE t1,t2; +CREATE TABLE t1 (d varchar(6), k int); +INSERT INTO t1 VALUES (NULL, 2); +SELECT GREATEST(d,d) FROM t1 WHERE k=2; +GREATEST(d,d) +NULL +DROP TABLE t1; +select 1197.90 mod 50; +1197.90 mod 50 +47.90 +select 5.1 mod 3, 5.1 mod -3, -5.1 mod 3, -5.1 mod -3; +5.1 mod 3 5.1 mod -3 -5.1 mod 3 -5.1 mod -3 +2.1 2.1 -2.1 -2.1 +select 5 mod 3, 5 mod -3, -5 mod 3, -5 mod -3; +5 mod 3 5 mod -3 -5 mod 3 -5 mod -3 +2 2 -2 -2 diff --git a/mysql-test/r/innodb.result.es b/mysql-test/r/innodb.result.es new file mode 100644 index 00000000000..602a034bc16 --- /dev/null +++ b/mysql-test/r/innodb.result.es @@ -0,0 +1,1653 @@ +drop table if exists t1,t2,t3,t4; +drop database if exists mysqltest; +create table t1 (id int unsigned not null auto_increment, code tinyint unsigned not null, name char(20) not null, primary key (id), key (code), unique (name)) engine=innodb; +insert into t1 (code, name) values (1, 'Tim'), (1, 'Monty'), (2, 'David'), (2, 'Erik'), (3, 'Sasha'), (3, 'Jeremy'), (4, 'Matt'); +select id, code, name from t1 order by id; +id code name +1 1 Tim +2 1 Monty +3 2 David +4 2 Erik +5 3 Sasha +6 3 Jeremy +7 4 Matt +update ignore t1 set id = 8, name = 'Sinisa' where id < 3; +select id, code, name from t1 order by id; +id code name +2 1 Monty +3 2 David +4 2 Erik +5 3 Sasha +6 3 Jeremy +7 4 Matt +8 1 Sinisa +update ignore t1 set id = id + 10, name = 'Ralph' where id < 4; +select id, code, name from t1 order by id; +id code name +3 2 David +4 2 Erik +5 3 Sasha +6 3 Jeremy +7 4 Matt +8 1 Sinisa +12 1 Ralph +drop table t1; +CREATE TABLE t1 ( +id int(11) NOT NULL auto_increment, +parent_id int(11) DEFAULT '0' NOT NULL, +level tinyint(4) DEFAULT '0' NOT NULL, +PRIMARY KEY (id), +KEY parent_id (parent_id), +KEY level (level) +) engine=innodb; +INSERT INTO t1 VALUES (1,0,0),(3,1,1),(4,1,1),(8,2,2),(9,2,2),(17,3,2),(22,4,2),(24,4,2),(28,5,2),(29,5,2),(30,5,2),(31,6,2),(32,6,2),(33,6,2),(203,7,2),(202,7,2),(20,3,2),(157,0,0),(193,5,2),(40,7,2),(2,1,1),(15,2,2),(6,1,1),(34,6,2),(35,6,2),(16,3,2),(7,1,1),(36,7,2),(18,3,2),(26,5,2),(27,5,2),(183,4,2),(38,7,2),(25,5,2),(37,7,2),(21,4,2),(19,3,2),(5,1,1),(179,5,2); +update t1 set parent_id=parent_id+100; +select * from t1 where parent_id=102; +id parent_id level +8 102 2 +9 102 2 +15 102 2 +update t1 set id=id+1000; +update t1 set id=1024 where id=1009; +Got one of the listed errors +select * from t1; +id parent_id level +1001 100 0 +1002 101 1 +1003 101 1 +1004 101 1 +1005 101 1 +1006 101 1 +1007 101 1 +1008 102 2 +1009 102 2 +1015 102 2 +1016 103 2 +1017 103 2 +1018 103 2 +1019 103 2 +1020 103 2 +1021 104 2 +1022 104 2 +1024 104 2 +1025 105 2 +1026 105 2 +1027 105 2 +1028 105 2 +1029 105 2 +1030 105 2 +1031 106 2 +1032 106 2 +1033 106 2 +1034 106 2 +1035 106 2 +1036 107 2 +1037 107 2 +1038 107 2 +1040 107 2 +1157 100 0 +1179 105 2 +1183 104 2 +1193 105 2 +1202 107 2 +1203 107 2 +update ignore t1 set id=id+1; +select * from t1; +id parent_id level +1001 100 0 +1002 101 1 +1003 101 1 +1004 101 1 +1005 101 1 +1006 101 1 +1007 101 1 +1008 102 2 +1010 102 2 +1015 102 2 +1016 103 2 +1017 103 2 +1018 103 2 +1019 103 2 +1020 103 2 +1021 104 2 +1023 104 2 +1024 104 2 +1025 105 2 +1026 105 2 +1027 105 2 +1028 105 2 +1029 105 2 +1030 105 2 +1031 106 2 +1032 106 2 +1033 106 2 +1034 106 2 +1035 106 2 +1036 107 2 +1037 107 2 +1039 107 2 +1041 107 2 +1158 100 0 +1180 105 2 +1184 104 2 +1194 105 2 +1202 107 2 +1204 107 2 +update ignore t1 set id=1023 where id=1010; +select * from t1 where parent_id=102; +id parent_id level +1008 102 2 +1010 102 2 +1015 102 2 +explain select level from t1 where level=1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref level level 1 const # Using where; Using index +explain select level,id from t1 where level=1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref level level 1 const # Using where; Using index +explain select level,id,parent_id from t1 where level=1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref level level 1 const # Using where +select level,id from t1 where level=1; +level id +1 1002 +1 1003 +1 1004 +1 1005 +1 1006 +1 1007 +select level,id,parent_id from t1 where level=1; +level id parent_id +1 1002 101 +1 1003 101 +1 1004 101 +1 1005 101 +1 1006 101 +1 1007 101 +optimize table t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +show keys from t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment +t1 0 PRIMARY 1 id A # NULL NULL BTREE +t1 1 parent_id 1 parent_id A # NULL NULL BTREE +t1 1 level 1 level A # NULL NULL BTREE +drop table t1; +CREATE TABLE t1 ( +gesuchnr int(11) DEFAULT '0' NOT NULL, +benutzer_id int(11) DEFAULT '0' NOT NULL, +PRIMARY KEY (gesuchnr,benutzer_id) +) engine=innodb; +replace into t1 (gesuchnr,benutzer_id) values (2,1); +replace into t1 (gesuchnr,benutzer_id) values (1,1); +replace into t1 (gesuchnr,benutzer_id) values (1,1); +select * from t1; +gesuchnr benutzer_id +1 1 +2 1 +drop table t1; +create table t1 (a int) engine=innodb; +insert into t1 values (1), (2); +optimize table t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +delete from t1 where a = 1; +select * from t1; +a +2 +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK +drop table t1; +create table t1 (a int,b varchar(20)) engine=innodb; +insert into t1 values (1,""), (2,"testing"); +delete from t1 where a = 1; +select * from t1; +a b +2 testing +create index skr on t1 (a); +insert into t1 values (3,""), (4,"testing"); +analyze table t1; +Table Op Msg_type Msg_text +test.t1 analyze status OK +show keys from t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment +t1 1 skr 1 a A # NULL NULL YES BTREE +drop table t1; +create table t1 (a int,b varchar(20),key(a)) engine=innodb; +insert into t1 values (1,""), (2,"testing"); +select * from t1 where a = 1; +a b +1 +drop table t1; +create table t1 (n int not null primary key) engine=innodb; +set autocommit=0; +insert into t1 values (4); +rollback; +select n, "after rollback" from t1; +n after rollback +insert into t1 values (4); +commit; +select n, "after commit" from t1; +n after commit +4 after commit +commit; +insert into t1 values (5); +insert into t1 values (4); +ERROR 23000: Duplicate entry '4' for key 1 +commit; +select n, "after commit" from t1; +n after commit +4 after commit +5 after commit +set autocommit=1; +insert into t1 values (6); +insert into t1 values (4); +ERROR 23000: Duplicate entry '4' for key 1 +select n from t1; +n +4 +5 +6 +rollback; +drop table t1; +create table t1 (n int not null primary key) engine=innodb; +start transaction; +insert into t1 values (4); +flush tables with read lock; +commit; +unlock tables; +commit; +select * from t1; +n +4 +drop table t1; +create table t1 ( id int NOT NULL PRIMARY KEY, nom varchar(64)) engine=innodb; +begin; +insert into t1 values(1,'hamdouni'); +select id as afterbegin_id,nom as afterbegin_nom from t1; +afterbegin_id afterbegin_nom +1 hamdouni +rollback; +select id as afterrollback_id,nom as afterrollback_nom from t1; +afterrollback_id afterrollback_nom +set autocommit=0; +insert into t1 values(2,'mysql'); +select id as afterautocommit0_id,nom as afterautocommit0_nom from t1; +afterautocommit0_id afterautocommit0_nom +2 mysql +rollback; +select id as afterrollback_id,nom as afterrollback_nom from t1; +afterrollback_id afterrollback_nom +set autocommit=1; +drop table t1; +CREATE TABLE t1 (id char(8) not null primary key, val int not null) engine=innodb; +insert into t1 values ('pippo', 12); +insert into t1 values ('pippo', 12); +ERROR 23000: Duplicate entry 'pippo' for key 1 +delete from t1; +delete from t1 where id = 'pippo'; +select * from t1; +id val +insert into t1 values ('pippo', 12); +set autocommit=0; +delete from t1; +rollback; +select * from t1; +id val +pippo 12 +delete from t1; +commit; +select * from t1; +id val +drop table t1; +create table t1 (a integer) engine=innodb; +start transaction; +rename table t1 to t2; +create table t1 (b integer) engine=innodb; +insert into t1 values (1); +rollback; +drop table t1; +rename table t2 to t1; +drop table t1; +set autocommit=1; +CREATE TABLE t1 (ID INTEGER NOT NULL PRIMARY KEY, NAME VARCHAR(64)) ENGINE=innodb; +INSERT INTO t1 VALUES (1, 'Jochen'); +select * from t1; +ID NAME +1 Jochen +drop table t1; +CREATE TABLE t1 ( _userid VARCHAR(60) NOT NULL PRIMARY KEY) ENGINE=innodb; +set autocommit=0; +INSERT INTO t1 SET _userid='marc@anyware.co.uk'; +COMMIT; +SELECT * FROM t1; +_userid +marc@anyware.co.uk +SELECT _userid FROM t1 WHERE _userid='marc@anyware.co.uk'; +_userid +marc@anyware.co.uk +drop table t1; +set autocommit=1; +CREATE TABLE t1 ( +user_id int(10) DEFAULT '0' NOT NULL, +name varchar(100), +phone varchar(100), +ref_email varchar(100) DEFAULT '' NOT NULL, +detail varchar(200), +PRIMARY KEY (user_id,ref_email) +)engine=innodb; +INSERT INTO t1 VALUES (10292,'sanjeev','29153373','sansh777@hotmail.com','xxx'),(10292,'shirish','2333604','shirish@yahoo.com','ddsds'),(10292,'sonali','323232','sonali@bolly.com','filmstar'); +select * from t1 where user_id=10292; +user_id name phone ref_email detail +10292 sanjeev 29153373 sansh777@hotmail.com xxx +10292 shirish 2333604 shirish@yahoo.com ddsds +10292 sonali 323232 sonali@bolly.com filmstar +INSERT INTO t1 VALUES (10291,'sanjeev','29153373','sansh777@hotmail.com','xxx'),(10293,'shirish','2333604','shirish@yahoo.com','ddsds'); +select * from t1 where user_id=10292; +user_id name phone ref_email detail +10292 sanjeev 29153373 sansh777@hotmail.com xxx +10292 shirish 2333604 shirish@yahoo.com ddsds +10292 sonali 323232 sonali@bolly.com filmstar +select * from t1 where user_id>=10292; +user_id name phone ref_email detail +10292 sanjeev 29153373 sansh777@hotmail.com xxx +10292 shirish 2333604 shirish@yahoo.com ddsds +10292 sonali 323232 sonali@bolly.com filmstar +10293 shirish 2333604 shirish@yahoo.com ddsds +select * from t1 where user_id>10292; +user_id name phone ref_email detail +10293 shirish 2333604 shirish@yahoo.com ddsds +select * from t1 where user_id<10292; +user_id name phone ref_email detail +10291 sanjeev 29153373 sansh777@hotmail.com xxx +drop table t1; +CREATE TABLE t1 (a int not null, b int not null,c int not null, +key(a),primary key(a,b), unique(c),key(a),unique(b)); +show index from t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment +t1 0 PRIMARY 1 a A # NULL NULL BTREE +t1 0 PRIMARY 2 b A # NULL NULL BTREE +t1 0 c 1 c A # NULL NULL BTREE +t1 0 b 1 b A # NULL NULL BTREE +t1 1 a 1 a A # NULL NULL BTREE +t1 1 a_2 1 a A # NULL NULL BTREE +drop table t1; +create table t1 (col1 int not null, col2 char(4) not null, primary key(col1)); +alter table t1 engine=innodb; +insert into t1 values ('1','1'),('5','2'),('2','3'),('3','4'),('4','4'); +select * from t1; +col1 col2 +1 1 +2 3 +3 4 +4 4 +5 2 +update t1 set col2='7' where col1='4'; +select * from t1; +col1 col2 +1 1 +2 3 +3 4 +4 7 +5 2 +alter table t1 add co3 int not null; +select * from t1; +col1 col2 co3 +1 1 0 +2 3 0 +3 4 0 +4 7 0 +5 2 0 +update t1 set col2='9' where col1='2'; +select * from t1; +col1 col2 co3 +1 1 0 +2 9 0 +3 4 0 +4 7 0 +5 2 0 +drop table t1; +create table t1 (a int not null , b int, primary key (a)) engine = innodb; +create table t2 (a int not null , b int, primary key (a)) engine = myisam; +insert into t1 VALUES (1,3) , (2,3), (3,3); +select * from t1; +a b +1 3 +2 3 +3 3 +insert into t2 select * from t1; +select * from t2; +a b +1 3 +2 3 +3 3 +delete from t1 where b = 3; +select * from t1; +a b +insert into t1 select * from t2; +select * from t1; +a b +1 3 +2 3 +3 3 +select * from t2; +a b +1 3 +2 3 +3 3 +drop table t1,t2; +CREATE TABLE t1 ( +id int(11) NOT NULL auto_increment, +ggid varchar(32) binary DEFAULT '' NOT NULL, +email varchar(64) DEFAULT '' NOT NULL, +passwd varchar(32) binary DEFAULT '' NOT NULL, +PRIMARY KEY (id), +UNIQUE ggid (ggid) +) ENGINE=innodb; +insert into t1 (ggid,passwd) values ('test1','xxx'); +insert into t1 (ggid,passwd) values ('test2','yyy'); +insert into t1 (ggid,passwd) values ('test2','this will fail'); +ERROR 23000: Duplicate entry 'test2' for key 2 +insert into t1 (ggid,id) values ('this will fail',1); +ERROR 23000: Duplicate entry '1' for key 1 +select * from t1 where ggid='test1'; +id ggid email passwd +1 test1 xxx +select * from t1 where passwd='xxx'; +id ggid email passwd +1 test1 xxx +select * from t1 where id=2; +id ggid email passwd +2 test2 yyy +replace into t1 (ggid,id) values ('this will work',1); +replace into t1 (ggid,passwd) values ('test2','this will work'); +update t1 set id=100,ggid='test2' where id=1; +ERROR 23000: Duplicate entry 'test2' for key 2 +select * from t1; +id ggid email passwd +1 this will work +3 test2 this will work +select * from t1 where id=1; +id ggid email passwd +1 this will work +select * from t1 where id=999; +id ggid email passwd +drop table t1; +CREATE TABLE t1 ( +user_name varchar(12), +password text, +subscribed char(1), +user_id int(11) DEFAULT '0' NOT NULL, +quota bigint(20), +weight double, +access_date date, +access_time time, +approved datetime, +dummy_primary_key int(11) NOT NULL auto_increment, +PRIMARY KEY (dummy_primary_key) +) ENGINE=innodb; +INSERT INTO t1 VALUES ('user_0','somepassword','N',0,0,0,'2000-09-07','23:06:59','2000-09-07 23:06:59',1); +INSERT INTO t1 VALUES ('user_1','somepassword','Y',1,1,1,'2000-09-07','23:06:59','2000-09-07 23:06:59',2); +INSERT INTO t1 VALUES ('user_2','somepassword','N',2,2,1.4142135623731,'2000-09-07','23:06:59','2000-09-07 23:06:59',3); +INSERT INTO t1 VALUES ('user_3','somepassword','Y',3,3,1.7320508075689,'2000-09-07','23:06:59','2000-09-07 23:06:59',4); +INSERT INTO t1 VALUES ('user_4','somepassword','N',4,4,2,'2000-09-07','23:06:59','2000-09-07 23:06:59',5); +select user_name, password , subscribed, user_id, quota, weight, access_date, access_time, approved, dummy_primary_key from t1 order by user_name; +user_name password subscribed user_id quota weight access_date access_time approved dummy_primary_key +user_0 somepassword N 0 0 0 2000-09-07 23:06:59 2000-09-07 23:06:59 1 +user_1 somepassword Y 1 1 1 2000-09-07 23:06:59 2000-09-07 23:06:59 2 +user_2 somepassword N 2 2 1.4142135623731 2000-09-07 23:06:59 2000-09-07 23:06:59 3 +user_3 somepassword Y 3 3 1.7320508075689 2000-09-07 23:06:59 2000-09-07 23:06:59 4 +user_4 somepassword N 4 4 2 2000-09-07 23:06:59 2000-09-07 23:06:59 5 +drop table t1; +CREATE TABLE t1 ( +id int(11) NOT NULL auto_increment, +parent_id int(11) DEFAULT '0' NOT NULL, +level tinyint(4) DEFAULT '0' NOT NULL, +KEY (id), +KEY parent_id (parent_id), +KEY level (level) +) engine=innodb; +INSERT INTO t1 VALUES (1,0,0),(3,1,1),(4,1,1),(8,2,2),(9,2,2),(17,3,2),(22,4,2),(24,4,2),(28,5,2),(29,5,2),(30,5,2),(31,6,2),(32,6,2),(33,6,2),(203,7,2),(202,7,2),(20,3,2),(157,0,0),(193,5,2),(40,7,2),(2,1,1),(15,2,2),(6,1,1),(34,6,2),(35,6,2),(16,3,2),(7,1,1),(36,7,2),(18,3,2),(26,5,2),(27,5,2),(183,4,2),(38,7,2),(25,5,2),(37,7,2),(21,4,2),(19,3,2),(5,1,1); +INSERT INTO t1 values (179,5,2); +update t1 set parent_id=parent_id+100; +select * from t1 where parent_id=102; +id parent_id level +8 102 2 +9 102 2 +15 102 2 +update t1 set id=id+1000; +update t1 set id=1024 where id=1009; +select * from t1; +id parent_id level +1001 100 0 +1003 101 1 +1004 101 1 +1008 102 2 +1024 102 2 +1017 103 2 +1022 104 2 +1024 104 2 +1028 105 2 +1029 105 2 +1030 105 2 +1031 106 2 +1032 106 2 +1033 106 2 +1203 107 2 +1202 107 2 +1020 103 2 +1157 100 0 +1193 105 2 +1040 107 2 +1002 101 1 +1015 102 2 +1006 101 1 +1034 106 2 +1035 106 2 +1016 103 2 +1007 101 1 +1036 107 2 +1018 103 2 +1026 105 2 +1027 105 2 +1183 104 2 +1038 107 2 +1025 105 2 +1037 107 2 +1021 104 2 +1019 103 2 +1005 101 1 +1179 105 2 +update ignore t1 set id=id+1; +select * from t1; +id parent_id level +1002 100 0 +1004 101 1 +1005 101 1 +1009 102 2 +1025 102 2 +1018 103 2 +1023 104 2 +1025 104 2 +1029 105 2 +1030 105 2 +1031 105 2 +1032 106 2 +1033 106 2 +1034 106 2 +1204 107 2 +1203 107 2 +1021 103 2 +1158 100 0 +1194 105 2 +1041 107 2 +1003 101 1 +1016 102 2 +1007 101 1 +1035 106 2 +1036 106 2 +1017 103 2 +1008 101 1 +1037 107 2 +1019 103 2 +1027 105 2 +1028 105 2 +1184 104 2 +1039 107 2 +1026 105 2 +1038 107 2 +1022 104 2 +1020 103 2 +1006 101 1 +1180 105 2 +update ignore t1 set id=1023 where id=1010; +select * from t1 where parent_id=102; +id parent_id level +1009 102 2 +1025 102 2 +1016 102 2 +explain select level from t1 where level=1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref level level 1 const # Using where; Using index +select level,id from t1 where level=1; +level id +1 1004 +1 1005 +1 1003 +1 1007 +1 1008 +1 1006 +select level,id,parent_id from t1 where level=1; +level id parent_id +1 1004 101 +1 1005 101 +1 1003 101 +1 1007 101 +1 1008 101 +1 1006 101 +select level,id from t1 where level=1 order by id; +level id +1 1003 +1 1004 +1 1005 +1 1006 +1 1007 +1 1008 +delete from t1 where level=1; +select * from t1; +id parent_id level +1002 100 0 +1009 102 2 +1025 102 2 +1018 103 2 +1023 104 2 +1025 104 2 +1029 105 2 +1030 105 2 +1031 105 2 +1032 106 2 +1033 106 2 +1034 106 2 +1204 107 2 +1203 107 2 +1021 103 2 +1158 100 0 +1194 105 2 +1041 107 2 +1016 102 2 +1035 106 2 +1036 106 2 +1017 103 2 +1037 107 2 +1019 103 2 +1027 105 2 +1028 105 2 +1184 104 2 +1039 107 2 +1026 105 2 +1038 107 2 +1022 104 2 +1020 103 2 +1180 105 2 +drop table t1; +CREATE TABLE t1 ( +sca_code char(6) NOT NULL, +cat_code char(6) NOT NULL, +sca_desc varchar(50), +lan_code char(2) NOT NULL, +sca_pic varchar(100), +sca_sdesc varchar(50), +sca_sch_desc varchar(16), +PRIMARY KEY (sca_code, cat_code, lan_code), +INDEX sca_pic (sca_pic) +) engine = innodb ; +INSERT INTO t1 ( sca_code, cat_code, sca_desc, lan_code, sca_pic, sca_sdesc, sca_sch_desc) VALUES ( 'PD', 'J', 'PENDANT', 'EN', NULL, NULL, 'PENDANT'),( 'RI', 'J', 'RING', 'EN', NULL, NULL, 'RING'),( 'QQ', 'N', 'RING', 'EN', 'not null', NULL, 'RING'); +select count(*) from t1 where sca_code = 'PD'; +count(*) +1 +select count(*) from t1 where sca_code <= 'PD'; +count(*) +1 +select count(*) from t1 where sca_pic is null; +count(*) +2 +alter table t1 drop index sca_pic, add index sca_pic (cat_code, sca_pic); +select count(*) from t1 where sca_code='PD' and sca_pic is null; +count(*) +1 +select count(*) from t1 where cat_code='E'; +count(*) +0 +alter table t1 drop index sca_pic, add index (sca_pic, cat_code); +select count(*) from t1 where sca_code='PD' and sca_pic is null; +count(*) +1 +select count(*) from t1 where sca_pic >= 'n'; +count(*) +1 +select sca_pic from t1 where sca_pic is null; +sca_pic +NULL +NULL +update t1 set sca_pic="test" where sca_pic is null; +delete from t1 where sca_code='pd'; +drop table t1; +set @a:=now(); +CREATE TABLE t1 (a int not null, b timestamp not null, primary key (a)) engine=innodb; +insert into t1 (a) values(1),(2),(3); +select t1.a from t1 natural join t1 as t2 where t1.b >= @a order by t1.a; +a +1 +2 +3 +update t1 set a=5 where a=1; +select a from t1; +a +2 +3 +5 +drop table t1; +create table t1 (a varchar(100) not null, primary key(a), b int not null) engine=innodb; +insert into t1 values("hello",1),("world",2); +select * from t1 order by b desc; +a b +world 2 +hello 1 +optimize table t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +show keys from t1; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment +t1 0 PRIMARY 1 a A # NULL NULL BTREE +drop table t1; +create table t1 (i int, j int ) ENGINE=innodb; +insert into t1 values (1,2); +select * from t1 where i=1 and j=2; +i j +1 2 +create index ax1 on t1 (i,j); +select * from t1 where i=1 and j=2; +i j +1 2 +drop table t1; +CREATE TABLE t1 ( +a int3 unsigned NOT NULL, +b int1 unsigned NOT NULL, +UNIQUE (a, b) +) ENGINE = innodb; +INSERT INTO t1 VALUES (1, 1); +SELECT MIN(B),MAX(b) FROM t1 WHERE t1.a = 1; +MIN(B) MAX(b) +1 1 +drop table t1; +CREATE TABLE t1 (a int unsigned NOT NULL) engine=innodb; +INSERT INTO t1 VALUES (1); +SELECT * FROM t1; +a +1 +DROP TABLE t1; +create table t1 (a int primary key,b int, c int, d int, e int, f int, g int, h int, i int, j int, k int, l int, m int, n int, o int, p int, q int, r int, s int, t int, u int, v int, w int, x int, y int, z int, a1 int, a2 int, a3 int, a4 int, a5 int, a6 int, a7 int, a8 int, a9 int, b1 int, b2 int, b3 int, b4 int, b5 int, b6 int) engine = innodb; +insert into t1 values (1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1); +explain select * from t1 where a > 0 and a < 50; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL # Using where +drop table t1; +create table t1 (id int NOT NULL,id2 int NOT NULL,id3 int NOT NULL,dummy1 char(30),primary key (id,id2),index index_id3 (id3)) engine=innodb; +insert into t1 values (0,0,0,'ABCDEFGHIJ'),(2,2,2,'BCDEFGHIJK'),(1,1,1,'CDEFGHIJKL'); +LOCK TABLES t1 WRITE; +insert into t1 values (99,1,2,'D'),(1,1,2,'D'); +ERROR 23000: Duplicate entry '1-1' for key 1 +select id from t1; +id +0 +1 +2 +select id from t1; +id +0 +1 +2 +UNLOCK TABLES; +DROP TABLE t1; +create table t1 (id int NOT NULL,id2 int NOT NULL,id3 int NOT NULL,dummy1 char(30),primary key (id,id2),index index_id3 (id3)) engine=innodb; +insert into t1 values (0,0,0,'ABCDEFGHIJ'),(2,2,2,'BCDEFGHIJK'),(1,1,1,'CDEFGHIJKL'); +LOCK TABLES t1 WRITE; +begin; +insert into t1 values (99,1,2,'D'),(1,1,2,'D'); +ERROR 23000: Duplicate entry '1-1' for key 1 +select id from t1; +id +0 +1 +2 +insert ignore into t1 values (100,1,2,'D'),(1,1,99,'D'); +commit; +select id,id3 from t1; +id id3 +0 0 +1 1 +2 2 +100 2 +UNLOCK TABLES; +DROP TABLE t1; +create table t1 (a char(20), unique (a(5))) engine=innodb; +drop table t1; +create table t1 (a char(20), index (a(5))) engine=innodb; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` char(20) default NULL, + KEY `a` (`a`(5)) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t1; +create temporary table t1 (a int not null auto_increment, primary key(a)) engine=innodb; +insert into t1 values (NULL),(NULL),(NULL); +delete from t1 where a=3; +insert into t1 values (NULL); +select * from t1; +a +1 +2 +4 +alter table t1 add b int; +select * from t1; +a b +1 NULL +2 NULL +4 NULL +drop table t1; +create table t1 +( +id int auto_increment primary key, +name varchar(32) not null, +value text not null, +uid int not null, +unique key(name,uid) +) engine=innodb; +insert into t1 values (1,'one','one value',101), +(2,'two','two value',102),(3,'three','three value',103); +set insert_id=5; +replace into t1 (value,name,uid) values ('other value','two',102); +delete from t1 where uid=102; +set insert_id=5; +replace into t1 (value,name,uid) values ('other value','two',102); +set insert_id=6; +replace into t1 (value,name,uid) values ('other value','two',102); +select * from t1; +id name value uid +1 one one value 101 +3 three three value 103 +6 two other value 102 +drop table t1; +create database mysqltest; +create table mysqltest.t1 (a int not null) engine= innodb; +insert into mysqltest.t1 values(1); +create table mysqltest.t2 (a int not null) engine= myisam; +insert into mysqltest.t2 values(1); +create table mysqltest.t3 (a int not null) engine= heap; +insert into mysqltest.t3 values(1); +commit; +drop database mysqltest; +show tables from mysqltest; +Got one of the listed errors +set autocommit=0; +create table t1 (a int not null) engine= innodb; +insert into t1 values(1),(2); +truncate table t1; +ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction +commit; +truncate table t1; +select * from t1; +a +insert into t1 values(1),(2); +delete from t1; +select * from t1; +a +commit; +drop table t1; +set autocommit=1; +create table t1 (a int not null) engine= innodb; +insert into t1 values(1),(2); +truncate table t1; +insert into t1 values(1),(2); +select * from t1; +a +1 +2 +truncate table t1; +insert into t1 values(1),(2); +delete from t1; +select * from t1; +a +drop table t1; +create table t1 (a int not null, b int not null, c int not null, primary key (a),key(b)) engine=innodb; +insert into t1 values (3,3,3),(1,1,1),(2,2,2),(4,4,4); +explain select * from t1 order by a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL PRIMARY 4 NULL # +explain select * from t1 order by b; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL b 4 NULL # +explain select * from t1 order by c; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL # Using filesort +explain select a from t1 order by a; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL PRIMARY 4 NULL # Using index +explain select b from t1 order by b; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL b 4 NULL # Using index +explain select a,b from t1 order by b; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL b 4 NULL # Using index +explain select a,b from t1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL b 4 NULL # Using index +explain select a,b,c from t1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL # +drop table t1; +create table t1 (t int not null default 1, key (t)) engine=innodb; +desc t1; +Field Type Null Key Default Extra +t int(11) MUL 1 +drop table t1; +CREATE TABLE t1 ( +number bigint(20) NOT NULL default '0', +cname char(15) NOT NULL default '', +carrier_id smallint(6) NOT NULL default '0', +privacy tinyint(4) NOT NULL default '0', +last_mod_date timestamp(14) NOT NULL, +last_mod_id smallint(6) NOT NULL default '0', +last_app_date timestamp(14) NOT NULL, +last_app_id smallint(6) default '-1', +version smallint(6) NOT NULL default '0', +assigned_scps int(11) default '0', +status tinyint(4) default '0' +) ENGINE=InnoDB; +INSERT INTO t1 VALUES (4077711111,'SeanWheeler',90,2,20020111112846,500,00000000000000,-1,2,3,1); +INSERT INTO t1 VALUES (9197722223,'berry',90,3,20020111112809,500,20020102114532,501,4,10,0); +INSERT INTO t1 VALUES (650,'San Francisco',0,0,20011227111336,342,00000000000000,-1,1,24,1); +INSERT INTO t1 VALUES (302467,'Sue\'s Subshop',90,3,20020109113241,500,20020102115111,501,7,24,0); +INSERT INTO t1 VALUES (6014911113,'SudzCarwash',520,1,20020102115234,500,20020102115259,501,33,32768,0); +INSERT INTO t1 VALUES (333,'tubs',99,2,20020109113440,501,20020109113440,500,3,10,0); +CREATE TABLE t2 ( +number bigint(20) NOT NULL default '0', +cname char(15) NOT NULL default '', +carrier_id smallint(6) NOT NULL default '0', +privacy tinyint(4) NOT NULL default '0', +last_mod_date timestamp(14) NOT NULL, +last_mod_id smallint(6) NOT NULL default '0', +last_app_date timestamp(14) NOT NULL, +last_app_id smallint(6) default '-1', +version smallint(6) NOT NULL default '0', +assigned_scps int(11) default '0', +status tinyint(4) default '0' +) ENGINE=InnoDB; +INSERT INTO t2 VALUES (4077711111,'SeanWheeler',0,2,20020111112853,500,00000000000000,-1,2,3,1); +INSERT INTO t2 VALUES (9197722223,'berry',90,3,20020111112818,500,20020102114532,501,4,10,0); +INSERT INTO t2 VALUES (650,'San Francisco',90,0,20020109113158,342,00000000000000,-1,1,24,1); +INSERT INTO t2 VALUES (333,'tubs',99,2,20020109113453,501,20020109113453,500,3,10,0); +select * from t1; +number cname carrier_id privacy last_mod_date last_mod_id last_app_date last_app_id version assigned_scps status +4077711111 SeanWheeler 90 2 2002-01-11 11:28:46 500 0000-00-00 00:00:00 -1 2 3 1 +9197722223 berry 90 3 2002-01-11 11:28:09 500 2002-01-02 11:45:32 501 4 10 0 +650 San Francisco 0 0 2001-12-27 11:13:36 342 0000-00-00 00:00:00 -1 1 24 1 +302467 Sue's Subshop 90 3 2002-01-09 11:32:41 500 2002-01-02 11:51:11 501 7 24 0 +6014911113 SudzCarwash 520 1 2002-01-02 11:52:34 500 2002-01-02 11:52:59 501 33 32768 0 +333 tubs 99 2 2002-01-09 11:34:40 501 2002-01-09 11:34:40 500 3 10 0 +select * from t2; +number cname carrier_id privacy last_mod_date last_mod_id last_app_date last_app_id version assigned_scps status +4077711111 SeanWheeler 0 2 2002-01-11 11:28:53 500 0000-00-00 00:00:00 -1 2 3 1 +9197722223 berry 90 3 2002-01-11 11:28:18 500 2002-01-02 11:45:32 501 4 10 0 +650 San Francisco 90 0 2002-01-09 11:31:58 342 0000-00-00 00:00:00 -1 1 24 1 +333 tubs 99 2 2002-01-09 11:34:53 501 2002-01-09 11:34:53 500 3 10 0 +delete t1, t2 from t1 left join t2 on t1.number=t2.number where (t1.carrier_id=90 and t1.number=t2.number) or (t2.carrier_id=90 and t1.number=t2.number) or (t1.carrier_id=90 and t2.number is null); +select * from t1; +number cname carrier_id privacy last_mod_date last_mod_id last_app_date last_app_id version assigned_scps status +6014911113 SudzCarwash 520 1 2002-01-02 11:52:34 500 2002-01-02 11:52:59 501 33 32768 0 +333 tubs 99 2 2002-01-09 11:34:40 501 2002-01-09 11:34:40 500 3 10 0 +select * from t2; +number cname carrier_id privacy last_mod_date last_mod_id last_app_date last_app_id version assigned_scps status +333 tubs 99 2 2002-01-09 11:34:53 501 2002-01-09 11:34:53 500 3 10 0 +select * from t2; +number cname carrier_id privacy last_mod_date last_mod_id last_app_date last_app_id version assigned_scps status +333 tubs 99 2 2002-01-09 11:34:53 501 2002-01-09 11:34:53 500 3 10 0 +drop table t1,t2; +create table t1 (id int unsigned not null auto_increment, code tinyint unsigned not null, name char(20) not null, primary key (id), key (code), unique (name)) engine=innodb; +BEGIN; +SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE; +SELECT @@tx_isolation,@@global.tx_isolation; +@@tx_isolation @@global.tx_isolation +SERIALIZABLE REPEATABLE-READ +insert into t1 (code, name) values (1, 'Tim'), (1, 'Monty'), (2, 'David'); +select id, code, name from t1 order by id; +id code name +1 1 Tim +2 1 Monty +3 2 David +COMMIT; +BEGIN; +SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ; +insert into t1 (code, name) values (2, 'Erik'), (3, 'Sasha'); +select id, code, name from t1 order by id; +id code name +1 1 Tim +2 1 Monty +3 2 David +4 2 Erik +5 3 Sasha +COMMIT; +BEGIN; +SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; +insert into t1 (code, name) values (3, 'Jeremy'), (4, 'Matt'); +select id, code, name from t1 order by id; +id code name +1 1 Tim +2 1 Monty +3 2 David +4 2 Erik +5 3 Sasha +6 3 Jeremy +7 4 Matt +COMMIT; +DROP TABLE t1; +create table t1 (n int(10), d int(10)) engine=innodb; +create table t2 (n int(10), d int(10)) engine=innodb; +insert into t1 values(1,1),(1,2); +insert into t2 values(1,10),(2,20); +UPDATE t1,t2 SET t1.d=t2.d,t2.d=30 WHERE t1.n=t2.n; +select * from t1; +n d +1 10 +1 10 +select * from t2; +n d +1 30 +2 20 +drop table t1,t2; +create table t1 (a int, b int) engine=innodb; +insert into t1 values(20,null); +select t2.b, ifnull(t2.b,"this is null") from t1 as t2 left join t1 as t3 on +t2.b=t3.a; +b ifnull(t2.b,"this is null") +NULL this is null +select t2.b, ifnull(t2.b,"this is null") from t1 as t2 left join t1 as t3 on +t2.b=t3.a order by 1; +b ifnull(t2.b,"this is null") +NULL this is null +insert into t1 values(10,null); +select t2.b, ifnull(t2.b,"this is null") from t1 as t2 left join t1 as t3 on +t2.b=t3.a order by 1; +b ifnull(t2.b,"this is null") +NULL this is null +NULL this is null +drop table t1; +create table t1 (a varchar(10) not null) engine=myisam; +create table t2 (b varchar(10) not null unique) engine=innodb; +select t1.a from t1,t2 where t1.a=t2.b; +a +drop table t1,t2; +create table t1 (a int not null, b int, primary key (a)) engine = innodb; +create table t2 (a int not null, b int, primary key (a)) engine = innodb; +insert into t1 values (10, 20); +insert into t2 values (10, 20); +update t1, t2 set t1.b = 150, t2.b = t1.b where t2.a = t1.a and t1.a = 10; +drop table t1,t2; +CREATE TABLE t1 (id INT NOT NULL, PRIMARY KEY (id)) ENGINE=INNODB; +CREATE TABLE t2 (id INT PRIMARY KEY, t1_id INT, INDEX par_ind (t1_id), FOREIGN KEY (t1_id) REFERENCES t1(id) ON DELETE CASCADE ) ENGINE=INNODB; +insert into t1 set id=1; +insert into t2 set id=1, t1_id=1; +delete t1,t2 from t1,t2 where t1.id=t2.t1_id; +select * from t1; +id +select * from t2; +id t1_id +drop table t2,t1; +CREATE TABLE t1(id INT NOT NULL, PRIMARY KEY (id)) ENGINE=INNODB; +CREATE TABLE t2(id INT PRIMARY KEY, t1_id INT, INDEX par_ind (t1_id) ) ENGINE=INNODB; +INSERT INTO t1 VALUES(1); +INSERT INTO t2 VALUES(1, 1); +SELECT * from t1; +id +1 +UPDATE t1,t2 SET t1.id=t1.id+1, t2.t1_id=t1.id+1; +SELECT * from t1; +id +2 +UPDATE t1,t2 SET t1.id=t1.id+1 where t1.id!=t2.id; +SELECT * from t1; +id +3 +DROP TABLE t1,t2; +set autocommit=0; +CREATE TABLE t1 (id CHAR(15) NOT NULL, value CHAR(40) NOT NULL, PRIMARY KEY(id)) ENGINE=InnoDB; +CREATE TABLE t2 (id CHAR(15) NOT NULL, value CHAR(40) NOT NULL, PRIMARY KEY(id)) ENGINE=InnoDB; +CREATE TABLE t3 (id1 CHAR(15) NOT NULL, id2 CHAR(15) NOT NULL, PRIMARY KEY(id1, id2)) ENGINE=InnoDB; +INSERT INTO t3 VALUES("my-test-1", "my-test-2"); +COMMIT; +INSERT INTO t1 VALUES("this-key", "will disappear"); +INSERT INTO t2 VALUES("this-key", "will also disappear"); +DELETE FROM t3 WHERE id1="my-test-1"; +SELECT * FROM t1; +id value +this-key will disappear +SELECT * FROM t2; +id value +this-key will also disappear +SELECT * FROM t3; +id1 id2 +ROLLBACK; +SELECT * FROM t1; +id value +SELECT * FROM t2; +id value +SELECT * FROM t3; +id1 id2 +my-test-1 my-test-2 +SELECT * FROM t3 WHERE id1="my-test-1" LOCK IN SHARE MODE; +id1 id2 +my-test-1 my-test-2 +COMMIT; +set autocommit=1; +DROP TABLE t1,t2,t3; +CREATE TABLE t1 (a int not null primary key, b int not null, unique (b)) engine=innodb; +INSERT INTO t1 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9); +UPDATE t1 set a=a+100 where b between 2 and 3 and a < 1000; +SELECT * from t1; +a b +1 1 +102 2 +103 3 +4 4 +5 5 +6 6 +7 7 +8 8 +9 9 +drop table t1; +CREATE TABLE t1 (a int not null primary key, b int not null, key (b)) engine=innodb; +CREATE TABLE t2 (a int not null primary key, b int not null, key (b)) engine=innodb; +INSERT INTO t1 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9),(10,10),(11,11),(12,12); +INSERT INTO t2 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9); +update t1,t2 set t1.a=t1.a+100; +select * from t1; +a b +101 1 +102 2 +103 3 +104 4 +105 5 +106 6 +107 7 +108 8 +109 9 +110 10 +111 11 +112 12 +update t1,t2 set t1.a=t1.a+100 where t1.a=101; +select * from t1; +a b +201 1 +102 2 +103 3 +104 4 +105 5 +106 6 +107 7 +108 8 +109 9 +110 10 +111 11 +112 12 +update t1,t2 set t1.b=t1.b+10 where t1.b=2; +select * from t1; +a b +201 1 +103 3 +104 4 +105 5 +106 6 +107 7 +108 8 +109 9 +110 10 +111 11 +102 12 +112 12 +update t1,t2 set t1.b=t1.b+2,t2.b=t1.b+10 where t1.b between 3 and 5 and t1.a=t2.a+100; +select * from t1; +a b +201 1 +103 5 +104 6 +106 6 +105 7 +107 7 +108 8 +109 9 +110 10 +111 11 +102 12 +112 12 +select * from t2; +a b +1 1 +2 2 +6 6 +7 7 +8 8 +9 9 +3 13 +4 14 +5 15 +drop table t1,t2; +CREATE TABLE t2 ( NEXT_T BIGINT NOT NULL PRIMARY KEY) ENGINE=MyISAM; +CREATE TABLE t1 ( B_ID INTEGER NOT NULL PRIMARY KEY) ENGINE=InnoDB; +SET AUTOCOMMIT=0; +INSERT INTO t1 ( B_ID ) VALUES ( 1 ); +INSERT INTO t2 ( NEXT_T ) VALUES ( 1 ); +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +SELECT * FROM t1; +B_ID +drop table t1,t2; +create table t1 ( pk int primary key, parent int not null, child int not null, index (parent) ) engine = innodb; +insert into t1 values (1,0,4), (2,1,3), (3,2,1), (4,1,2); +select distinct parent,child from t1 order by parent; +parent child +0 4 +1 2 +1 3 +2 1 +drop table t1; +create table t1 (a int not null auto_increment primary key, b int, c int, key(c)) engine=innodb; +create table t2 (a int not null auto_increment primary key, b int); +insert into t1 (b) values (null),(null),(null),(null),(null),(null),(null); +insert into t2 (a) select b from t1; +insert into t1 (b) select b from t2; +insert into t2 (a) select b from t1; +insert into t1 (a) select b from t2; +insert into t2 (a) select b from t1; +insert into t1 (a) select b from t2; +insert into t2 (a) select b from t1; +insert into t1 (a) select b from t2; +insert into t2 (a) select b from t1; +insert into t1 (a) select b from t2; +insert into t2 (a) select b from t1; +insert into t1 (a) select b from t2; +insert into t2 (a) select b from t1; +insert into t1 (a) select b from t2; +insert into t2 (a) select b from t1; +insert into t1 (a) select b from t2; +insert into t2 (a) select b from t1; +insert into t1 (a) select b from t2; +select count(*) from t1; +count(*) +29267 +explain select * from t1 where c between 1 and 10000; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range c c 5 NULL # Using where +update t1 set c=a; +explain select * from t1 where c between 1 and 10000; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL c NULL NULL NULL # Using where +drop table t1,t2; +create table t1 (id int primary key auto_increment, fk int, index index_fk (fk)) engine=innodb; +insert into t1 (id) values (null),(null),(null),(null),(null); +update t1 set fk=69 where fk is null order by id limit 1; +SELECT * from t1; +id fk +2 NULL +3 NULL +4 NULL +5 NULL +1 69 +drop table t1; +create table t1 (a int not null, b int not null, key (a)); +insert into t1 values (1,1),(1,2),(1,3),(3,1),(3,2),(3,3),(3,1),(3,2),(3,3),(2,1),(2,2),(2,3); +SET @tmp=0; +update t1 set b=(@tmp:=@tmp+1) order by a; +update t1 set b=99 where a=1 order by b asc limit 1; +update t1 set b=100 where a=1 order by b desc limit 2; +update t1 set a=a+10+b where a=1 order by b; +select * from t1 order by a,b; +a b +2 4 +2 5 +2 6 +3 7 +3 8 +3 9 +3 10 +3 11 +3 12 +13 2 +111 100 +111 100 +drop table t1; +create table t1 ( c char(8) not null ) engine=innodb; +insert into t1 values ('0'),('1'),('2'),('3'),('4'),('5'),('6'),('7'),('8'),('9'); +insert into t1 values ('A'),('B'),('C'),('D'),('E'),('F'); +alter table t1 add b char(8) not null; +alter table t1 add a char(8) not null; +alter table t1 add primary key (a,b,c); +update t1 set a=c, b=c; +create table t2 (c char(8) not null, b char(8) not null, a char(8) not null, primary key(a,b,c)) engine=innodb; +insert into t2 select * from t1; +delete t1,t2 from t2,t1 where t1.a<'B' and t2.b=t1.b; +drop table t1,t2; +SET AUTOCOMMIT=1; +create table t1 (a integer auto_increment primary key) engine=innodb; +insert into t1 (a) values (NULL),(NULL); +truncate table t1; +insert into t1 (a) values (NULL),(NULL); +SELECT * from t1; +a +3 +4 +drop table t1; +CREATE TABLE t1 (`id 1` INT NOT NULL, PRIMARY KEY (`id 1`)) ENGINE=INNODB; +CREATE TABLE t2 (id INT PRIMARY KEY, t1_id INT, INDEX par_ind (t1_id), FOREIGN KEY (`t1_id`) REFERENCES `t1`(`id 1`) ON DELETE CASCADE ) ENGINE=INNODB; +drop table t2,t1; +create table `t1` (`id` int( 11 ) not null ,primary key ( `id` )) engine = innodb; +insert into `t1`values ( 1 ) ; +create table `t2` (`id` int( 11 ) not null default '0',unique key `id` ( `id` ) ,constraint `t1_id_fk` foreign key ( `id` ) references `t1` (`id` )) engine = innodb; +insert into `t2`values ( 1 ) ; +create table `t3` (`id` int( 11 ) not null default '0',key `id` ( `id` ) ,constraint `t2_id_fk` foreign key ( `id` ) references `t2` (`id` )) engine = innodb; +insert into `t3`values ( 1 ) ; +delete t3,t2,t1 from t1,t2,t3 where t1.id =1 and t2.id = t1.id and t3.id = t2.id; +ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails +update t1,t2,t3 set t3.id=5, t2.id=6, t1.id=7 where t1.id =1 and t2.id = t1.id and t3.id = t2.id; +ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails +update t3 set t3.id=7 where t1.id =1 and t2.id = t1.id and t3.id = t2.id; +ERROR 42S02: Unknown table 't1' in where clause +drop table t3,t2,t1; +create table t1( +id int primary key, +pid int, +index(pid), +foreign key(pid) references t1(id) on delete cascade) engine=innodb; +insert into t1 values(0,0),(1,0),(2,1),(3,2),(4,3),(5,4),(6,5),(7,6), +(8,7),(9,8),(10,9),(11,10),(12,11),(13,12),(14,13),(15,14); +delete from t1 where id=0; +ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails +delete from t1 where id=15; +delete from t1 where id=0; +drop table t1; +CREATE TABLE t1 (col1 int(1))ENGINE=InnoDB; +CREATE TABLE t2 (col1 int(1),stamp TIMESTAMP,INDEX stamp_idx +(stamp))ENGINE=InnoDB; +insert into t1 values (1),(2),(3); +insert into t2 values (1, 20020204130000),(2, 20020204130000),(4,20020204310000 ),(5,20020204230000); +Warnings: +Warning 1265 Data truncated for column 'stamp' at row 3 +SELECT col1 FROM t1 UNION SELECT col1 FROM t2 WHERE stamp < +'20020204120000' GROUP BY col1; +col1 +1 +2 +3 +4 +drop table t1,t2; +CREATE TABLE t1 ( +`id` int(10) unsigned NOT NULL auto_increment, +`id_object` int(10) unsigned default '0', +`id_version` int(10) unsigned NOT NULL default '1', +label varchar(100) NOT NULL default '', +`description` text, +PRIMARY KEY (`id`), +KEY `id_object` (`id_object`), +KEY `id_version` (`id_version`) +) ENGINE=InnoDB; +INSERT INTO t1 VALUES("6", "3382", "9", "Test", NULL), ("7", "102", "5", "Le Pekin (Test)", NULL),("584", "1794", "4", "Test de resto", NULL),("837", "1822", "6", "Test 3", NULL),("1119", "3524", "1", "Societe Test", NULL),("1122", "3525", "1", "Fournisseur Test", NULL); +CREATE TABLE t2 ( +`id` int(10) unsigned NOT NULL auto_increment, +`id_version` int(10) unsigned NOT NULL default '1', +PRIMARY KEY (`id`), +KEY `id_version` (`id_version`) +) ENGINE=InnoDB; +INSERT INTO t2 VALUES("3524", "1"),("3525", "1"),("1794", "4"),("102", "5"),("1822", "6"),("3382", "9"); +SELECT t2.id, t1.label FROM t2 INNER JOIN +(SELECT t1.id_object as id_object FROM t1 WHERE t1.label LIKE '%test%') AS lbl +ON (t2.id = lbl.id_object) INNER JOIN t1 ON (t2.id = t1.id_object); +id label +3382 Test +102 Le Pekin (Test) +1794 Test de resto +1822 Test 3 +3524 Societe Test +3525 Fournisseur Test +drop table t1,t2; +create table t1 (c1 char(5) unique not null, c2 int, stamp timestamp) engine=innodb; +select * from t1; +c1 c2 stamp +replace delayed into t1 (c1, c2) values ( "text1","11"),( "text2","12"); +select * from t1; +c1 c2 stamp +text1 11 2004-12-01 13:23:14 +text2 12 2004-12-01 13:23:14 +replace delayed into t1 (c1, c2) values ( "text1","12"),( "text2","13"),( "text3","14", "a" ),( "text4","15", "b" ); +ERROR 21S01: Column count doesn't match value count at row 3 +select * from t1; +c1 c2 stamp +text1 11 2004-12-01 13:23:14 +text2 12 2004-12-01 13:23:14 +drop table t1; +create table t1 (a int, b varchar(200), c text not null) checksum=1 engine=myisam; +create table t2 (a int, b varchar(200), c text not null) checksum=0 engine=innodb; +create table t3 (a int, b varchar(200), c text not null) checksum=1 engine=innodb; +insert t1 values (1, "aaa", "bbb"), (NULL, "", "ccccc"), (0, NULL, ""); +insert t2 select * from t1; +insert t3 select * from t1; +checksum table t1, t2, t3, t4 quick; +Table Checksum +test.t1 968604391 +test.t2 NULL +test.t3 NULL +test.t4 NULL +checksum table t1, t2, t3, t4; +Table Checksum +test.t1 968604391 +test.t2 968604391 +test.t3 968604391 +test.t4 NULL +checksum table t1, t2, t3, t4 extended; +Table Checksum +test.t1 968604391 +test.t2 968604391 +test.t3 968604391 +test.t4 NULL +drop table t1,t2,t3; +create table t1 (id int, name char(10) not null, name2 char(10) not null) engine=innodb; +insert into t1 values(1,'first','fff'),(2,'second','sss'),(3,'third','ttt'); +select name2 from t1 union all select name from t1 union all select id from t1; +name2 +fff +sss +ttt +first +second +third +1 +2 +3 +drop table t1; +create table t1 (a int) engine=innodb; +create table t2 like t1; +drop table t1,t2; +create table t1 (id int(11) not null, id2 int(11) not null, unique (id,id2)) engine=innodb; +create table t2 (id int(11) not null, constraint t1_id_fk foreign key ( id ) references t1 (id)) engine = innodb; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` int(11) NOT NULL default '0', + `id2` int(11) NOT NULL default '0', + UNIQUE KEY `id` (`id`,`id2`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(11) NOT NULL default '0', + KEY `t1_id_fk` (`id`), + CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`) REFERENCES `t1` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +create index id on t2 (id); +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(11) NOT NULL default '0', + KEY `id` (`id`), + CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`) REFERENCES `t1` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +create index id2 on t2 (id); +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(11) NOT NULL default '0', + KEY `id` (`id`), + KEY `id2` (`id`), + CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`) REFERENCES `t1` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop index id2 on t2; +drop index id on t2; +Got one of the listed errors +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(11) NOT NULL default '0', + KEY `id` (`id`), + CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`) REFERENCES `t1` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t2; +create table t2 (id int(11) not null, id2 int(11) not null, constraint t1_id_fk foreign key (id,id2) references t1 (id,id2)) engine = innodb; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(11) NOT NULL default '0', + `id2` int(11) NOT NULL default '0', + KEY `t1_id_fk` (`id`,`id2`), + CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`, `id2`) REFERENCES `t1` (`id`, `id2`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +create unique index id on t2 (id,id2); +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(11) NOT NULL default '0', + `id2` int(11) NOT NULL default '0', + UNIQUE KEY `id` (`id`,`id2`), + CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`, `id2`) REFERENCES `t1` (`id`, `id2`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t2; +create table t2 (id int(11) not null, id2 int(11) not null, unique (id,id2),constraint t1_id_fk foreign key (id2,id) references t1 (id,id2)) engine = innodb; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(11) NOT NULL default '0', + `id2` int(11) NOT NULL default '0', + UNIQUE KEY `id` (`id`,`id2`), + KEY `t1_id_fk` (`id2`,`id`), + CONSTRAINT `t1_id_fk` FOREIGN KEY (`id2`, `id`) REFERENCES `t1` (`id`, `id2`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t2; +create table t2 (id int(11) not null, id2 int(11) not null, unique (id,id2), constraint t1_id_fk foreign key (id) references t1 (id)) engine = innodb; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(11) NOT NULL default '0', + `id2` int(11) NOT NULL default '0', + UNIQUE KEY `id` (`id`,`id2`), + CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`) REFERENCES `t1` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t2; +create table t2 (id int(11) not null, id2 int(11) not null, unique (id,id2),constraint t1_id_fk foreign key (id2,id) references t1 (id,id2)) engine = innodb; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(11) NOT NULL default '0', + `id2` int(11) NOT NULL default '0', + UNIQUE KEY `id` (`id`,`id2`), + KEY `t1_id_fk` (`id2`,`id`), + CONSTRAINT `t1_id_fk` FOREIGN KEY (`id2`, `id`) REFERENCES `t1` (`id`, `id2`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t2; +create table t2 (id int(11) not null auto_increment, id2 int(11) not null, constraint t1_id_fk foreign key (id) references t1 (id), primary key (id), index (id,id2)) engine = innodb; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(11) NOT NULL auto_increment, + `id2` int(11) NOT NULL default '0', + PRIMARY KEY (`id`), + KEY `id` (`id`,`id2`), + CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`) REFERENCES `t1` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t2; +create table t2 (id int(11) not null auto_increment, id2 int(11) not null, constraint t1_id_fk foreign key (id) references t1 (id)) engine= innodb; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(11) NOT NULL auto_increment, + `id2` int(11) NOT NULL default '0', + KEY `t1_id_fk` (`id`), + CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`) REFERENCES `t1` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +alter table t2 add index id_test (id), add index id_test2 (id,id2); +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `id` int(11) NOT NULL auto_increment, + `id2` int(11) NOT NULL default '0', + KEY `id_test` (`id`), + KEY `id_test2` (`id`,`id2`), + CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`) REFERENCES `t1` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t2; +create table t2 (id int(11) not null, id2 int(11) not null, constraint t1_id_fk foreign key (id2,id) references t1 (id)) engine = innodb; +ERROR HY000: Can't create table '/home/hf/work/mysql-4.1.clean/mysql-test/var/master-data/test/t2.frm' (errno: 150) +create table t2 (a int auto_increment primary key, b int, index(b), foreign key (b) references t1(id), unique(b)) engine=innodb; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) NOT NULL auto_increment, + `b` int(11) default NULL, + PRIMARY KEY (`a`), + UNIQUE KEY `b_2` (`b`), + KEY `b` (`b`), + CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`b`) REFERENCES `t1` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t2; +create table t2 (a int auto_increment primary key, b int, foreign key (b) references t1(id), foreign key (b) references t1(id), unique(b)) engine=innodb; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) NOT NULL auto_increment, + `b` int(11) default NULL, + PRIMARY KEY (`a`), + UNIQUE KEY `b` (`b`), + CONSTRAINT `t2_ibfk_1` FOREIGN KEY (`b`) REFERENCES `t1` (`id`), + CONSTRAINT `t2_ibfk_2` FOREIGN KEY (`b`) REFERENCES `t1` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +drop table t2, t1; +show status like "binlog_cache_use"; +Variable_name Value +Binlog_cache_use 24 +show status like "binlog_cache_disk_use"; +Variable_name Value +Binlog_cache_disk_use 0 +create table t1 (a int) engine=innodb; +show status like "binlog_cache_use"; +Variable_name Value +Binlog_cache_use 25 +show status like "binlog_cache_disk_use"; +Variable_name Value +Binlog_cache_disk_use 1 +begin; +delete from t1; +commit; +show status like "binlog_cache_use"; +Variable_name Value +Binlog_cache_use 26 +show status like "binlog_cache_disk_use"; +Variable_name Value +Binlog_cache_disk_use 1 +drop table t1; +create table t1 (c char(10), index (c,c)) engine=innodb; +ERROR 42S21: Duplicate column name 'c' +create table t1 (c1 char(10), c2 char(10), index (c1,c2,c1)) engine=innodb; +ERROR 42S21: Duplicate column name 'c1' +create table t1 (c1 char(10), c2 char(10), index (c1,c1,c2)) engine=innodb; +ERROR 42S21: Duplicate column name 'c1' +create table t1 (c1 char(10), c2 char(10), index (c2,c1,c1)) engine=innodb; +ERROR 42S21: Duplicate column name 'c1' +create table t1 (c1 char(10), c2 char(10)) engine=innodb; +alter table t1 add key (c1,c1); +ERROR 42S21: Duplicate column name 'c1' +alter table t1 add key (c2,c1,c1); +ERROR 42S21: Duplicate column name 'c1' +alter table t1 add key (c1,c2,c1); +ERROR 42S21: Duplicate column name 'c1' +alter table t1 add key (c1,c1,c2); +ERROR 42S21: Duplicate column name 'c1' +drop table t1; diff --git a/mysql-test/r/myisam-blob.result.es b/mysql-test/r/myisam-blob.result.es new file mode 100644 index 00000000000..4031b9cfd1c --- /dev/null +++ b/mysql-test/r/myisam-blob.result.es @@ -0,0 +1,59 @@ +drop table if exists t1; +CREATE TABLE t1 (data LONGBLOB) ENGINE=myisam; +INSERT INTO t1 (data) VALUES (NULL); +UPDATE t1 set data=repeat('a',18*1024*1024); +Warnings: +Warning 1301 Result of repeat() was larger than max_allowed_packet (24) - truncated +select length(data) from t1; +length(data) +NULL +delete from t1 where left(data,1)='a'; +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK +truncate table t1; +INSERT INTO t1 (data) VALUES (repeat('a',1*1024*1024)); +Warnings: +Warning 1301 Result of repeat() was larger than max_allowed_packet (24) - truncated +INSERT INTO t1 (data) VALUES (repeat('b',16*1024*1024-1024)); +Warnings: +Warning 1301 Result of repeat() was larger than max_allowed_packet (24) - truncated +delete from t1 where left(data,1)='b'; +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK +UPDATE t1 set data=repeat('c',17*1024*1024); +Warnings: +Warning 1301 Result of repeat() was larger than max_allowed_packet (24) - truncated +Warning 1301 Result of repeat() was larger than max_allowed_packet (24) - truncated +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK +delete from t1 where left(data,1)='c'; +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK +INSERT INTO t1 set data=repeat('a',18*1024*1024); +Warnings: +Warning 1301 Result of repeat() was larger than max_allowed_packet (24) - truncated +select length(data) from t1; +length(data) +NULL +NULL +NULL +alter table t1 modify data blob; +select length(data) from t1; +length(data) +NULL +NULL +NULL +drop table t1; +CREATE TABLE t1 (data BLOB) ENGINE=myisam; +INSERT INTO t1 (data) VALUES (NULL); +UPDATE t1 set data=repeat('a',18*1024*1024); +Warnings: +Warning 1301 Result of repeat() was larger than max_allowed_packet (24) - truncated +select length(data) from t1; +length(data) +NULL +drop table t1; diff --git a/mysql-test/r/ps_2myisam.result.es b/mysql-test/r/ps_2myisam.result.es new file mode 100644 index 00000000000..3f17b4cdcd0 --- /dev/null +++ b/mysql-test/r/ps_2myisam.result.es @@ -0,0 +1,3130 @@ +use test; +drop table if exists t1, t9 ; +create table t1 +( +a int, b varchar(30), +primary key(a) +) engine = 'MYISAM' ; +create table t9 +( +c1 tinyint, c2 smallint, c3 mediumint, c4 int, +c5 integer, c6 bigint, c7 float, c8 double, +c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4), +c13 date, c14 datetime, c15 timestamp(14), c16 time, +c17 year, c18 bit, c19 bool, c20 char, +c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext, +c25 blob, c26 text, c27 mediumblob, c28 mediumtext, +c29 longblob, c30 longtext, c31 enum('one', 'two', 'three'), +c32 set('monday', 'tuesday', 'wednesday'), +primary key(c1) +) engine = 'MYISAM' ; +delete from t1 ; +insert into t1 values (1,'one'); +insert into t1 values (2,'two'); +insert into t1 values (3,'three'); +insert into t1 values (4,'four'); +commit ; +delete from t9 ; +insert into t9 +set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, +c10= 1, c11= 1, c12 = 1, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=true, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; +insert into t9 +set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, +c10= 9, c11= 9, c12 = 9, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=false, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +commit ; +test_sequence +------ simple select tests ------ +prepare stmt1 from ' select * from t9 order by c1 ' ; +execute stmt1; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def test t9 t9 c1 c1 1 4 1 N 49155 0 63 +def test t9 t9 c2 c2 2 6 1 Y 32768 0 63 +def test t9 t9 c3 c3 9 9 1 Y 32768 0 63 +def test t9 t9 c4 c4 3 11 1 Y 32768 0 63 +def test t9 t9 c5 c5 3 11 1 Y 32768 0 63 +def test t9 t9 c6 c6 8 20 1 Y 32768 0 63 +def test t9 t9 c7 c7 4 12 1 Y 32768 31 63 +def test t9 t9 c8 c8 5 22 1 Y 32768 31 63 +def test t9 t9 c9 c9 5 22 1 Y 32768 31 63 +def test t9 t9 c10 c10 5 22 1 Y 32768 31 63 +def test t9 t9 c11 c11 0 9 6 Y 32768 4 63 +def test t9 t9 c12 c12 0 10 6 Y 32768 4 63 +def test t9 t9 c13 c13 10 10 10 Y 128 0 63 +def test t9 t9 c14 c14 12 19 19 Y 128 0 63 +def test t9 t9 c15 c15 7 19 19 N 1249 0 63 +def test t9 t9 c16 c16 11 8 8 Y 128 0 63 +def test t9 t9 c17 c17 13 4 4 Y 32864 0 63 +def test t9 t9 c18 c18 1 1 1 Y 32768 0 63 +def test t9 t9 c19 c19 1 1 1 Y 32768 0 63 +def test t9 t9 c20 c20 254 1 1 Y 0 0 8 +def test t9 t9 c21 c21 253 10 10 Y 0 0 8 +def test t9 t9 c22 c22 253 30 30 Y 0 0 8 +def test t9 t9 c23 c23 252 255 8 Y 144 0 63 +def test t9 t9 c24 c24 252 255 8 Y 16 0 8 +def test t9 t9 c25 c25 252 65535 4 Y 144 0 63 +def test t9 t9 c26 c26 252 65535 4 Y 16 0 8 +def test t9 t9 c27 c27 252 16777215 10 Y 144 0 63 +def test t9 t9 c28 c28 252 16777215 10 Y 16 0 8 +def test t9 t9 c29 c29 252 16777215 8 Y 144 0 63 +def test t9 t9 c30 c30 252 16777215 8 Y 16 0 8 +def test t9 t9 c31 c31 254 5 3 Y 256 0 8 +def test t9 t9 c32 c32 254 24 7 Y 2048 0 8 +c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32 +1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday +set @arg00='SELECT' ; +prepare stmt1 from ' ? a from t1 where a=1 '; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? a from t1 where a=1' at line 1 +set @arg00=1 ; +select @arg00, b from t1 where a=1 ; +@arg00 b +1 one +prepare stmt1 from ' select ?, b from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +? b +1 one +set @arg00='lion' ; +select @arg00, b from t1 where a=1 ; +@arg00 b +lion one +prepare stmt1 from ' select ?, b from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +? b +lion one +set @arg00=NULL ; +select @arg00, b from t1 where a=1 ; +@arg00 b +NULL one +prepare stmt1 from ' select ?, b from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +? b +NULL one +set @arg00=1 ; +select b, a - @arg00 from t1 where a=1 ; +b a - @arg00 +one 0 +prepare stmt1 from ' select b, a - ? from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +b a - ? +one 0 +set @arg00=null ; +select @arg00 as my_col ; +my_col +NULL +prepare stmt1 from ' select ? as my_col'; +execute stmt1 using @arg00 ; +my_col +NULL +select @arg00 + 1 as my_col ; +my_col +NULL +prepare stmt1 from ' select ? + 1 as my_col'; +execute stmt1 using @arg00 ; +my_col +NULL +select 1 + @arg00 as my_col ; +my_col +NULL +prepare stmt1 from ' select 1 + ? as my_col'; +execute stmt1 using @arg00 ; +my_col +NULL +set @arg00='MySQL' ; +select substr(@arg00,1,2) from t1 where a=1 ; +substr(@arg00,1,2) +My +prepare stmt1 from ' select substr(?,1,2) from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +substr(?,1,2) +My +set @arg00=3 ; +select substr('MySQL',@arg00,5) from t1 where a=1 ; +substr('MySQL',@arg00,5) +SQL +prepare stmt1 from ' select substr(''MySQL'',?,5) from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +substr('MySQL',?,5) +SQL +select substr('MySQL',1,@arg00) from t1 where a=1 ; +substr('MySQL',1,@arg00) +MyS +prepare stmt1 from ' select substr(''MySQL'',1,?) from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +substr('MySQL',1,?) +MyS +set @arg00='MySQL' ; +select a , concat(@arg00,b) from t1 order by a; +a concat(@arg00,b) +1 MySQLone +2 MySQLtwo +3 MySQLthree +4 MySQLfour +prepare stmt1 from ' select a , concat(?,b) from t1 order by a ' ; +execute stmt1 using @arg00; +a concat(?,b) +1 MySQLone +2 MySQLtwo +3 MySQLthree +4 MySQLfour +select a , concat(b,@arg00) from t1 order by a ; +a concat(b,@arg00) +1 oneMySQL +2 twoMySQL +3 threeMySQL +4 fourMySQL +prepare stmt1 from ' select a , concat(b,?) from t1 order by a ' ; +execute stmt1 using @arg00; +a concat(b,?) +1 oneMySQL +2 twoMySQL +3 threeMySQL +4 fourMySQL +set @arg00='MySQL' ; +select group_concat(@arg00,b order by a) from t1 +group by 'a' ; +group_concat(@arg00,b order by a) +MySQLone,MySQLtwo,MySQLthree,MySQLfour +prepare stmt1 from ' select group_concat(?,b order by a) from t1 +group by ''a'' ' ; +execute stmt1 using @arg00; +group_concat(?,b order by a) +MySQLone,MySQLtwo,MySQLthree,MySQLfour +select group_concat(b,@arg00 order by a) from t1 +group by 'a' ; +group_concat(b,@arg00 order by a) +oneMySQL,twoMySQL,threeMySQL,fourMySQL +prepare stmt1 from ' select group_concat(b,? order by a) from t1 +group by ''a'' ' ; +execute stmt1 using @arg00; +group_concat(b,? order by a) +oneMySQL,twoMySQL,threeMySQL,fourMySQL +set @arg00='first' ; +set @arg01='second' ; +set @arg02=NULL; +select @arg00, @arg01 from t1 where a=1 ; +@arg00 @arg01 +first second +prepare stmt1 from ' select ?, ? from t1 where a=1 ' ; +execute stmt1 using @arg00, @arg01 ; +? ? +first second +execute stmt1 using @arg02, @arg01 ; +? ? +NULL second +execute stmt1 using @arg00, @arg02 ; +? ? +first NULL +execute stmt1 using @arg02, @arg02 ; +? ? +NULL NULL +drop table if exists t5 ; +create table t5 (id1 int(11) not null default '0', +value2 varchar(100), value1 varchar(100)) ; +insert into t5 values (1,'hh','hh'),(2,'hh','hh'), +(1,'ii','ii'),(2,'ii','ii') ; +prepare stmt1 from ' select id1,value1 from t5 where id1=? or value1=? order by id1,value1 ' ; +set @arg00=1 ; +set @arg01='hh' ; +execute stmt1 using @arg00, @arg01 ; +id1 value1 +1 hh +1 ii +2 hh +drop table t5 ; +drop table if exists t5 ; +create table t5(session_id char(9) not null) ; +insert into t5 values ('abc') ; +prepare stmt1 from ' select * from t5 +where ?=''1111'' and session_id = ''abc'' ' ; +set @arg00='abc' ; +execute stmt1 using @arg00 ; +session_id +set @arg00='1111' ; +execute stmt1 using @arg00 ; +session_id +abc +set @arg00='abc' ; +execute stmt1 using @arg00 ; +session_id +drop table t5 ; +set @arg00='FROM' ; +select a @arg00 t1 where a=1 ; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 t1 where a=1' at line 1 +prepare stmt1 from ' select a ? t1 where a=1 ' ; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? t1 where a=1' at line 1 +set @arg00='t1' ; +select a from @arg00 where a=1 ; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 where a=1' at line 1 +prepare stmt1 from ' select a from ? where a=1 ' ; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? where a=1' at line 1 +set @arg00='WHERE' ; +select a from t1 @arg00 a=1 ; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 a=1' at line 1 +prepare stmt1 from ' select a from t1 ? a=1 ' ; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? a=1' at line 1 +set @arg00=1 ; +select a FROM t1 where a=@arg00 ; +a +1 +prepare stmt1 from ' select a FROM t1 where a=? ' ; +execute stmt1 using @arg00 ; +a +1 +set @arg00=1000 ; +execute stmt1 using @arg00 ; +a +set @arg00=NULL ; +select a FROM t1 where a=@arg00 ; +a +prepare stmt1 from ' select a FROM t1 where a=? ' ; +execute stmt1 using @arg00 ; +a +set @arg00=4 ; +select a FROM t1 where a=sqrt(@arg00) ; +a +2 +prepare stmt1 from ' select a FROM t1 where a=sqrt(?) ' ; +execute stmt1 using @arg00 ; +a +2 +set @arg00=NULL ; +select a FROM t1 where a=sqrt(@arg00) ; +a +prepare stmt1 from ' select a FROM t1 where a=sqrt(?) ' ; +execute stmt1 using @arg00 ; +a +set @arg00=2 ; +set @arg01=3 ; +select a FROM t1 where a in (@arg00,@arg01) order by a; +a +2 +3 +prepare stmt1 from ' select a FROM t1 where a in (?,?) order by a '; +execute stmt1 using @arg00, @arg01; +a +2 +3 +set @arg00= 'one' ; +set @arg01= 'two' ; +set @arg02= 'five' ; +prepare stmt1 from ' select b FROM t1 where b in (?,?,?) order by b ' ; +execute stmt1 using @arg00, @arg01, @arg02 ; +b +one +two +prepare stmt1 from ' select b FROM t1 where b like ? '; +set @arg00='two' ; +execute stmt1 using @arg00 ; +b +two +set @arg00='tw%' ; +execute stmt1 using @arg00 ; +b +two +set @arg00='%wo' ; +execute stmt1 using @arg00 ; +b +two +set @arg00=null ; +insert into t9 set c1= 0, c5 = NULL ; +select c5 from t9 where c5 > NULL ; +c5 +prepare stmt1 from ' select c5 from t9 where c5 > ? '; +execute stmt1 using @arg00 ; +c5 +select c5 from t9 where c5 < NULL ; +c5 +prepare stmt1 from ' select c5 from t9 where c5 < ? '; +execute stmt1 using @arg00 ; +c5 +select c5 from t9 where c5 = NULL ; +c5 +prepare stmt1 from ' select c5 from t9 where c5 = ? '; +execute stmt1 using @arg00 ; +c5 +select c5 from t9 where c5 <=> NULL ; +c5 +NULL +prepare stmt1 from ' select c5 from t9 where c5 <=> ? '; +execute stmt1 using @arg00 ; +c5 +NULL +delete from t9 where c1= 0 ; +set @arg00='>' ; +select a FROM t1 where a @arg00 1 ; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 1' at line 1 +prepare stmt1 from ' select a FROM t1 where a ? 1 ' ; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? 1' at line 1 +set @arg00=1 ; +select a,b FROM t1 where a is not NULL +AND b is not NULL group by a - @arg00 ; +a b +1 one +2 two +3 three +4 four +prepare stmt1 from ' select a,b FROM t1 where a is not NULL +AND b is not NULL group by a - ? ' ; +execute stmt1 using @arg00 ; +a b +1 one +2 two +3 three +4 four +set @arg00='two' ; +select a,b FROM t1 where a is not NULL +AND b is not NULL having b <> @arg00 order by a ; +a b +1 one +3 three +4 four +prepare stmt1 from ' select a,b FROM t1 where a is not NULL +AND b is not NULL having b <> ? order by a ' ; +execute stmt1 using @arg00 ; +a b +1 one +3 three +4 four +set @arg00=1 ; +select a,b FROM t1 where a is not NULL +AND b is not NULL order by a - @arg00 ; +a b +1 one +2 two +3 three +4 four +prepare stmt1 from ' select a,b FROM t1 where a is not NULL +AND b is not NULL order by a - ? ' ; +execute stmt1 using @arg00 ; +a b +1 one +2 two +3 three +4 four +set @arg00=2 ; +select a,b from t1 order by 2 ; +a b +4 four +1 one +3 three +2 two +prepare stmt1 from ' select a,b from t1 +order by ? '; +execute stmt1 using @arg00; +a b +4 four +1 one +3 three +2 two +set @arg00=1 ; +execute stmt1 using @arg00; +a b +1 one +2 two +3 three +4 four +set @arg00=0 ; +execute stmt1 using @arg00; +ERROR 42S22: Unknown column '?' in 'order clause' +set @arg00=1; +prepare stmt1 from ' select a,b from t1 order by a +limit 1 '; +execute stmt1 ; +a b +1 one +prepare stmt1 from ' select a,b from t1 +limit ? '; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?' at line 2 +set @arg00='b' ; +set @arg01=0 ; +set @arg02=2 ; +set @arg03=2 ; +select sum(a), @arg00 from t1 where a > @arg01 +and b is not null group by substr(b,@arg02) +having sum(a) <> @arg03 ; +sum(a) @arg00 +3 b +1 b +4 b +prepare stmt1 from ' select sum(a), ? from t1 where a > ? +and b is not null group by substr(b,?) +having sum(a) <> ? '; +execute stmt1 using @arg00, @arg01, @arg02, @arg03; +sum(a) ? +3 b +1 b +4 b +test_sequence +------ join tests ------ +select first.a as a1, second.a as a2 +from t1 first, t1 second +where first.a = second.a order by a1 ; +a1 a2 +1 1 +2 2 +3 3 +4 4 +prepare stmt1 from ' select first.a as a1, second.a as a2 + from t1 first, t1 second + where first.a = second.a order by a1 '; +execute stmt1 ; +a1 a2 +1 1 +2 2 +3 3 +4 4 +set @arg00='ABC'; +set @arg01='two'; +set @arg02='one'; +select first.a, @arg00, second.a FROM t1 first, t1 second +where @arg01 = first.b or first.a = second.a or second.b = @arg02 +order by second.a, first.a; +a @arg00 a +1 ABC 1 +2 ABC 1 +3 ABC 1 +4 ABC 1 +2 ABC 2 +2 ABC 3 +3 ABC 3 +2 ABC 4 +4 ABC 4 +prepare stmt1 from ' select first.a, ?, second.a FROM t1 first, t1 second + where ? = first.b or first.a = second.a or second.b = ? + order by second.a, first.a'; +execute stmt1 using @arg00, @arg01, @arg02; +a ? a +1 ABC 1 +2 ABC 1 +3 ABC 1 +4 ABC 1 +2 ABC 2 +2 ABC 3 +3 ABC 3 +2 ABC 4 +4 ABC 4 +drop table if exists t2 ; +create table t2 as select * from t1 ; +set @query1= 'SELECT * FROM t2 join t1 on (t1.a=t2.a) order by t2.a ' ; +set @query2= 'SELECT * FROM t2 natural join t1 order by t2.a ' ; +set @query3= 'SELECT * FROM t2 join t1 using(a) order by t2.a ' ; +set @query4= 'SELECT * FROM t2 left join t1 on(t1.a=t2.a) order by t2.a ' ; +set @query5= 'SELECT * FROM t2 natural left join t1 order by t2.a ' ; +set @query6= 'SELECT * FROM t2 left join t1 using(a) order by t2.a ' ; +set @query7= 'SELECT * FROM t2 right join t1 on(t1.a=t2.a) order by t2.a ' ; +set @query8= 'SELECT * FROM t2 natural right join t1 order by t2.a ' ; +set @query9= 'SELECT * FROM t2 right join t1 using(a) order by t2.a ' ; +the join statement is: +SELECT * FROM t2 right join t1 using(a) order by t2.a +prepare stmt1 from @query9 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +the join statement is: +SELECT * FROM t2 natural right join t1 order by t2.a +prepare stmt1 from @query8 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +the join statement is: +SELECT * FROM t2 right join t1 on(t1.a=t2.a) order by t2.a +prepare stmt1 from @query7 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +the join statement is: +SELECT * FROM t2 left join t1 using(a) order by t2.a +prepare stmt1 from @query6 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +the join statement is: +SELECT * FROM t2 natural left join t1 order by t2.a +prepare stmt1 from @query5 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +the join statement is: +SELECT * FROM t2 left join t1 on(t1.a=t2.a) order by t2.a +prepare stmt1 from @query4 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +the join statement is: +SELECT * FROM t2 join t1 using(a) order by t2.a +prepare stmt1 from @query3 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +the join statement is: +SELECT * FROM t2 natural join t1 order by t2.a +prepare stmt1 from @query2 ; +execute stmt1 ; +a b +1 one +2 two +3 three +4 four +execute stmt1 ; +a b +1 one +2 two +3 three +4 four +execute stmt1 ; +a b +1 one +2 two +3 three +4 four +the join statement is: +SELECT * FROM t2 join t1 on (t1.a=t2.a) order by t2.a +prepare stmt1 from @query1 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +drop table t2 ; +test_sequence +------ subquery tests ------ +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where b = ''two'') '; +execute stmt1 ; +a b +2 two +set @arg00='two' ; +select a, b FROM t1 outer_table where +a = (select a from t1 where b = 'two' ) and b=@arg00 ; +a b +2 two +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where b = ''two'') and b=? '; +execute stmt1 using @arg00; +a b +2 two +set @arg00='two' ; +select a, b FROM t1 outer_table where +a = (select a from t1 where b = @arg00 ) and b='two' ; +a b +2 two +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where b = ? ) and b=''two'' ' ; +execute stmt1 using @arg00; +a b +2 two +set @arg00=3 ; +set @arg01='three' ; +select a,b FROM t1 where (a,b) in (select 3, 'three'); +a b +3 three +select a FROM t1 where (a,b) in (select @arg00,@arg01); +a +3 +prepare stmt1 from ' select a FROM t1 where (a,b) in (select ?, ?) '; +execute stmt1 using @arg00, @arg01; +a +3 +set @arg00=1 ; +set @arg01='two' ; +set @arg02=2 ; +set @arg03='two' ; +select a, @arg00, b FROM t1 outer_table where +b=@arg01 and a = (select @arg02 from t1 where b = @arg03 ) ; +a @arg00 b +2 1 two +prepare stmt1 from ' select a, ?, b FROM t1 outer_table where + b=? and a = (select ? from t1 where b = ? ) ' ; +execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; +a ? b +2 1 two +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where b = outer_table.b ) order by a '; +execute stmt1 ; +a b +1 one +2 two +3 three +4 four +prepare stmt1 from ' SELECT a as ccc from t1 where a+1= + (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) '; +execute stmt1 ; +ccc +1 +deallocate prepare stmt1 ; +prepare stmt1 from ' SELECT a as ccc from t1 where a+1= + (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) '; +execute stmt1 ; +ccc +1 +deallocate prepare stmt1 ; +prepare stmt1 from ' SELECT a as ccc from t1 where a+1= + (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) '; +execute stmt1 ; +ccc +1 +deallocate prepare stmt1 ; +set @arg00='two' ; +select a, b FROM t1 outer_table where +a = (select a from t1 where b = outer_table.b ) and b=@arg00 ; +a b +2 two +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where b = outer_table.b) and b=? '; +execute stmt1 using @arg00; +a b +2 two +set @arg00=2 ; +select a, b FROM t1 outer_table where +a = (select a from t1 where a = @arg00 and b = outer_table.b) and b='two' ; +a b +2 two +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where a = ? and b = outer_table.b) and b=''two'' ' ; +execute stmt1 using @arg00; +a b +2 two +set @arg00=2 ; +select a, b FROM t1 outer_table where +a = (select a from t1 where outer_table.a = @arg00 and a=2) and b='two' ; +a b +2 two +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where outer_table.a = ? and a=2) and b=''two'' ' ; +execute stmt1 using @arg00; +a b +2 two +set @arg00=1 ; +set @arg01='two' ; +set @arg02=2 ; +set @arg03='two' ; +select a, @arg00, b FROM t1 outer_table where +b=@arg01 and a = (select @arg02 from t1 where outer_table.b = @arg03 +and outer_table.a=a ) ; +a @arg00 b +2 1 two +prepare stmt1 from ' select a, ?, b FROM t1 outer_table where + b=? and a = (select ? from t1 where outer_table.b = ? + and outer_table.a=a ) ' ; +execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; +a ? b +2 1 two +set @arg00=1 ; +set @arg01=0 ; +select a, @arg00 +from ( select a - @arg00 as a from t1 where a=@arg00 ) as t2 +where a=@arg01; +a @arg00 +0 1 +prepare stmt1 from ' select a, ? + from ( select a - ? as a from t1 where a=? ) as t2 + where a=? '; +execute stmt1 using @arg00, @arg00, @arg00, @arg01 ; +a ? +0 1 +drop table if exists t2 ; +create table t2 as select * from t1; +prepare stmt1 from ' select a in (select a from t2) from t1 ' ; +execute stmt1 ; +a in (select a from t2) +1 +1 +1 +1 +drop table if exists t5, t6, t7 ; +create table t5 (a int , b int) ; +create table t6 like t5 ; +create table t7 like t5 ; +insert into t5 values (0, 100), (1, 2), (1, 3), (2, 2), (2, 7), +(2, -1), (3, 10) ; +insert into t6 values (0, 0), (1, 1), (2, 1), (3, 1), (4, 1) ; +insert into t7 values (3, 3), (2, 2), (1, 1) ; +prepare stmt1 from ' select a, (select count(distinct t5.b) as sum from t5, t6 + where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b + group by t5.a order by sum limit 1) from t7 ' ; +execute stmt1 ; +a (select count(distinct t5.b) as sum from t5, t6 + where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b + group by t5.a order by sum limit 1) +3 1 +2 2 +1 2 +execute stmt1 ; +a (select count(distinct t5.b) as sum from t5, t6 + where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b + group by t5.a order by sum limit 1) +3 1 +2 2 +1 2 +execute stmt1 ; +a (select count(distinct t5.b) as sum from t5, t6 + where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b + group by t5.a order by sum limit 1) +3 1 +2 2 +1 2 +drop table t5, t6, t7 ; +drop table if exists t2 ; +create table t2 as select * from t9; +set @stmt= ' SELECT + (SELECT SUM(c1 + c12 + 0.0) FROM t2 + where (t9.c2 - 0e-3) = t2.c2 + GROUP BY t9.c15 LIMIT 1) as scalar_s, + exists (select 1.0e+0 from t2 + where t2.c3 * 9.0000000000 = t9.c4) as exists_s, + c5 * 4 in (select c6 + 0.3e+1 from t2) as in_s, + (c7 - 4, c8 - 4) in (select c9 + 4.0, c10 + 40e-1 from t2) as in_row_s +FROM t9, +(select c25 x, c32 y from t2) tt WHERE x = c25 ' ; +prepare stmt1 from @stmt ; +execute stmt1 ; +execute stmt1 ; +set @stmt= concat('explain ',@stmt); +prepare stmt1 from @stmt ; +execute stmt1 ; +execute stmt1 ; +set @stmt= ' SELECT + (SELECT SUM(c1+c12+?) FROM t2 where (t9.c2-?)=t2.c2 + GROUP BY t9.c15 LIMIT 1) as scalar_s, + exists (select ? from t2 + where t2.c3*?=t9.c4) as exists_s, + c5*? in (select c6+? from t2) as in_s, + (c7-?, c8-?) in (select c9+?, c10+? from t2) as in_row_s +FROM t9, +(select c25 x, c32 y from t2) tt WHERE x =c25 ' ; +set @arg00= 0.0 ; +set @arg01= 0e-3 ; +set @arg02= 1.0e+0 ; +set @arg03= 9.0000000000 ; +set @arg04= 4 ; +set @arg05= 0.3e+1 ; +set @arg06= 4 ; +set @arg07= 4 ; +set @arg08= 4.0 ; +set @arg09= 40e-1 ; +prepare stmt1 from @stmt ; +execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, +@arg07, @arg08, @arg09 ; +execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, +@arg07, @arg08, @arg09 ; +set @stmt= concat('explain ',@stmt); +prepare stmt1 from @stmt ; +execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, +@arg07, @arg08, @arg09 ; +execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, +@arg07, @arg08, @arg09 ; +drop table t2 ; +select 1 < (select a from t1) ; +ERROR 21000: Subquery returns more than 1 row +prepare stmt1 from ' select 1 < (select a from t1) ' ; +execute stmt1 ; +ERROR 21000: Subquery returns more than 1 row +select 1 as my_col ; +my_col +1 +test_sequence +------ union tests ------ +prepare stmt1 from ' select a FROM t1 where a=1 + union distinct + select a FROM t1 where a=1 '; +execute stmt1 ; +a +1 +execute stmt1 ; +a +1 +prepare stmt1 from ' select a FROM t1 where a=1 + union all + select a FROM t1 where a=1 '; +execute stmt1 ; +a +1 +1 +prepare stmt1 from ' SELECT 1, 2 union SELECT 1 ' ; +ERROR 21000: The used SELECT statements have a different number of columns +prepare stmt1 from ' SELECT 1 union SELECT 1, 2 ' ; +ERROR 21000: The used SELECT statements have a different number of columns +prepare stmt1 from ' SELECT * from t1 union SELECT 1 ' ; +ERROR 21000: The used SELECT statements have a different number of columns +prepare stmt1 from ' SELECT 1 union SELECT * from t1 ' ; +ERROR 21000: The used SELECT statements have a different number of columns +set @arg00=1 ; +select @arg00 FROM t1 where a=1 +union distinct +select 1 FROM t1 where a=1; +@arg00 +1 +prepare stmt1 from ' select ? FROM t1 where a=1 + union distinct + select 1 FROM t1 where a=1 ' ; +execute stmt1 using @arg00; +? +1 +set @arg00=1 ; +select 1 FROM t1 where a=1 +union distinct +select @arg00 FROM t1 where a=1; +1 +1 +prepare stmt1 from ' select 1 FROM t1 where a=1 + union distinct + select ? FROM t1 where a=1 ' ; +execute stmt1 using @arg00; +1 +1 +set @arg00='a' ; +select @arg00 FROM t1 where a=1 +union distinct +select @arg00 FROM t1 where a=1; +@arg00 +a +prepare stmt1 from ' select ? FROM t1 where a=1 + union distinct + select ? FROM t1 where a=1 '; +execute stmt1 using @arg00, @arg00; +? +a +prepare stmt1 from ' select ? + union distinct + select ? '; +execute stmt1 using @arg00, @arg00; +? +a +set @arg00='a' ; +set @arg01=1 ; +set @arg02='a' ; +set @arg03=2 ; +select @arg00 FROM t1 where a=@arg01 +union distinct +select @arg02 FROM t1 where a=@arg03; +@arg00 +a +prepare stmt1 from ' select ? FROM t1 where a=? + union distinct + select ? FROM t1 where a=? ' ; +execute stmt1 using @arg00, @arg01, @arg02, @arg03; +? +a +set @arg00=1 ; +prepare stmt1 from ' select sum(a) + 200, ? from t1 +union distinct +select sum(a) + 200, 1 from t1 +group by b ' ; +execute stmt1 using @arg00; +sum(a) + 200 ? +210 1 +204 1 +201 1 +203 1 +202 1 +set @Oporto='Oporto' ; +set @Lisboa='Lisboa' ; +set @0=0 ; +set @1=1 ; +set @2=2 ; +set @3=3 ; +set @4=4 ; +select @Oporto,@Lisboa,@0,@1,@2,@3,@4 ; +@Oporto @Lisboa @0 @1 @2 @3 @4 +Oporto Lisboa 0 1 2 3 4 +select sum(a) + 200 as the_sum, @Oporto as the_town from t1 +group by b +union distinct +select sum(a) + 200, @Lisboa from t1 +group by b ; +the_sum the_town +204 Oporto +201 Oporto +203 Oporto +202 Oporto +204 Lisboa +201 Lisboa +203 Lisboa +202 Lisboa +prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1 + group by b + union distinct + select sum(a) + 200, ? from t1 + group by b ' ; +execute stmt1 using @Oporto, @Lisboa; +the_sum the_town +204 Oporto +201 Oporto +203 Oporto +202 Oporto +204 Lisboa +201 Lisboa +203 Lisboa +202 Lisboa +select sum(a) + 200 as the_sum, @Oporto as the_town from t1 +where a > @1 +group by b +union distinct +select sum(a) + 200, @Lisboa from t1 +where a > @2 +group by b ; +the_sum the_town +204 Oporto +203 Oporto +202 Oporto +204 Lisboa +203 Lisboa +prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1 + where a > ? + group by b + union distinct + select sum(a) + 200, ? from t1 + where a > ? + group by b ' ; +execute stmt1 using @Oporto, @1, @Lisboa, @2; +the_sum the_town +204 Oporto +203 Oporto +202 Oporto +204 Lisboa +203 Lisboa +select sum(a) + 200 as the_sum, @Oporto as the_town from t1 +where a > @1 +group by b +having avg(a) > @2 +union distinct +select sum(a) + 200, @Lisboa from t1 +where a > @2 +group by b +having avg(a) > @3; +the_sum the_town +204 Oporto +203 Oporto +204 Lisboa +prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1 + where a > ? + group by b + having avg(a) > ? + union distinct + select sum(a) + 200, ? from t1 + where a > ? + group by b + having avg(a) > ? '; +execute stmt1 using @Oporto, @1, @2, @Lisboa, @2, @3; +the_sum the_town +204 Oporto +203 Oporto +204 Lisboa +test_sequence +------ explain select tests ------ +prepare stmt1 from ' explain select * from t9 ' ; +execute stmt1; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def id 8 3 1 N 32801 0 8 +def select_type 253 19 6 N 1 31 33 +def table 253 64 2 N 1 31 33 +def type 253 10 3 N 1 31 33 +def possible_keys 253 4096 0 Y 0 31 33 +def key 253 64 0 Y 0 31 33 +def key_len 8 3 0 Y 32800 0 8 +def ref 253 1024 0 Y 0 31 33 +def rows 8 10 1 N 32801 0 8 +def Extra 253 255 0 N 1 31 33 +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t9 ALL NULL NULL NULL NULL 2 +drop table if exists t2 ; +create table t2 (s varchar(25), fulltext(s)) +ENGINE = 'MYISAM' ; +insert into t2 values ('Gravedigger'), ('Greed'),('Hollow Dogs') ; +commit ; +prepare stmt1 from ' select s from t2 where match (s) against (?) ' ; +set @arg00='Dogs' ; +execute stmt1 using @arg00 ; +s +Hollow Dogs +prepare stmt1 from ' SELECT s FROM t2 +where match (s) against (concat(?,''digger'')) '; +set @arg00='Grave' ; +execute stmt1 using @arg00 ; +s +Gravedigger +drop table t2 ; +test_sequence +------ delete tests ------ +delete from t1 ; +insert into t1 values (1,'one'); +insert into t1 values (2,'two'); +insert into t1 values (3,'three'); +insert into t1 values (4,'four'); +commit ; +delete from t9 ; +insert into t9 +set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, +c10= 1, c11= 1, c12 = 1, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=true, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; +insert into t9 +set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, +c10= 9, c11= 9, c12 = 9, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=false, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +commit ; +prepare stmt1 from 'delete from t1 where a=2' ; +execute stmt1; +select a,b from t1 where a=2; +a b +execute stmt1; +insert into t1 values(0,NULL); +set @arg00=NULL; +prepare stmt1 from 'delete from t1 where b=?' ; +execute stmt1 using @arg00; +select a,b from t1 where b is NULL ; +a b +0 NULL +set @arg00='one'; +execute stmt1 using @arg00; +select a,b from t1 where b=@arg00; +a b +prepare stmt1 from 'truncate table t1' ; +ERROR HY000: This command is not supported in the prepared statement protocol yet +test_sequence +------ update tests ------ +delete from t1 ; +insert into t1 values (1,'one'); +insert into t1 values (2,'two'); +insert into t1 values (3,'three'); +insert into t1 values (4,'four'); +commit ; +delete from t9 ; +insert into t9 +set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, +c10= 1, c11= 1, c12 = 1, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=true, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; +insert into t9 +set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, +c10= 9, c11= 9, c12 = 9, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=false, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +commit ; +prepare stmt1 from 'update t1 set b=''a=two'' where a=2' ; +execute stmt1; +select a,b from t1 where a=2; +a b +2 a=two +execute stmt1; +select a,b from t1 where a=2; +a b +2 a=two +set @arg00=NULL; +prepare stmt1 from 'update t1 set b=? where a=2' ; +execute stmt1 using @arg00; +select a,b from t1 where a=2; +a b +2 NULL +set @arg00='two'; +execute stmt1 using @arg00; +select a,b from t1 where a=2; +a b +2 two +set @arg00=2; +prepare stmt1 from 'update t1 set b=NULL where a=?' ; +execute stmt1 using @arg00; +select a,b from t1 where a=@arg00; +a b +2 NULL +update t1 set b='two' where a=@arg00; +set @arg00=2000; +execute stmt1 using @arg00; +select a,b from t1 where a=@arg00; +a b +set @arg00=2; +set @arg01=22; +prepare stmt1 from 'update t1 set a=? where a=?' ; +execute stmt1 using @arg00, @arg00; +select a,b from t1 where a=@arg00; +a b +2 two +execute stmt1 using @arg01, @arg00; +select a,b from t1 where a=@arg01; +a b +22 two +execute stmt1 using @arg00, @arg01; +select a,b from t1 where a=@arg00; +a b +2 two +set @arg00=NULL; +set @arg01=2; +execute stmt1 using @arg00, @arg01; +Warnings: +Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 1 +select a,b from t1 order by a; +a b +0 two +1 one +3 three +4 four +set @arg00=0; +execute stmt1 using @arg01, @arg00; +select a,b from t1 order by a; +a b +1 one +2 two +3 three +4 four +set @arg00=23; +set @arg01='two'; +set @arg02=2; +set @arg03='two'; +set @arg04=2; +drop table if exists t2; +create table t2 as select a,b from t1 ; +prepare stmt1 from 'update t1 set a=? where b=? + and a in (select ? from t2 + where b = ? or a = ?)'; +execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04 ; +affected rows: 1 +info: Rows matched: 1 Changed: 1 Warnings: 0 +select a,b from t1 where a = @arg00 ; +a b +23 two +prepare stmt1 from 'update t1 set a=? where b=? + and a not in (select ? from t2 + where b = ? or a = ?)'; +execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ; +affected rows: 1 +info: Rows matched: 1 Changed: 1 Warnings: 0 +select a,b from t1 order by a ; +a b +1 one +2 two +3 three +4 four +drop table t2 ; +create table t2 +( +a int, b varchar(30), +primary key(a) +) engine = 'MYISAM' ; +insert into t2(a,b) select a, b from t1 ; +prepare stmt1 from 'update t1 set a=? where b=? + and a in (select ? from t2 + where b = ? or a = ?)'; +execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04 ; +affected rows: 1 +info: Rows matched: 1 Changed: 1 Warnings: 0 +select a,b from t1 where a = @arg00 ; +a b +23 two +prepare stmt1 from 'update t1 set a=? where b=? + and a not in (select ? from t2 + where b = ? or a = ?)'; +execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ; +affected rows: 1 +info: Rows matched: 1 Changed: 1 Warnings: 0 +select a,b from t1 order by a ; +a b +1 one +2 two +3 three +4 four +drop table t2 ; +set @arg00=1; +prepare stmt1 from 'update t1 set b=''bla'' +where a=2 +limit 1'; +execute stmt1 ; +select a,b from t1 where b = 'bla' ; +a b +2 bla +prepare stmt1 from 'update t1 set b=''bla'' +where a=2 +limit ?'; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?' at line 3 +test_sequence +------ insert tests ------ +delete from t1 ; +insert into t1 values (1,'one'); +insert into t1 values (2,'two'); +insert into t1 values (3,'three'); +insert into t1 values (4,'four'); +commit ; +delete from t9 ; +insert into t9 +set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, +c10= 1, c11= 1, c12 = 1, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=true, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; +insert into t9 +set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, +c10= 9, c11= 9, c12 = 9, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=false, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +commit ; +prepare stmt1 from 'insert into t1 values(5, ''five'' )'; +execute stmt1; +select a,b from t1 where a = 5; +a b +5 five +set @arg00='six' ; +prepare stmt1 from 'insert into t1 values(6, ? )'; +execute stmt1 using @arg00; +select a,b from t1 where b = @arg00; +a b +6 six +execute stmt1 using @arg00; +ERROR 23000: Duplicate entry '6' for key 1 +set @arg00=NULL ; +prepare stmt1 from 'insert into t1 values(0, ? )'; +execute stmt1 using @arg00; +select a,b from t1 where b is NULL; +a b +0 NULL +set @arg00=8 ; +set @arg01='eight' ; +prepare stmt1 from 'insert into t1 values(?, ? )'; +execute stmt1 using @arg00, @arg01 ; +select a,b from t1 where b = @arg01; +a b +8 eight +set @NULL= null ; +set @arg00= 'abc' ; +execute stmt1 using @NULL, @NULL ; +ERROR 23000: Column 'a' cannot be null +execute stmt1 using @NULL, @NULL ; +ERROR 23000: Column 'a' cannot be null +execute stmt1 using @NULL, @arg00 ; +ERROR 23000: Column 'a' cannot be null +execute stmt1 using @NULL, @arg00 ; +ERROR 23000: Column 'a' cannot be null +set @arg01= 10000 + 2 ; +execute stmt1 using @arg01, @arg00 ; +set @arg01= 10000 + 1 ; +execute stmt1 using @arg01, @arg00 ; +select * from t1 where a > 10000 order by a ; +a b +10001 abc +10002 abc +delete from t1 where a > 10000 ; +set @arg01= 10000 + 2 ; +execute stmt1 using @arg01, @NULL ; +set @arg01= 10000 + 1 ; +execute stmt1 using @arg01, @NULL ; +select * from t1 where a > 10000 order by a ; +a b +10001 NULL +10002 NULL +delete from t1 where a > 10000 ; +set @arg01= 10000 + 10 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 9 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 8 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 7 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 6 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 5 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 4 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 3 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 2 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 1 ; +execute stmt1 using @arg01, @arg01 ; +select * from t1 where a > 10000 order by a ; +a b +10001 10001 +10002 10002 +10003 10003 +10004 10004 +10005 10005 +10006 10006 +10007 10007 +10008 10008 +10009 10009 +10010 10010 +delete from t1 where a > 10000 ; +set @arg00=81 ; +set @arg01='8-1' ; +set @arg02=82 ; +set @arg03='8-2' ; +prepare stmt1 from 'insert into t1 values(?,?),(?,?)'; +execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; +select a,b from t1 where a in (@arg00,@arg02) ; +a b +81 8-1 +82 8-2 +set @arg00=9 ; +set @arg01='nine' ; +prepare stmt1 from 'insert into t1 set a=?, b=? '; +execute stmt1 using @arg00, @arg01 ; +select a,b from t1 where a = @arg00 ; +a b +9 nine +set @arg00=6 ; +set @arg01=1 ; +prepare stmt1 from 'insert into t1 set a=?, b=''sechs'' + on duplicate key update a=a + ?, b=concat(b,''modified'') '; +execute stmt1 using @arg00, @arg01; +select * from t1 order by a; +a b +0 NULL +1 one +2 two +3 three +4 four +5 five +7 sixmodified +8 eight +9 nine +81 8-1 +82 8-2 +set @arg00=81 ; +set @arg01=1 ; +execute stmt1 using @arg00, @arg01; +ERROR 23000: Duplicate entry '82' for key 1 +drop table if exists t2 ; +create table t2 (id int auto_increment primary key) +ENGINE= 'MYISAM' ; +prepare stmt1 from ' select last_insert_id() ' ; +insert into t2 values (NULL) ; +execute stmt1 ; +last_insert_id() +1 +insert into t2 values (NULL) ; +execute stmt1 ; +last_insert_id() +2 +drop table t2 ; +set @1000=1000 ; +set @x1000_2="x1000_2" ; +set @x1000_3="x1000_3" ; +set @x1000="x1000" ; +set @1100=1100 ; +set @x1100="x1100" ; +set @100=100 ; +set @updated="updated" ; +insert into t1 values(1000,'x1000_1') ; +insert into t1 values(@1000,@x1000_2),(@1000,@x1000_3) +on duplicate key update a = a + @100, b = concat(b,@updated) ; +select a,b from t1 where a >= 1000 order by a ; +a b +1000 x1000_3 +1100 x1000_1updated +delete from t1 where a >= 1000 ; +insert into t1 values(1000,'x1000_1') ; +prepare stmt1 from ' insert into t1 values(?,?),(?,?) + on duplicate key update a = a + ?, b = concat(b,?) '; +execute stmt1 using @1000, @x1000_2, @1000, @x1000_3, @100, @updated ; +select a,b from t1 where a >= 1000 order by a ; +a b +1000 x1000_3 +1100 x1000_1updated +delete from t1 where a >= 1000 ; +insert into t1 values(1000,'x1000_1') ; +execute stmt1 using @1000, @x1000_2, @1100, @x1000_3, @100, @updated ; +select a,b from t1 where a >= 1000 order by a ; +a b +1200 x1000_1updatedupdated +delete from t1 where a >= 1000 ; +prepare stmt1 from ' replace into t1 (a,b) select 100, ''hundred'' '; +execute stmt1; +execute stmt1; +execute stmt1; +test_sequence +------ multi table tests ------ +delete from t1 ; +delete from t9 ; +insert into t1(a,b) values (1, 'one'), (2, 'two'), (3, 'three') ; +insert into t9 (c1,c21) +values (1, 'one'), (2, 'two'), (3, 'three') ; +prepare stmt_delete from " delete t1, t9 + from t1, t9 where t1.a=t9.c1 and t1.b='updated' "; +prepare stmt_update from " update t1, t9 + set t1.b='updated', t9.c21='updated' + where t1.a=t9.c1 and t1.a=? "; +prepare stmt_select1 from " select a, b from t1 order by a" ; +prepare stmt_select2 from " select c1, c21 from t9 order by c1" ; +set @arg00= 1 ; +execute stmt_update using @arg00 ; +execute stmt_delete ; +execute stmt_select1 ; +a b +2 two +3 three +execute stmt_select2 ; +c1 c21 +2 two +3 three +set @arg00= @arg00 + 1 ; +execute stmt_update using @arg00 ; +execute stmt_delete ; +execute stmt_select1 ; +a b +3 three +execute stmt_select2 ; +c1 c21 +3 three +set @arg00= @arg00 + 1 ; +execute stmt_update using @arg00 ; +execute stmt_delete ; +execute stmt_select1 ; +a b +execute stmt_select2 ; +c1 c21 +set @arg00= @arg00 + 1 ; +delete from t1 ; +insert into t1 values (1,'one'); +insert into t1 values (2,'two'); +insert into t1 values (3,'three'); +insert into t1 values (4,'four'); +commit ; +delete from t9 ; +insert into t9 +set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, +c10= 1, c11= 1, c12 = 1, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=true, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; +insert into t9 +set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, +c10= 9, c11= 9, c12 = 9, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=false, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +commit ; +insert into t1 values(0,NULL) ; +set @duplicate='duplicate ' ; +set @1000=1000 ; +set @5=5 ; +select a,b from t1 where a < 5 order by a ; +a b +0 NULL +1 one +2 two +3 three +4 four +insert into t1 select a + @1000, concat(@duplicate,b) from t1 +where a < @5 ; +affected rows: 5 +info: Records: 5 Duplicates: 0 Warnings: 0 +select a,b from t1 where a >= 1000 order by a ; +a b +1000 NULL +1001 duplicate one +1002 duplicate two +1003 duplicate three +1004 duplicate four +delete from t1 where a >= 1000 ; +prepare stmt1 from ' insert into t1 select a + ?, concat(?,b) from t1 +where a < ? ' ; +execute stmt1 using @1000, @duplicate, @5; +affected rows: 5 +info: Records: 5 Duplicates: 0 Warnings: 0 +select a,b from t1 where a >= 1000 order by a ; +a b +1000 NULL +1001 duplicate one +1002 duplicate two +1003 duplicate three +1004 duplicate four +delete from t1 where a >= 1000 ; +set @float=1.00; +set @five='five' ; +drop table if exists t2; +create table t2 like t1 ; +insert into t2 (b,a) +select @duplicate, sum(first.a) from t1 first, t1 second +where first.a <> @5 and second.b = first.b +and second.b <> @five +group by second.b +having sum(second.a) > @2 +union +select b, a + @100 from t1 +where (a,b) in ( select sqrt(a+@1)+CAST(@float AS signed),b +from t1); +affected rows: 3 +info: Records: 3 Duplicates: 0 Warnings: 0 +select a,b from t2 order by a ; +a b +3 duplicate +4 duplicate +103 three +delete from t2 ; +prepare stmt1 from ' insert into t2 (b,a) +select ?, sum(first.a) + from t1 first, t1 second + where first.a <> ? and second.b = first.b and second.b <> ? + group by second.b + having sum(second.a) > ? +union +select b, a + ? from t1 + where (a,b) in ( select sqrt(a+?)+CAST(? AS signed),b + from t1 ) ' ; +execute stmt1 using @duplicate, @5, @five, @2, @100, @1, @float ; +affected rows: 3 +info: Records: 3 Duplicates: 0 Warnings: 0 +select a,b from t2 order by a ; +a b +3 duplicate +4 duplicate +103 three +drop table t2; +drop table if exists t5 ; +set @arg01= 8; +set @arg02= 8.0; +set @arg03= 80.00000000000e-1; +set @arg04= 'abc' ; +set @arg05= CAST('abc' as binary) ; +set @arg06= '1991-08-05' ; +set @arg07= CAST('1991-08-05' as date); +set @arg08= '1991-08-05 01:01:01' ; +set @arg09= CAST('1991-08-05 01:01:01' as datetime) ; +set @arg10= unix_timestamp('1991-01-01 01:01:01'); +set @arg11= YEAR('1991-01-01 01:01:01'); +set @arg12= 8 ; +set @arg12= NULL ; +set @arg13= 8.0 ; +set @arg13= NULL ; +set @arg14= 'abc'; +set @arg14= NULL ; +set @arg15= CAST('abc' as binary) ; +set @arg15= NULL ; +create table t5 as select +8 as const01, @arg01 as param01, +8.0 as const02, @arg02 as param02, +80.00000000000e-1 as const03, @arg03 as param03, +'abc' as const04, @arg04 as param04, +CAST('abc' as binary) as const05, @arg05 as param05, +'1991-08-05' as const06, @arg06 as param06, +CAST('1991-08-05' as date) as const07, @arg07 as param07, +'1991-08-05 01:01:01' as const08, @arg08 as param08, +CAST('1991-08-05 01:01:01' as datetime) as const09, @arg09 as param09, +unix_timestamp('1991-01-01 01:01:01') as const10, @arg10 as param10, +YEAR('1991-01-01 01:01:01') as const11, @arg11 as param11, +NULL as const12, @arg12 as param12, +@arg13 as param13, +@arg14 as param14, +@arg15 as param15; +show create table t5 ; +Table Create Table +t5 CREATE TABLE `t5` ( + `const01` bigint(1) NOT NULL default '0', + `param01` bigint(20) default NULL, + `const02` double(3,1) NOT NULL default '0.0', + `param02` double default NULL, + `const03` double NOT NULL default '0', + `param03` double default NULL, + `const04` char(3) NOT NULL default '', + `param04` longtext, + `const05` binary(3) NOT NULL default '', + `param05` longblob, + `const06` varchar(10) NOT NULL default '', + `param06` longtext, + `const07` date default NULL, + `param07` longblob, + `const08` varchar(19) NOT NULL default '', + `param08` longtext, + `const09` datetime default NULL, + `param09` longblob, + `const10` int(10) NOT NULL default '0', + `param10` bigint(20) default NULL, + `const11` int(4) default NULL, + `param11` bigint(20) default NULL, + `const12` binary(0) default NULL, + `param12` bigint(20) default NULL, + `param13` double default NULL, + `param14` longtext, + `param15` longblob +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select * from t5 ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def test t5 t5 const01 const01 8 1 1 N 32769 0 63 +def test t5 t5 param01 param01 8 20 1 Y 32768 0 63 +def test t5 t5 const02 const02 5 3 3 N 32769 1 63 +def test t5 t5 param02 param02 5 20 1 Y 32768 31 63 +def test t5 t5 const03 const03 5 23 1 N 32769 31 63 +def test t5 t5 param03 param03 5 20 1 Y 32768 31 63 +def test t5 t5 const04 const04 254 3 3 N 1 0 8 +def test t5 t5 param04 param04 252 16777215 3 Y 16 0 8 +def test t5 t5 const05 const05 254 3 3 N 129 0 63 +def test t5 t5 param05 param05 252 16777215 3 Y 144 0 63 +def test t5 t5 const06 const06 253 10 10 N 1 0 8 +def test t5 t5 param06 param06 252 16777215 10 Y 16 0 8 +def test t5 t5 const07 const07 10 10 10 Y 128 0 63 +def test t5 t5 param07 param07 252 16777215 10 Y 144 0 63 +def test t5 t5 const08 const08 253 19 19 N 1 0 8 +def test t5 t5 param08 param08 252 16777215 19 Y 16 0 8 +def test t5 t5 const09 const09 12 19 19 Y 128 0 63 +def test t5 t5 param09 param09 252 16777215 19 Y 144 0 63 +def test t5 t5 const10 const10 3 10 9 N 32769 0 63 +def test t5 t5 param10 param10 8 20 9 Y 32768 0 63 +def test t5 t5 const11 const11 3 4 4 Y 32768 0 63 +def test t5 t5 param11 param11 8 20 4 Y 32768 0 63 +def test t5 t5 const12 const12 254 0 0 Y 128 0 63 +def test t5 t5 param12 param12 8 20 0 Y 32768 0 63 +def test t5 t5 param13 param13 5 20 0 Y 32768 31 63 +def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8 +def test t5 t5 param15 param15 252 16777215 0 Y 144 0 63 +const01 8 +param01 8 +const02 8.0 +param02 8 +const03 8 +param03 8 +const04 abc +param04 abc +const05 abc +param05 abc +const06 1991-08-05 +param06 1991-08-05 +const07 1991-08-05 +param07 1991-08-05 +const08 1991-08-05 01:01:01 +param08 1991-08-05 01:01:01 +const09 1991-08-05 01:01:01 +param09 1991-08-05 01:01:01 +const10 662680861 +param10 662680861 +const11 1991 +param11 1991 +const12 NULL +param12 NULL +param13 NULL +param14 NULL +param15 NULL +drop table t5 ; +test_sequence +------ data type conversion tests ------ +delete from t1 ; +insert into t1 values (1,'one'); +insert into t1 values (2,'two'); +insert into t1 values (3,'three'); +insert into t1 values (4,'four'); +commit ; +delete from t9 ; +insert into t9 +set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, +c10= 1, c11= 1, c12 = 1, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=true, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; +insert into t9 +set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, +c10= 9, c11= 9, c12 = 9, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=false, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +commit ; +insert into t9 set c1= 0, c15= '1991-01-01 01:01:01' ; +select * from t9 order by c1 ; +c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday +test_sequence +------ select @parameter:= column ------ +prepare full_info from "select @arg01, @arg02, @arg03, @arg04, + @arg05, @arg06, @arg07, @arg08, + @arg09, @arg10, @arg11, @arg12, + @arg13, @arg14, @arg15, @arg16, + @arg17, @arg18, @arg19, @arg20, + @arg21, @arg22, @arg23, @arg24, + @arg25, @arg26, @arg27, @arg28, + @arg29, @arg30, @arg31, @arg32" ; +select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, +@arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8, +@arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12, +@arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16, +@arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20, +@arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24, +@arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28, +@arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32 +from t9 where c1= 1 ; +@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 +1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 1 Y 128 31 63 +def @arg03 254 20 1 Y 128 31 63 +def @arg04 254 20 1 Y 128 31 63 +def @arg05 254 20 1 Y 128 31 63 +def @arg06 254 20 1 Y 128 31 63 +def @arg07 254 20 1 Y 128 31 63 +def @arg08 254 20 1 Y 128 31 63 +def @arg09 254 20 1 Y 128 31 63 +def @arg10 254 20 1 Y 128 31 63 +def @arg11 254 20 1 Y 128 31 63 +def @arg12 254 20 1 Y 128 31 63 +def @arg13 254 8192 10 Y 128 31 63 +def @arg14 254 8192 19 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 8 Y 128 31 63 +def @arg17 254 20 4 Y 128 31 63 +def @arg18 254 20 1 Y 128 31 63 +def @arg19 254 20 1 Y 128 31 63 +def @arg20 254 8192 1 Y 0 31 8 +def @arg21 254 8192 10 Y 0 31 8 +def @arg22 254 8192 30 Y 0 31 8 +def @arg23 254 8192 8 Y 128 31 63 +def @arg24 254 8192 8 Y 0 31 8 +def @arg25 254 8192 4 Y 128 31 63 +def @arg26 254 8192 4 Y 0 31 8 +def @arg27 254 8192 10 Y 128 31 63 +def @arg28 254 8192 10 Y 0 31 8 +def @arg29 254 8192 8 Y 128 31 63 +def @arg30 254 8192 8 Y 0 31 8 +def @arg31 254 8192 3 Y 0 31 8 +def @arg32 254 8192 6 Y 128 31 63 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, +@arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8, +@arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12, +@arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16, +@arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20, +@arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24, +@arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28, +@arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32 +from t9 where c1= 0 ; +@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 0 Y 128 31 63 +def @arg03 254 20 0 Y 128 31 63 +def @arg04 254 20 0 Y 128 31 63 +def @arg05 254 20 0 Y 128 31 63 +def @arg06 254 20 0 Y 128 31 63 +def @arg07 254 20 0 Y 128 31 63 +def @arg08 254 20 0 Y 128 31 63 +def @arg09 254 20 0 Y 128 31 63 +def @arg10 254 20 0 Y 128 31 63 +def @arg11 254 20 0 Y 128 31 63 +def @arg12 254 20 0 Y 128 31 63 +def @arg13 254 8192 0 Y 128 31 63 +def @arg14 254 8192 0 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 0 Y 128 31 63 +def @arg17 254 20 0 Y 128 31 63 +def @arg18 254 20 0 Y 128 31 63 +def @arg19 254 20 0 Y 128 31 63 +def @arg20 254 8192 0 Y 0 31 8 +def @arg21 254 8192 0 Y 0 31 8 +def @arg22 254 8192 0 Y 0 31 8 +def @arg23 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 0 31 8 +def @arg25 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 0 31 8 +def @arg27 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 0 31 8 +def @arg29 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 0 31 8 +def @arg31 254 8192 0 Y 0 31 8 +def @arg32 254 8192 0 Y 0 31 8 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +prepare stmt1 from "select + @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, + @arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8, + @arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12, + @arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16, + @arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20, + @arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24, + @arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28, + @arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32 +from t9 where c1= ?" ; +set @my_key= 1 ; +execute stmt1 using @my_key ; +@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 +1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 1 Y 128 31 63 +def @arg03 254 20 1 Y 128 31 63 +def @arg04 254 20 1 Y 128 31 63 +def @arg05 254 20 1 Y 128 31 63 +def @arg06 254 20 1 Y 128 31 63 +def @arg07 254 20 1 Y 128 31 63 +def @arg08 254 20 1 Y 128 31 63 +def @arg09 254 20 1 Y 128 31 63 +def @arg10 254 20 1 Y 128 31 63 +def @arg11 254 20 1 Y 128 31 63 +def @arg12 254 20 1 Y 128 31 63 +def @arg13 254 8192 10 Y 128 31 63 +def @arg14 254 8192 19 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 8 Y 128 31 63 +def @arg17 254 20 4 Y 128 31 63 +def @arg18 254 20 1 Y 128 31 63 +def @arg19 254 20 1 Y 128 31 63 +def @arg20 254 8192 1 Y 0 31 8 +def @arg21 254 8192 10 Y 0 31 8 +def @arg22 254 8192 30 Y 0 31 8 +def @arg23 254 8192 8 Y 128 31 63 +def @arg24 254 8192 8 Y 0 31 8 +def @arg25 254 8192 4 Y 128 31 63 +def @arg26 254 8192 4 Y 0 31 8 +def @arg27 254 8192 10 Y 128 31 63 +def @arg28 254 8192 10 Y 0 31 8 +def @arg29 254 8192 8 Y 128 31 63 +def @arg30 254 8192 8 Y 0 31 8 +def @arg31 254 8192 3 Y 0 31 8 +def @arg32 254 8192 6 Y 128 31 63 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +set @my_key= 0 ; +execute stmt1 using @my_key ; +@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 0 Y 128 31 63 +def @arg03 254 20 0 Y 128 31 63 +def @arg04 254 20 0 Y 128 31 63 +def @arg05 254 20 0 Y 128 31 63 +def @arg06 254 20 0 Y 128 31 63 +def @arg07 254 20 0 Y 128 31 63 +def @arg08 254 20 0 Y 128 31 63 +def @arg09 254 20 0 Y 128 31 63 +def @arg10 254 20 0 Y 128 31 63 +def @arg11 254 20 0 Y 128 31 63 +def @arg12 254 20 0 Y 128 31 63 +def @arg13 254 8192 0 Y 128 31 63 +def @arg14 254 8192 0 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 0 Y 128 31 63 +def @arg17 254 20 0 Y 128 31 63 +def @arg18 254 20 0 Y 128 31 63 +def @arg19 254 20 0 Y 128 31 63 +def @arg20 254 8192 0 Y 0 31 8 +def @arg21 254 8192 0 Y 0 31 8 +def @arg22 254 8192 0 Y 0 31 8 +def @arg23 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 0 31 8 +def @arg25 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 0 31 8 +def @arg27 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 0 31 8 +def @arg29 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 0 31 8 +def @arg31 254 8192 0 Y 0 31 8 +def @arg32 254 8192 0 Y 0 31 8 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +prepare stmt1 from "select ? := c1 from t9 where c1= 1" ; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':= c1 from t9 where c1= 1' at line 1 +test_sequence +------ select column, .. into @parm,.. ------ +select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, +c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, +c25, c26, c27, c28, c29, c30, c31, c32 +into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, +@arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, +@arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24, +@arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 +from t9 where c1= 1 ; +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 1 Y 128 31 63 +def @arg03 254 20 1 Y 128 31 63 +def @arg04 254 20 1 Y 128 31 63 +def @arg05 254 20 1 Y 128 31 63 +def @arg06 254 20 1 Y 128 31 63 +def @arg07 254 20 1 Y 128 31 63 +def @arg08 254 20 1 Y 128 31 63 +def @arg09 254 20 1 Y 128 31 63 +def @arg10 254 20 1 Y 128 31 63 +def @arg11 254 20 1 Y 128 31 63 +def @arg12 254 20 1 Y 128 31 63 +def @arg13 254 8192 10 Y 128 31 63 +def @arg14 254 8192 19 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 8 Y 128 31 63 +def @arg17 254 20 4 Y 128 31 63 +def @arg18 254 20 1 Y 128 31 63 +def @arg19 254 20 1 Y 128 31 63 +def @arg20 254 8192 1 Y 0 31 8 +def @arg21 254 8192 10 Y 0 31 8 +def @arg22 254 8192 30 Y 0 31 8 +def @arg23 254 8192 8 Y 128 31 63 +def @arg24 254 8192 8 Y 0 31 8 +def @arg25 254 8192 4 Y 128 31 63 +def @arg26 254 8192 4 Y 0 31 8 +def @arg27 254 8192 10 Y 128 31 63 +def @arg28 254 8192 10 Y 0 31 8 +def @arg29 254 8192 8 Y 128 31 63 +def @arg30 254 8192 8 Y 0 31 8 +def @arg31 254 8192 3 Y 0 31 8 +def @arg32 254 8192 6 Y 128 31 63 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, +c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, +c25, c26, c27, c28, c29, c30, c31, c32 +into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, +@arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, +@arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24, +@arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 +from t9 where c1= 0 ; +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 0 Y 128 31 63 +def @arg03 254 20 0 Y 128 31 63 +def @arg04 254 20 0 Y 128 31 63 +def @arg05 254 20 0 Y 128 31 63 +def @arg06 254 20 0 Y 128 31 63 +def @arg07 254 20 0 Y 128 31 63 +def @arg08 254 20 0 Y 128 31 63 +def @arg09 254 20 0 Y 128 31 63 +def @arg10 254 20 0 Y 128 31 63 +def @arg11 254 20 0 Y 128 31 63 +def @arg12 254 20 0 Y 128 31 63 +def @arg13 254 8192 0 Y 128 31 63 +def @arg14 254 8192 0 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 0 Y 128 31 63 +def @arg17 254 20 0 Y 128 31 63 +def @arg18 254 20 0 Y 128 31 63 +def @arg19 254 20 0 Y 128 31 63 +def @arg20 254 8192 0 Y 0 31 8 +def @arg21 254 8192 0 Y 0 31 8 +def @arg22 254 8192 0 Y 0 31 8 +def @arg23 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 0 31 8 +def @arg25 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 0 31 8 +def @arg27 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 0 31 8 +def @arg29 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 0 31 8 +def @arg31 254 8192 0 Y 0 31 8 +def @arg32 254 8192 0 Y 0 31 8 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +prepare stmt1 from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, + c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, + c25, c26, c27, c28, c29, c30, c31, c32 +into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, + @arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, + @arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24, + @arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 +from t9 where c1= ?" ; +set @my_key= 1 ; +execute stmt1 using @my_key ; +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 1 Y 128 31 63 +def @arg03 254 20 1 Y 128 31 63 +def @arg04 254 20 1 Y 128 31 63 +def @arg05 254 20 1 Y 128 31 63 +def @arg06 254 20 1 Y 128 31 63 +def @arg07 254 20 1 Y 128 31 63 +def @arg08 254 20 1 Y 128 31 63 +def @arg09 254 20 1 Y 128 31 63 +def @arg10 254 20 1 Y 128 31 63 +def @arg11 254 20 1 Y 128 31 63 +def @arg12 254 20 1 Y 128 31 63 +def @arg13 254 8192 10 Y 128 31 63 +def @arg14 254 8192 19 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 8 Y 128 31 63 +def @arg17 254 20 4 Y 128 31 63 +def @arg18 254 20 1 Y 128 31 63 +def @arg19 254 20 1 Y 128 31 63 +def @arg20 254 8192 1 Y 0 31 8 +def @arg21 254 8192 10 Y 0 31 8 +def @arg22 254 8192 30 Y 0 31 8 +def @arg23 254 8192 8 Y 128 31 63 +def @arg24 254 8192 8 Y 0 31 8 +def @arg25 254 8192 4 Y 128 31 63 +def @arg26 254 8192 4 Y 0 31 8 +def @arg27 254 8192 10 Y 128 31 63 +def @arg28 254 8192 10 Y 0 31 8 +def @arg29 254 8192 8 Y 128 31 63 +def @arg30 254 8192 8 Y 0 31 8 +def @arg31 254 8192 3 Y 0 31 8 +def @arg32 254 8192 6 Y 128 31 63 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +set @my_key= 0 ; +execute stmt1 using @my_key ; +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 0 Y 128 31 63 +def @arg03 254 20 0 Y 128 31 63 +def @arg04 254 20 0 Y 128 31 63 +def @arg05 254 20 0 Y 128 31 63 +def @arg06 254 20 0 Y 128 31 63 +def @arg07 254 20 0 Y 128 31 63 +def @arg08 254 20 0 Y 128 31 63 +def @arg09 254 20 0 Y 128 31 63 +def @arg10 254 20 0 Y 128 31 63 +def @arg11 254 20 0 Y 128 31 63 +def @arg12 254 20 0 Y 128 31 63 +def @arg13 254 8192 0 Y 128 31 63 +def @arg14 254 8192 0 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 0 Y 128 31 63 +def @arg17 254 20 0 Y 128 31 63 +def @arg18 254 20 0 Y 128 31 63 +def @arg19 254 20 0 Y 128 31 63 +def @arg20 254 8192 0 Y 0 31 8 +def @arg21 254 8192 0 Y 0 31 8 +def @arg22 254 8192 0 Y 0 31 8 +def @arg23 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 0 31 8 +def @arg25 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 0 31 8 +def @arg27 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 0 31 8 +def @arg29 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 0 31 8 +def @arg31 254 8192 0 Y 0 31 8 +def @arg32 254 8192 0 Y 0 31 8 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +prepare stmt1 from "select c1 into ? from t9 where c1= 1" ; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? from t9 where c1= 1' at line 1 +test_sequence +-- insert into numeric columns -- +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20 ) ; +set @arg00= 21 ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt1 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22 )" ; +execute stmt1 ; +set @arg00= 23; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, +30.0, 30.0, 30.0 ) ; +set @arg00= 31.0 ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt1 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, + 32.0, 32.0, 32.0 )" ; +execute stmt1 ; +set @arg00= 33.0; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( '40', '40', '40', '40', '40', '40', '40', '40', +'40', '40', '40' ) ; +set @arg00= '41' ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt1 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( '42', '42', '42', '42', '42', '42', '42', '42', + '42', '42', '42' )" ; +execute stmt1 ; +set @arg00= '43'; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( CAST('50' as binary), CAST('50' as binary), +CAST('50' as binary), CAST('50' as binary), CAST('50' as binary), +CAST('50' as binary), CAST('50' as binary), CAST('50' as binary), +CAST('50' as binary), CAST('50' as binary), CAST('50' as binary) ) ; +set @arg00= CAST('51' as binary) ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt1 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( CAST('52' as binary), CAST('52' as binary), + CAST('52' as binary), CAST('52' as binary), CAST('52' as binary), + CAST('52' as binary), CAST('52' as binary), CAST('52' as binary), + CAST('52' as binary), CAST('52' as binary), CAST('52' as binary) )" ; +execute stmt1 ; +set @arg00= CAST('53' as binary) ; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +set @arg00= 2 ; +set @arg00= NULL ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( 60, NULL, NULL, NULL, NULL, NULL, NULL, NULL, +NULL, NULL, NULL ) ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( 61, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt1 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 62, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL )" ; +execute stmt1 ; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 63, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +set @arg00= 8.0 ; +set @arg00= NULL ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( 71, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 73, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +set @arg00= 'abc' ; +set @arg00= NULL ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( 81, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 83, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 +from t9 where c1 >= 20 +order by c1 ; +c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c12 +20 20 20 20 20 20 20 20 20 20 20.0000 +21 21 21 21 21 21 21 21 21 21 21.0000 +22 22 22 22 22 22 22 22 22 22 22.0000 +23 23 23 23 23 23 23 23 23 23 23.0000 +30 30 30 30 30 30 30 30 30 30 30.0000 +31 31 31 31 31 31 31 31 31 31 31.0000 +32 32 32 32 32 32 32 32 32 32 32.0000 +33 33 33 33 33 33 33 33 33 33 33.0000 +40 40 40 40 40 40 40 40 40 40 40.0000 +41 41 41 41 41 41 41 41 41 41 41.0000 +42 42 42 42 42 42 42 42 42 42 42.0000 +43 43 43 43 43 43 43 43 43 43 43.0000 +50 50 50 50 50 50 50 50 50 50 50.0000 +51 51 51 51 51 51 51 51 51 51 51.0000 +52 52 52 52 52 52 52 52 52 52 52.0000 +53 53 53 53 53 53 53 53 53 53 53.0000 +60 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +61 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +62 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +63 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +71 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +73 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +81 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +83 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +test_sequence +-- select .. where numeric column = .. -- +set @arg00= 20; +select 'true' as found from t9 +where c1= 20 and c2= 20 and c3= 20 and c4= 20 and c5= 20 and c6= 20 and c7= 20 +and c8= 20 and c9= 20 and c10= 20 and c12= 20; +found +true +select 'true' as found from t9 +where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 +and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 +and c12= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c2= 20 and c3= 20 and c4= 20 and c5= 20 and c6= 20 and c7= 20 + and c8= 20 and c9= 20 and c10= 20 and c12= 20 "; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? + and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? + and c12= ? "; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +found +true +set @arg00= 20.0; +select 'true' as found from t9 +where c1= 20.0 and c2= 20.0 and c3= 20.0 and c4= 20.0 and c5= 20.0 and c6= 20.0 +and c7= 20.0 and c8= 20.0 and c9= 20.0 and c10= 20.0 and c12= 20.0; +found +true +select 'true' as found from t9 +where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 +and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 +and c12= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20.0 and c2= 20.0 and c3= 20.0 and c4= 20.0 and c5= 20.0 and c6= 20.0 + and c7= 20.0 and c8= 20.0 and c9= 20.0 and c10= 20.0 and c12= 20.0 "; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? + and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? + and c12= ? "; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +found +true +select 'true' as found from t9 +where c1= '20' and c2= '20' and c3= '20' and c4= '20' and c5= '20' and c6= '20' + and c7= '20' and c8= '20' and c9= '20' and c10= '20' and c12= '20'; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= '20' and c2= '20' and c3= '20' and c4= '20' and c5= '20' and c6= '20' + and c7= '20' and c8= '20' and c9= '20' and c10= '20' and c12= '20' "; +execute stmt1 ; +found +true +set @arg00= '20'; +select 'true' as found from t9 +where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 +and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 +and c12= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? + and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? + and c12= ? "; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +found +true +select 'true' as found from t9 +where c1= CAST('20' as binary) and c2= CAST('20' as binary) and +c3= CAST('20' as binary) and c4= CAST('20' as binary) and +c5= CAST('20' as binary) and c6= CAST('20' as binary) and +c7= CAST('20' as binary) and c8= CAST('20' as binary) and +c9= CAST('20' as binary) and c10= CAST('20' as binary) and +c12= CAST('20' as binary); +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= CAST('20' as binary) and c2= CAST('20' as binary) and + c3= CAST('20' as binary) and c4= CAST('20' as binary) and + c5= CAST('20' as binary) and c6= CAST('20' as binary) and + c7= CAST('20' as binary) and c8= CAST('20' as binary) and + c9= CAST('20' as binary) and c10= CAST('20' as binary) and + c12= CAST('20' as binary) "; +execute stmt1 ; +found +true +set @arg00= CAST('20' as binary) ; +select 'true' as found from t9 +where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 +and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 +and c12= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? + and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? + and c12= ? "; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +found +true +delete from t9 ; +test_sequence +-- some numeric overflow experiments -- +prepare my_insert from "insert into t9 + ( c21, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 'O', ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +prepare my_select from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 +from t9 where c21 = 'O' "; +prepare my_delete from "delete from t9 where c21 = 'O' "; +set @arg00= 9223372036854775807 ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1264 Data truncated; out of range for column 'c1' at row 1 +Warning 1264 Data truncated; out of range for column 'c2' at row 1 +Warning 1264 Data truncated; out of range for column 'c3' at row 1 +Warning 1264 Data truncated; out of range for column 'c4' at row 1 +Warning 1264 Data truncated; out of range for column 'c5' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 127 +c2 32767 +c3 8388607 +c4 2147483647 +c5 2147483647 +c6 9223372036854775807 +c7 9.22337e+18 +c8 9.22337203685478e+18 +c9 9.22337203685478e+18 +c10 9.22337203685478e+18 +c12 99999.9999 +execute my_delete ; +set @arg00= '9223372036854775807' ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1264 Data truncated; out of range for column 'c1' at row 1 +Warning 1264 Data truncated; out of range for column 'c2' at row 1 +Warning 1264 Data truncated; out of range for column 'c3' at row 1 +Warning 1265 Data truncated for column 'c4' at row 1 +Warning 1265 Data truncated for column 'c5' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 127 +c2 32767 +c3 8388607 +c4 2147483647 +c5 2147483647 +c6 9223372036854775807 +c7 9.22337e+18 +c8 9.22337203685478e+18 +c9 9.22337203685478e+18 +c10 9.22337203685478e+18 +c12 99999.9999 +execute my_delete ; +set @arg00= -9223372036854775808 ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1264 Data truncated; out of range for column 'c1' at row 1 +Warning 1264 Data truncated; out of range for column 'c2' at row 1 +Warning 1264 Data truncated; out of range for column 'c3' at row 1 +Warning 1264 Data truncated; out of range for column 'c4' at row 1 +Warning 1264 Data truncated; out of range for column 'c5' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 -128 +c2 -32768 +c3 -8388608 +c4 -2147483648 +c5 -2147483648 +c6 -9223372036854775808 +c7 -9.22337e+18 +c8 -9.22337203685478e+18 +c9 -9.22337203685478e+18 +c10 -9.22337203685478e+18 +c12 -9999.9999 +execute my_delete ; +set @arg00= '-9223372036854775808' ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1264 Data truncated; out of range for column 'c1' at row 1 +Warning 1264 Data truncated; out of range for column 'c2' at row 1 +Warning 1264 Data truncated; out of range for column 'c3' at row 1 +Warning 1265 Data truncated for column 'c4' at row 1 +Warning 1265 Data truncated for column 'c5' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 -128 +c2 -32768 +c3 -8388608 +c4 -2147483648 +c5 -2147483648 +c6 -9223372036854775808 +c7 -9.22337e+18 +c8 -9.22337203685478e+18 +c9 -9.22337203685478e+18 +c10 -9.22337203685478e+18 +c12 -9999.9999 +execute my_delete ; +set @arg00= 1.11111111111111111111e+50 ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1264 Data truncated; out of range for column 'c1' at row 1 +Warning 1264 Data truncated; out of range for column 'c2' at row 1 +Warning 1264 Data truncated; out of range for column 'c3' at row 1 +Warning 1264 Data truncated; out of range for column 'c4' at row 1 +Warning 1264 Data truncated; out of range for column 'c5' at row 1 +Warning 1264 Data truncated; out of range for column 'c6' at row 1 +Warning 1264 Data truncated; out of range for column 'c7' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 127 +c2 32767 +c3 8388607 +c4 2147483647 +c5 2147483647 +c6 9223372036854775807 +c7 3.40282e+38 +c8 1.11111111111111e+50 +c9 1.11111111111111e+50 +c10 1.11111111111111e+50 +c12 99999.9999 +execute my_delete ; +set @arg00= '1.11111111111111111111e+50' ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1265 Data truncated for column 'c1' at row 1 +Warning 1265 Data truncated for column 'c2' at row 1 +Warning 1265 Data truncated for column 'c3' at row 1 +Warning 1265 Data truncated for column 'c4' at row 1 +Warning 1265 Data truncated for column 'c5' at row 1 +Warning 1265 Data truncated for column 'c6' at row 1 +Warning 1264 Data truncated; out of range for column 'c7' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 1 +c2 1 +c3 1 +c4 1 +c5 1 +c6 1 +c7 3.40282e+38 +c8 1.11111111111111e+50 +c9 1.11111111111111e+50 +c10 1.11111111111111e+50 +c12 99999.9999 +execute my_delete ; +set @arg00= -1.11111111111111111111e+50 ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1264 Data truncated; out of range for column 'c1' at row 1 +Warning 1264 Data truncated; out of range for column 'c2' at row 1 +Warning 1264 Data truncated; out of range for column 'c3' at row 1 +Warning 1264 Data truncated; out of range for column 'c4' at row 1 +Warning 1264 Data truncated; out of range for column 'c5' at row 1 +Warning 1264 Data truncated; out of range for column 'c6' at row 1 +Warning 1264 Data truncated; out of range for column 'c7' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 -128 +c2 -32768 +c3 -8388608 +c4 -2147483648 +c5 -2147483648 +c6 -9223372036854775808 +c7 -3.40282e+38 +c8 -1.11111111111111e+50 +c9 -1.11111111111111e+50 +c10 -1.11111111111111e+50 +c12 -9999.9999 +execute my_delete ; +set @arg00= '-1.11111111111111111111e+50' ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1265 Data truncated for column 'c1' at row 1 +Warning 1265 Data truncated for column 'c2' at row 1 +Warning 1265 Data truncated for column 'c3' at row 1 +Warning 1265 Data truncated for column 'c4' at row 1 +Warning 1265 Data truncated for column 'c5' at row 1 +Warning 1265 Data truncated for column 'c6' at row 1 +Warning 1264 Data truncated; out of range for column 'c7' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 -1 +c2 -1 +c3 -1 +c4 -1 +c5 -1 +c6 -1 +c7 -3.40282e+38 +c8 -1.11111111111111e+50 +c9 -1.11111111111111e+50 +c10 -1.11111111111111e+50 +c12 -9999.9999 +execute my_delete ; +test_sequence +-- insert into string columns -- +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +select c1, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30 +from t9 where c1 >= 20 +order by c1 ; +c1 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 +20 2 20 20 20 20 20 20 20 20 20 20 +21 2 21 21 21 21 21 21 21 21 21 21 +22 2 22 22 22 22 22 22 22 22 22 22 +23 2 23 23 23 23 23 23 23 23 23 23 +30 3 30 30 30 30 30 30 30 30 30 30 +31 3 31 31 31 31 31 31 31 31 31 31 +32 3 32 32 32 32 32 32 32 32 32 32 +33 3 33 33 33 33 33 33 33 33 33 33 +40 4 40 40 40 40 40 40 40 40 40 40 +41 4 41 41 41 41 41 41 41 41 41 41 +42 4 42 42 42 42 42 42 42 42 42 42 +43 4 43 43 43 43 43 43 43 43 43 43 +50 5 50 50 50.00 50.00 50.00 50.00 50.00 50.00 50.00 50.00 +51 5 51 51 51 51 51 51 51 51 51 51 +52 5 52 52 52.00 52.00 52.00 52.00 52.00 52.00 52.00 52.00 +53 5 53 53 53.00 53.00 53.00 53.00 53.00 53.00 53.00 53.00 +54 5 54 54 54.00 54.00 54.00 54.00 54.00 54.00 54.00 54.00 +55 5 55 55 55 55 55 55 55 55 55 55 +56 6 56 56 56.00 56.00 56.00 56.00 56.00 56.00 56.00 56.00 +57 6 57 57 57.00 57.00 57.00 57.00 57.00 57.00 57.00 57.00 +60 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +61 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +62 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +63 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +71 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +73 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +81 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +83 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +test_sequence +-- select .. where string column = .. -- +set @arg00= '20'; +select 'true' as found from t9 +where c1= 20 and concat(c20,substr('20',1+length(c20)))= '20' and c21= '20' and +c22= '20' and c23= '20' and c24= '20' and c25= '20' and c26= '20' and +c27= '20' and c28= '20' and c29= '20' and c30= '20' ; +found +true +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and +c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and +c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr('20',1+length(c20)))= '20' and c21= '20' and + c22= '20' and c23= '20' and c24= '20' and c25= '20' and c26= '20' and + c27= '20' and c28= '20' and c29= '20' and c30= '20'" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and + c21= ? and c22= ? and c23= ? and c25= ? and + c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +found +true +set @arg00= CAST('20' as binary); +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(CAST('20' as binary),1+length(c20))) += CAST('20' as binary) and c21= CAST('20' as binary) +and c22= CAST('20' as binary) and c23= CAST('20' as binary) and +c24= CAST('20' as binary) and c25= CAST('20' as binary) and +c26= CAST('20' as binary) and c27= CAST('20' as binary) and +c28= CAST('20' as binary) and c29= CAST('20' as binary) and +c30= CAST('20' as binary) ; +found +true +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(@arg00,1+length(c20))) = @arg00 and +c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and +c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and +c30= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(CAST('20' as binary),1+length(c20))) + = CAST('20' as binary) and c21= CAST('20' as binary) + and c22= CAST('20' as binary) and c23= CAST('20' as binary) and + c24= CAST('20' as binary) and c25= CAST('20' as binary) and + c26= CAST('20' as binary) and c27= CAST('20' as binary) and + c28= CAST('20' as binary) and c29= CAST('20' as binary) and + c30= CAST('20' as binary)" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(?,1+length(c20))) = ? and c21= ? and + c22= ? and c23= ? and c25= ? and c26= ? and c27= ? and c28= ? and + c29= ? and c30= ?"; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +found +true +set @arg00= 20; +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(20,1+length(c20)))= 20 and c21= 20 and +c22= 20 and c23= 20 and c24= 20 and c25= 20 and c26= 20 and +c27= 20 and c28= 20 and c29= 20 and c30= 20 ; +found +true +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and +c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and +c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(20,1+length(c20)))= 20 and c21= 20 and + c22= 20 and c23= 20 and c24= 20 and c25= 20 and c26= 20 and + c27= 20 and c28= 20 and c29= 20 and c30= 20" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and + c21= ? and c22= ? and c23= ? and c25= ? and + c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +found +true +set @arg00= 20.0; +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(20.0,1+length(c20)))= 20.0 and c21= 20.0 and +c22= 20.0 and c23= 20.0 and c24= 20.0 and c25= 20.0 and c26= 20.0 and +c27= 20.0 and c28= 20.0 and c29= 20.0 and c30= 20.0 ; +found +true +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and +c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and +c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(20.0,1+length(c20)))= 20.0 and c21= 20.0 and + c22= 20.0 and c23= 20.0 and c24= 20.0 and c25= 20.0 and c26= 20.0 and + c27= 20.0 and c28= 20.0 and c29= 20.0 and c30= 20.0" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and + c21= ? and c22= ? and c23= ? and c25= ? and + c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +found +true +delete from t9 ; +test_sequence +-- insert into date/time columns -- +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1264 Data truncated; out of range for column 'c13' at row 1 +Warning 1265 Data truncated for column 'c14' at row 1 +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1264 Data truncated; out of range for column 'c13' at row 1 +Warning 1265 Data truncated for column 'c14' at row 1 +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1264 Data truncated; out of range for column 'c13' at row 1 +Warning 1265 Data truncated for column 'c14' at row 1 +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1264 Data truncated; out of range for column 'c13' at row 1 +Warning 1265 Data truncated for column 'c14' at row 1 +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +select c1, c13, c14, c15, c16, c17 from t9 order by c1 ; +c1 c13 c14 c15 c16 c17 +20 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +21 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +22 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +23 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +30 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +31 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +32 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +33 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +40 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +41 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +42 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +43 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +50 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +51 0010-00-00 0010-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +52 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +53 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +60 NULL NULL 1991-01-01 01:01:01 NULL NULL +61 NULL NULL 1991-01-01 01:01:01 NULL NULL +62 NULL NULL 1991-01-01 01:01:01 NULL NULL +63 NULL NULL 1991-01-01 01:01:01 NULL NULL +71 NULL NULL 1991-01-01 01:01:01 NULL NULL +73 NULL NULL 1991-01-01 01:01:01 NULL NULL +81 NULL NULL 1991-01-01 01:01:01 NULL NULL +83 NULL NULL 1991-01-01 01:01:01 NULL NULL +test_sequence +-- select .. where date/time column = .. -- +set @arg00= '1991-01-01 01:01:01' ; +select 'true' as found from t9 +where c1= 20 and c13= '1991-01-01 01:01:01' and c14= '1991-01-01 01:01:01' and +c15= '1991-01-01 01:01:01' and c16= '1991-01-01 01:01:01' and +c17= '1991-01-01 01:01:01' ; +found +true +select 'true' as found from t9 +where c1= 20 and c13= @arg00 and c14= @arg00 and c15= @arg00 and c16= @arg00 +and c17= @arg00 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c13= '1991-01-01 01:01:01' and c14= '1991-01-01 01:01:01' and + c15= '1991-01-01 01:01:01' and c16= '1991-01-01 01:01:01' and + c17= '1991-01-01 01:01:01'" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c13= ? and c14= ? and c15= ? and c16= ? and c17= ?" ; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00 ; +found +true +set @arg00= CAST('1991-01-01 01:01:01' as datetime) ; +select 'true' as found from t9 +where c1= 20 and c13= CAST('1991-01-01 01:01:01' as datetime) and +c14= CAST('1991-01-01 01:01:01' as datetime) and +c15= CAST('1991-01-01 01:01:01' as datetime) and +c16= CAST('1991-01-01 01:01:01' as datetime) and +c17= CAST('1991-01-01 01:01:01' as datetime) ; +found +true +select 'true' as found from t9 +where c1= 20 and c13= @arg00 and c14= @arg00 and c15= @arg00 and c16= @arg00 +and c17= @arg00 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c13= CAST('1991-01-01 01:01:01' as datetime) and + c14= CAST('1991-01-01 01:01:01' as datetime) and + c15= CAST('1991-01-01 01:01:01' as datetime) and + c16= CAST('1991-01-01 01:01:01' as datetime) and + c17= CAST('1991-01-01 01:01:01' as datetime)" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c13= ? and c14= ? and c15= ? and c16= ? and c17= ?" ; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00 ; +found +true +set @arg00= 1991 ; +select 'true' as found from t9 +where c1= 20 and c17= 1991 ; +found +true +select 'true' as found from t9 +where c1= 20 and c17= @arg00 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c17= 1991" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c17= ?" ; +execute stmt1 using @arg00 ; +found +true +set @arg00= 1.991e+3 ; +select 'true' as found from t9 +where c1= 20 and abs(c17 - 1.991e+3) < 0.01 ; +found +true +select 'true' as found from t9 +where c1= 20 and abs(c17 - @arg00) < 0.01 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and abs(c17 - 1.991e+3) < 0.01" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and abs(c17 - ?) < 0.01" ; +execute stmt1 using @arg00 ; +found +true +drop table t1, t9; diff --git a/mysql-test/r/ps_3innodb.result.es b/mysql-test/r/ps_3innodb.result.es new file mode 100644 index 00000000000..9386f18a4df --- /dev/null +++ b/mysql-test/r/ps_3innodb.result.es @@ -0,0 +1,3113 @@ +use test; +drop table if exists t1, t9 ; +create table t1 +( +a int, b varchar(30), +primary key(a) +) engine = 'InnoDB' ; +create table t9 +( +c1 tinyint, c2 smallint, c3 mediumint, c4 int, +c5 integer, c6 bigint, c7 float, c8 double, +c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4), +c13 date, c14 datetime, c15 timestamp(14), c16 time, +c17 year, c18 bit, c19 bool, c20 char, +c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext, +c25 blob, c26 text, c27 mediumblob, c28 mediumtext, +c29 longblob, c30 longtext, c31 enum('one', 'two', 'three'), +c32 set('monday', 'tuesday', 'wednesday'), +primary key(c1) +) engine = 'InnoDB' ; +delete from t1 ; +insert into t1 values (1,'one'); +insert into t1 values (2,'two'); +insert into t1 values (3,'three'); +insert into t1 values (4,'four'); +commit ; +delete from t9 ; +insert into t9 +set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, +c10= 1, c11= 1, c12 = 1, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=true, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; +insert into t9 +set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, +c10= 9, c11= 9, c12 = 9, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=false, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +commit ; +test_sequence +------ simple select tests ------ +prepare stmt1 from ' select * from t9 order by c1 ' ; +execute stmt1; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def test t9 t9 c1 c1 1 4 1 N 49155 0 63 +def test t9 t9 c2 c2 2 6 1 Y 32768 0 63 +def test t9 t9 c3 c3 9 9 1 Y 32768 0 63 +def test t9 t9 c4 c4 3 11 1 Y 32768 0 63 +def test t9 t9 c5 c5 3 11 1 Y 32768 0 63 +def test t9 t9 c6 c6 8 20 1 Y 32768 0 63 +def test t9 t9 c7 c7 4 12 1 Y 32768 31 63 +def test t9 t9 c8 c8 5 22 1 Y 32768 31 63 +def test t9 t9 c9 c9 5 22 1 Y 32768 31 63 +def test t9 t9 c10 c10 5 22 1 Y 32768 31 63 +def test t9 t9 c11 c11 0 9 6 Y 32768 4 63 +def test t9 t9 c12 c12 0 10 6 Y 32768 4 63 +def test t9 t9 c13 c13 10 10 10 Y 128 0 63 +def test t9 t9 c14 c14 12 19 19 Y 128 0 63 +def test t9 t9 c15 c15 7 19 19 N 1249 0 63 +def test t9 t9 c16 c16 11 8 8 Y 128 0 63 +def test t9 t9 c17 c17 13 4 4 Y 32864 0 63 +def test t9 t9 c18 c18 1 1 1 Y 32768 0 63 +def test t9 t9 c19 c19 1 1 1 Y 32768 0 63 +def test t9 t9 c20 c20 254 1 1 Y 0 0 8 +def test t9 t9 c21 c21 253 10 10 Y 0 0 8 +def test t9 t9 c22 c22 253 30 30 Y 0 0 8 +def test t9 t9 c23 c23 252 255 8 Y 144 0 63 +def test t9 t9 c24 c24 252 255 8 Y 16 0 8 +def test t9 t9 c25 c25 252 65535 4 Y 144 0 63 +def test t9 t9 c26 c26 252 65535 4 Y 16 0 8 +def test t9 t9 c27 c27 252 16777215 10 Y 144 0 63 +def test t9 t9 c28 c28 252 16777215 10 Y 16 0 8 +def test t9 t9 c29 c29 252 16777215 8 Y 144 0 63 +def test t9 t9 c30 c30 252 16777215 8 Y 16 0 8 +def test t9 t9 c31 c31 254 5 3 Y 256 0 8 +def test t9 t9 c32 c32 254 24 7 Y 2048 0 8 +c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32 +1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday +set @arg00='SELECT' ; +prepare stmt1 from ' ? a from t1 where a=1 '; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? a from t1 where a=1' at line 1 +set @arg00=1 ; +select @arg00, b from t1 where a=1 ; +@arg00 b +1 one +prepare stmt1 from ' select ?, b from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +? b +1 one +set @arg00='lion' ; +select @arg00, b from t1 where a=1 ; +@arg00 b +lion one +prepare stmt1 from ' select ?, b from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +? b +lion one +set @arg00=NULL ; +select @arg00, b from t1 where a=1 ; +@arg00 b +NULL one +prepare stmt1 from ' select ?, b from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +? b +NULL one +set @arg00=1 ; +select b, a - @arg00 from t1 where a=1 ; +b a - @arg00 +one 0 +prepare stmt1 from ' select b, a - ? from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +b a - ? +one 0 +set @arg00=null ; +select @arg00 as my_col ; +my_col +NULL +prepare stmt1 from ' select ? as my_col'; +execute stmt1 using @arg00 ; +my_col +NULL +select @arg00 + 1 as my_col ; +my_col +NULL +prepare stmt1 from ' select ? + 1 as my_col'; +execute stmt1 using @arg00 ; +my_col +NULL +select 1 + @arg00 as my_col ; +my_col +NULL +prepare stmt1 from ' select 1 + ? as my_col'; +execute stmt1 using @arg00 ; +my_col +NULL +set @arg00='MySQL' ; +select substr(@arg00,1,2) from t1 where a=1 ; +substr(@arg00,1,2) +My +prepare stmt1 from ' select substr(?,1,2) from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +substr(?,1,2) +My +set @arg00=3 ; +select substr('MySQL',@arg00,5) from t1 where a=1 ; +substr('MySQL',@arg00,5) +SQL +prepare stmt1 from ' select substr(''MySQL'',?,5) from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +substr('MySQL',?,5) +SQL +select substr('MySQL',1,@arg00) from t1 where a=1 ; +substr('MySQL',1,@arg00) +MyS +prepare stmt1 from ' select substr(''MySQL'',1,?) from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +substr('MySQL',1,?) +MyS +set @arg00='MySQL' ; +select a , concat(@arg00,b) from t1 order by a; +a concat(@arg00,b) +1 MySQLone +2 MySQLtwo +3 MySQLthree +4 MySQLfour +prepare stmt1 from ' select a , concat(?,b) from t1 order by a ' ; +execute stmt1 using @arg00; +a concat(?,b) +1 MySQLone +2 MySQLtwo +3 MySQLthree +4 MySQLfour +select a , concat(b,@arg00) from t1 order by a ; +a concat(b,@arg00) +1 oneMySQL +2 twoMySQL +3 threeMySQL +4 fourMySQL +prepare stmt1 from ' select a , concat(b,?) from t1 order by a ' ; +execute stmt1 using @arg00; +a concat(b,?) +1 oneMySQL +2 twoMySQL +3 threeMySQL +4 fourMySQL +set @arg00='MySQL' ; +select group_concat(@arg00,b order by a) from t1 +group by 'a' ; +group_concat(@arg00,b order by a) +MySQLone,MySQLtwo,MySQLthree,MySQLfour +prepare stmt1 from ' select group_concat(?,b order by a) from t1 +group by ''a'' ' ; +execute stmt1 using @arg00; +group_concat(?,b order by a) +MySQLone,MySQLtwo,MySQLthree,MySQLfour +select group_concat(b,@arg00 order by a) from t1 +group by 'a' ; +group_concat(b,@arg00 order by a) +oneMySQL,twoMySQL,threeMySQL,fourMySQL +prepare stmt1 from ' select group_concat(b,? order by a) from t1 +group by ''a'' ' ; +execute stmt1 using @arg00; +group_concat(b,? order by a) +oneMySQL,twoMySQL,threeMySQL,fourMySQL +set @arg00='first' ; +set @arg01='second' ; +set @arg02=NULL; +select @arg00, @arg01 from t1 where a=1 ; +@arg00 @arg01 +first second +prepare stmt1 from ' select ?, ? from t1 where a=1 ' ; +execute stmt1 using @arg00, @arg01 ; +? ? +first second +execute stmt1 using @arg02, @arg01 ; +? ? +NULL second +execute stmt1 using @arg00, @arg02 ; +? ? +first NULL +execute stmt1 using @arg02, @arg02 ; +? ? +NULL NULL +drop table if exists t5 ; +create table t5 (id1 int(11) not null default '0', +value2 varchar(100), value1 varchar(100)) ; +insert into t5 values (1,'hh','hh'),(2,'hh','hh'), +(1,'ii','ii'),(2,'ii','ii') ; +prepare stmt1 from ' select id1,value1 from t5 where id1=? or value1=? order by id1,value1 ' ; +set @arg00=1 ; +set @arg01='hh' ; +execute stmt1 using @arg00, @arg01 ; +id1 value1 +1 hh +1 ii +2 hh +drop table t5 ; +drop table if exists t5 ; +create table t5(session_id char(9) not null) ; +insert into t5 values ('abc') ; +prepare stmt1 from ' select * from t5 +where ?=''1111'' and session_id = ''abc'' ' ; +set @arg00='abc' ; +execute stmt1 using @arg00 ; +session_id +set @arg00='1111' ; +execute stmt1 using @arg00 ; +session_id +abc +set @arg00='abc' ; +execute stmt1 using @arg00 ; +session_id +drop table t5 ; +set @arg00='FROM' ; +select a @arg00 t1 where a=1 ; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 t1 where a=1' at line 1 +prepare stmt1 from ' select a ? t1 where a=1 ' ; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? t1 where a=1' at line 1 +set @arg00='t1' ; +select a from @arg00 where a=1 ; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 where a=1' at line 1 +prepare stmt1 from ' select a from ? where a=1 ' ; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? where a=1' at line 1 +set @arg00='WHERE' ; +select a from t1 @arg00 a=1 ; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 a=1' at line 1 +prepare stmt1 from ' select a from t1 ? a=1 ' ; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? a=1' at line 1 +set @arg00=1 ; +select a FROM t1 where a=@arg00 ; +a +1 +prepare stmt1 from ' select a FROM t1 where a=? ' ; +execute stmt1 using @arg00 ; +a +1 +set @arg00=1000 ; +execute stmt1 using @arg00 ; +a +set @arg00=NULL ; +select a FROM t1 where a=@arg00 ; +a +prepare stmt1 from ' select a FROM t1 where a=? ' ; +execute stmt1 using @arg00 ; +a +set @arg00=4 ; +select a FROM t1 where a=sqrt(@arg00) ; +a +2 +prepare stmt1 from ' select a FROM t1 where a=sqrt(?) ' ; +execute stmt1 using @arg00 ; +a +2 +set @arg00=NULL ; +select a FROM t1 where a=sqrt(@arg00) ; +a +prepare stmt1 from ' select a FROM t1 where a=sqrt(?) ' ; +execute stmt1 using @arg00 ; +a +set @arg00=2 ; +set @arg01=3 ; +select a FROM t1 where a in (@arg00,@arg01) order by a; +a +2 +3 +prepare stmt1 from ' select a FROM t1 where a in (?,?) order by a '; +execute stmt1 using @arg00, @arg01; +a +2 +3 +set @arg00= 'one' ; +set @arg01= 'two' ; +set @arg02= 'five' ; +prepare stmt1 from ' select b FROM t1 where b in (?,?,?) order by b ' ; +execute stmt1 using @arg00, @arg01, @arg02 ; +b +one +two +prepare stmt1 from ' select b FROM t1 where b like ? '; +set @arg00='two' ; +execute stmt1 using @arg00 ; +b +two +set @arg00='tw%' ; +execute stmt1 using @arg00 ; +b +two +set @arg00='%wo' ; +execute stmt1 using @arg00 ; +b +two +set @arg00=null ; +insert into t9 set c1= 0, c5 = NULL ; +select c5 from t9 where c5 > NULL ; +c5 +prepare stmt1 from ' select c5 from t9 where c5 > ? '; +execute stmt1 using @arg00 ; +c5 +select c5 from t9 where c5 < NULL ; +c5 +prepare stmt1 from ' select c5 from t9 where c5 < ? '; +execute stmt1 using @arg00 ; +c5 +select c5 from t9 where c5 = NULL ; +c5 +prepare stmt1 from ' select c5 from t9 where c5 = ? '; +execute stmt1 using @arg00 ; +c5 +select c5 from t9 where c5 <=> NULL ; +c5 +NULL +prepare stmt1 from ' select c5 from t9 where c5 <=> ? '; +execute stmt1 using @arg00 ; +c5 +NULL +delete from t9 where c1= 0 ; +set @arg00='>' ; +select a FROM t1 where a @arg00 1 ; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 1' at line 1 +prepare stmt1 from ' select a FROM t1 where a ? 1 ' ; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? 1' at line 1 +set @arg00=1 ; +select a,b FROM t1 where a is not NULL +AND b is not NULL group by a - @arg00 ; +a b +1 one +2 two +3 three +4 four +prepare stmt1 from ' select a,b FROM t1 where a is not NULL +AND b is not NULL group by a - ? ' ; +execute stmt1 using @arg00 ; +a b +1 one +2 two +3 three +4 four +set @arg00='two' ; +select a,b FROM t1 where a is not NULL +AND b is not NULL having b <> @arg00 order by a ; +a b +1 one +3 three +4 four +prepare stmt1 from ' select a,b FROM t1 where a is not NULL +AND b is not NULL having b <> ? order by a ' ; +execute stmt1 using @arg00 ; +a b +1 one +3 three +4 four +set @arg00=1 ; +select a,b FROM t1 where a is not NULL +AND b is not NULL order by a - @arg00 ; +a b +1 one +2 two +3 three +4 four +prepare stmt1 from ' select a,b FROM t1 where a is not NULL +AND b is not NULL order by a - ? ' ; +execute stmt1 using @arg00 ; +a b +1 one +2 two +3 three +4 four +set @arg00=2 ; +select a,b from t1 order by 2 ; +a b +4 four +1 one +3 three +2 two +prepare stmt1 from ' select a,b from t1 +order by ? '; +execute stmt1 using @arg00; +a b +4 four +1 one +3 three +2 two +set @arg00=1 ; +execute stmt1 using @arg00; +a b +1 one +2 two +3 three +4 four +set @arg00=0 ; +execute stmt1 using @arg00; +ERROR 42S22: Unknown column '?' in 'order clause' +set @arg00=1; +prepare stmt1 from ' select a,b from t1 order by a +limit 1 '; +execute stmt1 ; +a b +1 one +prepare stmt1 from ' select a,b from t1 +limit ? '; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?' at line 2 +set @arg00='b' ; +set @arg01=0 ; +set @arg02=2 ; +set @arg03=2 ; +select sum(a), @arg00 from t1 where a > @arg01 +and b is not null group by substr(b,@arg02) +having sum(a) <> @arg03 ; +sum(a) @arg00 +3 b +1 b +4 b +prepare stmt1 from ' select sum(a), ? from t1 where a > ? +and b is not null group by substr(b,?) +having sum(a) <> ? '; +execute stmt1 using @arg00, @arg01, @arg02, @arg03; +sum(a) ? +3 b +1 b +4 b +test_sequence +------ join tests ------ +select first.a as a1, second.a as a2 +from t1 first, t1 second +where first.a = second.a order by a1 ; +a1 a2 +1 1 +2 2 +3 3 +4 4 +prepare stmt1 from ' select first.a as a1, second.a as a2 + from t1 first, t1 second + where first.a = second.a order by a1 '; +execute stmt1 ; +a1 a2 +1 1 +2 2 +3 3 +4 4 +set @arg00='ABC'; +set @arg01='two'; +set @arg02='one'; +select first.a, @arg00, second.a FROM t1 first, t1 second +where @arg01 = first.b or first.a = second.a or second.b = @arg02 +order by second.a, first.a; +a @arg00 a +1 ABC 1 +2 ABC 1 +3 ABC 1 +4 ABC 1 +2 ABC 2 +2 ABC 3 +3 ABC 3 +2 ABC 4 +4 ABC 4 +prepare stmt1 from ' select first.a, ?, second.a FROM t1 first, t1 second + where ? = first.b or first.a = second.a or second.b = ? + order by second.a, first.a'; +execute stmt1 using @arg00, @arg01, @arg02; +a ? a +1 ABC 1 +2 ABC 1 +3 ABC 1 +4 ABC 1 +2 ABC 2 +2 ABC 3 +3 ABC 3 +2 ABC 4 +4 ABC 4 +drop table if exists t2 ; +create table t2 as select * from t1 ; +set @query1= 'SELECT * FROM t2 join t1 on (t1.a=t2.a) order by t2.a ' ; +set @query2= 'SELECT * FROM t2 natural join t1 order by t2.a ' ; +set @query3= 'SELECT * FROM t2 join t1 using(a) order by t2.a ' ; +set @query4= 'SELECT * FROM t2 left join t1 on(t1.a=t2.a) order by t2.a ' ; +set @query5= 'SELECT * FROM t2 natural left join t1 order by t2.a ' ; +set @query6= 'SELECT * FROM t2 left join t1 using(a) order by t2.a ' ; +set @query7= 'SELECT * FROM t2 right join t1 on(t1.a=t2.a) order by t2.a ' ; +set @query8= 'SELECT * FROM t2 natural right join t1 order by t2.a ' ; +set @query9= 'SELECT * FROM t2 right join t1 using(a) order by t2.a ' ; +the join statement is: +SELECT * FROM t2 right join t1 using(a) order by t2.a +prepare stmt1 from @query9 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +the join statement is: +SELECT * FROM t2 natural right join t1 order by t2.a +prepare stmt1 from @query8 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +the join statement is: +SELECT * FROM t2 right join t1 on(t1.a=t2.a) order by t2.a +prepare stmt1 from @query7 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +the join statement is: +SELECT * FROM t2 left join t1 using(a) order by t2.a +prepare stmt1 from @query6 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +the join statement is: +SELECT * FROM t2 natural left join t1 order by t2.a +prepare stmt1 from @query5 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +the join statement is: +SELECT * FROM t2 left join t1 on(t1.a=t2.a) order by t2.a +prepare stmt1 from @query4 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +the join statement is: +SELECT * FROM t2 join t1 using(a) order by t2.a +prepare stmt1 from @query3 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +the join statement is: +SELECT * FROM t2 natural join t1 order by t2.a +prepare stmt1 from @query2 ; +execute stmt1 ; +a b +1 one +2 two +3 three +4 four +execute stmt1 ; +a b +1 one +2 two +3 three +4 four +execute stmt1 ; +a b +1 one +2 two +3 three +4 four +the join statement is: +SELECT * FROM t2 join t1 on (t1.a=t2.a) order by t2.a +prepare stmt1 from @query1 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +drop table t2 ; +test_sequence +------ subquery tests ------ +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where b = ''two'') '; +execute stmt1 ; +a b +2 two +set @arg00='two' ; +select a, b FROM t1 outer_table where +a = (select a from t1 where b = 'two' ) and b=@arg00 ; +a b +2 two +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where b = ''two'') and b=? '; +execute stmt1 using @arg00; +a b +2 two +set @arg00='two' ; +select a, b FROM t1 outer_table where +a = (select a from t1 where b = @arg00 ) and b='two' ; +a b +2 two +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where b = ? ) and b=''two'' ' ; +execute stmt1 using @arg00; +a b +2 two +set @arg00=3 ; +set @arg01='three' ; +select a,b FROM t1 where (a,b) in (select 3, 'three'); +a b +3 three +select a FROM t1 where (a,b) in (select @arg00,@arg01); +a +3 +prepare stmt1 from ' select a FROM t1 where (a,b) in (select ?, ?) '; +execute stmt1 using @arg00, @arg01; +a +3 +set @arg00=1 ; +set @arg01='two' ; +set @arg02=2 ; +set @arg03='two' ; +select a, @arg00, b FROM t1 outer_table where +b=@arg01 and a = (select @arg02 from t1 where b = @arg03 ) ; +a @arg00 b +2 1 two +prepare stmt1 from ' select a, ?, b FROM t1 outer_table where + b=? and a = (select ? from t1 where b = ? ) ' ; +execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; +a ? b +2 1 two +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where b = outer_table.b ) order by a '; +execute stmt1 ; +a b +1 one +2 two +3 three +4 four +prepare stmt1 from ' SELECT a as ccc from t1 where a+1= + (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) '; +execute stmt1 ; +ccc +1 +deallocate prepare stmt1 ; +prepare stmt1 from ' SELECT a as ccc from t1 where a+1= + (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) '; +execute stmt1 ; +ccc +1 +deallocate prepare stmt1 ; +prepare stmt1 from ' SELECT a as ccc from t1 where a+1= + (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) '; +execute stmt1 ; +ccc +1 +deallocate prepare stmt1 ; +set @arg00='two' ; +select a, b FROM t1 outer_table where +a = (select a from t1 where b = outer_table.b ) and b=@arg00 ; +a b +2 two +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where b = outer_table.b) and b=? '; +execute stmt1 using @arg00; +a b +2 two +set @arg00=2 ; +select a, b FROM t1 outer_table where +a = (select a from t1 where a = @arg00 and b = outer_table.b) and b='two' ; +a b +2 two +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where a = ? and b = outer_table.b) and b=''two'' ' ; +execute stmt1 using @arg00; +a b +2 two +set @arg00=2 ; +select a, b FROM t1 outer_table where +a = (select a from t1 where outer_table.a = @arg00 and a=2) and b='two' ; +a b +2 two +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where outer_table.a = ? and a=2) and b=''two'' ' ; +execute stmt1 using @arg00; +a b +2 two +set @arg00=1 ; +set @arg01='two' ; +set @arg02=2 ; +set @arg03='two' ; +select a, @arg00, b FROM t1 outer_table where +b=@arg01 and a = (select @arg02 from t1 where outer_table.b = @arg03 +and outer_table.a=a ) ; +a @arg00 b +2 1 two +prepare stmt1 from ' select a, ?, b FROM t1 outer_table where + b=? and a = (select ? from t1 where outer_table.b = ? + and outer_table.a=a ) ' ; +execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; +a ? b +2 1 two +set @arg00=1 ; +set @arg01=0 ; +select a, @arg00 +from ( select a - @arg00 as a from t1 where a=@arg00 ) as t2 +where a=@arg01; +a @arg00 +0 1 +prepare stmt1 from ' select a, ? + from ( select a - ? as a from t1 where a=? ) as t2 + where a=? '; +execute stmt1 using @arg00, @arg00, @arg00, @arg01 ; +a ? +0 1 +drop table if exists t2 ; +create table t2 as select * from t1; +prepare stmt1 from ' select a in (select a from t2) from t1 ' ; +execute stmt1 ; +a in (select a from t2) +1 +1 +1 +1 +drop table if exists t5, t6, t7 ; +create table t5 (a int , b int) ; +create table t6 like t5 ; +create table t7 like t5 ; +insert into t5 values (0, 100), (1, 2), (1, 3), (2, 2), (2, 7), +(2, -1), (3, 10) ; +insert into t6 values (0, 0), (1, 1), (2, 1), (3, 1), (4, 1) ; +insert into t7 values (3, 3), (2, 2), (1, 1) ; +prepare stmt1 from ' select a, (select count(distinct t5.b) as sum from t5, t6 + where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b + group by t5.a order by sum limit 1) from t7 ' ; +execute stmt1 ; +a (select count(distinct t5.b) as sum from t5, t6 + where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b + group by t5.a order by sum limit 1) +3 1 +2 2 +1 2 +execute stmt1 ; +a (select count(distinct t5.b) as sum from t5, t6 + where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b + group by t5.a order by sum limit 1) +3 1 +2 2 +1 2 +execute stmt1 ; +a (select count(distinct t5.b) as sum from t5, t6 + where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b + group by t5.a order by sum limit 1) +3 1 +2 2 +1 2 +drop table t5, t6, t7 ; +drop table if exists t2 ; +create table t2 as select * from t9; +set @stmt= ' SELECT + (SELECT SUM(c1 + c12 + 0.0) FROM t2 + where (t9.c2 - 0e-3) = t2.c2 + GROUP BY t9.c15 LIMIT 1) as scalar_s, + exists (select 1.0e+0 from t2 + where t2.c3 * 9.0000000000 = t9.c4) as exists_s, + c5 * 4 in (select c6 + 0.3e+1 from t2) as in_s, + (c7 - 4, c8 - 4) in (select c9 + 4.0, c10 + 40e-1 from t2) as in_row_s +FROM t9, +(select c25 x, c32 y from t2) tt WHERE x = c25 ' ; +prepare stmt1 from @stmt ; +execute stmt1 ; +execute stmt1 ; +set @stmt= concat('explain ',@stmt); +prepare stmt1 from @stmt ; +execute stmt1 ; +execute stmt1 ; +set @stmt= ' SELECT + (SELECT SUM(c1+c12+?) FROM t2 where (t9.c2-?)=t2.c2 + GROUP BY t9.c15 LIMIT 1) as scalar_s, + exists (select ? from t2 + where t2.c3*?=t9.c4) as exists_s, + c5*? in (select c6+? from t2) as in_s, + (c7-?, c8-?) in (select c9+?, c10+? from t2) as in_row_s +FROM t9, +(select c25 x, c32 y from t2) tt WHERE x =c25 ' ; +set @arg00= 0.0 ; +set @arg01= 0e-3 ; +set @arg02= 1.0e+0 ; +set @arg03= 9.0000000000 ; +set @arg04= 4 ; +set @arg05= 0.3e+1 ; +set @arg06= 4 ; +set @arg07= 4 ; +set @arg08= 4.0 ; +set @arg09= 40e-1 ; +prepare stmt1 from @stmt ; +execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, +@arg07, @arg08, @arg09 ; +execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, +@arg07, @arg08, @arg09 ; +set @stmt= concat('explain ',@stmt); +prepare stmt1 from @stmt ; +execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, +@arg07, @arg08, @arg09 ; +execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, +@arg07, @arg08, @arg09 ; +drop table t2 ; +select 1 < (select a from t1) ; +ERROR 21000: Subquery returns more than 1 row +prepare stmt1 from ' select 1 < (select a from t1) ' ; +execute stmt1 ; +ERROR 21000: Subquery returns more than 1 row +select 1 as my_col ; +my_col +1 +test_sequence +------ union tests ------ +prepare stmt1 from ' select a FROM t1 where a=1 + union distinct + select a FROM t1 where a=1 '; +execute stmt1 ; +a +1 +execute stmt1 ; +a +1 +prepare stmt1 from ' select a FROM t1 where a=1 + union all + select a FROM t1 where a=1 '; +execute stmt1 ; +a +1 +1 +prepare stmt1 from ' SELECT 1, 2 union SELECT 1 ' ; +ERROR 21000: The used SELECT statements have a different number of columns +prepare stmt1 from ' SELECT 1 union SELECT 1, 2 ' ; +ERROR 21000: The used SELECT statements have a different number of columns +prepare stmt1 from ' SELECT * from t1 union SELECT 1 ' ; +ERROR 21000: The used SELECT statements have a different number of columns +prepare stmt1 from ' SELECT 1 union SELECT * from t1 ' ; +ERROR 21000: The used SELECT statements have a different number of columns +set @arg00=1 ; +select @arg00 FROM t1 where a=1 +union distinct +select 1 FROM t1 where a=1; +@arg00 +1 +prepare stmt1 from ' select ? FROM t1 where a=1 + union distinct + select 1 FROM t1 where a=1 ' ; +execute stmt1 using @arg00; +? +1 +set @arg00=1 ; +select 1 FROM t1 where a=1 +union distinct +select @arg00 FROM t1 where a=1; +1 +1 +prepare stmt1 from ' select 1 FROM t1 where a=1 + union distinct + select ? FROM t1 where a=1 ' ; +execute stmt1 using @arg00; +1 +1 +set @arg00='a' ; +select @arg00 FROM t1 where a=1 +union distinct +select @arg00 FROM t1 where a=1; +@arg00 +a +prepare stmt1 from ' select ? FROM t1 where a=1 + union distinct + select ? FROM t1 where a=1 '; +execute stmt1 using @arg00, @arg00; +? +a +prepare stmt1 from ' select ? + union distinct + select ? '; +execute stmt1 using @arg00, @arg00; +? +a +set @arg00='a' ; +set @arg01=1 ; +set @arg02='a' ; +set @arg03=2 ; +select @arg00 FROM t1 where a=@arg01 +union distinct +select @arg02 FROM t1 where a=@arg03; +@arg00 +a +prepare stmt1 from ' select ? FROM t1 where a=? + union distinct + select ? FROM t1 where a=? ' ; +execute stmt1 using @arg00, @arg01, @arg02, @arg03; +? +a +set @arg00=1 ; +prepare stmt1 from ' select sum(a) + 200, ? from t1 +union distinct +select sum(a) + 200, 1 from t1 +group by b ' ; +execute stmt1 using @arg00; +sum(a) + 200 ? +210 1 +204 1 +201 1 +203 1 +202 1 +set @Oporto='Oporto' ; +set @Lisboa='Lisboa' ; +set @0=0 ; +set @1=1 ; +set @2=2 ; +set @3=3 ; +set @4=4 ; +select @Oporto,@Lisboa,@0,@1,@2,@3,@4 ; +@Oporto @Lisboa @0 @1 @2 @3 @4 +Oporto Lisboa 0 1 2 3 4 +select sum(a) + 200 as the_sum, @Oporto as the_town from t1 +group by b +union distinct +select sum(a) + 200, @Lisboa from t1 +group by b ; +the_sum the_town +204 Oporto +201 Oporto +203 Oporto +202 Oporto +204 Lisboa +201 Lisboa +203 Lisboa +202 Lisboa +prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1 + group by b + union distinct + select sum(a) + 200, ? from t1 + group by b ' ; +execute stmt1 using @Oporto, @Lisboa; +the_sum the_town +204 Oporto +201 Oporto +203 Oporto +202 Oporto +204 Lisboa +201 Lisboa +203 Lisboa +202 Lisboa +select sum(a) + 200 as the_sum, @Oporto as the_town from t1 +where a > @1 +group by b +union distinct +select sum(a) + 200, @Lisboa from t1 +where a > @2 +group by b ; +the_sum the_town +204 Oporto +203 Oporto +202 Oporto +204 Lisboa +203 Lisboa +prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1 + where a > ? + group by b + union distinct + select sum(a) + 200, ? from t1 + where a > ? + group by b ' ; +execute stmt1 using @Oporto, @1, @Lisboa, @2; +the_sum the_town +204 Oporto +203 Oporto +202 Oporto +204 Lisboa +203 Lisboa +select sum(a) + 200 as the_sum, @Oporto as the_town from t1 +where a > @1 +group by b +having avg(a) > @2 +union distinct +select sum(a) + 200, @Lisboa from t1 +where a > @2 +group by b +having avg(a) > @3; +the_sum the_town +204 Oporto +203 Oporto +204 Lisboa +prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1 + where a > ? + group by b + having avg(a) > ? + union distinct + select sum(a) + 200, ? from t1 + where a > ? + group by b + having avg(a) > ? '; +execute stmt1 using @Oporto, @1, @2, @Lisboa, @2, @3; +the_sum the_town +204 Oporto +203 Oporto +204 Lisboa +test_sequence +------ explain select tests ------ +prepare stmt1 from ' explain select * from t9 ' ; +execute stmt1; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def id 8 3 1 N 32801 0 8 +def select_type 253 19 6 N 1 31 33 +def table 253 64 2 N 1 31 33 +def type 253 10 3 N 1 31 33 +def possible_keys 253 4096 0 Y 0 31 33 +def key 253 64 0 Y 0 31 33 +def key_len 8 3 0 Y 32800 0 8 +def ref 253 1024 0 Y 0 31 33 +def rows 8 10 1 N 32801 0 8 +def Extra 253 255 0 N 1 31 33 +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t9 ALL NULL NULL NULL NULL 2 +test_sequence +------ delete tests ------ +delete from t1 ; +insert into t1 values (1,'one'); +insert into t1 values (2,'two'); +insert into t1 values (3,'three'); +insert into t1 values (4,'four'); +commit ; +delete from t9 ; +insert into t9 +set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, +c10= 1, c11= 1, c12 = 1, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=true, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; +insert into t9 +set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, +c10= 9, c11= 9, c12 = 9, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=false, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +commit ; +prepare stmt1 from 'delete from t1 where a=2' ; +execute stmt1; +select a,b from t1 where a=2; +a b +execute stmt1; +insert into t1 values(0,NULL); +set @arg00=NULL; +prepare stmt1 from 'delete from t1 where b=?' ; +execute stmt1 using @arg00; +select a,b from t1 where b is NULL ; +a b +0 NULL +set @arg00='one'; +execute stmt1 using @arg00; +select a,b from t1 where b=@arg00; +a b +prepare stmt1 from 'truncate table t1' ; +ERROR HY000: This command is not supported in the prepared statement protocol yet +test_sequence +------ update tests ------ +delete from t1 ; +insert into t1 values (1,'one'); +insert into t1 values (2,'two'); +insert into t1 values (3,'three'); +insert into t1 values (4,'four'); +commit ; +delete from t9 ; +insert into t9 +set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, +c10= 1, c11= 1, c12 = 1, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=true, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; +insert into t9 +set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, +c10= 9, c11= 9, c12 = 9, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=false, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +commit ; +prepare stmt1 from 'update t1 set b=''a=two'' where a=2' ; +execute stmt1; +select a,b from t1 where a=2; +a b +2 a=two +execute stmt1; +select a,b from t1 where a=2; +a b +2 a=two +set @arg00=NULL; +prepare stmt1 from 'update t1 set b=? where a=2' ; +execute stmt1 using @arg00; +select a,b from t1 where a=2; +a b +2 NULL +set @arg00='two'; +execute stmt1 using @arg00; +select a,b from t1 where a=2; +a b +2 two +set @arg00=2; +prepare stmt1 from 'update t1 set b=NULL where a=?' ; +execute stmt1 using @arg00; +select a,b from t1 where a=@arg00; +a b +2 NULL +update t1 set b='two' where a=@arg00; +set @arg00=2000; +execute stmt1 using @arg00; +select a,b from t1 where a=@arg00; +a b +set @arg00=2; +set @arg01=22; +prepare stmt1 from 'update t1 set a=? where a=?' ; +execute stmt1 using @arg00, @arg00; +select a,b from t1 where a=@arg00; +a b +2 two +execute stmt1 using @arg01, @arg00; +select a,b from t1 where a=@arg01; +a b +22 two +execute stmt1 using @arg00, @arg01; +select a,b from t1 where a=@arg00; +a b +2 two +set @arg00=NULL; +set @arg01=2; +execute stmt1 using @arg00, @arg01; +Warnings: +Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 1 +select a,b from t1 order by a; +a b +0 two +1 one +3 three +4 four +set @arg00=0; +execute stmt1 using @arg01, @arg00; +select a,b from t1 order by a; +a b +1 one +2 two +3 three +4 four +set @arg00=23; +set @arg01='two'; +set @arg02=2; +set @arg03='two'; +set @arg04=2; +drop table if exists t2; +create table t2 as select a,b from t1 ; +prepare stmt1 from 'update t1 set a=? where b=? + and a in (select ? from t2 + where b = ? or a = ?)'; +execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04 ; +affected rows: 1 +info: Rows matched: 1 Changed: 1 Warnings: 0 +select a,b from t1 where a = @arg00 ; +a b +23 two +prepare stmt1 from 'update t1 set a=? where b=? + and a not in (select ? from t2 + where b = ? or a = ?)'; +execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ; +affected rows: 1 +info: Rows matched: 1 Changed: 1 Warnings: 0 +select a,b from t1 order by a ; +a b +1 one +2 two +3 three +4 four +drop table t2 ; +create table t2 +( +a int, b varchar(30), +primary key(a) +) engine = 'InnoDB' ; +insert into t2(a,b) select a, b from t1 ; +prepare stmt1 from 'update t1 set a=? where b=? + and a in (select ? from t2 + where b = ? or a = ?)'; +execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04 ; +affected rows: 1 +info: Rows matched: 1 Changed: 1 Warnings: 0 +select a,b from t1 where a = @arg00 ; +a b +23 two +prepare stmt1 from 'update t1 set a=? where b=? + and a not in (select ? from t2 + where b = ? or a = ?)'; +execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ; +affected rows: 1 +info: Rows matched: 1 Changed: 1 Warnings: 0 +select a,b from t1 order by a ; +a b +1 one +2 two +3 three +4 four +drop table t2 ; +set @arg00=1; +prepare stmt1 from 'update t1 set b=''bla'' +where a=2 +limit 1'; +execute stmt1 ; +select a,b from t1 where b = 'bla' ; +a b +2 bla +prepare stmt1 from 'update t1 set b=''bla'' +where a=2 +limit ?'; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?' at line 3 +test_sequence +------ insert tests ------ +delete from t1 ; +insert into t1 values (1,'one'); +insert into t1 values (2,'two'); +insert into t1 values (3,'three'); +insert into t1 values (4,'four'); +commit ; +delete from t9 ; +insert into t9 +set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, +c10= 1, c11= 1, c12 = 1, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=true, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; +insert into t9 +set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, +c10= 9, c11= 9, c12 = 9, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=false, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +commit ; +prepare stmt1 from 'insert into t1 values(5, ''five'' )'; +execute stmt1; +select a,b from t1 where a = 5; +a b +5 five +set @arg00='six' ; +prepare stmt1 from 'insert into t1 values(6, ? )'; +execute stmt1 using @arg00; +select a,b from t1 where b = @arg00; +a b +6 six +execute stmt1 using @arg00; +ERROR 23000: Duplicate entry '6' for key 1 +set @arg00=NULL ; +prepare stmt1 from 'insert into t1 values(0, ? )'; +execute stmt1 using @arg00; +select a,b from t1 where b is NULL; +a b +0 NULL +set @arg00=8 ; +set @arg01='eight' ; +prepare stmt1 from 'insert into t1 values(?, ? )'; +execute stmt1 using @arg00, @arg01 ; +select a,b from t1 where b = @arg01; +a b +8 eight +set @NULL= null ; +set @arg00= 'abc' ; +execute stmt1 using @NULL, @NULL ; +ERROR 23000: Column 'a' cannot be null +execute stmt1 using @NULL, @NULL ; +ERROR 23000: Column 'a' cannot be null +execute stmt1 using @NULL, @arg00 ; +ERROR 23000: Column 'a' cannot be null +execute stmt1 using @NULL, @arg00 ; +ERROR 23000: Column 'a' cannot be null +set @arg01= 10000 + 2 ; +execute stmt1 using @arg01, @arg00 ; +set @arg01= 10000 + 1 ; +execute stmt1 using @arg01, @arg00 ; +select * from t1 where a > 10000 order by a ; +a b +10001 abc +10002 abc +delete from t1 where a > 10000 ; +set @arg01= 10000 + 2 ; +execute stmt1 using @arg01, @NULL ; +set @arg01= 10000 + 1 ; +execute stmt1 using @arg01, @NULL ; +select * from t1 where a > 10000 order by a ; +a b +10001 NULL +10002 NULL +delete from t1 where a > 10000 ; +set @arg01= 10000 + 10 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 9 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 8 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 7 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 6 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 5 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 4 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 3 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 2 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 1 ; +execute stmt1 using @arg01, @arg01 ; +select * from t1 where a > 10000 order by a ; +a b +10001 10001 +10002 10002 +10003 10003 +10004 10004 +10005 10005 +10006 10006 +10007 10007 +10008 10008 +10009 10009 +10010 10010 +delete from t1 where a > 10000 ; +set @arg00=81 ; +set @arg01='8-1' ; +set @arg02=82 ; +set @arg03='8-2' ; +prepare stmt1 from 'insert into t1 values(?,?),(?,?)'; +execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; +select a,b from t1 where a in (@arg00,@arg02) ; +a b +81 8-1 +82 8-2 +set @arg00=9 ; +set @arg01='nine' ; +prepare stmt1 from 'insert into t1 set a=?, b=? '; +execute stmt1 using @arg00, @arg01 ; +select a,b from t1 where a = @arg00 ; +a b +9 nine +set @arg00=6 ; +set @arg01=1 ; +prepare stmt1 from 'insert into t1 set a=?, b=''sechs'' + on duplicate key update a=a + ?, b=concat(b,''modified'') '; +execute stmt1 using @arg00, @arg01; +select * from t1 order by a; +a b +0 NULL +1 one +2 two +3 three +4 four +5 five +7 sixmodified +8 eight +9 nine +81 8-1 +82 8-2 +set @arg00=81 ; +set @arg01=1 ; +execute stmt1 using @arg00, @arg01; +ERROR 23000: Duplicate entry '82' for key 1 +drop table if exists t2 ; +create table t2 (id int auto_increment primary key) +ENGINE= 'InnoDB' ; +prepare stmt1 from ' select last_insert_id() ' ; +insert into t2 values (NULL) ; +execute stmt1 ; +last_insert_id() +1 +insert into t2 values (NULL) ; +execute stmt1 ; +last_insert_id() +2 +drop table t2 ; +set @1000=1000 ; +set @x1000_2="x1000_2" ; +set @x1000_3="x1000_3" ; +set @x1000="x1000" ; +set @1100=1100 ; +set @x1100="x1100" ; +set @100=100 ; +set @updated="updated" ; +insert into t1 values(1000,'x1000_1') ; +insert into t1 values(@1000,@x1000_2),(@1000,@x1000_3) +on duplicate key update a = a + @100, b = concat(b,@updated) ; +select a,b from t1 where a >= 1000 order by a ; +a b +1000 x1000_3 +1100 x1000_1updated +delete from t1 where a >= 1000 ; +insert into t1 values(1000,'x1000_1') ; +prepare stmt1 from ' insert into t1 values(?,?),(?,?) + on duplicate key update a = a + ?, b = concat(b,?) '; +execute stmt1 using @1000, @x1000_2, @1000, @x1000_3, @100, @updated ; +select a,b from t1 where a >= 1000 order by a ; +a b +1000 x1000_3 +1100 x1000_1updated +delete from t1 where a >= 1000 ; +insert into t1 values(1000,'x1000_1') ; +execute stmt1 using @1000, @x1000_2, @1100, @x1000_3, @100, @updated ; +select a,b from t1 where a >= 1000 order by a ; +a b +1200 x1000_1updatedupdated +delete from t1 where a >= 1000 ; +prepare stmt1 from ' replace into t1 (a,b) select 100, ''hundred'' '; +execute stmt1; +execute stmt1; +execute stmt1; +test_sequence +------ multi table tests ------ +delete from t1 ; +delete from t9 ; +insert into t1(a,b) values (1, 'one'), (2, 'two'), (3, 'three') ; +insert into t9 (c1,c21) +values (1, 'one'), (2, 'two'), (3, 'three') ; +prepare stmt_delete from " delete t1, t9 + from t1, t9 where t1.a=t9.c1 and t1.b='updated' "; +prepare stmt_update from " update t1, t9 + set t1.b='updated', t9.c21='updated' + where t1.a=t9.c1 and t1.a=? "; +prepare stmt_select1 from " select a, b from t1 order by a" ; +prepare stmt_select2 from " select c1, c21 from t9 order by c1" ; +set @arg00= 1 ; +execute stmt_update using @arg00 ; +execute stmt_delete ; +execute stmt_select1 ; +a b +2 two +3 three +execute stmt_select2 ; +c1 c21 +2 two +3 three +set @arg00= @arg00 + 1 ; +execute stmt_update using @arg00 ; +execute stmt_delete ; +execute stmt_select1 ; +a b +3 three +execute stmt_select2 ; +c1 c21 +3 three +set @arg00= @arg00 + 1 ; +execute stmt_update using @arg00 ; +execute stmt_delete ; +execute stmt_select1 ; +a b +execute stmt_select2 ; +c1 c21 +set @arg00= @arg00 + 1 ; +delete from t1 ; +insert into t1 values (1,'one'); +insert into t1 values (2,'two'); +insert into t1 values (3,'three'); +insert into t1 values (4,'four'); +commit ; +delete from t9 ; +insert into t9 +set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, +c10= 1, c11= 1, c12 = 1, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=true, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; +insert into t9 +set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, +c10= 9, c11= 9, c12 = 9, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=false, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +commit ; +insert into t1 values(0,NULL) ; +set @duplicate='duplicate ' ; +set @1000=1000 ; +set @5=5 ; +select a,b from t1 where a < 5 order by a ; +a b +0 NULL +1 one +2 two +3 three +4 four +insert into t1 select a + @1000, concat(@duplicate,b) from t1 +where a < @5 ; +affected rows: 5 +info: Records: 5 Duplicates: 0 Warnings: 0 +select a,b from t1 where a >= 1000 order by a ; +a b +1000 NULL +1001 duplicate one +1002 duplicate two +1003 duplicate three +1004 duplicate four +delete from t1 where a >= 1000 ; +prepare stmt1 from ' insert into t1 select a + ?, concat(?,b) from t1 +where a < ? ' ; +execute stmt1 using @1000, @duplicate, @5; +affected rows: 5 +info: Records: 5 Duplicates: 0 Warnings: 0 +select a,b from t1 where a >= 1000 order by a ; +a b +1000 NULL +1001 duplicate one +1002 duplicate two +1003 duplicate three +1004 duplicate four +delete from t1 where a >= 1000 ; +set @float=1.00; +set @five='five' ; +drop table if exists t2; +create table t2 like t1 ; +insert into t2 (b,a) +select @duplicate, sum(first.a) from t1 first, t1 second +where first.a <> @5 and second.b = first.b +and second.b <> @five +group by second.b +having sum(second.a) > @2 +union +select b, a + @100 from t1 +where (a,b) in ( select sqrt(a+@1)+CAST(@float AS signed),b +from t1); +affected rows: 3 +info: Records: 3 Duplicates: 0 Warnings: 0 +select a,b from t2 order by a ; +a b +3 duplicate +4 duplicate +103 three +delete from t2 ; +prepare stmt1 from ' insert into t2 (b,a) +select ?, sum(first.a) + from t1 first, t1 second + where first.a <> ? and second.b = first.b and second.b <> ? + group by second.b + having sum(second.a) > ? +union +select b, a + ? from t1 + where (a,b) in ( select sqrt(a+?)+CAST(? AS signed),b + from t1 ) ' ; +execute stmt1 using @duplicate, @5, @five, @2, @100, @1, @float ; +affected rows: 3 +info: Records: 3 Duplicates: 0 Warnings: 0 +select a,b from t2 order by a ; +a b +3 duplicate +4 duplicate +103 three +drop table t2; +drop table if exists t5 ; +set @arg01= 8; +set @arg02= 8.0; +set @arg03= 80.00000000000e-1; +set @arg04= 'abc' ; +set @arg05= CAST('abc' as binary) ; +set @arg06= '1991-08-05' ; +set @arg07= CAST('1991-08-05' as date); +set @arg08= '1991-08-05 01:01:01' ; +set @arg09= CAST('1991-08-05 01:01:01' as datetime) ; +set @arg10= unix_timestamp('1991-01-01 01:01:01'); +set @arg11= YEAR('1991-01-01 01:01:01'); +set @arg12= 8 ; +set @arg12= NULL ; +set @arg13= 8.0 ; +set @arg13= NULL ; +set @arg14= 'abc'; +set @arg14= NULL ; +set @arg15= CAST('abc' as binary) ; +set @arg15= NULL ; +create table t5 as select +8 as const01, @arg01 as param01, +8.0 as const02, @arg02 as param02, +80.00000000000e-1 as const03, @arg03 as param03, +'abc' as const04, @arg04 as param04, +CAST('abc' as binary) as const05, @arg05 as param05, +'1991-08-05' as const06, @arg06 as param06, +CAST('1991-08-05' as date) as const07, @arg07 as param07, +'1991-08-05 01:01:01' as const08, @arg08 as param08, +CAST('1991-08-05 01:01:01' as datetime) as const09, @arg09 as param09, +unix_timestamp('1991-01-01 01:01:01') as const10, @arg10 as param10, +YEAR('1991-01-01 01:01:01') as const11, @arg11 as param11, +NULL as const12, @arg12 as param12, +@arg13 as param13, +@arg14 as param14, +@arg15 as param15; +show create table t5 ; +Table Create Table +t5 CREATE TABLE `t5` ( + `const01` bigint(1) NOT NULL default '0', + `param01` bigint(20) default NULL, + `const02` double(3,1) NOT NULL default '0.0', + `param02` double default NULL, + `const03` double NOT NULL default '0', + `param03` double default NULL, + `const04` char(3) NOT NULL default '', + `param04` longtext, + `const05` binary(3) NOT NULL default '', + `param05` longblob, + `const06` varchar(10) NOT NULL default '', + `param06` longtext, + `const07` date default NULL, + `param07` longblob, + `const08` varchar(19) NOT NULL default '', + `param08` longtext, + `const09` datetime default NULL, + `param09` longblob, + `const10` int(10) NOT NULL default '0', + `param10` bigint(20) default NULL, + `const11` int(4) default NULL, + `param11` bigint(20) default NULL, + `const12` binary(0) default NULL, + `param12` bigint(20) default NULL, + `param13` double default NULL, + `param14` longtext, + `param15` longblob +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select * from t5 ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def test t5 t5 const01 const01 8 1 1 N 32769 0 63 +def test t5 t5 param01 param01 8 20 1 Y 32768 0 63 +def test t5 t5 const02 const02 5 3 3 N 32769 1 63 +def test t5 t5 param02 param02 5 20 1 Y 32768 31 63 +def test t5 t5 const03 const03 5 23 1 N 32769 31 63 +def test t5 t5 param03 param03 5 20 1 Y 32768 31 63 +def test t5 t5 const04 const04 254 3 3 N 1 0 8 +def test t5 t5 param04 param04 252 16777215 3 Y 16 0 8 +def test t5 t5 const05 const05 254 3 3 N 129 0 63 +def test t5 t5 param05 param05 252 16777215 3 Y 144 0 63 +def test t5 t5 const06 const06 253 10 10 N 1 0 8 +def test t5 t5 param06 param06 252 16777215 10 Y 16 0 8 +def test t5 t5 const07 const07 10 10 10 Y 128 0 63 +def test t5 t5 param07 param07 252 16777215 10 Y 144 0 63 +def test t5 t5 const08 const08 253 19 19 N 1 0 8 +def test t5 t5 param08 param08 252 16777215 19 Y 16 0 8 +def test t5 t5 const09 const09 12 19 19 Y 128 0 63 +def test t5 t5 param09 param09 252 16777215 19 Y 144 0 63 +def test t5 t5 const10 const10 3 10 9 N 32769 0 63 +def test t5 t5 param10 param10 8 20 9 Y 32768 0 63 +def test t5 t5 const11 const11 3 4 4 Y 32768 0 63 +def test t5 t5 param11 param11 8 20 4 Y 32768 0 63 +def test t5 t5 const12 const12 254 0 0 Y 128 0 63 +def test t5 t5 param12 param12 8 20 0 Y 32768 0 63 +def test t5 t5 param13 param13 5 20 0 Y 32768 31 63 +def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8 +def test t5 t5 param15 param15 252 16777215 0 Y 144 0 63 +const01 8 +param01 8 +const02 8.0 +param02 8 +const03 8 +param03 8 +const04 abc +param04 abc +const05 abc +param05 abc +const06 1991-08-05 +param06 1991-08-05 +const07 1991-08-05 +param07 1991-08-05 +const08 1991-08-05 01:01:01 +param08 1991-08-05 01:01:01 +const09 1991-08-05 01:01:01 +param09 1991-08-05 01:01:01 +const10 662680861 +param10 662680861 +const11 1991 +param11 1991 +const12 NULL +param12 NULL +param13 NULL +param14 NULL +param15 NULL +drop table t5 ; +test_sequence +------ data type conversion tests ------ +delete from t1 ; +insert into t1 values (1,'one'); +insert into t1 values (2,'two'); +insert into t1 values (3,'three'); +insert into t1 values (4,'four'); +commit ; +delete from t9 ; +insert into t9 +set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, +c10= 1, c11= 1, c12 = 1, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=true, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; +insert into t9 +set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, +c10= 9, c11= 9, c12 = 9, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=false, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +commit ; +insert into t9 set c1= 0, c15= '1991-01-01 01:01:01' ; +select * from t9 order by c1 ; +c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday +test_sequence +------ select @parameter:= column ------ +prepare full_info from "select @arg01, @arg02, @arg03, @arg04, + @arg05, @arg06, @arg07, @arg08, + @arg09, @arg10, @arg11, @arg12, + @arg13, @arg14, @arg15, @arg16, + @arg17, @arg18, @arg19, @arg20, + @arg21, @arg22, @arg23, @arg24, + @arg25, @arg26, @arg27, @arg28, + @arg29, @arg30, @arg31, @arg32" ; +select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, +@arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8, +@arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12, +@arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16, +@arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20, +@arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24, +@arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28, +@arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32 +from t9 where c1= 1 ; +@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 +1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 1 Y 128 31 63 +def @arg03 254 20 1 Y 128 31 63 +def @arg04 254 20 1 Y 128 31 63 +def @arg05 254 20 1 Y 128 31 63 +def @arg06 254 20 1 Y 128 31 63 +def @arg07 254 20 1 Y 128 31 63 +def @arg08 254 20 1 Y 128 31 63 +def @arg09 254 20 1 Y 128 31 63 +def @arg10 254 20 1 Y 128 31 63 +def @arg11 254 20 1 Y 128 31 63 +def @arg12 254 20 1 Y 128 31 63 +def @arg13 254 8192 10 Y 128 31 63 +def @arg14 254 8192 19 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 8 Y 128 31 63 +def @arg17 254 20 4 Y 128 31 63 +def @arg18 254 20 1 Y 128 31 63 +def @arg19 254 20 1 Y 128 31 63 +def @arg20 254 8192 1 Y 0 31 8 +def @arg21 254 8192 10 Y 0 31 8 +def @arg22 254 8192 30 Y 0 31 8 +def @arg23 254 8192 8 Y 128 31 63 +def @arg24 254 8192 8 Y 0 31 8 +def @arg25 254 8192 4 Y 128 31 63 +def @arg26 254 8192 4 Y 0 31 8 +def @arg27 254 8192 10 Y 128 31 63 +def @arg28 254 8192 10 Y 0 31 8 +def @arg29 254 8192 8 Y 128 31 63 +def @arg30 254 8192 8 Y 0 31 8 +def @arg31 254 8192 3 Y 0 31 8 +def @arg32 254 8192 6 Y 128 31 63 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, +@arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8, +@arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12, +@arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16, +@arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20, +@arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24, +@arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28, +@arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32 +from t9 where c1= 0 ; +@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 0 Y 128 31 63 +def @arg03 254 20 0 Y 128 31 63 +def @arg04 254 20 0 Y 128 31 63 +def @arg05 254 20 0 Y 128 31 63 +def @arg06 254 20 0 Y 128 31 63 +def @arg07 254 20 0 Y 128 31 63 +def @arg08 254 20 0 Y 128 31 63 +def @arg09 254 20 0 Y 128 31 63 +def @arg10 254 20 0 Y 128 31 63 +def @arg11 254 20 0 Y 128 31 63 +def @arg12 254 20 0 Y 128 31 63 +def @arg13 254 8192 0 Y 128 31 63 +def @arg14 254 8192 0 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 0 Y 128 31 63 +def @arg17 254 20 0 Y 128 31 63 +def @arg18 254 20 0 Y 128 31 63 +def @arg19 254 20 0 Y 128 31 63 +def @arg20 254 8192 0 Y 0 31 8 +def @arg21 254 8192 0 Y 0 31 8 +def @arg22 254 8192 0 Y 0 31 8 +def @arg23 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 0 31 8 +def @arg25 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 0 31 8 +def @arg27 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 0 31 8 +def @arg29 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 0 31 8 +def @arg31 254 8192 0 Y 0 31 8 +def @arg32 254 8192 0 Y 0 31 8 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +prepare stmt1 from "select + @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, + @arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8, + @arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12, + @arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16, + @arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20, + @arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24, + @arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28, + @arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32 +from t9 where c1= ?" ; +set @my_key= 1 ; +execute stmt1 using @my_key ; +@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 +1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 1 Y 128 31 63 +def @arg03 254 20 1 Y 128 31 63 +def @arg04 254 20 1 Y 128 31 63 +def @arg05 254 20 1 Y 128 31 63 +def @arg06 254 20 1 Y 128 31 63 +def @arg07 254 20 1 Y 128 31 63 +def @arg08 254 20 1 Y 128 31 63 +def @arg09 254 20 1 Y 128 31 63 +def @arg10 254 20 1 Y 128 31 63 +def @arg11 254 20 1 Y 128 31 63 +def @arg12 254 20 1 Y 128 31 63 +def @arg13 254 8192 10 Y 128 31 63 +def @arg14 254 8192 19 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 8 Y 128 31 63 +def @arg17 254 20 4 Y 128 31 63 +def @arg18 254 20 1 Y 128 31 63 +def @arg19 254 20 1 Y 128 31 63 +def @arg20 254 8192 1 Y 0 31 8 +def @arg21 254 8192 10 Y 0 31 8 +def @arg22 254 8192 30 Y 0 31 8 +def @arg23 254 8192 8 Y 128 31 63 +def @arg24 254 8192 8 Y 0 31 8 +def @arg25 254 8192 4 Y 128 31 63 +def @arg26 254 8192 4 Y 0 31 8 +def @arg27 254 8192 10 Y 128 31 63 +def @arg28 254 8192 10 Y 0 31 8 +def @arg29 254 8192 8 Y 128 31 63 +def @arg30 254 8192 8 Y 0 31 8 +def @arg31 254 8192 3 Y 0 31 8 +def @arg32 254 8192 6 Y 128 31 63 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +set @my_key= 0 ; +execute stmt1 using @my_key ; +@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 0 Y 128 31 63 +def @arg03 254 20 0 Y 128 31 63 +def @arg04 254 20 0 Y 128 31 63 +def @arg05 254 20 0 Y 128 31 63 +def @arg06 254 20 0 Y 128 31 63 +def @arg07 254 20 0 Y 128 31 63 +def @arg08 254 20 0 Y 128 31 63 +def @arg09 254 20 0 Y 128 31 63 +def @arg10 254 20 0 Y 128 31 63 +def @arg11 254 20 0 Y 128 31 63 +def @arg12 254 20 0 Y 128 31 63 +def @arg13 254 8192 0 Y 128 31 63 +def @arg14 254 8192 0 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 0 Y 128 31 63 +def @arg17 254 20 0 Y 128 31 63 +def @arg18 254 20 0 Y 128 31 63 +def @arg19 254 20 0 Y 128 31 63 +def @arg20 254 8192 0 Y 0 31 8 +def @arg21 254 8192 0 Y 0 31 8 +def @arg22 254 8192 0 Y 0 31 8 +def @arg23 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 0 31 8 +def @arg25 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 0 31 8 +def @arg27 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 0 31 8 +def @arg29 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 0 31 8 +def @arg31 254 8192 0 Y 0 31 8 +def @arg32 254 8192 0 Y 0 31 8 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +prepare stmt1 from "select ? := c1 from t9 where c1= 1" ; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':= c1 from t9 where c1= 1' at line 1 +test_sequence +------ select column, .. into @parm,.. ------ +select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, +c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, +c25, c26, c27, c28, c29, c30, c31, c32 +into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, +@arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, +@arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24, +@arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 +from t9 where c1= 1 ; +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 1 Y 128 31 63 +def @arg03 254 20 1 Y 128 31 63 +def @arg04 254 20 1 Y 128 31 63 +def @arg05 254 20 1 Y 128 31 63 +def @arg06 254 20 1 Y 128 31 63 +def @arg07 254 20 1 Y 128 31 63 +def @arg08 254 20 1 Y 128 31 63 +def @arg09 254 20 1 Y 128 31 63 +def @arg10 254 20 1 Y 128 31 63 +def @arg11 254 20 1 Y 128 31 63 +def @arg12 254 20 1 Y 128 31 63 +def @arg13 254 8192 10 Y 128 31 63 +def @arg14 254 8192 19 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 8 Y 128 31 63 +def @arg17 254 20 4 Y 128 31 63 +def @arg18 254 20 1 Y 128 31 63 +def @arg19 254 20 1 Y 128 31 63 +def @arg20 254 8192 1 Y 0 31 8 +def @arg21 254 8192 10 Y 0 31 8 +def @arg22 254 8192 30 Y 0 31 8 +def @arg23 254 8192 8 Y 128 31 63 +def @arg24 254 8192 8 Y 0 31 8 +def @arg25 254 8192 4 Y 128 31 63 +def @arg26 254 8192 4 Y 0 31 8 +def @arg27 254 8192 10 Y 128 31 63 +def @arg28 254 8192 10 Y 0 31 8 +def @arg29 254 8192 8 Y 128 31 63 +def @arg30 254 8192 8 Y 0 31 8 +def @arg31 254 8192 3 Y 0 31 8 +def @arg32 254 8192 6 Y 128 31 63 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, +c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, +c25, c26, c27, c28, c29, c30, c31, c32 +into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, +@arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, +@arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24, +@arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 +from t9 where c1= 0 ; +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 0 Y 128 31 63 +def @arg03 254 20 0 Y 128 31 63 +def @arg04 254 20 0 Y 128 31 63 +def @arg05 254 20 0 Y 128 31 63 +def @arg06 254 20 0 Y 128 31 63 +def @arg07 254 20 0 Y 128 31 63 +def @arg08 254 20 0 Y 128 31 63 +def @arg09 254 20 0 Y 128 31 63 +def @arg10 254 20 0 Y 128 31 63 +def @arg11 254 20 0 Y 128 31 63 +def @arg12 254 20 0 Y 128 31 63 +def @arg13 254 8192 0 Y 128 31 63 +def @arg14 254 8192 0 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 0 Y 128 31 63 +def @arg17 254 20 0 Y 128 31 63 +def @arg18 254 20 0 Y 128 31 63 +def @arg19 254 20 0 Y 128 31 63 +def @arg20 254 8192 0 Y 0 31 8 +def @arg21 254 8192 0 Y 0 31 8 +def @arg22 254 8192 0 Y 0 31 8 +def @arg23 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 0 31 8 +def @arg25 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 0 31 8 +def @arg27 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 0 31 8 +def @arg29 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 0 31 8 +def @arg31 254 8192 0 Y 0 31 8 +def @arg32 254 8192 0 Y 0 31 8 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +prepare stmt1 from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, + c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, + c25, c26, c27, c28, c29, c30, c31, c32 +into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, + @arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, + @arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24, + @arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 +from t9 where c1= ?" ; +set @my_key= 1 ; +execute stmt1 using @my_key ; +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 1 Y 128 31 63 +def @arg03 254 20 1 Y 128 31 63 +def @arg04 254 20 1 Y 128 31 63 +def @arg05 254 20 1 Y 128 31 63 +def @arg06 254 20 1 Y 128 31 63 +def @arg07 254 20 1 Y 128 31 63 +def @arg08 254 20 1 Y 128 31 63 +def @arg09 254 20 1 Y 128 31 63 +def @arg10 254 20 1 Y 128 31 63 +def @arg11 254 20 1 Y 128 31 63 +def @arg12 254 20 1 Y 128 31 63 +def @arg13 254 8192 10 Y 128 31 63 +def @arg14 254 8192 19 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 8 Y 128 31 63 +def @arg17 254 20 4 Y 128 31 63 +def @arg18 254 20 1 Y 128 31 63 +def @arg19 254 20 1 Y 128 31 63 +def @arg20 254 8192 1 Y 0 31 8 +def @arg21 254 8192 10 Y 0 31 8 +def @arg22 254 8192 30 Y 0 31 8 +def @arg23 254 8192 8 Y 128 31 63 +def @arg24 254 8192 8 Y 0 31 8 +def @arg25 254 8192 4 Y 128 31 63 +def @arg26 254 8192 4 Y 0 31 8 +def @arg27 254 8192 10 Y 128 31 63 +def @arg28 254 8192 10 Y 0 31 8 +def @arg29 254 8192 8 Y 128 31 63 +def @arg30 254 8192 8 Y 0 31 8 +def @arg31 254 8192 3 Y 0 31 8 +def @arg32 254 8192 6 Y 128 31 63 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +set @my_key= 0 ; +execute stmt1 using @my_key ; +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 0 Y 128 31 63 +def @arg03 254 20 0 Y 128 31 63 +def @arg04 254 20 0 Y 128 31 63 +def @arg05 254 20 0 Y 128 31 63 +def @arg06 254 20 0 Y 128 31 63 +def @arg07 254 20 0 Y 128 31 63 +def @arg08 254 20 0 Y 128 31 63 +def @arg09 254 20 0 Y 128 31 63 +def @arg10 254 20 0 Y 128 31 63 +def @arg11 254 20 0 Y 128 31 63 +def @arg12 254 20 0 Y 128 31 63 +def @arg13 254 8192 0 Y 128 31 63 +def @arg14 254 8192 0 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 0 Y 128 31 63 +def @arg17 254 20 0 Y 128 31 63 +def @arg18 254 20 0 Y 128 31 63 +def @arg19 254 20 0 Y 128 31 63 +def @arg20 254 8192 0 Y 0 31 8 +def @arg21 254 8192 0 Y 0 31 8 +def @arg22 254 8192 0 Y 0 31 8 +def @arg23 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 0 31 8 +def @arg25 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 0 31 8 +def @arg27 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 0 31 8 +def @arg29 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 0 31 8 +def @arg31 254 8192 0 Y 0 31 8 +def @arg32 254 8192 0 Y 0 31 8 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +prepare stmt1 from "select c1 into ? from t9 where c1= 1" ; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? from t9 where c1= 1' at line 1 +test_sequence +-- insert into numeric columns -- +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20 ) ; +set @arg00= 21 ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt1 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22 )" ; +execute stmt1 ; +set @arg00= 23; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, +30.0, 30.0, 30.0 ) ; +set @arg00= 31.0 ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt1 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, + 32.0, 32.0, 32.0 )" ; +execute stmt1 ; +set @arg00= 33.0; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( '40', '40', '40', '40', '40', '40', '40', '40', +'40', '40', '40' ) ; +set @arg00= '41' ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt1 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( '42', '42', '42', '42', '42', '42', '42', '42', + '42', '42', '42' )" ; +execute stmt1 ; +set @arg00= '43'; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( CAST('50' as binary), CAST('50' as binary), +CAST('50' as binary), CAST('50' as binary), CAST('50' as binary), +CAST('50' as binary), CAST('50' as binary), CAST('50' as binary), +CAST('50' as binary), CAST('50' as binary), CAST('50' as binary) ) ; +set @arg00= CAST('51' as binary) ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt1 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( CAST('52' as binary), CAST('52' as binary), + CAST('52' as binary), CAST('52' as binary), CAST('52' as binary), + CAST('52' as binary), CAST('52' as binary), CAST('52' as binary), + CAST('52' as binary), CAST('52' as binary), CAST('52' as binary) )" ; +execute stmt1 ; +set @arg00= CAST('53' as binary) ; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +set @arg00= 2 ; +set @arg00= NULL ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( 60, NULL, NULL, NULL, NULL, NULL, NULL, NULL, +NULL, NULL, NULL ) ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( 61, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt1 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 62, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL )" ; +execute stmt1 ; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 63, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +set @arg00= 8.0 ; +set @arg00= NULL ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( 71, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 73, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +set @arg00= 'abc' ; +set @arg00= NULL ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( 81, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 83, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 +from t9 where c1 >= 20 +order by c1 ; +c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c12 +20 20 20 20 20 20 20 20 20 20 20.0000 +21 21 21 21 21 21 21 21 21 21 21.0000 +22 22 22 22 22 22 22 22 22 22 22.0000 +23 23 23 23 23 23 23 23 23 23 23.0000 +30 30 30 30 30 30 30 30 30 30 30.0000 +31 31 31 31 31 31 31 31 31 31 31.0000 +32 32 32 32 32 32 32 32 32 32 32.0000 +33 33 33 33 33 33 33 33 33 33 33.0000 +40 40 40 40 40 40 40 40 40 40 40.0000 +41 41 41 41 41 41 41 41 41 41 41.0000 +42 42 42 42 42 42 42 42 42 42 42.0000 +43 43 43 43 43 43 43 43 43 43 43.0000 +50 50 50 50 50 50 50 50 50 50 50.0000 +51 51 51 51 51 51 51 51 51 51 51.0000 +52 52 52 52 52 52 52 52 52 52 52.0000 +53 53 53 53 53 53 53 53 53 53 53.0000 +60 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +61 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +62 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +63 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +71 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +73 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +81 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +83 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +test_sequence +-- select .. where numeric column = .. -- +set @arg00= 20; +select 'true' as found from t9 +where c1= 20 and c2= 20 and c3= 20 and c4= 20 and c5= 20 and c6= 20 and c7= 20 +and c8= 20 and c9= 20 and c10= 20 and c12= 20; +found +true +select 'true' as found from t9 +where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 +and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 +and c12= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c2= 20 and c3= 20 and c4= 20 and c5= 20 and c6= 20 and c7= 20 + and c8= 20 and c9= 20 and c10= 20 and c12= 20 "; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? + and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? + and c12= ? "; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +found +true +set @arg00= 20.0; +select 'true' as found from t9 +where c1= 20.0 and c2= 20.0 and c3= 20.0 and c4= 20.0 and c5= 20.0 and c6= 20.0 +and c7= 20.0 and c8= 20.0 and c9= 20.0 and c10= 20.0 and c12= 20.0; +found +true +select 'true' as found from t9 +where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 +and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 +and c12= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20.0 and c2= 20.0 and c3= 20.0 and c4= 20.0 and c5= 20.0 and c6= 20.0 + and c7= 20.0 and c8= 20.0 and c9= 20.0 and c10= 20.0 and c12= 20.0 "; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? + and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? + and c12= ? "; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +found +true +select 'true' as found from t9 +where c1= '20' and c2= '20' and c3= '20' and c4= '20' and c5= '20' and c6= '20' + and c7= '20' and c8= '20' and c9= '20' and c10= '20' and c12= '20'; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= '20' and c2= '20' and c3= '20' and c4= '20' and c5= '20' and c6= '20' + and c7= '20' and c8= '20' and c9= '20' and c10= '20' and c12= '20' "; +execute stmt1 ; +found +true +set @arg00= '20'; +select 'true' as found from t9 +where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 +and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 +and c12= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? + and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? + and c12= ? "; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +found +true +select 'true' as found from t9 +where c1= CAST('20' as binary) and c2= CAST('20' as binary) and +c3= CAST('20' as binary) and c4= CAST('20' as binary) and +c5= CAST('20' as binary) and c6= CAST('20' as binary) and +c7= CAST('20' as binary) and c8= CAST('20' as binary) and +c9= CAST('20' as binary) and c10= CAST('20' as binary) and +c12= CAST('20' as binary); +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= CAST('20' as binary) and c2= CAST('20' as binary) and + c3= CAST('20' as binary) and c4= CAST('20' as binary) and + c5= CAST('20' as binary) and c6= CAST('20' as binary) and + c7= CAST('20' as binary) and c8= CAST('20' as binary) and + c9= CAST('20' as binary) and c10= CAST('20' as binary) and + c12= CAST('20' as binary) "; +execute stmt1 ; +found +true +set @arg00= CAST('20' as binary) ; +select 'true' as found from t9 +where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 +and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 +and c12= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? + and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? + and c12= ? "; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +found +true +delete from t9 ; +test_sequence +-- some numeric overflow experiments -- +prepare my_insert from "insert into t9 + ( c21, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 'O', ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +prepare my_select from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 +from t9 where c21 = 'O' "; +prepare my_delete from "delete from t9 where c21 = 'O' "; +set @arg00= 9223372036854775807 ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1264 Data truncated; out of range for column 'c1' at row 1 +Warning 1264 Data truncated; out of range for column 'c2' at row 1 +Warning 1264 Data truncated; out of range for column 'c3' at row 1 +Warning 1264 Data truncated; out of range for column 'c4' at row 1 +Warning 1264 Data truncated; out of range for column 'c5' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 127 +c2 32767 +c3 8388607 +c4 2147483647 +c5 2147483647 +c6 9223372036854775807 +c7 9.22337e+18 +c8 9.22337203685478e+18 +c9 9.22337203685478e+18 +c10 9.22337203685478e+18 +c12 99999.9999 +execute my_delete ; +set @arg00= '9223372036854775807' ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1264 Data truncated; out of range for column 'c1' at row 1 +Warning 1264 Data truncated; out of range for column 'c2' at row 1 +Warning 1264 Data truncated; out of range for column 'c3' at row 1 +Warning 1265 Data truncated for column 'c4' at row 1 +Warning 1265 Data truncated for column 'c5' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 127 +c2 32767 +c3 8388607 +c4 2147483647 +c5 2147483647 +c6 9223372036854775807 +c7 9.22337e+18 +c8 9.22337203685478e+18 +c9 9.22337203685478e+18 +c10 9.22337203685478e+18 +c12 99999.9999 +execute my_delete ; +set @arg00= -9223372036854775808 ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1264 Data truncated; out of range for column 'c1' at row 1 +Warning 1264 Data truncated; out of range for column 'c2' at row 1 +Warning 1264 Data truncated; out of range for column 'c3' at row 1 +Warning 1264 Data truncated; out of range for column 'c4' at row 1 +Warning 1264 Data truncated; out of range for column 'c5' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 -128 +c2 -32768 +c3 -8388608 +c4 -2147483648 +c5 -2147483648 +c6 -9223372036854775808 +c7 -9.22337e+18 +c8 -9.22337203685478e+18 +c9 -9.22337203685478e+18 +c10 -9.22337203685478e+18 +c12 -9999.9999 +execute my_delete ; +set @arg00= '-9223372036854775808' ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1264 Data truncated; out of range for column 'c1' at row 1 +Warning 1264 Data truncated; out of range for column 'c2' at row 1 +Warning 1264 Data truncated; out of range for column 'c3' at row 1 +Warning 1265 Data truncated for column 'c4' at row 1 +Warning 1265 Data truncated for column 'c5' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 -128 +c2 -32768 +c3 -8388608 +c4 -2147483648 +c5 -2147483648 +c6 -9223372036854775808 +c7 -9.22337e+18 +c8 -9.22337203685478e+18 +c9 -9.22337203685478e+18 +c10 -9.22337203685478e+18 +c12 -9999.9999 +execute my_delete ; +set @arg00= 1.11111111111111111111e+50 ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1264 Data truncated; out of range for column 'c1' at row 1 +Warning 1264 Data truncated; out of range for column 'c2' at row 1 +Warning 1264 Data truncated; out of range for column 'c3' at row 1 +Warning 1264 Data truncated; out of range for column 'c4' at row 1 +Warning 1264 Data truncated; out of range for column 'c5' at row 1 +Warning 1264 Data truncated; out of range for column 'c6' at row 1 +Warning 1264 Data truncated; out of range for column 'c7' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 127 +c2 32767 +c3 8388607 +c4 2147483647 +c5 2147483647 +c6 9223372036854775807 +c7 3.40282e+38 +c8 1.11111111111111e+50 +c9 1.11111111111111e+50 +c10 1.11111111111111e+50 +c12 99999.9999 +execute my_delete ; +set @arg00= '1.11111111111111111111e+50' ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1265 Data truncated for column 'c1' at row 1 +Warning 1265 Data truncated for column 'c2' at row 1 +Warning 1265 Data truncated for column 'c3' at row 1 +Warning 1265 Data truncated for column 'c4' at row 1 +Warning 1265 Data truncated for column 'c5' at row 1 +Warning 1265 Data truncated for column 'c6' at row 1 +Warning 1264 Data truncated; out of range for column 'c7' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 1 +c2 1 +c3 1 +c4 1 +c5 1 +c6 1 +c7 3.40282e+38 +c8 1.11111111111111e+50 +c9 1.11111111111111e+50 +c10 1.11111111111111e+50 +c12 99999.9999 +execute my_delete ; +set @arg00= -1.11111111111111111111e+50 ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1264 Data truncated; out of range for column 'c1' at row 1 +Warning 1264 Data truncated; out of range for column 'c2' at row 1 +Warning 1264 Data truncated; out of range for column 'c3' at row 1 +Warning 1264 Data truncated; out of range for column 'c4' at row 1 +Warning 1264 Data truncated; out of range for column 'c5' at row 1 +Warning 1264 Data truncated; out of range for column 'c6' at row 1 +Warning 1264 Data truncated; out of range for column 'c7' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 -128 +c2 -32768 +c3 -8388608 +c4 -2147483648 +c5 -2147483648 +c6 -9223372036854775808 +c7 -3.40282e+38 +c8 -1.11111111111111e+50 +c9 -1.11111111111111e+50 +c10 -1.11111111111111e+50 +c12 -9999.9999 +execute my_delete ; +set @arg00= '-1.11111111111111111111e+50' ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1265 Data truncated for column 'c1' at row 1 +Warning 1265 Data truncated for column 'c2' at row 1 +Warning 1265 Data truncated for column 'c3' at row 1 +Warning 1265 Data truncated for column 'c4' at row 1 +Warning 1265 Data truncated for column 'c5' at row 1 +Warning 1265 Data truncated for column 'c6' at row 1 +Warning 1264 Data truncated; out of range for column 'c7' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 -1 +c2 -1 +c3 -1 +c4 -1 +c5 -1 +c6 -1 +c7 -3.40282e+38 +c8 -1.11111111111111e+50 +c9 -1.11111111111111e+50 +c10 -1.11111111111111e+50 +c12 -9999.9999 +execute my_delete ; +test_sequence +-- insert into string columns -- +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +select c1, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30 +from t9 where c1 >= 20 +order by c1 ; +c1 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 +20 2 20 20 20 20 20 20 20 20 20 20 +21 2 21 21 21 21 21 21 21 21 21 21 +22 2 22 22 22 22 22 22 22 22 22 22 +23 2 23 23 23 23 23 23 23 23 23 23 +30 3 30 30 30 30 30 30 30 30 30 30 +31 3 31 31 31 31 31 31 31 31 31 31 +32 3 32 32 32 32 32 32 32 32 32 32 +33 3 33 33 33 33 33 33 33 33 33 33 +40 4 40 40 40 40 40 40 40 40 40 40 +41 4 41 41 41 41 41 41 41 41 41 41 +42 4 42 42 42 42 42 42 42 42 42 42 +43 4 43 43 43 43 43 43 43 43 43 43 +50 5 50 50 50.00 50.00 50.00 50.00 50.00 50.00 50.00 50.00 +51 5 51 51 51 51 51 51 51 51 51 51 +52 5 52 52 52.00 52.00 52.00 52.00 52.00 52.00 52.00 52.00 +53 5 53 53 53.00 53.00 53.00 53.00 53.00 53.00 53.00 53.00 +54 5 54 54 54.00 54.00 54.00 54.00 54.00 54.00 54.00 54.00 +55 5 55 55 55 55 55 55 55 55 55 55 +56 6 56 56 56.00 56.00 56.00 56.00 56.00 56.00 56.00 56.00 +57 6 57 57 57.00 57.00 57.00 57.00 57.00 57.00 57.00 57.00 +60 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +61 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +62 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +63 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +71 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +73 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +81 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +83 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +test_sequence +-- select .. where string column = .. -- +set @arg00= '20'; +select 'true' as found from t9 +where c1= 20 and concat(c20,substr('20',1+length(c20)))= '20' and c21= '20' and +c22= '20' and c23= '20' and c24= '20' and c25= '20' and c26= '20' and +c27= '20' and c28= '20' and c29= '20' and c30= '20' ; +found +true +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and +c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and +c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr('20',1+length(c20)))= '20' and c21= '20' and + c22= '20' and c23= '20' and c24= '20' and c25= '20' and c26= '20' and + c27= '20' and c28= '20' and c29= '20' and c30= '20'" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and + c21= ? and c22= ? and c23= ? and c25= ? and + c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +found +true +set @arg00= CAST('20' as binary); +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(CAST('20' as binary),1+length(c20))) += CAST('20' as binary) and c21= CAST('20' as binary) +and c22= CAST('20' as binary) and c23= CAST('20' as binary) and +c24= CAST('20' as binary) and c25= CAST('20' as binary) and +c26= CAST('20' as binary) and c27= CAST('20' as binary) and +c28= CAST('20' as binary) and c29= CAST('20' as binary) and +c30= CAST('20' as binary) ; +found +true +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(@arg00,1+length(c20))) = @arg00 and +c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and +c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and +c30= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(CAST('20' as binary),1+length(c20))) + = CAST('20' as binary) and c21= CAST('20' as binary) + and c22= CAST('20' as binary) and c23= CAST('20' as binary) and + c24= CAST('20' as binary) and c25= CAST('20' as binary) and + c26= CAST('20' as binary) and c27= CAST('20' as binary) and + c28= CAST('20' as binary) and c29= CAST('20' as binary) and + c30= CAST('20' as binary)" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(?,1+length(c20))) = ? and c21= ? and + c22= ? and c23= ? and c25= ? and c26= ? and c27= ? and c28= ? and + c29= ? and c30= ?"; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +found +true +set @arg00= 20; +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(20,1+length(c20)))= 20 and c21= 20 and +c22= 20 and c23= 20 and c24= 20 and c25= 20 and c26= 20 and +c27= 20 and c28= 20 and c29= 20 and c30= 20 ; +found +true +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and +c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and +c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(20,1+length(c20)))= 20 and c21= 20 and + c22= 20 and c23= 20 and c24= 20 and c25= 20 and c26= 20 and + c27= 20 and c28= 20 and c29= 20 and c30= 20" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and + c21= ? and c22= ? and c23= ? and c25= ? and + c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +found +true +set @arg00= 20.0; +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(20.0,1+length(c20)))= 20.0 and c21= 20.0 and +c22= 20.0 and c23= 20.0 and c24= 20.0 and c25= 20.0 and c26= 20.0 and +c27= 20.0 and c28= 20.0 and c29= 20.0 and c30= 20.0 ; +found +true +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and +c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and +c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(20.0,1+length(c20)))= 20.0 and c21= 20.0 and + c22= 20.0 and c23= 20.0 and c24= 20.0 and c25= 20.0 and c26= 20.0 and + c27= 20.0 and c28= 20.0 and c29= 20.0 and c30= 20.0" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and + c21= ? and c22= ? and c23= ? and c25= ? and + c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +found +true +delete from t9 ; +test_sequence +-- insert into date/time columns -- +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1264 Data truncated; out of range for column 'c13' at row 1 +Warning 1265 Data truncated for column 'c14' at row 1 +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1264 Data truncated; out of range for column 'c13' at row 1 +Warning 1265 Data truncated for column 'c14' at row 1 +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1264 Data truncated; out of range for column 'c13' at row 1 +Warning 1265 Data truncated for column 'c14' at row 1 +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1264 Data truncated; out of range for column 'c13' at row 1 +Warning 1265 Data truncated for column 'c14' at row 1 +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +select c1, c13, c14, c15, c16, c17 from t9 order by c1 ; +c1 c13 c14 c15 c16 c17 +20 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +21 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +22 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +23 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +30 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +31 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +32 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +33 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +40 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +41 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +42 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +43 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +50 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +51 0010-00-00 0010-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +52 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +53 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +60 NULL NULL 1991-01-01 01:01:01 NULL NULL +61 NULL NULL 1991-01-01 01:01:01 NULL NULL +62 NULL NULL 1991-01-01 01:01:01 NULL NULL +63 NULL NULL 1991-01-01 01:01:01 NULL NULL +71 NULL NULL 1991-01-01 01:01:01 NULL NULL +73 NULL NULL 1991-01-01 01:01:01 NULL NULL +81 NULL NULL 1991-01-01 01:01:01 NULL NULL +83 NULL NULL 1991-01-01 01:01:01 NULL NULL +test_sequence +-- select .. where date/time column = .. -- +set @arg00= '1991-01-01 01:01:01' ; +select 'true' as found from t9 +where c1= 20 and c13= '1991-01-01 01:01:01' and c14= '1991-01-01 01:01:01' and +c15= '1991-01-01 01:01:01' and c16= '1991-01-01 01:01:01' and +c17= '1991-01-01 01:01:01' ; +found +true +select 'true' as found from t9 +where c1= 20 and c13= @arg00 and c14= @arg00 and c15= @arg00 and c16= @arg00 +and c17= @arg00 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c13= '1991-01-01 01:01:01' and c14= '1991-01-01 01:01:01' and + c15= '1991-01-01 01:01:01' and c16= '1991-01-01 01:01:01' and + c17= '1991-01-01 01:01:01'" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c13= ? and c14= ? and c15= ? and c16= ? and c17= ?" ; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00 ; +found +true +set @arg00= CAST('1991-01-01 01:01:01' as datetime) ; +select 'true' as found from t9 +where c1= 20 and c13= CAST('1991-01-01 01:01:01' as datetime) and +c14= CAST('1991-01-01 01:01:01' as datetime) and +c15= CAST('1991-01-01 01:01:01' as datetime) and +c16= CAST('1991-01-01 01:01:01' as datetime) and +c17= CAST('1991-01-01 01:01:01' as datetime) ; +found +true +select 'true' as found from t9 +where c1= 20 and c13= @arg00 and c14= @arg00 and c15= @arg00 and c16= @arg00 +and c17= @arg00 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c13= CAST('1991-01-01 01:01:01' as datetime) and + c14= CAST('1991-01-01 01:01:01' as datetime) and + c15= CAST('1991-01-01 01:01:01' as datetime) and + c16= CAST('1991-01-01 01:01:01' as datetime) and + c17= CAST('1991-01-01 01:01:01' as datetime)" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c13= ? and c14= ? and c15= ? and c16= ? and c17= ?" ; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00 ; +found +true +set @arg00= 1991 ; +select 'true' as found from t9 +where c1= 20 and c17= 1991 ; +found +true +select 'true' as found from t9 +where c1= 20 and c17= @arg00 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c17= 1991" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c17= ?" ; +execute stmt1 using @arg00 ; +found +true +set @arg00= 1.991e+3 ; +select 'true' as found from t9 +where c1= 20 and abs(c17 - 1.991e+3) < 0.01 ; +found +true +select 'true' as found from t9 +where c1= 20 and abs(c17 - @arg00) < 0.01 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and abs(c17 - 1.991e+3) < 0.01" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and abs(c17 - ?) < 0.01" ; +execute stmt1 using @arg00 ; +found +true +drop table t1, t9; diff --git a/mysql-test/r/ps_4heap.result.es b/mysql-test/r/ps_4heap.result.es new file mode 100644 index 00000000000..fcd9c52b4f9 --- /dev/null +++ b/mysql-test/r/ps_4heap.result.es @@ -0,0 +1,3114 @@ +use test; +drop table if exists t1, t9 ; +create table t1 +( +a int, b varchar(30), +primary key(a) +) engine = 'HEAP' ; +drop table if exists t9; +create table t9 +( +c1 tinyint, c2 smallint, c3 mediumint, c4 int, +c5 integer, c6 bigint, c7 float, c8 double, +c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4), +c13 date, c14 datetime, c15 timestamp(14), c16 time, +c17 year, c18 bit, c19 bool, c20 char, +c21 char(10), c22 varchar(30), c23 char(100), c24 char(100), +c25 char(100), c26 char(100), c27 char(100), c28 char(100), +c29 char(100), c30 char(100), c31 enum('one', 'two', 'three'), +c32 set('monday', 'tuesday', 'wednesday'), +primary key(c1) +) engine = 'HEAP' ; +delete from t1 ; +insert into t1 values (1,'one'); +insert into t1 values (2,'two'); +insert into t1 values (3,'three'); +insert into t1 values (4,'four'); +commit ; +delete from t9 ; +insert into t9 +set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, +c10= 1, c11= 1, c12 = 1, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=true, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; +insert into t9 +set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, +c10= 9, c11= 9, c12 = 9, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=false, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +commit ; +test_sequence +------ simple select tests ------ +prepare stmt1 from ' select * from t9 order by c1 ' ; +execute stmt1; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def test t9 t9 c1 c1 1 4 1 N 49155 0 63 +def test t9 t9 c2 c2 2 6 1 Y 32768 0 63 +def test t9 t9 c3 c3 9 9 1 Y 32768 0 63 +def test t9 t9 c4 c4 3 11 1 Y 32768 0 63 +def test t9 t9 c5 c5 3 11 1 Y 32768 0 63 +def test t9 t9 c6 c6 8 20 1 Y 32768 0 63 +def test t9 t9 c7 c7 4 12 1 Y 32768 31 63 +def test t9 t9 c8 c8 5 22 1 Y 32768 31 63 +def test t9 t9 c9 c9 5 22 1 Y 32768 31 63 +def test t9 t9 c10 c10 5 22 1 Y 32768 31 63 +def test t9 t9 c11 c11 0 9 6 Y 32768 4 63 +def test t9 t9 c12 c12 0 10 6 Y 32768 4 63 +def test t9 t9 c13 c13 10 10 10 Y 128 0 63 +def test t9 t9 c14 c14 12 19 19 Y 128 0 63 +def test t9 t9 c15 c15 7 19 19 N 1249 0 63 +def test t9 t9 c16 c16 11 8 8 Y 128 0 63 +def test t9 t9 c17 c17 13 4 4 Y 32864 0 63 +def test t9 t9 c18 c18 1 1 1 Y 32768 0 63 +def test t9 t9 c19 c19 1 1 1 Y 32768 0 63 +def test t9 t9 c20 c20 254 1 1 Y 0 0 8 +def test t9 t9 c21 c21 253 10 10 Y 0 0 8 +def test t9 t9 c22 c22 253 30 30 Y 0 0 8 +def test t9 t9 c23 c23 253 100 8 Y 0 0 8 +def test t9 t9 c24 c24 253 100 8 Y 0 0 8 +def test t9 t9 c25 c25 253 100 4 Y 0 0 8 +def test t9 t9 c26 c26 253 100 4 Y 0 0 8 +def test t9 t9 c27 c27 253 100 10 Y 0 0 8 +def test t9 t9 c28 c28 253 100 10 Y 0 0 8 +def test t9 t9 c29 c29 253 100 8 Y 0 0 8 +def test t9 t9 c30 c30 253 100 8 Y 0 0 8 +def test t9 t9 c31 c31 254 5 3 Y 256 0 8 +def test t9 t9 c32 c32 254 24 7 Y 2048 0 8 +c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32 +1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday +set @arg00='SELECT' ; +prepare stmt1 from ' ? a from t1 where a=1 '; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? a from t1 where a=1' at line 1 +set @arg00=1 ; +select @arg00, b from t1 where a=1 ; +@arg00 b +1 one +prepare stmt1 from ' select ?, b from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +? b +1 one +set @arg00='lion' ; +select @arg00, b from t1 where a=1 ; +@arg00 b +lion one +prepare stmt1 from ' select ?, b from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +? b +lion one +set @arg00=NULL ; +select @arg00, b from t1 where a=1 ; +@arg00 b +NULL one +prepare stmt1 from ' select ?, b from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +? b +NULL one +set @arg00=1 ; +select b, a - @arg00 from t1 where a=1 ; +b a - @arg00 +one 0 +prepare stmt1 from ' select b, a - ? from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +b a - ? +one 0 +set @arg00=null ; +select @arg00 as my_col ; +my_col +NULL +prepare stmt1 from ' select ? as my_col'; +execute stmt1 using @arg00 ; +my_col +NULL +select @arg00 + 1 as my_col ; +my_col +NULL +prepare stmt1 from ' select ? + 1 as my_col'; +execute stmt1 using @arg00 ; +my_col +NULL +select 1 + @arg00 as my_col ; +my_col +NULL +prepare stmt1 from ' select 1 + ? as my_col'; +execute stmt1 using @arg00 ; +my_col +NULL +set @arg00='MySQL' ; +select substr(@arg00,1,2) from t1 where a=1 ; +substr(@arg00,1,2) +My +prepare stmt1 from ' select substr(?,1,2) from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +substr(?,1,2) +My +set @arg00=3 ; +select substr('MySQL',@arg00,5) from t1 where a=1 ; +substr('MySQL',@arg00,5) +SQL +prepare stmt1 from ' select substr(''MySQL'',?,5) from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +substr('MySQL',?,5) +SQL +select substr('MySQL',1,@arg00) from t1 where a=1 ; +substr('MySQL',1,@arg00) +MyS +prepare stmt1 from ' select substr(''MySQL'',1,?) from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +substr('MySQL',1,?) +MyS +set @arg00='MySQL' ; +select a , concat(@arg00,b) from t1 order by a; +a concat(@arg00,b) +1 MySQLone +2 MySQLtwo +3 MySQLthree +4 MySQLfour +prepare stmt1 from ' select a , concat(?,b) from t1 order by a ' ; +execute stmt1 using @arg00; +a concat(?,b) +1 MySQLone +2 MySQLtwo +3 MySQLthree +4 MySQLfour +select a , concat(b,@arg00) from t1 order by a ; +a concat(b,@arg00) +1 oneMySQL +2 twoMySQL +3 threeMySQL +4 fourMySQL +prepare stmt1 from ' select a , concat(b,?) from t1 order by a ' ; +execute stmt1 using @arg00; +a concat(b,?) +1 oneMySQL +2 twoMySQL +3 threeMySQL +4 fourMySQL +set @arg00='MySQL' ; +select group_concat(@arg00,b order by a) from t1 +group by 'a' ; +group_concat(@arg00,b order by a) +MySQLone,MySQLtwo,MySQLthree,MySQLfour +prepare stmt1 from ' select group_concat(?,b order by a) from t1 +group by ''a'' ' ; +execute stmt1 using @arg00; +group_concat(?,b order by a) +MySQLone,MySQLtwo,MySQLthree,MySQLfour +select group_concat(b,@arg00 order by a) from t1 +group by 'a' ; +group_concat(b,@arg00 order by a) +oneMySQL,twoMySQL,threeMySQL,fourMySQL +prepare stmt1 from ' select group_concat(b,? order by a) from t1 +group by ''a'' ' ; +execute stmt1 using @arg00; +group_concat(b,? order by a) +oneMySQL,twoMySQL,threeMySQL,fourMySQL +set @arg00='first' ; +set @arg01='second' ; +set @arg02=NULL; +select @arg00, @arg01 from t1 where a=1 ; +@arg00 @arg01 +first second +prepare stmt1 from ' select ?, ? from t1 where a=1 ' ; +execute stmt1 using @arg00, @arg01 ; +? ? +first second +execute stmt1 using @arg02, @arg01 ; +? ? +NULL second +execute stmt1 using @arg00, @arg02 ; +? ? +first NULL +execute stmt1 using @arg02, @arg02 ; +? ? +NULL NULL +drop table if exists t5 ; +create table t5 (id1 int(11) not null default '0', +value2 varchar(100), value1 varchar(100)) ; +insert into t5 values (1,'hh','hh'),(2,'hh','hh'), +(1,'ii','ii'),(2,'ii','ii') ; +prepare stmt1 from ' select id1,value1 from t5 where id1=? or value1=? order by id1,value1 ' ; +set @arg00=1 ; +set @arg01='hh' ; +execute stmt1 using @arg00, @arg01 ; +id1 value1 +1 hh +1 ii +2 hh +drop table t5 ; +drop table if exists t5 ; +create table t5(session_id char(9) not null) ; +insert into t5 values ('abc') ; +prepare stmt1 from ' select * from t5 +where ?=''1111'' and session_id = ''abc'' ' ; +set @arg00='abc' ; +execute stmt1 using @arg00 ; +session_id +set @arg00='1111' ; +execute stmt1 using @arg00 ; +session_id +abc +set @arg00='abc' ; +execute stmt1 using @arg00 ; +session_id +drop table t5 ; +set @arg00='FROM' ; +select a @arg00 t1 where a=1 ; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 t1 where a=1' at line 1 +prepare stmt1 from ' select a ? t1 where a=1 ' ; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? t1 where a=1' at line 1 +set @arg00='t1' ; +select a from @arg00 where a=1 ; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 where a=1' at line 1 +prepare stmt1 from ' select a from ? where a=1 ' ; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? where a=1' at line 1 +set @arg00='WHERE' ; +select a from t1 @arg00 a=1 ; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 a=1' at line 1 +prepare stmt1 from ' select a from t1 ? a=1 ' ; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? a=1' at line 1 +set @arg00=1 ; +select a FROM t1 where a=@arg00 ; +a +1 +prepare stmt1 from ' select a FROM t1 where a=? ' ; +execute stmt1 using @arg00 ; +a +1 +set @arg00=1000 ; +execute stmt1 using @arg00 ; +a +set @arg00=NULL ; +select a FROM t1 where a=@arg00 ; +a +prepare stmt1 from ' select a FROM t1 where a=? ' ; +execute stmt1 using @arg00 ; +a +set @arg00=4 ; +select a FROM t1 where a=sqrt(@arg00) ; +a +2 +prepare stmt1 from ' select a FROM t1 where a=sqrt(?) ' ; +execute stmt1 using @arg00 ; +a +2 +set @arg00=NULL ; +select a FROM t1 where a=sqrt(@arg00) ; +a +prepare stmt1 from ' select a FROM t1 where a=sqrt(?) ' ; +execute stmt1 using @arg00 ; +a +set @arg00=2 ; +set @arg01=3 ; +select a FROM t1 where a in (@arg00,@arg01) order by a; +a +2 +3 +prepare stmt1 from ' select a FROM t1 where a in (?,?) order by a '; +execute stmt1 using @arg00, @arg01; +a +2 +3 +set @arg00= 'one' ; +set @arg01= 'two' ; +set @arg02= 'five' ; +prepare stmt1 from ' select b FROM t1 where b in (?,?,?) order by b ' ; +execute stmt1 using @arg00, @arg01, @arg02 ; +b +one +two +prepare stmt1 from ' select b FROM t1 where b like ? '; +set @arg00='two' ; +execute stmt1 using @arg00 ; +b +two +set @arg00='tw%' ; +execute stmt1 using @arg00 ; +b +two +set @arg00='%wo' ; +execute stmt1 using @arg00 ; +b +two +set @arg00=null ; +insert into t9 set c1= 0, c5 = NULL ; +select c5 from t9 where c5 > NULL ; +c5 +prepare stmt1 from ' select c5 from t9 where c5 > ? '; +execute stmt1 using @arg00 ; +c5 +select c5 from t9 where c5 < NULL ; +c5 +prepare stmt1 from ' select c5 from t9 where c5 < ? '; +execute stmt1 using @arg00 ; +c5 +select c5 from t9 where c5 = NULL ; +c5 +prepare stmt1 from ' select c5 from t9 where c5 = ? '; +execute stmt1 using @arg00 ; +c5 +select c5 from t9 where c5 <=> NULL ; +c5 +NULL +prepare stmt1 from ' select c5 from t9 where c5 <=> ? '; +execute stmt1 using @arg00 ; +c5 +NULL +delete from t9 where c1= 0 ; +set @arg00='>' ; +select a FROM t1 where a @arg00 1 ; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 1' at line 1 +prepare stmt1 from ' select a FROM t1 where a ? 1 ' ; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? 1' at line 1 +set @arg00=1 ; +select a,b FROM t1 where a is not NULL +AND b is not NULL group by a - @arg00 ; +a b +1 one +2 two +3 three +4 four +prepare stmt1 from ' select a,b FROM t1 where a is not NULL +AND b is not NULL group by a - ? ' ; +execute stmt1 using @arg00 ; +a b +1 one +2 two +3 three +4 four +set @arg00='two' ; +select a,b FROM t1 where a is not NULL +AND b is not NULL having b <> @arg00 order by a ; +a b +1 one +3 three +4 four +prepare stmt1 from ' select a,b FROM t1 where a is not NULL +AND b is not NULL having b <> ? order by a ' ; +execute stmt1 using @arg00 ; +a b +1 one +3 three +4 four +set @arg00=1 ; +select a,b FROM t1 where a is not NULL +AND b is not NULL order by a - @arg00 ; +a b +1 one +2 two +3 three +4 four +prepare stmt1 from ' select a,b FROM t1 where a is not NULL +AND b is not NULL order by a - ? ' ; +execute stmt1 using @arg00 ; +a b +1 one +2 two +3 three +4 four +set @arg00=2 ; +select a,b from t1 order by 2 ; +a b +4 four +1 one +3 three +2 two +prepare stmt1 from ' select a,b from t1 +order by ? '; +execute stmt1 using @arg00; +a b +4 four +1 one +3 three +2 two +set @arg00=1 ; +execute stmt1 using @arg00; +a b +1 one +2 two +3 three +4 four +set @arg00=0 ; +execute stmt1 using @arg00; +ERROR 42S22: Unknown column '?' in 'order clause' +set @arg00=1; +prepare stmt1 from ' select a,b from t1 order by a +limit 1 '; +execute stmt1 ; +a b +1 one +prepare stmt1 from ' select a,b from t1 +limit ? '; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?' at line 2 +set @arg00='b' ; +set @arg01=0 ; +set @arg02=2 ; +set @arg03=2 ; +select sum(a), @arg00 from t1 where a > @arg01 +and b is not null group by substr(b,@arg02) +having sum(a) <> @arg03 ; +sum(a) @arg00 +3 b +1 b +4 b +prepare stmt1 from ' select sum(a), ? from t1 where a > ? +and b is not null group by substr(b,?) +having sum(a) <> ? '; +execute stmt1 using @arg00, @arg01, @arg02, @arg03; +sum(a) ? +3 b +1 b +4 b +test_sequence +------ join tests ------ +select first.a as a1, second.a as a2 +from t1 first, t1 second +where first.a = second.a order by a1 ; +a1 a2 +1 1 +2 2 +3 3 +4 4 +prepare stmt1 from ' select first.a as a1, second.a as a2 + from t1 first, t1 second + where first.a = second.a order by a1 '; +execute stmt1 ; +a1 a2 +1 1 +2 2 +3 3 +4 4 +set @arg00='ABC'; +set @arg01='two'; +set @arg02='one'; +select first.a, @arg00, second.a FROM t1 first, t1 second +where @arg01 = first.b or first.a = second.a or second.b = @arg02 +order by second.a, first.a; +a @arg00 a +1 ABC 1 +2 ABC 1 +3 ABC 1 +4 ABC 1 +2 ABC 2 +2 ABC 3 +3 ABC 3 +2 ABC 4 +4 ABC 4 +prepare stmt1 from ' select first.a, ?, second.a FROM t1 first, t1 second + where ? = first.b or first.a = second.a or second.b = ? + order by second.a, first.a'; +execute stmt1 using @arg00, @arg01, @arg02; +a ? a +1 ABC 1 +2 ABC 1 +3 ABC 1 +4 ABC 1 +2 ABC 2 +2 ABC 3 +3 ABC 3 +2 ABC 4 +4 ABC 4 +drop table if exists t2 ; +create table t2 as select * from t1 ; +set @query1= 'SELECT * FROM t2 join t1 on (t1.a=t2.a) order by t2.a ' ; +set @query2= 'SELECT * FROM t2 natural join t1 order by t2.a ' ; +set @query3= 'SELECT * FROM t2 join t1 using(a) order by t2.a ' ; +set @query4= 'SELECT * FROM t2 left join t1 on(t1.a=t2.a) order by t2.a ' ; +set @query5= 'SELECT * FROM t2 natural left join t1 order by t2.a ' ; +set @query6= 'SELECT * FROM t2 left join t1 using(a) order by t2.a ' ; +set @query7= 'SELECT * FROM t2 right join t1 on(t1.a=t2.a) order by t2.a ' ; +set @query8= 'SELECT * FROM t2 natural right join t1 order by t2.a ' ; +set @query9= 'SELECT * FROM t2 right join t1 using(a) order by t2.a ' ; +the join statement is: +SELECT * FROM t2 right join t1 using(a) order by t2.a +prepare stmt1 from @query9 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +the join statement is: +SELECT * FROM t2 natural right join t1 order by t2.a +prepare stmt1 from @query8 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +the join statement is: +SELECT * FROM t2 right join t1 on(t1.a=t2.a) order by t2.a +prepare stmt1 from @query7 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +the join statement is: +SELECT * FROM t2 left join t1 using(a) order by t2.a +prepare stmt1 from @query6 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +the join statement is: +SELECT * FROM t2 natural left join t1 order by t2.a +prepare stmt1 from @query5 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +the join statement is: +SELECT * FROM t2 left join t1 on(t1.a=t2.a) order by t2.a +prepare stmt1 from @query4 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +the join statement is: +SELECT * FROM t2 join t1 using(a) order by t2.a +prepare stmt1 from @query3 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +the join statement is: +SELECT * FROM t2 natural join t1 order by t2.a +prepare stmt1 from @query2 ; +execute stmt1 ; +a b +1 one +2 two +3 three +4 four +execute stmt1 ; +a b +1 one +2 two +3 three +4 four +execute stmt1 ; +a b +1 one +2 two +3 three +4 four +the join statement is: +SELECT * FROM t2 join t1 on (t1.a=t2.a) order by t2.a +prepare stmt1 from @query1 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +drop table t2 ; +test_sequence +------ subquery tests ------ +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where b = ''two'') '; +execute stmt1 ; +a b +2 two +set @arg00='two' ; +select a, b FROM t1 outer_table where +a = (select a from t1 where b = 'two' ) and b=@arg00 ; +a b +2 two +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where b = ''two'') and b=? '; +execute stmt1 using @arg00; +a b +2 two +set @arg00='two' ; +select a, b FROM t1 outer_table where +a = (select a from t1 where b = @arg00 ) and b='two' ; +a b +2 two +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where b = ? ) and b=''two'' ' ; +execute stmt1 using @arg00; +a b +2 two +set @arg00=3 ; +set @arg01='three' ; +select a,b FROM t1 where (a,b) in (select 3, 'three'); +a b +3 three +select a FROM t1 where (a,b) in (select @arg00,@arg01); +a +3 +prepare stmt1 from ' select a FROM t1 where (a,b) in (select ?, ?) '; +execute stmt1 using @arg00, @arg01; +a +3 +set @arg00=1 ; +set @arg01='two' ; +set @arg02=2 ; +set @arg03='two' ; +select a, @arg00, b FROM t1 outer_table where +b=@arg01 and a = (select @arg02 from t1 where b = @arg03 ) ; +a @arg00 b +2 1 two +prepare stmt1 from ' select a, ?, b FROM t1 outer_table where + b=? and a = (select ? from t1 where b = ? ) ' ; +execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; +a ? b +2 1 two +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where b = outer_table.b ) order by a '; +execute stmt1 ; +a b +1 one +2 two +3 three +4 four +prepare stmt1 from ' SELECT a as ccc from t1 where a+1= + (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) '; +execute stmt1 ; +ccc +1 +deallocate prepare stmt1 ; +prepare stmt1 from ' SELECT a as ccc from t1 where a+1= + (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) '; +execute stmt1 ; +ccc +1 +deallocate prepare stmt1 ; +prepare stmt1 from ' SELECT a as ccc from t1 where a+1= + (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) '; +execute stmt1 ; +ccc +1 +deallocate prepare stmt1 ; +set @arg00='two' ; +select a, b FROM t1 outer_table where +a = (select a from t1 where b = outer_table.b ) and b=@arg00 ; +a b +2 two +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where b = outer_table.b) and b=? '; +execute stmt1 using @arg00; +a b +2 two +set @arg00=2 ; +select a, b FROM t1 outer_table where +a = (select a from t1 where a = @arg00 and b = outer_table.b) and b='two' ; +a b +2 two +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where a = ? and b = outer_table.b) and b=''two'' ' ; +execute stmt1 using @arg00; +a b +2 two +set @arg00=2 ; +select a, b FROM t1 outer_table where +a = (select a from t1 where outer_table.a = @arg00 and a=2) and b='two' ; +a b +2 two +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where outer_table.a = ? and a=2) and b=''two'' ' ; +execute stmt1 using @arg00; +a b +2 two +set @arg00=1 ; +set @arg01='two' ; +set @arg02=2 ; +set @arg03='two' ; +select a, @arg00, b FROM t1 outer_table where +b=@arg01 and a = (select @arg02 from t1 where outer_table.b = @arg03 +and outer_table.a=a ) ; +a @arg00 b +2 1 two +prepare stmt1 from ' select a, ?, b FROM t1 outer_table where + b=? and a = (select ? from t1 where outer_table.b = ? + and outer_table.a=a ) ' ; +execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; +a ? b +2 1 two +set @arg00=1 ; +set @arg01=0 ; +select a, @arg00 +from ( select a - @arg00 as a from t1 where a=@arg00 ) as t2 +where a=@arg01; +a @arg00 +0 1 +prepare stmt1 from ' select a, ? + from ( select a - ? as a from t1 where a=? ) as t2 + where a=? '; +execute stmt1 using @arg00, @arg00, @arg00, @arg01 ; +a ? +0 1 +drop table if exists t2 ; +create table t2 as select * from t1; +prepare stmt1 from ' select a in (select a from t2) from t1 ' ; +execute stmt1 ; +a in (select a from t2) +1 +1 +1 +1 +drop table if exists t5, t6, t7 ; +create table t5 (a int , b int) ; +create table t6 like t5 ; +create table t7 like t5 ; +insert into t5 values (0, 100), (1, 2), (1, 3), (2, 2), (2, 7), +(2, -1), (3, 10) ; +insert into t6 values (0, 0), (1, 1), (2, 1), (3, 1), (4, 1) ; +insert into t7 values (3, 3), (2, 2), (1, 1) ; +prepare stmt1 from ' select a, (select count(distinct t5.b) as sum from t5, t6 + where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b + group by t5.a order by sum limit 1) from t7 ' ; +execute stmt1 ; +a (select count(distinct t5.b) as sum from t5, t6 + where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b + group by t5.a order by sum limit 1) +3 1 +2 2 +1 2 +execute stmt1 ; +a (select count(distinct t5.b) as sum from t5, t6 + where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b + group by t5.a order by sum limit 1) +3 1 +2 2 +1 2 +execute stmt1 ; +a (select count(distinct t5.b) as sum from t5, t6 + where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b + group by t5.a order by sum limit 1) +3 1 +2 2 +1 2 +drop table t5, t6, t7 ; +drop table if exists t2 ; +create table t2 as select * from t9; +set @stmt= ' SELECT + (SELECT SUM(c1 + c12 + 0.0) FROM t2 + where (t9.c2 - 0e-3) = t2.c2 + GROUP BY t9.c15 LIMIT 1) as scalar_s, + exists (select 1.0e+0 from t2 + where t2.c3 * 9.0000000000 = t9.c4) as exists_s, + c5 * 4 in (select c6 + 0.3e+1 from t2) as in_s, + (c7 - 4, c8 - 4) in (select c9 + 4.0, c10 + 40e-1 from t2) as in_row_s +FROM t9, +(select c25 x, c32 y from t2) tt WHERE x = c25 ' ; +prepare stmt1 from @stmt ; +execute stmt1 ; +execute stmt1 ; +set @stmt= concat('explain ',@stmt); +prepare stmt1 from @stmt ; +execute stmt1 ; +execute stmt1 ; +set @stmt= ' SELECT + (SELECT SUM(c1+c12+?) FROM t2 where (t9.c2-?)=t2.c2 + GROUP BY t9.c15 LIMIT 1) as scalar_s, + exists (select ? from t2 + where t2.c3*?=t9.c4) as exists_s, + c5*? in (select c6+? from t2) as in_s, + (c7-?, c8-?) in (select c9+?, c10+? from t2) as in_row_s +FROM t9, +(select c25 x, c32 y from t2) tt WHERE x =c25 ' ; +set @arg00= 0.0 ; +set @arg01= 0e-3 ; +set @arg02= 1.0e+0 ; +set @arg03= 9.0000000000 ; +set @arg04= 4 ; +set @arg05= 0.3e+1 ; +set @arg06= 4 ; +set @arg07= 4 ; +set @arg08= 4.0 ; +set @arg09= 40e-1 ; +prepare stmt1 from @stmt ; +execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, +@arg07, @arg08, @arg09 ; +execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, +@arg07, @arg08, @arg09 ; +set @stmt= concat('explain ',@stmt); +prepare stmt1 from @stmt ; +execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, +@arg07, @arg08, @arg09 ; +execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, +@arg07, @arg08, @arg09 ; +drop table t2 ; +select 1 < (select a from t1) ; +ERROR 21000: Subquery returns more than 1 row +prepare stmt1 from ' select 1 < (select a from t1) ' ; +execute stmt1 ; +ERROR 21000: Subquery returns more than 1 row +select 1 as my_col ; +my_col +1 +test_sequence +------ union tests ------ +prepare stmt1 from ' select a FROM t1 where a=1 + union distinct + select a FROM t1 where a=1 '; +execute stmt1 ; +a +1 +execute stmt1 ; +a +1 +prepare stmt1 from ' select a FROM t1 where a=1 + union all + select a FROM t1 where a=1 '; +execute stmt1 ; +a +1 +1 +prepare stmt1 from ' SELECT 1, 2 union SELECT 1 ' ; +ERROR 21000: The used SELECT statements have a different number of columns +prepare stmt1 from ' SELECT 1 union SELECT 1, 2 ' ; +ERROR 21000: The used SELECT statements have a different number of columns +prepare stmt1 from ' SELECT * from t1 union SELECT 1 ' ; +ERROR 21000: The used SELECT statements have a different number of columns +prepare stmt1 from ' SELECT 1 union SELECT * from t1 ' ; +ERROR 21000: The used SELECT statements have a different number of columns +set @arg00=1 ; +select @arg00 FROM t1 where a=1 +union distinct +select 1 FROM t1 where a=1; +@arg00 +1 +prepare stmt1 from ' select ? FROM t1 where a=1 + union distinct + select 1 FROM t1 where a=1 ' ; +execute stmt1 using @arg00; +? +1 +set @arg00=1 ; +select 1 FROM t1 where a=1 +union distinct +select @arg00 FROM t1 where a=1; +1 +1 +prepare stmt1 from ' select 1 FROM t1 where a=1 + union distinct + select ? FROM t1 where a=1 ' ; +execute stmt1 using @arg00; +1 +1 +set @arg00='a' ; +select @arg00 FROM t1 where a=1 +union distinct +select @arg00 FROM t1 where a=1; +@arg00 +a +prepare stmt1 from ' select ? FROM t1 where a=1 + union distinct + select ? FROM t1 where a=1 '; +execute stmt1 using @arg00, @arg00; +? +a +prepare stmt1 from ' select ? + union distinct + select ? '; +execute stmt1 using @arg00, @arg00; +? +a +set @arg00='a' ; +set @arg01=1 ; +set @arg02='a' ; +set @arg03=2 ; +select @arg00 FROM t1 where a=@arg01 +union distinct +select @arg02 FROM t1 where a=@arg03; +@arg00 +a +prepare stmt1 from ' select ? FROM t1 where a=? + union distinct + select ? FROM t1 where a=? ' ; +execute stmt1 using @arg00, @arg01, @arg02, @arg03; +? +a +set @arg00=1 ; +prepare stmt1 from ' select sum(a) + 200, ? from t1 +union distinct +select sum(a) + 200, 1 from t1 +group by b ' ; +execute stmt1 using @arg00; +sum(a) + 200 ? +210 1 +204 1 +201 1 +203 1 +202 1 +set @Oporto='Oporto' ; +set @Lisboa='Lisboa' ; +set @0=0 ; +set @1=1 ; +set @2=2 ; +set @3=3 ; +set @4=4 ; +select @Oporto,@Lisboa,@0,@1,@2,@3,@4 ; +@Oporto @Lisboa @0 @1 @2 @3 @4 +Oporto Lisboa 0 1 2 3 4 +select sum(a) + 200 as the_sum, @Oporto as the_town from t1 +group by b +union distinct +select sum(a) + 200, @Lisboa from t1 +group by b ; +the_sum the_town +204 Oporto +201 Oporto +203 Oporto +202 Oporto +204 Lisboa +201 Lisboa +203 Lisboa +202 Lisboa +prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1 + group by b + union distinct + select sum(a) + 200, ? from t1 + group by b ' ; +execute stmt1 using @Oporto, @Lisboa; +the_sum the_town +204 Oporto +201 Oporto +203 Oporto +202 Oporto +204 Lisboa +201 Lisboa +203 Lisboa +202 Lisboa +select sum(a) + 200 as the_sum, @Oporto as the_town from t1 +where a > @1 +group by b +union distinct +select sum(a) + 200, @Lisboa from t1 +where a > @2 +group by b ; +the_sum the_town +204 Oporto +203 Oporto +202 Oporto +204 Lisboa +203 Lisboa +prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1 + where a > ? + group by b + union distinct + select sum(a) + 200, ? from t1 + where a > ? + group by b ' ; +execute stmt1 using @Oporto, @1, @Lisboa, @2; +the_sum the_town +204 Oporto +203 Oporto +202 Oporto +204 Lisboa +203 Lisboa +select sum(a) + 200 as the_sum, @Oporto as the_town from t1 +where a > @1 +group by b +having avg(a) > @2 +union distinct +select sum(a) + 200, @Lisboa from t1 +where a > @2 +group by b +having avg(a) > @3; +the_sum the_town +204 Oporto +203 Oporto +204 Lisboa +prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1 + where a > ? + group by b + having avg(a) > ? + union distinct + select sum(a) + 200, ? from t1 + where a > ? + group by b + having avg(a) > ? '; +execute stmt1 using @Oporto, @1, @2, @Lisboa, @2, @3; +the_sum the_town +204 Oporto +203 Oporto +204 Lisboa +test_sequence +------ explain select tests ------ +prepare stmt1 from ' explain select * from t9 ' ; +execute stmt1; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def id 8 3 1 N 32801 0 8 +def select_type 253 19 6 N 1 31 33 +def table 253 64 2 N 1 31 33 +def type 253 10 3 N 1 31 33 +def possible_keys 253 4096 0 Y 0 31 33 +def key 253 64 0 Y 0 31 33 +def key_len 8 3 0 Y 32800 0 8 +def ref 253 1024 0 Y 0 31 33 +def rows 8 10 1 N 32801 0 8 +def Extra 253 255 0 N 1 31 33 +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t9 ALL NULL NULL NULL NULL 2 +test_sequence +------ delete tests ------ +delete from t1 ; +insert into t1 values (1,'one'); +insert into t1 values (2,'two'); +insert into t1 values (3,'three'); +insert into t1 values (4,'four'); +commit ; +delete from t9 ; +insert into t9 +set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, +c10= 1, c11= 1, c12 = 1, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=true, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; +insert into t9 +set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, +c10= 9, c11= 9, c12 = 9, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=false, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +commit ; +prepare stmt1 from 'delete from t1 where a=2' ; +execute stmt1; +select a,b from t1 where a=2; +a b +execute stmt1; +insert into t1 values(0,NULL); +set @arg00=NULL; +prepare stmt1 from 'delete from t1 where b=?' ; +execute stmt1 using @arg00; +select a,b from t1 where b is NULL ; +a b +0 NULL +set @arg00='one'; +execute stmt1 using @arg00; +select a,b from t1 where b=@arg00; +a b +prepare stmt1 from 'truncate table t1' ; +ERROR HY000: This command is not supported in the prepared statement protocol yet +test_sequence +------ update tests ------ +delete from t1 ; +insert into t1 values (1,'one'); +insert into t1 values (2,'two'); +insert into t1 values (3,'three'); +insert into t1 values (4,'four'); +commit ; +delete from t9 ; +insert into t9 +set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, +c10= 1, c11= 1, c12 = 1, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=true, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; +insert into t9 +set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, +c10= 9, c11= 9, c12 = 9, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=false, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +commit ; +prepare stmt1 from 'update t1 set b=''a=two'' where a=2' ; +execute stmt1; +select a,b from t1 where a=2; +a b +2 a=two +execute stmt1; +select a,b from t1 where a=2; +a b +2 a=two +set @arg00=NULL; +prepare stmt1 from 'update t1 set b=? where a=2' ; +execute stmt1 using @arg00; +select a,b from t1 where a=2; +a b +2 NULL +set @arg00='two'; +execute stmt1 using @arg00; +select a,b from t1 where a=2; +a b +2 two +set @arg00=2; +prepare stmt1 from 'update t1 set b=NULL where a=?' ; +execute stmt1 using @arg00; +select a,b from t1 where a=@arg00; +a b +2 NULL +update t1 set b='two' where a=@arg00; +set @arg00=2000; +execute stmt1 using @arg00; +select a,b from t1 where a=@arg00; +a b +set @arg00=2; +set @arg01=22; +prepare stmt1 from 'update t1 set a=? where a=?' ; +execute stmt1 using @arg00, @arg00; +select a,b from t1 where a=@arg00; +a b +2 two +execute stmt1 using @arg01, @arg00; +select a,b from t1 where a=@arg01; +a b +22 two +execute stmt1 using @arg00, @arg01; +select a,b from t1 where a=@arg00; +a b +2 two +set @arg00=NULL; +set @arg01=2; +execute stmt1 using @arg00, @arg01; +Warnings: +Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 1 +select a,b from t1 order by a; +a b +0 two +1 one +3 three +4 four +set @arg00=0; +execute stmt1 using @arg01, @arg00; +select a,b from t1 order by a; +a b +1 one +2 two +3 three +4 four +set @arg00=23; +set @arg01='two'; +set @arg02=2; +set @arg03='two'; +set @arg04=2; +drop table if exists t2; +create table t2 as select a,b from t1 ; +prepare stmt1 from 'update t1 set a=? where b=? + and a in (select ? from t2 + where b = ? or a = ?)'; +execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04 ; +affected rows: 1 +info: Rows matched: 1 Changed: 1 Warnings: 0 +select a,b from t1 where a = @arg00 ; +a b +23 two +prepare stmt1 from 'update t1 set a=? where b=? + and a not in (select ? from t2 + where b = ? or a = ?)'; +execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ; +affected rows: 1 +info: Rows matched: 1 Changed: 1 Warnings: 0 +select a,b from t1 order by a ; +a b +1 one +2 two +3 three +4 four +drop table t2 ; +create table t2 +( +a int, b varchar(30), +primary key(a) +) engine = 'HEAP' ; +insert into t2(a,b) select a, b from t1 ; +prepare stmt1 from 'update t1 set a=? where b=? + and a in (select ? from t2 + where b = ? or a = ?)'; +execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04 ; +affected rows: 1 +info: Rows matched: 1 Changed: 1 Warnings: 0 +select a,b from t1 where a = @arg00 ; +a b +23 two +prepare stmt1 from 'update t1 set a=? where b=? + and a not in (select ? from t2 + where b = ? or a = ?)'; +execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ; +affected rows: 1 +info: Rows matched: 1 Changed: 1 Warnings: 0 +select a,b from t1 order by a ; +a b +1 one +2 two +3 three +4 four +drop table t2 ; +set @arg00=1; +prepare stmt1 from 'update t1 set b=''bla'' +where a=2 +limit 1'; +execute stmt1 ; +select a,b from t1 where b = 'bla' ; +a b +2 bla +prepare stmt1 from 'update t1 set b=''bla'' +where a=2 +limit ?'; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?' at line 3 +test_sequence +------ insert tests ------ +delete from t1 ; +insert into t1 values (1,'one'); +insert into t1 values (2,'two'); +insert into t1 values (3,'three'); +insert into t1 values (4,'four'); +commit ; +delete from t9 ; +insert into t9 +set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, +c10= 1, c11= 1, c12 = 1, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=true, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; +insert into t9 +set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, +c10= 9, c11= 9, c12 = 9, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=false, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +commit ; +prepare stmt1 from 'insert into t1 values(5, ''five'' )'; +execute stmt1; +select a,b from t1 where a = 5; +a b +5 five +set @arg00='six' ; +prepare stmt1 from 'insert into t1 values(6, ? )'; +execute stmt1 using @arg00; +select a,b from t1 where b = @arg00; +a b +6 six +execute stmt1 using @arg00; +ERROR 23000: Duplicate entry '6' for key 1 +set @arg00=NULL ; +prepare stmt1 from 'insert into t1 values(0, ? )'; +execute stmt1 using @arg00; +select a,b from t1 where b is NULL; +a b +0 NULL +set @arg00=8 ; +set @arg01='eight' ; +prepare stmt1 from 'insert into t1 values(?, ? )'; +execute stmt1 using @arg00, @arg01 ; +select a,b from t1 where b = @arg01; +a b +8 eight +set @NULL= null ; +set @arg00= 'abc' ; +execute stmt1 using @NULL, @NULL ; +ERROR 23000: Column 'a' cannot be null +execute stmt1 using @NULL, @NULL ; +ERROR 23000: Column 'a' cannot be null +execute stmt1 using @NULL, @arg00 ; +ERROR 23000: Column 'a' cannot be null +execute stmt1 using @NULL, @arg00 ; +ERROR 23000: Column 'a' cannot be null +set @arg01= 10000 + 2 ; +execute stmt1 using @arg01, @arg00 ; +set @arg01= 10000 + 1 ; +execute stmt1 using @arg01, @arg00 ; +select * from t1 where a > 10000 order by a ; +a b +10001 abc +10002 abc +delete from t1 where a > 10000 ; +set @arg01= 10000 + 2 ; +execute stmt1 using @arg01, @NULL ; +set @arg01= 10000 + 1 ; +execute stmt1 using @arg01, @NULL ; +select * from t1 where a > 10000 order by a ; +a b +10001 NULL +10002 NULL +delete from t1 where a > 10000 ; +set @arg01= 10000 + 10 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 9 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 8 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 7 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 6 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 5 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 4 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 3 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 2 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 1 ; +execute stmt1 using @arg01, @arg01 ; +select * from t1 where a > 10000 order by a ; +a b +10001 10001 +10002 10002 +10003 10003 +10004 10004 +10005 10005 +10006 10006 +10007 10007 +10008 10008 +10009 10009 +10010 10010 +delete from t1 where a > 10000 ; +set @arg00=81 ; +set @arg01='8-1' ; +set @arg02=82 ; +set @arg03='8-2' ; +prepare stmt1 from 'insert into t1 values(?,?),(?,?)'; +execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; +select a,b from t1 where a in (@arg00,@arg02) ; +a b +81 8-1 +82 8-2 +set @arg00=9 ; +set @arg01='nine' ; +prepare stmt1 from 'insert into t1 set a=?, b=? '; +execute stmt1 using @arg00, @arg01 ; +select a,b from t1 where a = @arg00 ; +a b +9 nine +set @arg00=6 ; +set @arg01=1 ; +prepare stmt1 from 'insert into t1 set a=?, b=''sechs'' + on duplicate key update a=a + ?, b=concat(b,''modified'') '; +execute stmt1 using @arg00, @arg01; +select * from t1 order by a; +a b +0 NULL +1 one +2 two +3 three +4 four +5 five +7 sixmodified +8 eight +9 nine +81 8-1 +82 8-2 +set @arg00=81 ; +set @arg01=1 ; +execute stmt1 using @arg00, @arg01; +ERROR 23000: Duplicate entry '82' for key 1 +drop table if exists t2 ; +create table t2 (id int auto_increment primary key) +ENGINE= 'HEAP' ; +prepare stmt1 from ' select last_insert_id() ' ; +insert into t2 values (NULL) ; +execute stmt1 ; +last_insert_id() +1 +insert into t2 values (NULL) ; +execute stmt1 ; +last_insert_id() +2 +drop table t2 ; +set @1000=1000 ; +set @x1000_2="x1000_2" ; +set @x1000_3="x1000_3" ; +set @x1000="x1000" ; +set @1100=1100 ; +set @x1100="x1100" ; +set @100=100 ; +set @updated="updated" ; +insert into t1 values(1000,'x1000_1') ; +insert into t1 values(@1000,@x1000_2),(@1000,@x1000_3) +on duplicate key update a = a + @100, b = concat(b,@updated) ; +select a,b from t1 where a >= 1000 order by a ; +a b +1000 x1000_3 +1100 x1000_1updated +delete from t1 where a >= 1000 ; +insert into t1 values(1000,'x1000_1') ; +prepare stmt1 from ' insert into t1 values(?,?),(?,?) + on duplicate key update a = a + ?, b = concat(b,?) '; +execute stmt1 using @1000, @x1000_2, @1000, @x1000_3, @100, @updated ; +select a,b from t1 where a >= 1000 order by a ; +a b +1000 x1000_3 +1100 x1000_1updated +delete from t1 where a >= 1000 ; +insert into t1 values(1000,'x1000_1') ; +execute stmt1 using @1000, @x1000_2, @1100, @x1000_3, @100, @updated ; +select a,b from t1 where a >= 1000 order by a ; +a b +1200 x1000_1updatedupdated +delete from t1 where a >= 1000 ; +prepare stmt1 from ' replace into t1 (a,b) select 100, ''hundred'' '; +execute stmt1; +execute stmt1; +execute stmt1; +test_sequence +------ multi table tests ------ +delete from t1 ; +delete from t9 ; +insert into t1(a,b) values (1, 'one'), (2, 'two'), (3, 'three') ; +insert into t9 (c1,c21) +values (1, 'one'), (2, 'two'), (3, 'three') ; +prepare stmt_delete from " delete t1, t9 + from t1, t9 where t1.a=t9.c1 and t1.b='updated' "; +prepare stmt_update from " update t1, t9 + set t1.b='updated', t9.c21='updated' + where t1.a=t9.c1 and t1.a=? "; +prepare stmt_select1 from " select a, b from t1 order by a" ; +prepare stmt_select2 from " select c1, c21 from t9 order by c1" ; +set @arg00= 1 ; +execute stmt_update using @arg00 ; +execute stmt_delete ; +execute stmt_select1 ; +a b +2 two +3 three +execute stmt_select2 ; +c1 c21 +2 two +3 three +set @arg00= @arg00 + 1 ; +execute stmt_update using @arg00 ; +execute stmt_delete ; +execute stmt_select1 ; +a b +3 three +execute stmt_select2 ; +c1 c21 +3 three +set @arg00= @arg00 + 1 ; +execute stmt_update using @arg00 ; +execute stmt_delete ; +execute stmt_select1 ; +a b +execute stmt_select2 ; +c1 c21 +set @arg00= @arg00 + 1 ; +delete from t1 ; +insert into t1 values (1,'one'); +insert into t1 values (2,'two'); +insert into t1 values (3,'three'); +insert into t1 values (4,'four'); +commit ; +delete from t9 ; +insert into t9 +set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, +c10= 1, c11= 1, c12 = 1, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=true, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; +insert into t9 +set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, +c10= 9, c11= 9, c12 = 9, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=false, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +commit ; +insert into t1 values(0,NULL) ; +set @duplicate='duplicate ' ; +set @1000=1000 ; +set @5=5 ; +select a,b from t1 where a < 5 order by a ; +a b +0 NULL +1 one +2 two +3 three +4 four +insert into t1 select a + @1000, concat(@duplicate,b) from t1 +where a < @5 ; +affected rows: 5 +info: Records: 5 Duplicates: 0 Warnings: 0 +select a,b from t1 where a >= 1000 order by a ; +a b +1000 NULL +1001 duplicate one +1002 duplicate two +1003 duplicate three +1004 duplicate four +delete from t1 where a >= 1000 ; +prepare stmt1 from ' insert into t1 select a + ?, concat(?,b) from t1 +where a < ? ' ; +execute stmt1 using @1000, @duplicate, @5; +affected rows: 5 +info: Records: 5 Duplicates: 0 Warnings: 0 +select a,b from t1 where a >= 1000 order by a ; +a b +1000 NULL +1001 duplicate one +1002 duplicate two +1003 duplicate three +1004 duplicate four +delete from t1 where a >= 1000 ; +set @float=1.00; +set @five='five' ; +drop table if exists t2; +create table t2 like t1 ; +insert into t2 (b,a) +select @duplicate, sum(first.a) from t1 first, t1 second +where first.a <> @5 and second.b = first.b +and second.b <> @five +group by second.b +having sum(second.a) > @2 +union +select b, a + @100 from t1 +where (a,b) in ( select sqrt(a+@1)+CAST(@float AS signed),b +from t1); +affected rows: 3 +info: Records: 3 Duplicates: 0 Warnings: 0 +select a,b from t2 order by a ; +a b +3 duplicate +4 duplicate +103 three +delete from t2 ; +prepare stmt1 from ' insert into t2 (b,a) +select ?, sum(first.a) + from t1 first, t1 second + where first.a <> ? and second.b = first.b and second.b <> ? + group by second.b + having sum(second.a) > ? +union +select b, a + ? from t1 + where (a,b) in ( select sqrt(a+?)+CAST(? AS signed),b + from t1 ) ' ; +execute stmt1 using @duplicate, @5, @five, @2, @100, @1, @float ; +affected rows: 3 +info: Records: 3 Duplicates: 0 Warnings: 0 +select a,b from t2 order by a ; +a b +3 duplicate +4 duplicate +103 three +drop table t2; +drop table if exists t5 ; +set @arg01= 8; +set @arg02= 8.0; +set @arg03= 80.00000000000e-1; +set @arg04= 'abc' ; +set @arg05= CAST('abc' as binary) ; +set @arg06= '1991-08-05' ; +set @arg07= CAST('1991-08-05' as date); +set @arg08= '1991-08-05 01:01:01' ; +set @arg09= CAST('1991-08-05 01:01:01' as datetime) ; +set @arg10= unix_timestamp('1991-01-01 01:01:01'); +set @arg11= YEAR('1991-01-01 01:01:01'); +set @arg12= 8 ; +set @arg12= NULL ; +set @arg13= 8.0 ; +set @arg13= NULL ; +set @arg14= 'abc'; +set @arg14= NULL ; +set @arg15= CAST('abc' as binary) ; +set @arg15= NULL ; +create table t5 as select +8 as const01, @arg01 as param01, +8.0 as const02, @arg02 as param02, +80.00000000000e-1 as const03, @arg03 as param03, +'abc' as const04, @arg04 as param04, +CAST('abc' as binary) as const05, @arg05 as param05, +'1991-08-05' as const06, @arg06 as param06, +CAST('1991-08-05' as date) as const07, @arg07 as param07, +'1991-08-05 01:01:01' as const08, @arg08 as param08, +CAST('1991-08-05 01:01:01' as datetime) as const09, @arg09 as param09, +unix_timestamp('1991-01-01 01:01:01') as const10, @arg10 as param10, +YEAR('1991-01-01 01:01:01') as const11, @arg11 as param11, +NULL as const12, @arg12 as param12, +@arg13 as param13, +@arg14 as param14, +@arg15 as param15; +show create table t5 ; +Table Create Table +t5 CREATE TABLE `t5` ( + `const01` bigint(1) NOT NULL default '0', + `param01` bigint(20) default NULL, + `const02` double(3,1) NOT NULL default '0.0', + `param02` double default NULL, + `const03` double NOT NULL default '0', + `param03` double default NULL, + `const04` char(3) NOT NULL default '', + `param04` longtext, + `const05` binary(3) NOT NULL default '', + `param05` longblob, + `const06` varchar(10) NOT NULL default '', + `param06` longtext, + `const07` date default NULL, + `param07` longblob, + `const08` varchar(19) NOT NULL default '', + `param08` longtext, + `const09` datetime default NULL, + `param09` longblob, + `const10` int(10) NOT NULL default '0', + `param10` bigint(20) default NULL, + `const11` int(4) default NULL, + `param11` bigint(20) default NULL, + `const12` binary(0) default NULL, + `param12` bigint(20) default NULL, + `param13` double default NULL, + `param14` longtext, + `param15` longblob +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select * from t5 ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def test t5 t5 const01 const01 8 1 1 N 32769 0 63 +def test t5 t5 param01 param01 8 20 1 Y 32768 0 63 +def test t5 t5 const02 const02 5 3 3 N 32769 1 63 +def test t5 t5 param02 param02 5 20 1 Y 32768 31 63 +def test t5 t5 const03 const03 5 23 1 N 32769 31 63 +def test t5 t5 param03 param03 5 20 1 Y 32768 31 63 +def test t5 t5 const04 const04 254 3 3 N 1 0 8 +def test t5 t5 param04 param04 252 16777215 3 Y 16 0 8 +def test t5 t5 const05 const05 254 3 3 N 129 0 63 +def test t5 t5 param05 param05 252 16777215 3 Y 144 0 63 +def test t5 t5 const06 const06 253 10 10 N 1 0 8 +def test t5 t5 param06 param06 252 16777215 10 Y 16 0 8 +def test t5 t5 const07 const07 10 10 10 Y 128 0 63 +def test t5 t5 param07 param07 252 16777215 10 Y 144 0 63 +def test t5 t5 const08 const08 253 19 19 N 1 0 8 +def test t5 t5 param08 param08 252 16777215 19 Y 16 0 8 +def test t5 t5 const09 const09 12 19 19 Y 128 0 63 +def test t5 t5 param09 param09 252 16777215 19 Y 144 0 63 +def test t5 t5 const10 const10 3 10 9 N 32769 0 63 +def test t5 t5 param10 param10 8 20 9 Y 32768 0 63 +def test t5 t5 const11 const11 3 4 4 Y 32768 0 63 +def test t5 t5 param11 param11 8 20 4 Y 32768 0 63 +def test t5 t5 const12 const12 254 0 0 Y 128 0 63 +def test t5 t5 param12 param12 8 20 0 Y 32768 0 63 +def test t5 t5 param13 param13 5 20 0 Y 32768 31 63 +def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8 +def test t5 t5 param15 param15 252 16777215 0 Y 144 0 63 +const01 8 +param01 8 +const02 8.0 +param02 8 +const03 8 +param03 8 +const04 abc +param04 abc +const05 abc +param05 abc +const06 1991-08-05 +param06 1991-08-05 +const07 1991-08-05 +param07 1991-08-05 +const08 1991-08-05 01:01:01 +param08 1991-08-05 01:01:01 +const09 1991-08-05 01:01:01 +param09 1991-08-05 01:01:01 +const10 662680861 +param10 662680861 +const11 1991 +param11 1991 +const12 NULL +param12 NULL +param13 NULL +param14 NULL +param15 NULL +drop table t5 ; +test_sequence +------ data type conversion tests ------ +delete from t1 ; +insert into t1 values (1,'one'); +insert into t1 values (2,'two'); +insert into t1 values (3,'three'); +insert into t1 values (4,'four'); +commit ; +delete from t9 ; +insert into t9 +set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, +c10= 1, c11= 1, c12 = 1, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=true, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; +insert into t9 +set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, +c10= 9, c11= 9, c12 = 9, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=false, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +commit ; +insert into t9 set c1= 0, c15= '1991-01-01 01:01:01' ; +select * from t9 order by c1 ; +c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday +test_sequence +------ select @parameter:= column ------ +prepare full_info from "select @arg01, @arg02, @arg03, @arg04, + @arg05, @arg06, @arg07, @arg08, + @arg09, @arg10, @arg11, @arg12, + @arg13, @arg14, @arg15, @arg16, + @arg17, @arg18, @arg19, @arg20, + @arg21, @arg22, @arg23, @arg24, + @arg25, @arg26, @arg27, @arg28, + @arg29, @arg30, @arg31, @arg32" ; +select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, +@arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8, +@arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12, +@arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16, +@arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20, +@arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24, +@arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28, +@arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32 +from t9 where c1= 1 ; +@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 +1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 1 Y 128 31 63 +def @arg03 254 20 1 Y 128 31 63 +def @arg04 254 20 1 Y 128 31 63 +def @arg05 254 20 1 Y 128 31 63 +def @arg06 254 20 1 Y 128 31 63 +def @arg07 254 20 1 Y 128 31 63 +def @arg08 254 20 1 Y 128 31 63 +def @arg09 254 20 1 Y 128 31 63 +def @arg10 254 20 1 Y 128 31 63 +def @arg11 254 20 1 Y 128 31 63 +def @arg12 254 20 1 Y 128 31 63 +def @arg13 254 8192 10 Y 128 31 63 +def @arg14 254 8192 19 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 8 Y 128 31 63 +def @arg17 254 20 4 Y 128 31 63 +def @arg18 254 20 1 Y 128 31 63 +def @arg19 254 20 1 Y 128 31 63 +def @arg20 254 8192 1 Y 0 31 8 +def @arg21 254 8192 10 Y 0 31 8 +def @arg22 254 8192 30 Y 0 31 8 +def @arg23 254 8192 8 Y 0 31 8 +def @arg24 254 8192 8 Y 0 31 8 +def @arg25 254 8192 4 Y 0 31 8 +def @arg26 254 8192 4 Y 0 31 8 +def @arg27 254 8192 10 Y 0 31 8 +def @arg28 254 8192 10 Y 0 31 8 +def @arg29 254 8192 8 Y 0 31 8 +def @arg30 254 8192 8 Y 0 31 8 +def @arg31 254 8192 3 Y 0 31 8 +def @arg32 254 8192 6 Y 128 31 63 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, +@arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8, +@arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12, +@arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16, +@arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20, +@arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24, +@arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28, +@arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32 +from t9 where c1= 0 ; +@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 0 Y 128 31 63 +def @arg03 254 20 0 Y 128 31 63 +def @arg04 254 20 0 Y 128 31 63 +def @arg05 254 20 0 Y 128 31 63 +def @arg06 254 20 0 Y 128 31 63 +def @arg07 254 20 0 Y 128 31 63 +def @arg08 254 20 0 Y 128 31 63 +def @arg09 254 20 0 Y 128 31 63 +def @arg10 254 20 0 Y 128 31 63 +def @arg11 254 20 0 Y 128 31 63 +def @arg12 254 20 0 Y 128 31 63 +def @arg13 254 8192 0 Y 128 31 63 +def @arg14 254 8192 0 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 0 Y 128 31 63 +def @arg17 254 20 0 Y 128 31 63 +def @arg18 254 20 0 Y 128 31 63 +def @arg19 254 20 0 Y 128 31 63 +def @arg20 254 8192 0 Y 0 31 8 +def @arg21 254 8192 0 Y 0 31 8 +def @arg22 254 8192 0 Y 0 31 8 +def @arg23 254 8192 0 Y 0 31 8 +def @arg24 254 8192 0 Y 0 31 8 +def @arg25 254 8192 0 Y 0 31 8 +def @arg26 254 8192 0 Y 0 31 8 +def @arg27 254 8192 0 Y 0 31 8 +def @arg28 254 8192 0 Y 0 31 8 +def @arg29 254 8192 0 Y 0 31 8 +def @arg30 254 8192 0 Y 0 31 8 +def @arg31 254 8192 0 Y 0 31 8 +def @arg32 254 8192 0 Y 0 31 8 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +prepare stmt1 from "select + @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, + @arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8, + @arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12, + @arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16, + @arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20, + @arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24, + @arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28, + @arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32 +from t9 where c1= ?" ; +set @my_key= 1 ; +execute stmt1 using @my_key ; +@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 +1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 1 Y 128 31 63 +def @arg03 254 20 1 Y 128 31 63 +def @arg04 254 20 1 Y 128 31 63 +def @arg05 254 20 1 Y 128 31 63 +def @arg06 254 20 1 Y 128 31 63 +def @arg07 254 20 1 Y 128 31 63 +def @arg08 254 20 1 Y 128 31 63 +def @arg09 254 20 1 Y 128 31 63 +def @arg10 254 20 1 Y 128 31 63 +def @arg11 254 20 1 Y 128 31 63 +def @arg12 254 20 1 Y 128 31 63 +def @arg13 254 8192 10 Y 128 31 63 +def @arg14 254 8192 19 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 8 Y 128 31 63 +def @arg17 254 20 4 Y 128 31 63 +def @arg18 254 20 1 Y 128 31 63 +def @arg19 254 20 1 Y 128 31 63 +def @arg20 254 8192 1 Y 0 31 8 +def @arg21 254 8192 10 Y 0 31 8 +def @arg22 254 8192 30 Y 0 31 8 +def @arg23 254 8192 8 Y 0 31 8 +def @arg24 254 8192 8 Y 0 31 8 +def @arg25 254 8192 4 Y 0 31 8 +def @arg26 254 8192 4 Y 0 31 8 +def @arg27 254 8192 10 Y 0 31 8 +def @arg28 254 8192 10 Y 0 31 8 +def @arg29 254 8192 8 Y 0 31 8 +def @arg30 254 8192 8 Y 0 31 8 +def @arg31 254 8192 3 Y 0 31 8 +def @arg32 254 8192 6 Y 128 31 63 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +set @my_key= 0 ; +execute stmt1 using @my_key ; +@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 0 Y 128 31 63 +def @arg03 254 20 0 Y 128 31 63 +def @arg04 254 20 0 Y 128 31 63 +def @arg05 254 20 0 Y 128 31 63 +def @arg06 254 20 0 Y 128 31 63 +def @arg07 254 20 0 Y 128 31 63 +def @arg08 254 20 0 Y 128 31 63 +def @arg09 254 20 0 Y 128 31 63 +def @arg10 254 20 0 Y 128 31 63 +def @arg11 254 20 0 Y 128 31 63 +def @arg12 254 20 0 Y 128 31 63 +def @arg13 254 8192 0 Y 128 31 63 +def @arg14 254 8192 0 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 0 Y 128 31 63 +def @arg17 254 20 0 Y 128 31 63 +def @arg18 254 20 0 Y 128 31 63 +def @arg19 254 20 0 Y 128 31 63 +def @arg20 254 8192 0 Y 0 31 8 +def @arg21 254 8192 0 Y 0 31 8 +def @arg22 254 8192 0 Y 0 31 8 +def @arg23 254 8192 0 Y 0 31 8 +def @arg24 254 8192 0 Y 0 31 8 +def @arg25 254 8192 0 Y 0 31 8 +def @arg26 254 8192 0 Y 0 31 8 +def @arg27 254 8192 0 Y 0 31 8 +def @arg28 254 8192 0 Y 0 31 8 +def @arg29 254 8192 0 Y 0 31 8 +def @arg30 254 8192 0 Y 0 31 8 +def @arg31 254 8192 0 Y 0 31 8 +def @arg32 254 8192 0 Y 0 31 8 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +prepare stmt1 from "select ? := c1 from t9 where c1= 1" ; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':= c1 from t9 where c1= 1' at line 1 +test_sequence +------ select column, .. into @parm,.. ------ +select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, +c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, +c25, c26, c27, c28, c29, c30, c31, c32 +into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, +@arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, +@arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24, +@arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 +from t9 where c1= 1 ; +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 1 Y 128 31 63 +def @arg03 254 20 1 Y 128 31 63 +def @arg04 254 20 1 Y 128 31 63 +def @arg05 254 20 1 Y 128 31 63 +def @arg06 254 20 1 Y 128 31 63 +def @arg07 254 20 1 Y 128 31 63 +def @arg08 254 20 1 Y 128 31 63 +def @arg09 254 20 1 Y 128 31 63 +def @arg10 254 20 1 Y 128 31 63 +def @arg11 254 20 1 Y 128 31 63 +def @arg12 254 20 1 Y 128 31 63 +def @arg13 254 8192 10 Y 128 31 63 +def @arg14 254 8192 19 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 8 Y 128 31 63 +def @arg17 254 20 4 Y 128 31 63 +def @arg18 254 20 1 Y 128 31 63 +def @arg19 254 20 1 Y 128 31 63 +def @arg20 254 8192 1 Y 0 31 8 +def @arg21 254 8192 10 Y 0 31 8 +def @arg22 254 8192 30 Y 0 31 8 +def @arg23 254 8192 8 Y 0 31 8 +def @arg24 254 8192 8 Y 0 31 8 +def @arg25 254 8192 4 Y 0 31 8 +def @arg26 254 8192 4 Y 0 31 8 +def @arg27 254 8192 10 Y 0 31 8 +def @arg28 254 8192 10 Y 0 31 8 +def @arg29 254 8192 8 Y 0 31 8 +def @arg30 254 8192 8 Y 0 31 8 +def @arg31 254 8192 3 Y 0 31 8 +def @arg32 254 8192 6 Y 128 31 63 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, +c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, +c25, c26, c27, c28, c29, c30, c31, c32 +into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, +@arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, +@arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24, +@arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 +from t9 where c1= 0 ; +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 0 Y 128 31 63 +def @arg03 254 20 0 Y 128 31 63 +def @arg04 254 20 0 Y 128 31 63 +def @arg05 254 20 0 Y 128 31 63 +def @arg06 254 20 0 Y 128 31 63 +def @arg07 254 20 0 Y 128 31 63 +def @arg08 254 20 0 Y 128 31 63 +def @arg09 254 20 0 Y 128 31 63 +def @arg10 254 20 0 Y 128 31 63 +def @arg11 254 20 0 Y 128 31 63 +def @arg12 254 20 0 Y 128 31 63 +def @arg13 254 8192 0 Y 128 31 63 +def @arg14 254 8192 0 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 0 Y 128 31 63 +def @arg17 254 20 0 Y 128 31 63 +def @arg18 254 20 0 Y 128 31 63 +def @arg19 254 20 0 Y 128 31 63 +def @arg20 254 8192 0 Y 0 31 8 +def @arg21 254 8192 0 Y 0 31 8 +def @arg22 254 8192 0 Y 0 31 8 +def @arg23 254 8192 0 Y 0 31 8 +def @arg24 254 8192 0 Y 0 31 8 +def @arg25 254 8192 0 Y 0 31 8 +def @arg26 254 8192 0 Y 0 31 8 +def @arg27 254 8192 0 Y 0 31 8 +def @arg28 254 8192 0 Y 0 31 8 +def @arg29 254 8192 0 Y 0 31 8 +def @arg30 254 8192 0 Y 0 31 8 +def @arg31 254 8192 0 Y 0 31 8 +def @arg32 254 8192 0 Y 0 31 8 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +prepare stmt1 from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, + c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, + c25, c26, c27, c28, c29, c30, c31, c32 +into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, + @arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, + @arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24, + @arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 +from t9 where c1= ?" ; +set @my_key= 1 ; +execute stmt1 using @my_key ; +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 1 Y 128 31 63 +def @arg03 254 20 1 Y 128 31 63 +def @arg04 254 20 1 Y 128 31 63 +def @arg05 254 20 1 Y 128 31 63 +def @arg06 254 20 1 Y 128 31 63 +def @arg07 254 20 1 Y 128 31 63 +def @arg08 254 20 1 Y 128 31 63 +def @arg09 254 20 1 Y 128 31 63 +def @arg10 254 20 1 Y 128 31 63 +def @arg11 254 20 1 Y 128 31 63 +def @arg12 254 20 1 Y 128 31 63 +def @arg13 254 8192 10 Y 128 31 63 +def @arg14 254 8192 19 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 8 Y 128 31 63 +def @arg17 254 20 4 Y 128 31 63 +def @arg18 254 20 1 Y 128 31 63 +def @arg19 254 20 1 Y 128 31 63 +def @arg20 254 8192 1 Y 0 31 8 +def @arg21 254 8192 10 Y 0 31 8 +def @arg22 254 8192 30 Y 0 31 8 +def @arg23 254 8192 8 Y 0 31 8 +def @arg24 254 8192 8 Y 0 31 8 +def @arg25 254 8192 4 Y 0 31 8 +def @arg26 254 8192 4 Y 0 31 8 +def @arg27 254 8192 10 Y 0 31 8 +def @arg28 254 8192 10 Y 0 31 8 +def @arg29 254 8192 8 Y 0 31 8 +def @arg30 254 8192 8 Y 0 31 8 +def @arg31 254 8192 3 Y 0 31 8 +def @arg32 254 8192 6 Y 128 31 63 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +set @my_key= 0 ; +execute stmt1 using @my_key ; +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 0 Y 128 31 63 +def @arg03 254 20 0 Y 128 31 63 +def @arg04 254 20 0 Y 128 31 63 +def @arg05 254 20 0 Y 128 31 63 +def @arg06 254 20 0 Y 128 31 63 +def @arg07 254 20 0 Y 128 31 63 +def @arg08 254 20 0 Y 128 31 63 +def @arg09 254 20 0 Y 128 31 63 +def @arg10 254 20 0 Y 128 31 63 +def @arg11 254 20 0 Y 128 31 63 +def @arg12 254 20 0 Y 128 31 63 +def @arg13 254 8192 0 Y 128 31 63 +def @arg14 254 8192 0 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 0 Y 128 31 63 +def @arg17 254 20 0 Y 128 31 63 +def @arg18 254 20 0 Y 128 31 63 +def @arg19 254 20 0 Y 128 31 63 +def @arg20 254 8192 0 Y 0 31 8 +def @arg21 254 8192 0 Y 0 31 8 +def @arg22 254 8192 0 Y 0 31 8 +def @arg23 254 8192 0 Y 0 31 8 +def @arg24 254 8192 0 Y 0 31 8 +def @arg25 254 8192 0 Y 0 31 8 +def @arg26 254 8192 0 Y 0 31 8 +def @arg27 254 8192 0 Y 0 31 8 +def @arg28 254 8192 0 Y 0 31 8 +def @arg29 254 8192 0 Y 0 31 8 +def @arg30 254 8192 0 Y 0 31 8 +def @arg31 254 8192 0 Y 0 31 8 +def @arg32 254 8192 0 Y 0 31 8 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +prepare stmt1 from "select c1 into ? from t9 where c1= 1" ; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? from t9 where c1= 1' at line 1 +test_sequence +-- insert into numeric columns -- +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20 ) ; +set @arg00= 21 ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt1 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22 )" ; +execute stmt1 ; +set @arg00= 23; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, +30.0, 30.0, 30.0 ) ; +set @arg00= 31.0 ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt1 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, + 32.0, 32.0, 32.0 )" ; +execute stmt1 ; +set @arg00= 33.0; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( '40', '40', '40', '40', '40', '40', '40', '40', +'40', '40', '40' ) ; +set @arg00= '41' ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt1 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( '42', '42', '42', '42', '42', '42', '42', '42', + '42', '42', '42' )" ; +execute stmt1 ; +set @arg00= '43'; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( CAST('50' as binary), CAST('50' as binary), +CAST('50' as binary), CAST('50' as binary), CAST('50' as binary), +CAST('50' as binary), CAST('50' as binary), CAST('50' as binary), +CAST('50' as binary), CAST('50' as binary), CAST('50' as binary) ) ; +set @arg00= CAST('51' as binary) ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt1 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( CAST('52' as binary), CAST('52' as binary), + CAST('52' as binary), CAST('52' as binary), CAST('52' as binary), + CAST('52' as binary), CAST('52' as binary), CAST('52' as binary), + CAST('52' as binary), CAST('52' as binary), CAST('52' as binary) )" ; +execute stmt1 ; +set @arg00= CAST('53' as binary) ; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +set @arg00= 2 ; +set @arg00= NULL ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( 60, NULL, NULL, NULL, NULL, NULL, NULL, NULL, +NULL, NULL, NULL ) ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( 61, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt1 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 62, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL )" ; +execute stmt1 ; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 63, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +set @arg00= 8.0 ; +set @arg00= NULL ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( 71, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 73, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +set @arg00= 'abc' ; +set @arg00= NULL ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( 81, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 83, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 +from t9 where c1 >= 20 +order by c1 ; +c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c12 +20 20 20 20 20 20 20 20 20 20 20.0000 +21 21 21 21 21 21 21 21 21 21 21.0000 +22 22 22 22 22 22 22 22 22 22 22.0000 +23 23 23 23 23 23 23 23 23 23 23.0000 +30 30 30 30 30 30 30 30 30 30 30.0000 +31 31 31 31 31 31 31 31 31 31 31.0000 +32 32 32 32 32 32 32 32 32 32 32.0000 +33 33 33 33 33 33 33 33 33 33 33.0000 +40 40 40 40 40 40 40 40 40 40 40.0000 +41 41 41 41 41 41 41 41 41 41 41.0000 +42 42 42 42 42 42 42 42 42 42 42.0000 +43 43 43 43 43 43 43 43 43 43 43.0000 +50 50 50 50 50 50 50 50 50 50 50.0000 +51 51 51 51 51 51 51 51 51 51 51.0000 +52 52 52 52 52 52 52 52 52 52 52.0000 +53 53 53 53 53 53 53 53 53 53 53.0000 +60 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +61 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +62 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +63 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +71 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +73 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +81 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +83 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +test_sequence +-- select .. where numeric column = .. -- +set @arg00= 20; +select 'true' as found from t9 +where c1= 20 and c2= 20 and c3= 20 and c4= 20 and c5= 20 and c6= 20 and c7= 20 +and c8= 20 and c9= 20 and c10= 20 and c12= 20; +found +true +select 'true' as found from t9 +where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 +and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 +and c12= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c2= 20 and c3= 20 and c4= 20 and c5= 20 and c6= 20 and c7= 20 + and c8= 20 and c9= 20 and c10= 20 and c12= 20 "; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? + and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? + and c12= ? "; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +found +true +set @arg00= 20.0; +select 'true' as found from t9 +where c1= 20.0 and c2= 20.0 and c3= 20.0 and c4= 20.0 and c5= 20.0 and c6= 20.0 +and c7= 20.0 and c8= 20.0 and c9= 20.0 and c10= 20.0 and c12= 20.0; +found +true +select 'true' as found from t9 +where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 +and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 +and c12= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20.0 and c2= 20.0 and c3= 20.0 and c4= 20.0 and c5= 20.0 and c6= 20.0 + and c7= 20.0 and c8= 20.0 and c9= 20.0 and c10= 20.0 and c12= 20.0 "; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? + and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? + and c12= ? "; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +found +true +select 'true' as found from t9 +where c1= '20' and c2= '20' and c3= '20' and c4= '20' and c5= '20' and c6= '20' + and c7= '20' and c8= '20' and c9= '20' and c10= '20' and c12= '20'; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= '20' and c2= '20' and c3= '20' and c4= '20' and c5= '20' and c6= '20' + and c7= '20' and c8= '20' and c9= '20' and c10= '20' and c12= '20' "; +execute stmt1 ; +found +true +set @arg00= '20'; +select 'true' as found from t9 +where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 +and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 +and c12= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? + and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? + and c12= ? "; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +found +true +select 'true' as found from t9 +where c1= CAST('20' as binary) and c2= CAST('20' as binary) and +c3= CAST('20' as binary) and c4= CAST('20' as binary) and +c5= CAST('20' as binary) and c6= CAST('20' as binary) and +c7= CAST('20' as binary) and c8= CAST('20' as binary) and +c9= CAST('20' as binary) and c10= CAST('20' as binary) and +c12= CAST('20' as binary); +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= CAST('20' as binary) and c2= CAST('20' as binary) and + c3= CAST('20' as binary) and c4= CAST('20' as binary) and + c5= CAST('20' as binary) and c6= CAST('20' as binary) and + c7= CAST('20' as binary) and c8= CAST('20' as binary) and + c9= CAST('20' as binary) and c10= CAST('20' as binary) and + c12= CAST('20' as binary) "; +execute stmt1 ; +found +true +set @arg00= CAST('20' as binary) ; +select 'true' as found from t9 +where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 +and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 +and c12= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? + and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? + and c12= ? "; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +found +true +delete from t9 ; +test_sequence +-- some numeric overflow experiments -- +prepare my_insert from "insert into t9 + ( c21, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 'O', ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +prepare my_select from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 +from t9 where c21 = 'O' "; +prepare my_delete from "delete from t9 where c21 = 'O' "; +set @arg00= 9223372036854775807 ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1264 Data truncated; out of range for column 'c1' at row 1 +Warning 1264 Data truncated; out of range for column 'c2' at row 1 +Warning 1264 Data truncated; out of range for column 'c3' at row 1 +Warning 1264 Data truncated; out of range for column 'c4' at row 1 +Warning 1264 Data truncated; out of range for column 'c5' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 127 +c2 32767 +c3 8388607 +c4 2147483647 +c5 2147483647 +c6 9223372036854775807 +c7 9.22337e+18 +c8 9.22337203685478e+18 +c9 9.22337203685478e+18 +c10 9.22337203685478e+18 +c12 99999.9999 +execute my_delete ; +set @arg00= '9223372036854775807' ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1264 Data truncated; out of range for column 'c1' at row 1 +Warning 1264 Data truncated; out of range for column 'c2' at row 1 +Warning 1264 Data truncated; out of range for column 'c3' at row 1 +Warning 1265 Data truncated for column 'c4' at row 1 +Warning 1265 Data truncated for column 'c5' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 127 +c2 32767 +c3 8388607 +c4 2147483647 +c5 2147483647 +c6 9223372036854775807 +c7 9.22337e+18 +c8 9.22337203685478e+18 +c9 9.22337203685478e+18 +c10 9.22337203685478e+18 +c12 99999.9999 +execute my_delete ; +set @arg00= -9223372036854775808 ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1264 Data truncated; out of range for column 'c1' at row 1 +Warning 1264 Data truncated; out of range for column 'c2' at row 1 +Warning 1264 Data truncated; out of range for column 'c3' at row 1 +Warning 1264 Data truncated; out of range for column 'c4' at row 1 +Warning 1264 Data truncated; out of range for column 'c5' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 -128 +c2 -32768 +c3 -8388608 +c4 -2147483648 +c5 -2147483648 +c6 -9223372036854775808 +c7 -9.22337e+18 +c8 -9.22337203685478e+18 +c9 -9.22337203685478e+18 +c10 -9.22337203685478e+18 +c12 -9999.9999 +execute my_delete ; +set @arg00= '-9223372036854775808' ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1264 Data truncated; out of range for column 'c1' at row 1 +Warning 1264 Data truncated; out of range for column 'c2' at row 1 +Warning 1264 Data truncated; out of range for column 'c3' at row 1 +Warning 1265 Data truncated for column 'c4' at row 1 +Warning 1265 Data truncated for column 'c5' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 -128 +c2 -32768 +c3 -8388608 +c4 -2147483648 +c5 -2147483648 +c6 -9223372036854775808 +c7 -9.22337e+18 +c8 -9.22337203685478e+18 +c9 -9.22337203685478e+18 +c10 -9.22337203685478e+18 +c12 -9999.9999 +execute my_delete ; +set @arg00= 1.11111111111111111111e+50 ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1264 Data truncated; out of range for column 'c1' at row 1 +Warning 1264 Data truncated; out of range for column 'c2' at row 1 +Warning 1264 Data truncated; out of range for column 'c3' at row 1 +Warning 1264 Data truncated; out of range for column 'c4' at row 1 +Warning 1264 Data truncated; out of range for column 'c5' at row 1 +Warning 1264 Data truncated; out of range for column 'c6' at row 1 +Warning 1264 Data truncated; out of range for column 'c7' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 127 +c2 32767 +c3 8388607 +c4 2147483647 +c5 2147483647 +c6 9223372036854775807 +c7 3.40282e+38 +c8 1.11111111111111e+50 +c9 1.11111111111111e+50 +c10 1.11111111111111e+50 +c12 99999.9999 +execute my_delete ; +set @arg00= '1.11111111111111111111e+50' ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1265 Data truncated for column 'c1' at row 1 +Warning 1265 Data truncated for column 'c2' at row 1 +Warning 1265 Data truncated for column 'c3' at row 1 +Warning 1265 Data truncated for column 'c4' at row 1 +Warning 1265 Data truncated for column 'c5' at row 1 +Warning 1265 Data truncated for column 'c6' at row 1 +Warning 1264 Data truncated; out of range for column 'c7' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 1 +c2 1 +c3 1 +c4 1 +c5 1 +c6 1 +c7 3.40282e+38 +c8 1.11111111111111e+50 +c9 1.11111111111111e+50 +c10 1.11111111111111e+50 +c12 99999.9999 +execute my_delete ; +set @arg00= -1.11111111111111111111e+50 ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1264 Data truncated; out of range for column 'c1' at row 1 +Warning 1264 Data truncated; out of range for column 'c2' at row 1 +Warning 1264 Data truncated; out of range for column 'c3' at row 1 +Warning 1264 Data truncated; out of range for column 'c4' at row 1 +Warning 1264 Data truncated; out of range for column 'c5' at row 1 +Warning 1264 Data truncated; out of range for column 'c6' at row 1 +Warning 1264 Data truncated; out of range for column 'c7' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 -128 +c2 -32768 +c3 -8388608 +c4 -2147483648 +c5 -2147483648 +c6 -9223372036854775808 +c7 -3.40282e+38 +c8 -1.11111111111111e+50 +c9 -1.11111111111111e+50 +c10 -1.11111111111111e+50 +c12 -9999.9999 +execute my_delete ; +set @arg00= '-1.11111111111111111111e+50' ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1265 Data truncated for column 'c1' at row 1 +Warning 1265 Data truncated for column 'c2' at row 1 +Warning 1265 Data truncated for column 'c3' at row 1 +Warning 1265 Data truncated for column 'c4' at row 1 +Warning 1265 Data truncated for column 'c5' at row 1 +Warning 1265 Data truncated for column 'c6' at row 1 +Warning 1264 Data truncated; out of range for column 'c7' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 -1 +c2 -1 +c3 -1 +c4 -1 +c5 -1 +c6 -1 +c7 -3.40282e+38 +c8 -1.11111111111111e+50 +c9 -1.11111111111111e+50 +c10 -1.11111111111111e+50 +c12 -9999.9999 +execute my_delete ; +test_sequence +-- insert into string columns -- +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +select c1, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30 +from t9 where c1 >= 20 +order by c1 ; +c1 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 +20 2 20 20 20 20 20 20 20 20 20 20 +21 2 21 21 21 21 21 21 21 21 21 21 +22 2 22 22 22 22 22 22 22 22 22 22 +23 2 23 23 23 23 23 23 23 23 23 23 +30 3 30 30 30 30 30 30 30 30 30 30 +31 3 31 31 31 31 31 31 31 31 31 31 +32 3 32 32 32 32 32 32 32 32 32 32 +33 3 33 33 33 33 33 33 33 33 33 33 +40 4 40 40 40 40 40 40 40 40 40 40 +41 4 41 41 41 41 41 41 41 41 41 41 +42 4 42 42 42 42 42 42 42 42 42 42 +43 4 43 43 43 43 43 43 43 43 43 43 +50 5 50 50 50 50 50 50 50 50 50 50 +51 5 51 51 51 51 51 51 51 51 51 51 +52 5 52 52 52 52 52 52 52 52 52 52 +53 5 53 53 53 53 53 53 53 53 53 53 +54 5 54 54 54 54 54 54 54 54 54 54 +55 5 55 55 55 55 55 55 55 55 55 55 +56 6 56 56 56 56 56 56 56 56 56 56 +57 6 57 57 57 57 57 57 57 57 57 57 +60 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +61 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +62 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +63 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +71 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +73 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +81 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +83 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +test_sequence +-- select .. where string column = .. -- +set @arg00= '20'; +select 'true' as found from t9 +where c1= 20 and concat(c20,substr('20',1+length(c20)))= '20' and c21= '20' and +c22= '20' and c23= '20' and c24= '20' and c25= '20' and c26= '20' and +c27= '20' and c28= '20' and c29= '20' and c30= '20' ; +found +true +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and +c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and +c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr('20',1+length(c20)))= '20' and c21= '20' and + c22= '20' and c23= '20' and c24= '20' and c25= '20' and c26= '20' and + c27= '20' and c28= '20' and c29= '20' and c30= '20'" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and + c21= ? and c22= ? and c23= ? and c25= ? and + c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +found +true +set @arg00= CAST('20' as binary); +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(CAST('20' as binary),1+length(c20))) += CAST('20' as binary) and c21= CAST('20' as binary) +and c22= CAST('20' as binary) and c23= CAST('20' as binary) and +c24= CAST('20' as binary) and c25= CAST('20' as binary) and +c26= CAST('20' as binary) and c27= CAST('20' as binary) and +c28= CAST('20' as binary) and c29= CAST('20' as binary) and +c30= CAST('20' as binary) ; +found +true +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(@arg00,1+length(c20))) = @arg00 and +c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and +c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and +c30= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(CAST('20' as binary),1+length(c20))) + = CAST('20' as binary) and c21= CAST('20' as binary) + and c22= CAST('20' as binary) and c23= CAST('20' as binary) and + c24= CAST('20' as binary) and c25= CAST('20' as binary) and + c26= CAST('20' as binary) and c27= CAST('20' as binary) and + c28= CAST('20' as binary) and c29= CAST('20' as binary) and + c30= CAST('20' as binary)" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(?,1+length(c20))) = ? and c21= ? and + c22= ? and c23= ? and c25= ? and c26= ? and c27= ? and c28= ? and + c29= ? and c30= ?"; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +found +true +set @arg00= 20; +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(20,1+length(c20)))= 20 and c21= 20 and +c22= 20 and c23= 20 and c24= 20 and c25= 20 and c26= 20 and +c27= 20 and c28= 20 and c29= 20 and c30= 20 ; +found +true +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and +c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and +c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(20,1+length(c20)))= 20 and c21= 20 and + c22= 20 and c23= 20 and c24= 20 and c25= 20 and c26= 20 and + c27= 20 and c28= 20 and c29= 20 and c30= 20" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and + c21= ? and c22= ? and c23= ? and c25= ? and + c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +found +true +set @arg00= 20.0; +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(20.0,1+length(c20)))= 20.0 and c21= 20.0 and +c22= 20.0 and c23= 20.0 and c24= 20.0 and c25= 20.0 and c26= 20.0 and +c27= 20.0 and c28= 20.0 and c29= 20.0 and c30= 20.0 ; +found +true +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and +c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and +c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(20.0,1+length(c20)))= 20.0 and c21= 20.0 and + c22= 20.0 and c23= 20.0 and c24= 20.0 and c25= 20.0 and c26= 20.0 and + c27= 20.0 and c28= 20.0 and c29= 20.0 and c30= 20.0" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and + c21= ? and c22= ? and c23= ? and c25= ? and + c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +found +true +delete from t9 ; +test_sequence +-- insert into date/time columns -- +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1264 Data truncated; out of range for column 'c13' at row 1 +Warning 1265 Data truncated for column 'c14' at row 1 +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1264 Data truncated; out of range for column 'c13' at row 1 +Warning 1265 Data truncated for column 'c14' at row 1 +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1264 Data truncated; out of range for column 'c13' at row 1 +Warning 1265 Data truncated for column 'c14' at row 1 +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1264 Data truncated; out of range for column 'c13' at row 1 +Warning 1265 Data truncated for column 'c14' at row 1 +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +select c1, c13, c14, c15, c16, c17 from t9 order by c1 ; +c1 c13 c14 c15 c16 c17 +20 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +21 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +22 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +23 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +30 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +31 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +32 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +33 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +40 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +41 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +42 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +43 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +50 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +51 0010-00-00 0010-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +52 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +53 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +60 NULL NULL 1991-01-01 01:01:01 NULL NULL +61 NULL NULL 1991-01-01 01:01:01 NULL NULL +62 NULL NULL 1991-01-01 01:01:01 NULL NULL +63 NULL NULL 1991-01-01 01:01:01 NULL NULL +71 NULL NULL 1991-01-01 01:01:01 NULL NULL +73 NULL NULL 1991-01-01 01:01:01 NULL NULL +81 NULL NULL 1991-01-01 01:01:01 NULL NULL +83 NULL NULL 1991-01-01 01:01:01 NULL NULL +test_sequence +-- select .. where date/time column = .. -- +set @arg00= '1991-01-01 01:01:01' ; +select 'true' as found from t9 +where c1= 20 and c13= '1991-01-01 01:01:01' and c14= '1991-01-01 01:01:01' and +c15= '1991-01-01 01:01:01' and c16= '1991-01-01 01:01:01' and +c17= '1991-01-01 01:01:01' ; +found +true +select 'true' as found from t9 +where c1= 20 and c13= @arg00 and c14= @arg00 and c15= @arg00 and c16= @arg00 +and c17= @arg00 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c13= '1991-01-01 01:01:01' and c14= '1991-01-01 01:01:01' and + c15= '1991-01-01 01:01:01' and c16= '1991-01-01 01:01:01' and + c17= '1991-01-01 01:01:01'" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c13= ? and c14= ? and c15= ? and c16= ? and c17= ?" ; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00 ; +found +true +set @arg00= CAST('1991-01-01 01:01:01' as datetime) ; +select 'true' as found from t9 +where c1= 20 and c13= CAST('1991-01-01 01:01:01' as datetime) and +c14= CAST('1991-01-01 01:01:01' as datetime) and +c15= CAST('1991-01-01 01:01:01' as datetime) and +c16= CAST('1991-01-01 01:01:01' as datetime) and +c17= CAST('1991-01-01 01:01:01' as datetime) ; +found +true +select 'true' as found from t9 +where c1= 20 and c13= @arg00 and c14= @arg00 and c15= @arg00 and c16= @arg00 +and c17= @arg00 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c13= CAST('1991-01-01 01:01:01' as datetime) and + c14= CAST('1991-01-01 01:01:01' as datetime) and + c15= CAST('1991-01-01 01:01:01' as datetime) and + c16= CAST('1991-01-01 01:01:01' as datetime) and + c17= CAST('1991-01-01 01:01:01' as datetime)" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c13= ? and c14= ? and c15= ? and c16= ? and c17= ?" ; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00 ; +found +true +set @arg00= 1991 ; +select 'true' as found from t9 +where c1= 20 and c17= 1991 ; +found +true +select 'true' as found from t9 +where c1= 20 and c17= @arg00 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c17= 1991" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c17= ?" ; +execute stmt1 using @arg00 ; +found +true +set @arg00= 1.991e+3 ; +select 'true' as found from t9 +where c1= 20 and abs(c17 - 1.991e+3) < 0.01 ; +found +true +select 'true' as found from t9 +where c1= 20 and abs(c17 - @arg00) < 0.01 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and abs(c17 - 1.991e+3) < 0.01" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and abs(c17 - ?) < 0.01" ; +execute stmt1 using @arg00 ; +found +true +drop table t1, t9; diff --git a/mysql-test/r/ps_5merge.result.es b/mysql-test/r/ps_5merge.result.es new file mode 100644 index 00000000000..4f05be1b4d9 --- /dev/null +++ b/mysql-test/r/ps_5merge.result.es @@ -0,0 +1,6064 @@ +use test; +drop table if exists t1, t1_1, t1_2, +t9, t9_1, t9_2; +drop table if exists t1, t9 ; +create table t1 +( +a int, b varchar(30), +primary key(a) +) engine = 'MYISAM' ; +create table t9 +( +c1 tinyint, c2 smallint, c3 mediumint, c4 int, +c5 integer, c6 bigint, c7 float, c8 double, +c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4), +c13 date, c14 datetime, c15 timestamp(14), c16 time, +c17 year, c18 bit, c19 bool, c20 char, +c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext, +c25 blob, c26 text, c27 mediumblob, c28 mediumtext, +c29 longblob, c30 longtext, c31 enum('one', 'two', 'three'), +c32 set('monday', 'tuesday', 'wednesday'), +primary key(c1) +) engine = 'MYISAM' ; +rename table t1 to t1_1, t9 to t9_1 ; +drop table if exists t1, t9 ; +create table t1 +( +a int, b varchar(30), +primary key(a) +) engine = 'MYISAM' ; +create table t9 +( +c1 tinyint, c2 smallint, c3 mediumint, c4 int, +c5 integer, c6 bigint, c7 float, c8 double, +c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4), +c13 date, c14 datetime, c15 timestamp(14), c16 time, +c17 year, c18 bit, c19 bool, c20 char, +c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext, +c25 blob, c26 text, c27 mediumblob, c28 mediumtext, +c29 longblob, c30 longtext, c31 enum('one', 'two', 'three'), +c32 set('monday', 'tuesday', 'wednesday'), +primary key(c1) +) engine = 'MYISAM' ; +rename table t1 to t1_2, t9 to t9_2 ; +create table t1 +( +a int, b varchar(30), +primary key(a) +) ENGINE = MERGE UNION=(t1_1,t1_2) +INSERT_METHOD=FIRST; +create table t9 +( +c1 tinyint, c2 smallint, c3 mediumint, c4 int, +c5 integer, c6 bigint, c7 float, c8 double, +c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4), +c13 date, c14 datetime, c15 timestamp(14), c16 time, +c17 year, c18 bit, c19 bool, c20 char, +c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext, +c25 blob, c26 text, c27 mediumblob, c28 mediumtext, +c29 longblob, c30 longtext, c31 enum('one', 'two', 'three'), +c32 set('monday', 'tuesday', 'wednesday'), +primary key(c1) +) ENGINE = MERGE UNION=(t9_1,t9_2) +INSERT_METHOD=FIRST; +delete from t1 ; +insert into t1 values (1,'one'); +insert into t1 values (2,'two'); +insert into t1 values (3,'three'); +insert into t1 values (4,'four'); +commit ; +delete from t9 ; +insert into t9 +set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, +c10= 1, c11= 1, c12 = 1, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=true, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; +insert into t9 +set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, +c10= 9, c11= 9, c12 = 9, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=false, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +commit ; +test_sequence +------ simple select tests ------ +prepare stmt1 from ' select * from t9 order by c1 ' ; +execute stmt1; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def test t9 t9 c1 c1 1 4 1 N 49155 0 63 +def test t9 t9 c2 c2 2 6 1 Y 32768 0 63 +def test t9 t9 c3 c3 9 9 1 Y 32768 0 63 +def test t9 t9 c4 c4 3 11 1 Y 32768 0 63 +def test t9 t9 c5 c5 3 11 1 Y 32768 0 63 +def test t9 t9 c6 c6 8 20 1 Y 32768 0 63 +def test t9 t9 c7 c7 4 12 1 Y 32768 31 63 +def test t9 t9 c8 c8 5 22 1 Y 32768 31 63 +def test t9 t9 c9 c9 5 22 1 Y 32768 31 63 +def test t9 t9 c10 c10 5 22 1 Y 32768 31 63 +def test t9 t9 c11 c11 0 9 6 Y 32768 4 63 +def test t9 t9 c12 c12 0 10 6 Y 32768 4 63 +def test t9 t9 c13 c13 10 10 10 Y 128 0 63 +def test t9 t9 c14 c14 12 19 19 Y 128 0 63 +def test t9 t9 c15 c15 7 19 19 N 1249 0 63 +def test t9 t9 c16 c16 11 8 8 Y 128 0 63 +def test t9 t9 c17 c17 13 4 4 Y 32864 0 63 +def test t9 t9 c18 c18 1 1 1 Y 32768 0 63 +def test t9 t9 c19 c19 1 1 1 Y 32768 0 63 +def test t9 t9 c20 c20 254 1 1 Y 0 0 8 +def test t9 t9 c21 c21 253 10 10 Y 0 0 8 +def test t9 t9 c22 c22 253 30 30 Y 0 0 8 +def test t9 t9 c23 c23 252 255 8 Y 144 0 63 +def test t9 t9 c24 c24 252 255 8 Y 16 0 8 +def test t9 t9 c25 c25 252 65535 4 Y 144 0 63 +def test t9 t9 c26 c26 252 65535 4 Y 16 0 8 +def test t9 t9 c27 c27 252 16777215 10 Y 144 0 63 +def test t9 t9 c28 c28 252 16777215 10 Y 16 0 8 +def test t9 t9 c29 c29 252 16777215 8 Y 144 0 63 +def test t9 t9 c30 c30 252 16777215 8 Y 16 0 8 +def test t9 t9 c31 c31 254 5 3 Y 256 0 8 +def test t9 t9 c32 c32 254 24 7 Y 2048 0 8 +c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32 +1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday +set @arg00='SELECT' ; +prepare stmt1 from ' ? a from t1 where a=1 '; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? a from t1 where a=1' at line 1 +set @arg00=1 ; +select @arg00, b from t1 where a=1 ; +@arg00 b +1 one +prepare stmt1 from ' select ?, b from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +? b +1 one +set @arg00='lion' ; +select @arg00, b from t1 where a=1 ; +@arg00 b +lion one +prepare stmt1 from ' select ?, b from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +? b +lion one +set @arg00=NULL ; +select @arg00, b from t1 where a=1 ; +@arg00 b +NULL one +prepare stmt1 from ' select ?, b from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +? b +NULL one +set @arg00=1 ; +select b, a - @arg00 from t1 where a=1 ; +b a - @arg00 +one 0 +prepare stmt1 from ' select b, a - ? from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +b a - ? +one 0 +set @arg00=null ; +select @arg00 as my_col ; +my_col +NULL +prepare stmt1 from ' select ? as my_col'; +execute stmt1 using @arg00 ; +my_col +NULL +select @arg00 + 1 as my_col ; +my_col +NULL +prepare stmt1 from ' select ? + 1 as my_col'; +execute stmt1 using @arg00 ; +my_col +NULL +select 1 + @arg00 as my_col ; +my_col +NULL +prepare stmt1 from ' select 1 + ? as my_col'; +execute stmt1 using @arg00 ; +my_col +NULL +set @arg00='MySQL' ; +select substr(@arg00,1,2) from t1 where a=1 ; +substr(@arg00,1,2) +My +prepare stmt1 from ' select substr(?,1,2) from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +substr(?,1,2) +My +set @arg00=3 ; +select substr('MySQL',@arg00,5) from t1 where a=1 ; +substr('MySQL',@arg00,5) +SQL +prepare stmt1 from ' select substr(''MySQL'',?,5) from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +substr('MySQL',?,5) +SQL +select substr('MySQL',1,@arg00) from t1 where a=1 ; +substr('MySQL',1,@arg00) +MyS +prepare stmt1 from ' select substr(''MySQL'',1,?) from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +substr('MySQL',1,?) +MyS +set @arg00='MySQL' ; +select a , concat(@arg00,b) from t1 order by a; +a concat(@arg00,b) +1 MySQLone +2 MySQLtwo +3 MySQLthree +4 MySQLfour +prepare stmt1 from ' select a , concat(?,b) from t1 order by a ' ; +execute stmt1 using @arg00; +a concat(?,b) +1 MySQLone +2 MySQLtwo +3 MySQLthree +4 MySQLfour +select a , concat(b,@arg00) from t1 order by a ; +a concat(b,@arg00) +1 oneMySQL +2 twoMySQL +3 threeMySQL +4 fourMySQL +prepare stmt1 from ' select a , concat(b,?) from t1 order by a ' ; +execute stmt1 using @arg00; +a concat(b,?) +1 oneMySQL +2 twoMySQL +3 threeMySQL +4 fourMySQL +set @arg00='MySQL' ; +select group_concat(@arg00,b order by a) from t1 +group by 'a' ; +group_concat(@arg00,b order by a) +MySQLone,MySQLtwo,MySQLthree,MySQLfour +prepare stmt1 from ' select group_concat(?,b order by a) from t1 +group by ''a'' ' ; +execute stmt1 using @arg00; +group_concat(?,b order by a) +MySQLone,MySQLtwo,MySQLthree,MySQLfour +select group_concat(b,@arg00 order by a) from t1 +group by 'a' ; +group_concat(b,@arg00 order by a) +oneMySQL,twoMySQL,threeMySQL,fourMySQL +prepare stmt1 from ' select group_concat(b,? order by a) from t1 +group by ''a'' ' ; +execute stmt1 using @arg00; +group_concat(b,? order by a) +oneMySQL,twoMySQL,threeMySQL,fourMySQL +set @arg00='first' ; +set @arg01='second' ; +set @arg02=NULL; +select @arg00, @arg01 from t1 where a=1 ; +@arg00 @arg01 +first second +prepare stmt1 from ' select ?, ? from t1 where a=1 ' ; +execute stmt1 using @arg00, @arg01 ; +? ? +first second +execute stmt1 using @arg02, @arg01 ; +? ? +NULL second +execute stmt1 using @arg00, @arg02 ; +? ? +first NULL +execute stmt1 using @arg02, @arg02 ; +? ? +NULL NULL +drop table if exists t5 ; +create table t5 (id1 int(11) not null default '0', +value2 varchar(100), value1 varchar(100)) ; +insert into t5 values (1,'hh','hh'),(2,'hh','hh'), +(1,'ii','ii'),(2,'ii','ii') ; +prepare stmt1 from ' select id1,value1 from t5 where id1=? or value1=? order by id1,value1 ' ; +set @arg00=1 ; +set @arg01='hh' ; +execute stmt1 using @arg00, @arg01 ; +id1 value1 +1 hh +1 ii +2 hh +drop table t5 ; +drop table if exists t5 ; +create table t5(session_id char(9) not null) ; +insert into t5 values ('abc') ; +prepare stmt1 from ' select * from t5 +where ?=''1111'' and session_id = ''abc'' ' ; +set @arg00='abc' ; +execute stmt1 using @arg00 ; +session_id +set @arg00='1111' ; +execute stmt1 using @arg00 ; +session_id +abc +set @arg00='abc' ; +execute stmt1 using @arg00 ; +session_id +drop table t5 ; +set @arg00='FROM' ; +select a @arg00 t1 where a=1 ; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 t1 where a=1' at line 1 +prepare stmt1 from ' select a ? t1 where a=1 ' ; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? t1 where a=1' at line 1 +set @arg00='t1' ; +select a from @arg00 where a=1 ; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 where a=1' at line 1 +prepare stmt1 from ' select a from ? where a=1 ' ; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? where a=1' at line 1 +set @arg00='WHERE' ; +select a from t1 @arg00 a=1 ; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 a=1' at line 1 +prepare stmt1 from ' select a from t1 ? a=1 ' ; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? a=1' at line 1 +set @arg00=1 ; +select a FROM t1 where a=@arg00 ; +a +1 +prepare stmt1 from ' select a FROM t1 where a=? ' ; +execute stmt1 using @arg00 ; +a +1 +set @arg00=1000 ; +execute stmt1 using @arg00 ; +a +set @arg00=NULL ; +select a FROM t1 where a=@arg00 ; +a +prepare stmt1 from ' select a FROM t1 where a=? ' ; +execute stmt1 using @arg00 ; +a +set @arg00=4 ; +select a FROM t1 where a=sqrt(@arg00) ; +a +2 +prepare stmt1 from ' select a FROM t1 where a=sqrt(?) ' ; +execute stmt1 using @arg00 ; +a +2 +set @arg00=NULL ; +select a FROM t1 where a=sqrt(@arg00) ; +a +prepare stmt1 from ' select a FROM t1 where a=sqrt(?) ' ; +execute stmt1 using @arg00 ; +a +set @arg00=2 ; +set @arg01=3 ; +select a FROM t1 where a in (@arg00,@arg01) order by a; +a +2 +3 +prepare stmt1 from ' select a FROM t1 where a in (?,?) order by a '; +execute stmt1 using @arg00, @arg01; +a +2 +3 +set @arg00= 'one' ; +set @arg01= 'two' ; +set @arg02= 'five' ; +prepare stmt1 from ' select b FROM t1 where b in (?,?,?) order by b ' ; +execute stmt1 using @arg00, @arg01, @arg02 ; +b +one +two +prepare stmt1 from ' select b FROM t1 where b like ? '; +set @arg00='two' ; +execute stmt1 using @arg00 ; +b +two +set @arg00='tw%' ; +execute stmt1 using @arg00 ; +b +two +set @arg00='%wo' ; +execute stmt1 using @arg00 ; +b +two +set @arg00=null ; +insert into t9 set c1= 0, c5 = NULL ; +select c5 from t9 where c5 > NULL ; +c5 +prepare stmt1 from ' select c5 from t9 where c5 > ? '; +execute stmt1 using @arg00 ; +c5 +select c5 from t9 where c5 < NULL ; +c5 +prepare stmt1 from ' select c5 from t9 where c5 < ? '; +execute stmt1 using @arg00 ; +c5 +select c5 from t9 where c5 = NULL ; +c5 +prepare stmt1 from ' select c5 from t9 where c5 = ? '; +execute stmt1 using @arg00 ; +c5 +select c5 from t9 where c5 <=> NULL ; +c5 +NULL +prepare stmt1 from ' select c5 from t9 where c5 <=> ? '; +execute stmt1 using @arg00 ; +c5 +NULL +delete from t9 where c1= 0 ; +set @arg00='>' ; +select a FROM t1 where a @arg00 1 ; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 1' at line 1 +prepare stmt1 from ' select a FROM t1 where a ? 1 ' ; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? 1' at line 1 +set @arg00=1 ; +select a,b FROM t1 where a is not NULL +AND b is not NULL group by a - @arg00 ; +a b +1 one +2 two +3 three +4 four +prepare stmt1 from ' select a,b FROM t1 where a is not NULL +AND b is not NULL group by a - ? ' ; +execute stmt1 using @arg00 ; +a b +1 one +2 two +3 three +4 four +set @arg00='two' ; +select a,b FROM t1 where a is not NULL +AND b is not NULL having b <> @arg00 order by a ; +a b +1 one +3 three +4 four +prepare stmt1 from ' select a,b FROM t1 where a is not NULL +AND b is not NULL having b <> ? order by a ' ; +execute stmt1 using @arg00 ; +a b +1 one +3 three +4 four +set @arg00=1 ; +select a,b FROM t1 where a is not NULL +AND b is not NULL order by a - @arg00 ; +a b +1 one +2 two +3 three +4 four +prepare stmt1 from ' select a,b FROM t1 where a is not NULL +AND b is not NULL order by a - ? ' ; +execute stmt1 using @arg00 ; +a b +1 one +2 two +3 three +4 four +set @arg00=2 ; +select a,b from t1 order by 2 ; +a b +4 four +1 one +3 three +2 two +prepare stmt1 from ' select a,b from t1 +order by ? '; +execute stmt1 using @arg00; +a b +4 four +1 one +3 three +2 two +set @arg00=1 ; +execute stmt1 using @arg00; +a b +1 one +2 two +3 three +4 four +set @arg00=0 ; +execute stmt1 using @arg00; +ERROR 42S22: Unknown column '?' in 'order clause' +set @arg00=1; +prepare stmt1 from ' select a,b from t1 order by a +limit 1 '; +execute stmt1 ; +a b +1 one +prepare stmt1 from ' select a,b from t1 +limit ? '; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?' at line 2 +set @arg00='b' ; +set @arg01=0 ; +set @arg02=2 ; +set @arg03=2 ; +select sum(a), @arg00 from t1 where a > @arg01 +and b is not null group by substr(b,@arg02) +having sum(a) <> @arg03 ; +sum(a) @arg00 +3 b +1 b +4 b +prepare stmt1 from ' select sum(a), ? from t1 where a > ? +and b is not null group by substr(b,?) +having sum(a) <> ? '; +execute stmt1 using @arg00, @arg01, @arg02, @arg03; +sum(a) ? +3 b +1 b +4 b +test_sequence +------ join tests ------ +select first.a as a1, second.a as a2 +from t1 first, t1 second +where first.a = second.a order by a1 ; +a1 a2 +1 1 +2 2 +3 3 +4 4 +prepare stmt1 from ' select first.a as a1, second.a as a2 + from t1 first, t1 second + where first.a = second.a order by a1 '; +execute stmt1 ; +a1 a2 +1 1 +2 2 +3 3 +4 4 +set @arg00='ABC'; +set @arg01='two'; +set @arg02='one'; +select first.a, @arg00, second.a FROM t1 first, t1 second +where @arg01 = first.b or first.a = second.a or second.b = @arg02 +order by second.a, first.a; +a @arg00 a +1 ABC 1 +2 ABC 1 +3 ABC 1 +4 ABC 1 +2 ABC 2 +2 ABC 3 +3 ABC 3 +2 ABC 4 +4 ABC 4 +prepare stmt1 from ' select first.a, ?, second.a FROM t1 first, t1 second + where ? = first.b or first.a = second.a or second.b = ? + order by second.a, first.a'; +execute stmt1 using @arg00, @arg01, @arg02; +a ? a +1 ABC 1 +2 ABC 1 +3 ABC 1 +4 ABC 1 +2 ABC 2 +2 ABC 3 +3 ABC 3 +2 ABC 4 +4 ABC 4 +drop table if exists t2 ; +create table t2 as select * from t1 ; +set @query1= 'SELECT * FROM t2 join t1 on (t1.a=t2.a) order by t2.a ' ; +set @query2= 'SELECT * FROM t2 natural join t1 order by t2.a ' ; +set @query3= 'SELECT * FROM t2 join t1 using(a) order by t2.a ' ; +set @query4= 'SELECT * FROM t2 left join t1 on(t1.a=t2.a) order by t2.a ' ; +set @query5= 'SELECT * FROM t2 natural left join t1 order by t2.a ' ; +set @query6= 'SELECT * FROM t2 left join t1 using(a) order by t2.a ' ; +set @query7= 'SELECT * FROM t2 right join t1 on(t1.a=t2.a) order by t2.a ' ; +set @query8= 'SELECT * FROM t2 natural right join t1 order by t2.a ' ; +set @query9= 'SELECT * FROM t2 right join t1 using(a) order by t2.a ' ; +the join statement is: +SELECT * FROM t2 right join t1 using(a) order by t2.a +prepare stmt1 from @query9 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +the join statement is: +SELECT * FROM t2 natural right join t1 order by t2.a +prepare stmt1 from @query8 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +the join statement is: +SELECT * FROM t2 right join t1 on(t1.a=t2.a) order by t2.a +prepare stmt1 from @query7 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +the join statement is: +SELECT * FROM t2 left join t1 using(a) order by t2.a +prepare stmt1 from @query6 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +the join statement is: +SELECT * FROM t2 natural left join t1 order by t2.a +prepare stmt1 from @query5 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +the join statement is: +SELECT * FROM t2 left join t1 on(t1.a=t2.a) order by t2.a +prepare stmt1 from @query4 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +the join statement is: +SELECT * FROM t2 join t1 using(a) order by t2.a +prepare stmt1 from @query3 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +the join statement is: +SELECT * FROM t2 natural join t1 order by t2.a +prepare stmt1 from @query2 ; +execute stmt1 ; +a b +1 one +2 two +3 three +4 four +execute stmt1 ; +a b +1 one +2 two +3 three +4 four +execute stmt1 ; +a b +1 one +2 two +3 three +4 four +the join statement is: +SELECT * FROM t2 join t1 on (t1.a=t2.a) order by t2.a +prepare stmt1 from @query1 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +drop table t2 ; +test_sequence +------ subquery tests ------ +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where b = ''two'') '; +execute stmt1 ; +a b +2 two +set @arg00='two' ; +select a, b FROM t1 outer_table where +a = (select a from t1 where b = 'two' ) and b=@arg00 ; +a b +2 two +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where b = ''two'') and b=? '; +execute stmt1 using @arg00; +a b +2 two +set @arg00='two' ; +select a, b FROM t1 outer_table where +a = (select a from t1 where b = @arg00 ) and b='two' ; +a b +2 two +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where b = ? ) and b=''two'' ' ; +execute stmt1 using @arg00; +a b +2 two +set @arg00=3 ; +set @arg01='three' ; +select a,b FROM t1 where (a,b) in (select 3, 'three'); +a b +3 three +select a FROM t1 where (a,b) in (select @arg00,@arg01); +a +3 +prepare stmt1 from ' select a FROM t1 where (a,b) in (select ?, ?) '; +execute stmt1 using @arg00, @arg01; +a +3 +set @arg00=1 ; +set @arg01='two' ; +set @arg02=2 ; +set @arg03='two' ; +select a, @arg00, b FROM t1 outer_table where +b=@arg01 and a = (select @arg02 from t1 where b = @arg03 ) ; +a @arg00 b +2 1 two +prepare stmt1 from ' select a, ?, b FROM t1 outer_table where + b=? and a = (select ? from t1 where b = ? ) ' ; +execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; +a ? b +2 1 two +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where b = outer_table.b ) order by a '; +execute stmt1 ; +a b +1 one +2 two +3 three +4 four +prepare stmt1 from ' SELECT a as ccc from t1 where a+1= + (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) '; +execute stmt1 ; +ccc +1 +deallocate prepare stmt1 ; +prepare stmt1 from ' SELECT a as ccc from t1 where a+1= + (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) '; +execute stmt1 ; +ccc +1 +deallocate prepare stmt1 ; +prepare stmt1 from ' SELECT a as ccc from t1 where a+1= + (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) '; +execute stmt1 ; +ccc +1 +deallocate prepare stmt1 ; +set @arg00='two' ; +select a, b FROM t1 outer_table where +a = (select a from t1 where b = outer_table.b ) and b=@arg00 ; +a b +2 two +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where b = outer_table.b) and b=? '; +execute stmt1 using @arg00; +a b +2 two +set @arg00=2 ; +select a, b FROM t1 outer_table where +a = (select a from t1 where a = @arg00 and b = outer_table.b) and b='two' ; +a b +2 two +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where a = ? and b = outer_table.b) and b=''two'' ' ; +execute stmt1 using @arg00; +a b +2 two +set @arg00=2 ; +select a, b FROM t1 outer_table where +a = (select a from t1 where outer_table.a = @arg00 and a=2) and b='two' ; +a b +2 two +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where outer_table.a = ? and a=2) and b=''two'' ' ; +execute stmt1 using @arg00; +a b +2 two +set @arg00=1 ; +set @arg01='two' ; +set @arg02=2 ; +set @arg03='two' ; +select a, @arg00, b FROM t1 outer_table where +b=@arg01 and a = (select @arg02 from t1 where outer_table.b = @arg03 +and outer_table.a=a ) ; +a @arg00 b +2 1 two +prepare stmt1 from ' select a, ?, b FROM t1 outer_table where + b=? and a = (select ? from t1 where outer_table.b = ? + and outer_table.a=a ) ' ; +execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; +a ? b +2 1 two +set @arg00=1 ; +set @arg01=0 ; +select a, @arg00 +from ( select a - @arg00 as a from t1 where a=@arg00 ) as t2 +where a=@arg01; +a @arg00 +0 1 +prepare stmt1 from ' select a, ? + from ( select a - ? as a from t1 where a=? ) as t2 + where a=? '; +execute stmt1 using @arg00, @arg00, @arg00, @arg01 ; +a ? +0 1 +drop table if exists t2 ; +create table t2 as select * from t1; +prepare stmt1 from ' select a in (select a from t2) from t1 ' ; +execute stmt1 ; +a in (select a from t2) +1 +1 +1 +1 +drop table if exists t5, t6, t7 ; +create table t5 (a int , b int) ; +create table t6 like t5 ; +create table t7 like t5 ; +insert into t5 values (0, 100), (1, 2), (1, 3), (2, 2), (2, 7), +(2, -1), (3, 10) ; +insert into t6 values (0, 0), (1, 1), (2, 1), (3, 1), (4, 1) ; +insert into t7 values (3, 3), (2, 2), (1, 1) ; +prepare stmt1 from ' select a, (select count(distinct t5.b) as sum from t5, t6 + where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b + group by t5.a order by sum limit 1) from t7 ' ; +execute stmt1 ; +a (select count(distinct t5.b) as sum from t5, t6 + where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b + group by t5.a order by sum limit 1) +3 1 +2 2 +1 2 +execute stmt1 ; +a (select count(distinct t5.b) as sum from t5, t6 + where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b + group by t5.a order by sum limit 1) +3 1 +2 2 +1 2 +execute stmt1 ; +a (select count(distinct t5.b) as sum from t5, t6 + where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b + group by t5.a order by sum limit 1) +3 1 +2 2 +1 2 +drop table t5, t6, t7 ; +drop table if exists t2 ; +create table t2 as select * from t9; +set @stmt= ' SELECT + (SELECT SUM(c1 + c12 + 0.0) FROM t2 + where (t9.c2 - 0e-3) = t2.c2 + GROUP BY t9.c15 LIMIT 1) as scalar_s, + exists (select 1.0e+0 from t2 + where t2.c3 * 9.0000000000 = t9.c4) as exists_s, + c5 * 4 in (select c6 + 0.3e+1 from t2) as in_s, + (c7 - 4, c8 - 4) in (select c9 + 4.0, c10 + 40e-1 from t2) as in_row_s +FROM t9, +(select c25 x, c32 y from t2) tt WHERE x = c25 ' ; +prepare stmt1 from @stmt ; +execute stmt1 ; +execute stmt1 ; +set @stmt= concat('explain ',@stmt); +prepare stmt1 from @stmt ; +execute stmt1 ; +execute stmt1 ; +set @stmt= ' SELECT + (SELECT SUM(c1+c12+?) FROM t2 where (t9.c2-?)=t2.c2 + GROUP BY t9.c15 LIMIT 1) as scalar_s, + exists (select ? from t2 + where t2.c3*?=t9.c4) as exists_s, + c5*? in (select c6+? from t2) as in_s, + (c7-?, c8-?) in (select c9+?, c10+? from t2) as in_row_s +FROM t9, +(select c25 x, c32 y from t2) tt WHERE x =c25 ' ; +set @arg00= 0.0 ; +set @arg01= 0e-3 ; +set @arg02= 1.0e+0 ; +set @arg03= 9.0000000000 ; +set @arg04= 4 ; +set @arg05= 0.3e+1 ; +set @arg06= 4 ; +set @arg07= 4 ; +set @arg08= 4.0 ; +set @arg09= 40e-1 ; +prepare stmt1 from @stmt ; +execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, +@arg07, @arg08, @arg09 ; +execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, +@arg07, @arg08, @arg09 ; +set @stmt= concat('explain ',@stmt); +prepare stmt1 from @stmt ; +execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, +@arg07, @arg08, @arg09 ; +execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, +@arg07, @arg08, @arg09 ; +drop table t2 ; +select 1 < (select a from t1) ; +ERROR 21000: Subquery returns more than 1 row +prepare stmt1 from ' select 1 < (select a from t1) ' ; +execute stmt1 ; +ERROR 21000: Subquery returns more than 1 row +select 1 as my_col ; +my_col +1 +test_sequence +------ union tests ------ +prepare stmt1 from ' select a FROM t1 where a=1 + union distinct + select a FROM t1 where a=1 '; +execute stmt1 ; +a +1 +execute stmt1 ; +a +1 +prepare stmt1 from ' select a FROM t1 where a=1 + union all + select a FROM t1 where a=1 '; +execute stmt1 ; +a +1 +1 +prepare stmt1 from ' SELECT 1, 2 union SELECT 1 ' ; +ERROR 21000: The used SELECT statements have a different number of columns +prepare stmt1 from ' SELECT 1 union SELECT 1, 2 ' ; +ERROR 21000: The used SELECT statements have a different number of columns +prepare stmt1 from ' SELECT * from t1 union SELECT 1 ' ; +ERROR 21000: The used SELECT statements have a different number of columns +prepare stmt1 from ' SELECT 1 union SELECT * from t1 ' ; +ERROR 21000: The used SELECT statements have a different number of columns +set @arg00=1 ; +select @arg00 FROM t1 where a=1 +union distinct +select 1 FROM t1 where a=1; +@arg00 +1 +prepare stmt1 from ' select ? FROM t1 where a=1 + union distinct + select 1 FROM t1 where a=1 ' ; +execute stmt1 using @arg00; +? +1 +set @arg00=1 ; +select 1 FROM t1 where a=1 +union distinct +select @arg00 FROM t1 where a=1; +1 +1 +prepare stmt1 from ' select 1 FROM t1 where a=1 + union distinct + select ? FROM t1 where a=1 ' ; +execute stmt1 using @arg00; +1 +1 +set @arg00='a' ; +select @arg00 FROM t1 where a=1 +union distinct +select @arg00 FROM t1 where a=1; +@arg00 +a +prepare stmt1 from ' select ? FROM t1 where a=1 + union distinct + select ? FROM t1 where a=1 '; +execute stmt1 using @arg00, @arg00; +? +a +prepare stmt1 from ' select ? + union distinct + select ? '; +execute stmt1 using @arg00, @arg00; +? +a +set @arg00='a' ; +set @arg01=1 ; +set @arg02='a' ; +set @arg03=2 ; +select @arg00 FROM t1 where a=@arg01 +union distinct +select @arg02 FROM t1 where a=@arg03; +@arg00 +a +prepare stmt1 from ' select ? FROM t1 where a=? + union distinct + select ? FROM t1 where a=? ' ; +execute stmt1 using @arg00, @arg01, @arg02, @arg03; +? +a +set @arg00=1 ; +prepare stmt1 from ' select sum(a) + 200, ? from t1 +union distinct +select sum(a) + 200, 1 from t1 +group by b ' ; +execute stmt1 using @arg00; +sum(a) + 200 ? +210 1 +204 1 +201 1 +203 1 +202 1 +set @Oporto='Oporto' ; +set @Lisboa='Lisboa' ; +set @0=0 ; +set @1=1 ; +set @2=2 ; +set @3=3 ; +set @4=4 ; +select @Oporto,@Lisboa,@0,@1,@2,@3,@4 ; +@Oporto @Lisboa @0 @1 @2 @3 @4 +Oporto Lisboa 0 1 2 3 4 +select sum(a) + 200 as the_sum, @Oporto as the_town from t1 +group by b +union distinct +select sum(a) + 200, @Lisboa from t1 +group by b ; +the_sum the_town +204 Oporto +201 Oporto +203 Oporto +202 Oporto +204 Lisboa +201 Lisboa +203 Lisboa +202 Lisboa +prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1 + group by b + union distinct + select sum(a) + 200, ? from t1 + group by b ' ; +execute stmt1 using @Oporto, @Lisboa; +the_sum the_town +204 Oporto +201 Oporto +203 Oporto +202 Oporto +204 Lisboa +201 Lisboa +203 Lisboa +202 Lisboa +select sum(a) + 200 as the_sum, @Oporto as the_town from t1 +where a > @1 +group by b +union distinct +select sum(a) + 200, @Lisboa from t1 +where a > @2 +group by b ; +the_sum the_town +204 Oporto +203 Oporto +202 Oporto +204 Lisboa +203 Lisboa +prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1 + where a > ? + group by b + union distinct + select sum(a) + 200, ? from t1 + where a > ? + group by b ' ; +execute stmt1 using @Oporto, @1, @Lisboa, @2; +the_sum the_town +204 Oporto +203 Oporto +202 Oporto +204 Lisboa +203 Lisboa +select sum(a) + 200 as the_sum, @Oporto as the_town from t1 +where a > @1 +group by b +having avg(a) > @2 +union distinct +select sum(a) + 200, @Lisboa from t1 +where a > @2 +group by b +having avg(a) > @3; +the_sum the_town +204 Oporto +203 Oporto +204 Lisboa +prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1 + where a > ? + group by b + having avg(a) > ? + union distinct + select sum(a) + 200, ? from t1 + where a > ? + group by b + having avg(a) > ? '; +execute stmt1 using @Oporto, @1, @2, @Lisboa, @2, @3; +the_sum the_town +204 Oporto +203 Oporto +204 Lisboa +test_sequence +------ explain select tests ------ +prepare stmt1 from ' explain select * from t9 ' ; +execute stmt1; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def id 8 3 1 N 32801 0 8 +def select_type 253 19 6 N 1 31 33 +def table 253 64 2 N 1 31 33 +def type 253 10 3 N 1 31 33 +def possible_keys 253 4096 0 Y 0 31 33 +def key 253 64 0 Y 0 31 33 +def key_len 8 3 0 Y 32800 0 8 +def ref 253 1024 0 Y 0 31 33 +def rows 8 10 1 N 32801 0 8 +def Extra 253 255 0 N 1 31 33 +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t9 ALL NULL NULL NULL NULL 2 +test_sequence +------ delete tests ------ +delete from t1 ; +insert into t1 values (1,'one'); +insert into t1 values (2,'two'); +insert into t1 values (3,'three'); +insert into t1 values (4,'four'); +commit ; +delete from t9 ; +insert into t9 +set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, +c10= 1, c11= 1, c12 = 1, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=true, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; +insert into t9 +set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, +c10= 9, c11= 9, c12 = 9, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=false, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +commit ; +prepare stmt1 from 'delete from t1 where a=2' ; +execute stmt1; +select a,b from t1 where a=2; +a b +execute stmt1; +insert into t1 values(0,NULL); +set @arg00=NULL; +prepare stmt1 from 'delete from t1 where b=?' ; +execute stmt1 using @arg00; +select a,b from t1 where b is NULL ; +a b +0 NULL +set @arg00='one'; +execute stmt1 using @arg00; +select a,b from t1 where b=@arg00; +a b +prepare stmt1 from 'truncate table t1' ; +ERROR HY000: This command is not supported in the prepared statement protocol yet +test_sequence +------ update tests ------ +delete from t1 ; +insert into t1 values (1,'one'); +insert into t1 values (2,'two'); +insert into t1 values (3,'three'); +insert into t1 values (4,'four'); +commit ; +delete from t9 ; +insert into t9 +set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, +c10= 1, c11= 1, c12 = 1, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=true, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; +insert into t9 +set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, +c10= 9, c11= 9, c12 = 9, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=false, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +commit ; +prepare stmt1 from 'update t1 set b=''a=two'' where a=2' ; +execute stmt1; +select a,b from t1 where a=2; +a b +2 a=two +execute stmt1; +select a,b from t1 where a=2; +a b +2 a=two +set @arg00=NULL; +prepare stmt1 from 'update t1 set b=? where a=2' ; +execute stmt1 using @arg00; +select a,b from t1 where a=2; +a b +2 NULL +set @arg00='two'; +execute stmt1 using @arg00; +select a,b from t1 where a=2; +a b +2 two +set @arg00=2; +prepare stmt1 from 'update t1 set b=NULL where a=?' ; +execute stmt1 using @arg00; +select a,b from t1 where a=@arg00; +a b +2 NULL +update t1 set b='two' where a=@arg00; +set @arg00=2000; +execute stmt1 using @arg00; +select a,b from t1 where a=@arg00; +a b +set @arg00=2; +set @arg01=22; +prepare stmt1 from 'update t1 set a=? where a=?' ; +execute stmt1 using @arg00, @arg00; +select a,b from t1 where a=@arg00; +a b +2 two +execute stmt1 using @arg01, @arg00; +select a,b from t1 where a=@arg01; +a b +22 two +execute stmt1 using @arg00, @arg01; +select a,b from t1 where a=@arg00; +a b +2 two +set @arg00=NULL; +set @arg01=2; +execute stmt1 using @arg00, @arg01; +Warnings: +Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 1 +select a,b from t1 order by a; +a b +0 two +1 one +3 three +4 four +set @arg00=0; +execute stmt1 using @arg01, @arg00; +select a,b from t1 order by a; +a b +1 one +2 two +3 three +4 four +set @arg00=23; +set @arg01='two'; +set @arg02=2; +set @arg03='two'; +set @arg04=2; +drop table if exists t2; +create table t2 as select a,b from t1 ; +prepare stmt1 from 'update t1 set a=? where b=? + and a in (select ? from t2 + where b = ? or a = ?)'; +execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04 ; +affected rows: 1 +info: Rows matched: 1 Changed: 1 Warnings: 0 +select a,b from t1 where a = @arg00 ; +a b +23 two +prepare stmt1 from 'update t1 set a=? where b=? + and a not in (select ? from t2 + where b = ? or a = ?)'; +execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ; +affected rows: 1 +info: Rows matched: 1 Changed: 1 Warnings: 0 +select a,b from t1 order by a ; +a b +1 one +2 two +3 three +4 four +drop table t2 ; +create table t2 +( +a int, b varchar(30), +primary key(a) +) engine = 'MYISAM' ; +insert into t2(a,b) select a, b from t1 ; +prepare stmt1 from 'update t1 set a=? where b=? + and a in (select ? from t2 + where b = ? or a = ?)'; +execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04 ; +affected rows: 1 +info: Rows matched: 1 Changed: 1 Warnings: 0 +select a,b from t1 where a = @arg00 ; +a b +23 two +prepare stmt1 from 'update t1 set a=? where b=? + and a not in (select ? from t2 + where b = ? or a = ?)'; +execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ; +affected rows: 1 +info: Rows matched: 1 Changed: 1 Warnings: 0 +select a,b from t1 order by a ; +a b +1 one +2 two +3 three +4 four +drop table t2 ; +set @arg00=1; +prepare stmt1 from 'update t1 set b=''bla'' +where a=2 +limit 1'; +execute stmt1 ; +select a,b from t1 where b = 'bla' ; +a b +2 bla +prepare stmt1 from 'update t1 set b=''bla'' +where a=2 +limit ?'; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?' at line 3 +test_sequence +------ insert tests ------ +delete from t1 ; +insert into t1 values (1,'one'); +insert into t1 values (2,'two'); +insert into t1 values (3,'three'); +insert into t1 values (4,'four'); +commit ; +delete from t9 ; +insert into t9 +set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, +c10= 1, c11= 1, c12 = 1, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=true, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; +insert into t9 +set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, +c10= 9, c11= 9, c12 = 9, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=false, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +commit ; +prepare stmt1 from 'insert into t1 values(5, ''five'' )'; +execute stmt1; +select a,b from t1 where a = 5; +a b +5 five +set @arg00='six' ; +prepare stmt1 from 'insert into t1 values(6, ? )'; +execute stmt1 using @arg00; +select a,b from t1 where b = @arg00; +a b +6 six +execute stmt1 using @arg00; +ERROR 23000: Duplicate entry '6' for key 1 +set @arg00=NULL ; +prepare stmt1 from 'insert into t1 values(0, ? )'; +execute stmt1 using @arg00; +select a,b from t1 where b is NULL; +a b +0 NULL +set @arg00=8 ; +set @arg01='eight' ; +prepare stmt1 from 'insert into t1 values(?, ? )'; +execute stmt1 using @arg00, @arg01 ; +select a,b from t1 where b = @arg01; +a b +8 eight +set @NULL= null ; +set @arg00= 'abc' ; +execute stmt1 using @NULL, @NULL ; +ERROR 23000: Column 'a' cannot be null +execute stmt1 using @NULL, @NULL ; +ERROR 23000: Column 'a' cannot be null +execute stmt1 using @NULL, @arg00 ; +ERROR 23000: Column 'a' cannot be null +execute stmt1 using @NULL, @arg00 ; +ERROR 23000: Column 'a' cannot be null +set @arg01= 10000 + 2 ; +execute stmt1 using @arg01, @arg00 ; +set @arg01= 10000 + 1 ; +execute stmt1 using @arg01, @arg00 ; +select * from t1 where a > 10000 order by a ; +a b +10001 abc +10002 abc +delete from t1 where a > 10000 ; +set @arg01= 10000 + 2 ; +execute stmt1 using @arg01, @NULL ; +set @arg01= 10000 + 1 ; +execute stmt1 using @arg01, @NULL ; +select * from t1 where a > 10000 order by a ; +a b +10001 NULL +10002 NULL +delete from t1 where a > 10000 ; +set @arg01= 10000 + 10 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 9 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 8 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 7 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 6 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 5 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 4 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 3 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 2 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 1 ; +execute stmt1 using @arg01, @arg01 ; +select * from t1 where a > 10000 order by a ; +a b +10001 10001 +10002 10002 +10003 10003 +10004 10004 +10005 10005 +10006 10006 +10007 10007 +10008 10008 +10009 10009 +10010 10010 +delete from t1 where a > 10000 ; +set @arg00=81 ; +set @arg01='8-1' ; +set @arg02=82 ; +set @arg03='8-2' ; +prepare stmt1 from 'insert into t1 values(?,?),(?,?)'; +execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; +select a,b from t1 where a in (@arg00,@arg02) ; +a b +81 8-1 +82 8-2 +set @arg00=9 ; +set @arg01='nine' ; +prepare stmt1 from 'insert into t1 set a=?, b=? '; +execute stmt1 using @arg00, @arg01 ; +select a,b from t1 where a = @arg00 ; +a b +9 nine +set @arg00=6 ; +set @arg01=1 ; +prepare stmt1 from 'insert into t1 set a=?, b=''sechs'' + on duplicate key update a=a + ?, b=concat(b,''modified'') '; +execute stmt1 using @arg00, @arg01; +select * from t1 order by a; +a b +0 NULL +1 one +2 two +3 three +4 four +5 five +7 sixmodified +8 eight +9 nine +81 8-1 +82 8-2 +set @arg00=81 ; +set @arg01=1 ; +execute stmt1 using @arg00, @arg01; +ERROR 23000: Duplicate entry '82' for key 1 +drop table if exists t2 ; +create table t2 (id int auto_increment primary key) +ENGINE= 'MYISAM' ; +prepare stmt1 from ' select last_insert_id() ' ; +insert into t2 values (NULL) ; +execute stmt1 ; +last_insert_id() +1 +insert into t2 values (NULL) ; +execute stmt1 ; +last_insert_id() +2 +drop table t2 ; +set @1000=1000 ; +set @x1000_2="x1000_2" ; +set @x1000_3="x1000_3" ; +set @x1000="x1000" ; +set @1100=1100 ; +set @x1100="x1100" ; +set @100=100 ; +set @updated="updated" ; +insert into t1 values(1000,'x1000_1') ; +insert into t1 values(@1000,@x1000_2),(@1000,@x1000_3) +on duplicate key update a = a + @100, b = concat(b,@updated) ; +select a,b from t1 where a >= 1000 order by a ; +a b +1000 x1000_3 +1100 x1000_1updated +delete from t1 where a >= 1000 ; +insert into t1 values(1000,'x1000_1') ; +prepare stmt1 from ' insert into t1 values(?,?),(?,?) + on duplicate key update a = a + ?, b = concat(b,?) '; +execute stmt1 using @1000, @x1000_2, @1000, @x1000_3, @100, @updated ; +select a,b from t1 where a >= 1000 order by a ; +a b +1000 x1000_3 +1100 x1000_1updated +delete from t1 where a >= 1000 ; +insert into t1 values(1000,'x1000_1') ; +execute stmt1 using @1000, @x1000_2, @1100, @x1000_3, @100, @updated ; +select a,b from t1 where a >= 1000 order by a ; +a b +1200 x1000_1updatedupdated +delete from t1 where a >= 1000 ; +prepare stmt1 from ' replace into t1 (a,b) select 100, ''hundred'' '; +execute stmt1; +execute stmt1; +execute stmt1; +test_sequence +------ multi table tests ------ +delete from t1 ; +delete from t9 ; +insert into t1(a,b) values (1, 'one'), (2, 'two'), (3, 'three') ; +insert into t9 (c1,c21) +values (1, 'one'), (2, 'two'), (3, 'three') ; +prepare stmt_delete from " delete t1, t9 + from t1, t9 where t1.a=t9.c1 and t1.b='updated' "; +prepare stmt_update from " update t1, t9 + set t1.b='updated', t9.c21='updated' + where t1.a=t9.c1 and t1.a=? "; +prepare stmt_select1 from " select a, b from t1 order by a" ; +prepare stmt_select2 from " select c1, c21 from t9 order by c1" ; +set @arg00= 1 ; +execute stmt_update using @arg00 ; +execute stmt_delete ; +execute stmt_select1 ; +a b +2 two +3 three +execute stmt_select2 ; +c1 c21 +2 two +3 three +set @arg00= @arg00 + 1 ; +execute stmt_update using @arg00 ; +execute stmt_delete ; +execute stmt_select1 ; +a b +3 three +execute stmt_select2 ; +c1 c21 +3 three +set @arg00= @arg00 + 1 ; +execute stmt_update using @arg00 ; +execute stmt_delete ; +execute stmt_select1 ; +a b +execute stmt_select2 ; +c1 c21 +set @arg00= @arg00 + 1 ; +drop table if exists t5 ; +set @arg01= 8; +set @arg02= 8.0; +set @arg03= 80.00000000000e-1; +set @arg04= 'abc' ; +set @arg05= CAST('abc' as binary) ; +set @arg06= '1991-08-05' ; +set @arg07= CAST('1991-08-05' as date); +set @arg08= '1991-08-05 01:01:01' ; +set @arg09= CAST('1991-08-05 01:01:01' as datetime) ; +set @arg10= unix_timestamp('1991-01-01 01:01:01'); +set @arg11= YEAR('1991-01-01 01:01:01'); +set @arg12= 8 ; +set @arg12= NULL ; +set @arg13= 8.0 ; +set @arg13= NULL ; +set @arg14= 'abc'; +set @arg14= NULL ; +set @arg15= CAST('abc' as binary) ; +set @arg15= NULL ; +create table t5 as select +8 as const01, @arg01 as param01, +8.0 as const02, @arg02 as param02, +80.00000000000e-1 as const03, @arg03 as param03, +'abc' as const04, @arg04 as param04, +CAST('abc' as binary) as const05, @arg05 as param05, +'1991-08-05' as const06, @arg06 as param06, +CAST('1991-08-05' as date) as const07, @arg07 as param07, +'1991-08-05 01:01:01' as const08, @arg08 as param08, +CAST('1991-08-05 01:01:01' as datetime) as const09, @arg09 as param09, +unix_timestamp('1991-01-01 01:01:01') as const10, @arg10 as param10, +YEAR('1991-01-01 01:01:01') as const11, @arg11 as param11, +NULL as const12, @arg12 as param12, +@arg13 as param13, +@arg14 as param14, +@arg15 as param15; +show create table t5 ; +Table Create Table +t5 CREATE TABLE `t5` ( + `const01` bigint(1) NOT NULL default '0', + `param01` bigint(20) default NULL, + `const02` double(3,1) NOT NULL default '0.0', + `param02` double default NULL, + `const03` double NOT NULL default '0', + `param03` double default NULL, + `const04` char(3) NOT NULL default '', + `param04` longtext, + `const05` binary(3) NOT NULL default '', + `param05` longblob, + `const06` varchar(10) NOT NULL default '', + `param06` longtext, + `const07` date default NULL, + `param07` longblob, + `const08` varchar(19) NOT NULL default '', + `param08` longtext, + `const09` datetime default NULL, + `param09` longblob, + `const10` int(10) NOT NULL default '0', + `param10` bigint(20) default NULL, + `const11` int(4) default NULL, + `param11` bigint(20) default NULL, + `const12` binary(0) default NULL, + `param12` bigint(20) default NULL, + `param13` double default NULL, + `param14` longtext, + `param15` longblob +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select * from t5 ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def test t5 t5 const01 const01 8 1 1 N 32769 0 63 +def test t5 t5 param01 param01 8 20 1 Y 32768 0 63 +def test t5 t5 const02 const02 5 3 3 N 32769 1 63 +def test t5 t5 param02 param02 5 20 1 Y 32768 31 63 +def test t5 t5 const03 const03 5 23 1 N 32769 31 63 +def test t5 t5 param03 param03 5 20 1 Y 32768 31 63 +def test t5 t5 const04 const04 254 3 3 N 1 0 8 +def test t5 t5 param04 param04 252 16777215 3 Y 16 0 8 +def test t5 t5 const05 const05 254 3 3 N 129 0 63 +def test t5 t5 param05 param05 252 16777215 3 Y 144 0 63 +def test t5 t5 const06 const06 253 10 10 N 1 0 8 +def test t5 t5 param06 param06 252 16777215 10 Y 16 0 8 +def test t5 t5 const07 const07 10 10 10 Y 128 0 63 +def test t5 t5 param07 param07 252 16777215 10 Y 144 0 63 +def test t5 t5 const08 const08 253 19 19 N 1 0 8 +def test t5 t5 param08 param08 252 16777215 19 Y 16 0 8 +def test t5 t5 const09 const09 12 19 19 Y 128 0 63 +def test t5 t5 param09 param09 252 16777215 19 Y 144 0 63 +def test t5 t5 const10 const10 3 10 9 N 32769 0 63 +def test t5 t5 param10 param10 8 20 9 Y 32768 0 63 +def test t5 t5 const11 const11 3 4 4 Y 32768 0 63 +def test t5 t5 param11 param11 8 20 4 Y 32768 0 63 +def test t5 t5 const12 const12 254 0 0 Y 128 0 63 +def test t5 t5 param12 param12 8 20 0 Y 32768 0 63 +def test t5 t5 param13 param13 5 20 0 Y 32768 31 63 +def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8 +def test t5 t5 param15 param15 252 16777215 0 Y 144 0 63 +const01 8 +param01 8 +const02 8.0 +param02 8 +const03 8 +param03 8 +const04 abc +param04 abc +const05 abc +param05 abc +const06 1991-08-05 +param06 1991-08-05 +const07 1991-08-05 +param07 1991-08-05 +const08 1991-08-05 01:01:01 +param08 1991-08-05 01:01:01 +const09 1991-08-05 01:01:01 +param09 1991-08-05 01:01:01 +const10 662680861 +param10 662680861 +const11 1991 +param11 1991 +const12 NULL +param12 NULL +param13 NULL +param14 NULL +param15 NULL +drop table t5 ; +test_sequence +------ data type conversion tests ------ +delete from t1 ; +insert into t1 values (1,'one'); +insert into t1 values (2,'two'); +insert into t1 values (3,'three'); +insert into t1 values (4,'four'); +commit ; +delete from t9 ; +insert into t9 +set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, +c10= 1, c11= 1, c12 = 1, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=true, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; +insert into t9 +set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, +c10= 9, c11= 9, c12 = 9, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=false, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +commit ; +insert into t9 set c1= 0, c15= '1991-01-01 01:01:01' ; +select * from t9 order by c1 ; +c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday +test_sequence +------ select @parameter:= column ------ +prepare full_info from "select @arg01, @arg02, @arg03, @arg04, + @arg05, @arg06, @arg07, @arg08, + @arg09, @arg10, @arg11, @arg12, + @arg13, @arg14, @arg15, @arg16, + @arg17, @arg18, @arg19, @arg20, + @arg21, @arg22, @arg23, @arg24, + @arg25, @arg26, @arg27, @arg28, + @arg29, @arg30, @arg31, @arg32" ; +select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, +@arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8, +@arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12, +@arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16, +@arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20, +@arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24, +@arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28, +@arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32 +from t9 where c1= 1 ; +@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 +1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 1 Y 128 31 63 +def @arg03 254 20 1 Y 128 31 63 +def @arg04 254 20 1 Y 128 31 63 +def @arg05 254 20 1 Y 128 31 63 +def @arg06 254 20 1 Y 128 31 63 +def @arg07 254 20 1 Y 128 31 63 +def @arg08 254 20 1 Y 128 31 63 +def @arg09 254 20 1 Y 128 31 63 +def @arg10 254 20 1 Y 128 31 63 +def @arg11 254 20 1 Y 128 31 63 +def @arg12 254 20 1 Y 128 31 63 +def @arg13 254 8192 10 Y 128 31 63 +def @arg14 254 8192 19 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 8 Y 128 31 63 +def @arg17 254 20 4 Y 128 31 63 +def @arg18 254 20 1 Y 128 31 63 +def @arg19 254 20 1 Y 128 31 63 +def @arg20 254 8192 1 Y 0 31 8 +def @arg21 254 8192 10 Y 0 31 8 +def @arg22 254 8192 30 Y 0 31 8 +def @arg23 254 8192 8 Y 128 31 63 +def @arg24 254 8192 8 Y 0 31 8 +def @arg25 254 8192 4 Y 128 31 63 +def @arg26 254 8192 4 Y 0 31 8 +def @arg27 254 8192 10 Y 128 31 63 +def @arg28 254 8192 10 Y 0 31 8 +def @arg29 254 8192 8 Y 128 31 63 +def @arg30 254 8192 8 Y 0 31 8 +def @arg31 254 8192 3 Y 0 31 8 +def @arg32 254 8192 6 Y 128 31 63 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, +@arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8, +@arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12, +@arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16, +@arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20, +@arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24, +@arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28, +@arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32 +from t9 where c1= 0 ; +@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 0 Y 128 31 63 +def @arg03 254 20 0 Y 128 31 63 +def @arg04 254 20 0 Y 128 31 63 +def @arg05 254 20 0 Y 128 31 63 +def @arg06 254 20 0 Y 128 31 63 +def @arg07 254 20 0 Y 128 31 63 +def @arg08 254 20 0 Y 128 31 63 +def @arg09 254 20 0 Y 128 31 63 +def @arg10 254 20 0 Y 128 31 63 +def @arg11 254 20 0 Y 128 31 63 +def @arg12 254 20 0 Y 128 31 63 +def @arg13 254 8192 0 Y 128 31 63 +def @arg14 254 8192 0 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 0 Y 128 31 63 +def @arg17 254 20 0 Y 128 31 63 +def @arg18 254 20 0 Y 128 31 63 +def @arg19 254 20 0 Y 128 31 63 +def @arg20 254 8192 0 Y 0 31 8 +def @arg21 254 8192 0 Y 0 31 8 +def @arg22 254 8192 0 Y 0 31 8 +def @arg23 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 0 31 8 +def @arg25 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 0 31 8 +def @arg27 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 0 31 8 +def @arg29 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 0 31 8 +def @arg31 254 8192 0 Y 0 31 8 +def @arg32 254 8192 0 Y 0 31 8 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +prepare stmt1 from "select + @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, + @arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8, + @arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12, + @arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16, + @arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20, + @arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24, + @arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28, + @arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32 +from t9 where c1= ?" ; +set @my_key= 1 ; +execute stmt1 using @my_key ; +@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 +1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 1 Y 128 31 63 +def @arg03 254 20 1 Y 128 31 63 +def @arg04 254 20 1 Y 128 31 63 +def @arg05 254 20 1 Y 128 31 63 +def @arg06 254 20 1 Y 128 31 63 +def @arg07 254 20 1 Y 128 31 63 +def @arg08 254 20 1 Y 128 31 63 +def @arg09 254 20 1 Y 128 31 63 +def @arg10 254 20 1 Y 128 31 63 +def @arg11 254 20 1 Y 128 31 63 +def @arg12 254 20 1 Y 128 31 63 +def @arg13 254 8192 10 Y 128 31 63 +def @arg14 254 8192 19 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 8 Y 128 31 63 +def @arg17 254 20 4 Y 128 31 63 +def @arg18 254 20 1 Y 128 31 63 +def @arg19 254 20 1 Y 128 31 63 +def @arg20 254 8192 1 Y 0 31 8 +def @arg21 254 8192 10 Y 0 31 8 +def @arg22 254 8192 30 Y 0 31 8 +def @arg23 254 8192 8 Y 128 31 63 +def @arg24 254 8192 8 Y 0 31 8 +def @arg25 254 8192 4 Y 128 31 63 +def @arg26 254 8192 4 Y 0 31 8 +def @arg27 254 8192 10 Y 128 31 63 +def @arg28 254 8192 10 Y 0 31 8 +def @arg29 254 8192 8 Y 128 31 63 +def @arg30 254 8192 8 Y 0 31 8 +def @arg31 254 8192 3 Y 0 31 8 +def @arg32 254 8192 6 Y 128 31 63 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +set @my_key= 0 ; +execute stmt1 using @my_key ; +@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 0 Y 128 31 63 +def @arg03 254 20 0 Y 128 31 63 +def @arg04 254 20 0 Y 128 31 63 +def @arg05 254 20 0 Y 128 31 63 +def @arg06 254 20 0 Y 128 31 63 +def @arg07 254 20 0 Y 128 31 63 +def @arg08 254 20 0 Y 128 31 63 +def @arg09 254 20 0 Y 128 31 63 +def @arg10 254 20 0 Y 128 31 63 +def @arg11 254 20 0 Y 128 31 63 +def @arg12 254 20 0 Y 128 31 63 +def @arg13 254 8192 0 Y 128 31 63 +def @arg14 254 8192 0 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 0 Y 128 31 63 +def @arg17 254 20 0 Y 128 31 63 +def @arg18 254 20 0 Y 128 31 63 +def @arg19 254 20 0 Y 128 31 63 +def @arg20 254 8192 0 Y 0 31 8 +def @arg21 254 8192 0 Y 0 31 8 +def @arg22 254 8192 0 Y 0 31 8 +def @arg23 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 0 31 8 +def @arg25 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 0 31 8 +def @arg27 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 0 31 8 +def @arg29 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 0 31 8 +def @arg31 254 8192 0 Y 0 31 8 +def @arg32 254 8192 0 Y 0 31 8 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +prepare stmt1 from "select ? := c1 from t9 where c1= 1" ; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':= c1 from t9 where c1= 1' at line 1 +test_sequence +------ select column, .. into @parm,.. ------ +select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, +c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, +c25, c26, c27, c28, c29, c30, c31, c32 +into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, +@arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, +@arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24, +@arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 +from t9 where c1= 1 ; +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 1 Y 128 31 63 +def @arg03 254 20 1 Y 128 31 63 +def @arg04 254 20 1 Y 128 31 63 +def @arg05 254 20 1 Y 128 31 63 +def @arg06 254 20 1 Y 128 31 63 +def @arg07 254 20 1 Y 128 31 63 +def @arg08 254 20 1 Y 128 31 63 +def @arg09 254 20 1 Y 128 31 63 +def @arg10 254 20 1 Y 128 31 63 +def @arg11 254 20 1 Y 128 31 63 +def @arg12 254 20 1 Y 128 31 63 +def @arg13 254 8192 10 Y 128 31 63 +def @arg14 254 8192 19 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 8 Y 128 31 63 +def @arg17 254 20 4 Y 128 31 63 +def @arg18 254 20 1 Y 128 31 63 +def @arg19 254 20 1 Y 128 31 63 +def @arg20 254 8192 1 Y 0 31 8 +def @arg21 254 8192 10 Y 0 31 8 +def @arg22 254 8192 30 Y 0 31 8 +def @arg23 254 8192 8 Y 128 31 63 +def @arg24 254 8192 8 Y 0 31 8 +def @arg25 254 8192 4 Y 128 31 63 +def @arg26 254 8192 4 Y 0 31 8 +def @arg27 254 8192 10 Y 128 31 63 +def @arg28 254 8192 10 Y 0 31 8 +def @arg29 254 8192 8 Y 128 31 63 +def @arg30 254 8192 8 Y 0 31 8 +def @arg31 254 8192 3 Y 0 31 8 +def @arg32 254 8192 6 Y 128 31 63 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, +c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, +c25, c26, c27, c28, c29, c30, c31, c32 +into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, +@arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, +@arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24, +@arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 +from t9 where c1= 0 ; +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 0 Y 128 31 63 +def @arg03 254 20 0 Y 128 31 63 +def @arg04 254 20 0 Y 128 31 63 +def @arg05 254 20 0 Y 128 31 63 +def @arg06 254 20 0 Y 128 31 63 +def @arg07 254 20 0 Y 128 31 63 +def @arg08 254 20 0 Y 128 31 63 +def @arg09 254 20 0 Y 128 31 63 +def @arg10 254 20 0 Y 128 31 63 +def @arg11 254 20 0 Y 128 31 63 +def @arg12 254 20 0 Y 128 31 63 +def @arg13 254 8192 0 Y 128 31 63 +def @arg14 254 8192 0 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 0 Y 128 31 63 +def @arg17 254 20 0 Y 128 31 63 +def @arg18 254 20 0 Y 128 31 63 +def @arg19 254 20 0 Y 128 31 63 +def @arg20 254 8192 0 Y 0 31 8 +def @arg21 254 8192 0 Y 0 31 8 +def @arg22 254 8192 0 Y 0 31 8 +def @arg23 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 0 31 8 +def @arg25 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 0 31 8 +def @arg27 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 0 31 8 +def @arg29 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 0 31 8 +def @arg31 254 8192 0 Y 0 31 8 +def @arg32 254 8192 0 Y 0 31 8 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +prepare stmt1 from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, + c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, + c25, c26, c27, c28, c29, c30, c31, c32 +into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, + @arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, + @arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24, + @arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 +from t9 where c1= ?" ; +set @my_key= 1 ; +execute stmt1 using @my_key ; +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 1 Y 128 31 63 +def @arg03 254 20 1 Y 128 31 63 +def @arg04 254 20 1 Y 128 31 63 +def @arg05 254 20 1 Y 128 31 63 +def @arg06 254 20 1 Y 128 31 63 +def @arg07 254 20 1 Y 128 31 63 +def @arg08 254 20 1 Y 128 31 63 +def @arg09 254 20 1 Y 128 31 63 +def @arg10 254 20 1 Y 128 31 63 +def @arg11 254 20 1 Y 128 31 63 +def @arg12 254 20 1 Y 128 31 63 +def @arg13 254 8192 10 Y 128 31 63 +def @arg14 254 8192 19 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 8 Y 128 31 63 +def @arg17 254 20 4 Y 128 31 63 +def @arg18 254 20 1 Y 128 31 63 +def @arg19 254 20 1 Y 128 31 63 +def @arg20 254 8192 1 Y 0 31 8 +def @arg21 254 8192 10 Y 0 31 8 +def @arg22 254 8192 30 Y 0 31 8 +def @arg23 254 8192 8 Y 128 31 63 +def @arg24 254 8192 8 Y 0 31 8 +def @arg25 254 8192 4 Y 128 31 63 +def @arg26 254 8192 4 Y 0 31 8 +def @arg27 254 8192 10 Y 128 31 63 +def @arg28 254 8192 10 Y 0 31 8 +def @arg29 254 8192 8 Y 128 31 63 +def @arg30 254 8192 8 Y 0 31 8 +def @arg31 254 8192 3 Y 0 31 8 +def @arg32 254 8192 6 Y 128 31 63 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +set @my_key= 0 ; +execute stmt1 using @my_key ; +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 0 Y 128 31 63 +def @arg03 254 20 0 Y 128 31 63 +def @arg04 254 20 0 Y 128 31 63 +def @arg05 254 20 0 Y 128 31 63 +def @arg06 254 20 0 Y 128 31 63 +def @arg07 254 20 0 Y 128 31 63 +def @arg08 254 20 0 Y 128 31 63 +def @arg09 254 20 0 Y 128 31 63 +def @arg10 254 20 0 Y 128 31 63 +def @arg11 254 20 0 Y 128 31 63 +def @arg12 254 20 0 Y 128 31 63 +def @arg13 254 8192 0 Y 128 31 63 +def @arg14 254 8192 0 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 0 Y 128 31 63 +def @arg17 254 20 0 Y 128 31 63 +def @arg18 254 20 0 Y 128 31 63 +def @arg19 254 20 0 Y 128 31 63 +def @arg20 254 8192 0 Y 0 31 8 +def @arg21 254 8192 0 Y 0 31 8 +def @arg22 254 8192 0 Y 0 31 8 +def @arg23 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 0 31 8 +def @arg25 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 0 31 8 +def @arg27 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 0 31 8 +def @arg29 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 0 31 8 +def @arg31 254 8192 0 Y 0 31 8 +def @arg32 254 8192 0 Y 0 31 8 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +prepare stmt1 from "select c1 into ? from t9 where c1= 1" ; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? from t9 where c1= 1' at line 1 +test_sequence +-- insert into numeric columns -- +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20 ) ; +set @arg00= 21 ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt1 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22 )" ; +execute stmt1 ; +set @arg00= 23; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, +30.0, 30.0, 30.0 ) ; +set @arg00= 31.0 ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt1 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, + 32.0, 32.0, 32.0 )" ; +execute stmt1 ; +set @arg00= 33.0; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( '40', '40', '40', '40', '40', '40', '40', '40', +'40', '40', '40' ) ; +set @arg00= '41' ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt1 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( '42', '42', '42', '42', '42', '42', '42', '42', + '42', '42', '42' )" ; +execute stmt1 ; +set @arg00= '43'; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( CAST('50' as binary), CAST('50' as binary), +CAST('50' as binary), CAST('50' as binary), CAST('50' as binary), +CAST('50' as binary), CAST('50' as binary), CAST('50' as binary), +CAST('50' as binary), CAST('50' as binary), CAST('50' as binary) ) ; +set @arg00= CAST('51' as binary) ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt1 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( CAST('52' as binary), CAST('52' as binary), + CAST('52' as binary), CAST('52' as binary), CAST('52' as binary), + CAST('52' as binary), CAST('52' as binary), CAST('52' as binary), + CAST('52' as binary), CAST('52' as binary), CAST('52' as binary) )" ; +execute stmt1 ; +set @arg00= CAST('53' as binary) ; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +set @arg00= 2 ; +set @arg00= NULL ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( 60, NULL, NULL, NULL, NULL, NULL, NULL, NULL, +NULL, NULL, NULL ) ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( 61, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt1 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 62, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL )" ; +execute stmt1 ; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 63, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +set @arg00= 8.0 ; +set @arg00= NULL ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( 71, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 73, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +set @arg00= 'abc' ; +set @arg00= NULL ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( 81, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 83, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 +from t9 where c1 >= 20 +order by c1 ; +c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c12 +20 20 20 20 20 20 20 20 20 20 20.0000 +21 21 21 21 21 21 21 21 21 21 21.0000 +22 22 22 22 22 22 22 22 22 22 22.0000 +23 23 23 23 23 23 23 23 23 23 23.0000 +30 30 30 30 30 30 30 30 30 30 30.0000 +31 31 31 31 31 31 31 31 31 31 31.0000 +32 32 32 32 32 32 32 32 32 32 32.0000 +33 33 33 33 33 33 33 33 33 33 33.0000 +40 40 40 40 40 40 40 40 40 40 40.0000 +41 41 41 41 41 41 41 41 41 41 41.0000 +42 42 42 42 42 42 42 42 42 42 42.0000 +43 43 43 43 43 43 43 43 43 43 43.0000 +50 50 50 50 50 50 50 50 50 50 50.0000 +51 51 51 51 51 51 51 51 51 51 51.0000 +52 52 52 52 52 52 52 52 52 52 52.0000 +53 53 53 53 53 53 53 53 53 53 53.0000 +60 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +61 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +62 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +63 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +71 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +73 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +81 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +83 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +test_sequence +-- select .. where numeric column = .. -- +set @arg00= 20; +select 'true' as found from t9 +where c1= 20 and c2= 20 and c3= 20 and c4= 20 and c5= 20 and c6= 20 and c7= 20 +and c8= 20 and c9= 20 and c10= 20 and c12= 20; +found +true +select 'true' as found from t9 +where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 +and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 +and c12= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c2= 20 and c3= 20 and c4= 20 and c5= 20 and c6= 20 and c7= 20 + and c8= 20 and c9= 20 and c10= 20 and c12= 20 "; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? + and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? + and c12= ? "; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +found +true +set @arg00= 20.0; +select 'true' as found from t9 +where c1= 20.0 and c2= 20.0 and c3= 20.0 and c4= 20.0 and c5= 20.0 and c6= 20.0 +and c7= 20.0 and c8= 20.0 and c9= 20.0 and c10= 20.0 and c12= 20.0; +found +true +select 'true' as found from t9 +where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 +and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 +and c12= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20.0 and c2= 20.0 and c3= 20.0 and c4= 20.0 and c5= 20.0 and c6= 20.0 + and c7= 20.0 and c8= 20.0 and c9= 20.0 and c10= 20.0 and c12= 20.0 "; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? + and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? + and c12= ? "; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +found +true +select 'true' as found from t9 +where c1= '20' and c2= '20' and c3= '20' and c4= '20' and c5= '20' and c6= '20' + and c7= '20' and c8= '20' and c9= '20' and c10= '20' and c12= '20'; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= '20' and c2= '20' and c3= '20' and c4= '20' and c5= '20' and c6= '20' + and c7= '20' and c8= '20' and c9= '20' and c10= '20' and c12= '20' "; +execute stmt1 ; +found +true +set @arg00= '20'; +select 'true' as found from t9 +where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 +and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 +and c12= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? + and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? + and c12= ? "; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +found +true +select 'true' as found from t9 +where c1= CAST('20' as binary) and c2= CAST('20' as binary) and +c3= CAST('20' as binary) and c4= CAST('20' as binary) and +c5= CAST('20' as binary) and c6= CAST('20' as binary) and +c7= CAST('20' as binary) and c8= CAST('20' as binary) and +c9= CAST('20' as binary) and c10= CAST('20' as binary) and +c12= CAST('20' as binary); +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= CAST('20' as binary) and c2= CAST('20' as binary) and + c3= CAST('20' as binary) and c4= CAST('20' as binary) and + c5= CAST('20' as binary) and c6= CAST('20' as binary) and + c7= CAST('20' as binary) and c8= CAST('20' as binary) and + c9= CAST('20' as binary) and c10= CAST('20' as binary) and + c12= CAST('20' as binary) "; +execute stmt1 ; +found +true +set @arg00= CAST('20' as binary) ; +select 'true' as found from t9 +where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 +and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 +and c12= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? + and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? + and c12= ? "; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +found +true +delete from t9 ; +test_sequence +-- some numeric overflow experiments -- +prepare my_insert from "insert into t9 + ( c21, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 'O', ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +prepare my_select from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 +from t9 where c21 = 'O' "; +prepare my_delete from "delete from t9 where c21 = 'O' "; +set @arg00= 9223372036854775807 ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1264 Data truncated; out of range for column 'c1' at row 1 +Warning 1264 Data truncated; out of range for column 'c2' at row 1 +Warning 1264 Data truncated; out of range for column 'c3' at row 1 +Warning 1264 Data truncated; out of range for column 'c4' at row 1 +Warning 1264 Data truncated; out of range for column 'c5' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 127 +c2 32767 +c3 8388607 +c4 2147483647 +c5 2147483647 +c6 9223372036854775807 +c7 9.22337e+18 +c8 9.22337203685478e+18 +c9 9.22337203685478e+18 +c10 9.22337203685478e+18 +c12 99999.9999 +execute my_delete ; +set @arg00= '9223372036854775807' ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1264 Data truncated; out of range for column 'c1' at row 1 +Warning 1264 Data truncated; out of range for column 'c2' at row 1 +Warning 1264 Data truncated; out of range for column 'c3' at row 1 +Warning 1265 Data truncated for column 'c4' at row 1 +Warning 1265 Data truncated for column 'c5' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 127 +c2 32767 +c3 8388607 +c4 2147483647 +c5 2147483647 +c6 9223372036854775807 +c7 9.22337e+18 +c8 9.22337203685478e+18 +c9 9.22337203685478e+18 +c10 9.22337203685478e+18 +c12 99999.9999 +execute my_delete ; +set @arg00= -9223372036854775808 ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1264 Data truncated; out of range for column 'c1' at row 1 +Warning 1264 Data truncated; out of range for column 'c2' at row 1 +Warning 1264 Data truncated; out of range for column 'c3' at row 1 +Warning 1264 Data truncated; out of range for column 'c4' at row 1 +Warning 1264 Data truncated; out of range for column 'c5' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 -128 +c2 -32768 +c3 -8388608 +c4 -2147483648 +c5 -2147483648 +c6 -9223372036854775808 +c7 -9.22337e+18 +c8 -9.22337203685478e+18 +c9 -9.22337203685478e+18 +c10 -9.22337203685478e+18 +c12 -9999.9999 +execute my_delete ; +set @arg00= '-9223372036854775808' ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1264 Data truncated; out of range for column 'c1' at row 1 +Warning 1264 Data truncated; out of range for column 'c2' at row 1 +Warning 1264 Data truncated; out of range for column 'c3' at row 1 +Warning 1265 Data truncated for column 'c4' at row 1 +Warning 1265 Data truncated for column 'c5' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 -128 +c2 -32768 +c3 -8388608 +c4 -2147483648 +c5 -2147483648 +c6 -9223372036854775808 +c7 -9.22337e+18 +c8 -9.22337203685478e+18 +c9 -9.22337203685478e+18 +c10 -9.22337203685478e+18 +c12 -9999.9999 +execute my_delete ; +set @arg00= 1.11111111111111111111e+50 ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1264 Data truncated; out of range for column 'c1' at row 1 +Warning 1264 Data truncated; out of range for column 'c2' at row 1 +Warning 1264 Data truncated; out of range for column 'c3' at row 1 +Warning 1264 Data truncated; out of range for column 'c4' at row 1 +Warning 1264 Data truncated; out of range for column 'c5' at row 1 +Warning 1264 Data truncated; out of range for column 'c6' at row 1 +Warning 1264 Data truncated; out of range for column 'c7' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 127 +c2 32767 +c3 8388607 +c4 2147483647 +c5 2147483647 +c6 9223372036854775807 +c7 3.40282e+38 +c8 1.11111111111111e+50 +c9 1.11111111111111e+50 +c10 1.11111111111111e+50 +c12 99999.9999 +execute my_delete ; +set @arg00= '1.11111111111111111111e+50' ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1265 Data truncated for column 'c1' at row 1 +Warning 1265 Data truncated for column 'c2' at row 1 +Warning 1265 Data truncated for column 'c3' at row 1 +Warning 1265 Data truncated for column 'c4' at row 1 +Warning 1265 Data truncated for column 'c5' at row 1 +Warning 1265 Data truncated for column 'c6' at row 1 +Warning 1264 Data truncated; out of range for column 'c7' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 1 +c2 1 +c3 1 +c4 1 +c5 1 +c6 1 +c7 3.40282e+38 +c8 1.11111111111111e+50 +c9 1.11111111111111e+50 +c10 1.11111111111111e+50 +c12 99999.9999 +execute my_delete ; +set @arg00= -1.11111111111111111111e+50 ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1264 Data truncated; out of range for column 'c1' at row 1 +Warning 1264 Data truncated; out of range for column 'c2' at row 1 +Warning 1264 Data truncated; out of range for column 'c3' at row 1 +Warning 1264 Data truncated; out of range for column 'c4' at row 1 +Warning 1264 Data truncated; out of range for column 'c5' at row 1 +Warning 1264 Data truncated; out of range for column 'c6' at row 1 +Warning 1264 Data truncated; out of range for column 'c7' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 -128 +c2 -32768 +c3 -8388608 +c4 -2147483648 +c5 -2147483648 +c6 -9223372036854775808 +c7 -3.40282e+38 +c8 -1.11111111111111e+50 +c9 -1.11111111111111e+50 +c10 -1.11111111111111e+50 +c12 -9999.9999 +execute my_delete ; +set @arg00= '-1.11111111111111111111e+50' ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1265 Data truncated for column 'c1' at row 1 +Warning 1265 Data truncated for column 'c2' at row 1 +Warning 1265 Data truncated for column 'c3' at row 1 +Warning 1265 Data truncated for column 'c4' at row 1 +Warning 1265 Data truncated for column 'c5' at row 1 +Warning 1265 Data truncated for column 'c6' at row 1 +Warning 1264 Data truncated; out of range for column 'c7' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 -1 +c2 -1 +c3 -1 +c4 -1 +c5 -1 +c6 -1 +c7 -3.40282e+38 +c8 -1.11111111111111e+50 +c9 -1.11111111111111e+50 +c10 -1.11111111111111e+50 +c12 -9999.9999 +execute my_delete ; +test_sequence +-- insert into string columns -- +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +select c1, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30 +from t9 where c1 >= 20 +order by c1 ; +c1 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 +20 2 20 20 20 20 20 20 20 20 20 20 +21 2 21 21 21 21 21 21 21 21 21 21 +22 2 22 22 22 22 22 22 22 22 22 22 +23 2 23 23 23 23 23 23 23 23 23 23 +30 3 30 30 30 30 30 30 30 30 30 30 +31 3 31 31 31 31 31 31 31 31 31 31 +32 3 32 32 32 32 32 32 32 32 32 32 +33 3 33 33 33 33 33 33 33 33 33 33 +40 4 40 40 40 40 40 40 40 40 40 40 +41 4 41 41 41 41 41 41 41 41 41 41 +42 4 42 42 42 42 42 42 42 42 42 42 +43 4 43 43 43 43 43 43 43 43 43 43 +50 5 50 50 50.00 50.00 50.00 50.00 50.00 50.00 50.00 50.00 +51 5 51 51 51 51 51 51 51 51 51 51 +52 5 52 52 52.00 52.00 52.00 52.00 52.00 52.00 52.00 52.00 +53 5 53 53 53.00 53.00 53.00 53.00 53.00 53.00 53.00 53.00 +54 5 54 54 54.00 54.00 54.00 54.00 54.00 54.00 54.00 54.00 +55 5 55 55 55 55 55 55 55 55 55 55 +56 6 56 56 56.00 56.00 56.00 56.00 56.00 56.00 56.00 56.00 +57 6 57 57 57.00 57.00 57.00 57.00 57.00 57.00 57.00 57.00 +60 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +61 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +62 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +63 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +71 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +73 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +81 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +83 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +test_sequence +-- select .. where string column = .. -- +set @arg00= '20'; +select 'true' as found from t9 +where c1= 20 and concat(c20,substr('20',1+length(c20)))= '20' and c21= '20' and +c22= '20' and c23= '20' and c24= '20' and c25= '20' and c26= '20' and +c27= '20' and c28= '20' and c29= '20' and c30= '20' ; +found +true +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and +c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and +c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr('20',1+length(c20)))= '20' and c21= '20' and + c22= '20' and c23= '20' and c24= '20' and c25= '20' and c26= '20' and + c27= '20' and c28= '20' and c29= '20' and c30= '20'" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and + c21= ? and c22= ? and c23= ? and c25= ? and + c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +found +true +set @arg00= CAST('20' as binary); +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(CAST('20' as binary),1+length(c20))) += CAST('20' as binary) and c21= CAST('20' as binary) +and c22= CAST('20' as binary) and c23= CAST('20' as binary) and +c24= CAST('20' as binary) and c25= CAST('20' as binary) and +c26= CAST('20' as binary) and c27= CAST('20' as binary) and +c28= CAST('20' as binary) and c29= CAST('20' as binary) and +c30= CAST('20' as binary) ; +found +true +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(@arg00,1+length(c20))) = @arg00 and +c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and +c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and +c30= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(CAST('20' as binary),1+length(c20))) + = CAST('20' as binary) and c21= CAST('20' as binary) + and c22= CAST('20' as binary) and c23= CAST('20' as binary) and + c24= CAST('20' as binary) and c25= CAST('20' as binary) and + c26= CAST('20' as binary) and c27= CAST('20' as binary) and + c28= CAST('20' as binary) and c29= CAST('20' as binary) and + c30= CAST('20' as binary)" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(?,1+length(c20))) = ? and c21= ? and + c22= ? and c23= ? and c25= ? and c26= ? and c27= ? and c28= ? and + c29= ? and c30= ?"; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +found +true +set @arg00= 20; +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(20,1+length(c20)))= 20 and c21= 20 and +c22= 20 and c23= 20 and c24= 20 and c25= 20 and c26= 20 and +c27= 20 and c28= 20 and c29= 20 and c30= 20 ; +found +true +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and +c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and +c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(20,1+length(c20)))= 20 and c21= 20 and + c22= 20 and c23= 20 and c24= 20 and c25= 20 and c26= 20 and + c27= 20 and c28= 20 and c29= 20 and c30= 20" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and + c21= ? and c22= ? and c23= ? and c25= ? and + c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +found +true +set @arg00= 20.0; +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(20.0,1+length(c20)))= 20.0 and c21= 20.0 and +c22= 20.0 and c23= 20.0 and c24= 20.0 and c25= 20.0 and c26= 20.0 and +c27= 20.0 and c28= 20.0 and c29= 20.0 and c30= 20.0 ; +found +true +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and +c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and +c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(20.0,1+length(c20)))= 20.0 and c21= 20.0 and + c22= 20.0 and c23= 20.0 and c24= 20.0 and c25= 20.0 and c26= 20.0 and + c27= 20.0 and c28= 20.0 and c29= 20.0 and c30= 20.0" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and + c21= ? and c22= ? and c23= ? and c25= ? and + c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +found +true +delete from t9 ; +test_sequence +-- insert into date/time columns -- +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1264 Data truncated; out of range for column 'c13' at row 1 +Warning 1265 Data truncated for column 'c14' at row 1 +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1264 Data truncated; out of range for column 'c13' at row 1 +Warning 1265 Data truncated for column 'c14' at row 1 +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1264 Data truncated; out of range for column 'c13' at row 1 +Warning 1265 Data truncated for column 'c14' at row 1 +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1264 Data truncated; out of range for column 'c13' at row 1 +Warning 1265 Data truncated for column 'c14' at row 1 +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +select c1, c13, c14, c15, c16, c17 from t9 order by c1 ; +c1 c13 c14 c15 c16 c17 +20 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +21 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +22 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +23 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +30 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +31 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +32 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +33 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +40 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +41 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +42 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +43 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +50 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +51 0010-00-00 0010-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +52 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +53 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +60 NULL NULL 1991-01-01 01:01:01 NULL NULL +61 NULL NULL 1991-01-01 01:01:01 NULL NULL +62 NULL NULL 1991-01-01 01:01:01 NULL NULL +63 NULL NULL 1991-01-01 01:01:01 NULL NULL +71 NULL NULL 1991-01-01 01:01:01 NULL NULL +73 NULL NULL 1991-01-01 01:01:01 NULL NULL +81 NULL NULL 1991-01-01 01:01:01 NULL NULL +83 NULL NULL 1991-01-01 01:01:01 NULL NULL +test_sequence +-- select .. where date/time column = .. -- +set @arg00= '1991-01-01 01:01:01' ; +select 'true' as found from t9 +where c1= 20 and c13= '1991-01-01 01:01:01' and c14= '1991-01-01 01:01:01' and +c15= '1991-01-01 01:01:01' and c16= '1991-01-01 01:01:01' and +c17= '1991-01-01 01:01:01' ; +found +true +select 'true' as found from t9 +where c1= 20 and c13= @arg00 and c14= @arg00 and c15= @arg00 and c16= @arg00 +and c17= @arg00 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c13= '1991-01-01 01:01:01' and c14= '1991-01-01 01:01:01' and + c15= '1991-01-01 01:01:01' and c16= '1991-01-01 01:01:01' and + c17= '1991-01-01 01:01:01'" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c13= ? and c14= ? and c15= ? and c16= ? and c17= ?" ; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00 ; +found +true +set @arg00= CAST('1991-01-01 01:01:01' as datetime) ; +select 'true' as found from t9 +where c1= 20 and c13= CAST('1991-01-01 01:01:01' as datetime) and +c14= CAST('1991-01-01 01:01:01' as datetime) and +c15= CAST('1991-01-01 01:01:01' as datetime) and +c16= CAST('1991-01-01 01:01:01' as datetime) and +c17= CAST('1991-01-01 01:01:01' as datetime) ; +found +true +select 'true' as found from t9 +where c1= 20 and c13= @arg00 and c14= @arg00 and c15= @arg00 and c16= @arg00 +and c17= @arg00 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c13= CAST('1991-01-01 01:01:01' as datetime) and + c14= CAST('1991-01-01 01:01:01' as datetime) and + c15= CAST('1991-01-01 01:01:01' as datetime) and + c16= CAST('1991-01-01 01:01:01' as datetime) and + c17= CAST('1991-01-01 01:01:01' as datetime)" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c13= ? and c14= ? and c15= ? and c16= ? and c17= ?" ; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00 ; +found +true +set @arg00= 1991 ; +select 'true' as found from t9 +where c1= 20 and c17= 1991 ; +found +true +select 'true' as found from t9 +where c1= 20 and c17= @arg00 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c17= 1991" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c17= ?" ; +execute stmt1 using @arg00 ; +found +true +set @arg00= 1.991e+3 ; +select 'true' as found from t9 +where c1= 20 and abs(c17 - 1.991e+3) < 0.01 ; +found +true +select 'true' as found from t9 +where c1= 20 and abs(c17 - @arg00) < 0.01 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and abs(c17 - 1.991e+3) < 0.01" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and abs(c17 - ?) < 0.01" ; +execute stmt1 using @arg00 ; +found +true +drop table t1, t9 ; +create table t1 +( +a int, b varchar(30), +primary key(a) +) ENGINE = MERGE UNION=(t1_1,t1_2) +INSERT_METHOD=LAST; +create table t9 +( +c1 tinyint, c2 smallint, c3 mediumint, c4 int, +c5 integer, c6 bigint, c7 float, c8 double, +c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4), +c13 date, c14 datetime, c15 timestamp(14), c16 time, +c17 year, c18 bit, c19 bool, c20 char, +c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext, +c25 blob, c26 text, c27 mediumblob, c28 mediumtext, +c29 longblob, c30 longtext, c31 enum('one', 'two', 'three'), +c32 set('monday', 'tuesday', 'wednesday'), +primary key(c1) +) ENGINE = MERGE UNION=(t9_1,t9_2) +INSERT_METHOD=LAST; +delete from t1 ; +insert into t1 values (1,'one'); +insert into t1 values (2,'two'); +insert into t1 values (3,'three'); +insert into t1 values (4,'four'); +commit ; +delete from t9 ; +insert into t9 +set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, +c10= 1, c11= 1, c12 = 1, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=true, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; +insert into t9 +set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, +c10= 9, c11= 9, c12 = 9, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=false, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +commit ; +test_sequence +------ simple select tests ------ +prepare stmt1 from ' select * from t9 order by c1 ' ; +execute stmt1; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def test t9 t9 c1 c1 1 4 1 N 49155 0 63 +def test t9 t9 c2 c2 2 6 1 Y 32768 0 63 +def test t9 t9 c3 c3 9 9 1 Y 32768 0 63 +def test t9 t9 c4 c4 3 11 1 Y 32768 0 63 +def test t9 t9 c5 c5 3 11 1 Y 32768 0 63 +def test t9 t9 c6 c6 8 20 1 Y 32768 0 63 +def test t9 t9 c7 c7 4 12 1 Y 32768 31 63 +def test t9 t9 c8 c8 5 22 1 Y 32768 31 63 +def test t9 t9 c9 c9 5 22 1 Y 32768 31 63 +def test t9 t9 c10 c10 5 22 1 Y 32768 31 63 +def test t9 t9 c11 c11 0 9 6 Y 32768 4 63 +def test t9 t9 c12 c12 0 10 6 Y 32768 4 63 +def test t9 t9 c13 c13 10 10 10 Y 128 0 63 +def test t9 t9 c14 c14 12 19 19 Y 128 0 63 +def test t9 t9 c15 c15 7 19 19 N 1249 0 63 +def test t9 t9 c16 c16 11 8 8 Y 128 0 63 +def test t9 t9 c17 c17 13 4 4 Y 32864 0 63 +def test t9 t9 c18 c18 1 1 1 Y 32768 0 63 +def test t9 t9 c19 c19 1 1 1 Y 32768 0 63 +def test t9 t9 c20 c20 254 1 1 Y 0 0 8 +def test t9 t9 c21 c21 253 10 10 Y 0 0 8 +def test t9 t9 c22 c22 253 30 30 Y 0 0 8 +def test t9 t9 c23 c23 252 255 8 Y 144 0 63 +def test t9 t9 c24 c24 252 255 8 Y 16 0 8 +def test t9 t9 c25 c25 252 65535 4 Y 144 0 63 +def test t9 t9 c26 c26 252 65535 4 Y 16 0 8 +def test t9 t9 c27 c27 252 16777215 10 Y 144 0 63 +def test t9 t9 c28 c28 252 16777215 10 Y 16 0 8 +def test t9 t9 c29 c29 252 16777215 8 Y 144 0 63 +def test t9 t9 c30 c30 252 16777215 8 Y 16 0 8 +def test t9 t9 c31 c31 254 5 3 Y 256 0 8 +def test t9 t9 c32 c32 254 24 7 Y 2048 0 8 +c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32 +1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday +set @arg00='SELECT' ; +prepare stmt1 from ' ? a from t1 where a=1 '; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? a from t1 where a=1' at line 1 +set @arg00=1 ; +select @arg00, b from t1 where a=1 ; +@arg00 b +1 one +prepare stmt1 from ' select ?, b from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +? b +1 one +set @arg00='lion' ; +select @arg00, b from t1 where a=1 ; +@arg00 b +lion one +prepare stmt1 from ' select ?, b from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +? b +lion one +set @arg00=NULL ; +select @arg00, b from t1 where a=1 ; +@arg00 b +NULL one +prepare stmt1 from ' select ?, b from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +? b +NULL one +set @arg00=1 ; +select b, a - @arg00 from t1 where a=1 ; +b a - @arg00 +one 0 +prepare stmt1 from ' select b, a - ? from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +b a - ? +one 0 +set @arg00=null ; +select @arg00 as my_col ; +my_col +NULL +prepare stmt1 from ' select ? as my_col'; +execute stmt1 using @arg00 ; +my_col +NULL +select @arg00 + 1 as my_col ; +my_col +NULL +prepare stmt1 from ' select ? + 1 as my_col'; +execute stmt1 using @arg00 ; +my_col +NULL +select 1 + @arg00 as my_col ; +my_col +NULL +prepare stmt1 from ' select 1 + ? as my_col'; +execute stmt1 using @arg00 ; +my_col +NULL +set @arg00='MySQL' ; +select substr(@arg00,1,2) from t1 where a=1 ; +substr(@arg00,1,2) +My +prepare stmt1 from ' select substr(?,1,2) from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +substr(?,1,2) +My +set @arg00=3 ; +select substr('MySQL',@arg00,5) from t1 where a=1 ; +substr('MySQL',@arg00,5) +SQL +prepare stmt1 from ' select substr(''MySQL'',?,5) from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +substr('MySQL',?,5) +SQL +select substr('MySQL',1,@arg00) from t1 where a=1 ; +substr('MySQL',1,@arg00) +MyS +prepare stmt1 from ' select substr(''MySQL'',1,?) from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +substr('MySQL',1,?) +MyS +set @arg00='MySQL' ; +select a , concat(@arg00,b) from t1 order by a; +a concat(@arg00,b) +1 MySQLone +2 MySQLtwo +3 MySQLthree +4 MySQLfour +prepare stmt1 from ' select a , concat(?,b) from t1 order by a ' ; +execute stmt1 using @arg00; +a concat(?,b) +1 MySQLone +2 MySQLtwo +3 MySQLthree +4 MySQLfour +select a , concat(b,@arg00) from t1 order by a ; +a concat(b,@arg00) +1 oneMySQL +2 twoMySQL +3 threeMySQL +4 fourMySQL +prepare stmt1 from ' select a , concat(b,?) from t1 order by a ' ; +execute stmt1 using @arg00; +a concat(b,?) +1 oneMySQL +2 twoMySQL +3 threeMySQL +4 fourMySQL +set @arg00='MySQL' ; +select group_concat(@arg00,b order by a) from t1 +group by 'a' ; +group_concat(@arg00,b order by a) +MySQLone,MySQLtwo,MySQLthree,MySQLfour +prepare stmt1 from ' select group_concat(?,b order by a) from t1 +group by ''a'' ' ; +execute stmt1 using @arg00; +group_concat(?,b order by a) +MySQLone,MySQLtwo,MySQLthree,MySQLfour +select group_concat(b,@arg00 order by a) from t1 +group by 'a' ; +group_concat(b,@arg00 order by a) +oneMySQL,twoMySQL,threeMySQL,fourMySQL +prepare stmt1 from ' select group_concat(b,? order by a) from t1 +group by ''a'' ' ; +execute stmt1 using @arg00; +group_concat(b,? order by a) +oneMySQL,twoMySQL,threeMySQL,fourMySQL +set @arg00='first' ; +set @arg01='second' ; +set @arg02=NULL; +select @arg00, @arg01 from t1 where a=1 ; +@arg00 @arg01 +first second +prepare stmt1 from ' select ?, ? from t1 where a=1 ' ; +execute stmt1 using @arg00, @arg01 ; +? ? +first second +execute stmt1 using @arg02, @arg01 ; +? ? +NULL second +execute stmt1 using @arg00, @arg02 ; +? ? +first NULL +execute stmt1 using @arg02, @arg02 ; +? ? +NULL NULL +drop table if exists t5 ; +create table t5 (id1 int(11) not null default '0', +value2 varchar(100), value1 varchar(100)) ; +insert into t5 values (1,'hh','hh'),(2,'hh','hh'), +(1,'ii','ii'),(2,'ii','ii') ; +prepare stmt1 from ' select id1,value1 from t5 where id1=? or value1=? order by id1,value1 ' ; +set @arg00=1 ; +set @arg01='hh' ; +execute stmt1 using @arg00, @arg01 ; +id1 value1 +1 hh +1 ii +2 hh +drop table t5 ; +drop table if exists t5 ; +create table t5(session_id char(9) not null) ; +insert into t5 values ('abc') ; +prepare stmt1 from ' select * from t5 +where ?=''1111'' and session_id = ''abc'' ' ; +set @arg00='abc' ; +execute stmt1 using @arg00 ; +session_id +set @arg00='1111' ; +execute stmt1 using @arg00 ; +session_id +abc +set @arg00='abc' ; +execute stmt1 using @arg00 ; +session_id +drop table t5 ; +set @arg00='FROM' ; +select a @arg00 t1 where a=1 ; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 t1 where a=1' at line 1 +prepare stmt1 from ' select a ? t1 where a=1 ' ; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? t1 where a=1' at line 1 +set @arg00='t1' ; +select a from @arg00 where a=1 ; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 where a=1' at line 1 +prepare stmt1 from ' select a from ? where a=1 ' ; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? where a=1' at line 1 +set @arg00='WHERE' ; +select a from t1 @arg00 a=1 ; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 a=1' at line 1 +prepare stmt1 from ' select a from t1 ? a=1 ' ; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? a=1' at line 1 +set @arg00=1 ; +select a FROM t1 where a=@arg00 ; +a +1 +prepare stmt1 from ' select a FROM t1 where a=? ' ; +execute stmt1 using @arg00 ; +a +1 +set @arg00=1000 ; +execute stmt1 using @arg00 ; +a +set @arg00=NULL ; +select a FROM t1 where a=@arg00 ; +a +prepare stmt1 from ' select a FROM t1 where a=? ' ; +execute stmt1 using @arg00 ; +a +set @arg00=4 ; +select a FROM t1 where a=sqrt(@arg00) ; +a +2 +prepare stmt1 from ' select a FROM t1 where a=sqrt(?) ' ; +execute stmt1 using @arg00 ; +a +2 +set @arg00=NULL ; +select a FROM t1 where a=sqrt(@arg00) ; +a +prepare stmt1 from ' select a FROM t1 where a=sqrt(?) ' ; +execute stmt1 using @arg00 ; +a +set @arg00=2 ; +set @arg01=3 ; +select a FROM t1 where a in (@arg00,@arg01) order by a; +a +2 +3 +prepare stmt1 from ' select a FROM t1 where a in (?,?) order by a '; +execute stmt1 using @arg00, @arg01; +a +2 +3 +set @arg00= 'one' ; +set @arg01= 'two' ; +set @arg02= 'five' ; +prepare stmt1 from ' select b FROM t1 where b in (?,?,?) order by b ' ; +execute stmt1 using @arg00, @arg01, @arg02 ; +b +one +two +prepare stmt1 from ' select b FROM t1 where b like ? '; +set @arg00='two' ; +execute stmt1 using @arg00 ; +b +two +set @arg00='tw%' ; +execute stmt1 using @arg00 ; +b +two +set @arg00='%wo' ; +execute stmt1 using @arg00 ; +b +two +set @arg00=null ; +insert into t9 set c1= 0, c5 = NULL ; +select c5 from t9 where c5 > NULL ; +c5 +prepare stmt1 from ' select c5 from t9 where c5 > ? '; +execute stmt1 using @arg00 ; +c5 +select c5 from t9 where c5 < NULL ; +c5 +prepare stmt1 from ' select c5 from t9 where c5 < ? '; +execute stmt1 using @arg00 ; +c5 +select c5 from t9 where c5 = NULL ; +c5 +prepare stmt1 from ' select c5 from t9 where c5 = ? '; +execute stmt1 using @arg00 ; +c5 +select c5 from t9 where c5 <=> NULL ; +c5 +NULL +prepare stmt1 from ' select c5 from t9 where c5 <=> ? '; +execute stmt1 using @arg00 ; +c5 +NULL +delete from t9 where c1= 0 ; +set @arg00='>' ; +select a FROM t1 where a @arg00 1 ; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 1' at line 1 +prepare stmt1 from ' select a FROM t1 where a ? 1 ' ; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? 1' at line 1 +set @arg00=1 ; +select a,b FROM t1 where a is not NULL +AND b is not NULL group by a - @arg00 ; +a b +1 one +2 two +3 three +4 four +prepare stmt1 from ' select a,b FROM t1 where a is not NULL +AND b is not NULL group by a - ? ' ; +execute stmt1 using @arg00 ; +a b +1 one +2 two +3 three +4 four +set @arg00='two' ; +select a,b FROM t1 where a is not NULL +AND b is not NULL having b <> @arg00 order by a ; +a b +1 one +3 three +4 four +prepare stmt1 from ' select a,b FROM t1 where a is not NULL +AND b is not NULL having b <> ? order by a ' ; +execute stmt1 using @arg00 ; +a b +1 one +3 three +4 four +set @arg00=1 ; +select a,b FROM t1 where a is not NULL +AND b is not NULL order by a - @arg00 ; +a b +1 one +2 two +3 three +4 four +prepare stmt1 from ' select a,b FROM t1 where a is not NULL +AND b is not NULL order by a - ? ' ; +execute stmt1 using @arg00 ; +a b +1 one +2 two +3 three +4 four +set @arg00=2 ; +select a,b from t1 order by 2 ; +a b +4 four +1 one +3 three +2 two +prepare stmt1 from ' select a,b from t1 +order by ? '; +execute stmt1 using @arg00; +a b +4 four +1 one +3 three +2 two +set @arg00=1 ; +execute stmt1 using @arg00; +a b +1 one +2 two +3 three +4 four +set @arg00=0 ; +execute stmt1 using @arg00; +ERROR 42S22: Unknown column '?' in 'order clause' +set @arg00=1; +prepare stmt1 from ' select a,b from t1 order by a +limit 1 '; +execute stmt1 ; +a b +1 one +prepare stmt1 from ' select a,b from t1 +limit ? '; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?' at line 2 +set @arg00='b' ; +set @arg01=0 ; +set @arg02=2 ; +set @arg03=2 ; +select sum(a), @arg00 from t1 where a > @arg01 +and b is not null group by substr(b,@arg02) +having sum(a) <> @arg03 ; +sum(a) @arg00 +3 b +1 b +4 b +prepare stmt1 from ' select sum(a), ? from t1 where a > ? +and b is not null group by substr(b,?) +having sum(a) <> ? '; +execute stmt1 using @arg00, @arg01, @arg02, @arg03; +sum(a) ? +3 b +1 b +4 b +test_sequence +------ join tests ------ +select first.a as a1, second.a as a2 +from t1 first, t1 second +where first.a = second.a order by a1 ; +a1 a2 +1 1 +2 2 +3 3 +4 4 +prepare stmt1 from ' select first.a as a1, second.a as a2 + from t1 first, t1 second + where first.a = second.a order by a1 '; +execute stmt1 ; +a1 a2 +1 1 +2 2 +3 3 +4 4 +set @arg00='ABC'; +set @arg01='two'; +set @arg02='one'; +select first.a, @arg00, second.a FROM t1 first, t1 second +where @arg01 = first.b or first.a = second.a or second.b = @arg02 +order by second.a, first.a; +a @arg00 a +1 ABC 1 +2 ABC 1 +3 ABC 1 +4 ABC 1 +2 ABC 2 +2 ABC 3 +3 ABC 3 +2 ABC 4 +4 ABC 4 +prepare stmt1 from ' select first.a, ?, second.a FROM t1 first, t1 second + where ? = first.b or first.a = second.a or second.b = ? + order by second.a, first.a'; +execute stmt1 using @arg00, @arg01, @arg02; +a ? a +1 ABC 1 +2 ABC 1 +3 ABC 1 +4 ABC 1 +2 ABC 2 +2 ABC 3 +3 ABC 3 +2 ABC 4 +4 ABC 4 +drop table if exists t2 ; +create table t2 as select * from t1 ; +set @query1= 'SELECT * FROM t2 join t1 on (t1.a=t2.a) order by t2.a ' ; +set @query2= 'SELECT * FROM t2 natural join t1 order by t2.a ' ; +set @query3= 'SELECT * FROM t2 join t1 using(a) order by t2.a ' ; +set @query4= 'SELECT * FROM t2 left join t1 on(t1.a=t2.a) order by t2.a ' ; +set @query5= 'SELECT * FROM t2 natural left join t1 order by t2.a ' ; +set @query6= 'SELECT * FROM t2 left join t1 using(a) order by t2.a ' ; +set @query7= 'SELECT * FROM t2 right join t1 on(t1.a=t2.a) order by t2.a ' ; +set @query8= 'SELECT * FROM t2 natural right join t1 order by t2.a ' ; +set @query9= 'SELECT * FROM t2 right join t1 using(a) order by t2.a ' ; +the join statement is: +SELECT * FROM t2 right join t1 using(a) order by t2.a +prepare stmt1 from @query9 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +the join statement is: +SELECT * FROM t2 natural right join t1 order by t2.a +prepare stmt1 from @query8 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +the join statement is: +SELECT * FROM t2 right join t1 on(t1.a=t2.a) order by t2.a +prepare stmt1 from @query7 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +the join statement is: +SELECT * FROM t2 left join t1 using(a) order by t2.a +prepare stmt1 from @query6 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +the join statement is: +SELECT * FROM t2 natural left join t1 order by t2.a +prepare stmt1 from @query5 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +the join statement is: +SELECT * FROM t2 left join t1 on(t1.a=t2.a) order by t2.a +prepare stmt1 from @query4 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +the join statement is: +SELECT * FROM t2 join t1 using(a) order by t2.a +prepare stmt1 from @query3 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +the join statement is: +SELECT * FROM t2 natural join t1 order by t2.a +prepare stmt1 from @query2 ; +execute stmt1 ; +a b +1 one +2 two +3 three +4 four +execute stmt1 ; +a b +1 one +2 two +3 three +4 four +execute stmt1 ; +a b +1 one +2 two +3 three +4 four +the join statement is: +SELECT * FROM t2 join t1 on (t1.a=t2.a) order by t2.a +prepare stmt1 from @query1 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +drop table t2 ; +test_sequence +------ subquery tests ------ +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where b = ''two'') '; +execute stmt1 ; +a b +2 two +set @arg00='two' ; +select a, b FROM t1 outer_table where +a = (select a from t1 where b = 'two' ) and b=@arg00 ; +a b +2 two +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where b = ''two'') and b=? '; +execute stmt1 using @arg00; +a b +2 two +set @arg00='two' ; +select a, b FROM t1 outer_table where +a = (select a from t1 where b = @arg00 ) and b='two' ; +a b +2 two +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where b = ? ) and b=''two'' ' ; +execute stmt1 using @arg00; +a b +2 two +set @arg00=3 ; +set @arg01='three' ; +select a,b FROM t1 where (a,b) in (select 3, 'three'); +a b +3 three +select a FROM t1 where (a,b) in (select @arg00,@arg01); +a +3 +prepare stmt1 from ' select a FROM t1 where (a,b) in (select ?, ?) '; +execute stmt1 using @arg00, @arg01; +a +3 +set @arg00=1 ; +set @arg01='two' ; +set @arg02=2 ; +set @arg03='two' ; +select a, @arg00, b FROM t1 outer_table where +b=@arg01 and a = (select @arg02 from t1 where b = @arg03 ) ; +a @arg00 b +2 1 two +prepare stmt1 from ' select a, ?, b FROM t1 outer_table where + b=? and a = (select ? from t1 where b = ? ) ' ; +execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; +a ? b +2 1 two +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where b = outer_table.b ) order by a '; +execute stmt1 ; +a b +1 one +2 two +3 three +4 four +prepare stmt1 from ' SELECT a as ccc from t1 where a+1= + (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) '; +execute stmt1 ; +ccc +1 +deallocate prepare stmt1 ; +prepare stmt1 from ' SELECT a as ccc from t1 where a+1= + (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) '; +execute stmt1 ; +ccc +1 +deallocate prepare stmt1 ; +prepare stmt1 from ' SELECT a as ccc from t1 where a+1= + (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) '; +execute stmt1 ; +ccc +1 +deallocate prepare stmt1 ; +set @arg00='two' ; +select a, b FROM t1 outer_table where +a = (select a from t1 where b = outer_table.b ) and b=@arg00 ; +a b +2 two +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where b = outer_table.b) and b=? '; +execute stmt1 using @arg00; +a b +2 two +set @arg00=2 ; +select a, b FROM t1 outer_table where +a = (select a from t1 where a = @arg00 and b = outer_table.b) and b='two' ; +a b +2 two +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where a = ? and b = outer_table.b) and b=''two'' ' ; +execute stmt1 using @arg00; +a b +2 two +set @arg00=2 ; +select a, b FROM t1 outer_table where +a = (select a from t1 where outer_table.a = @arg00 and a=2) and b='two' ; +a b +2 two +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where outer_table.a = ? and a=2) and b=''two'' ' ; +execute stmt1 using @arg00; +a b +2 two +set @arg00=1 ; +set @arg01='two' ; +set @arg02=2 ; +set @arg03='two' ; +select a, @arg00, b FROM t1 outer_table where +b=@arg01 and a = (select @arg02 from t1 where outer_table.b = @arg03 +and outer_table.a=a ) ; +a @arg00 b +2 1 two +prepare stmt1 from ' select a, ?, b FROM t1 outer_table where + b=? and a = (select ? from t1 where outer_table.b = ? + and outer_table.a=a ) ' ; +execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; +a ? b +2 1 two +set @arg00=1 ; +set @arg01=0 ; +select a, @arg00 +from ( select a - @arg00 as a from t1 where a=@arg00 ) as t2 +where a=@arg01; +a @arg00 +0 1 +prepare stmt1 from ' select a, ? + from ( select a - ? as a from t1 where a=? ) as t2 + where a=? '; +execute stmt1 using @arg00, @arg00, @arg00, @arg01 ; +a ? +0 1 +drop table if exists t2 ; +create table t2 as select * from t1; +prepare stmt1 from ' select a in (select a from t2) from t1 ' ; +execute stmt1 ; +a in (select a from t2) +1 +1 +1 +1 +drop table if exists t5, t6, t7 ; +create table t5 (a int , b int) ; +create table t6 like t5 ; +create table t7 like t5 ; +insert into t5 values (0, 100), (1, 2), (1, 3), (2, 2), (2, 7), +(2, -1), (3, 10) ; +insert into t6 values (0, 0), (1, 1), (2, 1), (3, 1), (4, 1) ; +insert into t7 values (3, 3), (2, 2), (1, 1) ; +prepare stmt1 from ' select a, (select count(distinct t5.b) as sum from t5, t6 + where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b + group by t5.a order by sum limit 1) from t7 ' ; +execute stmt1 ; +a (select count(distinct t5.b) as sum from t5, t6 + where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b + group by t5.a order by sum limit 1) +3 1 +2 2 +1 2 +execute stmt1 ; +a (select count(distinct t5.b) as sum from t5, t6 + where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b + group by t5.a order by sum limit 1) +3 1 +2 2 +1 2 +execute stmt1 ; +a (select count(distinct t5.b) as sum from t5, t6 + where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b + group by t5.a order by sum limit 1) +3 1 +2 2 +1 2 +drop table t5, t6, t7 ; +drop table if exists t2 ; +create table t2 as select * from t9; +set @stmt= ' SELECT + (SELECT SUM(c1 + c12 + 0.0) FROM t2 + where (t9.c2 - 0e-3) = t2.c2 + GROUP BY t9.c15 LIMIT 1) as scalar_s, + exists (select 1.0e+0 from t2 + where t2.c3 * 9.0000000000 = t9.c4) as exists_s, + c5 * 4 in (select c6 + 0.3e+1 from t2) as in_s, + (c7 - 4, c8 - 4) in (select c9 + 4.0, c10 + 40e-1 from t2) as in_row_s +FROM t9, +(select c25 x, c32 y from t2) tt WHERE x = c25 ' ; +prepare stmt1 from @stmt ; +execute stmt1 ; +execute stmt1 ; +set @stmt= concat('explain ',@stmt); +prepare stmt1 from @stmt ; +execute stmt1 ; +execute stmt1 ; +set @stmt= ' SELECT + (SELECT SUM(c1+c12+?) FROM t2 where (t9.c2-?)=t2.c2 + GROUP BY t9.c15 LIMIT 1) as scalar_s, + exists (select ? from t2 + where t2.c3*?=t9.c4) as exists_s, + c5*? in (select c6+? from t2) as in_s, + (c7-?, c8-?) in (select c9+?, c10+? from t2) as in_row_s +FROM t9, +(select c25 x, c32 y from t2) tt WHERE x =c25 ' ; +set @arg00= 0.0 ; +set @arg01= 0e-3 ; +set @arg02= 1.0e+0 ; +set @arg03= 9.0000000000 ; +set @arg04= 4 ; +set @arg05= 0.3e+1 ; +set @arg06= 4 ; +set @arg07= 4 ; +set @arg08= 4.0 ; +set @arg09= 40e-1 ; +prepare stmt1 from @stmt ; +execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, +@arg07, @arg08, @arg09 ; +execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, +@arg07, @arg08, @arg09 ; +set @stmt= concat('explain ',@stmt); +prepare stmt1 from @stmt ; +execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, +@arg07, @arg08, @arg09 ; +execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, +@arg07, @arg08, @arg09 ; +drop table t2 ; +select 1 < (select a from t1) ; +ERROR 21000: Subquery returns more than 1 row +prepare stmt1 from ' select 1 < (select a from t1) ' ; +execute stmt1 ; +ERROR 21000: Subquery returns more than 1 row +select 1 as my_col ; +my_col +1 +test_sequence +------ union tests ------ +prepare stmt1 from ' select a FROM t1 where a=1 + union distinct + select a FROM t1 where a=1 '; +execute stmt1 ; +a +1 +execute stmt1 ; +a +1 +prepare stmt1 from ' select a FROM t1 where a=1 + union all + select a FROM t1 where a=1 '; +execute stmt1 ; +a +1 +1 +prepare stmt1 from ' SELECT 1, 2 union SELECT 1 ' ; +ERROR 21000: The used SELECT statements have a different number of columns +prepare stmt1 from ' SELECT 1 union SELECT 1, 2 ' ; +ERROR 21000: The used SELECT statements have a different number of columns +prepare stmt1 from ' SELECT * from t1 union SELECT 1 ' ; +ERROR 21000: The used SELECT statements have a different number of columns +prepare stmt1 from ' SELECT 1 union SELECT * from t1 ' ; +ERROR 21000: The used SELECT statements have a different number of columns +set @arg00=1 ; +select @arg00 FROM t1 where a=1 +union distinct +select 1 FROM t1 where a=1; +@arg00 +1 +prepare stmt1 from ' select ? FROM t1 where a=1 + union distinct + select 1 FROM t1 where a=1 ' ; +execute stmt1 using @arg00; +? +1 +set @arg00=1 ; +select 1 FROM t1 where a=1 +union distinct +select @arg00 FROM t1 where a=1; +1 +1 +prepare stmt1 from ' select 1 FROM t1 where a=1 + union distinct + select ? FROM t1 where a=1 ' ; +execute stmt1 using @arg00; +1 +1 +set @arg00='a' ; +select @arg00 FROM t1 where a=1 +union distinct +select @arg00 FROM t1 where a=1; +@arg00 +a +prepare stmt1 from ' select ? FROM t1 where a=1 + union distinct + select ? FROM t1 where a=1 '; +execute stmt1 using @arg00, @arg00; +? +a +prepare stmt1 from ' select ? + union distinct + select ? '; +execute stmt1 using @arg00, @arg00; +? +a +set @arg00='a' ; +set @arg01=1 ; +set @arg02='a' ; +set @arg03=2 ; +select @arg00 FROM t1 where a=@arg01 +union distinct +select @arg02 FROM t1 where a=@arg03; +@arg00 +a +prepare stmt1 from ' select ? FROM t1 where a=? + union distinct + select ? FROM t1 where a=? ' ; +execute stmt1 using @arg00, @arg01, @arg02, @arg03; +? +a +set @arg00=1 ; +prepare stmt1 from ' select sum(a) + 200, ? from t1 +union distinct +select sum(a) + 200, 1 from t1 +group by b ' ; +execute stmt1 using @arg00; +sum(a) + 200 ? +210 1 +204 1 +201 1 +203 1 +202 1 +set @Oporto='Oporto' ; +set @Lisboa='Lisboa' ; +set @0=0 ; +set @1=1 ; +set @2=2 ; +set @3=3 ; +set @4=4 ; +select @Oporto,@Lisboa,@0,@1,@2,@3,@4 ; +@Oporto @Lisboa @0 @1 @2 @3 @4 +Oporto Lisboa 0 1 2 3 4 +select sum(a) + 200 as the_sum, @Oporto as the_town from t1 +group by b +union distinct +select sum(a) + 200, @Lisboa from t1 +group by b ; +the_sum the_town +204 Oporto +201 Oporto +203 Oporto +202 Oporto +204 Lisboa +201 Lisboa +203 Lisboa +202 Lisboa +prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1 + group by b + union distinct + select sum(a) + 200, ? from t1 + group by b ' ; +execute stmt1 using @Oporto, @Lisboa; +the_sum the_town +204 Oporto +201 Oporto +203 Oporto +202 Oporto +204 Lisboa +201 Lisboa +203 Lisboa +202 Lisboa +select sum(a) + 200 as the_sum, @Oporto as the_town from t1 +where a > @1 +group by b +union distinct +select sum(a) + 200, @Lisboa from t1 +where a > @2 +group by b ; +the_sum the_town +204 Oporto +203 Oporto +202 Oporto +204 Lisboa +203 Lisboa +prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1 + where a > ? + group by b + union distinct + select sum(a) + 200, ? from t1 + where a > ? + group by b ' ; +execute stmt1 using @Oporto, @1, @Lisboa, @2; +the_sum the_town +204 Oporto +203 Oporto +202 Oporto +204 Lisboa +203 Lisboa +select sum(a) + 200 as the_sum, @Oporto as the_town from t1 +where a > @1 +group by b +having avg(a) > @2 +union distinct +select sum(a) + 200, @Lisboa from t1 +where a > @2 +group by b +having avg(a) > @3; +the_sum the_town +204 Oporto +203 Oporto +204 Lisboa +prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1 + where a > ? + group by b + having avg(a) > ? + union distinct + select sum(a) + 200, ? from t1 + where a > ? + group by b + having avg(a) > ? '; +execute stmt1 using @Oporto, @1, @2, @Lisboa, @2, @3; +the_sum the_town +204 Oporto +203 Oporto +204 Lisboa +test_sequence +------ explain select tests ------ +prepare stmt1 from ' explain select * from t9 ' ; +execute stmt1; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def id 8 3 1 N 32801 0 8 +def select_type 253 19 6 N 1 31 33 +def table 253 64 2 N 1 31 33 +def type 253 10 3 N 1 31 33 +def possible_keys 253 4096 0 Y 0 31 33 +def key 253 64 0 Y 0 31 33 +def key_len 8 3 0 Y 32800 0 8 +def ref 253 1024 0 Y 0 31 33 +def rows 8 10 1 N 32801 0 8 +def Extra 253 255 0 N 1 31 33 +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t9 ALL NULL NULL NULL NULL 2 +test_sequence +------ delete tests ------ +delete from t1 ; +insert into t1 values (1,'one'); +insert into t1 values (2,'two'); +insert into t1 values (3,'three'); +insert into t1 values (4,'four'); +commit ; +delete from t9 ; +insert into t9 +set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, +c10= 1, c11= 1, c12 = 1, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=true, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; +insert into t9 +set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, +c10= 9, c11= 9, c12 = 9, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=false, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +commit ; +prepare stmt1 from 'delete from t1 where a=2' ; +execute stmt1; +select a,b from t1 where a=2; +a b +execute stmt1; +insert into t1 values(0,NULL); +set @arg00=NULL; +prepare stmt1 from 'delete from t1 where b=?' ; +execute stmt1 using @arg00; +select a,b from t1 where b is NULL ; +a b +0 NULL +set @arg00='one'; +execute stmt1 using @arg00; +select a,b from t1 where b=@arg00; +a b +prepare stmt1 from 'truncate table t1' ; +ERROR HY000: This command is not supported in the prepared statement protocol yet +test_sequence +------ update tests ------ +delete from t1 ; +insert into t1 values (1,'one'); +insert into t1 values (2,'two'); +insert into t1 values (3,'three'); +insert into t1 values (4,'four'); +commit ; +delete from t9 ; +insert into t9 +set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, +c10= 1, c11= 1, c12 = 1, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=true, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; +insert into t9 +set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, +c10= 9, c11= 9, c12 = 9, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=false, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +commit ; +prepare stmt1 from 'update t1 set b=''a=two'' where a=2' ; +execute stmt1; +select a,b from t1 where a=2; +a b +2 a=two +execute stmt1; +select a,b from t1 where a=2; +a b +2 a=two +set @arg00=NULL; +prepare stmt1 from 'update t1 set b=? where a=2' ; +execute stmt1 using @arg00; +select a,b from t1 where a=2; +a b +2 NULL +set @arg00='two'; +execute stmt1 using @arg00; +select a,b from t1 where a=2; +a b +2 two +set @arg00=2; +prepare stmt1 from 'update t1 set b=NULL where a=?' ; +execute stmt1 using @arg00; +select a,b from t1 where a=@arg00; +a b +2 NULL +update t1 set b='two' where a=@arg00; +set @arg00=2000; +execute stmt1 using @arg00; +select a,b from t1 where a=@arg00; +a b +set @arg00=2; +set @arg01=22; +prepare stmt1 from 'update t1 set a=? where a=?' ; +execute stmt1 using @arg00, @arg00; +select a,b from t1 where a=@arg00; +a b +2 two +execute stmt1 using @arg01, @arg00; +select a,b from t1 where a=@arg01; +a b +22 two +execute stmt1 using @arg00, @arg01; +select a,b from t1 where a=@arg00; +a b +2 two +set @arg00=NULL; +set @arg01=2; +execute stmt1 using @arg00, @arg01; +Warnings: +Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 1 +select a,b from t1 order by a; +a b +0 two +1 one +3 three +4 four +set @arg00=0; +execute stmt1 using @arg01, @arg00; +select a,b from t1 order by a; +a b +1 one +2 two +3 three +4 four +set @arg00=23; +set @arg01='two'; +set @arg02=2; +set @arg03='two'; +set @arg04=2; +drop table if exists t2; +create table t2 as select a,b from t1 ; +prepare stmt1 from 'update t1 set a=? where b=? + and a in (select ? from t2 + where b = ? or a = ?)'; +execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04 ; +affected rows: 1 +info: Rows matched: 1 Changed: 1 Warnings: 0 +select a,b from t1 where a = @arg00 ; +a b +23 two +prepare stmt1 from 'update t1 set a=? where b=? + and a not in (select ? from t2 + where b = ? or a = ?)'; +execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ; +affected rows: 1 +info: Rows matched: 1 Changed: 1 Warnings: 0 +select a,b from t1 order by a ; +a b +1 one +2 two +3 three +4 four +drop table t2 ; +create table t2 +( +a int, b varchar(30), +primary key(a) +) engine = 'MYISAM' ; +insert into t2(a,b) select a, b from t1 ; +prepare stmt1 from 'update t1 set a=? where b=? + and a in (select ? from t2 + where b = ? or a = ?)'; +execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04 ; +affected rows: 1 +info: Rows matched: 1 Changed: 1 Warnings: 0 +select a,b from t1 where a = @arg00 ; +a b +23 two +prepare stmt1 from 'update t1 set a=? where b=? + and a not in (select ? from t2 + where b = ? or a = ?)'; +execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ; +affected rows: 1 +info: Rows matched: 1 Changed: 1 Warnings: 0 +select a,b from t1 order by a ; +a b +1 one +2 two +3 three +4 four +drop table t2 ; +set @arg00=1; +prepare stmt1 from 'update t1 set b=''bla'' +where a=2 +limit 1'; +execute stmt1 ; +select a,b from t1 where b = 'bla' ; +a b +2 bla +prepare stmt1 from 'update t1 set b=''bla'' +where a=2 +limit ?'; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?' at line 3 +test_sequence +------ insert tests ------ +delete from t1 ; +insert into t1 values (1,'one'); +insert into t1 values (2,'two'); +insert into t1 values (3,'three'); +insert into t1 values (4,'four'); +commit ; +delete from t9 ; +insert into t9 +set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, +c10= 1, c11= 1, c12 = 1, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=true, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; +insert into t9 +set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, +c10= 9, c11= 9, c12 = 9, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=false, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +commit ; +prepare stmt1 from 'insert into t1 values(5, ''five'' )'; +execute stmt1; +select a,b from t1 where a = 5; +a b +5 five +set @arg00='six' ; +prepare stmt1 from 'insert into t1 values(6, ? )'; +execute stmt1 using @arg00; +select a,b from t1 where b = @arg00; +a b +6 six +execute stmt1 using @arg00; +ERROR 23000: Duplicate entry '6' for key 1 +set @arg00=NULL ; +prepare stmt1 from 'insert into t1 values(0, ? )'; +execute stmt1 using @arg00; +select a,b from t1 where b is NULL; +a b +0 NULL +set @arg00=8 ; +set @arg01='eight' ; +prepare stmt1 from 'insert into t1 values(?, ? )'; +execute stmt1 using @arg00, @arg01 ; +select a,b from t1 where b = @arg01; +a b +8 eight +set @NULL= null ; +set @arg00= 'abc' ; +execute stmt1 using @NULL, @NULL ; +ERROR 23000: Column 'a' cannot be null +execute stmt1 using @NULL, @NULL ; +ERROR 23000: Column 'a' cannot be null +execute stmt1 using @NULL, @arg00 ; +ERROR 23000: Column 'a' cannot be null +execute stmt1 using @NULL, @arg00 ; +ERROR 23000: Column 'a' cannot be null +set @arg01= 10000 + 2 ; +execute stmt1 using @arg01, @arg00 ; +set @arg01= 10000 + 1 ; +execute stmt1 using @arg01, @arg00 ; +select * from t1 where a > 10000 order by a ; +a b +10001 abc +10002 abc +delete from t1 where a > 10000 ; +set @arg01= 10000 + 2 ; +execute stmt1 using @arg01, @NULL ; +set @arg01= 10000 + 1 ; +execute stmt1 using @arg01, @NULL ; +select * from t1 where a > 10000 order by a ; +a b +10001 NULL +10002 NULL +delete from t1 where a > 10000 ; +set @arg01= 10000 + 10 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 9 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 8 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 7 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 6 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 5 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 4 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 3 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 2 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 1 ; +execute stmt1 using @arg01, @arg01 ; +select * from t1 where a > 10000 order by a ; +a b +10001 10001 +10002 10002 +10003 10003 +10004 10004 +10005 10005 +10006 10006 +10007 10007 +10008 10008 +10009 10009 +10010 10010 +delete from t1 where a > 10000 ; +set @arg00=81 ; +set @arg01='8-1' ; +set @arg02=82 ; +set @arg03='8-2' ; +prepare stmt1 from 'insert into t1 values(?,?),(?,?)'; +execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; +select a,b from t1 where a in (@arg00,@arg02) ; +a b +81 8-1 +82 8-2 +set @arg00=9 ; +set @arg01='nine' ; +prepare stmt1 from 'insert into t1 set a=?, b=? '; +execute stmt1 using @arg00, @arg01 ; +select a,b from t1 where a = @arg00 ; +a b +9 nine +set @arg00=6 ; +set @arg01=1 ; +prepare stmt1 from 'insert into t1 set a=?, b=''sechs'' + on duplicate key update a=a + ?, b=concat(b,''modified'') '; +execute stmt1 using @arg00, @arg01; +select * from t1 order by a; +a b +0 NULL +1 one +2 two +3 three +4 four +5 five +7 sixmodified +8 eight +9 nine +81 8-1 +82 8-2 +set @arg00=81 ; +set @arg01=1 ; +execute stmt1 using @arg00, @arg01; +ERROR 23000: Duplicate entry '82' for key 1 +drop table if exists t2 ; +create table t2 (id int auto_increment primary key) +ENGINE= 'MYISAM' ; +prepare stmt1 from ' select last_insert_id() ' ; +insert into t2 values (NULL) ; +execute stmt1 ; +last_insert_id() +1 +insert into t2 values (NULL) ; +execute stmt1 ; +last_insert_id() +2 +drop table t2 ; +set @1000=1000 ; +set @x1000_2="x1000_2" ; +set @x1000_3="x1000_3" ; +set @x1000="x1000" ; +set @1100=1100 ; +set @x1100="x1100" ; +set @100=100 ; +set @updated="updated" ; +insert into t1 values(1000,'x1000_1') ; +insert into t1 values(@1000,@x1000_2),(@1000,@x1000_3) +on duplicate key update a = a + @100, b = concat(b,@updated) ; +select a,b from t1 where a >= 1000 order by a ; +a b +1000 x1000_3 +1100 x1000_1updated +delete from t1 where a >= 1000 ; +insert into t1 values(1000,'x1000_1') ; +prepare stmt1 from ' insert into t1 values(?,?),(?,?) + on duplicate key update a = a + ?, b = concat(b,?) '; +execute stmt1 using @1000, @x1000_2, @1000, @x1000_3, @100, @updated ; +select a,b from t1 where a >= 1000 order by a ; +a b +1000 x1000_3 +1100 x1000_1updated +delete from t1 where a >= 1000 ; +insert into t1 values(1000,'x1000_1') ; +execute stmt1 using @1000, @x1000_2, @1100, @x1000_3, @100, @updated ; +select a,b from t1 where a >= 1000 order by a ; +a b +1200 x1000_1updatedupdated +delete from t1 where a >= 1000 ; +prepare stmt1 from ' replace into t1 (a,b) select 100, ''hundred'' '; +execute stmt1; +execute stmt1; +execute stmt1; +test_sequence +------ multi table tests ------ +delete from t1 ; +delete from t9 ; +insert into t1(a,b) values (1, 'one'), (2, 'two'), (3, 'three') ; +insert into t9 (c1,c21) +values (1, 'one'), (2, 'two'), (3, 'three') ; +prepare stmt_delete from " delete t1, t9 + from t1, t9 where t1.a=t9.c1 and t1.b='updated' "; +prepare stmt_update from " update t1, t9 + set t1.b='updated', t9.c21='updated' + where t1.a=t9.c1 and t1.a=? "; +prepare stmt_select1 from " select a, b from t1 order by a" ; +prepare stmt_select2 from " select c1, c21 from t9 order by c1" ; +set @arg00= 1 ; +execute stmt_update using @arg00 ; +execute stmt_delete ; +execute stmt_select1 ; +a b +2 two +3 three +execute stmt_select2 ; +c1 c21 +2 two +3 three +set @arg00= @arg00 + 1 ; +execute stmt_update using @arg00 ; +execute stmt_delete ; +execute stmt_select1 ; +a b +3 three +execute stmt_select2 ; +c1 c21 +3 three +set @arg00= @arg00 + 1 ; +execute stmt_update using @arg00 ; +execute stmt_delete ; +execute stmt_select1 ; +a b +execute stmt_select2 ; +c1 c21 +set @arg00= @arg00 + 1 ; +drop table if exists t5 ; +set @arg01= 8; +set @arg02= 8.0; +set @arg03= 80.00000000000e-1; +set @arg04= 'abc' ; +set @arg05= CAST('abc' as binary) ; +set @arg06= '1991-08-05' ; +set @arg07= CAST('1991-08-05' as date); +set @arg08= '1991-08-05 01:01:01' ; +set @arg09= CAST('1991-08-05 01:01:01' as datetime) ; +set @arg10= unix_timestamp('1991-01-01 01:01:01'); +set @arg11= YEAR('1991-01-01 01:01:01'); +set @arg12= 8 ; +set @arg12= NULL ; +set @arg13= 8.0 ; +set @arg13= NULL ; +set @arg14= 'abc'; +set @arg14= NULL ; +set @arg15= CAST('abc' as binary) ; +set @arg15= NULL ; +create table t5 as select +8 as const01, @arg01 as param01, +8.0 as const02, @arg02 as param02, +80.00000000000e-1 as const03, @arg03 as param03, +'abc' as const04, @arg04 as param04, +CAST('abc' as binary) as const05, @arg05 as param05, +'1991-08-05' as const06, @arg06 as param06, +CAST('1991-08-05' as date) as const07, @arg07 as param07, +'1991-08-05 01:01:01' as const08, @arg08 as param08, +CAST('1991-08-05 01:01:01' as datetime) as const09, @arg09 as param09, +unix_timestamp('1991-01-01 01:01:01') as const10, @arg10 as param10, +YEAR('1991-01-01 01:01:01') as const11, @arg11 as param11, +NULL as const12, @arg12 as param12, +@arg13 as param13, +@arg14 as param14, +@arg15 as param15; +show create table t5 ; +Table Create Table +t5 CREATE TABLE `t5` ( + `const01` bigint(1) NOT NULL default '0', + `param01` bigint(20) default NULL, + `const02` double(3,1) NOT NULL default '0.0', + `param02` double default NULL, + `const03` double NOT NULL default '0', + `param03` double default NULL, + `const04` char(3) NOT NULL default '', + `param04` longtext, + `const05` binary(3) NOT NULL default '', + `param05` longblob, + `const06` varchar(10) NOT NULL default '', + `param06` longtext, + `const07` date default NULL, + `param07` longblob, + `const08` varchar(19) NOT NULL default '', + `param08` longtext, + `const09` datetime default NULL, + `param09` longblob, + `const10` int(10) NOT NULL default '0', + `param10` bigint(20) default NULL, + `const11` int(4) default NULL, + `param11` bigint(20) default NULL, + `const12` binary(0) default NULL, + `param12` bigint(20) default NULL, + `param13` double default NULL, + `param14` longtext, + `param15` longblob +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select * from t5 ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def test t5 t5 const01 const01 8 1 1 N 32769 0 63 +def test t5 t5 param01 param01 8 20 1 Y 32768 0 63 +def test t5 t5 const02 const02 5 3 3 N 32769 1 63 +def test t5 t5 param02 param02 5 20 1 Y 32768 31 63 +def test t5 t5 const03 const03 5 23 1 N 32769 31 63 +def test t5 t5 param03 param03 5 20 1 Y 32768 31 63 +def test t5 t5 const04 const04 254 3 3 N 1 0 8 +def test t5 t5 param04 param04 252 16777215 3 Y 16 0 8 +def test t5 t5 const05 const05 254 3 3 N 129 0 63 +def test t5 t5 param05 param05 252 16777215 3 Y 144 0 63 +def test t5 t5 const06 const06 253 10 10 N 1 0 8 +def test t5 t5 param06 param06 252 16777215 10 Y 16 0 8 +def test t5 t5 const07 const07 10 10 10 Y 128 0 63 +def test t5 t5 param07 param07 252 16777215 10 Y 144 0 63 +def test t5 t5 const08 const08 253 19 19 N 1 0 8 +def test t5 t5 param08 param08 252 16777215 19 Y 16 0 8 +def test t5 t5 const09 const09 12 19 19 Y 128 0 63 +def test t5 t5 param09 param09 252 16777215 19 Y 144 0 63 +def test t5 t5 const10 const10 3 10 9 N 32769 0 63 +def test t5 t5 param10 param10 8 20 9 Y 32768 0 63 +def test t5 t5 const11 const11 3 4 4 Y 32768 0 63 +def test t5 t5 param11 param11 8 20 4 Y 32768 0 63 +def test t5 t5 const12 const12 254 0 0 Y 128 0 63 +def test t5 t5 param12 param12 8 20 0 Y 32768 0 63 +def test t5 t5 param13 param13 5 20 0 Y 32768 31 63 +def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8 +def test t5 t5 param15 param15 252 16777215 0 Y 144 0 63 +const01 8 +param01 8 +const02 8.0 +param02 8 +const03 8 +param03 8 +const04 abc +param04 abc +const05 abc +param05 abc +const06 1991-08-05 +param06 1991-08-05 +const07 1991-08-05 +param07 1991-08-05 +const08 1991-08-05 01:01:01 +param08 1991-08-05 01:01:01 +const09 1991-08-05 01:01:01 +param09 1991-08-05 01:01:01 +const10 662680861 +param10 662680861 +const11 1991 +param11 1991 +const12 NULL +param12 NULL +param13 NULL +param14 NULL +param15 NULL +drop table t5 ; +test_sequence +------ data type conversion tests ------ +delete from t1 ; +insert into t1 values (1,'one'); +insert into t1 values (2,'two'); +insert into t1 values (3,'three'); +insert into t1 values (4,'four'); +commit ; +delete from t9 ; +insert into t9 +set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, +c10= 1, c11= 1, c12 = 1, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=true, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; +insert into t9 +set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, +c10= 9, c11= 9, c12 = 9, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=false, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +commit ; +insert into t9 set c1= 0, c15= '1991-01-01 01:01:01' ; +select * from t9 order by c1 ; +c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday +test_sequence +------ select @parameter:= column ------ +prepare full_info from "select @arg01, @arg02, @arg03, @arg04, + @arg05, @arg06, @arg07, @arg08, + @arg09, @arg10, @arg11, @arg12, + @arg13, @arg14, @arg15, @arg16, + @arg17, @arg18, @arg19, @arg20, + @arg21, @arg22, @arg23, @arg24, + @arg25, @arg26, @arg27, @arg28, + @arg29, @arg30, @arg31, @arg32" ; +select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, +@arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8, +@arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12, +@arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16, +@arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20, +@arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24, +@arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28, +@arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32 +from t9 where c1= 1 ; +@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 +1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 1 Y 128 31 63 +def @arg03 254 20 1 Y 128 31 63 +def @arg04 254 20 1 Y 128 31 63 +def @arg05 254 20 1 Y 128 31 63 +def @arg06 254 20 1 Y 128 31 63 +def @arg07 254 20 1 Y 128 31 63 +def @arg08 254 20 1 Y 128 31 63 +def @arg09 254 20 1 Y 128 31 63 +def @arg10 254 20 1 Y 128 31 63 +def @arg11 254 20 1 Y 128 31 63 +def @arg12 254 20 1 Y 128 31 63 +def @arg13 254 8192 10 Y 128 31 63 +def @arg14 254 8192 19 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 8 Y 128 31 63 +def @arg17 254 20 4 Y 128 31 63 +def @arg18 254 20 1 Y 128 31 63 +def @arg19 254 20 1 Y 128 31 63 +def @arg20 254 8192 1 Y 0 31 8 +def @arg21 254 8192 10 Y 0 31 8 +def @arg22 254 8192 30 Y 0 31 8 +def @arg23 254 8192 8 Y 128 31 63 +def @arg24 254 8192 8 Y 0 31 8 +def @arg25 254 8192 4 Y 128 31 63 +def @arg26 254 8192 4 Y 0 31 8 +def @arg27 254 8192 10 Y 128 31 63 +def @arg28 254 8192 10 Y 0 31 8 +def @arg29 254 8192 8 Y 128 31 63 +def @arg30 254 8192 8 Y 0 31 8 +def @arg31 254 8192 3 Y 0 31 8 +def @arg32 254 8192 6 Y 128 31 63 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, +@arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8, +@arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12, +@arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16, +@arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20, +@arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24, +@arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28, +@arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32 +from t9 where c1= 0 ; +@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 0 Y 128 31 63 +def @arg03 254 20 0 Y 128 31 63 +def @arg04 254 20 0 Y 128 31 63 +def @arg05 254 20 0 Y 128 31 63 +def @arg06 254 20 0 Y 128 31 63 +def @arg07 254 20 0 Y 128 31 63 +def @arg08 254 20 0 Y 128 31 63 +def @arg09 254 20 0 Y 128 31 63 +def @arg10 254 20 0 Y 128 31 63 +def @arg11 254 20 0 Y 128 31 63 +def @arg12 254 20 0 Y 128 31 63 +def @arg13 254 8192 0 Y 128 31 63 +def @arg14 254 8192 0 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 0 Y 128 31 63 +def @arg17 254 20 0 Y 128 31 63 +def @arg18 254 20 0 Y 128 31 63 +def @arg19 254 20 0 Y 128 31 63 +def @arg20 254 8192 0 Y 0 31 8 +def @arg21 254 8192 0 Y 0 31 8 +def @arg22 254 8192 0 Y 0 31 8 +def @arg23 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 0 31 8 +def @arg25 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 0 31 8 +def @arg27 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 0 31 8 +def @arg29 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 0 31 8 +def @arg31 254 8192 0 Y 0 31 8 +def @arg32 254 8192 0 Y 0 31 8 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +prepare stmt1 from "select + @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, + @arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8, + @arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12, + @arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16, + @arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20, + @arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24, + @arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28, + @arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32 +from t9 where c1= ?" ; +set @my_key= 1 ; +execute stmt1 using @my_key ; +@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 +1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 1 Y 128 31 63 +def @arg03 254 20 1 Y 128 31 63 +def @arg04 254 20 1 Y 128 31 63 +def @arg05 254 20 1 Y 128 31 63 +def @arg06 254 20 1 Y 128 31 63 +def @arg07 254 20 1 Y 128 31 63 +def @arg08 254 20 1 Y 128 31 63 +def @arg09 254 20 1 Y 128 31 63 +def @arg10 254 20 1 Y 128 31 63 +def @arg11 254 20 1 Y 128 31 63 +def @arg12 254 20 1 Y 128 31 63 +def @arg13 254 8192 10 Y 128 31 63 +def @arg14 254 8192 19 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 8 Y 128 31 63 +def @arg17 254 20 4 Y 128 31 63 +def @arg18 254 20 1 Y 128 31 63 +def @arg19 254 20 1 Y 128 31 63 +def @arg20 254 8192 1 Y 0 31 8 +def @arg21 254 8192 10 Y 0 31 8 +def @arg22 254 8192 30 Y 0 31 8 +def @arg23 254 8192 8 Y 128 31 63 +def @arg24 254 8192 8 Y 0 31 8 +def @arg25 254 8192 4 Y 128 31 63 +def @arg26 254 8192 4 Y 0 31 8 +def @arg27 254 8192 10 Y 128 31 63 +def @arg28 254 8192 10 Y 0 31 8 +def @arg29 254 8192 8 Y 128 31 63 +def @arg30 254 8192 8 Y 0 31 8 +def @arg31 254 8192 3 Y 0 31 8 +def @arg32 254 8192 6 Y 128 31 63 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +set @my_key= 0 ; +execute stmt1 using @my_key ; +@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 0 Y 128 31 63 +def @arg03 254 20 0 Y 128 31 63 +def @arg04 254 20 0 Y 128 31 63 +def @arg05 254 20 0 Y 128 31 63 +def @arg06 254 20 0 Y 128 31 63 +def @arg07 254 20 0 Y 128 31 63 +def @arg08 254 20 0 Y 128 31 63 +def @arg09 254 20 0 Y 128 31 63 +def @arg10 254 20 0 Y 128 31 63 +def @arg11 254 20 0 Y 128 31 63 +def @arg12 254 20 0 Y 128 31 63 +def @arg13 254 8192 0 Y 128 31 63 +def @arg14 254 8192 0 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 0 Y 128 31 63 +def @arg17 254 20 0 Y 128 31 63 +def @arg18 254 20 0 Y 128 31 63 +def @arg19 254 20 0 Y 128 31 63 +def @arg20 254 8192 0 Y 0 31 8 +def @arg21 254 8192 0 Y 0 31 8 +def @arg22 254 8192 0 Y 0 31 8 +def @arg23 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 0 31 8 +def @arg25 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 0 31 8 +def @arg27 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 0 31 8 +def @arg29 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 0 31 8 +def @arg31 254 8192 0 Y 0 31 8 +def @arg32 254 8192 0 Y 0 31 8 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +prepare stmt1 from "select ? := c1 from t9 where c1= 1" ; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':= c1 from t9 where c1= 1' at line 1 +test_sequence +------ select column, .. into @parm,.. ------ +select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, +c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, +c25, c26, c27, c28, c29, c30, c31, c32 +into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, +@arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, +@arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24, +@arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 +from t9 where c1= 1 ; +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 1 Y 128 31 63 +def @arg03 254 20 1 Y 128 31 63 +def @arg04 254 20 1 Y 128 31 63 +def @arg05 254 20 1 Y 128 31 63 +def @arg06 254 20 1 Y 128 31 63 +def @arg07 254 20 1 Y 128 31 63 +def @arg08 254 20 1 Y 128 31 63 +def @arg09 254 20 1 Y 128 31 63 +def @arg10 254 20 1 Y 128 31 63 +def @arg11 254 20 1 Y 128 31 63 +def @arg12 254 20 1 Y 128 31 63 +def @arg13 254 8192 10 Y 128 31 63 +def @arg14 254 8192 19 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 8 Y 128 31 63 +def @arg17 254 20 4 Y 128 31 63 +def @arg18 254 20 1 Y 128 31 63 +def @arg19 254 20 1 Y 128 31 63 +def @arg20 254 8192 1 Y 0 31 8 +def @arg21 254 8192 10 Y 0 31 8 +def @arg22 254 8192 30 Y 0 31 8 +def @arg23 254 8192 8 Y 128 31 63 +def @arg24 254 8192 8 Y 0 31 8 +def @arg25 254 8192 4 Y 128 31 63 +def @arg26 254 8192 4 Y 0 31 8 +def @arg27 254 8192 10 Y 128 31 63 +def @arg28 254 8192 10 Y 0 31 8 +def @arg29 254 8192 8 Y 128 31 63 +def @arg30 254 8192 8 Y 0 31 8 +def @arg31 254 8192 3 Y 0 31 8 +def @arg32 254 8192 6 Y 128 31 63 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, +c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, +c25, c26, c27, c28, c29, c30, c31, c32 +into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, +@arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, +@arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24, +@arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 +from t9 where c1= 0 ; +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 0 Y 128 31 63 +def @arg03 254 20 0 Y 128 31 63 +def @arg04 254 20 0 Y 128 31 63 +def @arg05 254 20 0 Y 128 31 63 +def @arg06 254 20 0 Y 128 31 63 +def @arg07 254 20 0 Y 128 31 63 +def @arg08 254 20 0 Y 128 31 63 +def @arg09 254 20 0 Y 128 31 63 +def @arg10 254 20 0 Y 128 31 63 +def @arg11 254 20 0 Y 128 31 63 +def @arg12 254 20 0 Y 128 31 63 +def @arg13 254 8192 0 Y 128 31 63 +def @arg14 254 8192 0 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 0 Y 128 31 63 +def @arg17 254 20 0 Y 128 31 63 +def @arg18 254 20 0 Y 128 31 63 +def @arg19 254 20 0 Y 128 31 63 +def @arg20 254 8192 0 Y 0 31 8 +def @arg21 254 8192 0 Y 0 31 8 +def @arg22 254 8192 0 Y 0 31 8 +def @arg23 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 0 31 8 +def @arg25 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 0 31 8 +def @arg27 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 0 31 8 +def @arg29 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 0 31 8 +def @arg31 254 8192 0 Y 0 31 8 +def @arg32 254 8192 0 Y 0 31 8 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +prepare stmt1 from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, + c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, + c25, c26, c27, c28, c29, c30, c31, c32 +into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, + @arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, + @arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24, + @arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 +from t9 where c1= ?" ; +set @my_key= 1 ; +execute stmt1 using @my_key ; +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 1 Y 128 31 63 +def @arg03 254 20 1 Y 128 31 63 +def @arg04 254 20 1 Y 128 31 63 +def @arg05 254 20 1 Y 128 31 63 +def @arg06 254 20 1 Y 128 31 63 +def @arg07 254 20 1 Y 128 31 63 +def @arg08 254 20 1 Y 128 31 63 +def @arg09 254 20 1 Y 128 31 63 +def @arg10 254 20 1 Y 128 31 63 +def @arg11 254 20 1 Y 128 31 63 +def @arg12 254 20 1 Y 128 31 63 +def @arg13 254 8192 10 Y 128 31 63 +def @arg14 254 8192 19 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 8 Y 128 31 63 +def @arg17 254 20 4 Y 128 31 63 +def @arg18 254 20 1 Y 128 31 63 +def @arg19 254 20 1 Y 128 31 63 +def @arg20 254 8192 1 Y 0 31 8 +def @arg21 254 8192 10 Y 0 31 8 +def @arg22 254 8192 30 Y 0 31 8 +def @arg23 254 8192 8 Y 128 31 63 +def @arg24 254 8192 8 Y 0 31 8 +def @arg25 254 8192 4 Y 128 31 63 +def @arg26 254 8192 4 Y 0 31 8 +def @arg27 254 8192 10 Y 128 31 63 +def @arg28 254 8192 10 Y 0 31 8 +def @arg29 254 8192 8 Y 128 31 63 +def @arg30 254 8192 8 Y 0 31 8 +def @arg31 254 8192 3 Y 0 31 8 +def @arg32 254 8192 6 Y 128 31 63 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +set @my_key= 0 ; +execute stmt1 using @my_key ; +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 0 Y 128 31 63 +def @arg03 254 20 0 Y 128 31 63 +def @arg04 254 20 0 Y 128 31 63 +def @arg05 254 20 0 Y 128 31 63 +def @arg06 254 20 0 Y 128 31 63 +def @arg07 254 20 0 Y 128 31 63 +def @arg08 254 20 0 Y 128 31 63 +def @arg09 254 20 0 Y 128 31 63 +def @arg10 254 20 0 Y 128 31 63 +def @arg11 254 20 0 Y 128 31 63 +def @arg12 254 20 0 Y 128 31 63 +def @arg13 254 8192 0 Y 128 31 63 +def @arg14 254 8192 0 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 0 Y 128 31 63 +def @arg17 254 20 0 Y 128 31 63 +def @arg18 254 20 0 Y 128 31 63 +def @arg19 254 20 0 Y 128 31 63 +def @arg20 254 8192 0 Y 0 31 8 +def @arg21 254 8192 0 Y 0 31 8 +def @arg22 254 8192 0 Y 0 31 8 +def @arg23 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 0 31 8 +def @arg25 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 0 31 8 +def @arg27 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 0 31 8 +def @arg29 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 0 31 8 +def @arg31 254 8192 0 Y 0 31 8 +def @arg32 254 8192 0 Y 0 31 8 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +prepare stmt1 from "select c1 into ? from t9 where c1= 1" ; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? from t9 where c1= 1' at line 1 +test_sequence +-- insert into numeric columns -- +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20 ) ; +set @arg00= 21 ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt1 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22 )" ; +execute stmt1 ; +set @arg00= 23; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, +30.0, 30.0, 30.0 ) ; +set @arg00= 31.0 ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt1 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, + 32.0, 32.0, 32.0 )" ; +execute stmt1 ; +set @arg00= 33.0; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( '40', '40', '40', '40', '40', '40', '40', '40', +'40', '40', '40' ) ; +set @arg00= '41' ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt1 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( '42', '42', '42', '42', '42', '42', '42', '42', + '42', '42', '42' )" ; +execute stmt1 ; +set @arg00= '43'; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( CAST('50' as binary), CAST('50' as binary), +CAST('50' as binary), CAST('50' as binary), CAST('50' as binary), +CAST('50' as binary), CAST('50' as binary), CAST('50' as binary), +CAST('50' as binary), CAST('50' as binary), CAST('50' as binary) ) ; +set @arg00= CAST('51' as binary) ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt1 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( CAST('52' as binary), CAST('52' as binary), + CAST('52' as binary), CAST('52' as binary), CAST('52' as binary), + CAST('52' as binary), CAST('52' as binary), CAST('52' as binary), + CAST('52' as binary), CAST('52' as binary), CAST('52' as binary) )" ; +execute stmt1 ; +set @arg00= CAST('53' as binary) ; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +set @arg00= 2 ; +set @arg00= NULL ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( 60, NULL, NULL, NULL, NULL, NULL, NULL, NULL, +NULL, NULL, NULL ) ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( 61, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt1 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 62, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL )" ; +execute stmt1 ; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 63, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +set @arg00= 8.0 ; +set @arg00= NULL ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( 71, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 73, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +set @arg00= 'abc' ; +set @arg00= NULL ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( 81, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 83, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 +from t9 where c1 >= 20 +order by c1 ; +c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c12 +20 20 20 20 20 20 20 20 20 20 20.0000 +21 21 21 21 21 21 21 21 21 21 21.0000 +22 22 22 22 22 22 22 22 22 22 22.0000 +23 23 23 23 23 23 23 23 23 23 23.0000 +30 30 30 30 30 30 30 30 30 30 30.0000 +31 31 31 31 31 31 31 31 31 31 31.0000 +32 32 32 32 32 32 32 32 32 32 32.0000 +33 33 33 33 33 33 33 33 33 33 33.0000 +40 40 40 40 40 40 40 40 40 40 40.0000 +41 41 41 41 41 41 41 41 41 41 41.0000 +42 42 42 42 42 42 42 42 42 42 42.0000 +43 43 43 43 43 43 43 43 43 43 43.0000 +50 50 50 50 50 50 50 50 50 50 50.0000 +51 51 51 51 51 51 51 51 51 51 51.0000 +52 52 52 52 52 52 52 52 52 52 52.0000 +53 53 53 53 53 53 53 53 53 53 53.0000 +60 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +61 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +62 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +63 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +71 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +73 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +81 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +83 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +test_sequence +-- select .. where numeric column = .. -- +set @arg00= 20; +select 'true' as found from t9 +where c1= 20 and c2= 20 and c3= 20 and c4= 20 and c5= 20 and c6= 20 and c7= 20 +and c8= 20 and c9= 20 and c10= 20 and c12= 20; +found +true +select 'true' as found from t9 +where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 +and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 +and c12= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c2= 20 and c3= 20 and c4= 20 and c5= 20 and c6= 20 and c7= 20 + and c8= 20 and c9= 20 and c10= 20 and c12= 20 "; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? + and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? + and c12= ? "; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +found +true +set @arg00= 20.0; +select 'true' as found from t9 +where c1= 20.0 and c2= 20.0 and c3= 20.0 and c4= 20.0 and c5= 20.0 and c6= 20.0 +and c7= 20.0 and c8= 20.0 and c9= 20.0 and c10= 20.0 and c12= 20.0; +found +true +select 'true' as found from t9 +where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 +and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 +and c12= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20.0 and c2= 20.0 and c3= 20.0 and c4= 20.0 and c5= 20.0 and c6= 20.0 + and c7= 20.0 and c8= 20.0 and c9= 20.0 and c10= 20.0 and c12= 20.0 "; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? + and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? + and c12= ? "; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +found +true +select 'true' as found from t9 +where c1= '20' and c2= '20' and c3= '20' and c4= '20' and c5= '20' and c6= '20' + and c7= '20' and c8= '20' and c9= '20' and c10= '20' and c12= '20'; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= '20' and c2= '20' and c3= '20' and c4= '20' and c5= '20' and c6= '20' + and c7= '20' and c8= '20' and c9= '20' and c10= '20' and c12= '20' "; +execute stmt1 ; +found +true +set @arg00= '20'; +select 'true' as found from t9 +where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 +and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 +and c12= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? + and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? + and c12= ? "; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +found +true +select 'true' as found from t9 +where c1= CAST('20' as binary) and c2= CAST('20' as binary) and +c3= CAST('20' as binary) and c4= CAST('20' as binary) and +c5= CAST('20' as binary) and c6= CAST('20' as binary) and +c7= CAST('20' as binary) and c8= CAST('20' as binary) and +c9= CAST('20' as binary) and c10= CAST('20' as binary) and +c12= CAST('20' as binary); +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= CAST('20' as binary) and c2= CAST('20' as binary) and + c3= CAST('20' as binary) and c4= CAST('20' as binary) and + c5= CAST('20' as binary) and c6= CAST('20' as binary) and + c7= CAST('20' as binary) and c8= CAST('20' as binary) and + c9= CAST('20' as binary) and c10= CAST('20' as binary) and + c12= CAST('20' as binary) "; +execute stmt1 ; +found +true +set @arg00= CAST('20' as binary) ; +select 'true' as found from t9 +where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 +and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 +and c12= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? + and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? + and c12= ? "; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +found +true +delete from t9 ; +test_sequence +-- some numeric overflow experiments -- +prepare my_insert from "insert into t9 + ( c21, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 'O', ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +prepare my_select from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 +from t9 where c21 = 'O' "; +prepare my_delete from "delete from t9 where c21 = 'O' "; +set @arg00= 9223372036854775807 ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1264 Data truncated; out of range for column 'c1' at row 1 +Warning 1264 Data truncated; out of range for column 'c2' at row 1 +Warning 1264 Data truncated; out of range for column 'c3' at row 1 +Warning 1264 Data truncated; out of range for column 'c4' at row 1 +Warning 1264 Data truncated; out of range for column 'c5' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 127 +c2 32767 +c3 8388607 +c4 2147483647 +c5 2147483647 +c6 9223372036854775807 +c7 9.22337e+18 +c8 9.22337203685478e+18 +c9 9.22337203685478e+18 +c10 9.22337203685478e+18 +c12 99999.9999 +execute my_delete ; +set @arg00= '9223372036854775807' ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1264 Data truncated; out of range for column 'c1' at row 1 +Warning 1264 Data truncated; out of range for column 'c2' at row 1 +Warning 1264 Data truncated; out of range for column 'c3' at row 1 +Warning 1265 Data truncated for column 'c4' at row 1 +Warning 1265 Data truncated for column 'c5' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 127 +c2 32767 +c3 8388607 +c4 2147483647 +c5 2147483647 +c6 9223372036854775807 +c7 9.22337e+18 +c8 9.22337203685478e+18 +c9 9.22337203685478e+18 +c10 9.22337203685478e+18 +c12 99999.9999 +execute my_delete ; +set @arg00= -9223372036854775808 ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1264 Data truncated; out of range for column 'c1' at row 1 +Warning 1264 Data truncated; out of range for column 'c2' at row 1 +Warning 1264 Data truncated; out of range for column 'c3' at row 1 +Warning 1264 Data truncated; out of range for column 'c4' at row 1 +Warning 1264 Data truncated; out of range for column 'c5' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 -128 +c2 -32768 +c3 -8388608 +c4 -2147483648 +c5 -2147483648 +c6 -9223372036854775808 +c7 -9.22337e+18 +c8 -9.22337203685478e+18 +c9 -9.22337203685478e+18 +c10 -9.22337203685478e+18 +c12 -9999.9999 +execute my_delete ; +set @arg00= '-9223372036854775808' ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1264 Data truncated; out of range for column 'c1' at row 1 +Warning 1264 Data truncated; out of range for column 'c2' at row 1 +Warning 1264 Data truncated; out of range for column 'c3' at row 1 +Warning 1265 Data truncated for column 'c4' at row 1 +Warning 1265 Data truncated for column 'c5' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 -128 +c2 -32768 +c3 -8388608 +c4 -2147483648 +c5 -2147483648 +c6 -9223372036854775808 +c7 -9.22337e+18 +c8 -9.22337203685478e+18 +c9 -9.22337203685478e+18 +c10 -9.22337203685478e+18 +c12 -9999.9999 +execute my_delete ; +set @arg00= 1.11111111111111111111e+50 ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1264 Data truncated; out of range for column 'c1' at row 1 +Warning 1264 Data truncated; out of range for column 'c2' at row 1 +Warning 1264 Data truncated; out of range for column 'c3' at row 1 +Warning 1264 Data truncated; out of range for column 'c4' at row 1 +Warning 1264 Data truncated; out of range for column 'c5' at row 1 +Warning 1264 Data truncated; out of range for column 'c6' at row 1 +Warning 1264 Data truncated; out of range for column 'c7' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 127 +c2 32767 +c3 8388607 +c4 2147483647 +c5 2147483647 +c6 9223372036854775807 +c7 3.40282e+38 +c8 1.11111111111111e+50 +c9 1.11111111111111e+50 +c10 1.11111111111111e+50 +c12 99999.9999 +execute my_delete ; +set @arg00= '1.11111111111111111111e+50' ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1265 Data truncated for column 'c1' at row 1 +Warning 1265 Data truncated for column 'c2' at row 1 +Warning 1265 Data truncated for column 'c3' at row 1 +Warning 1265 Data truncated for column 'c4' at row 1 +Warning 1265 Data truncated for column 'c5' at row 1 +Warning 1265 Data truncated for column 'c6' at row 1 +Warning 1264 Data truncated; out of range for column 'c7' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 1 +c2 1 +c3 1 +c4 1 +c5 1 +c6 1 +c7 3.40282e+38 +c8 1.11111111111111e+50 +c9 1.11111111111111e+50 +c10 1.11111111111111e+50 +c12 99999.9999 +execute my_delete ; +set @arg00= -1.11111111111111111111e+50 ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1264 Data truncated; out of range for column 'c1' at row 1 +Warning 1264 Data truncated; out of range for column 'c2' at row 1 +Warning 1264 Data truncated; out of range for column 'c3' at row 1 +Warning 1264 Data truncated; out of range for column 'c4' at row 1 +Warning 1264 Data truncated; out of range for column 'c5' at row 1 +Warning 1264 Data truncated; out of range for column 'c6' at row 1 +Warning 1264 Data truncated; out of range for column 'c7' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 -128 +c2 -32768 +c3 -8388608 +c4 -2147483648 +c5 -2147483648 +c6 -9223372036854775808 +c7 -3.40282e+38 +c8 -1.11111111111111e+50 +c9 -1.11111111111111e+50 +c10 -1.11111111111111e+50 +c12 -9999.9999 +execute my_delete ; +set @arg00= '-1.11111111111111111111e+50' ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1265 Data truncated for column 'c1' at row 1 +Warning 1265 Data truncated for column 'c2' at row 1 +Warning 1265 Data truncated for column 'c3' at row 1 +Warning 1265 Data truncated for column 'c4' at row 1 +Warning 1265 Data truncated for column 'c5' at row 1 +Warning 1265 Data truncated for column 'c6' at row 1 +Warning 1264 Data truncated; out of range for column 'c7' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 -1 +c2 -1 +c3 -1 +c4 -1 +c5 -1 +c6 -1 +c7 -3.40282e+38 +c8 -1.11111111111111e+50 +c9 -1.11111111111111e+50 +c10 -1.11111111111111e+50 +c12 -9999.9999 +execute my_delete ; +test_sequence +-- insert into string columns -- +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +select c1, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30 +from t9 where c1 >= 20 +order by c1 ; +c1 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 +20 2 20 20 20 20 20 20 20 20 20 20 +21 2 21 21 21 21 21 21 21 21 21 21 +22 2 22 22 22 22 22 22 22 22 22 22 +23 2 23 23 23 23 23 23 23 23 23 23 +30 3 30 30 30 30 30 30 30 30 30 30 +31 3 31 31 31 31 31 31 31 31 31 31 +32 3 32 32 32 32 32 32 32 32 32 32 +33 3 33 33 33 33 33 33 33 33 33 33 +40 4 40 40 40 40 40 40 40 40 40 40 +41 4 41 41 41 41 41 41 41 41 41 41 +42 4 42 42 42 42 42 42 42 42 42 42 +43 4 43 43 43 43 43 43 43 43 43 43 +50 5 50 50 50.00 50.00 50.00 50.00 50.00 50.00 50.00 50.00 +51 5 51 51 51 51 51 51 51 51 51 51 +52 5 52 52 52.00 52.00 52.00 52.00 52.00 52.00 52.00 52.00 +53 5 53 53 53.00 53.00 53.00 53.00 53.00 53.00 53.00 53.00 +54 5 54 54 54.00 54.00 54.00 54.00 54.00 54.00 54.00 54.00 +55 5 55 55 55 55 55 55 55 55 55 55 +56 6 56 56 56.00 56.00 56.00 56.00 56.00 56.00 56.00 56.00 +57 6 57 57 57.00 57.00 57.00 57.00 57.00 57.00 57.00 57.00 +60 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +61 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +62 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +63 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +71 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +73 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +81 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +83 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +test_sequence +-- select .. where string column = .. -- +set @arg00= '20'; +select 'true' as found from t9 +where c1= 20 and concat(c20,substr('20',1+length(c20)))= '20' and c21= '20' and +c22= '20' and c23= '20' and c24= '20' and c25= '20' and c26= '20' and +c27= '20' and c28= '20' and c29= '20' and c30= '20' ; +found +true +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and +c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and +c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr('20',1+length(c20)))= '20' and c21= '20' and + c22= '20' and c23= '20' and c24= '20' and c25= '20' and c26= '20' and + c27= '20' and c28= '20' and c29= '20' and c30= '20'" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and + c21= ? and c22= ? and c23= ? and c25= ? and + c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +found +true +set @arg00= CAST('20' as binary); +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(CAST('20' as binary),1+length(c20))) += CAST('20' as binary) and c21= CAST('20' as binary) +and c22= CAST('20' as binary) and c23= CAST('20' as binary) and +c24= CAST('20' as binary) and c25= CAST('20' as binary) and +c26= CAST('20' as binary) and c27= CAST('20' as binary) and +c28= CAST('20' as binary) and c29= CAST('20' as binary) and +c30= CAST('20' as binary) ; +found +true +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(@arg00,1+length(c20))) = @arg00 and +c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and +c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and +c30= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(CAST('20' as binary),1+length(c20))) + = CAST('20' as binary) and c21= CAST('20' as binary) + and c22= CAST('20' as binary) and c23= CAST('20' as binary) and + c24= CAST('20' as binary) and c25= CAST('20' as binary) and + c26= CAST('20' as binary) and c27= CAST('20' as binary) and + c28= CAST('20' as binary) and c29= CAST('20' as binary) and + c30= CAST('20' as binary)" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(?,1+length(c20))) = ? and c21= ? and + c22= ? and c23= ? and c25= ? and c26= ? and c27= ? and c28= ? and + c29= ? and c30= ?"; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +found +true +set @arg00= 20; +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(20,1+length(c20)))= 20 and c21= 20 and +c22= 20 and c23= 20 and c24= 20 and c25= 20 and c26= 20 and +c27= 20 and c28= 20 and c29= 20 and c30= 20 ; +found +true +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and +c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and +c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(20,1+length(c20)))= 20 and c21= 20 and + c22= 20 and c23= 20 and c24= 20 and c25= 20 and c26= 20 and + c27= 20 and c28= 20 and c29= 20 and c30= 20" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and + c21= ? and c22= ? and c23= ? and c25= ? and + c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +found +true +set @arg00= 20.0; +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(20.0,1+length(c20)))= 20.0 and c21= 20.0 and +c22= 20.0 and c23= 20.0 and c24= 20.0 and c25= 20.0 and c26= 20.0 and +c27= 20.0 and c28= 20.0 and c29= 20.0 and c30= 20.0 ; +found +true +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and +c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and +c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(20.0,1+length(c20)))= 20.0 and c21= 20.0 and + c22= 20.0 and c23= 20.0 and c24= 20.0 and c25= 20.0 and c26= 20.0 and + c27= 20.0 and c28= 20.0 and c29= 20.0 and c30= 20.0" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and + c21= ? and c22= ? and c23= ? and c25= ? and + c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +found +true +delete from t9 ; +test_sequence +-- insert into date/time columns -- +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1264 Data truncated; out of range for column 'c13' at row 1 +Warning 1265 Data truncated for column 'c14' at row 1 +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1264 Data truncated; out of range for column 'c13' at row 1 +Warning 1265 Data truncated for column 'c14' at row 1 +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1264 Data truncated; out of range for column 'c13' at row 1 +Warning 1265 Data truncated for column 'c14' at row 1 +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1264 Data truncated; out of range for column 'c13' at row 1 +Warning 1265 Data truncated for column 'c14' at row 1 +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +select c1, c13, c14, c15, c16, c17 from t9 order by c1 ; +c1 c13 c14 c15 c16 c17 +20 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +21 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +22 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +23 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +30 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +31 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +32 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +33 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +40 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +41 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +42 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +43 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +50 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +51 0010-00-00 0010-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +52 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +53 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +60 NULL NULL 1991-01-01 01:01:01 NULL NULL +61 NULL NULL 1991-01-01 01:01:01 NULL NULL +62 NULL NULL 1991-01-01 01:01:01 NULL NULL +63 NULL NULL 1991-01-01 01:01:01 NULL NULL +71 NULL NULL 1991-01-01 01:01:01 NULL NULL +73 NULL NULL 1991-01-01 01:01:01 NULL NULL +81 NULL NULL 1991-01-01 01:01:01 NULL NULL +83 NULL NULL 1991-01-01 01:01:01 NULL NULL +test_sequence +-- select .. where date/time column = .. -- +set @arg00= '1991-01-01 01:01:01' ; +select 'true' as found from t9 +where c1= 20 and c13= '1991-01-01 01:01:01' and c14= '1991-01-01 01:01:01' and +c15= '1991-01-01 01:01:01' and c16= '1991-01-01 01:01:01' and +c17= '1991-01-01 01:01:01' ; +found +true +select 'true' as found from t9 +where c1= 20 and c13= @arg00 and c14= @arg00 and c15= @arg00 and c16= @arg00 +and c17= @arg00 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c13= '1991-01-01 01:01:01' and c14= '1991-01-01 01:01:01' and + c15= '1991-01-01 01:01:01' and c16= '1991-01-01 01:01:01' and + c17= '1991-01-01 01:01:01'" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c13= ? and c14= ? and c15= ? and c16= ? and c17= ?" ; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00 ; +found +true +set @arg00= CAST('1991-01-01 01:01:01' as datetime) ; +select 'true' as found from t9 +where c1= 20 and c13= CAST('1991-01-01 01:01:01' as datetime) and +c14= CAST('1991-01-01 01:01:01' as datetime) and +c15= CAST('1991-01-01 01:01:01' as datetime) and +c16= CAST('1991-01-01 01:01:01' as datetime) and +c17= CAST('1991-01-01 01:01:01' as datetime) ; +found +true +select 'true' as found from t9 +where c1= 20 and c13= @arg00 and c14= @arg00 and c15= @arg00 and c16= @arg00 +and c17= @arg00 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c13= CAST('1991-01-01 01:01:01' as datetime) and + c14= CAST('1991-01-01 01:01:01' as datetime) and + c15= CAST('1991-01-01 01:01:01' as datetime) and + c16= CAST('1991-01-01 01:01:01' as datetime) and + c17= CAST('1991-01-01 01:01:01' as datetime)" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c13= ? and c14= ? and c15= ? and c16= ? and c17= ?" ; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00 ; +found +true +set @arg00= 1991 ; +select 'true' as found from t9 +where c1= 20 and c17= 1991 ; +found +true +select 'true' as found from t9 +where c1= 20 and c17= @arg00 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c17= 1991" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c17= ?" ; +execute stmt1 using @arg00 ; +found +true +set @arg00= 1.991e+3 ; +select 'true' as found from t9 +where c1= 20 and abs(c17 - 1.991e+3) < 0.01 ; +found +true +select 'true' as found from t9 +where c1= 20 and abs(c17 - @arg00) < 0.01 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and abs(c17 - 1.991e+3) < 0.01" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and abs(c17 - ?) < 0.01" ; +execute stmt1 using @arg00 ; +found +true +drop table t1, t1_1, t1_2, +t9_1, t9_2, t9; diff --git a/mysql-test/r/ps_6bdb.result.es b/mysql-test/r/ps_6bdb.result.es new file mode 100644 index 00000000000..7b7f7e23bbf --- /dev/null +++ b/mysql-test/r/ps_6bdb.result.es @@ -0,0 +1,3113 @@ +use test; +drop table if exists t1, t9 ; +create table t1 +( +a int, b varchar(30), +primary key(a) +) engine = 'BDB' ; +create table t9 +( +c1 tinyint, c2 smallint, c3 mediumint, c4 int, +c5 integer, c6 bigint, c7 float, c8 double, +c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4), +c13 date, c14 datetime, c15 timestamp(14), c16 time, +c17 year, c18 bit, c19 bool, c20 char, +c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext, +c25 blob, c26 text, c27 mediumblob, c28 mediumtext, +c29 longblob, c30 longtext, c31 enum('one', 'two', 'three'), +c32 set('monday', 'tuesday', 'wednesday'), +primary key(c1) +) engine = 'BDB' ; +delete from t1 ; +insert into t1 values (1,'one'); +insert into t1 values (2,'two'); +insert into t1 values (3,'three'); +insert into t1 values (4,'four'); +commit ; +delete from t9 ; +insert into t9 +set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, +c10= 1, c11= 1, c12 = 1, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=true, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; +insert into t9 +set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, +c10= 9, c11= 9, c12 = 9, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=false, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +commit ; +test_sequence +------ simple select tests ------ +prepare stmt1 from ' select * from t9 order by c1 ' ; +execute stmt1; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def test t9 t9 c1 c1 1 4 1 N 49155 0 63 +def test t9 t9 c2 c2 2 6 1 Y 32768 0 63 +def test t9 t9 c3 c3 9 9 1 Y 32768 0 63 +def test t9 t9 c4 c4 3 11 1 Y 32768 0 63 +def test t9 t9 c5 c5 3 11 1 Y 32768 0 63 +def test t9 t9 c6 c6 8 20 1 Y 32768 0 63 +def test t9 t9 c7 c7 4 12 1 Y 32768 31 63 +def test t9 t9 c8 c8 5 22 1 Y 32768 31 63 +def test t9 t9 c9 c9 5 22 1 Y 32768 31 63 +def test t9 t9 c10 c10 5 22 1 Y 32768 31 63 +def test t9 t9 c11 c11 0 9 6 Y 32768 4 63 +def test t9 t9 c12 c12 0 10 6 Y 32768 4 63 +def test t9 t9 c13 c13 10 10 10 Y 128 0 63 +def test t9 t9 c14 c14 12 19 19 Y 128 0 63 +def test t9 t9 c15 c15 7 19 19 N 1249 0 63 +def test t9 t9 c16 c16 11 8 8 Y 128 0 63 +def test t9 t9 c17 c17 13 4 4 Y 32864 0 63 +def test t9 t9 c18 c18 1 1 1 Y 32768 0 63 +def test t9 t9 c19 c19 1 1 1 Y 32768 0 63 +def test t9 t9 c20 c20 254 1 1 Y 0 0 8 +def test t9 t9 c21 c21 253 10 10 Y 0 0 8 +def test t9 t9 c22 c22 253 30 30 Y 0 0 8 +def test t9 t9 c23 c23 252 255 8 Y 144 0 63 +def test t9 t9 c24 c24 252 255 8 Y 16 0 8 +def test t9 t9 c25 c25 252 65535 4 Y 144 0 63 +def test t9 t9 c26 c26 252 65535 4 Y 16 0 8 +def test t9 t9 c27 c27 252 16777215 10 Y 144 0 63 +def test t9 t9 c28 c28 252 16777215 10 Y 16 0 8 +def test t9 t9 c29 c29 252 16777215 8 Y 144 0 63 +def test t9 t9 c30 c30 252 16777215 8 Y 16 0 8 +def test t9 t9 c31 c31 254 5 3 Y 256 0 8 +def test t9 t9 c32 c32 254 24 7 Y 2048 0 8 +c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32 +1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday +set @arg00='SELECT' ; +prepare stmt1 from ' ? a from t1 where a=1 '; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? a from t1 where a=1' at line 1 +set @arg00=1 ; +select @arg00, b from t1 where a=1 ; +@arg00 b +1 one +prepare stmt1 from ' select ?, b from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +? b +1 one +set @arg00='lion' ; +select @arg00, b from t1 where a=1 ; +@arg00 b +lion one +prepare stmt1 from ' select ?, b from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +? b +lion one +set @arg00=NULL ; +select @arg00, b from t1 where a=1 ; +@arg00 b +NULL one +prepare stmt1 from ' select ?, b from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +? b +NULL one +set @arg00=1 ; +select b, a - @arg00 from t1 where a=1 ; +b a - @arg00 +one 0 +prepare stmt1 from ' select b, a - ? from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +b a - ? +one 0 +set @arg00=null ; +select @arg00 as my_col ; +my_col +NULL +prepare stmt1 from ' select ? as my_col'; +execute stmt1 using @arg00 ; +my_col +NULL +select @arg00 + 1 as my_col ; +my_col +NULL +prepare stmt1 from ' select ? + 1 as my_col'; +execute stmt1 using @arg00 ; +my_col +NULL +select 1 + @arg00 as my_col ; +my_col +NULL +prepare stmt1 from ' select 1 + ? as my_col'; +execute stmt1 using @arg00 ; +my_col +NULL +set @arg00='MySQL' ; +select substr(@arg00,1,2) from t1 where a=1 ; +substr(@arg00,1,2) +My +prepare stmt1 from ' select substr(?,1,2) from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +substr(?,1,2) +My +set @arg00=3 ; +select substr('MySQL',@arg00,5) from t1 where a=1 ; +substr('MySQL',@arg00,5) +SQL +prepare stmt1 from ' select substr(''MySQL'',?,5) from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +substr('MySQL',?,5) +SQL +select substr('MySQL',1,@arg00) from t1 where a=1 ; +substr('MySQL',1,@arg00) +MyS +prepare stmt1 from ' select substr(''MySQL'',1,?) from t1 where a=1 ' ; +execute stmt1 using @arg00 ; +substr('MySQL',1,?) +MyS +set @arg00='MySQL' ; +select a , concat(@arg00,b) from t1 order by a; +a concat(@arg00,b) +1 MySQLone +2 MySQLtwo +3 MySQLthree +4 MySQLfour +prepare stmt1 from ' select a , concat(?,b) from t1 order by a ' ; +execute stmt1 using @arg00; +a concat(?,b) +1 MySQLone +2 MySQLtwo +3 MySQLthree +4 MySQLfour +select a , concat(b,@arg00) from t1 order by a ; +a concat(b,@arg00) +1 oneMySQL +2 twoMySQL +3 threeMySQL +4 fourMySQL +prepare stmt1 from ' select a , concat(b,?) from t1 order by a ' ; +execute stmt1 using @arg00; +a concat(b,?) +1 oneMySQL +2 twoMySQL +3 threeMySQL +4 fourMySQL +set @arg00='MySQL' ; +select group_concat(@arg00,b order by a) from t1 +group by 'a' ; +group_concat(@arg00,b order by a) +MySQLone,MySQLtwo,MySQLthree,MySQLfour +prepare stmt1 from ' select group_concat(?,b order by a) from t1 +group by ''a'' ' ; +execute stmt1 using @arg00; +group_concat(?,b order by a) +MySQLone,MySQLtwo,MySQLthree,MySQLfour +select group_concat(b,@arg00 order by a) from t1 +group by 'a' ; +group_concat(b,@arg00 order by a) +oneMySQL,twoMySQL,threeMySQL,fourMySQL +prepare stmt1 from ' select group_concat(b,? order by a) from t1 +group by ''a'' ' ; +execute stmt1 using @arg00; +group_concat(b,? order by a) +oneMySQL,twoMySQL,threeMySQL,fourMySQL +set @arg00='first' ; +set @arg01='second' ; +set @arg02=NULL; +select @arg00, @arg01 from t1 where a=1 ; +@arg00 @arg01 +first second +prepare stmt1 from ' select ?, ? from t1 where a=1 ' ; +execute stmt1 using @arg00, @arg01 ; +? ? +first second +execute stmt1 using @arg02, @arg01 ; +? ? +NULL second +execute stmt1 using @arg00, @arg02 ; +? ? +first NULL +execute stmt1 using @arg02, @arg02 ; +? ? +NULL NULL +drop table if exists t5 ; +create table t5 (id1 int(11) not null default '0', +value2 varchar(100), value1 varchar(100)) ; +insert into t5 values (1,'hh','hh'),(2,'hh','hh'), +(1,'ii','ii'),(2,'ii','ii') ; +prepare stmt1 from ' select id1,value1 from t5 where id1=? or value1=? order by id1,value1 ' ; +set @arg00=1 ; +set @arg01='hh' ; +execute stmt1 using @arg00, @arg01 ; +id1 value1 +1 hh +1 ii +2 hh +drop table t5 ; +drop table if exists t5 ; +create table t5(session_id char(9) not null) ; +insert into t5 values ('abc') ; +prepare stmt1 from ' select * from t5 +where ?=''1111'' and session_id = ''abc'' ' ; +set @arg00='abc' ; +execute stmt1 using @arg00 ; +session_id +set @arg00='1111' ; +execute stmt1 using @arg00 ; +session_id +abc +set @arg00='abc' ; +execute stmt1 using @arg00 ; +session_id +drop table t5 ; +set @arg00='FROM' ; +select a @arg00 t1 where a=1 ; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 t1 where a=1' at line 1 +prepare stmt1 from ' select a ? t1 where a=1 ' ; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? t1 where a=1' at line 1 +set @arg00='t1' ; +select a from @arg00 where a=1 ; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 where a=1' at line 1 +prepare stmt1 from ' select a from ? where a=1 ' ; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? where a=1' at line 1 +set @arg00='WHERE' ; +select a from t1 @arg00 a=1 ; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 a=1' at line 1 +prepare stmt1 from ' select a from t1 ? a=1 ' ; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? a=1' at line 1 +set @arg00=1 ; +select a FROM t1 where a=@arg00 ; +a +1 +prepare stmt1 from ' select a FROM t1 where a=? ' ; +execute stmt1 using @arg00 ; +a +1 +set @arg00=1000 ; +execute stmt1 using @arg00 ; +a +set @arg00=NULL ; +select a FROM t1 where a=@arg00 ; +a +prepare stmt1 from ' select a FROM t1 where a=? ' ; +execute stmt1 using @arg00 ; +a +set @arg00=4 ; +select a FROM t1 where a=sqrt(@arg00) ; +a +2 +prepare stmt1 from ' select a FROM t1 where a=sqrt(?) ' ; +execute stmt1 using @arg00 ; +a +2 +set @arg00=NULL ; +select a FROM t1 where a=sqrt(@arg00) ; +a +prepare stmt1 from ' select a FROM t1 where a=sqrt(?) ' ; +execute stmt1 using @arg00 ; +a +set @arg00=2 ; +set @arg01=3 ; +select a FROM t1 where a in (@arg00,@arg01) order by a; +a +2 +3 +prepare stmt1 from ' select a FROM t1 where a in (?,?) order by a '; +execute stmt1 using @arg00, @arg01; +a +2 +3 +set @arg00= 'one' ; +set @arg01= 'two' ; +set @arg02= 'five' ; +prepare stmt1 from ' select b FROM t1 where b in (?,?,?) order by b ' ; +execute stmt1 using @arg00, @arg01, @arg02 ; +b +one +two +prepare stmt1 from ' select b FROM t1 where b like ? '; +set @arg00='two' ; +execute stmt1 using @arg00 ; +b +two +set @arg00='tw%' ; +execute stmt1 using @arg00 ; +b +two +set @arg00='%wo' ; +execute stmt1 using @arg00 ; +b +two +set @arg00=null ; +insert into t9 set c1= 0, c5 = NULL ; +select c5 from t9 where c5 > NULL ; +c5 +prepare stmt1 from ' select c5 from t9 where c5 > ? '; +execute stmt1 using @arg00 ; +c5 +select c5 from t9 where c5 < NULL ; +c5 +prepare stmt1 from ' select c5 from t9 where c5 < ? '; +execute stmt1 using @arg00 ; +c5 +select c5 from t9 where c5 = NULL ; +c5 +prepare stmt1 from ' select c5 from t9 where c5 = ? '; +execute stmt1 using @arg00 ; +c5 +select c5 from t9 where c5 <=> NULL ; +c5 +NULL +prepare stmt1 from ' select c5 from t9 where c5 <=> ? '; +execute stmt1 using @arg00 ; +c5 +NULL +delete from t9 where c1= 0 ; +set @arg00='>' ; +select a FROM t1 where a @arg00 1 ; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 1' at line 1 +prepare stmt1 from ' select a FROM t1 where a ? 1 ' ; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? 1' at line 1 +set @arg00=1 ; +select a,b FROM t1 where a is not NULL +AND b is not NULL group by a - @arg00 ; +a b +1 one +2 two +3 three +4 four +prepare stmt1 from ' select a,b FROM t1 where a is not NULL +AND b is not NULL group by a - ? ' ; +execute stmt1 using @arg00 ; +a b +1 one +2 two +3 three +4 four +set @arg00='two' ; +select a,b FROM t1 where a is not NULL +AND b is not NULL having b <> @arg00 order by a ; +a b +1 one +3 three +4 four +prepare stmt1 from ' select a,b FROM t1 where a is not NULL +AND b is not NULL having b <> ? order by a ' ; +execute stmt1 using @arg00 ; +a b +1 one +3 three +4 four +set @arg00=1 ; +select a,b FROM t1 where a is not NULL +AND b is not NULL order by a - @arg00 ; +a b +1 one +2 two +3 three +4 four +prepare stmt1 from ' select a,b FROM t1 where a is not NULL +AND b is not NULL order by a - ? ' ; +execute stmt1 using @arg00 ; +a b +1 one +2 two +3 three +4 four +set @arg00=2 ; +select a,b from t1 order by 2 ; +a b +4 four +1 one +3 three +2 two +prepare stmt1 from ' select a,b from t1 +order by ? '; +execute stmt1 using @arg00; +a b +4 four +1 one +3 three +2 two +set @arg00=1 ; +execute stmt1 using @arg00; +a b +1 one +2 two +3 three +4 four +set @arg00=0 ; +execute stmt1 using @arg00; +ERROR 42S22: Unknown column '?' in 'order clause' +set @arg00=1; +prepare stmt1 from ' select a,b from t1 order by a +limit 1 '; +execute stmt1 ; +a b +1 one +prepare stmt1 from ' select a,b from t1 +limit ? '; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?' at line 2 +set @arg00='b' ; +set @arg01=0 ; +set @arg02=2 ; +set @arg03=2 ; +select sum(a), @arg00 from t1 where a > @arg01 +and b is not null group by substr(b,@arg02) +having sum(a) <> @arg03 ; +sum(a) @arg00 +3 b +1 b +4 b +prepare stmt1 from ' select sum(a), ? from t1 where a > ? +and b is not null group by substr(b,?) +having sum(a) <> ? '; +execute stmt1 using @arg00, @arg01, @arg02, @arg03; +sum(a) ? +3 b +1 b +4 b +test_sequence +------ join tests ------ +select first.a as a1, second.a as a2 +from t1 first, t1 second +where first.a = second.a order by a1 ; +a1 a2 +1 1 +2 2 +3 3 +4 4 +prepare stmt1 from ' select first.a as a1, second.a as a2 + from t1 first, t1 second + where first.a = second.a order by a1 '; +execute stmt1 ; +a1 a2 +1 1 +2 2 +3 3 +4 4 +set @arg00='ABC'; +set @arg01='two'; +set @arg02='one'; +select first.a, @arg00, second.a FROM t1 first, t1 second +where @arg01 = first.b or first.a = second.a or second.b = @arg02 +order by second.a, first.a; +a @arg00 a +1 ABC 1 +2 ABC 1 +3 ABC 1 +4 ABC 1 +2 ABC 2 +2 ABC 3 +3 ABC 3 +2 ABC 4 +4 ABC 4 +prepare stmt1 from ' select first.a, ?, second.a FROM t1 first, t1 second + where ? = first.b or first.a = second.a or second.b = ? + order by second.a, first.a'; +execute stmt1 using @arg00, @arg01, @arg02; +a ? a +1 ABC 1 +2 ABC 1 +3 ABC 1 +4 ABC 1 +2 ABC 2 +2 ABC 3 +3 ABC 3 +2 ABC 4 +4 ABC 4 +drop table if exists t2 ; +create table t2 as select * from t1 ; +set @query1= 'SELECT * FROM t2 join t1 on (t1.a=t2.a) order by t2.a ' ; +set @query2= 'SELECT * FROM t2 natural join t1 order by t2.a ' ; +set @query3= 'SELECT * FROM t2 join t1 using(a) order by t2.a ' ; +set @query4= 'SELECT * FROM t2 left join t1 on(t1.a=t2.a) order by t2.a ' ; +set @query5= 'SELECT * FROM t2 natural left join t1 order by t2.a ' ; +set @query6= 'SELECT * FROM t2 left join t1 using(a) order by t2.a ' ; +set @query7= 'SELECT * FROM t2 right join t1 on(t1.a=t2.a) order by t2.a ' ; +set @query8= 'SELECT * FROM t2 natural right join t1 order by t2.a ' ; +set @query9= 'SELECT * FROM t2 right join t1 using(a) order by t2.a ' ; +the join statement is: +SELECT * FROM t2 right join t1 using(a) order by t2.a +prepare stmt1 from @query9 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +the join statement is: +SELECT * FROM t2 natural right join t1 order by t2.a +prepare stmt1 from @query8 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +the join statement is: +SELECT * FROM t2 right join t1 on(t1.a=t2.a) order by t2.a +prepare stmt1 from @query7 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +the join statement is: +SELECT * FROM t2 left join t1 using(a) order by t2.a +prepare stmt1 from @query6 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +the join statement is: +SELECT * FROM t2 natural left join t1 order by t2.a +prepare stmt1 from @query5 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +the join statement is: +SELECT * FROM t2 left join t1 on(t1.a=t2.a) order by t2.a +prepare stmt1 from @query4 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +the join statement is: +SELECT * FROM t2 join t1 using(a) order by t2.a +prepare stmt1 from @query3 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +the join statement is: +SELECT * FROM t2 natural join t1 order by t2.a +prepare stmt1 from @query2 ; +execute stmt1 ; +a b +1 one +2 two +3 three +4 four +execute stmt1 ; +a b +1 one +2 two +3 three +4 four +execute stmt1 ; +a b +1 one +2 two +3 three +4 four +the join statement is: +SELECT * FROM t2 join t1 on (t1.a=t2.a) order by t2.a +prepare stmt1 from @query1 ; +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +execute stmt1 ; +a b a b +1 one 1 one +2 two 2 two +3 three 3 three +4 four 4 four +drop table t2 ; +test_sequence +------ subquery tests ------ +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where b = ''two'') '; +execute stmt1 ; +a b +2 two +set @arg00='two' ; +select a, b FROM t1 outer_table where +a = (select a from t1 where b = 'two' ) and b=@arg00 ; +a b +2 two +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where b = ''two'') and b=? '; +execute stmt1 using @arg00; +a b +2 two +set @arg00='two' ; +select a, b FROM t1 outer_table where +a = (select a from t1 where b = @arg00 ) and b='two' ; +a b +2 two +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where b = ? ) and b=''two'' ' ; +execute stmt1 using @arg00; +a b +2 two +set @arg00=3 ; +set @arg01='three' ; +select a,b FROM t1 where (a,b) in (select 3, 'three'); +a b +3 three +select a FROM t1 where (a,b) in (select @arg00,@arg01); +a +3 +prepare stmt1 from ' select a FROM t1 where (a,b) in (select ?, ?) '; +execute stmt1 using @arg00, @arg01; +a +3 +set @arg00=1 ; +set @arg01='two' ; +set @arg02=2 ; +set @arg03='two' ; +select a, @arg00, b FROM t1 outer_table where +b=@arg01 and a = (select @arg02 from t1 where b = @arg03 ) ; +a @arg00 b +2 1 two +prepare stmt1 from ' select a, ?, b FROM t1 outer_table where + b=? and a = (select ? from t1 where b = ? ) ' ; +execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; +a ? b +2 1 two +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where b = outer_table.b ) order by a '; +execute stmt1 ; +a b +1 one +2 two +3 three +4 four +prepare stmt1 from ' SELECT a as ccc from t1 where a+1= + (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) '; +execute stmt1 ; +ccc +1 +deallocate prepare stmt1 ; +prepare stmt1 from ' SELECT a as ccc from t1 where a+1= + (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) '; +execute stmt1 ; +ccc +1 +deallocate prepare stmt1 ; +prepare stmt1 from ' SELECT a as ccc from t1 where a+1= + (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) '; +execute stmt1 ; +ccc +1 +deallocate prepare stmt1 ; +set @arg00='two' ; +select a, b FROM t1 outer_table where +a = (select a from t1 where b = outer_table.b ) and b=@arg00 ; +a b +2 two +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where b = outer_table.b) and b=? '; +execute stmt1 using @arg00; +a b +2 two +set @arg00=2 ; +select a, b FROM t1 outer_table where +a = (select a from t1 where a = @arg00 and b = outer_table.b) and b='two' ; +a b +2 two +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where a = ? and b = outer_table.b) and b=''two'' ' ; +execute stmt1 using @arg00; +a b +2 two +set @arg00=2 ; +select a, b FROM t1 outer_table where +a = (select a from t1 where outer_table.a = @arg00 and a=2) and b='two' ; +a b +2 two +prepare stmt1 from ' select a, b FROM t1 outer_table where + a = (select a from t1 where outer_table.a = ? and a=2) and b=''two'' ' ; +execute stmt1 using @arg00; +a b +2 two +set @arg00=1 ; +set @arg01='two' ; +set @arg02=2 ; +set @arg03='two' ; +select a, @arg00, b FROM t1 outer_table where +b=@arg01 and a = (select @arg02 from t1 where outer_table.b = @arg03 +and outer_table.a=a ) ; +a @arg00 b +2 1 two +prepare stmt1 from ' select a, ?, b FROM t1 outer_table where + b=? and a = (select ? from t1 where outer_table.b = ? + and outer_table.a=a ) ' ; +execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; +a ? b +2 1 two +set @arg00=1 ; +set @arg01=0 ; +select a, @arg00 +from ( select a - @arg00 as a from t1 where a=@arg00 ) as t2 +where a=@arg01; +a @arg00 +0 1 +prepare stmt1 from ' select a, ? + from ( select a - ? as a from t1 where a=? ) as t2 + where a=? '; +execute stmt1 using @arg00, @arg00, @arg00, @arg01 ; +a ? +0 1 +drop table if exists t2 ; +create table t2 as select * from t1; +prepare stmt1 from ' select a in (select a from t2) from t1 ' ; +execute stmt1 ; +a in (select a from t2) +1 +1 +1 +1 +drop table if exists t5, t6, t7 ; +create table t5 (a int , b int) ; +create table t6 like t5 ; +create table t7 like t5 ; +insert into t5 values (0, 100), (1, 2), (1, 3), (2, 2), (2, 7), +(2, -1), (3, 10) ; +insert into t6 values (0, 0), (1, 1), (2, 1), (3, 1), (4, 1) ; +insert into t7 values (3, 3), (2, 2), (1, 1) ; +prepare stmt1 from ' select a, (select count(distinct t5.b) as sum from t5, t6 + where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b + group by t5.a order by sum limit 1) from t7 ' ; +execute stmt1 ; +a (select count(distinct t5.b) as sum from t5, t6 + where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b + group by t5.a order by sum limit 1) +3 1 +2 2 +1 2 +execute stmt1 ; +a (select count(distinct t5.b) as sum from t5, t6 + where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b + group by t5.a order by sum limit 1) +3 1 +2 2 +1 2 +execute stmt1 ; +a (select count(distinct t5.b) as sum from t5, t6 + where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b + group by t5.a order by sum limit 1) +3 1 +2 2 +1 2 +drop table t5, t6, t7 ; +drop table if exists t2 ; +create table t2 as select * from t9; +set @stmt= ' SELECT + (SELECT SUM(c1 + c12 + 0.0) FROM t2 + where (t9.c2 - 0e-3) = t2.c2 + GROUP BY t9.c15 LIMIT 1) as scalar_s, + exists (select 1.0e+0 from t2 + where t2.c3 * 9.0000000000 = t9.c4) as exists_s, + c5 * 4 in (select c6 + 0.3e+1 from t2) as in_s, + (c7 - 4, c8 - 4) in (select c9 + 4.0, c10 + 40e-1 from t2) as in_row_s +FROM t9, +(select c25 x, c32 y from t2) tt WHERE x = c25 ' ; +prepare stmt1 from @stmt ; +execute stmt1 ; +execute stmt1 ; +set @stmt= concat('explain ',@stmt); +prepare stmt1 from @stmt ; +execute stmt1 ; +execute stmt1 ; +set @stmt= ' SELECT + (SELECT SUM(c1+c12+?) FROM t2 where (t9.c2-?)=t2.c2 + GROUP BY t9.c15 LIMIT 1) as scalar_s, + exists (select ? from t2 + where t2.c3*?=t9.c4) as exists_s, + c5*? in (select c6+? from t2) as in_s, + (c7-?, c8-?) in (select c9+?, c10+? from t2) as in_row_s +FROM t9, +(select c25 x, c32 y from t2) tt WHERE x =c25 ' ; +set @arg00= 0.0 ; +set @arg01= 0e-3 ; +set @arg02= 1.0e+0 ; +set @arg03= 9.0000000000 ; +set @arg04= 4 ; +set @arg05= 0.3e+1 ; +set @arg06= 4 ; +set @arg07= 4 ; +set @arg08= 4.0 ; +set @arg09= 40e-1 ; +prepare stmt1 from @stmt ; +execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, +@arg07, @arg08, @arg09 ; +execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, +@arg07, @arg08, @arg09 ; +set @stmt= concat('explain ',@stmt); +prepare stmt1 from @stmt ; +execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, +@arg07, @arg08, @arg09 ; +execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, +@arg07, @arg08, @arg09 ; +drop table t2 ; +select 1 < (select a from t1) ; +ERROR 21000: Subquery returns more than 1 row +prepare stmt1 from ' select 1 < (select a from t1) ' ; +execute stmt1 ; +ERROR 21000: Subquery returns more than 1 row +select 1 as my_col ; +my_col +1 +test_sequence +------ union tests ------ +prepare stmt1 from ' select a FROM t1 where a=1 + union distinct + select a FROM t1 where a=1 '; +execute stmt1 ; +a +1 +execute stmt1 ; +a +1 +prepare stmt1 from ' select a FROM t1 where a=1 + union all + select a FROM t1 where a=1 '; +execute stmt1 ; +a +1 +1 +prepare stmt1 from ' SELECT 1, 2 union SELECT 1 ' ; +ERROR 21000: The used SELECT statements have a different number of columns +prepare stmt1 from ' SELECT 1 union SELECT 1, 2 ' ; +ERROR 21000: The used SELECT statements have a different number of columns +prepare stmt1 from ' SELECT * from t1 union SELECT 1 ' ; +ERROR 21000: The used SELECT statements have a different number of columns +prepare stmt1 from ' SELECT 1 union SELECT * from t1 ' ; +ERROR 21000: The used SELECT statements have a different number of columns +set @arg00=1 ; +select @arg00 FROM t1 where a=1 +union distinct +select 1 FROM t1 where a=1; +@arg00 +1 +prepare stmt1 from ' select ? FROM t1 where a=1 + union distinct + select 1 FROM t1 where a=1 ' ; +execute stmt1 using @arg00; +? +1 +set @arg00=1 ; +select 1 FROM t1 where a=1 +union distinct +select @arg00 FROM t1 where a=1; +1 +1 +prepare stmt1 from ' select 1 FROM t1 where a=1 + union distinct + select ? FROM t1 where a=1 ' ; +execute stmt1 using @arg00; +1 +1 +set @arg00='a' ; +select @arg00 FROM t1 where a=1 +union distinct +select @arg00 FROM t1 where a=1; +@arg00 +a +prepare stmt1 from ' select ? FROM t1 where a=1 + union distinct + select ? FROM t1 where a=1 '; +execute stmt1 using @arg00, @arg00; +? +a +prepare stmt1 from ' select ? + union distinct + select ? '; +execute stmt1 using @arg00, @arg00; +? +a +set @arg00='a' ; +set @arg01=1 ; +set @arg02='a' ; +set @arg03=2 ; +select @arg00 FROM t1 where a=@arg01 +union distinct +select @arg02 FROM t1 where a=@arg03; +@arg00 +a +prepare stmt1 from ' select ? FROM t1 where a=? + union distinct + select ? FROM t1 where a=? ' ; +execute stmt1 using @arg00, @arg01, @arg02, @arg03; +? +a +set @arg00=1 ; +prepare stmt1 from ' select sum(a) + 200, ? from t1 +union distinct +select sum(a) + 200, 1 from t1 +group by b ' ; +execute stmt1 using @arg00; +sum(a) + 200 ? +210 1 +204 1 +201 1 +203 1 +202 1 +set @Oporto='Oporto' ; +set @Lisboa='Lisboa' ; +set @0=0 ; +set @1=1 ; +set @2=2 ; +set @3=3 ; +set @4=4 ; +select @Oporto,@Lisboa,@0,@1,@2,@3,@4 ; +@Oporto @Lisboa @0 @1 @2 @3 @4 +Oporto Lisboa 0 1 2 3 4 +select sum(a) + 200 as the_sum, @Oporto as the_town from t1 +group by b +union distinct +select sum(a) + 200, @Lisboa from t1 +group by b ; +the_sum the_town +204 Oporto +201 Oporto +203 Oporto +202 Oporto +204 Lisboa +201 Lisboa +203 Lisboa +202 Lisboa +prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1 + group by b + union distinct + select sum(a) + 200, ? from t1 + group by b ' ; +execute stmt1 using @Oporto, @Lisboa; +the_sum the_town +204 Oporto +201 Oporto +203 Oporto +202 Oporto +204 Lisboa +201 Lisboa +203 Lisboa +202 Lisboa +select sum(a) + 200 as the_sum, @Oporto as the_town from t1 +where a > @1 +group by b +union distinct +select sum(a) + 200, @Lisboa from t1 +where a > @2 +group by b ; +the_sum the_town +204 Oporto +203 Oporto +202 Oporto +204 Lisboa +203 Lisboa +prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1 + where a > ? + group by b + union distinct + select sum(a) + 200, ? from t1 + where a > ? + group by b ' ; +execute stmt1 using @Oporto, @1, @Lisboa, @2; +the_sum the_town +204 Oporto +203 Oporto +202 Oporto +204 Lisboa +203 Lisboa +select sum(a) + 200 as the_sum, @Oporto as the_town from t1 +where a > @1 +group by b +having avg(a) > @2 +union distinct +select sum(a) + 200, @Lisboa from t1 +where a > @2 +group by b +having avg(a) > @3; +the_sum the_town +204 Oporto +203 Oporto +204 Lisboa +prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1 + where a > ? + group by b + having avg(a) > ? + union distinct + select sum(a) + 200, ? from t1 + where a > ? + group by b + having avg(a) > ? '; +execute stmt1 using @Oporto, @1, @2, @Lisboa, @2, @3; +the_sum the_town +204 Oporto +203 Oporto +204 Lisboa +test_sequence +------ explain select tests ------ +prepare stmt1 from ' explain select * from t9 ' ; +execute stmt1; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def id 8 3 1 N 32801 0 8 +def select_type 253 19 6 N 1 31 33 +def table 253 64 2 N 1 31 33 +def type 253 10 3 N 1 31 33 +def possible_keys 253 4096 0 Y 0 31 33 +def key 253 64 0 Y 0 31 33 +def key_len 8 3 0 Y 32800 0 8 +def ref 253 1024 0 Y 0 31 33 +def rows 8 10 1 N 32801 0 8 +def Extra 253 255 0 N 1 31 33 +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t9 ALL NULL NULL NULL NULL 3 +test_sequence +------ delete tests ------ +delete from t1 ; +insert into t1 values (1,'one'); +insert into t1 values (2,'two'); +insert into t1 values (3,'three'); +insert into t1 values (4,'four'); +commit ; +delete from t9 ; +insert into t9 +set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, +c10= 1, c11= 1, c12 = 1, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=true, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; +insert into t9 +set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, +c10= 9, c11= 9, c12 = 9, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=false, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +commit ; +prepare stmt1 from 'delete from t1 where a=2' ; +execute stmt1; +select a,b from t1 where a=2; +a b +execute stmt1; +insert into t1 values(0,NULL); +set @arg00=NULL; +prepare stmt1 from 'delete from t1 where b=?' ; +execute stmt1 using @arg00; +select a,b from t1 where b is NULL ; +a b +0 NULL +set @arg00='one'; +execute stmt1 using @arg00; +select a,b from t1 where b=@arg00; +a b +prepare stmt1 from 'truncate table t1' ; +ERROR HY000: This command is not supported in the prepared statement protocol yet +test_sequence +------ update tests ------ +delete from t1 ; +insert into t1 values (1,'one'); +insert into t1 values (2,'two'); +insert into t1 values (3,'three'); +insert into t1 values (4,'four'); +commit ; +delete from t9 ; +insert into t9 +set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, +c10= 1, c11= 1, c12 = 1, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=true, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; +insert into t9 +set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, +c10= 9, c11= 9, c12 = 9, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=false, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +commit ; +prepare stmt1 from 'update t1 set b=''a=two'' where a=2' ; +execute stmt1; +select a,b from t1 where a=2; +a b +2 a=two +execute stmt1; +select a,b from t1 where a=2; +a b +2 a=two +set @arg00=NULL; +prepare stmt1 from 'update t1 set b=? where a=2' ; +execute stmt1 using @arg00; +select a,b from t1 where a=2; +a b +2 NULL +set @arg00='two'; +execute stmt1 using @arg00; +select a,b from t1 where a=2; +a b +2 two +set @arg00=2; +prepare stmt1 from 'update t1 set b=NULL where a=?' ; +execute stmt1 using @arg00; +select a,b from t1 where a=@arg00; +a b +2 NULL +update t1 set b='two' where a=@arg00; +set @arg00=2000; +execute stmt1 using @arg00; +select a,b from t1 where a=@arg00; +a b +set @arg00=2; +set @arg01=22; +prepare stmt1 from 'update t1 set a=? where a=?' ; +execute stmt1 using @arg00, @arg00; +select a,b from t1 where a=@arg00; +a b +2 two +execute stmt1 using @arg01, @arg00; +select a,b from t1 where a=@arg01; +a b +22 two +execute stmt1 using @arg00, @arg01; +select a,b from t1 where a=@arg00; +a b +2 two +set @arg00=NULL; +set @arg01=2; +execute stmt1 using @arg00, @arg01; +Warnings: +Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 1 +select a,b from t1 order by a; +a b +0 two +1 one +3 three +4 four +set @arg00=0; +execute stmt1 using @arg01, @arg00; +select a,b from t1 order by a; +a b +1 one +2 two +3 three +4 four +set @arg00=23; +set @arg01='two'; +set @arg02=2; +set @arg03='two'; +set @arg04=2; +drop table if exists t2; +create table t2 as select a,b from t1 ; +prepare stmt1 from 'update t1 set a=? where b=? + and a in (select ? from t2 + where b = ? or a = ?)'; +execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04 ; +affected rows: 1 +info: Rows matched: 1 Changed: 1 Warnings: 0 +select a,b from t1 where a = @arg00 ; +a b +23 two +prepare stmt1 from 'update t1 set a=? where b=? + and a not in (select ? from t2 + where b = ? or a = ?)'; +execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ; +affected rows: 1 +info: Rows matched: 1 Changed: 1 Warnings: 0 +select a,b from t1 order by a ; +a b +1 one +2 two +3 three +4 four +drop table t2 ; +create table t2 +( +a int, b varchar(30), +primary key(a) +) engine = 'BDB' ; +insert into t2(a,b) select a, b from t1 ; +prepare stmt1 from 'update t1 set a=? where b=? + and a in (select ? from t2 + where b = ? or a = ?)'; +execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04 ; +affected rows: 1 +info: Rows matched: 1 Changed: 1 Warnings: 0 +select a,b from t1 where a = @arg00 ; +a b +23 two +prepare stmt1 from 'update t1 set a=? where b=? + and a not in (select ? from t2 + where b = ? or a = ?)'; +execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ; +affected rows: 1 +info: Rows matched: 1 Changed: 1 Warnings: 0 +select a,b from t1 order by a ; +a b +1 one +2 two +3 three +4 four +drop table t2 ; +set @arg00=1; +prepare stmt1 from 'update t1 set b=''bla'' +where a=2 +limit 1'; +execute stmt1 ; +select a,b from t1 where b = 'bla' ; +a b +2 bla +prepare stmt1 from 'update t1 set b=''bla'' +where a=2 +limit ?'; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?' at line 3 +test_sequence +------ insert tests ------ +delete from t1 ; +insert into t1 values (1,'one'); +insert into t1 values (2,'two'); +insert into t1 values (3,'three'); +insert into t1 values (4,'four'); +commit ; +delete from t9 ; +insert into t9 +set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, +c10= 1, c11= 1, c12 = 1, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=true, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; +insert into t9 +set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, +c10= 9, c11= 9, c12 = 9, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=false, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +commit ; +prepare stmt1 from 'insert into t1 values(5, ''five'' )'; +execute stmt1; +select a,b from t1 where a = 5; +a b +5 five +set @arg00='six' ; +prepare stmt1 from 'insert into t1 values(6, ? )'; +execute stmt1 using @arg00; +select a,b from t1 where b = @arg00; +a b +6 six +execute stmt1 using @arg00; +ERROR 23000: Duplicate entry '6' for key 1 +set @arg00=NULL ; +prepare stmt1 from 'insert into t1 values(0, ? )'; +execute stmt1 using @arg00; +select a,b from t1 where b is NULL; +a b +0 NULL +set @arg00=8 ; +set @arg01='eight' ; +prepare stmt1 from 'insert into t1 values(?, ? )'; +execute stmt1 using @arg00, @arg01 ; +select a,b from t1 where b = @arg01; +a b +8 eight +set @NULL= null ; +set @arg00= 'abc' ; +execute stmt1 using @NULL, @NULL ; +ERROR 23000: Column 'a' cannot be null +execute stmt1 using @NULL, @NULL ; +ERROR 23000: Column 'a' cannot be null +execute stmt1 using @NULL, @arg00 ; +ERROR 23000: Column 'a' cannot be null +execute stmt1 using @NULL, @arg00 ; +ERROR 23000: Column 'a' cannot be null +set @arg01= 10000 + 2 ; +execute stmt1 using @arg01, @arg00 ; +set @arg01= 10000 + 1 ; +execute stmt1 using @arg01, @arg00 ; +select * from t1 where a > 10000 order by a ; +a b +10001 abc +10002 abc +delete from t1 where a > 10000 ; +set @arg01= 10000 + 2 ; +execute stmt1 using @arg01, @NULL ; +set @arg01= 10000 + 1 ; +execute stmt1 using @arg01, @NULL ; +select * from t1 where a > 10000 order by a ; +a b +10001 NULL +10002 NULL +delete from t1 where a > 10000 ; +set @arg01= 10000 + 10 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 9 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 8 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 7 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 6 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 5 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 4 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 3 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 2 ; +execute stmt1 using @arg01, @arg01 ; +set @arg01= 10000 + 1 ; +execute stmt1 using @arg01, @arg01 ; +select * from t1 where a > 10000 order by a ; +a b +10001 10001 +10002 10002 +10003 10003 +10004 10004 +10005 10005 +10006 10006 +10007 10007 +10008 10008 +10009 10009 +10010 10010 +delete from t1 where a > 10000 ; +set @arg00=81 ; +set @arg01='8-1' ; +set @arg02=82 ; +set @arg03='8-2' ; +prepare stmt1 from 'insert into t1 values(?,?),(?,?)'; +execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; +select a,b from t1 where a in (@arg00,@arg02) ; +a b +81 8-1 +82 8-2 +set @arg00=9 ; +set @arg01='nine' ; +prepare stmt1 from 'insert into t1 set a=?, b=? '; +execute stmt1 using @arg00, @arg01 ; +select a,b from t1 where a = @arg00 ; +a b +9 nine +set @arg00=6 ; +set @arg01=1 ; +prepare stmt1 from 'insert into t1 set a=?, b=''sechs'' + on duplicate key update a=a + ?, b=concat(b,''modified'') '; +execute stmt1 using @arg00, @arg01; +select * from t1 order by a; +a b +0 NULL +1 one +2 two +3 three +4 four +5 five +7 sixmodified +8 eight +9 nine +81 8-1 +82 8-2 +set @arg00=81 ; +set @arg01=1 ; +execute stmt1 using @arg00, @arg01; +ERROR 23000: Duplicate entry '82' for key 1 +drop table if exists t2 ; +create table t2 (id int auto_increment primary key) +ENGINE= 'BDB' ; +prepare stmt1 from ' select last_insert_id() ' ; +insert into t2 values (NULL) ; +execute stmt1 ; +last_insert_id() +1 +insert into t2 values (NULL) ; +execute stmt1 ; +last_insert_id() +2 +drop table t2 ; +set @1000=1000 ; +set @x1000_2="x1000_2" ; +set @x1000_3="x1000_3" ; +set @x1000="x1000" ; +set @1100=1100 ; +set @x1100="x1100" ; +set @100=100 ; +set @updated="updated" ; +insert into t1 values(1000,'x1000_1') ; +insert into t1 values(@1000,@x1000_2),(@1000,@x1000_3) +on duplicate key update a = a + @100, b = concat(b,@updated) ; +select a,b from t1 where a >= 1000 order by a ; +a b +1000 x1000_3 +1100 x1000_1updated +delete from t1 where a >= 1000 ; +insert into t1 values(1000,'x1000_1') ; +prepare stmt1 from ' insert into t1 values(?,?),(?,?) + on duplicate key update a = a + ?, b = concat(b,?) '; +execute stmt1 using @1000, @x1000_2, @1000, @x1000_3, @100, @updated ; +select a,b from t1 where a >= 1000 order by a ; +a b +1000 x1000_3 +1100 x1000_1updated +delete from t1 where a >= 1000 ; +insert into t1 values(1000,'x1000_1') ; +execute stmt1 using @1000, @x1000_2, @1100, @x1000_3, @100, @updated ; +select a,b from t1 where a >= 1000 order by a ; +a b +1200 x1000_1updatedupdated +delete from t1 where a >= 1000 ; +prepare stmt1 from ' replace into t1 (a,b) select 100, ''hundred'' '; +execute stmt1; +execute stmt1; +execute stmt1; +test_sequence +------ multi table tests ------ +delete from t1 ; +delete from t9 ; +insert into t1(a,b) values (1, 'one'), (2, 'two'), (3, 'three') ; +insert into t9 (c1,c21) +values (1, 'one'), (2, 'two'), (3, 'three') ; +prepare stmt_delete from " delete t1, t9 + from t1, t9 where t1.a=t9.c1 and t1.b='updated' "; +prepare stmt_update from " update t1, t9 + set t1.b='updated', t9.c21='updated' + where t1.a=t9.c1 and t1.a=? "; +prepare stmt_select1 from " select a, b from t1 order by a" ; +prepare stmt_select2 from " select c1, c21 from t9 order by c1" ; +set @arg00= 1 ; +execute stmt_update using @arg00 ; +execute stmt_delete ; +execute stmt_select1 ; +a b +2 two +3 three +execute stmt_select2 ; +c1 c21 +2 two +3 three +set @arg00= @arg00 + 1 ; +execute stmt_update using @arg00 ; +execute stmt_delete ; +execute stmt_select1 ; +a b +3 three +execute stmt_select2 ; +c1 c21 +3 three +set @arg00= @arg00 + 1 ; +execute stmt_update using @arg00 ; +execute stmt_delete ; +execute stmt_select1 ; +a b +execute stmt_select2 ; +c1 c21 +set @arg00= @arg00 + 1 ; +delete from t1 ; +insert into t1 values (1,'one'); +insert into t1 values (2,'two'); +insert into t1 values (3,'three'); +insert into t1 values (4,'four'); +commit ; +delete from t9 ; +insert into t9 +set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, +c10= 1, c11= 1, c12 = 1, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=true, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; +insert into t9 +set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, +c10= 9, c11= 9, c12 = 9, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=false, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +commit ; +insert into t1 values(0,NULL) ; +set @duplicate='duplicate ' ; +set @1000=1000 ; +set @5=5 ; +select a,b from t1 where a < 5 order by a ; +a b +0 NULL +1 one +2 two +3 three +4 four +insert into t1 select a + @1000, concat(@duplicate,b) from t1 +where a < @5 ; +affected rows: 5 +info: Records: 5 Duplicates: 0 Warnings: 0 +select a,b from t1 where a >= 1000 order by a ; +a b +1000 NULL +1001 duplicate one +1002 duplicate two +1003 duplicate three +1004 duplicate four +delete from t1 where a >= 1000 ; +prepare stmt1 from ' insert into t1 select a + ?, concat(?,b) from t1 +where a < ? ' ; +execute stmt1 using @1000, @duplicate, @5; +affected rows: 5 +info: Records: 5 Duplicates: 0 Warnings: 0 +select a,b from t1 where a >= 1000 order by a ; +a b +1000 NULL +1001 duplicate one +1002 duplicate two +1003 duplicate three +1004 duplicate four +delete from t1 where a >= 1000 ; +set @float=1.00; +set @five='five' ; +drop table if exists t2; +create table t2 like t1 ; +insert into t2 (b,a) +select @duplicate, sum(first.a) from t1 first, t1 second +where first.a <> @5 and second.b = first.b +and second.b <> @five +group by second.b +having sum(second.a) > @2 +union +select b, a + @100 from t1 +where (a,b) in ( select sqrt(a+@1)+CAST(@float AS signed),b +from t1); +affected rows: 3 +info: Records: 3 Duplicates: 0 Warnings: 0 +select a,b from t2 order by a ; +a b +3 duplicate +4 duplicate +103 three +delete from t2 ; +prepare stmt1 from ' insert into t2 (b,a) +select ?, sum(first.a) + from t1 first, t1 second + where first.a <> ? and second.b = first.b and second.b <> ? + group by second.b + having sum(second.a) > ? +union +select b, a + ? from t1 + where (a,b) in ( select sqrt(a+?)+CAST(? AS signed),b + from t1 ) ' ; +execute stmt1 using @duplicate, @5, @five, @2, @100, @1, @float ; +affected rows: 3 +info: Records: 3 Duplicates: 0 Warnings: 0 +select a,b from t2 order by a ; +a b +3 duplicate +4 duplicate +103 three +drop table t2; +drop table if exists t5 ; +set @arg01= 8; +set @arg02= 8.0; +set @arg03= 80.00000000000e-1; +set @arg04= 'abc' ; +set @arg05= CAST('abc' as binary) ; +set @arg06= '1991-08-05' ; +set @arg07= CAST('1991-08-05' as date); +set @arg08= '1991-08-05 01:01:01' ; +set @arg09= CAST('1991-08-05 01:01:01' as datetime) ; +set @arg10= unix_timestamp('1991-01-01 01:01:01'); +set @arg11= YEAR('1991-01-01 01:01:01'); +set @arg12= 8 ; +set @arg12= NULL ; +set @arg13= 8.0 ; +set @arg13= NULL ; +set @arg14= 'abc'; +set @arg14= NULL ; +set @arg15= CAST('abc' as binary) ; +set @arg15= NULL ; +create table t5 as select +8 as const01, @arg01 as param01, +8.0 as const02, @arg02 as param02, +80.00000000000e-1 as const03, @arg03 as param03, +'abc' as const04, @arg04 as param04, +CAST('abc' as binary) as const05, @arg05 as param05, +'1991-08-05' as const06, @arg06 as param06, +CAST('1991-08-05' as date) as const07, @arg07 as param07, +'1991-08-05 01:01:01' as const08, @arg08 as param08, +CAST('1991-08-05 01:01:01' as datetime) as const09, @arg09 as param09, +unix_timestamp('1991-01-01 01:01:01') as const10, @arg10 as param10, +YEAR('1991-01-01 01:01:01') as const11, @arg11 as param11, +NULL as const12, @arg12 as param12, +@arg13 as param13, +@arg14 as param14, +@arg15 as param15; +show create table t5 ; +Table Create Table +t5 CREATE TABLE `t5` ( + `const01` bigint(1) NOT NULL default '0', + `param01` bigint(20) default NULL, + `const02` double(3,1) NOT NULL default '0.0', + `param02` double default NULL, + `const03` double NOT NULL default '0', + `param03` double default NULL, + `const04` char(3) NOT NULL default '', + `param04` longtext, + `const05` binary(3) NOT NULL default '', + `param05` longblob, + `const06` varchar(10) NOT NULL default '', + `param06` longtext, + `const07` date default NULL, + `param07` longblob, + `const08` varchar(19) NOT NULL default '', + `param08` longtext, + `const09` datetime default NULL, + `param09` longblob, + `const10` int(10) NOT NULL default '0', + `param10` bigint(20) default NULL, + `const11` int(4) default NULL, + `param11` bigint(20) default NULL, + `const12` binary(0) default NULL, + `param12` bigint(20) default NULL, + `param13` double default NULL, + `param14` longtext, + `param15` longblob +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +select * from t5 ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def test t5 t5 const01 const01 8 1 1 N 32769 0 63 +def test t5 t5 param01 param01 8 20 1 Y 32768 0 63 +def test t5 t5 const02 const02 5 3 3 N 32769 1 63 +def test t5 t5 param02 param02 5 20 1 Y 32768 31 63 +def test t5 t5 const03 const03 5 23 1 N 32769 31 63 +def test t5 t5 param03 param03 5 20 1 Y 32768 31 63 +def test t5 t5 const04 const04 254 3 3 N 1 0 8 +def test t5 t5 param04 param04 252 16777215 3 Y 16 0 8 +def test t5 t5 const05 const05 254 3 3 N 129 0 63 +def test t5 t5 param05 param05 252 16777215 3 Y 144 0 63 +def test t5 t5 const06 const06 253 10 10 N 1 0 8 +def test t5 t5 param06 param06 252 16777215 10 Y 16 0 8 +def test t5 t5 const07 const07 10 10 10 Y 128 0 63 +def test t5 t5 param07 param07 252 16777215 10 Y 144 0 63 +def test t5 t5 const08 const08 253 19 19 N 1 0 8 +def test t5 t5 param08 param08 252 16777215 19 Y 16 0 8 +def test t5 t5 const09 const09 12 19 19 Y 128 0 63 +def test t5 t5 param09 param09 252 16777215 19 Y 144 0 63 +def test t5 t5 const10 const10 3 10 9 N 32769 0 63 +def test t5 t5 param10 param10 8 20 9 Y 32768 0 63 +def test t5 t5 const11 const11 3 4 4 Y 32768 0 63 +def test t5 t5 param11 param11 8 20 4 Y 32768 0 63 +def test t5 t5 const12 const12 254 0 0 Y 128 0 63 +def test t5 t5 param12 param12 8 20 0 Y 32768 0 63 +def test t5 t5 param13 param13 5 20 0 Y 32768 31 63 +def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8 +def test t5 t5 param15 param15 252 16777215 0 Y 144 0 63 +const01 8 +param01 8 +const02 8.0 +param02 8 +const03 8 +param03 8 +const04 abc +param04 abc +const05 abc +param05 abc +const06 1991-08-05 +param06 1991-08-05 +const07 1991-08-05 +param07 1991-08-05 +const08 1991-08-05 01:01:01 +param08 1991-08-05 01:01:01 +const09 1991-08-05 01:01:01 +param09 1991-08-05 01:01:01 +const10 662680861 +param10 662680861 +const11 1991 +param11 1991 +const12 NULL +param12 NULL +param13 NULL +param14 NULL +param15 NULL +drop table t5 ; +test_sequence +------ data type conversion tests ------ +delete from t1 ; +insert into t1 values (1,'one'); +insert into t1 values (2,'two'); +insert into t1 values (3,'three'); +insert into t1 values (4,'four'); +commit ; +delete from t9 ; +insert into t9 +set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, +c10= 1, c11= 1, c12 = 1, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=true, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; +insert into t9 +set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, +c10= 9, c11= 9, c12 = 9, +c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', +c16= '11:11:11', c17= '2004', +c18= 1, c19=false, c20= 'a', c21= '123456789a', +c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', +c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', +c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; +commit ; +insert into t9 set c1= 0, c15= '1991-01-01 01:01:01' ; +select * from t9 order by c1 ; +c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday +test_sequence +------ select @parameter:= column ------ +prepare full_info from "select @arg01, @arg02, @arg03, @arg04, + @arg05, @arg06, @arg07, @arg08, + @arg09, @arg10, @arg11, @arg12, + @arg13, @arg14, @arg15, @arg16, + @arg17, @arg18, @arg19, @arg20, + @arg21, @arg22, @arg23, @arg24, + @arg25, @arg26, @arg27, @arg28, + @arg29, @arg30, @arg31, @arg32" ; +select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, +@arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8, +@arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12, +@arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16, +@arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20, +@arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24, +@arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28, +@arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32 +from t9 where c1= 1 ; +@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 +1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 1 Y 128 31 63 +def @arg03 254 20 1 Y 128 31 63 +def @arg04 254 20 1 Y 128 31 63 +def @arg05 254 20 1 Y 128 31 63 +def @arg06 254 20 1 Y 128 31 63 +def @arg07 254 20 1 Y 128 31 63 +def @arg08 254 20 1 Y 128 31 63 +def @arg09 254 20 1 Y 128 31 63 +def @arg10 254 20 1 Y 128 31 63 +def @arg11 254 20 1 Y 128 31 63 +def @arg12 254 20 1 Y 128 31 63 +def @arg13 254 8192 10 Y 128 31 63 +def @arg14 254 8192 19 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 8 Y 128 31 63 +def @arg17 254 20 4 Y 128 31 63 +def @arg18 254 20 1 Y 128 31 63 +def @arg19 254 20 1 Y 128 31 63 +def @arg20 254 8192 1 Y 0 31 8 +def @arg21 254 8192 10 Y 0 31 8 +def @arg22 254 8192 30 Y 0 31 8 +def @arg23 254 8192 8 Y 128 31 63 +def @arg24 254 8192 8 Y 0 31 8 +def @arg25 254 8192 4 Y 128 31 63 +def @arg26 254 8192 4 Y 0 31 8 +def @arg27 254 8192 10 Y 128 31 63 +def @arg28 254 8192 10 Y 0 31 8 +def @arg29 254 8192 8 Y 128 31 63 +def @arg30 254 8192 8 Y 0 31 8 +def @arg31 254 8192 3 Y 0 31 8 +def @arg32 254 8192 6 Y 128 31 63 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, +@arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8, +@arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12, +@arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16, +@arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20, +@arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24, +@arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28, +@arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32 +from t9 where c1= 0 ; +@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 0 Y 128 31 63 +def @arg03 254 20 0 Y 128 31 63 +def @arg04 254 20 0 Y 128 31 63 +def @arg05 254 20 0 Y 128 31 63 +def @arg06 254 20 0 Y 128 31 63 +def @arg07 254 20 0 Y 128 31 63 +def @arg08 254 20 0 Y 128 31 63 +def @arg09 254 20 0 Y 128 31 63 +def @arg10 254 20 0 Y 128 31 63 +def @arg11 254 20 0 Y 128 31 63 +def @arg12 254 20 0 Y 128 31 63 +def @arg13 254 8192 0 Y 128 31 63 +def @arg14 254 8192 0 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 0 Y 128 31 63 +def @arg17 254 20 0 Y 128 31 63 +def @arg18 254 20 0 Y 128 31 63 +def @arg19 254 20 0 Y 128 31 63 +def @arg20 254 8192 0 Y 0 31 8 +def @arg21 254 8192 0 Y 0 31 8 +def @arg22 254 8192 0 Y 0 31 8 +def @arg23 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 0 31 8 +def @arg25 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 0 31 8 +def @arg27 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 0 31 8 +def @arg29 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 0 31 8 +def @arg31 254 8192 0 Y 0 31 8 +def @arg32 254 8192 0 Y 0 31 8 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +prepare stmt1 from "select + @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, + @arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8, + @arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12, + @arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16, + @arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20, + @arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24, + @arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28, + @arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32 +from t9 where c1= ?" ; +set @my_key= 1 ; +execute stmt1 using @my_key ; +@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 +1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 1 Y 128 31 63 +def @arg03 254 20 1 Y 128 31 63 +def @arg04 254 20 1 Y 128 31 63 +def @arg05 254 20 1 Y 128 31 63 +def @arg06 254 20 1 Y 128 31 63 +def @arg07 254 20 1 Y 128 31 63 +def @arg08 254 20 1 Y 128 31 63 +def @arg09 254 20 1 Y 128 31 63 +def @arg10 254 20 1 Y 128 31 63 +def @arg11 254 20 1 Y 128 31 63 +def @arg12 254 20 1 Y 128 31 63 +def @arg13 254 8192 10 Y 128 31 63 +def @arg14 254 8192 19 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 8 Y 128 31 63 +def @arg17 254 20 4 Y 128 31 63 +def @arg18 254 20 1 Y 128 31 63 +def @arg19 254 20 1 Y 128 31 63 +def @arg20 254 8192 1 Y 0 31 8 +def @arg21 254 8192 10 Y 0 31 8 +def @arg22 254 8192 30 Y 0 31 8 +def @arg23 254 8192 8 Y 128 31 63 +def @arg24 254 8192 8 Y 0 31 8 +def @arg25 254 8192 4 Y 128 31 63 +def @arg26 254 8192 4 Y 0 31 8 +def @arg27 254 8192 10 Y 128 31 63 +def @arg28 254 8192 10 Y 0 31 8 +def @arg29 254 8192 8 Y 128 31 63 +def @arg30 254 8192 8 Y 0 31 8 +def @arg31 254 8192 3 Y 0 31 8 +def @arg32 254 8192 6 Y 128 31 63 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +set @my_key= 0 ; +execute stmt1 using @my_key ; +@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 0 Y 128 31 63 +def @arg03 254 20 0 Y 128 31 63 +def @arg04 254 20 0 Y 128 31 63 +def @arg05 254 20 0 Y 128 31 63 +def @arg06 254 20 0 Y 128 31 63 +def @arg07 254 20 0 Y 128 31 63 +def @arg08 254 20 0 Y 128 31 63 +def @arg09 254 20 0 Y 128 31 63 +def @arg10 254 20 0 Y 128 31 63 +def @arg11 254 20 0 Y 128 31 63 +def @arg12 254 20 0 Y 128 31 63 +def @arg13 254 8192 0 Y 128 31 63 +def @arg14 254 8192 0 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 0 Y 128 31 63 +def @arg17 254 20 0 Y 128 31 63 +def @arg18 254 20 0 Y 128 31 63 +def @arg19 254 20 0 Y 128 31 63 +def @arg20 254 8192 0 Y 0 31 8 +def @arg21 254 8192 0 Y 0 31 8 +def @arg22 254 8192 0 Y 0 31 8 +def @arg23 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 0 31 8 +def @arg25 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 0 31 8 +def @arg27 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 0 31 8 +def @arg29 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 0 31 8 +def @arg31 254 8192 0 Y 0 31 8 +def @arg32 254 8192 0 Y 0 31 8 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +prepare stmt1 from "select ? := c1 from t9 where c1= 1" ; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':= c1 from t9 where c1= 1' at line 1 +test_sequence +------ select column, .. into @parm,.. ------ +select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, +c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, +c25, c26, c27, c28, c29, c30, c31, c32 +into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, +@arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, +@arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24, +@arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 +from t9 where c1= 1 ; +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 1 Y 128 31 63 +def @arg03 254 20 1 Y 128 31 63 +def @arg04 254 20 1 Y 128 31 63 +def @arg05 254 20 1 Y 128 31 63 +def @arg06 254 20 1 Y 128 31 63 +def @arg07 254 20 1 Y 128 31 63 +def @arg08 254 20 1 Y 128 31 63 +def @arg09 254 20 1 Y 128 31 63 +def @arg10 254 20 1 Y 128 31 63 +def @arg11 254 20 1 Y 128 31 63 +def @arg12 254 20 1 Y 128 31 63 +def @arg13 254 8192 10 Y 128 31 63 +def @arg14 254 8192 19 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 8 Y 128 31 63 +def @arg17 254 20 4 Y 128 31 63 +def @arg18 254 20 1 Y 128 31 63 +def @arg19 254 20 1 Y 128 31 63 +def @arg20 254 8192 1 Y 0 31 8 +def @arg21 254 8192 10 Y 0 31 8 +def @arg22 254 8192 30 Y 0 31 8 +def @arg23 254 8192 8 Y 128 31 63 +def @arg24 254 8192 8 Y 0 31 8 +def @arg25 254 8192 4 Y 128 31 63 +def @arg26 254 8192 4 Y 0 31 8 +def @arg27 254 8192 10 Y 128 31 63 +def @arg28 254 8192 10 Y 0 31 8 +def @arg29 254 8192 8 Y 128 31 63 +def @arg30 254 8192 8 Y 0 31 8 +def @arg31 254 8192 3 Y 0 31 8 +def @arg32 254 8192 6 Y 128 31 63 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, +c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, +c25, c26, c27, c28, c29, c30, c31, c32 +into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, +@arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, +@arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24, +@arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 +from t9 where c1= 0 ; +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 0 Y 128 31 63 +def @arg03 254 20 0 Y 128 31 63 +def @arg04 254 20 0 Y 128 31 63 +def @arg05 254 20 0 Y 128 31 63 +def @arg06 254 20 0 Y 128 31 63 +def @arg07 254 20 0 Y 128 31 63 +def @arg08 254 20 0 Y 128 31 63 +def @arg09 254 20 0 Y 128 31 63 +def @arg10 254 20 0 Y 128 31 63 +def @arg11 254 20 0 Y 128 31 63 +def @arg12 254 20 0 Y 128 31 63 +def @arg13 254 8192 0 Y 128 31 63 +def @arg14 254 8192 0 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 0 Y 128 31 63 +def @arg17 254 20 0 Y 128 31 63 +def @arg18 254 20 0 Y 128 31 63 +def @arg19 254 20 0 Y 128 31 63 +def @arg20 254 8192 0 Y 0 31 8 +def @arg21 254 8192 0 Y 0 31 8 +def @arg22 254 8192 0 Y 0 31 8 +def @arg23 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 0 31 8 +def @arg25 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 0 31 8 +def @arg27 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 0 31 8 +def @arg29 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 0 31 8 +def @arg31 254 8192 0 Y 0 31 8 +def @arg32 254 8192 0 Y 0 31 8 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +prepare stmt1 from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, + c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, + c25, c26, c27, c28, c29, c30, c31, c32 +into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, + @arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, + @arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24, + @arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 +from t9 where c1= ?" ; +set @my_key= 1 ; +execute stmt1 using @my_key ; +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 1 Y 128 31 63 +def @arg03 254 20 1 Y 128 31 63 +def @arg04 254 20 1 Y 128 31 63 +def @arg05 254 20 1 Y 128 31 63 +def @arg06 254 20 1 Y 128 31 63 +def @arg07 254 20 1 Y 128 31 63 +def @arg08 254 20 1 Y 128 31 63 +def @arg09 254 20 1 Y 128 31 63 +def @arg10 254 20 1 Y 128 31 63 +def @arg11 254 20 1 Y 128 31 63 +def @arg12 254 20 1 Y 128 31 63 +def @arg13 254 8192 10 Y 128 31 63 +def @arg14 254 8192 19 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 8 Y 128 31 63 +def @arg17 254 20 4 Y 128 31 63 +def @arg18 254 20 1 Y 128 31 63 +def @arg19 254 20 1 Y 128 31 63 +def @arg20 254 8192 1 Y 0 31 8 +def @arg21 254 8192 10 Y 0 31 8 +def @arg22 254 8192 30 Y 0 31 8 +def @arg23 254 8192 8 Y 128 31 63 +def @arg24 254 8192 8 Y 0 31 8 +def @arg25 254 8192 4 Y 128 31 63 +def @arg26 254 8192 4 Y 0 31 8 +def @arg27 254 8192 10 Y 128 31 63 +def @arg28 254 8192 10 Y 0 31 8 +def @arg29 254 8192 8 Y 128 31 63 +def @arg30 254 8192 8 Y 0 31 8 +def @arg31 254 8192 3 Y 0 31 8 +def @arg32 254 8192 6 Y 128 31 63 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +set @my_key= 0 ; +execute stmt1 using @my_key ; +execute full_info ; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def @arg01 254 20 1 Y 128 31 63 +def @arg02 254 20 0 Y 128 31 63 +def @arg03 254 20 0 Y 128 31 63 +def @arg04 254 20 0 Y 128 31 63 +def @arg05 254 20 0 Y 128 31 63 +def @arg06 254 20 0 Y 128 31 63 +def @arg07 254 20 0 Y 128 31 63 +def @arg08 254 20 0 Y 128 31 63 +def @arg09 254 20 0 Y 128 31 63 +def @arg10 254 20 0 Y 128 31 63 +def @arg11 254 20 0 Y 128 31 63 +def @arg12 254 20 0 Y 128 31 63 +def @arg13 254 8192 0 Y 128 31 63 +def @arg14 254 8192 0 Y 128 31 63 +def @arg15 254 8192 19 Y 128 31 63 +def @arg16 254 8192 0 Y 128 31 63 +def @arg17 254 20 0 Y 128 31 63 +def @arg18 254 20 0 Y 128 31 63 +def @arg19 254 20 0 Y 128 31 63 +def @arg20 254 8192 0 Y 0 31 8 +def @arg21 254 8192 0 Y 0 31 8 +def @arg22 254 8192 0 Y 0 31 8 +def @arg23 254 8192 0 Y 128 31 63 +def @arg24 254 8192 0 Y 0 31 8 +def @arg25 254 8192 0 Y 128 31 63 +def @arg26 254 8192 0 Y 0 31 8 +def @arg27 254 8192 0 Y 128 31 63 +def @arg28 254 8192 0 Y 0 31 8 +def @arg29 254 8192 0 Y 128 31 63 +def @arg30 254 8192 0 Y 0 31 8 +def @arg31 254 8192 0 Y 0 31 8 +def @arg32 254 8192 0 Y 0 31 8 +@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 +0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +prepare stmt1 from "select c1 into ? from t9 where c1= 1" ; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? from t9 where c1= 1' at line 1 +test_sequence +-- insert into numeric columns -- +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20 ) ; +set @arg00= 21 ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt1 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22 )" ; +execute stmt1 ; +set @arg00= 23; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, +30.0, 30.0, 30.0 ) ; +set @arg00= 31.0 ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt1 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, + 32.0, 32.0, 32.0 )" ; +execute stmt1 ; +set @arg00= 33.0; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( '40', '40', '40', '40', '40', '40', '40', '40', +'40', '40', '40' ) ; +set @arg00= '41' ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt1 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( '42', '42', '42', '42', '42', '42', '42', '42', + '42', '42', '42' )" ; +execute stmt1 ; +set @arg00= '43'; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( CAST('50' as binary), CAST('50' as binary), +CAST('50' as binary), CAST('50' as binary), CAST('50' as binary), +CAST('50' as binary), CAST('50' as binary), CAST('50' as binary), +CAST('50' as binary), CAST('50' as binary), CAST('50' as binary) ) ; +set @arg00= CAST('51' as binary) ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt1 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( CAST('52' as binary), CAST('52' as binary), + CAST('52' as binary), CAST('52' as binary), CAST('52' as binary), + CAST('52' as binary), CAST('52' as binary), CAST('52' as binary), + CAST('52' as binary), CAST('52' as binary), CAST('52' as binary) )" ; +execute stmt1 ; +set @arg00= CAST('53' as binary) ; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +set @arg00= 2 ; +set @arg00= NULL ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( 60, NULL, NULL, NULL, NULL, NULL, NULL, NULL, +NULL, NULL, NULL ) ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( 61, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt1 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 62, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL )" ; +execute stmt1 ; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 63, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +set @arg00= 8.0 ; +set @arg00= NULL ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( 71, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 73, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +set @arg00= 'abc' ; +set @arg00= NULL ; +insert into t9 +( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values +( 81, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ) ; +prepare stmt2 from "insert into t9 + ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 83, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 +from t9 where c1 >= 20 +order by c1 ; +c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c12 +20 20 20 20 20 20 20 20 20 20 20.0000 +21 21 21 21 21 21 21 21 21 21 21.0000 +22 22 22 22 22 22 22 22 22 22 22.0000 +23 23 23 23 23 23 23 23 23 23 23.0000 +30 30 30 30 30 30 30 30 30 30 30.0000 +31 31 31 31 31 31 31 31 31 31 31.0000 +32 32 32 32 32 32 32 32 32 32 32.0000 +33 33 33 33 33 33 33 33 33 33 33.0000 +40 40 40 40 40 40 40 40 40 40 40.0000 +41 41 41 41 41 41 41 41 41 41 41.0000 +42 42 42 42 42 42 42 42 42 42 42.0000 +43 43 43 43 43 43 43 43 43 43 43.0000 +50 50 50 50 50 50 50 50 50 50 50.0000 +51 51 51 51 51 51 51 51 51 51 51.0000 +52 52 52 52 52 52 52 52 52 52 52.0000 +53 53 53 53 53 53 53 53 53 53 53.0000 +60 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +61 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +62 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +63 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +71 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +73 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +81 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +83 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +test_sequence +-- select .. where numeric column = .. -- +set @arg00= 20; +select 'true' as found from t9 +where c1= 20 and c2= 20 and c3= 20 and c4= 20 and c5= 20 and c6= 20 and c7= 20 +and c8= 20 and c9= 20 and c10= 20 and c12= 20; +found +true +select 'true' as found from t9 +where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 +and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 +and c12= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c2= 20 and c3= 20 and c4= 20 and c5= 20 and c6= 20 and c7= 20 + and c8= 20 and c9= 20 and c10= 20 and c12= 20 "; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? + and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? + and c12= ? "; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +found +true +set @arg00= 20.0; +select 'true' as found from t9 +where c1= 20.0 and c2= 20.0 and c3= 20.0 and c4= 20.0 and c5= 20.0 and c6= 20.0 +and c7= 20.0 and c8= 20.0 and c9= 20.0 and c10= 20.0 and c12= 20.0; +found +true +select 'true' as found from t9 +where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 +and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 +and c12= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20.0 and c2= 20.0 and c3= 20.0 and c4= 20.0 and c5= 20.0 and c6= 20.0 + and c7= 20.0 and c8= 20.0 and c9= 20.0 and c10= 20.0 and c12= 20.0 "; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? + and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? + and c12= ? "; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +found +true +select 'true' as found from t9 +where c1= '20' and c2= '20' and c3= '20' and c4= '20' and c5= '20' and c6= '20' + and c7= '20' and c8= '20' and c9= '20' and c10= '20' and c12= '20'; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= '20' and c2= '20' and c3= '20' and c4= '20' and c5= '20' and c6= '20' + and c7= '20' and c8= '20' and c9= '20' and c10= '20' and c12= '20' "; +execute stmt1 ; +found +true +set @arg00= '20'; +select 'true' as found from t9 +where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 +and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 +and c12= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? + and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? + and c12= ? "; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +found +true +select 'true' as found from t9 +where c1= CAST('20' as binary) and c2= CAST('20' as binary) and +c3= CAST('20' as binary) and c4= CAST('20' as binary) and +c5= CAST('20' as binary) and c6= CAST('20' as binary) and +c7= CAST('20' as binary) and c8= CAST('20' as binary) and +c9= CAST('20' as binary) and c10= CAST('20' as binary) and +c12= CAST('20' as binary); +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= CAST('20' as binary) and c2= CAST('20' as binary) and + c3= CAST('20' as binary) and c4= CAST('20' as binary) and + c5= CAST('20' as binary) and c6= CAST('20' as binary) and + c7= CAST('20' as binary) and c8= CAST('20' as binary) and + c9= CAST('20' as binary) and c10= CAST('20' as binary) and + c12= CAST('20' as binary) "; +execute stmt1 ; +found +true +set @arg00= CAST('20' as binary) ; +select 'true' as found from t9 +where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 +and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 +and c12= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? + and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? + and c12= ? "; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00 ; +found +true +delete from t9 ; +test_sequence +-- some numeric overflow experiments -- +prepare my_insert from "insert into t9 + ( c21, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) +values + ( 'O', ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; +prepare my_select from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 +from t9 where c21 = 'O' "; +prepare my_delete from "delete from t9 where c21 = 'O' "; +set @arg00= 9223372036854775807 ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1264 Data truncated; out of range for column 'c1' at row 1 +Warning 1264 Data truncated; out of range for column 'c2' at row 1 +Warning 1264 Data truncated; out of range for column 'c3' at row 1 +Warning 1264 Data truncated; out of range for column 'c4' at row 1 +Warning 1264 Data truncated; out of range for column 'c5' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 127 +c2 32767 +c3 8388607 +c4 2147483647 +c5 2147483647 +c6 9223372036854775807 +c7 9.22337e+18 +c8 9.22337203685478e+18 +c9 9.22337203685478e+18 +c10 9.22337203685478e+18 +c12 99999.9999 +execute my_delete ; +set @arg00= '9223372036854775807' ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1264 Data truncated; out of range for column 'c1' at row 1 +Warning 1264 Data truncated; out of range for column 'c2' at row 1 +Warning 1264 Data truncated; out of range for column 'c3' at row 1 +Warning 1265 Data truncated for column 'c4' at row 1 +Warning 1265 Data truncated for column 'c5' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 127 +c2 32767 +c3 8388607 +c4 2147483647 +c5 2147483647 +c6 9223372036854775807 +c7 9.22337e+18 +c8 9.22337203685478e+18 +c9 9.22337203685478e+18 +c10 9.22337203685478e+18 +c12 99999.9999 +execute my_delete ; +set @arg00= -9223372036854775808 ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1264 Data truncated; out of range for column 'c1' at row 1 +Warning 1264 Data truncated; out of range for column 'c2' at row 1 +Warning 1264 Data truncated; out of range for column 'c3' at row 1 +Warning 1264 Data truncated; out of range for column 'c4' at row 1 +Warning 1264 Data truncated; out of range for column 'c5' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 -128 +c2 -32768 +c3 -8388608 +c4 -2147483648 +c5 -2147483648 +c6 -9223372036854775808 +c7 -9.22337e+18 +c8 -9.22337203685478e+18 +c9 -9.22337203685478e+18 +c10 -9.22337203685478e+18 +c12 -9999.9999 +execute my_delete ; +set @arg00= '-9223372036854775808' ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1264 Data truncated; out of range for column 'c1' at row 1 +Warning 1264 Data truncated; out of range for column 'c2' at row 1 +Warning 1264 Data truncated; out of range for column 'c3' at row 1 +Warning 1265 Data truncated for column 'c4' at row 1 +Warning 1265 Data truncated for column 'c5' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 -128 +c2 -32768 +c3 -8388608 +c4 -2147483648 +c5 -2147483648 +c6 -9223372036854775808 +c7 -9.22337e+18 +c8 -9.22337203685478e+18 +c9 -9.22337203685478e+18 +c10 -9.22337203685478e+18 +c12 -9999.9999 +execute my_delete ; +set @arg00= 1.11111111111111111111e+50 ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1264 Data truncated; out of range for column 'c1' at row 1 +Warning 1264 Data truncated; out of range for column 'c2' at row 1 +Warning 1264 Data truncated; out of range for column 'c3' at row 1 +Warning 1264 Data truncated; out of range for column 'c4' at row 1 +Warning 1264 Data truncated; out of range for column 'c5' at row 1 +Warning 1264 Data truncated; out of range for column 'c6' at row 1 +Warning 1264 Data truncated; out of range for column 'c7' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 127 +c2 32767 +c3 8388607 +c4 2147483647 +c5 2147483647 +c6 9223372036854775807 +c7 3.40282e+38 +c8 1.11111111111111e+50 +c9 1.11111111111111e+50 +c10 1.11111111111111e+50 +c12 99999.9999 +execute my_delete ; +set @arg00= '1.11111111111111111111e+50' ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1265 Data truncated for column 'c1' at row 1 +Warning 1265 Data truncated for column 'c2' at row 1 +Warning 1265 Data truncated for column 'c3' at row 1 +Warning 1265 Data truncated for column 'c4' at row 1 +Warning 1265 Data truncated for column 'c5' at row 1 +Warning 1265 Data truncated for column 'c6' at row 1 +Warning 1264 Data truncated; out of range for column 'c7' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 1 +c2 1 +c3 1 +c4 1 +c5 1 +c6 1 +c7 3.40282e+38 +c8 1.11111111111111e+50 +c9 1.11111111111111e+50 +c10 1.11111111111111e+50 +c12 99999.9999 +execute my_delete ; +set @arg00= -1.11111111111111111111e+50 ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1264 Data truncated; out of range for column 'c1' at row 1 +Warning 1264 Data truncated; out of range for column 'c2' at row 1 +Warning 1264 Data truncated; out of range for column 'c3' at row 1 +Warning 1264 Data truncated; out of range for column 'c4' at row 1 +Warning 1264 Data truncated; out of range for column 'c5' at row 1 +Warning 1264 Data truncated; out of range for column 'c6' at row 1 +Warning 1264 Data truncated; out of range for column 'c7' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 -128 +c2 -32768 +c3 -8388608 +c4 -2147483648 +c5 -2147483648 +c6 -9223372036854775808 +c7 -3.40282e+38 +c8 -1.11111111111111e+50 +c9 -1.11111111111111e+50 +c10 -1.11111111111111e+50 +c12 -9999.9999 +execute my_delete ; +set @arg00= '-1.11111111111111111111e+50' ; +execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +Warnings: +Warning 1265 Data truncated for column 'c1' at row 1 +Warning 1265 Data truncated for column 'c2' at row 1 +Warning 1265 Data truncated for column 'c3' at row 1 +Warning 1265 Data truncated for column 'c4' at row 1 +Warning 1265 Data truncated for column 'c5' at row 1 +Warning 1265 Data truncated for column 'c6' at row 1 +Warning 1264 Data truncated; out of range for column 'c7' at row 1 +Warning 1264 Data truncated; out of range for column 'c12' at row 1 +execute my_select ; +c1 -1 +c2 -1 +c3 -1 +c4 -1 +c5 -1 +c6 -1 +c7 -3.40282e+38 +c8 -1.11111111111111e+50 +c9 -1.11111111111111e+50 +c10 -1.11111111111111e+50 +c12 -9999.9999 +execute my_delete ; +test_sequence +-- insert into string columns -- +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 +select c1, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30 +from t9 where c1 >= 20 +order by c1 ; +c1 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 +20 2 20 20 20 20 20 20 20 20 20 20 +21 2 21 21 21 21 21 21 21 21 21 21 +22 2 22 22 22 22 22 22 22 22 22 22 +23 2 23 23 23 23 23 23 23 23 23 23 +30 3 30 30 30 30 30 30 30 30 30 30 +31 3 31 31 31 31 31 31 31 31 31 31 +32 3 32 32 32 32 32 32 32 32 32 32 +33 3 33 33 33 33 33 33 33 33 33 33 +40 4 40 40 40 40 40 40 40 40 40 40 +41 4 41 41 41 41 41 41 41 41 41 41 +42 4 42 42 42 42 42 42 42 42 42 42 +43 4 43 43 43 43 43 43 43 43 43 43 +50 5 50 50 50.00 50.00 50.00 50.00 50.00 50.00 50.00 50.00 +51 5 51 51 51 51 51 51 51 51 51 51 +52 5 52 52 52.00 52.00 52.00 52.00 52.00 52.00 52.00 52.00 +53 5 53 53 53.00 53.00 53.00 53.00 53.00 53.00 53.00 53.00 +54 5 54 54 54.00 54.00 54.00 54.00 54.00 54.00 54.00 54.00 +55 5 55 55 55 55 55 55 55 55 55 55 +56 6 56 56 56.00 56.00 56.00 56.00 56.00 56.00 56.00 56.00 +57 6 57 57 57.00 57.00 57.00 57.00 57.00 57.00 57.00 57.00 +60 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +61 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +62 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +63 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +71 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +73 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +81 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +83 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL +test_sequence +-- select .. where string column = .. -- +set @arg00= '20'; +select 'true' as found from t9 +where c1= 20 and concat(c20,substr('20',1+length(c20)))= '20' and c21= '20' and +c22= '20' and c23= '20' and c24= '20' and c25= '20' and c26= '20' and +c27= '20' and c28= '20' and c29= '20' and c30= '20' ; +found +true +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and +c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and +c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr('20',1+length(c20)))= '20' and c21= '20' and + c22= '20' and c23= '20' and c24= '20' and c25= '20' and c26= '20' and + c27= '20' and c28= '20' and c29= '20' and c30= '20'" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and + c21= ? and c22= ? and c23= ? and c25= ? and + c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +found +true +set @arg00= CAST('20' as binary); +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(CAST('20' as binary),1+length(c20))) += CAST('20' as binary) and c21= CAST('20' as binary) +and c22= CAST('20' as binary) and c23= CAST('20' as binary) and +c24= CAST('20' as binary) and c25= CAST('20' as binary) and +c26= CAST('20' as binary) and c27= CAST('20' as binary) and +c28= CAST('20' as binary) and c29= CAST('20' as binary) and +c30= CAST('20' as binary) ; +found +true +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(@arg00,1+length(c20))) = @arg00 and +c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and +c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and +c30= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(CAST('20' as binary),1+length(c20))) + = CAST('20' as binary) and c21= CAST('20' as binary) + and c22= CAST('20' as binary) and c23= CAST('20' as binary) and + c24= CAST('20' as binary) and c25= CAST('20' as binary) and + c26= CAST('20' as binary) and c27= CAST('20' as binary) and + c28= CAST('20' as binary) and c29= CAST('20' as binary) and + c30= CAST('20' as binary)" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(?,1+length(c20))) = ? and c21= ? and + c22= ? and c23= ? and c25= ? and c26= ? and c27= ? and c28= ? and + c29= ? and c30= ?"; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +found +true +set @arg00= 20; +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(20,1+length(c20)))= 20 and c21= 20 and +c22= 20 and c23= 20 and c24= 20 and c25= 20 and c26= 20 and +c27= 20 and c28= 20 and c29= 20 and c30= 20 ; +found +true +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and +c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and +c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(20,1+length(c20)))= 20 and c21= 20 and + c22= 20 and c23= 20 and c24= 20 and c25= 20 and c26= 20 and + c27= 20 and c28= 20 and c29= 20 and c30= 20" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and + c21= ? and c22= ? and c23= ? and c25= ? and + c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +found +true +set @arg00= 20.0; +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(20.0,1+length(c20)))= 20.0 and c21= 20.0 and +c22= 20.0 and c23= 20.0 and c24= 20.0 and c25= 20.0 and c26= 20.0 and +c27= 20.0 and c28= 20.0 and c29= 20.0 and c30= 20.0 ; +found +true +select 'true' as found from t9 +where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and +c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and +c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(20.0,1+length(c20)))= 20.0 and c21= 20.0 and + c22= 20.0 and c23= 20.0 and c24= 20.0 and c25= 20.0 and c26= 20.0 and + c27= 20.0 and c28= 20.0 and c29= 20.0 and c30= 20.0" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and + c21= ? and c22= ? and c23= ? and c25= ? and + c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, +@arg00, @arg00, @arg00, @arg00, @arg00 ; +found +true +delete from t9 ; +test_sequence +-- insert into date/time columns -- +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c17' at row 1 +Warnings: +Warning 1264 Data truncated; out of range for column 'c13' at row 1 +Warning 1265 Data truncated for column 'c14' at row 1 +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1264 Data truncated; out of range for column 'c13' at row 1 +Warning 1265 Data truncated for column 'c14' at row 1 +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1264 Data truncated; out of range for column 'c13' at row 1 +Warning 1265 Data truncated for column 'c14' at row 1 +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1264 Data truncated; out of range for column 'c13' at row 1 +Warning 1265 Data truncated for column 'c14' at row 1 +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +Warnings: +Warning 1265 Data truncated for column 'c15' at row 1 +Warning 1264 Data truncated; out of range for column 'c16' at row 1 +Warning 1264 Data truncated; out of range for column 'c17' at row 1 +select c1, c13, c14, c15, c16, c17 from t9 order by c1 ; +c1 c13 c14 c15 c16 c17 +20 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +21 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +22 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +23 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +30 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +31 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +32 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +33 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 +40 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +41 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +42 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +43 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +50 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +51 0010-00-00 0010-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +52 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +53 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +60 NULL NULL 1991-01-01 01:01:01 NULL NULL +61 NULL NULL 1991-01-01 01:01:01 NULL NULL +62 NULL NULL 1991-01-01 01:01:01 NULL NULL +63 NULL NULL 1991-01-01 01:01:01 NULL NULL +71 NULL NULL 1991-01-01 01:01:01 NULL NULL +73 NULL NULL 1991-01-01 01:01:01 NULL NULL +81 NULL NULL 1991-01-01 01:01:01 NULL NULL +83 NULL NULL 1991-01-01 01:01:01 NULL NULL +test_sequence +-- select .. where date/time column = .. -- +set @arg00= '1991-01-01 01:01:01' ; +select 'true' as found from t9 +where c1= 20 and c13= '1991-01-01 01:01:01' and c14= '1991-01-01 01:01:01' and +c15= '1991-01-01 01:01:01' and c16= '1991-01-01 01:01:01' and +c17= '1991-01-01 01:01:01' ; +found +true +select 'true' as found from t9 +where c1= 20 and c13= @arg00 and c14= @arg00 and c15= @arg00 and c16= @arg00 +and c17= @arg00 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c13= '1991-01-01 01:01:01' and c14= '1991-01-01 01:01:01' and + c15= '1991-01-01 01:01:01' and c16= '1991-01-01 01:01:01' and + c17= '1991-01-01 01:01:01'" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c13= ? and c14= ? and c15= ? and c16= ? and c17= ?" ; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00 ; +found +true +set @arg00= CAST('1991-01-01 01:01:01' as datetime) ; +select 'true' as found from t9 +where c1= 20 and c13= CAST('1991-01-01 01:01:01' as datetime) and +c14= CAST('1991-01-01 01:01:01' as datetime) and +c15= CAST('1991-01-01 01:01:01' as datetime) and +c16= CAST('1991-01-01 01:01:01' as datetime) and +c17= CAST('1991-01-01 01:01:01' as datetime) ; +found +true +select 'true' as found from t9 +where c1= 20 and c13= @arg00 and c14= @arg00 and c15= @arg00 and c16= @arg00 +and c17= @arg00 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c13= CAST('1991-01-01 01:01:01' as datetime) and + c14= CAST('1991-01-01 01:01:01' as datetime) and + c15= CAST('1991-01-01 01:01:01' as datetime) and + c16= CAST('1991-01-01 01:01:01' as datetime) and + c17= CAST('1991-01-01 01:01:01' as datetime)" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c13= ? and c14= ? and c15= ? and c16= ? and c17= ?" ; +execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00 ; +found +true +set @arg00= 1991 ; +select 'true' as found from t9 +where c1= 20 and c17= 1991 ; +found +true +select 'true' as found from t9 +where c1= 20 and c17= @arg00 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c17= 1991" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and c17= ?" ; +execute stmt1 using @arg00 ; +found +true +set @arg00= 1.991e+3 ; +select 'true' as found from t9 +where c1= 20 and abs(c17 - 1.991e+3) < 0.01 ; +found +true +select 'true' as found from t9 +where c1= 20 and abs(c17 - @arg00) < 0.01 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and abs(c17 - 1.991e+3) < 0.01" ; +execute stmt1 ; +found +true +prepare stmt1 from "select 'true' as found from t9 +where c1= 20 and abs(c17 - ?) < 0.01" ; +execute stmt1 using @arg00 ; +found +true +drop table t1, t9; diff --git a/mysql-test/r/query_cache.result.es b/mysql-test/r/query_cache.result.es index 218e4e1ae2a..1e16354d87d 100644 --- a/mysql-test/r/query_cache.result.es +++ b/mysql-test/r/query_cache.result.es @@ -791,6 +791,19 @@ Qcache_queries_in_cache 1 unlock table; drop table t1,t2; set query_cache_wlock_invalidate=default; +CREATE TABLE t1 (id INT PRIMARY KEY); +insert into t1 values (1),(2),(3); +select * from t1; +id +1 +2 +3 +create temporary table t1 (a int not null auto_increment +primary key); +select * from t1; +a +drop table t1; +drop table t1; SET NAMES koi8r; CREATE TABLE t1 (a char(1) character set koi8r); INSERT INTO t1 VALUES (_koi8r'á'),(_koi8r'Á'); @@ -901,6 +914,8 @@ set group_concat_max_len=10; select group_concat(a) FROM t1 group by b; group_concat(a) 1234567890 +Warnings: +Warning 1260 1 line(s) were cut by GROUP_CONCAT() set group_concat_max_len=1024; select group_concat(a) FROM t1 group by b; group_concat(a) diff --git a/mysql-test/r/select.result.es b/mysql-test/r/select.result.es index 2ff58372d6d..da761ebb822 100644 --- a/mysql-test/r/select.result.es +++ b/mysql-test/r/select.result.es @@ -1,4 +1,5 @@ drop table if exists t1,t2,t3,t4; +drop table if exists t1_1,t1_2,t9_1,t9_2; CREATE TABLE t1 ( Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL, Varor_period smallint(4) unsigned DEFAULT '0' NOT NULL @@ -2056,6 +2057,10 @@ t2 1 fld3 1 fld3 A NULL NULL NULL BTREE drop table t4, t3, t2, t1; DO 1; DO benchmark(100,1+1),1,1; +do default; +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 +do foobar; +ERROR 42S22: Unknown column 'foobar' in 'field list' CREATE TABLE t1 ( id mediumint(8) unsigned NOT NULL auto_increment, pseudo varchar(35) NOT NULL default '', @@ -2348,6 +2353,27 @@ select * from t2,t3 where t2.s = t3.s; s s two two drop table t1, t2, t3; +create table t1 (a integer, b integer, index(a), index(b)); +create table t2 (c integer, d integer, index(c), index(d)); +insert into t1 values (1,2), (2,2), (3,2), (4,2); +insert into t2 values (1,3), (2,3), (3,4), (4,4); +explain select * from t1 left join t2 on a=c where d in (4); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ref c,d d 5 const 2 Using where +1 SIMPLE t1 ALL a NULL NULL NULL 3 Using where +select * from t1 left join t2 on a=c where d in (4); +a b c d +3 2 3 4 +4 2 4 4 +explain select * from t1 left join t2 on a=c where d = 4; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ref c,d d 5 const 2 Using where +1 SIMPLE t1 ALL a NULL NULL NULL 3 Using where +select * from t1 left join t2 on a=c where d = 4; +a b c d +3 2 3 4 +4 2 4 4 +drop table t1, t2; CREATE TABLE t1 ( i int(11) NOT NULL default '0', c char(10) NOT NULL default '', @@ -2360,7 +2386,4 @@ INSERT INTO t1 VALUES (3,'c'); EXPLAIN SELECT i FROM t1 WHERE i=1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1 Using index -EXPLAIN SELECT i FROM t1 WHERE i=1; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1 Using index DROP TABLE t1; diff --git a/mysql-test/r/type_blob.result.es b/mysql-test/r/type_blob.result.es index 84d02b4a4b4..a510eee8f38 100644 --- a/mysql-test/r/type_blob.result.es +++ b/mysql-test/r/type_blob.result.es @@ -684,8 +684,8 @@ id txt 3 NULL 1 Chevy drop table t1; -CREATE TABLE t1 ( i int(11) NOT NULL default '0', c text NOT NULL, PRIMARY KEY (i), KEY (c(1),c(1))); -INSERT t1 VALUES (1,''),(2,''),(3,'asdfh'),(4,''); +CREATE TABLE t1 ( i int(11) NOT NULL default '0', c text NOT NULL, d varchar(1) NOT NULL DEFAULT ' ', PRIMARY KEY (i), KEY (c(1),d)); +INSERT t1 (i, c) VALUES (1,''),(2,''),(3,'asdfh'),(4,''); select max(i) from t1 where c = ''; max(i) 4 diff --git a/mysql-test/r/type_float.result.es b/mysql-test/r/type_float.result.es index 411817bbfef..4bfe644d7fb 100644 --- a/mysql-test/r/type_float.result.es +++ b/mysql-test/r/type_float.result.es @@ -22,14 +22,14 @@ select * from t1; f1 f2 10 10 100000 100000 -1.23457e+09 1234567890 +1.23457e+9 1234567890 1e+10 10000000000 1e+15 1e+15 1e+20 1e+20 3.40282e+38 1e+50 3.40282e+38 1e+150 -10 -10 -1e-05 1e-05 +1e-5 1e-5 1e-10 1e-10 1e-15 1e-15 1e-20 1e-20 @@ -137,6 +137,8 @@ t1 CREATE TABLE `t1` ( drop table t1; create table t1 (c20 char); insert into t1 values (5000.0); +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 drop table t1; create table t1 (f float(54)); ERROR 42000: Incorrect column specifier for column 'f' diff --git a/mysql-test/t/bdb-deadlock.tminus b/mysql-test/t/bdb-deadlock.tminus new file mode 100644 index 00000000000..d86403fcffc --- /dev/null +++ b/mysql-test/t/bdb-deadlock.tminus @@ -0,0 +1,57 @@ +# This test doesn't work with the embedded version as this code +# assumes that one query is running while we are doing queries on +# a second connection. +# This would work if mysqltest run would be threaded and handle each +# connection in a separate thread. +# + +#-- source include/not_embedded.inc +-- source include/have_bdb.inc + +connect (con1,localhost,root,,); +connect (con2,localhost,root,,); + +--disable_warnings +drop table if exists t1,t2; +--enable_warnings +connection con1; +create table t1 (id integer, x integer) engine=BDB; +create table t2 (id integer, x integer) engine=BDB; +insert into t1 values(0, 0); +insert into t2 values(0, 0); +set autocommit=0; +update t1 set x = 1 where id = 0; + +connection con2; +set autocommit=0; +update t2 set x = 1 where id = 0; + +# The following query should hang because con1 is locking the page +--send +select x from t1 where id = 0; + +connection con1; +# This should generate a deadlock as we are trying to access a locked row +--send +select x from t2 where id = 0; + +connection con2; +--error 1213 +reap; +commit; + +connection con1; +reap; +commit; + +connection con2; +select * from t1; +select * from t2; +commit; + +connection con1; +select * from t1; +select * from t2; +commit; + +drop table t1,t2; diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index a790e6fe9d8..637bb48b2cf 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -427,8 +427,17 @@ static void set_param_date(Item_param *param, uchar **pos, ulong len) #else/*!EMBEDDED_LIBRARY*/ void set_param_time(Item_param *param, uchar **pos, ulong len) { - MYSQL_TIME *to= (MYSQL_TIME*)*pos; - param->set_time(to, MYSQL_TIMESTAMP_TIME, + MYSQL_TIME tm= *((MYSQL_TIME*)*pos); + tm.hour+= tm.day * 24; + tm.day= tm.year= tm.month= 0; + if (tm.hour > 838) + { + /* TODO: add warning 'Data truncated' here */ + tm.hour= 838; + tm.minute= 59; + tm.second= 59; + } + param->set_time(&tm, MYSQL_TIMESTAMP_TIME, MAX_TIME_WIDTH * MY_CHARSET_BIN_MB_MAXLEN); } diff --git a/tests/client_test.c b/tests/client_test.c index 35990a521a4..a7fadbd3033 100644 --- a/tests/client_test.c +++ b/tests/client_test.c @@ -683,7 +683,9 @@ static void verify_prepare_field(MYSQL_RES *result, as utf8. Field length is calculated as number of characters * maximum number of bytes a character can occupy. */ +#ifndef EMBEDDED_LIBRARY DIE_UNLESS(field->length == length * cs->mbmaxlen); +#endif if (def) DIE_UNLESS(strcmp(field->def, def) == 0); } From 93cf297fcb932aaaf1c006d7066ec453c9a907cb Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 2 Dec 2004 14:43:51 +0200 Subject: [PATCH 0397/1063] Cleanups during review stage Added auto-correct of field length for enum/set tables for ALTER TABLE This is becasue of a bug in previous MySQL 4.1 versions where the length for enum/set was set incorrectly after ALTER TABLE mysql-test/r/rpl_start_stop_slave.result: Fixed wrong test mysql-test/r/type_enum.result: Added test for wrong enum/set length after alter table mysql-test/t/ps.test: removed empty line mysql-test/t/type_enum.test: Added test for wrong enum/set length after alter table sql/field.cc: Added auto-correct of field length for enum/set tables. This is becasue of a bug in previous MySQL 4.1 versions where the length for enum/set was set incorrectly after ALTER TABLE sql/item_cmpfunc.cc: Simple optimization sql/mysql_priv.h: Made local function global sql/set_var.cc: Simple cleanup sql/sql_table.cc: Simple cleanups & optimizations --- mysql-test/r/rpl_start_stop_slave.result | 4 +- mysql-test/r/type_enum.result | 12 +++++ mysql-test/t/ps.test | 1 - mysql-test/t/type_enum.test | 13 +++++ sql/field.cc | 60 +++++++++++++++++------- sql/item_cmpfunc.cc | 12 ++--- sql/mysql_priv.h | 2 + sql/set_var.cc | 9 ++-- sql/sql_table.cc | 14 ++---- 9 files changed, 85 insertions(+), 42 deletions(-) diff --git a/mysql-test/r/rpl_start_stop_slave.result b/mysql-test/r/rpl_start_stop_slave.result index 1b4d87124d1..1fcb586d1fb 100644 --- a/mysql-test/r/rpl_start_stop_slave.result +++ b/mysql-test/r/rpl_start_stop_slave.result @@ -1,9 +1,9 @@ -slave stop; +stop slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -slave start; +start slave; stop slave; create table t1(n int); start slave; diff --git a/mysql-test/r/type_enum.result b/mysql-test/r/type_enum.result index da85ffe6495..86b8e1d8653 100644 --- a/mysql-test/r/type_enum.result +++ b/mysql-test/r/type_enum.result @@ -1693,3 +1693,15 @@ oe ue ss DROP TABLE t1; +create table t1 (a enum ('Y','N') CHARACTER SET utf8 COLLATE utf8_bin); +insert into t1 values ('Y'); +alter table t1 add b set ('Y','N') CHARACTER SET utf8 COLLATE utf8_bin; +alter table t1 add c enum ('Y','N') CHARACTER SET utf8 COLLATE utf8_bin; +select * from t1; +Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr +def test t1 t1 a a 254 3 1 Y 384 0 8 +def test t1 t1 b b 254 9 0 Y 2176 0 8 +def test t1 t1 c c 254 3 0 Y 384 0 8 +a b c +Y NULL NULL +drop table t1; diff --git a/mysql-test/t/ps.test b/mysql-test/t/ps.test index 7fe88ad0ddc..51d1fd065cf 100644 --- a/mysql-test/t/ps.test +++ b/mysql-test/t/ps.test @@ -471,4 +471,3 @@ execute stmt using @var, @var, @var; set @var=null; select @var is null, @var is not null, @var; execute stmt using @var, @var, @var; - diff --git a/mysql-test/t/type_enum.test b/mysql-test/t/type_enum.test index dc2e4d0f469..485fef8a0ca 100644 --- a/mysql-test/t/type_enum.test +++ b/mysql-test/t/type_enum.test @@ -72,3 +72,16 @@ CREATE TABLE t1 (c enum('ae','oe','ue','ss') collate latin1_german2_ci); INSERT INTO t1 VALUES ('ä'),('ö'),('ü'),('ß'); SELECT * FROM t1; DROP TABLE t1; + +# +# Test bug where enum fields where extended for each ALTER TABLE +# + +create table t1 (a enum ('Y','N') CHARACTER SET utf8 COLLATE utf8_bin); +insert into t1 values ('Y'); +alter table t1 add b set ('Y','N') CHARACTER SET utf8 COLLATE utf8_bin; +alter table t1 add c enum ('Y','N') CHARACTER SET utf8 COLLATE utf8_bin; +--enable_metadata +select * from t1; +--disable metadata +drop table t1; diff --git a/sql/field.cc b/sql/field.cc index 72c27b6adf9..eee7f6f1684 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -5842,25 +5842,47 @@ bool Field_num::eq_def(Field *field) void create_field::create_length_to_internal_length(void) { - switch (sql_type) + switch (sql_type) { + case MYSQL_TYPE_TINY_BLOB: + case MYSQL_TYPE_MEDIUM_BLOB: + case MYSQL_TYPE_LONG_BLOB: + case MYSQL_TYPE_BLOB: + case MYSQL_TYPE_VAR_STRING: + case MYSQL_TYPE_STRING: + length*= charset->mbmaxlen; + pack_length= calc_pack_length(sql_type == FIELD_TYPE_VAR_STRING ? + FIELD_TYPE_STRING : sql_type, length); + break; +#ifdef CORRECT_CODE_BUT_CANT_YET_BE_USED + case MYSQL_TYPE_ENUM: + case MYSQL_TYPE_SET: + length*= charset->mbmaxlen; + break; +#else + /* + Because of a bug in MySQL 4.1 where length was extended for ENUM and SET + fields for every ALTER TABLE, we have to recalculate lengths here + */ + case MYSQL_TYPE_ENUM: { - case MYSQL_TYPE_TINY_BLOB: - case MYSQL_TYPE_MEDIUM_BLOB: - case MYSQL_TYPE_LONG_BLOB: - case MYSQL_TYPE_BLOB: - case MYSQL_TYPE_VAR_STRING: - case MYSQL_TYPE_STRING: - length*= charset->mbmaxlen; - pack_length= calc_pack_length(sql_type == FIELD_TYPE_VAR_STRING ? - FIELD_TYPE_STRING : sql_type, length); - break; - case MYSQL_TYPE_ENUM: - case MYSQL_TYPE_SET: - length*= charset->mbmaxlen; - break; - default: - /* do nothing */ - break; + uint32 tot_length, max_length; + calculate_interval_lengths(current_thd, interval, + &max_length, &tot_length); + length= max_length * charset->mbmaxlen; + break; + } + case MYSQL_TYPE_SET: + { + uint32 tot_length, max_length; + calculate_interval_lengths(current_thd, interval, + &max_length, &tot_length); + length= (tot_length + (interval->count - 1)) * charset->mbmaxlen; + break; + } +#endif + default: + /* do nothing */ + break; } } @@ -6085,6 +6107,8 @@ create_field::create_field(Field *old_field,Field *orig_field) } length=(length+charset->mbmaxlen-1)/charset->mbmaxlen; // QQ: Probably not needed break; + case MYSQL_TYPE_ENUM: + case MYSQL_TYPE_SET: case FIELD_TYPE_STRING: case FIELD_TYPE_VAR_STRING: length=(length+charset->mbmaxlen-1)/charset->mbmaxlen; diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index 4970517de87..c7481192be8 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -2365,10 +2365,10 @@ Item_func_regex::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref) } int error; if ((error= regcomp(&preg,res->c_ptr(), - ((cmp_collation.collation->state & MY_CS_BINSORT) || - (cmp_collation.collation->state & MY_CS_CSSORT)) ? + ((cmp_collation.collation->state & + (MY_CS_BINSORT | MY_CS_CSSORT)) ? REG_EXTENDED | REG_NOSUB : - REG_EXTENDED | REG_NOSUB | REG_ICASE, + REG_EXTENDED | REG_NOSUB | REG_ICASE), cmp_collation.collation))) { (void) regerror(error,&preg,buff,sizeof(buff)); @@ -2417,10 +2417,10 @@ longlong Item_func_regex::val_int() regex_compiled=0; } if (regcomp(&preg,res2->c_ptr(), - ((cmp_collation.collation->state & MY_CS_BINSORT) || - (cmp_collation.collation->state & MY_CS_CSSORT)) ? + ((cmp_collation.collation->state & + (MY_CS_BINSORT | MY_CS_CSSORT)) ? REG_EXTENDED | REG_NOSUB : - REG_EXTENDED | REG_NOSUB | REG_ICASE, + REG_EXTENDED | REG_NOSUB | REG_ICASE), cmp_collation.collation)) { null_value=1; diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 3f55a88b262..331dc43f9ad 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -370,6 +370,8 @@ int insert_precheck(THD *thd, TABLE_LIST *tables); int create_table_precheck(THD *thd, TABLE_LIST *tables, TABLE_LIST *create_table); Item *negate_expression(THD *thd, Item *expr); +void calculate_interval_lengths(THD *thd, TYPELIB *interval, + uint *max_length, uint *tot_length); #include "sql_class.h" #include "opt_range.h" diff --git a/sql/set_var.cc b/sql/set_var.cc index 2031ac15412..79be4dc1c46 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -2725,24 +2725,23 @@ sys_var *find_sys_var(const char *str, uint length) int sql_set_variables(THD *thd, List *var_list) { - int error= 0; + int error; List_iterator_fast it(*var_list); DBUG_ENTER("sql_set_variables"); set_var_base *var; while ((var=it++)) { - if ((error=var->check(thd))) + if ((error= var->check(thd))) goto err; } - if (!thd->net.report_error) + if (!(error= test(thd->net.report_error))) { it.rewind(); while ((var= it++)) error|= var->update(thd); // Returns 0, -1 or 1 } - else - error= 1; + err: free_underlaid_joins(thd, &thd->lex->select_lex); DBUG_RETURN(error); diff --git a/sql/sql_table.cc b/sql/sql_table.cc index eedd9388877..2260877fc05 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -814,8 +814,7 @@ int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info, DBUG_RETURN(-1); } } - else - if (key_info->algorithm == HA_KEY_ALG_RTREE) + else if (key_info->algorithm == HA_KEY_ALG_RTREE) { #ifdef HAVE_RTREE_KEYS if ((key_info->key_parts & 1) == 1) @@ -839,6 +838,8 @@ int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info, CHARSET_INFO *ft_key_charset=0; // for FULLTEXT for (uint column_nr=0 ; (column=cols++) ; column_nr++) { + key_part_spec *dup_column; + it.rewind(); field=0; while ((sql_field=it++) && @@ -853,9 +854,8 @@ int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info, column->field_name); DBUG_RETURN(-1); } - for (uint dup_nr= 0; dup_nr < column_nr; dup_nr++) + while ((dup_column= cols2++) != column) { - key_part_spec *dup_column= cols2++; if (!my_strcasecmp(system_charset_info, column->field_name, dup_column->field_name)) { @@ -866,12 +866,6 @@ int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info, } } cols2.rewind(); - /* for fulltext keys keyseg length is 1 for blobs (it's ignored in - ft code anyway, and 0 (set to column width later) for char's. - it has to be correct col width for char's, as char data are not - prefixed with length (unlike blobs, where ft code takes data length - from a data prefix, ignoring column->length). - */ if (key->type == Key::FULLTEXT) { if ((sql_field->sql_type != FIELD_TYPE_STRING && From 374252c6860bfeab1efcd44078c0e203d21d676d Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 2 Dec 2004 15:14:01 +0200 Subject: [PATCH 0398/1063] merge (new code fixed the ALTER TABLE problem) --- sql/field.cc | 23 ----------------------- sql/mysql_priv.h | 2 -- 2 files changed, 25 deletions(-) diff --git a/sql/field.cc b/sql/field.cc index b9c9b269070..90203d1935d 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -5853,33 +5853,10 @@ void create_field::create_length_to_internal_length(void) pack_length= calc_pack_length(sql_type == FIELD_TYPE_VAR_STRING ? FIELD_TYPE_STRING : sql_type, length); break; -#ifdef CORRECT_CODE_BUT_CANT_YET_BE_USED case MYSQL_TYPE_ENUM: case MYSQL_TYPE_SET: length*= charset->mbmaxlen; break; -#else - /* - Because of a bug in MySQL 4.1 where length was extended for ENUM and SET - fields for every ALTER TABLE, we have to recalculate lengths here - */ - case MYSQL_TYPE_ENUM: - { - uint32 tot_length, max_length; - calculate_interval_lengths(current_thd, interval, - &max_length, &tot_length); - length= max_length * charset->mbmaxlen; - break; - } - case MYSQL_TYPE_SET: - { - uint32 tot_length, max_length; - calculate_interval_lengths(current_thd, interval, - &max_length, &tot_length); - length= (tot_length + (interval->count - 1)) * charset->mbmaxlen; - break; - } -#endif default: /* do nothing */ break; diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index b4f19a54de2..3a19a903e00 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -370,8 +370,6 @@ int insert_precheck(THD *thd, TABLE_LIST *tables); int create_table_precheck(THD *thd, TABLE_LIST *tables, TABLE_LIST *create_table); Item *negate_expression(THD *thd, Item *expr); -void calculate_interval_lengths(THD *thd, TYPELIB *interval, - uint *max_length, uint *tot_length); #include "sql_class.h" #include "opt_range.h" From 66c3afa363a28288663ce0202ee35e9948b89933 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 2 Dec 2004 15:14:36 +0100 Subject: [PATCH 0399/1063] myisam/mi_packrec.c more robust checks (catch more corruptions) myisam/mi_packrec.c: more robust checks (catch more corruptions) --- myisam/mi_packrec.c | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/myisam/mi_packrec.c b/myisam/mi_packrec.c index c2cc6e17df6..a277c2ca9d1 100644 --- a/myisam/mi_packrec.c +++ b/myisam/mi_packrec.c @@ -42,6 +42,7 @@ { bits-=(bit+1); break; } \ pos+= *pos +#define OFFSET_TABLE_SIZE 512 static uint read_huff_table(MI_BIT_BUFF *bit_buff,MI_DECODE_TREE *decode_tree, uint16 **decode_table,byte **intervall_buff, @@ -53,7 +54,7 @@ static void fill_quick_table(uint16 *table,uint bits, uint max_bits, uint value); static uint copy_decode_table(uint16 *to_pos,uint offset, uint16 *decode_table); -static uint find_longest_bitstream(uint16 *table); +static uint find_longest_bitstream(uint16 *table, uint16 *end); static void (*get_unpack_function(MI_COLUMNDEF *rec))(MI_COLUMNDEF *field, MI_BIT_BUFF *buff, uchar *to, @@ -178,7 +179,7 @@ my_bool _mi_read_pack_info(MI_INFO *info, pbool fix_keys) length=(uint) (elements*2+trees*(1 << myisam_quick_table_bits)); if (!(share->decode_tables=(uint16*) - my_malloc((length+512)*sizeof(uint16)+ + my_malloc((length+OFFSET_TABLE_SIZE)*sizeof(uint16)+ (uint) (share->pack.header_length+7), MYF(MY_WME | MY_ZEROFILL)))) { @@ -186,7 +187,7 @@ my_bool _mi_read_pack_info(MI_INFO *info, pbool fix_keys) goto err1; } tmp_buff=share->decode_tables+length; - disk_cache=(byte*) (tmp_buff+512); + disk_cache=(byte*) (tmp_buff+OFFSET_TABLE_SIZE); if (my_read(file,disk_cache, (uint) (share->pack.header_length-sizeof(header)), @@ -302,7 +303,7 @@ static uint read_huff_table(MI_BIT_BUFF *bit_buff, MI_DECODE_TREE *decode_tree, decode_tree->intervalls= *intervall_buff; if (! intervall_length) { - table_bits=find_longest_bitstream(tmp_buff); + table_bits=find_longest_bitstream(tmp_buff, tmp_buff+OFFSET_TABLE_SIZE); if (table_bits == (uint) ~0) return 1; if (table_bits > myisam_quick_table_bits) @@ -397,19 +398,23 @@ static uint copy_decode_table(uint16 *to_pos, uint offset, } -static uint find_longest_bitstream(uint16 *table) +static uint find_longest_bitstream(uint16 *table, uint16 *end) { uint length=1,length2; - if (*table > 512) - return ~0; - if (!(*table & IS_CHAR)) - length=find_longest_bitstream(table+ *table)+1; - table++; - if (*table > 512) - return ~0; if (!(*table & IS_CHAR)) { - length2=find_longest_bitstream(table+ *table)+1; + uint16 *next= table + *table; + if (next > end || next == table) + return ~0; + length=find_longest_bitstream(next, end)+1; + } + table++; + if (!(*table & IS_CHAR)) + { + uint16 *next= table + *table; + if (next > end || next == table) + return ~0; + length2=find_longest_bitstream(table+ *table, end)+1; length=max(length,length2); } return length; From d3b6349ad8ceaf0700be0e44ce88f49f44cf7a4e Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 2 Dec 2004 16:42:37 +0100 Subject: [PATCH 0400/1063] Change to prevent the failure of "make distclean" on the missing 'regex/Makefile' (and, later, 'strings/Makefile'). configure.in: The subdirectories 'strings' and 'regex' were each contained in both the 'sql_client_dirs' and the 'sql_server_dirs' macro. As these are used to form the (Makefile) macro 'SUBDIRS' and 'DIST_SUBDIRS', these subdirectories will get listed there twice. This causes a failure of the (recursive) "make distclean", so this double inclusion must be prevented. --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 0d6e797f571..4aa4b3c9845 100644 --- a/configure.in +++ b/configure.in @@ -2830,7 +2830,7 @@ thread_dirs= dnl This probably should be cleaned up more - for now the threaded dnl client is just using plain-old libs. -sql_client_dirs="libmysql strings regex client" +sql_client_dirs="libmysql client" linked_client_targets="linked_libmysql_sources" CLIENT_LIBS=$NON_THREADED_CLIENT_LIBS if test "$THREAD_SAFE_CLIENT" != "no" From 902419dbe0a96233bde6b6ff737d97f6e4c83e71 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 2 Dec 2004 18:05:37 +0100 Subject: [PATCH 0401/1063] Bug #6697 Failure to build 4.1.7 on Visual Studio .NET [fixed] mysqld.dsp: Added custom build step for message.mc to all targets VC++Files/sql/mysqld.dsp: Added custom build step for message.mc to all targets --- VC++Files/sql/mysqld.dsp | 111 ++++++++++++++++++++++++++++++--------- 1 file changed, 87 insertions(+), 24 deletions(-) diff --git a/VC++Files/sql/mysqld.dsp b/VC++Files/sql/mysqld.dsp index 31c52009d9f..9c642c08808 100644 --- a/VC++Files/sql/mysqld.dsp +++ b/VC++Files/sql/mysqld.dsp @@ -924,76 +924,139 @@ SOURCE=.\message.mc !IF "$(CFG)" == "mysqld - Win32 Release" +# Begin Custom Build +InputPath=.\message.mc + +BuildCmds= \ + mc message.mc + +"message.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"message.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) +# End Custom Build + !ELSEIF "$(CFG)" == "mysqld - Win32 Debug" +# Begin Custom Build +InputPath=.\message.mc + +BuildCmds= \ + mc message.mc + +"message.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"message.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) +# End Custom Build + !ELSEIF "$(CFG)" == "mysqld - Win32 nt" -# Begin Custom Build - Compiling messages -InputDir=. +# Begin Custom Build InputPath=.\message.mc -InputName=message BuildCmds= \ - mc.exe "$(InputDir)\$(InputName).mc" + mc message.mc -"$(InputDir)\$(InputName).rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" +"message.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) -"$(InputDir)\$(InputName).h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" +"message.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) # End Custom Build !ELSEIF "$(CFG)" == "mysqld - Win32 Max nt" -# Begin Custom Build - Compiling messages -InputDir=. + +# Begin Custom Build InputPath=.\message.mc -InputName=message BuildCmds= \ - mc.exe "$(InputDir)\$(InputName).mc" + mc message.mc -"$(InputDir)\$(InputName).rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" +"message.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) -"$(InputDir)\$(InputName).h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" +"message.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) # End Custom Build + !ELSEIF "$(CFG)" == "mysqld - Win32 Max" +# Begin Custom Build +InputPath=.\message.mc + +BuildCmds= \ + mc message.mc + +"message.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"message.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) +# End Custom Build + !ELSEIF "$(CFG)" == "mysqld - Win32 classic" +# Begin Custom Build +InputPath=.\message.mc + +BuildCmds= \ + mc message.mc + +"message.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"message.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) +# End Custom Build + !ELSEIF "$(CFG)" == "mysqld - Win32 pro" +# Begin Custom Build +InputPath=.\message.mc + +BuildCmds= \ + mc message.mc + +"message.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) + +"message.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" + $(BuildCmds) +# End Custom Build + !ELSEIF "$(CFG)" == "mysqld - Win32 classic nt" -# Begin Custom Build - Compiling messages -InputDir=. + +# Begin Custom Build InputPath=.\message.mc -InputName=message BuildCmds= \ - mc.exe "$(InputDir)\$(InputName).mc" + mc message.mc -"$(InputDir)\$(InputName).rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" +"message.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) -"$(InputDir)\$(InputName).h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" +"message.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) # End Custom Build + !ELSEIF "$(CFG)" == "mysqld - Win32 pro nt" -# Begin Custom Build - Compiling messages -InputDir=. + +# Begin Custom Build InputPath=.\message.mc -InputName=message BuildCmds= \ - mc.exe "$(InputDir)\$(InputName).mc" + mc message.mc -"$(InputDir)\$(InputName).rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" +"message.rc" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) -"$(InputDir)\$(InputName).h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" +"message.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" $(BuildCmds) # End Custom Build + !ENDIF # End Source File From fbafcb2c0e1c5064ebe378e545ad0ffac09de3b2 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 2 Dec 2004 18:55:10 +0100 Subject: [PATCH 0402/1063] - added option --with-archive to enable compiling with the Archive Storage Engine --- Build-tools/Do-compile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Build-tools/Do-compile b/Build-tools/Do-compile index e98c3d84937..f8e91efd70d 100755 --- a/Build-tools/Do-compile +++ b/Build-tools/Do-compile @@ -10,7 +10,7 @@ use Sys::Hostname; $opt_distribution=$opt_user=$opt_config_env=$opt_config_extra_env=""; $opt_dbd_options=$opt_perl_options=$opt_config_options=$opt_make_options=$opt_suffix=""; $opt_tmp=$opt_version_suffix=""; -$opt_bundled_zlib=$opt_help=$opt_delete=$opt_debug=$opt_stage=$opt_no_test=$opt_no_perl=$opt_one_error=$opt_with_low_memory=$opt_fast_benchmark=$opt_static_client=$opt_static_server=$opt_static_perl=$opt_sur=$opt_with_small_disk=$opt_local_perl=$opt_tcpip=$opt_build_thread=$opt_use_old_distribution=$opt_enable_shared=$opt_no_crash_me=$opt_no_strip=$opt_with_cluster=$opt_with_debug=$opt_no_benchmark=$opt_no_mysqltest=$opt_without_embedded=$opt_readline=0; +$opt_bundled_zlib=$opt_help=$opt_delete=$opt_debug=$opt_stage=$opt_no_test=$opt_no_perl=$opt_one_error=$opt_with_low_memory=$opt_fast_benchmark=$opt_static_client=$opt_static_server=$opt_static_perl=$opt_sur=$opt_with_small_disk=$opt_local_perl=$opt_tcpip=$opt_build_thread=$opt_use_old_distribution=$opt_enable_shared=$opt_no_crash_me=$opt_no_strip=$opt_with_archive=$opt_with_cluster=$opt_with_debug=$opt_no_benchmark=$opt_no_mysqltest=$opt_without_embedded=$opt_readline=0; $opt_innodb=$opt_bdb=$opt_raid=$opt_libwrap=$opt_clearlogs=0; GetOptions( @@ -53,6 +53,7 @@ GetOptions( "use-old-distribution", "user=s", "version-suffix=s", + "with-archive", "with-cluster", "with-debug", "with-low-memory", @@ -273,6 +274,7 @@ if ($opt_stage <= 1) $opt_config_options.= " --with-libedit"; } $opt_config_options.= " --with-embedded-server" unless ($opt_without_embedded); + $opt_config_options.= " --with-archive-storage-engine" if ($opt_with_archive); $opt_config_options.= " --with-ndbcluster" if ($opt_with_cluster); # Only enable InnoDB when requested (required to be able to @@ -609,6 +611,9 @@ If user is empty then no mail is sent. --version-suffix=suffix Set name suffix (e.g. 'com' or '-max') for a distribution +--with archive +Enable the Archive storage Engine + --with cluster Compile and test with NDB Cluster enabled From d1964f416324cd154b436671f370d71bf29b96bd Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 2 Dec 2004 20:53:54 +0100 Subject: [PATCH 0403/1063] compatibility fix --- sql/item_func.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/item_func.cc b/sql/item_func.cc index 32841ba447b..5ed543efbc7 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -171,7 +171,7 @@ bool Item_func::agg_arg_charsets(DTCollation &coll, for (arg= args, last= args + nargs; arg < last; arg++) { Item* conv; - uint dummy_offset; + uint32 dummy_offset; if (!String::needs_conversion(0, coll.collation, (*arg)->collation.collation, &dummy_offset)) From 5fc09be9a36cdd98691ff109788c2c5b0a9a2c69 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 2 Dec 2004 21:32:36 +0100 Subject: [PATCH 0404/1063] - updated lowercase_table3 test result (T1.InnoDB -> T1.ibd). Failure was discovered on Mac OS X mysql-test/r/lowercase_table3.result: - updated test result (T1.InnoDB -> T1.ibd). Failure was discovered on Mac OS X --- mysql-test/r/lowercase_table3.result | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/r/lowercase_table3.result b/mysql-test/r/lowercase_table3.result index a645e46be9e..8182d07c26b 100644 --- a/mysql-test/r/lowercase_table3.result +++ b/mysql-test/r/lowercase_table3.result @@ -6,5 +6,5 @@ drop table t1; flush tables; CREATE TABLE t1 (a int) ENGINE=INNODB; SELECT * from T1; -ERROR HY000: Can't open file: 'T1.InnoDB' (errno: 1) +ERROR HY000: Can't open file: 'T1.ibd' (errno: 1) drop table t1; From 9286d1c1452d53dd36c94fbe94a3f99be7b1dfb2 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 3 Dec 2004 00:05:11 +0100 Subject: [PATCH 0405/1063] Prevent adding 'CREATE TABLE .. SELECT' query to the binary log when the insertion of new records partially failed. It would get logged because of the logic to log a partially-failed 'INSERT ... SELECT' (which can't be rolled back in non-transactional tables), but 'CREATE TABLE ... SELECT' is always rolled back on failure, even for non-transactional tables. (Bug #6682) (Original fix reimplemented after review by Serg and Guilhem.) mysql-test/t/insert_select.test: Add test case for Bug #6682 mysql-test/r/insert_select.result: Add results for test case for Bug #6682 sql/sql_table.cc: moved tmp_disable_binlog() and reenable_binlog macros to sql/sql_class.h sql/sql_insert.cc: disable binlog during call to super's ::send_error in select_create class sql/sql_class.h: add select_create::send_error() BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted --- BitKeeper/etc/logging_ok | 1 + mysql-test/r/insert_select.result | 9 +++++++++ mysql-test/t/insert_select.test | 13 +++++++++++++ sql/sql_class.h | 10 ++++++++++ sql/sql_insert.cc | 13 +++++++++++++ sql/sql_table.cc | 8 -------- 6 files changed, 46 insertions(+), 8 deletions(-) diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok index e8b795c4d80..6e6433a80ae 100644 --- a/BitKeeper/etc/logging_ok +++ b/BitKeeper/etc/logging_ok @@ -64,6 +64,7 @@ jcole@main.burghcom.com jcole@mugatu.spaceapes.com jcole@sarvik.tfr.cafe.ee jcole@tetra.spaceapes.com +jimw@mysql.com joerg@mysql.com jorge@linux.jorge.mysql.com kaj@work.mysql.com diff --git a/mysql-test/r/insert_select.result b/mysql-test/r/insert_select.result index a10e7fc02bb..ecd26f2d9fb 100644 --- a/mysql-test/r/insert_select.result +++ b/mysql-test/r/insert_select.result @@ -78,6 +78,15 @@ master-bin.001 4 Start 1 4 Server ver: VERSION, Binlog ver: 3 master-bin.001 79 Query 1 79 use `test`; insert into t1 select * from t2 drop table t1, t2; drop table if exists t1, t2; +create table t1(a int); +insert into t1 values(1),(1); +reset master; +create table t2(unique(a)) select a from t1; +Duplicate entry '1' for key 1 +show binlog events; +Log_name Pos Event_type Server_id Orig_log_pos Info +master-bin.001 4 Start 1 4 Server ver: VERSION, Binlog ver: 3 +drop table t1; create table t1 (a int not null); create table t2 (a int not null); insert into t1 values (1); diff --git a/mysql-test/t/insert_select.test b/mysql-test/t/insert_select.test index d9a8cfaf1be..deb80dbcdbf 100644 --- a/mysql-test/t/insert_select.test +++ b/mysql-test/t/insert_select.test @@ -86,6 +86,19 @@ show binlog events; drop table t1, t2; drop table if exists t1, t2; +# Verify that a partly-completed CREATE TABLE .. SELECT does not +# get into the binlog (Bug #6682) +create table t1(a int); +insert into t1 values(1),(1); +reset master; +--error 1062 +create table t2(unique(a)) select a from t1; +# The above should produce an error, *and* not appear in the binlog +let $VERSION=`select version()`; +--replace_result $VERSION VERSION +show binlog events; +drop table t1; + # # Test of insert ... select from same table # diff --git a/sql/sql_class.h b/sql/sql_class.h index 4250ebdd568..17d371d3dc0 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -637,6 +637,15 @@ public: #endif }; +# define tmp_disable_binlog(A) \ + ulong save_options= (A)->options, save_master_access= (A)->master_access; \ + (A)->options&= ~OPTION_BIN_LOG; \ + (A)->master_access|= SUPER_ACL; /* unneeded in 4.1 */ + +#define reenable_binlog(A) \ + (A)->options= save_options; \ + (A)->master_access= save_master_access; + /* Flags for the THD::system_thread (bitmap) variable */ #define SYSTEM_THREAD_DELAYED_INSERT 1 #define SYSTEM_THREAD_SLAVE_IO 2 @@ -781,6 +790,7 @@ public: {} int prepare(List &list); bool send_data(List &values); + void send_error(uint errcode,const char *err); bool send_eof(); void abort(); }; diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 8912c1faf2a..0c62a9af7ba 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -1505,6 +1505,19 @@ bool select_create::send_data(List &values) return 0; } + +void select_create::send_error(uint errcode,const char *err) +{ + /* + Disable binlog, because we "roll back" partial inserts in ::abort + by removing the table, even for non-transactional tables. + */ + tmp_disable_binlog(thd); + select_insert::send_error(errcode, err); + reenable_binlog(thd); +} + + extern HASH open_cache; diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 1e5237b1428..33bdd992efb 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -31,14 +31,6 @@ #endif #include "sql_acl.h" // for SUPER_ACL -# define tmp_disable_binlog(A) \ - ulong save_options= (A)->options, save_master_access= (A)->master_access; \ - (A)->options&= ~OPTION_BIN_LOG; \ - (A)->master_access|= SUPER_ACL; /* unneeded in 4.1 */ - -#define reenable_binlog(A) \ - (A)->options= save_options; \ - (A)->master_access= save_master_access; extern HASH open_cache; static const char *primary_key_name="PRIMARY"; From 8948b7450fa543ef14f29b6087fd70ccfa640972 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 3 Dec 2004 02:44:33 +0100 Subject: [PATCH 0406/1063] Manual fixes to merge of fix for Bug #6682 to 4.1. sql/sql_class.h: update tmp_disable_binlog() and reenable_binlog() macros mysql-test/r/insert_select.result: Handle results that differ from 4.0 to 4.1 --- mysql-test/r/insert_select.result | 4 ++-- sql/sql_class.h | 11 ++++------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/mysql-test/r/insert_select.result b/mysql-test/r/insert_select.result index fcb4229fcdb..0a6a34f9a58 100644 --- a/mysql-test/r/insert_select.result +++ b/mysql-test/r/insert_select.result @@ -85,10 +85,10 @@ create table t1(a int); insert into t1 values(1),(1); reset master; create table t2(unique(a)) select a from t1; -Duplicate entry '1' for key 1 +ERROR 23000: Duplicate entry '1' for key 1 show binlog events; Log_name Pos Event_type Server_id Orig_log_pos Info -master-bin.001 4 Start 1 4 Server ver: VERSION, Binlog ver: 3 +master-bin.000001 4 Start 1 4 Server ver: VERSION, Binlog ver: 3 drop table t1; create table t1 (a int not null); create table t2 (a int not null); diff --git a/sql/sql_class.h b/sql/sql_class.h index 4e695701310..eaddca7b7d8 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -1092,14 +1092,11 @@ public: void end_statement(); }; -# define tmp_disable_binlog(A) \ - ulong save_options= (A)->options, save_master_access= (A)->master_access; \ - (A)->options&= ~OPTION_BIN_LOG; \ - (A)->master_access|= SUPER_ACL; /* unneeded in 4.1 */ +#define tmp_disable_binlog(A) \ + ulong save_options= (A)->options; \ + (A)->options&= ~OPTION_BIN_LOG; -#define reenable_binlog(A) \ - (A)->options= save_options; \ - (A)->master_access= save_master_access; +#define reenable_binlog(A) (A)->options= save_options; /* Flags for the THD::system_thread (bitmap) variable */ #define SYSTEM_THREAD_DELAYED_INSERT 1 From 220acb328e8f4e46fd16b60af6c5a23852e4feef Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 3 Dec 2004 12:13:51 +0100 Subject: [PATCH 0407/1063] Bug#6391 (binlog-do-db rules ignored) CREATE DATABASE statement used the current database instead of the database created when checking conditions for replication. CREATE/DROP/ALTER DATABASE statements are now replicated based on the manipulated database. mysql-test/t/rpl_until.test: Longer sleep to allow slave to stop. mysql-test/t/rpl_charset.test: Position change in binary file. mysql-test/r/drop_temp_table.result: Position change in binlog. mysql-test/r/rpl_loaddata_rule_m.result: Position change in binlog. mysql-test/r/rpl_charset.result: Position change in binlog. sql/log_event.h: Added new flag and parameter to suppress generation of USE statements. sql/log_event.cc: Added parameter and code to suppress generation of USE statements. sql/sql_db.cc: Suppress generation of USE before CREATE/ALTER/DROP DATABASE statements. sql/log.cc: Query_log_event have new extra parameter. sql/sql_table.cc: Query_log_event have new extra parameter. sql/sql_base.cc: Query_log_event have new extra parameter. sql/sql_update.cc: Query_log_event have new extra parameter. sql/sql_insert.cc: Query_log_event have new extra parameter. sql/sql_rename.cc: Query_log_event have new extra parameter. sql/sql_delete.cc: Query_log_event have new extra parameter. sql/sql_acl.cc: Query_log_event have new extra parameter. sql/handler.cc: Query_log_event have new extra parameter. sql/item_func.cc: Query_log_event have new extra parameter. sql/sql_parse.cc: Query_log_event have new extra parameter. --- mysql-test/r/drop_temp_table.result | 8 +- mysql-test/r/rpl_charset.result | 116 ++++++++++---------- mysql-test/r/rpl_create_database.result | 83 ++++++++++++++ mysql-test/r/rpl_loaddata_rule_m.result | 2 + mysql-test/t/rpl_charset.test | 6 +- mysql-test/t/rpl_create_database-master.opt | 1 + mysql-test/t/rpl_create_database-slave.opt | 1 + mysql-test/t/rpl_create_database.test | 68 ++++++++++++ mysql-test/t/rpl_until.test | 2 +- sql/handler.cc | 4 +- sql/item_func.cc | 2 +- sql/log.cc | 14 +-- sql/log_event.cc | 30 +++-- sql/log_event.h | 20 +++- sql/sql_acl.cc | 2 +- sql/sql_base.cc | 4 +- sql/sql_db.cc | 44 +++++++- sql/sql_delete.cc | 6 +- sql/sql_insert.cc | 8 +- sql/sql_parse.cc | 16 +-- sql/sql_rename.cc | 2 +- sql/sql_table.cc | 17 +-- sql/sql_update.cc | 4 +- 23 files changed, 340 insertions(+), 120 deletions(-) create mode 100644 mysql-test/r/rpl_create_database.result create mode 100644 mysql-test/t/rpl_create_database-master.opt create mode 100644 mysql-test/t/rpl_create_database-slave.opt create mode 100644 mysql-test/t/rpl_create_database.test diff --git a/mysql-test/r/drop_temp_table.result b/mysql-test/r/drop_temp_table.result index 99ee0143c05..266196877c8 100644 --- a/mysql-test/r/drop_temp_table.result +++ b/mysql-test/r/drop_temp_table.result @@ -11,8 +11,8 @@ get_lock("a",10) show binlog events; Log_name Pos Event_type Server_id Orig_log_pos Info master-bin.000001 4 Start 1 4 Server ver: VERSION, Binlog ver: 3 -master-bin.000001 79 Query 1 79 use `test`; create database `drop-temp+table-test` -master-bin.000001 152 Query 1 152 use `drop-temp+table-test`; create temporary table `table:name` (a int) -master-bin.000001 246 Query 1 246 use `drop-temp+table-test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `drop-temp+table-test`.`table:name` -master-bin.000001 375 Query 1 375 use `drop-temp+table-test`; DO RELEASE_LOCK("a") +master-bin.000001 79 Query 1 79 create database `drop-temp+table-test` +master-bin.000001 168 Query 1 168 use `drop-temp+table-test`; create temporary table `table:name` (a int) +master-bin.000001 262 Query 1 262 use `drop-temp+table-test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `drop-temp+table-test`.`table:name` +master-bin.000001 391 Query 1 391 use `drop-temp+table-test`; DO RELEASE_LOCK("a") drop database `drop-temp+table-test`; diff --git a/mysql-test/r/rpl_charset.result b/mysql-test/r/rpl_charset.result index 54cce23b301..cab41344238 100644 --- a/mysql-test/r/rpl_charset.result +++ b/mysql-test/r/rpl_charset.result @@ -105,62 +105,62 @@ drop database mysqltest2; drop database mysqltest3; show binlog events from 79; Log_name Pos Event_type Server_id Orig_log_pos Info -master-bin.000001 79 Query 1 79 use `test`; drop database if exists mysqltest2 -master-bin.000001 148 Query 1 148 use `test`; drop database if exists mysqltest3 -master-bin.000001 217 Query 1 217 use `test`; create database mysqltest2 character set latin2 -master-bin.000001 299 Query 1 299 use `test`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=8,COLLATION_DATABASE=8,COLLATION_SERVER=30 -master-bin.000001 433 Query 1 433 use `test`; create database mysqltest3 -master-bin.000001 494 Query 1 494 use `test`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=8,COLLATION_DATABASE=8,COLLATION_SERVER=64 -master-bin.000001 628 Query 1 628 use `test`; drop database mysqltest3 -master-bin.000001 687 Query 1 687 use `test`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=8,COLLATION_DATABASE=8,COLLATION_SERVER=64 -master-bin.000001 821 Query 1 821 use `test`; create database mysqltest3 -master-bin.000001 882 Query 1 882 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=8,COLLATION_DATABASE=9,COLLATION_SERVER=64 -master-bin.000001 1022 Query 1 1022 use `mysqltest2`; create table t1 (a int auto_increment primary key, b varchar(100)) -master-bin.000001 1129 Query 1 1129 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=4,COLLATION_CONNECTION=27,COLLATION_DATABASE=9,COLLATION_SERVER=64 -master-bin.000001 1270 Intvar 1 1270 INSERT_ID=1 -master-bin.000001 1298 Query 1 1298 use `mysqltest2`; insert into t1 (b) values(@@character_set_server) -master-bin.000001 1388 Query 1 1388 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=4,COLLATION_CONNECTION=27,COLLATION_DATABASE=9,COLLATION_SERVER=64 -master-bin.000001 1529 Intvar 1 1529 INSERT_ID=2 -master-bin.000001 1557 Query 1 1557 use `mysqltest2`; insert into t1 (b) values(@@collation_server) -master-bin.000001 1643 Query 1 1643 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=4,COLLATION_CONNECTION=27,COLLATION_DATABASE=9,COLLATION_SERVER=64 -master-bin.000001 1784 Intvar 1 1784 INSERT_ID=3 -master-bin.000001 1812 Query 1 1812 use `mysqltest2`; insert into t1 (b) values(@@character_set_client) -master-bin.000001 1902 Query 1 1902 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=4,COLLATION_CONNECTION=27,COLLATION_DATABASE=9,COLLATION_SERVER=64 -master-bin.000001 2043 Intvar 1 2043 INSERT_ID=4 -master-bin.000001 2071 Query 1 2071 use `mysqltest2`; insert into t1 (b) values(@@character_set_connection) -master-bin.000001 2165 Query 1 2165 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=4,COLLATION_CONNECTION=27,COLLATION_DATABASE=9,COLLATION_SERVER=64 -master-bin.000001 2306 Intvar 1 2306 INSERT_ID=5 -master-bin.000001 2334 Query 1 2334 use `mysqltest2`; insert into t1 (b) values(@@collation_connection) -master-bin.000001 2424 Query 1 2424 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=5,COLLATION_DATABASE=9,COLLATION_SERVER=64 -master-bin.000001 2564 Query 1 2564 use `mysqltest2`; truncate table t1 -master-bin.000001 2622 Query 1 2622 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=5,COLLATION_DATABASE=9,COLLATION_SERVER=64 -master-bin.000001 2762 Intvar 1 2762 INSERT_ID=1 -master-bin.000001 2790 Query 1 2790 use `mysqltest2`; insert into t1 (b) values(@@collation_connection) -master-bin.000001 2880 Query 1 2880 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=5,COLLATION_DATABASE=9,COLLATION_SERVER=64 -master-bin.000001 3020 Intvar 1 3020 INSERT_ID=2 -master-bin.000001 3048 Query 1 3048 use `mysqltest2`; insert into t1 (b) values(LEAST("Müller","Muffler")) -master-bin.000001 3141 Query 1 3141 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64 -master-bin.000001 3282 Intvar 1 3282 INSERT_ID=3 -master-bin.000001 3310 Query 1 3310 use `mysqltest2`; insert into t1 (b) values(@@collation_connection) -master-bin.000001 3400 Query 1 3400 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64 -master-bin.000001 3541 Intvar 1 3541 INSERT_ID=4 -master-bin.000001 3569 Query 1 3569 use `mysqltest2`; insert into t1 (b) values(LEAST("Müller","Muffler")) -master-bin.000001 3662 Query 1 3662 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64 -master-bin.000001 3803 Intvar 1 3803 INSERT_ID=74 -master-bin.000001 3831 Create_file 1 3831 db=mysqltest2;table=t1;file_id=1;block_len=581 -master-bin.000001 4504 Query 1 4504 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64 -master-bin.000001 4645 Intvar 1 4645 INSERT_ID=5 -master-bin.000001 4673 Exec_load 1 4673 ;file_id=1 -master-bin.000001 4696 Query 1 4696 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64 -master-bin.000001 4837 Query 1 4837 use `mysqltest2`; truncate table t1 -master-bin.000001 4895 Query 1 4895 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64 -master-bin.000001 5036 Intvar 1 5036 INSERT_ID=1 -master-bin.000001 5064 User var 1 5064 @`a`=_cp850 0x4DFC6C6C6572 COLLATE cp850_general_ci -master-bin.000001 5104 Query 1 5104 use `mysqltest2`; insert into t1 (b) values(collation(@a)) -master-bin.000001 5185 Query 1 5185 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64 -master-bin.000001 5326 Query 1 5326 use `mysqltest2`; drop database mysqltest2 -master-bin.000001 5391 Query 1 5391 SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64 -master-bin.000001 5522 Query 1 5522 drop database mysqltest3 +master-bin.000001 79 Query 1 79 drop database if exists mysqltest2 +master-bin.000001 154 Query 1 154 drop database if exists mysqltest3 +master-bin.000001 229 Query 1 229 create database mysqltest2 character set latin2 +master-bin.000001 317 Query 1 317 use `test`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=8,COLLATION_DATABASE=8,COLLATION_SERVER=30 +master-bin.000001 451 Query 1 451 create database mysqltest3 +master-bin.000001 518 Query 1 518 use `test`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=8,COLLATION_DATABASE=8,COLLATION_SERVER=64 +master-bin.000001 652 Query 1 652 drop database mysqltest3 +master-bin.000001 717 Query 1 717 use `test`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=8,COLLATION_DATABASE=8,COLLATION_SERVER=64 +master-bin.000001 851 Query 1 851 create database mysqltest3 +master-bin.000001 918 Query 1 918 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=8,COLLATION_DATABASE=9,COLLATION_SERVER=64 +master-bin.000001 1058 Query 1 1058 use `mysqltest2`; create table t1 (a int auto_increment primary key, b varchar(100)) +master-bin.000001 1165 Query 1 1165 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=4,COLLATION_CONNECTION=27,COLLATION_DATABASE=9,COLLATION_SERVER=64 +master-bin.000001 1306 Intvar 1 1306 INSERT_ID=1 +master-bin.000001 1334 Query 1 1334 use `mysqltest2`; insert into t1 (b) values(@@character_set_server) +master-bin.000001 1424 Query 1 1424 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=4,COLLATION_CONNECTION=27,COLLATION_DATABASE=9,COLLATION_SERVER=64 +master-bin.000001 1565 Intvar 1 1565 INSERT_ID=2 +master-bin.000001 1593 Query 1 1593 use `mysqltest2`; insert into t1 (b) values(@@collation_server) +master-bin.000001 1679 Query 1 1679 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=4,COLLATION_CONNECTION=27,COLLATION_DATABASE=9,COLLATION_SERVER=64 +master-bin.000001 1820 Intvar 1 1820 INSERT_ID=3 +master-bin.000001 1848 Query 1 1848 use `mysqltest2`; insert into t1 (b) values(@@character_set_client) +master-bin.000001 1938 Query 1 1938 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=4,COLLATION_CONNECTION=27,COLLATION_DATABASE=9,COLLATION_SERVER=64 +master-bin.000001 2079 Intvar 1 2079 INSERT_ID=4 +master-bin.000001 2107 Query 1 2107 use `mysqltest2`; insert into t1 (b) values(@@character_set_connection) +master-bin.000001 2201 Query 1 2201 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=4,COLLATION_CONNECTION=27,COLLATION_DATABASE=9,COLLATION_SERVER=64 +master-bin.000001 2342 Intvar 1 2342 INSERT_ID=5 +master-bin.000001 2370 Query 1 2370 use `mysqltest2`; insert into t1 (b) values(@@collation_connection) +master-bin.000001 2460 Query 1 2460 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=5,COLLATION_DATABASE=9,COLLATION_SERVER=64 +master-bin.000001 2600 Query 1 2600 use `mysqltest2`; truncate table t1 +master-bin.000001 2658 Query 1 2658 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=5,COLLATION_DATABASE=9,COLLATION_SERVER=64 +master-bin.000001 2798 Intvar 1 2798 INSERT_ID=1 +master-bin.000001 2826 Query 1 2826 use `mysqltest2`; insert into t1 (b) values(@@collation_connection) +master-bin.000001 2916 Query 1 2916 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=5,COLLATION_DATABASE=9,COLLATION_SERVER=64 +master-bin.000001 3056 Intvar 1 3056 INSERT_ID=2 +master-bin.000001 3084 Query 1 3084 use `mysqltest2`; insert into t1 (b) values(LEAST("Müller","Muffler")) +master-bin.000001 3177 Query 1 3177 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64 +master-bin.000001 3318 Intvar 1 3318 INSERT_ID=3 +master-bin.000001 3346 Query 1 3346 use `mysqltest2`; insert into t1 (b) values(@@collation_connection) +master-bin.000001 3436 Query 1 3436 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64 +master-bin.000001 3577 Intvar 1 3577 INSERT_ID=4 +master-bin.000001 3605 Query 1 3605 use `mysqltest2`; insert into t1 (b) values(LEAST("Müller","Muffler")) +master-bin.000001 3698 Query 1 3698 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64 +master-bin.000001 3839 Intvar 1 3839 INSERT_ID=74 +master-bin.000001 3867 Create_file 1 3867 db=mysqltest2;table=t1;file_id=1;block_len=581 +master-bin.000001 4540 Query 1 4540 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64 +master-bin.000001 4681 Intvar 1 4681 INSERT_ID=5 +master-bin.000001 4709 Exec_load 1 4709 ;file_id=1 +master-bin.000001 4732 Query 1 4732 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64 +master-bin.000001 4873 Query 1 4873 use `mysqltest2`; truncate table t1 +master-bin.000001 4931 Query 1 4931 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64 +master-bin.000001 5072 Intvar 1 5072 INSERT_ID=1 +master-bin.000001 5100 User var 1 5100 @`a`=_cp850 0x4DFC6C6C6572 COLLATE cp850_general_ci +master-bin.000001 5140 Query 1 5140 use `mysqltest2`; insert into t1 (b) values(collation(@a)) +master-bin.000001 5221 Query 1 5221 use `mysqltest2`; SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64 +master-bin.000001 5362 Query 1 5362 drop database mysqltest2 +master-bin.000001 5427 Query 1 5427 SET ONE_SHOT CHARACTER_SET_CLIENT=8,COLLATION_CONNECTION=31,COLLATION_DATABASE=9,COLLATION_SERVER=64 +master-bin.000001 5558 Query 1 5558 drop database mysqltest3 set global character_set_server=latin2; ERROR HY000: Binary logging and replication forbid changing the global server character set or collation set global character_set_server=latin2; @@ -200,8 +200,8 @@ hex(c1) hex(c2) CDF32C20E7E020F0FBE1E0EBEAF3 CDF32C20E7E020F0FBE1E0EBEAF3 stop slave; delete from t1; -change master to master_log_pos=5801; -start slave until master_log_file='master-bin.000001', master_log_pos=5937; +change master to master_log_pos=5847; +start slave until master_log_file='master-bin.000001', master_log_pos=5983; start slave; select hex(c1), hex(c2) from t1; hex(c1) hex(c2) diff --git a/mysql-test/r/rpl_create_database.result b/mysql-test/r/rpl_create_database.result new file mode 100644 index 00000000000..90c9d83e059 --- /dev/null +++ b/mysql-test/r/rpl_create_database.result @@ -0,0 +1,83 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +DROP DATABASE IF EXISTS mysqltest_prometheus; +DROP DATABASE IF EXISTS mysqltest_sisyfos; +DROP DATABASE IF EXISTS mysqltest_bob; +DROP DATABASE IF EXISTS mysqltest_bob; +CREATE DATABASE mysqltest_prometheus; +CREATE DATABASE mysqltest_sisyfos; +CREATE DATABASE mysqltest_bob; +USE mysqltest_sisyfos; +CREATE TABLE t1 (b int); +INSERT INTO t1 VALUES(1); +USE mysqltest_bob; +CREATE TABLE t2 (b int); +INSERT INTO t2 VALUES(2); +ALTER DATABASE mysqltest_sisyfos CHARACTER SET latin1; +USE mysqltest_sisyfos; +ALTER DATABASE mysqltest_bob CHARACTER SET latin1; +SHOW DATABASES; +Database +mysql +mysqltest_bob +mysqltest_prometheus +mysqltest_sisyfos +test +SHOW DATABASES; +Database +mysql +mysqltest_prometheus +mysqltest_sisyfos +test +DROP DATABASE IF EXISTS mysqltest_sisyfos; +USE mysqltest_prometheus; +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1); +CREATE DATABASE mysqltest_sisyfos; +USE mysqltest_sisyfos; +CREATE TABLE t2 (a INT); +SHOW BINLOG EVENTS; +Log_name Pos Event_type Server_id Orig_log_pos Info +master-bin.000001 4 Start 1 4 Server ver: 4.1.8-debug-log, Binlog ver: 3 +master-bin.000001 79 Query 1 79 DROP DATABASE IF EXISTS mysqltest_prometheus +master-bin.000001 174 Query 1 174 DROP DATABASE IF EXISTS mysqltest_sisyfos +master-bin.000001 263 Query 1 263 CREATE DATABASE mysqltest_prometheus +master-bin.000001 350 Query 1 350 CREATE DATABASE mysqltest_sisyfos +master-bin.000001 431 Query 1 431 use `mysqltest_sisyfos`; CREATE TABLE t1 (b int) +master-bin.000001 502 Query 1 502 use `mysqltest_sisyfos`; INSERT INTO t1 VALUES(1) +master-bin.000001 574 Query 1 574 ALTER DATABASE mysqltest_sisyfos CHARACTER SET latin1 +master-bin.000001 675 Query 1 675 DROP DATABASE IF EXISTS mysqltest_sisyfos +master-bin.000001 764 Query 1 764 use `mysqltest_prometheus`; CREATE TABLE t1 (a INT) +master-bin.000001 838 Query 1 838 use `mysqltest_prometheus`; INSERT INTO t1 VALUES (1) +master-bin.000001 914 Query 1 914 CREATE DATABASE mysqltest_sisyfos +master-bin.000001 995 Query 1 995 use `mysqltest_sisyfos`; CREATE TABLE t2 (a INT) +SHOW DATABASES; +Database +mysql +mysqltest_bob +mysqltest_prometheus +mysqltest_sisyfos +test +SHOW DATABASES; +Database +mysql +mysqltest_prometheus +mysqltest_sisyfos +test +SHOW CREATE TABLE mysqltest_prometheus.t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SHOW CREATE TABLE mysqltest_sisyfos.t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(11) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP DATABASE IF EXISTS mysqltest_prometheus; +DROP DATABASE IF EXISTS mysqltest_sisyfos; +DROP DATABASE IF EXISTS mysqltest_bob; diff --git a/mysql-test/r/rpl_loaddata_rule_m.result b/mysql-test/r/rpl_loaddata_rule_m.result index a34453b0a2b..08f2c2ec071 100644 --- a/mysql-test/r/rpl_loaddata_rule_m.result +++ b/mysql-test/r/rpl_loaddata_rule_m.result @@ -12,4 +12,6 @@ use mysqltest; load data infile '../../std_data/rpl_loaddata.dat' into table test.t1; show binlog events from 79; Log_name Pos Event_type Server_id Orig_log_pos Info +master-bin.000001 79 Query 1 79 drop database if exists mysqltest +master-bin.000001 152 Query 1 152 create database mysqltest drop database mysqltest; diff --git a/mysql-test/t/rpl_charset.test b/mysql-test/t/rpl_charset.test index 9b9f53a94de..68036ae49f1 100644 --- a/mysql-test/t/rpl_charset.test +++ b/mysql-test/t/rpl_charset.test @@ -154,9 +154,9 @@ select hex(c1), hex(c2) from t1; stop slave; delete from t1; -change master to master_log_pos=5801; -start slave until master_log_file='master-bin.000001', master_log_pos=5937; -# Slave is supposed to stop _after_ the INSERT, even though 5937 is +change master to master_log_pos=5847; +start slave until master_log_file='master-bin.000001', master_log_pos=5983; +# Slave is supposed to stop _after_ the INSERT, even though 5983 is # the position of the beginning of the INSERT; after SET slave is not # supposed to increment position. wait_for_slave_to_stop; diff --git a/mysql-test/t/rpl_create_database-master.opt b/mysql-test/t/rpl_create_database-master.opt new file mode 100644 index 00000000000..85660a17140 --- /dev/null +++ b/mysql-test/t/rpl_create_database-master.opt @@ -0,0 +1 @@ +--binlog-do-db=mysqltest_sisyfos --binlog-do-db=mysqltest_prometheus diff --git a/mysql-test/t/rpl_create_database-slave.opt b/mysql-test/t/rpl_create_database-slave.opt new file mode 100644 index 00000000000..96d630c9229 --- /dev/null +++ b/mysql-test/t/rpl_create_database-slave.opt @@ -0,0 +1 @@ +--replicate-do-db=mysqltest_sisyfos --replicate-do-db=mysqltest_prometheus diff --git a/mysql-test/t/rpl_create_database.test b/mysql-test/t/rpl_create_database.test new file mode 100644 index 00000000000..39790b8afa4 --- /dev/null +++ b/mysql-test/t/rpl_create_database.test @@ -0,0 +1,68 @@ +# +# Tests for replication of statements that manipulate databases. +# +# For this test file, we have a number of databases. All databases +# with "greek" names will be replicated on the slave, while other names +# (e.g., american) will not be replicated. +# + +source include/master-slave.inc; + +# Bug#6391 (binlog-do-db rules ignored) +# In this case, 'mysqltest_bob' should not be replicated to the slave. +--disable_warnings +DROP DATABASE IF EXISTS mysqltest_prometheus; +DROP DATABASE IF EXISTS mysqltest_sisyfos; +DROP DATABASE IF EXISTS mysqltest_bob; +sync_slave_with_master; +# This database is not replicated +DROP DATABASE IF EXISTS mysqltest_bob; +--enable_warnings + +connection master; +CREATE DATABASE mysqltest_prometheus; +CREATE DATABASE mysqltest_sisyfos; +CREATE DATABASE mysqltest_bob; + +USE mysqltest_sisyfos; +# These should be replicated +CREATE TABLE t1 (b int); +INSERT INTO t1 VALUES(1); + +USE mysqltest_bob; +# These should *not* be replicated +CREATE TABLE t2 (b int); +INSERT INTO t2 VALUES(2); + +# Current database is now 'mysqltest_bob' +# The following should be replicated +ALTER DATABASE mysqltest_sisyfos CHARACTER SET latin1; + +USE mysqltest_sisyfos; +# The following should *not* be replicated +ALTER DATABASE mysqltest_bob CHARACTER SET latin1; + +SHOW DATABASES; +sync_slave_with_master; +SHOW DATABASES; + +connection master; +DROP DATABASE IF EXISTS mysqltest_sisyfos; +USE mysqltest_prometheus; +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (1); +CREATE DATABASE mysqltest_sisyfos; +USE mysqltest_sisyfos; +CREATE TABLE t2 (a INT); +SHOW BINLOG EVENTS; +SHOW DATABASES; +sync_slave_with_master; +SHOW DATABASES; +SHOW CREATE TABLE mysqltest_prometheus.t1; +SHOW CREATE TABLE mysqltest_sisyfos.t2; + +connection master; +DROP DATABASE IF EXISTS mysqltest_prometheus; +DROP DATABASE IF EXISTS mysqltest_sisyfos; +DROP DATABASE IF EXISTS mysqltest_bob; +sync_slave_with_master; diff --git a/mysql-test/t/rpl_until.test b/mysql-test/t/rpl_until.test index 5eaec0727b6..45b343ace14 100644 --- a/mysql-test/t/rpl_until.test +++ b/mysql-test/t/rpl_until.test @@ -43,7 +43,7 @@ show slave status; # try replicate all until second insert to t2; start slave until relay_log_file='slave-relay-bin.000002', relay_log_pos=537; -sleep 2; +sleep 4; select * from t2; --replace_result $MASTER_MYPORT MASTER_MYPORT --replace_column 1 # 9 # 23 # 33 # diff --git a/sql/handler.cc b/sql/handler.cc index 5dae7950390..d2844f3e09b 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -723,7 +723,7 @@ int ha_rollback_to_savepoint(THD *thd, char *savepoint_name) if (unlikely((thd->options & OPTION_STATUS_NO_TRANS_UPDATE) && my_b_tell(&thd->transaction.trans_log))) { - Query_log_event qinfo(thd, thd->query, thd->query_length, TRUE); + Query_log_event qinfo(thd, thd->query, thd->query_length, TRUE, FALSE); if (mysql_bin_log.write(&qinfo)) error= 1; } @@ -761,7 +761,7 @@ int ha_savepoint(THD *thd, char *savepoint_name) innobase_savepoint(thd,savepoint_name, my_b_tell(&thd->transaction.trans_log)); #endif - Query_log_event qinfo(thd, thd->query, thd->query_length, TRUE); + Query_log_event qinfo(thd, thd->query, thd->query_length, TRUE, FALSE); if (mysql_bin_log.write(&qinfo)) error= 1; } diff --git a/sql/item_func.cc b/sql/item_func.cc index 3fb5bcd01c6..b0ea9a52fb6 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -2007,7 +2007,7 @@ void item_user_lock_release(User_level_lock *ull) tmp.copy(command, strlen(command), tmp.charset()); tmp.append(ull->key,ull->key_length); tmp.append("\")", 2); - Query_log_event qev(current_thd, tmp.ptr(), tmp.length(),1); + Query_log_event qev(current_thd, tmp.ptr(), tmp.length(),1, FALSE); qev.error_code=0; // this query is always safe to run on slave mysql_bin_log.write(&qev); } diff --git a/sql/log.cc b/sql/log.cc index 460910fcee8..6c3ba68165c 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -1274,7 +1274,7 @@ bool MYSQL_LOG::write(Log_event* event_info) (local_db && !db_ok(local_db, binlog_do_db, binlog_ignore_db))) { VOID(pthread_mutex_unlock(&LOCK_log)); - DBUG_PRINT("error",("!db_ok")); + DBUG_PRINT("error",("!db_ok('%s')", local_db)); DBUG_RETURN(0); } #endif /* HAVE_REPLICATION */ @@ -1317,7 +1317,7 @@ COLLATION_CONNECTION=%u,COLLATION_DATABASE=%u,COLLATION_SERVER=%u", (uint) thd->variables.collation_connection->number, (uint) thd->variables.collation_database->number, (uint) thd->variables.collation_server->number); - Query_log_event e(thd, buf, written, 0); + Query_log_event e(thd, buf, written, 0, FALSE); e.set_log_pos(this); if (e.write(file)) goto err; @@ -1333,7 +1333,7 @@ COLLATION_CONNECTION=%u,COLLATION_DATABASE=%u,COLLATION_SERVER=%u", char *buf_end= strxmov(buf, "SET ONE_SHOT TIME_ZONE='", thd->variables.time_zone->get_name()->ptr(), "'", NullS); - Query_log_event e(thd, buf, buf_end - buf, 0); + Query_log_event e(thd, buf, buf_end - buf, 0, FALSE); e.set_log_pos(this); if (e.write(file)) goto err; @@ -1402,7 +1402,7 @@ COLLATION_CONNECTION=%u,COLLATION_DATABASE=%u,COLLATION_SERVER=%u", if (thd->options & OPTION_NO_FOREIGN_KEY_CHECKS) { - Query_log_event e(thd, "SET FOREIGN_KEY_CHECKS=0", 24, 0); + Query_log_event e(thd, "SET FOREIGN_KEY_CHECKS=0", 24, 0, FALSE); e.set_log_pos(this); if (e.write(file)) goto err; @@ -1421,7 +1421,7 @@ COLLATION_CONNECTION=%u,COLLATION_DATABASE=%u,COLLATION_SERVER=%u", { if (thd->options & OPTION_NO_FOREIGN_KEY_CHECKS) { - Query_log_event e(thd, "SET FOREIGN_KEY_CHECKS=1", 24, 0); + Query_log_event e(thd, "SET FOREIGN_KEY_CHECKS=1", 24, 0, FALSE); e.set_log_pos(this); if (e.write(file)) goto err; @@ -1597,7 +1597,7 @@ bool MYSQL_LOG::write(THD *thd, IO_CACHE *cache, bool commit_or_rollback) we will add the "COMMIT mark and write the buffer to the binlog. */ { - Query_log_event qinfo(thd, "BEGIN", 5, TRUE); + Query_log_event qinfo(thd, "BEGIN", 5, TRUE, FALSE); /* Imagine this is rollback due to net timeout, after all statements of the transaction succeeded. Then we want a zero-error code in BEGIN. @@ -1638,7 +1638,7 @@ bool MYSQL_LOG::write(THD *thd, IO_CACHE *cache, bool commit_or_rollback) Query_log_event qinfo(thd, commit_or_rollback ? "COMMIT" : "ROLLBACK", commit_or_rollback ? 6 : 8, - TRUE); + TRUE, FALSE); qinfo.error_code= 0; qinfo.set_log_pos(this); if (qinfo.write(&log_file) || flush_io_cache(&log_file) || diff --git a/sql/log_event.cc b/sql/log_event.cc index 2fdc89504d7..7a4d14d101a 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -780,7 +780,8 @@ void Query_log_event::pack_info(Protocol *protocol) if (!(buf= my_malloc(9 + db_len + q_len, MYF(MY_WME)))) return; pos= buf; - if (db && db_len) + if (!(flags & LOG_EVENT_SUPPRESS_USE_F) + && db && db_len) { pos= strmov(buf, "use `"); memcpy(pos, db, db_len); @@ -872,9 +873,12 @@ int Query_log_event::write_data(IO_CACHE* file) #ifndef MYSQL_CLIENT Query_log_event::Query_log_event(THD* thd_arg, const char* query_arg, - ulong query_length, bool using_trans) - :Log_event(thd_arg, !thd_arg->tmp_table_used ? - 0 : LOG_EVENT_THREAD_SPECIFIC_F, using_trans), + ulong query_length, bool using_trans, + bool suppress_use) + :Log_event(thd_arg, + ((thd_arg->tmp_table_used ? LOG_EVENT_THREAD_SPECIFIC_F : 0) + | (suppress_use ? LOG_EVENT_SUPPRESS_USE_F : 0)), + using_trans), data_buf(0), query(query_arg), db(thd_arg->db), q_len((uint32) query_length), error_code(thd_arg->killed ? @@ -949,14 +953,20 @@ void Query_log_event::print(FILE* file, bool short_form, char* last_db) bool different_db= 1; - if (db && last_db) + if (!(flags & LOG_EVENT_SUPPRESS_USE_F)) { - if (different_db= memcmp(last_db, db, db_len + 1)) - memcpy(last_db, db, db_len + 1); + if (db && last_db) + { + if (different_db= memcmp(last_db, db, db_len + 1)) + memcpy(last_db, db, db_len + 1); + } + + if (db && db[0] && different_db) + { + fprintf(file, "use %s;\n", db); + } } - - if (db && db[0] && different_db) - fprintf(file, "use %s;\n", db); + end=int10_to_str((long) when, strmov(buff,"SET TIMESTAMP="),10); *end++=';'; *end++='\n'; diff --git a/sql/log_event.h b/sql/log_event.h index 1606659e21e..8a2334e8574 100644 --- a/sql/log_event.h +++ b/sql/log_event.h @@ -264,6 +264,19 @@ struct sql_ex_info */ #define LOG_EVENT_THREAD_SPECIFIC_F 0x4 +/* + Suppress the generation of 'USE' statements before the actual + statement. This flag should be set for any events that does not need + the current database set to function correctly. Most notable cases + are 'CREATE DATABASE' and 'DROP DATABASE'. + + This flags should only be used in exceptional circumstances, since + it introduce a significant change in behaviour regarding the + replication logic together with the flags --binlog-do-db and + --replicated-do-db. + */ +#define LOG_EVENT_SUPPRESS_USE_F 0x8 + enum Log_event_type { UNKNOWN_EVENT= 0, START_EVENT= 1, QUERY_EVENT= 2, STOP_EVENT= 3, @@ -331,8 +344,9 @@ public: /* Some 16 flags. Only one is really used now; look above for - LOG_EVENT_TIME_F, LOG_EVENT_FORCED_ROTATE_F, LOG_EVENT_THREAD_SPECIFIC_F - for notes. + LOG_EVENT_TIME_F, LOG_EVENT_FORCED_ROTATE_F, + LOG_EVENT_THREAD_SPECIFIC_F, and LOG_EVENT_SUPPRESS_USE_F for + notes. */ uint16 flags; @@ -465,7 +479,7 @@ public: #ifndef MYSQL_CLIENT Query_log_event(THD* thd_arg, const char* query_arg, ulong query_length, - bool using_trans); + bool using_trans, bool suppress_use); const char* get_db() { return db; } #ifdef HAVE_REPLICATION void pack_info(Protocol* protocol); diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index d6f52fed1d2..60827d6d83e 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -1230,7 +1230,7 @@ bool change_password(THD *thd, const char *host, const char *user, new_password)); thd->clear_error(); mysql_update_log.write(thd, buff, query_length); - Query_log_event qinfo(thd, buff, query_length, 0); + Query_log_event qinfo(thd, buff, query_length, 0, FALSE); mysql_bin_log.write(&qinfo); DBUG_RETURN(0); } diff --git a/sql/sql_base.cc b/sql/sql_base.cc index a5db02478ac..64e616e872f 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -524,7 +524,7 @@ void close_temporary_tables(THD *thd) { /* The -1 is to remove last ',' */ thd->clear_error(); - Query_log_event qinfo(thd, query, (ulong)(end-query)-1, 0); + Query_log_event qinfo(thd, query, (ulong)(end-query)-1, 0, FALSE); /* Imagine the thread had created a temp table, then was doing a SELECT, and the SELECT was killed. Then it's not clever to mark the statement above as @@ -1441,7 +1441,7 @@ static int open_unireg_entry(THD *thd, TABLE *entry, const char *db, { end = strxmov(strmov(query, "DELETE FROM `"), db,"`.`",name,"`", NullS); - Query_log_event qinfo(thd, query, (ulong)(end-query), 0); + Query_log_event qinfo(thd, query, (ulong)(end-query), 0, FALSE); mysql_bin_log.write(&qinfo); my_free(query, MYF(0)); } diff --git a/sql/sql_db.cc b/sql/sql_db.cc index 350a7432990..e3ca0328382 100644 --- a/sql/sql_db.cc +++ b/sql/sql_db.cc @@ -467,7 +467,29 @@ int mysql_create_db(THD *thd, char *db, HA_CREATE_INFO *create_info, mysql_update_log.write(thd, query, query_length); if (mysql_bin_log.is_open()) { - Query_log_event qinfo(thd, query, query_length, 0); + Query_log_event qinfo(thd, query, query_length, 0, + /* suppress_use */ TRUE); + + /* + Write should use the database being created as the "current + database" and not the threads current database, which is the + default. If we do not change the "current database" to the + database being created, the CREATE statement will not be + replicated when using --binlog-do-db to select databases to be + replicated. + + An example (--binlog-do-db=sisyfos): + + CREATE DATABASE bob; # Not replicated + USE bob; # 'bob' is the current database + CREATE DATABASE sisyfos; # Not replicated since 'bob' is + # current database. + USE sisyfos; # Will give error on slave since + # database does not exist. + */ + qinfo.db = db; + qinfo.db_len = strlen(db); + mysql_bin_log.write(&qinfo); } send_ok(thd, result); @@ -517,7 +539,15 @@ int mysql_alter_db(THD *thd, const char *db, HA_CREATE_INFO *create_info) mysql_update_log.write(thd,thd->query, thd->query_length); if (mysql_bin_log.is_open()) { - Query_log_event qinfo(thd, thd->query, thd->query_length, 0); + Query_log_event qinfo(thd, thd->query, thd->query_length, 0, + /* suppress_use */ TRUE); + + // Write should use the database being created as the "current + // database" and not the threads current database, which is the + // default. + qinfo.db = db; + qinfo.db_len = strlen(db); + thd->clear_error(); mysql_bin_log.write(&qinfo); } @@ -625,7 +655,15 @@ int mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent) mysql_update_log.write(thd, query, query_length); if (mysql_bin_log.is_open()) { - Query_log_event qinfo(thd, query, query_length, 0); + Query_log_event qinfo(thd, query, query_length, 0, + /* suppress_use */ TRUE); + + // Write should use the database being created as the "current + // database" and not the threads current database, which is the + // default. + qinfo.db = db; + qinfo.db_len = strlen(db); + thd->clear_error(); mysql_bin_log.write(&qinfo); } diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc index 09893970803..29d86a99ff3 100644 --- a/sql/sql_delete.cc +++ b/sql/sql_delete.cc @@ -216,7 +216,7 @@ cleanup: if (error <= 0) thd->clear_error(); Query_log_event qinfo(thd, thd->query, thd->query_length, - log_delayed); + log_delayed, FALSE); if (mysql_bin_log.write(&qinfo) && transactional_table) error=1; } @@ -565,7 +565,7 @@ bool multi_delete::send_eof() if (error <= 0) thd->clear_error(); Query_log_event qinfo(thd, thd->query, thd->query_length, - log_delayed); + log_delayed, FALSE); if (mysql_bin_log.write(&qinfo) && !normal_tables) local_error=1; // Log write failed: roll back the SQL statement } @@ -674,7 +674,7 @@ end: { thd->clear_error(); Query_log_event qinfo(thd, thd->query, thd->query_length, - thd->tmp_table); + thd->tmp_table, FALSE); mysql_bin_log.write(&qinfo); } send_ok(thd); // This should return record count diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index d590d3b5093..3a2721e658d 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -368,7 +368,7 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list, if (error <= 0) thd->clear_error(); Query_log_event qinfo(thd, thd->query, thd->query_length, - log_delayed); + log_delayed, FALSE); if (mysql_bin_log.write(&qinfo) && transactional_table) error=1; } @@ -1364,7 +1364,7 @@ bool delayed_insert::handle_inserts(void) mysql_update_log.write(&thd,row->query, row->query_length); if (row->log_query & DELAYED_LOG_BIN && using_bin_log) { - Query_log_event qinfo(&thd, row->query, row->query_length,0); + Query_log_event qinfo(&thd, row->query, row->query_length,0, FALSE); mysql_bin_log.write(&qinfo); } } @@ -1539,7 +1539,7 @@ void select_insert::send_error(uint errcode,const char *err) if (mysql_bin_log.is_open()) { Query_log_event qinfo(thd, thd->query, thd->query_length, - table->file->has_transactions()); + table->file->has_transactions(), FALSE); mysql_bin_log.write(&qinfo); } if (!table->tmp_table) @@ -1581,7 +1581,7 @@ bool select_insert::send_eof() if (!error) thd->clear_error(); Query_log_event qinfo(thd, thd->query, thd->query_length, - table->file->has_transactions()); + table->file->has_transactions(), FALSE); mysql_bin_log.write(&qinfo); } if ((error2=ha_autocommit_or_rollback(thd,error)) && ! error) diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index e066e447345..f3d8307c4e0 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -2614,7 +2614,7 @@ unsent_create_error: if (mysql_bin_log.is_open()) { thd->clear_error(); // No binlog error generated - Query_log_event qinfo(thd, thd->query, thd->query_length, 0); + Query_log_event qinfo(thd, thd->query, thd->query_length, 0, FALSE); mysql_bin_log.write(&qinfo); } } @@ -2643,7 +2643,7 @@ unsent_create_error: if (mysql_bin_log.is_open()) { thd->clear_error(); // No binlog error generated - Query_log_event qinfo(thd, thd->query, thd->query_length, 0); + Query_log_event qinfo(thd, thd->query, thd->query_length, 0, FALSE); mysql_bin_log.write(&qinfo); } } @@ -2666,7 +2666,7 @@ unsent_create_error: if (mysql_bin_log.is_open()) { thd->clear_error(); // No binlog error generated - Query_log_event qinfo(thd, thd->query, thd->query_length, 0); + Query_log_event qinfo(thd, thd->query, thd->query_length, 0, FALSE); mysql_bin_log.write(&qinfo); } } @@ -3262,7 +3262,7 @@ purposes internal to the MySQL server", MYF(0)); mysql_update_log.write(thd, thd->query, thd->query_length); if (mysql_bin_log.is_open()) { - Query_log_event qinfo(thd, thd->query, thd->query_length, 0); + Query_log_event qinfo(thd, thd->query, thd->query_length, 0, FALSE); mysql_bin_log.write(&qinfo); } send_ok(thd); @@ -3278,7 +3278,7 @@ purposes internal to the MySQL server", MYF(0)); mysql_update_log.write(thd, thd->query, thd->query_length); if (mysql_bin_log.is_open()) { - Query_log_event qinfo(thd, thd->query, thd->query_length, 0); + Query_log_event qinfo(thd, thd->query, thd->query_length, 0, FALSE); mysql_bin_log.write(&qinfo); } send_ok(thd); @@ -3345,7 +3345,7 @@ purposes internal to the MySQL server", MYF(0)); if (mysql_bin_log.is_open()) { thd->clear_error(); - Query_log_event qinfo(thd, thd->query, thd->query_length, 0); + Query_log_event qinfo(thd, thd->query, thd->query_length, 0, FALSE); mysql_bin_log.write(&qinfo); } } @@ -3366,7 +3366,7 @@ purposes internal to the MySQL server", MYF(0)); if (mysql_bin_log.is_open()) { thd->clear_error(); - Query_log_event qinfo(thd, thd->query, thd->query_length, 0); + Query_log_event qinfo(thd, thd->query, thd->query_length, 0, FALSE); mysql_bin_log.write(&qinfo); } if (mqh_used && lex->sql_command == SQLCOM_GRANT) @@ -3409,7 +3409,7 @@ purposes internal to the MySQL server", MYF(0)); mysql_update_log.write(thd, thd->query, thd->query_length); if (mysql_bin_log.is_open()) { - Query_log_event qinfo(thd, thd->query, thd->query_length, 0); + Query_log_event qinfo(thd, thd->query, thd->query_length, 0, FALSE); mysql_bin_log.write(&qinfo); } } diff --git a/sql/sql_rename.cc b/sql/sql_rename.cc index afaf2ed0923..388034e0f1a 100644 --- a/sql/sql_rename.cc +++ b/sql/sql_rename.cc @@ -84,7 +84,7 @@ bool mysql_rename_tables(THD *thd, TABLE_LIST *table_list) if (mysql_bin_log.is_open()) { thd->clear_error(); - Query_log_event qinfo(thd, thd->query, thd->query_length, 0); + Query_log_event qinfo(thd, thd->query, thd->query_length, 0, FALSE); mysql_bin_log.write(&qinfo); } send_ok(thd); diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 3a242dc6547..4529c7e83e1 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -282,7 +282,8 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists, if (!error) thd->clear_error(); Query_log_event qinfo(thd, thd->query, thd->query_length, - tmp_table_deleted && !some_tables_deleted); + tmp_table_deleted && !some_tables_deleted, + FALSE); mysql_bin_log.write(&qinfo); } } @@ -1292,7 +1293,8 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name, thd->clear_error(); Query_log_event qinfo(thd, thd->query, thd->query_length, test(create_info->options & - HA_LEX_CREATE_TMP_TABLE)); + HA_LEX_CREATE_TMP_TABLE), + FALSE); mysql_bin_log.write(&qinfo); } } @@ -2217,7 +2219,8 @@ int mysql_create_like_table(THD* thd, TABLE_LIST* table, thd->clear_error(); Query_log_event qinfo(thd, thd->query, thd->query_length, test(create_info->options & - HA_LEX_CREATE_TMP_TABLE)); + HA_LEX_CREATE_TMP_TABLE), + FALSE); mysql_bin_log.write(&qinfo); } res= 0; @@ -2328,7 +2331,7 @@ mysql_discard_or_import_tablespace(THD *thd, mysql_update_log.write(thd, thd->query,thd->query_length); if (mysql_bin_log.is_open()) { - Query_log_event qinfo(thd, thd->query, thd->query_length, 0); + Query_log_event qinfo(thd, thd->query, thd->query_length, 0, FALSE); mysql_bin_log.write(&qinfo); } err: @@ -2715,7 +2718,7 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name, if (mysql_bin_log.is_open()) { thd->clear_error(); - Query_log_event qinfo(thd, thd->query, thd->query_length, 0); + Query_log_event qinfo(thd, thd->query, thd->query_length, 0, FALSE); mysql_bin_log.write(&qinfo); } if (do_send_ok) @@ -3110,7 +3113,7 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name, if (mysql_bin_log.is_open()) { thd->clear_error(); - Query_log_event qinfo(thd, thd->query, thd->query_length, 0); + Query_log_event qinfo(thd, thd->query, thd->query_length, 0, FALSE); mysql_bin_log.write(&qinfo); } goto end_temporary; @@ -3245,7 +3248,7 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name, if (mysql_bin_log.is_open()) { thd->clear_error(); - Query_log_event qinfo(thd, thd->query, thd->query_length, 0); + Query_log_event qinfo(thd, thd->query, thd->query_length, 0, FALSE); mysql_bin_log.write(&qinfo); } VOID(pthread_cond_broadcast(&COND_refresh)); diff --git a/sql/sql_update.cc b/sql/sql_update.cc index d3597f274dc..21fcac34070 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -344,7 +344,7 @@ int mysql_update(THD *thd, if (error <= 0) thd->clear_error(); Query_log_event qinfo(thd, thd->query, thd->query_length, - log_delayed); + log_delayed, FALSE); if (mysql_bin_log.write(&qinfo) && transactional_table) error=1; // Rollback update } @@ -1221,7 +1221,7 @@ bool multi_update::send_eof() if (local_error <= 0) thd->clear_error(); Query_log_event qinfo(thd, thd->query, thd->query_length, - log_delayed); + log_delayed, FALSE); if (mysql_bin_log.write(&qinfo) && trans_safe) local_error= 1; // Rollback update } From abb1963df346dc271d4f33e74535a44cc9f56fd4 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 3 Dec 2004 12:45:51 +0100 Subject: [PATCH 0408/1063] ndb - fix abort of scan when in WAIT_AI_SCAN state ndb/src/kernel/blocks/dblqh/DblqhMain.cpp: Make sure to release all resources when aborting scan in state WAIT_AI_SCAN --- ndb/src/kernel/blocks/dblqh/DblqhMain.cpp | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp b/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp index c106a6ddfac..8bbbc72a38d 100644 --- a/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp +++ b/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp @@ -7320,6 +7320,8 @@ void Dblqh::closeScanRequestLab(Signal* signal) scanptr.p->m_curr_batch_size_rows = 0; scanptr.p->m_curr_batch_size_bytes= 0; sendScanFragConf(signal, ZTRUE); + abort_scan(signal, scanptr.i, 0); + return; break; case TcConnectionrec::SCAN_TUPKEY: case TcConnectionrec::SCAN_FIRST_STOPPED: @@ -7710,14 +7712,18 @@ void Dblqh::abort_scan(Signal* signal, Uint32 scan_ptr_i, Uint32 errcode){ releaseScanrec(signal); tcConnectptr.p->transactionState = TcConnectionrec::IDLE; tcConnectptr.p->abortState = TcConnectionrec::ABORT_ACTIVE; - - ScanFragRef * ref = (ScanFragRef*)&signal->theData[0]; - ref->senderData = tcConnectptr.p->clientConnectrec; - ref->transId1 = tcConnectptr.p->transid[0]; - ref->transId2 = tcConnectptr.p->transid[1]; - ref->errorCode = errcode; - sendSignal(tcConnectptr.p->clientBlockref, GSN_SCAN_FRAGREF, signal, - ScanFragRef::SignalLength, JBB); + + if(errcode) + { + jam(); + ScanFragRef * ref = (ScanFragRef*)&signal->theData[0]; + ref->senderData = tcConnectptr.p->clientConnectrec; + ref->transId1 = tcConnectptr.p->transid[0]; + ref->transId2 = tcConnectptr.p->transid[1]; + ref->errorCode = errcode; + sendSignal(tcConnectptr.p->clientBlockref, GSN_SCAN_FRAGREF, signal, + ScanFragRef::SignalLength, JBB); + } deleteTransidHash(signal); releaseOprec(signal); releaseTcrec(signal, tcConnectptr); From 465961799a3372da548ad592e57a13c0e3415c78 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 3 Dec 2004 16:59:49 +0500 Subject: [PATCH 0409/1063] added project files of mysqltest and mysql_test_run_new --- VC++Files/client/mysqltest.dsp | 125 ++++++++++++++++++++ VC++Files/mysql-test/mysql_test_run_new.dsp | 106 +++++++++++++++++ VC++Files/mysql.dsw | 24 ++++ 3 files changed, 255 insertions(+) create mode 100644 VC++Files/client/mysqltest.dsp create mode 100644 VC++Files/mysql-test/mysql_test_run_new.dsp diff --git a/VC++Files/client/mysqltest.dsp b/VC++Files/client/mysqltest.dsp new file mode 100644 index 00000000000..badd61a70b9 --- /dev/null +++ b/VC++Files/client/mysqltest.dsp @@ -0,0 +1,125 @@ +# Microsoft Developer Studio Project File - Name="mysqltest" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=mysqltest - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "mysqltest.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "mysqltest.mak" CFG="mysqltest - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "mysqltest - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "mysqltest - Win32 classic" (based on "Win32 (x86) Console Application") +!MESSAGE "mysqltest - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "mysqltest - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir ".\debug" +# PROP BASE Intermediate_Dir ".\debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir ".\debug" +# PROP Intermediate_Dir ".\debug" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MTd /I "../include" /I "../" /Z7 /W3 /Od /G6 /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_CONSOLE" /D "_WINDOWS" /D "USE_TLS" /D "_MBCS" /Fp".\debug/mysqltest.pch" /Fo".\debug/" /Fd".\debug/" /GZ /c /GX +# ADD CPP /nologo /MTd /I "../include" /I "../" /Z7 /W3 /Od /G6 /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_CONSOLE" /D "_WINDOWS" /D "USE_TLS" /D "_MBCS" /Fp".\debug/mysqltest.pch" /Fo".\debug/" /Fd".\debug/" /GZ /c /GX +# ADD BASE MTL /nologo /tlb".\debug\mysqltest.tlb" /win32 +# ADD MTL /nologo /tlb".\debug\mysqltest.tlb" /win32 +# ADD BASE RSC /l 1033 /d "_DEBUG" +# ADD RSC /l 1033 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib odbc32.lib odbccp32.lib mysys.lib /nologo /out:"..\client_debug\mysqltest.exe" /incremental:no /libpath:"..\lib_debug\" /debug /pdb:".\debug\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib odbc32.lib odbccp32.lib mysys.lib /nologo /out:"..\client_debug\mysqltest.exe" /incremental:no /libpath:"..\lib_debug\" /debug /pdb:".\debug\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386 + +!ELSEIF "$(CFG)" == "mysqltest - Win32 classic" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir ".\classic" +# PROP BASE Intermediate_Dir ".\classic" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir ".\classic" +# PROP Intermediate_Dir ".\classic" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MT /I "../include" /I "../" /W3 /Ob1 /G6 /D "_CONSOLE" /D "_WINDOWS" /D "LICENSE=Commercial" /D "DBUG_OFF" /D "NDEBUG" /D "_MBCS" /GF /Gy /Fp".\classic/mysqltest.pch" /Fo".\classic/" /Fd".\classic/" /c /GX +# ADD CPP /nologo /MT /I "../include" /I "../" /W3 /Ob1 /G6 /D "_CONSOLE" /D "_WINDOWS" /D "LICENSE=Commercial" /D "DBUG_OFF" /D "NDEBUG" /D "_MBCS" /GF /Gy /Fp".\classic/mysqltest.pch" /Fo".\classic/" /Fd".\classic/" /c /GX +# ADD BASE MTL /nologo /tlb".\classic\mysqltest.tlb" /win32 +# ADD MTL /nologo /tlb".\classic\mysqltest.tlb" /win32 +# ADD BASE RSC /l 1033 /d "NDEBUG" +# ADD RSC /l 1033 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib odbc32.lib odbccp32.lib /nologo /out:"..\client_classic\mysqltest.exe" /incremental:no /libpath:"..\lib_release\" /pdb:".\classic\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib odbc32.lib odbccp32.lib /nologo /out:"..\client_classic\mysqltest.exe" /incremental:no /libpath:"..\lib_release\" /pdb:".\classic\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386 + +!ELSEIF "$(CFG)" == "mysqltest - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir ".\release" +# PROP BASE Intermediate_Dir ".\release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir ".\release" +# PROP Intermediate_Dir ".\release" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MT /I "../include" /I "../" /W3 /Ob1 /G6 /D "DBUG_OFF" /D "_CONSOLE" /D "_WINDOWS" /D "NDEBUG" /D "_MBCS" /GF /Gy /Fp".\release/mysqltest.pch" /Fo".\release/" /Fd".\release/" /c /GX +# ADD CPP /nologo /MT /I "../include" /I "../" /W3 /Ob1 /G6 /D "DBUG_OFF" /D "_CONSOLE" /D "_WINDOWS" /D "NDEBUG" /D "_MBCS" /GF /Gy /Fp".\release/mysqltest.pch" /Fo".\release/" /Fd".\release/" /c /GX +# ADD BASE MTL /nologo /tlb".\release\mysqltest.tlb" /win32 +# ADD MTL /nologo /tlb".\release\mysqltest.tlb" /win32 +# ADD BASE RSC /l 1033 /d "NDEBUG" +# ADD RSC /l 1033 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib odbc32.lib odbccp32.lib /nologo /out:"..\client_release\mysqltest.exe" /incremental:no /libpath:"..\lib_release\" /pdb:".\release\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib odbc32.lib odbccp32.lib /nologo /out:"..\client_release\mysqltest.exe" /incremental:no /libpath:"..\lib_release\" /pdb:".\release\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386 + +!ENDIF + +# Begin Target + +# Name "mysqltest - Win32 Debug" +# Name "mysqltest - Win32 classic" +# Name "mysqltest - Win32 Release" +# Begin Source File + +SOURCE=..\libmysql\manager.c +# End Source File +# Begin Source File + +SOURCE=.\mysqltest.c +# End Source File +# End Target +# End Project + diff --git a/VC++Files/mysql-test/mysql_test_run_new.dsp b/VC++Files/mysql-test/mysql_test_run_new.dsp new file mode 100644 index 00000000000..bbdabb98a37 --- /dev/null +++ b/VC++Files/mysql-test/mysql_test_run_new.dsp @@ -0,0 +1,106 @@ +# Microsoft Developer Studio Project File - Name="mysql_test_run_new" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Application" 0x0101 + +CFG=mysql_test_run_new - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "mysql_test_run_new.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "mysql_test_run_new.mak" CFG="mysql_test_run_new - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "mysql_test_run_new - Win32 Debug" (based on "Win32 (x86) Application") +!MESSAGE "mysql_test_run_new - Win32 Release" (based on "Win32 (x86) Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "mysql_test_run_new - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MTd /I "../include" /I "../" /Z7 /W3 /Od /G6 /D "_DEBUG" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /D "__WIN__" /D "_WIN32" /Fp".\debug/mysql_test_run.pch" /Fo".\debug/" /Fd".\debug/" /GZ /c /GX +# ADD CPP /nologo /MTd /I "../include" /I "../" /Z7 /W3 /Od /G6 /D "_DEBUG" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /D "__WIN__" /D "_WIN32" /Fp".\debug/mysql_test_run.pch" /Fo".\debug/" /Fd".\debug/" /GZ /c /GX +# ADD BASE MTL /nologo /win32 +# ADD MTL /nologo /win32 +# ADD BASE RSC /l 1033 +# ADD RSC /l 1033 +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Ws2_32.lib /nologo /out:"..\mysql-test\mysql_test_run_new.exe" /debug /pdb:".\debug\mysql_test_run_new.pdb" /pdbtype:sept /map /mapinfo:exports /subsystem:windows +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Ws2_32.lib /nologo /out:"..\mysql-test\mysql_test_run_new.exe" /debug /pdb:".\debug\mysql_test_run_new.pdb" /pdbtype:sept /map /mapinfo:exports /subsystem:windows + +!ELSEIF "$(CFG)" == "mysql_test_run_new - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MTd /I "../include" /I "../" /W3 /Ob1 /G6 /D "DBUG_OFF" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /D "__WIN__" /D "_WIN32" /GF /Gy /Fo".\release/" /Fd".\release/" /c /GX +# ADD CPP /nologo /MTd /I "../include" /I "../" /W3 /Ob1 /G6 /D "DBUG_OFF" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /D "__WIN__" /D "_WIN32" /GF /Gy /Fo".\release/" /Fd".\release/" /c /GX +# ADD BASE MTL /nologo /win32 +# ADD MTL /nologo /win32 +# ADD BASE RSC /l 1033 +# ADD RSC /l 1033 +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Ws2_32.lib /nologo /out:"..\mysql-test\mysql_test_run_new.exe" /pdbtype:sept /subsystem:windows +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Ws2_32.lib /nologo /out:"..\mysql-test\mysql_test_run_new.exe" /pdbtype:sept /subsystem:windows + +!ENDIF + +# Begin Target + +# Name "mysql_test_run_new - Win32 Debug" +# Name "mysql_test_run_new - Win32 Release" +# Begin Source File + +SOURCE=my_create_tables.c +# End Source File +# Begin Source File + +SOURCE=my_manage.c +# End Source File +# Begin Source File + +SOURCE=my_manage.h +# End Source File +# Begin Source File + +SOURCE=mysql_test_run_new.c +# End Source File +# End Target +# End Project + diff --git a/VC++Files/mysql.dsw b/VC++Files/mysql.dsw index 61a466174b6..222b09c3d80 100644 --- a/VC++Files/mysql.dsw +++ b/VC++Files/mysql.dsw @@ -816,6 +816,30 @@ Package=<4> ############################################################################### +Project: "mysqltest"=.\client\mysqltest.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Project: "mysql_test_run_new"=.\mysql-test\mysql_test_run_new.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + Global: Package=<5> From c9215dc241ab3f26ba3eb2139b6130d0872e3aa4 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 3 Dec 2004 15:00:56 +0100 Subject: [PATCH 0410/1063] ndb: failed update updated tuple version. crash at DbtupTrigger.cpp 1102 ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp: failed update updated tuple version. crash at DbtupTrigger.cpp 1102 --- ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp b/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp index 49de0d80bcd..8e3ca6528c2 100644 --- a/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp +++ b/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp @@ -1113,6 +1113,7 @@ Dbtup::updateStartLab(Signal* signal, regOperPtr->attrinbufLen); if (retValue == -1) { tupkeyErrorLab(signal); + return -1; }//if } else { jam(); From b1f4a482f4545999d6210aabdc2c0a80ee574374 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 3 Dec 2004 15:02:07 +0100 Subject: [PATCH 0411/1063] ndb - fix in test suite ndb/test/src/NDBT_Test.cpp: clear threads when finished waiting --- ndb/test/src/NDBT_Test.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/ndb/test/src/NDBT_Test.cpp b/ndb/test/src/NDBT_Test.cpp index 1434617c988..bbbde008938 100644 --- a/ndb/test/src/NDBT_Test.cpp +++ b/ndb/test/src/NDBT_Test.cpp @@ -519,6 +519,7 @@ void NDBT_TestCaseImpl1::waitSteps(){ NdbThread_WaitFor(threads[i], &status); NdbThread_Destroy(&threads[i]); } + threads.clear(); } From dea513dd12e4f394c1c801006d3350c619f0b64f Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 3 Dec 2004 15:02:29 +0100 Subject: [PATCH 0412/1063] sql/sql_class.h Bug #6284 - report truncation warnings in INSERT ... SELECT only for "INSERT" part sql/sql_insert.cc Bug #6284 - report truncation warnings in INSERT ... SELECT only for "INSERT" part sql/sql_class.h: Bug #6284 - report truncation warnings in INSERT ... SELECT only for "INSERT" part sql/sql_insert.cc: Bug #6284 - report truncation warnings in INSERT ... SELECT only for "INSERT" part --- sql/sql_class.h | 3 ++- sql/sql_insert.cc | 43 +++++++++++++++++-------------------------- 2 files changed, 19 insertions(+), 27 deletions(-) diff --git a/sql/sql_class.h b/sql/sql_class.h index d0d9afc7746..33cd248994a 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -1235,6 +1235,7 @@ class select_insert :public select_result_interceptor { ~select_insert(); int prepare(List &list, SELECT_LEX_UNIT *u); bool send_data(List &items); + virtual void store_values(List &values); void send_error(uint errcode,const char *err); bool send_eof(); /* not implemented: select_insert is never re-used in prepared statements */ @@ -1262,7 +1263,7 @@ public: create_info(create_info_par), lock(0) {} int prepare(List &list, SELECT_LEX_UNIT *u); - bool send_data(List &values); + void store_values(List &values); bool send_eof(); void abort(); }; diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index d590d3b5093..fc4a5f8f9b8 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -1457,7 +1457,6 @@ select_insert::prepare(List &values, SELECT_LEX_UNIT *u) restore_record(table,default_values); // Get empty record table->next_number_field=table->found_next_number_field; - thd->count_cuted_fields= CHECK_FIELD_WARN; // calc cuted fields thd->cuted_fields=0; if (info.handle_duplicates == DUP_IGNORE || info.handle_duplicates == DUP_REPLACE) @@ -1487,27 +1486,34 @@ select_insert::~select_insert() bool select_insert::send_data(List &values) { DBUG_ENTER("select_insert::send_data"); + bool error=0; if (unit->offset_limit_cnt) { // using limit offset,count unit->offset_limit_cnt--; DBUG_RETURN(0); } - if (fields->elements) - fill_record(*fields, values, 1); - else - fill_record(table->field, values, 1); - if (thd->net.report_error || write_record(table,&info)) - DBUG_RETURN(1); - if (table->next_number_field) // Clear for next record + thd->count_cuted_fields= CHECK_FIELD_WARN; // calc cuted fields + store_values(values); + error=thd->net.report_error || write_record(table,&info); + thd->count_cuted_fields= CHECK_FIELD_IGNORE; + if (!error && table->next_number_field) // Clear for next record { table->next_number_field->reset(); if (! last_insert_id && thd->insert_id_used) last_insert_id=thd->insert_id(); } - DBUG_RETURN(0); + DBUG_RETURN(error); } +void select_insert::store_values(List &values) +{ + if (fields->elements) + fill_record(*fields, values, 1); + else + fill_record(table->field, values, 1); +} + void select_insert::send_error(uint errcode,const char *err) { DBUG_ENTER("select_insert::send_error"); @@ -1637,7 +1643,6 @@ select_create::prepare(List &values, SELECT_LEX_UNIT *u) table->next_number_field=table->found_next_number_field; restore_record(table,default_values); // Get empty record - thd->count_cuted_fields= CHECK_FIELD_WARN; // count warnings thd->cuted_fields=0; if (info.handle_duplicates == DUP_IGNORE || info.handle_duplicates == DUP_REPLACE) @@ -1647,23 +1652,9 @@ select_create::prepare(List &values, SELECT_LEX_UNIT *u) } -bool select_create::send_data(List &values) +void select_create::store_values(List &values) { - if (unit->offset_limit_cnt) - { // using limit offset,count - unit->offset_limit_cnt--; - return 0; - } fill_record(field, values, 1); - if (thd->net.report_error ||write_record(table,&info)) - return 1; - if (table->next_number_field) // Clear for next record - { - table->next_number_field->reset(); - if (! last_insert_id && thd->insert_id_used) - last_insert_id=thd->insert_id(); - } - return 0; } @@ -1711,7 +1702,7 @@ void select_create::abort() enum db_type table_type=table->db_type; if (!table->tmp_table) { - ulong version= table->version; + ulong version= table->version; hash_delete(&open_cache,(byte*) table); if (!create_info->table_existed) quick_rm_table(table_type, db, name); From f2d6046eda1d0e210eb6aa68d6d604d2ef824918 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 3 Dec 2004 15:18:25 +0100 Subject: [PATCH 0413/1063] Due to a compiler bug, slave.cc:tables_ok() sometimes wrongly returns 1 if the return type is int or int_fast8_t. The test case that showed this problem is rpl000001 and the tested version was MySQL 5.0.2. The compiler with the problem is GCC 3.0.4 runing on "Linux bitch 2.4.18 #2 Thu Apr 11 14:37:17 EDT 2002 sparc64 unknown". By changing the return type to bool the problem disappear. (Another way to make the problem disappear is to simply print the returned value with printf("%d",?). The printed returned value is always 0 in the test cases I have run.) This is only a partial solution to the problem, since someone could later change the return type of the function back to int or some other type that does not work. sql/slave.cc: Changed type sql/slave.h: Changed type --- sql/slave.cc | 2 +- sql/slave.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/slave.cc b/sql/slave.cc index b5caf2627a6..bd9650ed369 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -759,7 +759,7 @@ static TABLE_RULE_ENT* find_wild(DYNAMIC_ARRAY *a, const char* key, int len) 1 should be logged/replicated */ -int tables_ok(THD* thd, TABLE_LIST* tables) +bool tables_ok(THD* thd, TABLE_LIST* tables) { bool some_tables_updating= 0; DBUG_ENTER("tables_ok"); diff --git a/sql/slave.h b/sql/slave.h index a4d123329c6..08cf0806717 100644 --- a/sql/slave.h +++ b/sql/slave.h @@ -496,7 +496,7 @@ int show_master_info(THD* thd, MASTER_INFO* mi); int show_binlog_info(THD* thd); /* See if the query uses any tables that should not be replicated */ -int tables_ok(THD* thd, TABLE_LIST* tables); +bool tables_ok(THD* thd, TABLE_LIST* tables); /* Check to see if the database is ok to operate on with respect to the From 77e833d529acc6ade513d5dacfd9c6eda0fe6a1d Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 3 Dec 2004 17:35:50 +0100 Subject: [PATCH 0414/1063] compatibility fix (2G filesize limit) --- mysql-test/t/ps_1general.test | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mysql-test/t/ps_1general.test b/mysql-test/t/ps_1general.test index baa37dbf41d..08c1ad85fb1 100644 --- a/mysql-test/t/ps_1general.test +++ b/mysql-test/t/ps_1general.test @@ -294,12 +294,14 @@ execute stmt4; prepare stmt4 from ' show table status from test like ''t2%'' '; # egalize date and time values --replace_column 12 # 13 # 14 # +--replace_result 2147483647 64424509439 # Bug#4288 : prepared statement 'show table status ..', wrong output on execute execute stmt4; # try the same with the big table prepare stmt4 from ' show table status from test like ''t9%'' '; # egalize date and time values --replace_column 12 # 13 # 14 # +--replace_result 2147483647 4294967295 # Bug#4288 execute stmt4; prepare stmt4 from ' show status like ''Threads_running'' '; From 67aec82f792d65ebc2fe49574c5cb02ce2d1c727 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 3 Dec 2004 18:42:35 +0100 Subject: [PATCH 0415/1063] Fix t/rpl_create_database.test: replace version in SHOW BINLOG RESULTS mysql-test/t/rpl_create_database.test: need to replace version in results mysql-test/r/rpl_create_database.result: version gets replaced --- mysql-test/r/rpl_create_database.result | 2 +- mysql-test/t/rpl_create_database.test | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/rpl_create_database.result b/mysql-test/r/rpl_create_database.result index 90c9d83e059..2375e13bb5c 100644 --- a/mysql-test/r/rpl_create_database.result +++ b/mysql-test/r/rpl_create_database.result @@ -42,7 +42,7 @@ USE mysqltest_sisyfos; CREATE TABLE t2 (a INT); SHOW BINLOG EVENTS; Log_name Pos Event_type Server_id Orig_log_pos Info -master-bin.000001 4 Start 1 4 Server ver: 4.1.8-debug-log, Binlog ver: 3 +master-bin.000001 4 Start 1 4 Server ver: VERSION, Binlog ver: 3 master-bin.000001 79 Query 1 79 DROP DATABASE IF EXISTS mysqltest_prometheus master-bin.000001 174 Query 1 174 DROP DATABASE IF EXISTS mysqltest_sisyfos master-bin.000001 263 Query 1 263 CREATE DATABASE mysqltest_prometheus diff --git a/mysql-test/t/rpl_create_database.test b/mysql-test/t/rpl_create_database.test index 39790b8afa4..7ed0d5dbdbb 100644 --- a/mysql-test/t/rpl_create_database.test +++ b/mysql-test/t/rpl_create_database.test @@ -54,6 +54,8 @@ INSERT INTO t1 VALUES (1); CREATE DATABASE mysqltest_sisyfos; USE mysqltest_sisyfos; CREATE TABLE t2 (a INT); +let $VERSION=`select version()`; +--replace_result $VERSION VERSION SHOW BINLOG EVENTS; SHOW DATABASES; sync_slave_with_master; From 863c73898fced0216b6dcadda99366fbf8f3cdfc Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 3 Dec 2004 21:26:14 +0000 Subject: [PATCH 0416/1063] added configure option to control extra ndb debug options, for release debug build please configure with --without-ndb-debug --- acinclude.m4 | 23 +++++++++++++++++++++++ configure.in | 17 ++++++++++++++--- 2 files changed, 37 insertions(+), 3 deletions(-) diff --git a/acinclude.m4 b/acinclude.m4 index 81917372206..b43fad3ec70 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -1624,6 +1624,11 @@ AC_DEFUN([MYSQL_CHECK_NDB_OPTIONS], [ --with-ndb-port-base Base port for NDB Cluster transporters], [ndb_port_base="$withval"], [ndb_port_base="default"]) + AC_ARG_WITH([ndb-debug], + [ + --without-ndb-debug Disable special ndb debug features], + [ndb_debug="$withval"], + [ndb_debug="no"]) AC_MSG_CHECKING([for NDB Cluster options]) AC_MSG_RESULT([]) @@ -1663,6 +1668,24 @@ AC_DEFUN([MYSQL_CHECK_NDB_OPTIONS], [ ;; esac + case "$ndb_debug" in + yes ) + AC_MSG_RESULT([-- including ndb extra debug options]) + with_ndb_debug="yes" + ;; + full ) + AC_MSG_RESULT([-- including ndb extra extra debug options]) + with_ndb_debug="full" + ;; + no ) + AC_MSG_RESULT([-- not including ndb extra debug options]) + with_ndb_debug="no" + ;; + * ) + with_ndb_debug="default" + ;; + esac + AC_MSG_RESULT([done.]) ]) diff --git a/configure.in b/configure.in index 4aa4b3c9845..4e5f919af2a 100644 --- a/configure.in +++ b/configure.in @@ -3039,15 +3039,26 @@ then MAKE_BINARY_DISTRIBUTION_OPTIONS="$MAKE_BINARY_DISTRIBUTION_OPTIONS --with-ndbcluster" CXXFLAGS="$CXXFLAGS \$(NDB_CXXFLAGS)" - if test "$with_debug" = "yes" + if test "$with_ndb_debug" = "default" + then + with_ndb_debug = $with_debug + fi + + if test "$with_ndb_debug" = "yes" then # Medium debug. NDB_DEFS="-DNDB_DEBUG -DVM_TRACE -DERROR_INSERT -DARRAY_GUARD" - elif test "$with_debug" = "full" + elif test "$with_ndb_debug" = "full" then NDB_DEFS="-DNDB_DEBUG_FULL -DVM_TRACE -DERROR_INSERT -DARRAY_GUARD" else - NDB_DEFS="-DNDEBUG" + # no extra ndb debug but still do asserts if debug version + if test "$with_debug" = "yes" -o "$with_debug" = "full" + then + NDB_DEFS="" + else + NDB_DEFS="-DNDEBUG" + fi fi AC_SUBST([NDB_DEFS]) From f83514a0077fc63fbc446b2d9df2925652b8ec50 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 3 Dec 2004 23:07:08 +0100 Subject: [PATCH 0417/1063] Fix for BUG#6671 "mysqlbinlog does not show thread_id for LOAD DATA INFILE" (exactly, for the bug in 4.1 reported in this bug report). We just make Load_log_event work like Query_log_event for temp tables. sql/log_event.cc: For LOAD DATA INFILE to be preceded by SET PSEUDO_THREAD_ID if needed, in the mysqlbinlog output, we need to use the LOG_EVENT_THREAD_SPECIFIC_F flag in Load_log_event exactly like we already do in Query_log_event. --- sql/log_event.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sql/log_event.cc b/sql/log_event.cc index 2fdc89504d7..e76b1d8a759 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -1406,7 +1406,9 @@ Load_log_event::Load_log_event(THD *thd_arg, sql_exchange *ex, List &fields_arg, enum enum_duplicates handle_dup, bool using_trans) - :Log_event(thd_arg, 0, using_trans), thread_id(thd_arg->thread_id), + :Log_event(thd_arg, !thd_arg->tmp_table_used ? + 0 : LOG_EVENT_THREAD_SPECIFIC_F, using_trans), + thread_id(thd_arg->thread_id), slave_proxy_id(thd_arg->variables.pseudo_thread_id), num_fields(0),fields(0), field_lens(0),field_block_len(0), @@ -1596,6 +1598,9 @@ void Load_log_event::print(FILE* file, bool short_form, char* last_db, commented ? "# " : "", db); + if (flags & LOG_EVENT_THREAD_SPECIFIC_F) + fprintf(file,"%sSET @@session.pseudo_thread_id=%lu;\n", + commented ? "# " : "", (ulong)thread_id); fprintf(file, "%sLOAD DATA ", commented ? "# " : ""); if (check_fname_outside_temp_buf()) From 56080a8d1ef21e6330e76de27eb28fc2daf5876a Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 4 Dec 2004 00:14:18 +0200 Subject: [PATCH 0418/1063] postreview fixes mysql-test/r/subselect_innodb.result: fixed result of test mysql-test/t/subselect_innodb.test: fixed test layout --- mysql-test/r/subselect_innodb.result | 26 ++++++++++++++++++++++++++ mysql-test/t/subselect_innodb.test | 15 +++++++++++++-- 2 files changed, 39 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/subselect_innodb.result b/mysql-test/r/subselect_innodb.result index e8f6426f51b..0b813a07a1d 100644 --- a/mysql-test/r/subselect_innodb.result +++ b/mysql-test/r/subselect_innodb.result @@ -114,3 +114,29 @@ SELECT R.unit, R.ingredient FROM t1 R WHERE R.ingredient IN (SELECT N.ingredient unit ingredient xx yy drop table t1, t2; +CREATE TABLE t1 ( +id INT NOT NULL auto_increment, +date1 DATE, coworkerid INT, +description VARCHAR(255), +sum_used DOUBLE, +sum_remaining DOUBLE, +comments VARCHAR(255), +PRIMARY KEY(id) +) engine=innodb; +insert into t1 values (NULL, '1999-01-01', 1,'test', 22, 33, 'comment'), (NULL, '1999-01-01', 1,'test', 22, 33, 'comment'), (NULL, '1999-01-01', 1,'test', 22, 33, 'comment'), (NULL, '1998-01-01', 1,'test', 22, 33, 'comment'), (NULL, '1998-01-01', 1,'test', 22, 33, 'comment'), (NULL, '2004-01-01', 1,'test', 22, 33, 'comment'), (NULL, '2004-01-01', 1,'test', 22, 33, 'comment'); +SELECT DISTINCT +(SELECT sum(sum_used) FROM t1 WHERE sum_used > 0 AND year(date1) <= '2004') as somallontvangsten, +(SELECT sum(sum_used) FROM t1 WHERE sum_used < 0 AND year(date1) <= '2004') as somalluitgaven +FROM t1; +somallontvangsten somalluitgaven +154 NULL +select * from t1; +id date1 coworkerid description sum_used sum_remaining comments +1 1999-01-01 1 test 22 33 comment +2 1999-01-01 1 test 22 33 comment +3 1999-01-01 1 test 22 33 comment +4 1998-01-01 1 test 22 33 comment +5 1998-01-01 1 test 22 33 comment +6 2004-01-01 1 test 22 33 comment +7 2004-01-01 1 test 22 33 comment +drop table t1; diff --git a/mysql-test/t/subselect_innodb.test b/mysql-test/t/subselect_innodb.test index 54c56e640dc..aa7fe138876 100644 --- a/mysql-test/t/subselect_innodb.test +++ b/mysql-test/t/subselect_innodb.test @@ -129,8 +129,19 @@ drop table t1, t2; # # possible early unlock # -CREATE TABLE t1 ( id INT NOT NULL auto_increment, date1 DATE, coworkerid INT, description VARCHAR(255), sum_used DOUBLE, sum_remaining DOUBLE, comments VARCHAR(255), PRIMARY KEY(id)) engine=innodb; +CREATE TABLE t1 ( + id INT NOT NULL auto_increment, + date1 DATE, coworkerid INT, + description VARCHAR(255), + sum_used DOUBLE, + sum_remaining DOUBLE, + comments VARCHAR(255), + PRIMARY KEY(id) +) engine=innodb; insert into t1 values (NULL, '1999-01-01', 1,'test', 22, 33, 'comment'), (NULL, '1999-01-01', 1,'test', 22, 33, 'comment'), (NULL, '1999-01-01', 1,'test', 22, 33, 'comment'), (NULL, '1998-01-01', 1,'test', 22, 33, 'comment'), (NULL, '1998-01-01', 1,'test', 22, 33, 'comment'), (NULL, '2004-01-01', 1,'test', 22, 33, 'comment'), (NULL, '2004-01-01', 1,'test', 22, 33, 'comment'); -SELECT DISTINCT (SELECT sum(sum_used) FROM t1 WHERE sum_used > 0 AND year(date1) <= '2004') as somallontvangsten, (SELECT sum(sum_used) FROM t1 WHERE sum_used < 0 AND year(date1) <= '2004') as somalluitgaven FROM t1; +SELECT DISTINCT + (SELECT sum(sum_used) FROM t1 WHERE sum_used > 0 AND year(date1) <= '2004') as somallontvangsten, + (SELECT sum(sum_used) FROM t1 WHERE sum_used < 0 AND year(date1) <= '2004') as somalluitgaven + FROM t1; select * from t1; drop table t1; From b6aa3489fe681611a43edb5b23b72b926de30ebd Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 4 Dec 2004 10:06:38 +0100 Subject: [PATCH 0419/1063] help text corrected --- client/mysqldump.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/mysqldump.c b/client/mysqldump.c index 489063ffc73..b4fa293c19c 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -158,7 +158,7 @@ static struct my_option my_long_options[] = (gptr*) &opt_compatible_mode_str, (gptr*) &opt_compatible_mode_str, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"compact", OPT_COMPACT, - "Give less verbose output (useful for debugging). Disables structure comments and header/footer constructs. Enables options --skip-add-drop-table --no-set-names --skip-disable-keys --skip-lock-tables", + "Give less verbose output (useful for debugging). Disables structure comments and header/footer constructs. Enables options --skip-add-drop-table --no-set-names --skip-disable-keys --skip-add-locks", (gptr*) &opt_compact, (gptr*) &opt_compact, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"complete-insert", 'c', "Use complete insert statements.", (gptr*) &cFlag, From f8cdf570979c550ef04c53f691118ed2b1296a7c Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 4 Dec 2004 15:17:13 +0100 Subject: [PATCH 0420/1063] ndb: fix solaris (etc) ndb startup problem in mysql-test-run ndb/src/common/util/NdbOut.cpp: avoid printf("%s", (char*)0) --- ndb/src/common/util/NdbOut.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ndb/src/common/util/NdbOut.cpp b/ndb/src/common/util/NdbOut.cpp index fa74cb364f3..e20119a7987 100644 --- a/ndb/src/common/util/NdbOut.cpp +++ b/ndb/src/common/util/NdbOut.cpp @@ -54,7 +54,7 @@ NdbOut& NdbOut::operator<<(unsigned long int v) { return *this << (Uint64) v; } NdbOut& -NdbOut::operator<<(const char* val){ m_out->print("%s", val); return * this; } +NdbOut::operator<<(const char* val){ m_out->print("%s", val ? val : "(null)"); return * this; } NdbOut& NdbOut::operator<<(const void* val){ m_out->print("%p", val); return * this; } NdbOut& From a5cc93b9235f58aefa96b23bb12cc589195ddaca Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 6 Dec 2004 11:41:16 +1100 Subject: [PATCH 0421/1063] Add (optional) endian parameter to 'get nodeid' to warn on endian conflicts. ndb/src/mgmapi/mgmapi.cpp: Send an extra (optional) parameter to 'get nodeid' to detect potential endianness conflicts. endian: big endian: small Server will deny our nodeid request if we're not compatible. If parameter is not specified, we behave how we used to (work or fail). ndb/src/mgmsrv/Services.cpp: Add extra (optional) parameter to 'get nodeid' to detect potential endianness conflicts. endian: big endian: little we will deny the nodeid request if the endian parameter is provided and the endian doesn't match. This should preserve compatibility with all clients. BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted --- BitKeeper/etc/logging_ok | 1 + ndb/src/mgmapi/mgmapi.cpp | 4 ++++ ndb/src/mgmsrv/Services.cpp | 15 ++++++++++++++- 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok index b8043910a11..6c673fdc2bd 100644 --- a/BitKeeper/etc/logging_ok +++ b/BitKeeper/etc/logging_ok @@ -192,6 +192,7 @@ serg@sergbook.mylan serg@sergbook.mysql.com sergefp@mysql.com sinisa@rhols221.adsl.netsonic.fi +stewart@mysql.com tfr@beta.frontier86.ee tfr@indrek.tfr.cafe.ee tfr@sarvik.tfr.cafe.ee diff --git a/ndb/src/mgmapi/mgmapi.cpp b/ndb/src/mgmapi/mgmapi.cpp index e22ceffe773..0768a9844af 100644 --- a/ndb/src/mgmapi/mgmapi.cpp +++ b/ndb/src/mgmapi/mgmapi.cpp @@ -1690,6 +1690,9 @@ ndb_mgm_alloc_nodeid(NdbMgmHandle handle, unsigned int version, int nodetype) { CHECK_HANDLE(handle, 0); CHECK_CONNECTED(handle, 0); + union { long l; char c[sizeof(long)]; } endian_check; + + endian_check.l = 1; int nodeid= handle->cfg._ownNodeId; @@ -1700,6 +1703,7 @@ ndb_mgm_alloc_nodeid(NdbMgmHandle handle, unsigned int version, int nodetype) args.put("user", "mysqld"); args.put("password", "mysqld"); args.put("public key", "a public key"); + args.put("endian", (endian_check.c[sizeof(long)-1])?"big":"little"); const ParserRow reply[]= { MGM_CMD("get nodeid reply", NULL, ""), diff --git a/ndb/src/mgmsrv/Services.cpp b/ndb/src/mgmsrv/Services.cpp index 5834d40cc78..2b3fb346d72 100644 --- a/ndb/src/mgmsrv/Services.cpp +++ b/ndb/src/mgmsrv/Services.cpp @@ -132,6 +132,7 @@ ParserRow commands[] = { MGM_ARG("user", String, Mandatory, "Password"), MGM_ARG("password", String, Mandatory, "Password"), MGM_ARG("public key", String, Mandatory, "Public key"), + MGM_ARG("endian", String, Optional, "Endianness"), MGM_CMD("get version", &MgmApiSession::getVersion, ""), @@ -386,6 +387,8 @@ MgmApiSession::get_nodeid(Parser_t::Context &, const char * user; const char * password; const char * public_key; + const char * endian; + union { long l; char c[sizeof(long)]; } endian_check; args.get("version", &version); args.get("nodetype", &nodetype); @@ -394,7 +397,17 @@ MgmApiSession::get_nodeid(Parser_t::Context &, args.get("user", &user); args.get("password", &password); args.get("public key", &public_key); - + args.get("endian", &endian); + + endian_check.l = 1; + if(endian + && strcmp(endian,(endian_check.c[sizeof(long)-1])?"big":"little")!=0) { + m_output->println(cmd); + m_output->println("result: Endianness of nodes does not match."); + m_output->println(""); + return; + } + bool compatible; switch (nodetype) { case NODE_TYPE_MGM: From 80b3339f6912dea66c98efd8b54de9f176cd7e99 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 6 Dec 2004 11:43:02 +1100 Subject: [PATCH 0422/1063] Integrate suggestions from Tomas Ulin's mail. (r.e. reporting an error in the case of endianness mismatch). ndb/src/mgmsrv/Services.cpp: - initialise endian= 0; args.get will not set if not found - change error message to be clearer --- ndb/src/mgmsrv/Services.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ndb/src/mgmsrv/Services.cpp b/ndb/src/mgmsrv/Services.cpp index 2b3fb346d72..9ee0203e454 100644 --- a/ndb/src/mgmsrv/Services.cpp +++ b/ndb/src/mgmsrv/Services.cpp @@ -387,7 +387,7 @@ MgmApiSession::get_nodeid(Parser_t::Context &, const char * user; const char * password; const char * public_key; - const char * endian; + const char * endian= NULL; union { long l; char c[sizeof(long)]; } endian_check; args.get("version", &version); @@ -403,7 +403,7 @@ MgmApiSession::get_nodeid(Parser_t::Context &, if(endian && strcmp(endian,(endian_check.c[sizeof(long)-1])?"big":"little")!=0) { m_output->println(cmd); - m_output->println("result: Endianness of nodes does not match."); + m_output->println("result: Node does not have the same endianness as the management server."); m_output->println(""); return; } From 1b3c814d424330160bb12d03e2c47ccbcd5869df Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 6 Dec 2004 10:57:22 +0400 Subject: [PATCH 0423/1063] configure.in: latin1_spanish_ci produced unknown collation error. configure.in: latin1_spanish_ci produced unknown collation error. --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 0d6e797f571..086a839594e 100644 --- a/configure.in +++ b/configure.in @@ -2714,7 +2714,7 @@ case $default_charset in ;; latin1) default_charset_default_collation="latin1_swedish_ci" - default_charset_collations="latin1_general_ci latin1_general_cs latin1_bin latin1_german1_ci latin1_german2_ci latin1_danish_ci latin1_swedish_ci" + default_charset_collations="latin1_general_ci latin1_general_cs latin1_bin latin1_german1_ci latin1_german2_ci latin1_danish_ci latin1_spanish_ci latin1_swedish_ci" ;; latin2) default_charset_default_collation="latin2_general_ci" From 88f1b90a700fcae4d918676e6e2148520655fa7b Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 6 Dec 2004 11:42:41 +0400 Subject: [PATCH 0424/1063] Fix for bug #6755 (ALTER TABLE ENABLE KEYS corrupts spatial index) myisam/mi_check.c: Spatial keys should not be filesort-ed. Specific function neede to insert key into spatial index mysql-test/r/gis-rtree.result: Appropriate test result mysql-test/t/gis-rtree.test: Test case --- myisam/mi_check.c | 10 +++++++- mysql-test/r/gis-rtree.result | 41 ++++++++++++++++++++++++++++++ mysql-test/t/gis-rtree.test | 47 +++++++++++++++++++++++++++++++++++ 3 files changed, 97 insertions(+), 1 deletion(-) diff --git a/myisam/mi_check.c b/myisam/mi_check.c index 2999482549c..f7e7ffd42f6 100644 --- a/myisam/mi_check.c +++ b/myisam/mi_check.c @@ -26,6 +26,7 @@ #ifdef HAVE_SYS_MMAN_H #include #endif +#include "rt_index.h" #ifndef USE_RAID #define my_raid_create(A,B,C,D,E,F,G) my_create(A,B,C,G) @@ -1465,6 +1466,12 @@ static int writekeys(MI_CHECK *param, register MI_INFO *info, byte *buff, if (_mi_ft_add(info,i,(char*) key,buff,filepos)) goto err; } + else if (info->s->keyinfo[i].flag & HA_SPATIAL) + { + uint key_length=_mi_make_key(info,i,key,buff,filepos); + if (rtree_insert(info, i, key, key_length)) + goto err; + } else { uint key_length=_mi_make_key(info,i,key,buff,filepos); @@ -3987,7 +3994,8 @@ static my_bool mi_too_big_key_for_sort(MI_KEYDEF *key, ha_rows rows) key->seg->charset->mbmaxlen; key_maxlength+=ft_max_word_len_for_sort-HA_FT_MAXBYTELEN; } - return (key->flag & (HA_BINARY_PACK_KEY | HA_VAR_LENGTH_KEY | HA_FULLTEXT) && + return (key->flag & HA_SPATIAL) || + (key->flag & (HA_BINARY_PACK_KEY | HA_VAR_LENGTH_KEY | HA_FULLTEXT) && ((ulonglong) rows * key_maxlength > (ulonglong) myisam_max_temp_length)); } diff --git a/mysql-test/r/gis-rtree.result b/mysql-test/r/gis-rtree.result index 3fb1a5dd31c..4ca8c379307 100644 --- a/mysql-test/r/gis-rtree.result +++ b/mysql-test/r/gis-rtree.result @@ -757,3 +757,44 @@ SPATIAL KEY(g) ) ENGINE=MyISAM; INSERT INTO t1 (g) VALUES (GeomFromText('LineString(1 2, 2 3)')),(GeomFromText('LineString(1 2, 2 4)')); drop table t1; +CREATE TABLE t1 ( +geoobjid INT NOT NULL, +line LINESTRING NOT NULL, +kind ENUM('po', 'pp', 'rr', 'dr', 'rd', 'ts', 'cl') NOT NULL DEFAULT 'po', +name VARCHAR(32), +SPATIAL KEY (line) +) engine=myisam; +ALTER TABLE t1 DISABLE KEYS; +INSERT INTO t1 (name, kind, line) VALUES +("Aadaouane", "pp", GeomFromText("POINT(32.816667 35.983333)")), +("Aadassiye", "pp", GeomFromText("POINT(35.816667 36.216667)")), +("Aadbel", "pp", GeomFromText("POINT(34.533333 36.100000)")), +("Aadchit", "pp", GeomFromText("POINT(33.347222 35.423611)")), +("Aadchite", "pp", GeomFromText("POINT(33.347222 35.423611)")), +("Aadchit el Qoussair", "pp", GeomFromText("POINT(33.283333 35.483333)")), +("Aaddaye", "pp", GeomFromText("POINT(36.716667 40.833333)")), +("'Aadeissa", "pp", GeomFromText("POINT(32.823889 35.698889)")), +("Aaderup", "pp", GeomFromText("POINT(55.216667 11.766667)")), +("Qalaat Aades", "pp", GeomFromText("POINT(33.503333 35.377500)")), +("A ad'ino", "pp", GeomFromText("POINT(54.812222 38.209167)")), +("Aadi Noia", "pp", GeomFromText("POINT(13.800000 39.833333)")), +("Aad La Macta", "pp", GeomFromText("POINT(35.779444 -0.129167)")), +("Aadland", "pp", GeomFromText("POINT(60.366667 5.483333)")), +("Aadliye", "pp", GeomFromText("POINT(33.366667 36.333333)")), +("Aadloun", "pp", GeomFromText("POINT(33.403889 35.273889)")), +("Aadma", "pp", GeomFromText("POINT(58.798333 22.663889)")), +("Aadma Asundus", "pp", GeomFromText("POINT(58.798333 22.663889)")), +("Aadmoun", "pp", GeomFromText("POINT(34.150000 35.650000)")), +("Aadneram", "pp", GeomFromText("POINT(59.016667 6.933333)")), +("Aadneskaar", "pp", GeomFromText("POINT(58.083333 6.983333)")), +("Aadorf", "pp", GeomFromText("POINT(47.483333 8.900000)")), +("Aadorp", "pp", GeomFromText("POINT(52.366667 6.633333)")), +("Aadouane", "pp", GeomFromText("POINT(32.816667 35.983333)")), +("Aadoui", "pp", GeomFromText("POINT(34.450000 35.983333)")), +("Aadouiye", "pp", GeomFromText("POINT(34.583333 36.183333)")), +("Aadouss", "pp", GeomFromText("POINT(33.512500 35.601389)")), +("Aadra", "pp", GeomFromText("POINT(33.616667 36.500000)")), +("Aadzi", "pp", GeomFromText("POINT(38.100000 64.850000)")); +ALTER TABLE t1 ENABLE KEYS; +INSERT INTO t1 (name, kind, line) VALUES ("austria", "pp", GeomFromText('LINESTRING(14.9906 48.9887,14.9946 48.9904,14.9947 48.9916)')); +drop table t1; diff --git a/mysql-test/t/gis-rtree.test b/mysql-test/t/gis-rtree.test index 817249b7e4c..cb1627e0500 100644 --- a/mysql-test/t/gis-rtree.test +++ b/mysql-test/t/gis-rtree.test @@ -118,3 +118,50 @@ CREATE TABLE t1 ( INSERT INTO t1 (g) VALUES (GeomFromText('LineString(1 2, 2 3)')),(GeomFromText('LineString(1 2, 2 4)')); #select * from t1 where g Date: Mon, 6 Dec 2004 08:49:34 +0000 Subject: [PATCH 0425/1063] wixed ndb-debug option for configure --- acinclude.m4 | 10 +++++----- configure.in | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/acinclude.m4 b/acinclude.m4 index b43fad3ec70..730ee15ed20 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -1628,7 +1628,7 @@ AC_DEFUN([MYSQL_CHECK_NDB_OPTIONS], [ [ --without-ndb-debug Disable special ndb debug features], [ndb_debug="$withval"], - [ndb_debug="no"]) + [ndb_debug="default"]) AC_MSG_CHECKING([for NDB Cluster options]) AC_MSG_RESULT([]) @@ -1671,18 +1671,18 @@ AC_DEFUN([MYSQL_CHECK_NDB_OPTIONS], [ case "$ndb_debug" in yes ) AC_MSG_RESULT([-- including ndb extra debug options]) - with_ndb_debug="yes" + have_ndb_debug="yes" ;; full ) AC_MSG_RESULT([-- including ndb extra extra debug options]) - with_ndb_debug="full" + have_ndb_debug="full" ;; no ) AC_MSG_RESULT([-- not including ndb extra debug options]) - with_ndb_debug="no" + have_ndb_debug="no" ;; * ) - with_ndb_debug="default" + have_ndb_debug="default" ;; esac diff --git a/configure.in b/configure.in index 4e5f919af2a..28d9d7c0f9c 100644 --- a/configure.in +++ b/configure.in @@ -3039,16 +3039,16 @@ then MAKE_BINARY_DISTRIBUTION_OPTIONS="$MAKE_BINARY_DISTRIBUTION_OPTIONS --with-ndbcluster" CXXFLAGS="$CXXFLAGS \$(NDB_CXXFLAGS)" - if test "$with_ndb_debug" = "default" + if test "$have_ndb_debug" = "default" then - with_ndb_debug = $with_debug + have_ndb_debug=$with_debug fi - if test "$with_ndb_debug" = "yes" + if test "$have_ndb_debug" = "yes" then # Medium debug. NDB_DEFS="-DNDB_DEBUG -DVM_TRACE -DERROR_INSERT -DARRAY_GUARD" - elif test "$with_ndb_debug" = "full" + elif test "$have_ndb_debug" = "full" then NDB_DEFS="-DNDB_DEBUG_FULL -DVM_TRACE -DERROR_INSERT -DARRAY_GUARD" else From 21f2d3aa3fac1fa864b9a32d0848a22931b7ec61 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 6 Dec 2004 16:22:51 +0400 Subject: [PATCH 0426/1063] Fixed thar proper charset was not set in Field_set::val_str() --- mysql-test/r/ps_2myisam.result | 8 ++++---- mysql-test/r/ps_3innodb.result | 8 ++++---- mysql-test/r/ps_4heap.result | 8 ++++---- mysql-test/r/ps_5merge.result | 16 ++++++++-------- mysql-test/r/ps_6bdb.result | 8 ++++---- mysql-test/r/ps_7ndb.result | 8 ++++---- sql/field.cc | 1 + 7 files changed, 29 insertions(+), 28 deletions(-) diff --git a/mysql-test/r/ps_2myisam.result b/mysql-test/r/ps_2myisam.result index 42b4580643e..24c1102306f 100644 --- a/mysql-test/r/ps_2myisam.result +++ b/mysql-test/r/ps_2myisam.result @@ -1941,7 +1941,7 @@ def @arg28 254 8192 10 Y 0 31 8 def @arg29 254 8192 8 Y 128 31 63 def @arg30 254 8192 8 Y 0 31 8 def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 +def @arg32 254 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, @@ -2038,7 +2038,7 @@ def @arg28 254 8192 10 Y 0 31 8 def @arg29 254 8192 8 Y 128 31 63 def @arg30 254 8192 8 Y 0 31 8 def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 +def @arg32 254 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday set @my_key= 0 ; @@ -2126,7 +2126,7 @@ def @arg28 254 8192 10 Y 0 31 8 def @arg29 254 8192 8 Y 128 31 63 def @arg30 254 8192 8 Y 0 31 8 def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 +def @arg32 254 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, @@ -2216,7 +2216,7 @@ def @arg28 254 8192 10 Y 0 31 8 def @arg29 254 8192 8 Y 128 31 63 def @arg30 254 8192 8 Y 0 31 8 def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 +def @arg32 254 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday set @my_key= 0 ; diff --git a/mysql-test/r/ps_3innodb.result b/mysql-test/r/ps_3innodb.result index bb001fe9e02..ad2912529a5 100644 --- a/mysql-test/r/ps_3innodb.result +++ b/mysql-test/r/ps_3innodb.result @@ -1924,7 +1924,7 @@ def @arg28 254 8192 10 Y 0 31 8 def @arg29 254 8192 8 Y 128 31 63 def @arg30 254 8192 8 Y 0 31 8 def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 +def @arg32 254 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, @@ -2021,7 +2021,7 @@ def @arg28 254 8192 10 Y 0 31 8 def @arg29 254 8192 8 Y 128 31 63 def @arg30 254 8192 8 Y 0 31 8 def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 +def @arg32 254 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday set @my_key= 0 ; @@ -2109,7 +2109,7 @@ def @arg28 254 8192 10 Y 0 31 8 def @arg29 254 8192 8 Y 128 31 63 def @arg30 254 8192 8 Y 0 31 8 def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 +def @arg32 254 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, @@ -2199,7 +2199,7 @@ def @arg28 254 8192 10 Y 0 31 8 def @arg29 254 8192 8 Y 128 31 63 def @arg30 254 8192 8 Y 0 31 8 def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 +def @arg32 254 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday set @my_key= 0 ; diff --git a/mysql-test/r/ps_4heap.result b/mysql-test/r/ps_4heap.result index 263b389ffa4..123e3d58b38 100644 --- a/mysql-test/r/ps_4heap.result +++ b/mysql-test/r/ps_4heap.result @@ -1925,7 +1925,7 @@ def @arg28 254 8192 10 Y 0 31 8 def @arg29 254 8192 8 Y 0 31 8 def @arg30 254 8192 8 Y 0 31 8 def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 +def @arg32 254 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, @@ -2022,7 +2022,7 @@ def @arg28 254 8192 10 Y 0 31 8 def @arg29 254 8192 8 Y 0 31 8 def @arg30 254 8192 8 Y 0 31 8 def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 +def @arg32 254 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday set @my_key= 0 ; @@ -2110,7 +2110,7 @@ def @arg28 254 8192 10 Y 0 31 8 def @arg29 254 8192 8 Y 0 31 8 def @arg30 254 8192 8 Y 0 31 8 def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 +def @arg32 254 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, @@ -2200,7 +2200,7 @@ def @arg28 254 8192 10 Y 0 31 8 def @arg29 254 8192 8 Y 0 31 8 def @arg30 254 8192 8 Y 0 31 8 def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 +def @arg32 254 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday set @my_key= 0 ; diff --git a/mysql-test/r/ps_5merge.result b/mysql-test/r/ps_5merge.result index 0ec296717e0..e07cb7d7c49 100644 --- a/mysql-test/r/ps_5merge.result +++ b/mysql-test/r/ps_5merge.result @@ -1864,7 +1864,7 @@ def @arg28 254 8192 10 Y 0 31 8 def @arg29 254 8192 8 Y 128 31 63 def @arg30 254 8192 8 Y 0 31 8 def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 +def @arg32 254 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, @@ -1961,7 +1961,7 @@ def @arg28 254 8192 10 Y 0 31 8 def @arg29 254 8192 8 Y 128 31 63 def @arg30 254 8192 8 Y 0 31 8 def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 +def @arg32 254 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday set @my_key= 0 ; @@ -2049,7 +2049,7 @@ def @arg28 254 8192 10 Y 0 31 8 def @arg29 254 8192 8 Y 128 31 63 def @arg30 254 8192 8 Y 0 31 8 def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 +def @arg32 254 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, @@ -2139,7 +2139,7 @@ def @arg28 254 8192 10 Y 0 31 8 def @arg29 254 8192 8 Y 128 31 63 def @arg30 254 8192 8 Y 0 31 8 def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 +def @arg32 254 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday set @my_key= 0 ; @@ -4874,7 +4874,7 @@ def @arg28 254 8192 10 Y 0 31 8 def @arg29 254 8192 8 Y 128 31 63 def @arg30 254 8192 8 Y 0 31 8 def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 +def @arg32 254 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, @@ -4971,7 +4971,7 @@ def @arg28 254 8192 10 Y 0 31 8 def @arg29 254 8192 8 Y 128 31 63 def @arg30 254 8192 8 Y 0 31 8 def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 +def @arg32 254 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday set @my_key= 0 ; @@ -5059,7 +5059,7 @@ def @arg28 254 8192 10 Y 0 31 8 def @arg29 254 8192 8 Y 128 31 63 def @arg30 254 8192 8 Y 0 31 8 def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 +def @arg32 254 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, @@ -5149,7 +5149,7 @@ def @arg28 254 8192 10 Y 0 31 8 def @arg29 254 8192 8 Y 128 31 63 def @arg30 254 8192 8 Y 0 31 8 def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 +def @arg32 254 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday set @my_key= 0 ; diff --git a/mysql-test/r/ps_6bdb.result b/mysql-test/r/ps_6bdb.result index bb28abeda69..5f2419bdda5 100644 --- a/mysql-test/r/ps_6bdb.result +++ b/mysql-test/r/ps_6bdb.result @@ -1924,7 +1924,7 @@ def @arg28 254 8192 10 Y 0 31 8 def @arg29 254 8192 8 Y 128 31 63 def @arg30 254 8192 8 Y 0 31 8 def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 +def @arg32 254 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, @@ -2021,7 +2021,7 @@ def @arg28 254 8192 10 Y 0 31 8 def @arg29 254 8192 8 Y 128 31 63 def @arg30 254 8192 8 Y 0 31 8 def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 +def @arg32 254 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday set @my_key= 0 ; @@ -2109,7 +2109,7 @@ def @arg28 254 8192 10 Y 0 31 8 def @arg29 254 8192 8 Y 128 31 63 def @arg30 254 8192 8 Y 0 31 8 def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 +def @arg32 254 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, @@ -2199,7 +2199,7 @@ def @arg28 254 8192 10 Y 0 31 8 def @arg29 254 8192 8 Y 128 31 63 def @arg30 254 8192 8 Y 0 31 8 def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 +def @arg32 254 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday set @my_key= 0 ; diff --git a/mysql-test/r/ps_7ndb.result b/mysql-test/r/ps_7ndb.result index 4fe7f57973f..41c55cac0ca 100644 --- a/mysql-test/r/ps_7ndb.result +++ b/mysql-test/r/ps_7ndb.result @@ -1924,7 +1924,7 @@ def @arg28 254 8192 10 Y 0 31 8 def @arg29 254 8192 8 Y 128 31 63 def @arg30 254 8192 8 Y 0 31 8 def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 +def @arg32 254 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, @@ -2021,7 +2021,7 @@ def @arg28 254 8192 10 Y 0 31 8 def @arg29 254 8192 8 Y 128 31 63 def @arg30 254 8192 8 Y 0 31 8 def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 +def @arg32 254 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday set @my_key= 0 ; @@ -2109,7 +2109,7 @@ def @arg28 254 8192 10 Y 0 31 8 def @arg29 254 8192 8 Y 128 31 63 def @arg30 254 8192 8 Y 0 31 8 def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 +def @arg32 254 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, @@ -2199,7 +2199,7 @@ def @arg28 254 8192 10 Y 0 31 8 def @arg29 254 8192 8 Y 128 31 63 def @arg30 254 8192 8 Y 0 31 8 def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 +def @arg32 254 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday set @my_key= 0 ; diff --git a/sql/field.cc b/sql/field.cc index 90203d1935d..6dfddf6fd71 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -5754,6 +5754,7 @@ String *Field_set::val_str(String *val_buffer, uint bitnr=0; val_buffer->length(0); + val_buffer->set_charset(field_charset); while (tmp && bitnr < (uint) typelib->count) { if (tmp & 1) From 04866cf0f1c9341dff58e45c5063508f83e8aeb8 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 6 Dec 2004 14:34:02 +0100 Subject: [PATCH 0427/1063] New fix for bug#6796 Wrong outcome of update operation of ndb table --- sql/sql_update.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sql/sql_update.cc b/sql/sql_update.cc index 37c048356cd..a52da469d9d 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -110,8 +110,7 @@ int mysql_update(THD *thd, #ifndef NO_EMBEDDED_ACCESS_CHECKS table->grant.want_privilege=want_privilege; #endif - if (setup_fields(thd, 0, update_table_list, fields, 1, 0, 0) || - setup_fields(thd, 0, update_table_list, values, 1, 0, 0)) + if (setup_fields(thd, 0, update_table_list, fields, 1, 0, 0)) DBUG_RETURN(-1); /* purecov: inspected */ if (table->timestamp_field) { @@ -126,7 +125,7 @@ int mysql_update(THD *thd, /* Check values */ table->grant.want_privilege=(SELECT_ACL & ~table->grant.privilege); #endif - if (setup_fields(thd, 0, update_table_list, values, 0, 0, 0)) + if (setup_fields(thd, 0, update_table_list, values, 1, 0, 0)) { free_underlaid_joins(thd, &thd->lex->select_lex); DBUG_RETURN(-1); /* purecov: inspected */ From c6b3c442a5ba34c027a7fa405620e9a1684ed50d Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 6 Dec 2004 14:51:10 +0100 Subject: [PATCH 0428/1063] Fix for bug#6935 table rename does not work with ndb tables --- mysql-test/r/ndb_alter_table.result | 16 ++++++++++ mysql-test/t/ndb_alter_table.test | 17 +++++++++++ ndb/include/ndbapi/NdbDictionary.hpp | 7 +++++ ndb/src/ndbapi/NdbDictionary.cpp | 7 ++++- ndb/src/ndbapi/NdbDictionaryImpl.cpp | 44 ++++++++++++++-------------- sql/ha_ndbcluster.cc | 40 +++++++++++++++---------- sql/ha_ndbcluster.h | 2 +- 7 files changed, 93 insertions(+), 40 deletions(-) diff --git a/mysql-test/r/ndb_alter_table.result b/mysql-test/r/ndb_alter_table.result index ee7c3b28fe2..f899d254243 100644 --- a/mysql-test/r/ndb_alter_table.result +++ b/mysql-test/r/ndb_alter_table.result @@ -1,4 +1,5 @@ DROP TABLE IF EXISTS t1; +drop database if exists mysqltest; CREATE TABLE t1 ( a INT NOT NULL, b INT NOT NULL @@ -9,6 +10,21 @@ SELECT * FROM t1; a b c 9410 9412 0 DROP TABLE t1; +CREATE DATABASE mysqltest; +USE mysqltest; +CREATE TABLE t1 ( +a INT NOT NULL, +b INT NOT NULL +) ENGINE=ndbcluster; +RENAME TABLE t1 TO test.t1; +SHOW TABLES; +Tables_in_mysqltest +DROP DATABASE mysqltest; +USE test; +SHOW TABLES; +Tables_in_test +t1 +DROP TABLE t1; create table t1 ( col1 int not null auto_increment primary key, col2 varchar(30) not null, diff --git a/mysql-test/t/ndb_alter_table.test b/mysql-test/t/ndb_alter_table.test index 22b1a0e476d..892443a1407 100644 --- a/mysql-test/t/ndb_alter_table.test +++ b/mysql-test/t/ndb_alter_table.test @@ -2,6 +2,7 @@ --disable_warnings DROP TABLE IF EXISTS t1; +drop database if exists mysqltest; --enable_warnings # @@ -20,6 +21,22 @@ SELECT * FROM t1; DROP TABLE t1; +# +# Verfify changing table names between databases +# +CREATE DATABASE mysqltest; +USE mysqltest; +CREATE TABLE t1 ( + a INT NOT NULL, + b INT NOT NULL +) ENGINE=ndbcluster; +RENAME TABLE t1 TO test.t1; +SHOW TABLES; +DROP DATABASE mysqltest; +USE test; +SHOW TABLES; +DROP TABLE t1; + # # More advanced test # diff --git a/ndb/include/ndbapi/NdbDictionary.hpp b/ndb/include/ndbapi/NdbDictionary.hpp index a3115076624..e07fc64f064 100644 --- a/ndb/include/ndbapi/NdbDictionary.hpp +++ b/ndb/include/ndbapi/NdbDictionary.hpp @@ -989,6 +989,13 @@ public: */ Table getTableForAlteration(const char * name); + /** + * Get copy a copy of a table for alteration. + * @param table Table object to alter + * @return table if successful. NULL if undefined + */ + Table getTableForAlteration(const Table &); + #ifndef DOXYGEN_SHOULD_SKIP_INTERNAL /** * Invalidate cached table object diff --git a/ndb/src/ndbapi/NdbDictionary.cpp b/ndb/src/ndbapi/NdbDictionary.cpp index 09d15c7f962..d1827c6895f 100644 --- a/ndb/src/ndbapi/NdbDictionary.cpp +++ b/ndb/src/ndbapi/NdbDictionary.cpp @@ -775,12 +775,17 @@ NdbDictionary::Dictionary::removeCachedTable(const char * name){ NdbDictionary::Table NdbDictionary::Dictionary::getTableForAlteration(const char * name){ - const NdbDictionary::Table * oldTable = getTable(name); + const Table * oldTable = getTable(name); return (oldTable) ? NdbDictionary::Table(*oldTable) : NdbDictionary::Table(); } +NdbDictionary::Table +NdbDictionary::Dictionary::getTableForAlteration(const Table & tab){ + return NdbDictionary::Table(tab); +} + int NdbDictionary::Dictionary::createIndex(const Index & ind) { diff --git a/ndb/src/ndbapi/NdbDictionaryImpl.cpp b/ndb/src/ndbapi/NdbDictionaryImpl.cpp index 345f2caac89..393a436ff85 100644 --- a/ndb/src/ndbapi/NdbDictionaryImpl.cpp +++ b/ndb/src/ndbapi/NdbDictionaryImpl.cpp @@ -1411,15 +1411,14 @@ int NdbDictionaryImpl::alterTable(NdbTableImpl &impl) const char * originalInternalName = internalName.c_str(); BaseString externalName = impl.m_externalName; const char * originalExternalName = externalName.c_str(); - NdbTableImpl * oldTab = getTable(originalExternalName); - - if(!oldTab){ + + DBUG_ENTER("NdbDictionaryImpl::alterTable"); + if(!get_local_table_info(originalInternalName, false)){ m_error.code = 709; - return -1; + DBUG_RETURN(-1); } // Alter the table int ret = m_receiver.alterTable(m_ndb, impl); - if(ret == 0){ // Remove cached information and let it be refreshed at next access if (m_localHash.get(originalInternalName) != NULL) { @@ -1433,7 +1432,7 @@ int NdbDictionaryImpl::alterTable(NdbTableImpl &impl) m_globalHash->unlock(); } } - return ret; + DBUG_RETURN(ret) } int @@ -1448,15 +1447,16 @@ NdbDictInterface::createOrAlterTable(Ndb & ndb, NdbTableImpl & impl, bool alter) { + DBUG_ENTER("NdbDictInterface::createOrAlterTable"); unsigned i; if((unsigned)impl.getNoOfPrimaryKeys() > NDB_MAX_NO_OF_ATTRIBUTES_IN_KEY){ m_error.code = 4317; - return -1; + DBUG_RETURN(-1); } unsigned sz = impl.m_columns.size(); if (sz > NDB_MAX_ATTRIBUTES_IN_TABLE){ m_error.code = 4318; - return -1; + DBUG_RETURN(-1); } impl.copyNewProperties(); @@ -1491,7 +1491,7 @@ NdbDictInterface::createOrAlterTable(Ndb & ndb, // Check max length of frm data if (impl.m_frm.length() > MAX_FRM_DATA_SIZE){ m_error.code = 1229; - return -1; + DBUG_RETURN(-1); } tmpTab.FrmLen = impl.m_frm.length(); memcpy(tmpTab.FrmData, impl.m_frm.get_data(), impl.m_frm.length()); @@ -1543,12 +1543,12 @@ NdbDictInterface::createOrAlterTable(Ndb & ndb, // charset is defined exactly for char types if (col->getCharType() != (col->m_cs != NULL)) { m_error.code = 703; - return -1; + DBUG_RETURN(-1); } // primary key type check if (col->m_pk && ! NdbSqlUtil::usable_in_pk(col->m_type, col->m_cs)) { m_error.code = 743; - return -1; + DBUG_RETURN(-1); } // charset in upper half of precision if (col->getCharType()) { @@ -1616,7 +1616,7 @@ NdbDictInterface::createOrAlterTable(Ndb & ndb, } } } - return ret; + DBUG_RETURN(ret); } int @@ -1675,17 +1675,17 @@ NdbDictInterface::alterTable(NdbApiSignal* signal, LinearSectionPtr ptr[3]) int errCodes[noErrCodes] = {AlterTableRef::NotMaster, AlterTableRef::Busy}; - int r = dictSignal(signal,ptr,1, - 1/*use masternode id*/, - 100,WAIT_ALTER_TAB_REQ, - WAITFOR_RESPONSE_TIMEOUT, - errCodes, noErrCodes); - if(m_error.code == AlterTableRef::InvalidTableVersion) { - // Clear caches and try again - return INCOMPATIBLE_VERSION; - } + int r = dictSignal(signal,ptr,1, + 1/*use masternode id*/, + 100,WAIT_ALTER_TAB_REQ, + WAITFOR_RESPONSE_TIMEOUT, + errCodes, noErrCodes); + if(m_error.code == AlterTableRef::InvalidTableVersion) { + // Clear caches and try again + return INCOMPATIBLE_VERSION; + } - return r; + return r; } void diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 6c609cd54ac..7054619fdab 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -3627,9 +3627,13 @@ int ha_ndbcluster::create_index(const char *name, int ha_ndbcluster::rename_table(const char *from, const char *to) { + NDBDICT *dict; char new_tabname[FN_HEADLEN]; + const NDBTAB *orig_tab; + int result; DBUG_ENTER("ha_ndbcluster::rename_table"); + DBUG_PRINT("info", ("Renaming %s to %s", from, to)); set_dbname(from); set_tabname(from); set_tabname(to, new_tabname); @@ -3637,14 +3641,20 @@ int ha_ndbcluster::rename_table(const char *from, const char *to) if (check_ndb_connection()) DBUG_RETURN(my_errno= HA_ERR_NO_CONNECTION); + dict= m_ndb->getDictionary(); + if (!(orig_tab= dict->getTable(m_tabname))) + ERR_RETURN(dict->getNdbError()); - int result= alter_table_name(m_tabname, new_tabname); - if (result == 0) + m_table= (void *)orig_tab; + // Change current database to that of target table + set_dbname(to); + m_ndb->setDatabaseName(m_dbname); + if (!(result= alter_table_name(new_tabname))) { - set_tabname(to); - handler::rename_table(from, to); + // Rename .ndb file + result= handler::rename_table(from, to); } - + DBUG_RETURN(result); } @@ -3653,19 +3663,16 @@ int ha_ndbcluster::rename_table(const char *from, const char *to) Rename a table in NDB Cluster using alter table */ -int ha_ndbcluster::alter_table_name(const char *from, const char *to) +int ha_ndbcluster::alter_table_name(const char *to) { - NDBDICT *dict= m_ndb->getDictionary(); - const NDBTAB *orig_tab; + NDBDICT * dict= m_ndb->getDictionary(); + const NDBTAB *orig_tab= (const NDBTAB *) m_table; + int ret; DBUG_ENTER("alter_table_name_table"); - DBUG_PRINT("enter", ("Renaming %s to %s", from, to)); - if (!(orig_tab= dict->getTable(from))) - ERR_RETURN(dict->getNdbError()); - - NdbDictionary::Table copy_tab= dict->getTableForAlteration(from); - copy_tab.setName(to); - if (dict->alterTable(copy_tab) != 0) + NdbDictionary::Table new_tab= dict->getTableForAlteration(*orig_tab); + new_tab.setName(to); + if (dict->alterTable(new_tab) != 0) ERR_RETURN(dict->getNdbError()); m_table= NULL; @@ -3688,7 +3695,7 @@ int ha_ndbcluster::delete_table(const char *name) if (check_ndb_connection()) DBUG_RETURN(HA_ERR_NO_CONNECTION); - + // Remove .ndb file handler::delete_table(name); DBUG_RETURN(drop_table()); } @@ -3944,6 +3951,7 @@ Ndb* check_ndb_in_thd(THD* thd) } + int ha_ndbcluster::check_ndb_connection() { THD* thd= current_thd; diff --git a/sql/ha_ndbcluster.h b/sql/ha_ndbcluster.h index f6c712620c1..2d7b14b2311 100644 --- a/sql/ha_ndbcluster.h +++ b/sql/ha_ndbcluster.h @@ -148,7 +148,7 @@ class ha_ndbcluster: public handler uint8 table_cache_type(); private: - int alter_table_name(const char *from, const char *to); + int alter_table_name(const char *to); int drop_table(); int create_index(const char *name, KEY *key_info, bool unique); int create_ordered_index(const char *name, KEY *key_info); From 1f1257bd52b7b040df3d8d3842401a885ab8b965 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 6 Dec 2004 18:45:41 +0400 Subject: [PATCH 0429/1063] A fix (bug #5823: mysql_install_db fails due to incorrect max_allowed_packet). scripts/fill_help_tables.sh: percent_xxx variables added to avoid /0 error. scripts/mysql_install_db.sh: A fix (bug #5823: mysql_install_db fails due to incorrect max_allowed_packet). --net_buffer_length=16K added. sql/net_serv.cc: Typo fixed. sql/sql_parse.cc: A fix (bug #5823: mysql_install_db fails due to incorrect max_allowed_packet). Auto extend net buffer in bootstrap mode. --- scripts/fill_help_tables.sh | 12 ++++++++---- scripts/mysql_install_db.sh | 2 +- sql/net_serv.cc | 4 ++-- sql/sql_parse.cc | 22 +++++++++++++++++----- 4 files changed, 28 insertions(+), 12 deletions(-) diff --git a/scripts/fill_help_tables.sh b/scripts/fill_help_tables.sh index 78dfe7b6088..51edfc8af78 100644 --- a/scripts/fill_help_tables.sh +++ b/scripts/fill_help_tables.sh @@ -454,10 +454,12 @@ sub print_verbose_errors print STDERR "number of help keywords - ",$count_keywords,"\n"; my $count_without_help= scalar(@without_help); + my $percent_without_help= $count_lex ? + int (($count_without_help/$count_lex)*100) : + "100"; print_bad_names(\@without_help,"lexems without help (". $count_without_help." ~ ". - (int (($count_without_help/$count_lex)*100)). - "%)"); + $percent_without_help."%)"); print_bad_names(\@description_with_at, " topics below have symbol \'@\' in their descriptions.\n". "it's probably the litter from 'texi' tags (script needs fixing)"); @@ -467,10 +469,12 @@ sub print_verbose_errors print_bad_names(\@without_description,"topics without description"); my $count_without_example= scalar(@without_example); + my $percent_without_example= $count_topics ? + int (($count_without_example/$count_topics)*100) : + "100"; print_bad_names(\@without_example,"topics without example (". $count_without_example." ~ ". - (int (($count_without_example/$count_topics)*100)). - "%)"); + $percent_without_example."%)"); } print_verbose_errors if ($verbose_option ne 0); diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index b4f59790e73..8b2e42bd8cd 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -213,7 +213,7 @@ then fi mysqld_install_cmd_line="$mysqld $defaults $mysqld_opt --bootstrap \ --skip-grant-tables --basedir=$basedir --datadir=$ldata --skip-innodb \ ---skip-bdb --skip-ndbcluster $args --max_allowed_packet=8M" +--skip-bdb --skip-ndbcluster $args --max_allowed_packet=8M --net_buffer_length=16K" if $scriptdir/mysql_create_system_tables $create_option $mdata $hostname $windows \ | eval "$mysqld_install_cmd_line" then diff --git a/sql/net_serv.cc b/sql/net_serv.cc index 5985cf63ed6..1e34ed90fee 100644 --- a/sql/net_serv.cc +++ b/sql/net_serv.cc @@ -165,8 +165,8 @@ my_bool net_realloc(NET *net, ulong length) if (length >= net->max_packet_size) { - DBUG_PRINT("error",("Packet too large. Max sixe: %lu", - net->max_packet_size)); + DBUG_PRINT("error", ("Packet too large. Max size: %lu", + net->max_packet_size)); net->error= 1; net->report_error= 1; net->last_errno= ER_NET_PACKET_TOO_LARGE; diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 3d1df80c37b..71870e2d990 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -1102,13 +1102,25 @@ extern "C" pthread_handler_decl(handle_bootstrap,arg) thd->init_for_queries(); while (fgets(buff, thd->net.max_packet, file)) { - uint length=(uint) strlen(buff); - if (buff[length-1]!='\n' && !feof(file)) + ulong length= (ulong) strlen(buff); + while (buff[length-1] != '\n' && !feof(file)) { - send_error(thd,ER_NET_PACKET_TOO_LARGE, NullS); - thd->fatal_error(); - break; + /* + We got only a part of the current string. Will try to increase + net buffer then read the rest of the current string. + */ + if (net_realloc(&(thd->net), 2 * thd->net.max_packet)) + { + send_error(thd, thd->net.last_errno, NullS); + thd->is_fatal_error= 1; + break; + } + buff= (char*) thd->net.buff; + fgets(buff + length, thd->net.max_packet - length, file); + length+= (ulong) strlen(buff + length); } + if (thd->is_fatal_error) + break; while (length && (my_isspace(thd->charset(), buff[length-1]) || buff[length-1] == ';')) length--; From e94fc374c52478268e7de22a316e52edd66ce192 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 6 Dec 2004 19:01:51 +0300 Subject: [PATCH 0430/1063] Syntax extention: 'ALTER DATABASE' without db name (after review) --- mysql-test/r/ctype_create.result | 9 +++++++++ mysql-test/t/ctype_create.test | 12 ++++++++++++ sql/sql_parse.cc | 18 ++++++++++++------ sql/sql_yacc.yy | 11 ++++++++--- 4 files changed, 41 insertions(+), 9 deletions(-) diff --git a/mysql-test/r/ctype_create.result b/mysql-test/r/ctype_create.result index b35131f62a4..63bae33c6e1 100644 --- a/mysql-test/r/ctype_create.result +++ b/mysql-test/r/ctype_create.result @@ -63,3 +63,12 @@ ERROR HY000: Conflicting declarations: 'CHARACTER SET latin1' and 'CHARACTER SET create database d1 default character set latin1 collate latin2_bin; ERROR 42000: COLLATION 'latin2_bin' is not valid for CHARACTER SET 'latin1' DROP DATABASE mysqltest1; +CREATE DATABASE mysqltest2 DEFAULT CHARACTER SET latin7; +use mysqltest2; +ALTER DATABASE DEFAULT CHARACTER SET latin2; +show create database mysqltest2; +Database Create Database +mysqltest2 CREATE DATABASE `mysqltest2` /*!40100 DEFAULT CHARACTER SET latin2 */ +drop database mysqltest2; +ALTER DATABASE DEFAULT CHARACTER SET latin2; +ERROR 3D000: No database selected diff --git a/mysql-test/t/ctype_create.test b/mysql-test/t/ctype_create.test index 9a5cb025474..e97017ab416 100644 --- a/mysql-test/t/ctype_create.test +++ b/mysql-test/t/ctype_create.test @@ -86,3 +86,15 @@ create database d1 default character set latin1 collate latin2_bin; # # DROP DATABASE mysqltest1; + + +# +# Synatx: 'ALTER DATABASE' without db_name +# +CREATE DATABASE mysqltest2 DEFAULT CHARACTER SET latin7; +use mysqltest2; +ALTER DATABASE DEFAULT CHARACTER SET latin2; +show create database mysqltest2; +drop database mysqltest2; +--error 1046 +ALTER DATABASE DEFAULT CHARACTER SET latin2; diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 3d1df80c37b..1e18771ad15 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -3184,9 +3184,15 @@ purposes internal to the MySQL server", MYF(0)); } case SQLCOM_ALTER_DB: { - if (!strip_sp(lex->name) || check_db_name(lex->name)) + char *db= lex->name ? lex->name : thd->db; + if (!db) { - net_printf(thd, ER_WRONG_DB_NAME, lex->name); + send_error(thd, ER_NO_DB_ERROR); + goto error; + } + if (!strip_sp(db) || check_db_name(db)) + { + net_printf(thd, ER_WRONG_DB_NAME, db); break; } /* @@ -3198,21 +3204,21 @@ purposes internal to the MySQL server", MYF(0)); */ #ifdef HAVE_REPLICATION if (thd->slave_thread && - (!db_ok(lex->name, replicate_do_db, replicate_ignore_db) || - !db_ok_with_wild_table(lex->name))) + (!db_ok(db, replicate_do_db, replicate_ignore_db) || + !db_ok_with_wild_table(db))) { my_error(ER_SLAVE_IGNORED_TABLE, MYF(0)); break; } #endif - if (check_access(thd,ALTER_ACL,lex->name,0,1,0)) + if (check_access(thd, ALTER_ACL, db, 0, 1, 0)) break; if (thd->locked_tables || thd->active_transaction()) { send_error(thd,ER_LOCK_OR_ACTIVE_TRANSACTION); goto error; } - res=mysql_alter_db(thd,lex->name,&lex->create_info); + res= mysql_alter_db(thd, db, &lex->create_info); break; } case SQLCOM_SHOW_CREATE_DB: diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 49e567ab54b..e525fb2478a 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -609,7 +609,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize); %type remember_name remember_end opt_ident opt_db text_or_password - opt_constraint constraint + opt_constraint constraint ident_or_empty %type text_string opt_gconcat_separator @@ -1870,7 +1870,7 @@ alter: } alter_list {} - | ALTER DATABASE ident + | ALTER DATABASE ident_or_empty { Lex->create_info.default_table_charset= NULL; Lex->create_info.used_fields= 0; @@ -1879,10 +1879,15 @@ alter: { LEX *lex=Lex; lex->sql_command=SQLCOM_ALTER_DB; - lex->name=$3.str; + lex->name= $3; }; +ident_or_empty: + /* empty */ { $$= 0; } + | ident { $$= $1.str; }; + + alter_list: | DISCARD TABLESPACE { Lex->alter_info.tablespace_op= DISCARD_TABLESPACE; } | IMPORT TABLESPACE { Lex->alter_info.tablespace_op= IMPORT_TABLESPACE; } From 8ec6cf2cd5ed54f1336784ffe548a813cbbde172 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 6 Dec 2004 20:45:32 +0400 Subject: [PATCH 0431/1063] UCS2 support in ENUM and SET, which also fixes: Bug #5174 SHOW CREATE TABLE hangs up if the table contains half-with katakana enum values UCS2 values are stored in HEX encoding in FRM file --- mysql-test/r/ctype_ucs.result | 56 +++++++++++++++++++++++++++++++++++ mysql-test/t/ctype_ucs.test | 31 +++++++++++++++++++ sql/field.cc | 19 ++++++------ sql/item_strfunc.cc | 11 ------- sql/mysql_priv.h | 17 +++++++++++ sql/strfunc.cc | 20 +++++++++++-- sql/table.cc | 17 +++++++++++ sql/unireg.cc | 22 ++++++++++++++ 8 files changed, 170 insertions(+), 23 deletions(-) diff --git a/mysql-test/r/ctype_ucs.result b/mysql-test/r/ctype_ucs.result index 70a66ddd924..ef3682c1cfc 100644 --- a/mysql-test/r/ctype_ucs.result +++ b/mysql-test/r/ctype_ucs.result @@ -525,3 +525,59 @@ use test; SET TIMESTAMP=10000; insert into t2 values (@v); drop table t2; +set names latin1; +create table t1 (a enum('x','y','z') character set ucs2); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` enum('x','y','z') character set ucs2 default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('x'); +insert into t1 values ('y'); +insert into t1 values ('z'); +select a, hex(a) from t1 order by a; +a hex(a) +x 0078 +y 0079 +z 007A +alter table t1 change a a enum('x','y','z','d','e','ä','ö','ü') character set ucs2; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` enum('x','y','z','d','e','ä','ö','ü') character set ucs2 default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('D'); +insert into t1 values ('E '); +insert into t1 values ('Ä'); +insert into t1 values ('Ö'); +insert into t1 values ('Ü'); +select a, hex(a) from t1 order by a; +a hex(a) +x 0078 +y 0079 +z 007A +d 0064 +e 0065 +ä 00E4 +ö 00F6 +ü 00FC +drop table t1; +create table t1 (a set ('x','y','z','ä','ö','ü') character set ucs2); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` set('x','y','z','ä','ö','ü') character set ucs2 default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +insert into t1 values ('x'); +insert into t1 values ('y'); +insert into t1 values ('z'); +insert into t1 values ('x,y'); +insert into t1 values ('x,y,z,Ä,Ö,Ü'); +select a, hex(a) from t1 order by a; +a hex(a) +x 0078 +y 0079 +x,y 0078002C0079 +z 007A +x,y,z,ä,ö,ü 0078002C0079002C007A002C00E4002C00F6002C00FC +drop table t1; diff --git a/mysql-test/t/ctype_ucs.test b/mysql-test/t/ctype_ucs.test index b1d872c58a5..b8f58ab028b 100644 --- a/mysql-test/t/ctype_ucs.test +++ b/mysql-test/t/ctype_ucs.test @@ -343,3 +343,34 @@ show binlog events from 79; --replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR --exec $MYSQL_BINLOG --short-form $MYSQL_TEST_DIR/var/log/master-bin.000001 drop table t2; + + +# +# Check that ucs2 works with ENUM and SET type +# +set names latin1; +create table t1 (a enum('x','y','z') character set ucs2); +show create table t1; +insert into t1 values ('x'); +insert into t1 values ('y'); +insert into t1 values ('z'); +select a, hex(a) from t1 order by a; +alter table t1 change a a enum('x','y','z','d','e','ä','ö','ü') character set ucs2; +show create table t1; +insert into t1 values ('D'); +insert into t1 values ('E '); +insert into t1 values ('Ä'); +insert into t1 values ('Ö'); +insert into t1 values ('Ü'); +select a, hex(a) from t1 order by a; +drop table t1; + +create table t1 (a set ('x','y','z','ä','ö','ü') character set ucs2); +show create table t1; +insert into t1 values ('x'); +insert into t1 values ('y'); +insert into t1 values ('z'); +insert into t1 values ('x,y'); +insert into t1 values ('x,y,z,Ä,Ö,Ü'); +select a, hex(a) from t1 order by a; +drop table t1; diff --git a/sql/field.cc b/sql/field.cc index 6dfddf6fd71..74252a46842 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -5529,8 +5529,7 @@ int Field_enum::store(const char *from,uint length,CHARSET_INFO *cs) } /* Remove end space */ - while (length > 0 && my_isspace(system_charset_info,from[length-1])) - length--; + length= field_charset->cset->lengthsp(field_charset, from, length); uint tmp=find_type2(typelib, from, length, field_charset); if (!tmp) { @@ -5632,7 +5631,7 @@ String *Field_enum::val_str(String *val_buffer __attribute__((unused)), val_ptr->set("", 0, field_charset); else val_ptr->set((const char*) typelib->type_names[tmp-1], - (uint) strlen(typelib->type_names[tmp-1]), + typelib->type_lengths[tmp-1], field_charset); return val_ptr; } @@ -5669,13 +5668,14 @@ void Field_enum::sql_type(String &res) const res.append("enum("); bool flag=0; - for (const char **pos= typelib->type_names; *pos; pos++) + uint *len= typelib->type_lengths; + for (const char **pos= typelib->type_names; *pos; pos++, len++) { uint dummy_errors; if (flag) res.append(','); /* convert to res.charset() == utf8, then quote */ - enum_item.copy(*pos, strlen(*pos), charset(), res.charset(), &dummy_errors); + enum_item.copy(*pos, *len, charset(), res.charset(), &dummy_errors); append_unescaped(&res, enum_item.ptr(), enum_item.length()); flag= 1; } @@ -5760,9 +5760,9 @@ String *Field_set::val_str(String *val_buffer, if (tmp & 1) { if (val_buffer->length()) - val_buffer->append(field_separator); + val_buffer->append(&field_separator, 1, &my_charset_latin1); String str(typelib->type_names[bitnr], - (uint) strlen(typelib->type_names[bitnr]), + typelib->type_lengths[bitnr], field_charset); val_buffer->append(str); } @@ -5782,13 +5782,14 @@ void Field_set::sql_type(String &res) const res.append("set("); bool flag=0; - for (const char **pos= typelib->type_names; *pos; pos++) + uint *len= typelib->type_lengths; + for (const char **pos= typelib->type_names; *pos; pos++, len++) { uint dummy_errors; if (flag) res.append(','); /* convert to res.charset() == utf8, then quote */ - set_item.copy(*pos, strlen(*pos), charset(), res.charset(), &dummy_errors); + set_item.copy(*pos, *len, charset(), res.charset(), &dummy_errors); append_unescaped(&res, set_item.ptr(), set_item.length()); flag= 1; } diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 5a23eec5a1b..893126b7fe6 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -2320,17 +2320,6 @@ String *Item_func_hex::val_str(String *str) return &tmp_value; } -inline int hexchar_to_int(char c) -{ - if (c <= '9' && c >= '0') - return c-'0'; - c|=32; - if (c <= 'f' && c >= 'a') - return c-'a'+10; - return -1; -} - - /* Convert given hex string to a binary string */ String *Item_func_unhex::val_str(String *str) diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 3a19a903e00..cefc77cb5d4 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -1200,6 +1200,23 @@ inline void setup_table_map(TABLE *table, TABLE_LIST *table_list, uint tablenr) } +/* + SYNOPSYS + hexchar_to_int() + convert a hex digit into number +*/ + +inline int hexchar_to_int(char c) +{ + if (c <= '9' && c >= '0') + return c-'0'; + c|=32; + if (c <= 'f' && c >= 'a') + return c-'a'+10; + return -1; +} + + /* Some functions that are different in the embedded library and the normal server diff --git a/sql/strfunc.cc b/sql/strfunc.cc index b5255e9be06..8ab6992a63a 100644 --- a/sql/strfunc.cc +++ b/sql/strfunc.cc @@ -53,8 +53,22 @@ ulonglong find_set(TYPELIB *lib, const char *str, uint length, CHARSET_INFO *cs, { const char *pos= start; uint var_len; + int mblen= 1; - for (; pos != end && *pos != field_separator; pos++) ; + if (cs && cs->mbminlen > 1) + { + for ( ; pos < end; pos+= mblen) + { + my_wc_t wc; + if ((mblen= cs->cset->mb_wc(cs, &wc, (const uchar *) pos, + (const uchar *) end)) < 1) + mblen= 1; // Not to hang on a wrong multibyte sequence + if (wc == (my_wc_t) field_separator) + break; + } + } + else + for (; pos != end && *pos != field_separator; pos++) ; var_len= (uint) (pos - start); uint find= cs ? find_type2(lib, start, var_len, cs) : find_type(lib, start, var_len, (bool) 0); @@ -66,9 +80,9 @@ ulonglong find_set(TYPELIB *lib, const char *str, uint length, CHARSET_INFO *cs, } else found|= ((longlong) 1 << (find - 1)); - if (pos == end) + if (pos >= end) break; - start= pos + 1; + start= pos + mblen; } } return found; diff --git a/sql/table.cc b/sql/table.cc index cb565097c0b..370ad5eff1d 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -485,6 +485,23 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag, charset= outparam->table_charset; bzero((char*) &comment, sizeof(comment)); } + + if (interval_nr && charset->mbminlen > 1) + { + /* Unescape UCS2 intervals from HEX notation */ + TYPELIB *interval= outparam->intervals + interval_nr - 1; + for (uint pos= 0; pos < interval->count; pos++) + { + char *from, *to; + for (from= to= (char*) interval->type_names[pos]; *from; ) + { + *to++= (char) (hexchar_to_int(*from++) << 4) + + hexchar_to_int(*from++); + } + interval->type_lengths[pos] /= 2; + } + } + *field_ptr=reg_field= make_field(record+recpos, (uint32) field_length, diff --git a/sql/unireg.cc b/sql/unireg.cc index c82fcc4abef..6d72c6af135 100644 --- a/sql/unireg.cc +++ b/sql/unireg.cc @@ -423,6 +423,28 @@ static bool pack_header(uchar *forminfo, enum db_type table_type, if (field->interval) { uint old_int_count=int_count; + + if (field->charset->mbminlen > 1) + { + /* Escape UCS2 intervals using HEX notation */ + for (uint pos= 0; pos < field->interval->count; pos++) + { + char *dst; + uint length= field->interval->type_lengths[pos], hex_length; + const char *src= field->interval->type_names[pos]; + const char *srcend= src + length; + hex_length= length * 2; + field->interval->type_lengths[pos]= hex_length; + field->interval->type_names[pos]= dst= sql_alloc(hex_length + 1); + for ( ; src < srcend; src++) + { + *dst++= _dig_vec_upper[((uchar) *src) >> 4]; + *dst++= _dig_vec_upper[((uchar) *src) & 15]; + } + *dst= '\0'; + } + } + field->interval_id=get_interval_id(&int_count,create_fields,field); if (old_int_count != int_count) { From e1248f4fc392d20ff34084ee913df90815d15008 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 6 Dec 2004 16:26:05 -0800 Subject: [PATCH 0432/1063] Fix for crummy compiler that didn't udnerstand for declaration. Another fix for example storage engine to pass, not skip, test. mysql-test/r/have_exampledb.require: Fix for test for examples. sql/examples/ha_archive.cc: Fix for compiler that had problem with ANSI C. --- mysql-test/r/have_exampledb.require | 2 +- sql/examples/ha_archive.cc | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/have_exampledb.require b/mysql-test/r/have_exampledb.require index 4b0938660fe..29d0cf8b1a6 100644 --- a/mysql-test/r/have_exampledb.require +++ b/mysql-test/r/have_exampledb.require @@ -1,2 +1,2 @@ Variable_name Value -have_exampledb YES +have_example_engine YES diff --git a/sql/examples/ha_archive.cc b/sql/examples/ha_archive.cc index 6fbfb3f9f9d..771bf91d118 100644 --- a/sql/examples/ha_archive.cc +++ b/sql/examples/ha_archive.cc @@ -528,6 +528,7 @@ error: int ha_archive::write_row(byte * buf) { z_off_t written; + Field_blob **field; DBUG_ENTER("ha_archive::write_row"); statistic_increment(ha_write_count,&LOCK_status); @@ -543,7 +544,7 @@ int ha_archive::write_row(byte * buf) We should probably mark the table as damagaged if the record is written but the blob fails. */ - for (Field_blob **field=table->blob_field ; *field ; field++) + for (field= table->blob_field ; *field ; field++) { char *ptr; uint32 size= (*field)->get_length(); From d5c7d8500107271571f13baa54b246827e134143 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 7 Dec 2004 15:49:54 +1100 Subject: [PATCH 0433/1063] Fix segmentation fault on incorrect configuration. Starting ndb_mgmd on a host which isn't in the configuration file as the ndb_mgmd (e.g. the ip address is different) would have ndb_mgmd segfault. There was a check in the code, but it was (potentially) trying to dereference null ndb/src/mgmsrv/MgmtSrvr.cpp: Don't try and print client_addr->sin_addr if client_addr is null --- ndb/src/mgmsrv/MgmtSrvr.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ndb/src/mgmsrv/MgmtSrvr.cpp b/ndb/src/mgmsrv/MgmtSrvr.cpp index 061aa2e0cb8..4dd1f7cf084 100644 --- a/ndb/src/mgmsrv/MgmtSrvr.cpp +++ b/ndb/src/mgmsrv/MgmtSrvr.cpp @@ -2292,8 +2292,9 @@ MgmtSrvr::alloc_node_id(NodeId * nodeId, if (found_matching_type) if (found_free_node) error_string.appfmt("Connection done from wrong host ip %s.", - inet_ntoa(((struct sockaddr_in *) - (client_addr))->sin_addr)); + (client_addr)? + inet_ntoa(((struct sockaddr_in *) + (client_addr))->sin_addr):""); else error_string.appfmt("No free node id found for %s.", type_string.c_str()); From 065a07289cc0b93bef16506b267918555bb43d05 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 7 Dec 2004 09:11:50 +0000 Subject: [PATCH 0434/1063] fixed clusterlog "filter" command ndb/src/mgmsrv/CommandInterpreter.cpp: removed clusterlog command ndb/src/mgmsrv/CommandInterpreter.hpp: removed clusterlog command --- ndb/include/logger/Logger.hpp | 2 +- ndb/include/mgmapi/mgmapi.h | 14 +- ndb/src/common/logger/Logger.cpp | 17 +- ndb/src/mgmapi/mgmapi.cpp | 79 ++++-- ndb/src/mgmclient/CommandInterpreter.cpp | 314 +++++++++++------------ ndb/src/mgmsrv/CommandInterpreter.cpp | 128 --------- ndb/src/mgmsrv/CommandInterpreter.hpp | 1 - ndb/src/mgmsrv/MgmtSrvr.cpp | 16 +- ndb/src/mgmsrv/MgmtSrvr.hpp | 2 +- ndb/src/mgmsrv/Services.cpp | 5 +- 10 files changed, 254 insertions(+), 324 deletions(-) diff --git a/ndb/include/logger/Logger.hpp b/ndb/include/logger/Logger.hpp index c6145f2091a..f12297023b7 100644 --- a/ndb/include/logger/Logger.hpp +++ b/ndb/include/logger/Logger.hpp @@ -101,7 +101,7 @@ public: /** The log levels. NOTE: Could not use the name LogLevel since * it caused conflicts with another class. */ - enum LoggerLevel {LL_OFF, LL_DEBUG, LL_INFO, LL_WARNING, LL_ERROR, + enum LoggerLevel {LL_ON, LL_DEBUG, LL_INFO, LL_WARNING, LL_ERROR, LL_CRITICAL, LL_ALERT, LL_ALL}; /** diff --git a/ndb/include/mgmapi/mgmapi.h b/ndb/include/mgmapi/mgmapi.h index dc4f745adb2..5329ded4f19 100644 --- a/ndb/include/mgmapi/mgmapi.h +++ b/ndb/include/mgmapi/mgmapi.h @@ -244,7 +244,9 @@ extern "C" { * Log severities (used to filter the cluster log) */ enum ndb_mgm_clusterlog_level { - NDB_MGM_CLUSTERLOG_OFF = 0, /*< Cluster log off*/ + NDB_MGM_ILLEGAL_CLUSTERLOG_LEVEL = -1, + /* must range from 0 and up, indexes into an array */ + NDB_MGM_CLUSTERLOG_ON = 0, /*< Cluster log on*/ NDB_MGM_CLUSTERLOG_DEBUG = 1, /*< Used in NDB Cluster *< developement */ @@ -264,7 +266,8 @@ extern "C" { *< corrected immediately, *< such as a corrupted system */ - NDB_MGM_CLUSTERLOG_ALL = 7 /*< All severities on*/ + /* must be next number, works as bound in loop */ + NDB_MGM_CLUSTERLOG_ALL = 7 /*< All severities */ }; /** @@ -580,11 +583,13 @@ extern "C" { * * @param handle NDB management handle. * @param level A cluster log level to filter. + * @param enable set 1=enable 0=disable * @param reply Reply message. * @return -1 on error. */ int ndb_mgm_filter_clusterlog(NdbMgmHandle handle, enum ndb_mgm_clusterlog_level level, + int enable, struct ndb_mgm_reply* reply); /** @@ -620,6 +625,11 @@ extern "C" { int level, struct ndb_mgm_reply* reply); + ndb_mgm_clusterlog_level + ndb_mgm_match_clusterlog_level(const char * name); + const char * + ndb_mgm_get_clusterlog_level_string(enum ndb_mgm_clusterlog_level level); + /** * Set log category and levels for the Node * diff --git a/ndb/src/common/logger/Logger.cpp b/ndb/src/common/logger/Logger.cpp index f6f70fbeff7..b392b966838 100644 --- a/ndb/src/common/logger/Logger.cpp +++ b/ndb/src/common/logger/Logger.cpp @@ -30,7 +30,7 @@ // // PUBLIC // -const char* Logger::LoggerLevelNames[] = { "OFF ", +const char* Logger::LoggerLevelNames[] = { "ON ", "DEBUG ", "INFO ", "WARNING ", @@ -46,7 +46,9 @@ Logger::Logger() : m_pSyslogHandler(NULL) { m_pHandlerList = new LogHandlerList(); - m_logLevels[LL_INFO] = true; + disable(LL_ALL); + enable(LL_ON); + enable(LL_INFO); } Logger::~Logger() @@ -227,6 +229,13 @@ Logger::removeAllHandlers() bool Logger::isEnable(LoggerLevel logLevel) const { + if (logLevel == LL_ALL) + { + for (unsigned i = 1; i < MAX_LOG_LEVELS; i++) + if (!m_logLevels[i]) + return false; + return true; + } return m_logLevels[logLevel]; } @@ -235,7 +244,7 @@ Logger::enable(LoggerLevel logLevel) { if (logLevel == LL_ALL) { - for (unsigned i = 1; i < MAX_LOG_LEVELS; i++) + for (unsigned i = 0; i < MAX_LOG_LEVELS; i++) { m_logLevels[i] = true; } @@ -337,7 +346,7 @@ Logger::debug(const char* pMsg, ...) const void Logger::log(LoggerLevel logLevel, const char* pMsg, va_list ap) const { - if (m_logLevels[LL_OFF] == false && m_logLevels[logLevel]) + if (m_logLevels[LL_ON] && m_logLevels[logLevel]) { LogHandler* pHandler = NULL; while ( (pHandler = m_pHandlerList->next()) != NULL) diff --git a/ndb/src/mgmapi/mgmapi.cpp b/ndb/src/mgmapi/mgmapi.cpp index e22ceffe773..2bcb3c74848 100644 --- a/ndb/src/mgmapi/mgmapi.cpp +++ b/ndb/src/mgmapi/mgmapi.cpp @@ -914,21 +914,67 @@ ndb_mgm_restart(NdbMgmHandle handle, int no_of_nodes, const int *node_list) return ndb_mgm_restart2(handle, no_of_nodes, node_list, 0, 0, 0); } +static const char *clusterlog_level_names[]= + { "enabled", "debug", "info", "warning", "error", "critical", "alert" }; + +struct ndb_mgm_clusterlog_levels +{ + const char* name; + enum ndb_mgm_clusterlog_level level; +} clusterlog_levels[] = { + { clusterlog_level_names[0], NDB_MGM_CLUSTERLOG_ON }, + { clusterlog_level_names[1], NDB_MGM_CLUSTERLOG_DEBUG }, + { clusterlog_level_names[2], NDB_MGM_CLUSTERLOG_INFO }, + { clusterlog_level_names[3], NDB_MGM_CLUSTERLOG_WARNING }, + { clusterlog_level_names[4], NDB_MGM_CLUSTERLOG_ERROR }, + { clusterlog_level_names[5], NDB_MGM_CLUSTERLOG_CRITICAL }, + { clusterlog_level_names[6], NDB_MGM_CLUSTERLOG_ALERT }, + { "all", NDB_MGM_CLUSTERLOG_ALL }, + { 0, NDB_MGM_ILLEGAL_CLUSTERLOG_LEVEL }, +}; + +extern "C" +ndb_mgm_clusterlog_level +ndb_mgm_match_clusterlog_level(const char * name) +{ + if(name == 0) + return NDB_MGM_ILLEGAL_CLUSTERLOG_LEVEL; + + for(int i = 0; clusterlog_levels[i].name !=0 ; i++) + if(strcasecmp(name, clusterlog_levels[i].name) == 0) + return clusterlog_levels[i].level; + + return NDB_MGM_ILLEGAL_CLUSTERLOG_LEVEL; +} + +extern "C" +const char * +ndb_mgm_get_clusterlog_level_string(enum ndb_mgm_clusterlog_level level) +{ + int i= (int)level; + if (i >= 0 && i < (int)NDB_MGM_CLUSTERLOG_ALL) + return clusterlog_level_names[i]; + for(i = (int)NDB_MGM_CLUSTERLOG_ALL; clusterlog_levels[i].name != 0; i++) + if(clusterlog_levels[i].level == level) + return clusterlog_levels[i].name; + return 0; +} + extern "C" unsigned int * ndb_mgm_get_logfilter(NdbMgmHandle handle) { SET_ERROR(handle, NDB_MGM_NO_ERROR, "Executing: ndb_mgm_get_logfilter"); - static Uint32 enabled[7] = {0,0,0,0,0,0,0}; + static Uint32 enabled[(int)NDB_MGM_CLUSTERLOG_ALL] = {0,0,0,0,0,0,0}; const ParserRow getinfo_reply[] = { MGM_CMD("clusterlog", NULL, ""), - MGM_ARG("enabled", Int, Mandatory, ""), - MGM_ARG("debug", Int, Mandatory, ""), - MGM_ARG("info", Int, Mandatory, ""), - MGM_ARG("warning", Int, Mandatory, ""), - MGM_ARG("error", Int, Mandatory, ""), - MGM_ARG("critical", Int, Mandatory, ""), - MGM_ARG("alert", Int, Mandatory, ""), + MGM_ARG(clusterlog_level_names[0], Int, Mandatory, ""), + MGM_ARG(clusterlog_level_names[1], Int, Mandatory, ""), + MGM_ARG(clusterlog_level_names[2], Int, Mandatory, ""), + MGM_ARG(clusterlog_level_names[3], Int, Mandatory, ""), + MGM_ARG(clusterlog_level_names[4], Int, Mandatory, ""), + MGM_ARG(clusterlog_level_names[5], Int, Mandatory, ""), + MGM_ARG(clusterlog_level_names[6], Int, Mandatory, ""), }; CHECK_HANDLE(handle, NULL); CHECK_CONNECTED(handle, NULL); @@ -938,10 +984,8 @@ ndb_mgm_get_logfilter(NdbMgmHandle handle) reply = ndb_mgm_call(handle, getinfo_reply, "get info clusterlog", &args); CHECK_REPLY(reply, NULL); - const char *names[] = { "enabled", "debug", "info", "warning", "error", - "critical", "alert" }; - for(int i=0; i < 7; i++) { - reply->get(names[i], &enabled[i]); + for(int i=0; i < (int)NDB_MGM_CLUSTERLOG_ALL; i++) { + reply->get(clusterlog_level_names[i], &enabled[i]); } return enabled; } @@ -950,6 +994,7 @@ extern "C" int ndb_mgm_filter_clusterlog(NdbMgmHandle handle, enum ndb_mgm_clusterlog_level level, + int enable, struct ndb_mgm_reply* /*reply*/) { SET_ERROR(handle, NDB_MGM_NO_ERROR, "Executing: ndb_mgm_filter_clusterlog"); @@ -964,6 +1009,7 @@ ndb_mgm_filter_clusterlog(NdbMgmHandle handle, Properties args; args.put("level", level); + args.put("enable", enable); const Properties *reply; reply = ndb_mgm_call(handle, filter_reply, "set logfilter", &args); @@ -971,11 +1017,14 @@ ndb_mgm_filter_clusterlog(NdbMgmHandle handle, BaseString result; reply->get("result", result); - if(strcmp(result.c_str(), "1") == 0) { + + if (strcmp(result.c_str(), "1") == 0) + retval = 1; + else if (strcmp(result.c_str(), "0") == 0) retval = 0; - } else { + else + { SET_ERROR(handle, EINVAL, result.c_str()); - retval = -1; } delete reply; return retval; diff --git a/ndb/src/mgmclient/CommandInterpreter.cpp b/ndb/src/mgmclient/CommandInterpreter.cpp index 7ef62da9bb3..3a9b3c47376 100644 --- a/ndb/src/mgmclient/CommandInterpreter.cpp +++ b/ndb/src/mgmclient/CommandInterpreter.cpp @@ -264,9 +264,9 @@ static const char* helpText = "START BACKUP Start backup\n" "ABORT BACKUP Abort backup\n" "SHUTDOWN Shutdown all processes in cluster and quit\n" -"CLUSTERLOG ON Enable Cluster logging\n" -"CLUSTERLOG OFF Disable Cluster logging\n" -"CLUSTERLOG FILTER Toggle severity filter on/off\n" +"CLUSTERLOG ON [] ... Enable Cluster logging\n" +"CLUSTERLOG OFF [] ... Disable Cluster logging\n" +"CLUSTERLOG TOGGLE [] ... Toggle severity filter on/off\n" "CLUSTERLOG INFO Print cluster log information\n" " START Start DB node (started with -n)\n" " RESTART [-n] [-i] Restart DB node\n" @@ -666,11 +666,9 @@ CommandInterpreter::analyseAfterFirstToken(int processId, if(processId == -1){ executeForAll(command, fun, allAfterSecondToken); } else { - if(strcasecmp(command, "STATUS") != 0) - ndbout_c("Executing %s on node %d.", command, processId); (this->*fun)(processId, allAfterSecondToken, false); - ndbout << endl; } + ndbout << endl; } /** @@ -733,12 +731,8 @@ CommandInterpreter::executeForAll(const char * cmd, ExecuteFunction fun, return; } NdbAutoPtr ap1((char*)cl); - while(get_next_nodeid(cl, &nodeId, NDB_MGM_NODE_TYPE_NDB)) { - if(strcasecmp(cmd, "STATUS") != 0) - ndbout_c("Executing %s on node %d.", cmd, nodeId); + while(get_next_nodeid(cl, &nodeId, NDB_MGM_NODE_TYPE_NDB)) (this->*fun)(nodeId, allAfterSecondToken, true); - ndbout << endl; - } // while } } @@ -1137,144 +1131,130 @@ CommandInterpreter::executeConnect(char* parameters) void CommandInterpreter::executeClusterLog(char* parameters) { + DBUG_ENTER("CommandInterpreter::executeClusterLog"); int i; - if (parameters != 0 && strlen(parameters) != 0) { - enum ndb_mgm_clusterlog_level severity = NDB_MGM_CLUSTERLOG_ALL; - int isOk = true; - char name[12]; - bool noArgs = false; - - char * tmpString = my_strdup(parameters,MYF(MY_WME)); - My_auto_ptr ap1(tmpString); - char * tmpPtr = 0; - char * item = strtok_r(tmpString, " ", &tmpPtr); - - /******************** - * CLUSTERLOG FILTER - ********************/ - if (strcasecmp(item, "FILTER") == 0) { - - item = strtok_r(NULL, " ", &tmpPtr); - if (item == NULL) { - noArgs = true; - } - while (item != NULL) { - snprintf(name, sizeof(name), item); - - if (strcasecmp(item, "ALL") == 0) { - severity = NDB_MGM_CLUSTERLOG_ALL; - } else if (strcasecmp(item, "ALERT") == 0) { - severity = NDB_MGM_CLUSTERLOG_ALERT; - } else if (strcasecmp(item, "CRITICAL") == 0) { - severity = NDB_MGM_CLUSTERLOG_CRITICAL; - } else if (strcasecmp(item, "ERROR") == 0) { - severity = NDB_MGM_CLUSTERLOG_ERROR; - } else if (strcasecmp(item, "WARNING") == 0) { - severity = NDB_MGM_CLUSTERLOG_WARNING; - } else if (strcasecmp(item, "INFO") == 0) { - severity = NDB_MGM_CLUSTERLOG_INFO; - } else if (strcasecmp(item, "DEBUG") == 0) { - severity = NDB_MGM_CLUSTERLOG_DEBUG; - } else if (strcasecmp(item, "OFF") == 0) { - severity = NDB_MGM_CLUSTERLOG_OFF; - } else { - isOk = false; - } - - item = strtok_r(NULL, " ", &tmpPtr); - } // while(item != NULL){ - - if (noArgs) { - ndbout << "Missing argument(s)." << endl; - } else if (isOk) { - if(ndb_mgm_filter_clusterlog(m_mgmsrv, severity, NULL)) { - if(strcasecmp(name, "ALL") == 0) { - ndbout << "All severities levels enabled." << endl; - } else if(strcasecmp(name, "OFF") == 0) { - ndbout << "Cluster logging enabled." << endl; - } else { - ndbout << name << " events disabled." << endl; - } - } else { - if(strcasecmp(name, "ALL") == 0) { - ndbout << "All severities levels disabled." << endl; - } else if(strcasecmp(name, "OFF") == 0) { - ndbout << "Cluster logging disabled." << endl; - } else { - ndbout << name << " events enabled." << endl; - } - } - } else { - ndbout << "Invalid severity level." << endl; - } - - /******************** - * CLUSTERLOG INFO - ********************/ - } else if (strcasecmp(item, "INFO") == 0) { - Uint32 *enabled = ndb_mgm_get_logfilter(m_mgmsrv); - if(enabled == NULL) { - ndbout << "Couldn't get status" << endl; - printError(); - return; - } - const char* names[] = {"ENABLED", "DEBUG", "INFO", "WARNING", "ERROR", - "CRITICAL", "ALERT"}; - if(enabled[0]) - ndbout << "Cluster logging is disabled." << endl; - - - for(i = 0; i<7;i++) - printf("enabled[%d] = %d\n", i, enabled[i]); - ndbout << "Severities enabled: "; - for(i = 1; i < 7; i++) { - if(enabled[i]) - ndbout << names[i] << " "; - } - ndbout << endl; - - /******************** - * CLUSTERLOG OFF - ********************/ - } else if (strcasecmp(item, "OFF") == 0) { - Uint32 *enabled = ndb_mgm_get_logfilter(m_mgmsrv); - if(enabled == NULL) { - ndbout << "Couldn't get status" << endl; - printError(); - return; - } - if(!enabled[0]) { - ndb_mgm_filter_clusterlog(m_mgmsrv, NDB_MGM_CLUSTERLOG_OFF, NULL); - ndbout << "Cluster logging is disabled." << endl; - } else { - ndbout << "Cluster logging is already disabled." << endl; - - } - - /******************** - * CLUSTERLOG ON - ********************/ - } else if (strcasecmp(item, "ON") == 0) { - Uint32 *enabled = ndb_mgm_get_logfilter(m_mgmsrv); - if(enabled == NULL) { - ndbout << "Could not get status" << endl; - printError(); - return; - } - if(enabled[0]) { - ndb_mgm_filter_clusterlog(m_mgmsrv, NDB_MGM_CLUSTERLOG_OFF, NULL); - ndbout << "Cluster logging is enabled." << endl; - } else { - ndbout << "Cluster logging is already enabled." << endl; - - } - } else { - ndbout << "Invalid argument." << endl; - } - - } else { + if (emptyString(parameters)) + { ndbout << "Missing argument." << endl; + DBUG_VOID_RETURN; } + + enum ndb_mgm_clusterlog_level severity = NDB_MGM_CLUSTERLOG_ALL; + + char * tmpString = my_strdup(parameters,MYF(MY_WME)); + My_auto_ptr ap1(tmpString); + char * tmpPtr = 0; + char * item = strtok_r(tmpString, " ", &tmpPtr); + int enable; + + Uint32 *enabled = ndb_mgm_get_logfilter(m_mgmsrv); + if(enabled == NULL) { + ndbout << "Couldn't get status" << endl; + printError(); + DBUG_VOID_RETURN; + } + + /******************** + * CLUSTERLOG INFO + ********************/ + if (strcasecmp(item, "INFO") == 0) { + DBUG_PRINT("info",("INFO")); + if(enabled[0] == 0) + { + ndbout << "Cluster logging is disabled." << endl; + DBUG_VOID_RETURN; + } +#if 0 + for(i = 0; i<7;i++) + printf("enabled[%d] = %d\n", i, enabled[i]); +#endif + ndbout << "Severities enabled: "; + for(i = 1; i < (int)NDB_MGM_CLUSTERLOG_ALL; i++) { + const char *str= ndb_mgm_get_clusterlog_level_string((ndb_mgm_clusterlog_level)i); + if (str == 0) + { + DBUG_ASSERT(false); + continue; + } + if(enabled[i]) + ndbout << BaseString(str).ndb_toupper() << " "; + } + ndbout << endl; + DBUG_VOID_RETURN; + + } + else if (strcasecmp(item, "FILTER") == 0 || + strcasecmp(item, "TOGGLE") == 0) + { + DBUG_PRINT("info",("TOGGLE")); + enable= -1; + } + else if (strcasecmp(item, "OFF") == 0) + { + DBUG_PRINT("info",("OFF")); + enable= 0; + } else if (strcasecmp(item, "ON") == 0) { + DBUG_PRINT("info",("ON")); + enable= 1; + } else { + ndbout << "Invalid argument." << endl; + DBUG_VOID_RETURN; + } + + int res_enable; + item = strtok_r(NULL, " ", &tmpPtr); + if (item == NULL) { + res_enable= ndb_mgm_filter_clusterlog(m_mgmsrv, + NDB_MGM_CLUSTERLOG_ON, enable, NULL); + if (res_enable < 0) + { + ndbout << "Couldn't set filter" << endl; + printError(); + DBUG_VOID_RETURN; + } + ndbout << "Cluster logging is " << (res_enable ? "enabled.":"disabled") << endl; + DBUG_VOID_RETURN; + } + + do { + severity= NDB_MGM_ILLEGAL_CLUSTERLOG_LEVEL; + if (strcasecmp(item, "ALL") == 0) { + severity = NDB_MGM_CLUSTERLOG_ALL; + } else if (strcasecmp(item, "ALERT") == 0) { + severity = NDB_MGM_CLUSTERLOG_ALERT; + } else if (strcasecmp(item, "CRITICAL") == 0) { + severity = NDB_MGM_CLUSTERLOG_CRITICAL; + } else if (strcasecmp(item, "ERROR") == 0) { + severity = NDB_MGM_CLUSTERLOG_ERROR; + } else if (strcasecmp(item, "WARNING") == 0) { + severity = NDB_MGM_CLUSTERLOG_WARNING; + } else if (strcasecmp(item, "INFO") == 0) { + severity = NDB_MGM_CLUSTERLOG_INFO; + } else if (strcasecmp(item, "DEBUG") == 0) { + severity = NDB_MGM_CLUSTERLOG_DEBUG; + } else if (strcasecmp(item, "OFF") == 0 || + strcasecmp(item, "ON") == 0) { + if (enable < 0) // only makes sense with toggle + severity = NDB_MGM_CLUSTERLOG_ON; + } + if (severity == NDB_MGM_ILLEGAL_CLUSTERLOG_LEVEL) { + ndbout << "Invalid severity level: " << item << endl; + DBUG_VOID_RETURN; + } + + res_enable = ndb_mgm_filter_clusterlog(m_mgmsrv, severity, enable, NULL); + if (res_enable < 0) + { + ndbout << "Couldn't set filter" << endl; + printError(); + DBUG_VOID_RETURN; + } + ndbout << item << " " << (res_enable ? "enabled":"disabled") << endl; + + item = strtok_r(NULL, " ", &tmpPtr); + } while(item != NULL); + + DBUG_VOID_RETURN; } //***************************************************************************** @@ -1404,7 +1384,7 @@ CommandInterpreter::executeRestart(int processId, const char* parameters, if(all) ndbout << "NDB Cluster is being restarted." << endl; else - ndbout_c("Database node %d is being restarted.", processId); + ndbout_c("Node %d is being restarted.", processId); } } @@ -1451,7 +1431,7 @@ CommandInterpreter::executeStatus(int processId, const char* parameters, bool all) { if (! emptyString(parameters)) { - ndbout << "No parameters expected to this command." << endl; + ndbout_c("No parameters expected to this command."); return; } @@ -1482,7 +1462,7 @@ CommandInterpreter::executeStatus(int processId, ndbout << "Node " << processId << ": " << status_string(status); switch(status){ case NDB_MGM_NODE_STATUS_STARTING: - ndbout << " (Phase " << startPhase << ")" ; + ndbout << " (Phase " << startPhase << ")"; break; case NDB_MGM_NODE_STATUS_SHUTTING_DOWN: ndbout << " (Phase " << startPhase << ")"; @@ -1495,6 +1475,8 @@ CommandInterpreter::executeStatus(int processId, getMajor(version) , getMinor(version), getBuild(version)); + else + ndbout << endl; } @@ -1506,7 +1488,10 @@ CommandInterpreter::executeLogLevel(int processId, const char* parameters, bool all) { (void) all; - + if (emptyString(parameters)) { + ndbout << "Expected argument" << endl; + return; + } BaseString tmp(parameters); Vector spec; tmp.split(spec, "="); @@ -1532,6 +1517,8 @@ CommandInterpreter::executeLogLevel(int processId, const char* parameters, return; } + ndbout << "Executing LOGLEVEL on node " << processId << flush; + struct ndb_mgm_reply reply; int result; result = ndb_mgm_set_loglevel_node(m_mgmsrv, @@ -1541,11 +1528,10 @@ CommandInterpreter::executeLogLevel(int processId, const char* parameters, &reply); if (result < 0) { - ndbout_c("Executing LOGLEVEL on node %d failed.", processId); + ndbout_c(" failed."); printError(); } else { - ndbout << "Executing LOGLEVEL on node " << processId << " OK!" - << endl; + ndbout_c(" OK!"); } } @@ -1840,36 +1826,36 @@ CommandInterpreter::executeEventReporting(int processId, spec[0].trim().ndb_toupper(); int category = ndb_mgm_match_event_category(spec[0].c_str()); if(category == NDB_MGM_ILLEGAL_EVENT_CATEGORY){ - category = atoi(spec[0].c_str()); - if(category < NDB_MGM_MIN_EVENT_CATEGORY || + if(!convert(spec[0].c_str(), category) || + category < NDB_MGM_MIN_EVENT_CATEGORY || category > NDB_MGM_MAX_EVENT_CATEGORY){ ndbout << "Unknown category: \"" << spec[0].c_str() << "\"" << endl; return; } } - - int level = atoi(spec[1].c_str()); - if(level < 0 || level > 15){ + + int level; + if (!convert(spec[1].c_str(),level)) + { ndbout << "Invalid level: " << spec[1].c_str() << endl; return; } - + + ndbout << "Executing CLUSTERLOG on node " << processId << flush; struct ndb_mgm_reply reply; int result; - result = ndb_mgm_set_loglevel_clusterlog(m_mgmsrv, - processId, // fast fix - pekka + processId, (ndb_mgm_event_category)category, level, &reply); if (result != 0) { - ndbout_c("Executing CLUSTERLOG on node %d failed", processId); + ndbout_c(" failed."); printError(); } else { - ndbout << "Executing CLUSTERLOG on node " << processId << " OK!" - << endl; + ndbout_c(" OK!"); } } diff --git a/ndb/src/mgmsrv/CommandInterpreter.cpp b/ndb/src/mgmsrv/CommandInterpreter.cpp index 02bf24f1d9c..1b882cd2e71 100644 --- a/ndb/src/mgmsrv/CommandInterpreter.cpp +++ b/ndb/src/mgmsrv/CommandInterpreter.cpp @@ -157,10 +157,6 @@ int CommandInterpreter::readAndExecute() { executeShow(allAfterFirstToken); return true; } - else if (strcmp(firstToken, "CLUSTERLOG") == 0) { - executeClusterLog(allAfterFirstToken); - return true; - } else if(strcmp(firstToken, "START") == 0 && allAfterFirstToken != 0 && strncmp(allAfterFirstToken, "BACKUP", sizeof("BACKUP") - 1) == 0){ @@ -472,130 +468,6 @@ void CommandInterpreter::executeShow(char* parameters) { } } - -//***************************************************************************** -//***************************************************************************** -void CommandInterpreter::executeClusterLog(char* parameters) { - - if (parameters != 0 && strlen(parameters) != 0) { - int severity = 7; - int isOk = true; - char name[12]; - bool noArgs = false; - - char * tmpString = strdup(parameters); - char * tmpPtr = 0; - char * item = strtok_r(tmpString, " ", &tmpPtr); - - /******************** - * CLUSTERLOG FILTER - ********************/ - if (strcmp(item, "FILTER") == 0) { - - item = strtok_r(NULL, " ", &tmpPtr); - if (item == NULL) { - noArgs = true; - } - while (item != NULL) { - snprintf(name, 12, item); - - if (strcmp(item, "ALL") == 0) { - severity = 7; - } else if (strcmp(item, "ALERT") == 0) { - severity = 6; - } else if (strcmp(item, "CRITICAL") == 0) { - severity = 5; - } else if (strcmp(item, "ERROR") == 0) { - severity = 4; - } else if (strcmp(item, "WARNING") == 0) { - severity = 3; - } else if (strcmp(item, "INFO") == 0) { - severity = 2; - } else if (strcmp(item, "DEBUG") == 0) { - severity = 1; - } else if (strcmp(item, "OFF") == 0) { - severity = 0; - } else { - isOk = false; - } - - item = strtok_r(NULL, " ", &tmpPtr); - } // while(item != NULL){ - free(tmpString); - - if (noArgs) { - ndbout << "Missing argument(s)." << endl; - } else if (isOk) { - if (_mgmtSrvr.setEventLogFilter(severity)) { - if(strcmp(name, "ALL") == 0 || strcmp(name, "all") == 0) { - ndbout << "All severities levels enabled." << endl; - } else if(strcmp(name, "OFF") == 0 || strcmp(name, "off") == 0) { - ndbout << "Cluster logging disabled." << endl; - } else { - ndbout << name << " events enabled." << endl; - } - } else { - if(strcmp(name, "ALL") == 0) { - ndbout << "All severities levels disabled." << endl; - } else if(strcmp(name, "OFF") == 0) { - ndbout << "Cluster logging enabled." << endl; - } else { - ndbout << name << " events disabled." << endl; - } - } - } else { - ndbout << "Invalid severity level." << endl; - } - - /******************** - * CLUSTERLOG INFO - ********************/ - } else if (strcmp(item, "INFO") == 0) { - const char* names[] = {"DEBUG", "INFO", "WARNING", "ERROR", - "CRITICAL", "ALERT"}; - if (_mgmtSrvr.isEventLogFilterEnabled(0)) { // OFF - ndbout << "Cluster logging is disabled." << endl; - } - - ndbout << "Severities enabled: "; - for (int i = 0; i < 6; i++) { - if (_mgmtSrvr.isEventLogFilterEnabled(i + 1)) { - ndbout << names[i] << " "; - } - } - ndbout << endl; - - /******************** - * CLUSTERLOG OFF - ********************/ - } else if (strcmp(item, "OFF") == 0) { - if (!_mgmtSrvr.isEventLogFilterEnabled(0)) { // ON - if (_mgmtSrvr.setEventLogFilter(0)); - ndbout << "Cluster logging is disabled." << endl; - } else { - ndbout << "Cluster logging is already disabled." << endl; - } - - /******************** - * CLUSTERLOG ON - ********************/ - } else if (strcmp(item, "ON") == 0) { - if (_mgmtSrvr.isEventLogFilterEnabled(0)) { // OFF - if (_mgmtSrvr.setEventLogFilter(0)); - ndbout << "Cluster logging is enabled." << endl; - } else { - ndbout << "Cluster logging is already enabled." << endl; - } - - } else { - ndbout << "Invalid argument." << endl; - } - - } else { - ndbout << "Missing argument." << endl; - } -} - void stopCallback(int nodeId, void * anyData, int errCode){ if(errCode == 0){ diff --git a/ndb/src/mgmsrv/CommandInterpreter.hpp b/ndb/src/mgmsrv/CommandInterpreter.hpp index 1a5184361d6..74e5c2e95be 100644 --- a/ndb/src/mgmsrv/CommandInterpreter.hpp +++ b/ndb/src/mgmsrv/CommandInterpreter.hpp @@ -125,7 +125,6 @@ private: void executeShow(char* parameters); void executeRun(char* parameters); void executeInfo(char* parameters); - void executeClusterLog(char* parameters); public: void executeStop(int processId, const char* parameters, bool all); diff --git a/ndb/src/mgmsrv/MgmtSrvr.cpp b/ndb/src/mgmsrv/MgmtSrvr.cpp index 061aa2e0cb8..4a9bfac3b6c 100644 --- a/ndb/src/mgmsrv/MgmtSrvr.cpp +++ b/ndb/src/mgmsrv/MgmtSrvr.cpp @@ -226,7 +226,8 @@ MgmtSrvr::startEventLog() clusterLog); } if(!g_EventLogger.addHandler(logdest)) { - ndbout << "Warning: could not add log destination \"" << logdest.c_str() << "\"" << endl; + ndbout << "Warning: could not add log destination \"" + << logdest.c_str() << "\"" << endl; } } @@ -244,18 +245,19 @@ public: }; bool -MgmtSrvr::setEventLogFilter(int severity) +MgmtSrvr::setEventLogFilter(int severity, int enable) { - bool enabled = true; Logger::LoggerLevel level = (Logger::LoggerLevel)severity; - if (g_EventLogger.isEnable(level)) { + if (enable > 0) { + g_EventLogger.enable(level); + } else if (enable == 0) { + g_EventLogger.disable(level); + } else if (g_EventLogger.isEnable(level)) { g_EventLogger.disable(level); - enabled = false; } else { g_EventLogger.enable(level); } - - return enabled; + return g_EventLogger.isEnable(level); } bool diff --git a/ndb/src/mgmsrv/MgmtSrvr.hpp b/ndb/src/mgmsrv/MgmtSrvr.hpp index 1afb0848ecc..4d5631d3eb6 100644 --- a/ndb/src/mgmsrv/MgmtSrvr.hpp +++ b/ndb/src/mgmsrv/MgmtSrvr.hpp @@ -122,7 +122,7 @@ public: * @param serverity the log level/serverity. * @return true if the severity was enabled. */ - bool setEventLogFilter(int severity); + bool setEventLogFilter(int severity, int enable); /** * Returns true if the log level/severity is enabled. diff --git a/ndb/src/mgmsrv/Services.cpp b/ndb/src/mgmsrv/Services.cpp index 5834d40cc78..0707fff24ec 100644 --- a/ndb/src/mgmsrv/Services.cpp +++ b/ndb/src/mgmsrv/Services.cpp @@ -217,6 +217,7 @@ ParserRow commands[] = { MGM_CMD("set logfilter", &MgmApiSession::setLogFilter, ""), MGM_ARG("level", Int, Mandatory, "Severety level"), + MGM_ARG("enable", Int, Mandatory, "1=disable, 0=enable, -1=toggle"), MGM_CMD("config lock", &MgmApiSession::configLock, ""), @@ -1190,10 +1191,12 @@ void MgmApiSession::setLogFilter(Parser_t::Context &ctx, const class Properties &args) { Uint32 level; + Uint32 enable; args.get("level", &level); + args.get("enable", &enable); - int result = m_mgmsrv.setEventLogFilter(level); + int result = m_mgmsrv.setEventLogFilter(level, enable); m_output->println("set logfilter reply"); m_output->println("result: %d", result); From a700754e7108aa51631949f236e4cd965f7fda42 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 7 Dec 2004 10:27:22 +0100 Subject: [PATCH 0435/1063] Removed getTableForAlteration --- ndb/include/ndbapi/NdbDictionary.hpp | 14 -------------- ndb/src/ndbapi/NdbDictionary.cpp | 13 ------------- ndb/test/ndbapi/testDict.cpp | 6 +++--- sql/ha_ndbcluster.cc | 2 +- 4 files changed, 4 insertions(+), 31 deletions(-) diff --git a/ndb/include/ndbapi/NdbDictionary.hpp b/ndb/include/ndbapi/NdbDictionary.hpp index e07fc64f064..75296e919f0 100644 --- a/ndb/include/ndbapi/NdbDictionary.hpp +++ b/ndb/include/ndbapi/NdbDictionary.hpp @@ -982,20 +982,6 @@ public: */ const Table * getTable(const char * name); - /** - * Get table with given name for alteration. - * @param name Name of table to alter - * @return table if successful. NULL if undefined - */ - Table getTableForAlteration(const char * name); - - /** - * Get copy a copy of a table for alteration. - * @param table Table object to alter - * @return table if successful. NULL if undefined - */ - Table getTableForAlteration(const Table &); - #ifndef DOXYGEN_SHOULD_SKIP_INTERNAL /** * Invalidate cached table object diff --git a/ndb/src/ndbapi/NdbDictionary.cpp b/ndb/src/ndbapi/NdbDictionary.cpp index d1827c6895f..f88bbc907a6 100644 --- a/ndb/src/ndbapi/NdbDictionary.cpp +++ b/ndb/src/ndbapi/NdbDictionary.cpp @@ -773,19 +773,6 @@ NdbDictionary::Dictionary::removeCachedTable(const char * name){ m_impl.removeCachedObject(* t); } -NdbDictionary::Table -NdbDictionary::Dictionary::getTableForAlteration(const char * name){ - const Table * oldTable = getTable(name); - return (oldTable) ? - NdbDictionary::Table(*oldTable) - : NdbDictionary::Table(); -} - -NdbDictionary::Table -NdbDictionary::Dictionary::getTableForAlteration(const Table & tab){ - return NdbDictionary::Table(tab); -} - int NdbDictionary::Dictionary::createIndex(const Index & ind) { diff --git a/ndb/test/ndbapi/testDict.cpp b/ndb/test/ndbapi/testDict.cpp index 0a43bb02fff..5f88342705a 100644 --- a/ndb/test/ndbapi/testDict.cpp +++ b/ndb/test/ndbapi/testDict.cpp @@ -1211,7 +1211,7 @@ runTableRename(NDBT_Context* ctx, NDBT_Step* step){ const NdbDictionary::Table * oldTable = dict->getTable(pTabName.c_str()); if (oldTable) { - NdbDictionary::Table newTable = dict->getTableForAlteration(pTabName.c_str()); + NdbDictionary::Table newTable = *oldTable; newTable.setName(pTabNewName.c_str()); CHECK2(dict->alterTable(newTable) == 0, "TableRename failed"); @@ -1280,7 +1280,7 @@ runTableRenameNF(NDBT_Context* ctx, NDBT_Step* step){ const NdbDictionary::Table * oldTable = dict->getTable(pTabName.c_str()); if (oldTable) { - NdbDictionary::Table newTable = dict->getTableForAlteration(pTabName.c_str()); + NdbDictionary::Table newTable = *oldTable; newTable.setName(pTabNewName.c_str()); CHECK2(dict->alterTable(newTable) == 0, "TableRename failed"); @@ -1377,7 +1377,7 @@ runTableRenameSR(NDBT_Context* ctx, NDBT_Step* step){ const NdbDictionary::Table * oldTable = dict->getTable(pTabName.c_str()); if (oldTable) { - NdbDictionary::Table newTable = dict->getTableForAlteration(pTabName.c_str()); + NdbDictionary::Table newTable = *oldTable; newTable.setName(pTabNewName.c_str()); CHECK2(dict->alterTable(newTable) == 0, "TableRename failed"); diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 7054619fdab..775ab96d1a1 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -3670,7 +3670,7 @@ int ha_ndbcluster::alter_table_name(const char *to) int ret; DBUG_ENTER("alter_table_name_table"); - NdbDictionary::Table new_tab= dict->getTableForAlteration(*orig_tab); + NdbDictionary::Table new_tab= *orig_tab; new_tab.setName(to); if (dict->alterTable(new_tab) != 0) ERR_RETURN(dict->getNdbError()); From 154e64ac92daa754b0e173f37132897112941220 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 7 Dec 2004 14:51:13 +0400 Subject: [PATCH 0436/1063] A fix (bug #6993: Max myisam_data_pointer_size limited to 7). --- mysql-test/r/variables.result | 4 ++++ mysql-test/t/variables.test | 7 +++++++ sql/mysqld.cc | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result index b2a97ce3e48..01db98648bd 100644 --- a/mysql-test/r/variables.result +++ b/mysql-test/r/variables.result @@ -478,3 +478,7 @@ t1 CREATE TABLE `t1` ( `c3` longtext ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; +SET GLOBAL MYISAM_DATA_POINTER_SIZE= 8; +SHOW VARIABLES LIKE 'MYISAM_DATA_POINTER_SIZE'; +Variable_name Value +myisam_data_pointer_size 8 diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test index d0a78c157c3..7dc07f9313e 100644 --- a/mysql-test/t/variables.test +++ b/mysql-test/t/variables.test @@ -355,3 +355,10 @@ create table t1 as select @arg00 as c1, @arg01 as c2, @arg02 as c3; show create table t1; drop table t1; + +# +# Bug #6993: myisam_data_pointer_size +# + +SET GLOBAL MYISAM_DATA_POINTER_SIZE= 8; +SHOW VARIABLES LIKE 'MYISAM_DATA_POINTER_SIZE'; diff --git a/sql/mysqld.cc b/sql/mysqld.cc index da834080bc0..607dd6a101a 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -5004,7 +5004,7 @@ The minimum value for this variable is 4096.", "Default pointer size to be used for MyISAM tables.", (gptr*) &myisam_data_pointer_size, (gptr*) &myisam_data_pointer_size, 0, GET_ULONG, REQUIRED_ARG, - 4, 2, 7, 0, 1, 0}, + 4, 2, 8, 0, 1, 0}, {"myisam_max_extra_sort_file_size", OPT_MYISAM_MAX_EXTRA_SORT_FILE_SIZE, "Used to help MySQL to decide when to use the slow but safe key cache index create method.", (gptr*) &global_system_variables.myisam_max_extra_sort_file_size, From 9d48570cd45f3381891583544d091703a21e7310 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 7 Dec 2004 12:08:20 +0100 Subject: [PATCH 0437/1063] two fixes for potential security bugs --- sql/log.cc | 18 ++++++++++-------- sql/sql_class.cc | 4 ++-- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/sql/log.cc b/sql/log.cc index b2d015c1a14..b46a8de056e 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -1797,6 +1797,7 @@ bool flush_error_log() char err_renamed[FN_REFLEN], *end; end= strmake(err_renamed,log_error_file,FN_REFLEN-4); strmov(end, "-old"); + VOID(pthread_mutex_lock(&LOCK_error_log)); #ifdef __WIN__ char err_temp[FN_REFLEN+4]; /* @@ -1804,7 +1805,7 @@ bool flush_error_log() the current error file. */ strmov(strmov(err_temp, err_renamed),"-tmp"); - (void) my_delete(err_temp, MYF(0)); + (void) my_delete(err_temp, MYF(0)); if (freopen(err_temp,"a+",stdout)) { freopen(err_temp,"a+",stderr); @@ -1817,20 +1818,21 @@ bool flush_error_log() if ((fd = my_open(err_temp, O_RDONLY, MYF(0))) >= 0) { while ((bytes = (int) my_read(fd, (byte*) buf, IO_SIZE, MYF(0))) > 0) - my_fwrite(stderr, (byte*) buf, (uint) strlen(buf),MYF(0)); + my_fwrite(stderr, (byte*) buf, bytes, MYF(0)); my_close(fd, MYF(0)); } - (void) my_delete(err_temp, MYF(0)); + (void) my_delete(err_temp, MYF(0)); } else result= 1; #else - my_rename(log_error_file,err_renamed,MYF(0)); - if (freopen(log_error_file,"a+",stdout)) - freopen(log_error_file,"a+",stderr); - else - result= 1; + my_rename(log_error_file,err_renamed,MYF(0)); + if (freopen(log_error_file,"a+",stdout)) + freopen(log_error_file,"a+",stderr); + else + result= 1; #endif + VOID(pthread_mutex_unlock(&LOCK_error_log)); } return result; } diff --git a/sql/sql_class.cc b/sql/sql_class.cc index c829778151b..9dd75b32d5d 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -564,7 +564,7 @@ select_export::prepare(List &list) return 1; } /* Create the file world readable */ - if ((file=my_create(path, 0666, O_WRONLY, MYF(MY_WME))) < 0) + if ((file=my_create(path, 0666, O_WRONLY|O_EXCL, MYF(MY_WME))) < 0) return 1; #ifdef HAVE_FCHMOD (void) fchmod(file,0666); // Because of umask() @@ -803,7 +803,7 @@ select_dump::prepare(List &list __attribute__((unused))) return 1; } /* Create the file world readable */ - if ((file=my_create(path, 0666, O_WRONLY, MYF(MY_WME))) < 0) + if ((file=my_create(path, 0666, O_WRONLY|O_EXCL, MYF(MY_WME))) < 0) return 1; #ifdef HAVE_FCHMOD (void) fchmod(file,0666); // Because of umask() From 9f48eedb4e2251dbc30019ad012cb808385072ab Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 7 Dec 2004 14:08:56 +0300 Subject: [PATCH 0438/1063] Fix for bug #6840: Default value is not checked in ALTER column SET DEFAULT 'x' --- mysql-test/r/type_enum.result | 8 ++++++ mysql-test/t/type_enum.test | 15 ++++++++++- sql/sql_table.cc | 50 ++++++++++++++++++----------------- 3 files changed, 48 insertions(+), 25 deletions(-) diff --git a/mysql-test/r/type_enum.result b/mysql-test/r/type_enum.result index 2ccf32367fb..e5239dcf769 100644 --- a/mysql-test/r/type_enum.result +++ b/mysql-test/r/type_enum.result @@ -1737,3 +1737,11 @@ def test t1 t1 c c 254 3 0 Y 384 0 8 a b c Y NULL NULL drop table t1; +create table t1 (a enum('x','y') default 'x'); +alter table t1 alter a set default 'z'; +ERROR 42000: Invalid default value for 'a' +drop table t1; +create table t1 (a set('x','y') default 'x'); +alter table t1 alter a set default 'z'; +ERROR 42000: Invalid default value for 'a' +drop table t1; diff --git a/mysql-test/t/type_enum.test b/mysql-test/t/type_enum.test index 3a5b12b91e4..6b2183df069 100644 --- a/mysql-test/t/type_enum.test +++ b/mysql-test/t/type_enum.test @@ -111,5 +111,18 @@ alter table t1 add b set ('Y','N') CHARACTER SET utf8 COLLATE utf8_bin; alter table t1 add c enum ('Y','N') CHARACTER SET utf8 COLLATE utf8_bin; --enable_metadata select * from t1; ---disable metadata +--disable_metadata +drop table t1; + +# +# Bug #6840 Default value is not checked in ALTER column SET DEFAULT 'x' +# +create table t1 (a enum('x','y') default 'x'); +--error 1067 +alter table t1 alter a set default 'z'; +drop table t1; + +create table t1 (a set('x','y') default 'x'); +--error 1067 +alter table t1 alter a set default 'z'; drop table t1; diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 12193e8736b..c798760cfa8 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -485,43 +485,45 @@ int mysql_prepare_table(THD *thd, HA_CREATE_INFO *create_info, DBUG_RETURN(-1); } - if ((sql_field->sql_type == FIELD_TYPE_SET || - sql_field->sql_type == FIELD_TYPE_ENUM) && !sql_field->interval) + if (sql_field->sql_type == FIELD_TYPE_SET || + sql_field->sql_type == FIELD_TYPE_ENUM) { uint32 dummy; CHARSET_INFO *cs= sql_field->charset; - TYPELIB *interval; + TYPELIB *interval= sql_field->interval; /* Create typelib from interval_list, and if necessary convert strings from client character set to the column character set. */ - - interval= sql_field->interval= typelib(sql_field->interval_list); - List_iterator it(sql_field->interval_list); - String conv, *tmp; - for (uint i= 0; (tmp= it++); i++) + if (!interval) { - if (String::needs_conversion(tmp->length(), tmp->charset(), cs, &dummy)) + interval= sql_field->interval= typelib(sql_field->interval_list); + List_iterator it(sql_field->interval_list); + String conv, *tmp; + for (uint i= 0; (tmp= it++); i++) { - uint cnv_errs; - conv.copy(tmp->ptr(), tmp->length(), tmp->charset(), cs, &cnv_errs); - char *buf= (char*) sql_alloc(conv.length()+1); - memcpy(buf, conv.ptr(), conv.length()); - buf[conv.length()]= '\0'; - interval->type_names[i]= buf; - interval->type_lengths[i]= conv.length(); + if (String::needs_conversion(tmp->length(), tmp->charset(), + cs, &dummy)) + { + uint cnv_errs; + conv.copy(tmp->ptr(), tmp->length(), tmp->charset(), cs, &cnv_errs); + char *buf= (char*) sql_alloc(conv.length()+1); + memcpy(buf, conv.ptr(), conv.length()); + buf[conv.length()]= '\0'; + interval->type_names[i]= buf; + interval->type_lengths[i]= conv.length(); + } + + // Strip trailing spaces. + uint lengthsp= cs->cset->lengthsp(cs, interval->type_names[i], + interval->type_lengths[i]); + interval->type_lengths[i]= lengthsp; + ((uchar *)interval->type_names[i])[lengthsp]= '\0'; } - - // Strip trailing spaces. - uint lengthsp= cs->cset->lengthsp(cs, interval->type_names[i], - interval->type_lengths[i]); - interval->type_lengths[i]= lengthsp; - ((uchar *)interval->type_names[i])[lengthsp]= '\0'; + sql_field->interval_list.empty(); // Don't need interval_list anymore } - sql_field->interval_list.empty(); // Don't need interval_list anymore - /* Convert the default value from client character From d23c70e9cf0e59a01ca0f8b5681e44bd0bc26759 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 7 Dec 2004 15:13:47 +0300 Subject: [PATCH 0439/1063] merge fix --- mysql-test/r/ps_1general.result | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/ps_1general.result b/mysql-test/r/ps_1general.result index 882fc4783dd..5f8cb2597c6 100644 --- a/mysql-test/r/ps_1general.result +++ b/mysql-test/r/ps_1general.result @@ -273,11 +273,11 @@ t2 1 t2_idx 1 b A NULL NULL NULL YES BTREE prepare stmt4 from ' show table status from test like ''t2%'' '; execute stmt4; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment -t2 MyISAM 9 Fixed 0 0 # # # 0 NULL # # # latin1_swedish_ci NULL +t2 MyISAM 9 Fixed 0 0 0 64424509439 1024 0 NULL # # # latin1_swedish_ci NULL prepare stmt4 from ' show table status from test like ''t9%'' '; execute stmt4; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment -t9 MyISAM 9 Dynamic 2 220 # # # 0 NULL # # # latin1_swedish_ci NULL +t9 MyISAM 9 Dynamic 2 220 440 4294967295 2048 0 NULL # # # latin1_swedish_ci NULL prepare stmt4 from ' show status like ''Threads_running'' '; execute stmt4; Variable_name Value From c68dfe29fb6f31bc48f2ab189032eb7414de7356 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 7 Dec 2004 17:01:46 +0400 Subject: [PATCH 0440/1063] #7066 [Ver]: "ctype_ucs" fails on SGI IRIX --- sql/table.cc | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/sql/table.cc b/sql/table.cc index 370ad5eff1d..992f6df0401 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -495,8 +495,17 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag, char *from, *to; for (from= to= (char*) interval->type_names[pos]; *from; ) { - *to++= (char) (hexchar_to_int(*from++) << 4) + - hexchar_to_int(*from++); + /* + Note, hexchar_to_int(*from++) doesn't work + one some compilers, e.g. IRIX. Looks like a compiler + bug in inline functions in combination with arguments + that have a side effect. So, let's use from[0] and from[1] + and increment 'from' by two later. + */ + + *to++= (char) (hexchar_to_int(from[0]) << 4) + + hexchar_to_int(from[1]); + from+= 2; } interval->type_lengths[pos] /= 2; } From 96d6a116316e15c7684ae1ad8ff639f4e768e9fe Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 7 Dec 2004 15:39:46 +0000 Subject: [PATCH 0441/1063] added returntype BaseString& for ndb_upper and ndb_lower instead of void uppercase printout ndb/include/util/BaseString.hpp: added returntype BaseString& for ndb_upper and ndb_lower instead of void ndb/src/mgmclient/CommandInterpreter.cpp: uppercase printout --- ndb/include/util/BaseString.hpp | 10 ++++++---- ndb/src/mgmclient/CommandInterpreter.cpp | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/ndb/include/util/BaseString.hpp b/ndb/include/util/BaseString.hpp index 066a24f294e..02a6a3b3e66 100644 --- a/ndb/include/util/BaseString.hpp +++ b/ndb/include/util/BaseString.hpp @@ -48,10 +48,10 @@ public: bool empty() const; /** @brief Convert to uppercase */ - void ndb_toupper(); + BaseString& ndb_toupper(); /** @brief Convert to lowercase */ - void ndb_tolower(); + BaseString& ndb_tolower(); /** @brief Assigns from a char * */ BaseString& assign(const char* s); @@ -206,16 +206,18 @@ BaseString::empty() const return m_len == 0; } -inline void +inline BaseString& BaseString::ndb_toupper() { for(unsigned i = 0; i < length(); i++) m_chr[i] = toupper(m_chr[i]); + return *this; } -inline void +inline BaseString& BaseString::ndb_tolower() { for(unsigned i = 0; i < length(); i++) m_chr[i] = tolower(m_chr[i]); + return *this; } inline bool diff --git a/ndb/src/mgmclient/CommandInterpreter.cpp b/ndb/src/mgmclient/CommandInterpreter.cpp index 3a9b3c47376..53c0e3b673e 100644 --- a/ndb/src/mgmclient/CommandInterpreter.cpp +++ b/ndb/src/mgmclient/CommandInterpreter.cpp @@ -1249,7 +1249,7 @@ CommandInterpreter::executeClusterLog(char* parameters) printError(); DBUG_VOID_RETURN; } - ndbout << item << " " << (res_enable ? "enabled":"disabled") << endl; + ndbout << BaseString(item).ndb_toupper().c_str() << " " << (res_enable ? "enabled":"disabled") << endl; item = strtok_r(NULL, " ", &tmpPtr); } while(item != NULL); From 9806e3f057706ba3ed85685d4ba0173038652a09 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 7 Dec 2004 17:10:42 +0100 Subject: [PATCH 0442/1063] Added missing ; --- ndb/src/ndbapi/NdbDictionaryImpl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ndb/src/ndbapi/NdbDictionaryImpl.cpp b/ndb/src/ndbapi/NdbDictionaryImpl.cpp index 393a436ff85..5319e678441 100644 --- a/ndb/src/ndbapi/NdbDictionaryImpl.cpp +++ b/ndb/src/ndbapi/NdbDictionaryImpl.cpp @@ -1432,7 +1432,7 @@ int NdbDictionaryImpl::alterTable(NdbTableImpl &impl) m_globalHash->unlock(); } } - DBUG_RETURN(ret) + DBUG_RETURN(ret); } int From 5c7949af6b3e927854b14889940483b827553197 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 7 Dec 2004 19:12:29 +0200 Subject: [PATCH 0443/1063] Fix for a bug #6996 BitKeeper/etc/ignore: Added analyse.test client/mysqladmin.c to the ignore list libmysql/libmysql.c: Fix for a bug #6996 This fix enables that after all rows are read from a buffered result, mysql_stmt_data_seek(stmt,0) can rewind a counter to the beginning, so that rows can be re-fetched. tests/client_test.c: Addition of a test for fix of the bug #6996 in client_test.c --- .bzrignore | 2 ++ libmysql/libmysql.c | 6 +++++ tests/client_test.c | 62 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 70 insertions(+) diff --git a/.bzrignore b/.bzrignore index 80079b02026..dee0812c9b0 100644 --- a/.bzrignore +++ b/.bzrignore @@ -943,3 +943,5 @@ ac_available_languages_fragment libmysqld/ha_archive.cc libmysqld/ha_example.cc libmysqld/ha_tina.cc +analyse.test +client/mysqladmin.c diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index cb20c5181a8..99fa0299de9 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -4413,6 +4413,12 @@ mysql_stmt_data_seek(MYSQL_STMT *stmt, my_ulonglong row) for (; tmp && row; --row, tmp= tmp->next) ; stmt->data_cursor= tmp; + if (!row && tmp) + { + /* Rewind the counter */ + stmt->read_row_func= stmt_read_row_buffered; + stmt->state= MYSQL_STMT_EXECUTE_DONE; + } DBUG_VOID_RETURN; } diff --git a/tests/client_test.c b/tests/client_test.c index a7fadbd3033..75ce242900a 100644 --- a/tests/client_test.c +++ b/tests/client_test.c @@ -11389,6 +11389,67 @@ static void test_conversion() myquery(rc); } +static void test_rewind(void) +{ + MYSQL_STMT *stmt; + MYSQL_BIND bind; + int rc = 0; + const char *stmt_text; + long unsigned int length=4, Data=0; + my_bool isnull=0; + + myheader("test_rewind"); + + stmt_text= "CREATE TABLE t1 (a int)"; + rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text)); + myquery(rc); + stmt_text= "INSERT INTO t1 VALUES(2),(3),(4)"; + rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text)); + myquery(rc); + + stmt= mysql_stmt_init(mysql); + + stmt_text= "SELECT * FROM t1"; + rc= mysql_stmt_prepare(stmt, stmt_text, strlen(stmt_text)); + check_execute(stmt, rc); + + bzero(&bind,sizeof(MYSQL_BIND)); + bind.buffer_type= MYSQL_TYPE_LONG; + bind.buffer= (void *)&Data; /* this buffer won't be altered */ + bind.length= &length; + bind.is_null= &isnull; + + rc= mysql_stmt_execute(stmt); + check_execute(stmt, rc); + + rc= mysql_stmt_store_result(stmt); + DIE_UNLESS(rc == 0); + + rc= mysql_stmt_bind_result(stmt, &bind); + DIE_UNLESS(rc == 0); + + /* retreive all result sets till we are at the end */ + while(!mysql_stmt_fetch(stmt)) + printf("fetched result:%ld\n", Data); + + DIE_UNLESS(rc != MYSQL_NO_DATA); + + /* seek to the first row */ + mysql_stmt_data_seek(stmt, 0); + + /* now we should be able to fetch the results again */ + /* but mysql_stmt_fetch returns MYSQL_NO_DATA */ + while(!(rc= mysql_stmt_fetch(stmt))) + printf("fetched result after seek:%ld\n", Data); + + DIE_UNLESS(rc == MYSQL_NO_DATA); + + stmt_text= "DROP TABLE t1"; + rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text)); + myquery(rc); + rc= mysql_stmt_free_result(stmt); + rc= mysql_stmt_close(stmt); +} /* Read and parse arguments and MySQL options from my.cnf @@ -11594,6 +11655,7 @@ static struct my_tests_st my_tests[]= { { "test_datetime_ranges", test_datetime_ranges }, { "test_bug4172", test_bug4172 }, { "test_conversion", test_conversion }, + { "test_rewind", test_rewind }, { 0, 0 } }; From 86f19614e1c07b1e3e540d082c137edad80b9f44 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 7 Dec 2004 21:18:15 +0200 Subject: [PATCH 0444/1063] postreview fix sql/item_cmpfunc.cc: comment fixed sql/item_subselect.cc: comment fixed debug info and inherited method call sql/item_subselect.h: comment fixed sql/item_sum.cc: comment fixed sql/item_sum.h: comment fixed --- sql/item_cmpfunc.cc | 4 +++- sql/item_subselect.cc | 9 +++++++-- sql/item_subselect.h | 2 +- sql/item_sum.cc | 4 +++- sql/item_sum.h | 2 +- 5 files changed, 15 insertions(+), 6 deletions(-) diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index c6ac1651118..51212418b09 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -146,7 +146,9 @@ void Item_func_not_all::print(String *str) /* - special NOP for ALL subquery + Special NOP (No OPeration) for ALL subquery it is like Item_func_not_all + (return TRUE if underlaying sudquery do not return rows) but if subquery + returns some rows it return same value as argument (TRUE/FALSE). */ longlong Item_func_nop_all::val_int() diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index b263b06c91f..1265d0b3557 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -292,14 +292,19 @@ Item_maxmin_subselect::Item_maxmin_subselect(Item_subselect *parent, void Item_maxmin_subselect::cleanup() { + DBUG_ENTER("Item_maxmin_subselect::cleanup"); + Item_singlerow_subselect::cleanup(); + /* - By default is is TRUE to avoid TRUE reporting by + By default it is TRUE to avoid TRUE reporting by Item_func_not_all/Item_func_nop_all if this item was never called. Engine exec() set it to FALSE by reset_value_registration() call. + select_max_min_finder_subselect::send_data() set it back to TRUE if some + value will be found. */ - was_values= TRUE; + DBUG_VOID_RETURN; } diff --git a/sql/item_subselect.h b/sql/item_subselect.h index bd6ede49255..ab2d441ed7a 100644 --- a/sql/item_subselect.h +++ b/sql/item_subselect.h @@ -160,7 +160,7 @@ class Item_maxmin_subselect :public Item_singlerow_subselect { protected: bool max; - bool was_values; // was checked at least some values + bool was_values; // Set if we have found at least one row public: Item_maxmin_subselect(Item_subselect *parent, st_select_lex *select_lex, bool max); diff --git a/sql/item_sum.cc b/sql/item_sum.cc index 7bc70052920..66d4fba205c 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -537,11 +537,13 @@ void Item_sum_hybrid::cleanup() DBUG_ENTER("Item_sum_hybrid::cleanup"); Item_sum::cleanup(); used_table_cache= ~(table_map) 0; + /* - by default is is TRUE to avoid TRUE reporting by + by default it is TRUE to avoid TRUE reporting by Item_func_not_all/Item_func_nop_all if this item was never called. no_rows_in_result() set it to FALSE if was not results found. + If some results found it will be left unchanged. */ was_values= TRUE; DBUG_VOID_RETURN; diff --git a/sql/item_sum.h b/sql/item_sum.h index e718c885d4a..cec611b8854 100644 --- a/sql/item_sum.h +++ b/sql/item_sum.h @@ -402,7 +402,7 @@ class Item_sum_hybrid :public Item_sum enum_field_types hybrid_field_type; int cmp_sign; table_map used_table_cache; - bool was_values; // was checked at least some values (for max/min only) + bool was_values; // Set if we have found at least one row (for max/min only) public: Item_sum_hybrid(Item *item_par,int sign) From d74a3faf240023e6f674a502b6915fcccf34c726 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 7 Dec 2004 21:57:54 +0200 Subject: [PATCH 0445/1063] Fixed Bug#7043, "SHOW CREATE TABLE security hole". --- sql/sql_parse.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 0e32097266d..73f65449f55 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -2600,7 +2600,9 @@ unsent_create_error: check_access(thd, SELECT_ACL | EXTRA_ACL, tables->db, &tables->grant.privilege,0,0)) goto error; - res = mysqld_show_create(thd, tables); + if (grant_option && check_grant(thd, SELECT_ACL, tables, 2, UINT_MAX, 0)) + goto error; + res= mysqld_show_create(thd, tables); break; } #endif From 27c6192e82bffc5f340d548b987eac17fdb86494 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 7 Dec 2004 21:41:29 +0100 Subject: [PATCH 0446/1063] allocate a buffer large enough for a longer matching string --- myisam/ft_boolean_search.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/myisam/ft_boolean_search.c b/myisam/ft_boolean_search.c index c432ac5a16c..ffc7e1bf104 100644 --- a/myisam/ft_boolean_search.c +++ b/myisam/ft_boolean_search.c @@ -155,7 +155,7 @@ static void _ftb_parse_query(FTB *ftb, byte **start, byte *end, ftbw=(FTB_WORD *)alloc_root(&ftb->mem_root, sizeof(FTB_WORD) + (param.trunc ? MI_MAX_KEY_BUFF : - w.len+extra)); + w.len*ftb->charset->mbmaxlen+extra)); ftbw->len=w.len+1; ftbw->flags=0; ftbw->off=0; From c23f6444203afadeb212225d2a8b208b459401de Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 8 Dec 2004 01:34:50 +0300 Subject: [PATCH 0447/1063] A followup to Bug#6878 "Crash with engine=memory", reported as Bug#6986 ""show_check" fails on 64bit platforms": now minimal rec_length of a HEAP table >= sizeof(void*), hence it's platform-dependant. mysql-test/r/show_check.result: Fix test results for 64-bit platforms. mysql-test/t/show_check.test: Ignore two more columns of output of show table status: it's different on 64-bit and 32-bit platforms. --- mysql-test/r/show_check.result | 42 +++++++++++++++++----------------- mysql-test/t/show_check.test | 14 ++++++------ 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result index 8256c8d692a..0afe45eb5e5 100644 --- a/mysql-test/r/show_check.result +++ b/mysql-test/r/show_check.result @@ -314,57 +314,57 @@ insert into t2 values (1),(2); insert into t3 values (1,1),(2,2); show table status; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment -t1 HEAP 9 Fixed 2 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL -t2 HEAP 9 Fixed 2 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL -t3 HEAP 9 Fixed 2 9 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t1 HEAP 9 Fixed 2 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t2 HEAP 9 Fixed 2 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t3 HEAP 9 Fixed 2 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL insert into t1 values (3),(4); insert into t2 values (3),(4); insert into t3 values (3,3),(4,4); show table status; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment -t1 HEAP 9 Fixed 4 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL -t2 HEAP 9 Fixed 4 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL -t3 HEAP 9 Fixed 4 9 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t1 HEAP 9 Fixed 4 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t2 HEAP 9 Fixed 4 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t3 HEAP 9 Fixed 4 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL insert into t1 values (5); insert into t2 values (5); insert into t3 values (5,5); show table status; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment -t1 HEAP 9 Fixed 5 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL -t2 HEAP 9 Fixed 5 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL -t3 HEAP 9 Fixed 5 9 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t1 HEAP 9 Fixed 5 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t2 HEAP 9 Fixed 5 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t3 HEAP 9 Fixed 5 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL delete from t1 where a=3; delete from t2 where b=3; delete from t3 where a=3; show table status; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment -t1 HEAP 9 Fixed 4 5 # # # 5 NULL NULL NULL NULL latin1_swedish_ci NULL -t2 HEAP 9 Fixed 4 5 # # # 5 NULL NULL NULL NULL latin1_swedish_ci NULL -t3 HEAP 9 Fixed 4 9 # # # 9 NULL NULL NULL NULL latin1_swedish_ci NULL +t1 HEAP 9 Fixed 4 # # # # # NULL NULL NULL NULL latin1_swedish_ci NULL +t2 HEAP 9 Fixed 4 # # # # # NULL NULL NULL NULL latin1_swedish_ci NULL +t3 HEAP 9 Fixed 4 # # # # # NULL NULL NULL NULL latin1_swedish_ci NULL delete from t1; delete from t2; delete from t3; show table status; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment -t1 HEAP 9 Fixed 0 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL -t2 HEAP 9 Fixed 0 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL -t3 HEAP 9 Fixed 0 9 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t1 HEAP 9 Fixed 0 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t2 HEAP 9 Fixed 0 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t3 HEAP 9 Fixed 0 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL insert into t1 values (5); insert into t2 values (5); insert into t3 values (5,5); show table status; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment -t1 HEAP 9 Fixed 1 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL -t2 HEAP 9 Fixed 1 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL -t3 HEAP 9 Fixed 1 9 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t1 HEAP 9 Fixed 1 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t2 HEAP 9 Fixed 1 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL +t3 HEAP 9 Fixed 1 # # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL delete from t1 where a=5; delete from t2 where b=5; delete from t3 where a=5; show table status; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment -t1 HEAP 9 Fixed 0 5 # # # 5 NULL NULL NULL NULL latin1_swedish_ci NULL -t2 HEAP 9 Fixed 0 5 # # # 5 NULL NULL NULL NULL latin1_swedish_ci NULL -t3 HEAP 9 Fixed 0 9 # # # 9 NULL NULL NULL NULL latin1_swedish_ci NULL +t1 HEAP 9 Fixed 0 # # # # # NULL NULL NULL NULL latin1_swedish_ci NULL +t2 HEAP 9 Fixed 0 # # # # # NULL NULL NULL NULL latin1_swedish_ci NULL +t3 HEAP 9 Fixed 0 # # # # # NULL NULL NULL NULL latin1_swedish_ci NULL drop table t1, t2, t3; create database mysqltest; show create database mysqltest; diff --git a/mysql-test/t/show_check.test b/mysql-test/t/show_check.test index efbe2e9371d..7788215dd27 100644 --- a/mysql-test/t/show_check.test +++ b/mysql-test/t/show_check.test @@ -228,37 +228,37 @@ CREATE TABLE t3 ( insert into t1 values (1),(2); insert into t2 values (1),(2); insert into t3 values (1,1),(2,2); ---replace_column 7 # 8 # 9 # +--replace_column 6 # 7 # 8 # 9 # show table status; insert into t1 values (3),(4); insert into t2 values (3),(4); insert into t3 values (3,3),(4,4); ---replace_column 7 # 8 # 9 # +--replace_column 6 # 7 # 8 # 9 # show table status; insert into t1 values (5); insert into t2 values (5); insert into t3 values (5,5); ---replace_column 7 # 8 # 9 # +--replace_column 6 # 7 # 8 # 9 # show table status; delete from t1 where a=3; delete from t2 where b=3; delete from t3 where a=3; ---replace_column 7 # 8 # 9 # +--replace_column 6 # 7 # 8 # 9 # 10 # show table status; delete from t1; delete from t2; delete from t3; ---replace_column 7 # 8 # 9 # +--replace_column 6 # 7 # 8 # 9 # show table status; insert into t1 values (5); insert into t2 values (5); insert into t3 values (5,5); ---replace_column 7 # 8 # 9 # +--replace_column 6 # 7 # 8 # 9 # show table status; delete from t1 where a=5; delete from t2 where b=5; delete from t3 where a=5; ---replace_column 7 # 8 # 9 # +--replace_column 6 # 7 # 8 # 9 # 10 # show table status; drop table t1, t2, t3; From b89ef30962f3f5cc30c5a9cf6ea7ae4a034b48f0 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 8 Dec 2004 14:24:59 +0000 Subject: [PATCH 0448/1063] bug #7104 + some extra debug printouts mysql-test/ndb/ndbcluster.sh: fixed debug flag in ndbcluster start script ndb/include/debugger/EventLogger.hpp: bug #7104 ndb/include/kernel/LogLevel.hpp: bug #7104 ndb/src/common/debugger/EventLogger.cpp: bug #7104 ndb/src/common/portlib/NdbTCP.cpp: removed debug printout in Ndb_getInAddr ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp: bug #7104 ndb/src/mgmapi/mgmapi.cpp: bug #7104 ndb/src/mgmsrv/MgmtSrvr.cpp: bug #7104 ndb/src/mgmsrv/MgmtSrvr.hpp: bug #7104 ndb/src/mgmsrv/Services.cpp: bug #7104 ndb/src/ndbapi/TransporterFacade.cpp: bug #7104 --- mysql-test/ndb/ndbcluster.sh | 3 +- ndb/include/debugger/EventLogger.hpp | 5 ++ ndb/include/kernel/LogLevel.hpp | 12 +++-- ndb/src/common/debugger/EventLogger.cpp | 35 ++++++++++---- ndb/src/common/portlib/NdbTCP.cpp | 12 ++--- ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp | 23 ++++----- ndb/src/mgmapi/mgmapi.cpp | 7 ++- ndb/src/mgmsrv/MgmtSrvr.cpp | 34 ++++++------- ndb/src/mgmsrv/MgmtSrvr.hpp | 19 ++++---- ndb/src/mgmsrv/Services.cpp | 63 +++++++++++++++---------- ndb/src/ndbapi/TransporterFacade.cpp | 4 ++ 11 files changed, 129 insertions(+), 88 deletions(-) diff --git a/mysql-test/ndb/ndbcluster.sh b/mysql-test/ndb/ndbcluster.sh index 60188705857..fbef16c140b 100644 --- a/mysql-test/ndb/ndbcluster.sh +++ b/mysql-test/ndb/ndbcluster.sh @@ -67,8 +67,7 @@ while test $# -gt 0; do initial_ndb=1 ;; --debug*) - f=`echo "$1" | sed -e "s;--debug=;;"` - flags_ndb="$flags_ndb $f" + flags_ndb="$flags_ndb $1" ;; --status) status_ndb=1 diff --git a/ndb/include/debugger/EventLogger.hpp b/ndb/include/debugger/EventLogger.hpp index 686989089ae..b82c823ee0b 100644 --- a/ndb/include/debugger/EventLogger.hpp +++ b/ndb/include/debugger/EventLogger.hpp @@ -48,6 +48,11 @@ public: static const EventRepLogLevelMatrix matrix[]; static const Uint32 matrixSize; + static int + EventLoggerBase::event_lookup(int eventType, + LogLevel::EventCategory &cat, + Uint32 &threshold, + Logger::LoggerLevel &severity); }; /** diff --git a/ndb/include/kernel/LogLevel.hpp b/ndb/include/kernel/LogLevel.hpp index 467f0604edd..0ff4386da8e 100644 --- a/ndb/include/kernel/LogLevel.hpp +++ b/ndb/include/kernel/LogLevel.hpp @@ -73,7 +73,7 @@ public: /** * Note level is valid as 0-15 */ - void setLogLevel(EventCategory ec, Uint32 level = 7); + int setLogLevel(EventCategory ec, Uint32 level = 7); /** * Get the loglevel (0-15) for a category @@ -119,10 +119,14 @@ LogLevel::clear(){ } inline -void +int LogLevel::setLogLevel(EventCategory ec, Uint32 level){ - assert(ec >= 0 && (Uint32) ec < LOGLEVEL_CATEGORIES); - logLevelData[ec] = (Uint8)level; + if (ec >= 0 && (Uint32) ec < LOGLEVEL_CATEGORIES) + { + logLevelData[ec] = (Uint8)level; + return 0; + } + return 1; } inline diff --git a/ndb/src/common/debugger/EventLogger.cpp b/ndb/src/common/debugger/EventLogger.cpp index 59be0affcb4..8bb797b7855 100644 --- a/ndb/src/common/debugger/EventLogger.cpp +++ b/ndb/src/common/debugger/EventLogger.cpp @@ -1342,6 +1342,23 @@ operator<<(NdbOut& out, const LogLevel & ll) return out; } +int +EventLoggerBase::event_lookup(int eventType, + LogLevel::EventCategory &cat, + Uint32 &threshold, + Logger::LoggerLevel &severity) +{ + for(unsigned i = 0; igetLogLevel(cat) : m_logLevel.getLogLevel(cat); + DBUG_PRINT("info",("threshold=%d, set=%d", threshold, set)); + if (ll) + DBUG_PRINT("info",("m_logLevel.getLogLevel=%d", m_logLevel.getLogLevel(cat))); if (threshold <= set){ switch (severity){ case Logger::LL_ALERT: @@ -1401,6 +1415,7 @@ EventLogger::log(int eventType, const Uint32* theData, NodeId nodeId, break; } } // if (.. + DBUG_VOID_RETURN; } int diff --git a/ndb/src/common/portlib/NdbTCP.cpp b/ndb/src/common/portlib/NdbTCP.cpp index 35b0c8c21e4..a63f5a7ba27 100644 --- a/ndb/src/common/portlib/NdbTCP.cpp +++ b/ndb/src/common/portlib/NdbTCP.cpp @@ -22,7 +22,7 @@ extern "C" int Ndb_getInAddr(struct in_addr * dst, const char *address) { - DBUG_ENTER("Ndb_getInAddr"); + // DBUG_ENTER("Ndb_getInAddr"); { int tmp_errno; struct hostent tmp_hostent, *hp; @@ -33,7 +33,7 @@ Ndb_getInAddr(struct in_addr * dst, const char *address) { { memcpy(dst, hp->h_addr, min(sizeof(*dst), (size_t) hp->h_length)); my_gethostbyname_r_free(); - DBUG_RETURN(0); + return 0; //DBUG_RETURN(0); } my_gethostbyname_r_free(); } @@ -47,11 +47,11 @@ Ndb_getInAddr(struct in_addr * dst, const char *address) { #endif ) { - DBUG_RETURN(0); + return 0; //DBUG_RETURN(0); } - DBUG_PRINT("error",("inet_addr(%s) - %d - %s", - address, errno, strerror(errno))); - DBUG_RETURN(-1); + // DBUG_PRINT("error",("inet_addr(%s) - %d - %s", + // address, errno, strerror(errno))); + return -1; //DBUG_RETURN(-1); } #if 0 diff --git a/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp b/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp index 234d832655c..af8668180f9 100644 --- a/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp +++ b/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp @@ -193,21 +193,11 @@ void Cmvmi::execEVENT_REP(Signal* signal) /** * If entry is not found */ - Uint32 threshold = 16; - LogLevel::EventCategory eventCategory = (LogLevel::EventCategory)0; - - for(unsigned int i = 0; i< EventLoggerBase::matrixSize; i++){ - if(EventLoggerBase::matrix[i].eventType == eventType){ - eventCategory = EventLoggerBase::matrix[i].eventCategory; - threshold = EventLoggerBase::matrix[i].threshold; - break; - } - } - - if(threshold > 15){ - // No entry found in matrix (or event that should never be printed) + Uint32 threshold; + LogLevel::EventCategory eventCategory; + Logger::LoggerLevel severity; + if (EventLoggerBase::event_lookup(eventType,eventCategory,threshold,severity)) return; - } SubscriberPtr ptr; for(subscribers.first(ptr); ptr.i != RNIL; subscribers.next(ptr)){ @@ -225,14 +215,15 @@ void Cmvmi::execEVENT_REP(Signal* signal) // Print the event info g_eventLogger.log(eventReport->getEventType(), signal->theData); + return; }//execEVENT_REP() void Cmvmi::execEVENT_SUBSCRIBE_REQ(Signal * signal){ EventSubscribeReq * subReq = (EventSubscribeReq *)&signal->theData[0]; SubscriberPtr ptr; - jamEntry(); + DBUG_ENTER("Cmvmi::execEVENT_SUBSCRIBE_REQ"); /** * Search for subcription @@ -269,11 +260,13 @@ Cmvmi::execEVENT_SUBSCRIBE_REQ(Signal * signal){ category = (LogLevel::EventCategory)(subReq->theData[i] >> 16); level = subReq->theData[i] & 0xFFFF; ptr.p->logLevel.setLogLevel(category, level); + DBUG_PRINT("info",("entry %d: level=%d, category= %d", i, level, category)); } } signal->theData[0] = ptr.i; sendSignal(ptr.p->blockRef, GSN_EVENT_SUBSCRIBE_CONF, signal, 1, JBB); + DBUG_VOID_RETURN; } void diff --git a/ndb/src/mgmapi/mgmapi.cpp b/ndb/src/mgmapi/mgmapi.cpp index 59ab6c00258..1a4a10f9421 100644 --- a/ndb/src/mgmapi/mgmapi.cpp +++ b/ndb/src/mgmapi/mgmapi.cpp @@ -1102,15 +1102,18 @@ ndb_mgm_set_loglevel_clusterlog(NdbMgmHandle handle, int nodeId, "set cluster loglevel", &args); CHECK_REPLY(reply, -1); + DBUG_ENTER("ndb_mgm_set_loglevel_clusterlog"); + DBUG_PRINT("enter",("node=%d, category=%d, level=%d", nodeId, cat, level)); + BaseString result; reply->get("result", result); if(strcmp(result.c_str(), "Ok") != 0) { SET_ERROR(handle, EINVAL, result.c_str()); delete reply; - return -1; + DBUG_RETURN(-1); } delete reply; - return 0; + DBUG_RETURN(0); } extern "C" diff --git a/ndb/src/mgmsrv/MgmtSrvr.cpp b/ndb/src/mgmsrv/MgmtSrvr.cpp index 4a9bfac3b6c..7497c517931 100644 --- a/ndb/src/mgmsrv/MgmtSrvr.cpp +++ b/ndb/src/mgmsrv/MgmtSrvr.cpp @@ -153,7 +153,7 @@ MgmtSrvr::logLevelThreadRun() * Handle started nodes */ EventSubscribeReq req; - req = m_statisticsListner.m_clients[0].m_logLevel; + req = m_event_listner[0].m_logLevel; req.blockRef = _ownReference; SetLogLevelOrd ord; @@ -409,7 +409,7 @@ MgmtSrvr::MgmtSrvr(SocketServer *socket_server, _ownReference(0), theSignalIdleList(NULL), theWaitState(WAIT_SUBSCRIBE_CONF), - m_statisticsListner(this) + m_event_listner(this) { DBUG_ENTER("MgmtSrvr::MgmtSrvr"); @@ -547,16 +547,18 @@ MgmtSrvr::MgmtSrvr(SocketServer *socket_server, } } + // Setup clusterlog as client[0] in m_event_listner { - MgmStatService::StatListener se; + Ndb_mgmd_event_service::Event_listener se; se.m_socket = -1; for(size_t t = 0; thandleStatus(nodeId, alive); + DBUG_VOID_RETURN; } enum ndb_mgm_node_type @@ -2386,8 +2388,8 @@ MgmtSrvr::eventReport(NodeId nodeId, const Uint32 * theData) EventReport::EventType type = eventReport->getEventType(); // Log event g_EventLogger.log(type, theData, nodeId, - &m_statisticsListner.m_clients[0].m_logLevel); - m_statisticsListner.log(type, theData, nodeId); + &m_event_listner[0].m_logLevel); + m_event_listner.log(type, theData, nodeId); } /*************************************************************************** @@ -2740,5 +2742,5 @@ template bool SignalQueue::waitFor(Vector&, SigMatch*&, NdbA #endif template class MutexVector; -template class MutexVector; +template class MutexVector; template class MutexVector; diff --git a/ndb/src/mgmsrv/MgmtSrvr.hpp b/ndb/src/mgmsrv/MgmtSrvr.hpp index 4d5631d3eb6..0cad99e9d86 100644 --- a/ndb/src/mgmsrv/MgmtSrvr.hpp +++ b/ndb/src/mgmsrv/MgmtSrvr.hpp @@ -43,27 +43,30 @@ class Config; class SetLogLevelOrd; class SocketServer; -class MgmStatService : public EventLoggerBase +class Ndb_mgmd_event_service : public EventLoggerBase { friend class MgmtSrvr; public: - struct StatListener : public EventLoggerBase { + struct Event_listener : public EventLoggerBase { NDB_SOCKET_TYPE m_socket; }; private: class MgmtSrvr * m_mgmsrv; - MutexVector m_clients; + MutexVector m_clients; public: - MgmStatService(class MgmtSrvr * m) : m_clients(5) { + Ndb_mgmd_event_service(class MgmtSrvr * m) : m_clients(5) { m_mgmsrv = m; } - void add_listener(const StatListener&); + void add_listener(const Event_listener&); void log(int eventType, const Uint32* theData, NodeId nodeId); - void stopSessions(); + void stop_sessions(); + + Event_listener& operator[](unsigned i) { return m_clients[i]; } + const Event_listener& operator[](unsigned i) const { return m_clients[i]; } }; /** @@ -732,8 +735,8 @@ private: LogLevel m_nodeLogLevel[MAX_NODES]; enum ndb_mgm_node_type nodeTypes[MAX_NODES]; friend class MgmApiSession; - friend class MgmStatService; - MgmStatService m_statisticsListner; + friend class Ndb_mgmd_event_service; + Ndb_mgmd_event_service m_event_listner; /** * Handles the thread wich upon a 'Node is started' event will diff --git a/ndb/src/mgmsrv/Services.cpp b/ndb/src/mgmsrv/Services.cpp index 6ba2663c335..5b8d12e44d5 100644 --- a/ndb/src/mgmsrv/Services.cpp +++ b/ndb/src/mgmsrv/Services.cpp @@ -208,12 +208,12 @@ ParserRow commands[] = { MGM_CMD("set loglevel", &MgmApiSession::setLogLevel, ""), MGM_ARG("node", Int, Mandatory, "Node"), - MGM_ARG("category", String, Mandatory, "Event category"), + MGM_ARG("category", Int, Mandatory, "Event category"), MGM_ARG("level", Int, Mandatory, "Log level (0-15)"), MGM_CMD("set cluster loglevel", &MgmApiSession::setClusterLogLevel, ""), MGM_ARG("node", Int, Mandatory, "Node"), - MGM_ARG("category", String, Mandatory, "Event category"), + MGM_ARG("category", Int, Mandatory, "Event category"), MGM_ARG("level", Int, Mandatory, "Log level (0-15)"), MGM_CMD("set logfilter", &MgmApiSession::setLogFilter, ""), @@ -781,20 +781,35 @@ MgmApiSession::bye(Parser::Context &, void MgmApiSession::setClusterLogLevel(Parser::Context &, Properties const &args) { - Uint32 node, level, category; + const char *reply= "set cluster loglevel reply"; + Uint32 node, level, cat; BaseString errorString; SetLogLevelOrd logLevel; int result; + DBUG_ENTER("MgmApiSession::setClusterLogLevel"); args.get("node", &node); - args.get("category", &category); + args.get("category", &cat); args.get("level", &level); + DBUG_PRINT("enter",("node=%d, category=%d, level=%d", node, cat, level)); + /* XXX should use constants for this value */ if(level > 15) { - m_output->println("set cluster loglevel reply"); - m_output->println("result: Invalid loglevel"); + m_output->println(reply); + m_output->println("result: Invalid loglevel %d", level); m_output->println(""); - return; + DBUG_VOID_RETURN; + } + + LogLevel::EventCategory category= + (LogLevel::EventCategory)(cat-(int)CFG_MIN_LOGLEVEL); + + if (m_mgmsrv.m_event_listner[0].m_logLevel.setLogLevel(category,level)) + { + m_output->println(reply); + m_output->println("result: Invalid category %d", category); + m_output->println(""); + DBUG_VOID_RETURN; } EventSubscribeReq req; @@ -802,10 +817,11 @@ MgmApiSession::setClusterLogLevel(Parser::Context &, req.noOfEntries = 1; req.theData[0] = (category << 16) | level; m_mgmsrv.m_log_level_requests.push_back(req); - - m_output->println("set cluster loglevel reply"); + + m_output->println(reply); m_output->println("result: Ok"); m_output->println(""); + DBUG_VOID_RETURN; } void @@ -1263,21 +1279,17 @@ operator<<(NdbOut& out, const LogLevel & ll) } void -MgmStatService::log(int eventType, const Uint32* theData, NodeId nodeId){ +Ndb_mgmd_event_service::log(int eventType, const Uint32* theData, NodeId nodeId){ - Uint32 threshold = 0; - LogLevel::EventCategory cat= LogLevel::llInvalid; + Uint32 threshold; + LogLevel::EventCategory cat; + Logger::LoggerLevel severity; int i; + DBUG_ENTER("Ndb_mgmd_event_service::log"); + DBUG_PRINT("enter",("eventType=%d, nodeid=%d", eventType, nodeId)); - for(i = 0; (unsigned)im_log_level_requests.push_back(req); } } + DBUG_VOID_RETURN; } void -MgmStatService::add_listener(const StatListener& client){ +Ndb_mgmd_event_service::add_listener(const Event_listener& client){ m_clients.push_back(client); LogLevel tmp = m_logLevel; tmp.set_max(client.m_logLevel); @@ -1334,7 +1347,7 @@ MgmStatService::add_listener(const StatListener& client){ } void -MgmStatService::stopSessions(){ +Ndb_mgmd_event_service::stop_sessions(){ for(int i = m_clients.size() - 1; i >= 0; i--){ if(m_clients[i].m_socket >= 0){ NDB_CLOSE_SOCKET(m_clients[i].m_socket); @@ -1374,7 +1387,7 @@ MgmApiSession::listen_event(Parser::Context & ctx, int result = 0; BaseString msg; - MgmStatService::StatListener le; + Ndb_mgmd_event_service::Event_listener le; le.m_socket = m_socket; Vector list; @@ -1419,7 +1432,7 @@ MgmApiSession::listen_event(Parser::Context & ctx, goto done; } - m_mgmsrv.m_statisticsListner.add_listener(le); + m_mgmsrv.m_event_listner.add_listener(le); m_stop = true; m_socket = -1; diff --git a/ndb/src/ndbapi/TransporterFacade.cpp b/ndb/src/ndbapi/TransporterFacade.cpp index dfb090c8416..031ee6315e8 100644 --- a/ndb/src/ndbapi/TransporterFacade.cpp +++ b/ndb/src/ndbapi/TransporterFacade.cpp @@ -626,6 +626,9 @@ TransporterFacade::ReportNodeFailureComplete(NodeId tNodeId) * After the restart the node is up again and the Ndb object * might not have noticed the failure. */ + + DBUG_ENTER("TransporterFacade::ReportNodeFailureComplete"); + DBUG_PRINT("enter",("nodeid= %d", tNodeId)); Uint32 sz = m_threads.m_statusNext.size(); for (Uint32 i = 0; i < sz ; i ++) { if (m_threads.getInUse(i)){ @@ -634,6 +637,7 @@ TransporterFacade::ReportNodeFailureComplete(NodeId tNodeId) (*RegPC) (obj, tNodeId, false, true); } } + DBUG_VOID_RETURN; } void From 433430f4a2549dfd1691da3a4df7c39429211013 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 8 Dec 2004 17:53:01 +0200 Subject: [PATCH 0449/1063] os0file.c: Print a better error message to the .err log if InnoDB's advisory file locking fails innobase/os/os0file.c: Print a better error message to the .err log if InnoDB's advisory file locking fails --- innobase/os/os0file.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/innobase/os/os0file.c b/innobase/os/os0file.c index 8b9a0582781..5aa6fe37f26 100644 --- a/innobase/os/os0file.c +++ b/innobase/os/os0file.c @@ -394,10 +394,19 @@ os_file_lock( lk.l_start = lk.l_len = 0; if (fcntl(fd, F_SETLK, &lk) == -1) { fprintf(stderr, - "InnoDB: Unable to lock %s, error: %d", name, errno); + "InnoDB: Unable to lock %s, error: %d\n", name, errno); + + if (errno == EAGAIN || errno == EACCES) { + fprintf(stderr, +"InnoDB: Check that you do not already have another mysqld process\n" +"InnoDB: using the same InnoDB data or log files.\n"); + } + close(fd); + return(-1); } + return(0); } #endif /* USE_FILE_LOCK */ From b5e844468cff742173c42e418cbf12532739ec2d Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 8 Dec 2004 19:34:11 +0100 Subject: [PATCH 0450/1063] - added two new options to Do-compile: --ps-test: run the test suite using prepared statements --embedded-test: run the test suite against the embedded server Build-tools/Do-compile: - added two new options: --ps-test: run the test suite using prepared statements --embedded-test: run the test suite against the embedded server --- Build-tools/Do-compile | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/Build-tools/Do-compile b/Build-tools/Do-compile index f8e91efd70d..da2be90a428 100755 --- a/Build-tools/Do-compile +++ b/Build-tools/Do-compile @@ -11,7 +11,7 @@ $opt_distribution=$opt_user=$opt_config_env=$opt_config_extra_env=""; $opt_dbd_options=$opt_perl_options=$opt_config_options=$opt_make_options=$opt_suffix=""; $opt_tmp=$opt_version_suffix=""; $opt_bundled_zlib=$opt_help=$opt_delete=$opt_debug=$opt_stage=$opt_no_test=$opt_no_perl=$opt_one_error=$opt_with_low_memory=$opt_fast_benchmark=$opt_static_client=$opt_static_server=$opt_static_perl=$opt_sur=$opt_with_small_disk=$opt_local_perl=$opt_tcpip=$opt_build_thread=$opt_use_old_distribution=$opt_enable_shared=$opt_no_crash_me=$opt_no_strip=$opt_with_archive=$opt_with_cluster=$opt_with_debug=$opt_no_benchmark=$opt_no_mysqltest=$opt_without_embedded=$opt_readline=0; -$opt_innodb=$opt_bdb=$opt_raid=$opt_libwrap=$opt_clearlogs=0; +$opt_embedded_test=$opt_ps_test=$opt_innodb=$opt_bdb=$opt_raid=$opt_libwrap=$opt_clearlogs=0; GetOptions( "bdb", @@ -25,6 +25,7 @@ GetOptions( "delete", "distribution=s", "enable-shared", + "embedded-test", "fast-benchmark", "help|Information", "innodb", @@ -40,6 +41,7 @@ GetOptions( "one-error", "perl-files=s", "perl-options=s", + "ps-test", "raid", "readline", "stage=i", @@ -274,6 +276,7 @@ if ($opt_stage <= 1) $opt_config_options.= " --with-libedit"; } $opt_config_options.= " --with-embedded-server" unless ($opt_without_embedded); + $opt_embedded_test= 0 if ($opt_without_embedded); $opt_config_options.= " --with-archive-storage-engine" if ($opt_with_archive); $opt_config_options.= " --with-ndbcluster" if ($opt_with_cluster); @@ -376,13 +379,29 @@ $ENV{"LD_LIBRARY_PATH"}= ("$test_dir/lib" . if ($opt_stage <= 5 && !$opt_no_test && !$opt_no_mysqltest) { my $flags= ""; - my $force= ""; $flags.= " --with-ndbcluster" if ($opt_with_cluster); $flags.= " --force" if (!$opt_one_error); log_timestamp(); + info("Running test suite"); system("mkdir $bench_tmpdir") if (! -d $bench_tmpdir); safe_cd("${test_dir}/mysql-test"); check_system("./mysql-test-run $flags --tmpdir=$bench_tmpdir --master_port=$mysql_tcp_port --slave_port=$slave_port --ndbcluster_port=$ndbcluster_port --manager-port=$manager_port --no-manager --sleep=10", "tests were successful"); + + if ($opt_ps_test) + { + log_timestamp(); + info("Running test suite using prepared statements"); + check_system("./mysql-test-run $flags --ps-protocol --tmpdir=$bench_tmpdir --master_port=$mysql_tcp_port --slave_port=$slave_port --ndbcluster_port=$ndbcluster_port --manager-port=$manager_port --no-manager --sleep=10", "tests were successful"); + } + + if ($opt_embedded_test) + { + log_timestamp(); + info("Running embedded server test suite"); + # Embedded server and NDB don't jive + $flags=~ s/ --with-ndbcluster//; + check_system("./mysql-test-run $flags --embedded-server --tmpdir=$bench_tmpdir --master_port=$mysql_tcp_port --slave_port=$slave_port --manager-port=$manager_port --no-manager --sleep=10", "tests were successful"); + } # 'mysql-test-run' writes its own final message for log evaluation. } @@ -528,6 +547,9 @@ Delete the distribution file. --distribution= Name of the MySQL source distribution file. +--embedded-test +Run the test suite against the embedded server + --enable-shared Compile with shared libraries @@ -576,6 +598,9 @@ Compile and install the given perl modules. --perl-options= Build Perl modules with the additional options +--ps-test +Run an additional test run, using prepared statements + --raid Compile with RAID support From 998209d36b93e1a0b6e2078b004a0cdbbaf5a712 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 9 Dec 2004 00:37:17 +0300 Subject: [PATCH 0451/1063] A fix and test case for Bug#6873 "PS, having with subquery, crash during execute" mysql-test/r/ps.result: Test results updated (Bug#6873) mysql-test/t/ps.test: A test case for Bug#6873 "PS, having with subquery, crash during execute". sql/item_subselect.cc: If we transform having subtree, modify SELECT_LEX::having pointer to point to the new having tree root. --- mysql-test/r/ps.result | 11 +++++++++++ mysql-test/t/ps.test | 14 ++++++++++++++ sql/item_subselect.cc | 2 ++ 3 files changed, 27 insertions(+) diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result index 4a4c8fe22e4..4cb32fa4644 100644 --- a/mysql-test/r/ps.result +++ b/mysql-test/r/ps.result @@ -471,3 +471,14 @@ select @var is null, @var is not null, @var; execute stmt using @var, @var, @var; ? is null ? is not null ? 1 0 NULL +create table t1 (pnum char(3)); +create table t2 (pnum char(3)); +prepare stmt from "select pnum from t2 having pnum in (select 'p1' from t1)"; +execute stmt; +pnum +execute stmt; +pnum +execute stmt; +pnum +deallocate prepare stmt; +drop table t1, t2; diff --git a/mysql-test/t/ps.test b/mysql-test/t/ps.test index 51d1fd065cf..92bf4ece4e3 100644 --- a/mysql-test/t/ps.test +++ b/mysql-test/t/ps.test @@ -471,3 +471,17 @@ execute stmt using @var, @var, @var; set @var=null; select @var is null, @var is not null, @var; execute stmt using @var, @var, @var; + +# +# Bug#6873 "PS, having with subquery, crash during execute" +# check that if we modify having subtree, we update JOIN->having pointer +# +create table t1 (pnum char(3)); +create table t2 (pnum char(3)); +prepare stmt from "select pnum from t2 having pnum in (select 'p1' from t1)"; +execute stmt; +execute stmt; +execute stmt; +deallocate prepare stmt; +drop table t1, t2; + diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index 1265d0b3557..69941b36ca0 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -155,6 +155,8 @@ bool Item_subselect::fix_fields(THD *thd_param, TABLE_LIST *tables, Item **ref) // did we changed top item of WHERE condition if (unit->outer_select()->where == (*ref)) unit->outer_select()->where= substitution; // correct WHERE for PS + else if (unit->outer_select()->having == (*ref)) + unit->outer_select()->having= substitution; // correct HAVING for PS (*ref)= substitution; substitution->name= name; From 43a1ddcfcce4f9f9902e601b2435549cb6233c02 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 8 Dec 2004 21:48:32 +0000 Subject: [PATCH 0452/1063] ndbcluster.sh: added test switch basic_log.result, basic.test, basic.result: new file mysql-test/ndb/ndbcluster.sh: added test switch --- mysql-test/ndb/basic.result | 68 +++++++++++++++++++++++++++++++++ mysql-test/ndb/basic.test | 17 +++++++++ mysql-test/ndb/basic_log.result | 0 mysql-test/ndb/ndbcluster.sh | 63 +++++++++++++++++++++++++++++- 4 files changed, 146 insertions(+), 2 deletions(-) create mode 100644 mysql-test/ndb/basic.result create mode 100644 mysql-test/ndb/basic.test create mode 100644 mysql-test/ndb/basic_log.result diff --git a/mysql-test/ndb/basic.result b/mysql-test/ndb/basic.result new file mode 100644 index 00000000000..6bd907a11d0 --- /dev/null +++ b/mysql-test/ndb/basic.result @@ -0,0 +1,68 @@ +-- NDB Cluster -- Management Client -- +--------------------------------------------------------------------------- + NDB Cluster -- Management Client -- Help +--------------------------------------------------------------------------- +HELP Print help text +HELP SHOW Help for SHOW command +HELP DEBUG Help for debug compiled version +SHOW Print information about cluster +START BACKUP Start backup +ABORT BACKUP Abort backup +SHUTDOWN Shutdown all processes in cluster and quit +CLUSTERLOG ON [] ... Enable Cluster logging +CLUSTERLOG OFF [] ... Disable Cluster logging +CLUSTERLOG TOGGLE [] ... Toggle severity filter on/off +CLUSTERLOG INFO Print cluster log information + START Start DB node (started with -n) + RESTART [-n] [-i] Restart DB node + STOP Stop DB node +ENTER SINGLE USER MODE Enter single user mode +EXIT SINGLE USER MODE Exit single user mode + STATUS Print status + CLUSTERLOG {=}+ Set log level for cluster log +PURGE STALE SESSIONS Reset reserved nodeid's in the mgmt server +CONNECT [] Connect to management server (reconnect if already connected) +QUIT Quit management client + + = ALERT | CRITICAL | ERROR | WARNING | INFO | DEBUG + = STARTUP | SHUTDOWN | STATISTICS | CHECKPOINT | NODERESTART | CONNECTION | INFO | ERROR | GREP | DEBUG | BACKUP + = 0 - 15 + = ALL | Any database node id + +Connected to Management Server at: localhost:1186 +Node 1: started (Version 4.1.8) +Node 2: started (Version 4.1.8) + +Node 1: started (Version 4.1.8) + +Node 2: started (Version 4.1.8) + +Executing CLUSTERLOG on node 1 OK! +Executing CLUSTERLOG on node 2 OK! + +Executing CLUSTERLOG on node 1 OK! +Executing CLUSTERLOG on node 2 OK! + +Executing CLUSTERLOG on node 1 OK! +Executing CLUSTERLOG on node 2 OK! + +Executing CLUSTERLOG on node 1 OK! +Executing CLUSTERLOG on node 2 OK! + +Executing CLUSTERLOG on node 1 OK! +Executing CLUSTERLOG on node 2 OK! + +Executing CLUSTERLOG on node 1 OK! +Executing CLUSTERLOG on node 2 OK! + +Executing CLUSTERLOG on node 1 OK! +Executing CLUSTERLOG on node 2 OK! + +Executing CLUSTERLOG on node 1 OK! +Executing CLUSTERLOG on node 2 OK! + +Cluster logging is disabled +Cluster logging is enabled. +Cluster logging is disabled +ALL disabled +ALL enabled diff --git a/mysql-test/ndb/basic.test b/mysql-test/ndb/basic.test new file mode 100644 index 00000000000..945bda94ff6 --- /dev/null +++ b/mysql-test/ndb/basic.test @@ -0,0 +1,17 @@ +help +all status +1 status +2 status +all clusterlog connection=8 +all clusterlog startup=7 +all clusterlog checkpoint=7 +all clusterlog noderestart=15 +all clusterlog statistics=7 +all clusterlog error=7 +all clusterlog info=7 +all clusterlog backup=15 +clusterlog off +clusterlog toggle +clusterlog off +clusterlog off all +clusterlog on all diff --git a/mysql-test/ndb/basic_log.result b/mysql-test/ndb/basic_log.result new file mode 100644 index 00000000000..e69de29bb2d diff --git a/mysql-test/ndb/ndbcluster.sh b/mysql-test/ndb/ndbcluster.sh index fbef16c140b..11cb8e77268 100644 --- a/mysql-test/ndb/ndbcluster.sh +++ b/mysql-test/ndb/ndbcluster.sh @@ -47,6 +47,7 @@ fi pidfile=ndbcluster.pid cfgfile=Ndb.cfg +test_ndb= stop_ndb= initial_ndb= status_ndb= @@ -59,6 +60,9 @@ ndb_imem=24M while test $# -gt 0; do case "$1" in + --test) + test_ndb=1 + ;; --stop) stop_ndb=1 ;; @@ -231,7 +235,7 @@ status_ndbcluster status_ndbcluster() { # Start management client - echo "show" | $exec_mgmtclient + $exec_mgmtclient -e show } stop_default_ndbcluster() { @@ -240,7 +244,7 @@ stop_default_ndbcluster() { exec_mgmtclient="$exec_mgmtclient --try-reconnect=1" -echo "shutdown" | $exec_mgmtclient 2>&1 | cat > /dev/null +$exec_mgmtclient -e shutdown 2>&1 | cat > /dev/null if [ -f "$fs_ndb/$pidfile" ] ; then kill_pids=`cat "$fs_ndb/$pidfile"` @@ -275,6 +279,50 @@ if [ -f "$fs_ndb/$pidfile" ] ; then fi } +initialize_ndb_test () +{ + fs_result=$fs_ndb/r + rm -rf $fs_result + mkdir $fs_result + echo ------------------ + echo starting ndb tests + echo ------------------ +} + +do_ndb_test () +{ + test_name=$1 + + clusterlog=$fs_ndb/ndb_3_cluster.log + + test_log_result=$fs_result/${test_name}_log.result + test_log_reject=$fs_result/${test_name}_log.reject + test_result=$fs_result/${test_name}.result + test_reject=$fs_result/${test_name}.reject + + cp $clusterlog $test_log_result + cat ndb/${test_name}_log.result >> $test_log_result + + cp ndb/${test_name}.result $test_result + + cat ndb/${test_name}.test | $exec_mgmtclient > $test_reject + cp $clusterlog $test_log_reject + r=`diff -C 5 $test_result $test_reject` + if [ $r ] ; then + t="fail" + else + t="pass" + fi + printf "ndb_mgm output %20s [%s]\n" $test_name $t + r=`diff -C 5 $test_log_result $test_log_reject` + if [ $r ] ; then + t="fail" + else + t="pass" + fi + printf "clusterlog output %20s [%s]\n" $test_name $t +} + if [ $status_ndb ] ; then status_ndbcluster exit 0 @@ -286,4 +334,15 @@ else start_default_ndbcluster fi +if [ $test_ndb ] ; then + initialize_ndb_test + all_tests=`ls ndb/*.test | sed "s#ndb/##" | sed "s#.test##"` + for a in $all_tests ; do + do_ndb_test $a + done + echo ------------------ + echo shutting down cluster + stop_default_ndbcluster +fi + exit 0 From 5380a3a600b0d0f13f80eb10071bafeb8a89b0ed Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 8 Dec 2004 22:56:23 +0000 Subject: [PATCH 0453/1063] ndbcluster.sh: made compare of logs possible in ndb test restart_log.result, restart.test, restart.result: new file mysql-test/ndb/ndbcluster.sh: made compare of logs possible in ndb test --- mysql-test/ndb/ndbcluster.sh | 24 +++++++++--------------- mysql-test/ndb/restart.result | 16 ++++++++++++++++ mysql-test/ndb/restart.test | 12 ++++++++++++ mysql-test/ndb/restart_log.result | 20 ++++++++++++++++++++ 4 files changed, 57 insertions(+), 15 deletions(-) create mode 100644 mysql-test/ndb/restart.result create mode 100644 mysql-test/ndb/restart.test create mode 100644 mysql-test/ndb/restart_log.result diff --git a/mysql-test/ndb/ndbcluster.sh b/mysql-test/ndb/ndbcluster.sh index 11cb8e77268..848223a091c 100644 --- a/mysql-test/ndb/ndbcluster.sh +++ b/mysql-test/ndb/ndbcluster.sh @@ -300,26 +300,20 @@ do_ndb_test () test_result=$fs_result/${test_name}.result test_reject=$fs_result/${test_name}.reject - cp $clusterlog $test_log_result - cat ndb/${test_name}_log.result >> $test_log_result + clean_log='s/.*\[MgmSrvr\]//' + + cat $clusterlog ndb/${test_name}_log.result | sed -e $clean_log > $test_log_result cp ndb/${test_name}.result $test_result cat ndb/${test_name}.test | $exec_mgmtclient > $test_reject - cp $clusterlog $test_log_reject - r=`diff -C 5 $test_result $test_reject` - if [ $r ] ; then - t="fail" - else - t="pass" - fi + cat $clusterlog | sed -e $clean_log > $test_log_reject + + t="pass" + diff -C 5 $test_result $test_reject || t="fail" printf "ndb_mgm output %20s [%s]\n" $test_name $t - r=`diff -C 5 $test_log_result $test_log_reject` - if [ $r ] ; then - t="fail" - else - t="pass" - fi + t="pass" + diff -C 5 $test_log_result $test_log_reject || t="fail" printf "clusterlog output %20s [%s]\n" $test_name $t } diff --git a/mysql-test/ndb/restart.result b/mysql-test/ndb/restart.result new file mode 100644 index 00000000000..efa1399b5d9 --- /dev/null +++ b/mysql-test/ndb/restart.result @@ -0,0 +1,16 @@ +-- NDB Cluster -- Management Client -- +Connected to Management Server at: localhost:1186 +ALL disabled +Cluster logging is enabled. +ALERT enabled +Executing CLUSTERLOG on node 1 OK! +Executing CLUSTERLOG on node 2 OK! + +Node 1 is being restarted. + +Executing CLUSTERLOG on node 1 OK! +Executing CLUSTERLOG on node 2 OK! + +Node 1 is being restarted. + +ALL enabled diff --git a/mysql-test/ndb/restart.test b/mysql-test/ndb/restart.test new file mode 100644 index 00000000000..6ea9e919368 --- /dev/null +++ b/mysql-test/ndb/restart.test @@ -0,0 +1,12 @@ +clusterlog off all +clusterlog on +clusterlog on alert +all clusterlog connection=0 +sleep 1 +1 restart +sleep 5 +all clusterlog connection=8 +sleep 1 +1 restart +sleep 5 +clusterlog on all diff --git a/mysql-test/ndb/restart_log.result b/mysql-test/ndb/restart_log.result new file mode 100644 index 00000000000..2b25fc7b5b6 --- /dev/null +++ b/mysql-test/ndb/restart_log.result @@ -0,0 +1,20 @@ + ALERT -- Node 2: Network partitioning - arbitration required + ALERT -- Node 2: Arbitration won - positive reply from node 3 + ALERT -- Node 2: Node 1 has failed. The Node state at failure was 0 + ALERT -- Node 2: Node failure of 1 DBLQH completed + ALERT -- Node 2: Node failure of 1 DBDICT completed + ALERT -- Node 2: Node failure of 1 DBDIH completed + ALERT -- Node 2: Node failure of 1 DBTC completed + ALERT -- Node 2: Node 2 completed failure of Node 1 + ALERT -- Node 2: All nodes completed failure of Node 1 + ALERT -- Node 3: Node 1 Disconnected + ALERT -- Node 2: Node 1 Disconnected + ALERT -- Node 2: Network partitioning - arbitration required + ALERT -- Node 2: Arbitration won - positive reply from node 3 + ALERT -- Node 2: Node 1 has failed. The Node state at failure was 0 + ALERT -- Node 2: Node failure of 1 DBLQH completed + ALERT -- Node 2: Node failure of 1 DBDICT completed + ALERT -- Node 2: Node failure of 1 DBDIH completed + ALERT -- Node 2: Node failure of 1 DBTC completed + ALERT -- Node 2: Node 2 completed failure of Node 1 + ALERT -- Node 2: All nodes completed failure of Node 1 From f5428acdcaf2fed7768821aaabeb5354f377f062 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 8 Dec 2004 23:00:08 +0000 Subject: [PATCH 0454/1063] added possibility for comment into management client added sleep command to management client all for testing purposes --- ndb/src/mgmclient/CommandInterpreter.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ndb/src/mgmclient/CommandInterpreter.cpp b/ndb/src/mgmclient/CommandInterpreter.cpp index 53c0e3b673e..1d4d66df961 100644 --- a/ndb/src/mgmclient/CommandInterpreter.cpp +++ b/ndb/src/mgmclient/CommandInterpreter.cpp @@ -499,7 +499,8 @@ CommandInterpreter::execute_impl(const char *_line) line = my_strdup(_line,MYF(MY_WME)); My_auto_ptr ptr(line); - if (emptyString(line)) { + if (emptyString(line) || + line[0] == '#') { DBUG_RETURN(true); } @@ -516,6 +517,11 @@ CommandInterpreter::execute_impl(const char *_line) executeConnect(allAfterFirstToken); DBUG_RETURN(true); } + else if (strcasecmp(firstToken, "SLEEP") == 0) { + if (allAfterFirstToken) + sleep(atoi(allAfterFirstToken)); + DBUG_RETURN(true); + } else if((strcasecmp(firstToken, "QUIT") == 0 || strcasecmp(firstToken, "EXIT") == 0 || strcasecmp(firstToken, "BYE") == 0) && From 0724b1b250e414fdbb454d7d1d42f7f418ce1b06 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 9 Dec 2004 09:39:20 +0000 Subject: [PATCH 0455/1063] fixed so that trailing ';' are accepted by the ndb_mgm to be more "mysql client" like some cleanup --- ndb/src/mgmclient/CommandInterpreter.cpp | 51 +++++++++++++++--------- 1 file changed, 32 insertions(+), 19 deletions(-) diff --git a/ndb/src/mgmclient/CommandInterpreter.cpp b/ndb/src/mgmclient/CommandInterpreter.cpp index 1d4d66df961..e4c66d04624 100644 --- a/ndb/src/mgmclient/CommandInterpreter.cpp +++ b/ndb/src/mgmclient/CommandInterpreter.cpp @@ -484,6 +484,13 @@ CommandInterpreter::execute(const char *_line, int _try_reconnect, return result; } +static void +invalid_command(const char *cmd) +{ + ndbout << "Invalid command: " << cmd << endl; + ndbout << "Type HELP for help." << endl << endl; +} + int CommandInterpreter::execute_impl(const char *_line) { @@ -493,17 +500,30 @@ CommandInterpreter::execute_impl(const char *_line) char * line; if(_line == NULL) { - // ndbout << endl; DBUG_RETURN(false); } line = my_strdup(_line,MYF(MY_WME)); My_auto_ptr ptr(line); - - if (emptyString(line) || - line[0] == '#') { - DBUG_RETURN(true); - } - + + int do_continue; + do { + do_continue= 0; + BaseString::trim(line," \t"); + if (line[0] == 0 || + line[0] == '#') + { + DBUG_RETURN(true); + } + // for mysql client compatability remove trailing ';' + { + unsigned last= strlen(line)-1; + if (line[last] == ';') + { + line[last]= 0; + do_continue= 1; + } + } + } while (do_continue); // if there is anything in the line proceed char* firstToken = strtok(line, " "); char* allAfterFirstToken = strtok(NULL, ""); @@ -590,8 +610,7 @@ CommandInterpreter::execute_impl(const char *_line) int nodeId; if (! convert(firstToken, nodeId)) { - ndbout << "Invalid command: " << _line << endl; - ndbout << "Type HELP for help." << endl << endl; + invalid_command(_line); DBUG_RETURN(true); } @@ -640,12 +659,8 @@ CommandInterpreter::analyseAfterFirstToken(int processId, char* allAfterFirstToken) { if (emptyString(allAfterFirstToken)) { - if (processId == -1) { - ndbout << "Expected a command after ALL." << endl; - } - else { - ndbout << "Expected a command after node ID." << endl; - } + ndbout << "Expected a command after " + << ((processId == -1) ? "ALL." : "node ID.") << endl; return; } @@ -664,8 +679,7 @@ CommandInterpreter::analyseAfterFirstToken(int processId, } if(fun == 0){ - ndbout << "Invalid command: " << secondToken << endl; - ndbout << "Type HELP for help." << endl << endl; + invalid_command(secondToken); return; } @@ -846,8 +860,7 @@ CommandInterpreter::executeHelp(char* parameters) ndbout << helpTextDebug; #endif } else { - ndbout << "Invalid argument: " << parameters << endl; - ndbout << "Type HELP for help." << endl << endl; + invalid_command(parameters); } } From 37865bc907a7f31ba906bc403ee9715e536552d5 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 9 Dec 2004 11:29:17 +0100 Subject: [PATCH 0456/1063] bug#6995 - ndb don't store keys in normalized form instead save everythings as normal attributes ndb/src/kernel/blocks/backup/Backup.cpp: Remove special handling of keys, that was build to support tables where keys was only stored in ACC ndb/src/kernel/blocks/backup/Backup.hpp: Remove special handling of keys, that was build to support tables where keys was only stored in ACC ndb/src/kernel/blocks/backup/BackupInit.cpp: Remove special handling of keys, that was build to support tables where keys was only stored in ACC ndb/tools/restore/Restore.cpp: Remove special handling of keys, that was build to support tables where keys was only stored in ACC ndb/tools/restore/Restore.hpp: Remove special handling of keys, that was build to support tables where keys was only stored in ACC --- ndb/src/kernel/blocks/backup/Backup.cpp | 123 ++++---------------- ndb/src/kernel/blocks/backup/Backup.hpp | 40 +------ ndb/src/kernel/blocks/backup/BackupInit.cpp | 1 - ndb/tools/restore/Restore.cpp | 27 ----- ndb/tools/restore/Restore.hpp | 2 - 5 files changed, 24 insertions(+), 169 deletions(-) diff --git a/ndb/src/kernel/blocks/backup/Backup.cpp b/ndb/src/kernel/blocks/backup/Backup.cpp index e6fe63d9014..e7ec6c71196 100644 --- a/ndb/src/kernel/blocks/backup/Backup.cpp +++ b/ndb/src/kernel/blocks/backup/Backup.cpp @@ -1265,10 +1265,6 @@ Backup::createAttributeMask(TablePtr tabPtr, jam(); AttributePtr attr; table.attributes.getPtr(attr, i); - if(attr.p->data.key != 0){ - jam(); - continue; - } mask.set(i); } } @@ -2954,12 +2950,9 @@ Backup::parseTableDescription(Signal* signal, BackupRecordPtr ptr, Uint32 len) tabPtr.p->schemaVersion = tmpTab.TableVersion; tabPtr.p->noOfAttributes = tmpTab.NoOfAttributes; - tabPtr.p->noOfKeys = tmpTab.NoOfKeyAttr; tabPtr.p->noOfNull = 0; tabPtr.p->noOfVariable = 0; // Computed while iterating over attribs - tabPtr.p->sz_FixedKeys = 0; // Computed while iterating over attribs tabPtr.p->sz_FixedAttributes = 0; // Computed while iterating over attribs - tabPtr.p->variableKeyId = RNIL; // Computed while iterating over attribs tabPtr.p->triggerIds[0] = ILLEGAL_TRIGGER_ID; tabPtr.p->triggerIds[1] = ILLEGAL_TRIGGER_ID; tabPtr.p->triggerIds[2] = ILLEGAL_TRIGGER_ID; @@ -2994,7 +2987,6 @@ Backup::parseTableDescription(Signal* signal, BackupRecordPtr ptr, Uint32 len) attrPtr.p->data.nullable = tmp.AttributeNullableFlag; attrPtr.p->data.fixed = (tmp.AttributeArraySize != 0); - attrPtr.p->data.key = tmp.AttributeKeyFlag; attrPtr.p->data.sz32 = sz32; /** @@ -3002,50 +2994,26 @@ Backup::parseTableDescription(Signal* signal, BackupRecordPtr ptr, Uint32 len) * 1) Fixed * 2) Nullable * 3) Variable - * 4) Fixed key - * 5) Variable key */ - if(attrPtr.p->data.key == false) { + if(attrPtr.p->data.fixed == true && attrPtr.p->data.nullable == false) { jam(); - - if(attrPtr.p->data.fixed == true && attrPtr.p->data.nullable == false) { - jam(); - attrPtr.p->data.offset = tabPtr.p->sz_FixedAttributes; - tabPtr.p->sz_FixedAttributes += sz32; - }//if - - if(attrPtr.p->data.fixed == true && attrPtr.p->data.nullable == true) { - jam(); - attrPtr.p->data.offset = 0; - - attrPtr.p->data.offsetNull = tabPtr.p->noOfNull; - tabPtr.p->noOfNull++; - tabPtr.p->noOfVariable++; - }//if - - if(attrPtr.p->data.fixed == false) { - jam(); - tabPtr.p->noOfVariable++; - ndbrequire(0); - }//if - - } else if(attrPtr.p->data.key == true) { + attrPtr.p->data.offset = tabPtr.p->sz_FixedAttributes; + tabPtr.p->sz_FixedAttributes += sz32; + }//if + + if(attrPtr.p->data.fixed == true && attrPtr.p->data.nullable == true) { jam(); - ndbrequire(attrPtr.p->data.nullable == false); + attrPtr.p->data.offset = 0; - if(attrPtr.p->data.fixed == true) { // Fixed key - jam(); - tabPtr.p->sz_FixedKeys += sz32; - }//if - - if(attrPtr.p->data.fixed == false) { // Variable key - jam(); - attrPtr.p->data.offset = 0; - tabPtr.p->noOfVariable++; - ndbrequire(tabPtr.p->variableKeyId == RNIL); // Only one variable key - tabPtr.p->variableKeyId = attrPtr.i; - ndbrequire(0); - }//if + attrPtr.p->data.offsetNull = tabPtr.p->noOfNull; + tabPtr.p->noOfNull++; + tabPtr.p->noOfVariable++; + }//if + + if(attrPtr.p->data.fixed == false) { + jam(); + tabPtr.p->noOfVariable++; + ndbrequire(0); }//if it.next(); // Move Past EndOfAttribute @@ -3355,7 +3323,7 @@ Backup::execBACKUP_FRAGMENT_REQ(Signal* signal) Table & table = * tabPtr.p; ScanFragReq * req = (ScanFragReq *)signal->getDataPtrSend(); const Uint32 parallelism = 16; - const Uint32 attrLen = 5 + table.noOfAttributes - table.noOfKeys; + const Uint32 attrLen = 5 + table.noOfAttributes; req->senderData = filePtr.i; req->resultRef = reference(); @@ -3366,7 +3334,7 @@ Backup::execBACKUP_FRAGMENT_REQ(Signal* signal) req->tableId = table.tableId; ScanFragReq::setLockMode(req->requestInfo, 0); ScanFragReq::setHoldLockFlag(req->requestInfo, 0); - ScanFragReq::setKeyinfoFlag(req->requestInfo, 1); + ScanFragReq::setKeyinfoFlag(req->requestInfo, 0); ScanFragReq::setAttrLen(req->requestInfo,attrLen); req->transId1 = 0; req->transId2 = (BACKUP << 20) + (getOwnNodeId() << 8); @@ -3381,7 +3349,7 @@ Backup::execBACKUP_FRAGMENT_REQ(Signal* signal) signal->theData[2] = (BACKUP << 20) + (getOwnNodeId() << 8); // Return all - signal->theData[3] = table.noOfAttributes - table.noOfKeys; + signal->theData[3] = table.noOfAttributes; signal->theData[4] = 0; signal->theData[5] = 0; signal->theData[6] = 0; @@ -3393,10 +3361,6 @@ Backup::execBACKUP_FRAGMENT_REQ(Signal* signal) jam(); AttributePtr attr; table.attributes.getPtr(attr, i); - if(attr.p->data.key != 0) { - jam(); - continue; - }//if AttributeHeader::init(&signal->theData[dataPos], i, 0); dataPos++; @@ -3506,64 +3470,19 @@ Backup::execTRANSID_AI(Signal* signal) } } -void -Backup::execKEYINFO20(Signal* signal) -{ - jamEntry(); - - const Uint32 filePtrI = signal->theData[0]; - const Uint32 keyLen = signal->theData[1]; - //const Uint32 scanInfo = signal->theData[2]; - //const Uint32 transId1 = signal->theData[3]; - //const Uint32 transId2 = signal->theData[4]; - const Uint32 dataLen = signal->length() - 5; - - BackupFilePtr filePtr; - c_backupFilePool.getPtr(filePtr, filePtrI); - - OperationRecord & op = filePtr.p->operation; - - /** - * Unpack data - */ - ndbrequire(keyLen == dataLen); - const Uint32 * src = &signal->theData[5]; - const Uint32 klFixed = op.getFixedKeySize(); - ndbrequire(keyLen >= klFixed); - - Uint32 * dst = op.newKey(); - memcpy(dst, src, klFixed << 2); - - const Uint32 szLeft = (keyLen - klFixed); - if(szLeft > 0) { - jam(); - src += klFixed; - dst = op.newVariableKey(szLeft); - memcpy(dst, src, (szLeft << 2)); - ndbrequire(0); - }//if - - if(op.finished()){ - jam(); - op.newRecord(op.dst); - } -} - void Backup::OperationRecord::init(const TablePtr & ptr) { tablePtr = ptr.i; - noOfAttributes = (ptr.p->noOfAttributes - ptr.p->noOfKeys) + 1; - variableKeyId = ptr.p->variableKeyId; + noOfAttributes = ptr.p->noOfAttributes; sz_Bitmask = (ptr.p->noOfNull + 31) >> 5; - sz_FixedKeys = ptr.p->sz_FixedKeys; sz_FixedAttribs = ptr.p->sz_FixedAttributes; if(ptr.p->noOfVariable == 0) { jam(); - maxRecordSize = 1 + sz_Bitmask + sz_FixedKeys + sz_FixedAttribs; + maxRecordSize = 1 + sz_Bitmask + sz_FixedAttribs; } else { jam(); maxRecordSize = diff --git a/ndb/src/kernel/blocks/backup/Backup.hpp b/ndb/src/kernel/blocks/backup/Backup.hpp index 4dc2cd13ae0..9cc6255af11 100644 --- a/ndb/src/kernel/blocks/backup/Backup.hpp +++ b/ndb/src/kernel/blocks/backup/Backup.hpp @@ -76,7 +76,6 @@ protected: */ void execSCAN_HBREP(Signal* signal); void execTRANSID_AI(Signal* signal); - void execKEYINFO20(Signal* signal); void execSCAN_FRAGREF(Signal* signal); void execSCAN_FRAGCONF(Signal* signal); @@ -172,8 +171,8 @@ public: struct Data { Uint8 nullable; Uint8 fixed; - Uint8 key; - Uint8 unused; + Uint8 unused; + Uint8 unused2; Uint32 sz32; // No of 32 bit words Uint32 offset; // Relative DataFixedAttributes/DataFixedKeys Uint32 offsetNull; // In NullBitmask @@ -199,12 +198,9 @@ public: Uint32 frag_mask; Uint32 tableType; Uint32 noOfNull; - Uint32 noOfKeys; Uint32 noOfAttributes; Uint32 noOfVariable; - Uint32 sz_FixedKeys; Uint32 sz_FixedAttributes; - Uint32 variableKeyId; Uint32 triggerIds[3]; bool triggerAllocated[3]; @@ -224,7 +220,6 @@ public: * Once per table */ void init(const TablePtr & ptr); - inline Uint32 getFixedKeySize() const { return sz_FixedKeys; } /** * Once per fragment @@ -247,23 +242,19 @@ public: /** * Per attribute */ - Uint32 * newKey(); void nullAttribute(Uint32 nullOffset); Uint32 * newNullable(Uint32 attrId, Uint32 sz); Uint32 * newAttrib(Uint32 offset, Uint32 sz); Uint32 * newVariable(Uint32 id, Uint32 sz); - Uint32 * newVariableKey(Uint32 sz); private: Uint32* base; Uint32* dst_Length; Uint32* dst_Bitmask; - Uint32* dst_FixedKeys; Uint32* dst_FixedAttribs; BackupFormat::DataFile::VariableData* dst_VariableData; Uint32 noOfAttributes; // No of Attributes - Uint32 variableKeyId; // Id of variable key Uint32 attrLeft; // No of attributes left Uint32 opNoDone; @@ -289,7 +280,6 @@ public: * sizes of part */ Uint32 sz_Bitmask; - Uint32 sz_FixedKeys; Uint32 sz_FixedAttribs; public: @@ -628,7 +618,6 @@ Backup::OperationRecord::newRecord(Uint32 * p){ base = p; dst_Length = p; p += 1; dst_Bitmask = p; p += sz_Bitmask; - dst_FixedKeys = p; p += sz_FixedKeys; dst_FixedAttribs = p; p += sz_FixedAttribs; dst_VariableData = (BackupFormat::DataFile::VariableData*)p; BitmaskImpl::clear(sz_Bitmask, dst_Bitmask); @@ -645,14 +634,6 @@ Backup::OperationRecord::newAttrib(Uint32 offset, Uint32 sz){ return dst; } -inline -Uint32 * -Backup::OperationRecord::newKey(){ - attrLeft --; - attrSzLeft = 0; - return dst_FixedKeys; -} - inline void Backup::OperationRecord::nullAttribute(Uint32 offsetNull){ @@ -691,21 +672,6 @@ Backup::OperationRecord::newVariable(Uint32 id, Uint32 sz){ return dst; } -inline -Uint32 * -Backup::OperationRecord::newVariableKey(Uint32 sz){ - attrLeft--; - attrSzLeft = 0; - attrSzTotal += sz; - - dst = &dst_VariableData->Data[0]; - dst_VariableData->Sz = htonl(sz); - dst_VariableData->Id = htonl(variableKeyId); - - dst_VariableData = (BackupFormat::DataFile::VariableData *)(dst + sz); - return dst; -} - inline bool Backup::OperationRecord::finished(){ @@ -713,7 +679,7 @@ Backup::OperationRecord::finished(){ return false; } - opLen += attrSzTotal + sz_FixedKeys; + opLen += attrSzTotal; opNoDone++; scanStop = dst = (Uint32 *)dst_VariableData; diff --git a/ndb/src/kernel/blocks/backup/BackupInit.cpp b/ndb/src/kernel/blocks/backup/BackupInit.cpp index 8daad05558b..a02e068687b 100644 --- a/ndb/src/kernel/blocks/backup/BackupInit.cpp +++ b/ndb/src/kernel/blocks/backup/BackupInit.cpp @@ -126,7 +126,6 @@ Backup::Backup(const Configuration & conf) : addRecSignal(GSN_SCAN_HBREP, &Backup::execSCAN_HBREP); addRecSignal(GSN_TRANSID_AI, &Backup::execTRANSID_AI); - addRecSignal(GSN_KEYINFO20, &Backup::execKEYINFO20); addRecSignal(GSN_SCAN_FRAGREF, &Backup::execSCAN_FRAGREF); addRecSignal(GSN_SCAN_FRAGCONF, &Backup::execSCAN_FRAGCONF); diff --git a/ndb/tools/restore/Restore.cpp b/ndb/tools/restore/Restore.cpp index 6e2fcaed3af..de769b4c880 100644 --- a/ndb/tools/restore/Restore.cpp +++ b/ndb/tools/restore/Restore.cpp @@ -334,27 +334,6 @@ RestoreDataIterator::getNextTuple(int & res) Uint32 *buf_ptr = (Uint32*)_buf_ptr, *ptr = buf_ptr; ptr += m_currentTable->m_nullBitmaskSize; Uint32 i; - for(i= 0; i < m_currentTable->m_fixedKeys.size(); i++){ - assert(ptr < buf_ptr + dataLength); - - const Uint32 attrId = m_currentTable->m_fixedKeys[i]->attrId; - - AttributeData * attr_data = m_tuple.getData(attrId); - const AttributeDesc * attr_desc = m_tuple.getDesc(attrId); - - const Uint32 sz = attr_desc->getSizeInWords(); - - attr_data->null = false; - attr_data->void_value = ptr; - - if(!Twiddle(attr_desc, attr_data)) - { - res = -1; - return NULL; - } - ptr += sz; - } - for(i = 0; i < m_currentTable->m_fixedAttribs.size(); i++){ assert(ptr < buf_ptr + dataLength); @@ -699,12 +678,6 @@ void TableS::createAttr(NdbDictionary::Column *column) if (d->m_column->getAutoIncrement()) m_auto_val_id= d->attrId; - if(d->m_column->getPrimaryKey() /* && not variable */) - { - m_fixedKeys.push_back(d); - return; - } - if(!d->m_column->getNullable()) { m_fixedAttribs.push_back(d); diff --git a/ndb/tools/restore/Restore.hpp b/ndb/tools/restore/Restore.hpp index 82fcdcdb183..a7d4fc174c7 100644 --- a/ndb/tools/restore/Restore.hpp +++ b/ndb/tools/restore/Restore.hpp @@ -123,8 +123,6 @@ class TableS { Uint32 schemaVersion; Uint32 backupVersion; Vector allAttributesDesc; - Vector m_fixedKeys; - //Vector m_variableKey; Vector m_fixedAttribs; Vector m_variableAttribs; From 9ad51c631c7ef6d5ed4bea0b6171a98502844c81 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 9 Dec 2004 13:31:46 +0300 Subject: [PATCH 0457/1063] Fix for bug #6765 "Implicit access to time zone description tables requires privileges for them if some table or column level grants present" (with after-review fixes). We should set SELECT_ACL for implicitly opened tables in my_tz_check_n_skip_implicit_tables() to be able to bypass privilege checking in check_grant(). Also we should exclude those tables from privilege checking in multi-update. mysql-test/r/timezone2.result: Extended test for bug #6116 "SET time_zone := ... requires access to mysql.time_zone tables" Added test for bug #6765 "Implicit access to time zone description tables requires privileges for them if some table or column level grants present" mysql-test/t/timezone2.test: Extended test for bug #6116 "SET time_zone := ... requires access to mysql.time_zone tables" Added test for bug #6765 "Implicit access to time zone description tables requires privileges for them if some table or column level grants present" sql/item_geofunc.cc: sql_acl.h is now included via mysql_priv.h sql/item_strfunc.cc: sql_acl.h is now included via mysql_priv.h sql/log.cc: sql_acl.h is now included via mysql_priv.h sql/mysql_priv.h: Now we have to include sql_acl.h before tztime.h, since my_tz_check_n_skip_implicit_tables() defined there requires SELECT_ACL constant defined in sql_acl.h. sql/mysqld.cc: sql_acl.h is now included via mysql_priv.h sql/repl_failsafe.cc: sql_acl.h is now included via mysql_priv.h sql/set_var.cc: sql_acl.h is now included via mysql_priv.h sql/sql_acl.cc: sql_acl.h is now included via mysql_priv.h sql/sql_base.cc: sql_acl.h is now included via mysql_priv.h sql/sql_cache.cc: sql_acl.h is now included via mysql_priv.h sql/sql_class.cc: sql_acl.h is now included via mysql_priv.h sql/sql_db.cc: sql_acl.h is now included via mysql_priv.h sql/sql_derived.cc: sql_acl.h is now included via mysql_priv.h sql/sql_do.cc: sql_acl.h is now included via mysql_priv.h sql/sql_insert.cc: sql_acl.h is now included via mysql_priv.h sql/sql_parse.cc: check_one_table_access(): Tweaked comments. multi_update_precheck(): Added skipping of implicitly opened tables during privilege checking. sql/sql_prepare.cc: sql_acl.h is now included via mysql_priv.h sql/sql_repl.cc: sql_acl.h is now included via mysql_priv.h sql/sql_show.cc: sql_acl.h is now included via mysql_priv.h sql/sql_update.cc: sql_acl.h is now included via mysql_priv.h sql/sql_yacc.yy: sql_acl.h is now included via mysql_priv.h sql/tztime.h: my_tz_check_n_skip_implicit_tables(): We should set SELECT_ACL for implictly opened tables to be able to bypass privilege checking in check_grant(). --- mysql-test/r/timezone2.result | 38 ++++++++++++++++++++++++++++--- mysql-test/t/timezone2.test | 43 +++++++++++++++++++++++++++++++++-- sql/item_geofunc.cc | 1 - sql/item_strfunc.cc | 1 - sql/log.cc | 1 - sql/mysql_priv.h | 3 ++- sql/mysqld.cc | 1 - sql/repl_failsafe.cc | 1 - sql/set_var.cc | 1 - sql/sql_acl.cc | 1 - sql/sql_base.cc | 1 - sql/sql_cache.cc | 1 - sql/sql_class.cc | 1 - sql/sql_db.cc | 1 - sql/sql_derived.cc | 1 - sql/sql_do.cc | 1 - sql/sql_insert.cc | 1 - sql/sql_parse.cc | 10 ++++---- sql/sql_prepare.cc | 1 - sql/sql_repl.cc | 1 - sql/sql_show.cc | 1 - sql/sql_update.cc | 1 - sql/sql_yacc.yy | 1 - sql/tztime.h | 6 +++-- 24 files changed, 88 insertions(+), 31 deletions(-) diff --git a/mysql-test/r/timezone2.result b/mysql-test/r/timezone2.result index 86264bf5b7e..1c98fd18a08 100644 --- a/mysql-test/r/timezone2.result +++ b/mysql-test/r/timezone2.result @@ -1,4 +1,4 @@ -drop table if exists t1; +drop table if exists t1, t2; create table t1 (ts timestamp); set time_zone='+00:00'; select unix_timestamp(utc_timestamp())-unix_timestamp(current_timestamp()); @@ -256,18 +256,50 @@ delete from mysql.db where user like 'mysqltest\_%'; delete from mysql.tables_priv where user like 'mysqltest\_%'; delete from mysql.columns_priv where user like 'mysqltest\_%'; flush privileges; -grant usage on mysqltest.* to mysqltest_1@localhost; +create table t1 (a int, b datetime); +create table t2 (c int, d datetime); +grant all privileges on test.* to mysqltest_1@localhost; show grants for current_user(); Grants for mysqltest_1@localhost GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' +GRANT ALL PRIVILEGES ON `test`.* TO 'mysqltest_1'@'localhost' set time_zone= '+00:00'; set time_zone= 'Europe/Moscow'; select convert_tz('2004-10-21 19:00:00', 'Europe/Moscow', 'UTC'); convert_tz('2004-10-21 19:00:00', 'Europe/Moscow', 'UTC') 2004-10-21 15:00:00 +select convert_tz(b, 'Europe/Moscow', 'UTC') from t1; +convert_tz(b, 'Europe/Moscow', 'UTC') +update t1, t2 set t1.b = convert_tz('2004-10-21 19:00:00', 'Europe/Moscow', 'UTC') +where t1.a = t2.c and t2.d = (select max(d) from t2); select * from mysql.time_zone_name; ERROR 42000: Access denied for user 'mysqltest_1'@'localhost' to database 'mysql' select Name, convert_tz('2004-10-21 19:00:00', Name, 'UTC') from mysql.time_zone_name; ERROR 42000: Access denied for user 'mysqltest_1'@'localhost' to database 'mysql' -delete from mysql.user where user like 'mysqltest\_%'; +delete from mysql.db where user like 'mysqltest\_%'; flush privileges; +grant all privileges on test.t1 to mysqltest_1@localhost; +grant all privileges on test.t2 to mysqltest_1@localhost; +show grants for current_user(); +Grants for mysqltest_1@localhost +GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' +GRANT ALL PRIVILEGES ON `test`.`t2` TO 'mysqltest_1'@'localhost' +GRANT ALL PRIVILEGES ON `test`.`t1` TO 'mysqltest_1'@'localhost' +set time_zone= '+00:00'; +set time_zone= 'Europe/Moscow'; +select convert_tz('2004-11-31 12:00:00', 'Europe/Moscow', 'UTC'); +convert_tz('2004-11-31 12:00:00', 'Europe/Moscow', 'UTC') +2004-12-01 09:00:00 +select convert_tz(b, 'Europe/Moscow', 'UTC') from t1; +convert_tz(b, 'Europe/Moscow', 'UTC') +update t1, t2 set t1.b = convert_tz('2004-11-30 12:00:00', 'Europe/Moscow', 'UTC') +where t1.a = t2.c and t2.d = (select max(d) from t2); +select * from mysql.time_zone_name; +ERROR 42000: select command denied to user 'mysqltest_1'@'localhost' for table 'time_zone_name' +select Name, convert_tz('2004-11-30 12:00:00', Name, 'UTC') from mysql.time_zone_name; +ERROR 42000: select command denied to user 'mysqltest_1'@'localhost' for table 'time_zone_name' +delete from mysql.user where user like 'mysqltest\_%'; +delete from mysql.db where user like 'mysqltest\_%'; +delete from mysql.tables_priv where user like 'mysqltest\_%'; +flush privileges; +drop table t1, t2; diff --git a/mysql-test/t/timezone2.test b/mysql-test/t/timezone2.test index ad8089e1a37..d185a647921 100644 --- a/mysql-test/t/timezone2.test +++ b/mysql-test/t/timezone2.test @@ -2,7 +2,7 @@ # Preparing playground --disable_warnings -drop table if exists t1; +drop table if exists t1, t2; --enable_warnings @@ -205,25 +205,64 @@ drop table t1; # even for unprivileged users. # +# Let us prepare playground delete from mysql.user where user like 'mysqltest\_%'; delete from mysql.db where user like 'mysqltest\_%'; delete from mysql.tables_priv where user like 'mysqltest\_%'; delete from mysql.columns_priv where user like 'mysqltest\_%'; flush privileges; +create table t1 (a int, b datetime); +create table t2 (c int, d datetime); -grant usage on mysqltest.* to mysqltest_1@localhost; +grant all privileges on test.* to mysqltest_1@localhost; connect (tzuser, localhost, mysqltest_1,,); connection tzuser; show grants for current_user(); set time_zone= '+00:00'; set time_zone= 'Europe/Moscow'; select convert_tz('2004-10-21 19:00:00', 'Europe/Moscow', 'UTC'); +select convert_tz(b, 'Europe/Moscow', 'UTC') from t1; +# Let us also check whenever multi-update works ok +update t1, t2 set t1.b = convert_tz('2004-10-21 19:00:00', 'Europe/Moscow', 'UTC') + where t1.a = t2.c and t2.d = (select max(d) from t2); # But still these two statements should not work: --error 1044 select * from mysql.time_zone_name; --error 1044 select Name, convert_tz('2004-10-21 19:00:00', Name, 'UTC') from mysql.time_zone_name; +# +# Test for bug #6765 "Implicit access to time zone description tables +# requires privileges for them if some table or column level grants +# present" +# +connection default; +# Let use some table-level grants instead of db-level +# to make life more interesting +delete from mysql.db where user like 'mysqltest\_%'; +flush privileges; +grant all privileges on test.t1 to mysqltest_1@localhost; +grant all privileges on test.t2 to mysqltest_1@localhost; +# The test itself is almost the same as previous one +connect (tzuser2, localhost, mysqltest_1,,); +connection tzuser2; +show grants for current_user(); +set time_zone= '+00:00'; +set time_zone= 'Europe/Moscow'; +select convert_tz('2004-11-31 12:00:00', 'Europe/Moscow', 'UTC'); +select convert_tz(b, 'Europe/Moscow', 'UTC') from t1; +update t1, t2 set t1.b = convert_tz('2004-11-30 12:00:00', 'Europe/Moscow', 'UTC') + where t1.a = t2.c and t2.d = (select max(d) from t2); +# Again these two statements should not work (but with different errors): +--error 1142 +select * from mysql.time_zone_name; +--error 1142 +select Name, convert_tz('2004-11-30 12:00:00', Name, 'UTC') from mysql.time_zone_name; + +# Clean-up connection default; delete from mysql.user where user like 'mysqltest\_%'; +delete from mysql.db where user like 'mysqltest\_%'; +delete from mysql.tables_priv where user like 'mysqltest\_%'; flush privileges; +drop table t1, t2; diff --git a/sql/item_geofunc.cc b/sql/item_geofunc.cc index 7c3319bbfea..2f00416bddf 100644 --- a/sql/item_geofunc.cc +++ b/sql/item_geofunc.cc @@ -24,7 +24,6 @@ #include "mysql_priv.h" #ifdef HAVE_SPATIAL -#include "sql_acl.h" #include void Item_geometry_func::fix_length_and_dec() diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 5a23eec5a1b..ebd794f1e76 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -25,7 +25,6 @@ #endif #include "mysql_priv.h" -#include "sql_acl.h" #include #ifdef HAVE_OPENSSL #include diff --git a/sql/log.cc b/sql/log.cc index 460910fcee8..83034c79dde 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -23,7 +23,6 @@ #endif #include "mysql_priv.h" -#include "sql_acl.h" #include "sql_repl.h" #include "ha_innodb.h" // necessary to cut the binlog when crash recovery diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 3f55a88b262..46f47e51b6d 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -350,7 +350,6 @@ inline THD *_current_thd(void) #include "sql_udf.h" class user_var_entry; #include "item.h" -#include "tztime.h" typedef Comp_creator* (*chooser_compare_func_creator)(bool invert); /* sql_parse.cc */ void free_items(Item *item); @@ -371,6 +370,8 @@ int create_table_precheck(THD *thd, TABLE_LIST *tables, TABLE_LIST *create_table); Item *negate_expression(THD *thd, Item *expr); #include "sql_class.h" +#include "sql_acl.h" +#include "tztime.h" #include "opt_range.h" #ifdef HAVE_QUERY_CACHE diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 43407b345fa..ccb38b40802 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -17,7 +17,6 @@ #include "mysql_priv.h" #include #include -#include "sql_acl.h" #include "slave.h" #include "sql_repl.h" #include "repl_failsafe.h" diff --git a/sql/repl_failsafe.cc b/sql/repl_failsafe.cc index 356ec80608c..85a51ba9b51 100644 --- a/sql/repl_failsafe.cc +++ b/sql/repl_failsafe.cc @@ -20,7 +20,6 @@ #include "repl_failsafe.h" #include "sql_repl.h" #include "slave.h" -#include "sql_acl.h" #include "log_event.h" #include diff --git a/sql/set_var.cc b/sql/set_var.cc index 2031ac15412..bbc9cf77c9f 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -55,7 +55,6 @@ #include "mysql_priv.h" #include #include "slave.h" -#include "sql_acl.h" #include #include #include diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index d6f52fed1d2..b880a7b2b65 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -26,7 +26,6 @@ */ #include "mysql_priv.h" -#include "sql_acl.h" #include "hash_filo.h" #ifdef HAVE_REPLICATION #include "sql_repl.h" //for tables_ok() diff --git a/sql/sql_base.cc b/sql/sql_base.cc index a5db02478ac..a8e1d3020ca 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -18,7 +18,6 @@ /* Basic functions needed by many modules */ #include "mysql_priv.h" -#include "sql_acl.h" #include "sql_select.h" #include #include diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc index 1bf8d179770..0e2058d73e9 100644 --- a/sql/sql_cache.cc +++ b/sql/sql_cache.cc @@ -300,7 +300,6 @@ TODO list: #include #include #include -#include "sql_acl.h" #include "ha_myisammrg.h" #ifndef MASTER #include "../srclib/myisammrg/myrg_def.h" diff --git a/sql/sql_class.cc b/sql/sql_class.cc index bab81d785c3..1ba34595dd9 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -27,7 +27,6 @@ #endif #include "mysql_priv.h" -#include "sql_acl.h" #include #include #include diff --git a/sql/sql_db.cc b/sql/sql_db.cc index 350a7432990..cb360859049 100644 --- a/sql/sql_db.cc +++ b/sql/sql_db.cc @@ -19,7 +19,6 @@ #include "mysql_priv.h" #include -#include "sql_acl.h" #include #include #ifdef __WIN__ diff --git a/sql/sql_derived.cc b/sql/sql_derived.cc index 3259e0a4f22..9475ec08c96 100644 --- a/sql/sql_derived.cc +++ b/sql/sql_derived.cc @@ -23,7 +23,6 @@ #include "mysql_priv.h" #include "sql_select.h" -#include "sql_acl.h" static int mysql_derived(THD *thd, LEX *lex, SELECT_LEX_UNIT *s, TABLE_LIST *t); diff --git a/sql/sql_do.cc b/sql/sql_do.cc index 0d4529fb29e..af72632199f 100644 --- a/sql/sql_do.cc +++ b/sql/sql_do.cc @@ -18,7 +18,6 @@ /* Execute DO statement */ #include "mysql_priv.h" -#include "sql_acl.h" int mysql_do(THD *thd, List &values) { diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index d590d3b5093..f191a4b327a 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -18,7 +18,6 @@ /* Insert of records */ #include "mysql_priv.h" -#include "sql_acl.h" static int check_null_fields(THD *thd,TABLE *entry); #ifndef EMBEDDED_LIBRARY diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index e066e447345..3dec17ae8ba 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -15,7 +15,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "mysql_priv.h" -#include "sql_acl.h" #include "sql_repl.h" #include "repl_failsafe.h" #include @@ -3571,7 +3570,7 @@ error: /* Check grants for commands which work only with one table and all other - tables belong to subselects. + tables belonging to subselects or implicitly opened tables. SYNOPSIS check_one_table_access() @@ -3593,7 +3592,7 @@ int check_one_table_access(THD *thd, ulong privilege, TABLE_LIST *tables) if (grant_option && check_grant(thd, privilege, tables, 0, 1, 0)) return 1; - /* Check rights on tables of subselect (if exists) */ + /* Check rights on tables of subselects and implictly opened tables */ TABLE_LIST *subselects_tables; if ((subselects_tables= tables->next)) { @@ -5229,7 +5228,10 @@ int multi_update_precheck(THD *thd, TABLE_LIST *tables) DBUG_PRINT("info",("Checking sub query list")); for (table= tables; table; table= table->next) { - if (table->table_in_update_from_clause) + if (my_tz_check_n_skip_implicit_tables(&table, + lex->time_zone_tables_used)) + continue; + else if (table->table_in_update_from_clause) { /* If we check table by local TABLE_LIST copy then we should copy diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index a790e6fe9d8..69e3cddfdde 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -68,7 +68,6 @@ Long data handling: ***********************************************************************/ #include "mysql_priv.h" -#include "sql_acl.h" #include "sql_select.h" // for JOIN #include // for isspace() #ifdef EMBEDDED_LIBRARY diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc index bbcea537ff1..6854cb24ee9 100644 --- a/sql/sql_repl.cc +++ b/sql/sql_repl.cc @@ -18,7 +18,6 @@ #ifdef HAVE_REPLICATION #include "sql_repl.h" -#include "sql_acl.h" #include "log_event.h" #include diff --git a/sql/sql_show.cc b/sql/sql_show.cc index bda490e2916..4454499c1fc 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -19,7 +19,6 @@ #include "mysql_priv.h" #include "sql_select.h" // For select_describe -#include "sql_acl.h" #include "repl_failsafe.h" #include diff --git a/sql/sql_update.cc b/sql/sql_update.cc index d3597f274dc..4a225913eaa 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -21,7 +21,6 @@ */ #include "mysql_priv.h" -#include "sql_acl.h" #include "sql_select.h" static bool safe_update_on_fly(JOIN_TAB *join_tab, List *fields); diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 8cbfaf3f99b..03acc81b5ab 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -32,7 +32,6 @@ #define Select Lex->current_select #include "mysql_priv.h" #include "slave.h" -#include "sql_acl.h" #include "lex_symbol.h" #include "item_create.h" #include diff --git a/sql/tztime.h b/sql/tztime.h index 9f969639bd0..2214c1b29d6 100644 --- a/sql/tztime.h +++ b/sql/tztime.h @@ -66,8 +66,8 @@ extern void my_tz_free(); /* - Check if we have pointer to the beggining of list of implictly used - time zone tables and fast-forward to its end. + Check if we have pointer to the begining of list of implicitly used time + zone tables, set SELECT_ACL for them and fast-forward to its end. SYNOPSIS my_tz_check_n_skip_implicit_tables() @@ -87,6 +87,8 @@ inline bool my_tz_check_n_skip_implicit_tables(TABLE_LIST **table, { if (*table == tz_tables) { + for (int i= 0; i < 4; i++) + (*table)[i].grant.privilege= SELECT_ACL; (*table)+= 3; return TRUE; } From 5535fa96fbbee28558bb2fccbc8eecf4872b37ff Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 9 Dec 2004 12:47:20 +0200 Subject: [PATCH 0458/1063] Ensure that we free memory used with --order-by-primary (in mysqldump) Simple, non critical, fix to mysql_fix_privilege_tables client/mysqldump.c: Ensure that we free memory used with --order-by-primary mysql-test/t/system_mysql_db_fix.test: Remove warnings when compiled with support for ISAM scripts/mysql_fix_privilege_tables.sh: Ensure that 'my_print_defaults' is called correctly sql/set_var.cc: Code style cleanups sql/sql_db.cc: Fixed comments sql/udf_example.cc: Fixed comments --- client/mysqldump.c | 6 ++++-- mysql-test/t/system_mysql_db_fix.test | 6 ++++++ scripts/mysql_fix_privilege_tables.sh | 8 ++++++-- sql/set_var.cc | 14 +++++--------- sql/sql_db.cc | 28 ++++++++++++++------------- sql/udf_example.cc | 13 ++++++++----- 6 files changed, 44 insertions(+), 31 deletions(-) diff --git a/client/mysqldump.c b/client/mysqldump.c index 489063ffc73..d7cdf5c6624 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -1825,8 +1825,6 @@ static void dumpTable(uint numFields, char *table) err: if (query != query_buf) my_free(query, MYF(MY_ALLOW_ZERO_PTR)); - if (order_by) - my_free(order_by, MYF(0)); safe_exit(error); return; } /* dumpTable */ @@ -1978,6 +1976,8 @@ static int dump_all_tables_in_db(char *database) numrows = getTableStructure(table, database); if (!dFlag && numrows > 0) dumpTable(numrows,table); + my_free(order_by, MYF(MY_ALLOW_ZERO_PTR)); + order_by= 0; } if (opt_xml) { @@ -2027,6 +2027,8 @@ static int dump_selected_tables(char *db, char **table_names, int tables) numrows = getTableStructure(*table_names, db); if (!dFlag && numrows > 0) dumpTable(numrows, *table_names); + my_free(order_by, MYF(MY_ALLOW_ZERO_PTR)); + order_by= 0; } if (opt_xml) { diff --git a/mysql-test/t/system_mysql_db_fix.test b/mysql-test/t/system_mysql_db_fix.test index 6c44535e3b7..1539d210a3a 100644 --- a/mysql-test/t/system_mysql_db_fix.test +++ b/mysql-test/t/system_mysql_db_fix.test @@ -9,6 +9,7 @@ use test; # create system tables as in mysql-3.20 +--disable_warnings CREATE TABLE db ( Host char(60) binary DEFAULT '' NOT NULL, Db char(32) binary DEFAULT '' NOT NULL, @@ -23,10 +24,12 @@ CREATE TABLE db ( KEY User (User) ) type=ISAM; +--enable-warnings INSERT INTO db VALUES ('%','test', '','Y','Y','Y','Y','Y','Y'); INSERT INTO db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y'); +--disable_warnings CREATE TABLE host ( Host char(60) binary DEFAULT '' NOT NULL, Db char(32) binary DEFAULT '' NOT NULL, @@ -39,7 +42,9 @@ CREATE TABLE host ( PRIMARY KEY Host (Host,Db) ) type=ISAM; +--enable-warnings +--disable_warnings CREATE TABLE user ( Host char(60) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, @@ -56,6 +61,7 @@ CREATE TABLE user ( PRIMARY KEY Host (Host,User) ) type=ISAM; +--enable-warnings INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y'); INSERT INTO user VALUES ('localhost','', '','N','N','N','N','N','N','N','N','N'); diff --git a/scripts/mysql_fix_privilege_tables.sh b/scripts/mysql_fix_privilege_tables.sh index b84e512b69a..56807a81d7c 100644 --- a/scripts/mysql_fix_privilege_tables.sh +++ b/scripts/mysql_fix_privilege_tables.sh @@ -14,6 +14,7 @@ port="" socket="" database="mysql" bindir="" +print_defaults_bindir="." file=mysql_fix_privilege_tables.sql @@ -57,7 +58,9 @@ parse_arguments() { --port=*) port=`echo "$arg" | sed -e "s;--port=;;"` ;; --socket=*) socket=`echo "$arg" | sed -e "s;--socket=;;"` ;; --database=*) database=`echo "$arg" | sed -e "s;--database=;;"` ;; - --bindir=*) bindir=`echo "$arg" | sed -e "s;--bindir=;;"` ;; + --bindir=*) bindir=`echo "$arg" | sed -e "s;--bindir=;;"` + print_defaults_bindir=$bindir + ;; *) if test -n "$pick_args" then @@ -73,7 +76,8 @@ parse_arguments() { # Get first arguments from the my.cfg file, groups [mysqld] and # [mysql_install_db], and then merge with the command line arguments -for dir in ./bin @bindir@ @bindir@ extra $bindir/../bin $bindir/../extra +print_defaults=my_print_defaults +for dir in ./bin @bindir@ @bindir@ extra $print_defaults_bindir/../bin $print_defaults_bindir/../extra do if test -x $dir/my_print_defaults then diff --git a/sql/set_var.cc b/sql/set_var.cc index 79be4dc1c46..35a2c264f28 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -359,22 +359,18 @@ sys_var_thd_bool sys_innodb_table_locks("innodb_table_locks", sys_var_long_ptr sys_innodb_autoextend_increment("innodb_autoextend_increment", &srv_auto_extend_increment); #endif + #ifdef HAVE_NDBCLUSTER_DB -// ndb thread specific variable settings +/* ndb thread specific variable settings */ sys_var_thd_ulong sys_ndb_autoincrement_prefetch_sz("ndb_autoincrement_prefetch_sz", &SV::ndb_autoincrement_prefetch_sz); sys_var_thd_bool -sys_ndb_force_send("ndb_force_send", - &SV::ndb_force_send); +sys_ndb_force_send("ndb_force_send", &SV::ndb_force_send); sys_var_thd_bool -sys_ndb_use_exact_count("ndb_use_exact_count", - &SV::ndb_use_exact_count); +sys_ndb_use_exact_count("ndb_use_exact_count", &SV::ndb_use_exact_count); sys_var_thd_bool -sys_ndb_use_transactions("ndb_use_transactions", - &SV::ndb_use_transactions); -// ndb server global variable settings -// none +sys_ndb_use_transactions("ndb_use_transactions", &SV::ndb_use_transactions); #endif /* Time/date/datetime formats */ diff --git a/sql/sql_db.cc b/sql/sql_db.cc index e3ca0328382..00dff1d713b 100644 --- a/sql/sql_db.cc +++ b/sql/sql_db.cc @@ -390,7 +390,7 @@ int mysql_create_db(THD *thd, char *db, HA_CREATE_INFO *create_info, VOID(pthread_mutex_lock(&LOCK_mysql_create_db)); - // do not create database if another thread is holding read lock + /* do not create database if another thread is holding read lock */ if (wait_if_global_read_lock(thd, 0, 1)) { error= -1; @@ -514,7 +514,7 @@ int mysql_alter_db(THD *thd, const char *db, HA_CREATE_INFO *create_info) VOID(pthread_mutex_lock(&LOCK_mysql_create_db)); - // do not alter database if another thread is holding read lock + /* do not alter database if another thread is holding read lock */ if ((error=wait_if_global_read_lock(thd,0,1))) goto exit2; @@ -542,9 +542,11 @@ int mysql_alter_db(THD *thd, const char *db, HA_CREATE_INFO *create_info) Query_log_event qinfo(thd, thd->query, thd->query_length, 0, /* suppress_use */ TRUE); - // Write should use the database being created as the "current - // database" and not the threads current database, which is the - // default. + /* + Write should use the database being created as the "current + database" and not the threads current database, which is the + default. + */ qinfo.db = db; qinfo.db_len = strlen(db); @@ -577,7 +579,6 @@ exit2: -1 Error generated */ - int mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent) { long deleted=0; @@ -589,7 +590,7 @@ int mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent) VOID(pthread_mutex_lock(&LOCK_mysql_create_db)); - // do not drop database if another thread is holding read lock + /* do not drop database if another thread is holding read lock */ if (wait_if_global_read_lock(thd, 0, 1)) { error= -1; @@ -657,10 +658,11 @@ int mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent) { Query_log_event qinfo(thd, query, query_length, 0, /* suppress_use */ TRUE); - - // Write should use the database being created as the "current - // database" and not the threads current database, which is the - // default. + /* + Write should use the database being created as the "current + database" and not the threads current database, which is the + default. + */ qinfo.db = db; qinfo.db_len = strlen(db); @@ -774,7 +776,7 @@ static long mysql_rm_known_files(THD *thd, MY_DIR *dirp, const char *db, found_other_files++; continue; } - // just for safety we use files_charset_info + /* just for safety we use files_charset_info */ if (db && !my_strcasecmp(files_charset_info, extension, reg_ext)) { @@ -909,7 +911,7 @@ bool mysql_change_db(THD *thd, const char *name) if (!dbname || !(db_length= strlen(dbname))) { x_free(dbname); /* purecov: inspected */ - send_error(thd,ER_NO_DB_ERROR); /* purecov: inspected */ + send_error(thd,ER_NO_DB_ERROR); /* purecov: inspected */ DBUG_RETURN(1); /* purecov: inspected */ } if (check_db_name(dbname)) diff --git a/sql/udf_example.cc b/sql/udf_example.cc index 7e2ee9113b2..50de0f187fe 100644 --- a/sql/udf_example.cc +++ b/sql/udf_example.cc @@ -615,10 +615,12 @@ my_bool sequence_init(UDF_INIT *initid, UDF_ARGS *args, char *message) return 1; } bzero(initid->ptr,sizeof(longlong)); - // Fool MySQL to think that this function is a constant - // This will ensure that MySQL only evalutes the function - // when the rows are sent to the client and not before any ORDER BY - // clauses + /* + Fool MySQL to think that this function is a constant + This will ensure that MySQL only evalutes the function + when the rows are sent to the client and not before any ORDER BY + clauses + */ initid->const_item=1; return 0; } @@ -635,9 +637,10 @@ longlong sequence(UDF_INIT *initid, UDF_ARGS *args, char *is_null, ulonglong val=0; if (args->arg_count) val= *((longlong*) args->args[0]); - return ++ *((longlong*) initid->ptr) + val; + return ++*((longlong*) initid->ptr) + val; } + /**************************************************************************** ** Some functions that handles IP and hostname conversions ** The orignal function was from Zeev Suraski. From 809ea73208ab3edd36cad744918a1d4d3785411a Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 9 Dec 2004 15:56:19 +0400 Subject: [PATCH 0459/1063] Bugs: #7111: server crashes when regexp is used --- mysql-test/r/ctype_uca.result | 11 +++++++++++ mysql-test/t/ctype_uca.test | 8 ++++++++ regex/regcomp.c | 21 +++++++++++++++++++-- 3 files changed, 38 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/ctype_uca.result b/mysql-test/r/ctype_uca.result index cb060ad7ee4..fbe876d3b66 100644 --- a/mysql-test/r/ctype_uca.result +++ b/mysql-test/r/ctype_uca.result @@ -2375,3 +2375,14 @@ DROP DATABASE d1; USE test; SET character_set_server= @safe_character_set_server; SET collation_server= @safe_collation_server; +create table t1 (a varchar(1)) character set utf8 collate utf8_estonian_ci; +insert into t1 values ('A'),('B'),('C'),('a'),('b'),('c'); +select a, a regexp '[a]' from t1 order by binary a; +a a regexp '[a]' +A 1 +B 0 +C 0 +a 1 +b 0 +c 0 +drop table t1; diff --git a/mysql-test/t/ctype_uca.test b/mysql-test/t/ctype_uca.test index 11833ba9bc7..8bca2a4b3c2 100644 --- a/mysql-test/t/ctype_uca.test +++ b/mysql-test/t/ctype_uca.test @@ -444,3 +444,11 @@ DROP TABLE t1; SET @test_character_set= 'utf8'; SET @test_collation= 'utf8_swedish_ci'; -- source include/ctype_common.inc + +# +# Bug 7111 server crashes when regexp is used +# +create table t1 (a varchar(1)) character set utf8 collate utf8_estonian_ci; +insert into t1 values ('A'),('B'),('C'),('a'),('b'),('c'); +select a, a regexp '[a]' from t1 order by binary a; +drop table t1; diff --git a/regex/regcomp.c b/regex/regcomp.c index 5f0351c32aa..998b39379aa 100644 --- a/regex/regcomp.c +++ b/regex/regcomp.c @@ -860,11 +860,28 @@ othercase(charset,ch) CHARSET_INFO *charset; int ch; { + /* + In MySQL some multi-byte character sets + have 'ctype' array but don't have 'to_lower' + and 'to_upper' arrays. In this case we handle + only basic latin letters a..z and A..Z. + + If 'to_lower' and 'to_upper' arrays are empty in a character set, + then my_isalpha(cs, ch) should never return TRUE for characters + other than basic latin letters. Otherwise it should be + considered as a mistake in character set definition. + */ assert(my_isalpha(charset,ch)); if (my_isupper(charset,ch)) - return(my_tolower(charset,ch)); + { + return(charset->to_lower ? my_tolower(charset,ch) : + ch - 'A' + 'a'); + } else if (my_islower(charset,ch)) - return(my_toupper(charset,ch)); + { + return(charset->to_upper ? my_toupper(charset,ch) : + ch - 'a' + 'A'); + } else /* peculiar, but could happen */ return(ch); } From f67fe154dd4025ccf0e1f74b0841410c80f21a46 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 9 Dec 2004 13:36:23 +0100 Subject: [PATCH 0460/1063] bug#6995 - fixed so that ndb_restore 4.1.8 can read files created by 4.1.7 as bugfix changed binary format ndb/tools/restore/Restore.cpp: Fixed so that version 4.1.8 of restore can read files created by 4.1.7 ndb/tools/restore/Restore.hpp: Fixed so that version 4.1.8 of restore can read files created by 4.1.7 ndb/tools/restore/main.cpp: Fixed so that version 4.1.8 of restore can read files created by 4.1.7 --- ndb/tools/restore/Restore.cpp | 35 +++++++++++++++++++++++++++++++---- ndb/tools/restore/Restore.hpp | 4 +++- ndb/tools/restore/main.cpp | 9 ++++++++- 3 files changed, 42 insertions(+), 6 deletions(-) diff --git a/ndb/tools/restore/Restore.cpp b/ndb/tools/restore/Restore.cpp index de769b4c880..277cdc72532 100644 --- a/ndb/tools/restore/Restore.cpp +++ b/ndb/tools/restore/Restore.cpp @@ -192,14 +192,15 @@ RestoreMetaData::readGCPEntry() { return true; } -TableS::TableS(NdbTableImpl* tableImpl) +TableS::TableS(Uint32 version, NdbTableImpl* tableImpl) : m_dictTable(tableImpl) { m_dictTable = tableImpl; m_noOfNullable = m_nullBitmaskSize = 0; m_auto_val_id= ~(Uint32)0; m_max_auto_val= 0; - + backupVersion = version; + for (int i = 0; i < tableImpl->getNoOfColumns(); i++) createAttr(tableImpl->getColumn(i)); } @@ -226,11 +227,10 @@ RestoreMetaData::parseTableDescriptor(const Uint32 * data, Uint32 len) debug << "parseTableInfo " << tableImpl->getName() << " done" << endl; - TableS * table = new TableS(tableImpl); + TableS * table = new TableS(m_fileHeader.NdbVersion, tableImpl); if(table == NULL) { return false; } - table->setBackupVersion(m_fileHeader.NdbVersion); debug << "Parsed table id " << table->getTableId() << endl; debug << "Parsed table #attr " << table->getNoOfAttributes() << endl; @@ -334,6 +334,27 @@ RestoreDataIterator::getNextTuple(int & res) Uint32 *buf_ptr = (Uint32*)_buf_ptr, *ptr = buf_ptr; ptr += m_currentTable->m_nullBitmaskSize; Uint32 i; + for(i= 0; i < m_currentTable->m_fixedKeys.size(); i++){ + assert(ptr < buf_ptr + dataLength); + + const Uint32 attrId = m_currentTable->m_fixedKeys[i]->attrId; + + AttributeData * attr_data = m_tuple.getData(attrId); + const AttributeDesc * attr_desc = m_tuple.getDesc(attrId); + + const Uint32 sz = attr_desc->getSizeInWords(); + + attr_data->null = false; + attr_data->void_value = ptr; + + if(!Twiddle(attr_desc, attr_data)) + { + res = -1; + return NULL; + } + ptr += sz; + } + for(i = 0; i < m_currentTable->m_fixedAttribs.size(); i++){ assert(ptr < buf_ptr + dataLength); @@ -678,6 +699,12 @@ void TableS::createAttr(NdbDictionary::Column *column) if (d->m_column->getAutoIncrement()) m_auto_val_id= d->attrId; + if(d->m_column->getPrimaryKey() && backupVersion <= MAKE_VERSION(4,1,7)) + { + m_fixedKeys.push_back(d); + return; + } + if(!d->m_column->getNullable()) { m_fixedAttribs.push_back(d); diff --git a/ndb/tools/restore/Restore.hpp b/ndb/tools/restore/Restore.hpp index a7d4fc174c7..e0b06c1774c 100644 --- a/ndb/tools/restore/Restore.hpp +++ b/ndb/tools/restore/Restore.hpp @@ -123,6 +123,8 @@ class TableS { Uint32 schemaVersion; Uint32 backupVersion; Vector allAttributesDesc; + Vector m_fixedKeys; + //Vector m_variableKey; Vector m_fixedAttribs; Vector m_variableAttribs; @@ -138,7 +140,7 @@ class TableS { public: class NdbDictionary::Table* m_dictTable; - TableS (class NdbTableImpl* dictTable); + TableS (Uint32 version, class NdbTableImpl* dictTable); ~TableS(); Uint32 getTableId() const { diff --git a/ndb/tools/restore/main.cpp b/ndb/tools/restore/main.cpp index 482212911cb..575cd9b3b2f 100644 --- a/ndb/tools/restore/main.cpp +++ b/ndb/tools/restore/main.cpp @@ -247,11 +247,18 @@ main(int argc, char** argv) ndbout << "Failed to read " << metaData.getFilename() << endl << endl; return -1; } + + const BackupFormat::FileHeader & tmp = metaData.getFileHeader(); + const Uint32 version = tmp.NdbVersion; + + ndbout << "Ndb version in backup files: " + << getVersionString(version, 0) << endl; + /** * check wheater we can restore the backup (right version). */ int res = metaData.loadContent(); - + if (res == 0) { ndbout_c("Restore: Failed to load content"); From 52a754edd3f1961998b098f1a907fb068040a8ea Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 9 Dec 2004 15:18:31 +0100 Subject: [PATCH 0461/1063] ndb: sunfire100c: fix aligment when 32-bit pointers and 64-bit ha_rows ndb/src/ndbapi/DictCache.cpp: fix aligment when 32-bit pointers and 64-bit ha_rows ndb/src/ndbapi/DictCache.hpp: fix aligment when 32-bit pointers and 64-bit ha_rows --- ndb/src/ndbapi/DictCache.cpp | 6 ++++-- ndb/src/ndbapi/DictCache.hpp | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ndb/src/ndbapi/DictCache.cpp b/ndb/src/ndbapi/DictCache.cpp index 12300ce216f..afdb37aa53f 100644 --- a/ndb/src/ndbapi/DictCache.cpp +++ b/ndb/src/ndbapi/DictCache.cpp @@ -24,10 +24,12 @@ Ndb_local_table_info * Ndb_local_table_info::create(NdbTableImpl *table_impl, Uint32 sz) { - void *data= malloc(sizeof(NdbTableImpl)+sz-1); + if (sz % 8 != 0) // round to Uint64 + sz += 8 - sz % 8; + void *data= malloc(sizeof(NdbTableImpl)+sz-8); if (data == 0) return 0; - memset(data,0,sizeof(NdbTableImpl)+sz-1); + memset(data,0,sizeof(NdbTableImpl)+sz-8); new (data) Ndb_local_table_info(table_impl); return (Ndb_local_table_info *) data; } diff --git a/ndb/src/ndbapi/DictCache.hpp b/ndb/src/ndbapi/DictCache.hpp index 0dc853306fa..a517acee56b 100644 --- a/ndb/src/ndbapi/DictCache.hpp +++ b/ndb/src/ndbapi/DictCache.hpp @@ -32,7 +32,7 @@ public: static Ndb_local_table_info *create(NdbTableImpl *table_impl, Uint32 sz=0); static void destroy(Ndb_local_table_info *); NdbTableImpl *m_table_impl; - char m_local_data[1]; + Uint64 m_local_data[1]; private: Ndb_local_table_info(NdbTableImpl *table_impl); ~Ndb_local_table_info(); From c4be610466b4af0ba9a88d76f951948d77815134 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 9 Dec 2004 19:47:41 +0100 Subject: [PATCH 0462/1063] Do-compile: Added --with-csv and --with-example for CSV and Example storage engines Build-tools/Do-compile: Added --with-csv and --with-example for CSV and Example storage engines --- Build-tools/Do-compile | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Build-tools/Do-compile b/Build-tools/Do-compile index da2be90a428..78dcd634f7c 100755 --- a/Build-tools/Do-compile +++ b/Build-tools/Do-compile @@ -10,7 +10,7 @@ use Sys::Hostname; $opt_distribution=$opt_user=$opt_config_env=$opt_config_extra_env=""; $opt_dbd_options=$opt_perl_options=$opt_config_options=$opt_make_options=$opt_suffix=""; $opt_tmp=$opt_version_suffix=""; -$opt_bundled_zlib=$opt_help=$opt_delete=$opt_debug=$opt_stage=$opt_no_test=$opt_no_perl=$opt_one_error=$opt_with_low_memory=$opt_fast_benchmark=$opt_static_client=$opt_static_server=$opt_static_perl=$opt_sur=$opt_with_small_disk=$opt_local_perl=$opt_tcpip=$opt_build_thread=$opt_use_old_distribution=$opt_enable_shared=$opt_no_crash_me=$opt_no_strip=$opt_with_archive=$opt_with_cluster=$opt_with_debug=$opt_no_benchmark=$opt_no_mysqltest=$opt_without_embedded=$opt_readline=0; +$opt_bundled_zlib=$opt_help=$opt_delete=$opt_debug=$opt_stage=$opt_no_test=$opt_no_perl=$opt_one_error=$opt_with_low_memory=$opt_fast_benchmark=$opt_static_client=$opt_static_server=$opt_static_perl=$opt_sur=$opt_with_small_disk=$opt_local_perl=$opt_tcpip=$opt_build_thread=$opt_use_old_distribution=$opt_enable_shared=$opt_no_crash_me=$opt_no_strip=$opt_with_archive=$opt_with_cluster=$opt_with_csv=$opt_with_example=$opt_with_debug=$opt_no_benchmark=$opt_no_mysqltest=$opt_without_embedded=$opt_readline=0; $opt_embedded_test=$opt_ps_test=$opt_innodb=$opt_bdb=$opt_raid=$opt_libwrap=$opt_clearlogs=0; GetOptions( @@ -57,6 +57,8 @@ GetOptions( "version-suffix=s", "with-archive", "with-cluster", + "with-csv", + "with-example", "with-debug", "with-low-memory", "with-other-libc=s", @@ -279,6 +281,8 @@ if ($opt_stage <= 1) $opt_embedded_test= 0 if ($opt_without_embedded); $opt_config_options.= " --with-archive-storage-engine" if ($opt_with_archive); $opt_config_options.= " --with-ndbcluster" if ($opt_with_cluster); + $opt_config_options.= " --with-csv-storage-engine" if ($opt_with_csv); + $opt_config_options.= " --with-example-storage-engine" if ($opt_with_example); # Only enable InnoDB when requested (required to be able to # build the "Classic" packages that do not include InnoDB) @@ -637,11 +641,17 @@ If user is empty then no mail is sent. Set name suffix (e.g. 'com' or '-max') for a distribution --with archive -Enable the Archive storage Engine +Enable the Archive storage engine --with cluster Compile and test with NDB Cluster enabled +--with-csv +Enable the CSV storage engine + +--with-example +Enable the Example storage engine + --with-debug Build binaries with debug information (implies "--no-strip") From f4f4e6367dcbe917ca6a935b881650c28949ce00 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 10 Dec 2004 00:06:33 +0200 Subject: [PATCH 0463/1063] srv0srv.c: srv_printf_innodb_monitor(): Removed extraneous rewind() call. The caller of this function calls rewind() if necessary. In this way, we avoid rewind()ing stderr in srv_lock_timeout_and_monitor_thread(). innobase/srv/srv0srv.c: srv_printf_innodb_monitor(): Removed extraneous rewind() call. The caller of this function calls rewind() if necessary. In this way, we avoid rewind()ing stderr in srv_lock_timeout_and_monitor_thread(). --- innobase/srv/srv0srv.c | 1 - 1 file changed, 1 deletion(-) diff --git a/innobase/srv/srv0srv.c b/innobase/srv/srv0srv.c index 99a2db57d79..d633c67cdf3 100644 --- a/innobase/srv/srv0srv.c +++ b/innobase/srv/srv0srv.c @@ -1439,7 +1439,6 @@ srv_printf_innodb_monitor( srv_last_monitor_time = time(NULL); - rewind(file); fputs("\n=====================================\n", file); ut_print_timestamp(file); From 41a61e84d724e48f6d1e026e7f79469b55ac230c Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 10 Dec 2004 00:17:43 +0200 Subject: [PATCH 0464/1063] A fix for a crashing bug #7101, which occures when the expression involving LEFT() function is used in GROUP BY field. mysql-test/r/func_str.result: A result for bug #7101 test case mysql-test/t/func_str.test: Test case for bug #7101 --- mysql-test/r/func_str.result | 6 ++++++ mysql-test/t/func_str.test | 8 ++++++++ sql/item_strfunc.cc | 5 +++-- sql/item_strfunc.h | 1 + 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result index 8d49d55be39..0e98f304d89 100644 --- a/mysql-test/r/func_str.result +++ b/mysql-test/r/func_str.result @@ -685,3 +685,9 @@ drop table t1; select left(1234, 3) + 0; left(1234, 3) + 0 123 +create table t1 (a int not null primary key, b varchar(40), c datetime); +insert into t1 (a,b,c) values (1,'Tom',now()),(2,'ball games',now()), (3,'Basil',now()), (4,'Dean',now()),(5,'Ellis',now()), (6,'Serg',now()), (7,'Sergei',now()),(8,'Georg',now()),(9,'Salle',now()),(10,'Sinisa',now()); +select count(*) as total, left(c,10) as reg from t1 group by reg order by reg desc limit 0,12; +total reg +10 2004-12-10 +drop table t1; diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test index d5a3e80c417..2934a9733a7 100644 --- a/mysql-test/t/func_str.test +++ b/mysql-test/t/func_str.test @@ -421,3 +421,11 @@ drop table t1; # select left(1234, 3) + 0; + +# +# Bug #7101: bug with LEFT() when used as a field in GROUP BY aggregation +# +create table t1 (a int not null primary key, b varchar(40), c datetime); +insert into t1 (a,b,c) values (1,'Tom',now()),(2,'ball games',now()), (3,'Basil',now()), (4,'Dean',now()),(5,'Ellis',now()), (6,'Serg',now()), (7,'Sergei',now()),(8,'Georg',now()),(9,'Salle',now()),(10,'Sinisa',now()); +select count(*) as total, left(c,10) as reg from t1 group by reg order by reg desc limit 0,12; +drop table t1; diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 893126b7fe6..7fc5e51621e 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -955,8 +955,9 @@ String *Item_func_left::val_str(String *str) if (res->length() <= (uint) length || res->length() <= (char_pos= res->charpos(length))) return res; - str_value.set(*res, 0, char_pos); - return &str_value; + + tmp_value.set(*res, 0, char_pos); + return &tmp_value; } diff --git a/sql/item_strfunc.h b/sql/item_strfunc.h index afe03c31345..8efe60bbd89 100644 --- a/sql/item_strfunc.h +++ b/sql/item_strfunc.h @@ -162,6 +162,7 @@ public: class Item_func_left :public Item_str_func { + String tmp_value; public: Item_func_left(Item *a,Item *b) :Item_str_func(a,b) {} String *val_str(String *); From 7a60d1558a89df5f198884d360a14bf2b48f2c49 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 10 Dec 2004 02:36:45 +0200 Subject: [PATCH 0465/1063] dict0dict.c: Fix the bug that the character 0xA0 that EMS MySQL Manager in ALTER TABLE adds after a table name confuses the InnoDB FOREIGN KEY parser, causing an error 121 when we try to add a new constraint; a full fix would require the lexer to be aware of thd->charset_info() and UTF-8 innobase/dict/dict0dict.c: Fix the bug that the character 0xA0 that EMS MySQL Manager in ALTER TABLE adds after a table name confuses the InnoDB FOREIGN KEY parser, causing an error 121 when we try to add a new constraint; a full fix would require the lexer to be aware of thd->charset_info() and UTF-8 --- innobase/dict/dict0dict.c | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/innobase/dict/dict0dict.c b/innobase/dict/dict0dict.c index 183c547ab2b..ecc533ed26f 100644 --- a/innobase/dict/dict0dict.c +++ b/innobase/dict/dict0dict.c @@ -2364,6 +2364,8 @@ dict_scan_id( ulint len = 0; const char* s; char* d; + ulint id_len; + byte* b; *id = NULL; @@ -2425,6 +2427,28 @@ dict_scan_id( *id = s; } + if (heap) { + /* EMS MySQL Manager sometimes adds characters 0xA0 (in + latin1, a 'non-breakable space') to the end of a table name. + But isspace(0xA0) is not true, which confuses our foreign key + parser. After the UTF-8 conversion in ha_innodb.cc, bytes 0xC2 + and 0xA0 are at the end of the string. + + TODO: we should lex the string using thd->charset_info, and + my_isspace(). Only after that, convert id names to UTF-8. */ + + b = (byte*)(*id); + id_len = strlen(b); + + if (id_len >= 3 && b[id_len - 1] == 0xA0 + && b[id_len - 2] == 0xC2) { + + /* Strip the 2 last bytes */ + + b[id_len - 2] = '\0'; + } + } + return(ptr); } @@ -2479,7 +2503,7 @@ dict_scan_col( } /************************************************************************* -Scans the referenced table name from an SQL string. */ +Scans a table name from an SQL string. */ static const char* dict_scan_table_name( @@ -2490,7 +2514,7 @@ dict_scan_table_name( const char* name, /* in: foreign key table name */ ibool* success,/* out: TRUE if ok name found */ mem_heap_t* heap, /* in: heap where to allocate the id */ - const char** ref_name)/* out,own: the referenced table name; + const char** ref_name)/* out,own: the table name; NULL if no name was scannable */ { const char* database_name = NULL; From 95056a0b657b6d4f3a9106e4f21dfdf348da3690 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 10 Dec 2004 16:06:49 +0400 Subject: [PATCH 0466/1063] Fix for bug #6516 (Server crash loading spatial data) (after discussion with SerG) include/my_base.h: Handler error code added myisam/mi_write.c: New error code handled myisam/rt_index.c: check for zero length added myisam/sp_key.c: zero length check added mysql-test/r/gis-rtree.result: appropriate test result mysql-test/t/gis-rtree.test: test case sql/handler.cc: new error code handling added --- include/my_base.h | 1 + myisam/mi_write.c | 7 ++++--- myisam/rt_index.c | 3 ++- myisam/sp_key.c | 5 +++++ mysql-test/r/gis-rtree.result | 6 ++++++ mysql-test/t/gis-rtree.test | 7 +++++++ sql/handler.cc | 6 +++++- 7 files changed, 30 insertions(+), 5 deletions(-) diff --git a/include/my_base.h b/include/my_base.h index d884113dc4d..7290d0da09b 100644 --- a/include/my_base.h +++ b/include/my_base.h @@ -291,6 +291,7 @@ enum ha_base_keytype { #define HA_ERR_NO_SUCH_TABLE 155 /* The table does not exist in engine */ #define HA_ERR_TABLE_EXIST 156 /* The table existed in storage engine */ #define HA_ERR_NO_CONNECTION 157 /* Could not connect to storage engine */ +#define HA_ERR_NULL_IN_SPATIAL 158 /* NULLs are not supported in spatial index */ /* Other constants */ diff --git a/myisam/mi_write.c b/myisam/mi_write.c index 303e924118f..7d053ddfd22 100644 --- a/myisam/mi_write.c +++ b/myisam/mi_write.c @@ -124,8 +124,8 @@ int mi_write(MI_INFO *info, byte *record) { if (local_lock_tree) rw_unlock(&share->key_root_lock[i]); - DBUG_PRINT("error",("Got error: %d on write",my_errno)); - goto err; + DBUG_PRINT("error",("Got error: %d on write",my_errno)); + goto err; } } if (local_lock_tree) @@ -159,7 +159,8 @@ int mi_write(MI_INFO *info, byte *record) err: save_errno=my_errno; - if (my_errno == HA_ERR_FOUND_DUPP_KEY || my_errno == HA_ERR_RECORD_FILE_FULL) + if (my_errno == HA_ERR_FOUND_DUPP_KEY || my_errno == HA_ERR_RECORD_FILE_FULL || + my_errno == HA_ERR_NULL_IN_SPATIAL) { if (info->bulk_insert) { diff --git a/myisam/rt_index.c b/myisam/rt_index.c index cfb2ca877f4..bdf5ee9c60f 100644 --- a/myisam/rt_index.c +++ b/myisam/rt_index.c @@ -710,7 +710,8 @@ err1: int rtree_insert(MI_INFO *info, uint keynr, uchar *key, uint key_length) { - return (rtree_insert_level(info, keynr, key, key_length, -1) == -1) ? -1 : 0; + return (!key_length || + (rtree_insert_level(info, keynr, key, key_length, -1) == -1)) ? -1 : 0; } diff --git a/myisam/sp_key.c b/myisam/sp_key.c index 0e424a9e193..b61e8094cde 100644 --- a/myisam/sp_key.c +++ b/myisam/sp_key.c @@ -50,6 +50,11 @@ uint sp_make_key(register MI_INFO *info, uint keynr, uchar *key, dlen = _mi_calc_blob_length(keyseg->bit_start, pos); memcpy_fixed(&dptr, pos + keyseg->bit_start, sizeof(char*)); + if (!dptr) + { + my_errno= HA_ERR_NULL_IN_SPATIAL; + return 0; + } sp_mbr_from_wkb(dptr + 4, dlen - 4, SPDIMS, mbr); /* SRID */ for (i = 0, keyseg = keyinfo->seg; keyseg->type; keyseg++, i++) diff --git a/mysql-test/r/gis-rtree.result b/mysql-test/r/gis-rtree.result index 4ca8c379307..7b63654ffaf 100644 --- a/mysql-test/r/gis-rtree.result +++ b/mysql-test/r/gis-rtree.result @@ -798,3 +798,9 @@ INSERT INTO t1 (name, kind, line) VALUES ALTER TABLE t1 ENABLE KEYS; INSERT INTO t1 (name, kind, line) VALUES ("austria", "pp", GeomFromText('LINESTRING(14.9906 48.9887,14.9946 48.9904,14.9947 48.9916)')); drop table t1; +CREATE TABLE t1 (st varchar(100)); +INSERT INTO t1 VALUES ("Fake string"); +CREATE TABLE t2 (geom GEOMETRY NOT NULL, SPATIAL KEY gk(geom)); +INSERT INTO t2 SELECT GeomFromText(st) FROM t1; +ERROR HY000: Unknown error +drop table t1, t2; diff --git a/mysql-test/t/gis-rtree.test b/mysql-test/t/gis-rtree.test index cb1627e0500..716dd38a119 100644 --- a/mysql-test/t/gis-rtree.test +++ b/mysql-test/t/gis-rtree.test @@ -165,3 +165,10 @@ INSERT INTO t1 (name, kind, line) VALUES ALTER TABLE t1 ENABLE KEYS; INSERT INTO t1 (name, kind, line) VALUES ("austria", "pp", GeomFromText('LINESTRING(14.9906 48.9887,14.9946 48.9904,14.9947 48.9916)')); drop table t1; + +CREATE TABLE t1 (st varchar(100)); +INSERT INTO t1 VALUES ("Fake string"); +CREATE TABLE t2 (geom GEOMETRY NOT NULL, SPATIAL KEY gk(geom)); +--error 1105 +INSERT INTO t2 SELECT GeomFromText(st) FROM t1; +drop table t1, t2; diff --git a/sql/handler.cc b/sql/handler.cc index 530c5f137ec..3200c6932e9 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -1083,6 +1083,9 @@ void handler::print_error(int error, myf errflag) textno=ER_DUP_KEY; break; } + case HA_ERR_NULL_IN_SPATIAL: + textno= ER_UNKNOWN_ERROR; + DBUG_VOID_RETURN; case HA_ERR_FOUND_DUPP_UNIQUE: textno=ER_DUP_UNIQUE; break; @@ -1196,7 +1199,8 @@ uint handler::get_dup_key(int error) { DBUG_ENTER("handler::get_dup_key"); table->file->errkey = (uint) -1; - if (error == HA_ERR_FOUND_DUPP_KEY || error == HA_ERR_FOUND_DUPP_UNIQUE) + if (error == HA_ERR_FOUND_DUPP_KEY || error == HA_ERR_FOUND_DUPP_UNIQUE || + error == HA_ERR_NULL_IN_SPATIAL) info(HA_STATUS_ERRKEY | HA_STATUS_NO_LOCK); DBUG_RETURN(table->file->errkey); } From d408a4aad1c224bfd8be64dbdd705fd17678bef9 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 10 Dec 2004 13:06:58 +0100 Subject: [PATCH 0467/1063] Makefile.am: Moved "../regex/libregex.a" before "../libmysql/libmysqlclient.la" when linking. For -all-static linking libtool put -lc after the .la file and this put the libc regex functions before our regex functions when linking on Linux. client/Makefile.am: Moved "../regex/libregex.a" before "../libmysql/libmysqlclient.la" when linking, for static linking libtool put -lc after the .la and this put the libc regex functions before out regex functions in the link on Linux. --- client/Makefile.am | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/client/Makefile.am b/client/Makefile.am index fa317367f71..0404aacb383 100644 --- a/client/Makefile.am +++ b/client/Makefile.am @@ -21,6 +21,7 @@ INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/regex \ $(openssl_includes) LIBS = @CLIENT_LIBS@ DEPLIB= ../libmysql/libmysqlclient.la +REGEXLIB= ../regex/libregex.a LDADD = @CLIENT_EXTRA_LDFLAGS@ $(DEPLIB) bin_PROGRAMS = mysql mysqladmin mysqlcheck mysqlshow \ mysqldump mysqlimport mysqltest mysqlbinlog mysqlmanagerc mysqlmanager-pwgen @@ -37,8 +38,8 @@ mysqlshow_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES) $(DEPLIB) mysqldump_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES) $(DEPLIB) mysqlimport_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES) $(DEPLIB) mysqltest_SOURCES= mysqltest.c ../mysys/my_getsystime.c -mysqltest_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES) $(DEPLIB) -mysqltest_LDADD = $(LDADD) $(top_builddir)/regex/libregex.a +mysqltest_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES) $(REGEXLIB) $(DEPLIB) +mysqltest_LDADD = $(REGEXLIB) $(LDADD) mysqlbinlog_SOURCES = mysqlbinlog.cc ../mysys/mf_tempdir.c mysqlbinlog_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES) $(DEPLIB) mysqlmanagerc_SOURCES = mysqlmanagerc.c From 05cb2737b93ab4c8509ca78126883e6c850aa218 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 10 Dec 2004 16:08:18 +0400 Subject: [PATCH 0468/1063] Bug #6819 Some ujis characters cannot be inserted into table Allow to insert not-assigned UJIS codes. --- mysql-test/r/ctype_ujis.result | 2041 ++++++++++++++++++++++++++++++++ mysql-test/t/ctype_ujis.test | 1022 ++++++++++++++++ strings/ctype-ujis.c | 44 +- 3 files changed, 3105 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/ctype_ujis.result b/mysql-test/r/ctype_ujis.result index d02ac0062f8..aa4c347d54f 100644 --- a/mysql-test/r/ctype_ujis.result +++ b/mysql-test/r/ctype_ujis.result @@ -166,3 +166,2044 @@ SELECT t1.* FROM t1 WHERE b='iiijjjkkkl' ORDER BY a; a b 2 iiijjjkkkl DROP TABLE t1; +DROP TABLE IF EXISTS t1; +Warnings: +Note 1051 Unknown table 't1' +CREATE TABLE t1(c char(1)) character set ujis; +INSERT INTO t1 VALUES(0xA2AF); +INSERT INTO t1 VALUES(0xA2B0); +INSERT INTO t1 VALUES(0xA2B1); +INSERT INTO t1 VALUES(0xA2B2); +INSERT INTO t1 VALUES(0xA2B3); +INSERT INTO t1 VALUES(0xA2B4); +INSERT INTO t1 VALUES(0xA2B5); +INSERT INTO t1 VALUES(0xA2B6); +INSERT INTO t1 VALUES(0xA2B7); +INSERT INTO t1 VALUES(0xA2B8); +INSERT INTO t1 VALUES(0xA2B9); +INSERT INTO t1 VALUES(0xA2C2); +INSERT INTO t1 VALUES(0xA2C3); +INSERT INTO t1 VALUES(0xA2C4); +INSERT INTO t1 VALUES(0xA2C5); +INSERT INTO t1 VALUES(0xA2C6); +INSERT INTO t1 VALUES(0xA2C7); +INSERT INTO t1 VALUES(0xA2C8); +INSERT INTO t1 VALUES(0xA2C9); +INSERT INTO t1 VALUES(0xA2D1); +INSERT INTO t1 VALUES(0xA2D2); +INSERT INTO t1 VALUES(0xA2D3); +INSERT INTO t1 VALUES(0xA2D4); +INSERT INTO t1 VALUES(0xA2D5); +INSERT INTO t1 VALUES(0xA2D6); +INSERT INTO t1 VALUES(0xA2D7); +INSERT INTO t1 VALUES(0xA2D8); +INSERT INTO t1 VALUES(0xA2D9); +INSERT INTO t1 VALUES(0xA2DA); +INSERT INTO t1 VALUES(0xA2DB); +INSERT INTO t1 VALUES(0xA2EB); +INSERT INTO t1 VALUES(0xA2EC); +INSERT INTO t1 VALUES(0xA2ED); +INSERT INTO t1 VALUES(0xA2EE); +INSERT INTO t1 VALUES(0xA2EF); +INSERT INTO t1 VALUES(0xA2F0); +INSERT INTO t1 VALUES(0xA2F1); +INSERT INTO t1 VALUES(0xA2FA); +INSERT INTO t1 VALUES(0xA2FB); +INSERT INTO t1 VALUES(0xA2FC); +INSERT INTO t1 VALUES(0xA2FD); +INSERT INTO t1 VALUES(0xA3A1); +INSERT INTO t1 VALUES(0xA3A2); +INSERT INTO t1 VALUES(0xA3A3); +INSERT INTO t1 VALUES(0xA3A4); +INSERT INTO t1 VALUES(0xA3A5); +INSERT INTO t1 VALUES(0xA3A6); +INSERT INTO t1 VALUES(0xA3A7); +INSERT INTO t1 VALUES(0xA3A8); +INSERT INTO t1 VALUES(0xA3A9); +INSERT INTO t1 VALUES(0xA3AA); +INSERT INTO t1 VALUES(0xA3AB); +INSERT INTO t1 VALUES(0xA3AC); +INSERT INTO t1 VALUES(0xA3AD); +INSERT INTO t1 VALUES(0xA3AE); +INSERT INTO t1 VALUES(0xA3AF); +INSERT INTO t1 VALUES(0xA3BA); +INSERT INTO t1 VALUES(0xA3BB); +INSERT INTO t1 VALUES(0xA3BC); +INSERT INTO t1 VALUES(0xA3BD); +INSERT INTO t1 VALUES(0xA3BE); +INSERT INTO t1 VALUES(0xA3BF); +INSERT INTO t1 VALUES(0xA3C0); +INSERT INTO t1 VALUES(0xA3DB); +INSERT INTO t1 VALUES(0xA3DC); +INSERT INTO t1 VALUES(0xA3DD); +INSERT INTO t1 VALUES(0xA3DE); +INSERT INTO t1 VALUES(0xA3DF); +INSERT INTO t1 VALUES(0xA3E0); +INSERT INTO t1 VALUES(0xA3FB); +INSERT INTO t1 VALUES(0xA3FC); +INSERT INTO t1 VALUES(0xA3FD); +INSERT INTO t1 VALUES(0xA3FE); +INSERT INTO t1 VALUES(0xA4F4); +INSERT INTO t1 VALUES(0xA4F5); +INSERT INTO t1 VALUES(0xA4F6); +INSERT INTO t1 VALUES(0xA4F7); +INSERT INTO t1 VALUES(0xA4F8); +INSERT INTO t1 VALUES(0xA4F9); +INSERT INTO t1 VALUES(0xA4FA); +INSERT INTO t1 VALUES(0xA4FB); +INSERT INTO t1 VALUES(0xA4FC); +INSERT INTO t1 VALUES(0xA4FD); +INSERT INTO t1 VALUES(0xA4FE); +INSERT INTO t1 VALUES(0xA5F7); +INSERT INTO t1 VALUES(0xA5F8); +INSERT INTO t1 VALUES(0xA5F9); +INSERT INTO t1 VALUES(0xA5FA); +INSERT INTO t1 VALUES(0xA5FB); +INSERT INTO t1 VALUES(0xA5FC); +INSERT INTO t1 VALUES(0xA5FD); +INSERT INTO t1 VALUES(0xA5FE); +INSERT INTO t1 VALUES(0xA6B9); +INSERT INTO t1 VALUES(0xA6BA); +INSERT INTO t1 VALUES(0xA6BB); +INSERT INTO t1 VALUES(0xA6BC); +INSERT INTO t1 VALUES(0xA6BD); +INSERT INTO t1 VALUES(0xA6BE); +INSERT INTO t1 VALUES(0xA6BF); +INSERT INTO t1 VALUES(0xA6C0); +INSERT INTO t1 VALUES(0xA6D9); +INSERT INTO t1 VALUES(0xA6DA); +INSERT INTO t1 VALUES(0xA6DB); +INSERT INTO t1 VALUES(0xA6DC); +INSERT INTO t1 VALUES(0xA6DD); +INSERT INTO t1 VALUES(0xA6DE); +INSERT INTO t1 VALUES(0xA6DF); +INSERT INTO t1 VALUES(0xA6E0); +INSERT INTO t1 VALUES(0xA6E1); +INSERT INTO t1 VALUES(0xA6E2); +INSERT INTO t1 VALUES(0xA6E3); +INSERT INTO t1 VALUES(0xA6E4); +INSERT INTO t1 VALUES(0xA6E5); +INSERT INTO t1 VALUES(0xA6E6); +INSERT INTO t1 VALUES(0xA6E7); +INSERT INTO t1 VALUES(0xA6E8); +INSERT INTO t1 VALUES(0xA6E9); +INSERT INTO t1 VALUES(0xA6EA); +INSERT INTO t1 VALUES(0xA6EB); +INSERT INTO t1 VALUES(0xA6EC); +INSERT INTO t1 VALUES(0xA6ED); +INSERT INTO t1 VALUES(0xA6EE); +INSERT INTO t1 VALUES(0xA6EF); +INSERT INTO t1 VALUES(0xA6F0); +INSERT INTO t1 VALUES(0xA6F1); +INSERT INTO t1 VALUES(0xA6F2); +INSERT INTO t1 VALUES(0xA6F3); +INSERT INTO t1 VALUES(0xA6F4); +INSERT INTO t1 VALUES(0xA6F5); +INSERT INTO t1 VALUES(0xA6F6); +INSERT INTO t1 VALUES(0xA6F7); +INSERT INTO t1 VALUES(0xA6F8); +INSERT INTO t1 VALUES(0xA6F9); +INSERT INTO t1 VALUES(0xA6FA); +INSERT INTO t1 VALUES(0xA6FB); +INSERT INTO t1 VALUES(0xA6FC); +INSERT INTO t1 VALUES(0xA6FD); +INSERT INTO t1 VALUES(0xA6FE); +INSERT INTO t1 VALUES(0xA7C2); +INSERT INTO t1 VALUES(0xA7C3); +INSERT INTO t1 VALUES(0xA7C4); +INSERT INTO t1 VALUES(0xA7C5); +INSERT INTO t1 VALUES(0xA7C6); +INSERT INTO t1 VALUES(0xA7C7); +INSERT INTO t1 VALUES(0xA7C8); +INSERT INTO t1 VALUES(0xA7C9); +INSERT INTO t1 VALUES(0xA7CA); +INSERT INTO t1 VALUES(0xA7CB); +INSERT INTO t1 VALUES(0xA7CC); +INSERT INTO t1 VALUES(0xA7CD); +INSERT INTO t1 VALUES(0xA7CE); +INSERT INTO t1 VALUES(0xA7CF); +INSERT INTO t1 VALUES(0xA7D0); +INSERT INTO t1 VALUES(0xA7F2); +INSERT INTO t1 VALUES(0xA7F3); +INSERT INTO t1 VALUES(0xA7F4); +INSERT INTO t1 VALUES(0xA7F5); +INSERT INTO t1 VALUES(0xA7F6); +INSERT INTO t1 VALUES(0xA7F7); +INSERT INTO t1 VALUES(0xA7F8); +INSERT INTO t1 VALUES(0xA7F9); +INSERT INTO t1 VALUES(0xA7FA); +INSERT INTO t1 VALUES(0xA7FB); +INSERT INTO t1 VALUES(0xA7FC); +INSERT INTO t1 VALUES(0xA7FD); +INSERT INTO t1 VALUES(0xA7FE); +INSERT INTO t1 VALUES(0xA8C1); +INSERT INTO t1 VALUES(0xA8C2); +INSERT INTO t1 VALUES(0xA8C3); +INSERT INTO t1 VALUES(0xA8C4); +INSERT INTO t1 VALUES(0xA8C5); +INSERT INTO t1 VALUES(0xA8C6); +INSERT INTO t1 VALUES(0xA8C7); +INSERT INTO t1 VALUES(0xA8C8); +INSERT INTO t1 VALUES(0xA8C9); +INSERT INTO t1 VALUES(0xA8CA); +INSERT INTO t1 VALUES(0xA8CB); +INSERT INTO t1 VALUES(0xA8CC); +INSERT INTO t1 VALUES(0xA8CD); +INSERT INTO t1 VALUES(0xA8CE); +INSERT INTO t1 VALUES(0xA8CF); +INSERT INTO t1 VALUES(0xA8D0); +INSERT INTO t1 VALUES(0xA8D1); +INSERT INTO t1 VALUES(0xA8D2); +INSERT INTO t1 VALUES(0xA8D3); +INSERT INTO t1 VALUES(0xA8D4); +INSERT INTO t1 VALUES(0xA8D5); +INSERT INTO t1 VALUES(0xA8D6); +INSERT INTO t1 VALUES(0xA8D7); +INSERT INTO t1 VALUES(0xA8D8); +INSERT INTO t1 VALUES(0xA8D9); +INSERT INTO t1 VALUES(0xA8DA); +INSERT INTO t1 VALUES(0xA8DB); +INSERT INTO t1 VALUES(0xA8DC); +INSERT INTO t1 VALUES(0xA8DD); +INSERT INTO t1 VALUES(0xA8DE); +INSERT INTO t1 VALUES(0xA8DF); +INSERT INTO t1 VALUES(0xA8E0); +INSERT INTO t1 VALUES(0xA8E1); +INSERT INTO t1 VALUES(0xA8E2); +INSERT INTO t1 VALUES(0xA8E3); +INSERT INTO t1 VALUES(0xA8E4); +INSERT INTO t1 VALUES(0xA8E5); +INSERT INTO t1 VALUES(0xA8E6); +INSERT INTO t1 VALUES(0xA8E7); +INSERT INTO t1 VALUES(0xA8E8); +INSERT INTO t1 VALUES(0xA8E9); +INSERT INTO t1 VALUES(0xA8EA); +INSERT INTO t1 VALUES(0xA8EB); +INSERT INTO t1 VALUES(0xA8EC); +INSERT INTO t1 VALUES(0xA8ED); +INSERT INTO t1 VALUES(0xA8EE); +INSERT INTO t1 VALUES(0xA8EF); +INSERT INTO t1 VALUES(0xA8F0); +INSERT INTO t1 VALUES(0xA8F1); +INSERT INTO t1 VALUES(0xA8F2); +INSERT INTO t1 VALUES(0xA8F3); +INSERT INTO t1 VALUES(0xA8F4); +INSERT INTO t1 VALUES(0xA8F5); +INSERT INTO t1 VALUES(0xA8F6); +INSERT INTO t1 VALUES(0xA8F7); +INSERT INTO t1 VALUES(0xA8F8); +INSERT INTO t1 VALUES(0xA8F9); +INSERT INTO t1 VALUES(0xA8FA); +INSERT INTO t1 VALUES(0xA8FB); +INSERT INTO t1 VALUES(0xA8FC); +INSERT INTO t1 VALUES(0xA8FD); +INSERT INTO t1 VALUES(0xA8FE); +INSERT INTO t1 VALUES(0xA9A1); +INSERT INTO t1 VALUES(0xA9A2); +INSERT INTO t1 VALUES(0xA9A3); +INSERT INTO t1 VALUES(0xA9A4); +INSERT INTO t1 VALUES(0xA9A5); +INSERT INTO t1 VALUES(0xA9A6); +INSERT INTO t1 VALUES(0xA9A7); +INSERT INTO t1 VALUES(0xA9A8); +INSERT INTO t1 VALUES(0xA9A9); +INSERT INTO t1 VALUES(0xA9AA); +INSERT INTO t1 VALUES(0xA9AB); +INSERT INTO t1 VALUES(0xA9AC); +INSERT INTO t1 VALUES(0xA9AD); +INSERT INTO t1 VALUES(0xA9AE); +INSERT INTO t1 VALUES(0xA9AF); +INSERT INTO t1 VALUES(0xA9B0); +INSERT INTO t1 VALUES(0xA9B1); +INSERT INTO t1 VALUES(0xA9B2); +INSERT INTO t1 VALUES(0xA9B3); +INSERT INTO t1 VALUES(0xA9B4); +INSERT INTO t1 VALUES(0xA9B5); +INSERT INTO t1 VALUES(0xA9B6); +INSERT INTO t1 VALUES(0xA9B7); +INSERT INTO t1 VALUES(0xA9B8); +INSERT INTO t1 VALUES(0xA9B9); +INSERT INTO t1 VALUES(0xA9BA); +INSERT INTO t1 VALUES(0xA9BB); +INSERT INTO t1 VALUES(0xA9BC); +INSERT INTO t1 VALUES(0xA9BD); +INSERT INTO t1 VALUES(0xA9BE); +INSERT INTO t1 VALUES(0xA9BF); +INSERT INTO t1 VALUES(0xA9C0); +INSERT INTO t1 VALUES(0xA9C1); +INSERT INTO t1 VALUES(0xA9C2); +INSERT INTO t1 VALUES(0xA9C3); +INSERT INTO t1 VALUES(0xA9C4); +INSERT INTO t1 VALUES(0xA9C5); +INSERT INTO t1 VALUES(0xA9C6); +INSERT INTO t1 VALUES(0xA9C7); +INSERT INTO t1 VALUES(0xA9C8); +INSERT INTO t1 VALUES(0xA9C9); +INSERT INTO t1 VALUES(0xA9CA); +INSERT INTO t1 VALUES(0xA9CB); +INSERT INTO t1 VALUES(0xA9CC); +INSERT INTO t1 VALUES(0xA9CD); +INSERT INTO t1 VALUES(0xA9CE); +INSERT INTO t1 VALUES(0xA9CF); +INSERT INTO t1 VALUES(0xA9D0); +INSERT INTO t1 VALUES(0xA9D1); +INSERT INTO t1 VALUES(0xA9D2); +INSERT INTO t1 VALUES(0xA9D3); +INSERT INTO t1 VALUES(0xA9D4); +INSERT INTO t1 VALUES(0xA9D5); +INSERT INTO t1 VALUES(0xA9D6); +INSERT INTO t1 VALUES(0xA9D7); +INSERT INTO t1 VALUES(0xA9D8); +INSERT INTO t1 VALUES(0xA9D9); +INSERT INTO t1 VALUES(0xA9DA); +INSERT INTO t1 VALUES(0xA9DB); +INSERT INTO t1 VALUES(0xA9DC); +INSERT INTO t1 VALUES(0xA9DD); +INSERT INTO t1 VALUES(0xA9DE); +INSERT INTO t1 VALUES(0xA9DF); +INSERT INTO t1 VALUES(0xA9E0); +INSERT INTO t1 VALUES(0xA9E1); +INSERT INTO t1 VALUES(0xA9E2); +INSERT INTO t1 VALUES(0xA9E3); +INSERT INTO t1 VALUES(0xA9E4); +INSERT INTO t1 VALUES(0xA9E5); +INSERT INTO t1 VALUES(0xA9E6); +INSERT INTO t1 VALUES(0xA9E7); +INSERT INTO t1 VALUES(0xA9E8); +INSERT INTO t1 VALUES(0xA9E9); +INSERT INTO t1 VALUES(0xA9EA); +INSERT INTO t1 VALUES(0xA9EB); +INSERT INTO t1 VALUES(0xA9EC); +INSERT INTO t1 VALUES(0xA9ED); +INSERT INTO t1 VALUES(0xA9EE); +INSERT INTO t1 VALUES(0xA9EF); +INSERT INTO t1 VALUES(0xA9F0); +INSERT INTO t1 VALUES(0xA9F1); +INSERT INTO t1 VALUES(0xA9F2); +INSERT INTO t1 VALUES(0xA9F3); +INSERT INTO t1 VALUES(0xA9F4); +INSERT INTO t1 VALUES(0xA9F5); +INSERT INTO t1 VALUES(0xA9F6); +INSERT INTO t1 VALUES(0xA9F7); +INSERT INTO t1 VALUES(0xA9F8); +INSERT INTO t1 VALUES(0xA9F9); +INSERT INTO t1 VALUES(0xA9FA); +INSERT INTO t1 VALUES(0xA9FB); +INSERT INTO t1 VALUES(0xA9FC); +INSERT INTO t1 VALUES(0xA9FD); +INSERT INTO t1 VALUES(0xA9FE); +INSERT INTO t1 VALUES(0xAAA1); +INSERT INTO t1 VALUES(0xAAA2); +INSERT INTO t1 VALUES(0xAAA3); +INSERT INTO t1 VALUES(0xAAA4); +INSERT INTO t1 VALUES(0xAAA5); +INSERT INTO t1 VALUES(0xAAA6); +INSERT INTO t1 VALUES(0xAAA7); +INSERT INTO t1 VALUES(0xAAA8); +INSERT INTO t1 VALUES(0xAAA9); +INSERT INTO t1 VALUES(0xAAAA); +INSERT INTO t1 VALUES(0xAAAB); +INSERT INTO t1 VALUES(0xAAAC); +INSERT INTO t1 VALUES(0xAAAD); +INSERT INTO t1 VALUES(0xAAAE); +INSERT INTO t1 VALUES(0xAAAF); +INSERT INTO t1 VALUES(0xAAB0); +INSERT INTO t1 VALUES(0xAAB1); +INSERT INTO t1 VALUES(0xAAB2); +INSERT INTO t1 VALUES(0xAAB3); +INSERT INTO t1 VALUES(0xAAB4); +INSERT INTO t1 VALUES(0xAAB5); +INSERT INTO t1 VALUES(0xAAB6); +INSERT INTO t1 VALUES(0xAAB7); +INSERT INTO t1 VALUES(0xAAB8); +INSERT INTO t1 VALUES(0xAAB9); +INSERT INTO t1 VALUES(0xAABA); +INSERT INTO t1 VALUES(0xAABB); +INSERT INTO t1 VALUES(0xAABC); +INSERT INTO t1 VALUES(0xAABD); +INSERT INTO t1 VALUES(0xAABE); +INSERT INTO t1 VALUES(0xAABF); +INSERT INTO t1 VALUES(0xAAC0); +INSERT INTO t1 VALUES(0xAAC1); +INSERT INTO t1 VALUES(0xAAC2); +INSERT INTO t1 VALUES(0xAAC3); +INSERT INTO t1 VALUES(0xAAC4); +INSERT INTO t1 VALUES(0xAAC5); +INSERT INTO t1 VALUES(0xAAC6); +INSERT INTO t1 VALUES(0xAAC7); +INSERT INTO t1 VALUES(0xAAC8); +INSERT INTO t1 VALUES(0xAAC9); +INSERT INTO t1 VALUES(0xAACA); +INSERT INTO t1 VALUES(0xAACB); +INSERT INTO t1 VALUES(0xAACC); +INSERT INTO t1 VALUES(0xAACD); +INSERT INTO t1 VALUES(0xAACE); +INSERT INTO t1 VALUES(0xAACF); +INSERT INTO t1 VALUES(0xAAD0); +INSERT INTO t1 VALUES(0xAAD1); +INSERT INTO t1 VALUES(0xAAD2); +INSERT INTO t1 VALUES(0xAAD3); +INSERT INTO t1 VALUES(0xAAD4); +INSERT INTO t1 VALUES(0xAAD5); +INSERT INTO t1 VALUES(0xAAD6); +INSERT INTO t1 VALUES(0xAAD7); +INSERT INTO t1 VALUES(0xAAD8); +INSERT INTO t1 VALUES(0xAAD9); +INSERT INTO t1 VALUES(0xAADA); +INSERT INTO t1 VALUES(0xAADB); +INSERT INTO t1 VALUES(0xAADC); +INSERT INTO t1 VALUES(0xAADD); +INSERT INTO t1 VALUES(0xAADE); +INSERT INTO t1 VALUES(0xAADF); +INSERT INTO t1 VALUES(0xAAE0); +INSERT INTO t1 VALUES(0xAAE1); +INSERT INTO t1 VALUES(0xAAE2); +INSERT INTO t1 VALUES(0xAAE3); +INSERT INTO t1 VALUES(0xAAE4); +INSERT INTO t1 VALUES(0xAAE5); +INSERT INTO t1 VALUES(0xAAE6); +INSERT INTO t1 VALUES(0xAAE7); +INSERT INTO t1 VALUES(0xAAE8); +INSERT INTO t1 VALUES(0xAAE9); +INSERT INTO t1 VALUES(0xAAEA); +INSERT INTO t1 VALUES(0xAAEB); +INSERT INTO t1 VALUES(0xAAEC); +INSERT INTO t1 VALUES(0xAAED); +INSERT INTO t1 VALUES(0xAAEE); +INSERT INTO t1 VALUES(0xAAEF); +INSERT INTO t1 VALUES(0xAAF0); +INSERT INTO t1 VALUES(0xAAF1); +INSERT INTO t1 VALUES(0xAAF2); +INSERT INTO t1 VALUES(0xAAF3); +INSERT INTO t1 VALUES(0xAAF4); +INSERT INTO t1 VALUES(0xAAF5); +INSERT INTO t1 VALUES(0xAAF6); +INSERT INTO t1 VALUES(0xAAF7); +INSERT INTO t1 VALUES(0xAAF8); +INSERT INTO t1 VALUES(0xAAF9); +INSERT INTO t1 VALUES(0xAAFA); +INSERT INTO t1 VALUES(0xAAFB); +INSERT INTO t1 VALUES(0xAAFC); +INSERT INTO t1 VALUES(0xAAFD); +INSERT INTO t1 VALUES(0xAAFE); +INSERT INTO t1 VALUES(0xABA1); +INSERT INTO t1 VALUES(0xABA2); +INSERT INTO t1 VALUES(0xABA3); +INSERT INTO t1 VALUES(0xABA4); +INSERT INTO t1 VALUES(0xABA5); +INSERT INTO t1 VALUES(0xABA6); +INSERT INTO t1 VALUES(0xABA7); +INSERT INTO t1 VALUES(0xABA8); +INSERT INTO t1 VALUES(0xABA9); +INSERT INTO t1 VALUES(0xABAA); +INSERT INTO t1 VALUES(0xABAB); +INSERT INTO t1 VALUES(0xABAC); +INSERT INTO t1 VALUES(0xABAD); +INSERT INTO t1 VALUES(0xABAE); +INSERT INTO t1 VALUES(0xABAF); +INSERT INTO t1 VALUES(0xABB0); +INSERT INTO t1 VALUES(0xABB1); +INSERT INTO t1 VALUES(0xABB2); +INSERT INTO t1 VALUES(0xABB3); +INSERT INTO t1 VALUES(0xABB4); +INSERT INTO t1 VALUES(0xABB5); +INSERT INTO t1 VALUES(0xABB6); +INSERT INTO t1 VALUES(0xABB7); +INSERT INTO t1 VALUES(0xABB8); +INSERT INTO t1 VALUES(0xABB9); +INSERT INTO t1 VALUES(0xABBA); +INSERT INTO t1 VALUES(0xABBB); +INSERT INTO t1 VALUES(0xABBC); +INSERT INTO t1 VALUES(0xABBD); +INSERT INTO t1 VALUES(0xABBE); +INSERT INTO t1 VALUES(0xABBF); +INSERT INTO t1 VALUES(0xABC0); +INSERT INTO t1 VALUES(0xABC1); +INSERT INTO t1 VALUES(0xABC2); +INSERT INTO t1 VALUES(0xABC3); +INSERT INTO t1 VALUES(0xABC4); +INSERT INTO t1 VALUES(0xABC5); +INSERT INTO t1 VALUES(0xABC6); +INSERT INTO t1 VALUES(0xABC7); +INSERT INTO t1 VALUES(0xABC8); +INSERT INTO t1 VALUES(0xABC9); +INSERT INTO t1 VALUES(0xABCA); +INSERT INTO t1 VALUES(0xABCB); +INSERT INTO t1 VALUES(0xABCC); +INSERT INTO t1 VALUES(0xABCD); +INSERT INTO t1 VALUES(0xABCE); +INSERT INTO t1 VALUES(0xABCF); +INSERT INTO t1 VALUES(0xABD0); +INSERT INTO t1 VALUES(0xABD1); +INSERT INTO t1 VALUES(0xABD2); +INSERT INTO t1 VALUES(0xABD3); +INSERT INTO t1 VALUES(0xABD4); +INSERT INTO t1 VALUES(0xABD5); +INSERT INTO t1 VALUES(0xABD6); +INSERT INTO t1 VALUES(0xABD7); +INSERT INTO t1 VALUES(0xABD8); +INSERT INTO t1 VALUES(0xABD9); +INSERT INTO t1 VALUES(0xABDA); +INSERT INTO t1 VALUES(0xABDB); +INSERT INTO t1 VALUES(0xABDC); +INSERT INTO t1 VALUES(0xABDD); +INSERT INTO t1 VALUES(0xABDE); +INSERT INTO t1 VALUES(0xABDF); +INSERT INTO t1 VALUES(0xABE0); +INSERT INTO t1 VALUES(0xABE1); +INSERT INTO t1 VALUES(0xABE2); +INSERT INTO t1 VALUES(0xABE3); +INSERT INTO t1 VALUES(0xABE4); +INSERT INTO t1 VALUES(0xABE5); +INSERT INTO t1 VALUES(0xABE6); +INSERT INTO t1 VALUES(0xABE7); +INSERT INTO t1 VALUES(0xABE8); +INSERT INTO t1 VALUES(0xABE9); +INSERT INTO t1 VALUES(0xABEA); +INSERT INTO t1 VALUES(0xABEB); +INSERT INTO t1 VALUES(0xABEC); +INSERT INTO t1 VALUES(0xABED); +INSERT INTO t1 VALUES(0xABEE); +INSERT INTO t1 VALUES(0xABEF); +INSERT INTO t1 VALUES(0xABF0); +INSERT INTO t1 VALUES(0xABF1); +INSERT INTO t1 VALUES(0xABF2); +INSERT INTO t1 VALUES(0xABF3); +INSERT INTO t1 VALUES(0xABF4); +INSERT INTO t1 VALUES(0xABF5); +INSERT INTO t1 VALUES(0xABF6); +INSERT INTO t1 VALUES(0xABF7); +INSERT INTO t1 VALUES(0xABF8); +INSERT INTO t1 VALUES(0xABF9); +INSERT INTO t1 VALUES(0xABFA); +INSERT INTO t1 VALUES(0xABFB); +INSERT INTO t1 VALUES(0xABFC); +INSERT INTO t1 VALUES(0xABFD); +INSERT INTO t1 VALUES(0xABFE); +INSERT INTO t1 VALUES(0xACA1); +INSERT INTO t1 VALUES(0xACA2); +INSERT INTO t1 VALUES(0xACA3); +INSERT INTO t1 VALUES(0xACA4); +INSERT INTO t1 VALUES(0xACA5); +INSERT INTO t1 VALUES(0xACA6); +INSERT INTO t1 VALUES(0xACA7); +INSERT INTO t1 VALUES(0xACA8); +INSERT INTO t1 VALUES(0xACA9); +INSERT INTO t1 VALUES(0xACAA); +INSERT INTO t1 VALUES(0xACAB); +INSERT INTO t1 VALUES(0xACAC); +INSERT INTO t1 VALUES(0xACAD); +INSERT INTO t1 VALUES(0xACAE); +INSERT INTO t1 VALUES(0xACAF); +INSERT INTO t1 VALUES(0xACB0); +INSERT INTO t1 VALUES(0xACB1); +INSERT INTO t1 VALUES(0xACB2); +INSERT INTO t1 VALUES(0xACB3); +INSERT INTO t1 VALUES(0xACB4); +INSERT INTO t1 VALUES(0xACB5); +INSERT INTO t1 VALUES(0xACB6); +INSERT INTO t1 VALUES(0xACB7); +INSERT INTO t1 VALUES(0xACB8); +INSERT INTO t1 VALUES(0xACB9); +INSERT INTO t1 VALUES(0xACBA); +INSERT INTO t1 VALUES(0xACBB); +INSERT INTO t1 VALUES(0xACBC); +INSERT INTO t1 VALUES(0xACBD); +INSERT INTO t1 VALUES(0xACBE); +INSERT INTO t1 VALUES(0xACBF); +INSERT INTO t1 VALUES(0xACC0); +INSERT INTO t1 VALUES(0xACC1); +INSERT INTO t1 VALUES(0xACC2); +INSERT INTO t1 VALUES(0xACC3); +INSERT INTO t1 VALUES(0xACC4); +INSERT INTO t1 VALUES(0xACC5); +INSERT INTO t1 VALUES(0xACC6); +INSERT INTO t1 VALUES(0xACC7); +INSERT INTO t1 VALUES(0xACC8); +INSERT INTO t1 VALUES(0xACC9); +INSERT INTO t1 VALUES(0xACCA); +INSERT INTO t1 VALUES(0xACCB); +INSERT INTO t1 VALUES(0xACCC); +INSERT INTO t1 VALUES(0xACCD); +INSERT INTO t1 VALUES(0xACCE); +INSERT INTO t1 VALUES(0xACCF); +INSERT INTO t1 VALUES(0xACD0); +INSERT INTO t1 VALUES(0xACD1); +INSERT INTO t1 VALUES(0xACD2); +INSERT INTO t1 VALUES(0xACD3); +INSERT INTO t1 VALUES(0xACD4); +INSERT INTO t1 VALUES(0xACD5); +INSERT INTO t1 VALUES(0xACD6); +INSERT INTO t1 VALUES(0xACD7); +INSERT INTO t1 VALUES(0xACD8); +INSERT INTO t1 VALUES(0xACD9); +INSERT INTO t1 VALUES(0xACDA); +INSERT INTO t1 VALUES(0xACDB); +INSERT INTO t1 VALUES(0xACDC); +INSERT INTO t1 VALUES(0xACDD); +INSERT INTO t1 VALUES(0xACDE); +INSERT INTO t1 VALUES(0xACDF); +INSERT INTO t1 VALUES(0xACE0); +INSERT INTO t1 VALUES(0xACE1); +INSERT INTO t1 VALUES(0xACE2); +INSERT INTO t1 VALUES(0xACE3); +INSERT INTO t1 VALUES(0xACE4); +INSERT INTO t1 VALUES(0xACE5); +INSERT INTO t1 VALUES(0xACE6); +INSERT INTO t1 VALUES(0xACE7); +INSERT INTO t1 VALUES(0xACE8); +INSERT INTO t1 VALUES(0xACE9); +INSERT INTO t1 VALUES(0xACEA); +INSERT INTO t1 VALUES(0xACEB); +INSERT INTO t1 VALUES(0xACEC); +INSERT INTO t1 VALUES(0xACED); +INSERT INTO t1 VALUES(0xACEE); +INSERT INTO t1 VALUES(0xACEF); +INSERT INTO t1 VALUES(0xACF0); +INSERT INTO t1 VALUES(0xACF1); +INSERT INTO t1 VALUES(0xACF2); +INSERT INTO t1 VALUES(0xACF3); +INSERT INTO t1 VALUES(0xACF4); +INSERT INTO t1 VALUES(0xACF5); +INSERT INTO t1 VALUES(0xACF6); +INSERT INTO t1 VALUES(0xACF7); +INSERT INTO t1 VALUES(0xACF8); +INSERT INTO t1 VALUES(0xACF9); +INSERT INTO t1 VALUES(0xACFA); +INSERT INTO t1 VALUES(0xACFB); +INSERT INTO t1 VALUES(0xACFC); +INSERT INTO t1 VALUES(0xACFD); +INSERT INTO t1 VALUES(0xACFE); +INSERT INTO t1 VALUES(0xADA1); +INSERT INTO t1 VALUES(0xADA2); +INSERT INTO t1 VALUES(0xADA3); +INSERT INTO t1 VALUES(0xADA4); +INSERT INTO t1 VALUES(0xADA5); +INSERT INTO t1 VALUES(0xADA6); +INSERT INTO t1 VALUES(0xADA7); +INSERT INTO t1 VALUES(0xADA8); +INSERT INTO t1 VALUES(0xADA9); +INSERT INTO t1 VALUES(0xADAA); +INSERT INTO t1 VALUES(0xADAB); +INSERT INTO t1 VALUES(0xADAC); +INSERT INTO t1 VALUES(0xADAD); +INSERT INTO t1 VALUES(0xADAE); +INSERT INTO t1 VALUES(0xADAF); +INSERT INTO t1 VALUES(0xADB0); +INSERT INTO t1 VALUES(0xADB1); +INSERT INTO t1 VALUES(0xADB2); +INSERT INTO t1 VALUES(0xADB3); +INSERT INTO t1 VALUES(0xADB4); +INSERT INTO t1 VALUES(0xADB5); +INSERT INTO t1 VALUES(0xADB6); +INSERT INTO t1 VALUES(0xADB7); +INSERT INTO t1 VALUES(0xADB8); +INSERT INTO t1 VALUES(0xADB9); +INSERT INTO t1 VALUES(0xADBA); +INSERT INTO t1 VALUES(0xADBB); +INSERT INTO t1 VALUES(0xADBC); +INSERT INTO t1 VALUES(0xADBD); +INSERT INTO t1 VALUES(0xADBE); +INSERT INTO t1 VALUES(0xADBF); +INSERT INTO t1 VALUES(0xADC0); +INSERT INTO t1 VALUES(0xADC1); +INSERT INTO t1 VALUES(0xADC2); +INSERT INTO t1 VALUES(0xADC3); +INSERT INTO t1 VALUES(0xADC4); +INSERT INTO t1 VALUES(0xADC5); +INSERT INTO t1 VALUES(0xADC6); +INSERT INTO t1 VALUES(0xADC7); +INSERT INTO t1 VALUES(0xADC8); +INSERT INTO t1 VALUES(0xADC9); +INSERT INTO t1 VALUES(0xADCA); +INSERT INTO t1 VALUES(0xADCB); +INSERT INTO t1 VALUES(0xADCC); +INSERT INTO t1 VALUES(0xADCD); +INSERT INTO t1 VALUES(0xADCE); +INSERT INTO t1 VALUES(0xADCF); +INSERT INTO t1 VALUES(0xADD0); +INSERT INTO t1 VALUES(0xADD1); +INSERT INTO t1 VALUES(0xADD2); +INSERT INTO t1 VALUES(0xADD3); +INSERT INTO t1 VALUES(0xADD4); +INSERT INTO t1 VALUES(0xADD5); +INSERT INTO t1 VALUES(0xADD6); +INSERT INTO t1 VALUES(0xADD7); +INSERT INTO t1 VALUES(0xADD8); +INSERT INTO t1 VALUES(0xADD9); +INSERT INTO t1 VALUES(0xADDA); +INSERT INTO t1 VALUES(0xADDB); +INSERT INTO t1 VALUES(0xADDC); +INSERT INTO t1 VALUES(0xADDD); +INSERT INTO t1 VALUES(0xADDE); +INSERT INTO t1 VALUES(0xADDF); +INSERT INTO t1 VALUES(0xADE0); +INSERT INTO t1 VALUES(0xADE1); +INSERT INTO t1 VALUES(0xADE2); +INSERT INTO t1 VALUES(0xADE3); +INSERT INTO t1 VALUES(0xADE4); +INSERT INTO t1 VALUES(0xADE5); +INSERT INTO t1 VALUES(0xADE6); +INSERT INTO t1 VALUES(0xADE7); +INSERT INTO t1 VALUES(0xADE8); +INSERT INTO t1 VALUES(0xADE9); +INSERT INTO t1 VALUES(0xADEA); +INSERT INTO t1 VALUES(0xADEB); +INSERT INTO t1 VALUES(0xADEC); +INSERT INTO t1 VALUES(0xADED); +INSERT INTO t1 VALUES(0xADEE); +INSERT INTO t1 VALUES(0xADEF); +INSERT INTO t1 VALUES(0xADF0); +INSERT INTO t1 VALUES(0xADF1); +INSERT INTO t1 VALUES(0xADF2); +INSERT INTO t1 VALUES(0xADF3); +INSERT INTO t1 VALUES(0xADF4); +INSERT INTO t1 VALUES(0xADF5); +INSERT INTO t1 VALUES(0xADF6); +INSERT INTO t1 VALUES(0xADF7); +INSERT INTO t1 VALUES(0xADF8); +INSERT INTO t1 VALUES(0xADF9); +INSERT INTO t1 VALUES(0xADFA); +INSERT INTO t1 VALUES(0xADFB); +INSERT INTO t1 VALUES(0xADFC); +INSERT INTO t1 VALUES(0xADFD); +INSERT INTO t1 VALUES(0xADFE); +INSERT INTO t1 VALUES(0xAEA1); +INSERT INTO t1 VALUES(0xAEA2); +INSERT INTO t1 VALUES(0xAEA3); +INSERT INTO t1 VALUES(0xAEA4); +INSERT INTO t1 VALUES(0xAEA5); +INSERT INTO t1 VALUES(0xAEA6); +INSERT INTO t1 VALUES(0xAEA7); +INSERT INTO t1 VALUES(0xAEA8); +INSERT INTO t1 VALUES(0xAEA9); +INSERT INTO t1 VALUES(0xAEAA); +INSERT INTO t1 VALUES(0xAEAB); +INSERT INTO t1 VALUES(0xAEAC); +INSERT INTO t1 VALUES(0xAEAD); +INSERT INTO t1 VALUES(0xAEAE); +INSERT INTO t1 VALUES(0xAEAF); +INSERT INTO t1 VALUES(0xAEB0); +INSERT INTO t1 VALUES(0xAEB1); +INSERT INTO t1 VALUES(0xAEB2); +INSERT INTO t1 VALUES(0xAEB3); +INSERT INTO t1 VALUES(0xAEB4); +INSERT INTO t1 VALUES(0xAEB5); +INSERT INTO t1 VALUES(0xAEB6); +INSERT INTO t1 VALUES(0xAEB7); +INSERT INTO t1 VALUES(0xAEB8); +INSERT INTO t1 VALUES(0xAEB9); +INSERT INTO t1 VALUES(0xAEBA); +INSERT INTO t1 VALUES(0xAEBB); +INSERT INTO t1 VALUES(0xAEBC); +INSERT INTO t1 VALUES(0xAEBD); +INSERT INTO t1 VALUES(0xAEBE); +INSERT INTO t1 VALUES(0xAEBF); +INSERT INTO t1 VALUES(0xAEC0); +INSERT INTO t1 VALUES(0xAEC1); +INSERT INTO t1 VALUES(0xAEC2); +INSERT INTO t1 VALUES(0xAEC3); +INSERT INTO t1 VALUES(0xAEC4); +INSERT INTO t1 VALUES(0xAEC5); +INSERT INTO t1 VALUES(0xAEC6); +INSERT INTO t1 VALUES(0xAEC7); +INSERT INTO t1 VALUES(0xAEC8); +INSERT INTO t1 VALUES(0xAEC9); +INSERT INTO t1 VALUES(0xAECA); +INSERT INTO t1 VALUES(0xAECB); +INSERT INTO t1 VALUES(0xAECC); +INSERT INTO t1 VALUES(0xAECD); +INSERT INTO t1 VALUES(0xAECE); +INSERT INTO t1 VALUES(0xAECF); +INSERT INTO t1 VALUES(0xAED0); +INSERT INTO t1 VALUES(0xAED1); +INSERT INTO t1 VALUES(0xAED2); +INSERT INTO t1 VALUES(0xAED3); +INSERT INTO t1 VALUES(0xAED4); +INSERT INTO t1 VALUES(0xAED5); +INSERT INTO t1 VALUES(0xAED6); +INSERT INTO t1 VALUES(0xAED7); +INSERT INTO t1 VALUES(0xAED8); +INSERT INTO t1 VALUES(0xAED9); +INSERT INTO t1 VALUES(0xAEDA); +INSERT INTO t1 VALUES(0xAEDB); +INSERT INTO t1 VALUES(0xAEDC); +INSERT INTO t1 VALUES(0xAEDD); +INSERT INTO t1 VALUES(0xAEDE); +INSERT INTO t1 VALUES(0xAEDF); +INSERT INTO t1 VALUES(0xAEE0); +INSERT INTO t1 VALUES(0xAEE1); +INSERT INTO t1 VALUES(0xAEE2); +INSERT INTO t1 VALUES(0xAEE3); +INSERT INTO t1 VALUES(0xAEE4); +INSERT INTO t1 VALUES(0xAEE5); +INSERT INTO t1 VALUES(0xAEE6); +INSERT INTO t1 VALUES(0xAEE7); +INSERT INTO t1 VALUES(0xAEE8); +INSERT INTO t1 VALUES(0xAEE9); +INSERT INTO t1 VALUES(0xAEEA); +INSERT INTO t1 VALUES(0xAEEB); +INSERT INTO t1 VALUES(0xAEEC); +INSERT INTO t1 VALUES(0xAEED); +INSERT INTO t1 VALUES(0xAEEE); +INSERT INTO t1 VALUES(0xAEEF); +INSERT INTO t1 VALUES(0xAEF0); +INSERT INTO t1 VALUES(0xAEF1); +INSERT INTO t1 VALUES(0xAEF2); +INSERT INTO t1 VALUES(0xAEF3); +INSERT INTO t1 VALUES(0xAEF4); +INSERT INTO t1 VALUES(0xAEF5); +INSERT INTO t1 VALUES(0xAEF6); +INSERT INTO t1 VALUES(0xAEF7); +INSERT INTO t1 VALUES(0xAEF8); +INSERT INTO t1 VALUES(0xAEF9); +INSERT INTO t1 VALUES(0xAEFA); +INSERT INTO t1 VALUES(0xAEFB); +INSERT INTO t1 VALUES(0xAEFC); +INSERT INTO t1 VALUES(0xAEFD); +INSERT INTO t1 VALUES(0xAEFE); +INSERT INTO t1 VALUES(0xAFA1); +INSERT INTO t1 VALUES(0xAFA2); +INSERT INTO t1 VALUES(0xAFA3); +INSERT INTO t1 VALUES(0xAFA4); +INSERT INTO t1 VALUES(0xAFA5); +INSERT INTO t1 VALUES(0xAFA6); +INSERT INTO t1 VALUES(0xAFA7); +INSERT INTO t1 VALUES(0xAFA8); +INSERT INTO t1 VALUES(0xAFA9); +INSERT INTO t1 VALUES(0xAFAA); +INSERT INTO t1 VALUES(0xAFAB); +INSERT INTO t1 VALUES(0xAFAC); +INSERT INTO t1 VALUES(0xAFAD); +INSERT INTO t1 VALUES(0xAFAE); +INSERT INTO t1 VALUES(0xAFAF); +INSERT INTO t1 VALUES(0xAFB0); +INSERT INTO t1 VALUES(0xAFB1); +INSERT INTO t1 VALUES(0xAFB2); +INSERT INTO t1 VALUES(0xAFB3); +INSERT INTO t1 VALUES(0xAFB4); +INSERT INTO t1 VALUES(0xAFB5); +INSERT INTO t1 VALUES(0xAFB6); +INSERT INTO t1 VALUES(0xAFB7); +INSERT INTO t1 VALUES(0xAFB8); +INSERT INTO t1 VALUES(0xAFB9); +INSERT INTO t1 VALUES(0xAFBA); +INSERT INTO t1 VALUES(0xAFBB); +INSERT INTO t1 VALUES(0xAFBC); +INSERT INTO t1 VALUES(0xAFBD); +INSERT INTO t1 VALUES(0xAFBE); +INSERT INTO t1 VALUES(0xAFBF); +INSERT INTO t1 VALUES(0xAFC0); +INSERT INTO t1 VALUES(0xAFC1); +INSERT INTO t1 VALUES(0xAFC2); +INSERT INTO t1 VALUES(0xAFC3); +INSERT INTO t1 VALUES(0xAFC4); +INSERT INTO t1 VALUES(0xAFC5); +INSERT INTO t1 VALUES(0xAFC6); +INSERT INTO t1 VALUES(0xAFC7); +INSERT INTO t1 VALUES(0xAFC8); +INSERT INTO t1 VALUES(0xAFC9); +INSERT INTO t1 VALUES(0xAFCA); +INSERT INTO t1 VALUES(0xAFCB); +INSERT INTO t1 VALUES(0xAFCC); +INSERT INTO t1 VALUES(0xAFCD); +INSERT INTO t1 VALUES(0xAFCE); +INSERT INTO t1 VALUES(0xAFCF); +INSERT INTO t1 VALUES(0xAFD0); +INSERT INTO t1 VALUES(0xAFD1); +INSERT INTO t1 VALUES(0xAFD2); +INSERT INTO t1 VALUES(0xAFD3); +INSERT INTO t1 VALUES(0xAFD4); +INSERT INTO t1 VALUES(0xAFD5); +INSERT INTO t1 VALUES(0xAFD6); +INSERT INTO t1 VALUES(0xAFD7); +INSERT INTO t1 VALUES(0xAFD8); +INSERT INTO t1 VALUES(0xAFD9); +INSERT INTO t1 VALUES(0xAFDA); +INSERT INTO t1 VALUES(0xAFDB); +INSERT INTO t1 VALUES(0xAFDC); +INSERT INTO t1 VALUES(0xAFDD); +INSERT INTO t1 VALUES(0xAFDE); +INSERT INTO t1 VALUES(0xAFDF); +INSERT INTO t1 VALUES(0xAFE0); +INSERT INTO t1 VALUES(0xAFE1); +INSERT INTO t1 VALUES(0xAFE2); +INSERT INTO t1 VALUES(0xAFE3); +INSERT INTO t1 VALUES(0xAFE4); +INSERT INTO t1 VALUES(0xAFE5); +INSERT INTO t1 VALUES(0xAFE6); +INSERT INTO t1 VALUES(0xAFE7); +INSERT INTO t1 VALUES(0xAFE8); +INSERT INTO t1 VALUES(0xAFE9); +INSERT INTO t1 VALUES(0xAFEA); +INSERT INTO t1 VALUES(0xAFEB); +INSERT INTO t1 VALUES(0xAFEC); +INSERT INTO t1 VALUES(0xAFED); +INSERT INTO t1 VALUES(0xAFEE); +INSERT INTO t1 VALUES(0xAFEF); +INSERT INTO t1 VALUES(0xAFF0); +INSERT INTO t1 VALUES(0xAFF1); +INSERT INTO t1 VALUES(0xAFF2); +INSERT INTO t1 VALUES(0xAFF3); +INSERT INTO t1 VALUES(0xAFF4); +INSERT INTO t1 VALUES(0xAFF5); +INSERT INTO t1 VALUES(0xAFF6); +INSERT INTO t1 VALUES(0xAFF7); +INSERT INTO t1 VALUES(0xAFF8); +INSERT INTO t1 VALUES(0xAFF9); +INSERT INTO t1 VALUES(0xAFFA); +INSERT INTO t1 VALUES(0xAFFB); +INSERT INTO t1 VALUES(0xAFFC); +INSERT INTO t1 VALUES(0xAFFD); +INSERT INTO t1 VALUES(0xAFFE); +INSERT INTO t1 VALUES(0xCFD4); +INSERT INTO t1 VALUES(0xCFD5); +INSERT INTO t1 VALUES(0xCFD6); +INSERT INTO t1 VALUES(0xCFD7); +INSERT INTO t1 VALUES(0xCFD8); +INSERT INTO t1 VALUES(0xCFD9); +INSERT INTO t1 VALUES(0xCFDA); +INSERT INTO t1 VALUES(0xCFDB); +INSERT INTO t1 VALUES(0xCFDC); +INSERT INTO t1 VALUES(0xCFDD); +INSERT INTO t1 VALUES(0xCFDE); +INSERT INTO t1 VALUES(0xCFDF); +INSERT INTO t1 VALUES(0xCFE0); +INSERT INTO t1 VALUES(0xCFE1); +INSERT INTO t1 VALUES(0xCFE2); +INSERT INTO t1 VALUES(0xCFE3); +INSERT INTO t1 VALUES(0xCFE4); +INSERT INTO t1 VALUES(0xCFE5); +INSERT INTO t1 VALUES(0xCFE6); +INSERT INTO t1 VALUES(0xCFE7); +INSERT INTO t1 VALUES(0xCFE8); +INSERT INTO t1 VALUES(0xCFE9); +INSERT INTO t1 VALUES(0xCFEA); +INSERT INTO t1 VALUES(0xCFEB); +INSERT INTO t1 VALUES(0xCFEC); +INSERT INTO t1 VALUES(0xCFED); +INSERT INTO t1 VALUES(0xCFEE); +INSERT INTO t1 VALUES(0xCFEF); +INSERT INTO t1 VALUES(0xCFF0); +INSERT INTO t1 VALUES(0xCFF1); +INSERT INTO t1 VALUES(0xCFF2); +INSERT INTO t1 VALUES(0xCFF3); +INSERT INTO t1 VALUES(0xCFF4); +INSERT INTO t1 VALUES(0xCFF5); +INSERT INTO t1 VALUES(0xCFF6); +INSERT INTO t1 VALUES(0xCFF7); +INSERT INTO t1 VALUES(0xCFF8); +INSERT INTO t1 VALUES(0xCFF9); +INSERT INTO t1 VALUES(0xCFFA); +INSERT INTO t1 VALUES(0xCFFB); +INSERT INTO t1 VALUES(0xCFFC); +INSERT INTO t1 VALUES(0xCFFD); +INSERT INTO t1 VALUES(0xCFFE); +INSERT INTO t1 VALUES(0xF4A7); +INSERT INTO t1 VALUES(0xF4A8); +INSERT INTO t1 VALUES(0xF4A9); +INSERT INTO t1 VALUES(0xF4AA); +INSERT INTO t1 VALUES(0xF4AB); +INSERT INTO t1 VALUES(0xF4AC); +INSERT INTO t1 VALUES(0xF4AD); +INSERT INTO t1 VALUES(0xF4AE); +INSERT INTO t1 VALUES(0xF4AF); +INSERT INTO t1 VALUES(0xF4B0); +INSERT INTO t1 VALUES(0xF4B1); +INSERT INTO t1 VALUES(0xF4B2); +INSERT INTO t1 VALUES(0xF4B3); +INSERT INTO t1 VALUES(0xF4B4); +INSERT INTO t1 VALUES(0xF4B5); +INSERT INTO t1 VALUES(0xF4B6); +INSERT INTO t1 VALUES(0xF4B7); +INSERT INTO t1 VALUES(0xF4B8); +INSERT INTO t1 VALUES(0xF4B9); +INSERT INTO t1 VALUES(0xF4BA); +INSERT INTO t1 VALUES(0xF4BB); +INSERT INTO t1 VALUES(0xF4BC); +INSERT INTO t1 VALUES(0xF4BD); +INSERT INTO t1 VALUES(0xF4BE); +INSERT INTO t1 VALUES(0xF4BF); +INSERT INTO t1 VALUES(0xF4C0); +INSERT INTO t1 VALUES(0xF4C1); +INSERT INTO t1 VALUES(0xF4C2); +INSERT INTO t1 VALUES(0xF4C3); +INSERT INTO t1 VALUES(0xF4C4); +INSERT INTO t1 VALUES(0xF4C5); +INSERT INTO t1 VALUES(0xF4C6); +INSERT INTO t1 VALUES(0xF4C7); +INSERT INTO t1 VALUES(0xF4C8); +INSERT INTO t1 VALUES(0xF4C9); +INSERT INTO t1 VALUES(0xF4CA); +INSERT INTO t1 VALUES(0xF4CB); +INSERT INTO t1 VALUES(0xF4CC); +INSERT INTO t1 VALUES(0xF4CD); +INSERT INTO t1 VALUES(0xF4CE); +INSERT INTO t1 VALUES(0xF4CF); +INSERT INTO t1 VALUES(0xF4D0); +INSERT INTO t1 VALUES(0xF4D1); +INSERT INTO t1 VALUES(0xF4D2); +INSERT INTO t1 VALUES(0xF4D3); +INSERT INTO t1 VALUES(0xF4D4); +INSERT INTO t1 VALUES(0xF4D5); +INSERT INTO t1 VALUES(0xF4D6); +INSERT INTO t1 VALUES(0xF4D7); +INSERT INTO t1 VALUES(0xF4D8); +INSERT INTO t1 VALUES(0xF4D9); +INSERT INTO t1 VALUES(0xF4DA); +INSERT INTO t1 VALUES(0xF4DB); +INSERT INTO t1 VALUES(0xF4DC); +INSERT INTO t1 VALUES(0xF4DD); +INSERT INTO t1 VALUES(0xF4DE); +INSERT INTO t1 VALUES(0xF4DF); +INSERT INTO t1 VALUES(0xF4E0); +INSERT INTO t1 VALUES(0xF4E1); +INSERT INTO t1 VALUES(0xF4E2); +INSERT INTO t1 VALUES(0xF4E3); +INSERT INTO t1 VALUES(0xF4E4); +INSERT INTO t1 VALUES(0xF4E5); +INSERT INTO t1 VALUES(0xF4E6); +INSERT INTO t1 VALUES(0xF4E7); +INSERT INTO t1 VALUES(0xF4E8); +INSERT INTO t1 VALUES(0xF4E9); +INSERT INTO t1 VALUES(0xF4EA); +INSERT INTO t1 VALUES(0xF4EB); +INSERT INTO t1 VALUES(0xF4EC); +INSERT INTO t1 VALUES(0xF4ED); +INSERT INTO t1 VALUES(0xF4EE); +INSERT INTO t1 VALUES(0xF4EF); +INSERT INTO t1 VALUES(0xF4F0); +INSERT INTO t1 VALUES(0xF4F1); +INSERT INTO t1 VALUES(0xF4F2); +INSERT INTO t1 VALUES(0xF4F3); +INSERT INTO t1 VALUES(0xF4F4); +INSERT INTO t1 VALUES(0xF4F5); +INSERT INTO t1 VALUES(0xF4F6); +INSERT INTO t1 VALUES(0xF4F7); +INSERT INTO t1 VALUES(0xF4F8); +INSERT INTO t1 VALUES(0xF4F9); +INSERT INTO t1 VALUES(0xF4FA); +INSERT INTO t1 VALUES(0xF4FB); +INSERT INTO t1 VALUES(0xF4FC); +INSERT INTO t1 VALUES(0xF4FD); +INSERT INTO t1 VALUES(0xF4FE); +SELECT HEX(c) FROM t1 ORDER BY BINARY c; +HEX(c) +A2AF +A2B0 +A2B1 +A2B2 +A2B3 +A2B4 +A2B5 +A2B6 +A2B7 +A2B8 +A2B9 +A2C2 +A2C3 +A2C4 +A2C5 +A2C6 +A2C7 +A2C8 +A2C9 +A2D1 +A2D2 +A2D3 +A2D4 +A2D5 +A2D6 +A2D7 +A2D8 +A2D9 +A2DA +A2DB +A2EB +A2EC +A2ED +A2EE +A2EF +A2F0 +A2F1 +A2FA +A2FB +A2FC +A2FD +A3A1 +A3A2 +A3A3 +A3A4 +A3A5 +A3A6 +A3A7 +A3A8 +A3A9 +A3AA +A3AB +A3AC +A3AD +A3AE +A3AF +A3BA +A3BB +A3BC +A3BD +A3BE +A3BF +A3C0 +A3DB +A3DC +A3DD +A3DE +A3DF +A3E0 +A3FB +A3FC +A3FD +A3FE +A4F4 +A4F5 +A4F6 +A4F7 +A4F8 +A4F9 +A4FA +A4FB +A4FC +A4FD +A4FE +A5F7 +A5F8 +A5F9 +A5FA +A5FB +A5FC +A5FD +A5FE +A6B9 +A6BA +A6BB +A6BC +A6BD +A6BE +A6BF +A6C0 +A6D9 +A6DA +A6DB +A6DC +A6DD +A6DE +A6DF +A6E0 +A6E1 +A6E2 +A6E3 +A6E4 +A6E5 +A6E6 +A6E7 +A6E8 +A6E9 +A6EA +A6EB +A6EC +A6ED +A6EE +A6EF +A6F0 +A6F1 +A6F2 +A6F3 +A6F4 +A6F5 +A6F6 +A6F7 +A6F8 +A6F9 +A6FA +A6FB +A6FC +A6FD +A6FE +A7C2 +A7C3 +A7C4 +A7C5 +A7C6 +A7C7 +A7C8 +A7C9 +A7CA +A7CB +A7CC +A7CD +A7CE +A7CF +A7D0 +A7F2 +A7F3 +A7F4 +A7F5 +A7F6 +A7F7 +A7F8 +A7F9 +A7FA +A7FB +A7FC +A7FD +A7FE +A8C1 +A8C2 +A8C3 +A8C4 +A8C5 +A8C6 +A8C7 +A8C8 +A8C9 +A8CA +A8CB +A8CC +A8CD +A8CE +A8CF +A8D0 +A8D1 +A8D2 +A8D3 +A8D4 +A8D5 +A8D6 +A8D7 +A8D8 +A8D9 +A8DA +A8DB +A8DC +A8DD +A8DE +A8DF +A8E0 +A8E1 +A8E2 +A8E3 +A8E4 +A8E5 +A8E6 +A8E7 +A8E8 +A8E9 +A8EA +A8EB +A8EC +A8ED +A8EE +A8EF +A8F0 +A8F1 +A8F2 +A8F3 +A8F4 +A8F5 +A8F6 +A8F7 +A8F8 +A8F9 +A8FA +A8FB +A8FC +A8FD +A8FE +A9A1 +A9A2 +A9A3 +A9A4 +A9A5 +A9A6 +A9A7 +A9A8 +A9A9 +A9AA +A9AB +A9AC +A9AD +A9AE +A9AF +A9B0 +A9B1 +A9B2 +A9B3 +A9B4 +A9B5 +A9B6 +A9B7 +A9B8 +A9B9 +A9BA +A9BB +A9BC +A9BD +A9BE +A9BF +A9C0 +A9C1 +A9C2 +A9C3 +A9C4 +A9C5 +A9C6 +A9C7 +A9C8 +A9C9 +A9CA +A9CB +A9CC +A9CD +A9CE +A9CF +A9D0 +A9D1 +A9D2 +A9D3 +A9D4 +A9D5 +A9D6 +A9D7 +A9D8 +A9D9 +A9DA +A9DB +A9DC +A9DD +A9DE +A9DF +A9E0 +A9E1 +A9E2 +A9E3 +A9E4 +A9E5 +A9E6 +A9E7 +A9E8 +A9E9 +A9EA +A9EB +A9EC +A9ED +A9EE +A9EF +A9F0 +A9F1 +A9F2 +A9F3 +A9F4 +A9F5 +A9F6 +A9F7 +A9F8 +A9F9 +A9FA +A9FB +A9FC +A9FD +A9FE +AAA1 +AAA2 +AAA3 +AAA4 +AAA5 +AAA6 +AAA7 +AAA8 +AAA9 +AAAA +AAAB +AAAC +AAAD +AAAE +AAAF +AAB0 +AAB1 +AAB2 +AAB3 +AAB4 +AAB5 +AAB6 +AAB7 +AAB8 +AAB9 +AABA +AABB +AABC +AABD +AABE +AABF +AAC0 +AAC1 +AAC2 +AAC3 +AAC4 +AAC5 +AAC6 +AAC7 +AAC8 +AAC9 +AACA +AACB +AACC +AACD +AACE +AACF +AAD0 +AAD1 +AAD2 +AAD3 +AAD4 +AAD5 +AAD6 +AAD7 +AAD8 +AAD9 +AADA +AADB +AADC +AADD +AADE +AADF +AAE0 +AAE1 +AAE2 +AAE3 +AAE4 +AAE5 +AAE6 +AAE7 +AAE8 +AAE9 +AAEA +AAEB +AAEC +AAED +AAEE +AAEF +AAF0 +AAF1 +AAF2 +AAF3 +AAF4 +AAF5 +AAF6 +AAF7 +AAF8 +AAF9 +AAFA +AAFB +AAFC +AAFD +AAFE +ABA1 +ABA2 +ABA3 +ABA4 +ABA5 +ABA6 +ABA7 +ABA8 +ABA9 +ABAA +ABAB +ABAC +ABAD +ABAE +ABAF +ABB0 +ABB1 +ABB2 +ABB3 +ABB4 +ABB5 +ABB6 +ABB7 +ABB8 +ABB9 +ABBA +ABBB +ABBC +ABBD +ABBE +ABBF +ABC0 +ABC1 +ABC2 +ABC3 +ABC4 +ABC5 +ABC6 +ABC7 +ABC8 +ABC9 +ABCA +ABCB +ABCC +ABCD +ABCE +ABCF +ABD0 +ABD1 +ABD2 +ABD3 +ABD4 +ABD5 +ABD6 +ABD7 +ABD8 +ABD9 +ABDA +ABDB +ABDC +ABDD +ABDE +ABDF +ABE0 +ABE1 +ABE2 +ABE3 +ABE4 +ABE5 +ABE6 +ABE7 +ABE8 +ABE9 +ABEA +ABEB +ABEC +ABED +ABEE +ABEF +ABF0 +ABF1 +ABF2 +ABF3 +ABF4 +ABF5 +ABF6 +ABF7 +ABF8 +ABF9 +ABFA +ABFB +ABFC +ABFD +ABFE +ACA1 +ACA2 +ACA3 +ACA4 +ACA5 +ACA6 +ACA7 +ACA8 +ACA9 +ACAA +ACAB +ACAC +ACAD +ACAE +ACAF +ACB0 +ACB1 +ACB2 +ACB3 +ACB4 +ACB5 +ACB6 +ACB7 +ACB8 +ACB9 +ACBA +ACBB +ACBC +ACBD +ACBE +ACBF +ACC0 +ACC1 +ACC2 +ACC3 +ACC4 +ACC5 +ACC6 +ACC7 +ACC8 +ACC9 +ACCA +ACCB +ACCC +ACCD +ACCE +ACCF +ACD0 +ACD1 +ACD2 +ACD3 +ACD4 +ACD5 +ACD6 +ACD7 +ACD8 +ACD9 +ACDA +ACDB +ACDC +ACDD +ACDE +ACDF +ACE0 +ACE1 +ACE2 +ACE3 +ACE4 +ACE5 +ACE6 +ACE7 +ACE8 +ACE9 +ACEA +ACEB +ACEC +ACED +ACEE +ACEF +ACF0 +ACF1 +ACF2 +ACF3 +ACF4 +ACF5 +ACF6 +ACF7 +ACF8 +ACF9 +ACFA +ACFB +ACFC +ACFD +ACFE +ADA1 +ADA2 +ADA3 +ADA4 +ADA5 +ADA6 +ADA7 +ADA8 +ADA9 +ADAA +ADAB +ADAC +ADAD +ADAE +ADAF +ADB0 +ADB1 +ADB2 +ADB3 +ADB4 +ADB5 +ADB6 +ADB7 +ADB8 +ADB9 +ADBA +ADBB +ADBC +ADBD +ADBE +ADBF +ADC0 +ADC1 +ADC2 +ADC3 +ADC4 +ADC5 +ADC6 +ADC7 +ADC8 +ADC9 +ADCA +ADCB +ADCC +ADCD +ADCE +ADCF +ADD0 +ADD1 +ADD2 +ADD3 +ADD4 +ADD5 +ADD6 +ADD7 +ADD8 +ADD9 +ADDA +ADDB +ADDC +ADDD +ADDE +ADDF +ADE0 +ADE1 +ADE2 +ADE3 +ADE4 +ADE5 +ADE6 +ADE7 +ADE8 +ADE9 +ADEA +ADEB +ADEC +ADED +ADEE +ADEF +ADF0 +ADF1 +ADF2 +ADF3 +ADF4 +ADF5 +ADF6 +ADF7 +ADF8 +ADF9 +ADFA +ADFB +ADFC +ADFD +ADFE +AEA1 +AEA2 +AEA3 +AEA4 +AEA5 +AEA6 +AEA7 +AEA8 +AEA9 +AEAA +AEAB +AEAC +AEAD +AEAE +AEAF +AEB0 +AEB1 +AEB2 +AEB3 +AEB4 +AEB5 +AEB6 +AEB7 +AEB8 +AEB9 +AEBA +AEBB +AEBC +AEBD +AEBE +AEBF +AEC0 +AEC1 +AEC2 +AEC3 +AEC4 +AEC5 +AEC6 +AEC7 +AEC8 +AEC9 +AECA +AECB +AECC +AECD +AECE +AECF +AED0 +AED1 +AED2 +AED3 +AED4 +AED5 +AED6 +AED7 +AED8 +AED9 +AEDA +AEDB +AEDC +AEDD +AEDE +AEDF +AEE0 +AEE1 +AEE2 +AEE3 +AEE4 +AEE5 +AEE6 +AEE7 +AEE8 +AEE9 +AEEA +AEEB +AEEC +AEED +AEEE +AEEF +AEF0 +AEF1 +AEF2 +AEF3 +AEF4 +AEF5 +AEF6 +AEF7 +AEF8 +AEF9 +AEFA +AEFB +AEFC +AEFD +AEFE +AFA1 +AFA2 +AFA3 +AFA4 +AFA5 +AFA6 +AFA7 +AFA8 +AFA9 +AFAA +AFAB +AFAC +AFAD +AFAE +AFAF +AFB0 +AFB1 +AFB2 +AFB3 +AFB4 +AFB5 +AFB6 +AFB7 +AFB8 +AFB9 +AFBA +AFBB +AFBC +AFBD +AFBE +AFBF +AFC0 +AFC1 +AFC2 +AFC3 +AFC4 +AFC5 +AFC6 +AFC7 +AFC8 +AFC9 +AFCA +AFCB +AFCC +AFCD +AFCE +AFCF +AFD0 +AFD1 +AFD2 +AFD3 +AFD4 +AFD5 +AFD6 +AFD7 +AFD8 +AFD9 +AFDA +AFDB +AFDC +AFDD +AFDE +AFDF +AFE0 +AFE1 +AFE2 +AFE3 +AFE4 +AFE5 +AFE6 +AFE7 +AFE8 +AFE9 +AFEA +AFEB +AFEC +AFED +AFEE +AFEF +AFF0 +AFF1 +AFF2 +AFF3 +AFF4 +AFF5 +AFF6 +AFF7 +AFF8 +AFF9 +AFFA +AFFB +AFFC +AFFD +AFFE +CFD4 +CFD5 +CFD6 +CFD7 +CFD8 +CFD9 +CFDA +CFDB +CFDC +CFDD +CFDE +CFDF +CFE0 +CFE1 +CFE2 +CFE3 +CFE4 +CFE5 +CFE6 +CFE7 +CFE8 +CFE9 +CFEA +CFEB +CFEC +CFED +CFEE +CFEF +CFF0 +CFF1 +CFF2 +CFF3 +CFF4 +CFF5 +CFF6 +CFF7 +CFF8 +CFF9 +CFFA +CFFB +CFFC +CFFD +CFFE +F4A7 +F4A8 +F4A9 +F4AA +F4AB +F4AC +F4AD +F4AE +F4AF +F4B0 +F4B1 +F4B2 +F4B3 +F4B4 +F4B5 +F4B6 +F4B7 +F4B8 +F4B9 +F4BA +F4BB +F4BC +F4BD +F4BE +F4BF +F4C0 +F4C1 +F4C2 +F4C3 +F4C4 +F4C5 +F4C6 +F4C7 +F4C8 +F4C9 +F4CA +F4CB +F4CC +F4CD +F4CE +F4CF +F4D0 +F4D1 +F4D2 +F4D3 +F4D4 +F4D5 +F4D6 +F4D7 +F4D8 +F4D9 +F4DA +F4DB +F4DC +F4DD +F4DE +F4DF +F4E0 +F4E1 +F4E2 +F4E3 +F4E4 +F4E5 +F4E6 +F4E7 +F4E8 +F4E9 +F4EA +F4EB +F4EC +F4ED +F4EE +F4EF +F4F0 +F4F1 +F4F2 +F4F3 +F4F4 +F4F5 +F4F6 +F4F7 +F4F8 +F4F9 +F4FA +F4FB +F4FC +F4FD +F4FE +DROP TABLE t1; diff --git a/mysql-test/t/ctype_ujis.test b/mysql-test/t/ctype_ujis.test index 9cfb6b14d7e..3f0e9882179 100644 --- a/mysql-test/t/ctype_ujis.test +++ b/mysql-test/t/ctype_ujis.test @@ -119,3 +119,1025 @@ SELECT t1.* FROM t1 WHERE b='aaabbbcccddd' ORDER BY a; SELECT t1.* FROM t1 WHERE b='eeefffggghhh' ORDER BY a; SELECT t1.* FROM t1 WHERE b='iiijjjkkkl' ORDER BY a; DROP TABLE t1; + +DROP TABLE IF EXISTS t1; +CREATE TABLE t1(c char(1)) character set ujis; +INSERT INTO t1 VALUES(0xA2AF); +INSERT INTO t1 VALUES(0xA2B0); +INSERT INTO t1 VALUES(0xA2B1); +INSERT INTO t1 VALUES(0xA2B2); +INSERT INTO t1 VALUES(0xA2B3); +INSERT INTO t1 VALUES(0xA2B4); +INSERT INTO t1 VALUES(0xA2B5); +INSERT INTO t1 VALUES(0xA2B6); +INSERT INTO t1 VALUES(0xA2B7); +INSERT INTO t1 VALUES(0xA2B8); +INSERT INTO t1 VALUES(0xA2B9); +INSERT INTO t1 VALUES(0xA2C2); +INSERT INTO t1 VALUES(0xA2C3); +INSERT INTO t1 VALUES(0xA2C4); +INSERT INTO t1 VALUES(0xA2C5); +INSERT INTO t1 VALUES(0xA2C6); +INSERT INTO t1 VALUES(0xA2C7); +INSERT INTO t1 VALUES(0xA2C8); +INSERT INTO t1 VALUES(0xA2C9); +INSERT INTO t1 VALUES(0xA2D1); +INSERT INTO t1 VALUES(0xA2D2); +INSERT INTO t1 VALUES(0xA2D3); +INSERT INTO t1 VALUES(0xA2D4); +INSERT INTO t1 VALUES(0xA2D5); +INSERT INTO t1 VALUES(0xA2D6); +INSERT INTO t1 VALUES(0xA2D7); +INSERT INTO t1 VALUES(0xA2D8); +INSERT INTO t1 VALUES(0xA2D9); +INSERT INTO t1 VALUES(0xA2DA); +INSERT INTO t1 VALUES(0xA2DB); +INSERT INTO t1 VALUES(0xA2EB); +INSERT INTO t1 VALUES(0xA2EC); +INSERT INTO t1 VALUES(0xA2ED); +INSERT INTO t1 VALUES(0xA2EE); +INSERT INTO t1 VALUES(0xA2EF); +INSERT INTO t1 VALUES(0xA2F0); +INSERT INTO t1 VALUES(0xA2F1); +INSERT INTO t1 VALUES(0xA2FA); +INSERT INTO t1 VALUES(0xA2FB); +INSERT INTO t1 VALUES(0xA2FC); +INSERT INTO t1 VALUES(0xA2FD); +INSERT INTO t1 VALUES(0xA3A1); +INSERT INTO t1 VALUES(0xA3A2); +INSERT INTO t1 VALUES(0xA3A3); +INSERT INTO t1 VALUES(0xA3A4); +INSERT INTO t1 VALUES(0xA3A5); +INSERT INTO t1 VALUES(0xA3A6); +INSERT INTO t1 VALUES(0xA3A7); +INSERT INTO t1 VALUES(0xA3A8); +INSERT INTO t1 VALUES(0xA3A9); +INSERT INTO t1 VALUES(0xA3AA); +INSERT INTO t1 VALUES(0xA3AB); +INSERT INTO t1 VALUES(0xA3AC); +INSERT INTO t1 VALUES(0xA3AD); +INSERT INTO t1 VALUES(0xA3AE); +INSERT INTO t1 VALUES(0xA3AF); +INSERT INTO t1 VALUES(0xA3BA); +INSERT INTO t1 VALUES(0xA3BB); +INSERT INTO t1 VALUES(0xA3BC); +INSERT INTO t1 VALUES(0xA3BD); +INSERT INTO t1 VALUES(0xA3BE); +INSERT INTO t1 VALUES(0xA3BF); +INSERT INTO t1 VALUES(0xA3C0); +INSERT INTO t1 VALUES(0xA3DB); +INSERT INTO t1 VALUES(0xA3DC); +INSERT INTO t1 VALUES(0xA3DD); +INSERT INTO t1 VALUES(0xA3DE); +INSERT INTO t1 VALUES(0xA3DF); +INSERT INTO t1 VALUES(0xA3E0); +INSERT INTO t1 VALUES(0xA3FB); +INSERT INTO t1 VALUES(0xA3FC); +INSERT INTO t1 VALUES(0xA3FD); +INSERT INTO t1 VALUES(0xA3FE); +INSERT INTO t1 VALUES(0xA4F4); +INSERT INTO t1 VALUES(0xA4F5); +INSERT INTO t1 VALUES(0xA4F6); +INSERT INTO t1 VALUES(0xA4F7); +INSERT INTO t1 VALUES(0xA4F8); +INSERT INTO t1 VALUES(0xA4F9); +INSERT INTO t1 VALUES(0xA4FA); +INSERT INTO t1 VALUES(0xA4FB); +INSERT INTO t1 VALUES(0xA4FC); +INSERT INTO t1 VALUES(0xA4FD); +INSERT INTO t1 VALUES(0xA4FE); +INSERT INTO t1 VALUES(0xA5F7); +INSERT INTO t1 VALUES(0xA5F8); +INSERT INTO t1 VALUES(0xA5F9); +INSERT INTO t1 VALUES(0xA5FA); +INSERT INTO t1 VALUES(0xA5FB); +INSERT INTO t1 VALUES(0xA5FC); +INSERT INTO t1 VALUES(0xA5FD); +INSERT INTO t1 VALUES(0xA5FE); +INSERT INTO t1 VALUES(0xA6B9); +INSERT INTO t1 VALUES(0xA6BA); +INSERT INTO t1 VALUES(0xA6BB); +INSERT INTO t1 VALUES(0xA6BC); +INSERT INTO t1 VALUES(0xA6BD); +INSERT INTO t1 VALUES(0xA6BE); +INSERT INTO t1 VALUES(0xA6BF); +INSERT INTO t1 VALUES(0xA6C0); +INSERT INTO t1 VALUES(0xA6D9); +INSERT INTO t1 VALUES(0xA6DA); +INSERT INTO t1 VALUES(0xA6DB); +INSERT INTO t1 VALUES(0xA6DC); +INSERT INTO t1 VALUES(0xA6DD); +INSERT INTO t1 VALUES(0xA6DE); +INSERT INTO t1 VALUES(0xA6DF); +INSERT INTO t1 VALUES(0xA6E0); +INSERT INTO t1 VALUES(0xA6E1); +INSERT INTO t1 VALUES(0xA6E2); +INSERT INTO t1 VALUES(0xA6E3); +INSERT INTO t1 VALUES(0xA6E4); +INSERT INTO t1 VALUES(0xA6E5); +INSERT INTO t1 VALUES(0xA6E6); +INSERT INTO t1 VALUES(0xA6E7); +INSERT INTO t1 VALUES(0xA6E8); +INSERT INTO t1 VALUES(0xA6E9); +INSERT INTO t1 VALUES(0xA6EA); +INSERT INTO t1 VALUES(0xA6EB); +INSERT INTO t1 VALUES(0xA6EC); +INSERT INTO t1 VALUES(0xA6ED); +INSERT INTO t1 VALUES(0xA6EE); +INSERT INTO t1 VALUES(0xA6EF); +INSERT INTO t1 VALUES(0xA6F0); +INSERT INTO t1 VALUES(0xA6F1); +INSERT INTO t1 VALUES(0xA6F2); +INSERT INTO t1 VALUES(0xA6F3); +INSERT INTO t1 VALUES(0xA6F4); +INSERT INTO t1 VALUES(0xA6F5); +INSERT INTO t1 VALUES(0xA6F6); +INSERT INTO t1 VALUES(0xA6F7); +INSERT INTO t1 VALUES(0xA6F8); +INSERT INTO t1 VALUES(0xA6F9); +INSERT INTO t1 VALUES(0xA6FA); +INSERT INTO t1 VALUES(0xA6FB); +INSERT INTO t1 VALUES(0xA6FC); +INSERT INTO t1 VALUES(0xA6FD); +INSERT INTO t1 VALUES(0xA6FE); +INSERT INTO t1 VALUES(0xA7C2); +INSERT INTO t1 VALUES(0xA7C3); +INSERT INTO t1 VALUES(0xA7C4); +INSERT INTO t1 VALUES(0xA7C5); +INSERT INTO t1 VALUES(0xA7C6); +INSERT INTO t1 VALUES(0xA7C7); +INSERT INTO t1 VALUES(0xA7C8); +INSERT INTO t1 VALUES(0xA7C9); +INSERT INTO t1 VALUES(0xA7CA); +INSERT INTO t1 VALUES(0xA7CB); +INSERT INTO t1 VALUES(0xA7CC); +INSERT INTO t1 VALUES(0xA7CD); +INSERT INTO t1 VALUES(0xA7CE); +INSERT INTO t1 VALUES(0xA7CF); +INSERT INTO t1 VALUES(0xA7D0); +INSERT INTO t1 VALUES(0xA7F2); +INSERT INTO t1 VALUES(0xA7F3); +INSERT INTO t1 VALUES(0xA7F4); +INSERT INTO t1 VALUES(0xA7F5); +INSERT INTO t1 VALUES(0xA7F6); +INSERT INTO t1 VALUES(0xA7F7); +INSERT INTO t1 VALUES(0xA7F8); +INSERT INTO t1 VALUES(0xA7F9); +INSERT INTO t1 VALUES(0xA7FA); +INSERT INTO t1 VALUES(0xA7FB); +INSERT INTO t1 VALUES(0xA7FC); +INSERT INTO t1 VALUES(0xA7FD); +INSERT INTO t1 VALUES(0xA7FE); +INSERT INTO t1 VALUES(0xA8C1); +INSERT INTO t1 VALUES(0xA8C2); +INSERT INTO t1 VALUES(0xA8C3); +INSERT INTO t1 VALUES(0xA8C4); +INSERT INTO t1 VALUES(0xA8C5); +INSERT INTO t1 VALUES(0xA8C6); +INSERT INTO t1 VALUES(0xA8C7); +INSERT INTO t1 VALUES(0xA8C8); +INSERT INTO t1 VALUES(0xA8C9); +INSERT INTO t1 VALUES(0xA8CA); +INSERT INTO t1 VALUES(0xA8CB); +INSERT INTO t1 VALUES(0xA8CC); +INSERT INTO t1 VALUES(0xA8CD); +INSERT INTO t1 VALUES(0xA8CE); +INSERT INTO t1 VALUES(0xA8CF); +INSERT INTO t1 VALUES(0xA8D0); +INSERT INTO t1 VALUES(0xA8D1); +INSERT INTO t1 VALUES(0xA8D2); +INSERT INTO t1 VALUES(0xA8D3); +INSERT INTO t1 VALUES(0xA8D4); +INSERT INTO t1 VALUES(0xA8D5); +INSERT INTO t1 VALUES(0xA8D6); +INSERT INTO t1 VALUES(0xA8D7); +INSERT INTO t1 VALUES(0xA8D8); +INSERT INTO t1 VALUES(0xA8D9); +INSERT INTO t1 VALUES(0xA8DA); +INSERT INTO t1 VALUES(0xA8DB); +INSERT INTO t1 VALUES(0xA8DC); +INSERT INTO t1 VALUES(0xA8DD); +INSERT INTO t1 VALUES(0xA8DE); +INSERT INTO t1 VALUES(0xA8DF); +INSERT INTO t1 VALUES(0xA8E0); +INSERT INTO t1 VALUES(0xA8E1); +INSERT INTO t1 VALUES(0xA8E2); +INSERT INTO t1 VALUES(0xA8E3); +INSERT INTO t1 VALUES(0xA8E4); +INSERT INTO t1 VALUES(0xA8E5); +INSERT INTO t1 VALUES(0xA8E6); +INSERT INTO t1 VALUES(0xA8E7); +INSERT INTO t1 VALUES(0xA8E8); +INSERT INTO t1 VALUES(0xA8E9); +INSERT INTO t1 VALUES(0xA8EA); +INSERT INTO t1 VALUES(0xA8EB); +INSERT INTO t1 VALUES(0xA8EC); +INSERT INTO t1 VALUES(0xA8ED); +INSERT INTO t1 VALUES(0xA8EE); +INSERT INTO t1 VALUES(0xA8EF); +INSERT INTO t1 VALUES(0xA8F0); +INSERT INTO t1 VALUES(0xA8F1); +INSERT INTO t1 VALUES(0xA8F2); +INSERT INTO t1 VALUES(0xA8F3); +INSERT INTO t1 VALUES(0xA8F4); +INSERT INTO t1 VALUES(0xA8F5); +INSERT INTO t1 VALUES(0xA8F6); +INSERT INTO t1 VALUES(0xA8F7); +INSERT INTO t1 VALUES(0xA8F8); +INSERT INTO t1 VALUES(0xA8F9); +INSERT INTO t1 VALUES(0xA8FA); +INSERT INTO t1 VALUES(0xA8FB); +INSERT INTO t1 VALUES(0xA8FC); +INSERT INTO t1 VALUES(0xA8FD); +INSERT INTO t1 VALUES(0xA8FE); +INSERT INTO t1 VALUES(0xA9A1); +INSERT INTO t1 VALUES(0xA9A2); +INSERT INTO t1 VALUES(0xA9A3); +INSERT INTO t1 VALUES(0xA9A4); +INSERT INTO t1 VALUES(0xA9A5); +INSERT INTO t1 VALUES(0xA9A6); +INSERT INTO t1 VALUES(0xA9A7); +INSERT INTO t1 VALUES(0xA9A8); +INSERT INTO t1 VALUES(0xA9A9); +INSERT INTO t1 VALUES(0xA9AA); +INSERT INTO t1 VALUES(0xA9AB); +INSERT INTO t1 VALUES(0xA9AC); +INSERT INTO t1 VALUES(0xA9AD); +INSERT INTO t1 VALUES(0xA9AE); +INSERT INTO t1 VALUES(0xA9AF); +INSERT INTO t1 VALUES(0xA9B0); +INSERT INTO t1 VALUES(0xA9B1); +INSERT INTO t1 VALUES(0xA9B2); +INSERT INTO t1 VALUES(0xA9B3); +INSERT INTO t1 VALUES(0xA9B4); +INSERT INTO t1 VALUES(0xA9B5); +INSERT INTO t1 VALUES(0xA9B6); +INSERT INTO t1 VALUES(0xA9B7); +INSERT INTO t1 VALUES(0xA9B8); +INSERT INTO t1 VALUES(0xA9B9); +INSERT INTO t1 VALUES(0xA9BA); +INSERT INTO t1 VALUES(0xA9BB); +INSERT INTO t1 VALUES(0xA9BC); +INSERT INTO t1 VALUES(0xA9BD); +INSERT INTO t1 VALUES(0xA9BE); +INSERT INTO t1 VALUES(0xA9BF); +INSERT INTO t1 VALUES(0xA9C0); +INSERT INTO t1 VALUES(0xA9C1); +INSERT INTO t1 VALUES(0xA9C2); +INSERT INTO t1 VALUES(0xA9C3); +INSERT INTO t1 VALUES(0xA9C4); +INSERT INTO t1 VALUES(0xA9C5); +INSERT INTO t1 VALUES(0xA9C6); +INSERT INTO t1 VALUES(0xA9C7); +INSERT INTO t1 VALUES(0xA9C8); +INSERT INTO t1 VALUES(0xA9C9); +INSERT INTO t1 VALUES(0xA9CA); +INSERT INTO t1 VALUES(0xA9CB); +INSERT INTO t1 VALUES(0xA9CC); +INSERT INTO t1 VALUES(0xA9CD); +INSERT INTO t1 VALUES(0xA9CE); +INSERT INTO t1 VALUES(0xA9CF); +INSERT INTO t1 VALUES(0xA9D0); +INSERT INTO t1 VALUES(0xA9D1); +INSERT INTO t1 VALUES(0xA9D2); +INSERT INTO t1 VALUES(0xA9D3); +INSERT INTO t1 VALUES(0xA9D4); +INSERT INTO t1 VALUES(0xA9D5); +INSERT INTO t1 VALUES(0xA9D6); +INSERT INTO t1 VALUES(0xA9D7); +INSERT INTO t1 VALUES(0xA9D8); +INSERT INTO t1 VALUES(0xA9D9); +INSERT INTO t1 VALUES(0xA9DA); +INSERT INTO t1 VALUES(0xA9DB); +INSERT INTO t1 VALUES(0xA9DC); +INSERT INTO t1 VALUES(0xA9DD); +INSERT INTO t1 VALUES(0xA9DE); +INSERT INTO t1 VALUES(0xA9DF); +INSERT INTO t1 VALUES(0xA9E0); +INSERT INTO t1 VALUES(0xA9E1); +INSERT INTO t1 VALUES(0xA9E2); +INSERT INTO t1 VALUES(0xA9E3); +INSERT INTO t1 VALUES(0xA9E4); +INSERT INTO t1 VALUES(0xA9E5); +INSERT INTO t1 VALUES(0xA9E6); +INSERT INTO t1 VALUES(0xA9E7); +INSERT INTO t1 VALUES(0xA9E8); +INSERT INTO t1 VALUES(0xA9E9); +INSERT INTO t1 VALUES(0xA9EA); +INSERT INTO t1 VALUES(0xA9EB); +INSERT INTO t1 VALUES(0xA9EC); +INSERT INTO t1 VALUES(0xA9ED); +INSERT INTO t1 VALUES(0xA9EE); +INSERT INTO t1 VALUES(0xA9EF); +INSERT INTO t1 VALUES(0xA9F0); +INSERT INTO t1 VALUES(0xA9F1); +INSERT INTO t1 VALUES(0xA9F2); +INSERT INTO t1 VALUES(0xA9F3); +INSERT INTO t1 VALUES(0xA9F4); +INSERT INTO t1 VALUES(0xA9F5); +INSERT INTO t1 VALUES(0xA9F6); +INSERT INTO t1 VALUES(0xA9F7); +INSERT INTO t1 VALUES(0xA9F8); +INSERT INTO t1 VALUES(0xA9F9); +INSERT INTO t1 VALUES(0xA9FA); +INSERT INTO t1 VALUES(0xA9FB); +INSERT INTO t1 VALUES(0xA9FC); +INSERT INTO t1 VALUES(0xA9FD); +INSERT INTO t1 VALUES(0xA9FE); +INSERT INTO t1 VALUES(0xAAA1); +INSERT INTO t1 VALUES(0xAAA2); +INSERT INTO t1 VALUES(0xAAA3); +INSERT INTO t1 VALUES(0xAAA4); +INSERT INTO t1 VALUES(0xAAA5); +INSERT INTO t1 VALUES(0xAAA6); +INSERT INTO t1 VALUES(0xAAA7); +INSERT INTO t1 VALUES(0xAAA8); +INSERT INTO t1 VALUES(0xAAA9); +INSERT INTO t1 VALUES(0xAAAA); +INSERT INTO t1 VALUES(0xAAAB); +INSERT INTO t1 VALUES(0xAAAC); +INSERT INTO t1 VALUES(0xAAAD); +INSERT INTO t1 VALUES(0xAAAE); +INSERT INTO t1 VALUES(0xAAAF); +INSERT INTO t1 VALUES(0xAAB0); +INSERT INTO t1 VALUES(0xAAB1); +INSERT INTO t1 VALUES(0xAAB2); +INSERT INTO t1 VALUES(0xAAB3); +INSERT INTO t1 VALUES(0xAAB4); +INSERT INTO t1 VALUES(0xAAB5); +INSERT INTO t1 VALUES(0xAAB6); +INSERT INTO t1 VALUES(0xAAB7); +INSERT INTO t1 VALUES(0xAAB8); +INSERT INTO t1 VALUES(0xAAB9); +INSERT INTO t1 VALUES(0xAABA); +INSERT INTO t1 VALUES(0xAABB); +INSERT INTO t1 VALUES(0xAABC); +INSERT INTO t1 VALUES(0xAABD); +INSERT INTO t1 VALUES(0xAABE); +INSERT INTO t1 VALUES(0xAABF); +INSERT INTO t1 VALUES(0xAAC0); +INSERT INTO t1 VALUES(0xAAC1); +INSERT INTO t1 VALUES(0xAAC2); +INSERT INTO t1 VALUES(0xAAC3); +INSERT INTO t1 VALUES(0xAAC4); +INSERT INTO t1 VALUES(0xAAC5); +INSERT INTO t1 VALUES(0xAAC6); +INSERT INTO t1 VALUES(0xAAC7); +INSERT INTO t1 VALUES(0xAAC8); +INSERT INTO t1 VALUES(0xAAC9); +INSERT INTO t1 VALUES(0xAACA); +INSERT INTO t1 VALUES(0xAACB); +INSERT INTO t1 VALUES(0xAACC); +INSERT INTO t1 VALUES(0xAACD); +INSERT INTO t1 VALUES(0xAACE); +INSERT INTO t1 VALUES(0xAACF); +INSERT INTO t1 VALUES(0xAAD0); +INSERT INTO t1 VALUES(0xAAD1); +INSERT INTO t1 VALUES(0xAAD2); +INSERT INTO t1 VALUES(0xAAD3); +INSERT INTO t1 VALUES(0xAAD4); +INSERT INTO t1 VALUES(0xAAD5); +INSERT INTO t1 VALUES(0xAAD6); +INSERT INTO t1 VALUES(0xAAD7); +INSERT INTO t1 VALUES(0xAAD8); +INSERT INTO t1 VALUES(0xAAD9); +INSERT INTO t1 VALUES(0xAADA); +INSERT INTO t1 VALUES(0xAADB); +INSERT INTO t1 VALUES(0xAADC); +INSERT INTO t1 VALUES(0xAADD); +INSERT INTO t1 VALUES(0xAADE); +INSERT INTO t1 VALUES(0xAADF); +INSERT INTO t1 VALUES(0xAAE0); +INSERT INTO t1 VALUES(0xAAE1); +INSERT INTO t1 VALUES(0xAAE2); +INSERT INTO t1 VALUES(0xAAE3); +INSERT INTO t1 VALUES(0xAAE4); +INSERT INTO t1 VALUES(0xAAE5); +INSERT INTO t1 VALUES(0xAAE6); +INSERT INTO t1 VALUES(0xAAE7); +INSERT INTO t1 VALUES(0xAAE8); +INSERT INTO t1 VALUES(0xAAE9); +INSERT INTO t1 VALUES(0xAAEA); +INSERT INTO t1 VALUES(0xAAEB); +INSERT INTO t1 VALUES(0xAAEC); +INSERT INTO t1 VALUES(0xAAED); +INSERT INTO t1 VALUES(0xAAEE); +INSERT INTO t1 VALUES(0xAAEF); +INSERT INTO t1 VALUES(0xAAF0); +INSERT INTO t1 VALUES(0xAAF1); +INSERT INTO t1 VALUES(0xAAF2); +INSERT INTO t1 VALUES(0xAAF3); +INSERT INTO t1 VALUES(0xAAF4); +INSERT INTO t1 VALUES(0xAAF5); +INSERT INTO t1 VALUES(0xAAF6); +INSERT INTO t1 VALUES(0xAAF7); +INSERT INTO t1 VALUES(0xAAF8); +INSERT INTO t1 VALUES(0xAAF9); +INSERT INTO t1 VALUES(0xAAFA); +INSERT INTO t1 VALUES(0xAAFB); +INSERT INTO t1 VALUES(0xAAFC); +INSERT INTO t1 VALUES(0xAAFD); +INSERT INTO t1 VALUES(0xAAFE); +INSERT INTO t1 VALUES(0xABA1); +INSERT INTO t1 VALUES(0xABA2); +INSERT INTO t1 VALUES(0xABA3); +INSERT INTO t1 VALUES(0xABA4); +INSERT INTO t1 VALUES(0xABA5); +INSERT INTO t1 VALUES(0xABA6); +INSERT INTO t1 VALUES(0xABA7); +INSERT INTO t1 VALUES(0xABA8); +INSERT INTO t1 VALUES(0xABA9); +INSERT INTO t1 VALUES(0xABAA); +INSERT INTO t1 VALUES(0xABAB); +INSERT INTO t1 VALUES(0xABAC); +INSERT INTO t1 VALUES(0xABAD); +INSERT INTO t1 VALUES(0xABAE); +INSERT INTO t1 VALUES(0xABAF); +INSERT INTO t1 VALUES(0xABB0); +INSERT INTO t1 VALUES(0xABB1); +INSERT INTO t1 VALUES(0xABB2); +INSERT INTO t1 VALUES(0xABB3); +INSERT INTO t1 VALUES(0xABB4); +INSERT INTO t1 VALUES(0xABB5); +INSERT INTO t1 VALUES(0xABB6); +INSERT INTO t1 VALUES(0xABB7); +INSERT INTO t1 VALUES(0xABB8); +INSERT INTO t1 VALUES(0xABB9); +INSERT INTO t1 VALUES(0xABBA); +INSERT INTO t1 VALUES(0xABBB); +INSERT INTO t1 VALUES(0xABBC); +INSERT INTO t1 VALUES(0xABBD); +INSERT INTO t1 VALUES(0xABBE); +INSERT INTO t1 VALUES(0xABBF); +INSERT INTO t1 VALUES(0xABC0); +INSERT INTO t1 VALUES(0xABC1); +INSERT INTO t1 VALUES(0xABC2); +INSERT INTO t1 VALUES(0xABC3); +INSERT INTO t1 VALUES(0xABC4); +INSERT INTO t1 VALUES(0xABC5); +INSERT INTO t1 VALUES(0xABC6); +INSERT INTO t1 VALUES(0xABC7); +INSERT INTO t1 VALUES(0xABC8); +INSERT INTO t1 VALUES(0xABC9); +INSERT INTO t1 VALUES(0xABCA); +INSERT INTO t1 VALUES(0xABCB); +INSERT INTO t1 VALUES(0xABCC); +INSERT INTO t1 VALUES(0xABCD); +INSERT INTO t1 VALUES(0xABCE); +INSERT INTO t1 VALUES(0xABCF); +INSERT INTO t1 VALUES(0xABD0); +INSERT INTO t1 VALUES(0xABD1); +INSERT INTO t1 VALUES(0xABD2); +INSERT INTO t1 VALUES(0xABD3); +INSERT INTO t1 VALUES(0xABD4); +INSERT INTO t1 VALUES(0xABD5); +INSERT INTO t1 VALUES(0xABD6); +INSERT INTO t1 VALUES(0xABD7); +INSERT INTO t1 VALUES(0xABD8); +INSERT INTO t1 VALUES(0xABD9); +INSERT INTO t1 VALUES(0xABDA); +INSERT INTO t1 VALUES(0xABDB); +INSERT INTO t1 VALUES(0xABDC); +INSERT INTO t1 VALUES(0xABDD); +INSERT INTO t1 VALUES(0xABDE); +INSERT INTO t1 VALUES(0xABDF); +INSERT INTO t1 VALUES(0xABE0); +INSERT INTO t1 VALUES(0xABE1); +INSERT INTO t1 VALUES(0xABE2); +INSERT INTO t1 VALUES(0xABE3); +INSERT INTO t1 VALUES(0xABE4); +INSERT INTO t1 VALUES(0xABE5); +INSERT INTO t1 VALUES(0xABE6); +INSERT INTO t1 VALUES(0xABE7); +INSERT INTO t1 VALUES(0xABE8); +INSERT INTO t1 VALUES(0xABE9); +INSERT INTO t1 VALUES(0xABEA); +INSERT INTO t1 VALUES(0xABEB); +INSERT INTO t1 VALUES(0xABEC); +INSERT INTO t1 VALUES(0xABED); +INSERT INTO t1 VALUES(0xABEE); +INSERT INTO t1 VALUES(0xABEF); +INSERT INTO t1 VALUES(0xABF0); +INSERT INTO t1 VALUES(0xABF1); +INSERT INTO t1 VALUES(0xABF2); +INSERT INTO t1 VALUES(0xABF3); +INSERT INTO t1 VALUES(0xABF4); +INSERT INTO t1 VALUES(0xABF5); +INSERT INTO t1 VALUES(0xABF6); +INSERT INTO t1 VALUES(0xABF7); +INSERT INTO t1 VALUES(0xABF8); +INSERT INTO t1 VALUES(0xABF9); +INSERT INTO t1 VALUES(0xABFA); +INSERT INTO t1 VALUES(0xABFB); +INSERT INTO t1 VALUES(0xABFC); +INSERT INTO t1 VALUES(0xABFD); +INSERT INTO t1 VALUES(0xABFE); +INSERT INTO t1 VALUES(0xACA1); +INSERT INTO t1 VALUES(0xACA2); +INSERT INTO t1 VALUES(0xACA3); +INSERT INTO t1 VALUES(0xACA4); +INSERT INTO t1 VALUES(0xACA5); +INSERT INTO t1 VALUES(0xACA6); +INSERT INTO t1 VALUES(0xACA7); +INSERT INTO t1 VALUES(0xACA8); +INSERT INTO t1 VALUES(0xACA9); +INSERT INTO t1 VALUES(0xACAA); +INSERT INTO t1 VALUES(0xACAB); +INSERT INTO t1 VALUES(0xACAC); +INSERT INTO t1 VALUES(0xACAD); +INSERT INTO t1 VALUES(0xACAE); +INSERT INTO t1 VALUES(0xACAF); +INSERT INTO t1 VALUES(0xACB0); +INSERT INTO t1 VALUES(0xACB1); +INSERT INTO t1 VALUES(0xACB2); +INSERT INTO t1 VALUES(0xACB3); +INSERT INTO t1 VALUES(0xACB4); +INSERT INTO t1 VALUES(0xACB5); +INSERT INTO t1 VALUES(0xACB6); +INSERT INTO t1 VALUES(0xACB7); +INSERT INTO t1 VALUES(0xACB8); +INSERT INTO t1 VALUES(0xACB9); +INSERT INTO t1 VALUES(0xACBA); +INSERT INTO t1 VALUES(0xACBB); +INSERT INTO t1 VALUES(0xACBC); +INSERT INTO t1 VALUES(0xACBD); +INSERT INTO t1 VALUES(0xACBE); +INSERT INTO t1 VALUES(0xACBF); +INSERT INTO t1 VALUES(0xACC0); +INSERT INTO t1 VALUES(0xACC1); +INSERT INTO t1 VALUES(0xACC2); +INSERT INTO t1 VALUES(0xACC3); +INSERT INTO t1 VALUES(0xACC4); +INSERT INTO t1 VALUES(0xACC5); +INSERT INTO t1 VALUES(0xACC6); +INSERT INTO t1 VALUES(0xACC7); +INSERT INTO t1 VALUES(0xACC8); +INSERT INTO t1 VALUES(0xACC9); +INSERT INTO t1 VALUES(0xACCA); +INSERT INTO t1 VALUES(0xACCB); +INSERT INTO t1 VALUES(0xACCC); +INSERT INTO t1 VALUES(0xACCD); +INSERT INTO t1 VALUES(0xACCE); +INSERT INTO t1 VALUES(0xACCF); +INSERT INTO t1 VALUES(0xACD0); +INSERT INTO t1 VALUES(0xACD1); +INSERT INTO t1 VALUES(0xACD2); +INSERT INTO t1 VALUES(0xACD3); +INSERT INTO t1 VALUES(0xACD4); +INSERT INTO t1 VALUES(0xACD5); +INSERT INTO t1 VALUES(0xACD6); +INSERT INTO t1 VALUES(0xACD7); +INSERT INTO t1 VALUES(0xACD8); +INSERT INTO t1 VALUES(0xACD9); +INSERT INTO t1 VALUES(0xACDA); +INSERT INTO t1 VALUES(0xACDB); +INSERT INTO t1 VALUES(0xACDC); +INSERT INTO t1 VALUES(0xACDD); +INSERT INTO t1 VALUES(0xACDE); +INSERT INTO t1 VALUES(0xACDF); +INSERT INTO t1 VALUES(0xACE0); +INSERT INTO t1 VALUES(0xACE1); +INSERT INTO t1 VALUES(0xACE2); +INSERT INTO t1 VALUES(0xACE3); +INSERT INTO t1 VALUES(0xACE4); +INSERT INTO t1 VALUES(0xACE5); +INSERT INTO t1 VALUES(0xACE6); +INSERT INTO t1 VALUES(0xACE7); +INSERT INTO t1 VALUES(0xACE8); +INSERT INTO t1 VALUES(0xACE9); +INSERT INTO t1 VALUES(0xACEA); +INSERT INTO t1 VALUES(0xACEB); +INSERT INTO t1 VALUES(0xACEC); +INSERT INTO t1 VALUES(0xACED); +INSERT INTO t1 VALUES(0xACEE); +INSERT INTO t1 VALUES(0xACEF); +INSERT INTO t1 VALUES(0xACF0); +INSERT INTO t1 VALUES(0xACF1); +INSERT INTO t1 VALUES(0xACF2); +INSERT INTO t1 VALUES(0xACF3); +INSERT INTO t1 VALUES(0xACF4); +INSERT INTO t1 VALUES(0xACF5); +INSERT INTO t1 VALUES(0xACF6); +INSERT INTO t1 VALUES(0xACF7); +INSERT INTO t1 VALUES(0xACF8); +INSERT INTO t1 VALUES(0xACF9); +INSERT INTO t1 VALUES(0xACFA); +INSERT INTO t1 VALUES(0xACFB); +INSERT INTO t1 VALUES(0xACFC); +INSERT INTO t1 VALUES(0xACFD); +INSERT INTO t1 VALUES(0xACFE); +INSERT INTO t1 VALUES(0xADA1); +INSERT INTO t1 VALUES(0xADA2); +INSERT INTO t1 VALUES(0xADA3); +INSERT INTO t1 VALUES(0xADA4); +INSERT INTO t1 VALUES(0xADA5); +INSERT INTO t1 VALUES(0xADA6); +INSERT INTO t1 VALUES(0xADA7); +INSERT INTO t1 VALUES(0xADA8); +INSERT INTO t1 VALUES(0xADA9); +INSERT INTO t1 VALUES(0xADAA); +INSERT INTO t1 VALUES(0xADAB); +INSERT INTO t1 VALUES(0xADAC); +INSERT INTO t1 VALUES(0xADAD); +INSERT INTO t1 VALUES(0xADAE); +INSERT INTO t1 VALUES(0xADAF); +INSERT INTO t1 VALUES(0xADB0); +INSERT INTO t1 VALUES(0xADB1); +INSERT INTO t1 VALUES(0xADB2); +INSERT INTO t1 VALUES(0xADB3); +INSERT INTO t1 VALUES(0xADB4); +INSERT INTO t1 VALUES(0xADB5); +INSERT INTO t1 VALUES(0xADB6); +INSERT INTO t1 VALUES(0xADB7); +INSERT INTO t1 VALUES(0xADB8); +INSERT INTO t1 VALUES(0xADB9); +INSERT INTO t1 VALUES(0xADBA); +INSERT INTO t1 VALUES(0xADBB); +INSERT INTO t1 VALUES(0xADBC); +INSERT INTO t1 VALUES(0xADBD); +INSERT INTO t1 VALUES(0xADBE); +INSERT INTO t1 VALUES(0xADBF); +INSERT INTO t1 VALUES(0xADC0); +INSERT INTO t1 VALUES(0xADC1); +INSERT INTO t1 VALUES(0xADC2); +INSERT INTO t1 VALUES(0xADC3); +INSERT INTO t1 VALUES(0xADC4); +INSERT INTO t1 VALUES(0xADC5); +INSERT INTO t1 VALUES(0xADC6); +INSERT INTO t1 VALUES(0xADC7); +INSERT INTO t1 VALUES(0xADC8); +INSERT INTO t1 VALUES(0xADC9); +INSERT INTO t1 VALUES(0xADCA); +INSERT INTO t1 VALUES(0xADCB); +INSERT INTO t1 VALUES(0xADCC); +INSERT INTO t1 VALUES(0xADCD); +INSERT INTO t1 VALUES(0xADCE); +INSERT INTO t1 VALUES(0xADCF); +INSERT INTO t1 VALUES(0xADD0); +INSERT INTO t1 VALUES(0xADD1); +INSERT INTO t1 VALUES(0xADD2); +INSERT INTO t1 VALUES(0xADD3); +INSERT INTO t1 VALUES(0xADD4); +INSERT INTO t1 VALUES(0xADD5); +INSERT INTO t1 VALUES(0xADD6); +INSERT INTO t1 VALUES(0xADD7); +INSERT INTO t1 VALUES(0xADD8); +INSERT INTO t1 VALUES(0xADD9); +INSERT INTO t1 VALUES(0xADDA); +INSERT INTO t1 VALUES(0xADDB); +INSERT INTO t1 VALUES(0xADDC); +INSERT INTO t1 VALUES(0xADDD); +INSERT INTO t1 VALUES(0xADDE); +INSERT INTO t1 VALUES(0xADDF); +INSERT INTO t1 VALUES(0xADE0); +INSERT INTO t1 VALUES(0xADE1); +INSERT INTO t1 VALUES(0xADE2); +INSERT INTO t1 VALUES(0xADE3); +INSERT INTO t1 VALUES(0xADE4); +INSERT INTO t1 VALUES(0xADE5); +INSERT INTO t1 VALUES(0xADE6); +INSERT INTO t1 VALUES(0xADE7); +INSERT INTO t1 VALUES(0xADE8); +INSERT INTO t1 VALUES(0xADE9); +INSERT INTO t1 VALUES(0xADEA); +INSERT INTO t1 VALUES(0xADEB); +INSERT INTO t1 VALUES(0xADEC); +INSERT INTO t1 VALUES(0xADED); +INSERT INTO t1 VALUES(0xADEE); +INSERT INTO t1 VALUES(0xADEF); +INSERT INTO t1 VALUES(0xADF0); +INSERT INTO t1 VALUES(0xADF1); +INSERT INTO t1 VALUES(0xADF2); +INSERT INTO t1 VALUES(0xADF3); +INSERT INTO t1 VALUES(0xADF4); +INSERT INTO t1 VALUES(0xADF5); +INSERT INTO t1 VALUES(0xADF6); +INSERT INTO t1 VALUES(0xADF7); +INSERT INTO t1 VALUES(0xADF8); +INSERT INTO t1 VALUES(0xADF9); +INSERT INTO t1 VALUES(0xADFA); +INSERT INTO t1 VALUES(0xADFB); +INSERT INTO t1 VALUES(0xADFC); +INSERT INTO t1 VALUES(0xADFD); +INSERT INTO t1 VALUES(0xADFE); +INSERT INTO t1 VALUES(0xAEA1); +INSERT INTO t1 VALUES(0xAEA2); +INSERT INTO t1 VALUES(0xAEA3); +INSERT INTO t1 VALUES(0xAEA4); +INSERT INTO t1 VALUES(0xAEA5); +INSERT INTO t1 VALUES(0xAEA6); +INSERT INTO t1 VALUES(0xAEA7); +INSERT INTO t1 VALUES(0xAEA8); +INSERT INTO t1 VALUES(0xAEA9); +INSERT INTO t1 VALUES(0xAEAA); +INSERT INTO t1 VALUES(0xAEAB); +INSERT INTO t1 VALUES(0xAEAC); +INSERT INTO t1 VALUES(0xAEAD); +INSERT INTO t1 VALUES(0xAEAE); +INSERT INTO t1 VALUES(0xAEAF); +INSERT INTO t1 VALUES(0xAEB0); +INSERT INTO t1 VALUES(0xAEB1); +INSERT INTO t1 VALUES(0xAEB2); +INSERT INTO t1 VALUES(0xAEB3); +INSERT INTO t1 VALUES(0xAEB4); +INSERT INTO t1 VALUES(0xAEB5); +INSERT INTO t1 VALUES(0xAEB6); +INSERT INTO t1 VALUES(0xAEB7); +INSERT INTO t1 VALUES(0xAEB8); +INSERT INTO t1 VALUES(0xAEB9); +INSERT INTO t1 VALUES(0xAEBA); +INSERT INTO t1 VALUES(0xAEBB); +INSERT INTO t1 VALUES(0xAEBC); +INSERT INTO t1 VALUES(0xAEBD); +INSERT INTO t1 VALUES(0xAEBE); +INSERT INTO t1 VALUES(0xAEBF); +INSERT INTO t1 VALUES(0xAEC0); +INSERT INTO t1 VALUES(0xAEC1); +INSERT INTO t1 VALUES(0xAEC2); +INSERT INTO t1 VALUES(0xAEC3); +INSERT INTO t1 VALUES(0xAEC4); +INSERT INTO t1 VALUES(0xAEC5); +INSERT INTO t1 VALUES(0xAEC6); +INSERT INTO t1 VALUES(0xAEC7); +INSERT INTO t1 VALUES(0xAEC8); +INSERT INTO t1 VALUES(0xAEC9); +INSERT INTO t1 VALUES(0xAECA); +INSERT INTO t1 VALUES(0xAECB); +INSERT INTO t1 VALUES(0xAECC); +INSERT INTO t1 VALUES(0xAECD); +INSERT INTO t1 VALUES(0xAECE); +INSERT INTO t1 VALUES(0xAECF); +INSERT INTO t1 VALUES(0xAED0); +INSERT INTO t1 VALUES(0xAED1); +INSERT INTO t1 VALUES(0xAED2); +INSERT INTO t1 VALUES(0xAED3); +INSERT INTO t1 VALUES(0xAED4); +INSERT INTO t1 VALUES(0xAED5); +INSERT INTO t1 VALUES(0xAED6); +INSERT INTO t1 VALUES(0xAED7); +INSERT INTO t1 VALUES(0xAED8); +INSERT INTO t1 VALUES(0xAED9); +INSERT INTO t1 VALUES(0xAEDA); +INSERT INTO t1 VALUES(0xAEDB); +INSERT INTO t1 VALUES(0xAEDC); +INSERT INTO t1 VALUES(0xAEDD); +INSERT INTO t1 VALUES(0xAEDE); +INSERT INTO t1 VALUES(0xAEDF); +INSERT INTO t1 VALUES(0xAEE0); +INSERT INTO t1 VALUES(0xAEE1); +INSERT INTO t1 VALUES(0xAEE2); +INSERT INTO t1 VALUES(0xAEE3); +INSERT INTO t1 VALUES(0xAEE4); +INSERT INTO t1 VALUES(0xAEE5); +INSERT INTO t1 VALUES(0xAEE6); +INSERT INTO t1 VALUES(0xAEE7); +INSERT INTO t1 VALUES(0xAEE8); +INSERT INTO t1 VALUES(0xAEE9); +INSERT INTO t1 VALUES(0xAEEA); +INSERT INTO t1 VALUES(0xAEEB); +INSERT INTO t1 VALUES(0xAEEC); +INSERT INTO t1 VALUES(0xAEED); +INSERT INTO t1 VALUES(0xAEEE); +INSERT INTO t1 VALUES(0xAEEF); +INSERT INTO t1 VALUES(0xAEF0); +INSERT INTO t1 VALUES(0xAEF1); +INSERT INTO t1 VALUES(0xAEF2); +INSERT INTO t1 VALUES(0xAEF3); +INSERT INTO t1 VALUES(0xAEF4); +INSERT INTO t1 VALUES(0xAEF5); +INSERT INTO t1 VALUES(0xAEF6); +INSERT INTO t1 VALUES(0xAEF7); +INSERT INTO t1 VALUES(0xAEF8); +INSERT INTO t1 VALUES(0xAEF9); +INSERT INTO t1 VALUES(0xAEFA); +INSERT INTO t1 VALUES(0xAEFB); +INSERT INTO t1 VALUES(0xAEFC); +INSERT INTO t1 VALUES(0xAEFD); +INSERT INTO t1 VALUES(0xAEFE); +INSERT INTO t1 VALUES(0xAFA1); +INSERT INTO t1 VALUES(0xAFA2); +INSERT INTO t1 VALUES(0xAFA3); +INSERT INTO t1 VALUES(0xAFA4); +INSERT INTO t1 VALUES(0xAFA5); +INSERT INTO t1 VALUES(0xAFA6); +INSERT INTO t1 VALUES(0xAFA7); +INSERT INTO t1 VALUES(0xAFA8); +INSERT INTO t1 VALUES(0xAFA9); +INSERT INTO t1 VALUES(0xAFAA); +INSERT INTO t1 VALUES(0xAFAB); +INSERT INTO t1 VALUES(0xAFAC); +INSERT INTO t1 VALUES(0xAFAD); +INSERT INTO t1 VALUES(0xAFAE); +INSERT INTO t1 VALUES(0xAFAF); +INSERT INTO t1 VALUES(0xAFB0); +INSERT INTO t1 VALUES(0xAFB1); +INSERT INTO t1 VALUES(0xAFB2); +INSERT INTO t1 VALUES(0xAFB3); +INSERT INTO t1 VALUES(0xAFB4); +INSERT INTO t1 VALUES(0xAFB5); +INSERT INTO t1 VALUES(0xAFB6); +INSERT INTO t1 VALUES(0xAFB7); +INSERT INTO t1 VALUES(0xAFB8); +INSERT INTO t1 VALUES(0xAFB9); +INSERT INTO t1 VALUES(0xAFBA); +INSERT INTO t1 VALUES(0xAFBB); +INSERT INTO t1 VALUES(0xAFBC); +INSERT INTO t1 VALUES(0xAFBD); +INSERT INTO t1 VALUES(0xAFBE); +INSERT INTO t1 VALUES(0xAFBF); +INSERT INTO t1 VALUES(0xAFC0); +INSERT INTO t1 VALUES(0xAFC1); +INSERT INTO t1 VALUES(0xAFC2); +INSERT INTO t1 VALUES(0xAFC3); +INSERT INTO t1 VALUES(0xAFC4); +INSERT INTO t1 VALUES(0xAFC5); +INSERT INTO t1 VALUES(0xAFC6); +INSERT INTO t1 VALUES(0xAFC7); +INSERT INTO t1 VALUES(0xAFC8); +INSERT INTO t1 VALUES(0xAFC9); +INSERT INTO t1 VALUES(0xAFCA); +INSERT INTO t1 VALUES(0xAFCB); +INSERT INTO t1 VALUES(0xAFCC); +INSERT INTO t1 VALUES(0xAFCD); +INSERT INTO t1 VALUES(0xAFCE); +INSERT INTO t1 VALUES(0xAFCF); +INSERT INTO t1 VALUES(0xAFD0); +INSERT INTO t1 VALUES(0xAFD1); +INSERT INTO t1 VALUES(0xAFD2); +INSERT INTO t1 VALUES(0xAFD3); +INSERT INTO t1 VALUES(0xAFD4); +INSERT INTO t1 VALUES(0xAFD5); +INSERT INTO t1 VALUES(0xAFD6); +INSERT INTO t1 VALUES(0xAFD7); +INSERT INTO t1 VALUES(0xAFD8); +INSERT INTO t1 VALUES(0xAFD9); +INSERT INTO t1 VALUES(0xAFDA); +INSERT INTO t1 VALUES(0xAFDB); +INSERT INTO t1 VALUES(0xAFDC); +INSERT INTO t1 VALUES(0xAFDD); +INSERT INTO t1 VALUES(0xAFDE); +INSERT INTO t1 VALUES(0xAFDF); +INSERT INTO t1 VALUES(0xAFE0); +INSERT INTO t1 VALUES(0xAFE1); +INSERT INTO t1 VALUES(0xAFE2); +INSERT INTO t1 VALUES(0xAFE3); +INSERT INTO t1 VALUES(0xAFE4); +INSERT INTO t1 VALUES(0xAFE5); +INSERT INTO t1 VALUES(0xAFE6); +INSERT INTO t1 VALUES(0xAFE7); +INSERT INTO t1 VALUES(0xAFE8); +INSERT INTO t1 VALUES(0xAFE9); +INSERT INTO t1 VALUES(0xAFEA); +INSERT INTO t1 VALUES(0xAFEB); +INSERT INTO t1 VALUES(0xAFEC); +INSERT INTO t1 VALUES(0xAFED); +INSERT INTO t1 VALUES(0xAFEE); +INSERT INTO t1 VALUES(0xAFEF); +INSERT INTO t1 VALUES(0xAFF0); +INSERT INTO t1 VALUES(0xAFF1); +INSERT INTO t1 VALUES(0xAFF2); +INSERT INTO t1 VALUES(0xAFF3); +INSERT INTO t1 VALUES(0xAFF4); +INSERT INTO t1 VALUES(0xAFF5); +INSERT INTO t1 VALUES(0xAFF6); +INSERT INTO t1 VALUES(0xAFF7); +INSERT INTO t1 VALUES(0xAFF8); +INSERT INTO t1 VALUES(0xAFF9); +INSERT INTO t1 VALUES(0xAFFA); +INSERT INTO t1 VALUES(0xAFFB); +INSERT INTO t1 VALUES(0xAFFC); +INSERT INTO t1 VALUES(0xAFFD); +INSERT INTO t1 VALUES(0xAFFE); +INSERT INTO t1 VALUES(0xCFD4); +INSERT INTO t1 VALUES(0xCFD5); +INSERT INTO t1 VALUES(0xCFD6); +INSERT INTO t1 VALUES(0xCFD7); +INSERT INTO t1 VALUES(0xCFD8); +INSERT INTO t1 VALUES(0xCFD9); +INSERT INTO t1 VALUES(0xCFDA); +INSERT INTO t1 VALUES(0xCFDB); +INSERT INTO t1 VALUES(0xCFDC); +INSERT INTO t1 VALUES(0xCFDD); +INSERT INTO t1 VALUES(0xCFDE); +INSERT INTO t1 VALUES(0xCFDF); +INSERT INTO t1 VALUES(0xCFE0); +INSERT INTO t1 VALUES(0xCFE1); +INSERT INTO t1 VALUES(0xCFE2); +INSERT INTO t1 VALUES(0xCFE3); +INSERT INTO t1 VALUES(0xCFE4); +INSERT INTO t1 VALUES(0xCFE5); +INSERT INTO t1 VALUES(0xCFE6); +INSERT INTO t1 VALUES(0xCFE7); +INSERT INTO t1 VALUES(0xCFE8); +INSERT INTO t1 VALUES(0xCFE9); +INSERT INTO t1 VALUES(0xCFEA); +INSERT INTO t1 VALUES(0xCFEB); +INSERT INTO t1 VALUES(0xCFEC); +INSERT INTO t1 VALUES(0xCFED); +INSERT INTO t1 VALUES(0xCFEE); +INSERT INTO t1 VALUES(0xCFEF); +INSERT INTO t1 VALUES(0xCFF0); +INSERT INTO t1 VALUES(0xCFF1); +INSERT INTO t1 VALUES(0xCFF2); +INSERT INTO t1 VALUES(0xCFF3); +INSERT INTO t1 VALUES(0xCFF4); +INSERT INTO t1 VALUES(0xCFF5); +INSERT INTO t1 VALUES(0xCFF6); +INSERT INTO t1 VALUES(0xCFF7); +INSERT INTO t1 VALUES(0xCFF8); +INSERT INTO t1 VALUES(0xCFF9); +INSERT INTO t1 VALUES(0xCFFA); +INSERT INTO t1 VALUES(0xCFFB); +INSERT INTO t1 VALUES(0xCFFC); +INSERT INTO t1 VALUES(0xCFFD); +INSERT INTO t1 VALUES(0xCFFE); +INSERT INTO t1 VALUES(0xF4A7); +INSERT INTO t1 VALUES(0xF4A8); +INSERT INTO t1 VALUES(0xF4A9); +INSERT INTO t1 VALUES(0xF4AA); +INSERT INTO t1 VALUES(0xF4AB); +INSERT INTO t1 VALUES(0xF4AC); +INSERT INTO t1 VALUES(0xF4AD); +INSERT INTO t1 VALUES(0xF4AE); +INSERT INTO t1 VALUES(0xF4AF); +INSERT INTO t1 VALUES(0xF4B0); +INSERT INTO t1 VALUES(0xF4B1); +INSERT INTO t1 VALUES(0xF4B2); +INSERT INTO t1 VALUES(0xF4B3); +INSERT INTO t1 VALUES(0xF4B4); +INSERT INTO t1 VALUES(0xF4B5); +INSERT INTO t1 VALUES(0xF4B6); +INSERT INTO t1 VALUES(0xF4B7); +INSERT INTO t1 VALUES(0xF4B8); +INSERT INTO t1 VALUES(0xF4B9); +INSERT INTO t1 VALUES(0xF4BA); +INSERT INTO t1 VALUES(0xF4BB); +INSERT INTO t1 VALUES(0xF4BC); +INSERT INTO t1 VALUES(0xF4BD); +INSERT INTO t1 VALUES(0xF4BE); +INSERT INTO t1 VALUES(0xF4BF); +INSERT INTO t1 VALUES(0xF4C0); +INSERT INTO t1 VALUES(0xF4C1); +INSERT INTO t1 VALUES(0xF4C2); +INSERT INTO t1 VALUES(0xF4C3); +INSERT INTO t1 VALUES(0xF4C4); +INSERT INTO t1 VALUES(0xF4C5); +INSERT INTO t1 VALUES(0xF4C6); +INSERT INTO t1 VALUES(0xF4C7); +INSERT INTO t1 VALUES(0xF4C8); +INSERT INTO t1 VALUES(0xF4C9); +INSERT INTO t1 VALUES(0xF4CA); +INSERT INTO t1 VALUES(0xF4CB); +INSERT INTO t1 VALUES(0xF4CC); +INSERT INTO t1 VALUES(0xF4CD); +INSERT INTO t1 VALUES(0xF4CE); +INSERT INTO t1 VALUES(0xF4CF); +INSERT INTO t1 VALUES(0xF4D0); +INSERT INTO t1 VALUES(0xF4D1); +INSERT INTO t1 VALUES(0xF4D2); +INSERT INTO t1 VALUES(0xF4D3); +INSERT INTO t1 VALUES(0xF4D4); +INSERT INTO t1 VALUES(0xF4D5); +INSERT INTO t1 VALUES(0xF4D6); +INSERT INTO t1 VALUES(0xF4D7); +INSERT INTO t1 VALUES(0xF4D8); +INSERT INTO t1 VALUES(0xF4D9); +INSERT INTO t1 VALUES(0xF4DA); +INSERT INTO t1 VALUES(0xF4DB); +INSERT INTO t1 VALUES(0xF4DC); +INSERT INTO t1 VALUES(0xF4DD); +INSERT INTO t1 VALUES(0xF4DE); +INSERT INTO t1 VALUES(0xF4DF); +INSERT INTO t1 VALUES(0xF4E0); +INSERT INTO t1 VALUES(0xF4E1); +INSERT INTO t1 VALUES(0xF4E2); +INSERT INTO t1 VALUES(0xF4E3); +INSERT INTO t1 VALUES(0xF4E4); +INSERT INTO t1 VALUES(0xF4E5); +INSERT INTO t1 VALUES(0xF4E6); +INSERT INTO t1 VALUES(0xF4E7); +INSERT INTO t1 VALUES(0xF4E8); +INSERT INTO t1 VALUES(0xF4E9); +INSERT INTO t1 VALUES(0xF4EA); +INSERT INTO t1 VALUES(0xF4EB); +INSERT INTO t1 VALUES(0xF4EC); +INSERT INTO t1 VALUES(0xF4ED); +INSERT INTO t1 VALUES(0xF4EE); +INSERT INTO t1 VALUES(0xF4EF); +INSERT INTO t1 VALUES(0xF4F0); +INSERT INTO t1 VALUES(0xF4F1); +INSERT INTO t1 VALUES(0xF4F2); +INSERT INTO t1 VALUES(0xF4F3); +INSERT INTO t1 VALUES(0xF4F4); +INSERT INTO t1 VALUES(0xF4F5); +INSERT INTO t1 VALUES(0xF4F6); +INSERT INTO t1 VALUES(0xF4F7); +INSERT INTO t1 VALUES(0xF4F8); +INSERT INTO t1 VALUES(0xF4F9); +INSERT INTO t1 VALUES(0xF4FA); +INSERT INTO t1 VALUES(0xF4FB); +INSERT INTO t1 VALUES(0xF4FC); +INSERT INTO t1 VALUES(0xF4FD); +INSERT INTO t1 VALUES(0xF4FE); +SELECT HEX(c) FROM t1 ORDER BY BINARY c; +DROP TABLE t1; diff --git a/strings/ctype-ujis.c b/strings/ctype-ujis.c index 94673a20795..fc1496df280 100644 --- a/strings/ctype-ujis.c +++ b/strings/ctype-ujis.c @@ -8243,7 +8243,6 @@ my_jisx0212_uni_onechar(int code){ } - /* EUC-JP encoding subcomponents: [x00-x7F] # ASCII/JIS-Roman (one-byte/character) @@ -8252,6 +8251,47 @@ my_jisx0212_uni_onechar(int code){ [xA1-xFE][xA1-xFE] # JIS X 0208:1997 (two bytes/char) */ +static +uint my_well_formed_len_ujis(CHARSET_INFO *cs __attribute__((unused)), + const char *beg, const char *end, uint pos) +{ + const uchar *b= (uchar *) beg; + + for ( ; pos && b < (uchar*) end; pos--, b++) + { + char *chbeg; + uint ch= *b; + + if (ch <= 0x7F) /* one byte */ + continue; + + chbeg= (char *) b++; + if (b >= (uchar *) end) /* need more bytes */ + return chbeg - beg; /* unexpected EOL */ + + if (ch == 0x8E) /* [x8E][xA0-xDF] */ + { + if (*b >= 0xA0 && *b <= 0xDF) + continue; + return chbeg - beg; /* invalid sequence */ + } + + if (ch == 0x8F) /* [x8F][xA1-xFE][xA1-xFE] */ + { + ch= *b++; + if (b >= (uchar*) end) + return chbeg - beg; /* unexpected EOL */ + } + + if (ch >= 0xA1 && ch <= 0xFE && + *b >= 0xA1 && *b <= 0xFE) /* [xA1-xFE][xA1-xFE] */ + continue; + return chbeg - beg; /* invalid sequence */ + } + return b - (uchar *) beg; +} + + static uint my_numcells_eucjp(CHARSET_INFO *cs __attribute__((unused)), const char *str, const char *strend) @@ -8475,7 +8515,7 @@ static MY_CHARSET_HANDLER my_charset_handler= mbcharlen_ujis, my_numchars_mb, my_charpos_mb, - my_well_formed_len_mb, + my_well_formed_len_ujis, my_lengthsp_8bit, my_numcells_eucjp, my_mb_wc_euc_jp, /* mb_wc */ From 220edcf590308c3341057539a02512b3b8e35ff3 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 10 Dec 2004 14:01:03 +0100 Subject: [PATCH 0469/1063] mysql-test-run.sh: Use different TESTS_BINDIR for --embedded-server mysql-test/mysql-test-run.sh: Use different TESTS_BINDIR for --embedded-server --- mysql-test/mysql-test-run.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index 09d3511fec8..5a7ede0cba8 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -490,6 +490,7 @@ if [ x$SOURCE_DIST = x1 ] ; then echo "Fatal error: Cannot find embedded server 'mysqltest'" 1>&2 exit 1 fi + TESTS_BINDIR="$BASEDIR/libmysqld/examples" else MYSQLD="$VALGRIND $BASEDIR/sql/mysqld" if [ -f "$BASEDIR/client/.libs/lt-mysqltest" ] ; then @@ -499,6 +500,7 @@ if [ x$SOURCE_DIST = x1 ] ; then else MYSQL_TEST="$BASEDIR/client/mysqltest" fi + TESTS_BINDIR="$BASEDIR/tests" fi if [ -f "$BASEDIR/client/.libs/mysqldump" ] ; then MYSQL_DUMP="$BASEDIR/client/.libs/mysqldump" @@ -515,7 +517,6 @@ if [ x$SOURCE_DIST = x1 ] ; then fi CLIENT_BINDIR="$BASEDIR/client" - TESTS_BINDIR="$BASEDIR/tests" MYSQLADMIN="$CLIENT_BINDIR/mysqladmin" WAIT_PID="$BASEDIR/extra/mysql_waitpid" MYSQL_MANAGER_CLIENT="$CLIENT_BINDIR/mysqlmanagerc" From 23145c51ca5d3263f87957fc967d5d9d2389b469 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 10 Dec 2004 17:58:13 +0400 Subject: [PATCH 0470/1063] Privileges columns were removed from output to be able to reuse test results for both server and --embedded-server versions. BitKeeper/deleted/.del-ctype_big5.result.es~f75ebc9f8836316f: Delete: mysql-test/r/ctype_big5.result.es BitKeeper/deleted/.del-ctype_uca.result.es~9fab42f7561fa166: Delete: mysql-test/r/ctype_uca.result.es --- mysql-test/include/ctype_common.inc | 2 + mysql-test/r/ctype_big5.result | 4 +- mysql-test/r/ctype_big5.result.es | 58 - mysql-test/r/ctype_uca.result | 4 +- mysql-test/r/ctype_uca.result.es | 2377 --------------------------- 5 files changed, 6 insertions(+), 2439 deletions(-) delete mode 100644 mysql-test/r/ctype_big5.result.es delete mode 100644 mysql-test/r/ctype_uca.result.es diff --git a/mysql-test/include/ctype_common.inc b/mysql-test/include/ctype_common.inc index 77937bdb854..202c508a9c9 100644 --- a/mysql-test/include/ctype_common.inc +++ b/mysql-test/include/ctype_common.inc @@ -25,6 +25,7 @@ USE d1; CREATE TABLE t1 (c CHAR(10), KEY(c)); --enable_warnings # check the column was created with the expected charset/collation +--replace_result select,insert,update,references "" SHOW FULL COLUMNS FROM t1; INSERT INTO t1 VALUES ('aaa'),('aaaa'),('aaaaa'); SELECT c as want3results FROM t1 WHERE c LIKE 'aaa%'; @@ -37,6 +38,7 @@ DROP TABLE t1; CREATE TABLE t1 (c1 varchar(15), KEY c1 (c1(2))); --enable_warnings # check the column was created with the expected charset/collation +--replace_result select,insert,update,references "" SHOW FULL COLUMNS FROM t1; INSERT INTO t1 VALUES ('location'),('loberge'),('lotre'),('boabab'); SELECT c1 as want3results from t1 where c1 like 'l%'; diff --git a/mysql-test/r/ctype_big5.result b/mysql-test/r/ctype_big5.result index 789b6e586ad..9b9fcbccbe0 100644 --- a/mysql-test/r/ctype_big5.result +++ b/mysql-test/r/ctype_big5.result @@ -10,7 +10,7 @@ USE d1; CREATE TABLE t1 (c CHAR(10), KEY(c)); SHOW FULL COLUMNS FROM t1; Field Type Collation Null Key Default Extra Privileges Comment -c char(10) big5_chinese_ci YES MUL NULL select,insert,update,references +c char(10) big5_chinese_ci YES MUL NULL INSERT INTO t1 VALUES ('aaa'),('aaaa'),('aaaaa'); SELECT c as want3results FROM t1 WHERE c LIKE 'aaa%'; want3results @@ -21,7 +21,7 @@ DROP TABLE t1; CREATE TABLE t1 (c1 varchar(15), KEY c1 (c1(2))); SHOW FULL COLUMNS FROM t1; Field Type Collation Null Key Default Extra Privileges Comment -c1 varchar(15) big5_chinese_ci YES MUL NULL select,insert,update,references +c1 varchar(15) big5_chinese_ci YES MUL NULL INSERT INTO t1 VALUES ('location'),('loberge'),('lotre'),('boabab'); SELECT c1 as want3results from t1 where c1 like 'l%'; want3results diff --git a/mysql-test/r/ctype_big5.result.es b/mysql-test/r/ctype_big5.result.es deleted file mode 100644 index 9b9fcbccbe0..00000000000 --- a/mysql-test/r/ctype_big5.result.es +++ /dev/null @@ -1,58 +0,0 @@ -drop table if exists t1; -SET @test_character_set= 'big5'; -SET @test_collation= 'big5_chinese_ci'; -SET @safe_character_set_server= @@character_set_server; -SET @safe_collation_server= @@collation_server; -SET character_set_server= @test_character_set; -SET collation_server= @test_collation; -CREATE DATABASE d1; -USE d1; -CREATE TABLE t1 (c CHAR(10), KEY(c)); -SHOW FULL COLUMNS FROM t1; -Field Type Collation Null Key Default Extra Privileges Comment -c char(10) big5_chinese_ci YES MUL NULL -INSERT INTO t1 VALUES ('aaa'),('aaaa'),('aaaaa'); -SELECT c as want3results FROM t1 WHERE c LIKE 'aaa%'; -want3results -aaa -aaaa -aaaaa -DROP TABLE t1; -CREATE TABLE t1 (c1 varchar(15), KEY c1 (c1(2))); -SHOW FULL COLUMNS FROM t1; -Field Type Collation Null Key Default Extra Privileges Comment -c1 varchar(15) big5_chinese_ci YES MUL NULL -INSERT INTO t1 VALUES ('location'),('loberge'),('lotre'),('boabab'); -SELECT c1 as want3results from t1 where c1 like 'l%'; -want3results -location -loberge -lotre -SELECT c1 as want3results from t1 where c1 like 'lo%'; -want3results -location -loberge -lotre -SELECT c1 as want1result from t1 where c1 like 'loc%'; -want1result -location -SELECT c1 as want1result from t1 where c1 like 'loca%'; -want1result -location -SELECT c1 as want1result from t1 where c1 like 'locat%'; -want1result -location -SELECT c1 as want1result from t1 where c1 like 'locati%'; -want1result -location -SELECT c1 as want1result from t1 where c1 like 'locatio%'; -want1result -location -SELECT c1 as want1result from t1 where c1 like 'location%'; -want1result -location -DROP TABLE t1; -DROP DATABASE d1; -USE test; -SET character_set_server= @safe_character_set_server; -SET collation_server= @safe_collation_server; diff --git a/mysql-test/r/ctype_uca.result b/mysql-test/r/ctype_uca.result index fbe876d3b66..0573092e39b 100644 --- a/mysql-test/r/ctype_uca.result +++ b/mysql-test/r/ctype_uca.result @@ -2329,7 +2329,7 @@ USE d1; CREATE TABLE t1 (c CHAR(10), KEY(c)); SHOW FULL COLUMNS FROM t1; Field Type Collation Null Key Default Extra Privileges Comment -c char(10) utf8_swedish_ci YES MUL NULL select,insert,update,references +c char(10) utf8_swedish_ci YES MUL NULL INSERT INTO t1 VALUES ('aaa'),('aaaa'),('aaaaa'); SELECT c as want3results FROM t1 WHERE c LIKE 'aaa%'; want3results @@ -2340,7 +2340,7 @@ DROP TABLE t1; CREATE TABLE t1 (c1 varchar(15), KEY c1 (c1(2))); SHOW FULL COLUMNS FROM t1; Field Type Collation Null Key Default Extra Privileges Comment -c1 varchar(15) utf8_swedish_ci YES MUL NULL select,insert,update,references +c1 varchar(15) utf8_swedish_ci YES MUL NULL INSERT INTO t1 VALUES ('location'),('loberge'),('lotre'),('boabab'); SELECT c1 as want3results from t1 where c1 like 'l%'; want3results diff --git a/mysql-test/r/ctype_uca.result.es b/mysql-test/r/ctype_uca.result.es deleted file mode 100644 index 1f86376def6..00000000000 --- a/mysql-test/r/ctype_uca.result.es +++ /dev/null @@ -1,2377 +0,0 @@ -DROP TABLE IF EXISTS t1; -set names utf8; -set collation_connection=utf8_unicode_ci; -select 'a' = 'a', 'a' = 'a ', 'a ' = 'a'; -'a' = 'a' 'a' = 'a ' 'a ' = 'a' -1 1 1 -select 'a\t' = 'a' , 'a\t' < 'a' , 'a\t' > 'a'; -'a\t' = 'a' 'a\t' < 'a' 'a\t' > 'a' -0 1 0 -select 'a\t' = 'a ', 'a\t' < 'a ', 'a\t' > 'a '; -'a\t' = 'a ' 'a\t' < 'a ' 'a\t' > 'a ' -0 1 0 -select 'a' = 'a\t', 'a' < 'a\t', 'a' > 'a\t'; -'a' = 'a\t' 'a' < 'a\t' 'a' > 'a\t' -0 0 1 -select 'a ' = 'a\t', 'a ' < 'a\t', 'a ' > 'a\t'; -'a ' = 'a\t' 'a ' < 'a\t' 'a ' > 'a\t' -0 0 1 -select 'a a' > 'a', 'a \t' < 'a'; -'a a' > 'a' 'a \t' < 'a' -1 1 -select 'c' like '\_' as want0; -want0 -0 -CREATE TABLE t ( -c char(20) NOT NULL -) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -INSERT INTO t VALUES ('a'),('ab'),('aba'); -ALTER TABLE t ADD INDEX (c); -SELECT c FROM t WHERE c LIKE 'a%'; -c -a -ab -aba -DROP TABLE t; -create table t1 (c1 char(10) character set utf8 collate utf8_bin); -insert into t1 values ('A'),('a'); -insert into t1 values ('B'),('b'); -insert into t1 values ('C'),('c'); -insert into t1 values ('D'),('d'); -insert into t1 values ('E'),('e'); -insert into t1 values ('F'),('f'); -insert into t1 values ('G'),('g'); -insert into t1 values ('H'),('h'); -insert into t1 values ('I'),('i'); -insert into t1 values ('J'),('j'); -insert into t1 values ('K'),('k'); -insert into t1 values ('L'),('l'); -insert into t1 values ('M'),('m'); -insert into t1 values ('N'),('n'); -insert into t1 values ('O'),('o'); -insert into t1 values ('P'),('p'); -insert into t1 values ('Q'),('q'); -insert into t1 values ('R'),('r'); -insert into t1 values ('S'),('s'); -insert into t1 values ('T'),('t'); -insert into t1 values ('U'),('u'); -insert into t1 values ('V'),('v'); -insert into t1 values ('W'),('w'); -insert into t1 values ('X'),('x'); -insert into t1 values ('Y'),('y'); -insert into t1 values ('Z'),('z'); -insert into t1 values (_ucs2 0x00e0),(_ucs2 0x00c0); -insert into t1 values (_ucs2 0x00e1),(_ucs2 0x00c1); -insert into t1 values (_ucs2 0x00e2),(_ucs2 0x00c2); -insert into t1 values (_ucs2 0x00e3),(_ucs2 0x00c3); -insert into t1 values (_ucs2 0x00e4),(_ucs2 0x00c4); -insert into t1 values (_ucs2 0x00e5),(_ucs2 0x00c5); -insert into t1 values (_ucs2 0x00e6),(_ucs2 0x00c6); -insert into t1 values (_ucs2 0x00e7),(_ucs2 0x00c7); -insert into t1 values (_ucs2 0x00e8),(_ucs2 0x00c8); -insert into t1 values (_ucs2 0x00e9),(_ucs2 0x00c9); -insert into t1 values (_ucs2 0x00ea),(_ucs2 0x00ca); -insert into t1 values (_ucs2 0x00eb),(_ucs2 0x00cb); -insert into t1 values (_ucs2 0x00ec),(_ucs2 0x00cc); -insert into t1 values (_ucs2 0x00ed),(_ucs2 0x00cd); -insert into t1 values (_ucs2 0x00ee),(_ucs2 0x00ce); -insert into t1 values (_ucs2 0x00ef),(_ucs2 0x00cf); -insert into t1 values (_ucs2 0x00f0),(_ucs2 0x00d0); -insert into t1 values (_ucs2 0x00f1),(_ucs2 0x00d1); -insert into t1 values (_ucs2 0x00f2),(_ucs2 0x00d2); -insert into t1 values (_ucs2 0x00f3),(_ucs2 0x00d3); -insert into t1 values (_ucs2 0x00f4),(_ucs2 0x00d4); -insert into t1 values (_ucs2 0x00f5),(_ucs2 0x00d5); -insert into t1 values (_ucs2 0x00f6),(_ucs2 0x00d6); -insert into t1 values (_ucs2 0x00f7),(_ucs2 0x00d7); -insert into t1 values (_ucs2 0x00f8),(_ucs2 0x00d8); -insert into t1 values (_ucs2 0x00f9),(_ucs2 0x00d9); -insert into t1 values (_ucs2 0x00fa),(_ucs2 0x00da); -insert into t1 values (_ucs2 0x00fb),(_ucs2 0x00db); -insert into t1 values (_ucs2 0x00fc),(_ucs2 0x00dc); -insert into t1 values (_ucs2 0x00fd),(_ucs2 0x00dd); -insert into t1 values (_ucs2 0x00fe),(_ucs2 0x00de); -insert into t1 values (_ucs2 0x00ff),(_ucs2 0x00df); -insert into t1 values (_ucs2 0x0100),(_ucs2 0x0101),(_ucs2 0x0102),(_ucs2 0x0103); -insert into t1 values (_ucs2 0x0104),(_ucs2 0x0105),(_ucs2 0x0106),(_ucs2 0x0107); -insert into t1 values (_ucs2 0x0108),(_ucs2 0x0109),(_ucs2 0x010a),(_ucs2 0x010b); -insert into t1 values (_ucs2 0x010c),(_ucs2 0x010d),(_ucs2 0x010e),(_ucs2 0x010f); -insert into t1 values (_ucs2 0x0110),(_ucs2 0x0111),(_ucs2 0x0112),(_ucs2 0x0113); -insert into t1 values (_ucs2 0x0114),(_ucs2 0x0115),(_ucs2 0x0116),(_ucs2 0x0117); -insert into t1 values (_ucs2 0x0118),(_ucs2 0x0119),(_ucs2 0x011a),(_ucs2 0x011b); -insert into t1 values (_ucs2 0x011c),(_ucs2 0x011d),(_ucs2 0x011e),(_ucs2 0x011f); -insert into t1 values (_ucs2 0x0120),(_ucs2 0x0121),(_ucs2 0x0122),(_ucs2 0x0123); -insert into t1 values (_ucs2 0x0124),(_ucs2 0x0125),(_ucs2 0x0126),(_ucs2 0x0127); -insert into t1 values (_ucs2 0x0128),(_ucs2 0x0129),(_ucs2 0x012a),(_ucs2 0x012b); -insert into t1 values (_ucs2 0x012c),(_ucs2 0x012d),(_ucs2 0x012e),(_ucs2 0x012f); -insert into t1 values (_ucs2 0x0130),(_ucs2 0x0131),(_ucs2 0x0132),(_ucs2 0x0133); -insert into t1 values (_ucs2 0x0134),(_ucs2 0x0135),(_ucs2 0x0136),(_ucs2 0x0137); -insert into t1 values (_ucs2 0x0138),(_ucs2 0x0139),(_ucs2 0x013a),(_ucs2 0x013b); -insert into t1 values (_ucs2 0x013c),(_ucs2 0x013d),(_ucs2 0x013e),(_ucs2 0x013f); -insert into t1 values (_ucs2 0x0140),(_ucs2 0x0141),(_ucs2 0x0142),(_ucs2 0x0143); -insert into t1 values (_ucs2 0x0144),(_ucs2 0x0145),(_ucs2 0x0146),(_ucs2 0x0147); -insert into t1 values (_ucs2 0x0148),(_ucs2 0x0149),(_ucs2 0x014a),(_ucs2 0x014b); -insert into t1 values (_ucs2 0x014c),(_ucs2 0x014d),(_ucs2 0x014e),(_ucs2 0x014f); -insert into t1 values (_ucs2 0x0150),(_ucs2 0x0151),(_ucs2 0x0152),(_ucs2 0x0153); -insert into t1 values (_ucs2 0x0154),(_ucs2 0x0155),(_ucs2 0x0156),(_ucs2 0x0157); -insert into t1 values (_ucs2 0x0158),(_ucs2 0x0159),(_ucs2 0x015a),(_ucs2 0x015b); -insert into t1 values (_ucs2 0x015c),(_ucs2 0x015d),(_ucs2 0x015e),(_ucs2 0x015f); -insert into t1 values (_ucs2 0x0160),(_ucs2 0x0161),(_ucs2 0x0162),(_ucs2 0x0163); -insert into t1 values (_ucs2 0x0164),(_ucs2 0x0165),(_ucs2 0x0166),(_ucs2 0x0167); -insert into t1 values (_ucs2 0x0168),(_ucs2 0x0169),(_ucs2 0x016a),(_ucs2 0x016b); -insert into t1 values (_ucs2 0x016c),(_ucs2 0x016d),(_ucs2 0x016e),(_ucs2 0x016f); -insert into t1 values (_ucs2 0x0170),(_ucs2 0x0171),(_ucs2 0x0172),(_ucs2 0x0173); -insert into t1 values (_ucs2 0x0174),(_ucs2 0x0175),(_ucs2 0x0176),(_ucs2 0x0177); -insert into t1 values (_ucs2 0x0178),(_ucs2 0x0179),(_ucs2 0x017a),(_ucs2 0x017b); -insert into t1 values (_ucs2 0x017c),(_ucs2 0x017d),(_ucs2 0x017e),(_ucs2 0x017f); -insert into t1 values (_ucs2 0x0180),(_ucs2 0x0181),(_ucs2 0x0182),(_ucs2 0x0183); -insert into t1 values (_ucs2 0x0184),(_ucs2 0x0185),(_ucs2 0x0186),(_ucs2 0x0187); -insert into t1 values (_ucs2 0x0188),(_ucs2 0x0189),(_ucs2 0x018a),(_ucs2 0x018b); -insert into t1 values (_ucs2 0x018c),(_ucs2 0x018d),(_ucs2 0x018e),(_ucs2 0x018f); -insert into t1 values (_ucs2 0x0190),(_ucs2 0x0191),(_ucs2 0x0192),(_ucs2 0x0193); -insert into t1 values (_ucs2 0x0194),(_ucs2 0x0195),(_ucs2 0x0196),(_ucs2 0x0197); -insert into t1 values (_ucs2 0x0198),(_ucs2 0x0199),(_ucs2 0x019a),(_ucs2 0x019b); -insert into t1 values (_ucs2 0x019c),(_ucs2 0x019d),(_ucs2 0x019e),(_ucs2 0x019f); -insert into t1 values (_ucs2 0x01a0),(_ucs2 0x01a1),(_ucs2 0x01a2),(_ucs2 0x01a3); -insert into t1 values (_ucs2 0x01a4),(_ucs2 0x01a5),(_ucs2 0x01a6),(_ucs2 0x01a7); -insert into t1 values (_ucs2 0x01a8),(_ucs2 0x01a9),(_ucs2 0x01aa),(_ucs2 0x01ab); -insert into t1 values (_ucs2 0x01ac),(_ucs2 0x01ad),(_ucs2 0x01ae),(_ucs2 0x01af); -insert into t1 values (_ucs2 0x01b0),(_ucs2 0x01b1),(_ucs2 0x01b2),(_ucs2 0x01b3); -insert into t1 values (_ucs2 0x01b4),(_ucs2 0x01b5),(_ucs2 0x01b6),(_ucs2 0x01b7); -insert into t1 values (_ucs2 0x01b8),(_ucs2 0x01b9),(_ucs2 0x01ba),(_ucs2 0x01bb); -insert into t1 values (_ucs2 0x01bc),(_ucs2 0x01bd),(_ucs2 0x01be),(_ucs2 0x01bf); -insert into t1 values (_ucs2 0x01c0),(_ucs2 0x01c1),(_ucs2 0x01c2),(_ucs2 0x01c3); -insert into t1 values (_ucs2 0x01c4),(_ucs2 0x01c5),(_ucs2 0x01c6),(_ucs2 0x01c7); -insert into t1 values (_ucs2 0x01c8),(_ucs2 0x01c9),(_ucs2 0x01ca),(_ucs2 0x01cb); -insert into t1 values (_ucs2 0x01cc),(_ucs2 0x01cd),(_ucs2 0x01ce),(_ucs2 0x01cf); -insert into t1 values (_ucs2 0x01d0),(_ucs2 0x01d1),(_ucs2 0x01d2),(_ucs2 0x01d3); -insert into t1 values (_ucs2 0x01d4),(_ucs2 0x01d5),(_ucs2 0x01d6),(_ucs2 0x01d7); -insert into t1 values (_ucs2 0x01d8),(_ucs2 0x01d9),(_ucs2 0x01da),(_ucs2 0x01db); -insert into t1 values (_ucs2 0x01dc),(_ucs2 0x01dd),(_ucs2 0x01de),(_ucs2 0x01df); -insert into t1 values (_ucs2 0x01e0),(_ucs2 0x01e1),(_ucs2 0x01e2),(_ucs2 0x01e3); -insert into t1 values (_ucs2 0x01e4),(_ucs2 0x01e5),(_ucs2 0x01e6),(_ucs2 0x01e7); -insert into t1 values (_ucs2 0x01e8),(_ucs2 0x01e9),(_ucs2 0x01ea),(_ucs2 0x01eb); -insert into t1 values (_ucs2 0x01ec),(_ucs2 0x01ed),(_ucs2 0x01ee),(_ucs2 0x01ef); -insert into t1 values (_ucs2 0x01f0),(_ucs2 0x01f1),(_ucs2 0x01f2),(_ucs2 0x01f3); -insert into t1 values (_ucs2 0x01f4),(_ucs2 0x01f5),(_ucs2 0x01f6),(_ucs2 0x01f7); -insert into t1 values (_ucs2 0x01f8),(_ucs2 0x01f9),(_ucs2 0x01fa),(_ucs2 0x01fb); -insert into t1 values (_ucs2 0x01fc),(_ucs2 0x01fd),(_ucs2 0x01fe),(_ucs2 0x01ff); -insert into t1 values ('AA'),('Aa'),('aa'),('aA'); -insert into t1 values ('CH'),('Ch'),('ch'),('cH'); -insert into t1 values ('DZ'),('Dz'),('dz'),('dZ'); -insert into t1 values ('IJ'),('Ij'),('ij'),('iJ'); -insert into t1 values ('LJ'),('Lj'),('lj'),('lJ'); -insert into t1 values ('LL'),('Ll'),('ll'),('lL'); -insert into t1 values ('NJ'),('Nj'),('nj'),('nJ'); -insert into t1 values ('OE'),('Oe'),('oe'),('oE'); -insert into t1 values ('SS'),('Ss'),('ss'),('sS'); -insert into t1 values ('RR'),('Rr'),('rr'),('rR'); -select group_concat(c1 order by c1) from t1 group by c1 collate utf8_unicode_ci; -group_concat(c1 order by c1) -÷ -× -A,a,À,Ã,Â,Ã,Ä,Ã…,à,á,â,ã,ä,Ã¥,Ä€,Ä,Ä‚,ă,Ä„,Ä…,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç» -AA,Aa,aA,aa -Æ,æ,Ç¢,Ç£,Ǽ,ǽ -B,b -Æ€ -Æ -Æ‚,ƃ -C,c,Ç,ç,Ć,ć,Ĉ,ĉ,ÄŠ,Ä‹,ÄŒ,Ä -CH,Ch,cH,ch -Ƈ,ƈ -D,d,ÄŽ,Ä -DZ,Dz,dZ,dz,Ç„,Ç…,dž,DZ,Dz,dz -Ä,Ä‘ -Ɖ -ÆŠ -Æ‹,ÆŒ -Ã,ð -E,e,È,É,Ê,Ë,è,é,ê,ë,Ä’,Ä“,Ä”,Ä•,Ä–,Ä—,Ę,Ä™,Äš,Ä› -ÆŽ,Ç -Æ -Æ -F,f -Æ‘,Æ’ -G,g,Äœ,Ä,Äž,ÄŸ,Ä ,Ä¡,Ä¢,Ä£,Ǧ,ǧ,Ç´,ǵ -Ǥ,Ç¥ -Æ“ -Æ” -Æ¢,Æ£ -H,h,Ĥ,Ä¥ -Æ•,Ƕ -Ħ,ħ -I,i,ÃŒ,Ã,ÃŽ,Ã,ì,í,î,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä­,Ä®,į,İ,Ç,Ç -IJ,Ij,iJ,ij,IJ,ij -ı -Æ— -Æ– -J,j,Ä´,ĵ,ǰ -K,k,Ķ,Ä·,Ǩ,Ç© -Ƙ,Æ™ -L,l,Ĺ,ĺ,Ä»,ļ,Ľ,ľ -Ä¿,Å€ -LJ,Lj,lJ,lj,LJ,Lj,lj -LL,Ll,lL,ll -Å,Å‚ -Æš -Æ› -M,m -N,n,Ñ,ñ,Ń,Å„,Å…,ņ,Ň,ň,Ǹ,ǹ -NJ,Nj,nJ,nj,ÇŠ,Ç‹,ÇŒ -Æ -Æž -ÅŠ,Å‹ -O,o,Ã’,Ó,Ô,Õ,Ö,ò,ó,ô,õ,ö,ÅŒ,Å,ÅŽ,Å,Å,Å‘,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç­ -OE,Oe,oE,oe,Å’,Å“ -Ø,ø,Ǿ,Ç¿ -Ɔ -ÆŸ -P,p -Ƥ,Æ¥ -Q,q -ĸ -R,r,Å”,Å•,Å–,Å—,Ř,Å™ -RR,Rr,rR,rr -Ʀ -S,s,Åš,Å›,Åœ,Å,Åž,ÅŸ,Å ,Å¡,Å¿ -SS,Ss,sS,ss,ß -Æ© -ƪ -T,t,Å¢,Å£,Ť,Å¥ -ƾ -Ŧ,ŧ -Æ« -Ƭ,Æ­ -Æ® -U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,Å©,Ū,Å«,Ŭ,Å­,Å®,ů,Ű,ű,Ų,ų,Ư,ư,Ç“,Ç”,Ç•,Ç–,Ç—,ǘ,Ç™,Çš,Ç›,Çœ -Æœ -Ʊ -V,v -Ʋ -W,w,Å´,ŵ -X,x -Y,y,Ã,ý,ÿ,Ŷ,Å·,Ÿ -Ƴ,Æ´ -Z,z,Ź,ź,Å»,ż,Ž,ž -Æ -Ƶ,ƶ -Æ·,Ç®,ǯ -Ƹ,ƹ -ƺ -Þ,þ -Æ¿,Ç· -Æ» -Ƨ,ƨ -Ƽ,ƽ -Æ„,Æ… -ʼn -Ç€ -Ç -Ç‚ -ǃ -select group_concat(c1 order by c1) from t1 group by c1 collate utf8_icelandic_ci; -group_concat(c1 order by c1) -÷ -× -A,a,À,Â,Ã,à,â,ã,Ä€,Ä,Ä‚,ă,Ä„,Ä…,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç» -AA,Aa,aA,aa -Ã,á -Ç¢,Ç£,Ǽ,ǽ -B,b -Æ€ -Æ -Æ‚,ƃ -C,c,Ç,ç,Ć,ć,Ĉ,ĉ,ÄŠ,Ä‹,ÄŒ,Ä -CH,Ch,cH,ch -Ƈ,ƈ -D,d,ÄŽ,Ä -DZ,Dz,dZ,dz,Ç„,Ç…,dž,DZ,Dz,dz -Ã,ð -Ä,Ä‘ -Ɖ -ÆŠ -Æ‹,ÆŒ -E,e,È,Ê,Ë,è,ê,ë,Ä’,Ä“,Ä”,Ä•,Ä–,Ä—,Ę,Ä™,Äš,Ä› -É,é -ÆŽ,Ç -Æ -Æ -F,f -Æ‘,Æ’ -G,g,Äœ,Ä,Äž,ÄŸ,Ä ,Ä¡,Ä¢,Ä£,Ǧ,ǧ,Ç´,ǵ -Ǥ,Ç¥ -Æ“ -Æ” -Æ¢,Æ£ -H,h,Ĥ,Ä¥ -Æ•,Ƕ -Ħ,ħ -I,i,ÃŒ,ÃŽ,Ã,ì,î,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä­,Ä®,į,İ,Ç,Ç -IJ,Ij,iJ,ij,IJ,ij -Ã,í -ı -Æ— -Æ– -J,j,Ä´,ĵ,ǰ -K,k,Ķ,Ä·,Ǩ,Ç© -Ƙ,Æ™ -L,l,Ĺ,ĺ,Ä»,ļ,Ľ,ľ -Ä¿,Å€ -LJ,Lj,lJ,lj,LJ,Lj,lj -LL,Ll,lL,ll -Å,Å‚ -Æš -Æ› -M,m -N,n,Ñ,ñ,Ń,Å„,Å…,ņ,Ň,ň,Ǹ,ǹ -NJ,Nj,nJ,nj,ÇŠ,Ç‹,ÇŒ -Æ -Æž -ÅŠ,Å‹ -O,o,Ã’,Ô,Õ,ò,ô,õ,ÅŒ,Å,ÅŽ,Å,Å,Å‘,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç­ -OE,Oe,oE,oe,Å’,Å“ -Ó,ó -Ǿ,Ç¿ -Ɔ -ÆŸ -P,p -Ƥ,Æ¥ -Q,q -ĸ -R,r,Å”,Å•,Å–,Å—,Ř,Å™ -RR,Rr,rR,rr -Ʀ -S,s,Åš,Å›,Åœ,Å,Åž,ÅŸ,Å ,Å¡,Å¿ -SS,Ss,sS,ss,ß -Æ© -ƪ -T,t,Å¢,Å£,Ť,Å¥ -ƾ -Ŧ,ŧ -Æ« -Ƭ,Æ­ -Æ® -U,u,Ù,Û,Ü,ù,û,ü,Ũ,Å©,Ū,Å«,Ŭ,Å­,Å®,ů,Ű,ű,Ų,ų,Ư,ư,Ç“,Ç”,Ç•,Ç–,Ç—,ǘ,Ç™,Çš,Ç›,Çœ -Ú,ú -Æœ -Ʊ -V,v -Ʋ -W,w,Å´,ŵ -X,x -Y,y,ÿ,Ŷ,Å·,Ÿ -Ã,ý -Ƴ,Æ´ -Z,z,Ź,ź,Å»,ż,Ž,ž -Æ -Þ,þ -Ä,Æ,ä,æ -Ö,Ø,ö,ø -Ã…,Ã¥ -Ƶ,ƶ -Æ·,Ç®,ǯ -Ƹ,ƹ -ƺ -Æ¿,Ç· -Æ» -Ƨ,ƨ -Ƽ,ƽ -Æ„,Æ… -ʼn -Ç€ -Ç -Ç‚ -ǃ -select group_concat(c1 order by c1) from t1 group by c1 collate utf8_latvian_ci; -group_concat(c1 order by c1) -÷ -× -A,a,À,Ã,Â,Ã,Ä,Ã…,à,á,â,ã,ä,Ã¥,Ä€,Ä,Ä‚,ă,Ä„,Ä…,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç» -AA,Aa,aA,aa -Æ,æ,Ç¢,Ç£,Ǽ,ǽ -B,b -Æ€ -Æ -Æ‚,ƃ -C,c,Ç,ç,Ć,ć,Ĉ,ĉ,ÄŠ,Ä‹ -CH,Ch,cH,ch -ÄŒ,Ä -Ƈ,ƈ -D,d,ÄŽ,Ä -DZ,Dz,dZ,dz,Ç„,Ç…,dž,DZ,Dz,dz -Ä,Ä‘ -Ɖ -ÆŠ -Æ‹,ÆŒ -Ã,ð -E,e,È,É,Ê,Ë,è,é,ê,ë,Ä’,Ä“,Ä”,Ä•,Ä–,Ä—,Ę,Ä™,Äš,Ä› -ÆŽ,Ç -Æ -Æ -F,f -Æ‘,Æ’ -G,g,Äœ,Ä,Äž,ÄŸ,Ä ,Ä¡,Ǧ,ǧ,Ç´,ǵ -Ä¢,Ä£ -Ǥ,Ç¥ -Æ“ -Æ” -Æ¢,Æ£ -H,h,Ĥ,Ä¥ -Æ•,Ƕ -Ħ,ħ -I,i,ÃŒ,Ã,ÃŽ,Ã,ì,í,î,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä­,Ä®,į,İ,Ç,Ç -IJ,Ij,iJ,ij,IJ,ij -Y,y -ı -Æ— -Æ– -J,j,Ä´,ĵ,ǰ -K,k,Ǩ,Ç© -Ķ,Ä· -Ƙ,Æ™ -L,l,Ĺ,ĺ,Ľ,ľ -Ä¿,Å€ -LJ,Lj,lJ,lj,LJ,Lj,lj -LL,Ll,lL,ll -Ä»,ļ -Å,Å‚ -Æš -Æ› -M,m -N,n,Ñ,ñ,Ń,Å„,Ň,ň,Ǹ,ǹ -NJ,Nj,nJ,nj,ÇŠ,Ç‹,ÇŒ -Å…,ņ -Æ -Æž -ÅŠ,Å‹ -O,o,Ã’,Ó,Ô,Õ,Ö,ò,ó,ô,õ,ö,ÅŒ,Å,ÅŽ,Å,Å,Å‘,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç­ -OE,Oe,oE,oe,Å’,Å“ -Ø,ø,Ǿ,Ç¿ -Ɔ -ÆŸ -P,p -Ƥ,Æ¥ -Q,q -ĸ -R,r,Å”,Å•,Ř,Å™ -RR,Rr,rR,rr -Å–,Å— -Ʀ -S,s,Åš,Å›,Åœ,Å,Åž,ÅŸ,Å¿ -SS,Ss,sS,ss,ß -Å ,Å¡ -Æ© -ƪ -T,t,Å¢,Å£,Ť,Å¥ -ƾ -Ŧ,ŧ -Æ« -Ƭ,Æ­ -Æ® -U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,Å©,Ū,Å«,Ŭ,Å­,Å®,ů,Ű,ű,Ų,ų,Ư,ư,Ç“,Ç”,Ç•,Ç–,Ç—,ǘ,Ç™,Çš,Ç›,Çœ -Æœ -Ʊ -V,v -Ʋ -W,w,Å´,ŵ -X,x -Ã,ý,ÿ,Ŷ,Å·,Ÿ -Ƴ,Æ´ -Z,z,Ź,ź,Å»,ż -Æ -Ž,ž -Ƶ,ƶ -Æ·,Ç®,ǯ -Ƹ,ƹ -ƺ -Þ,þ -Æ¿,Ç· -Æ» -Ƨ,ƨ -Ƽ,ƽ -Æ„,Æ… -ʼn -Ç€ -Ç -Ç‚ -ǃ -select group_concat(c1 order by c1) from t1 group by c1 collate utf8_romanian_ci; -group_concat(c1 order by c1) -÷ -× -A,a,À,Ã,Ã,Ä,Ã…,à,á,ã,ä,Ã¥,Ä€,Ä,Ä„,Ä…,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç» -AA,Aa,aA,aa -Ä‚,ă -Â,â -Æ,æ,Ç¢,Ç£,Ǽ,ǽ -B,b -Æ€ -Æ -Æ‚,ƃ -C,c,Ç,ç,Ć,ć,Ĉ,ĉ,ÄŠ,Ä‹,ÄŒ,Ä -CH,Ch,cH,ch -Ƈ,ƈ -D,d,ÄŽ,Ä -DZ,Dz,dZ,dz,Ç„,Ç…,dž,DZ,Dz,dz -Ä,Ä‘ -Ɖ -ÆŠ -Æ‹,ÆŒ -Ã,ð -E,e,È,É,Ê,Ë,è,é,ê,ë,Ä’,Ä“,Ä”,Ä•,Ä–,Ä—,Ę,Ä™,Äš,Ä› -ÆŽ,Ç -Æ -Æ -F,f -Æ‘,Æ’ -G,g,Äœ,Ä,Äž,ÄŸ,Ä ,Ä¡,Ä¢,Ä£,Ǧ,ǧ,Ç´,ǵ -Ǥ,Ç¥ -Æ“ -Æ” -Æ¢,Æ£ -H,h,Ĥ,Ä¥ -Æ•,Ƕ -Ħ,ħ -I,i,ÃŒ,Ã,Ã,ì,í,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä­,Ä®,į,İ,Ç,Ç -IJ,Ij,iJ,ij,IJ,ij -ÃŽ,î -ı -Æ— -Æ– -J,j,Ä´,ĵ,ǰ -K,k,Ķ,Ä·,Ǩ,Ç© -Ƙ,Æ™ -L,l,Ĺ,ĺ,Ä»,ļ,Ľ,ľ -Ä¿,Å€ -LJ,Lj,lJ,lj,LJ,Lj,lj -LL,Ll,lL,ll -Å,Å‚ -Æš -Æ› -M,m -N,n,Ñ,ñ,Ń,Å„,Å…,ņ,Ň,ň,Ǹ,ǹ -NJ,Nj,nJ,nj,ÇŠ,Ç‹,ÇŒ -Æ -Æž -ÅŠ,Å‹ -O,o,Ã’,Ó,Ô,Õ,Ö,ò,ó,ô,õ,ö,ÅŒ,Å,ÅŽ,Å,Å,Å‘,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç­ -OE,Oe,oE,oe,Å’,Å“ -Ø,ø,Ǿ,Ç¿ -Ɔ -ÆŸ -P,p -Ƥ,Æ¥ -Q,q -ĸ -R,r,Å”,Å•,Å–,Å—,Ř,Å™ -RR,Rr,rR,rr -Ʀ -S,s,Åš,Å›,Åœ,Å,Å ,Å¡,Å¿ -SS,Ss,sS,ss,ß -Åž,ÅŸ -Æ© -ƪ -T,t,Ť,Å¥ -ƾ -Å¢,Å£ -Ŧ,ŧ -Æ« -Ƭ,Æ­ -Æ® -U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,Å©,Ū,Å«,Ŭ,Å­,Å®,ů,Ű,ű,Ų,ų,Ư,ư,Ç“,Ç”,Ç•,Ç–,Ç—,ǘ,Ç™,Çš,Ç›,Çœ -Æœ -Ʊ -V,v -Ʋ -W,w,Å´,ŵ -X,x -Y,y,Ã,ý,ÿ,Ŷ,Å·,Ÿ -Ƴ,Æ´ -Z,z,Ź,ź,Å»,ż,Ž,ž -Æ -Ƶ,ƶ -Æ·,Ç®,ǯ -Ƹ,ƹ -ƺ -Þ,þ -Æ¿,Ç· -Æ» -Ƨ,ƨ -Ƽ,ƽ -Æ„,Æ… -ʼn -Ç€ -Ç -Ç‚ -ǃ -select group_concat(c1 order by c1) from t1 group by c1 collate utf8_slovenian_ci; -group_concat(c1 order by c1) -÷ -× -A,a,À,Ã,Â,Ã,Ä,Ã…,à,á,â,ã,ä,Ã¥,Ä€,Ä,Ä‚,ă,Ä„,Ä…,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç» -AA,Aa,aA,aa -Æ,æ,Ç¢,Ç£,Ǽ,ǽ -B,b -Æ€ -Æ -Æ‚,ƃ -C,c,Ç,ç,Ć,ć,Ĉ,ĉ,ÄŠ,Ä‹ -CH,Ch,cH,ch -ÄŒ,Ä -Ƈ,ƈ -D,d,ÄŽ,Ä -DZ,Dz,dZ,dz,Ç„,Ç…,dž,DZ,Dz,dz -Ä,Ä‘ -Ɖ -ÆŠ -Æ‹,ÆŒ -Ã,ð -E,e,È,É,Ê,Ë,è,é,ê,ë,Ä’,Ä“,Ä”,Ä•,Ä–,Ä—,Ę,Ä™,Äš,Ä› -ÆŽ,Ç -Æ -Æ -F,f -Æ‘,Æ’ -G,g,Äœ,Ä,Äž,ÄŸ,Ä ,Ä¡,Ä¢,Ä£,Ǧ,ǧ,Ç´,ǵ -Ǥ,Ç¥ -Æ“ -Æ” -Æ¢,Æ£ -H,h,Ĥ,Ä¥ -Æ•,Ƕ -Ħ,ħ -I,i,ÃŒ,Ã,ÃŽ,Ã,ì,í,î,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä­,Ä®,į,İ,Ç,Ç -IJ,Ij,iJ,ij,IJ,ij -ı -Æ— -Æ– -J,j,Ä´,ĵ,ǰ -K,k,Ķ,Ä·,Ǩ,Ç© -Ƙ,Æ™ -L,l,Ĺ,ĺ,Ä»,ļ,Ľ,ľ -Ä¿,Å€ -LJ,Lj,lJ,lj,LJ,Lj,lj -LL,Ll,lL,ll -Å,Å‚ -Æš -Æ› -M,m -N,n,Ñ,ñ,Ń,Å„,Å…,ņ,Ň,ň,Ǹ,ǹ -NJ,Nj,nJ,nj,ÇŠ,Ç‹,ÇŒ -Æ -Æž -ÅŠ,Å‹ -O,o,Ã’,Ó,Ô,Õ,Ö,ò,ó,ô,õ,ö,ÅŒ,Å,ÅŽ,Å,Å,Å‘,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç­ -OE,Oe,oE,oe,Å’,Å“ -Ø,ø,Ǿ,Ç¿ -Ɔ -ÆŸ -P,p -Ƥ,Æ¥ -Q,q -ĸ -R,r,Å”,Å•,Å–,Å—,Ř,Å™ -RR,Rr,rR,rr -Ʀ -S,s,Åš,Å›,Åœ,Å,Åž,ÅŸ,Å¿ -SS,Ss,sS,ss,ß -Å ,Å¡ -Æ© -ƪ -T,t,Å¢,Å£,Ť,Å¥ -ƾ -Ŧ,ŧ -Æ« -Ƭ,Æ­ -Æ® -U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,Å©,Ū,Å«,Ŭ,Å­,Å®,ů,Ű,ű,Ų,ų,Ư,ư,Ç“,Ç”,Ç•,Ç–,Ç—,ǘ,Ç™,Çš,Ç›,Çœ -Æœ -Ʊ -V,v -Ʋ -W,w,Å´,ŵ -X,x -Y,y,Ã,ý,ÿ,Ŷ,Å·,Ÿ -Ƴ,Æ´ -Z,z,Ź,ź,Å»,ż -Æ -Ž,ž -Ƶ,ƶ -Æ·,Ç®,ǯ -Ƹ,ƹ -ƺ -Þ,þ -Æ¿,Ç· -Æ» -Ƨ,ƨ -Ƽ,ƽ -Æ„,Æ… -ʼn -Ç€ -Ç -Ç‚ -ǃ -select group_concat(c1 order by c1) from t1 group by c1 collate utf8_polish_ci; -group_concat(c1 order by c1) -÷ -× -A,a,À,Ã,Â,Ã,Ä,Ã…,à,á,â,ã,ä,Ã¥,Ä€,Ä,Ä‚,ă,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç» -AA,Aa,aA,aa -Ä„,Ä… -Æ,æ,Ç¢,Ç£,Ǽ,ǽ -B,b -Æ€ -Æ -Æ‚,ƃ -C,c,Ç,ç,Ĉ,ĉ,ÄŠ,Ä‹,ÄŒ,Ä -CH,Ch,cH,ch -Ć,ć -Ƈ,ƈ -D,d,ÄŽ,Ä -DZ,Dz,dZ,dz,Ç„,Ç…,dž,DZ,Dz,dz -Ä,Ä‘ -Ɖ -ÆŠ -Æ‹,ÆŒ -Ã,ð -E,e,È,É,Ê,Ë,è,é,ê,ë,Ä’,Ä“,Ä”,Ä•,Ä–,Ä—,Äš,Ä› -Ę,Ä™ -ÆŽ,Ç -Æ -Æ -F,f -Æ‘,Æ’ -G,g,Äœ,Ä,Äž,ÄŸ,Ä ,Ä¡,Ä¢,Ä£,Ǧ,ǧ,Ç´,ǵ -Ǥ,Ç¥ -Æ“ -Æ” -Æ¢,Æ£ -H,h,Ĥ,Ä¥ -Æ•,Ƕ -Ħ,ħ -I,i,ÃŒ,Ã,ÃŽ,Ã,ì,í,î,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä­,Ä®,į,İ,Ç,Ç -IJ,Ij,iJ,ij,IJ,ij -ı -Æ— -Æ– -J,j,Ä´,ĵ,ǰ -K,k,Ķ,Ä·,Ǩ,Ç© -Ƙ,Æ™ -L,l,Ĺ,ĺ,Ä»,ļ,Ľ,ľ -Ä¿,Å€ -LJ,Lj,lJ,lj,LJ,Lj,lj -LL,Ll,lL,ll -Å,Å‚ -Æš -Æ› -M,m -N,n,Ñ,ñ,Å…,ņ,Ň,ň,Ǹ,ǹ -NJ,Nj,nJ,nj,ÇŠ,Ç‹,ÇŒ -Ń,Å„ -Æ -Æž -ÅŠ,Å‹ -O,o,Ã’,Ô,Õ,Ö,ò,ô,õ,ö,ÅŒ,Å,ÅŽ,Å,Å,Å‘,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç­ -OE,Oe,oE,oe,Å’,Å“ -Ó,ó -Ø,ø,Ǿ,Ç¿ -Ɔ -ÆŸ -P,p -Ƥ,Æ¥ -Q,q -ĸ -R,r,Å”,Å•,Å–,Å—,Ř,Å™ -RR,Rr,rR,rr -Ʀ -S,s,Åœ,Å,Åž,ÅŸ,Å ,Å¡,Å¿ -SS,Ss,sS,ss,ß -Åš,Å› -Æ© -ƪ -T,t,Å¢,Å£,Ť,Å¥ -ƾ -Ŧ,ŧ -Æ« -Ƭ,Æ­ -Æ® -U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,Å©,Ū,Å«,Ŭ,Å­,Å®,ů,Ű,ű,Ų,ų,Ư,ư,Ç“,Ç”,Ç•,Ç–,Ç—,ǘ,Ç™,Çš,Ç›,Çœ -Æœ -Ʊ -V,v -Ʋ -W,w,Å´,ŵ -X,x -Y,y,Ã,ý,ÿ,Ŷ,Å·,Ÿ -Ƴ,Æ´ -Z,z,Ž,ž -Æ -Ź,ź -Å»,ż -Ƶ,ƶ -Æ·,Ç®,ǯ -Ƹ,ƹ -ƺ -Þ,þ -Æ¿,Ç· -Æ» -Ƨ,ƨ -Ƽ,ƽ -Æ„,Æ… -ʼn -Ç€ -Ç -Ç‚ -ǃ -select group_concat(c1 order by c1) from t1 group by c1 collate utf8_estonian_ci; -group_concat(c1 order by c1) -÷ -× -A,a,À,Ã,Â,Ã,Ã…,à,á,â,ã,Ã¥,Ä€,Ä,Ä‚,ă,Ä„,Ä…,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç» -AA,Aa,aA,aa -Æ,æ,Ç¢,Ç£,Ǽ,ǽ -B,b -Æ€ -Æ -Æ‚,ƃ -C,c,Ç,ç,Ć,ć,Ĉ,ĉ,ÄŠ,Ä‹,ÄŒ,Ä -CH,Ch,cH,ch -Ƈ,ƈ -D,d,ÄŽ,Ä -DZ,Dz,dZ,dz -Ç„,Ç…,dž,DZ,Dz,dz -Ä,Ä‘ -Ɖ -ÆŠ -Æ‹,ÆŒ -Ã,ð -E,e,È,É,Ê,Ë,è,é,ê,ë,Ä’,Ä“,Ä”,Ä•,Ä–,Ä—,Ę,Ä™,Äš,Ä› -ÆŽ,Ç -Æ -Æ -F,f -Æ‘,Æ’ -G,g,Äœ,Ä,Äž,ÄŸ,Ä ,Ä¡,Ä¢,Ä£,Ǧ,ǧ,Ç´,ǵ -Ǥ,Ç¥ -Æ“ -Æ” -Æ¢,Æ£ -H,h,Ĥ,Ä¥ -Æ•,Ƕ -Ħ,ħ -I,i,ÃŒ,Ã,ÃŽ,Ã,ì,í,î,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä­,Ä®,į,İ,Ç,Ç -IJ,Ij,iJ,ij,IJ,ij -ı -Æ— -Æ– -J,j,Ä´,ĵ,ǰ -K,k,Ķ,Ä·,Ǩ,Ç© -Ƙ,Æ™ -L,l,Ĺ,ĺ,Ä»,ļ,Ľ,ľ -Ä¿,Å€ -LJ,Lj,lJ,lj,LJ,Lj,lj -LL,Ll,lL,ll -Å,Å‚ -Æš -Æ› -M,m -N,n,Ñ,ñ,Ń,Å„,Å…,ņ,Ň,ň,Ǹ,ǹ -NJ,Nj,nJ,nj,ÇŠ,Ç‹,ÇŒ -Æ -Æž -ÅŠ,Å‹ -O,o,Ã’,Ó,Ô,ò,ó,ô,ÅŒ,Å,ÅŽ,Å,Å,Å‘,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç­ -OE,Oe,oE,oe,Å’,Å“ -Ø,ø,Ǿ,Ç¿ -Ɔ -ÆŸ -P,p -Ƥ,Æ¥ -Q,q -ĸ -R,r,Å”,Å•,Å–,Å—,Ř,Å™ -RR,Rr,rR,rr -Ʀ -S,s,Åš,Å›,Åœ,Å,Åž,ÅŸ,Å¿ -SS,Ss,sS,ss,ß -Å ,Å¡ -Z,z -Ž,ž -Æ© -ƪ -T,t,Å¢,Å£,Ť,Å¥ -ƾ -Ŧ,ŧ -Æ« -Ƭ,Æ­ -Æ® -U,u,Ù,Ú,Û,ù,ú,û,Ũ,Å©,Ū,Å«,Ŭ,Å­,Å®,ů,Ű,ű,Ų,ų,Ư,ư,Ç“,Ç”,Ç•,Ç–,Ç—,ǘ,Ç™,Çš,Ç›,Çœ -Æœ -Ʊ -V,v -Ʋ -W,w,Å´,ŵ -Õ,õ -Ä,ä -Ö,ö -Ü,ü -X,x -Y,y,Ã,ý,ÿ,Ŷ,Å·,Ÿ -Ƴ,Æ´ -Ź,ź,Å»,ż -Æ -Ƶ,ƶ -Æ·,Ç®,ǯ -Ƹ,ƹ -ƺ -Þ,þ -Æ¿,Ç· -Æ» -Ƨ,ƨ -Ƽ,ƽ -Æ„,Æ… -ʼn -Ç€ -Ç -Ç‚ -ǃ -select group_concat(c1 order by c1) from t1 group by c1 collate utf8_spanish_ci; -group_concat(c1 order by c1) -÷ -× -A,a,À,Ã,Â,Ã,Ä,Ã…,à,á,â,ã,ä,Ã¥,Ä€,Ä,Ä‚,ă,Ä„,Ä…,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç» -AA,Aa,aA,aa -Æ,æ,Ç¢,Ç£,Ǽ,ǽ -B,b -Æ€ -Æ -Æ‚,ƃ -C,c,Ç,ç,Ć,ć,Ĉ,ĉ,ÄŠ,Ä‹,ÄŒ,Ä -CH,Ch,cH,ch -Ƈ,ƈ -D,d,ÄŽ,Ä -DZ,Dz,dZ,dz,Ç„,Ç…,dž,DZ,Dz,dz -Ä,Ä‘ -Ɖ -ÆŠ -Æ‹,ÆŒ -Ã,ð -E,e,È,É,Ê,Ë,è,é,ê,ë,Ä’,Ä“,Ä”,Ä•,Ä–,Ä—,Ę,Ä™,Äš,Ä› -ÆŽ,Ç -Æ -Æ -F,f -Æ‘,Æ’ -G,g,Äœ,Ä,Äž,ÄŸ,Ä ,Ä¡,Ä¢,Ä£,Ǧ,ǧ,Ç´,ǵ -Ǥ,Ç¥ -Æ“ -Æ” -Æ¢,Æ£ -H,h,Ĥ,Ä¥ -Æ•,Ƕ -Ħ,ħ -I,i,ÃŒ,Ã,ÃŽ,Ã,ì,í,î,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä­,Ä®,į,İ,Ç,Ç -IJ,Ij,iJ,ij,IJ,ij -ı -Æ— -Æ– -J,j,Ä´,ĵ,ǰ -K,k,Ķ,Ä·,Ǩ,Ç© -Ƙ,Æ™ -L,l,Ĺ,ĺ,Ä»,ļ,Ľ,ľ -Ä¿,Å€ -LJ,Lj,lJ,lj,LJ,Lj,lj -LL,Ll,lL,ll -Å,Å‚ -Æš -Æ› -M,m -N,n,Ń,Å„,Å…,ņ,Ň,ň,Ǹ,ǹ -NJ,Nj,nJ,nj,ÇŠ,Ç‹,ÇŒ -Ñ,ñ -Æ -Æž -ÅŠ,Å‹ -O,o,Ã’,Ó,Ô,Õ,Ö,ò,ó,ô,õ,ö,ÅŒ,Å,ÅŽ,Å,Å,Å‘,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç­ -OE,Oe,oE,oe,Å’,Å“ -Ø,ø,Ǿ,Ç¿ -Ɔ -ÆŸ -P,p -Ƥ,Æ¥ -Q,q -ĸ -R,r,Å”,Å•,Å–,Å—,Ř,Å™ -RR,Rr,rR,rr -Ʀ -S,s,Åš,Å›,Åœ,Å,Åž,ÅŸ,Å ,Å¡,Å¿ -SS,Ss,sS,ss,ß -Æ© -ƪ -T,t,Å¢,Å£,Ť,Å¥ -ƾ -Ŧ,ŧ -Æ« -Ƭ,Æ­ -Æ® -U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,Å©,Ū,Å«,Ŭ,Å­,Å®,ů,Ű,ű,Ų,ų,Ư,ư,Ç“,Ç”,Ç•,Ç–,Ç—,ǘ,Ç™,Çš,Ç›,Çœ -Æœ -Ʊ -V,v -Ʋ -W,w,Å´,ŵ -X,x -Y,y,Ã,ý,ÿ,Ŷ,Å·,Ÿ -Ƴ,Æ´ -Z,z,Ź,ź,Å»,ż,Ž,ž -Æ -Ƶ,ƶ -Æ·,Ç®,ǯ -Ƹ,ƹ -ƺ -Þ,þ -Æ¿,Ç· -Æ» -Ƨ,ƨ -Ƽ,ƽ -Æ„,Æ… -ʼn -Ç€ -Ç -Ç‚ -ǃ -select group_concat(c1 order by c1) from t1 group by c1 collate utf8_swedish_ci; -group_concat(c1 order by c1) -÷ -× -A,a,À,Ã,Â,Ã,à,á,â,ã,Ä€,Ä,Ä‚,ă,Ä„,Ä…,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç» -AA,Aa,aA,aa -Ç¢,Ç£,Ǽ,ǽ -B,b -Æ€ -Æ -Æ‚,ƃ -C,c,Ç,ç,Ć,ć,Ĉ,ĉ,ÄŠ,Ä‹,ÄŒ,Ä -CH,Ch,cH,ch -Ƈ,ƈ -D,d,ÄŽ,Ä -DZ,Dz,dZ,dz,Ç„,Ç…,dž,DZ,Dz,dz -Ä,Ä‘ -Ɖ -ÆŠ -Æ‹,ÆŒ -Ã,ð -E,e,È,É,Ê,Ë,è,é,ê,ë,Ä’,Ä“,Ä”,Ä•,Ä–,Ä—,Ę,Ä™,Äš,Ä› -ÆŽ,Ç -Æ -Æ -F,f -Æ‘,Æ’ -G,g,Äœ,Ä,Äž,ÄŸ,Ä ,Ä¡,Ä¢,Ä£,Ǧ,ǧ,Ç´,ǵ -Ǥ,Ç¥ -Æ“ -Æ” -Æ¢,Æ£ -H,h,Ĥ,Ä¥ -Æ•,Ƕ -Ħ,ħ -I,i,ÃŒ,Ã,ÃŽ,Ã,ì,í,î,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä­,Ä®,į,İ,Ç,Ç -IJ,Ij,iJ,ij,IJ,ij -ı -Æ— -Æ– -J,j,Ä´,ĵ,ǰ -K,k,Ķ,Ä·,Ǩ,Ç© -Ƙ,Æ™ -L,l,Ĺ,ĺ,Ä»,ļ,Ľ,ľ -Ä¿,Å€ -LJ,Lj,lJ,lj,LJ,Lj,lj -LL,Ll,lL,ll -Å,Å‚ -Æš -Æ› -M,m -N,n,Ñ,ñ,Ń,Å„,Å…,ņ,Ň,ň,Ǹ,ǹ -NJ,Nj,nJ,nj,ÇŠ,Ç‹,ÇŒ -Æ -Æž -ÅŠ,Å‹ -O,o,Ã’,Ó,Ô,Õ,ò,ó,ô,õ,ÅŒ,Å,ÅŽ,Å,Å,Å‘,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç­ -OE,Oe,oE,oe,Å’,Å“ -Ǿ,Ç¿ -Ɔ -ÆŸ -P,p -Ƥ,Æ¥ -Q,q -ĸ -R,r,Å”,Å•,Å–,Å—,Ř,Å™ -RR,Rr,rR,rr -Ʀ -S,s,Åš,Å›,Åœ,Å,Åž,ÅŸ,Å ,Å¡,Å¿ -SS,Ss,sS,ss,ß -Æ© -ƪ -T,t,Å¢,Å£,Ť,Å¥ -ƾ -Ŧ,ŧ -Æ« -Ƭ,Æ­ -Æ® -U,u,Ù,Ú,Û,ù,ú,û,Ũ,Å©,Ū,Å«,Ŭ,Å­,Å®,ů,Ű,ű,Ų,ų,Ư,ư,Ç“,Ç”,Ç•,Ç–,Ç—,ǘ,Ç™,Çš,Ç›,Çœ -Æœ -Ʊ -V,v -Ʋ -W,w,Å´,ŵ -X,x -Y,y,Ü,Ã,ü,ý,ÿ,Ŷ,Å·,Ÿ -Ƴ,Æ´ -Z,z,Ź,ź,Å»,ż,Ž,ž -Æ -Ã…,Ã¥ -Ä,Æ,ä,æ -Ö,Ø,ö,ø -Ƶ,ƶ -Æ·,Ç®,ǯ -Ƹ,ƹ -ƺ -Þ,þ -Æ¿,Ç· -Æ» -Ƨ,ƨ -Ƽ,ƽ -Æ„,Æ… -ʼn -Ç€ -Ç -Ç‚ -ǃ -select group_concat(c1 order by c1) from t1 group by c1 collate utf8_turkish_ci; -group_concat(c1 order by c1) -÷ -× -A,a,À,Ã,Â,Ã,Ä,Ã…,à,á,â,ã,ä,Ã¥,Ä€,Ä,Ä‚,ă,Ä„,Ä…,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç» -AA,Aa,aA,aa -Æ,æ,Ç¢,Ç£,Ǽ,ǽ -B,b -Æ€ -Æ -Æ‚,ƃ -C,c,Ć,ć,Ĉ,ĉ,ÄŠ,Ä‹,ÄŒ,Ä -CH,Ch,cH,ch -Ç,ç -Ƈ,ƈ -D,d,ÄŽ,Ä -DZ,Dz,dZ,dz,Ç„,Ç…,dž,DZ,Dz,dz -Ä,Ä‘ -Ɖ -ÆŠ -Æ‹,ÆŒ -Ã,ð -E,e,È,É,Ê,Ë,è,é,ê,ë,Ä’,Ä“,Ä”,Ä•,Ä–,Ä—,Ę,Ä™,Äš,Ä› -ÆŽ,Ç -Æ -Æ -F,f -Æ‘,Æ’ -G,g,Äœ,Ä,Ä ,Ä¡,Ä¢,Ä£,Ǧ,ǧ,Ç´,ǵ -Äž,ÄŸ -Ǥ,Ç¥ -Æ“ -Æ” -Æ¢,Æ£ -H,h,Ĥ,Ä¥ -I,ı -IJ,Ij -Æ•,Ƕ -Ħ,ħ -i,ÃŒ,Ã,ÃŽ,Ã,ì,í,î,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä­,Ä®,į,İ,Ç,Ç -iJ,ij,IJ,ij -Æ— -Æ– -J,j,Ä´,ĵ,ǰ -K,k,Ķ,Ä·,Ǩ,Ç© -Ƙ,Æ™ -L,l,Ĺ,ĺ,Ä»,ļ,Ľ,ľ -Ä¿,Å€ -LJ,Lj,lJ,lj,LJ,Lj,lj -LL,Ll,lL,ll -Å,Å‚ -Æš -Æ› -M,m -N,n,Ñ,ñ,Ń,Å„,Å…,ņ,Ň,ň,Ǹ,ǹ -NJ,Nj,nJ,nj,ÇŠ,Ç‹,ÇŒ -Æ -Æž -ÅŠ,Å‹ -O,o,Ã’,Ó,Ô,Õ,ò,ó,ô,õ,ÅŒ,Å,ÅŽ,Å,Å,Å‘,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç­ -OE,Oe,oE,oe,Å’,Å“ -Ö,ö -Ø,ø,Ǿ,Ç¿ -Ɔ -ÆŸ -P,p -Ƥ,Æ¥ -Q,q -ĸ -R,r,Å”,Å•,Å–,Å—,Ř,Å™ -RR,Rr,rR,rr -Ʀ -S,s,Åš,Å›,Åœ,Å,Å ,Å¡,Å¿ -SS,Ss,sS,ss,ß -Åž,ÅŸ -Æ© -ƪ -T,t,Å¢,Å£,Ť,Å¥ -ƾ -Ŧ,ŧ -Æ« -Ƭ,Æ­ -Æ® -U,u,Ù,Ú,Û,ù,ú,û,Ũ,Å©,Ū,Å«,Ŭ,Å­,Å®,ů,Ű,ű,Ų,ų,Ư,ư,Ç“,Ç”,Ç•,Ç–,Ç—,ǘ,Ç™,Çš,Ç›,Çœ -Ü,ü -Æœ -Ʊ -V,v -Ʋ -W,w,Å´,ŵ -X,x -Y,y,Ã,ý,ÿ,Ŷ,Å·,Ÿ -Ƴ,Æ´ -Z,z,Ź,ź,Å»,ż,Ž,ž -Æ -Ƶ,ƶ -Æ·,Ç®,ǯ -Ƹ,ƹ -ƺ -Þ,þ -Æ¿,Ç· -Æ» -Ƨ,ƨ -Ƽ,ƽ -Æ„,Æ… -ʼn -Ç€ -Ç -Ç‚ -ǃ -select group_concat(c1 order by c1) from t1 group by c1 collate utf8_czech_ci; -group_concat(c1 order by c1) -÷ -× -A,a,À,Ã,Â,Ã,Ä,Ã…,à,á,â,ã,ä,Ã¥,Ä€,Ä,Ä‚,ă,Ä„,Ä…,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç» -AA,Aa,aA,aa -Æ,æ,Ç¢,Ç£,Ǽ,ǽ -B,b -Æ€ -Æ -Æ‚,ƃ -C,c,Ç,ç,Ć,ć,Ĉ,ĉ,ÄŠ,Ä‹ -cH -ÄŒ,Ä -Ƈ,ƈ -D,d,ÄŽ,Ä -DZ,Dz,dZ,dz,Ç„,Ç…,dž,DZ,Dz,dz -Ä,Ä‘ -Ɖ -ÆŠ -Æ‹,ÆŒ -Ã,ð -E,e,È,É,Ê,Ë,è,é,ê,ë,Ä’,Ä“,Ä”,Ä•,Ä–,Ä—,Ę,Ä™,Äš,Ä› -ÆŽ,Ç -Æ -Æ -F,f -Æ‘,Æ’ -G,g,Äœ,Ä,Äž,ÄŸ,Ä ,Ä¡,Ä¢,Ä£,Ǧ,ǧ,Ç´,ǵ -Ǥ,Ç¥ -Æ“ -Æ” -Æ¢,Æ£ -H,h,Ĥ,Ä¥ -CH,Ch,ch -Æ•,Ƕ -Ħ,ħ -I,i,ÃŒ,Ã,ÃŽ,Ã,ì,í,î,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä­,Ä®,į,İ,Ç,Ç -IJ,Ij,iJ,ij,IJ,ij -ı -Æ— -Æ– -J,j,Ä´,ĵ,ǰ -K,k,Ķ,Ä·,Ǩ,Ç© -Ƙ,Æ™ -L,l,Ĺ,ĺ,Ä»,ļ,Ľ,ľ -Ä¿,Å€ -LJ,Lj,lJ,lj,LJ,Lj,lj -LL,Ll,lL,ll -Å,Å‚ -Æš -Æ› -M,m -N,n,Ñ,ñ,Ń,Å„,Å…,ņ,Ň,ň,Ǹ,ǹ -NJ,Nj,nJ,nj,ÇŠ,Ç‹,ÇŒ -Æ -Æž -ÅŠ,Å‹ -O,o,Ã’,Ó,Ô,Õ,Ö,ò,ó,ô,õ,ö,ÅŒ,Å,ÅŽ,Å,Å,Å‘,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç­ -OE,Oe,oE,oe,Å’,Å“ -Ø,ø,Ǿ,Ç¿ -Ɔ -ÆŸ -P,p -Ƥ,Æ¥ -Q,q -ĸ -R,r,Å”,Å•,Å–,Å— -RR,Rr,rR,rr -Ř,Å™ -Ʀ -S,s,Åš,Å›,Åœ,Å,Åž,ÅŸ,Å¿ -SS,Ss,sS,ss,ß -Å ,Å¡ -Æ© -ƪ -T,t,Å¢,Å£,Ť,Å¥ -ƾ -Ŧ,ŧ -Æ« -Ƭ,Æ­ -Æ® -U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,Å©,Ū,Å«,Ŭ,Å­,Å®,ů,Ű,ű,Ų,ų,Ư,ư,Ç“,Ç”,Ç•,Ç–,Ç—,ǘ,Ç™,Çš,Ç›,Çœ -Æœ -Ʊ -V,v -Ʋ -W,w,Å´,ŵ -X,x -Y,y,Ã,ý,ÿ,Ŷ,Å·,Ÿ -Ƴ,Æ´ -Z,z,Ź,ź,Å»,ż -Æ -Ž,ž -Ƶ,ƶ -Æ·,Ç®,ǯ -Ƹ,ƹ -ƺ -Þ,þ -Æ¿,Ç· -Æ» -Ƨ,ƨ -Ƽ,ƽ -Æ„,Æ… -ʼn -Ç€ -Ç -Ç‚ -ǃ -select group_concat(c1 order by c1) from t1 group by c1 collate utf8_danish_ci; -group_concat(c1 order by c1) -÷ -× -A,a,À,Ã,Â,Ã,à,á,â,ã,Ä€,Ä,Ä‚,ă,Ä„,Ä…,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç» -aA -Ç¢,Ç£,Ǽ,ǽ -B,b -Æ€ -Æ -Æ‚,ƃ -C,c,Ç,ç,Ć,ć,Ĉ,ĉ,ÄŠ,Ä‹,ÄŒ,Ä -CH,Ch,cH,ch -Ƈ,ƈ -D,d,ÄŽ,Ä -DZ,Dz,dZ,dz,Ç„,Ç…,dž,DZ,Dz,dz -Ä,Ä‘ -Ɖ -ÆŠ -Æ‹,ÆŒ -Ã,ð -E,e,È,É,Ê,Ë,è,é,ê,ë,Ä’,Ä“,Ä”,Ä•,Ä–,Ä—,Ę,Ä™,Äš,Ä› -ÆŽ,Ç -Æ -Æ -F,f -Æ‘,Æ’ -G,g,Äœ,Ä,Äž,ÄŸ,Ä ,Ä¡,Ä¢,Ä£,Ǧ,ǧ,Ç´,ǵ -Ǥ,Ç¥ -Æ“ -Æ” -Æ¢,Æ£ -H,h,Ĥ,Ä¥ -Æ•,Ƕ -Ħ,ħ -I,i,ÃŒ,Ã,ÃŽ,Ã,ì,í,î,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä­,Ä®,į,İ,Ç,Ç -IJ,Ij,iJ,ij,IJ,ij -ı -Æ— -Æ– -J,j,Ä´,ĵ,ǰ -K,k,Ķ,Ä·,Ǩ,Ç© -Ƙ,Æ™ -L,l,Ĺ,ĺ,Ä»,ļ,Ľ,ľ -Ä¿,Å€ -LJ,Lj,lJ,lj,LJ,Lj,lj -LL,Ll,lL,ll -Å,Å‚ -Æš -Æ› -M,m -N,n,Ñ,ñ,Ń,Å„,Å…,ņ,Ň,ň,Ǹ,ǹ -NJ,Nj,nJ,nj,ÇŠ,Ç‹,ÇŒ -Æ -Æž -ÅŠ,Å‹ -O,o,Ã’,Ó,Ô,Õ,ò,ó,ô,õ,ÅŒ,Å,ÅŽ,Å,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç­ -OE,Oe,oE,oe,Å’,Å“ -Ǿ,Ç¿ -Ɔ -ÆŸ -P,p -Ƥ,Æ¥ -Q,q -ĸ -R,r,Å”,Å•,Å–,Å—,Ř,Å™ -RR,Rr,rR,rr -Ʀ -S,s,Åš,Å›,Åœ,Å,Åž,ÅŸ,Å ,Å¡,Å¿ -SS,Ss,sS,ss,ß -Æ© -ƪ -T,t,Å¢,Å£,Ť,Å¥ -ƾ -Ŧ,ŧ -Æ« -Ƭ,Æ­ -Æ® -U,u,Ù,Ú,Û,ù,ú,û,Ũ,Å©,Ū,Å«,Ŭ,Å­,Å®,ů,Ų,ų,Ư,ư,Ç“,Ç”,Ç•,Ç–,Ç—,ǘ,Ç™,Çš,Ç›,Çœ -Æœ -Ʊ -V,v -Ʋ -W,w,Å´,ŵ -X,x -Y,y,Ü,Ã,ü,ý,ÿ,Ű,ű,Ŷ,Å·,Ÿ -Ƴ,Æ´ -Z,z,Ź,ź,Å»,ż,Ž,ž -Æ -Ä,Æ,ä,æ -Ö,Ø,ö,ø,Å,Å‘ -AA,Aa,aa,Ã…,Ã¥ -Ƶ,ƶ -Æ·,Ç®,ǯ -Ƹ,ƹ -ƺ -Þ,þ -Æ¿,Ç· -Æ» -Ƨ,ƨ -Ƽ,ƽ -Æ„,Æ… -ʼn -Ç€ -Ç -Ç‚ -ǃ -select group_concat(c1 order by c1) from t1 group by c1 collate utf8_lithuanian_ci; -group_concat(c1 order by c1) -÷ -× -A,a,À,Ã,Â,Ã,Ä,Ã…,à,á,â,ã,ä,Ã¥,Ä€,Ä,Ä‚,ă,Ä„,Ä…,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç» -AA,Aa,aA,aa -Æ,æ,Ç¢,Ç£,Ǽ,ǽ -B,b -Æ€ -Æ -Æ‚,ƃ -C,CH,Ch,c,ch,Ç,ç,Ć,ć,Ĉ,ĉ,ÄŠ,Ä‹ -cH -ÄŒ,Ä -Ƈ,ƈ -D,d,ÄŽ,Ä -DZ,Dz,dZ,dz,Ç„,Ç…,dž,DZ,Dz,dz -Ä,Ä‘ -Ɖ -ÆŠ -Æ‹,ÆŒ -Ã,ð -E,e,È,É,Ê,Ë,è,é,ê,ë,Ä’,Ä“,Ä”,Ä•,Ä–,Ä—,Ę,Ä™,Äš,Ä› -ÆŽ,Ç -Æ -Æ -F,f -Æ‘,Æ’ -G,g,Äœ,Ä,Äž,ÄŸ,Ä ,Ä¡,Ä¢,Ä£,Ǧ,ǧ,Ç´,ǵ -Ǥ,Ç¥ -Æ“ -Æ” -Æ¢,Æ£ -H,h,Ĥ,Ä¥ -Æ•,Ƕ -Ħ,ħ -I,Y,i,y,ÃŒ,Ã,ÃŽ,Ã,ì,í,î,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä­,Ä®,į,İ,Ç,Ç -IJ,Ij,iJ,ij,IJ,ij -ı -Æ— -Æ– -J,j,Ä´,ĵ,ǰ -K,k,Ķ,Ä·,Ǩ,Ç© -Ƙ,Æ™ -L,l,Ĺ,ĺ,Ä»,ļ,Ľ,ľ -Ä¿,Å€ -LJ,Lj,lJ,lj,LJ,Lj,lj -LL,Ll,lL,ll -Å,Å‚ -Æš -Æ› -M,m -N,n,Ñ,ñ,Ń,Å„,Å…,ņ,Ň,ň,Ǹ,ǹ -NJ,Nj,nJ,nj,ÇŠ,Ç‹,ÇŒ -Æ -Æž -ÅŠ,Å‹ -O,o,Ã’,Ó,Ô,Õ,Ö,ò,ó,ô,õ,ö,ÅŒ,Å,ÅŽ,Å,Å,Å‘,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç­ -OE,Oe,oE,oe,Å’,Å“ -Ø,ø,Ǿ,Ç¿ -Ɔ -ÆŸ -P,p -Ƥ,Æ¥ -Q,q -ĸ -R,r,Å”,Å•,Å–,Å—,Ř,Å™ -RR,Rr,rR,rr -Ʀ -S,s,Åš,Å›,Åœ,Å,Åž,ÅŸ,Å¿ -SS,Ss,sS,ss,ß -Å ,Å¡ -Æ© -ƪ -T,t,Å¢,Å£,Ť,Å¥ -ƾ -Ŧ,ŧ -Æ« -Ƭ,Æ­ -Æ® -U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,Å©,Ū,Å«,Ŭ,Å­,Å®,ů,Ű,ű,Ų,ų,Ư,ư,Ç“,Ç”,Ç•,Ç–,Ç—,ǘ,Ç™,Çš,Ç›,Çœ -Æœ -Ʊ -V,v -Ʋ -W,w,Å´,ŵ -X,x -Ã,ý,ÿ,Ŷ,Å·,Ÿ -Ƴ,Æ´ -Z,z,Ź,ź,Å»,ż -Æ -Ž,ž -Ƶ,ƶ -Æ·,Ç®,ǯ -Ƹ,ƹ -ƺ -Þ,þ -Æ¿,Ç· -Æ» -Ƨ,ƨ -Ƽ,ƽ -Æ„,Æ… -ʼn -Ç€ -Ç -Ç‚ -ǃ -select group_concat(c1 order by c1) from t1 group by c1 collate utf8_slovak_ci; -group_concat(c1 order by c1) -÷ -× -A,a,À,Ã,Â,Ã,Ã…,à,á,â,ã,Ã¥,Ä€,Ä,Ä‚,ă,Ä„,Ä…,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç» -AA,Aa,aA,aa -Ä,ä -Æ,æ,Ç¢,Ç£,Ǽ,ǽ -B,b -Æ€ -Æ -Æ‚,ƃ -C,c,Ç,ç,Ć,ć,Ĉ,ĉ,ÄŠ,Ä‹ -cH -ÄŒ,Ä -Ƈ,ƈ -D,d,ÄŽ,Ä -DZ,Dz,dZ,dz,Ç„,Ç…,dž,DZ,Dz,dz -Ä,Ä‘ -Ɖ -ÆŠ -Æ‹,ÆŒ -Ã,ð -E,e,È,É,Ê,Ë,è,é,ê,ë,Ä’,Ä“,Ä”,Ä•,Ä–,Ä—,Ę,Ä™,Äš,Ä› -ÆŽ,Ç -Æ -Æ -F,f -Æ‘,Æ’ -G,g,Äœ,Ä,Äž,ÄŸ,Ä ,Ä¡,Ä¢,Ä£,Ǧ,ǧ,Ç´,ǵ -Ǥ,Ç¥ -Æ“ -Æ” -Æ¢,Æ£ -H,h,Ĥ,Ä¥ -CH,Ch,ch -Æ•,Ƕ -Ħ,ħ -I,i,ÃŒ,Ã,ÃŽ,Ã,ì,í,î,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä­,Ä®,į,İ,Ç,Ç -IJ,Ij,iJ,ij,IJ,ij -ı -Æ— -Æ– -J,j,Ä´,ĵ,ǰ -K,k,Ķ,Ä·,Ǩ,Ç© -Ƙ,Æ™ -L,l,Ĺ,ĺ,Ä»,ļ,Ľ,ľ -Ä¿,Å€ -LJ,Lj,lJ,lj,LJ,Lj,lj -LL,Ll,lL,ll -Å,Å‚ -Æš -Æ› -M,m -N,n,Ñ,ñ,Ń,Å„,Å…,ņ,Ň,ň,Ǹ,ǹ -NJ,Nj,nJ,nj,ÇŠ,Ç‹,ÇŒ -Æ -Æž -ÅŠ,Å‹ -O,o,Ã’,Ó,Õ,Ö,ò,ó,õ,ö,ÅŒ,Å,ÅŽ,Å,Å,Å‘,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç­ -OE,Oe,oE,oe,Å’,Å“ -Ô,ô -Ø,ø,Ǿ,Ç¿ -Ɔ -ÆŸ -P,p -Ƥ,Æ¥ -Q,q -ĸ -R,r,Å”,Å•,Å–,Å—,Ř,Å™ -RR,Rr,rR,rr -Ʀ -S,s,Åš,Å›,Åœ,Å,Åž,ÅŸ,Å¿ -SS,Ss,sS,ss,ß -Å ,Å¡ -Æ© -ƪ -T,t,Å¢,Å£,Ť,Å¥ -ƾ -Ŧ,ŧ -Æ« -Ƭ,Æ­ -Æ® -U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,Å©,Ū,Å«,Ŭ,Å­,Å®,ů,Ű,ű,Ų,ų,Ư,ư,Ç“,Ç”,Ç•,Ç–,Ç—,ǘ,Ç™,Çš,Ç›,Çœ -Æœ -Ʊ -V,v -Ʋ -W,w,Å´,ŵ -X,x -Y,y,Ã,ý,ÿ,Ŷ,Å·,Ÿ -Ƴ,Æ´ -Z,z,Ź,ź,Å»,ż -Æ -Ž,ž -Ƶ,ƶ -Æ·,Ç®,ǯ -Ƹ,ƹ -ƺ -Þ,þ -Æ¿,Ç· -Æ» -Ƨ,ƨ -Ƽ,ƽ -Æ„,Æ… -ʼn -Ç€ -Ç -Ç‚ -ǃ -select group_concat(c1 order by c1) from t1 group by c1 collate utf8_spanish2_ci; -group_concat(c1 order by c1) -÷ -× -A,a,À,Ã,Â,Ã,Ä,Ã…,à,á,â,ã,ä,Ã¥,Ä€,Ä,Ä‚,ă,Ä„,Ä…,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç» -AA,Aa,aA,aa -Æ,æ,Ç¢,Ç£,Ǽ,ǽ -B,b -Æ€ -Æ -Æ‚,ƃ -C,c,Ç,ç,Ć,ć,Ĉ,ĉ,ÄŠ,Ä‹,ÄŒ,Ä -cH -CH,Ch,ch -Ƈ,ƈ -D,d,ÄŽ,Ä -DZ,Dz,dZ,dz,Ç„,Ç…,dž,DZ,Dz,dz -Ä,Ä‘ -Ɖ -ÆŠ -Æ‹,ÆŒ -Ã,ð -E,e,È,É,Ê,Ë,è,é,ê,ë,Ä’,Ä“,Ä”,Ä•,Ä–,Ä—,Ę,Ä™,Äš,Ä› -ÆŽ,Ç -Æ -Æ -F,f -Æ‘,Æ’ -G,g,Äœ,Ä,Äž,ÄŸ,Ä ,Ä¡,Ä¢,Ä£,Ǧ,ǧ,Ç´,ǵ -Ǥ,Ç¥ -Æ“ -Æ” -Æ¢,Æ£ -H,h,Ĥ,Ä¥ -Æ•,Ƕ -Ħ,ħ -I,i,ÃŒ,Ã,ÃŽ,Ã,ì,í,î,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä­,Ä®,į,İ,Ç,Ç -IJ,Ij,iJ,ij,IJ,ij -ı -Æ— -Æ– -J,j,Ä´,ĵ,ǰ -K,k,Ķ,Ä·,Ǩ,Ç© -Ƙ,Æ™ -L,l,Ĺ,ĺ,Ä»,ļ,Ľ,ľ -Ä¿,Å€ -LJ,Lj,lJ,lj,LJ,Lj,lj -lL -LL,Ll,ll -Å,Å‚ -Æš -Æ› -M,m -N,n,Ń,Å„,Å…,ņ,Ň,ň,Ǹ,ǹ -NJ,Nj,nJ,nj,ÇŠ,Ç‹,ÇŒ -Ñ,ñ -Æ -Æž -ÅŠ,Å‹ -O,o,Ã’,Ó,Ô,Õ,Ö,ò,ó,ô,õ,ö,ÅŒ,Å,ÅŽ,Å,Å,Å‘,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç­ -OE,Oe,oE,oe,Å’,Å“ -Ø,ø,Ǿ,Ç¿ -Ɔ -ÆŸ -P,p -Ƥ,Æ¥ -Q,q -ĸ -R,RR,Rr,r,rr,Å”,Å•,Å–,Å—,Ř,Å™ -rR -Ʀ -S,s,Åš,Å›,Åœ,Å,Åž,ÅŸ,Å ,Å¡,Å¿ -SS,Ss,sS,ss,ß -Æ© -ƪ -T,t,Å¢,Å£,Ť,Å¥ -ƾ -Ŧ,ŧ -Æ« -Ƭ,Æ­ -Æ® -U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,Å©,Ū,Å«,Ŭ,Å­,Å®,ů,Ű,ű,Ų,ų,Ư,ư,Ç“,Ç”,Ç•,Ç–,Ç—,ǘ,Ç™,Çš,Ç›,Çœ -Æœ -Ʊ -V,v -Ʋ -W,w,Å´,ŵ -X,x -Y,y,Ã,ý,ÿ,Ŷ,Å·,Ÿ -Ƴ,Æ´ -Z,z,Ź,ź,Å»,ż,Ž,ž -Æ -Ƶ,ƶ -Æ·,Ç®,ǯ -Ƹ,ƹ -ƺ -Þ,þ -Æ¿,Ç· -Æ» -Ƨ,ƨ -Ƽ,ƽ -Æ„,Æ… -ʼn -Ç€ -Ç -Ç‚ -ǃ -select group_concat(c1 order by c1) from t1 group by c1 collate utf8_roman_ci; -group_concat(c1 order by c1) -÷ -× -A,a,À,Ã,Â,Ã,Ä,Ã…,à,á,â,ã,ä,Ã¥,Ä€,Ä,Ä‚,ă,Ä„,Ä…,Ç,ÇŽ,Çž,ÇŸ,Ç ,Ç¡,Ǻ,Ç» -AA,Aa,aA,aa -Æ,æ,Ç¢,Ç£,Ǽ,ǽ -B,b -Æ€ -Æ -Æ‚,ƃ -C,c,Ç,ç,Ć,ć,Ĉ,ĉ,ÄŠ,Ä‹,ÄŒ,Ä -CH,Ch,cH,ch -Ƈ,ƈ -D,d,ÄŽ,Ä -DZ,Dz,dZ,dz,Ç„,Ç…,dž,DZ,Dz,dz -Ä,Ä‘ -Ɖ -ÆŠ -Æ‹,ÆŒ -Ã,ð -E,e,È,É,Ê,Ë,è,é,ê,ë,Ä’,Ä“,Ä”,Ä•,Ä–,Ä—,Ę,Ä™,Äš,Ä› -ÆŽ,Ç -Æ -Æ -F,f -Æ‘,Æ’ -G,g,Äœ,Ä,Äž,ÄŸ,Ä ,Ä¡,Ä¢,Ä£,Ǧ,ǧ,Ç´,ǵ -Ǥ,Ç¥ -Æ“ -Æ” -Æ¢,Æ£ -H,h,Ĥ,Ä¥ -Æ•,Ƕ -Ħ,ħ -I,J,i,j,ÃŒ,Ã,ÃŽ,Ã,ì,í,î,ï,Ĩ,Ä©,Ī,Ä«,Ĭ,Ä­,Ä®,į,İ,Ç,Ç -IJ,Ij,iJ,ij -IJ,ij -ı -Æ— -Æ– -Ä´,ĵ,ǰ -K,k,Ķ,Ä·,Ǩ,Ç© -Ƙ,Æ™ -L,l,Ĺ,ĺ,Ä»,ļ,Ľ,ľ -Ä¿,Å€ -LJ,Lj,lJ,lj -LJ,Lj,lj -LL,Ll,lL,ll -Å,Å‚ -Æš -Æ› -M,m -N,n,Ñ,ñ,Ń,Å„,Å…,ņ,Ň,ň,Ǹ,ǹ -NJ,Nj,nJ,nj -ÇŠ,Ç‹,ÇŒ -Æ -Æž -ÅŠ,Å‹ -O,o,Ã’,Ó,Ô,Õ,Ö,ò,ó,ô,õ,ö,ÅŒ,Å,ÅŽ,Å,Å,Å‘,Æ ,Æ¡,Ç‘,Ç’,Ǫ,Ç«,Ǭ,Ç­ -OE,Oe,oE,oe,Å’,Å“ -Ø,ø,Ǿ,Ç¿ -Ɔ -ÆŸ -P,p -Ƥ,Æ¥ -Q,q -ĸ -R,r,Å”,Å•,Å–,Å—,Ř,Å™ -RR,Rr,rR,rr -Ʀ -S,s,Åš,Å›,Åœ,Å,Åž,ÅŸ,Å ,Å¡,Å¿ -SS,Ss,sS,ss,ß -Æ© -ƪ -T,t,Å¢,Å£,Ť,Å¥ -ƾ -Ŧ,ŧ -Æ« -Ƭ,Æ­ -Æ® -Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,Å©,Ū,Å«,Ŭ,Å­,Å®,ů,Ű,ű,Ų,ų,Ư,ư,Ç“,Ç”,Ç•,Ç–,Ç—,ǘ,Ç™,Çš,Ç›,Çœ -Æœ -Ʊ -U,V,u,v -Ʋ -W,w,Å´,ŵ -X,x -Y,y,Ã,ý,ÿ,Ŷ,Å·,Ÿ -Ƴ,Æ´ -Z,z,Ź,ź,Å»,ż,Ž,ž -Æ -Ƶ,ƶ -Æ·,Ç®,ǯ -Ƹ,ƹ -ƺ -Þ,þ -Æ¿,Ç· -Æ» -Ƨ,ƨ -Ƽ,ƽ -Æ„,Æ… -ʼn -Ç€ -Ç -Ç‚ -ǃ -drop table t1; -SET NAMES utf8; -CREATE TABLE t1 (c varchar(255) NOT NULL COLLATE utf8_general_ci, INDEX (c)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x039C03C903B403B11F770308 USING utf8)); -SELECT * FROM t1 WHERE c LIKE CONVERT(_ucs2 0x039C0025 USING utf8) -COLLATE utf8_general_ci; -c -Μωδαί̈ -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x039C03C903B4 USING utf8)); -SELECT * FROM t1 WHERE c LIKE CONVERT(_ucs2 0x039C0025 USING utf8) -COLLATE utf8_general_ci ORDER BY c; -c -Μωδ -Μωδαί̈ -DROP TABLE t1; -CREATE TABLE t1 (c varchar(255) NOT NULL COLLATE ucs2_unicode_ci, INDEX (c)); -INSERT INTO t1 VALUES (_ucs2 0x039C03C903B403B11F770308); -SELECT * FROM t1 WHERE c LIKE _ucs2 0x039C0025 COLLATE ucs2_unicode_ci; -c -Μωδαί̈ -INSERT INTO t1 VALUES (_ucs2 0x039C03C903B4); -SELECT * FROM t1 WHERE c LIKE _ucs2 0x039C0025 -COLLATE ucs2_unicode_ci ORDER BY c; -c -Μωδ -Μωδαί̈ -DROP TABLE t1; -CREATE TABLE t1 (c varchar(255) NOT NULL COLLATE utf8_unicode_ci, INDEX (c)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x039C03C903B403B11F770308 USING utf8)); -SELECT * FROM t1 WHERE c LIKE CONVERT(_ucs2 0x039C0025 USING utf8) COLLATE utf8_unicode_ci; -c -Μωδαί̈ -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x039C03C903B4 USING utf8)); -SELECT * FROM t1 WHERE c LIKE CONVERT(_ucs2 0x039C0025 USING utf8) -COLLATE utf8_unicode_ci ORDER BY c; -c -Μωδ -Μωδαί̈ -DROP TABLE t1; -CREATE TABLE t1 ( -col1 CHAR(32) CHARACTER SET utf8 NOT NULL -); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0041004100410627 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0041004100410628 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0041004100410647 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0041004100410648 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0633064A0651062F USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062D06330646 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A0642064A USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06320627062F0647 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062806310627064A USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064706450647 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F062706460634062C0648064A06270646064A USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06A90647 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A06270631064A062E USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062706460642064406270628 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627064A0631062706460650 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627062F064806270631062F USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06280631062706480646200C06310627 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062E064806270646062F0647 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0648 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A062D062A USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A0623062B064A0631 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06220646 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0642063106270631 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06AF06310641062A0647 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06270646062F USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0634062E0635064A0651062A064A USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0628062706310632 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06270633062A USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x063906A90633 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06270648060C USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F0631 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062D062F0648062F USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0628064A0633062A USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0648067E0646062C USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06330627064406AF064A060C USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x063306270644 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064606450627064A0646062F0647 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A06280631064A0632 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0645062C06440633 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06280648062F060C USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0628064A0646 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06350641062D0627062A USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627064A0646 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06A9062A06270628 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06280647 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x068606340645 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0645064A USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062E06480631062F USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0686064706310647 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627064A USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06420648064A USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06450635064506510645 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06310627 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0646063406270646 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0645064A200C062F0647062F060C USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0647063106860646062F USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06390645064400BB USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06A9064806340634 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0628 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064706500646064A064606AF USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627062D063306270646 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064A062706310634062706370631 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06450646062A06340631 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0634062F0647 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F0633062A USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A064806270646 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0647064506270646 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627064806510644 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A0634062E064A0635 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F0627062F USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06280627 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A064106270648062A USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062D06270644062A USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A064106A906510631 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x063A064406280647 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F06270631062F USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064A06A9064A USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06270632 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x063106470628063106270646 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064606470636062A USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064506340631064806370647 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627064A063106270646 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0646064A0632 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064A06A9 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0645062D064206510642 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0637063106270632 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064106310647064606AF USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A0645062F06510646 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627064A063106270646064A USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06280648062F USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06A90627063106470627064A USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06270648 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0639063106350647 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627064506480631 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0633064A06270633064A USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627064A063106270646060C USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062D064806320647 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x063906440645 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F062706460634 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06450642062706440627062A USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F064A06AF0631 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0648064A06980647 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0646062706450647 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064506480631062F USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0628062D062B USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0628063106310633064A USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064606480634062A0647 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06450646 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A064606470627 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0622064606860647 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F064806310647 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627064206270645062A USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x067E0631062F062706320645 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0698062706460648064A0647 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0648064A USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F06390648062A0650 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x063306500631 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F0646064A0633064F0646 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x063106270633 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0647064A0626062A USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0639064406480645200C063406310642064A USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06280639062F0627064B USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0645062F063106330647 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062206410631064A06420627064A064A USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F06270646063406AF06270647 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06440646062F0646 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x067E064A06480633062A USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0647064606AF06270645064A USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x067E0633 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0622063A06270632 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062C064606AF USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062C064706270646 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F064806510645 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x063406470631 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06A9064506280631064A062C USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06450646062A06420644 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06A90631062F0646062F USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06470645 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06310641062A USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06220646062C0627 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064506270646062F USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A0627 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062706A9062A06280631 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064606380631 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F06480644062A USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F06480628062706310647 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064606330628062A USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0645063306270639062F USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0634062F USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06480632064A0631 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0645062E062A06270631 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06330641064A0631 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627064606AF0644064A0633 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A0642064A200C06320627062F0647 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06280627063206AF0634062A USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0647064506330631 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06220644064506270646064A USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06270634 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06220645062F0647 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06A906270631064A USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x067E0631062F0627062E062A0647 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x063906440645064A USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x0627062F0628064A USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062D062F0651 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064606280648062F060C USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06480644064A USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x063906480636060C USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06340627064A062F USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064506470645 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062A0631 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06220646060C USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06470645063306310634 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06A90627064606480646 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062E0627064606480627062F06AF064A USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06AF06310645064A USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06280648062C0648062F USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062206480631062F USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F0648 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06A90627064506440627064B USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x064A06A9062F064A06AF0631 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06AF USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x062F064406280633062A0647 USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06280648062F0646062F USING utf8)); -INSERT INTO t1 VALUES (CONVERT(_ucs2 0x06450647064506270646 USING utf8)); -SELECT HEX(CONVERT(col1 USING ucs2)) FROM t1 ORDER BY col1 COLLATE utf8_persian_ci, col1 COLLATE utf8_bin; -HEX(CONVERT(col1 USING ucs2)) -0041004100410627 -0041004100410628 -0041004100410648 -0041004100410647 -0622063A06270632 -062206410631064A06420627064A064A -06220644064506270646064A -06220645062F0647 -06220646 -06220646060C -06220646062C0627 -0622064606860647 -062206480631062F -0627062D063306270646 -0627062F0628064A -0627062F064806270631062F -06270632 -06270633062A -06270634 -0627064206270645062A -062706A9062A06280631 -0627064506480631 -06270646062F -062706460642064406270628 -0627064606AF0644064A0633 -06270648 -06270648060C -0627064806510644 -0627064A -0627064A063106270646 -0627064A063106270646060C -0627064A0631062706460650 -0627064A063106270646064A -0627064A0646 -0628 -06280627 -0628062706310632 -06280627063206AF0634062A -0628062D062B -06280631062706480646200C06310627 -062806310627064A -0628063106310633064A -06280639062F0627064B -06280648062C0648062F -06280648062F -06280648062F060C -06280648062F0646062F -06280647 -0628064A0633062A -0628064A0646 -067E0631062F0627062E062A0647 -067E0631062F062706320645 -067E0633 -067E064A06480633062A -062A0627 -062A06270631064A062E -062A0623062B064A0631 -062A06280631064A0632 -062A062D062A -062A0631 -062A0634062E064A0635 -062A064106270648062A -062A064106A906510631 -062A0642064A -062A0642064A200C06320627062F0647 -062A0645062F06510646 -062A064606470627 -062A064806270646 -062C064606AF -062C064706270646 -068606340645 -0686064706310647 -062D06270644062A -062D062F0651 -062D062F0648062F -062D06330646 -062D064806320647 -062E0627064606480627062F06AF064A -062E064806270646062F0647 -062E06480631062F -062F0627062F -062F06270631062F -062F062706460634 -062F062706460634062C0648064A06270646064A -062F06270646063406AF06270647 -062F0631 -062F0633062A -062F06390648062A0650 -062F064406280633062A0647 -062F0646064A0633064F0646 -062F0648 -062F06480628062706310647 -062F064806310647 -062F06480644062A -062F064806510645 -062F064A06AF0631 -06310627 -063106270633 -06310641062A -063106470628063106270646 -06320627062F0647 -0698062706460648064A0647 -063306500631 -063306270644 -06330627064406AF064A060C -06330641064A0631 -0633064A06270633064A -0633064A0651062F -06340627064A062F -0634062E0635064A0651062A064A -0634062F -0634062F0647 -063406470631 -06350641062D0627062A -0637063106270632 -0639063106350647 -063906A90633 -063906440645 -063906440645064A -0639064406480645200C063406310642064A -06390645064400BB -063906480636060C -063A064406280647 -064106310647064606AF -0642063106270631 -06420648064A -06A90627063106470627064A -06A906270631064A -06A90627064506440627064B -06A90627064606480646 -06A9062A06270628 -06A90631062F0646062F -06A9064506280631064A062C -06A9064806340634 -06A90647 -06AF -06AF06310641062A0647 -06AF06310645064A -06440646062F0646 -064506270646062F -0645062C06440633 -0645062D064206510642 -0645062E062A06270631 -0645062F063106330647 -0645063306270639062F -064506340631064806370647 -06450635064506510645 -06450642062706440627062A -06450646 -06450646062A06340631 -06450646062A06420644 -064506480631062F -064506470645 -06450647064506270646 -0645064A -0645064A200C062F0647062F060C -0646062706450647 -064606280648062F060C -064606330628062A -0646063406270646 -064606380631 -064606450627064A0646062F0647 -064606480634062A0647 -064606470636062A -0646064A0632 -0648 -0648067E0646062C -06480632064A0631 -06480644064A -0648064A -0648064A06980647 -064706500646064A064606AF -0647063106860646062F -06470645 -0647064506270646 -0647064506330631 -06470645063306310634 -064706450647 -0647064606AF06270645064A -0647064A0626062A -064A062706310634062706370631 -064A06A9 -064A06A9062F064A06AF0631 -064A06A9064A -DROP TABLE t1; -SET @test_character_set= 'utf8'; -SET @test_collation= 'utf8_swedish_ci'; -SET @safe_character_set_server= @@character_set_server; -SET @safe_collation_server= @@collation_server; -SET character_set_server= @test_character_set; -SET collation_server= @test_collation; -CREATE DATABASE d1; -USE d1; -CREATE TABLE t1 (c CHAR(10), KEY(c)); -SHOW FULL COLUMNS FROM t1; -Field Type Collation Null Key Default Extra Privileges Comment -c char(10) utf8_swedish_ci YES MUL NULL -INSERT INTO t1 VALUES ('aaa'),('aaaa'),('aaaaa'); -SELECT c as want3results FROM t1 WHERE c LIKE 'aaa%'; -want3results -aaa -aaaa -aaaaa -DROP TABLE t1; -CREATE TABLE t1 (c1 varchar(15), KEY c1 (c1(2))); -SHOW FULL COLUMNS FROM t1; -Field Type Collation Null Key Default Extra Privileges Comment -c1 varchar(15) utf8_swedish_ci YES MUL NULL -INSERT INTO t1 VALUES ('location'),('loberge'),('lotre'),('boabab'); -SELECT c1 as want3results from t1 where c1 like 'l%'; -want3results -location -loberge -lotre -SELECT c1 as want3results from t1 where c1 like 'lo%'; -want3results -location -loberge -lotre -SELECT c1 as want1result from t1 where c1 like 'loc%'; -want1result -location -SELECT c1 as want1result from t1 where c1 like 'loca%'; -want1result -location -SELECT c1 as want1result from t1 where c1 like 'locat%'; -want1result -location -SELECT c1 as want1result from t1 where c1 like 'locati%'; -want1result -location -SELECT c1 as want1result from t1 where c1 like 'locatio%'; -want1result -location -SELECT c1 as want1result from t1 where c1 like 'location%'; -want1result -location -DROP TABLE t1; -DROP DATABASE d1; -USE test; -SET character_set_server= @safe_character_set_server; -SET collation_server= @safe_collation_server; From 0be6eab66564d600e2feb162a8f96835b8c154d3 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 10 Dec 2004 17:05:40 +0200 Subject: [PATCH 0471/1063] dict0dict.c: In the FOREIGN KEY parser, do not cut 0xC2A0 from the end of an identifier if it was quoted innobase/dict/dict0dict.c: In the FOREIGN KEY parser, do not cut 0xC2A0 from the end of an identifier if it was quoted --- innobase/dict/dict0dict.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/innobase/dict/dict0dict.c b/innobase/dict/dict0dict.c index ecc533ed26f..2e6504cac11 100644 --- a/innobase/dict/dict0dict.c +++ b/innobase/dict/dict0dict.c @@ -2427,7 +2427,7 @@ dict_scan_id( *id = s; } - if (heap) { + if (heap && !quote) { /* EMS MySQL Manager sometimes adds characters 0xA0 (in latin1, a 'non-breakable space') to the end of a table name. But isspace(0xA0) is not true, which confuses our foreign key From c486461e4430ced16300cc86c007a8d1d980af93 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 10 Dec 2004 17:12:47 +0200 Subject: [PATCH 0472/1063] dict0dict.h, dict0dict.c, ha_innodb.cc: Fix for the 0xA0 character problem in the InnoDB FOREIGN KEY parser: if my_isspace() treats 0xA0 as space, then let InnoDB do the same; this might break some multi-byte charset id's, though for big5, ujis, sjis this seems not to change the current behavior (I checked the tables in /share/charsets); this fix must NOT be merged to 4.1 because in 4.1 everything is in UTF-8 sql/ha_innodb.cc: Fix for the 0xA0 character problem in the InnoDB FOREIGN KEY parser: if my_isspace() treats 0xA0 as space, then let InnoDB do the same; this might break some multi-byte charset id's, though for big5, ujis, sjis this seems not to change the current behavior (I checked the tables in /share/charsets); this fix must NOT be merged to 4.1 because in 4.1 everything is in UTF-8 innobase/dict/dict0dict.c: Fix for the 0xA0 character problem in the InnoDB FOREIGN KEY parser: if my_isspace() treats 0xA0 as space, then let InnoDB do the same; this might break some multi-byte charset id's, though for big5, ujis, sjis this seems not to change the current behavior (I checked the tables in /share/charsets); this fix must NOT be merged to 4.1 because in 4.1 everything is in UTF-8 innobase/include/dict0dict.h: Fix for the 0xA0 character problem in the InnoDB FOREIGN KEY parser: if my_isspace() treats 0xA0 as space, then let InnoDB do the same; this might break some multi-byte charset id's, though for big5, ujis, sjis this seems not to change the current behavior (I checked the tables in /share/charsets); this fix must NOT be merged to 4.1 because in 4.1 everything is in UTF-8 --- innobase/dict/dict0dict.c | 41 ++++++++++++++++++++++++++++-------- innobase/include/dict0dict.h | 2 ++ sql/ha_innodb.cc | 5 +++++ 3 files changed, 39 insertions(+), 9 deletions(-) diff --git a/innobase/dict/dict0dict.c b/innobase/dict/dict0dict.c index aa5bab210ef..b4be9108659 100644 --- a/innobase/dict/dict0dict.c +++ b/innobase/dict/dict0dict.c @@ -27,6 +27,8 @@ Created 1/8/1996 Heikki Tuuri #include "que0que.h" #include "rem0cmp.h" +ibool dict_char_0xA0_is_space = FALSE; /* A special fix for 4.0 */ + dict_sys_t* dict_sys = NULL; /* the dictionary system */ rw_lock_t dict_operation_lock; /* table create, drop, etc. reserve @@ -172,7 +174,28 @@ and unique key errors */ FILE* dict_foreign_err_file = NULL; mutex_t dict_foreign_err_mutex; /* mutex protecting the foreign and unique error buffers */ - +/************************************************************************ +Checks if a byte is considered space in the current charset of MySQL. +TODO: find out if this works correctly in multibyte charsets. */ +static +ibool +dict_isspace( +/*=========*/ + /* out: TRUE if considered space */ + char c) /* in: one-byte character */ +{ + if (isspace(c)) { + + return(TRUE); + } + + if (dict_char_0xA0_is_space && (byte)c == (byte)0xA0) { + + return(TRUE); + } + + return(FALSE); +} /************************************************************************ Checks if the database name in two table names is the same. */ @@ -2198,7 +2221,7 @@ dict_accept( *success = FALSE; - while (isspace(*ptr)) { + while (dict_isspace(*ptr)) { ptr++; } @@ -2241,7 +2264,7 @@ dict_scan_id( *id = NULL; - while (isspace(*ptr)) { + while (dict_isspace(*ptr)) { ptr++; } @@ -2272,7 +2295,7 @@ dict_scan_id( len++; } } else { - while (!isspace(*ptr) && *ptr != '(' && *ptr != ')' + while (!dict_isspace(*ptr) && *ptr != '(' && *ptr != ')' && (accept_also_dot || *ptr != '.') && *ptr != ',' && *ptr != '\0') { @@ -2765,11 +2788,11 @@ loop: ut_a(success); - if (!isspace(*ptr) && *ptr != '"' && *ptr != '`') { + if (!dict_isspace(*ptr) && *ptr != '"' && *ptr != '`') { goto loop; } - while (isspace(*ptr)) { + while (dict_isspace(*ptr)) { ptr++; } @@ -2795,7 +2818,7 @@ loop: ptr = dict_accept(ptr, "FOREIGN", &success); - if (!isspace(*ptr)) { + if (!dict_isspace(*ptr)) { goto loop; } @@ -2883,7 +2906,7 @@ col_loop1: } ptr = dict_accept(ptr, "REFERENCES", &success); - if (!success || !isspace(*ptr)) { + if (!success || !dict_isspace(*ptr)) { dict_foreign_report_syntax_err(name, start_of_latest_foreign, ptr); return(DB_CANNOT_ADD_CONSTRAINT); @@ -3261,7 +3284,7 @@ loop: ptr = dict_accept(ptr, "DROP", &success); - if (!isspace(*ptr)) { + if (!dict_isspace(*ptr)) { goto loop; } diff --git a/innobase/include/dict0dict.h b/innobase/include/dict0dict.h index 9940be9832d..8b31e6f84a5 100644 --- a/innobase/include/dict0dict.h +++ b/innobase/include/dict0dict.h @@ -26,6 +26,8 @@ Created 1/8/1996 Heikki Tuuri #include "ut0byte.h" #include "trx0types.h" +extern ibool dict_char_0xA0_is_space; + /************************************************************************ Get the database name length in a table name. */ diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index 91f92c8cadb..c36075207ed 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -64,6 +64,7 @@ extern "C" { #include "../innobase/include/log0log.h" #include "../innobase/include/lock0lock.h" #include "../innobase/include/dict0crea.h" +#include "../innobase/include/dict0dict.h" #include "../innobase/include/btr0cur.h" #include "../innobase/include/btr0btr.h" #include "../innobase/include/fsp0fsp.h" @@ -917,6 +918,10 @@ innobase_init(void) srv_print_verbose_log = mysql_embedded ? 0 : 1; + if (my_isspace(default_charset_info, (char)0xA0)) { + dict_char_0xA0_is_space = TRUE; + } + if (strcmp(default_charset_info->name, "latin1") == 0) { /* Store the character ordering table to InnoDB. From 070777797c50e2b99ed5a3a55d4c14fd8f9ec9dc Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 10 Dec 2004 18:03:43 +0200 Subject: [PATCH 0473/1063] dict0dict.c, log.cc: Remove accidentally merged 4.0 changes dict0dict.c: Remove the 4.0 fix accidentally auto-merged to 4.1 row0mysql.h, dict0dict.h: Remove a change auto-merged from 4.0 innobase/include/dict0dict.h: Remove a change auto-merged from 4.0 innobase/include/row0mysql.h: Remove a change auto-merged from 4.0 sql/log.cc: Remove accidentally merged 4.0 changes innobase/dict/dict0dict.c: Remove accidentally merged 4.0 changes --- innobase/dict/dict0dict.c | 41 ++++++++---------------------------- innobase/include/dict0dict.h | 2 -- innobase/include/row0mysql.h | 10 +++++++++ sql/log.cc | 18 +++++++--------- 4 files changed, 27 insertions(+), 44 deletions(-) diff --git a/innobase/dict/dict0dict.c b/innobase/dict/dict0dict.c index e3aac1f70ad..2e6504cac11 100644 --- a/innobase/dict/dict0dict.c +++ b/innobase/dict/dict0dict.c @@ -27,8 +27,6 @@ Created 1/8/1996 Heikki Tuuri #include "que0que.h" #include "rem0cmp.h" -ibool dict_char_0xA0_is_space = FALSE; /* A special fix for 4.0 */ - dict_sys_t* dict_sys = NULL; /* the dictionary system */ rw_lock_t dict_operation_lock; /* table create, drop, etc. reserve @@ -198,28 +196,7 @@ and unique key errors */ FILE* dict_foreign_err_file = NULL; mutex_t dict_foreign_err_mutex; /* mutex protecting the foreign and unique error buffers */ -/************************************************************************ -Checks if a byte is considered space in the current charset of MySQL. -TODO: find out if this works correctly in multibyte charsets. */ -static -ibool -dict_isspace( -/*=========*/ - /* out: TRUE if considered space */ - char c) /* in: one-byte character */ -{ - if (isspace(c)) { - - return(TRUE); - } - - if (dict_char_0xA0_is_space && (byte)c == (byte)0xA0) { - - return(TRUE); - } - - return(FALSE); -} + /************************************************************************ Checks if the database name in two table names is the same. */ @@ -2347,7 +2324,7 @@ dict_accept( *success = FALSE; - while (dict_isspace(*ptr)) { + while (isspace(*ptr)) { ptr++; } @@ -2392,7 +2369,7 @@ dict_scan_id( *id = NULL; - while (dict_isspace(*ptr)) { + while (isspace(*ptr)) { ptr++; } @@ -2423,7 +2400,7 @@ dict_scan_id( len++; } } else { - while (!dict_isspace(*ptr) && *ptr != '(' && *ptr != ')' + while (!isspace(*ptr) && *ptr != '(' && *ptr != ')' && (accept_also_dot || *ptr != '.') && *ptr != ',' && *ptr != '\0') { @@ -2927,11 +2904,11 @@ loop: ut_a(success); - if (!dict_isspace(*ptr) && *ptr != '"' && *ptr != '`') { + if (!isspace(*ptr) && *ptr != '"' && *ptr != '`') { goto loop; } - while (dict_isspace(*ptr)) { + while (isspace(*ptr)) { ptr++; } @@ -2957,7 +2934,7 @@ loop: ptr = dict_accept(ptr, "FOREIGN", &success); - if (!dict_isspace(*ptr)) { + if (!isspace(*ptr)) { goto loop; } @@ -3045,7 +3022,7 @@ col_loop1: } ptr = dict_accept(ptr, "REFERENCES", &success); - if (!success || !dict_isspace(*ptr)) { + if (!success || !isspace(*ptr)) { dict_foreign_report_syntax_err(name, start_of_latest_foreign, ptr); return(DB_CANNOT_ADD_CONSTRAINT); @@ -3426,7 +3403,7 @@ loop: ptr = dict_accept(ptr, "DROP", &success); - if (!dict_isspace(*ptr)) { + if (!isspace(*ptr)) { goto loop; } diff --git a/innobase/include/dict0dict.h b/innobase/include/dict0dict.h index b29905c8b96..ca632691450 100644 --- a/innobase/include/dict0dict.h +++ b/innobase/include/dict0dict.h @@ -26,8 +26,6 @@ Created 1/8/1996 Heikki Tuuri #include "ut0byte.h" #include "trx0types.h" -extern ibool dict_char_0xA0_is_space; - /************************************************************************ Get the database name length in a table name. */ diff --git a/innobase/include/row0mysql.h b/innobase/include/row0mysql.h index f47ce74ce37..78f4c754c7f 100644 --- a/innobase/include/row0mysql.h +++ b/innobase/include/row0mysql.h @@ -291,6 +291,16 @@ row_mysql_unfreeze_data_dictionary( /*===============================*/ trx_t* trx); /* in: transaction */ /************************************************************************* +Checks if a table name contains the string "/#sql" which denotes temporary +tables in MySQL. */ + +ibool +row_is_mysql_tmp_table_name( +/*========================*/ + /* out: TRUE if temporary table */ + const char* name); /* in: table name in the form + 'database/tablename' */ +/************************************************************************* Does a table creation operation for MySQL. If the name of the created table ends to characters INNODB_MONITOR, then this also starts printing of monitor output by the master thread. */ diff --git a/sql/log.cc b/sql/log.cc index e4556d71fb3..3a420866025 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -2036,7 +2036,6 @@ bool flush_error_log() char err_renamed[FN_REFLEN], *end; end= strmake(err_renamed,log_error_file,FN_REFLEN-4); strmov(end, "-old"); - VOID(pthread_mutex_lock(&LOCK_error_log)); #ifdef __WIN__ char err_temp[FN_REFLEN+4]; /* @@ -2044,7 +2043,7 @@ bool flush_error_log() the current error file. */ strmov(strmov(err_temp, err_renamed),"-tmp"); - (void) my_delete(err_temp, MYF(0)); + (void) my_delete(err_temp, MYF(0)); if (freopen(err_temp,"a+",stdout)) { freopen(err_temp,"a+",stderr); @@ -2057,21 +2056,20 @@ bool flush_error_log() if ((fd = my_open(err_temp, O_RDONLY, MYF(0))) >= 0) { while ((bytes = (int) my_read(fd, (byte*) buf, IO_SIZE, MYF(0))) > 0) - my_fwrite(stderr, (byte*) buf, bytes, MYF(0)); + my_fwrite(stderr, (byte*) buf, (uint) strlen(buf),MYF(0)); my_close(fd, MYF(0)); } - (void) my_delete(err_temp, MYF(0)); + (void) my_delete(err_temp, MYF(0)); } else result= 1; #else - my_rename(log_error_file,err_renamed,MYF(0)); - if (freopen(log_error_file,"a+",stdout)) - freopen(log_error_file,"a+",stderr); - else - result= 1; + my_rename(log_error_file,err_renamed,MYF(0)); + if (freopen(log_error_file,"a+",stdout)) + freopen(log_error_file,"a+",stderr); + else + result= 1; #endif - VOID(pthread_mutex_unlock(&LOCK_error_log)); } return result; } From 111fa31f616a87435a844b9a0d5ad16ec4da8382 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 10 Dec 2004 20:07:00 +0400 Subject: [PATCH 0474/1063] A fix (bug #7129: Test failure: 'type_ranges' when using '--ps-protocol' bug #7126: Test failure: 'func_str' when using '--ps-protocol' bug #7130: Test failure: 'type_uint' when using '--ps-protocol'). --- libmysql/libmysql.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index 99fa0299de9..8989dc18fd7 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -3663,8 +3663,8 @@ static void fetch_result_with_conversion(MYSQL_BIND *param, MYSQL_FIELD *field, case MYSQL_TYPE_INT24: /* mediumint is sent as 4 bytes int */ case MYSQL_TYPE_LONG: { - long value= sint4korr(*row); - longlong data= field_is_unsigned ? (longlong) (unsigned long) value : + int32 value= sint4korr(*row); + longlong data= field_is_unsigned ? (longlong) (uint32) value : (longlong) value; fetch_long_with_conversion(param, field, data); *row+= 4; From dec3467588e9525f598bc608a6757c7647d78905 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 10 Dec 2004 18:09:07 +0200 Subject: [PATCH 0475/1063] row0mysql.h: Remove accidentally pushed unnecessary change innobase/include/row0mysql.h: Remove accidentally pushed unnecessary change --- innobase/include/row0mysql.h | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/innobase/include/row0mysql.h b/innobase/include/row0mysql.h index 78f4c754c7f..f47ce74ce37 100644 --- a/innobase/include/row0mysql.h +++ b/innobase/include/row0mysql.h @@ -291,16 +291,6 @@ row_mysql_unfreeze_data_dictionary( /*===============================*/ trx_t* trx); /* in: transaction */ /************************************************************************* -Checks if a table name contains the string "/#sql" which denotes temporary -tables in MySQL. */ - -ibool -row_is_mysql_tmp_table_name( -/*========================*/ - /* out: TRUE if temporary table */ - const char* name); /* in: table name in the form - 'database/tablename' */ -/************************************************************************* Does a table creation operation for MySQL. If the name of the created table ends to characters INNODB_MONITOR, then this also starts printing of monitor output by the master thread. */ From 90ce7aea5feb3ff64ae898350cd62dc3c3ed3345 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 10 Dec 2004 23:50:09 +0100 Subject: [PATCH 0476/1063] Fix results file for insert_select test with embedded server. (Bug #7167) mysql-test/r/insert_select.result.es: add output to embedded server results --- mysql-test/r/insert_select.result.es | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/mysql-test/r/insert_select.result.es b/mysql-test/r/insert_select.result.es index 3955c0534f2..9e11402733d 100644 --- a/mysql-test/r/insert_select.result.es +++ b/mysql-test/r/insert_select.result.es @@ -78,6 +78,13 @@ a 1 2 drop table t1, t2; +create table t1(a int); +insert into t1 values(1),(1); +reset master; +create table t2(unique(a)) select a from t1; +ERROR 23000: Duplicate entry '1' for key 1 +show binlog events; +drop table t1; create table t1 (a int not null); create table t2 (a int not null); insert into t1 values (1); From 35aaf2222d2ecc374beccb1e1b564d8ad3906d47 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 11 Dec 2004 09:39:29 +0100 Subject: [PATCH 0477/1063] getting rid of now() is tests --- mysql-test/r/func_str.result | 2 +- mysql-test/t/func_str.test | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result index 0e98f304d89..41203566aab 100644 --- a/mysql-test/r/func_str.result +++ b/mysql-test/r/func_str.result @@ -686,7 +686,7 @@ select left(1234, 3) + 0; left(1234, 3) + 0 123 create table t1 (a int not null primary key, b varchar(40), c datetime); -insert into t1 (a,b,c) values (1,'Tom',now()),(2,'ball games',now()), (3,'Basil',now()), (4,'Dean',now()),(5,'Ellis',now()), (6,'Serg',now()), (7,'Sergei',now()),(8,'Georg',now()),(9,'Salle',now()),(10,'Sinisa',now()); +insert into t1 (a,b,c) values (1,'Tom','2004-12-10 12:13:14'),(2,'ball games','2004-12-10 12:13:14'), (3,'Basil','2004-12-10 12:13:14'), (4,'Dean','2004-12-10 12:13:14'),(5,'Ellis','2004-12-10 12:13:14'), (6,'Serg','2004-12-10 12:13:14'), (7,'Sergei','2004-12-10 12:13:14'),(8,'Georg','2004-12-10 12:13:14'),(9,'Salle','2004-12-10 12:13:14'),(10,'Sinisa','2004-12-10 12:13:14'); select count(*) as total, left(c,10) as reg from t1 group by reg order by reg desc limit 0,12; total reg 10 2004-12-10 diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test index 2934a9733a7..4404429cf7e 100644 --- a/mysql-test/t/func_str.test +++ b/mysql-test/t/func_str.test @@ -426,6 +426,6 @@ select left(1234, 3) + 0; # Bug #7101: bug with LEFT() when used as a field in GROUP BY aggregation # create table t1 (a int not null primary key, b varchar(40), c datetime); -insert into t1 (a,b,c) values (1,'Tom',now()),(2,'ball games',now()), (3,'Basil',now()), (4,'Dean',now()),(5,'Ellis',now()), (6,'Serg',now()), (7,'Sergei',now()),(8,'Georg',now()),(9,'Salle',now()),(10,'Sinisa',now()); +insert into t1 (a,b,c) values (1,'Tom','2004-12-10 12:13:14'),(2,'ball games','2004-12-10 12:13:14'), (3,'Basil','2004-12-10 12:13:14'), (4,'Dean','2004-12-10 12:13:14'),(5,'Ellis','2004-12-10 12:13:14'), (6,'Serg','2004-12-10 12:13:14'), (7,'Sergei','2004-12-10 12:13:14'),(8,'Georg','2004-12-10 12:13:14'),(9,'Salle','2004-12-10 12:13:14'),(10,'Sinisa','2004-12-10 12:13:14'); select count(*) as total, left(c,10) as reg from t1 group by reg order by reg desc limit 0,12; drop table t1; From da6a5f6ec095b88fb9d0bf63a4d9e4675f1450a8 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 11 Dec 2004 10:17:25 +0100 Subject: [PATCH 0478/1063] sql/password.c: check for buffer overflow in check_scramble_323 (BUG#7187) sql/password.c: check for buffer overflow in check_scramble_323 --- sql/password.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sql/password.c b/sql/password.c index b9f3a07e596..04b3a46bd48 100644 --- a/sql/password.c +++ b/sql/password.c @@ -211,12 +211,13 @@ check_scramble_323(const char *scrambled, const char *message, ulong hash_message[2]; char buff[16],*to,extra; /* Big enough for check */ const char *pos; - + hash_password(hash_message, message, SCRAMBLE_LENGTH_323); randominit(&rand_st,hash_pass[0] ^ hash_message[0], hash_pass[1] ^ hash_message[1]); to=buff; - for (pos=scrambled ; *pos ; pos++) + DBUG_ASSERT(sizeof(buff) > SCRAMBLE_LENGTH_323); + for (pos=scrambled ; *pos && to < buff+sizeof(buff) ; pos++) *to++=(char) (floor(my_rnd(&rand_st)*31)+64); if (pos-scrambled != SCRAMBLE_LENGTH_323) return 1; From 8e4251dd855e81215281b958e97a3dc6b9153a4b Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 11 Dec 2004 15:51:52 +0300 Subject: [PATCH 0479/1063] Fix for BUG#5837 - attempt 3. Call mark_as_null_row in join_read_const and join_read_system. mysql-test/r/multi_update.result: Testcase for BUG#5837 mysql-test/t/multi_update.test: Testcase for BUG#5837 sql/table.h: Added comments --- mysql-test/r/multi_update.result | 6 ++++++ mysql-test/t/multi_update.test | 9 +++++++++ sql/sql_select.cc | 10 ++++++++-- sql/table.h | 10 ++++++++-- 4 files changed, 31 insertions(+), 4 deletions(-) diff --git a/mysql-test/r/multi_update.result b/mysql-test/r/multi_update.result index fc414f2f46b..5e7b392b503 100644 --- a/mysql-test/r/multi_update.result +++ b/mysql-test/r/multi_update.result @@ -399,3 +399,9 @@ select * from t2; c2_id c2_p_id c2_note c2_active 1 1 A Note 1 drop table t1, t2; +drop table if exists t2, t1; +create table t1(aclid bigint not null primary key, status tinyint(1) not null ) type = innodb; +create table t2(refid bigint not null primary key, aclid bigint, index idx_acl(aclid) )type = innodb; +insert into t2 values(1,null); +delete t2, t1 from t2 as a left join t1 as b on (a.aclid=b.aclid) where a.refid='1'; +drop table t1, t2; diff --git a/mysql-test/t/multi_update.test b/mysql-test/t/multi_update.test index 3494126f890..2d6770f77ed 100644 --- a/mysql-test/t/multi_update.test +++ b/mysql-test/t/multi_update.test @@ -337,3 +337,12 @@ update t1 left join t2 on p_id = c2_p_id set c2_note = 'asdf-1' where p_id = 2; select * from t1; select * from t2; drop table t1, t2; + +# Test for BUG#5837 - delete with outer join and const tables +drop table if exists t2, t1; +create table t1(aclid bigint not null primary key, status tinyint(1) not null ) type = innodb; +create table t2(refid bigint not null primary key, aclid bigint, index idx_acl(aclid) )type = innodb; +insert into t2 values(1,null); +delete t2, t1 from t2 as a left join t1 as b on (a.aclid=b.aclid) where a.refid='1'; +drop table t1, t2; + diff --git a/sql/sql_select.cc b/sql/sql_select.cc index e46b7fb8b97..2df0d45f8ed 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -4951,7 +4951,10 @@ join_read_system(JOIN_TAB *tab) table->file->print_error(error,MYF(0)); return 1; } - table->null_row=1; // This is ok. + if (tab->on_expr) + mark_as_null_row(tab->table); + else + table->null_row=1; // Why do this for inner join? empty_record(table); // Make empty record return -1; } @@ -4981,7 +4984,10 @@ join_read_const(JOIN_TAB *tab) } if (error) { - table->null_row=1; + if (tab->on_expr) + mark_as_null_row(tab->table); + else + table->null_row=1; empty_record(table); if (error != HA_ERR_KEY_NOT_FOUND) { diff --git a/sql/table.h b/sql/table.h index 84df7ba127e..0a1d1893531 100644 --- a/sql/table.h +++ b/sql/table.h @@ -89,8 +89,14 @@ struct st_table { int current_lock; /* Type of lock on table */ enum tmp_table_type tmp_table; my_bool copy_blobs; /* copy_blobs when storing */ - my_bool null_row; /* All columns are null */ - my_bool maybe_null,outer_join; /* Used with OUTER JOIN */ + /* + Used in outer joins: if true, all columns are considered to have NULL + values, including columns declared as "not null". + */ + my_bool null_row; + /* 0 or JOIN_TYPE_{LEFT|RIGHT}, same as TABLE_LIST::outer_join */ + my_bool outer_join; + my_bool maybe_null; /* true if (outer_join != 0) */ my_bool force_index; my_bool distinct,const_table,no_rows; my_bool key_read, bulk_insert; From 0a3590f6d08342512deecfe15e91424eb01c0be4 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 11 Dec 2004 16:36:12 +0300 Subject: [PATCH 0480/1063] Post-merge fixes --- mysql-test/r/multi_update.result | 13 +++++++++---- mysql-test/t/multi_update.test | 14 ++++++++++---- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/mysql-test/r/multi_update.result b/mysql-test/r/multi_update.result index 75a7c3e5a0c..dba10296063 100644 --- a/mysql-test/r/multi_update.result +++ b/mysql-test/r/multi_update.result @@ -464,9 +464,14 @@ ERROR HY000: You can't specify target table 't1' for update in FROM clause delete t1 from t1,t2 where t1.col1 < (select max(col1) from t1) and t1.col1 = t2.col1; ERROR HY000: You can't specify target table 't1' for update in FROM clause drop table t1,t2; -drop table if exists t2, t1; -create table t1(aclid bigint not null primary key, status tinyint(1) not null ) type = innodb; -create table t2(refid bigint not null primary key, aclid bigint, index idx_acl(aclid) )type = innodb; +create table t1 ( +aclid bigint not null primary key, +status tinyint(1) not null +) engine = innodb; +create table t2 ( +refid bigint not null primary key, +aclid bigint, index idx_acl(aclid) +) engine = innodb; insert into t2 values(1,null); -delete t2, t1 from t2 as a left join t1 as b on (a.aclid=b.aclid) where a.refid='1'; +delete t2, t1 from t2 left join t1 on (t2.aclid=t1.aclid) where t2.refid='1'; drop table t1, t2; diff --git a/mysql-test/t/multi_update.test b/mysql-test/t/multi_update.test index 005ce74db83..e90de399500 100644 --- a/mysql-test/t/multi_update.test +++ b/mysql-test/t/multi_update.test @@ -433,10 +433,16 @@ delete t1 from t1,t2 where t1.col1 < (select max(col1) from t1) and t1.col1 = t2 drop table t1,t2; # Test for BUG#5837 - delete with outer join and const tables -drop table if exists t2, t1; -create table t1(aclid bigint not null primary key, status tinyint(1) not null ) type = innodb; -create table t2(refid bigint not null primary key, aclid bigint, index idx_acl(aclid) )type = innodb; +create table t1 ( + aclid bigint not null primary key, + status tinyint(1) not null +) engine = innodb; + +create table t2 ( + refid bigint not null primary key, + aclid bigint, index idx_acl(aclid) +) engine = innodb; insert into t2 values(1,null); -delete t2, t1 from t2 as a left join t1 as b on (a.aclid=b.aclid) where a.refid='1'; +delete t2, t1 from t2 left join t1 on (t2.aclid=t1.aclid) where t2.refid='1'; drop table t1, t2; From 3ce0df59372a3598ae39423e35bab877459693ad Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 11 Dec 2004 17:13:19 +0200 Subject: [PATCH 0481/1063] new reference which refer to current value not to result used for resolving outer refernces if subqueri is not in HAVING clause (BUG#7079) and the same used for subquery transformetion mysql-test/r/subselect.result: reference on changable fields from subquery mysql-test/t/subselect.test: reference on changable fields from subquery sql/item.cc: new reference which refer to current value not to result used sql/item.h: new reference which refer to current value not to result used sql/item_subselect.cc: new reference which refer to current value not to result used --- mysql-test/r/subselect.result | 28 +++++++++++++++++++++++++ mysql-test/t/subselect.test | 28 +++++++++++++++++++++++++ sql/item.cc | 34 +++++++++++++++++++++++------- sql/item.h | 39 +++++++++++++++++++++++++++++++++++ sql/item_subselect.cc | 13 ++++++------ 5 files changed, 128 insertions(+), 14 deletions(-) diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index 956ddb655ee..9c52b25a577 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -2105,3 +2105,31 @@ s1 s1 < all (select s1 from t1) 1 0 NULL NULL drop table t1; +CREATE TABLE t1 ( +Code char(3) NOT NULL default '', +Name char(52) NOT NULL default '', +Continent enum('Asia','Europe','North America','Africa','Oceania','Antarctica','South America') NOT NULL default 'Asia', +Region char(26) NOT NULL default '', +SurfaceArea float(10,2) NOT NULL default '0.00', +IndepYear smallint(6) default NULL, +Population int(11) NOT NULL default '0', +LifeExpectancy float(3,1) default NULL, +GNP float(10,2) default NULL, +GNPOld float(10,2) default NULL, +LocalName char(45) NOT NULL default '', +GovernmentForm char(45) NOT NULL default '', +HeadOfState char(60) default NULL, +Capital int(11) default NULL, +Code2 char(2) NOT NULL default '' +) TYPE=MyISAM; +Warnings: +Warning 1287 'TYPE=storage_engine' is deprecated; use 'ENGINE=storage_engine' instead +INSERT INTO t1 VALUES ('XXX','Xxxxx','Oceania','Xxxxxx',26.00,0,0,0,0,0,'Xxxxx','Xxxxx','Xxxxx',NULL,'XX'); +INSERT INTO t1 VALUES ('ASM','American Samoa','Oceania','Polynesia',199.00,0,68000,75.1,334.00,NULL,'Amerika Samoa','US Territory','George W. Bush',54,'AS'); +INSERT INTO t1 VALUES ('ATF','French Southern territories','Antarctica','Antarctica',7780.00,0,0,NULL,0.00,NULL,'Terres australes françaises','Nonmetropolitan Territory of France','Jacques Chirac',NULL,'TF'); +INSERT INTO t1 VALUES ('UMI','United States Minor Outlying Islands','Oceania','Micronesia/Caribbean',16.00,0,0,NULL,0.00,NULL,'United States Minor Outlying Islands','Dependent Territory of the US','George W. Bush',NULL,'UM'); +/*!40000 ALTER TABLE t1 ENABLE KEYS */; +SELECT DISTINCT Continent AS c FROM t1 WHERE Code <> SOME ( SELECT Code FROM t1 WHERE Continent = c AND Population < 200); +c +Oceania +drop table t1; diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test index e09aa489983..b5b5de069bf 100644 --- a/mysql-test/t/subselect.test +++ b/mysql-test/t/subselect.test @@ -1358,3 +1358,31 @@ insert into t1 values (1),(null); select * from t1 where s1 < all (select s1 from t1); select s1, s1 < all (select s1 from t1) from t1; drop table t1; + +# +# reference on changable fields from subquery +# +CREATE TABLE t1 ( + Code char(3) NOT NULL default '', + Name char(52) NOT NULL default '', + Continent enum('Asia','Europe','North America','Africa','Oceania','Antarctica','South America') NOT NULL default 'Asia', + Region char(26) NOT NULL default '', + SurfaceArea float(10,2) NOT NULL default '0.00', + IndepYear smallint(6) default NULL, + Population int(11) NOT NULL default '0', + LifeExpectancy float(3,1) default NULL, + GNP float(10,2) default NULL, + GNPOld float(10,2) default NULL, + LocalName char(45) NOT NULL default '', + GovernmentForm char(45) NOT NULL default '', + HeadOfState char(60) default NULL, + Capital int(11) default NULL, + Code2 char(2) NOT NULL default '' +) TYPE=MyISAM; +INSERT INTO t1 VALUES ('XXX','Xxxxx','Oceania','Xxxxxx',26.00,0,0,0,0,0,'Xxxxx','Xxxxx','Xxxxx',NULL,'XX'); +INSERT INTO t1 VALUES ('ASM','American Samoa','Oceania','Polynesia',199.00,0,68000,75.1,334.00,NULL,'Amerika Samoa','US Territory','George W. Bush',54,'AS'); +INSERT INTO t1 VALUES ('ATF','French Southern territories','Antarctica','Antarctica',7780.00,0,0,NULL,0.00,NULL,'Terres australes françaises','Nonmetropolitan Territory of France','Jacques Chirac',NULL,'TF'); +INSERT INTO t1 VALUES ('UMI','United States Minor Outlying Islands','Oceania','Micronesia/Caribbean',16.00,0,0,NULL,0.00,NULL,'United States Minor Outlying Islands','Dependent Territory of the US','George W. Bush',NULL,'UM'); +/*!40000 ALTER TABLE t1 ENABLE KEYS */; +SELECT DISTINCT Continent AS c FROM t1 WHERE Code <> SOME ( SELECT Code FROM t1 WHERE Continent = c AND Population < 200); +drop table t1; diff --git a/sql/item.cc b/sql/item.cc index 31c35e87cd4..3fca0033be2 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -69,7 +69,7 @@ Item::Item(): } /* - Constructor used by Item_field, Item_ref & agregate (sum) functions. + Constructor used by Item_field, Item_*_ref & agregate (sum) functions. Used for duplicating lists in processing queries with temporary tables */ @@ -114,7 +114,7 @@ Item_ident::Item_ident(const char *db_name_par,const char *table_name_par, name = (char*) field_name_par; } -// Constructor used by Item_field & Item_ref (see Item comment) +// Constructor used by Item_field & Item_*_ref (see Item comment) Item_ident::Item_ident(THD *thd, Item_ident *item) :Item(thd, item), orig_db_name(item->orig_db_name), @@ -1372,6 +1372,7 @@ static void mark_as_dependent(THD *thd, SELECT_LEX *last, SELECT_LEX *current, bool Item_field::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref) { + enum_parsing_place place; DBUG_ASSERT(fixed == 0); if (!field) // If field is not checked { @@ -1419,8 +1420,7 @@ bool Item_field::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref) } Item_subselect *prev_subselect_item= prev_unit->item; - enum_parsing_place place= - prev_subselect_item->parsing_place; + place= prev_subselect_item->parsing_place; /* check table fields only if subquery used somewhere out of HAVING or outer SELECT do not use groupping (i.e. tables are @@ -1489,8 +1489,13 @@ bool Item_field::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref) return -1; } - Item_ref *rf= new Item_ref(last->ref_pointer_array + counter, - (char *)table_name, (char *)field_name); + Item_ref *rf= (place == IN_HAVING ? + new Item_ref(last->ref_pointer_array + counter, + (char *)table_name, + (char *)field_name) : + new Item_direct_ref(last->ref_pointer_array + counter, + (char *)table_name, + (char *)field_name)); if (!rf) return 1; thd->change_item_tree(ref, rf); @@ -2039,6 +2044,7 @@ bool Item_ref::fix_fields(THD *thd,TABLE_LIST *tables, Item **reference) { DBUG_ASSERT(fixed == 0); uint counter; + enum_parsing_place place; bool not_used; if (!ref) { @@ -2097,8 +2103,7 @@ bool Item_ref::fix_fields(THD *thd,TABLE_LIST *tables, Item **reference) // it is primary INSERT st_select_lex => skip first table resolving table_list= table_list->next; } - enum_parsing_place place= - prev_subselect_item->parsing_place; + place= prev_subselect_item->parsing_place; /* check table fields only if subquery used somewhere out of HAVING or SELECT list or outer SELECT do not use groupping (i.e. tables @@ -2168,6 +2173,19 @@ bool Item_ref::fix_fields(THD *thd,TABLE_LIST *tables, Item **reference) } mark_as_dependent(thd, last, thd->lex->current_select, this); + if (place == IN_HAVING) + { + Item_ref *rf; + if (!(rf= new Item_direct_ref(last->ref_pointer_array + counter, + (char *)table_name, + (char *)field_name))) + return 1; + ref= 0; // Safety + if (rf->fix_fields(thd, tables, ref) || rf->check_cols(1)) + return 1; + thd->change_item_tree(reference, rf); + return 0; + } ref= last->ref_pointer_array + counter; } else if (!ref) diff --git a/sql/item.h b/sql/item.h index 3c4f80e3857..3ae1da23f15 100644 --- a/sql/item.h +++ b/sql/item.h @@ -889,6 +889,45 @@ public: void print(String *str); }; + +class Item_direct_ref :public Item_ref +{ +public: + Item_direct_ref(Item **item, const char *table_name_par, + const char *field_name_par) + :Item_ref(item, table_name_par, field_name_par) {} + /* Constructor need to process subselect with temporary tables (see Item) */ + Item_direct_ref(THD *thd, Item_direct_ref *item) : Item_ref(thd, item) {} + double val() + { + double tmp=(*ref)->val(); + null_value=(*ref)->null_value; + return tmp; + } + longlong val_int() + { + longlong tmp=(*ref)->val_int(); + null_value=(*ref)->null_value; + return tmp; + } + String *val_str(String* tmp) + { + tmp=(*ref)->val_str(tmp); + null_value=(*ref)->null_value; + return tmp; + } + bool is_null() + { + (void) (*ref)->val_int(); + return (*ref)->null_value; + } + bool get_date(TIME *ltime,uint fuzzydate) + { + return (null_value=(*ref)->get_date(ltime,fuzzydate)); + } +}; + + class Item_in_subselect; class Item_ref_null_helper: public Item_ref { diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index 69941b36ca0..ffa3b072801 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -797,9 +797,9 @@ Item_in_subselect::single_value_transformer(JOIN *join, As far as Item_ref_in_optimizer do not substitude itself on fix_fields we can use same item for all selects. */ - expr= new Item_ref((Item**)optimizer->get_cache(), - (char *)"", - (char *)in_left_expr_name); + expr= new Item_direct_ref((Item**)optimizer->get_cache(), + (char *)"", + (char *)in_left_expr_name); unit->uncacheable|= UNCACHEABLE_DEPENDENT; } @@ -993,9 +993,10 @@ Item_in_subselect::row_value_transformer(JOIN *join) (char *) "", (char *) ""); func= - eq_creator.create(new Item_ref((*optimizer->get_cache())->addr(i), - (char *)"", - (char *)in_left_expr_name), + eq_creator.create(new Item_direct_ref((*optimizer->get_cache())-> + addr(i), + (char *)"", + (char *)in_left_expr_name), func); item= and_items(item, func); } From b5c119e7c0f3b0ff6885c0dc247f53902ef7f621 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 11 Dec 2004 19:59:09 +0300 Subject: [PATCH 0482/1063] Fix for BUG#6976: In Item_ref::Item_ref set maybe_null (and other fields fix_fields sets) to be the same as in (*ref), because Item_ref::fix_fields() will not be called. Previously maybe_null was 0 always and this produced a bogus state where maybe_null==0 && is_null() == true which broke evaluation for some upper-level Items, like AND and OR. mysql-test/r/group_by.result: Test for BUG#6976 mysql-test/t/group_by.test: Test for BUG#6976 sql/item.cc: Comment added sql/item.h: Fix for BUG#6976: in Item_ref::Item_ref(Item**...) fix all fields because fix_fields() will not be called. --- mysql-test/r/group_by.result | 12 ++++++++++++ mysql-test/t/group_by.test | 9 +++++++++ sql/item.cc | 1 + sql/item.h | 14 +++++++++++++- 4 files changed, 35 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/group_by.result b/mysql-test/r/group_by.result index dba95614052..f636692c0d9 100644 --- a/mysql-test/r/group_by.result +++ b/mysql-test/r/group_by.result @@ -626,3 +626,15 @@ explain SELECT i, COUNT(DISTINCT(i)) FROM t1 GROUP BY j ORDER BY NULL; table type possible_keys key key_len ref rows Extra t1 ALL NULL NULL NULL NULL 6 Using filesort DROP TABLE t1; +create table t1 (a int); +insert into t1 values(null); +select min(a) is null from t1; +min(a) is null +1 +select min(a) is null or null from t1; +min(a) is null or null +1 +select 1 and min(a) is null from t1; +1 and min(a) is null +1 +drop table t1; diff --git a/mysql-test/t/group_by.test b/mysql-test/t/group_by.test index 58bb4b3e268..5af78b924f8 100644 --- a/mysql-test/t/group_by.test +++ b/mysql-test/t/group_by.test @@ -447,3 +447,12 @@ INSERT INTO t1 VALUES (1,2),(2,3),(4,5),(3,5),(1,5),(23,5); SELECT i, COUNT(DISTINCT(i)) FROM t1 GROUP BY j ORDER BY NULL; explain SELECT i, COUNT(DISTINCT(i)) FROM t1 GROUP BY j ORDER BY NULL; DROP TABLE t1; + +#Test for BUG#6976: Aggregate functions have incorrect NULL-ness +create table t1 (a int); +insert into t1 values(null); +select min(a) is null from t1; +select min(a) is null or null from t1; +select 1 and min(a) is null from t1; +drop table t1; + diff --git a/sql/item.cc b/sql/item.cc index 739b5385b55..8737cc06bbd 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -687,6 +687,7 @@ bool Item_null::send(THD *thd, String *packet) /* This is used for HAVING clause Find field in select list having the same name + This is not always called, see also Item_ref::Item_ref */ bool Item_ref::fix_fields(THD *thd,TABLE_LIST *tables) diff --git a/sql/item.h b/sql/item.h index f6f9e1c0621..cc6a846d6c1 100644 --- a/sql/item.h +++ b/sql/item.h @@ -401,7 +401,19 @@ public: Item_ref(char *db_par,char *table_name_par,char *field_name_par) :Item_ident(db_par,table_name_par,field_name_par),ref(0) {} Item_ref(Item **item, char *table_name_par,char *field_name_par) - :Item_ident(NullS,table_name_par,field_name_par),ref(item) {} + :Item_ident(NullS,table_name_par,field_name_par),ref(item) + { + /* + This ctor is called from Item_XXX::split_sum_func, and fix_fields will + not be called for *this, so we must setup everything here. **ref is + already fixed at this point. + */ + max_length= (*ref)->max_length; + decimals= (*ref)->decimals; + binary= (*ref)->binary; + with_sum_func= (*ref)->with_sum_func; + maybe_null= (*ref)->maybe_null; + } enum Type type() const { return REF_ITEM; } bool eq(const Item *item, bool binary_cmp) const { return (*ref)->eq(item, binary_cmp); } From a9457c573df0ce1b7505ee735140322badd628c0 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 13 Dec 2004 01:21:14 +0200 Subject: [PATCH 0483/1063] fixed optimized SOME subquery mysql-test/r/subselect.result: correct results of SOME subquery sql/item_cmpfunc.cc: some comments added fixed optimized SOME subquery --- mysql-test/r/subselect.result | 6 ------ sql/item_cmpfunc.cc | 8 ++++---- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index 9c52b25a577..fc23331ad7b 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -1490,9 +1490,6 @@ Warnings: Note 1003 select test.t3.a AS `a` from test.t3 where ((test.t3.a < (select max(test.t2.b) from test.t2))) select * from t3 where a >= some (select b from t2); a -6 -7 -3 explain extended select * from t3 where a >= some (select b from t2); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 3 Using where @@ -1512,9 +1509,6 @@ Warnings: Note 1003 select test.t3.a AS `a` from test.t3 where ((test.t3.a < (select test.t2.b AS `b` from test.t2 group by test.t2.b))) select * from t3 where a >= some (select b from t2 group by 1); a -6 -7 -3 explain extended select * from t3 where a >= some (select b from t2 group by 1); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 3 Using where diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index 51212418b09..88083878053 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -120,7 +120,7 @@ longlong Item_func_not_all::val_int() /* return TRUE if there was records in underlaying select in max/min - optimisation + optimisation (ALL subquery) */ if (empty_underlying_subquery()) return 1; @@ -157,11 +157,11 @@ longlong Item_func_nop_all::val_int() double value= args[0]->val(); /* - return TRUE if there was records in underlaying select in max/min - optimisation + return FALSE if there was records in underlaying select in max/min + optimisation (SAME/ANY subquery) */ if (empty_underlying_subquery()) - return 1; + return 0; null_value= args[0]->null_value; return (null_value || value == 0) ? 0 : 1; From 8f318cf1825176faba9cf8dcae9df78bc54d1e15 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 13 Dec 2004 00:48:06 +0100 Subject: [PATCH 0484/1063] fix bug#7193 added start backup parameter to enable setting wait state and set different timeouts depending on waitstate moved listen of backup event out of backup and into separete thread thread created at connect() and destroyed at disconnect() added start backup command options "nowait" "wait completed" "wait started" fixed log level settings ndb/include/mgmapi/mgmapi.h: added start backup parameter to enable setting wait state ndb/src/common/debugger/EventLogger.cpp: changed to unsigned printout ndb/src/mgmapi/mgmapi.cpp: added start backup parameter to enable setting wait state, and set different timeouts depending on waitstate ndb/src/mgmclient/CommandInterpreter.cpp: moved listen of backup event out of backup and into separete thread thread created at connect() and destroyed at disconnect() added start backup command options "nowait" "wait completed" "wait started" ndb/src/mgmsrv/MgmtSrvr.cpp: added more options to start backup to set wait state + set timeout depending on wait state + some debug printouts ndb/src/mgmsrv/MgmtSrvr.hpp: added more options to start backup to set wait state ndb/src/mgmsrv/Services.cpp: removed old backup code added use of stard backup otions fixed log level settings ndb/test/src/NdbBackup.cpp: adopted to new wait state option in start backup --- ndb/include/mgmapi/mgmapi.h | 6 +- ndb/src/common/debugger/EventLogger.cpp | 8 +- ndb/src/mgmapi/mgmapi.cpp | 14 +- ndb/src/mgmclient/CommandInterpreter.cpp | 199 +++++++++++++++++++---- ndb/src/mgmsrv/MgmtSrvr.cpp | 28 +++- ndb/src/mgmsrv/MgmtSrvr.hpp | 6 +- ndb/src/mgmsrv/Services.cpp | 138 ++++++---------- ndb/test/src/NdbBackup.cpp | 3 +- 8 files changed, 263 insertions(+), 139 deletions(-) diff --git a/ndb/include/mgmapi/mgmapi.h b/ndb/include/mgmapi/mgmapi.h index 5329ded4f19..fd4baea3e1f 100644 --- a/ndb/include/mgmapi/mgmapi.h +++ b/ndb/include/mgmapi/mgmapi.h @@ -666,11 +666,15 @@ extern "C" { * Start backup * * @param handle NDB management handle. + * @param wait_completed 0=don't wait for confirmation + 1=wait for backup started + 2=wait for backup completed * @param backup_id Backup id is returned from function. * @param reply Reply message. * @return -1 on error. */ - int ndb_mgm_start_backup(NdbMgmHandle handle, unsigned int* backup_id, + int ndb_mgm_start_backup(NdbMgmHandle handle, int wait_completed, + unsigned int* backup_id, struct ndb_mgm_reply* reply); /** diff --git a/ndb/src/common/debugger/EventLogger.cpp b/ndb/src/common/debugger/EventLogger.cpp index 8bb797b7855..877f5dee243 100644 --- a/ndb/src/common/debugger/EventLogger.cpp +++ b/ndb/src/common/debugger/EventLogger.cpp @@ -1280,10 +1280,10 @@ EventLogger::getText(char * m_text, size_t m_text_len, case EventReport::BackupCompleted: BaseString::snprintf(m_text, m_text_len, - "%sBackup %d started from node %d completed\n" - " StartGCP: %d StopGCP: %d\n" - " #Records: %d #LogRecords: %d\n" - " Data: %d bytes Log: %d bytes", + "%sBackup %u started from node %u completed\n" + " StartGCP: %u StopGCP: %u\n" + " #Records: %u #LogRecords: %u\n" + " Data: %u bytes Log: %u bytes", theNodeId, theData[2], refToNode(theData[1]), theData[3], theData[4], theData[6], theData[8], theData[5], theData[7]); diff --git a/ndb/src/mgmapi/mgmapi.cpp b/ndb/src/mgmapi/mgmapi.cpp index 1a4a10f9421..adf0d26d632 100644 --- a/ndb/src/mgmapi/mgmapi.cpp +++ b/ndb/src/mgmapi/mgmapi.cpp @@ -1545,7 +1545,8 @@ ndb_mgm_start(NdbMgmHandle handle, int no_of_nodes, const int * node_list) *****************************************************************************/ extern "C" int -ndb_mgm_start_backup(NdbMgmHandle handle, unsigned int* _backup_id, +ndb_mgm_start_backup(NdbMgmHandle handle, int wait_completed, + unsigned int* _backup_id, struct ndb_mgm_reply* /*reply*/) { SET_ERROR(handle, NDB_MGM_NO_ERROR, "Executing: ndb_mgm_start_backup"); @@ -1559,8 +1560,17 @@ ndb_mgm_start_backup(NdbMgmHandle handle, unsigned int* _backup_id, CHECK_CONNECTED(handle, -1); Properties args; + args.put("completed", wait_completed); const Properties *reply; - reply = ndb_mgm_call(handle, start_backup_reply, "start backup", &args); + { // start backup can take some time, set timeout high + Uint64 old_timeout= handle->read_timeout; + if (wait_completed == 2) + handle->read_timeout= 30*60*1000; // 30 minutes + else if (wait_completed == 1) + handle->read_timeout= 5*60*1000; // 5 minutes + reply = ndb_mgm_call(handle, start_backup_reply, "start backup", &args); + handle->read_timeout= old_timeout; + } CHECK_REPLY(reply, -1); BaseString result; diff --git a/ndb/src/mgmclient/CommandInterpreter.cpp b/ndb/src/mgmclient/CommandInterpreter.cpp index e4c66d04624..4855b716d99 100644 --- a/ndb/src/mgmclient/CommandInterpreter.cpp +++ b/ndb/src/mgmclient/CommandInterpreter.cpp @@ -154,7 +154,8 @@ private: const char * param); NdbMgmHandle m_mgmsrv; - bool connected; + NdbMgmHandle m_mgmsrv2; + bool m_connected; int m_verbose; int try_reconnect; int m_error; @@ -163,6 +164,7 @@ private: const char *rep_host; bool rep_connected; #endif + struct NdbThread* m_event_thread; }; @@ -261,7 +263,8 @@ static const char* helpText = "SHOW CONFIG Print configuration\n" "SHOW PARAMETERS Print configuration parameters\n" #endif -"START BACKUP Start backup\n" +"START BACKUP [NOWAIT | WAIT STARTED | WAIT COMPLETED]\n" +" Start backup (default WAIT COMPLETED)\n" "ABORT BACKUP Abort backup\n" "SHUTDOWN Shutdown all processes in cluster and quit\n" "CLUSTERLOG ON [] ... Enable Cluster logging\n" @@ -386,13 +389,19 @@ CommandInterpreter::CommandInterpreter(const char *_host,int verbose) ndbout_c("Cannot create handle to management server."); exit(-1); } + m_mgmsrv2 = ndb_mgm_create_handle(); + if(m_mgmsrv2 == NULL) { + ndbout_c("Cannot create handle to management server."); + exit(-1); + } if (ndb_mgm_set_connectstring(m_mgmsrv, _host)) { printError(); exit(-1); } - connected = false; + m_connected= false; + m_event_thread= 0; try_reconnect = 0; #ifdef HAVE_GLOBAL_REPLICATION rep_host = NULL; @@ -406,8 +415,9 @@ CommandInterpreter::CommandInterpreter(const char *_host,int verbose) */ CommandInterpreter::~CommandInterpreter() { - connected = false; + disconnect(); ndb_mgm_destroy_handle(&m_mgmsrv); + ndb_mgm_destroy_handle(&m_mgmsrv2); } static bool @@ -430,7 +440,10 @@ void CommandInterpreter::printError() { if (ndb_mgm_check_connection(m_mgmsrv)) - connected= false; + { + m_connected= false; + disconnect(); + } ndbout_c("* %5d: %s", ndb_mgm_get_latest_error(m_mgmsrv), ndb_mgm_get_latest_error_msg(m_mgmsrv)); @@ -440,32 +453,90 @@ CommandInterpreter::printError() //***************************************************************************** //***************************************************************************** -bool +static int do_event_thread; +static void* +event_thread_run(void* m) +{ + NdbMgmHandle handle= *(NdbMgmHandle*)m; + + my_thread_init(); + + int filter[] = { 15, NDB_MGM_EVENT_CATEGORY_BACKUP, 0 }; + int fd = ndb_mgm_listen_event(handle, filter); + if (fd > 0) + { + char *tmp= 0; + char buf[1024]; + SocketInputStream in(fd,10); + do { + if (tmp == 0) NdbSleep_MilliSleep(10); + if((tmp = in.gets(buf, 1024))) + ndbout << tmp; + } while(do_event_thread); + } + + my_thread_end(); + NdbThread_Exit(0); + return 0; +} + +bool CommandInterpreter::connect() { - if(!connected) { + if(!m_connected) + { if(!ndb_mgm_connect(m_mgmsrv, try_reconnect-1, 5, 1)) { - connected = true; - if (m_verbose) + const char *host= ndb_mgm_get_connected_host(m_mgmsrv); + unsigned port= ndb_mgm_get_connected_port(m_mgmsrv); + if(!ndb_mgm_set_connectstring(m_mgmsrv2, + BaseString(host).appfmt(":%d",port).c_str()) + && + !ndb_mgm_connect(m_mgmsrv2, try_reconnect-1, 5, 1)) { - printf("Connected to Management Server at: %s:%d\n", - ndb_mgm_get_connected_host(m_mgmsrv), - ndb_mgm_get_connected_port(m_mgmsrv)); + m_connected= true; + if (m_verbose) + { + printf("Connected to Management Server at: %s:%d\n", + host, port); + } + { + do_event_thread= 1; + m_event_thread = NdbThread_Create(event_thread_run, + (void**)&m_mgmsrv2, + 32768, + "CommandInterpreted_event_thread", + NDB_THREAD_PRIO_LOW); + } + } + else + { + ndb_mgm_disconnect(m_mgmsrv); } } } - return connected; + return m_connected; } bool CommandInterpreter::disconnect() { - if (connected && (ndb_mgm_disconnect(m_mgmsrv) == -1)) { - ndbout_c("Could not disconnect from management server"); - printError(); + if (m_event_thread) { + void *res; + do_event_thread= 0; + NdbThread_WaitFor(m_event_thread, &res); + NdbThread_Destroy(&m_event_thread); + m_event_thread= 0; + ndb_mgm_disconnect(m_mgmsrv2); + } + if (m_connected) + { + if (ndb_mgm_disconnect(m_mgmsrv) == -1) { + ndbout_c("Could not disconnect from management server"); + printError(); + } + m_connected= false; } - connected = false; return true; } @@ -914,7 +985,8 @@ CommandInterpreter::executeShutdown(char* parameters) return result; } - connected = false; + m_connected= false; + disconnect(); ndbout << "NDB Cluster management server shutdown." << endl; return 0; } @@ -1882,21 +1954,68 @@ CommandInterpreter::executeEventReporting(int processId, * Backup *****************************************************************************/ int -CommandInterpreter::executeStartBackup(char* /*parameters*/) +CommandInterpreter::executeStartBackup(char* parameters) { struct ndb_mgm_reply reply; unsigned int backupId; - +#if 0 int filter[] = { 15, NDB_MGM_EVENT_CATEGORY_BACKUP, 0 }; int fd = ndb_mgm_listen_event(m_mgmsrv, filter); - int result = ndb_mgm_start_backup(m_mgmsrv, &backupId, &reply); + if (fd < 0) + { + ndbout << "Initializing start of backup failed" << endl; + printError(); + return fd; + } +#endif + Vector args; + { + BaseString(parameters).split(args); + for (unsigned i= 0; i < args.size(); i++) + if (args[i].length() == 0) + args.erase(i--); + else + args[i].ndb_toupper(); + } + int sz= args.size(); + + int result; + if (sz == 2 && + args[1] == "NOWAIT") + { + result = ndb_mgm_start_backup(m_mgmsrv, 0, &backupId, &reply); + } + else if (sz == 1 || + (sz == 3 && + args[1] == "WAIT" && + args[2] == "COMPLETED")) + { + ndbout_c("Waiting for completed, this may take several minutes"); + result = ndb_mgm_start_backup(m_mgmsrv, 2, &backupId, &reply); + } + else if (sz == 3 && + args[1] == "WAIT" && + args[2] == "STARTED") + { + ndbout_c("Waiting for started, this may take several minutes"); + result = ndb_mgm_start_backup(m_mgmsrv, 1, &backupId, &reply); + } + else + { + invalid_command(parameters); + return -1; + } + if (result != 0) { ndbout << "Start of backup failed" << endl; printError(); +#if 0 close(fd); +#endif return result; } - +#if 0 + ndbout_c("Waiting for completed, this may take several minutes"); char *tmp; char buf[1024]; { @@ -1923,29 +2042,39 @@ CommandInterpreter::executeStartBackup(char* /*parameters*/) ndbout << tmp; } } while(tmp && tmp[0] != 0); - + close(fd); +#endif return 0; } void CommandInterpreter::executeAbortBackup(char* parameters) { - strtok(parameters, " "); - struct ndb_mgm_reply reply; - char* id = strtok(NULL, "\0"); int bid = -1; - if(id == 0 || sscanf(id, "%d", &bid) != 1){ - ndbout << "Invalid arguments: expected " << endl; - return; + struct ndb_mgm_reply reply; + if (emptyString(parameters)) + goto executeAbortBackupError1; + + { + strtok(parameters, " "); + char* id = strtok(NULL, "\0"); + if(id == 0 || sscanf(id, "%d", &bid) != 1) + goto executeAbortBackupError1; } - int result = ndb_mgm_abort_backup(m_mgmsrv, bid, &reply); - if (result != 0) { - ndbout << "Abort of backup " << bid << " failed" << endl; - printError(); - } else { - ndbout << "Abort of backup " << bid << " ordered" << endl; + { + int result= ndb_mgm_abort_backup(m_mgmsrv, bid, &reply); + if (result != 0) { + ndbout << "Abort of backup " << bid << " failed" << endl; + printError(); + } else { + ndbout << "Abort of backup " << bid << " ordered" << endl; + } } + return; + executeAbortBackupError1: + ndbout << "Invalid arguments: expected " << endl; + return; } #ifdef HAVE_GLOBAL_REPLICATION diff --git a/ndb/src/mgmsrv/MgmtSrvr.cpp b/ndb/src/mgmsrv/MgmtSrvr.cpp index c5f08df8a6c..d0e1207cef0 100644 --- a/ndb/src/mgmsrv/MgmtSrvr.cpp +++ b/ndb/src/mgmsrv/MgmtSrvr.cpp @@ -2397,7 +2397,7 @@ MgmtSrvr::eventReport(NodeId nodeId, const Uint32 * theData) * Backup ***************************************************************************/ int -MgmtSrvr::startBackup(Uint32& backupId, bool waitCompleted) +MgmtSrvr::startBackup(Uint32& backupId, int waitCompleted) { bool next; NodeId nodeId = 0; @@ -2419,11 +2419,16 @@ MgmtSrvr::startBackup(Uint32& backupId, bool waitCompleted) req->backupDataLen = 0; int result; - if (waitCompleted) { - result = sendRecSignal(nodeId, WAIT_BACKUP_COMPLETED, signal, true); + if (waitCompleted == 2) { + result = sendRecSignal(nodeId, WAIT_BACKUP_COMPLETED, + signal, true, 30*60*1000 /*30 secs*/); + } + else if (waitCompleted == 1) { + result = sendRecSignal(nodeId, WAIT_BACKUP_STARTED, + signal, true, 5*60*1000 /*5 mins*/); } else { - result = sendRecSignal(nodeId, WAIT_BACKUP_STARTED, signal, true); + result = sendRecSignal(nodeId, NO_WAIT, signal, true); } if (result == -1) { return SEND_OR_RECEIVE_FAILED; @@ -2502,18 +2507,31 @@ MgmtSrvr::abortBackup(Uint32 backupId) void MgmtSrvr::backupCallback(BackupEvent & event) { + DBUG_ENTER("MgmtSrvr::backupCallback"); m_lastBackupEvent = event; switch(event.Event){ case BackupEvent::BackupFailedToStart: + DBUG_PRINT("info",("BackupEvent::BackupFailedToStart")); + theWaitState = NO_WAIT; + break; case BackupEvent::BackupAborted: + DBUG_PRINT("info",("BackupEvent::BackupAborted")); + theWaitState = NO_WAIT; + break; case BackupEvent::BackupCompleted: + DBUG_PRINT("info",("BackupEvent::BackupCompleted")); theWaitState = NO_WAIT; break; case BackupEvent::BackupStarted: if(theWaitState == WAIT_BACKUP_STARTED) + { + DBUG_PRINT("info",("BackupEvent::BackupStarted NO_WAIT")); theWaitState = NO_WAIT; + } else { + DBUG_PRINT("info",("BackupEvent::BackupStarted")); + } } - return; + DBUG_VOID_RETURN; } diff --git a/ndb/src/mgmsrv/MgmtSrvr.hpp b/ndb/src/mgmsrv/MgmtSrvr.hpp index 0cad99e9d86..21311ad78c9 100644 --- a/ndb/src/mgmsrv/MgmtSrvr.hpp +++ b/ndb/src/mgmsrv/MgmtSrvr.hpp @@ -60,6 +60,8 @@ public: } void add_listener(const Event_listener&); + void update_max_log_level(const LogLevel&); + void update_log_level(const LogLevel&); void log(int eventType, const Uint32* theData, NodeId nodeId); @@ -67,6 +69,8 @@ public: Event_listener& operator[](unsigned i) { return m_clients[i]; } const Event_listener& operator[](unsigned i) const { return m_clients[i]; } + void lock() { m_clients.lock(); } + void unlock(){ m_clients.unlock(); } }; /** @@ -360,7 +364,7 @@ public: /** * Backup functionallity */ - int startBackup(Uint32& backupId, bool waitCompleted = false); + int startBackup(Uint32& backupId, int waitCompleted= 2); int abortBackup(Uint32 backupId); int performBackup(Uint32* backupId); diff --git a/ndb/src/mgmsrv/Services.cpp b/ndb/src/mgmsrv/Services.cpp index 5b8d12e44d5..edd1e6ef07e 100644 --- a/ndb/src/mgmsrv/Services.cpp +++ b/ndb/src/mgmsrv/Services.cpp @@ -176,6 +176,7 @@ ParserRow commands[] = { MGM_ARG("args", String, Mandatory, "Args(space separated int's)"), MGM_CMD("start backup", &MgmApiSession::startBackup, ""), + MGM_ARG("completed", Int, Optional ,"Wait until completed"), MGM_CMD("abort backup", &MgmApiSession::abortBackup, ""), MGM_ARG("id", Int, Mandatory, "Backup id"), @@ -629,85 +630,30 @@ MgmApiSession::getVersion(Parser::Context &, m_output->println("string: %s", NDB_VERSION_STRING); m_output->println(""); } -#if 0 - -/***************************************************************************** - * BACKUP - *****************************************************************************/ - -int completed; -MgmtSrvr::BackupEvent globalEvent; - -static void -completedCallback(const MgmtSrvr::BackupEvent & event){ - - ndbout << "WaitCallback" << endl; - // Save event in the latestEvent var - - switch(event.Event){ - case MgmtSrvr::BackupEvent::BackupCompleted: - case MgmtSrvr::BackupEvent::BackupFailedToStart: - globalEvent = event; - completed = 1; - break; - } -} void MgmApiSession::startBackup(Parser::Context &, - Properties const &) { + Properties const &args) { + DBUG_ENTER("MgmApiSession::startBackup"); unsigned backupId; + Uint32 completed= 2; int result; - MgmtSrvr::BackupCallback prevCallback; - prevCallback = m_mgmsrv.setCallback(completedCallback); - completed = 0; - result = m_mgmsrv.startBackup(backupId); - if (result == 0){ + args.get("completed", &completed); - // Wait for the callback to call our condition - // waitFor(); - while (completed == 0) - NdbSleep_SecSleep(0); - - if (globalEvent.Event == MgmtSrvr::BackupEvent::BackupFailedToStart) - result = globalEvent.FailedToStart.ErrorCode; - else - backupId = globalEvent.Completed.BackupId; - } - - // restore old callback - m_mgmsrv.setCallback(prevCallback); - - m_output->println("start backup reply"); - if(result != 0) - m_output->println("result: %s(%d)", get_error_text(result), result); - else{ - m_output->println("result: Ok"); - m_output->println("id: %d", backupId); - } - m_output->println(""); - -} -#endif - -void -MgmApiSession::startBackup(Parser::Context &, - Properties const &) { - unsigned backupId; - int result; - - result = m_mgmsrv.startBackup(backupId, true); + result = m_mgmsrv.startBackup(backupId, completed); m_output->println("start backup reply"); if(result != 0) + { m_output->println("result: %s", get_error_text(result)); + } else{ m_output->println("result: Ok"); m_output->println("id: %d", backupId); } m_output->println(""); - + DBUG_VOID_RETURN; } void @@ -804,19 +750,22 @@ MgmApiSession::setClusterLogLevel(Parser::Context &, LogLevel::EventCategory category= (LogLevel::EventCategory)(cat-(int)CFG_MIN_LOGLEVEL); + m_mgmsrv.m_event_listner.lock(); if (m_mgmsrv.m_event_listner[0].m_logLevel.setLogLevel(category,level)) { m_output->println(reply); m_output->println("result: Invalid category %d", category); m_output->println(""); + m_mgmsrv.m_event_listner.unlock(); DBUG_VOID_RETURN; } + m_mgmsrv.m_event_listner.unlock(); - EventSubscribeReq req; - req.blockRef = 0; - req.noOfEntries = 1; - req.theData[0] = (category << 16) | level; - m_mgmsrv.m_log_level_requests.push_back(req); + { + LogLevel ll; + ll.setLogLevel(category,level); + m_mgmsrv.m_event_listner.update_max_log_level(ll); + } m_output->println(reply); m_output->println("result: Ok"); @@ -827,13 +776,13 @@ MgmApiSession::setClusterLogLevel(Parser::Context &, void MgmApiSession::setLogLevel(Parser::Context &, Properties const &args) { - Uint32 node = 0, level = 0, category; + Uint32 node = 0, level = 0, cat; BaseString errorString; SetLogLevelOrd logLevel; int result; logLevel.clear(); args.get("node", &node); - args.get("category", &category); + args.get("category", &cat); args.get("level", &level); /* XXX should use constants for this value */ @@ -844,12 +793,15 @@ MgmApiSession::setLogLevel(Parser::Context &, return; } - EventSubscribeReq req; - req.blockRef = node; - req.noOfEntries = 1; - req.theData[0] = (category << 16) | level; - m_mgmsrv.m_log_level_requests.push_back(req); - + LogLevel::EventCategory category= + (LogLevel::EventCategory)(cat-(int)CFG_MIN_LOGLEVEL); + + { + LogLevel ll; + ll.setLogLevel(category,level); + m_mgmsrv.m_event_listner.update_max_log_level(ll); + } + m_output->println("set loglevel reply"); m_output->println("result: Ok"); m_output->println(""); @@ -1319,24 +1271,22 @@ Ndb_mgmd_event_service::log(int eventType, const Uint32* theData, NodeId nodeId) tmp.set_max(m_clients[i].m_logLevel); } m_clients.unlock(); - - if(!(tmp == m_logLevel)){ - m_logLevel = tmp; - EventSubscribeReq req; - req = tmp; - req.blockRef = 0; - m_mgmsrv->m_log_level_requests.push_back(req); - } + update_log_level(tmp); } - DBUG_VOID_RETURN; + DBUG_VOID_RETURN; } void -Ndb_mgmd_event_service::add_listener(const Event_listener& client){ - m_clients.push_back(client); - LogLevel tmp = m_logLevel; - tmp.set_max(client.m_logLevel); - +Ndb_mgmd_event_service::update_max_log_level(const LogLevel &log_level) +{ + LogLevel tmp= m_logLevel; + tmp.set_max(log_level); + update_log_level(tmp); +} + +void +Ndb_mgmd_event_service::update_log_level(const LogLevel &tmp) +{ if(!(tmp == m_logLevel)){ m_logLevel = tmp; EventSubscribeReq req; @@ -1346,14 +1296,22 @@ Ndb_mgmd_event_service::add_listener(const Event_listener& client){ } } +void +Ndb_mgmd_event_service::add_listener(const Event_listener& client){ + m_clients.push_back(client); + update_max_log_level(client.m_logLevel); +} + void Ndb_mgmd_event_service::stop_sessions(){ + m_clients.lock(); for(int i = m_clients.size() - 1; i >= 0; i--){ if(m_clients[i].m_socket >= 0){ NDB_CLOSE_SOCKET(m_clients[i].m_socket); m_clients.erase(i); } } + m_clients.unlock(); } void diff --git a/ndb/test/src/NdbBackup.cpp b/ndb/test/src/NdbBackup.cpp index 09f52bf0bed..5e22468692e 100644 --- a/ndb/test/src/NdbBackup.cpp +++ b/ndb/test/src/NdbBackup.cpp @@ -46,7 +46,8 @@ NdbBackup::start(unsigned int & _backup_id){ ndb_mgm_reply reply; reply.return_code = 0; - if (ndb_mgm_start_backup(handle, + if (ndb_mgm_start_backup(handle, + 2, // wait until completed &_backup_id, &reply) == -1) { g_err << "Could not start backup " << endl; From f916abf3796de564676d2a6e96427caef20b325b Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 13 Dec 2004 00:51:30 +0100 Subject: [PATCH 0485/1063] CommandInterpreter.cpp: changed help text ndb/src/mgmclient/CommandInterpreter.cpp: changed help text --- ndb/src/mgmclient/CommandInterpreter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ndb/src/mgmclient/CommandInterpreter.cpp b/ndb/src/mgmclient/CommandInterpreter.cpp index 4855b716d99..a169d21f97c 100644 --- a/ndb/src/mgmclient/CommandInterpreter.cpp +++ b/ndb/src/mgmclient/CommandInterpreter.cpp @@ -266,7 +266,7 @@ static const char* helpText = "START BACKUP [NOWAIT | WAIT STARTED | WAIT COMPLETED]\n" " Start backup (default WAIT COMPLETED)\n" "ABORT BACKUP Abort backup\n" -"SHUTDOWN Shutdown all processes in cluster and quit\n" +"SHUTDOWN Shutdown all processes in cluster\n" "CLUSTERLOG ON [] ... Enable Cluster logging\n" "CLUSTERLOG OFF [] ... Disable Cluster logging\n" "CLUSTERLOG TOGGLE [] ... Toggle severity filter on/off\n" From 1e314961893c2f5a460bb16c72c320ad3fedd037 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 13 Dec 2004 08:45:00 +0200 Subject: [PATCH 0486/1063] initialize variables (addition for BUG#7079) sql/item.cc: initialize variables --- sql/item.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/item.cc b/sql/item.cc index 3fca0033be2..9ed8b39dece 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -1372,7 +1372,7 @@ static void mark_as_dependent(THD *thd, SELECT_LEX *last, SELECT_LEX *current, bool Item_field::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref) { - enum_parsing_place place; + enum_parsing_place place= NO_MATTER; DBUG_ASSERT(fixed == 0); if (!field) // If field is not checked { @@ -2044,7 +2044,7 @@ bool Item_ref::fix_fields(THD *thd,TABLE_LIST *tables, Item **reference) { DBUG_ASSERT(fixed == 0); uint counter; - enum_parsing_place place; + enum_parsing_place place= NO_MATTER; bool not_used; if (!ref) { From f40f838f50bda025cacd0529e1ec41bb4f1e5579 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 13 Dec 2004 12:31:17 +0200 Subject: [PATCH 0487/1063] dict0load.c: dict_load_table(): detect the new table format of MySQL 5.0.3 innobase/dict/dict0load.c: dict_load_table(): detect the new table format of MySQL 5.0.3 --- innobase/dict/dict0load.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/innobase/dict/dict0load.c b/innobase/dict/dict0load.c index a4637e09d07..0bbf0511b57 100644 --- a/innobase/dict/dict0load.c +++ b/innobase/dict/dict0load.c @@ -647,6 +647,22 @@ dict_load_table( return(NULL); } +#if MYSQL_VERSION_ID < 50300 + /* Starting from MySQL 5.0.3, the high-order bit of MIX_LEN is the + "compact format" flag. */ + field = rec_get_nth_field(rec, 7, &len); + if (mach_read_from_1(field) & 0x80) { + btr_pcur_close(&pcur); + mtr_commit(&mtr); + mem_heap_free(heap); + ut_print_timestamp(stderr); + fprintf(stderr, + " InnoDB: table %s is in the new compact format\n" + "InnoDB: of MySQL 5.0.3 or later\n", name); + return(NULL); + } +#endif /* MYSQL_VERSION_ID < 50300 */ + ut_a(0 == ut_strcmp((char *) "SPACE", dict_field_get_col( dict_index_get_nth_field( From be19c6f72109d8ffd3adbee84a1289ad05bcf14f Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 13 Dec 2004 11:45:45 +0100 Subject: [PATCH 0488/1063] bug #7230 + fixed testcase mysql-test/ndb/basic.result: fixed testcase ndb/include/debugger/EventLogger.hpp: bug #7230 --- mysql-test/ndb/basic.result | 5 +++-- ndb/include/debugger/EventLogger.hpp | 9 ++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/mysql-test/ndb/basic.result b/mysql-test/ndb/basic.result index 6bd907a11d0..7049c02f304 100644 --- a/mysql-test/ndb/basic.result +++ b/mysql-test/ndb/basic.result @@ -6,9 +6,10 @@ HELP Print help text HELP SHOW Help for SHOW command HELP DEBUG Help for debug compiled version SHOW Print information about cluster -START BACKUP Start backup +START BACKUP [NOWAIT | WAIT STARTED | WAIT COMPLETED] + Start backup (default WAIT COMPLETED) ABORT BACKUP Abort backup -SHUTDOWN Shutdown all processes in cluster and quit +SHUTDOWN Shutdown all processes in cluster CLUSTERLOG ON [] ... Enable Cluster logging CLUSTERLOG OFF [] ... Disable Cluster logging CLUSTERLOG TOGGLE [] ... Toggle severity filter on/off diff --git a/ndb/include/debugger/EventLogger.hpp b/ndb/include/debugger/EventLogger.hpp index b82c823ee0b..ddf21b79f5f 100644 --- a/ndb/include/debugger/EventLogger.hpp +++ b/ndb/include/debugger/EventLogger.hpp @@ -48,11 +48,10 @@ public: static const EventRepLogLevelMatrix matrix[]; static const Uint32 matrixSize; - static int - EventLoggerBase::event_lookup(int eventType, - LogLevel::EventCategory &cat, - Uint32 &threshold, - Logger::LoggerLevel &severity); + static int event_lookup(int eventType, + LogLevel::EventCategory &cat, + Uint32 &threshold, + Logger::LoggerLevel &severity); }; /** From f507b37767334fb52ce3f7d32c710754ef15d022 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 13 Dec 2004 12:50:33 +0100 Subject: [PATCH 0489/1063] ndb - Handle shm-transporter wo/ busy-wait + also handled mixed tcp/shm transporters + bug#7124 ndb/src/common/transporter/SHM_Transporter.cpp: Add remote/own pid for signaling availability of data on shm-segment ndb/src/common/transporter/SHM_Transporter.hpp: Add remote/own pid for signaling availability of data on shm-segment ndb/src/common/transporter/TransporterRegistry.cpp: Add remote/own pid for signaling availability of data on shm-segment ndb/src/kernel/main.cpp: Set pid to use for shm-signaling ndb/src/mgmsrv/ConfigInfo.cpp: bug#7124 ndb/src/ndbapi/TransporterFacade.cpp: Set pid to use for shm-signaling --- .../common/transporter/SHM_Transporter.cpp | 83 ++-- .../common/transporter/SHM_Transporter.hpp | 33 +- .../transporter/TransporterRegistry.cpp | 398 ++++++++++-------- ndb/src/kernel/main.cpp | 3 + ndb/src/mgmsrv/ConfigInfo.cpp | 63 ++- ndb/src/ndbapi/TransporterFacade.cpp | 4 + 6 files changed, 336 insertions(+), 248 deletions(-) diff --git a/ndb/src/common/transporter/SHM_Transporter.cpp b/ndb/src/common/transporter/SHM_Transporter.cpp index ab161d8c18c..7c2c2aafb85 100644 --- a/ndb/src/common/transporter/SHM_Transporter.cpp +++ b/ndb/src/common/transporter/SHM_Transporter.cpp @@ -26,6 +26,8 @@ #include #include +extern int g_shm_pid; + SHM_Transporter::SHM_Transporter(TransporterRegistry &t_reg, const char *lHostName, const char *rHostName, @@ -52,6 +54,7 @@ SHM_Transporter::SHM_Transporter(TransporterRegistry &t_reg, #ifdef DEBUG_TRANSPORTER printf("shm key (%d - %d) = %d\n", lNodeId, rNodeId, shmKey); #endif + m_signal_threshold = 4096; } SHM_Transporter::~SHM_Transporter(){ @@ -182,42 +185,6 @@ SHM_Transporter::setupBuffers(){ #endif } -#if 0 -SendStatus -SHM_Transporter::prepareSend(const SignalHeader * const signalHeader, - Uint8 prio, - const Uint32 * const signalData, - const LinearSegmentPtr ptr[3], - bool force){ - - if(isConnected()){ - - const Uint32 lenBytes = m_packer.getMessageLength(signalHeader, ptr); - - Uint32 * insertPtr = (Uint32 *)writer->getWritePtr(lenBytes); - - if(insertPtr != 0){ - - m_packer.pack(insertPtr, prio, signalHeader, signalData, ptr); - - /** - * Do funky membar stuff - */ - - writer->updateWritePtr(lenBytes); - return SEND_OK; - - } else { - // NdbSleep_MilliSleep(3); - //goto tryagain; - return SEND_BUFFER_FULL; - } - } - return SEND_DISCONNECTED; -} -#endif - - bool SHM_Transporter::connect_server_impl(NDB_SOCKET_TYPE sockfd) { @@ -247,10 +214,17 @@ SHM_Transporter::connect_server_impl(NDB_SOCKET_TYPE sockfd) } // Send ok to client - s_output.println("shm server 1 ok"); - + s_output.println("shm server 1 ok: %d", g_shm_pid); + // Wait for ok from client - if (s_input.gets(buf, 256) == 0) { + if (s_input.gets(buf, 256) == 0) + { + NDB_CLOSE_SOCKET(sockfd); + DBUG_RETURN(false); + } + + if(sscanf(buf, "shm client 1 ok: %d", &m_remote_pid) != 1) + { NDB_CLOSE_SOCKET(sockfd); DBUG_RETURN(false); } @@ -289,6 +263,12 @@ SHM_Transporter::connect_client_impl(NDB_SOCKET_TYPE sockfd) DBUG_RETURN(false); } + if(sscanf(buf, "shm server 1 ok: %d", &m_remote_pid) != 1) + { + NDB_CLOSE_SOCKET(sockfd); + DBUG_RETURN(false); + } + // Create if(!_shmSegCreated){ if (!ndb_shm_get()) { @@ -313,10 +293,10 @@ SHM_Transporter::connect_client_impl(NDB_SOCKET_TYPE sockfd) } // Send ok to server - s_output.println("shm client 1 ok"); - + s_output.println("shm client 1 ok: %d", g_shm_pid); + int r= connect_common(sockfd); - + if (r) { // Wait for ok from server if (s_input.gets(buf, 256) == 0) { @@ -344,18 +324,33 @@ SHM_Transporter::connect_common(NDB_SOCKET_TYPE sockfd) return false; } - if(!setupBuffersDone) { + if(!setupBuffersDone) + { setupBuffers(); setupBuffersDone=true; } - if(setupBuffersDone) { + if(setupBuffersDone) + { NdbSleep_MilliSleep(m_timeOutMillis); if(*serverStatusFlag == 1 && *clientStatusFlag == 1) + { + m_last_signal = 0; return true; + } } DBUG_PRINT("error", ("Failed to set up buffers to node %d", remoteNodeId)); return false; } + +void +SHM_Transporter::doSend() +{ + if(m_last_signal) + { + m_last_signal = 0; + kill(m_remote_pid, SIGUSR1); + } +} diff --git a/ndb/src/common/transporter/SHM_Transporter.hpp b/ndb/src/common/transporter/SHM_Transporter.hpp index 27692209ffe..b501f652168 100644 --- a/ndb/src/common/transporter/SHM_Transporter.hpp +++ b/ndb/src/common/transporter/SHM_Transporter.hpp @@ -47,18 +47,25 @@ public: * SHM destructor */ virtual ~SHM_Transporter(); - + /** * Do initialization */ bool initTransporter(); - - Uint32 * getWritePtr(Uint32 lenBytes, Uint32 prio){ + + Uint32 * getWritePtr(Uint32 lenBytes, Uint32 prio) + { return (Uint32 *)writer->getWritePtr(lenBytes); } - void updateWritePtr(Uint32 lenBytes, Uint32 prio){ + void updateWritePtr(Uint32 lenBytes, Uint32 prio) + { writer->updateWritePtr(lenBytes); + m_last_signal += lenBytes; + if(m_last_signal >= m_signal_threshold) + { + doSend(); + } } void getReceivePtr(Uint32 ** ptr, Uint32 ** eod){ @@ -123,28 +130,36 @@ protected: */ void setupBuffers(); + /** + * doSend (i.e signal receiver) + */ + void doSend(); + int m_remote_pid; + Uint32 m_last_signal; + Uint32 m_signal_threshold; + private: bool _shmSegCreated; bool _attached; bool m_connected; - + key_t shmKey; volatile Uint32 * serverStatusFlag; volatile Uint32 * clientStatusFlag; bool setupBuffersDone; - + #ifdef NDB_WIN32 HANDLE hFileMapping; #else int shmId; #endif - + int shmSize; char * shmBuf; - + SHM_Reader * reader; SHM_Writer * writer; - + /** * @return - True if the reader has data to read on its segment. */ diff --git a/ndb/src/common/transporter/TransporterRegistry.cpp b/ndb/src/common/transporter/TransporterRegistry.cpp index a2fab8f9806..61924fe55b2 100644 --- a/ndb/src/common/transporter/TransporterRegistry.cpp +++ b/ndb/src/common/transporter/TransporterRegistry.cpp @@ -47,6 +47,8 @@ #include #include +int g_shm_pid = 0; + SocketServer::Session * TransporterService::newSession(NDB_SOCKET_TYPE sockfd) { DBUG_ENTER("SocketServer::Session * TransporterService::newSession"); @@ -622,11 +624,28 @@ TransporterRegistry::pollReceive(Uint32 timeOutMillis){ return retVal; #endif - if((nSHMTransporters+nSCITransporters) > 0) + if((nSCITransporters) > 0) + { timeOutMillis=0; + } + +#ifdef NDB_SHM_TRANSPORTER + if(nSHMTransporters > 0) + { + Uint32 res = poll_SHM(0); + if(res) + { + retVal |= res; + timeOutMillis = 0; + } + } +#endif + #ifdef NDB_TCP_TRANSPORTER - if(nTCPTransporters > 0) + if(nTCPTransporters > 0 || retVal == 0) + { retVal |= poll_TCP(timeOutMillis); + } else tcpReadSelectReply = 0; #endif @@ -635,8 +654,11 @@ TransporterRegistry::pollReceive(Uint32 timeOutMillis){ retVal |= poll_SCI(timeOutMillis); #endif #ifdef NDB_SHM_TRANSPORTER - if(nSHMTransporters > 0) - retVal |= poll_SHM(timeOutMillis); + if(nSHMTransporters > 0 && retVal == 0) + { + int res = poll_SHM(0); + retVal |= res; + } #endif return retVal; } @@ -644,8 +666,8 @@ TransporterRegistry::pollReceive(Uint32 timeOutMillis){ #ifdef NDB_SCI_TRANSPORTER Uint32 -TransporterRegistry::poll_SCI(Uint32 timeOutMillis){ - +TransporterRegistry::poll_SCI(Uint32 timeOutMillis) +{ for (int i=0; iisConnected()) { @@ -659,73 +681,29 @@ TransporterRegistry::poll_SCI(Uint32 timeOutMillis){ #ifdef NDB_SHM_TRANSPORTER +static int g_shm_counter = 0; Uint32 TransporterRegistry::poll_SHM(Uint32 timeOutMillis) { - for(int j=0; j < 20; j++) - for (int i=0; iisConnected()) { - if(t->hasDataToRead()) { - return 1; - } - } - } - /** - * @note: granularity of linux/i386 timer is not good enough. - * Can't sleep if using SHM as it is now. - */ - /* - if(timeOutMillis > 0) - NdbSleep_MilliSleep(timeOutMillis); - else - NdbSleep_MilliSleep(1); - */ - return 0; -#if 0 - NDB_TICKS startTime = NdbTick_CurrentMillisecond(); - for(int i=0; i<100; i++) { + for(int j=0; j < 100; j++) + { for (int i=0; iisConnected()) { - if(t->hasDataToRead()){ + if(t->hasDataToRead()) { return 1; } - else - continue; - } - else - continue; - } - - if(NdbTick_CurrentMillisecond() > (startTime +timeOutMillis)) - return 0; - } - NdbSleep_MilliSleep(5); - return 0; - -#endif -#if 0 - - for(int j=0; j < 100; j++) { - for (int i=0; iisConnected()) { - if(t->hasDataToRead()) - return 1; } } } return 0; -#endif } - - #endif #ifdef NDB_OSE_TRANSPORTER Uint32 -TransporterRegistry::poll_OSE(Uint32 timeOutMillis){ +TransporterRegistry::poll_OSE(Uint32 timeOutMillis) +{ if(theOSEReceiver != NULL){ return theOSEReceiver->doReceive(timeOutMillis); } @@ -736,18 +714,18 @@ TransporterRegistry::poll_OSE(Uint32 timeOutMillis){ #ifdef NDB_TCP_TRANSPORTER Uint32 -TransporterRegistry::poll_TCP(Uint32 timeOutMillis){ - - if (nTCPTransporters == 0){ +TransporterRegistry::poll_TCP(Uint32 timeOutMillis) +{ + if (false && nTCPTransporters == 0) + { tcpReadSelectReply = 0; return 0; } struct timeval timeout; #ifdef NDB_OSE - // Return directly if there are no TCP transporters configured - + if(timeOutMillis <= 1){ timeout.tv_sec = 0; timeout.tv_usec = 1025; @@ -760,7 +738,7 @@ TransporterRegistry::poll_TCP(Uint32 timeOutMillis){ timeout.tv_usec = (timeOutMillis % 1000) * 1000; #endif - NDB_SOCKET_TYPE maxSocketValue = 0; + NDB_SOCKET_TYPE maxSocketValue = -1; // Needed for TCP/IP connections // The read- and writeset are used by select @@ -788,23 +766,29 @@ TransporterRegistry::poll_TCP(Uint32 timeOutMillis){ maxSocketValue++; tcpReadSelectReply = select(maxSocketValue, &tcpReadset, 0, 0, &timeout); + if(false && tcpReadSelectReply == -1 && errno == EINTR) + ndbout_c("woke-up by signal"); + #ifdef NDB_WIN32 if(tcpReadSelectReply == SOCKET_ERROR) { NdbSleep_MilliSleep(timeOutMillis); } #endif - + return tcpReadSelectReply; } #endif void -TransporterRegistry::performReceive(){ +TransporterRegistry::performReceive() +{ #ifdef NDB_OSE_TRANSPORTER - if(theOSEReceiver != 0){ - while(theOSEReceiver->hasData()){ + if(theOSEReceiver != 0) + { + while(theOSEReceiver->hasData()) + { NodeId remoteNodeId; Uint32 * readPtr; Uint32 sz = theOSEReceiver->getReceiveData(&remoteNodeId, &readPtr); @@ -827,16 +811,20 @@ TransporterRegistry::performReceive(){ #endif #ifdef NDB_TCP_TRANSPORTER - if(tcpReadSelectReply > 0){ - for (int i=0; i 0) + { + for (int i=0; igetRemoteNodeId(); const NDB_SOCKET_TYPE socket = t->getSocket(); if(is_connected(nodeId)){ - if(t->isConnected() && FD_ISSET(socket, &tcpReadset)) { + if(t->isConnected() && FD_ISSET(socket, &tcpReadset)) + { const int receiveSize = t->doReceive(); - if(receiveSize > 0){ + if(receiveSize > 0) + { Uint32 * ptr; Uint32 sz = t->getReceiveData(&ptr); Uint32 szUsed = unpack(ptr, sz, nodeId, ioStates[nodeId]); @@ -847,142 +835,165 @@ TransporterRegistry::performReceive(){ } } #endif - - + #ifdef NDB_SCI_TRANSPORTER //performReceive //do prepareReceive on the SCI transporters (prepareReceive(t,,,,)) - for (int i=0; igetRemoteNodeId(); - if(is_connected(nodeId)){ - if(t->isConnected() && t->checkConnected()){ - Uint32 * readPtr, * eodPtr; - t->getReceivePtr(&readPtr, &eodPtr); - Uint32 *newPtr = unpack(readPtr, eodPtr, nodeId, ioStates[nodeId]); - t->updateReceivePtr(newPtr); - } - } - } + for (int i=0; igetRemoteNodeId(); + if(is_connected(nodeId)) + { + if(t->isConnected() && t->checkConnected()) + { + Uint32 * readPtr, * eodPtr; + t->getReceivePtr(&readPtr, &eodPtr); + Uint32 *newPtr = unpack(readPtr, eodPtr, nodeId, ioStates[nodeId]); + t->updateReceivePtr(newPtr); + } + } + } #endif #ifdef NDB_SHM_TRANSPORTER - for (int i=0; igetRemoteNodeId(); - if(is_connected(nodeId)){ - if(t->isConnected() && t->checkConnected()){ - Uint32 * readPtr, * eodPtr; - t->getReceivePtr(&readPtr, &eodPtr); - Uint32 *newPtr = unpack(readPtr, eodPtr, nodeId, ioStates[nodeId]); - t->updateReceivePtr(newPtr); - } - } - } + for (int i=0; igetRemoteNodeId(); + if(is_connected(nodeId)){ + if(t->isConnected() && t->checkConnected()) + { + Uint32 * readPtr, * eodPtr; + t->getReceivePtr(&readPtr, &eodPtr); + Uint32 *newPtr = unpack(readPtr, eodPtr, nodeId, ioStates[nodeId]); + t->updateReceivePtr(newPtr); + } + } + } #endif } static int x = 0; void -TransporterRegistry::performSend(){ - int i; - sendCounter = 1; - +TransporterRegistry::performSend() +{ + int i; + sendCounter = 1; + #ifdef NDB_OSE_TRANSPORTER - for (int i = 0; i < nOSETransporters; i++){ - OSE_Transporter *t = theOSETransporters[i]; - if((is_connected(t->getRemoteNodeId()) && - (t->isConnected())) { - t->doSend(); - }//if - }//for + for (int i = 0; i < nOSETransporters; i++) + { + OSE_Transporter *t = theOSETransporters[i]; + if(is_connected(t->getRemoteNodeId()) &&& (t->isConnected())) + { + t->doSend(); + }//if + }//for #endif - + #ifdef NDB_TCP_TRANSPORTER #ifdef NDB_OSE + { + int maxSocketValue = 0; + + // Needed for TCP/IP connections + // The writeset are used by select + fd_set writeset; + FD_ZERO(&writeset); + + // Prepare for sending and receiving + for (i = 0; i < nTCPTransporters; i++) { + TCP_Transporter * t = theTCPTransporters[i]; + + // If the transporter is connected + if ((t->hasDataToSend()) && (t->isConnected())) { + const int socket = t->getSocket(); + // Find the highest socket value. It will be used by select + if (socket > maxSocketValue) { + maxSocketValue = socket; + }//if + FD_SET(socket, &writeset); + }//if + }//for + + // The highest socket value plus one + if(maxSocketValue == 0) + return; + + maxSocketValue++; + struct timeval timeout = { 0, 1025 }; + Uint32 tmp = select(maxSocketValue, 0, &writeset, 0, &timeout); + + if (tmp == 0) { - int maxSocketValue = 0; - - // Needed for TCP/IP connections - // The writeset are used by select - fd_set writeset; - FD_ZERO(&writeset); - - // Prepare for sending and receiving - for (i = 0; i < nTCPTransporters; i++) { - TCP_Transporter * t = theTCPTransporters[i]; - - // If the transporter is connected - if ((t->hasDataToSend()) && (t->isConnected())) { - const int socket = t->getSocket(); - // Find the highest socket value. It will be used by select - if (socket > maxSocketValue) { - maxSocketValue = socket; - }//if - FD_SET(socket, &writeset); - }//if - }//for - - // The highest socket value plus one - if(maxSocketValue == 0) - return; - - maxSocketValue++; - struct timeval timeout = { 0, 1025 }; - Uint32 tmp = select(maxSocketValue, 0, &writeset, 0, &timeout); - - if (tmp == 0) { - return; - }//if - for (i = 0; i < nTCPTransporters; i++) { - TCP_Transporter *t = theTCPTransporters[i]; - const NodeId nodeId = t->getRemoteNodeId(); - const int socket = t->getSocket(); - if(is_connected(nodeId)){ - if(t->isConnected() && FD_ISSET(socket, &writeset)) { - t->doSend(); - }//if - }//if - }//for + return; + }//if + for (i = 0; i < nTCPTransporters; i++) { + TCP_Transporter *t = theTCPTransporters[i]; + const NodeId nodeId = t->getRemoteNodeId(); + const int socket = t->getSocket(); + if(is_connected(nodeId)){ + if(t->isConnected() && FD_ISSET(socket, &writeset)) { + t->doSend(); + }//if + }//if + }//for } #endif #ifdef NDB_TCP_TRANSPORTER - for (i = x; i < nTCPTransporters; i++) { - TCP_Transporter *t = theTCPTransporters[i]; - if (t && - (t->hasDataToSend()) && - (t->isConnected()) && - (is_connected(t->getRemoteNodeId()))) { - t->doSend(); - }//if - }//for - for (i = 0; i < x && i < nTCPTransporters; i++) { - TCP_Transporter *t = theTCPTransporters[i]; - if (t && - (t->hasDataToSend()) && - (t->isConnected()) && - (is_connected(t->getRemoteNodeId()))) { - t->doSend(); - }//if - }//for - x++; - if (x == nTCPTransporters) x = 0; + for (i = x; i < nTCPTransporters; i++) + { + TCP_Transporter *t = theTCPTransporters[i]; + if (t && t->hasDataToSend() && t->isConnected() && + is_connected(t->getRemoteNodeId())) + { + t->doSend(); + } + } + for (i = 0; i < x && i < nTCPTransporters; i++) + { + TCP_Transporter *t = theTCPTransporters[i]; + if (t && t->hasDataToSend() && t->isConnected() && + is_connected(t->getRemoteNodeId())) + { + t->doSend(); + } + } + x++; + if (x == nTCPTransporters) x = 0; #endif #endif #ifdef NDB_SCI_TRANSPORTER - //scroll through the SCI transporters, - // get each transporter, check if connected, send data - for (i=0; igetRemoteNodeId(); - - if(is_connected(nodeId)){ - if(t->isConnected() && t->hasDataToSend()) { - t->doSend(); - } //if + //scroll through the SCI transporters, + // get each transporter, check if connected, send data + for (i=0; igetRemoteNodeId(); + + if(is_connected(nodeId)) + { + if(t->isConnected() && t->hasDataToSend()) { + t->doSend(); } //if - } //if + } //if + } +#endif + +#ifdef NDB_SHM_TRANSPORTER + for (i=0; igetRemoteNodeId(); + if(is_connected(nodeId)) + { + if(t->isConnected()) + { + t->doSend(); + } + } + } #endif } @@ -1169,7 +1180,8 @@ TransporterRegistry::stop_clients() } void -TransporterRegistry::add_transporter_interface(const char *interface, unsigned short port) +TransporterRegistry::add_transporter_interface(const char *interface, + unsigned short port) { DBUG_ENTER("TransporterRegistry::add_transporter_interface"); DBUG_PRINT("enter",("interface=%s, port= %d", interface, port)); @@ -1232,6 +1244,15 @@ TransporterRegistry::start_service(SocketServer& socket_server) return true; } +#ifdef NDB_SHM_TRANSPORTER +static +RETSIGTYPE +shm_sig_handler(int signo) +{ + g_shm_counter++; +} +#endif + void TransporterRegistry::startReceiving() { @@ -1250,6 +1271,13 @@ TransporterRegistry::startReceiving() for(int i = 0; itheReceiverPid = theReceiverPid; #endif + +#ifdef NDB_SHM_TRANSPORTER + if(nSHMTransporters) + { + signal(SIGUSR1, shm_sig_handler); + } +#endif } void diff --git a/ndb/src/kernel/main.cpp b/ndb/src/kernel/main.cpp index 926647838c9..7d6b597e6dd 100644 --- a/ndb/src/kernel/main.cpp +++ b/ndb/src/kernel/main.cpp @@ -49,6 +49,8 @@ void catchsigs(bool ignore); // for process signal handling extern "C" void handler_shutdown(int signum); // for process signal handling extern "C" void handler_error(int signum); // for process signal handling +extern int g_shm_pid; + // Shows system information void systemInfo(const Configuration & conf, const LogLevel & ll); @@ -145,6 +147,7 @@ int main(int argc, char** argv) } g_eventLogger.info("Angel pid: %d ndb pid: %d", getppid(), getpid()); + g_shm_pid = getpid(); theConfig->setupConfiguration(); systemInfo(* theConfig, * theConfig->m_logLevel); diff --git a/ndb/src/mgmsrv/ConfigInfo.cpp b/ndb/src/mgmsrv/ConfigInfo.cpp index 4af1556a0c0..35229d1f666 100644 --- a/ndb/src/mgmsrv/ConfigInfo.cpp +++ b/ndb/src/mgmsrv/ConfigInfo.cpp @@ -82,7 +82,7 @@ static bool transformConnection(InitConfigFileParser::Context & ctx, const char static bool applyDefaultValues(InitConfigFileParser::Context & ctx, const char *); static bool checkMandatory(InitConfigFileParser::Context & ctx, const char *); static bool fixPortNumber(InitConfigFileParser::Context & ctx, const char *); -static bool fixShmkey(InitConfigFileParser::Context & ctx, const char *); +static bool fixShmKey(InitConfigFileParser::Context & ctx, const char *); static bool checkDbConstraints(InitConfigFileParser::Context & ctx, const char *); static bool checkConnectionConstraints(InitConfigFileParser::Context &, const char *); static bool checkTCPConstraints(InitConfigFileParser::Context &, const char *); @@ -131,13 +131,15 @@ ConfigInfo::m_SectionRules[] = { { "TCP", fixHostname, "HostName2" }, { "SCI", fixHostname, "HostName1" }, { "SCI", fixHostname, "HostName2" }, + { "SHM", fixHostname, "HostName1" }, + { "SHM", fixHostname, "HostName2" }, { "OSE", fixHostname, "HostName1" }, { "OSE", fixHostname, "HostName2" }, { "TCP", fixPortNumber, 0 }, // has to come after fixHostName { "SHM", fixPortNumber, 0 }, // has to come after fixHostName { "SCI", fixPortNumber, 0 }, // has to come after fixHostName - //{ "SHM", fixShmKey, 0 }, + { "SHM", fixShmKey, 0 }, /** * fixExtConnection must be after fixNodeId @@ -168,6 +170,8 @@ ConfigInfo::m_SectionRules[] = { { "TCP", checkTCPConstraints, "HostName2" }, { "SCI", checkTCPConstraints, "HostName1" }, { "SCI", checkTCPConstraints, "HostName2" }, + { "SHM", checkTCPConstraints, "HostName1" }, + { "SHM", checkTCPConstraints, "HostName2" }, { "*", checkMandatory, 0 }, @@ -1687,16 +1691,27 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { 0, 0 }, { - CFG_CONNECTION_NODE_1, - "NodeId1", + CFG_CONNECTION_HOSTNAME_1, + "HostName1", "SHM", - "Id of node ("DB_TOKEN_PRINT", "API_TOKEN_PRINT" or "MGM_TOKEN_PRINT") on one side of the connection", - ConfigInfo::USED, + "Name/IP of computer on one side of the connection", + ConfigInfo::INTERNAL, false, ConfigInfo::STRING, - MANDATORY, + UNDEFINED, 0, 0 }, - + + { + CFG_CONNECTION_HOSTNAME_2, + "HostName2", + "SHM", + "Name/IP of computer on one side of the connection", + ConfigInfo::INTERNAL, + false, + ConfigInfo::STRING, + UNDEFINED, + 0, 0 }, + { CFG_CONNECTION_SERVER_PORT, "PortNumber", @@ -1709,6 +1724,17 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "0", STR_VALUE(MAX_INT_RNIL) }, + { + CFG_CONNECTION_NODE_1, + "NodeId1", + "SHM", + "Id of node ("DB_TOKEN_PRINT", "API_TOKEN_PRINT" or "MGM_TOKEN_PRINT") on one side of the connection", + ConfigInfo::USED, + false, + ConfigInfo::STRING, + MANDATORY, + 0, 0 }, + { CFG_CONNECTION_NODE_2, "NodeId2", @@ -3025,15 +3051,32 @@ fixPortNumber(InitConfigFileParser::Context & ctx, const char * data){ << "per connection, please remove from config. " << "Will be changed to " << port << endl; ctx.m_currentSection->put("PortNumber", port, true); - } else + } + else + { ctx.m_currentSection->put("PortNumber", port); - + } DBUG_PRINT("info", ("connection %d-%d port %d host %s", id1, id2, port, hostname.c_str())); DBUG_RETURN(true); } +static +bool +fixShmKey(InitConfigFileParser::Context & ctx, const char *) +{ + Uint32 id1= 0, id2= 0, key= 0; + require(ctx.m_currentSection->get("NodeId1", &id1)); + require(ctx.m_currentSection->get("NodeId2", &id2)); + if(ctx.m_currentSection->get("ShmKey", &key)) + return true; + + key= (id1 > id2 ? id1 << 16 | id2 : id2 << 16 | id1); + ctx.m_currentSection->put("ShmKey", key); + return true; +} + /** * DB Node rule: Check various constraints */ diff --git a/ndb/src/ndbapi/TransporterFacade.cpp b/ndb/src/ndbapi/TransporterFacade.cpp index dfb090c8416..f6a7496decc 100644 --- a/ndb/src/ndbapi/TransporterFacade.cpp +++ b/ndb/src/ndbapi/TransporterFacade.cpp @@ -450,8 +450,12 @@ runReceiveResponse_C(void * me) return me; } +extern int g_shm_pid; + void TransporterFacade::threadMainReceive(void) { + g_shm_pid = getpid(); + theTransporterRegistry->startReceiving(); NdbMutex_Lock(theMutexPtr); theTransporterRegistry->update_connections(); From f4dc786ec88e700a3d3e3b90cf090eec0bf29c84 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 13 Dec 2004 14:19:34 +0200 Subject: [PATCH 0490/1063] Some fixes for Netware. --- netware/init_db.sql | 30 +++++++++++++-------------- netware/mysql_fix_privilege_tables.pl | 2 +- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/netware/init_db.sql b/netware/init_db.sql index 15111c9043b..c5810b50e8e 100644 --- a/netware/init_db.sql +++ b/netware/init_db.sql @@ -3,14 +3,14 @@ CREATE DATABASE test; USE mysql; -CREATE TABLE db (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL, References_priv enum('N','Y') DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db,User), KEY User (User)) comment='Database privileges'; +CREATE TABLE db (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL, References_priv enum('N','Y') DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db,User), KEY User (User)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Database privileges'; INSERT INTO db VALUES ('%','test','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y'); INSERT INTO db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y'); -CREATE TABLE host (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL, References_priv enum('N','Y') DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db)) comment='Host privileges; Merged with database privileges'; +CREATE TABLE host (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL, References_priv enum('N','Y') DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Host privileges; Merged with database privileges'; -CREATE TABLE user (Host char(60) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Password char(41) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL, Reload_priv enum('N','Y') DEFAULT 'N' NOT NULL, Shutdown_priv enum('N','Y') DEFAULT 'N' NOT NULL, Process_priv enum('N','Y') DEFAULT 'N' NOT NULL, File_priv enum('N','Y') DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL, References_priv enum('N','Y') DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL, Show_db_priv enum('N','Y') DEFAULT 'N' NOT NULL, Super_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') DEFAULT 'N' NOT NULL, Repl_slave_priv enum('N','Y') DEFAULT 'N' NOT NULL, Repl_client_priv enum('N','Y') DEFAULT 'N' NOT NULL, ssl_type enum('','ANY','X509', 'SPECIFIED') DEFAULT '' NOT NULL, ssl_cipher BLOB NOT NULL, x509_issuer BLOB NOT NULL, x509_subject BLOB NOT NULL, max_questions int(11) unsigned DEFAULT 0 NOT NULL, max_updates int(11) unsigned DEFAULT 0 NOT NULL, max_connections int(11) unsigned DEFAULT 0 NOT NULL, PRIMARY KEY Host (Host,User)) comment='Users and global privileges'; +CREATE TABLE user (Host char(60) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Password char(41) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL, Reload_priv enum('N','Y') DEFAULT 'N' NOT NULL, Shutdown_priv enum('N','Y') DEFAULT 'N' NOT NULL, Process_priv enum('N','Y') DEFAULT 'N' NOT NULL, File_priv enum('N','Y') DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL, References_priv enum('N','Y') DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL, Show_db_priv enum('N','Y') DEFAULT 'N' NOT NULL, Super_priv enum('N','Y') DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') DEFAULT 'N' NOT NULL, Repl_slave_priv enum('N','Y') DEFAULT 'N' NOT NULL, Repl_client_priv enum('N','Y') DEFAULT 'N' NOT NULL, ssl_type enum('','ANY','X509', 'SPECIFIED') DEFAULT '' NOT NULL, ssl_cipher BLOB NOT NULL, x509_issuer BLOB NOT NULL, x509_subject BLOB NOT NULL, max_questions int(11) unsigned DEFAULT 0 NOT NULL, max_updates int(11) unsigned DEFAULT 0 NOT NULL, max_connections int(11) unsigned DEFAULT 0 NOT NULL, PRIMARY KEY Host (Host,User)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Users and global privileges'; INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); INSERT INTO user VALUES ('','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); @@ -18,21 +18,21 @@ INSERT INTO user VALUES ('','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y INSERT INTO user (host,user) values ('localhost',''); INSERT INTO user (host,user) values ('',''); -CREATE TABLE func (name char(64) binary DEFAULT '' NOT NULL, ret tinyint(1) DEFAULT '0' NOT NULL, dl char(128) DEFAULT '' NOT NULL, type enum ('function','aggregate') NOT NULL, PRIMARY KEY (name)) comment='User defined functions'; +CREATE TABLE func (name char(64) binary DEFAULT '' NOT NULL, ret tinyint(1) DEFAULT '0' NOT NULL, dl char(128) DEFAULT '' NOT NULL, type enum ('function','aggregate') NOT NULL, PRIMARY KEY (name)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='User defined functions'; -CREATE TABLE tables_priv (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Timestamp timestamp(14), Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') DEFAULT '' NOT NULL, Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name), KEY Grantor (Grantor)) comment='Table privileges'; +CREATE TABLE tables_priv (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Timestamp timestamp(14), Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') DEFAULT '' NOT NULL, Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name), KEY Grantor (Grantor)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Table privileges'; -CREATE TABLE columns_priv (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Column_name char(64) binary DEFAULT '' NOT NULL, Timestamp timestamp(14), Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name,Column_name)) comment='Column privileges'; +CREATE TABLE columns_priv (Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Column_name char(64) binary DEFAULT '' NOT NULL, Timestamp timestamp(14), Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name,Column_name)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Column privileges'; -CREATE TABLE help_topic (help_topic_id int unsigned NOT NULL, name varchar(64) NOT NULL, help_category_id smallint unsigned NOT NULL, description text NOT NULL, example text NOT NULL, url varchar(128) NOT NULL, primary key (help_topic_id), unique index (name))comment='help topics'; -CREATE TABLE help_category (help_category_id smallint unsigned NOT NULL, name varchar(64) NOT NULL, parent_category_id smallint unsigned null, url varchar(128) NOT NULL, primary key (help_category_id), unique index (name)) comment='help categories'; -CREATE TABLE help_keyword (help_keyword_id int unsigned NOT NULL, name varchar(64) NOT NULL, primary key (help_keyword_id), unique index (name)) comment='help keywords'; -CREATE TABLE help_relation (help_topic_id int unsigned NOT NULL references help_topic, help_keyword_id int unsigned NOT NULL references help_keyword, primary key (help_keyword_id, help_topic_id)) comment='keyword-topic relation'; +CREATE TABLE help_topic (help_topic_id int unsigned NOT NULL, name varchar(64) NOT NULL, help_category_id smallint unsigned NOT NULL, description text NOT NULL, example text NOT NULL, url varchar(128) NOT NULL, primary key (help_topic_id), unique index (name)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='help topics'; +CREATE TABLE help_category (help_category_id smallint unsigned NOT NULL, name varchar(64) NOT NULL, parent_category_id smallint unsigned null, url varchar(128) NOT NULL, primary key (help_category_id), unique index (name)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='help categories'; +CREATE TABLE help_keyword (help_keyword_id int unsigned NOT NULL, name varchar(64) NOT NULL, primary key (help_keyword_id), unique index (name)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='help keywords'; +CREATE TABLE help_relation (help_topic_id int unsigned NOT NULL references help_topic, help_keyword_id int unsigned NOT NULL references help_keyword, primary key (help_keyword_id, help_topic_id)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='keyword-topic relation'; -CREATE TABLE time_zone_name (Name char(64) NOT NULL,Time_zone_id int unsigned NOT NULL,PRIMARY KEY Name (Name)) DEFAULT CHARACTER SET latin1 comment='Time zone names'; +CREATE TABLE time_zone_name (Name char(64) NOT NULL,Time_zone_id int unsigned NOT NULL,PRIMARY KEY Name (Name)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Time zone names'; -CREATE TABLE time_zone (Time_zone_id int unsigned NOT NULL auto_increment, Use_leap_seconds enum('Y','N') DEFAULT 'N' NOT NULL,PRIMARY KEY TzId (Time_zone_id)) DEFAULT CHARACTER SET latin1 comment='Time zones'; -CREATE TABLE time_zone_transition (Time_zone_id int unsigned NOT NULL,Transition_time bigint signed NOT NULL,Transition_type_id int unsigned NOT NULL,PRIMARY KEY TzIdTranTime (Time_zone_id, Transition_time)) DEFAULT CHARACTER SET latin1 comment='Time zone transitions'; +CREATE TABLE time_zone (Time_zone_id int unsigned NOT NULL auto_increment, Use_leap_seconds enum('Y','N') DEFAULT 'N' NOT NULL,PRIMARY KEY TzId (Time_zone_id)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Time zones'; +CREATE TABLE time_zone_transition (Time_zone_id int unsigned NOT NULL,Transition_time bigint signed NOT NULL,Transition_type_id int unsigned NOT NULL,PRIMARY KEY TzIdTranTime (Time_zone_id, Transition_time)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Time zone transitions'; -CREATE TABLE time_zone_transition_type (Time_zone_id int unsigned NOT NULL,Transition_type_id int unsigned NOT NULL,Offset int signed DEFAULT 0 NOT NULL,Is_DST tinyint unsigned DEFAULT 0 NOT NULL,Abbreviation char(8) DEFAULT '' NOT NULL,PRIMARY KEY TzIdTrTId (Time_zone_id, Transition_type_id)) DEFAULT CHARACTER SET latin1 comment='Time zone transition types'; -CREATE TABLE time_zone_leap_second (Transition_time bigint signed NOT NULL,Correction int signed NOT NULL,PRIMARY KEY TranTime (Transition_time)) DEFAULT CHARACTER SET latin1 comment='Leap seconds information for time zones'; +CREATE TABLE time_zone_transition_type (Time_zone_id int unsigned NOT NULL,Transition_type_id int unsigned NOT NULL,Offset int signed DEFAULT 0 NOT NULL,Is_DST tinyint unsigned DEFAULT 0 NOT NULL,Abbreviation char(8) DEFAULT '' NOT NULL,PRIMARY KEY TzIdTrTId (Time_zone_id, Transition_type_id)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Time zone transition types'; +CREATE TABLE time_zone_leap_second (Transition_time bigint signed NOT NULL,Correction int signed NOT NULL,PRIMARY KEY TranTime (Transition_time)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Leap seconds information for time zones'; diff --git a/netware/mysql_fix_privilege_tables.pl b/netware/mysql_fix_privilege_tables.pl index c0a428eff0f..20af37be2d7 100644 --- a/netware/mysql_fix_privilege_tables.pl +++ b/netware/mysql_fix_privilege_tables.pl @@ -206,7 +206,7 @@ unique index (name) \ print "Filling online help tables with contents...\n"; # Generate the path for "fill_help_tables.sql" file which is in different folder. $fill_help_table=$0; -$fill_help_table =~ s/scripts[\\\/]mysql_fix_privilege_tables.pl/support-files\\fill_help_tables.sql/; +$fill_help_table =~ s/scripts[\\\/]mysql_fix_privilege_tables.pl/share\\fill_help_tables.sql/; #read all content from the sql file which contains recordsfor help tables. open(fileIN,$fill_help_table) or die("Cannot open $fill_help_table: $!"); From 46364ddb1978802ad9bf5418738b03d0cfe8bd61 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 13 Dec 2004 12:26:28 +0000 Subject: [PATCH 0491/1063] WL#2274 - INSERT..SELECT..UPDATE UPDATE clause conflicts with SELECT for use of item_list field. Alter UPDATE clause to use new lex field update_list Tests included mysql-test/r/insert_update.result: WL#2274 New tests for INSERT..SELECT..UPDATE mysql-test/t/insert_update.test: WL#2274 New tests for INSERT..SELECT..UPDATE sql/mysql_priv.h: Remove function - insert_select_precheck() sql/sql_class.h: WL#2274 New constructor for class select_insert sql/sql_insert.cc: WL#2274 Move code into mysql_prepare_insert Add checks as param values may be NULL sql/sql_lex.cc: WL#2274 initialize lex->update_list sql/sql_lex.h: WL#2274 New field in LEX: update_list sql/sql_parse.cc: WL#2274 INSERT..UPDATE clause now populates lex->update_list Remove redundant function: insert_select_precheck() sql/sql_prepare.cc: WL#2274 invoke insert_precheck() instead of insert_select_precheck() sql/sql_yacc.yy: WL#2274 Enable INSERT..SELECT..UPDATE syntax New rule - insert_update_list, to populate lex->update_list --- mysql-test/r/insert_update.result | 62 +++++++++++++++++++++++++++++++ mysql-test/t/insert_update.test | 31 ++++++++++++++++ sql/mysql_priv.h | 1 - sql/sql_class.h | 10 +++++ sql/sql_insert.cc | 27 ++++++++------ sql/sql_lex.cc | 1 + sql/sql_lex.h | 2 +- sql/sql_parse.cc | 45 +++++++--------------- sql/sql_prepare.cc | 2 +- sql/sql_yacc.yy | 45 +++++++++++----------- 10 files changed, 157 insertions(+), 69 deletions(-) diff --git a/mysql-test/r/insert_update.result b/mysql-test/r/insert_update.result index 303d7186015..753dc2cd749 100644 --- a/mysql-test/r/insert_update.result +++ b/mysql-test/r/insert_update.result @@ -105,3 +105,65 @@ a b 8 28 9 29 drop table t1; +CREATE TABLE t1 (a INT, b INT, c INT, UNIQUE (A), UNIQUE(B)); +INSERT t1 VALUES (1,2,10), (3,4,20); +INSERT t1 SELECT 5,6,30 FROM DUAL ON DUPLICATE KEY UPDATE c=c+100; +SELECT * FROM t1; +a b c +1 2 10 +3 4 20 +5 6 30 +INSERT t1 SELECT 5,7,40 FROM DUAL ON DUPLICATE KEY UPDATE c=c+100; +SELECT * FROM t1; +a b c +1 2 10 +3 4 20 +5 6 130 +INSERT t1 SELECT 8,4,50 FROM DUAL ON DUPLICATE KEY UPDATE c=c+1000; +SELECT * FROM t1; +a b c +1 2 10 +3 4 1020 +5 6 130 +INSERT t1 SELECT 1,4,60 FROM DUAL ON DUPLICATE KEY UPDATE c=c+10000; +SELECT * FROM t1; +a b c +1 2 10010 +3 4 1020 +5 6 130 +INSERT t1 SELECT 1,9,70 FROM DUAL ON DUPLICATE KEY UPDATE c=c+100000, b=4; +ERROR 23000: Duplicate entry '4' for key 2 +SELECT * FROM t1; +a b c +1 2 10010 +3 4 1020 +5 6 130 +TRUNCATE TABLE t1; +INSERT t1 VALUES (1,2,10), (3,4,20); +CREATE TABLE t2 (x INT, y INT, z INT, d INT); +INSERT t2 VALUES (5,6,30,1), (7,4,40,1), (8,9,60,1); +INSERT t2 VALUES (2,1,11,2), (7,4,40,2); +INSERT t1 SELECT x,y,z FROM t2 WHERE d=1 ON DUPLICATE KEY UPDATE c=c+100; +SELECT * FROM t1; +a b c +1 2 10 +3 4 120 +5 6 30 +8 9 60 +INSERT t1 SET a=5 ON DUPLICATE KEY UPDATE b=0; +SELECT * FROM t1; +a b c +1 2 10 +3 4 120 +5 0 30 +8 9 60 +INSERT t1 SELECT x,y,z FROM t2 WHERE d=2 ON DUPLICATE KEY UPDATE c=c+VALUES(a); +SELECT *, VALUES(a) FROM t1; +a b c VALUES(a) +1 2 10 NULL +3 4 127 NULL +5 0 30 NULL +8 9 60 NULL +2 1 11 NULL +DROP TABLE t1; +DROP TABLE t2; diff --git a/mysql-test/t/insert_update.test b/mysql-test/t/insert_update.test index fc54ce88f8a..182baa641da 100644 --- a/mysql-test/t/insert_update.test +++ b/mysql-test/t/insert_update.test @@ -48,3 +48,34 @@ disable_info; select * from t1; drop table t1; + +# WorkLog #2274 - enable INSERT .. SELECT .. UPDATE syntax +# Same tests as beginning of this test except that insert source +# is a result from a select statement +# +CREATE TABLE t1 (a INT, b INT, c INT, UNIQUE (A), UNIQUE(B)); +INSERT t1 VALUES (1,2,10), (3,4,20); +INSERT t1 SELECT 5,6,30 FROM DUAL ON DUPLICATE KEY UPDATE c=c+100; +SELECT * FROM t1; +INSERT t1 SELECT 5,7,40 FROM DUAL ON DUPLICATE KEY UPDATE c=c+100; +SELECT * FROM t1; +INSERT t1 SELECT 8,4,50 FROM DUAL ON DUPLICATE KEY UPDATE c=c+1000; +SELECT * FROM t1; +INSERT t1 SELECT 1,4,60 FROM DUAL ON DUPLICATE KEY UPDATE c=c+10000; +SELECT * FROM t1; +-- error 1062 +INSERT t1 SELECT 1,9,70 FROM DUAL ON DUPLICATE KEY UPDATE c=c+100000, b=4; +SELECT * FROM t1; +TRUNCATE TABLE t1; +INSERT t1 VALUES (1,2,10), (3,4,20); +CREATE TABLE t2 (x INT, y INT, z INT, d INT); +INSERT t2 VALUES (5,6,30,1), (7,4,40,1), (8,9,60,1); +INSERT t2 VALUES (2,1,11,2), (7,4,40,2); +INSERT t1 SELECT x,y,z FROM t2 WHERE d=1 ON DUPLICATE KEY UPDATE c=c+100; +SELECT * FROM t1; +INSERT t1 SET a=5 ON DUPLICATE KEY UPDATE b=0; +SELECT * FROM t1; +INSERT t1 SELECT x,y,z FROM t2 WHERE d=2 ON DUPLICATE KEY UPDATE c=c+VALUES(a); +SELECT *, VALUES(a) FROM t1; +DROP TABLE t1; +DROP TABLE t2; diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 8350122c4e2..c90935f4cf9 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -362,7 +362,6 @@ bool check_merge_table_access(THD *thd, char *db, TABLE_LIST *table_list); int multi_update_precheck(THD *thd, TABLE_LIST *tables); int multi_delete_precheck(THD *thd, TABLE_LIST *tables, uint *table_count); -int insert_select_precheck(THD *thd, TABLE_LIST *tables); int update_precheck(THD *thd, TABLE_LIST *tables); int delete_precheck(THD *thd, TABLE_LIST *tables); int insert_precheck(THD *thd, TABLE_LIST *tables); diff --git a/sql/sql_class.h b/sql/sql_class.h index 419c087afbc..169835f3324 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -1238,6 +1238,16 @@ class select_insert :public select_result_interceptor { bzero((char*) &info,sizeof(info)); info.handle_duplicates=duplic; } + select_insert(TABLE *table_par, List *fields_par, + List *update_fields, List *update_values, + enum_duplicates duplic) + :table(table_par), fields(fields_par), last_insert_id(0) + { + bzero((char*) &info,sizeof(info)); + info.handle_duplicates=duplic; + info.update_fields= update_fields; + info.update_values= update_values; + } ~select_insert(); int prepare(List &list, SELECT_LEX_UNIT *u); bool send_data(List &items); diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 768acb0cf9e..ce64890523a 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -197,15 +197,6 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list, thd->used_tables=0; values= its++; - if (duplic == DUP_UPDATE && !table->insert_values) - { - /* it should be allocated before Item::fix_fields() */ - table->insert_values= - (byte *)alloc_root(thd->mem_root, table->rec_buff_length); - if (!table->insert_values) - goto abort; - } - if (mysql_prepare_insert(thd, table_list, insert_table_list, table, fields, values, update_fields, update_values, duplic)) @@ -448,14 +439,24 @@ int mysql_prepare_insert(THD *thd, TABLE_LIST *table_list, enum_duplicates duplic) { DBUG_ENTER("mysql_prepare_insert"); - if (check_insert_fields(thd, table, fields, *values, 1) || + if (duplic == DUP_UPDATE && !table->insert_values) + { + /* it should be allocated before Item::fix_fields() */ + table->insert_values= + (byte *)alloc_root(thd->mem_root, table->rec_buff_length); + if (!table->insert_values) + DBUG_RETURN(-1); + } + if ((values && check_insert_fields(thd, table, fields, *values, 1)) || setup_tables(insert_table_list) || - setup_fields(thd, 0, insert_table_list, *values, 0, 0, 0) || + (values && setup_fields(thd, 0, insert_table_list, *values, 0, 0, 0)) || (duplic == DUP_UPDATE && (setup_fields(thd, 0, insert_table_list, update_fields, 1, 0, 0) || setup_fields(thd, 0, insert_table_list, update_values, 1, 0, 0)))) DBUG_RETURN(-1); - if (find_real_table_in_list(table_list->next, + if ((thd->lex->sql_command==SQLCOM_INSERT || + thd->lex->sql_command==SQLCOM_REPLACE) && + find_real_table_in_list(table_list->next, table_list->db, table_list->real_name)) { my_error(ER_UPDATE_TABLE_USED, MYF(0), table_list->real_name); @@ -550,8 +551,10 @@ int write_record(TABLE *table,COPY_INFO *info) that matches, is updated. If update causes a conflict again, an error is returned */ + DBUG_ASSERT(table->insert_values != NULL); store_record(table,insert_values); restore_record(table,record[1]); + DBUG_ASSERT(info->update_fields->elements==info->update_values->elements); if (fill_record(*info->update_fields, *info->update_values, 0)) goto err; if ((error=table->file->update_row(table->record[1],table->record[0]))) diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index 1d9afcc94a4..d2ac0df1472 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -123,6 +123,7 @@ void lex_start(THD *thd, uchar *buf,uint length) lex->unit.thd= thd; lex->select_lex.init_query(); lex->value_list.empty(); + lex->update_list.empty(); lex->param_list.empty(); lex->unit.next= lex->unit.master= lex->unit.link_next= lex->unit.return_to= 0; diff --git a/sql/sql_lex.h b/sql/sql_lex.h index b055a022eb4..8421be7e735 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -587,7 +587,7 @@ typedef struct st_lex List columns; List key_list; List create_list; - List *insert_list,field_list,value_list; + List *insert_list,field_list,value_list,update_list; List many_values; List var_list; List param_list; diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index e73c3d95b42..8dc1339993e 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -2717,7 +2717,7 @@ unsent_create_error: if ((res= insert_precheck(thd, tables))) break; res = mysql_insert(thd,tables,lex->field_list,lex->many_values, - select_lex->item_list, lex->value_list, + lex->update_list, lex->value_list, lex->duplicates); if (thd->net.report_error) res= -1; @@ -2727,7 +2727,7 @@ unsent_create_error: case SQLCOM_INSERT_SELECT: { TABLE_LIST *first_local_table= (TABLE_LIST *) select_lex->table_list.first; - if ((res= insert_select_precheck(thd, tables))) + if ((res= insert_precheck(thd, tables))) break; /* Fix lock for first table */ @@ -2749,11 +2749,16 @@ unsent_create_error: select_lex->options |= OPTION_BUFFER_RESULT; } - if (!(res= open_and_lock_tables(thd, tables)) && + !(res= mysql_prepare_insert(thd, tables, first_local_table, + tables->table, lex->field_list, 0, + lex->update_list, lex->value_list, + lex->duplicates)) && (result= new select_insert(tables->table, &lex->field_list, + &lex->update_list, &lex->value_list, lex->duplicates))) { + TABLE *table= tables->table; /* Skip first table, which is the table we are inserting in */ lex->select_lex.table_list.first= (byte*) first_local_table->next; /* @@ -2766,6 +2771,7 @@ unsent_create_error: lex->select_lex.table_list.first= (byte*) first_local_table; lex->select_lex.resolve_mode= SELECT_LEX::INSERT_MODE; delete result; + table->insert_values= 0; if (thd->net.report_error) res= -1; } @@ -5304,33 +5310,6 @@ int multi_delete_precheck(THD *thd, TABLE_LIST *tables, uint *table_count) } -/* - INSERT ... SELECT query pre-check - - SYNOPSIS - insert_delete_precheck() - thd Thread handler - tables Global table list - - RETURN VALUE - 0 OK - 1 Error (message is sent to user) - -1 Error (message is not sent to user) -*/ - -int insert_select_precheck(THD *thd, TABLE_LIST *tables) -{ - DBUG_ENTER("insert_select_precheck"); - /* - Check that we have modify privileges for the first table and - select privileges for the rest - */ - ulong privilege= (thd->lex->duplicates == DUP_REPLACE ? - INSERT_ACL | DELETE_ACL : INSERT_ACL); - DBUG_RETURN(check_one_table_access(thd, privilege, tables) ? 1 : 0); -} - - /* simple UPDATE query pre-check @@ -5402,6 +5381,10 @@ int insert_precheck(THD *thd, TABLE_LIST *tables) LEX *lex= thd->lex; DBUG_ENTER("insert_precheck"); + /* + Check that we have modify privileges for the first table and + select privileges for the rest + */ ulong privilege= INSERT_ACL | (lex->duplicates == DUP_REPLACE ? DELETE_ACL : 0) | (lex->duplicates == DUP_UPDATE ? UPDATE_ACL : 0); @@ -5409,7 +5392,7 @@ int insert_precheck(THD *thd, TABLE_LIST *tables) if (check_one_table_access(thd, privilege, tables)) DBUG_RETURN(1); - if (lex->select_lex.item_list.elements != lex->value_list.elements) + if (lex->update_list.elements != lex->value_list.elements) { my_error(ER_WRONG_VALUE_COUNT, MYF(0)); DBUG_RETURN(-1); diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index bcb9d18d827..f4a96d751cd 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -1343,7 +1343,7 @@ static int mysql_test_insert_select(Prepared_statement *stmt, { int res; LEX *lex= stmt->lex; - if ((res= insert_select_precheck(stmt->thd, tables))) + if ((res= insert_precheck(stmt->thd, tables))) return res; TABLE_LIST *first_local_table= (TABLE_LIST *)lex->select_lex.table_list.first; diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 1b629e72ecc..a09694ee1e6 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -4161,21 +4161,8 @@ expr_or_default: opt_insert_update: /* empty */ - | ON DUPLICATE_SYM - { - LEX *lex= Lex; - /* - For simplicity, let's forget about INSERT ... SELECT ... UPDATE - for a moment. - */ - if (lex->sql_command != SQLCOM_INSERT) - { - yyerror(ER(ER_SYNTAX_ERROR)); - YYABORT; - } - lex->duplicates= DUP_UPDATE; - } - KEY_SYM UPDATE_SYM update_list + | ON DUPLICATE_SYM { Lex->duplicates= DUP_UPDATE; } + KEY_SYM UPDATE_SYM insert_update_list ; /* Update rows in a table */ @@ -4211,16 +4198,28 @@ update: ; update_list: - update_list ',' simple_ident equal expr_or_default + update_list ',' update_elem + | update_elem; + +update_elem: + simple_ident equal expr_or_default { - if (add_item_to_list(YYTHD, $3) || add_value_to_list(YYTHD, $5)) + if (add_item_to_list(YYTHD, $1) || add_value_to_list(YYTHD, $3)) YYABORT; - } - | simple_ident equal expr_or_default - { - if (add_item_to_list(YYTHD, $1) || add_value_to_list(YYTHD, $3)) - YYABORT; - }; + }; + +insert_update_list: + insert_update_list ',' insert_update_elem + | insert_update_elem; + +insert_update_elem: + simple_ident equal expr_or_default + { + LEX *lex= Lex; + if (lex->update_list.push_back($1) || + lex->value_list.push_back($3)) + YYABORT; + }; opt_low_priority: /* empty */ { $$= YYTHD->update_lock_default; } From ca4d47dc086902c109259cc6e870a63616ed5c59 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 13 Dec 2004 13:43:28 +0100 Subject: [PATCH 0492/1063] fixed event thread for better error handling --- ndb/src/mgmclient/CommandInterpreter.cpp | 41 +++++++++++++++++------- 1 file changed, 30 insertions(+), 11 deletions(-) diff --git a/ndb/src/mgmclient/CommandInterpreter.cpp b/ndb/src/mgmclient/CommandInterpreter.cpp index a169d21f97c..0c7fe642e54 100644 --- a/ndb/src/mgmclient/CommandInterpreter.cpp +++ b/ndb/src/mgmclient/CommandInterpreter.cpp @@ -465,6 +465,7 @@ event_thread_run(void* m) int fd = ndb_mgm_listen_event(handle, filter); if (fd > 0) { + do_event_thread= 1; char *tmp= 0; char buf[1024]; SocketInputStream in(fd,10); @@ -474,6 +475,10 @@ event_thread_run(void* m) ndbout << tmp; } while(do_event_thread); } + else + { + do_event_thread= -1; + } my_thread_end(); NdbThread_Exit(0); @@ -494,24 +499,38 @@ CommandInterpreter::connect() && !ndb_mgm_connect(m_mgmsrv2, try_reconnect-1, 5, 1)) { - m_connected= true; - if (m_verbose) + assert(m_event_thread == 0); + assert(do_event_thread == 0); + do_event_thread= 0; + m_event_thread = NdbThread_Create(event_thread_run, + (void**)&m_mgmsrv2, + 32768, + "CommandInterpreted_event_thread", + NDB_THREAD_PRIO_LOW); + if (m_event_thread != 0) { - printf("Connected to Management Server at: %s:%d\n", - host, port); + int iter= 1000; // try for 30 seconds + while(do_event_thread == 0 && + iter-- > 0) + NdbSleep_MilliSleep(30); } + if (m_event_thread == 0 || + do_event_thread == 0 || + do_event_thread == -1) { - do_event_thread= 1; - m_event_thread = NdbThread_Create(event_thread_run, - (void**)&m_mgmsrv2, - 32768, - "CommandInterpreted_event_thread", - NDB_THREAD_PRIO_LOW); + printf("Warning, event thread startup failed, degraded printouts as result\n"); + do_event_thread= 0; } } else { - ndb_mgm_disconnect(m_mgmsrv); + printf("Warning, event connect failed, degraded printouts as result\n"); + } + m_connected= true; + if (m_verbose) + { + printf("Connected to Management Server at: %s:%d\n", + host, port); } } } From 4d3362b431c16058d355917a291636eed7b05c60 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 13 Dec 2004 14:54:13 +0200 Subject: [PATCH 0493/1063] fixed parameter to avoid accessing unallocated memory --- sql/sql_select.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/sql_select.cc b/sql/sql_select.cc index ba2a227bf95..f2499966815 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -1418,7 +1418,7 @@ JOIN::exec() WHERE clause for any tables after the sorted one. */ JOIN_TAB *curr_table= &curr_join->join_tab[curr_join->const_tables+1]; - JOIN_TAB *end_table= &curr_join->join_tab[tables]; + JOIN_TAB *end_table= &curr_join->join_tab[curr_join->tables]; for (; curr_table < end_table ; curr_table++) { /* From fe6baf9f60c268adc971c4f628a3cc918ce32cfa Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 13 Dec 2004 13:58:58 +0100 Subject: [PATCH 0494/1063] changed back to just restricting max meta objects in dict to make sure we can "always" configure ourselves out of unforseen limits ndb/src/kernel/vm/Configuration.cpp: changed back to just restricting mac meta objects in dict to make sure we can "always" confiure ourselves out of unforseen limits --- ndb/src/kernel/vm/Configuration.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ndb/src/kernel/vm/Configuration.cpp b/ndb/src/kernel/vm/Configuration.cpp index 931b4da5a17..25b6ed272f9 100644 --- a/ndb/src/kernel/vm/Configuration.cpp +++ b/ndb/src/kernel/vm/Configuration.cpp @@ -609,8 +609,9 @@ Configuration::calcSizeAlt(ConfigValues * ownConfig){ Uint32 noOfMetaTables= noOfTables + noOfOrderedIndexes + noOfUniqueHashIndexes; - if (noOfMetaTables > MAX_TABLES) - noOfMetaTables= MAX_TABLES; + Uint32 noOfMetaTablesDict= noOfMetaTables; + if (noOfMetaTablesDict > MAX_TABLES) + noOfMetaTablesDict= MAX_TABLES; { /** @@ -619,8 +620,8 @@ Configuration::calcSizeAlt(ConfigValues * ownConfig){ cfg.put(CFG_DICT_ATTRIBUTE, noOfAttributes); - cfg.put(CFG_DICT_TABLE, - noOfMetaTables); + cfg.put(CFG_DICT_TABLE, + noOfMetaTablesDict); } From 8621164bd1c53c7b0d629142d8f91e8c74a97bb6 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 13 Dec 2004 15:05:52 +0200 Subject: [PATCH 0495/1063] comment of class edded --- sql/item.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sql/item.h b/sql/item.h index 3ae1da23f15..7a288473533 100644 --- a/sql/item.h +++ b/sql/item.h @@ -890,6 +890,10 @@ public: }; +/* + The same as Item_ref, but get value from val_* family of method to get + value of item on which it referred instead of result* family. +*/ class Item_direct_ref :public Item_ref { public: From f61f828cc52e73608becf7b30acd83674412afef Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 13 Dec 2004 14:26:39 +0100 Subject: [PATCH 0496/1063] BackupInit.cpp: quick fix for wrong allocation of size ndb/src/kernel/blocks/backup/BackupInit.cpp: quick fix for wrong allocation of size --- ndb/src/kernel/blocks/backup/BackupInit.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ndb/src/kernel/blocks/backup/BackupInit.cpp b/ndb/src/kernel/blocks/backup/BackupInit.cpp index f1130c3e8a7..37c579bfe84 100644 --- a/ndb/src/kernel/blocks/backup/BackupInit.cpp +++ b/ndb/src/kernel/blocks/backup/BackupInit.cpp @@ -44,7 +44,8 @@ Backup::Backup(const Configuration & conf) : Uint32 noBackups = 0, noTables = 0, noAttribs = 0; ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_DB_DISCLESS, &m_diskless)); ndb_mgm_get_int_parameter(p, CFG_DB_PARALLEL_BACKUPS, &noBackups); - ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_DB_NO_TABLES, &noTables)); + // ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_DB_NO_TABLES, &noTables)); + ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_DICT_TABLE, &noTables)); ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_DB_NO_ATTRIBUTES, &noAttribs)); noAttribs++; //RT 527 bug fix From 36c7c702fc7e04d66e2734c8ab2fb31d5483f9d4 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 13 Dec 2004 15:10:54 +0100 Subject: [PATCH 0497/1063] correcting --expire_logs_days description in mysqld --help --- sql/mysqld.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index da834080bc0..f349f672ba8 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -4758,7 +4758,8 @@ replicating a LOAD DATA INFILE command.", (gptr*) &delayed_queue_size, (gptr*) &delayed_queue_size, 0, GET_ULONG, REQUIRED_ARG, DELAYED_QUEUE_SIZE, 1, ~0L, 0, 1, 0}, {"expire_logs_days", OPT_EXPIRE_LOGS_DAYS, - "Binary logs will be rotated after expire-log-days days ", + "If non-zero, binary logs will be purged after expire_logs_days " + "days; possible purges happen at startup and at binary log rotation.", (gptr*) &expire_logs_days, (gptr*) &expire_logs_days, 0, GET_ULONG, REQUIRED_ARG, 0, 0, 99, 0, 1, 0}, From 6d7fe8520a938d92a6a7b0e569e8f56d926936ac Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 13 Dec 2004 20:06:06 +0300 Subject: [PATCH 0498/1063] Merging fix for BUG#6976 from 4.0 to 4.1 The problem in 4.1 was the same as in 4.0 - fix_fields() not called for created Item_ref. The fix is similar too - initialize Item_refs in ctor (but don't interfere with cases when Item_ref is used by subselects). sql/item.cc: Fix for BUG#6976 ported from 4.0 sql/item_cmpfunc.cc: Fix for BUG#6976 ported from 4.0 sql/item_func.cc: Fix for BUG#6976 ported from 4.0 sql/item_row.cc: Fix for BUG#6976 ported from 4.0 sql/item_strfunc.cc: Fix for BUG#6976 ported from 4.0 --- sql/item.cc | 4 ++-- sql/item.h | 21 +++++++++++++++++++++ sql/item_cmpfunc.cc | 3 ++- sql/item_func.cc | 2 +- sql/item_row.cc | 3 ++- sql/item_strfunc.cc | 2 +- 6 files changed, 29 insertions(+), 6 deletions(-) diff --git a/sql/item.cc b/sql/item.cc index 31c35e87cd4..85e200920f1 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -1488,9 +1488,9 @@ bool Item_field::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref) "forward reference in item list"); return -1; } - Item_ref *rf= new Item_ref(last->ref_pointer_array + counter, - (char *)table_name, (char *)field_name); + (char *)table_name, (char *)field_name, + this); if (!rf) return 1; thd->change_item_tree(ref, rf); diff --git a/sql/item.h b/sql/item.h index 3c4f80e3857..cf697f59727 100644 --- a/sql/item.h +++ b/sql/item.h @@ -835,6 +835,26 @@ public: :Item_ident(db_par, table_name_par, field_name_par), ref(0) {} Item_ref(Item **item, const char *table_name_par, const char *field_name_par) :Item_ident(NullS, table_name_par, field_name_par), ref(item) {} + + /* + This constructor is used when processing GROUP BY and referred Item is + available. We set all properties here because fix_fields() will not be + called for the created Item_ref. (see BUG#6976) + TODO check if we could get rid of *_name_par parameters and if we need to + perform similar initialization for other ctors. + TODO we probably fix a superset of problems like in BUG#6658. Check this + with Bar, and if we have a more broader set of problems like this. + */ + Item_ref(Item **item, const char *table_name_par, + const char *field_name_par, Item *src) + : Item_ident(NullS, table_name_par, field_name_par), ref(item) + { + collation.set(src->collation); + max_length= src->max_length; + decimals= src->decimals; + with_sum_func= src->with_sum_func; + maybe_null= src->maybe_null; + } /* Constructor need to process subselect with temporary tables (see Item) */ Item_ref(THD *thd, Item_ref *item) :Item_ident(thd, item), ref(item->ref) {} enum Type type() const { return REF_ITEM; } @@ -890,6 +910,7 @@ public: }; class Item_in_subselect; + class Item_ref_null_helper: public Item_ref { protected: diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index 51212418b09..b225889d916 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -2022,7 +2022,8 @@ void Item_cond::split_sum_func(THD *thd, Item **ref_pointer_array, { Item **ref= li.ref(); uint el= fields.elements; - Item *new_item= new Item_ref(ref_pointer_array + el, 0, item->name); + Item *new_item= new Item_ref(ref_pointer_array + el, 0, item->name, + item); fields.push_front(item); ref_pointer_array[el]= item; thd->change_item_tree(ref, new_item); diff --git a/sql/item_func.cc b/sql/item_func.cc index 98b204d1809..af53a771720 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -349,7 +349,7 @@ void Item_func::split_sum_func(THD *thd, Item **ref_pointer_array, else if (item->used_tables() || item->type() == SUM_FUNC_ITEM) { uint el= fields.elements; - Item *new_item= new Item_ref(ref_pointer_array + el, 0, item->name); + Item *new_item= new Item_ref(ref_pointer_array + el, 0, item->name, item); new_item->collation.set(item->collation); fields.push_front(item); ref_pointer_array[el]= item; diff --git a/sql/item_row.cc b/sql/item_row.cc index 289efe45300..b65b0b7b608 100644 --- a/sql/item_row.cc +++ b/sql/item_row.cc @@ -95,7 +95,8 @@ void Item_row::split_sum_func(THD *thd, Item **ref_pointer_array, else if ((*arg)->used_tables() || (*arg)->type() == SUM_FUNC_ITEM) { uint el= fields.elements; - Item *new_item= new Item_ref(ref_pointer_array + el, 0, (*arg)->name); + Item *new_item= new Item_ref(ref_pointer_array + el, 0, (*arg)->name, + *arg); fields.push_front(*arg); ref_pointer_array[el]= *arg; thd->change_item_tree(arg, new_item); diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index aaeeb9d8bb8..82cbd1fed72 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -1748,7 +1748,7 @@ void Item_func_make_set::split_sum_func(THD *thd, Item **ref_pointer_array, else if (item->used_tables() || item->type() == SUM_FUNC_ITEM) { uint el= fields.elements; - Item *new_item= new Item_ref(ref_pointer_array + el, 0, item->name); + Item *new_item= new Item_ref(ref_pointer_array + el, 0, item->name,item); fields.push_front(item); ref_pointer_array[el]= item; thd->change_item_tree(&item, new_item); From 06cbb73f26c7eba54ef4a435b27bce5c4d2a6cdf Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 13 Dec 2004 20:25:26 +0300 Subject: [PATCH 0499/1063] Merged fixes for BUG#6976 and BUG#7079 --- sql/item.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sql/item.h b/sql/item.h index 119fad83746..52a644677a6 100644 --- a/sql/item.h +++ b/sql/item.h @@ -922,6 +922,10 @@ public: :Item_ref(item, table_name_par, field_name_par) {} /* Constructor need to process subselect with temporary tables (see Item) */ Item_direct_ref(THD *thd, Item_direct_ref *item) : Item_ref(thd, item) {} + Item_direct_ref(Item **item, const char *table_name_par, + const char *field_name_par, Item *src) + : Item_ref(item, table_name_par, field_name_par, src) {} + double val() { double tmp=(*ref)->val(); From 6dad55159110c113df366e3b1dd377f30ae91efe Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 13 Dec 2004 13:48:37 -0600 Subject: [PATCH 0500/1063] Makefile.am: Add running of test suite with --ps-protocol to 'test' target Makefile.am: Add running of test suite with --ps-protocol to 'test' target --- Makefile.am | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index 0770854f176..6d089cee698 100644 --- a/Makefile.am +++ b/Makefile.am @@ -100,5 +100,8 @@ tags: # Test installation test: - cd mysql-test ; ./mysql-test-run + cd mysql-test + ./mysql-test-run + ./mysql-test-run --ps-protocol + From bd8f96f759a1b633de5d6359c824277663ebd3f3 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 13 Dec 2004 21:00:43 +0100 Subject: [PATCH 0501/1063] Small bug fix ps-modify1 used the user variables @1, @2, @100 set within ps_query and ps_modify. That architecture was wrong, because the dependence of ps_modify1 on ps_query and ps_modify makes the test script maintenance and the use of these test cases during bug fixing/ debugging of single sub test cases very uncomfortable. Therefore these user variables (@1, @2, @100) are also set within ps-modify1. The result files of the test cases ps_2myisam, ps_3innodb, ps_4heap, ps_6bdb, ps_7ndb will be affected by that change and show 3 additional lines, but nothing else will change. mysql-test/include/ps_modify1.inc: Initialization of three user variables, with values derived from ps_query and ps_modify mysql-test/r/ps_2myisam.result: updated result set mysql-test/r/ps_3innodb.result: updated result set mysql-test/r/ps_4heap.result: updated result sset mysql-test/r/ps_6bdb.result: updated result set mysql-test/r/ps_7ndb.result: updated result set --- mysql-test/include/ps_modify1.inc | 3 +++ mysql-test/r/ps_2myisam.result | 3 +++ mysql-test/r/ps_3innodb.result | 3 +++ mysql-test/r/ps_4heap.result | 3 +++ mysql-test/r/ps_6bdb.result | 3 +++ mysql-test/r/ps_7ndb.result | 3 +++ 6 files changed, 18 insertions(+) diff --git a/mysql-test/include/ps_modify1.inc b/mysql-test/include/ps_modify1.inc index 5fba7faa59a..345654b2d66 100644 --- a/mysql-test/include/ps_modify1.inc +++ b/mysql-test/include/ps_modify1.inc @@ -65,6 +65,9 @@ execute stmt1 using @1000, @duplicate, @5; select a,b from t1 where a >= 1000 order by a ; delete from t1 where a >= 1000 ; +set @1=1 ; +set @2=2 ; +set @100=100 ; set @float=1.00; set @five='five' ; --disable_warnings diff --git a/mysql-test/r/ps_2myisam.result b/mysql-test/r/ps_2myisam.result index 24c1102306f..c2799c6faed 100644 --- a/mysql-test/r/ps_2myisam.result +++ b/mysql-test/r/ps_2myisam.result @@ -1688,6 +1688,9 @@ a b 1003 duplicate three 1004 duplicate four delete from t1 where a >= 1000 ; +set @1=1 ; +set @2=2 ; +set @100=100 ; set @float=1.00; set @five='five' ; drop table if exists t2; diff --git a/mysql-test/r/ps_3innodb.result b/mysql-test/r/ps_3innodb.result index ad2912529a5..034cd75ea4b 100644 --- a/mysql-test/r/ps_3innodb.result +++ b/mysql-test/r/ps_3innodb.result @@ -1671,6 +1671,9 @@ a b 1003 duplicate three 1004 duplicate four delete from t1 where a >= 1000 ; +set @1=1 ; +set @2=2 ; +set @100=100 ; set @float=1.00; set @five='five' ; drop table if exists t2; diff --git a/mysql-test/r/ps_4heap.result b/mysql-test/r/ps_4heap.result index 123e3d58b38..60a9ddd2bf2 100644 --- a/mysql-test/r/ps_4heap.result +++ b/mysql-test/r/ps_4heap.result @@ -1672,6 +1672,9 @@ a b 1003 duplicate three 1004 duplicate four delete from t1 where a >= 1000 ; +set @1=1 ; +set @2=2 ; +set @100=100 ; set @float=1.00; set @five='five' ; drop table if exists t2; diff --git a/mysql-test/r/ps_6bdb.result b/mysql-test/r/ps_6bdb.result index 5f2419bdda5..baf273c84c0 100644 --- a/mysql-test/r/ps_6bdb.result +++ b/mysql-test/r/ps_6bdb.result @@ -1671,6 +1671,9 @@ a b 1003 duplicate three 1004 duplicate four delete from t1 where a >= 1000 ; +set @1=1 ; +set @2=2 ; +set @100=100 ; set @float=1.00; set @five='five' ; drop table if exists t2; diff --git a/mysql-test/r/ps_7ndb.result b/mysql-test/r/ps_7ndb.result index 41c55cac0ca..3dbe3ed6218 100644 --- a/mysql-test/r/ps_7ndb.result +++ b/mysql-test/r/ps_7ndb.result @@ -1671,6 +1671,9 @@ a b 1003 duplicate three 1004 duplicate four delete from t1 where a >= 1000 ; +set @1=1 ; +set @2=2 ; +set @100=100 ; set @float=1.00; set @five='five' ; drop table if exists t2; From 844c6e3495712e30a21090d481428f82ff39e51a Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 13 Dec 2004 14:03:19 -0600 Subject: [PATCH 0502/1063] Makefile.am: s/spaces/TAB/ Makefile.am: s/spaces/TAB/ --- Makefile.am | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile.am b/Makefile.am index 6d089cee698..b00b3747294 100644 --- a/Makefile.am +++ b/Makefile.am @@ -101,7 +101,7 @@ tags: test: cd mysql-test - ./mysql-test-run - ./mysql-test-run --ps-protocol + ./mysql-test-run + ./mysql-test-run --ps-protocol From 01e2c3f0994731ff552f93d36e6928cdcbf10148 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 13 Dec 2004 21:43:30 +0100 Subject: [PATCH 0503/1063] - a fix for the fix - now "make test" will run the test suite with and without the PS protocol --- Makefile.am | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Makefile.am b/Makefile.am index b00b3747294..c1ae9217e8b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -100,8 +100,4 @@ tags: # Test installation test: - cd mysql-test - ./mysql-test-run - ./mysql-test-run --ps-protocol - - + cd mysql-test; ./mysql-test-run && ./mysql-test-run --ps-protocol From 0e4868529124dd1048acf1cbf2b10edee0614fb3 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 14 Dec 2004 01:07:06 +0300 Subject: [PATCH 0504/1063] Merge of fix for BUG#6976 continued: pulling in some Item_ref changes from 5.0 * Added Item_ref::set_properties * Item_ref::Item_ref now expects to get in *item either NULL - then fix_fields() will be called later or ptr to Item it will refer to - then an equivalent of fix_fields() call is performed sql/item.cc: Merge of fix for BUG#6976 continued: pulling in some Item_ref changes from 5.0 * Added Item_ref::set_properties * Adjusted Item_ref::Item_ref calls to match new calling convention sql/item.h: Merge of fix for BUG#6976 continued: pulling in some Item_ref changes from 5.0 * Added Item_ref::set_properties * Item_ref::Item_ref now expects to get in *item either NULL - then fix_fields() will be called later or ptr to Item it will refer to - then an equivalent of fix_fields() call is performed sql/item_cmpfunc.cc: Merge of fix for BUG#6976 continued: pulling in some Item_ref changes from 5.0 * Adjusted Item_ref::Item_ref calls to match new calling convention sql/item_func.cc: Merge of fix for BUG#6976 continued: pulling in some Item_ref changes from 5.0 * Added Item_ref::set_properties * Adjusted Item_ref::Item_ref calls to match new calling convention sql/item_row.cc: Merge of fix for BUG#6976 continued: pulling in some Item_ref changes from 5.0 * Added Item_ref::set_properties * Adjusted Item_ref::Item_ref calls to match new calling convention sql/item_strfunc.cc: Merge of fix for BUG#6976 continued: pulling in some Item_ref changes from 5.0 * Added Item_ref::set_properties * Adjusted Item_ref::Item_ref calls to match new calling convention --- sql/item.cc | 29 +++++++++++++++++++++-------- sql/item.h | 41 ++++++++++++++++++++++------------------- sql/item_cmpfunc.cc | 4 ++-- sql/item_func.cc | 3 ++- sql/item_row.cc | 4 ++-- sql/item_strfunc.cc | 3 ++- 6 files changed, 51 insertions(+), 33 deletions(-) diff --git a/sql/item.cc b/sql/item.cc index ec637eb8bce..aa67219ab53 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -1488,16 +1488,24 @@ bool Item_field::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref) "forward reference in item list"); return -1; } + /* + Here, a subset of actions performed by Item_ref::set_properties + is not enough. So we pass ptr to NULL into Item_[direct]_ref ctor, + so no initialization is performed, and call fix_fields() below. + */ + Item *save= last->ref_pointer_array[counter]; + last->ref_pointer_array[counter]= NULL; Item_ref *rf= (place == IN_HAVING ? new Item_ref(last->ref_pointer_array + counter, (char *)table_name, - (char *)field_name, this) : + (char *)field_name) : new Item_direct_ref(last->ref_pointer_array + counter, (char *)table_name, - (char *)field_name, this)); + (char *)field_name)); if (!rf) return 1; thd->change_item_tree(ref, rf); + last->ref_pointer_array[counter]= save; /* rf is Item_ref => never substitute other items (in this case) during fix_fields() => we can use rf after fix_fields() @@ -2220,18 +2228,23 @@ bool Item_ref::fix_fields(THD *thd,TABLE_LIST *tables, Item **reference) "forward reference in item list")); return 1; } - max_length= (*ref)->max_length; - maybe_null= (*ref)->maybe_null; - decimals= (*ref)->decimals; - collation.set((*ref)->collation); - with_sum_func= (*ref)->with_sum_func; - fixed= 1; + + set_properties(); if (ref && (*ref)->check_cols(1)) return 1; return 0; } +void Item_ref::set_properties() +{ + max_length= (*ref)->max_length; + maybe_null= (*ref)->maybe_null; + decimals= (*ref)->decimals; + collation.set((*ref)->collation); + with_sum_func= (*ref)->with_sum_func; + fixed= 1; +} void Item_ref::print(String *str) { diff --git a/sql/item.h b/sql/item.h index 52a644677a6..2411904a00f 100644 --- a/sql/item.h +++ b/sql/item.h @@ -827,34 +827,35 @@ public: class Item_ref :public Item_ident { +protected: + void set_properties(); public: Field *result_field; /* Save result here */ Item **ref; Item_ref(const char *db_par, const char *table_name_par, const char *field_name_par) :Item_ident(db_par, table_name_par, field_name_par), ref(0) {} - Item_ref(Item **item, const char *table_name_par, const char *field_name_par) - :Item_ident(NullS, table_name_par, field_name_par), ref(item) {} - /* - This constructor is used when processing GROUP BY and referred Item is - available. We set all properties here because fix_fields() will not be - called for the created Item_ref. (see BUG#6976) - TODO check if we could get rid of *_name_par parameters and if we need to - perform similar initialization for other ctors. + This constructor is used in two scenarios: + A) *item = NULL + No initialization is performed, fix_fields() call will be necessary. + + B) *item points to an Item this Item_ref will refer to. This is + used for GROUP BY. fix_fields() will not be called in this case, + so we call set_properties to make this item "fixed". set_properties + performs a subset of action Item_ref::fix_fields does, and this subset + is enough for Item_ref's used in GROUP BY. + TODO we probably fix a superset of problems like in BUG#6658. Check this with Bar, and if we have a more broader set of problems like this. */ - Item_ref(Item **item, const char *table_name_par, - const char *field_name_par, Item *src) - : Item_ident(NullS, table_name_par, field_name_par), ref(item) + Item_ref(Item **item, const char *table_name_par, const char *field_name_par) + :Item_ident(NullS, table_name_par, field_name_par), ref(item) { - collation.set(src->collation); - max_length= src->max_length; - decimals= src->decimals; - with_sum_func= src->with_sum_func; - maybe_null= src->maybe_null; + if (*item) + set_properties(); } + /* Constructor need to process subselect with temporary tables (see Item) */ Item_ref(THD *thd, Item_ref *item) :Item_ident(thd, item), ref(item->ref) {} enum Type type() const { return REF_ITEM; } @@ -862,29 +863,34 @@ public: { return ref && (*ref)->eq(item, binary_cmp); } double val() { + DBUG_ASSERT(fixed); double tmp=(*ref)->val_result(); null_value=(*ref)->null_value; return tmp; } longlong val_int() { + DBUG_ASSERT(fixed); longlong tmp=(*ref)->val_int_result(); null_value=(*ref)->null_value; return tmp; } String *val_str(String* tmp) { + DBUG_ASSERT(fixed); tmp=(*ref)->str_result(tmp); null_value=(*ref)->null_value; return tmp; } bool is_null() { + DBUG_ASSERT(fixed); (void) (*ref)->val_int_result(); return (*ref)->null_value; } bool get_date(TIME *ltime,uint fuzzydate) { + DBUG_ASSERT(fixed); return (null_value=(*ref)->get_date_result(ltime,fuzzydate)); } bool send(Protocol *prot, String *tmp){ return (*ref)->send(prot, tmp); } @@ -922,9 +928,6 @@ public: :Item_ref(item, table_name_par, field_name_par) {} /* Constructor need to process subselect with temporary tables (see Item) */ Item_direct_ref(THD *thd, Item_direct_ref *item) : Item_ref(thd, item) {} - Item_direct_ref(Item **item, const char *table_name_par, - const char *field_name_par, Item *src) - : Item_ref(item, table_name_par, field_name_par, src) {} double val() { diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index 0b824178afd..26ed8f4e9c1 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -2022,8 +2022,8 @@ void Item_cond::split_sum_func(THD *thd, Item **ref_pointer_array, { Item **ref= li.ref(); uint el= fields.elements; - Item *new_item= new Item_ref(ref_pointer_array + el, 0, item->name, - item); + ref_pointer_array[el]= item; + Item *new_item= new Item_ref(ref_pointer_array + el, 0, item->name); fields.push_front(item); ref_pointer_array[el]= item; thd->change_item_tree(ref, new_item); diff --git a/sql/item_func.cc b/sql/item_func.cc index af53a771720..8220db40ecb 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -349,7 +349,8 @@ void Item_func::split_sum_func(THD *thd, Item **ref_pointer_array, else if (item->used_tables() || item->type() == SUM_FUNC_ITEM) { uint el= fields.elements; - Item *new_item= new Item_ref(ref_pointer_array + el, 0, item->name, item); + ref_pointer_array[el]= item; + Item *new_item= new Item_ref(ref_pointer_array + el, 0, item->name); new_item->collation.set(item->collation); fields.push_front(item); ref_pointer_array[el]= item; diff --git a/sql/item_row.cc b/sql/item_row.cc index b65b0b7b608..4e4957b980e 100644 --- a/sql/item_row.cc +++ b/sql/item_row.cc @@ -95,8 +95,8 @@ void Item_row::split_sum_func(THD *thd, Item **ref_pointer_array, else if ((*arg)->used_tables() || (*arg)->type() == SUM_FUNC_ITEM) { uint el= fields.elements; - Item *new_item= new Item_ref(ref_pointer_array + el, 0, (*arg)->name, - *arg); + ref_pointer_array[el]=*arg; + Item *new_item= new Item_ref(ref_pointer_array + el, 0, (*arg)->name); fields.push_front(*arg); ref_pointer_array[el]= *arg; thd->change_item_tree(arg, new_item); diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 82cbd1fed72..e1b063cd5e0 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -1748,7 +1748,8 @@ void Item_func_make_set::split_sum_func(THD *thd, Item **ref_pointer_array, else if (item->used_tables() || item->type() == SUM_FUNC_ITEM) { uint el= fields.elements; - Item *new_item= new Item_ref(ref_pointer_array + el, 0, item->name,item); + ref_pointer_array[el]=item; + Item *new_item= new Item_ref(ref_pointer_array + el, 0, item->name); fields.push_front(item); ref_pointer_array[el]= item; thd->change_item_tree(&item, new_item); From 8322eb0aaaf410819da5eaa95ecd5e3b6ce3c2b0 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 14 Dec 2004 03:36:19 +0300 Subject: [PATCH 0505/1063] * Added comments and one assert * Backport of safety measures from 5.0: make numeorous replaces: s/item->fix_fields()/if (!item->fixed) item->fix_fields() sql/item.cc: * More comments * Backport of safety measures from 5.0: make numeorous replaces: s/item->fix_fields()/if (!item->fixed) item->fix_fields() sql/item.h: Assert added sql/item_cmpfunc.cc: Backport of safety measures from 5.0: make numeorous replaces: s/item->fix_fields()/if (!item->fixed) item->fix_fields() sql/item_func.cc: Backport of safety measures from 5.0: make numeorous replaces: s/item->fix_fields()/if (!item->fixed) item->fix_fields() sql/item_strfunc.h: Backport of safety measures from 5.0: make numeorous replaces: s/item->fix_fields()/if (!item->fixed) item->fix_fields() sql/item_subselect.cc: Backport of safety measures from 5.0: make numeorous replaces: s/item->fix_fields()/if (!item->fixed) item->fix_fields() sql/item_sum.cc: Backport of safety measures from 5.0: make numeorous replaces: s/item->fix_fields()/if (!item->fixed) item->fix_fields() sql/set_var.cc: Backport of safety measures from 5.0: make numeorous replaces: s/item->fix_fields()/if (!item->fixed) item->fix_fields() sql/sql_base.cc: Backport of safety measures from 5.0: make numeorous replaces: s/item->fix_fields()/if (!item->fixed) item->fix_fields() sql/sql_handler.cc: Backport of safety measures from 5.0: make numeorous replaces: s/item->fix_fields()/if (!item->fixed) item->fix_fields() sql/sql_help.cc: Backport of safety measures from 5.0: make numeorous replaces: s/item->fix_fields()/if (!item->fixed) item->fix_fields() sql/sql_select.cc: Backport of safety measures from 5.0: make numeorous replaces: s/item->fix_fields()/if (!item->fixed) item->fix_fields() --- sql/item.cc | 9 +++++---- sql/item.h | 1 + sql/item_cmpfunc.cc | 6 ++++-- sql/item_func.cc | 4 ++-- sql/item_strfunc.h | 3 ++- sql/item_subselect.cc | 3 ++- sql/item_sum.cc | 4 +++- sql/set_var.cc | 6 ++++-- sql/sql_base.cc | 6 ++++-- sql/sql_handler.cc | 6 ++++-- sql/sql_help.cc | 3 ++- sql/sql_select.cc | 3 ++- 12 files changed, 35 insertions(+), 19 deletions(-) diff --git a/sql/item.cc b/sql/item.cc index aa67219ab53..92a15694e89 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -1490,8 +1490,9 @@ bool Item_field::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref) } /* Here, a subset of actions performed by Item_ref::set_properties - is not enough. So we pass ptr to NULL into Item_[direct]_ref ctor, - so no initialization is performed, and call fix_fields() below. + is not enough. So we pass ptr to NULL into Item_[direct]_ref + constructor, so no initialization is performed, and call + fix_fields() below. */ Item *save= last->ref_pointer_array[counter]; last->ref_pointer_array[counter]= NULL; @@ -2291,7 +2292,7 @@ bool Item_default_value::fix_fields(THD *thd, fixed= 1; return 0; } - if (arg->fix_fields(thd, table_list, &arg)) + if (!arg->fixed && arg->fix_fields(thd, table_list, &arg)) return 1; if (arg->type() == REF_ITEM) @@ -2338,7 +2339,7 @@ bool Item_insert_value::fix_fields(THD *thd, Item **items) { DBUG_ASSERT(fixed == 0); - if (arg->fix_fields(thd, table_list, &arg)) + if (!arg->fixed && arg->fix_fields(thd, table_list, &arg)) return 1; if (arg->type() == REF_ITEM) diff --git a/sql/item.h b/sql/item.h index 2411904a00f..71b92cd1efc 100644 --- a/sql/item.h +++ b/sql/item.h @@ -852,6 +852,7 @@ public: Item_ref(Item **item, const char *table_name_par, const char *field_name_par) :Item_ident(NullS, table_name_par, field_name_par), ref(item) { + DBUG_ASSERT(item); if (*item) set_properties(); } diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index 26ed8f4e9c1..a135f08ae45 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -2374,8 +2374,10 @@ bool Item_func_regex::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref) { DBUG_ASSERT(fixed == 0); - if (args[0]->fix_fields(thd, tables, args) || args[0]->check_cols(1) || - args[1]->fix_fields(thd,tables, args + 1) || args[1]->check_cols(1)) + if ((!args[0]->fixed && + args[0]->fix_fields(thd, tables, args)) || args[0]->check_cols(1) || + (!args[1]->fixed && + args[1]->fix_fields(thd,tables, args + 1)) || args[1]->check_cols(1)) return 1; /* purecov: inspected */ with_sum_func=args[0]->with_sum_func || args[1]->with_sum_func; max_length= 1; diff --git a/sql/item_func.cc b/sql/item_func.cc index 8220db40ecb..2d939f47716 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -351,7 +351,6 @@ void Item_func::split_sum_func(THD *thd, Item **ref_pointer_array, uint el= fields.elements; ref_pointer_array[el]= item; Item *new_item= new Item_ref(ref_pointer_array + el, 0, item->name); - new_item->collation.set(item->collation); fields.push_front(item); ref_pointer_array[el]= item; thd->change_item_tree(arg, new_item); @@ -1664,7 +1663,8 @@ udf_handler::fix_fields(THD *thd, TABLE_LIST *tables, Item_result_field *func, arg != arg_end ; arg++,i++) { - if ((*arg)->fix_fields(thd, tables, arg)) + if (!(*arg)->fixed && + (*arg)->fix_fields(thd, tables, arg)) DBUG_RETURN(1); // we can't assign 'item' before, because fix_fields() can change arg Item *item= *arg; diff --git a/sql/item_strfunc.h b/sql/item_strfunc.h index 8efe60bbd89..698536a61c7 100644 --- a/sql/item_strfunc.h +++ b/sql/item_strfunc.h @@ -397,7 +397,8 @@ public: bool fix_fields(THD *thd, TABLE_LIST *tlist, Item **ref) { DBUG_ASSERT(fixed == 0); - return (item->fix_fields(thd, tlist, &item) || + return (!item->fixed && + item->fix_fields(thd, tlist, &item) || item->check_cols(1) || Item_func::fix_fields(thd, tlist, ref)); } diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index ffa3b072801..1d0f46fd196 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -766,7 +766,8 @@ Item_in_subselect::single_value_transformer(JOIN *join, // left expression belong to outer select SELECT_LEX *current= thd->lex->current_select, *up; thd->lex->current_select= up= current->return_after_parsing(); - if (left_expr->fix_fields(thd, up->get_table_list(), &left_expr)) + if (!left_expr->fixed && + left_expr->fix_fields(thd, up->get_table_list(), &left_expr)) { thd->lex->current_select= current; goto err; diff --git a/sql/item_sum.cc b/sql/item_sum.cc index 66d4fba205c..029a1fd6c48 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -1918,7 +1918,9 @@ Item_func_group_concat::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref) for (i=0 ; i < arg_count ; i++) { - if (args[i]->fix_fields(thd, tables, args + i) || args[i]->check_cols(1)) + if ((!args[i]->fixed && + args[i]->fix_fields(thd, tables, args + i)) || + args[i]->check_cols(1)) return 1; if (i < arg_count_field) maybe_null|= args[i]->maybe_null; diff --git a/sql/set_var.cc b/sql/set_var.cc index b7f410c207d..d10ea3e11c1 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -2799,7 +2799,8 @@ int set_var::check(THD *thd) return 0; } - if (value->fix_fields(thd, 0, &value) || value->check_cols(1)) + if ((!value->fixed && + value->fix_fields(thd, 0, &value)) || value->check_cols(1)) return -1; if (var->check_update_type(value->result_type())) { @@ -2834,7 +2835,8 @@ int set_var::light_check(THD *thd) if (type == OPT_GLOBAL && check_global_access(thd, SUPER_ACL)) return 1; - if (value && (value->fix_fields(thd, 0, &value) || value->check_cols(1))) + if (value && ((!value->fixed && value->fix_fields(thd, 0, &value)) || + value->check_cols(1))) return -1; return 0; } diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 05b11646cd7..5c71049e565 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -2684,7 +2684,8 @@ int setup_conds(THD *thd,TABLE_LIST *tables,COND **conds) thd->restore_backup_item_arena(arena, &backup); if (*conds && !(*conds)->fixed) { - if ((*conds)->fix_fields(thd, tables, conds)) + if (!(*conds)->fixed && + (*conds)->fix_fields(thd, tables, conds)) DBUG_RETURN(1); } } @@ -2696,7 +2697,8 @@ int setup_conds(THD *thd,TABLE_LIST *tables,COND **conds) thd->restore_backup_item_arena(arena, &backup); if (table->on_expr && !table->on_expr->fixed) { - if (table->on_expr->fix_fields(thd, tables, &table->on_expr)) + if (!table->on_expr->fixed && + table->on_expr->fix_fields(thd, tables, &table->on_expr)) DBUG_RETURN(1); } } diff --git a/sql/sql_handler.cc b/sql/sql_handler.cc index f98bb0a9131..f250a00eca1 100644 --- a/sql/sql_handler.cc +++ b/sql/sql_handler.cc @@ -429,7 +429,8 @@ int mysql_ha_read(THD *thd, TABLE_LIST *tables, } tables->table=table; - if (cond && (cond->fix_fields(thd, tables, &cond) || cond->check_cols(1))) + if (cond && ((!cond->fixed && + cond->fix_fields(thd, tables, &cond)) || cond->check_cols(1))) goto err0; table->file->init_table_handle_for_HANDLER(); // Only InnoDB requires it @@ -516,7 +517,8 @@ int mysql_ha_read(THD *thd, TABLE_LIST *tables, for (key_len=0 ; (item=it_ke++) ; key_part++) { // 'item' can be changed by fix_fields() call - if (item->fix_fields(thd, tables, it_ke.ref()) || + if ((!item->fixed && + item->fix_fields(thd, tables, it_ke.ref())) || (item= *it_ke.ref())->check_cols(1)) goto err; if (item->used_tables() & ~RAND_TABLE_BIT) diff --git a/sql/sql_help.cc b/sql/sql_help.cc index 04ecbbd43b9..0e0d32a922d 100644 --- a/sql/sql_help.cc +++ b/sql/sql_help.cc @@ -557,7 +557,8 @@ int send_variant_2_list(MEM_ROOT *mem_root, Protocol *protocol, SQL_SELECT *prepare_simple_select(THD *thd, Item *cond, TABLE_LIST *tables, TABLE *table, int *error) { - cond->fix_fields(thd, tables, &cond); // can never fail + if (!cond->fixed) + cond->fix_fields(thd, tables, &cond); // can never fail SQL_SELECT *res= make_select(table,0,0,cond,error); if (*error || (res && res->check_quick(thd, 0, HA_POS_ERROR))) { diff --git a/sql/sql_select.cc b/sql/sql_select.cc index f2499966815..2d701e668cf 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -8904,7 +8904,8 @@ static bool add_ref_to_table_cond(THD *thd, JOIN_TAB *join_tab) if (thd->is_fatal_error) DBUG_RETURN(TRUE); - cond->fix_fields(thd,(TABLE_LIST *) 0, (Item**)&cond); + if (!cond->fixed) + cond->fix_fields(thd,(TABLE_LIST *) 0, (Item**)&cond); if (join_tab->select) { error=(int) cond->add(join_tab->select->cond); From 7e7a2b32e8a9c3e784e6e3f3a6927635cd4ec9a8 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 14 Dec 2004 08:10:22 +0100 Subject: [PATCH 0506/1063] ndb - shm transporter benchmark result ndb/docs/wl2077.txt: Add result from micro benchmark with shm-transporter ndb/include/transporter/TransporterRegistry.hpp: Move pid into transporter registry ndb/src/common/transporter/SHM_Transporter.cpp: Move pid into transporter registry ndb/src/common/transporter/TransporterRegistry.cpp: Move pid into transporter registry ndb/src/kernel/main.cpp: Move pid into transporter registry ndb/src/ndbapi/TransporterFacade.cpp: Move pid into transporter registry --- ndb/docs/wl2077.txt | 33 +++++++++++++------ .../transporter/TransporterRegistry.hpp | 2 ++ .../common/transporter/SHM_Transporter.cpp | 6 ++-- .../transporter/TransporterRegistry.cpp | 6 ++-- ndb/src/kernel/main.cpp | 3 -- ndb/src/ndbapi/TransporterFacade.cpp | 4 --- 6 files changed, 31 insertions(+), 23 deletions(-) diff --git a/ndb/docs/wl2077.txt b/ndb/docs/wl2077.txt index 5a77c18aa2a..f5b10bb702e 100644 --- a/ndb/docs/wl2077.txt +++ b/ndb/docs/wl2077.txt @@ -3,18 +3,24 @@ 1 host, 1 ndbd, api co-hosted results in 1000 rows / sec - wo/reset bounds w/ rb -4.1-read committed a) 4.9 b) 7.4 -4.1-read hold lock c) 4.7 d) 6.7 + wo/reset bounds w/ rb +4.1-read committed a) 4.9 b) 7.4 +4.1-read hold lock c) 4.7 d) 6.7 -wl2077-read committed 6.4 (+30%) 10.8 (+45%) -wl2077-read hold lock 4.6 (-1%) 6.7 (+ 0%) +wl2077-read committed 6.4 (+30%) 10.8 (+45%) +wl2077-read hold lock 4.6 (-1%) 6.7 (+ 0%) --- Comparision e) -serial pk: 10.9' -batched (1000): 59' -serial uniq index: 8.4' -batched (1000): 33' +5.0-ndb batch read committed f) 50' (+680%) g) 50' (+360%) +5.0-ndb batch read hold lock h) 12' (+160%) i) 13' (+79%) + +shm-mem read committed (cmp. wl2077) a) 9.5' (+48%) b) 14' (+30%) + read hold lock c) 6.7' (+45%) d) 9.8' (+46%) + +-- Comparision e) shm +serial pk: 10.9' 20' (+83%) +batched (1000): 59' 62' (+5%) +serial uniq index: 8.4' 14' (+66%) +batched (1000): 33' 36' (+9%) index range (1000): 186' ---- @@ -25,6 +31,8 @@ b) testScanPerf -s 100000 -c 0 -d 0 -a 1 -l 0 -r 2 -q 1 T1 c) testScanPerf -s 100000 -c 0 -d 0 -a 1 -l 1 -r 2 -q 0 T1 d) testScanPerf -s 100000 -c 0 -d 0 -a 1 -l 1 -r 2 -q 1 T1 e) testReadPerf -i 25 -c 0 -d 0 T1 +f) testScanPerf -s 100000 -c 0 -d 0 -a 1 -l 0 -r 3 -q 0 -m 1000 -i 10 T1 +g) testScanPerf -s 100000 -c 0 -d 0 -a 1 -l 0 -r 3 -q 1 -m 1000 -i 10 T1 --- music join 1db-co 2db-co @@ -33,3 +41,8 @@ e) testReadPerf -i 25 -c 0 -d 0 T1 wl2077 12s 14s wl2077 wo/ blobs 1.2s (-30%) 2.5s (-22%) + +pekka-blob-fix 1.3s + +shm 1.2s 2.0s +shm wo/ blobs 1.1s 2.0s diff --git a/ndb/include/transporter/TransporterRegistry.hpp b/ndb/include/transporter/TransporterRegistry.hpp index ac6291f9e57..4ca288d0a0a 100644 --- a/ndb/include/transporter/TransporterRegistry.hpp +++ b/ndb/include/transporter/TransporterRegistry.hpp @@ -312,6 +312,8 @@ private: Uint32 poll_TCP(Uint32 timeOutMillis); Uint32 poll_SCI(Uint32 timeOutMillis); Uint32 poll_SHM(Uint32 timeOutMillis); + + int m_shm_own_pid; }; #endif // Define of TransporterRegistry_H diff --git a/ndb/src/common/transporter/SHM_Transporter.cpp b/ndb/src/common/transporter/SHM_Transporter.cpp index 7c2c2aafb85..e4051519b86 100644 --- a/ndb/src/common/transporter/SHM_Transporter.cpp +++ b/ndb/src/common/transporter/SHM_Transporter.cpp @@ -214,7 +214,8 @@ SHM_Transporter::connect_server_impl(NDB_SOCKET_TYPE sockfd) } // Send ok to client - s_output.println("shm server 1 ok: %d", g_shm_pid); + s_output.println("shm server 1 ok: %d", + m_transporter_registry.m_shm_own_pid); // Wait for ok from client if (s_input.gets(buf, 256) == 0) @@ -293,7 +294,8 @@ SHM_Transporter::connect_client_impl(NDB_SOCKET_TYPE sockfd) } // Send ok to server - s_output.println("shm client 1 ok: %d", g_shm_pid); + s_output.println("shm client 1 ok: %d", + m_transporter_registry.m_shm_own_pid); int r= connect_common(sockfd); diff --git a/ndb/src/common/transporter/TransporterRegistry.cpp b/ndb/src/common/transporter/TransporterRegistry.cpp index 61924fe55b2..77e72a4fa2c 100644 --- a/ndb/src/common/transporter/TransporterRegistry.cpp +++ b/ndb/src/common/transporter/TransporterRegistry.cpp @@ -1273,10 +1273,8 @@ TransporterRegistry::startReceiving() #endif #ifdef NDB_SHM_TRANSPORTER - if(nSHMTransporters) - { - signal(SIGUSR1, shm_sig_handler); - } + m_shm_own_pid = getpid(); + signal(SIGUSR1, shm_sig_handler); #endif } diff --git a/ndb/src/kernel/main.cpp b/ndb/src/kernel/main.cpp index 7d6b597e6dd..926647838c9 100644 --- a/ndb/src/kernel/main.cpp +++ b/ndb/src/kernel/main.cpp @@ -49,8 +49,6 @@ void catchsigs(bool ignore); // for process signal handling extern "C" void handler_shutdown(int signum); // for process signal handling extern "C" void handler_error(int signum); // for process signal handling -extern int g_shm_pid; - // Shows system information void systemInfo(const Configuration & conf, const LogLevel & ll); @@ -147,7 +145,6 @@ int main(int argc, char** argv) } g_eventLogger.info("Angel pid: %d ndb pid: %d", getppid(), getpid()); - g_shm_pid = getpid(); theConfig->setupConfiguration(); systemInfo(* theConfig, * theConfig->m_logLevel); diff --git a/ndb/src/ndbapi/TransporterFacade.cpp b/ndb/src/ndbapi/TransporterFacade.cpp index f6a7496decc..dfb090c8416 100644 --- a/ndb/src/ndbapi/TransporterFacade.cpp +++ b/ndb/src/ndbapi/TransporterFacade.cpp @@ -450,12 +450,8 @@ runReceiveResponse_C(void * me) return me; } -extern int g_shm_pid; - void TransporterFacade::threadMainReceive(void) { - g_shm_pid = getpid(); - theTransporterRegistry->startReceiving(); NdbMutex_Lock(theMutexPtr); theTransporterRegistry->update_connections(); From ebee4cfad31de754185483811219135b5ef7c68a Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 14 Dec 2004 08:26:53 +0100 Subject: [PATCH 0507/1063] ndb - fix protection wrt shm ndb/include/transporter/TransporterRegistry.hpp: fix protection --- ndb/include/transporter/TransporterRegistry.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ndb/include/transporter/TransporterRegistry.hpp b/ndb/include/transporter/TransporterRegistry.hpp index 4ca288d0a0a..4946222d23e 100644 --- a/ndb/include/transporter/TransporterRegistry.hpp +++ b/ndb/include/transporter/TransporterRegistry.hpp @@ -87,6 +87,7 @@ public: */ class TransporterRegistry { friend class OSE_Receiver; + friend class SHM_Transporter; friend class Transporter; friend class TransporterService; public: @@ -312,7 +313,7 @@ private: Uint32 poll_TCP(Uint32 timeOutMillis); Uint32 poll_SCI(Uint32 timeOutMillis); Uint32 poll_SHM(Uint32 timeOutMillis); - + int m_shm_own_pid; }; From 00d9273aa59d5ec424daf7c3b76224ce55d61d62 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 14 Dec 2004 11:35:23 +0400 Subject: [PATCH 0508/1063] Portability fix (bug #7203: "delayed" test fails on QNX when using prepared statements) mysql-test/t/delayed.test: Portability fix (bug #7203: "delayed" test fails on QNX when using prepared statements) 1 is not enough delay for QNX. --- mysql-test/t/delayed.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/t/delayed.test b/mysql-test/t/delayed.test index 4cf26b330c6..40bd7a912f3 100644 --- a/mysql-test/t/delayed.test +++ b/mysql-test/t/delayed.test @@ -14,7 +14,7 @@ insert delayed into t1 set a = 4; insert delayed into t1 set a = 5, tmsp = 19711006010203; insert delayed into t1 (a, tmsp) values (6, 19711006010203); insert delayed into t1 (a, tmsp) values (7, NULL); ---sleep 1 +--sleep 2 insert into t1 set a = 8,tmsp=19711006010203; select * from t1 where tmsp=0; select * from t1 where tmsp=19711006010203; From 379fe351ee5583b88d7682e97f1aa60a6bbb7642 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 14 Dec 2004 10:57:30 +0300 Subject: [PATCH 0509/1063] Test for BUG#7242: Testing prepare + several times execute (here in client_test.c because we need to check if several PS execution works and the bug shows up with binary protocol only ) tests/client_test.c: Test for BUG#7242: Testing prepare + several times execute --- tests/client_test.c | 51 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/tests/client_test.c b/tests/client_test.c index 75ce242900a..b0bf40799da 100644 --- a/tests/client_test.c +++ b/tests/client_test.c @@ -1026,6 +1026,56 @@ static void test_tran_innodb() } +/* Test for BUG#7242 */ + +static void test_prepare_insert_update() +{ + MYSQL_STMT *stmt; + int rc; + int i; + const char *testcase[]= { + "CREATE TABLE t1 (a INT, b INT, c INT, UNIQUE (A), UNIQUE(B))", + "INSERT t1 VALUES (1,2,10), (3,4,20)", + "INSERT t1 VALUES (5,6,30), (7,4,40), (8,9,60) ON DUPLICATE KEY UPDATE c=c+100", + "SELECT * FROM t1", + "INSERT t1 SET a=5 ON DUPLICATE KEY UPDATE b=0", + "SELECT * FROM t1", + "INSERT t1 VALUES (2,1,11), (7,4,40) ON DUPLICATE KEY UPDATE c=c+VALUES(a)", + NULL}; + const char **cur_query; + + myheader("test_prepare_insert_update"); + + for (cur_query= testcase; *cur_query; cur_query++) + { + printf("\nRunning query: %s", *cur_query); + strmov(query, *cur_query); + stmt= mysql_simple_prepare(mysql, query); + check_stmt(stmt); + + verify_param_count(stmt, 0); + rc= mysql_stmt_execute(stmt); + + check_execute(stmt, rc); + /* try the last query several times */ + if (!cur_query[1]) + { + for (i=0; i < 3;i++) + { + printf("\nExecuting last statement again"); + rc= mysql_stmt_execute(stmt); + check_execute(stmt, rc); + rc= mysql_stmt_execute(stmt); + check_execute(stmt, rc); + } + } + mysql_stmt_close(stmt); + } + + rc= mysql_commit(mysql); + myquery(rc); +} + /* Test simple prepares of all DML statements */ static void test_prepare_simple() @@ -11513,6 +11563,7 @@ and you are welcome to modify and redistribute it under the GPL license\n"); static struct my_tests_st my_tests[]= { { "client_query", client_query }, + { "test_prepare_insert_update", test_prepare_insert_update}, #if NOT_YET_WORKING { "test_drop_temp", test_drop_temp }, #endif From 63b36352d8af260af499596f1188f1f56c62b73f Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 14 Dec 2004 08:57:50 +0100 Subject: [PATCH 0510/1063] ndb - Handle connections without corresponding node ndb/src/mgmsrv/ConfigInfo.cpp: Handle connections without corresponding node --- ndb/src/mgmsrv/ConfigInfo.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ndb/src/mgmsrv/ConfigInfo.cpp b/ndb/src/mgmsrv/ConfigInfo.cpp index 35229d1f666..7417bef5619 100644 --- a/ndb/src/mgmsrv/ConfigInfo.cpp +++ b/ndb/src/mgmsrv/ConfigInfo.cpp @@ -2973,7 +2973,13 @@ fixHostname(InitConfigFileParser::Context & ctx, const char * data){ require(ctx.m_currentSection->get(buf, &id)); const Properties * node; - require(ctx.m_config->get("Node", id, &node)); + if(!ctx.m_config->get("Node", id, &node)) + { + ctx.reportError("Unknown node: \"%d\" specified in connection " + "[%s] starting at line: %d", + id, ctx.fname, ctx.m_sectionLineno); + return false; + } const char * hostname; require(node->get("HostName", &hostname)); From 17d1552bbb555f5fe52c39bd4ffee99ad6d823c6 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 14 Dec 2004 08:12:04 +0000 Subject: [PATCH 0511/1063] Bug#7242 The "insert_update" causes a server crash when using prepared statements Must clear table->insert_values after completing every prepared statement --- sql/sql_prepare.cc | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index f4a96d751cd..6d2ddf03b50 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -1514,6 +1514,27 @@ static bool init_param_array(Prepared_statement *stmt) } +/* Init statement before execution */ + +static void cleanup_stmt_for_execute(Prepared_statement *stmt) +{ + THD *thd= stmt->thd; + LEX *lex= stmt->lex; + SELECT_LEX *sl= lex->all_selects_list; + + for (; sl; sl= sl->next_select_in_list()) + { + for (TABLE_LIST *tables= (TABLE_LIST*) sl->table_list.first; + tables; + tables= tables->next) + { + if (tables->table) + tables->table->insert_values= 0; + } + } +} + + /* Given a query string with parameter markers, create a Prepared Statement from it and send PS info back to the client. @@ -1614,6 +1635,7 @@ int mysql_stmt_prepare(THD *thd, char *packet, uint packet_length, if (!error) error= send_prepare_results(stmt, test(name)); + cleanup_stmt_for_execute(stmt); /* restore to WAIT_PRIOR: QUERY_PRIOR is set inside alloc_query */ if (!(specialflag & SPECIAL_NO_PRIOR)) @@ -1904,6 +1926,7 @@ static void execute_stmt(THD *thd, Prepared_statement *stmt, reset_stmt_params(stmt); close_thread_tables(thd); // to close derived tables thd->set_statement(&thd->stmt_backup); + cleanup_stmt_for_execute(stmt); DBUG_VOID_RETURN; } From 16de85317eb31b928b7b9b8c43eeffc3609443c5 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 14 Dec 2004 10:23:35 +0100 Subject: [PATCH 0512/1063] mysql-test-run.sh: removed diskless option for ndb test mysql-test/mysql-test-run.sh: removed diskless option for ndb test --- mysql-test/mysql-test-run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index 5a7ede0cba8..426b8b486be 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -947,7 +947,7 @@ start_ndbcluster() else NDBCLUSTER_EXTRA_OPTS="--small" fi - ./ndb/ndbcluster $NDBCLUSTER_OPTS $NDBCLUSTER_EXTRA_OPTS --diskless --initial || exit 1 + ./ndb/ndbcluster $NDBCLUSTER_OPTS $NDBCLUSTER_EXTRA_OPTS --initial || exit 1 NDB_CONNECTSTRING="host=localhost:$NDBCLUSTER_PORT" else NDB_CONNECTSTRING="$USE_RUNNING_NDBCLUSTER" From 54745a18a19c9deeda279e22bf05b4741dcaa1ce Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 14 Dec 2004 15:41:01 +0400 Subject: [PATCH 0513/1063] A quick fix for bug #7257: Crash in default tests: 'subselect' sql/item.h: A quick fix for bug #7257: Crash in default tests: 'subselect' We have to pass &item instead of &store to the Item_ref_null_helper() then set ref. --- sql/item.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/item.h b/sql/item.h index 71b92cd1efc..fb649547fa2 100644 --- a/sql/item.h +++ b/sql/item.h @@ -983,9 +983,9 @@ class Item_null_helper :public Item_ref_null_helper public: Item_null_helper(Item_in_subselect* master, Item *item, const char *table_name_par, const char *field_name_par) - :Item_ref_null_helper(master, &store, table_name_par, field_name_par), + :Item_ref_null_helper(master, &item, table_name_par, field_name_par), store(item) - {} + { ref= &store; } void print(String *str); }; From cef35aeb1c338743d5bfa4cae46e63486aa2c7c2 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 14 Dec 2004 15:58:30 +0400 Subject: [PATCH 0514/1063] bug#6275 "client_test" fail in 4.1.7 make test bug#6911 resultset metadata always return client character set --- mysql-test/r/type_enum.result | 6 +++--- sql/item.h | 2 +- sql/protocol.cc | 12 ++++++++++-- tests/client_test.c | 29 ++++++++++++++++++----------- 4 files changed, 32 insertions(+), 17 deletions(-) diff --git a/mysql-test/r/type_enum.result b/mysql-test/r/type_enum.result index e5239dcf769..14d3443bda9 100644 --- a/mysql-test/r/type_enum.result +++ b/mysql-test/r/type_enum.result @@ -1731,9 +1731,9 @@ alter table t1 add b set ('Y','N') CHARACTER SET utf8 COLLATE utf8_bin; alter table t1 add c enum ('Y','N') CHARACTER SET utf8 COLLATE utf8_bin; select * from t1; Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def test t1 t1 a a 254 3 1 Y 384 0 8 -def test t1 t1 b b 254 9 0 Y 2176 0 8 -def test t1 t1 c c 254 3 0 Y 384 0 8 +def test t1 t1 a a 254 1 1 Y 384 0 8 +def test t1 t1 b b 254 3 0 Y 2176 0 8 +def test t1 t1 c c 254 1 0 Y 384 0 8 a b c Y NULL NULL drop table t1; diff --git a/sql/item.h b/sql/item.h index 71b92cd1efc..1024251793e 100644 --- a/sql/item.h +++ b/sql/item.h @@ -765,7 +765,7 @@ class Item_empty_string :public Item_string public: Item_empty_string(const char *header,uint length, CHARSET_INFO *cs= NULL) : Item_string("",0, cs ? cs : &my_charset_bin) - { name=(char*) header; max_length=length;} + { name=(char*) header; max_length= cs ? length * cs->mbmaxlen : length; } void make_field(Send_field *field); }; diff --git a/sql/protocol.cc b/sql/protocol.cc index eaa0fd55b25..95cd8415c85 100644 --- a/sql/protocol.cc +++ b/sql/protocol.cc @@ -549,10 +549,18 @@ bool Protocol::send_fields(List *list, uint flag) pos= (char*) local_packet->ptr()+local_packet->length(); *pos++= 12; // Length of packed fields if (item->collation.collation == &my_charset_bin || thd_charset == NULL) + { + /* No conversion */ int2store(pos, field.charsetnr); + int4store(pos+2, field.length); + } else - int2store(pos, thd_charset->number); - int4store(pos+2, field.length); + { + /* With conversion */ + int2store(pos, thd_charset->number); + uint char_len= field.length / item->collation.collation->mbmaxlen; + int4store(pos+2, char_len * thd_charset->mbmaxlen); + } pos[6]= field.type; int2store(pos+7,field.flags); pos[9]= (char) field.decimals; diff --git a/tests/client_test.c b/tests/client_test.c index b0bf40799da..b78339cc9bb 100644 --- a/tests/client_test.c +++ b/tests/client_test.c @@ -1101,7 +1101,8 @@ static void test_prepare_simple() mysql_stmt_close(stmt); /* update */ - strmov(query, "UPDATE test_prepare_simple SET id=? WHERE id=? AND name= ?"); + strmov(query, "UPDATE test_prepare_simple SET id=? " + "WHERE id=? AND CONVERT(name USING utf8)= ?"); stmt= mysql_simple_prepare(mysql, query); check_stmt(stmt); @@ -1129,7 +1130,8 @@ static void test_prepare_simple() mysql_stmt_close(stmt); /* select */ - strmov(query, "SELECT * FROM test_prepare_simple WHERE id=? AND name= ?"); + strmov(query, "SELECT * FROM test_prepare_simple WHERE id=? " + "AND CONVERT(name USING utf8)= ?"); stmt= mysql_simple_prepare(mysql, query); check_stmt(stmt); @@ -1158,7 +1160,7 @@ static void test_prepare_field_result() rc= mysql_query(mysql, "CREATE TABLE test_prepare_field_result(int_c int, " "var_c varchar(50), ts_c timestamp(14), " - "char_c char(3), date_c date, extra tinyint)"); + "char_c char(4), date_c date, extra tinyint)"); myquery(rc); /* insert */ @@ -1184,8 +1186,8 @@ static void test_prepare_field_result() "t1", "test_prepare_field_result", current_db, 10, 0); verify_prepare_field(result, 3, "ts_c", "ts_c", MYSQL_TYPE_TIMESTAMP, "t1", "test_prepare_field_result", current_db, 19, 0); - verify_prepare_field(result, 4, "char_c", "char_c", MYSQL_TYPE_STRING, - "t1", "test_prepare_field_result", current_db, 3, 0); + verify_prepare_field(result, 4, "char_c", "char_c", MYSQL_TYPE_VAR_STRING, + "t1", "test_prepare_field_result", current_db, 4, 0); verify_field_count(result, 5); mysql_free_result(result); @@ -1921,7 +1923,8 @@ static void test_select() rc= mysql_commit(mysql); myquery(rc); - strmov(query, "SELECT * FROM test_select WHERE id= ? AND name=?"); + strmov(query, "SELECT * FROM test_select WHERE id= ? " + "AND CONVERT(name USING utf8) =?"); stmt= mysql_simple_prepare(mysql, query); check_stmt(stmt); @@ -1981,7 +1984,8 @@ static void test_ps_conj_select() "(2, 'hh', 'hh'), (1, 'ii', 'ii'), (2, 'ii', 'ii')"); myquery(rc); - strmov(query, "select id1, value1 from t1 where id1= ? or value1= ?"); + strmov(query, "select id1, value1 from t1 where id1= ? or " + "CONVERT(value1 USING utf8)= ?"); stmt= mysql_simple_prepare(mysql, query); check_stmt(stmt); @@ -2060,7 +2064,8 @@ session_id char(9) NOT NULL, \ "(\"abx\", 1, 2, 3, 2003-08-30)"); myquery(rc); - strmov(query, "SELECT * FROM test_select WHERE session_id= ?"); + strmov(query, "SELECT * FROM test_select WHERE " + "CONVERT(session_id USING utf8)= ?"); stmt= mysql_simple_prepare(mysql, query); check_stmt(stmt); @@ -2898,7 +2903,8 @@ static void test_simple_delete() myquery(rc); /* insert by prepare */ - strmov(query, "DELETE FROM test_simple_delete WHERE col1= ? AND col2= ? AND col3= 100"); + strmov(query, "DELETE FROM test_simple_delete WHERE col1= ? AND " + "CONVERT(col2 USING utf8)= ? AND col3= 100"); stmt= mysql_simple_prepare(mysql, query); check_stmt(stmt); @@ -4866,7 +4872,8 @@ static void test_multi_stmt() /* alter the table schema now */ stmt1= mysql_simple_prepare(mysql, "DELETE FROM test_multi_table " - "WHERE id= ? AND name=?"); + "WHERE id= ? AND " + "CONVERT(name USING utf8)=?"); check_stmt(stmt1); verify_param_count(stmt1, 2); @@ -6632,7 +6639,7 @@ static void test_field_misc() "@@table_type", "", /* field and its org name */ MYSQL_TYPE_STRING, /* field type */ "", "", /* table and its org name */ - "", type_length*3, 0); /* db name, length */ + "", type_length, 0); /* db name, length */ mysql_free_result(result); mysql_stmt_close(stmt); From 820d68d9033ed566177a4ff9c2c4c1e98b0deb6e Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 14 Dec 2004 18:46:55 +0500 Subject: [PATCH 0515/1063] corrected mysqltest.dsp corrected mysql_test_run_new.dsp added dependency corrected path of mysql_test_run_new.dsp fixed wrong code added my_create_tables.c removed command_line fixed #elif restored NAME_MAX and MAX_FNAME added create_system_files() added compare() for windows added all files of testes in script added mysql-test in script BitKeeper/etc/ignore: Added mysql-4.1.8-win-src.zip to the ignore list VC++Files/client/mysqltest.dsp: corrected dsp file VC++Files/mysql-test/mysql_test_run_new.dsp: corrected mysql_test_run_new.dsp VC++Files/mysql.dsw: added dependency corrected path of mysql_test_run_new.dsp client/mysqltest.c: fixed wrong code mysql-test/Makefile.am: added my_create_tables.c mysql-test/my_manage.c: removed command_line fixed #elif mysql-test/my_manage.h: restored NAME_MAX and MAX_FNAME mysql-test/mysql_test_run_new.c: added create_system_files() added compare for windows scripts/make_win_src_distribution.sh: added all files of testes added mysql-test --- .bzrignore | 1 + VC++Files/client/mysqltest.dsp | 16 +- VC++Files/mysql-test/mysql_test_run_new.dsp | 54 +- VC++Files/mysql.dsw | 17 +- client/mysqltest.c | 5 +- mysql-test/Makefile.am | 2 +- mysql-test/my_create_tables.c | 646 ++++++++++++++++++++ mysql-test/my_manage.c | 3 +- mysql-test/my_manage.h | 4 + mysql-test/mysql_test_run_new.c | 16 +- scripts/make_win_src_distribution.sh | 7 +- 11 files changed, 726 insertions(+), 45 deletions(-) create mode 100644 mysql-test/my_create_tables.c diff --git a/.bzrignore b/.bzrignore index dee0812c9b0..37f82b008f8 100644 --- a/.bzrignore +++ b/.bzrignore @@ -945,3 +945,4 @@ libmysqld/ha_example.cc libmysqld/ha_tina.cc analyse.test client/mysqladmin.c +mysql-4.1.8-win-src.zip diff --git a/VC++Files/client/mysqltest.dsp b/VC++Files/client/mysqltest.dsp index badd61a70b9..1f1613026a9 100644 --- a/VC++Files/client/mysqltest.dsp +++ b/VC++Files/client/mysqltest.dsp @@ -42,8 +42,8 @@ RSC=rc.exe # PROP Output_Dir ".\debug" # PROP Intermediate_Dir ".\debug" # PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /I "../include" /I "../" /Z7 /W3 /Od /G6 /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_CONSOLE" /D "_WINDOWS" /D "USE_TLS" /D "_MBCS" /Fp".\debug/mysqltest.pch" /Fo".\debug/" /Fd".\debug/" /GZ /c /GX -# ADD CPP /nologo /MTd /I "../include" /I "../" /Z7 /W3 /Od /G6 /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_CONSOLE" /D "_WINDOWS" /D "USE_TLS" /D "_MBCS" /Fp".\debug/mysqltest.pch" /Fo".\debug/" /Fd".\debug/" /GZ /c /GX +# ADD BASE CPP /nologo /MTd /I "../include" /I "../regex" /I "../" /Z7 /W3 /Od /G6 /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_CONSOLE" /D "_WINDOWS" /D "_MBCS" /Fp".\debug/mysqltest.pch" /Fo".\debug/" /Fd".\debug/" /GZ /c /GX +# ADD CPP /nologo /MTd /I "../include" /I "../regex" /I "../" /Z7 /W3 /Od /G6 /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_CONSOLE" /D "_WINDOWS" /D "_MBCS" /Fp".\debug/mysqltest.pch" /Fo".\debug/" /Fd".\debug/" /GZ /c /GX # ADD BASE MTL /nologo /tlb".\debug\mysqltest.tlb" /win32 # ADD MTL /nologo /tlb".\debug\mysqltest.tlb" /win32 # ADD BASE RSC /l 1033 /d "_DEBUG" @@ -52,8 +52,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib odbc32.lib odbccp32.lib mysys.lib /nologo /out:"..\client_debug\mysqltest.exe" /incremental:no /libpath:"..\lib_debug\" /debug /pdb:".\debug\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib odbc32.lib odbccp32.lib mysys.lib /nologo /out:"..\client_debug\mysqltest.exe" /incremental:no /libpath:"..\lib_debug\" /debug /pdb:".\debug\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386 +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib mysys.lib regex.lib /nologo /out:"..\client_debug\mysqltest.exe" /incremental:no /libpath:"..\lib_debug\" /debug /pdb:".\debug\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib mysys.lib regex.lib /nologo /out:"..\client_debug\mysqltest.exe" /incremental:no /libpath:"..\lib_debug\" /debug /pdb:".\debug\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386 !ELSEIF "$(CFG)" == "mysqltest - Win32 classic" @@ -77,8 +77,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib odbc32.lib odbccp32.lib /nologo /out:"..\client_classic\mysqltest.exe" /incremental:no /libpath:"..\lib_release\" /pdb:".\classic\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib odbc32.lib odbccp32.lib /nologo /out:"..\client_classic\mysqltest.exe" /incremental:no /libpath:"..\lib_release\" /pdb:".\classic\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386 +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib /nologo /out:"..\client_classic\mysqltest.exe" /incremental:no /libpath:"..\lib_release\" /pdb:".\classic\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib /nologo /out:"..\client_classic\mysqltest.exe" /incremental:no /libpath:"..\lib_release\" /pdb:".\classic\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386 !ELSEIF "$(CFG)" == "mysqltest - Win32 Release" @@ -102,8 +102,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib odbc32.lib odbccp32.lib /nologo /out:"..\client_release\mysqltest.exe" /incremental:no /libpath:"..\lib_release\" /pdb:".\release\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib odbc32.lib odbccp32.lib /nologo /out:"..\client_release\mysqltest.exe" /incremental:no /libpath:"..\lib_release\" /pdb:".\release\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386 +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib /nologo /out:"..\client_release\mysqltest.exe" /incremental:no /libpath:"..\lib_release\" /pdb:".\release\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib /nologo /out:"..\client_release\mysqltest.exe" /incremental:no /libpath:"..\lib_release\" /pdb:".\release\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386 !ENDIF diff --git a/VC++Files/mysql-test/mysql_test_run_new.dsp b/VC++Files/mysql-test/mysql_test_run_new.dsp index bbdabb98a37..7e43da20b26 100644 --- a/VC++Files/mysql-test/mysql_test_run_new.dsp +++ b/VC++Files/mysql-test/mysql_test_run_new.dsp @@ -2,7 +2,7 @@ # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** -# TARGTYPE "Win32 (x86) Application" 0x0101 +# TARGTYPE "Win32 (x86) Console Application" 0x0103 CFG=mysql_test_run_new - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, @@ -17,8 +17,8 @@ CFG=mysql_test_run_new - Win32 Debug !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE -!MESSAGE "mysql_test_run_new - Win32 Debug" (based on "Win32 (x86) Application") -!MESSAGE "mysql_test_run_new - Win32 Release" (based on "Win32 (x86) Application") +!MESSAGE "mysql_test_run_new - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "mysql_test_run_new - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE # Begin Project @@ -33,51 +33,51 @@ RSC=rc.exe # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Output_Dir ".\Debug" +# PROP BASE Intermediate_Dir ".\Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" +# PROP Output_Dir ".\Debug" +# PROP Intermediate_Dir ".\Debug" # PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /I "../include" /I "../" /Z7 /W3 /Od /G6 /D "_DEBUG" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /D "__WIN__" /D "_WIN32" /Fp".\debug/mysql_test_run.pch" /Fo".\debug/" /Fd".\debug/" /GZ /c /GX -# ADD CPP /nologo /MTd /I "../include" /I "../" /Z7 /W3 /Od /G6 /D "_DEBUG" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /D "__WIN__" /D "_WIN32" /Fp".\debug/mysql_test_run.pch" /Fo".\debug/" /Fd".\debug/" /GZ /c /GX -# ADD BASE MTL /nologo /win32 -# ADD MTL /nologo /win32 +# ADD BASE CPP /nologo /MTd /I "../include" /I "../" /Z7 /W3 /Od /G6 /D "_DEBUG" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /D "__WIN__" /D "_WIN32" /Fp".\Debug/mysql_test_run_new.pch" /Fo".\Debug/" /Fd".\Debug/" /GZ /c /GX +# ADD CPP /nologo /MTd /I "../include" /I "../" /Z7 /W3 /Od /G6 /D "_DEBUG" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /D "__WIN__" /D "_WIN32" /Fp".\Debug/mysql_test_run_new.pch" /Fo".\Debug/" /Fd".\Debug/" /GZ /c /GX +# ADD BASE MTL /nologo /tlb".\Debug\mysql_test_run_new.tlb" /win32 +# ADD MTL /nologo /tlb".\Debug\mysql_test_run_new.tlb" /win32 # ADD BASE RSC /l 1033 # ADD RSC /l 1033 BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Ws2_32.lib /nologo /out:"..\mysql-test\mysql_test_run_new.exe" /debug /pdb:".\debug\mysql_test_run_new.pdb" /pdbtype:sept /map /mapinfo:exports /subsystem:windows -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Ws2_32.lib /nologo /out:"..\mysql-test\mysql_test_run_new.exe" /debug /pdb:".\debug\mysql_test_run_new.pdb" /pdbtype:sept /map /mapinfo:exports /subsystem:windows +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib Ws2_32.lib /nologo /out:"..\mysql-test\mysql_test_run_new.exe" /incremental:yes /debug /pdb:".\Debug\mysql_test_run_new.pdb" /pdbtype:sept /map:".\Debug\mysql_test_run_new.map" /subsystem:console +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib Ws2_32.lib /nologo /out:"..\mysql-test\mysql_test_run_new.exe" /incremental:yes /debug /pdb:".\Debug\mysql_test_run_new.pdb" /pdbtype:sept /map:".\Debug\mysql_test_run_new.map" /subsystem:console !ELSEIF "$(CFG)" == "mysql_test_run_new - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" +# PROP BASE Output_Dir ".\Release" +# PROP BASE Intermediate_Dir ".\Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" +# PROP Output_Dir ".\Release" +# PROP Intermediate_Dir ".\Release" # PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /I "../include" /I "../" /W3 /Ob1 /G6 /D "DBUG_OFF" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /D "__WIN__" /D "_WIN32" /GF /Gy /Fo".\release/" /Fd".\release/" /c /GX -# ADD CPP /nologo /MTd /I "../include" /I "../" /W3 /Ob1 /G6 /D "DBUG_OFF" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /D "__WIN__" /D "_WIN32" /GF /Gy /Fo".\release/" /Fd".\release/" /c /GX -# ADD BASE MTL /nologo /win32 -# ADD MTL /nologo /win32 +# ADD BASE CPP /nologo /MTd /I "../include" /I "../" /W3 /Ob1 /G6 /D "DBUG_OFF" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /D "__WIN__" /D "_WIN32" /GF /Gy /Fp".\Release/mysql_test_run_new.pch" /Fo".\Release/" /Fd".\Release/" /c /GX +# ADD CPP /nologo /MTd /I "../include" /I "../" /W3 /Ob1 /G6 /D "DBUG_OFF" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /D "__WIN__" /D "_WIN32" /GF /Gy /Fp".\Release/mysql_test_run_new.pch" /Fo".\Release/" /Fd".\Release/" /c /GX +# ADD BASE MTL /nologo /tlb".\Release\mysql_test_run_new.tlb" /win32 +# ADD MTL /nologo /tlb".\Release\mysql_test_run_new.tlb" /win32 # ADD BASE RSC /l 1033 # ADD RSC /l 1033 BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Ws2_32.lib /nologo /out:"..\mysql-test\mysql_test_run_new.exe" /pdbtype:sept /subsystem:windows -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Ws2_32.lib /nologo /out:"..\mysql-test\mysql_test_run_new.exe" /pdbtype:sept /subsystem:windows +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib Ws2_32.lib /nologo /out:"..\mysql-test\mysql_test_run_new.exe" /incremental:no /pdb:".\Release\mysql_test_run_new.pdb" /pdbtype:sept /subsystem:windows +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib Ws2_32.lib /nologo /out:"..\mysql-test\mysql_test_run_new.exe" /incremental:no /pdb:".\Release\mysql_test_run_new.pdb" /pdbtype:sept /subsystem:windows !ENDIF @@ -87,19 +87,19 @@ LINK32=link.exe # Name "mysql_test_run_new - Win32 Release" # Begin Source File -SOURCE=my_create_tables.c +SOURCE=.\my_create_tables.c # End Source File # Begin Source File -SOURCE=my_manage.c +SOURCE=.\my_manage.c # End Source File # Begin Source File -SOURCE=my_manage.h +SOURCE=.\my_manage.h # End Source File # Begin Source File -SOURCE=mysql_test_run_new.c +SOURCE=.\mysql_test_run_new.c # End Source File # End Target # End Project diff --git a/VC++Files/mysql.dsw b/VC++Files/mysql.dsw index 222b09c3d80..0ce2acfed23 100644 --- a/VC++Files/mysql.dsw +++ b/VC++Files/mysql.dsw @@ -824,11 +824,20 @@ Package=<5> Package=<4> {{{ + Begin Project Dependency + Project_Dep_Name libmysql + End Project Dependency + Begin Project Dependency + Project_Dep_Name mysys + End Project Dependency + Begin Project Dependency + Project_Dep_Name regex + End Project Dependency }}} ############################################################################### -Project: "mysql_test_run_new"=.\mysql-test\mysql_test_run_new.dsp - Package Owner=<4> +Project: "mysql_test_run_new"=".\mysql-test\mysql_test_run_new.dsp" - Package Owner=<4> Package=<5> {{{ @@ -836,6 +845,12 @@ Package=<5> Package=<4> {{{ + Begin Project Dependency + Project_Dep_Name mysqltest + End Project Dependency + Begin Project Dependency + Project_Dep_Name mysqladmin + End Project Dependency }}} ############################################################################### diff --git a/client/mysqltest.c b/client/mysqltest.c index dfaf48dd60e..18d5660d1a7 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -227,7 +227,7 @@ typedef struct int alloced; } VAR; -#ifdef __NETWARE__ +#if defined(__NETWARE__) || defined(__WIN__) /* Netware doesn't proved environment variable substitution that is done by the shell in unix environments. We do this in the following function: @@ -4600,6 +4600,9 @@ static char *subst_env_var(const char *str) */ #undef popen /* Remove wrapper */ +#ifdef __WIN__ +#define popen _popen /* redefine for windows */ +#endif FILE *my_popen(const char *cmd, const char *mode __attribute__((unused))) { diff --git a/mysql-test/Makefile.am b/mysql-test/Makefile.am index c4b3fae40f9..d718935cca8 100644 --- a/mysql-test/Makefile.am +++ b/mysql-test/Makefile.am @@ -39,7 +39,7 @@ CLEANFILES = $(test_SCRIPTS) $(test_DATA) INCLUDES = -I$(srcdir)/../include -I../include -I.. EXTRA_PROGRAMS = mysql_test_run_new noinst_HEADERS = my_manage.h -mysql_test_run_new_SOURCES= mysql_test_run_new.c my_manage.c +mysql_test_run_new_SOURCES= mysql_test_run_new.c my_manage.c my_create_tables.c dist-hook: diff --git a/mysql-test/my_create_tables.c b/mysql-test/my_create_tables.c new file mode 100644 index 00000000000..405f66dc8df --- /dev/null +++ b/mysql-test/my_create_tables.c @@ -0,0 +1,646 @@ +#include +#include +#ifndef __WIN__ +#include +#endif +#include +#ifdef __NETWARE__ +#include +#include +#else +#include +#ifndef __WIN__ +#include +#include +#else +#include +#include +#include +#endif +#endif +#include +#include +#include +#include +#include "my_manage.h" + +/* + Synopsis: + This function testes a exist file + +Arguments: + mdata: path to data + file_name: name of file +Output: + A zero value indicates that file is exist. +*/ +bool test_sys_file(const char *mdata,const char *file_name) +{ + struct stat file; + char path_file_name[PATH_MAX]; + snprintf(path_file_name, PATH_MAX, "%s/%s", mdata, file_name); + return(stat(path_file_name,&file)); +} + +/* + Synopsis: + This function creates a file with sql requstes for creating + system data files. + +Arguments: + mdata: path to data + output_file: file name for output file + test: to create system files with test data +Output: + A zero value indicates a success. +*/ +bool create_system_files(const char *mdata,const char *output_file, bool test) +{ + FILE *out; + + out = fopen(output_file, "w+"); + + if (!out) + return 1; + + if (test_sys_file(mdata,"mysql")) + { + fprintf(out,"CREATE DATABASE mysql;\n"); + } + + if (test && test_sys_file(mdata,"test")) + { + fprintf(out,"CREATE DATABASE test;\n"); + } + + fprintf(out,"USE mysql;\n"); + + if (test_sys_file(mdata,"mysql/db.frm")) + { + fprintf(out, + "CREATE TABLE db (" + "Host char(60) binary DEFAULT '' NOT NULL," + "Db char(64) binary DEFAULT '' NOT NULL," + "User char(16) binary DEFAULT '' NOT NULL," + "Select_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Update_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Create_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "References_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Index_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "PRIMARY KEY Host (Host,Db,User)," + "KEY User (User))" + "comment='Database privileges';\n"); + + if (test) + { + fprintf(out,"INSERT INTO db VALUES ('%%','test','','Y','Y','Y','Y'" + ",'Y','Y','N','Y','Y','Y','Y','Y');\n"); + fprintf(out,"INSERT INTO db VALUES ('%%','test\\_%%','','Y','Y','Y'" + ",'Y','Y','Y','N','Y','Y','Y','Y','Y');\n"); + } + } + + if (test_sys_file(mdata,"mysql/host.frm")) + { + fprintf(out, + "CREATE TABLE host (" + "Host char(60) binary DEFAULT '' NOT NULL," + "Db char(64) binary DEFAULT '' NOT NULL," + "Select_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Update_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Create_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "References_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Index_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "PRIMARY KEY Host (Host,Db))" + "comment='Host privileges;" + " Merged with database privileges';\n"); + } + + if (test_sys_file(mdata,"mysql/user.frm")) + { +#ifdef __WIN__ + WSADATA wsa_data; +#endif + char hostname[FN_REFLEN]; + +#ifdef __WIN__ + if (WSAStartup(MAKEWORD( 2, 2 ),&wsa_data)) + return 1; +#endif + if (gethostname(hostname, FN_REFLEN)) + return 1; +#ifdef __WIN__ + WSACleanup( ); +#endif + + if (strchr(hostname, '.') == NULL) + strcat(hostname, "%"); + + fprintf(out, + "CREATE TABLE user (" + "Host char(60) binary DEFAULT '' NOT NULL," + "User char(16) binary DEFAULT '' NOT NULL," + "Password char(41) binary DEFAULT '' NOT NULL," + "Select_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Update_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Create_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Reload_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Shutdown_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Process_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "File_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "References_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Index_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Show_db_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Super_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Execute_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Repl_slave_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "Repl_client_priv enum('N','Y') DEFAULT 'N' NOT NULL," + "ssl_type enum('','ANY','X509', 'SPECIFIED') DEFAULT '' NOT NULL," + "ssl_cipher BLOB NOT NULL," + "x509_issuer BLOB NOT NULL," + "x509_subject BLOB NOT NULL," + "max_questions int(11) unsigned DEFAULT 0 NOT NULL," + "max_updates int(11) unsigned DEFAULT 0 NOT NULL," + "max_connections int(11) unsigned DEFAULT 0 NOT NULL," + "PRIMARY KEY Host (Host,User)" + ") comment='Users and global privileges';\n"); + + if (test) + { + fprintf(out, + "INSERT INTO user VALUES ('localhost','root',''" + ",'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y'" + ",'Y','Y','Y','Y','Y','','','','',0,0,0);\n"); + fprintf(out, + "INSERT INTO user VALUES ('%s','root','','Y','Y'," + "'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y'," + "'Y','Y','Y','Y','','','','',0,0,0);\n",hostname); + fprintf(out, + "REPLACE INTO user VALUES ('127.0.0.1','root',''," + "'Y','Y','Y','Y','Y','Y'," + "'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y'" + ",'Y','','','','',0,0,0);\n"); + fprintf(out,"INSERT INTO user (host,user) values ('localhost','');\n"); + fprintf(out,"INSERT INTO user (host,user) values ('%s','');\n",hostname); + } + else + { + fprintf(out, + "INSERT INTO user VALUES ('localhost','root',''," + "'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y'," + "'Y','Y','Y','Y','','','','',0,0,0);\n"); +#ifndef __WIN__ + fprintf(out, + "INSERT INTO user VALUES ('%s','root','','Y','Y'," + "'Y','Y','Y','Y','Y','Y'" + "'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','',''" + ",'','',0,0,0);\n",hostname); + fprintf(out,"INSERT INTO user (host,user) values ('%s','');\n",hostname); + fprintf(out,"INSERT INTO user (host,user) values ('localhost','');\n"); +#else + fprintf(out, + "INSERT INTO user VALUES ('localhost','','','Y','Y','Y'" + ",'Y','Y','Y','Y','Y','Y'" + ",'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','',''," + "'','',0,0,0);\n"); +#endif + } + } + + + if (test_sys_file(mdata,"mysql/func.frm")) + { + fprintf(out, + "CREATE TABLE func (" + "name char(64) binary DEFAULT '' NOT NULL," + "ret tinyint(1) DEFAULT '0' NOT NULL," + "dl char(128) DEFAULT '' NOT NULL," + "type enum ('function','aggregate') NOT NULL," + "PRIMARY KEY (name)" + ") comment='User defined functions';\n"); + } + + if (test_sys_file(mdata,"mysql/tables_priv.frm")) + { + fprintf(out, + "CREATE TABLE tables_priv (" + "Host char(60) binary DEFAULT '' NOT NULL," + "Db char(64) binary DEFAULT '' NOT NULL," + "User char(16) binary DEFAULT '' NOT NULL," + "Table_name char(64) binary DEFAULT '' NOT NULL," + "Grantor char(77) DEFAULT '' NOT NULL," + "Timestamp timestamp(14)," + "Table_priv set('Select','Insert','Update','Delete'," + "'Create','Drop','Grant','References','Index','Alter')" + " DEFAULT '' NOT NULL," + "Column_priv set('Select','Insert','Update','References')" + " DEFAULT '' NOT NULL," + "PRIMARY KEY (Host,Db,User,Table_name)," + "KEY Grantor (Grantor)" + ") comment='Table privileges';\n"); + } + + if (test_sys_file(mdata,"mysql/columns_priv.frm")) + { + fprintf(out, + "CREATE TABLE columns_priv (" + "Host char(60) binary DEFAULT '' NOT NULL," + "Db char(64) binary DEFAULT '' NOT NULL," + "User char(16) binary DEFAULT '' NOT NULL," + "Table_name char(64) binary DEFAULT '' NOT NULL," + "Column_name char(64) binary DEFAULT '' NOT NULL," + "Timestamp timestamp(14)," + "Column_priv set('Select','Insert','Update','References')" + " DEFAULT '' NOT NULL," + "PRIMARY KEY (Host,Db,User,Table_name,Column_name)" + ") comment='Column privileges';\n"); + } + + if (test_sys_file(mdata,"mysql/help_topic.frm")) + { + fprintf(out, + "CREATE TABLE help_topic (" + "help_topic_id int unsigned not null," + "name varchar(64) not null," + "help_category_id smallint unsigned not null," + "description text not null," + "example text not null," + "url varchar(128) not null," + "primary key (help_topic_id)," + "unique index (name)" + ") comment='help topics';\n"); + } + + if (test_sys_file(mdata,"mysql/help_category.frm")) + { + fprintf(out, + "CREATE TABLE help_category (" + "help_category_id smallint unsigned not null," + "name varchar(64) not null," + "parent_category_id smallint unsigned null," + "url varchar(128) not null," + "primary key (help_category_id)," + "unique index (name)" + ") comment='help categories';\n"); + } + + if (test_sys_file(mdata,"mysql/help_keyword.frm")) + { + fprintf(out, + "CREATE TABLE help_keyword (" + "help_keyword_id int unsigned not null," + "name varchar(64) not null," + "primary key (help_keyword_id)," + "unique index (name)" + ") comment='help keywords';\n"); + } + + if (test_sys_file(mdata,"mysql/help_relation.frm")) + { + fprintf(out, + "CREATE TABLE help_relation (" + "help_topic_id int unsigned not null references help_topic," + "help_keyword_id int unsigned not null references help_keyword," + "primary key (help_keyword_id, help_topic_id)" + ") comment='keyword-topic relation';\n"); + } + + if (test_sys_file(mdata,"mysql/time_zone_name.frm")) + { + fprintf(out, + "CREATE TABLE time_zone_name (" + "Name char(64) NOT NULL," + "Time_zone_id int unsigned NOT NULL," + "PRIMARY KEY Name (Name)" + ") DEFAULT CHARACTER SET latin1 " + "comment='Time zone names';\n"); + + if (test) + { + fprintf(out, + "INSERT INTO time_zone_name (Name, Time_Zone_id) VALUES" + "('MET', 1), ('UTC', 2), ('Universal', 2), " + "('Europe/Moscow',3), ('leap/Europe/Moscow',4);\n"); + } + } + + + if (test_sys_file(mdata,"mysql/time_zone.frm")) + { + fprintf(out, + "CREATE TABLE time_zone (" + "Time_zone_id int unsigned NOT NULL auto_increment," + "Use_leap_seconds enum('Y','N') DEFAULT 'N' NOT NULL," + "PRIMARY KEY TzId (Time_zone_id)" + ") DEFAULT CHARACTER SET latin1 " + "comment='Time zones';\n"); + + if (test) + { + fprintf(out,"INSERT INTO time_zone (Time_zone_id, Use_leap_seconds)" + "VALUES (1,'N'), (2,'N'), (3,'N'), (4,'Y');\n"); + } + } + + if (test_sys_file(mdata,"mysql/time_zone_transition.frm")) + { + fprintf(out, + "CREATE TABLE time_zone_transition (" + "Time_zone_id int unsigned NOT NULL," + "Transition_time bigint signed NOT NULL," + "Transition_type_id int unsigned NOT NULL," + "PRIMARY KEY TzIdTranTime (Time_zone_id, Transition_time)" + ") DEFAULT CHARACTER SET latin1 " + "comment='Time zone transitions';\n"); + + if (test) + { + fprintf(out, + "INSERT INTO time_zone_transition" + "(Time_zone_id, Transition_time, Transition_type_id)" + "VALUES" + " (1, -1693706400, 0) ,(1, -1680483600, 1)" + ",(1, -1663455600, 2) ,(1, -1650150000, 3)" + ",(1, -1632006000, 2) ,(1, -1618700400, 3)" + ",(1, -938905200, 2) ,(1, -857257200, 3)" + ",(1, -844556400, 2) ,(1, -828226800, 3)" + ",(1, -812502000, 2) ,(1, -796777200, 3)" + ",(1, 228877200, 2) ,(1, 243997200, 3)" + ",(1, 260326800, 2) ,(1, 276051600, 3)" + ",(1, 291776400, 2) ,(1, 307501200, 3)" + ",(1, 323830800, 2) ,(1, 338950800, 3)" + ",(1, 354675600, 2) ,(1, 370400400, 3)" + ",(1, 386125200, 2) ,(1, 401850000, 3)" + ",(1, 417574800, 2) ,(1, 433299600, 3)" + ",(1, 449024400, 2) ,(1, 465354000, 3)" + ",(1, 481078800, 2) ,(1, 496803600, 3)" + ",(1, 512528400, 2) ,(1, 528253200, 3)" + ",(1, 543978000, 2) ,(1, 559702800, 3)" + ",(1, 575427600, 2) ,(1, 591152400, 3)" + ",(1, 606877200, 2) ,(1, 622602000, 3)" + ",(1, 638326800, 2) ,(1, 654656400, 3)" + ",(1, 670381200, 2) ,(1, 686106000, 3)" + ",(1, 701830800, 2) ,(1, 717555600, 3)" + ",(1, 733280400, 2) ,(1, 749005200, 3)" + ",(1, 764730000, 2) ,(1, 780454800, 3)" + ",(1, 796179600, 2) ,(1, 811904400, 3)" + ",(1, 828234000, 2) ,(1, 846378000, 3)" + ",(1, 859683600, 2) ,(1, 877827600, 3)" + ",(1, 891133200, 2) ,(1, 909277200, 3)" + ",(1, 922582800, 2) ,(1, 941331600, 3)" + ",(1, 954032400, 2) ,(1, 972781200, 3)" + ",(1, 985482000, 2) ,(1, 1004230800, 3)" + ",(1, 1017536400, 2) ,(1, 1035680400, 3)" + ",(1, 1048986000, 2) ,(1, 1067130000, 3)" + ",(1, 1080435600, 2) ,(1, 1099184400, 3)" + ",(1, 1111885200, 2) ,(1, 1130634000, 3)" + ",(1, 1143334800, 2) ,(1, 1162083600, 3)" + ",(1, 1174784400, 2) ,(1, 1193533200, 3)" + ",(1, 1206838800, 2) ,(1, 1224982800, 3)" + ",(1, 1238288400, 2) ,(1, 1256432400, 3)" + ",(1, 1269738000, 2) ,(1, 1288486800, 3)" + ",(1, 1301187600, 2) ,(1, 1319936400, 3)" + ",(1, 1332637200, 2) ,(1, 1351386000, 3)" + ",(1, 1364691600, 2) ,(1, 1382835600, 3)" + ",(1, 1396141200, 2) ,(1, 1414285200, 3)" + ",(1, 1427590800, 2) ,(1, 1445734800, 3)" + ",(1, 1459040400, 2) ,(1, 1477789200, 3)" + ",(1, 1490490000, 2) ,(1, 1509238800, 3)" + ",(1, 1521939600, 2) ,(1, 1540688400, 3)" + ",(1, 1553994000, 2) ,(1, 1572138000, 3)" + ",(1, 1585443600, 2) ,(1, 1603587600, 3)" + ",(1, 1616893200, 2) ,(1, 1635642000, 3)" + ",(1, 1648342800, 2) ,(1, 1667091600, 3)" + ",(1, 1679792400, 2) ,(1, 1698541200, 3)" + ",(1, 1711846800, 2) ,(1, 1729990800, 3)" + ",(1, 1743296400, 2) ,(1, 1761440400, 3)" + ",(1, 1774746000, 2) ,(1, 1792890000, 3)" + ",(1, 1806195600, 2) ,(1, 1824944400, 3)" + ",(1, 1837645200, 2) ,(1, 1856394000, 3)" + ",(1, 1869094800, 2) ,(1, 1887843600, 3)" + ",(1, 1901149200, 2) ,(1, 1919293200, 3)" + ",(1, 1932598800, 2) ,(1, 1950742800, 3)" + ",(1, 1964048400, 2) ,(1, 1982797200, 3)" + ",(1, 1995498000, 2) ,(1, 2014246800, 3)" + ",(1, 2026947600, 2) ,(1, 2045696400, 3)" + ",(1, 2058397200, 2) ,(1, 2077146000, 3)" + ",(1, 2090451600, 2) ,(1, 2108595600, 3)" + ",(1, 2121901200, 2) ,(1, 2140045200, 3)" + ",(3, -1688265000, 2) ,(3, -1656819048, 1)" + ",(3, -1641353448, 2) ,(3, -1627965048, 3)" + ",(3, -1618716648, 1) ,(3, -1596429048, 3)" + ",(3, -1593829848, 5) ,(3, -1589860800, 4)" + ",(3, -1542427200, 5) ,(3, -1539493200, 6)" + ",(3, -1525323600, 5) ,(3, -1522728000, 4)" + ",(3, -1491188400, 7) ,(3, -1247536800, 4)" + ",(3, 354920400, 5) ,(3, 370728000, 4)" + ",(3, 386456400, 5) ,(3, 402264000, 4)" + ",(3, 417992400, 5) ,(3, 433800000, 4)" + ",(3, 449614800, 5) ,(3, 465346800, 8)" + ",(3, 481071600, 9) ,(3, 496796400, 8)" + ",(3, 512521200, 9) ,(3, 528246000, 8)" + ",(3, 543970800, 9) ,(3, 559695600, 8)" + ",(3, 575420400, 9) ,(3, 591145200, 8)" + ",(3, 606870000, 9) ,(3, 622594800, 8)" + ",(3, 638319600, 9) ,(3, 654649200, 8)" + ",(3, 670374000, 10) ,(3, 686102400, 11)" + ",(3, 695779200, 8) ,(3, 701812800, 5)" + ",(3, 717534000, 4) ,(3, 733273200, 9)" + ",(3, 748998000, 8) ,(3, 764722800, 9)" + ",(3, 780447600, 8) ,(3, 796172400, 9)" + ",(3, 811897200, 8) ,(3, 828226800, 9)" + ",(3, 846370800, 8) ,(3, 859676400, 9)" + ",(3, 877820400, 8) ,(3, 891126000, 9)" + ",(3, 909270000, 8) ,(3, 922575600, 9)" + ",(3, 941324400, 8) ,(3, 954025200, 9)" + ",(3, 972774000, 8) ,(3, 985474800, 9)" + ",(3, 1004223600, 8) ,(3, 1017529200, 9)" + ",(3, 1035673200, 8) ,(3, 1048978800, 9)" + ",(3, 1067122800, 8) ,(3, 1080428400, 9)" + ",(3, 1099177200, 8) ,(3, 1111878000, 9)" + ",(3, 1130626800, 8) ,(3, 1143327600, 9)" + ",(3, 1162076400, 8) ,(3, 1174777200, 9)" + ",(3, 1193526000, 8) ,(3, 1206831600, 9)" + ",(3, 1224975600, 8) ,(3, 1238281200, 9)" + ",(3, 1256425200, 8) ,(3, 1269730800, 9)" + ",(3, 1288479600, 8) ,(3, 1301180400, 9)" + ",(3, 1319929200, 8) ,(3, 1332630000, 9)" + ",(3, 1351378800, 8) ,(3, 1364684400, 9)" + ",(3, 1382828400, 8) ,(3, 1396134000, 9)" + ",(3, 1414278000, 8) ,(3, 1427583600, 9)" + ",(3, 1445727600, 8) ,(3, 1459033200, 9)" + ",(3, 1477782000, 8) ,(3, 1490482800, 9)" + ",(3, 1509231600, 8) ,(3, 1521932400, 9)" + ",(3, 1540681200, 8) ,(3, 1553986800, 9)" + ",(3, 1572130800, 8) ,(3, 1585436400, 9)" + ",(3, 1603580400, 8) ,(3, 1616886000, 9)" + ",(3, 1635634800, 8) ,(3, 1648335600, 9)" + ",(3, 1667084400, 8) ,(3, 1679785200, 9)" + ",(3, 1698534000, 8) ,(3, 1711839600, 9)" + ",(3, 1729983600, 8) ,(3, 1743289200, 9)" + ",(3, 1761433200, 8) ,(3, 1774738800, 9)" + ",(3, 1792882800, 8) ,(3, 1806188400, 9)" + ",(3, 1824937200, 8) ,(3, 1837638000, 9)" + ",(3, 1856386800, 8) ,(3, 1869087600, 9)" + ",(3, 1887836400, 8) ,(3, 1901142000, 9)" + ",(3, 1919286000, 8) ,(3, 1932591600, 9)" + ",(3, 1950735600, 8) ,(3, 1964041200, 9)" + ",(3, 1982790000, 8) ,(3, 1995490800, 9)" + ",(3, 2014239600, 8) ,(3, 2026940400, 9)" + ",(3, 2045689200, 8) ,(3, 2058390000, 9)" + ",(3, 2077138800, 8) ,(3, 2090444400, 9)" + ",(3, 2108588400, 8) ,(3, 2121894000, 9)" + ",(3, 2140038000, 8)" + ",(4, -1688265000, 2) ,(4, -1656819048, 1)" + ",(4, -1641353448, 2) ,(4, -1627965048, 3)" + ",(4, -1618716648, 1) ,(4, -1596429048, 3)" + ",(4, -1593829848, 5) ,(4, -1589860800, 4)" + ",(4, -1542427200, 5) ,(4, -1539493200, 6)" + ",(4, -1525323600, 5) ,(4, -1522728000, 4)" + ",(4, -1491188400, 7) ,(4, -1247536800, 4)" + ",(4, 354920409, 5) ,(4, 370728010, 4)" + ",(4, 386456410, 5) ,(4, 402264011, 4)" + ",(4, 417992411, 5) ,(4, 433800012, 4)" + ",(4, 449614812, 5) ,(4, 465346812, 8)" + ",(4, 481071612, 9) ,(4, 496796413, 8)" + ",(4, 512521213, 9) ,(4, 528246013, 8)" + ",(4, 543970813, 9) ,(4, 559695613, 8)" + ",(4, 575420414, 9) ,(4, 591145214, 8)" + ",(4, 606870014, 9) ,(4, 622594814, 8)" + ",(4, 638319615, 9) ,(4, 654649215, 8)" + ",(4, 670374016, 10) ,(4, 686102416, 11)" + ",(4, 695779216, 8) ,(4, 701812816, 5)" + ",(4, 717534017, 4) ,(4, 733273217, 9)" + ",(4, 748998018, 8) ,(4, 764722818, 9)" + ",(4, 780447619, 8) ,(4, 796172419, 9)" + ",(4, 811897219, 8) ,(4, 828226820, 9)" + ",(4, 846370820, 8) ,(4, 859676420, 9)" + ",(4, 877820421, 8) ,(4, 891126021, 9)" + ",(4, 909270021, 8) ,(4, 922575622, 9)" + ",(4, 941324422, 8) ,(4, 954025222, 9)" + ",(4, 972774022, 8) ,(4, 985474822, 9)" + ",(4, 1004223622, 8) ,(4, 1017529222, 9)" + ",(4, 1035673222, 8) ,(4, 1048978822, 9)" + ",(4, 1067122822, 8) ,(4, 1080428422, 9)" + ",(4, 1099177222, 8) ,(4, 1111878022, 9)" + ",(4, 1130626822, 8) ,(4, 1143327622, 9)" + ",(4, 1162076422, 8) ,(4, 1174777222, 9)" + ",(4, 1193526022, 8) ,(4, 1206831622, 9)" + ",(4, 1224975622, 8) ,(4, 1238281222, 9)" + ",(4, 1256425222, 8) ,(4, 1269730822, 9)" + ",(4, 1288479622, 8) ,(4, 1301180422, 9)" + ",(4, 1319929222, 8) ,(4, 1332630022, 9)" + ",(4, 1351378822, 8) ,(4, 1364684422, 9)" + ",(4, 1382828422, 8) ,(4, 1396134022, 9)" + ",(4, 1414278022, 8) ,(4, 1427583622, 9)" + ",(4, 1445727622, 8) ,(4, 1459033222, 9)" + ",(4, 1477782022, 8) ,(4, 1490482822, 9)" + ",(4, 1509231622, 8) ,(4, 1521932422, 9)" + ",(4, 1540681222, 8) ,(4, 1553986822, 9)" + ",(4, 1572130822, 8) ,(4, 1585436422, 9)" + ",(4, 1603580422, 8) ,(4, 1616886022, 9)" + ",(4, 1635634822, 8) ,(4, 1648335622, 9)" + ",(4, 1667084422, 8) ,(4, 1679785222, 9)" + ",(4, 1698534022, 8) ,(4, 1711839622, 9)" + ",(4, 1729983622, 8) ,(4, 1743289222, 9)" + ",(4, 1761433222, 8) ,(4, 1774738822, 9)" + ",(4, 1792882822, 8) ,(4, 1806188422, 9)" + ",(4, 1824937222, 8) ,(4, 1837638022, 9)" + ",(4, 1856386822, 8) ,(4, 1869087622, 9)" + ",(4, 1887836422, 8) ,(4, 1901142022, 9)" + ",(4, 1919286022, 8) ,(4, 1932591622, 9)" + ",(4, 1950735622, 8) ,(4, 1964041222, 9)" + ",(4, 1982790022, 8) ,(4, 1995490822, 9)" + ",(4, 2014239622, 8) ,(4, 2026940422, 9)" + ",(4, 2045689222, 8) ,(4, 2058390022, 9)" + ",(4, 2077138822, 8) ,(4, 2090444422, 9)" + ",(4, 2108588422, 8) ,(4, 2121894022, 9)" + ",(4, 2140038022, 8);\n"); + } + } + + if (test_sys_file(mdata,"mysql/time_zone_transition_type.frm")) + { + fprintf(out, + "CREATE TABLE time_zone_transition_type (" + "Time_zone_id int unsigned NOT NULL," + "Transition_type_id int unsigned NOT NULL," + "Offset int signed DEFAULT 0 NOT NULL," + "Is_DST tinyint unsigned DEFAULT 0 NOT NULL," + "Abbreviation char(8) DEFAULT '' NOT NULL," + "PRIMARY KEY TzIdTrTId (Time_zone_id, Transition_type_id)" + ") DEFAULT CHARACTER SET latin1 " + "comment='Time zone transition types';\n"); + + if (test) + { + fprintf(out, + "INSERT INTO time_zone_transition_type (Time_zone_id," + "Transition_type_id, Offset, Is_DST, Abbreviation) VALUES" + "(1, 0, 7200, 1, 'MEST') ,(1, 1, 3600, 0, 'MET')" + ",(1, 2, 7200, 1, 'MEST') ,(1, 3, 3600, 0, 'MET')" + ",(2, 0, 0, 0, 'UTC')" + ",(3, 0, 9000, 0, 'MMT') ,(3, 1, 12648, 1, 'MST')" + ",(3, 2, 9048, 0, 'MMT') ,(3, 3, 16248, 1, 'MDST')" + ",(3, 4, 10800, 0, 'MSK') ,(3, 5, 14400, 1, 'MSD')" + ",(3, 6, 18000, 1, 'MSD') ,(3, 7, 7200, 0, 'EET')" + ",(3, 8, 10800, 0, 'MSK') ,(3, 9, 14400, 1, 'MSD')" + ",(3, 10, 10800, 1, 'EEST') ,(3, 11, 7200, 0, 'EET')" + ",(4, 0, 9000, 0, 'MMT') ,(4, 1, 12648, 1, 'MST')" + ",(4, 2, 9048, 0, 'MMT') ,(4, 3, 16248, 1, 'MDST')" + ",(4, 4, 10800, 0, 'MSK') ,(4, 5, 14400, 1, 'MSD')" + ",(4, 6, 18000, 1, 'MSD') ,(4, 7, 7200, 0, 'EET')" + ",(4, 8, 10800, 0, 'MSK') ,(4, 9, 14400, 1, 'MSD')" + ",(4, 10, 10800, 1, 'EEST') ,(4, 11, 7200, 0, 'EET');\n"); + } + } + + if (test_sys_file(mdata,"mysql/time_zone_leap_second.frm")) + { + fprintf(out, + "CREATE TABLE time_zone_leap_second (" + "Transition_time bigint signed NOT NULL," + "Correction int signed NOT NULL," + "PRIMARY KEY TranTime (Transition_time)" + ") DEFAULT CHARACTER SET latin1 " + "comment='Leap seconds information for time zones';\n"); + + if (test) + { + fprintf(out, + "INSERT INTO time_zone_leap_second " + "(Transition_time, Correction) VALUES " + "(78796800, 1) ,(94694401, 2) ,(126230402, 3)" + ",(157766403, 4) ,(189302404, 5) ,(220924805, 6)" + ",(252460806, 7) ,(283996807, 8) ,(315532808, 9)" + ",(362793609, 10) ,(394329610, 11) ,(425865611, 12)" + ",(489024012, 13) ,(567993613, 14) ,(631152014, 15)" + ",(662688015, 16) ,(709948816, 17) ,(741484817, 18)" + ",(773020818, 19) ,(820454419, 20) ,(867715220, 21)" + ",(915148821, 22);\n"); + } + } + + return fclose(out); +} diff --git a/mysql-test/my_manage.c b/mysql-test/my_manage.c index cc27558f131..472b0d32683 100644 --- a/mysql-test/my_manage.c +++ b/mysql-test/my_manage.c @@ -333,7 +333,6 @@ int spawn(char *path, arg_list_t *al, int join, char *input, PROCESS_INFORMATION process_information; DWORD exit_code; char win_args[1024]= ""; - char command_line[1024]= ""; /* Skip the first parameter */ for (i= 1; i < al->argc; i++) @@ -724,7 +723,7 @@ int removef(const char *format, ...) va_end(ap); return remove(path); -#eldef __WIN__ +#elif __WIN__ { va_list ap; char path[FN_REFLEN]; diff --git a/mysql-test/my_manage.h b/mysql-test/my_manage.h index 7e371d36ab1..5df77b01af8 100644 --- a/mysql-test/my_manage.h +++ b/mysql-test/my_manage.h @@ -52,6 +52,8 @@ int my_vsnprintf_(char *to, size_t n, const char* value, ...); #define TRY_MAX 5 #ifdef __WIN__ +#define PATH_MAX _MAX_PATH +#define NAME_MAX _MAX_FNAME #define kill(A,B) TerminateProcess((HANDLE)A,0) #define NOT_NEED_PID 0 #define MASTER_PID 1 @@ -130,4 +132,6 @@ int removef(const char *, ...); void get_basedir(char *, char *); void remove_empty_file(const char *file_name); +bool create_system_files(const char *mdata,const char *output_file, bool test); + #endif /* _MY_MANAGE */ diff --git a/mysql-test/mysql_test_run_new.c b/mysql-test/mysql_test_run_new.c index d8bf731b398..fe13d71c1c2 100644 --- a/mysql-test/mysql_test_run_new.c +++ b/mysql-test/mysql_test_run_new.c @@ -267,6 +267,8 @@ void install_db(char *datadir) snprintf(output, FN_REFLEN, "%s/install.out", datadir); snprintf(error, FN_REFLEN, "%s/install.err", datadir); + if (create_system_files(datadir,input, TRUE)) + die("Unable to create init_db.sql."); /* args */ init_args(&al); add_arg(&al, mysqld_file); @@ -307,9 +309,6 @@ void mysql_install_db() /* var directory */ snprintf(temp, FN_REFLEN, "%s/var", mysql_test_dir); - /* clean up old direcotry */ - del_tree(temp); - /* create var directory */ #ifndef __WIN__ mkdir(temp, S_IRWXU); @@ -1435,6 +1434,17 @@ void setup(char *file __attribute__((unused))) } +/* + Compare names of testes for right order +*/ +#ifdef __WIN__ +int compare( const void *arg1, const void *arg2 ) +{ + return _stricmp( * ( char** ) arg1, * ( char** ) arg2 ); +} +#endif + + /****************************************************************************** main() diff --git a/scripts/make_win_src_distribution.sh b/scripts/make_win_src_distribution.sh index fd7884068ba..a635f266165 100644 --- a/scripts/make_win_src_distribution.sh +++ b/scripts/make_win_src_distribution.sh @@ -189,7 +189,10 @@ copy_dir_files() mkdir $BASE/$arg fi for i in *.c *.cpp *.h *.ih *.i *.ic *.asm *.def \ - README INSTALL* LICENSE + README INSTALL* LICENSE *.inc *.test *.result \ + *.pem Moscow_leap des_key_file *.dat *.000001 \ + *.require *.opt + do if [ -f $i ] then @@ -247,7 +250,7 @@ done # Input directories to be copied recursively # -for i in bdb innobase +for i in bdb innobase mysql-test do copy_dir_dirs $i done From 79a0ed6232233f6c85c83fbee4e27e594a7149db Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 14 Dec 2004 19:24:19 +0500 Subject: [PATCH 0516/1063] BUG#6056 (continue) added event_conn_closed replaced WaitForSingleObject on WaitForMultipleObjects inserted a check in vio_close() added SetEvent() for event_conn_closed include/violite.h: added event_conn_closed sql-common/client.c: added event_conn_closed sql/mysqld.cc: added event_conn_closed vio/vio.c: added event_conn_closed vio/viosocket.c: replaced WaitForSingleObject on WaitForMultipleObjects inserted a check in vio_close() added SetEvent() for event_conn_closed --- include/violite.h | 4 +++- sql-common/client.c | 12 +++++++++++- sql/mysqld.cc | 11 ++++++++++- vio/vio.c | 4 +++- vio/viosocket.c | 31 +++++++++++++++++++++++-------- 5 files changed, 50 insertions(+), 12 deletions(-) diff --git a/include/violite.h b/include/violite.h index ba7de3ee175..64e834d6653 100644 --- a/include/violite.h +++ b/include/violite.h @@ -45,7 +45,8 @@ Vio* vio_new_win32shared_memory(NET *net,HANDLE handle_file_map, HANDLE event_server_wrote, HANDLE event_server_read, HANDLE event_client_wrote, - HANDLE event_client_read); + HANDLE event_client_read, + HANDLE event_conn_closed); int vio_read_pipe(Vio *vio, gptr buf, int size); int vio_write_pipe(Vio *vio, const gptr buf, int size); int vio_close_pipe(Vio * vio); @@ -197,6 +198,7 @@ struct st_vio HANDLE event_server_read; HANDLE event_client_wrote; HANDLE event_client_read; + HANDLE event_conn_closed; long shared_memory_remain; char *shared_memory_pos; NET *net; diff --git a/sql-common/client.c b/sql-common/client.c index b847c467b85..0714ca4291f 100644 --- a/sql-common/client.c +++ b/sql-common/client.c @@ -396,6 +396,7 @@ HANDLE create_shared_memory(MYSQL *mysql,NET *net, uint connect_timeout) HANDLE event_server_read = NULL; HANDLE event_client_wrote = NULL; HANDLE event_client_read = NULL; + HANDLE event_conn_closed = NULL; HANDLE handle_file_map = NULL; ulong connect_number; char connect_number_char[22], *p; @@ -508,6 +509,13 @@ HANDLE create_shared_memory(MYSQL *mysql,NET *net, uint connect_timeout) error_allow = CR_SHARED_MEMORY_EVENT_ERROR; goto err2; } + + strmov(suffix_pos, "CONNECTION_CLOSED"); + if ((event_conn_closed = OpenEvent(EVENT_ALL_ACCESS,FALSE,tmp)) == NULL) + { + error_allow = CR_SHARED_MEMORY_EVENT_ERROR; + goto err2; + } /* Set event that server should send data */ @@ -519,7 +527,7 @@ err2: net->vio= vio_new_win32shared_memory(net,handle_file_map,handle_map, event_server_wrote, event_server_read,event_client_wrote, - event_client_read); + event_client_read,event_conn_closed); } else { @@ -532,6 +540,8 @@ err2: CloseHandle(event_client_read); if (event_client_wrote) CloseHandle(event_client_wrote); + if (event_conn_closed) + CloseHandle(event_conn_closed); if (handle_map) UnmapViewOfFile(handle_map); if (handle_file_map) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index e39c902444e..4a6dc037557 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -3813,6 +3813,7 @@ pthread_handler_decl(handle_connections_shared_memory,arg) HANDLE event_client_read= 0; // for transfer data server <-> client HANDLE event_server_wrote= 0; HANDLE event_server_read= 0; + HANDLE event_conn_closed= 0; THD *thd= 0; p= int10_to_str(connect_number, connect_number_char, 10); @@ -3866,6 +3867,12 @@ pthread_handler_decl(handle_connections_shared_memory,arg) errmsg= "Could not create server write event"; goto errorconn; } + strmov(suffix_pos, "CONNECTION_CLOSED"); + if ((event_conn_closed= CreateEvent(0,TRUE,FALSE,tmp)) == 0) + { + errmsg= "Could not create closed connection event"; + goto errorconn; + } if (abort_loop) goto errorconn; if (!(thd= new THD)) @@ -3889,7 +3896,8 @@ pthread_handler_decl(handle_connections_shared_memory,arg) event_client_wrote, event_client_read, event_server_wrote, - event_server_read)) || + event_server_read, + event_conn_closed)) || my_net_init(&thd->net, thd->net.vio)) { close_connection(thd, ER_OUT_OF_RESOURCES, 1); @@ -3916,6 +3924,7 @@ errorconn: if (event_server_read) CloseHandle(event_server_read); if (event_client_wrote) CloseHandle(event_client_wrote); if (event_client_read) CloseHandle(event_client_read); + if (event_conn_closed) CloseHandle(event_conn_closed); delete thd; } diff --git a/vio/vio.c b/vio/vio.c index a356d8edeff..92d69dc5148 100644 --- a/vio/vio.c +++ b/vio/vio.c @@ -171,7 +171,8 @@ Vio *vio_new_win32pipe(HANDLE hPipe) #ifdef HAVE_SMEM Vio *vio_new_win32shared_memory(NET *net,HANDLE handle_file_map, HANDLE handle_map, HANDLE event_server_wrote, HANDLE event_server_read, - HANDLE event_client_wrote, HANDLE event_client_read) + HANDLE event_client_wrote, HANDLE event_client_read, + HANDLE event_conn_closed) { Vio *vio; DBUG_ENTER("vio_new_win32shared_memory"); @@ -184,6 +185,7 @@ Vio *vio_new_win32shared_memory(NET *net,HANDLE handle_file_map, HANDLE handle_m vio->event_server_read = event_server_read; vio->event_client_wrote = event_client_wrote; vio->event_client_read = event_client_read; + vio->event_conn_closed = event_conn_closed; vio->shared_memory_remain = 0; vio->shared_memory_pos = handle_map; vio->net = net; diff --git a/vio/viosocket.c b/vio/viosocket.c index 48a9058480a..caf9451df7a 100644 --- a/vio/viosocket.c +++ b/vio/viosocket.c @@ -381,10 +381,21 @@ int vio_read_shared_memory(Vio * vio, gptr buf, int size) { if (vio->shared_memory_remain == 0) { - if (WaitForSingleObject(vio->event_server_wrote,vio->net->read_timeout*1000) != WAIT_OBJECT_0) + HANDLE events[2]; + events[0]= vio->event_server_wrote; + events[1]= vio->event_conn_closed; + /* + WaitForMultipleObjects can return next values: + WAIT_OBJECT_0+0 - event from vio->event_server_wrote + WAIT_OBJECT_0+1 - event from vio->event_conn_closed. We can't read anything + WAIT_ABANDONED_0 and WAIT_TIMEOUT - fail. We can't read anything + */ + if (WaitForMultipleObjects(2,(HANDLE*)&events,FALSE, + vio->net->read_timeout*1000) != WAIT_OBJECT_0) { DBUG_RETURN(-1); }; + vio->shared_memory_pos = vio->handle_map; vio->shared_memory_remain = uint4korr((ulong*)vio->shared_memory_pos); vio->shared_memory_pos+=4; @@ -454,17 +465,21 @@ int vio_close_shared_memory(Vio * vio) { int r; DBUG_ENTER("vio_close_shared_memory"); - r=UnmapViewOfFile(vio->handle_map) || CloseHandle(vio->event_server_wrote) || - CloseHandle(vio->event_server_read) || CloseHandle(vio->event_client_wrote) || - CloseHandle(vio->event_client_read) || CloseHandle(vio->handle_file_map); - if (r) + if (vio->type != VIO_CLOSED) { - DBUG_PRINT("vio_error", ("close() failed, error: %d",r)); - /* FIXME: error handling (not critical for MySQL) */ + SetEvent(vio->event_conn_closed); + r=UnmapViewOfFile(vio->handle_map) || CloseHandle(vio->event_server_wrote) || + CloseHandle(vio->event_server_read) || CloseHandle(vio->event_client_wrote) || + CloseHandle(vio->event_client_read) || CloseHandle(vio->handle_file_map); + if (!r) + { + DBUG_PRINT("vio_error", ("close() failed, error: %d",r)); + /* FIXME: error handling (not critical for MySQL) */ + } } vio->type= VIO_CLOSED; vio->sd= -1; - DBUG_RETURN(r); + DBUG_RETURN(!r); } #endif /* HAVE_SMEM */ #endif /* __WIN__ */ From e938cfcea6e12babc71d5c28789d4e876ae0021a Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 14 Dec 2004 18:47:34 +0400 Subject: [PATCH 0517/1063] Clean-up. TYPE=MyISAM replaced with ENGINE=MyISAM. --- mysql-test/r/subselect.result | 4 +--- mysql-test/t/subselect.test | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index fc23331ad7b..0735f133e6f 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -2115,9 +2115,7 @@ GovernmentForm char(45) NOT NULL default '', HeadOfState char(60) default NULL, Capital int(11) default NULL, Code2 char(2) NOT NULL default '' -) TYPE=MyISAM; -Warnings: -Warning 1287 'TYPE=storage_engine' is deprecated; use 'ENGINE=storage_engine' instead +) ENGINE=MyISAM; INSERT INTO t1 VALUES ('XXX','Xxxxx','Oceania','Xxxxxx',26.00,0,0,0,0,0,'Xxxxx','Xxxxx','Xxxxx',NULL,'XX'); INSERT INTO t1 VALUES ('ASM','American Samoa','Oceania','Polynesia',199.00,0,68000,75.1,334.00,NULL,'Amerika Samoa','US Territory','George W. Bush',54,'AS'); INSERT INTO t1 VALUES ('ATF','French Southern territories','Antarctica','Antarctica',7780.00,0,0,NULL,0.00,NULL,'Terres australes françaises','Nonmetropolitan Territory of France','Jacques Chirac',NULL,'TF'); diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test index b5b5de069bf..f59851fa722 100644 --- a/mysql-test/t/subselect.test +++ b/mysql-test/t/subselect.test @@ -1378,7 +1378,7 @@ CREATE TABLE t1 ( HeadOfState char(60) default NULL, Capital int(11) default NULL, Code2 char(2) NOT NULL default '' -) TYPE=MyISAM; +) ENGINE=MyISAM; INSERT INTO t1 VALUES ('XXX','Xxxxx','Oceania','Xxxxxx',26.00,0,0,0,0,0,'Xxxxx','Xxxxx','Xxxxx',NULL,'XX'); INSERT INTO t1 VALUES ('ASM','American Samoa','Oceania','Polynesia',199.00,0,68000,75.1,334.00,NULL,'Amerika Samoa','US Territory','George W. Bush',54,'AS'); INSERT INTO t1 VALUES ('ATF','French Southern territories','Antarctica','Antarctica',7780.00,0,0,NULL,0.00,NULL,'Terres australes françaises','Nonmetropolitan Territory of France','Jacques Chirac',NULL,'TF'); From 83fce55a3ae79c0033e372cb7ec48a3248307d6e Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 15 Dec 2004 01:37:22 +0300 Subject: [PATCH 0518/1063] A fix of return value of mysql_stmt_bind_result() and cleanup. include/errmsg.h: New libmysql error status code CR_NO_STMT_METADATA libmysql/errmsg.c: Error message for CR_STMT_NO_METADATA. Adding an empty line to shorten further diffs when new error messages are added (as suggested by Monty). libmysql/libmysql.c: Return error from mysql_stmt_bind_result() if the statement contains no metadata. A few comments fixed. tests/client_test.c: Tests fixed: mysql_stmt_bind_result now returns error if there is no metadata. --- include/errmsg.h | 1 + libmysql/errmsg.c | 12 +++++++++--- libmysql/libmysql.c | 15 +++++++-------- tests/client_test.c | 5 +---- 4 files changed, 18 insertions(+), 15 deletions(-) diff --git a/include/errmsg.h b/include/errmsg.h index 6115b24a3d8..96977227666 100644 --- a/include/errmsg.h +++ b/include/errmsg.h @@ -90,3 +90,4 @@ extern const char *client_errors[]; /* Error messages */ #define CR_SECURE_AUTH 2049 #define CR_FETCH_CANCELED 2050 #define CR_NO_DATA 2051 +#define CR_NO_STMT_METADATA 2052 diff --git a/libmysql/errmsg.c b/libmysql/errmsg.c index 710bf4ccd8d..5fa94e5ff0d 100644 --- a/libmysql/errmsg.c +++ b/libmysql/errmsg.c @@ -78,7 +78,9 @@ const char *client_errors[]= "Invalid connection handle", "Connection using old (pre-4.1.1) authentication protocol refused (client option 'secure_auth' enabled)", "Row retrieval was canceled by mysql_stmt_close() call", - "Attempt to read column without prior row fetch" + "Attempt to read column without prior row fetch", + "Prepared statement contains no metadata", + "" }; /* Start of code added by Roberto M. Serqueira - martinsc@uol.com.br - 05.24.2001 */ @@ -137,7 +139,9 @@ const char *client_errors[]= "Invalid connection handle", "Connection using old (pre-4.1.1) authentication protocol refused (client option 'secure_auth' enabled)", "Row retrieval was canceled by mysql_stmt_close() call", - "Attempt to read column without prior row fetch" + "Attempt to read column without prior row fetch", + "Prepared statement contains no metadata", + "" }; #else /* ENGLISH */ @@ -194,7 +198,9 @@ const char *client_errors[]= "Invalid connection handle", "Connection using old (pre-4.1.1) authentication protocol refused (client option 'secure_auth' enabled)", "Row retrieval was canceled by mysql_stmt_close() call", - "Attempt to read column without prior row fetch" + "Attempt to read column without prior row fetch", + "Prepared statement contains no metadata", + "" }; #endif diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index 8989dc18fd7..a71e99a5642 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -2139,12 +2139,12 @@ static void update_stmt_fields(MYSQL_STMT *stmt) DESCRIPTION This function should be used after mysql_stmt_execute(). You can safely check that prepared statement has a result set by calling - mysql_stmt_num_fields(): if number of fields is not zero, you can call + mysql_stmt_field_count(): if number of fields is not zero, you can call this function to get fields metadata. Next steps you may want to make: - find out number of columns in result set by calling mysql_num_fields(res) (the same value is returned by - mysql_stmt_num_fields) + mysql_stmt_field_count()) - fetch metadata for any column with mysql_fetch_field, mysql_fetch_field_direct, mysql_fetch_fields, mysql_field_seek. - free returned MYSQL_RES structure with mysql_free_result. @@ -3882,11 +3882,10 @@ my_bool STDCALL mysql_stmt_bind_result(MYSQL_STMT *stmt, MYSQL_BIND *bind) if (!bind_count) { - if ((int) stmt->state < (int) MYSQL_STMT_PREPARE_DONE) - { - set_stmt_error(stmt, CR_NO_PREPARE_STMT, unknown_sqlstate); - } - DBUG_RETURN(0); + int errorcode= (int) stmt->state < (int) MYSQL_STMT_PREPARE_DONE ? + CR_NO_PREPARE_STMT : CR_NO_STMT_METADATA; + set_stmt_error(stmt, errorcode, unknown_sqlstate); + DBUG_RETURN(1); } /* @@ -4278,7 +4277,7 @@ static void stmt_update_metadata(MYSQL_STMT *stmt, MYSQL_ROWS *data) row+= (stmt->field_count+9)/8; /* skip null bits */ bit= 4; /* first 2 bits are reserved */ - /* Go throw all fields and calculate metadata */ + /* Go through all fields and calculate metadata */ for (bind= stmt->bind, end= bind + stmt->field_count, field= stmt->fields ; bind < end ; bind++, field++) diff --git a/tests/client_test.c b/tests/client_test.c index b78339cc9bb..fb130a17361 100644 --- a/tests/client_test.c +++ b/tests/client_test.c @@ -5636,9 +5636,6 @@ static void test_subselect() rc= mysql_stmt_bind_param(stmt, bind); check_execute(stmt, rc); - rc= mysql_stmt_bind_result(stmt, bind); - check_execute(stmt, rc); - id= 2; rc= mysql_stmt_execute(stmt); check_execute(stmt, rc); @@ -5982,7 +5979,7 @@ static void test_pure_coverage() check_execute(stmt, rc); rc= mysql_stmt_bind_result(stmt, (MYSQL_BIND*)0); - check_execute(stmt, rc); + DIE_UNLESS(rc == 1); mysql_stmt_close(stmt); From 33959dc1a4fa638e67bb98892a466692b9ba402e Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 15 Dec 2004 12:36:01 +0100 Subject: [PATCH 0519/1063] fix for bug #7285: Disable start of embedded server when need to connect to an external server with mysqld. libmysql/libmysql.c: fix for bug #7285: Disable start of embedded server when need to connect to an external server with libmysqld. Calling mysql_server_init with a negative value for argc will not start the embedded server. --- libmysql/libmysql.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index a71e99a5642..b180e86392d 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -158,7 +158,8 @@ int STDCALL mysql_server_init(int argc __attribute__((unused)), (void) signal(SIGPIPE, SIG_IGN); #endif #ifdef EMBEDDED_LIBRARY - result= init_embedded_server(argc, argv, groups); + if (argc > -1) + result= init_embedded_server(argc, argv, groups); #endif } #ifdef THREAD From b857b6e763d8cd2329c48911a0e82d5506d3d184 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 16 Dec 2004 02:43:35 +0300 Subject: [PATCH 0520/1063] myisam/sort.c:my_var_write and mysys/hash.c:hash_key made static inline, not simply inline, to fix the linking failure on Sun Solaris 9 (sparc) with Sun Studio 9, reported by Peter Harvey. myisam/sort.c: my_var_write made static inline (fix for a link failure) mysys/hash.c: hash_key made static inline (fix a link failure) --- myisam/sort.c | 7 +++++-- mysys/hash.c | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/myisam/sort.c b/myisam/sort.c index 3dc066e877c..39bde41e4c9 100644 --- a/myisam/sort.c +++ b/myisam/sort.c @@ -84,7 +84,9 @@ static int NEAR_F write_merge_key_varlen(MI_SORT_PARAM *info, IO_CACHE *to_file, char* key, uint sort_length, uint count); -inline int my_var_write(MI_SORT_PARAM *info,IO_CACHE *to_file, byte *bufs); +static inline int +my_var_write(MI_SORT_PARAM *info, IO_CACHE *to_file, byte *bufs); + /* Creates a index of sorted keys @@ -625,7 +627,8 @@ static int NEAR_F write_keys(MI_SORT_PARAM *info, register uchar **sort_keys, } /* write_keys */ -inline int my_var_write(MI_SORT_PARAM *info, IO_CACHE *to_file, byte *bufs) +static inline int +my_var_write(MI_SORT_PARAM *info, IO_CACHE *to_file, byte *bufs) { int err; uint16 len = _mi_keylength(info->keyinfo, (uchar*) bufs); diff --git a/mysys/hash.c b/mysys/hash.c index d068299d44e..451bc1eb7f5 100644 --- a/mysys/hash.c +++ b/mysys/hash.c @@ -146,7 +146,7 @@ void hash_reset(HASH *hash) handle inline functions that are not defined as native types */ -inline char* +static inline char* hash_key(HASH *hash,const byte *record,uint *length,my_bool first) { if (hash->get_key) From 1fa33736d3d0d21d53284460b1cfd94ca258e527 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 16 Dec 2004 13:34:25 +0100 Subject: [PATCH 0521/1063] - bumped up version number in configure.in from 4.1.8 to 4.1.9 - tagged ChangeSet 1.2173 as "mysql-4.1.8" configure.in: - bumped up version number from 4.1.8 to 4.1.9 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 4131db9c66d..760e7ee20fb 100644 --- a/configure.in +++ b/configure.in @@ -5,7 +5,7 @@ AC_INIT(sql/mysqld.cc) AC_CANONICAL_SYSTEM # The Docs Makefile.am parses this line! # remember to also change ndb version below and update version.c in ndb -AM_INIT_AUTOMAKE(mysql, 4.1.8) +AM_INIT_AUTOMAKE(mysql, 4.1.9) AM_CONFIG_HEADER(config.h) PROTOCOL_VERSION=10 From bfa45f2fa2aa9dfd7bb8cdea974ade3af7867b08 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 16 Dec 2004 16:16:28 +0300 Subject: [PATCH 0522/1063] Making 4.1 tree compile with -ansi -pedantic include/raid.h: Fixing compile-time warning: pragma interface is not supported in C, let's move it to C++ part of the header. ndb/include/kernel/signaldata/CreateEvnt.hpp: - remove extra erroneous ; from ends of function definitions ndb/include/kernel/signaldata/PackedSignal.hpp: - remove extra erroneous ; from ends of function definitions ndb/include/kernel/signaldata/SumaImpl.hpp: - remove extra erroneous ; from ends of function definitions ndb/src/common/debugger/signaldata/DictTabInfo.cpp: - remove extra erroneous ; from ends of function definitions ndb/src/common/debugger/signaldata/NFCompleteRep.cpp: - remove extra erroneous ; from ends of function definitions ndb/src/common/logger/FileLogHandler.cpp: - remove extra erroneous ; from ends of function definitions ndb/src/kernel/blocks/backup/BackupInit.cpp: - remove extra erroneous ; from ends of function definitions ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp: - remove extra erroneous ; from ends of function definitions ndb/src/kernel/blocks/dbacc/DbaccInit.cpp: - remove extra erroneous ; from ends of function definitions ndb/src/kernel/blocks/dbdict/Dbdict.cpp: - remove extra erroneous ; from ends of function definitions ndb/src/kernel/blocks/dbdih/DbdihInit.cpp: - remove extra erroneous ; from ends of function definitions ndb/src/kernel/blocks/dblqh/DblqhInit.cpp: - remove extra erroneous ; from ends of function definitions ndb/src/kernel/blocks/dbtc/DbtcInit.cpp: - remove extra erroneous ; from ends of function definitions ndb/src/kernel/blocks/dbtup/DbtupGen.cpp: - remove extra erroneous ; from ends of function definitions ndb/src/kernel/blocks/dbtux/Dbtux.hpp: - remove extra erroneous ; from ends of function definitions ndb/src/kernel/blocks/dbtux/DbtuxGen.cpp: - remove extra erroneous ; from ends of function definitions ndb/src/kernel/blocks/dbutil/DbUtil.cpp: - remove extra erroneous ; from ends of function definitions ndb/src/kernel/blocks/grep/GrepInit.cpp: - remove extra erroneous ; from ends of function definitions ndb/src/kernel/blocks/ndbcntr/NdbcntrInit.cpp: - remove extra erroneous ; from ends of function definitions ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp: - remove extra erroneous ; from ends of function definitions ndb/src/kernel/blocks/ndbfs/VoidFs.cpp: - remove extra erroneous ; from ends of function definitions ndb/src/kernel/blocks/qmgr/QmgrInit.cpp: - remove extra erroneous ; from ends of function definitions ndb/src/kernel/blocks/suma/Suma.cpp: - remove extra erroneous ; from ends of function definitions ndb/src/kernel/blocks/suma/SumaInit.cpp: - remove extra erroneous ; from ends of function definitions ndb/src/kernel/blocks/trix/Trix.cpp: - remove extra erroneous ; from ends of function definitions ndb/src/mgmsrv/MgmtSrvr.cpp: - remove extra erroneous ; from ends of function definitions ndb/src/ndbapi/NdbEventOperation.cpp: - remove extra erroneous ; from ends of function definitions ndb/src/ndbapi/NdbScanFilter.cpp: - remove extra erroneous ; from ends of function definitions ndb/tools/restore/Restore.cpp: - remove extra erroneous ; from ends of function definitions sql/item_create.h: - remove extra erroneous ; sql/sql_cache.cc: - remove extra erroneous ; tests/client_test.c: - fix -pedantic warning --- include/raid.h | 7 ++++--- ndb/include/kernel/signaldata/CreateEvnt.hpp | 8 ++++---- ndb/include/kernel/signaldata/PackedSignal.hpp | 2 +- ndb/include/kernel/signaldata/SumaImpl.hpp | 18 +++++++++--------- .../common/debugger/signaldata/DictTabInfo.cpp | 2 +- .../debugger/signaldata/NFCompleteRep.cpp | 2 +- ndb/src/common/logger/FileLogHandler.cpp | 6 +++--- ndb/src/kernel/blocks/backup/BackupInit.cpp | 2 +- ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp | 2 +- ndb/src/kernel/blocks/dbacc/DbaccInit.cpp | 2 +- ndb/src/kernel/blocks/dbdict/Dbdict.cpp | 2 +- ndb/src/kernel/blocks/dbdih/DbdihInit.cpp | 2 +- ndb/src/kernel/blocks/dblqh/DblqhInit.cpp | 2 +- ndb/src/kernel/blocks/dbtc/DbtcInit.cpp | 2 +- ndb/src/kernel/blocks/dbtup/DbtupGen.cpp | 2 +- ndb/src/kernel/blocks/dbtux/Dbtux.hpp | 4 ++-- ndb/src/kernel/blocks/dbtux/DbtuxGen.cpp | 2 +- ndb/src/kernel/blocks/dbutil/DbUtil.cpp | 2 +- ndb/src/kernel/blocks/grep/GrepInit.cpp | 2 +- ndb/src/kernel/blocks/ndbcntr/NdbcntrInit.cpp | 2 +- ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp | 2 +- ndb/src/kernel/blocks/ndbfs/VoidFs.cpp | 2 +- ndb/src/kernel/blocks/qmgr/QmgrInit.cpp | 2 +- ndb/src/kernel/blocks/suma/Suma.cpp | 2 +- ndb/src/kernel/blocks/suma/SumaInit.cpp | 4 ++-- ndb/src/kernel/blocks/trix/Trix.cpp | 2 +- ndb/src/mgmsrv/MgmtSrvr.cpp | 2 +- ndb/src/ndbapi/NdbEventOperation.cpp | 2 +- ndb/src/ndbapi/NdbScanFilter.cpp | 4 ++-- ndb/tools/restore/Restore.cpp | 8 ++++---- sql/item_create.h | 2 +- sql/sql_cache.cc | 2 +- tests/client_test.c | 6 +++--- 33 files changed, 57 insertions(+), 56 deletions(-) diff --git a/include/raid.h b/include/raid.h index b5a5e665824..04c54393e54 100644 --- a/include/raid.h +++ b/include/raid.h @@ -32,9 +32,6 @@ C_MODE_END #endif #if defined(USE_RAID) -#ifdef __GNUC__ -#pragma interface /* gcc class implementation */ -#endif #include "my_dir.h" /* Trap all occurences of my_...() in source and use our wrapper around this function */ @@ -92,6 +89,10 @@ extern "C" { #ifdef __cplusplus } +#ifdef __GNUC__ +#pragma interface /* gcc class implementation */ +#endif + class RaidName { public: RaidName(const char *FileName); diff --git a/ndb/include/kernel/signaldata/CreateEvnt.hpp b/ndb/include/kernel/signaldata/CreateEvnt.hpp index 65a07c122a2..e911fa36ce6 100644 --- a/ndb/include/kernel/signaldata/CreateEvnt.hpp +++ b/ndb/include/kernel/signaldata/CreateEvnt.hpp @@ -475,14 +475,14 @@ struct CreateEvntRef { } }; inline bool CreateEvntRef::isTemporary() const -{ return (errorCode & CreateEvntRef::Temporary) > 0; }; +{ return (errorCode & CreateEvntRef::Temporary) > 0; } inline void CreateEvntRef::setTemporary() -{ errorCode |= CreateEvntRef::Temporary; }; +{ errorCode |= CreateEvntRef::Temporary; } inline CreateEvntRef::ErrorCode CreateEvntRef::setTemporary(ErrorCode ec) { return (CreateEvntRef::ErrorCode) - (errorCode = ((Uint32) ec | (Uint32)CreateEvntRef::Temporary)); }; + (errorCode = ((Uint32) ec | (Uint32)CreateEvntRef::Temporary)); } inline CreateEvntRef::ErrorCode CreateEvntRef::makeTemporary(ErrorCode ec) { return (CreateEvntRef::ErrorCode) - ( (Uint32) ec | (Uint32)CreateEvntRef::Temporary ); }; + ( (Uint32) ec | (Uint32)CreateEvntRef::Temporary ); } #endif diff --git a/ndb/include/kernel/signaldata/PackedSignal.hpp b/ndb/include/kernel/signaldata/PackedSignal.hpp index 057bb39b25a..ea0ff6db526 100644 --- a/ndb/include/kernel/signaldata/PackedSignal.hpp +++ b/ndb/include/kernel/signaldata/PackedSignal.hpp @@ -38,6 +38,6 @@ class PackedSignal { }; inline -Uint32 PackedSignal::getSignalType(Uint32 data) { return data >> 28; }; +Uint32 PackedSignal::getSignalType(Uint32 data) { return data >> 28; } #endif diff --git a/ndb/include/kernel/signaldata/SumaImpl.hpp b/ndb/include/kernel/signaldata/SumaImpl.hpp index 089132cd9aa..89ade067dcd 100644 --- a/ndb/include/kernel/signaldata/SumaImpl.hpp +++ b/ndb/include/kernel/signaldata/SumaImpl.hpp @@ -159,12 +159,12 @@ public: Uint32 subscriberRef; }; inline bool SubStartRef::isTemporary() const -{ return (errorCode & SubStartRef::Temporary) > 0; }; +{ return (errorCode & SubStartRef::Temporary) > 0; } inline void SubStartRef::setTemporary() -{ errorCode |= SubStartRef::Temporary; }; +{ errorCode |= SubStartRef::Temporary; } inline SubStartRef::ErrorCode SubStartRef::setTemporary(ErrorCode ec) { return (SubStartRef::ErrorCode) - (errorCode = ((Uint32) ec | (Uint32)SubStartRef::Temporary)); }; + (errorCode = ((Uint32) ec | (Uint32)SubStartRef::Temporary)); } class SubStartConf { /** @@ -239,12 +239,12 @@ public: }; }; inline bool SubStopRef::isTemporary() const -{ return (errorCode & SubStopRef::Temporary) > 0; }; +{ return (errorCode & SubStopRef::Temporary) > 0; } inline void SubStopRef::setTemporary() -{ errorCode |= SubStopRef::Temporary; }; +{ errorCode |= SubStopRef::Temporary; } inline SubStopRef::ErrorCode SubStopRef::setTemporary(ErrorCode ec) { return (SubStopRef::ErrorCode) - (errorCode = ((Uint32) ec | (Uint32)SubStopRef::Temporary)); }; + (errorCode = ((Uint32) ec | (Uint32)SubStopRef::Temporary)); } class SubStopConf { /** @@ -515,12 +515,12 @@ public: }; }; inline bool SubRemoveRef::isTemporary() const -{ return (err & SubRemoveRef::Temporary) > 0; }; +{ return (err & SubRemoveRef::Temporary) > 0; } inline void SubRemoveRef::setTemporary() -{ err |= SubRemoveRef::Temporary; }; +{ err |= SubRemoveRef::Temporary; } inline SubRemoveRef::ErrorCode SubRemoveRef::setTemporary(ErrorCode ec) { return (SubRemoveRef::ErrorCode) - (errorCode = ((Uint32) ec | (Uint32)SubRemoveRef::Temporary)); }; + (errorCode = ((Uint32) ec | (Uint32)SubRemoveRef::Temporary)); } class SubRemoveConf { /** diff --git a/ndb/src/common/debugger/signaldata/DictTabInfo.cpp b/ndb/src/common/debugger/signaldata/DictTabInfo.cpp index 7e7bf87e2db..c6165532ddb 100644 --- a/ndb/src/common/debugger/signaldata/DictTabInfo.cpp +++ b/ndb/src/common/debugger/signaldata/DictTabInfo.cpp @@ -152,4 +152,4 @@ DictTabInfo::Attribute::init(){ AttributeExtLength = 0, AttributeAutoIncrement = false; memset(AttributeDefaultValue, 0, sizeof(AttributeDefaultValue));//AttributeDefaultValue[0] = 0; -}; +} diff --git a/ndb/src/common/debugger/signaldata/NFCompleteRep.cpp b/ndb/src/common/debugger/signaldata/NFCompleteRep.cpp index 20f7ea99871..f2d6f2f104a 100644 --- a/ndb/src/common/debugger/signaldata/NFCompleteRep.cpp +++ b/ndb/src/common/debugger/signaldata/NFCompleteRep.cpp @@ -41,4 +41,4 @@ printNF_COMPLETE_REP(FILE * output, sig->from); return true; -}; +} diff --git a/ndb/src/common/logger/FileLogHandler.cpp b/ndb/src/common/logger/FileLogHandler.cpp index 29172ff93ad..cdc33eb349c 100644 --- a/ndb/src/common/logger/FileLogHandler.cpp +++ b/ndb/src/common/logger/FileLogHandler.cpp @@ -198,7 +198,7 @@ FileLogHandler::setFilename(const BaseString &filename) { m_pLogFile = new File_class(filename.c_str(), "a+"); open(); return true; -}; +} bool FileLogHandler::setMaxSize(const BaseString &size) { @@ -214,7 +214,7 @@ FileLogHandler::setMaxSize(const BaseString &size) { m_maxFileSize = val; return true; -}; +} bool FileLogHandler::setMaxFiles(const BaseString &files) { @@ -225,7 +225,7 @@ FileLogHandler::setMaxFiles(const BaseString &files) { m_maxNoFiles = val; return true; -}; +} bool FileLogHandler::checkParams() { diff --git a/ndb/src/kernel/blocks/backup/BackupInit.cpp b/ndb/src/kernel/blocks/backup/BackupInit.cpp index 37c579bfe84..e0171c61eca 100644 --- a/ndb/src/kernel/blocks/backup/BackupInit.cpp +++ b/ndb/src/kernel/blocks/backup/BackupInit.cpp @@ -205,7 +205,7 @@ Backup::~Backup() { } -BLOCK_FUNCTIONS(Backup); +BLOCK_FUNCTIONS(Backup) template class ArrayPool; template class ArrayPool; diff --git a/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp b/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp index af8668180f9..923277f7c8b 100644 --- a/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp +++ b/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp @@ -1110,7 +1110,7 @@ Cmvmi::execDUMP_STATE_ORD(Signal* signal) }//Cmvmi::execDUMP_STATE_ORD() -BLOCK_FUNCTIONS(Cmvmi); +BLOCK_FUNCTIONS(Cmvmi) static Uint32 g_print; static LinearSectionPtr g_test[3]; diff --git a/ndb/src/kernel/blocks/dbacc/DbaccInit.cpp b/ndb/src/kernel/blocks/dbacc/DbaccInit.cpp index 2705f95f6dd..95b336a0a65 100644 --- a/ndb/src/kernel/blocks/dbacc/DbaccInit.cpp +++ b/ndb/src/kernel/blocks/dbacc/DbaccInit.cpp @@ -264,4 +264,4 @@ Dbacc::~Dbacc() }//Dbacc::~Dbacc() -BLOCK_FUNCTIONS(Dbacc); +BLOCK_FUNCTIONS(Dbacc) diff --git a/ndb/src/kernel/blocks/dbdict/Dbdict.cpp b/ndb/src/kernel/blocks/dbdict/Dbdict.cpp index 2b9072ab042..5e15917f720 100644 --- a/ndb/src/kernel/blocks/dbdict/Dbdict.cpp +++ b/ndb/src/kernel/blocks/dbdict/Dbdict.cpp @@ -1192,7 +1192,7 @@ Dbdict::~Dbdict() { }//Dbdict::~Dbdict() -BLOCK_FUNCTIONS(Dbdict); +BLOCK_FUNCTIONS(Dbdict) void Dbdict::initCommonData() { diff --git a/ndb/src/kernel/blocks/dbdih/DbdihInit.cpp b/ndb/src/kernel/blocks/dbdih/DbdihInit.cpp index 7ca45ef4b43..b823dbcd952 100644 --- a/ndb/src/kernel/blocks/dbdih/DbdihInit.cpp +++ b/ndb/src/kernel/blocks/dbdih/DbdihInit.cpp @@ -314,7 +314,7 @@ Dbdih::~Dbdih() }//Dbdih::~Dbdih() -BLOCK_FUNCTIONS(Dbdih); +BLOCK_FUNCTIONS(Dbdih) diff --git a/ndb/src/kernel/blocks/dblqh/DblqhInit.cpp b/ndb/src/kernel/blocks/dblqh/DblqhInit.cpp index d0fef8753cb..0577aa4d344 100644 --- a/ndb/src/kernel/blocks/dblqh/DblqhInit.cpp +++ b/ndb/src/kernel/blocks/dblqh/DblqhInit.cpp @@ -454,5 +454,5 @@ Dblqh::~Dblqh() ctcNodeFailrecFileSize); }//Dblqh::~Dblqh() -BLOCK_FUNCTIONS(Dblqh); +BLOCK_FUNCTIONS(Dblqh) diff --git a/ndb/src/kernel/blocks/dbtc/DbtcInit.cpp b/ndb/src/kernel/blocks/dbtc/DbtcInit.cpp index e38089242c3..5c66ba776b0 100644 --- a/ndb/src/kernel/blocks/dbtc/DbtcInit.cpp +++ b/ndb/src/kernel/blocks/dbtc/DbtcInit.cpp @@ -365,5 +365,5 @@ Dbtc::~Dbtc() capiConnectFilesize); }//Dbtc::~Dbtc() -BLOCK_FUNCTIONS(Dbtc); +BLOCK_FUNCTIONS(Dbtc) diff --git a/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp b/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp index d33adcd08e1..8e1cba24359 100644 --- a/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp +++ b/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp @@ -215,7 +215,7 @@ Dbtup::~Dbtup() }//Dbtup::~Dbtup() -BLOCK_FUNCTIONS(Dbtup); +BLOCK_FUNCTIONS(Dbtup) /* **************************************************************** */ /* ---------------------------------------------------------------- */ diff --git a/ndb/src/kernel/blocks/dbtux/Dbtux.hpp b/ndb/src/kernel/blocks/dbtux/Dbtux.hpp index 8f49b7fa6d6..8af83e3c056 100644 --- a/ndb/src/kernel/blocks/dbtux/Dbtux.hpp +++ b/ndb/src/kernel/blocks/dbtux/Dbtux.hpp @@ -1066,7 +1066,7 @@ Dbtux::Index::Index() : m_fragId[i] = ZNIL; m_fragPtrI[i] = RNIL; }; -}; +} // Dbtux::Frag @@ -1103,7 +1103,7 @@ Dbtux::FragOp::FragOp() : m_fragNo(ZNIL), m_numAttrsRecvd(ZNIL) { -}; +} // Dbtux::NodeHandle diff --git a/ndb/src/kernel/blocks/dbtux/DbtuxGen.cpp b/ndb/src/kernel/blocks/dbtux/DbtuxGen.cpp index 18aa914de05..8990d6c86b6 100644 --- a/ndb/src/kernel/blocks/dbtux/DbtuxGen.cpp +++ b/ndb/src/kernel/blocks/dbtux/DbtuxGen.cpp @@ -293,4 +293,4 @@ Dbtux::copyAttrs(const Frag& frag, ConstData data1, Data data2, unsigned maxlen2 #endif } -BLOCK_FUNCTIONS(Dbtux); +BLOCK_FUNCTIONS(Dbtux) diff --git a/ndb/src/kernel/blocks/dbutil/DbUtil.cpp b/ndb/src/kernel/blocks/dbutil/DbUtil.cpp index f7e8981e122..b94bb8e6d7e 100644 --- a/ndb/src/kernel/blocks/dbutil/DbUtil.cpp +++ b/ndb/src/kernel/blocks/dbutil/DbUtil.cpp @@ -158,7 +158,7 @@ DbUtil::~DbUtil() { } -BLOCK_FUNCTIONS(DbUtil); +BLOCK_FUNCTIONS(DbUtil) void DbUtil::releasePrepare(PreparePtr prepPtr) { diff --git a/ndb/src/kernel/blocks/grep/GrepInit.cpp b/ndb/src/kernel/blocks/grep/GrepInit.cpp index cfb454a1f9b..36855f86568 100644 --- a/ndb/src/kernel/blocks/grep/GrepInit.cpp +++ b/ndb/src/kernel/blocks/grep/GrepInit.cpp @@ -132,7 +132,7 @@ Grep::~Grep() { } -BLOCK_FUNCTIONS(Grep); +BLOCK_FUNCTIONS(Grep) Grep::PSPart::PSPart(Grep * sb) : BlockComponent(sb), diff --git a/ndb/src/kernel/blocks/ndbcntr/NdbcntrInit.cpp b/ndb/src/kernel/blocks/ndbcntr/NdbcntrInit.cpp index 43044eeebcd..c7b472fc91a 100644 --- a/ndb/src/kernel/blocks/ndbcntr/NdbcntrInit.cpp +++ b/ndb/src/kernel/blocks/ndbcntr/NdbcntrInit.cpp @@ -114,4 +114,4 @@ Ndbcntr::~Ndbcntr() }//Ndbcntr::~Ndbcntr() -BLOCK_FUNCTIONS(Ndbcntr); +BLOCK_FUNCTIONS(Ndbcntr) diff --git a/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp b/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp index 56e3d3abbed..d30b956e74a 100644 --- a/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp +++ b/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp @@ -1010,7 +1010,7 @@ Ndbfs::execDUMP_STATE_ORD(Signal* signal) -BLOCK_FUNCTIONS(Ndbfs); +BLOCK_FUNCTIONS(Ndbfs) template class Vector; template class Vector; diff --git a/ndb/src/kernel/blocks/ndbfs/VoidFs.cpp b/ndb/src/kernel/blocks/ndbfs/VoidFs.cpp index d3407e8d4e7..d093089acfc 100644 --- a/ndb/src/kernel/blocks/ndbfs/VoidFs.cpp +++ b/ndb/src/kernel/blocks/ndbfs/VoidFs.cpp @@ -196,5 +196,5 @@ VoidFs::execDUMP_STATE_ORD(Signal* signal) -BLOCK_FUNCTIONS(VoidFs); +BLOCK_FUNCTIONS(VoidFs) diff --git a/ndb/src/kernel/blocks/qmgr/QmgrInit.cpp b/ndb/src/kernel/blocks/qmgr/QmgrInit.cpp index b0f1088779c..d6960ce154e 100644 --- a/ndb/src/kernel/blocks/qmgr/QmgrInit.cpp +++ b/ndb/src/kernel/blocks/qmgr/QmgrInit.cpp @@ -100,4 +100,4 @@ Qmgr::~Qmgr() }//Qmgr::~Qmgr() -BLOCK_FUNCTIONS(Qmgr); +BLOCK_FUNCTIONS(Qmgr) diff --git a/ndb/src/kernel/blocks/suma/Suma.cpp b/ndb/src/kernel/blocks/suma/Suma.cpp index f6d9a0ac35a..836fa28d9ad 100644 --- a/ndb/src/kernel/blocks/suma/Suma.cpp +++ b/ndb/src/kernel/blocks/suma/Suma.cpp @@ -3553,7 +3553,7 @@ Suma::Restart::Restart(Suma& s) : suma(s) { c_okToStart[i] = false; c_waitingToStart[i] = false; } -}; +} void Suma::Restart::resetNode(Uint32 sumaRef) diff --git a/ndb/src/kernel/blocks/suma/SumaInit.cpp b/ndb/src/kernel/blocks/suma/SumaInit.cpp index 255abd47c94..36217c313af 100644 --- a/ndb/src/kernel/blocks/suma/SumaInit.cpp +++ b/ndb/src/kernel/blocks/suma/SumaInit.cpp @@ -188,6 +188,6 @@ Suma::~Suma() { } -BLOCK_FUNCTIONS(Suma); -BLOCK_FUNCTIONS(SumaParticipant); +BLOCK_FUNCTIONS(Suma) +BLOCK_FUNCTIONS(SumaParticipant) diff --git a/ndb/src/kernel/blocks/trix/Trix.cpp b/ndb/src/kernel/blocks/trix/Trix.cpp index 80cf9f88c0d..75bc19b6a20 100644 --- a/ndb/src/kernel/blocks/trix/Trix.cpp +++ b/ndb/src/kernel/blocks/trix/Trix.cpp @@ -962,6 +962,6 @@ void Trix::checkParallelism(Signal* signal, SubscriptionRecord* subRec) } } -BLOCK_FUNCTIONS(Trix); +BLOCK_FUNCTIONS(Trix) template void append(DataBuffer<15>&,SegmentedSectionPtr,SectionSegmentPool&); diff --git a/ndb/src/mgmsrv/MgmtSrvr.cpp b/ndb/src/mgmsrv/MgmtSrvr.cpp index d0e1207cef0..c6c30a0f520 100644 --- a/ndb/src/mgmsrv/MgmtSrvr.cpp +++ b/ndb/src/mgmsrv/MgmtSrvr.cpp @@ -130,7 +130,7 @@ MgmtSrvr::signalRecvThreadRun() (this->*handler->function)(signal); } } -}; +} EventLogger g_EventLogger; diff --git a/ndb/src/ndbapi/NdbEventOperation.cpp b/ndb/src/ndbapi/NdbEventOperation.cpp index 506a6c8d86d..d209293f8b0 100644 --- a/ndb/src/ndbapi/NdbEventOperation.cpp +++ b/ndb/src/ndbapi/NdbEventOperation.cpp @@ -121,5 +121,5 @@ NdbEventOperation::wait(void *p, int aMillisecondNumber) } NdbEventOperation::NdbEventOperation(NdbEventOperationImpl& impl) - : m_impl(impl) {}; + : m_impl(impl) {} diff --git a/ndb/src/ndbapi/NdbScanFilter.cpp b/ndb/src/ndbapi/NdbScanFilter.cpp index 38b1c70c047..0c851427ba5 100644 --- a/ndb/src/ndbapi/NdbScanFilter.cpp +++ b/ndb/src/ndbapi/NdbScanFilter.cpp @@ -397,7 +397,7 @@ NdbScanFilterImpl::cond_col_const(Interpreter::BinaryCondition op, (m_operation->* branch)(4, 5, m_current.m_ownLabel); return 0; -}; +} int NdbScanFilter::eq(int AttrId, Uint32 value){ @@ -478,7 +478,7 @@ NdbScanFilterImpl::cond_col(Interpreter::UnaryCondition op, Uint32 AttrId){ Branch1 branch = table2[op].m_branches[m_current.m_group]; (m_operation->* branch)(AttrId, m_current.m_ownLabel); return 0; -}; +} int NdbScanFilter::isnull(int AttrId){ diff --git a/ndb/tools/restore/Restore.cpp b/ndb/tools/restore/Restore.cpp index 277cdc72532..fa616ee8fee 100644 --- a/ndb/tools/restore/Restore.cpp +++ b/ndb/tools/restore/Restore.cpp @@ -260,16 +260,16 @@ TupleS & TupleS::operator=(const TupleS& tuple) memcpy(allAttrData, tuple.allAttrData, getNoOfAttributes()*sizeof(AttributeData)); return *this; -}; +} int TupleS::getNoOfAttributes() const { if (m_currentTable == 0) return 0; return m_currentTable->getNoOfAttributes(); -}; +} TableS * TupleS::getTable() const { return m_currentTable; -}; +} const AttributeDesc * TupleS::getDesc(int i) const { return m_currentTable->allAttributesDesc[i]; @@ -277,7 +277,7 @@ const AttributeDesc * TupleS::getDesc(int i) const { AttributeData * TupleS::getData(int i) const{ return &(allAttrData[i]); -}; +} bool TupleS::prepareRecord(TableS & tab){ diff --git a/sql/item_create.h b/sql/item_create.h index 7577627ef04..faff6f45220 100644 --- a/sql/item_create.h +++ b/sql/item_create.h @@ -87,7 +87,7 @@ Item *create_func_soundex(Item* a); Item *create_func_space(Item *); Item *create_func_sqrt(Item* a); Item *create_func_strcmp(Item* a, Item *b); -Item *create_func_tan(Item* a);; +Item *create_func_tan(Item* a); Item *create_func_time_format(Item *a, Item *b); Item *create_func_time_to_sec(Item* a); Item *create_func_to_days(Item* a); diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc index 0e2058d73e9..bd42a2c1720 100644 --- a/sql/sql_cache.cc +++ b/sql/sql_cache.cc @@ -374,7 +374,7 @@ inline Query_cache_block * Query_cache_block_table::block() return (Query_cache_block *)(((byte*)this) - ALIGN_SIZE(sizeof(Query_cache_block_table)*n) - ALIGN_SIZE(sizeof(Query_cache_block))); -}; +} /***************************************************************************** Query_cache_block method(s) diff --git a/tests/client_test.c b/tests/client_test.c index fb130a17361..0575b355b05 100644 --- a/tests/client_test.c +++ b/tests/client_test.c @@ -11320,7 +11320,7 @@ static void test_bug4172() MYSQL_ROW row; int rc; char f[100], d[100], e[100]; - long f_len, d_len, e_len; + ulong f_len, d_len, e_len; myheader("test_bug4172"); @@ -11411,8 +11411,8 @@ static void test_conversion() mysql_stmt_bind_param(stmt, bind); - buff[0]= 0xC3; - buff[1]= 0xA0; + buff[0]= (uchar) 0xC3; + buff[1]= (uchar) 0xA0; length= 2; rc= mysql_stmt_execute(stmt); From 2fb340b5209dda8f71f372fed17d65a0c5814821 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 16 Dec 2004 16:31:50 +0300 Subject: [PATCH 0523/1063] Fix for bug #7297 "Two digit year should be interpreted correctly even with zero month and day" aka "Date decoding trouble" Two digit year should be interpreted correctly as year in 20th or 21st century even with zero month and day. Only exception should be zero date '00-00-00' or '00-00-00 00:00:00'. mysql-test/r/type_datetime.result: Added test for bug #7297 "Two digit year should be interpreted correctly even with zero month and day" mysql-test/t/type_datetime.test: Added test for bug #7297 "Two digit year should be interpreted correctly even with zero month and day" sql/time.cc: str_to_TIME(): Two digit year should be interpreted correctly as year in 20th or 21st century even with zero month and day. Only exception should be zero date '00-00-00' or '00-00-00 00:00:00'. --- mysql-test/r/type_datetime.result | 10 ++++++++++ mysql-test/t/type_datetime.test | 12 ++++++++++++ sql/time.cc | 2 +- 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/type_datetime.result b/mysql-test/r/type_datetime.result index 756deab80e0..fcadba016fa 100644 --- a/mysql-test/r/type_datetime.result +++ b/mysql-test/r/type_datetime.result @@ -102,3 +102,13 @@ insert into t1 values (now(), now()); select * from t1 where a is null or b is null; a b drop table t1; +create table t1 (dt datetime); +insert into t1 values ("12-00-00"), ("00-00-00 01:00:00"); +insert into t1 values ("00-00-00"), ("00-00-00 00:00:00"); +select * from t1; +dt +2012-00-00 00:00:00 +2000-00-00 01:00:00 +0000-00-00 00:00:00 +0000-00-00 00:00:00 +drop table t1; diff --git a/mysql-test/t/type_datetime.test b/mysql-test/t/type_datetime.test index 850e5238111..a7f9004d062 100644 --- a/mysql-test/t/type_datetime.test +++ b/mysql-test/t/type_datetime.test @@ -68,3 +68,15 @@ insert into t1 values (now(), now()); insert into t1 values (now(), now()); select * from t1 where a is null or b is null; drop table t1; + +# +# Test for bug #7297 "Two digit year should be interpreted correctly even +# with zero month and day" +# +create table t1 (dt datetime); +# These dates should be treated as dates in 21st century +insert into t1 values ("12-00-00"), ("00-00-00 01:00:00"); +# Zero dates are still special :/ +insert into t1 values ("00-00-00"), ("00-00-00 00:00:00"); +select * from t1; +drop table t1; diff --git a/sql/time.cc b/sql/time.cc index 38670db054f..d8b4b80e351 100644 --- a/sql/time.cc +++ b/sql/time.cc @@ -410,7 +410,7 @@ str_to_TIME(const char *str, uint length, TIME *l_time,bool fuzzy_date) else date[6]=0; - if (year_length == 2 && i >=2 && (date[1] || date[2])) + if (year_length == 2 && not_zero_date) date[0]+= (date[0] < YY_PART_YEAR ? 2000 : 1900); number_of_fields=i; while (i < 6) From da2c55b3abf214af17624e82d9963ddf8f3851c0 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 16 Dec 2004 18:04:51 +0200 Subject: [PATCH 0524/1063] Test for BUG#6054. The bug itsel is fixed by the fix for #5837. mysql-test/r/update.result: test results mysql-test/t/update.test: bug test --- mysql-test/r/update.result | 6 ++++++ mysql-test/t/update.test | 9 +++++++++ 2 files changed, 15 insertions(+) diff --git a/mysql-test/r/update.result b/mysql-test/r/update.result index c9405d71237..08b7f942ccc 100644 --- a/mysql-test/r/update.result +++ b/mysql-test/r/update.result @@ -203,3 +203,9 @@ colC colA colD colE colF 3 4433 10005 492 500 DROP TABLE t1; DROP TABLE t2; +drop table if exists t1, t2; +create table t1 (c1 int, c2 char(6), c3 int); +create table t2 (c1 int, c2 char(6)); +insert into t1 values (1, "t1c2-1", 10), (2, "t1c2-2", 20); +update t1 left join t2 on t1.c1 = t2.c1 set t2.c2 = "t2c2-1"; +update t1 left join t2 on t1.c1 = t2.c1 set t2.c2 = "t2c2-1" where t1.c3 = 10; diff --git a/mysql-test/t/update.test b/mysql-test/t/update.test index 1850564418c..fdf6a57cc11 100644 --- a/mysql-test/t/update.test +++ b/mysql-test/t/update.test @@ -155,3 +155,12 @@ SELECT * FROM t2; DROP TABLE t1; DROP TABLE t2; +# +# Bug #6054 +# +drop table if exists t1, t2; +create table t1 (c1 int, c2 char(6), c3 int); +create table t2 (c1 int, c2 char(6)); +insert into t1 values (1, "t1c2-1", 10), (2, "t1c2-2", 20); +update t1 left join t2 on t1.c1 = t2.c1 set t2.c2 = "t2c2-1"; +update t1 left join t2 on t1.c1 = t2.c1 set t2.c2 = "t2c2-1" where t1.c3 = 10; From 8722bb9a09a1b1c84f909fc6079601127237028a Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 16 Dec 2004 18:44:39 +0200 Subject: [PATCH 0525/1063] Moved drop table statement to the end. mysql-test/r/update.result: moved drop statement mysql-test/t/update.test: moved drop statement --- mysql-test/r/update.result | 1 + mysql-test/t/update.test | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/update.result b/mysql-test/r/update.result index 08b7f942ccc..2d0903a4dae 100644 --- a/mysql-test/r/update.result +++ b/mysql-test/r/update.result @@ -209,3 +209,4 @@ create table t2 (c1 int, c2 char(6)); insert into t1 values (1, "t1c2-1", 10), (2, "t1c2-2", 20); update t1 left join t2 on t1.c1 = t2.c1 set t2.c2 = "t2c2-1"; update t1 left join t2 on t1.c1 = t2.c1 set t2.c2 = "t2c2-1" where t1.c3 = 10; +drop table t1, t2; diff --git a/mysql-test/t/update.test b/mysql-test/t/update.test index fdf6a57cc11..62439dcc51b 100644 --- a/mysql-test/t/update.test +++ b/mysql-test/t/update.test @@ -158,9 +158,9 @@ DROP TABLE t2; # # Bug #6054 # -drop table if exists t1, t2; create table t1 (c1 int, c2 char(6), c3 int); create table t2 (c1 int, c2 char(6)); insert into t1 values (1, "t1c2-1", 10), (2, "t1c2-2", 20); update t1 left join t2 on t1.c1 = t2.c1 set t2.c2 = "t2c2-1"; update t1 left join t2 on t1.c1 = t2.c1 set t2.c2 = "t2c2-1" where t1.c3 = 10; +drop table t1, t2; From ae6f147a4f65b0392e61c6d447523fa9b6db186f Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 16 Dec 2004 18:46:38 +0200 Subject: [PATCH 0526/1063] Test for BUG#6054. The bug itsel is fixed by the fix for #5837. mysql-test/r/update.result: test result mysql-test/t/update.test: test queries --- mysql-test/r/update.result | 6 ++++++ mysql-test/t/update.test | 9 +++++++++ 2 files changed, 15 insertions(+) diff --git a/mysql-test/r/update.result b/mysql-test/r/update.result index 6d2e623a6fb..beab6105f79 100644 --- a/mysql-test/r/update.result +++ b/mysql-test/r/update.result @@ -206,3 +206,9 @@ colC colA colD colE colF 3 4433 10005 492 500 DROP TABLE t1; DROP TABLE t2; +create table t1 (c1 int, c2 char(6), c3 int); +create table t2 (c1 int, c2 char(6)); +insert into t1 values (1, "t1c2-1", 10), (2, "t1c2-2", 20); +update t1 left join t2 on t1.c1 = t2.c1 set t2.c2 = "t2c2-1"; +update t1 left join t2 on t1.c1 = t2.c1 set t2.c2 = "t2c2-1" where t1.c3 = 10; +drop table t1, t2; diff --git a/mysql-test/t/update.test b/mysql-test/t/update.test index aeefa3c33f5..704263b1216 100644 --- a/mysql-test/t/update.test +++ b/mysql-test/t/update.test @@ -161,3 +161,12 @@ SELECT * FROM t2; DROP TABLE t1; DROP TABLE t2; +# +# Bug #6054 +# +create table t1 (c1 int, c2 char(6), c3 int); +create table t2 (c1 int, c2 char(6)); +insert into t1 values (1, "t1c2-1", 10), (2, "t1c2-2", 20); +update t1 left join t2 on t1.c1 = t2.c1 set t2.c2 = "t2c2-1"; +update t1 left join t2 on t1.c1 = t2.c1 set t2.c2 = "t2c2-1" where t1.c3 = 10; +drop table t1, t2; From 4869f022fd4761445843135102790691e8d48861 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 16 Dec 2004 18:12:22 +0100 Subject: [PATCH 0527/1063] A change of behaviour of Seconds_Behind_Master from SHOW SLAVE STATUS. It's going into 4.1 because old behaviour was somewhat nonsensical (kind of bug). Changes are that if repl threads are down or disconnected the column will be NULL, and if master is idle the column will not grow indefinitely anymore. sql/slave.cc: mi->slave_running and rli->slave_running now uints (was needed only for mi but because of start_slave_thread() usage, had to change both). So mi->slave_running can now take 3 values: not running, running & not connected, running and connected. The last value serves for calculation of Seconds_Behind_Master in SHOW SLAVE STATUS. Changing this column's behaviour: if SQL or I/O thread is not running, or if I/O thread is not connected (for example if it is reconnecting), it's NULL (to mean "unknown"). And if master is idle, the column will not grow indefinitely like it used to (that was meaningless); this is fixed by forcing a value of 0 when the slave SQL thread has hit EOF of relay log (which has only a limited number of caveats explained in comments in code). sql/slave.h: slave_running used to be bool but we need to distinguish, for the I/O slave thread, between "running & connected" and "running & not connected" ("running" means the thread exists). sql/sql_repl.cc: we don't need anymore to set rli->last_master_timestamp to 0 (we used that to make Seconds_Behind_Master be NULL) in RESET SLAVE and CHANGE MASTER, as these commands imply that slave threads are not running and so Seconds_Behind_Master is already NULL because of that. --- sql/slave.cc | 61 ++++++++++++++++++++++++++++++++++++++----------- sql/slave.h | 27 ++++++++++++++++++---- sql/sql_repl.cc | 8 +++---- 3 files changed, 74 insertions(+), 22 deletions(-) diff --git a/sql/slave.cc b/sql/slave.cc index bd9650ed369..90c75243f3d 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -545,7 +545,7 @@ int terminate_slave_threads(MASTER_INFO* mi,int thread_mask,bool skip_lock) int terminate_slave_thread(THD* thd, pthread_mutex_t* term_lock, pthread_mutex_t *cond_lock, pthread_cond_t* term_cond, - volatile bool* slave_running) + volatile uint *slave_running) { if (term_lock) { @@ -583,7 +583,7 @@ int terminate_slave_thread(THD* thd, pthread_mutex_t* term_lock, int start_slave_thread(pthread_handler h_func, pthread_mutex_t *start_lock, pthread_mutex_t *cond_lock, pthread_cond_t *start_cond, - volatile bool *slave_running, + volatile uint *slave_running, volatile ulong *slave_run_id, MASTER_INFO* mi, bool high_priority) @@ -963,7 +963,7 @@ void end_slave() static bool io_slave_killed(THD* thd, MASTER_INFO* mi) { DBUG_ASSERT(mi->io_thd == thd); - DBUG_ASSERT(mi->slave_running == 1); // tracking buffer overrun + DBUG_ASSERT(mi->slave_running); // tracking buffer overrun return mi->abort_slave || abort_loop || thd->killed; } @@ -1767,19 +1767,13 @@ void init_master_info_with_options(MASTER_INFO* mi) strmake(mi->ssl_key, master_ssl_key, sizeof(mi->ssl_key)-1); } -static void clear_slave_error(RELAY_LOG_INFO* rli) +void clear_slave_error(RELAY_LOG_INFO* rli) { /* Clear the errors displayed by SHOW SLAVE STATUS */ rli->last_slave_error[0]= 0; rli->last_slave_errno= 0; } -void clear_slave_error_timestamp(RELAY_LOG_INFO* rli) -{ - rli->last_master_timestamp= 0; - clear_slave_error(rli); -} - /* Reset UNTIL condition for RELAY_LOG_INFO SYNOPSYS @@ -2166,6 +2160,11 @@ int show_master_info(THD* thd, MASTER_INFO* mi) String *packet= &thd->packet; protocol->prepare_for_resend(); + /* + TODO: we read slave_running without run_lock, whereas these variables + are updated under run_lock and not data_lock. In 5.0 we should lock + run_lock on top of data_lock (with good order). + */ pthread_mutex_lock(&mi->data_lock); pthread_mutex_lock(&mi->rli.data_lock); @@ -2226,7 +2225,12 @@ int show_master_info(THD* thd, MASTER_INFO* mi) protocol->store(mi->ssl_cipher, &my_charset_bin); protocol->store(mi->ssl_key, &my_charset_bin); - if (mi->rli.last_master_timestamp) + /* + Seconds_Behind_Master: if SQL thread is running and I/O thread is + connected, we can compute it otherwise show NULL (i.e. unknown). + */ + if ((mi->slave_running == MYSQL_SLAVE_RUN_CONNECT) && + mi->rli.slave_running) { long tmp= (long)((time_t)time((time_t*) 0) - mi->rli.last_master_timestamp) @@ -2246,9 +2250,13 @@ int show_master_info(THD* thd, MASTER_INFO* mi) slave is 2. At SHOW SLAVE STATUS time, assume that the difference between timestamp of slave and rli->last_master_timestamp is 0 (i.e. they are in the same second), then we get 0-(2-1)=-1 as a result. - This confuses users, so we don't go below 0. + This confuses users, so we don't go below 0: hence the max(). + + last_master_timestamp == 0 (an "impossible" timestamp 1970) is a + special marker to say "consider we have caught up". */ - protocol->store((longlong)(max(0, tmp))); + protocol->store((longlong)(mi->rli.last_master_timestamp ? max(0, tmp) + : 0)); } else protocol->store_null(); @@ -3041,6 +3049,8 @@ slave_begin: connected: + // TODO: the assignment below should be under mutex (5.0) + mi->slave_running= MYSQL_SLAVE_RUN_CONNECT; thd->slave_net = &mysql->net; thd->proc_info = "Checking master version"; if (get_master_version_and_clock(mysql, mi)) @@ -3072,6 +3082,7 @@ dump"); goto err; } + mi->slave_running= MYSQL_SLAVE_RUN_NOT_CONNECT; thd->proc_info= "Waiting to reconnect after a failed binlog dump request"; #ifdef SIGNAL_WITH_VIO_CLOSE thd->clear_active_vio(); @@ -3148,6 +3159,7 @@ max_allowed_packet", mysql_error(mysql)); goto err; } + mi->slave_running= MYSQL_SLAVE_RUN_NOT_CONNECT; thd->proc_info = "Waiting to reconnect after a failed master event read"; #ifdef SIGNAL_WITH_VIO_CLOSE thd->clear_active_vio(); @@ -3323,6 +3335,14 @@ slave_begin: pthread_mutex_lock(&LOCK_thread_count); threads.append(thd); pthread_mutex_unlock(&LOCK_thread_count); + /* + We are going to set slave_running to 1. Assuming slave I/O thread is + alive and connected, this is going to make Seconds_Behind_Master be 0 + i.e. "caught up". Even if we're just at start of thread. Well it's ok, at + the moment we start we can think we are caught up, and the next second we + start receiving data so we realize we are not caught up and + Seconds_Behind_Master grows. No big deal. + */ rli->slave_running = 1; rli->abort_slave = 0; pthread_mutex_unlock(&rli->run_lock); @@ -4211,10 +4231,25 @@ Before assert, my_b_tell(cur_log)=%s rli->event_relay_log_pos=%s", */ pthread_mutex_unlock(&rli->log_space_lock); pthread_cond_broadcast(&rli->log_space_cond); + /* + We say in Seconds_Behind_Master that we have "caught up". Note that + for example if network link is broken but I/O slave thread hasn't + noticed it (slave_net_timeout not elapsed), then we'll say "caught + up" whereas we're not really caught up. Fixing that would require + internally cutting timeout in smaller pieces in network read, no + thanks. Another example: SQL has caught up on I/O, now I/O has read + a new event and is queuing it; the false "0" will exist until SQL + finishes executing the new event; it will be look abnormal only if + the events have old timestamps (then you get "many", 0, "many"). + Transient phases like this can't really be fixed. + */ + time_t save_timestamp= rli->last_master_timestamp; + rli->last_master_timestamp= 0; // Note that wait_for_update unlocks lock_log ! rli->relay_log.wait_for_update(rli->sql_thd, 1); // re-acquire data lock since we released it earlier pthread_mutex_lock(&rli->data_lock); + rli->last_master_timestamp= save_timestamp; continue; } /* diff --git a/sql/slave.h b/sql/slave.h index 08cf0806717..bcd79dd4a39 100644 --- a/sql/slave.h +++ b/sql/slave.h @@ -98,6 +98,21 @@ enum enum_binlog_formats { BINLOG_FORMAT_323_LESS_57, BINLOG_FORMAT_323_GEQ_57 }; +/* + 3 possible values for MASTER_INFO::slave_running and + RELAY_LOG_INFO::slave_running. + The values 0,1,2 are very important: to keep the diff small, I didn't + substitute places where we use 0/1 with the newly defined symbols. So don't change + these values. + The same way, code is assuming that in RELAY_LOG_INFO we use only values + 0/1. + I started with using an enum, but + enum_variable=1; is not legal so would have required many line changes. +*/ +#define MYSQL_SLAVE_NOT_RUN 0 +#define MYSQL_SLAVE_RUN_NOT_CONNECT 1 +#define MYSQL_SLAVE_RUN_CONNECT 2 + /**************************************************************************** Replication SQL Thread @@ -251,7 +266,8 @@ typedef struct st_relay_log_info /* if not set, the value of other members of the structure are undefined */ bool inited; - volatile bool abort_slave, slave_running; + volatile bool abort_slave; + volatile uint slave_running; /* Condition and its parameters from START SLAVE UNTIL clause. @@ -385,7 +401,8 @@ typedef struct st_master_info #endif bool inited; enum enum_binlog_formats old_format; - volatile bool abort_slave, slave_running; + volatile bool abort_slave; + volatile uint slave_running; volatile ulong slave_run_id; /* The difference in seconds between the clock of the master and the clock of @@ -464,7 +481,7 @@ int terminate_slave_threads(MASTER_INFO* mi, int thread_mask, int terminate_slave_thread(THD* thd, pthread_mutex_t* term_mutex, pthread_mutex_t* cond_lock, pthread_cond_t* term_cond, - volatile bool* slave_running); + volatile uint* slave_running); int start_slave_threads(bool need_slave_mutex, bool wait_for_start, MASTER_INFO* mi, const char* master_info_fname, const char* slave_info_fname, int thread_mask); @@ -477,7 +494,7 @@ int start_slave_threads(bool need_slave_mutex, bool wait_for_start, int start_slave_thread(pthread_handler h_func, pthread_mutex_t* start_lock, pthread_mutex_t *cond_lock, pthread_cond_t* start_cond, - volatile bool *slave_running, + volatile uint *slave_running, volatile ulong *slave_run_id, MASTER_INFO* mi, bool high_priority); @@ -519,7 +536,7 @@ void slave_print_error(RELAY_LOG_INFO* rli, int err_code, const char* msg, ...); void end_slave(); /* clean up */ void init_master_info_with_options(MASTER_INFO* mi); void clear_until_condition(RELAY_LOG_INFO* rli); -void clear_slave_error_timestamp(RELAY_LOG_INFO* rli); +void clear_slave_error(RELAY_LOG_INFO* rli); int init_master_info(MASTER_INFO* mi, const char* master_info_fname, const char* slave_info_fname, bool abort_if_no_master_info_file, diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc index 6854cb24ee9..2f0d8d3aa0d 100644 --- a/sql/sql_repl.cc +++ b/sql/sql_repl.cc @@ -880,10 +880,10 @@ int reset_slave(THD *thd, MASTER_INFO* mi) */ init_master_info_with_options(mi); /* - Reset errors, and master timestamp (the idea is that we forget about the + Reset errors (the idea is that we forget about the old master). */ - clear_slave_error_timestamp(&mi->rli); + clear_slave_error(&mi->rli); clear_until_condition(&mi->rli); // close master_info_file, relay_log_info_file, set mi->inited=rli->inited=0 @@ -1143,8 +1143,8 @@ int change_master(THD* thd, MASTER_INFO* mi) pthread_mutex_lock(&mi->rli.data_lock); mi->rli.abort_pos_wait++; /* for MASTER_POS_WAIT() to abort */ - /* Clear the errors, for a clean start, and master timestamp */ - clear_slave_error_timestamp(&mi->rli); + /* Clear the errors, for a clean start */ + clear_slave_error(&mi->rli); clear_until_condition(&mi->rli); /* If we don't write new coordinates to disk now, then old will remain in From 1b17ba5244d654cdcc5171fbd6e777e5a1a2f34a Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 16 Dec 2004 20:26:24 +0100 Subject: [PATCH 0528/1063] Have 'mysql-test-run' write a list of all failed tests at the end, if run with '--force'. mysql-test/mysql-test-run.sh: Backport an improvement from 4.1: If the tool is run with '--force', give a list of all test cases that failed at the end. This is essential for automated analysis of the build logs file. --- mysql-test/mysql-test-run.sh | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index d47560fe7a6..b760309bb5b 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -4,6 +4,7 @@ # Sligtly updated by Monty # Cleaned up again by Matt # Fixed by Sergei +# List of failed cases (--force) backported from 4.1 by Joerg # :-) #++ @@ -202,6 +203,7 @@ MYSQL_MANAGER_LOG=$MYSQL_TEST_DIR/var/log/manager.log MYSQL_MANAGER_USER=root NO_SLAVE=0 USER_TEST= +FAILED_CASES= EXTRA_MASTER_OPT="" EXTRA_MYSQL_TEST_OPT="" @@ -1333,7 +1335,7 @@ run_testcase () show_failed_diff $result_file $ECHO if [ x$FORCE != x1 ] ; then - $ECHO "Aborting. To continue, re-run with '--force'." + $ECHO "Aborting: $tname failed. To continue, re-run with '--force'." $ECHO if [ -z "$DO_GDB" ] && [ -z "$USE_RUNNING_SERVER" ] && [ -z "$DO_DDD" ] then @@ -1342,7 +1344,7 @@ run_testcase () fi exit 1 fi - + FAILED_CASES="$FAILED_CASES $tname" if [ -z "$DO_GDB" ] && [ -z "$USE_RUNNING_SERVER" ] && [ -z "$DO_DDD" ] then mysql_restart @@ -1485,4 +1487,10 @@ $ECHO [ "$DO_GCOV" ] && gcov_collect # collect coverage information [ "$DO_GPROF" ] && gprof_collect # collect coverage information -exit 0 +if [ $TOT_FAIL -ne 0 ]; then + $ECHO "mysql-test-run: *** Failing the test(s):$FAILED_CASES" + $ECHO + exit 1 +else + exit 0 +fi From 4935b27c47eaa581878ebfbb817485aef4a57704 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 16 Dec 2004 22:19:59 +0100 Subject: [PATCH 0529/1063] merge --- ndb/src/kernel/vm/SimulatedBlock.hpp | 4 ++-- ndb/src/mgmsrv/ConfigInfo.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ndb/src/kernel/vm/SimulatedBlock.hpp b/ndb/src/kernel/vm/SimulatedBlock.hpp index fd59fef49db..cff19734368 100644 --- a/ndb/src/kernel/vm/SimulatedBlock.hpp +++ b/ndb/src/kernel/vm/SimulatedBlock.hpp @@ -76,7 +76,6 @@ typedef struct NewVar } NewVARIABLE; /* 128 bits */ class SimulatedBlock { - friend class MutexManager; friend class SafeCounter; friend class SafeCounterManager; friend struct UpgradeStartup; @@ -468,7 +467,8 @@ public: BlockReference reference() const; void progError(int line, int err_code, const char* extra = 0); }; - + + friend class MutexManager; MutexManager c_mutexMgr; void ignoreMutexUnlockCallback(Signal* signal, Uint32 ptrI, Uint32 retVal); diff --git a/ndb/src/mgmsrv/ConfigInfo.cpp b/ndb/src/mgmsrv/ConfigInfo.cpp index 577e4311932..ab2e34f6d3a 100644 --- a/ndb/src/mgmsrv/ConfigInfo.cpp +++ b/ndb/src/mgmsrv/ConfigInfo.cpp @@ -1730,9 +1730,9 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "NodeId1", "SHM", "Id of node ("DB_TOKEN_PRINT", "API_TOKEN_PRINT" or "MGM_TOKEN_PRINT") on one side of the connection", - ConfigInfo::USED, + ConfigInfo::CI_USED, false, - ConfigInfo::STRING, + ConfigInfo::CI_STRING, MANDATORY, 0, 0 }, From 082bf702a575ddfef7e7688275d920b7a6c12e21 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 16 Dec 2004 22:38:42 +0100 Subject: [PATCH 0530/1063] Very minor fixes for Seconds_Behind_Master column of SHOW SLAVE STATUS. sql/log_event.cc: comment sql/slave.cc: putting setting of rli->last_master_timestamp a few lines above, so that it is done under rli->data_lock. --- sql/log_event.cc | 3 +++ sql/slave.cc | 29 +++++++++++++++-------------- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/sql/log_event.cc b/sql/log_event.cc index 087e58a7bad..c027c3a8ee4 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -373,6 +373,9 @@ int Log_event::exec_event(struct st_relay_log_info* rli) Note that Rotate_log_event::exec_event() does not call this function, so there is no chance that a fake rotate event resets last_master_timestamp. + Note that we update without mutex (probably ok - except in some very + rare cases, only consequence is that value may take some time to + display in Seconds_Behind_Master - not critical). */ rli->last_master_timestamp= when; } diff --git a/sql/slave.cc b/sql/slave.cc index 90c75243f3d..ef9caa5f5b5 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -4189,6 +4189,21 @@ Before assert, my_b_tell(cur_log)=%s rli->event_relay_log_pos=%s", */ if (hot_log) { + /* + We say in Seconds_Behind_Master that we have "caught up". Note that + for example if network link is broken but I/O slave thread hasn't + noticed it (slave_net_timeout not elapsed), then we'll say "caught + up" whereas we're not really caught up. Fixing that would require + internally cutting timeout in smaller pieces in network read, no + thanks. Another example: SQL has caught up on I/O, now I/O has read + a new event and is queuing it; the false "0" will exist until SQL + finishes executing the new event; it will be look abnormal only if + the events have old timestamps (then you get "many", 0, "many"). + Transient phases like this can't really be fixed. + */ + time_t save_timestamp= rli->last_master_timestamp; + rli->last_master_timestamp= 0; + DBUG_ASSERT(rli->relay_log.get_open_count() == rli->cur_log_old_open_count); /* We can, and should release data_lock while we are waiting for @@ -4231,20 +4246,6 @@ Before assert, my_b_tell(cur_log)=%s rli->event_relay_log_pos=%s", */ pthread_mutex_unlock(&rli->log_space_lock); pthread_cond_broadcast(&rli->log_space_cond); - /* - We say in Seconds_Behind_Master that we have "caught up". Note that - for example if network link is broken but I/O slave thread hasn't - noticed it (slave_net_timeout not elapsed), then we'll say "caught - up" whereas we're not really caught up. Fixing that would require - internally cutting timeout in smaller pieces in network read, no - thanks. Another example: SQL has caught up on I/O, now I/O has read - a new event and is queuing it; the false "0" will exist until SQL - finishes executing the new event; it will be look abnormal only if - the events have old timestamps (then you get "many", 0, "many"). - Transient phases like this can't really be fixed. - */ - time_t save_timestamp= rli->last_master_timestamp; - rli->last_master_timestamp= 0; // Note that wait_for_update unlocks lock_log ! rli->relay_log.wait_for_update(rli->sql_thd, 1); // re-acquire data lock since we released it earlier From 8d9badb36e2bccd7f5e249235e05a1c653259391 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 16 Dec 2004 23:14:41 +0100 Subject: [PATCH 0531/1063] A .test for BUG#6287 "Slave skips auto_increment values in Replication with InnoDB" which Heikki fixed in 4.1.8 and 4.0.23. I verified that without Heikki's patch the test fails (7 gets inserted). Test added to 4.1 because in testsuite of 4.0 it's impossible to start slave with InnoDB. --- mysql-test/r/rpl_insert_ignore.result | 70 +++++++++++++++++++++++ mysql-test/t/rpl_insert_ignore-slave.opt | 1 + mysql-test/t/rpl_insert_ignore.test | 71 ++++++++++++++++++++++++ 3 files changed, 142 insertions(+) create mode 100644 mysql-test/r/rpl_insert_ignore.result create mode 100644 mysql-test/t/rpl_insert_ignore-slave.opt create mode 100644 mysql-test/t/rpl_insert_ignore.test diff --git a/mysql-test/r/rpl_insert_ignore.result b/mysql-test/r/rpl_insert_ignore.result new file mode 100644 index 00000000000..da24c86627c --- /dev/null +++ b/mysql-test/r/rpl_insert_ignore.result @@ -0,0 +1,70 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +CREATE TABLE t1 ( +a int unsigned not null auto_increment primary key, +b int unsigned, +unique (b) +) ENGINE=innodb; +CREATE TABLE t2 ( +a int unsigned, # to force INSERT SELECT to have a certain order +b int unsigned +) ENGINE=innodb; +INSERT INTO t1 VALUES (NULL, 1); +INSERT INTO t1 VALUES (NULL, 2); +INSERT INTO t1 VALUES (NULL, 3); +INSERT INTO t1 VALUES (NULL, 4); +INSERT INTO t2 VALUES (1, 1); +INSERT INTO t2 VALUES (2, 2); +INSERT INTO t2 VALUES (3, 5); +INSERT INTO t2 VALUES (4, 3); +INSERT INTO t2 VALUES (5, 4); +INSERT INTO t2 VALUES (6, 6); +INSERT IGNORE INTO t1 SELECT NULL, t2.b FROM t2 ORDER BY t2.a; +SELECT * FROM t1 ORDER BY a; +a b +1 1 +2 2 +3 3 +4 4 +5 5 +6 6 +SELECT * FROM t1 ORDER BY a; +a b +1 1 +2 2 +3 3 +4 4 +5 5 +6 6 +drop table t1; +CREATE TABLE t1 ( +a int unsigned not null auto_increment primary key, +b int unsigned, +unique (b) +) ENGINE=myisam; +INSERT INTO t1 VALUES (1, 1); +INSERT INTO t1 VALUES (2, 2); +INSERT INTO t1 VALUES (3, 3); +INSERT INTO t1 VALUES (4, 4); +INSERT IGNORE INTO t1 SELECT NULL, t2.b FROM t2 ORDER BY t2.a; +SELECT * FROM t1 ORDER BY a; +a b +1 1 +2 2 +3 3 +4 4 +5 5 +6 6 +SELECT * FROM t1 ORDER BY a; +a b +1 1 +2 2 +3 3 +4 4 +5 5 +6 6 +drop table t1, t2; diff --git a/mysql-test/t/rpl_insert_ignore-slave.opt b/mysql-test/t/rpl_insert_ignore-slave.opt new file mode 100644 index 00000000000..627becdbfb5 --- /dev/null +++ b/mysql-test/t/rpl_insert_ignore-slave.opt @@ -0,0 +1 @@ +--innodb diff --git a/mysql-test/t/rpl_insert_ignore.test b/mysql-test/t/rpl_insert_ignore.test new file mode 100644 index 00000000000..58eaa287817 --- /dev/null +++ b/mysql-test/t/rpl_insert_ignore.test @@ -0,0 +1,71 @@ +# Testcase for BUG#6287 "Slave skips auto_increment values in Replication with InnoDB" +# The bug was that if on master, INSERT IGNORE ignored some +# rows, and the table was InnoDB with auto_inc column, then on slave +# some rows received an auto_inc bigger than on master. +# Slave needs to be started with --innodb to store table in InnoDB. +# Same test for MyISAM (which had no bug). + +-- source include/have_innodb.inc + +-- source include/master-slave.inc + +CREATE TABLE t1 ( + a int unsigned not null auto_increment primary key, + b int unsigned, + unique (b) +) ENGINE=innodb; + +CREATE TABLE t2 ( + a int unsigned, # to force INSERT SELECT to have a certain order + b int unsigned +) ENGINE=innodb; + + +INSERT INTO t1 VALUES (NULL, 1); +INSERT INTO t1 VALUES (NULL, 2); +INSERT INTO t1 VALUES (NULL, 3); +INSERT INTO t1 VALUES (NULL, 4); + +# An alternation of values which will conflict in t1 and will not. + +INSERT INTO t2 VALUES (1, 1); +INSERT INTO t2 VALUES (2, 2); +INSERT INTO t2 VALUES (3, 5); +INSERT INTO t2 VALUES (4, 3); +INSERT INTO t2 VALUES (5, 4); +INSERT INTO t2 VALUES (6, 6); + +INSERT IGNORE INTO t1 SELECT NULL, t2.b FROM t2 ORDER BY t2.a; + +# Compare results + +SELECT * FROM t1 ORDER BY a; + +sync_slave_with_master; +SELECT * FROM t1 ORDER BY a; + +# Now do the same for MyISAM + +connection master; +drop table t1; +CREATE TABLE t1 ( + a int unsigned not null auto_increment primary key, + b int unsigned, + unique (b) +) ENGINE=myisam; + +INSERT INTO t1 VALUES (1, 1); +INSERT INTO t1 VALUES (2, 2); +INSERT INTO t1 VALUES (3, 3); +INSERT INTO t1 VALUES (4, 4); + +INSERT IGNORE INTO t1 SELECT NULL, t2.b FROM t2 ORDER BY t2.a; + +SELECT * FROM t1 ORDER BY a; + +sync_slave_with_master; +SELECT * FROM t1 ORDER BY a; + +connection master; +drop table t1, t2; +sync_slave_with_master; From 2e4fda1c531bfd355d7c7296ca39083c41ff763c Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 17 Dec 2004 06:55:21 +0100 Subject: [PATCH 0532/1063] Bumb up ndb version --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 760e7ee20fb..7f7e6438e66 100644 --- a/configure.in +++ b/configure.in @@ -16,7 +16,7 @@ SHARED_LIB_VERSION=14:0:0 # ndb version NDB_VERSION_MAJOR=4 NDB_VERSION_MINOR=1 -NDB_VERSION_BUILD=8 +NDB_VERSION_BUILD=9 NDB_VERSION_STATUS="" # Set all version vars based on $VERSION. How do we do this more elegant ? From cd2e3aca3491b204e702b47713598513ab945e50 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 17 Dec 2004 09:55:23 +0100 Subject: [PATCH 0533/1063] moved some Ndb member variables to NdbImpl class removed theCurrentConnectCounter optimized the_release_ind by using pos[0] to indicate that there is something there smaller storage of theDBNodes array by using Uint8 set the_relase_ind array to Uint32 to avoid possible parallell thread usage errors --- ndb/include/ndbapi/Ndb.hpp | 11 +-------- ndb/src/ndbapi/Ndb.cpp | 37 +++++++++++------------------- ndb/src/ndbapi/NdbConnection.cpp | 4 ++-- ndb/src/ndbapi/NdbImpl.hpp | 35 +++++++++++++++++----------- ndb/src/ndbapi/NdbReceiver.cpp | 4 ++-- ndb/src/ndbapi/Ndbif.cpp | 21 +++++++++-------- ndb/src/ndbapi/Ndbinit.cpp | 30 ++++++++++++------------ ndb/src/ndbapi/Ndblist.cpp | 39 +++++++++----------------------- 8 files changed, 77 insertions(+), 104 deletions(-) diff --git a/ndb/include/ndbapi/Ndb.hpp b/ndb/include/ndbapi/Ndb.hpp index 5ec09269695..1c9c2db5d6b 100644 --- a/ndb/include/ndbapi/Ndb.hpp +++ b/ndb/include/ndbapi/Ndb.hpp @@ -1586,7 +1586,6 @@ private: /****************************************************************************** * These are the private variables in this class. *****************************************************************************/ - NdbObjectIdMap* theNdbObjectIdMap; Ndb_cluster_connection *m_ndb_cluster_connection; NdbConnection** thePreparedTransactionsArray; @@ -1637,10 +1636,6 @@ private: Uint32 theMyRef; // My block reference Uint32 theNode; // The node number of our node - Uint32 theNoOfDBnodes; // The number of DB nodes - Uint32 * theDBnodes; // The node number of the DB nodes - Uint8 *the_release_ind;// 1 indicates to release all connections to node - Uint64 the_last_check_time; Uint64 theFirstTransId; @@ -1663,10 +1658,6 @@ private: InitConfigError } theInitState; - // Ensure good distribution of connects - Uint32 theCurrentConnectIndex; - Uint32 theCurrentConnectCounter; - /** * Computes fragement id for primary key * @@ -1692,7 +1683,7 @@ private: Uint32 noOfFragments; Uint32 * fragment2PrimaryNodeMap; - void init(Uint32 noOfNodes, Uint32 nodeIds[]); + void init(Uint32 noOfNodes, Uint8 nodeIds[]); void release(); } startTransactionNodeSelectionData; diff --git a/ndb/src/ndbapi/Ndb.cpp b/ndb/src/ndbapi/Ndb.cpp index 75ae539fc8b..ddfe94c1421 100644 --- a/ndb/src/ndbapi/Ndb.cpp +++ b/ndb/src/ndbapi/Ndb.cpp @@ -65,37 +65,25 @@ NdbConnection* Ndb::doConnect(Uint32 tConNode) // We will connect to any node. Make sure that we have connections to all // nodes. //**************************************************************************** - Uint32 tNoOfDbNodes = theNoOfDBnodes; - i = theCurrentConnectIndex; + Uint32 tNoOfDbNodes= theImpl->theNoOfDBnodes; + Uint32 &theCurrentConnectIndex= theImpl->theCurrentConnectIndex; UintR Tcount = 0; do { - if (i >= tNoOfDbNodes) { - i = 0; + theCurrentConnectIndex++; + if (theCurrentConnectIndex >= tNoOfDbNodes) { + theCurrentConnectIndex = 0; }//if Tcount++; - tNode = theDBnodes[i]; + tNode = theImpl->theDBnodes[theCurrentConnectIndex]; TretCode = NDB_connect(tNode); if ((TretCode == 1) || (TretCode == 2)) { //**************************************************************************** // We have connections now to the desired node. Return //**************************************************************************** - if (theCurrentConnectIndex == i) { - theCurrentConnectCounter++; - if (theCurrentConnectCounter == 8) { - theCurrentConnectCounter = 1; - theCurrentConnectIndex++; - }//if - } else { - // Set to 2 because we have already connected to a node - // when we get here. - theCurrentConnectCounter = 2; - theCurrentConnectIndex = i; - }//if return getConnectedNdbConnection(tNode); } else if (TretCode != 0) { tAnyAlive = 1; }//if - i++; } while (Tcount < tNoOfDbNodes); //**************************************************************************** // We were unable to find a free connection. If no node alive we will report @@ -211,8 +199,9 @@ Ndb::doDisconnect() NdbConnection* tNdbCon; CHECK_STATUS_MACRO_VOID; - DBUG_PRINT("info", ("theNoOfDBnodes=%d", theNoOfDBnodes)); - Uint32 tNoOfDbNodes = theNoOfDBnodes; + Uint32 tNoOfDbNodes = theImpl->theNoOfDBnodes; + Uint8 *theDBnodes= theImpl->theDBnodes; + DBUG_PRINT("info", ("theNoOfDBnodes=%d", tNoOfDbNodes)); UintR i; for (i = 0; i < tNoOfDbNodes; i++) { Uint32 tNode = theDBnodes[i]; @@ -259,8 +248,8 @@ Ndb::waitUntilReady(int timeout) unsigned int foundAliveNode = 0; TransporterFacade *tp = TransporterFacade::instance(); tp->lock_mutex(); - for (unsigned int i = 0; i < theNoOfDBnodes; i++) { - const NodeId nodeId = theDBnodes[i]; + for (unsigned int i = 0; i < theImpl->theNoOfDBnodes; i++) { + const NodeId nodeId = theImpl->theDBnodes[i]; //************************************************ // If any node is answering, ndb is answering //************************************************ @@ -270,7 +259,7 @@ Ndb::waitUntilReady(int timeout) }//for tp->unlock_mutex(); - if (foundAliveNode == theNoOfDBnodes) { + if (foundAliveNode == theImpl->theNoOfDBnodes) { DBUG_RETURN(0); }//if if (foundAliveNode > 0) { @@ -1077,7 +1066,7 @@ Ndb::guessPrimaryNode(Uint32 fragmentId){ void Ndb::StartTransactionNodeSelectionData::init(Uint32 noOfNodes, - Uint32 nodeIds[]) { + Uint8 nodeIds[]) { kValue = 6; noOfFragments = 2 * noOfNodes; diff --git a/ndb/src/ndbapi/NdbConnection.cpp b/ndb/src/ndbapi/NdbConnection.cpp index f4bb000300a..01012bfda01 100644 --- a/ndb/src/ndbapi/NdbConnection.cpp +++ b/ndb/src/ndbapi/NdbConnection.cpp @@ -83,7 +83,7 @@ NdbConnection::NdbConnection( Ndb* aNdb ) : { theListState = NotInList; theError.code = 0; - theId = theNdb->theNdbObjectIdMap->map(this); + theId = theNdb->theImpl->theNdbObjectIdMap.map(this); #define CHECK_SZ(mask, sz) assert((sizeof(mask)/sizeof(mask[0])) == sz) @@ -99,7 +99,7 @@ Remark: Deletes the connection object. NdbConnection::~NdbConnection() { DBUG_ENTER("NdbConnection::~NdbConnection"); - theNdb->theNdbObjectIdMap->unmap(theId, this); + theNdb->theImpl->theNdbObjectIdMap.unmap(theId, this); DBUG_VOID_RETURN; }//NdbConnection::~NdbConnection() diff --git a/ndb/src/ndbapi/NdbImpl.hpp b/ndb/src/ndbapi/NdbImpl.hpp index 1fb1969b589..cd1364e15fb 100644 --- a/ndb/src/ndbapi/NdbImpl.hpp +++ b/ndb/src/ndbapi/NdbImpl.hpp @@ -17,7 +17,15 @@ #ifndef NDB_IMPL_HPP #define NDB_IMPL_HPP -#include +#include +#include +#include +#include +#include +#include + +#include + #include "ObjectMap.hpp" /** @@ -25,20 +33,21 @@ */ class NdbImpl { public: - Vector m_invalidTables; + NdbImpl(); + ~NdbImpl(); - void checkErrorCode(Uint32 i); - void checkInvalidTable(class NdbDictionaryImpl * dict); + // Ensure good distribution of connects + Uint32 theCurrentConnectIndex; + + NdbObjectIdMap theNdbObjectIdMap; + + Uint32 theNoOfDBnodes; // The number of DB nodes + Uint8 theDBnodes[MAX_NDB_NODES]; // The node number of the DB nodes + + // 1 indicates to release all connections to node + Uint32 the_release_ind[MAX_NDB_NODES]; }; -#include -#include -#include -#include -#include - -#include - #ifdef VM_TRACE #define TRACE_DEBUG(x) ndbout << x << endl; #else @@ -57,7 +66,7 @@ public: inline void * Ndb::int2void(Uint32 val){ - return theNdbObjectIdMap->getObject(val); + return theImpl->theNdbObjectIdMap.getObject(val); } inline diff --git a/ndb/src/ndbapi/NdbReceiver.cpp b/ndb/src/ndbapi/NdbReceiver.cpp index 14f8d4b8440..cad247512b2 100644 --- a/ndb/src/ndbapi/NdbReceiver.cpp +++ b/ndb/src/ndbapi/NdbReceiver.cpp @@ -40,7 +40,7 @@ NdbReceiver::~NdbReceiver() { DBUG_ENTER("NdbReceiver::~NdbReceiver"); if (m_id != NdbObjectIdMap::InvalidId) { - m_ndb->theNdbObjectIdMap->unmap(m_id, this); + m_ndb->theImpl->theNdbObjectIdMap.unmap(m_id, this); } delete[] m_rows; DBUG_VOID_RETURN; @@ -54,7 +54,7 @@ NdbReceiver::init(ReceiverType type, void* owner) m_owner = owner; if (m_id == NdbObjectIdMap::InvalidId) { if (m_ndb) - m_id = m_ndb->theNdbObjectIdMap->map(this); + m_id = m_ndb->theImpl->theNdbObjectIdMap.map(this); } theFirstRecAttr = NULL; diff --git a/ndb/src/ndbapi/Ndbif.cpp b/ndb/src/ndbapi/Ndbif.cpp index c011c1a6a26..232e55662f0 100644 --- a/ndb/src/ndbapi/Ndbif.cpp +++ b/ndb/src/ndbapi/Ndbif.cpp @@ -92,8 +92,8 @@ Ndb::init(int aMaxNoOfTransactions) theDictionary->setTransporter(this, theFacade); - aNrOfCon = theNoOfDBnodes; - aNrOfOp = 2*theNoOfDBnodes; + aNrOfCon = theImpl->theNoOfDBnodes; + aNrOfOp = 2*theImpl->theNoOfDBnodes; // Create connection object in a linked list if((createConIdleList(aNrOfCon)) == -1){ @@ -192,14 +192,14 @@ void Ndb::connected(Uint32 ref) } TransporterFacade * theFacade = TransporterFacade::instance(); - int i; - theNoOfDBnodes= 0; + int i, n= 0; for (i = 1; i < MAX_NDB_NODES; i++){ if (theFacade->getIsDbNode(i)){ - theDBnodes[theNoOfDBnodes] = i; - theNoOfDBnodes++; + theImpl->theDBnodes[n] = i; + n++; } } + theImpl->theNoOfDBnodes= n; theFirstTransId = ((Uint64)tBlockNo << 52)+ ((Uint64)tmpTheNode << 40); theFirstTransId += theFacade->m_max_trans_id; @@ -207,9 +207,10 @@ void Ndb::connected(Uint32 ref) DBUG_PRINT("info",("connected with ref=%x, id=%d, no_db_nodes=%d, first_trans_id=%lx", theMyRef, tmpTheNode, - theNoOfDBnodes, + theImpl->theNoOfDBnodes, theFirstTransId)); - startTransactionNodeSelectionData.init(theNoOfDBnodes, theDBnodes); + startTransactionNodeSelectionData.init(theImpl->theNoOfDBnodes, + theImpl->theDBnodes); theCommitAckSignal = new NdbApiSignal(theMyRef); theDictionary->m_receiver.m_reference= theMyRef; @@ -247,7 +248,9 @@ Ndb::report_node_failure(Uint32 node_id) * * This method is only called by ClusterMgr (via lots of methods) */ - the_release_ind[node_id] = 1; + theImpl->the_release_ind[node_id] = 1; + // must come after + theImpl->the_release_ind[0] = 1; theWaiter.nodeFail(node_id); return; }//Ndb::report_node_failure() diff --git a/ndb/src/ndbapi/Ndbinit.cpp b/ndb/src/ndbapi/Ndbinit.cpp index 48e62c36a5f..9754c25ab15 100644 --- a/ndb/src/ndbapi/Ndbinit.cpp +++ b/ndb/src/ndbapi/Ndbinit.cpp @@ -82,7 +82,6 @@ void Ndb::setup(Ndb_cluster_connection *ndb_cluster_connection, { DBUG_ENTER("Ndb::setup"); - theNdbObjectIdMap= 0; m_ndb_cluster_connection= ndb_cluster_connection; thePreparedTransactionsArray= NULL; theSentTransactionsArray= NULL; @@ -110,9 +109,6 @@ void Ndb::setup(Ndb_cluster_connection *ndb_cluster_connection, theCallList= NULL; theScanList= NULL; theNdbBlobIdleList= NULL; - theNoOfDBnodes= 0; - theDBnodes= NULL; - the_release_ind= NULL; the_last_check_time= 0; theFirstTransId= 0; theRestartGCI= 0; @@ -134,19 +130,12 @@ void Ndb::setup(Ndb_cluster_connection *ndb_cluster_connection, theError.code = 0; - theNdbObjectIdMap = new NdbObjectIdMap(1024,1024); theConnectionArray = new NdbConnection * [MAX_NDB_NODES]; - theDBnodes = new Uint32[MAX_NDB_NODES]; - the_release_ind = new Uint8[MAX_NDB_NODES]; theCommitAckSignal = NULL; - theCurrentConnectCounter = 1; - theCurrentConnectIndex = 0; int i; for (i = 0; i < MAX_NDB_NODES ; i++) { theConnectionArray[i] = NULL; - the_release_ind[i] = 0; - theDBnodes[i] = 0; }//forg for (i = 0; i < 2048 ; i++) { theFirstTupleId[i] = 0; @@ -213,7 +202,6 @@ Ndb::~Ndb() doDisconnect(); delete theDictionary; - delete theImpl; NdbGlobalEventBuffer_drop(theGlobalEventBufferHandle); @@ -260,15 +248,12 @@ Ndb::~Ndb() startTransactionNodeSelectionData.release(); delete []theConnectionArray; - delete []theDBnodes; - delete []the_release_ind; if(theCommitAckSignal != NULL){ delete theCommitAckSignal; theCommitAckSignal = NULL; } - if(theNdbObjectIdMap != 0) - delete theNdbObjectIdMap; + delete theImpl; /** * This sleep is to make sure that the transporter @@ -307,4 +292,17 @@ NdbWaiter::~NdbWaiter(){ NdbCondition_Destroy(m_condition); } +NdbImpl::NdbImpl() : theNdbObjectIdMap(1024,1024), + theCurrentConnectIndex(0), + theNoOfDBnodes(0) +{ + int i; + for (i = 0; i < MAX_NDB_NODES; i++) { + the_release_ind[i] = 0; + } +} + +NdbImpl::~NdbImpl() +{ +} diff --git a/ndb/src/ndbapi/Ndblist.cpp b/ndb/src/ndbapi/Ndblist.cpp index a5f2a4801d5..5902aa413dc 100644 --- a/ndb/src/ndbapi/Ndblist.cpp +++ b/ndb/src/ndbapi/Ndblist.cpp @@ -30,10 +30,18 @@ void Ndb::checkFailedNode() { DBUG_ENTER("Ndb::checkFailedNode"); - DBUG_PRINT("enter", ("theNoOfDBnodes: %d", theNoOfDBnodes)); + Uint32 *the_release_ind= theImpl->the_release_ind; + if (the_release_ind[0] == 0) + { + DBUG_VOID_RETURN; + } + Uint32 tNoOfDbNodes = theImpl->theNoOfDBnodes; + Uint8 *theDBnodes= theImpl->theDBnodes; - DBUG_ASSERT(theNoOfDBnodes < MAX_NDB_NODES); - for (Uint32 i = 0; i < theNoOfDBnodes; i++){ + DBUG_PRINT("enter", ("theNoOfDBnodes: %d", tNoOfDbNodes)); + + DBUG_ASSERT(tNoOfDbNodes < MAX_NDB_NODES); + for (Uint32 i = 0; i < tNoOfDbNodes; i++){ const NodeId node_id = theDBnodes[i]; DBUG_PRINT("info", ("i: %d, node_id: %d", i, node_id)); @@ -56,31 +64,6 @@ Ndb::checkFailedNode() DBUG_VOID_RETURN; } -#if 0 -void -NdbImpl::checkInvalidTable(NdbDictionaryImpl * dict){ - Uint32 sz = m_invalidTables.size(); - for(Int32 i = sz - 1; i >= 0; i--){ - NdbTableImpl * tab = m_invalidTables[i]; - m_invalidTables.erase(i); - dict->tableDropped(* tab); - } -} - -void -NdbImpl::checkErrorCode(Uint32 i, NdbTableImpl * tab){ - switch(i){ - case 241: - case 283: - case 284: - case 285: - case 1225: - case 1226: - - } -} -#endif - /*************************************************************************** * int createConIdleList(int aNrOfCon); * From f7193b925455ede2b97ccde36c96732446d1db7e Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 17 Dec 2004 12:14:45 +0300 Subject: [PATCH 0534/1063] Fix for BUG#6825: When calculating Item_func_neg::max_length, add 1 for '-'. For numeric constants we only need to add, since the parser doesn't produce negative numbers. For strings we only add (we actually could substract 1 if given string is a constant and it has '-number' form but we're not doing that because * we set max_length bigger then necessary in other cases as well. * the current solution is simpler and safer (bigger max_length is better then cutting out) mysql-test/r/func_concat.result: Test for BUG#6825 mysql-test/r/metadata.result: Ajusted results according to fix of bug BUG#6825:length(-1) = 2 , not 1 mysql-test/t/func_concat.test: Test for BUG#6825 --- mysql-test/r/func_concat.result | 36 +++++++++++++++++++++++++++++++++ mysql-test/r/metadata.result | 2 +- mysql-test/t/func_concat.test | 16 +++++++++++++++ sql/item_func.cc | 16 +++++++++++++++ 4 files changed, 69 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/func_concat.result b/mysql-test/r/func_concat.result index ec53d6d87b0..419413e4156 100644 --- a/mysql-test/r/func_concat.result +++ b/mysql-test/r/func_concat.result @@ -32,3 +32,39 @@ select * from t1 where concat(A,C,B,D) = 'AAAA2003-03-011051'; a b c d AAAA 105 2003-03-01 1 drop table t1; +select 'a' union select concat('a', -4); +a +a +a-4 +select 'a' union select concat('a', -4.5); +a +a +a-4.5 +select 'a' union select concat('a', -(4 + 1)); +a +a +a-5 +select 'a' union select concat('a', 4 - 5); +a +a +a-1 +select 'a' union select concat('a', -'3'); +a +a +a-3 +select 'a' union select concat('a', -concat('3',4)); +a +a +a-34 +select 'a' union select concat('a', -0); +a +a +a0 +select 'a' union select concat('a', -0.0); +a +a +a-0.0 +select 'a' union select concat('a', -0.0000); +a +a +a-0.0000 diff --git a/mysql-test/r/metadata.result b/mysql-test/r/metadata.result index 2321a8998ac..3c7cf60db7a 100644 --- a/mysql-test/r/metadata.result +++ b/mysql-test/r/metadata.result @@ -3,7 +3,7 @@ select 1, 1.0, -1, "hello", NULL; Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr def 1 8 1 1 N 32769 0 8 def 1.0 5 3 3 N 32769 1 8 -def -1 8 1 2 N 32769 0 8 +def -1 8 2 2 N 32769 0 8 def hello 254 5 5 N 1 31 8 def NULL 6 0 0 Y 32896 0 63 1 1.0 -1 hello NULL diff --git a/mysql-test/t/func_concat.test b/mysql-test/t/func_concat.test index 0cf1502b10e..78818cdda4e 100644 --- a/mysql-test/t/func_concat.test +++ b/mysql-test/t/func_concat.test @@ -34,3 +34,19 @@ create table t1 (a char(4), b double, c date, d tinyint(4)); insert into t1 values ('AAAA', 105, '2003-03-01', 1); select * from t1 where concat(A,C,B,D) = 'AAAA2003-03-011051'; drop table t1; + +# BUG#6825 +select 'a' union select concat('a', -4); +select 'a' union select concat('a', -4.5); + +select 'a' union select concat('a', -(4 + 1)); +select 'a' union select concat('a', 4 - 5); + +select 'a' union select concat('a', -'3'); +select 'a' union select concat('a', -concat('3',4)); + +select 'a' union select concat('a', -0); +select 'a' union select concat('a', -0.0); + +select 'a' union select concat('a', -0.0000); + diff --git a/sql/item_func.cc b/sql/item_func.cc index 2d939f47716..413000f9d1b 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -775,9 +775,25 @@ longlong Item_func_neg::val_int() void Item_func_neg::fix_length_and_dec() { + enum Item_result arg_result= args[0]->result_type(); + enum Item::Type arg_type= args[0]->type(); decimals=args[0]->decimals; max_length=args[0]->max_length; hybrid_type= REAL_RESULT; + + /* + We need to account for added '-' in the following cases: + A) argument is a real or integer positive constant - in this case + argument's max_length is set to actual number of bytes occupied, and not + maximum number of bytes real or integer may require. Note that all + constants are non negative so we don't need to account for removed '-'. + B) argument returns a string. + */ + if (arg_result == STRING_RESULT || + (arg_type == REAL_ITEM && ((Item_real*)args[0])->value >= 0) || + (arg_type == INT_ITEM && ((Item_int*)args[0])->value > 0)) + max_length++; + if (args[0]->result_type() == INT_RESULT) { /* From 113fe5065281e752703b1be503aaa551087bc2f6 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 17 Dec 2004 10:24:57 +0100 Subject: [PATCH 0535/1063] version.c: 4.1.9 compatible with 4.1.8 ndb/src/common/util/version.c: 4.1.9 compatible with 4.1.8 --- ndb/src/common/util/version.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ndb/src/common/util/version.c b/ndb/src/common/util/version.c index f2b3d5bd522..8e4f6efe745 100644 --- a/ndb/src/common/util/version.c +++ b/ndb/src/common/util/version.c @@ -69,6 +69,7 @@ struct NdbUpGradeCompatible { #ifndef TEST_VERSION struct NdbUpGradeCompatible ndbCompatibleTable_full[] = { + { MAKE_VERSION(4,1,9), MAKE_VERSION(4,1,8), UG_Exact }, { MAKE_VERSION(3,5,2), MAKE_VERSION(3,5,1), UG_Exact }, { 0, 0, UG_Null } }; From b181f610e1c5bd29a21a4b73bb2fa58b37a18d6b Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 17 Dec 2004 10:27:58 +0100 Subject: [PATCH 0536/1063] bug#7379 & bug#7346 - ndb_restore ndb/tools/restore/consumer_restore.cpp: 1) Fix bug when blobs and multiple databases bug#7379 2) Fix bug #7346 ndb/tools/restore/consumer_restore.hpp: Moved tuple handle into callback object instead of having separate array Declared m_transactions volatile --- ndb/tools/restore/consumer_restore.cpp | 97 ++++++++++++-------------- ndb/tools/restore/consumer_restore.hpp | 7 +- 2 files changed, 46 insertions(+), 58 deletions(-) diff --git a/ndb/tools/restore/consumer_restore.cpp b/ndb/tools/restore/consumer_restore.cpp index e2c55e5a0b1..fbe96cb2a71 100644 --- a/ndb/tools/restore/consumer_restore.cpp +++ b/ndb/tools/restore/consumer_restore.cpp @@ -52,19 +52,10 @@ BackupRestore::init() return false; } - m_tuples = new TupleS[m_parallelism]; - - if (m_tuples == 0) - { - err << "Failed to allocate tuples" << endl; - return false; - } - m_free_callback= m_callback; for (Uint32 i= 0; i < m_parallelism; i++) { m_callback[i].restore= this; m_callback[i].connection= 0; - m_callback[i].tup= &m_tuples[i]; if (i > 0) m_callback[i-1].next= &(m_callback[i]); } @@ -86,12 +77,6 @@ void BackupRestore::release() delete [] m_callback; m_callback= 0; } - - if (m_tuples) - { - delete [] m_tuples; - m_tuples= 0; - } } BackupRestore::~BackupRestore() @@ -118,14 +103,21 @@ BackupRestore::get_table(const NdbDictionary::Table* tab){ m_cache.m_old_table = tab; int cnt, id1, id2; - char buf[256]; - if((cnt = sscanf(tab->getName(), "%[^/]/%[^/]/NDB$BLOB_%d_%d", buf, buf, &id1, &id2)) == 4){ - BaseString::snprintf(buf, sizeof(buf), "NDB$BLOB_%d_%d", m_new_tables[id1]->getTableId(), id2); - m_cache.m_new_table = m_ndb->getDictionary()->getTable(buf); + char db[256], schema[256]; + if((cnt = sscanf(tab->getName(), "%[^/]/%[^/]/NDB$BLOB_%d_%d", + db, schema, &id1, &id2)) == 4){ + m_ndb->setDatabaseName(db); + m_ndb->setSchemaName(schema); + + BaseString::snprintf(db, sizeof(db), "NDB$BLOB_%d_%d", + m_new_tables[id1]->getTableId(), id2); + + m_cache.m_new_table = m_ndb->getDictionary()->getTable(db); + } else { m_cache.m_new_table = m_new_tables[tab->getTableId()]; } - + assert(m_cache.m_new_table); return m_cache.m_new_table; } @@ -266,22 +258,24 @@ void BackupRestore::tuple(const TupleS & tup) if (!m_restore) return; - restore_callback_t * cb = m_free_callback; - - if (cb == 0) - assert(false); - - m_free_callback = cb->next; - cb->retries = 0; - *(cb->tup) = tup; // must do copy! - tuple_a(cb); - - if (m_free_callback == 0) + while (m_free_callback == 0) { + assert(m_transactions == m_parallelism); // send-poll all transactions // close transaction is done in callback m_ndb->sendPollNdb(3000, 1); } + + restore_callback_t * cb = m_free_callback; + + if (cb == 0) + assert(false); + + m_free_callback = cb->next; + cb->retries = 0; + cb->tup = tup; // must do copy! + tuple_a(cb); + } void BackupRestore::tuple_a(restore_callback_t *cb) @@ -303,7 +297,7 @@ void BackupRestore::tuple_a(restore_callback_t *cb) exitHandler(); } // if - const TupleS &tup = *(cb->tup); + const TupleS &tup = cb->tup; const NdbDictionary::Table * table = get_table(tup.getTable()->m_dictTable); NdbOperation * op = cb->connection->getNdbOperation(table); @@ -372,7 +366,9 @@ void BackupRestore::tuple_a(restore_callback_t *cb) m_transactions++; return; } - err << "Unable to recover from errors. Exiting..." << endl; + err << "Retried transaction " << cb->retries << " times.\nLast error" + << m_ndb->getNdbError(cb->error_code) << endl + << "...Unable to recover from errors. Exiting..." << endl; exitHandler(); } @@ -416,16 +412,21 @@ bool BackupRestore::errorHandler(restore_callback_t *cb) NdbError error= cb->connection->getNdbError(); m_ndb->closeTransaction(cb->connection); cb->connection= 0; + + Uint32 sleepTime = 100 + cb->retries * 300; + cb->retries++; + cb->error_code = error.code; + switch(error.status) { case NdbError::Success: - return false; - // ERROR! - break; - + return false; + // ERROR! + break; + case NdbError::TemporaryError: - NdbSleep_MilliSleep(10); + NdbSleep_MilliSleep(sleepTime); return true; // RETRY break; @@ -438,15 +439,6 @@ bool BackupRestore::errorHandler(restore_callback_t *cb) default: case NdbError::PermanentError: - switch (error.code) - { - case 499: - case 250: - NdbSleep_MilliSleep(10); - return true; //temp errors? - default: - break; - } //ERROR err << error << endl; return false; @@ -468,13 +460,10 @@ BackupRestore::tuple_free() if (!m_restore) return; - if (m_transactions > 0) { - // Send all transactions to NDB - m_ndb->sendPreparedTransactions(0); - - // Poll all transactions - while (m_transactions > 0) - m_ndb->pollNdb(3000, m_transactions); + // Poll all transactions + while (m_transactions) + { + m_ndb->sendPollNdb(3000); } } diff --git a/ndb/tools/restore/consumer_restore.hpp b/ndb/tools/restore/consumer_restore.hpp index 59e2734ea1f..df219cd4412 100644 --- a/ndb/tools/restore/consumer_restore.hpp +++ b/ndb/tools/restore/consumer_restore.hpp @@ -21,9 +21,10 @@ struct restore_callback_t { class BackupRestore *restore; - class TupleS *tup; + class TupleS tup; class NdbConnection *connection; int retries; + int error_code; restore_callback_t *next; }; @@ -39,7 +40,6 @@ public: m_restore_meta = false; m_parallelism = parallelism; m_callback = 0; - m_tuples = 0; m_free_callback = 0; m_transactions = 0; m_cache.m_old_table = 0; @@ -68,9 +68,8 @@ public: Uint32 m_dataCount; Uint32 m_parallelism; - Uint32 m_transactions; + volatile Uint32 m_transactions; - TupleS *m_tuples; restore_callback_t *m_callback; restore_callback_t *m_free_callback; From 21162110fd89c1f63cf1d8c34fd9ca7a86a556b3 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 17 Dec 2004 10:40:56 +0100 Subject: [PATCH 0537/1063] CommandInterpreter.hpp, CommandInterpreter.cpp: removed methods that are duplicated in management client ndb/src/mgmsrv/CommandInterpreter.cpp: removed methods that are duplicated in management client ndb/src/mgmsrv/CommandInterpreter.hpp: removed methods that are duplicated in management client --- ndb/src/mgmsrv/CommandInterpreter.cpp | 537 +------------------------- ndb/src/mgmsrv/CommandInterpreter.hpp | 8 - 2 files changed, 1 insertion(+), 544 deletions(-) diff --git a/ndb/src/mgmsrv/CommandInterpreter.cpp b/ndb/src/mgmsrv/CommandInterpreter.cpp index 1b882cd2e71..7e64b2fec19 100644 --- a/ndb/src/mgmsrv/CommandInterpreter.cpp +++ b/ndb/src/mgmsrv/CommandInterpreter.cpp @@ -30,64 +30,10 @@ #include -static const char* helpTexts[] = { - "HELP Print help text", - "HELP SHOW Help for the SHOW command", -#ifdef VM_TRACE // DEBUG ONLY - "HELP DEBUG Help for debug compiled version", -#endif - "SHOW Print information about cluster", - "SHOW CONFIG Print configuration", - "SHOW PARAMETERS Print configuration parameters", - "START BACKUP Start backup\n" - "ABORT BACKUP Aborts backup\n" - "CLUSTERLOG ON Enable Cluster logging", - "CLUSTERLOG OFF Disable Cluster logging", - "CLUSTERLOG FILTER Toggle severity filter on/off", - "CLUSTERLOG INFO Print cluster log information", - "{|ALL} START Start DB node (started with -n)", - "{|ALL} RESTART [-n] [-i] Restart DB node", - "{|ALL} STOP Stop DB node", - "{|ALL} STATUS Print status", - "{|ALL} CLUSTERLOG {=}+ Set log level for cluster log", - "QUIT Quit management server", -}; -static const unsigned noOfHelpTexts = sizeof(helpTexts)/sizeof(const char*); - -static const char* helpTextShow = -"SHOW prints NDB Cluster information\n\n" -"SHOW Print information about cluster\n" -"SHOW CONFIG Print configuration (in initial config file format)\n" -"SHOW PARAMETERS Print information about configuration parameters\n\n" -; - -#ifdef VM_TRACE // DEBUG ONLY -static const char* helpTextDebug = -"SHOW PROPERTIES Print config properties object\n" -"{|ALL} LOGLEVEL {=}+ Set log level\n" -"{|ALL} ERROR Inject error into NDB node\n" -"{|ALL} TRACE Set trace number\n" -"{|ALL} LOG [BLOCK = {ALL|+}] Set logging on in & out signals\n" -"{|ALL} LOGIN [BLOCK = {ALL|+}] Set logging on in signals\n" -"{|ALL} LOGOUT [BLOCK = {ALL|+}] Set logging on out signals\n" -"{|ALL} LOGOFF [BLOCK = {ALL|+}] Unset signal logging\n" -"{|ALL} TESTON Start signal logging\n" -"{|ALL} TESTOFF Stop signal logging\n" -"{|ALL} SET Update configuration variable\n" -"{|ALL} DUMP Dump system state to cluster.log\n" -"{|ALL} GETSTAT Print statistics\n" -"\n" -; -#endif - - - //****************************************************************************** //****************************************************************************** CommandInterpreter::CommandInterpreter(MgmtSrvr& mgmtSrvr) : _mgmtSrvr(mgmtSrvr) { - - // _mgmtSrvr.setCallback(CmdBackupCallback); } @@ -145,48 +91,7 @@ int CommandInterpreter::readAndExecute() { char* firstToken = strtok(line, " "); char* allAfterFirstToken = strtok(NULL, "\0"); - if (strcmp(firstToken, "HELP") == 0) { - executeHelp(allAfterFirstToken); - return true; - } - else if (strcmp(firstToken, "?") == 0) { - executeHelp(allAfterFirstToken); - return true; - } - else if (strcmp(firstToken, "SHOW") == 0) { - executeShow(allAfterFirstToken); - return true; - } - else if(strcmp(firstToken, "START") == 0 && - allAfterFirstToken != 0 && - strncmp(allAfterFirstToken, "BACKUP", sizeof("BACKUP") - 1) == 0){ - executeStartBackup(allAfterFirstToken); - return true; - } - else if(strcmp(firstToken, "ABORT") == 0 && - allAfterFirstToken != 0 && - strncmp(allAfterFirstToken, "BACKUP", sizeof("BACKUP") - 1) == 0){ - executeAbortBackup(allAfterFirstToken); - return true; - } - - else if(strcmp(firstToken, "ENTER") == 0 && - allAfterFirstToken != 0 && - strncmp(allAfterFirstToken, "SINGLE USER MODE ", - sizeof("SINGLE USER MODE") - 1) == 0){ - executeEnterSingleUser(allAfterFirstToken); - return true; - } - - else if(strcmp(firstToken, "EXIT") == 0 && - allAfterFirstToken != 0 && - strncmp(allAfterFirstToken, "SINGLE USER MODE ", - sizeof("SINGLE USER MODE") - 1) == 0){ - executeExitSingleUser(allAfterFirstToken); - return true; - } - - else if (strcmp(firstToken, "ALL") == 0) { + if (strcmp(firstToken, "ALL") == 0) { analyseAfterFirstToken(-1, allAfterFirstToken); } else if(strcmp(firstToken, "QUIT") == 0 || @@ -218,8 +123,6 @@ static const CommandInterpreter::CommandFunctionPair commands[] = { { "START", &CommandInterpreter::executeStart } ,{ "RESTART", &CommandInterpreter::executeRestart } ,{ "STOP", &CommandInterpreter::executeStop } - ,{ "STATUS", &CommandInterpreter::executeStatus } - ,{ "LOGLEVEL", &CommandInterpreter::executeLogLevel } #ifdef ERROR_INSERT ,{ "ERROR", &CommandInterpreter::executeError } #endif @@ -230,9 +133,7 @@ static const CommandInterpreter::CommandFunctionPair commands[] = { ,{ "LOGOFF", &CommandInterpreter::executeLogOff } ,{ "TESTON", &CommandInterpreter::executeTestOn } ,{ "TESTOFF", &CommandInterpreter::executeTestOff } - ,{ "CLUSTERLOG", &CommandInterpreter::executeEventReporting } ,{ "DUMP", &CommandInterpreter::executeDumpState } - ,{ "JONAS", &CommandInterpreter::jonas } }; @@ -370,104 +271,9 @@ bool CommandInterpreter::parseBlockSpecification(const char* allAfterLog, return true; } - - -//****************************************************************************** -//****************************************************************************** -void CommandInterpreter::executeHelp(char* parameters) { - - (void)parameters; // Don't want compiler warning - - if (emptyString(parameters)) { - unsigned i; - for (i = 0; i = " - << "ALERT | CRITICAL | ERROR | WARNING | INFO | DEBUG" - << endl; - - ndbout << " = "; - for(i = 0; i = " << "0 - 15" - << endl; - - ndbout << endl; - } else if (strcmp(parameters, "SHOW") == 0) { - ndbout << helpTextShow; -#ifdef VM_TRACE // DEBUG ONLY - } else if (strcmp(parameters, "DEBUG") == 0) { - ndbout << helpTextDebug; -#endif - } else { - ndbout << "Invalid argument." << endl; - } -} - //***************************************************************************** //***************************************************************************** -void CommandInterpreter::executeShow(char* parameters) { - - if (emptyString(parameters)) { - ndbout << "Cluster Configuration" << endl - << "---------------------" << endl; - - NodeId nodeId = 0; - ndbout << _mgmtSrvr.getNodeCount(NDB_MGM_NODE_TYPE_NDB) - << " NDB Node(s) with" - << endl; - while (_mgmtSrvr.getNextNodeId(&nodeId, NDB_MGM_NODE_TYPE_NDB)){ - ndbout << " Node Id = " << nodeId << endl; - } - ndbout << endl; - - nodeId = 0; - ndbout << _mgmtSrvr.getNodeCount(NDB_MGM_NODE_TYPE_API) - << " API Node(s) with" - << endl; - while (_mgmtSrvr.getNextNodeId(&nodeId, NDB_MGM_NODE_TYPE_API)){ - ndbout << " Node Id = " << nodeId << endl; - } - ndbout << endl; - - nodeId = 0; - ndbout << _mgmtSrvr.getNodeCount(NDB_MGM_NODE_TYPE_MGM) - << " MGM Node(s) with" - << endl; - while (_mgmtSrvr.getNextNodeId(&nodeId, NDB_MGM_NODE_TYPE_MGM)){ - ndbout << " Node Id = " << nodeId << endl; - } - ndbout << endl; - - ndbout << helpTextShow; - - return; - } else if (strcmp(parameters, "PROPERTIES") == 0 || - strcmp(parameters, "PROP") == 0) { - ndbout << "_mgmtSrvr.getConfig()->print();" << endl; /* XXX */ - } else if (strcmp(parameters, "CONFIGURATION") == 0 || - strcmp(parameters, "CONFIG") == 0){ - ndbout << "_mgmtSrvr.getConfigFile()->print();" << endl; /* XXX */ - _mgmtSrvr.getConfig()->printConfigFile(); - } else if (strcmp(parameters, "PARAMETERS") == 0 || - strcmp(parameters, "PARAMS") == 0 || - strcmp(parameters, "PARAM") == 0) { - ndbout << "_mgmtSrvr.getConfigInfo()->print();" << endl; /* XXX */ - } else { - ndbout << "Invalid argument." << endl; - } -} - void stopCallback(int nodeId, void * anyData, int errCode){ if(errCode == 0){ @@ -483,59 +289,6 @@ stopCallback(int nodeId, void * anyData, int errCode){ } } -void -versionCallback(int nodeId, int version, void * anyData, int errCode){ - if(errCode == 0){ - MgmtSrvr * mgm = (MgmtSrvr *)anyData; - switch(mgm->getNodeType(nodeId)){ - case NDB_MGM_NODE_TYPE_MGM: - { - ndbout << "MGMT node:\t" << nodeId << " "; - ndbout_c(" (Version %d.%d.%d)", - getMajor(version) , - getMinor(version), - getBuild(version)); - } - break; - case NDB_MGM_NODE_TYPE_NDB: - { - ndbout << "DB node:\t" << nodeId << " "; - if(version == 0) - ndbout << "(no version information available)" << endl; - else { - ndbout_c(" (Version %d.%d.%d)", - getMajor(version) , - getMinor(version), - getBuild(version)); - } - } - break; - case NDB_MGM_NODE_TYPE_API: - { - ndbout << "API node:\t" << nodeId << " "; - if(version == 0) - ndbout << "(no version information available)" << endl; - else { - ndbout_c(" (Version %d.%d.%d)", - getMajor(version) , - getMinor(version), - getBuild(version)); - } - - } - break; - case NDB_MGM_NODE_TYPE_UNKNOWN: - case NDB_MGM_NODE_TYPE_REP: - abort(); - }; - - } else { - MgmtSrvr * mgm = (MgmtSrvr *)anyData; - char err_str[1024]; - ndbout << mgm->getErrorText(errCode,err_str,sizeof(err_str)) << endl; - } -} - //***************************************************************************** //***************************************************************************** void CommandInterpreter::executeStop(int processId, @@ -643,124 +396,6 @@ CommandInterpreter::executeDumpState(int processId, const char* parameters, } } -void CommandInterpreter::executeStatus(int processId, - const char* parameters, bool all) { - - (void)all; // Don't want compiler warning - - if (! emptyString(parameters)) { - ndbout << "No parameters expected to this command." << endl; - return; - } - - ndb_mgm_node_status status; - Uint32 startPhase, version, dynamicId, nodeGroup, connectCount; - bool system; - int result = _mgmtSrvr.status(processId, - &status, &version, &startPhase, &system, - &dynamicId, &nodeGroup, &connectCount); - if(result != 0){ - ndbout << get_error_text(result) << endl; - return; - } - - ndbout << "Node " << processId << ": "; - switch(status){ - case NDB_MGM_NODE_STATUS_NO_CONTACT: - ndbout << "No contact" << endl; - break; - case NDB_MGM_NODE_STATUS_NOT_STARTED: - ndbout << "Not started" ; - break; - case NDB_MGM_NODE_STATUS_STARTING: - ndbout << "Starting (Start phase " << startPhase << ")" ; - break; - case NDB_MGM_NODE_STATUS_STARTED: - ndbout << "Started" ; - break; - case NDB_MGM_NODE_STATUS_SHUTTING_DOWN: - ndbout << "Shutting down " << (system == false ? "node" : "system") - << " (Phase " << startPhase << ")" - ; - break; - case NDB_MGM_NODE_STATUS_RESTARTING: - ndbout << "Restarting" ; - break; - case NDB_MGM_NODE_STATUS_SINGLEUSER: - ndbout << "Single user mode" ; - break; - default: - ndbout << "Unknown state" ; - break; - } - if(status != NDB_MGM_NODE_STATUS_NO_CONTACT){ - - ndbout_c(" (Version %d.%d.%d)", - getMajor(version) , - getMinor(version), - getBuild(version)); - - // NOTE It's possible to print dynamicId and nodeGroup here ... - // ndbout << ", " < 15){ - ndbout << "Invalid loglevel specification row, level 0-15" << endl; - free(tmpString); - return ; - } - logLevel.setLogLevel(cat, level); - - item = strtok_r(NULL, ", ", &tmpPtr); - } - free(tmpString); - } - - int result = _mgmtSrvr.setNodeLogLevel(processId, logLevel); - if (result != 0) { - ndbout << get_error_text(result) << endl; - } -#endif -} - - - //***************************************************************************** //***************************************************************************** void CommandInterpreter::executeError(int processId, @@ -956,173 +591,3 @@ void CommandInterpreter::executeTestOff(int processId, } } - -//***************************************************************************** -//***************************************************************************** -void CommandInterpreter::executeEventReporting(int processId, - const char* parameters, - bool all) { -#if 0 - (void)all; // Don't want compiler warning - SetLogLevelOrd logLevel; logLevel.clear(); - - if (emptyString(parameters) || (strcmp(parameters, "ALL") == 0)) { - for(Uint32 i = 0; i 15){ - ndbout << "Invalid loglevel specification row, level 0-15" << endl; - free(tmpString); - return ; - } - logLevel.setLogLevel(cat, level); - - item = strtok_r(NULL, ", ", &tmpPtr); - } - free(tmpString); - } - ndbout_c("processId %d", processId); - int result = _mgmtSrvr.setEventReportingLevel(processId, logLevel); - if (result != 0) { - ndbout << get_error_text(result) << endl; - } -#endif -} - -void -CommandInterpreter::executeStartBackup(char* parameters) { - Uint32 backupId; - int result = _mgmtSrvr.startBackup(backupId); - if (result != 0) { - ndbout << get_error_text(result) << endl; - } else { - // ndbout << "Start of backup ordered" << endl; - } -} - -void -CommandInterpreter::executeAbortBackup(char* parameters) { - strtok(parameters, " "); - char* id = strtok(NULL, "\0"); - int bid = -1; - if(id == 0 || sscanf(id, "%d", &bid) != 1){ - ndbout << "Invalid arguments: expected " << endl; - return; - } - int result = _mgmtSrvr.abortBackup(bid); - if (result != 0) { - ndbout << get_error_text(result) << endl; - } else { - ndbout << "Abort of backup " << bid << " ordered" << endl; - } -} - - - -void -CommandInterpreter::executeEnterSingleUser(char* parameters) { - strtok(parameters, " "); - char* id = strtok(NULL, " "); - id = strtok(NULL, " "); - id = strtok(NULL, "\0"); - int nodeId = -1; - if(id == 0 || sscanf(id, "%d", &nodeId) != 1){ - ndbout << "Invalid arguments: expected " << endl; - return; - } - int result = _mgmtSrvr.enterSingleUser(0, nodeId,0,0); - if (result != 0) { - ndbout << get_error_text(result) << endl; - } else { - ndbout << "Entering single user mode, granting access for node " - << nodeId << " OK." << endl; - } -} - -void CommandInterpreter::executeExitSingleUser(char* parameters) { - _mgmtSrvr.exitSingleUser(0,0,0,0); -} - - -#include - -void -CommandInterpreter::jonas(int processId, const char* parameters, bool all) { - - MgmtSrvr::Area51 tmp = _mgmtSrvr.getStuff(); - - NdbApiSignal signal(0); - Uint32 * theData = signal.getDataPtrSend(); - Uint32 data[25]; - Uint32 sec0[70]; - Uint32 sec1[123]; - - data[0] = 12; - data[1] = 13; - - unsigned i; - for(i = 0; i<70; i++) - sec0[i] = i; - - for(i = 0; i<123; i++) - sec1[i] = 70+i; - - signal.set(0, CMVMI, GSN_TESTSIG, 3); - signal.m_noOfSections = 2; - signal.m_fragmentInfo = 1; - - LinearSectionPtr ptr[3]; - - theData[0] = 3; - theData[1] = 0; - theData[2] = 7; // FragmentId - - ptr[0].sz = 2; - ptr[0].p = &data[0]; - - ptr[1].sz = 60; - ptr[1].p = &sec0[0]; - - tmp.theFacade->lock_mutex(); - tmp.theRegistry->prepareSend(&signal, 1, theData, processId, ptr); - tmp.theFacade->unlock_mutex(); - - signal.set(0, CMVMI, GSN_TESTSIG, 3); - signal.m_noOfSections = 2; - signal.m_fragmentInfo = 3; - - theData[0] = 0; - theData[1] = 1; - theData[2] = 7; // FragmentId - - ptr[0].sz = 10; - ptr[0].p = &sec0[60]; - - ptr[1].sz = 123; - ptr[1].p = &sec1[0]; - - tmp.theFacade->lock_mutex(); - tmp.theRegistry->prepareSend(&signal, 1, theData, processId, ptr); - tmp.theFacade->unlock_mutex(); -} diff --git a/ndb/src/mgmsrv/CommandInterpreter.hpp b/ndb/src/mgmsrv/CommandInterpreter.hpp index 74e5c2e95be..1cd80c5d3ae 100644 --- a/ndb/src/mgmsrv/CommandInterpreter.hpp +++ b/ndb/src/mgmsrv/CommandInterpreter.hpp @@ -130,7 +130,6 @@ public: void executeStop(int processId, const char* parameters, bool all); void executeStart(int processId, const char* parameters, bool all); void executeRestart(int processId, const char* parameters, bool all); - void executeLogLevel(int processId, const char* parameters, bool all); void executeError(int processId, const char* parameters, bool all); void executeTrace(int processId, const char* parameters, bool all); void executeLog(int processId, const char* parameters, bool all); @@ -140,14 +139,7 @@ public: void executeTestOn(int processId, const char* parameters, bool all); void executeTestOff(int processId, const char* parameters, bool all); void executeStatus(int processId, const char* parameters, bool all); - void executeEnterSingleUser(char* parameters); - void executeExitSingleUser(char* parameters); - void executeEventReporting(int processId, const char* parameters, bool all); void executeDumpState(int processId, const char* parameters, bool all); - void executeStartBackup(char * pars); - void executeAbortBackup(char * pars); - - void jonas(int processId, const char* parameters, bool all); /** * A execute function definition From b3dd00299928ecf27d830359ac6ece8901ed016f Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 17 Dec 2004 10:55:00 +0100 Subject: [PATCH 0538/1063] enabled setting version for ndb --- ndb/src/common/util/version.c | 41 ++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/ndb/src/common/util/version.c b/ndb/src/common/util/version.c index 8e4f6efe745..75537c6ed3a 100644 --- a/ndb/src/common/util/version.c +++ b/ndb/src/common/util/version.c @@ -17,6 +17,8 @@ #include #include #include +#include +#include Uint32 getMajor(Uint32 version) { return (version >> 16) & 0xFF; @@ -67,6 +69,24 @@ struct NdbUpGradeCompatible { /*#define TEST_VERSION*/ +#define HAVE_NDB_SETVERSION +#ifdef HAVE_NDB_SETVERSION +Uint32 ndbOwnVersionTesting = 0; +void +ndbSetOwnVersion() { + char buf[256]; + if (NdbEnv_GetEnv("NDB_SETVERSION", buf, sizeof(buf))) { + Uint32 _v1,_v2,_v3; + if (sscanf(buf, "%u.%u.%u", &_v1, &_v2, &_v3) == 3) { + ndbOwnVersionTesting = MAKE_VERSION(_v1,_v2,_v3); + ndbout_c("Testing: Version set to 0x%x", ndbOwnVersionTesting); + } + } +} +#else +void ndbSetOwnVersion() {} +#endif + #ifndef TEST_VERSION struct NdbUpGradeCompatible ndbCompatibleTable_full[] = { { MAKE_VERSION(4,1,9), MAKE_VERSION(4,1,8), UG_Exact }, @@ -79,8 +99,6 @@ struct NdbUpGradeCompatible ndbCompatibleTable_upgrade[] = { { 0, 0, UG_Null } }; -void ndbSetOwnVersion() {} - #else /* testing purposes */ struct NdbUpGradeCompatible ndbCompatibleTable_full[] = { @@ -101,19 +119,6 @@ struct NdbUpGradeCompatible ndbCompatibleTable_upgrade[] = { }; -Uint32 ndbOwnVersionTesting = 0; -void -ndbSetOwnVersion() { - char buf[256]; - if (NdbEnv_GetEnv("NDB_SETVERSION", buf, sizeof(buf))) { - Uint32 _v1,_v2,_v3; - if (sscanf(buf, "%u.%u.%u", &_v1, &_v2, &_v3) == 3) { - ndbOwnVersionTesting = MAKE_VERSION(_v1,_v2,_v3); - ndbout_c("Testing: Version set to 0x%x", ndbOwnVersionTesting); - } - } -} - #endif void ndbPrintVersion() @@ -127,13 +132,13 @@ void ndbPrintVersion() Uint32 ndbGetOwnVersion() { -#ifndef TEST_VERSION - return NDB_VERSION_D; -#else /* testing purposes */ +#ifdef HAVE_NDB_SETVERSION if (ndbOwnVersionTesting == 0) return NDB_VERSION_D; else return ndbOwnVersionTesting; +#else + return NDB_VERSION_D; #endif } From 1780c9b349452c9a06a572800a299495e733ed20 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 17 Dec 2004 12:03:08 +0100 Subject: [PATCH 0539/1063] removed more duplicated commands for management server --- ndb/src/mgmclient/CommandInterpreter.cpp | 38 --- ndb/src/mgmsrv/CommandInterpreter.cpp | 300 +---------------------- ndb/src/mgmsrv/CommandInterpreter.hpp | 77 ------ 3 files changed, 7 insertions(+), 408 deletions(-) diff --git a/ndb/src/mgmclient/CommandInterpreter.cpp b/ndb/src/mgmclient/CommandInterpreter.cpp index 0c7fe642e54..550830da56f 100644 --- a/ndb/src/mgmclient/CommandInterpreter.cpp +++ b/ndb/src/mgmclient/CommandInterpreter.cpp @@ -110,7 +110,6 @@ public: void executeRestart(int processId, const char* parameters, bool all); void executeLogLevel(int processId, const char* parameters, bool all); void executeError(int processId, const char* parameters, bool all); - void executeTrace(int processId, const char* parameters, bool all); void executeLog(int processId, const char* parameters, bool all); void executeLogIn(int processId, const char* parameters, bool all); void executeLogOut(int processId, const char* parameters, bool all); @@ -729,7 +728,6 @@ static const CommandInterpreter::CommandFunctionPair commands[] = { #ifdef ERROR_INSERT ,{ "ERROR", &CommandInterpreter::executeError } #endif - ,{ "TRACE", &CommandInterpreter::executeTrace } ,{ "LOG", &CommandInterpreter::executeLog } ,{ "LOGIN", &CommandInterpreter::executeLogIn } ,{ "LOGOUT", &CommandInterpreter::executeLogOut } @@ -1676,42 +1674,6 @@ void CommandInterpreter::executeError(int processId, ndb_mgm_insert_error(m_mgmsrv, processId, errorNo, NULL); } -//***************************************************************************** -//***************************************************************************** -void -CommandInterpreter::executeTrace(int /*processId*/, - const char* /*parameters*/, bool /*all*/) -{ -#if 0 - if (emptyString(parameters)) { - ndbout << "Missing trace number." << endl; - return; - } - - char* newpar = my_strdup(parameters,MYF(MY_WME)); - My_auto_ptr ap1(newpar); - char* firstParameter = strtok(newpar, " "); - - - int traceNo; - if (! convert(firstParameter, traceNo)) { - ndbout << "Expected an integer." << endl; - return; - } - char* allAfterFirstParameter = strtok(NULL, "\0"); - - if (! emptyString(allAfterFirstParameter)) { - ndbout << "Nothing expected after trace number." << endl; - return; - } - - int result = _mgmtSrvr.setTraceNo(processId, traceNo); - if (result != 0) { - ndbout << get_error_text(result) << endl; - } -#endif -} - //***************************************************************************** //***************************************************************************** diff --git a/ndb/src/mgmsrv/CommandInterpreter.cpp b/ndb/src/mgmsrv/CommandInterpreter.cpp index 24b64457649..0b28defa196 100644 --- a/ndb/src/mgmsrv/CommandInterpreter.cpp +++ b/ndb/src/mgmsrv/CommandInterpreter.cpp @@ -104,7 +104,6 @@ int CommandInterpreter::readAndExecute() { int processId; if (! convert(firstToken, processId)) { ndbout << "Invalid command: " << _line << "." << endl; - ndbout << "Type HELP for help." << endl << endl; return true; } if (processId < 0) { @@ -120,20 +119,9 @@ int CommandInterpreter::readAndExecute() { static const CommandInterpreter::CommandFunctionPair commands[] = { - { "START", &CommandInterpreter::executeStart } - ,{ "RESTART", &CommandInterpreter::executeRestart } - ,{ "STOP", &CommandInterpreter::executeStop } -#ifdef ERROR_INSERT - ,{ "ERROR", &CommandInterpreter::executeError } -#endif - ,{ "TRACE", &CommandInterpreter::executeTrace } - ,{ "LOG", &CommandInterpreter::executeLog } - ,{ "LOGIN", &CommandInterpreter::executeLogIn } + { "LOGIN", &CommandInterpreter::executeLogIn } ,{ "LOGOUT", &CommandInterpreter::executeLogOut } ,{ "LOGOFF", &CommandInterpreter::executeLogOff } - ,{ "TESTON", &CommandInterpreter::executeTestOn } - ,{ "TESTOFF", &CommandInterpreter::executeTestOff } - ,{ "DUMP", &CommandInterpreter::executeDumpState } }; @@ -170,16 +158,14 @@ CommandInterpreter::analyseAfterFirstToken(int processId, if(fun == 0){ ndbout << "Invalid command: " << secondToken << "." << endl; - ndbout << "Type HELP for help." << endl << endl; return; } if(processId == -1){ executeForAll(command, fun, allAfterSecondToken); } else { - if(strcmp(command, "STATUS") != 0) - ndbout << "Executing " << command << " on node: " - << processId << endl << endl; + ndbout << "Executing " << command << " on node: " + << processId << endl << endl; (this->*fun)(processId, allAfterSecondToken, false); ndbout << endl; } @@ -190,18 +176,11 @@ CommandInterpreter::executeForAll(const char * cmd, ExecuteFunction fun, const char * allAfterSecondToken){ NodeId nodeId = 0; - if(strcmp(cmd, "STOP") == 0 || - strcmp(cmd, "RESTART") == 0){ - ndbout << "Executing " << cmd << " on all nodes" << endl << "\n"; + while(_mgmtSrvr.getNextNodeId(&nodeId, NDB_MGM_NODE_TYPE_NDB)){ + ndbout << "Executing " << cmd << " on node: " + << nodeId << endl << endl; (this->*fun)(nodeId, allAfterSecondToken, true); - } else { - while(_mgmtSrvr.getNextNodeId(&nodeId, NDB_MGM_NODE_TYPE_NDB)){ - if(strcmp(cmd, "STATUS") != 0) - ndbout << "Executing " << cmd << " on node: " - << nodeId << endl << endl; - (this->*fun)(nodeId, allAfterSecondToken, true); - ndbout << endl; - } // for + ndbout << endl; } } @@ -271,233 +250,6 @@ bool CommandInterpreter::parseBlockSpecification(const char* allAfterLog, return true; } -//***************************************************************************** -//***************************************************************************** - -void -stopCallback(int nodeId, void * anyData, int errCode){ - if(errCode == 0){ - if(nodeId == 0) - ndbout << "\nCluster has shutdown" << endl; - else - ndbout << "\nNode " << nodeId << " has shutdown" << endl; - } else { - MgmtSrvr * mgm = (MgmtSrvr *)anyData; - char err_str[1024]; - ndbout << "Node " << nodeId << " has not shutdown: " - << mgm->getErrorText(errCode,err_str,sizeof(err_str)) << endl; - } -} - -//***************************************************************************** -//***************************************************************************** -void CommandInterpreter::executeStop(int processId, - const char* parameters, bool all) { - - (void)parameters; // Don't want compiler warning - - int result = 0; - if(all) - result = _mgmtSrvr.stop((int *)0, false, stopCallback, this); - else - result = _mgmtSrvr.stopNode(processId, false, stopCallback, this); - - if(result != 0) - ndbout << get_error_text(result) << endl; -} - - -void CommandInterpreter::executeStart(int processId, const char* parameters, - bool all) { - (void)all; // Don't want compiler warning - - if (! emptyString(parameters)) { - ndbout << "No parameters expected to this command." << endl; - return; - } - - int result = _mgmtSrvr.start(processId); - if (result != 0) { - ndbout << get_error_text(result) << endl; - } -} - -void -CommandInterpreter::executeRestart(int processId, const char* parameters, - bool all) { - - bool nostart = false; - bool initialstart = false; - - if(parameters != 0 && strlen(parameters) != 0){ - char * tmpString = strdup(parameters); - char * tmpPtr = 0; - char * item = strtok_r(tmpString, " ", &tmpPtr); - while(item != NULL){ - if(strcmp(item, "-N") == 0) - nostart = true; - if(strcmp(item, "-I") == 0) - initialstart = true; - item = strtok_r(NULL, " ", &tmpPtr); - } - free(tmpString); - } - int result; - if(all) - result = _mgmtSrvr.restart(nostart, initialstart, false, - 0, stopCallback, this); - else - result = _mgmtSrvr.restartNode(processId, nostart, initialstart, false, - stopCallback, - this); - if (result != 0) { - ndbout << get_error_text(result) << endl; - } -} - -void -CommandInterpreter::executeDumpState(int processId, const char* parameters, - bool all) { - - (void)all; // Don't want compiler warning - - if(parameters == 0 || strlen(parameters) == 0){ - ndbout << "Expected argument" << endl; - return; - } - - Uint32 no = 0; - Uint32 pars[25]; - - char * tmpString = strdup(parameters); - char * tmpPtr = 0; - char * item = strtok_r(tmpString, " ", &tmpPtr); - int error; - while(item != NULL){ - if (0x0 <= my_strtoll10(item, NULL, &error) && my_strtoll10(item, NULL, &error) <= 0xffffffff) { - pars[no] = my_strtoll10(item, NULL, &error); - } else { - ndbout << "Illegal value in argument to signal." << endl - << "(Value must be between 0 and 0xffffffff.)" - << endl; - return; - } - no++; - item = strtok_r(NULL, " ", &tmpPtr); - } - ndbout << "Sending dump signal with data:" << endl; - for (Uint32 i=0; i blocks; - if (! parseBlockSpecification(parameters, blocks)) { - return; - } - - int result = _mgmtSrvr.setSignalLoggingMode(processId, MgmtSrvr::InOut, blocks); - if (result != 0) { - ndbout << get_error_text(result) << endl; - } - -} - - - -//****************************************************************************** -//****************************************************************************** void CommandInterpreter::executeLogIn(int processId, const char* parameters, bool all) { @@ -554,41 +306,3 @@ void CommandInterpreter::executeLogOff(int processId, } } - -//****************************************************************************** -//****************************************************************************** -void CommandInterpreter::executeTestOn(int processId, - const char* parameters, bool all) { - - (void)all; // Don't want compiler warning - - if (! emptyString(parameters)) { - ndbout << "No parameters expected to this command." << endl; - return; - } - - int result = _mgmtSrvr.startSignalTracing(processId); - if (result != 0) { - ndbout << get_error_text(result) << endl; - } - -} - -//****************************************************************************** -//****************************************************************************** -void CommandInterpreter::executeTestOff(int processId, - const char* parameters, bool all) { - - (void)all; // Don't want compiler warning - - if (! emptyString(parameters)) { - ndbout << "No parameters expected to this command." << endl; - return; - } - - int result = _mgmtSrvr.stopSignalTracing(processId); - if (result != 0) { - ndbout << get_error_text(result) << endl; - } - -} diff --git a/ndb/src/mgmsrv/CommandInterpreter.hpp b/ndb/src/mgmsrv/CommandInterpreter.hpp index 1cd80c5d3ae..0eb39758969 100644 --- a/ndb/src/mgmsrv/CommandInterpreter.hpp +++ b/ndb/src/mgmsrv/CommandInterpreter.hpp @@ -17,52 +17,21 @@ #ifndef CommandInterpreter_H #define CommandInterpreter_H -//***************************************************************************** -// Author: Peter Lind -//***************************************************************************** - #include #include #include class MgmtSrvr; -/** - * @class CommandInterpreter - * @brief Reads command line in management client - * - * This class has one public method which reads a command line - * from a stream. It then interpret that commmand line and calls a suitable - * method in the MgmtSrvr class which executes the command. - * - * For command syntax, see the HELP command. - */ class CommandInterpreter { public: - /** - * Constructor - * @param mgmtSrvr: Management server to use when executing commands - */ CommandInterpreter(MgmtSrvr& mgmtSrvr); - - /** - * Reads one line from the stream, parse the line to find - * a command and then calls a suitable method which executes - * the command. - * - * @return true until quit/bye/exit has been typed - */ int readAndExecute(); private: char m_err_str[1024]; const char *get_error_text(int err_no); - /** - * Read a string, and return a pointer to it. - * - * @return NULL on EOF. - */ char *readline_gets () { static char linebuffer[254]; @@ -89,61 +58,15 @@ private: return (line_read); } - /** - * Analyse the command line, after the first token. - * - * @param processId: DB process id to send command to or -1 if - * command will be sent to all DB processes. - * @param allAfterFirstToken: What the client gave after the - * first token on the command line - */ void analyseAfterFirstToken(int processId, char* allAfterFirstTokenCstr); - - /** - * Parse the block specification part of the LOG* commands, - * things after LOG*: [BLOCK = {ALL|+}] - * - * @param allAfterLog: What the client gave after the second token - * (LOG*) on the command line - * @param blocks, OUT: ALL or name of all the blocks - * @return: true if correct syntax, otherwise false - */ bool parseBlockSpecification(const char* allAfterLog, Vector& blocks); - - /** - * A bunch of execute functions: Executes one of the commands - * - * @param processId: DB process id to send command to - * @param parameters: What the client gave after the command name - * on the command line. - * For example if complete input from user is: "1 LOGLEVEL 22" then the - * parameters argument is the string with everything after LOGLEVEL, in this - * case "22". Each function is responsible to check the parameters argument. - */ - void executeHelp(char* parameters); - void executeShow(char* parameters); - void executeRun(char* parameters); - void executeInfo(char* parameters); public: - void executeStop(int processId, const char* parameters, bool all); - void executeStart(int processId, const char* parameters, bool all); - void executeRestart(int processId, const char* parameters, bool all); - void executeError(int processId, const char* parameters, bool all); - void executeTrace(int processId, const char* parameters, bool all); - void executeLog(int processId, const char* parameters, bool all); void executeLogIn(int processId, const char* parameters, bool all); void executeLogOut(int processId, const char* parameters, bool all); void executeLogOff(int processId, const char* parameters, bool all); - void executeTestOn(int processId, const char* parameters, bool all); - void executeTestOff(int processId, const char* parameters, bool all); - void executeStatus(int processId, const char* parameters, bool all); - void executeDumpState(int processId, const char* parameters, bool all); - /** - * A execute function definition - */ public: typedef void (CommandInterpreter::* ExecuteFunction)(int processId, const char * param, From 7b592c9e2416792fd17997a8f44eadb939c2629a Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 17 Dec 2004 12:27:08 +0100 Subject: [PATCH 0540/1063] added TRACE to managemnt server removed TRACE from management client ndb/src/mgmclient/CommandInterpreter.cpp: removed TRACE from management client ndb/src/mgmsrv/CommandInterpreter.cpp: added TRACE to managemnt server ndb/src/mgmsrv/CommandInterpreter.hpp: added TRACE to managemnt server --- ndb/src/mgmclient/CommandInterpreter.cpp | 1 - ndb/src/mgmsrv/CommandInterpreter.cpp | 39 +++++++++++++++++++++++- ndb/src/mgmsrv/CommandInterpreter.hpp | 1 + 3 files changed, 39 insertions(+), 2 deletions(-) diff --git a/ndb/src/mgmclient/CommandInterpreter.cpp b/ndb/src/mgmclient/CommandInterpreter.cpp index 550830da56f..cbf7776fe06 100644 --- a/ndb/src/mgmclient/CommandInterpreter.cpp +++ b/ndb/src/mgmclient/CommandInterpreter.cpp @@ -340,7 +340,6 @@ static const char* helpTextDebug = #ifdef ERROR_INSERT " ERROR Inject error into NDB node\n" #endif -" TRACE Set trace number\n" " LOG [BLOCK = {ALL|+}] Set logging on in & out signals\n" " LOGIN [BLOCK = {ALL|+}] Set logging on in signals\n" " LOGOUT [BLOCK = {ALL|+}] Set logging on out signals\n" diff --git a/ndb/src/mgmsrv/CommandInterpreter.cpp b/ndb/src/mgmsrv/CommandInterpreter.cpp index 0b28defa196..686155415d5 100644 --- a/ndb/src/mgmsrv/CommandInterpreter.cpp +++ b/ndb/src/mgmsrv/CommandInterpreter.cpp @@ -119,7 +119,8 @@ int CommandInterpreter::readAndExecute() { static const CommandInterpreter::CommandFunctionPair commands[] = { - { "LOGIN", &CommandInterpreter::executeLogIn } + { "TRACE", &CommandInterpreter::executeTrace } + ,{ "LOGIN", &CommandInterpreter::executeLogIn } ,{ "LOGOUT", &CommandInterpreter::executeLogOut } ,{ "LOGOFF", &CommandInterpreter::executeLogOff } }; @@ -306,3 +307,39 @@ void CommandInterpreter::executeLogOff(int processId, } } + +void CommandInterpreter::executeTrace(int processId, + const char* parameters, bool all) { + + (void)all; // Don't want compiler warning + + if (emptyString(parameters)) { + ndbout << "Missing trace number." << endl; + return; + } + + char* newpar = strdup(parameters); + char* firstParameter = strtok(newpar, " "); + + + int traceNo; + if (! convert(firstParameter, traceNo)) { + ndbout << "Expected an integer." << endl; + free(newpar); + return; + } + + char* allAfterFirstParameter = strtok(NULL, "\0"); + + if (! emptyString(allAfterFirstParameter)) { + ndbout << "Nothing expected after trace number." << endl; + free(newpar); + return; + } + + int result = _mgmtSrvr.setTraceNo(processId, traceNo); + if (result != 0) { + ndbout << get_error_text(result) << endl; + } + free(newpar); +} diff --git a/ndb/src/mgmsrv/CommandInterpreter.hpp b/ndb/src/mgmsrv/CommandInterpreter.hpp index 0eb39758969..6b67d1a5a5f 100644 --- a/ndb/src/mgmsrv/CommandInterpreter.hpp +++ b/ndb/src/mgmsrv/CommandInterpreter.hpp @@ -63,6 +63,7 @@ private: Vector& blocks); public: + void executeTrace(int processId, const char* parameters, bool all); void executeLogIn(int processId, const char* parameters, bool all); void executeLogOut(int processId, const char* parameters, bool all); void executeLogOff(int processId, const char* parameters, bool all); From 71981ad774c92552ce300389f519fc9a410b3686 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 17 Dec 2004 17:03:15 +0100 Subject: [PATCH 0541/1063] Delete files which were accidently created within the last push BitKeeper/deleted/.del-tool_test.test~7a0c705c995ee523: Delete: mysql-test/t/tool_test.test BitKeeper/deleted/.del-tool_test.result~ec1f972349e9e18: Delete: mysql-test/r/tool_test.result BitKeeper/deleted/.del-ps_12func.test~78bc82c8a4a1ccae: Delete: mysql-test/t/ps_12func.test BitKeeper/deleted/.del-ps_12func.result~d8cce403c6cb460e: Delete: mysql-test/r/ps_12func.result BitKeeper/deleted/.del-patchwork-check.inc~45d0d076850f5c5b: Delete: mysql-test/include/patchwork-check.inc --- mysql-test/include/patchwork-check.inc | 330 -- mysql-test/r/ps_12func.result | 4748 ------------------------ mysql-test/r/tool_test.result | 223 -- mysql-test/t/ps_12func.test | 867 ----- mysql-test/t/tool_test.test | 105 - 5 files changed, 6273 deletions(-) delete mode 100644 mysql-test/include/patchwork-check.inc delete mode 100644 mysql-test/r/ps_12func.result delete mode 100644 mysql-test/r/tool_test.result delete mode 100644 mysql-test/t/ps_12func.test delete mode 100644 mysql-test/t/tool_test.test diff --git a/mysql-test/include/patchwork-check.inc b/mysql-test/include/patchwork-check.inc deleted file mode 100644 index b11db7fa50d..00000000000 --- a/mysql-test/include/patchwork-check.inc +++ /dev/null @@ -1,330 +0,0 @@ -###################### patchwork-check.inc ############################# -# # -# Basic routine for the generation and execution of prepared and non # -# prepared SQL statements. # -# # -# Purpose: Simplify the check of complex statements with different # -# sets of parameters (data type, value) # -# # -######################################################################## - -# -# NOTE: PLEASE BE VERY CAREFULL, WHEN CHANGING OR USING ;-) THIS ROUTINE. -# -# Please be aware, that this routine -# - will be sourced by several test case files stored within the -# directory 'mysql-test/t'. So every change here will affect -# several test cases. -# - does not check its own prequisites -# - modifies the content and the data type of the -# uservariables @var_1 ... @var_ -# -# Please preserve the '___' naming of the the auxiliary variables. -# These names should avoid that a test case writer accidently creates a -# variable with the same name. -# - -# naming conventions: -# stmt_c_ --> statement with constants like "select 1 " -# stmt_uv_ --> statement with uservariables like "select @var_1 " -# stmt_ph_ --> prepared statement with placeholders like "select ? " - - -# -# Explanation how to use this routine by an example: -# -# Content of the caller script: -# .... -# set @stmt_part1= 'SELECT f1 + ' -# set @stmt_part2= ' from t1 where f2= ' ; -# set @stmt_part3= '' ; -# set @string_1= "1"; set @type_1= "BIGINT"; -# set @string_2= "-2.3E-4"; set @type_2= "DOUBLE"; -# set @max_var_number= 2; -# --source include/patchwork-check.inc -# -# # The next testing rounds could start with -# set @string_1= "NULL"; set @type_1= "BIGINT"; -# set @string_2= "-2.3E-4"; set @type_2= "DOUBLE"; -# --source include/patchwork-check.inc -# -# set @string_1= "1"; set @type_1= "BIGINT"; -# set @string_2= "NULL"; set @type_2= "LONGTEXT"; -# --source include/patchwork-check.inc -# -# Statements and uservariables to be produced and executed by this routine -# 1. Statements with constants -# 1.1 stmt1= SELECT f1 + 1 from t1 where f2= -2.3E-4 ; -# 1.2 stmt1 as prepared statement -# 2. Statements with uservariables -# @var_n should be of data type @type_n (if possible) and have the -# content @string_n . -# 2.1 stmt2= SELECT f1 + @var_1 from t1 where f2= @var_2 -# 2.2 stmt2 as prepared statement -# 3. prepared statement with placeholders -# prepare stmt1 from 'SELECT f1 + ? from t1 where f2= ?' -# execute stmt1 using @var_1, @var_2 -# -# Every prepared statement variant of the "patchwork" is 3 times executed. -# -# -# Please have also also a look into -# - t/tooltest.test , which checks or -# - t/ps_12func.test , which contains test cases using -# this routine. -# - - -############## -# -# Prerequisites: -# -# The caller script must set the following uservariables: -# -# The statement pieces: @stmt_part1, @stmt_part2, ... , @stmt_part -# -# The parameter values: @string_1, ... , @string_ -# The parameter value should fit to the data type ! -# UPPER(@stmt_part1) = 'NULL' will cause (SQL) NULL as content. -# -# The parameter data types: @type_1, ... , @type_ -# valid types are: BIGINT, DOUBLE, LONGTEXT, LONGBLOB -# -# Attention: All other type assignments will lead to a -# uservariable of type LONGTEXT !! -# -# The number of parameter values must be published via -# set @max_var_number= ; -# -# Attention: This routine does not perform any check of the content -# of these variables. -# - -############## -# -# How is intended uservariable generated: -# -# Step 1: generate a uservariable of the intended type -# -# UPPER(@type_) statement -# BIGINT set @var_= 0 -# DOUBLE' set @var_idx_= 0.0 -# LONGTEXT' set @var_= "INIT" -# LONGBLOB' set @var_= CAST("INIT" AS BINARY) -# set @var_= "INIT" -# -# Step 2: assign the value to the uservariable -# -# IF ( UPPER(@string_) != 'NULL') -# UPPER(@type_) -# BIGINT set @var_= CEIL(@string_) -# DOUBLE set @var_= @string_ + 0.0 -# LONGTEXT set @var_= @string_ -# LONGBLOB set @var_= CAST(@string_ AS BINARY) -# set @var_= @string_ -# ELSE -# set @var_= NULL -# - - -# -# How to debug this routine if something goes wrong: -# -# 1. Put the line '--disable_abort_on_error' into the caller script -# --> There will be no abort of mysqltest, if a statement fails. -# You will get a protocol (in most cases). -# 2. Put the line 'set $__debug_= 1 ;' into the caller script . -# The next call of patchwork-check.inc will print -# the type and content of generated uservariables and statements. -# 3. disable the '--disable_query_log' option some lines below -# -# and please be patient towards this routine, it is far away from being perfect. -# - - -# Suppress the majority of the huge output concerning the statement and -# uservariable generation ---disable_query_log - -let $__idx_= 1 ; -eval set @__stmt_c_= @stmt_part_$__idx_ ; -# If the number of variables is greater 0, we need also -# - the statement with uservariables (stmt_uv) and -# - the prepared statement with placeholders (stmt_ph) and -# - the execute for the prepared statement with placeholders (execute_stmt_ph) -let $__with_var_= `select @max_var_number > 0`; -while ($__with_var_) -{ - eval set @__stmt_uv_= @stmt_part_$__idx_ ; - eval set @__stmt_ph_= @stmt_part_$__idx_ ; - set @__execute_stmt_ph= 'execute __stmt_ph_ using ' ; - let $__num_= `select @max_var_number`; - while ($__num_) - { - ##### Generate the Uservariables - eval set @__my_init_= CASE UPPER(@type_$__idx_) - WHEN 'BIGINT' THEN 'set @var_$__idx_= 0' - WHEN 'DOUBLE' THEN 'set @var_$__idx_= 0.0' - WHEN 'LONGTEXT' THEN 'set @var_$__idx_= "INIT"' - WHEN 'LONGBLOB' THEN 'set @var_$__idx_= CAST("INIT" AS BINARY)' - ELSE 'set @var_$__idx_= "INIT"' END; - # select @__my_init_ as "@__my_init_ is: " ; - let $__my_init_= `select @__my_init_`; - eval $__my_init_ ; - - eval set @__my_init_= CASE UPPER(@type_$__idx_) - WHEN 'BIGINT' THEN - "set @var_$__idx_= IF(UPPER(@string_$__idx_)!='NULL',CEIL(@string_$__idx_),NULL)" - WHEN 'DOUBLE' THEN - "set @var_$__idx_= IF(UPPER(@string_$__idx_)!='NULL',@string_$__idx_ + 0.0,NULL)" - WHEN 'LONGTEXT' THEN - "set @var_$__idx_= IF(UPPER(@string_$__idx_)!='NULL',@string_$__idx_,NULL)" - WHEN 'LONGBLOB' THEN - "set @var_$__idx_= IF(UPPER(@string_$__idx_)!='NULL',CAST(@string_$__idx_ AS BINARY),NULL)" - ELSE - "set @var_$__idx_= IF(UPPER(@string_$__idx_)!='NULL',@string_$__idx_,NULL)" END; - let $__my_init_= `select @__my_init_`; - eval $__my_init_ ; - - ##### concat the variable to the statements - ## with Constants - # 1. replace ugly NULLs like 'NuLl' with 'NULL' for better readability - # 2. Strings to be inserted into the statement must be quoted - eval set @__stmt_c_= concat( - @__stmt_c_, - IF(UPPER(@string_$__idx_)='NULL','NULL', - IF(UPPER(@type_$__idx_)='LONGTEXT' or UPPER(@type_$__idx_)='LONGBLOB', - concat('''',@string_$__idx_,''''), @string_$__idx_ - ))) ; - ## with Uservariables - eval set @__stmt_uv_= concat(@__stmt_uv_, '@var_$__idx_') ; - ## with placeholders - eval set @__stmt_ph_= concat(@__stmt_ph_, '?') ; - - ##### complete the execute for the prepared statement with placeholders - eval set @__execute_stmt_ph= concat(@__execute_stmt_ph, '@var_$__idx_,') ; - - inc $__idx_ ; - ##### concat the next part of the statement to the statements - eval set @__stmt_c_= concat(@__stmt_c_, @stmt_part_$__idx_ ); - eval set @__stmt_uv_= concat(@__stmt_uv_, @stmt_part_$__idx_ ); - eval set @__stmt_ph_= concat(@__stmt_ph_, @stmt_part_$__idx_ ); - - dec $__num_ ; - } - # @__execute_stmt_ph contains a trailing ',' which must be cut away - set @__execute_stmt_ph= substr(@__execute_stmt_ph,1,length(@__execute_stmt_ph) - 1); - dec $__with_var_ ; -} - -while ($__debug_) -{ - ### Print debug informations for patchwork with variables - let $__with_var_= `select @max_var_number > 0`; - while ($__with_var_) - { - ### Print out the content of the statement variables - eval select "--------------------------------------" - as "the content of the statement variables" - union select concat('@__stmt_c_ is: ',@__stmt_c_) - union select concat('@__stmt_uv_ is: ',@__stmt_uv_) - union select concat('@__stmt_ph_ is: ',@__stmt_ph_) - union select concat('@__execute_stmt_ph is: ',@__execute_stmt_ph); - - - ### Print out the content of the uservariables - select '--------------------------------------' - as "the content of the parameter variables"; - set @__parameter_= 'select '; - let $__num_= `select @max_var_number`; - let $__idx_= 1 ; - while ($__num_) - { - eval select @type_$__idx_ as type, - @string_$__idx_ as string, - @var_$__idx_ as uservariable ; - eval set @__parameter_= concat(@__parameter_, '@var_$__idx_ ,'); - inc $__idx_ ; - - dec $__num_ ; - } - # @__parameter_ contains a trailing ',' which must be cut away - set @__parameter_= substr(@__parameter_,1,length(@__parameter_) - 1); - let $__aux_= `select @__parameter_` ; - eval $__aux_ ; - - - ### Create a table from the uservariables and print out the column types - let $__aux_= `select concat('CREATE TABLE t9 AS ',@__parameter_)` ; - --disable_warnings - drop table if exists t9; - --enable_warnings - eval $__aux_ ; - show create table t9; - drop table t9; - - dec $__with_var_ ; - } - ### Print debug informations for patchwork without variables - ### stmt_uv, stmt_ph, execute_stmt_ph and uservariables do NOT exist - let $__with_var_= `select @max_var_number = 0`; - while ($__with_var_) - { - ### Print out the content of the statement variables - eval select "--------------------------------------" - as "the content of the statement variable" - union select concat('@__stmt_c_ is: ',@__stmt_c_) ; - - dec $__with_var_ ; - } - - - dec $__debug_ ; -} - -## copy the statements and the execute into $variables -# (__stmt_ph_ is not needed) -## + generate the prepared statements ---enable_query_log -let $__stmt_c_= `select @__stmt_c_`; -eval prepare __stmt_c_ from @__stmt_c_ ; -let $__with_var_= `select @max_var_number > 0`; -while ($__with_var_) -{ - let $__stmt_uv_= `select @__stmt_uv_`; - eval prepare __stmt_uv_ from @__stmt_uv_ ; - let $__execute_ph= `select @__execute_stmt_ph`; - eval prepare __stmt_ph_ from @__stmt_ph_ ; - dec $__with_var_ ; -} - - -##### The execution of all statements -## statement with Constants -eval $__stmt_c_ ; -## prepared statement with Constants -execute __stmt_c_ ; -# Try to detect if the prior executes damaged the parse tree by -# two additional executes . -execute __stmt_c_ ; -execute __stmt_c_ ; -let $__with_var_= `select @max_var_number > 0`; -while ($__with_var_) -{ - ## statement with Uservariables - eval $__stmt_uv_ ; - ## prepared statement with Uservariables - execute __stmt_uv_ ; - # Try to detect if the prior executes damaged the parse tree by - # two additional executes . - execute __stmt_uv_ ; - execute __stmt_uv_ ; - ## prepared statement with placeholders - eval $__execute_ph ; - # Try to detect if the prior executes damaged the parse tree by - # two additional executes . - eval $__execute_ph ; - eval $__execute_ph ; - - dec $__with_var_ ; -} diff --git a/mysql-test/r/ps_12func.result b/mysql-test/r/ps_12func.result deleted file mode 100644 index 881d5392edd..00000000000 --- a/mysql-test/r/ps_12func.result +++ /dev/null @@ -1,4748 +0,0 @@ -use test; - -###### Variations on ROUND(X,D) ###### - -set @stmt_part_1= 'select ROUND(' ; -set @stmt_part_2= ',' ; -set @stmt_part_3= ') as my_col' ; -set @max_var_number= 2; -set @string_1= '11.298' ; -set @type_1= 'DOUBLE' ; -set @type_2= 'BIGINT' ; -set @string_2= '1' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(11.298,1) as my_col ; -my_col -11.3 -execute __stmt_c_ ; -my_col -11.3 -execute __stmt_c_ ; -my_col -11.3 -execute __stmt_c_ ; -my_col -11.3 -select ROUND(@var_1 ,@var_2) as my_col ; -my_col -11.3 -execute __stmt_uv_ ; -my_col -11.3 -execute __stmt_uv_ ; -my_col -11.3 -execute __stmt_uv_ ; -my_col -11.3 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -11.3 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -11.3 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -11.3 -set @string_2= '3' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(11.298,3) as my_col ; -my_col -11.298 -execute __stmt_c_ ; -my_col -11.298 -execute __stmt_c_ ; -my_col -11.298 -execute __stmt_c_ ; -my_col -11.298 -select ROUND(@var_1 ,@var_2) as my_col ; -my_col -11.298 -execute __stmt_uv_ ; -my_col -11.298 -execute __stmt_uv_ ; -my_col -11.298 -execute __stmt_uv_ ; -my_col -11.298 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -11.298 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -11.298 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -11.298 -set @string_2= '4' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(11.298,4) as my_col ; -my_col -11.2980 -execute __stmt_c_ ; -my_col -11.2980 -execute __stmt_c_ ; -my_col -11.2980 -execute __stmt_c_ ; -my_col -11.2980 -select ROUND(@var_1 ,@var_2) as my_col ; -my_col -11.2980 -execute __stmt_uv_ ; -my_col -11.2980 -execute __stmt_uv_ ; -my_col -11.2980 -execute __stmt_uv_ ; -my_col -11.2980 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -11.2980 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -11.2980 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -11.2980 -set @string_2= '0' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(11.298,0) as my_col ; -my_col -11 -execute __stmt_c_ ; -my_col -11 -execute __stmt_c_ ; -my_col -11 -execute __stmt_c_ ; -my_col -11 -select ROUND(@var_1 ,@var_2) as my_col ; -my_col -11 -execute __stmt_uv_ ; -my_col -11 -execute __stmt_uv_ ; -my_col -11 -execute __stmt_uv_ ; -my_col -11 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -11 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -11 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -11 -set @string_2= '-1' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(11.298,-1) as my_col ; -my_col -10 -execute __stmt_c_ ; -my_col -10 -execute __stmt_c_ ; -my_col -10 -execute __stmt_c_ ; -my_col -10 -select ROUND(@var_1 ,@var_2) as my_col ; -my_col -10 -execute __stmt_uv_ ; -my_col -10 -execute __stmt_uv_ ; -my_col -10 -execute __stmt_uv_ ; -my_col -10 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -10 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -10 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -10 -set @string_2= '-2' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(11.298,-2) as my_col ; -my_col -0 -execute __stmt_c_ ; -my_col -0 -execute __stmt_c_ ; -my_col -0 -execute __stmt_c_ ; -my_col -0 -select ROUND(@var_1 ,@var_2) as my_col ; -my_col -0 -execute __stmt_uv_ ; -my_col -0 -execute __stmt_uv_ ; -my_col -0 -execute __stmt_uv_ ; -my_col -0 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -0 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -0 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -0 -set @string_2= '-3' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(11.298,-3) as my_col ; -my_col -0 -execute __stmt_c_ ; -my_col -0 -execute __stmt_c_ ; -my_col -0 -execute __stmt_c_ ; -my_col -0 -select ROUND(@var_1 ,@var_2) as my_col ; -my_col -0 -execute __stmt_uv_ ; -my_col -0 -execute __stmt_uv_ ; -my_col -0 -execute __stmt_uv_ ; -my_col -0 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -0 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -0 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -0 -set @string_2= 'NULL' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(11.298,NULL) as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select ROUND(@var_1 ,@var_2) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -set @type_2= 'DOUBLE' ; -set @string_2= '1.0' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(11.298,1.0) as my_col ; -my_col -11.3 -execute __stmt_c_ ; -my_col -11.3 -execute __stmt_c_ ; -my_col -11.3 -execute __stmt_c_ ; -my_col -11.3 -select ROUND(@var_1 ,@var_2) as my_col ; -my_col -11.3 -execute __stmt_uv_ ; -my_col -11.3 -execute __stmt_uv_ ; -my_col -11.3 -execute __stmt_uv_ ; -my_col -11.3 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -11.3 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -11.3 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -11.3 -set @string_2= '3.0' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(11.298,3.0) as my_col ; -my_col -11.298 -execute __stmt_c_ ; -my_col -11.298 -execute __stmt_c_ ; -my_col -11.298 -execute __stmt_c_ ; -my_col -11.298 -select ROUND(@var_1 ,@var_2) as my_col ; -my_col -11.298 -execute __stmt_uv_ ; -my_col -11.298 -execute __stmt_uv_ ; -my_col -11.298 -execute __stmt_uv_ ; -my_col -11.298 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -11.298 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -11.298 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -11.298 -set @string_2= '4.0' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(11.298,4.0) as my_col ; -my_col -11.2980 -execute __stmt_c_ ; -my_col -11.2980 -execute __stmt_c_ ; -my_col -11.2980 -execute __stmt_c_ ; -my_col -11.2980 -select ROUND(@var_1 ,@var_2) as my_col ; -my_col -11.2980 -execute __stmt_uv_ ; -my_col -11.2980 -execute __stmt_uv_ ; -my_col -11.2980 -execute __stmt_uv_ ; -my_col -11.2980 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -11.2980 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -11.2980 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -11.2980 -set @string_2= '0.0' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(11.298,0.0) as my_col ; -my_col -11 -execute __stmt_c_ ; -my_col -11 -execute __stmt_c_ ; -my_col -11 -execute __stmt_c_ ; -my_col -11 -select ROUND(@var_1 ,@var_2) as my_col ; -my_col -11 -execute __stmt_uv_ ; -my_col -11 -execute __stmt_uv_ ; -my_col -11 -execute __stmt_uv_ ; -my_col -11 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -11 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -11 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -11 -set @string_2= '-1.0' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(11.298,-1.0) as my_col ; -my_col -10 -execute __stmt_c_ ; -my_col -10 -execute __stmt_c_ ; -my_col -10 -execute __stmt_c_ ; -my_col -10 -select ROUND(@var_1 ,@var_2) as my_col ; -my_col -10 -execute __stmt_uv_ ; -my_col -10 -execute __stmt_uv_ ; -my_col -10 -execute __stmt_uv_ ; -my_col -10 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -10 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -10 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -10 -set @string_2= '-2.0' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(11.298,-2.0) as my_col ; -my_col -0 -execute __stmt_c_ ; -my_col -0 -execute __stmt_c_ ; -my_col -0 -execute __stmt_c_ ; -my_col -0 -select ROUND(@var_1 ,@var_2) as my_col ; -my_col -0 -execute __stmt_uv_ ; -my_col -0 -execute __stmt_uv_ ; -my_col -0 -execute __stmt_uv_ ; -my_col -0 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -0 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -0 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -0 -set @string_2= '-3.0' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(11.298,-3.0) as my_col ; -my_col -0 -execute __stmt_c_ ; -my_col -0 -execute __stmt_c_ ; -my_col -0 -execute __stmt_c_ ; -my_col -0 -select ROUND(@var_1 ,@var_2) as my_col ; -my_col -0 -execute __stmt_uv_ ; -my_col -0 -execute __stmt_uv_ ; -my_col -0 -execute __stmt_uv_ ; -my_col -0 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -0 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -0 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -0 -set @string_2= '1.1' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(11.298,1.1) as my_col ; -my_col -11.3 -execute __stmt_c_ ; -my_col -11.3 -execute __stmt_c_ ; -my_col -11.3 -execute __stmt_c_ ; -my_col -11.3 -select ROUND(@var_1 ,@var_2) as my_col ; -my_col -11.3 -execute __stmt_uv_ ; -my_col -11.3 -execute __stmt_uv_ ; -my_col -11.3 -execute __stmt_uv_ ; -my_col -11.3 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -11.3 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -11.3 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -11.3 -set @string_2= '1.9' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(11.298,1.9) as my_col ; -my_col -11.30 -execute __stmt_c_ ; -my_col -11.30 -execute __stmt_c_ ; -my_col -11.30 -execute __stmt_c_ ; -my_col -11.30 -select ROUND(@var_1 ,@var_2) as my_col ; -my_col -11.3 -execute __stmt_uv_ ; -my_col -11.3 -execute __stmt_uv_ ; -my_col -11.3 -execute __stmt_uv_ ; -my_col -11.3 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -11.30 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -11.30 -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -11.30 -set @string_2= 'NULL' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(11.298,NULL) as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select ROUND(@var_1 ,@var_2) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -set @type_2= 'LONGBLOB' ; -set @string_2= 'NULL' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(11.298,NULL) as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select ROUND(@var_1 ,@var_2) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -set @string_1= 'NULL' ; -set @type_1= 'BIGINT' ; -set @type_2= 'BIGINT' ; -set @string_2= '2' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(NULL,2) as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select ROUND(@var_1 ,@var_2) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -set @string_2= '-2' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(NULL,-2) as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select ROUND(@var_1 ,@var_2) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -set @string_2= 'NULL' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(NULL,NULL) as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select ROUND(@var_1 ,@var_2) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -set @type_2= 'DOUBLE' ; -set @string_2= '2.0' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(NULL,2.0) as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select ROUND(@var_1 ,@var_2) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -set @string_2= '-2.0' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(NULL,-2.0) as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select ROUND(@var_1 ,@var_2) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -set @string_2= 'NULL' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(NULL,NULL) as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select ROUND(@var_1 ,@var_2) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -set @type_2= 'LONGBLOB' ; -set @string_2= 'NULL' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(NULL,NULL) as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select ROUND(@var_1 ,@var_2) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -set @string_1= 'NULL' ; -set @type_1= 'DOUBLE' ; -set @type_2= 'BIGINT' ; -set @string_2= '2' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(NULL,2) as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select ROUND(@var_1 ,@var_2) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -set @string_2= '-2' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(NULL,-2) as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select ROUND(@var_1 ,@var_2) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -set @string_2= 'NULL' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(NULL,NULL) as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select ROUND(@var_1 ,@var_2) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -set @type_2= 'DOUBLE' ; -set @string_2= '2.0' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(NULL,2.0) as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select ROUND(@var_1 ,@var_2) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -set @string_2= '-2.0' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(NULL,-2.0) as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select ROUND(@var_1 ,@var_2) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -set @string_2= 'NULL' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(NULL,NULL) as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select ROUND(@var_1 ,@var_2) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -set @type_2= 'LONGBLOB' ; -set @string_2= 'NULL' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(NULL,NULL) as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select ROUND(@var_1 ,@var_2) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -set @string_1= 'NULL' ; -set @type_1= 'LONGBLOB' ; -set @type_2= 'BIGINT' ; -set @string_2= '2' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(NULL,2) as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select ROUND(@var_1 ,@var_2) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -set @string_2= '-2' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(NULL,-2) as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select ROUND(@var_1 ,@var_2) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -set @string_2= 'NULL' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(NULL,NULL) as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select ROUND(@var_1 ,@var_2) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -set @type_2= 'DOUBLE' ; -set @string_2= '2.0' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(NULL,2.0) as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select ROUND(@var_1 ,@var_2) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -set @string_2= '-2.0' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(NULL,-2.0) as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select ROUND(@var_1 ,@var_2) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -set @string_2= 'NULL' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(NULL,NULL) as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select ROUND(@var_1 ,@var_2) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -set @type_2= 'LONGBLOB' ; -set @string_2= 'NULL' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(NULL,NULL) as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select ROUND(@var_1 ,@var_2) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2 ; -my_col -NULL -set @stmt_part_1= 'select ROUND(' ; -set @stmt_part_2= ') as my_col' ; -set @max_var_number= 1; -set @string_1= '11' ; -set @type_1= 'BIGINT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(11) as my_col ; -my_col -11 -execute __stmt_c_ ; -my_col -11 -execute __stmt_c_ ; -my_col -11 -execute __stmt_c_ ; -my_col -11 -select ROUND(@var_1 ) as my_col ; -my_col -11 -execute __stmt_uv_ ; -my_col -11 -execute __stmt_uv_ ; -my_col -11 -execute __stmt_uv_ ; -my_col -11 -execute __stmt_ph_ using @var_1 ; -my_col -11 -execute __stmt_ph_ using @var_1 ; -my_col -11 -execute __stmt_ph_ using @var_1 ; -my_col -11 -set @string_1= '-11' ; -set @type_1= 'BIGINT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(-11) as my_col ; -my_col --11 -execute __stmt_c_ ; -my_col --11 -execute __stmt_c_ ; -my_col --11 -execute __stmt_c_ ; -my_col --11 -select ROUND(@var_1 ) as my_col ; -my_col --11 -execute __stmt_uv_ ; -my_col --11 -execute __stmt_uv_ ; -my_col --11 -execute __stmt_uv_ ; -my_col --11 -execute __stmt_ph_ using @var_1 ; -my_col --11 -execute __stmt_ph_ using @var_1 ; -my_col --11 -execute __stmt_ph_ using @var_1 ; -my_col --11 -set @string_1= '0' ; -set @type_1= 'BIGINT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(0) as my_col ; -my_col -0 -execute __stmt_c_ ; -my_col -0 -execute __stmt_c_ ; -my_col -0 -execute __stmt_c_ ; -my_col -0 -select ROUND(@var_1 ) as my_col ; -my_col -0 -execute __stmt_uv_ ; -my_col -0 -execute __stmt_uv_ ; -my_col -0 -execute __stmt_uv_ ; -my_col -0 -execute __stmt_ph_ using @var_1 ; -my_col -0 -execute __stmt_ph_ using @var_1 ; -my_col -0 -execute __stmt_ph_ using @var_1 ; -my_col -0 -set @string_1= 'NULL' ; -set @type_1= 'BIGINT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(NULL) as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select ROUND(@var_1 ) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ; -my_col -NULL -set @string_1= '11.49' ; -set @type_1= 'DOUBLE' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(11.49) as my_col ; -my_col -11 -execute __stmt_c_ ; -my_col -11 -execute __stmt_c_ ; -my_col -11 -execute __stmt_c_ ; -my_col -11 -select ROUND(@var_1 ) as my_col ; -my_col -11 -execute __stmt_uv_ ; -my_col -11 -execute __stmt_uv_ ; -my_col -11 -execute __stmt_uv_ ; -my_col -11 -execute __stmt_ph_ using @var_1 ; -my_col -11 -execute __stmt_ph_ using @var_1 ; -my_col -11 -execute __stmt_ph_ using @var_1 ; -my_col -11 -set @string_1= '10.51' ; -set @type_1= 'DOUBLE' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(10.51) as my_col ; -my_col -11 -execute __stmt_c_ ; -my_col -11 -execute __stmt_c_ ; -my_col -11 -execute __stmt_c_ ; -my_col -11 -select ROUND(@var_1 ) as my_col ; -my_col -11 -execute __stmt_uv_ ; -my_col -11 -execute __stmt_uv_ ; -my_col -11 -execute __stmt_uv_ ; -my_col -11 -execute __stmt_ph_ using @var_1 ; -my_col -11 -execute __stmt_ph_ using @var_1 ; -my_col -11 -execute __stmt_ph_ using @var_1 ; -my_col -11 -set @string_1= '0.0' ; -set @type_1= 'DOUBLE' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(0.0) as my_col ; -my_col -0 -execute __stmt_c_ ; -my_col -0 -execute __stmt_c_ ; -my_col -0 -execute __stmt_c_ ; -my_col -0 -select ROUND(@var_1 ) as my_col ; -my_col -0 -execute __stmt_uv_ ; -my_col -0 -execute __stmt_uv_ ; -my_col -0 -execute __stmt_uv_ ; -my_col -0 -execute __stmt_ph_ using @var_1 ; -my_col -0 -execute __stmt_ph_ using @var_1 ; -my_col -0 -execute __stmt_ph_ using @var_1 ; -my_col -0 -set @string_1= 'NULL' ; -set @type_1= 'DOUBLE' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(NULL) as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select ROUND(@var_1 ) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ; -my_col -NULL -set @string_1= '-11.49' ; -set @type_1= 'DOUBLE' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(-11.49) as my_col ; -my_col --11 -execute __stmt_c_ ; -my_col --11 -execute __stmt_c_ ; -my_col --11 -execute __stmt_c_ ; -my_col --11 -select ROUND(@var_1 ) as my_col ; -my_col --11 -execute __stmt_uv_ ; -my_col --11 -execute __stmt_uv_ ; -my_col --11 -execute __stmt_uv_ ; -my_col --11 -execute __stmt_ph_ using @var_1 ; -my_col --11 -execute __stmt_ph_ using @var_1 ; -my_col --11 -execute __stmt_ph_ using @var_1 ; -my_col --11 -set @string_1= '-10.51' ; -set @type_1= 'DOUBLE' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select ROUND(-10.51) as my_col ; -my_col --11 -execute __stmt_c_ ; -my_col --11 -execute __stmt_c_ ; -my_col --11 -execute __stmt_c_ ; -my_col --11 -select ROUND(@var_1 ) as my_col ; -my_col --11 -execute __stmt_uv_ ; -my_col --11 -execute __stmt_uv_ ; -my_col --11 -execute __stmt_uv_ ; -my_col --11 -execute __stmt_ph_ using @var_1 ; -my_col --11 -execute __stmt_ph_ using @var_1 ; -my_col --11 -execute __stmt_ph_ using @var_1 ; -my_col --11 -set @stmt_part_2= 'select ROUND() as my_col' ; -set @max_var_number= 0; -prepare __stmt_c_ from @__stmt_c_ ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 -select ROUND( ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 -execute __stmt_c_ ; -ERROR HY000: Unknown prepared statement handler (__stmt_c_) given to EXECUTE -execute __stmt_c_ ; -ERROR HY000: Unknown prepared statement handler (__stmt_c_) given to EXECUTE -execute __stmt_c_ ; -ERROR HY000: Unknown prepared statement handler (__stmt_c_) given to EXECUTE - -###### Variations on CONCAT_WS(separator,str1,str2,...) ###### - -set @stmt_part_1= 'select CONCAT_WS(' ; -set @stmt_part_2= ',' ; -set @stmt_part_3= ',' ; -set @stmt_part_4= ') as my_col' ; -set @max_var_number= 3; -set @string_1= 'S' ; -set @type_1= 'LONGTEXT' ; -set @string_2= 'My' ; -set @type_2= 'LONGTEXT' ; -set @string_3= 'QL' ; -set @type_3= 'LONGTEXT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select CONCAT_WS('S','My','QL') as my_col ; -my_col -MySQL -execute __stmt_c_ ; -my_col -MySQL -execute __stmt_c_ ; -my_col -MySQL -execute __stmt_c_ ; -my_col -MySQL -select CONCAT_WS(@var_1 ,@var_2,@var_3) as my_col ; -my_col -MySQL -execute __stmt_uv_ ; -my_col -MySQL -execute __stmt_uv_ ; -my_col -MySQL -execute __stmt_uv_ ; -my_col -MySQL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -MySQL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -MySQL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -MySQL -set @string_1= 'NULL' ; -set @type_1= 'LONGBLOB' ; -set @string_2= 'My' ; -set @type_2= 'LONGTEXT' ; -set @string_3= 'QL' ; -set @type_3= 'LONGTEXT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select CONCAT_WS(NULL,'My','QL') as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select CONCAT_WS(@var_1 ,@var_2,@var_3) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL -set @type_1= 'BIGINT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select CONCAT_WS(NULL,'My','QL') as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select CONCAT_WS(@var_1 ,@var_2,@var_3) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL -set @type_1= 'DOUBLE' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select CONCAT_WS(NULL,'My','QL') as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select CONCAT_WS(@var_1 ,@var_2,@var_3) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL -set @string_1= 'S' ; -set @type_1= 'LONGTEXT' ; -set @string_2= 'NULL' ; -set @type_2= 'LONGBLOB' ; -set @string_3= 'QL' ; -set @type_3= 'LONGTEXT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select CONCAT_WS('S',NULL,'QL') as my_col ; -my_col -QL -execute __stmt_c_ ; -my_col -QL -execute __stmt_c_ ; -my_col -QL -execute __stmt_c_ ; -my_col -QL -select CONCAT_WS(@var_1 ,@var_2,@var_3) as my_col ; -my_col -QL -execute __stmt_uv_ ; -my_col -QL -execute __stmt_uv_ ; -my_col -QL -execute __stmt_uv_ ; -my_col -QL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -QL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -QL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -QL -set @type_2= 'BIGINT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select CONCAT_WS('S',NULL,'QL') as my_col ; -my_col -QL -execute __stmt_c_ ; -my_col -QL -execute __stmt_c_ ; -my_col -QL -execute __stmt_c_ ; -my_col -QL -select CONCAT_WS(@var_1 ,@var_2,@var_3) as my_col ; -my_col -QL -execute __stmt_uv_ ; -my_col -QL -execute __stmt_uv_ ; -my_col -QL -execute __stmt_uv_ ; -my_col -QL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -QL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -QL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -QL -set @type_2= 'DOUBLE' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select CONCAT_WS('S',NULL,'QL') as my_col ; -my_col -QL -execute __stmt_c_ ; -my_col -QL -execute __stmt_c_ ; -my_col -QL -execute __stmt_c_ ; -my_col -QL -select CONCAT_WS(@var_1 ,@var_2,@var_3) as my_col ; -my_col -QL -execute __stmt_uv_ ; -my_col -QL -execute __stmt_uv_ ; -my_col -QL -execute __stmt_uv_ ; -my_col -QL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -QL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -QL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -QL -set @string_1= 'S' ; -set @type_1= 'LONGTEXT' ; -set @string_2= 'My' ; -set @type_2= 'LONGTEXT' ; -set @string_3= 'NULL' ; -set @type_3= 'LONGTEXT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select CONCAT_WS('S','My',NULL) as my_col ; -my_col -My -execute __stmt_c_ ; -my_col -My -execute __stmt_c_ ; -my_col -My -execute __stmt_c_ ; -my_col -My -select CONCAT_WS(@var_1 ,@var_2,@var_3) as my_col ; -my_col -My -execute __stmt_uv_ ; -my_col -My -execute __stmt_uv_ ; -my_col -My -execute __stmt_uv_ ; -my_col -My -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -My -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -My -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -My -set @type_3= 'BIGINT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select CONCAT_WS('S','My',NULL) as my_col ; -my_col -My -execute __stmt_c_ ; -my_col -My -execute __stmt_c_ ; -my_col -My -execute __stmt_c_ ; -my_col -My -select CONCAT_WS(@var_1 ,@var_2,@var_3) as my_col ; -my_col -My -execute __stmt_uv_ ; -my_col -My -execute __stmt_uv_ ; -my_col -My -execute __stmt_uv_ ; -my_col -My -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -My -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -My -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -My -set @type_3= 'DOUBLE' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select CONCAT_WS('S','My',NULL) as my_col ; -my_col -My -execute __stmt_c_ ; -my_col -My -execute __stmt_c_ ; -my_col -My -execute __stmt_c_ ; -my_col -My -select CONCAT_WS(@var_1 ,@var_2,@var_3) as my_col ; -my_col -My -execute __stmt_uv_ ; -my_col -My -execute __stmt_uv_ ; -my_col -My -execute __stmt_uv_ ; -my_col -My -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -My -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -My -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -My -set @stmt_part_1= "select CONCAT_WS('S',IF(" ; -set @stmt_part_2= ' IS NULL, ' ; -set @stmt_part_3= ' , ' ; -set @stmt_part_4= "),'QL') as my_col" ; -set @max_var_number= 3; -set @string_1= 'My' ; -set @type_1= 'LONGTEXT' ; -set @string_2= 'X' ; -set @type_2= 'LONGTEXT' ; -set @string_3= 'My' ; -set @type_3= 'LONGTEXT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select CONCAT_WS('S',IF('My' IS NULL, 'X' , 'My'),'QL') as my_col ; -my_col -MySQL -execute __stmt_c_ ; -my_col -MySQL -execute __stmt_c_ ; -my_col -MySQL -execute __stmt_c_ ; -my_col -MySQL -select CONCAT_WS('S',IF(@var_1 IS NULL, @var_2 , @var_3),'QL') as my_col ; -my_col -MySQL -execute __stmt_uv_ ; -my_col -MySQL -execute __stmt_uv_ ; -my_col -MySQL -execute __stmt_uv_ ; -my_col -MySQL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -MySQL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -MySQL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -MySQL -set @string_1= 'NULL' ; -set @type_1= 'LONGBLOB' ; -set @string_2= 'X' ; -set @type_2= 'LONGTEXT' ; -set @string_3= 'My' ; -set @type_3= 'LONGTEXT' ; - -###### Variations on CHAR(N,...) ###### - -set @stmt_part_1= 'select CHAR(' ; -set @stmt_part_2= ',' ; -set @stmt_part_3= ',' ; -set @stmt_part_4= ',' ; -set @stmt_part_5= ',' ; -set @stmt_part_6= ') as my_col' ; -set @max_var_number= 5; -set @string_1= '77' ; -set @type_1= 'BIGINT' ; -set @string_2= '121' ; -set @type_2= 'BIGINT' ; -set @string_3= '83' ; -set @type_3= 'BIGINT' ; -set @string_4= '81' ; -set @type_4= 'BIGINT' ; -set @string_5= '76' ; -set @type_5= 'BIGINT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select CHAR(77,121,83,81,76) as my_col ; -my_col -MySQL -execute __stmt_c_ ; -my_col -MySQL -execute __stmt_c_ ; -my_col -MySQL -execute __stmt_c_ ; -my_col -MySQL -select CHAR(@var_1 ,@var_2,@var_3,@var_4,@var_5) as my_col ; -my_col -MySQL -execute __stmt_uv_ ; -my_col -MySQL -execute __stmt_uv_ ; -my_col -MySQL -execute __stmt_uv_ ; -my_col -MySQL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4,@var_5 ; -my_col -MySQL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4,@var_5 ; -my_col -MySQL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4,@var_5 ; -my_col -MySQL -set @string_1= 'NULL' ; -set @type_1= 'BIGINT' ; -set @string_1= '77' ; -set @type_1= 'BIGINT' ; -set @string_2= '121' ; -set @type_2= 'BIGINT' ; -set @string_3= 'NULL' ; -set @type_3= 'BIGINT' ; -set @string_4= '81' ; -set @type_4= 'BIGINT' ; -set @string_5= '76' ; -set @type_5= 'BIGINT' ; -set @string_1= '77' ; -set @type_1= 'BIGINT' ; -set @string_2= '121' ; -set @type_2= 'BIGINT' ; -set @string_3= 'NULL' ; -set @type_3= 'BIGINT' ; -set @string_4= 'NULL' ; -set @type_4= 'BIGINT' ; -set @string_5= '76' ; -set @type_5= 'BIGINT' ; -set @string_1= '77' ; -set @type_1= 'BIGINT' ; -set @string_2= '121' ; -set @type_2= 'BIGINT' ; -set @string_3= '83' ; -set @type_3= 'BIGINT' ; -set @string_4= '81' ; -set @type_4= 'BIGINT' ; -set @string_5= 'NULL' ; -set @type_5= 'BIGINT' ; -set @string_1= 'NULL' ; -set @type_1= 'LONGBLOB' ; -set @string_2= '121' ; -set @type_2= 'BIGINT' ; -set @string_3= '83' ; -set @type_3= 'BIGINT' ; -set @string_4= '81' ; -set @type_4= 'BIGINT' ; -set @string_5= '76' ; -set @type_5= 'BIGINT' ; - -###### Variations on CHAR_LENGTH ###### - -set @stmt_part_1= 'select CHAR_LENGTH(' ; -set @stmt_part_2= ') as my_col' ; -set @max_var_number= 1; -set @string_1= 'MySQL' ; -set @type_1= 'LONGTEXT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select CHAR_LENGTH('MySQL') as my_col ; -my_col -5 -execute __stmt_c_ ; -my_col -5 -execute __stmt_c_ ; -my_col -5 -execute __stmt_c_ ; -my_col -5 -select CHAR_LENGTH(@var_1 ) as my_col ; -my_col -5 -execute __stmt_uv_ ; -my_col -5 -execute __stmt_uv_ ; -my_col -5 -execute __stmt_uv_ ; -my_col -5 -execute __stmt_ph_ using @var_1 ; -my_col -5 -execute __stmt_ph_ using @var_1 ; -my_col -5 -execute __stmt_ph_ using @var_1 ; -my_col -5 -set @string_1= 'NULL' ; -set @type_1= 'LONGTEXT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select CHAR_LENGTH(NULL) as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select CHAR_LENGTH(@var_1 ) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ; -my_col -NULL -set @type_1= 'BIGINT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select CHAR_LENGTH(NULL) as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select CHAR_LENGTH(@var_1 ) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ; -my_col -NULL -set @type_1= 'DOUBLE' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select CHAR_LENGTH(NULL) as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select CHAR_LENGTH(@var_1 ) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ; -my_col -NULL - -###### Variations on FIELD(str,str1,str2,str3,...) ###### - -set @stmt_part_1= 'select FIELD(' ; -set @stmt_part_2= ',' ; -set @stmt_part_3= ',' ; -set @stmt_part_4= ',' ; -set @stmt_part_5= ') as my_col' ; -set @max_var_number= 4; -set @string_1= 'Hit' ; -set @type_1= 'LONGTEXT' ; -set @string_2= '1it' ; -set @type_2= 'LONGTEXT' ; -set @string_3= 'Hit' ; -set @type_3= 'LONGTEXT' ; -set @string_4= '3it' ; -set @type_4= 'LONGTEXT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select FIELD('Hit','1it','Hit','3it') as my_col ; -my_col -2 -execute __stmt_c_ ; -my_col -2 -execute __stmt_c_ ; -my_col -2 -execute __stmt_c_ ; -my_col -2 -select FIELD(@var_1 ,@var_2,@var_3,@var_4) as my_col ; -my_col -2 -execute __stmt_uv_ ; -my_col -2 -execute __stmt_uv_ ; -my_col -2 -execute __stmt_uv_ ; -my_col -2 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -2 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -2 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -2 -set @string_1= 'NULL' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select FIELD(NULL,'1it','Hit','3it') as my_col ; -my_col -0 -execute __stmt_c_ ; -my_col -0 -execute __stmt_c_ ; -my_col -0 -execute __stmt_c_ ; -my_col -0 -select FIELD(@var_1 ,@var_2,@var_3,@var_4) as my_col ; -my_col -0 -execute __stmt_uv_ ; -my_col -0 -execute __stmt_uv_ ; -my_col -0 -execute __stmt_uv_ ; -my_col -0 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -0 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -0 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -0 -set @string_3= 'NULL' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select FIELD(NULL,'1it',NULL,'3it') as my_col ; -my_col -0 -execute __stmt_c_ ; -my_col -0 -execute __stmt_c_ ; -my_col -0 -execute __stmt_c_ ; -my_col -0 -select FIELD(@var_1 ,@var_2,@var_3,@var_4) as my_col ; -my_col -0 -execute __stmt_uv_ ; -my_col -0 -execute __stmt_uv_ ; -my_col -0 -execute __stmt_uv_ ; -my_col -0 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -0 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -0 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -0 - -###### Variations on INSERT(str,pos,len,newstr) ###### - -set @stmt_part_1= "select INSERT(" ; -set @stmt_part_2= ',' ; -set @stmt_part_3= ',' ; -set @stmt_part_4= ',' ; -set @stmt_part_5= ") as my_col" ; -set @max_var_number= 4; -set @string_1= 'ABCDEFGHI' ; -set @type_1= 'LONGTEXT' ; -set @string_2= '3' ; -set @type_2= 'BIGINT' ; -set @string_3= '4' ; -set @type_3= 'BIGINT' ; -set @string_4= '1234' ; -set @type_4= 'LONGTEXT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select INSERT('ABCDEFGHI',3,4,'1234') as my_col ; -my_col -AB1234GHI -execute __stmt_c_ ; -my_col -AB1234GHI -execute __stmt_c_ ; -my_col -AB1234GHI -execute __stmt_c_ ; -my_col -AB1234GHI -select INSERT(@var_1 ,@var_2,@var_3,@var_4) as my_col ; -my_col -AB1234GHI -execute __stmt_uv_ ; -my_col -AB1234GHI -execute __stmt_uv_ ; -my_col -AB1234GHI -execute __stmt_uv_ ; -my_col -AB1234GHI -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -AB1234GHI -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -AB1234GHI -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -AB1234GHI -set @string_2= '+30.0E-1' ; -set @type_2= 'DOUBLE' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select INSERT('ABCDEFGHI',+30.0E-1,4,'1234') as my_col ; -my_col -AB1234GHI -execute __stmt_c_ ; -my_col -AB1234GHI -execute __stmt_c_ ; -my_col -AB1234GHI -execute __stmt_c_ ; -my_col -AB1234GHI -select INSERT(@var_1 ,@var_2,@var_3,@var_4) as my_col ; -my_col -AB1234GHI -execute __stmt_uv_ ; -my_col -AB1234GHI -execute __stmt_uv_ ; -my_col -AB1234GHI -execute __stmt_uv_ ; -my_col -AB1234GHI -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -AB1234GHI -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -AB1234GHI -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -AB1234GHI -set @string_2= '3' ; -set @type_2= 'BIGINT' ; -set @string_3= '+40.0E-1' ; -set @type_3= 'DOUBLE' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select INSERT('ABCDEFGHI',3,+40.0E-1,'1234') as my_col ; -my_col -AB1234GHI -execute __stmt_c_ ; -my_col -AB1234GHI -execute __stmt_c_ ; -my_col -AB1234GHI -execute __stmt_c_ ; -my_col -AB1234GHI -select INSERT(@var_1 ,@var_2,@var_3,@var_4) as my_col ; -my_col -AB1234GHI -execute __stmt_uv_ ; -my_col -AB1234GHI -execute __stmt_uv_ ; -my_col -AB1234GHI -execute __stmt_uv_ ; -my_col -AB1234GHI -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -AB1234GHI -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -AB1234GHI -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -AB1234GHI -set @string_1= 'NULL' ; -set @type_1= 'LONGTEXT' ; -set @string_2= '3' ; -set @type_2= 'BIGINT' ; -set @string_3= '4' ; -set @type_3= 'BIGINT' ; -set @string_4= '1234' ; -set @type_4= 'LONGTEXT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select INSERT(NULL,3,4,'1234') as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select INSERT(@var_1 ,@var_2,@var_3,@var_4) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -NULL -set @string_1= 'ABCDEFGHI' ; -set @type_1= 'LONGTEXT' ; -set @string_2= 'NULL' ; -set @type_2= 'BIGINT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select INSERT('ABCDEFGHI',NULL,4,'1234') as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select INSERT(@var_1 ,@var_2,@var_3,@var_4) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -NULL -set @string_2= '3' ; -set @type_2= 'BIGINT' ; -set @string_3= 'NULL' ; -set @type_3= 'BIGINT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select INSERT('ABCDEFGHI',3,NULL,'1234') as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select INSERT(@var_1 ,@var_2,@var_3,@var_4) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -NULL -set @string_3= '4' ; -set @type_3= 'BIGINT' ; -set @string_4= 'NULL' ; -set @type_4= 'LONGTEXT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select INSERT('ABCDEFGHI',3,4,NULL) as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select INSERT(@var_1 ,@var_2,@var_3,@var_4) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -NULL -set @string_1= 'ABCDEFGHI' ; -set @type_1= 'LONGTEXT' ; -set @string_2= '3' ; -set @type_2= 'BIGINT' ; -set @string_3= '4' ; -set @type_3= 'BIGINT' ; -set @string_4= '1234' ; -set @type_4= 'LONGTEXT' ; -set @string_2= '15' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select INSERT('ABCDEFGHI',15,4,'1234') as my_col ; -my_col -ABCDEFGHI -execute __stmt_c_ ; -my_col -ABCDEFGHI -execute __stmt_c_ ; -my_col -ABCDEFGHI -execute __stmt_c_ ; -my_col -ABCDEFGHI -select INSERT(@var_1 ,@var_2,@var_3,@var_4) as my_col ; -my_col -ABCDEFGHI -execute __stmt_uv_ ; -my_col -ABCDEFGHI -execute __stmt_uv_ ; -my_col -ABCDEFGHI -execute __stmt_uv_ ; -my_col -ABCDEFGHI -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -ABCDEFGHI -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -ABCDEFGHI -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -ABCDEFGHI -set @string_2= '0' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select INSERT('ABCDEFGHI',0,4,'1234') as my_col ; -my_col -ABCDEFGHI -execute __stmt_c_ ; -my_col -ABCDEFGHI -execute __stmt_c_ ; -my_col -ABCDEFGHI -execute __stmt_c_ ; -my_col -ABCDEFGHI -select INSERT(@var_1 ,@var_2,@var_3,@var_4) as my_col ; -my_col -ABCDEFGHI -execute __stmt_uv_ ; -my_col -ABCDEFGHI -execute __stmt_uv_ ; -my_col -ABCDEFGHI -execute __stmt_uv_ ; -my_col -ABCDEFGHI -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -ABCDEFGHI -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -ABCDEFGHI -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -ABCDEFGHI -set @string_2= '-1' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select INSERT('ABCDEFGHI',-1,4,'1234') as my_col ; -my_col -ABCDEFGHI -execute __stmt_c_ ; -my_col -ABCDEFGHI -execute __stmt_c_ ; -my_col -ABCDEFGHI -execute __stmt_c_ ; -my_col -ABCDEFGHI -select INSERT(@var_1 ,@var_2,@var_3,@var_4) as my_col ; -my_col -ABCDEFGHI -execute __stmt_uv_ ; -my_col -ABCDEFGHI -execute __stmt_uv_ ; -my_col -ABCDEFGHI -execute __stmt_uv_ ; -my_col -ABCDEFGHI -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -ABCDEFGHI -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -ABCDEFGHI -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -ABCDEFGHI -set @string_1= 'ABCDEFGHI' ; -set @type_1= 'LONGTEXT' ; -set @string_2= '3' ; -set @type_2= 'BIGINT' ; -set @string_3= '4' ; -set @type_3= 'BIGINT' ; -set @string_4= '1234' ; -set @type_4= 'LONGTEXT' ; -set @string_3= '10' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select INSERT('ABCDEFGHI',3,10,'1234') as my_col ; -my_col -AB1234 -execute __stmt_c_ ; -my_col -AB1234 -execute __stmt_c_ ; -my_col -AB1234 -execute __stmt_c_ ; -my_col -AB1234 -select INSERT(@var_1 ,@var_2,@var_3,@var_4) as my_col ; -my_col -AB1234 -execute __stmt_uv_ ; -my_col -AB1234 -execute __stmt_uv_ ; -my_col -AB1234 -execute __stmt_uv_ ; -my_col -AB1234 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -AB1234 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -AB1234 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -AB1234 -set @string_3= '5' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select INSERT('ABCDEFGHI',3,5,'1234') as my_col ; -my_col -AB1234HI -execute __stmt_c_ ; -my_col -AB1234HI -execute __stmt_c_ ; -my_col -AB1234HI -execute __stmt_c_ ; -my_col -AB1234HI -select INSERT(@var_1 ,@var_2,@var_3,@var_4) as my_col ; -my_col -AB1234HI -execute __stmt_uv_ ; -my_col -AB1234HI -execute __stmt_uv_ ; -my_col -AB1234HI -execute __stmt_uv_ ; -my_col -AB1234HI -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -AB1234HI -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -AB1234HI -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -AB1234HI -set @string_3= '0' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select INSERT('ABCDEFGHI',3,0,'1234') as my_col ; -my_col -AB1234CDEFGHI -execute __stmt_c_ ; -my_col -AB1234CDEFGHI -execute __stmt_c_ ; -my_col -AB1234CDEFGHI -execute __stmt_c_ ; -my_col -AB1234CDEFGHI -select INSERT(@var_1 ,@var_2,@var_3,@var_4) as my_col ; -my_col -AB1234CDEFGHI -execute __stmt_uv_ ; -my_col -AB1234CDEFGHI -execute __stmt_uv_ ; -my_col -AB1234CDEFGHI -execute __stmt_uv_ ; -my_col -AB1234CDEFGHI -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -AB1234CDEFGHI -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -AB1234CDEFGHI -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -AB1234CDEFGHI -set @string_3= '-1' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select INSERT('ABCDEFGHI',3,-1,'1234') as my_col ; -my_col -AB1234 -execute __stmt_c_ ; -my_col -AB1234 -execute __stmt_c_ ; -my_col -AB1234 -execute __stmt_c_ ; -my_col -AB1234 -select INSERT(@var_1 ,@var_2,@var_3,@var_4) as my_col ; -my_col -AB1234 -execute __stmt_uv_ ; -my_col -AB1234 -execute __stmt_uv_ ; -my_col -AB1234 -execute __stmt_uv_ ; -my_col -AB1234 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -AB1234 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -AB1234 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4 ; -my_col -AB1234 - -###### Variations on BIN(N) ###### - -set @stmt_part_1= "select BIN(" ; -set @stmt_part_2= ") as my_col" ; -set @max_var_number= 1; -set @string_1= '12' ; -set @type_1= 'BIGINT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select BIN(12) as my_col ; -my_col -1100 -execute __stmt_c_ ; -my_col -1100 -execute __stmt_c_ ; -my_col -1100 -execute __stmt_c_ ; -my_col -1100 -select BIN(@var_1 ) as my_col ; -my_col -1100 -execute __stmt_uv_ ; -my_col -1100 -execute __stmt_uv_ ; -my_col -1100 -execute __stmt_uv_ ; -my_col -1100 -execute __stmt_ph_ using @var_1 ; -my_col -1100 -execute __stmt_ph_ using @var_1 ; -my_col -1100 -execute __stmt_ph_ using @var_1 ; -my_col -1100 -set @string_1= 'NULL' ; -set @type_1= 'BIGINT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select BIN(NULL) as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select BIN(@var_1 ) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ; -my_col -NULL -set @string_1= '2147483648' ; -set @type_1= 'BIGINT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select BIN(2147483648) as my_col ; -my_col -10000000000000000000000000000000 -execute __stmt_c_ ; -my_col -10000000000000000000000000000000 -execute __stmt_c_ ; -my_col -10000000000000000000000000000000 -execute __stmt_c_ ; -my_col -10000000000000000000000000000000 -select BIN(@var_1 ) as my_col ; -my_col -10000000000000000000000000000000 -execute __stmt_uv_ ; -my_col -10000000000000000000000000000000 -execute __stmt_uv_ ; -my_col -10000000000000000000000000000000 -execute __stmt_uv_ ; -my_col -10000000000000000000000000000000 -execute __stmt_ph_ using @var_1 ; -my_col -10000000000000000000000000000000 -execute __stmt_ph_ using @var_1 ; -my_col -10000000000000000000000000000000 -execute __stmt_ph_ using @var_1 ; -my_col -10000000000000000000000000000000 -set @string_1= '0' ; -set @type_1= 'BIGINT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select BIN(0) as my_col ; -my_col -0 -execute __stmt_c_ ; -my_col -0 -execute __stmt_c_ ; -my_col -0 -execute __stmt_c_ ; -my_col -0 -select BIN(@var_1 ) as my_col ; -my_col -0 -execute __stmt_uv_ ; -my_col -0 -execute __stmt_uv_ ; -my_col -0 -execute __stmt_uv_ ; -my_col -0 -execute __stmt_ph_ using @var_1 ; -my_col -0 -execute __stmt_ph_ using @var_1 ; -my_col -0 -execute __stmt_ph_ using @var_1 ; -my_col -0 -set @string_1= '-1' ; -set @type_1= 'BIGINT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select BIN(-1) as my_col ; -my_col -1111111111111111111111111111111111111111111111111111111111111111 -execute __stmt_c_ ; -my_col -1111111111111111111111111111111111111111111111111111111111111111 -execute __stmt_c_ ; -my_col -1111111111111111111111111111111111111111111111111111111111111111 -execute __stmt_c_ ; -my_col -1111111111111111111111111111111111111111111111111111111111111111 -select BIN(@var_1 ) as my_col ; -my_col -1111111111111111111111111111111111111111111111111111111111111111 -execute __stmt_uv_ ; -my_col -1111111111111111111111111111111111111111111111111111111111111111 -execute __stmt_uv_ ; -my_col -1111111111111111111111111111111111111111111111111111111111111111 -execute __stmt_uv_ ; -my_col -1111111111111111111111111111111111111111111111111111111111111111 -execute __stmt_ph_ using @var_1 ; -my_col -1111111111111111111111111111111111111111111111111111111111111111 -execute __stmt_ph_ using @var_1 ; -my_col -1111111111111111111111111111111111111111111111111111111111111111 -execute __stmt_ph_ using @var_1 ; -my_col -1111111111111111111111111111111111111111111111111111111111111111 -set @string_1= '9000000000000000000' ; -set @type_1= 'BIGINT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select BIN(9000000000000000000) as my_col ; -my_col -111110011100110011011000101000011100010100001000000000000000000 -execute __stmt_c_ ; -my_col -111110011100110011011000101000011100010100001000000000000000000 -execute __stmt_c_ ; -my_col -111110011100110011011000101000011100010100001000000000000000000 -execute __stmt_c_ ; -my_col -111110011100110011011000101000011100010100001000000000000000000 -select BIN(@var_1 ) as my_col ; -my_col -111110011100110011011000101000011100010100001000000000000000000 -execute __stmt_uv_ ; -my_col -111110011100110011011000101000011100010100001000000000000000000 -execute __stmt_uv_ ; -my_col -111110011100110011011000101000011100010100001000000000000000000 -execute __stmt_uv_ ; -my_col -111110011100110011011000101000011100010100001000000000000000000 -execute __stmt_ph_ using @var_1 ; -my_col -111110011100110011011000101000011100010100001000000000000000000 -execute __stmt_ph_ using @var_1 ; -my_col -111110011100110011011000101000011100010100001000000000000000000 -execute __stmt_ph_ using @var_1 ; -my_col -111110011100110011011000101000011100010100001000000000000000000 -set @string_1= '12.9E-0' ; -set @type_1= 'DOUBLE' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select BIN(12.9E-0) as my_col ; -my_col -1100 -execute __stmt_c_ ; -my_col -1100 -execute __stmt_c_ ; -my_col -1100 -execute __stmt_c_ ; -my_col -1100 -select BIN(@var_1 ) as my_col ; -my_col -1100 -execute __stmt_uv_ ; -my_col -1100 -execute __stmt_uv_ ; -my_col -1100 -execute __stmt_uv_ ; -my_col -1100 -execute __stmt_ph_ using @var_1 ; -my_col -1100 -execute __stmt_ph_ using @var_1 ; -my_col -1100 -execute __stmt_ph_ using @var_1 ; -my_col -1100 -set @string_1= '0.129E+2' ; -set @type_1= 'DOUBLE' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select BIN(0.129E+2) as my_col ; -my_col -1100 -execute __stmt_c_ ; -my_col -1100 -execute __stmt_c_ ; -my_col -1100 -execute __stmt_c_ ; -my_col -1100 -select BIN(@var_1 ) as my_col ; -my_col -1100 -execute __stmt_uv_ ; -my_col -1100 -execute __stmt_uv_ ; -my_col -1100 -execute __stmt_uv_ ; -my_col -1100 -execute __stmt_ph_ using @var_1 ; -my_col -1100 -execute __stmt_ph_ using @var_1 ; -my_col -1100 -execute __stmt_ph_ using @var_1 ; -my_col -1100 - -###### Variations on BIT_LENGT(str) ###### - -set @stmt_part_1= "select BIT_LENGTH(" ; -set @stmt_part_2= ") as my_col" ; -set @max_var_number= 1; -set @string_1= 'text' ; -set @type_1= 'LONGTEXT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select BIT_LENGTH('text') as my_col ; -my_col -32 -execute __stmt_c_ ; -my_col -32 -execute __stmt_c_ ; -my_col -32 -execute __stmt_c_ ; -my_col -32 -select BIT_LENGTH(@var_1 ) as my_col ; -my_col -32 -execute __stmt_uv_ ; -my_col -32 -execute __stmt_uv_ ; -my_col -32 -execute __stmt_uv_ ; -my_col -32 -execute __stmt_ph_ using @var_1 ; -my_col -32 -execute __stmt_ph_ using @var_1 ; -my_col -32 -execute __stmt_ph_ using @var_1 ; -my_col -32 -set @string_1= 'NULL' ; -set @type_1= 'LONGTEXT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select BIT_LENGTH(NULL) as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select BIT_LENGTH(@var_1 ) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ; -my_col -NULL - -###### Variations on CONV(N,from_base,to_base) ###### - -set @stmt_part_1= "select CONV(" ; -set @stmt_part_2= "," ; -set @stmt_part_3= "," ; -set @stmt_part_4= ") as my_col" ; -set @max_var_number= 3; -set @string_1= '37' ; -set @type_1= 'BIGINT' ; -set @string_2= '10' ; -set @type_2= 'BIGINT' ; -set @string_3= '10' ; -set @type_3= 'BIGINT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select CONV(37,10,10) as my_col ; -my_col -37 -execute __stmt_c_ ; -my_col -37 -execute __stmt_c_ ; -my_col -37 -execute __stmt_c_ ; -my_col -37 -select CONV(@var_1 ,@var_2,@var_3) as my_col ; -my_col -37 -execute __stmt_uv_ ; -my_col -37 -execute __stmt_uv_ ; -my_col -37 -execute __stmt_uv_ ; -my_col -37 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -37 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -37 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -37 -set @string_1= '-37' ; -set @type_1= 'BIGINT' ; -set @string_2= '10' ; -set @type_2= 'BIGINT' ; -set @string_3= '10' ; -set @type_3= 'BIGINT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select CONV(-37,10,10) as my_col ; -my_col -18446744073709551579 -execute __stmt_c_ ; -my_col -18446744073709551579 -execute __stmt_c_ ; -my_col -18446744073709551579 -execute __stmt_c_ ; -my_col -18446744073709551579 -select CONV(@var_1 ,@var_2,@var_3) as my_col ; -my_col -18446744073709551579 -execute __stmt_uv_ ; -my_col -18446744073709551579 -execute __stmt_uv_ ; -my_col -18446744073709551579 -execute __stmt_uv_ ; -my_col -18446744073709551579 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -18446744073709551579 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -18446744073709551579 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -18446744073709551579 -set @string_1= CAST(CAST(-37 AS unsigned INTEGER) AS CHAR); -set @type_1= 'LONGTEXT' ; -set @string_2= '10' ; -set @type_2= 'BIGINT' ; -set @string_3= '10' ; -set @type_3= 'BIGINT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select CONV('18446744073709551579',10,10) as my_col ; -my_col -18446744073709551579 -execute __stmt_c_ ; -my_col -18446744073709551579 -execute __stmt_c_ ; -my_col -18446744073709551579 -execute __stmt_c_ ; -my_col -18446744073709551579 -select CONV(@var_1 ,@var_2,@var_3) as my_col ; -my_col -18446744073709551579 -execute __stmt_uv_ ; -my_col -18446744073709551579 -execute __stmt_uv_ ; -my_col -18446744073709551579 -execute __stmt_uv_ ; -my_col -18446744073709551579 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -18446744073709551579 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -18446744073709551579 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -18446744073709551579 -set @string_1= '37' ; -set @type_1= 'BIGINT' ; -set @string_2= '10' ; -set @type_2= 'BIGINT' ; -set @string_3= '-10' ; -set @type_3= 'BIGINT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select CONV(37,10,-10) as my_col ; -my_col -37 -execute __stmt_c_ ; -my_col -37 -execute __stmt_c_ ; -my_col -37 -execute __stmt_c_ ; -my_col -37 -select CONV(@var_1 ,@var_2,@var_3) as my_col ; -my_col -37 -execute __stmt_uv_ ; -my_col -37 -execute __stmt_uv_ ; -my_col -37 -execute __stmt_uv_ ; -my_col -37 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -37 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -37 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -37 -set @string_1= '-37' ; -set @type_1= 'BIGINT' ; -set @string_2= '10' ; -set @type_2= 'BIGINT' ; -set @string_3= '-10' ; -set @type_3= 'BIGINT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select CONV(-37,10,-10) as my_col ; -my_col --37 -execute __stmt_c_ ; -my_col --37 -execute __stmt_c_ ; -my_col --37 -execute __stmt_c_ ; -my_col --37 -select CONV(@var_1 ,@var_2,@var_3) as my_col ; -my_col --37 -execute __stmt_uv_ ; -my_col --37 -execute __stmt_uv_ ; -my_col --37 -execute __stmt_uv_ ; -my_col --37 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col --37 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col --37 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col --37 -set @string_1= '9' ; -set @type_1= 'BIGINT' ; -set @string_2= '10' ; -set @type_2= 'BIGINT' ; -set @string_3= '11' ; -set @type_3= 'BIGINT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select CONV(9,10,11) as my_col ; -my_col -9 -execute __stmt_c_ ; -my_col -9 -execute __stmt_c_ ; -my_col -9 -execute __stmt_c_ ; -my_col -9 -select CONV(@var_1 ,@var_2,@var_3) as my_col ; -my_col -9 -execute __stmt_uv_ ; -my_col -9 -execute __stmt_uv_ ; -my_col -9 -execute __stmt_uv_ ; -my_col -9 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -9 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -9 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -9 -set @string_1= '9' ; -set @type_1= 'BIGINT' ; -set @string_2= '11' ; -set @type_2= 'BIGINT' ; -set @string_3= '10' ; -set @type_3= 'BIGINT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select CONV(9,11,10) as my_col ; -my_col -9 -execute __stmt_c_ ; -my_col -9 -execute __stmt_c_ ; -my_col -9 -execute __stmt_c_ ; -my_col -9 -select CONV(@var_1 ,@var_2,@var_3) as my_col ; -my_col -9 -execute __stmt_uv_ ; -my_col -9 -execute __stmt_uv_ ; -my_col -9 -execute __stmt_uv_ ; -my_col -9 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -9 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -9 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -9 -set @string_1= '10' ; -set @type_1= 'BIGINT' ; -set @string_2= '10' ; -set @type_2= 'BIGINT' ; -set @string_3= '11' ; -set @type_3= 'BIGINT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select CONV(10,10,11) as my_col ; -my_col -A -execute __stmt_c_ ; -my_col -A -execute __stmt_c_ ; -my_col -A -execute __stmt_c_ ; -my_col -A -select CONV(@var_1 ,@var_2,@var_3) as my_col ; -my_col -A -execute __stmt_uv_ ; -my_col -A -execute __stmt_uv_ ; -my_col -A -execute __stmt_uv_ ; -my_col -A -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -A -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -A -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -A -set @string_1= 'A' ; -set @type_1= 'LONGTEXT' ; -set @string_2= '11' ; -set @type_2= 'BIGINT' ; -set @string_3= '10' ; -set @type_3= 'BIGINT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select CONV('A',11,10) as my_col ; -my_col -10 -execute __stmt_c_ ; -my_col -10 -execute __stmt_c_ ; -my_col -10 -execute __stmt_c_ ; -my_col -10 -select CONV(@var_1 ,@var_2,@var_3) as my_col ; -my_col -10 -execute __stmt_uv_ ; -my_col -10 -execute __stmt_uv_ ; -my_col -10 -execute __stmt_uv_ ; -my_col -10 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -10 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -10 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -10 -set @string_1= '11' ; -set @type_1= 'BIGINT' ; -set @string_2= '10' ; -set @type_2= 'BIGINT' ; -set @string_3= '11' ; -set @type_3= 'BIGINT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select CONV(11,10,11) as my_col ; -my_col -10 -execute __stmt_c_ ; -my_col -10 -execute __stmt_c_ ; -my_col -10 -execute __stmt_c_ ; -my_col -10 -select CONV(@var_1 ,@var_2,@var_3) as my_col ; -my_col -10 -execute __stmt_uv_ ; -my_col -10 -execute __stmt_uv_ ; -my_col -10 -execute __stmt_uv_ ; -my_col -10 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -10 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -10 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -10 -set @string_1= '10' ; -set @type_1= 'BIGINT' ; -set @string_2= '11' ; -set @type_2= 'BIGINT' ; -set @string_3= '10' ; -set @type_3= 'BIGINT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select CONV(10,11,10) as my_col ; -my_col -11 -execute __stmt_c_ ; -my_col -11 -execute __stmt_c_ ; -my_col -11 -execute __stmt_c_ ; -my_col -11 -select CONV(@var_1 ,@var_2,@var_3) as my_col ; -my_col -11 -execute __stmt_uv_ ; -my_col -11 -execute __stmt_uv_ ; -my_col -11 -execute __stmt_uv_ ; -my_col -11 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -11 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -11 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -11 -set @string_1= '37' ; -set @type_1= 'BIGINT' ; -set @string_2= '10' ; -set @type_2= 'BIGINT' ; -set @string_3= '36' ; -set @type_3= 'BIGINT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select CONV(37,10,36) as my_col ; -my_col -11 -execute __stmt_c_ ; -my_col -11 -execute __stmt_c_ ; -my_col -11 -execute __stmt_c_ ; -my_col -11 -select CONV(@var_1 ,@var_2,@var_3) as my_col ; -my_col -11 -execute __stmt_uv_ ; -my_col -11 -execute __stmt_uv_ ; -my_col -11 -execute __stmt_uv_ ; -my_col -11 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -11 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -11 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -11 -set @string_1= '11' ; -set @type_1= 'BIGINT' ; -set @string_2= '36' ; -set @type_2= 'BIGINT' ; -set @string_3= '10' ; -set @type_3= 'BIGINT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select CONV(11,36,10) as my_col ; -my_col -37 -execute __stmt_c_ ; -my_col -37 -execute __stmt_c_ ; -my_col -37 -execute __stmt_c_ ; -my_col -37 -select CONV(@var_1 ,@var_2,@var_3) as my_col ; -my_col -37 -execute __stmt_uv_ ; -my_col -37 -execute __stmt_uv_ ; -my_col -37 -execute __stmt_uv_ ; -my_col -37 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -37 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -37 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -37 -set @string_1= 'NULL' ; -set @type_1= 'BIGINT' ; -set @string_2= '10' ; -set @type_2= 'BIGINT' ; -set @string_3= '10' ; -set @type_3= 'BIGINT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select CONV(NULL,10,10) as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select CONV(@var_1 ,@var_2,@var_3) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL -set @string_1= '37' ; -set @string_2= 'NULL' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select CONV(37,NULL,10) as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select CONV(@var_1 ,@var_2,@var_3) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL -set @string_2= '10' ; -set @string_3= 'NULL' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select CONV(37,10,NULL) as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select CONV(@var_1 ,@var_2,@var_3) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL -set @string_3= '10' ; -set @string_1= '9' ; -set @type_1= 'BIGINT' ; -set @string_2= '37' ; -set @type_2= 'BIGINT' ; -set @string_3= '10' ; -set @type_3= 'BIGINT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select CONV(9,37,10) as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select CONV(@var_1 ,@var_2,@var_3) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL -set @string_1= '9' ; -set @type_1= 'BIGINT' ; -set @string_2= '1' ; -set @type_2= 'BIGINT' ; -set @string_3= '10' ; -set @type_3= 'BIGINT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select CONV(9,1,10) as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select CONV(@var_1 ,@var_2,@var_3) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL -set @string_1= '9' ; -set @type_1= 'BIGINT' ; -set @string_2= '0' ; -set @type_2= 'BIGINT' ; -set @string_3= '10' ; -set @type_3= 'BIGINT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select CONV(9,0,10) as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select CONV(@var_1 ,@var_2,@var_3) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL -set @string_1= '9' ; -set @type_1= 'BIGINT' ; -set @string_2= '-1' ; -set @type_2= 'BIGINT' ; -set @string_3= '10' ; -set @type_3= 'BIGINT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select CONV(9,-1,10) as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select CONV(@var_1 ,@var_2,@var_3) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL -set @string_1= '9' ; -set @type_1= 'BIGINT' ; -set @string_2= '10' ; -set @type_2= 'BIGINT' ; -set @string_3= '37' ; -set @type_3= 'BIGINT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select CONV(9,10,37) as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select CONV(@var_1 ,@var_2,@var_3) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL -set @string_1= '9' ; -set @type_1= 'BIGINT' ; -set @string_2= '10' ; -set @type_2= 'BIGINT' ; -set @string_3= '1' ; -set @type_3= 'BIGINT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select CONV(9,10,1) as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select CONV(@var_1 ,@var_2,@var_3) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL -set @string_1= '9' ; -set @type_1= 'BIGINT' ; -set @string_2= '0' ; -set @type_2= 'BIGINT' ; -set @string_3= '0' ; -set @type_3= 'BIGINT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select CONV(9,0,0) as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select CONV(@var_1 ,@var_2,@var_3) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL -set @string_1= '9' ; -set @type_1= 'BIGINT' ; -set @string_2= '10' ; -set @type_2= 'BIGINT' ; -set @string_3= '-1' ; -set @type_3= 'BIGINT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select CONV(9,10,-1) as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select CONV(@var_1 ,@var_2,@var_3) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL -set @string_1= '9' ; -set @type_1= 'BIGINT' ; -set @string_2= '10' ; -set @type_2= 'BIGINT' ; -set @string_3= '-37' ; -set @type_3= 'BIGINT' ; -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -select CONV(9,10,-37) as my_col ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -execute __stmt_c_ ; -my_col -NULL -select CONV(@var_1 ,@var_2,@var_3) as my_col ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_uv_ ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3 ; -my_col -NULL diff --git a/mysql-test/r/tool_test.result b/mysql-test/r/tool_test.result deleted file mode 100644 index 7be7645d8eb..00000000000 --- a/mysql-test/r/tool_test.result +++ /dev/null @@ -1,223 +0,0 @@ -use test ; -set @stmt_part_1= 'SELECT 1 as "my_fine_statement"' ; -set @max_var_number= 0; -the content of the statement variable --------------------------------------- -@__stmt_c_ is: SELECT 1 as "my_fine_statement" -prepare __stmt_c_ from @__stmt_c_ ; -SELECT 1 as "my_fine_statement" ; -my_fine_statement -1 -execute __stmt_c_ ; -my_fine_statement -1 -execute __stmt_c_ ; -my_fine_statement -1 -execute __stmt_c_ ; -my_fine_statement -1 -set @stmt_part_1= 'SELECT ' ; -set @stmt_part_2= ' + ' ; -set @stmt_part_3= ' + ' ; -set @stmt_part_4= ' + ' ; -set @stmt_part_5= ' + ' ; -set @stmt_part_6= ' + ' ; -set @stmt_part_7= ' + ' ; -set @stmt_part_8= ' + ' ; -set @stmt_part_9= ' as "my_fine_statement"' ; -set @max_var_number= 8; -set @string_1= '1' ; -set @type_1= 'BIGINT' ; -set @string_2= 'nULL' ; -set @type_2= 'BIGINT' ; -set @string_3= '2.0' ; -set @type_3= 'DOUBLE' ; -set @string_4= 'NuLL' ; -set @type_4= 'DOUBLE' ; -set @string_5= 'TEXT' ; -set @type_5= 'LONGTEXT' ; -set @string_6= 'NUlL' ; -set @type_6= 'LONGTEXT' ; -set @string_7= 'BLOB' ; -set @type_7= 'LONGBLOB' ; -set @string_8= 'NULl' ; -set @type_8= 'LONGBLOB' ; -set @var_1= 'YYYYYYYY' ; -set @var_2= 'YYYYYYYY' ; -set @var_3= 'YYYYYYYY' ; -set @var_4= 'YYYYYYYY' ; -set @var_5= 'YYYYYYYY' ; -set @var_6= 'YYYYYYYY' ; -set @var_7= 'YYYYYYYY' ; -set @var_8= 'YYYYYYYY' ; -the content of the statement variables --------------------------------------- -@__stmt_c_ is: SELECT 1 + NULL + 2.0 + NULL + 'TEXT' + NULL + 'BLOB' + NULL as "my_fine_statement" -@__stmt_uv_ is: SELECT @var_1 + @var_2 + @var_3 + @var_4 + @var_5 + @var_6 + @var_7 + @var_8 as "my_fine_statement" -@__stmt_ph_ is: SELECT ? + ? + ? + ? + ? + ? + ? + ? as "my_fine_statement" -@__execute_stmt_ph is: execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4,@var_5,@var_6,@var_7,@var_8 -the content of the parameter variables --------------------------------------- -type string uservariable -BIGINT 1 1 -type string uservariable -BIGINT nULL NULL -type string uservariable -DOUBLE 2.0 2 -type string uservariable -DOUBLE NuLL NULL -type string uservariable -LONGTEXT TEXT TEXT -type string uservariable -LONGTEXT NUlL NULL -type string uservariable -LONGBLOB BLOB BLOB -type string uservariable -LONGBLOB NULl NULL -@var_1 @var_2 @var_3 @var_4 @var_5 @var_6 @var_7 @var_8 -1 NULL 2 NULL TEXT NULL BLOB NULL -Table Create Table -t9 CREATE TABLE `t9` ( - `@var_1` bigint(20) default NULL, - `@var_2` bigint(20) default NULL, - `@var_3` double default NULL, - `@var_4` double default NULL, - `@var_5` longtext, - `@var_6` longtext, - `@var_7` longblob, - `@var_8` longblob -) ENGINE=MyISAM DEFAULT CHARSET=latin1 -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -SELECT 1 + NULL + 2.0 + NULL + 'TEXT' + NULL + 'BLOB' + NULL as "my_fine_statement" ; -my_fine_statement -NULL -execute __stmt_c_ ; -my_fine_statement -NULL -execute __stmt_c_ ; -my_fine_statement -NULL -execute __stmt_c_ ; -my_fine_statement -NULL -SELECT @var_1 + @var_2 + @var_3 + @var_4 + @var_5 + @var_6 + @var_7 + @var_8 as "my_fine_statement" ; -my_fine_statement -NULL -execute __stmt_uv_ ; -my_fine_statement -NULL -execute __stmt_uv_ ; -my_fine_statement -NULL -execute __stmt_uv_ ; -my_fine_statement -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4,@var_5,@var_6,@var_7,@var_8 ; -my_fine_statement -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4,@var_5,@var_6,@var_7,@var_8 ; -my_fine_statement -NULL -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4,@var_5,@var_6,@var_7,@var_8 ; -my_fine_statement -NULL -set @string_1= '1.0' ; -set @type_1= 'DOUBLE' ; -set @string_2= '3.0' ; -set @type_2= 'DOUBLE' ; -set @string_3= '2' ; -set @type_3= 'BIGINT' ; -set @string_4= '4' ; -set @type_4= 'BIGINT' ; -set @string_5= '5' ; -set @type_5= 'BIGINT' ; -set @string_6= '6' ; -set @type_6= 'DOUBLE' ; -set @string_7= '7' ; -set @type_7= 'DOUBLE' ; -set @string_8= '8' ; -set @type_8= 'DOUBLE' ; -set @var_1= 'YYYYYYYY' ; -set @var_2= 'YYYYYYYY' ; -set @var_3= 'YYYYYYYY' ; -set @var_4= 'YYYYYYYY' ; -set @var_5= 'YYYYYYYY' ; -set @var_6= 'YYYYYYYY' ; -set @var_7= 'YYYYYYYY' ; -set @var_8= 'YYYYYYYY' ; -the content of the statement variables --------------------------------------- -@__stmt_c_ is: SELECT 1.0 + 3.0 + 2 + 4 + 5 + 6 + 7 + 8 as "my_fine_statement" -@__stmt_uv_ is: SELECT @var_1 + @var_2 + @var_3 + @var_4 + @var_5 + @var_6 + @var_7 + @var_8 as "my_fine_statement" -@__stmt_ph_ is: SELECT ? + ? + ? + ? + ? + ? + ? + ? as "my_fine_statement" -@__execute_stmt_ph is: execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4,@var_5,@var_6,@var_7,@var_8 -the content of the parameter variables --------------------------------------- -type string uservariable -DOUBLE 1.0 1 -type string uservariable -DOUBLE 3.0 3 -type string uservariable -BIGINT 2 2 -type string uservariable -BIGINT 4 4 -type string uservariable -BIGINT 5 5 -type string uservariable -DOUBLE 6 6 -type string uservariable -DOUBLE 7 7 -type string uservariable -DOUBLE 8 8 -@var_1 @var_2 @var_3 @var_4 @var_5 @var_6 @var_7 @var_8 -1 3 2 4 5 6 7 8 -Table Create Table -t9 CREATE TABLE `t9` ( - `@var_1` double default NULL, - `@var_2` double default NULL, - `@var_3` bigint(20) default NULL, - `@var_4` bigint(20) default NULL, - `@var_5` bigint(20) default NULL, - `@var_6` double default NULL, - `@var_7` double default NULL, - `@var_8` double default NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 -prepare __stmt_c_ from @__stmt_c_ ; -prepare __stmt_uv_ from @__stmt_uv_ ; -prepare __stmt_ph_ from @__stmt_ph_ ; -SELECT 1.0 + 3.0 + 2 + 4 + 5 + 6 + 7 + 8 as "my_fine_statement" ; -my_fine_statement -36.0 -execute __stmt_c_ ; -my_fine_statement -36.0 -execute __stmt_c_ ; -my_fine_statement -36.0 -execute __stmt_c_ ; -my_fine_statement -36.0 -SELECT @var_1 + @var_2 + @var_3 + @var_4 + @var_5 + @var_6 + @var_7 + @var_8 as "my_fine_statement" ; -my_fine_statement -36 -execute __stmt_uv_ ; -my_fine_statement -36 -execute __stmt_uv_ ; -my_fine_statement -36 -execute __stmt_uv_ ; -my_fine_statement -36 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4,@var_5,@var_6,@var_7,@var_8 ; -my_fine_statement -36 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4,@var_5,@var_6,@var_7,@var_8 ; -my_fine_statement -36 -execute __stmt_ph_ using @var_1 ,@var_2,@var_3,@var_4,@var_5,@var_6,@var_7,@var_8 ; -my_fine_statement -36 diff --git a/mysql-test/t/ps_12func.test b/mysql-test/t/ps_12func.test deleted file mode 100644 index 65abffe946c..00000000000 --- a/mysql-test/t/ps_12func.test +++ /dev/null @@ -1,867 +0,0 @@ -##################### ps_12func.test ##################### -# # -# Prepared Statement tests of functions # -# # -# Non prepared variants are also checked # -# # -# Checked functions: # -# # -# ROUND(X,D) and ROUND(X) # -# CONCAT_WS(separator,str1,str2,...) # -# CHAR(N,...) # -# CHAR_LENGTH(str) # -# FIELD(str,str1,str2,str3,...) # -# INSERT(str,pos,len,newstr) # -# BIN(N) # -# BIT_LENGTH(str) # -# CONV(N,from_base,to_base) # -# # -########################################################## - -use test; - -# "--disable_abort_on_error" is definitely needed, because there are some tests -# which intentional produce statements with wrong syntax and it is not -# possible to put a "--error " just before the execution calls -# within patchwork-test.inc . ---disable_abort_on_error - -##### ROUND(X,D) ---disable_query_log -select concat('###### Variations on ROUND(X,D) ######') as '' -union select ''; ---enable_query_log -set @stmt_part_1= 'select ROUND(' ; -set @stmt_part_2= ',' ; -set @stmt_part_3= ') as my_col' ; -set @max_var_number= 2; - - -#------------------------------------------------------------------ -# first parameter 11.298 (DOUBLE) , ROUND( m.n , p ) m = 2 ; n = 3 -# Variations on parameter2 -#------------------------------------------------------------------ -set @string_1= '11.298' ; -set @type_1= 'DOUBLE' ; -## data type BIGINT, if possible -set @type_2= 'BIGINT' ; -# p < n -set @string_2= '1' ; ---source include/patchwork-check.inc -# p = n -set @string_2= '3' ; ---source include/patchwork-check.inc -# p > n -set @string_2= '4' ; ---source include/patchwork-check.inc -# p = 0 -set @string_2= '0' ; ---source include/patchwork-check.inc -# -p < m -set @string_2= '-1' ; ---source include/patchwork-check.inc -# -p = m -set @string_2= '-2' ; ---source include/patchwork-check.inc -# -p > m -set @string_2= '-3' ; ---source include/patchwork-check.inc -# -p = NULL -set @string_2= 'NULL' ; ---source include/patchwork-check.inc - -## data type DOUBLE, if possible -set @type_2= 'DOUBLE' ; -# p < n -set @string_2= '1.0' ; ---source include/patchwork-check.inc -# p = n -set @string_2= '3.0' ; ---source include/patchwork-check.inc -# p > n -set @string_2= '4.0' ; ---source include/patchwork-check.inc -# p = 0 -set @string_2= '0.0' ; ---source include/patchwork-check.inc -# -p < m -set @string_2= '-1.0' ; ---source include/patchwork-check.inc -# -p = m -set @string_2= '-2.0' ; ---source include/patchwork-check.inc -# -p > m -set @string_2= '-3.0' ; ---source include/patchwork-check.inc -# ugly values -set @string_2= '1.1' ; ---source include/patchwork-check.inc -set @string_2= '1.9' ; ---source include/patchwork-check.inc -# -p = NULL -set @string_2= 'NULL' ; ---source include/patchwork-check.inc - -## data type LONGBLOB, content NULL -set @type_2= 'LONGBLOB' ; -set @string_2= 'NULL' ; ---source include/patchwork-check.inc - - -#------------------------------------------------------------------ -# first parameter data type BIGINT, content NULL -# Variations on parameter2 -#------------------------------------------------------------------ -set @string_1= 'NULL' ; -set @type_1= 'BIGINT' ; - -set @type_2= 'BIGINT' ; -set @string_2= '2' ; ---source include/patchwork-check.inc -set @string_2= '-2' ; ---source include/patchwork-check.inc -set @string_2= 'NULL' ; ---source include/patchwork-check.inc - -set @type_2= 'DOUBLE' ; -set @string_2= '2.0' ; ---source include/patchwork-check.inc -set @string_2= '-2.0' ; ---source include/patchwork-check.inc -set @string_2= 'NULL' ; ---source include/patchwork-check.inc - -set @type_2= 'LONGBLOB' ; -set @string_2= 'NULL' ; ---source include/patchwork-check.inc - - -#------------------------------------------------------------------ -# first parameter data type DOUBLE, content NULL -# Variations on parameter2 -#------------------------------------------------------------------ -set @string_1= 'NULL' ; -set @type_1= 'DOUBLE' ; - -set @type_2= 'BIGINT' ; -set @string_2= '2' ; ---source include/patchwork-check.inc -set @string_2= '-2' ; ---source include/patchwork-check.inc -set @string_2= 'NULL' ; ---source include/patchwork-check.inc - -set @type_2= 'DOUBLE' ; -set @string_2= '2.0' ; ---source include/patchwork-check.inc -set @string_2= '-2.0' ; ---source include/patchwork-check.inc -set @string_2= 'NULL' ; ---source include/patchwork-check.inc - -set @type_2= 'LONGBLOB' ; -set @string_2= 'NULL' ; ---source include/patchwork-check.inc - - -#------------------------------------------------------------------ -# first parameter data type LONGBLOB, content NULL -# Variations on parameter2 -#------------------------------------------------------------------ -set @string_1= 'NULL' ; -set @type_1= 'LONGBLOB' ; - -set @type_2= 'BIGINT' ; -set @string_2= '2' ; ---source include/patchwork-check.inc -set @string_2= '-2' ; ---source include/patchwork-check.inc -set @string_2= 'NULL' ; ---source include/patchwork-check.inc - -set @type_2= 'DOUBLE' ; -set @string_2= '2.0' ; ---source include/patchwork-check.inc -set @string_2= '-2.0' ; ---source include/patchwork-check.inc -set @string_2= 'NULL' ; ---source include/patchwork-check.inc - -set @type_2= 'LONGBLOB' ; -set @string_2= 'NULL' ; ---source include/patchwork-check.inc - -#------------------------------------------------------------------ -# ROUND(D) Returns the argument X, rounded to the nearest integer. -#------------------------------------------------------------------ -set @stmt_part_1= 'select ROUND(' ; -set @stmt_part_2= ') as my_col' ; -set @max_var_number= 1; -## test cases with BIGINT -set @string_1= '11' ; -set @type_1= 'BIGINT' ; ---source include/patchwork-check.inc -set @string_1= '-11' ; -set @type_1= 'BIGINT' ; ---source include/patchwork-check.inc -set @string_1= '0' ; -set @type_1= 'BIGINT' ; ---source include/patchwork-check.inc -set @string_1= 'NULL' ; -set @type_1= 'BIGINT' ; ---source include/patchwork-check.inc -## test cases with BIGINT -set @string_1= '11.49' ; -set @type_1= 'DOUBLE' ; ---source include/patchwork-check.inc -set @string_1= '10.51' ; -set @type_1= 'DOUBLE' ; ---source include/patchwork-check.inc -set @string_1= '0.0' ; -set @type_1= 'DOUBLE' ; ---source include/patchwork-check.inc -set @string_1= 'NULL' ; -set @type_1= 'DOUBLE' ; ---source include/patchwork-check.inc -set @string_1= '-11.49' ; -set @type_1= 'DOUBLE' ; ---source include/patchwork-check.inc -set @string_1= '-10.51' ; -set @type_1= 'DOUBLE' ; ---source include/patchwork-check.inc -## Incomplete statement -set @stmt_part_2= 'select ROUND() as my_col' ; -set @max_var_number= 0; ---source include/patchwork-check.inc - -##### CONCAT_WS(separator,str1,str2,...) -# Example: CONCAT_WS('S','My','QL') ---disable_query_log -select concat('###### Variations on CONCAT_WS(separator,str1,str2,...) ######') -as '' union select ''; ---enable_query_log -set @stmt_part_1= 'select CONCAT_WS(' ; -set @stmt_part_2= ',' ; -set @stmt_part_3= ',' ; -set @stmt_part_4= ') as my_col' ; -set @max_var_number= 3; - -### common case -set @string_1= 'S' ; -set @type_1= 'LONGTEXT' ; -set @string_2= 'My' ; -set @type_2= 'LONGTEXT' ; -set @string_3= 'QL' ; -set @type_3= 'LONGTEXT' ; ---source include/patchwork-check.inc - -#------------------------------------------------------------------ -# NULL at different parameter positions -#------------------------------------------------------------------ -### The separator (first parameter) is NULL. -set @string_1= 'NULL' ; -set @type_1= 'LONGBLOB' ; -set @string_2= 'My' ; -set @type_2= 'LONGTEXT' ; -set @string_3= 'QL' ; -set @type_3= 'LONGTEXT' ; ---source include/patchwork-check.inc -set @type_1= 'BIGINT' ; ---source include/patchwork-check.inc -set @type_1= 'DOUBLE' ; ---source include/patchwork-check.inc - -### The first string (second parameter) is NULL. -set @string_1= 'S' ; -set @type_1= 'LONGTEXT' ; -set @string_2= 'NULL' ; -set @type_2= 'LONGBLOB' ; -set @string_3= 'QL' ; -set @type_3= 'LONGTEXT' ; ---source include/patchwork-check.inc -set @type_2= 'BIGINT' ; ---source include/patchwork-check.inc -set @type_2= 'DOUBLE' ; ---source include/patchwork-check.inc - -### The second string (third parameter) is NULL. -set @string_1= 'S' ; -set @type_1= 'LONGTEXT' ; -set @string_2= 'My' ; -set @type_2= 'LONGTEXT' ; -set @string_3= 'NULL' ; -set @type_3= 'LONGTEXT' ; ---source include/patchwork-check.inc -set @type_3= 'BIGINT' ; ---source include/patchwork-check.inc -set @type_3= 'DOUBLE' ; ---source include/patchwork-check.inc - -#------------------------------------------------------------------ -# some complicated things -#------------------------------------------------------------------ -# select concat_ws('S',IF(parameter1=NULL,parameter2,parameter3),'QL') -set @stmt_part_1= "select CONCAT_WS('S',IF(" ; -set @stmt_part_2= ' IS NULL, ' ; -set @stmt_part_3= ' , ' ; -set @stmt_part_4= "),'QL') as my_col" ; -set @max_var_number= 3; - -# common case -set @string_1= 'My' ; -set @type_1= 'LONGTEXT' ; -set @string_2= 'X' ; -set @type_2= 'LONGTEXT' ; -set @string_3= 'My' ; -set @type_3= 'LONGTEXT' ; ---source include/patchwork-check.inc - -set @string_1= 'NULL' ; -set @type_1= 'LONGBLOB' ; -set @string_2= 'X' ; -set @type_2= 'LONGTEXT' ; -set @string_3= 'My' ; -set @type_3= 'LONGTEXT' ; -# deactivated because of -# Bug#6297 : prepared statement, wrong handling of IS NULL -# let $__debug_= 1; -# --source include/patchwork-check.inc - -##### CHAR(N,...) -# Example(Manual): SELECT CHAR(77,121,83,81,'76'); ---disable_query_log -select concat('###### Variations on CHAR(N,...) ######') as '' -union select ''; ---enable_query_log -set @stmt_part_1= 'select CHAR(' ; -set @stmt_part_2= ',' ; -set @stmt_part_3= ',' ; -set @stmt_part_4= ',' ; -set @stmt_part_5= ',' ; -set @stmt_part_6= ') as my_col' ; -set @max_var_number= 5; - -### common case -set @string_1= '77' ; -set @type_1= 'BIGINT' ; -set @string_2= '121' ; -set @type_2= 'BIGINT' ; -set @string_3= '83' ; -set @type_3= 'BIGINT' ; -set @string_4= '81' ; -set @type_4= 'BIGINT' ; -set @string_5= '76' ; -set @type_5= 'BIGINT' ; ---source include/patchwork-check.inc - -#------------------------------------------------------------------ -# NULL at different parameter positions -#------------------------------------------------------------------ -# Only the first parameter is NULL. -set @string_1= 'NULL' ; -set @type_1= 'BIGINT' ; -##### ugly maybe wrong result -# Bug#6317: string function CHAR, parameter is NULL, wrong result -#--source include/patchwork-check.inc - -## Only one non first/last parameter is NULL. -set @string_1= '77' ; -set @type_1= 'BIGINT' ; -set @string_2= '121' ; -set @type_2= 'BIGINT' ; -set @string_3= 'NULL' ; -set @type_3= 'BIGINT' ; -set @string_4= '81' ; -set @type_4= 'BIGINT' ; -set @string_5= '76' ; -set @type_5= 'BIGINT' ; -# Bug#6317: string function CHAR, parameter is NULL, wrong result -#--source include/patchwork-check.inc - -## Two neighbour parameters in the middle are NULL. -set @string_1= '77' ; -set @type_1= 'BIGINT' ; -set @string_2= '121' ; -set @type_2= 'BIGINT' ; -set @string_3= 'NULL' ; -set @type_3= 'BIGINT' ; -set @string_4= 'NULL' ; -set @type_4= 'BIGINT' ; -set @string_5= '76' ; -set @type_5= 'BIGINT' ; -# Bug#6317: string function CHAR, parameter is NULL, wrong result -#--source include/patchwork-check.inc - -## Only the last parameter is NULL. -set @string_1= '77' ; -set @type_1= 'BIGINT' ; -set @string_2= '121' ; -set @type_2= 'BIGINT' ; -set @string_3= '83' ; -set @type_3= 'BIGINT' ; -set @string_4= '81' ; -set @type_4= 'BIGINT' ; -set @string_5= 'NULL' ; -set @type_5= 'BIGINT' ; -# Bug#6317: string function CHAR, parameter is NULL, wrong result -#--source include/patchwork-check.inc - -## The first parameter is NULL with bad type. -set @string_1= 'NULL' ; -set @type_1= 'LONGBLOB' ; -set @string_2= '121' ; -set @type_2= 'BIGINT' ; -set @string_3= '83' ; -set @type_3= 'BIGINT' ; -set @string_4= '81' ; -set @type_4= 'BIGINT' ; -set @string_5= '76' ; -set @type_5= 'BIGINT' ; -# Bug#6317: string function CHAR, parameter is NULL, wrong result -#--source include/patchwork-check.inc - - -##### CHAR_LENGTH(str) ---disable_query_log -select concat('###### Variations on CHAR_LENGTH ######') as '' -union select ''; ---enable_query_log -set @stmt_part_1= 'select CHAR_LENGTH(' ; -set @stmt_part_2= ') as my_col' ; -set @max_var_number= 1; - -### common case -set @string_1= 'MySQL' ; -set @type_1= 'LONGTEXT' ; ---source include/patchwork-check.inc - -#------------------------------------------------------------------ -# NULL at different parameter positions -#------------------------------------------------------------------ -set @string_1= 'NULL' ; -set @type_1= 'LONGTEXT' ; ---source include/patchwork-check.inc -set @type_1= 'BIGINT' ; ---source include/patchwork-check.inc -set @type_1= 'DOUBLE' ; ---source include/patchwork-check.inc - - -##### FIELD(str,str1,str2,str3,...) ---disable_query_log -select concat('###### Variations on FIELD(str,str1,str2,str3,...) ######') as '' -union select ''; ---enable_query_log -set @stmt_part_1= 'select FIELD(' ; -set @stmt_part_2= ',' ; -set @stmt_part_3= ',' ; -set @stmt_part_4= ',' ; -set @stmt_part_5= ') as my_col' ; -set @max_var_number= 4; - -### common case -set @string_1= 'Hit' ; -set @type_1= 'LONGTEXT' ; -set @string_2= '1it' ; -set @type_2= 'LONGTEXT' ; -set @string_3= 'Hit' ; -set @type_3= 'LONGTEXT' ; -set @string_4= '3it' ; -set @type_4= 'LONGTEXT' ; ---source include/patchwork-check.inc - -#------------------------------------------------------------------ -# NULL at different parameter positions -#------------------------------------------------------------------ -# string to search for is NULL, all other strings not NULL -set @string_1= 'NULL' ; -# Bug#6321: strange error, string function FIELD(, .. ---source include/patchwork-check.inc -# string to search for and one of the other is NULL -set @string_3= 'NULL' ; -# Bug#6321: strange error, string function FIELD(, .. ---source include/patchwork-check.inc - - -##### INSERT(str,pos,len,newstr) -# Manual Example: SELECT INSERT('Quadratic', 3, 4, 'What') -> 'QuWhattic' ---disable_query_log -select concat('###### Variations on INSERT(str,pos,len,newstr) ######') as '' -union select ''; ---enable_query_log -set @stmt_part_1= "select INSERT(" ; -set @stmt_part_2= ',' ; -set @stmt_part_3= ',' ; -set @stmt_part_4= ',' ; -set @stmt_part_5= ") as my_col" ; -set @max_var_number= 4; - -### common case (modified manual example) -set @string_1= 'ABCDEFGHI' ; -set @type_1= 'LONGTEXT' ; -set @string_2= '3' ; -set @type_2= 'BIGINT' ; -set @string_3= '4' ; -set @type_3= 'BIGINT' ; -set @string_4= '1234' ; -set @type_4= 'LONGTEXT' ; ---source include/patchwork-check.inc - -#------------------------------------------------------------------ -# Try DOUBLE instead of BIGINT for pos and len -#------------------------------------------------------------------ -set @string_2= '+30.0E-1' ; -set @type_2= 'DOUBLE' ; ---source include/patchwork-check.inc -set @string_2= '3' ; -set @type_2= 'BIGINT' ; -set @string_3= '+40.0E-1' ; -set @type_3= 'DOUBLE' ; ---source include/patchwork-check.inc - -#------------------------------------------------------------------ -# NULL at different parameter positions -#------------------------------------------------------------------ -set @string_1= 'NULL' ; -set @type_1= 'LONGTEXT' ; -set @string_2= '3' ; -set @type_2= 'BIGINT' ; -set @string_3= '4' ; -set @type_3= 'BIGINT' ; -set @string_4= '1234' ; -set @type_4= 'LONGTEXT' ; ---source include/patchwork-check.inc -set @string_1= 'ABCDEFGHI' ; -set @type_1= 'LONGTEXT' ; -set @string_2= 'NULL' ; -set @type_2= 'BIGINT' ; ---source include/patchwork-check.inc -set @string_2= '3' ; -set @type_2= 'BIGINT' ; -set @string_3= 'NULL' ; -set @type_3= 'BIGINT' ; ---source include/patchwork-check.inc -set @string_3= '4' ; -set @type_3= 'BIGINT' ; -set @string_4= 'NULL' ; -set @type_4= 'LONGTEXT' ; ---source include/patchwork-check.inc - -#------------------------------------------------------------------ -# Variations on the second parameter (start position) -#------------------------------------------------------------------ -set @string_1= 'ABCDEFGHI' ; -set @type_1= 'LONGTEXT' ; -set @string_2= '3' ; -set @type_2= 'BIGINT' ; -set @string_3= '4' ; -set @type_3= 'BIGINT' ; -set @string_4= '1234' ; -set @type_4= 'LONGTEXT' ; -# start position > length of the first string (9) -set @string_2= '15' ; ---source include/patchwork-check.inc -# start position = 0 -set @string_2= '0' ; ---source include/patchwork-check.inc -# start position < 0 -set @string_2= '-1' ; ---source include/patchwork-check.inc - -#------------------------------------------------------------------ -# Variations on the third parameter (# of chars of string one to be replaced) -#------------------------------------------------------------------ -set @string_1= 'ABCDEFGHI' ; -set @type_1= 'LONGTEXT' ; -set @string_2= '3' ; -set @type_2= 'BIGINT' ; -set @string_3= '4' ; -set @type_3= 'BIGINT' ; -set @string_4= '1234' ; -set @type_4= 'LONGTEXT' ; -## chars to be replaced > length of the second string -# start pos (3) + replace length(10) > length of first string(9) -set @string_3= '10' ; ---source include/patchwork-check.inc -# start pos (3) + chars to be replaced (5) < length of first string(9) -set @string_3= '5' ; ---source include/patchwork-check.inc -# chars to be replaced = 0 -set @string_3= '0' ; ---source include/patchwork-check.inc -# chars to be replaced < 0 -set @string_3= '-1' ; ---source include/patchwork-check.inc - - -##### BIN(N) -# manual example: SELECT BIN(12); -> '1100' ---disable_query_log -select concat('###### Variations on BIN(N) ######') as '' -union select ''; ---enable_query_log -set @stmt_part_1= "select BIN(" ; -set @stmt_part_2= ") as my_col" ; -set @max_var_number= 1; - -set @string_1= '12' ; -set @type_1= 'BIGINT' ; ---source include/patchwork-check.inc -#### Variations on the parameter -set @string_1= 'NULL' ; -set @type_1= 'BIGINT' ; ---source include/patchwork-check.inc -set @string_1= '2147483648' ; -set @type_1= 'BIGINT' ; ---source include/patchwork-check.inc -set @string_1= '0' ; -set @type_1= 'BIGINT' ; ---source include/patchwork-check.inc -set @string_1= '-1' ; -set @type_1= 'BIGINT' ; ---source include/patchwork-check.inc -set @string_1= '9000000000000000000' ; -set @type_1= 'BIGINT' ; ---source include/patchwork-check.inc -set @string_1= '12.9E-0' ; -set @type_1= 'DOUBLE' ; ---source include/patchwork-check.inc -set @string_1= '0.129E+2' ; -set @type_1= 'DOUBLE' ; ---source include/patchwork-check.inc - -##### BIT_LENGTH(str) -# Manual example: SELECT BIT_LENGTH('text'); -> 32 ---disable_query_log -select concat('###### Variations on BIT_LENGT(str) ######') as '' -union select ''; ---enable_query_log -set @stmt_part_1= "select BIT_LENGTH(" ; -set @stmt_part_2= ") as my_col" ; -set @max_var_number= 1; - -set @string_1= 'text' ; -set @type_1= 'LONGTEXT' ; ---source include/patchwork-check.inc - -# try NULL -set @string_1= 'NULL' ; -set @type_1= 'LONGTEXT' ; ---source include/patchwork-check.inc - - -##### CONV(N,from_base,to_base) -# Manual example: SELECT CONV(-17,10,-18); -> '-H' ---disable_query_log -select concat('###### Variations on CONV(N,from_base,to_base) ######') as '' -union select ''; ---enable_query_log -set @stmt_part_1= "select CONV(" ; -set @stmt_part_2= "," ; -set @stmt_part_3= "," ; -set @stmt_part_4= ") as my_col" ; -set @max_var_number= 3; - -#------------------------------------------------------------------ -# Manual: If to_base is a negative number, N is regarded as a signed number. -# Otherwise, N is treated as unsigned. -# Experiments with positive/negative number/to_base -#------------------------------------------------------------------ -# number positive written, to_base positive -set @string_1= '37' ; -set @type_1= 'BIGINT' ; -set @string_2= '10' ; -set @type_2= 'BIGINT' ; -set @string_3= '10' ; -set @type_3= 'BIGINT' ; ---source include/patchwork-check.inc -# number negative written, to_base positive -set @string_1= '-37' ; -set @type_1= 'BIGINT' ; -set @string_2= '10' ; -set @type_2= 'BIGINT' ; -set @string_3= '10' ; -set @type_3= 'BIGINT' ; ---source include/patchwork-check.inc -# The last result (unsigned) BIGINT 18446744073709551579 might be surprising. -# The next statements could give an explanation. -set @string_1= CAST(CAST(-37 AS unsigned INTEGER) AS CHAR); -set @type_1= 'LONGTEXT' ; -set @string_2= '10' ; -set @type_2= 'BIGINT' ; -set @string_3= '10' ; -set @type_3= 'BIGINT' ; ---source include/patchwork-check.inc -# number positive written, to_base negative -set @string_1= '37' ; -set @type_1= 'BIGINT' ; -set @string_2= '10' ; -set @type_2= 'BIGINT' ; -set @string_3= '-10' ; -set @type_3= 'BIGINT' ; ---source include/patchwork-check.inc -# number negative written, to_base negative -set @string_1= '-37' ; -set @type_1= 'BIGINT' ; -set @string_2= '10' ; -set @type_2= 'BIGINT' ; -set @string_3= '-10' ; -set @type_3= 'BIGINT' ; ---source include/patchwork-check.inc - -#------------------------------------------------------------------ -# conversions to and from the exotic 11 based number system -#------------------------------------------------------------------ -set @string_1= '9' ; -set @type_1= 'BIGINT' ; -set @string_2= '10' ; -set @type_2= 'BIGINT' ; -set @string_3= '11' ; -set @type_3= 'BIGINT' ; ---source include/patchwork-check.inc -set @string_1= '9' ; -set @type_1= 'BIGINT' ; -set @string_2= '11' ; -set @type_2= 'BIGINT' ; -set @string_3= '10' ; -set @type_3= 'BIGINT' ; ---source include/patchwork-check.inc -set @string_1= '10' ; -set @type_1= 'BIGINT' ; -set @string_2= '10' ; -set @type_2= 'BIGINT' ; -set @string_3= '11' ; -set @type_3= 'BIGINT' ; ---source include/patchwork-check.inc -set @string_1= 'A' ; -set @type_1= 'LONGTEXT' ; -set @string_2= '11' ; -set @type_2= 'BIGINT' ; -set @string_3= '10' ; -set @type_3= 'BIGINT' ; ---source include/patchwork-check.inc -set @string_1= '11' ; -set @type_1= 'BIGINT' ; -set @string_2= '10' ; -set @type_2= 'BIGINT' ; -set @string_3= '11' ; -set @type_3= 'BIGINT' ; ---source include/patchwork-check.inc -set @string_1= '10' ; -set @type_1= 'BIGINT' ; -set @string_2= '11' ; -set @type_2= 'BIGINT' ; -set @string_3= '10' ; -set @type_3= 'BIGINT' ; ---source include/patchwork-check.inc - -#------------------------------------------------------------------ -# Try the maximum base value 36 -#------------------------------------------------------------------ -set @string_1= '37' ; -set @type_1= 'BIGINT' ; -set @string_2= '10' ; -set @type_2= 'BIGINT' ; -set @string_3= '36' ; -set @type_3= 'BIGINT' ; ---source include/patchwork-check.inc -set @string_1= '11' ; -set @type_1= 'BIGINT' ; -set @string_2= '36' ; -set @type_2= 'BIGINT' ; -set @string_3= '10' ; -set @type_3= 'BIGINT' ; ---source include/patchwork-check.inc - -#------------------------------------------------------------------ -# NULL at different parameter positions -#------------------------------------------------------------------ -set @string_1= 'NULL' ; -set @type_1= 'BIGINT' ; -set @string_2= '10' ; -set @type_2= 'BIGINT' ; -set @string_3= '10' ; -set @type_3= 'BIGINT' ; ---source include/patchwork-check.inc -set @string_1= '37' ; -set @string_2= 'NULL' ; ---source include/patchwork-check.inc -set @string_2= '10' ; -set @string_3= 'NULL' ; ---source include/patchwork-check.inc -set @string_3= '10' ; - -#------------------------------------------------------------------ -# The rule for from_base is: 2 <= from_base <= 36 -# Try values outside of this range. -#------------------------------------------------------------------ -set @string_1= '9' ; -set @type_1= 'BIGINT' ; -set @string_2= '37' ; -set @type_2= 'BIGINT' ; -set @string_3= '10' ; -set @type_3= 'BIGINT' ; ---source include/patchwork-check.inc -set @string_1= '9' ; -set @type_1= 'BIGINT' ; -set @string_2= '1' ; -set @type_2= 'BIGINT' ; -set @string_3= '10' ; -set @type_3= 'BIGINT' ; ---source include/patchwork-check.inc -set @string_1= '9' ; -set @type_1= 'BIGINT' ; -set @string_2= '0' ; -set @type_2= 'BIGINT' ; -set @string_3= '10' ; -set @type_3= 'BIGINT' ; ---source include/patchwork-check.inc -set @string_1= '9' ; -set @type_1= 'BIGINT' ; -set @string_2= '-1' ; -set @type_2= 'BIGINT' ; -set @string_3= '10' ; -set @type_3= 'BIGINT' ; ---source include/patchwork-check.inc - -#------------------------------------------------------------------ -# The rule for to_base is: 2<= ABS(to_base) <= 36 -# Try values outside of this range. -#------------------------------------------------------------------ -set @string_1= '9' ; -set @type_1= 'BIGINT' ; -set @string_2= '10' ; -set @type_2= 'BIGINT' ; -set @string_3= '37' ; -set @type_3= 'BIGINT' ; ---source include/patchwork-check.inc -set @string_1= '9' ; -set @type_1= 'BIGINT' ; -set @string_2= '10' ; -set @type_2= 'BIGINT' ; -set @string_3= '1' ; -set @type_3= 'BIGINT' ; ---source include/patchwork-check.inc -set @string_1= '9' ; -set @type_1= 'BIGINT' ; -set @string_2= '0' ; -set @type_2= 'BIGINT' ; -set @string_3= '0' ; -set @type_3= 'BIGINT' ; ---source include/patchwork-check.inc -set @string_1= '9' ; -set @type_1= 'BIGINT' ; -set @string_2= '10' ; -set @type_2= 'BIGINT' ; -set @string_3= '-1' ; -set @type_3= 'BIGINT' ; ---source include/patchwork-check.inc -set @string_1= '9' ; -set @type_1= 'BIGINT' ; -set @string_2= '10' ; -set @type_2= 'BIGINT' ; -set @string_3= '-37' ; -set @type_3= 'BIGINT' ; ---source include/patchwork-check.inc - - diff --git a/mysql-test/t/tool_test.test b/mysql-test/t/tool_test.test deleted file mode 100644 index b28eae2c17d..00000000000 --- a/mysql-test/t/tool_test.test +++ /dev/null @@ -1,105 +0,0 @@ -########################### tool_test.test ############################# -# # -# Test sequences for the check of mysqltest based test tools # -# # -# Checked routines: # -# include/patchwork-check.inc # -# # -######################################################################## - -##### Check of include/patchwork-check.inc -# -use test ; ---disable_abort_on_error - -#----------------------------------------------------------------------- -# Simple test (special case): -# The statement is made of only one piece and does not contain variables. -#----------------------------------------------------------------------- -set @stmt_part_1= 'SELECT 1 as "my_fine_statement"' ; -set @max_var_number= 0; -# switch debug output on (Attention: patchwork-check.inc will switch it off) -let $__debug_= 1; ---source include/patchwork-check.inc - -#----------------------------------------------------------------------- -# Test case with many statement pieces and variables of all in -# include/patchwork-check.inc available data types. -#----------------------------------------------------------------------- -set @stmt_part_1= 'SELECT ' ; -set @stmt_part_2= ' + ' ; -set @stmt_part_3= ' + ' ; -set @stmt_part_4= ' + ' ; -set @stmt_part_5= ' + ' ; -set @stmt_part_6= ' + ' ; -set @stmt_part_7= ' + ' ; -set @stmt_part_8= ' + ' ; -set @stmt_part_9= ' as "my_fine_statement"' ; -set @max_var_number= 8; - -set @string_1= '1' ; -set @type_1= 'BIGINT' ; -set @string_2= 'nULL' ; -set @type_2= 'BIGINT' ; -set @string_3= '2.0' ; -set @type_3= 'DOUBLE' ; -set @string_4= 'NuLL' ; -set @type_4= 'DOUBLE' ; -set @string_5= 'TEXT' ; -set @type_5= 'LONGTEXT' ; -set @string_6= 'NUlL' ; -set @type_6= 'LONGTEXT' ; -set @string_7= 'BLOB' ; -set @type_7= 'LONGBLOB' ; -set @string_8= 'NULl' ; -set @type_8= 'LONGBLOB' ; - -# Initialization of all uservariables to the data type LONGTEXT and content, -# which will not be repeated within the following tests. -# 'include/patchwork-check.inc' MUST destroy all these settings. -# That is why this initialization is NOT needed within test cases -# calling include/patchwork-check.inc . -set @var_1= 'YYYYYYYY' ; -set @var_2= 'YYYYYYYY' ; -set @var_3= 'YYYYYYYY' ; -set @var_4= 'YYYYYYYY' ; -set @var_5= 'YYYYYYYY' ; -set @var_6= 'YYYYYYYY' ; -set @var_7= 'YYYYYYYY' ; -set @var_8= 'YYYYYYYY' ; - -# switch debug output on (Attention: patchwork-check.inc will switch it off) -let $__debug_= 1; ---source include/patchwork-check.inc - -### Execute the statement with more useful content of the variables. -set @string_1= '1.0' ; -set @type_1= 'DOUBLE' ; -set @string_2= '3.0' ; -set @type_2= 'DOUBLE' ; -set @string_3= '2' ; -set @type_3= 'BIGINT' ; -set @string_4= '4' ; -set @type_4= 'BIGINT' ; -set @string_5= '5' ; -set @type_5= 'BIGINT' ; -set @string_6= '6' ; -set @type_6= 'DOUBLE' ; -set @string_7= '7' ; -set @type_7= 'DOUBLE' ; -set @string_8= '8' ; -set @type_8= 'DOUBLE' ; - -# Initialization -set @var_1= 'YYYYYYYY' ; -set @var_2= 'YYYYYYYY' ; -set @var_3= 'YYYYYYYY' ; -set @var_4= 'YYYYYYYY' ; -set @var_5= 'YYYYYYYY' ; -set @var_6= 'YYYYYYYY' ; -set @var_7= 'YYYYYYYY' ; -set @var_8= 'YYYYYYYY' ; - -# switch debug output on (Attention: include/patchwork-check.inc switches it off) -let $__debug_= 1; ---source include/patchwork-check.inc From 7b063137855ed2dd72f661260e9d157c8779b360 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 17 Dec 2004 18:35:11 +0200 Subject: [PATCH 0542/1063] InnoDB: Fixed bugs in the padding and trimming of trailing spaces that affected the UCS2 character set. (Bug #7350) innobase/data/data0type.c: Added dtype_get_charset_coll_noninline() innobase/include/data0type.h: Added dtype_get_charset_coll_noninline() innobase/include/row0mysql.h: Added charset field to mysql_row_templ_struct. innobase/include/row0mysql.ic: row_mysql_store_col_in_innobase_format(): When removing trailing spaces, treat the UCS2 character set properly. innobase/rem/rem0cmp.c: cmp_whole_field(): Do not remove trailing 0x20 bytes, as innobase_mysql_cmp() implicitly pads the strings with trailing spaces as necessary. innobase/row/row0sel.c: row_sel_field_store_in_mysql_format(): Do not pad with 0x20 bytes. row_sel_store_mysql_rec(): Pad VARCHARs with trailing spaces (0x20, or 0x0020 in UCS2). sql/ha_innodb.cc: build_template(): Initialize templ->charset --- innobase/data/data0type.c | 11 ++++++ innobase/include/data0type.h | 7 ++++ innobase/include/row0mysql.h | 2 ++ innobase/include/row0mysql.ic | 31 +++++++++++++--- innobase/rem/rem0cmp.c | 16 --------- innobase/row/row0sel.c | 68 +++++++++++++++++++++++++++++++---- sql/ha_innodb.cc | 2 ++ 7 files changed, 110 insertions(+), 27 deletions(-) diff --git a/innobase/data/data0type.c b/innobase/data/data0type.c index 714cf92bc65..dab14df4240 100644 --- a/innobase/data/data0type.c +++ b/innobase/data/data0type.c @@ -165,6 +165,17 @@ dtype_is_non_binary_string_type( return(FALSE); } +/************************************************************************* +Gets the MySQL charset-collation code for MySQL string types. */ + +ulint +dtype_get_charset_coll_noninline( +/*=============================*/ + ulint prtype) /* in: precise data type */ +{ + return(dtype_get_charset_coll(prtype)); +} + /************************************************************************* Forms a precise type from the < 4.1.2 format precise type plus the charset-collation code. */ diff --git a/innobase/include/data0type.h b/innobase/include/data0type.h index c263d2bf613..02c874836fd 100644 --- a/innobase/include/data0type.h +++ b/innobase/include/data0type.h @@ -234,6 +234,13 @@ dtype_get_prtype( dtype_t* type); /************************************************************************* Gets the MySQL charset-collation code for MySQL string types. */ + +ulint +dtype_get_charset_coll_noninline( +/*=============================*/ + ulint prtype);/* in: precise data type */ +/************************************************************************* +Gets the MySQL charset-collation code for MySQL string types. */ UNIV_INLINE ulint dtype_get_charset_coll( diff --git a/innobase/include/row0mysql.h b/innobase/include/row0mysql.h index f47ce74ce37..062dae4e60c 100644 --- a/innobase/include/row0mysql.h +++ b/innobase/include/row0mysql.h @@ -454,6 +454,8 @@ struct mysql_row_templ_struct { zero if column cannot be NULL */ ulint type; /* column type in Innobase mtype numbers DATA_CHAR... */ + ulint charset; /* MySQL charset-collation code + of the column, or zero */ ulint is_unsigned; /* if a column type is an integer type and this field is != 0, then it is an unsigned integer type */ diff --git a/innobase/include/row0mysql.ic b/innobase/include/row0mysql.ic index 4ecd66e06ec..fc922b52d0a 100644 --- a/innobase/include/row0mysql.ic +++ b/innobase/include/row0mysql.ic @@ -91,12 +91,33 @@ row_mysql_store_col_in_innobase_format( } } else if (type == DATA_VARCHAR || type == DATA_VARMYSQL || type == DATA_BINARY) { + /* Remove trailing spaces. */ + + /* Handle UCS2 strings differently. As no new + collations will be introduced in 4.1, we hardcode the + charset-collation codes here. In 5.0, the logic will + be based on mbminlen. */ + ulint cset = dtype_get_charset_coll( + dtype_get_prtype(dfield_get_type(dfield))); ptr = row_mysql_read_var_ref(&col_len, mysql_data); - - /* Remove trailing spaces */ - while (col_len > 0 && ptr[col_len - 1] == ' ') { - col_len--; - } + if (cset == 35/*ucs2_general_ci*/ + || cset == 90/*ucs2_bin*/ + || (cset >= 128/*ucs2_unicode_ci*/ + && cset <= 144/*ucs2_persian_ci*/)) { + /* space=0x0020 */ + /* Trim "half-chars", just in case. */ + col_len &= ~1; + + while (col_len >= 2 && ptr[col_len - 2] == 0x00 + && ptr[col_len - 1] == 0x20) { + col_len -= 2; + } + } else { + /* space=0x20 */ + while (col_len > 0 && ptr[col_len - 1] == 0x20) { + col_len--; + } + } } else if (type == DATA_BLOB) { ptr = row_mysql_read_blob_ref(&col_len, mysql_data, col_len); } diff --git a/innobase/rem/rem0cmp.c b/innobase/rem/rem0cmp.c index 041fb7914e2..cf549284acc 100644 --- a/innobase/rem/rem0cmp.c +++ b/innobase/rem/rem0cmp.c @@ -261,22 +261,6 @@ cmp_whole_field( "InnoDB: comparison!\n"); } - /* MySQL does not pad the ends of strings with spaces in a - comparison. That would cause a foreign key check to fail for - non-latin1 character sets if we have different length columns. - To prevent that we remove trailing spaces here before doing - the comparison. NOTE that if we in the future map more MySQL - types to DATA_MYSQL or DATA_VARMYSQL, we have to change this - code. */ - - while (a_length > 0 && a[a_length - 1] == ' ') { - a_length--; - } - - while (b_length > 0 && b[b_length - 1] == ' ') { - b_length--; - } - return(innobase_mysql_cmp( (int)(type->prtype & DATA_MYSQL_TYPE_MASK), (uint)dtype_get_charset_coll(type->prtype), diff --git a/innobase/row/row0sel.c b/innobase/row/row0sel.c index ce76f48e7a7..61ba0b53172 100644 --- a/innobase/row/row0sel.c +++ b/innobase/row/row0sel.c @@ -2204,9 +2204,6 @@ row_sel_field_store_in_mysql_format( dest = row_mysql_store_var_len(dest, len); ut_memcpy(dest, data, len); - /* Pad with trailing spaces */ - memset(dest + len, ' ', col_len - len); - /* ut_ad(col_len >= len + 2); No real var implemented in MySQL yet! */ @@ -2334,7 +2331,45 @@ row_sel_store_mysql_rec( mysql_rec + templ->mysql_col_offset, templ->mysql_col_len, data, len, templ->type, templ->is_unsigned); - + + if (templ->type == DATA_VARCHAR + || templ->type == DATA_VARMYSQL + || templ->type == DATA_BINARY) { + /* Pad with trailing spaces */ + data = mysql_rec + templ->mysql_col_offset; + + /* Handle UCS2 strings differently. As no new + collations will be introduced in 4.1, we + hardcode the charset-collation codes here. + 5.0 will use a different approach. */ + if (templ->charset == 35 + || templ->charset == 90 + || (templ->charset >= 128 + && templ->charset <= 144)) { + /* space=0x0020 */ + ulint col_len = templ->mysql_col_len; + + ut_a(!(col_len & 1)); + if (len & 1) { + /* A 0x20 has been stripped + from the column. + Pad it back. */ + goto pad_0x20; + } + /* Pad the rest of the string + with 0x0020 */ + while (len < col_len) { + data[len++] = 0x00; + pad_0x20: + data[len++] = 0x20; + } + } else { + /* space=0x20 */ + memset(data + len, 0x20, + templ->mysql_col_len - len); + } + } + /* Cleanup */ if (extern_field_heap) { mem_heap_free(extern_field_heap); @@ -2368,8 +2403,29 @@ row_sel_store_mysql_rec( pad_char = '\0'; } - memset(mysql_rec + templ->mysql_col_offset, pad_char, - templ->mysql_col_len); + /* Handle UCS2 strings differently. As no new + collations will be introduced in 4.1, + we hardcode the charset-collation codes here. + 5.0 will use a different approach. */ + if (templ->charset == 35 + || templ->charset == 90 + || (templ->charset >= 128 + && templ->charset <= 144)) { + /* There are two bytes per char, so the length + has to be an even number. */ + ut_a(!(templ->mysql_col_len & 1)); + data = mysql_rec + templ->mysql_col_offset; + len = templ->mysql_col_len; + /* Pad with 0x0020. */ + while (len >= 2) { + *data++ = 0x00; + *data++ = 0x20; + len -= 2; + } + } else { + memset(mysql_rec + templ->mysql_col_offset, + pad_char, templ->mysql_col_len); + } } } diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index cc69762cbdb..8110df1063f 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -2248,6 +2248,8 @@ build_template( templ->mysql_col_len = (ulint) field->pack_length(); templ->type = get_innobase_type_from_mysql_type(field); + templ->charset = dtype_get_charset_coll_noninline( + index->table->cols[i].type.prtype); templ->is_unsigned = (ulint) (field->flags & UNSIGNED_FLAG); if (templ->type == DATA_BLOB) { From 9a202517f562adc467e0b461d898bbcd6edee77a Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 17 Dec 2004 23:37:43 +0100 Subject: [PATCH 0543/1063] Fix for BUG#7358: removing warning reporting of mysqldump 4.1.8 when calling SHOW CREATE DATABASE, as we deal almost gracefully with it (back to behaviour of 4.1.7). Warning was not fatal: mysqldump continued. And the good thing is that it helped spot that starting from 4.1.7, SHOW CREATE DATABASE failed (if --single-transaction and first db has non-empty InnoDB table and there is a second db) and thus mysqldump produced CREATE DATABASE statements missing the CHARACTER SET clause. Removing the bug which was in the server, and the warning reporting in mysqldump (compatibility with old servers). client/mysqldump.c: don't report errors as we deal almost gracefully with them (back to code of 4.1.7) mysql-test/r/flush_block_commit.result: result update mysql-test/t/flush_block_commit.test: let's verify that SHOW CREATE DATABASE succeeds even if connection has open transaction. sql/sql_parse.cc: There is no reason to forbid SHOW CREATE DATABASE if connection has an open transaction --- client/mysqldump.c | 2 +- mysql-test/r/flush_block_commit.result | 8 ++++++++ mysql-test/t/flush_block_commit.test | 8 ++++++++ sql/sql_parse.cc | 5 ----- 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/client/mysqldump.c b/client/mysqldump.c index 11892a3458f..c36f9d3e23e 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -1914,7 +1914,7 @@ static int init_dumping(char *database) sprintf(qbuf,"SHOW CREATE DATABASE IF NOT EXISTS %s", qdatabase); - if (mysql_query_with_error_report(sock, &dbinfo, qbuf)) + if (mysql_query(sock, qbuf) || !(dbinfo = mysql_store_result(sock))) { /* Old server version, dump generic CREATE DATABASE */ fprintf(md_result_file, diff --git a/mysql-test/r/flush_block_commit.result b/mysql-test/r/flush_block_commit.result index 4a7575d8f7a..2e9f1920937 100644 --- a/mysql-test/r/flush_block_commit.result +++ b/mysql-test/r/flush_block_commit.result @@ -28,4 +28,12 @@ commit; unlock tables; flush tables with read lock; unlock tables; +begin; +select * from t1; +a +1 +10 +show create database test; +Database Create Database +test CREATE DATABASE `test` /*!40100 DEFAULT CHARACTER SET latin1 */ drop table t1; diff --git a/mysql-test/t/flush_block_commit.test b/mysql-test/t/flush_block_commit.test index ac14b7b98bc..87715452089 100644 --- a/mysql-test/t/flush_block_commit.test +++ b/mysql-test/t/flush_block_commit.test @@ -1,6 +1,7 @@ # Let's see if FLUSH TABLES WITH READ LOCK blocks COMMIT of existing # transactions. # We verify that we did not introduce a deadlock. +# This is intended to mimick how mysqldump and innobackup work. -- source include/have_innodb.inc @@ -63,4 +64,11 @@ unlock tables; connection con2; flush tables with read lock; # bug caused hang here unlock tables; + +# BUG#7358 SHOW CREATE DATABASE fails if open transaction + +begin; +select * from t1; +show create database test; + drop table t1; diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 8dc1339993e..55d26a68116 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -3249,11 +3249,6 @@ purposes internal to the MySQL server", MYF(0)); } if (check_access(thd,SELECT_ACL,lex->name,0,1,0)) break; - if (thd->locked_tables || thd->active_transaction()) - { - send_error(thd,ER_LOCK_OR_ACTIVE_TRANSACTION); - goto error; - } res=mysqld_show_create_db(thd,lex->name,&lex->create_info); break; } From 4f9a0a06a8d60d68022fb813b59df8aacd5e4460 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 18 Dec 2004 02:07:32 +0000 Subject: [PATCH 0544/1063] Bug#7391 - Multi-table UPDATE security regression Add in missing privilege checks. Tests for the privileges. mysql-test/r/grant.result: Bug#7391 - Multi-table UPDATE security regression Tests column, table and db level access mysql-test/t/grant.test: Bug#7391 - Multi-table UPDATE security regression Tests column, table and db level access sql/sql_update.cc: Bug#7391 - Multi-table UPDATE security regression Add in missing privilege checks. --- mysql-test/r/grant.result | 64 ++++++++++++++++++++++++++++++++++ mysql-test/t/grant.test | 72 +++++++++++++++++++++++++++++++++++++++ sql/sql_update.cc | 20 +++++++++++ 3 files changed, 156 insertions(+) diff --git a/mysql-test/r/grant.result b/mysql-test/r/grant.result index f0e5d16e916..2a433e3d5db 100644 --- a/mysql-test/r/grant.result +++ b/mysql-test/r/grant.result @@ -156,3 +156,67 @@ select host,db,user,select_priv,insert_priv from mysql.db where db="db6123"; host db user select_priv insert_priv delete from mysql.user where user='test6123'; drop database db6123; +create database mysqltest_1; +create database mysqltest_2; +create table mysqltest_1.t1 select 1 a, 2 q; +create table mysqltest_1.t2 select 1 b, 2 r; +create table mysqltest_2.t1 select 1 c, 2 s; +create table mysqltest_2.t2 select 1 d, 2 t; +grant update (a) on mysqltest_1.t1 to mysqltest_3@localhost; +grant select (b) on mysqltest_1.t2 to mysqltest_3@localhost; +grant select (c) on mysqltest_2.t1 to mysqltest_3@localhost; +grant update (d) on mysqltest_2.t2 to mysqltest_3@localhost; +show grants for mysqltest_3@localhost; +Grants for mysqltest_3@localhost +GRANT USAGE ON *.* TO 'mysqltest_3'@'localhost' +GRANT SELECT (b) ON `mysqltest_1`.`t2` TO 'mysqltest_3'@'localhost' +GRANT SELECT (c) ON `mysqltest_2`.`t1` TO 'mysqltest_3'@'localhost' +GRANT UPDATE (a) ON `mysqltest_1`.`t1` TO 'mysqltest_3'@'localhost' +GRANT UPDATE (d) ON `mysqltest_2`.`t2` TO 'mysqltest_3'@'localhost' +update mysqltest_1.t1, mysqltest_1.t2 set q=10 where b=1; +UPDATE command denied to user: 'mysqltest_3@localhost' for column 'q' in table 't1' +update mysqltest_1.t1, mysqltest_2.t2 set d=20 where d=1; +select command denied to user: 'mysqltest_3@localhost' for table 't1' +update mysqltest_2.t1, mysqltest_1.t2 set c=20 where b=1; +UPDATE command denied to user: 'mysqltest_3@localhost' for column 'c' in table 't1' +update mysqltest_2.t1, mysqltest_2.t2 set d=10 where s=2; +SELECT command denied to user: 'mysqltest_3@localhost' for column 's' in table 't1' +update mysqltest_1.t1, mysqltest_2.t2 set a=10,d=10; +update mysqltest_1.t1, mysqltest_2.t1 set a=20 where c=20; +select t1.*,t2.* from mysqltest_1.t1,mysqltest_1.t2; +a q b r +10 2 1 2 +select t1.*,t2.* from mysqltest_2.t1,mysqltest_2.t2; +c s d t +1 2 10 2 +revoke all on mysqltest_1.t1 from mysqltest_3@localhost; +revoke all on mysqltest_1.t2 from mysqltest_3@localhost; +revoke all on mysqltest_2.t1 from mysqltest_3@localhost; +revoke all on mysqltest_2.t2 from mysqltest_3@localhost; +grant all on mysqltest_2.* to mysqltest_3@localhost; +grant select on *.* to mysqltest_3@localhost; +flush privileges; +use mysqltest_1; +update mysqltest_2.t1, mysqltest_2.t2 set c=500,d=600; +update mysqltest_1.t1, mysqltest_1.t2 set a=100,b=200; +UPDATE command denied to user: 'mysqltest_3@localhost' for column 'a' in table 't1' +use mysqltest_2; +update mysqltest_1.t1, mysqltest_1.t2 set a=100,b=200; +Access denied for user: 'mysqltest_3@localhost' to database 'mysqltest_1' +update mysqltest_2.t1, mysqltest_1.t2 set c=100,b=200; +Access denied for user: 'mysqltest_3@localhost' to database 'mysqltest_1' +update mysqltest_1.t1, mysqltest_2.t2 set a=100,d=200; +Access denied for user: 'mysqltest_3@localhost' to database 'mysqltest_1' +select t1.*,t2.* from mysqltest_1.t1,mysqltest_1.t2; +a q b r +10 2 1 2 +select t1.*,t2.* from mysqltest_2.t1,mysqltest_2.t2; +c s d t +500 2 600 2 +delete from mysql.user where user='mysqltest_3'; +delete from mysql.db where user="mysqltest_3"; +delete from mysql.tables_priv where user="mysqltest_3"; +delete from mysql.columns_priv where user="mysqltest_3"; +flush privileges; +drop database mysqltest_1; +drop database mysqltest_2; diff --git a/mysql-test/t/grant.test b/mysql-test/t/grant.test index 21173a356ce..d9b4be04de3 100644 --- a/mysql-test/t/grant.test +++ b/mysql-test/t/grant.test @@ -2,6 +2,8 @@ drop table if exists t1; --enable_warnings +connect (master,localhost,root,,); +connection master; # # Test that SSL options works properly # @@ -114,3 +116,73 @@ grant usage on db6123.* to test6123 identified by 'magic123'; select host,db,user,select_priv,insert_priv from mysql.db where db="db6123"; delete from mysql.user where user='test6123'; drop database db6123; + +# +# Bug#7391: Cross-database multi-table UPDATE security problem +# +create database mysqltest_1; +create database mysqltest_2; +create table mysqltest_1.t1 select 1 a, 2 q; +create table mysqltest_1.t2 select 1 b, 2 r; +create table mysqltest_2.t1 select 1 c, 2 s; +create table mysqltest_2.t2 select 1 d, 2 t; + +#test the column privileges +grant update (a) on mysqltest_1.t1 to mysqltest_3@localhost; +grant select (b) on mysqltest_1.t2 to mysqltest_3@localhost; +grant select (c) on mysqltest_2.t1 to mysqltest_3@localhost; +grant update (d) on mysqltest_2.t2 to mysqltest_3@localhost; +connect (conn1,localhost,mysqltest_3,,); +connection conn1; +show grants for mysqltest_3@localhost; +--error 1143 +update mysqltest_1.t1, mysqltest_1.t2 set q=10 where b=1; +--error 1142 +update mysqltest_1.t1, mysqltest_2.t2 set d=20 where d=1; +--error 1143 +update mysqltest_2.t1, mysqltest_1.t2 set c=20 where b=1; +--error 1143 +update mysqltest_2.t1, mysqltest_2.t2 set d=10 where s=2; +#the following two should work +update mysqltest_1.t1, mysqltest_2.t2 set a=10,d=10; +update mysqltest_1.t1, mysqltest_2.t1 set a=20 where c=20; +connection master; +select t1.*,t2.* from mysqltest_1.t1,mysqltest_1.t2; +select t1.*,t2.* from mysqltest_2.t1,mysqltest_2.t2; +revoke all on mysqltest_1.t1 from mysqltest_3@localhost; +revoke all on mysqltest_1.t2 from mysqltest_3@localhost; +revoke all on mysqltest_2.t1 from mysqltest_3@localhost; +revoke all on mysqltest_2.t2 from mysqltest_3@localhost; + +#test the db/table level privileges +grant all on mysqltest_2.* to mysqltest_3@localhost; +grant select on *.* to mysqltest_3@localhost; +flush privileges; +disconnect conn1; +connect (conn2,localhost,mysqltest_3,,); +connection conn2; +use mysqltest_1; +update mysqltest_2.t1, mysqltest_2.t2 set c=500,d=600; +# the following failed before, should fail now. +--error 1143 +update mysqltest_1.t1, mysqltest_1.t2 set a=100,b=200; +use mysqltest_2; +#the following used to succeed, it must fail now. +--error 1044 +update mysqltest_1.t1, mysqltest_1.t2 set a=100,b=200; +--error 1044 +update mysqltest_2.t1, mysqltest_1.t2 set c=100,b=200; +--error 1044 +update mysqltest_1.t1, mysqltest_2.t2 set a=100,d=200; +#lets see the result +connection master; +select t1.*,t2.* from mysqltest_1.t1,mysqltest_1.t2; +select t1.*,t2.* from mysqltest_2.t1,mysqltest_2.t2; + +delete from mysql.user where user='mysqltest_3'; +delete from mysql.db where user="mysqltest_3"; +delete from mysql.tables_priv where user="mysqltest_3"; +delete from mysql.columns_priv where user="mysqltest_3"; +flush privileges; +drop database mysqltest_1; +drop database mysqltest_2; diff --git a/sql/sql_update.cc b/sql/sql_update.cc index cdcc90e8651..f7355f2e9b6 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -465,21 +465,34 @@ int mysql_multi_update(THD *thd, */ for (tl= table_list ; tl ; tl=tl->next) { + TABLE_LIST *save= tl->next; TABLE *table= tl->table; + uint wants; + tl->next= 0; if (update_map & table->map) { DBUG_PRINT("info",("setting table `%s` for update", tl->alias)); tl->lock_type= thd->lex.lock_option; tl->updating= 1; + wants= UPDATE_ACL; } else { DBUG_PRINT("info",("setting table `%s` for read-only", tl->alias)); tl->lock_type= TL_READ; tl->updating= 0; + wants= SELECT_ACL; } if (!using_lock_tables) tl->table->reginfo.lock_type= tl->lock_type; + + if (check_access(thd, wants, tl->db, &tl->grant.privilege, 0, 0) || + (grant_option && check_grant(thd, wants, tl, 0, 0))) + { + tl->next= save; + DBUG_RETURN(0); + } + tl->next= save; } /* Relock the tables with the correct modes */ @@ -541,6 +554,13 @@ int mysql_multi_update(THD *thd, } } + /* + If we have no WHERE clause, make it true otherwise the Select + examines the privileges + */ + if (!conds) + conds= new Item_int("1", 1LL, 1); + if (!(result=new multi_update(thd, table_list, fields, values, handle_duplicates))) DBUG_RETURN(-1); From c6be66530a1391c88b250c6212fb8a26084778c8 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 18 Dec 2004 02:34:11 +0000 Subject: [PATCH 0545/1063] Remove bogus lines --- sql/sql_update.cc | 7 ------- 1 file changed, 7 deletions(-) diff --git a/sql/sql_update.cc b/sql/sql_update.cc index f7355f2e9b6..4f7e34ec74f 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -554,13 +554,6 @@ int mysql_multi_update(THD *thd, } } - /* - If we have no WHERE clause, make it true otherwise the Select - examines the privileges - */ - if (!conds) - conds= new Item_int("1", 1LL, 1); - if (!(result=new multi_update(thd, table_list, fields, values, handle_duplicates))) DBUG_RETURN(-1); From c892bc8beabfd218ae99bcd93a23b5c02849ff7f Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 17 Dec 2004 22:25:35 -0500 Subject: [PATCH 0546/1063] my-innodb-heavy-4G.cnf.sh: I fixed the typos in the transaction-isolation comments. I fixed the spelling mistakes in the comment. It had tripped up a support customer as they couldn't start the server with transaction-isolation= read-commited support-files/my-innodb-heavy-4G.cnf.sh: I fixed the typos in the transaction-isolation comments. BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted --- BitKeeper/etc/logging_ok | 1 + support-files/my-innodb-heavy-4G.cnf.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok index f4e5f08ae63..c5d9551ebf1 100644 --- a/BitKeeper/etc/logging_ok +++ b/BitKeeper/etc/logging_ok @@ -104,6 +104,7 @@ magnus@neptunus.(none) magnus@shellback.(none) marko@hundin.mysql.fi mats@mysql.com +matt@booty.(none) matt@mysql.com matthias@three.local.lan miguel@hegel.(none) diff --git a/support-files/my-innodb-heavy-4G.cnf.sh b/support-files/my-innodb-heavy-4G.cnf.sh index 6def311f474..062d106ce6a 100644 --- a/support-files/my-innodb-heavy-4G.cnf.sh +++ b/support-files/my-innodb-heavy-4G.cnf.sh @@ -177,7 +177,7 @@ default_table_type = MYISAM thread_stack = 192K # Set the default transaction isolation level. Levels available are: -# READ-UNCOMMITED, READ-COMMITED, REPEATABLE-READ, SERIALIZABLE +# READ-UNCOMMITTED, READ-COMMITTED, REPEATABLE-READ, SERIALIZABLE transaction_isolation = REPEATABLE-READ # Maximum size for internal (in-memory) temporary tables. If a table From 2ca011d4608bac018986e0509c9d74ddafca50ec Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 18 Dec 2004 13:45:19 +0200 Subject: [PATCH 0547/1063] Simplify code during review --- sql/sql_select.cc | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 2df0d45f8ed..eda4ce73186 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -4951,10 +4951,7 @@ join_read_system(JOIN_TAB *tab) table->file->print_error(error,MYF(0)); return 1; } - if (tab->on_expr) - mark_as_null_row(tab->table); - else - table->null_row=1; // Why do this for inner join? + mark_as_null_row(tab->table); empty_record(table); // Make empty record return -1; } @@ -4984,10 +4981,7 @@ join_read_const(JOIN_TAB *tab) } if (error) { - if (tab->on_expr) - mark_as_null_row(tab->table); - else - table->null_row=1; + mark_as_null_row(tab->table); empty_record(table); if (error != HA_ERR_KEY_NOT_FOUND) { From 63e472550347b990d26f92af1e874a57bf0a6201 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 18 Dec 2004 11:57:17 +0000 Subject: [PATCH 0548/1063] Fix test --- mysql-test/r/update.result | 1 - 1 file changed, 1 deletion(-) diff --git a/mysql-test/r/update.result b/mysql-test/r/update.result index 2d0903a4dae..7810d52d156 100644 --- a/mysql-test/r/update.result +++ b/mysql-test/r/update.result @@ -203,7 +203,6 @@ colC colA colD colE colF 3 4433 10005 492 500 DROP TABLE t1; DROP TABLE t2; -drop table if exists t1, t2; create table t1 (c1 int, c2 char(6), c3 int); create table t2 (c1 int, c2 char(6)); insert into t1 values (1, "t1c2-1", 10), (2, "t1c2-2", 20); From b1eb45210bc2259cec791252259f2496d70a7161 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 18 Dec 2004 15:15:41 +0000 Subject: [PATCH 0549/1063] Fix test results --- mysql-test/r/grant.result | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/mysql-test/r/grant.result b/mysql-test/r/grant.result index 38f7ca13a4b..d6d5a3e99ea 100644 --- a/mysql-test/r/grant.result +++ b/mysql-test/r/grant.result @@ -359,13 +359,13 @@ GRANT SELECT (c) ON `mysqltest_2`.`t1` TO 'mysqltest_3'@'localhost' GRANT UPDATE (a) ON `mysqltest_1`.`t1` TO 'mysqltest_3'@'localhost' GRANT UPDATE (d) ON `mysqltest_2`.`t2` TO 'mysqltest_3'@'localhost' update mysqltest_1.t1, mysqltest_1.t2 set q=10 where b=1; -ERROR 42000: UPDATE command denied to user 'mysqltest_3@localhost' for column 'q' in table 't1' +ERROR 42000: UPDATE command denied to user 'mysqltest_3'@'localhost' for column 'q' in table 't1' update mysqltest_1.t1, mysqltest_2.t2 set d=20 where d=1; -ERROR 42000: SELECT command denied to user 'mysqltest_3@localhost' for column 'd' in table 't1' +ERROR 42000: SELECT command denied to user 'mysqltest_3'@'localhost' for column 'd' in table 't2' update mysqltest_2.t1, mysqltest_1.t2 set c=20 where b=1; -ERROR 42000: UPDATE command denied to user 'mysqltest_3@localhost' for column 'c' in table 't1' +ERROR 42000: UPDATE command denied to user 'mysqltest_3'@'localhost' for column 'c' in table 't1' update mysqltest_2.t1, mysqltest_2.t2 set d=10 where s=2; -ERROR 42000: SELECT command denied to user 'mysqltest_3@localhost' for column 's' in table 't1' +ERROR 42000: SELECT command denied to user 'mysqltest_3'@'localhost' for column 's' in table 't1' update mysqltest_1.t1, mysqltest_2.t2 set a=10,d=10; update mysqltest_1.t1, mysqltest_2.t1 set a=20 where c=20; select t1.*,t2.* from mysqltest_1.t1,mysqltest_1.t2; @@ -384,14 +384,14 @@ flush privileges; use mysqltest_1; update mysqltest_2.t1, mysqltest_2.t2 set c=500,d=600; update mysqltest_1.t1, mysqltest_1.t2 set a=100,b=200; -ERROR 42000: UPDATE command denied to user 'mysqltest_3@localhost' for column 'a' in table 't1' +ERROR 42000: UPDATE command denied to user 'mysqltest_3'@'localhost' for column 'a' in table 't1' use mysqltest_2; update mysqltest_1.t1, mysqltest_1.t2 set a=100,b=200; -ERROR 42000: Access denied for user 'mysqltest_3@localhost' to database 'mysqltest_1' +ERROR 42000: Access denied for user 'mysqltest_3'@'localhost' to database 'mysqltest_1' update mysqltest_2.t1, mysqltest_1.t2 set c=100,b=200; -ERROR 42000: Access denied for user 'mysqltest_3@localhost' to database 'mysqltest_1' +ERROR 42000: Access denied for user 'mysqltest_3'@'localhost' to database 'mysqltest_1' update mysqltest_1.t1, mysqltest_2.t2 set a=100,d=200; -ERROR 42000: Access denied for user 'mysqltest_3@localhost' to database 'mysqltest_1' +ERROR 42000: Access denied for user 'mysqltest_3'@'localhost' to database 'mysqltest_1' select t1.*,t2.* from mysqltest_1.t1,mysqltest_1.t2; a q b r 10 2 1 2 From d8432ada2c6b4a7550e17053d3824736ee75ddea Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 18 Dec 2004 14:22:20 -0600 Subject: [PATCH 0550/1063] fill_help_tables.sh: Convert @samp{c} to 'c', not c. scripts/fill_help_tables.sh: Convert @samp{c} to 'c', not c. BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted --- BitKeeper/etc/logging_ok | 1 + scripts/fill_help_tables.sh | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok index c5d9551ebf1..782259dea02 100644 --- a/BitKeeper/etc/logging_ok +++ b/BitKeeper/etc/logging_ok @@ -159,6 +159,7 @@ nick@nick.leippe.com papa@gbichot.local patg@krsna.patg.net paul@central.snake.net +paul@frost.snake.net paul@ice.local paul@ice.snake.net paul@kite-hub.kitebird.com diff --git a/scripts/fill_help_tables.sh b/scripts/fill_help_tables.sh index 51edfc8af78..fbe7c597b34 100644 --- a/scripts/fill_help_tables.sh +++ b/scripts/fill_help_tables.sh @@ -203,7 +203,7 @@ sub prepare_name $a =~ s/\@command\{((.|\n)+?)\}/$1/go; $a =~ s/\@code\{((.|\n)+?)\}/$1/go; $a =~ s/\@strong\{(.+?)\}/$1/go; - $a =~ s/\@samp\{(.+?)\}/$1/go; + $a =~ s/\@samp\{(.+?)\}/'$1'/go; $a =~ s/\@emph\{((.|\n)+?)\}/\/$1\//go; $a =~ s/\@xref\{((.|\n)+?)\}/See also : [$1]/go; $a =~ s/\@ref\{((.|\n)+?)\}/[$1]/go; @@ -254,7 +254,7 @@ sub prepare_description $a =~ s/\@command\{((.|\n)+?)\}/$1/go; $a =~ s/\@code\{((.|\n)+?)\}/$1/go; $a =~ s/\@strong\{(.+?)\}/$1/go; - $a =~ s/\@samp\{(.+?)\}/$1/go; + $a =~ s/\@samp\{(.+?)\}/'$1'/go; $a =~ s/\@emph\{((.|\n)+?)\}/\/$1\//go; $a =~ s/\@xref\{((.|\n)+?)\}/See also : [$1]/go; $a =~ s/\@ref\{((.|\n)+?)\}/[$1]/go; From b824756c00b235bc6825d561c833ffed2f2e0d38 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 18 Dec 2004 14:30:00 -0600 Subject: [PATCH 0551/1063] mysql.cc: Fix up mysql help messages. client/mysql.cc: Fix up mysql help messages. --- client/mysql.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/mysql.cc b/client/mysql.cc index 8e9dd84c8f0..0ea0f10f5d7 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -1677,7 +1677,7 @@ static int com_server_help(String *buffer __attribute__((unused)), if (num_fields == 2) { put_info("Many help items for your request exist.", INFO_INFO); - put_info("To make a more specific request, please type 'help ',\nwhere item is one of the following", INFO_INFO); + put_info("To make a more specific request, please type 'help ',\nwhere is one of the following", INFO_INFO); num_name= 0; num_cat= 1; last_char= '_'; @@ -1685,7 +1685,7 @@ static int com_server_help(String *buffer __attribute__((unused)), else if ((cur= mysql_fetch_row(result))) { tee_fprintf(PAGER, "You asked for help about help category: \"%s\"\n", cur[0]); - put_info("For more information, type 'help ', where item is one of the following", INFO_INFO); + put_info("For more information, type 'help ', where is one of the following", INFO_INFO); num_name= 1; num_cat= 2; print_help_item(&cur,1,2,&last_char); From 6cbcd3423afd72961d7f04c5536426ba92e24db8 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 19 Dec 2004 20:28:52 +0300 Subject: [PATCH 0552/1063] Fix assertion failure in client_test when linked with the embedded library: stmt_update_metadata (used when we update max_length in mysql_stmt_store_result) needs valid row->length. libmysqld/lib_sql.cc: row->length is asserted to be valid in stmt_update_metadata --- libmysqld/lib_sql.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc index 8092d87b97c..917bcada564 100644 --- a/libmysqld/lib_sql.cc +++ b/libmysqld/lib_sql.cc @@ -710,6 +710,7 @@ bool Protocol_prep::write() } cur->data= (MYSQL_ROW)(((char *)cur) + sizeof(MYSQL_ROWS)); memcpy(cur->data, packet->ptr()+1, packet->length()-1); + cur->length= packet->length(); /* To allow us to do sanity checks */ *data->prev_ptr= cur; data->prev_ptr= &cur->next; From f06f81610071b4f13352230d829f8bf03ac97117 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 20 Dec 2004 13:47:38 +0400 Subject: [PATCH 0553/1063] A fix (bug #7281: RAND(RAND) crashes server). --- mysql-test/r/func_math.result | 2 ++ mysql-test/t/func_math.test | 7 +++++++ sql/item_func.cc | 3 ++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/func_math.result b/mysql-test/r/func_math.result index 90aa04515d7..3a28cccfac5 100644 --- a/mysql-test/r/func_math.result +++ b/mysql-test/r/func_math.result @@ -124,3 +124,5 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: Note 1003 select degrees(pi()) AS `degrees(pi())`,radians(360) AS `radians(360)` +select rand(rand); +ERROR 42S22: Unknown column 'rand' in 'field list' diff --git a/mysql-test/t/func_math.test b/mysql-test/t/func_math.test index e58c097b5a6..668aefc2d8d 100644 --- a/mysql-test/t/func_math.test +++ b/mysql-test/t/func_math.test @@ -51,3 +51,10 @@ SELECT ASIN(1.2-0.2); #select floor(log(16)/log(2)); explain extended select degrees(pi()),radians(360); + +# +# Bug #7281: problem with rand() +# + +--error 1054 +select rand(rand); diff --git a/sql/item_func.cc b/sql/item_func.cc index 2d939f47716..3c565d0c466 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -1091,7 +1091,8 @@ double Item_func_round::val() bool Item_func_rand::fix_fields(THD *thd, struct st_table_list *tables, Item **ref) { - Item_real_func::fix_fields(thd, tables, ref); + if (Item_real_func::fix_fields(thd, tables, ref)) + return TRUE; used_tables_cache|= RAND_TABLE_BIT; if (arg_count) { // Only use argument once in query From 8c01aba776c21448f1f10be51200cd2d1ebd2ab5 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 20 Dec 2004 12:36:14 +0100 Subject: [PATCH 0554/1063] added config parameter Group on connection moved NdbWaiter, m_ndb_cluster_connection, to impl class moved node selection things to cluster connection moved all private things to impl class added opts for shared memory and node selection changed opts handling somewhat; introduced enum for options and common handling of option variables added checks for transporter support automatic addition of shared mem transporters moved wait_until_ready code to cluster connection added control of usage of new node selection method ndb/include/mgmapi/mgmapi_config_parameters.h: added config parameter Group on connection ndb/include/ndbapi/Ndb.hpp: moved NdbWaiter, m_ndb_cluster_connection, to impl class moved node selection things to cluster connection ndb/include/ndbapi/ndb_cluster_connection.hpp: moved all private things to impl class ndb/include/util/ndb_opts.h: added opts for shared memory and node selection ndb/src/kernel/vm/Configuration.cpp: changed opts handling somewhat; introduced enum for options and common handling of option variables ndb/src/mgmclient/main.cpp: changed opts handling somewhat; introduced enum for options and common handling of option variables ndb/src/mgmsrv/ConfigInfo.cpp: added checks for transporter support automatic addition of shared mem transporters ndb/src/mgmsrv/MgmtSrvr.cpp: in alloc node id first choose connection with specified hostname ndb/src/mgmsrv/main.cpp: changed opts handling somewhat; introduced enum for options and common handling of option variables ndb/src/ndbapi/DictCache.hpp: added include file ndb/src/ndbapi/Ndb.cpp: enabled using new node selection method moved wait_until_ready code to cluster connection moved node selection (hint) to cluster connection removed start transaction dgroup ndb/src/ndbapi/NdbDictionaryImpl.hpp: removed and added inclusde files ndb/src/ndbapi/NdbImpl.hpp: moved things from Ndb into Impl class moved waiter things to new file NdbWaiter.hpp ndb/src/ndbapi/NdbScanOperation.cpp: ndbwaiter is no in impl class ndb/src/ndbapi/Ndbif.cpp: ndbwaiter is no in impl class ndb/src/ndbapi/Ndbinit.cpp: moved some Ndb things into impl class ndb/src/ndbapi/TransporterFacade.hpp: changed friend declaration ndb/src/ndbapi/ndb_cluster_connection.cpp: moved node selection things to cluster connection moved things from cluster connection to cluster connection impl class ndb/test/ndbapi/testNdbApi.cpp: removed start transaction dgroup ndb/tools/delete_all.cpp: changed opts handling somewhat; introduced enum for options and common handling of option variables ndb/tools/desc.cpp: changed opts handling somewhat; introduced enum for options and common handling of option variables ndb/tools/drop_index.cpp: changed opts handling somewhat; introduced enum for options and common handling of option variables ndb/tools/drop_tab.cpp: changed opts handling somewhat; introduced enum for options and common handling of option variables ndb/tools/listTables.cpp: changed opts handling somewhat; introduced enum for options and common handling of option variables ndb/tools/restore/restore_main.cpp: changed opts handling somewhat; introduced enum for options and common handling of option variables ndb/tools/select_all.cpp: changed opts handling somewhat; introduced enum for options and common handling of option variables ndb/tools/select_count.cpp: changed opts handling somewhat; introduced enum for options and common handling of option variables ndb/tools/waiter.cpp: changed opts handling somewhat; introduced enum for options and common handling of option variables sql/ha_ndbcluster.cc: added control of usage of new node selection method sql/mysqld.cc: added control of usage of new node selection method --- ndb/include/mgmapi/mgmapi_config_parameters.h | 1 + ndb/include/ndbapi/Ndb.hpp | 83 --- ndb/include/ndbapi/ndb_cluster_connection.hpp | 31 +- ndb/include/util/ndb_opts.h | 77 ++- ndb/src/kernel/vm/Configuration.cpp | 12 +- ndb/src/mgmclient/main.cpp | 6 +- ndb/src/mgmsrv/ConfigInfo.cpp | 184 +++++- ndb/src/mgmsrv/MgmtSrvr.cpp | 15 + ndb/src/mgmsrv/main.cpp | 56 +- ndb/src/ndbapi/DictCache.hpp | 1 + ndb/src/ndbapi/Ndb.cpp | 266 ++------ ndb/src/ndbapi/NdbDictionaryImpl.hpp | 2 +- ndb/src/ndbapi/NdbImpl.hpp | 75 +-- ndb/src/ndbapi/NdbScanOperation.cpp | 16 +- ndb/src/ndbapi/NdbWaiter.hpp | 102 +++ ndb/src/ndbapi/Ndbif.cpp | 56 +- ndb/src/ndbapi/Ndbinit.cpp | 36 +- ndb/src/ndbapi/TransporterFacade.hpp | 2 +- ndb/src/ndbapi/ndb_cluster_connection.cpp | 618 +++++++++++++++--- .../ndbapi/ndb_cluster_connection_impl.hpp | 100 +++ ndb/test/ndbapi/testNdbApi.cpp | 8 + ndb/tools/delete_all.cpp | 6 +- ndb/tools/desc.cpp | 6 +- ndb/tools/drop_index.cpp | 6 +- ndb/tools/drop_tab.cpp | 6 +- ndb/tools/listTables.cpp | 8 +- ndb/tools/restore/restore_main.cpp | 5 +- ndb/tools/select_all.cpp | 6 +- ndb/tools/select_count.cpp | 6 +- ndb/tools/waiter.cpp | 6 +- sql/ha_ndbcluster.cc | 21 +- sql/mysqld.cc | 46 +- 32 files changed, 1242 insertions(+), 627 deletions(-) create mode 100644 ndb/src/ndbapi/NdbWaiter.hpp create mode 100644 ndb/src/ndbapi/ndb_cluster_connection_impl.hpp diff --git a/ndb/include/mgmapi/mgmapi_config_parameters.h b/ndb/include/mgmapi/mgmapi_config_parameters.h index 6a0cd376355..406bdb1a110 100644 --- a/ndb/include/mgmapi/mgmapi_config_parameters.h +++ b/ndb/include/mgmapi/mgmapi_config_parameters.h @@ -110,6 +110,7 @@ #define CFG_CONNECTION_SERVER_PORT 406 #define CFG_CONNECTION_HOSTNAME_1 407 #define CFG_CONNECTION_HOSTNAME_2 408 +#define CFG_CONNECTION_GROUP 409 #define CFG_TCP_SERVER 452 #define CFG_TCP_SEND_BUFFER_SIZE 454 diff --git a/ndb/include/ndbapi/Ndb.hpp b/ndb/include/ndbapi/Ndb.hpp index 1c9c2db5d6b..766409d64e2 100644 --- a/ndb/include/ndbapi/Ndb.hpp +++ b/ndb/include/ndbapi/Ndb.hpp @@ -901,23 +901,6 @@ typedef void (* NdbEventCallback)(NdbEventOperation*, Ndb*, void*); NDB_MAX_SCHEMA_NAME_SIZE + \ NDB_MAX_TAB_NAME_SIZE*2 -#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL -class NdbWaiter { -public: - NdbWaiter(); - ~NdbWaiter(); - - void wait(int waitTime); - void nodeFail(Uint32 node); - void signal(Uint32 state); - - Uint32 m_node; - Uint32 m_state; - void * m_mutex; - struct NdbCondition * m_condition; -}; -#endif - /** * @class Ndb * @brief Represents the NDB kernel and is the main class of the NDB API. @@ -1199,39 +1182,6 @@ public: const char * keyData = 0, Uint32 keyLen = 0); -#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL - /** - * This method is a modification of Ndb::startTransaction, - * in which we use only the first two chars of keyData to - * select transaction coordinator. - * This is referred to as a distribution group. - * There are two ways to use the method: - * - In the first, the two characters are used directly as - * the distribution key, and - * - in the second the distribution is calculated as: - * (10 * (char[0] - 0x30) + (char[1] - 0x30)). - * Thus, in the second way, the two ASCII digits '78' - * will provide the distribution key = 78. - * - * @note Transaction priorities are not yet supported. - * - * @param aPrio Priority of the transaction.
- * Priority 0 is the highest priority and is used for short transactions - * with requirements on low delay.
- * Priority 1 is a medium priority for short transactions.
- * Priority 2 is a medium priority for long transactions.
- * Priority 3 is a low priority for long transactions. - * @param keyData is a string of which the two first characters - * is used to compute which fragement the data is stored in. - * @param type is the type of distribution group.
- * 0 means direct usage of the two characters, and
- * 1 means the ASCII digit variant. - * @return NdbConnection, or NULL if it failed. - */ - NdbConnection* startTransactionDGroup(Uint32 aPrio, - const char * keyData, int type); -#endif - /** * When a transactions is completed, the transaction has to be closed. * @@ -1586,8 +1536,6 @@ private: /****************************************************************************** * These are the private variables in this class. *****************************************************************************/ - Ndb_cluster_connection *m_ndb_cluster_connection; - NdbConnection** thePreparedTransactionsArray; NdbConnection** theSentTransactionsArray; NdbConnection** theCompletedTransactionsArray; @@ -1601,8 +1549,6 @@ private: Uint32 theNextConnectNode; - NdbWaiter theWaiter; - bool fullyQualifiedNames; // Ndb database name. @@ -1658,35 +1604,6 @@ private: InitConfigError } theInitState; - /** - * Computes fragement id for primary key - * - * Note that keydata has to be "shaped" as it is being sent in KEYINFO - */ - Uint32 computeFragmentId(const char * keyData, Uint32 keyLen); - Uint32 getFragmentId(Uint32 hashValue); - - /** - * Make a guess to which node is the primary for the fragment - */ - Uint32 guessPrimaryNode(Uint32 fragmentId); - - /** - * Structure containing values for guessing primary node - */ - struct StartTransactionNodeSelectionData { - StartTransactionNodeSelectionData(): - fragment2PrimaryNodeMap(0) {}; - Uint32 kValue; - Uint32 hashValueMask; - Uint32 hashpointerValue; - Uint32 noOfFragments; - Uint32 * fragment2PrimaryNodeMap; - - void init(Uint32 noOfNodes, Uint8 nodeIds[]); - void release(); - } startTransactionNodeSelectionData; - NdbApiSignal* theCommitAckSignal; diff --git a/ndb/include/ndbapi/ndb_cluster_connection.hpp b/ndb/include/ndbapi/ndb_cluster_connection.hpp index db1cd0b119e..1b1c8575656 100644 --- a/ndb/include/ndbapi/ndb_cluster_connection.hpp +++ b/ndb/include/ndbapi/ndb_cluster_connection.hpp @@ -18,13 +18,7 @@ #ifndef CLUSTER_CONNECTION_HPP #define CLUSTER_CONNECTION_HPP -class TransporterFacade; -class ConfigRetriever; -struct NdbThread; - -extern "C" { - void* run_ndb_cluster_connection_connect_thread(void*); -} +struct Ndb_cluster_connection_node_iter; class Ndb_cluster_connection { public: @@ -32,16 +26,27 @@ public: ~Ndb_cluster_connection(); int connect(int no_retries, int retry_delay_in_seconds, int verbose); int start_connect_thread(int (*connect_callback)(void)= 0); + + // add check coupled to init state of cluster connection + // timeout_after_first_alive negative - ok only if all alive + // timeout_after_first_alive positive - ok if some alive + int wait_until_ready(int timeout_for_first_alive, + int timeout_after_first_alive); + const char *get_connectstring(char *buf, int buf_sz) const; int get_connected_port() const; const char *get_connected_host() const; + + void set_optimized_node_selection(int val); + + Uint32 no_db_nodes(); + private: - friend void* run_ndb_cluster_connection_connect_thread(void*); - void connect_thread(); - TransporterFacade *m_facade; - ConfigRetriever *m_config_retriever; - NdbThread *m_connect_thread; - int (*m_connect_callback)(void); + friend class Ndb; + friend class NdbImpl; + friend class Ndb_cluster_connection_impl; + class Ndb_cluster_connection_impl & m_impl; + Ndb_cluster_connection(Ndb_cluster_connection_impl&); }; #endif diff --git a/ndb/include/util/ndb_opts.h b/ndb/include/util/ndb_opts.h index f7ae3b5489e..4bac36f5e5e 100644 --- a/ndb/include/util/ndb_opts.h +++ b/ndb/include/util/ndb_opts.h @@ -17,47 +17,62 @@ #ifndef _NDB_OPTS_H #define _NDB_OPTS_H +#include #include #include #include #include +#define NDB_STD_OPTS_VARS \ +const char *opt_connect_str= 0;\ +my_bool opt_ndb_shm;\ +my_bool opt_ndb_optimized_node_selection + +#define NDB_STD_OPTS_OPTIONS \ +OPT_NDB_SHM= 256,\ +OPT_NDB_OPTIMIZED_NODE_SELECTION + +#define OPT_NDB_CONNECTSTRING 'c' + +#ifdef NDB_SHM_TRANSPORTER +#define OPT_NDB_SHM_DEFAULT 1 +#else +#define OPT_NDB_SHM_DEFAULT 0 +#endif + +#define NDB_STD_OPTS_COMMON \ + { "usage", '?', "Display this help and exit.", \ + 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 }, \ + { "help", '?', "Display this help and exit.", \ + 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 }, \ + { "version", 'V', "Output version information and exit.", 0, 0, 0, \ + GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 }, \ + { "ndb-connectstring", OPT_NDB_CONNECTSTRING, \ + "Set connect string for connecting to ndb_mgmd. " \ + "Syntax: \"[nodeid=;][host=][:]\". " \ + "Overides specifying entries in NDB_CONNECTSTRING and Ndb.cfg", \ + (gptr*) &opt_connect_str, (gptr*) &opt_connect_str, 0, \ + GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },\ + { "ndb-shm", OPT_NDB_SHM,\ + "Allow optimizing using shared memory connections when available",\ + (gptr*) &opt_ndb_shm, (gptr*) &opt_ndb_shm, 0,\ + GET_BOOL, NO_ARG, OPT_NDB_SHM_DEFAULT, 0, 0, 0, 0, 0 },\ + {"ndb-optimized-node-selection", OPT_NDB_OPTIMIZED_NODE_SELECTION,\ + "Select nodes for transactions in a more optimal way",\ + (gptr*) &opt_ndb_optimized_node_selection,\ + (gptr*) &opt_ndb_optimized_node_selection, 0,\ + GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0},\ + { "connect-string", OPT_NDB_CONNECTSTRING, "same as --ndb-connectstring",\ + (gptr*) &opt_connect_str, (gptr*) &opt_connect_str, 0,\ + GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 } + #ifndef DBUG_OFF #define NDB_STD_OPTS(prog_name) \ { "debug", '#', "Output debug log. Often this is 'd:t:o,filename'.", \ 0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0 }, \ - { "usage", '?', "Display this help and exit.", \ - 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 }, \ - { "help", '?', "Display this help and exit.", \ - 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 }, \ - { "version", 'V', "Output version information and exit.", 0, 0, 0, \ - GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 }, \ - { "ndb-connectstring", 'c', \ - "Set connect string for connecting to ndb_mgmd. " \ - "Syntax: \"[nodeid=;][host=][:]\". " \ - "Overides specifying entries in NDB_CONNECTSTRING and Ndb.cfg", \ - (gptr*) &opt_connect_str, (gptr*) &opt_connect_str, 0, \ - GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },\ - { "connect-string", 'c', "same as --ndb-connectstring",\ - (gptr*) &opt_connect_str, (gptr*) &opt_connect_str, 0, \ - GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 } + NDB_STD_OPTS_COMMON #else -#define NDB_STD_OPTS(prog_name) \ - { "usage", '?', "Display this help and exit.", \ - 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 }, \ - { "help", '?', "Display this help and exit.", \ - 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 }, \ - { "version", 'V', "Output version information and exit.", 0, 0, 0, \ - GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 }, \ - { "ndb-connectstring", 'c', \ - "Set connect string for connecting to ndb_mgmd. " \ - "Syntax: \"[nodeid=;][host=][:]\". " \ - "Overides specifying entries in NDB_CONNECTSTRING and Ndb.cfg", \ - (gptr*) &opt_connect_str, (gptr*) &opt_connect_str, 0, \ - GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },\ - { "connect-string", 'c', "same as --ndb-connectstring",\ - (gptr*) &opt_connect_str, (gptr*) &opt_connect_str, 0,\ - GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 } +#define NDB_STD_OPTS(prog_name) NDB_STD_OPTS_COMMON #endif #endif /*_NDB_OPTS_H */ diff --git a/ndb/src/kernel/vm/Configuration.cpp b/ndb/src/kernel/vm/Configuration.cpp index 3de84bb0566..29255fc9837 100644 --- a/ndb/src/kernel/vm/Configuration.cpp +++ b/ndb/src/kernel/vm/Configuration.cpp @@ -46,7 +46,13 @@ extern "C" { #include extern EventLogger g_eventLogger; -static const char* opt_connect_str= 0; +enum ndbd_options { + NDB_STD_OPTS_OPTIONS, + OPT_INITIAL, + OPT_NODAEMON +}; + +NDB_STD_OPTS_VARS; static int _daemon, _no_daemon, _initial, _no_start; /** * Arguments to NDB process @@ -54,7 +60,7 @@ static int _daemon, _no_daemon, _initial, _no_start; static struct my_option my_long_options[] = { NDB_STD_OPTS("ndbd"), - { "initial", 256, + { "initial", OPT_INITIAL, "Perform initial start of ndbd, including cleaning the file system. " "Consult documentation before using this", (gptr*) &_initial, (gptr*) &_initial, 0, @@ -66,7 +72,7 @@ static struct my_option my_long_options[] = { "daemon", 'd', "Start ndbd as daemon (default)", (gptr*) &_daemon, (gptr*) &_daemon, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0 }, - { "nodaemon", 257, + { "nodaemon", OPT_NODAEMON, "Do not start ndbd as daemon, provided for testing purposes", (gptr*) &_no_daemon, (gptr*) &_no_daemon, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 }, diff --git a/ndb/src/mgmclient/main.cpp b/ndb/src/mgmclient/main.cpp index 84e27790705..9417c03805f 100644 --- a/ndb/src/mgmclient/main.cpp +++ b/ndb/src/mgmclient/main.cpp @@ -56,9 +56,13 @@ handler(int sig){ } } +enum ndb_mgm_options { + NDB_STD_OPTS_OPTIONS +}; +NDB_STD_OPTS_VARS; + static const char default_prompt[]= "ndb_mgm> "; static unsigned _try_reconnect; -static char *opt_connect_str= 0; static const char *prompt= default_prompt; static char *opt_execute_str= 0; diff --git a/ndb/src/mgmsrv/ConfigInfo.cpp b/ndb/src/mgmsrv/ConfigInfo.cpp index ab2e34f6d3a..800ffe2e361 100644 --- a/ndb/src/mgmsrv/ConfigInfo.cpp +++ b/ndb/src/mgmsrv/ConfigInfo.cpp @@ -23,6 +23,8 @@ #include "InitConfigFileParser.hpp" #include +extern my_bool opt_ndb_shm; + #define MAX_LINE_LENGTH 255 #define KEY_INTERNAL 0 #define MAX_INT_RNIL 0xfffffeff @@ -79,6 +81,7 @@ static bool transformSystem(InitConfigFileParser::Context & ctx, const char *); static bool transformExternalSystem(InitConfigFileParser::Context & ctx, const char *); static bool transformNode(InitConfigFileParser::Context & ctx, const char *); static bool transformExtNode(InitConfigFileParser::Context & ctx, const char *); +static bool checkConnectionSupport(InitConfigFileParser::Context & ctx, const char *); static bool transformConnection(InitConfigFileParser::Context & ctx, const char *); static bool applyDefaultValues(InitConfigFileParser::Context & ctx, const char *); static bool checkMandatory(InitConfigFileParser::Context & ctx, const char *); @@ -108,6 +111,11 @@ ConfigInfo::m_SectionRules[] = { { "REP", transformNode, 0 }, { "EXTERNAL REP", transformExtNode, 0 }, + { "TCP", checkConnectionSupport, 0 }, + { "SHM", checkConnectionSupport, 0 }, + { "SCI", checkConnectionSupport, 0 }, + { "OSE", checkConnectionSupport, 0 }, + { "TCP", transformConnection, 0 }, { "SHM", transformConnection, 0 }, { "SCI", transformConnection, 0 }, @@ -130,6 +138,8 @@ ConfigInfo::m_SectionRules[] = { { "TCP", fixHostname, "HostName1" }, { "TCP", fixHostname, "HostName2" }, + { "SHM", fixHostname, "HostName1" }, + { "SHM", fixHostname, "HostName2" }, { "SCI", fixHostname, "HostName1" }, { "SCI", fixHostname, "HostName2" }, { "SHM", fixHostname, "HostName1" }, @@ -197,6 +207,9 @@ static bool sanity_checks(Vector§ions, static bool add_node_connections(Vector§ions, struct InitConfigFileParser::Context &ctx, const char * rule_data); +static bool set_connection_priorities(Vector§ions, + struct InitConfigFileParser::Context &ctx, + const char * rule_data); static bool add_server_ports(Vector§ions, struct InitConfigFileParser::Context &ctx, const char * rule_data); @@ -208,6 +221,7 @@ const ConfigInfo::ConfigRule ConfigInfo::m_ConfigRules[] = { { sanity_checks, 0 }, { add_node_connections, 0 }, + { set_connection_priorities, 0 }, { add_server_ports, 0 }, { check_node_vs_replicas, 0 }, { 0, 0 } @@ -1582,6 +1596,17 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { MANDATORY, 0, 0 }, + { + CFG_CONNECTION_GROUP, + "Group", + "TCP", + "", + ConfigInfo::CI_USED, + false, + ConfigInfo::CI_INT, + "55", + "0", "200" }, + { CFG_CONNECTION_SEND_SIGNAL_ID, "SendSignalId", @@ -1747,6 +1772,17 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { MANDATORY, 0, 0 }, + { + CFG_CONNECTION_GROUP, + "Group", + "SHM", + "", + ConfigInfo::CI_USED, + false, + ConfigInfo::CI_INT, + "35", + "0", "200" }, + { CFG_CONNECTION_SEND_SIGNAL_ID, "SendSignalId", @@ -1780,7 +1816,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ConfigInfo::CI_USED, false, ConfigInfo::CI_INT, - MANDATORY, + "0", "0", STR_VALUE(MAX_INT_RNIL) }, @@ -1857,6 +1893,17 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "0", STR_VALUE(MAX_INT_RNIL) }, + { + CFG_CONNECTION_GROUP, + "Group", + "SCI", + "", + ConfigInfo::CI_USED, + false, + ConfigInfo::CI_INT, + "15", + "0", "200" }, + { CFG_CONNECTION_HOSTNAME_1, "HostName1", @@ -2680,12 +2727,51 @@ transformExtNode(InitConfigFileParser::Context & ctx, const char * data){ return true; } +/** + * Connection rule: Check support of connection + */ +bool +checkConnectionSupport(InitConfigFileParser::Context & ctx, const char * data) +{ + int error= 0; + if (strcasecmp("TCP",ctx.fname) == 0) + { + // always enabled + } + else if (strcasecmp("SHM",ctx.fname) == 0) + { +#ifndef NDB_SHM_TRANSPORTER + error= 1; +#endif + } + else if (strcasecmp("SCI",ctx.fname) == 0) + { +#ifndef NDB_SCI_TRANSPORTER + error= 1; +#endif + } + else if (strcasecmp("OSE",ctx.fname) == 0) + { +#ifndef NDB_OSE_TRANSPORTER + error= 1; +#endif + } + if (error) + { + ctx.reportError("Binary not compiled with this connection support, " + "[%s] starting at line: %d", + ctx.fname, ctx.m_sectionLineno); + return false; + } + return true; +} + /** * Connection rule: Update "NoOfConnections" */ bool -transformConnection(InitConfigFileParser::Context & ctx, const char * data){ - +transformConnection(InitConfigFileParser::Context & ctx, const char * data) +{ Uint32 connections = 0; ctx.m_userProperties.get("NoOfConnections", &connections); BaseString::snprintf(ctx.pname, sizeof(ctx.pname), "Connection_%d", connections); @@ -3398,11 +3484,51 @@ sanity_checks(Vector§ions, return true; } +static void +add_a_connection(Vector§ions, + struct InitConfigFileParser::Context &ctx, + Uint32 nodeId1, Uint32 nodeId2, bool use_shm) +{ + ConfigInfo::ConfigRuleSection s; + const char *hostname1= 0, *hostname2= 0; + const Properties *tmp; + + require(ctx.m_config->get("Node", nodeId1, &tmp)); + tmp->get("HostName", &hostname1); + + require(ctx.m_config->get("Node", nodeId2, &tmp)); + tmp->get("HostName", &hostname2); + + char buf[16]; + s.m_sectionData= new Properties(true); + BaseString::snprintf(buf, sizeof(buf), "%u", nodeId1); + s.m_sectionData->put("NodeId1", buf); + BaseString::snprintf(buf, sizeof(buf), "%u", nodeId2); + s.m_sectionData->put("NodeId2", buf); + + if (use_shm && + hostname1 && hostname1[0] && + hostname2 && hostname2[0] && + strcmp(hostname1,hostname2) == 0) + { + s.m_sectionType= BaseString("SHM"); + DBUG_PRINT("info",("adding SHM connection %d %d",nodeId1,nodeId2)); + } + else + { + s.m_sectionType= BaseString("TCP"); + DBUG_PRINT("info",("adding TCP connection %d %d",nodeId1,nodeId2)); + } + + sections.push_back(s); +} + static bool add_node_connections(Vector§ions, struct InitConfigFileParser::Context &ctx, const char * rule_data) { + DBUG_ENTER("add_node_connections"); Uint32 i; Properties * props= ctx.m_config; Properties p_connections(true); @@ -3427,9 +3553,10 @@ add_node_connections(Vector§ions, ctx.m_userProperties.get("NoOfNodes", &nNodes); Properties p_db_nodes(true); - Properties p_api_mgm_nodes(true); + Properties p_api_nodes(true); + Properties p_mgm_nodes(true); - Uint32 i_db= 0, i_api_mgm= 0, n; + Uint32 i_db= 0, i_api= 0, i_mgm= 0, n; for (i= 0, n= 0; n < nNodes; i++){ const Properties * tmp; if(!props->get("Node", i, &tmp)) continue; @@ -3440,9 +3567,10 @@ add_node_connections(Vector§ions, if (strcmp(type,DB_TOKEN) == 0) p_db_nodes.put("", i_db++, i); - else if (strcmp(type,API_TOKEN) == 0 || - strcmp(type,MGM_TOKEN) == 0) - p_api_mgm_nodes.put("", i_api_mgm++, i); + else if (strcmp(type,API_TOKEN) == 0) + p_api_nodes.put("", i_api++, i); + else if (strcmp(type,MGM_TOKEN) == 0) + p_mgm_nodes.put("", i_mgm++, i); } Uint32 nodeId1, nodeId2, dummy; @@ -3451,39 +3579,39 @@ add_node_connections(Vector§ions, for (Uint32 j= i+1;; j++){ if(!p_db_nodes.get("", j, &nodeId2)) break; if(!p_connections2.get("", nodeId1+nodeId2<<16, &dummy)) { - ConfigInfo::ConfigRuleSection s; - s.m_sectionType= BaseString("TCP"); - s.m_sectionData= new Properties(true); - char buf[16]; - BaseString::snprintf(buf, sizeof(buf), "%u", nodeId1); - s.m_sectionData->put("NodeId1", buf); - BaseString::snprintf(buf, sizeof(buf), "%u", nodeId2); - s.m_sectionData->put("NodeId2", buf); - sections.push_back(s); + add_a_connection(sections,ctx,nodeId1,nodeId2,opt_ndb_shm); } } } - for (i= 0; p_api_mgm_nodes.get("", i, &nodeId1); i++){ + for (i= 0; p_api_nodes.get("", i, &nodeId1); i++){ if(!p_connections.get("", nodeId1, &dummy)) { for (Uint32 j= 0;; j++){ if(!p_db_nodes.get("", j, &nodeId2)) break; - ConfigInfo::ConfigRuleSection s; - s.m_sectionType= BaseString("TCP"); - s.m_sectionData= new Properties(true); - char buf[16]; - BaseString::snprintf(buf, sizeof(buf), "%u", nodeId1); - s.m_sectionData->put("NodeId1", buf); - BaseString::snprintf(buf, sizeof(buf), "%u", nodeId2); - s.m_sectionData->put("NodeId2", buf); - sections.push_back(s); + add_a_connection(sections,ctx,nodeId1,nodeId2,opt_ndb_shm); } } } - return true; + for (i= 0; p_mgm_nodes.get("", i, &nodeId1); i++){ + if(!p_connections.get("", nodeId1, &dummy)) { + for (Uint32 j= 0;; j++){ + if(!p_db_nodes.get("", j, &nodeId2)) break; + add_a_connection(sections,ctx,nodeId1,nodeId2,0); + } + } + } + + DBUG_RETURN(true); } +static bool set_connection_priorities(Vector§ions, + struct InitConfigFileParser::Context &ctx, + const char * rule_data) +{ + DBUG_ENTER("set_connection_priorities"); + DBUG_RETURN(true); +} static bool add_server_ports(Vector§ions, struct InitConfigFileParser::Context &ctx, diff --git a/ndb/src/mgmsrv/MgmtSrvr.cpp b/ndb/src/mgmsrv/MgmtSrvr.cpp index 713dff912bb..3fcde997cb0 100644 --- a/ndb/src/mgmsrv/MgmtSrvr.cpp +++ b/ndb/src/mgmsrv/MgmtSrvr.cpp @@ -2225,9 +2225,24 @@ MgmtSrvr::alloc_node_id(NodeId * nodeId, if (*nodeId != 0 || type != NDB_MGM_NODE_TYPE_MGM || no_mgm == 1) { // any match is ok + + if (config_hostname == 0 && + *nodeId == 0 && + type != NDB_MGM_NODE_TYPE_MGM) + { + if (!id_found) // only set if not set earlier + id_found= tmp; + continue; /* continue looking for a nodeid with specified + * hostname + */ + } + assert(id_found == 0); id_found= tmp; break; } + assert(no_mgm > 1); + assert(*nodeId != 0); + assert(type != NDB_MGM_NODE_TYPE_MGM); if (id_found) { // mgmt server may only have one match error_string.appfmt("Ambiguous node id's %d and %d.\n" "Suggest specifying node id in connectstring,\n" diff --git a/ndb/src/mgmsrv/main.cpp b/ndb/src/mgmsrv/main.cpp index 992e827ceaa..04c95117214 100644 --- a/ndb/src/mgmsrv/main.cpp +++ b/ndb/src/mgmsrv/main.cpp @@ -89,50 +89,50 @@ bool g_StopServer; extern EventLogger g_EventLogger; extern int global_mgmt_server_check; -static char *opt_connect_str= 0; + +enum ndb_mgmd_options { + NDB_STD_OPTS_OPTIONS, + OPT_INTERACTIVE, + OPT_NO_NODEID_CHECKS, + OPT_NO_DAEMON +}; +NDB_STD_OPTS_VARS; + +#if NDB_VERSION_MAJOR <= 4 +#undef OPT_NDB_CONNECTSTRING +#define OPT_NDB_CONNECTSTRING 1023 +#else + +#endif static struct my_option my_long_options[] = { -#ifndef DBUG_OFF - { "debug", '#', "Output debug log. Often this is 'd:t:o,filename'.", - 0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0 }, -#endif - { "usage", '?', "Display this help and exit.", - 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 }, - { "help", '?', "Display this help and exit.", - 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 }, - { "version", 'V', "Output version information and exit.", 0, 0, 0, - GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 }, - { "ndb-connectstring", 1023, - "Set connect string for connecting to ndb_mgmd. " - "Syntax: \"[nodeid=;][host=][:]\". " - "Overides specifying entries in NDB_CONNECTSTRING and Ndb.cfg", - (gptr*) &opt_connect_str, (gptr*) &opt_connect_str, 0, - GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, - { "connect-string", 1023, - "same as --ndb-connectstring.", - (gptr*) &opt_connect_str, (gptr*) &opt_connect_str, 0, - GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, + NDB_STD_OPTS("ndb_mgmd"), { "config-file", 'f', "Specify cluster configuration file", (gptr*) &glob.config_filename, (gptr*) &glob.config_filename, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, { "daemon", 'd', "Run ndb_mgmd in daemon mode (default)", (gptr*) &glob.daemon, (gptr*) &glob.daemon, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0 }, - { "interactive", 256, "Run interactive. Not supported but provided for testing purposes", + { "interactive", OPT_INTERACTIVE, + "Run interactive. Not supported but provided for testing purposes", (gptr*) &glob.interactive, (gptr*) &glob.interactive, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 }, - { "no-nodeid-checks", 257, "Do not provide any node id checks", + { "no-nodeid-checks", OPT_NO_NODEID_CHECKS, + "Do not provide any node id checks", (gptr*) &g_no_nodeid_checks, (gptr*) &g_no_nodeid_checks, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 }, - { "nodaemon", 258, "Don't run as daemon, but don't read from stdin", + { "nodaemon", OPT_NO_DAEMON, + "Don't run as daemon, but don't read from stdin", (gptr*) &glob.non_interactive, (gptr*) &glob.non_interactive, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 }, +#if NDB_VERSION_MAJOR <= 4 { "config-file", 'c', "-c provided for backwards compatability, will be removed in 5.0." " Use -f instead", (gptr*) &glob.config_filename, (gptr*) &glob.config_filename, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, +#endif { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} }; static void short_usage_sub(void) @@ -164,6 +164,14 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), case 'c': printf("Warning: -c will be removed in 5.0, use -f instead\n"); break; + case OPT_NDB_SHM: +#ifndef NDB_SHM_TRANSPORTER + printf("Warning: binary not compiled with shared memory support,\n" + "use configure option --with-ndb-shm to enable support.\n" + "Tcp connections will now be used instead\n"); + opt_ndb_shm= 0; +#endif + break; case '?': usage(); exit(0); diff --git a/ndb/src/ndbapi/DictCache.hpp b/ndb/src/ndbapi/DictCache.hpp index a517acee56b..58c08a93e61 100644 --- a/ndb/src/ndbapi/DictCache.hpp +++ b/ndb/src/ndbapi/DictCache.hpp @@ -25,6 +25,7 @@ #include #include #include +#include #include "NdbLinHash.hpp" class Ndb_local_table_info { diff --git a/ndb/src/ndbapi/Ndb.cpp b/ndb/src/ndbapi/Ndb.cpp index ca4592fb5eb..e9a125922c6 100644 --- a/ndb/src/ndbapi/Ndb.cpp +++ b/ndb/src/ndbapi/Ndb.cpp @@ -46,7 +46,6 @@ Connect to any node which has no connection at the moment. NdbConnection* Ndb::doConnect(Uint32 tConNode) { Uint32 tNode; - Uint32 i = 0;; Uint32 tAnyAlive = 0; int TretCode; @@ -65,26 +64,51 @@ NdbConnection* Ndb::doConnect(Uint32 tConNode) // We will connect to any node. Make sure that we have connections to all // nodes. //**************************************************************************** - Uint32 tNoOfDbNodes= theImpl->theNoOfDBnodes; - Uint32 &theCurrentConnectIndex= theImpl->theCurrentConnectIndex; - UintR Tcount = 0; - do { - theCurrentConnectIndex++; - if (theCurrentConnectIndex >= tNoOfDbNodes) { - theCurrentConnectIndex = 0; - }//if - Tcount++; - tNode = theImpl->theDBnodes[theCurrentConnectIndex]; - TretCode = NDB_connect(tNode); - if ((TretCode == 1) || (TretCode == 2)) { + if (theImpl->m_optimized_node_selection) + { + Ndb_cluster_connection_node_iter &node_iter= + theImpl->m_node_iter; + theImpl->m_ndb_cluster_connection.init_get_next_node(node_iter); + while ((tNode= theImpl->m_ndb_cluster_connection.get_next_node(node_iter))) + { + TretCode= NDB_connect(tNode); + if ((TretCode == 1) || + (TretCode == 2)) + { //**************************************************************************** // We have connections now to the desired node. Return //**************************************************************************** - return getConnectedNdbConnection(tNode); - } else if (TretCode != 0) { - tAnyAlive = 1; - }//if - } while (Tcount < tNoOfDbNodes); + return getConnectedNdbConnection(tNode); + } else if (TretCode != 0) { + tAnyAlive= 1; + }//if + } + } + else // just do a regular round robin + { + Uint32 tNoOfDbNodes= theImpl->theNoOfDBnodes; + Uint32 &theCurrentConnectIndex= theImpl->theCurrentConnectIndex; + UintR Tcount = 0; + do { + theCurrentConnectIndex++; + if (theCurrentConnectIndex >= tNoOfDbNodes) + theCurrentConnectIndex = 0; + + Tcount++; + tNode= theImpl->theDBnodes[theCurrentConnectIndex]; + TretCode= NDB_connect(tNode); + if ((TretCode == 1) || + (TretCode == 2)) + { +//**************************************************************************** +// We have connections now to the desired node. Return +//**************************************************************************** + return getConnectedNdbConnection(tNode); + } else if (TretCode != 0) { + tAnyAlive= 1; + }//if + } while (Tcount < tNoOfDbNodes); + } //**************************************************************************** // We were unable to find a free connection. If no node alive we will report // error code for cluster failure otherwise connection failure. @@ -149,8 +173,8 @@ Ndb::NDB_connect(Uint32 tNode) tReturnCode = tp->sendSignal(tSignal, tNode); releaseSignal(tSignal); if (tReturnCode != -1) { - theWaiter.m_node = tNode; - theWaiter.m_state = WAIT_TC_SEIZE; + theImpl->theWaiter.m_node = tNode; + theImpl->theWaiter.m_state = WAIT_TC_SEIZE; tReturnCode = receiveResponse(); }//if } else { @@ -243,50 +267,28 @@ Ndb::waitUntilReady(int timeout) DBUG_RETURN(-1); } - do { - if ((id = theNode) != 0) { - unsigned int foundAliveNode = 0; - TransporterFacade *tp = TransporterFacade::instance(); - tp->lock_mutex(); - for (unsigned int i = 0; i < theImpl->theNoOfDBnodes; i++) { - const NodeId nodeId = theImpl->theDBnodes[i]; - //************************************************ - // If any node is answering, ndb is answering - //************************************************ - if (tp->get_node_alive(nodeId) != 0) { - foundAliveNode++; - }//if - }//for - - tp->unlock_mutex(); - if (foundAliveNode == theImpl->theNoOfDBnodes) { - DBUG_RETURN(0); - }//if - if (foundAliveNode > 0) { - noChecksSinceFirstAliveFound++; - }//if - if (noChecksSinceFirstAliveFound > 30) { - DBUG_RETURN(0); - }//if - }//if theNode != 0 + while (theNode == 0) { if (secondsCounter >= timeout) - break; + { + theError.code = 4269; + DBUG_RETURN(-1); + } NdbSleep_MilliSleep(100); milliCounter += 100; if (milliCounter >= 1000) { secondsCounter++; milliCounter = 0; }//if - } while (1); - if (id == 0) { - theError.code = 4269; + } + + if (theImpl->m_ndb_cluster_connection.wait_until_ready + (timeout-secondsCounter,30)) + { + theError.code = 4009; DBUG_RETURN(-1); } - if (noChecksSinceFirstAliveFound > 0) { - DBUG_RETURN(0); - }//if - theError.code = 4009; - DBUG_RETURN(-1); + + DBUG_RETURN(0); } /***************************************************************************** @@ -311,8 +313,8 @@ Ndb::startTransaction(Uint32 aPriority, const char * keyData, Uint32 keyLen) */ Uint32 nodeId; if(keyData != 0) { - Uint32 fragmentId = computeFragmentId(keyData, keyLen); - nodeId = guessPrimaryNode(fragmentId); + nodeId = 0; // guess not supported + // nodeId = m_ndb_cluster_connection->guess_primary_node(keyData, keyLen); } else { nodeId = 0; }//if @@ -373,44 +375,6 @@ Ndb::hupp(NdbConnection* pBuddyTrans) }//if }//Ndb::hupp() -NdbConnection* -Ndb::startTransactionDGroup(Uint32 aPriority, const char * keyData, int type) -{ - - char DGroup[4]; - if ((keyData == NULL) || - (type > 1)) { - theError.code = 4118; - return NULL; - }//if - if (theInitState == Initialised) { - theError.code = 0; - checkFailedNode(); - /** - * If the user supplied key data - * We will make a qualified quess to which node is the primary for the - * the fragment and contact that node - */ - Uint32 fragmentId; - if (type == 0) { - DGroup[0] = keyData[0]; - DGroup[1] = keyData[1]; - DGroup[2] = 0x30; - DGroup[3] = 0x30; - fragmentId = computeFragmentId(&DGroup[0], 4); - } else { - Uint32 hashValue = ((keyData[0] - 0x30) * 10) + (keyData[1] - 0x30); - fragmentId = getFragmentId(hashValue); - }//if - Uint32 nodeId = guessPrimaryNode(fragmentId); - NdbConnection* trans= startTransactionLocal(aPriority, nodeId); - DBUG_PRINT("exit", ("start DGroup trans: 0x%x transid: 0x%llx", - trans, trans ? trans->getTransactionId() : 0)); - return trans; - } else { - return NULL; - }//if -}//Ndb::startTransaction() NdbConnection* Ndb::startTransactionLocal(Uint32 aPriority, Uint32 nodeId) @@ -1010,118 +974,6 @@ Ndb::opTupleIdOnNdb(Uint32 aTableId, Uint64 opValue, Uint32 op) return ~0; } -static const Uint32 MAX_KEY_LEN_64_WORDS = 4; -static const Uint32 MAX_KEY_LEN_32_WORDS = 8; -static const Uint32 MAX_KEY_LEN_BYTES = 32; - -Uint32 -Ndb::computeFragmentId(const char * keyData, Uint32 keyLen) -{ - Uint64 tempData[MAX_KEY_LEN_64_WORDS]; - - const Uint32 usedKeyLen = (keyLen + 3) >> 2; // In words - const char * usedKeyData = 0; - - /** - * If key data buffer is not aligned (on 64 bit boundary) - * or key len is not a multiple of 4 - * Use temp data - */ - if(((((UintPtr)keyData) & 7) == 0) && ((keyLen & 3) == 0)) { - usedKeyData = keyData; - } else { - memcpy(&tempData[0], keyData, keyLen); - const int slack = keyLen & 3; - if(slack > 0) { - memset(&((char *)&tempData[0])[keyLen], 0, (4 - slack)); - }//if - usedKeyData = (char *)&tempData[0]; - }//if - - Uint32 hashValue = md5_hash((Uint64 *)usedKeyData, usedKeyLen); - - hashValue >>= startTransactionNodeSelectionData.kValue; - return getFragmentId(hashValue); -}//Ndb::computeFragmentId() - -Uint32 -Ndb::getFragmentId(Uint32 hashValue) -{ - Uint32 fragmentId = hashValue & - startTransactionNodeSelectionData.hashValueMask; - if(fragmentId < startTransactionNodeSelectionData.hashpointerValue) { - fragmentId = hashValue & - ((startTransactionNodeSelectionData.hashValueMask << 1) + 1); - }//if - return fragmentId; -} - -Uint32 -Ndb::guessPrimaryNode(Uint32 fragmentId){ - //ASSERT(((fragmentId > 0) && fragmentId < - // startTransactionNodeSelectionData.noOfFragments), "Invalid fragementId"); - - return startTransactionNodeSelectionData.fragment2PrimaryNodeMap[fragmentId]; -} - -void -Ndb::StartTransactionNodeSelectionData::init(Uint32 noOfNodes, - Uint8 nodeIds[]) { - kValue = 6; - noOfFragments = 2 * noOfNodes; - - /** - * Compute hashValueMask and hashpointerValue - */ - { - Uint32 topBit = (1 << 31); - for(int i = 31; i>=0; i--){ - if((noOfFragments & topBit) != 0) - break; - topBit >>= 1; - } - hashValueMask = topBit - 1; - hashpointerValue = noOfFragments - (hashValueMask + 1); - } - - /** - * This initialization depends on - * the fact that: - * primary node for fragment i = i % noOfNodes - * - * This algorithm should be implemented in Dbdih - */ - { - if (fragment2PrimaryNodeMap != 0) - abort(); - - fragment2PrimaryNodeMap = new Uint32[noOfFragments]; - Uint32 i; - for(i = 0; i fragment2PrimaryNodeMap[j]){ - Uint32 tmp = fragment2PrimaryNodeMap[i]; - fragment2PrimaryNodeMap[i] = fragment2PrimaryNodeMap[j]; - fragment2PrimaryNodeMap[j] = tmp; - } - - for(i = 0; i #include #include -#include "NdbImpl.hpp" +#include "NdbWaiter.hpp" #include "DictCache.hpp" class NdbDictObjectImpl { diff --git a/ndb/src/ndbapi/NdbImpl.hpp b/ndb/src/ndbapi/NdbImpl.hpp index 21a4706f890..00a8ef19f3a 100644 --- a/ndb/src/ndbapi/NdbImpl.hpp +++ b/ndb/src/ndbapi/NdbImpl.hpp @@ -17,7 +17,9 @@ #ifndef NDB_IMPL_HPP #define NDB_IMPL_HPP +#include #include +#include #include #include #include @@ -26,6 +28,8 @@ #include +#include "ndb_cluster_connection_impl.hpp" +#include "NdbDictionaryImpl.hpp" #include "ObjectMap.hpp" /** @@ -33,11 +37,16 @@ */ class NdbImpl { public: - NdbImpl(); + NdbImpl(Ndb_cluster_connection *, Ndb&); ~NdbImpl(); + Ndb_cluster_connection_impl &m_ndb_cluster_connection; + + NdbDictionaryImpl m_dictionary; + // Ensure good distribution of connects Uint32 theCurrentConnectIndex; + Ndb_cluster_connection_node_iter m_node_iter; NdbObjectIdMap theNdbObjectIdMap; @@ -46,6 +55,10 @@ public: // 1 indicates to release all connections to node Uint32 the_release_ind[MAX_NDB_NODES]; + + NdbWaiter theWaiter; + + int m_optimized_node_selection; }; #ifdef VM_TRACE @@ -113,26 +126,6 @@ Ndb::checkInitState() Uint32 convertEndian(Uint32 Data); -enum WaitSignalType { - NO_WAIT = 0, - WAIT_NODE_FAILURE = 1, // Node failure during wait - WST_WAIT_TIMEOUT = 2, // Timeout during wait - - WAIT_TC_SEIZE = 3, - WAIT_TC_RELEASE = 4, - WAIT_NDB_TAMPER = 5, - WAIT_SCAN = 6, - - // DICT stuff - WAIT_GET_TAB_INFO_REQ = 11, - WAIT_CREATE_TAB_REQ = 12, - WAIT_DROP_TAB_REQ = 13, - WAIT_ALTER_TAB_REQ = 14, - WAIT_CREATE_INDX_REQ = 15, - WAIT_DROP_INDX_REQ = 16, - WAIT_LIST_TABLES_CONF = 17 -}; - enum LockMode { Read, Update, @@ -140,44 +133,4 @@ enum LockMode { Delete }; -#include - -inline -void -NdbWaiter::wait(int waitTime) -{ - const bool forever = (waitTime == -1); - const NDB_TICKS maxTime = NdbTick_CurrentMillisecond() + waitTime; - while (1) { - if (m_state == NO_WAIT || m_state == WAIT_NODE_FAILURE) - break; - if (forever) { - NdbCondition_Wait(m_condition, (NdbMutex*)m_mutex); - } else { - if (waitTime <= 0) { - m_state = WST_WAIT_TIMEOUT; - break; - } - NdbCondition_WaitTimeout(m_condition, (NdbMutex*)m_mutex, waitTime); - waitTime = maxTime - NdbTick_CurrentMillisecond(); - } - } -} - -inline -void -NdbWaiter::nodeFail(Uint32 aNodeId){ - if (m_state != NO_WAIT && m_node == aNodeId){ - m_state = WAIT_NODE_FAILURE; - NdbCondition_Signal(m_condition); - } -} - -inline -void -NdbWaiter::signal(Uint32 state){ - m_state = state; - NdbCondition_Signal(m_condition); -} - #endif diff --git a/ndb/src/ndbapi/NdbScanOperation.cpp b/ndb/src/ndbapi/NdbScanOperation.cpp index 88208409c08..a90c9f524a2 100644 --- a/ndb/src/ndbapi/NdbScanOperation.cpp +++ b/ndb/src/ndbapi/NdbScanOperation.cpp @@ -528,8 +528,8 @@ int NdbScanOperation::nextResult(bool fetchAllowed, bool forceSend) /** * No completed... */ - theNdb->theWaiter.m_node = nodeId; - theNdb->theWaiter.m_state = WAIT_SCAN; + theNdb->theImpl->theWaiter.m_node = nodeId; + theNdb->theImpl->theWaiter.m_state = WAIT_SCAN; int return_code = theNdb->receiveResponse(WAITFOR_SCAN_TIMEOUT); if (return_code == 0 && seq == tp->getNodeSequence(nodeId)) { continue; @@ -1358,8 +1358,8 @@ NdbIndexScanOperation::next_result_ordered(bool fetchAllowed, Uint32 tmp = m_sent_receivers_count; s_idx = m_current_api_receiver; while(m_sent_receivers_count > 0 && !theError.code){ - theNdb->theWaiter.m_node = nodeId; - theNdb->theWaiter.m_state = WAIT_SCAN; + theNdb->theImpl->theWaiter.m_node = nodeId; + theNdb->theImpl->theWaiter.m_state = WAIT_SCAN; int return_code = theNdb->receiveResponse(WAITFOR_SCAN_TIMEOUT); if (return_code == 0 && seq == tp->getNodeSequence(nodeId)) { continue; @@ -1506,8 +1506,8 @@ NdbScanOperation::close_impl(TransporterFacade* tp, bool forceSend){ */ while(theError.code == 0 && m_sent_receivers_count) { - theNdb->theWaiter.m_node = nodeId; - theNdb->theWaiter.m_state = WAIT_SCAN; + theNdb->theImpl->theWaiter.m_node = nodeId; + theNdb->theImpl->theWaiter.m_state = WAIT_SCAN; int return_code = theNdb->receiveResponse(WAITFOR_SCAN_TIMEOUT); switch(return_code){ case 0: @@ -1576,8 +1576,8 @@ NdbScanOperation::close_impl(TransporterFacade* tp, bool forceSend){ */ while(m_sent_receivers_count+m_api_receivers_count+m_conf_receivers_count) { - theNdb->theWaiter.m_node = nodeId; - theNdb->theWaiter.m_state = WAIT_SCAN; + theNdb->theImpl->theWaiter.m_node = nodeId; + theNdb->theImpl->theWaiter.m_state = WAIT_SCAN; int return_code = theNdb->receiveResponse(WAITFOR_SCAN_TIMEOUT); switch(return_code){ case 0: diff --git a/ndb/src/ndbapi/NdbWaiter.hpp b/ndb/src/ndbapi/NdbWaiter.hpp new file mode 100644 index 00000000000..8b7b2a75879 --- /dev/null +++ b/ndb/src/ndbapi/NdbWaiter.hpp @@ -0,0 +1,102 @@ +/* Copyright (C) 2003 MySQL AB + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef NDB_WAITER_HPP +#define NDB_WAITER_HPP + +#include +#include +#include +#include +#include +#include +#include + +#include + +enum WaitSignalType { + NO_WAIT = 0, + WAIT_NODE_FAILURE = 1, // Node failure during wait + WST_WAIT_TIMEOUT = 2, // Timeout during wait + + WAIT_TC_SEIZE = 3, + WAIT_TC_RELEASE = 4, + WAIT_NDB_TAMPER = 5, + WAIT_SCAN = 6, + + // DICT stuff + WAIT_GET_TAB_INFO_REQ = 11, + WAIT_CREATE_TAB_REQ = 12, + WAIT_DROP_TAB_REQ = 13, + WAIT_ALTER_TAB_REQ = 14, + WAIT_CREATE_INDX_REQ = 15, + WAIT_DROP_INDX_REQ = 16, + WAIT_LIST_TABLES_CONF = 17 +}; + +class NdbWaiter { +public: + NdbWaiter(); + ~NdbWaiter(); + + void wait(int waitTime); + void nodeFail(Uint32 node); + void signal(Uint32 state); + + Uint32 m_node; + Uint32 m_state; + void * m_mutex; + struct NdbCondition * m_condition; +}; + +inline +void +NdbWaiter::wait(int waitTime) +{ + const bool forever = (waitTime == -1); + const NDB_TICKS maxTime = NdbTick_CurrentMillisecond() + waitTime; + while (1) { + if (m_state == NO_WAIT || m_state == WAIT_NODE_FAILURE) + break; + if (forever) { + NdbCondition_Wait(m_condition, (NdbMutex*)m_mutex); + } else { + if (waitTime <= 0) { + m_state = WST_WAIT_TIMEOUT; + break; + } + NdbCondition_WaitTimeout(m_condition, (NdbMutex*)m_mutex, waitTime); + waitTime = maxTime - NdbTick_CurrentMillisecond(); + } + } +} + +inline +void +NdbWaiter::nodeFail(Uint32 aNodeId){ + if (m_state != NO_WAIT && m_node == aNodeId){ + m_state = WAIT_NODE_FAILURE; + NdbCondition_Signal(m_condition); + } +} + +inline +void +NdbWaiter::signal(Uint32 state){ + m_state = state; + NdbCondition_Signal(m_condition); +} + +#endif diff --git a/ndb/src/ndbapi/Ndbif.cpp b/ndb/src/ndbapi/Ndbif.cpp index 232e55662f0..a4f233709c4 100644 --- a/ndb/src/ndbapi/Ndbif.cpp +++ b/ndb/src/ndbapi/Ndbif.cpp @@ -209,8 +209,6 @@ void Ndb::connected(Uint32 ref) tmpTheNode, theImpl->theNoOfDBnodes, theFirstTransId)); - startTransactionNodeSelectionData.init(theImpl->theNoOfDBnodes, - theImpl->theDBnodes); theCommitAckSignal = new NdbApiSignal(theMyRef); theDictionary->m_receiver.m_reference= theMyRef; @@ -251,7 +249,7 @@ Ndb::report_node_failure(Uint32 node_id) theImpl->the_release_ind[node_id] = 1; // must come after theImpl->the_release_ind[0] = 1; - theWaiter.nodeFail(node_id); + theImpl->theWaiter.nodeFail(node_id); return; }//Ndb::report_node_failure() @@ -330,7 +328,7 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3]) NdbConnection* tCon; int tReturnCode = -1; const Uint32* tDataPtr = aSignal->getDataPtr(); - const Uint32 tWaitState = theWaiter.m_state; + const Uint32 tWaitState = theImpl->theWaiter.m_state; const Uint32 tSignalNumber = aSignal->readSignalNumber(); const Uint32 tFirstData = *tDataPtr; const Uint32 tLen = aSignal->getLength(); @@ -401,7 +399,7 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3]) break; case NdbReceiver::NDB_SCANRECEIVER: tCon->theScanningOp->receiver_delivered(tRec); - theWaiter.m_state = (((WaitSignalType) tWaitState) == WAIT_SCAN ? + theImpl->theWaiter.m_state = (((WaitSignalType) tWaitState) == WAIT_SCAN ? (Uint32) NO_WAIT : tWaitState); break; default: @@ -598,7 +596,7 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3]) }//if tReturnCode = tCon->receiveTCSEIZECONF(aSignal); if (tReturnCode != -1) { - theWaiter.m_state = NO_WAIT; + theImpl->theWaiter.m_state = NO_WAIT; } else { goto InvalidSignal; }//if @@ -618,7 +616,7 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3]) }//if tReturnCode = tCon->receiveTCSEIZEREF(aSignal); if (tReturnCode != -1) { - theWaiter.m_state = NO_WAIT; + theImpl->theWaiter.m_state = NO_WAIT; } else { return; }//if @@ -638,7 +636,7 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3]) }//if tReturnCode = tCon->receiveTCRELEASECONF(aSignal); if (tReturnCode != -1) { - theWaiter.m_state = NO_WAIT; + theImpl->theWaiter.m_state = NO_WAIT; }//if break; } @@ -656,7 +654,7 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3]) }//if tReturnCode = tCon->receiveTCRELEASEREF(aSignal); if (tReturnCode != -1) { - theWaiter.m_state = NO_WAIT; + theImpl->theWaiter.m_state = NO_WAIT; }//if break; } @@ -708,7 +706,7 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3]) return; tReturnCode = tCon->receiveDIHNDBTAMPER(aSignal); if (tReturnCode != -1) - theWaiter.m_state = NO_WAIT; + theImpl->theWaiter.m_state = NO_WAIT; break; } case GSN_SCAN_TABCONF: @@ -730,7 +728,7 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3]) tLen - ScanTabConf::SignalLength); } if (tReturnCode != -1 && tWaitState == WAIT_SCAN) - theWaiter.m_state = NO_WAIT; + theImpl->theWaiter.m_state = NO_WAIT; break; } else { goto InvalidSignal; @@ -749,7 +747,7 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3]) if (tCon->checkMagicNumber() == 0){ tReturnCode = tCon->receiveSCAN_TABREF(aSignal); if (tReturnCode != -1 && tWaitState == WAIT_SCAN){ - theWaiter.m_state = NO_WAIT; + theImpl->theWaiter.m_state = NO_WAIT; } break; } @@ -774,7 +772,7 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3]) switch(com){ case 1: tCon->theScanningOp->receiver_delivered(tRec); - theWaiter.m_state = (((WaitSignalType) tWaitState) == WAIT_SCAN ? + theImpl->theWaiter.m_state = (((WaitSignalType) tWaitState) == WAIT_SCAN ? (Uint32) NO_WAIT : tWaitState); break; case 0: @@ -838,16 +836,16 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3]) goto InvalidSignal; }//switch - if (theWaiter.m_state == NO_WAIT) { + if (theImpl->theWaiter.m_state == NO_WAIT) { // Wake up the thread waiting for response - NdbCondition_Signal(theWaiter.m_condition); + NdbCondition_Signal(theImpl->theWaiter.m_condition); }//if return; InvalidSignal: #ifdef VM_TRACE ndbout_c("Ndbif: Error Ndb::handleReceivedSignal " - "(GSN=%d, theWaiter.m_state=%d)" + "(GSN=%d, theImpl->theWaiter.m_state=%d)" " sender = (Block: %d Node: %d)", tSignalNumber, tWaitState, @@ -895,7 +893,7 @@ Ndb::completedTransaction(NdbConnection* aCon) if ((theMinNoOfEventsToWakeUp != 0) && (theNoOfCompletedTransactions >= theMinNoOfEventsToWakeUp)) { theMinNoOfEventsToWakeUp = 0; - NdbCondition_Signal(theWaiter.m_condition); + NdbCondition_Signal(theImpl->theWaiter.m_condition); return; }//if } else { @@ -1155,9 +1153,9 @@ void Ndb::waitCompletedTransactions(int aMilliSecondsToWait, int noOfEventsToWaitFor) { - theWaiter.m_state = NO_WAIT; + theImpl->theWaiter.m_state = NO_WAIT; /** - * theWaiter.m_state = NO_WAIT; + * theImpl->theWaiter.m_state = NO_WAIT; * To ensure no messup with synchronous node fail handling * (see ReportFailure) */ @@ -1166,8 +1164,8 @@ Ndb::waitCompletedTransactions(int aMilliSecondsToWait, theMinNoOfEventsToWakeUp = noOfEventsToWaitFor; do { if (waitTime < 1000) waitTime = 1000; - NdbCondition_WaitTimeout(theWaiter.m_condition, - (NdbMutex*)theWaiter.m_mutex, + NdbCondition_WaitTimeout(theImpl->theWaiter.m_condition, + (NdbMutex*)theImpl->theWaiter.m_mutex, waitTime); if (theNoOfCompletedTransactions >= (Uint32)noOfEventsToWaitFor) { break; @@ -1273,23 +1271,23 @@ Ndb::receiveResponse(int waitTime){ int tResultCode; TransporterFacade::instance()->checkForceSend(theNdbBlockNumber); - theWaiter.wait(waitTime); + theImpl->theWaiter.wait(waitTime); - if(theWaiter.m_state == NO_WAIT) { + if(theImpl->theWaiter.m_state == NO_WAIT) { tResultCode = 0; } else { #ifdef VM_TRACE - ndbout << "ERR: receiveResponse - theWaiter.m_state = "; - ndbout << theWaiter.m_state << endl; + ndbout << "ERR: receiveResponse - theImpl->theWaiter.m_state = "; + ndbout << theImpl->theWaiter.m_state << endl; #endif - if (theWaiter.m_state == WAIT_NODE_FAILURE){ + if (theImpl->theWaiter.m_state == WAIT_NODE_FAILURE){ tResultCode = -2; } else { tResultCode = -1; } - theWaiter.m_state = NO_WAIT; + theImpl->theWaiter.m_state = NO_WAIT; } return tResultCode; }//Ndb::receiveResponse() @@ -1321,8 +1319,8 @@ Ndb::sendRecSignal(Uint16 node_id, if (tp->check_send_size(node_id, send_size)) { return_code = tp->sendSignal(aSignal, node_id); if (return_code != -1) { - theWaiter.m_node = node_id; - theWaiter.m_state = aWaitState; + theImpl->theWaiter.m_node = node_id; + theImpl->theWaiter.m_state = aWaitState; return_code = receiveResponse(); } else { return_code = -3; diff --git a/ndb/src/ndbapi/Ndbinit.cpp b/ndb/src/ndbapi/Ndbinit.cpp index 9754c25ab15..e1af7bd4cc5 100644 --- a/ndb/src/ndbapi/Ndbinit.cpp +++ b/ndb/src/ndbapi/Ndbinit.cpp @@ -50,7 +50,9 @@ Ndb(const char* aDataBase); Parameters: aDataBase : Name of the database. Remark: Connect to the database. ***************************************************************************/ -Ndb::Ndb( const char* aDataBase , const char* aSchema) { +Ndb::Ndb( const char* aDataBase , const char* aSchema) + : theImpl(NULL) +{ DBUG_ENTER("Ndb::Ndb()"); DBUG_PRINT("enter",("(old)Ndb::Ndb this=0x%x", this)); if (theNoOfNdbObjects < 0) @@ -66,6 +68,7 @@ Ndb::Ndb( const char* aDataBase , const char* aSchema) { Ndb::Ndb( Ndb_cluster_connection *ndb_cluster_connection, const char* aDataBase , const char* aSchema) + : theImpl(NULL) { DBUG_ENTER("Ndb::Ndb()"); DBUG_PRINT("enter",("Ndb::Ndb this=0x%x", this)); @@ -82,7 +85,10 @@ void Ndb::setup(Ndb_cluster_connection *ndb_cluster_connection, { DBUG_ENTER("Ndb::setup"); - m_ndb_cluster_connection= ndb_cluster_connection; + assert(theImpl == NULL); + theImpl= new NdbImpl(ndb_cluster_connection,*this); + theDictionary= &(theImpl->m_dictionary); + thePreparedTransactionsArray= NULL; theSentTransactionsArray= NULL; theCompletedTransactionsArray= NULL; @@ -93,8 +99,6 @@ void Ndb::setup(Ndb_cluster_connection *ndb_cluster_connection, theMaxNoOfTransactions= 0; theMinNoOfEventsToWakeUp= 0; prefixEnd= NULL; - theImpl= NULL; - theDictionary= NULL; theConIdleList= NULL; theOpIdleList= NULL; theScanOpIdleList= NULL; @@ -153,14 +157,12 @@ void Ndb::setup(Ndb_cluster_connection *ndb_cluster_connection, prefixEnd = prefixName + (len < (int) sizeof(prefixName) ? len : sizeof(prefixName) - 1); - theWaiter.m_mutex = TransporterFacade::instance()->theMutexPtr; + theImpl->theWaiter.m_mutex = TransporterFacade::instance()->theMutexPtr; // Signal that the constructor has finished OK if (theInitState == NotConstructed) theInitState = NotInitialised; - theImpl = new NdbImpl(); - { NdbGlobalEventBufferHandle *h= NdbGlobalEventBuffer_init(NDB_MAX_ACTIVE_EVENTS); @@ -171,11 +173,6 @@ void Ndb::setup(Ndb_cluster_connection *ndb_cluster_connection, theGlobalEventBufferHandle = h; } - theDictionary = new NdbDictionaryImpl(*this); - if (theDictionary == NULL) { - ndbout_c("Ndb cailed to allocate dictionary"); - exit(-1); - } DBUG_VOID_RETURN; } @@ -201,8 +198,6 @@ Ndb::~Ndb() DBUG_PRINT("enter",("Ndb::~Ndb this=0x%x",this)); doDisconnect(); - delete theDictionary; - NdbGlobalEventBuffer_drop(theGlobalEventBufferHandle); if (TransporterFacade::instance() != NULL && theNdbBlockNumber > 0){ @@ -245,7 +240,6 @@ Ndb::~Ndb() freeSignal(); releaseTransactionArrays(); - startTransactionNodeSelectionData.release(); delete []theConnectionArray; if(theCommitAckSignal != NULL){ @@ -292,14 +286,20 @@ NdbWaiter::~NdbWaiter(){ NdbCondition_Destroy(m_condition); } -NdbImpl::NdbImpl() : theNdbObjectIdMap(1024,1024), - theCurrentConnectIndex(0), - theNoOfDBnodes(0) +NdbImpl::NdbImpl(Ndb_cluster_connection *ndb_cluster_connection, + Ndb& ndb) + : m_ndb_cluster_connection(ndb_cluster_connection->m_impl), + m_dictionary(ndb), + theCurrentConnectIndex(0), + theNdbObjectIdMap(1024,1024), + theNoOfDBnodes(0) { int i; for (i = 0; i < MAX_NDB_NODES; i++) { the_release_ind[i] = 0; } + m_optimized_node_selection= + m_ndb_cluster_connection.m_optimized_node_selection; } NdbImpl::~NdbImpl() diff --git a/ndb/src/ndbapi/TransporterFacade.hpp b/ndb/src/ndbapi/TransporterFacade.hpp index 5680e3a6f03..99edea846c1 100644 --- a/ndb/src/ndbapi/TransporterFacade.hpp +++ b/ndb/src/ndbapi/TransporterFacade.hpp @@ -127,7 +127,7 @@ private: friend class ExtSender; ///< @todo Hack to be able to sendSignalUnCond friend class GrepSS; friend class Ndb; - friend class Ndb_cluster_connection; + friend class Ndb_cluster_connection_impl; int sendSignalUnCond(NdbApiSignal *, NodeId nodeId); diff --git a/ndb/src/ndbapi/ndb_cluster_connection.cpp b/ndb/src/ndbapi/ndb_cluster_connection.cpp index f436ee56ede..98a52786aab 100644 --- a/ndb/src/ndbapi/ndb_cluster_connection.cpp +++ b/ndb/src/ndbapi/ndb_cluster_connection.cpp @@ -18,7 +18,9 @@ #include #include -#include +#include "ndb_cluster_connection_impl.hpp" +#include +#include #include #include #include @@ -26,6 +28,8 @@ #include #include #include +#include +#include static int g_run_connect_thread= 0; @@ -35,13 +39,226 @@ NdbMutex *ndb_global_event_buffer_mutex= NULL; NdbMutex *ndb_print_state_mutex= NULL; #endif +/* + * Ndb_cluster_connection + */ + Ndb_cluster_connection::Ndb_cluster_connection(const char *connect_string) + : m_impl(* new Ndb_cluster_connection_impl(connect_string)) +{ +} + +Ndb_cluster_connection::Ndb_cluster_connection +(Ndb_cluster_connection_impl& impl) : m_impl(impl) +{ +} + +Ndb_cluster_connection::~Ndb_cluster_connection() +{ + Ndb_cluster_connection_impl *tmp = &m_impl; + if (this != tmp) + delete tmp; +} + +int Ndb_cluster_connection::get_connected_port() const +{ + if (m_impl.m_config_retriever) + return m_impl.m_config_retriever->get_mgmd_port(); + return -1; +} + +const char *Ndb_cluster_connection::get_connected_host() const +{ + if (m_impl.m_config_retriever) + return m_impl.m_config_retriever->get_mgmd_host(); + return 0; +} + +const char *Ndb_cluster_connection::get_connectstring(char *buf, + int buf_sz) const +{ + if (m_impl.m_config_retriever) + return m_impl.m_config_retriever->get_connectstring(buf,buf_sz); + return 0; +} + +extern "C" pthread_handler_decl(run_ndb_cluster_connection_connect_thread, me) +{ + my_thread_init(); + g_run_connect_thread= 1; + ((Ndb_cluster_connection_impl*) me)->connect_thread(); + my_thread_end(); + NdbThread_Exit(0); + return me; +} + +int Ndb_cluster_connection::start_connect_thread(int (*connect_callback)(void)) +{ + int r; + DBUG_ENTER("Ndb_cluster_connection::start_connect_thread"); + m_impl.m_connect_callback= connect_callback; + if ((r = connect(0,0,0)) == 1) + { + DBUG_PRINT("info",("starting thread")); + m_impl.m_connect_thread= + NdbThread_Create(run_ndb_cluster_connection_connect_thread, + (void**)&m_impl, 32768, "ndb_cluster_connection", + NDB_THREAD_PRIO_LOW); + } + else if (r < 0) + { + DBUG_RETURN(-1); + } + else if (m_impl.m_connect_callback) + { + (*m_impl.m_connect_callback)(); + } + DBUG_RETURN(0); +} + +void Ndb_cluster_connection::set_optimized_node_selection(int val) +{ + m_impl.m_optimized_node_selection= val; +} + +void +Ndb_cluster_connection_impl::init_get_next_node +(Ndb_cluster_connection_node_iter &iter) +{ + if (iter.scan_state != (Uint8)~0) + iter.cur_pos= iter.scan_state; + if (iter.cur_pos >= no_db_nodes()) + iter.cur_pos= 0; + iter.init_pos= iter.cur_pos; + iter.scan_state= 0; + // fprintf(stderr,"[init %d]",iter.init_pos); + return; +} + +Uint32 +Ndb_cluster_connection_impl::get_next_node(Ndb_cluster_connection_node_iter &iter) +{ + Uint32 cur_pos= iter.cur_pos; + if (cur_pos >= no_db_nodes()) + return 0; + + Ndb_cluster_connection_impl::Node *nodes= m_impl.m_all_nodes.getBase(); + Ndb_cluster_connection_impl::Node &node= nodes[cur_pos]; + + if (iter.scan_state != (Uint8)~0) + { + assert(iter.scan_state < no_db_nodes()); + if (nodes[iter.scan_state].group == node.group) + iter.scan_state= ~0; + else + return nodes[iter.scan_state++].id; + } + + // fprintf(stderr,"[%d]",node.id); + + cur_pos++; + Uint32 init_pos= iter.init_pos; + if (cur_pos == node.next_group) + { + cur_pos= nodes[init_pos].this_group; + } + + // fprintf(stderr,"[cur_pos %d]",cur_pos); + if (cur_pos != init_pos) + iter.cur_pos= cur_pos; + else + { + iter.cur_pos= node.next_group; + iter.init_pos= node.next_group; + } + return node.id; +} + +Uint32 +Ndb_cluster_connection::no_db_nodes() +{ + return m_impl.m_all_nodes.size(); +} + + +int +Ndb_cluster_connection::wait_until_ready(int timeout, + int timeout_after_first_alive) +{ + DBUG_ENTER("Ndb_cluster_connection::wait_until_ready"); + TransporterFacade *tp = TransporterFacade::instance(); + if (tp == 0) + { + DBUG_RETURN(-1); + } + if (tp->ownId() == 0) + { + DBUG_RETURN(-1); + } + int secondsCounter = 0; + int milliCounter = 0; + int noChecksSinceFirstAliveFound = 0; + do { + unsigned int foundAliveNode = 0; + tp->lock_mutex(); + for(unsigned i= 0; i < no_db_nodes(); i++) + { + //************************************************ + // If any node is answering, ndb is answering + //************************************************ + if (tp->get_node_alive(m_impl.m_all_nodes[i].id) != 0) { + foundAliveNode++; + } + } + tp->unlock_mutex(); + + if (foundAliveNode == no_db_nodes()) + { + DBUG_RETURN(0); + } + else if (foundAliveNode > 0) + { + noChecksSinceFirstAliveFound++; + if (timeout_after_first_alive >= 0) + { + if (noChecksSinceFirstAliveFound > timeout_after_first_alive) + DBUG_RETURN(0); + } + else // timeout_after_first_alive < 0 + { + if (noChecksSinceFirstAliveFound > -timeout_after_first_alive) + DBUG_RETURN(-1); + } + } + else if (secondsCounter >= timeout) + { // no alive nodes and timed out + DBUG_RETURN(-1); + } + NdbSleep_MilliSleep(100); + milliCounter += 100; + if (milliCounter >= 1000) { + secondsCounter++; + milliCounter = 0; + }//if + } while (1); +} + + + +/* + * Ndb_cluster_connection_impl + */ + +Ndb_cluster_connection_impl::Ndb_cluster_connection_impl(const char * + connect_string) + : Ndb_cluster_connection(*this), + m_optimized_node_selection(1) { DBUG_ENTER("Ndb_cluster_connection"); DBUG_PRINT("enter",("Ndb_cluster_connection this=0x%x", this)); - m_facade= TransporterFacade::theFacadeInstance= new TransporterFacade(); + m_transporter_facade= + TransporterFacade::theFacadeInstance= new TransporterFacade(); - m_config_retriever= 0; m_connect_thread= 0; m_connect_callback= 0; @@ -64,43 +281,230 @@ Ndb_cluster_connection::Ndb_cluster_connection(const char *connect_string) delete m_config_retriever; m_config_retriever= 0; } + DBUG_VOID_RETURN; } -int Ndb_cluster_connection::get_connected_port() const +Ndb_cluster_connection_impl::~Ndb_cluster_connection_impl() { + DBUG_ENTER("~Ndb_cluster_connection"); + DBUG_PRINT("enter",("~Ndb_cluster_connection this=0x%x", this)); + TransporterFacade::stop_instance(); + if (m_connect_thread) + { + void *status; + g_run_connect_thread= 0; + NdbThread_WaitFor(m_connect_thread, &status); + NdbThread_Destroy(&m_connect_thread); + m_connect_thread= 0; + } + if (m_transporter_facade != 0) + { + delete m_transporter_facade; + if (m_transporter_facade != TransporterFacade::theFacadeInstance) + abort(); + TransporterFacade::theFacadeInstance= 0; + } if (m_config_retriever) - return m_config_retriever->get_mgmd_port(); - return -1; + delete m_config_retriever; + + // fragmentToNodeMap.release(); + + DBUG_VOID_RETURN; } -const char *Ndb_cluster_connection::get_connected_host() const +void +Ndb_cluster_connection_impl::init_nodes_vector(Uint32 nodeid, + const ndb_mgm_configuration + &config) { - if (m_config_retriever) - return m_config_retriever->get_mgmd_host(); - return 0; + DBUG_ENTER("Ndb_cluster_connection_impl::init_nodes_vector"); + ndb_mgm_configuration_iterator iter(config, CFG_SECTION_CONNECTION); + + for(iter.first(); iter.valid(); iter.next()) + { + Uint32 nodeid1, nodeid2, remoteNodeId, group= 5; + const char * remoteHostName= 0, * localHostName= 0; + if(iter.get(CFG_CONNECTION_NODE_1, &nodeid1)) continue; + if(iter.get(CFG_CONNECTION_NODE_2, &nodeid2)) continue; + + if(nodeid1 != nodeid && nodeid2 != nodeid) continue; + remoteNodeId = (nodeid == nodeid1 ? nodeid2 : nodeid1); + + iter.get(CFG_CONNECTION_GROUP, &group); + + { + const char * host1= 0, * host2= 0; + iter.get(CFG_CONNECTION_HOSTNAME_1, &host1); + iter.get(CFG_CONNECTION_HOSTNAME_2, &host2); + localHostName = (nodeid == nodeid1 ? host1 : host2); + remoteHostName = (nodeid == nodeid1 ? host2 : host1); + } + + Uint32 type = ~0; + if(iter.get(CFG_TYPE_OF_SECTION, &type)) continue; + + switch(type){ + case CONNECTION_TYPE_SHM:{ + break; + } + case CONNECTION_TYPE_SCI:{ + break; + } + case CONNECTION_TYPE_TCP:{ + // connecting through localhost + // check if config_hostname is local + if (SocketServer::tryBind(0,remoteHostName)) + group--; // upgrade group value + break; + } + case CONNECTION_TYPE_OSE:{ + break; + } + } + m_impl.m_all_nodes.push_back(Node(group,remoteNodeId)); + DBUG_PRINT("info",("saved %d %d", group,remoteNodeId)); + for (int i= m_impl.m_all_nodes.size()-2; + i >= 0 && m_impl.m_all_nodes[i].group > m_impl.m_all_nodes[i+1].group; + i--) + { + Node tmp= m_impl.m_all_nodes[i]; + m_impl.m_all_nodes[i]= m_impl.m_all_nodes[i+1]; + m_impl.m_all_nodes[i+1]= tmp; + } + } + + int i; + Uint32 cur_group, i_group= 0; + cur_group= ~0; + for (i= (int)m_impl.m_all_nodes.size()-1; i >= 0; i--) + { + if (m_impl.m_all_nodes[i].group != cur_group) + { + cur_group= m_impl.m_all_nodes[i].group; + i_group= i+1; + } + m_impl.m_all_nodes[i].next_group= i_group; + } + cur_group= ~0; + for (i= 0; i < (int)m_impl.m_all_nodes.size(); i++) + { + if (m_impl.m_all_nodes[i].group != cur_group) + { + cur_group= m_impl.m_all_nodes[i].group; + i_group= i; + } + m_impl.m_all_nodes[i].this_group= i_group; + } +#if 0 + for (i= 0; i < (int)m_impl.m_all_nodes.size(); i++) + { + fprintf(stderr, "[%d] %d %d %d %d\n", + i, + m_impl.m_all_nodes[i].id, + m_impl.m_all_nodes[i].group, + m_impl.m_all_nodes[i].this_group, + m_impl.m_all_nodes[i].next_group); + } + + do_test(); +#endif + DBUG_VOID_RETURN; } -const char *Ndb_cluster_connection::get_connectstring(char *buf, int buf_sz) const +void +Ndb_cluster_connection_impl::do_test() { - if (m_config_retriever) - return m_config_retriever->get_connectstring(buf,buf_sz); - return 0; + Ndb_cluster_connection_node_iter iter; + int n= no_db_nodes()+5; + Uint32 *nodes= new Uint32[n+1]; + + for (int g= 0; g < n; g++) + { + for (int h= 0; h < n; h++) + { + Uint32 id; + Ndb_cluster_connection_node_iter iter2; + { + for (int j= 0; j < g; j++) + { + nodes[j]= get_next_node(iter2); + } + } + + for (int i= 0; i < n; i++) + { + init_get_next_node(iter); + fprintf(stderr, "%d dead:(", g); + id= 0; + while (id == 0) + { + if ((id= get_next_node(iter)) == 0) + break; + for (int j= 0; j < g; j++) + { + if (nodes[j] == id) + { + fprintf(stderr, " %d", id); + id= 0; + break; + } + } + } + fprintf(stderr, ")"); + if (id == 0) + { + break; + } + fprintf(stderr, " %d\n", id); + } + fprintf(stderr, "\n"); + } + } + delete [] nodes; } -extern "C" pthread_handler_decl(run_ndb_cluster_connection_connect_thread, me) +int Ndb_cluster_connection::connect(int no_retries, int retry_delay_in_seconds, + int verbose) { - my_thread_init(); - g_run_connect_thread= 1; - ((Ndb_cluster_connection*) me)->connect_thread(); - my_thread_end(); - NdbThread_Exit(0); - return me; + DBUG_ENTER("Ndb_cluster_connection::connect"); + const char* error = 0; + do { + if (m_impl.m_config_retriever == 0) + DBUG_RETURN(-1); + if (m_impl.m_config_retriever->do_connect(no_retries, + retry_delay_in_seconds, + verbose)) + DBUG_RETURN(1); // mgmt server not up yet + + Uint32 nodeId = m_impl.m_config_retriever->allocNodeId(4/*retries*/, + 3/*delay*/); + if(nodeId == 0) + break; + ndb_mgm_configuration * props = m_impl.m_config_retriever->getConfig(); + if(props == 0) + break; + m_impl.m_transporter_facade->start_instance(nodeId, props); + + m_impl.init_nodes_vector(nodeId, *props); + + ndb_mgm_destroy_configuration(props); + m_impl.m_transporter_facade->connected(); + DBUG_RETURN(0); + } while(0); + + ndbout << "Configuration error: "; + const char* erString = m_impl.m_config_retriever->getErrorString(); + if (erString == 0) { + erString = "No error specified!"; + } + ndbout << erString << endl; + DBUG_RETURN(-1); } -void Ndb_cluster_connection::connect_thread() +void Ndb_cluster_connection_impl::connect_thread() { - DBUG_ENTER("Ndb_cluster_connection::connect_thread"); + DBUG_ENTER("Ndb_cluster_connection_impl::connect_thread"); int r; do { NdbSleep_SecSleep(1); @@ -120,84 +524,110 @@ void Ndb_cluster_connection::connect_thread() DBUG_VOID_RETURN; } -int Ndb_cluster_connection::start_connect_thread(int (*connect_callback)(void)) -{ - int r; - DBUG_ENTER("Ndb_cluster_connection::start_connect_thread"); - m_connect_callback= connect_callback; - if ((r = connect(0,0,0)) == 1) - { - DBUG_PRINT("info",("starting thread")); - m_connect_thread= - NdbThread_Create(run_ndb_cluster_connection_connect_thread, - (void**)this, 32768, "ndb_cluster_connection", - NDB_THREAD_PRIO_LOW); - } - else if (r < 0) - { - DBUG_RETURN(-1); - } - else if (m_connect_callback) - { - (*m_connect_callback)(); - } - DBUG_RETURN(0); -} +/* + * Hint handling to select node + * ToDo: fix this + */ -int Ndb_cluster_connection::connect(int no_retries, int retry_delay_in_seconds, int verbose) +void +Ndb_cluster_connection_impl::FragmentToNodeMap::init(Uint32 noOfNodes, + Uint8 nodeIds[]) { - DBUG_ENTER("Ndb_cluster_connection::connect"); - const char* error = 0; - do { - if (m_config_retriever == 0) - DBUG_RETURN(-1); - if (m_config_retriever->do_connect(no_retries,retry_delay_in_seconds,verbose)) - DBUG_RETURN(1); // mgmt server not up yet + kValue = 6; + noOfFragments = 2 * noOfNodes; - Uint32 nodeId = m_config_retriever->allocNodeId(4/*retries*/,3/*delay*/); - if(nodeId == 0) - break; - ndb_mgm_configuration * props = m_config_retriever->getConfig(); - if(props == 0) - break; - m_facade->start_instance(nodeId, props); - ndb_mgm_destroy_configuration(props); - m_facade->connected(); - DBUG_RETURN(0); - } while(0); + /** + * Compute hashValueMask and hashpointerValue + */ + { + Uint32 topBit = (1 << 31); + for(int i = 31; i>=0; i--){ + if((noOfFragments & topBit) != 0) + break; + topBit >>= 1; + } + hashValueMask = topBit - 1; + hashpointerValue = noOfFragments - (hashValueMask + 1); + } - ndbout << "Configuration error: "; - const char* erString = m_config_retriever->getErrorString(); - if (erString == 0) { - erString = "No error specified!"; - } - ndbout << erString << endl; - DBUG_RETURN(-1); -} - -Ndb_cluster_connection::~Ndb_cluster_connection() -{ - DBUG_ENTER("~Ndb_cluster_connection"); - DBUG_PRINT("enter",("~Ndb_cluster_connection this=0x%x", this)); - TransporterFacade::stop_instance(); - if (m_connect_thread) + /** + * This initialization depends on + * the fact that: + * primary node for fragment i = i % noOfNodes + * + * This algorithm should be implemented in Dbdih + */ { - void *status; - g_run_connect_thread= 0; - NdbThread_WaitFor(m_connect_thread, &status); - NdbThread_Destroy(&m_connect_thread); - m_connect_thread= 0; - } - if (m_facade != 0) - { - delete m_facade; - if (m_facade != TransporterFacade::theFacadeInstance) + if (fragment2PrimaryNodeMap != 0) abort(); - TransporterFacade::theFacadeInstance= 0; + + fragment2PrimaryNodeMap = new Uint32[noOfFragments]; + Uint32 i; + for(i = 0; i fragment2PrimaryNodeMap[j]){ + Uint32 tmp = fragment2PrimaryNodeMap[i]; + fragment2PrimaryNodeMap[i] = fragment2PrimaryNodeMap[j]; + fragment2PrimaryNodeMap[j] = tmp; + } + + for(i = 0; i> 2; // In words + const char * usedKeyData = 0; + + /** + * If key data buffer is not aligned (on 64 bit boundary) + * or key len is not a multiple of 4 + * Use temp data + */ + if(((((UintPtr)keyData) & 7) == 0) && ((keyLen & 3) == 0)) { + usedKeyData = keyData; + } else { + memcpy(&tempData[0], keyData, keyLen); + const int slack = keyLen & 3; + if(slack > 0) { + memset(&((char *)&tempData[0])[keyLen], 0, (4 - slack)); + }//if + usedKeyData = (char *)&tempData[0]; + }//if + + Uint32 hashValue = md5_hash((Uint64 *)usedKeyData, usedKeyLen); + + hashValue >>= fragmentToNodeMap.kValue; + + Uint32 fragmentId = hashValue & + fragmentToNodeMap.hashValueMask; + + if(fragmentId < fragmentToNodeMap.hashpointerValue) { + fragmentId = hashValue & + ((fragmentToNodeMap.hashValueMask << 1) + 1); + }//if + return fragmentId; } +template class Vector; + diff --git a/ndb/src/ndbapi/ndb_cluster_connection_impl.hpp b/ndb/src/ndbapi/ndb_cluster_connection_impl.hpp new file mode 100644 index 00000000000..620eac296a3 --- /dev/null +++ b/ndb/src/ndbapi/ndb_cluster_connection_impl.hpp @@ -0,0 +1,100 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + + +#ifndef CLUSTER_CONNECTION_IMPL_HPP +#define CLUSTER_CONNECTION_IMPL_HPP + +#include +#include + +class TransporterFacade; +class ConfigRetriever; +class NdbThread; +class ndb_mgm_configuration; + +struct Ndb_cluster_connection_node_iter { + Ndb_cluster_connection_node_iter() : scan_state(~0), + init_pos(0), + cur_pos(0) {}; + Uint8 scan_state; + Uint8 init_pos; + Uint8 cur_pos; +}; + +extern "C" { + void* run_ndb_cluster_connection_connect_thread(void*); +} + +class Ndb_cluster_connection_impl : public Ndb_cluster_connection +{ + Ndb_cluster_connection_impl(const char *connectstring); + ~Ndb_cluster_connection_impl(); + + void do_test(); + + void init_get_next_node(Ndb_cluster_connection_node_iter &iter); + Uint32 get_next_node(Ndb_cluster_connection_node_iter &iter); + +private: + friend class Ndb; + friend class NdbImpl; + friend void* run_ndb_cluster_connection_connect_thread(void*); + friend class Ndb_cluster_connection; + + /** + * Structure containing values for guessing primary node + */ + struct FragmentToNodeMap { + FragmentToNodeMap(): + fragment2PrimaryNodeMap(0) {}; + Uint32 kValue; + Uint32 hashValueMask; + Uint32 hashpointerValue; + Uint32 noOfFragments; + Uint32 *fragment2PrimaryNodeMap; + + void init(Uint32 noOfNodes, Uint8 nodeIds[]); + void release(); + } fragmentToNodeMap; + + struct Node + { + Node(Uint32 _g= 0, Uint32 _id= 0) : this_group(0), + next_group(0), + group(_g), + id(_id) {}; + Uint32 this_group; + Uint32 next_group; + Uint32 group; + Uint32 id; + }; + + Vector m_all_nodes; + void init_nodes_vector(Uint32 nodeid, const ndb_mgm_configuration &config); + Uint32 guess_primary_node(const char * keyData, Uint32 keyLen); + + void connect_thread(); + + TransporterFacade *m_transporter_facade; + ConfigRetriever *m_config_retriever; + NdbThread *m_connect_thread; + int (*m_connect_callback)(void); + + int m_optimized_node_selection; +}; + +#endif diff --git a/ndb/test/ndbapi/testNdbApi.cpp b/ndb/test/ndbapi/testNdbApi.cpp index a1ebac609b6..69e534e6860 100644 --- a/ndb/test/ndbapi/testNdbApi.cpp +++ b/ndb/test/ndbapi/testNdbApi.cpp @@ -142,14 +142,22 @@ int runTestMaxTransaction(NDBT_Context* ctx, NDBT_Step* step){ 4); break; case 2: + ndbout_c("startTransactionDGroup not supported"); + abort(); + /* pCon = pNdb->startTransactionDGroup(1, "TEST", 0); + */ break; case 3: + ndbout_c("startTransactionDGroup not supported"); + abort(); + /* pCon = pNdb->startTransactionDGroup(2, "TEST", 1); + */ break; default: diff --git a/ndb/tools/delete_all.cpp b/ndb/tools/delete_all.cpp index 046ac8005d2..cdfaf2134ff 100644 --- a/ndb/tools/delete_all.cpp +++ b/ndb/tools/delete_all.cpp @@ -24,7 +24,11 @@ static int clear_table(Ndb* pNdb, const NdbDictionary::Table* pTab, int parallelism=240); -static const char* opt_connect_str= 0; +enum ndb_delete_all { + NDB_STD_OPTS_OPTIONS +}; +NDB_STD_OPTS_VARS; + static const char* _dbname = "TEST_DB"; static struct my_option my_long_options[] = { diff --git a/ndb/tools/desc.cpp b/ndb/tools/desc.cpp index c5e9efdfa8a..4bca51ee903 100644 --- a/ndb/tools/desc.cpp +++ b/ndb/tools/desc.cpp @@ -19,7 +19,11 @@ #include #include -static const char* opt_connect_str= 0; +enum ndb_desc_options { + NDB_STD_OPTS_OPTIONS +}; +NDB_STD_OPTS_VARS; + static const char* _dbname = "TEST_DB"; static int _unqualified = 0; static struct my_option my_long_options[] = diff --git a/ndb/tools/drop_index.cpp b/ndb/tools/drop_index.cpp index 6600811e0c4..2b7f8c1bce9 100644 --- a/ndb/tools/drop_index.cpp +++ b/ndb/tools/drop_index.cpp @@ -21,7 +21,11 @@ #include #include -static const char* opt_connect_str= 0; +enum ndb_drop_index_options { + NDB_STD_OPTS_OPTIONS +}; +NDB_STD_OPTS_VARS; + static const char* _dbname = "TEST_DB"; static struct my_option my_long_options[] = { diff --git a/ndb/tools/drop_tab.cpp b/ndb/tools/drop_tab.cpp index 0661a8c599b..2b0b6908449 100644 --- a/ndb/tools/drop_tab.cpp +++ b/ndb/tools/drop_tab.cpp @@ -21,7 +21,11 @@ #include #include -static const char* opt_connect_str= 0; +enum ndb_drop_table_options { + NDB_STD_OPTS_OPTIONS +}; +NDB_STD_OPTS_VARS; + static const char* _dbname = "TEST_DB"; static struct my_option my_long_options[] = { diff --git a/ndb/tools/listTables.cpp b/ndb/tools/listTables.cpp index ccb6967e2dc..710af66f4de 100644 --- a/ndb/tools/listTables.cpp +++ b/ndb/tools/listTables.cpp @@ -161,13 +161,17 @@ list(const char * tabname, } } -static const char* opt_connect_str= 0; +enum ndb_show_tables_options { + NDB_STD_OPTS_OPTIONS +}; +NDB_STD_OPTS_VARS; + static const char* _dbname = "TEST_DB"; static int _loops; static int _type; static struct my_option my_long_options[] = { - NDB_STD_OPTS("ndb_desc"), + NDB_STD_OPTS("ndb_show_tables"), { "database", 'd', "Name of database table is in", (gptr*) &_dbname, (gptr*) &_dbname, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, diff --git a/ndb/tools/restore/restore_main.cpp b/ndb/tools/restore/restore_main.cpp index ece2b2605b4..c24ed620b71 100644 --- a/ndb/tools/restore/restore_main.cpp +++ b/ndb/tools/restore/restore_main.cpp @@ -36,7 +36,10 @@ static Vector g_consumers; static const char* ga_backupPath = "." DIR_SEPARATOR; -static const char* opt_connect_str= NULL; +enum ndb_restore_options { + NDB_STD_OPTS_OPTIONS +}; +NDB_STD_OPTS_VARS; /** * print and restore flags diff --git a/ndb/tools/select_all.cpp b/ndb/tools/select_all.cpp index 5efeed485a4..9c65750094b 100644 --- a/ndb/tools/select_all.cpp +++ b/ndb/tools/select_all.cpp @@ -36,7 +36,11 @@ int scanReadRecords(Ndb*, char delim, bool orderby); -static const char* opt_connect_str= 0; +enum ndb_select_all_options { + NDB_STD_OPTS_OPTIONS +}; +NDB_STD_OPTS_VARS; + static const char* _dbname = "TEST_DB"; static const char* _delimiter = "\t"; static int _unqualified, _header, _parallelism, _useHexFormat, _lock, diff --git a/ndb/tools/select_count.cpp b/ndb/tools/select_count.cpp index c3491f842d8..516eebda91d 100644 --- a/ndb/tools/select_count.cpp +++ b/ndb/tools/select_count.cpp @@ -32,7 +32,11 @@ select_count(Ndb* pNdb, const NdbDictionary::Table* pTab, int* count_rows, UtilTransactions::ScanLock lock); -static const char* opt_connect_str= 0; +enum ndb_select_count_options { + NDB_STD_OPTS_OPTIONS +}; +NDB_STD_OPTS_VARS; + static const char* _dbname = "TEST_DB"; static int _parallelism = 240; static int _lock = 0; diff --git a/ndb/tools/waiter.cpp b/ndb/tools/waiter.cpp index 5973b046f8f..4b86de36514 100644 --- a/ndb/tools/waiter.cpp +++ b/ndb/tools/waiter.cpp @@ -30,7 +30,11 @@ int waitClusterStatus(const char* _addr, ndb_mgm_node_status _status, unsigned int _timeout); -static const char* opt_connect_str= 0; +enum ndb_waiter_options { + NDB_STD_OPTS_OPTIONS +}; +NDB_STD_OPTS_VARS; + static int _no_contact = 0; static int _timeout = 120; static struct my_option my_long_options[] = diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 029fe31ecf7..eb201ee6ef5 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -32,6 +32,10 @@ #include #include +// options from from mysqld.cc +extern my_bool opt_ndb_optimized_node_selection; +extern const char *opt_ndbcluster_connectstring; + // Default value for parallelism static const int parallelism= 240; @@ -39,9 +43,6 @@ static const int parallelism= 240; // createable against NDB from this handler static const int max_transactions= 256; -// connectstring to cluster if given by mysqld -const char *ndbcluster_connectstring= 0; - static const char *ha_ndb_ext=".ndb"; #define NDB_HIDDEN_PRIMARY_KEY_LENGTH 8 @@ -4233,15 +4234,19 @@ bool ndbcluster_init() int res; DBUG_ENTER("ndbcluster_init"); // Set connectstring if specified - if (ndbcluster_connectstring != 0) - DBUG_PRINT("connectstring", ("%s", ndbcluster_connectstring)); + if (opt_ndbcluster_connectstring != 0) + DBUG_PRINT("connectstring", ("%s", opt_ndbcluster_connectstring)); if ((g_ndb_cluster_connection= - new Ndb_cluster_connection(ndbcluster_connectstring)) == 0) + new Ndb_cluster_connection(opt_ndbcluster_connectstring)) == 0) { - DBUG_PRINT("error",("Ndb_cluster_connection(%s)",ndbcluster_connectstring)); + DBUG_PRINT("error",("Ndb_cluster_connection(%s)", + opt_ndbcluster_connectstring)); goto ndbcluster_init_error; } + g_ndb_cluster_connection->set_optimized_node_selection + (opt_ndb_optimized_node_selection); + // Create a Ndb object to open the connection to NDB g_ndb= new Ndb(g_ndb_cluster_connection, "sys"); g_ndb->getDictionary()->set_local_table_data_size(sizeof(Ndb_table_local_info)); @@ -4256,7 +4261,7 @@ bool ndbcluster_init() DBUG_PRINT("info",("NDBCLUSTER storage engine at %s on port %d", g_ndb_cluster_connection->get_connected_host(), g_ndb_cluster_connection->get_connected_port())); - g_ndb->waitUntilReady(10); + g_ndb_cluster_connection->wait_until_ready(10,0); } else if(res == 1) { diff --git a/sql/mysqld.cc b/sql/mysqld.cc index e39c902444e..5cd85113641 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -53,6 +53,11 @@ #endif #ifdef HAVE_NDBCLUSTER_DB #define OPT_NDBCLUSTER_DEFAULT 0 +#ifdef NDB_SHM_TRANSPORTER +#define OPT_NDB_SHM_DEFAULT 1 +#else +#define OPT_NDB_SHM_DEFAULT 0 +#endif #else #define OPT_NDBCLUSTER_DEFAULT 0 #endif @@ -285,6 +290,10 @@ my_bool opt_safe_user_create = 0, opt_no_mix_types = 0; my_bool opt_show_slave_auth_info, opt_sql_bin_update = 0; my_bool opt_log_slave_updates= 0; my_bool opt_console= 0, opt_bdb, opt_innodb, opt_isam, opt_ndbcluster; +#ifdef HAVE_NDBCLUSTER_DB +const char *opt_ndbcluster_connectstring= 0; +my_bool opt_ndb_shm, opt_ndb_optimized_node_selection; +#endif my_bool opt_readonly, use_temp_pool, relay_log_purge; my_bool opt_sync_bdb_logs, opt_sync_frm; my_bool opt_secure_auth= 0; @@ -3998,6 +4007,7 @@ enum options_mysqld OPT_INNODB, OPT_ISAM, OPT_NDBCLUSTER, OPT_NDB_CONNECTSTRING, OPT_NDB_USE_EXACT_COUNT, OPT_NDB_FORCE_SEND, OPT_NDB_AUTOINCREMENT_PREFETCH_SZ, + OPT_NDB_SHM, OPT_NDB_OPTIMIZED_NODE_SELECTION, OPT_SKIP_SAFEMALLOC, OPT_TEMP_POOL, OPT_TX_ISOLATION, OPT_SKIP_STACK_TRACE, OPT_SKIP_SYMLINKS, @@ -4439,24 +4449,46 @@ Disable with --skip-ndbcluster (will save memory).", #ifdef HAVE_NDBCLUSTER_DB {"ndb-connectstring", OPT_NDB_CONNECTSTRING, "Connect string for ndbcluster.", - (gptr*) &ndbcluster_connectstring, (gptr*) &ndbcluster_connectstring, + (gptr*) &opt_ndbcluster_connectstring, + (gptr*) &opt_ndbcluster_connectstring, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"ndb_autoincrement_prefetch_sz", OPT_NDB_AUTOINCREMENT_PREFETCH_SZ, - "Specify number of autoincrement values that are prefetched", + {"ndb-autoincrement-prefetch-sz", OPT_NDB_AUTOINCREMENT_PREFETCH_SZ, + "Specify number of autoincrement values that are prefetched.", (gptr*) &global_system_variables.ndb_autoincrement_prefetch_sz, (gptr*) &global_system_variables.ndb_autoincrement_prefetch_sz, 0, GET_INT, REQUIRED_ARG, 32, 1, 256, 0, 0, 0}, - {"ndb_force_send", OPT_NDB_FORCE_SEND, - "Force send of buffers to ndb immediately without waiting for other threads", + {"ndb-force-send", OPT_NDB_FORCE_SEND, + "Force send of buffers to ndb immediately without waiting for " + "other threads.", (gptr*) &global_system_variables.ndb_force_send, (gptr*) &global_system_variables.ndb_force_send, 0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0}, + {"ndb_force_send", OPT_NDB_FORCE_SEND, + "same as --ndb-force-send.", + (gptr*) &global_system_variables.ndb_force_send, + (gptr*) &global_system_variables.ndb_force_send, + 0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0}, + {"ndb-use-exact-count", OPT_NDB_USE_EXACT_COUNT, + "Use exact records count during query planning and for fast " + "select count(*), disable for faster queries.", + (gptr*) &global_system_variables.ndb_use_exact_count, + (gptr*) &global_system_variables.ndb_use_exact_count, + 0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0}, {"ndb_use_exact_count", OPT_NDB_USE_EXACT_COUNT, - "Use exact records count during query planning and for " - "fast select count(*)", + "same as --ndb-use-exact-count.", (gptr*) &global_system_variables.ndb_use_exact_count, (gptr*) &global_system_variables.ndb_use_exact_count, 0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0}, + {"ndb-shm", OPT_NDB_SHM, + "Use shared memory connections when available.", + (gptr*) &opt_ndb_shm, + (gptr*) &opt_ndb_shm, + 0, GET_BOOL, OPT_ARG, OPT_NDB_SHM_DEFAULT, 0, 0, 0, 0, 0}, + {"ndb-optimized-node-selection", OPT_NDB_OPTIMIZED_NODE_SELECTION, + "Select nodes for transactions in a more optimal way.", + (gptr*) &opt_ndb_optimized_node_selection, + (gptr*) &opt_ndb_optimized_node_selection, + 0, GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0}, #endif {"new", 'n', "Use very new possible 'unsafe' functions.", (gptr*) &global_system_variables.new_mode, From 05862273cb44524a70d3abda686a311ad6b553b1 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 20 Dec 2004 16:19:22 +0100 Subject: [PATCH 0555/1063] automatically configure with shared memory transporter for ndb if functions are available --- acinclude.m4 | 18 ------------------ configure.in | 17 ++++++++++++++--- 2 files changed, 14 insertions(+), 21 deletions(-) diff --git a/acinclude.m4 b/acinclude.m4 index 730ee15ed20..4f2ad8daf91 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -1599,11 +1599,6 @@ AC_DEFUN([MYSQL_CHECK_NDB_OPTIONS], [ ;; esac - AC_ARG_WITH([ndb-shm], - [ - --with-ndb-shm Include the NDB Cluster shared memory transporter], - [ndb_shm="$withval"], - [ndb_shm=no]) AC_ARG_WITH([ndb-test], [ --with-ndb-test Include the NDB Cluster ndbapi test programs], @@ -1633,19 +1628,6 @@ AC_DEFUN([MYSQL_CHECK_NDB_OPTIONS], [ AC_MSG_CHECKING([for NDB Cluster options]) AC_MSG_RESULT([]) - have_ndb_shm=no - case "$ndb_shm" in - yes ) - AC_MSG_RESULT([-- including shared memory transporter]) - AC_DEFINE([NDB_SHM_TRANSPORTER], [1], - [Including Ndb Cluster DB shared memory transporter]) - have_ndb_shm="yes" - ;; - * ) - AC_MSG_RESULT([-- not including shared memory transporter]) - ;; - esac - have_ndb_test=no case "$ndb_test" in yes ) diff --git a/configure.in b/configure.in index 9be817c51da..bc78c9c8764 100644 --- a/configure.in +++ b/configure.in @@ -1923,7 +1923,9 @@ AC_CHECK_FUNCS(alarm bcmp bfill bmove bzero chsize cuserid fchmod fcntl \ pthread_attr_setstacksize pthread_condattr_create pthread_getsequence_np \ pthread_key_delete pthread_rwlock_rdlock pthread_setprio \ pthread_setprio_np pthread_setschedparam pthread_sigmask readlink \ - realpath rename rint rwlock_init setupterm sighold sigset sigthreadmask \ + realpath rename rint rwlock_init setupterm \ + shmget shmat shmdt shmctl \ + sighold sigset sigthreadmask \ snprintf socket stpcpy strcasecmp strerror strnlen strpbrk strstr strtol \ strtoll strtoul strtoull tell tempnam thr_setconcurrency vidattr) @@ -3078,10 +3080,19 @@ fi AC_SUBST([ndb_port_base]) ndb_transporter_opt_objs="" -if test X"$have_ndb_shm" = Xyes +if test "$ac_cv_func_shmget" = "yes" && + test "$ac_cv_func_shmat" = "yes" && + test "$ac_cv_func_shmdt" = "yes" && + test "$ac_cv_func_shmctl" = "yes" then - ndb_transporter_opt_objs="$ndb_transporter_opt_objs SHM_Transporter.lo SHM_Transporter.unix.lo" + AC_DEFINE([NDB_SHM_TRANSPORTER], [1], + [Including Ndb Cluster DB shared memory transporter]) + AC_MSG_RESULT([Including ndb shared memory transporter]) + ndb_transporter_opt_objs="$ndb_transporter_opt_objs SHM_Transporter.lo SHM_Transporter.unix.lo" +else + AC_MSG_RESULT([Not including ndb shared memory transporter]) fi + if test X"$have_ndb_sci" = Xyes then ndb_transporter_opt_objs="$ndb_transporter_opt_objs SCI_Transporter.lo" From 9cee9f6969e45051ac26e62b1a520ff642c6b22e Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 20 Dec 2004 15:12:13 -0600 Subject: [PATCH 0556/1063] configure.in: Increment from 4.0.23 to 4.0.24 configure.in: Increment from 4.0.23 to 4.0.24 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 06a0c1bd52f..65af867cbc0 100644 --- a/configure.in +++ b/configure.in @@ -4,7 +4,7 @@ dnl Process this file with autoconf to produce a configure script. AC_INIT(sql/mysqld.cc) AC_CANONICAL_SYSTEM # The Docs Makefile.am parses this line! -AM_INIT_AUTOMAKE(mysql, 4.0.23) +AM_INIT_AUTOMAKE(mysql, 4.0.24) AM_CONFIG_HEADER(config.h) PROTOCOL_VERSION=10 From fee2e57b675ba2e07bb9833ffbe18996fbf97ccb Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 21 Dec 2004 10:05:58 +0400 Subject: [PATCH 0557/1063] Fix to perform correctly with charsets in embedded server BitKeeper/deleted/.del-ctype_recoding.result.es~45c6fe567949af: Delete: mysql-test/r/ctype_recoding.result.es BitKeeper/deleted/.del-func_test.result.es~4de135264090aa14: Delete: mysql-test/r/func_test.result.es BitKeeper/deleted/.del-ps_2myisam.result.es~5132bde9c07c41e8: Delete: mysql-test/r/ps_2myisam.result.es BitKeeper/deleted/.del-ps_3innodb.result.es~a3613f0e86132472: Delete: mysql-test/r/ps_3innodb.result.es BitKeeper/deleted/.del-ps_4heap.result.es~956ae2c46b66b6ed: Delete: mysql-test/r/ps_4heap.result.es BitKeeper/deleted/.del-ps_5merge.result.es~6093a834fec21efe: Delete: mysql-test/r/ps_5merge.result.es BitKeeper/deleted/.del-ps_6bdb.result.es~57b94c3756e3d093: Delete: mysql-test/r/ps_6bdb.result.es libmysqld/lib_sql.cc: Charset conversion implemented mysql-test/r/query_cache.result.es: correct test result provided tests/client_test.c: now it works --- libmysqld/lib_sql.cc | 78 +- mysql-test/r/ctype_recoding.result.es | 242 - mysql-test/r/func_test.result.es | 185 - mysql-test/r/ps_2myisam.result.es | 3130 ------------- mysql-test/r/ps_3innodb.result.es | 3113 ------------- mysql-test/r/ps_4heap.result.es | 3114 ------------- mysql-test/r/ps_5merge.result.es | 6064 ------------------------- mysql-test/r/ps_6bdb.result.es | 3113 ------------- mysql-test/r/query_cache.result.es | 8 +- tests/client_test.c | 2 - 10 files changed, 56 insertions(+), 18993 deletions(-) delete mode 100644 mysql-test/r/ctype_recoding.result.es delete mode 100644 mysql-test/r/func_test.result.es delete mode 100644 mysql-test/r/ps_2myisam.result.es delete mode 100644 mysql-test/r/ps_3innodb.result.es delete mode 100644 mysql-test/r/ps_4heap.result.es delete mode 100644 mysql-test/r/ps_5merge.result.es delete mode 100644 mysql-test/r/ps_6bdb.result.es diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc index 8092d87b97c..a9503c644a8 100644 --- a/libmysqld/lib_sql.cc +++ b/libmysqld/lib_sql.cc @@ -591,6 +591,32 @@ err: C_MODE_END +static char *dup_str_aux(MEM_ROOT *root, const char *from, uint length, + CHARSET_INFO *fromcs, CHARSET_INFO *tocs) +{ + uint32 dummy32; + uint dummy_err; + char *result; + + /* 'tocs' is set 0 when client issues SET character_set_results=NULL */ + if (tocs && String::needs_conversion(0, fromcs, tocs, &dummy32)) + { + uint new_len= (tocs->mbmaxlen * length) / fromcs->mbminlen + 1; + result= (char *)alloc_root(root, new_len); + length= copy_and_convert(result, new_len, + tocs, from, length, fromcs, &dummy_err); + } + else + { + result= (char *)alloc_root(root, length + 1); + memcpy(result, from, length); + } + + result[length]= 0; + return result; +} + + bool Protocol::send_fields(List *list, uint flag) { List_iterator_fast it(*list); @@ -598,6 +624,8 @@ bool Protocol::send_fields(List *list, uint flag) MYSQL_FIELD *client_field; MYSQL *mysql= thd->mysql; MEM_ROOT *field_alloc; + CHARSET_INFO *thd_cs= thd->variables.character_set_results; + CHARSET_INFO *cs= system_charset_info; DBUG_ENTER("send_fields"); @@ -616,12 +644,29 @@ bool Protocol::send_fields(List *list, uint flag) Send_field server_field; item->make_field(&server_field); - client_field->db= strdup_root(field_alloc, server_field.db_name); - client_field->table= strdup_root(field_alloc, server_field.table_name); - client_field->name= strdup_root(field_alloc, server_field.col_name); - client_field->org_table= strdup_root(field_alloc, server_field.org_table_name); - client_field->org_name= strdup_root(field_alloc, server_field.org_col_name); - client_field->length= server_field.length; + client_field->db= dup_str_aux(field_alloc, server_field.db_name, + strlen(server_field.db_name), cs, thd_cs); + client_field->table= dup_str_aux(field_alloc, server_field.table_name, + strlen(server_field.table_name), cs, thd_cs); + client_field->name= dup_str_aux(field_alloc, server_field.col_name, + strlen(server_field.col_name), cs, thd_cs); + client_field->org_table= dup_str_aux(field_alloc, server_field.org_table_name, + strlen(server_field.org_table_name), cs, thd_cs); + client_field->org_name= dup_str_aux(field_alloc, server_field.org_col_name, + strlen(server_field.org_col_name), cs, thd_cs); + if (item->collation.collation == &my_charset_bin || thd_cs == NULL) + { + /* No conversion */ + client_field->charsetnr= server_field.charsetnr; + client_field->length= server_field.length; + } + else + { + /* With conversion */ + client_field->charsetnr= thd_cs->number; + uint char_len= server_field.length / item->collation.collation->mbmaxlen; + client_field->length= char_len * thd_cs->mbmaxlen; + } client_field->type= server_field.type; client_field->flags= server_field.flags; client_field->decimals= server_field.decimals; @@ -630,9 +675,8 @@ bool Protocol::send_fields(List *list, uint flag) client_field->name_length= strlen(client_field->name); client_field->org_name_length= strlen(client_field->org_name); client_field->org_table_length= strlen(client_field->org_table); - client_field->charsetnr= server_field.charsetnr; - client_field->catalog= strdup_root(field_alloc, "def"); + client_field->catalog= dup_str_aux(field_alloc, "def", 3, cs, thd_cs); client_field->catalog_length= 3; if (INTERNAL_NUM_FIELD(client_field)) @@ -804,21 +848,3 @@ bool Protocol::net_store_data(const char *from, uint length) return false; } -#if 0 -/* The same as Protocol::net_store_data but does the converstion -*/ -bool Protocol::convert_str(const char *from, uint length) -{ - if (!(*next_field=alloc_root(alloc, length + 1))) - return true; - convert->store_dest(*next_field, from, length); - (*next_field)[length]= 0; - if (next_mysql_field->max_length < length) - next_mysql_field->max_length=length; - ++next_field; - ++next_mysql_field; - - return false; -} -#endif - diff --git a/mysql-test/r/ctype_recoding.result.es b/mysql-test/r/ctype_recoding.result.es deleted file mode 100644 index 27425a69872..00000000000 --- a/mysql-test/r/ctype_recoding.result.es +++ /dev/null @@ -1,242 +0,0 @@ -SET CHARACTER SET koi8r; -DROP TABLE IF EXISTS ÔÁÂÌÉÃÁ, t1, t2; -SET CHARACTER SET koi8r; -CREATE TABLE t1 (a CHAR(10) CHARACTER SET cp1251) SELECT _koi8r'ÐÒÏÂÁ' AS a; -CREATE TABLE t2 (a CHAR(10) CHARACTER SET utf8); -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` char(10) character set cp1251 default NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 -SELECT a FROM t1; -a -ÐÒÏÂÁ -SELECT HEX(a) FROM t1; -HEX(a) -EFF0EEE1E0 -INSERT t2 SELECT * FROM t1; -SELECT HEX(a) FROM t2; -HEX(a) -D0BFD180D0BED0B1D0B0 -DROP TABLE t1, t2; -CREATE TABLE t1 (description text character set cp1250 NOT NULL); -INSERT INTO t1 (description) VALUES (_latin2'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaasssssssssssaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddde'); -SELECT description FROM t1; -description -aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaasssssssssssaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddde -DROP TABLE t1; -CREATE TABLE t1 (a TEXT CHARACTER SET cp1251) SELECT _koi8r'ÐÒÏÂÁ' AS a; -CREATE TABLE t2 (a TEXT CHARACTER SET utf8); -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `a` text character set cp1251 -) ENGINE=MyISAM DEFAULT CHARSET=latin1 -SELECT HEX(a) FROM t1; -HEX(a) -EFF0EEE1E0 -INSERT t2 SELECT * FROM t1; -SELECT HEX(a) FROM t2; -HEX(a) -D0BFD180D0BED0B1D0B0 -DROP TABLE t1, t2; -CREATE TABLE `ÔÁÂÌÉÃÁ` -( -ÐÏÌÅ CHAR(32) CHARACTER SET koi8r NOT NULL COMMENT "ËÏÍÍÅÎÔÁÒÉÊ ÐÏÌÑ" -) COMMENT "ËÏÍÍÅÎÔÁÒÉÊ ÔÁÂÌÉÃÙ"; -SHOW TABLES; -Tables_in_test -ÔÁÂÌÉÃÁ -SHOW CREATE TABLE ÔÁÂÌÉÃÁ; -Table Create Table -ÔÁÂÌÉÃÁ CREATE TABLE `ÔÁÂÌÉÃÁ` ( - `ÐÏÌÅ` char(32) character set koi8r NOT NULL default '' COMMENT 'ËÏÍÍÅÎÔÁÒÉÊ ÐÏÌÑ' -) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='ËÏÍÍÅÎÔÁÒÉÊ ÔÁÂÌÉÃÙ' -SHOW FIELDS FROM ÔÁÂÌÉÃÁ; -Field Type Null Key Default Extra -ÐÏÌÅ char(32) -SET CHARACTER SET cp1251; -SHOW TABLES; -Tables_in_test -òàáëèöà -SHOW CREATE TABLE òàáëèöà; -Table Create Table -òàáëèöà CREATE TABLE `òàáëèöà` ( - `ïîëå` char(32) character set koi8r NOT NULL default '' COMMENT 'êîììåíòàðèé ïîëÿ' -) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='êîììåíòàðèé òàáëèöû' -SHOW FIELDS FROM òàáëèöà; -Field Type Null Key Default Extra -ïîëå char(32) -SET CHARACTER SET utf8; -SHOW TABLES; -Tables_in_test -таблица -SHOW CREATE TABLE таблица; -Table Create Table -таблица CREATE TABLE `таблица` ( - `поле` char(32) character set koi8r NOT NULL default '' COMMENT 'комментарий полÑ' -) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='комментарий таблицы' -SHOW FIELDS FROM таблица; -Field Type Null Key Default Extra -поле char(32) -SET CHARACTER SET koi8r; -DROP TABLE ÔÁÂÌÉÃÁ; -SET CHARACTER SET default; -SET NAMES UTF8; -CREATE TABLE t1 (t text) DEFAULT CHARSET UTF8; -INSERT INTO t1 (t) VALUES ('x'); -SELECT 1 FROM t1 WHERE CONCAT(_latin1'x') = t; -1 -1 -DROP TABLE t1; -SET CHARACTER SET koi8r; -CREATE DATABASE ÔÅÓÔ; -USE ÔÅÓÔ; -SHOW TABLES; -Tables_in_теÑÑ‚ -SHOW TABLES IN ÔÅÓÔ; -Tables_in_теÑÑ‚ -SET CHARACTER SET cp1251; -SHOW TABLES; -Tables_in_теÑÑ‚ -SHOW TABLES IN òåñò; -Tables_in_теÑÑ‚ -SET CHARACTER SET koi8r; -DROP DATABASE ÔÅÓÔ; -SET NAMES koi8r; -SELECT hex('ÔÅÓÔ'); -hex('теÑÑ‚') -D4C5D3D4 -SET character_set_connection=cp1251; -SELECT hex('ÔÅÓÔ'); -hex('теÑÑ‚') -F2E5F1F2 -USE test; -SET NAMES binary; -CREATE TABLE `теÑÑ‚` (`теÑÑ‚` int); -SHOW CREATE TABLE `теÑÑ‚`; -Table Create Table -теÑÑ‚ CREATE TABLE `теÑÑ‚` ( - `теÑÑ‚` int(11) default NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 -SET NAMES utf8; -SHOW CREATE TABLE `теÑÑ‚`; -Table Create Table -теÑÑ‚ CREATE TABLE `теÑÑ‚` ( - `теÑÑ‚` int(11) default NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 -DROP TABLE `теÑÑ‚`; -SET NAMES binary; -SET character_set_connection=utf8; -SELECT 'теÑÑ‚' as s; -s -теÑÑ‚ -SET NAMES utf8; -SET character_set_connection=binary; -SELECT 'теÑÑ‚' as s; -s -теÑÑ‚ -SET NAMES latin1; -CREATE TABLE t1 (`ä` CHAR(128) DEFAULT 'ä', `ä1` ENUM('ä1','ä2') DEFAULT 'ä2'); -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `ä` char(128) default 'ä', - `ä1` enum('ä1','ä2') default 'ä2' -) ENGINE=MyISAM DEFAULT CHARSET=latin1 -SHOW COLUMNS FROM t1; -Field Type Null Key Default Extra -ä char(128) YES ä -ä1 enum('ä1','ä2') YES ä2 -SET NAMES binary; -SHOW CREATE TABLE t1; -Table Create Table -t1 CREATE TABLE `t1` ( - `ä` char(128) default 'ä', - `ä1` enum('ä1','ä2') default 'ä2' -) ENGINE=MyISAM DEFAULT CHARSET=latin1 -SHOW COLUMNS FROM t1; -Field Type Null Key Default Extra -ä char(128) YES ä -ä1 enum('ä1','ä2') YES ä2 -DROP TABLE t1; -SET NAMES binary; -CREATE TABLE `goodÐÌÏÈÏ` (a int); -ERROR HY000: Invalid utf8 character string: 'ÐÌÏÈÏ' -SET NAMES utf8; -CREATE TABLE `goodÐÌÏÈÏ` (a int); -ERROR HY000: Invalid utf8 character string: 'ÐÌÏÈÏ` (a int)' -set names latin1; -create table t1 (a char(10) character set koi8r, b text character set koi8r); -insert into t1 values ('test','test'); -insert into t1 values ('ÊÃÕË','ÊÃÕË'); -Warnings: -Warning 1265 Data truncated for column 'a' at row 1 -Warning 1265 Data truncated for column 'b' at row 1 -drop table t1; -set names koi8r; -create table t1 (a char(10) character set cp1251); -insert into t1 values (_koi8r'×ÁÓÑ'); -select * from t1 where a=_koi8r'×ÁÓÑ'; -a -×ÁÓÑ -select * from t1 where a=concat(_koi8r'×ÁÓÑ'); -ERROR HY000: Illegal mix of collations (cp1251_general_ci,IMPLICIT) and (koi8r_general_ci,COERCIBLE) for operation '=' -select * from t1 where a=_latin1'×ÁÓÑ'; -ERROR HY000: Illegal mix of collations (cp1251_general_ci,IMPLICIT) and (latin1_swedish_ci,COERCIBLE) for operation '=' -drop table t1; -set names latin1; -set names koi8r; -create table t1 (c1 char(10) character set cp1251); -insert into t1 values ('ß'); -select c1 from t1 where c1 between 'ß' and 'ß'; -c1 -ß -select ifnull(c1,'ß'), ifnull(null,c1) from t1; -ifnull(c1,'ÑŠ') ifnull(null,c1) -ß ß -select if(1,c1,'ö'), if(0,c1,'ö') from t1; -if(1,c1,'Ж') if(0,c1,'Ж') -ß ö -select coalesce('ö',c1), coalesce(null,c1) from t1; -coalesce('Ж',c1) coalesce(null,c1) -ö ß -select least(c1,'ö'), greatest(c1,'ö') from t1; -least(c1,'Ж') greatest(c1,'Ж') -ö ß -select locate(c1,'ß'), locate('ß',c1) from t1; -locate(c1,'ÑŠ') locate('ÑŠ',c1) -1 1 -select field(c1,'ß'),field('ß',c1) from t1; -field(c1,'ÑŠ') field('ÑŠ',c1) -1 1 -select concat(c1,'ö'), concat('ö',c1) from t1; -concat(c1,'Ж') concat('Ж',c1) -ßö öß -select concat_ws(c1,'ö','ß'), concat_ws('ö',c1,'ß') from t1; -concat_ws(c1,'Ж','ÑŠ') concat_ws('Ж',c1,'ÑŠ') -ößß ßöß -select replace(c1,'ß','ö'), replace('ß',c1,'ö') from t1; -replace(c1,'ÑŠ','Ж') replace('ÑŠ',c1,'Ж') -ö ö -select substring_index(c1,'öößß',2) from t1; -substring_index(c1,'ЖЖъъ',2) -ß -select elt(1,c1,'ö'),elt(1,'ö',c1) from t1; -elt(1,c1,'Ж') elt(1,'Ж',c1) -ß ö -select make_set(3,c1,'ö'), make_set(3,'ö',c1) from t1; -make_set(3,c1,'Ж') make_set(3,'Ж',c1) -ß,ö ö,ß -select insert(c1,1,2,'ö'),insert('ö',1,2,c1) from t1; -insert(c1,1,2,'Ж') insert('Ж',1,2,c1) -ö ß -select trim(c1 from 'ß'),trim('ß' from c1) from t1; -trim(c1 from 'ÑŠ') trim('ÑŠ' from c1) - -select lpad(c1,3,'ö'), lpad('ö',3,c1) from t1; -lpad(c1,3,'Ж') lpad('Ж',3,c1) -ööß ßßö -select rpad(c1,3,'ö'), rpad('ö',3,c1) from t1; -rpad(c1,3,'Ж') rpad('Ж',3,c1) -ßöö ößß diff --git a/mysql-test/r/func_test.result.es b/mysql-test/r/func_test.result.es deleted file mode 100644 index 380f96835d0..00000000000 --- a/mysql-test/r/func_test.result.es +++ /dev/null @@ -1,185 +0,0 @@ -drop table if exists t1,t2; -select 0=0,1>0,1>=1,1<0,1<=0,1!=0,strcmp("abc","abcd"),strcmp("b","a"),strcmp("a","a") ; -0=0 1>0 1>=1 1<0 1<=0 1!=0 strcmp("abc","abcd") strcmp("b","a") strcmp("a","a") -1 1 1 0 0 1 -1 1 0 -select "a"<"b","a"<="b","b">="a","b">"a","a"="A","a"<>"b"; -"a"<"b" "a"<="b" "b">="a" "b">"a" "a"="A" "a"<>"b" -1 1 1 1 1 1 -select "a "="A", "A "="a", "a " <= "A b"; -"a "="A" "A "="a" "a " <= "A b" -1 1 1 -select "abc" like "a%", "abc" not like "%d%", "a%" like "a\%","abc%" like "a%\%","abcd" like "a%b_%d", "a" like "%%a","abcde" like "a%_e","abc" like "abc%"; -"abc" like "a%" "abc" not like "%d%" "a%" like "a\%" "abc%" like "a%\%" "abcd" like "a%b_%d" "a" like "%%a" "abcde" like "a%_e" "abc" like "abc%" -1 1 1 1 1 1 1 1 -select "a" like "%%b","a" like "%%ab","ab" like "a\%", "ab" like "_", "ab" like "ab_", "abc" like "%_d", "abc" like "abc%d"; -"a" like "%%b" "a" like "%%ab" "ab" like "a\%" "ab" like "_" "ab" like "ab_" "abc" like "%_d" "abc" like "abc%d" -0 0 0 0 0 0 0 -select '?' like '|%', '?' like '|%' ESCAPE '|', '%' like '|%', '%' like '|%' ESCAPE '|', '%' like '%'; -'?' like '|%' '?' like '|%' ESCAPE '|' '%' like '|%' '%' like '|%' ESCAPE '|' '%' like '%' -0 0 0 1 1 -select 'abc' like '%c','abcabc' like '%c', "ab" like "", "ab" like "a", "ab" like "ab"; -'abc' like '%c' 'abcabc' like '%c' "ab" like "" "ab" like "a" "ab" like "ab" -1 1 0 0 1 -select "Det här är svenska" regexp "h[[:alpha:]]+r", "aba" regexp "^(a|b)*$"; -"Det här är svenska" regexp "h[[:alpha:]]+r" "aba" regexp "^(a|b)*$" -1 1 -select "aba" regexp concat("^","a"); -"aba" regexp concat("^","a") -1 -select !0,NOT 0=1,!(0=0),1 AND 1,1 && 0,0 OR 1,1 || NULL, 1=1 or 1=1 and 1=0; -!0 NOT 0=1 !(0=0) 1 AND 1 1 && 0 0 OR 1 1 || NULL 1=1 or 1=1 and 1=0 -1 1 0 1 0 1 1 1 -select 2 between 1 and 3, "monty" between "max" and "my",2=2 and "monty" between "max" and "my" and 3=3; -2 between 1 and 3 "monty" between "max" and "my" 2=2 and "monty" between "max" and "my" and 3=3 -1 1 1 -select 'b' between 'a' and 'c', 'B' between 'a' and 'c'; -'b' between 'a' and 'c' 'B' between 'a' and 'c' -1 1 -select 2 in (3,2,5,9,5,1),"monty" in ("david","monty","allan"), 1.2 in (1.4,1.2,1.0); -2 in (3,2,5,9,5,1) "monty" in ("david","monty","allan") 1.2 in (1.4,1.2,1.0) -1 1 1 -select -1.49 or -1.49,0.6 or 0.6; --1.49 or -1.49 0.6 or 0.6 -1 1 -select 3 ^ 11, 1 ^ 1, 1 ^ 0, 1 ^ NULL, NULL ^ 1; -3 ^ 11 1 ^ 1 1 ^ 0 1 ^ NULL NULL ^ 1 -8 0 1 NULL NULL -explain extended select 3 ^ 11, 1 ^ 1, 1 ^ 0, 1 ^ NULL, NULL ^ 1; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used -Warnings: -Note 1003 select (3 ^ 11) AS `3 ^ 11`,(1 ^ 1) AS `1 ^ 1`,(1 ^ 0) AS `1 ^ 0`,(1 ^ NULL) AS `1 ^ NULL`,(NULL ^ 1) AS `NULL ^ 1` -select 1 XOR 1, 1 XOR 0, 0 XOR 1, 0 XOR 0, NULL XOR 1, 1 XOR NULL, 0 XOR NULL; -1 XOR 1 1 XOR 0 0 XOR 1 0 XOR 0 NULL XOR 1 1 XOR NULL 0 XOR NULL -0 1 1 0 NULL NULL NULL -select 1 like 2 xor 2 like 1; -1 like 2 xor 2 like 1 -0 -select 10 % 7, 10 mod 7, 10 div 3; -10 % 7 10 mod 7 10 div 3 -3 3 3 -explain extended select 10 % 7, 10 mod 7, 10 div 3; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used -Warnings: -Note 1003 select (10 % 7) AS `10 % 7`,(10 % 7) AS `10 mod 7`,(10 DIV 3) AS `10 div 3` -select (1 << 64)-1, ((1 << 64)-1) DIV 1, ((1 << 64)-1) DIV 2; -(1 << 64)-1 ((1 << 64)-1) DIV 1 ((1 << 64)-1) DIV 2 -18446744073709551615 18446744073709551615 9223372036854775807 -explain extended select (1 << 64)-1, ((1 << 64)-1) DIV 1, ((1 << 64)-1) DIV 2; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used -Warnings: -Note 1003 select ((1 << 64) - 1) AS `(1 << 64)-1`,(((1 << 64) - 1) DIV 1) AS `((1 << 64)-1) DIV 1`,(((1 << 64) - 1) DIV 2) AS `((1 << 64)-1) DIV 2` -create table t1 (a int); -insert t1 values (1); -select * from t1 where 1 xor 1; -a -explain extended select * from t1 where 1 xor 1; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -Warnings: -Note 1003 select test.t1.a AS `a` from test.t1 where (1 xor 1) -select - a from t1; -- a --1 -explain extended select - a from t1; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 system NULL NULL NULL NULL 1 -Warnings: -Note 1003 select -(test.t1.a) AS `- a` from test.t1 -drop table t1; -select 5 between 0 and 10 between 0 and 1,(5 between 0 and 10) between 0 and 1; -5 between 0 and 10 between 0 and 1 (5 between 0 and 10) between 0 and 1 -0 1 -select 1 and 2 between 2 and 10, 2 between 2 and 10 and 1; -1 and 2 between 2 and 10 2 between 2 and 10 and 1 -1 1 -select 1 and 0 or 2, 2 or 1 and 0; -1 and 0 or 2 2 or 1 and 0 -1 1 -select _koi8r'a' = _koi8r'A'; -_koi8r'a' = _koi8r'A' -1 -select _koi8r'a' = _koi8r'A' COLLATE koi8r_general_ci; -_koi8r'a' = _koi8r'A' COLLATE koi8r_general_ci -1 -explain extended select _koi8r'a' = _koi8r'A' COLLATE koi8r_general_ci; -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used -Warnings: -Note 1003 select (_koi8r'a' = (_koi8r'A' collate _latin1'koi8r_general_ci')) AS `_koi8r'a' = _koi8r'A' COLLATE koi8r_general_ci` -select _koi8r'a' = _koi8r'A' COLLATE koi8r_bin; -_koi8r'a' = _koi8r'A' COLLATE koi8r_bin -0 -select _koi8r'a' COLLATE koi8r_general_ci = _koi8r'A'; -_koi8r'a' COLLATE koi8r_general_ci = _koi8r'A' -1 -select _koi8r'a' COLLATE koi8r_bin = _koi8r'A'; -_koi8r'a' COLLATE koi8r_bin = _koi8r'A' -0 -select _koi8r'a' COLLATE koi8r_bin = _koi8r'A' COLLATE koi8r_general_ci; -ERROR HY000: Illegal mix of collations (koi8r_bin,EXPLICIT) and (koi8r_general_ci,EXPLICIT) for operation '=' -select _koi8r'a' = _latin1'A'; -ERROR HY000: Illegal mix of collations (koi8r_general_ci,COERCIBLE) and (latin1_swedish_ci,COERCIBLE) for operation '=' -select strcmp(_koi8r'a', _koi8r'A'); -strcmp(_koi8r'a', _koi8r'A') -0 -select strcmp(_koi8r'a', _koi8r'A' COLLATE koi8r_general_ci); -strcmp(_koi8r'a', _koi8r'A' COLLATE koi8r_general_ci) -0 -select strcmp(_koi8r'a', _koi8r'A' COLLATE koi8r_bin); -strcmp(_koi8r'a', _koi8r'A' COLLATE koi8r_bin) -1 -select strcmp(_koi8r'a' COLLATE koi8r_general_ci, _koi8r'A'); -strcmp(_koi8r'a' COLLATE koi8r_general_ci, _koi8r'A') -0 -select strcmp(_koi8r'a' COLLATE koi8r_bin, _koi8r'A'); -strcmp(_koi8r'a' COLLATE koi8r_bin, _koi8r'A') -1 -select strcmp(_koi8r'a' COLLATE koi8r_general_ci, _koi8r'A' COLLATE koi8r_bin); -ERROR HY000: Illegal mix of collations (koi8r_general_ci,EXPLICIT) and (koi8r_bin,EXPLICIT) for operation 'strcmp' -select strcmp(_koi8r'a', _latin1'A'); -ERROR HY000: Illegal mix of collations (koi8r_general_ci,COERCIBLE) and (latin1_swedish_ci,COERCIBLE) for operation 'strcmp' -select _koi8r'a' LIKE _koi8r'A'; -_koi8r'a' LIKE _koi8r'A' -1 -select _koi8r'a' LIKE _koi8r'A' COLLATE koi8r_general_ci; -_koi8r'a' LIKE _koi8r'A' COLLATE koi8r_general_ci -1 -select _koi8r'a' LIKE _koi8r'A' COLLATE koi8r_bin; -_koi8r'a' LIKE _koi8r'A' COLLATE koi8r_bin -0 -select _koi8r'a' COLLATE koi8r_general_ci LIKE _koi8r'A'; -_koi8r'a' COLLATE koi8r_general_ci LIKE _koi8r'A' -1 -select _koi8r'a' COLLATE koi8r_bin LIKE _koi8r'A'; -_koi8r'a' COLLATE koi8r_bin LIKE _koi8r'A' -0 -select _koi8r'a' COLLATE koi8r_general_ci LIKE _koi8r'A' COLLATE koi8r_bin; -ERROR HY000: Illegal mix of collations (koi8r_general_ci,EXPLICIT) and (koi8r_bin,EXPLICIT) for operation 'like' -select _koi8r'a' LIKE _latin1'A'; -ERROR HY000: Illegal mix of collations (koi8r_general_ci,COERCIBLE) and (latin1_swedish_ci,COERCIBLE) for operation 'like' -CREATE TABLE t1 ( faq_group_id int(11) NOT NULL default '0', faq_id int(11) NOT NULL default '0', title varchar(240) default NULL, keywords text, description longblob, solution longblob, status tinyint(4) NOT NULL default '0', access_id smallint(6) default NULL, lang_id smallint(6) NOT NULL default '0', created datetime NOT NULL default '0000-00-00 00:00:00', updated datetime default NULL, last_access datetime default NULL, last_notify datetime default NULL, solved_count int(11) NOT NULL default '0', static_solved int(11) default NULL, solved_1 int(11) default NULL, solved_2 int(11) default NULL, solved_3 int(11) default NULL, solved_4 int(11) default NULL, solved_5 int(11) default NULL, expires datetime default NULL, notes text, assigned_to smallint(6) default NULL, assigned_group smallint(6) default NULL, last_edited_by smallint(6) default NULL, orig_ref_no varchar(15) binary default NULL, c$fundstate smallint(6) default NULL, c$contributor smallint(6) default NULL, UNIQUE KEY t1$faq_id (faq_id), KEY t1$group_id$faq_id (faq_group_id,faq_id), KEY t1$c$fundstate (c$fundstate) ) ENGINE=MyISAM; -INSERT INTO t1 VALUES (82,82,'How to use the DynaVox Usage Counts Feature','usages count, number, corner, white, box, button','\r\n\r\n \r\n \r\n \r\n \r\n
 \r\n

How \r\n To: \r\n Display or Hide the Usage Counts to find out how many times each button is being selected.

\r\n
','\r\n \r\n \r\n \r\n \r\n\r\n \r\n
  \r\n \r\n

1. Select \r\n the On/Setup button to access the DynaVox Setup Menu.
\r\n 2. Select Button Features.
\r\n 3. Below the OK button is the Usage Counts button.
\r\n a. If it says \"Hidden\" then the Usage Counts will not be displayed.
\r\n b. If it says \"Displayed\" then the Usage Counts will be shown.
\r\n c. Select the Usage Counts Option Ring once and it will toggle \r\n to the alternative option.
\r\n 4. Once the correct setting has been chosen, select OK to leave the Button \r\n Features menu.
\r\n 5. Select OK out of the Setup menu and return to the communication \r\n page.

\r\n

For \r\n further information on Usage Counts, see the Button Features \r\n Menu Entry in the DynaVox/DynaMyte Reference Manual.

\r\n
',4,1,1,'2001-11-16 16:43:34','2002-11-25 12:09:43','2003-07-24 01:04:48',NULL,11,NULL,0,0,0,0,0,NULL,NULL,NULL,NULL,11,NULL,NULL,NULL); -CREATE TABLE t2 ( access_id smallint(6) NOT NULL default '0', name varchar(20) binary default NULL, rank smallint(6) NOT NULL default '0', KEY t2$access_id (access_id) ) ENGINE=MyISAM; -INSERT INTO t2 VALUES (1,'Everyone',2),(2,'Help',3),(3,'Customer Support',1); -SELECT f_acc.rank, a1.rank, a2.rank FROM t1 LEFT JOIN t1 f1 ON (f1.access_id=1 AND f1.faq_group_id = t1.faq_group_id) LEFT JOIN t2 a1 ON (a1.access_id = f1.access_id) LEFT JOIN t1 f2 ON (f2.access_id=3 AND f2.faq_group_id = t1.faq_group_id) LEFT JOIN t2 a2 ON (a2.access_id = f2.access_id), t2 f_acc WHERE LEAST(a1.rank,a2.rank) = f_acc.rank; -rank rank rank -2 2 NULL -DROP TABLE t1,t2; -CREATE TABLE t1 (d varchar(6), k int); -INSERT INTO t1 VALUES (NULL, 2); -SELECT GREATEST(d,d) FROM t1 WHERE k=2; -GREATEST(d,d) -NULL -DROP TABLE t1; -select 1197.90 mod 50; -1197.90 mod 50 -47.90 -select 5.1 mod 3, 5.1 mod -3, -5.1 mod 3, -5.1 mod -3; -5.1 mod 3 5.1 mod -3 -5.1 mod 3 -5.1 mod -3 -2.1 2.1 -2.1 -2.1 -select 5 mod 3, 5 mod -3, -5 mod 3, -5 mod -3; -5 mod 3 5 mod -3 -5 mod 3 -5 mod -3 -2 2 -2 -2 diff --git a/mysql-test/r/ps_2myisam.result.es b/mysql-test/r/ps_2myisam.result.es deleted file mode 100644 index 3f17b4cdcd0..00000000000 --- a/mysql-test/r/ps_2myisam.result.es +++ /dev/null @@ -1,3130 +0,0 @@ -use test; -drop table if exists t1, t9 ; -create table t1 -( -a int, b varchar(30), -primary key(a) -) engine = 'MYISAM' ; -create table t9 -( -c1 tinyint, c2 smallint, c3 mediumint, c4 int, -c5 integer, c6 bigint, c7 float, c8 double, -c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4), -c13 date, c14 datetime, c15 timestamp(14), c16 time, -c17 year, c18 bit, c19 bool, c20 char, -c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext, -c25 blob, c26 text, c27 mediumblob, c28 mediumtext, -c29 longblob, c30 longtext, c31 enum('one', 'two', 'three'), -c32 set('monday', 'tuesday', 'wednesday'), -primary key(c1) -) engine = 'MYISAM' ; -delete from t1 ; -insert into t1 values (1,'one'); -insert into t1 values (2,'two'); -insert into t1 values (3,'three'); -insert into t1 values (4,'four'); -commit ; -delete from t9 ; -insert into t9 -set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, -c10= 1, c11= 1, c12 = 1, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=true, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t9 -set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, -c10= 9, c11= 9, c12 = 9, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=false, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; -commit ; -test_sequence ------- simple select tests ------ -prepare stmt1 from ' select * from t9 order by c1 ' ; -execute stmt1; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def test t9 t9 c1 c1 1 4 1 N 49155 0 63 -def test t9 t9 c2 c2 2 6 1 Y 32768 0 63 -def test t9 t9 c3 c3 9 9 1 Y 32768 0 63 -def test t9 t9 c4 c4 3 11 1 Y 32768 0 63 -def test t9 t9 c5 c5 3 11 1 Y 32768 0 63 -def test t9 t9 c6 c6 8 20 1 Y 32768 0 63 -def test t9 t9 c7 c7 4 12 1 Y 32768 31 63 -def test t9 t9 c8 c8 5 22 1 Y 32768 31 63 -def test t9 t9 c9 c9 5 22 1 Y 32768 31 63 -def test t9 t9 c10 c10 5 22 1 Y 32768 31 63 -def test t9 t9 c11 c11 0 9 6 Y 32768 4 63 -def test t9 t9 c12 c12 0 10 6 Y 32768 4 63 -def test t9 t9 c13 c13 10 10 10 Y 128 0 63 -def test t9 t9 c14 c14 12 19 19 Y 128 0 63 -def test t9 t9 c15 c15 7 19 19 N 1249 0 63 -def test t9 t9 c16 c16 11 8 8 Y 128 0 63 -def test t9 t9 c17 c17 13 4 4 Y 32864 0 63 -def test t9 t9 c18 c18 1 1 1 Y 32768 0 63 -def test t9 t9 c19 c19 1 1 1 Y 32768 0 63 -def test t9 t9 c20 c20 254 1 1 Y 0 0 8 -def test t9 t9 c21 c21 253 10 10 Y 0 0 8 -def test t9 t9 c22 c22 253 30 30 Y 0 0 8 -def test t9 t9 c23 c23 252 255 8 Y 144 0 63 -def test t9 t9 c24 c24 252 255 8 Y 16 0 8 -def test t9 t9 c25 c25 252 65535 4 Y 144 0 63 -def test t9 t9 c26 c26 252 65535 4 Y 16 0 8 -def test t9 t9 c27 c27 252 16777215 10 Y 144 0 63 -def test t9 t9 c28 c28 252 16777215 10 Y 16 0 8 -def test t9 t9 c29 c29 252 16777215 8 Y 144 0 63 -def test t9 t9 c30 c30 252 16777215 8 Y 16 0 8 -def test t9 t9 c31 c31 254 5 3 Y 256 0 8 -def test t9 t9 c32 c32 254 24 7 Y 2048 0 8 -c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32 -1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday -set @arg00='SELECT' ; -prepare stmt1 from ' ? a from t1 where a=1 '; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? a from t1 where a=1' at line 1 -set @arg00=1 ; -select @arg00, b from t1 where a=1 ; -@arg00 b -1 one -prepare stmt1 from ' select ?, b from t1 where a=1 ' ; -execute stmt1 using @arg00 ; -? b -1 one -set @arg00='lion' ; -select @arg00, b from t1 where a=1 ; -@arg00 b -lion one -prepare stmt1 from ' select ?, b from t1 where a=1 ' ; -execute stmt1 using @arg00 ; -? b -lion one -set @arg00=NULL ; -select @arg00, b from t1 where a=1 ; -@arg00 b -NULL one -prepare stmt1 from ' select ?, b from t1 where a=1 ' ; -execute stmt1 using @arg00 ; -? b -NULL one -set @arg00=1 ; -select b, a - @arg00 from t1 where a=1 ; -b a - @arg00 -one 0 -prepare stmt1 from ' select b, a - ? from t1 where a=1 ' ; -execute stmt1 using @arg00 ; -b a - ? -one 0 -set @arg00=null ; -select @arg00 as my_col ; -my_col -NULL -prepare stmt1 from ' select ? as my_col'; -execute stmt1 using @arg00 ; -my_col -NULL -select @arg00 + 1 as my_col ; -my_col -NULL -prepare stmt1 from ' select ? + 1 as my_col'; -execute stmt1 using @arg00 ; -my_col -NULL -select 1 + @arg00 as my_col ; -my_col -NULL -prepare stmt1 from ' select 1 + ? as my_col'; -execute stmt1 using @arg00 ; -my_col -NULL -set @arg00='MySQL' ; -select substr(@arg00,1,2) from t1 where a=1 ; -substr(@arg00,1,2) -My -prepare stmt1 from ' select substr(?,1,2) from t1 where a=1 ' ; -execute stmt1 using @arg00 ; -substr(?,1,2) -My -set @arg00=3 ; -select substr('MySQL',@arg00,5) from t1 where a=1 ; -substr('MySQL',@arg00,5) -SQL -prepare stmt1 from ' select substr(''MySQL'',?,5) from t1 where a=1 ' ; -execute stmt1 using @arg00 ; -substr('MySQL',?,5) -SQL -select substr('MySQL',1,@arg00) from t1 where a=1 ; -substr('MySQL',1,@arg00) -MyS -prepare stmt1 from ' select substr(''MySQL'',1,?) from t1 where a=1 ' ; -execute stmt1 using @arg00 ; -substr('MySQL',1,?) -MyS -set @arg00='MySQL' ; -select a , concat(@arg00,b) from t1 order by a; -a concat(@arg00,b) -1 MySQLone -2 MySQLtwo -3 MySQLthree -4 MySQLfour -prepare stmt1 from ' select a , concat(?,b) from t1 order by a ' ; -execute stmt1 using @arg00; -a concat(?,b) -1 MySQLone -2 MySQLtwo -3 MySQLthree -4 MySQLfour -select a , concat(b,@arg00) from t1 order by a ; -a concat(b,@arg00) -1 oneMySQL -2 twoMySQL -3 threeMySQL -4 fourMySQL -prepare stmt1 from ' select a , concat(b,?) from t1 order by a ' ; -execute stmt1 using @arg00; -a concat(b,?) -1 oneMySQL -2 twoMySQL -3 threeMySQL -4 fourMySQL -set @arg00='MySQL' ; -select group_concat(@arg00,b order by a) from t1 -group by 'a' ; -group_concat(@arg00,b order by a) -MySQLone,MySQLtwo,MySQLthree,MySQLfour -prepare stmt1 from ' select group_concat(?,b order by a) from t1 -group by ''a'' ' ; -execute stmt1 using @arg00; -group_concat(?,b order by a) -MySQLone,MySQLtwo,MySQLthree,MySQLfour -select group_concat(b,@arg00 order by a) from t1 -group by 'a' ; -group_concat(b,@arg00 order by a) -oneMySQL,twoMySQL,threeMySQL,fourMySQL -prepare stmt1 from ' select group_concat(b,? order by a) from t1 -group by ''a'' ' ; -execute stmt1 using @arg00; -group_concat(b,? order by a) -oneMySQL,twoMySQL,threeMySQL,fourMySQL -set @arg00='first' ; -set @arg01='second' ; -set @arg02=NULL; -select @arg00, @arg01 from t1 where a=1 ; -@arg00 @arg01 -first second -prepare stmt1 from ' select ?, ? from t1 where a=1 ' ; -execute stmt1 using @arg00, @arg01 ; -? ? -first second -execute stmt1 using @arg02, @arg01 ; -? ? -NULL second -execute stmt1 using @arg00, @arg02 ; -? ? -first NULL -execute stmt1 using @arg02, @arg02 ; -? ? -NULL NULL -drop table if exists t5 ; -create table t5 (id1 int(11) not null default '0', -value2 varchar(100), value1 varchar(100)) ; -insert into t5 values (1,'hh','hh'),(2,'hh','hh'), -(1,'ii','ii'),(2,'ii','ii') ; -prepare stmt1 from ' select id1,value1 from t5 where id1=? or value1=? order by id1,value1 ' ; -set @arg00=1 ; -set @arg01='hh' ; -execute stmt1 using @arg00, @arg01 ; -id1 value1 -1 hh -1 ii -2 hh -drop table t5 ; -drop table if exists t5 ; -create table t5(session_id char(9) not null) ; -insert into t5 values ('abc') ; -prepare stmt1 from ' select * from t5 -where ?=''1111'' and session_id = ''abc'' ' ; -set @arg00='abc' ; -execute stmt1 using @arg00 ; -session_id -set @arg00='1111' ; -execute stmt1 using @arg00 ; -session_id -abc -set @arg00='abc' ; -execute stmt1 using @arg00 ; -session_id -drop table t5 ; -set @arg00='FROM' ; -select a @arg00 t1 where a=1 ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 t1 where a=1' at line 1 -prepare stmt1 from ' select a ? t1 where a=1 ' ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? t1 where a=1' at line 1 -set @arg00='t1' ; -select a from @arg00 where a=1 ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 where a=1' at line 1 -prepare stmt1 from ' select a from ? where a=1 ' ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? where a=1' at line 1 -set @arg00='WHERE' ; -select a from t1 @arg00 a=1 ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 a=1' at line 1 -prepare stmt1 from ' select a from t1 ? a=1 ' ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? a=1' at line 1 -set @arg00=1 ; -select a FROM t1 where a=@arg00 ; -a -1 -prepare stmt1 from ' select a FROM t1 where a=? ' ; -execute stmt1 using @arg00 ; -a -1 -set @arg00=1000 ; -execute stmt1 using @arg00 ; -a -set @arg00=NULL ; -select a FROM t1 where a=@arg00 ; -a -prepare stmt1 from ' select a FROM t1 where a=? ' ; -execute stmt1 using @arg00 ; -a -set @arg00=4 ; -select a FROM t1 where a=sqrt(@arg00) ; -a -2 -prepare stmt1 from ' select a FROM t1 where a=sqrt(?) ' ; -execute stmt1 using @arg00 ; -a -2 -set @arg00=NULL ; -select a FROM t1 where a=sqrt(@arg00) ; -a -prepare stmt1 from ' select a FROM t1 where a=sqrt(?) ' ; -execute stmt1 using @arg00 ; -a -set @arg00=2 ; -set @arg01=3 ; -select a FROM t1 where a in (@arg00,@arg01) order by a; -a -2 -3 -prepare stmt1 from ' select a FROM t1 where a in (?,?) order by a '; -execute stmt1 using @arg00, @arg01; -a -2 -3 -set @arg00= 'one' ; -set @arg01= 'two' ; -set @arg02= 'five' ; -prepare stmt1 from ' select b FROM t1 where b in (?,?,?) order by b ' ; -execute stmt1 using @arg00, @arg01, @arg02 ; -b -one -two -prepare stmt1 from ' select b FROM t1 where b like ? '; -set @arg00='two' ; -execute stmt1 using @arg00 ; -b -two -set @arg00='tw%' ; -execute stmt1 using @arg00 ; -b -two -set @arg00='%wo' ; -execute stmt1 using @arg00 ; -b -two -set @arg00=null ; -insert into t9 set c1= 0, c5 = NULL ; -select c5 from t9 where c5 > NULL ; -c5 -prepare stmt1 from ' select c5 from t9 where c5 > ? '; -execute stmt1 using @arg00 ; -c5 -select c5 from t9 where c5 < NULL ; -c5 -prepare stmt1 from ' select c5 from t9 where c5 < ? '; -execute stmt1 using @arg00 ; -c5 -select c5 from t9 where c5 = NULL ; -c5 -prepare stmt1 from ' select c5 from t9 where c5 = ? '; -execute stmt1 using @arg00 ; -c5 -select c5 from t9 where c5 <=> NULL ; -c5 -NULL -prepare stmt1 from ' select c5 from t9 where c5 <=> ? '; -execute stmt1 using @arg00 ; -c5 -NULL -delete from t9 where c1= 0 ; -set @arg00='>' ; -select a FROM t1 where a @arg00 1 ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 1' at line 1 -prepare stmt1 from ' select a FROM t1 where a ? 1 ' ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? 1' at line 1 -set @arg00=1 ; -select a,b FROM t1 where a is not NULL -AND b is not NULL group by a - @arg00 ; -a b -1 one -2 two -3 three -4 four -prepare stmt1 from ' select a,b FROM t1 where a is not NULL -AND b is not NULL group by a - ? ' ; -execute stmt1 using @arg00 ; -a b -1 one -2 two -3 three -4 four -set @arg00='two' ; -select a,b FROM t1 where a is not NULL -AND b is not NULL having b <> @arg00 order by a ; -a b -1 one -3 three -4 four -prepare stmt1 from ' select a,b FROM t1 where a is not NULL -AND b is not NULL having b <> ? order by a ' ; -execute stmt1 using @arg00 ; -a b -1 one -3 three -4 four -set @arg00=1 ; -select a,b FROM t1 where a is not NULL -AND b is not NULL order by a - @arg00 ; -a b -1 one -2 two -3 three -4 four -prepare stmt1 from ' select a,b FROM t1 where a is not NULL -AND b is not NULL order by a - ? ' ; -execute stmt1 using @arg00 ; -a b -1 one -2 two -3 three -4 four -set @arg00=2 ; -select a,b from t1 order by 2 ; -a b -4 four -1 one -3 three -2 two -prepare stmt1 from ' select a,b from t1 -order by ? '; -execute stmt1 using @arg00; -a b -4 four -1 one -3 three -2 two -set @arg00=1 ; -execute stmt1 using @arg00; -a b -1 one -2 two -3 three -4 four -set @arg00=0 ; -execute stmt1 using @arg00; -ERROR 42S22: Unknown column '?' in 'order clause' -set @arg00=1; -prepare stmt1 from ' select a,b from t1 order by a -limit 1 '; -execute stmt1 ; -a b -1 one -prepare stmt1 from ' select a,b from t1 -limit ? '; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?' at line 2 -set @arg00='b' ; -set @arg01=0 ; -set @arg02=2 ; -set @arg03=2 ; -select sum(a), @arg00 from t1 where a > @arg01 -and b is not null group by substr(b,@arg02) -having sum(a) <> @arg03 ; -sum(a) @arg00 -3 b -1 b -4 b -prepare stmt1 from ' select sum(a), ? from t1 where a > ? -and b is not null group by substr(b,?) -having sum(a) <> ? '; -execute stmt1 using @arg00, @arg01, @arg02, @arg03; -sum(a) ? -3 b -1 b -4 b -test_sequence ------- join tests ------ -select first.a as a1, second.a as a2 -from t1 first, t1 second -where first.a = second.a order by a1 ; -a1 a2 -1 1 -2 2 -3 3 -4 4 -prepare stmt1 from ' select first.a as a1, second.a as a2 - from t1 first, t1 second - where first.a = second.a order by a1 '; -execute stmt1 ; -a1 a2 -1 1 -2 2 -3 3 -4 4 -set @arg00='ABC'; -set @arg01='two'; -set @arg02='one'; -select first.a, @arg00, second.a FROM t1 first, t1 second -where @arg01 = first.b or first.a = second.a or second.b = @arg02 -order by second.a, first.a; -a @arg00 a -1 ABC 1 -2 ABC 1 -3 ABC 1 -4 ABC 1 -2 ABC 2 -2 ABC 3 -3 ABC 3 -2 ABC 4 -4 ABC 4 -prepare stmt1 from ' select first.a, ?, second.a FROM t1 first, t1 second - where ? = first.b or first.a = second.a or second.b = ? - order by second.a, first.a'; -execute stmt1 using @arg00, @arg01, @arg02; -a ? a -1 ABC 1 -2 ABC 1 -3 ABC 1 -4 ABC 1 -2 ABC 2 -2 ABC 3 -3 ABC 3 -2 ABC 4 -4 ABC 4 -drop table if exists t2 ; -create table t2 as select * from t1 ; -set @query1= 'SELECT * FROM t2 join t1 on (t1.a=t2.a) order by t2.a ' ; -set @query2= 'SELECT * FROM t2 natural join t1 order by t2.a ' ; -set @query3= 'SELECT * FROM t2 join t1 using(a) order by t2.a ' ; -set @query4= 'SELECT * FROM t2 left join t1 on(t1.a=t2.a) order by t2.a ' ; -set @query5= 'SELECT * FROM t2 natural left join t1 order by t2.a ' ; -set @query6= 'SELECT * FROM t2 left join t1 using(a) order by t2.a ' ; -set @query7= 'SELECT * FROM t2 right join t1 on(t1.a=t2.a) order by t2.a ' ; -set @query8= 'SELECT * FROM t2 natural right join t1 order by t2.a ' ; -set @query9= 'SELECT * FROM t2 right join t1 using(a) order by t2.a ' ; -the join statement is: -SELECT * FROM t2 right join t1 using(a) order by t2.a -prepare stmt1 from @query9 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -the join statement is: -SELECT * FROM t2 natural right join t1 order by t2.a -prepare stmt1 from @query8 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -the join statement is: -SELECT * FROM t2 right join t1 on(t1.a=t2.a) order by t2.a -prepare stmt1 from @query7 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -the join statement is: -SELECT * FROM t2 left join t1 using(a) order by t2.a -prepare stmt1 from @query6 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -the join statement is: -SELECT * FROM t2 natural left join t1 order by t2.a -prepare stmt1 from @query5 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -the join statement is: -SELECT * FROM t2 left join t1 on(t1.a=t2.a) order by t2.a -prepare stmt1 from @query4 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -the join statement is: -SELECT * FROM t2 join t1 using(a) order by t2.a -prepare stmt1 from @query3 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -the join statement is: -SELECT * FROM t2 natural join t1 order by t2.a -prepare stmt1 from @query2 ; -execute stmt1 ; -a b -1 one -2 two -3 three -4 four -execute stmt1 ; -a b -1 one -2 two -3 three -4 four -execute stmt1 ; -a b -1 one -2 two -3 three -4 four -the join statement is: -SELECT * FROM t2 join t1 on (t1.a=t2.a) order by t2.a -prepare stmt1 from @query1 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -drop table t2 ; -test_sequence ------- subquery tests ------ -prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where b = ''two'') '; -execute stmt1 ; -a b -2 two -set @arg00='two' ; -select a, b FROM t1 outer_table where -a = (select a from t1 where b = 'two' ) and b=@arg00 ; -a b -2 two -prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where b = ''two'') and b=? '; -execute stmt1 using @arg00; -a b -2 two -set @arg00='two' ; -select a, b FROM t1 outer_table where -a = (select a from t1 where b = @arg00 ) and b='two' ; -a b -2 two -prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where b = ? ) and b=''two'' ' ; -execute stmt1 using @arg00; -a b -2 two -set @arg00=3 ; -set @arg01='three' ; -select a,b FROM t1 where (a,b) in (select 3, 'three'); -a b -3 three -select a FROM t1 where (a,b) in (select @arg00,@arg01); -a -3 -prepare stmt1 from ' select a FROM t1 where (a,b) in (select ?, ?) '; -execute stmt1 using @arg00, @arg01; -a -3 -set @arg00=1 ; -set @arg01='two' ; -set @arg02=2 ; -set @arg03='two' ; -select a, @arg00, b FROM t1 outer_table where -b=@arg01 and a = (select @arg02 from t1 where b = @arg03 ) ; -a @arg00 b -2 1 two -prepare stmt1 from ' select a, ?, b FROM t1 outer_table where - b=? and a = (select ? from t1 where b = ? ) ' ; -execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; -a ? b -2 1 two -prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where b = outer_table.b ) order by a '; -execute stmt1 ; -a b -1 one -2 two -3 three -4 four -prepare stmt1 from ' SELECT a as ccc from t1 where a+1= - (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) '; -execute stmt1 ; -ccc -1 -deallocate prepare stmt1 ; -prepare stmt1 from ' SELECT a as ccc from t1 where a+1= - (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) '; -execute stmt1 ; -ccc -1 -deallocate prepare stmt1 ; -prepare stmt1 from ' SELECT a as ccc from t1 where a+1= - (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) '; -execute stmt1 ; -ccc -1 -deallocate prepare stmt1 ; -set @arg00='two' ; -select a, b FROM t1 outer_table where -a = (select a from t1 where b = outer_table.b ) and b=@arg00 ; -a b -2 two -prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where b = outer_table.b) and b=? '; -execute stmt1 using @arg00; -a b -2 two -set @arg00=2 ; -select a, b FROM t1 outer_table where -a = (select a from t1 where a = @arg00 and b = outer_table.b) and b='two' ; -a b -2 two -prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where a = ? and b = outer_table.b) and b=''two'' ' ; -execute stmt1 using @arg00; -a b -2 two -set @arg00=2 ; -select a, b FROM t1 outer_table where -a = (select a from t1 where outer_table.a = @arg00 and a=2) and b='two' ; -a b -2 two -prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where outer_table.a = ? and a=2) and b=''two'' ' ; -execute stmt1 using @arg00; -a b -2 two -set @arg00=1 ; -set @arg01='two' ; -set @arg02=2 ; -set @arg03='two' ; -select a, @arg00, b FROM t1 outer_table where -b=@arg01 and a = (select @arg02 from t1 where outer_table.b = @arg03 -and outer_table.a=a ) ; -a @arg00 b -2 1 two -prepare stmt1 from ' select a, ?, b FROM t1 outer_table where - b=? and a = (select ? from t1 where outer_table.b = ? - and outer_table.a=a ) ' ; -execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; -a ? b -2 1 two -set @arg00=1 ; -set @arg01=0 ; -select a, @arg00 -from ( select a - @arg00 as a from t1 where a=@arg00 ) as t2 -where a=@arg01; -a @arg00 -0 1 -prepare stmt1 from ' select a, ? - from ( select a - ? as a from t1 where a=? ) as t2 - where a=? '; -execute stmt1 using @arg00, @arg00, @arg00, @arg01 ; -a ? -0 1 -drop table if exists t2 ; -create table t2 as select * from t1; -prepare stmt1 from ' select a in (select a from t2) from t1 ' ; -execute stmt1 ; -a in (select a from t2) -1 -1 -1 -1 -drop table if exists t5, t6, t7 ; -create table t5 (a int , b int) ; -create table t6 like t5 ; -create table t7 like t5 ; -insert into t5 values (0, 100), (1, 2), (1, 3), (2, 2), (2, 7), -(2, -1), (3, 10) ; -insert into t6 values (0, 0), (1, 1), (2, 1), (3, 1), (4, 1) ; -insert into t7 values (3, 3), (2, 2), (1, 1) ; -prepare stmt1 from ' select a, (select count(distinct t5.b) as sum from t5, t6 - where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b - group by t5.a order by sum limit 1) from t7 ' ; -execute stmt1 ; -a (select count(distinct t5.b) as sum from t5, t6 - where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b - group by t5.a order by sum limit 1) -3 1 -2 2 -1 2 -execute stmt1 ; -a (select count(distinct t5.b) as sum from t5, t6 - where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b - group by t5.a order by sum limit 1) -3 1 -2 2 -1 2 -execute stmt1 ; -a (select count(distinct t5.b) as sum from t5, t6 - where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b - group by t5.a order by sum limit 1) -3 1 -2 2 -1 2 -drop table t5, t6, t7 ; -drop table if exists t2 ; -create table t2 as select * from t9; -set @stmt= ' SELECT - (SELECT SUM(c1 + c12 + 0.0) FROM t2 - where (t9.c2 - 0e-3) = t2.c2 - GROUP BY t9.c15 LIMIT 1) as scalar_s, - exists (select 1.0e+0 from t2 - where t2.c3 * 9.0000000000 = t9.c4) as exists_s, - c5 * 4 in (select c6 + 0.3e+1 from t2) as in_s, - (c7 - 4, c8 - 4) in (select c9 + 4.0, c10 + 40e-1 from t2) as in_row_s -FROM t9, -(select c25 x, c32 y from t2) tt WHERE x = c25 ' ; -prepare stmt1 from @stmt ; -execute stmt1 ; -execute stmt1 ; -set @stmt= concat('explain ',@stmt); -prepare stmt1 from @stmt ; -execute stmt1 ; -execute stmt1 ; -set @stmt= ' SELECT - (SELECT SUM(c1+c12+?) FROM t2 where (t9.c2-?)=t2.c2 - GROUP BY t9.c15 LIMIT 1) as scalar_s, - exists (select ? from t2 - where t2.c3*?=t9.c4) as exists_s, - c5*? in (select c6+? from t2) as in_s, - (c7-?, c8-?) in (select c9+?, c10+? from t2) as in_row_s -FROM t9, -(select c25 x, c32 y from t2) tt WHERE x =c25 ' ; -set @arg00= 0.0 ; -set @arg01= 0e-3 ; -set @arg02= 1.0e+0 ; -set @arg03= 9.0000000000 ; -set @arg04= 4 ; -set @arg05= 0.3e+1 ; -set @arg06= 4 ; -set @arg07= 4 ; -set @arg08= 4.0 ; -set @arg09= 40e-1 ; -prepare stmt1 from @stmt ; -execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, -@arg07, @arg08, @arg09 ; -execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, -@arg07, @arg08, @arg09 ; -set @stmt= concat('explain ',@stmt); -prepare stmt1 from @stmt ; -execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, -@arg07, @arg08, @arg09 ; -execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, -@arg07, @arg08, @arg09 ; -drop table t2 ; -select 1 < (select a from t1) ; -ERROR 21000: Subquery returns more than 1 row -prepare stmt1 from ' select 1 < (select a from t1) ' ; -execute stmt1 ; -ERROR 21000: Subquery returns more than 1 row -select 1 as my_col ; -my_col -1 -test_sequence ------- union tests ------ -prepare stmt1 from ' select a FROM t1 where a=1 - union distinct - select a FROM t1 where a=1 '; -execute stmt1 ; -a -1 -execute stmt1 ; -a -1 -prepare stmt1 from ' select a FROM t1 where a=1 - union all - select a FROM t1 where a=1 '; -execute stmt1 ; -a -1 -1 -prepare stmt1 from ' SELECT 1, 2 union SELECT 1 ' ; -ERROR 21000: The used SELECT statements have a different number of columns -prepare stmt1 from ' SELECT 1 union SELECT 1, 2 ' ; -ERROR 21000: The used SELECT statements have a different number of columns -prepare stmt1 from ' SELECT * from t1 union SELECT 1 ' ; -ERROR 21000: The used SELECT statements have a different number of columns -prepare stmt1 from ' SELECT 1 union SELECT * from t1 ' ; -ERROR 21000: The used SELECT statements have a different number of columns -set @arg00=1 ; -select @arg00 FROM t1 where a=1 -union distinct -select 1 FROM t1 where a=1; -@arg00 -1 -prepare stmt1 from ' select ? FROM t1 where a=1 - union distinct - select 1 FROM t1 where a=1 ' ; -execute stmt1 using @arg00; -? -1 -set @arg00=1 ; -select 1 FROM t1 where a=1 -union distinct -select @arg00 FROM t1 where a=1; -1 -1 -prepare stmt1 from ' select 1 FROM t1 where a=1 - union distinct - select ? FROM t1 where a=1 ' ; -execute stmt1 using @arg00; -1 -1 -set @arg00='a' ; -select @arg00 FROM t1 where a=1 -union distinct -select @arg00 FROM t1 where a=1; -@arg00 -a -prepare stmt1 from ' select ? FROM t1 where a=1 - union distinct - select ? FROM t1 where a=1 '; -execute stmt1 using @arg00, @arg00; -? -a -prepare stmt1 from ' select ? - union distinct - select ? '; -execute stmt1 using @arg00, @arg00; -? -a -set @arg00='a' ; -set @arg01=1 ; -set @arg02='a' ; -set @arg03=2 ; -select @arg00 FROM t1 where a=@arg01 -union distinct -select @arg02 FROM t1 where a=@arg03; -@arg00 -a -prepare stmt1 from ' select ? FROM t1 where a=? - union distinct - select ? FROM t1 where a=? ' ; -execute stmt1 using @arg00, @arg01, @arg02, @arg03; -? -a -set @arg00=1 ; -prepare stmt1 from ' select sum(a) + 200, ? from t1 -union distinct -select sum(a) + 200, 1 from t1 -group by b ' ; -execute stmt1 using @arg00; -sum(a) + 200 ? -210 1 -204 1 -201 1 -203 1 -202 1 -set @Oporto='Oporto' ; -set @Lisboa='Lisboa' ; -set @0=0 ; -set @1=1 ; -set @2=2 ; -set @3=3 ; -set @4=4 ; -select @Oporto,@Lisboa,@0,@1,@2,@3,@4 ; -@Oporto @Lisboa @0 @1 @2 @3 @4 -Oporto Lisboa 0 1 2 3 4 -select sum(a) + 200 as the_sum, @Oporto as the_town from t1 -group by b -union distinct -select sum(a) + 200, @Lisboa from t1 -group by b ; -the_sum the_town -204 Oporto -201 Oporto -203 Oporto -202 Oporto -204 Lisboa -201 Lisboa -203 Lisboa -202 Lisboa -prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1 - group by b - union distinct - select sum(a) + 200, ? from t1 - group by b ' ; -execute stmt1 using @Oporto, @Lisboa; -the_sum the_town -204 Oporto -201 Oporto -203 Oporto -202 Oporto -204 Lisboa -201 Lisboa -203 Lisboa -202 Lisboa -select sum(a) + 200 as the_sum, @Oporto as the_town from t1 -where a > @1 -group by b -union distinct -select sum(a) + 200, @Lisboa from t1 -where a > @2 -group by b ; -the_sum the_town -204 Oporto -203 Oporto -202 Oporto -204 Lisboa -203 Lisboa -prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1 - where a > ? - group by b - union distinct - select sum(a) + 200, ? from t1 - where a > ? - group by b ' ; -execute stmt1 using @Oporto, @1, @Lisboa, @2; -the_sum the_town -204 Oporto -203 Oporto -202 Oporto -204 Lisboa -203 Lisboa -select sum(a) + 200 as the_sum, @Oporto as the_town from t1 -where a > @1 -group by b -having avg(a) > @2 -union distinct -select sum(a) + 200, @Lisboa from t1 -where a > @2 -group by b -having avg(a) > @3; -the_sum the_town -204 Oporto -203 Oporto -204 Lisboa -prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1 - where a > ? - group by b - having avg(a) > ? - union distinct - select sum(a) + 200, ? from t1 - where a > ? - group by b - having avg(a) > ? '; -execute stmt1 using @Oporto, @1, @2, @Lisboa, @2, @3; -the_sum the_town -204 Oporto -203 Oporto -204 Lisboa -test_sequence ------- explain select tests ------ -prepare stmt1 from ' explain select * from t9 ' ; -execute stmt1; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def id 8 3 1 N 32801 0 8 -def select_type 253 19 6 N 1 31 33 -def table 253 64 2 N 1 31 33 -def type 253 10 3 N 1 31 33 -def possible_keys 253 4096 0 Y 0 31 33 -def key 253 64 0 Y 0 31 33 -def key_len 8 3 0 Y 32800 0 8 -def ref 253 1024 0 Y 0 31 33 -def rows 8 10 1 N 32801 0 8 -def Extra 253 255 0 N 1 31 33 -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t9 ALL NULL NULL NULL NULL 2 -drop table if exists t2 ; -create table t2 (s varchar(25), fulltext(s)) -ENGINE = 'MYISAM' ; -insert into t2 values ('Gravedigger'), ('Greed'),('Hollow Dogs') ; -commit ; -prepare stmt1 from ' select s from t2 where match (s) against (?) ' ; -set @arg00='Dogs' ; -execute stmt1 using @arg00 ; -s -Hollow Dogs -prepare stmt1 from ' SELECT s FROM t2 -where match (s) against (concat(?,''digger'')) '; -set @arg00='Grave' ; -execute stmt1 using @arg00 ; -s -Gravedigger -drop table t2 ; -test_sequence ------- delete tests ------ -delete from t1 ; -insert into t1 values (1,'one'); -insert into t1 values (2,'two'); -insert into t1 values (3,'three'); -insert into t1 values (4,'four'); -commit ; -delete from t9 ; -insert into t9 -set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, -c10= 1, c11= 1, c12 = 1, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=true, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t9 -set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, -c10= 9, c11= 9, c12 = 9, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=false, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; -commit ; -prepare stmt1 from 'delete from t1 where a=2' ; -execute stmt1; -select a,b from t1 where a=2; -a b -execute stmt1; -insert into t1 values(0,NULL); -set @arg00=NULL; -prepare stmt1 from 'delete from t1 where b=?' ; -execute stmt1 using @arg00; -select a,b from t1 where b is NULL ; -a b -0 NULL -set @arg00='one'; -execute stmt1 using @arg00; -select a,b from t1 where b=@arg00; -a b -prepare stmt1 from 'truncate table t1' ; -ERROR HY000: This command is not supported in the prepared statement protocol yet -test_sequence ------- update tests ------ -delete from t1 ; -insert into t1 values (1,'one'); -insert into t1 values (2,'two'); -insert into t1 values (3,'three'); -insert into t1 values (4,'four'); -commit ; -delete from t9 ; -insert into t9 -set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, -c10= 1, c11= 1, c12 = 1, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=true, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t9 -set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, -c10= 9, c11= 9, c12 = 9, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=false, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; -commit ; -prepare stmt1 from 'update t1 set b=''a=two'' where a=2' ; -execute stmt1; -select a,b from t1 where a=2; -a b -2 a=two -execute stmt1; -select a,b from t1 where a=2; -a b -2 a=two -set @arg00=NULL; -prepare stmt1 from 'update t1 set b=? where a=2' ; -execute stmt1 using @arg00; -select a,b from t1 where a=2; -a b -2 NULL -set @arg00='two'; -execute stmt1 using @arg00; -select a,b from t1 where a=2; -a b -2 two -set @arg00=2; -prepare stmt1 from 'update t1 set b=NULL where a=?' ; -execute stmt1 using @arg00; -select a,b from t1 where a=@arg00; -a b -2 NULL -update t1 set b='two' where a=@arg00; -set @arg00=2000; -execute stmt1 using @arg00; -select a,b from t1 where a=@arg00; -a b -set @arg00=2; -set @arg01=22; -prepare stmt1 from 'update t1 set a=? where a=?' ; -execute stmt1 using @arg00, @arg00; -select a,b from t1 where a=@arg00; -a b -2 two -execute stmt1 using @arg01, @arg00; -select a,b from t1 where a=@arg01; -a b -22 two -execute stmt1 using @arg00, @arg01; -select a,b from t1 where a=@arg00; -a b -2 two -set @arg00=NULL; -set @arg01=2; -execute stmt1 using @arg00, @arg01; -Warnings: -Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 1 -select a,b from t1 order by a; -a b -0 two -1 one -3 three -4 four -set @arg00=0; -execute stmt1 using @arg01, @arg00; -select a,b from t1 order by a; -a b -1 one -2 two -3 three -4 four -set @arg00=23; -set @arg01='two'; -set @arg02=2; -set @arg03='two'; -set @arg04=2; -drop table if exists t2; -create table t2 as select a,b from t1 ; -prepare stmt1 from 'update t1 set a=? where b=? - and a in (select ? from t2 - where b = ? or a = ?)'; -execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04 ; -affected rows: 1 -info: Rows matched: 1 Changed: 1 Warnings: 0 -select a,b from t1 where a = @arg00 ; -a b -23 two -prepare stmt1 from 'update t1 set a=? where b=? - and a not in (select ? from t2 - where b = ? or a = ?)'; -execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ; -affected rows: 1 -info: Rows matched: 1 Changed: 1 Warnings: 0 -select a,b from t1 order by a ; -a b -1 one -2 two -3 three -4 four -drop table t2 ; -create table t2 -( -a int, b varchar(30), -primary key(a) -) engine = 'MYISAM' ; -insert into t2(a,b) select a, b from t1 ; -prepare stmt1 from 'update t1 set a=? where b=? - and a in (select ? from t2 - where b = ? or a = ?)'; -execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04 ; -affected rows: 1 -info: Rows matched: 1 Changed: 1 Warnings: 0 -select a,b from t1 where a = @arg00 ; -a b -23 two -prepare stmt1 from 'update t1 set a=? where b=? - and a not in (select ? from t2 - where b = ? or a = ?)'; -execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ; -affected rows: 1 -info: Rows matched: 1 Changed: 1 Warnings: 0 -select a,b from t1 order by a ; -a b -1 one -2 two -3 three -4 four -drop table t2 ; -set @arg00=1; -prepare stmt1 from 'update t1 set b=''bla'' -where a=2 -limit 1'; -execute stmt1 ; -select a,b from t1 where b = 'bla' ; -a b -2 bla -prepare stmt1 from 'update t1 set b=''bla'' -where a=2 -limit ?'; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?' at line 3 -test_sequence ------- insert tests ------ -delete from t1 ; -insert into t1 values (1,'one'); -insert into t1 values (2,'two'); -insert into t1 values (3,'three'); -insert into t1 values (4,'four'); -commit ; -delete from t9 ; -insert into t9 -set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, -c10= 1, c11= 1, c12 = 1, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=true, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t9 -set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, -c10= 9, c11= 9, c12 = 9, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=false, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; -commit ; -prepare stmt1 from 'insert into t1 values(5, ''five'' )'; -execute stmt1; -select a,b from t1 where a = 5; -a b -5 five -set @arg00='six' ; -prepare stmt1 from 'insert into t1 values(6, ? )'; -execute stmt1 using @arg00; -select a,b from t1 where b = @arg00; -a b -6 six -execute stmt1 using @arg00; -ERROR 23000: Duplicate entry '6' for key 1 -set @arg00=NULL ; -prepare stmt1 from 'insert into t1 values(0, ? )'; -execute stmt1 using @arg00; -select a,b from t1 where b is NULL; -a b -0 NULL -set @arg00=8 ; -set @arg01='eight' ; -prepare stmt1 from 'insert into t1 values(?, ? )'; -execute stmt1 using @arg00, @arg01 ; -select a,b from t1 where b = @arg01; -a b -8 eight -set @NULL= null ; -set @arg00= 'abc' ; -execute stmt1 using @NULL, @NULL ; -ERROR 23000: Column 'a' cannot be null -execute stmt1 using @NULL, @NULL ; -ERROR 23000: Column 'a' cannot be null -execute stmt1 using @NULL, @arg00 ; -ERROR 23000: Column 'a' cannot be null -execute stmt1 using @NULL, @arg00 ; -ERROR 23000: Column 'a' cannot be null -set @arg01= 10000 + 2 ; -execute stmt1 using @arg01, @arg00 ; -set @arg01= 10000 + 1 ; -execute stmt1 using @arg01, @arg00 ; -select * from t1 where a > 10000 order by a ; -a b -10001 abc -10002 abc -delete from t1 where a > 10000 ; -set @arg01= 10000 + 2 ; -execute stmt1 using @arg01, @NULL ; -set @arg01= 10000 + 1 ; -execute stmt1 using @arg01, @NULL ; -select * from t1 where a > 10000 order by a ; -a b -10001 NULL -10002 NULL -delete from t1 where a > 10000 ; -set @arg01= 10000 + 10 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 9 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 8 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 7 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 6 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 5 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 4 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 3 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 2 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 1 ; -execute stmt1 using @arg01, @arg01 ; -select * from t1 where a > 10000 order by a ; -a b -10001 10001 -10002 10002 -10003 10003 -10004 10004 -10005 10005 -10006 10006 -10007 10007 -10008 10008 -10009 10009 -10010 10010 -delete from t1 where a > 10000 ; -set @arg00=81 ; -set @arg01='8-1' ; -set @arg02=82 ; -set @arg03='8-2' ; -prepare stmt1 from 'insert into t1 values(?,?),(?,?)'; -execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; -select a,b from t1 where a in (@arg00,@arg02) ; -a b -81 8-1 -82 8-2 -set @arg00=9 ; -set @arg01='nine' ; -prepare stmt1 from 'insert into t1 set a=?, b=? '; -execute stmt1 using @arg00, @arg01 ; -select a,b from t1 where a = @arg00 ; -a b -9 nine -set @arg00=6 ; -set @arg01=1 ; -prepare stmt1 from 'insert into t1 set a=?, b=''sechs'' - on duplicate key update a=a + ?, b=concat(b,''modified'') '; -execute stmt1 using @arg00, @arg01; -select * from t1 order by a; -a b -0 NULL -1 one -2 two -3 three -4 four -5 five -7 sixmodified -8 eight -9 nine -81 8-1 -82 8-2 -set @arg00=81 ; -set @arg01=1 ; -execute stmt1 using @arg00, @arg01; -ERROR 23000: Duplicate entry '82' for key 1 -drop table if exists t2 ; -create table t2 (id int auto_increment primary key) -ENGINE= 'MYISAM' ; -prepare stmt1 from ' select last_insert_id() ' ; -insert into t2 values (NULL) ; -execute stmt1 ; -last_insert_id() -1 -insert into t2 values (NULL) ; -execute stmt1 ; -last_insert_id() -2 -drop table t2 ; -set @1000=1000 ; -set @x1000_2="x1000_2" ; -set @x1000_3="x1000_3" ; -set @x1000="x1000" ; -set @1100=1100 ; -set @x1100="x1100" ; -set @100=100 ; -set @updated="updated" ; -insert into t1 values(1000,'x1000_1') ; -insert into t1 values(@1000,@x1000_2),(@1000,@x1000_3) -on duplicate key update a = a + @100, b = concat(b,@updated) ; -select a,b from t1 where a >= 1000 order by a ; -a b -1000 x1000_3 -1100 x1000_1updated -delete from t1 where a >= 1000 ; -insert into t1 values(1000,'x1000_1') ; -prepare stmt1 from ' insert into t1 values(?,?),(?,?) - on duplicate key update a = a + ?, b = concat(b,?) '; -execute stmt1 using @1000, @x1000_2, @1000, @x1000_3, @100, @updated ; -select a,b from t1 where a >= 1000 order by a ; -a b -1000 x1000_3 -1100 x1000_1updated -delete from t1 where a >= 1000 ; -insert into t1 values(1000,'x1000_1') ; -execute stmt1 using @1000, @x1000_2, @1100, @x1000_3, @100, @updated ; -select a,b from t1 where a >= 1000 order by a ; -a b -1200 x1000_1updatedupdated -delete from t1 where a >= 1000 ; -prepare stmt1 from ' replace into t1 (a,b) select 100, ''hundred'' '; -execute stmt1; -execute stmt1; -execute stmt1; -test_sequence ------- multi table tests ------ -delete from t1 ; -delete from t9 ; -insert into t1(a,b) values (1, 'one'), (2, 'two'), (3, 'three') ; -insert into t9 (c1,c21) -values (1, 'one'), (2, 'two'), (3, 'three') ; -prepare stmt_delete from " delete t1, t9 - from t1, t9 where t1.a=t9.c1 and t1.b='updated' "; -prepare stmt_update from " update t1, t9 - set t1.b='updated', t9.c21='updated' - where t1.a=t9.c1 and t1.a=? "; -prepare stmt_select1 from " select a, b from t1 order by a" ; -prepare stmt_select2 from " select c1, c21 from t9 order by c1" ; -set @arg00= 1 ; -execute stmt_update using @arg00 ; -execute stmt_delete ; -execute stmt_select1 ; -a b -2 two -3 three -execute stmt_select2 ; -c1 c21 -2 two -3 three -set @arg00= @arg00 + 1 ; -execute stmt_update using @arg00 ; -execute stmt_delete ; -execute stmt_select1 ; -a b -3 three -execute stmt_select2 ; -c1 c21 -3 three -set @arg00= @arg00 + 1 ; -execute stmt_update using @arg00 ; -execute stmt_delete ; -execute stmt_select1 ; -a b -execute stmt_select2 ; -c1 c21 -set @arg00= @arg00 + 1 ; -delete from t1 ; -insert into t1 values (1,'one'); -insert into t1 values (2,'two'); -insert into t1 values (3,'three'); -insert into t1 values (4,'four'); -commit ; -delete from t9 ; -insert into t9 -set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, -c10= 1, c11= 1, c12 = 1, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=true, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t9 -set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, -c10= 9, c11= 9, c12 = 9, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=false, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; -commit ; -insert into t1 values(0,NULL) ; -set @duplicate='duplicate ' ; -set @1000=1000 ; -set @5=5 ; -select a,b from t1 where a < 5 order by a ; -a b -0 NULL -1 one -2 two -3 three -4 four -insert into t1 select a + @1000, concat(@duplicate,b) from t1 -where a < @5 ; -affected rows: 5 -info: Records: 5 Duplicates: 0 Warnings: 0 -select a,b from t1 where a >= 1000 order by a ; -a b -1000 NULL -1001 duplicate one -1002 duplicate two -1003 duplicate three -1004 duplicate four -delete from t1 where a >= 1000 ; -prepare stmt1 from ' insert into t1 select a + ?, concat(?,b) from t1 -where a < ? ' ; -execute stmt1 using @1000, @duplicate, @5; -affected rows: 5 -info: Records: 5 Duplicates: 0 Warnings: 0 -select a,b from t1 where a >= 1000 order by a ; -a b -1000 NULL -1001 duplicate one -1002 duplicate two -1003 duplicate three -1004 duplicate four -delete from t1 where a >= 1000 ; -set @float=1.00; -set @five='five' ; -drop table if exists t2; -create table t2 like t1 ; -insert into t2 (b,a) -select @duplicate, sum(first.a) from t1 first, t1 second -where first.a <> @5 and second.b = first.b -and second.b <> @five -group by second.b -having sum(second.a) > @2 -union -select b, a + @100 from t1 -where (a,b) in ( select sqrt(a+@1)+CAST(@float AS signed),b -from t1); -affected rows: 3 -info: Records: 3 Duplicates: 0 Warnings: 0 -select a,b from t2 order by a ; -a b -3 duplicate -4 duplicate -103 three -delete from t2 ; -prepare stmt1 from ' insert into t2 (b,a) -select ?, sum(first.a) - from t1 first, t1 second - where first.a <> ? and second.b = first.b and second.b <> ? - group by second.b - having sum(second.a) > ? -union -select b, a + ? from t1 - where (a,b) in ( select sqrt(a+?)+CAST(? AS signed),b - from t1 ) ' ; -execute stmt1 using @duplicate, @5, @five, @2, @100, @1, @float ; -affected rows: 3 -info: Records: 3 Duplicates: 0 Warnings: 0 -select a,b from t2 order by a ; -a b -3 duplicate -4 duplicate -103 three -drop table t2; -drop table if exists t5 ; -set @arg01= 8; -set @arg02= 8.0; -set @arg03= 80.00000000000e-1; -set @arg04= 'abc' ; -set @arg05= CAST('abc' as binary) ; -set @arg06= '1991-08-05' ; -set @arg07= CAST('1991-08-05' as date); -set @arg08= '1991-08-05 01:01:01' ; -set @arg09= CAST('1991-08-05 01:01:01' as datetime) ; -set @arg10= unix_timestamp('1991-01-01 01:01:01'); -set @arg11= YEAR('1991-01-01 01:01:01'); -set @arg12= 8 ; -set @arg12= NULL ; -set @arg13= 8.0 ; -set @arg13= NULL ; -set @arg14= 'abc'; -set @arg14= NULL ; -set @arg15= CAST('abc' as binary) ; -set @arg15= NULL ; -create table t5 as select -8 as const01, @arg01 as param01, -8.0 as const02, @arg02 as param02, -80.00000000000e-1 as const03, @arg03 as param03, -'abc' as const04, @arg04 as param04, -CAST('abc' as binary) as const05, @arg05 as param05, -'1991-08-05' as const06, @arg06 as param06, -CAST('1991-08-05' as date) as const07, @arg07 as param07, -'1991-08-05 01:01:01' as const08, @arg08 as param08, -CAST('1991-08-05 01:01:01' as datetime) as const09, @arg09 as param09, -unix_timestamp('1991-01-01 01:01:01') as const10, @arg10 as param10, -YEAR('1991-01-01 01:01:01') as const11, @arg11 as param11, -NULL as const12, @arg12 as param12, -@arg13 as param13, -@arg14 as param14, -@arg15 as param15; -show create table t5 ; -Table Create Table -t5 CREATE TABLE `t5` ( - `const01` bigint(1) NOT NULL default '0', - `param01` bigint(20) default NULL, - `const02` double(3,1) NOT NULL default '0.0', - `param02` double default NULL, - `const03` double NOT NULL default '0', - `param03` double default NULL, - `const04` char(3) NOT NULL default '', - `param04` longtext, - `const05` binary(3) NOT NULL default '', - `param05` longblob, - `const06` varchar(10) NOT NULL default '', - `param06` longtext, - `const07` date default NULL, - `param07` longblob, - `const08` varchar(19) NOT NULL default '', - `param08` longtext, - `const09` datetime default NULL, - `param09` longblob, - `const10` int(10) NOT NULL default '0', - `param10` bigint(20) default NULL, - `const11` int(4) default NULL, - `param11` bigint(20) default NULL, - `const12` binary(0) default NULL, - `param12` bigint(20) default NULL, - `param13` double default NULL, - `param14` longtext, - `param15` longblob -) ENGINE=MyISAM DEFAULT CHARSET=latin1 -select * from t5 ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def test t5 t5 const01 const01 8 1 1 N 32769 0 63 -def test t5 t5 param01 param01 8 20 1 Y 32768 0 63 -def test t5 t5 const02 const02 5 3 3 N 32769 1 63 -def test t5 t5 param02 param02 5 20 1 Y 32768 31 63 -def test t5 t5 const03 const03 5 23 1 N 32769 31 63 -def test t5 t5 param03 param03 5 20 1 Y 32768 31 63 -def test t5 t5 const04 const04 254 3 3 N 1 0 8 -def test t5 t5 param04 param04 252 16777215 3 Y 16 0 8 -def test t5 t5 const05 const05 254 3 3 N 129 0 63 -def test t5 t5 param05 param05 252 16777215 3 Y 144 0 63 -def test t5 t5 const06 const06 253 10 10 N 1 0 8 -def test t5 t5 param06 param06 252 16777215 10 Y 16 0 8 -def test t5 t5 const07 const07 10 10 10 Y 128 0 63 -def test t5 t5 param07 param07 252 16777215 10 Y 144 0 63 -def test t5 t5 const08 const08 253 19 19 N 1 0 8 -def test t5 t5 param08 param08 252 16777215 19 Y 16 0 8 -def test t5 t5 const09 const09 12 19 19 Y 128 0 63 -def test t5 t5 param09 param09 252 16777215 19 Y 144 0 63 -def test t5 t5 const10 const10 3 10 9 N 32769 0 63 -def test t5 t5 param10 param10 8 20 9 Y 32768 0 63 -def test t5 t5 const11 const11 3 4 4 Y 32768 0 63 -def test t5 t5 param11 param11 8 20 4 Y 32768 0 63 -def test t5 t5 const12 const12 254 0 0 Y 128 0 63 -def test t5 t5 param12 param12 8 20 0 Y 32768 0 63 -def test t5 t5 param13 param13 5 20 0 Y 32768 31 63 -def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8 -def test t5 t5 param15 param15 252 16777215 0 Y 144 0 63 -const01 8 -param01 8 -const02 8.0 -param02 8 -const03 8 -param03 8 -const04 abc -param04 abc -const05 abc -param05 abc -const06 1991-08-05 -param06 1991-08-05 -const07 1991-08-05 -param07 1991-08-05 -const08 1991-08-05 01:01:01 -param08 1991-08-05 01:01:01 -const09 1991-08-05 01:01:01 -param09 1991-08-05 01:01:01 -const10 662680861 -param10 662680861 -const11 1991 -param11 1991 -const12 NULL -param12 NULL -param13 NULL -param14 NULL -param15 NULL -drop table t5 ; -test_sequence ------- data type conversion tests ------ -delete from t1 ; -insert into t1 values (1,'one'); -insert into t1 values (2,'two'); -insert into t1 values (3,'three'); -insert into t1 values (4,'four'); -commit ; -delete from t9 ; -insert into t9 -set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, -c10= 1, c11= 1, c12 = 1, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=true, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t9 -set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, -c10= 9, c11= 9, c12 = 9, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=false, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; -commit ; -insert into t9 set c1= 0, c15= '1991-01-01 01:01:01' ; -select * from t9 order by c1 ; -c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32 -0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday -test_sequence ------- select @parameter:= column ------ -prepare full_info from "select @arg01, @arg02, @arg03, @arg04, - @arg05, @arg06, @arg07, @arg08, - @arg09, @arg10, @arg11, @arg12, - @arg13, @arg14, @arg15, @arg16, - @arg17, @arg18, @arg19, @arg20, - @arg21, @arg22, @arg23, @arg24, - @arg25, @arg26, @arg27, @arg28, - @arg29, @arg30, @arg31, @arg32" ; -select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, -@arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8, -@arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12, -@arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16, -@arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20, -@arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24, -@arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28, -@arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32 -from t9 where c1= 1 ; -@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 -1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 1 Y 128 31 63 -def @arg03 254 20 1 Y 128 31 63 -def @arg04 254 20 1 Y 128 31 63 -def @arg05 254 20 1 Y 128 31 63 -def @arg06 254 20 1 Y 128 31 63 -def @arg07 254 20 1 Y 128 31 63 -def @arg08 254 20 1 Y 128 31 63 -def @arg09 254 20 1 Y 128 31 63 -def @arg10 254 20 1 Y 128 31 63 -def @arg11 254 20 1 Y 128 31 63 -def @arg12 254 20 1 Y 128 31 63 -def @arg13 254 8192 10 Y 128 31 63 -def @arg14 254 8192 19 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 8 Y 128 31 63 -def @arg17 254 20 4 Y 128 31 63 -def @arg18 254 20 1 Y 128 31 63 -def @arg19 254 20 1 Y 128 31 63 -def @arg20 254 8192 1 Y 0 31 8 -def @arg21 254 8192 10 Y 0 31 8 -def @arg22 254 8192 30 Y 0 31 8 -def @arg23 254 8192 8 Y 128 31 63 -def @arg24 254 8192 8 Y 0 31 8 -def @arg25 254 8192 4 Y 128 31 63 -def @arg26 254 8192 4 Y 0 31 8 -def @arg27 254 8192 10 Y 128 31 63 -def @arg28 254 8192 10 Y 0 31 8 -def @arg29 254 8192 8 Y 128 31 63 -def @arg30 254 8192 8 Y 0 31 8 -def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, -@arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8, -@arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12, -@arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16, -@arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20, -@arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24, -@arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28, -@arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32 -from t9 where c1= 0 ; -@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 -0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 0 Y 128 31 63 -def @arg03 254 20 0 Y 128 31 63 -def @arg04 254 20 0 Y 128 31 63 -def @arg05 254 20 0 Y 128 31 63 -def @arg06 254 20 0 Y 128 31 63 -def @arg07 254 20 0 Y 128 31 63 -def @arg08 254 20 0 Y 128 31 63 -def @arg09 254 20 0 Y 128 31 63 -def @arg10 254 20 0 Y 128 31 63 -def @arg11 254 20 0 Y 128 31 63 -def @arg12 254 20 0 Y 128 31 63 -def @arg13 254 8192 0 Y 128 31 63 -def @arg14 254 8192 0 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 0 Y 128 31 63 -def @arg17 254 20 0 Y 128 31 63 -def @arg18 254 20 0 Y 128 31 63 -def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 0 31 8 -def @arg21 254 8192 0 Y 0 31 8 -def @arg22 254 8192 0 Y 0 31 8 -def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 0 31 8 -def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 0 31 8 -def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 0 31 8 -def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 0 31 8 -def @arg31 254 8192 0 Y 0 31 8 -def @arg32 254 8192 0 Y 0 31 8 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -prepare stmt1 from "select - @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, - @arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8, - @arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12, - @arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16, - @arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20, - @arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24, - @arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28, - @arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32 -from t9 where c1= ?" ; -set @my_key= 1 ; -execute stmt1 using @my_key ; -@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 -1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 1 Y 128 31 63 -def @arg03 254 20 1 Y 128 31 63 -def @arg04 254 20 1 Y 128 31 63 -def @arg05 254 20 1 Y 128 31 63 -def @arg06 254 20 1 Y 128 31 63 -def @arg07 254 20 1 Y 128 31 63 -def @arg08 254 20 1 Y 128 31 63 -def @arg09 254 20 1 Y 128 31 63 -def @arg10 254 20 1 Y 128 31 63 -def @arg11 254 20 1 Y 128 31 63 -def @arg12 254 20 1 Y 128 31 63 -def @arg13 254 8192 10 Y 128 31 63 -def @arg14 254 8192 19 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 8 Y 128 31 63 -def @arg17 254 20 4 Y 128 31 63 -def @arg18 254 20 1 Y 128 31 63 -def @arg19 254 20 1 Y 128 31 63 -def @arg20 254 8192 1 Y 0 31 8 -def @arg21 254 8192 10 Y 0 31 8 -def @arg22 254 8192 30 Y 0 31 8 -def @arg23 254 8192 8 Y 128 31 63 -def @arg24 254 8192 8 Y 0 31 8 -def @arg25 254 8192 4 Y 128 31 63 -def @arg26 254 8192 4 Y 0 31 8 -def @arg27 254 8192 10 Y 128 31 63 -def @arg28 254 8192 10 Y 0 31 8 -def @arg29 254 8192 8 Y 128 31 63 -def @arg30 254 8192 8 Y 0 31 8 -def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -set @my_key= 0 ; -execute stmt1 using @my_key ; -@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 -0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 0 Y 128 31 63 -def @arg03 254 20 0 Y 128 31 63 -def @arg04 254 20 0 Y 128 31 63 -def @arg05 254 20 0 Y 128 31 63 -def @arg06 254 20 0 Y 128 31 63 -def @arg07 254 20 0 Y 128 31 63 -def @arg08 254 20 0 Y 128 31 63 -def @arg09 254 20 0 Y 128 31 63 -def @arg10 254 20 0 Y 128 31 63 -def @arg11 254 20 0 Y 128 31 63 -def @arg12 254 20 0 Y 128 31 63 -def @arg13 254 8192 0 Y 128 31 63 -def @arg14 254 8192 0 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 0 Y 128 31 63 -def @arg17 254 20 0 Y 128 31 63 -def @arg18 254 20 0 Y 128 31 63 -def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 0 31 8 -def @arg21 254 8192 0 Y 0 31 8 -def @arg22 254 8192 0 Y 0 31 8 -def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 0 31 8 -def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 0 31 8 -def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 0 31 8 -def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 0 31 8 -def @arg31 254 8192 0 Y 0 31 8 -def @arg32 254 8192 0 Y 0 31 8 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -prepare stmt1 from "select ? := c1 from t9 where c1= 1" ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':= c1 from t9 where c1= 1' at line 1 -test_sequence ------- select column, .. into @parm,.. ------ -select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, -c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, -c25, c26, c27, c28, c29, c30, c31, c32 -into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, -@arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, -@arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24, -@arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 -from t9 where c1= 1 ; -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 1 Y 128 31 63 -def @arg03 254 20 1 Y 128 31 63 -def @arg04 254 20 1 Y 128 31 63 -def @arg05 254 20 1 Y 128 31 63 -def @arg06 254 20 1 Y 128 31 63 -def @arg07 254 20 1 Y 128 31 63 -def @arg08 254 20 1 Y 128 31 63 -def @arg09 254 20 1 Y 128 31 63 -def @arg10 254 20 1 Y 128 31 63 -def @arg11 254 20 1 Y 128 31 63 -def @arg12 254 20 1 Y 128 31 63 -def @arg13 254 8192 10 Y 128 31 63 -def @arg14 254 8192 19 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 8 Y 128 31 63 -def @arg17 254 20 4 Y 128 31 63 -def @arg18 254 20 1 Y 128 31 63 -def @arg19 254 20 1 Y 128 31 63 -def @arg20 254 8192 1 Y 0 31 8 -def @arg21 254 8192 10 Y 0 31 8 -def @arg22 254 8192 30 Y 0 31 8 -def @arg23 254 8192 8 Y 128 31 63 -def @arg24 254 8192 8 Y 0 31 8 -def @arg25 254 8192 4 Y 128 31 63 -def @arg26 254 8192 4 Y 0 31 8 -def @arg27 254 8192 10 Y 128 31 63 -def @arg28 254 8192 10 Y 0 31 8 -def @arg29 254 8192 8 Y 128 31 63 -def @arg30 254 8192 8 Y 0 31 8 -def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, -c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, -c25, c26, c27, c28, c29, c30, c31, c32 -into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, -@arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, -@arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24, -@arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 -from t9 where c1= 0 ; -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 0 Y 128 31 63 -def @arg03 254 20 0 Y 128 31 63 -def @arg04 254 20 0 Y 128 31 63 -def @arg05 254 20 0 Y 128 31 63 -def @arg06 254 20 0 Y 128 31 63 -def @arg07 254 20 0 Y 128 31 63 -def @arg08 254 20 0 Y 128 31 63 -def @arg09 254 20 0 Y 128 31 63 -def @arg10 254 20 0 Y 128 31 63 -def @arg11 254 20 0 Y 128 31 63 -def @arg12 254 20 0 Y 128 31 63 -def @arg13 254 8192 0 Y 128 31 63 -def @arg14 254 8192 0 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 0 Y 128 31 63 -def @arg17 254 20 0 Y 128 31 63 -def @arg18 254 20 0 Y 128 31 63 -def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 0 31 8 -def @arg21 254 8192 0 Y 0 31 8 -def @arg22 254 8192 0 Y 0 31 8 -def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 0 31 8 -def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 0 31 8 -def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 0 31 8 -def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 0 31 8 -def @arg31 254 8192 0 Y 0 31 8 -def @arg32 254 8192 0 Y 0 31 8 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -prepare stmt1 from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, - c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, - c25, c26, c27, c28, c29, c30, c31, c32 -into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, - @arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, - @arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24, - @arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 -from t9 where c1= ?" ; -set @my_key= 1 ; -execute stmt1 using @my_key ; -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 1 Y 128 31 63 -def @arg03 254 20 1 Y 128 31 63 -def @arg04 254 20 1 Y 128 31 63 -def @arg05 254 20 1 Y 128 31 63 -def @arg06 254 20 1 Y 128 31 63 -def @arg07 254 20 1 Y 128 31 63 -def @arg08 254 20 1 Y 128 31 63 -def @arg09 254 20 1 Y 128 31 63 -def @arg10 254 20 1 Y 128 31 63 -def @arg11 254 20 1 Y 128 31 63 -def @arg12 254 20 1 Y 128 31 63 -def @arg13 254 8192 10 Y 128 31 63 -def @arg14 254 8192 19 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 8 Y 128 31 63 -def @arg17 254 20 4 Y 128 31 63 -def @arg18 254 20 1 Y 128 31 63 -def @arg19 254 20 1 Y 128 31 63 -def @arg20 254 8192 1 Y 0 31 8 -def @arg21 254 8192 10 Y 0 31 8 -def @arg22 254 8192 30 Y 0 31 8 -def @arg23 254 8192 8 Y 128 31 63 -def @arg24 254 8192 8 Y 0 31 8 -def @arg25 254 8192 4 Y 128 31 63 -def @arg26 254 8192 4 Y 0 31 8 -def @arg27 254 8192 10 Y 128 31 63 -def @arg28 254 8192 10 Y 0 31 8 -def @arg29 254 8192 8 Y 128 31 63 -def @arg30 254 8192 8 Y 0 31 8 -def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -set @my_key= 0 ; -execute stmt1 using @my_key ; -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 0 Y 128 31 63 -def @arg03 254 20 0 Y 128 31 63 -def @arg04 254 20 0 Y 128 31 63 -def @arg05 254 20 0 Y 128 31 63 -def @arg06 254 20 0 Y 128 31 63 -def @arg07 254 20 0 Y 128 31 63 -def @arg08 254 20 0 Y 128 31 63 -def @arg09 254 20 0 Y 128 31 63 -def @arg10 254 20 0 Y 128 31 63 -def @arg11 254 20 0 Y 128 31 63 -def @arg12 254 20 0 Y 128 31 63 -def @arg13 254 8192 0 Y 128 31 63 -def @arg14 254 8192 0 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 0 Y 128 31 63 -def @arg17 254 20 0 Y 128 31 63 -def @arg18 254 20 0 Y 128 31 63 -def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 0 31 8 -def @arg21 254 8192 0 Y 0 31 8 -def @arg22 254 8192 0 Y 0 31 8 -def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 0 31 8 -def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 0 31 8 -def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 0 31 8 -def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 0 31 8 -def @arg31 254 8192 0 Y 0 31 8 -def @arg32 254 8192 0 Y 0 31 8 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -prepare stmt1 from "select c1 into ? from t9 where c1= 1" ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? from t9 where c1= 1' at line 1 -test_sequence --- insert into numeric columns -- -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20 ) ; -set @arg00= 21 ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ) ; -prepare stmt1 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22 )" ; -execute stmt1 ; -set @arg00= 23; -prepare stmt2 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, -30.0, 30.0, 30.0 ) ; -set @arg00= 31.0 ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ) ; -prepare stmt1 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, - 32.0, 32.0, 32.0 )" ; -execute stmt1 ; -set @arg00= 33.0; -prepare stmt2 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( '40', '40', '40', '40', '40', '40', '40', '40', -'40', '40', '40' ) ; -set @arg00= '41' ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ) ; -prepare stmt1 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( '42', '42', '42', '42', '42', '42', '42', '42', - '42', '42', '42' )" ; -execute stmt1 ; -set @arg00= '43'; -prepare stmt2 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( CAST('50' as binary), CAST('50' as binary), -CAST('50' as binary), CAST('50' as binary), CAST('50' as binary), -CAST('50' as binary), CAST('50' as binary), CAST('50' as binary), -CAST('50' as binary), CAST('50' as binary), CAST('50' as binary) ) ; -set @arg00= CAST('51' as binary) ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ) ; -prepare stmt1 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( CAST('52' as binary), CAST('52' as binary), - CAST('52' as binary), CAST('52' as binary), CAST('52' as binary), - CAST('52' as binary), CAST('52' as binary), CAST('52' as binary), - CAST('52' as binary), CAST('52' as binary), CAST('52' as binary) )" ; -execute stmt1 ; -set @arg00= CAST('53' as binary) ; -prepare stmt2 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -set @arg00= 2 ; -set @arg00= NULL ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( 60, NULL, NULL, NULL, NULL, NULL, NULL, NULL, -NULL, NULL, NULL ) ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( 61, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ) ; -prepare stmt1 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( 62, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL )" ; -execute stmt1 ; -prepare stmt2 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( 63, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -set @arg00= 8.0 ; -set @arg00= NULL ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( 71, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ) ; -prepare stmt2 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( 73, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -set @arg00= 'abc' ; -set @arg00= NULL ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( 81, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ) ; -prepare stmt2 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( 83, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 -from t9 where c1 >= 20 -order by c1 ; -c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c12 -20 20 20 20 20 20 20 20 20 20 20.0000 -21 21 21 21 21 21 21 21 21 21 21.0000 -22 22 22 22 22 22 22 22 22 22 22.0000 -23 23 23 23 23 23 23 23 23 23 23.0000 -30 30 30 30 30 30 30 30 30 30 30.0000 -31 31 31 31 31 31 31 31 31 31 31.0000 -32 32 32 32 32 32 32 32 32 32 32.0000 -33 33 33 33 33 33 33 33 33 33 33.0000 -40 40 40 40 40 40 40 40 40 40 40.0000 -41 41 41 41 41 41 41 41 41 41 41.0000 -42 42 42 42 42 42 42 42 42 42 42.0000 -43 43 43 43 43 43 43 43 43 43 43.0000 -50 50 50 50 50 50 50 50 50 50 50.0000 -51 51 51 51 51 51 51 51 51 51 51.0000 -52 52 52 52 52 52 52 52 52 52 52.0000 -53 53 53 53 53 53 53 53 53 53 53.0000 -60 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -61 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -62 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -63 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -71 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -73 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -81 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -83 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -test_sequence --- select .. where numeric column = .. -- -set @arg00= 20; -select 'true' as found from t9 -where c1= 20 and c2= 20 and c3= 20 and c4= 20 and c5= 20 and c6= 20 and c7= 20 -and c8= 20 and c9= 20 and c10= 20 and c12= 20; -found -true -select 'true' as found from t9 -where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 -and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 -and c12= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c2= 20 and c3= 20 and c4= 20 and c5= 20 and c6= 20 and c7= 20 - and c8= 20 and c9= 20 and c10= 20 and c12= 20 "; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? - and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? - and c12= ? "; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -found -true -set @arg00= 20.0; -select 'true' as found from t9 -where c1= 20.0 and c2= 20.0 and c3= 20.0 and c4= 20.0 and c5= 20.0 and c6= 20.0 -and c7= 20.0 and c8= 20.0 and c9= 20.0 and c10= 20.0 and c12= 20.0; -found -true -select 'true' as found from t9 -where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 -and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 -and c12= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20.0 and c2= 20.0 and c3= 20.0 and c4= 20.0 and c5= 20.0 and c6= 20.0 - and c7= 20.0 and c8= 20.0 and c9= 20.0 and c10= 20.0 and c12= 20.0 "; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? - and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? - and c12= ? "; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -found -true -select 'true' as found from t9 -where c1= '20' and c2= '20' and c3= '20' and c4= '20' and c5= '20' and c6= '20' - and c7= '20' and c8= '20' and c9= '20' and c10= '20' and c12= '20'; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= '20' and c2= '20' and c3= '20' and c4= '20' and c5= '20' and c6= '20' - and c7= '20' and c8= '20' and c9= '20' and c10= '20' and c12= '20' "; -execute stmt1 ; -found -true -set @arg00= '20'; -select 'true' as found from t9 -where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 -and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 -and c12= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? - and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? - and c12= ? "; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -found -true -select 'true' as found from t9 -where c1= CAST('20' as binary) and c2= CAST('20' as binary) and -c3= CAST('20' as binary) and c4= CAST('20' as binary) and -c5= CAST('20' as binary) and c6= CAST('20' as binary) and -c7= CAST('20' as binary) and c8= CAST('20' as binary) and -c9= CAST('20' as binary) and c10= CAST('20' as binary) and -c12= CAST('20' as binary); -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= CAST('20' as binary) and c2= CAST('20' as binary) and - c3= CAST('20' as binary) and c4= CAST('20' as binary) and - c5= CAST('20' as binary) and c6= CAST('20' as binary) and - c7= CAST('20' as binary) and c8= CAST('20' as binary) and - c9= CAST('20' as binary) and c10= CAST('20' as binary) and - c12= CAST('20' as binary) "; -execute stmt1 ; -found -true -set @arg00= CAST('20' as binary) ; -select 'true' as found from t9 -where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 -and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 -and c12= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? - and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? - and c12= ? "; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -found -true -delete from t9 ; -test_sequence --- some numeric overflow experiments -- -prepare my_insert from "insert into t9 - ( c21, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( 'O', ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -prepare my_select from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 -from t9 where c21 = 'O' "; -prepare my_delete from "delete from t9 where c21 = 'O' "; -set @arg00= 9223372036854775807 ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1264 Data truncated; out of range for column 'c1' at row 1 -Warning 1264 Data truncated; out of range for column 'c2' at row 1 -Warning 1264 Data truncated; out of range for column 'c3' at row 1 -Warning 1264 Data truncated; out of range for column 'c4' at row 1 -Warning 1264 Data truncated; out of range for column 'c5' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 127 -c2 32767 -c3 8388607 -c4 2147483647 -c5 2147483647 -c6 9223372036854775807 -c7 9.22337e+18 -c8 9.22337203685478e+18 -c9 9.22337203685478e+18 -c10 9.22337203685478e+18 -c12 99999.9999 -execute my_delete ; -set @arg00= '9223372036854775807' ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1264 Data truncated; out of range for column 'c1' at row 1 -Warning 1264 Data truncated; out of range for column 'c2' at row 1 -Warning 1264 Data truncated; out of range for column 'c3' at row 1 -Warning 1265 Data truncated for column 'c4' at row 1 -Warning 1265 Data truncated for column 'c5' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 127 -c2 32767 -c3 8388607 -c4 2147483647 -c5 2147483647 -c6 9223372036854775807 -c7 9.22337e+18 -c8 9.22337203685478e+18 -c9 9.22337203685478e+18 -c10 9.22337203685478e+18 -c12 99999.9999 -execute my_delete ; -set @arg00= -9223372036854775808 ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1264 Data truncated; out of range for column 'c1' at row 1 -Warning 1264 Data truncated; out of range for column 'c2' at row 1 -Warning 1264 Data truncated; out of range for column 'c3' at row 1 -Warning 1264 Data truncated; out of range for column 'c4' at row 1 -Warning 1264 Data truncated; out of range for column 'c5' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 -128 -c2 -32768 -c3 -8388608 -c4 -2147483648 -c5 -2147483648 -c6 -9223372036854775808 -c7 -9.22337e+18 -c8 -9.22337203685478e+18 -c9 -9.22337203685478e+18 -c10 -9.22337203685478e+18 -c12 -9999.9999 -execute my_delete ; -set @arg00= '-9223372036854775808' ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1264 Data truncated; out of range for column 'c1' at row 1 -Warning 1264 Data truncated; out of range for column 'c2' at row 1 -Warning 1264 Data truncated; out of range for column 'c3' at row 1 -Warning 1265 Data truncated for column 'c4' at row 1 -Warning 1265 Data truncated for column 'c5' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 -128 -c2 -32768 -c3 -8388608 -c4 -2147483648 -c5 -2147483648 -c6 -9223372036854775808 -c7 -9.22337e+18 -c8 -9.22337203685478e+18 -c9 -9.22337203685478e+18 -c10 -9.22337203685478e+18 -c12 -9999.9999 -execute my_delete ; -set @arg00= 1.11111111111111111111e+50 ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1264 Data truncated; out of range for column 'c1' at row 1 -Warning 1264 Data truncated; out of range for column 'c2' at row 1 -Warning 1264 Data truncated; out of range for column 'c3' at row 1 -Warning 1264 Data truncated; out of range for column 'c4' at row 1 -Warning 1264 Data truncated; out of range for column 'c5' at row 1 -Warning 1264 Data truncated; out of range for column 'c6' at row 1 -Warning 1264 Data truncated; out of range for column 'c7' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 127 -c2 32767 -c3 8388607 -c4 2147483647 -c5 2147483647 -c6 9223372036854775807 -c7 3.40282e+38 -c8 1.11111111111111e+50 -c9 1.11111111111111e+50 -c10 1.11111111111111e+50 -c12 99999.9999 -execute my_delete ; -set @arg00= '1.11111111111111111111e+50' ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1265 Data truncated for column 'c1' at row 1 -Warning 1265 Data truncated for column 'c2' at row 1 -Warning 1265 Data truncated for column 'c3' at row 1 -Warning 1265 Data truncated for column 'c4' at row 1 -Warning 1265 Data truncated for column 'c5' at row 1 -Warning 1265 Data truncated for column 'c6' at row 1 -Warning 1264 Data truncated; out of range for column 'c7' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 1 -c2 1 -c3 1 -c4 1 -c5 1 -c6 1 -c7 3.40282e+38 -c8 1.11111111111111e+50 -c9 1.11111111111111e+50 -c10 1.11111111111111e+50 -c12 99999.9999 -execute my_delete ; -set @arg00= -1.11111111111111111111e+50 ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1264 Data truncated; out of range for column 'c1' at row 1 -Warning 1264 Data truncated; out of range for column 'c2' at row 1 -Warning 1264 Data truncated; out of range for column 'c3' at row 1 -Warning 1264 Data truncated; out of range for column 'c4' at row 1 -Warning 1264 Data truncated; out of range for column 'c5' at row 1 -Warning 1264 Data truncated; out of range for column 'c6' at row 1 -Warning 1264 Data truncated; out of range for column 'c7' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 -128 -c2 -32768 -c3 -8388608 -c4 -2147483648 -c5 -2147483648 -c6 -9223372036854775808 -c7 -3.40282e+38 -c8 -1.11111111111111e+50 -c9 -1.11111111111111e+50 -c10 -1.11111111111111e+50 -c12 -9999.9999 -execute my_delete ; -set @arg00= '-1.11111111111111111111e+50' ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1265 Data truncated for column 'c1' at row 1 -Warning 1265 Data truncated for column 'c2' at row 1 -Warning 1265 Data truncated for column 'c3' at row 1 -Warning 1265 Data truncated for column 'c4' at row 1 -Warning 1265 Data truncated for column 'c5' at row 1 -Warning 1265 Data truncated for column 'c6' at row 1 -Warning 1264 Data truncated; out of range for column 'c7' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 -1 -c2 -1 -c3 -1 -c4 -1 -c5 -1 -c6 -1 -c7 -3.40282e+38 -c8 -1.11111111111111e+50 -c9 -1.11111111111111e+50 -c10 -1.11111111111111e+50 -c12 -9999.9999 -execute my_delete ; -test_sequence --- insert into string columns -- -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -select c1, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30 -from t9 where c1 >= 20 -order by c1 ; -c1 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 -20 2 20 20 20 20 20 20 20 20 20 20 -21 2 21 21 21 21 21 21 21 21 21 21 -22 2 22 22 22 22 22 22 22 22 22 22 -23 2 23 23 23 23 23 23 23 23 23 23 -30 3 30 30 30 30 30 30 30 30 30 30 -31 3 31 31 31 31 31 31 31 31 31 31 -32 3 32 32 32 32 32 32 32 32 32 32 -33 3 33 33 33 33 33 33 33 33 33 33 -40 4 40 40 40 40 40 40 40 40 40 40 -41 4 41 41 41 41 41 41 41 41 41 41 -42 4 42 42 42 42 42 42 42 42 42 42 -43 4 43 43 43 43 43 43 43 43 43 43 -50 5 50 50 50.00 50.00 50.00 50.00 50.00 50.00 50.00 50.00 -51 5 51 51 51 51 51 51 51 51 51 51 -52 5 52 52 52.00 52.00 52.00 52.00 52.00 52.00 52.00 52.00 -53 5 53 53 53.00 53.00 53.00 53.00 53.00 53.00 53.00 53.00 -54 5 54 54 54.00 54.00 54.00 54.00 54.00 54.00 54.00 54.00 -55 5 55 55 55 55 55 55 55 55 55 55 -56 6 56 56 56.00 56.00 56.00 56.00 56.00 56.00 56.00 56.00 -57 6 57 57 57.00 57.00 57.00 57.00 57.00 57.00 57.00 57.00 -60 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -61 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -62 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -63 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -71 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -73 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -81 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -83 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -test_sequence --- select .. where string column = .. -- -set @arg00= '20'; -select 'true' as found from t9 -where c1= 20 and concat(c20,substr('20',1+length(c20)))= '20' and c21= '20' and -c22= '20' and c23= '20' and c24= '20' and c25= '20' and c26= '20' and -c27= '20' and c28= '20' and c29= '20' and c30= '20' ; -found -true -select 'true' as found from t9 -where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and -c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and -c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr('20',1+length(c20)))= '20' and c21= '20' and - c22= '20' and c23= '20' and c24= '20' and c25= '20' and c26= '20' and - c27= '20' and c28= '20' and c29= '20' and c30= '20'" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and - c21= ? and c22= ? and c23= ? and c25= ? and - c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -found -true -set @arg00= CAST('20' as binary); -select 'true' as found from t9 -where c1= 20 and concat(c20,substr(CAST('20' as binary),1+length(c20))) -= CAST('20' as binary) and c21= CAST('20' as binary) -and c22= CAST('20' as binary) and c23= CAST('20' as binary) and -c24= CAST('20' as binary) and c25= CAST('20' as binary) and -c26= CAST('20' as binary) and c27= CAST('20' as binary) and -c28= CAST('20' as binary) and c29= CAST('20' as binary) and -c30= CAST('20' as binary) ; -found -true -select 'true' as found from t9 -where c1= 20 and concat(c20,substr(@arg00,1+length(c20))) = @arg00 and -c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and -c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and -c30= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr(CAST('20' as binary),1+length(c20))) - = CAST('20' as binary) and c21= CAST('20' as binary) - and c22= CAST('20' as binary) and c23= CAST('20' as binary) and - c24= CAST('20' as binary) and c25= CAST('20' as binary) and - c26= CAST('20' as binary) and c27= CAST('20' as binary) and - c28= CAST('20' as binary) and c29= CAST('20' as binary) and - c30= CAST('20' as binary)" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr(?,1+length(c20))) = ? and c21= ? and - c22= ? and c23= ? and c25= ? and c26= ? and c27= ? and c28= ? and - c29= ? and c30= ?"; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -found -true -set @arg00= 20; -select 'true' as found from t9 -where c1= 20 and concat(c20,substr(20,1+length(c20)))= 20 and c21= 20 and -c22= 20 and c23= 20 and c24= 20 and c25= 20 and c26= 20 and -c27= 20 and c28= 20 and c29= 20 and c30= 20 ; -found -true -select 'true' as found from t9 -where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and -c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and -c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr(20,1+length(c20)))= 20 and c21= 20 and - c22= 20 and c23= 20 and c24= 20 and c25= 20 and c26= 20 and - c27= 20 and c28= 20 and c29= 20 and c30= 20" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and - c21= ? and c22= ? and c23= ? and c25= ? and - c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -found -true -set @arg00= 20.0; -select 'true' as found from t9 -where c1= 20 and concat(c20,substr(20.0,1+length(c20)))= 20.0 and c21= 20.0 and -c22= 20.0 and c23= 20.0 and c24= 20.0 and c25= 20.0 and c26= 20.0 and -c27= 20.0 and c28= 20.0 and c29= 20.0 and c30= 20.0 ; -found -true -select 'true' as found from t9 -where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and -c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and -c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr(20.0,1+length(c20)))= 20.0 and c21= 20.0 and - c22= 20.0 and c23= 20.0 and c24= 20.0 and c25= 20.0 and c26= 20.0 and - c27= 20.0 and c28= 20.0 and c29= 20.0 and c30= 20.0" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and - c21= ? and c22= ? and c23= ? and c25= ? and - c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -found -true -delete from t9 ; -test_sequence --- insert into date/time columns -- -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1264 Data truncated; out of range for column 'c13' at row 1 -Warning 1265 Data truncated for column 'c14' at row 1 -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -Warnings: -Warning 1264 Data truncated; out of range for column 'c13' at row 1 -Warning 1265 Data truncated for column 'c14' at row 1 -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -Warnings: -Warning 1264 Data truncated; out of range for column 'c13' at row 1 -Warning 1265 Data truncated for column 'c14' at row 1 -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -Warnings: -Warning 1264 Data truncated; out of range for column 'c13' at row 1 -Warning 1265 Data truncated for column 'c14' at row 1 -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -select c1, c13, c14, c15, c16, c17 from t9 order by c1 ; -c1 c13 c14 c15 c16 c17 -20 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -21 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -22 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -23 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -30 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -31 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -32 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -33 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -40 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -41 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -42 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -43 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -50 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -51 0010-00-00 0010-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -52 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -53 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -60 NULL NULL 1991-01-01 01:01:01 NULL NULL -61 NULL NULL 1991-01-01 01:01:01 NULL NULL -62 NULL NULL 1991-01-01 01:01:01 NULL NULL -63 NULL NULL 1991-01-01 01:01:01 NULL NULL -71 NULL NULL 1991-01-01 01:01:01 NULL NULL -73 NULL NULL 1991-01-01 01:01:01 NULL NULL -81 NULL NULL 1991-01-01 01:01:01 NULL NULL -83 NULL NULL 1991-01-01 01:01:01 NULL NULL -test_sequence --- select .. where date/time column = .. -- -set @arg00= '1991-01-01 01:01:01' ; -select 'true' as found from t9 -where c1= 20 and c13= '1991-01-01 01:01:01' and c14= '1991-01-01 01:01:01' and -c15= '1991-01-01 01:01:01' and c16= '1991-01-01 01:01:01' and -c17= '1991-01-01 01:01:01' ; -found -true -select 'true' as found from t9 -where c1= 20 and c13= @arg00 and c14= @arg00 and c15= @arg00 and c16= @arg00 -and c17= @arg00 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c13= '1991-01-01 01:01:01' and c14= '1991-01-01 01:01:01' and - c15= '1991-01-01 01:01:01' and c16= '1991-01-01 01:01:01' and - c17= '1991-01-01 01:01:01'" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c13= ? and c14= ? and c15= ? and c16= ? and c17= ?" ; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00 ; -found -true -set @arg00= CAST('1991-01-01 01:01:01' as datetime) ; -select 'true' as found from t9 -where c1= 20 and c13= CAST('1991-01-01 01:01:01' as datetime) and -c14= CAST('1991-01-01 01:01:01' as datetime) and -c15= CAST('1991-01-01 01:01:01' as datetime) and -c16= CAST('1991-01-01 01:01:01' as datetime) and -c17= CAST('1991-01-01 01:01:01' as datetime) ; -found -true -select 'true' as found from t9 -where c1= 20 and c13= @arg00 and c14= @arg00 and c15= @arg00 and c16= @arg00 -and c17= @arg00 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c13= CAST('1991-01-01 01:01:01' as datetime) and - c14= CAST('1991-01-01 01:01:01' as datetime) and - c15= CAST('1991-01-01 01:01:01' as datetime) and - c16= CAST('1991-01-01 01:01:01' as datetime) and - c17= CAST('1991-01-01 01:01:01' as datetime)" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c13= ? and c14= ? and c15= ? and c16= ? and c17= ?" ; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00 ; -found -true -set @arg00= 1991 ; -select 'true' as found from t9 -where c1= 20 and c17= 1991 ; -found -true -select 'true' as found from t9 -where c1= 20 and c17= @arg00 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c17= 1991" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c17= ?" ; -execute stmt1 using @arg00 ; -found -true -set @arg00= 1.991e+3 ; -select 'true' as found from t9 -where c1= 20 and abs(c17 - 1.991e+3) < 0.01 ; -found -true -select 'true' as found from t9 -where c1= 20 and abs(c17 - @arg00) < 0.01 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and abs(c17 - 1.991e+3) < 0.01" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and abs(c17 - ?) < 0.01" ; -execute stmt1 using @arg00 ; -found -true -drop table t1, t9; diff --git a/mysql-test/r/ps_3innodb.result.es b/mysql-test/r/ps_3innodb.result.es deleted file mode 100644 index 9386f18a4df..00000000000 --- a/mysql-test/r/ps_3innodb.result.es +++ /dev/null @@ -1,3113 +0,0 @@ -use test; -drop table if exists t1, t9 ; -create table t1 -( -a int, b varchar(30), -primary key(a) -) engine = 'InnoDB' ; -create table t9 -( -c1 tinyint, c2 smallint, c3 mediumint, c4 int, -c5 integer, c6 bigint, c7 float, c8 double, -c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4), -c13 date, c14 datetime, c15 timestamp(14), c16 time, -c17 year, c18 bit, c19 bool, c20 char, -c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext, -c25 blob, c26 text, c27 mediumblob, c28 mediumtext, -c29 longblob, c30 longtext, c31 enum('one', 'two', 'three'), -c32 set('monday', 'tuesday', 'wednesday'), -primary key(c1) -) engine = 'InnoDB' ; -delete from t1 ; -insert into t1 values (1,'one'); -insert into t1 values (2,'two'); -insert into t1 values (3,'three'); -insert into t1 values (4,'four'); -commit ; -delete from t9 ; -insert into t9 -set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, -c10= 1, c11= 1, c12 = 1, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=true, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t9 -set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, -c10= 9, c11= 9, c12 = 9, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=false, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; -commit ; -test_sequence ------- simple select tests ------ -prepare stmt1 from ' select * from t9 order by c1 ' ; -execute stmt1; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def test t9 t9 c1 c1 1 4 1 N 49155 0 63 -def test t9 t9 c2 c2 2 6 1 Y 32768 0 63 -def test t9 t9 c3 c3 9 9 1 Y 32768 0 63 -def test t9 t9 c4 c4 3 11 1 Y 32768 0 63 -def test t9 t9 c5 c5 3 11 1 Y 32768 0 63 -def test t9 t9 c6 c6 8 20 1 Y 32768 0 63 -def test t9 t9 c7 c7 4 12 1 Y 32768 31 63 -def test t9 t9 c8 c8 5 22 1 Y 32768 31 63 -def test t9 t9 c9 c9 5 22 1 Y 32768 31 63 -def test t9 t9 c10 c10 5 22 1 Y 32768 31 63 -def test t9 t9 c11 c11 0 9 6 Y 32768 4 63 -def test t9 t9 c12 c12 0 10 6 Y 32768 4 63 -def test t9 t9 c13 c13 10 10 10 Y 128 0 63 -def test t9 t9 c14 c14 12 19 19 Y 128 0 63 -def test t9 t9 c15 c15 7 19 19 N 1249 0 63 -def test t9 t9 c16 c16 11 8 8 Y 128 0 63 -def test t9 t9 c17 c17 13 4 4 Y 32864 0 63 -def test t9 t9 c18 c18 1 1 1 Y 32768 0 63 -def test t9 t9 c19 c19 1 1 1 Y 32768 0 63 -def test t9 t9 c20 c20 254 1 1 Y 0 0 8 -def test t9 t9 c21 c21 253 10 10 Y 0 0 8 -def test t9 t9 c22 c22 253 30 30 Y 0 0 8 -def test t9 t9 c23 c23 252 255 8 Y 144 0 63 -def test t9 t9 c24 c24 252 255 8 Y 16 0 8 -def test t9 t9 c25 c25 252 65535 4 Y 144 0 63 -def test t9 t9 c26 c26 252 65535 4 Y 16 0 8 -def test t9 t9 c27 c27 252 16777215 10 Y 144 0 63 -def test t9 t9 c28 c28 252 16777215 10 Y 16 0 8 -def test t9 t9 c29 c29 252 16777215 8 Y 144 0 63 -def test t9 t9 c30 c30 252 16777215 8 Y 16 0 8 -def test t9 t9 c31 c31 254 5 3 Y 256 0 8 -def test t9 t9 c32 c32 254 24 7 Y 2048 0 8 -c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32 -1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday -set @arg00='SELECT' ; -prepare stmt1 from ' ? a from t1 where a=1 '; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? a from t1 where a=1' at line 1 -set @arg00=1 ; -select @arg00, b from t1 where a=1 ; -@arg00 b -1 one -prepare stmt1 from ' select ?, b from t1 where a=1 ' ; -execute stmt1 using @arg00 ; -? b -1 one -set @arg00='lion' ; -select @arg00, b from t1 where a=1 ; -@arg00 b -lion one -prepare stmt1 from ' select ?, b from t1 where a=1 ' ; -execute stmt1 using @arg00 ; -? b -lion one -set @arg00=NULL ; -select @arg00, b from t1 where a=1 ; -@arg00 b -NULL one -prepare stmt1 from ' select ?, b from t1 where a=1 ' ; -execute stmt1 using @arg00 ; -? b -NULL one -set @arg00=1 ; -select b, a - @arg00 from t1 where a=1 ; -b a - @arg00 -one 0 -prepare stmt1 from ' select b, a - ? from t1 where a=1 ' ; -execute stmt1 using @arg00 ; -b a - ? -one 0 -set @arg00=null ; -select @arg00 as my_col ; -my_col -NULL -prepare stmt1 from ' select ? as my_col'; -execute stmt1 using @arg00 ; -my_col -NULL -select @arg00 + 1 as my_col ; -my_col -NULL -prepare stmt1 from ' select ? + 1 as my_col'; -execute stmt1 using @arg00 ; -my_col -NULL -select 1 + @arg00 as my_col ; -my_col -NULL -prepare stmt1 from ' select 1 + ? as my_col'; -execute stmt1 using @arg00 ; -my_col -NULL -set @arg00='MySQL' ; -select substr(@arg00,1,2) from t1 where a=1 ; -substr(@arg00,1,2) -My -prepare stmt1 from ' select substr(?,1,2) from t1 where a=1 ' ; -execute stmt1 using @arg00 ; -substr(?,1,2) -My -set @arg00=3 ; -select substr('MySQL',@arg00,5) from t1 where a=1 ; -substr('MySQL',@arg00,5) -SQL -prepare stmt1 from ' select substr(''MySQL'',?,5) from t1 where a=1 ' ; -execute stmt1 using @arg00 ; -substr('MySQL',?,5) -SQL -select substr('MySQL',1,@arg00) from t1 where a=1 ; -substr('MySQL',1,@arg00) -MyS -prepare stmt1 from ' select substr(''MySQL'',1,?) from t1 where a=1 ' ; -execute stmt1 using @arg00 ; -substr('MySQL',1,?) -MyS -set @arg00='MySQL' ; -select a , concat(@arg00,b) from t1 order by a; -a concat(@arg00,b) -1 MySQLone -2 MySQLtwo -3 MySQLthree -4 MySQLfour -prepare stmt1 from ' select a , concat(?,b) from t1 order by a ' ; -execute stmt1 using @arg00; -a concat(?,b) -1 MySQLone -2 MySQLtwo -3 MySQLthree -4 MySQLfour -select a , concat(b,@arg00) from t1 order by a ; -a concat(b,@arg00) -1 oneMySQL -2 twoMySQL -3 threeMySQL -4 fourMySQL -prepare stmt1 from ' select a , concat(b,?) from t1 order by a ' ; -execute stmt1 using @arg00; -a concat(b,?) -1 oneMySQL -2 twoMySQL -3 threeMySQL -4 fourMySQL -set @arg00='MySQL' ; -select group_concat(@arg00,b order by a) from t1 -group by 'a' ; -group_concat(@arg00,b order by a) -MySQLone,MySQLtwo,MySQLthree,MySQLfour -prepare stmt1 from ' select group_concat(?,b order by a) from t1 -group by ''a'' ' ; -execute stmt1 using @arg00; -group_concat(?,b order by a) -MySQLone,MySQLtwo,MySQLthree,MySQLfour -select group_concat(b,@arg00 order by a) from t1 -group by 'a' ; -group_concat(b,@arg00 order by a) -oneMySQL,twoMySQL,threeMySQL,fourMySQL -prepare stmt1 from ' select group_concat(b,? order by a) from t1 -group by ''a'' ' ; -execute stmt1 using @arg00; -group_concat(b,? order by a) -oneMySQL,twoMySQL,threeMySQL,fourMySQL -set @arg00='first' ; -set @arg01='second' ; -set @arg02=NULL; -select @arg00, @arg01 from t1 where a=1 ; -@arg00 @arg01 -first second -prepare stmt1 from ' select ?, ? from t1 where a=1 ' ; -execute stmt1 using @arg00, @arg01 ; -? ? -first second -execute stmt1 using @arg02, @arg01 ; -? ? -NULL second -execute stmt1 using @arg00, @arg02 ; -? ? -first NULL -execute stmt1 using @arg02, @arg02 ; -? ? -NULL NULL -drop table if exists t5 ; -create table t5 (id1 int(11) not null default '0', -value2 varchar(100), value1 varchar(100)) ; -insert into t5 values (1,'hh','hh'),(2,'hh','hh'), -(1,'ii','ii'),(2,'ii','ii') ; -prepare stmt1 from ' select id1,value1 from t5 where id1=? or value1=? order by id1,value1 ' ; -set @arg00=1 ; -set @arg01='hh' ; -execute stmt1 using @arg00, @arg01 ; -id1 value1 -1 hh -1 ii -2 hh -drop table t5 ; -drop table if exists t5 ; -create table t5(session_id char(9) not null) ; -insert into t5 values ('abc') ; -prepare stmt1 from ' select * from t5 -where ?=''1111'' and session_id = ''abc'' ' ; -set @arg00='abc' ; -execute stmt1 using @arg00 ; -session_id -set @arg00='1111' ; -execute stmt1 using @arg00 ; -session_id -abc -set @arg00='abc' ; -execute stmt1 using @arg00 ; -session_id -drop table t5 ; -set @arg00='FROM' ; -select a @arg00 t1 where a=1 ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 t1 where a=1' at line 1 -prepare stmt1 from ' select a ? t1 where a=1 ' ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? t1 where a=1' at line 1 -set @arg00='t1' ; -select a from @arg00 where a=1 ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 where a=1' at line 1 -prepare stmt1 from ' select a from ? where a=1 ' ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? where a=1' at line 1 -set @arg00='WHERE' ; -select a from t1 @arg00 a=1 ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 a=1' at line 1 -prepare stmt1 from ' select a from t1 ? a=1 ' ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? a=1' at line 1 -set @arg00=1 ; -select a FROM t1 where a=@arg00 ; -a -1 -prepare stmt1 from ' select a FROM t1 where a=? ' ; -execute stmt1 using @arg00 ; -a -1 -set @arg00=1000 ; -execute stmt1 using @arg00 ; -a -set @arg00=NULL ; -select a FROM t1 where a=@arg00 ; -a -prepare stmt1 from ' select a FROM t1 where a=? ' ; -execute stmt1 using @arg00 ; -a -set @arg00=4 ; -select a FROM t1 where a=sqrt(@arg00) ; -a -2 -prepare stmt1 from ' select a FROM t1 where a=sqrt(?) ' ; -execute stmt1 using @arg00 ; -a -2 -set @arg00=NULL ; -select a FROM t1 where a=sqrt(@arg00) ; -a -prepare stmt1 from ' select a FROM t1 where a=sqrt(?) ' ; -execute stmt1 using @arg00 ; -a -set @arg00=2 ; -set @arg01=3 ; -select a FROM t1 where a in (@arg00,@arg01) order by a; -a -2 -3 -prepare stmt1 from ' select a FROM t1 where a in (?,?) order by a '; -execute stmt1 using @arg00, @arg01; -a -2 -3 -set @arg00= 'one' ; -set @arg01= 'two' ; -set @arg02= 'five' ; -prepare stmt1 from ' select b FROM t1 where b in (?,?,?) order by b ' ; -execute stmt1 using @arg00, @arg01, @arg02 ; -b -one -two -prepare stmt1 from ' select b FROM t1 where b like ? '; -set @arg00='two' ; -execute stmt1 using @arg00 ; -b -two -set @arg00='tw%' ; -execute stmt1 using @arg00 ; -b -two -set @arg00='%wo' ; -execute stmt1 using @arg00 ; -b -two -set @arg00=null ; -insert into t9 set c1= 0, c5 = NULL ; -select c5 from t9 where c5 > NULL ; -c5 -prepare stmt1 from ' select c5 from t9 where c5 > ? '; -execute stmt1 using @arg00 ; -c5 -select c5 from t9 where c5 < NULL ; -c5 -prepare stmt1 from ' select c5 from t9 where c5 < ? '; -execute stmt1 using @arg00 ; -c5 -select c5 from t9 where c5 = NULL ; -c5 -prepare stmt1 from ' select c5 from t9 where c5 = ? '; -execute stmt1 using @arg00 ; -c5 -select c5 from t9 where c5 <=> NULL ; -c5 -NULL -prepare stmt1 from ' select c5 from t9 where c5 <=> ? '; -execute stmt1 using @arg00 ; -c5 -NULL -delete from t9 where c1= 0 ; -set @arg00='>' ; -select a FROM t1 where a @arg00 1 ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 1' at line 1 -prepare stmt1 from ' select a FROM t1 where a ? 1 ' ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? 1' at line 1 -set @arg00=1 ; -select a,b FROM t1 where a is not NULL -AND b is not NULL group by a - @arg00 ; -a b -1 one -2 two -3 three -4 four -prepare stmt1 from ' select a,b FROM t1 where a is not NULL -AND b is not NULL group by a - ? ' ; -execute stmt1 using @arg00 ; -a b -1 one -2 two -3 three -4 four -set @arg00='two' ; -select a,b FROM t1 where a is not NULL -AND b is not NULL having b <> @arg00 order by a ; -a b -1 one -3 three -4 four -prepare stmt1 from ' select a,b FROM t1 where a is not NULL -AND b is not NULL having b <> ? order by a ' ; -execute stmt1 using @arg00 ; -a b -1 one -3 three -4 four -set @arg00=1 ; -select a,b FROM t1 where a is not NULL -AND b is not NULL order by a - @arg00 ; -a b -1 one -2 two -3 three -4 four -prepare stmt1 from ' select a,b FROM t1 where a is not NULL -AND b is not NULL order by a - ? ' ; -execute stmt1 using @arg00 ; -a b -1 one -2 two -3 three -4 four -set @arg00=2 ; -select a,b from t1 order by 2 ; -a b -4 four -1 one -3 three -2 two -prepare stmt1 from ' select a,b from t1 -order by ? '; -execute stmt1 using @arg00; -a b -4 four -1 one -3 three -2 two -set @arg00=1 ; -execute stmt1 using @arg00; -a b -1 one -2 two -3 three -4 four -set @arg00=0 ; -execute stmt1 using @arg00; -ERROR 42S22: Unknown column '?' in 'order clause' -set @arg00=1; -prepare stmt1 from ' select a,b from t1 order by a -limit 1 '; -execute stmt1 ; -a b -1 one -prepare stmt1 from ' select a,b from t1 -limit ? '; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?' at line 2 -set @arg00='b' ; -set @arg01=0 ; -set @arg02=2 ; -set @arg03=2 ; -select sum(a), @arg00 from t1 where a > @arg01 -and b is not null group by substr(b,@arg02) -having sum(a) <> @arg03 ; -sum(a) @arg00 -3 b -1 b -4 b -prepare stmt1 from ' select sum(a), ? from t1 where a > ? -and b is not null group by substr(b,?) -having sum(a) <> ? '; -execute stmt1 using @arg00, @arg01, @arg02, @arg03; -sum(a) ? -3 b -1 b -4 b -test_sequence ------- join tests ------ -select first.a as a1, second.a as a2 -from t1 first, t1 second -where first.a = second.a order by a1 ; -a1 a2 -1 1 -2 2 -3 3 -4 4 -prepare stmt1 from ' select first.a as a1, second.a as a2 - from t1 first, t1 second - where first.a = second.a order by a1 '; -execute stmt1 ; -a1 a2 -1 1 -2 2 -3 3 -4 4 -set @arg00='ABC'; -set @arg01='two'; -set @arg02='one'; -select first.a, @arg00, second.a FROM t1 first, t1 second -where @arg01 = first.b or first.a = second.a or second.b = @arg02 -order by second.a, first.a; -a @arg00 a -1 ABC 1 -2 ABC 1 -3 ABC 1 -4 ABC 1 -2 ABC 2 -2 ABC 3 -3 ABC 3 -2 ABC 4 -4 ABC 4 -prepare stmt1 from ' select first.a, ?, second.a FROM t1 first, t1 second - where ? = first.b or first.a = second.a or second.b = ? - order by second.a, first.a'; -execute stmt1 using @arg00, @arg01, @arg02; -a ? a -1 ABC 1 -2 ABC 1 -3 ABC 1 -4 ABC 1 -2 ABC 2 -2 ABC 3 -3 ABC 3 -2 ABC 4 -4 ABC 4 -drop table if exists t2 ; -create table t2 as select * from t1 ; -set @query1= 'SELECT * FROM t2 join t1 on (t1.a=t2.a) order by t2.a ' ; -set @query2= 'SELECT * FROM t2 natural join t1 order by t2.a ' ; -set @query3= 'SELECT * FROM t2 join t1 using(a) order by t2.a ' ; -set @query4= 'SELECT * FROM t2 left join t1 on(t1.a=t2.a) order by t2.a ' ; -set @query5= 'SELECT * FROM t2 natural left join t1 order by t2.a ' ; -set @query6= 'SELECT * FROM t2 left join t1 using(a) order by t2.a ' ; -set @query7= 'SELECT * FROM t2 right join t1 on(t1.a=t2.a) order by t2.a ' ; -set @query8= 'SELECT * FROM t2 natural right join t1 order by t2.a ' ; -set @query9= 'SELECT * FROM t2 right join t1 using(a) order by t2.a ' ; -the join statement is: -SELECT * FROM t2 right join t1 using(a) order by t2.a -prepare stmt1 from @query9 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -the join statement is: -SELECT * FROM t2 natural right join t1 order by t2.a -prepare stmt1 from @query8 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -the join statement is: -SELECT * FROM t2 right join t1 on(t1.a=t2.a) order by t2.a -prepare stmt1 from @query7 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -the join statement is: -SELECT * FROM t2 left join t1 using(a) order by t2.a -prepare stmt1 from @query6 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -the join statement is: -SELECT * FROM t2 natural left join t1 order by t2.a -prepare stmt1 from @query5 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -the join statement is: -SELECT * FROM t2 left join t1 on(t1.a=t2.a) order by t2.a -prepare stmt1 from @query4 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -the join statement is: -SELECT * FROM t2 join t1 using(a) order by t2.a -prepare stmt1 from @query3 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -the join statement is: -SELECT * FROM t2 natural join t1 order by t2.a -prepare stmt1 from @query2 ; -execute stmt1 ; -a b -1 one -2 two -3 three -4 four -execute stmt1 ; -a b -1 one -2 two -3 three -4 four -execute stmt1 ; -a b -1 one -2 two -3 three -4 four -the join statement is: -SELECT * FROM t2 join t1 on (t1.a=t2.a) order by t2.a -prepare stmt1 from @query1 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -drop table t2 ; -test_sequence ------- subquery tests ------ -prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where b = ''two'') '; -execute stmt1 ; -a b -2 two -set @arg00='two' ; -select a, b FROM t1 outer_table where -a = (select a from t1 where b = 'two' ) and b=@arg00 ; -a b -2 two -prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where b = ''two'') and b=? '; -execute stmt1 using @arg00; -a b -2 two -set @arg00='two' ; -select a, b FROM t1 outer_table where -a = (select a from t1 where b = @arg00 ) and b='two' ; -a b -2 two -prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where b = ? ) and b=''two'' ' ; -execute stmt1 using @arg00; -a b -2 two -set @arg00=3 ; -set @arg01='three' ; -select a,b FROM t1 where (a,b) in (select 3, 'three'); -a b -3 three -select a FROM t1 where (a,b) in (select @arg00,@arg01); -a -3 -prepare stmt1 from ' select a FROM t1 where (a,b) in (select ?, ?) '; -execute stmt1 using @arg00, @arg01; -a -3 -set @arg00=1 ; -set @arg01='two' ; -set @arg02=2 ; -set @arg03='two' ; -select a, @arg00, b FROM t1 outer_table where -b=@arg01 and a = (select @arg02 from t1 where b = @arg03 ) ; -a @arg00 b -2 1 two -prepare stmt1 from ' select a, ?, b FROM t1 outer_table where - b=? and a = (select ? from t1 where b = ? ) ' ; -execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; -a ? b -2 1 two -prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where b = outer_table.b ) order by a '; -execute stmt1 ; -a b -1 one -2 two -3 three -4 four -prepare stmt1 from ' SELECT a as ccc from t1 where a+1= - (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) '; -execute stmt1 ; -ccc -1 -deallocate prepare stmt1 ; -prepare stmt1 from ' SELECT a as ccc from t1 where a+1= - (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) '; -execute stmt1 ; -ccc -1 -deallocate prepare stmt1 ; -prepare stmt1 from ' SELECT a as ccc from t1 where a+1= - (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) '; -execute stmt1 ; -ccc -1 -deallocate prepare stmt1 ; -set @arg00='two' ; -select a, b FROM t1 outer_table where -a = (select a from t1 where b = outer_table.b ) and b=@arg00 ; -a b -2 two -prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where b = outer_table.b) and b=? '; -execute stmt1 using @arg00; -a b -2 two -set @arg00=2 ; -select a, b FROM t1 outer_table where -a = (select a from t1 where a = @arg00 and b = outer_table.b) and b='two' ; -a b -2 two -prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where a = ? and b = outer_table.b) and b=''two'' ' ; -execute stmt1 using @arg00; -a b -2 two -set @arg00=2 ; -select a, b FROM t1 outer_table where -a = (select a from t1 where outer_table.a = @arg00 and a=2) and b='two' ; -a b -2 two -prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where outer_table.a = ? and a=2) and b=''two'' ' ; -execute stmt1 using @arg00; -a b -2 two -set @arg00=1 ; -set @arg01='two' ; -set @arg02=2 ; -set @arg03='two' ; -select a, @arg00, b FROM t1 outer_table where -b=@arg01 and a = (select @arg02 from t1 where outer_table.b = @arg03 -and outer_table.a=a ) ; -a @arg00 b -2 1 two -prepare stmt1 from ' select a, ?, b FROM t1 outer_table where - b=? and a = (select ? from t1 where outer_table.b = ? - and outer_table.a=a ) ' ; -execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; -a ? b -2 1 two -set @arg00=1 ; -set @arg01=0 ; -select a, @arg00 -from ( select a - @arg00 as a from t1 where a=@arg00 ) as t2 -where a=@arg01; -a @arg00 -0 1 -prepare stmt1 from ' select a, ? - from ( select a - ? as a from t1 where a=? ) as t2 - where a=? '; -execute stmt1 using @arg00, @arg00, @arg00, @arg01 ; -a ? -0 1 -drop table if exists t2 ; -create table t2 as select * from t1; -prepare stmt1 from ' select a in (select a from t2) from t1 ' ; -execute stmt1 ; -a in (select a from t2) -1 -1 -1 -1 -drop table if exists t5, t6, t7 ; -create table t5 (a int , b int) ; -create table t6 like t5 ; -create table t7 like t5 ; -insert into t5 values (0, 100), (1, 2), (1, 3), (2, 2), (2, 7), -(2, -1), (3, 10) ; -insert into t6 values (0, 0), (1, 1), (2, 1), (3, 1), (4, 1) ; -insert into t7 values (3, 3), (2, 2), (1, 1) ; -prepare stmt1 from ' select a, (select count(distinct t5.b) as sum from t5, t6 - where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b - group by t5.a order by sum limit 1) from t7 ' ; -execute stmt1 ; -a (select count(distinct t5.b) as sum from t5, t6 - where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b - group by t5.a order by sum limit 1) -3 1 -2 2 -1 2 -execute stmt1 ; -a (select count(distinct t5.b) as sum from t5, t6 - where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b - group by t5.a order by sum limit 1) -3 1 -2 2 -1 2 -execute stmt1 ; -a (select count(distinct t5.b) as sum from t5, t6 - where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b - group by t5.a order by sum limit 1) -3 1 -2 2 -1 2 -drop table t5, t6, t7 ; -drop table if exists t2 ; -create table t2 as select * from t9; -set @stmt= ' SELECT - (SELECT SUM(c1 + c12 + 0.0) FROM t2 - where (t9.c2 - 0e-3) = t2.c2 - GROUP BY t9.c15 LIMIT 1) as scalar_s, - exists (select 1.0e+0 from t2 - where t2.c3 * 9.0000000000 = t9.c4) as exists_s, - c5 * 4 in (select c6 + 0.3e+1 from t2) as in_s, - (c7 - 4, c8 - 4) in (select c9 + 4.0, c10 + 40e-1 from t2) as in_row_s -FROM t9, -(select c25 x, c32 y from t2) tt WHERE x = c25 ' ; -prepare stmt1 from @stmt ; -execute stmt1 ; -execute stmt1 ; -set @stmt= concat('explain ',@stmt); -prepare stmt1 from @stmt ; -execute stmt1 ; -execute stmt1 ; -set @stmt= ' SELECT - (SELECT SUM(c1+c12+?) FROM t2 where (t9.c2-?)=t2.c2 - GROUP BY t9.c15 LIMIT 1) as scalar_s, - exists (select ? from t2 - where t2.c3*?=t9.c4) as exists_s, - c5*? in (select c6+? from t2) as in_s, - (c7-?, c8-?) in (select c9+?, c10+? from t2) as in_row_s -FROM t9, -(select c25 x, c32 y from t2) tt WHERE x =c25 ' ; -set @arg00= 0.0 ; -set @arg01= 0e-3 ; -set @arg02= 1.0e+0 ; -set @arg03= 9.0000000000 ; -set @arg04= 4 ; -set @arg05= 0.3e+1 ; -set @arg06= 4 ; -set @arg07= 4 ; -set @arg08= 4.0 ; -set @arg09= 40e-1 ; -prepare stmt1 from @stmt ; -execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, -@arg07, @arg08, @arg09 ; -execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, -@arg07, @arg08, @arg09 ; -set @stmt= concat('explain ',@stmt); -prepare stmt1 from @stmt ; -execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, -@arg07, @arg08, @arg09 ; -execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, -@arg07, @arg08, @arg09 ; -drop table t2 ; -select 1 < (select a from t1) ; -ERROR 21000: Subquery returns more than 1 row -prepare stmt1 from ' select 1 < (select a from t1) ' ; -execute stmt1 ; -ERROR 21000: Subquery returns more than 1 row -select 1 as my_col ; -my_col -1 -test_sequence ------- union tests ------ -prepare stmt1 from ' select a FROM t1 where a=1 - union distinct - select a FROM t1 where a=1 '; -execute stmt1 ; -a -1 -execute stmt1 ; -a -1 -prepare stmt1 from ' select a FROM t1 where a=1 - union all - select a FROM t1 where a=1 '; -execute stmt1 ; -a -1 -1 -prepare stmt1 from ' SELECT 1, 2 union SELECT 1 ' ; -ERROR 21000: The used SELECT statements have a different number of columns -prepare stmt1 from ' SELECT 1 union SELECT 1, 2 ' ; -ERROR 21000: The used SELECT statements have a different number of columns -prepare stmt1 from ' SELECT * from t1 union SELECT 1 ' ; -ERROR 21000: The used SELECT statements have a different number of columns -prepare stmt1 from ' SELECT 1 union SELECT * from t1 ' ; -ERROR 21000: The used SELECT statements have a different number of columns -set @arg00=1 ; -select @arg00 FROM t1 where a=1 -union distinct -select 1 FROM t1 where a=1; -@arg00 -1 -prepare stmt1 from ' select ? FROM t1 where a=1 - union distinct - select 1 FROM t1 where a=1 ' ; -execute stmt1 using @arg00; -? -1 -set @arg00=1 ; -select 1 FROM t1 where a=1 -union distinct -select @arg00 FROM t1 where a=1; -1 -1 -prepare stmt1 from ' select 1 FROM t1 where a=1 - union distinct - select ? FROM t1 where a=1 ' ; -execute stmt1 using @arg00; -1 -1 -set @arg00='a' ; -select @arg00 FROM t1 where a=1 -union distinct -select @arg00 FROM t1 where a=1; -@arg00 -a -prepare stmt1 from ' select ? FROM t1 where a=1 - union distinct - select ? FROM t1 where a=1 '; -execute stmt1 using @arg00, @arg00; -? -a -prepare stmt1 from ' select ? - union distinct - select ? '; -execute stmt1 using @arg00, @arg00; -? -a -set @arg00='a' ; -set @arg01=1 ; -set @arg02='a' ; -set @arg03=2 ; -select @arg00 FROM t1 where a=@arg01 -union distinct -select @arg02 FROM t1 where a=@arg03; -@arg00 -a -prepare stmt1 from ' select ? FROM t1 where a=? - union distinct - select ? FROM t1 where a=? ' ; -execute stmt1 using @arg00, @arg01, @arg02, @arg03; -? -a -set @arg00=1 ; -prepare stmt1 from ' select sum(a) + 200, ? from t1 -union distinct -select sum(a) + 200, 1 from t1 -group by b ' ; -execute stmt1 using @arg00; -sum(a) + 200 ? -210 1 -204 1 -201 1 -203 1 -202 1 -set @Oporto='Oporto' ; -set @Lisboa='Lisboa' ; -set @0=0 ; -set @1=1 ; -set @2=2 ; -set @3=3 ; -set @4=4 ; -select @Oporto,@Lisboa,@0,@1,@2,@3,@4 ; -@Oporto @Lisboa @0 @1 @2 @3 @4 -Oporto Lisboa 0 1 2 3 4 -select sum(a) + 200 as the_sum, @Oporto as the_town from t1 -group by b -union distinct -select sum(a) + 200, @Lisboa from t1 -group by b ; -the_sum the_town -204 Oporto -201 Oporto -203 Oporto -202 Oporto -204 Lisboa -201 Lisboa -203 Lisboa -202 Lisboa -prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1 - group by b - union distinct - select sum(a) + 200, ? from t1 - group by b ' ; -execute stmt1 using @Oporto, @Lisboa; -the_sum the_town -204 Oporto -201 Oporto -203 Oporto -202 Oporto -204 Lisboa -201 Lisboa -203 Lisboa -202 Lisboa -select sum(a) + 200 as the_sum, @Oporto as the_town from t1 -where a > @1 -group by b -union distinct -select sum(a) + 200, @Lisboa from t1 -where a > @2 -group by b ; -the_sum the_town -204 Oporto -203 Oporto -202 Oporto -204 Lisboa -203 Lisboa -prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1 - where a > ? - group by b - union distinct - select sum(a) + 200, ? from t1 - where a > ? - group by b ' ; -execute stmt1 using @Oporto, @1, @Lisboa, @2; -the_sum the_town -204 Oporto -203 Oporto -202 Oporto -204 Lisboa -203 Lisboa -select sum(a) + 200 as the_sum, @Oporto as the_town from t1 -where a > @1 -group by b -having avg(a) > @2 -union distinct -select sum(a) + 200, @Lisboa from t1 -where a > @2 -group by b -having avg(a) > @3; -the_sum the_town -204 Oporto -203 Oporto -204 Lisboa -prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1 - where a > ? - group by b - having avg(a) > ? - union distinct - select sum(a) + 200, ? from t1 - where a > ? - group by b - having avg(a) > ? '; -execute stmt1 using @Oporto, @1, @2, @Lisboa, @2, @3; -the_sum the_town -204 Oporto -203 Oporto -204 Lisboa -test_sequence ------- explain select tests ------ -prepare stmt1 from ' explain select * from t9 ' ; -execute stmt1; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def id 8 3 1 N 32801 0 8 -def select_type 253 19 6 N 1 31 33 -def table 253 64 2 N 1 31 33 -def type 253 10 3 N 1 31 33 -def possible_keys 253 4096 0 Y 0 31 33 -def key 253 64 0 Y 0 31 33 -def key_len 8 3 0 Y 32800 0 8 -def ref 253 1024 0 Y 0 31 33 -def rows 8 10 1 N 32801 0 8 -def Extra 253 255 0 N 1 31 33 -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t9 ALL NULL NULL NULL NULL 2 -test_sequence ------- delete tests ------ -delete from t1 ; -insert into t1 values (1,'one'); -insert into t1 values (2,'two'); -insert into t1 values (3,'three'); -insert into t1 values (4,'four'); -commit ; -delete from t9 ; -insert into t9 -set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, -c10= 1, c11= 1, c12 = 1, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=true, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t9 -set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, -c10= 9, c11= 9, c12 = 9, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=false, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; -commit ; -prepare stmt1 from 'delete from t1 where a=2' ; -execute stmt1; -select a,b from t1 where a=2; -a b -execute stmt1; -insert into t1 values(0,NULL); -set @arg00=NULL; -prepare stmt1 from 'delete from t1 where b=?' ; -execute stmt1 using @arg00; -select a,b from t1 where b is NULL ; -a b -0 NULL -set @arg00='one'; -execute stmt1 using @arg00; -select a,b from t1 where b=@arg00; -a b -prepare stmt1 from 'truncate table t1' ; -ERROR HY000: This command is not supported in the prepared statement protocol yet -test_sequence ------- update tests ------ -delete from t1 ; -insert into t1 values (1,'one'); -insert into t1 values (2,'two'); -insert into t1 values (3,'three'); -insert into t1 values (4,'four'); -commit ; -delete from t9 ; -insert into t9 -set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, -c10= 1, c11= 1, c12 = 1, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=true, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t9 -set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, -c10= 9, c11= 9, c12 = 9, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=false, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; -commit ; -prepare stmt1 from 'update t1 set b=''a=two'' where a=2' ; -execute stmt1; -select a,b from t1 where a=2; -a b -2 a=two -execute stmt1; -select a,b from t1 where a=2; -a b -2 a=two -set @arg00=NULL; -prepare stmt1 from 'update t1 set b=? where a=2' ; -execute stmt1 using @arg00; -select a,b from t1 where a=2; -a b -2 NULL -set @arg00='two'; -execute stmt1 using @arg00; -select a,b from t1 where a=2; -a b -2 two -set @arg00=2; -prepare stmt1 from 'update t1 set b=NULL where a=?' ; -execute stmt1 using @arg00; -select a,b from t1 where a=@arg00; -a b -2 NULL -update t1 set b='two' where a=@arg00; -set @arg00=2000; -execute stmt1 using @arg00; -select a,b from t1 where a=@arg00; -a b -set @arg00=2; -set @arg01=22; -prepare stmt1 from 'update t1 set a=? where a=?' ; -execute stmt1 using @arg00, @arg00; -select a,b from t1 where a=@arg00; -a b -2 two -execute stmt1 using @arg01, @arg00; -select a,b from t1 where a=@arg01; -a b -22 two -execute stmt1 using @arg00, @arg01; -select a,b from t1 where a=@arg00; -a b -2 two -set @arg00=NULL; -set @arg01=2; -execute stmt1 using @arg00, @arg01; -Warnings: -Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 1 -select a,b from t1 order by a; -a b -0 two -1 one -3 three -4 four -set @arg00=0; -execute stmt1 using @arg01, @arg00; -select a,b from t1 order by a; -a b -1 one -2 two -3 three -4 four -set @arg00=23; -set @arg01='two'; -set @arg02=2; -set @arg03='two'; -set @arg04=2; -drop table if exists t2; -create table t2 as select a,b from t1 ; -prepare stmt1 from 'update t1 set a=? where b=? - and a in (select ? from t2 - where b = ? or a = ?)'; -execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04 ; -affected rows: 1 -info: Rows matched: 1 Changed: 1 Warnings: 0 -select a,b from t1 where a = @arg00 ; -a b -23 two -prepare stmt1 from 'update t1 set a=? where b=? - and a not in (select ? from t2 - where b = ? or a = ?)'; -execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ; -affected rows: 1 -info: Rows matched: 1 Changed: 1 Warnings: 0 -select a,b from t1 order by a ; -a b -1 one -2 two -3 three -4 four -drop table t2 ; -create table t2 -( -a int, b varchar(30), -primary key(a) -) engine = 'InnoDB' ; -insert into t2(a,b) select a, b from t1 ; -prepare stmt1 from 'update t1 set a=? where b=? - and a in (select ? from t2 - where b = ? or a = ?)'; -execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04 ; -affected rows: 1 -info: Rows matched: 1 Changed: 1 Warnings: 0 -select a,b from t1 where a = @arg00 ; -a b -23 two -prepare stmt1 from 'update t1 set a=? where b=? - and a not in (select ? from t2 - where b = ? or a = ?)'; -execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ; -affected rows: 1 -info: Rows matched: 1 Changed: 1 Warnings: 0 -select a,b from t1 order by a ; -a b -1 one -2 two -3 three -4 four -drop table t2 ; -set @arg00=1; -prepare stmt1 from 'update t1 set b=''bla'' -where a=2 -limit 1'; -execute stmt1 ; -select a,b from t1 where b = 'bla' ; -a b -2 bla -prepare stmt1 from 'update t1 set b=''bla'' -where a=2 -limit ?'; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?' at line 3 -test_sequence ------- insert tests ------ -delete from t1 ; -insert into t1 values (1,'one'); -insert into t1 values (2,'two'); -insert into t1 values (3,'three'); -insert into t1 values (4,'four'); -commit ; -delete from t9 ; -insert into t9 -set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, -c10= 1, c11= 1, c12 = 1, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=true, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t9 -set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, -c10= 9, c11= 9, c12 = 9, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=false, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; -commit ; -prepare stmt1 from 'insert into t1 values(5, ''five'' )'; -execute stmt1; -select a,b from t1 where a = 5; -a b -5 five -set @arg00='six' ; -prepare stmt1 from 'insert into t1 values(6, ? )'; -execute stmt1 using @arg00; -select a,b from t1 where b = @arg00; -a b -6 six -execute stmt1 using @arg00; -ERROR 23000: Duplicate entry '6' for key 1 -set @arg00=NULL ; -prepare stmt1 from 'insert into t1 values(0, ? )'; -execute stmt1 using @arg00; -select a,b from t1 where b is NULL; -a b -0 NULL -set @arg00=8 ; -set @arg01='eight' ; -prepare stmt1 from 'insert into t1 values(?, ? )'; -execute stmt1 using @arg00, @arg01 ; -select a,b from t1 where b = @arg01; -a b -8 eight -set @NULL= null ; -set @arg00= 'abc' ; -execute stmt1 using @NULL, @NULL ; -ERROR 23000: Column 'a' cannot be null -execute stmt1 using @NULL, @NULL ; -ERROR 23000: Column 'a' cannot be null -execute stmt1 using @NULL, @arg00 ; -ERROR 23000: Column 'a' cannot be null -execute stmt1 using @NULL, @arg00 ; -ERROR 23000: Column 'a' cannot be null -set @arg01= 10000 + 2 ; -execute stmt1 using @arg01, @arg00 ; -set @arg01= 10000 + 1 ; -execute stmt1 using @arg01, @arg00 ; -select * from t1 where a > 10000 order by a ; -a b -10001 abc -10002 abc -delete from t1 where a > 10000 ; -set @arg01= 10000 + 2 ; -execute stmt1 using @arg01, @NULL ; -set @arg01= 10000 + 1 ; -execute stmt1 using @arg01, @NULL ; -select * from t1 where a > 10000 order by a ; -a b -10001 NULL -10002 NULL -delete from t1 where a > 10000 ; -set @arg01= 10000 + 10 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 9 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 8 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 7 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 6 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 5 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 4 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 3 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 2 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 1 ; -execute stmt1 using @arg01, @arg01 ; -select * from t1 where a > 10000 order by a ; -a b -10001 10001 -10002 10002 -10003 10003 -10004 10004 -10005 10005 -10006 10006 -10007 10007 -10008 10008 -10009 10009 -10010 10010 -delete from t1 where a > 10000 ; -set @arg00=81 ; -set @arg01='8-1' ; -set @arg02=82 ; -set @arg03='8-2' ; -prepare stmt1 from 'insert into t1 values(?,?),(?,?)'; -execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; -select a,b from t1 where a in (@arg00,@arg02) ; -a b -81 8-1 -82 8-2 -set @arg00=9 ; -set @arg01='nine' ; -prepare stmt1 from 'insert into t1 set a=?, b=? '; -execute stmt1 using @arg00, @arg01 ; -select a,b from t1 where a = @arg00 ; -a b -9 nine -set @arg00=6 ; -set @arg01=1 ; -prepare stmt1 from 'insert into t1 set a=?, b=''sechs'' - on duplicate key update a=a + ?, b=concat(b,''modified'') '; -execute stmt1 using @arg00, @arg01; -select * from t1 order by a; -a b -0 NULL -1 one -2 two -3 three -4 four -5 five -7 sixmodified -8 eight -9 nine -81 8-1 -82 8-2 -set @arg00=81 ; -set @arg01=1 ; -execute stmt1 using @arg00, @arg01; -ERROR 23000: Duplicate entry '82' for key 1 -drop table if exists t2 ; -create table t2 (id int auto_increment primary key) -ENGINE= 'InnoDB' ; -prepare stmt1 from ' select last_insert_id() ' ; -insert into t2 values (NULL) ; -execute stmt1 ; -last_insert_id() -1 -insert into t2 values (NULL) ; -execute stmt1 ; -last_insert_id() -2 -drop table t2 ; -set @1000=1000 ; -set @x1000_2="x1000_2" ; -set @x1000_3="x1000_3" ; -set @x1000="x1000" ; -set @1100=1100 ; -set @x1100="x1100" ; -set @100=100 ; -set @updated="updated" ; -insert into t1 values(1000,'x1000_1') ; -insert into t1 values(@1000,@x1000_2),(@1000,@x1000_3) -on duplicate key update a = a + @100, b = concat(b,@updated) ; -select a,b from t1 where a >= 1000 order by a ; -a b -1000 x1000_3 -1100 x1000_1updated -delete from t1 where a >= 1000 ; -insert into t1 values(1000,'x1000_1') ; -prepare stmt1 from ' insert into t1 values(?,?),(?,?) - on duplicate key update a = a + ?, b = concat(b,?) '; -execute stmt1 using @1000, @x1000_2, @1000, @x1000_3, @100, @updated ; -select a,b from t1 where a >= 1000 order by a ; -a b -1000 x1000_3 -1100 x1000_1updated -delete from t1 where a >= 1000 ; -insert into t1 values(1000,'x1000_1') ; -execute stmt1 using @1000, @x1000_2, @1100, @x1000_3, @100, @updated ; -select a,b from t1 where a >= 1000 order by a ; -a b -1200 x1000_1updatedupdated -delete from t1 where a >= 1000 ; -prepare stmt1 from ' replace into t1 (a,b) select 100, ''hundred'' '; -execute stmt1; -execute stmt1; -execute stmt1; -test_sequence ------- multi table tests ------ -delete from t1 ; -delete from t9 ; -insert into t1(a,b) values (1, 'one'), (2, 'two'), (3, 'three') ; -insert into t9 (c1,c21) -values (1, 'one'), (2, 'two'), (3, 'three') ; -prepare stmt_delete from " delete t1, t9 - from t1, t9 where t1.a=t9.c1 and t1.b='updated' "; -prepare stmt_update from " update t1, t9 - set t1.b='updated', t9.c21='updated' - where t1.a=t9.c1 and t1.a=? "; -prepare stmt_select1 from " select a, b from t1 order by a" ; -prepare stmt_select2 from " select c1, c21 from t9 order by c1" ; -set @arg00= 1 ; -execute stmt_update using @arg00 ; -execute stmt_delete ; -execute stmt_select1 ; -a b -2 two -3 three -execute stmt_select2 ; -c1 c21 -2 two -3 three -set @arg00= @arg00 + 1 ; -execute stmt_update using @arg00 ; -execute stmt_delete ; -execute stmt_select1 ; -a b -3 three -execute stmt_select2 ; -c1 c21 -3 three -set @arg00= @arg00 + 1 ; -execute stmt_update using @arg00 ; -execute stmt_delete ; -execute stmt_select1 ; -a b -execute stmt_select2 ; -c1 c21 -set @arg00= @arg00 + 1 ; -delete from t1 ; -insert into t1 values (1,'one'); -insert into t1 values (2,'two'); -insert into t1 values (3,'three'); -insert into t1 values (4,'four'); -commit ; -delete from t9 ; -insert into t9 -set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, -c10= 1, c11= 1, c12 = 1, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=true, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t9 -set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, -c10= 9, c11= 9, c12 = 9, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=false, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; -commit ; -insert into t1 values(0,NULL) ; -set @duplicate='duplicate ' ; -set @1000=1000 ; -set @5=5 ; -select a,b from t1 where a < 5 order by a ; -a b -0 NULL -1 one -2 two -3 three -4 four -insert into t1 select a + @1000, concat(@duplicate,b) from t1 -where a < @5 ; -affected rows: 5 -info: Records: 5 Duplicates: 0 Warnings: 0 -select a,b from t1 where a >= 1000 order by a ; -a b -1000 NULL -1001 duplicate one -1002 duplicate two -1003 duplicate three -1004 duplicate four -delete from t1 where a >= 1000 ; -prepare stmt1 from ' insert into t1 select a + ?, concat(?,b) from t1 -where a < ? ' ; -execute stmt1 using @1000, @duplicate, @5; -affected rows: 5 -info: Records: 5 Duplicates: 0 Warnings: 0 -select a,b from t1 where a >= 1000 order by a ; -a b -1000 NULL -1001 duplicate one -1002 duplicate two -1003 duplicate three -1004 duplicate four -delete from t1 where a >= 1000 ; -set @float=1.00; -set @five='five' ; -drop table if exists t2; -create table t2 like t1 ; -insert into t2 (b,a) -select @duplicate, sum(first.a) from t1 first, t1 second -where first.a <> @5 and second.b = first.b -and second.b <> @five -group by second.b -having sum(second.a) > @2 -union -select b, a + @100 from t1 -where (a,b) in ( select sqrt(a+@1)+CAST(@float AS signed),b -from t1); -affected rows: 3 -info: Records: 3 Duplicates: 0 Warnings: 0 -select a,b from t2 order by a ; -a b -3 duplicate -4 duplicate -103 three -delete from t2 ; -prepare stmt1 from ' insert into t2 (b,a) -select ?, sum(first.a) - from t1 first, t1 second - where first.a <> ? and second.b = first.b and second.b <> ? - group by second.b - having sum(second.a) > ? -union -select b, a + ? from t1 - where (a,b) in ( select sqrt(a+?)+CAST(? AS signed),b - from t1 ) ' ; -execute stmt1 using @duplicate, @5, @five, @2, @100, @1, @float ; -affected rows: 3 -info: Records: 3 Duplicates: 0 Warnings: 0 -select a,b from t2 order by a ; -a b -3 duplicate -4 duplicate -103 three -drop table t2; -drop table if exists t5 ; -set @arg01= 8; -set @arg02= 8.0; -set @arg03= 80.00000000000e-1; -set @arg04= 'abc' ; -set @arg05= CAST('abc' as binary) ; -set @arg06= '1991-08-05' ; -set @arg07= CAST('1991-08-05' as date); -set @arg08= '1991-08-05 01:01:01' ; -set @arg09= CAST('1991-08-05 01:01:01' as datetime) ; -set @arg10= unix_timestamp('1991-01-01 01:01:01'); -set @arg11= YEAR('1991-01-01 01:01:01'); -set @arg12= 8 ; -set @arg12= NULL ; -set @arg13= 8.0 ; -set @arg13= NULL ; -set @arg14= 'abc'; -set @arg14= NULL ; -set @arg15= CAST('abc' as binary) ; -set @arg15= NULL ; -create table t5 as select -8 as const01, @arg01 as param01, -8.0 as const02, @arg02 as param02, -80.00000000000e-1 as const03, @arg03 as param03, -'abc' as const04, @arg04 as param04, -CAST('abc' as binary) as const05, @arg05 as param05, -'1991-08-05' as const06, @arg06 as param06, -CAST('1991-08-05' as date) as const07, @arg07 as param07, -'1991-08-05 01:01:01' as const08, @arg08 as param08, -CAST('1991-08-05 01:01:01' as datetime) as const09, @arg09 as param09, -unix_timestamp('1991-01-01 01:01:01') as const10, @arg10 as param10, -YEAR('1991-01-01 01:01:01') as const11, @arg11 as param11, -NULL as const12, @arg12 as param12, -@arg13 as param13, -@arg14 as param14, -@arg15 as param15; -show create table t5 ; -Table Create Table -t5 CREATE TABLE `t5` ( - `const01` bigint(1) NOT NULL default '0', - `param01` bigint(20) default NULL, - `const02` double(3,1) NOT NULL default '0.0', - `param02` double default NULL, - `const03` double NOT NULL default '0', - `param03` double default NULL, - `const04` char(3) NOT NULL default '', - `param04` longtext, - `const05` binary(3) NOT NULL default '', - `param05` longblob, - `const06` varchar(10) NOT NULL default '', - `param06` longtext, - `const07` date default NULL, - `param07` longblob, - `const08` varchar(19) NOT NULL default '', - `param08` longtext, - `const09` datetime default NULL, - `param09` longblob, - `const10` int(10) NOT NULL default '0', - `param10` bigint(20) default NULL, - `const11` int(4) default NULL, - `param11` bigint(20) default NULL, - `const12` binary(0) default NULL, - `param12` bigint(20) default NULL, - `param13` double default NULL, - `param14` longtext, - `param15` longblob -) ENGINE=MyISAM DEFAULT CHARSET=latin1 -select * from t5 ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def test t5 t5 const01 const01 8 1 1 N 32769 0 63 -def test t5 t5 param01 param01 8 20 1 Y 32768 0 63 -def test t5 t5 const02 const02 5 3 3 N 32769 1 63 -def test t5 t5 param02 param02 5 20 1 Y 32768 31 63 -def test t5 t5 const03 const03 5 23 1 N 32769 31 63 -def test t5 t5 param03 param03 5 20 1 Y 32768 31 63 -def test t5 t5 const04 const04 254 3 3 N 1 0 8 -def test t5 t5 param04 param04 252 16777215 3 Y 16 0 8 -def test t5 t5 const05 const05 254 3 3 N 129 0 63 -def test t5 t5 param05 param05 252 16777215 3 Y 144 0 63 -def test t5 t5 const06 const06 253 10 10 N 1 0 8 -def test t5 t5 param06 param06 252 16777215 10 Y 16 0 8 -def test t5 t5 const07 const07 10 10 10 Y 128 0 63 -def test t5 t5 param07 param07 252 16777215 10 Y 144 0 63 -def test t5 t5 const08 const08 253 19 19 N 1 0 8 -def test t5 t5 param08 param08 252 16777215 19 Y 16 0 8 -def test t5 t5 const09 const09 12 19 19 Y 128 0 63 -def test t5 t5 param09 param09 252 16777215 19 Y 144 0 63 -def test t5 t5 const10 const10 3 10 9 N 32769 0 63 -def test t5 t5 param10 param10 8 20 9 Y 32768 0 63 -def test t5 t5 const11 const11 3 4 4 Y 32768 0 63 -def test t5 t5 param11 param11 8 20 4 Y 32768 0 63 -def test t5 t5 const12 const12 254 0 0 Y 128 0 63 -def test t5 t5 param12 param12 8 20 0 Y 32768 0 63 -def test t5 t5 param13 param13 5 20 0 Y 32768 31 63 -def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8 -def test t5 t5 param15 param15 252 16777215 0 Y 144 0 63 -const01 8 -param01 8 -const02 8.0 -param02 8 -const03 8 -param03 8 -const04 abc -param04 abc -const05 abc -param05 abc -const06 1991-08-05 -param06 1991-08-05 -const07 1991-08-05 -param07 1991-08-05 -const08 1991-08-05 01:01:01 -param08 1991-08-05 01:01:01 -const09 1991-08-05 01:01:01 -param09 1991-08-05 01:01:01 -const10 662680861 -param10 662680861 -const11 1991 -param11 1991 -const12 NULL -param12 NULL -param13 NULL -param14 NULL -param15 NULL -drop table t5 ; -test_sequence ------- data type conversion tests ------ -delete from t1 ; -insert into t1 values (1,'one'); -insert into t1 values (2,'two'); -insert into t1 values (3,'three'); -insert into t1 values (4,'four'); -commit ; -delete from t9 ; -insert into t9 -set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, -c10= 1, c11= 1, c12 = 1, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=true, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t9 -set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, -c10= 9, c11= 9, c12 = 9, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=false, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; -commit ; -insert into t9 set c1= 0, c15= '1991-01-01 01:01:01' ; -select * from t9 order by c1 ; -c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32 -0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday -test_sequence ------- select @parameter:= column ------ -prepare full_info from "select @arg01, @arg02, @arg03, @arg04, - @arg05, @arg06, @arg07, @arg08, - @arg09, @arg10, @arg11, @arg12, - @arg13, @arg14, @arg15, @arg16, - @arg17, @arg18, @arg19, @arg20, - @arg21, @arg22, @arg23, @arg24, - @arg25, @arg26, @arg27, @arg28, - @arg29, @arg30, @arg31, @arg32" ; -select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, -@arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8, -@arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12, -@arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16, -@arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20, -@arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24, -@arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28, -@arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32 -from t9 where c1= 1 ; -@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 -1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 1 Y 128 31 63 -def @arg03 254 20 1 Y 128 31 63 -def @arg04 254 20 1 Y 128 31 63 -def @arg05 254 20 1 Y 128 31 63 -def @arg06 254 20 1 Y 128 31 63 -def @arg07 254 20 1 Y 128 31 63 -def @arg08 254 20 1 Y 128 31 63 -def @arg09 254 20 1 Y 128 31 63 -def @arg10 254 20 1 Y 128 31 63 -def @arg11 254 20 1 Y 128 31 63 -def @arg12 254 20 1 Y 128 31 63 -def @arg13 254 8192 10 Y 128 31 63 -def @arg14 254 8192 19 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 8 Y 128 31 63 -def @arg17 254 20 4 Y 128 31 63 -def @arg18 254 20 1 Y 128 31 63 -def @arg19 254 20 1 Y 128 31 63 -def @arg20 254 8192 1 Y 0 31 8 -def @arg21 254 8192 10 Y 0 31 8 -def @arg22 254 8192 30 Y 0 31 8 -def @arg23 254 8192 8 Y 128 31 63 -def @arg24 254 8192 8 Y 0 31 8 -def @arg25 254 8192 4 Y 128 31 63 -def @arg26 254 8192 4 Y 0 31 8 -def @arg27 254 8192 10 Y 128 31 63 -def @arg28 254 8192 10 Y 0 31 8 -def @arg29 254 8192 8 Y 128 31 63 -def @arg30 254 8192 8 Y 0 31 8 -def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, -@arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8, -@arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12, -@arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16, -@arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20, -@arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24, -@arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28, -@arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32 -from t9 where c1= 0 ; -@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 -0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 0 Y 128 31 63 -def @arg03 254 20 0 Y 128 31 63 -def @arg04 254 20 0 Y 128 31 63 -def @arg05 254 20 0 Y 128 31 63 -def @arg06 254 20 0 Y 128 31 63 -def @arg07 254 20 0 Y 128 31 63 -def @arg08 254 20 0 Y 128 31 63 -def @arg09 254 20 0 Y 128 31 63 -def @arg10 254 20 0 Y 128 31 63 -def @arg11 254 20 0 Y 128 31 63 -def @arg12 254 20 0 Y 128 31 63 -def @arg13 254 8192 0 Y 128 31 63 -def @arg14 254 8192 0 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 0 Y 128 31 63 -def @arg17 254 20 0 Y 128 31 63 -def @arg18 254 20 0 Y 128 31 63 -def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 0 31 8 -def @arg21 254 8192 0 Y 0 31 8 -def @arg22 254 8192 0 Y 0 31 8 -def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 0 31 8 -def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 0 31 8 -def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 0 31 8 -def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 0 31 8 -def @arg31 254 8192 0 Y 0 31 8 -def @arg32 254 8192 0 Y 0 31 8 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -prepare stmt1 from "select - @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, - @arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8, - @arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12, - @arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16, - @arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20, - @arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24, - @arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28, - @arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32 -from t9 where c1= ?" ; -set @my_key= 1 ; -execute stmt1 using @my_key ; -@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 -1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 1 Y 128 31 63 -def @arg03 254 20 1 Y 128 31 63 -def @arg04 254 20 1 Y 128 31 63 -def @arg05 254 20 1 Y 128 31 63 -def @arg06 254 20 1 Y 128 31 63 -def @arg07 254 20 1 Y 128 31 63 -def @arg08 254 20 1 Y 128 31 63 -def @arg09 254 20 1 Y 128 31 63 -def @arg10 254 20 1 Y 128 31 63 -def @arg11 254 20 1 Y 128 31 63 -def @arg12 254 20 1 Y 128 31 63 -def @arg13 254 8192 10 Y 128 31 63 -def @arg14 254 8192 19 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 8 Y 128 31 63 -def @arg17 254 20 4 Y 128 31 63 -def @arg18 254 20 1 Y 128 31 63 -def @arg19 254 20 1 Y 128 31 63 -def @arg20 254 8192 1 Y 0 31 8 -def @arg21 254 8192 10 Y 0 31 8 -def @arg22 254 8192 30 Y 0 31 8 -def @arg23 254 8192 8 Y 128 31 63 -def @arg24 254 8192 8 Y 0 31 8 -def @arg25 254 8192 4 Y 128 31 63 -def @arg26 254 8192 4 Y 0 31 8 -def @arg27 254 8192 10 Y 128 31 63 -def @arg28 254 8192 10 Y 0 31 8 -def @arg29 254 8192 8 Y 128 31 63 -def @arg30 254 8192 8 Y 0 31 8 -def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -set @my_key= 0 ; -execute stmt1 using @my_key ; -@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 -0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 0 Y 128 31 63 -def @arg03 254 20 0 Y 128 31 63 -def @arg04 254 20 0 Y 128 31 63 -def @arg05 254 20 0 Y 128 31 63 -def @arg06 254 20 0 Y 128 31 63 -def @arg07 254 20 0 Y 128 31 63 -def @arg08 254 20 0 Y 128 31 63 -def @arg09 254 20 0 Y 128 31 63 -def @arg10 254 20 0 Y 128 31 63 -def @arg11 254 20 0 Y 128 31 63 -def @arg12 254 20 0 Y 128 31 63 -def @arg13 254 8192 0 Y 128 31 63 -def @arg14 254 8192 0 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 0 Y 128 31 63 -def @arg17 254 20 0 Y 128 31 63 -def @arg18 254 20 0 Y 128 31 63 -def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 0 31 8 -def @arg21 254 8192 0 Y 0 31 8 -def @arg22 254 8192 0 Y 0 31 8 -def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 0 31 8 -def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 0 31 8 -def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 0 31 8 -def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 0 31 8 -def @arg31 254 8192 0 Y 0 31 8 -def @arg32 254 8192 0 Y 0 31 8 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -prepare stmt1 from "select ? := c1 from t9 where c1= 1" ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':= c1 from t9 where c1= 1' at line 1 -test_sequence ------- select column, .. into @parm,.. ------ -select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, -c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, -c25, c26, c27, c28, c29, c30, c31, c32 -into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, -@arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, -@arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24, -@arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 -from t9 where c1= 1 ; -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 1 Y 128 31 63 -def @arg03 254 20 1 Y 128 31 63 -def @arg04 254 20 1 Y 128 31 63 -def @arg05 254 20 1 Y 128 31 63 -def @arg06 254 20 1 Y 128 31 63 -def @arg07 254 20 1 Y 128 31 63 -def @arg08 254 20 1 Y 128 31 63 -def @arg09 254 20 1 Y 128 31 63 -def @arg10 254 20 1 Y 128 31 63 -def @arg11 254 20 1 Y 128 31 63 -def @arg12 254 20 1 Y 128 31 63 -def @arg13 254 8192 10 Y 128 31 63 -def @arg14 254 8192 19 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 8 Y 128 31 63 -def @arg17 254 20 4 Y 128 31 63 -def @arg18 254 20 1 Y 128 31 63 -def @arg19 254 20 1 Y 128 31 63 -def @arg20 254 8192 1 Y 0 31 8 -def @arg21 254 8192 10 Y 0 31 8 -def @arg22 254 8192 30 Y 0 31 8 -def @arg23 254 8192 8 Y 128 31 63 -def @arg24 254 8192 8 Y 0 31 8 -def @arg25 254 8192 4 Y 128 31 63 -def @arg26 254 8192 4 Y 0 31 8 -def @arg27 254 8192 10 Y 128 31 63 -def @arg28 254 8192 10 Y 0 31 8 -def @arg29 254 8192 8 Y 128 31 63 -def @arg30 254 8192 8 Y 0 31 8 -def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, -c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, -c25, c26, c27, c28, c29, c30, c31, c32 -into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, -@arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, -@arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24, -@arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 -from t9 where c1= 0 ; -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 0 Y 128 31 63 -def @arg03 254 20 0 Y 128 31 63 -def @arg04 254 20 0 Y 128 31 63 -def @arg05 254 20 0 Y 128 31 63 -def @arg06 254 20 0 Y 128 31 63 -def @arg07 254 20 0 Y 128 31 63 -def @arg08 254 20 0 Y 128 31 63 -def @arg09 254 20 0 Y 128 31 63 -def @arg10 254 20 0 Y 128 31 63 -def @arg11 254 20 0 Y 128 31 63 -def @arg12 254 20 0 Y 128 31 63 -def @arg13 254 8192 0 Y 128 31 63 -def @arg14 254 8192 0 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 0 Y 128 31 63 -def @arg17 254 20 0 Y 128 31 63 -def @arg18 254 20 0 Y 128 31 63 -def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 0 31 8 -def @arg21 254 8192 0 Y 0 31 8 -def @arg22 254 8192 0 Y 0 31 8 -def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 0 31 8 -def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 0 31 8 -def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 0 31 8 -def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 0 31 8 -def @arg31 254 8192 0 Y 0 31 8 -def @arg32 254 8192 0 Y 0 31 8 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -prepare stmt1 from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, - c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, - c25, c26, c27, c28, c29, c30, c31, c32 -into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, - @arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, - @arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24, - @arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 -from t9 where c1= ?" ; -set @my_key= 1 ; -execute stmt1 using @my_key ; -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 1 Y 128 31 63 -def @arg03 254 20 1 Y 128 31 63 -def @arg04 254 20 1 Y 128 31 63 -def @arg05 254 20 1 Y 128 31 63 -def @arg06 254 20 1 Y 128 31 63 -def @arg07 254 20 1 Y 128 31 63 -def @arg08 254 20 1 Y 128 31 63 -def @arg09 254 20 1 Y 128 31 63 -def @arg10 254 20 1 Y 128 31 63 -def @arg11 254 20 1 Y 128 31 63 -def @arg12 254 20 1 Y 128 31 63 -def @arg13 254 8192 10 Y 128 31 63 -def @arg14 254 8192 19 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 8 Y 128 31 63 -def @arg17 254 20 4 Y 128 31 63 -def @arg18 254 20 1 Y 128 31 63 -def @arg19 254 20 1 Y 128 31 63 -def @arg20 254 8192 1 Y 0 31 8 -def @arg21 254 8192 10 Y 0 31 8 -def @arg22 254 8192 30 Y 0 31 8 -def @arg23 254 8192 8 Y 128 31 63 -def @arg24 254 8192 8 Y 0 31 8 -def @arg25 254 8192 4 Y 128 31 63 -def @arg26 254 8192 4 Y 0 31 8 -def @arg27 254 8192 10 Y 128 31 63 -def @arg28 254 8192 10 Y 0 31 8 -def @arg29 254 8192 8 Y 128 31 63 -def @arg30 254 8192 8 Y 0 31 8 -def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -set @my_key= 0 ; -execute stmt1 using @my_key ; -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 0 Y 128 31 63 -def @arg03 254 20 0 Y 128 31 63 -def @arg04 254 20 0 Y 128 31 63 -def @arg05 254 20 0 Y 128 31 63 -def @arg06 254 20 0 Y 128 31 63 -def @arg07 254 20 0 Y 128 31 63 -def @arg08 254 20 0 Y 128 31 63 -def @arg09 254 20 0 Y 128 31 63 -def @arg10 254 20 0 Y 128 31 63 -def @arg11 254 20 0 Y 128 31 63 -def @arg12 254 20 0 Y 128 31 63 -def @arg13 254 8192 0 Y 128 31 63 -def @arg14 254 8192 0 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 0 Y 128 31 63 -def @arg17 254 20 0 Y 128 31 63 -def @arg18 254 20 0 Y 128 31 63 -def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 0 31 8 -def @arg21 254 8192 0 Y 0 31 8 -def @arg22 254 8192 0 Y 0 31 8 -def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 0 31 8 -def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 0 31 8 -def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 0 31 8 -def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 0 31 8 -def @arg31 254 8192 0 Y 0 31 8 -def @arg32 254 8192 0 Y 0 31 8 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -prepare stmt1 from "select c1 into ? from t9 where c1= 1" ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? from t9 where c1= 1' at line 1 -test_sequence --- insert into numeric columns -- -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20 ) ; -set @arg00= 21 ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ) ; -prepare stmt1 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22 )" ; -execute stmt1 ; -set @arg00= 23; -prepare stmt2 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, -30.0, 30.0, 30.0 ) ; -set @arg00= 31.0 ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ) ; -prepare stmt1 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, - 32.0, 32.0, 32.0 )" ; -execute stmt1 ; -set @arg00= 33.0; -prepare stmt2 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( '40', '40', '40', '40', '40', '40', '40', '40', -'40', '40', '40' ) ; -set @arg00= '41' ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ) ; -prepare stmt1 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( '42', '42', '42', '42', '42', '42', '42', '42', - '42', '42', '42' )" ; -execute stmt1 ; -set @arg00= '43'; -prepare stmt2 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( CAST('50' as binary), CAST('50' as binary), -CAST('50' as binary), CAST('50' as binary), CAST('50' as binary), -CAST('50' as binary), CAST('50' as binary), CAST('50' as binary), -CAST('50' as binary), CAST('50' as binary), CAST('50' as binary) ) ; -set @arg00= CAST('51' as binary) ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ) ; -prepare stmt1 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( CAST('52' as binary), CAST('52' as binary), - CAST('52' as binary), CAST('52' as binary), CAST('52' as binary), - CAST('52' as binary), CAST('52' as binary), CAST('52' as binary), - CAST('52' as binary), CAST('52' as binary), CAST('52' as binary) )" ; -execute stmt1 ; -set @arg00= CAST('53' as binary) ; -prepare stmt2 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -set @arg00= 2 ; -set @arg00= NULL ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( 60, NULL, NULL, NULL, NULL, NULL, NULL, NULL, -NULL, NULL, NULL ) ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( 61, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ) ; -prepare stmt1 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( 62, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL )" ; -execute stmt1 ; -prepare stmt2 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( 63, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -set @arg00= 8.0 ; -set @arg00= NULL ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( 71, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ) ; -prepare stmt2 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( 73, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -set @arg00= 'abc' ; -set @arg00= NULL ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( 81, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ) ; -prepare stmt2 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( 83, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 -from t9 where c1 >= 20 -order by c1 ; -c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c12 -20 20 20 20 20 20 20 20 20 20 20.0000 -21 21 21 21 21 21 21 21 21 21 21.0000 -22 22 22 22 22 22 22 22 22 22 22.0000 -23 23 23 23 23 23 23 23 23 23 23.0000 -30 30 30 30 30 30 30 30 30 30 30.0000 -31 31 31 31 31 31 31 31 31 31 31.0000 -32 32 32 32 32 32 32 32 32 32 32.0000 -33 33 33 33 33 33 33 33 33 33 33.0000 -40 40 40 40 40 40 40 40 40 40 40.0000 -41 41 41 41 41 41 41 41 41 41 41.0000 -42 42 42 42 42 42 42 42 42 42 42.0000 -43 43 43 43 43 43 43 43 43 43 43.0000 -50 50 50 50 50 50 50 50 50 50 50.0000 -51 51 51 51 51 51 51 51 51 51 51.0000 -52 52 52 52 52 52 52 52 52 52 52.0000 -53 53 53 53 53 53 53 53 53 53 53.0000 -60 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -61 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -62 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -63 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -71 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -73 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -81 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -83 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -test_sequence --- select .. where numeric column = .. -- -set @arg00= 20; -select 'true' as found from t9 -where c1= 20 and c2= 20 and c3= 20 and c4= 20 and c5= 20 and c6= 20 and c7= 20 -and c8= 20 and c9= 20 and c10= 20 and c12= 20; -found -true -select 'true' as found from t9 -where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 -and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 -and c12= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c2= 20 and c3= 20 and c4= 20 and c5= 20 and c6= 20 and c7= 20 - and c8= 20 and c9= 20 and c10= 20 and c12= 20 "; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? - and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? - and c12= ? "; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -found -true -set @arg00= 20.0; -select 'true' as found from t9 -where c1= 20.0 and c2= 20.0 and c3= 20.0 and c4= 20.0 and c5= 20.0 and c6= 20.0 -and c7= 20.0 and c8= 20.0 and c9= 20.0 and c10= 20.0 and c12= 20.0; -found -true -select 'true' as found from t9 -where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 -and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 -and c12= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20.0 and c2= 20.0 and c3= 20.0 and c4= 20.0 and c5= 20.0 and c6= 20.0 - and c7= 20.0 and c8= 20.0 and c9= 20.0 and c10= 20.0 and c12= 20.0 "; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? - and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? - and c12= ? "; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -found -true -select 'true' as found from t9 -where c1= '20' and c2= '20' and c3= '20' and c4= '20' and c5= '20' and c6= '20' - and c7= '20' and c8= '20' and c9= '20' and c10= '20' and c12= '20'; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= '20' and c2= '20' and c3= '20' and c4= '20' and c5= '20' and c6= '20' - and c7= '20' and c8= '20' and c9= '20' and c10= '20' and c12= '20' "; -execute stmt1 ; -found -true -set @arg00= '20'; -select 'true' as found from t9 -where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 -and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 -and c12= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? - and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? - and c12= ? "; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -found -true -select 'true' as found from t9 -where c1= CAST('20' as binary) and c2= CAST('20' as binary) and -c3= CAST('20' as binary) and c4= CAST('20' as binary) and -c5= CAST('20' as binary) and c6= CAST('20' as binary) and -c7= CAST('20' as binary) and c8= CAST('20' as binary) and -c9= CAST('20' as binary) and c10= CAST('20' as binary) and -c12= CAST('20' as binary); -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= CAST('20' as binary) and c2= CAST('20' as binary) and - c3= CAST('20' as binary) and c4= CAST('20' as binary) and - c5= CAST('20' as binary) and c6= CAST('20' as binary) and - c7= CAST('20' as binary) and c8= CAST('20' as binary) and - c9= CAST('20' as binary) and c10= CAST('20' as binary) and - c12= CAST('20' as binary) "; -execute stmt1 ; -found -true -set @arg00= CAST('20' as binary) ; -select 'true' as found from t9 -where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 -and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 -and c12= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? - and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? - and c12= ? "; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -found -true -delete from t9 ; -test_sequence --- some numeric overflow experiments -- -prepare my_insert from "insert into t9 - ( c21, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( 'O', ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -prepare my_select from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 -from t9 where c21 = 'O' "; -prepare my_delete from "delete from t9 where c21 = 'O' "; -set @arg00= 9223372036854775807 ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1264 Data truncated; out of range for column 'c1' at row 1 -Warning 1264 Data truncated; out of range for column 'c2' at row 1 -Warning 1264 Data truncated; out of range for column 'c3' at row 1 -Warning 1264 Data truncated; out of range for column 'c4' at row 1 -Warning 1264 Data truncated; out of range for column 'c5' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 127 -c2 32767 -c3 8388607 -c4 2147483647 -c5 2147483647 -c6 9223372036854775807 -c7 9.22337e+18 -c8 9.22337203685478e+18 -c9 9.22337203685478e+18 -c10 9.22337203685478e+18 -c12 99999.9999 -execute my_delete ; -set @arg00= '9223372036854775807' ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1264 Data truncated; out of range for column 'c1' at row 1 -Warning 1264 Data truncated; out of range for column 'c2' at row 1 -Warning 1264 Data truncated; out of range for column 'c3' at row 1 -Warning 1265 Data truncated for column 'c4' at row 1 -Warning 1265 Data truncated for column 'c5' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 127 -c2 32767 -c3 8388607 -c4 2147483647 -c5 2147483647 -c6 9223372036854775807 -c7 9.22337e+18 -c8 9.22337203685478e+18 -c9 9.22337203685478e+18 -c10 9.22337203685478e+18 -c12 99999.9999 -execute my_delete ; -set @arg00= -9223372036854775808 ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1264 Data truncated; out of range for column 'c1' at row 1 -Warning 1264 Data truncated; out of range for column 'c2' at row 1 -Warning 1264 Data truncated; out of range for column 'c3' at row 1 -Warning 1264 Data truncated; out of range for column 'c4' at row 1 -Warning 1264 Data truncated; out of range for column 'c5' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 -128 -c2 -32768 -c3 -8388608 -c4 -2147483648 -c5 -2147483648 -c6 -9223372036854775808 -c7 -9.22337e+18 -c8 -9.22337203685478e+18 -c9 -9.22337203685478e+18 -c10 -9.22337203685478e+18 -c12 -9999.9999 -execute my_delete ; -set @arg00= '-9223372036854775808' ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1264 Data truncated; out of range for column 'c1' at row 1 -Warning 1264 Data truncated; out of range for column 'c2' at row 1 -Warning 1264 Data truncated; out of range for column 'c3' at row 1 -Warning 1265 Data truncated for column 'c4' at row 1 -Warning 1265 Data truncated for column 'c5' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 -128 -c2 -32768 -c3 -8388608 -c4 -2147483648 -c5 -2147483648 -c6 -9223372036854775808 -c7 -9.22337e+18 -c8 -9.22337203685478e+18 -c9 -9.22337203685478e+18 -c10 -9.22337203685478e+18 -c12 -9999.9999 -execute my_delete ; -set @arg00= 1.11111111111111111111e+50 ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1264 Data truncated; out of range for column 'c1' at row 1 -Warning 1264 Data truncated; out of range for column 'c2' at row 1 -Warning 1264 Data truncated; out of range for column 'c3' at row 1 -Warning 1264 Data truncated; out of range for column 'c4' at row 1 -Warning 1264 Data truncated; out of range for column 'c5' at row 1 -Warning 1264 Data truncated; out of range for column 'c6' at row 1 -Warning 1264 Data truncated; out of range for column 'c7' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 127 -c2 32767 -c3 8388607 -c4 2147483647 -c5 2147483647 -c6 9223372036854775807 -c7 3.40282e+38 -c8 1.11111111111111e+50 -c9 1.11111111111111e+50 -c10 1.11111111111111e+50 -c12 99999.9999 -execute my_delete ; -set @arg00= '1.11111111111111111111e+50' ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1265 Data truncated for column 'c1' at row 1 -Warning 1265 Data truncated for column 'c2' at row 1 -Warning 1265 Data truncated for column 'c3' at row 1 -Warning 1265 Data truncated for column 'c4' at row 1 -Warning 1265 Data truncated for column 'c5' at row 1 -Warning 1265 Data truncated for column 'c6' at row 1 -Warning 1264 Data truncated; out of range for column 'c7' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 1 -c2 1 -c3 1 -c4 1 -c5 1 -c6 1 -c7 3.40282e+38 -c8 1.11111111111111e+50 -c9 1.11111111111111e+50 -c10 1.11111111111111e+50 -c12 99999.9999 -execute my_delete ; -set @arg00= -1.11111111111111111111e+50 ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1264 Data truncated; out of range for column 'c1' at row 1 -Warning 1264 Data truncated; out of range for column 'c2' at row 1 -Warning 1264 Data truncated; out of range for column 'c3' at row 1 -Warning 1264 Data truncated; out of range for column 'c4' at row 1 -Warning 1264 Data truncated; out of range for column 'c5' at row 1 -Warning 1264 Data truncated; out of range for column 'c6' at row 1 -Warning 1264 Data truncated; out of range for column 'c7' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 -128 -c2 -32768 -c3 -8388608 -c4 -2147483648 -c5 -2147483648 -c6 -9223372036854775808 -c7 -3.40282e+38 -c8 -1.11111111111111e+50 -c9 -1.11111111111111e+50 -c10 -1.11111111111111e+50 -c12 -9999.9999 -execute my_delete ; -set @arg00= '-1.11111111111111111111e+50' ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1265 Data truncated for column 'c1' at row 1 -Warning 1265 Data truncated for column 'c2' at row 1 -Warning 1265 Data truncated for column 'c3' at row 1 -Warning 1265 Data truncated for column 'c4' at row 1 -Warning 1265 Data truncated for column 'c5' at row 1 -Warning 1265 Data truncated for column 'c6' at row 1 -Warning 1264 Data truncated; out of range for column 'c7' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 -1 -c2 -1 -c3 -1 -c4 -1 -c5 -1 -c6 -1 -c7 -3.40282e+38 -c8 -1.11111111111111e+50 -c9 -1.11111111111111e+50 -c10 -1.11111111111111e+50 -c12 -9999.9999 -execute my_delete ; -test_sequence --- insert into string columns -- -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -select c1, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30 -from t9 where c1 >= 20 -order by c1 ; -c1 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 -20 2 20 20 20 20 20 20 20 20 20 20 -21 2 21 21 21 21 21 21 21 21 21 21 -22 2 22 22 22 22 22 22 22 22 22 22 -23 2 23 23 23 23 23 23 23 23 23 23 -30 3 30 30 30 30 30 30 30 30 30 30 -31 3 31 31 31 31 31 31 31 31 31 31 -32 3 32 32 32 32 32 32 32 32 32 32 -33 3 33 33 33 33 33 33 33 33 33 33 -40 4 40 40 40 40 40 40 40 40 40 40 -41 4 41 41 41 41 41 41 41 41 41 41 -42 4 42 42 42 42 42 42 42 42 42 42 -43 4 43 43 43 43 43 43 43 43 43 43 -50 5 50 50 50.00 50.00 50.00 50.00 50.00 50.00 50.00 50.00 -51 5 51 51 51 51 51 51 51 51 51 51 -52 5 52 52 52.00 52.00 52.00 52.00 52.00 52.00 52.00 52.00 -53 5 53 53 53.00 53.00 53.00 53.00 53.00 53.00 53.00 53.00 -54 5 54 54 54.00 54.00 54.00 54.00 54.00 54.00 54.00 54.00 -55 5 55 55 55 55 55 55 55 55 55 55 -56 6 56 56 56.00 56.00 56.00 56.00 56.00 56.00 56.00 56.00 -57 6 57 57 57.00 57.00 57.00 57.00 57.00 57.00 57.00 57.00 -60 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -61 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -62 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -63 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -71 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -73 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -81 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -83 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -test_sequence --- select .. where string column = .. -- -set @arg00= '20'; -select 'true' as found from t9 -where c1= 20 and concat(c20,substr('20',1+length(c20)))= '20' and c21= '20' and -c22= '20' and c23= '20' and c24= '20' and c25= '20' and c26= '20' and -c27= '20' and c28= '20' and c29= '20' and c30= '20' ; -found -true -select 'true' as found from t9 -where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and -c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and -c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr('20',1+length(c20)))= '20' and c21= '20' and - c22= '20' and c23= '20' and c24= '20' and c25= '20' and c26= '20' and - c27= '20' and c28= '20' and c29= '20' and c30= '20'" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and - c21= ? and c22= ? and c23= ? and c25= ? and - c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -found -true -set @arg00= CAST('20' as binary); -select 'true' as found from t9 -where c1= 20 and concat(c20,substr(CAST('20' as binary),1+length(c20))) -= CAST('20' as binary) and c21= CAST('20' as binary) -and c22= CAST('20' as binary) and c23= CAST('20' as binary) and -c24= CAST('20' as binary) and c25= CAST('20' as binary) and -c26= CAST('20' as binary) and c27= CAST('20' as binary) and -c28= CAST('20' as binary) and c29= CAST('20' as binary) and -c30= CAST('20' as binary) ; -found -true -select 'true' as found from t9 -where c1= 20 and concat(c20,substr(@arg00,1+length(c20))) = @arg00 and -c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and -c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and -c30= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr(CAST('20' as binary),1+length(c20))) - = CAST('20' as binary) and c21= CAST('20' as binary) - and c22= CAST('20' as binary) and c23= CAST('20' as binary) and - c24= CAST('20' as binary) and c25= CAST('20' as binary) and - c26= CAST('20' as binary) and c27= CAST('20' as binary) and - c28= CAST('20' as binary) and c29= CAST('20' as binary) and - c30= CAST('20' as binary)" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr(?,1+length(c20))) = ? and c21= ? and - c22= ? and c23= ? and c25= ? and c26= ? and c27= ? and c28= ? and - c29= ? and c30= ?"; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -found -true -set @arg00= 20; -select 'true' as found from t9 -where c1= 20 and concat(c20,substr(20,1+length(c20)))= 20 and c21= 20 and -c22= 20 and c23= 20 and c24= 20 and c25= 20 and c26= 20 and -c27= 20 and c28= 20 and c29= 20 and c30= 20 ; -found -true -select 'true' as found from t9 -where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and -c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and -c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr(20,1+length(c20)))= 20 and c21= 20 and - c22= 20 and c23= 20 and c24= 20 and c25= 20 and c26= 20 and - c27= 20 and c28= 20 and c29= 20 and c30= 20" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and - c21= ? and c22= ? and c23= ? and c25= ? and - c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -found -true -set @arg00= 20.0; -select 'true' as found from t9 -where c1= 20 and concat(c20,substr(20.0,1+length(c20)))= 20.0 and c21= 20.0 and -c22= 20.0 and c23= 20.0 and c24= 20.0 and c25= 20.0 and c26= 20.0 and -c27= 20.0 and c28= 20.0 and c29= 20.0 and c30= 20.0 ; -found -true -select 'true' as found from t9 -where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and -c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and -c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr(20.0,1+length(c20)))= 20.0 and c21= 20.0 and - c22= 20.0 and c23= 20.0 and c24= 20.0 and c25= 20.0 and c26= 20.0 and - c27= 20.0 and c28= 20.0 and c29= 20.0 and c30= 20.0" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and - c21= ? and c22= ? and c23= ? and c25= ? and - c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -found -true -delete from t9 ; -test_sequence --- insert into date/time columns -- -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1264 Data truncated; out of range for column 'c13' at row 1 -Warning 1265 Data truncated for column 'c14' at row 1 -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -Warnings: -Warning 1264 Data truncated; out of range for column 'c13' at row 1 -Warning 1265 Data truncated for column 'c14' at row 1 -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -Warnings: -Warning 1264 Data truncated; out of range for column 'c13' at row 1 -Warning 1265 Data truncated for column 'c14' at row 1 -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -Warnings: -Warning 1264 Data truncated; out of range for column 'c13' at row 1 -Warning 1265 Data truncated for column 'c14' at row 1 -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -select c1, c13, c14, c15, c16, c17 from t9 order by c1 ; -c1 c13 c14 c15 c16 c17 -20 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -21 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -22 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -23 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -30 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -31 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -32 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -33 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -40 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -41 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -42 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -43 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -50 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -51 0010-00-00 0010-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -52 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -53 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -60 NULL NULL 1991-01-01 01:01:01 NULL NULL -61 NULL NULL 1991-01-01 01:01:01 NULL NULL -62 NULL NULL 1991-01-01 01:01:01 NULL NULL -63 NULL NULL 1991-01-01 01:01:01 NULL NULL -71 NULL NULL 1991-01-01 01:01:01 NULL NULL -73 NULL NULL 1991-01-01 01:01:01 NULL NULL -81 NULL NULL 1991-01-01 01:01:01 NULL NULL -83 NULL NULL 1991-01-01 01:01:01 NULL NULL -test_sequence --- select .. where date/time column = .. -- -set @arg00= '1991-01-01 01:01:01' ; -select 'true' as found from t9 -where c1= 20 and c13= '1991-01-01 01:01:01' and c14= '1991-01-01 01:01:01' and -c15= '1991-01-01 01:01:01' and c16= '1991-01-01 01:01:01' and -c17= '1991-01-01 01:01:01' ; -found -true -select 'true' as found from t9 -where c1= 20 and c13= @arg00 and c14= @arg00 and c15= @arg00 and c16= @arg00 -and c17= @arg00 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c13= '1991-01-01 01:01:01' and c14= '1991-01-01 01:01:01' and - c15= '1991-01-01 01:01:01' and c16= '1991-01-01 01:01:01' and - c17= '1991-01-01 01:01:01'" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c13= ? and c14= ? and c15= ? and c16= ? and c17= ?" ; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00 ; -found -true -set @arg00= CAST('1991-01-01 01:01:01' as datetime) ; -select 'true' as found from t9 -where c1= 20 and c13= CAST('1991-01-01 01:01:01' as datetime) and -c14= CAST('1991-01-01 01:01:01' as datetime) and -c15= CAST('1991-01-01 01:01:01' as datetime) and -c16= CAST('1991-01-01 01:01:01' as datetime) and -c17= CAST('1991-01-01 01:01:01' as datetime) ; -found -true -select 'true' as found from t9 -where c1= 20 and c13= @arg00 and c14= @arg00 and c15= @arg00 and c16= @arg00 -and c17= @arg00 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c13= CAST('1991-01-01 01:01:01' as datetime) and - c14= CAST('1991-01-01 01:01:01' as datetime) and - c15= CAST('1991-01-01 01:01:01' as datetime) and - c16= CAST('1991-01-01 01:01:01' as datetime) and - c17= CAST('1991-01-01 01:01:01' as datetime)" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c13= ? and c14= ? and c15= ? and c16= ? and c17= ?" ; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00 ; -found -true -set @arg00= 1991 ; -select 'true' as found from t9 -where c1= 20 and c17= 1991 ; -found -true -select 'true' as found from t9 -where c1= 20 and c17= @arg00 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c17= 1991" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c17= ?" ; -execute stmt1 using @arg00 ; -found -true -set @arg00= 1.991e+3 ; -select 'true' as found from t9 -where c1= 20 and abs(c17 - 1.991e+3) < 0.01 ; -found -true -select 'true' as found from t9 -where c1= 20 and abs(c17 - @arg00) < 0.01 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and abs(c17 - 1.991e+3) < 0.01" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and abs(c17 - ?) < 0.01" ; -execute stmt1 using @arg00 ; -found -true -drop table t1, t9; diff --git a/mysql-test/r/ps_4heap.result.es b/mysql-test/r/ps_4heap.result.es deleted file mode 100644 index fcd9c52b4f9..00000000000 --- a/mysql-test/r/ps_4heap.result.es +++ /dev/null @@ -1,3114 +0,0 @@ -use test; -drop table if exists t1, t9 ; -create table t1 -( -a int, b varchar(30), -primary key(a) -) engine = 'HEAP' ; -drop table if exists t9; -create table t9 -( -c1 tinyint, c2 smallint, c3 mediumint, c4 int, -c5 integer, c6 bigint, c7 float, c8 double, -c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4), -c13 date, c14 datetime, c15 timestamp(14), c16 time, -c17 year, c18 bit, c19 bool, c20 char, -c21 char(10), c22 varchar(30), c23 char(100), c24 char(100), -c25 char(100), c26 char(100), c27 char(100), c28 char(100), -c29 char(100), c30 char(100), c31 enum('one', 'two', 'three'), -c32 set('monday', 'tuesday', 'wednesday'), -primary key(c1) -) engine = 'HEAP' ; -delete from t1 ; -insert into t1 values (1,'one'); -insert into t1 values (2,'two'); -insert into t1 values (3,'three'); -insert into t1 values (4,'four'); -commit ; -delete from t9 ; -insert into t9 -set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, -c10= 1, c11= 1, c12 = 1, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=true, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t9 -set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, -c10= 9, c11= 9, c12 = 9, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=false, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; -commit ; -test_sequence ------- simple select tests ------ -prepare stmt1 from ' select * from t9 order by c1 ' ; -execute stmt1; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def test t9 t9 c1 c1 1 4 1 N 49155 0 63 -def test t9 t9 c2 c2 2 6 1 Y 32768 0 63 -def test t9 t9 c3 c3 9 9 1 Y 32768 0 63 -def test t9 t9 c4 c4 3 11 1 Y 32768 0 63 -def test t9 t9 c5 c5 3 11 1 Y 32768 0 63 -def test t9 t9 c6 c6 8 20 1 Y 32768 0 63 -def test t9 t9 c7 c7 4 12 1 Y 32768 31 63 -def test t9 t9 c8 c8 5 22 1 Y 32768 31 63 -def test t9 t9 c9 c9 5 22 1 Y 32768 31 63 -def test t9 t9 c10 c10 5 22 1 Y 32768 31 63 -def test t9 t9 c11 c11 0 9 6 Y 32768 4 63 -def test t9 t9 c12 c12 0 10 6 Y 32768 4 63 -def test t9 t9 c13 c13 10 10 10 Y 128 0 63 -def test t9 t9 c14 c14 12 19 19 Y 128 0 63 -def test t9 t9 c15 c15 7 19 19 N 1249 0 63 -def test t9 t9 c16 c16 11 8 8 Y 128 0 63 -def test t9 t9 c17 c17 13 4 4 Y 32864 0 63 -def test t9 t9 c18 c18 1 1 1 Y 32768 0 63 -def test t9 t9 c19 c19 1 1 1 Y 32768 0 63 -def test t9 t9 c20 c20 254 1 1 Y 0 0 8 -def test t9 t9 c21 c21 253 10 10 Y 0 0 8 -def test t9 t9 c22 c22 253 30 30 Y 0 0 8 -def test t9 t9 c23 c23 253 100 8 Y 0 0 8 -def test t9 t9 c24 c24 253 100 8 Y 0 0 8 -def test t9 t9 c25 c25 253 100 4 Y 0 0 8 -def test t9 t9 c26 c26 253 100 4 Y 0 0 8 -def test t9 t9 c27 c27 253 100 10 Y 0 0 8 -def test t9 t9 c28 c28 253 100 10 Y 0 0 8 -def test t9 t9 c29 c29 253 100 8 Y 0 0 8 -def test t9 t9 c30 c30 253 100 8 Y 0 0 8 -def test t9 t9 c31 c31 254 5 3 Y 256 0 8 -def test t9 t9 c32 c32 254 24 7 Y 2048 0 8 -c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32 -1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday -set @arg00='SELECT' ; -prepare stmt1 from ' ? a from t1 where a=1 '; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? a from t1 where a=1' at line 1 -set @arg00=1 ; -select @arg00, b from t1 where a=1 ; -@arg00 b -1 one -prepare stmt1 from ' select ?, b from t1 where a=1 ' ; -execute stmt1 using @arg00 ; -? b -1 one -set @arg00='lion' ; -select @arg00, b from t1 where a=1 ; -@arg00 b -lion one -prepare stmt1 from ' select ?, b from t1 where a=1 ' ; -execute stmt1 using @arg00 ; -? b -lion one -set @arg00=NULL ; -select @arg00, b from t1 where a=1 ; -@arg00 b -NULL one -prepare stmt1 from ' select ?, b from t1 where a=1 ' ; -execute stmt1 using @arg00 ; -? b -NULL one -set @arg00=1 ; -select b, a - @arg00 from t1 where a=1 ; -b a - @arg00 -one 0 -prepare stmt1 from ' select b, a - ? from t1 where a=1 ' ; -execute stmt1 using @arg00 ; -b a - ? -one 0 -set @arg00=null ; -select @arg00 as my_col ; -my_col -NULL -prepare stmt1 from ' select ? as my_col'; -execute stmt1 using @arg00 ; -my_col -NULL -select @arg00 + 1 as my_col ; -my_col -NULL -prepare stmt1 from ' select ? + 1 as my_col'; -execute stmt1 using @arg00 ; -my_col -NULL -select 1 + @arg00 as my_col ; -my_col -NULL -prepare stmt1 from ' select 1 + ? as my_col'; -execute stmt1 using @arg00 ; -my_col -NULL -set @arg00='MySQL' ; -select substr(@arg00,1,2) from t1 where a=1 ; -substr(@arg00,1,2) -My -prepare stmt1 from ' select substr(?,1,2) from t1 where a=1 ' ; -execute stmt1 using @arg00 ; -substr(?,1,2) -My -set @arg00=3 ; -select substr('MySQL',@arg00,5) from t1 where a=1 ; -substr('MySQL',@arg00,5) -SQL -prepare stmt1 from ' select substr(''MySQL'',?,5) from t1 where a=1 ' ; -execute stmt1 using @arg00 ; -substr('MySQL',?,5) -SQL -select substr('MySQL',1,@arg00) from t1 where a=1 ; -substr('MySQL',1,@arg00) -MyS -prepare stmt1 from ' select substr(''MySQL'',1,?) from t1 where a=1 ' ; -execute stmt1 using @arg00 ; -substr('MySQL',1,?) -MyS -set @arg00='MySQL' ; -select a , concat(@arg00,b) from t1 order by a; -a concat(@arg00,b) -1 MySQLone -2 MySQLtwo -3 MySQLthree -4 MySQLfour -prepare stmt1 from ' select a , concat(?,b) from t1 order by a ' ; -execute stmt1 using @arg00; -a concat(?,b) -1 MySQLone -2 MySQLtwo -3 MySQLthree -4 MySQLfour -select a , concat(b,@arg00) from t1 order by a ; -a concat(b,@arg00) -1 oneMySQL -2 twoMySQL -3 threeMySQL -4 fourMySQL -prepare stmt1 from ' select a , concat(b,?) from t1 order by a ' ; -execute stmt1 using @arg00; -a concat(b,?) -1 oneMySQL -2 twoMySQL -3 threeMySQL -4 fourMySQL -set @arg00='MySQL' ; -select group_concat(@arg00,b order by a) from t1 -group by 'a' ; -group_concat(@arg00,b order by a) -MySQLone,MySQLtwo,MySQLthree,MySQLfour -prepare stmt1 from ' select group_concat(?,b order by a) from t1 -group by ''a'' ' ; -execute stmt1 using @arg00; -group_concat(?,b order by a) -MySQLone,MySQLtwo,MySQLthree,MySQLfour -select group_concat(b,@arg00 order by a) from t1 -group by 'a' ; -group_concat(b,@arg00 order by a) -oneMySQL,twoMySQL,threeMySQL,fourMySQL -prepare stmt1 from ' select group_concat(b,? order by a) from t1 -group by ''a'' ' ; -execute stmt1 using @arg00; -group_concat(b,? order by a) -oneMySQL,twoMySQL,threeMySQL,fourMySQL -set @arg00='first' ; -set @arg01='second' ; -set @arg02=NULL; -select @arg00, @arg01 from t1 where a=1 ; -@arg00 @arg01 -first second -prepare stmt1 from ' select ?, ? from t1 where a=1 ' ; -execute stmt1 using @arg00, @arg01 ; -? ? -first second -execute stmt1 using @arg02, @arg01 ; -? ? -NULL second -execute stmt1 using @arg00, @arg02 ; -? ? -first NULL -execute stmt1 using @arg02, @arg02 ; -? ? -NULL NULL -drop table if exists t5 ; -create table t5 (id1 int(11) not null default '0', -value2 varchar(100), value1 varchar(100)) ; -insert into t5 values (1,'hh','hh'),(2,'hh','hh'), -(1,'ii','ii'),(2,'ii','ii') ; -prepare stmt1 from ' select id1,value1 from t5 where id1=? or value1=? order by id1,value1 ' ; -set @arg00=1 ; -set @arg01='hh' ; -execute stmt1 using @arg00, @arg01 ; -id1 value1 -1 hh -1 ii -2 hh -drop table t5 ; -drop table if exists t5 ; -create table t5(session_id char(9) not null) ; -insert into t5 values ('abc') ; -prepare stmt1 from ' select * from t5 -where ?=''1111'' and session_id = ''abc'' ' ; -set @arg00='abc' ; -execute stmt1 using @arg00 ; -session_id -set @arg00='1111' ; -execute stmt1 using @arg00 ; -session_id -abc -set @arg00='abc' ; -execute stmt1 using @arg00 ; -session_id -drop table t5 ; -set @arg00='FROM' ; -select a @arg00 t1 where a=1 ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 t1 where a=1' at line 1 -prepare stmt1 from ' select a ? t1 where a=1 ' ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? t1 where a=1' at line 1 -set @arg00='t1' ; -select a from @arg00 where a=1 ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 where a=1' at line 1 -prepare stmt1 from ' select a from ? where a=1 ' ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? where a=1' at line 1 -set @arg00='WHERE' ; -select a from t1 @arg00 a=1 ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 a=1' at line 1 -prepare stmt1 from ' select a from t1 ? a=1 ' ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? a=1' at line 1 -set @arg00=1 ; -select a FROM t1 where a=@arg00 ; -a -1 -prepare stmt1 from ' select a FROM t1 where a=? ' ; -execute stmt1 using @arg00 ; -a -1 -set @arg00=1000 ; -execute stmt1 using @arg00 ; -a -set @arg00=NULL ; -select a FROM t1 where a=@arg00 ; -a -prepare stmt1 from ' select a FROM t1 where a=? ' ; -execute stmt1 using @arg00 ; -a -set @arg00=4 ; -select a FROM t1 where a=sqrt(@arg00) ; -a -2 -prepare stmt1 from ' select a FROM t1 where a=sqrt(?) ' ; -execute stmt1 using @arg00 ; -a -2 -set @arg00=NULL ; -select a FROM t1 where a=sqrt(@arg00) ; -a -prepare stmt1 from ' select a FROM t1 where a=sqrt(?) ' ; -execute stmt1 using @arg00 ; -a -set @arg00=2 ; -set @arg01=3 ; -select a FROM t1 where a in (@arg00,@arg01) order by a; -a -2 -3 -prepare stmt1 from ' select a FROM t1 where a in (?,?) order by a '; -execute stmt1 using @arg00, @arg01; -a -2 -3 -set @arg00= 'one' ; -set @arg01= 'two' ; -set @arg02= 'five' ; -prepare stmt1 from ' select b FROM t1 where b in (?,?,?) order by b ' ; -execute stmt1 using @arg00, @arg01, @arg02 ; -b -one -two -prepare stmt1 from ' select b FROM t1 where b like ? '; -set @arg00='two' ; -execute stmt1 using @arg00 ; -b -two -set @arg00='tw%' ; -execute stmt1 using @arg00 ; -b -two -set @arg00='%wo' ; -execute stmt1 using @arg00 ; -b -two -set @arg00=null ; -insert into t9 set c1= 0, c5 = NULL ; -select c5 from t9 where c5 > NULL ; -c5 -prepare stmt1 from ' select c5 from t9 where c5 > ? '; -execute stmt1 using @arg00 ; -c5 -select c5 from t9 where c5 < NULL ; -c5 -prepare stmt1 from ' select c5 from t9 where c5 < ? '; -execute stmt1 using @arg00 ; -c5 -select c5 from t9 where c5 = NULL ; -c5 -prepare stmt1 from ' select c5 from t9 where c5 = ? '; -execute stmt1 using @arg00 ; -c5 -select c5 from t9 where c5 <=> NULL ; -c5 -NULL -prepare stmt1 from ' select c5 from t9 where c5 <=> ? '; -execute stmt1 using @arg00 ; -c5 -NULL -delete from t9 where c1= 0 ; -set @arg00='>' ; -select a FROM t1 where a @arg00 1 ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 1' at line 1 -prepare stmt1 from ' select a FROM t1 where a ? 1 ' ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? 1' at line 1 -set @arg00=1 ; -select a,b FROM t1 where a is not NULL -AND b is not NULL group by a - @arg00 ; -a b -1 one -2 two -3 three -4 four -prepare stmt1 from ' select a,b FROM t1 where a is not NULL -AND b is not NULL group by a - ? ' ; -execute stmt1 using @arg00 ; -a b -1 one -2 two -3 three -4 four -set @arg00='two' ; -select a,b FROM t1 where a is not NULL -AND b is not NULL having b <> @arg00 order by a ; -a b -1 one -3 three -4 four -prepare stmt1 from ' select a,b FROM t1 where a is not NULL -AND b is not NULL having b <> ? order by a ' ; -execute stmt1 using @arg00 ; -a b -1 one -3 three -4 four -set @arg00=1 ; -select a,b FROM t1 where a is not NULL -AND b is not NULL order by a - @arg00 ; -a b -1 one -2 two -3 three -4 four -prepare stmt1 from ' select a,b FROM t1 where a is not NULL -AND b is not NULL order by a - ? ' ; -execute stmt1 using @arg00 ; -a b -1 one -2 two -3 three -4 four -set @arg00=2 ; -select a,b from t1 order by 2 ; -a b -4 four -1 one -3 three -2 two -prepare stmt1 from ' select a,b from t1 -order by ? '; -execute stmt1 using @arg00; -a b -4 four -1 one -3 three -2 two -set @arg00=1 ; -execute stmt1 using @arg00; -a b -1 one -2 two -3 three -4 four -set @arg00=0 ; -execute stmt1 using @arg00; -ERROR 42S22: Unknown column '?' in 'order clause' -set @arg00=1; -prepare stmt1 from ' select a,b from t1 order by a -limit 1 '; -execute stmt1 ; -a b -1 one -prepare stmt1 from ' select a,b from t1 -limit ? '; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?' at line 2 -set @arg00='b' ; -set @arg01=0 ; -set @arg02=2 ; -set @arg03=2 ; -select sum(a), @arg00 from t1 where a > @arg01 -and b is not null group by substr(b,@arg02) -having sum(a) <> @arg03 ; -sum(a) @arg00 -3 b -1 b -4 b -prepare stmt1 from ' select sum(a), ? from t1 where a > ? -and b is not null group by substr(b,?) -having sum(a) <> ? '; -execute stmt1 using @arg00, @arg01, @arg02, @arg03; -sum(a) ? -3 b -1 b -4 b -test_sequence ------- join tests ------ -select first.a as a1, second.a as a2 -from t1 first, t1 second -where first.a = second.a order by a1 ; -a1 a2 -1 1 -2 2 -3 3 -4 4 -prepare stmt1 from ' select first.a as a1, second.a as a2 - from t1 first, t1 second - where first.a = second.a order by a1 '; -execute stmt1 ; -a1 a2 -1 1 -2 2 -3 3 -4 4 -set @arg00='ABC'; -set @arg01='two'; -set @arg02='one'; -select first.a, @arg00, second.a FROM t1 first, t1 second -where @arg01 = first.b or first.a = second.a or second.b = @arg02 -order by second.a, first.a; -a @arg00 a -1 ABC 1 -2 ABC 1 -3 ABC 1 -4 ABC 1 -2 ABC 2 -2 ABC 3 -3 ABC 3 -2 ABC 4 -4 ABC 4 -prepare stmt1 from ' select first.a, ?, second.a FROM t1 first, t1 second - where ? = first.b or first.a = second.a or second.b = ? - order by second.a, first.a'; -execute stmt1 using @arg00, @arg01, @arg02; -a ? a -1 ABC 1 -2 ABC 1 -3 ABC 1 -4 ABC 1 -2 ABC 2 -2 ABC 3 -3 ABC 3 -2 ABC 4 -4 ABC 4 -drop table if exists t2 ; -create table t2 as select * from t1 ; -set @query1= 'SELECT * FROM t2 join t1 on (t1.a=t2.a) order by t2.a ' ; -set @query2= 'SELECT * FROM t2 natural join t1 order by t2.a ' ; -set @query3= 'SELECT * FROM t2 join t1 using(a) order by t2.a ' ; -set @query4= 'SELECT * FROM t2 left join t1 on(t1.a=t2.a) order by t2.a ' ; -set @query5= 'SELECT * FROM t2 natural left join t1 order by t2.a ' ; -set @query6= 'SELECT * FROM t2 left join t1 using(a) order by t2.a ' ; -set @query7= 'SELECT * FROM t2 right join t1 on(t1.a=t2.a) order by t2.a ' ; -set @query8= 'SELECT * FROM t2 natural right join t1 order by t2.a ' ; -set @query9= 'SELECT * FROM t2 right join t1 using(a) order by t2.a ' ; -the join statement is: -SELECT * FROM t2 right join t1 using(a) order by t2.a -prepare stmt1 from @query9 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -the join statement is: -SELECT * FROM t2 natural right join t1 order by t2.a -prepare stmt1 from @query8 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -the join statement is: -SELECT * FROM t2 right join t1 on(t1.a=t2.a) order by t2.a -prepare stmt1 from @query7 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -the join statement is: -SELECT * FROM t2 left join t1 using(a) order by t2.a -prepare stmt1 from @query6 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -the join statement is: -SELECT * FROM t2 natural left join t1 order by t2.a -prepare stmt1 from @query5 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -the join statement is: -SELECT * FROM t2 left join t1 on(t1.a=t2.a) order by t2.a -prepare stmt1 from @query4 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -the join statement is: -SELECT * FROM t2 join t1 using(a) order by t2.a -prepare stmt1 from @query3 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -the join statement is: -SELECT * FROM t2 natural join t1 order by t2.a -prepare stmt1 from @query2 ; -execute stmt1 ; -a b -1 one -2 two -3 three -4 four -execute stmt1 ; -a b -1 one -2 two -3 three -4 four -execute stmt1 ; -a b -1 one -2 two -3 three -4 four -the join statement is: -SELECT * FROM t2 join t1 on (t1.a=t2.a) order by t2.a -prepare stmt1 from @query1 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -drop table t2 ; -test_sequence ------- subquery tests ------ -prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where b = ''two'') '; -execute stmt1 ; -a b -2 two -set @arg00='two' ; -select a, b FROM t1 outer_table where -a = (select a from t1 where b = 'two' ) and b=@arg00 ; -a b -2 two -prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where b = ''two'') and b=? '; -execute stmt1 using @arg00; -a b -2 two -set @arg00='two' ; -select a, b FROM t1 outer_table where -a = (select a from t1 where b = @arg00 ) and b='two' ; -a b -2 two -prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where b = ? ) and b=''two'' ' ; -execute stmt1 using @arg00; -a b -2 two -set @arg00=3 ; -set @arg01='three' ; -select a,b FROM t1 where (a,b) in (select 3, 'three'); -a b -3 three -select a FROM t1 where (a,b) in (select @arg00,@arg01); -a -3 -prepare stmt1 from ' select a FROM t1 where (a,b) in (select ?, ?) '; -execute stmt1 using @arg00, @arg01; -a -3 -set @arg00=1 ; -set @arg01='two' ; -set @arg02=2 ; -set @arg03='two' ; -select a, @arg00, b FROM t1 outer_table where -b=@arg01 and a = (select @arg02 from t1 where b = @arg03 ) ; -a @arg00 b -2 1 two -prepare stmt1 from ' select a, ?, b FROM t1 outer_table where - b=? and a = (select ? from t1 where b = ? ) ' ; -execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; -a ? b -2 1 two -prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where b = outer_table.b ) order by a '; -execute stmt1 ; -a b -1 one -2 two -3 three -4 four -prepare stmt1 from ' SELECT a as ccc from t1 where a+1= - (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) '; -execute stmt1 ; -ccc -1 -deallocate prepare stmt1 ; -prepare stmt1 from ' SELECT a as ccc from t1 where a+1= - (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) '; -execute stmt1 ; -ccc -1 -deallocate prepare stmt1 ; -prepare stmt1 from ' SELECT a as ccc from t1 where a+1= - (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) '; -execute stmt1 ; -ccc -1 -deallocate prepare stmt1 ; -set @arg00='two' ; -select a, b FROM t1 outer_table where -a = (select a from t1 where b = outer_table.b ) and b=@arg00 ; -a b -2 two -prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where b = outer_table.b) and b=? '; -execute stmt1 using @arg00; -a b -2 two -set @arg00=2 ; -select a, b FROM t1 outer_table where -a = (select a from t1 where a = @arg00 and b = outer_table.b) and b='two' ; -a b -2 two -prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where a = ? and b = outer_table.b) and b=''two'' ' ; -execute stmt1 using @arg00; -a b -2 two -set @arg00=2 ; -select a, b FROM t1 outer_table where -a = (select a from t1 where outer_table.a = @arg00 and a=2) and b='two' ; -a b -2 two -prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where outer_table.a = ? and a=2) and b=''two'' ' ; -execute stmt1 using @arg00; -a b -2 two -set @arg00=1 ; -set @arg01='two' ; -set @arg02=2 ; -set @arg03='two' ; -select a, @arg00, b FROM t1 outer_table where -b=@arg01 and a = (select @arg02 from t1 where outer_table.b = @arg03 -and outer_table.a=a ) ; -a @arg00 b -2 1 two -prepare stmt1 from ' select a, ?, b FROM t1 outer_table where - b=? and a = (select ? from t1 where outer_table.b = ? - and outer_table.a=a ) ' ; -execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; -a ? b -2 1 two -set @arg00=1 ; -set @arg01=0 ; -select a, @arg00 -from ( select a - @arg00 as a from t1 where a=@arg00 ) as t2 -where a=@arg01; -a @arg00 -0 1 -prepare stmt1 from ' select a, ? - from ( select a - ? as a from t1 where a=? ) as t2 - where a=? '; -execute stmt1 using @arg00, @arg00, @arg00, @arg01 ; -a ? -0 1 -drop table if exists t2 ; -create table t2 as select * from t1; -prepare stmt1 from ' select a in (select a from t2) from t1 ' ; -execute stmt1 ; -a in (select a from t2) -1 -1 -1 -1 -drop table if exists t5, t6, t7 ; -create table t5 (a int , b int) ; -create table t6 like t5 ; -create table t7 like t5 ; -insert into t5 values (0, 100), (1, 2), (1, 3), (2, 2), (2, 7), -(2, -1), (3, 10) ; -insert into t6 values (0, 0), (1, 1), (2, 1), (3, 1), (4, 1) ; -insert into t7 values (3, 3), (2, 2), (1, 1) ; -prepare stmt1 from ' select a, (select count(distinct t5.b) as sum from t5, t6 - where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b - group by t5.a order by sum limit 1) from t7 ' ; -execute stmt1 ; -a (select count(distinct t5.b) as sum from t5, t6 - where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b - group by t5.a order by sum limit 1) -3 1 -2 2 -1 2 -execute stmt1 ; -a (select count(distinct t5.b) as sum from t5, t6 - where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b - group by t5.a order by sum limit 1) -3 1 -2 2 -1 2 -execute stmt1 ; -a (select count(distinct t5.b) as sum from t5, t6 - where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b - group by t5.a order by sum limit 1) -3 1 -2 2 -1 2 -drop table t5, t6, t7 ; -drop table if exists t2 ; -create table t2 as select * from t9; -set @stmt= ' SELECT - (SELECT SUM(c1 + c12 + 0.0) FROM t2 - where (t9.c2 - 0e-3) = t2.c2 - GROUP BY t9.c15 LIMIT 1) as scalar_s, - exists (select 1.0e+0 from t2 - where t2.c3 * 9.0000000000 = t9.c4) as exists_s, - c5 * 4 in (select c6 + 0.3e+1 from t2) as in_s, - (c7 - 4, c8 - 4) in (select c9 + 4.0, c10 + 40e-1 from t2) as in_row_s -FROM t9, -(select c25 x, c32 y from t2) tt WHERE x = c25 ' ; -prepare stmt1 from @stmt ; -execute stmt1 ; -execute stmt1 ; -set @stmt= concat('explain ',@stmt); -prepare stmt1 from @stmt ; -execute stmt1 ; -execute stmt1 ; -set @stmt= ' SELECT - (SELECT SUM(c1+c12+?) FROM t2 where (t9.c2-?)=t2.c2 - GROUP BY t9.c15 LIMIT 1) as scalar_s, - exists (select ? from t2 - where t2.c3*?=t9.c4) as exists_s, - c5*? in (select c6+? from t2) as in_s, - (c7-?, c8-?) in (select c9+?, c10+? from t2) as in_row_s -FROM t9, -(select c25 x, c32 y from t2) tt WHERE x =c25 ' ; -set @arg00= 0.0 ; -set @arg01= 0e-3 ; -set @arg02= 1.0e+0 ; -set @arg03= 9.0000000000 ; -set @arg04= 4 ; -set @arg05= 0.3e+1 ; -set @arg06= 4 ; -set @arg07= 4 ; -set @arg08= 4.0 ; -set @arg09= 40e-1 ; -prepare stmt1 from @stmt ; -execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, -@arg07, @arg08, @arg09 ; -execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, -@arg07, @arg08, @arg09 ; -set @stmt= concat('explain ',@stmt); -prepare stmt1 from @stmt ; -execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, -@arg07, @arg08, @arg09 ; -execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, -@arg07, @arg08, @arg09 ; -drop table t2 ; -select 1 < (select a from t1) ; -ERROR 21000: Subquery returns more than 1 row -prepare stmt1 from ' select 1 < (select a from t1) ' ; -execute stmt1 ; -ERROR 21000: Subquery returns more than 1 row -select 1 as my_col ; -my_col -1 -test_sequence ------- union tests ------ -prepare stmt1 from ' select a FROM t1 where a=1 - union distinct - select a FROM t1 where a=1 '; -execute stmt1 ; -a -1 -execute stmt1 ; -a -1 -prepare stmt1 from ' select a FROM t1 where a=1 - union all - select a FROM t1 where a=1 '; -execute stmt1 ; -a -1 -1 -prepare stmt1 from ' SELECT 1, 2 union SELECT 1 ' ; -ERROR 21000: The used SELECT statements have a different number of columns -prepare stmt1 from ' SELECT 1 union SELECT 1, 2 ' ; -ERROR 21000: The used SELECT statements have a different number of columns -prepare stmt1 from ' SELECT * from t1 union SELECT 1 ' ; -ERROR 21000: The used SELECT statements have a different number of columns -prepare stmt1 from ' SELECT 1 union SELECT * from t1 ' ; -ERROR 21000: The used SELECT statements have a different number of columns -set @arg00=1 ; -select @arg00 FROM t1 where a=1 -union distinct -select 1 FROM t1 where a=1; -@arg00 -1 -prepare stmt1 from ' select ? FROM t1 where a=1 - union distinct - select 1 FROM t1 where a=1 ' ; -execute stmt1 using @arg00; -? -1 -set @arg00=1 ; -select 1 FROM t1 where a=1 -union distinct -select @arg00 FROM t1 where a=1; -1 -1 -prepare stmt1 from ' select 1 FROM t1 where a=1 - union distinct - select ? FROM t1 where a=1 ' ; -execute stmt1 using @arg00; -1 -1 -set @arg00='a' ; -select @arg00 FROM t1 where a=1 -union distinct -select @arg00 FROM t1 where a=1; -@arg00 -a -prepare stmt1 from ' select ? FROM t1 where a=1 - union distinct - select ? FROM t1 where a=1 '; -execute stmt1 using @arg00, @arg00; -? -a -prepare stmt1 from ' select ? - union distinct - select ? '; -execute stmt1 using @arg00, @arg00; -? -a -set @arg00='a' ; -set @arg01=1 ; -set @arg02='a' ; -set @arg03=2 ; -select @arg00 FROM t1 where a=@arg01 -union distinct -select @arg02 FROM t1 where a=@arg03; -@arg00 -a -prepare stmt1 from ' select ? FROM t1 where a=? - union distinct - select ? FROM t1 where a=? ' ; -execute stmt1 using @arg00, @arg01, @arg02, @arg03; -? -a -set @arg00=1 ; -prepare stmt1 from ' select sum(a) + 200, ? from t1 -union distinct -select sum(a) + 200, 1 from t1 -group by b ' ; -execute stmt1 using @arg00; -sum(a) + 200 ? -210 1 -204 1 -201 1 -203 1 -202 1 -set @Oporto='Oporto' ; -set @Lisboa='Lisboa' ; -set @0=0 ; -set @1=1 ; -set @2=2 ; -set @3=3 ; -set @4=4 ; -select @Oporto,@Lisboa,@0,@1,@2,@3,@4 ; -@Oporto @Lisboa @0 @1 @2 @3 @4 -Oporto Lisboa 0 1 2 3 4 -select sum(a) + 200 as the_sum, @Oporto as the_town from t1 -group by b -union distinct -select sum(a) + 200, @Lisboa from t1 -group by b ; -the_sum the_town -204 Oporto -201 Oporto -203 Oporto -202 Oporto -204 Lisboa -201 Lisboa -203 Lisboa -202 Lisboa -prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1 - group by b - union distinct - select sum(a) + 200, ? from t1 - group by b ' ; -execute stmt1 using @Oporto, @Lisboa; -the_sum the_town -204 Oporto -201 Oporto -203 Oporto -202 Oporto -204 Lisboa -201 Lisboa -203 Lisboa -202 Lisboa -select sum(a) + 200 as the_sum, @Oporto as the_town from t1 -where a > @1 -group by b -union distinct -select sum(a) + 200, @Lisboa from t1 -where a > @2 -group by b ; -the_sum the_town -204 Oporto -203 Oporto -202 Oporto -204 Lisboa -203 Lisboa -prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1 - where a > ? - group by b - union distinct - select sum(a) + 200, ? from t1 - where a > ? - group by b ' ; -execute stmt1 using @Oporto, @1, @Lisboa, @2; -the_sum the_town -204 Oporto -203 Oporto -202 Oporto -204 Lisboa -203 Lisboa -select sum(a) + 200 as the_sum, @Oporto as the_town from t1 -where a > @1 -group by b -having avg(a) > @2 -union distinct -select sum(a) + 200, @Lisboa from t1 -where a > @2 -group by b -having avg(a) > @3; -the_sum the_town -204 Oporto -203 Oporto -204 Lisboa -prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1 - where a > ? - group by b - having avg(a) > ? - union distinct - select sum(a) + 200, ? from t1 - where a > ? - group by b - having avg(a) > ? '; -execute stmt1 using @Oporto, @1, @2, @Lisboa, @2, @3; -the_sum the_town -204 Oporto -203 Oporto -204 Lisboa -test_sequence ------- explain select tests ------ -prepare stmt1 from ' explain select * from t9 ' ; -execute stmt1; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def id 8 3 1 N 32801 0 8 -def select_type 253 19 6 N 1 31 33 -def table 253 64 2 N 1 31 33 -def type 253 10 3 N 1 31 33 -def possible_keys 253 4096 0 Y 0 31 33 -def key 253 64 0 Y 0 31 33 -def key_len 8 3 0 Y 32800 0 8 -def ref 253 1024 0 Y 0 31 33 -def rows 8 10 1 N 32801 0 8 -def Extra 253 255 0 N 1 31 33 -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t9 ALL NULL NULL NULL NULL 2 -test_sequence ------- delete tests ------ -delete from t1 ; -insert into t1 values (1,'one'); -insert into t1 values (2,'two'); -insert into t1 values (3,'three'); -insert into t1 values (4,'four'); -commit ; -delete from t9 ; -insert into t9 -set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, -c10= 1, c11= 1, c12 = 1, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=true, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t9 -set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, -c10= 9, c11= 9, c12 = 9, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=false, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; -commit ; -prepare stmt1 from 'delete from t1 where a=2' ; -execute stmt1; -select a,b from t1 where a=2; -a b -execute stmt1; -insert into t1 values(0,NULL); -set @arg00=NULL; -prepare stmt1 from 'delete from t1 where b=?' ; -execute stmt1 using @arg00; -select a,b from t1 where b is NULL ; -a b -0 NULL -set @arg00='one'; -execute stmt1 using @arg00; -select a,b from t1 where b=@arg00; -a b -prepare stmt1 from 'truncate table t1' ; -ERROR HY000: This command is not supported in the prepared statement protocol yet -test_sequence ------- update tests ------ -delete from t1 ; -insert into t1 values (1,'one'); -insert into t1 values (2,'two'); -insert into t1 values (3,'three'); -insert into t1 values (4,'four'); -commit ; -delete from t9 ; -insert into t9 -set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, -c10= 1, c11= 1, c12 = 1, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=true, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t9 -set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, -c10= 9, c11= 9, c12 = 9, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=false, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; -commit ; -prepare stmt1 from 'update t1 set b=''a=two'' where a=2' ; -execute stmt1; -select a,b from t1 where a=2; -a b -2 a=two -execute stmt1; -select a,b from t1 where a=2; -a b -2 a=two -set @arg00=NULL; -prepare stmt1 from 'update t1 set b=? where a=2' ; -execute stmt1 using @arg00; -select a,b from t1 where a=2; -a b -2 NULL -set @arg00='two'; -execute stmt1 using @arg00; -select a,b from t1 where a=2; -a b -2 two -set @arg00=2; -prepare stmt1 from 'update t1 set b=NULL where a=?' ; -execute stmt1 using @arg00; -select a,b from t1 where a=@arg00; -a b -2 NULL -update t1 set b='two' where a=@arg00; -set @arg00=2000; -execute stmt1 using @arg00; -select a,b from t1 where a=@arg00; -a b -set @arg00=2; -set @arg01=22; -prepare stmt1 from 'update t1 set a=? where a=?' ; -execute stmt1 using @arg00, @arg00; -select a,b from t1 where a=@arg00; -a b -2 two -execute stmt1 using @arg01, @arg00; -select a,b from t1 where a=@arg01; -a b -22 two -execute stmt1 using @arg00, @arg01; -select a,b from t1 where a=@arg00; -a b -2 two -set @arg00=NULL; -set @arg01=2; -execute stmt1 using @arg00, @arg01; -Warnings: -Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 1 -select a,b from t1 order by a; -a b -0 two -1 one -3 three -4 four -set @arg00=0; -execute stmt1 using @arg01, @arg00; -select a,b from t1 order by a; -a b -1 one -2 two -3 three -4 four -set @arg00=23; -set @arg01='two'; -set @arg02=2; -set @arg03='two'; -set @arg04=2; -drop table if exists t2; -create table t2 as select a,b from t1 ; -prepare stmt1 from 'update t1 set a=? where b=? - and a in (select ? from t2 - where b = ? or a = ?)'; -execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04 ; -affected rows: 1 -info: Rows matched: 1 Changed: 1 Warnings: 0 -select a,b from t1 where a = @arg00 ; -a b -23 two -prepare stmt1 from 'update t1 set a=? where b=? - and a not in (select ? from t2 - where b = ? or a = ?)'; -execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ; -affected rows: 1 -info: Rows matched: 1 Changed: 1 Warnings: 0 -select a,b from t1 order by a ; -a b -1 one -2 two -3 three -4 four -drop table t2 ; -create table t2 -( -a int, b varchar(30), -primary key(a) -) engine = 'HEAP' ; -insert into t2(a,b) select a, b from t1 ; -prepare stmt1 from 'update t1 set a=? where b=? - and a in (select ? from t2 - where b = ? or a = ?)'; -execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04 ; -affected rows: 1 -info: Rows matched: 1 Changed: 1 Warnings: 0 -select a,b from t1 where a = @arg00 ; -a b -23 two -prepare stmt1 from 'update t1 set a=? where b=? - and a not in (select ? from t2 - where b = ? or a = ?)'; -execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ; -affected rows: 1 -info: Rows matched: 1 Changed: 1 Warnings: 0 -select a,b from t1 order by a ; -a b -1 one -2 two -3 three -4 four -drop table t2 ; -set @arg00=1; -prepare stmt1 from 'update t1 set b=''bla'' -where a=2 -limit 1'; -execute stmt1 ; -select a,b from t1 where b = 'bla' ; -a b -2 bla -prepare stmt1 from 'update t1 set b=''bla'' -where a=2 -limit ?'; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?' at line 3 -test_sequence ------- insert tests ------ -delete from t1 ; -insert into t1 values (1,'one'); -insert into t1 values (2,'two'); -insert into t1 values (3,'three'); -insert into t1 values (4,'four'); -commit ; -delete from t9 ; -insert into t9 -set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, -c10= 1, c11= 1, c12 = 1, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=true, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t9 -set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, -c10= 9, c11= 9, c12 = 9, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=false, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; -commit ; -prepare stmt1 from 'insert into t1 values(5, ''five'' )'; -execute stmt1; -select a,b from t1 where a = 5; -a b -5 five -set @arg00='six' ; -prepare stmt1 from 'insert into t1 values(6, ? )'; -execute stmt1 using @arg00; -select a,b from t1 where b = @arg00; -a b -6 six -execute stmt1 using @arg00; -ERROR 23000: Duplicate entry '6' for key 1 -set @arg00=NULL ; -prepare stmt1 from 'insert into t1 values(0, ? )'; -execute stmt1 using @arg00; -select a,b from t1 where b is NULL; -a b -0 NULL -set @arg00=8 ; -set @arg01='eight' ; -prepare stmt1 from 'insert into t1 values(?, ? )'; -execute stmt1 using @arg00, @arg01 ; -select a,b from t1 where b = @arg01; -a b -8 eight -set @NULL= null ; -set @arg00= 'abc' ; -execute stmt1 using @NULL, @NULL ; -ERROR 23000: Column 'a' cannot be null -execute stmt1 using @NULL, @NULL ; -ERROR 23000: Column 'a' cannot be null -execute stmt1 using @NULL, @arg00 ; -ERROR 23000: Column 'a' cannot be null -execute stmt1 using @NULL, @arg00 ; -ERROR 23000: Column 'a' cannot be null -set @arg01= 10000 + 2 ; -execute stmt1 using @arg01, @arg00 ; -set @arg01= 10000 + 1 ; -execute stmt1 using @arg01, @arg00 ; -select * from t1 where a > 10000 order by a ; -a b -10001 abc -10002 abc -delete from t1 where a > 10000 ; -set @arg01= 10000 + 2 ; -execute stmt1 using @arg01, @NULL ; -set @arg01= 10000 + 1 ; -execute stmt1 using @arg01, @NULL ; -select * from t1 where a > 10000 order by a ; -a b -10001 NULL -10002 NULL -delete from t1 where a > 10000 ; -set @arg01= 10000 + 10 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 9 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 8 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 7 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 6 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 5 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 4 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 3 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 2 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 1 ; -execute stmt1 using @arg01, @arg01 ; -select * from t1 where a > 10000 order by a ; -a b -10001 10001 -10002 10002 -10003 10003 -10004 10004 -10005 10005 -10006 10006 -10007 10007 -10008 10008 -10009 10009 -10010 10010 -delete from t1 where a > 10000 ; -set @arg00=81 ; -set @arg01='8-1' ; -set @arg02=82 ; -set @arg03='8-2' ; -prepare stmt1 from 'insert into t1 values(?,?),(?,?)'; -execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; -select a,b from t1 where a in (@arg00,@arg02) ; -a b -81 8-1 -82 8-2 -set @arg00=9 ; -set @arg01='nine' ; -prepare stmt1 from 'insert into t1 set a=?, b=? '; -execute stmt1 using @arg00, @arg01 ; -select a,b from t1 where a = @arg00 ; -a b -9 nine -set @arg00=6 ; -set @arg01=1 ; -prepare stmt1 from 'insert into t1 set a=?, b=''sechs'' - on duplicate key update a=a + ?, b=concat(b,''modified'') '; -execute stmt1 using @arg00, @arg01; -select * from t1 order by a; -a b -0 NULL -1 one -2 two -3 three -4 four -5 five -7 sixmodified -8 eight -9 nine -81 8-1 -82 8-2 -set @arg00=81 ; -set @arg01=1 ; -execute stmt1 using @arg00, @arg01; -ERROR 23000: Duplicate entry '82' for key 1 -drop table if exists t2 ; -create table t2 (id int auto_increment primary key) -ENGINE= 'HEAP' ; -prepare stmt1 from ' select last_insert_id() ' ; -insert into t2 values (NULL) ; -execute stmt1 ; -last_insert_id() -1 -insert into t2 values (NULL) ; -execute stmt1 ; -last_insert_id() -2 -drop table t2 ; -set @1000=1000 ; -set @x1000_2="x1000_2" ; -set @x1000_3="x1000_3" ; -set @x1000="x1000" ; -set @1100=1100 ; -set @x1100="x1100" ; -set @100=100 ; -set @updated="updated" ; -insert into t1 values(1000,'x1000_1') ; -insert into t1 values(@1000,@x1000_2),(@1000,@x1000_3) -on duplicate key update a = a + @100, b = concat(b,@updated) ; -select a,b from t1 where a >= 1000 order by a ; -a b -1000 x1000_3 -1100 x1000_1updated -delete from t1 where a >= 1000 ; -insert into t1 values(1000,'x1000_1') ; -prepare stmt1 from ' insert into t1 values(?,?),(?,?) - on duplicate key update a = a + ?, b = concat(b,?) '; -execute stmt1 using @1000, @x1000_2, @1000, @x1000_3, @100, @updated ; -select a,b from t1 where a >= 1000 order by a ; -a b -1000 x1000_3 -1100 x1000_1updated -delete from t1 where a >= 1000 ; -insert into t1 values(1000,'x1000_1') ; -execute stmt1 using @1000, @x1000_2, @1100, @x1000_3, @100, @updated ; -select a,b from t1 where a >= 1000 order by a ; -a b -1200 x1000_1updatedupdated -delete from t1 where a >= 1000 ; -prepare stmt1 from ' replace into t1 (a,b) select 100, ''hundred'' '; -execute stmt1; -execute stmt1; -execute stmt1; -test_sequence ------- multi table tests ------ -delete from t1 ; -delete from t9 ; -insert into t1(a,b) values (1, 'one'), (2, 'two'), (3, 'three') ; -insert into t9 (c1,c21) -values (1, 'one'), (2, 'two'), (3, 'three') ; -prepare stmt_delete from " delete t1, t9 - from t1, t9 where t1.a=t9.c1 and t1.b='updated' "; -prepare stmt_update from " update t1, t9 - set t1.b='updated', t9.c21='updated' - where t1.a=t9.c1 and t1.a=? "; -prepare stmt_select1 from " select a, b from t1 order by a" ; -prepare stmt_select2 from " select c1, c21 from t9 order by c1" ; -set @arg00= 1 ; -execute stmt_update using @arg00 ; -execute stmt_delete ; -execute stmt_select1 ; -a b -2 two -3 three -execute stmt_select2 ; -c1 c21 -2 two -3 three -set @arg00= @arg00 + 1 ; -execute stmt_update using @arg00 ; -execute stmt_delete ; -execute stmt_select1 ; -a b -3 three -execute stmt_select2 ; -c1 c21 -3 three -set @arg00= @arg00 + 1 ; -execute stmt_update using @arg00 ; -execute stmt_delete ; -execute stmt_select1 ; -a b -execute stmt_select2 ; -c1 c21 -set @arg00= @arg00 + 1 ; -delete from t1 ; -insert into t1 values (1,'one'); -insert into t1 values (2,'two'); -insert into t1 values (3,'three'); -insert into t1 values (4,'four'); -commit ; -delete from t9 ; -insert into t9 -set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, -c10= 1, c11= 1, c12 = 1, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=true, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t9 -set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, -c10= 9, c11= 9, c12 = 9, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=false, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; -commit ; -insert into t1 values(0,NULL) ; -set @duplicate='duplicate ' ; -set @1000=1000 ; -set @5=5 ; -select a,b from t1 where a < 5 order by a ; -a b -0 NULL -1 one -2 two -3 three -4 four -insert into t1 select a + @1000, concat(@duplicate,b) from t1 -where a < @5 ; -affected rows: 5 -info: Records: 5 Duplicates: 0 Warnings: 0 -select a,b from t1 where a >= 1000 order by a ; -a b -1000 NULL -1001 duplicate one -1002 duplicate two -1003 duplicate three -1004 duplicate four -delete from t1 where a >= 1000 ; -prepare stmt1 from ' insert into t1 select a + ?, concat(?,b) from t1 -where a < ? ' ; -execute stmt1 using @1000, @duplicate, @5; -affected rows: 5 -info: Records: 5 Duplicates: 0 Warnings: 0 -select a,b from t1 where a >= 1000 order by a ; -a b -1000 NULL -1001 duplicate one -1002 duplicate two -1003 duplicate three -1004 duplicate four -delete from t1 where a >= 1000 ; -set @float=1.00; -set @five='five' ; -drop table if exists t2; -create table t2 like t1 ; -insert into t2 (b,a) -select @duplicate, sum(first.a) from t1 first, t1 second -where first.a <> @5 and second.b = first.b -and second.b <> @five -group by second.b -having sum(second.a) > @2 -union -select b, a + @100 from t1 -where (a,b) in ( select sqrt(a+@1)+CAST(@float AS signed),b -from t1); -affected rows: 3 -info: Records: 3 Duplicates: 0 Warnings: 0 -select a,b from t2 order by a ; -a b -3 duplicate -4 duplicate -103 three -delete from t2 ; -prepare stmt1 from ' insert into t2 (b,a) -select ?, sum(first.a) - from t1 first, t1 second - where first.a <> ? and second.b = first.b and second.b <> ? - group by second.b - having sum(second.a) > ? -union -select b, a + ? from t1 - where (a,b) in ( select sqrt(a+?)+CAST(? AS signed),b - from t1 ) ' ; -execute stmt1 using @duplicate, @5, @five, @2, @100, @1, @float ; -affected rows: 3 -info: Records: 3 Duplicates: 0 Warnings: 0 -select a,b from t2 order by a ; -a b -3 duplicate -4 duplicate -103 three -drop table t2; -drop table if exists t5 ; -set @arg01= 8; -set @arg02= 8.0; -set @arg03= 80.00000000000e-1; -set @arg04= 'abc' ; -set @arg05= CAST('abc' as binary) ; -set @arg06= '1991-08-05' ; -set @arg07= CAST('1991-08-05' as date); -set @arg08= '1991-08-05 01:01:01' ; -set @arg09= CAST('1991-08-05 01:01:01' as datetime) ; -set @arg10= unix_timestamp('1991-01-01 01:01:01'); -set @arg11= YEAR('1991-01-01 01:01:01'); -set @arg12= 8 ; -set @arg12= NULL ; -set @arg13= 8.0 ; -set @arg13= NULL ; -set @arg14= 'abc'; -set @arg14= NULL ; -set @arg15= CAST('abc' as binary) ; -set @arg15= NULL ; -create table t5 as select -8 as const01, @arg01 as param01, -8.0 as const02, @arg02 as param02, -80.00000000000e-1 as const03, @arg03 as param03, -'abc' as const04, @arg04 as param04, -CAST('abc' as binary) as const05, @arg05 as param05, -'1991-08-05' as const06, @arg06 as param06, -CAST('1991-08-05' as date) as const07, @arg07 as param07, -'1991-08-05 01:01:01' as const08, @arg08 as param08, -CAST('1991-08-05 01:01:01' as datetime) as const09, @arg09 as param09, -unix_timestamp('1991-01-01 01:01:01') as const10, @arg10 as param10, -YEAR('1991-01-01 01:01:01') as const11, @arg11 as param11, -NULL as const12, @arg12 as param12, -@arg13 as param13, -@arg14 as param14, -@arg15 as param15; -show create table t5 ; -Table Create Table -t5 CREATE TABLE `t5` ( - `const01` bigint(1) NOT NULL default '0', - `param01` bigint(20) default NULL, - `const02` double(3,1) NOT NULL default '0.0', - `param02` double default NULL, - `const03` double NOT NULL default '0', - `param03` double default NULL, - `const04` char(3) NOT NULL default '', - `param04` longtext, - `const05` binary(3) NOT NULL default '', - `param05` longblob, - `const06` varchar(10) NOT NULL default '', - `param06` longtext, - `const07` date default NULL, - `param07` longblob, - `const08` varchar(19) NOT NULL default '', - `param08` longtext, - `const09` datetime default NULL, - `param09` longblob, - `const10` int(10) NOT NULL default '0', - `param10` bigint(20) default NULL, - `const11` int(4) default NULL, - `param11` bigint(20) default NULL, - `const12` binary(0) default NULL, - `param12` bigint(20) default NULL, - `param13` double default NULL, - `param14` longtext, - `param15` longblob -) ENGINE=MyISAM DEFAULT CHARSET=latin1 -select * from t5 ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def test t5 t5 const01 const01 8 1 1 N 32769 0 63 -def test t5 t5 param01 param01 8 20 1 Y 32768 0 63 -def test t5 t5 const02 const02 5 3 3 N 32769 1 63 -def test t5 t5 param02 param02 5 20 1 Y 32768 31 63 -def test t5 t5 const03 const03 5 23 1 N 32769 31 63 -def test t5 t5 param03 param03 5 20 1 Y 32768 31 63 -def test t5 t5 const04 const04 254 3 3 N 1 0 8 -def test t5 t5 param04 param04 252 16777215 3 Y 16 0 8 -def test t5 t5 const05 const05 254 3 3 N 129 0 63 -def test t5 t5 param05 param05 252 16777215 3 Y 144 0 63 -def test t5 t5 const06 const06 253 10 10 N 1 0 8 -def test t5 t5 param06 param06 252 16777215 10 Y 16 0 8 -def test t5 t5 const07 const07 10 10 10 Y 128 0 63 -def test t5 t5 param07 param07 252 16777215 10 Y 144 0 63 -def test t5 t5 const08 const08 253 19 19 N 1 0 8 -def test t5 t5 param08 param08 252 16777215 19 Y 16 0 8 -def test t5 t5 const09 const09 12 19 19 Y 128 0 63 -def test t5 t5 param09 param09 252 16777215 19 Y 144 0 63 -def test t5 t5 const10 const10 3 10 9 N 32769 0 63 -def test t5 t5 param10 param10 8 20 9 Y 32768 0 63 -def test t5 t5 const11 const11 3 4 4 Y 32768 0 63 -def test t5 t5 param11 param11 8 20 4 Y 32768 0 63 -def test t5 t5 const12 const12 254 0 0 Y 128 0 63 -def test t5 t5 param12 param12 8 20 0 Y 32768 0 63 -def test t5 t5 param13 param13 5 20 0 Y 32768 31 63 -def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8 -def test t5 t5 param15 param15 252 16777215 0 Y 144 0 63 -const01 8 -param01 8 -const02 8.0 -param02 8 -const03 8 -param03 8 -const04 abc -param04 abc -const05 abc -param05 abc -const06 1991-08-05 -param06 1991-08-05 -const07 1991-08-05 -param07 1991-08-05 -const08 1991-08-05 01:01:01 -param08 1991-08-05 01:01:01 -const09 1991-08-05 01:01:01 -param09 1991-08-05 01:01:01 -const10 662680861 -param10 662680861 -const11 1991 -param11 1991 -const12 NULL -param12 NULL -param13 NULL -param14 NULL -param15 NULL -drop table t5 ; -test_sequence ------- data type conversion tests ------ -delete from t1 ; -insert into t1 values (1,'one'); -insert into t1 values (2,'two'); -insert into t1 values (3,'three'); -insert into t1 values (4,'four'); -commit ; -delete from t9 ; -insert into t9 -set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, -c10= 1, c11= 1, c12 = 1, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=true, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t9 -set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, -c10= 9, c11= 9, c12 = 9, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=false, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; -commit ; -insert into t9 set c1= 0, c15= '1991-01-01 01:01:01' ; -select * from t9 order by c1 ; -c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32 -0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday -test_sequence ------- select @parameter:= column ------ -prepare full_info from "select @arg01, @arg02, @arg03, @arg04, - @arg05, @arg06, @arg07, @arg08, - @arg09, @arg10, @arg11, @arg12, - @arg13, @arg14, @arg15, @arg16, - @arg17, @arg18, @arg19, @arg20, - @arg21, @arg22, @arg23, @arg24, - @arg25, @arg26, @arg27, @arg28, - @arg29, @arg30, @arg31, @arg32" ; -select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, -@arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8, -@arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12, -@arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16, -@arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20, -@arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24, -@arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28, -@arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32 -from t9 where c1= 1 ; -@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 -1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 1 Y 128 31 63 -def @arg03 254 20 1 Y 128 31 63 -def @arg04 254 20 1 Y 128 31 63 -def @arg05 254 20 1 Y 128 31 63 -def @arg06 254 20 1 Y 128 31 63 -def @arg07 254 20 1 Y 128 31 63 -def @arg08 254 20 1 Y 128 31 63 -def @arg09 254 20 1 Y 128 31 63 -def @arg10 254 20 1 Y 128 31 63 -def @arg11 254 20 1 Y 128 31 63 -def @arg12 254 20 1 Y 128 31 63 -def @arg13 254 8192 10 Y 128 31 63 -def @arg14 254 8192 19 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 8 Y 128 31 63 -def @arg17 254 20 4 Y 128 31 63 -def @arg18 254 20 1 Y 128 31 63 -def @arg19 254 20 1 Y 128 31 63 -def @arg20 254 8192 1 Y 0 31 8 -def @arg21 254 8192 10 Y 0 31 8 -def @arg22 254 8192 30 Y 0 31 8 -def @arg23 254 8192 8 Y 0 31 8 -def @arg24 254 8192 8 Y 0 31 8 -def @arg25 254 8192 4 Y 0 31 8 -def @arg26 254 8192 4 Y 0 31 8 -def @arg27 254 8192 10 Y 0 31 8 -def @arg28 254 8192 10 Y 0 31 8 -def @arg29 254 8192 8 Y 0 31 8 -def @arg30 254 8192 8 Y 0 31 8 -def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, -@arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8, -@arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12, -@arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16, -@arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20, -@arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24, -@arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28, -@arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32 -from t9 where c1= 0 ; -@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 -0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 0 Y 128 31 63 -def @arg03 254 20 0 Y 128 31 63 -def @arg04 254 20 0 Y 128 31 63 -def @arg05 254 20 0 Y 128 31 63 -def @arg06 254 20 0 Y 128 31 63 -def @arg07 254 20 0 Y 128 31 63 -def @arg08 254 20 0 Y 128 31 63 -def @arg09 254 20 0 Y 128 31 63 -def @arg10 254 20 0 Y 128 31 63 -def @arg11 254 20 0 Y 128 31 63 -def @arg12 254 20 0 Y 128 31 63 -def @arg13 254 8192 0 Y 128 31 63 -def @arg14 254 8192 0 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 0 Y 128 31 63 -def @arg17 254 20 0 Y 128 31 63 -def @arg18 254 20 0 Y 128 31 63 -def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 0 31 8 -def @arg21 254 8192 0 Y 0 31 8 -def @arg22 254 8192 0 Y 0 31 8 -def @arg23 254 8192 0 Y 0 31 8 -def @arg24 254 8192 0 Y 0 31 8 -def @arg25 254 8192 0 Y 0 31 8 -def @arg26 254 8192 0 Y 0 31 8 -def @arg27 254 8192 0 Y 0 31 8 -def @arg28 254 8192 0 Y 0 31 8 -def @arg29 254 8192 0 Y 0 31 8 -def @arg30 254 8192 0 Y 0 31 8 -def @arg31 254 8192 0 Y 0 31 8 -def @arg32 254 8192 0 Y 0 31 8 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -prepare stmt1 from "select - @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, - @arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8, - @arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12, - @arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16, - @arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20, - @arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24, - @arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28, - @arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32 -from t9 where c1= ?" ; -set @my_key= 1 ; -execute stmt1 using @my_key ; -@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 -1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 1 Y 128 31 63 -def @arg03 254 20 1 Y 128 31 63 -def @arg04 254 20 1 Y 128 31 63 -def @arg05 254 20 1 Y 128 31 63 -def @arg06 254 20 1 Y 128 31 63 -def @arg07 254 20 1 Y 128 31 63 -def @arg08 254 20 1 Y 128 31 63 -def @arg09 254 20 1 Y 128 31 63 -def @arg10 254 20 1 Y 128 31 63 -def @arg11 254 20 1 Y 128 31 63 -def @arg12 254 20 1 Y 128 31 63 -def @arg13 254 8192 10 Y 128 31 63 -def @arg14 254 8192 19 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 8 Y 128 31 63 -def @arg17 254 20 4 Y 128 31 63 -def @arg18 254 20 1 Y 128 31 63 -def @arg19 254 20 1 Y 128 31 63 -def @arg20 254 8192 1 Y 0 31 8 -def @arg21 254 8192 10 Y 0 31 8 -def @arg22 254 8192 30 Y 0 31 8 -def @arg23 254 8192 8 Y 0 31 8 -def @arg24 254 8192 8 Y 0 31 8 -def @arg25 254 8192 4 Y 0 31 8 -def @arg26 254 8192 4 Y 0 31 8 -def @arg27 254 8192 10 Y 0 31 8 -def @arg28 254 8192 10 Y 0 31 8 -def @arg29 254 8192 8 Y 0 31 8 -def @arg30 254 8192 8 Y 0 31 8 -def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -set @my_key= 0 ; -execute stmt1 using @my_key ; -@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 -0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 0 Y 128 31 63 -def @arg03 254 20 0 Y 128 31 63 -def @arg04 254 20 0 Y 128 31 63 -def @arg05 254 20 0 Y 128 31 63 -def @arg06 254 20 0 Y 128 31 63 -def @arg07 254 20 0 Y 128 31 63 -def @arg08 254 20 0 Y 128 31 63 -def @arg09 254 20 0 Y 128 31 63 -def @arg10 254 20 0 Y 128 31 63 -def @arg11 254 20 0 Y 128 31 63 -def @arg12 254 20 0 Y 128 31 63 -def @arg13 254 8192 0 Y 128 31 63 -def @arg14 254 8192 0 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 0 Y 128 31 63 -def @arg17 254 20 0 Y 128 31 63 -def @arg18 254 20 0 Y 128 31 63 -def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 0 31 8 -def @arg21 254 8192 0 Y 0 31 8 -def @arg22 254 8192 0 Y 0 31 8 -def @arg23 254 8192 0 Y 0 31 8 -def @arg24 254 8192 0 Y 0 31 8 -def @arg25 254 8192 0 Y 0 31 8 -def @arg26 254 8192 0 Y 0 31 8 -def @arg27 254 8192 0 Y 0 31 8 -def @arg28 254 8192 0 Y 0 31 8 -def @arg29 254 8192 0 Y 0 31 8 -def @arg30 254 8192 0 Y 0 31 8 -def @arg31 254 8192 0 Y 0 31 8 -def @arg32 254 8192 0 Y 0 31 8 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -prepare stmt1 from "select ? := c1 from t9 where c1= 1" ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':= c1 from t9 where c1= 1' at line 1 -test_sequence ------- select column, .. into @parm,.. ------ -select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, -c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, -c25, c26, c27, c28, c29, c30, c31, c32 -into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, -@arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, -@arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24, -@arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 -from t9 where c1= 1 ; -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 1 Y 128 31 63 -def @arg03 254 20 1 Y 128 31 63 -def @arg04 254 20 1 Y 128 31 63 -def @arg05 254 20 1 Y 128 31 63 -def @arg06 254 20 1 Y 128 31 63 -def @arg07 254 20 1 Y 128 31 63 -def @arg08 254 20 1 Y 128 31 63 -def @arg09 254 20 1 Y 128 31 63 -def @arg10 254 20 1 Y 128 31 63 -def @arg11 254 20 1 Y 128 31 63 -def @arg12 254 20 1 Y 128 31 63 -def @arg13 254 8192 10 Y 128 31 63 -def @arg14 254 8192 19 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 8 Y 128 31 63 -def @arg17 254 20 4 Y 128 31 63 -def @arg18 254 20 1 Y 128 31 63 -def @arg19 254 20 1 Y 128 31 63 -def @arg20 254 8192 1 Y 0 31 8 -def @arg21 254 8192 10 Y 0 31 8 -def @arg22 254 8192 30 Y 0 31 8 -def @arg23 254 8192 8 Y 0 31 8 -def @arg24 254 8192 8 Y 0 31 8 -def @arg25 254 8192 4 Y 0 31 8 -def @arg26 254 8192 4 Y 0 31 8 -def @arg27 254 8192 10 Y 0 31 8 -def @arg28 254 8192 10 Y 0 31 8 -def @arg29 254 8192 8 Y 0 31 8 -def @arg30 254 8192 8 Y 0 31 8 -def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, -c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, -c25, c26, c27, c28, c29, c30, c31, c32 -into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, -@arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, -@arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24, -@arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 -from t9 where c1= 0 ; -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 0 Y 128 31 63 -def @arg03 254 20 0 Y 128 31 63 -def @arg04 254 20 0 Y 128 31 63 -def @arg05 254 20 0 Y 128 31 63 -def @arg06 254 20 0 Y 128 31 63 -def @arg07 254 20 0 Y 128 31 63 -def @arg08 254 20 0 Y 128 31 63 -def @arg09 254 20 0 Y 128 31 63 -def @arg10 254 20 0 Y 128 31 63 -def @arg11 254 20 0 Y 128 31 63 -def @arg12 254 20 0 Y 128 31 63 -def @arg13 254 8192 0 Y 128 31 63 -def @arg14 254 8192 0 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 0 Y 128 31 63 -def @arg17 254 20 0 Y 128 31 63 -def @arg18 254 20 0 Y 128 31 63 -def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 0 31 8 -def @arg21 254 8192 0 Y 0 31 8 -def @arg22 254 8192 0 Y 0 31 8 -def @arg23 254 8192 0 Y 0 31 8 -def @arg24 254 8192 0 Y 0 31 8 -def @arg25 254 8192 0 Y 0 31 8 -def @arg26 254 8192 0 Y 0 31 8 -def @arg27 254 8192 0 Y 0 31 8 -def @arg28 254 8192 0 Y 0 31 8 -def @arg29 254 8192 0 Y 0 31 8 -def @arg30 254 8192 0 Y 0 31 8 -def @arg31 254 8192 0 Y 0 31 8 -def @arg32 254 8192 0 Y 0 31 8 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -prepare stmt1 from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, - c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, - c25, c26, c27, c28, c29, c30, c31, c32 -into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, - @arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, - @arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24, - @arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 -from t9 where c1= ?" ; -set @my_key= 1 ; -execute stmt1 using @my_key ; -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 1 Y 128 31 63 -def @arg03 254 20 1 Y 128 31 63 -def @arg04 254 20 1 Y 128 31 63 -def @arg05 254 20 1 Y 128 31 63 -def @arg06 254 20 1 Y 128 31 63 -def @arg07 254 20 1 Y 128 31 63 -def @arg08 254 20 1 Y 128 31 63 -def @arg09 254 20 1 Y 128 31 63 -def @arg10 254 20 1 Y 128 31 63 -def @arg11 254 20 1 Y 128 31 63 -def @arg12 254 20 1 Y 128 31 63 -def @arg13 254 8192 10 Y 128 31 63 -def @arg14 254 8192 19 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 8 Y 128 31 63 -def @arg17 254 20 4 Y 128 31 63 -def @arg18 254 20 1 Y 128 31 63 -def @arg19 254 20 1 Y 128 31 63 -def @arg20 254 8192 1 Y 0 31 8 -def @arg21 254 8192 10 Y 0 31 8 -def @arg22 254 8192 30 Y 0 31 8 -def @arg23 254 8192 8 Y 0 31 8 -def @arg24 254 8192 8 Y 0 31 8 -def @arg25 254 8192 4 Y 0 31 8 -def @arg26 254 8192 4 Y 0 31 8 -def @arg27 254 8192 10 Y 0 31 8 -def @arg28 254 8192 10 Y 0 31 8 -def @arg29 254 8192 8 Y 0 31 8 -def @arg30 254 8192 8 Y 0 31 8 -def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -set @my_key= 0 ; -execute stmt1 using @my_key ; -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 0 Y 128 31 63 -def @arg03 254 20 0 Y 128 31 63 -def @arg04 254 20 0 Y 128 31 63 -def @arg05 254 20 0 Y 128 31 63 -def @arg06 254 20 0 Y 128 31 63 -def @arg07 254 20 0 Y 128 31 63 -def @arg08 254 20 0 Y 128 31 63 -def @arg09 254 20 0 Y 128 31 63 -def @arg10 254 20 0 Y 128 31 63 -def @arg11 254 20 0 Y 128 31 63 -def @arg12 254 20 0 Y 128 31 63 -def @arg13 254 8192 0 Y 128 31 63 -def @arg14 254 8192 0 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 0 Y 128 31 63 -def @arg17 254 20 0 Y 128 31 63 -def @arg18 254 20 0 Y 128 31 63 -def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 0 31 8 -def @arg21 254 8192 0 Y 0 31 8 -def @arg22 254 8192 0 Y 0 31 8 -def @arg23 254 8192 0 Y 0 31 8 -def @arg24 254 8192 0 Y 0 31 8 -def @arg25 254 8192 0 Y 0 31 8 -def @arg26 254 8192 0 Y 0 31 8 -def @arg27 254 8192 0 Y 0 31 8 -def @arg28 254 8192 0 Y 0 31 8 -def @arg29 254 8192 0 Y 0 31 8 -def @arg30 254 8192 0 Y 0 31 8 -def @arg31 254 8192 0 Y 0 31 8 -def @arg32 254 8192 0 Y 0 31 8 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -prepare stmt1 from "select c1 into ? from t9 where c1= 1" ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? from t9 where c1= 1' at line 1 -test_sequence --- insert into numeric columns -- -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20 ) ; -set @arg00= 21 ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ) ; -prepare stmt1 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22 )" ; -execute stmt1 ; -set @arg00= 23; -prepare stmt2 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, -30.0, 30.0, 30.0 ) ; -set @arg00= 31.0 ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ) ; -prepare stmt1 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, - 32.0, 32.0, 32.0 )" ; -execute stmt1 ; -set @arg00= 33.0; -prepare stmt2 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( '40', '40', '40', '40', '40', '40', '40', '40', -'40', '40', '40' ) ; -set @arg00= '41' ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ) ; -prepare stmt1 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( '42', '42', '42', '42', '42', '42', '42', '42', - '42', '42', '42' )" ; -execute stmt1 ; -set @arg00= '43'; -prepare stmt2 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( CAST('50' as binary), CAST('50' as binary), -CAST('50' as binary), CAST('50' as binary), CAST('50' as binary), -CAST('50' as binary), CAST('50' as binary), CAST('50' as binary), -CAST('50' as binary), CAST('50' as binary), CAST('50' as binary) ) ; -set @arg00= CAST('51' as binary) ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ) ; -prepare stmt1 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( CAST('52' as binary), CAST('52' as binary), - CAST('52' as binary), CAST('52' as binary), CAST('52' as binary), - CAST('52' as binary), CAST('52' as binary), CAST('52' as binary), - CAST('52' as binary), CAST('52' as binary), CAST('52' as binary) )" ; -execute stmt1 ; -set @arg00= CAST('53' as binary) ; -prepare stmt2 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -set @arg00= 2 ; -set @arg00= NULL ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( 60, NULL, NULL, NULL, NULL, NULL, NULL, NULL, -NULL, NULL, NULL ) ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( 61, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ) ; -prepare stmt1 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( 62, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL )" ; -execute stmt1 ; -prepare stmt2 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( 63, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -set @arg00= 8.0 ; -set @arg00= NULL ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( 71, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ) ; -prepare stmt2 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( 73, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -set @arg00= 'abc' ; -set @arg00= NULL ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( 81, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ) ; -prepare stmt2 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( 83, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 -from t9 where c1 >= 20 -order by c1 ; -c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c12 -20 20 20 20 20 20 20 20 20 20 20.0000 -21 21 21 21 21 21 21 21 21 21 21.0000 -22 22 22 22 22 22 22 22 22 22 22.0000 -23 23 23 23 23 23 23 23 23 23 23.0000 -30 30 30 30 30 30 30 30 30 30 30.0000 -31 31 31 31 31 31 31 31 31 31 31.0000 -32 32 32 32 32 32 32 32 32 32 32.0000 -33 33 33 33 33 33 33 33 33 33 33.0000 -40 40 40 40 40 40 40 40 40 40 40.0000 -41 41 41 41 41 41 41 41 41 41 41.0000 -42 42 42 42 42 42 42 42 42 42 42.0000 -43 43 43 43 43 43 43 43 43 43 43.0000 -50 50 50 50 50 50 50 50 50 50 50.0000 -51 51 51 51 51 51 51 51 51 51 51.0000 -52 52 52 52 52 52 52 52 52 52 52.0000 -53 53 53 53 53 53 53 53 53 53 53.0000 -60 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -61 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -62 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -63 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -71 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -73 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -81 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -83 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -test_sequence --- select .. where numeric column = .. -- -set @arg00= 20; -select 'true' as found from t9 -where c1= 20 and c2= 20 and c3= 20 and c4= 20 and c5= 20 and c6= 20 and c7= 20 -and c8= 20 and c9= 20 and c10= 20 and c12= 20; -found -true -select 'true' as found from t9 -where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 -and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 -and c12= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c2= 20 and c3= 20 and c4= 20 and c5= 20 and c6= 20 and c7= 20 - and c8= 20 and c9= 20 and c10= 20 and c12= 20 "; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? - and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? - and c12= ? "; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -found -true -set @arg00= 20.0; -select 'true' as found from t9 -where c1= 20.0 and c2= 20.0 and c3= 20.0 and c4= 20.0 and c5= 20.0 and c6= 20.0 -and c7= 20.0 and c8= 20.0 and c9= 20.0 and c10= 20.0 and c12= 20.0; -found -true -select 'true' as found from t9 -where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 -and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 -and c12= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20.0 and c2= 20.0 and c3= 20.0 and c4= 20.0 and c5= 20.0 and c6= 20.0 - and c7= 20.0 and c8= 20.0 and c9= 20.0 and c10= 20.0 and c12= 20.0 "; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? - and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? - and c12= ? "; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -found -true -select 'true' as found from t9 -where c1= '20' and c2= '20' and c3= '20' and c4= '20' and c5= '20' and c6= '20' - and c7= '20' and c8= '20' and c9= '20' and c10= '20' and c12= '20'; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= '20' and c2= '20' and c3= '20' and c4= '20' and c5= '20' and c6= '20' - and c7= '20' and c8= '20' and c9= '20' and c10= '20' and c12= '20' "; -execute stmt1 ; -found -true -set @arg00= '20'; -select 'true' as found from t9 -where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 -and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 -and c12= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? - and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? - and c12= ? "; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -found -true -select 'true' as found from t9 -where c1= CAST('20' as binary) and c2= CAST('20' as binary) and -c3= CAST('20' as binary) and c4= CAST('20' as binary) and -c5= CAST('20' as binary) and c6= CAST('20' as binary) and -c7= CAST('20' as binary) and c8= CAST('20' as binary) and -c9= CAST('20' as binary) and c10= CAST('20' as binary) and -c12= CAST('20' as binary); -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= CAST('20' as binary) and c2= CAST('20' as binary) and - c3= CAST('20' as binary) and c4= CAST('20' as binary) and - c5= CAST('20' as binary) and c6= CAST('20' as binary) and - c7= CAST('20' as binary) and c8= CAST('20' as binary) and - c9= CAST('20' as binary) and c10= CAST('20' as binary) and - c12= CAST('20' as binary) "; -execute stmt1 ; -found -true -set @arg00= CAST('20' as binary) ; -select 'true' as found from t9 -where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 -and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 -and c12= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? - and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? - and c12= ? "; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -found -true -delete from t9 ; -test_sequence --- some numeric overflow experiments -- -prepare my_insert from "insert into t9 - ( c21, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( 'O', ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -prepare my_select from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 -from t9 where c21 = 'O' "; -prepare my_delete from "delete from t9 where c21 = 'O' "; -set @arg00= 9223372036854775807 ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1264 Data truncated; out of range for column 'c1' at row 1 -Warning 1264 Data truncated; out of range for column 'c2' at row 1 -Warning 1264 Data truncated; out of range for column 'c3' at row 1 -Warning 1264 Data truncated; out of range for column 'c4' at row 1 -Warning 1264 Data truncated; out of range for column 'c5' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 127 -c2 32767 -c3 8388607 -c4 2147483647 -c5 2147483647 -c6 9223372036854775807 -c7 9.22337e+18 -c8 9.22337203685478e+18 -c9 9.22337203685478e+18 -c10 9.22337203685478e+18 -c12 99999.9999 -execute my_delete ; -set @arg00= '9223372036854775807' ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1264 Data truncated; out of range for column 'c1' at row 1 -Warning 1264 Data truncated; out of range for column 'c2' at row 1 -Warning 1264 Data truncated; out of range for column 'c3' at row 1 -Warning 1265 Data truncated for column 'c4' at row 1 -Warning 1265 Data truncated for column 'c5' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 127 -c2 32767 -c3 8388607 -c4 2147483647 -c5 2147483647 -c6 9223372036854775807 -c7 9.22337e+18 -c8 9.22337203685478e+18 -c9 9.22337203685478e+18 -c10 9.22337203685478e+18 -c12 99999.9999 -execute my_delete ; -set @arg00= -9223372036854775808 ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1264 Data truncated; out of range for column 'c1' at row 1 -Warning 1264 Data truncated; out of range for column 'c2' at row 1 -Warning 1264 Data truncated; out of range for column 'c3' at row 1 -Warning 1264 Data truncated; out of range for column 'c4' at row 1 -Warning 1264 Data truncated; out of range for column 'c5' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 -128 -c2 -32768 -c3 -8388608 -c4 -2147483648 -c5 -2147483648 -c6 -9223372036854775808 -c7 -9.22337e+18 -c8 -9.22337203685478e+18 -c9 -9.22337203685478e+18 -c10 -9.22337203685478e+18 -c12 -9999.9999 -execute my_delete ; -set @arg00= '-9223372036854775808' ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1264 Data truncated; out of range for column 'c1' at row 1 -Warning 1264 Data truncated; out of range for column 'c2' at row 1 -Warning 1264 Data truncated; out of range for column 'c3' at row 1 -Warning 1265 Data truncated for column 'c4' at row 1 -Warning 1265 Data truncated for column 'c5' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 -128 -c2 -32768 -c3 -8388608 -c4 -2147483648 -c5 -2147483648 -c6 -9223372036854775808 -c7 -9.22337e+18 -c8 -9.22337203685478e+18 -c9 -9.22337203685478e+18 -c10 -9.22337203685478e+18 -c12 -9999.9999 -execute my_delete ; -set @arg00= 1.11111111111111111111e+50 ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1264 Data truncated; out of range for column 'c1' at row 1 -Warning 1264 Data truncated; out of range for column 'c2' at row 1 -Warning 1264 Data truncated; out of range for column 'c3' at row 1 -Warning 1264 Data truncated; out of range for column 'c4' at row 1 -Warning 1264 Data truncated; out of range for column 'c5' at row 1 -Warning 1264 Data truncated; out of range for column 'c6' at row 1 -Warning 1264 Data truncated; out of range for column 'c7' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 127 -c2 32767 -c3 8388607 -c4 2147483647 -c5 2147483647 -c6 9223372036854775807 -c7 3.40282e+38 -c8 1.11111111111111e+50 -c9 1.11111111111111e+50 -c10 1.11111111111111e+50 -c12 99999.9999 -execute my_delete ; -set @arg00= '1.11111111111111111111e+50' ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1265 Data truncated for column 'c1' at row 1 -Warning 1265 Data truncated for column 'c2' at row 1 -Warning 1265 Data truncated for column 'c3' at row 1 -Warning 1265 Data truncated for column 'c4' at row 1 -Warning 1265 Data truncated for column 'c5' at row 1 -Warning 1265 Data truncated for column 'c6' at row 1 -Warning 1264 Data truncated; out of range for column 'c7' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 1 -c2 1 -c3 1 -c4 1 -c5 1 -c6 1 -c7 3.40282e+38 -c8 1.11111111111111e+50 -c9 1.11111111111111e+50 -c10 1.11111111111111e+50 -c12 99999.9999 -execute my_delete ; -set @arg00= -1.11111111111111111111e+50 ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1264 Data truncated; out of range for column 'c1' at row 1 -Warning 1264 Data truncated; out of range for column 'c2' at row 1 -Warning 1264 Data truncated; out of range for column 'c3' at row 1 -Warning 1264 Data truncated; out of range for column 'c4' at row 1 -Warning 1264 Data truncated; out of range for column 'c5' at row 1 -Warning 1264 Data truncated; out of range for column 'c6' at row 1 -Warning 1264 Data truncated; out of range for column 'c7' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 -128 -c2 -32768 -c3 -8388608 -c4 -2147483648 -c5 -2147483648 -c6 -9223372036854775808 -c7 -3.40282e+38 -c8 -1.11111111111111e+50 -c9 -1.11111111111111e+50 -c10 -1.11111111111111e+50 -c12 -9999.9999 -execute my_delete ; -set @arg00= '-1.11111111111111111111e+50' ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1265 Data truncated for column 'c1' at row 1 -Warning 1265 Data truncated for column 'c2' at row 1 -Warning 1265 Data truncated for column 'c3' at row 1 -Warning 1265 Data truncated for column 'c4' at row 1 -Warning 1265 Data truncated for column 'c5' at row 1 -Warning 1265 Data truncated for column 'c6' at row 1 -Warning 1264 Data truncated; out of range for column 'c7' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 -1 -c2 -1 -c3 -1 -c4 -1 -c5 -1 -c6 -1 -c7 -3.40282e+38 -c8 -1.11111111111111e+50 -c9 -1.11111111111111e+50 -c10 -1.11111111111111e+50 -c12 -9999.9999 -execute my_delete ; -test_sequence --- insert into string columns -- -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -select c1, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30 -from t9 where c1 >= 20 -order by c1 ; -c1 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 -20 2 20 20 20 20 20 20 20 20 20 20 -21 2 21 21 21 21 21 21 21 21 21 21 -22 2 22 22 22 22 22 22 22 22 22 22 -23 2 23 23 23 23 23 23 23 23 23 23 -30 3 30 30 30 30 30 30 30 30 30 30 -31 3 31 31 31 31 31 31 31 31 31 31 -32 3 32 32 32 32 32 32 32 32 32 32 -33 3 33 33 33 33 33 33 33 33 33 33 -40 4 40 40 40 40 40 40 40 40 40 40 -41 4 41 41 41 41 41 41 41 41 41 41 -42 4 42 42 42 42 42 42 42 42 42 42 -43 4 43 43 43 43 43 43 43 43 43 43 -50 5 50 50 50 50 50 50 50 50 50 50 -51 5 51 51 51 51 51 51 51 51 51 51 -52 5 52 52 52 52 52 52 52 52 52 52 -53 5 53 53 53 53 53 53 53 53 53 53 -54 5 54 54 54 54 54 54 54 54 54 54 -55 5 55 55 55 55 55 55 55 55 55 55 -56 6 56 56 56 56 56 56 56 56 56 56 -57 6 57 57 57 57 57 57 57 57 57 57 -60 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -61 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -62 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -63 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -71 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -73 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -81 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -83 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -test_sequence --- select .. where string column = .. -- -set @arg00= '20'; -select 'true' as found from t9 -where c1= 20 and concat(c20,substr('20',1+length(c20)))= '20' and c21= '20' and -c22= '20' and c23= '20' and c24= '20' and c25= '20' and c26= '20' and -c27= '20' and c28= '20' and c29= '20' and c30= '20' ; -found -true -select 'true' as found from t9 -where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and -c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and -c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr('20',1+length(c20)))= '20' and c21= '20' and - c22= '20' and c23= '20' and c24= '20' and c25= '20' and c26= '20' and - c27= '20' and c28= '20' and c29= '20' and c30= '20'" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and - c21= ? and c22= ? and c23= ? and c25= ? and - c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -found -true -set @arg00= CAST('20' as binary); -select 'true' as found from t9 -where c1= 20 and concat(c20,substr(CAST('20' as binary),1+length(c20))) -= CAST('20' as binary) and c21= CAST('20' as binary) -and c22= CAST('20' as binary) and c23= CAST('20' as binary) and -c24= CAST('20' as binary) and c25= CAST('20' as binary) and -c26= CAST('20' as binary) and c27= CAST('20' as binary) and -c28= CAST('20' as binary) and c29= CAST('20' as binary) and -c30= CAST('20' as binary) ; -found -true -select 'true' as found from t9 -where c1= 20 and concat(c20,substr(@arg00,1+length(c20))) = @arg00 and -c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and -c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and -c30= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr(CAST('20' as binary),1+length(c20))) - = CAST('20' as binary) and c21= CAST('20' as binary) - and c22= CAST('20' as binary) and c23= CAST('20' as binary) and - c24= CAST('20' as binary) and c25= CAST('20' as binary) and - c26= CAST('20' as binary) and c27= CAST('20' as binary) and - c28= CAST('20' as binary) and c29= CAST('20' as binary) and - c30= CAST('20' as binary)" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr(?,1+length(c20))) = ? and c21= ? and - c22= ? and c23= ? and c25= ? and c26= ? and c27= ? and c28= ? and - c29= ? and c30= ?"; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -found -true -set @arg00= 20; -select 'true' as found from t9 -where c1= 20 and concat(c20,substr(20,1+length(c20)))= 20 and c21= 20 and -c22= 20 and c23= 20 and c24= 20 and c25= 20 and c26= 20 and -c27= 20 and c28= 20 and c29= 20 and c30= 20 ; -found -true -select 'true' as found from t9 -where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and -c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and -c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr(20,1+length(c20)))= 20 and c21= 20 and - c22= 20 and c23= 20 and c24= 20 and c25= 20 and c26= 20 and - c27= 20 and c28= 20 and c29= 20 and c30= 20" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and - c21= ? and c22= ? and c23= ? and c25= ? and - c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -found -true -set @arg00= 20.0; -select 'true' as found from t9 -where c1= 20 and concat(c20,substr(20.0,1+length(c20)))= 20.0 and c21= 20.0 and -c22= 20.0 and c23= 20.0 and c24= 20.0 and c25= 20.0 and c26= 20.0 and -c27= 20.0 and c28= 20.0 and c29= 20.0 and c30= 20.0 ; -found -true -select 'true' as found from t9 -where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and -c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and -c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr(20.0,1+length(c20)))= 20.0 and c21= 20.0 and - c22= 20.0 and c23= 20.0 and c24= 20.0 and c25= 20.0 and c26= 20.0 and - c27= 20.0 and c28= 20.0 and c29= 20.0 and c30= 20.0" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and - c21= ? and c22= ? and c23= ? and c25= ? and - c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -found -true -delete from t9 ; -test_sequence --- insert into date/time columns -- -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1264 Data truncated; out of range for column 'c13' at row 1 -Warning 1265 Data truncated for column 'c14' at row 1 -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -Warnings: -Warning 1264 Data truncated; out of range for column 'c13' at row 1 -Warning 1265 Data truncated for column 'c14' at row 1 -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -Warnings: -Warning 1264 Data truncated; out of range for column 'c13' at row 1 -Warning 1265 Data truncated for column 'c14' at row 1 -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -Warnings: -Warning 1264 Data truncated; out of range for column 'c13' at row 1 -Warning 1265 Data truncated for column 'c14' at row 1 -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -select c1, c13, c14, c15, c16, c17 from t9 order by c1 ; -c1 c13 c14 c15 c16 c17 -20 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -21 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -22 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -23 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -30 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -31 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -32 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -33 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -40 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -41 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -42 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -43 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -50 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -51 0010-00-00 0010-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -52 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -53 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -60 NULL NULL 1991-01-01 01:01:01 NULL NULL -61 NULL NULL 1991-01-01 01:01:01 NULL NULL -62 NULL NULL 1991-01-01 01:01:01 NULL NULL -63 NULL NULL 1991-01-01 01:01:01 NULL NULL -71 NULL NULL 1991-01-01 01:01:01 NULL NULL -73 NULL NULL 1991-01-01 01:01:01 NULL NULL -81 NULL NULL 1991-01-01 01:01:01 NULL NULL -83 NULL NULL 1991-01-01 01:01:01 NULL NULL -test_sequence --- select .. where date/time column = .. -- -set @arg00= '1991-01-01 01:01:01' ; -select 'true' as found from t9 -where c1= 20 and c13= '1991-01-01 01:01:01' and c14= '1991-01-01 01:01:01' and -c15= '1991-01-01 01:01:01' and c16= '1991-01-01 01:01:01' and -c17= '1991-01-01 01:01:01' ; -found -true -select 'true' as found from t9 -where c1= 20 and c13= @arg00 and c14= @arg00 and c15= @arg00 and c16= @arg00 -and c17= @arg00 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c13= '1991-01-01 01:01:01' and c14= '1991-01-01 01:01:01' and - c15= '1991-01-01 01:01:01' and c16= '1991-01-01 01:01:01' and - c17= '1991-01-01 01:01:01'" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c13= ? and c14= ? and c15= ? and c16= ? and c17= ?" ; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00 ; -found -true -set @arg00= CAST('1991-01-01 01:01:01' as datetime) ; -select 'true' as found from t9 -where c1= 20 and c13= CAST('1991-01-01 01:01:01' as datetime) and -c14= CAST('1991-01-01 01:01:01' as datetime) and -c15= CAST('1991-01-01 01:01:01' as datetime) and -c16= CAST('1991-01-01 01:01:01' as datetime) and -c17= CAST('1991-01-01 01:01:01' as datetime) ; -found -true -select 'true' as found from t9 -where c1= 20 and c13= @arg00 and c14= @arg00 and c15= @arg00 and c16= @arg00 -and c17= @arg00 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c13= CAST('1991-01-01 01:01:01' as datetime) and - c14= CAST('1991-01-01 01:01:01' as datetime) and - c15= CAST('1991-01-01 01:01:01' as datetime) and - c16= CAST('1991-01-01 01:01:01' as datetime) and - c17= CAST('1991-01-01 01:01:01' as datetime)" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c13= ? and c14= ? and c15= ? and c16= ? and c17= ?" ; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00 ; -found -true -set @arg00= 1991 ; -select 'true' as found from t9 -where c1= 20 and c17= 1991 ; -found -true -select 'true' as found from t9 -where c1= 20 and c17= @arg00 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c17= 1991" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c17= ?" ; -execute stmt1 using @arg00 ; -found -true -set @arg00= 1.991e+3 ; -select 'true' as found from t9 -where c1= 20 and abs(c17 - 1.991e+3) < 0.01 ; -found -true -select 'true' as found from t9 -where c1= 20 and abs(c17 - @arg00) < 0.01 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and abs(c17 - 1.991e+3) < 0.01" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and abs(c17 - ?) < 0.01" ; -execute stmt1 using @arg00 ; -found -true -drop table t1, t9; diff --git a/mysql-test/r/ps_5merge.result.es b/mysql-test/r/ps_5merge.result.es deleted file mode 100644 index 4f05be1b4d9..00000000000 --- a/mysql-test/r/ps_5merge.result.es +++ /dev/null @@ -1,6064 +0,0 @@ -use test; -drop table if exists t1, t1_1, t1_2, -t9, t9_1, t9_2; -drop table if exists t1, t9 ; -create table t1 -( -a int, b varchar(30), -primary key(a) -) engine = 'MYISAM' ; -create table t9 -( -c1 tinyint, c2 smallint, c3 mediumint, c4 int, -c5 integer, c6 bigint, c7 float, c8 double, -c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4), -c13 date, c14 datetime, c15 timestamp(14), c16 time, -c17 year, c18 bit, c19 bool, c20 char, -c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext, -c25 blob, c26 text, c27 mediumblob, c28 mediumtext, -c29 longblob, c30 longtext, c31 enum('one', 'two', 'three'), -c32 set('monday', 'tuesday', 'wednesday'), -primary key(c1) -) engine = 'MYISAM' ; -rename table t1 to t1_1, t9 to t9_1 ; -drop table if exists t1, t9 ; -create table t1 -( -a int, b varchar(30), -primary key(a) -) engine = 'MYISAM' ; -create table t9 -( -c1 tinyint, c2 smallint, c3 mediumint, c4 int, -c5 integer, c6 bigint, c7 float, c8 double, -c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4), -c13 date, c14 datetime, c15 timestamp(14), c16 time, -c17 year, c18 bit, c19 bool, c20 char, -c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext, -c25 blob, c26 text, c27 mediumblob, c28 mediumtext, -c29 longblob, c30 longtext, c31 enum('one', 'two', 'three'), -c32 set('monday', 'tuesday', 'wednesday'), -primary key(c1) -) engine = 'MYISAM' ; -rename table t1 to t1_2, t9 to t9_2 ; -create table t1 -( -a int, b varchar(30), -primary key(a) -) ENGINE = MERGE UNION=(t1_1,t1_2) -INSERT_METHOD=FIRST; -create table t9 -( -c1 tinyint, c2 smallint, c3 mediumint, c4 int, -c5 integer, c6 bigint, c7 float, c8 double, -c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4), -c13 date, c14 datetime, c15 timestamp(14), c16 time, -c17 year, c18 bit, c19 bool, c20 char, -c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext, -c25 blob, c26 text, c27 mediumblob, c28 mediumtext, -c29 longblob, c30 longtext, c31 enum('one', 'two', 'three'), -c32 set('monday', 'tuesday', 'wednesday'), -primary key(c1) -) ENGINE = MERGE UNION=(t9_1,t9_2) -INSERT_METHOD=FIRST; -delete from t1 ; -insert into t1 values (1,'one'); -insert into t1 values (2,'two'); -insert into t1 values (3,'three'); -insert into t1 values (4,'four'); -commit ; -delete from t9 ; -insert into t9 -set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, -c10= 1, c11= 1, c12 = 1, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=true, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t9 -set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, -c10= 9, c11= 9, c12 = 9, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=false, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; -commit ; -test_sequence ------- simple select tests ------ -prepare stmt1 from ' select * from t9 order by c1 ' ; -execute stmt1; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def test t9 t9 c1 c1 1 4 1 N 49155 0 63 -def test t9 t9 c2 c2 2 6 1 Y 32768 0 63 -def test t9 t9 c3 c3 9 9 1 Y 32768 0 63 -def test t9 t9 c4 c4 3 11 1 Y 32768 0 63 -def test t9 t9 c5 c5 3 11 1 Y 32768 0 63 -def test t9 t9 c6 c6 8 20 1 Y 32768 0 63 -def test t9 t9 c7 c7 4 12 1 Y 32768 31 63 -def test t9 t9 c8 c8 5 22 1 Y 32768 31 63 -def test t9 t9 c9 c9 5 22 1 Y 32768 31 63 -def test t9 t9 c10 c10 5 22 1 Y 32768 31 63 -def test t9 t9 c11 c11 0 9 6 Y 32768 4 63 -def test t9 t9 c12 c12 0 10 6 Y 32768 4 63 -def test t9 t9 c13 c13 10 10 10 Y 128 0 63 -def test t9 t9 c14 c14 12 19 19 Y 128 0 63 -def test t9 t9 c15 c15 7 19 19 N 1249 0 63 -def test t9 t9 c16 c16 11 8 8 Y 128 0 63 -def test t9 t9 c17 c17 13 4 4 Y 32864 0 63 -def test t9 t9 c18 c18 1 1 1 Y 32768 0 63 -def test t9 t9 c19 c19 1 1 1 Y 32768 0 63 -def test t9 t9 c20 c20 254 1 1 Y 0 0 8 -def test t9 t9 c21 c21 253 10 10 Y 0 0 8 -def test t9 t9 c22 c22 253 30 30 Y 0 0 8 -def test t9 t9 c23 c23 252 255 8 Y 144 0 63 -def test t9 t9 c24 c24 252 255 8 Y 16 0 8 -def test t9 t9 c25 c25 252 65535 4 Y 144 0 63 -def test t9 t9 c26 c26 252 65535 4 Y 16 0 8 -def test t9 t9 c27 c27 252 16777215 10 Y 144 0 63 -def test t9 t9 c28 c28 252 16777215 10 Y 16 0 8 -def test t9 t9 c29 c29 252 16777215 8 Y 144 0 63 -def test t9 t9 c30 c30 252 16777215 8 Y 16 0 8 -def test t9 t9 c31 c31 254 5 3 Y 256 0 8 -def test t9 t9 c32 c32 254 24 7 Y 2048 0 8 -c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32 -1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday -set @arg00='SELECT' ; -prepare stmt1 from ' ? a from t1 where a=1 '; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? a from t1 where a=1' at line 1 -set @arg00=1 ; -select @arg00, b from t1 where a=1 ; -@arg00 b -1 one -prepare stmt1 from ' select ?, b from t1 where a=1 ' ; -execute stmt1 using @arg00 ; -? b -1 one -set @arg00='lion' ; -select @arg00, b from t1 where a=1 ; -@arg00 b -lion one -prepare stmt1 from ' select ?, b from t1 where a=1 ' ; -execute stmt1 using @arg00 ; -? b -lion one -set @arg00=NULL ; -select @arg00, b from t1 where a=1 ; -@arg00 b -NULL one -prepare stmt1 from ' select ?, b from t1 where a=1 ' ; -execute stmt1 using @arg00 ; -? b -NULL one -set @arg00=1 ; -select b, a - @arg00 from t1 where a=1 ; -b a - @arg00 -one 0 -prepare stmt1 from ' select b, a - ? from t1 where a=1 ' ; -execute stmt1 using @arg00 ; -b a - ? -one 0 -set @arg00=null ; -select @arg00 as my_col ; -my_col -NULL -prepare stmt1 from ' select ? as my_col'; -execute stmt1 using @arg00 ; -my_col -NULL -select @arg00 + 1 as my_col ; -my_col -NULL -prepare stmt1 from ' select ? + 1 as my_col'; -execute stmt1 using @arg00 ; -my_col -NULL -select 1 + @arg00 as my_col ; -my_col -NULL -prepare stmt1 from ' select 1 + ? as my_col'; -execute stmt1 using @arg00 ; -my_col -NULL -set @arg00='MySQL' ; -select substr(@arg00,1,2) from t1 where a=1 ; -substr(@arg00,1,2) -My -prepare stmt1 from ' select substr(?,1,2) from t1 where a=1 ' ; -execute stmt1 using @arg00 ; -substr(?,1,2) -My -set @arg00=3 ; -select substr('MySQL',@arg00,5) from t1 where a=1 ; -substr('MySQL',@arg00,5) -SQL -prepare stmt1 from ' select substr(''MySQL'',?,5) from t1 where a=1 ' ; -execute stmt1 using @arg00 ; -substr('MySQL',?,5) -SQL -select substr('MySQL',1,@arg00) from t1 where a=1 ; -substr('MySQL',1,@arg00) -MyS -prepare stmt1 from ' select substr(''MySQL'',1,?) from t1 where a=1 ' ; -execute stmt1 using @arg00 ; -substr('MySQL',1,?) -MyS -set @arg00='MySQL' ; -select a , concat(@arg00,b) from t1 order by a; -a concat(@arg00,b) -1 MySQLone -2 MySQLtwo -3 MySQLthree -4 MySQLfour -prepare stmt1 from ' select a , concat(?,b) from t1 order by a ' ; -execute stmt1 using @arg00; -a concat(?,b) -1 MySQLone -2 MySQLtwo -3 MySQLthree -4 MySQLfour -select a , concat(b,@arg00) from t1 order by a ; -a concat(b,@arg00) -1 oneMySQL -2 twoMySQL -3 threeMySQL -4 fourMySQL -prepare stmt1 from ' select a , concat(b,?) from t1 order by a ' ; -execute stmt1 using @arg00; -a concat(b,?) -1 oneMySQL -2 twoMySQL -3 threeMySQL -4 fourMySQL -set @arg00='MySQL' ; -select group_concat(@arg00,b order by a) from t1 -group by 'a' ; -group_concat(@arg00,b order by a) -MySQLone,MySQLtwo,MySQLthree,MySQLfour -prepare stmt1 from ' select group_concat(?,b order by a) from t1 -group by ''a'' ' ; -execute stmt1 using @arg00; -group_concat(?,b order by a) -MySQLone,MySQLtwo,MySQLthree,MySQLfour -select group_concat(b,@arg00 order by a) from t1 -group by 'a' ; -group_concat(b,@arg00 order by a) -oneMySQL,twoMySQL,threeMySQL,fourMySQL -prepare stmt1 from ' select group_concat(b,? order by a) from t1 -group by ''a'' ' ; -execute stmt1 using @arg00; -group_concat(b,? order by a) -oneMySQL,twoMySQL,threeMySQL,fourMySQL -set @arg00='first' ; -set @arg01='second' ; -set @arg02=NULL; -select @arg00, @arg01 from t1 where a=1 ; -@arg00 @arg01 -first second -prepare stmt1 from ' select ?, ? from t1 where a=1 ' ; -execute stmt1 using @arg00, @arg01 ; -? ? -first second -execute stmt1 using @arg02, @arg01 ; -? ? -NULL second -execute stmt1 using @arg00, @arg02 ; -? ? -first NULL -execute stmt1 using @arg02, @arg02 ; -? ? -NULL NULL -drop table if exists t5 ; -create table t5 (id1 int(11) not null default '0', -value2 varchar(100), value1 varchar(100)) ; -insert into t5 values (1,'hh','hh'),(2,'hh','hh'), -(1,'ii','ii'),(2,'ii','ii') ; -prepare stmt1 from ' select id1,value1 from t5 where id1=? or value1=? order by id1,value1 ' ; -set @arg00=1 ; -set @arg01='hh' ; -execute stmt1 using @arg00, @arg01 ; -id1 value1 -1 hh -1 ii -2 hh -drop table t5 ; -drop table if exists t5 ; -create table t5(session_id char(9) not null) ; -insert into t5 values ('abc') ; -prepare stmt1 from ' select * from t5 -where ?=''1111'' and session_id = ''abc'' ' ; -set @arg00='abc' ; -execute stmt1 using @arg00 ; -session_id -set @arg00='1111' ; -execute stmt1 using @arg00 ; -session_id -abc -set @arg00='abc' ; -execute stmt1 using @arg00 ; -session_id -drop table t5 ; -set @arg00='FROM' ; -select a @arg00 t1 where a=1 ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 t1 where a=1' at line 1 -prepare stmt1 from ' select a ? t1 where a=1 ' ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? t1 where a=1' at line 1 -set @arg00='t1' ; -select a from @arg00 where a=1 ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 where a=1' at line 1 -prepare stmt1 from ' select a from ? where a=1 ' ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? where a=1' at line 1 -set @arg00='WHERE' ; -select a from t1 @arg00 a=1 ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 a=1' at line 1 -prepare stmt1 from ' select a from t1 ? a=1 ' ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? a=1' at line 1 -set @arg00=1 ; -select a FROM t1 where a=@arg00 ; -a -1 -prepare stmt1 from ' select a FROM t1 where a=? ' ; -execute stmt1 using @arg00 ; -a -1 -set @arg00=1000 ; -execute stmt1 using @arg00 ; -a -set @arg00=NULL ; -select a FROM t1 where a=@arg00 ; -a -prepare stmt1 from ' select a FROM t1 where a=? ' ; -execute stmt1 using @arg00 ; -a -set @arg00=4 ; -select a FROM t1 where a=sqrt(@arg00) ; -a -2 -prepare stmt1 from ' select a FROM t1 where a=sqrt(?) ' ; -execute stmt1 using @arg00 ; -a -2 -set @arg00=NULL ; -select a FROM t1 where a=sqrt(@arg00) ; -a -prepare stmt1 from ' select a FROM t1 where a=sqrt(?) ' ; -execute stmt1 using @arg00 ; -a -set @arg00=2 ; -set @arg01=3 ; -select a FROM t1 where a in (@arg00,@arg01) order by a; -a -2 -3 -prepare stmt1 from ' select a FROM t1 where a in (?,?) order by a '; -execute stmt1 using @arg00, @arg01; -a -2 -3 -set @arg00= 'one' ; -set @arg01= 'two' ; -set @arg02= 'five' ; -prepare stmt1 from ' select b FROM t1 where b in (?,?,?) order by b ' ; -execute stmt1 using @arg00, @arg01, @arg02 ; -b -one -two -prepare stmt1 from ' select b FROM t1 where b like ? '; -set @arg00='two' ; -execute stmt1 using @arg00 ; -b -two -set @arg00='tw%' ; -execute stmt1 using @arg00 ; -b -two -set @arg00='%wo' ; -execute stmt1 using @arg00 ; -b -two -set @arg00=null ; -insert into t9 set c1= 0, c5 = NULL ; -select c5 from t9 where c5 > NULL ; -c5 -prepare stmt1 from ' select c5 from t9 where c5 > ? '; -execute stmt1 using @arg00 ; -c5 -select c5 from t9 where c5 < NULL ; -c5 -prepare stmt1 from ' select c5 from t9 where c5 < ? '; -execute stmt1 using @arg00 ; -c5 -select c5 from t9 where c5 = NULL ; -c5 -prepare stmt1 from ' select c5 from t9 where c5 = ? '; -execute stmt1 using @arg00 ; -c5 -select c5 from t9 where c5 <=> NULL ; -c5 -NULL -prepare stmt1 from ' select c5 from t9 where c5 <=> ? '; -execute stmt1 using @arg00 ; -c5 -NULL -delete from t9 where c1= 0 ; -set @arg00='>' ; -select a FROM t1 where a @arg00 1 ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 1' at line 1 -prepare stmt1 from ' select a FROM t1 where a ? 1 ' ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? 1' at line 1 -set @arg00=1 ; -select a,b FROM t1 where a is not NULL -AND b is not NULL group by a - @arg00 ; -a b -1 one -2 two -3 three -4 four -prepare stmt1 from ' select a,b FROM t1 where a is not NULL -AND b is not NULL group by a - ? ' ; -execute stmt1 using @arg00 ; -a b -1 one -2 two -3 three -4 four -set @arg00='two' ; -select a,b FROM t1 where a is not NULL -AND b is not NULL having b <> @arg00 order by a ; -a b -1 one -3 three -4 four -prepare stmt1 from ' select a,b FROM t1 where a is not NULL -AND b is not NULL having b <> ? order by a ' ; -execute stmt1 using @arg00 ; -a b -1 one -3 three -4 four -set @arg00=1 ; -select a,b FROM t1 where a is not NULL -AND b is not NULL order by a - @arg00 ; -a b -1 one -2 two -3 three -4 four -prepare stmt1 from ' select a,b FROM t1 where a is not NULL -AND b is not NULL order by a - ? ' ; -execute stmt1 using @arg00 ; -a b -1 one -2 two -3 three -4 four -set @arg00=2 ; -select a,b from t1 order by 2 ; -a b -4 four -1 one -3 three -2 two -prepare stmt1 from ' select a,b from t1 -order by ? '; -execute stmt1 using @arg00; -a b -4 four -1 one -3 three -2 two -set @arg00=1 ; -execute stmt1 using @arg00; -a b -1 one -2 two -3 three -4 four -set @arg00=0 ; -execute stmt1 using @arg00; -ERROR 42S22: Unknown column '?' in 'order clause' -set @arg00=1; -prepare stmt1 from ' select a,b from t1 order by a -limit 1 '; -execute stmt1 ; -a b -1 one -prepare stmt1 from ' select a,b from t1 -limit ? '; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?' at line 2 -set @arg00='b' ; -set @arg01=0 ; -set @arg02=2 ; -set @arg03=2 ; -select sum(a), @arg00 from t1 where a > @arg01 -and b is not null group by substr(b,@arg02) -having sum(a) <> @arg03 ; -sum(a) @arg00 -3 b -1 b -4 b -prepare stmt1 from ' select sum(a), ? from t1 where a > ? -and b is not null group by substr(b,?) -having sum(a) <> ? '; -execute stmt1 using @arg00, @arg01, @arg02, @arg03; -sum(a) ? -3 b -1 b -4 b -test_sequence ------- join tests ------ -select first.a as a1, second.a as a2 -from t1 first, t1 second -where first.a = second.a order by a1 ; -a1 a2 -1 1 -2 2 -3 3 -4 4 -prepare stmt1 from ' select first.a as a1, second.a as a2 - from t1 first, t1 second - where first.a = second.a order by a1 '; -execute stmt1 ; -a1 a2 -1 1 -2 2 -3 3 -4 4 -set @arg00='ABC'; -set @arg01='two'; -set @arg02='one'; -select first.a, @arg00, second.a FROM t1 first, t1 second -where @arg01 = first.b or first.a = second.a or second.b = @arg02 -order by second.a, first.a; -a @arg00 a -1 ABC 1 -2 ABC 1 -3 ABC 1 -4 ABC 1 -2 ABC 2 -2 ABC 3 -3 ABC 3 -2 ABC 4 -4 ABC 4 -prepare stmt1 from ' select first.a, ?, second.a FROM t1 first, t1 second - where ? = first.b or first.a = second.a or second.b = ? - order by second.a, first.a'; -execute stmt1 using @arg00, @arg01, @arg02; -a ? a -1 ABC 1 -2 ABC 1 -3 ABC 1 -4 ABC 1 -2 ABC 2 -2 ABC 3 -3 ABC 3 -2 ABC 4 -4 ABC 4 -drop table if exists t2 ; -create table t2 as select * from t1 ; -set @query1= 'SELECT * FROM t2 join t1 on (t1.a=t2.a) order by t2.a ' ; -set @query2= 'SELECT * FROM t2 natural join t1 order by t2.a ' ; -set @query3= 'SELECT * FROM t2 join t1 using(a) order by t2.a ' ; -set @query4= 'SELECT * FROM t2 left join t1 on(t1.a=t2.a) order by t2.a ' ; -set @query5= 'SELECT * FROM t2 natural left join t1 order by t2.a ' ; -set @query6= 'SELECT * FROM t2 left join t1 using(a) order by t2.a ' ; -set @query7= 'SELECT * FROM t2 right join t1 on(t1.a=t2.a) order by t2.a ' ; -set @query8= 'SELECT * FROM t2 natural right join t1 order by t2.a ' ; -set @query9= 'SELECT * FROM t2 right join t1 using(a) order by t2.a ' ; -the join statement is: -SELECT * FROM t2 right join t1 using(a) order by t2.a -prepare stmt1 from @query9 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -the join statement is: -SELECT * FROM t2 natural right join t1 order by t2.a -prepare stmt1 from @query8 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -the join statement is: -SELECT * FROM t2 right join t1 on(t1.a=t2.a) order by t2.a -prepare stmt1 from @query7 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -the join statement is: -SELECT * FROM t2 left join t1 using(a) order by t2.a -prepare stmt1 from @query6 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -the join statement is: -SELECT * FROM t2 natural left join t1 order by t2.a -prepare stmt1 from @query5 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -the join statement is: -SELECT * FROM t2 left join t1 on(t1.a=t2.a) order by t2.a -prepare stmt1 from @query4 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -the join statement is: -SELECT * FROM t2 join t1 using(a) order by t2.a -prepare stmt1 from @query3 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -the join statement is: -SELECT * FROM t2 natural join t1 order by t2.a -prepare stmt1 from @query2 ; -execute stmt1 ; -a b -1 one -2 two -3 three -4 four -execute stmt1 ; -a b -1 one -2 two -3 three -4 four -execute stmt1 ; -a b -1 one -2 two -3 three -4 four -the join statement is: -SELECT * FROM t2 join t1 on (t1.a=t2.a) order by t2.a -prepare stmt1 from @query1 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -drop table t2 ; -test_sequence ------- subquery tests ------ -prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where b = ''two'') '; -execute stmt1 ; -a b -2 two -set @arg00='two' ; -select a, b FROM t1 outer_table where -a = (select a from t1 where b = 'two' ) and b=@arg00 ; -a b -2 two -prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where b = ''two'') and b=? '; -execute stmt1 using @arg00; -a b -2 two -set @arg00='two' ; -select a, b FROM t1 outer_table where -a = (select a from t1 where b = @arg00 ) and b='two' ; -a b -2 two -prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where b = ? ) and b=''two'' ' ; -execute stmt1 using @arg00; -a b -2 two -set @arg00=3 ; -set @arg01='three' ; -select a,b FROM t1 where (a,b) in (select 3, 'three'); -a b -3 three -select a FROM t1 where (a,b) in (select @arg00,@arg01); -a -3 -prepare stmt1 from ' select a FROM t1 where (a,b) in (select ?, ?) '; -execute stmt1 using @arg00, @arg01; -a -3 -set @arg00=1 ; -set @arg01='two' ; -set @arg02=2 ; -set @arg03='two' ; -select a, @arg00, b FROM t1 outer_table where -b=@arg01 and a = (select @arg02 from t1 where b = @arg03 ) ; -a @arg00 b -2 1 two -prepare stmt1 from ' select a, ?, b FROM t1 outer_table where - b=? and a = (select ? from t1 where b = ? ) ' ; -execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; -a ? b -2 1 two -prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where b = outer_table.b ) order by a '; -execute stmt1 ; -a b -1 one -2 two -3 three -4 four -prepare stmt1 from ' SELECT a as ccc from t1 where a+1= - (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) '; -execute stmt1 ; -ccc -1 -deallocate prepare stmt1 ; -prepare stmt1 from ' SELECT a as ccc from t1 where a+1= - (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) '; -execute stmt1 ; -ccc -1 -deallocate prepare stmt1 ; -prepare stmt1 from ' SELECT a as ccc from t1 where a+1= - (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) '; -execute stmt1 ; -ccc -1 -deallocate prepare stmt1 ; -set @arg00='two' ; -select a, b FROM t1 outer_table where -a = (select a from t1 where b = outer_table.b ) and b=@arg00 ; -a b -2 two -prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where b = outer_table.b) and b=? '; -execute stmt1 using @arg00; -a b -2 two -set @arg00=2 ; -select a, b FROM t1 outer_table where -a = (select a from t1 where a = @arg00 and b = outer_table.b) and b='two' ; -a b -2 two -prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where a = ? and b = outer_table.b) and b=''two'' ' ; -execute stmt1 using @arg00; -a b -2 two -set @arg00=2 ; -select a, b FROM t1 outer_table where -a = (select a from t1 where outer_table.a = @arg00 and a=2) and b='two' ; -a b -2 two -prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where outer_table.a = ? and a=2) and b=''two'' ' ; -execute stmt1 using @arg00; -a b -2 two -set @arg00=1 ; -set @arg01='two' ; -set @arg02=2 ; -set @arg03='two' ; -select a, @arg00, b FROM t1 outer_table where -b=@arg01 and a = (select @arg02 from t1 where outer_table.b = @arg03 -and outer_table.a=a ) ; -a @arg00 b -2 1 two -prepare stmt1 from ' select a, ?, b FROM t1 outer_table where - b=? and a = (select ? from t1 where outer_table.b = ? - and outer_table.a=a ) ' ; -execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; -a ? b -2 1 two -set @arg00=1 ; -set @arg01=0 ; -select a, @arg00 -from ( select a - @arg00 as a from t1 where a=@arg00 ) as t2 -where a=@arg01; -a @arg00 -0 1 -prepare stmt1 from ' select a, ? - from ( select a - ? as a from t1 where a=? ) as t2 - where a=? '; -execute stmt1 using @arg00, @arg00, @arg00, @arg01 ; -a ? -0 1 -drop table if exists t2 ; -create table t2 as select * from t1; -prepare stmt1 from ' select a in (select a from t2) from t1 ' ; -execute stmt1 ; -a in (select a from t2) -1 -1 -1 -1 -drop table if exists t5, t6, t7 ; -create table t5 (a int , b int) ; -create table t6 like t5 ; -create table t7 like t5 ; -insert into t5 values (0, 100), (1, 2), (1, 3), (2, 2), (2, 7), -(2, -1), (3, 10) ; -insert into t6 values (0, 0), (1, 1), (2, 1), (3, 1), (4, 1) ; -insert into t7 values (3, 3), (2, 2), (1, 1) ; -prepare stmt1 from ' select a, (select count(distinct t5.b) as sum from t5, t6 - where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b - group by t5.a order by sum limit 1) from t7 ' ; -execute stmt1 ; -a (select count(distinct t5.b) as sum from t5, t6 - where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b - group by t5.a order by sum limit 1) -3 1 -2 2 -1 2 -execute stmt1 ; -a (select count(distinct t5.b) as sum from t5, t6 - where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b - group by t5.a order by sum limit 1) -3 1 -2 2 -1 2 -execute stmt1 ; -a (select count(distinct t5.b) as sum from t5, t6 - where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b - group by t5.a order by sum limit 1) -3 1 -2 2 -1 2 -drop table t5, t6, t7 ; -drop table if exists t2 ; -create table t2 as select * from t9; -set @stmt= ' SELECT - (SELECT SUM(c1 + c12 + 0.0) FROM t2 - where (t9.c2 - 0e-3) = t2.c2 - GROUP BY t9.c15 LIMIT 1) as scalar_s, - exists (select 1.0e+0 from t2 - where t2.c3 * 9.0000000000 = t9.c4) as exists_s, - c5 * 4 in (select c6 + 0.3e+1 from t2) as in_s, - (c7 - 4, c8 - 4) in (select c9 + 4.0, c10 + 40e-1 from t2) as in_row_s -FROM t9, -(select c25 x, c32 y from t2) tt WHERE x = c25 ' ; -prepare stmt1 from @stmt ; -execute stmt1 ; -execute stmt1 ; -set @stmt= concat('explain ',@stmt); -prepare stmt1 from @stmt ; -execute stmt1 ; -execute stmt1 ; -set @stmt= ' SELECT - (SELECT SUM(c1+c12+?) FROM t2 where (t9.c2-?)=t2.c2 - GROUP BY t9.c15 LIMIT 1) as scalar_s, - exists (select ? from t2 - where t2.c3*?=t9.c4) as exists_s, - c5*? in (select c6+? from t2) as in_s, - (c7-?, c8-?) in (select c9+?, c10+? from t2) as in_row_s -FROM t9, -(select c25 x, c32 y from t2) tt WHERE x =c25 ' ; -set @arg00= 0.0 ; -set @arg01= 0e-3 ; -set @arg02= 1.0e+0 ; -set @arg03= 9.0000000000 ; -set @arg04= 4 ; -set @arg05= 0.3e+1 ; -set @arg06= 4 ; -set @arg07= 4 ; -set @arg08= 4.0 ; -set @arg09= 40e-1 ; -prepare stmt1 from @stmt ; -execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, -@arg07, @arg08, @arg09 ; -execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, -@arg07, @arg08, @arg09 ; -set @stmt= concat('explain ',@stmt); -prepare stmt1 from @stmt ; -execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, -@arg07, @arg08, @arg09 ; -execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, -@arg07, @arg08, @arg09 ; -drop table t2 ; -select 1 < (select a from t1) ; -ERROR 21000: Subquery returns more than 1 row -prepare stmt1 from ' select 1 < (select a from t1) ' ; -execute stmt1 ; -ERROR 21000: Subquery returns more than 1 row -select 1 as my_col ; -my_col -1 -test_sequence ------- union tests ------ -prepare stmt1 from ' select a FROM t1 where a=1 - union distinct - select a FROM t1 where a=1 '; -execute stmt1 ; -a -1 -execute stmt1 ; -a -1 -prepare stmt1 from ' select a FROM t1 where a=1 - union all - select a FROM t1 where a=1 '; -execute stmt1 ; -a -1 -1 -prepare stmt1 from ' SELECT 1, 2 union SELECT 1 ' ; -ERROR 21000: The used SELECT statements have a different number of columns -prepare stmt1 from ' SELECT 1 union SELECT 1, 2 ' ; -ERROR 21000: The used SELECT statements have a different number of columns -prepare stmt1 from ' SELECT * from t1 union SELECT 1 ' ; -ERROR 21000: The used SELECT statements have a different number of columns -prepare stmt1 from ' SELECT 1 union SELECT * from t1 ' ; -ERROR 21000: The used SELECT statements have a different number of columns -set @arg00=1 ; -select @arg00 FROM t1 where a=1 -union distinct -select 1 FROM t1 where a=1; -@arg00 -1 -prepare stmt1 from ' select ? FROM t1 where a=1 - union distinct - select 1 FROM t1 where a=1 ' ; -execute stmt1 using @arg00; -? -1 -set @arg00=1 ; -select 1 FROM t1 where a=1 -union distinct -select @arg00 FROM t1 where a=1; -1 -1 -prepare stmt1 from ' select 1 FROM t1 where a=1 - union distinct - select ? FROM t1 where a=1 ' ; -execute stmt1 using @arg00; -1 -1 -set @arg00='a' ; -select @arg00 FROM t1 where a=1 -union distinct -select @arg00 FROM t1 where a=1; -@arg00 -a -prepare stmt1 from ' select ? FROM t1 where a=1 - union distinct - select ? FROM t1 where a=1 '; -execute stmt1 using @arg00, @arg00; -? -a -prepare stmt1 from ' select ? - union distinct - select ? '; -execute stmt1 using @arg00, @arg00; -? -a -set @arg00='a' ; -set @arg01=1 ; -set @arg02='a' ; -set @arg03=2 ; -select @arg00 FROM t1 where a=@arg01 -union distinct -select @arg02 FROM t1 where a=@arg03; -@arg00 -a -prepare stmt1 from ' select ? FROM t1 where a=? - union distinct - select ? FROM t1 where a=? ' ; -execute stmt1 using @arg00, @arg01, @arg02, @arg03; -? -a -set @arg00=1 ; -prepare stmt1 from ' select sum(a) + 200, ? from t1 -union distinct -select sum(a) + 200, 1 from t1 -group by b ' ; -execute stmt1 using @arg00; -sum(a) + 200 ? -210 1 -204 1 -201 1 -203 1 -202 1 -set @Oporto='Oporto' ; -set @Lisboa='Lisboa' ; -set @0=0 ; -set @1=1 ; -set @2=2 ; -set @3=3 ; -set @4=4 ; -select @Oporto,@Lisboa,@0,@1,@2,@3,@4 ; -@Oporto @Lisboa @0 @1 @2 @3 @4 -Oporto Lisboa 0 1 2 3 4 -select sum(a) + 200 as the_sum, @Oporto as the_town from t1 -group by b -union distinct -select sum(a) + 200, @Lisboa from t1 -group by b ; -the_sum the_town -204 Oporto -201 Oporto -203 Oporto -202 Oporto -204 Lisboa -201 Lisboa -203 Lisboa -202 Lisboa -prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1 - group by b - union distinct - select sum(a) + 200, ? from t1 - group by b ' ; -execute stmt1 using @Oporto, @Lisboa; -the_sum the_town -204 Oporto -201 Oporto -203 Oporto -202 Oporto -204 Lisboa -201 Lisboa -203 Lisboa -202 Lisboa -select sum(a) + 200 as the_sum, @Oporto as the_town from t1 -where a > @1 -group by b -union distinct -select sum(a) + 200, @Lisboa from t1 -where a > @2 -group by b ; -the_sum the_town -204 Oporto -203 Oporto -202 Oporto -204 Lisboa -203 Lisboa -prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1 - where a > ? - group by b - union distinct - select sum(a) + 200, ? from t1 - where a > ? - group by b ' ; -execute stmt1 using @Oporto, @1, @Lisboa, @2; -the_sum the_town -204 Oporto -203 Oporto -202 Oporto -204 Lisboa -203 Lisboa -select sum(a) + 200 as the_sum, @Oporto as the_town from t1 -where a > @1 -group by b -having avg(a) > @2 -union distinct -select sum(a) + 200, @Lisboa from t1 -where a > @2 -group by b -having avg(a) > @3; -the_sum the_town -204 Oporto -203 Oporto -204 Lisboa -prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1 - where a > ? - group by b - having avg(a) > ? - union distinct - select sum(a) + 200, ? from t1 - where a > ? - group by b - having avg(a) > ? '; -execute stmt1 using @Oporto, @1, @2, @Lisboa, @2, @3; -the_sum the_town -204 Oporto -203 Oporto -204 Lisboa -test_sequence ------- explain select tests ------ -prepare stmt1 from ' explain select * from t9 ' ; -execute stmt1; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def id 8 3 1 N 32801 0 8 -def select_type 253 19 6 N 1 31 33 -def table 253 64 2 N 1 31 33 -def type 253 10 3 N 1 31 33 -def possible_keys 253 4096 0 Y 0 31 33 -def key 253 64 0 Y 0 31 33 -def key_len 8 3 0 Y 32800 0 8 -def ref 253 1024 0 Y 0 31 33 -def rows 8 10 1 N 32801 0 8 -def Extra 253 255 0 N 1 31 33 -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t9 ALL NULL NULL NULL NULL 2 -test_sequence ------- delete tests ------ -delete from t1 ; -insert into t1 values (1,'one'); -insert into t1 values (2,'two'); -insert into t1 values (3,'three'); -insert into t1 values (4,'four'); -commit ; -delete from t9 ; -insert into t9 -set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, -c10= 1, c11= 1, c12 = 1, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=true, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t9 -set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, -c10= 9, c11= 9, c12 = 9, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=false, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; -commit ; -prepare stmt1 from 'delete from t1 where a=2' ; -execute stmt1; -select a,b from t1 where a=2; -a b -execute stmt1; -insert into t1 values(0,NULL); -set @arg00=NULL; -prepare stmt1 from 'delete from t1 where b=?' ; -execute stmt1 using @arg00; -select a,b from t1 where b is NULL ; -a b -0 NULL -set @arg00='one'; -execute stmt1 using @arg00; -select a,b from t1 where b=@arg00; -a b -prepare stmt1 from 'truncate table t1' ; -ERROR HY000: This command is not supported in the prepared statement protocol yet -test_sequence ------- update tests ------ -delete from t1 ; -insert into t1 values (1,'one'); -insert into t1 values (2,'two'); -insert into t1 values (3,'three'); -insert into t1 values (4,'four'); -commit ; -delete from t9 ; -insert into t9 -set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, -c10= 1, c11= 1, c12 = 1, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=true, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t9 -set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, -c10= 9, c11= 9, c12 = 9, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=false, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; -commit ; -prepare stmt1 from 'update t1 set b=''a=two'' where a=2' ; -execute stmt1; -select a,b from t1 where a=2; -a b -2 a=two -execute stmt1; -select a,b from t1 where a=2; -a b -2 a=two -set @arg00=NULL; -prepare stmt1 from 'update t1 set b=? where a=2' ; -execute stmt1 using @arg00; -select a,b from t1 where a=2; -a b -2 NULL -set @arg00='two'; -execute stmt1 using @arg00; -select a,b from t1 where a=2; -a b -2 two -set @arg00=2; -prepare stmt1 from 'update t1 set b=NULL where a=?' ; -execute stmt1 using @arg00; -select a,b from t1 where a=@arg00; -a b -2 NULL -update t1 set b='two' where a=@arg00; -set @arg00=2000; -execute stmt1 using @arg00; -select a,b from t1 where a=@arg00; -a b -set @arg00=2; -set @arg01=22; -prepare stmt1 from 'update t1 set a=? where a=?' ; -execute stmt1 using @arg00, @arg00; -select a,b from t1 where a=@arg00; -a b -2 two -execute stmt1 using @arg01, @arg00; -select a,b from t1 where a=@arg01; -a b -22 two -execute stmt1 using @arg00, @arg01; -select a,b from t1 where a=@arg00; -a b -2 two -set @arg00=NULL; -set @arg01=2; -execute stmt1 using @arg00, @arg01; -Warnings: -Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 1 -select a,b from t1 order by a; -a b -0 two -1 one -3 three -4 four -set @arg00=0; -execute stmt1 using @arg01, @arg00; -select a,b from t1 order by a; -a b -1 one -2 two -3 three -4 four -set @arg00=23; -set @arg01='two'; -set @arg02=2; -set @arg03='two'; -set @arg04=2; -drop table if exists t2; -create table t2 as select a,b from t1 ; -prepare stmt1 from 'update t1 set a=? where b=? - and a in (select ? from t2 - where b = ? or a = ?)'; -execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04 ; -affected rows: 1 -info: Rows matched: 1 Changed: 1 Warnings: 0 -select a,b from t1 where a = @arg00 ; -a b -23 two -prepare stmt1 from 'update t1 set a=? where b=? - and a not in (select ? from t2 - where b = ? or a = ?)'; -execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ; -affected rows: 1 -info: Rows matched: 1 Changed: 1 Warnings: 0 -select a,b from t1 order by a ; -a b -1 one -2 two -3 three -4 four -drop table t2 ; -create table t2 -( -a int, b varchar(30), -primary key(a) -) engine = 'MYISAM' ; -insert into t2(a,b) select a, b from t1 ; -prepare stmt1 from 'update t1 set a=? where b=? - and a in (select ? from t2 - where b = ? or a = ?)'; -execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04 ; -affected rows: 1 -info: Rows matched: 1 Changed: 1 Warnings: 0 -select a,b from t1 where a = @arg00 ; -a b -23 two -prepare stmt1 from 'update t1 set a=? where b=? - and a not in (select ? from t2 - where b = ? or a = ?)'; -execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ; -affected rows: 1 -info: Rows matched: 1 Changed: 1 Warnings: 0 -select a,b from t1 order by a ; -a b -1 one -2 two -3 three -4 four -drop table t2 ; -set @arg00=1; -prepare stmt1 from 'update t1 set b=''bla'' -where a=2 -limit 1'; -execute stmt1 ; -select a,b from t1 where b = 'bla' ; -a b -2 bla -prepare stmt1 from 'update t1 set b=''bla'' -where a=2 -limit ?'; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?' at line 3 -test_sequence ------- insert tests ------ -delete from t1 ; -insert into t1 values (1,'one'); -insert into t1 values (2,'two'); -insert into t1 values (3,'three'); -insert into t1 values (4,'four'); -commit ; -delete from t9 ; -insert into t9 -set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, -c10= 1, c11= 1, c12 = 1, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=true, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t9 -set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, -c10= 9, c11= 9, c12 = 9, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=false, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; -commit ; -prepare stmt1 from 'insert into t1 values(5, ''five'' )'; -execute stmt1; -select a,b from t1 where a = 5; -a b -5 five -set @arg00='six' ; -prepare stmt1 from 'insert into t1 values(6, ? )'; -execute stmt1 using @arg00; -select a,b from t1 where b = @arg00; -a b -6 six -execute stmt1 using @arg00; -ERROR 23000: Duplicate entry '6' for key 1 -set @arg00=NULL ; -prepare stmt1 from 'insert into t1 values(0, ? )'; -execute stmt1 using @arg00; -select a,b from t1 where b is NULL; -a b -0 NULL -set @arg00=8 ; -set @arg01='eight' ; -prepare stmt1 from 'insert into t1 values(?, ? )'; -execute stmt1 using @arg00, @arg01 ; -select a,b from t1 where b = @arg01; -a b -8 eight -set @NULL= null ; -set @arg00= 'abc' ; -execute stmt1 using @NULL, @NULL ; -ERROR 23000: Column 'a' cannot be null -execute stmt1 using @NULL, @NULL ; -ERROR 23000: Column 'a' cannot be null -execute stmt1 using @NULL, @arg00 ; -ERROR 23000: Column 'a' cannot be null -execute stmt1 using @NULL, @arg00 ; -ERROR 23000: Column 'a' cannot be null -set @arg01= 10000 + 2 ; -execute stmt1 using @arg01, @arg00 ; -set @arg01= 10000 + 1 ; -execute stmt1 using @arg01, @arg00 ; -select * from t1 where a > 10000 order by a ; -a b -10001 abc -10002 abc -delete from t1 where a > 10000 ; -set @arg01= 10000 + 2 ; -execute stmt1 using @arg01, @NULL ; -set @arg01= 10000 + 1 ; -execute stmt1 using @arg01, @NULL ; -select * from t1 where a > 10000 order by a ; -a b -10001 NULL -10002 NULL -delete from t1 where a > 10000 ; -set @arg01= 10000 + 10 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 9 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 8 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 7 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 6 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 5 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 4 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 3 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 2 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 1 ; -execute stmt1 using @arg01, @arg01 ; -select * from t1 where a > 10000 order by a ; -a b -10001 10001 -10002 10002 -10003 10003 -10004 10004 -10005 10005 -10006 10006 -10007 10007 -10008 10008 -10009 10009 -10010 10010 -delete from t1 where a > 10000 ; -set @arg00=81 ; -set @arg01='8-1' ; -set @arg02=82 ; -set @arg03='8-2' ; -prepare stmt1 from 'insert into t1 values(?,?),(?,?)'; -execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; -select a,b from t1 where a in (@arg00,@arg02) ; -a b -81 8-1 -82 8-2 -set @arg00=9 ; -set @arg01='nine' ; -prepare stmt1 from 'insert into t1 set a=?, b=? '; -execute stmt1 using @arg00, @arg01 ; -select a,b from t1 where a = @arg00 ; -a b -9 nine -set @arg00=6 ; -set @arg01=1 ; -prepare stmt1 from 'insert into t1 set a=?, b=''sechs'' - on duplicate key update a=a + ?, b=concat(b,''modified'') '; -execute stmt1 using @arg00, @arg01; -select * from t1 order by a; -a b -0 NULL -1 one -2 two -3 three -4 four -5 five -7 sixmodified -8 eight -9 nine -81 8-1 -82 8-2 -set @arg00=81 ; -set @arg01=1 ; -execute stmt1 using @arg00, @arg01; -ERROR 23000: Duplicate entry '82' for key 1 -drop table if exists t2 ; -create table t2 (id int auto_increment primary key) -ENGINE= 'MYISAM' ; -prepare stmt1 from ' select last_insert_id() ' ; -insert into t2 values (NULL) ; -execute stmt1 ; -last_insert_id() -1 -insert into t2 values (NULL) ; -execute stmt1 ; -last_insert_id() -2 -drop table t2 ; -set @1000=1000 ; -set @x1000_2="x1000_2" ; -set @x1000_3="x1000_3" ; -set @x1000="x1000" ; -set @1100=1100 ; -set @x1100="x1100" ; -set @100=100 ; -set @updated="updated" ; -insert into t1 values(1000,'x1000_1') ; -insert into t1 values(@1000,@x1000_2),(@1000,@x1000_3) -on duplicate key update a = a + @100, b = concat(b,@updated) ; -select a,b from t1 where a >= 1000 order by a ; -a b -1000 x1000_3 -1100 x1000_1updated -delete from t1 where a >= 1000 ; -insert into t1 values(1000,'x1000_1') ; -prepare stmt1 from ' insert into t1 values(?,?),(?,?) - on duplicate key update a = a + ?, b = concat(b,?) '; -execute stmt1 using @1000, @x1000_2, @1000, @x1000_3, @100, @updated ; -select a,b from t1 where a >= 1000 order by a ; -a b -1000 x1000_3 -1100 x1000_1updated -delete from t1 where a >= 1000 ; -insert into t1 values(1000,'x1000_1') ; -execute stmt1 using @1000, @x1000_2, @1100, @x1000_3, @100, @updated ; -select a,b from t1 where a >= 1000 order by a ; -a b -1200 x1000_1updatedupdated -delete from t1 where a >= 1000 ; -prepare stmt1 from ' replace into t1 (a,b) select 100, ''hundred'' '; -execute stmt1; -execute stmt1; -execute stmt1; -test_sequence ------- multi table tests ------ -delete from t1 ; -delete from t9 ; -insert into t1(a,b) values (1, 'one'), (2, 'two'), (3, 'three') ; -insert into t9 (c1,c21) -values (1, 'one'), (2, 'two'), (3, 'three') ; -prepare stmt_delete from " delete t1, t9 - from t1, t9 where t1.a=t9.c1 and t1.b='updated' "; -prepare stmt_update from " update t1, t9 - set t1.b='updated', t9.c21='updated' - where t1.a=t9.c1 and t1.a=? "; -prepare stmt_select1 from " select a, b from t1 order by a" ; -prepare stmt_select2 from " select c1, c21 from t9 order by c1" ; -set @arg00= 1 ; -execute stmt_update using @arg00 ; -execute stmt_delete ; -execute stmt_select1 ; -a b -2 two -3 three -execute stmt_select2 ; -c1 c21 -2 two -3 three -set @arg00= @arg00 + 1 ; -execute stmt_update using @arg00 ; -execute stmt_delete ; -execute stmt_select1 ; -a b -3 three -execute stmt_select2 ; -c1 c21 -3 three -set @arg00= @arg00 + 1 ; -execute stmt_update using @arg00 ; -execute stmt_delete ; -execute stmt_select1 ; -a b -execute stmt_select2 ; -c1 c21 -set @arg00= @arg00 + 1 ; -drop table if exists t5 ; -set @arg01= 8; -set @arg02= 8.0; -set @arg03= 80.00000000000e-1; -set @arg04= 'abc' ; -set @arg05= CAST('abc' as binary) ; -set @arg06= '1991-08-05' ; -set @arg07= CAST('1991-08-05' as date); -set @arg08= '1991-08-05 01:01:01' ; -set @arg09= CAST('1991-08-05 01:01:01' as datetime) ; -set @arg10= unix_timestamp('1991-01-01 01:01:01'); -set @arg11= YEAR('1991-01-01 01:01:01'); -set @arg12= 8 ; -set @arg12= NULL ; -set @arg13= 8.0 ; -set @arg13= NULL ; -set @arg14= 'abc'; -set @arg14= NULL ; -set @arg15= CAST('abc' as binary) ; -set @arg15= NULL ; -create table t5 as select -8 as const01, @arg01 as param01, -8.0 as const02, @arg02 as param02, -80.00000000000e-1 as const03, @arg03 as param03, -'abc' as const04, @arg04 as param04, -CAST('abc' as binary) as const05, @arg05 as param05, -'1991-08-05' as const06, @arg06 as param06, -CAST('1991-08-05' as date) as const07, @arg07 as param07, -'1991-08-05 01:01:01' as const08, @arg08 as param08, -CAST('1991-08-05 01:01:01' as datetime) as const09, @arg09 as param09, -unix_timestamp('1991-01-01 01:01:01') as const10, @arg10 as param10, -YEAR('1991-01-01 01:01:01') as const11, @arg11 as param11, -NULL as const12, @arg12 as param12, -@arg13 as param13, -@arg14 as param14, -@arg15 as param15; -show create table t5 ; -Table Create Table -t5 CREATE TABLE `t5` ( - `const01` bigint(1) NOT NULL default '0', - `param01` bigint(20) default NULL, - `const02` double(3,1) NOT NULL default '0.0', - `param02` double default NULL, - `const03` double NOT NULL default '0', - `param03` double default NULL, - `const04` char(3) NOT NULL default '', - `param04` longtext, - `const05` binary(3) NOT NULL default '', - `param05` longblob, - `const06` varchar(10) NOT NULL default '', - `param06` longtext, - `const07` date default NULL, - `param07` longblob, - `const08` varchar(19) NOT NULL default '', - `param08` longtext, - `const09` datetime default NULL, - `param09` longblob, - `const10` int(10) NOT NULL default '0', - `param10` bigint(20) default NULL, - `const11` int(4) default NULL, - `param11` bigint(20) default NULL, - `const12` binary(0) default NULL, - `param12` bigint(20) default NULL, - `param13` double default NULL, - `param14` longtext, - `param15` longblob -) ENGINE=MyISAM DEFAULT CHARSET=latin1 -select * from t5 ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def test t5 t5 const01 const01 8 1 1 N 32769 0 63 -def test t5 t5 param01 param01 8 20 1 Y 32768 0 63 -def test t5 t5 const02 const02 5 3 3 N 32769 1 63 -def test t5 t5 param02 param02 5 20 1 Y 32768 31 63 -def test t5 t5 const03 const03 5 23 1 N 32769 31 63 -def test t5 t5 param03 param03 5 20 1 Y 32768 31 63 -def test t5 t5 const04 const04 254 3 3 N 1 0 8 -def test t5 t5 param04 param04 252 16777215 3 Y 16 0 8 -def test t5 t5 const05 const05 254 3 3 N 129 0 63 -def test t5 t5 param05 param05 252 16777215 3 Y 144 0 63 -def test t5 t5 const06 const06 253 10 10 N 1 0 8 -def test t5 t5 param06 param06 252 16777215 10 Y 16 0 8 -def test t5 t5 const07 const07 10 10 10 Y 128 0 63 -def test t5 t5 param07 param07 252 16777215 10 Y 144 0 63 -def test t5 t5 const08 const08 253 19 19 N 1 0 8 -def test t5 t5 param08 param08 252 16777215 19 Y 16 0 8 -def test t5 t5 const09 const09 12 19 19 Y 128 0 63 -def test t5 t5 param09 param09 252 16777215 19 Y 144 0 63 -def test t5 t5 const10 const10 3 10 9 N 32769 0 63 -def test t5 t5 param10 param10 8 20 9 Y 32768 0 63 -def test t5 t5 const11 const11 3 4 4 Y 32768 0 63 -def test t5 t5 param11 param11 8 20 4 Y 32768 0 63 -def test t5 t5 const12 const12 254 0 0 Y 128 0 63 -def test t5 t5 param12 param12 8 20 0 Y 32768 0 63 -def test t5 t5 param13 param13 5 20 0 Y 32768 31 63 -def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8 -def test t5 t5 param15 param15 252 16777215 0 Y 144 0 63 -const01 8 -param01 8 -const02 8.0 -param02 8 -const03 8 -param03 8 -const04 abc -param04 abc -const05 abc -param05 abc -const06 1991-08-05 -param06 1991-08-05 -const07 1991-08-05 -param07 1991-08-05 -const08 1991-08-05 01:01:01 -param08 1991-08-05 01:01:01 -const09 1991-08-05 01:01:01 -param09 1991-08-05 01:01:01 -const10 662680861 -param10 662680861 -const11 1991 -param11 1991 -const12 NULL -param12 NULL -param13 NULL -param14 NULL -param15 NULL -drop table t5 ; -test_sequence ------- data type conversion tests ------ -delete from t1 ; -insert into t1 values (1,'one'); -insert into t1 values (2,'two'); -insert into t1 values (3,'three'); -insert into t1 values (4,'four'); -commit ; -delete from t9 ; -insert into t9 -set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, -c10= 1, c11= 1, c12 = 1, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=true, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t9 -set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, -c10= 9, c11= 9, c12 = 9, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=false, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; -commit ; -insert into t9 set c1= 0, c15= '1991-01-01 01:01:01' ; -select * from t9 order by c1 ; -c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32 -0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday -test_sequence ------- select @parameter:= column ------ -prepare full_info from "select @arg01, @arg02, @arg03, @arg04, - @arg05, @arg06, @arg07, @arg08, - @arg09, @arg10, @arg11, @arg12, - @arg13, @arg14, @arg15, @arg16, - @arg17, @arg18, @arg19, @arg20, - @arg21, @arg22, @arg23, @arg24, - @arg25, @arg26, @arg27, @arg28, - @arg29, @arg30, @arg31, @arg32" ; -select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, -@arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8, -@arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12, -@arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16, -@arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20, -@arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24, -@arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28, -@arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32 -from t9 where c1= 1 ; -@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 -1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 1 Y 128 31 63 -def @arg03 254 20 1 Y 128 31 63 -def @arg04 254 20 1 Y 128 31 63 -def @arg05 254 20 1 Y 128 31 63 -def @arg06 254 20 1 Y 128 31 63 -def @arg07 254 20 1 Y 128 31 63 -def @arg08 254 20 1 Y 128 31 63 -def @arg09 254 20 1 Y 128 31 63 -def @arg10 254 20 1 Y 128 31 63 -def @arg11 254 20 1 Y 128 31 63 -def @arg12 254 20 1 Y 128 31 63 -def @arg13 254 8192 10 Y 128 31 63 -def @arg14 254 8192 19 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 8 Y 128 31 63 -def @arg17 254 20 4 Y 128 31 63 -def @arg18 254 20 1 Y 128 31 63 -def @arg19 254 20 1 Y 128 31 63 -def @arg20 254 8192 1 Y 0 31 8 -def @arg21 254 8192 10 Y 0 31 8 -def @arg22 254 8192 30 Y 0 31 8 -def @arg23 254 8192 8 Y 128 31 63 -def @arg24 254 8192 8 Y 0 31 8 -def @arg25 254 8192 4 Y 128 31 63 -def @arg26 254 8192 4 Y 0 31 8 -def @arg27 254 8192 10 Y 128 31 63 -def @arg28 254 8192 10 Y 0 31 8 -def @arg29 254 8192 8 Y 128 31 63 -def @arg30 254 8192 8 Y 0 31 8 -def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, -@arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8, -@arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12, -@arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16, -@arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20, -@arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24, -@arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28, -@arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32 -from t9 where c1= 0 ; -@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 -0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 0 Y 128 31 63 -def @arg03 254 20 0 Y 128 31 63 -def @arg04 254 20 0 Y 128 31 63 -def @arg05 254 20 0 Y 128 31 63 -def @arg06 254 20 0 Y 128 31 63 -def @arg07 254 20 0 Y 128 31 63 -def @arg08 254 20 0 Y 128 31 63 -def @arg09 254 20 0 Y 128 31 63 -def @arg10 254 20 0 Y 128 31 63 -def @arg11 254 20 0 Y 128 31 63 -def @arg12 254 20 0 Y 128 31 63 -def @arg13 254 8192 0 Y 128 31 63 -def @arg14 254 8192 0 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 0 Y 128 31 63 -def @arg17 254 20 0 Y 128 31 63 -def @arg18 254 20 0 Y 128 31 63 -def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 0 31 8 -def @arg21 254 8192 0 Y 0 31 8 -def @arg22 254 8192 0 Y 0 31 8 -def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 0 31 8 -def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 0 31 8 -def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 0 31 8 -def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 0 31 8 -def @arg31 254 8192 0 Y 0 31 8 -def @arg32 254 8192 0 Y 0 31 8 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -prepare stmt1 from "select - @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, - @arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8, - @arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12, - @arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16, - @arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20, - @arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24, - @arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28, - @arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32 -from t9 where c1= ?" ; -set @my_key= 1 ; -execute stmt1 using @my_key ; -@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 -1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 1 Y 128 31 63 -def @arg03 254 20 1 Y 128 31 63 -def @arg04 254 20 1 Y 128 31 63 -def @arg05 254 20 1 Y 128 31 63 -def @arg06 254 20 1 Y 128 31 63 -def @arg07 254 20 1 Y 128 31 63 -def @arg08 254 20 1 Y 128 31 63 -def @arg09 254 20 1 Y 128 31 63 -def @arg10 254 20 1 Y 128 31 63 -def @arg11 254 20 1 Y 128 31 63 -def @arg12 254 20 1 Y 128 31 63 -def @arg13 254 8192 10 Y 128 31 63 -def @arg14 254 8192 19 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 8 Y 128 31 63 -def @arg17 254 20 4 Y 128 31 63 -def @arg18 254 20 1 Y 128 31 63 -def @arg19 254 20 1 Y 128 31 63 -def @arg20 254 8192 1 Y 0 31 8 -def @arg21 254 8192 10 Y 0 31 8 -def @arg22 254 8192 30 Y 0 31 8 -def @arg23 254 8192 8 Y 128 31 63 -def @arg24 254 8192 8 Y 0 31 8 -def @arg25 254 8192 4 Y 128 31 63 -def @arg26 254 8192 4 Y 0 31 8 -def @arg27 254 8192 10 Y 128 31 63 -def @arg28 254 8192 10 Y 0 31 8 -def @arg29 254 8192 8 Y 128 31 63 -def @arg30 254 8192 8 Y 0 31 8 -def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -set @my_key= 0 ; -execute stmt1 using @my_key ; -@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 -0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 0 Y 128 31 63 -def @arg03 254 20 0 Y 128 31 63 -def @arg04 254 20 0 Y 128 31 63 -def @arg05 254 20 0 Y 128 31 63 -def @arg06 254 20 0 Y 128 31 63 -def @arg07 254 20 0 Y 128 31 63 -def @arg08 254 20 0 Y 128 31 63 -def @arg09 254 20 0 Y 128 31 63 -def @arg10 254 20 0 Y 128 31 63 -def @arg11 254 20 0 Y 128 31 63 -def @arg12 254 20 0 Y 128 31 63 -def @arg13 254 8192 0 Y 128 31 63 -def @arg14 254 8192 0 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 0 Y 128 31 63 -def @arg17 254 20 0 Y 128 31 63 -def @arg18 254 20 0 Y 128 31 63 -def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 0 31 8 -def @arg21 254 8192 0 Y 0 31 8 -def @arg22 254 8192 0 Y 0 31 8 -def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 0 31 8 -def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 0 31 8 -def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 0 31 8 -def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 0 31 8 -def @arg31 254 8192 0 Y 0 31 8 -def @arg32 254 8192 0 Y 0 31 8 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -prepare stmt1 from "select ? := c1 from t9 where c1= 1" ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':= c1 from t9 where c1= 1' at line 1 -test_sequence ------- select column, .. into @parm,.. ------ -select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, -c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, -c25, c26, c27, c28, c29, c30, c31, c32 -into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, -@arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, -@arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24, -@arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 -from t9 where c1= 1 ; -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 1 Y 128 31 63 -def @arg03 254 20 1 Y 128 31 63 -def @arg04 254 20 1 Y 128 31 63 -def @arg05 254 20 1 Y 128 31 63 -def @arg06 254 20 1 Y 128 31 63 -def @arg07 254 20 1 Y 128 31 63 -def @arg08 254 20 1 Y 128 31 63 -def @arg09 254 20 1 Y 128 31 63 -def @arg10 254 20 1 Y 128 31 63 -def @arg11 254 20 1 Y 128 31 63 -def @arg12 254 20 1 Y 128 31 63 -def @arg13 254 8192 10 Y 128 31 63 -def @arg14 254 8192 19 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 8 Y 128 31 63 -def @arg17 254 20 4 Y 128 31 63 -def @arg18 254 20 1 Y 128 31 63 -def @arg19 254 20 1 Y 128 31 63 -def @arg20 254 8192 1 Y 0 31 8 -def @arg21 254 8192 10 Y 0 31 8 -def @arg22 254 8192 30 Y 0 31 8 -def @arg23 254 8192 8 Y 128 31 63 -def @arg24 254 8192 8 Y 0 31 8 -def @arg25 254 8192 4 Y 128 31 63 -def @arg26 254 8192 4 Y 0 31 8 -def @arg27 254 8192 10 Y 128 31 63 -def @arg28 254 8192 10 Y 0 31 8 -def @arg29 254 8192 8 Y 128 31 63 -def @arg30 254 8192 8 Y 0 31 8 -def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, -c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, -c25, c26, c27, c28, c29, c30, c31, c32 -into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, -@arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, -@arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24, -@arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 -from t9 where c1= 0 ; -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 0 Y 128 31 63 -def @arg03 254 20 0 Y 128 31 63 -def @arg04 254 20 0 Y 128 31 63 -def @arg05 254 20 0 Y 128 31 63 -def @arg06 254 20 0 Y 128 31 63 -def @arg07 254 20 0 Y 128 31 63 -def @arg08 254 20 0 Y 128 31 63 -def @arg09 254 20 0 Y 128 31 63 -def @arg10 254 20 0 Y 128 31 63 -def @arg11 254 20 0 Y 128 31 63 -def @arg12 254 20 0 Y 128 31 63 -def @arg13 254 8192 0 Y 128 31 63 -def @arg14 254 8192 0 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 0 Y 128 31 63 -def @arg17 254 20 0 Y 128 31 63 -def @arg18 254 20 0 Y 128 31 63 -def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 0 31 8 -def @arg21 254 8192 0 Y 0 31 8 -def @arg22 254 8192 0 Y 0 31 8 -def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 0 31 8 -def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 0 31 8 -def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 0 31 8 -def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 0 31 8 -def @arg31 254 8192 0 Y 0 31 8 -def @arg32 254 8192 0 Y 0 31 8 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -prepare stmt1 from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, - c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, - c25, c26, c27, c28, c29, c30, c31, c32 -into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, - @arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, - @arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24, - @arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 -from t9 where c1= ?" ; -set @my_key= 1 ; -execute stmt1 using @my_key ; -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 1 Y 128 31 63 -def @arg03 254 20 1 Y 128 31 63 -def @arg04 254 20 1 Y 128 31 63 -def @arg05 254 20 1 Y 128 31 63 -def @arg06 254 20 1 Y 128 31 63 -def @arg07 254 20 1 Y 128 31 63 -def @arg08 254 20 1 Y 128 31 63 -def @arg09 254 20 1 Y 128 31 63 -def @arg10 254 20 1 Y 128 31 63 -def @arg11 254 20 1 Y 128 31 63 -def @arg12 254 20 1 Y 128 31 63 -def @arg13 254 8192 10 Y 128 31 63 -def @arg14 254 8192 19 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 8 Y 128 31 63 -def @arg17 254 20 4 Y 128 31 63 -def @arg18 254 20 1 Y 128 31 63 -def @arg19 254 20 1 Y 128 31 63 -def @arg20 254 8192 1 Y 0 31 8 -def @arg21 254 8192 10 Y 0 31 8 -def @arg22 254 8192 30 Y 0 31 8 -def @arg23 254 8192 8 Y 128 31 63 -def @arg24 254 8192 8 Y 0 31 8 -def @arg25 254 8192 4 Y 128 31 63 -def @arg26 254 8192 4 Y 0 31 8 -def @arg27 254 8192 10 Y 128 31 63 -def @arg28 254 8192 10 Y 0 31 8 -def @arg29 254 8192 8 Y 128 31 63 -def @arg30 254 8192 8 Y 0 31 8 -def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -set @my_key= 0 ; -execute stmt1 using @my_key ; -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 0 Y 128 31 63 -def @arg03 254 20 0 Y 128 31 63 -def @arg04 254 20 0 Y 128 31 63 -def @arg05 254 20 0 Y 128 31 63 -def @arg06 254 20 0 Y 128 31 63 -def @arg07 254 20 0 Y 128 31 63 -def @arg08 254 20 0 Y 128 31 63 -def @arg09 254 20 0 Y 128 31 63 -def @arg10 254 20 0 Y 128 31 63 -def @arg11 254 20 0 Y 128 31 63 -def @arg12 254 20 0 Y 128 31 63 -def @arg13 254 8192 0 Y 128 31 63 -def @arg14 254 8192 0 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 0 Y 128 31 63 -def @arg17 254 20 0 Y 128 31 63 -def @arg18 254 20 0 Y 128 31 63 -def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 0 31 8 -def @arg21 254 8192 0 Y 0 31 8 -def @arg22 254 8192 0 Y 0 31 8 -def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 0 31 8 -def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 0 31 8 -def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 0 31 8 -def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 0 31 8 -def @arg31 254 8192 0 Y 0 31 8 -def @arg32 254 8192 0 Y 0 31 8 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -prepare stmt1 from "select c1 into ? from t9 where c1= 1" ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? from t9 where c1= 1' at line 1 -test_sequence --- insert into numeric columns -- -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20 ) ; -set @arg00= 21 ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ) ; -prepare stmt1 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22 )" ; -execute stmt1 ; -set @arg00= 23; -prepare stmt2 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, -30.0, 30.0, 30.0 ) ; -set @arg00= 31.0 ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ) ; -prepare stmt1 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, - 32.0, 32.0, 32.0 )" ; -execute stmt1 ; -set @arg00= 33.0; -prepare stmt2 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( '40', '40', '40', '40', '40', '40', '40', '40', -'40', '40', '40' ) ; -set @arg00= '41' ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ) ; -prepare stmt1 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( '42', '42', '42', '42', '42', '42', '42', '42', - '42', '42', '42' )" ; -execute stmt1 ; -set @arg00= '43'; -prepare stmt2 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( CAST('50' as binary), CAST('50' as binary), -CAST('50' as binary), CAST('50' as binary), CAST('50' as binary), -CAST('50' as binary), CAST('50' as binary), CAST('50' as binary), -CAST('50' as binary), CAST('50' as binary), CAST('50' as binary) ) ; -set @arg00= CAST('51' as binary) ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ) ; -prepare stmt1 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( CAST('52' as binary), CAST('52' as binary), - CAST('52' as binary), CAST('52' as binary), CAST('52' as binary), - CAST('52' as binary), CAST('52' as binary), CAST('52' as binary), - CAST('52' as binary), CAST('52' as binary), CAST('52' as binary) )" ; -execute stmt1 ; -set @arg00= CAST('53' as binary) ; -prepare stmt2 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -set @arg00= 2 ; -set @arg00= NULL ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( 60, NULL, NULL, NULL, NULL, NULL, NULL, NULL, -NULL, NULL, NULL ) ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( 61, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ) ; -prepare stmt1 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( 62, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL )" ; -execute stmt1 ; -prepare stmt2 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( 63, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -set @arg00= 8.0 ; -set @arg00= NULL ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( 71, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ) ; -prepare stmt2 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( 73, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -set @arg00= 'abc' ; -set @arg00= NULL ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( 81, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ) ; -prepare stmt2 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( 83, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 -from t9 where c1 >= 20 -order by c1 ; -c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c12 -20 20 20 20 20 20 20 20 20 20 20.0000 -21 21 21 21 21 21 21 21 21 21 21.0000 -22 22 22 22 22 22 22 22 22 22 22.0000 -23 23 23 23 23 23 23 23 23 23 23.0000 -30 30 30 30 30 30 30 30 30 30 30.0000 -31 31 31 31 31 31 31 31 31 31 31.0000 -32 32 32 32 32 32 32 32 32 32 32.0000 -33 33 33 33 33 33 33 33 33 33 33.0000 -40 40 40 40 40 40 40 40 40 40 40.0000 -41 41 41 41 41 41 41 41 41 41 41.0000 -42 42 42 42 42 42 42 42 42 42 42.0000 -43 43 43 43 43 43 43 43 43 43 43.0000 -50 50 50 50 50 50 50 50 50 50 50.0000 -51 51 51 51 51 51 51 51 51 51 51.0000 -52 52 52 52 52 52 52 52 52 52 52.0000 -53 53 53 53 53 53 53 53 53 53 53.0000 -60 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -61 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -62 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -63 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -71 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -73 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -81 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -83 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -test_sequence --- select .. where numeric column = .. -- -set @arg00= 20; -select 'true' as found from t9 -where c1= 20 and c2= 20 and c3= 20 and c4= 20 and c5= 20 and c6= 20 and c7= 20 -and c8= 20 and c9= 20 and c10= 20 and c12= 20; -found -true -select 'true' as found from t9 -where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 -and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 -and c12= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c2= 20 and c3= 20 and c4= 20 and c5= 20 and c6= 20 and c7= 20 - and c8= 20 and c9= 20 and c10= 20 and c12= 20 "; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? - and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? - and c12= ? "; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -found -true -set @arg00= 20.0; -select 'true' as found from t9 -where c1= 20.0 and c2= 20.0 and c3= 20.0 and c4= 20.0 and c5= 20.0 and c6= 20.0 -and c7= 20.0 and c8= 20.0 and c9= 20.0 and c10= 20.0 and c12= 20.0; -found -true -select 'true' as found from t9 -where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 -and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 -and c12= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20.0 and c2= 20.0 and c3= 20.0 and c4= 20.0 and c5= 20.0 and c6= 20.0 - and c7= 20.0 and c8= 20.0 and c9= 20.0 and c10= 20.0 and c12= 20.0 "; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? - and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? - and c12= ? "; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -found -true -select 'true' as found from t9 -where c1= '20' and c2= '20' and c3= '20' and c4= '20' and c5= '20' and c6= '20' - and c7= '20' and c8= '20' and c9= '20' and c10= '20' and c12= '20'; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= '20' and c2= '20' and c3= '20' and c4= '20' and c5= '20' and c6= '20' - and c7= '20' and c8= '20' and c9= '20' and c10= '20' and c12= '20' "; -execute stmt1 ; -found -true -set @arg00= '20'; -select 'true' as found from t9 -where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 -and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 -and c12= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? - and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? - and c12= ? "; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -found -true -select 'true' as found from t9 -where c1= CAST('20' as binary) and c2= CAST('20' as binary) and -c3= CAST('20' as binary) and c4= CAST('20' as binary) and -c5= CAST('20' as binary) and c6= CAST('20' as binary) and -c7= CAST('20' as binary) and c8= CAST('20' as binary) and -c9= CAST('20' as binary) and c10= CAST('20' as binary) and -c12= CAST('20' as binary); -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= CAST('20' as binary) and c2= CAST('20' as binary) and - c3= CAST('20' as binary) and c4= CAST('20' as binary) and - c5= CAST('20' as binary) and c6= CAST('20' as binary) and - c7= CAST('20' as binary) and c8= CAST('20' as binary) and - c9= CAST('20' as binary) and c10= CAST('20' as binary) and - c12= CAST('20' as binary) "; -execute stmt1 ; -found -true -set @arg00= CAST('20' as binary) ; -select 'true' as found from t9 -where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 -and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 -and c12= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? - and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? - and c12= ? "; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -found -true -delete from t9 ; -test_sequence --- some numeric overflow experiments -- -prepare my_insert from "insert into t9 - ( c21, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( 'O', ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -prepare my_select from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 -from t9 where c21 = 'O' "; -prepare my_delete from "delete from t9 where c21 = 'O' "; -set @arg00= 9223372036854775807 ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1264 Data truncated; out of range for column 'c1' at row 1 -Warning 1264 Data truncated; out of range for column 'c2' at row 1 -Warning 1264 Data truncated; out of range for column 'c3' at row 1 -Warning 1264 Data truncated; out of range for column 'c4' at row 1 -Warning 1264 Data truncated; out of range for column 'c5' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 127 -c2 32767 -c3 8388607 -c4 2147483647 -c5 2147483647 -c6 9223372036854775807 -c7 9.22337e+18 -c8 9.22337203685478e+18 -c9 9.22337203685478e+18 -c10 9.22337203685478e+18 -c12 99999.9999 -execute my_delete ; -set @arg00= '9223372036854775807' ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1264 Data truncated; out of range for column 'c1' at row 1 -Warning 1264 Data truncated; out of range for column 'c2' at row 1 -Warning 1264 Data truncated; out of range for column 'c3' at row 1 -Warning 1265 Data truncated for column 'c4' at row 1 -Warning 1265 Data truncated for column 'c5' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 127 -c2 32767 -c3 8388607 -c4 2147483647 -c5 2147483647 -c6 9223372036854775807 -c7 9.22337e+18 -c8 9.22337203685478e+18 -c9 9.22337203685478e+18 -c10 9.22337203685478e+18 -c12 99999.9999 -execute my_delete ; -set @arg00= -9223372036854775808 ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1264 Data truncated; out of range for column 'c1' at row 1 -Warning 1264 Data truncated; out of range for column 'c2' at row 1 -Warning 1264 Data truncated; out of range for column 'c3' at row 1 -Warning 1264 Data truncated; out of range for column 'c4' at row 1 -Warning 1264 Data truncated; out of range for column 'c5' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 -128 -c2 -32768 -c3 -8388608 -c4 -2147483648 -c5 -2147483648 -c6 -9223372036854775808 -c7 -9.22337e+18 -c8 -9.22337203685478e+18 -c9 -9.22337203685478e+18 -c10 -9.22337203685478e+18 -c12 -9999.9999 -execute my_delete ; -set @arg00= '-9223372036854775808' ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1264 Data truncated; out of range for column 'c1' at row 1 -Warning 1264 Data truncated; out of range for column 'c2' at row 1 -Warning 1264 Data truncated; out of range for column 'c3' at row 1 -Warning 1265 Data truncated for column 'c4' at row 1 -Warning 1265 Data truncated for column 'c5' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 -128 -c2 -32768 -c3 -8388608 -c4 -2147483648 -c5 -2147483648 -c6 -9223372036854775808 -c7 -9.22337e+18 -c8 -9.22337203685478e+18 -c9 -9.22337203685478e+18 -c10 -9.22337203685478e+18 -c12 -9999.9999 -execute my_delete ; -set @arg00= 1.11111111111111111111e+50 ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1264 Data truncated; out of range for column 'c1' at row 1 -Warning 1264 Data truncated; out of range for column 'c2' at row 1 -Warning 1264 Data truncated; out of range for column 'c3' at row 1 -Warning 1264 Data truncated; out of range for column 'c4' at row 1 -Warning 1264 Data truncated; out of range for column 'c5' at row 1 -Warning 1264 Data truncated; out of range for column 'c6' at row 1 -Warning 1264 Data truncated; out of range for column 'c7' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 127 -c2 32767 -c3 8388607 -c4 2147483647 -c5 2147483647 -c6 9223372036854775807 -c7 3.40282e+38 -c8 1.11111111111111e+50 -c9 1.11111111111111e+50 -c10 1.11111111111111e+50 -c12 99999.9999 -execute my_delete ; -set @arg00= '1.11111111111111111111e+50' ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1265 Data truncated for column 'c1' at row 1 -Warning 1265 Data truncated for column 'c2' at row 1 -Warning 1265 Data truncated for column 'c3' at row 1 -Warning 1265 Data truncated for column 'c4' at row 1 -Warning 1265 Data truncated for column 'c5' at row 1 -Warning 1265 Data truncated for column 'c6' at row 1 -Warning 1264 Data truncated; out of range for column 'c7' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 1 -c2 1 -c3 1 -c4 1 -c5 1 -c6 1 -c7 3.40282e+38 -c8 1.11111111111111e+50 -c9 1.11111111111111e+50 -c10 1.11111111111111e+50 -c12 99999.9999 -execute my_delete ; -set @arg00= -1.11111111111111111111e+50 ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1264 Data truncated; out of range for column 'c1' at row 1 -Warning 1264 Data truncated; out of range for column 'c2' at row 1 -Warning 1264 Data truncated; out of range for column 'c3' at row 1 -Warning 1264 Data truncated; out of range for column 'c4' at row 1 -Warning 1264 Data truncated; out of range for column 'c5' at row 1 -Warning 1264 Data truncated; out of range for column 'c6' at row 1 -Warning 1264 Data truncated; out of range for column 'c7' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 -128 -c2 -32768 -c3 -8388608 -c4 -2147483648 -c5 -2147483648 -c6 -9223372036854775808 -c7 -3.40282e+38 -c8 -1.11111111111111e+50 -c9 -1.11111111111111e+50 -c10 -1.11111111111111e+50 -c12 -9999.9999 -execute my_delete ; -set @arg00= '-1.11111111111111111111e+50' ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1265 Data truncated for column 'c1' at row 1 -Warning 1265 Data truncated for column 'c2' at row 1 -Warning 1265 Data truncated for column 'c3' at row 1 -Warning 1265 Data truncated for column 'c4' at row 1 -Warning 1265 Data truncated for column 'c5' at row 1 -Warning 1265 Data truncated for column 'c6' at row 1 -Warning 1264 Data truncated; out of range for column 'c7' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 -1 -c2 -1 -c3 -1 -c4 -1 -c5 -1 -c6 -1 -c7 -3.40282e+38 -c8 -1.11111111111111e+50 -c9 -1.11111111111111e+50 -c10 -1.11111111111111e+50 -c12 -9999.9999 -execute my_delete ; -test_sequence --- insert into string columns -- -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -select c1, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30 -from t9 where c1 >= 20 -order by c1 ; -c1 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 -20 2 20 20 20 20 20 20 20 20 20 20 -21 2 21 21 21 21 21 21 21 21 21 21 -22 2 22 22 22 22 22 22 22 22 22 22 -23 2 23 23 23 23 23 23 23 23 23 23 -30 3 30 30 30 30 30 30 30 30 30 30 -31 3 31 31 31 31 31 31 31 31 31 31 -32 3 32 32 32 32 32 32 32 32 32 32 -33 3 33 33 33 33 33 33 33 33 33 33 -40 4 40 40 40 40 40 40 40 40 40 40 -41 4 41 41 41 41 41 41 41 41 41 41 -42 4 42 42 42 42 42 42 42 42 42 42 -43 4 43 43 43 43 43 43 43 43 43 43 -50 5 50 50 50.00 50.00 50.00 50.00 50.00 50.00 50.00 50.00 -51 5 51 51 51 51 51 51 51 51 51 51 -52 5 52 52 52.00 52.00 52.00 52.00 52.00 52.00 52.00 52.00 -53 5 53 53 53.00 53.00 53.00 53.00 53.00 53.00 53.00 53.00 -54 5 54 54 54.00 54.00 54.00 54.00 54.00 54.00 54.00 54.00 -55 5 55 55 55 55 55 55 55 55 55 55 -56 6 56 56 56.00 56.00 56.00 56.00 56.00 56.00 56.00 56.00 -57 6 57 57 57.00 57.00 57.00 57.00 57.00 57.00 57.00 57.00 -60 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -61 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -62 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -63 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -71 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -73 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -81 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -83 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -test_sequence --- select .. where string column = .. -- -set @arg00= '20'; -select 'true' as found from t9 -where c1= 20 and concat(c20,substr('20',1+length(c20)))= '20' and c21= '20' and -c22= '20' and c23= '20' and c24= '20' and c25= '20' and c26= '20' and -c27= '20' and c28= '20' and c29= '20' and c30= '20' ; -found -true -select 'true' as found from t9 -where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and -c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and -c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr('20',1+length(c20)))= '20' and c21= '20' and - c22= '20' and c23= '20' and c24= '20' and c25= '20' and c26= '20' and - c27= '20' and c28= '20' and c29= '20' and c30= '20'" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and - c21= ? and c22= ? and c23= ? and c25= ? and - c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -found -true -set @arg00= CAST('20' as binary); -select 'true' as found from t9 -where c1= 20 and concat(c20,substr(CAST('20' as binary),1+length(c20))) -= CAST('20' as binary) and c21= CAST('20' as binary) -and c22= CAST('20' as binary) and c23= CAST('20' as binary) and -c24= CAST('20' as binary) and c25= CAST('20' as binary) and -c26= CAST('20' as binary) and c27= CAST('20' as binary) and -c28= CAST('20' as binary) and c29= CAST('20' as binary) and -c30= CAST('20' as binary) ; -found -true -select 'true' as found from t9 -where c1= 20 and concat(c20,substr(@arg00,1+length(c20))) = @arg00 and -c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and -c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and -c30= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr(CAST('20' as binary),1+length(c20))) - = CAST('20' as binary) and c21= CAST('20' as binary) - and c22= CAST('20' as binary) and c23= CAST('20' as binary) and - c24= CAST('20' as binary) and c25= CAST('20' as binary) and - c26= CAST('20' as binary) and c27= CAST('20' as binary) and - c28= CAST('20' as binary) and c29= CAST('20' as binary) and - c30= CAST('20' as binary)" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr(?,1+length(c20))) = ? and c21= ? and - c22= ? and c23= ? and c25= ? and c26= ? and c27= ? and c28= ? and - c29= ? and c30= ?"; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -found -true -set @arg00= 20; -select 'true' as found from t9 -where c1= 20 and concat(c20,substr(20,1+length(c20)))= 20 and c21= 20 and -c22= 20 and c23= 20 and c24= 20 and c25= 20 and c26= 20 and -c27= 20 and c28= 20 and c29= 20 and c30= 20 ; -found -true -select 'true' as found from t9 -where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and -c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and -c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr(20,1+length(c20)))= 20 and c21= 20 and - c22= 20 and c23= 20 and c24= 20 and c25= 20 and c26= 20 and - c27= 20 and c28= 20 and c29= 20 and c30= 20" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and - c21= ? and c22= ? and c23= ? and c25= ? and - c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -found -true -set @arg00= 20.0; -select 'true' as found from t9 -where c1= 20 and concat(c20,substr(20.0,1+length(c20)))= 20.0 and c21= 20.0 and -c22= 20.0 and c23= 20.0 and c24= 20.0 and c25= 20.0 and c26= 20.0 and -c27= 20.0 and c28= 20.0 and c29= 20.0 and c30= 20.0 ; -found -true -select 'true' as found from t9 -where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and -c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and -c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr(20.0,1+length(c20)))= 20.0 and c21= 20.0 and - c22= 20.0 and c23= 20.0 and c24= 20.0 and c25= 20.0 and c26= 20.0 and - c27= 20.0 and c28= 20.0 and c29= 20.0 and c30= 20.0" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and - c21= ? and c22= ? and c23= ? and c25= ? and - c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -found -true -delete from t9 ; -test_sequence --- insert into date/time columns -- -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1264 Data truncated; out of range for column 'c13' at row 1 -Warning 1265 Data truncated for column 'c14' at row 1 -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -Warnings: -Warning 1264 Data truncated; out of range for column 'c13' at row 1 -Warning 1265 Data truncated for column 'c14' at row 1 -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -Warnings: -Warning 1264 Data truncated; out of range for column 'c13' at row 1 -Warning 1265 Data truncated for column 'c14' at row 1 -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -Warnings: -Warning 1264 Data truncated; out of range for column 'c13' at row 1 -Warning 1265 Data truncated for column 'c14' at row 1 -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -select c1, c13, c14, c15, c16, c17 from t9 order by c1 ; -c1 c13 c14 c15 c16 c17 -20 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -21 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -22 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -23 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -30 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -31 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -32 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -33 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -40 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -41 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -42 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -43 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -50 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -51 0010-00-00 0010-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -52 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -53 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -60 NULL NULL 1991-01-01 01:01:01 NULL NULL -61 NULL NULL 1991-01-01 01:01:01 NULL NULL -62 NULL NULL 1991-01-01 01:01:01 NULL NULL -63 NULL NULL 1991-01-01 01:01:01 NULL NULL -71 NULL NULL 1991-01-01 01:01:01 NULL NULL -73 NULL NULL 1991-01-01 01:01:01 NULL NULL -81 NULL NULL 1991-01-01 01:01:01 NULL NULL -83 NULL NULL 1991-01-01 01:01:01 NULL NULL -test_sequence --- select .. where date/time column = .. -- -set @arg00= '1991-01-01 01:01:01' ; -select 'true' as found from t9 -where c1= 20 and c13= '1991-01-01 01:01:01' and c14= '1991-01-01 01:01:01' and -c15= '1991-01-01 01:01:01' and c16= '1991-01-01 01:01:01' and -c17= '1991-01-01 01:01:01' ; -found -true -select 'true' as found from t9 -where c1= 20 and c13= @arg00 and c14= @arg00 and c15= @arg00 and c16= @arg00 -and c17= @arg00 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c13= '1991-01-01 01:01:01' and c14= '1991-01-01 01:01:01' and - c15= '1991-01-01 01:01:01' and c16= '1991-01-01 01:01:01' and - c17= '1991-01-01 01:01:01'" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c13= ? and c14= ? and c15= ? and c16= ? and c17= ?" ; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00 ; -found -true -set @arg00= CAST('1991-01-01 01:01:01' as datetime) ; -select 'true' as found from t9 -where c1= 20 and c13= CAST('1991-01-01 01:01:01' as datetime) and -c14= CAST('1991-01-01 01:01:01' as datetime) and -c15= CAST('1991-01-01 01:01:01' as datetime) and -c16= CAST('1991-01-01 01:01:01' as datetime) and -c17= CAST('1991-01-01 01:01:01' as datetime) ; -found -true -select 'true' as found from t9 -where c1= 20 and c13= @arg00 and c14= @arg00 and c15= @arg00 and c16= @arg00 -and c17= @arg00 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c13= CAST('1991-01-01 01:01:01' as datetime) and - c14= CAST('1991-01-01 01:01:01' as datetime) and - c15= CAST('1991-01-01 01:01:01' as datetime) and - c16= CAST('1991-01-01 01:01:01' as datetime) and - c17= CAST('1991-01-01 01:01:01' as datetime)" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c13= ? and c14= ? and c15= ? and c16= ? and c17= ?" ; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00 ; -found -true -set @arg00= 1991 ; -select 'true' as found from t9 -where c1= 20 and c17= 1991 ; -found -true -select 'true' as found from t9 -where c1= 20 and c17= @arg00 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c17= 1991" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c17= ?" ; -execute stmt1 using @arg00 ; -found -true -set @arg00= 1.991e+3 ; -select 'true' as found from t9 -where c1= 20 and abs(c17 - 1.991e+3) < 0.01 ; -found -true -select 'true' as found from t9 -where c1= 20 and abs(c17 - @arg00) < 0.01 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and abs(c17 - 1.991e+3) < 0.01" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and abs(c17 - ?) < 0.01" ; -execute stmt1 using @arg00 ; -found -true -drop table t1, t9 ; -create table t1 -( -a int, b varchar(30), -primary key(a) -) ENGINE = MERGE UNION=(t1_1,t1_2) -INSERT_METHOD=LAST; -create table t9 -( -c1 tinyint, c2 smallint, c3 mediumint, c4 int, -c5 integer, c6 bigint, c7 float, c8 double, -c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4), -c13 date, c14 datetime, c15 timestamp(14), c16 time, -c17 year, c18 bit, c19 bool, c20 char, -c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext, -c25 blob, c26 text, c27 mediumblob, c28 mediumtext, -c29 longblob, c30 longtext, c31 enum('one', 'two', 'three'), -c32 set('monday', 'tuesday', 'wednesday'), -primary key(c1) -) ENGINE = MERGE UNION=(t9_1,t9_2) -INSERT_METHOD=LAST; -delete from t1 ; -insert into t1 values (1,'one'); -insert into t1 values (2,'two'); -insert into t1 values (3,'three'); -insert into t1 values (4,'four'); -commit ; -delete from t9 ; -insert into t9 -set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, -c10= 1, c11= 1, c12 = 1, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=true, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t9 -set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, -c10= 9, c11= 9, c12 = 9, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=false, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; -commit ; -test_sequence ------- simple select tests ------ -prepare stmt1 from ' select * from t9 order by c1 ' ; -execute stmt1; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def test t9 t9 c1 c1 1 4 1 N 49155 0 63 -def test t9 t9 c2 c2 2 6 1 Y 32768 0 63 -def test t9 t9 c3 c3 9 9 1 Y 32768 0 63 -def test t9 t9 c4 c4 3 11 1 Y 32768 0 63 -def test t9 t9 c5 c5 3 11 1 Y 32768 0 63 -def test t9 t9 c6 c6 8 20 1 Y 32768 0 63 -def test t9 t9 c7 c7 4 12 1 Y 32768 31 63 -def test t9 t9 c8 c8 5 22 1 Y 32768 31 63 -def test t9 t9 c9 c9 5 22 1 Y 32768 31 63 -def test t9 t9 c10 c10 5 22 1 Y 32768 31 63 -def test t9 t9 c11 c11 0 9 6 Y 32768 4 63 -def test t9 t9 c12 c12 0 10 6 Y 32768 4 63 -def test t9 t9 c13 c13 10 10 10 Y 128 0 63 -def test t9 t9 c14 c14 12 19 19 Y 128 0 63 -def test t9 t9 c15 c15 7 19 19 N 1249 0 63 -def test t9 t9 c16 c16 11 8 8 Y 128 0 63 -def test t9 t9 c17 c17 13 4 4 Y 32864 0 63 -def test t9 t9 c18 c18 1 1 1 Y 32768 0 63 -def test t9 t9 c19 c19 1 1 1 Y 32768 0 63 -def test t9 t9 c20 c20 254 1 1 Y 0 0 8 -def test t9 t9 c21 c21 253 10 10 Y 0 0 8 -def test t9 t9 c22 c22 253 30 30 Y 0 0 8 -def test t9 t9 c23 c23 252 255 8 Y 144 0 63 -def test t9 t9 c24 c24 252 255 8 Y 16 0 8 -def test t9 t9 c25 c25 252 65535 4 Y 144 0 63 -def test t9 t9 c26 c26 252 65535 4 Y 16 0 8 -def test t9 t9 c27 c27 252 16777215 10 Y 144 0 63 -def test t9 t9 c28 c28 252 16777215 10 Y 16 0 8 -def test t9 t9 c29 c29 252 16777215 8 Y 144 0 63 -def test t9 t9 c30 c30 252 16777215 8 Y 16 0 8 -def test t9 t9 c31 c31 254 5 3 Y 256 0 8 -def test t9 t9 c32 c32 254 24 7 Y 2048 0 8 -c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32 -1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday -set @arg00='SELECT' ; -prepare stmt1 from ' ? a from t1 where a=1 '; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? a from t1 where a=1' at line 1 -set @arg00=1 ; -select @arg00, b from t1 where a=1 ; -@arg00 b -1 one -prepare stmt1 from ' select ?, b from t1 where a=1 ' ; -execute stmt1 using @arg00 ; -? b -1 one -set @arg00='lion' ; -select @arg00, b from t1 where a=1 ; -@arg00 b -lion one -prepare stmt1 from ' select ?, b from t1 where a=1 ' ; -execute stmt1 using @arg00 ; -? b -lion one -set @arg00=NULL ; -select @arg00, b from t1 where a=1 ; -@arg00 b -NULL one -prepare stmt1 from ' select ?, b from t1 where a=1 ' ; -execute stmt1 using @arg00 ; -? b -NULL one -set @arg00=1 ; -select b, a - @arg00 from t1 where a=1 ; -b a - @arg00 -one 0 -prepare stmt1 from ' select b, a - ? from t1 where a=1 ' ; -execute stmt1 using @arg00 ; -b a - ? -one 0 -set @arg00=null ; -select @arg00 as my_col ; -my_col -NULL -prepare stmt1 from ' select ? as my_col'; -execute stmt1 using @arg00 ; -my_col -NULL -select @arg00 + 1 as my_col ; -my_col -NULL -prepare stmt1 from ' select ? + 1 as my_col'; -execute stmt1 using @arg00 ; -my_col -NULL -select 1 + @arg00 as my_col ; -my_col -NULL -prepare stmt1 from ' select 1 + ? as my_col'; -execute stmt1 using @arg00 ; -my_col -NULL -set @arg00='MySQL' ; -select substr(@arg00,1,2) from t1 where a=1 ; -substr(@arg00,1,2) -My -prepare stmt1 from ' select substr(?,1,2) from t1 where a=1 ' ; -execute stmt1 using @arg00 ; -substr(?,1,2) -My -set @arg00=3 ; -select substr('MySQL',@arg00,5) from t1 where a=1 ; -substr('MySQL',@arg00,5) -SQL -prepare stmt1 from ' select substr(''MySQL'',?,5) from t1 where a=1 ' ; -execute stmt1 using @arg00 ; -substr('MySQL',?,5) -SQL -select substr('MySQL',1,@arg00) from t1 where a=1 ; -substr('MySQL',1,@arg00) -MyS -prepare stmt1 from ' select substr(''MySQL'',1,?) from t1 where a=1 ' ; -execute stmt1 using @arg00 ; -substr('MySQL',1,?) -MyS -set @arg00='MySQL' ; -select a , concat(@arg00,b) from t1 order by a; -a concat(@arg00,b) -1 MySQLone -2 MySQLtwo -3 MySQLthree -4 MySQLfour -prepare stmt1 from ' select a , concat(?,b) from t1 order by a ' ; -execute stmt1 using @arg00; -a concat(?,b) -1 MySQLone -2 MySQLtwo -3 MySQLthree -4 MySQLfour -select a , concat(b,@arg00) from t1 order by a ; -a concat(b,@arg00) -1 oneMySQL -2 twoMySQL -3 threeMySQL -4 fourMySQL -prepare stmt1 from ' select a , concat(b,?) from t1 order by a ' ; -execute stmt1 using @arg00; -a concat(b,?) -1 oneMySQL -2 twoMySQL -3 threeMySQL -4 fourMySQL -set @arg00='MySQL' ; -select group_concat(@arg00,b order by a) from t1 -group by 'a' ; -group_concat(@arg00,b order by a) -MySQLone,MySQLtwo,MySQLthree,MySQLfour -prepare stmt1 from ' select group_concat(?,b order by a) from t1 -group by ''a'' ' ; -execute stmt1 using @arg00; -group_concat(?,b order by a) -MySQLone,MySQLtwo,MySQLthree,MySQLfour -select group_concat(b,@arg00 order by a) from t1 -group by 'a' ; -group_concat(b,@arg00 order by a) -oneMySQL,twoMySQL,threeMySQL,fourMySQL -prepare stmt1 from ' select group_concat(b,? order by a) from t1 -group by ''a'' ' ; -execute stmt1 using @arg00; -group_concat(b,? order by a) -oneMySQL,twoMySQL,threeMySQL,fourMySQL -set @arg00='first' ; -set @arg01='second' ; -set @arg02=NULL; -select @arg00, @arg01 from t1 where a=1 ; -@arg00 @arg01 -first second -prepare stmt1 from ' select ?, ? from t1 where a=1 ' ; -execute stmt1 using @arg00, @arg01 ; -? ? -first second -execute stmt1 using @arg02, @arg01 ; -? ? -NULL second -execute stmt1 using @arg00, @arg02 ; -? ? -first NULL -execute stmt1 using @arg02, @arg02 ; -? ? -NULL NULL -drop table if exists t5 ; -create table t5 (id1 int(11) not null default '0', -value2 varchar(100), value1 varchar(100)) ; -insert into t5 values (1,'hh','hh'),(2,'hh','hh'), -(1,'ii','ii'),(2,'ii','ii') ; -prepare stmt1 from ' select id1,value1 from t5 where id1=? or value1=? order by id1,value1 ' ; -set @arg00=1 ; -set @arg01='hh' ; -execute stmt1 using @arg00, @arg01 ; -id1 value1 -1 hh -1 ii -2 hh -drop table t5 ; -drop table if exists t5 ; -create table t5(session_id char(9) not null) ; -insert into t5 values ('abc') ; -prepare stmt1 from ' select * from t5 -where ?=''1111'' and session_id = ''abc'' ' ; -set @arg00='abc' ; -execute stmt1 using @arg00 ; -session_id -set @arg00='1111' ; -execute stmt1 using @arg00 ; -session_id -abc -set @arg00='abc' ; -execute stmt1 using @arg00 ; -session_id -drop table t5 ; -set @arg00='FROM' ; -select a @arg00 t1 where a=1 ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 t1 where a=1' at line 1 -prepare stmt1 from ' select a ? t1 where a=1 ' ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? t1 where a=1' at line 1 -set @arg00='t1' ; -select a from @arg00 where a=1 ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 where a=1' at line 1 -prepare stmt1 from ' select a from ? where a=1 ' ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? where a=1' at line 1 -set @arg00='WHERE' ; -select a from t1 @arg00 a=1 ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 a=1' at line 1 -prepare stmt1 from ' select a from t1 ? a=1 ' ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? a=1' at line 1 -set @arg00=1 ; -select a FROM t1 where a=@arg00 ; -a -1 -prepare stmt1 from ' select a FROM t1 where a=? ' ; -execute stmt1 using @arg00 ; -a -1 -set @arg00=1000 ; -execute stmt1 using @arg00 ; -a -set @arg00=NULL ; -select a FROM t1 where a=@arg00 ; -a -prepare stmt1 from ' select a FROM t1 where a=? ' ; -execute stmt1 using @arg00 ; -a -set @arg00=4 ; -select a FROM t1 where a=sqrt(@arg00) ; -a -2 -prepare stmt1 from ' select a FROM t1 where a=sqrt(?) ' ; -execute stmt1 using @arg00 ; -a -2 -set @arg00=NULL ; -select a FROM t1 where a=sqrt(@arg00) ; -a -prepare stmt1 from ' select a FROM t1 where a=sqrt(?) ' ; -execute stmt1 using @arg00 ; -a -set @arg00=2 ; -set @arg01=3 ; -select a FROM t1 where a in (@arg00,@arg01) order by a; -a -2 -3 -prepare stmt1 from ' select a FROM t1 where a in (?,?) order by a '; -execute stmt1 using @arg00, @arg01; -a -2 -3 -set @arg00= 'one' ; -set @arg01= 'two' ; -set @arg02= 'five' ; -prepare stmt1 from ' select b FROM t1 where b in (?,?,?) order by b ' ; -execute stmt1 using @arg00, @arg01, @arg02 ; -b -one -two -prepare stmt1 from ' select b FROM t1 where b like ? '; -set @arg00='two' ; -execute stmt1 using @arg00 ; -b -two -set @arg00='tw%' ; -execute stmt1 using @arg00 ; -b -two -set @arg00='%wo' ; -execute stmt1 using @arg00 ; -b -two -set @arg00=null ; -insert into t9 set c1= 0, c5 = NULL ; -select c5 from t9 where c5 > NULL ; -c5 -prepare stmt1 from ' select c5 from t9 where c5 > ? '; -execute stmt1 using @arg00 ; -c5 -select c5 from t9 where c5 < NULL ; -c5 -prepare stmt1 from ' select c5 from t9 where c5 < ? '; -execute stmt1 using @arg00 ; -c5 -select c5 from t9 where c5 = NULL ; -c5 -prepare stmt1 from ' select c5 from t9 where c5 = ? '; -execute stmt1 using @arg00 ; -c5 -select c5 from t9 where c5 <=> NULL ; -c5 -NULL -prepare stmt1 from ' select c5 from t9 where c5 <=> ? '; -execute stmt1 using @arg00 ; -c5 -NULL -delete from t9 where c1= 0 ; -set @arg00='>' ; -select a FROM t1 where a @arg00 1 ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 1' at line 1 -prepare stmt1 from ' select a FROM t1 where a ? 1 ' ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? 1' at line 1 -set @arg00=1 ; -select a,b FROM t1 where a is not NULL -AND b is not NULL group by a - @arg00 ; -a b -1 one -2 two -3 three -4 four -prepare stmt1 from ' select a,b FROM t1 where a is not NULL -AND b is not NULL group by a - ? ' ; -execute stmt1 using @arg00 ; -a b -1 one -2 two -3 three -4 four -set @arg00='two' ; -select a,b FROM t1 where a is not NULL -AND b is not NULL having b <> @arg00 order by a ; -a b -1 one -3 three -4 four -prepare stmt1 from ' select a,b FROM t1 where a is not NULL -AND b is not NULL having b <> ? order by a ' ; -execute stmt1 using @arg00 ; -a b -1 one -3 three -4 four -set @arg00=1 ; -select a,b FROM t1 where a is not NULL -AND b is not NULL order by a - @arg00 ; -a b -1 one -2 two -3 three -4 four -prepare stmt1 from ' select a,b FROM t1 where a is not NULL -AND b is not NULL order by a - ? ' ; -execute stmt1 using @arg00 ; -a b -1 one -2 two -3 three -4 four -set @arg00=2 ; -select a,b from t1 order by 2 ; -a b -4 four -1 one -3 three -2 two -prepare stmt1 from ' select a,b from t1 -order by ? '; -execute stmt1 using @arg00; -a b -4 four -1 one -3 three -2 two -set @arg00=1 ; -execute stmt1 using @arg00; -a b -1 one -2 two -3 three -4 four -set @arg00=0 ; -execute stmt1 using @arg00; -ERROR 42S22: Unknown column '?' in 'order clause' -set @arg00=1; -prepare stmt1 from ' select a,b from t1 order by a -limit 1 '; -execute stmt1 ; -a b -1 one -prepare stmt1 from ' select a,b from t1 -limit ? '; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?' at line 2 -set @arg00='b' ; -set @arg01=0 ; -set @arg02=2 ; -set @arg03=2 ; -select sum(a), @arg00 from t1 where a > @arg01 -and b is not null group by substr(b,@arg02) -having sum(a) <> @arg03 ; -sum(a) @arg00 -3 b -1 b -4 b -prepare stmt1 from ' select sum(a), ? from t1 where a > ? -and b is not null group by substr(b,?) -having sum(a) <> ? '; -execute stmt1 using @arg00, @arg01, @arg02, @arg03; -sum(a) ? -3 b -1 b -4 b -test_sequence ------- join tests ------ -select first.a as a1, second.a as a2 -from t1 first, t1 second -where first.a = second.a order by a1 ; -a1 a2 -1 1 -2 2 -3 3 -4 4 -prepare stmt1 from ' select first.a as a1, second.a as a2 - from t1 first, t1 second - where first.a = second.a order by a1 '; -execute stmt1 ; -a1 a2 -1 1 -2 2 -3 3 -4 4 -set @arg00='ABC'; -set @arg01='two'; -set @arg02='one'; -select first.a, @arg00, second.a FROM t1 first, t1 second -where @arg01 = first.b or first.a = second.a or second.b = @arg02 -order by second.a, first.a; -a @arg00 a -1 ABC 1 -2 ABC 1 -3 ABC 1 -4 ABC 1 -2 ABC 2 -2 ABC 3 -3 ABC 3 -2 ABC 4 -4 ABC 4 -prepare stmt1 from ' select first.a, ?, second.a FROM t1 first, t1 second - where ? = first.b or first.a = second.a or second.b = ? - order by second.a, first.a'; -execute stmt1 using @arg00, @arg01, @arg02; -a ? a -1 ABC 1 -2 ABC 1 -3 ABC 1 -4 ABC 1 -2 ABC 2 -2 ABC 3 -3 ABC 3 -2 ABC 4 -4 ABC 4 -drop table if exists t2 ; -create table t2 as select * from t1 ; -set @query1= 'SELECT * FROM t2 join t1 on (t1.a=t2.a) order by t2.a ' ; -set @query2= 'SELECT * FROM t2 natural join t1 order by t2.a ' ; -set @query3= 'SELECT * FROM t2 join t1 using(a) order by t2.a ' ; -set @query4= 'SELECT * FROM t2 left join t1 on(t1.a=t2.a) order by t2.a ' ; -set @query5= 'SELECT * FROM t2 natural left join t1 order by t2.a ' ; -set @query6= 'SELECT * FROM t2 left join t1 using(a) order by t2.a ' ; -set @query7= 'SELECT * FROM t2 right join t1 on(t1.a=t2.a) order by t2.a ' ; -set @query8= 'SELECT * FROM t2 natural right join t1 order by t2.a ' ; -set @query9= 'SELECT * FROM t2 right join t1 using(a) order by t2.a ' ; -the join statement is: -SELECT * FROM t2 right join t1 using(a) order by t2.a -prepare stmt1 from @query9 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -the join statement is: -SELECT * FROM t2 natural right join t1 order by t2.a -prepare stmt1 from @query8 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -the join statement is: -SELECT * FROM t2 right join t1 on(t1.a=t2.a) order by t2.a -prepare stmt1 from @query7 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -the join statement is: -SELECT * FROM t2 left join t1 using(a) order by t2.a -prepare stmt1 from @query6 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -the join statement is: -SELECT * FROM t2 natural left join t1 order by t2.a -prepare stmt1 from @query5 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -the join statement is: -SELECT * FROM t2 left join t1 on(t1.a=t2.a) order by t2.a -prepare stmt1 from @query4 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -the join statement is: -SELECT * FROM t2 join t1 using(a) order by t2.a -prepare stmt1 from @query3 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -the join statement is: -SELECT * FROM t2 natural join t1 order by t2.a -prepare stmt1 from @query2 ; -execute stmt1 ; -a b -1 one -2 two -3 three -4 four -execute stmt1 ; -a b -1 one -2 two -3 three -4 four -execute stmt1 ; -a b -1 one -2 two -3 three -4 four -the join statement is: -SELECT * FROM t2 join t1 on (t1.a=t2.a) order by t2.a -prepare stmt1 from @query1 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -drop table t2 ; -test_sequence ------- subquery tests ------ -prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where b = ''two'') '; -execute stmt1 ; -a b -2 two -set @arg00='two' ; -select a, b FROM t1 outer_table where -a = (select a from t1 where b = 'two' ) and b=@arg00 ; -a b -2 two -prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where b = ''two'') and b=? '; -execute stmt1 using @arg00; -a b -2 two -set @arg00='two' ; -select a, b FROM t1 outer_table where -a = (select a from t1 where b = @arg00 ) and b='two' ; -a b -2 two -prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where b = ? ) and b=''two'' ' ; -execute stmt1 using @arg00; -a b -2 two -set @arg00=3 ; -set @arg01='three' ; -select a,b FROM t1 where (a,b) in (select 3, 'three'); -a b -3 three -select a FROM t1 where (a,b) in (select @arg00,@arg01); -a -3 -prepare stmt1 from ' select a FROM t1 where (a,b) in (select ?, ?) '; -execute stmt1 using @arg00, @arg01; -a -3 -set @arg00=1 ; -set @arg01='two' ; -set @arg02=2 ; -set @arg03='two' ; -select a, @arg00, b FROM t1 outer_table where -b=@arg01 and a = (select @arg02 from t1 where b = @arg03 ) ; -a @arg00 b -2 1 two -prepare stmt1 from ' select a, ?, b FROM t1 outer_table where - b=? and a = (select ? from t1 where b = ? ) ' ; -execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; -a ? b -2 1 two -prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where b = outer_table.b ) order by a '; -execute stmt1 ; -a b -1 one -2 two -3 three -4 four -prepare stmt1 from ' SELECT a as ccc from t1 where a+1= - (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) '; -execute stmt1 ; -ccc -1 -deallocate prepare stmt1 ; -prepare stmt1 from ' SELECT a as ccc from t1 where a+1= - (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) '; -execute stmt1 ; -ccc -1 -deallocate prepare stmt1 ; -prepare stmt1 from ' SELECT a as ccc from t1 where a+1= - (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) '; -execute stmt1 ; -ccc -1 -deallocate prepare stmt1 ; -set @arg00='two' ; -select a, b FROM t1 outer_table where -a = (select a from t1 where b = outer_table.b ) and b=@arg00 ; -a b -2 two -prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where b = outer_table.b) and b=? '; -execute stmt1 using @arg00; -a b -2 two -set @arg00=2 ; -select a, b FROM t1 outer_table where -a = (select a from t1 where a = @arg00 and b = outer_table.b) and b='two' ; -a b -2 two -prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where a = ? and b = outer_table.b) and b=''two'' ' ; -execute stmt1 using @arg00; -a b -2 two -set @arg00=2 ; -select a, b FROM t1 outer_table where -a = (select a from t1 where outer_table.a = @arg00 and a=2) and b='two' ; -a b -2 two -prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where outer_table.a = ? and a=2) and b=''two'' ' ; -execute stmt1 using @arg00; -a b -2 two -set @arg00=1 ; -set @arg01='two' ; -set @arg02=2 ; -set @arg03='two' ; -select a, @arg00, b FROM t1 outer_table where -b=@arg01 and a = (select @arg02 from t1 where outer_table.b = @arg03 -and outer_table.a=a ) ; -a @arg00 b -2 1 two -prepare stmt1 from ' select a, ?, b FROM t1 outer_table where - b=? and a = (select ? from t1 where outer_table.b = ? - and outer_table.a=a ) ' ; -execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; -a ? b -2 1 two -set @arg00=1 ; -set @arg01=0 ; -select a, @arg00 -from ( select a - @arg00 as a from t1 where a=@arg00 ) as t2 -where a=@arg01; -a @arg00 -0 1 -prepare stmt1 from ' select a, ? - from ( select a - ? as a from t1 where a=? ) as t2 - where a=? '; -execute stmt1 using @arg00, @arg00, @arg00, @arg01 ; -a ? -0 1 -drop table if exists t2 ; -create table t2 as select * from t1; -prepare stmt1 from ' select a in (select a from t2) from t1 ' ; -execute stmt1 ; -a in (select a from t2) -1 -1 -1 -1 -drop table if exists t5, t6, t7 ; -create table t5 (a int , b int) ; -create table t6 like t5 ; -create table t7 like t5 ; -insert into t5 values (0, 100), (1, 2), (1, 3), (2, 2), (2, 7), -(2, -1), (3, 10) ; -insert into t6 values (0, 0), (1, 1), (2, 1), (3, 1), (4, 1) ; -insert into t7 values (3, 3), (2, 2), (1, 1) ; -prepare stmt1 from ' select a, (select count(distinct t5.b) as sum from t5, t6 - where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b - group by t5.a order by sum limit 1) from t7 ' ; -execute stmt1 ; -a (select count(distinct t5.b) as sum from t5, t6 - where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b - group by t5.a order by sum limit 1) -3 1 -2 2 -1 2 -execute stmt1 ; -a (select count(distinct t5.b) as sum from t5, t6 - where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b - group by t5.a order by sum limit 1) -3 1 -2 2 -1 2 -execute stmt1 ; -a (select count(distinct t5.b) as sum from t5, t6 - where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b - group by t5.a order by sum limit 1) -3 1 -2 2 -1 2 -drop table t5, t6, t7 ; -drop table if exists t2 ; -create table t2 as select * from t9; -set @stmt= ' SELECT - (SELECT SUM(c1 + c12 + 0.0) FROM t2 - where (t9.c2 - 0e-3) = t2.c2 - GROUP BY t9.c15 LIMIT 1) as scalar_s, - exists (select 1.0e+0 from t2 - where t2.c3 * 9.0000000000 = t9.c4) as exists_s, - c5 * 4 in (select c6 + 0.3e+1 from t2) as in_s, - (c7 - 4, c8 - 4) in (select c9 + 4.0, c10 + 40e-1 from t2) as in_row_s -FROM t9, -(select c25 x, c32 y from t2) tt WHERE x = c25 ' ; -prepare stmt1 from @stmt ; -execute stmt1 ; -execute stmt1 ; -set @stmt= concat('explain ',@stmt); -prepare stmt1 from @stmt ; -execute stmt1 ; -execute stmt1 ; -set @stmt= ' SELECT - (SELECT SUM(c1+c12+?) FROM t2 where (t9.c2-?)=t2.c2 - GROUP BY t9.c15 LIMIT 1) as scalar_s, - exists (select ? from t2 - where t2.c3*?=t9.c4) as exists_s, - c5*? in (select c6+? from t2) as in_s, - (c7-?, c8-?) in (select c9+?, c10+? from t2) as in_row_s -FROM t9, -(select c25 x, c32 y from t2) tt WHERE x =c25 ' ; -set @arg00= 0.0 ; -set @arg01= 0e-3 ; -set @arg02= 1.0e+0 ; -set @arg03= 9.0000000000 ; -set @arg04= 4 ; -set @arg05= 0.3e+1 ; -set @arg06= 4 ; -set @arg07= 4 ; -set @arg08= 4.0 ; -set @arg09= 40e-1 ; -prepare stmt1 from @stmt ; -execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, -@arg07, @arg08, @arg09 ; -execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, -@arg07, @arg08, @arg09 ; -set @stmt= concat('explain ',@stmt); -prepare stmt1 from @stmt ; -execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, -@arg07, @arg08, @arg09 ; -execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, -@arg07, @arg08, @arg09 ; -drop table t2 ; -select 1 < (select a from t1) ; -ERROR 21000: Subquery returns more than 1 row -prepare stmt1 from ' select 1 < (select a from t1) ' ; -execute stmt1 ; -ERROR 21000: Subquery returns more than 1 row -select 1 as my_col ; -my_col -1 -test_sequence ------- union tests ------ -prepare stmt1 from ' select a FROM t1 where a=1 - union distinct - select a FROM t1 where a=1 '; -execute stmt1 ; -a -1 -execute stmt1 ; -a -1 -prepare stmt1 from ' select a FROM t1 where a=1 - union all - select a FROM t1 where a=1 '; -execute stmt1 ; -a -1 -1 -prepare stmt1 from ' SELECT 1, 2 union SELECT 1 ' ; -ERROR 21000: The used SELECT statements have a different number of columns -prepare stmt1 from ' SELECT 1 union SELECT 1, 2 ' ; -ERROR 21000: The used SELECT statements have a different number of columns -prepare stmt1 from ' SELECT * from t1 union SELECT 1 ' ; -ERROR 21000: The used SELECT statements have a different number of columns -prepare stmt1 from ' SELECT 1 union SELECT * from t1 ' ; -ERROR 21000: The used SELECT statements have a different number of columns -set @arg00=1 ; -select @arg00 FROM t1 where a=1 -union distinct -select 1 FROM t1 where a=1; -@arg00 -1 -prepare stmt1 from ' select ? FROM t1 where a=1 - union distinct - select 1 FROM t1 where a=1 ' ; -execute stmt1 using @arg00; -? -1 -set @arg00=1 ; -select 1 FROM t1 where a=1 -union distinct -select @arg00 FROM t1 where a=1; -1 -1 -prepare stmt1 from ' select 1 FROM t1 where a=1 - union distinct - select ? FROM t1 where a=1 ' ; -execute stmt1 using @arg00; -1 -1 -set @arg00='a' ; -select @arg00 FROM t1 where a=1 -union distinct -select @arg00 FROM t1 where a=1; -@arg00 -a -prepare stmt1 from ' select ? FROM t1 where a=1 - union distinct - select ? FROM t1 where a=1 '; -execute stmt1 using @arg00, @arg00; -? -a -prepare stmt1 from ' select ? - union distinct - select ? '; -execute stmt1 using @arg00, @arg00; -? -a -set @arg00='a' ; -set @arg01=1 ; -set @arg02='a' ; -set @arg03=2 ; -select @arg00 FROM t1 where a=@arg01 -union distinct -select @arg02 FROM t1 where a=@arg03; -@arg00 -a -prepare stmt1 from ' select ? FROM t1 where a=? - union distinct - select ? FROM t1 where a=? ' ; -execute stmt1 using @arg00, @arg01, @arg02, @arg03; -? -a -set @arg00=1 ; -prepare stmt1 from ' select sum(a) + 200, ? from t1 -union distinct -select sum(a) + 200, 1 from t1 -group by b ' ; -execute stmt1 using @arg00; -sum(a) + 200 ? -210 1 -204 1 -201 1 -203 1 -202 1 -set @Oporto='Oporto' ; -set @Lisboa='Lisboa' ; -set @0=0 ; -set @1=1 ; -set @2=2 ; -set @3=3 ; -set @4=4 ; -select @Oporto,@Lisboa,@0,@1,@2,@3,@4 ; -@Oporto @Lisboa @0 @1 @2 @3 @4 -Oporto Lisboa 0 1 2 3 4 -select sum(a) + 200 as the_sum, @Oporto as the_town from t1 -group by b -union distinct -select sum(a) + 200, @Lisboa from t1 -group by b ; -the_sum the_town -204 Oporto -201 Oporto -203 Oporto -202 Oporto -204 Lisboa -201 Lisboa -203 Lisboa -202 Lisboa -prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1 - group by b - union distinct - select sum(a) + 200, ? from t1 - group by b ' ; -execute stmt1 using @Oporto, @Lisboa; -the_sum the_town -204 Oporto -201 Oporto -203 Oporto -202 Oporto -204 Lisboa -201 Lisboa -203 Lisboa -202 Lisboa -select sum(a) + 200 as the_sum, @Oporto as the_town from t1 -where a > @1 -group by b -union distinct -select sum(a) + 200, @Lisboa from t1 -where a > @2 -group by b ; -the_sum the_town -204 Oporto -203 Oporto -202 Oporto -204 Lisboa -203 Lisboa -prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1 - where a > ? - group by b - union distinct - select sum(a) + 200, ? from t1 - where a > ? - group by b ' ; -execute stmt1 using @Oporto, @1, @Lisboa, @2; -the_sum the_town -204 Oporto -203 Oporto -202 Oporto -204 Lisboa -203 Lisboa -select sum(a) + 200 as the_sum, @Oporto as the_town from t1 -where a > @1 -group by b -having avg(a) > @2 -union distinct -select sum(a) + 200, @Lisboa from t1 -where a > @2 -group by b -having avg(a) > @3; -the_sum the_town -204 Oporto -203 Oporto -204 Lisboa -prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1 - where a > ? - group by b - having avg(a) > ? - union distinct - select sum(a) + 200, ? from t1 - where a > ? - group by b - having avg(a) > ? '; -execute stmt1 using @Oporto, @1, @2, @Lisboa, @2, @3; -the_sum the_town -204 Oporto -203 Oporto -204 Lisboa -test_sequence ------- explain select tests ------ -prepare stmt1 from ' explain select * from t9 ' ; -execute stmt1; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def id 8 3 1 N 32801 0 8 -def select_type 253 19 6 N 1 31 33 -def table 253 64 2 N 1 31 33 -def type 253 10 3 N 1 31 33 -def possible_keys 253 4096 0 Y 0 31 33 -def key 253 64 0 Y 0 31 33 -def key_len 8 3 0 Y 32800 0 8 -def ref 253 1024 0 Y 0 31 33 -def rows 8 10 1 N 32801 0 8 -def Extra 253 255 0 N 1 31 33 -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t9 ALL NULL NULL NULL NULL 2 -test_sequence ------- delete tests ------ -delete from t1 ; -insert into t1 values (1,'one'); -insert into t1 values (2,'two'); -insert into t1 values (3,'three'); -insert into t1 values (4,'four'); -commit ; -delete from t9 ; -insert into t9 -set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, -c10= 1, c11= 1, c12 = 1, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=true, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t9 -set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, -c10= 9, c11= 9, c12 = 9, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=false, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; -commit ; -prepare stmt1 from 'delete from t1 where a=2' ; -execute stmt1; -select a,b from t1 where a=2; -a b -execute stmt1; -insert into t1 values(0,NULL); -set @arg00=NULL; -prepare stmt1 from 'delete from t1 where b=?' ; -execute stmt1 using @arg00; -select a,b from t1 where b is NULL ; -a b -0 NULL -set @arg00='one'; -execute stmt1 using @arg00; -select a,b from t1 where b=@arg00; -a b -prepare stmt1 from 'truncate table t1' ; -ERROR HY000: This command is not supported in the prepared statement protocol yet -test_sequence ------- update tests ------ -delete from t1 ; -insert into t1 values (1,'one'); -insert into t1 values (2,'two'); -insert into t1 values (3,'three'); -insert into t1 values (4,'four'); -commit ; -delete from t9 ; -insert into t9 -set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, -c10= 1, c11= 1, c12 = 1, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=true, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t9 -set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, -c10= 9, c11= 9, c12 = 9, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=false, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; -commit ; -prepare stmt1 from 'update t1 set b=''a=two'' where a=2' ; -execute stmt1; -select a,b from t1 where a=2; -a b -2 a=two -execute stmt1; -select a,b from t1 where a=2; -a b -2 a=two -set @arg00=NULL; -prepare stmt1 from 'update t1 set b=? where a=2' ; -execute stmt1 using @arg00; -select a,b from t1 where a=2; -a b -2 NULL -set @arg00='two'; -execute stmt1 using @arg00; -select a,b from t1 where a=2; -a b -2 two -set @arg00=2; -prepare stmt1 from 'update t1 set b=NULL where a=?' ; -execute stmt1 using @arg00; -select a,b from t1 where a=@arg00; -a b -2 NULL -update t1 set b='two' where a=@arg00; -set @arg00=2000; -execute stmt1 using @arg00; -select a,b from t1 where a=@arg00; -a b -set @arg00=2; -set @arg01=22; -prepare stmt1 from 'update t1 set a=? where a=?' ; -execute stmt1 using @arg00, @arg00; -select a,b from t1 where a=@arg00; -a b -2 two -execute stmt1 using @arg01, @arg00; -select a,b from t1 where a=@arg01; -a b -22 two -execute stmt1 using @arg00, @arg01; -select a,b from t1 where a=@arg00; -a b -2 two -set @arg00=NULL; -set @arg01=2; -execute stmt1 using @arg00, @arg01; -Warnings: -Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 1 -select a,b from t1 order by a; -a b -0 two -1 one -3 three -4 four -set @arg00=0; -execute stmt1 using @arg01, @arg00; -select a,b from t1 order by a; -a b -1 one -2 two -3 three -4 four -set @arg00=23; -set @arg01='two'; -set @arg02=2; -set @arg03='two'; -set @arg04=2; -drop table if exists t2; -create table t2 as select a,b from t1 ; -prepare stmt1 from 'update t1 set a=? where b=? - and a in (select ? from t2 - where b = ? or a = ?)'; -execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04 ; -affected rows: 1 -info: Rows matched: 1 Changed: 1 Warnings: 0 -select a,b from t1 where a = @arg00 ; -a b -23 two -prepare stmt1 from 'update t1 set a=? where b=? - and a not in (select ? from t2 - where b = ? or a = ?)'; -execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ; -affected rows: 1 -info: Rows matched: 1 Changed: 1 Warnings: 0 -select a,b from t1 order by a ; -a b -1 one -2 two -3 three -4 four -drop table t2 ; -create table t2 -( -a int, b varchar(30), -primary key(a) -) engine = 'MYISAM' ; -insert into t2(a,b) select a, b from t1 ; -prepare stmt1 from 'update t1 set a=? where b=? - and a in (select ? from t2 - where b = ? or a = ?)'; -execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04 ; -affected rows: 1 -info: Rows matched: 1 Changed: 1 Warnings: 0 -select a,b from t1 where a = @arg00 ; -a b -23 two -prepare stmt1 from 'update t1 set a=? where b=? - and a not in (select ? from t2 - where b = ? or a = ?)'; -execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ; -affected rows: 1 -info: Rows matched: 1 Changed: 1 Warnings: 0 -select a,b from t1 order by a ; -a b -1 one -2 two -3 three -4 four -drop table t2 ; -set @arg00=1; -prepare stmt1 from 'update t1 set b=''bla'' -where a=2 -limit 1'; -execute stmt1 ; -select a,b from t1 where b = 'bla' ; -a b -2 bla -prepare stmt1 from 'update t1 set b=''bla'' -where a=2 -limit ?'; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?' at line 3 -test_sequence ------- insert tests ------ -delete from t1 ; -insert into t1 values (1,'one'); -insert into t1 values (2,'two'); -insert into t1 values (3,'three'); -insert into t1 values (4,'four'); -commit ; -delete from t9 ; -insert into t9 -set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, -c10= 1, c11= 1, c12 = 1, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=true, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t9 -set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, -c10= 9, c11= 9, c12 = 9, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=false, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; -commit ; -prepare stmt1 from 'insert into t1 values(5, ''five'' )'; -execute stmt1; -select a,b from t1 where a = 5; -a b -5 five -set @arg00='six' ; -prepare stmt1 from 'insert into t1 values(6, ? )'; -execute stmt1 using @arg00; -select a,b from t1 where b = @arg00; -a b -6 six -execute stmt1 using @arg00; -ERROR 23000: Duplicate entry '6' for key 1 -set @arg00=NULL ; -prepare stmt1 from 'insert into t1 values(0, ? )'; -execute stmt1 using @arg00; -select a,b from t1 where b is NULL; -a b -0 NULL -set @arg00=8 ; -set @arg01='eight' ; -prepare stmt1 from 'insert into t1 values(?, ? )'; -execute stmt1 using @arg00, @arg01 ; -select a,b from t1 where b = @arg01; -a b -8 eight -set @NULL= null ; -set @arg00= 'abc' ; -execute stmt1 using @NULL, @NULL ; -ERROR 23000: Column 'a' cannot be null -execute stmt1 using @NULL, @NULL ; -ERROR 23000: Column 'a' cannot be null -execute stmt1 using @NULL, @arg00 ; -ERROR 23000: Column 'a' cannot be null -execute stmt1 using @NULL, @arg00 ; -ERROR 23000: Column 'a' cannot be null -set @arg01= 10000 + 2 ; -execute stmt1 using @arg01, @arg00 ; -set @arg01= 10000 + 1 ; -execute stmt1 using @arg01, @arg00 ; -select * from t1 where a > 10000 order by a ; -a b -10001 abc -10002 abc -delete from t1 where a > 10000 ; -set @arg01= 10000 + 2 ; -execute stmt1 using @arg01, @NULL ; -set @arg01= 10000 + 1 ; -execute stmt1 using @arg01, @NULL ; -select * from t1 where a > 10000 order by a ; -a b -10001 NULL -10002 NULL -delete from t1 where a > 10000 ; -set @arg01= 10000 + 10 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 9 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 8 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 7 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 6 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 5 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 4 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 3 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 2 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 1 ; -execute stmt1 using @arg01, @arg01 ; -select * from t1 where a > 10000 order by a ; -a b -10001 10001 -10002 10002 -10003 10003 -10004 10004 -10005 10005 -10006 10006 -10007 10007 -10008 10008 -10009 10009 -10010 10010 -delete from t1 where a > 10000 ; -set @arg00=81 ; -set @arg01='8-1' ; -set @arg02=82 ; -set @arg03='8-2' ; -prepare stmt1 from 'insert into t1 values(?,?),(?,?)'; -execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; -select a,b from t1 where a in (@arg00,@arg02) ; -a b -81 8-1 -82 8-2 -set @arg00=9 ; -set @arg01='nine' ; -prepare stmt1 from 'insert into t1 set a=?, b=? '; -execute stmt1 using @arg00, @arg01 ; -select a,b from t1 where a = @arg00 ; -a b -9 nine -set @arg00=6 ; -set @arg01=1 ; -prepare stmt1 from 'insert into t1 set a=?, b=''sechs'' - on duplicate key update a=a + ?, b=concat(b,''modified'') '; -execute stmt1 using @arg00, @arg01; -select * from t1 order by a; -a b -0 NULL -1 one -2 two -3 three -4 four -5 five -7 sixmodified -8 eight -9 nine -81 8-1 -82 8-2 -set @arg00=81 ; -set @arg01=1 ; -execute stmt1 using @arg00, @arg01; -ERROR 23000: Duplicate entry '82' for key 1 -drop table if exists t2 ; -create table t2 (id int auto_increment primary key) -ENGINE= 'MYISAM' ; -prepare stmt1 from ' select last_insert_id() ' ; -insert into t2 values (NULL) ; -execute stmt1 ; -last_insert_id() -1 -insert into t2 values (NULL) ; -execute stmt1 ; -last_insert_id() -2 -drop table t2 ; -set @1000=1000 ; -set @x1000_2="x1000_2" ; -set @x1000_3="x1000_3" ; -set @x1000="x1000" ; -set @1100=1100 ; -set @x1100="x1100" ; -set @100=100 ; -set @updated="updated" ; -insert into t1 values(1000,'x1000_1') ; -insert into t1 values(@1000,@x1000_2),(@1000,@x1000_3) -on duplicate key update a = a + @100, b = concat(b,@updated) ; -select a,b from t1 where a >= 1000 order by a ; -a b -1000 x1000_3 -1100 x1000_1updated -delete from t1 where a >= 1000 ; -insert into t1 values(1000,'x1000_1') ; -prepare stmt1 from ' insert into t1 values(?,?),(?,?) - on duplicate key update a = a + ?, b = concat(b,?) '; -execute stmt1 using @1000, @x1000_2, @1000, @x1000_3, @100, @updated ; -select a,b from t1 where a >= 1000 order by a ; -a b -1000 x1000_3 -1100 x1000_1updated -delete from t1 where a >= 1000 ; -insert into t1 values(1000,'x1000_1') ; -execute stmt1 using @1000, @x1000_2, @1100, @x1000_3, @100, @updated ; -select a,b from t1 where a >= 1000 order by a ; -a b -1200 x1000_1updatedupdated -delete from t1 where a >= 1000 ; -prepare stmt1 from ' replace into t1 (a,b) select 100, ''hundred'' '; -execute stmt1; -execute stmt1; -execute stmt1; -test_sequence ------- multi table tests ------ -delete from t1 ; -delete from t9 ; -insert into t1(a,b) values (1, 'one'), (2, 'two'), (3, 'three') ; -insert into t9 (c1,c21) -values (1, 'one'), (2, 'two'), (3, 'three') ; -prepare stmt_delete from " delete t1, t9 - from t1, t9 where t1.a=t9.c1 and t1.b='updated' "; -prepare stmt_update from " update t1, t9 - set t1.b='updated', t9.c21='updated' - where t1.a=t9.c1 and t1.a=? "; -prepare stmt_select1 from " select a, b from t1 order by a" ; -prepare stmt_select2 from " select c1, c21 from t9 order by c1" ; -set @arg00= 1 ; -execute stmt_update using @arg00 ; -execute stmt_delete ; -execute stmt_select1 ; -a b -2 two -3 three -execute stmt_select2 ; -c1 c21 -2 two -3 three -set @arg00= @arg00 + 1 ; -execute stmt_update using @arg00 ; -execute stmt_delete ; -execute stmt_select1 ; -a b -3 three -execute stmt_select2 ; -c1 c21 -3 three -set @arg00= @arg00 + 1 ; -execute stmt_update using @arg00 ; -execute stmt_delete ; -execute stmt_select1 ; -a b -execute stmt_select2 ; -c1 c21 -set @arg00= @arg00 + 1 ; -drop table if exists t5 ; -set @arg01= 8; -set @arg02= 8.0; -set @arg03= 80.00000000000e-1; -set @arg04= 'abc' ; -set @arg05= CAST('abc' as binary) ; -set @arg06= '1991-08-05' ; -set @arg07= CAST('1991-08-05' as date); -set @arg08= '1991-08-05 01:01:01' ; -set @arg09= CAST('1991-08-05 01:01:01' as datetime) ; -set @arg10= unix_timestamp('1991-01-01 01:01:01'); -set @arg11= YEAR('1991-01-01 01:01:01'); -set @arg12= 8 ; -set @arg12= NULL ; -set @arg13= 8.0 ; -set @arg13= NULL ; -set @arg14= 'abc'; -set @arg14= NULL ; -set @arg15= CAST('abc' as binary) ; -set @arg15= NULL ; -create table t5 as select -8 as const01, @arg01 as param01, -8.0 as const02, @arg02 as param02, -80.00000000000e-1 as const03, @arg03 as param03, -'abc' as const04, @arg04 as param04, -CAST('abc' as binary) as const05, @arg05 as param05, -'1991-08-05' as const06, @arg06 as param06, -CAST('1991-08-05' as date) as const07, @arg07 as param07, -'1991-08-05 01:01:01' as const08, @arg08 as param08, -CAST('1991-08-05 01:01:01' as datetime) as const09, @arg09 as param09, -unix_timestamp('1991-01-01 01:01:01') as const10, @arg10 as param10, -YEAR('1991-01-01 01:01:01') as const11, @arg11 as param11, -NULL as const12, @arg12 as param12, -@arg13 as param13, -@arg14 as param14, -@arg15 as param15; -show create table t5 ; -Table Create Table -t5 CREATE TABLE `t5` ( - `const01` bigint(1) NOT NULL default '0', - `param01` bigint(20) default NULL, - `const02` double(3,1) NOT NULL default '0.0', - `param02` double default NULL, - `const03` double NOT NULL default '0', - `param03` double default NULL, - `const04` char(3) NOT NULL default '', - `param04` longtext, - `const05` binary(3) NOT NULL default '', - `param05` longblob, - `const06` varchar(10) NOT NULL default '', - `param06` longtext, - `const07` date default NULL, - `param07` longblob, - `const08` varchar(19) NOT NULL default '', - `param08` longtext, - `const09` datetime default NULL, - `param09` longblob, - `const10` int(10) NOT NULL default '0', - `param10` bigint(20) default NULL, - `const11` int(4) default NULL, - `param11` bigint(20) default NULL, - `const12` binary(0) default NULL, - `param12` bigint(20) default NULL, - `param13` double default NULL, - `param14` longtext, - `param15` longblob -) ENGINE=MyISAM DEFAULT CHARSET=latin1 -select * from t5 ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def test t5 t5 const01 const01 8 1 1 N 32769 0 63 -def test t5 t5 param01 param01 8 20 1 Y 32768 0 63 -def test t5 t5 const02 const02 5 3 3 N 32769 1 63 -def test t5 t5 param02 param02 5 20 1 Y 32768 31 63 -def test t5 t5 const03 const03 5 23 1 N 32769 31 63 -def test t5 t5 param03 param03 5 20 1 Y 32768 31 63 -def test t5 t5 const04 const04 254 3 3 N 1 0 8 -def test t5 t5 param04 param04 252 16777215 3 Y 16 0 8 -def test t5 t5 const05 const05 254 3 3 N 129 0 63 -def test t5 t5 param05 param05 252 16777215 3 Y 144 0 63 -def test t5 t5 const06 const06 253 10 10 N 1 0 8 -def test t5 t5 param06 param06 252 16777215 10 Y 16 0 8 -def test t5 t5 const07 const07 10 10 10 Y 128 0 63 -def test t5 t5 param07 param07 252 16777215 10 Y 144 0 63 -def test t5 t5 const08 const08 253 19 19 N 1 0 8 -def test t5 t5 param08 param08 252 16777215 19 Y 16 0 8 -def test t5 t5 const09 const09 12 19 19 Y 128 0 63 -def test t5 t5 param09 param09 252 16777215 19 Y 144 0 63 -def test t5 t5 const10 const10 3 10 9 N 32769 0 63 -def test t5 t5 param10 param10 8 20 9 Y 32768 0 63 -def test t5 t5 const11 const11 3 4 4 Y 32768 0 63 -def test t5 t5 param11 param11 8 20 4 Y 32768 0 63 -def test t5 t5 const12 const12 254 0 0 Y 128 0 63 -def test t5 t5 param12 param12 8 20 0 Y 32768 0 63 -def test t5 t5 param13 param13 5 20 0 Y 32768 31 63 -def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8 -def test t5 t5 param15 param15 252 16777215 0 Y 144 0 63 -const01 8 -param01 8 -const02 8.0 -param02 8 -const03 8 -param03 8 -const04 abc -param04 abc -const05 abc -param05 abc -const06 1991-08-05 -param06 1991-08-05 -const07 1991-08-05 -param07 1991-08-05 -const08 1991-08-05 01:01:01 -param08 1991-08-05 01:01:01 -const09 1991-08-05 01:01:01 -param09 1991-08-05 01:01:01 -const10 662680861 -param10 662680861 -const11 1991 -param11 1991 -const12 NULL -param12 NULL -param13 NULL -param14 NULL -param15 NULL -drop table t5 ; -test_sequence ------- data type conversion tests ------ -delete from t1 ; -insert into t1 values (1,'one'); -insert into t1 values (2,'two'); -insert into t1 values (3,'three'); -insert into t1 values (4,'four'); -commit ; -delete from t9 ; -insert into t9 -set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, -c10= 1, c11= 1, c12 = 1, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=true, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t9 -set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, -c10= 9, c11= 9, c12 = 9, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=false, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; -commit ; -insert into t9 set c1= 0, c15= '1991-01-01 01:01:01' ; -select * from t9 order by c1 ; -c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32 -0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday -test_sequence ------- select @parameter:= column ------ -prepare full_info from "select @arg01, @arg02, @arg03, @arg04, - @arg05, @arg06, @arg07, @arg08, - @arg09, @arg10, @arg11, @arg12, - @arg13, @arg14, @arg15, @arg16, - @arg17, @arg18, @arg19, @arg20, - @arg21, @arg22, @arg23, @arg24, - @arg25, @arg26, @arg27, @arg28, - @arg29, @arg30, @arg31, @arg32" ; -select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, -@arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8, -@arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12, -@arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16, -@arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20, -@arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24, -@arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28, -@arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32 -from t9 where c1= 1 ; -@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 -1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 1 Y 128 31 63 -def @arg03 254 20 1 Y 128 31 63 -def @arg04 254 20 1 Y 128 31 63 -def @arg05 254 20 1 Y 128 31 63 -def @arg06 254 20 1 Y 128 31 63 -def @arg07 254 20 1 Y 128 31 63 -def @arg08 254 20 1 Y 128 31 63 -def @arg09 254 20 1 Y 128 31 63 -def @arg10 254 20 1 Y 128 31 63 -def @arg11 254 20 1 Y 128 31 63 -def @arg12 254 20 1 Y 128 31 63 -def @arg13 254 8192 10 Y 128 31 63 -def @arg14 254 8192 19 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 8 Y 128 31 63 -def @arg17 254 20 4 Y 128 31 63 -def @arg18 254 20 1 Y 128 31 63 -def @arg19 254 20 1 Y 128 31 63 -def @arg20 254 8192 1 Y 0 31 8 -def @arg21 254 8192 10 Y 0 31 8 -def @arg22 254 8192 30 Y 0 31 8 -def @arg23 254 8192 8 Y 128 31 63 -def @arg24 254 8192 8 Y 0 31 8 -def @arg25 254 8192 4 Y 128 31 63 -def @arg26 254 8192 4 Y 0 31 8 -def @arg27 254 8192 10 Y 128 31 63 -def @arg28 254 8192 10 Y 0 31 8 -def @arg29 254 8192 8 Y 128 31 63 -def @arg30 254 8192 8 Y 0 31 8 -def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, -@arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8, -@arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12, -@arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16, -@arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20, -@arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24, -@arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28, -@arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32 -from t9 where c1= 0 ; -@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 -0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 0 Y 128 31 63 -def @arg03 254 20 0 Y 128 31 63 -def @arg04 254 20 0 Y 128 31 63 -def @arg05 254 20 0 Y 128 31 63 -def @arg06 254 20 0 Y 128 31 63 -def @arg07 254 20 0 Y 128 31 63 -def @arg08 254 20 0 Y 128 31 63 -def @arg09 254 20 0 Y 128 31 63 -def @arg10 254 20 0 Y 128 31 63 -def @arg11 254 20 0 Y 128 31 63 -def @arg12 254 20 0 Y 128 31 63 -def @arg13 254 8192 0 Y 128 31 63 -def @arg14 254 8192 0 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 0 Y 128 31 63 -def @arg17 254 20 0 Y 128 31 63 -def @arg18 254 20 0 Y 128 31 63 -def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 0 31 8 -def @arg21 254 8192 0 Y 0 31 8 -def @arg22 254 8192 0 Y 0 31 8 -def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 0 31 8 -def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 0 31 8 -def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 0 31 8 -def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 0 31 8 -def @arg31 254 8192 0 Y 0 31 8 -def @arg32 254 8192 0 Y 0 31 8 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -prepare stmt1 from "select - @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, - @arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8, - @arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12, - @arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16, - @arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20, - @arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24, - @arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28, - @arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32 -from t9 where c1= ?" ; -set @my_key= 1 ; -execute stmt1 using @my_key ; -@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 -1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 1 Y 128 31 63 -def @arg03 254 20 1 Y 128 31 63 -def @arg04 254 20 1 Y 128 31 63 -def @arg05 254 20 1 Y 128 31 63 -def @arg06 254 20 1 Y 128 31 63 -def @arg07 254 20 1 Y 128 31 63 -def @arg08 254 20 1 Y 128 31 63 -def @arg09 254 20 1 Y 128 31 63 -def @arg10 254 20 1 Y 128 31 63 -def @arg11 254 20 1 Y 128 31 63 -def @arg12 254 20 1 Y 128 31 63 -def @arg13 254 8192 10 Y 128 31 63 -def @arg14 254 8192 19 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 8 Y 128 31 63 -def @arg17 254 20 4 Y 128 31 63 -def @arg18 254 20 1 Y 128 31 63 -def @arg19 254 20 1 Y 128 31 63 -def @arg20 254 8192 1 Y 0 31 8 -def @arg21 254 8192 10 Y 0 31 8 -def @arg22 254 8192 30 Y 0 31 8 -def @arg23 254 8192 8 Y 128 31 63 -def @arg24 254 8192 8 Y 0 31 8 -def @arg25 254 8192 4 Y 128 31 63 -def @arg26 254 8192 4 Y 0 31 8 -def @arg27 254 8192 10 Y 128 31 63 -def @arg28 254 8192 10 Y 0 31 8 -def @arg29 254 8192 8 Y 128 31 63 -def @arg30 254 8192 8 Y 0 31 8 -def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -set @my_key= 0 ; -execute stmt1 using @my_key ; -@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 -0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 0 Y 128 31 63 -def @arg03 254 20 0 Y 128 31 63 -def @arg04 254 20 0 Y 128 31 63 -def @arg05 254 20 0 Y 128 31 63 -def @arg06 254 20 0 Y 128 31 63 -def @arg07 254 20 0 Y 128 31 63 -def @arg08 254 20 0 Y 128 31 63 -def @arg09 254 20 0 Y 128 31 63 -def @arg10 254 20 0 Y 128 31 63 -def @arg11 254 20 0 Y 128 31 63 -def @arg12 254 20 0 Y 128 31 63 -def @arg13 254 8192 0 Y 128 31 63 -def @arg14 254 8192 0 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 0 Y 128 31 63 -def @arg17 254 20 0 Y 128 31 63 -def @arg18 254 20 0 Y 128 31 63 -def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 0 31 8 -def @arg21 254 8192 0 Y 0 31 8 -def @arg22 254 8192 0 Y 0 31 8 -def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 0 31 8 -def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 0 31 8 -def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 0 31 8 -def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 0 31 8 -def @arg31 254 8192 0 Y 0 31 8 -def @arg32 254 8192 0 Y 0 31 8 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -prepare stmt1 from "select ? := c1 from t9 where c1= 1" ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':= c1 from t9 where c1= 1' at line 1 -test_sequence ------- select column, .. into @parm,.. ------ -select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, -c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, -c25, c26, c27, c28, c29, c30, c31, c32 -into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, -@arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, -@arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24, -@arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 -from t9 where c1= 1 ; -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 1 Y 128 31 63 -def @arg03 254 20 1 Y 128 31 63 -def @arg04 254 20 1 Y 128 31 63 -def @arg05 254 20 1 Y 128 31 63 -def @arg06 254 20 1 Y 128 31 63 -def @arg07 254 20 1 Y 128 31 63 -def @arg08 254 20 1 Y 128 31 63 -def @arg09 254 20 1 Y 128 31 63 -def @arg10 254 20 1 Y 128 31 63 -def @arg11 254 20 1 Y 128 31 63 -def @arg12 254 20 1 Y 128 31 63 -def @arg13 254 8192 10 Y 128 31 63 -def @arg14 254 8192 19 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 8 Y 128 31 63 -def @arg17 254 20 4 Y 128 31 63 -def @arg18 254 20 1 Y 128 31 63 -def @arg19 254 20 1 Y 128 31 63 -def @arg20 254 8192 1 Y 0 31 8 -def @arg21 254 8192 10 Y 0 31 8 -def @arg22 254 8192 30 Y 0 31 8 -def @arg23 254 8192 8 Y 128 31 63 -def @arg24 254 8192 8 Y 0 31 8 -def @arg25 254 8192 4 Y 128 31 63 -def @arg26 254 8192 4 Y 0 31 8 -def @arg27 254 8192 10 Y 128 31 63 -def @arg28 254 8192 10 Y 0 31 8 -def @arg29 254 8192 8 Y 128 31 63 -def @arg30 254 8192 8 Y 0 31 8 -def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, -c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, -c25, c26, c27, c28, c29, c30, c31, c32 -into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, -@arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, -@arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24, -@arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 -from t9 where c1= 0 ; -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 0 Y 128 31 63 -def @arg03 254 20 0 Y 128 31 63 -def @arg04 254 20 0 Y 128 31 63 -def @arg05 254 20 0 Y 128 31 63 -def @arg06 254 20 0 Y 128 31 63 -def @arg07 254 20 0 Y 128 31 63 -def @arg08 254 20 0 Y 128 31 63 -def @arg09 254 20 0 Y 128 31 63 -def @arg10 254 20 0 Y 128 31 63 -def @arg11 254 20 0 Y 128 31 63 -def @arg12 254 20 0 Y 128 31 63 -def @arg13 254 8192 0 Y 128 31 63 -def @arg14 254 8192 0 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 0 Y 128 31 63 -def @arg17 254 20 0 Y 128 31 63 -def @arg18 254 20 0 Y 128 31 63 -def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 0 31 8 -def @arg21 254 8192 0 Y 0 31 8 -def @arg22 254 8192 0 Y 0 31 8 -def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 0 31 8 -def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 0 31 8 -def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 0 31 8 -def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 0 31 8 -def @arg31 254 8192 0 Y 0 31 8 -def @arg32 254 8192 0 Y 0 31 8 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -prepare stmt1 from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, - c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, - c25, c26, c27, c28, c29, c30, c31, c32 -into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, - @arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, - @arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24, - @arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 -from t9 where c1= ?" ; -set @my_key= 1 ; -execute stmt1 using @my_key ; -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 1 Y 128 31 63 -def @arg03 254 20 1 Y 128 31 63 -def @arg04 254 20 1 Y 128 31 63 -def @arg05 254 20 1 Y 128 31 63 -def @arg06 254 20 1 Y 128 31 63 -def @arg07 254 20 1 Y 128 31 63 -def @arg08 254 20 1 Y 128 31 63 -def @arg09 254 20 1 Y 128 31 63 -def @arg10 254 20 1 Y 128 31 63 -def @arg11 254 20 1 Y 128 31 63 -def @arg12 254 20 1 Y 128 31 63 -def @arg13 254 8192 10 Y 128 31 63 -def @arg14 254 8192 19 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 8 Y 128 31 63 -def @arg17 254 20 4 Y 128 31 63 -def @arg18 254 20 1 Y 128 31 63 -def @arg19 254 20 1 Y 128 31 63 -def @arg20 254 8192 1 Y 0 31 8 -def @arg21 254 8192 10 Y 0 31 8 -def @arg22 254 8192 30 Y 0 31 8 -def @arg23 254 8192 8 Y 128 31 63 -def @arg24 254 8192 8 Y 0 31 8 -def @arg25 254 8192 4 Y 128 31 63 -def @arg26 254 8192 4 Y 0 31 8 -def @arg27 254 8192 10 Y 128 31 63 -def @arg28 254 8192 10 Y 0 31 8 -def @arg29 254 8192 8 Y 128 31 63 -def @arg30 254 8192 8 Y 0 31 8 -def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -set @my_key= 0 ; -execute stmt1 using @my_key ; -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 0 Y 128 31 63 -def @arg03 254 20 0 Y 128 31 63 -def @arg04 254 20 0 Y 128 31 63 -def @arg05 254 20 0 Y 128 31 63 -def @arg06 254 20 0 Y 128 31 63 -def @arg07 254 20 0 Y 128 31 63 -def @arg08 254 20 0 Y 128 31 63 -def @arg09 254 20 0 Y 128 31 63 -def @arg10 254 20 0 Y 128 31 63 -def @arg11 254 20 0 Y 128 31 63 -def @arg12 254 20 0 Y 128 31 63 -def @arg13 254 8192 0 Y 128 31 63 -def @arg14 254 8192 0 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 0 Y 128 31 63 -def @arg17 254 20 0 Y 128 31 63 -def @arg18 254 20 0 Y 128 31 63 -def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 0 31 8 -def @arg21 254 8192 0 Y 0 31 8 -def @arg22 254 8192 0 Y 0 31 8 -def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 0 31 8 -def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 0 31 8 -def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 0 31 8 -def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 0 31 8 -def @arg31 254 8192 0 Y 0 31 8 -def @arg32 254 8192 0 Y 0 31 8 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -prepare stmt1 from "select c1 into ? from t9 where c1= 1" ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? from t9 where c1= 1' at line 1 -test_sequence --- insert into numeric columns -- -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20 ) ; -set @arg00= 21 ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ) ; -prepare stmt1 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22 )" ; -execute stmt1 ; -set @arg00= 23; -prepare stmt2 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, -30.0, 30.0, 30.0 ) ; -set @arg00= 31.0 ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ) ; -prepare stmt1 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, - 32.0, 32.0, 32.0 )" ; -execute stmt1 ; -set @arg00= 33.0; -prepare stmt2 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( '40', '40', '40', '40', '40', '40', '40', '40', -'40', '40', '40' ) ; -set @arg00= '41' ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ) ; -prepare stmt1 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( '42', '42', '42', '42', '42', '42', '42', '42', - '42', '42', '42' )" ; -execute stmt1 ; -set @arg00= '43'; -prepare stmt2 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( CAST('50' as binary), CAST('50' as binary), -CAST('50' as binary), CAST('50' as binary), CAST('50' as binary), -CAST('50' as binary), CAST('50' as binary), CAST('50' as binary), -CAST('50' as binary), CAST('50' as binary), CAST('50' as binary) ) ; -set @arg00= CAST('51' as binary) ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ) ; -prepare stmt1 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( CAST('52' as binary), CAST('52' as binary), - CAST('52' as binary), CAST('52' as binary), CAST('52' as binary), - CAST('52' as binary), CAST('52' as binary), CAST('52' as binary), - CAST('52' as binary), CAST('52' as binary), CAST('52' as binary) )" ; -execute stmt1 ; -set @arg00= CAST('53' as binary) ; -prepare stmt2 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -set @arg00= 2 ; -set @arg00= NULL ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( 60, NULL, NULL, NULL, NULL, NULL, NULL, NULL, -NULL, NULL, NULL ) ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( 61, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ) ; -prepare stmt1 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( 62, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL )" ; -execute stmt1 ; -prepare stmt2 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( 63, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -set @arg00= 8.0 ; -set @arg00= NULL ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( 71, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ) ; -prepare stmt2 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( 73, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -set @arg00= 'abc' ; -set @arg00= NULL ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( 81, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ) ; -prepare stmt2 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( 83, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 -from t9 where c1 >= 20 -order by c1 ; -c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c12 -20 20 20 20 20 20 20 20 20 20 20.0000 -21 21 21 21 21 21 21 21 21 21 21.0000 -22 22 22 22 22 22 22 22 22 22 22.0000 -23 23 23 23 23 23 23 23 23 23 23.0000 -30 30 30 30 30 30 30 30 30 30 30.0000 -31 31 31 31 31 31 31 31 31 31 31.0000 -32 32 32 32 32 32 32 32 32 32 32.0000 -33 33 33 33 33 33 33 33 33 33 33.0000 -40 40 40 40 40 40 40 40 40 40 40.0000 -41 41 41 41 41 41 41 41 41 41 41.0000 -42 42 42 42 42 42 42 42 42 42 42.0000 -43 43 43 43 43 43 43 43 43 43 43.0000 -50 50 50 50 50 50 50 50 50 50 50.0000 -51 51 51 51 51 51 51 51 51 51 51.0000 -52 52 52 52 52 52 52 52 52 52 52.0000 -53 53 53 53 53 53 53 53 53 53 53.0000 -60 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -61 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -62 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -63 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -71 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -73 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -81 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -83 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -test_sequence --- select .. where numeric column = .. -- -set @arg00= 20; -select 'true' as found from t9 -where c1= 20 and c2= 20 and c3= 20 and c4= 20 and c5= 20 and c6= 20 and c7= 20 -and c8= 20 and c9= 20 and c10= 20 and c12= 20; -found -true -select 'true' as found from t9 -where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 -and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 -and c12= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c2= 20 and c3= 20 and c4= 20 and c5= 20 and c6= 20 and c7= 20 - and c8= 20 and c9= 20 and c10= 20 and c12= 20 "; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? - and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? - and c12= ? "; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -found -true -set @arg00= 20.0; -select 'true' as found from t9 -where c1= 20.0 and c2= 20.0 and c3= 20.0 and c4= 20.0 and c5= 20.0 and c6= 20.0 -and c7= 20.0 and c8= 20.0 and c9= 20.0 and c10= 20.0 and c12= 20.0; -found -true -select 'true' as found from t9 -where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 -and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 -and c12= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20.0 and c2= 20.0 and c3= 20.0 and c4= 20.0 and c5= 20.0 and c6= 20.0 - and c7= 20.0 and c8= 20.0 and c9= 20.0 and c10= 20.0 and c12= 20.0 "; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? - and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? - and c12= ? "; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -found -true -select 'true' as found from t9 -where c1= '20' and c2= '20' and c3= '20' and c4= '20' and c5= '20' and c6= '20' - and c7= '20' and c8= '20' and c9= '20' and c10= '20' and c12= '20'; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= '20' and c2= '20' and c3= '20' and c4= '20' and c5= '20' and c6= '20' - and c7= '20' and c8= '20' and c9= '20' and c10= '20' and c12= '20' "; -execute stmt1 ; -found -true -set @arg00= '20'; -select 'true' as found from t9 -where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 -and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 -and c12= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? - and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? - and c12= ? "; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -found -true -select 'true' as found from t9 -where c1= CAST('20' as binary) and c2= CAST('20' as binary) and -c3= CAST('20' as binary) and c4= CAST('20' as binary) and -c5= CAST('20' as binary) and c6= CAST('20' as binary) and -c7= CAST('20' as binary) and c8= CAST('20' as binary) and -c9= CAST('20' as binary) and c10= CAST('20' as binary) and -c12= CAST('20' as binary); -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= CAST('20' as binary) and c2= CAST('20' as binary) and - c3= CAST('20' as binary) and c4= CAST('20' as binary) and - c5= CAST('20' as binary) and c6= CAST('20' as binary) and - c7= CAST('20' as binary) and c8= CAST('20' as binary) and - c9= CAST('20' as binary) and c10= CAST('20' as binary) and - c12= CAST('20' as binary) "; -execute stmt1 ; -found -true -set @arg00= CAST('20' as binary) ; -select 'true' as found from t9 -where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 -and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 -and c12= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? - and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? - and c12= ? "; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -found -true -delete from t9 ; -test_sequence --- some numeric overflow experiments -- -prepare my_insert from "insert into t9 - ( c21, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( 'O', ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -prepare my_select from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 -from t9 where c21 = 'O' "; -prepare my_delete from "delete from t9 where c21 = 'O' "; -set @arg00= 9223372036854775807 ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1264 Data truncated; out of range for column 'c1' at row 1 -Warning 1264 Data truncated; out of range for column 'c2' at row 1 -Warning 1264 Data truncated; out of range for column 'c3' at row 1 -Warning 1264 Data truncated; out of range for column 'c4' at row 1 -Warning 1264 Data truncated; out of range for column 'c5' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 127 -c2 32767 -c3 8388607 -c4 2147483647 -c5 2147483647 -c6 9223372036854775807 -c7 9.22337e+18 -c8 9.22337203685478e+18 -c9 9.22337203685478e+18 -c10 9.22337203685478e+18 -c12 99999.9999 -execute my_delete ; -set @arg00= '9223372036854775807' ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1264 Data truncated; out of range for column 'c1' at row 1 -Warning 1264 Data truncated; out of range for column 'c2' at row 1 -Warning 1264 Data truncated; out of range for column 'c3' at row 1 -Warning 1265 Data truncated for column 'c4' at row 1 -Warning 1265 Data truncated for column 'c5' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 127 -c2 32767 -c3 8388607 -c4 2147483647 -c5 2147483647 -c6 9223372036854775807 -c7 9.22337e+18 -c8 9.22337203685478e+18 -c9 9.22337203685478e+18 -c10 9.22337203685478e+18 -c12 99999.9999 -execute my_delete ; -set @arg00= -9223372036854775808 ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1264 Data truncated; out of range for column 'c1' at row 1 -Warning 1264 Data truncated; out of range for column 'c2' at row 1 -Warning 1264 Data truncated; out of range for column 'c3' at row 1 -Warning 1264 Data truncated; out of range for column 'c4' at row 1 -Warning 1264 Data truncated; out of range for column 'c5' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 -128 -c2 -32768 -c3 -8388608 -c4 -2147483648 -c5 -2147483648 -c6 -9223372036854775808 -c7 -9.22337e+18 -c8 -9.22337203685478e+18 -c9 -9.22337203685478e+18 -c10 -9.22337203685478e+18 -c12 -9999.9999 -execute my_delete ; -set @arg00= '-9223372036854775808' ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1264 Data truncated; out of range for column 'c1' at row 1 -Warning 1264 Data truncated; out of range for column 'c2' at row 1 -Warning 1264 Data truncated; out of range for column 'c3' at row 1 -Warning 1265 Data truncated for column 'c4' at row 1 -Warning 1265 Data truncated for column 'c5' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 -128 -c2 -32768 -c3 -8388608 -c4 -2147483648 -c5 -2147483648 -c6 -9223372036854775808 -c7 -9.22337e+18 -c8 -9.22337203685478e+18 -c9 -9.22337203685478e+18 -c10 -9.22337203685478e+18 -c12 -9999.9999 -execute my_delete ; -set @arg00= 1.11111111111111111111e+50 ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1264 Data truncated; out of range for column 'c1' at row 1 -Warning 1264 Data truncated; out of range for column 'c2' at row 1 -Warning 1264 Data truncated; out of range for column 'c3' at row 1 -Warning 1264 Data truncated; out of range for column 'c4' at row 1 -Warning 1264 Data truncated; out of range for column 'c5' at row 1 -Warning 1264 Data truncated; out of range for column 'c6' at row 1 -Warning 1264 Data truncated; out of range for column 'c7' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 127 -c2 32767 -c3 8388607 -c4 2147483647 -c5 2147483647 -c6 9223372036854775807 -c7 3.40282e+38 -c8 1.11111111111111e+50 -c9 1.11111111111111e+50 -c10 1.11111111111111e+50 -c12 99999.9999 -execute my_delete ; -set @arg00= '1.11111111111111111111e+50' ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1265 Data truncated for column 'c1' at row 1 -Warning 1265 Data truncated for column 'c2' at row 1 -Warning 1265 Data truncated for column 'c3' at row 1 -Warning 1265 Data truncated for column 'c4' at row 1 -Warning 1265 Data truncated for column 'c5' at row 1 -Warning 1265 Data truncated for column 'c6' at row 1 -Warning 1264 Data truncated; out of range for column 'c7' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 1 -c2 1 -c3 1 -c4 1 -c5 1 -c6 1 -c7 3.40282e+38 -c8 1.11111111111111e+50 -c9 1.11111111111111e+50 -c10 1.11111111111111e+50 -c12 99999.9999 -execute my_delete ; -set @arg00= -1.11111111111111111111e+50 ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1264 Data truncated; out of range for column 'c1' at row 1 -Warning 1264 Data truncated; out of range for column 'c2' at row 1 -Warning 1264 Data truncated; out of range for column 'c3' at row 1 -Warning 1264 Data truncated; out of range for column 'c4' at row 1 -Warning 1264 Data truncated; out of range for column 'c5' at row 1 -Warning 1264 Data truncated; out of range for column 'c6' at row 1 -Warning 1264 Data truncated; out of range for column 'c7' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 -128 -c2 -32768 -c3 -8388608 -c4 -2147483648 -c5 -2147483648 -c6 -9223372036854775808 -c7 -3.40282e+38 -c8 -1.11111111111111e+50 -c9 -1.11111111111111e+50 -c10 -1.11111111111111e+50 -c12 -9999.9999 -execute my_delete ; -set @arg00= '-1.11111111111111111111e+50' ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1265 Data truncated for column 'c1' at row 1 -Warning 1265 Data truncated for column 'c2' at row 1 -Warning 1265 Data truncated for column 'c3' at row 1 -Warning 1265 Data truncated for column 'c4' at row 1 -Warning 1265 Data truncated for column 'c5' at row 1 -Warning 1265 Data truncated for column 'c6' at row 1 -Warning 1264 Data truncated; out of range for column 'c7' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 -1 -c2 -1 -c3 -1 -c4 -1 -c5 -1 -c6 -1 -c7 -3.40282e+38 -c8 -1.11111111111111e+50 -c9 -1.11111111111111e+50 -c10 -1.11111111111111e+50 -c12 -9999.9999 -execute my_delete ; -test_sequence --- insert into string columns -- -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -select c1, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30 -from t9 where c1 >= 20 -order by c1 ; -c1 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 -20 2 20 20 20 20 20 20 20 20 20 20 -21 2 21 21 21 21 21 21 21 21 21 21 -22 2 22 22 22 22 22 22 22 22 22 22 -23 2 23 23 23 23 23 23 23 23 23 23 -30 3 30 30 30 30 30 30 30 30 30 30 -31 3 31 31 31 31 31 31 31 31 31 31 -32 3 32 32 32 32 32 32 32 32 32 32 -33 3 33 33 33 33 33 33 33 33 33 33 -40 4 40 40 40 40 40 40 40 40 40 40 -41 4 41 41 41 41 41 41 41 41 41 41 -42 4 42 42 42 42 42 42 42 42 42 42 -43 4 43 43 43 43 43 43 43 43 43 43 -50 5 50 50 50.00 50.00 50.00 50.00 50.00 50.00 50.00 50.00 -51 5 51 51 51 51 51 51 51 51 51 51 -52 5 52 52 52.00 52.00 52.00 52.00 52.00 52.00 52.00 52.00 -53 5 53 53 53.00 53.00 53.00 53.00 53.00 53.00 53.00 53.00 -54 5 54 54 54.00 54.00 54.00 54.00 54.00 54.00 54.00 54.00 -55 5 55 55 55 55 55 55 55 55 55 55 -56 6 56 56 56.00 56.00 56.00 56.00 56.00 56.00 56.00 56.00 -57 6 57 57 57.00 57.00 57.00 57.00 57.00 57.00 57.00 57.00 -60 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -61 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -62 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -63 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -71 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -73 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -81 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -83 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -test_sequence --- select .. where string column = .. -- -set @arg00= '20'; -select 'true' as found from t9 -where c1= 20 and concat(c20,substr('20',1+length(c20)))= '20' and c21= '20' and -c22= '20' and c23= '20' and c24= '20' and c25= '20' and c26= '20' and -c27= '20' and c28= '20' and c29= '20' and c30= '20' ; -found -true -select 'true' as found from t9 -where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and -c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and -c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr('20',1+length(c20)))= '20' and c21= '20' and - c22= '20' and c23= '20' and c24= '20' and c25= '20' and c26= '20' and - c27= '20' and c28= '20' and c29= '20' and c30= '20'" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and - c21= ? and c22= ? and c23= ? and c25= ? and - c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -found -true -set @arg00= CAST('20' as binary); -select 'true' as found from t9 -where c1= 20 and concat(c20,substr(CAST('20' as binary),1+length(c20))) -= CAST('20' as binary) and c21= CAST('20' as binary) -and c22= CAST('20' as binary) and c23= CAST('20' as binary) and -c24= CAST('20' as binary) and c25= CAST('20' as binary) and -c26= CAST('20' as binary) and c27= CAST('20' as binary) and -c28= CAST('20' as binary) and c29= CAST('20' as binary) and -c30= CAST('20' as binary) ; -found -true -select 'true' as found from t9 -where c1= 20 and concat(c20,substr(@arg00,1+length(c20))) = @arg00 and -c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and -c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and -c30= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr(CAST('20' as binary),1+length(c20))) - = CAST('20' as binary) and c21= CAST('20' as binary) - and c22= CAST('20' as binary) and c23= CAST('20' as binary) and - c24= CAST('20' as binary) and c25= CAST('20' as binary) and - c26= CAST('20' as binary) and c27= CAST('20' as binary) and - c28= CAST('20' as binary) and c29= CAST('20' as binary) and - c30= CAST('20' as binary)" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr(?,1+length(c20))) = ? and c21= ? and - c22= ? and c23= ? and c25= ? and c26= ? and c27= ? and c28= ? and - c29= ? and c30= ?"; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -found -true -set @arg00= 20; -select 'true' as found from t9 -where c1= 20 and concat(c20,substr(20,1+length(c20)))= 20 and c21= 20 and -c22= 20 and c23= 20 and c24= 20 and c25= 20 and c26= 20 and -c27= 20 and c28= 20 and c29= 20 and c30= 20 ; -found -true -select 'true' as found from t9 -where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and -c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and -c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr(20,1+length(c20)))= 20 and c21= 20 and - c22= 20 and c23= 20 and c24= 20 and c25= 20 and c26= 20 and - c27= 20 and c28= 20 and c29= 20 and c30= 20" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and - c21= ? and c22= ? and c23= ? and c25= ? and - c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -found -true -set @arg00= 20.0; -select 'true' as found from t9 -where c1= 20 and concat(c20,substr(20.0,1+length(c20)))= 20.0 and c21= 20.0 and -c22= 20.0 and c23= 20.0 and c24= 20.0 and c25= 20.0 and c26= 20.0 and -c27= 20.0 and c28= 20.0 and c29= 20.0 and c30= 20.0 ; -found -true -select 'true' as found from t9 -where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and -c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and -c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr(20.0,1+length(c20)))= 20.0 and c21= 20.0 and - c22= 20.0 and c23= 20.0 and c24= 20.0 and c25= 20.0 and c26= 20.0 and - c27= 20.0 and c28= 20.0 and c29= 20.0 and c30= 20.0" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and - c21= ? and c22= ? and c23= ? and c25= ? and - c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -found -true -delete from t9 ; -test_sequence --- insert into date/time columns -- -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1264 Data truncated; out of range for column 'c13' at row 1 -Warning 1265 Data truncated for column 'c14' at row 1 -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -Warnings: -Warning 1264 Data truncated; out of range for column 'c13' at row 1 -Warning 1265 Data truncated for column 'c14' at row 1 -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -Warnings: -Warning 1264 Data truncated; out of range for column 'c13' at row 1 -Warning 1265 Data truncated for column 'c14' at row 1 -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -Warnings: -Warning 1264 Data truncated; out of range for column 'c13' at row 1 -Warning 1265 Data truncated for column 'c14' at row 1 -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -select c1, c13, c14, c15, c16, c17 from t9 order by c1 ; -c1 c13 c14 c15 c16 c17 -20 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -21 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -22 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -23 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -30 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -31 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -32 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -33 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -40 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -41 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -42 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -43 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -50 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -51 0010-00-00 0010-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -52 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -53 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -60 NULL NULL 1991-01-01 01:01:01 NULL NULL -61 NULL NULL 1991-01-01 01:01:01 NULL NULL -62 NULL NULL 1991-01-01 01:01:01 NULL NULL -63 NULL NULL 1991-01-01 01:01:01 NULL NULL -71 NULL NULL 1991-01-01 01:01:01 NULL NULL -73 NULL NULL 1991-01-01 01:01:01 NULL NULL -81 NULL NULL 1991-01-01 01:01:01 NULL NULL -83 NULL NULL 1991-01-01 01:01:01 NULL NULL -test_sequence --- select .. where date/time column = .. -- -set @arg00= '1991-01-01 01:01:01' ; -select 'true' as found from t9 -where c1= 20 and c13= '1991-01-01 01:01:01' and c14= '1991-01-01 01:01:01' and -c15= '1991-01-01 01:01:01' and c16= '1991-01-01 01:01:01' and -c17= '1991-01-01 01:01:01' ; -found -true -select 'true' as found from t9 -where c1= 20 and c13= @arg00 and c14= @arg00 and c15= @arg00 and c16= @arg00 -and c17= @arg00 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c13= '1991-01-01 01:01:01' and c14= '1991-01-01 01:01:01' and - c15= '1991-01-01 01:01:01' and c16= '1991-01-01 01:01:01' and - c17= '1991-01-01 01:01:01'" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c13= ? and c14= ? and c15= ? and c16= ? and c17= ?" ; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00 ; -found -true -set @arg00= CAST('1991-01-01 01:01:01' as datetime) ; -select 'true' as found from t9 -where c1= 20 and c13= CAST('1991-01-01 01:01:01' as datetime) and -c14= CAST('1991-01-01 01:01:01' as datetime) and -c15= CAST('1991-01-01 01:01:01' as datetime) and -c16= CAST('1991-01-01 01:01:01' as datetime) and -c17= CAST('1991-01-01 01:01:01' as datetime) ; -found -true -select 'true' as found from t9 -where c1= 20 and c13= @arg00 and c14= @arg00 and c15= @arg00 and c16= @arg00 -and c17= @arg00 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c13= CAST('1991-01-01 01:01:01' as datetime) and - c14= CAST('1991-01-01 01:01:01' as datetime) and - c15= CAST('1991-01-01 01:01:01' as datetime) and - c16= CAST('1991-01-01 01:01:01' as datetime) and - c17= CAST('1991-01-01 01:01:01' as datetime)" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c13= ? and c14= ? and c15= ? and c16= ? and c17= ?" ; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00 ; -found -true -set @arg00= 1991 ; -select 'true' as found from t9 -where c1= 20 and c17= 1991 ; -found -true -select 'true' as found from t9 -where c1= 20 and c17= @arg00 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c17= 1991" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c17= ?" ; -execute stmt1 using @arg00 ; -found -true -set @arg00= 1.991e+3 ; -select 'true' as found from t9 -where c1= 20 and abs(c17 - 1.991e+3) < 0.01 ; -found -true -select 'true' as found from t9 -where c1= 20 and abs(c17 - @arg00) < 0.01 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and abs(c17 - 1.991e+3) < 0.01" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and abs(c17 - ?) < 0.01" ; -execute stmt1 using @arg00 ; -found -true -drop table t1, t1_1, t1_2, -t9_1, t9_2, t9; diff --git a/mysql-test/r/ps_6bdb.result.es b/mysql-test/r/ps_6bdb.result.es deleted file mode 100644 index 7b7f7e23bbf..00000000000 --- a/mysql-test/r/ps_6bdb.result.es +++ /dev/null @@ -1,3113 +0,0 @@ -use test; -drop table if exists t1, t9 ; -create table t1 -( -a int, b varchar(30), -primary key(a) -) engine = 'BDB' ; -create table t9 -( -c1 tinyint, c2 smallint, c3 mediumint, c4 int, -c5 integer, c6 bigint, c7 float, c8 double, -c9 double precision, c10 real, c11 decimal(7, 4), c12 numeric(8, 4), -c13 date, c14 datetime, c15 timestamp(14), c16 time, -c17 year, c18 bit, c19 bool, c20 char, -c21 char(10), c22 varchar(30), c23 tinyblob, c24 tinytext, -c25 blob, c26 text, c27 mediumblob, c28 mediumtext, -c29 longblob, c30 longtext, c31 enum('one', 'two', 'three'), -c32 set('monday', 'tuesday', 'wednesday'), -primary key(c1) -) engine = 'BDB' ; -delete from t1 ; -insert into t1 values (1,'one'); -insert into t1 values (2,'two'); -insert into t1 values (3,'three'); -insert into t1 values (4,'four'); -commit ; -delete from t9 ; -insert into t9 -set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, -c10= 1, c11= 1, c12 = 1, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=true, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t9 -set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, -c10= 9, c11= 9, c12 = 9, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=false, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; -commit ; -test_sequence ------- simple select tests ------ -prepare stmt1 from ' select * from t9 order by c1 ' ; -execute stmt1; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def test t9 t9 c1 c1 1 4 1 N 49155 0 63 -def test t9 t9 c2 c2 2 6 1 Y 32768 0 63 -def test t9 t9 c3 c3 9 9 1 Y 32768 0 63 -def test t9 t9 c4 c4 3 11 1 Y 32768 0 63 -def test t9 t9 c5 c5 3 11 1 Y 32768 0 63 -def test t9 t9 c6 c6 8 20 1 Y 32768 0 63 -def test t9 t9 c7 c7 4 12 1 Y 32768 31 63 -def test t9 t9 c8 c8 5 22 1 Y 32768 31 63 -def test t9 t9 c9 c9 5 22 1 Y 32768 31 63 -def test t9 t9 c10 c10 5 22 1 Y 32768 31 63 -def test t9 t9 c11 c11 0 9 6 Y 32768 4 63 -def test t9 t9 c12 c12 0 10 6 Y 32768 4 63 -def test t9 t9 c13 c13 10 10 10 Y 128 0 63 -def test t9 t9 c14 c14 12 19 19 Y 128 0 63 -def test t9 t9 c15 c15 7 19 19 N 1249 0 63 -def test t9 t9 c16 c16 11 8 8 Y 128 0 63 -def test t9 t9 c17 c17 13 4 4 Y 32864 0 63 -def test t9 t9 c18 c18 1 1 1 Y 32768 0 63 -def test t9 t9 c19 c19 1 1 1 Y 32768 0 63 -def test t9 t9 c20 c20 254 1 1 Y 0 0 8 -def test t9 t9 c21 c21 253 10 10 Y 0 0 8 -def test t9 t9 c22 c22 253 30 30 Y 0 0 8 -def test t9 t9 c23 c23 252 255 8 Y 144 0 63 -def test t9 t9 c24 c24 252 255 8 Y 16 0 8 -def test t9 t9 c25 c25 252 65535 4 Y 144 0 63 -def test t9 t9 c26 c26 252 65535 4 Y 16 0 8 -def test t9 t9 c27 c27 252 16777215 10 Y 144 0 63 -def test t9 t9 c28 c28 252 16777215 10 Y 16 0 8 -def test t9 t9 c29 c29 252 16777215 8 Y 144 0 63 -def test t9 t9 c30 c30 252 16777215 8 Y 16 0 8 -def test t9 t9 c31 c31 254 5 3 Y 256 0 8 -def test t9 t9 c32 c32 254 24 7 Y 2048 0 8 -c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32 -1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday -set @arg00='SELECT' ; -prepare stmt1 from ' ? a from t1 where a=1 '; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? a from t1 where a=1' at line 1 -set @arg00=1 ; -select @arg00, b from t1 where a=1 ; -@arg00 b -1 one -prepare stmt1 from ' select ?, b from t1 where a=1 ' ; -execute stmt1 using @arg00 ; -? b -1 one -set @arg00='lion' ; -select @arg00, b from t1 where a=1 ; -@arg00 b -lion one -prepare stmt1 from ' select ?, b from t1 where a=1 ' ; -execute stmt1 using @arg00 ; -? b -lion one -set @arg00=NULL ; -select @arg00, b from t1 where a=1 ; -@arg00 b -NULL one -prepare stmt1 from ' select ?, b from t1 where a=1 ' ; -execute stmt1 using @arg00 ; -? b -NULL one -set @arg00=1 ; -select b, a - @arg00 from t1 where a=1 ; -b a - @arg00 -one 0 -prepare stmt1 from ' select b, a - ? from t1 where a=1 ' ; -execute stmt1 using @arg00 ; -b a - ? -one 0 -set @arg00=null ; -select @arg00 as my_col ; -my_col -NULL -prepare stmt1 from ' select ? as my_col'; -execute stmt1 using @arg00 ; -my_col -NULL -select @arg00 + 1 as my_col ; -my_col -NULL -prepare stmt1 from ' select ? + 1 as my_col'; -execute stmt1 using @arg00 ; -my_col -NULL -select 1 + @arg00 as my_col ; -my_col -NULL -prepare stmt1 from ' select 1 + ? as my_col'; -execute stmt1 using @arg00 ; -my_col -NULL -set @arg00='MySQL' ; -select substr(@arg00,1,2) from t1 where a=1 ; -substr(@arg00,1,2) -My -prepare stmt1 from ' select substr(?,1,2) from t1 where a=1 ' ; -execute stmt1 using @arg00 ; -substr(?,1,2) -My -set @arg00=3 ; -select substr('MySQL',@arg00,5) from t1 where a=1 ; -substr('MySQL',@arg00,5) -SQL -prepare stmt1 from ' select substr(''MySQL'',?,5) from t1 where a=1 ' ; -execute stmt1 using @arg00 ; -substr('MySQL',?,5) -SQL -select substr('MySQL',1,@arg00) from t1 where a=1 ; -substr('MySQL',1,@arg00) -MyS -prepare stmt1 from ' select substr(''MySQL'',1,?) from t1 where a=1 ' ; -execute stmt1 using @arg00 ; -substr('MySQL',1,?) -MyS -set @arg00='MySQL' ; -select a , concat(@arg00,b) from t1 order by a; -a concat(@arg00,b) -1 MySQLone -2 MySQLtwo -3 MySQLthree -4 MySQLfour -prepare stmt1 from ' select a , concat(?,b) from t1 order by a ' ; -execute stmt1 using @arg00; -a concat(?,b) -1 MySQLone -2 MySQLtwo -3 MySQLthree -4 MySQLfour -select a , concat(b,@arg00) from t1 order by a ; -a concat(b,@arg00) -1 oneMySQL -2 twoMySQL -3 threeMySQL -4 fourMySQL -prepare stmt1 from ' select a , concat(b,?) from t1 order by a ' ; -execute stmt1 using @arg00; -a concat(b,?) -1 oneMySQL -2 twoMySQL -3 threeMySQL -4 fourMySQL -set @arg00='MySQL' ; -select group_concat(@arg00,b order by a) from t1 -group by 'a' ; -group_concat(@arg00,b order by a) -MySQLone,MySQLtwo,MySQLthree,MySQLfour -prepare stmt1 from ' select group_concat(?,b order by a) from t1 -group by ''a'' ' ; -execute stmt1 using @arg00; -group_concat(?,b order by a) -MySQLone,MySQLtwo,MySQLthree,MySQLfour -select group_concat(b,@arg00 order by a) from t1 -group by 'a' ; -group_concat(b,@arg00 order by a) -oneMySQL,twoMySQL,threeMySQL,fourMySQL -prepare stmt1 from ' select group_concat(b,? order by a) from t1 -group by ''a'' ' ; -execute stmt1 using @arg00; -group_concat(b,? order by a) -oneMySQL,twoMySQL,threeMySQL,fourMySQL -set @arg00='first' ; -set @arg01='second' ; -set @arg02=NULL; -select @arg00, @arg01 from t1 where a=1 ; -@arg00 @arg01 -first second -prepare stmt1 from ' select ?, ? from t1 where a=1 ' ; -execute stmt1 using @arg00, @arg01 ; -? ? -first second -execute stmt1 using @arg02, @arg01 ; -? ? -NULL second -execute stmt1 using @arg00, @arg02 ; -? ? -first NULL -execute stmt1 using @arg02, @arg02 ; -? ? -NULL NULL -drop table if exists t5 ; -create table t5 (id1 int(11) not null default '0', -value2 varchar(100), value1 varchar(100)) ; -insert into t5 values (1,'hh','hh'),(2,'hh','hh'), -(1,'ii','ii'),(2,'ii','ii') ; -prepare stmt1 from ' select id1,value1 from t5 where id1=? or value1=? order by id1,value1 ' ; -set @arg00=1 ; -set @arg01='hh' ; -execute stmt1 using @arg00, @arg01 ; -id1 value1 -1 hh -1 ii -2 hh -drop table t5 ; -drop table if exists t5 ; -create table t5(session_id char(9) not null) ; -insert into t5 values ('abc') ; -prepare stmt1 from ' select * from t5 -where ?=''1111'' and session_id = ''abc'' ' ; -set @arg00='abc' ; -execute stmt1 using @arg00 ; -session_id -set @arg00='1111' ; -execute stmt1 using @arg00 ; -session_id -abc -set @arg00='abc' ; -execute stmt1 using @arg00 ; -session_id -drop table t5 ; -set @arg00='FROM' ; -select a @arg00 t1 where a=1 ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 t1 where a=1' at line 1 -prepare stmt1 from ' select a ? t1 where a=1 ' ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? t1 where a=1' at line 1 -set @arg00='t1' ; -select a from @arg00 where a=1 ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 where a=1' at line 1 -prepare stmt1 from ' select a from ? where a=1 ' ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? where a=1' at line 1 -set @arg00='WHERE' ; -select a from t1 @arg00 a=1 ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 a=1' at line 1 -prepare stmt1 from ' select a from t1 ? a=1 ' ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? a=1' at line 1 -set @arg00=1 ; -select a FROM t1 where a=@arg00 ; -a -1 -prepare stmt1 from ' select a FROM t1 where a=? ' ; -execute stmt1 using @arg00 ; -a -1 -set @arg00=1000 ; -execute stmt1 using @arg00 ; -a -set @arg00=NULL ; -select a FROM t1 where a=@arg00 ; -a -prepare stmt1 from ' select a FROM t1 where a=? ' ; -execute stmt1 using @arg00 ; -a -set @arg00=4 ; -select a FROM t1 where a=sqrt(@arg00) ; -a -2 -prepare stmt1 from ' select a FROM t1 where a=sqrt(?) ' ; -execute stmt1 using @arg00 ; -a -2 -set @arg00=NULL ; -select a FROM t1 where a=sqrt(@arg00) ; -a -prepare stmt1 from ' select a FROM t1 where a=sqrt(?) ' ; -execute stmt1 using @arg00 ; -a -set @arg00=2 ; -set @arg01=3 ; -select a FROM t1 where a in (@arg00,@arg01) order by a; -a -2 -3 -prepare stmt1 from ' select a FROM t1 where a in (?,?) order by a '; -execute stmt1 using @arg00, @arg01; -a -2 -3 -set @arg00= 'one' ; -set @arg01= 'two' ; -set @arg02= 'five' ; -prepare stmt1 from ' select b FROM t1 where b in (?,?,?) order by b ' ; -execute stmt1 using @arg00, @arg01, @arg02 ; -b -one -two -prepare stmt1 from ' select b FROM t1 where b like ? '; -set @arg00='two' ; -execute stmt1 using @arg00 ; -b -two -set @arg00='tw%' ; -execute stmt1 using @arg00 ; -b -two -set @arg00='%wo' ; -execute stmt1 using @arg00 ; -b -two -set @arg00=null ; -insert into t9 set c1= 0, c5 = NULL ; -select c5 from t9 where c5 > NULL ; -c5 -prepare stmt1 from ' select c5 from t9 where c5 > ? '; -execute stmt1 using @arg00 ; -c5 -select c5 from t9 where c5 < NULL ; -c5 -prepare stmt1 from ' select c5 from t9 where c5 < ? '; -execute stmt1 using @arg00 ; -c5 -select c5 from t9 where c5 = NULL ; -c5 -prepare stmt1 from ' select c5 from t9 where c5 = ? '; -execute stmt1 using @arg00 ; -c5 -select c5 from t9 where c5 <=> NULL ; -c5 -NULL -prepare stmt1 from ' select c5 from t9 where c5 <=> ? '; -execute stmt1 using @arg00 ; -c5 -NULL -delete from t9 where c1= 0 ; -set @arg00='>' ; -select a FROM t1 where a @arg00 1 ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@arg00 1' at line 1 -prepare stmt1 from ' select a FROM t1 where a ? 1 ' ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? 1' at line 1 -set @arg00=1 ; -select a,b FROM t1 where a is not NULL -AND b is not NULL group by a - @arg00 ; -a b -1 one -2 two -3 three -4 four -prepare stmt1 from ' select a,b FROM t1 where a is not NULL -AND b is not NULL group by a - ? ' ; -execute stmt1 using @arg00 ; -a b -1 one -2 two -3 three -4 four -set @arg00='two' ; -select a,b FROM t1 where a is not NULL -AND b is not NULL having b <> @arg00 order by a ; -a b -1 one -3 three -4 four -prepare stmt1 from ' select a,b FROM t1 where a is not NULL -AND b is not NULL having b <> ? order by a ' ; -execute stmt1 using @arg00 ; -a b -1 one -3 three -4 four -set @arg00=1 ; -select a,b FROM t1 where a is not NULL -AND b is not NULL order by a - @arg00 ; -a b -1 one -2 two -3 three -4 four -prepare stmt1 from ' select a,b FROM t1 where a is not NULL -AND b is not NULL order by a - ? ' ; -execute stmt1 using @arg00 ; -a b -1 one -2 two -3 three -4 four -set @arg00=2 ; -select a,b from t1 order by 2 ; -a b -4 four -1 one -3 three -2 two -prepare stmt1 from ' select a,b from t1 -order by ? '; -execute stmt1 using @arg00; -a b -4 four -1 one -3 three -2 two -set @arg00=1 ; -execute stmt1 using @arg00; -a b -1 one -2 two -3 three -4 four -set @arg00=0 ; -execute stmt1 using @arg00; -ERROR 42S22: Unknown column '?' in 'order clause' -set @arg00=1; -prepare stmt1 from ' select a,b from t1 order by a -limit 1 '; -execute stmt1 ; -a b -1 one -prepare stmt1 from ' select a,b from t1 -limit ? '; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?' at line 2 -set @arg00='b' ; -set @arg01=0 ; -set @arg02=2 ; -set @arg03=2 ; -select sum(a), @arg00 from t1 where a > @arg01 -and b is not null group by substr(b,@arg02) -having sum(a) <> @arg03 ; -sum(a) @arg00 -3 b -1 b -4 b -prepare stmt1 from ' select sum(a), ? from t1 where a > ? -and b is not null group by substr(b,?) -having sum(a) <> ? '; -execute stmt1 using @arg00, @arg01, @arg02, @arg03; -sum(a) ? -3 b -1 b -4 b -test_sequence ------- join tests ------ -select first.a as a1, second.a as a2 -from t1 first, t1 second -where first.a = second.a order by a1 ; -a1 a2 -1 1 -2 2 -3 3 -4 4 -prepare stmt1 from ' select first.a as a1, second.a as a2 - from t1 first, t1 second - where first.a = second.a order by a1 '; -execute stmt1 ; -a1 a2 -1 1 -2 2 -3 3 -4 4 -set @arg00='ABC'; -set @arg01='two'; -set @arg02='one'; -select first.a, @arg00, second.a FROM t1 first, t1 second -where @arg01 = first.b or first.a = second.a or second.b = @arg02 -order by second.a, first.a; -a @arg00 a -1 ABC 1 -2 ABC 1 -3 ABC 1 -4 ABC 1 -2 ABC 2 -2 ABC 3 -3 ABC 3 -2 ABC 4 -4 ABC 4 -prepare stmt1 from ' select first.a, ?, second.a FROM t1 first, t1 second - where ? = first.b or first.a = second.a or second.b = ? - order by second.a, first.a'; -execute stmt1 using @arg00, @arg01, @arg02; -a ? a -1 ABC 1 -2 ABC 1 -3 ABC 1 -4 ABC 1 -2 ABC 2 -2 ABC 3 -3 ABC 3 -2 ABC 4 -4 ABC 4 -drop table if exists t2 ; -create table t2 as select * from t1 ; -set @query1= 'SELECT * FROM t2 join t1 on (t1.a=t2.a) order by t2.a ' ; -set @query2= 'SELECT * FROM t2 natural join t1 order by t2.a ' ; -set @query3= 'SELECT * FROM t2 join t1 using(a) order by t2.a ' ; -set @query4= 'SELECT * FROM t2 left join t1 on(t1.a=t2.a) order by t2.a ' ; -set @query5= 'SELECT * FROM t2 natural left join t1 order by t2.a ' ; -set @query6= 'SELECT * FROM t2 left join t1 using(a) order by t2.a ' ; -set @query7= 'SELECT * FROM t2 right join t1 on(t1.a=t2.a) order by t2.a ' ; -set @query8= 'SELECT * FROM t2 natural right join t1 order by t2.a ' ; -set @query9= 'SELECT * FROM t2 right join t1 using(a) order by t2.a ' ; -the join statement is: -SELECT * FROM t2 right join t1 using(a) order by t2.a -prepare stmt1 from @query9 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -the join statement is: -SELECT * FROM t2 natural right join t1 order by t2.a -prepare stmt1 from @query8 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -the join statement is: -SELECT * FROM t2 right join t1 on(t1.a=t2.a) order by t2.a -prepare stmt1 from @query7 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -the join statement is: -SELECT * FROM t2 left join t1 using(a) order by t2.a -prepare stmt1 from @query6 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -the join statement is: -SELECT * FROM t2 natural left join t1 order by t2.a -prepare stmt1 from @query5 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -the join statement is: -SELECT * FROM t2 left join t1 on(t1.a=t2.a) order by t2.a -prepare stmt1 from @query4 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -the join statement is: -SELECT * FROM t2 join t1 using(a) order by t2.a -prepare stmt1 from @query3 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -the join statement is: -SELECT * FROM t2 natural join t1 order by t2.a -prepare stmt1 from @query2 ; -execute stmt1 ; -a b -1 one -2 two -3 three -4 four -execute stmt1 ; -a b -1 one -2 two -3 three -4 four -execute stmt1 ; -a b -1 one -2 two -3 three -4 four -the join statement is: -SELECT * FROM t2 join t1 on (t1.a=t2.a) order by t2.a -prepare stmt1 from @query1 ; -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -execute stmt1 ; -a b a b -1 one 1 one -2 two 2 two -3 three 3 three -4 four 4 four -drop table t2 ; -test_sequence ------- subquery tests ------ -prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where b = ''two'') '; -execute stmt1 ; -a b -2 two -set @arg00='two' ; -select a, b FROM t1 outer_table where -a = (select a from t1 where b = 'two' ) and b=@arg00 ; -a b -2 two -prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where b = ''two'') and b=? '; -execute stmt1 using @arg00; -a b -2 two -set @arg00='two' ; -select a, b FROM t1 outer_table where -a = (select a from t1 where b = @arg00 ) and b='two' ; -a b -2 two -prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where b = ? ) and b=''two'' ' ; -execute stmt1 using @arg00; -a b -2 two -set @arg00=3 ; -set @arg01='three' ; -select a,b FROM t1 where (a,b) in (select 3, 'three'); -a b -3 three -select a FROM t1 where (a,b) in (select @arg00,@arg01); -a -3 -prepare stmt1 from ' select a FROM t1 where (a,b) in (select ?, ?) '; -execute stmt1 using @arg00, @arg01; -a -3 -set @arg00=1 ; -set @arg01='two' ; -set @arg02=2 ; -set @arg03='two' ; -select a, @arg00, b FROM t1 outer_table where -b=@arg01 and a = (select @arg02 from t1 where b = @arg03 ) ; -a @arg00 b -2 1 two -prepare stmt1 from ' select a, ?, b FROM t1 outer_table where - b=? and a = (select ? from t1 where b = ? ) ' ; -execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; -a ? b -2 1 two -prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where b = outer_table.b ) order by a '; -execute stmt1 ; -a b -1 one -2 two -3 three -4 four -prepare stmt1 from ' SELECT a as ccc from t1 where a+1= - (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) '; -execute stmt1 ; -ccc -1 -deallocate prepare stmt1 ; -prepare stmt1 from ' SELECT a as ccc from t1 where a+1= - (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) '; -execute stmt1 ; -ccc -1 -deallocate prepare stmt1 ; -prepare stmt1 from ' SELECT a as ccc from t1 where a+1= - (SELECT 1+ccc from t1 where ccc+1=a+1 and a=1) '; -execute stmt1 ; -ccc -1 -deallocate prepare stmt1 ; -set @arg00='two' ; -select a, b FROM t1 outer_table where -a = (select a from t1 where b = outer_table.b ) and b=@arg00 ; -a b -2 two -prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where b = outer_table.b) and b=? '; -execute stmt1 using @arg00; -a b -2 two -set @arg00=2 ; -select a, b FROM t1 outer_table where -a = (select a from t1 where a = @arg00 and b = outer_table.b) and b='two' ; -a b -2 two -prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where a = ? and b = outer_table.b) and b=''two'' ' ; -execute stmt1 using @arg00; -a b -2 two -set @arg00=2 ; -select a, b FROM t1 outer_table where -a = (select a from t1 where outer_table.a = @arg00 and a=2) and b='two' ; -a b -2 two -prepare stmt1 from ' select a, b FROM t1 outer_table where - a = (select a from t1 where outer_table.a = ? and a=2) and b=''two'' ' ; -execute stmt1 using @arg00; -a b -2 two -set @arg00=1 ; -set @arg01='two' ; -set @arg02=2 ; -set @arg03='two' ; -select a, @arg00, b FROM t1 outer_table where -b=@arg01 and a = (select @arg02 from t1 where outer_table.b = @arg03 -and outer_table.a=a ) ; -a @arg00 b -2 1 two -prepare stmt1 from ' select a, ?, b FROM t1 outer_table where - b=? and a = (select ? from t1 where outer_table.b = ? - and outer_table.a=a ) ' ; -execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; -a ? b -2 1 two -set @arg00=1 ; -set @arg01=0 ; -select a, @arg00 -from ( select a - @arg00 as a from t1 where a=@arg00 ) as t2 -where a=@arg01; -a @arg00 -0 1 -prepare stmt1 from ' select a, ? - from ( select a - ? as a from t1 where a=? ) as t2 - where a=? '; -execute stmt1 using @arg00, @arg00, @arg00, @arg01 ; -a ? -0 1 -drop table if exists t2 ; -create table t2 as select * from t1; -prepare stmt1 from ' select a in (select a from t2) from t1 ' ; -execute stmt1 ; -a in (select a from t2) -1 -1 -1 -1 -drop table if exists t5, t6, t7 ; -create table t5 (a int , b int) ; -create table t6 like t5 ; -create table t7 like t5 ; -insert into t5 values (0, 100), (1, 2), (1, 3), (2, 2), (2, 7), -(2, -1), (3, 10) ; -insert into t6 values (0, 0), (1, 1), (2, 1), (3, 1), (4, 1) ; -insert into t7 values (3, 3), (2, 2), (1, 1) ; -prepare stmt1 from ' select a, (select count(distinct t5.b) as sum from t5, t6 - where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b - group by t5.a order by sum limit 1) from t7 ' ; -execute stmt1 ; -a (select count(distinct t5.b) as sum from t5, t6 - where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b - group by t5.a order by sum limit 1) -3 1 -2 2 -1 2 -execute stmt1 ; -a (select count(distinct t5.b) as sum from t5, t6 - where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b - group by t5.a order by sum limit 1) -3 1 -2 2 -1 2 -execute stmt1 ; -a (select count(distinct t5.b) as sum from t5, t6 - where t5.a=t6.a and t6.b > 0 and t5.a <= t7.b - group by t5.a order by sum limit 1) -3 1 -2 2 -1 2 -drop table t5, t6, t7 ; -drop table if exists t2 ; -create table t2 as select * from t9; -set @stmt= ' SELECT - (SELECT SUM(c1 + c12 + 0.0) FROM t2 - where (t9.c2 - 0e-3) = t2.c2 - GROUP BY t9.c15 LIMIT 1) as scalar_s, - exists (select 1.0e+0 from t2 - where t2.c3 * 9.0000000000 = t9.c4) as exists_s, - c5 * 4 in (select c6 + 0.3e+1 from t2) as in_s, - (c7 - 4, c8 - 4) in (select c9 + 4.0, c10 + 40e-1 from t2) as in_row_s -FROM t9, -(select c25 x, c32 y from t2) tt WHERE x = c25 ' ; -prepare stmt1 from @stmt ; -execute stmt1 ; -execute stmt1 ; -set @stmt= concat('explain ',@stmt); -prepare stmt1 from @stmt ; -execute stmt1 ; -execute stmt1 ; -set @stmt= ' SELECT - (SELECT SUM(c1+c12+?) FROM t2 where (t9.c2-?)=t2.c2 - GROUP BY t9.c15 LIMIT 1) as scalar_s, - exists (select ? from t2 - where t2.c3*?=t9.c4) as exists_s, - c5*? in (select c6+? from t2) as in_s, - (c7-?, c8-?) in (select c9+?, c10+? from t2) as in_row_s -FROM t9, -(select c25 x, c32 y from t2) tt WHERE x =c25 ' ; -set @arg00= 0.0 ; -set @arg01= 0e-3 ; -set @arg02= 1.0e+0 ; -set @arg03= 9.0000000000 ; -set @arg04= 4 ; -set @arg05= 0.3e+1 ; -set @arg06= 4 ; -set @arg07= 4 ; -set @arg08= 4.0 ; -set @arg09= 40e-1 ; -prepare stmt1 from @stmt ; -execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, -@arg07, @arg08, @arg09 ; -execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, -@arg07, @arg08, @arg09 ; -set @stmt= concat('explain ',@stmt); -prepare stmt1 from @stmt ; -execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, -@arg07, @arg08, @arg09 ; -execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, -@arg07, @arg08, @arg09 ; -drop table t2 ; -select 1 < (select a from t1) ; -ERROR 21000: Subquery returns more than 1 row -prepare stmt1 from ' select 1 < (select a from t1) ' ; -execute stmt1 ; -ERROR 21000: Subquery returns more than 1 row -select 1 as my_col ; -my_col -1 -test_sequence ------- union tests ------ -prepare stmt1 from ' select a FROM t1 where a=1 - union distinct - select a FROM t1 where a=1 '; -execute stmt1 ; -a -1 -execute stmt1 ; -a -1 -prepare stmt1 from ' select a FROM t1 where a=1 - union all - select a FROM t1 where a=1 '; -execute stmt1 ; -a -1 -1 -prepare stmt1 from ' SELECT 1, 2 union SELECT 1 ' ; -ERROR 21000: The used SELECT statements have a different number of columns -prepare stmt1 from ' SELECT 1 union SELECT 1, 2 ' ; -ERROR 21000: The used SELECT statements have a different number of columns -prepare stmt1 from ' SELECT * from t1 union SELECT 1 ' ; -ERROR 21000: The used SELECT statements have a different number of columns -prepare stmt1 from ' SELECT 1 union SELECT * from t1 ' ; -ERROR 21000: The used SELECT statements have a different number of columns -set @arg00=1 ; -select @arg00 FROM t1 where a=1 -union distinct -select 1 FROM t1 where a=1; -@arg00 -1 -prepare stmt1 from ' select ? FROM t1 where a=1 - union distinct - select 1 FROM t1 where a=1 ' ; -execute stmt1 using @arg00; -? -1 -set @arg00=1 ; -select 1 FROM t1 where a=1 -union distinct -select @arg00 FROM t1 where a=1; -1 -1 -prepare stmt1 from ' select 1 FROM t1 where a=1 - union distinct - select ? FROM t1 where a=1 ' ; -execute stmt1 using @arg00; -1 -1 -set @arg00='a' ; -select @arg00 FROM t1 where a=1 -union distinct -select @arg00 FROM t1 where a=1; -@arg00 -a -prepare stmt1 from ' select ? FROM t1 where a=1 - union distinct - select ? FROM t1 where a=1 '; -execute stmt1 using @arg00, @arg00; -? -a -prepare stmt1 from ' select ? - union distinct - select ? '; -execute stmt1 using @arg00, @arg00; -? -a -set @arg00='a' ; -set @arg01=1 ; -set @arg02='a' ; -set @arg03=2 ; -select @arg00 FROM t1 where a=@arg01 -union distinct -select @arg02 FROM t1 where a=@arg03; -@arg00 -a -prepare stmt1 from ' select ? FROM t1 where a=? - union distinct - select ? FROM t1 where a=? ' ; -execute stmt1 using @arg00, @arg01, @arg02, @arg03; -? -a -set @arg00=1 ; -prepare stmt1 from ' select sum(a) + 200, ? from t1 -union distinct -select sum(a) + 200, 1 from t1 -group by b ' ; -execute stmt1 using @arg00; -sum(a) + 200 ? -210 1 -204 1 -201 1 -203 1 -202 1 -set @Oporto='Oporto' ; -set @Lisboa='Lisboa' ; -set @0=0 ; -set @1=1 ; -set @2=2 ; -set @3=3 ; -set @4=4 ; -select @Oporto,@Lisboa,@0,@1,@2,@3,@4 ; -@Oporto @Lisboa @0 @1 @2 @3 @4 -Oporto Lisboa 0 1 2 3 4 -select sum(a) + 200 as the_sum, @Oporto as the_town from t1 -group by b -union distinct -select sum(a) + 200, @Lisboa from t1 -group by b ; -the_sum the_town -204 Oporto -201 Oporto -203 Oporto -202 Oporto -204 Lisboa -201 Lisboa -203 Lisboa -202 Lisboa -prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1 - group by b - union distinct - select sum(a) + 200, ? from t1 - group by b ' ; -execute stmt1 using @Oporto, @Lisboa; -the_sum the_town -204 Oporto -201 Oporto -203 Oporto -202 Oporto -204 Lisboa -201 Lisboa -203 Lisboa -202 Lisboa -select sum(a) + 200 as the_sum, @Oporto as the_town from t1 -where a > @1 -group by b -union distinct -select sum(a) + 200, @Lisboa from t1 -where a > @2 -group by b ; -the_sum the_town -204 Oporto -203 Oporto -202 Oporto -204 Lisboa -203 Lisboa -prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1 - where a > ? - group by b - union distinct - select sum(a) + 200, ? from t1 - where a > ? - group by b ' ; -execute stmt1 using @Oporto, @1, @Lisboa, @2; -the_sum the_town -204 Oporto -203 Oporto -202 Oporto -204 Lisboa -203 Lisboa -select sum(a) + 200 as the_sum, @Oporto as the_town from t1 -where a > @1 -group by b -having avg(a) > @2 -union distinct -select sum(a) + 200, @Lisboa from t1 -where a > @2 -group by b -having avg(a) > @3; -the_sum the_town -204 Oporto -203 Oporto -204 Lisboa -prepare stmt1 from ' select sum(a) + 200 as the_sum, ? as the_town from t1 - where a > ? - group by b - having avg(a) > ? - union distinct - select sum(a) + 200, ? from t1 - where a > ? - group by b - having avg(a) > ? '; -execute stmt1 using @Oporto, @1, @2, @Lisboa, @2, @3; -the_sum the_town -204 Oporto -203 Oporto -204 Lisboa -test_sequence ------- explain select tests ------ -prepare stmt1 from ' explain select * from t9 ' ; -execute stmt1; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def id 8 3 1 N 32801 0 8 -def select_type 253 19 6 N 1 31 33 -def table 253 64 2 N 1 31 33 -def type 253 10 3 N 1 31 33 -def possible_keys 253 4096 0 Y 0 31 33 -def key 253 64 0 Y 0 31 33 -def key_len 8 3 0 Y 32800 0 8 -def ref 253 1024 0 Y 0 31 33 -def rows 8 10 1 N 32801 0 8 -def Extra 253 255 0 N 1 31 33 -id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t9 ALL NULL NULL NULL NULL 3 -test_sequence ------- delete tests ------ -delete from t1 ; -insert into t1 values (1,'one'); -insert into t1 values (2,'two'); -insert into t1 values (3,'three'); -insert into t1 values (4,'four'); -commit ; -delete from t9 ; -insert into t9 -set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, -c10= 1, c11= 1, c12 = 1, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=true, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t9 -set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, -c10= 9, c11= 9, c12 = 9, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=false, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; -commit ; -prepare stmt1 from 'delete from t1 where a=2' ; -execute stmt1; -select a,b from t1 where a=2; -a b -execute stmt1; -insert into t1 values(0,NULL); -set @arg00=NULL; -prepare stmt1 from 'delete from t1 where b=?' ; -execute stmt1 using @arg00; -select a,b from t1 where b is NULL ; -a b -0 NULL -set @arg00='one'; -execute stmt1 using @arg00; -select a,b from t1 where b=@arg00; -a b -prepare stmt1 from 'truncate table t1' ; -ERROR HY000: This command is not supported in the prepared statement protocol yet -test_sequence ------- update tests ------ -delete from t1 ; -insert into t1 values (1,'one'); -insert into t1 values (2,'two'); -insert into t1 values (3,'three'); -insert into t1 values (4,'four'); -commit ; -delete from t9 ; -insert into t9 -set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, -c10= 1, c11= 1, c12 = 1, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=true, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t9 -set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, -c10= 9, c11= 9, c12 = 9, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=false, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; -commit ; -prepare stmt1 from 'update t1 set b=''a=two'' where a=2' ; -execute stmt1; -select a,b from t1 where a=2; -a b -2 a=two -execute stmt1; -select a,b from t1 where a=2; -a b -2 a=two -set @arg00=NULL; -prepare stmt1 from 'update t1 set b=? where a=2' ; -execute stmt1 using @arg00; -select a,b from t1 where a=2; -a b -2 NULL -set @arg00='two'; -execute stmt1 using @arg00; -select a,b from t1 where a=2; -a b -2 two -set @arg00=2; -prepare stmt1 from 'update t1 set b=NULL where a=?' ; -execute stmt1 using @arg00; -select a,b from t1 where a=@arg00; -a b -2 NULL -update t1 set b='two' where a=@arg00; -set @arg00=2000; -execute stmt1 using @arg00; -select a,b from t1 where a=@arg00; -a b -set @arg00=2; -set @arg01=22; -prepare stmt1 from 'update t1 set a=? where a=?' ; -execute stmt1 using @arg00, @arg00; -select a,b from t1 where a=@arg00; -a b -2 two -execute stmt1 using @arg01, @arg00; -select a,b from t1 where a=@arg01; -a b -22 two -execute stmt1 using @arg00, @arg01; -select a,b from t1 where a=@arg00; -a b -2 two -set @arg00=NULL; -set @arg01=2; -execute stmt1 using @arg00, @arg01; -Warnings: -Warning 1263 Data truncated; NULL supplied to NOT NULL column 'a' at row 1 -select a,b from t1 order by a; -a b -0 two -1 one -3 three -4 four -set @arg00=0; -execute stmt1 using @arg01, @arg00; -select a,b from t1 order by a; -a b -1 one -2 two -3 three -4 four -set @arg00=23; -set @arg01='two'; -set @arg02=2; -set @arg03='two'; -set @arg04=2; -drop table if exists t2; -create table t2 as select a,b from t1 ; -prepare stmt1 from 'update t1 set a=? where b=? - and a in (select ? from t2 - where b = ? or a = ?)'; -execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04 ; -affected rows: 1 -info: Rows matched: 1 Changed: 1 Warnings: 0 -select a,b from t1 where a = @arg00 ; -a b -23 two -prepare stmt1 from 'update t1 set a=? where b=? - and a not in (select ? from t2 - where b = ? or a = ?)'; -execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ; -affected rows: 1 -info: Rows matched: 1 Changed: 1 Warnings: 0 -select a,b from t1 order by a ; -a b -1 one -2 two -3 three -4 four -drop table t2 ; -create table t2 -( -a int, b varchar(30), -primary key(a) -) engine = 'BDB' ; -insert into t2(a,b) select a, b from t1 ; -prepare stmt1 from 'update t1 set a=? where b=? - and a in (select ? from t2 - where b = ? or a = ?)'; -execute stmt1 using @arg00, @arg01, @arg02, @arg03, @arg04 ; -affected rows: 1 -info: Rows matched: 1 Changed: 1 Warnings: 0 -select a,b from t1 where a = @arg00 ; -a b -23 two -prepare stmt1 from 'update t1 set a=? where b=? - and a not in (select ? from t2 - where b = ? or a = ?)'; -execute stmt1 using @arg04, @arg01, @arg02, @arg03, @arg00 ; -affected rows: 1 -info: Rows matched: 1 Changed: 1 Warnings: 0 -select a,b from t1 order by a ; -a b -1 one -2 two -3 three -4 four -drop table t2 ; -set @arg00=1; -prepare stmt1 from 'update t1 set b=''bla'' -where a=2 -limit 1'; -execute stmt1 ; -select a,b from t1 where b = 'bla' ; -a b -2 bla -prepare stmt1 from 'update t1 set b=''bla'' -where a=2 -limit ?'; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?' at line 3 -test_sequence ------- insert tests ------ -delete from t1 ; -insert into t1 values (1,'one'); -insert into t1 values (2,'two'); -insert into t1 values (3,'three'); -insert into t1 values (4,'four'); -commit ; -delete from t9 ; -insert into t9 -set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, -c10= 1, c11= 1, c12 = 1, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=true, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t9 -set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, -c10= 9, c11= 9, c12 = 9, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=false, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; -commit ; -prepare stmt1 from 'insert into t1 values(5, ''five'' )'; -execute stmt1; -select a,b from t1 where a = 5; -a b -5 five -set @arg00='six' ; -prepare stmt1 from 'insert into t1 values(6, ? )'; -execute stmt1 using @arg00; -select a,b from t1 where b = @arg00; -a b -6 six -execute stmt1 using @arg00; -ERROR 23000: Duplicate entry '6' for key 1 -set @arg00=NULL ; -prepare stmt1 from 'insert into t1 values(0, ? )'; -execute stmt1 using @arg00; -select a,b from t1 where b is NULL; -a b -0 NULL -set @arg00=8 ; -set @arg01='eight' ; -prepare stmt1 from 'insert into t1 values(?, ? )'; -execute stmt1 using @arg00, @arg01 ; -select a,b from t1 where b = @arg01; -a b -8 eight -set @NULL= null ; -set @arg00= 'abc' ; -execute stmt1 using @NULL, @NULL ; -ERROR 23000: Column 'a' cannot be null -execute stmt1 using @NULL, @NULL ; -ERROR 23000: Column 'a' cannot be null -execute stmt1 using @NULL, @arg00 ; -ERROR 23000: Column 'a' cannot be null -execute stmt1 using @NULL, @arg00 ; -ERROR 23000: Column 'a' cannot be null -set @arg01= 10000 + 2 ; -execute stmt1 using @arg01, @arg00 ; -set @arg01= 10000 + 1 ; -execute stmt1 using @arg01, @arg00 ; -select * from t1 where a > 10000 order by a ; -a b -10001 abc -10002 abc -delete from t1 where a > 10000 ; -set @arg01= 10000 + 2 ; -execute stmt1 using @arg01, @NULL ; -set @arg01= 10000 + 1 ; -execute stmt1 using @arg01, @NULL ; -select * from t1 where a > 10000 order by a ; -a b -10001 NULL -10002 NULL -delete from t1 where a > 10000 ; -set @arg01= 10000 + 10 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 9 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 8 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 7 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 6 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 5 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 4 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 3 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 2 ; -execute stmt1 using @arg01, @arg01 ; -set @arg01= 10000 + 1 ; -execute stmt1 using @arg01, @arg01 ; -select * from t1 where a > 10000 order by a ; -a b -10001 10001 -10002 10002 -10003 10003 -10004 10004 -10005 10005 -10006 10006 -10007 10007 -10008 10008 -10009 10009 -10010 10010 -delete from t1 where a > 10000 ; -set @arg00=81 ; -set @arg01='8-1' ; -set @arg02=82 ; -set @arg03='8-2' ; -prepare stmt1 from 'insert into t1 values(?,?),(?,?)'; -execute stmt1 using @arg00, @arg01, @arg02, @arg03 ; -select a,b from t1 where a in (@arg00,@arg02) ; -a b -81 8-1 -82 8-2 -set @arg00=9 ; -set @arg01='nine' ; -prepare stmt1 from 'insert into t1 set a=?, b=? '; -execute stmt1 using @arg00, @arg01 ; -select a,b from t1 where a = @arg00 ; -a b -9 nine -set @arg00=6 ; -set @arg01=1 ; -prepare stmt1 from 'insert into t1 set a=?, b=''sechs'' - on duplicate key update a=a + ?, b=concat(b,''modified'') '; -execute stmt1 using @arg00, @arg01; -select * from t1 order by a; -a b -0 NULL -1 one -2 two -3 three -4 four -5 five -7 sixmodified -8 eight -9 nine -81 8-1 -82 8-2 -set @arg00=81 ; -set @arg01=1 ; -execute stmt1 using @arg00, @arg01; -ERROR 23000: Duplicate entry '82' for key 1 -drop table if exists t2 ; -create table t2 (id int auto_increment primary key) -ENGINE= 'BDB' ; -prepare stmt1 from ' select last_insert_id() ' ; -insert into t2 values (NULL) ; -execute stmt1 ; -last_insert_id() -1 -insert into t2 values (NULL) ; -execute stmt1 ; -last_insert_id() -2 -drop table t2 ; -set @1000=1000 ; -set @x1000_2="x1000_2" ; -set @x1000_3="x1000_3" ; -set @x1000="x1000" ; -set @1100=1100 ; -set @x1100="x1100" ; -set @100=100 ; -set @updated="updated" ; -insert into t1 values(1000,'x1000_1') ; -insert into t1 values(@1000,@x1000_2),(@1000,@x1000_3) -on duplicate key update a = a + @100, b = concat(b,@updated) ; -select a,b from t1 where a >= 1000 order by a ; -a b -1000 x1000_3 -1100 x1000_1updated -delete from t1 where a >= 1000 ; -insert into t1 values(1000,'x1000_1') ; -prepare stmt1 from ' insert into t1 values(?,?),(?,?) - on duplicate key update a = a + ?, b = concat(b,?) '; -execute stmt1 using @1000, @x1000_2, @1000, @x1000_3, @100, @updated ; -select a,b from t1 where a >= 1000 order by a ; -a b -1000 x1000_3 -1100 x1000_1updated -delete from t1 where a >= 1000 ; -insert into t1 values(1000,'x1000_1') ; -execute stmt1 using @1000, @x1000_2, @1100, @x1000_3, @100, @updated ; -select a,b from t1 where a >= 1000 order by a ; -a b -1200 x1000_1updatedupdated -delete from t1 where a >= 1000 ; -prepare stmt1 from ' replace into t1 (a,b) select 100, ''hundred'' '; -execute stmt1; -execute stmt1; -execute stmt1; -test_sequence ------- multi table tests ------ -delete from t1 ; -delete from t9 ; -insert into t1(a,b) values (1, 'one'), (2, 'two'), (3, 'three') ; -insert into t9 (c1,c21) -values (1, 'one'), (2, 'two'), (3, 'three') ; -prepare stmt_delete from " delete t1, t9 - from t1, t9 where t1.a=t9.c1 and t1.b='updated' "; -prepare stmt_update from " update t1, t9 - set t1.b='updated', t9.c21='updated' - where t1.a=t9.c1 and t1.a=? "; -prepare stmt_select1 from " select a, b from t1 order by a" ; -prepare stmt_select2 from " select c1, c21 from t9 order by c1" ; -set @arg00= 1 ; -execute stmt_update using @arg00 ; -execute stmt_delete ; -execute stmt_select1 ; -a b -2 two -3 three -execute stmt_select2 ; -c1 c21 -2 two -3 three -set @arg00= @arg00 + 1 ; -execute stmt_update using @arg00 ; -execute stmt_delete ; -execute stmt_select1 ; -a b -3 three -execute stmt_select2 ; -c1 c21 -3 three -set @arg00= @arg00 + 1 ; -execute stmt_update using @arg00 ; -execute stmt_delete ; -execute stmt_select1 ; -a b -execute stmt_select2 ; -c1 c21 -set @arg00= @arg00 + 1 ; -delete from t1 ; -insert into t1 values (1,'one'); -insert into t1 values (2,'two'); -insert into t1 values (3,'three'); -insert into t1 values (4,'four'); -commit ; -delete from t9 ; -insert into t9 -set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, -c10= 1, c11= 1, c12 = 1, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=true, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t9 -set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, -c10= 9, c11= 9, c12 = 9, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=false, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; -commit ; -insert into t1 values(0,NULL) ; -set @duplicate='duplicate ' ; -set @1000=1000 ; -set @5=5 ; -select a,b from t1 where a < 5 order by a ; -a b -0 NULL -1 one -2 two -3 three -4 four -insert into t1 select a + @1000, concat(@duplicate,b) from t1 -where a < @5 ; -affected rows: 5 -info: Records: 5 Duplicates: 0 Warnings: 0 -select a,b from t1 where a >= 1000 order by a ; -a b -1000 NULL -1001 duplicate one -1002 duplicate two -1003 duplicate three -1004 duplicate four -delete from t1 where a >= 1000 ; -prepare stmt1 from ' insert into t1 select a + ?, concat(?,b) from t1 -where a < ? ' ; -execute stmt1 using @1000, @duplicate, @5; -affected rows: 5 -info: Records: 5 Duplicates: 0 Warnings: 0 -select a,b from t1 where a >= 1000 order by a ; -a b -1000 NULL -1001 duplicate one -1002 duplicate two -1003 duplicate three -1004 duplicate four -delete from t1 where a >= 1000 ; -set @float=1.00; -set @five='five' ; -drop table if exists t2; -create table t2 like t1 ; -insert into t2 (b,a) -select @duplicate, sum(first.a) from t1 first, t1 second -where first.a <> @5 and second.b = first.b -and second.b <> @five -group by second.b -having sum(second.a) > @2 -union -select b, a + @100 from t1 -where (a,b) in ( select sqrt(a+@1)+CAST(@float AS signed),b -from t1); -affected rows: 3 -info: Records: 3 Duplicates: 0 Warnings: 0 -select a,b from t2 order by a ; -a b -3 duplicate -4 duplicate -103 three -delete from t2 ; -prepare stmt1 from ' insert into t2 (b,a) -select ?, sum(first.a) - from t1 first, t1 second - where first.a <> ? and second.b = first.b and second.b <> ? - group by second.b - having sum(second.a) > ? -union -select b, a + ? from t1 - where (a,b) in ( select sqrt(a+?)+CAST(? AS signed),b - from t1 ) ' ; -execute stmt1 using @duplicate, @5, @five, @2, @100, @1, @float ; -affected rows: 3 -info: Records: 3 Duplicates: 0 Warnings: 0 -select a,b from t2 order by a ; -a b -3 duplicate -4 duplicate -103 three -drop table t2; -drop table if exists t5 ; -set @arg01= 8; -set @arg02= 8.0; -set @arg03= 80.00000000000e-1; -set @arg04= 'abc' ; -set @arg05= CAST('abc' as binary) ; -set @arg06= '1991-08-05' ; -set @arg07= CAST('1991-08-05' as date); -set @arg08= '1991-08-05 01:01:01' ; -set @arg09= CAST('1991-08-05 01:01:01' as datetime) ; -set @arg10= unix_timestamp('1991-01-01 01:01:01'); -set @arg11= YEAR('1991-01-01 01:01:01'); -set @arg12= 8 ; -set @arg12= NULL ; -set @arg13= 8.0 ; -set @arg13= NULL ; -set @arg14= 'abc'; -set @arg14= NULL ; -set @arg15= CAST('abc' as binary) ; -set @arg15= NULL ; -create table t5 as select -8 as const01, @arg01 as param01, -8.0 as const02, @arg02 as param02, -80.00000000000e-1 as const03, @arg03 as param03, -'abc' as const04, @arg04 as param04, -CAST('abc' as binary) as const05, @arg05 as param05, -'1991-08-05' as const06, @arg06 as param06, -CAST('1991-08-05' as date) as const07, @arg07 as param07, -'1991-08-05 01:01:01' as const08, @arg08 as param08, -CAST('1991-08-05 01:01:01' as datetime) as const09, @arg09 as param09, -unix_timestamp('1991-01-01 01:01:01') as const10, @arg10 as param10, -YEAR('1991-01-01 01:01:01') as const11, @arg11 as param11, -NULL as const12, @arg12 as param12, -@arg13 as param13, -@arg14 as param14, -@arg15 as param15; -show create table t5 ; -Table Create Table -t5 CREATE TABLE `t5` ( - `const01` bigint(1) NOT NULL default '0', - `param01` bigint(20) default NULL, - `const02` double(3,1) NOT NULL default '0.0', - `param02` double default NULL, - `const03` double NOT NULL default '0', - `param03` double default NULL, - `const04` char(3) NOT NULL default '', - `param04` longtext, - `const05` binary(3) NOT NULL default '', - `param05` longblob, - `const06` varchar(10) NOT NULL default '', - `param06` longtext, - `const07` date default NULL, - `param07` longblob, - `const08` varchar(19) NOT NULL default '', - `param08` longtext, - `const09` datetime default NULL, - `param09` longblob, - `const10` int(10) NOT NULL default '0', - `param10` bigint(20) default NULL, - `const11` int(4) default NULL, - `param11` bigint(20) default NULL, - `const12` binary(0) default NULL, - `param12` bigint(20) default NULL, - `param13` double default NULL, - `param14` longtext, - `param15` longblob -) ENGINE=MyISAM DEFAULT CHARSET=latin1 -select * from t5 ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def test t5 t5 const01 const01 8 1 1 N 32769 0 63 -def test t5 t5 param01 param01 8 20 1 Y 32768 0 63 -def test t5 t5 const02 const02 5 3 3 N 32769 1 63 -def test t5 t5 param02 param02 5 20 1 Y 32768 31 63 -def test t5 t5 const03 const03 5 23 1 N 32769 31 63 -def test t5 t5 param03 param03 5 20 1 Y 32768 31 63 -def test t5 t5 const04 const04 254 3 3 N 1 0 8 -def test t5 t5 param04 param04 252 16777215 3 Y 16 0 8 -def test t5 t5 const05 const05 254 3 3 N 129 0 63 -def test t5 t5 param05 param05 252 16777215 3 Y 144 0 63 -def test t5 t5 const06 const06 253 10 10 N 1 0 8 -def test t5 t5 param06 param06 252 16777215 10 Y 16 0 8 -def test t5 t5 const07 const07 10 10 10 Y 128 0 63 -def test t5 t5 param07 param07 252 16777215 10 Y 144 0 63 -def test t5 t5 const08 const08 253 19 19 N 1 0 8 -def test t5 t5 param08 param08 252 16777215 19 Y 16 0 8 -def test t5 t5 const09 const09 12 19 19 Y 128 0 63 -def test t5 t5 param09 param09 252 16777215 19 Y 144 0 63 -def test t5 t5 const10 const10 3 10 9 N 32769 0 63 -def test t5 t5 param10 param10 8 20 9 Y 32768 0 63 -def test t5 t5 const11 const11 3 4 4 Y 32768 0 63 -def test t5 t5 param11 param11 8 20 4 Y 32768 0 63 -def test t5 t5 const12 const12 254 0 0 Y 128 0 63 -def test t5 t5 param12 param12 8 20 0 Y 32768 0 63 -def test t5 t5 param13 param13 5 20 0 Y 32768 31 63 -def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8 -def test t5 t5 param15 param15 252 16777215 0 Y 144 0 63 -const01 8 -param01 8 -const02 8.0 -param02 8 -const03 8 -param03 8 -const04 abc -param04 abc -const05 abc -param05 abc -const06 1991-08-05 -param06 1991-08-05 -const07 1991-08-05 -param07 1991-08-05 -const08 1991-08-05 01:01:01 -param08 1991-08-05 01:01:01 -const09 1991-08-05 01:01:01 -param09 1991-08-05 01:01:01 -const10 662680861 -param10 662680861 -const11 1991 -param11 1991 -const12 NULL -param12 NULL -param13 NULL -param14 NULL -param15 NULL -drop table t5 ; -test_sequence ------- data type conversion tests ------ -delete from t1 ; -insert into t1 values (1,'one'); -insert into t1 values (2,'two'); -insert into t1 values (3,'three'); -insert into t1 values (4,'four'); -commit ; -delete from t9 ; -insert into t9 -set c1= 1, c2= 1, c3= 1, c4= 1, c5= 1, c6= 1, c7= 1, c8= 1, c9= 1, -c10= 1, c11= 1, c12 = 1, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=true, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='one', c32= 'monday'; -insert into t9 -set c1= 9, c2= 9, c3= 9, c4= 9, c5= 9, c6= 9, c7= 9, c8= 9, c9= 9, -c10= 9, c11= 9, c12 = 9, -c13= '2004-02-29', c14= '2004-02-29 11:11:11', c15= '2004-02-29 11:11:11', -c16= '11:11:11', c17= '2004', -c18= 1, c19=false, c20= 'a', c21= '123456789a', -c22= '123456789a123456789b123456789c', c23= 'tinyblob', c24= 'tinytext', -c25= 'blob', c26= 'text', c27= 'mediumblob', c28= 'mediumtext', -c29= 'longblob', c30= 'longtext', c31='two', c32= 'tuesday'; -commit ; -insert into t9 set c1= 0, c15= '1991-01-01 01:01:01' ; -select * from t9 order by c1 ; -c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 c17 c18 c19 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 c31 c32 -0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -9 9 9 9 9 9 9 9 9 9 9.0000 9.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 0 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext two tuesday -test_sequence ------- select @parameter:= column ------ -prepare full_info from "select @arg01, @arg02, @arg03, @arg04, - @arg05, @arg06, @arg07, @arg08, - @arg09, @arg10, @arg11, @arg12, - @arg13, @arg14, @arg15, @arg16, - @arg17, @arg18, @arg19, @arg20, - @arg21, @arg22, @arg23, @arg24, - @arg25, @arg26, @arg27, @arg28, - @arg29, @arg30, @arg31, @arg32" ; -select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, -@arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8, -@arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12, -@arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16, -@arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20, -@arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24, -@arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28, -@arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32 -from t9 where c1= 1 ; -@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 -1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 1 Y 128 31 63 -def @arg03 254 20 1 Y 128 31 63 -def @arg04 254 20 1 Y 128 31 63 -def @arg05 254 20 1 Y 128 31 63 -def @arg06 254 20 1 Y 128 31 63 -def @arg07 254 20 1 Y 128 31 63 -def @arg08 254 20 1 Y 128 31 63 -def @arg09 254 20 1 Y 128 31 63 -def @arg10 254 20 1 Y 128 31 63 -def @arg11 254 20 1 Y 128 31 63 -def @arg12 254 20 1 Y 128 31 63 -def @arg13 254 8192 10 Y 128 31 63 -def @arg14 254 8192 19 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 8 Y 128 31 63 -def @arg17 254 20 4 Y 128 31 63 -def @arg18 254 20 1 Y 128 31 63 -def @arg19 254 20 1 Y 128 31 63 -def @arg20 254 8192 1 Y 0 31 8 -def @arg21 254 8192 10 Y 0 31 8 -def @arg22 254 8192 30 Y 0 31 8 -def @arg23 254 8192 8 Y 128 31 63 -def @arg24 254 8192 8 Y 0 31 8 -def @arg25 254 8192 4 Y 128 31 63 -def @arg26 254 8192 4 Y 0 31 8 -def @arg27 254 8192 10 Y 128 31 63 -def @arg28 254 8192 10 Y 0 31 8 -def @arg29 254 8192 8 Y 128 31 63 -def @arg30 254 8192 8 Y 0 31 8 -def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, -@arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8, -@arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12, -@arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16, -@arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20, -@arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24, -@arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28, -@arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32 -from t9 where c1= 0 ; -@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 -0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 0 Y 128 31 63 -def @arg03 254 20 0 Y 128 31 63 -def @arg04 254 20 0 Y 128 31 63 -def @arg05 254 20 0 Y 128 31 63 -def @arg06 254 20 0 Y 128 31 63 -def @arg07 254 20 0 Y 128 31 63 -def @arg08 254 20 0 Y 128 31 63 -def @arg09 254 20 0 Y 128 31 63 -def @arg10 254 20 0 Y 128 31 63 -def @arg11 254 20 0 Y 128 31 63 -def @arg12 254 20 0 Y 128 31 63 -def @arg13 254 8192 0 Y 128 31 63 -def @arg14 254 8192 0 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 0 Y 128 31 63 -def @arg17 254 20 0 Y 128 31 63 -def @arg18 254 20 0 Y 128 31 63 -def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 0 31 8 -def @arg21 254 8192 0 Y 0 31 8 -def @arg22 254 8192 0 Y 0 31 8 -def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 0 31 8 -def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 0 31 8 -def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 0 31 8 -def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 0 31 8 -def @arg31 254 8192 0 Y 0 31 8 -def @arg32 254 8192 0 Y 0 31 8 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -prepare stmt1 from "select - @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, - @arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8, - @arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12, - @arg13:= c13, @arg14:= c14, @arg15:= c15, @arg16:= c16, - @arg17:= c17, @arg18:= c18, @arg19:= c19, @arg20:= c20, - @arg21:= c21, @arg22:= c22, @arg23:= c23, @arg24:= c24, - @arg25:= c25, @arg26:= c26, @arg27:= c27, @arg28:= c28, - @arg29:= c29, @arg30:= c30, @arg31:= c31, @arg32:= c32 -from t9 where c1= ?" ; -set @my_key= 1 ; -execute stmt1 using @my_key ; -@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 -1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 1 Y 128 31 63 -def @arg03 254 20 1 Y 128 31 63 -def @arg04 254 20 1 Y 128 31 63 -def @arg05 254 20 1 Y 128 31 63 -def @arg06 254 20 1 Y 128 31 63 -def @arg07 254 20 1 Y 128 31 63 -def @arg08 254 20 1 Y 128 31 63 -def @arg09 254 20 1 Y 128 31 63 -def @arg10 254 20 1 Y 128 31 63 -def @arg11 254 20 1 Y 128 31 63 -def @arg12 254 20 1 Y 128 31 63 -def @arg13 254 8192 10 Y 128 31 63 -def @arg14 254 8192 19 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 8 Y 128 31 63 -def @arg17 254 20 4 Y 128 31 63 -def @arg18 254 20 1 Y 128 31 63 -def @arg19 254 20 1 Y 128 31 63 -def @arg20 254 8192 1 Y 0 31 8 -def @arg21 254 8192 10 Y 0 31 8 -def @arg22 254 8192 30 Y 0 31 8 -def @arg23 254 8192 8 Y 128 31 63 -def @arg24 254 8192 8 Y 0 31 8 -def @arg25 254 8192 4 Y 128 31 63 -def @arg26 254 8192 4 Y 0 31 8 -def @arg27 254 8192 10 Y 128 31 63 -def @arg28 254 8192 10 Y 0 31 8 -def @arg29 254 8192 8 Y 128 31 63 -def @arg30 254 8192 8 Y 0 31 8 -def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -set @my_key= 0 ; -execute stmt1 using @my_key ; -@arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 -0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 0 Y 128 31 63 -def @arg03 254 20 0 Y 128 31 63 -def @arg04 254 20 0 Y 128 31 63 -def @arg05 254 20 0 Y 128 31 63 -def @arg06 254 20 0 Y 128 31 63 -def @arg07 254 20 0 Y 128 31 63 -def @arg08 254 20 0 Y 128 31 63 -def @arg09 254 20 0 Y 128 31 63 -def @arg10 254 20 0 Y 128 31 63 -def @arg11 254 20 0 Y 128 31 63 -def @arg12 254 20 0 Y 128 31 63 -def @arg13 254 8192 0 Y 128 31 63 -def @arg14 254 8192 0 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 0 Y 128 31 63 -def @arg17 254 20 0 Y 128 31 63 -def @arg18 254 20 0 Y 128 31 63 -def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 0 31 8 -def @arg21 254 8192 0 Y 0 31 8 -def @arg22 254 8192 0 Y 0 31 8 -def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 0 31 8 -def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 0 31 8 -def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 0 31 8 -def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 0 31 8 -def @arg31 254 8192 0 Y 0 31 8 -def @arg32 254 8192 0 Y 0 31 8 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -prepare stmt1 from "select ? := c1 from t9 where c1= 1" ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':= c1 from t9 where c1= 1' at line 1 -test_sequence ------- select column, .. into @parm,.. ------ -select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, -c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, -c25, c26, c27, c28, c29, c30, c31, c32 -into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, -@arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, -@arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24, -@arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 -from t9 where c1= 1 ; -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 1 Y 128 31 63 -def @arg03 254 20 1 Y 128 31 63 -def @arg04 254 20 1 Y 128 31 63 -def @arg05 254 20 1 Y 128 31 63 -def @arg06 254 20 1 Y 128 31 63 -def @arg07 254 20 1 Y 128 31 63 -def @arg08 254 20 1 Y 128 31 63 -def @arg09 254 20 1 Y 128 31 63 -def @arg10 254 20 1 Y 128 31 63 -def @arg11 254 20 1 Y 128 31 63 -def @arg12 254 20 1 Y 128 31 63 -def @arg13 254 8192 10 Y 128 31 63 -def @arg14 254 8192 19 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 8 Y 128 31 63 -def @arg17 254 20 4 Y 128 31 63 -def @arg18 254 20 1 Y 128 31 63 -def @arg19 254 20 1 Y 128 31 63 -def @arg20 254 8192 1 Y 0 31 8 -def @arg21 254 8192 10 Y 0 31 8 -def @arg22 254 8192 30 Y 0 31 8 -def @arg23 254 8192 8 Y 128 31 63 -def @arg24 254 8192 8 Y 0 31 8 -def @arg25 254 8192 4 Y 128 31 63 -def @arg26 254 8192 4 Y 0 31 8 -def @arg27 254 8192 10 Y 128 31 63 -def @arg28 254 8192 10 Y 0 31 8 -def @arg29 254 8192 8 Y 128 31 63 -def @arg30 254 8192 8 Y 0 31 8 -def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, -c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, -c25, c26, c27, c28, c29, c30, c31, c32 -into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, -@arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, -@arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24, -@arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 -from t9 where c1= 0 ; -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 0 Y 128 31 63 -def @arg03 254 20 0 Y 128 31 63 -def @arg04 254 20 0 Y 128 31 63 -def @arg05 254 20 0 Y 128 31 63 -def @arg06 254 20 0 Y 128 31 63 -def @arg07 254 20 0 Y 128 31 63 -def @arg08 254 20 0 Y 128 31 63 -def @arg09 254 20 0 Y 128 31 63 -def @arg10 254 20 0 Y 128 31 63 -def @arg11 254 20 0 Y 128 31 63 -def @arg12 254 20 0 Y 128 31 63 -def @arg13 254 8192 0 Y 128 31 63 -def @arg14 254 8192 0 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 0 Y 128 31 63 -def @arg17 254 20 0 Y 128 31 63 -def @arg18 254 20 0 Y 128 31 63 -def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 0 31 8 -def @arg21 254 8192 0 Y 0 31 8 -def @arg22 254 8192 0 Y 0 31 8 -def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 0 31 8 -def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 0 31 8 -def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 0 31 8 -def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 0 31 8 -def @arg31 254 8192 0 Y 0 31 8 -def @arg32 254 8192 0 Y 0 31 8 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -prepare stmt1 from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, - c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, - c25, c26, c27, c28, c29, c30, c31, c32 -into @arg01, @arg02, @arg03, @arg04, @arg05, @arg06, @arg07, @arg08, - @arg09, @arg10, @arg11, @arg12, @arg13, @arg14, @arg15, @arg16, - @arg17, @arg18, @arg19, @arg20, @arg21, @arg22, @arg23, @arg24, - @arg25, @arg26, @arg27, @arg28, @arg29, @arg30, @arg31, @arg32 -from t9 where c1= ?" ; -set @my_key= 1 ; -execute stmt1 using @my_key ; -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 1 Y 128 31 63 -def @arg03 254 20 1 Y 128 31 63 -def @arg04 254 20 1 Y 128 31 63 -def @arg05 254 20 1 Y 128 31 63 -def @arg06 254 20 1 Y 128 31 63 -def @arg07 254 20 1 Y 128 31 63 -def @arg08 254 20 1 Y 128 31 63 -def @arg09 254 20 1 Y 128 31 63 -def @arg10 254 20 1 Y 128 31 63 -def @arg11 254 20 1 Y 128 31 63 -def @arg12 254 20 1 Y 128 31 63 -def @arg13 254 8192 10 Y 128 31 63 -def @arg14 254 8192 19 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 8 Y 128 31 63 -def @arg17 254 20 4 Y 128 31 63 -def @arg18 254 20 1 Y 128 31 63 -def @arg19 254 20 1 Y 128 31 63 -def @arg20 254 8192 1 Y 0 31 8 -def @arg21 254 8192 10 Y 0 31 8 -def @arg22 254 8192 30 Y 0 31 8 -def @arg23 254 8192 8 Y 128 31 63 -def @arg24 254 8192 8 Y 0 31 8 -def @arg25 254 8192 4 Y 128 31 63 -def @arg26 254 8192 4 Y 0 31 8 -def @arg27 254 8192 10 Y 128 31 63 -def @arg28 254 8192 10 Y 0 31 8 -def @arg29 254 8192 8 Y 128 31 63 -def @arg30 254 8192 8 Y 0 31 8 -def @arg31 254 8192 3 Y 0 31 8 -def @arg32 254 8192 6 Y 128 31 63 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday -set @my_key= 0 ; -execute stmt1 using @my_key ; -execute full_info ; -Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def @arg01 254 20 1 Y 128 31 63 -def @arg02 254 20 0 Y 128 31 63 -def @arg03 254 20 0 Y 128 31 63 -def @arg04 254 20 0 Y 128 31 63 -def @arg05 254 20 0 Y 128 31 63 -def @arg06 254 20 0 Y 128 31 63 -def @arg07 254 20 0 Y 128 31 63 -def @arg08 254 20 0 Y 128 31 63 -def @arg09 254 20 0 Y 128 31 63 -def @arg10 254 20 0 Y 128 31 63 -def @arg11 254 20 0 Y 128 31 63 -def @arg12 254 20 0 Y 128 31 63 -def @arg13 254 8192 0 Y 128 31 63 -def @arg14 254 8192 0 Y 128 31 63 -def @arg15 254 8192 19 Y 128 31 63 -def @arg16 254 8192 0 Y 128 31 63 -def @arg17 254 20 0 Y 128 31 63 -def @arg18 254 20 0 Y 128 31 63 -def @arg19 254 20 0 Y 128 31 63 -def @arg20 254 8192 0 Y 0 31 8 -def @arg21 254 8192 0 Y 0 31 8 -def @arg22 254 8192 0 Y 0 31 8 -def @arg23 254 8192 0 Y 128 31 63 -def @arg24 254 8192 0 Y 0 31 8 -def @arg25 254 8192 0 Y 128 31 63 -def @arg26 254 8192 0 Y 0 31 8 -def @arg27 254 8192 0 Y 128 31 63 -def @arg28 254 8192 0 Y 0 31 8 -def @arg29 254 8192 0 Y 128 31 63 -def @arg30 254 8192 0 Y 0 31 8 -def @arg31 254 8192 0 Y 0 31 8 -def @arg32 254 8192 0 Y 0 31 8 -@arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -0 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1991-01-01 01:01:01 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -prepare stmt1 from "select c1 into ? from t9 where c1= 1" ; -ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? from t9 where c1= 1' at line 1 -test_sequence --- insert into numeric columns -- -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20 ) ; -set @arg00= 21 ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ) ; -prepare stmt1 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22 )" ; -execute stmt1 ; -set @arg00= 23; -prepare stmt2 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, -30.0, 30.0, 30.0 ) ; -set @arg00= 31.0 ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ) ; -prepare stmt1 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, - 32.0, 32.0, 32.0 )" ; -execute stmt1 ; -set @arg00= 33.0; -prepare stmt2 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( '40', '40', '40', '40', '40', '40', '40', '40', -'40', '40', '40' ) ; -set @arg00= '41' ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ) ; -prepare stmt1 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( '42', '42', '42', '42', '42', '42', '42', '42', - '42', '42', '42' )" ; -execute stmt1 ; -set @arg00= '43'; -prepare stmt2 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( CAST('50' as binary), CAST('50' as binary), -CAST('50' as binary), CAST('50' as binary), CAST('50' as binary), -CAST('50' as binary), CAST('50' as binary), CAST('50' as binary), -CAST('50' as binary), CAST('50' as binary), CAST('50' as binary) ) ; -set @arg00= CAST('51' as binary) ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ) ; -prepare stmt1 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( CAST('52' as binary), CAST('52' as binary), - CAST('52' as binary), CAST('52' as binary), CAST('52' as binary), - CAST('52' as binary), CAST('52' as binary), CAST('52' as binary), - CAST('52' as binary), CAST('52' as binary), CAST('52' as binary) )" ; -execute stmt1 ; -set @arg00= CAST('53' as binary) ; -prepare stmt2 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -set @arg00= 2 ; -set @arg00= NULL ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( 60, NULL, NULL, NULL, NULL, NULL, NULL, NULL, -NULL, NULL, NULL ) ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( 61, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ) ; -prepare stmt1 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( 62, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL )" ; -execute stmt1 ; -prepare stmt2 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( 63, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -set @arg00= 8.0 ; -set @arg00= NULL ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( 71, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ) ; -prepare stmt2 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( 73, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -set @arg00= 'abc' ; -set @arg00= NULL ; -insert into t9 -( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values -( 81, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ) ; -prepare stmt2 from "insert into t9 - ( c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( 83, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -execute stmt2 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 -from t9 where c1 >= 20 -order by c1 ; -c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c12 -20 20 20 20 20 20 20 20 20 20 20.0000 -21 21 21 21 21 21 21 21 21 21 21.0000 -22 22 22 22 22 22 22 22 22 22 22.0000 -23 23 23 23 23 23 23 23 23 23 23.0000 -30 30 30 30 30 30 30 30 30 30 30.0000 -31 31 31 31 31 31 31 31 31 31 31.0000 -32 32 32 32 32 32 32 32 32 32 32.0000 -33 33 33 33 33 33 33 33 33 33 33.0000 -40 40 40 40 40 40 40 40 40 40 40.0000 -41 41 41 41 41 41 41 41 41 41 41.0000 -42 42 42 42 42 42 42 42 42 42 42.0000 -43 43 43 43 43 43 43 43 43 43 43.0000 -50 50 50 50 50 50 50 50 50 50 50.0000 -51 51 51 51 51 51 51 51 51 51 51.0000 -52 52 52 52 52 52 52 52 52 52 52.0000 -53 53 53 53 53 53 53 53 53 53 53.0000 -60 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -61 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -62 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -63 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -71 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -73 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -81 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -83 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -test_sequence --- select .. where numeric column = .. -- -set @arg00= 20; -select 'true' as found from t9 -where c1= 20 and c2= 20 and c3= 20 and c4= 20 and c5= 20 and c6= 20 and c7= 20 -and c8= 20 and c9= 20 and c10= 20 and c12= 20; -found -true -select 'true' as found from t9 -where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 -and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 -and c12= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c2= 20 and c3= 20 and c4= 20 and c5= 20 and c6= 20 and c7= 20 - and c8= 20 and c9= 20 and c10= 20 and c12= 20 "; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? - and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? - and c12= ? "; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -found -true -set @arg00= 20.0; -select 'true' as found from t9 -where c1= 20.0 and c2= 20.0 and c3= 20.0 and c4= 20.0 and c5= 20.0 and c6= 20.0 -and c7= 20.0 and c8= 20.0 and c9= 20.0 and c10= 20.0 and c12= 20.0; -found -true -select 'true' as found from t9 -where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 -and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 -and c12= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20.0 and c2= 20.0 and c3= 20.0 and c4= 20.0 and c5= 20.0 and c6= 20.0 - and c7= 20.0 and c8= 20.0 and c9= 20.0 and c10= 20.0 and c12= 20.0 "; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? - and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? - and c12= ? "; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -found -true -select 'true' as found from t9 -where c1= '20' and c2= '20' and c3= '20' and c4= '20' and c5= '20' and c6= '20' - and c7= '20' and c8= '20' and c9= '20' and c10= '20' and c12= '20'; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= '20' and c2= '20' and c3= '20' and c4= '20' and c5= '20' and c6= '20' - and c7= '20' and c8= '20' and c9= '20' and c10= '20' and c12= '20' "; -execute stmt1 ; -found -true -set @arg00= '20'; -select 'true' as found from t9 -where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 -and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 -and c12= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? - and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? - and c12= ? "; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -found -true -select 'true' as found from t9 -where c1= CAST('20' as binary) and c2= CAST('20' as binary) and -c3= CAST('20' as binary) and c4= CAST('20' as binary) and -c5= CAST('20' as binary) and c6= CAST('20' as binary) and -c7= CAST('20' as binary) and c8= CAST('20' as binary) and -c9= CAST('20' as binary) and c10= CAST('20' as binary) and -c12= CAST('20' as binary); -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= CAST('20' as binary) and c2= CAST('20' as binary) and - c3= CAST('20' as binary) and c4= CAST('20' as binary) and - c5= CAST('20' as binary) and c6= CAST('20' as binary) and - c7= CAST('20' as binary) and c8= CAST('20' as binary) and - c9= CAST('20' as binary) and c10= CAST('20' as binary) and - c12= CAST('20' as binary) "; -execute stmt1 ; -found -true -set @arg00= CAST('20' as binary) ; -select 'true' as found from t9 -where c1= @arg00 and c2= @arg00 and c3= @arg00 and c4= @arg00 and c5= @arg00 -and c6= @arg00 and c7= @arg00 and c8= @arg00 and c9= @arg00 and c10= @arg00 -and c12= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= ? and c2= ? and c3= ? and c4= ? and c5= ? - and c6= ? and c7= ? and c8= ? and c9= ? and c10= ? - and c12= ? "; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00 ; -found -true -delete from t9 ; -test_sequence --- some numeric overflow experiments -- -prepare my_insert from "insert into t9 - ( c21, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 ) -values - ( 'O', ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )" ; -prepare my_select from "select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c12 -from t9 where c21 = 'O' "; -prepare my_delete from "delete from t9 where c21 = 'O' "; -set @arg00= 9223372036854775807 ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1264 Data truncated; out of range for column 'c1' at row 1 -Warning 1264 Data truncated; out of range for column 'c2' at row 1 -Warning 1264 Data truncated; out of range for column 'c3' at row 1 -Warning 1264 Data truncated; out of range for column 'c4' at row 1 -Warning 1264 Data truncated; out of range for column 'c5' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 127 -c2 32767 -c3 8388607 -c4 2147483647 -c5 2147483647 -c6 9223372036854775807 -c7 9.22337e+18 -c8 9.22337203685478e+18 -c9 9.22337203685478e+18 -c10 9.22337203685478e+18 -c12 99999.9999 -execute my_delete ; -set @arg00= '9223372036854775807' ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1264 Data truncated; out of range for column 'c1' at row 1 -Warning 1264 Data truncated; out of range for column 'c2' at row 1 -Warning 1264 Data truncated; out of range for column 'c3' at row 1 -Warning 1265 Data truncated for column 'c4' at row 1 -Warning 1265 Data truncated for column 'c5' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 127 -c2 32767 -c3 8388607 -c4 2147483647 -c5 2147483647 -c6 9223372036854775807 -c7 9.22337e+18 -c8 9.22337203685478e+18 -c9 9.22337203685478e+18 -c10 9.22337203685478e+18 -c12 99999.9999 -execute my_delete ; -set @arg00= -9223372036854775808 ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1264 Data truncated; out of range for column 'c1' at row 1 -Warning 1264 Data truncated; out of range for column 'c2' at row 1 -Warning 1264 Data truncated; out of range for column 'c3' at row 1 -Warning 1264 Data truncated; out of range for column 'c4' at row 1 -Warning 1264 Data truncated; out of range for column 'c5' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 -128 -c2 -32768 -c3 -8388608 -c4 -2147483648 -c5 -2147483648 -c6 -9223372036854775808 -c7 -9.22337e+18 -c8 -9.22337203685478e+18 -c9 -9.22337203685478e+18 -c10 -9.22337203685478e+18 -c12 -9999.9999 -execute my_delete ; -set @arg00= '-9223372036854775808' ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1264 Data truncated; out of range for column 'c1' at row 1 -Warning 1264 Data truncated; out of range for column 'c2' at row 1 -Warning 1264 Data truncated; out of range for column 'c3' at row 1 -Warning 1265 Data truncated for column 'c4' at row 1 -Warning 1265 Data truncated for column 'c5' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 -128 -c2 -32768 -c3 -8388608 -c4 -2147483648 -c5 -2147483648 -c6 -9223372036854775808 -c7 -9.22337e+18 -c8 -9.22337203685478e+18 -c9 -9.22337203685478e+18 -c10 -9.22337203685478e+18 -c12 -9999.9999 -execute my_delete ; -set @arg00= 1.11111111111111111111e+50 ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1264 Data truncated; out of range for column 'c1' at row 1 -Warning 1264 Data truncated; out of range for column 'c2' at row 1 -Warning 1264 Data truncated; out of range for column 'c3' at row 1 -Warning 1264 Data truncated; out of range for column 'c4' at row 1 -Warning 1264 Data truncated; out of range for column 'c5' at row 1 -Warning 1264 Data truncated; out of range for column 'c6' at row 1 -Warning 1264 Data truncated; out of range for column 'c7' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 127 -c2 32767 -c3 8388607 -c4 2147483647 -c5 2147483647 -c6 9223372036854775807 -c7 3.40282e+38 -c8 1.11111111111111e+50 -c9 1.11111111111111e+50 -c10 1.11111111111111e+50 -c12 99999.9999 -execute my_delete ; -set @arg00= '1.11111111111111111111e+50' ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1265 Data truncated for column 'c1' at row 1 -Warning 1265 Data truncated for column 'c2' at row 1 -Warning 1265 Data truncated for column 'c3' at row 1 -Warning 1265 Data truncated for column 'c4' at row 1 -Warning 1265 Data truncated for column 'c5' at row 1 -Warning 1265 Data truncated for column 'c6' at row 1 -Warning 1264 Data truncated; out of range for column 'c7' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 1 -c2 1 -c3 1 -c4 1 -c5 1 -c6 1 -c7 3.40282e+38 -c8 1.11111111111111e+50 -c9 1.11111111111111e+50 -c10 1.11111111111111e+50 -c12 99999.9999 -execute my_delete ; -set @arg00= -1.11111111111111111111e+50 ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1264 Data truncated; out of range for column 'c1' at row 1 -Warning 1264 Data truncated; out of range for column 'c2' at row 1 -Warning 1264 Data truncated; out of range for column 'c3' at row 1 -Warning 1264 Data truncated; out of range for column 'c4' at row 1 -Warning 1264 Data truncated; out of range for column 'c5' at row 1 -Warning 1264 Data truncated; out of range for column 'c6' at row 1 -Warning 1264 Data truncated; out of range for column 'c7' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 -128 -c2 -32768 -c3 -8388608 -c4 -2147483648 -c5 -2147483648 -c6 -9223372036854775808 -c7 -3.40282e+38 -c8 -1.11111111111111e+50 -c9 -1.11111111111111e+50 -c10 -1.11111111111111e+50 -c12 -9999.9999 -execute my_delete ; -set @arg00= '-1.11111111111111111111e+50' ; -execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -Warnings: -Warning 1265 Data truncated for column 'c1' at row 1 -Warning 1265 Data truncated for column 'c2' at row 1 -Warning 1265 Data truncated for column 'c3' at row 1 -Warning 1265 Data truncated for column 'c4' at row 1 -Warning 1265 Data truncated for column 'c5' at row 1 -Warning 1265 Data truncated for column 'c6' at row 1 -Warning 1264 Data truncated; out of range for column 'c7' at row 1 -Warning 1264 Data truncated; out of range for column 'c12' at row 1 -execute my_select ; -c1 -1 -c2 -1 -c3 -1 -c4 -1 -c5 -1 -c6 -1 -c7 -3.40282e+38 -c8 -1.11111111111111e+50 -c9 -1.11111111111111e+50 -c10 -1.11111111111111e+50 -c12 -9999.9999 -execute my_delete ; -test_sequence --- insert into string columns -- -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c20' at row 1 -select c1, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30 -from t9 where c1 >= 20 -order by c1 ; -c1 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 -20 2 20 20 20 20 20 20 20 20 20 20 -21 2 21 21 21 21 21 21 21 21 21 21 -22 2 22 22 22 22 22 22 22 22 22 22 -23 2 23 23 23 23 23 23 23 23 23 23 -30 3 30 30 30 30 30 30 30 30 30 30 -31 3 31 31 31 31 31 31 31 31 31 31 -32 3 32 32 32 32 32 32 32 32 32 32 -33 3 33 33 33 33 33 33 33 33 33 33 -40 4 40 40 40 40 40 40 40 40 40 40 -41 4 41 41 41 41 41 41 41 41 41 41 -42 4 42 42 42 42 42 42 42 42 42 42 -43 4 43 43 43 43 43 43 43 43 43 43 -50 5 50 50 50.00 50.00 50.00 50.00 50.00 50.00 50.00 50.00 -51 5 51 51 51 51 51 51 51 51 51 51 -52 5 52 52 52.00 52.00 52.00 52.00 52.00 52.00 52.00 52.00 -53 5 53 53 53.00 53.00 53.00 53.00 53.00 53.00 53.00 53.00 -54 5 54 54 54.00 54.00 54.00 54.00 54.00 54.00 54.00 54.00 -55 5 55 55 55 55 55 55 55 55 55 55 -56 6 56 56 56.00 56.00 56.00 56.00 56.00 56.00 56.00 56.00 -57 6 57 57 57.00 57.00 57.00 57.00 57.00 57.00 57.00 57.00 -60 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -61 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -62 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -63 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -71 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -73 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -81 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -83 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL -test_sequence --- select .. where string column = .. -- -set @arg00= '20'; -select 'true' as found from t9 -where c1= 20 and concat(c20,substr('20',1+length(c20)))= '20' and c21= '20' and -c22= '20' and c23= '20' and c24= '20' and c25= '20' and c26= '20' and -c27= '20' and c28= '20' and c29= '20' and c30= '20' ; -found -true -select 'true' as found from t9 -where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and -c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and -c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr('20',1+length(c20)))= '20' and c21= '20' and - c22= '20' and c23= '20' and c24= '20' and c25= '20' and c26= '20' and - c27= '20' and c28= '20' and c29= '20' and c30= '20'" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and - c21= ? and c22= ? and c23= ? and c25= ? and - c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -found -true -set @arg00= CAST('20' as binary); -select 'true' as found from t9 -where c1= 20 and concat(c20,substr(CAST('20' as binary),1+length(c20))) -= CAST('20' as binary) and c21= CAST('20' as binary) -and c22= CAST('20' as binary) and c23= CAST('20' as binary) and -c24= CAST('20' as binary) and c25= CAST('20' as binary) and -c26= CAST('20' as binary) and c27= CAST('20' as binary) and -c28= CAST('20' as binary) and c29= CAST('20' as binary) and -c30= CAST('20' as binary) ; -found -true -select 'true' as found from t9 -where c1= 20 and concat(c20,substr(@arg00,1+length(c20))) = @arg00 and -c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and -c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and -c30= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr(CAST('20' as binary),1+length(c20))) - = CAST('20' as binary) and c21= CAST('20' as binary) - and c22= CAST('20' as binary) and c23= CAST('20' as binary) and - c24= CAST('20' as binary) and c25= CAST('20' as binary) and - c26= CAST('20' as binary) and c27= CAST('20' as binary) and - c28= CAST('20' as binary) and c29= CAST('20' as binary) and - c30= CAST('20' as binary)" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr(?,1+length(c20))) = ? and c21= ? and - c22= ? and c23= ? and c25= ? and c26= ? and c27= ? and c28= ? and - c29= ? and c30= ?"; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -found -true -set @arg00= 20; -select 'true' as found from t9 -where c1= 20 and concat(c20,substr(20,1+length(c20)))= 20 and c21= 20 and -c22= 20 and c23= 20 and c24= 20 and c25= 20 and c26= 20 and -c27= 20 and c28= 20 and c29= 20 and c30= 20 ; -found -true -select 'true' as found from t9 -where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and -c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and -c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr(20,1+length(c20)))= 20 and c21= 20 and - c22= 20 and c23= 20 and c24= 20 and c25= 20 and c26= 20 and - c27= 20 and c28= 20 and c29= 20 and c30= 20" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and - c21= ? and c22= ? and c23= ? and c25= ? and - c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -found -true -set @arg00= 20.0; -select 'true' as found from t9 -where c1= 20 and concat(c20,substr(20.0,1+length(c20)))= 20.0 and c21= 20.0 and -c22= 20.0 and c23= 20.0 and c24= 20.0 and c25= 20.0 and c26= 20.0 and -c27= 20.0 and c28= 20.0 and c29= 20.0 and c30= 20.0 ; -found -true -select 'true' as found from t9 -where c1= 20 and concat(c20,substr(@arg00,1+length(c20)))= @arg00 and -c21= @arg00 and c22= @arg00 and c23= @arg00 and c25= @arg00 and -c26= @arg00 and c27= @arg00 and c28= @arg00 and c29= @arg00 and c30= @arg00; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr(20.0,1+length(c20)))= 20.0 and c21= 20.0 and - c22= 20.0 and c23= 20.0 and c24= 20.0 and c25= 20.0 and c26= 20.0 and - c27= 20.0 and c28= 20.0 and c29= 20.0 and c30= 20.0" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and concat(c20,substr(?,1+length(c20)))= ? and - c21= ? and c22= ? and c23= ? and c25= ? and - c26= ? and c27= ? and c28= ? and c29= ? and c30= ?" ; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, -@arg00, @arg00, @arg00, @arg00, @arg00 ; -found -true -delete from t9 ; -test_sequence --- insert into date/time columns -- -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c17' at row 1 -Warnings: -Warning 1264 Data truncated; out of range for column 'c13' at row 1 -Warning 1265 Data truncated for column 'c14' at row 1 -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -Warnings: -Warning 1264 Data truncated; out of range for column 'c13' at row 1 -Warning 1265 Data truncated for column 'c14' at row 1 -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -Warnings: -Warning 1264 Data truncated; out of range for column 'c13' at row 1 -Warning 1265 Data truncated for column 'c14' at row 1 -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -Warnings: -Warning 1264 Data truncated; out of range for column 'c13' at row 1 -Warning 1265 Data truncated for column 'c14' at row 1 -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -Warnings: -Warning 1265 Data truncated for column 'c15' at row 1 -Warning 1264 Data truncated; out of range for column 'c16' at row 1 -Warning 1264 Data truncated; out of range for column 'c17' at row 1 -select c1, c13, c14, c15, c16, c17 from t9 order by c1 ; -c1 c13 c14 c15 c16 c17 -20 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -21 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -22 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -23 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -30 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -31 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -32 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -33 1991-01-01 1991-01-01 01:01:01 1991-01-01 01:01:01 01:01:01 1991 -40 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -41 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -42 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -43 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -50 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -51 0010-00-00 0010-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -52 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -53 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -60 NULL NULL 1991-01-01 01:01:01 NULL NULL -61 NULL NULL 1991-01-01 01:01:01 NULL NULL -62 NULL NULL 1991-01-01 01:01:01 NULL NULL -63 NULL NULL 1991-01-01 01:01:01 NULL NULL -71 NULL NULL 1991-01-01 01:01:01 NULL NULL -73 NULL NULL 1991-01-01 01:01:01 NULL NULL -81 NULL NULL 1991-01-01 01:01:01 NULL NULL -83 NULL NULL 1991-01-01 01:01:01 NULL NULL -test_sequence --- select .. where date/time column = .. -- -set @arg00= '1991-01-01 01:01:01' ; -select 'true' as found from t9 -where c1= 20 and c13= '1991-01-01 01:01:01' and c14= '1991-01-01 01:01:01' and -c15= '1991-01-01 01:01:01' and c16= '1991-01-01 01:01:01' and -c17= '1991-01-01 01:01:01' ; -found -true -select 'true' as found from t9 -where c1= 20 and c13= @arg00 and c14= @arg00 and c15= @arg00 and c16= @arg00 -and c17= @arg00 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c13= '1991-01-01 01:01:01' and c14= '1991-01-01 01:01:01' and - c15= '1991-01-01 01:01:01' and c16= '1991-01-01 01:01:01' and - c17= '1991-01-01 01:01:01'" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c13= ? and c14= ? and c15= ? and c16= ? and c17= ?" ; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00 ; -found -true -set @arg00= CAST('1991-01-01 01:01:01' as datetime) ; -select 'true' as found from t9 -where c1= 20 and c13= CAST('1991-01-01 01:01:01' as datetime) and -c14= CAST('1991-01-01 01:01:01' as datetime) and -c15= CAST('1991-01-01 01:01:01' as datetime) and -c16= CAST('1991-01-01 01:01:01' as datetime) and -c17= CAST('1991-01-01 01:01:01' as datetime) ; -found -true -select 'true' as found from t9 -where c1= 20 and c13= @arg00 and c14= @arg00 and c15= @arg00 and c16= @arg00 -and c17= @arg00 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c13= CAST('1991-01-01 01:01:01' as datetime) and - c14= CAST('1991-01-01 01:01:01' as datetime) and - c15= CAST('1991-01-01 01:01:01' as datetime) and - c16= CAST('1991-01-01 01:01:01' as datetime) and - c17= CAST('1991-01-01 01:01:01' as datetime)" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c13= ? and c14= ? and c15= ? and c16= ? and c17= ?" ; -execute stmt1 using @arg00, @arg00, @arg00, @arg00, @arg00 ; -found -true -set @arg00= 1991 ; -select 'true' as found from t9 -where c1= 20 and c17= 1991 ; -found -true -select 'true' as found from t9 -where c1= 20 and c17= @arg00 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c17= 1991" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and c17= ?" ; -execute stmt1 using @arg00 ; -found -true -set @arg00= 1.991e+3 ; -select 'true' as found from t9 -where c1= 20 and abs(c17 - 1.991e+3) < 0.01 ; -found -true -select 'true' as found from t9 -where c1= 20 and abs(c17 - @arg00) < 0.01 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and abs(c17 - 1.991e+3) < 0.01" ; -execute stmt1 ; -found -true -prepare stmt1 from "select 'true' as found from t9 -where c1= 20 and abs(c17 - ?) < 0.01" ; -execute stmt1 using @arg00 ; -found -true -drop table t1, t9; diff --git a/mysql-test/r/query_cache.result.es b/mysql-test/r/query_cache.result.es index 1e16354d87d..7e75a3cee4c 100644 --- a/mysql-test/r/query_cache.result.es +++ b/mysql-test/r/query_cache.result.es @@ -808,7 +808,7 @@ SET NAMES koi8r; CREATE TABLE t1 (a char(1) character set koi8r); INSERT INTO t1 VALUES (_koi8r'á'),(_koi8r'Á'); SELECT a,'Â','â'='Â' FROM t1; -a б 'Б'='б' +a  'â'='Â' á  1 Á  1 show status like "Qcache_hits"; @@ -819,7 +819,7 @@ Variable_name Value Qcache_queries_in_cache 1 set collation_connection=koi8r_bin; SELECT a,'Â','â'='Â' FROM t1; -a б 'Б'='б' +a  'â'='Â' á  0 Á  0 show status like "Qcache_hits"; @@ -830,7 +830,7 @@ Variable_name Value Qcache_queries_in_cache 2 set character_set_client=cp1251; SELECT a,'Â','â'='Â' FROM t1; -a Ð’ 'в'='Ð’' +a ÷ '×'='÷' á ÷ 0 Á ÷ 0 show status like "Qcache_hits"; @@ -841,7 +841,7 @@ Variable_name Value Qcache_queries_in_cache 3 set character_set_results=cp1251; SELECT a,'Â','â'='Â' FROM t1; -a Ð’ 'в'='Ð’' +a  'â'='Â' À  0 à  0 show status like "Qcache_hits"; diff --git a/tests/client_test.c b/tests/client_test.c index 0575b355b05..dc18929341c 100644 --- a/tests/client_test.c +++ b/tests/client_test.c @@ -683,9 +683,7 @@ static void verify_prepare_field(MYSQL_RES *result, as utf8. Field length is calculated as number of characters * maximum number of bytes a character can occupy. */ -#ifndef EMBEDDED_LIBRARY DIE_UNLESS(field->length == length * cs->mbmaxlen); -#endif if (def) DIE_UNLESS(strcmp(field->def, def) == 0); } From ca756fa5a59b235456794e2ed075ce7d6e044c18 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 21 Dec 2004 12:31:38 +0400 Subject: [PATCH 0558/1063] Tabs removed --- libmysqld/lib_sql.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc index e866c801337..26d97fa03c8 100644 --- a/libmysqld/lib_sql.cc +++ b/libmysqld/lib_sql.cc @@ -604,7 +604,7 @@ static char *dup_str_aux(MEM_ROOT *root, const char *from, uint length, uint new_len= (tocs->mbmaxlen * length) / fromcs->mbminlen + 1; result= (char *)alloc_root(root, new_len); length= copy_and_convert(result, new_len, - tocs, from, length, fromcs, &dummy_err); + tocs, from, length, fromcs, &dummy_err); } else { @@ -645,15 +645,15 @@ bool Protocol::send_fields(List *list, uint flag) item->make_field(&server_field); client_field->db= dup_str_aux(field_alloc, server_field.db_name, - strlen(server_field.db_name), cs, thd_cs); + strlen(server_field.db_name), cs, thd_cs); client_field->table= dup_str_aux(field_alloc, server_field.table_name, - strlen(server_field.table_name), cs, thd_cs); + strlen(server_field.table_name), cs, thd_cs); client_field->name= dup_str_aux(field_alloc, server_field.col_name, - strlen(server_field.col_name), cs, thd_cs); + strlen(server_field.col_name), cs, thd_cs); client_field->org_table= dup_str_aux(field_alloc, server_field.org_table_name, - strlen(server_field.org_table_name), cs, thd_cs); + strlen(server_field.org_table_name), cs, thd_cs); client_field->org_name= dup_str_aux(field_alloc, server_field.org_col_name, - strlen(server_field.org_col_name), cs, thd_cs); + strlen(server_field.org_col_name), cs, thd_cs); if (item->collation.collation == &my_charset_bin || thd_cs == NULL) { /* No conversion */ From 78e8e7949e9e657d266e1b8f0d9fc9a3050e8a56 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 21 Dec 2004 10:37:12 +0100 Subject: [PATCH 0559/1063] added ndb_init.h to distribution added missing copyright text moved ndb_init things to separate header file removed ndb_global include documented cluster connection class moved internal constants to NdbImpl.hpp class changed wait_until_ready behaviour somewhat ndb/config/type_ndbapitest.mk.am: corrected -I flag ndb/include/Makefile.am: added ndb_init.h to distribution ndb/include/ndb_global.h.in: added copyright text moved ndb_init things to separate header file ndb/include/ndbapi/NdbBlob.hpp: moved error codes and internal constants to NdbBlobImpl.hpp ndb/include/ndbapi/NdbReceiver.hpp: removed ndb_global include ndb/include/ndbapi/ndb_cluster_connection.hpp: documented cluster connection class changed wait_until_ready behaviour somewhat ndb/src/ndbapi/Ndb.cpp: documented cluster connection class changed wait_until_ready behaviour somewhat ndb/src/ndbapi/NdbBlob.cpp: moved internal constants to NdbImpl.hpp class ndb/src/ndbapi/NdbDictionaryImpl.cpp: moved internal constants to NdbImpl.hpp class ndb/src/ndbapi/NdbOperationInt.cpp: changed includes ndb/src/ndbapi/ndb_cluster_connection.cpp: changed wait_until_ready behaviour somewhat ndb/test/ndbapi/testBlobs.cpp: use impl class to get constants --- ndb/config/type_ndbapitest.mk.am | 2 +- ndb/include/Makefile.am | 1 + ndb/include/ndb_global.h.in | 22 +++++-- ndb/include/ndb_init.h | 32 ++++++++++ ndb/include/ndbapi/NdbBlob.hpp | 15 ----- ndb/include/ndbapi/NdbReceiver.hpp | 3 +- ndb/include/ndbapi/ndb_cluster_connection.hpp | 60 +++++++++++++++--- ndb/src/ndbapi/Ndb.cpp | 2 +- ndb/src/ndbapi/NdbBlob.cpp | 63 ++++++++++--------- ndb/src/ndbapi/NdbBlobImpl.hpp | 39 ++++++++++++ ndb/src/ndbapi/NdbDictionaryImpl.cpp | 7 ++- ndb/src/ndbapi/NdbOperationInt.cpp | 18 ++---- ndb/src/ndbapi/ndb_cluster_connection.cpp | 14 +---- ndb/test/ndbapi/testBlobs.cpp | 3 +- 14 files changed, 190 insertions(+), 91 deletions(-) create mode 100644 ndb/include/ndb_init.h create mode 100644 ndb/src/ndbapi/NdbBlobImpl.hpp diff --git a/ndb/config/type_ndbapitest.mk.am b/ndb/config/type_ndbapitest.mk.am index f1fd8286337..392c4e9fc70 100644 --- a/ndb/config/type_ndbapitest.mk.am +++ b/ndb/config/type_ndbapitest.mk.am @@ -5,7 +5,7 @@ LDADD += $(top_builddir)/ndb/test/src/libNDBT.a \ $(top_builddir)/mysys/libmysys.a \ $(top_builddir)/strings/libmystrings.a @NDB_SCI_LIBS@ -INCLUDES += -I$(srcdir) -I$(top_srcdir)/include \ +INCLUDES += -I$(top_srcdir) -I$(top_srcdir)/include \ -I$(top_srcdir)/ndb/include \ -I$(top_srcdir)/ndb/include/ndbapi \ -I$(top_srcdir)/ndb/include/util \ diff --git a/ndb/include/Makefile.am b/ndb/include/Makefile.am index b29433a59b7..38b9d870fbc 100644 --- a/ndb/include/Makefile.am +++ b/ndb/include/Makefile.am @@ -2,6 +2,7 @@ include $(top_srcdir)/ndb/config/common.mk.am ndbinclude_HEADERS = \ +ndb_init.h \ ndb_types.h \ ndb_version.h diff --git a/ndb/include/ndb_global.h.in b/ndb/include/ndb_global.h.in index aefb319730c..aca67239719 100644 --- a/ndb/include/ndb_global.h.in +++ b/ndb/include/ndb_global.h.in @@ -1,3 +1,18 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef NDBGLOBAL_H #define NDBGLOBAL_H @@ -96,15 +111,12 @@ extern "C" { #include -/* call in main() - does not return on error */ -extern int ndb_init(void); -extern void ndb_end(int); -#define NDB_INIT(prog_name) {my_progname=(prog_name); ndb_init();} - #ifdef __cplusplus } #endif +#include "ndb_init.h" + #ifdef SCO #ifndef PATH_MAX diff --git a/ndb/include/ndb_init.h b/ndb/include/ndb_init.h new file mode 100644 index 00000000000..0ff53e6a2af --- /dev/null +++ b/ndb/include/ndb_init.h @@ -0,0 +1,32 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + + +#ifndef NDB_INIT_H +#define NDB_INIT_H + +#ifdef __cplusplus +extern "C" { +#endif +/* call in main() - does not return on error */ +extern int ndb_init(void); +extern void ndb_end(int); +#define NDB_INIT(prog_name) {my_progname=(prog_name); ndb_init();} +#ifdef __cplusplus +} +#endif + +#endif diff --git a/ndb/include/ndbapi/NdbBlob.hpp b/ndb/include/ndbapi/NdbBlob.hpp index 0fb63015da2..b145c69b04b 100644 --- a/ndb/include/ndbapi/NdbBlob.hpp +++ b/ndb/include/ndbapi/NdbBlob.hpp @@ -182,27 +182,12 @@ public: /** * Get blob parts table name. Useful only to test programs. */ - STATIC_CONST( BlobTableNameSize = 40 ); static int getBlobTableName(char* btname, Ndb* anNdb, const char* tableName, const char* columnName); /** * Return error object. The error may be blob specific (below) or may * be copied from a failed implicit operation. */ const NdbError& getNdbError() const; - // "Invalid blob attributes or invalid blob parts table" - STATIC_CONST( ErrTable = 4263 ); - // "Invalid usage of blob attribute" - STATIC_CONST( ErrUsage = 4264 ); - // "Method is not valid in current blob state" - STATIC_CONST( ErrState = 4265 ); - // "Invalid blob seek position" - STATIC_CONST( ErrSeek = 4266 ); - // "Corrupted blob value" - STATIC_CONST( ErrCorrupt = 4267 ); - // "Error in blob head update forced rollback of transaction" - STATIC_CONST( ErrAbort = 4268 ); - // "Unknown blob error" - STATIC_CONST( ErrUnknown = 4269 ); /** * Return info about all blobs in this operation. */ diff --git a/ndb/include/ndbapi/NdbReceiver.hpp b/ndb/include/ndbapi/NdbReceiver.hpp index b95313db274..af624f69bd3 100644 --- a/ndb/include/ndbapi/NdbReceiver.hpp +++ b/ndb/include/ndbapi/NdbReceiver.hpp @@ -19,7 +19,6 @@ #ifndef DOXYGEN_SHOULD_SKIP_INTERNAL // Not part of public interface #include -#include class Ndb; class NdbConnection; @@ -131,7 +130,9 @@ int NdbReceiver::execTCOPCONF(Uint32 len){ Uint32 tmp = m_received_result_length; m_expected_result_length = len; +#ifdef assert assert(!(tmp && !len)); +#endif return ((bool)len ^ (bool)tmp ? 0 : 1); } diff --git a/ndb/include/ndbapi/ndb_cluster_connection.hpp b/ndb/include/ndbapi/ndb_cluster_connection.hpp index 1b1c8575656..a98dcaaf5a4 100644 --- a/ndb/include/ndbapi/ndb_cluster_connection.hpp +++ b/ndb/include/ndbapi/ndb_cluster_connection.hpp @@ -18,28 +18,72 @@ #ifndef CLUSTER_CONNECTION_HPP #define CLUSTER_CONNECTION_HPP -struct Ndb_cluster_connection_node_iter; - +/** + * @class Ndb_cluster_connection + * @brief Represents a connection to a cluster of storage nodes + * + * Always start your application program by creating a + * Ndb_cluster_connection object. Your application should contain + * only one Ndb_cluster_connection. Your application connects to + * a cluster management server when method connect() is called. + * With the method wait_until_ready() it is possible to wait + * for the connection to one or several storage nodes. + */ class Ndb_cluster_connection { public: + /** + * Create a connection to a cluster of storage nodes + * + * @param specify the connectstring for where to find the + * management server + */ Ndb_cluster_connection(const char * connect_string = 0); ~Ndb_cluster_connection(); - int connect(int no_retries, int retry_delay_in_seconds, int verbose); - int start_connect_thread(int (*connect_callback)(void)= 0); - // add check coupled to init state of cluster connection - // timeout_after_first_alive negative - ok only if all alive - // timeout_after_first_alive positive - ok if some alive + /** + * Connect to a cluster management server + * + * @param no_retries specifies the number of retries to perform + * if the connect fails, negative number results in infinite + * number of retries + * @param retry_delay_in_seconds specifies how often retries should + * be performed + * @param verbose specifies if the method should print progess + * + * @return 0 if success, + * 1 if retriable error, + * -1 if non-retriable error + */ + int connect(int no_retries=0, int retry_delay_in_seconds=1, int verbose=0); + +#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL + int start_connect_thread(int (*connect_callback)(void)= 0); +#endif + + /** + * Wait until one or several storage nodes are connected + * + * @param time_out_for_first_alive number of seconds to wait until + * first alive node is detected + * @param timeout_after_first_alive number of seconds to wait after + * first alive node is detected + * + * @return 0 all nodes alive, + * > 0 at least one node alive, + * < 0 error + */ int wait_until_ready(int timeout_for_first_alive, int timeout_after_first_alive); +#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL const char *get_connectstring(char *buf, int buf_sz) const; int get_connected_port() const; const char *get_connected_host() const; void set_optimized_node_selection(int val); - Uint32 no_db_nodes(); + int no_db_nodes(); +#endif private: friend class Ndb; diff --git a/ndb/src/ndbapi/Ndb.cpp b/ndb/src/ndbapi/Ndb.cpp index e9a125922c6..b5493622b70 100644 --- a/ndb/src/ndbapi/Ndb.cpp +++ b/ndb/src/ndbapi/Ndb.cpp @@ -282,7 +282,7 @@ Ndb::waitUntilReady(int timeout) } if (theImpl->m_ndb_cluster_connection.wait_until_ready - (timeout-secondsCounter,30)) + (timeout-secondsCounter,30) < 0) { theError.code = 4009; DBUG_RETURN(-1); diff --git a/ndb/src/ndbapi/NdbBlob.cpp b/ndb/src/ndbapi/NdbBlob.cpp index da0a4f73c3e..f72361b86ac 100644 --- a/ndb/src/ndbapi/NdbBlob.cpp +++ b/ndb/src/ndbapi/NdbBlob.cpp @@ -21,6 +21,7 @@ #include #include #include +#include "NdbBlobImpl.hpp" #include #ifdef NDB_BLOB_DEBUG @@ -85,14 +86,14 @@ void NdbBlob::getBlobTableName(char* btname, const NdbTableImpl* t, const NdbColumnImpl* c) { assert(t != 0 && c != 0 && c->getBlobType()); - memset(btname, 0, BlobTableNameSize); + memset(btname, 0, NdbBlobImpl::BlobTableNameSize); sprintf(btname, "NDB$BLOB_%d_%d", (int)t->m_tableId, (int)c->m_attrId); } void NdbBlob::getBlobTable(NdbTableImpl& bt, const NdbTableImpl* t, const NdbColumnImpl* c) { - char btname[BlobTableNameSize]; + char btname[NdbBlobImpl::BlobTableNameSize]; getBlobTableName(btname, t, c); bt.setName(btname); bt.setLogging(t->getLogging()); @@ -450,15 +451,15 @@ NdbBlob::getValue(void* data, Uint32 bytes) { DBG("getValue data=" << hex << data << " bytes=" << dec << bytes); if (theGetFlag || theState != Prepared) { - setErrorCode(ErrState); + setErrorCode(NdbBlobImpl::ErrState); return -1; } if (! isReadOp() && ! isScanOp()) { - setErrorCode(ErrUsage); + setErrorCode(NdbBlobImpl::ErrUsage); return -1; } if (data == NULL && bytes != 0) { - setErrorCode(ErrUsage); + setErrorCode(NdbBlobImpl::ErrUsage); return -1; } theGetFlag = true; @@ -472,15 +473,15 @@ NdbBlob::setValue(const void* data, Uint32 bytes) { DBG("setValue data=" << hex << data << " bytes=" << dec << bytes); if (theSetFlag || theState != Prepared) { - setErrorCode(ErrState); + setErrorCode(NdbBlobImpl::ErrState); return -1; } if (! isInsertOp() && ! isUpdateOp() && ! isWriteOp()) { - setErrorCode(ErrUsage); + setErrorCode(NdbBlobImpl::ErrUsage); return -1; } if (data == NULL && bytes != 0) { - setErrorCode(ErrUsage); + setErrorCode(NdbBlobImpl::ErrUsage); return -1; } theSetFlag = true; @@ -512,7 +513,7 @@ NdbBlob::setActiveHook(ActiveHook activeHook, void* arg) { DBG("setActiveHook hook=" << hex << (void*)activeHook << " arg=" << hex << arg); if (theState != Prepared) { - setErrorCode(ErrState); + setErrorCode(NdbBlobImpl::ErrState); return -1; } theActiveHook = activeHook; @@ -531,7 +532,7 @@ NdbBlob::getNull(bool& isNull) return 0; } if (theNullFlag == -1) { - setErrorCode(ErrState); + setErrorCode(NdbBlobImpl::ErrState); return -1; } isNull = theNullFlag; @@ -546,7 +547,7 @@ NdbBlob::setNull() if (theState == Prepared) { return setValue(0, 0); } - setErrorCode(ErrState); + setErrorCode(NdbBlobImpl::ErrState); return -1; } if (theNullFlag) @@ -568,7 +569,7 @@ NdbBlob::getLength(Uint64& len) return 0; } if (theNullFlag == -1) { - setErrorCode(ErrState); + setErrorCode(NdbBlobImpl::ErrState); return -1; } len = theLength; @@ -580,7 +581,7 @@ NdbBlob::truncate(Uint64 length) { DBG("truncate [in] length=" << length); if (theNullFlag == -1) { - setErrorCode(ErrState); + setErrorCode(NdbBlobImpl::ErrState); return -1; } if (theLength > length) { @@ -608,7 +609,7 @@ NdbBlob::getPos(Uint64& pos) { DBG("getPos"); if (theNullFlag == -1) { - setErrorCode(ErrState); + setErrorCode(NdbBlobImpl::ErrState); return -1; } pos = thePos; @@ -620,11 +621,11 @@ NdbBlob::setPos(Uint64 pos) { DBG("setPos pos=" << pos); if (theNullFlag == -1) { - setErrorCode(ErrState); + setErrorCode(NdbBlobImpl::ErrState); return -1; } if (pos > theLength) { - setErrorCode(ErrSeek); + setErrorCode(NdbBlobImpl::ErrSeek); return -1; } thePos = pos; @@ -637,7 +638,7 @@ int NdbBlob::readData(void* data, Uint32& bytes) { if (theState != Active) { - setErrorCode(ErrState); + setErrorCode(NdbBlobImpl::ErrState); return -1; } char* buf = static_cast(data); @@ -666,7 +667,7 @@ NdbBlob::readDataPrivate(char* buf, Uint32& bytes) } } if (len > 0 && thePartSize == 0) { - setErrorCode(ErrSeek); + setErrorCode(NdbBlobImpl::ErrSeek); return -1; } if (len > 0) { @@ -731,7 +732,7 @@ int NdbBlob::writeData(const void* data, Uint32 bytes) { if (theState != Active) { - setErrorCode(ErrState); + setErrorCode(NdbBlobImpl::ErrState); return -1; } const char* buf = static_cast(data); @@ -764,7 +765,7 @@ NdbBlob::writeDataPrivate(const char* buf, Uint32 bytes) } } if (len > 0 && thePartSize == 0) { - setErrorCode(ErrSeek); + setErrorCode(NdbBlobImpl::ErrSeek); return -1; } if (len > 0) { @@ -1081,7 +1082,7 @@ NdbBlob::atPrepare(NdbConnection* aCon, NdbOperation* anOp, const NdbColumnImpl* theFillChar = 0x20; break; default: - setErrorCode(ErrUsage); + setErrorCode(NdbBlobImpl::ErrUsage); return -1; } // sizes @@ -1099,7 +1100,7 @@ NdbBlob::atPrepare(NdbConnection* aCon, NdbOperation* anOp, const NdbColumnImpl* (bc = bt->getColumn("DATA")) == NULL || bc->getType() != partType || bc->getLength() != (int)thePartSize) { - setErrorCode(ErrTable); + setErrorCode(NdbBlobImpl::ErrTable); return -1; } theBlobTable = &NdbTableImpl::getImpl(*bt); @@ -1120,7 +1121,7 @@ NdbBlob::atPrepare(NdbConnection* aCon, NdbOperation* anOp, const NdbColumnImpl* Uint32* data = (Uint32*)theKeyBuf.data; unsigned size = theTable->m_sizeOfKeysInWords; if (theNdbOp->getKeyFromTCREQ(data, size) == -1) { - setErrorCode(ErrUsage); + setErrorCode(NdbBlobImpl::ErrUsage); return -1; } } @@ -1129,7 +1130,7 @@ NdbBlob::atPrepare(NdbConnection* aCon, NdbOperation* anOp, const NdbColumnImpl* Uint32* data = (Uint32*)theAccessKeyBuf.data; unsigned size = theAccessTable->m_sizeOfKeysInWords; if (theNdbOp->getKeyFromTCREQ(data, size) == -1) { - setErrorCode(ErrUsage); + setErrorCode(NdbBlobImpl::ErrUsage); return -1; } } @@ -1158,7 +1159,7 @@ NdbBlob::atPrepare(NdbConnection* aCon, NdbOperation* anOp, const NdbColumnImpl* supportedOp = true; } if (! supportedOp) { - setErrorCode(ErrUsage); + setErrorCode(NdbBlobImpl::ErrUsage); return -1; } setState(Prepared); @@ -1204,7 +1205,7 @@ NdbBlob::preExecute(ExecType anExecType, bool& batch) tOp->updateTuple() == -1 || setTableKeyValue(tOp) == -1 || setHeadInlineValue(tOp) == -1) { - setErrorCode(ErrAbort); + setErrorCode(NdbBlobImpl::ErrAbort); return -1; } DBG("add op to update head+inline"); @@ -1434,7 +1435,7 @@ NdbBlob::postExecute(ExecType anExecType) tOp->updateTuple() == -1 || setTableKeyValue(tOp) == -1 || setHeadInlineValue(tOp) == -1) { - setErrorCode(ErrAbort); + setErrorCode(NdbBlobImpl::ErrAbort); return -1; } tOp->m_abortOption = AbortOnError; @@ -1464,7 +1465,7 @@ NdbBlob::preCommit() tOp->updateTuple() == -1 || setTableKeyValue(tOp) == -1 || setHeadInlineValue(tOp) == -1) { - setErrorCode(ErrAbort); + setErrorCode(NdbBlobImpl::ErrAbort); return -1; } tOp->m_abortOption = AbortOnError; @@ -1489,7 +1490,7 @@ NdbBlob::atNextResult() { Uint32* data = (Uint32*)theKeyBuf.data; unsigned size = theTable->m_sizeOfKeysInWords; if (((NdbScanOperation*)theNdbOp)->getKeyFromKEYINFO20(data, size) == -1) { - setErrorCode(ErrUsage); + setErrorCode(NdbBlobImpl::ErrUsage); return -1; } } @@ -1545,7 +1546,7 @@ NdbBlob::setErrorCode(NdbOperation* anOp, bool invalidFlag) else if ((code = theNdb->theError.code) != 0) ; else - code = ErrUnknown; + code = NdbBlobImpl::ErrUnknown; setErrorCode(code, invalidFlag); } @@ -1558,7 +1559,7 @@ NdbBlob::setErrorCode(NdbConnection* aCon, bool invalidFlag) else if ((code = theNdb->theError.code) != 0) ; else - code = ErrUnknown; + code = NdbBlobImpl::ErrUnknown; setErrorCode(code, invalidFlag); } diff --git a/ndb/src/ndbapi/NdbBlobImpl.hpp b/ndb/src/ndbapi/NdbBlobImpl.hpp new file mode 100644 index 00000000000..0030e910c52 --- /dev/null +++ b/ndb/src/ndbapi/NdbBlobImpl.hpp @@ -0,0 +1,39 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef NdbBlobImpl_H +#define NdbBlobImpl_H + +class NdbBlobImpl { +public: + STATIC_CONST( BlobTableNameSize = 40 ); + // "Invalid blob attributes or invalid blob parts table" + STATIC_CONST( ErrTable = 4263 ); + // "Invalid usage of blob attribute" + STATIC_CONST( ErrUsage = 4264 ); + // "Method is not valid in current blob state" + STATIC_CONST( ErrState = 4265 ); + // "Invalid blob seek position" + STATIC_CONST( ErrSeek = 4266 ); + // "Corrupted blob value" + STATIC_CONST( ErrCorrupt = 4267 ); + // "Error in blob head update forced rollback of transaction" + STATIC_CONST( ErrAbort = 4268 ); + // "Unknown blob error" + STATIC_CONST( ErrUnknown = 4269 ); +}; + +#endif diff --git a/ndb/src/ndbapi/NdbDictionaryImpl.cpp b/ndb/src/ndbapi/NdbDictionaryImpl.cpp index 5319e678441..7a293463c94 100644 --- a/ndb/src/ndbapi/NdbDictionaryImpl.cpp +++ b/ndb/src/ndbapi/NdbDictionaryImpl.cpp @@ -34,7 +34,8 @@ #include #include #include "NdbEventOperationImpl.hpp" -#include "NdbBlob.hpp" +#include +#include "NdbBlobImpl.hpp" #include #include @@ -1385,7 +1386,7 @@ NdbDictionaryImpl::addBlobTables(NdbTableImpl &t) if (! c.getBlobType() || c.getPartSize() == 0) continue; n--; - char btname[NdbBlob::BlobTableNameSize]; + char btname[NdbBlobImpl::BlobTableNameSize]; NdbBlob::getBlobTableName(btname, &t, &c); // Save BLOB table handle NdbTableImpl * cachedBlobTable = getTable(btname); @@ -1793,7 +1794,7 @@ NdbDictionaryImpl::dropBlobTables(NdbTableImpl & t) NdbColumnImpl & c = *t.m_columns[i]; if (! c.getBlobType() || c.getPartSize() == 0) continue; - char btname[NdbBlob::BlobTableNameSize]; + char btname[NdbBlobImpl::BlobTableNameSize]; NdbBlob::getBlobTableName(btname, &t, &c); if (dropTable(btname) != 0) { if (m_error.code != 709){ diff --git a/ndb/src/ndbapi/NdbOperationInt.cpp b/ndb/src/ndbapi/NdbOperationInt.cpp index ee7b8132cd1..ace90e35ca4 100644 --- a/ndb/src/ndbapi/NdbOperationInt.cpp +++ b/ndb/src/ndbapi/NdbOperationInt.cpp @@ -15,21 +15,11 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/************************************************************************************************ -Name: NdbOperationInt.C -Include: -Link: -Author: UABRONM Mikael Ronström UAB/M/MT -Date: 991029 -Version: 0.1 -Description: Interpreted operations in NDB API -Documentation: -Adjust: 991029 UABRONM First version. -************************************************************************************************/ -#include "NdbOperation.hpp" +#include +#include #include "NdbApiSignal.hpp" -#include "NdbConnection.hpp" -#include "Ndb.hpp" +#include +#include #include "NdbRecAttr.hpp" #include "NdbUtil.hpp" #include "Interpreter.hpp" diff --git a/ndb/src/ndbapi/ndb_cluster_connection.cpp b/ndb/src/ndbapi/ndb_cluster_connection.cpp index 98a52786aab..f754ec8b40a 100644 --- a/ndb/src/ndbapi/ndb_cluster_connection.cpp +++ b/ndb/src/ndbapi/ndb_cluster_connection.cpp @@ -174,7 +174,7 @@ Ndb_cluster_connection_impl::get_next_node(Ndb_cluster_connection_node_iter &ite return node.id; } -Uint32 +int Ndb_cluster_connection::no_db_nodes() { return m_impl.m_all_nodes.size(); @@ -219,16 +219,8 @@ Ndb_cluster_connection::wait_until_ready(int timeout, else if (foundAliveNode > 0) { noChecksSinceFirstAliveFound++; - if (timeout_after_first_alive >= 0) - { - if (noChecksSinceFirstAliveFound > timeout_after_first_alive) - DBUG_RETURN(0); - } - else // timeout_after_first_alive < 0 - { - if (noChecksSinceFirstAliveFound > -timeout_after_first_alive) - DBUG_RETURN(-1); - } + if (noChecksSinceFirstAliveFound > timeout_after_first_alive) + DBUG_RETURN(1); } else if (secondsCounter >= timeout) { // no alive nodes and timed out diff --git a/ndb/test/ndbapi/testBlobs.cpp b/ndb/test/ndbapi/testBlobs.cpp index 4b532856709..b2cc5636e45 100644 --- a/ndb/test/ndbapi/testBlobs.cpp +++ b/ndb/test/ndbapi/testBlobs.cpp @@ -23,13 +23,14 @@ #include #include #include +#include struct Bcol { bool m_nullable; unsigned m_inline; unsigned m_partsize; unsigned m_stripe; - char m_btname[NdbBlob::BlobTableNameSize]; + char m_btname[NdbBlobImpl::BlobTableNameSize]; Bcol(bool a, unsigned b, unsigned c, unsigned d) : m_nullable(a), m_inline(b), From c6b6977b9ee65258eef6f55a17fea8c68dcf1a0d Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 21 Dec 2004 11:09:48 +0000 Subject: [PATCH 0560/1063] Bug#6481 - storage_engine system variable allows nonsensical value Check that the requested storage engine is enabled. --- sql/set_var.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sql/set_var.cc b/sql/set_var.cc index d10ea3e11c1..e39d9934278 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -2945,9 +2945,11 @@ bool sys_var_thd_storage_engine::check(THD *thd, set_var *var) if (var->value->result_type() == STRING_RESULT) { + enum db_type db_type; if (!(res=var->value->val_str(&str)) || !(var->save_result.ulong_value= - (ulong) ha_resolve_by_name(res->ptr(), res->length()))) + (ulong) db_type= ha_resolve_by_name(res->ptr(), res->length())) || + ha_checktype(db_type) != db_type) { value= res ? res->c_ptr() : "NULL"; goto err; From 2ba7c517a48a670cad22c1282f6a74903db80e99 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 21 Dec 2004 17:12:27 +0400 Subject: [PATCH 0561/1063] Bug#7302: UCS2 data in ENUM field get truncated when new column is added --- mysql-test/r/ctype_ucs.result | 11 +++++++++++ mysql-test/t/ctype_ucs.test | 10 ++++++++++ sql/mysql_priv.h | 1 + sql/strfunc.cc | 37 +++++++++++++++++++++++++++++++++++ sql/table.cc | 20 +------------------ sql/unireg.cc | 11 +++++++++++ 6 files changed, 71 insertions(+), 19 deletions(-) diff --git a/mysql-test/r/ctype_ucs.result b/mysql-test/r/ctype_ucs.result index ef3682c1cfc..b1b83eb8b6c 100644 --- a/mysql-test/r/ctype_ucs.result +++ b/mysql-test/r/ctype_ucs.result @@ -581,3 +581,14 @@ x,y 0078002C0079 z 007A x,y,z,ä,ö,ü 0078002C0079002C007A002C00E4002C00F6002C00FC drop table t1; +create table t1(a enum('a','b','c')) default character set ucs2; +insert into t1 values('a'),('b'),('c'); +alter table t1 add b char(1); +show warnings; +Level Code Message +select * from t1 order by a; +a b +a NULL +b NULL +c NULL +drop table t1; diff --git a/mysql-test/t/ctype_ucs.test b/mysql-test/t/ctype_ucs.test index b8f58ab028b..b9f77505446 100644 --- a/mysql-test/t/ctype_ucs.test +++ b/mysql-test/t/ctype_ucs.test @@ -374,3 +374,13 @@ insert into t1 values ('x,y'); insert into t1 values ('x,y,z,Ä,Ö,Ü'); select a, hex(a) from t1 order by a; drop table t1; + +# +# Bug#7302 UCS2 data in ENUM fields get truncated when new column is added +# +create table t1(a enum('a','b','c')) default character set ucs2; +insert into t1 values('a'),('b'),('c'); +alter table t1 add b char(1); +show warnings; +select * from t1 order by a; +drop table t1; diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index c90935f4cf9..c300ea2885e 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -815,6 +815,7 @@ ulonglong find_set(TYPELIB *lib, const char *x, uint length, CHARSET_INFO *cs, char **err_pos, uint *err_len, bool *set_warning); uint find_type(TYPELIB *lib, const char *find, uint length, bool part_match); uint find_type2(TYPELIB *lib, const char *find, uint length, CHARSET_INFO *cs); +void unhex_type2(TYPELIB *lib); uint check_word(TYPELIB *lib, const char *val, const char *end, const char **end_of_word); diff --git a/sql/strfunc.cc b/sql/strfunc.cc index 8ab6992a63a..3ad6b1155d1 100644 --- a/sql/strfunc.cc +++ b/sql/strfunc.cc @@ -169,6 +169,43 @@ uint find_type2(TYPELIB *typelib, const char *x, uint length, CHARSET_INFO *cs) } /* find_type */ +/* + Un-hex all elements in a typelib + + SYNOPSIS + unhex_type2() + interval TYPELIB (struct of pointer to values + lengths + count) + + NOTES + + RETURN + N/A +*/ + +void unhex_type2(TYPELIB *interval) +{ + for (uint pos= 0; pos < interval->count; pos++) + { + char *from, *to; + for (from= to= (char*) interval->type_names[pos]; *from; ) + { + /* + Note, hexchar_to_int(*from++) doesn't work + one some compilers, e.g. IRIX. Looks like a compiler + bug in inline functions in combination with arguments + that have a side effect. So, let's use from[0] and from[1] + and increment 'from' by two later. + */ + + *to++= (char) (hexchar_to_int(from[0]) << 4) + + hexchar_to_int(from[1]); + from+= 2; + } + interval->type_lengths[pos] /= 2; + } +} + + /* Check if the first word in a string is one of the ones in TYPELIB diff --git a/sql/table.cc b/sql/table.cc index 992f6df0401..7adca2a5ab0 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -490,25 +490,7 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag, { /* Unescape UCS2 intervals from HEX notation */ TYPELIB *interval= outparam->intervals + interval_nr - 1; - for (uint pos= 0; pos < interval->count; pos++) - { - char *from, *to; - for (from= to= (char*) interval->type_names[pos]; *from; ) - { - /* - Note, hexchar_to_int(*from++) doesn't work - one some compilers, e.g. IRIX. Looks like a compiler - bug in inline functions in combination with arguments - that have a side effect. So, let's use from[0] and from[1] - and increment 'from' by two later. - */ - - *to++= (char) (hexchar_to_int(from[0]) << 4) + - hexchar_to_int(from[1]); - from+= 2; - } - interval->type_lengths[pos] /= 2; - } + unhex_type2(interval); } *field_ptr=reg_field= diff --git a/sql/unireg.cc b/sql/unireg.cc index 6d72c6af135..a550b06a466 100644 --- a/sql/unireg.cc +++ b/sql/unireg.cc @@ -174,6 +174,17 @@ bool mysql_create_frm(THD *thd, my_string file_name, goto err2; if (my_close(file,MYF(MY_WME))) goto err3; + + { + /* Unescape all UCS2 intervals: were escaped in pack_headers */ + List_iterator it(create_fields); + create_field *field; + while ((field=it++)) + { + if (field->interval && field->charset->mbminlen > 1) + unhex_type2(field->interval); + } + } DBUG_RETURN(0); err: From 68d85f701a9b2b3c2563129e894142f6927235df Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 21 Dec 2004 15:57:36 +0100 Subject: [PATCH 0562/1063] NdbApi.hpp: NdbApi.hpp to include ndb_inti.h and ndb_cluster_connecion.hpp ndb/include/ndbapi/NdbApi.hpp: NdbApi.hpp to include ndb_inti.h and ndb_cluster_connecion.hpp --- ndb/include/ndbapi/NdbApi.hpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ndb/include/ndbapi/NdbApi.hpp b/ndb/include/ndbapi/NdbApi.hpp index add733cccd7..ae7025f560a 100644 --- a/ndb/include/ndbapi/NdbApi.hpp +++ b/ndb/include/ndbapi/NdbApi.hpp @@ -17,6 +17,8 @@ #ifndef NdbApi_H #define NdbApi_H +#include "ndb_init.h" +#include "ndb_cluster_connection.hpp" #include "ndbapi_limits.h" #include "Ndb.hpp" #include "NdbConnection.hpp" From b0d26c26424e7761b5805d41c0dee54c11194a32 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 21 Dec 2004 18:21:17 +0200 Subject: [PATCH 0563/1063] os0file.c: Fix InnoDB bug: on HP-UX, with a 32-bit binary, InnoDB was only able to read or write <= 2 GB files; the reason was that InnoDB treated the return value of lseek() as a 32-bit integer; lseek was used on HP-UX-11 as a replacement for pread() and pwrite() because HAVE_BROKEN_PREAD was defined on that platform innobase/os/os0file.c: Fix InnoDB bug: on HP-UX, with a 32-bit binary, InnoDB was only able to read or write <= 2 GB files; the reason was that InnoDB treated the return value of lseek() as a 32-bit integer; lseek was used on HP-UX-11 as a replacement for pread() and pwrite() because HAVE_BROKEN_PREAD was defined on that platform --- innobase/os/os0file.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/innobase/os/os0file.c b/innobase/os/os0file.c index 6ed3720cc84..bab043fc746 100644 --- a/innobase/os/os0file.c +++ b/innobase/os/os0file.c @@ -6,6 +6,8 @@ The interface to the operating system file i/o primitives Created 10/21/1995 Heikki Tuuri *******************************************************/ +#define HAVE_BROKEN_PREAD + #include "os0file.h" #include "os0sync.h" #include "os0thread.h" @@ -14,8 +16,6 @@ Created 10/21/1995 Heikki Tuuri #include "fil0fil.h" #include "buf0buf.h" -#undef HAVE_FDATASYNC - #ifdef POSIX_ASYNC_IO /* We assume in this case that the OS has standard Posix aio (at least SunOS 2.6, HP-UX 11i and AIX 4.3 have) */ @@ -1195,6 +1195,7 @@ os_file_pread( return(n_bytes); #else { + off_t ret_offset; ssize_t ret; ulint i; @@ -1203,12 +1204,12 @@ os_file_pread( os_mutex_enter(os_file_seek_mutexes[i]); - ret = lseek(file, offs, 0); + ret_offset = lseek(file, offs, SEEK_SET); - if (ret < 0) { + if (ret_offset < 0) { os_mutex_exit(os_file_seek_mutexes[i]); - return(ret); + return(-1); } ret = read(file, buf, (ssize_t)n); @@ -1281,6 +1282,7 @@ os_file_pwrite( return(ret); #else { + off_t ret_offset; ulint i; /* Protect the seek / write operation with a mutex */ @@ -1288,12 +1290,12 @@ os_file_pwrite( os_mutex_enter(os_file_seek_mutexes[i]); - ret = lseek(file, offs, 0); + ret_offset = lseek(file, offs, SEEK_SET); - if (ret < 0) { + if (ret_offset < 0) { os_mutex_exit(os_file_seek_mutexes[i]); - return(ret); + return(-1); } ret = write(file, buf, (ssize_t)n); From fed35d922a07592eb167b447536ecc39bd322b6a Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 21 Dec 2004 18:33:53 +0200 Subject: [PATCH 0564/1063] os0file.c: Put back accidentally removed undef and remove a debug def innobase/os/os0file.c: Put back accidentally removed undef and remove a debug def --- innobase/os/os0file.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/innobase/os/os0file.c b/innobase/os/os0file.c index bab043fc746..b8339134fb1 100644 --- a/innobase/os/os0file.c +++ b/innobase/os/os0file.c @@ -6,8 +6,6 @@ The interface to the operating system file i/o primitives Created 10/21/1995 Heikki Tuuri *******************************************************/ -#define HAVE_BROKEN_PREAD - #include "os0file.h" #include "os0sync.h" #include "os0thread.h" @@ -16,6 +14,8 @@ Created 10/21/1995 Heikki Tuuri #include "fil0fil.h" #include "buf0buf.h" +#undef HAVE_FDATASYNC + #ifdef POSIX_ASYNC_IO /* We assume in this case that the OS has standard Posix aio (at least SunOS 2.6, HP-UX 11i and AIX 4.3 have) */ From ba9ca889123ce3e496965c2ca71851fe957bb32f Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 21 Dec 2004 18:33:41 +0100 Subject: [PATCH 0565/1063] main.cpp: ifdef on version prior to 5.0 ndb/src/mgmsrv/main.cpp: ifdef on version prior to 5.0 --- ndb/src/mgmsrv/main.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ndb/src/mgmsrv/main.cpp b/ndb/src/mgmsrv/main.cpp index 04c95117214..015e2de022d 100644 --- a/ndb/src/mgmsrv/main.cpp +++ b/ndb/src/mgmsrv/main.cpp @@ -161,9 +161,11 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), case 'V': print_version(); exit(0); +#if NDB_VERSION_MAJOR <= 4 case 'c': printf("Warning: -c will be removed in 5.0, use -f instead\n"); break; +#endif case OPT_NDB_SHM: #ifndef NDB_SHM_TRANSPORTER printf("Warning: binary not compiled with shared memory support,\n" From 375d7e014b6615b072b0d3564deb5fd94424b198 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 22 Dec 2004 07:20:01 +0100 Subject: [PATCH 0566/1063] added configuration hostnames to SHM config struct use configured hostnames for SHM transporter setup ndb/include/transporter/TransporterDefinitions.hpp: added configuration hostnames to SHM config struct ndb/src/common/mgmcommon/IPCConfig.cpp: added configuration hostnames to SHM config struct ndb/src/common/transporter/TransporterRegistry.cpp: added configuration hostnames to SHM config struct use configured hostnames for SHM transporter setup --- ndb/include/transporter/TransporterDefinitions.hpp | 2 ++ ndb/src/common/mgmcommon/IPCConfig.cpp | 2 ++ ndb/src/common/transporter/TransporterRegistry.cpp | 4 ++-- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ndb/include/transporter/TransporterDefinitions.hpp b/ndb/include/transporter/TransporterDefinitions.hpp index a8da8068552..4ff6b2073eb 100644 --- a/ndb/include/transporter/TransporterDefinitions.hpp +++ b/ndb/include/transporter/TransporterDefinitions.hpp @@ -68,6 +68,8 @@ struct TCP_TransporterConfiguration { */ struct SHM_TransporterConfiguration { Uint32 port; + const char *remoteHostName; + const char *localHostName; NodeId remoteNodeId; NodeId localNodeId; bool checksum; diff --git a/ndb/src/common/mgmcommon/IPCConfig.cpp b/ndb/src/common/mgmcommon/IPCConfig.cpp index 780504d2c62..1da03e3eaf2 100644 --- a/ndb/src/common/mgmcommon/IPCConfig.cpp +++ b/ndb/src/common/mgmcommon/IPCConfig.cpp @@ -383,6 +383,8 @@ IPCConfig::configureTransporters(Uint32 nodeId, if(iter.get(CFG_SHM_BUFFER_MEM, &conf.shmSize)) break; conf.port= server_port; + conf.localHostName = localHostName; + conf.remoteHostName = remoteHostName; if(!tr.createTransporter(&conf)){ DBUG_PRINT("error", ("Failed to create SHM Transporter from %d to %d", diff --git a/ndb/src/common/transporter/TransporterRegistry.cpp b/ndb/src/common/transporter/TransporterRegistry.cpp index be51e9223ba..394c7cd490d 100644 --- a/ndb/src/common/transporter/TransporterRegistry.cpp +++ b/ndb/src/common/transporter/TransporterRegistry.cpp @@ -358,8 +358,8 @@ TransporterRegistry::createTransporter(SHM_TransporterConfiguration *config) { return false; SHM_Transporter * t = new SHM_Transporter(*this, - "localhost", - "localhost", + config->localHostName, + config->remoteHostName, config->port, localNodeId, config->remoteNodeId, From b7a3d9e84d51cd17c13bf7ef5986f7b757f0d082 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 22 Dec 2004 07:50:44 +0100 Subject: [PATCH 0567/1063] added some debug printouts --- ndb/src/common/transporter/Transporter.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/ndb/src/common/transporter/Transporter.cpp b/ndb/src/common/transporter/Transporter.cpp index ee25d97feef..3fe10cb2fe8 100644 --- a/ndb/src/common/transporter/Transporter.cpp +++ b/ndb/src/common/transporter/Transporter.cpp @@ -37,6 +37,7 @@ Transporter::Transporter(TransporterRegistry &t_reg, m_packer(_signalId, _checksum), m_transporter_registry(t_reg) { + DBUG_ENTER("Transporter::Transporter"); if (rHostName && strlen(rHostName) > 0){ strncpy(remoteHostName, rHostName, sizeof(remoteHostName)); Ndb_getInAddr(&remoteHostAddress, rHostName); @@ -55,6 +56,11 @@ Transporter::Transporter(TransporterRegistry &t_reg, if (strlen(lHostName) > 0) Ndb_getInAddr(&localHostAddress, lHostName); + DBUG_PRINT("info",("rId=%d lId=%d isServer=%d rHost=%s lHost=%s r_port=%d", + remoteNodeId, localNodeId, isServer, + remoteHostName, localHostName, + r_port)); + byteOrder = _byteorder; compressionUsed = _compression; checksumUsed = _checksum; @@ -68,6 +74,7 @@ Transporter::Transporter(TransporterRegistry &t_reg, else m_socket_client= new SocketClient(remoteHostName, r_port, new SocketAuthSimple("ndbd", "ndbd passwd")); + DBUG_VOID_RETURN; } Transporter::~Transporter(){ @@ -77,8 +84,11 @@ Transporter::~Transporter(){ bool Transporter::connect_server(NDB_SOCKET_TYPE sockfd) { + DBUG_ENTER("Transporter::connect_server"); if(m_connected) - return true; // TODO assert(0); + { + DBUG_RETURN(true); // TODO assert(0); + } bool res = connect_server_impl(sockfd); if(res){ @@ -86,7 +96,7 @@ Transporter::connect_server(NDB_SOCKET_TYPE sockfd) { m_errorCount = 0; } - return res; + DBUG_RETURN(res); } bool From e6dfed9f4cb88406dec37ffb5ca1fa0b0f2b3e75 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 22 Dec 2004 11:01:25 +0200 Subject: [PATCH 0568/1063] ha_innodb.cc: If AUTOCOMMIT=1, do not acquire an InnoDB table lock in LOCK TABLES; this makes porting of old MyISAM applications to InnoDB easier, since in that mode InnoDB table locks caused deadlocks very easily sql/ha_innodb.cc: If AUTOCOMMIT=1, do not acquire an InnoDB table lock in LOCK TABLES; this makes porting of old MyISAM applications to InnoDB easier, since in that mode InnoDB table locks caused deadlocks very easily --- sql/ha_innodb.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index c36075207ed..69d9d885b8e 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -4702,7 +4702,8 @@ ha_innobase::external_lock( if (prebuilt->select_lock_type != LOCK_NONE) { if (thd->in_lock_tables && - thd->variables.innodb_table_locks) { + thd->variables.innodb_table_locks && + (thd->options & OPTION_NOT_AUTOCOMMIT)) { ulint error; error = row_lock_table_for_mysql(prebuilt); From bb15aa8420fc645b0ff18abb991ef1ac138bd82b Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 22 Dec 2004 10:01:31 +0100 Subject: [PATCH 0569/1063] wl1292 - ndb autotest - adapt to changes in Logger ndb/test/run-test/main.cpp: adapt to changes in Logger --- ndb/test/run-test/main.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/ndb/test/run-test/main.cpp b/ndb/test/run-test/main.cpp index ac7710d9546..fb6754dae7a 100644 --- a/ndb/test/run-test/main.cpp +++ b/ndb/test/run-test/main.cpp @@ -275,6 +275,7 @@ parse_args(int argc, const char** argv){ int tmp = Logger::LL_WARNING - g_verbosity; tmp = (tmp < Logger::LL_DEBUG ? Logger::LL_DEBUG : tmp); g_logger.disable(Logger::LL_ALL); + g_logger.enable(Logger::LL_ON); g_logger.enable((Logger::LoggerLevel)tmp, Logger::LL_ALERT); } From ef1971ecb153e3a5e26e20018fdccdc8220780dd Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 22 Dec 2004 11:11:16 +0200 Subject: [PATCH 0570/1063] ha_innodb.cc: Add a comment that no InnoDB table lock is now acquired in LOCK TABLES if AUTOCOMMIT=1. This helps to avoid deadlocks when porting old MyISAM applications to InnoDB. sql/ha_innodb.cc: Add a comment that no InnoDB table lock is now acquired in LOCK TABLES if AUTOCOMMIT=1. This helps to avoid deadlocks when porting old MyISAM applications to InnoDB. --- sql/ha_innodb.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index 20837e2172d..552f2676bdd 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -5049,10 +5049,18 @@ ha_innobase::external_lock( prebuilt->select_lock_type = LOCK_S; } + /* Starting from 4.1.9, no InnoDB table lock is taken in LOCK + TABLES if AUTOCOMMIT=1. It does not make much sense to acquire + an InnoDB table lock if it is released immediately at the end + of LOCK TABLES, and InnoDB's table locks in that case cause + VERY easily deadlocks. */ + if (prebuilt->select_lock_type != LOCK_NONE) { + if (thd->in_lock_tables && thd->variables.innodb_table_locks && (thd->options & OPTION_NOT_AUTOCOMMIT)) { + ulint error; error = row_lock_table_for_mysql(prebuilt, NULL, LOCK_TABLE_EXP); From cce8d0456ddcb17f9a8a471488a25936a2398b16 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 22 Dec 2004 16:02:27 +0400 Subject: [PATCH 0571/1063] Bug#7020: mysqldump --compatible=mysql40 still dumps in UTF8 See mysqldump.test comments for more details --- client/mysqldump.c | 6 ++ mysql-test/r/mysqldump.result | 106 ++++++++++++++++++++++++++++++++++ mysql-test/t/mysqldump.test | 16 +++++ 3 files changed, 128 insertions(+) diff --git a/client/mysqldump.c b/client/mysqldump.c index c36f9d3e23e..be2abd19822 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -613,6 +613,12 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), } if (end!=compatible_mode_normal_str) end[-1]= 0; + /* + Set charset to the default compiled value if it hasn't + been reset yet by --default-character-set=xxx. + */ + if (default_charset == (char*) MYSQL_UNIVERSAL_CLIENT_CHARSET) + default_charset= (char*) MYSQL_DEFAULT_CHARSET_NAME; break; } case (int) OPT_MYSQL_PROTOCOL: diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index 239418733ba..57e04d38fc1 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -374,3 +374,109 @@ USE `mysqldump_test_db`; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; drop database mysqldump_test_db; +CREATE TABLE t1 (a CHAR(10)); +INSERT INTO t1 VALUES (_latin1 'ÄÖÜß'); + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */; +DROP TABLE IF EXISTS `t1`; +CREATE TABLE `t1` ( + `a` char(10) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + + +/*!40000 ALTER TABLE `t1` DISABLE KEYS */; +LOCK TABLES `t1` WRITE; +INSERT INTO `t1` VALUES ('ÄÖÜß'); +UNLOCK TABLES; +/*!40000 ALTER TABLE `t1` ENABLE KEYS */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; + +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE="NO_AUTO_VALUE_ON_ZERO,MYSQL323" */; +DROP TABLE IF EXISTS `t1`; +CREATE TABLE `t1` ( + `a` char(10) default NULL +) TYPE=MyISAM; + + +/*!40000 ALTER TABLE `t1` DISABLE KEYS */; +LOCK TABLES `t1` WRITE; +INSERT INTO `t1` VALUES ('ÄÖÜß'); +UNLOCK TABLES; +/*!40000 ALTER TABLE `t1` ENABLE KEYS */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; + +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE="NO_AUTO_VALUE_ON_ZERO,MYSQL323" */; +DROP TABLE IF EXISTS `t1`; +CREATE TABLE `t1` ( + `a` char(10) default NULL +) TYPE=MyISAM; + + +/*!40000 ALTER TABLE `t1` DISABLE KEYS */; +LOCK TABLES `t1` WRITE; +INSERT INTO `t1` VALUES ('Ž™šá'); +UNLOCK TABLES; +/*!40000 ALTER TABLE `t1` ENABLE KEYS */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; + +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE="NO_AUTO_VALUE_ON_ZERO,MYSQL323" */; +DROP TABLE IF EXISTS `t1`; +CREATE TABLE `t1` ( + `a` char(10) default NULL +) TYPE=MyISAM; + + +/*!40000 ALTER TABLE `t1` DISABLE KEYS */; +LOCK TABLES `t1` WRITE; +INSERT INTO `t1` VALUES ('Ž™šá'); +UNLOCK TABLES; +/*!40000 ALTER TABLE `t1` ENABLE KEYS */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; + +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE="NO_AUTO_VALUE_ON_ZERO,MYSQL323" */; +DROP TABLE IF EXISTS `t1`; +CREATE TABLE `t1` ( + `a` char(10) default NULL +) TYPE=MyISAM; + + +/*!40000 ALTER TABLE `t1` DISABLE KEYS */; +LOCK TABLES `t1` WRITE; +INSERT INTO `t1` VALUES ('ÄÖÜß'); +UNLOCK TABLES; +/*!40000 ALTER TABLE `t1` ENABLE KEYS */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; + +DROP TABLE t1; diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test index 295658f21a8..7a6c1564e94 100644 --- a/mysql-test/t/mysqldump.test +++ b/mysql-test/t/mysqldump.test @@ -137,3 +137,19 @@ drop table t1; create database mysqldump_test_db character set latin2 collate latin2_bin; --exec $MYSQL_DUMP --skip-comments --databases mysqldump_test_db; drop database mysqldump_test_db; + +# +# Bug #7020 +# Check that we don't dump in UTF8 in compatible mode by default, +# but use the default compiled values, or the values given in +# --default-character-set=xxx. However, we should dump in UTF8 +# if it is explicitely set. + +CREATE TABLE t1 (a CHAR(10)); +INSERT INTO t1 VALUES (_latin1 'ÄÖÜß'); +--exec $MYSQL_DUMP --skip-comments test t1 +--exec $MYSQL_DUMP --skip-comments --compatible=mysql323 test t1 +--exec $MYSQL_DUMP --skip-comments --compatible=mysql323 --default-character-set=cp850 test t1 +--exec $MYSQL_DUMP --skip-comments --default-character-set=cp850 --compatible=mysql323 test t1 +--exec $MYSQL_DUMP --skip-comments --default-character-set=utf8 --compatible=mysql323 test t1 +DROP TABLE t1; From 2eb5ae4c3b7ff8923373d49db9eacaa0f5959c7b Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 22 Dec 2004 13:38:15 +0100 Subject: [PATCH 0572/1063] ndb: bug#7340 fix mysql-test/r/ndb_blob.result: bug#7340 fix mysql-test/t/ndb_blob.test: bug#7340 fix ndb/src/ndbapi/NdbConnection.cpp: bug#7340 fix ndb/src/ndbapi/NdbOperationDefine.cpp: bug#7340 fix --- mysql-test/r/ndb_blob.result | 18 ++++++++++++++++++ mysql-test/t/ndb_blob.test | 14 ++++++++++++++ ndb/src/ndbapi/NdbConnection.cpp | 7 +++---- ndb/src/ndbapi/NdbOperationDefine.cpp | 4 +++- 4 files changed, 38 insertions(+), 5 deletions(-) diff --git a/mysql-test/r/ndb_blob.result b/mysql-test/r/ndb_blob.result index 156c2d570a4..6f25ec95c80 100644 --- a/mysql-test/r/ndb_blob.result +++ b/mysql-test/r/ndb_blob.result @@ -467,3 +467,21 @@ a b 1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 2 BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB drop table t1; +create table t1 ( +id int(11) unsigned primary key NOT NULL auto_increment, +msg text NOT NULL +) engine=ndbcluster default charset=utf8; +insert into t1 (msg) values( +'Tries to validate (8 byte length + inline bytes) as UTF8 :( +Fast fix: removed validation for Text. It is not yet indexable +so bad data will not crash kernel. +Proper fix: Set inline bytes to multiple of mbmaxlen and +validate it (after the 8 byte length).'); +select * from t1; +id msg +1 Tries to validate (8 byte length + inline bytes) as UTF8 :( +Fast fix: removed validation for Text. It is not yet indexable +so bad data will not crash kernel. +Proper fix: Set inline bytes to multiple of mbmaxlen and +validate it (after the 8 byte length). +drop table t1; diff --git a/mysql-test/t/ndb_blob.test b/mysql-test/t/ndb_blob.test index 06ecbc66d97..96e38bfb58e 100644 --- a/mysql-test/t/ndb_blob.test +++ b/mysql-test/t/ndb_blob.test @@ -389,3 +389,17 @@ set autocommit=1; alter table t1 engine=myisam; select * from t1 order by a; drop table t1; + +# -- bug #7340 -- +create table t1 ( + id int(11) unsigned primary key NOT NULL auto_increment, + msg text NOT NULL +) engine=ndbcluster default charset=utf8; +insert into t1 (msg) values( +'Tries to validate (8 byte length + inline bytes) as UTF8 :( +Fast fix: removed validation for Text. It is not yet indexable +so bad data will not crash kernel. +Proper fix: Set inline bytes to multiple of mbmaxlen and +validate it (after the 8 byte length).'); +select * from t1; +drop table t1; diff --git a/ndb/src/ndbapi/NdbConnection.cpp b/ndb/src/ndbapi/NdbConnection.cpp index f4bb000300a..83715dbfca0 100644 --- a/ndb/src/ndbapi/NdbConnection.cpp +++ b/ndb/src/ndbapi/NdbConnection.cpp @@ -361,11 +361,10 @@ NdbConnection::execute(ExecType aTypeOfExec, if (executeNoBlobs(tExecType, abortOption, forceSend) == -1) ret = -1; -#ifndef VM_TRACE - // can happen in complex abort cases - theFirstOpInList = theLastOpInList = NULL; -#else +#ifdef ndb_api_crash_on_complex_blob_abort assert(theFirstOpInList == NULL && theLastOpInList == NULL); +#else + theFirstOpInList = theLastOpInList = NULL; #endif { diff --git a/ndb/src/ndbapi/NdbOperationDefine.cpp b/ndb/src/ndbapi/NdbOperationDefine.cpp index 35abb15b00d..c4aaffb3119 100644 --- a/ndb/src/ndbapi/NdbOperationDefine.cpp +++ b/ndb/src/ndbapi/NdbOperationDefine.cpp @@ -528,7 +528,9 @@ NdbOperation::setValue( const NdbColumnImpl* tAttrInfo, CHARSET_INFO* cs = tAttrInfo->m_cs; // invalid data can crash kernel if (cs != NULL && - (*cs->cset->well_formed_len)(cs, + // fast fix bug#7340 + tAttrInfo->m_type != NdbDictionary::Column::Text && + (*cs->cset->well_formed_len)(cs, aValue, aValue + sizeInBytes, sizeInBytes) != sizeInBytes) { From 17ec146c6c124d91a3c749da538b55bbd119c956 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 22 Dec 2004 14:58:57 +0100 Subject: [PATCH 0573/1063] ndb - Fix bug in backward compatility code (for our test programs) ndb/src/ndbapi/Ndbinit.cpp: Fix bug in backward compatility code (for our test programs) --- ndb/src/ndbapi/Ndbinit.cpp | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/ndb/src/ndbapi/Ndbinit.cpp b/ndb/src/ndbapi/Ndbinit.cpp index e1af7bd4cc5..a11dd842495 100644 --- a/ndb/src/ndbapi/Ndbinit.cpp +++ b/ndb/src/ndbapi/Ndbinit.cpp @@ -204,14 +204,6 @@ Ndb::~Ndb() TransporterFacade::instance()->close(theNdbBlockNumber, theFirstTransId); } - if (global_ndb_cluster_connection != 0) { - theNoOfNdbObjects--; - if(theNoOfNdbObjects == 0){ - delete global_ndb_cluster_connection; - global_ndb_cluster_connection= 0; - } - }//if - // if (theSchemaConToNdbList != NULL) // closeSchemaTransaction(theSchemaConToNdbList); while ( theConIdleList != NULL ) @@ -249,6 +241,19 @@ Ndb::~Ndb() delete theImpl; + /** + * This needs to be put after delete theImpl + * as TransporterFacade::instance is delete by global_ndb_cluster_connection + * and used by theImpl + */ + if (global_ndb_cluster_connection != 0) { + theNoOfNdbObjects--; + if(theNoOfNdbObjects == 0){ + delete global_ndb_cluster_connection; + global_ndb_cluster_connection= 0; + } + }//if + /** * This sleep is to make sure that the transporter * send thread will come in and send any From f20ac5cab0b2af74c739860f4adc00d57243d435 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 22 Dec 2004 15:08:22 +0100 Subject: [PATCH 0574/1063] ndb: use Ndb_cluster_connection in test* ndb/test/ndbapi/testBlobs.cpp: use Ndb_cluster_connection ndb/test/ndbapi/testOIBasic.cpp: use Ndb_cluster_connection --- ndb/test/ndbapi/testBlobs.cpp | 10 +++++++--- ndb/test/ndbapi/testOIBasic.cpp | 11 ++++++++--- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/ndb/test/ndbapi/testBlobs.cpp b/ndb/test/ndbapi/testBlobs.cpp index b2cc5636e45..7b30777456f 100644 --- a/ndb/test/ndbapi/testBlobs.cpp +++ b/ndb/test/ndbapi/testBlobs.cpp @@ -154,6 +154,7 @@ testcase(char x) (g_opt.m_skip == 0 || strchr(g_opt.m_skip, x) == 0); } +static Ndb_cluster_connection* g_ncc = 0; static Ndb* g_ndb = 0; static NdbDictionary::Dictionary* g_dic = 0; static NdbConnection* g_con = 0; @@ -1259,7 +1260,7 @@ deleteScan(bool idx) static int testmain() { - g_ndb = new Ndb("TEST_DB"); + g_ndb = new Ndb(g_ncc, "TEST_DB"); CHK(g_ndb->init() == 0); CHK(g_ndb->waitUntilReady() == 0); g_dic = g_ndb->getDictionary(); @@ -1448,7 +1449,7 @@ testperf() if (! testcase('p')) return 0; DBG("=== perf test ==="); - g_ndb = new Ndb("TEST_DB"); + g_ndb = new Ndb(g_ncc, "TEST_DB"); CHK(g_ndb->init() == 0); CHK(g_ndb->waitUntilReady() == 0); g_dic = g_ndb->getDictionary(); @@ -1860,10 +1861,13 @@ NDB_COMMAND(testOdbcDriver, "testBlobs", "testBlobs", "testBlobs", 65535) strcat(b, "r"); g_opt.m_skip = strdup(b); } - if (testmain() == -1 || testperf() == -1) { + g_ncc = new Ndb_cluster_connection(); + if (g_ncc->connect(30) != 0 || testmain() == -1 || testperf() == -1) { ndbout << "line " << __LINE__ << " FAIL loop=" << g_loop << endl; return NDBT_ProgramExit(NDBT_FAILED); } + delete g_ncc; + g_ncc = 0; return NDBT_ProgramExit(NDBT_OK); } diff --git a/ndb/test/ndbapi/testOIBasic.cpp b/ndb/test/ndbapi/testOIBasic.cpp index 41f0686e63b..e6d3844d18e 100644 --- a/ndb/test/ndbapi/testOIBasic.cpp +++ b/ndb/test/ndbapi/testOIBasic.cpp @@ -59,7 +59,7 @@ struct Opt { unsigned m_subloop; const char* m_table; unsigned m_threads; - unsigned m_v; + int m_v; Opt() : m_batch(32), m_bound("01234"), @@ -672,6 +672,8 @@ tabcount = sizeof(tablist) / sizeof(tablist[0]); // connections +static Ndb_cluster_connection* g_ncc = 0; + struct Con { Ndb* m_ndb; NdbDictionary::Dictionary* m_dic; @@ -720,7 +722,7 @@ int Con::connect() { assert(m_ndb == 0); - m_ndb = new Ndb("TEST_DB"); + m_ndb = new Ndb(g_ncc, "TEST_DB"); CHKCON(m_ndb->init() == 0, *this); CHKCON(m_ndb->waitUntilReady(30) == 0, *this); m_tx = 0, m_op = 0; @@ -3514,8 +3516,11 @@ NDB_COMMAND(testOIBasic, "testOIBasic", "testOIBasic", "testOIBasic", 65535) } { Par par(g_opt); - if (runtest(par) < 0) + g_ncc = new Ndb_cluster_connection(); + if (g_ncc->connect(30) != 0 || runtest(par) < 0) goto failed; + delete g_ncc; + g_ncc = 0; } // always exit with NDBT code ok: From 0ebbd72640bb719ae922d502f22a98acfa2c9aee Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 22 Dec 2004 18:56:57 +0400 Subject: [PATCH 0575/1063] Bugs#7278: Don't open a table if it contains columns with non-supported charsets --- sql/table.cc | 37 +++++++++++++++++++++++++++++-------- 1 file changed, 29 insertions(+), 8 deletions(-) diff --git a/sql/table.cc b/sql/table.cc index 7adca2a5ab0..5ede9c1e43d 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -24,7 +24,8 @@ /* Functions defined in this file */ -static void frm_error(int error,TABLE *form,const char *name,int errortype); +static void frm_error(int error,TABLE *form,const char *name, + int errortype, int errarg); static void fix_type_pointers(const char ***array, TYPELIB *point_to_type, uint types, char **names); static uint find_field(TABLE *form,uint start,uint length); @@ -57,6 +58,7 @@ static byte* get_field_name(Field **buff,uint *length, 2 Error (see frm_error) 3 Wrong data in .frm file 4 Error (see frm_error) + 5 Error (see frm_error: charset unavailable) */ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag, @@ -64,7 +66,7 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag, { reg1 uint i; reg2 uchar *strpos; - int j,error; + int j,error, errarg= 0; uint rec_buff_length,n_length,int_length,records,key_parts,keys, interval_count,interval_parts,read_length,db_create_options; uint key_info_length, com_length; @@ -436,10 +438,14 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag, } else { - if (!strpos[14]) - charset= &my_charset_bin; - else if (!(charset=get_charset((uint) strpos[14], MYF(0)))) - charset= outparam->table_charset; + if (!strpos[14]) + charset= &my_charset_bin; + else if (!(charset=get_charset((uint) strpos[14], MYF(0)))) + { + error= 5; // Unknown or unavailable charset + errarg= (int) strpos[14]; + goto err_not_open; + } } if (!comment_length) { @@ -781,7 +787,7 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag, err_end: /* Here when no file */ delete crypted; *root_ptr= old_root; - frm_error(error,outparam,name,ME_ERROR+ME_WAITTANG); + frm_error(error, outparam, name, ME_ERROR + ME_WAITTANG, errarg); delete outparam->file; outparam->file=0; // For easyer errorchecking outparam->db_stat=0; @@ -966,7 +972,8 @@ ulong make_new_entry(File file, uchar *fileinfo, TYPELIB *formnames, /* error message when opening a form file */ -static void frm_error(int error, TABLE *form, const char *name, myf errortype) +static void frm_error(int error, TABLE *form, const char *name, + myf errortype, int errarg) { int err_no; char buff[FN_REFLEN]; @@ -997,6 +1004,20 @@ static void frm_error(int error, TABLE *form, const char *name, myf errortype) fn_format(buff,form->real_name,form_dev,datext,2),my_errno); break; } + case 5: + { + const char *csname= get_charset_name((uint) errarg); + char tmp[10]; + if (!csname || csname[0] =='?') + { + my_snprintf(tmp, sizeof(tmp), "#%d", errarg); + csname= tmp; + } + my_printf_error(ER_UNKNOWN_COLLATION, + "Unknown collation '%s' in table '%-.64s' definition", + MYF(0), csname, form->real_name); + break; + } default: /* Better wrong error than none */ case 4: my_error(ER_NOT_FORM_FILE,errortype, From 8dcfad68e2f2a26ad2508762e2b6a9a6afac925a Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 22 Dec 2004 16:29:01 +0100 Subject: [PATCH 0576/1063] changed name of g_eventLogger so it can be used in TransporterRegistry and is the same as in the kernel ndb/include/ndbapi/ndb_cluster_connection.hpp: changed return type of no_ndb_nodes ndb/include/transporter/TransporterRegistry.hpp: added connect_server method to TransporterRegistry ndb/include/util/ndb_opts.h: set shared memory usage as _no_ default in 4.1 ndb/src/common/transporter/Makefile.am: added -I flags for EventLogger.hpp ndb/src/common/transporter/SCI_Transporter.cpp: setting transporter type ndb/src/common/transporter/SHM_Transporter.cpp: setting transporter type ndb/src/common/transporter/TCP_Transporter.cpp: setting transporter type ndb/src/common/transporter/Transporter.cpp: added event logger added type handling in transporter added verification of transporter type compatability ndb/src/common/transporter/Transporter.hpp: setting transporter type ndb/src/common/transporter/TransporterRegistry.cpp: moved server-client transporter negotiation to own method connect_server() added verification of transporter compatability ndb/src/kernel/main.cpp: changed which events are logged ndb/src/ndbapi/ndb_cluster_connection.cpp: added g_eventLogger sql/mysqld.cc: set shared memory usage as _no_ default in 4.1 --- ndb/include/ndbapi/ndb_cluster_connection.hpp | 2 +- .../transporter/TransporterRegistry.hpp | 7 +- ndb/include/util/ndb_opts.h | 2 +- ndb/src/common/transporter/Makefile.am | 2 +- .../common/transporter/SCI_Transporter.cpp | 3 +- .../common/transporter/SHM_Transporter.cpp | 6 +- .../common/transporter/TCP_Transporter.cpp | 3 +- ndb/src/common/transporter/Transporter.cpp | 57 ++++++-- ndb/src/common/transporter/Transporter.hpp | 2 + .../transporter/TransporterRegistry.cpp | 133 ++++++++++++------ ndb/src/kernel/main.cpp | 2 +- ndb/src/mgmsrv/MgmtSrvr.cpp | 37 +++-- ndb/src/mgmsrv/main.cpp | 10 +- ndb/src/ndbapi/ndb_cluster_connection.cpp | 10 +- sql/mysqld.cc | 2 +- 15 files changed, 194 insertions(+), 84 deletions(-) diff --git a/ndb/include/ndbapi/ndb_cluster_connection.hpp b/ndb/include/ndbapi/ndb_cluster_connection.hpp index a98dcaaf5a4..0e559700716 100644 --- a/ndb/include/ndbapi/ndb_cluster_connection.hpp +++ b/ndb/include/ndbapi/ndb_cluster_connection.hpp @@ -82,7 +82,7 @@ public: void set_optimized_node_selection(int val); - int no_db_nodes(); + unsigned no_db_nodes(); #endif private: diff --git a/ndb/include/transporter/TransporterRegistry.hpp b/ndb/include/transporter/TransporterRegistry.hpp index 96da7eef2cb..7487d6b1e80 100644 --- a/ndb/include/transporter/TransporterRegistry.hpp +++ b/ndb/include/transporter/TransporterRegistry.hpp @@ -99,7 +99,12 @@ public: unsigned sizeOfLongSignalMemory = 100); bool init(NodeId localNodeId); - + + /** + * after a connect from client, perform connection using correct transporter + */ + bool connect_server(NDB_SOCKET_TYPE sockfd); + /** * Remove all transporters */ diff --git a/ndb/include/util/ndb_opts.h b/ndb/include/util/ndb_opts.h index 4bac36f5e5e..dc95149f706 100644 --- a/ndb/include/util/ndb_opts.h +++ b/ndb/include/util/ndb_opts.h @@ -34,7 +34,7 @@ OPT_NDB_OPTIMIZED_NODE_SELECTION #define OPT_NDB_CONNECTSTRING 'c' -#ifdef NDB_SHM_TRANSPORTER +#if defined(NDB_SHM_TRANSPORTER) && MYSQL_VERSION_ID >= 50000 #define OPT_NDB_SHM_DEFAULT 1 #else #define OPT_NDB_SHM_DEFAULT 0 diff --git a/ndb/src/common/transporter/Makefile.am b/ndb/src/common/transporter/Makefile.am index d76b1b6048b..b902012e56d 100644 --- a/ndb/src/common/transporter/Makefile.am +++ b/ndb/src/common/transporter/Makefile.am @@ -13,7 +13,7 @@ EXTRA_libtransporter_la_SOURCES = SHM_Transporter.cpp SHM_Transporter.unix.cpp S libtransporter_la_LIBADD = @ndb_transporter_opt_objs@ libtransporter_la_DEPENDENCIES = @ndb_transporter_opt_objs@ -INCLUDES_LOC = -I$(top_srcdir)/ndb/include/kernel -I$(top_srcdir)/ndb/include/transporter @NDB_SCI_INCLUDES@ +INCLUDES_LOC = -I$(top_srcdir)/ndb/include/mgmapi -I$(top_srcdir)/ndb/include/debugger -I$(top_srcdir)/ndb/include/kernel -I$(top_srcdir)/ndb/include/transporter @NDB_SCI_INCLUDES@ include $(top_srcdir)/ndb/config/common.mk.am include $(top_srcdir)/ndb/config/type_util.mk.am diff --git a/ndb/src/common/transporter/SCI_Transporter.cpp b/ndb/src/common/transporter/SCI_Transporter.cpp index 73fbb064599..e7807c972b1 100644 --- a/ndb/src/common/transporter/SCI_Transporter.cpp +++ b/ndb/src/common/transporter/SCI_Transporter.cpp @@ -44,7 +44,8 @@ SCI_Transporter::SCI_Transporter(TransporterRegistry &t_reg, bool chksm, bool signalId, Uint32 reportFreq) : - Transporter(t_reg, lHostName, rHostName, r_port, _localNodeId, + Transporter(t_reg, tt_SCI_TRANSPORTER, + lHostName, rHostName, r_port, _localNodeId, _remoteNodeId, 0, false, chksm, signalId) { DBUG_ENTER("SCI_Transporter::SCI_Transporter"); diff --git a/ndb/src/common/transporter/SHM_Transporter.cpp b/ndb/src/common/transporter/SHM_Transporter.cpp index e4051519b86..ffb51bf1326 100644 --- a/ndb/src/common/transporter/SHM_Transporter.cpp +++ b/ndb/src/common/transporter/SHM_Transporter.cpp @@ -38,7 +38,8 @@ SHM_Transporter::SHM_Transporter(TransporterRegistry &t_reg, bool signalId, key_t _shmKey, Uint32 _shmSize) : - Transporter(t_reg, lHostName, rHostName, r_port, lNodeId, rNodeId, + Transporter(t_reg, tt_SHM_TRANSPORTER, + lHostName, rHostName, r_port, lNodeId, rNodeId, 0, false, checksum, signalId), shmKey(_shmKey), shmSize(_shmSize) @@ -256,6 +257,9 @@ SHM_Transporter::connect_client_impl(NDB_SOCKET_TYPE sockfd) SocketOutputStream s_output(sockfd); char buf[256]; +#if 1 +#endif + // Wait for server to create and attach if (s_input.gets(buf, 256) == 0) { NDB_CLOSE_SOCKET(sockfd); diff --git a/ndb/src/common/transporter/TCP_Transporter.cpp b/ndb/src/common/transporter/TCP_Transporter.cpp index 524ecd653e0..a629b620157 100644 --- a/ndb/src/common/transporter/TCP_Transporter.cpp +++ b/ndb/src/common/transporter/TCP_Transporter.cpp @@ -72,7 +72,8 @@ TCP_Transporter::TCP_Transporter(TransporterRegistry &t_reg, NodeId rNodeId, bool chksm, bool signalId, Uint32 _reportFreq) : - Transporter(t_reg, lHostName, rHostName, r_port, lNodeId, rNodeId, + Transporter(t_reg, tt_TCP_TRANSPORTER, + lHostName, rHostName, r_port, lNodeId, rNodeId, 0, false, chksm, signalId), m_sendBuffer(sendBufSize) { diff --git a/ndb/src/common/transporter/Transporter.cpp b/ndb/src/common/transporter/Transporter.cpp index 3fe10cb2fe8..b84f8f6fb5e 100644 --- a/ndb/src/common/transporter/Transporter.cpp +++ b/ndb/src/common/transporter/Transporter.cpp @@ -24,7 +24,11 @@ #include #include +#include +extern EventLogger g_eventLogger; + Transporter::Transporter(TransporterRegistry &t_reg, + TransporterType _type, const char *lHostName, const char *rHostName, int r_port, @@ -35,6 +39,7 @@ Transporter::Transporter(TransporterRegistry &t_reg, : m_r_port(r_port), remoteNodeId(rNodeId), localNodeId(lNodeId), isServer(lNodeId < rNodeId), m_packer(_signalId, _checksum), + m_type(_type), m_transporter_registry(t_reg) { DBUG_ENTER("Transporter::Transporter"); @@ -73,7 +78,8 @@ Transporter::Transporter(TransporterRegistry &t_reg, m_socket_client= 0; else m_socket_client= new SocketClient(remoteHostName, r_port, - new SocketAuthSimple("ndbd", "ndbd passwd")); + new SocketAuthSimple("ndbd", + "ndbd passwd")); DBUG_VOID_RETURN; } @@ -84,7 +90,9 @@ Transporter::~Transporter(){ bool Transporter::connect_server(NDB_SOCKET_TYPE sockfd) { + // all initial negotiation is done in TransporterRegistry::connect_server DBUG_ENTER("Transporter::connect_server"); + if(m_connected) { DBUG_RETURN(true); // TODO assert(0); @@ -108,27 +116,60 @@ Transporter::connect_client() { if (sockfd == NDB_INVALID_SOCKET) return false; - // send info about own id + DBUG_ENTER("Transporter::connect_client"); + + // send info about own id + // send info about own transporter type SocketOutputStream s_output(sockfd); - s_output.println("%d", localNodeId); + s_output.println("%d %d", localNodeId, m_type); // get remote id - int nodeId; + int nodeId, remote_transporter_type= -1; SocketInputStream s_input(sockfd); char buf[256]; if (s_input.gets(buf, 256) == 0) { NDB_CLOSE_SOCKET(sockfd); - return false; + DBUG_RETURN(false); } - if (sscanf(buf, "%d", &nodeId) != 1) { + + int r= sscanf(buf, "%d %d", &nodeId, &remote_transporter_type); + switch (r) { + case 2: + break; + case 1: + // we're running version prior to 4.1.9 + // ok, but with no checks on transporter configuration compatability + break; + default: NDB_CLOSE_SOCKET(sockfd); - return false; + DBUG_RETURN(false); } + + DBUG_PRINT("info", ("nodeId=%d remote_transporter_type=%d", + nodeId, remote_transporter_type)); + + if (remote_transporter_type != -1) + { + if (remote_transporter_type != m_type) + { + DBUG_PRINT("error", ("Transporter types mismatch this=%d remote=%d", + m_type, remote_transporter_type)); + NDB_CLOSE_SOCKET(sockfd); + g_eventLogger.error("Incompatible configuration: transporter type " + "mismatch with node %d", nodeId); + DBUG_RETURN(false); + } + } + else if (m_type == tt_SHM_TRANSPORTER) + { + g_eventLogger.warning("Unable to verify transporter compatability with node %d", nodeId); + } + bool res = connect_client_impl(sockfd); if(res){ m_connected = true; m_errorCount = 0; } - return res; + DBUG_RETURN(res); } void diff --git a/ndb/src/common/transporter/Transporter.hpp b/ndb/src/common/transporter/Transporter.hpp index 9a39f8788bc..10303ec71ea 100644 --- a/ndb/src/common/transporter/Transporter.hpp +++ b/ndb/src/common/transporter/Transporter.hpp @@ -71,6 +71,7 @@ public: protected: Transporter(TransporterRegistry &, + TransporterType, const char *lHostName, const char *rHostName, int r_port, @@ -127,6 +128,7 @@ protected: protected: bool m_connected; // Are we connected + TransporterType m_type; TransporterRegistry &m_transporter_registry; void *get_callback_obj() { return m_transporter_registry.callbackObj; }; diff --git a/ndb/src/common/transporter/TransporterRegistry.cpp b/ndb/src/common/transporter/TransporterRegistry.cpp index 394c7cd490d..2eb81b2b35d 100644 --- a/ndb/src/common/transporter/TransporterRegistry.cpp +++ b/ndb/src/common/transporter/TransporterRegistry.cpp @@ -47,6 +47,9 @@ #include #include +#include +extern EventLogger g_eventLogger; + int g_shm_pid = 0; SocketServer::Session * TransporterService::newSession(NDB_SOCKET_TYPE sockfd) @@ -57,49 +60,10 @@ SocketServer::Session * TransporterService::newSession(NDB_SOCKET_TYPE sockfd) DBUG_RETURN(0); } + if (!m_transporter_registry->connect_server(sockfd)) { - // read node id from client - int nodeId; - SocketInputStream s_input(sockfd); - char buf[256]; - if (s_input.gets(buf, 256) == 0) { - NDB_CLOSE_SOCKET(sockfd); - DBUG_PRINT("error", ("Could not get node id from client")); - DBUG_RETURN(0); - } - if (sscanf(buf, "%d", &nodeId) != 1) { - NDB_CLOSE_SOCKET(sockfd); - DBUG_PRINT("error", ("Error in node id from client")); - DBUG_RETURN(0); - } - - //check that nodeid is valid and that there is an allocated transporter - if ( nodeId < 0 || nodeId >= (int)m_transporter_registry->maxTransporters) { - NDB_CLOSE_SOCKET(sockfd); - DBUG_PRINT("error", ("Node id out of range from client")); - DBUG_RETURN(0); - } - if (m_transporter_registry->theTransporters[nodeId] == 0) { - NDB_CLOSE_SOCKET(sockfd); - DBUG_PRINT("error", ("No transporter for this node id from client")); - DBUG_RETURN(0); - } - - //check that the transporter should be connected - if (m_transporter_registry->performStates[nodeId] != TransporterRegistry::CONNECTING) { - NDB_CLOSE_SOCKET(sockfd); - DBUG_PRINT("error", ("Transporter in wrong state for this node id from client")); - DBUG_RETURN(0); - } - - Transporter *t= m_transporter_registry->theTransporters[nodeId]; - - // send info about own id (just as response to acknowledge connection) - SocketOutputStream s_output(sockfd); - s_output.println("%d", t->getLocalNodeId()); - - // setup transporter (transporter responsible for closing sockfd) - t->connect_server(sockfd); + NDB_CLOSE_SOCKET(sockfd); + DBUG_RETURN(0); } DBUG_RETURN(0); @@ -195,6 +159,91 @@ TransporterRegistry::init(NodeId nodeId) { return true; } +bool +TransporterRegistry::connect_server(NDB_SOCKET_TYPE sockfd) +{ + DBUG_ENTER("TransporterRegistry::connect_server"); + + // read node id from client + // read transporter type + int nodeId, remote_transporter_type= -1; + SocketInputStream s_input(sockfd); + char buf[256]; + if (s_input.gets(buf, 256) == 0) { + DBUG_PRINT("error", ("Could not get node id from client")); + DBUG_RETURN(false); + } + int r= sscanf(buf, "%d %d", &nodeId, &remote_transporter_type); + switch (r) { + case 2: + break; + case 1: + // we're running version prior to 4.1.9 + // ok, but with no checks on transporter configuration compatability + break; + default: + DBUG_PRINT("error", ("Error in node id from client")); + DBUG_RETURN(false); + } + + DBUG_PRINT("info", ("nodeId=%d remote_transporter_type=%d", + nodeId,remote_transporter_type)); + + //check that nodeid is valid and that there is an allocated transporter + if ( nodeId < 0 || nodeId >= (int)maxTransporters) { + DBUG_PRINT("error", ("Node id out of range from client")); + DBUG_RETURN(false); + } + if (theTransporters[nodeId] == 0) { + DBUG_PRINT("error", ("No transporter for this node id from client")); + DBUG_RETURN(false); + } + + //check that the transporter should be connected + if (performStates[nodeId] != TransporterRegistry::CONNECTING) { + DBUG_PRINT("error", ("Transporter in wrong state for this node id from client")); + DBUG_RETURN(false); + } + + Transporter *t= theTransporters[nodeId]; + + // send info about own id (just as response to acknowledge connection) + // send info on own transporter type + SocketOutputStream s_output(sockfd); + s_output.println("%d %d", t->getLocalNodeId(), t->m_type); + + if (remote_transporter_type != -1) + { + if (remote_transporter_type != t->m_type) + { + DBUG_PRINT("error", ("Transporter types mismatch this=%d remote=%d", + t->m_type, remote_transporter_type)); + g_eventLogger.error("Incompatible configuration: Transporter type " + "mismatch with node %d", nodeId); + + // wait for socket close for 1 second to let message arrive at client + { + fd_set a_set; + FD_ZERO(&a_set); + FD_SET(sockfd, &a_set); + struct timeval timeout; + timeout.tv_sec = 1; timeout.tv_usec = 0; + select(sockfd+1, &a_set, 0, 0, &timeout); + } + DBUG_RETURN(false); + } + } + else if (t->m_type == tt_SHM_TRANSPORTER) + { + g_eventLogger.warning("Unable to verify transporter compatability with node %d", nodeId); + } + + // setup transporter (transporter responsible for closing sockfd) + t->connect_server(sockfd); + + DBUG_RETURN(true); +} + bool TransporterRegistry::createTransporter(TCP_TransporterConfiguration *config) { #ifdef NDB_TCP_TRANSPORTER diff --git a/ndb/src/kernel/main.cpp b/ndb/src/kernel/main.cpp index 44fe1725c9e..448bdd9a1fa 100644 --- a/ndb/src/kernel/main.cpp +++ b/ndb/src/kernel/main.cpp @@ -58,7 +58,7 @@ int main(int argc, char** argv) // Print to stdout/console g_eventLogger.createConsoleHandler(); g_eventLogger.setCategory("NDB"); - g_eventLogger.enable(Logger::LL_INFO, Logger::LL_ALERT); // Log INFO to ALERT + g_eventLogger.enable(Logger::LL_ON, Logger::LL_ERROR); globalEmulatorData.create(); diff --git a/ndb/src/mgmsrv/MgmtSrvr.cpp b/ndb/src/mgmsrv/MgmtSrvr.cpp index 3fcde997cb0..f698099141a 100644 --- a/ndb/src/mgmsrv/MgmtSrvr.cpp +++ b/ndb/src/mgmsrv/MgmtSrvr.cpp @@ -133,8 +133,7 @@ MgmtSrvr::signalRecvThreadRun() } } - -EventLogger g_EventLogger; +extern EventLogger g_eventLogger; static NdbOut& operator<<(NdbOut& out, const LogLevel & ll) @@ -200,7 +199,7 @@ MgmtSrvr::logLevelThreadRun() void MgmtSrvr::startEventLog() { - g_EventLogger.setCategory("MgmSrvr"); + g_eventLogger.setCategory("MgmSrvr"); ndb_mgm_configuration_iterator * iter = ndb_mgm_create_configuration_iterator ((ndb_mgm_configuration*)_config->m_configValues, CFG_SECTION_NODE); @@ -226,7 +225,7 @@ MgmtSrvr::startEventLog() logdest.assfmt("FILE:filename=%s,maxsize=1000000,maxfiles=6", clusterLog); } - if(!g_EventLogger.addHandler(logdest)) { + if(!g_eventLogger.addHandler(logdest)) { ndbout << "Warning: could not add log destination \"" << logdest.c_str() << "\"" << endl; } @@ -250,21 +249,21 @@ MgmtSrvr::setEventLogFilter(int severity, int enable) { Logger::LoggerLevel level = (Logger::LoggerLevel)severity; if (enable > 0) { - g_EventLogger.enable(level); + g_eventLogger.enable(level); } else if (enable == 0) { - g_EventLogger.disable(level); - } else if (g_EventLogger.isEnable(level)) { - g_EventLogger.disable(level); + g_eventLogger.disable(level); + } else if (g_eventLogger.isEnable(level)) { + g_eventLogger.disable(level); } else { - g_EventLogger.enable(level); + g_eventLogger.enable(level); } - return g_EventLogger.isEnable(level); + return g_eventLogger.isEnable(level); } bool MgmtSrvr::isEventLogFilterEnabled(int severity) { - return g_EventLogger.isEnable((Logger::LoggerLevel)severity); + return g_eventLogger.isEnable((Logger::LoggerLevel)severity); } static ErrorItem errorTable[] = @@ -1990,7 +1989,7 @@ MgmtSrvr::handleReceivedSignal(NdbApiSignal* signal) } default: - g_EventLogger.error("Unknown signal received. SignalNumber: " + g_eventLogger.error("Unknown signal received. SignalNumber: " "%i from (%d, %x)", gsn, refToNode(signal->theSendersBlockRef), @@ -2066,7 +2065,7 @@ MgmtSrvr::handleStopReply(NodeId nodeId, Uint32 errCode) error: if(errCode != 0){ - g_EventLogger.error("Unexpected signal received. SignalNumber: %i from %d", + g_eventLogger.error("Unexpected signal received. SignalNumber: %i from %d", GSN_STOP_REF, nodeId); } } @@ -2286,7 +2285,7 @@ MgmtSrvr::alloc_node_id(NodeId * nodeId, m_reserved_nodes.set(id_found); char tmp_str[128]; m_reserved_nodes.getText(tmp_str); - g_EventLogger.info("Mgmt server state: nodeid %d reserved for ip %s, m_reserved_nodes %s.", + g_eventLogger.info("Mgmt server state: nodeid %d reserved for ip %s, m_reserved_nodes %s.", id_found, get_connect_address(id_found), tmp_str); DBUG_RETURN(true); } @@ -2346,7 +2345,7 @@ MgmtSrvr::alloc_node_id(NodeId * nodeId, *nodeId); } - g_EventLogger.warning("Allocate nodeid (%d) failed. Connection from ip %s. " + g_eventLogger.warning("Allocate nodeid (%d) failed. Connection from ip %s. " "Returned error string \"%s\"", *nodeId, client_addr != 0 ? inet_ntoa(((struct sockaddr_in *)(client_addr))->sin_addr) : "", @@ -2369,10 +2368,10 @@ MgmtSrvr::alloc_node_id(NodeId * nodeId, } } if (tmp_connected.length() > 0) - g_EventLogger.info("Mgmt server state: node id's %s connected but not reserved", + g_eventLogger.info("Mgmt server state: node id's %s connected but not reserved", tmp_connected.c_str()); if (tmp_not_connected.length() > 0) - g_EventLogger.info("Mgmt server state: node id's %s not connected but reserved", + g_eventLogger.info("Mgmt server state: node id's %s not connected but reserved", tmp_not_connected.c_str()); } DBUG_RETURN(false); @@ -2404,7 +2403,7 @@ MgmtSrvr::eventReport(NodeId nodeId, const Uint32 * theData) EventReport::EventType type = eventReport->getEventType(); // Log event - g_EventLogger.log(type, theData, nodeId, + g_eventLogger.log(type, theData, nodeId, &m_event_listner[0].m_logLevel); m_event_listner.log(type, theData, nodeId); } @@ -2647,7 +2646,7 @@ MgmtSrvr::Allocated_resources::~Allocated_resources() char tmp_str[128]; m_mgmsrv.m_reserved_nodes.getText(tmp_str); - g_EventLogger.info("Mgmt server state: nodeid %d freed, m_reserved_nodes %s.", + g_eventLogger.info("Mgmt server state: nodeid %d freed, m_reserved_nodes %s.", get_nodeid(), tmp_str); } } diff --git a/ndb/src/mgmsrv/main.cpp b/ndb/src/mgmsrv/main.cpp index 015e2de022d..ce79ccb732b 100644 --- a/ndb/src/mgmsrv/main.cpp +++ b/ndb/src/mgmsrv/main.cpp @@ -86,7 +86,7 @@ static MgmGlobals glob; * Global variables */ bool g_StopServer; -extern EventLogger g_EventLogger; +extern EventLogger g_eventLogger; extern int global_mgmt_server_check; @@ -303,12 +303,12 @@ int main(int argc, char** argv) BaseString::snprintf(msg, sizeof(msg), "NDB Cluster Management Server. %s", NDB_VERSION_STRING); ndbout_c(msg); - g_EventLogger.info(msg); + g_eventLogger.info(msg); BaseString::snprintf(msg, 256, "Id: %d, Command port: %d", glob.localNodeId, glob.port); ndbout_c(msg); - g_EventLogger.info(msg); + g_eventLogger.info(msg); g_StopServer = false; glob.socketServer->startServer(); @@ -324,10 +324,10 @@ int main(int argc, char** argv) NdbSleep_MilliSleep(500); } - g_EventLogger.info("Shutting down server..."); + g_eventLogger.info("Shutting down server..."); glob.socketServer->stopServer(); glob.socketServer->stopSessions(); - g_EventLogger.info("Shutdown complete"); + g_eventLogger.info("Shutdown complete"); return 0; error_end: return 1; diff --git a/ndb/src/ndbapi/ndb_cluster_connection.cpp b/ndb/src/ndbapi/ndb_cluster_connection.cpp index f754ec8b40a..5df707e211d 100644 --- a/ndb/src/ndbapi/ndb_cluster_connection.cpp +++ b/ndb/src/ndbapi/ndb_cluster_connection.cpp @@ -31,6 +31,9 @@ #include #include +#include +EventLogger g_eventLogger; + static int g_run_connect_thread= 0; #include @@ -174,7 +177,7 @@ Ndb_cluster_connection_impl::get_next_node(Ndb_cluster_connection_node_iter &ite return node.id; } -int +unsigned Ndb_cluster_connection::no_db_nodes() { return m_impl.m_all_nodes.size(); @@ -248,6 +251,11 @@ Ndb_cluster_connection_impl::Ndb_cluster_connection_impl(const char * { DBUG_ENTER("Ndb_cluster_connection"); DBUG_PRINT("enter",("Ndb_cluster_connection this=0x%x", this)); + + g_eventLogger.createConsoleHandler(); + g_eventLogger.setCategory("NdbApi"); + g_eventLogger.enable(Logger::LL_ON, Logger::LL_ERROR); + m_transporter_facade= TransporterFacade::theFacadeInstance= new TransporterFacade(); diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 5cd85113641..e6e079d3deb 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -53,7 +53,7 @@ #endif #ifdef HAVE_NDBCLUSTER_DB #define OPT_NDBCLUSTER_DEFAULT 0 -#ifdef NDB_SHM_TRANSPORTER +#if defined(NDB_SHM_TRANSPORTER) && MYSQL_VERSION_ID >= 50000 #define OPT_NDB_SHM_DEFAULT 1 #else #define OPT_NDB_SHM_DEFAULT 0 From 0ed3eb41a0db444896a5dd26e814b8f0f630957b Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 22 Dec 2004 18:58:25 +0300 Subject: [PATCH 0577/1063] Fix for bug #7458 "Microseconds are gobbled from the string result of STR_TO_DATE() function if there is another format specifier after %f in format string". Also small cleanup of STR_TO_DATE() implementation. (After review version.) mysql-test/r/date_formats.result: Added test for small bug in STR_TO_DATE() implementation which caused microseconds to be gobbled from string result of this function, if there was another specifier after %f in format string. mysql-test/t/date_formats.test: Added test for small bug in STR_TO_DATE() implementation which caused microseconds to be gobbled from string result of this function, if there was another specifier after %f in format string. sql/item_timefunc.cc: Small cleanup of str_to_date() implementation. Renamed check_result_type() to less ambigous get_date_time_result_type() and made it static. Also added handling of %X,%x,%V,%v to this function. Fixed small bug in it which caused microseconds to be gobbled if there was some other specifiers after %f. Cleaned up comments a bit. --- mysql-test/r/date_formats.result | 3 ++ mysql-test/t/date_formats.test | 2 ++ sql/item_timefunc.cc | 56 +++++++++++++++++++++----------- 3 files changed, 42 insertions(+), 19 deletions(-) diff --git a/mysql-test/r/date_formats.result b/mysql-test/r/date_formats.result index 758a83defed..2db014c4a52 100644 --- a/mysql-test/r/date_formats.result +++ b/mysql-test/r/date_formats.result @@ -296,6 +296,9 @@ Tuesday 52 2001 %W %V %X 00:00:00 15-01-2001 %d-%m-%Y %H:%i:%S 00:00:00 15-01-20 %d-%m-%y 00:00:00 15-2001-1 %d-%Y-%c 00:00:00 +select concat('',str_to_date('8:11:2.123456 03-01-02','%H:%i:%S.%f %y-%m-%d')); +concat('',str_to_date('8:11:2.123456 03-01-02','%H:%i:%S.%f %y-%m-%d')) +2003-01-02 08:11:02.123456 truncate table t1; insert into t1 values ('2003-01-02 10:11:12 PM', '%Y-%m-%d %H:%i:%S %p'), diff --git a/mysql-test/t/date_formats.test b/mysql-test/t/date_formats.test index c369a9c85d5..800e5880b09 100644 --- a/mysql-test/t/date_formats.test +++ b/mysql-test/t/date_formats.test @@ -166,6 +166,8 @@ select date,format,cast(str_to_date(date, format) as datetime) as datetime from select date,format,DATE(str_to_date(date, format)) as date2 from t1; select date,format,TIME(str_to_date(date, format)) as time from t1; select date,format,concat(TIME(str_to_date(date, format))) as time2 from t1; +# Test small bug in %f handling +select concat('',str_to_date('8:11:2.123456 03-01-02','%H:%i:%S.%f %y-%m-%d')); # Test wrong dates or converion specifiers diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index 354c8b5c50c..84a9e01ed2a 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -149,6 +149,9 @@ static DATE_TIME_FORMAT time_24hrs_format= {{0}, '\0', 0, conversion specifiers that can be used in such sub-patterns is limited. Also most of checks are skipped in this case. + If one adds new format specifiers to this function he should also + consider adding them to get_date_time_result_type() function. + RETURN 0 ok 1 error @@ -2595,25 +2598,31 @@ void Item_func_get_format::print(String *str) /* - check_result_type(s, l) returns DATE/TIME type - according to format string + Get type of datetime value (DATE/TIME/...) which will be produced + according to format string. - s: DATE/TIME format string - l: length of s - Result: date_time_format_types value: - DATE_TIME_MICROSECOND, DATE_TIME, - TIME_MICROSECOND, TIME_ONLY + SYNOPSIS + get_date_time_result_type() + format - format string + length - length of format string - We don't process day format's characters('D', 'd', 'e') - because day may be a member of all date/time types. - If only day format's character and no time part present - the result type is MYSQL_TYPE_DATE + NOTE + We don't process day format's characters('D', 'd', 'e') because day + may be a member of all date/time types. + + Format specifiers supported by this function should be in sync with + specifiers supported by extract_date_time() function. + + RETURN VALUE + One of date_time_format_types values: + DATE_TIME_MICROSECOND, DATE_TIME, DATE_ONLY, TIME_MICROSECOND, TIME_ONLY */ -date_time_format_types check_result_type(const char *format, uint length) +static date_time_format_types +get_date_time_result_type(const char *format, uint length) { const char *time_part_frms= "HISThiklrs"; - const char *date_part_frms= "MUYWabcjmuyw"; + const char *date_part_frms= "MVUXYWabcjmvuxyw"; bool date_part_used= 0, time_part_used= 0, frac_second_used= 0; const char *val= format; @@ -2624,22 +2633,30 @@ date_time_format_types check_result_type(const char *format, uint length) if (*val == '%' && val+1 != end) { val++; - if ((frac_second_used= (*val == 'f')) || - (!time_part_used && strchr(time_part_frms, *val))) + if (*val == 'f') + frac_second_used= time_part_used= 1; + else if (!time_part_used && strchr(time_part_frms, *val)) time_part_used= 1; else if (!date_part_used && strchr(date_part_frms, *val)) date_part_used= 1; - if (time_part_used && date_part_used && frac_second_used) + if (date_part_used && frac_second_used) + { + /* + frac_second_used implies time_part_used, and thus we already + have all types of date-time components and can end our search. + */ return DATE_TIME_MICROSECOND; + } } } + /* We don't have all three types of date-time components */ + if (frac_second_used) + return TIME_MICROSECOND; if (time_part_used) { if (date_part_used) return DATE_TIME; - if (frac_second_used) - return TIME_MICROSECOND; return TIME_ONLY; } return DATE_ONLY; @@ -2670,7 +2687,8 @@ void Item_func_str_to_date::fix_length_and_dec() if ((const_item= args[1]->const_item())) { format= args[1]->val_str(&format_str); - cached_format_type= check_result_type(format->ptr(), format->length()); + cached_format_type= get_date_time_result_type(format->ptr(), + format->length()); switch (cached_format_type) { case DATE_ONLY: cached_timestamp_type= MYSQL_TIMESTAMP_DATE; From eebd8d7e41fbfc954b567ac6561a5b3b617a232e Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 22 Dec 2004 18:27:07 +0100 Subject: [PATCH 0578/1063] added handling of repeated messages ndb/src/common/transporter/Transporter.hpp: fixed small error --- ndb/include/logger/LogHandler.hpp | 10 ++++ ndb/src/common/logger/LogHandler.cpp | 59 ++++++++++++++++++++-- ndb/src/common/transporter/Transporter.hpp | 2 +- 3 files changed, 65 insertions(+), 6 deletions(-) diff --git a/ndb/include/logger/LogHandler.hpp b/ndb/include/logger/LogHandler.hpp index ca4bd4c0668..57169e7ae6a 100644 --- a/ndb/include/logger/LogHandler.hpp +++ b/ndb/include/logger/LogHandler.hpp @@ -192,6 +192,16 @@ private: const char* m_pDateTimeFormat; int m_errorCode; + + // for handling repeated messages + unsigned m_count_repeated_messages; + unsigned m_max_repeat_frequency; + time_t m_last_log_time; + char m_last_category_buf[16]; + char m_last_message_buf[256]; + char *m_last_category; + Logger::LoggerLevel m_last_level; + char *m_last_message; }; #endif diff --git a/ndb/src/common/logger/LogHandler.cpp b/ndb/src/common/logger/LogHandler.cpp index a76cb622878..5cc8de21f67 100644 --- a/ndb/src/common/logger/LogHandler.cpp +++ b/ndb/src/common/logger/LogHandler.cpp @@ -23,22 +23,71 @@ // LogHandler::LogHandler() : m_pDateTimeFormat("%d-%.2d-%.2d %.2d:%.2d:%.2d"), - m_errorCode(0) -{ + m_errorCode(0), + m_last_category(m_last_category_buf), + m_last_message(m_last_message_buf) +{ + m_max_repeat_frequency= 3; // repeat messages maximum every 3 seconds + m_last_category_buf[0]= 0; + m_last_message_buf[0]= 0; } LogHandler::~LogHandler() { + if (m_last_message != m_last_message_buf) + free(m_last_message); + if (m_last_category != m_last_category_buf) + free(m_last_category); } void LogHandler::append(const char* pCategory, Logger::LoggerLevel level, const char* pMsg) -{ +{ + time_t now; + now= ::time((time_t*)NULL); + + if (level != m_last_level || + strcmp(pCategory, m_last_category) || + strcmp(pMsg, m_last_message)) + { + if (m_last_message != m_last_message_buf) + free(m_last_message); + if (m_last_category != m_last_category_buf) + free(m_last_category); + + m_count_repeated_messages= 0; + + m_last_level= level; + BaseString::snprintf(m_last_category_buf, sizeof(m_last_category_buf), "%s", pCategory); + BaseString::snprintf(m_last_message_buf, sizeof(m_last_message_buf), "%s", pMsg); + // ToDo: handle too long messages correctly + // right now all that will happen is that too long messages + // will be repeated unneccesarily + } + else // repeated message + { + if (now < m_last_log_time+m_max_repeat_frequency) + { + m_count_repeated_messages++; + return; + } + } + writeHeader(pCategory, level); - writeMessage(pMsg); + if (m_count_repeated_messages == 0) + writeMessage(pMsg); + else + { + BaseString str(pMsg); + str.appfmt(" - repeated %d times", m_count_repeated_messages); + writeMessage(str.c_str()); + m_count_repeated_messages= 0; + } writeFooter(); -} + + m_last_log_time= now; +} const char* LogHandler::getDefaultHeader(char* pStr, const char* pCategory, diff --git a/ndb/src/common/transporter/Transporter.hpp b/ndb/src/common/transporter/Transporter.hpp index 10303ec71ea..baff6d53dd8 100644 --- a/ndb/src/common/transporter/Transporter.hpp +++ b/ndb/src/common/transporter/Transporter.hpp @@ -151,7 +151,7 @@ Transporter::getRemoteNodeId() const { inline NodeId Transporter::getLocalNodeId() const { - return remoteNodeId; + return localNodeId; } inline From 74cc635a7cae3f2548ccbbdb2c6775758e554caa Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 22 Dec 2004 21:31:17 +0200 Subject: [PATCH 0579/1063] A fix for the bug #7495 mysql-test/r/func_str.result: A result for test case for the bug #7495 involving either LTRIM() or TRIM() within QUOTE() function. mysql-test/t/func_str.test: A test case for the bug #7495 involving either LTRIM() or TRIM() within QUOTE() function. sql/item_strfunc.cc: Changes for LTRIM() and TRIM() functions that aleviate the bug entirely. --- mysql-test/r/func_str.result | 12 ++++++++++++ mysql-test/t/func_str.test | 12 ++++++++++++ sql/item_strfunc.cc | 4 ++-- 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result index d38a2edfa1a..2ca90653fec 100644 --- a/mysql-test/r/func_str.result +++ b/mysql-test/r/func_str.result @@ -291,3 +291,15 @@ trim(trailing 'foo' from 'foo') select trim(leading 'foo' from 'foo'); trim(leading 'foo' from 'foo') +create table t1 (a varchar(80), b varchar(80)); +insert into t1 values(NULL,"12345"); +insert into t1 values(NULL,"chm"); +select quote(ltrim(concat(' ',t1.b))) from t1; +quote(ltrim(concat(' ',t1.b))) +'12345' +'chm' +select quote(trim(concat(' ',t1.b))) from t1; +quote(trim(concat(' ',t1.b))) +'12345' +'chm' +drop table t1; diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test index 1ae4db3a42a..421512c4dc4 100644 --- a/mysql-test/t/func_str.test +++ b/mysql-test/t/func_str.test @@ -185,3 +185,15 @@ drop table t1; select trim(trailing 'foo' from 'foo'); select trim(leading 'foo' from 'foo'); + +# +# crashing bug with QUOTE() and LTRIM() or TRIM() fixed +# Bug #7495 +# + +create table t1 (a varchar(80), b varchar(80)); +insert into t1 values(NULL,"12345"); +insert into t1 values(NULL,"chm"); +select quote(ltrim(concat(' ',t1.b))) from t1; +select quote(trim(concat(' ',t1.b))) from t1; +drop table t1; diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 53a9d3fe219..61477753594 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -1141,7 +1141,7 @@ String *Item_func_ltrim::val_str(String *str) } if (ptr == res->ptr()) return res; - tmp_value.set(*res,(uint) (ptr - res->ptr()),(uint) (end-ptr)); + tmp_value.copy(res->ptr() + (ptr - res->ptr()), (uint32) (end - ptr)); return &tmp_value; } @@ -1266,7 +1266,7 @@ String *Item_func_trim::val_str(String *str) } if (ptr == res->ptr() && end == ptr+res->length()) return res; - tmp_value.set(*res,(uint) (ptr - res->ptr()),(uint) (end-ptr)); + tmp_value.copy(res->ptr() + (ptr - res->ptr()), (uint32) (end - ptr)); return &tmp_value; } From 7b0857a7d050a58c53c6b8ad6b2848959e9d5ce6 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 22 Dec 2004 22:47:56 +0100 Subject: [PATCH 0580/1063] fixed so that last repeats are printed first with correct time if another message comes decided for fixed size buffers in LogHandler repeated messages mysql-test/ndb/basic.result: updated ndb test ndb/include/logger/LogHandler.hpp: decided for fixed size buffers ndb/include/logger/Logger.hpp: decided for fixed size buffers ndb/src/common/logger/LogHandler.cpp: decided for fixed size buffers ndb/src/common/logger/Logger.cpp: decided for fixed size buffers --- mysql-test/ndb/basic.result | 8 ++--- ndb/include/logger/LogHandler.hpp | 29 ++++++++-------- ndb/include/logger/Logger.hpp | 2 ++ ndb/src/common/logger/LogHandler.cpp | 51 +++++++++++++--------------- ndb/src/common/logger/Logger.cpp | 4 +-- 5 files changed, 47 insertions(+), 47 deletions(-) diff --git a/mysql-test/ndb/basic.result b/mysql-test/ndb/basic.result index 7049c02f304..5ebd20a7f83 100644 --- a/mysql-test/ndb/basic.result +++ b/mysql-test/ndb/basic.result @@ -31,12 +31,12 @@ QUIT Quit management client = ALL | Any database node id Connected to Management Server at: localhost:1186 -Node 1: started (Version 4.1.8) -Node 2: started (Version 4.1.8) +Node 1: started (Version 4.1.9) +Node 2: started (Version 4.1.9) -Node 1: started (Version 4.1.8) +Node 1: started (Version 4.1.9) -Node 2: started (Version 4.1.8) +Node 2: started (Version 4.1.9) Executing CLUSTERLOG on node 1 OK! Executing CLUSTERLOG on node 2 OK! diff --git a/ndb/include/logger/LogHandler.hpp b/ndb/include/logger/LogHandler.hpp index 57169e7ae6a..7df6ad864e5 100644 --- a/ndb/include/logger/LogHandler.hpp +++ b/ndb/include/logger/LogHandler.hpp @@ -19,7 +19,6 @@ #include "Logger.hpp" - /** * This class is the base class for all log handlers. A log handler is * responsible for formatting and writing log messages to a specific output. @@ -68,7 +67,8 @@ public: /** * Append a log message to the output stream/file whatever. * append() will call writeHeader(), writeMessage() and writeFooter() for - * a child class and in that order. + * a child class and in that order. Append checks for repeated messages. + * append_impl() does not check for repeats. * * @param pCategory the category/name to tag the log entry with. * @param level the log level. @@ -76,6 +76,8 @@ public: */ void append(const char* pCategory, Logger::LoggerLevel level, const char* pMsg); + void append_impl(const char* pCategory, Logger::LoggerLevel level, + const char* pMsg); /** * Returns a default formatted header. It currently has the @@ -111,14 +113,6 @@ public: */ void setDateTimeFormat(const char* pFormat); - /** - * Returns a string date and time string. - * - * @param pStr a string. - * @return a string with date and time. - */ - char* getTimeAsString(char* pStr) const; - /** * Returns the error code. */ @@ -185,6 +179,15 @@ protected: virtual void writeFooter() = 0; private: + /** + * Returns a string date and time string. + * @note does not update time, uses m_now as time + * @param pStr a string. + * @return a string with date and time. + */ + char* getTimeAsString(char* pStr) const; + time_t m_now; + /** Prohibit */ LogHandler(const LogHandler&); LogHandler* operator = (const LogHandler&); @@ -197,11 +200,9 @@ private: unsigned m_count_repeated_messages; unsigned m_max_repeat_frequency; time_t m_last_log_time; - char m_last_category_buf[16]; - char m_last_message_buf[256]; - char *m_last_category; + char m_last_category[MAX_HEADER_LENGTH]; + char m_last_message[MAX_LOG_MESSAGE_SIZE]; Logger::LoggerLevel m_last_level; - char *m_last_message; }; #endif diff --git a/ndb/include/logger/Logger.hpp b/ndb/include/logger/Logger.hpp index f12297023b7..ee762098fb6 100644 --- a/ndb/include/logger/Logger.hpp +++ b/ndb/include/logger/Logger.hpp @@ -20,6 +20,8 @@ #include #include +#define MAX_LOG_MESSAGE_SIZE 1024 + class LogHandler; class LogHandlerList; diff --git a/ndb/src/common/logger/LogHandler.cpp b/ndb/src/common/logger/LogHandler.cpp index 5cc8de21f67..e038b05401e 100644 --- a/ndb/src/common/logger/LogHandler.cpp +++ b/ndb/src/common/logger/LogHandler.cpp @@ -23,21 +23,18 @@ // LogHandler::LogHandler() : m_pDateTimeFormat("%d-%.2d-%.2d %.2d:%.2d:%.2d"), - m_errorCode(0), - m_last_category(m_last_category_buf), - m_last_message(m_last_message_buf) + m_errorCode(0) { m_max_repeat_frequency= 3; // repeat messages maximum every 3 seconds - m_last_category_buf[0]= 0; - m_last_message_buf[0]= 0; + m_count_repeated_messages= 0; + m_last_category[0]= 0; + m_last_message[0]= 0; + m_last_log_time= 0; + m_now= 0; } LogHandler::~LogHandler() { - if (m_last_message != m_last_message_buf) - free(m_last_message); - if (m_last_category != m_last_category_buf) - free(m_last_category); } void @@ -51,42 +48,44 @@ LogHandler::append(const char* pCategory, Logger::LoggerLevel level, strcmp(pCategory, m_last_category) || strcmp(pMsg, m_last_message)) { - if (m_last_message != m_last_message_buf) - free(m_last_message); - if (m_last_category != m_last_category_buf) - free(m_last_category); - - m_count_repeated_messages= 0; + if (m_count_repeated_messages > 0) // print that message + append_impl(m_last_category, m_last_level, m_last_message); m_last_level= level; - BaseString::snprintf(m_last_category_buf, sizeof(m_last_category_buf), "%s", pCategory); - BaseString::snprintf(m_last_message_buf, sizeof(m_last_message_buf), "%s", pMsg); - // ToDo: handle too long messages correctly - // right now all that will happen is that too long messages - // will be repeated unneccesarily + strncpy(m_last_category, pCategory, sizeof(m_last_category)); + strncpy(m_last_message, pMsg, sizeof(m_last_message)); } else // repeated message { if (now < m_last_log_time+m_max_repeat_frequency) { m_count_repeated_messages++; + m_now= now; return; } } + m_now= now; + + append_impl(pCategory, level, pMsg); + m_last_log_time= now; +} + +void +LogHandler::append_impl(const char* pCategory, Logger::LoggerLevel level, + const char* pMsg) +{ writeHeader(pCategory, level); if (m_count_repeated_messages == 0) writeMessage(pMsg); else { BaseString str(pMsg); - str.appfmt(" - repeated %d times", m_count_repeated_messages); + str.appfmt(" - Repeated %d times", m_count_repeated_messages); writeMessage(str.c_str()); m_count_repeated_messages= 0; } writeFooter(); - - m_last_log_time= now; } const char* @@ -125,12 +124,10 @@ char* LogHandler::getTimeAsString(char* pStr) const { struct tm* tm_now; - time_t now; - now = ::time((time_t*)NULL); #ifdef NDB_WIN32 - tm_now = localtime(&now); + tm_now = localtime(&m_now); #else - tm_now = ::localtime(&now); //uses the "current" timezone + tm_now = ::localtime(&m_now); //uses the "current" timezone #endif BaseString::snprintf(pStr, MAX_DATE_TIME_HEADER_LENGTH, diff --git a/ndb/src/common/logger/Logger.cpp b/ndb/src/common/logger/Logger.cpp index 4fa7b462563..7f18f5bd3ec 100644 --- a/ndb/src/common/logger/Logger.cpp +++ b/ndb/src/common/logger/Logger.cpp @@ -355,11 +355,11 @@ Logger::log(LoggerLevel logLevel, const char* pMsg, va_list ap) const LogHandler* pHandler = NULL; while ( (pHandler = m_pHandlerList->next()) != NULL) { - char buf[1024]; + char buf[MAX_LOG_MESSAGE_SIZE]; BaseString::vsnprintf(buf, sizeof(buf), pMsg, ap); pHandler->append(m_pCategory, logLevel, buf); } - } + } } // From baac3b76acb9d11061d65a9e462a6c405985f711 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 22 Dec 2004 22:59:19 +0100 Subject: [PATCH 0581/1063] BitKeeper/triggers/pre-delta don't checkin for Administrator or mysqldev sql/log.cc@1.157 restored a bugfix that was lost in a merge sql/log.cc: restored a bugfix that was lost in a merge BitKeeper/triggers/pre-delta: don't commit for Administrator or mysqldev --- BitKeeper/triggers/pre-delta | 11 +++++++++++ sql/log.cc | 4 +++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/BitKeeper/triggers/pre-delta b/BitKeeper/triggers/pre-delta index e22ae9ce940..cd861703bb5 100755 --- a/BitKeeper/triggers/pre-delta +++ b/BitKeeper/triggers/pre-delta @@ -1,5 +1,16 @@ #!/bin/sh +if [ "$BK_USER" = "Administrator" -o "$BK_USER" = "mysqldev" ] +then + echo "Error: you cannot checkin as 'Administrator' or 'mysqldev' user." + echo "as a workaround set BK_USER to your nickname" + echo "e.g.: export BK_USER='bar'" + echo "" + echo "Checkin FAILED!" + echo "Set BK_USER and retry." + exit 1 +fi + if [ `tail -c1 $BK_FILE` ] then echo "File $BK_FILE does not end with a new-line character!" diff --git a/sql/log.cc b/sql/log.cc index 3a420866025..ab0cb823f15 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -2036,6 +2036,7 @@ bool flush_error_log() char err_renamed[FN_REFLEN], *end; end= strmake(err_renamed,log_error_file,FN_REFLEN-4); strmov(end, "-old"); + VOID(pthread_mutex_lock(&LOCK_error_log)); #ifdef __WIN__ char err_temp[FN_REFLEN+4]; /* @@ -2056,7 +2057,7 @@ bool flush_error_log() if ((fd = my_open(err_temp, O_RDONLY, MYF(0))) >= 0) { while ((bytes = (int) my_read(fd, (byte*) buf, IO_SIZE, MYF(0))) > 0) - my_fwrite(stderr, (byte*) buf, (uint) strlen(buf),MYF(0)); + my_fwrite(stderr, (byte*) buf, bytes, MYF(0)); my_close(fd, MYF(0)); } (void) my_delete(err_temp, MYF(0)); @@ -2070,6 +2071,7 @@ bool flush_error_log() else result= 1; #endif + VOID(pthread_mutex_unlock(&LOCK_error_log)); } return result; } From 7199d9f4d32e2a9fbe87a06e7116e199a13f185c Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 23 Dec 2004 13:52:25 +0400 Subject: [PATCH 0582/1063] Take charsets from the source directory rather than from the install directory. --- mysql-test/mysql-test-run.sh | 3 ++- mysql-test/t/mysqldump.test | 10 +++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index 93b1360846a..4c141e75baa 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -596,7 +596,8 @@ MYSQL_DUMP="$MYSQL_DUMP --no-defaults -uroot --socket=$MASTER_MYSOCK --password= MYSQL_BINLOG="$MYSQL_BINLOG --no-defaults --local-load=$MYSQL_TMP_DIR $EXTRA_MYSQLBINLOG_OPT" MYSQL_FIX_SYSTEM_TABLES="$MYSQL_FIX_SYSTEM_TABLES --no-defaults --host=localhost --port=$MASTER_MYPORT --socket=$MASTER_MYSOCK --user=root --password=$DBPASSWD --basedir=$BASEDIR --bindir=$CLIENT_BINDIR --verbose" MYSQL="$MYSQL --host=localhost --port=$MASTER_MYPORT --socket=$MASTER_MYSOCK --user=root --password=$DBPASSWD" -export MYSQL MYSQL_DUMP MYSQL_BINLOG MYSQL_FIX_SYSTEM_TABLES CLIENT_BINDIR TESTS_BINDIR +export MYSQL MYSQL_DUMP MYSQL_BINLOG MYSQL_FIX_SYSTEM_TABLES +export CLIENT_BINDIR TESTS_BINDIR CHARSETSDIR export NDB_TOOLS_DIR MYSQL_TEST_ARGS="--no-defaults --socket=$MASTER_MYSOCK --database=$DB \ diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test index 7a6c1564e94..07b33689196 100644 --- a/mysql-test/t/mysqldump.test +++ b/mysql-test/t/mysqldump.test @@ -147,9 +147,9 @@ drop database mysqldump_test_db; CREATE TABLE t1 (a CHAR(10)); INSERT INTO t1 VALUES (_latin1 'ÄÖÜß'); ---exec $MYSQL_DUMP --skip-comments test t1 ---exec $MYSQL_DUMP --skip-comments --compatible=mysql323 test t1 ---exec $MYSQL_DUMP --skip-comments --compatible=mysql323 --default-character-set=cp850 test t1 ---exec $MYSQL_DUMP --skip-comments --default-character-set=cp850 --compatible=mysql323 test t1 ---exec $MYSQL_DUMP --skip-comments --default-character-set=utf8 --compatible=mysql323 test t1 +--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments test t1 +--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments --compatible=mysql323 test t1 +--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments --compatible=mysql323 --default-character-set=cp850 test t1 +--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments --default-character-set=cp850 --compatible=mysql323 test t1 +--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments --default-character-set=utf8 --compatible=mysql323 test t1 DROP TABLE t1; From 20c0434589a8353eafa81f01dc89464beee65960 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 23 Dec 2004 16:04:40 +0500 Subject: [PATCH 0583/1063] fix indentation add space after comma add space after equal add comments in vio_close_shared_memory() include/violite.h: fix indentation sql-common/client.c: fix identation sql/mysqld.cc: add space after comma vio/vio.c: add space after equal fix identation vio/viosocket.c: add space after comma add comments in vio_close_shared_memory() --- include/violite.h | 22 +++++++++++----------- sql-common/client.c | 4 ++-- sql/mysqld.cc | 45 ++++++++++++++++++++++++++------------------- vio/vio.c | 22 +++++++++++----------- vio/viosocket.c | 19 ++++++++++++++----- 5 files changed, 64 insertions(+), 48 deletions(-) diff --git a/include/violite.h b/include/violite.h index 64e834d6653..855d8a3d490 100644 --- a/include/violite.h +++ b/include/violite.h @@ -39,17 +39,17 @@ enum enum_vio_type Vio* vio_new(my_socket sd, enum enum_vio_type type, my_bool localhost); #ifdef __WIN__ -Vio* vio_new_win32pipe(HANDLE hPipe); -Vio* vio_new_win32shared_memory(NET *net,HANDLE handle_file_map, - HANDLE handle_map, - HANDLE event_server_wrote, - HANDLE event_server_read, - HANDLE event_client_wrote, - HANDLE event_client_read, - HANDLE event_conn_closed); -int vio_read_pipe(Vio *vio, gptr buf, int size); -int vio_write_pipe(Vio *vio, const gptr buf, int size); -int vio_close_pipe(Vio * vio); +Vio* vio_new_win32pipe(HANDLE hPipe); +Vio* vio_new_win32shared_memory(NET *net,HANDLE handle_file_map, + HANDLE handle_map, + HANDLE event_server_wrote, + HANDLE event_server_read, + HANDLE event_client_wrote, + HANDLE event_client_read, + HANDLE event_conn_closed); +int vio_read_pipe(Vio *vio, gptr buf, int size); +int vio_write_pipe(Vio *vio, const gptr buf, int size); +int vio_close_pipe(Vio * vio); #else #define HANDLE void * #endif /* __WIN__ */ diff --git a/sql-common/client.c b/sql-common/client.c index 0714ca4291f..87a781e0a0d 100644 --- a/sql-common/client.c +++ b/sql-common/client.c @@ -525,9 +525,9 @@ err2: if (error_allow == 0) { net->vio= vio_new_win32shared_memory(net,handle_file_map,handle_map, - event_server_wrote, + event_server_wrote, event_server_read,event_client_wrote, - event_client_read,event_conn_closed); + event_client_read,event_conn_closed); } else { diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 2bf9e898920..bebecb394e9 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -3853,31 +3853,31 @@ pthread_handler_decl(handle_connections_shared_memory,arg) goto errorconn; } strmov(suffix_pos, "CLIENT_WROTE"); - if ((event_client_wrote= CreateEvent(0,FALSE,FALSE,tmp)) == 0) + if ((event_client_wrote= CreateEvent(0, FALSE, FALSE, tmp)) == 0) { errmsg= "Could not create client write event"; goto errorconn; } strmov(suffix_pos, "CLIENT_READ"); - if ((event_client_read= CreateEvent(0,FALSE,FALSE,tmp)) == 0) + if ((event_client_read= CreateEvent(0, FALSE, FALSE, tmp)) == 0) { errmsg= "Could not create client read event"; goto errorconn; } strmov(suffix_pos, "SERVER_READ"); - if ((event_server_read= CreateEvent(0,FALSE,FALSE,tmp)) == 0) + if ((event_server_read= CreateEvent(0, FALSE, FALSE, tmp)) == 0) { errmsg= "Could not create server read event"; goto errorconn; } strmov(suffix_pos, "SERVER_WROTE"); - if ((event_server_wrote= CreateEvent(0,FALSE,FALSE,tmp)) == 0) + if ((event_server_wrote= CreateEvent(0, FALSE, FALSE, tmp)) == 0) { errmsg= "Could not create server write event"; goto errorconn; } strmov(suffix_pos, "CONNECTION_CLOSED"); - if ((event_conn_closed= CreateEvent(0,TRUE,FALSE,tmp)) == 0) + if ((event_conn_closed= CreateEvent(0, TRUE , FALSE, tmp)) == 0) { errmsg= "Could not create closed connection event"; goto errorconn; @@ -3900,14 +3900,14 @@ pthread_handler_decl(handle_connections_shared_memory,arg) goto errorconn; } if (!(thd->net.vio= vio_new_win32shared_memory(&thd->net, - handle_client_file_map, - handle_client_map, - event_client_wrote, - event_client_read, - event_server_wrote, - event_server_read, + handle_client_file_map, + handle_client_map, + event_client_wrote, + event_client_read, + event_server_wrote, + event_server_read, event_conn_closed)) || - my_net_init(&thd->net, thd->net.vio)) + my_net_init(&thd->net, thd->net.vio)) { close_connection(thd, ER_OUT_OF_RESOURCES, 1); errmsg= 0; @@ -3927,13 +3927,20 @@ errorconn: NullS); sql_perror(buff); } - if (handle_client_file_map) CloseHandle(handle_client_file_map); - if (handle_client_map) UnmapViewOfFile(handle_client_map); - if (event_server_wrote) CloseHandle(event_server_wrote); - if (event_server_read) CloseHandle(event_server_read); - if (event_client_wrote) CloseHandle(event_client_wrote); - if (event_client_read) CloseHandle(event_client_read); - if (event_conn_closed) CloseHandle(event_conn_closed); + if (handle_client_file_map) + CloseHandle(handle_client_file_map); + if (handle_client_map) + UnmapViewOfFile(handle_client_map); + if (event_server_wrote) + CloseHandle(event_server_wrote); + if (event_server_read) + CloseHandle(event_server_read); + if (event_client_wrote) + CloseHandle(event_client_wrote); + if (event_client_read) + CloseHandle(event_client_read); + if (event_conn_closed) + CloseHandle(event_conn_closed); delete thd; } diff --git a/vio/vio.c b/vio/vio.c index 92d69dc5148..978780d2632 100644 --- a/vio/vio.c +++ b/vio/vio.c @@ -172,23 +172,23 @@ Vio *vio_new_win32pipe(HANDLE hPipe) Vio *vio_new_win32shared_memory(NET *net,HANDLE handle_file_map, HANDLE handle_map, HANDLE event_server_wrote, HANDLE event_server_read, HANDLE event_client_wrote, HANDLE event_client_read, - HANDLE event_conn_closed) + HANDLE event_conn_closed) { Vio *vio; DBUG_ENTER("vio_new_win32shared_memory"); if ((vio = (Vio*) my_malloc(sizeof(Vio),MYF(MY_WME)))) { vio_reset(vio, VIO_TYPE_SHARED_MEMORY, 0, 0, TRUE); - vio->handle_file_map = handle_file_map; - vio->handle_map = handle_map; - vio->event_server_wrote = event_server_wrote; - vio->event_server_read = event_server_read; - vio->event_client_wrote = event_client_wrote; - vio->event_client_read = event_client_read; - vio->event_conn_closed = event_conn_closed; - vio->shared_memory_remain = 0; - vio->shared_memory_pos = handle_map; - vio->net = net; + vio->handle_file_map= handle_file_map; + vio->handle_map= handle_map; + vio->event_server_wrote= event_server_wrote; + vio->event_server_read= event_server_read; + vio->event_client_wrote= event_client_wrote; + vio->event_client_read= event_client_read; + vio->event_conn_closed= event_conn_closed; + vio->shared_memory_remain= 0; + vio->shared_memory_pos= handle_map; + vio->net= net; strmov(vio->desc, "shared memory"); } DBUG_RETURN(vio); diff --git a/vio/viosocket.c b/vio/viosocket.c index caf9451df7a..bcba05beef1 100644 --- a/vio/viosocket.c +++ b/vio/viosocket.c @@ -390,7 +390,7 @@ int vio_read_shared_memory(Vio * vio, gptr buf, int size) WAIT_OBJECT_0+1 - event from vio->event_conn_closed. We can't read anything WAIT_ABANDONED_0 and WAIT_TIMEOUT - fail. We can't read anything */ - if (WaitForMultipleObjects(2,(HANDLE*)&events,FALSE, + if (WaitForMultipleObjects(2, (HANDLE*)&events,FALSE, vio->net->read_timeout*1000) != WAIT_OBJECT_0) { DBUG_RETURN(-1); @@ -440,7 +440,8 @@ int vio_write_shared_memory(Vio * vio, const gptr buf, int size) current_postion = buf; while (remain != 0) { - if (WaitForSingleObject(vio->event_server_read,vio->net->write_timeout*1000) != WAIT_OBJECT_0) + if (WaitForSingleObject(vio->event_server_read, vio->net->write_timeout*1000) + != WAIT_OBJECT_0) { DBUG_RETURN(-1); }; @@ -467,10 +468,18 @@ int vio_close_shared_memory(Vio * vio) DBUG_ENTER("vio_close_shared_memory"); if (vio->type != VIO_CLOSED) { + /* + Set event_conn_closed for notification of both client and server that + connection is closed + */ SetEvent(vio->event_conn_closed); - r=UnmapViewOfFile(vio->handle_map) || CloseHandle(vio->event_server_wrote) || - CloseHandle(vio->event_server_read) || CloseHandle(vio->event_client_wrote) || - CloseHandle(vio->event_client_read) || CloseHandle(vio->handle_file_map); + /* + Close all handlers. UnmapViewOfFile and CloseHandle return non-zero + result if they are success. + */ + r= UnmapViewOfFile(vio->handle_map) || CloseHandle(vio->event_server_wrote) || + CloseHandle(vio->event_server_read) || CloseHandle(vio->event_client_wrote) || + CloseHandle(vio->event_client_read) || CloseHandle(vio->handle_file_map); if (!r) { DBUG_PRINT("vio_error", ("close() failed, error: %d",r)); From 665f6b6875ddc0ad50e4d09001db617bfab62bd4 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 23 Dec 2004 17:32:29 +0100 Subject: [PATCH 0584/1063] incorrect result fixed --- mysql-test/r/func_concat.result | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/func_concat.result b/mysql-test/r/func_concat.result index 419413e4156..0bd53b32dd7 100644 --- a/mysql-test/r/func_concat.result +++ b/mysql-test/r/func_concat.result @@ -63,8 +63,8 @@ a0 select 'a' union select concat('a', -0.0); a a -a-0.0 +a0.0 select 'a' union select concat('a', -0.0000); a a -a-0.0000 +a0.0000 From 4a5ca0bc638b2e09bca1fc0b9b8bee02590c6e08 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 23 Dec 2004 21:59:36 +0300 Subject: [PATCH 0585/1063] Make GRANTs, which change SSL attributes and/or user limits, to behave well on 5.0 tables (well now you can't use tables from 4.1 and 5.0 with 4.0 because former use utf8, but still it is nice to have similar code in acl_init() and replace_user_table()). This also will make such GRANTs working in 5.0 (they are broken now). mysql-test/r/grant.result: Added test for GRANT which manipulates user limits. mysql-test/t/grant.test: Added test for GRANT which manipulates user limits. --- mysql-test/r/grant.result | 22 +++++++++++++++ mysql-test/t/grant.test | 17 ++++++++++++ sql/sql_acl.cc | 56 +++++++++++++++++++++------------------ 3 files changed, 69 insertions(+), 26 deletions(-) diff --git a/mysql-test/r/grant.result b/mysql-test/r/grant.result index 2a433e3d5db..19d83a95c5e 100644 --- a/mysql-test/r/grant.result +++ b/mysql-test/r/grant.result @@ -36,6 +36,28 @@ Grants for mysqltest_1@localhost GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' REQUIRE ISSUER 'MySQL AB' SUBJECT 'testsubject' CIPHER 'EDH-RSA-DES-CBC3-SHA' delete from mysql.user where user='mysqltest_1'; flush privileges; +delete from mysql.user where user='mysqltest_1'; +flush privileges; +grant usage on *.* to mysqltest_1@localhost with max_queries_per_hour 10; +select * from mysql.user where user="mysqltest_1"; +Host User Password Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Reload_priv Shutdown_priv Process_priv File_priv Grant_priv References_priv Index_priv Alter_priv Show_db_priv Super_priv Create_tmp_table_priv Lock_tables_priv Execute_priv Repl_slave_priv Repl_client_priv ssl_type ssl_cipher x509_issuer x509_subject max_questions max_updates max_connections +localhost mysqltest_1 N N N N N N N N N N N N N N N N N N N N N 10 0 0 +show grants for mysqltest_1@localhost; +Grants for mysqltest_1@localhost +GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' WITH MAX_QUERIES_PER_HOUR 10 +grant usage on *.* to mysqltest_1@localhost with max_updates_per_hour 20 max_connections_per_hour 30; +select * from mysql.user where user="mysqltest_1"; +Host User Password Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Reload_priv Shutdown_priv Process_priv File_priv Grant_priv References_priv Index_priv Alter_priv Show_db_priv Super_priv Create_tmp_table_priv Lock_tables_priv Execute_priv Repl_slave_priv Repl_client_priv ssl_type ssl_cipher x509_issuer x509_subject max_questions max_updates max_connections +localhost mysqltest_1 N N N N N N N N N N N N N N N N N N N N N 10 20 30 +show grants for mysqltest_1@localhost; +Grants for mysqltest_1@localhost +GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' WITH MAX_QUERIES_PER_HOUR 10 MAX_UPDATES_PER_HOUR 20 MAX_CONNECTIONS_PER_HOUR 30 +flush privileges; +show grants for mysqltest_1@localhost; +Grants for mysqltest_1@localhost +GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' WITH MAX_QUERIES_PER_HOUR 10 MAX_UPDATES_PER_HOUR 20 MAX_CONNECTIONS_PER_HOUR 30 +delete from mysql.user where user='mysqltest_1'; +flush privileges; grant CREATE TEMPORARY TABLES, LOCK TABLES on mysqltest.* to mysqltest_1@localhost; show grants for mysqltest_1@localhost; Grants for mysqltest_1@localhost diff --git a/mysql-test/t/grant.test b/mysql-test/t/grant.test index d9b4be04de3..960c55065fe 100644 --- a/mysql-test/t/grant.test +++ b/mysql-test/t/grant.test @@ -27,6 +27,23 @@ show grants for mysqltest_1@localhost; delete from mysql.user where user='mysqltest_1'; flush privileges; +# +# Test of GRANTS specifying user limits +# +delete from mysql.user where user='mysqltest_1'; +flush privileges; +grant usage on *.* to mysqltest_1@localhost with max_queries_per_hour 10; +select * from mysql.user where user="mysqltest_1"; +show grants for mysqltest_1@localhost; +grant usage on *.* to mysqltest_1@localhost with max_updates_per_hour 20 max_connections_per_hour 30; +select * from mysql.user where user="mysqltest_1"; +show grants for mysqltest_1@localhost; +# This is just to double check that one won't ignore results of selects +flush privileges; +show grants for mysqltest_1@localhost; +delete from mysql.user where user='mysqltest_1'; +flush privileges; + # # Test that the new db privileges are stored/retrieved correctly # diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 67ca62357ec..1b55168695b 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -1403,6 +1403,7 @@ static int replace_user_table(THD *thd, TABLE *table, const LEX_USER &combo, Field **tmp_field; ulong priv; + uint next_field; for (tmp_field= table->field+3, priv = SELECT_ACL; *tmp_field && (*tmp_field)->real_type() == FIELD_TYPE_ENUM && ((Field_enum*) (*tmp_field))->typelib->count == 2 ; @@ -1411,56 +1412,59 @@ static int replace_user_table(THD *thd, TABLE *table, const LEX_USER &combo, if (priv & rights) // set requested privileges (*tmp_field)->store(&what,1); } - rights=get_access(table,3,0); + rights= get_access(table, 3, &next_field); DBUG_PRINT("info",("table->fields: %d",table->fields)); if (table->fields >= 31) /* From 4.0.0 we have more fields */ { /* We write down SSL related ACL stuff */ switch (thd->lex.ssl_type) { case SSL_TYPE_ANY: - table->field[24]->store("ANY",3); - table->field[25]->store("",0); - table->field[26]->store("",0); - table->field[27]->store("",0); + table->field[next_field]->store("ANY", 3); + table->field[next_field+1]->store("", 0); + table->field[next_field+2]->store("", 0); + table->field[next_field+3]->store("", 0); break; case SSL_TYPE_X509: - table->field[24]->store("X509",4); - table->field[25]->store("",0); - table->field[26]->store("",0); - table->field[27]->store("",0); + table->field[next_field]->store("X509", 4); + table->field[next_field+1]->store("", 0); + table->field[next_field+2]->store("", 0); + table->field[next_field+3]->store("", 0); break; case SSL_TYPE_SPECIFIED: - table->field[24]->store("SPECIFIED",9); - table->field[25]->store("",0); - table->field[26]->store("",0); - table->field[27]->store("",0); + table->field[next_field]->store("SPECIFIED", 9); + table->field[next_field+1]->store("", 0); + table->field[next_field+2]->store("", 0); + table->field[next_field+3]->store("", 0); if (thd->lex.ssl_cipher) - table->field[25]->store(thd->lex.ssl_cipher, - strlen(thd->lex.ssl_cipher)); + table->field[next_field+1]->store(thd->lex.ssl_cipher, + strlen(thd->lex.ssl_cipher)); if (thd->lex.x509_issuer) - table->field[26]->store(thd->lex.x509_issuer, - strlen(thd->lex.x509_issuer)); + table->field[next_field+2]->store(thd->lex.x509_issuer, + strlen(thd->lex.x509_issuer)); if (thd->lex.x509_subject) - table->field[27]->store(thd->lex.x509_subject, - strlen(thd->lex.x509_subject)); + table->field[next_field+3]->store(thd->lex.x509_subject, + strlen(thd->lex.x509_subject)); break; case SSL_TYPE_NOT_SPECIFIED: break; case SSL_TYPE_NONE: - table->field[24]->store("",0); - table->field[25]->store("",0); - table->field[26]->store("",0); - table->field[27]->store("",0); + table->field[next_field]->store("", 0); + table->field[next_field+1]->store("", 0); + table->field[next_field+2]->store("", 0); + table->field[next_field+3]->store("", 0); break; } + /* Skip over SSL related fields to first user limits related field */ + next_field+= 4; + USER_RESOURCES mqh = thd->lex.mqh; if (mqh.bits & 1) - table->field[28]->store((longlong) mqh.questions); + table->field[next_field]->store((longlong) mqh.questions); if (mqh.bits & 2) - table->field[29]->store((longlong) mqh.updates); + table->field[next_field+1]->store((longlong) mqh.updates); if (mqh.bits & 4) - table->field[30]->store((longlong) mqh.connections); + table->field[next_field+2]->store((longlong) mqh.connections); mqh_used = mqh_used || mqh.questions || mqh.updates || mqh.connections; } if (old_row_exists) From 8ccfad7636811347b57d9e14e20a3b52b8941664 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 23 Dec 2004 21:08:54 +0200 Subject: [PATCH 0586/1063] Fix for a bug #7495 mysql-test/r/func_str.result: result for test case for a bug in QUOTE() (Bug #7495) mysql-test/t/func_str.test: test case for a bug in QUOTE() (Bug #7495) sql/item_strfunc.cc: a better fix for a QUOTE() bug (Bug #7495) --- mysql-test/r/func_str.result | 18 ++++++------------ mysql-test/t/func_str.test | 8 ++------ sql/item_strfunc.cc | 14 +++++++------- 3 files changed, 15 insertions(+), 25 deletions(-) diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result index 2ca90653fec..278cd4dd935 100644 --- a/mysql-test/r/func_str.result +++ b/mysql-test/r/func_str.result @@ -291,15 +291,9 @@ trim(trailing 'foo' from 'foo') select trim(leading 'foo' from 'foo'); trim(leading 'foo' from 'foo') -create table t1 (a varchar(80), b varchar(80)); -insert into t1 values(NULL,"12345"); -insert into t1 values(NULL,"chm"); -select quote(ltrim(concat(' ',t1.b))) from t1; -quote(ltrim(concat(' ',t1.b))) -'12345' -'chm' -select quote(trim(concat(' ',t1.b))) from t1; -quote(trim(concat(' ',t1.b))) -'12345' -'chm' -drop table t1; +select quote(ltrim(concat(' ', 'a'))); +quote(ltrim(concat(' ', 'a'))) +'a' +select quote(trim(concat(' ', 'a'))); +quote(trim(concat(' ', 'a'))) +'a' diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test index 421512c4dc4..79a996e7e78 100644 --- a/mysql-test/t/func_str.test +++ b/mysql-test/t/func_str.test @@ -191,9 +191,5 @@ select trim(leading 'foo' from 'foo'); # Bug #7495 # -create table t1 (a varchar(80), b varchar(80)); -insert into t1 values(NULL,"12345"); -insert into t1 values(NULL,"chm"); -select quote(ltrim(concat(' ',t1.b))) from t1; -select quote(trim(concat(' ',t1.b))) from t1; -drop table t1; +select quote(ltrim(concat(' ', 'a'))); +select quote(trim(concat(' ', 'a'))); diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 61477753594..a852906ee2c 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -1141,7 +1141,7 @@ String *Item_func_ltrim::val_str(String *str) } if (ptr == res->ptr()) return res; - tmp_value.copy(res->ptr() + (ptr - res->ptr()), (uint32) (end - ptr)); + tmp_value.set(*res,(uint) (ptr - res->ptr()),(uint) (end-ptr)); return &tmp_value; } @@ -1266,7 +1266,7 @@ String *Item_func_trim::val_str(String *str) } if (ptr == res->ptr() && end == ptr+res->length()) return res; - tmp_value.copy(res->ptr() + (ptr - res->ptr()), (uint32) (end - ptr)); + tmp_value.set(*res,(uint) (ptr - res->ptr()),(uint) (end-ptr)); return &tmp_value; } @@ -2185,16 +2185,16 @@ String *Item_func_quote::val_str(String *str) /* We have to use realloc() instead of alloc() as we want to keep the - old result in str + old result in arg */ - if (str->realloc(new_length)) + if (arg->realloc(new_length)) goto null; /* As 'arg' and 'str' may be the same string, we must replace characters from the end to the beginning */ - to= (char*) str->ptr() + new_length - 1; + to= (char*) arg->ptr() + new_length - 1; *to--= '\''; for (start= (char*) arg->ptr(),end= start + arg_length; end-- != start; to--) { @@ -2222,9 +2222,9 @@ String *Item_func_quote::val_str(String *str) } } *to= '\''; - str->length(new_length); + arg->length(new_length); null_value= 0; - return str; + return arg; null: null_value= 1; From 50bd606d06ed549e0dbd5bbb2d35663fe7641421 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 24 Dec 2004 18:52:24 +0400 Subject: [PATCH 0587/1063] A fix (bug #5652: [patch] tcpwrapper support is broken on systems using an unmodified tcpwrapper). sql/mysqld.cc: A fix (bug #5652: [patch] tcpwrapper support is broken on systems using an unmodified tcpwrapper). Wrapper for fromhost, hosts_access, eval_client has been removed. --- sql/mysqld.cc | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 768acd77c27..eae63c5deb3 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -107,15 +107,6 @@ extern "C" { // Because of SCO 3.2V4.2 int allow_severity = LOG_INFO; int deny_severity = LOG_WARNING; -#ifdef __STDC__ -#define my_fromhost(A) fromhost(A) -#define my_hosts_access(A) hosts_access(A) -#define my_eval_client(A) eval_client(A) -#else -#define my_fromhost(A) fromhost() -#define my_hosts_access(A) hosts_access() -#define my_eval_client(A) eval_client() -#endif #endif /* HAVE_LIBWRAP */ #ifdef HAVE_SYS_MMAN_H @@ -3240,8 +3231,8 @@ extern "C" pthread_handler_decl(handle_connections_sockets, struct request_info req; signal(SIGCHLD, SIG_DFL); request_init(&req, RQ_DAEMON, libwrapName, RQ_FILE, new_sock, NULL); - my_fromhost(&req); - if (!my_hosts_access(&req)) + fromhost(&req); + if (!hosts_access(&req)) { /* This may be stupid but refuse() includes an exit(0) @@ -3249,7 +3240,7 @@ extern "C" pthread_handler_decl(handle_connections_sockets, clean_exit() - same stupid thing ... */ syslog(deny_severity, "refused connect from %s", - my_eval_client(&req)); + eval_client(&req)); /* C++ sucks (the gibberish in front just translates the supplied From cb8ffea15e0a6bdd8cf78eb63112cc6a6ab4448b Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 25 Dec 2004 00:07:22 +0200 Subject: [PATCH 0588/1063] additional 4.0 -> 4.1 merge !! mysql-test/r/func_str.result: a little, very little mistake in the merge process --- mysql-test/r/func_str.result | 1 - 1 file changed, 1 deletion(-) diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result index f4185ad93de..1c560dfa8b4 100644 --- a/mysql-test/r/func_str.result +++ b/mysql-test/r/func_str.result @@ -691,7 +691,6 @@ select count(*) as total, left(c,10) as reg from t1 group by reg order by reg de total reg 10 2004-12-10 drop table t1; - select quote(ltrim(concat(' ', 'a'))); quote(ltrim(concat(' ', 'a'))) 'a' From a1110e7069c66bce51b9afeb7aaec536d3a0d0d4 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 24 Dec 2004 23:30:40 +0100 Subject: [PATCH 0589/1063] better fix for bug#7242 (crash in prepared INSERT ... UPDATE) sql/sql_insert.cc: cleanup --- sql/sql_insert.cc | 9 ++++----- sql/sql_prepare.cc | 30 ++++-------------------------- 2 files changed, 8 insertions(+), 31 deletions(-) diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index ce64890523a..622176e22cc 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -427,6 +427,7 @@ abort: thd - thread handler table_list - global table list insert_table_list - local table list of INSERT SELECT_LEX + values - values to insert. NULL for INSERT ... SELECT RETURN VALUE 0 - OK @@ -442,7 +443,7 @@ int mysql_prepare_insert(THD *thd, TABLE_LIST *table_list, if (duplic == DUP_UPDATE && !table->insert_values) { /* it should be allocated before Item::fix_fields() */ - table->insert_values= + table->insert_values= (byte *)alloc_root(thd->mem_root, table->rec_buff_length); if (!table->insert_values) DBUG_RETURN(-1); @@ -454,10 +455,8 @@ int mysql_prepare_insert(THD *thd, TABLE_LIST *table_list, (setup_fields(thd, 0, insert_table_list, update_fields, 1, 0, 0) || setup_fields(thd, 0, insert_table_list, update_values, 1, 0, 0)))) DBUG_RETURN(-1); - if ((thd->lex->sql_command==SQLCOM_INSERT || - thd->lex->sql_command==SQLCOM_REPLACE) && - find_real_table_in_list(table_list->next, - table_list->db, table_list->real_name)) + if (values && find_real_table_in_list(table_list->next, table_list->db, + table_list->real_name)) { my_error(ER_UPDATE_TABLE_USED, MYF(0), table_list->real_name); DBUG_RETURN(-1); diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index 6d2ddf03b50..20ebc23e240 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -908,14 +908,15 @@ static int mysql_test_insert(Prepared_statement *stmt, uint value_count; ulong counter= 0; + table_list->table->insert_values=(byte *)1; // don't allocate insert_values if ((res= mysql_prepare_insert(thd, table_list, insert_table_list, table_list->table, fields, values, update_fields, update_values, duplic))) goto error; - + value_count= values->elements; its.rewind(); - + while ((values= its++)) { counter++; @@ -934,6 +935,7 @@ static int mysql_test_insert(Prepared_statement *stmt, res= 0; error: lex->unit.cleanup(); + table_list->table->insert_values=0; DBUG_RETURN(res); } @@ -1513,28 +1515,6 @@ static bool init_param_array(Prepared_statement *stmt) return 0; } - -/* Init statement before execution */ - -static void cleanup_stmt_for_execute(Prepared_statement *stmt) -{ - THD *thd= stmt->thd; - LEX *lex= stmt->lex; - SELECT_LEX *sl= lex->all_selects_list; - - for (; sl; sl= sl->next_select_in_list()) - { - for (TABLE_LIST *tables= (TABLE_LIST*) sl->table_list.first; - tables; - tables= tables->next) - { - if (tables->table) - tables->table->insert_values= 0; - } - } -} - - /* Given a query string with parameter markers, create a Prepared Statement from it and send PS info back to the client. @@ -1635,7 +1615,6 @@ int mysql_stmt_prepare(THD *thd, char *packet, uint packet_length, if (!error) error= send_prepare_results(stmt, test(name)); - cleanup_stmt_for_execute(stmt); /* restore to WAIT_PRIOR: QUERY_PRIOR is set inside alloc_query */ if (!(specialflag & SPECIAL_NO_PRIOR)) @@ -1926,7 +1905,6 @@ static void execute_stmt(THD *thd, Prepared_statement *stmt, reset_stmt_params(stmt); close_thread_tables(thd); // to close derived tables thd->set_statement(&thd->stmt_backup); - cleanup_stmt_for_execute(stmt); DBUG_VOID_RETURN; } From a4d840a09c09ca0c17bcc6776dda3d8f4ebec07d Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 25 Dec 2004 19:17:57 -0800 Subject: [PATCH 0590/1063] subselect.result, subselect.test: Added test cases for bug #7351. item_cmpfunc.cc: Fixed bug #7351: incorrect result for a query with a subquery returning empty set. If in the predicate v IN (SELECT a FROM t WHERE cond) v is null, then the result of the predicate is either INKNOWN or FALSE. It is FALSE if the subquery returns an empty set. item_subselect.cc: Fixed bug #7351: incorrect result for a query with a subquery returning empty set. The problem was due to not a quite legal transformation for 'IN' subqueries. A subquery containing a predicate of the form v IN (SELECT a FROM t WHERE cond) was transformed into EXISTS(SELECT a FROM t WHERE cond AND (a=v OR a IS NULL)). Yet, this transformation is valid only if v is not null. If v is null, then, in the case when (SELECT a FROM t WHERE cond) returns an empty set the value of the predicate is FALSE, otherwise the result of the predicate is INKNOWN. The fix resolves this problem by changing the result of the transformation to EXISTS(SELECT a FROM t WHERE cond AND (v IS NULL OR (a=v OR a IS NULL))) in the case when v is nullable. The new transformation prevents applying the lookup optimization for IN subqueries. To make it still applicable we have to introduce guarded access methods. sql/item_subselect.cc: Fixed bug #7351: incorrect result for a query with a subquery returning empty set. The problem was due to not a quite legal transformation for 'IN' subqueries. A subquery containing a predicate of the form v IN (SELECT a FROM t WHERE cond) was transformed into EXISTS(SELECT a FROM t WHERE cond AND (a=v OR a IS NULL)). Yet, this transformation is valid only if v is not null. If v is null, then, in the case when (SELECT a FROM t WHERE cond) returns an empty set the value of the predicate is FALSE, otherwise the result of the predicate is INKNOWN. The fix resolves this problem by changing the result of the transformation to EXISTS(SELECT a FROM t WHERE cond AND (v IS NULL OR (a=v OR a IS NULL))) in the case when v is nullable. The new transformation prevents applying the lookup optimization for IN subqueries. To make it still applicable we have to introduce guarded access methods. sql/item_cmpfunc.cc: Fixed bug #7351: incorrect result for a query with a subquery returning empty set. If in the predicate v IN (SELECT a FROM t WHERE cond) v is null, then the result of the predicate is either INKNOWN or FALSE. It is FALSE if the subquery returns an empty set. mysql-test/t/subselect.test: Added test cases for bug #7351. mysql-test/r/subselect.result: Added test cases for bug #7351. --- mysql-test/r/subselect.result | 25 ++++++++++++++++++++----- mysql-test/t/subselect.test | 21 ++++++++++++++++++++- sql/item_cmpfunc.cc | 5 +++-- sql/item_subselect.cc | 13 +++++++++---- 4 files changed, 52 insertions(+), 12 deletions(-) diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index 0735f133e6f..b264018866c 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -1425,7 +1425,7 @@ Note 1003 (select test.t1.s1 AS `s1` from test.t1) s1 tttt drop table t1; -create table t1 (s1 char(5), index s1(s1)); +create table t1 (s1 char(5) not null, index s1(s1)); create table t2 (s1 char(5), index s1(s1)); insert into t1 values ('a1'),('a2'),('a3'); insert into t2 values ('a1'),('a2'); @@ -1451,25 +1451,25 @@ a2 1 a3 1 explain extended select s1, s1 NOT IN (SELECT s1 FROM t2) from t1; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 index NULL s1 6 NULL 3 Using index +1 PRIMARY t1 index NULL s1 5 NULL 3 Using index 2 DEPENDENT SUBQUERY t2 index_subquery s1 s1 6 func 2 Using index Warnings: Note 1003 select test.t1.s1 AS `s1`,not((test.t1.s1,(((test.t1.s1) in t2 on s1 chicking NULL)))) AS `s1 NOT IN (SELECT s1 FROM t2)` from test.t1 explain extended select s1, s1 = ANY (SELECT s1 FROM t2) from t1; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 index NULL s1 6 NULL 3 Using index +1 PRIMARY t1 index NULL s1 5 NULL 3 Using index 2 DEPENDENT SUBQUERY t2 index_subquery s1 s1 6 func 2 Using index Warnings: Note 1003 select test.t1.s1 AS `s1`,(test.t1.s1,(((test.t1.s1) in t2 on s1 chicking NULL))) AS `s1 = ANY (SELECT s1 FROM t2)` from test.t1 explain extended select s1, s1 <> ALL (SELECT s1 FROM t2) from t1; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 index NULL s1 6 NULL 3 Using index +1 PRIMARY t1 index NULL s1 5 NULL 3 Using index 2 DEPENDENT SUBQUERY t2 index_subquery s1 s1 6 func 2 Using index Warnings: Note 1003 select test.t1.s1 AS `s1`,not((test.t1.s1,(((test.t1.s1) in t2 on s1 chicking NULL)))) AS `s1 <> ALL (SELECT s1 FROM t2)` from test.t1 explain extended select s1, s1 NOT IN (SELECT s1 FROM t2 WHERE s1 < 'a2') from t1; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 index NULL s1 6 NULL 3 Using index +1 PRIMARY t1 index NULL s1 5 NULL 3 Using index 2 DEPENDENT SUBQUERY t2 index_subquery s1 s1 6 func 1 Using index; Using where Warnings: Note 1003 select test.t1.s1 AS `s1`,not((test.t1.s1,(((test.t1.s1) in t2 on s1 chicking NULL where (test.t2.s1 < _latin1'a2'))))) AS `s1 NOT IN (SELECT s1 FROM t2 WHERE s1 < 'a2')` from test.t1 @@ -2125,3 +2125,18 @@ SELECT DISTINCT Continent AS c FROM t1 WHERE Code <> SOME ( SELECT Code FROM t1 c Oceania drop table t1; +CREATE TABLE t1 ( f1 BIGINT ); +INSERT INTO t1 SET f1= NULL; +INSERT INTO t1 SET f1= 1; +CREATE TABLE t2 ( f1 BIGINT ); +SELECT f1 FROM t1 +WHERE f1 <> ALL ( SELECT f1 FROM t2 ); +f1 +NULL +1 +INSERT INTO t2 VALUES (1), (2); +SELECT f1 FROM t1 +WHERE f1 <> ALL ( SELECT f1 FROM t2 WHERE f1 > 2 ); +f1 +NULL +1 diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test index f59851fa722..6f7daa66897 100644 --- a/mysql-test/t/subselect.test +++ b/mysql-test/t/subselect.test @@ -889,7 +889,7 @@ drop table t1; # # IN optimisation test results # -create table t1 (s1 char(5), index s1(s1)); +create table t1 (s1 char(5) not null, index s1(s1)); create table t2 (s1 char(5), index s1(s1)); insert into t1 values ('a1'),('a2'),('a3'); insert into t2 values ('a1'),('a2'); @@ -1386,3 +1386,22 @@ INSERT INTO t1 VALUES ('UMI','United States Minor Outlying Islands','Oceania','M /*!40000 ALTER TABLE t1 ENABLE KEYS */; SELECT DISTINCT Continent AS c FROM t1 WHERE Code <> SOME ( SELECT Code FROM t1 WHERE Continent = c AND Population < 200); drop table t1; + +# +# Test cases for bug #7351: +# quantified predicate with subquery returning empty result set +# + +CREATE TABLE t1 ( f1 BIGINT ); +INSERT INTO t1 SET f1= NULL; +INSERT INTO t1 SET f1= 1; +CREATE TABLE t2 ( f1 BIGINT ); + +SELECT f1 FROM t1 + WHERE f1 <> ALL ( SELECT f1 FROM t2 ); + +INSERT INTO t2 VALUES (1), (2); + +SELECT f1 FROM t1 + WHERE f1 <> ALL ( SELECT f1 FROM t2 WHERE f1 > 2 ); + diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index a135f08ae45..3d79c16b5d0 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -636,12 +636,13 @@ longlong Item_in_optimizer::val_int() { DBUG_ASSERT(fixed == 1); cache->store(args[0]); + longlong tmp= args[1]->val_int_result(); if (cache->null_value) { - null_value= 1; + if (tmp) + null_value= 1; return 0; } - longlong tmp= args[1]->val_int_result(); null_value= args[1]->null_value; return tmp; } diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index 1d0f46fd196..e1a80941a52 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -824,6 +824,8 @@ Item_in_subselect::single_value_transformer(JOIN *join, select_lex->ref_pointer_array, (char *)"", this->full_name())); + if (!abort_on_null && left_expr->maybe_null) + item= new Item_cond_or(new Item_func_isnull(left_expr), item); /* AND and comparison functions can't be changed during fix_fields() we can assign select_lex->having here, and pass 0 as last @@ -869,6 +871,8 @@ Item_in_subselect::single_value_transformer(JOIN *join, select_lex->having_fix_field= 0; item= new Item_cond_or(item, new Item_func_isnull(orig_item)); + if (left_expr->maybe_null) + item= new Item_cond_or(new Item_func_isnull(left_expr), item); } item->name= (char *)in_additional_cond; /* @@ -889,12 +893,13 @@ Item_in_subselect::single_value_transformer(JOIN *join, we can assign select_lex->having here, and pass 0 as last argument (reference) to fix_fields() */ - select_lex->having= - join->having= - func->create(expr, - new Item_null_helper(this, item, + item= func->create(expr, + new Item_null_helper(this, item, (char *)"", (char *)"")); + if (!abort_on_null && left_expr->maybe_null) + item= new Item_cond_or(new Item_func_isnull(left_expr), item); + select_lex->having= join->having= item; select_lex->having_fix_field= 1; if (join->having->fix_fields(thd, join->tables_list, 0)) From a9eef185c64ff73f72a612a3724223318795d64d Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 26 Dec 2004 02:04:40 -0800 Subject: [PATCH 0591/1063] subselect.result, subselect.test: Added a couple of new test cases for bug #7351. mysql-test/t/subselect.test: Added a couple of new test cases for bug #7351. mysql-test/r/subselect.result: Added a couple of new test cases for bug #7351. --- mysql-test/r/subselect.result | 12 ++++++++++++ mysql-test/t/subselect.test | 7 +++++++ 2 files changed, 19 insertions(+) diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index b264018866c..9c442d8e3cb 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -2140,3 +2140,15 @@ WHERE f1 <> ALL ( SELECT f1 FROM t2 WHERE f1 > 2 ); f1 NULL 1 +SELECT f1 FROM t1 +WHERE f1 <> ALL ( SELECT f1 FROM t2 WHERE f1 > 2 +UNION +SELECT f1 FROM t2 WHERE f1 > 3); +f1 +NULL +1 +SELECT f1 FROM t1 +WHERE f1 <> ALL ( SELECT SUM(f1) AS sf1 FROM t2 HAVING sf1 > 10000); +f1 +NULL +1 diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test index 6f7daa66897..6e4c3a5d604 100644 --- a/mysql-test/t/subselect.test +++ b/mysql-test/t/subselect.test @@ -1405,3 +1405,10 @@ INSERT INTO t2 VALUES (1), (2); SELECT f1 FROM t1 WHERE f1 <> ALL ( SELECT f1 FROM t2 WHERE f1 > 2 ); +SELECT f1 FROM t1 + WHERE f1 <> ALL ( SELECT f1 FROM t2 WHERE f1 > 2 + UNION + SELECT f1 FROM t2 WHERE f1 > 3); + +SELECT f1 FROM t1 + WHERE f1 <> ALL ( SELECT SUM(f1) AS sf1 FROM t2 HAVING sf1 > 10000); From 708eebea8aec579f71e086057063b1f8a7695df1 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 27 Dec 2004 04:10:25 +0200 Subject: [PATCH 0592/1063] Many files: Fix InnoDB critical bug #7496; we scan the InnoDB data dictionary also at a normal mysqld startup, and create the spaces, so that we know the mapping space id -> .ibd file name; fix an infinite loop if DISCARD TABLESPACE coincides with INSERT or some other table operation; fix a potential crash if DISCARD TABLESPACE coincides with a cascaded FOREIGN KEY operation in the same table; do not allow DISCARD TABLESPACE of a referenced table if FOREIGN_KEY_CHECKS=1 innobase/buf/buf0rea.c: Fix InnoDB critical bug #7496; we scan the InnoDB data dictionary also at a normal mysqld startup, and create the spaces, so that we know the mapping space id -> .ibd file name; fix an infinite loop if DISCARD TABLESPACE coincides with INSERT or some other table operation; fix a potential crash if DISCARD TABLESPACE coincides with a cascaded FOREIGN KEY operation in the same table; do not allow DISCARD TABLESPACE of a referenced table if FOREIGN_KEY_CHECKS=1 innobase/include/dict0load.h: Fix InnoDB critical bug #7496; we scan the InnoDB data dictionary also at a normal mysqld startup, and create the spaces, so that we know the mapping space id -> .ibd file name; fix an infinite loop if DISCARD TABLESPACE coincides with INSERT or some other table operation; fix a potential crash if DISCARD TABLESPACE coincides with a cascaded FOREIGN KEY operation in the same table; do not allow DISCARD TABLESPACE of a referenced table if FOREIGN_KEY_CHECKS=1 innobase/include/fil0fil.h: Fix InnoDB critical bug #7496; we scan the InnoDB data dictionary also at a normal mysqld startup, and create the spaces, so that we know the mapping space id -> .ibd file name; fix an infinite loop if DISCARD TABLESPACE coincides with INSERT or some other table operation; fix a potential crash if DISCARD TABLESPACE coincides with a cascaded FOREIGN KEY operation in the same table; do not allow DISCARD TABLESPACE of a referenced table if FOREIGN_KEY_CHECKS=1 innobase/include/row0mysql.h: Fix InnoDB critical bug #7496; we scan the InnoDB data dictionary also at a normal mysqld startup, and create the spaces, so that we know the mapping space id -> .ibd file name; fix an infinite loop if DISCARD TABLESPACE coincides with INSERT or some other table operation; fix a potential crash if DISCARD TABLESPACE coincides with a cascaded FOREIGN KEY operation in the same table; do not allow DISCARD TABLESPACE of a referenced table if FOREIGN_KEY_CHECKS=1 innobase/include/trx0trx.h: Fix InnoDB critical bug #7496; we scan the InnoDB data dictionary also at a normal mysqld startup, and create the spaces, so that we know the mapping space id -> .ibd file name; fix an infinite loop if DISCARD TABLESPACE coincides with INSERT or some other table operation; fix a potential crash if DISCARD TABLESPACE coincides with a cascaded FOREIGN KEY operation in the same table; do not allow DISCARD TABLESPACE of a referenced table if FOREIGN_KEY_CHECKS=1 innobase/dict/dict0load.c: Fix InnoDB critical bug #7496; we scan the InnoDB data dictionary also at a normal mysqld startup, and create the spaces, so that we know the mapping space id -> .ibd file name; fix an infinite loop if DISCARD TABLESPACE coincides with INSERT or some other table operation; fix a potential crash if DISCARD TABLESPACE coincides with a cascaded FOREIGN KEY operation in the same table; do not allow DISCARD TABLESPACE of a referenced table if FOREIGN_KEY_CHECKS=1 innobase/fil/fil0fil.c: Fix InnoDB critical bug #7496; we scan the InnoDB data dictionary also at a normal mysqld startup, and create the spaces, so that we know the mapping space id -> .ibd file name; fix an infinite loop if DISCARD TABLESPACE coincides with INSERT or some other table operation; fix a potential crash if DISCARD TABLESPACE coincides with a cascaded FOREIGN KEY operation in the same table; do not allow DISCARD TABLESPACE of a referenced table if FOREIGN_KEY_CHECKS=1 innobase/row/row0ins.c: Fix InnoDB critical bug #7496; we scan the InnoDB data dictionary also at a normal mysqld startup, and create the spaces, so that we know the mapping space id -> .ibd file name; fix an infinite loop if DISCARD TABLESPACE coincides with INSERT or some other table operation; fix a potential crash if DISCARD TABLESPACE coincides with a cascaded FOREIGN KEY operation in the same table; do not allow DISCARD TABLESPACE of a referenced table if FOREIGN_KEY_CHECKS=1 innobase/row/row0mysql.c: Fix InnoDB critical bug #7496; we scan the InnoDB data dictionary also at a normal mysqld startup, and create the spaces, so that we know the mapping space id -> .ibd file name; fix an infinite loop if DISCARD TABLESPACE coincides with INSERT or some other table operation; fix a potential crash if DISCARD TABLESPACE coincides with a cascaded FOREIGN KEY operation in the same table; do not allow DISCARD TABLESPACE of a referenced table if FOREIGN_KEY_CHECKS=1 innobase/row/row0sel.c: Fix InnoDB critical bug #7496; we scan the InnoDB data dictionary also at a normal mysqld startup, and create the spaces, so that we know the mapping space id -> .ibd file name; fix an infinite loop if DISCARD TABLESPACE coincides with INSERT or some other table operation; fix a potential crash if DISCARD TABLESPACE coincides with a cascaded FOREIGN KEY operation in the same table; do not allow DISCARD TABLESPACE of a referenced table if FOREIGN_KEY_CHECKS=1 innobase/srv/srv0start.c: Fix InnoDB critical bug #7496; we scan the InnoDB data dictionary also at a normal mysqld startup, and create the spaces, so that we know the mapping space id -> .ibd file name; fix an infinite loop if DISCARD TABLESPACE coincides with INSERT or some other table operation; fix a potential crash if DISCARD TABLESPACE coincides with a cascaded FOREIGN KEY operation in the same table; do not allow DISCARD TABLESPACE of a referenced table if FOREIGN_KEY_CHECKS=1 innobase/trx/trx0trx.c: Fix InnoDB critical bug #7496; we scan the InnoDB data dictionary also at a normal mysqld startup, and create the spaces, so that we know the mapping space id -> .ibd file name; fix an infinite loop if DISCARD TABLESPACE coincides with INSERT or some other table operation; fix a potential crash if DISCARD TABLESPACE coincides with a cascaded FOREIGN KEY operation in the same table; do not allow DISCARD TABLESPACE of a referenced table if FOREIGN_KEY_CHECKS=1 sql/ha_innodb.cc: Fix InnoDB critical bug #7496; we scan the InnoDB data dictionary also at a normal mysqld startup, and create the spaces, so that we know the mapping space id -> .ibd file name; fix an infinite loop if DISCARD TABLESPACE coincides with INSERT or some other table operation; fix a potential crash if DISCARD TABLESPACE coincides with a cascaded FOREIGN KEY operation in the same table; do not allow DISCARD TABLESPACE of a referenced table if FOREIGN_KEY_CHECKS=1 --- innobase/buf/buf0rea.c | 2 +- innobase/dict/dict0load.c | 30 ++++++-- innobase/fil/fil0fil.c | 93 +++++++++++++++++++---- innobase/include/dict0load.h | 10 ++- innobase/include/fil0fil.h | 28 ++++--- innobase/include/row0mysql.h | 20 +---- innobase/include/trx0trx.h | 13 ++++ innobase/row/row0ins.c | 4 +- innobase/row/row0mysql.c | 141 +++++++++++++++++++++++++++++------ innobase/row/row0sel.c | 18 ++++- innobase/srv/srv0start.c | 43 ++++++++--- innobase/trx/trx0trx.c | 8 ++ sql/ha_innodb.cc | 15 +--- 13 files changed, 321 insertions(+), 104 deletions(-) diff --git a/innobase/buf/buf0rea.c b/innobase/buf/buf0rea.c index 11107d777c8..58287d37387 100644 --- a/innobase/buf/buf0rea.c +++ b/innobase/buf/buf0rea.c @@ -326,7 +326,7 @@ buf_read_page( if (err == DB_TABLESPACE_DELETED) { ut_print_timestamp(stderr); fprintf(stderr, -" InnoDB: error: trying to access tablespace %lu page no. %lu,\n" +" InnoDB: Error: trying to access tablespace %lu page no. %lu,\n" "InnoDB: but the tablespace does not exist or is just being dropped.\n", (ulong) space, (ulong) offset); } diff --git a/innobase/dict/dict0load.c b/innobase/dict/dict0load.c index 7890ebd2b47..61facc8818d 100644 --- a/innobase/dict/dict0load.c +++ b/innobase/dict/dict0load.c @@ -205,12 +205,14 @@ loop: In a crash recovery we already have all the tablespace objects created. This function compares the space id information in the InnoDB data dictionary to what we already read with fil_load_single_table_tablespaces(). -In a normal startup we just scan the biggest space id, and store it to -fil_system. */ + +In a normal startup, we create the tablespace objects for every table in +InnoDB's data dictionary, if the corresponding .ibd file exists. +We also scan the biggest space id, and store it to fil_system. */ void -dict_check_tablespaces_or_store_max_id( -/*===================================*/ +dict_check_tablespaces_and_store_max_id( +/*====================================*/ ibool in_crash_recovery) /* in: are we doing a crash recovery */ { dict_table_t* sys_tables; @@ -280,6 +282,14 @@ loop: FALSE, TRUE, TRUE); } + if (space_id != 0 && !in_crash_recovery) { + /* It is a normal database startup: create the space + object and check that the .ibd file exists. */ + + fil_open_single_table_tablespace(FALSE, space_id, + name); + } + mem_free(name); if (space_id > max_space_id) { @@ -796,8 +806,18 @@ dict_load_table( /* Ok; (if we did a crash recovery then the tablespace can already be in the memory cache) */ } else { + /* In >= 4.1.9, InnoDB scans the data dictionary also + at a normal mysqld startup. It is an error if the + space object does not exist in memory. */ + + ut_print_timestamp(stderr); + fprintf(stderr, +" InnoDB: error: space object of table %s,\n" +"InnoDB: space id %lu did not exist in memory. Retrying an open.\n", + name, (ulong)space); /* Try to open the tablespace */ - if (!fil_open_single_table_tablespace(space, name)) { + if (!fil_open_single_table_tablespace(TRUE, + space, name)) { /* We failed to find a sensible tablespace file */ diff --git a/innobase/fil/fil0fil.c b/innobase/fil/fil0fil.c index de528355182..89648b3feca 100644 --- a/innobase/fil/fil0fil.c +++ b/innobase/fil/fil0fil.c @@ -466,6 +466,10 @@ fil_node_open_file( ulint size_low; ulint size_high; ibool ret; + byte* buf2; + byte* page; + ibool success; + ulint space_id; #ifdef UNIV_SYNC_DEBUG ut_ad(mutex_own(&(system->mutex))); @@ -494,6 +498,8 @@ fil_node_open_file( system->n_open++; if (node->size == 0) { + ut_a(space->purpose != FIL_LOG); + os_file_get_size(node->handle, &size_low, &size_high); size_bytes = (((ib_longlong)size_high) << 32) @@ -507,6 +513,46 @@ fil_node_open_file( ut_a(space->id != 0); + if (size_bytes < FIL_IBD_FILE_INITIAL_SIZE * UNIV_PAGE_SIZE) { + fprintf(stderr, +"InnoDB: Error: the size of single-table tablespace file %s\n" +"InnoDB: is only %lu %lu, should be at least %lu!", node->name, + (ulong) size_high, + (ulong) size_low, (ulong) (4 * UNIV_PAGE_SIZE)); + + ut_a(0); + } + + /* Read the first page of the tablespace */ + + buf2 = ut_malloc(2 * UNIV_PAGE_SIZE); + /* Align the memory for file i/o if we might have O_DIRECT + set */ + page = ut_align(buf2, UNIV_PAGE_SIZE); + + success = os_file_read(node->handle, page, 0, 0, + UNIV_PAGE_SIZE); + space_id = fsp_header_get_space_id(page); + + ut_free(buf2); + + if (space_id == ULINT_UNDEFINED || space_id == 0) { + fprintf(stderr, +"InnoDB: Error: tablespace id %lu in file %s is not sensible\n", + (ulong) space_id, + node->name); + + ut_a(0); + } + + if (space_id != space->id) { + fprintf(stderr, +"InnoDB: Error: tablespace id is %lu in the data dictionary\n" +"InnoDB: but in file %s it is %lu!\n", space->id, node->name, space_id); + + ut_a(0); + } + if (size_bytes >= FSP_EXTENT_SIZE * UNIV_PAGE_SIZE) { node->size = (ulint) ((size_bytes / (1024 * 1024)) * ((1024 * 1024) / UNIV_PAGE_SIZE)); @@ -2487,21 +2533,29 @@ func_exit: } /************************************************************************ -Tries to open a single-table tablespace and checks the space id is right in -it. If does not succeed, prints an error message to the .err log. This -function is used to open the tablespace when we load a table definition -to the dictionary cache. NOTE that we assume this operation is used under the -protection of the dictionary mutex, so that two users cannot race here. This -operation does not leave the file associated with the tablespace open, but -closes it after we have looked at the space id in it. */ +Tries to open a single-table tablespace and optionally checks the space id is +right in it. If does not succeed, prints an error message to the .err log. This +function is used to open a tablespace when we start up mysqld, and also in +IMPORT TABLESPACE. +NOTE that we assume this operation is used either at the database startup +or under the protection of the dictionary mutex, so that two users cannot +race here. This operation does not leave the file associated with the +tablespace open, but closes it after we have looked at the space id in it. */ ibool fil_open_single_table_tablespace( /*=============================*/ - /* out: TRUE if success */ - ulint id, /* in: space id */ - const char* name) /* in: table name in the - databasename/tablename format */ + /* out: TRUE if success */ + ibool check_space_id, /* in: should we check that the space + id in the file is right; we assume + that this function runs much faster + if no check is made, since accessing + the file inode probably is much + faster (the OS caches them) than + accessing the first page of the file */ + ulint id, /* in: space id */ + const char* name) /* in: table name in the + databasename/tablename format */ { os_file_t file; char* filepath; @@ -2540,6 +2594,12 @@ fil_open_single_table_tablespace( return(FALSE); } + if (!check_space_id) { + space_id = id; + + goto skip_check; + } + /* Read the first page of the tablespace */ buf2 = ut_malloc(2 * UNIV_PAGE_SIZE); @@ -2552,6 +2612,8 @@ fil_open_single_table_tablespace( space_id = fsp_header_get_space_id(page); + ut_free(buf2); + if (space_id != id) { ut_print_timestamp(stderr); @@ -2572,6 +2634,7 @@ fil_open_single_table_tablespace( goto func_exit; } +skip_check: success = fil_space_create(filepath, space_id, FIL_TABLESPACE); if (!success) { @@ -2584,7 +2647,6 @@ fil_open_single_table_tablespace( fil_node_create(filepath, 0, space_id, FALSE); func_exit: os_file_close(file); - ut_free(buf2); mem_free(filepath); return(ret); @@ -2651,7 +2713,7 @@ fil_load_single_table_tablespace( fprintf(stderr, "InnoDB: Error: could not open single-table tablespace file\n" "InnoDB: %s!\n" -"InnoDB: We do not continue crash recovery, because the table will become\n" +"InnoDB: We do not continue the crash recovery, because the table may become\n" "InnoDB: corrupt if we cannot apply the log records in the InnoDB log to it.\n" "InnoDB: To fix the problem and start mysqld:\n" "InnoDB: 1) If there is a permission problem in the file and mysqld cannot\n" @@ -2822,8 +2884,9 @@ fil_load_single_table_tablespace( goto func_exit; } - /* We do not measure the size of the file, that is why we pass the 0 - below */ + /* We do not use the size information we have about the file, because + the rounding formulat for extents and pages is somewhat complex; we + let fil_node_open() do that task. */ fil_node_create(filepath, 0, space_id, FALSE); func_exit: diff --git a/innobase/include/dict0load.h b/innobase/include/dict0load.h index d4dccb33373..1f0a5407140 100644 --- a/innobase/include/dict0load.h +++ b/innobase/include/dict0load.h @@ -18,12 +18,14 @@ Created 4/24/1996 Heikki Tuuri In a crash recovery we already have all the tablespace objects created. This function compares the space id information in the InnoDB data dictionary to what we already read with fil_load_single_table_tablespaces(). -In a normal startup we just scan the biggest space id, and store it to -fil_system. */ + +In a normal startup, we create the tablespace objects for every table in +InnoDB's data dictionary, if the corresponding .ibd file exists. +We also scan the biggest space id, and store it to fil_system. */ void -dict_check_tablespaces_or_store_max_id( -/*===================================*/ +dict_check_tablespaces_and_store_max_id( +/*====================================*/ ibool in_crash_recovery); /* in: are we doing a crash recovery */ /************************************************************************ Finds the first table name in the given database. */ diff --git a/innobase/include/fil0fil.h b/innobase/include/fil0fil.h index 43327aab9d2..c1a127aadca 100644 --- a/innobase/include/fil0fil.h +++ b/innobase/include/fil0fil.h @@ -364,19 +364,29 @@ fil_create_new_single_table_tablespace( tablespace file in pages, must be >= FIL_IBD_FILE_INITIAL_SIZE */ /************************************************************************ -Tries to open a single-table tablespace and checks the space id is right in -it. If does not succeed, prints an error message to the .err log. This -function is used to open the tablespace when we load a table definition -to the dictionary cache. NOTE that we assume this operation is used under the -protection of the dictionary mutex, so that two users cannot race here. */ +Tries to open a single-table tablespace and optionally checks the space id is +right in it. If does not succeed, prints an error message to the .err log. This +function is used to open a tablespace when we start up mysqld, and also in +IMPORT TABLESPACE. +NOTE that we assume this operation is used either at the database startup +or under the protection of the dictionary mutex, so that two users cannot +race here. This operation does not leave the file associated with the +tablespace open, but closes it after we have looked at the space id in it. */ ibool fil_open_single_table_tablespace( /*=============================*/ - /* out: TRUE if success */ - ulint id, /* in: space id */ - const char* name); /* in: table name in the - databasename/tablename format */ + /* out: TRUE if success */ + ibool check_space_id, /* in: should we check that the space + id in the file is right; we assume + that this function runs much faster + if no check is made, since accessing + the file inode probably is much + faster (the OS caches them) than + accessing the first page of the file */ + ulint id, /* in: space id */ + const char* name); /* in: table name in the + databasename/tablename format */ /************************************************************************ It is possible, though very improbable, that the lsn's in the tablespace to be imported have risen above the current system lsn, if a lengthy purge, ibuf diff --git a/innobase/include/row0mysql.h b/innobase/include/row0mysql.h index f47ce74ce37..19007069e28 100644 --- a/innobase/include/row0mysql.h +++ b/innobase/include/row0mysql.h @@ -367,25 +367,7 @@ row_drop_table_for_mysql( /************************************************************************* Discards the tablespace of a table which stored in an .ibd file. Discarding means that this function deletes the .ibd file and assigns a new table id for -the table. Also the flag table->ibd_file_missing is set TRUE. - -How do we prevent crashes caused by ongoing operations on the table? Old -operations could try to access non-existent pages. - -1) SQL queries, INSERT, SELECT, ...: we must get an exclusive MySQL table lock -on the table before we can do DISCARD TABLESPACE. Then there are no running -queries on the table. -2) Purge and rollback: we assign a new table id for the table. Since purge and -rollback look for the table based on the table id, they see the table as -'dropped' and discard their operations. -3) Insert buffer: we remove all entries for the tablespace in the insert -buffer tree; as long as the tablespace mem object does not exist, ongoing -insert buffer page merges are discarded in buf0rea.c. If we recreate the -tablespace mem object with IMPORT TABLESPACE later, then the tablespace will -have the same id, but the tablespace_version field in the mem object is -different, and ongoing old insert buffer page merges get discarded. -4) Linear readahead and random readahead: we use the same method as in 3) to -discard ongoing operations. */ +the table. Also the flag table->ibd_file_missing is set TRUE. */ int row_discard_tablespace_for_mysql( diff --git a/innobase/include/trx0trx.h b/innobase/include/trx0trx.h index 7eb91048684..8336e05bdb0 100644 --- a/innobase/include/trx0trx.h +++ b/innobase/include/trx0trx.h @@ -378,6 +378,19 @@ struct trx_struct{ replication slave, this is the position in the log file up to which replication has processed */ + /* A MySQL variable mysql_thd->synchronous_repl tells if we have + to use synchronous replication. See ha_innodb.cc. */ + char* repl_wait_binlog_name;/* NULL, or if synchronous MySQL + replication is used, the binlog name + up to which we must communicate the + binlog to the slave, before returning + from a commit; this is the same as + mysql_log_file_name, but we allocate + and copy the name to a separate buffer + here */ + ib_longlong repl_wait_binlog_pos;/* see above at + repl_wait_binlog_name */ + os_thread_id_t mysql_thread_id;/* id of the MySQL thread associated with this transaction object */ ulint mysql_process_no;/* since in Linux, 'top' reports diff --git a/innobase/row/row0ins.c b/innobase/row/row0ins.c index 6d1482b6720..f596bd3d473 100644 --- a/innobase/row/row0ins.c +++ b/innobase/row/row0ins.c @@ -1173,7 +1173,7 @@ run_again: check_index = foreign->foreign_index; } - if (check_table == NULL) { + if (check_table == NULL || check_table->ibd_file_missing) { if (check_ref) { FILE* ef = dict_foreign_err_file; mutex_enter(&dict_foreign_err_mutex); @@ -1192,7 +1192,7 @@ run_again: dtuple_print(ef, entry); fputs("\nBut the parent table ", ef); ut_print_name(ef, trx, foreign->referenced_table_name); - fputs(" does not currently exist!\n", ef); + fputs("\nor its .ind file does not currently exist!\n", ef); mutex_exit(&dict_foreign_err_mutex); return(DB_NO_REFERENCED_ROW); diff --git a/innobase/row/row0mysql.c b/innobase/row/row0mysql.c index dec2b19559c..3be3d3e6396 100644 --- a/innobase/row/row0mysql.c +++ b/innobase/row/row0mysql.c @@ -869,7 +869,21 @@ row_insert_for_mysql( ut_ad(trx); ut_ad(trx->mysql_thread_id == os_thread_get_curr_id()); - + + if (prebuilt->table->ibd_file_missing) { + ut_print_timestamp(stderr); + fprintf(stderr, " InnoDB: Error:\n" +"InnoDB: MySQL is trying to use a table handle but the .ibd file for\n" +"InnoDB: table %s does not exist.\n" +"InnoDB: Have you deleted the .ibd file from the database directory under\n" +"InnoDB: the MySQL datadir, or have you used DISCARD TABLESPACE?\n" +"InnoDB: Look from\n" +"http://dev.mysql.com/doc/mysql/en/InnoDB_troubleshooting_datadict.html\n" +"InnoDB: how you can resolve the problem.\n", + prebuilt->table->name); + return(DB_ERROR); + } + if (prebuilt->magic_n != ROW_PREBUILT_ALLOCATED) { fprintf(stderr, "InnoDB: Error: trying to free a corrupt\n" @@ -1087,6 +1101,20 @@ row_update_for_mysql( ut_ad(trx->mysql_thread_id == os_thread_get_curr_id()); UT_NOT_USED(mysql_rec); + if (prebuilt->table->ibd_file_missing) { + ut_print_timestamp(stderr); + fprintf(stderr, " InnoDB: Error:\n" +"InnoDB: MySQL is trying to use a table handle but the .ibd file for\n" +"InnoDB: table %s does not exist.\n" +"InnoDB: Have you deleted the .ibd file from the database directory under\n" +"InnoDB: the MySQL datadir, or have you used DISCARD TABLESPACE?\n" +"InnoDB: Look from\n" +"http://dev.mysql.com/doc/mysql/en/InnoDB_troubleshooting_datadict.html\n" +"InnoDB: how you can resolve the problem.\n", + prebuilt->table->name); + return(DB_ERROR); + } + if (prebuilt->magic_n != ROW_PREBUILT_ALLOCATED) { fprintf(stderr, "InnoDB: Error: trying to free a corrupt\n" @@ -1966,9 +1994,25 @@ row_add_table_to_background_drop_list( /************************************************************************* Discards the tablespace of a table which stored in an .ibd file. Discarding means that this function deletes the .ibd file and assigns a new table id for -the table. Also the flag table->ibd_file_missing is set TRUE. +the table. Also the flag table->ibd_file_missing is set TRUE. */ -How do we prevent crashes caused by ongoing operations on the table? Old +int +row_discard_tablespace_for_mysql( +/*=============================*/ + /* out: error code or DB_SUCCESS */ + const char* name, /* in: table name */ + trx_t* trx) /* in: transaction handle */ +{ + dict_foreign_t* foreign; + dulint new_id; + dict_table_t* table; + que_thr_t* thr; + que_t* graph = NULL; + ibool success; + ulint err; + char* buf; + +/* How do we prevent crashes caused by ongoing operations on the table? Old operations could try to access non-existent pages. 1) SQL queries, INSERT, SELECT, ...: we must get an exclusive MySQL table lock @@ -1984,22 +2028,9 @@ tablespace mem object with IMPORT TABLESPACE later, then the tablespace will have the same id, but the tablespace_version field in the mem object is different, and ongoing old insert buffer page merges get discarded. 4) Linear readahead and random readahead: we use the same method as in 3) to -discard ongoing operations. */ - -int -row_discard_tablespace_for_mysql( -/*=============================*/ - /* out: error code or DB_SUCCESS */ - const char* name, /* in: table name */ - trx_t* trx) /* in: transaction handle */ -{ - dulint new_id; - dict_table_t* table; - que_thr_t* thr; - que_t* graph = NULL; - ibool success; - ulint err; - char* buf; +discard ongoing operations. +5) FOREIGN KEY operations: if table->n_foreign_key_checks_running > 0, we +do not allow the discard. We also reserve the data dictionary latch. */ static const char discard_tablespace_proc1[] = "PROCEDURE DISCARD_TABLESPACE_PROC () IS\n" @@ -2060,6 +2091,54 @@ row_discard_tablespace_for_mysql( goto funct_exit; } + if (table->n_foreign_key_checks_running > 0) { + + ut_print_timestamp(stderr); + fputs(" InnoDB: You are trying to DISCARD table ", stderr); + ut_print_name(stderr, trx, table->name); + fputs("\n" + "InnoDB: though there is a foreign key check running on it.\n" + "InnoDB: Cannot discard the table.\n", + stderr); + + err = DB_ERROR; + + goto funct_exit; + } + + /* Check if the table is referenced by foreign key constraints from + some other table (not the table itself) */ + + foreign = UT_LIST_GET_FIRST(table->referenced_list); + + while (foreign && foreign->foreign_table == table) { + foreign = UT_LIST_GET_NEXT(referenced_list, foreign); + } + + if (foreign && trx->check_foreigns) { + + FILE* ef = dict_foreign_err_file; + + /* We only allow discarding a referenced table if + FOREIGN_KEY_CHECKS is set to 0 */ + + err = DB_CANNOT_DROP_CONSTRAINT; + + mutex_enter(&dict_foreign_err_mutex); + rewind(ef); + ut_print_timestamp(ef); + + fputs(" Cannot drop table ", ef); + ut_print_name(ef, trx, name); + fputs("\n" + "because it is referenced by ", ef); + ut_print_name(ef, trx, foreign->foreign_table_name); + putc('\n', ef); + mutex_exit(&dict_foreign_err_mutex); + + goto funct_exit; + } + new_id = dict_hdr_get_new_id(DICT_HDR_TABLE_ID); buf = mem_alloc((sizeof discard_tablespace_proc1) + @@ -2077,6 +2156,10 @@ row_discard_tablespace_for_mysql( ut_a(graph); + /* Remove any locks there are on the table or its records */ + + lock_reset_all_on_table(table); + graph->trx = trx; trx->graph = NULL; @@ -2227,8 +2310,8 @@ row_import_tablespace_for_mysql( ibuf_delete_for_discarded_space(table->space); - success = fil_open_single_table_tablespace(table->space, table->name); - + success = fil_open_single_table_tablespace(TRUE, table->space, + table->name); if (success) { table->ibd_file_missing = FALSE; table->tablespace_discarded = FALSE; @@ -2236,7 +2319,7 @@ row_import_tablespace_for_mysql( if (table->ibd_file_missing) { ut_print_timestamp(stderr); fputs( -" InnoDB: cannot find of open in the database directory the .ibd file of\n" +" InnoDB: cannot find or open in the database directory the .ibd file of\n" "InnoDB: table ", stderr); ut_print_name(stderr, trx, name); fputs("\n" @@ -3284,6 +3367,20 @@ row_check_table_for_mysql( ulint ret = DB_SUCCESS; ulint old_isolation_level; + if (prebuilt->table->ibd_file_missing) { + ut_print_timestamp(stderr); + fprintf(stderr, " InnoDB: Error:\n" +"InnoDB: MySQL is trying to use a table handle but the .ibd file for\n" +"InnoDB: table %s does not exist.\n" +"InnoDB: Have you deleted the .ibd file from the database directory under\n" +"InnoDB: the MySQL datadir, or have you used DISCARD TABLESPACE?\n" +"InnoDB: Look from\n" +"http://dev.mysql.com/doc/mysql/en/InnoDB_troubleshooting_datadict.html\n" +"InnoDB: how you can resolve the problem.\n", + prebuilt->table->name); + return(DB_ERROR); + } + prebuilt->trx->op_info = "checking table"; old_isolation_level = prebuilt->trx->isolation_level; diff --git a/innobase/row/row0sel.c b/innobase/row/row0sel.c index ce76f48e7a7..8cdcdd569ac 100644 --- a/innobase/row/row0sel.c +++ b/innobase/row/row0sel.c @@ -2776,7 +2776,7 @@ row_search_for_mysql( /* out: DB_SUCCESS, DB_RECORD_NOT_FOUND, DB_END_OF_INDEX, DB_DEADLOCK, - DB_LOCK_TABLE_FULL, + DB_LOCK_TABLE_FULL, DB_CORRUPTION, or DB_TOO_BIG_RECORD */ byte* buf, /* in/out: buffer for the fetched row in the MySQL format */ @@ -2828,7 +2828,21 @@ row_search_for_mysql( ut_ad(index && pcur && search_tuple); ut_ad(trx->mysql_thread_id == os_thread_get_curr_id()); - + + if (prebuilt->table->ibd_file_missing) { + ut_print_timestamp(stderr); + fprintf(stderr, " InnoDB: Error:\n" +"InnoDB: MySQL is trying to use a table handle but the .ibd file for\n" +"InnoDB: table %s does not exist.\n" +"InnoDB: Have you deleted the .ibd file from the database directory under\n" +"InnoDB: the MySQL datadir, or have you used DISCARD TABLESPACE?\n" +"InnoDB: Look from\n" +"http://dev.mysql.com/doc/mysql/en/InnoDB_troubleshooting_datadict.html\n" +"InnoDB: how you can resolve the problem.\n", + prebuilt->table->name); + return(DB_ERROR); + } + if (prebuilt->magic_n != ROW_PREBUILT_ALLOCATED) { fprintf(stderr, "InnoDB: Error: trying to free a corrupt\n" diff --git a/innobase/srv/srv0start.c b/innobase/srv/srv0start.c index 69341a1d7d1..c91db1f0dcc 100644 --- a/innobase/srv/srv0start.c +++ b/innobase/srv/srv0start.c @@ -1378,14 +1378,39 @@ NetWare. */ return(DB_ERROR); } - /* Since ibuf init is in dict_boot, and ibuf is needed - in any disk i/o, first call dict_boot */ + /* Since the insert buffer init is in dict_boot, and the + insert buffer is needed in any disk i/o, first we call + dict_boot(). Note that trx_sys_init_at_db_start() only needs + to access space 0, and the insert buffer at this stage already + works for space 0. */ dict_boot(); trx_sys_init_at_db_start(); - /* The following needs trx lists which are initialized in - trx_sys_init_at_db_start */ + if (srv_force_recovery < SRV_FORCE_NO_IBUF_MERGE) { + /* The following call is necessary for the insert + buffer to work with multiple tablespaces. We must + know the mapping between space id's and .ibd file + names. + + In a crash recovery, we check that the info in data + dictionary is consistent with what we already know + about space id's from the call of + fil_load_single_table_tablespaces(). + + In a normal startup, we create the space objects for + every table in the InnoDB data dictionary that has + an .ibd file. + + We also determine the maximum tablespace id used. + + TODO: We may have incomplete transactions in the + data dictionary tables. Does that harm the scanning of + the data dictionary below? */ + + dict_check_tablespaces_and_store_max_id( + recv_needed_recovery); + } srv_startup_is_before_trx_rollback_phase = FALSE; @@ -1393,6 +1418,9 @@ NetWare. */ system */ fsp_header_get_free_limit(0); + /* recv_recovery_from_checkpoint_finish needs trx lists which + are initialized in trx_sys_init_at_db_start(). */ + recv_recovery_from_checkpoint_finish(); } @@ -1433,13 +1461,6 @@ NetWare. */ } } #endif /* UNIV_LOG_ARCHIVE */ - if (!create_new_db && srv_force_recovery == 0) { - /* After a crash recovery we only check that the info in data - dictionary is consistent with what we already know about space - id's from the call of fil_load_single_table_tablespaces(). */ - - dict_check_tablespaces_or_store_max_id(recv_needed_recovery); - } if (srv_measure_contention) { /* os_thread_create(&test_measure_cont, NULL, thread_ids + diff --git a/innobase/trx/trx0trx.c b/innobase/trx/trx0trx.c index f7497ac4090..af4f1979858 100644 --- a/innobase/trx/trx0trx.c +++ b/innobase/trx/trx0trx.c @@ -109,6 +109,9 @@ trx_create( trx->mysql_log_offset = 0; trx->mysql_master_log_file_name = ""; trx->mysql_master_log_pos = 0; + + trx->repl_wait_binlog_name = NULL; + trx->repl_wait_binlog_pos = 0; mutex_create(&(trx->undo_mutex)); mutex_set_level(&(trx->undo_mutex), SYNC_TRX_UNDO); @@ -271,6 +274,11 @@ trx_free( trx_undo_arr_free(trx->undo_no_arr); } + if (trx->repl_wait_binlog_name != NULL) { + + mem_free(trx->repl_wait_binlog_name); + } + ut_a(UT_LIST_GET_LEN(trx->signals) == 0); ut_a(UT_LIST_GET_LEN(trx->reply_signals) == 0); diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index 552f2676bdd..b8ac40cee92 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -4977,7 +4977,7 @@ the SQL statement in case of an error. */ int ha_innobase::external_lock( /*=======================*/ - /* out: 0 */ + /* out: 0 or HA_ERR_CRASHED */ THD* thd, /* in: handle to the user thread */ int lock_type) /* in: lock type */ { @@ -4989,19 +4989,6 @@ ha_innobase::external_lock( update_thd(thd); - if (prebuilt->table->ibd_file_missing && !current_thd->tablespace_op) { - ut_print_timestamp(stderr); - fprintf(stderr, " InnoDB error:\n" -"MySQL is trying to use a table handle but the .ibd file for\n" -"table %s does not exist.\n" -"Have you deleted the .ibd file from the database directory under\n" -"the MySQL datadir, or have you used DISCARD TABLESPACE?\n" -"Look from section 15.1 of http://www.innodb.com/ibman.html\n" -"how you can resolve the problem.\n", - prebuilt->table->name); - DBUG_RETURN(HA_ERR_CRASHED); - } - trx = prebuilt->trx; prebuilt->sql_stat_start = TRUE; From 1b7282e3e1eba03d87d0e09372867abcdb7ce842 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 27 Dec 2004 04:27:09 +0200 Subject: [PATCH 0593/1063] ha_innodb.cc, row0ins.c, fil0fil.c: Correct typo innobase/fil/fil0fil.c: Correct typo innobase/row/row0ins.c: Correct typo sql/ha_innodb.cc: Correct typo --- innobase/fil/fil0fil.c | 2 +- innobase/row/row0ins.c | 2 +- sql/ha_innodb.cc | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/innobase/fil/fil0fil.c b/innobase/fil/fil0fil.c index 89648b3feca..d1a083fcd66 100644 --- a/innobase/fil/fil0fil.c +++ b/innobase/fil/fil0fil.c @@ -2885,7 +2885,7 @@ fil_load_single_table_tablespace( } /* We do not use the size information we have about the file, because - the rounding formulat for extents and pages is somewhat complex; we + the rounding formula for extents and pages is somewhat complex; we let fil_node_open() do that task. */ fil_node_create(filepath, 0, space_id, FALSE); diff --git a/innobase/row/row0ins.c b/innobase/row/row0ins.c index f596bd3d473..c82231ef5f6 100644 --- a/innobase/row/row0ins.c +++ b/innobase/row/row0ins.c @@ -1192,7 +1192,7 @@ run_again: dtuple_print(ef, entry); fputs("\nBut the parent table ", ef); ut_print_name(ef, trx, foreign->referenced_table_name); - fputs("\nor its .ind file does not currently exist!\n", ef); + fputs("\nor its .ibd file does not currently exist!\n", ef); mutex_exit(&dict_foreign_err_mutex); return(DB_NO_REFERENCED_ROW); diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index b8ac40cee92..7b6fb31acc6 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -4977,7 +4977,7 @@ the SQL statement in case of an error. */ int ha_innobase::external_lock( /*=======================*/ - /* out: 0 or HA_ERR_CRASHED */ + /* out: 0 */ THD* thd, /* in: handle to the user thread */ int lock_type) /* in: lock type */ { From 92655f14d2d439a620cf5de5f56e38befd702818 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 27 Dec 2004 04:32:37 +0200 Subject: [PATCH 0594/1063] row0mysql.c: Fix typo innobase/row/row0mysql.c: Fix typo --- innobase/row/row0mysql.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/innobase/row/row0mysql.c b/innobase/row/row0mysql.c index 3be3d3e6396..e887079e025 100644 --- a/innobase/row/row0mysql.c +++ b/innobase/row/row0mysql.c @@ -2128,7 +2128,7 @@ do not allow the discard. We also reserve the data dictionary latch. */ rewind(ef); ut_print_timestamp(ef); - fputs(" Cannot drop table ", ef); + fputs(" Cannot DISCARD table ", ef); ut_print_name(ef, trx, name); fputs("\n" "because it is referenced by ", ef); From 562df4ee0a89e7fa1bf2cd98298a0dc3f804b8b0 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 27 Dec 2004 04:40:10 +0200 Subject: [PATCH 0595/1063] ha_innodb.cc: Return a sensible error code from DISCARD TABLESPACE, if it fails because the table is referenced by a FOREIGN KEY sql/ha_innodb.cc: Return a sensible error code from DISCARD TABLESPACE, if it fails because the table is referenced by a FOREIGN KEY --- sql/ha_innodb.cc | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index 7b6fb31acc6..14b143ca04b 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -278,15 +278,15 @@ convert_error_code_to_mysql( } else if (error == (int) DB_LOCK_WAIT_TIMEOUT) { - /* Since we rolled back the whole transaction, we must - tell it also to MySQL so that MySQL knows to empty the - cached binlog for this transaction */ + /* Since we rolled back the whole transaction, we must + tell it also to MySQL so that MySQL knows to empty the + cached binlog for this transaction */ - if (thd) { - ha_rollback(thd); - } + if (thd) { + ha_rollback(thd); + } - return(HA_ERR_LOCK_WAIT_TIMEOUT); + return(HA_ERR_LOCK_WAIT_TIMEOUT); } else if (error == (int) DB_NO_REFERENCED_ROW) { @@ -3954,11 +3954,9 @@ ha_innobase::discard_or_import_tablespace( err = row_import_tablespace_for_mysql(dict_table->name, trx); } - if (err == DB_SUCCESS) { - DBUG_RETURN(0); - } + err = convert_error_code_to_mysql(err, NULL); - DBUG_RETURN(-1); + DBUG_RETURN(err); } /********************************************************************* From 2d9eeb04f19a9ed94a22e30a786be333abbeba6b Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 27 Dec 2004 05:03:11 +0200 Subject: [PATCH 0596/1063] sql_table.cc: Return a sensible error code from DISCARD TABLESPACE, if it fails because the table is referenced by a FOREIGN KEY sql/sql_table.cc: Return a sensible error code from DISCARD TABLESPACE, if it fails because the table is referenced by a FOREIGN KEY --- sql/sql_table.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sql/sql_table.cc b/sql/sql_table.cc index c798760cfa8..43f466282b1 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -2465,7 +2465,11 @@ err: send_ok(thd); DBUG_RETURN(0); } - DBUG_RETURN(error); + + if (error == HA_ERR_ROW_IS_REFERENCED) + my_error(ER_ROW_IS_REFERENCED, MYF(0)); + + DBUG_RETURN(-1); } From b4c61152d3e30d9dca00d702053264bc4a610c73 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 27 Dec 2004 14:05:35 +0200 Subject: [PATCH 0597/1063] Fix for BUG#7377. This fix adds the same implementation for ha_myisammgr::index_type as in version 5.0. mysql-test/r/merge.result: Added test result for BUG#7377. mysql-test/t/merge.test: Added test for BUG#7377. sql/ha_myisammrg.cc: Added implementation for handler::index_type. sql/ha_myisammrg.h: Added implementation for handler::index_type. --- mysql-test/r/merge.result | 5 +++++ mysql-test/t/merge.test | 3 +++ sql/ha_myisammrg.cc | 11 +++++++++++ sql/ha_myisammrg.h | 1 + 4 files changed, 20 insertions(+) diff --git a/mysql-test/r/merge.result b/mysql-test/r/merge.result index f71626221cb..79d8f019ce3 100644 --- a/mysql-test/r/merge.result +++ b/mysql-test/r/merge.result @@ -675,4 +675,9 @@ a b c 1 2 0 1 1 1 1 1 0 +show index from t3; +Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment +t3 1 a 1 a A NULL NULL NULL YES BTREE +t3 1 a 2 b A NULL NULL NULL YES BTREE +t3 1 a 3 c A NULL NULL NULL YES BTREE drop table t1, t2, t3; diff --git a/mysql-test/t/merge.test b/mysql-test/t/merge.test index b628cb07f7b..508f9da225e 100644 --- a/mysql-test/t/merge.test +++ b/mysql-test/t/merge.test @@ -301,5 +301,8 @@ select a,b,c from t3 force index (a) where a=1 order by a,b,c; explain select a,b,c from t3 force index (a) where a=1 order by a desc, b desc, c desc; select a,b,c from t3 force index (a) where a=1 order by a desc, b desc, c desc; +# BUG#7377 SHOW index on MERGE table crashes debug server +show index from t3; + drop table t1, t2, t3; diff --git a/sql/ha_myisammrg.cc b/sql/ha_myisammrg.cc index bf4c2a36ffd..bf47b4625e0 100644 --- a/sql/ha_myisammrg.cc +++ b/sql/ha_myisammrg.cc @@ -35,6 +35,17 @@ const char **ha_myisammrg::bas_ext() const { static const char *ext[]= { ".MRG", NullS }; return ext; } +const char *ha_myisammrg::index_type(uint key_number) +{ + return ((table->key_info[key_number].flags & HA_FULLTEXT) ? + "FULLTEXT" : + (table->key_info[key_number].flags & HA_SPATIAL) ? + "SPATIAL" : + (table->key_info[key_number].algorithm == HA_KEY_ALG_RTREE) ? + "RTREE" : + "BTREE"); +} + int ha_myisammrg::open(const char *name, int mode, uint test_if_locked) { diff --git a/sql/ha_myisammrg.h b/sql/ha_myisammrg.h index 264c580220c..6058c32c805 100644 --- a/sql/ha_myisammrg.h +++ b/sql/ha_myisammrg.h @@ -32,6 +32,7 @@ class ha_myisammrg: public handler ~ha_myisammrg() {} const char *table_type() const { return "MRG_MyISAM"; } const char **bas_ext() const; + const char *index_type(uint key_number); ulong table_flags() const { return (HA_REC_NOT_IN_SEQ | HA_AUTO_PART_KEY | HA_READ_RND_SAME | From a7b984d2336135100c09998d653f331d3b9df996 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 27 Dec 2004 17:15:38 +0200 Subject: [PATCH 0598/1063] row0ins.c: Fix bug: if we dropped a table where an INSERT was waiting for a lock to check a FOREIGN KEY constraint, then an assertion would fail in lock_reset_all_on_table(), since that operation assumes no waiting locks on the table or its records row0mysql.c: Fix bug: InnoDB failed to drop a table in the background drop queue if the table was referenced by a foreign key constraint innobase/row/row0mysql.c: Fix bug: InnoDB failed to drop a table in the background drop queue if the table was referenced by a foreign key constraint innobase/row/row0ins.c: Fix bug: if we dropped a table where an INSERT was waiting for a lock to check a FOREIGN KEY constraint, then an assertion would fail in lock_reset_all_on_table(), since that operation assumes no waiting locks on the table or its records --- innobase/row/row0ins.c | 26 ++++++++++++++++++++++++++ innobase/row/row0mysql.c | 16 +++++++++++----- 2 files changed, 37 insertions(+), 5 deletions(-) diff --git a/innobase/row/row0ins.c b/innobase/row/row0ins.c index b9f860903cb..60dbf059673 100644 --- a/innobase/row/row0ins.c +++ b/innobase/row/row0ins.c @@ -1373,8 +1373,34 @@ row_ins_check_foreign_constraints( row_mysql_freeze_data_dictionary(trx); } + if (foreign->referenced_table) { + mutex_enter(&(dict_sys->mutex)); + + (foreign->referenced_table + ->n_foreign_key_checks_running)++; + + mutex_exit(&(dict_sys->mutex)); + } + + /* NOTE that if the thread ends up waiting for a lock + we will release dict_operation_lock temporarily! + But the counter on the table protects the referenced + table from being dropped while the check is running. */ + err = row_ins_check_foreign_constraint(TRUE, foreign, table, entry, thr); + + if (foreign->referenced_table) { + mutex_enter(&(dict_sys->mutex)); + + ut_a(foreign->referenced_table + ->n_foreign_key_checks_running > 0); + (foreign->referenced_table + ->n_foreign_key_checks_running)--; + + mutex_exit(&(dict_sys->mutex)); + } + if (got_s_lock) { row_mysql_unfreeze_data_dictionary(trx); } diff --git a/innobase/row/row0mysql.c b/innobase/row/row0mysql.c index 2e8f7121d2c..ad5efc160c8 100644 --- a/innobase/row/row0mysql.c +++ b/innobase/row/row0mysql.c @@ -1761,6 +1761,12 @@ row_drop_table_for_mysql_in_background( trx = trx_allocate_for_background(); + /* If the original transaction was dropping a table referenced by + foreign keys, we must set the following to be able to drop the + table: */ + + trx->check_foreigns = FALSE; + /* fputs("InnoDB: Error: Dropping table ", stderr); ut_print_name(stderr, name); fputs(" in background drop list\n", stderr); */ @@ -1834,16 +1840,16 @@ loop: goto already_dropped; } - - if (table->n_mysql_handles_opened > 0 - || table->n_foreign_key_checks_running > 0) { + + if (DB_SUCCESS != row_drop_table_for_mysql_in_background( + drop->table_name)) { + /* If the DROP fails for some table, we return, and let the + main thread retry later */ return(n_tables + n_tables_dropped); } n_tables_dropped++; - - row_drop_table_for_mysql_in_background(drop->table_name); already_dropped: mutex_enter(&kernel_mutex); From 030842edaadf34fe0547bde9d46c6bf285416c88 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 27 Dec 2004 17:28:17 +0200 Subject: [PATCH 0599/1063] row0mysql.c: Merge the two FOREIGN KEY bug fixes from 4.0, and add a TODO comment innobase/row/row0mysql.c: Merge the two FOREIGN KEY bug fixes from 4.0, and add a TODO comment --- innobase/row/row0mysql.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/innobase/row/row0mysql.c b/innobase/row/row0mysql.c index 47f1f4c444c..e2b89cba866 100644 --- a/innobase/row/row0mysql.c +++ b/innobase/row/row0mysql.c @@ -2598,6 +2598,12 @@ row_drop_table_for_mysql( goto funct_exit; } + /* TODO: could we replace the counter n_foreign_key_checks_running + with lock checks on the table? Acquire here an exclusive lock on the + table, and rewrite lock0lock.c and the lock wait in srv0srv.c so that + they can cope with the table having been dropped here? Foreign key + checks take an IS or IX lock on the table. */ + if (table->n_foreign_key_checks_running > 0) { ut_print_timestamp(stderr); From dc29b1b90107c035330afb7ff5c394696cedc828 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 27 Dec 2004 18:15:32 +0100 Subject: [PATCH 0600/1063] - make sure that MYSQL_VERSION_ID created by "configure" does not contain any non-numerical characters (if $VERSION was e.g. "4.1.8a", $MYSQL_VERSION_ID resulted in "40108a", which broke the build as MYSQL_VERSION_ID must be numerical) configure.in: - make sure that MYSQL_VERSION_ID does not contain any non-numerical characters (if $VERSION was e.g. "4.1.8a", $MYSQL_VERSION_ID resulted in "40108a", which broke the build as MYSQL_VERSION_ID must be numerical) --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index bc78c9c8764..f8b40872d3d 100644 --- a/configure.in +++ b/configure.in @@ -23,7 +23,7 @@ NDB_VERSION_STATUS="" # Remember that regexps needs to quote [ and ] since this is run through m4 MYSQL_NO_DASH_VERSION=`echo $VERSION | sed -e "s|[[a-z]]*-.*$||"` MYSQL_BASE_VERSION=`echo $MYSQL_NO_DASH_VERSION | sed -e "s|\.[[^.]]*$||"` -MYSQL_VERSION_ID=`echo $MYSQL_NO_DASH_VERSION. | sed -e 's/\./ /g; s/ \([[0-9]]\) / 0\\1 /g; s/ //g'` +MYSQL_VERSION_ID=`echo $MYSQL_NO_DASH_VERSION. | sed -e 's/[[^0-9.]]//g; s/\./ /g; s/ \([[0-9]]\) / 0\\1 /g; s/ //g'` # The port should be constant for a LONG time MYSQL_TCP_PORT_DEFAULT=3306 From 4ba981e5214cfb3d7af1db1faa7d6cc79d2b2295 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 27 Dec 2004 20:06:40 +0200 Subject: [PATCH 0601/1063] row0mysql.c: Fix the previous bug fix: dropping a table with FOREIGN KEY checks running on it caused a cascade of failed drops while the foreign key check was waiting for a lock innobase/row/row0mysql.c: Fix the previous bug fix: dropping a table with FOREIGN KEY checks running on it caused a cascade of failed drops while the foreign key check was waiting for a lock --- innobase/row/row0mysql.c | 100 ++++++++++++++++++++++++++------------- 1 file changed, 66 insertions(+), 34 deletions(-) diff --git a/innobase/row/row0mysql.c b/innobase/row/row0mysql.c index ad5efc160c8..1ab7bb1deb0 100644 --- a/innobase/row/row0mysql.c +++ b/innobase/row/row0mysql.c @@ -1771,16 +1771,9 @@ row_drop_table_for_mysql_in_background( ut_print_name(stderr, name); fputs(" in background drop list\n", stderr); */ - /* Drop the table in InnoDB */ + /* Try to drop the table in InnoDB */ error = row_drop_table_for_mysql(name, trx, FALSE); - - if (error != DB_SUCCESS) { - ut_print_timestamp(stderr); - fputs(" InnoDB: Error: Dropping table ", stderr); - ut_print_name(stderr, name); - fputs(" in background drop list failed\n", stderr); - } /* Flush the log to reduce probability that the .frm files and the InnoDB data dictionary get out-of-sync if the user runs @@ -1792,7 +1785,7 @@ row_drop_table_for_mysql_in_background( trx_free_for_background(trx); - return(DB_SUCCESS); + return(error); } /************************************************************************* @@ -1826,6 +1819,7 @@ loop: mutex_exit(&kernel_mutex); if (drop == NULL) { + /* All tables dropped */ return(n_tables + n_tables_dropped); } @@ -1893,21 +1887,21 @@ row_get_background_drop_list_len_low(void) } /************************************************************************* -Adds a table to the list of tables which the master thread drops in -background. We need this on Unix because in ALTER TABLE MySQL may call -drop table even if the table has running queries on it. */ +If a table is not yet in the drop list, adds the table to the list of tables +which the master thread drops in background. We need this on Unix because in +ALTER TABLE MySQL may call drop table even if the table has running queries on +it. Also, if there are running foreign key checks on the table, we drop the +table lazily. */ static -void +ibool row_add_table_to_background_drop_list( /*==================================*/ + /* out: TRUE if the table was not yet in the + drop list, and was added there */ dict_table_t* table) /* in: table */ { row_mysql_drop_t* drop; - drop = mem_alloc(sizeof(row_mysql_drop_t)); - - drop->table_name = mem_strdup(table->name); - mutex_enter(&kernel_mutex); if (!row_mysql_drop_list_inited) { @@ -1915,6 +1909,25 @@ row_add_table_to_background_drop_list( UT_LIST_INIT(row_mysql_drop_list); row_mysql_drop_list_inited = TRUE; } + + /* Look if the table already is in the drop list */ + drop = UT_LIST_GET_FIRST(row_mysql_drop_list); + + while (drop != NULL) { + if (strcmp(drop->table_name, table->name) == 0) { + /* Already in the list */ + + mutex_exit(&kernel_mutex); + + return(FALSE); + } + + drop = UT_LIST_GET_NEXT(row_mysql_drop_list, drop); + } + + drop = mem_alloc(sizeof(row_mysql_drop_t)); + + drop->table_name = mem_strdup(table->name); UT_LIST_ADD_LAST(row_mysql_drop_list, row_mysql_drop_list, drop); @@ -1923,6 +1936,8 @@ row_add_table_to_background_drop_list( fputs(" to background drop list\n", stderr); */ mutex_exit(&kernel_mutex); + + return(TRUE); } /************************************************************************* @@ -2157,36 +2172,53 @@ row_drop_table_for_mysql( } if (table->n_mysql_handles_opened > 0) { + ibool added; - ut_print_timestamp(stderr); - fputs(" InnoDB: Warning: MySQL is trying to drop table ", - stderr); - ut_print_name(stderr, table->name); - fputs("\n" - "InnoDB: though there are still open handles to it.\n" - "InnoDB: Adding the table to the background drop queue.\n", + added = row_add_table_to_background_drop_list(table); + + if (added) { + ut_print_timestamp(stderr); +fputs(" InnoDB: Warning: MySQL is trying to drop table ", stderr); + ut_print_name(stderr, table->name); + fputs("\n" +"InnoDB: though there are still open handles to it.\n" +"InnoDB: Adding the table to the background drop queue.\n", stderr); + + /* We return DB_SUCCESS to MySQL though the drop will + happen lazily later */ - row_add_table_to_background_drop_list(table); - - err = DB_SUCCESS; + err = DB_SUCCESS; + } else { + /* The table is already in the background drop list */ + err = DB_ERROR; + } goto funct_exit; } if (table->n_foreign_key_checks_running > 0) { + ibool added; - ut_print_timestamp(stderr); - fputs(" InnoDB: You are trying to drop table ", stderr); + added = row_add_table_to_background_drop_list(table); + + if (added) { + ut_print_timestamp(stderr); +fputs(" InnoDB: You are trying to drop table ", stderr); ut_print_name(stderr, table->name); - fputs("\n" - "InnoDB: though there is a foreign key check running on it.\n" - "InnoDB: Adding the table to the background drop queue.\n", + fputs("\n" +"InnoDB: though there is a foreign key check running on it.\n" +"InnoDB: Adding the table to the background drop queue.\n", stderr); - row_add_table_to_background_drop_list(table); + /* We return DB_SUCCESS to MySQL though the drop will + happen lazily later */ - err = DB_SUCCESS; + err = DB_SUCCESS; + } else { + /* The table is already in the background drop list */ + err = DB_ERROR; + } goto funct_exit; } From 0ab90532cc54bfa81204ab2129de7124d8aac376 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 27 Dec 2004 19:10:30 +0100 Subject: [PATCH 0602/1063] WL#2319 V2: Exclude tables from dump - Added a hash to keep track of database-table pairs. - Specified database-table tables do not get dumped client/client_priv.h: WL#2319 V2: Exclude tables from dump client/mysqldump.c: WL#2319 V2: Exclude tables from dump mysql-test/r/mysqldump.result: WL#2319 V2: Exclude tables from dump mysql-test/t/mysqldump.test: WL#2319 V2: Exclude tables from dump --- client/client_priv.h | 1 + client/mysqldump.c | 106 +++++++++++++++++++++++++++++++--- mysql-test/r/mysqldump.result | 33 +++++++++++ mysql-test/t/mysqldump.test | 12 ++++ 4 files changed, 145 insertions(+), 7 deletions(-) diff --git a/client/client_priv.h b/client/client_priv.h index e86a56f58c1..95f4d105156 100644 --- a/client/client_priv.h +++ b/client/client_priv.h @@ -49,4 +49,5 @@ enum options_client #ifdef HAVE_NDBCLUSTER_DB ,OPT_NDBCLUSTER,OPT_NDB_CONNECTSTRING #endif + ,OPT_IGNORE_TABLE }; diff --git a/client/mysqldump.c b/client/mysqldump.c index be2abd19822..ffdb84397e9 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -43,6 +43,7 @@ #include #include #include +#include #include "client_priv.h" #include "mysql.h" @@ -128,6 +129,16 @@ const char *compatible_mode_names[]= TYPELIB compatible_mode_typelib= {array_elements(compatible_mode_names) - 1, "", compatible_mode_names, NULL}; +#define TABLE_RULE_HASH_SIZE 16 + +typedef struct st_table_rule_ent +{ + char* key; /* dbname.tablename */ + uint key_len; +} TABLE_RULE_ENT; + +my_bool ignore_table_inited; +HASH ignore_table; static struct my_option my_long_options[] = { @@ -233,6 +244,11 @@ static struct my_option my_long_options[] = (gptr*) &opt_hex_blob, (gptr*) &opt_hex_blob, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"host", 'h', "Connect to host.", (gptr*) ¤t_host, (gptr*) ¤t_host, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"ignore-table", OPT_IGNORE_TABLE, + "Do not dump the specified table. To specify more than one table to ignore, " + "use the directive multiple times, once for each table. Each table must " + "be specified with both database and table names, e.g. --ignore-table=database.table", + 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"lines-terminated-by", OPT_LTB, "Lines in the i.file are terminated by ...", (gptr*) &lines_terminated, (gptr*) &lines_terminated, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, @@ -502,6 +518,32 @@ static void write_footer(FILE *sql_file) } /* write_footer */ +static void free_table_ent(TABLE_RULE_ENT* e) +{ + my_free((gptr) e, MYF(0)); +} + + +static byte* get_table_key(TABLE_RULE_ENT* e, uint* len, + my_bool not_used __attribute__((unused))) +{ + *len= e->key_len; + return (byte*)e->key; +} + + +void init_table_rule_hash(HASH* h, bool* h_inited) +{ + if(hash_init(h, charset_info, TABLE_RULE_HASH_SIZE, 0, 0, + (hash_get_key) get_table_key, + (hash_free_key) free_table_ent, 0)) + { + fprintf(stderr, "Internal hash initialization error\n"); + exit(1); + } + *h_inited= 1; +} + static my_bool get_one_option(int optid, const struct my_option *opt __attribute__((unused)), @@ -573,6 +615,37 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), case (int) OPT_TABLES: opt_databases=0; break; + case (int) OPT_IGNORE_TABLE: + { + const char* dot = strchr(argument, '.'); + if (!dot) + { + fprintf(stderr, "Illegal use of option --ignore-table=.\n"); + exit(1); + } + // len is always > 0 because we know the there exists a '.' + uint len= (uint)strlen(argument); + TABLE_RULE_ENT* e= (TABLE_RULE_ENT*)my_malloc(sizeof(TABLE_RULE_ENT) + + len, MYF(MY_WME)); + if (!e) + { + fprintf(stderr, "Internal memory allocation error\n"); + exit(1); + } + e->key= (char*)e + sizeof(TABLE_RULE_ENT); + e->key_len= len; + memcpy(e->key, argument, len); + + if (!ignore_table_inited) + init_table_rule_hash(&ignore_table, &ignore_table_inited); + + if(my_hash_insert(&ignore_table, (byte*)e)) + { + fprintf(stderr, "Internal hash insert error\n"); + exit(1); + } + break; + } case (int) OPT_COMPATIBLE: { char buff[255]; @@ -1946,6 +2019,15 @@ static int init_dumping(char *database) } /* init_dumping */ +my_bool include_table(byte* hash_key, uint len) +{ + if (ignore_table_inited && + hash_search(&ignore_table, (byte*) hash_key, len)) + return FALSE; + + return TRUE; +} + static int dump_all_tables_in_db(char *database) { @@ -1953,6 +2035,12 @@ static int dump_all_tables_in_db(char *database) uint numrows; char table_buff[NAME_LEN*2+3]; + char hash_key[2*NAME_LEN+2]; /* "db.tablename" */ + char *afterdot; + + afterdot= strmov(hash_key, database); + *afterdot++= '.'; + if (init_dumping(database)) return 1; if (opt_xml) @@ -1961,7 +2049,7 @@ static int dump_all_tables_in_db(char *database) { DYNAMIC_STRING query; init_dynamic_string(&query, "LOCK TABLES ", 256, 1024); - for (numrows=0 ; (table = getTableName(1)) ; numrows++) + for (numrows= 0 ; (table= getTableName(1)) ; numrows++) { dynstr_append(&query, quote_name(table, table_buff, 1)); dynstr_append(&query, " READ /*!32311 LOCAL */,"); @@ -1977,13 +2065,17 @@ static int dump_all_tables_in_db(char *database) DBerror(sock, "when doing refresh"); /* We shall continue here, if --force was given */ } - while ((table = getTableName(0))) + while ((table= getTableName(0))) { - numrows = getTableStructure(table, database); - if (!dFlag && numrows > 0) - dumpTable(numrows,table); - my_free(order_by, MYF(MY_ALLOW_ZERO_PTR)); - order_by= 0; + char *end= strmov(afterdot, table); + if (include_table(hash_key, end - hash_key)) + { + numrows = getTableStructure(table, database); + if (!dFlag && numrows > 0) + dumpTable(numrows,table); + my_free(order_by, MYF(MY_ALLOW_ZERO_PTR)); + order_by= 0; + } } if (opt_xml) { diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index 57e04d38fc1..623bd2a0f3c 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -480,3 +480,36 @@ UNLOCK TABLES; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; DROP TABLE t1; +CREATE TABLE t1 (a int); +CREATE TABLE t2 (a int); +INSERT INTO t1 VALUES (1),(2),(3); +INSERT INTO t2 VALUES (4),(5),(6); + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */; +DROP TABLE IF EXISTS `t2`; +CREATE TABLE `t2` ( + `a` int(11) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + + +/*!40000 ALTER TABLE `t2` DISABLE KEYS */; +LOCK TABLES `t2` WRITE; +INSERT INTO `t2` VALUES (4),(5),(6); +UNLOCK TABLES; +/*!40000 ALTER TABLE `t2` ENABLE KEYS */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; + +DROP TABLE t1; +DROP TABLE t2; diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test index 07b33689196..255ae50a8ca 100644 --- a/mysql-test/t/mysqldump.test +++ b/mysql-test/t/mysqldump.test @@ -153,3 +153,15 @@ INSERT INTO t1 VALUES (_latin1 ' --exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments --default-character-set=cp850 --compatible=mysql323 test t1 --exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments --default-character-set=utf8 --compatible=mysql323 test t1 DROP TABLE t1; + +# +# WL #2319: Exclude Tables from dump +# + +CREATE TABLE t1 (a int); +CREATE TABLE t2 (a int); +INSERT INTO t1 VALUES (1),(2),(3); +INSERT INTO t2 VALUES (4),(5),(6); +--exec $MYSQL_DUMP --skip-comments --ignore-table=test.t1 test +DROP TABLE t1; +DROP TABLE t2; From 05fb4757f984607737999b86dc052b5c91bf5bd8 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 27 Dec 2004 21:22:06 +0200 Subject: [PATCH 0603/1063] row0mysql.c: Manually merge the latest FOREIGN KEY lock wait + DROP TABLE fix from 4.0 innobase/row/row0mysql.c: Manually merge the latest FOREIGN KEY lock wait + DROP TABLE fix from 4.0 --- innobase/row/row0mysql.c | 105 +++++++++++++++++++++++++-------------- 1 file changed, 69 insertions(+), 36 deletions(-) diff --git a/innobase/row/row0mysql.c b/innobase/row/row0mysql.c index e2b89cba866..b7cd730828a 100644 --- a/innobase/row/row0mysql.c +++ b/innobase/row/row0mysql.c @@ -1843,16 +1843,9 @@ row_drop_table_for_mysql_in_background( ut_print_name(stderr, name); fputs(" in background drop list\n", stderr); */ - /* Drop the table in InnoDB */ + /* Try to drop the table in InnoDB */ error = row_drop_table_for_mysql(name, trx, FALSE); - - if (error != DB_SUCCESS) { - ut_print_timestamp(stderr); - fputs(" InnoDB: Error: Dropping table ", stderr); - ut_print_name(stderr, trx, name); - fputs(" in background drop list failed\n", stderr); - } /* Flush the log to reduce probability that the .frm files and the InnoDB data dictionary get out-of-sync if the user runs @@ -1864,7 +1857,7 @@ row_drop_table_for_mysql_in_background( trx_free_for_background(trx); - return(DB_SUCCESS); + return(error); } /************************************************************************* @@ -1898,6 +1891,7 @@ loop: mutex_exit(&kernel_mutex); if (drop == NULL) { + /* All tables dropped */ return(n_tables + n_tables_dropped); } @@ -1965,21 +1959,21 @@ row_get_background_drop_list_len_low(void) } /************************************************************************* -Adds a table to the list of tables which the master thread drops in -background. We need this on Unix because in ALTER TABLE MySQL may call -drop table even if the table has running queries on it. */ +If a table is not yet in the drop list, adds the table to the list of tables +which the master thread drops in background. We need this on Unix because in +ALTER TABLE MySQL may call drop table even if the table has running queries on +it. Also, if there are running foreign key checks on the table, we drop the +table lazily. */ static -void +ibool row_add_table_to_background_drop_list( /*==================================*/ + /* out: TRUE if the table was not yet in the + drop list, and was added there */ dict_table_t* table) /* in: table */ { row_mysql_drop_t* drop; - drop = mem_alloc(sizeof(row_mysql_drop_t)); - - drop->table_name = mem_strdup(table->name); - mutex_enter(&kernel_mutex); if (!row_mysql_drop_list_inited) { @@ -1987,7 +1981,26 @@ row_add_table_to_background_drop_list( UT_LIST_INIT(row_mysql_drop_list); row_mysql_drop_list_inited = TRUE; } + + /* Look if the table already is in the drop list */ + drop = UT_LIST_GET_FIRST(row_mysql_drop_list); + while (drop != NULL) { + if (strcmp(drop->table_name, table->name) == 0) { + /* Already in the list */ + + mutex_exit(&kernel_mutex); + + return(FALSE); + } + + drop = UT_LIST_GET_NEXT(row_mysql_drop_list, drop); + } + + drop = mem_alloc(sizeof(row_mysql_drop_t)); + + drop->table_name = mem_strdup(table->name); + UT_LIST_ADD_LAST(row_mysql_drop_list, row_mysql_drop_list, drop); /* fputs("InnoDB: Adding table ", stderr); @@ -1995,6 +2008,8 @@ row_add_table_to_background_drop_list( fputs(" to background drop list\n", stderr); */ mutex_exit(&kernel_mutex); + + return(TRUE); } /************************************************************************* @@ -2347,7 +2362,7 @@ funct_exit: } /************************************************************************* -Drops a table for MySQL. If the name of the table to be dropped is equal +Drops a table for MySQL. If the name of the table to be dropped is equal with one of the predefined magic table names, then this also stops printing the corresponding monitor output by the master thread. */ @@ -2581,19 +2596,27 @@ row_drop_table_for_mysql( } if (table->n_mysql_handles_opened > 0) { + ibool added; - ut_print_timestamp(stderr); - fputs(" InnoDB: Warning: MySQL is trying to drop table ", - stderr); - ut_print_name(stderr, trx, table->name); - fputs("\n" - "InnoDB: though there are still open handles to it.\n" - "InnoDB: Adding the table to the background drop queue.\n", + added = row_add_table_to_background_drop_list(table); + + if (added) { + ut_print_timestamp(stderr); +fputs(" InnoDB: Warning: MySQL is trying to drop table ", stderr); + ut_print_name(stderr, trx, table->name); + fputs("\n" +"InnoDB: though there are still open handles to it.\n" +"InnoDB: Adding the table to the background drop queue.\n", stderr); + + /* We return DB_SUCCESS to MySQL though the drop will + happen lazily later */ - row_add_table_to_background_drop_list(table); - - err = DB_SUCCESS; + err = DB_SUCCESS; + } else { + /* The table is already in the background drop list */ + err = DB_ERROR; + } goto funct_exit; } @@ -2606,17 +2629,27 @@ row_drop_table_for_mysql( if (table->n_foreign_key_checks_running > 0) { - ut_print_timestamp(stderr); - fputs(" InnoDB: You are trying to drop table ", stderr); - ut_print_name(stderr, trx, table->name); - fputs("\n" - "InnoDB: though there is a foreign key check running on it.\n" - "InnoDB: Adding the table to the background drop queue.\n", + ibool added; + + added = row_add_table_to_background_drop_list(table); + + if (added) { + ut_print_timestamp(stderr); +fputs(" InnoDB: You are trying to drop table ", stderr); + ut_print_name(stderr, trx, table->name); + fputs("\n" +"InnoDB: though there is a foreign key check running on it.\n" +"InnoDB: Adding the table to the background drop queue.\n", stderr); - row_add_table_to_background_drop_list(table); + /* We return DB_SUCCESS to MySQL though the drop will + happen lazily later */ - err = DB_SUCCESS; + err = DB_SUCCESS; + } else { + /* The table is already in the background drop list */ + err = DB_ERROR; + } goto funct_exit; } From 8487aa5abc384de074681f71e67a8b7b0570baf2 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 28 Dec 2004 11:57:56 +0200 Subject: [PATCH 0604/1063] Fix for BUG#7455. The fix checks if the trim string argument is NULL. If so, the standard mandates that the function result must be also NULL. mysql-test/r/func_str.result: added test result mysql-test/t/func_str.test: Added test for NULL arguments. sql/item_strfunc.cc: Test if the trim argument is NULL. --- mysql-test/r/func_str.result | 6 ++++++ mysql-test/t/func_str.test | 8 ++++++++ sql/item_strfunc.cc | 11 ++++++++++- 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result index 1c560dfa8b4..8348ef12b0d 100644 --- a/mysql-test/r/func_str.result +++ b/mysql-test/r/func_str.result @@ -697,3 +697,9 @@ quote(ltrim(concat(' ', 'a'))) select quote(trim(concat(' ', 'a'))); quote(trim(concat(' ', 'a'))) 'a' +select trim(null from 'kate') as "must_be_null"; +must_be_null +NULL +select trim('xyz' from null) as "must_be_null"; +must_be_null +NULL diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test index 5477a0ccb30..a5d95332caa 100644 --- a/mysql-test/t/func_str.test +++ b/mysql-test/t/func_str.test @@ -435,3 +435,11 @@ drop table t1; select quote(ltrim(concat(' ', 'a'))); select quote(trim(concat(' ', 'a'))); + +# +# Bug#7455 unexpected result: TRIM( FROM ) gives NOT NULL +# According to ANSI if one of the TRIM arguments is NULL, then the result +# must be NULL too. +# +select trim(null from 'kate') as "must_be_null"; +select trim('xyz' from null) as "must_be_null"; diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 068878652e4..2a63c5355a4 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -1302,9 +1302,18 @@ String *Item_func_trim::val_str(String *str) return 0; /* purecov: inspected */ char buff[MAX_FIELD_WIDTH]; String tmp(buff,sizeof(buff),res->charset()); - String *remove_str= (arg_count==2) ? args[1]->val_str(&tmp) : &remove; uint remove_length; LINT_INIT(remove_length); + String *remove_str; /* The string to remove from res. */ + + if (arg_count == 2) + { + remove_str= args[1]->val_str(&tmp); + if ((null_value= args[1]->null_value)) + return 0; + } + else + remove_str= &remove; /* Default value. */ if (!remove_str || (remove_length=remove_str->length()) == 0 || remove_length > res->length()) From 0ebb5292f8f525fe70f90a6da972c7fc10811c62 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 28 Dec 2004 17:33:49 +0100 Subject: [PATCH 0605/1063] client/mysqldump.c compilation failure fixed cleanup client/mysqldump.c: compilation failure fixed cleanup --- client/mysqldump.c | 43 +++++++++++++++---------------------------- 1 file changed, 15 insertions(+), 28 deletions(-) diff --git a/client/mysqldump.c b/client/mysqldump.c index ffdb84397e9..98de9e0b069 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -137,7 +137,6 @@ typedef struct st_table_rule_ent uint key_len; } TABLE_RULE_ENT; -my_bool ignore_table_inited; HASH ignore_table; static struct my_option my_long_options[] = @@ -532,16 +531,12 @@ static byte* get_table_key(TABLE_RULE_ENT* e, uint* len, } -void init_table_rule_hash(HASH* h, bool* h_inited) +void init_table_rule_hash(HASH* h) { if(hash_init(h, charset_info, TABLE_RULE_HASH_SIZE, 0, 0, (hash_get_key) get_table_key, (hash_free_key) free_table_ent, 0)) - { - fprintf(stderr, "Internal hash initialization error\n"); - exit(1); - } - *h_inited= 1; + exit(EX_EOM); } @@ -617,37 +612,30 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), break; case (int) OPT_IGNORE_TABLE: { - const char* dot = strchr(argument, '.'); - if (!dot) + uint len= (uint)strlen(argument); + TABLE_RULE_ENT* e; + if (!strchr(argument, '.')) { fprintf(stderr, "Illegal use of option --ignore-table=.
\n"); exit(1); } - // len is always > 0 because we know the there exists a '.' - uint len= (uint)strlen(argument); - TABLE_RULE_ENT* e= (TABLE_RULE_ENT*)my_malloc(sizeof(TABLE_RULE_ENT) - + len, MYF(MY_WME)); - if (!e) - { - fprintf(stderr, "Internal memory allocation error\n"); - exit(1); - } + /* len is always > 0 because we know the there exists a '.' */ + e= (TABLE_RULE_ENT*)my_malloc(sizeof(TABLE_RULE_ENT) + len, MYF(MY_WME)); + if (!e) + exit(EX_EOM); e->key= (char*)e + sizeof(TABLE_RULE_ENT); e->key_len= len; memcpy(e->key, argument, len); - if (!ignore_table_inited) - init_table_rule_hash(&ignore_table, &ignore_table_inited); - + if (!hash_inited(&ignore_table)) + init_table_rule_hash(&ignore_table); + if(my_hash_insert(&ignore_table, (byte*)e)) - { - fprintf(stderr, "Internal hash insert error\n"); - exit(1); - } + exit(EX_EOM); break; } case (int) OPT_COMPATIBLE: - { + { char buff[255]; char *end= compatible_mode_normal_str; int i; @@ -2021,8 +2009,7 @@ static int init_dumping(char *database) my_bool include_table(byte* hash_key, uint len) { - if (ignore_table_inited && - hash_search(&ignore_table, (byte*) hash_key, len)) + if (hash_search(&ignore_table, (byte*) hash_key, len)) return FALSE; return TRUE; From 49501611aa534efcd18d3ee3bf94ec1ba13aa6f2 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 29 Dec 2004 17:06:26 +0200 Subject: [PATCH 0606/1063] srv0start.c: Print a more descriptive error and refuse to start InnoDB if the size of ibdata files is smaller than what is stored in the tablespace header; innodb_force_recovery will override this innobase/srv/srv0start.c: Print a more descriptive error and refuse to start InnoDB if the size of ibdata files is smaller than what is stored in the tablespace header; innodb_force_recovery will override this --- innobase/srv/srv0start.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/innobase/srv/srv0start.c b/innobase/srv/srv0start.c index c91db1f0dcc..7a61a885ef9 100644 --- a/innobase/srv/srv0start.c +++ b/innobase/srv/srv0start.c @@ -1528,6 +1528,21 @@ NetWare. */ "InnoDB: the sum of data file sizes is %lu pages\n", (ulong) tablespace_size_in_header, (ulong) sum_of_data_file_sizes); + + if (srv_force_recovery == 0 + && sum_of_data_file_sizes < tablespace_size_in_header) { + /* This is a fatal error, the tail of a tablespace is + missing */ + + fprintf(stderr, +"InnoDB: Cannot start InnoDB. The tail of the system tablespace is\n" +"InnoDB: missing. Have you edited innodb_data_file_path in my.cnf in an\n" +"InnoDB: inappropriate way, removing ibdata files from there?\n" +"InnoDB: You can set innodb_force_recovery=1 in my.cnf to force\n" +"InnoDB: a startup if you are trying to recover a badly corrupt database.\n"); + + return(DB_ERROR); + } } if (srv_auto_extend_last_data_file @@ -1538,6 +1553,18 @@ NetWare. */ "InnoDB: the sum of data file sizes is only %lu pages\n", (ulong) tablespace_size_in_header, (ulong) sum_of_data_file_sizes); + + if (srv_force_recovery == 0) { + + fprintf(stderr, +"InnoDB: Cannot start InnoDB. The tail of the system tablespace is\n" +"InnoDB: missing. Have you edited innodb_data_file_path in my.cnf in an\n" +"InnoDB: inappropriate way, removing ibdata files from there?\n" +"InnoDB: You can set innodb_force_recovery=1 in my.cnf to force\n" +"InnoDB: a startup if you are trying to recover a badly corrupt database.\n"); + + return(DB_ERROR); + } } /* Check that os_fast_mutexes work as expected */ From 1382df5aff42233669ed5b0b76dfd459f8d87c05 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 30 Dec 2004 13:39:01 +0300 Subject: [PATCH 0607/1063] Fix for bug #6914 "Problems using time()/date() output in expressions". When we cast datetime value to DATE (TIME) type we should throw away its time (date) part. This was not done properly if CAST() function was used in datetime expressions. mysql-test/r/cast.result: Added test for bug #6914 "Problems using time()/date() output in expressions". mysql-test/t/cast.test: Added test for bug #6914 "Problems using time()/date() output in expressions". sql/item_timefunc.cc: Item_time_typecast::get_time()/Item_date_typecast::get_date(): When we cast datetime value to DATE we should throw away its time part. When we cast such value to TIME type we should throw away its date part. --- mysql-test/r/cast.result | 9 +++++++++ mysql-test/t/cast.test | 10 ++++++++++ sql/item_timefunc.cc | 7 +++++++ 3 files changed, 26 insertions(+) diff --git a/mysql-test/r/cast.result b/mysql-test/r/cast.result index ccf75f68e88..636e2603f9b 100644 --- a/mysql-test/r/cast.result +++ b/mysql-test/r/cast.result @@ -178,3 +178,12 @@ aaa aa aab aa aac aa DROP TABLE t1; +select date_add(cast('2004-12-30 12:00:00' as date), interval 0 hour); +date_add(cast('2004-12-30 12:00:00' as date), interval 0 hour) +2004-12-30 00:00:00 +select timediff(cast('2004-12-30 12:00:00' as time), '12:00:00'); +timediff(cast('2004-12-30 12:00:00' as time), '12:00:00') +00:00:00 +select timediff(cast('1 12:00:00' as time), '12:00:00'); +timediff(cast('1 12:00:00' as time), '12:00:00') +24:00:00 diff --git a/mysql-test/t/cast.test b/mysql-test/t/cast.test index e5681dedbac..23bba7d5aff 100644 --- a/mysql-test/t/cast.test +++ b/mysql-test/t/cast.test @@ -108,3 +108,13 @@ SELECT a, CAST(a AS CHAR(3)) FROM t1 ORDER BY CAST(a AS CHAR(2)), a; SELECT a, CAST(a AS UNSIGNED) FROM t1 ORDER BY CAST(a AS CHAR) ; SELECT a, CAST(a AS CHAR(2)) FROM t1 ORDER BY CAST(a AS CHAR(3)), a; DROP TABLE t1; + +# +# Test for bug #6914 "Problems using time()/date() output in expressions". +# When we are casting datetime value to DATE/TIME we should throw away +# time/date parts (correspondingly). +# +select date_add(cast('2004-12-30 12:00:00' as date), interval 0 hour); +select timediff(cast('2004-12-30 12:00:00' as time), '12:00:00'); +# Still we should not throw away "days" part of time value +select timediff(cast('1 12:00:00' as time), '12:00:00'); diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index 84a9e01ed2a..054a9966e73 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -2183,6 +2183,12 @@ String *Item_datetime_typecast::val_str(String *str) bool Item_time_typecast::get_time(TIME *ltime) { bool res= get_arg0_time(ltime); + /* + For MYSQL_TIMESTAMP_TIME value we can have non-zero day part, + which we should not lose. + */ + if (ltime->time_type == MYSQL_TIMESTAMP_DATETIME) + ltime->year= ltime->month= ltime->day= 0; ltime->time_type= MYSQL_TIMESTAMP_TIME; return res; } @@ -2206,6 +2212,7 @@ String *Item_time_typecast::val_str(String *str) bool Item_date_typecast::get_date(TIME *ltime, uint fuzzy_date) { bool res= get_arg0_date(ltime,1); + ltime->hour= ltime->minute= ltime->second= ltime->second_part= 0; ltime->time_type= MYSQL_TIMESTAMP_DATE; return res; } From c1f1732f376c53431e9f55976df4f314978e1d77 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 30 Dec 2004 14:56:31 +0300 Subject: [PATCH 0608/1063] Fix func_concat.result: allow -0.00 to be converted to string both with and without leading minus --- mysql-test/r/func_concat.result | 6 +----- mysql-test/t/func_concat.test | 4 ++-- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/mysql-test/r/func_concat.result b/mysql-test/r/func_concat.result index 0bd53b32dd7..cf6fbf2da4f 100644 --- a/mysql-test/r/func_concat.result +++ b/mysql-test/r/func_concat.result @@ -63,8 +63,4 @@ a0 select 'a' union select concat('a', -0.0); a a -a0.0 -select 'a' union select concat('a', -0.0000); -a -a -a0.0000 +good diff --git a/mysql-test/t/func_concat.test b/mysql-test/t/func_concat.test index 78818cdda4e..b94901e9966 100644 --- a/mysql-test/t/func_concat.test +++ b/mysql-test/t/func_concat.test @@ -46,7 +46,7 @@ select 'a' union select concat('a', -'3'); select 'a' union select concat('a', -concat('3',4)); select 'a' union select concat('a', -0); + +--replace_result 'a-0.0' good 'a0.0' good select 'a' union select concat('a', -0.0); -select 'a' union select concat('a', -0.0000); - From f116ac5cdd84cf7e85aa9803e31e9d506c906f95 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 30 Dec 2004 14:03:19 +0100 Subject: [PATCH 0609/1063] Clean up the handling of "server" and "client" directories, while still avoiding the double listing of common directories in 'SUBDIRS' macro ("make distclean" had failed due to that). Solves bug#7368: "regex make error in 4.1.8" BitKeeper/etc/ignore: Added ndb/include/ndb_version.h ndb/include/ndb_global.h to the ignore list Makefile.am: Build the 'SUBDIRS' list from the new variable 'sql_union_dirs', not the old "client" and "servers" lists which will overlap. That overlap worked for build runs, but it caused failures of 'make distclean' etc because the overlapping directories were cleaned twice which could not work. Solves bug#7368: "regex make error in 4.1.8" configure.in: Introduce a new variable 'sql_union_dirs' to contain those directories which are needed for either server or client. This is needed to have complete "server" and "client" directory lists in 'Makefile' but prevent double listing in 'SUBDIRS' (see the comment for 'Makefile.am'). Solves bug#7368: "regex make error in 4.1.8" --- .bzrignore | 2 ++ Makefile.am | 4 ++-- configure.in | 16 +++++++++++++++- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/.bzrignore b/.bzrignore index 37f82b008f8..ee48342fd37 100644 --- a/.bzrignore +++ b/.bzrignore @@ -946,3 +946,5 @@ libmysqld/ha_tina.cc analyse.test client/mysqladmin.c mysql-4.1.8-win-src.zip +ndb/include/ndb_version.h +ndb/include/ndb_global.h diff --git a/Makefile.am b/Makefile.am index c1ae9217e8b..93f34986a1b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -23,14 +23,14 @@ EXTRA_DIST = INSTALL-SOURCE README COPYING EXCEPTIONS-CLIENT SUBDIRS = . include @docs_dirs@ @zlib_dir@ \ @readline_topdir@ sql-common \ @thread_dirs@ pstack \ - @sql_server_dirs@ @sql_client_dirs@ scripts man tests \ + @sql_union_dirs@ scripts man tests \ netware @libmysqld_dirs@ \ @bench_dirs@ support-files @fs_dirs@ @tools_dirs@ DIST_SUBDIRS = . include @docs_dirs@ zlib \ @readline_topdir@ sql-common \ @thread_dirs@ pstack \ - @sql_server_dirs@ @sql_client_dirs@ scripts @man_dirs@ tests SSL\ + @sql_union_dirs@ scripts @man_dirs@ tests SSL\ BUILD netware os2 @libmysqld_dirs@ \ @bench_dirs@ support-files @fs_dirs@ @tools_dirs@ diff --git a/configure.in b/configure.in index bc78c9c8764..ce3ae9c8dff 100644 --- a/configure.in +++ b/configure.in @@ -2832,7 +2832,7 @@ thread_dirs= dnl This probably should be cleaned up more - for now the threaded dnl client is just using plain-old libs. -sql_client_dirs="libmysql client" +sql_client_dirs="libmysql strings regex client" linked_client_targets="linked_libmysql_sources" CLIENT_LIBS=$NON_THREADED_CLIENT_LIBS if test "$THREAD_SAFE_CLIENT" != "no" @@ -3014,6 +3014,20 @@ AC_SUBST(sql_server_dirs) AC_SUBST(thread_dirs) AC_SUBST(server_scripts) +# Now that sql_client_dirs and sql_server_dirs are stable, determine the union. +# Start with the (longer) server list, add each client item not yet present. +sql_union_dirs=" $sql_server_dirs " +for DIR in $sql_client_dirs +do + if echo $sql_union_dirs | grep " $DIR " >/dev/null + then + : # already present, skip + else + sql_union_dirs="$sql_union_dirs $DIR " + fi +done +AC_SUBST(sql_union_dirs) + #if test "$with_posix_threads" = "no" -o "$with_mit_threads" = "yes" #then # MIT pthreads does now support connecting with unix sockets From 4ad77748b3ad558d4807d9aa31174eb8f72b90be Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 30 Dec 2004 16:34:01 +0100 Subject: [PATCH 0610/1063] Many files: Perl version of mysql-test-run new file mysql-test/lib/init_db.sql: Perl version of mysql-test-run mysql-test/lib/mtr_gcov.pl: Perl version of mysql-test-run mysql-test/lib/mtr_gprof.pl: Perl version of mysql-test-run mysql-test/lib/mtr_io.pl: Perl version of mysql-test-run mysql-test/lib/mtr_match.pl: Perl version of mysql-test-run mysql-test/lib/mtr_misc.pl: Perl version of mysql-test-run mysql-test/lib/mtr_process.pl: Perl version of mysql-test-run mysql-test/lib/mtr_report.pl: Perl version of mysql-test-run mysql-test/mysql-test-run.pl: Perl version of mysql-test-run --- mysql-test/lib/init_db.sql | 54 + mysql-test/lib/mtr_gcov.pl | 44 + mysql-test/lib/mtr_gprof.pl | 50 + mysql-test/lib/mtr_io.pl | 71 ++ mysql-test/lib/mtr_match.pl | 67 ++ mysql-test/lib/mtr_misc.pl | 50 + mysql-test/lib/mtr_process.pl | 421 +++++++ mysql-test/lib/mtr_report.pl | 257 +++++ mysql-test/mysql-test-run.pl | 1975 +++++++++++++++++++++++++++++++++ 9 files changed, 2989 insertions(+) create mode 100644 mysql-test/lib/init_db.sql create mode 100644 mysql-test/lib/mtr_gcov.pl create mode 100644 mysql-test/lib/mtr_gprof.pl create mode 100644 mysql-test/lib/mtr_io.pl create mode 100644 mysql-test/lib/mtr_match.pl create mode 100644 mysql-test/lib/mtr_misc.pl create mode 100644 mysql-test/lib/mtr_process.pl create mode 100644 mysql-test/lib/mtr_report.pl create mode 100755 mysql-test/mysql-test-run.pl diff --git a/mysql-test/lib/init_db.sql b/mysql-test/lib/init_db.sql new file mode 100644 index 00000000000..f42f7ca6b5f --- /dev/null +++ b/mysql-test/lib/init_db.sql @@ -0,0 +1,54 @@ +USE mysql; + +CREATE TABLE db (Host char(60) binary DEFAULT '' NOT NULL,Db char(64) binary DEFAULT '' NOT NULL,User char(16) binary DEFAULT '' NOT NULL,Select_priv enum('N','Y') DEFAULT 'N' NOT NULL,Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL,Update_priv enum('N','Y') DEFAULT 'N' NOT NULL,Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL,Create_priv enum('N','Y') DEFAULT 'N' NOT NULL,Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL,Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL,References_priv enum('N','Y') DEFAULT 'N' NOT NULL,Index_priv enum('N','Y') DEFAULT 'N' NOT NULL,Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL,Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL,Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL,PRIMARY KEY Host (Host,Db,User),KEY User (User)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Database privileges'; + +INSERT INTO db VALUES ('%','test','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y'); +INSERT INTO db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y'); + + +CREATE TABLE host (Host char(60) binary DEFAULT '' NOT NULL,Db char(64) binary DEFAULT '' NOT NULL,Select_priv enum('N','Y') DEFAULT 'N' NOT NULL,Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL,Update_priv enum('N','Y') DEFAULT 'N' NOT NULL,Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL,Create_priv enum('N','Y') DEFAULT 'N' NOT NULL,Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL,Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL,References_priv enum('N','Y') DEFAULT 'N' NOT NULL,Index_priv enum('N','Y') DEFAULT 'N' NOT NULL,Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL,Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL,Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL,PRIMARY KEY Host (Host,Db)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Host privileges; Merged with database privileges'; + +CREATE TABLE user (Host char(60) binary DEFAULT '' NOT NULL,User char(16) binary DEFAULT '' NOT NULL,Password char(41) binary DEFAULT '' NOT NULL,Select_priv enum('N','Y') DEFAULT 'N' NOT NULL,Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL,Update_priv enum('N','Y') DEFAULT 'N' NOT NULL,Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL,Create_priv enum('N','Y') DEFAULT 'N' NOT NULL,Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL,Reload_priv enum('N','Y') DEFAULT 'N' NOT NULL,Shutdown_priv enum('N','Y') DEFAULT 'N' NOT NULL,Process_priv enum('N','Y') DEFAULT 'N' NOT NULL,File_priv enum('N','Y') DEFAULT 'N' NOT NULL,Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL,References_priv enum('N','Y') DEFAULT 'N' NOT NULL,Index_priv enum('N','Y') DEFAULT 'N' NOT NULL,Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL,Show_db_priv enum('N','Y') DEFAULT 'N' NOT NULL,Super_priv enum('N','Y') DEFAULT 'N' NOT NULL,Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL,Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL,Execute_priv enum('N','Y') DEFAULT 'N' NOT NULL,Repl_slave_priv enum('N','Y') DEFAULT 'N' NOT NULL,Repl_client_priv enum('N','Y') DEFAULT 'N' NOT NULL,ssl_type enum('','ANY','X509', 'SPECIFIED') DEFAULT '' NOT NULL,ssl_cipher BLOB NOT NULL,x509_issuer BLOB NOT NULL,x509_subject BLOB NOT NULL,max_questions int(11) unsigned DEFAULT 0 NOT NULL,max_updates int(11) unsigned DEFAULT 0 NOT NULL,max_connections int(11) unsigned DEFAULT 0 NOT NULL,PRIMARY KEY Host (Host,User)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Users and global privileges'; + +INSERT INTO user VALUES ('%','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); +INSERT INTO user VALUES ('localhost','','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); +INSERT INTO user VALUES ('%','','','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','','','','',0,0,0); + +CREATE TABLE func (name char(64) binary DEFAULT '' NOT NULL,ret tinyint(1) DEFAULT '0' NOT NULL,dl char(128) DEFAULT '' NOT NULL,type enum ('function','aggregate') NOT NULL,PRIMARY KEY (name)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='User defined functions'; + +CREATE TABLE tables_priv (Host char(60) binary DEFAULT '' NOT NULL,Db char(64) binary DEFAULT '' NOT NULL,User char(16) binary DEFAULT '' NOT NULL,Table_name char(64) binary DEFAULT '' NOT NULL,Grantor char(77) DEFAULT '' NOT NULL,Timestamp timestamp(14),Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') DEFAULT '' NOT NULL,Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL,PRIMARY KEY (Host,Db,User,Table_name),KEY Grantor (Grantor)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Table privileges'; + +CREATE TABLE columns_priv (Host char(60) binary DEFAULT '' NOT NULL,Db char(64) binary DEFAULT '' NOT NULL,User char(16) binary DEFAULT '' NOT NULL,Table_name char(64) binary DEFAULT '' NOT NULL,Column_name char(64) binary DEFAULT '' NOT NULL,Timestamp timestamp(14),Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL,PRIMARY KEY (Host,Db,User,Table_name,Column_name)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Column privileges'; + +CREATE TABLE help_topic (help_topic_id int unsigned not null,name varchar(64) not null,help_category_id smallint unsigned not null,description text not null,example text not null,url varchar(128) not null,primary key (help_topic_id),unique index (name)) engine=MyISAM CHARACTER SET utf8 comment='help topics'; + +CREATE TABLE help_category (help_category_id smallint unsigned not null,name varchar(64) not null,parent_category_id smallint unsigned null,url varchar(128) not null,primary key (help_category_id),unique index (name)) engine=MyISAM CHARACTER SET utf8 comment='help categories'; + +CREATE TABLE help_keyword (help_keyword_id int unsigned not null,name varchar(64) not null,primary key (help_keyword_id),unique index (name)) engine=MyISAM CHARACTER SET utf8 comment='help keywords'; + +CREATE TABLE help_relation (help_topic_id int unsigned not null references help_topic,help_keyword_id int unsigned not null references help_keyword,primary key (help_keyword_id, help_topic_id)) engine=MyISAM CHARACTER SET utf8 comment='keyword-topic relation'; + +CREATE TABLE time_zone_name (Name char(64) NOT NULL,Time_zone_id int unsigned NOT NULL,PRIMARY KEY Name (Name)) engine=MyISAM CHARACTER SET utf8 comment='Time zone names'; + +INSERT INTO time_zone_name (Name, Time_Zone_id) VALUES ('MET', 1), ('UTC', 2), ('Universal', 2), ('Europe/Moscow',3), ('leap/Europe/Moscow',4), ('Japan', 5); + + +CREATE TABLE time_zone (Time_zone_id int unsigned NOT NULL auto_increment,Use_leap_seconds enum('Y','N') DEFAULT 'N' NOT NULL,PRIMARY KEY TzId (Time_zone_id)) engine=MyISAM CHARACTER SET utf8 comment='Time zones'; + +INSERT INTO time_zone (Time_zone_id, Use_leap_seconds) VALUES (1,'N'), (2,'N'), (3,'N'), (4,'Y'), (5,'N'); + + +CREATE TABLE time_zone_transition (Time_zone_id int unsigned NOT NULL,Transition_time bigint signed NOT NULL,Transition_type_id int unsigned NOT NULL,PRIMARY KEY TzIdTranTime (Time_zone_id, Transition_time)) engine=MyISAM CHARACTER SET utf8 comment='Time zone transitions'; + +INSERT INTO time_zone_transition (Time_zone_id, Transition_time, Transition_type_id) VALUES (1, -1693706400, 0) ,(1, -1680483600, 1),(1, -1663455600, 2) ,(1, -1650150000, 3),(1, -1632006000, 2) ,(1, -1618700400, 3),(1, -938905200, 2) ,(1, -857257200, 3),(1, -844556400, 2) ,(1, -828226800, 3),(1, -812502000, 2) ,(1, -796777200, 3),(1, 228877200, 2) ,(1, 243997200, 3),(1, 260326800, 2) ,(1, 276051600, 3),(1, 291776400, 2) ,(1, 307501200, 3),(1, 323830800, 2) ,(1, 338950800, 3),(1, 354675600, 2) ,(1, 370400400, 3),(1, 386125200, 2) ,(1, 401850000, 3),(1, 417574800, 2) ,(1, 433299600, 3),(1, 449024400, 2) ,(1, 465354000, 3),(1, 481078800, 2) ,(1, 496803600, 3),(1, 512528400, 2) ,(1, 528253200, 3),(1, 543978000, 2) ,(1, 559702800, 3),(1, 575427600, 2) ,(1, 591152400, 3),(1, 606877200, 2) ,(1, 622602000, 3),(1, 638326800, 2) ,(1, 654656400, 3),(1, 670381200, 2) ,(1, 686106000, 3),(1, 701830800, 2) ,(1, 717555600, 3),(1, 733280400, 2) ,(1, 749005200, 3),(1, 764730000, 2) ,(1, 780454800, 3),(1, 796179600, 2) ,(1, 811904400, 3),(1, 828234000, 2) ,(1, 846378000, 3),(1, 859683600, 2) ,(1, 877827600, 3),(1, 891133200, 2) ,(1, 909277200, 3),(1, 922582800, 2) ,(1, 941331600, 3),(1, 954032400, 2) ,(1, 972781200, 3),(1, 985482000, 2) ,(1, 1004230800, 3),(1, 1017536400, 2) ,(1, 1035680400, 3),(1, 1048986000, 2) ,(1, 1067130000, 3),(1, 1080435600, 2) ,(1, 1099184400, 3),(1, 1111885200, 2) ,(1, 1130634000, 3),(1, 1143334800, 2) ,(1, 1162083600, 3),(1, 1174784400, 2) ,(1, 1193533200, 3),(1, 1206838800, 2) ,(1, 1224982800, 3),(1, 1238288400, 2) ,(1, 1256432400, 3),(1, 1269738000, 2) ,(1, 1288486800, 3),(1, 1301187600, 2) ,(1, 1319936400, 3),(1, 1332637200, 2) ,(1, 1351386000, 3),(1, 1364691600, 2) ,(1, 1382835600, 3),(1, 1396141200, 2) ,(1, 1414285200, 3),(1, 1427590800, 2) ,(1, 1445734800, 3),(1, 1459040400, 2) ,(1, 1477789200, 3),(1, 1490490000, 2) ,(1, 1509238800, 3),(1, 1521939600, 2) ,(1, 1540688400, 3),(1, 1553994000, 2) ,(1, 1572138000, 3),(1, 1585443600, 2) ,(1, 1603587600, 3),(1, 1616893200, 2) ,(1, 1635642000, 3),(1, 1648342800, 2) ,(1, 1667091600, 3),(1, 1679792400, 2) ,(1, 1698541200, 3),(1, 1711846800, 2) ,(1, 1729990800, 3),(1, 1743296400, 2) ,(1, 1761440400, 3),(1, 1774746000, 2) ,(1, 1792890000, 3),(1, 1806195600, 2) ,(1, 1824944400, 3),(1, 1837645200, 2) ,(1, 1856394000, 3),(1, 1869094800, 2) ,(1, 1887843600, 3),(1, 1901149200, 2) ,(1, 1919293200, 3),(1, 1932598800, 2) ,(1, 1950742800, 3),(1, 1964048400, 2) ,(1, 1982797200, 3),(1, 1995498000, 2) ,(1, 2014246800, 3),(1, 2026947600, 2) ,(1, 2045696400, 3),(1, 2058397200, 2) ,(1, 2077146000, 3),(1, 2090451600, 2) ,(1, 2108595600, 3),(1, 2121901200, 2) ,(1, 2140045200, 3),(3, -1688265000, 2) ,(3, -1656819048, 1),(3, -1641353448, 2) ,(3, -1627965048, 3),(3, -1618716648, 1) ,(3, -1596429048, 3),(3, -1593829848, 5) ,(3, -1589860800, 4),(3, -1542427200, 5) ,(3, -1539493200, 6),(3, -1525323600, 5) ,(3, -1522728000, 4),(3, -1491188400, 7) ,(3, -1247536800, 4),(3, 354920400, 5) ,(3, 370728000, 4),(3, 386456400, 5) ,(3, 402264000, 4),(3, 417992400, 5) ,(3, 433800000, 4),(3, 449614800, 5) ,(3, 465346800, 8),(3, 481071600, 9) ,(3, 496796400, 8),(3, 512521200, 9) ,(3, 528246000, 8),(3, 543970800, 9) ,(3, 559695600, 8),(3, 575420400, 9) ,(3, 591145200, 8),(3, 606870000, 9) ,(3, 622594800, 8),(3, 638319600, 9) ,(3, 654649200, 8),(3, 670374000, 10) ,(3, 686102400, 11),(3, 695779200, 8) ,(3, 701812800, 5),(3, 717534000, 4) ,(3, 733273200, 9),(3, 748998000, 8) ,(3, 764722800, 9),(3, 780447600, 8) ,(3, 796172400, 9),(3, 811897200, 8) ,(3, 828226800, 9),(3, 846370800, 8) ,(3, 859676400, 9),(3, 877820400, 8) ,(3, 891126000, 9),(3, 909270000, 8) ,(3, 922575600, 9),(3, 941324400, 8) ,(3, 954025200, 9),(3, 972774000, 8) ,(3, 985474800, 9),(3, 1004223600, 8) ,(3, 1017529200, 9),(3, 1035673200, 8) ,(3, 1048978800, 9),(3, 1067122800, 8) ,(3, 1080428400, 9),(3, 1099177200, 8) ,(3, 1111878000, 9),(3, 1130626800, 8) ,(3, 1143327600, 9),(3, 1162076400, 8) ,(3, 1174777200, 9),(3, 1193526000, 8) ,(3, 1206831600, 9),(3, 1224975600, 8) ,(3, 1238281200, 9),(3, 1256425200, 8) ,(3, 1269730800, 9),(3, 1288479600, 8) ,(3, 1301180400, 9),(3, 1319929200, 8) ,(3, 1332630000, 9),(3, 1351378800, 8) ,(3, 1364684400, 9),(3, 1382828400, 8) ,(3, 1396134000, 9),(3, 1414278000, 8) ,(3, 1427583600, 9),(3, 1445727600, 8) ,(3, 1459033200, 9),(3, 1477782000, 8) ,(3, 1490482800, 9),(3, 1509231600, 8) ,(3, 1521932400, 9),(3, 1540681200, 8) ,(3, 1553986800, 9),(3, 1572130800, 8) ,(3, 1585436400, 9),(3, 1603580400, 8) ,(3, 1616886000, 9),(3, 1635634800, 8) ,(3, 1648335600, 9),(3, 1667084400, 8) ,(3, 1679785200, 9),(3, 1698534000, 8) ,(3, 1711839600, 9),(3, 1729983600, 8) ,(3, 1743289200, 9),(3, 1761433200, 8) ,(3, 1774738800, 9),(3, 1792882800, 8) ,(3, 1806188400, 9),(3, 1824937200, 8) ,(3, 1837638000, 9),(3, 1856386800, 8) ,(3, 1869087600, 9),(3, 1887836400, 8) ,(3, 1901142000, 9),(3, 1919286000, 8) ,(3, 1932591600, 9),(3, 1950735600, 8) ,(3, 1964041200, 9),(3, 1982790000, 8) ,(3, 1995490800, 9),(3, 2014239600, 8) ,(3, 2026940400, 9),(3, 2045689200, 8) ,(3, 2058390000, 9),(3, 2077138800, 8) ,(3, 2090444400, 9),(3, 2108588400, 8) ,(3, 2121894000, 9),(3, 2140038000, 8),(4, -1688265000, 2) ,(4, -1656819048, 1),(4, -1641353448, 2) ,(4, -1627965048, 3),(4, -1618716648, 1) ,(4, -1596429048, 3),(4, -1593829848, 5) ,(4, -1589860800, 4),(4, -1542427200, 5) ,(4, -1539493200, 6),(4, -1525323600, 5) ,(4, -1522728000, 4),(4, -1491188400, 7) ,(4, -1247536800, 4),(4, 354920409, 5) ,(4, 370728010, 4),(4, 386456410, 5) ,(4, 402264011, 4),(4, 417992411, 5) ,(4, 433800012, 4),(4, 449614812, 5) ,(4, 465346812, 8),(4, 481071612, 9) ,(4, 496796413, 8),(4, 512521213, 9) ,(4, 528246013, 8),(4, 543970813, 9) ,(4, 559695613, 8),(4, 575420414, 9) ,(4, 591145214, 8),(4, 606870014, 9) ,(4, 622594814, 8),(4, 638319615, 9) ,(4, 654649215, 8),(4, 670374016, 10) ,(4, 686102416, 11),(4, 695779216, 8) ,(4, 701812816, 5),(4, 717534017, 4) ,(4, 733273217, 9),(4, 748998018, 8) ,(4, 764722818, 9),(4, 780447619, 8) ,(4, 796172419, 9),(4, 811897219, 8) ,(4, 828226820, 9),(4, 846370820, 8) ,(4, 859676420, 9),(4, 877820421, 8) ,(4, 891126021, 9),(4, 909270021, 8) ,(4, 922575622, 9),(4, 941324422, 8) ,(4, 954025222, 9),(4, 972774022, 8) ,(4, 985474822, 9),(4, 1004223622, 8) ,(4, 1017529222, 9),(4, 1035673222, 8) ,(4, 1048978822, 9),(4, 1067122822, 8) ,(4, 1080428422, 9),(4, 1099177222, 8) ,(4, 1111878022, 9),(4, 1130626822, 8) ,(4, 1143327622, 9),(4, 1162076422, 8) ,(4, 1174777222, 9),(4, 1193526022, 8) ,(4, 1206831622, 9),(4, 1224975622, 8) ,(4, 1238281222, 9),(4, 1256425222, 8) ,(4, 1269730822, 9),(4, 1288479622, 8) ,(4, 1301180422, 9),(4, 1319929222, 8) ,(4, 1332630022, 9),(4, 1351378822, 8) ,(4, 1364684422, 9),(4, 1382828422, 8) ,(4, 1396134022, 9),(4, 1414278022, 8) ,(4, 1427583622, 9),(4, 1445727622, 8) ,(4, 1459033222, 9),(4, 1477782022, 8) ,(4, 1490482822, 9),(4, 1509231622, 8) ,(4, 1521932422, 9),(4, 1540681222, 8) ,(4, 1553986822, 9),(4, 1572130822, 8) ,(4, 1585436422, 9),(4, 1603580422, 8) ,(4, 1616886022, 9),(4, 1635634822, 8) ,(4, 1648335622, 9),(4, 1667084422, 8) ,(4, 1679785222, 9),(4, 1698534022, 8) ,(4, 1711839622, 9),(4, 1729983622, 8) ,(4, 1743289222, 9),(4, 1761433222, 8) ,(4, 1774738822, 9),(4, 1792882822, 8) ,(4, 1806188422, 9),(4, 1824937222, 8) ,(4, 1837638022, 9),(4, 1856386822, 8) ,(4, 1869087622, 9),(4, 1887836422, 8) ,(4, 1901142022, 9),(4, 1919286022, 8) ,(4, 1932591622, 9),(4, 1950735622, 8) ,(4, 1964041222, 9),(4, 1982790022, 8) ,(4, 1995490822, 9),(4, 2014239622, 8) ,(4, 2026940422, 9),(4, 2045689222, 8) ,(4, 2058390022, 9),(4, 2077138822, 8) ,(4, 2090444422, 9),(4, 2108588422, 8) ,(4, 2121894022, 9),(4, 2140038022, 8); + + +CREATE TABLE time_zone_transition_type (Time_zone_id int unsigned NOT NULL,Transition_type_id int unsigned NOT NULL,Offset int signed DEFAULT 0 NOT NULL,Is_DST tinyint unsigned DEFAULT 0 NOT NULL,Abbreviation char(8) DEFAULT '' NOT NULL,PRIMARY KEY TzIdTrTId (Time_zone_id, Transition_type_id)) engine=MyISAM CHARACTER SET utf8 comment='Time zone transition types'; + +INSERT INTO time_zone_transition_type (Time_zone_id,Transition_type_id, Offset, Is_DST, Abbreviation) VALUES (1, 0, 7200, 1, 'MEST') ,(1, 1, 3600, 0, 'MET') ,(1, 2, 7200, 1, 'MEST') ,(1, 3, 3600, 0, 'MET') ,(2, 0, 0, 0, 'UTC') ,(3, 0, 9000, 0, 'MMT') ,(3, 1, 12648, 1, 'MST') ,(3, 2, 9048, 0, 'MMT') ,(3, 3, 16248, 1, 'MDST') ,(3, 4, 10800, 0, 'MSK') ,(3, 5, 14400, 1, 'MSD') ,(3, 6, 18000, 1, 'MSD') ,(3, 7, 7200, 0, 'EET') ,(3, 8, 10800, 0, 'MSK') ,(3, 9, 14400, 1, 'MSD') ,(3, 10, 10800, 1, 'EEST') ,(3, 11, 7200, 0, 'EET') ,(4, 0, 9000, 0, 'MMT') ,(4, 1, 12648, 1, 'MST') ,(4, 2, 9048, 0, 'MMT') ,(4, 3, 16248, 1, 'MDST') ,(4, 4, 10800, 0, 'MSK') ,(4, 5, 14400, 1, 'MSD') ,(4, 6, 18000, 1, 'MSD') ,(4, 7, 7200, 0, 'EET') ,(4, 8, 10800, 0, 'MSK') ,(4, 9, 14400, 1, 'MSD') ,(4, 10, 10800, 1, 'EEST') ,(4, 11, 7200, 0, 'EET') ,(5, 0, 32400, 0, 'CJT') ,(5, 1, 32400, 0, 'JST'); + +CREATE TABLE time_zone_leap_second (Transition_time bigint signed NOT NULL,Correction int signed NOT NULL,PRIMARY KEY TranTime (Transition_time)) engine=MyISAM CHARACTER SET utf8 comment='Leap seconds information for time zones'; + +INSERT INTO time_zone_leap_second (Transition_time, Correction) VALUES (78796800, 1) ,(94694401, 2) ,(126230402, 3) ,(157766403, 4) ,(189302404, 5) ,(220924805, 6) ,(252460806, 7) ,(283996807, 8) ,(315532808, 9) ,(362793609, 10) ,(394329610, 11) ,(425865611, 12) ,(489024012, 13) ,(567993613, 14) ,(631152014, 15) ,(662688015, 16) ,(709948816, 17) ,(741484817, 18) ,(773020818, 19) ,(820454419, 20) ,(867715220, 21) ,(915148821, 22); + + diff --git a/mysql-test/lib/mtr_gcov.pl b/mysql-test/lib/mtr_gcov.pl new file mode 100644 index 00000000000..07aac1d2017 --- /dev/null +++ b/mysql-test/lib/mtr_gcov.pl @@ -0,0 +1,44 @@ +# -*- cperl -*- + +# This is a library file used by the Perl version of mysql-test-run, +# and is part of the translation of the Bourne shell script with the +# same name. + +use strict; + +# These are not to be prefixed with "mtr_" + +sub gcov_prepare (); +sub gcov_collect (); + +############################################################################## +# +# +# +############################################################################## + +sub gcov_prepare () { + + `find $::glob_basedir -name \*.gcov \ + -or -name \*.da | xargs rm`; +} + +sub gcov_collect () { + + print "Collecting source coverage info...\n"; + -f $::opt_gcov_msg and unlink($::opt_gcov_msg); + -f $::opt_gcov_err and unlink($::opt_gcov_err); + foreach my $d ( @::mysqld_src_dirs ) + { + chdir("$::glob_basedir/$d"); + foreach my $f ( (glob("*.h"), glob("*.cc"), glob("*.c")) ) + { + `$::opt_gcov $f 2>>$::opt_gcov_err >>$::opt_gcov_msg`; + } + chdir($::glob_mysql_test_dir); + } + print "gcov info in $::opt_gcov_msg, errors in $::opt_gcov_err\n"; +} + + +1; diff --git a/mysql-test/lib/mtr_gprof.pl b/mysql-test/lib/mtr_gprof.pl new file mode 100644 index 00000000000..cc874eebfe5 --- /dev/null +++ b/mysql-test/lib/mtr_gprof.pl @@ -0,0 +1,50 @@ +# -*- cperl -*- + +# This is a library file used by the Perl version of mysql-test-run, +# and is part of the translation of the Bourne shell script with the +# same name. + +use strict; + +# These are not to be prefixed with "mtr_" + +sub gprof_prepare (); +sub gprof_collect (); + +############################################################################## +# +# +# +############################################################################## + +sub gprof_prepare () { + + rmtree($::opt_gprof_dir); + mkdir($::opt_gprof_dir); +} + +# FIXME what about master1 and slave1?! +sub gprof_collect () { + + if ( -f "$::master->[0]->{'path_myddir'}/gmon.out" ) + { + # FIXME check result code?! + mtr_run("gprof", + [$::exe_master_mysqld, + "$::master->[0]->{'path_myddir'}/gmon.out"], + $::opt_gprof_master, "", "", ""); + print "Master execution profile has been saved in $::opt_gprof_master\n"; + } + if ( -f "$::slave->[0]->{'path_myddir'}/gmon.out" ) + { + # FIXME check result code?! + mtr_run("gprof", + [$::exe_slave_mysqld, + "$::slave->[0]->{'path_myddir'}/gmon.out"], + $::opt_gprof_slave, "", "", ""); + print "Slave execution profile has been saved in $::opt_gprof_slave\n"; + } +} + + +1; diff --git a/mysql-test/lib/mtr_io.pl b/mysql-test/lib/mtr_io.pl new file mode 100644 index 00000000000..14ea37dbb75 --- /dev/null +++ b/mysql-test/lib/mtr_io.pl @@ -0,0 +1,71 @@ +# -*- cperl -*- + +# This is a library file used by the Perl version of mysql-test-run, +# and is part of the translation of the Bourne shell script with the +# same name. + +use strict; + +sub mtr_get_pid_from_file ($); +sub mtr_get_opts_from_file ($); +sub mtr_tofile ($@); +sub mtr_tonewfile($@); + +############################################################################## +# +# +# +############################################################################## + +sub mtr_get_pid_from_file ($) { + my $file= shift; + + open(FILE,"<",$file) or mtr_error("can't open file \"$file\": $!"); + my $pid= ; + chomp($pid); + close FILE; + return $pid; +} + +sub mtr_get_opts_from_file ($) { + my $file= shift; + + open(FILE,"<",$file) or mtr_error("can't open file \"$file\": $!"); + my @args; + while ( ) + { + chomp; + s/\$MYSQL_TEST_DIR/$::glob_mysql_test_dir/g; + push(@args, split(' ', $_)); + } + close FILE; + return \@args; +} + +sub mtr_fromfile ($) { + my $file= shift; + + open(FILE,"<",$file) or mtr_error("can't open file \"$file\": $!"); + my $text= join('', ); + close FILE; + return $text; +} + +sub mtr_tofile ($@) { + my $file= shift; + + open(FILE,">>",$file) or mtr_error("can't open file \"$file\": $!"); + print FILE join("", @_); + close FILE; +} + +sub mtr_tonewfile ($@) { + my $file= shift; + + open(FILE,">",$file) or mtr_error("can't open file \"$file\": $!"); + print FILE join("", @_); + close FILE; +} + + +1; diff --git a/mysql-test/lib/mtr_match.pl b/mysql-test/lib/mtr_match.pl new file mode 100644 index 00000000000..eb5de655520 --- /dev/null +++ b/mysql-test/lib/mtr_match.pl @@ -0,0 +1,67 @@ +# -*- cperl -*- + +# This is a library file used by the Perl version of mysql-test-run, +# and is part of the translation of the Bourne shell script with the +# same name. + +use strict; + +sub mtr_match_prefix ($$); +sub mtr_match_extension ($$); +sub mtr_match_any_exact ($$); + +############################################################################## +# +# +# +############################################################################## + +# Match a prefix and return what is after the prefix + +sub mtr_match_prefix ($$) { + my $string= shift; + my $prefix= shift; + + if ( $string =~ /^\Q$prefix\E(.*)$/ ) # strncmp + { + return $1; + } + else + { + return undef; # NULL + } +} + + +# Match extension and return the name without extension + +sub mtr_match_extension ($$) { + my $file= shift; + my $ext= shift; + + if ( $file =~ /^(.*)\.\Q$ext\E$/ ) # strchr+strcmp or something + { + return $1; + } + else + { + return undef; # NULL + } +} + + +sub mtr_match_any_exact ($$) { + my $string= shift; + my $mlist= shift; + + foreach my $m (@$mlist) + { + if ( $string eq $m ) + { + return 1; + } + } + return 0; +} + +1; diff --git a/mysql-test/lib/mtr_misc.pl b/mysql-test/lib/mtr_misc.pl new file mode 100644 index 00000000000..5f80864d1f7 --- /dev/null +++ b/mysql-test/lib/mtr_misc.pl @@ -0,0 +1,50 @@ +# -*- cperl -*- + +# This is a library file used by the Perl version of mysql-test-run, +# and is part of the translation of the Bourne shell script with the +# same name. + +use strict; + +sub mtr_full_hostname (); +sub mtr_init_args ($); +sub mtr_add_arg ($$); + +############################################################################## +# +# Misc +# +############################################################################## + +# We want the fully qualified host name and hostname() may have returned +# only the short name. So we use the resolver to find out. + +sub mtr_full_hostname () { + + my $hostname= hostname(); + if ( $hostname !~ /\./ ) + { + my $address= gethostbyname($hostname) + or die "Couldn't resolve $hostname : $!"; + my $fullname= gethostbyaddr($address, AF_INET); + $hostname= $fullname if $fullname; + } + return $hostname; +} + +# FIXME move to own lib + +sub mtr_init_args ($) { + my $args = shift; + $$args = []; # Empty list +} + +sub mtr_add_arg ($$) { + my $args= shift; + my $format= shift; + my @fargs = @_; + + push(@$args, sprintf($format, @fargs)); +} + +1; diff --git a/mysql-test/lib/mtr_process.pl b/mysql-test/lib/mtr_process.pl new file mode 100644 index 00000000000..2263ef5bc24 --- /dev/null +++ b/mysql-test/lib/mtr_process.pl @@ -0,0 +1,421 @@ +# -*- cperl -*- + +# This is a library file used by the Perl version of mysql-test-run, +# and is part of the translation of the Bourne shell script with the +# same name. + +use strict; + +use POSIX ":sys_wait_h"; + +sub mtr_run ($$$$$$); +sub mtr_spawn ($$$$$$); +sub mtr_stop_servers ($); +sub mtr_kill_leftovers (); + +# static in C +sub spawn_impl ($$$$$$$); + +############################################################################## +# +# Execute an external command +# +############################################################################## + +# This function try to mimic the C version used in "netware/mysql_test_run.c" +# FIXME learn it to handle append mode as well, a "new" flag or a "append" + +sub mtr_run ($$$$$$) { + my $path= shift; + my $arg_list_t= shift; + my $input= shift; + my $output= shift; + my $error= shift; + my $pid_file= shift; + + return spawn_impl($path,$arg_list_t,1,$input,$output,$error,$pid_file); +} + +sub mtr_spawn ($$$$$$) { + my $path= shift; + my $arg_list_t= shift; + my $input= shift; + my $output= shift; + my $error= shift; + my $pid_file= shift; + + return spawn_impl($path,$arg_list_t,0,$input,$output,$error,$pid_file); +} + + +############################################################################## +# +# If $join is set, we return the error code, else we return the PID +# +############################################################################## + +sub spawn_impl ($$$$$$$) { + my $path= shift; + my $arg_list_t= shift; + my $join= shift; + my $input= shift; + my $output= shift; + my $error= shift; + my $pid_file= shift; # FIXME + + # FIXME really needing a PATH??? + # $ENV{'PATH'}= "/bin:/usr/bin:/usr/local/bin:/usr/bsd:/usr/X11R6/bin:/usr/openwin/bin:/usr/bin/X11:$ENV{'PATH'}"; + + $ENV{'TZ'}= "GMT-3"; # for UNIX_TIMESTAMP tests to work + $ENV{'LC_COLLATE'}= "C"; + $ENV{'MYSQL_TEST_DIR'}= $::glob_mysql_test_dir; + $ENV{'MASTER_MYPORT'}= $::opt_master_myport; + $ENV{'SLAVE_MYPORT'}= $::opt_slave_myport; +# $ENV{'MYSQL_TCP_PORT'}= '@MYSQL_TCP_PORT@'; # FIXME + $ENV{'MYSQL_TCP_PORT'}= 3306; + $ENV{'MASTER_MYSOCK'}= $::master->[0]->{'path_mysock'}; + + if ( $::opt_script_debug ) + { + print STDERR "-" x 78, "\n"; + print STDERR "STDIN $input\n" if $input; + print STDERR "STDOUT $output\n" if $output; + print STDERR "STDERR $error\n" if $error; + print STDERR "DAEMON\n" if !$join; + print STDERR "EXEC $path ", join(" ",@$arg_list_t), "\n"; + print STDERR "-" x 78, "\n"; + } + + my $pid= fork(); + + if ( $pid ) + { + # Parent, i.e. the main script + if ( $join ) + { + # We run a command and wait for the result + # FIXME this need to be improved + waitpid($pid,0); + my $exit_value= $? >> 8; + my $signal_num= $? & 127; + my $dumped_core= $? & 128; + if ( $signal_num ) + { + die("spawn got signal $signal_num"); + } + if ( $dumped_core ) + { + die("spawn dumped core"); + } + return $exit_value; + } + else + { + # We spawned a process we don't wait for + return $pid; + } + } + else + { + # Child, redirect output and exec + # FIXME I tried POSIX::setsid() here to detach and, I hoped, + # avoid zombies. But everything went wild, somehow the parent + # became a deamon as well, and was hard to kill ;-) + # Need to catch SIGCHLD and do waitpid or something instead...... + + $SIG{INT}= 'DEFAULT'; # Parent do some stuff, we don't + + if ( $output ) + { + open(STDOUT,">",$output) or die "Can't redirect STDOUT to \"$output\": $!"; + } + if ( $error ) + { + if ( $output eq $error ) + { + open(STDERR,">&STDOUT") or die "Can't dup STDOUT: $!"; + } + else + { + open(STDERR,">",$error) or die "Can't redirect STDERR to \"$output\": $!"; + } + } + if ( $input ) + { + open(STDIN,"<",$input) or die "Can't redirect STDIN to \"$input\": $!"; + } + exec($path,@$arg_list_t); + } +} + +############################################################################## +# +# Kill processes left from previous runs +# +############################################################################## + +sub mtr_kill_leftovers () { + + # First, kill all masters and slaves that would conflict with + # this run. Make sure to remove the PID file, if any. + + my @args; + + for ( my $idx; $idx < 2; $idx++ ) + { +# if ( $::master->[$idx]->{'pid'} ) +# { + push(@args, + $::master->[$idx]->{'path_mypid'}, + $::master->[$idx]->{'path_mysock'}, + ); +# } + } + + for ( my $idx; $idx < 3; $idx++ ) + { +# if ( $::slave->[$idx]->{'pid'} ) +# { + push(@args, + $::slave->[$idx]->{'path_mypid'}, + $::slave->[$idx]->{'path_mysock'}, + ); +# } + } + + mtr_stop_servers(\@args); + + # We scan the "var/run/" directory for other process id's to kill + my $rundir= "$::glob_mysql_test_dir/var/run"; # FIXME $path_run_dir or something + + if ( -d $rundir ) + { + opendir(RUNDIR, $rundir) + or mtr_error("can't open directory \"$rundir\": $!"); + + my @pids; + + while ( my $elem= readdir(RUNDIR) ) + { + my $pidfile= "$rundir/$elem"; + + if ( -f $pidfile ) + { + my $pid= mtr_get_pid_from_file($pidfile); + if ( ! unlink($pidfile) ) + { + mtr_error("can't remove $pidfile"); + } + push(@pids, $pid); + } + } + closedir(RUNDIR); + + my $retries= 10; # 10 seconds + do + { + kill(9, @pids); + } while ( $retries-- and kill(0, @pids) ); + + if ( kill(0, @pids) ) + { + mtr_error("can't kill processes " . join(" ", @pids)); + } + + } +} + +############################################################################## +# +# Shut down mysqld servers +# +############################################################################## + +# To speed things we kill servers in parallel. +# The argument is a list of 'pidfiles' and 'socketfiles'. +# We use the pidfiles and socketfiles to try to terminate the servers. +# This is not perfect, there could still be other server processes +# left. + +sub mtr_stop_servers ($) { + my $spec= shift; + + # First try nice normal shutdown using 'mysqladmin' + + { + my @args= @$spec; + while ( @args ) + { + my $pidfile= shift @args; # FIXME not used here.... + my $sockfile= shift @args; + + if ( -f $sockfile ) + { + + # FIXME wrong log..... + # FIXME, stderr..... + # Shutdown time must be high as slave may be in reconnect + my $opts= + [ + "--no-defaults", + "-uroot", + "--socket=$sockfile", + "--connect_timeout=5", + "--shutdown_timeout=70", + "shutdown", + ]; + # We don't wait for termination of mysqladmin + mtr_spawn($::exe_mysqladmin, $opts, + "", $::path_manager_log, $::path_manager_log, ""); + } + } + } + + # Wait for them all to remove their socket file + + SOCKREMOVED: + for (my $loop= $::opt_sleep_time_for_delete; $loop; $loop--) + { + my $sockfiles_left= 0; + my @args= @$spec; + while ( @args ) + { + my $pidfile= shift @args; + my $sockfile= shift @args; + if ( -f $sockfile or -f $pidfile ) + { + $sockfiles_left++; # Could be that pidfile is left + } + } + if ( ! $sockfiles_left ) + { + last SOCKREMOVED; + } + if ( $loop > 1 ) + { + sleep(1); # One second + } + } + + # We may have killed all that left a socket, but we are not sure we got + # them all killed. We now check the PID file, if any + + # Try nice kill with SIG_TERM + + { + my @args= @$spec; + while ( @args ) + { + my $pidfile= shift @args; + my $sockfile= shift @args; + if (-f $pidfile) + { + my $pid= mtr_get_pid_from_file($pidfile); + mtr_warning("process $pid not cooperating with mysqladmin, " . + "will send TERM signal to process"); + kill(15,$pid); # SIG_TERM + } + } + } + + # Wait for them all to die + + for (my $loop= $::opt_sleep_time_for_delete; $loop; $loop--) + { + my $pidfiles_left= 0; + my @args= @$spec; + while ( @args ) + { + my $pidfile= shift @args; + my $sockfile= shift @args; + if ( -f $pidfile ) + { + $pidfiles_left++; + } + } + if ( ! $pidfiles_left ) + { + return; + } + if ( $loop > 1 ) + { + sleep(1); # One second + } + } + + # Try hard kill with SIG_KILL + + { + my @args= @$spec; + while ( @args ) + { + my $pidfile= shift @args; + my $sockfile= shift @args; + if (-f $pidfile) + { + my $pid= mtr_get_pid_from_file($pidfile); + mtr_warning("$pid did not die from TERM signal, ", + "will send KILL signal to process"); + kill(9,$pid); + } + } + } + + # We check with Perl "kill 0" if process still exists + + PIDFILES: + for (my $loop= $::opt_sleep_time_for_delete; $loop; $loop--) + { + my $not_terminated= 0; + my @args= @$spec; + while ( @args ) + { + my $pidfile= shift @args; + my $sockfile= shift @args; + if (-f $pidfile) + { + my $pid= mtr_get_pid_from_file($pidfile); + if ( ! kill(0,$pid) ) + { + $not_terminated++; + mtr_warning("could't kill $pid"); + } + } + } + if ( ! $not_terminated ) + { + last PIDFILES; + } + if ( $loop > 1 ) + { + sleep(1); # One second + } + } + + { + my $pidfiles_left= 0; + my @args= @$spec; + while ( @args ) + { + my $pidfile= shift @args; + my $sockfile= shift @args; + if ( -f $pidfile ) + { + if ( ! unlink($pidfile) ) + { + $pidfiles_left++; + mtr_warning("could't delete $pidfile"); + } + } + } + if ( $pidfiles_left ) + { + mtr_error("one or more pid files could not be deleted"); + } + } + + # FIXME We just assume they are all dead, we don't know.... +} + + +1; diff --git a/mysql-test/lib/mtr_report.pl b/mysql-test/lib/mtr_report.pl new file mode 100644 index 00000000000..350cd993f19 --- /dev/null +++ b/mysql-test/lib/mtr_report.pl @@ -0,0 +1,257 @@ +# -*- cperl -*- + +# This is a library file used by the Perl version of mysql-test-run, +# and is part of the translation of the Bourne shell script with the +# same name. + +use strict; + +sub mtr_report_test_name($); +sub mtr_report_test_passed($); +sub mtr_report_test_failed($); +sub mtr_report_test_skipped($); + +sub mtr_show_failed_diff ($); +sub mtr_report_stats ($); +sub mtr_print_line (); +sub mtr_print_header (); +sub mtr_report (@); +sub mtr_warning (@); +sub mtr_error (@); +sub mtr_debug (@); + + +############################################################################## +# +# +# +############################################################################## + +# We can't use diff -u or diff -a as these are not portable + +sub mtr_show_failed_diff ($) { + my $tname= shift; + + my $reject_file= "r/$tname.reject"; + my $result_file= "r/$tname.result"; + my $eval_file= "r/$tname.eval"; + + if ( -f $eval_file ) + { + $result_file= $eval_file; + } + elsif ( $::opt_result_ext and + ( $::opt_record or -f "$result_file$::opt_result_ext" )) + { + # If we have an special externsion for result files we use it if we are + # recording or a result file with that extension exists. + $result_file= "$result_file$::opt_result_ext"; + } + + if ( -f $reject_file ) + { + print "Below are the diffs between actual and expected results:\n"; + print "-------------------------------------------------------\n"; + # FIXME check result code?! + mtr_run("diff",["-c",$result_file,$reject_file], "", "", "", ""); + print "-------------------------------------------------------\n"; + print "Please follow the instructions outlined at\n"; + print "http://www.mysql.com/doc/en/Reporting_mysqltest_bugs.html\n"; + print "to find the reason to this problem and how to report this.\n\n"; + } +} + +sub mtr_report_test_name ($) { + my $tinfo= shift; + + printf "%-31s ", $tinfo->{'name'}; +} + +sub mtr_report_test_skipped ($) { + my $tinfo= shift; + + $tinfo->{'result'}= 'MTR_RES_SKIPPED'; + print "[ skipped ]\n"; +} + +sub mtr_report_test_passed ($) { + my $tinfo= shift; + + my $timer= ""; +# FIXME +# if ( $::opt_timer and -f "$::glob_mysql_test_dir/var/log/timer" ) +# { +# $timer= `cat var/log/timer`; +# $timer= sprintf "%13s", $timer; +# } + $tinfo->{'result'}= 'MTR_RES_PASSED'; + print "[ pass ] $timer\n"; +} + +sub mtr_report_test_failed ($) { + my $tinfo= shift; + + $tinfo->{'result'}= 'MTR_RES_FAILED'; + print "[ fail ]\n"; + + print "Errors are (from $::path_timefile) :\n"; + print mtr_fromfile($::path_timefile); # FIXME print_file() instead + print "\n(the last lines may be the most important ones)\n"; +} + +sub mtr_report_stats ($) { + my $tests= shift; + + # ---------------------------------------------------------------------- + # Find out how we where doing + # ---------------------------------------------------------------------- + + my $tot_skiped= 0; + my $tot_passed= 0; + my $tot_failed= 0; + my $tot_tests= 0; + + foreach my $tinfo (@$tests) + { + if ( $tinfo->{'result'} eq 'MTR_RES_SKIPPED' ) + { + $tot_skiped++; + } + elsif ( $tinfo->{'result'} eq 'MTR_RES_PASSED' ) + { + $tot_tests++; + $tot_passed++; + } + elsif ( $tinfo->{'result'} eq 'MTR_RES_FAILED' ) + { + $tot_tests++; + $tot_failed++; + } + } + + # ---------------------------------------------------------------------- + # Print out a summary report to screen + # ---------------------------------------------------------------------- + + if ( ! $tot_failed ) + { + print "All $tot_tests tests were successful.\n"; + } + else + { + my $ratio= $tot_passed * 100 / $tot_tests; + printf "Failed $tot_failed/$tot_tests tests, " . + "%.2f\% successful.\n\n", $ratio; + print + "The log files in var/log may give you some hint\n", + "of what when wrong.\n", + "If you want to report this error, please read first ", + "the documentation at\n", + "http://www.mysql.com/doc/en/MySQL_test_suite.html\n"; + } + + # ---------------------------------------------------------------------- + # ---------------------------------------------------------------------- + + if ( ! $::glob_use_running_server ) + { + + # Report if there was any fatal warnings/errors in the log files + # + unlink("$::glob_mysql_test_dir/var/log/warnings"); + unlink("$::glob_mysql_test_dir/var/log/warnings.tmp"); + # Remove some non fatal warnings from the log files + +# FIXME what is going on ????? ;-) +# sed -e 's!Warning: Table:.* on delete!!g' -e 's!Warning: Setting lower_case_table_names=2!!g' -e 's!Warning: One can only use the --user.*root!!g' \ +# var/log/*.err \ +# | sed -e 's!Warning: Table:.* on rename!!g' \ +# > var/log/warnings.tmp; +# +# found_error=0; +# # Find errors +# for i in "^Warning:" "^Error:" "^==.* at 0x" +# do +# if ( $GREP "$i" var/log/warnings.tmp >> var/log/warnings ) +# { +# found_error=1 +# } +# done +# unlink("$::glob_mysql_test_dir/var/log/warnings.tmp"); +# if ( $found_error= "1" ) +# { +# print "WARNING: Got errors/warnings while running tests. Please examine\n" +# print "$::glob_mysql_test_dir/var/log/warnings for details.\n" +# } +# } + } + + print "\n"; + + if ( $tot_failed != 0 ) + { + print "mysql-test-run: *** Failing the test(s):"; + + foreach my $tinfo (@$tests) + { + if ( $tinfo->{'result'} eq 'MTR_RES_FAILED' ) + { + print " $tinfo->{'name'}"; + } + } + print "\n"; + mtr_error("there where failing test cases"); + } +} + +############################################################################## +# +# Text formatting +# +############################################################################## + +sub mtr_print_line () { + print '-' x 55, "\n"; +} + +sub mtr_print_header () { + print "\n"; + if ( $::opt_timer ) + { + print "TEST RESULT TIME (ms)\n"; + } + else + { + print "TEST RESULT\n"; + } + mtr_print_line(); + print "\n"; +} + + +############################################################################## +# +# Misc +# +############################################################################## + +sub mtr_report (@) { + print join(" ", @_),"\n"; +} + +sub mtr_warning (@) { + print STDERR "mysql-test-run: WARNING: ",join(" ", @_),"\n"; +} + +sub mtr_error (@) { + die "mysql-test-run: *** ERROR: ",join(" ", @_),"\n"; +} + +sub mtr_debug (@) { + if ( $::opt_script_debug ) + { + print "mysql-test-run: DEBUG: ",join(" ", @_),"\n"; + } +} + +1; diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl new file mode 100755 index 00000000000..c90ebf22dad --- /dev/null +++ b/mysql-test/mysql-test-run.pl @@ -0,0 +1,1975 @@ +#!/usr/bin/perl +# -*- cperl -*- + +# This is a transformation of the "mysql-test-run" Bourne shell script +# to Perl. This is just an intermediate step, the goal is to rewrite +# the Perl script to C. The complexity of the mysql-test-run script +# makes it a bit hard to write and debug it as a C program directly, +# so this is considered a prototype. +# +# Because of this the Perl coding style may in some cases look a bit +# funny. The rules used are +# +# - The coding style is as close as possible to the C/C++ MySQL +# coding standard. +# +# - Where NULL is to be returned, the undefined value is used. +# +# - Regexp comparisons are simple and can be translated to strcmp +# and other string functions. To ease this transformation matching +# is done in the lib "lib/mtr_match.pl", i.e. regular expressions +# should be avoided in the main program. +# +# - The "unless" construct is not to be used. It is the same as "if !". +# +# - opendir/readdir/closedir is used instead of glob()/<*>. +# +# - All lists of arguments to send to commands are Perl lists/arrays, +# not strings we append args to. Within reason, most string +# concatenation for arguments should be avoided. +# +# - sprintf() is to be used, within reason, for all string creation. +# This mtr_add_arg() function is also based on sprintf(), i.e. you +# use a format string and put the variable argument in the argument +# list. +# +# - Functions defined in the main program are not to be prefixed, +# functions in "library files" are to be prefixed with "mtr_" (for +# Mysql-Test-Run). There are some exceptions, code that fits best in +# the main program, but are put into separate files to avoid +# clutter, may be without prefix. +# +# - All stat/opendir/-f/ is to be kept in collect_test_cases(). It +# will create a struct that the rest of the program can use to get +# the information. This separates the "find information" from the +# "do the work" and makes the program more easy to maintain. +# +# - At the moment, there are tons of "global" variables that control +# this script, even accessed from the files in "lib/*.pl". This +# will change over time, for now global variables are used instead +# of using %opt, %path and %exe hashes, because I want more +# compile time checking, that hashes would not give me. Once this +# script is debugged, hashes will be used and passed as parameters +# to functions, to more closely mimic how it would be coded in C +# using structs. +# +# - The rule when it comes to the logic of this program is +# +# command_line_setup() - is to handle the logic between flags +# collect_test_cases() - is to do its best to select what tests +# to run, dig out options, if needs restart etc. +# run_testcase() - is to run a single testcase, and follow the +# logic set in both above. No, or rare file +# system operations. If a test seems complex, +# it should probably not be here. +# +# A nice way to trace the execution of this script while debugging +# is to use the Devel::Trace package found at +# "http://www.plover.com/~mjd/perl/Trace/" and run this script like +# "perl -d:Trace mysql-test-run.pl" + +$Devel::Trace::TRACE= 0; # Don't trace boring init stuff + +#require 5.6.1; +use File::Path; +use File::Basename; +use Cwd; +use Getopt::Long; +use Sys::Hostname; +#use Carp; +use IO::Socket; +use IO::Socket::INET; +use Data::Dumper; +use strict; +#use diagnostics; + +require "lib/mtr_process.pl"; +require "lib/mtr_io.pl"; +require "lib/mtr_gcov.pl"; +require "lib/mtr_gprof.pl"; +require "lib/mtr_report.pl"; +require "lib/mtr_match.pl"; +require "lib/mtr_misc.pl"; + +$Devel::Trace::TRACE= 1; + +my @skip_if_embedded_server= + ( + "bdb-deadlock", + "connect", + "flush_block_commit", + "grant2", + "grant_cache", + "grant", + "init_connect", + "innodb-deadlock", + "innodb-lock", + "mix_innodb_myisam_binlog", + "mysqlbinlog2", + "mysqlbinlog", + "mysqldump", + "mysql_protocols", + "ps_1general", + "rename", + "show_check", + "system_mysql_db_fix", + "user_var", + "variables", + ); + +# Used by gcov +our @mysqld_src_dirs= + ( + "strings", + "mysys", + "include", + "extra", + "regex", + "isam", + "merge", + "myisam", + "myisammrg", + "heap", + "sql", + ); + +############################################################################## +# +# Default settings +# +############################################################################## + +# We are to use handle_options() in "mysys/my_getopt.c" for the C version +# +# In the C version we want to use structs and, in some cases, arrays of +# structs. We let each struct be a separate hash. + +# Misc global variables + +our $glob_win32= 0; +our $glob_mysql_test_dir= undef; +our $glob_hostname= undef; +our $glob_scriptname= undef; +our $glob_use_running_server= 0; +our $glob_use_running_ndbcluster= 0; +our $glob_user= 'test'; +our $glob_use_embedded_server= 0; + +our $glob_basedir; +our $glob_do_test; + +# The total result + +our $path_charsetsdir; +our $path_client_bindir; +our $path_language; +our $path_tests_bindir; +our $path_timefile; +our $path_manager_log; # Used by mysqldadmin +our $path_slave_load_tmpdir; # What is this?! +our $path_my_basedir; +our $opt_tmpdir; # A path but set directly on cmd line + +our $opt_netware; + +our $opt_script_debug= 0; # Script debugging, enable with --script-debug + +# Options FIXME not all.... + +our $exe_master_mysqld; +our $exe_mysql; +our $exe_mysqladmin; +our $exe_mysqlbinlog; +our $exe_mysqld; +our $exe_mysqldump; # Called from test case +our $exe_mysqltest; +our $exe_slave_mysqld; + +our $opt_bench= 0; +our $opt_small_bench= 0; +our $opt_big_test= 0; # Send --big-test to mysqltest + +our $opt_extra_mysqld_opt; # FIXME not handled + +our $opt_compress; +our $opt_current_test; +our $opt_ddd; +our $opt_debug; +our $opt_do_test; +our $opt_embedded_server; +our $opt_extern; +our $opt_fast; +our $opt_force; + +our $opt_gcov; +our $opt_gcov_err; +our $opt_gcov_msg; + +our $opt_gdb; +our $opt_client_gdb; +our $opt_manual_gdb; + +our $opt_gprof; +our $opt_gprof_dir; +our $opt_gprof_master; +our $opt_gprof_slave; + +our $opt_local; +our $opt_local_master; + +our $master; # Will be struct in C +our $slave; + +our $opt_ndbcluster_port; +our $opt_ndbconnectstring; + +our $opt_no_manager; # Does nothing now, we never use manager + +our $opt_old_master; + +our $opt_record; + +our $opt_result_ext; + +our $opt_skip; +our $opt_skip_rpl; +our $opt_skip_test; + +our $opt_sleep; + +# FIXME all of the sleep time handling needs cleanup +our $opt_sleep_time_after_restart= 1; +our $opt_sleep_time_for_delete= 10; +our $opt_sleep_time_for_first_master= 400; # enough time create innodb tables +our $opt_sleep_time_for_second_master= 400; +our $opt_sleep_time_for_first_slave= 400; +our $opt_sleep_time_for_second_slave= 30; + +our $opt_socket; + +our $opt_source_dist; + +our $opt_start_and_exit; +our $opt_start_from; + +our $opt_strace_client; + +our $opt_timer; + + +our $opt_user_test; + +our $opt_valgrind; +our $opt_valgrind_all; +our $opt_valgrind_options; + +our $opt_verbose; + +our $opt_wait_for_master; +our $opt_wait_for_slave; +our $opt_wait_timeout= 10; + +our $opt_warnings; + +our $opt_with_ndbcluster; +our $opt_with_openssl; + + +###################################################################### +# +# Function declarations +# +###################################################################### + +sub main (); +sub initial_setup (); +sub command_line_setup (); +sub executable_setup (); +sub kill_and_cleanup (); +sub sleep_until_file_created ($$); +sub ndbcluster_start (); +sub ndbcluster_stop (); +sub run_benchmarks ($); +sub run_tests (); +sub mysql_install_db (); +sub install_db ($$); +sub run_testcase ($); +sub do_before_start_master ($$); +sub do_before_start_slave ($$); +sub mysqld_start ($$$$); +sub mysqld_arguments ($$$$$); +sub stop_masters_slaves (); +sub stop_masters (); +sub stop_slaves (); +sub run_mysqltest ($); + +###################################################################### +# +# Main program +# +###################################################################### + +main(); + +sub main () { + + initial_setup(); + command_line_setup(); + executable_setup(); + signal_setup(); + + if ( $opt_gcov ) + { + gcov_prepare(); + } + + if ( $opt_gprof ) + { + gprof_prepare(); + } + + if ( ! $glob_use_running_server ) + { + kill_and_cleanup(); + mysql_install_db(); + + if ( $opt_with_ndbcluster and ! $glob_use_running_ndbcluster ) + { + ndbcluster_start(); # We start the cluster storage engine + } + +# mysql_loadstd(); FIXME copying from "std_data" .frm and +# .MGR but there are none?! + } + + if ( $opt_start_and_exit ) + { + mtr_report("Servers started, exiting"); + } + else + { + if ( $opt_bench ) + { + run_benchmarks(shift); # Shift what? Extra arguments?! + } + else + { + run_tests(); + } + } + + exit(0); +} + +############################################################################## +# +# Initial setup independent on command line arguments +# +############################################################################## + +sub initial_setup () { + + select(STDOUT); + $| = 1; # Make unbuffered + + $glob_scriptname= basename($0); + + $glob_win32= ($^O eq "MSWin32"); + + # We require that we are in the "mysql-test" directory + # to run mysql-test-run + + if (! -f $glob_scriptname) + { + mtr_error("Can't find the location for the mysql-test-run script\n" . + "Go to to the mysql-test directory and execute the script " . + "as follows:\n./$glob_scriptname"); + } + + if ( -d "../sql" ) + { + $opt_source_dist= 1; + } + + $glob_hostname= mtr_full_hostname(); + + # 'basedir' is always parent of "mysql-test" directory + $glob_mysql_test_dir= cwd(); + $glob_basedir= dirname($glob_mysql_test_dir); + + $path_timefile= "$glob_mysql_test_dir/var/log/mysqltest-time"; + + # needs to be same length to test logging (FIXME what???) + $path_slave_load_tmpdir= "../../var/tmp"; + + $path_my_basedir= + $opt_source_dist ? $glob_mysql_test_dir : $glob_basedir; +} + + + +############################################################################## +# +# Default settings +# +############################################################################## + +sub command_line_setup () { + + # These are defaults for things that are set on the command line + + $opt_tmpdir= "$glob_mysql_test_dir/var/tmp"; + # FIXME maybe unneded? + $path_manager_log= "$glob_mysql_test_dir/var/log/manager.log"; + $opt_current_test= "$glob_mysql_test_dir/var/log/current_test"; + + my $opt_master_myport= 9306; + my $opt_slave_myport= 9308; + $opt_ndbcluster_port= 9350; + $opt_sleep_time_for_delete= 10; + + my $opt_user; + + # Read the command line + + GetOptions( + 'bench' => \$opt_bench, + 'big-test' => \$opt_big_test, + 'client-gdb' => \$opt_client_gdb, + 'compress' => \$opt_compress, + 'ddd' => \$opt_ddd, + 'debug' => \$opt_debug, + 'do-test=s' => \$opt_do_test, + 'embedded-server' => \$opt_embedded_server, + 'extern' => \$opt_extern, + 'fast' => \$opt_fast, + 'force' => \$opt_force, + 'gcov' => \$opt_gcov, + 'gdb' => \$opt_gdb, + 'gprof' => \$opt_gprof, + 'local' => \$opt_local, + 'local-master' => \$opt_local_master, + 'manual-gdb' => \$opt_manual_gdb, + 'master-binary=s' => \$exe_master_mysqld, + 'master_port=i' => \$opt_master_myport, + 'mysqld=s' => \$opt_extra_mysqld_opt, + 'ndbcluster_port=i' => \$opt_ndbcluster_port, + 'ndbconnectstring=s' => \$opt_ndbconnectstring, + 'netware' => \$opt_netware, + 'no-manager' => \$opt_no_manager, + 'old-master' => \$opt_old_master, + 'record' => \$opt_record, + 'script-debug' => \$opt_script_debug, + 'skip-rpl' => \$opt_skip_rpl, + 'skip-test=s' => \$opt_skip_test, + 'slave-binary=s' => \$exe_slave_mysqld, + 'slave_port=i' => \$opt_slave_myport, + 'sleep=i' => \$opt_sleep, + 'small-bench' => \$opt_small_bench, + 'socket=s' => \$opt_socket, + 'start-and-exit' => \$opt_start_and_exit, + 'start-from=s' => \$opt_start_from, + 'strace-client' => \$opt_strace_client, + 'timer' => \$opt_timer, + 'tmpdir=s' => \$opt_tmpdir, + 'user-test=s' => \$opt_user_test, + 'user=s' => \$opt_user, + 'valgrind' => \$opt_valgrind, + 'valgrind-all' => \$opt_valgrind_all, + 'valgrind-options=s' => \$opt_valgrind_options, + 'verbose' => \$opt_verbose, + 'wait-timeout=i' => \$opt_wait_timeout, + 'warnings|log-warnings' => \$opt_warnings, + 'with-ndbcluster' => \$opt_with_ndbcluster, + 'with-openssl' => \$opt_with_openssl, + ) or usage("Can't read options"); + + + # Put this into a hash, will be a C struct + + $master->[0]->{'path_myddir'}= "$glob_mysql_test_dir/var/master-data"; + $master->[0]->{'path_myerr'}= "$glob_mysql_test_dir/var/log/master.err"; + $master->[0]->{'path_mylog'}= "$glob_mysql_test_dir/var/log/master.log"; + $master->[0]->{'path_mypid'}= "$glob_mysql_test_dir/var/run/master.pid"; + $master->[0]->{'path_mysock'}= "$opt_tmpdir/master.sock"; + $master->[0]->{'path_myport'}= $opt_master_myport; + + $master->[1]->{'path_myddir'}= "$glob_mysql_test_dir/var/master1-data"; + $master->[1]->{'path_myerr'}= "$glob_mysql_test_dir/var/log/master1.err"; + $master->[1]->{'path_mylog'}= "$glob_mysql_test_dir/var/log/master1.log"; + $master->[1]->{'path_mypid'}= "$glob_mysql_test_dir/var/run/master1.pid"; + $master->[1]->{'path_mysock'}= "$opt_tmpdir/master1.sock"; + $master->[1]->{'path_myport'}= $opt_master_myport + 1; + + $slave->[0]->{'path_myddir'}= "$glob_mysql_test_dir/var/slave-data"; + $slave->[0]->{'path_myerr'}= "$glob_mysql_test_dir/var/log/slave.err"; + $slave->[0]->{'path_mylog'}= "$glob_mysql_test_dir/var/log/slave.log"; + $slave->[0]->{'path_mypid'}= "$glob_mysql_test_dir/var/run/slave.pid"; + $slave->[0]->{'path_mysock'}= "$opt_tmpdir/slave.sock"; + $slave->[0]->{'path_myport'}= $opt_slave_myport; + + $slave->[1]->{'path_myddir'}= "$glob_mysql_test_dir/var/slave1-data"; + $slave->[1]->{'path_myerr'}= "$glob_mysql_test_dir/var/log/slave1.err"; + $slave->[1]->{'path_mylog'}= "$glob_mysql_test_dir/var/log/slave1.log"; + $slave->[1]->{'path_mypid'}= "$glob_mysql_test_dir/var/run/slave1.pid"; + $slave->[1]->{'path_mysock'}= "$opt_tmpdir/slave1.sock"; + $slave->[1]->{'path_myport'}= $opt_slave_myport + 1; + + $slave->[2]->{'path_myddir'}= "$glob_mysql_test_dir/var/slave2-data"; + $slave->[2]->{'path_myerr'}= "$glob_mysql_test_dir/var/log/slave2.err"; + $slave->[2]->{'path_mylog'}= "$glob_mysql_test_dir/var/log/slave2.log"; + $slave->[2]->{'path_mypid'}= "$glob_mysql_test_dir/var/run/slave2.pid"; + $slave->[2]->{'path_mysock'}= "$opt_tmpdir/slave2.sock"; + $slave->[2]->{'path_myport'}= $opt_slave_myport + 2; + + # Do sanity checks of command line arguments + + if ( $opt_extern and $opt_local ) + { + die "Can't use --extern and --local at the same time"; + } + + if ( ! $opt_socket ) + { # FIXME set default before reading options? +# $opt_socket= '@MYSQL_UNIX_ADDR@'; + $opt_socket= "/tmp/mysql.sock"; # FIXME + } + + if ( $opt_extern ) + { + $glob_use_running_server= 1; + $opt_skip_rpl= 1; # We don't run rpl test cases + $master->[0]->{'path_mysock'}= $opt_socket; + } + + # -------------------------------------------------------------------------- + # Set LD_LIBRARY_PATH if we are using shared libraries + # -------------------------------------------------------------------------- + $ENV{'LD_LIBRARY_PATH'}= + "$glob_basedir/lib:$glob_basedir/libmysql/.libs" . + ($ENV{'LD_LIBRARY_PATH'} ? ":$ENV{'LD_LIBRARY_PATH'}" : ""); + $ENV{'DYLD_LIBRARY_PATH'}= + "$glob_basedir/lib:$glob_basedir/libmysql/.libs" . + ($ENV{'DYLD_LIBRARY_PATH'} ? ":$ENV{'DYLD_LIBRARY_PATH'}" : ""); + + # -------------------------------------------------------------------------- + # Look at the command line options and set script flags + # -------------------------------------------------------------------------- + + if ( $opt_record and ! @ARGV) + { + mtr_error("Will not run in record mode without a specific test case"); + } + + if ( $opt_embedded_server ) + { + $glob_use_embedded_server= 1; + $opt_skip_rpl= 1; # We never run replication with embedded + + if ( $opt_extern ) + { + die "Can't use --extern with --embedded-server"; + } + $opt_result_ext= ".es"; + } + + # FIXME don't understand what this is +# if ( $opt_local_master ) +# { +# $opt_master_myport= 3306; +# } + + if ( $opt_small_bench ) + { + $opt_bench= 1; + } + + if ( $opt_sleep ) + { + $opt_sleep_time_after_restart= $opt_sleep; + } + + if ( $opt_gcov ) + { + if ( $opt_source_dist ) + { + die "Coverage test needs the source - please use source dist"; + } + } + + if ( $opt_gdb ) + { + $opt_wait_timeout= 300; + if ( $opt_extern ) + { + die "Can't use --extern with --gdb"; + } + } + + if ( $opt_manual_gdb ) + { + $opt_gdb= 1; + if ( $opt_extern ) + { + die "Can't use --extern with --manual-gdb"; + } + } + + if ( $opt_ddd ) + { + if ( $opt_extern ) + { + die "Can't use --extern with --ddd"; + } + } + + if ( $opt_ndbconnectstring ) + { + $glob_use_running_ndbcluster= 1; + $opt_with_ndbcluster= 1; + } + + # FIXME + + #if ( $opt_valgrind or $opt_valgrind_all ) + #{ + # VALGRIND=`which valgrind` # this will print an error if not found FIXME + # Give good warning to the user and stop + # if ( ! $VALGRIND ) + # { + # print "You need to have the 'valgrind' program in your PATH to run mysql-test-run with option --valgrind. Valgrind's home page is http://valgrind.kde.org.\n" + # exit 1 + # } + # >=2.1.2 requires the --tool option, some versions write to stdout, some to stderr + # valgrind --help 2>&1 | grep "\-\-tool" > /dev/null && VALGRIND="$VALGRIND --tool=memcheck" + # VALGRIND="$VALGRIND --alignment=8 --leak-check=yes --num-callers=16" + # $opt_extra_mysqld_opt.= " --skip-safemalloc --skip-bdb"; + # SLEEP_TIME_AFTER_RESTART=10 + # $opt_sleep_time_for_delete= 60 + # $glob_use_running_server= "" + # if ( "$1"= "--valgrind-all" ) + # { + # VALGRIND="$VALGRIND -v --show-reachable=yes" + # } + #} + + if ( $opt_user ) + { + $glob_user= $opt_user; + } + elsif ( $glob_use_running_server ) + { + $glob_user= "test"; + } + else + { + $glob_user= "root"; # We want to do FLUSH xxx commands + } + +} + + +############################################################################## +# +# Set paths to various executable programs +# +############################################################################## + +sub executable_setup () { + + if ( $opt_source_dist ) + { + if ( $glob_use_embedded_server ) + { + if ( -f "$glob_basedir/libmysqld/examples/mysqltest" ) + { + $exe_mysqltest= "$glob_basedir/libmysqld/examples/mysqltest"; + } + else + { + mtr_error("Cannot find embedded server 'mysqltest'"); + } + } + else + { + $exe_mysqld= "$glob_basedir/sql/mysqld"; + if ( -f "$glob_basedir/client/.libs/lt-mysqltest" ) + { + $exe_mysqltest= "$glob_basedir/client/.libs/lt-mysqltest"; + } + elsif ( -f "$glob_basedir/client/.libs/mysqltest" ) + { + $exe_mysqltest= "$glob_basedir/client/.libs/mysqltest"; + } + else + { + $exe_mysqltest= "$glob_basedir/client/mysqltest"; + } + } + if ( -f "$glob_basedir/client/.libs/mysqldump" ) + { + $exe_mysqldump= "$glob_basedir/client/.libs/mysqldump"; + } + else + { + $exe_mysqldump= "$glob_basedir/client/mysqldump"; + } + if ( -f "$glob_basedir/client/.libs/mysqlbinlog" ) + { + $exe_mysqlbinlog= "$glob_basedir/client/.libs/mysqlbinlog"; + } + else + { + $exe_mysqlbinlog= "$glob_basedir/client/mysqlbinlog"; + } + + $path_client_bindir= "$glob_basedir/client"; + $path_tests_bindir= "$glob_basedir/tests"; + $exe_mysqladmin= "$path_client_bindir/mysqladmin"; + $exe_mysql= "$path_client_bindir/mysql"; + $path_language= "$glob_basedir/sql/share/english/"; + $path_charsetsdir= "$glob_basedir/sql/share/charsets"; + } + else + { + $path_client_bindir= "$glob_basedir/bin"; + $path_tests_bindir= "$glob_basedir/tests"; + $exe_mysqltest= "$path_client_bindir/mysqltest"; + $exe_mysqldump= "$path_client_bindir/mysqldump"; + $exe_mysqlbinlog= "$path_client_bindir/mysqlbinlog"; + $exe_mysqladmin= "$path_client_bindir/mysqladmin"; + $exe_mysql= "$path_client_bindir/mysql"; + if ( -d "$glob_basedir/share/mysql/english" ) + { + $path_language ="$glob_basedir/share/mysql/english/"; + $path_charsetsdir ="$glob_basedir/share/mysql/charsets"; + } + else + { + $path_language ="$glob_basedir/share/english/"; + $path_charsetsdir ="$glob_basedir/share/charsets"; + } + + if ( -x "$glob_basedir/libexec/mysqld" ) + { + $exe_mysqld= "$glob_basedir/libexec/mysqld"; + } + else + { + $exe_mysqld= "$glob_basedir/bin/mysqld"; + } + + } + + # FIXME special $exe_master_mysqld and $exe_slave_mysqld + # are not used that much.... + + if ( ! $exe_master_mysqld ) + { + $exe_master_mysqld= $exe_mysqld; + } + + if ( ! $exe_slave_mysqld ) + { + $exe_slave_mysqld= $exe_mysqld; + } +} + + +############################################################################## +# +# If we get a ^C, we try to clean up before termination +# +############################################################################## +# FIXME check restrictions what to do in a signal handler + +sub signal_setup () { + $SIG{INT}= \&handle_int_signal; +} + +sub handle_int_signal () { + $SIG{INT}= 'DEFAULT'; # If we get a ^C again, we die... + mtr_warning("got INT signal, cleaning up....."); + stop_masters_slaves(); + exit(1); +} + + +############################################################################## +# +# Collect information about test cases we are to run +# +############################################################################## + +sub collect_test_cases () { + my $testdir= "$glob_mysql_test_dir/t"; + + my @tests; # Array of hash, will be array of C struct + + opendir(TESTDIR, $testdir) or die "Can't open dir \"$testdir\": $!"; + + foreach my $elem ( sort readdir(TESTDIR) ) { + my $tname= mtr_match_extension($elem,"test"); + next if ! defined $tname; + next if $opt_do_test and ! defined mtr_match_prefix($elem,$opt_do_test); + my $path= "$testdir/$elem"; + + # ---------------------------------------------------------------------- + # Skip some tests silently + # ---------------------------------------------------------------------- + + if ( $opt_start_from and $tname lt $opt_start_from ) + { + next; + } + + # ---------------------------------------------------------------------- + # Skip some tests but include in list, just mark them to skip + # ---------------------------------------------------------------------- + + my $tinfo= {}; + $tinfo->{'name'}= $tname; + $tinfo->{'result_file'}= "r/$tname.result"; + push(@tests, $tinfo); + + if ( $opt_skip_test and defined mtr_match_prefix($tname,$opt_skip_test) ) + { + $tinfo->{'skip'}= 1; + next; + } + + # FIXME temporary solution, we have a hard coded list of test cases to + # skip if we are using the embedded server + + if ( $glob_use_embedded_server and + mtr_match_any_exact($tname,\@skip_if_embedded_server) ) + { + $tinfo->{'skip'}= 1; + next; + } + + # ---------------------------------------------------------------------- + # Collect information about test case + # ---------------------------------------------------------------------- + + $tinfo->{'path'}= $path; + + if ( defined mtr_match_prefix($tname,"rpl") ) + { + if ( $opt_skip_rpl ) + { + $tinfo->{'skip'}= 1; + next; + } + + # FIXME currently we always restart slaves + $tinfo->{'slave_restart'}= 1; + + if ( $tname eq 'rpl_failsafe' or $tname eq 'rpl_chain_temp_table' ) + { + $tinfo->{'slave_num'}= 3; + } + else + { + $tinfo->{'slave_num'}= 1; + } + } + + # FIXME what about embedded_server + ndbcluster, skip ?! + + my $master_opt_file= "$testdir/$tname-master.opt"; + my $slave_opt_file= "$testdir/$tname-slave.opt"; + my $slave_mi_file= "$testdir/$tname.slave-mi"; + my $master_sh= "$testdir/$tname-master.sh"; + my $slave_sh= "$testdir/$tname-slave.sh"; + + if ( -f $master_opt_file ) + { + $tinfo->{'master_restart'}= 1; # We think so for now + # This is a dirty hack from old mysql-test-run, we use the opt file + # to flag other things as well, it is not a opt list at all + my $extra_master_opt= mtr_get_opts_from_file($master_opt_file); + + foreach my $opt (@$extra_master_opt) + { + my $value; + + $value= mtr_match_prefix($opt, "--timezone="); + + if ( defined $value ) + { + $ENV{'TZ'}= $value; # FIXME pass this on somehow.... + $extra_master_opt= []; + $tinfo->{'master_restart'}= 0; + last; + } + + $value= mtr_match_prefix($opt, "--result-file="); + + if ( defined $value ) + { + $tinfo->{'result_file'}= "r/$value.result"; + if ( $opt_result_ext and $opt_record or + -f "$tinfo->{'result_file'}$opt_result_ext") + { + $tinfo->{'result_file'}.= $opt_result_ext; + } + $extra_master_opt= []; + $tinfo->{'master_restart'}= 0; + last; + } + } + + $tinfo->{'master_opt'}= $extra_master_opt; + } + + if ( -f $slave_opt_file ) + { + $tinfo->{'slave_opt'}= mtr_get_opts_from_file($slave_opt_file); + $tinfo->{'slave_restart'}= 1; + } + + if ( -f $slave_mi_file ) + { + $tinfo->{'slave_mi'}= mtr_get_opts_from_file($slave_mi_file); + $tinfo->{'slave_restart'}= 1; + } + + if ( -f $master_sh ) + { + if ( $glob_win32 ) + { + $tinfo->{'skip'}= 1; + } + else + { + $tinfo->{'master_sh'}= $master_sh; + $tinfo->{'master_restart'}= 1; + } + } + + if ( -f $slave_sh ) + { + if ( $glob_win32 ) + { + $tinfo->{'skip'}= 1; + } + else + { + $tinfo->{'slave_sh'}= $slave_sh; + $tinfo->{'slave_restart'}= 1; + } + } + + # We can't restart a running server that may be in use + + if ( $glob_use_running_server and + ( $tinfo->{'master_restart'} or $tinfo->{'slave_restart'} ) ) + { + $tinfo->{'skip'}= 1; + } + + } + + closedir TESTDIR; + + return \@tests; +} + + +############################################################################## +# +# Handle left overs from previous runs +# +############################################################################## + +sub kill_and_cleanup () { + + if ( $opt_fast or $glob_use_embedded_server ) + { + # FIXME is embedded server really using PID files?! + unlink($master->[0]->{'path_mypid'}); + unlink($master->[1]->{'path_mypid'}); + unlink($slave->[0]->{'path_mypid'}); + unlink($slave->[1]->{'path_mypid'}); + unlink($slave->[2]->{'path_mypid'}); + } + else + { + # Ensure that no old mysqld test servers are running + # This is different from terminating processes we have + # started from ths run of the script, this is terminating + # leftovers from previous runs. + + mtr_report("Killing Possible Leftover Processes"); + mtr_kill_leftovers(); + } + + if ( $opt_with_ndbcluster and ! $glob_use_running_ndbcluster ) + { + ndbcluster_stop(); + } + + mtr_report("Removing Stale Files"); + + rmtree("$glob_mysql_test_dir/var/log"); + rmtree("$glob_mysql_test_dir/var/ndbcluster"); + rmtree("$glob_mysql_test_dir/var/run"); + rmtree("$glob_mysql_test_dir/var/tmp"); + + mkpath("$glob_mysql_test_dir/var/log"); + mkpath("$glob_mysql_test_dir/var/ndbcluster"); + mkpath("$glob_mysql_test_dir/var/run"); + mkpath("$glob_mysql_test_dir/var/tmp"); + mkpath($opt_tmpdir); + + rmtree("$master->[0]->{'path_myddir'}"); + mkpath("$master->[0]->{'path_myddir'}/mysql"); # Need to create subdir?! + mkpath("$master->[0]->{'path_myddir'}/test"); + + rmtree("$master->[1]->{'path_myddir'}"); + mkpath("$master->[1]->{'path_myddir'}/mysql"); # Need to create subdir?! + mkpath("$master->[1]->{'path_myddir'}/test"); + + rmtree("$slave->[0]->{'path_myddir'}"); + mkpath("$slave->[0]->{'path_myddir'}/mysql"); # Need to create subdir?! + mkpath("$slave->[0]->{'path_myddir'}/test"); + + rmtree("$slave->[1]->{'path_myddir'}"); + mkpath("$slave->[1]->{'path_myddir'}/mysql"); # Need to create subdir?! + mkpath("$slave->[1]->{'path_myddir'}/test"); + + rmtree("$slave->[2]->{'path_myddir'}"); + mkpath("$slave->[2]->{'path_myddir'}/mysql"); # Need to create subdir?! + mkpath("$slave->[2]->{'path_myddir'}/test"); + + $opt_wait_for_master= $opt_sleep_time_for_first_master; + $opt_wait_for_slave= $opt_sleep_time_for_first_slave; +} + + +# FIXME + +sub sleep_until_file_created ($$) { + my $pidfile= shift; + my $timeout= shift; + + my $loop= $timeout * 2; + while ( $loop-- ) + { + if ( -r $pidfile ) + { + return; + } + sleep(1); + } + + if ( ! -r $pidfile ) + { + die "No $pidfile was created"; + } +} + + +############################################################################## +# +# Start the ndb cluster +# +############################################################################## + +# FIXME why is there a different start below?! + +sub ndbcluster_start () { + + mtr_report("Starting ndbcluster"); + my $ndbcluster_opts= $opt_bench ? "" : "--small"; + # FIXME check result code?! + mtr_run("./ndb/ndbcluster", + ["--port-base=$opt_ndbcluster_port", + $ndbcluster_opts, + "--diskless", + "--initial", + "--data-dir=$glob_mysql_test_dir/var"], + "", "", "", ""); +} + +sub ndbcluster_stop () { + mtr_run("./ndb/ndbcluster", + ["--data-dir=$glob_mysql_test_dir/var", + "--port-base=$opt_ndbcluster_port", + "--stop"], + "", "", "", ""); +} + + +############################################################################## +# +# Run the benchmark suite +# +############################################################################## + +sub run_benchmarks ($) { + my $benchmark= shift; + + my $args; + + if ( ! $glob_use_embedded_server and ! $opt_local_master ) + { + $master->[0]->{'pid'}= mysqld_start('master',0,[],[]); + } + + mtr_init_args(\$args); + + mtr_add_arg($args, "--socket=%s", $master->[0]->{'path_mysock'}); + mtr_add_arg($args, "--user=root"); + + if ( $opt_small_bench ) + { + mtr_add_arg($args, "--small-test"); + mtr_add_arg($args, "--small-tables"); + } + + if ( $opt_with_ndbcluster ) + { + mtr_add_arg($args, "--create-options=TYPE=ndb"); + } + + my $benchdir= "$glob_basedir/sql-bench"; + chdir($benchdir); # FIXME check error + + # FIXME write shorter.... + + if ( ! $benchmark ) + { + mtr_add_arg($args, "--log"); + mtr_run("./run-all-tests", $args, "", "", "", ""); + # FIXME check result code?! + } + elsif ( -x $benchmark ) + { + mtr_run("./$benchmark", $args, "", "", "", ""); + # FIXME check result code?! + } + else + { + mtr_error("benchmark $benchmark not found"); + } + + chdir($glob_mysql_test_dir); # Go back + + if ( ! $glob_use_embedded_server ) + { + stop_masters(); + } +} + + +############################################################################## +# +# Run the test suite +# +############################################################################## + +sub run_tests () { + + my $tests= collect_test_cases(); + + mtr_report("Starting Tests"); + + mtr_print_header(); + + foreach my $tinfo ( @$tests ) + { + run_testcase($tinfo); + } + + mtr_print_line(); + + if ( ! $opt_gdb and ! $glob_use_running_server and + ! $opt_ddd and ! $glob_use_embedded_server ) + { + stop_masters_slaves(); + } + + if ( $opt_with_ndbcluster and ! $glob_use_running_ndbcluster ) + { + ndbcluster_stop(); + } + + if ( $opt_gcov ) + { + gcov_collect(); # collect coverage information + } + if ( $opt_gprof ) + { + gprof_collect(); # collect coverage information + } + + mtr_report_stats($tests); +} + + +############################################################################## +# +# Initiate the test databases +# +############################################################################## + +sub mysql_install_db () { + + mtr_report("Installing Test Databases"); + + install_db('master', $master->[0]->{'path_myddir'}); + install_db('slave', $slave->[0]->{'path_myddir'}); + + return 0; +} + + +sub install_db ($$) { + my $type= shift; + my $data_dir= shift; + + my $init_db_sql= "lib/init_db.sql"; # FIXME this is too simple maybe + my $args; + + mtr_report("Installing \u$type Databases"); + + mtr_init_args(\$args); + + mtr_add_arg($args, "--no-defaults"); + mtr_add_arg($args, "--bootstrap"); + mtr_add_arg($args, "--skip-grant-tables"); + mtr_add_arg($args, "--basedir=%s", $path_my_basedir); + mtr_add_arg($args, "--datadir=%s", $data_dir); + mtr_add_arg($args, "--skip-innodb"); + mtr_add_arg($args, "--skip-ndbcluster"); + mtr_add_arg($args, "--skip-bdb"); + + if ( ! $opt_netware ) + { + mtr_add_arg($args, "--language=%s", $path_language); + mtr_add_arg($args, "--character-sets-dir=%s", $path_charsetsdir); + } + + if ( mtr_run($exe_mysqld, $args, $init_db_sql, + $path_manager_log, $path_manager_log, "") != 0 ) + { + mtr_error("error executing mysqld --bootstrap\n" . + "Could not install $type test DBs"); + } +} + + +############################################################################## +# +# Run a single test case +# +############################################################################## + +# When we get here, we have already filtered out test cases that doesn't +# apply to the current setup, for example if we use a running server, test +# cases that restart the server are dropped. So this function should mostly +# be about doing things, not a lot of logic. + +# We don't start and kill the servers for each testcase. But some +# testcases needs a restart, because they specify options to start +# mysqld with. After that testcase, we need to restart again, to set +# back the normal options. + +sub run_testcase ($) { + my $tinfo= shift; + + my $tname= $tinfo->{'name'}; + + mtr_tonewfile($opt_current_test,"$tname\n"); # Always tell where we are + + # ---------------------------------------------------------------------- + # If marked to skip, just print out and return. + # Note that a test case not marked as 'skip' can still be + # skipped later, because of the test case itself in cooperation + # with the mysqltest program tells us so. + # ---------------------------------------------------------------------- + + if ( $tinfo->{'skip'} ) + { + mtr_report_test_skipped($tinfo); + return; + } + + # ---------------------------------------------------------------------- + # If not using a running servers we may need to stop and restart. + # We restart in the case we have initiation scripts, server options + # etc to run. But we also restart again after the test first restart + # and test is run, to get back to normal server settings. + # + # To make the code a bit more clean, we actually only stop servers + # here, and mark this to be done. Then a generic "start" part will + # start up the needed servers again. + # ---------------------------------------------------------------------- + + if ( ! $glob_use_running_server and ! $glob_use_embedded_server ) + { + if ( $tinfo->{'master_restart'} or $master->[0]->{'uses_special_flags'} ) + { + stop_masters(); + $master->[0]->{'uses_special_flags'}= 0; # Forget about why we stopped + } + + # ---------------------------------------------------------------------- + # Always terminate all slaves, if any. Else we may have useless + # reconnection attempts and error messages in case the slave and + # master servers restart. + # ---------------------------------------------------------------------- + + stop_slaves(); + + # ---------------------------------------------------------------------- + # Start masters + # ---------------------------------------------------------------------- + + mtr_tofile($master->[0]->{'path_myerr'},"CURRENT_TEST: $tname\n"); + do_before_start_master($tname,$tinfo->{'master_sh'}); + + # FIXME give the args to the embedded server?! + # FIXME what does $opt_local_master mean?! + # FIXME split up start and check that started so that can do + # starts in parallel, masters and slaves at the same time. + + if ( ! $opt_local_master ) + { + if ( ! $master->[0]->{'pid'} ) + { + $master->[0]->{'pid'}= + mysqld_start('master',0,$tinfo->{'master_opt'},[]); + } + if ( $opt_with_ndbcluster and ! $master->[1]->{'pid'} ) + { + $master->[1]->{'pid'}= + mysqld_start('master',1,$tinfo->{'master_opt'},[]); + } + + if ( $tinfo->{'master_opt'} ) + { + $master->[0]->{'uses_special_flags'}= 1; + } + } + + # ---------------------------------------------------------------------- + # Start slaves - if needed + # ---------------------------------------------------------------------- + + if ( $tinfo->{'slave_num'} ) + { + mtr_tofile($slave->[0]->{'path_myerr'},"CURRENT_TEST: $tname\n"); + + do_before_start_slave($tname,$tinfo->{'slave_sh'}); + + for ( my $idx= 0; $idx < $tinfo->{'slave_num'}; $idx++ ) + { + if ( ! $slave->[$idx]->{'pid'} ) + { + $slave->[$idx]->{'pid'}= + mysqld_start('slave',$idx, + $tinfo->{'slave_opt'}, $tinfo->{'slave_mi'}); + } + } + } + } + + # ---------------------------------------------------------------------- + # Run the test case + # ---------------------------------------------------------------------- + + { + unlink("r/$tname.reject"); + unlink($path_timefile); + + mtr_report_test_name($tinfo); + + my $res= run_mysqltest($tinfo); + + if ( $res == 0 ) + { + mtr_report_test_passed($tinfo); + } + elsif ( $res == 2 ) + { + # Testcase itself tell us to skip this one + mtr_report_test_skipped($tinfo); + } + else + { + # Test case failed + if ( $res > 2 ) + { + mtr_tofile($path_timefile, + "mysqltest returned unexpected code $res, " . + "it has probably crashed"); + } + mtr_report_test_failed($tinfo); + mtr_show_failed_diff($tname); + print "\n"; + if ( ! $opt_force ) + { + print "Aborting: $tname failed. To continue, re-run with '--force'."; + print "\n"; + if ( ! $opt_gdb and ! $glob_use_running_server and + ! $opt_ddd and ! $glob_use_embedded_server ) + { + stop_masters_slaves(); + } + exit(1); + } + + # FIXME always terminate on failure?! + if ( ! $opt_gdb and ! $glob_use_running_server and + ! $opt_ddd and ! $glob_use_embedded_server ) + { + stop_masters_slaves(); + } + print "Resuming Tests\n\n"; + } + } +} + + +############################################################################## +# +# Start and stop servers +# +############################################################################## + +# The embedded server needs the cleanup so we do some of the start work +# but stop before actually running mysqld or anything. + +sub do_before_start_master ($$) { + my $tname= shift; + my $master_init_script= shift; + + # FIXME what about second master..... + + # Remove stale binary logs except for 2 tests which need them FIXME here???? + if ( $tname ne "rpl_crash_binlog_ib_1b" and + $tname ne "rpl_crash_binlog_ib_2b" and + $tname ne "rpl_crash_binlog_ib_3b") + { + # FIXME we really want separate dir for binlogs + `rm -fr $glob_mysql_test_dir/var/log/master-bin.*`; +# unlink("$glob_mysql_test_dir/var/log/master-bin.*"); + } + + # Remove old master.info and relay-log.info files + unlink("$glob_mysql_test_dir/var/master-data/master.info"); + unlink("$glob_mysql_test_dir/var/master-data/relay-log.info"); + unlink("$glob_mysql_test_dir/var/master1-data/master.info"); + unlink("$glob_mysql_test_dir/var/master1-data/relay-log.info"); + + #run master initialization shell script if one exists + + if ( $master_init_script and + mtr_run($master_init_script, [], "", "", "", "") != 0 ) + { + mtr_error("can't run $master_init_script"); + } + # for gcov FIXME needed? If so we need more absolute paths +# chdir($glob_basedir); +} + +sub do_before_start_slave ($$) { + my $tname= shift; + my $slave_init_script= shift; + + # When testing fail-safe replication, we will have more than one slave + # in this case, we start secondary slaves with an argument + + # Remove stale binary logs and old master.info files + # except for too tests which need them + if ( $tname ne "rpl_crash_binlog_ib_1b" and + $tname ne "rpl_crash_binlog_ib_2b" and + $tname ne "rpl_crash_binlog_ib_3b" ) + { + # FIXME we really want separate dir for binlogs + `rm -fr $glob_mysql_test_dir/var/log/slave*-bin.*`; +# unlink("$glob_mysql_test_dir/var/log/slave*-bin.*"); # FIXME idx??? + # FIXME really master?! + unlink("$glob_mysql_test_dir/var/slave-data/master.info"); + unlink("$glob_mysql_test_dir/var/slave-data/relay-log.info"); + } + + #run slave initialization shell script if one exists + if ( $slave_init_script and + mtr_run($slave_init_script, [], "", "", "", "") != 0 ) + { + mtr_error("can't run $slave_init_script"); + } + + unlink("$glob_mysql_test_dir/var/slave-data/log.*"); +} + +sub mysqld_arguments ($$$$$) { + my $args= shift; + my $type= shift; # master/slave/bootstrap + my $idx= shift; + my $extra_opt= shift; + my $slave_master_info= shift; + + my $sidx= ""; # Index as string, 0 is empty string + if ( $idx > 0 ) + { + $sidx= sprintf("%d", $idx); # sprintf not needed in Perl for this + } + + my $prefix= ""; # If mysqltest server arg + + if ( $glob_use_embedded_server ) + { + $prefix= "--server-arg="; + } + + mtr_add_arg($args, "%s--no-defaults", $prefix); + mtr_add_arg($args, "%s--basedir=%s", $prefix, $path_my_basedir); + mtr_add_arg($args, "%s--character-sets-dir=%s", $prefix, $path_charsetsdir); + mtr_add_arg($args, "%s--core", $prefix); + mtr_add_arg($args, "%s--default-character-set=latin1", $prefix); + mtr_add_arg($args, "%s--language=%s", $prefix, $path_language); + mtr_add_arg($args, "%s--tmpdir=$opt_tmpdir", $prefix); + + if ( $opt_valgrind ) + { + mtr_add_arg($args, "%s--skip-safemalloc", $prefix); + mtr_add_arg($args, "%s--skip-bdb", $prefix); + } + + my $pidfile; + + if ( $type eq 'master' ) + { + mtr_add_arg($args, "%s--log-bin=%s/var/log/master-bin", $prefix, + $glob_mysql_test_dir); + mtr_add_arg($args, "%s--pid-file=%s", $prefix, + $master->[$idx]->{'path_mypid'}); + mtr_add_arg($args, "%s--port=%d", $prefix, + $master->[$idx]->{'path_myport'}); + mtr_add_arg($args, "%s--server-id=1", $prefix); + mtr_add_arg($args, "%s--socket=%s", $prefix, + $master->[$idx]->{'path_mysock'}); + mtr_add_arg($args, "%s--innodb_data_file_path=ibdata1:50M", $prefix); + mtr_add_arg($args, "%s--local-infile", $prefix); + mtr_add_arg($args, "%s--datadir=%s", $prefix, + $master->[$idx]->{'path_myddir'}); + } + + if ( $type eq 'slave' ) + { + my $slave_server_id= 2 + $idx; + my $slave_rpl_rank= $idx > 0 ? 2 : $slave_server_id; + + mtr_add_arg($args, "%s--datadir=%s", $prefix, + $slave->[$idx]->{'path_myddir'}); + mtr_add_arg($args, "%s--exit-info=256", $prefix); + mtr_add_arg($args, "%s--init-rpl-role=slave", $prefix); + mtr_add_arg($args, "%s--log-bin=%s/var/log/slave%s-bin", $prefix, + $glob_mysql_test_dir, $sidx); # FIXME use own dir for binlogs + mtr_add_arg($args, "%s--log-slave-updates", $prefix); + mtr_add_arg($args, "%s--log=%s", $prefix, + $slave->[$idx]->{'path_myerr'}); + mtr_add_arg($args, "%s--master-retry-count=10", $prefix); + mtr_add_arg($args, "%s--pid-file=%s", $prefix, + $slave->[$idx]->{'path_mypid'}); + mtr_add_arg($args, "%s--port=%d", $prefix, + $slave->[$idx]->{'path_myport'}); + mtr_add_arg($args, "%s--relay-log=%s/var/log/slave%s-relay-bin", $prefix, + $glob_mysql_test_dir, $sidx); + mtr_add_arg($args, "%s--report-host=127.0.0.1", $prefix); + mtr_add_arg($args, "%s--report-port=%d", $prefix, + $slave->[$idx]->{'path_myport'}); + mtr_add_arg($args, "%s--report-user=root", $prefix); + mtr_add_arg($args, "%s--skip-innodb", $prefix); + mtr_add_arg($args, "%s--skip-ndbcluster", $prefix); + mtr_add_arg($args, "%s--skip-slave-start", $prefix); + mtr_add_arg($args, "%s--slave-load-tmpdir=%s", $prefix, + $path_slave_load_tmpdir); + mtr_add_arg($args, "%s--socket=%s", $prefix, + $slave->[$idx]->{'path_mysock'}); + mtr_add_arg($args, "%s--set-variable=slave_net_timeout=10", $prefix); + + if ( @$slave_master_info ) + { + foreach my $arg ( @$slave_master_info ) + { + mtr_add_arg($args, "%s%s", $prefix, $arg); + } + } + else + { + mtr_add_arg($args, "%s--master-user=root", $prefix); + mtr_add_arg($args, "%s--master-connect-retry=1", $prefix); + mtr_add_arg($args, "%s--master-host=127.0.0.1", $prefix); + mtr_add_arg($args, "%s--master-password=", $prefix); + mtr_add_arg($args, "%s--master-port=%d", $prefix, + $master->[0]->{'path_myport'}); # First master + mtr_add_arg($args, "%s--server-id=%d", $prefix, $slave_server_id); + mtr_add_arg($args, "%s--rpl-recovery-rank=%d", $prefix, $slave_rpl_rank); + } + } # end slave + + if ( $opt_debug ) + { + if ( $type eq 'master' ) + { + mtr_add_arg($args, "--debug=d:t:i:A,%s/var/log/master%s.trace", + $prefix, $glob_mysql_test_dir, $sidx); + } + if ( $type eq 'slave' ) + { + mtr_add_arg($args, "--debug=d:t:i:A,%s/var/log/slave%s.trace", + $prefix, $glob_mysql_test_dir, $sidx); + } + } + + if ( $opt_with_ndbcluster ) + { + mtr_add_arg($args, "%s--ndbcluster", $prefix); + + if ( $glob_use_running_ndbcluster ) + { + mtr_add_arg($args,"--ndb-connectstring=%s", $prefix, + $opt_ndbconnectstring); + } + else + { + mtr_add_arg($args,"--ndb-connectstring=host=localhost:%d", + $prefix, $opt_ndbcluster_port); + } + } + + # FIXME always set nowdays??? SMALL_SERVER + mtr_add_arg($args, "%s--key_buffer_size=1M", $prefix); + mtr_add_arg($args, "%s--sort_buffer=256K", $prefix); + mtr_add_arg($args, "%s--max_heap_table_size=1M", $prefix); + + if ( $opt_with_openssl ) + { + mtr_add_arg($args, "%s--ssl-ca=%s/SSL/cacert.pem", $prefix, $glob_basedir); + mtr_add_arg($args, "%s--ssl-cert=%s/SSL/server-cert.pem", $prefix, + $glob_basedir); + mtr_add_arg($args, "%s--ssl-key=%s/SSL/server-key.pem", $prefix, + $glob_basedir); + } + + if ( $opt_warnings ) + { + mtr_add_arg($args, "%s--log-warnings", $prefix); + } + + if ( $opt_gdb or $opt_client_gdb or $opt_manual_gdb or $opt_ddd) + { + mtr_add_arg($args, "%s--gdb", $prefix); + } + + # If we should run all tests cases, we will use a local server for that + + if ( -w "/" ) + { + # We are running as root; We need to add the --root argument + mtr_add_arg($args, "%s--user=root", $prefix); + } + + if ( $type eq 'master' ) + { + + if ( ! $opt_old_master ) + { + mtr_add_arg($args, "%s--rpl-recovery-rank=1", $prefix); + mtr_add_arg($args, "%s--init-rpl-role=master", $prefix); + } + + # FIXME strange,..... + if ( $opt_local_master ) + { + mtr_add_arg($args, "%s--host=127.0.0.1", $prefix); + mtr_add_arg($args, "%s--port=%s", $prefix, $ENV{'MYSQL_MYPORT'}); + } + } + + foreach my $arg ( @$extra_opt ) + { + mtr_add_arg($args, "%s%s", $prefix, $arg); + } + + if ( $opt_bench ) + { + mtr_add_arg($args, "%s--rpl-recovery-rank=1", $prefix); + mtr_add_arg($args, "%s--init-rpl-role=master", $prefix); + } + else + { + mtr_add_arg($args, "%s--exit-info=256", $prefix); + mtr_add_arg($args, "%s--open-files-limit=1024", $prefix); + + if ( $type eq 'master' ) + { + mtr_add_arg($args, "%s--log=%s", $prefix, $master->[0]->{'path_mylog'}); + } + if ( $type eq 'slave' ) + { + mtr_add_arg($args, "%s--log=%s", $prefix, $slave->[0]->{'path_mylog'}); + } + } + + return $args; +} + +# FIXME +# if ( $type eq 'master' and $glob_use_embedded_server ) +# { +# # Add a -A to each argument to pass it to embedded server +# my @mysqltest_opt= map {("-A",$_)} @args; +# $opt_extra_mysqltest_opt= \@mysqltest_opt; +# return; +# } + +############################################################################## +# +# Start mysqld and return the PID +# +############################################################################## + +sub mysqld_start ($$$$) { + my $type= shift; # master/slave/bootstrap + my $idx= shift; + my $extra_opt= shift; + my $slave_master_info= shift; + + my $args; # Arg vector + my $exe; + my $pid; + + # FIXME code duplication, make up your mind.... + if ( $opt_source_dist ) + { + $exe= "$glob_basedir/sql/mysqld"; + } + else + { + $exe ="$glob_basedir/libexec/mysqld"; + if ( ! -x $exe ) + { + $exe ="$glob_basedir/bin/mysqld"; + } + } + + mtr_init_args(\$args); + + if ( $opt_valgrind ) + { + + mtr_add_arg($args, "--tool=memcheck"); + mtr_add_arg($args, "--alignment=8"); + mtr_add_arg($args, "--leak-check=yes"); + mtr_add_arg($args, "--num-callers=16"); + + if ( $opt_valgrind_all ) + { + mtr_add_arg($args, "-v"); + mtr_add_arg($args, "--show-reachable=yes"); + } + + if ( $opt_valgrind_options ) + { + # FIXME split earlier and put into @glob_valgrind_* + mtr_add_arg($args, split(' ', $opt_valgrind_options)); + } + + mtr_add_arg($args, $exe); + + $exe= $opt_valgrind; + } + + mysqld_arguments($args,$type,$idx,$extra_opt,$slave_master_info); + + if ( $type eq 'master' ) + { + if ( $pid= mtr_spawn($exe, $args, "", + $master->[$idx]->{'path_myerr'}, + $master->[$idx]->{'path_myerr'}, "") ) + { + sleep_until_file_created($master->[$idx]->{'path_mypid'}, + $opt_wait_for_master); + $opt_wait_for_master= $opt_sleep_time_for_second_master; + return $pid; + } + } + + if ( $type eq 'slave' ) + { + if ( $pid= mtr_spawn($exe, $args, "", + $slave->[$idx]->{'path_myerr'}, + $slave->[$idx]->{'path_myerr'}, "") ) + { + sleep_until_file_created($slave->[$idx]->{'path_mypid'}, + $opt_wait_for_slave); + $opt_wait_for_slave= $opt_sleep_time_for_second_slave; + return $pid; + } + } + + die "Can't start mysqld FIXME"; +} + +sub stop_masters_slaves () { + + print "Ending Tests\n"; + print "Shutting-down MySQL daemon\n\n"; + stop_masters(); + print "Master(s) shutdown finished\n"; + stop_slaves(); + print "Slave(s) shutdown finished\n"; +} + +sub stop_masters () { + + my @args; + + for ( my $idx; $idx < 2; $idx++ ) + { + # FIXME if we hit ^C before fully started, this test will prevent + # the mysqld process from being killed + if ( $master->[$idx]->{'pid'} ) + { + push(@args, + $master->[$idx]->{'path_mypid'}, + $master->[$idx]->{'path_mysock'}, + ); + $master->[$idx]->{'pid'}= 0; + } + } + + mtr_stop_servers(\@args); +} + +sub stop_slaves () { + my $force= shift; + + my @args; + + for ( my $idx; $idx < 3; $idx++ ) + { + if ( $slave->[$idx]->{'pid'} ) + { + push(@args, + $slave->[$idx]->{'path_mypid'}, + $slave->[$idx]->{'path_mysock'}, + ); + $slave->[$idx]->{'pid'}= 0; + } + } + + mtr_stop_servers(\@args); +} + + +sub run_mysqltest ($) { + my $tinfo= shift; + + # FIXME set where???? + my $cmdline_mysqldump= "$exe_mysqldump --no-defaults -uroot " . + "--socket=$master->[0]->{'path_mysock'} --password="; + if ( $opt_debug ) + { + $cmdline_mysqldump .= + " --debug=d:t:A,$glob_mysql_test_dir/var/log/mysqldump.trace"; + } + + my $cmdline_mysqlbinlog= + "$exe_mysqlbinlog --no-defaults --local-load=$opt_tmpdir"; + + if ( $opt_debug ) + { + $cmdline_mysqlbinlog .= + " --debug=d:t:A,$glob_mysql_test_dir/var/log/mysqlbinlog.trace"; + } + + my $cmdline_mysql= + "$exe_mysql --host=localhost --port=$master->[0]->{'path_myport'} " . + "--socket=$master->[0]->{'path_mysock'} --user=root --password="; + + $ENV{'MYSQL'}= $exe_mysql; + $ENV{'MYSQL_DUMP'}= $cmdline_mysqldump; + $ENV{'MYSQL_BINLOG'}= $exe_mysqlbinlog; + $ENV{'CLIENT_BINDIR'}= $path_client_bindir; + $ENV{'TESTS_BINDIR'}= $path_tests_bindir; + + my $exe= $exe_mysqltest; + my $args; # Arg vector + + mtr_init_args(\$args); + + if ( $opt_strace_client ) + { + $exe= "strace"; # FIXME there are ktrace, .... + mtr_add_arg($args, "-o"); + mtr_add_arg($args, "%s/var/log/mysqltest.strace", $glob_mysql_test_dir); + mtr_add_arg($args, "$exe_mysqltest"); + } + + mtr_add_arg($args, "--no-defaults"); + mtr_add_arg($args, "--socket=%s", $master->[0]->{'path_mysock'}); + mtr_add_arg($args, "--database=test"); + mtr_add_arg($args, "--user=%s", $glob_user); + mtr_add_arg($args, "--password="); + mtr_add_arg($args, "--silent"); + mtr_add_arg($args, "-v"); + mtr_add_arg($args, "--skip-safemalloc"); + mtr_add_arg($args, "--tmpdir=%s", $opt_tmpdir); + mtr_add_arg($args, "--port=%d", $master->[0]->{'path_myport'}); + + if ( $opt_timer ) + { + mtr_add_arg($args, "--timer-file=var/log/timer"); + } + + if ( $opt_big_test ) + { + mtr_add_arg($args, "--big-test"); + } + + if ( $opt_record ) + { + mtr_add_arg($args, "--record"); + } + + if ( $opt_compress ) + { + mtr_add_arg($args, "--compress"); + } + + if ( $opt_sleep ) + { + mtr_add_arg($args, "--sleep=%d", $opt_sleep); + } + + if ( $opt_debug ) + { + mtr_add_arg($args, "--debug=d:t:A,%s/var/log/mysqltest.trace", + $glob_mysql_test_dir); + } + + if ( $opt_with_openssl ) + { + mtr_add_arg($args, "--ssl-ca=%s/SSL/cacert.pem", $glob_basedir); + mtr_add_arg($args, "--ssl-cert=%s/SSL/client-cert.pem", $glob_basedir); + mtr_add_arg($args, "--ssl-key=%s/SSL/client-key.pem", $glob_basedir); + } + + mtr_add_arg($args, "-R"); + mtr_add_arg($args, $tinfo->{'result_file'}); + + if ( $glob_use_embedded_server ) + { + mysqld_arguments($args,'master',0,$tinfo->{'master_opt'},[]); + } + + return mtr_run($exe_mysqltest,$args,$tinfo->{'path'},"",$path_timefile,""); +} From 1ffd688a4a341157df30602a7f3c6d97f9a4e010 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 30 Dec 2004 21:18:10 +0300 Subject: [PATCH 0611/1063] Fix for bug #7515 "from_unixtime(0) now returns NULL instead of the Epoch". (With after review fixes). mysql-test/r/func_time.result: Added test for bug #7515 "from_unixtime(0) now returns NULL instead of the Epoch". mysql-test/t/func_time.test: Added test for bug #7515 "from_unixtime(0) now returns NULL instead of the Epoch". sql/item_timefunc.cc: Item_func_from_unixtime: from_unixtime(0) should return Epoch instead of NULL. sql/item_timefunc.h: Item_func_from_unixtime: - Removed unused method definition. - fix_length_and_dec() should set maybe_null to true since now from_unixtime() can return NULL even in case when none of its arguments is NULL. --- mysql-test/r/func_time.result | 7 +++++-- mysql-test/t/func_time.test | 8 ++++++-- sql/item_timefunc.cc | 10 ++++++---- sql/item_timefunc.h | 3 +-- 4 files changed, 18 insertions(+), 10 deletions(-) diff --git a/mysql-test/r/func_time.result b/mysql-test/r/func_time.result index 32034bf289d..c1e75b60e4f 100644 --- a/mysql-test/r/func_time.result +++ b/mysql-test/r/func_time.result @@ -470,9 +470,12 @@ unix_timestamp(@a) select unix_timestamp('1969-12-01 19:00:01'); unix_timestamp('1969-12-01 19:00:01') 0 -select from_unixtime(0); -from_unixtime(0) +select from_unixtime(-1); +from_unixtime(-1) NULL select from_unixtime(2145916800); from_unixtime(2145916800) NULL +select from_unixtime(0); +from_unixtime(0) +1970-01-01 03:00:00 diff --git a/mysql-test/t/func_time.test b/mysql-test/t/func_time.test index da18269cf6a..60c7aa49fbf 100644 --- a/mysql-test/t/func_time.test +++ b/mysql-test/t/func_time.test @@ -228,7 +228,11 @@ select unix_timestamp('1969-12-01 19:00:01'); # # Test for bug #6439 "unix_timestamp() function returns wrong datetime -# values for too big argument". It should return error instead. +# values for too big argument" and bug #7515 "from_unixtime(0) now +# returns NULL instead of the epoch". unix_timestamp() should return error +# for too big or negative argument. It should return Epoch value for zero +# argument since it seems that many user's rely on this fact. # -select from_unixtime(0); +select from_unixtime(-1); select from_unixtime(2145916800); +select from_unixtime(0); diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index d188310be24..b03fd151383 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -946,10 +946,12 @@ bool Item_func_from_unixtime::get_date(TIME *ltime, { struct tm tm_tmp; time_t tmp; - longlong arg= args[0]->val_int(); - if ((null_value= (args[0]->null_value || - arg < TIMESTAMP_MIN_VALUE || - arg > TIMESTAMP_MAX_VALUE))) + ulonglong arg= (ulonglong)(args[0]->val_int()); + /* + "arg > TIMESTAMP_MAX_VALUE" check also covers case of negative + from_unixtime() argument since arg is unsigned. + */ + if ((null_value= (args[0]->null_value || arg > TIMESTAMP_MAX_VALUE))) return 1; tmp= arg; localtime_r(&tmp,&tm_tmp); diff --git a/sql/item_timefunc.h b/sql/item_timefunc.h index e04e24627d9..8ee2f935a80 100644 --- a/sql/item_timefunc.h +++ b/sql/item_timefunc.h @@ -359,8 +359,7 @@ class Item_func_from_unixtime :public Item_date_func longlong val_int(); String *val_str(String *str); const char *func_name() const { return "from_unixtime"; } - void fix_length_and_dec() { decimals=0; max_length=19; } -// enum Item_result result_type () const { return STRING_RESULT; } + void fix_length_and_dec() { decimals=0; max_length=19; maybe_null= 1; } bool get_date(TIME *res,bool fuzzy_date); }; From 523882ab71ee8b1d9e4c0f682b96069d5f8d83c9 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 30 Dec 2004 19:56:09 +0100 Subject: [PATCH 0612/1063] Fix for bug #7480 Mysqld crash in ha_ndbcluster using Query Browser BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted --- BitKeeper/etc/logging_ok | 1 + sql/ha_ndbcluster.cc | 77 +++++++++++++++++++++++++--------------- sql/ha_ndbcluster.h | 2 +- 3 files changed, 51 insertions(+), 29 deletions(-) diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok index 62b00f97f06..140d1359b08 100644 --- a/BitKeeper/etc/logging_ok +++ b/BitKeeper/etc/logging_ok @@ -100,6 +100,7 @@ lenz@mysql.com magnus@neptunus.(none) magnus@shellback.(none) marko@hundin.mysql.fi +marty@linux.site matt@mysql.com miguel@hegel.(none) miguel@hegel.br diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 145fd23ff43..f96114d8460 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -204,6 +204,12 @@ Thd_ndb::~Thd_ndb() delete ndb; } +inline +Ndb *ha_ndbcluster::get_ndb() +{ + return ((Thd_ndb*)current_thd->transaction.thd_ndb)->ndb; +} + /* * manage uncommitted insert/deletes during transactio to get records correct */ @@ -233,8 +239,9 @@ void ha_ndbcluster::records_update() info->no_uncommitted_rows_count)); // if (info->records == ~(ha_rows)0) { + Ndb *ndb= get_ndb(); Uint64 rows; - if(ndb_get_table_statistics(m_ndb, m_tabname, &rows, 0) == 0){ + if(ndb_get_table_statistics(ndb, m_tabname, &rows, 0) == 0){ info->records= rows; } } @@ -311,7 +318,8 @@ int ha_ndbcluster::ndb_err(NdbConnection *trans) switch (err.classification) { case NdbError::SchemaError: { - NDBDICT *dict= m_ndb->getDictionary(); + Ndb *ndb= get_ndb(); + NDBDICT *dict= ndb->getDictionary(); DBUG_PRINT("info", ("invalidateTable %s", m_tabname)); dict->invalidateTable(m_tabname); table->version=0L; /* Free when thread is ready */ @@ -341,7 +349,7 @@ bool ha_ndbcluster::get_error_message(int error, DBUG_ENTER("ha_ndbcluster::get_error_message"); DBUG_PRINT("enter", ("error: %d", error)); - Ndb *ndb= ((Thd_ndb*)current_thd->transaction.thd_ndb)->ndb; + Ndb *ndb= get_ndb(); if (!ndb) DBUG_RETURN(FALSE); @@ -670,7 +678,8 @@ bool ha_ndbcluster::uses_blob_value(bool all_fields) int ha_ndbcluster::get_metadata(const char *path) { - NDBDICT *dict= m_ndb->getDictionary(); + Ndb *ndb= get_ndb(); + NDBDICT *dict= ndb->getDictionary(); const NDBTAB *tab; int error; bool invalidating_ndb_table= FALSE; @@ -745,7 +754,8 @@ int ha_ndbcluster::build_index_list(TABLE *tab, enum ILBP phase) static const char* unique_suffix= "$unique"; KEY* key_info= tab->key_info; const char **key_name= tab->keynames.type_names; - NdbDictionary::Dictionary *dict= m_ndb->getDictionary(); + Ndb *ndb= get_ndb(); + NdbDictionary::Dictionary *dict= ndb->getDictionary(); DBUG_ENTER("build_index_list"); // Save information about all known indexes @@ -1651,7 +1661,8 @@ int ha_ndbcluster::write_row(byte *record) if (table->primary_key == MAX_KEY) { // Table has hidden primary key - Uint64 auto_value= m_ndb->getAutoIncrementValue((const NDBTAB *) m_table); + Ndb *ndb= get_ndb(); + Uint64 auto_value= ndb->getAutoIncrementValue((const NDBTAB *) m_table); if (set_hidden_key(op, table->fields, (const byte*)&auto_value)) ERR_RETURN(op->getNdbError()); } @@ -1727,11 +1738,12 @@ int ha_ndbcluster::write_row(byte *record) } if ((has_auto_increment) && (skip_auto_increment)) { + Ndb *ndb= get_ndb(); Uint64 next_val= (Uint64) table->next_number_field->val_int() + 1; DBUG_PRINT("info", ("Trying to set next auto increment value to %lu", (ulong) next_val)); - if (m_ndb->setAutoIncrementValue((const NDBTAB *) m_table, next_val, TRUE)) + if (ndb->setAutoIncrementValue((const NDBTAB *) m_table, next_val, TRUE)) DBUG_PRINT("info", ("Setting next auto increment value to %u", next_val)); } @@ -2536,8 +2548,11 @@ void ha_ndbcluster::info(uint flag) } else { + if ((my_errno= check_ndb_connection())) + DBUG_VOID_RETURN; + Ndb *ndb= get_ndb(); Uint64 rows; - if(ndb_get_table_statistics(m_ndb, m_tabname, &rows, 0) == 0){ + if(ndb_get_table_statistics(ndb, m_tabname, &rows, 0) == 0){ records= rows; } } @@ -2863,6 +2878,7 @@ int ha_ndbcluster::external_lock(THD *thd, int lock_type) DBUG_RETURN(1); Thd_ndb *thd_ndb= (Thd_ndb*)thd->transaction.thd_ndb; + Ndb *ndb= thd_ndb->ndb; DBUG_PRINT("enter", ("transaction.thd_ndb->lock_count: %d", thd_ndb->lock_count)); @@ -2880,9 +2896,9 @@ int ha_ndbcluster::external_lock(THD *thd, int lock_type) DBUG_ASSERT(!thd->transaction.stmt.ndb_tid); DBUG_PRINT("trans",("Starting transaction stmt")); - trans= m_ndb->startTransaction(); + trans= ndb->startTransaction(); if (trans == NULL) - ERR_RETURN(m_ndb->getNdbError()); + ERR_RETURN(ndb->getNdbError()); no_uncommitted_rows_reset(thd); thd->transaction.stmt.ndb_tid= trans; } @@ -2894,9 +2910,9 @@ int ha_ndbcluster::external_lock(THD *thd, int lock_type) // A "master" transaction ha not been started yet DBUG_PRINT("trans",("starting transaction, all")); - trans= m_ndb->startTransaction(); + trans= ndb->startTransaction(); if (trans == NULL) - ERR_RETURN(m_ndb->getNdbError()); + ERR_RETURN(ndb->getNdbError()); no_uncommitted_rows_reset(thd); /* @@ -2935,7 +2951,7 @@ int ha_ndbcluster::external_lock(THD *thd, int lock_type) retrieve_all_fields= FALSE; ops_pending= 0; { - NDBDICT *dict= m_ndb->getDictionary(); + NDBDICT *dict= ndb->getDictionary(); const NDBTAB *tab; void *tab_info; if (!(tab= dict->getTable(m_tabname, &tab_info))) @@ -2962,7 +2978,7 @@ int ha_ndbcluster::external_lock(THD *thd, int lock_type) We must in this case close the transaction to release resources */ DBUG_PRINT("trans",("ending non-updating transaction")); - m_ndb->closeTransaction(m_active_trans); + ndb->closeTransaction(m_active_trans); thd->transaction.stmt.ndb_tid= 0; } } @@ -3008,16 +3024,17 @@ int ha_ndbcluster::start_stmt(THD *thd) NdbConnection *trans= (NdbConnection*)thd->transaction.stmt.ndb_tid; if (!trans){ + Ndb *ndb= ((Thd_ndb*)thd->transaction.thd_ndb)->ndb; DBUG_PRINT("trans",("Starting transaction stmt")); NdbConnection *tablock_trans= (NdbConnection*)thd->transaction.all.ndb_tid; DBUG_PRINT("info", ("tablock_trans: %x", (uint)tablock_trans)); DBUG_ASSERT(tablock_trans); -// trans= m_ndb->hupp(tablock_trans); - trans= m_ndb->startTransaction(); +// trans= ndb->hupp(tablock_trans); + trans= ndb->startTransaction(); if (trans == NULL) - ERR_RETURN(m_ndb->getNdbError()); + ERR_RETURN(ndb->getNdbError()); no_uncommitted_rows_reset(thd); thd->transaction.stmt.ndb_tid= trans; } @@ -3363,7 +3380,8 @@ int ha_ndbcluster::create(const char *name, DBUG_RETURN(my_errno); // Create the table in NDB - NDBDICT *dict= m_ndb->getDictionary(); + Ndb *ndb= get_ndb(); + NDBDICT *dict= ndb->getDictionary(); if (dict->createTable(tab) != 0) { const NdbError err= dict->getNdbError(); @@ -3408,7 +3426,8 @@ int ha_ndbcluster::create_index(const char *name, KEY *key_info, bool unique) { - NdbDictionary::Dictionary *dict= m_ndb->getDictionary(); + Ndb *ndb= get_ndb(); + NdbDictionary::Dictionary *dict= ndb->getDictionary(); KEY_PART_INFO *key_part= key_info->key_part; KEY_PART_INFO *end= key_part + key_info->key_parts; @@ -3476,7 +3495,8 @@ int ha_ndbcluster::rename_table(const char *from, const char *to) int ha_ndbcluster::alter_table_name(const char *from, const char *to) { - NDBDICT *dict= m_ndb->getDictionary(); + Ndb *ndb= get_ndb(); + NDBDICT *dict= ndb->getDictionary(); const NDBTAB *orig_tab; DBUG_ENTER("alter_table_name_table"); DBUG_PRINT("enter", ("Renaming %s to %s", from, to)); @@ -3521,8 +3541,9 @@ int ha_ndbcluster::delete_table(const char *name) int ha_ndbcluster::drop_table() { - NdbDictionary::Dictionary *dict= m_ndb->getDictionary(); - + Ndb *ndb= get_ndb(); + NdbDictionary::Dictionary *dict= ndb->getDictionary(); + DBUG_ENTER("drop_table"); DBUG_PRINT("enter", ("Deleting %s", m_tabname)); @@ -3555,6 +3576,7 @@ longlong ha_ndbcluster::get_auto_increment() { DBUG_ENTER("get_auto_increment"); DBUG_PRINT("enter", ("m_tabname: %s", m_tabname)); + Ndb *ndb= get_ndb(); int cache_size= (rows_to_insert - rows_inserted < autoincrement_prefetch) ? rows_to_insert - rows_inserted @@ -3563,8 +3585,8 @@ longlong ha_ndbcluster::get_auto_increment() : autoincrement_prefetch; Uint64 auto_value= (skip_auto_increment) ? - m_ndb->readAutoIncrementValue((const NDBTAB *) m_table) - : m_ndb->getAutoIncrementValue((const NDBTAB *) m_table, cache_size); + ndb->readAutoIncrementValue((const NDBTAB *) m_table) + : ndb->getAutoIncrementValue((const NDBTAB *) m_table, cache_size); DBUG_RETURN((longlong)auto_value); } @@ -3577,7 +3599,6 @@ ha_ndbcluster::ha_ndbcluster(TABLE *table_arg): handler(table_arg), m_active_trans(NULL), m_active_cursor(NULL), - m_ndb(NULL), m_table(NULL), m_table_info(NULL), m_table_flags(HA_REC_NOT_IN_SEQ | @@ -3700,7 +3721,6 @@ int ha_ndbcluster::close(void) DBUG_ENTER("close"); free_share(m_share); m_share= 0; release_metadata(); - m_ndb= NULL; DBUG_RETURN(0); } @@ -3761,11 +3781,12 @@ Ndb* check_ndb_in_thd(THD* thd) int ha_ndbcluster::check_ndb_connection() { THD* thd= current_thd; + Ndb *ndb; DBUG_ENTER("check_ndb_connection"); - if (!(m_ndb= check_ndb_in_thd(thd))) + if (!(ndb= check_ndb_in_thd(thd))) DBUG_RETURN(HA_ERR_NO_CONNECTION); - m_ndb->setDatabaseName(m_dbname); + ndb->setDatabaseName(m_dbname); DBUG_RETURN(0); } diff --git a/sql/ha_ndbcluster.h b/sql/ha_ndbcluster.h index 8224d1c4167..47d2c8f1ab9 100644 --- a/sql/ha_ndbcluster.h +++ b/sql/ha_ndbcluster.h @@ -229,7 +229,6 @@ class ha_ndbcluster: public handler NdbConnection *m_active_trans; NdbResultSet *m_active_cursor; - Ndb *m_ndb; void *m_table; void *m_table_info; char m_dbname[FN_HEADLEN]; @@ -257,6 +256,7 @@ class ha_ndbcluster: public handler uint32 blobs_buffer_size; uint dupkey; + Ndb *get_ndb(); void set_rec_per_key(); void records_update(); void no_uncommitted_rows_execute_failure(); From 40a0199e77aa5305a6699b0572e8d913eea8d170 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 30 Dec 2004 21:01:11 +0100 Subject: [PATCH 0613/1063] unsufficient privilege checks in GRANT, when a grantor has column-level privileges --- mysql-test/r/alter_table.result | 2 +- mysql-test/r/grant.result | 2 +- mysql-test/r/grant_cache.result | 6 +- sql/sql_acl.cc | 100 ++++++++++++++++---------------- 4 files changed, 55 insertions(+), 55 deletions(-) diff --git a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result index e7a8d2c7cdf..78925a64e93 100644 --- a/mysql-test/r/alter_table.result +++ b/mysql-test/r/alter_table.result @@ -121,7 +121,7 @@ create database mysqltest; create table mysqltest.t1 (a int,b int,c int); grant all on mysqltest.t1 to mysqltest_1@localhost; alter table t1 rename t2; -insert command denied to user: 'mysqltest_1@localhost' for table 't2' +INSERT,CREATE command denied to user: 'mysqltest_1@localhost' for table 't2' revoke all privileges on mysqltest.t1 from mysqltest_1@localhost; delete from mysql.user where user='mysqltest_1'; drop database mysqltest; diff --git a/mysql-test/r/grant.result b/mysql-test/r/grant.result index 19d83a95c5e..9df50a242d7 100644 --- a/mysql-test/r/grant.result +++ b/mysql-test/r/grant.result @@ -198,7 +198,7 @@ GRANT UPDATE (d) ON `mysqltest_2`.`t2` TO 'mysqltest_3'@'localhost' update mysqltest_1.t1, mysqltest_1.t2 set q=10 where b=1; UPDATE command denied to user: 'mysqltest_3@localhost' for column 'q' in table 't1' update mysqltest_1.t1, mysqltest_2.t2 set d=20 where d=1; -select command denied to user: 'mysqltest_3@localhost' for table 't1' +SELECT command denied to user: 'mysqltest_3@localhost' for table 't1' update mysqltest_2.t1, mysqltest_1.t2 set c=20 where b=1; UPDATE command denied to user: 'mysqltest_3@localhost' for column 'c' in table 't1' update mysqltest_2.t1, mysqltest_2.t2 set d=10 where s=2; diff --git a/mysql-test/r/grant_cache.result b/mysql-test/r/grant_cache.result index 96eb9d2bc62..e31294154bb 100644 --- a/mysql-test/r/grant_cache.result +++ b/mysql-test/r/grant_cache.result @@ -121,7 +121,7 @@ a b c a 1 1 1 test.t1 2 2 2 test.t1 select * from t2; -select command denied to user: 'mysqltest_2@localhost' for table 't2' +SELECT command denied to user: 'mysqltest_2@localhost' for table 't2' show status like "Qcache_queries_in_cache"; Variable_name Value Qcache_queries_in_cache 6 @@ -135,7 +135,7 @@ select "user3"; user3 user3 select * from t1; -select command denied to user: 'mysqltest_3@localhost' for column 'b' in table 't1' +SELECT command denied to user: 'mysqltest_3@localhost' for column 'b' in table 't1' select a from t1; a 1 @@ -143,7 +143,7 @@ a select c from t1; SELECT command denied to user: 'mysqltest_3@localhost' for column 'c' in table 't1' select * from t2; -select command denied to user: 'mysqltest_3@localhost' for table 't2' +SELECT command denied to user: 'mysqltest_3@localhost' for table 't2' select mysqltest.t1.c from test.t1,mysqltest.t1; SELECT command denied to user: 'mysqltest_3@localhost' for column 'c' in table 't1' show status like "Qcache_queries_in_cache"; diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 1b55168695b..c883407970a 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -2134,37 +2134,57 @@ int mysql_table_grant(THD *thd, TABLE_LIST *table_list, DBUG_RETURN(-1); } - if (columns.elements && !revoke_grant) + if (!revoke_grant) { - TABLE *table; - class LEX_COLUMN *column; - List_iterator column_iter(columns); + if (columns.elements && !revoke_grant) + { + TABLE *table; + class LEX_COLUMN *column; + List_iterator column_iter(columns); - if (!(table=open_ltable(thd,table_list,TL_READ))) - DBUG_RETURN(-1); - while ((column = column_iter++)) - { - if (!find_field_in_table(thd,table,column->column.ptr(), - column->column.length(),0,0)) + if (!(table=open_ltable(thd,table_list,TL_READ))) + DBUG_RETURN(-1); + while ((column = column_iter++)) { - my_printf_error(ER_BAD_FIELD_ERROR,ER(ER_BAD_FIELD_ERROR),MYF(0), - column->column.c_ptr(), table_list->alias); - DBUG_RETURN(-1); + Field *f= find_field_in_table(thd,table,column->column.ptr(), + column->column.length(),1,0); + if (!f) + { + my_printf_error(ER_BAD_FIELD_ERROR,ER(ER_BAD_FIELD_ERROR),MYF(0), + column->column.c_ptr(), table_list->alias); + DBUG_RETURN(-1); + } + if (f == (Field*)-1) + { + DBUG_RETURN(-1); + } + column_priv|= column->rights; } - column_priv|= column->rights; + close_thread_tables(thd); } - close_thread_tables(thd); - } - else if (!(rights & CREATE_ACL) && !revoke_grant) - { - char buf[FN_REFLEN]; - sprintf(buf,"%s/%s/%s.frm",mysql_data_home, table_list->db, - table_list->real_name); - fn_format(buf,buf,"","",4+16+32); - if (access(buf,F_OK)) + else { - my_error(ER_NO_SUCH_TABLE,MYF(0),table_list->db, table_list->alias); - DBUG_RETURN(-1); + if (!(rights & CREATE_ACL)) + { + char buf[FN_REFLEN]; + sprintf(buf,"%s/%s/%s.frm",mysql_data_home, table_list->db, + table_list->real_name); + fn_format(buf,buf,"","",4+16+32); + if (access(buf,F_OK)) + { + my_error(ER_NO_SUCH_TABLE,MYF(0),table_list->db, table_list->alias); + DBUG_RETURN(-1); + } + } + if (table_list->grant.want_privilege) + { + char command[128]; + get_privilege_desc(command, sizeof(command), + table_list->grant.want_privilege); + my_error(ER_TABLEACCESS_DENIED_ERROR, MYF(0), + command, thd->priv_user, thd->host_or_ip, table_list->alias); + DBUG_RETURN(-1); + } } } @@ -2189,7 +2209,7 @@ int mysql_table_grant(THD *thd, TABLE_LIST *table_list, */ if (thd->slave_thread && table_rules_on) { - /* + /* The tables must be marked "updating" so that tables_ok() takes them into account in tests. */ @@ -2636,25 +2656,8 @@ err: pthread_mutex_unlock(&LOCK_grant); if (!no_errors) // Not a silent skip of table { - const char *command=""; - if (want_access & SELECT_ACL) - command ="select"; - else if (want_access & INSERT_ACL) - command = "insert"; - else if (want_access & UPDATE_ACL) - command = "update"; - else if (want_access & DELETE_ACL) - command = "delete"; - else if (want_access & DROP_ACL) - command = "drop"; - else if (want_access & CREATE_ACL) - command = "create"; - else if (want_access & ALTER_ACL) - command = "alter"; - else if (want_access & INDEX_ACL) - command = "index"; - else if (want_access & GRANT_ACL) - command = "grant"; + char command[128]; + get_privilege_desc(command, sizeof(command), want_access); net_printf(&thd->net,ER_TABLEACCESS_DENIED_ERROR, command, thd->priv_user, @@ -2767,11 +2770,8 @@ bool check_grant_all_columns(THD *thd, ulong want_access, TABLE *table) err: pthread_mutex_unlock(&LOCK_grant); - const char *command=""; - if (want_access & SELECT_ACL) - command ="select"; - else if (want_access & INSERT_ACL) - command = "insert"; + char command[128]; + get_privilege_desc(command, sizeof(command), want_access); my_printf_error(ER_COLUMNACCESS_DENIED_ERROR, ER(ER_COLUMNACCESS_DENIED_ERROR), MYF(0), From 0e302f5e8bdbcb6df7d6a1fb78b0d784dfb798d8 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 30 Dec 2004 23:44:42 +0300 Subject: [PATCH 0614/1063] Merged fixes for bug #7297 "Two digit year should be interpreted correctly even with zero month and day" and bug #7515 "from_unixtime(0) now returns NULL instead of the Epoch" into 4.1 tree. mysql-test/r/ps_2myisam.result: Updated test result after merging fix for bug #7297 "Two digit year should be interpreted correctly even with zero month and day" into 4.1 mysql-test/r/ps_3innodb.result: Updated test result after merging fix for bug #7297 "Two digit year should be interpreted correctly even with zero month and day" into 4.1 mysql-test/r/ps_4heap.result: Updated test result after merging fix for bug #7297 "Two digit year should be interpreted correctly even with zero month and day" into 4.1 mysql-test/r/ps_5merge.result: Updated test result after merging fix for bug #7297 "Two digit year should be interpreted correctly even with zero month and day" into 4.1 mysql-test/r/ps_6bdb.result: Updated test result after merging fix for bug #7297 "Two digit year should be interpreted correctly even with zero month and day" into 4.1 mysql-test/r/ps_7ndb.result: Updated test result after merging fix for bug #7297 "Two digit year should be interpreted correctly even with zero month and day" into 4.1 sql-common/my_time.c: Merged fix for bug #7297 "Two digit year should be interpreted correctly even with zero month and day" into 4.1 sql/item_timefunc.cc: Small fix after merging patch solving bug #7515 "from_unixtime(0) now returns NULL instead of the Epoch" into 4.1. --- mysql-test/r/ps_2myisam.result | 2 +- mysql-test/r/ps_3innodb.result | 2 +- mysql-test/r/ps_4heap.result | 2 +- mysql-test/r/ps_5merge.result | 4 ++-- mysql-test/r/ps_6bdb.result | 2 +- mysql-test/r/ps_7ndb.result | 2 +- sql-common/my_time.c | 3 +-- sql/item_timefunc.cc | 1 + 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/mysql-test/r/ps_2myisam.result b/mysql-test/r/ps_2myisam.result index c2799c6faed..3412f2fe00c 100644 --- a/mysql-test/r/ps_2myisam.result +++ b/mysql-test/r/ps_2myisam.result @@ -3027,7 +3027,7 @@ c1 c13 c14 c15 c16 c17 42 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 43 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 50 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -51 0010-00-00 0010-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +51 2010-00-00 2010-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 52 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 53 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 60 NULL NULL 1991-01-01 01:01:01 NULL NULL diff --git a/mysql-test/r/ps_3innodb.result b/mysql-test/r/ps_3innodb.result index 034cd75ea4b..99f45117c36 100644 --- a/mysql-test/r/ps_3innodb.result +++ b/mysql-test/r/ps_3innodb.result @@ -3010,7 +3010,7 @@ c1 c13 c14 c15 c16 c17 42 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 43 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 50 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -51 0010-00-00 0010-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +51 2010-00-00 2010-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 52 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 53 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 60 NULL NULL 1991-01-01 01:01:01 NULL NULL diff --git a/mysql-test/r/ps_4heap.result b/mysql-test/r/ps_4heap.result index 60a9ddd2bf2..1ec5c280523 100644 --- a/mysql-test/r/ps_4heap.result +++ b/mysql-test/r/ps_4heap.result @@ -3011,7 +3011,7 @@ c1 c13 c14 c15 c16 c17 42 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 43 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 50 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -51 0010-00-00 0010-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +51 2010-00-00 2010-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 52 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 53 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 60 NULL NULL 1991-01-01 01:01:01 NULL NULL diff --git a/mysql-test/r/ps_5merge.result b/mysql-test/r/ps_5merge.result index e07cb7d7c49..1f36d246da0 100644 --- a/mysql-test/r/ps_5merge.result +++ b/mysql-test/r/ps_5merge.result @@ -2947,7 +2947,7 @@ c1 c13 c14 c15 c16 c17 42 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 43 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 50 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -51 0010-00-00 0010-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +51 2010-00-00 2010-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 52 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 53 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 60 NULL NULL 1991-01-01 01:01:01 NULL NULL @@ -5957,7 +5957,7 @@ c1 c13 c14 c15 c16 c17 42 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 43 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 50 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -51 0010-00-00 0010-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +51 2010-00-00 2010-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 52 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 53 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 60 NULL NULL 1991-01-01 01:01:01 NULL NULL diff --git a/mysql-test/r/ps_6bdb.result b/mysql-test/r/ps_6bdb.result index baf273c84c0..1e7ef526d37 100644 --- a/mysql-test/r/ps_6bdb.result +++ b/mysql-test/r/ps_6bdb.result @@ -3010,7 +3010,7 @@ c1 c13 c14 c15 c16 c17 42 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 43 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 50 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -51 0010-00-00 0010-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +51 2010-00-00 2010-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 52 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 53 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 60 NULL NULL 1991-01-01 01:01:01 NULL NULL diff --git a/mysql-test/r/ps_7ndb.result b/mysql-test/r/ps_7ndb.result index 3dbe3ed6218..13b6894e9b5 100644 --- a/mysql-test/r/ps_7ndb.result +++ b/mysql-test/r/ps_7ndb.result @@ -3010,7 +3010,7 @@ c1 c13 c14 c15 c16 c17 42 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 43 0000-00-00 0000-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 50 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 -51 0010-00-00 0010-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 +51 2010-00-00 2010-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 52 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 53 2001-00-00 2001-00-00 00:00:00 0000-00-00 00:00:00 838:59:59 0000 60 NULL NULL 1991-01-01 01:01:01 NULL NULL diff --git a/sql-common/my_time.c b/sql-common/my_time.c index 29935696b7d..8dd4801b562 100644 --- a/sql-common/my_time.c +++ b/sql-common/my_time.c @@ -339,8 +339,7 @@ str_to_datetime(const char *str, uint length, MYSQL_TIME *l_time, } l_time->neg= 0; - if (year_length == 2 && i >= format_position[1] && i >=format_position[2] && - (l_time->month || l_time->day)) + if (year_length == 2 && not_zero_date) l_time->year+= (l_time->year < YY_PART_YEAR ? 2000 : 1900); if (number_of_fields < 3 || diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index 6198043b576..0d652a431cb 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -1597,6 +1597,7 @@ void Item_func_from_unixtime::fix_length_and_dec() collation.set(&my_charset_bin); decimals=0; max_length=MAX_DATETIME_WIDTH*MY_CHARSET_BIN_MB_MAXLEN; + maybe_null= 1; thd->time_zone_used= 1; } From 90f86403a9fa5b47601f3f0d22b4b8b7e527590f Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 31 Dec 2004 02:18:21 +0100 Subject: [PATCH 0615/1063] Checking size to no of free + 1 was not correct when entry was released before check. Thus empty it is when size == no of free This caused a memory leak which inserted a hard limit of max 64 unique indexes in the cluster. --- ndb/src/kernel/blocks/suma/Suma.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ndb/src/kernel/blocks/suma/Suma.cpp b/ndb/src/kernel/blocks/suma/Suma.cpp index 836fa28d9ad..88e6dea35ac 100644 --- a/ndb/src/kernel/blocks/suma/Suma.cpp +++ b/ndb/src/kernel/blocks/suma/Suma.cpp @@ -3471,10 +3471,10 @@ SumaParticipant::completeSubRemoveReq(Signal* signal, SubscriptionPtr subPtr) { */ #if 0 ndbout_c("c_subscriptionPool.getSize() %d c_subscriptionPool.getNoOfFree()%d", - c_subscriptionPool.getSize(),c_subscriptionPool.getNoOfFree()+1); + c_subscriptionPool.getSize(),c_subscriptionPool.getNoOfFree()); #endif - if(c_subscriptionPool.getSize() == c_subscriptionPool.getNoOfFree()+1) { + if(c_subscriptionPool.getSize() == c_subscriptionPool.getNoOfFree()) { jam(); #if 0 ndbout_c("SUB_REMOVE_REQ:Clearing c_tables"); From 5cde0749927a6c55933fe5834e4c862d4135db9b Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 31 Dec 2004 10:38:51 +0100 Subject: [PATCH 0616/1063] - added the "Archive", "CSV" and "Example" storage engines to the Linux "Max" RPM support-files/mysql.spec.sh: - added the "Archive", "CSV" and "Example" storage engines to the Max RPM --- support-files/mysql.spec.sh | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index e7f8a035a15..5afddee609b 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -152,15 +152,22 @@ languages and applications need to dynamically load and use MySQL. %package Max Release: %{release} -Summary: MySQL - server with Berkeley DB, RAID and UDF support +Summary: MySQL - server with extended functionality Group: Applications/Databases Provides: mysql-Max Obsoletes: mysql-Max Requires: MySQL-server >= 4.0 %description Max -Optional MySQL server binary that supports additional features like -Berkeley DB, RAID and User Defined Functions (UDFs). +Optional MySQL server binary that supports additional features like: + + - Berkeley DB Storage Engine + - Archive Storage Engine + - CSV Storage Engine + - Example Storage Engine + - MyISAM RAID + - User Defined Functions (UDFs). + To activate this binary, just install this package in addition to the standard MySQL package. @@ -273,6 +280,9 @@ BuildMySQL "--enable-shared \ --with-berkeley-db \ --with-innodb \ --with-raid \ + --with-archive \ + --with-csv-storage-engine \ + --with-example-storage-engine \ --with-embedded-server \ --with-server-suffix='-Max'" @@ -597,6 +607,12 @@ fi # itself - note that they must be ordered by date (important when # merging BK trees) %changelog +* Thu Dec 31 2004 Lenz Grimmer + +- enabled the "Archive" storage engine for the max binary +- enabled the "CSV" storage engine for the max binary +- enabled the "Example" storage engine for the max binary + * Thu Aug 26 2004 Lenz Grimmer - MySQL-Max now requires MySQL-server instead of MySQL (BUG 3860) From 2419fa2684413f103a5bee470a330f00310c3f6e Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 31 Dec 2004 12:04:35 +0200 Subject: [PATCH 0617/1063] Remove DUP_IGNORE from enum_duplicates and instead use a separate ignore flag This allows use to use INSERT IGNORE ... ON DUPLICATE ... mysql-test/r/drop.result: safety fix mysql-test/t/drop.test: safety fix mysql-test/t/multi_update.test: ensure we cover all possible errors sql/log_event.cc: Remove DUP_IGNORE from enum_duplicates and instead use a separate ignore flag sql/log_event.h: Remove DUP_IGNORE from enum_duplicates and instead use a separate ignore flag sql/mysql_priv.h: Remove DUP_IGNORE from enum_duplicates and instead use a separate ignore flag sql/sql_class.h: Remove DUP_IGNORE from enum_duplicates and instead use a separate ignore flag sql/sql_delete.cc: Remove DUP_IGNORE from enum_duplicates and instead use a separate ignore flag sql/sql_insert.cc: Remove DUP_IGNORE from enum_duplicates and instead use a separate ignore flag sql/sql_lex.cc: Remove DUP_IGNORE from enum_duplicates and instead use a separate ignore flag sql/sql_lex.h: Remove DUP_IGNORE from enum_duplicates and instead use a separate ignore flag sql/sql_load.cc: Remove DUP_IGNORE from enum_duplicates and instead use a separate ignore flag sql/sql_parse.cc: Remove DUP_IGNORE from enum_duplicates and instead use a separate ignore flag sql/sql_repl.cc: Remove DUP_IGNORE from enum_duplicates and instead use a separate ignore flag sql/sql_repl.h: Remove DUP_IGNORE from enum_duplicates and instead use a separate ignore flag sql/sql_select.cc: Remove DUP_IGNORE from enum_duplicates and instead use a separate ignore flag sql/sql_table.cc: Remove DUP_IGNORE from enum_duplicates and instead use a separate ignore flag sql/sql_union.cc: Remove DUP_IGNORE from enum_duplicates and instead use a separate ignore flag sql/sql_update.cc: Remove DUP_IGNORE from enum_duplicates and instead use a separate ignore flag sql/sql_yacc.yy: Remove DUP_IGNORE from enum_duplicates and instead use a separate ignore flag --- mysql-test/r/drop.result | 1 + mysql-test/t/drop.test | 2 ++ mysql-test/t/multi_update.test | 4 ++-- sql/log_event.cc | 24 +++++++++++++---------- sql/log_event.h | 4 ++-- sql/mysql_priv.h | 8 +++++--- sql/sql_class.h | 21 +++++++++++--------- sql/sql_delete.cc | 3 +-- sql/sql_insert.cc | 35 ++++++++++++++++++---------------- sql/sql_lex.cc | 1 + sql/sql_lex.h | 2 +- sql/sql_load.cc | 7 +++++-- sql/sql_parse.cc | 23 +++++++++++----------- sql/sql_repl.cc | 4 ++-- sql/sql_repl.h | 2 +- sql/sql_select.cc | 2 +- sql/sql_table.cc | 12 +++++++----- sql/sql_union.cc | 4 ++-- sql/sql_update.cc | 22 ++++++++++----------- sql/sql_yacc.yy | 21 +++++++++++++------- 20 files changed, 114 insertions(+), 88 deletions(-) diff --git a/mysql-test/r/drop.result b/mysql-test/r/drop.result index 8b919964163..223ceb003b3 100644 --- a/mysql-test/r/drop.result +++ b/mysql-test/r/drop.result @@ -1,5 +1,6 @@ drop table if exists t1; drop database if exists mysqltest; +drop database if exists client_test_db; drop table t1; ERROR 42S02: Unknown table 't1' create table t1(n int); diff --git a/mysql-test/t/drop.test b/mysql-test/t/drop.test index 88c47803f48..6f0e5b3f14c 100644 --- a/mysql-test/t/drop.test +++ b/mysql-test/t/drop.test @@ -2,6 +2,8 @@ --disable_warnings drop table if exists t1; drop database if exists mysqltest; +# If earlier test failed +drop database if exists client_test_db; --enable_warnings --error 1051; diff --git a/mysql-test/t/multi_update.test b/mysql-test/t/multi_update.test index e90de399500..4e42ecc041d 100644 --- a/mysql-test/t/multi_update.test +++ b/mysql-test/t/multi_update.test @@ -5,9 +5,9 @@ --disable_warnings drop table if exists t1,t2,t3; drop database if exists mysqltest; ---error 0,1141 +--error 0,1141,1147 revoke all privileges on mysqltest.t1 from mysqltest_1@localhost; ---error 0,1141 +--error 0,1141,1147 revoke all privileges on mysqltest.* from mysqltest_1@localhost; delete from mysql.user where user=_binary'mysqltest_1'; --enable_warnings diff --git a/sql/log_event.cc b/sql/log_event.cc index c027c3a8ee4..04395f121fd 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -1418,7 +1418,7 @@ Load_log_event::Load_log_event(THD *thd_arg, sql_exchange *ex, const char *db_arg, const char *table_name_arg, List &fields_arg, enum enum_duplicates handle_dup, - bool using_trans) + bool ignore, bool using_trans) :Log_event(thd_arg, !thd_arg->tmp_table_used ? 0 : LOG_EVENT_THREAD_SPECIFIC_F, using_trans), thread_id(thd_arg->thread_id), @@ -1456,9 +1456,6 @@ Load_log_event::Load_log_event(THD *thd_arg, sql_exchange *ex, sql_ex.empty_flags= 0; switch (handle_dup) { - case DUP_IGNORE: - sql_ex.opt_flags|= IGNORE_FLAG; - break; case DUP_REPLACE: sql_ex.opt_flags|= REPLACE_FLAG; break; @@ -1466,6 +1463,8 @@ Load_log_event::Load_log_event(THD *thd_arg, sql_exchange *ex, case DUP_ERROR: break; } + if (ignore) + sql_ex.opt_flags|= IGNORE_FLAG; if (!ex->field_term->length()) sql_ex.empty_flags |= FIELD_TERM_EMPTY; @@ -1791,6 +1790,7 @@ int Load_log_event::exec_event(NET* net, struct st_relay_log_info* rli, { char llbuff[22]; enum enum_duplicates handle_dup; + bool ignore= 0; /* Make a simplified LOAD DATA INFILE query, for the information of the user in SHOW PROCESSLIST. Note that db is known in the 'db' column. @@ -1807,21 +1807,24 @@ int Load_log_event::exec_event(NET* net, struct st_relay_log_info* rli, if (sql_ex.opt_flags & REPLACE_FLAG) handle_dup= DUP_REPLACE; else if (sql_ex.opt_flags & IGNORE_FLAG) - handle_dup= DUP_IGNORE; + { + ignore= 1; + handle_dup= DUP_ERROR; + } else { /* When replication is running fine, if it was DUP_ERROR on the - master then we could choose DUP_IGNORE here, because if DUP_ERROR + master then we could choose IGNORE here, because if DUP_ERROR suceeded on master, and data is identical on the master and slave, - then there should be no uniqueness errors on slave, so DUP_IGNORE is + then there should be no uniqueness errors on slave, so IGNORE is the same as DUP_ERROR. But in the unlikely case of uniqueness errors (because the data on the master and slave happen to be different (user error or bug), we want LOAD DATA to print an error message on the slave to discover the problem. If reading from net (a 3.23 master), mysql_load() will change this - to DUP_IGNORE. + to IGNORE. */ handle_dup= DUP_ERROR; } @@ -1855,7 +1858,7 @@ int Load_log_event::exec_event(NET* net, struct st_relay_log_info* rli, */ thd->net.pkt_nr = net->pkt_nr; } - if (mysql_load(thd, &ex, &tables, field_list, handle_dup, net != 0, + if (mysql_load(thd, &ex, &tables, field_list, handle_dup, ignore, net != 0, TL_WRITE)) thd->query_error = 1; if (thd->cuted_fields) @@ -2747,8 +2750,9 @@ Create_file_log_event:: Create_file_log_event(THD* thd_arg, sql_exchange* ex, const char* db_arg, const char* table_name_arg, List& fields_arg, enum enum_duplicates handle_dup, + bool ignore, char* block_arg, uint block_len_arg, bool using_trans) - :Load_log_event(thd_arg,ex,db_arg,table_name_arg,fields_arg,handle_dup, + :Load_log_event(thd_arg,ex,db_arg,table_name_arg,fields_arg,handle_dup, ignore, using_trans), fake_base(0), block(block_arg), event_buf(0), block_len(block_len_arg), file_id(thd_arg->file_id = mysql_bin_log.next_file_id()) diff --git a/sql/log_event.h b/sql/log_event.h index 8a2334e8574..f848f2ae1b9 100644 --- a/sql/log_event.h +++ b/sql/log_event.h @@ -599,7 +599,7 @@ public: Load_log_event(THD* thd, sql_exchange* ex, const char* db_arg, const char* table_name_arg, - List& fields_arg, enum enum_duplicates handle_dup, + List& fields_arg, enum enum_duplicates handle_dup, bool ignore, bool using_trans); void set_fields(const char* db, List &fields_arg); const char* get_db() { return db; } @@ -908,7 +908,7 @@ public: Create_file_log_event(THD* thd, sql_exchange* ex, const char* db_arg, const char* table_name_arg, List& fields_arg, - enum enum_duplicates handle_dup, + enum enum_duplicates handle_dup, bool ignore, char* block_arg, uint block_len_arg, bool using_trans); #ifdef HAVE_REPLICATION diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index c90935f4cf9..89775849932 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -538,6 +538,7 @@ int mysql_alter_table(THD *thd, char *new_db, char *new_name, List &keys, uint order_num, ORDER *order, enum enum_duplicates handle_duplicates, + bool ignore, ALTER_INFO *alter_info, bool do_send_ok=1); int mysql_recreate_table(THD *thd, TABLE_LIST *table_list, bool do_send_ok); int mysql_create_like_table(THD *thd, TABLE_LIST *table, @@ -557,11 +558,11 @@ int mysql_prepare_update(THD *thd, TABLE_LIST *table_list, int mysql_update(THD *thd,TABLE_LIST *tables,List &fields, List &values,COND *conds, uint order_num, ORDER *order, ha_rows limit, - enum enum_duplicates handle_duplicates); + enum enum_duplicates handle_duplicates, bool ignore); int mysql_multi_update(THD *thd, TABLE_LIST *table_list, List *fields, List *values, COND *conds, ulong options, - enum enum_duplicates handle_duplicates, + enum enum_duplicates handle_duplicates, bool ignore, SELECT_LEX_UNIT *unit, SELECT_LEX *select_lex); int mysql_prepare_insert(THD *thd, TABLE_LIST *table_list, TABLE_LIST *insert_table_list, TABLE *table, @@ -570,7 +571,7 @@ int mysql_prepare_insert(THD *thd, TABLE_LIST *table_list, List &update_values, enum_duplicates duplic); int mysql_insert(THD *thd,TABLE_LIST *table,List &fields, List &values, List &update_fields, - List &update_values, enum_duplicates flag); + List &update_values, enum_duplicates flag, bool ignore); int mysql_prepare_delete(THD *thd, TABLE_LIST *table_list, Item **conds); int mysql_delete(THD *thd, TABLE_LIST *table, COND *conds, SQL_LIST *order, ha_rows rows, ulong options); @@ -759,6 +760,7 @@ bool eval_const_cond(COND *cond); /* sql_load.cc */ int mysql_load(THD *thd,sql_exchange *ex, TABLE_LIST *table_list, List &fields, enum enum_duplicates handle_duplicates, + bool ignore, bool local_file,thr_lock_type lock_type); int write_record(TABLE *table,COPY_INFO *info); diff --git a/sql/sql_class.h b/sql/sql_class.h index 169835f3324..f7d25077238 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -29,7 +29,7 @@ class Slave_log_event; enum enum_enable_or_disable { LEAVE_AS_IS, ENABLE, DISABLE }; enum enum_ha_read_modes { RFIRST, RNEXT, RPREV, RLAST, RKEY, RNEXT_SAME }; -enum enum_duplicates { DUP_ERROR, DUP_REPLACE, DUP_IGNORE, DUP_UPDATE }; +enum enum_duplicates { DUP_ERROR, DUP_REPLACE, DUP_UPDATE }; enum enum_log_type { LOG_CLOSED, LOG_TO_BE_OPENED, LOG_NORMAL, LOG_NEW, LOG_BIN}; enum enum_delay_key_write { DELAY_KEY_WRITE_NONE, DELAY_KEY_WRITE_ON, DELAY_KEY_WRITE_ALL }; @@ -201,7 +201,8 @@ typedef struct st_copy_info { ha_rows error_count; enum enum_duplicates handle_duplicates; int escape_char, last_errno; -/* for INSERT ... UPDATE */ + bool ignore; + /* for INSERT ... UPDATE */ List *update_fields; List *update_values; } COPY_INFO; @@ -1232,19 +1233,21 @@ class select_insert :public select_result_interceptor { COPY_INFO info; select_insert(TABLE *table_par, List *fields_par, - enum_duplicates duplic) + enum_duplicates duplic, bool ignore) :table(table_par), fields(fields_par), last_insert_id(0) { bzero((char*) &info,sizeof(info)); + info.ignore= ignore; info.handle_duplicates=duplic; } select_insert(TABLE *table_par, List *fields_par, List *update_fields, List *update_values, - enum_duplicates duplic) + enum_duplicates duplic, bool ignore) :table(table_par), fields(fields_par), last_insert_id(0) { bzero((char*) &info,sizeof(info)); - info.handle_duplicates=duplic; + info.ignore= ignore; + info.handle_duplicates= duplic; info.update_fields= update_fields; info.update_values= update_values; } @@ -1273,8 +1276,8 @@ public: HA_CREATE_INFO *create_info_par, List &fields_par, List &keys_par, - List &select_fields,enum_duplicates duplic) - :select_insert (NULL, &select_fields, duplic), db(db_name), + List &select_fields,enum_duplicates duplic, bool ignore) + :select_insert (NULL, &select_fields, duplic, ignore), db(db_name), name(table_name), extra_fields(&fields_par),keys(&keys_par), create_info(create_info_par), lock(0) {} @@ -1525,11 +1528,11 @@ class multi_update :public select_result_interceptor uint table_count; Copy_field *copy_field; enum enum_duplicates handle_duplicates; - bool do_update, trans_safe, transactional_tables, log_delayed; + bool do_update, trans_safe, transactional_tables, log_delayed, ignore; public: multi_update(THD *thd_arg, TABLE_LIST *ut, List *fields, - List *values, enum_duplicates handle_duplicates); + List *values, enum_duplicates handle_duplicates, bool ignore); ~multi_update(); int prepare(List &list, SELECT_LEX_UNIT *u); bool send_data(List &items); diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc index 29d86a99ff3..8b4a0f0f6d0 100644 --- a/sql/sql_delete.cc +++ b/sql/sql_delete.cc @@ -57,8 +57,7 @@ int mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds, SQL_LIST *order, DBUG_RETURN(1); } - if (thd->lex->duplicates == DUP_IGNORE) - thd->lex->select_lex.no_error= 1; + thd->lex->select_lex.no_error= thd->lex->ignore; /* Test if the user wants to delete all rows */ if (!using_limit && const_cond && (!conds || conds->val_int()) && diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index ce64890523a..b7eaf4b9e70 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -22,7 +22,7 @@ static int check_null_fields(THD *thd,TABLE *entry); #ifndef EMBEDDED_LIBRARY static TABLE *delayed_get_table(THD *thd,TABLE_LIST *table_list); -static int write_delayed(THD *thd,TABLE *table, enum_duplicates dup, +static int write_delayed(THD *thd,TABLE *table, enum_duplicates dup, bool ignore, char *query, uint query_length, int log_on); static void end_delayed_insert(THD *thd); extern "C" pthread_handler_decl(handle_delayed_insert,arg); @@ -111,7 +111,8 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list, List &values_list, List &update_fields, List &update_values, - enum_duplicates duplic) + enum_duplicates duplic, + bool ignore) { int error, res; /* @@ -222,9 +223,10 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list, */ info.records= info.deleted= info.copied= info.updated= 0; + info.ignore= ignore; info.handle_duplicates=duplic; - info.update_fields=&update_fields; - info.update_values=&update_values; + info.update_fields= &update_fields; + info.update_values= &update_values; /* Count warnings for all inserts. For single line insert, generate an error if try to set a NOT NULL field @@ -289,7 +291,7 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list, #ifndef EMBEDDED_LIBRARY if (lock_type == TL_WRITE_DELAYED) { - error=write_delayed(thd,table,duplic,query, thd->query_length, log_on); + error=write_delayed(thd, table, duplic, ignore, query, thd->query_length, log_on); query=0; } else @@ -395,7 +397,7 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list, else { char buff[160]; - if (duplic == DUP_IGNORE) + if (ignore) sprintf(buff, ER(ER_INSERT_INFO), (ulong) info.records, (lock_type == TL_WRITE_DELAYED) ? (ulong) 0 : (ulong) (info.records - info.copied), (ulong) thd->cuted_fields); @@ -592,7 +594,7 @@ int write_record(TABLE *table,COPY_INFO *info) } else if ((error=table->file->write_row(table->record[0]))) { - if (info->handle_duplicates != DUP_IGNORE || + if (!info->ignore || (error != HA_ERR_FOUND_DUPP_KEY && error != HA_ERR_FOUND_DUPP_UNIQUE)) goto err; } @@ -648,14 +650,14 @@ public: char *record,*query; enum_duplicates dup; time_t start_time; - bool query_start_used,last_insert_id_used,insert_id_used; + bool query_start_used,last_insert_id_used,insert_id_used, ignore; int log_query; ulonglong last_insert_id; timestamp_auto_set_type timestamp_field_type; uint query_length; - delayed_row(enum_duplicates dup_arg, int log_query_arg) - :record(0),query(0),dup(dup_arg),log_query(log_query_arg) {} + delayed_row(enum_duplicates dup_arg, bool ignore_arg, int log_query_arg) + :record(0),query(0),dup(dup_arg),ignore(ignore_arg),log_query(log_query_arg) {} ~delayed_row() { x_free(record); @@ -967,7 +969,7 @@ TABLE *delayed_insert::get_local_table(THD* client_thd) /* Put a question in queue */ -static int write_delayed(THD *thd,TABLE *table,enum_duplicates duplic, +static int write_delayed(THD *thd,TABLE *table,enum_duplicates duplic, bool ignore, char *query, uint query_length, int log_on) { delayed_row *row=0; @@ -980,7 +982,7 @@ static int write_delayed(THD *thd,TABLE *table,enum_duplicates duplic, pthread_cond_wait(&di->cond_client,&di->mutex); thd->proc_info="storing row into queue"; - if (thd->killed || !(row= new delayed_row(duplic, log_on))) + if (thd->killed || !(row= new delayed_row(duplic, ignore, log_on))) goto err; if (!query) @@ -1341,8 +1343,9 @@ bool delayed_insert::handle_inserts(void) thd.insert_id_used=row->insert_id_used; table->timestamp_field_type= row->timestamp_field_type; + info.ignore= row->ignore; info.handle_duplicates= row->dup; - if (info.handle_duplicates == DUP_IGNORE || + if (info.ignore || info.handle_duplicates == DUP_REPLACE) { table->file->extra(HA_EXTRA_IGNORE_DUP_KEY); @@ -1460,7 +1463,7 @@ select_insert::prepare(List &values, SELECT_LEX_UNIT *u) restore_record(table,default_values); // Get empty record table->next_number_field=table->found_next_number_field; thd->cuted_fields=0; - if (info.handle_duplicates == DUP_IGNORE || + if (info.ignore || info.handle_duplicates == DUP_REPLACE) table->file->extra(HA_EXTRA_IGNORE_DUP_KEY); table->file->start_bulk_insert((ha_rows) 0); @@ -1602,7 +1605,7 @@ bool select_insert::send_eof() DBUG_RETURN(1); } char buff[160]; - if (info.handle_duplicates == DUP_IGNORE) + if (info.ignore) sprintf(buff, ER(ER_INSERT_INFO), (ulong) info.records, (ulong) (info.records - info.copied), (ulong) thd->cuted_fields); else @@ -1646,7 +1649,7 @@ select_create::prepare(List &values, SELECT_LEX_UNIT *u) restore_record(table,default_values); // Get empty record thd->cuted_fields=0; - if (info.handle_duplicates == DUP_IGNORE || + if (info.ignore || info.handle_duplicates == DUP_REPLACE) table->file->extra(HA_EXTRA_IGNORE_DUP_KEY); table->file->start_bulk_insert((ha_rows) 0); diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index d2ac0df1472..5730073bd35 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -158,6 +158,7 @@ void lex_start(THD *thd, uchar *buf,uint length) lex->ignore_space=test(thd->variables.sql_mode & MODE_IGNORE_SPACE); lex->sql_command=SQLCOM_END; lex->duplicates= DUP_ERROR; + lex->ignore= 0; lex->proc_list.first= 0; } diff --git a/sql/sql_lex.h b/sql/sql_lex.h index 8421be7e735..e2e0bc61c23 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -618,7 +618,7 @@ typedef struct st_lex bool in_comment, ignore_space, verbose, no_write_to_binlog; bool derived_tables; bool safe_to_cache_query; - bool subqueries; + bool subqueries, ignore; ALTER_INFO alter_info; /* Prepared statements SQL syntax:*/ LEX_STRING prepared_stmt_name; /* Statement name (in all queries) */ diff --git a/sql/sql_load.cc b/sql/sql_load.cc index 17ab472c87b..c4f5b1427af 100644 --- a/sql/sql_load.cc +++ b/sql/sql_load.cc @@ -80,6 +80,7 @@ static int read_sep_field(THD *thd,COPY_INFO &info,TABLE *table, int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list, List &fields, enum enum_duplicates handle_duplicates, + bool ignore, bool read_file_from_client,thr_lock_type lock_type) { char name[FN_REFLEN]; @@ -165,7 +166,7 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list, /* We can't give an error in the middle when using LOCAL files */ if (read_file_from_client && handle_duplicates == DUP_ERROR) - handle_duplicates=DUP_IGNORE; + ignore= 1; #ifndef EMBEDDED_LIBRARY if (read_file_from_client) @@ -216,6 +217,7 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list, COPY_INFO info; bzero((char*) &info,sizeof(info)); + info.ignore= ignore; info.handle_duplicates=handle_duplicates; info.escape_char=escaped->length() ? (*escaped)[0] : INT_MAX; @@ -237,6 +239,7 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list, lf_info.db = db; lf_info.table_name = table_list->real_name; lf_info.fields = &fields; + lf_info.ignore= ignore; lf_info.handle_dup = handle_duplicates; lf_info.wrote_create_file = 0; lf_info.last_pos_in_file = HA_POS_ERROR; @@ -267,7 +270,7 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list, table->timestamp_field_type= TIMESTAMP_NO_AUTO_SET; table->next_number_field=table->found_next_number_field; - if (handle_duplicates == DUP_IGNORE || + if (ignore || handle_duplicates == DUP_REPLACE) table->file->extra(HA_EXTRA_IGNORE_DUP_KEY); ha_enable_transaction(thd, FALSE); diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 55d26a68116..6353622098c 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -2393,7 +2393,8 @@ mysql_execute_command(THD *thd) &lex->create_info, lex->create_list, lex->key_list, - select_lex->item_list,lex->duplicates))) + select_lex->item_list, lex->duplicates, + lex->ignore))) { /* CREATE from SELECT give its SELECT_LEX for SELECT, @@ -2533,7 +2534,7 @@ unsent_create_error: lex->key_list, select_lex->order_list.elements, (ORDER *) select_lex->order_list.first, - lex->duplicates, &lex->alter_info); + lex->duplicates, lex->ignore, &lex->alter_info); } break; } @@ -2695,7 +2696,7 @@ unsent_create_error: select_lex->order_list.elements, (ORDER *) select_lex->order_list.first, select_lex->select_limit, - lex->duplicates); + lex->duplicates, lex->ignore); if (thd->net.report_error) res= -1; break; @@ -2708,7 +2709,7 @@ unsent_create_error: &lex->value_list, select_lex->where, select_lex->options, - lex->duplicates, unit, select_lex); + lex->duplicates, lex->ignore, unit, select_lex); break; } case SQLCOM_REPLACE: @@ -2716,9 +2717,9 @@ unsent_create_error: { if ((res= insert_precheck(thd, tables))) break; - res = mysql_insert(thd,tables,lex->field_list,lex->many_values, - lex->update_list, lex->value_list, - lex->duplicates); + res= mysql_insert(thd,tables,lex->field_list,lex->many_values, + lex->update_list, lex->value_list, + lex->duplicates, lex->ignore); if (thd->net.report_error) res= -1; break; @@ -2756,7 +2757,7 @@ unsent_create_error: lex->duplicates)) && (result= new select_insert(tables->table, &lex->field_list, &lex->update_list, &lex->value_list, - lex->duplicates))) + lex->duplicates, lex->ignore))) { TABLE *table= tables->table; /* Skip first table, which is the table we are inserting in */ @@ -3066,7 +3067,7 @@ unsent_create_error: goto error; } res=mysql_load(thd, lex->exchange, tables, lex->field_list, - lex->duplicates, (bool) lex->local_file, lex->lock_option); + lex->duplicates, lex->ignore, (bool) lex->local_file, lex->lock_option); break; } @@ -5119,7 +5120,7 @@ int mysql_create_index(THD *thd, TABLE_LIST *table_list, List &keys) DBUG_RETURN(mysql_alter_table(thd,table_list->db,table_list->real_name, &create_info, table_list, fields, keys, 0, (ORDER*)0, - DUP_ERROR, &alter_info)); + DUP_ERROR, 0, &alter_info)); } @@ -5138,7 +5139,7 @@ int mysql_drop_index(THD *thd, TABLE_LIST *table_list, ALTER_INFO *alter_info) DBUG_RETURN(mysql_alter_table(thd,table_list->db,table_list->real_name, &create_info, table_list, fields, keys, 0, (ORDER*)0, - DUP_ERROR, alter_info)); + DUP_ERROR, 0, alter_info)); } diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc index 2f0d8d3aa0d..fd165ad1fa5 100644 --- a/sql/sql_repl.cc +++ b/sql/sql_repl.cc @@ -1380,7 +1380,7 @@ err: int log_loaded_block(IO_CACHE* file) { - LOAD_FILE_INFO* lf_info; + LOAD_FILE_INFO *lf_info; uint block_len ; /* file->request_pos contains position where we started last read */ @@ -1402,7 +1402,7 @@ int log_loaded_block(IO_CACHE* file) { Create_file_log_event c(lf_info->thd,lf_info->ex,lf_info->db, lf_info->table_name, *lf_info->fields, - lf_info->handle_dup, buffer, + lf_info->handle_dup, lf_info->ignore, buffer, block_len, lf_info->log_delayed); mysql_bin_log.write(&c); lf_info->wrote_create_file = 1; diff --git a/sql/sql_repl.h b/sql/sql_repl.h index 3c17540b664..21b3d2955f7 100644 --- a/sql/sql_repl.h +++ b/sql/sql_repl.h @@ -67,7 +67,7 @@ typedef struct st_load_file_info enum enum_duplicates handle_dup; char* db; char* table_name; - bool wrote_create_file, log_delayed; + bool wrote_create_file, log_delayed, ignore; } LOAD_FILE_INFO; int log_loaded_block(IO_CACHE* file); diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 610a98d1983..03e322d28ee 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -468,7 +468,7 @@ JOIN::optimize() optimized= 1; // Ignore errors of execution if option IGNORE present - if (thd->lex->duplicates == DUP_IGNORE) + if (thd->lex->ignore) thd->lex->current_select->no_error= 1; #ifdef HAVE_REF_TO_FIELDS // Not done yet /* Add HAVING to WHERE if possible */ diff --git a/sql/sql_table.cc b/sql/sql_table.cc index c798760cfa8..95ed50bf6dc 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -36,6 +36,7 @@ static char *make_unique_key_name(const char *field_name,KEY *start,KEY *end); static int copy_data_between_tables(TABLE *from,TABLE *to, List &create, enum enum_duplicates handle_duplicates, + bool ignore, uint order_num, ORDER *order, ha_rows *copied,ha_rows *deleted); @@ -2682,7 +2683,7 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name, TABLE_LIST *table_list, List &fields, List &keys, uint order_num, ORDER *order, - enum enum_duplicates handle_duplicates, + enum enum_duplicates handle_duplicates, bool ignore, ALTER_INFO *alter_info, bool do_send_ok) { TABLE *table,*new_table; @@ -3201,7 +3202,7 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name, copied=deleted=0; if (!new_table->is_view) error=copy_data_between_tables(table,new_table,create_list, - handle_duplicates, + handle_duplicates, ignore, order_num, order, &copied, &deleted); thd->last_insert_id=next_insert_id; // Needed for correct log thd->count_cuted_fields= CHECK_FIELD_IGNORE; @@ -3421,6 +3422,7 @@ static int copy_data_between_tables(TABLE *from,TABLE *to, List &create, enum enum_duplicates handle_duplicates, + bool ignore, uint order_num, ORDER *order, ha_rows *copied, ha_rows *deleted) @@ -3514,7 +3516,7 @@ copy_data_between_tables(TABLE *from,TABLE *to, current query id */ from->file->extra(HA_EXTRA_RETRIEVE_ALL_COLS); init_read_record(&info, thd, from, (SQL_SELECT *) 0, 1,1); - if (handle_duplicates == DUP_IGNORE || + if (ignore || handle_duplicates == DUP_REPLACE) to->file->extra(HA_EXTRA_IGNORE_DUP_KEY); thd->row_count= 0; @@ -3540,7 +3542,7 @@ copy_data_between_tables(TABLE *from,TABLE *to, } if ((error=to->file->write_row((byte*) to->record[0]))) { - if ((handle_duplicates != DUP_IGNORE && + if ((!ignore && handle_duplicates != DUP_REPLACE) || (error != HA_ERR_FOUND_DUPP_KEY && error != HA_ERR_FOUND_DUPP_UNIQUE)) @@ -3616,7 +3618,7 @@ int mysql_recreate_table(THD *thd, TABLE_LIST *table_list, DBUG_RETURN(mysql_alter_table(thd, NullS, NullS, &create_info, table_list, lex->create_list, lex->key_list, 0, (ORDER *) 0, - DUP_ERROR, &lex->alter_info, do_send_ok)); + DUP_ERROR, 0, &lex->alter_info, do_send_ok)); } diff --git a/sql/sql_union.cc b/sql/sql_union.cc index b35209faeb2..f89b234f5b0 100644 --- a/sql/sql_union.cc +++ b/sql/sql_union.cc @@ -45,10 +45,10 @@ select_union::select_union(TABLE *table_par) { bzero((char*) &info,sizeof(info)); /* - We can always use DUP_IGNORE because the temporary table will only + We can always use IGNORE because the temporary table will only contain a unique key if we are using not using UNION ALL */ - info.handle_duplicates= DUP_IGNORE; + info.ignore= 1; } select_union::~select_union() diff --git a/sql/sql_update.cc b/sql/sql_update.cc index 2b27cff13e2..761e8d6de8b 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -54,7 +54,8 @@ int mysql_update(THD *thd, COND *conds, uint order_num, ORDER *order, ha_rows limit, - enum enum_duplicates handle_duplicates) + enum enum_duplicates handle_duplicates, + bool ignore) { bool using_limit=limit != HA_POS_ERROR; bool safe_update= thd->options & OPTION_SAFE_UPDATES; @@ -274,7 +275,7 @@ int mysql_update(THD *thd, } } - if (handle_duplicates == DUP_IGNORE) + if (ignore) table->file->extra(HA_EXTRA_IGNORE_DUP_KEY); init_read_record(&info,thd,table,select,0,1); @@ -299,8 +300,7 @@ int mysql_update(THD *thd, { updated++; } - else if (handle_duplicates != DUP_IGNORE || - error != HA_ERR_FOUND_DUPP_KEY) + else if (!ignore || error != HA_ERR_FOUND_DUPP_KEY) { thd->fatal_error(); // Force error message table->file->print_error(error,MYF(0)); @@ -476,7 +476,7 @@ int mysql_multi_update(THD *thd, List *values, COND *conds, ulong options, - enum enum_duplicates handle_duplicates, + enum enum_duplicates handle_duplicates, bool ignore, SELECT_LEX_UNIT *unit, SELECT_LEX *select_lex) { int res; @@ -667,7 +667,7 @@ int mysql_multi_update(THD *thd, } if (!(result=new multi_update(thd, update_list, fields, values, - handle_duplicates))) + handle_duplicates, ignore))) DBUG_RETURN(-1); res= mysql_select(thd, &select_lex->ref_pointer_array, @@ -684,11 +684,11 @@ int mysql_multi_update(THD *thd, multi_update::multi_update(THD *thd_arg, TABLE_LIST *table_list, List *field_list, List *value_list, - enum enum_duplicates handle_duplicates_arg) + enum enum_duplicates handle_duplicates_arg, bool ignore_arg) :all_tables(table_list), update_tables(0), thd(thd_arg), tmp_tables(0), updated(0), found(0), fields(field_list), values(value_list), table_count(0), copy_field(0), handle_duplicates(handle_duplicates_arg), - do_update(1), trans_safe(0), transactional_tables(1) + do_update(1), trans_safe(0), transactional_tables(1), ignore(ignore_arg) {} @@ -1021,8 +1021,7 @@ bool multi_update::send_data(List ¬_used_values) table->record[0]))) { updated--; - if (handle_duplicates != DUP_IGNORE || - error != HA_ERR_FOUND_DUPP_KEY) + if (!ignore || error != HA_ERR_FOUND_DUPP_KEY) { thd->fatal_error(); // Force error message table->file->print_error(error,MYF(0)); @@ -1154,8 +1153,7 @@ int multi_update::do_updates(bool from_send_error) if ((local_error=table->file->update_row(table->record[1], table->record[0]))) { - if (local_error != HA_ERR_FOUND_DUPP_KEY || - handle_duplicates != DUP_IGNORE) + if (!ignore || local_error != HA_ERR_FOUND_DUPP_KEY) goto err; } updated++; diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index a09694ee1e6..9235ce1fb6d 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -1849,8 +1849,9 @@ alter: { THD *thd= YYTHD; LEX *lex= thd->lex; - lex->sql_command = SQLCOM_ALTER_TABLE; - lex->name=0; + lex->sql_command= SQLCOM_ALTER_TABLE; + lex->name= 0; + lex->duplicates= DUP_ERROR; if (!lex->select_lex.add_table_to_list(thd, $4, NULL, TL_OPTION_UPDATING)) YYABORT; @@ -2035,8 +2036,9 @@ opt_column: | COLUMN_SYM {}; opt_ignore: - /* empty */ { Lex->duplicates=DUP_ERROR; } - | IGNORE_SYM { Lex->duplicates=DUP_IGNORE; }; + /* empty */ { Lex->ignore= 0;} + | IGNORE_SYM { Lex->ignore= 1;} + ; opt_restrict: /* empty */ {} @@ -4012,7 +4014,8 @@ insert: INSERT { LEX *lex= Lex; - lex->sql_command = SQLCOM_INSERT; + lex->sql_command= SQLCOM_INSERT; + lex->duplicates= DUP_ERROR; /* for subselects */ lex->lock_option= (using_update_log) ? TL_READ_NO_INSERT : TL_READ; lex->select_lex.resolve_mode= SELECT_LEX::INSERT_MODE; @@ -4174,6 +4177,7 @@ update: mysql_init_select(lex); lex->sql_command= SQLCOM_UPDATE; lex->lock_option= TL_UNLOCK; /* Will be set later */ + lex->duplicates= DUP_ERROR; } opt_low_priority opt_ignore join_table_list SET update_list @@ -4233,6 +4237,7 @@ delete: LEX *lex= Lex; lex->sql_command= SQLCOM_DELETE; lex->lock_option= lex->thd->update_lock_default; + lex->ignore= 0; lex->select_lex.init_order(); } opt_delete_options single_multi {} @@ -4289,7 +4294,7 @@ opt_delete_options: opt_delete_option: QUICK { Select->options|= OPTION_QUICK; } | LOW_PRIORITY { Lex->lock_option= TL_WRITE_LOW_PRIORITY; } - | IGNORE_SYM { Lex->duplicates= DUP_IGNORE; }; + | IGNORE_SYM { Lex->ignore= 1; }; truncate: TRUNCATE_SYM opt_table_sym table_name @@ -4698,6 +4703,8 @@ load: LOAD DATA_SYM load_data_lock opt_local INFILE TEXT_STRING_sys lex->sql_command= SQLCOM_LOAD; lex->lock_option= $3; lex->local_file= $4; + lex->duplicates= DUP_ERROR; + lex->ignore= 0; if (!(lex->exchange= new sql_exchange($6.str,0))) YYABORT; lex->field_list.empty(); @@ -4735,7 +4742,7 @@ load_data_lock: opt_duplicate: /* empty */ { Lex->duplicates=DUP_ERROR; } | REPLACE { Lex->duplicates=DUP_REPLACE; } - | IGNORE_SYM { Lex->duplicates=DUP_IGNORE; }; + | IGNORE_SYM { Lex->ignore= 1; }; opt_field_term: /* empty */ From 5eaf65ab4be77911eb03cceefac9ecea48c25f71 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 31 Dec 2004 11:52:14 +0100 Subject: [PATCH 0618/1063] post-merge mysql-test/r/grant2.result: new test case mysql-test/r/variables.result: don't fail w/o innodb mysql-test/t/grant2.test: new test case mysql-test/t/multi_update.test: don't fail w/o innodb mysql-test/t/variables.test: don't fail w/o innodb sql/sql_acl.cc: cleanup --- mysql-test/r/alter_table.result | 2 +- mysql-test/r/grant2.result | 17 ++++++++++++++--- mysql-test/r/grant_cache.result | 6 +++--- mysql-test/r/ps_1general.result | 4 ++-- mysql-test/r/timezone2.result | 4 ++-- mysql-test/r/variables.result | 6 +++--- mysql-test/t/grant2.test | 28 ++++++++++++++++++++++++---- mysql-test/t/multi_update.test | 2 ++ mysql-test/t/variables.test | 4 ++-- sql/sql_acl.cc | 3 +-- 10 files changed, 54 insertions(+), 22 deletions(-) diff --git a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result index 5a47110dda3..a7ae8bc310c 100644 --- a/mysql-test/r/alter_table.result +++ b/mysql-test/r/alter_table.result @@ -121,7 +121,7 @@ create database mysqltest; create table mysqltest.t1 (a int,b int,c int); grant all on mysqltest.t1 to mysqltest_1@localhost; alter table t1 rename t2; -ERROR 42000: INSERT,CREATE command denied to user: 'mysqltest_1@localhost' for table 't2' +ERROR 42000: INSERT,CREATE command denied to user 'mysqltest_1'@'localhost' for table 't2' revoke all privileges on mysqltest.t1 from mysqltest_1@localhost; delete from mysql.user where user=_binary'mysqltest_1'; drop database mysqltest; diff --git a/mysql-test/r/grant2.result b/mysql-test/r/grant2.result index a31fa2ac3dc..6d8bdbaf8f9 100644 --- a/mysql-test/r/grant2.result +++ b/mysql-test/r/grant2.result @@ -37,7 +37,6 @@ show grants for current_user(); Grants for mysqltest_1@localhost GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' GRANT SELECT, INSERT ON `mysqltest`.* TO 'mysqltest_1'@'localhost' -use mysqltest; insert into t1 values (1, 'I can''t change it!'); update t1 set data='I can change it!' where id = 1; ERROR 42000: Access denied for user 'mysqltest_1'@'localhost' to database 'mysqltest' @@ -47,8 +46,20 @@ select * from t1; id data 1 I can't change it! drop table t1; -drop database mysqltest; -use test; delete from mysql.user where user like 'mysqltest\_%'; delete from mysql.db where user like 'mysqltest\_%'; flush privileges; +create table t1 (a int, b int); +grant select (a) on t1 to mysqltest_1@localhost with grant option; +grant select (a,b) on t1 to mysqltest_2@localhost; +ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for column 'b' in table 't1' +grant select on t1 to mysqltest_3@localhost; +ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for table 't1' +drop table t1; +delete from mysql.user where user like 'mysqltest\_%'; +delete from mysql.db where user like 'mysqltest\_%'; +delete from mysql.tables_priv where user like 'mysqltest\_%'; +delete from mysql.columns_priv where user like 'mysqltest\_%'; +flush privileges; +drop database mysqltest; +use test; diff --git a/mysql-test/r/grant_cache.result b/mysql-test/r/grant_cache.result index b3e16f1fcf0..d905e9319fd 100644 --- a/mysql-test/r/grant_cache.result +++ b/mysql-test/r/grant_cache.result @@ -134,7 +134,7 @@ a b c a 1 1 1 test.t1 2 2 2 test.t1 select * from t2; -ERROR 42000: SELECT command denied to user: 'mysqltest_2@localhost' for table 't2' +ERROR 42000: SELECT command denied to user 'mysqltest_2'@'localhost' for table 't2' show status like "Qcache_queries_in_cache"; Variable_name Value Qcache_queries_in_cache 6 @@ -148,7 +148,7 @@ select "user3"; user3 user3 select * from t1; -ERROR 42000: SELECT command denied to user: 'mysqltest_3@localhost' for column 'b' in table 't1' +ERROR 42000: SELECT command denied to user 'mysqltest_3'@'localhost' for column 'b' in table 't1' select a from t1; a 1 @@ -156,7 +156,7 @@ a select c from t1; ERROR 42000: SELECT command denied to user 'mysqltest_3'@'localhost' for column 'c' in table 't1' select * from t2; -ERROR 42000: SELECT command denied to user: 'mysqltest_3@localhost' for table 't2' +ERROR 42000: SELECT command denied to user 'mysqltest_3'@'localhost' for table 't2' select mysqltest.t1.c from test.t1,mysqltest.t1; ERROR 42000: SELECT command denied to user 'mysqltest_3'@'localhost' for column 'c' in table 't1' show status like "Qcache_queries_in_cache"; diff --git a/mysql-test/r/ps_1general.result b/mysql-test/r/ps_1general.result index 5f8cb2597c6..25b9e2dcda4 100644 --- a/mysql-test/r/ps_1general.result +++ b/mysql-test/r/ps_1general.result @@ -834,7 +834,7 @@ execute s_t9 ; my_col 1 select a as my_col from t1; -ERROR 42000: select command denied to user 'second_user'@'localhost' for table 't1' +ERROR 42000: SELECT command denied to user 'second_user'@'localhost' for table 't1' grant select on mysqltest.t1 to second_user@localhost identified by 'looser' ; show grants for second_user@localhost ; @@ -873,7 +873,7 @@ Grants for second_user@localhost GRANT USAGE ON *.* TO 'second_user'@'localhost' IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3' GRANT SELECT ON `mysqltest`.`t9` TO 'second_user'@'localhost' execute s_t1 ; -ERROR 42000: select command denied to user 'second_user'@'localhost' for table 't1' +ERROR 42000: SELECT command denied to user 'second_user'@'localhost' for table 't1' revoke all privileges, grant option from second_user@localhost ; show grants for second_user@localhost ; Grants for second_user@localhost diff --git a/mysql-test/r/timezone2.result b/mysql-test/r/timezone2.result index 1c98fd18a08..a1a2fec739f 100644 --- a/mysql-test/r/timezone2.result +++ b/mysql-test/r/timezone2.result @@ -295,9 +295,9 @@ convert_tz(b, 'Europe/Moscow', 'UTC') update t1, t2 set t1.b = convert_tz('2004-11-30 12:00:00', 'Europe/Moscow', 'UTC') where t1.a = t2.c and t2.d = (select max(d) from t2); select * from mysql.time_zone_name; -ERROR 42000: select command denied to user 'mysqltest_1'@'localhost' for table 'time_zone_name' +ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for table 'time_zone_name' select Name, convert_tz('2004-11-30 12:00:00', Name, 'UTC') from mysql.time_zone_name; -ERROR 42000: select command denied to user 'mysqltest_1'@'localhost' for table 'time_zone_name' +ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for table 'time_zone_name' delete from mysql.user where user like 'mysqltest\_%'; delete from mysql.db where user like 'mysqltest\_%'; delete from mysql.tables_priv where user like 'mysqltest\_%'; diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result index 01db98648bd..6b700f7f6a2 100644 --- a/mysql-test/r/variables.result +++ b/mysql-test/r/variables.result @@ -115,13 +115,13 @@ set global concurrent_insert=DEFAULT; show variables like 'concurrent_insert'; Variable_name Value concurrent_insert ON -set storage_engine=MYISAM, storage_engine="HEAP", global storage_engine="INNODB"; +set storage_engine=MYISAM, storage_engine="HEAP", global storage_engine="MERGE"; show local variables like 'storage_engine'; Variable_name Value storage_engine HEAP show global variables like 'storage_engine'; Variable_name Value -storage_engine InnoDB +storage_engine MERGE set GLOBAL query_cache_size=100000; set GLOBAL myisam_max_sort_file_size=2000000; show global variables like 'myisam_max_sort_file_size'; @@ -220,7 +220,7 @@ set max_join_size="hello"; ERROR 42000: Incorrect argument type to variable 'max_join_size' set storage_engine=UNKNOWN_TABLE_TYPE; ERROR 42000: Unknown table engine 'UNKNOWN_TABLE_TYPE' -set storage_engine=INNODB, big_tables=2; +set storage_engine=MERGE, big_tables=2; ERROR 42000: Variable 'big_tables' can't be set to the value of '2' show local variables like 'storage_engine'; Variable_name Value diff --git a/mysql-test/t/grant2.test b/mysql-test/t/grant2.test index f86be0c95b9..7060d35e9a4 100644 --- a/mysql-test/t/grant2.test +++ b/mysql-test/t/grant2.test @@ -50,10 +50,9 @@ flush privileges; use mysqltest; create table t1 (id int primary key, data varchar(255)); -connect (mrbad, localhost, mysqltest_1,,); +connect (mrbad, localhost, mysqltest_1,,mysqltest); connection mrbad; show grants for current_user(); -use mysqltest; insert into t1 values (1, 'I can''t change it!'); --error 1044 update t1 set data='I can change it!' where id = 1; @@ -61,11 +60,32 @@ update t1 set data='I can change it!' where id = 1; --error 1044 insert into t1 values (1, 'XXX') on duplicate key update data= 'I can change it!'; select * from t1; +disconnect mrbad; connection default; drop table t1; -drop database mysqltest; -use test; delete from mysql.user where user like 'mysqltest\_%'; delete from mysql.db where user like 'mysqltest\_%'; flush privileges; + +create table t1 (a int, b int); +grant select (a) on t1 to mysqltest_1@localhost with grant option; +connect (mrugly, localhost, mysqltest_1,,mysqltest); +connection mrugly; +--error 1143 +grant select (a,b) on t1 to mysqltest_2@localhost; +--error 1142 +grant select on t1 to mysqltest_3@localhost; +disconnect mrugly; + +connection default; +drop table t1; +delete from mysql.user where user like 'mysqltest\_%'; +delete from mysql.db where user like 'mysqltest\_%'; +delete from mysql.tables_priv where user like 'mysqltest\_%'; +delete from mysql.columns_priv where user like 'mysqltest\_%'; +flush privileges; + +drop database mysqltest; +use test; + diff --git a/mysql-test/t/multi_update.test b/mysql-test/t/multi_update.test index e90de399500..4035099ec7e 100644 --- a/mysql-test/t/multi_update.test +++ b/mysql-test/t/multi_update.test @@ -433,6 +433,7 @@ delete t1 from t1,t2 where t1.col1 < (select max(col1) from t1) and t1.col1 = t2 drop table t1,t2; # Test for BUG#5837 - delete with outer join and const tables +--disable_warnings create table t1 ( aclid bigint not null primary key, status tinyint(1) not null @@ -442,6 +443,7 @@ create table t2 ( refid bigint not null primary key, aclid bigint, index idx_acl(aclid) ) engine = innodb; +--enable_warnings insert into t2 values(1,null); delete t2, t1 from t2 left join t1 on (t2.aclid=t1.aclid) where t2.refid='1'; drop table t1, t2; diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test index 7dc07f9313e..3a76ae5136e 100644 --- a/mysql-test/t/variables.test +++ b/mysql-test/t/variables.test @@ -71,7 +71,7 @@ show variables like 'concurrent_insert'; set global concurrent_insert=DEFAULT; show variables like 'concurrent_insert'; -set storage_engine=MYISAM, storage_engine="HEAP", global storage_engine="INNODB"; +set storage_engine=MYISAM, storage_engine="HEAP", global storage_engine="MERGE"; show local variables like 'storage_engine'; show global variables like 'storage_engine'; set GLOBAL query_cache_size=100000; @@ -128,7 +128,7 @@ set max_join_size="hello"; --error 1286 set storage_engine=UNKNOWN_TABLE_TYPE; --error 1231 -set storage_engine=INNODB, big_tables=2; +set storage_engine=MERGE, big_tables=2; show local variables like 'storage_engine'; --error 1229 set SESSION query_cache_size=10000; diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 5579aa9b3f5..2c11d1c87ad 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -964,9 +964,8 @@ static void acl_insert_db(const char *user, const char *host, const char *db, ulong acl_get(const char *host, const char *ip, const char *user, const char *db, my_bool db_is_pattern) { - ulong host_access,db_access; + ulong host_access= ~0,db_access= 0; uint i,key_length; - db_access=0; host_access= ~0; char key[ACL_KEY_LENGTH],*tmp_db,*end; acl_entry *entry; DBUG_ENTER("acl_get"); From 54b768472c3d304d18118ee8f88c7afe3ad92743 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 31 Dec 2004 12:46:18 +0100 Subject: [PATCH 0619/1063] - Bootrap now uses "compile-dist" by default to create the source distribution Build-tools/Bootstrap: - Use BUILD/compile-dist instead of compile-pentium-max - some minor cleanups --- BUILD/compile-dist | 46 +++++++++++++++++++++++++++++++++++++++++++ Build-tools/Bootstrap | 44 +++++++++++++++++++++-------------------- 2 files changed, 69 insertions(+), 21 deletions(-) create mode 100755 BUILD/compile-dist diff --git a/BUILD/compile-dist b/BUILD/compile-dist new file mode 100755 index 00000000000..2344d4dfffd --- /dev/null +++ b/BUILD/compile-dist @@ -0,0 +1,46 @@ +#!/bin/sh +# +# This script's purpose is to update the automake/autoconf helper scripts and +# to run a plain "configure" without any special compile flags. Only features +# that affect the content of the source distribution are enabled. The resulting +# tree can then be picked up by "make dist" to create the "pristine source +# package" that is used as the basis for all other binary builds. +# +make distclean +aclocal +autoheader +libtoolize --automake --force --copy +automake --force --add-missing --copy +autoconf +(cd bdb/dist && sh s_all) +(cd innobase && aclocal && autoheader && aclocal && automake && autoconf) + +# Default to gcc for CC and CXX +if test -z "$CXX" ; then + export CXX=gcc +fi + +if test -z "$CC" ; then + export CC=gcc +fi + +# Use ccache, if available +if ccache -V > /dev/null 2>&1 +then + if ! (echo "$CC" | grep "ccache" > /dev/null) + then + export CC="ccache $CC" + fi + if ! (echo "$CXX" | grep "ccache" > /dev/null) + then + export CXX="ccache $CXX" + fi +fi + +# Make sure to enable all features that affect "make dist" +./configure \ + --with-embedded-server \ + --with-berkeley-db \ + --with-innodb \ + --enable-thread-safe-client +make diff --git a/Build-tools/Bootstrap b/Build-tools/Bootstrap index a7d347ba32f..fc36c51ec85 100755 --- a/Build-tools/Bootstrap +++ b/Build-tools/Bootstrap @@ -26,7 +26,7 @@ else } # Some predefined settings -$build_command= "BUILD/compile-pentium-max"; +$build_command= "BUILD/compile-dist"; $PWD= cwd(); $opt_docdir= $PWD . "/mysqldoc"; $opt_archive_log= undef; @@ -70,7 +70,7 @@ GetOptions( "test|t", "verbose|v", "win-dist|w", - "quiet|q", + "quiet|q", ) || print_help(""); # @@ -122,18 +122,8 @@ if (($opt_directory ne $PWD) && (!-d $opt_directory && !$opt_dry_run)) # if ($opt_pull) { - &logger("Updating BK tree $REPO to latest ChangeSet first"); - chdir ($REPO) or &abort("Could not chdir to $REPO!"); - &run_command("bk pull", "Could not update $REPO!"); - chdir ($PWD) or &abort("Could not chdir to $PWD!"); - - unless ($opt_skip_manual) - { - &logger("Updating manual tree in $opt_docdir"); - chdir ($opt_docdir) or &abort("Could not chdir to $opt_docdir!"); - &run_command("bk pull", "Could not update $opt_docdir!"); - chdir ($PWD) or &abort("Could not chdir to $PWD!"); - } + &bk_pull("$REPO"); + &bk_pull("$opt_docdir") unless ($opt_skip_manual); } # @@ -270,7 +260,7 @@ if (defined $opt_changelog) $command.= " " . $REPO . " > $target_dir/ChangeLog"; &logger($command); # We cannot use run_command here because of output redirection - if (!$opt_dry_run) + unless ($opt_dry_run) { system($command) == 0 or &abort("Could not create $target_dir/ChangeLog!"); } @@ -281,17 +271,17 @@ if (defined $opt_changelog) # unless ($opt_skip_manual) { - $msg= "Updating manual files"; - &logger($msg); + &logger("Updating manual files"); foreach $file qw/internals manual reservedwords/ { system ("bk cat $opt_docdir/Docs/$file.texi > $target_dir/Docs/$file.texi") == 0 or &abort("Could not update $file.texi in $target_dir/Docs/!"); } - system ("rm -f $target_dir/Docs/Images/Makefile*") == 0 - or &abort("Could not remove Makefiles in $target_dir/Docs/Images/!"); - system ("cp $opt_docdir/Docs/Images/*.* $target_dir/Docs/Images") == 0 - or &abort("Could not copy image files in $target_dir/Docs/Images/!"); + + &run_command("rm -f $target_dir/Docs/Images/Makefile*", + "Could not remove Makefiles in $target_dir/Docs/Images/!"); + &run_command("cp $opt_docdir/Docs/Images/*.* $target_dir/Docs/Images", + "Could not copy image files in $target_dir/Docs/Images/!"); } # @@ -377,6 +367,18 @@ if ($opt_archive_log) exit 0; +# +# Run a BK pull on the given BK tree +# +sub bk_pull +{ + my $bk_tree= $_[0]; + &logger("Updating BK tree $bk_tree to latest ChangeSet first"); + chdir ($bk_tree) or &abort("Could not chdir to $bk_tree!"); + &run_command("bk pull", "Could not update $bk_tree!"); + chdir ($PWD) or &abort("Could not chdir to $PWD!"); +} + # # Print the help text message (with an optional message on top) # From 0428fcb89ea71ef397b26c65e11ef77097a3a83f Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 31 Dec 2004 13:12:36 +0100 Subject: [PATCH 0620/1063] - updated compile-dist to include NDB cluster BUILD/compile-dist: - make sure to include NDB cluster in the distribution, too --- BUILD/compile-dist | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/BUILD/compile-dist b/BUILD/compile-dist index 2344d4dfffd..f27c218747c 100755 --- a/BUILD/compile-dist +++ b/BUILD/compile-dist @@ -42,5 +42,6 @@ fi --with-embedded-server \ --with-berkeley-db \ --with-innodb \ - --enable-thread-safe-client + --enable-thread-safe-client \ + --with-ndbcluster make From cd47cb56fd76a47def597e7b486b89c65a65481d Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 31 Dec 2004 15:05:41 +0200 Subject: [PATCH 0621/1063] row0upd.c: Fix a little bug in InnoDB: we looked at the physical size of a stored SQL NULL value from a wrong field in the index; this has probably caused no bugs visible to the user, only caused some extra space usage in some rare cases; we may later backport the fix to 4.0 innobase/row/row0upd.c: Fix a little bug in InnoDB: we looked at the physical size of a stored SQL NULL value from a wrong field in the index; this has probably caused no bugs visible to the user, only caused some extra space usage in some rare cases; we may later backport the fix to 4.0 --- innobase/row/row0upd.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/innobase/row/row0upd.c b/innobase/row/row0upd.c index a449b9f1736..9192f6dc692 100644 --- a/innobase/row/row0upd.c +++ b/innobase/row/row0upd.c @@ -381,8 +381,14 @@ row_upd_changes_field_size_or_external( new_len = new_val->len; if (new_len == UNIV_SQL_NULL) { + /* A bug fixed on Dec 31st, 2004: we looked at the + SQL NULL size from the wrong field! We may backport + this fix also to 4.0. The merge to 5.0 will be made + manually immediately after we commit this to 4.1. */ + new_len = dtype_get_sql_null_size( - dict_index_get_nth_type(index, i)); + dict_index_get_nth_type(index, + upd_field->field_no)); } old_len = rec_get_nth_field_size(rec, upd_field->field_no); From 56db297d002150216c1085550b39a8bec65caf64 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 1 Jan 2005 13:49:53 +0200 Subject: [PATCH 0622/1063] log0recv.c: Fix a wrong memset in InnoDB Hot Backup code; the bug probably did not affect anything since we do not assume that the header of a log file is filled with zeros before writing the header info there; the bug found by Felix von Leitner innobase/log/log0recv.c: Fix a wrong memset in InnoDB Hot Backup code; the bug probably did not affect anything since we do not assume that the header of a log file is filled with zeros before writing the header info there; the bug found by Felix von Leitner --- innobase/log/log0recv.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/innobase/log/log0recv.c b/innobase/log/log0recv.c index 10f921bb1f0..ae84f085523 100644 --- a/innobase/log/log0recv.c +++ b/innobase/log/log0recv.c @@ -2990,8 +2990,7 @@ recv_reset_log_files_for_backup( memcpy(name + log_dir_len, logfilename, sizeof logfilename); buf = ut_malloc(LOG_FILE_HDR_SIZE + OS_FILE_LOG_BLOCK_SIZE); - memset(buf, LOG_FILE_HDR_SIZE + OS_FILE_LOG_BLOCK_SIZE, '\0'); - + memset(buf, '\0', LOG_FILE_HDR_SIZE + OS_FILE_LOG_BLOCK_SIZE); for (i = 0; i < n_log_files; i++) { From 3e2e4fb77fa30ca66849f9e05a30a7f339348a63 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 1 Jan 2005 19:27:41 +0100 Subject: [PATCH 0623/1063] mysql-test-run.pl: Added --ps-protocol and --embedded-server mysql-test/mysql-test-run.pl: Added --ps-protocol and --embedded-server --- mysql-test/mysql-test-run.pl | 125 ++++++++++++++++++++++------------- 1 file changed, 79 insertions(+), 46 deletions(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index c90ebf22dad..a69dcdce5c6 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -95,6 +95,7 @@ $Devel::Trace::TRACE= 1; my @skip_if_embedded_server= ( + "alter_table", "bdb-deadlock", "connect", "flush_block_commit", @@ -148,6 +149,7 @@ our @mysqld_src_dirs= our $glob_win32= 0; our $glob_mysql_test_dir= undef; +our $glob_mysql_bench_dir= undef; our $glob_hostname= undef; our $glob_scriptname= undef; our $glob_use_running_server= 0; @@ -237,6 +239,8 @@ our $opt_skip_test; our $opt_sleep; +our $opt_ps_protocol; + # FIXME all of the sleep time handling needs cleanup our $opt_sleep_time_after_restart= 1; our $opt_sleep_time_for_delete= 10; @@ -301,7 +305,7 @@ sub mysqld_arguments ($$$$$); sub stop_masters_slaves (); sub stop_masters (); sub stop_slaves (); -sub run_mysqltest ($); +sub run_mysqltest ($$); ###################################################################### # @@ -396,6 +400,7 @@ sub initial_setup () { # 'basedir' is always parent of "mysql-test" directory $glob_mysql_test_dir= cwd(); $glob_basedir= dirname($glob_mysql_test_dir); + $glob_mysql_bench_dir= "$glob_basedir/mysql-bench"; # FIXME make configurable $path_timefile= "$glob_mysql_test_dir/var/log/mysqltest-time"; @@ -441,6 +446,7 @@ sub command_line_setup () { 'debug' => \$opt_debug, 'do-test=s' => \$opt_do_test, 'embedded-server' => \$opt_embedded_server, + 'ps-protocol' => \$opt_ps_protocol, 'extern' => \$opt_extern, 'fast' => \$opt_fast, 'force' => \$opt_force, @@ -458,6 +464,7 @@ sub command_line_setup () { 'netware' => \$opt_netware, 'no-manager' => \$opt_no_manager, 'old-master' => \$opt_old_master, + 'ps-protocol' => \$opt_ps_protocol, 'record' => \$opt_record, 'script-debug' => \$opt_script_debug, 'skip-rpl' => \$opt_skip_rpl, @@ -526,7 +533,7 @@ sub command_line_setup () { if ( $opt_extern and $opt_local ) { - die "Can't use --extern and --local at the same time"; + mtr_error("Can't use --extern and --local at the same time"); } if ( ! $opt_socket ) @@ -568,7 +575,7 @@ sub command_line_setup () { if ( $opt_extern ) { - die "Can't use --extern with --embedded-server"; + mtr_error("Can't use --extern with --embedded-server"); } $opt_result_ext= ".es"; } @@ -589,12 +596,14 @@ sub command_line_setup () { $opt_sleep_time_after_restart= $opt_sleep; } - if ( $opt_gcov ) + if ( $opt_gcov and ! $opt_source_dist ) { - if ( $opt_source_dist ) - { - die "Coverage test needs the source - please use source dist"; - } + mtr_error("Coverage test needs the source - please use source dist"); + } + + if ( $glob_use_embedded_server and ! $opt_source_dist ) + { + mtr_error("Embedded server needs source tree - please use source dist"); } if ( $opt_gdb ) @@ -602,7 +611,7 @@ sub command_line_setup () { $opt_wait_timeout= 300; if ( $opt_extern ) { - die "Can't use --extern with --gdb"; + mtr_error("Can't use --extern with --gdb"); } } @@ -611,7 +620,7 @@ sub command_line_setup () { $opt_gdb= 1; if ( $opt_extern ) { - die "Can't use --extern with --manual-gdb"; + mtr_error("Can't use --extern with --manual-gdb"); } } @@ -619,7 +628,7 @@ sub command_line_setup () { { if ( $opt_extern ) { - die "Can't use --extern with --ddd"; + mtr_error("Can't use --extern with --ddd"); } } @@ -689,10 +698,10 @@ sub executable_setup () { { mtr_error("Cannot find embedded server 'mysqltest'"); } + $path_tests_bindir= "$glob_basedir/libmysqld/examples"; } else { - $exe_mysqld= "$glob_basedir/sql/mysqld"; if ( -f "$glob_basedir/client/.libs/lt-mysqltest" ) { $exe_mysqltest= "$glob_basedir/client/.libs/lt-mysqltest"; @@ -705,6 +714,7 @@ sub executable_setup () { { $exe_mysqltest= "$glob_basedir/client/mysqltest"; } + $path_tests_bindir= "$glob_basedir/tests"; } if ( -f "$glob_basedir/client/.libs/mysqldump" ) { @@ -723,8 +733,8 @@ sub executable_setup () { $exe_mysqlbinlog= "$glob_basedir/client/mysqlbinlog"; } + $exe_mysqld= "$glob_basedir/sql/mysqld"; $path_client_bindir= "$glob_basedir/client"; - $path_tests_bindir= "$glob_basedir/tests"; $exe_mysqladmin= "$path_client_bindir/mysqladmin"; $exe_mysql= "$path_client_bindir/mysql"; $path_language= "$glob_basedir/sql/share/english/"; @@ -791,7 +801,7 @@ sub handle_int_signal () { $SIG{INT}= 'DEFAULT'; # If we get a ^C again, we die... mtr_warning("got INT signal, cleaning up....."); stop_masters_slaves(); - exit(1); + mtr_error("We die from ^C signal from user"); } @@ -806,7 +816,7 @@ sub collect_test_cases () { my @tests; # Array of hash, will be array of C struct - opendir(TESTDIR, $testdir) or die "Can't open dir \"$testdir\": $!"; + opendir(TESTDIR, $testdir) or mtr_error("Can't open dir \"$testdir\": $!"); foreach my $elem ( sort readdir(TESTDIR) ) { my $tname= mtr_match_extension($elem,"test"); @@ -1066,7 +1076,7 @@ sub sleep_until_file_created ($$) { if ( ! -r $pidfile ) { - die "No $pidfile was created"; + mtr_error("No $pidfile was created"); } } @@ -1084,7 +1094,7 @@ sub ndbcluster_start () { mtr_report("Starting ndbcluster"); my $ndbcluster_opts= $opt_bench ? "" : "--small"; # FIXME check result code?! - mtr_run("./ndb/ndbcluster", + mtr_run("$glob_mysql_test_dir/ndb/ndbcluster", ["--port-base=$opt_ndbcluster_port", $ndbcluster_opts, "--diskless", @@ -1094,7 +1104,7 @@ sub ndbcluster_start () { } sub ndbcluster_stop () { - mtr_run("./ndb/ndbcluster", + mtr_run("$glob_mysql_test_dir/ndb/ndbcluster", ["--data-dir=$glob_mysql_test_dir/var", "--port-base=$opt_ndbcluster_port", "--stop"], @@ -1142,17 +1152,17 @@ sub run_benchmarks ($) { if ( ! $benchmark ) { mtr_add_arg($args, "--log"); - mtr_run("./run-all-tests", $args, "", "", "", ""); + mtr_run("$glob_mysql_bench_dir/run-all-tests", $args, "", "", "", ""); # FIXME check result code?! } elsif ( -x $benchmark ) { - mtr_run("./$benchmark", $args, "", "", "", ""); + mtr_run("$glob_mysql_bench_dir/$benchmark", $args, "", "", "", ""); # FIXME check result code?! } else { - mtr_error("benchmark $benchmark not found"); + mtr_error("Benchmark $benchmark not found"); } chdir($glob_mysql_test_dir); # Go back @@ -1172,6 +1182,8 @@ sub run_benchmarks ($) { sub run_tests () { + mtr_report("Finding Tests"); + my $tests= collect_test_cases(); mtr_report("Starting Tests"); @@ -1255,7 +1267,7 @@ sub install_db ($$) { if ( mtr_run($exe_mysqld, $args, $init_db_sql, $path_manager_log, $path_manager_log, "") != 0 ) { - mtr_error("error executing mysqld --bootstrap\n" . + mtr_error("Error executing mysqld --bootstrap\n" . "Could not install $type test DBs"); } } @@ -1293,6 +1305,7 @@ sub run_testcase ($) { if ( $tinfo->{'skip'} ) { + mtr_report_test_name($tinfo); mtr_report_test_skipped($tinfo); return; } @@ -1323,14 +1336,24 @@ sub run_testcase ($) { # ---------------------------------------------------------------------- stop_slaves(); + } - # ---------------------------------------------------------------------- - # Start masters - # ---------------------------------------------------------------------- + # ---------------------------------------------------------------------- + # Prepare to start masters. Even if we use embedded, we want to run + # the preparation. + # ---------------------------------------------------------------------- - mtr_tofile($master->[0]->{'path_myerr'},"CURRENT_TEST: $tname\n"); - do_before_start_master($tname,$tinfo->{'master_sh'}); + mtr_tofile($master->[0]->{'path_myerr'},"CURRENT_TEST: $tname\n"); + do_before_start_master($tname,$tinfo->{'master_sh'}); + # ---------------------------------------------------------------------- + # Start masters + # ---------------------------------------------------------------------- + + mtr_report_test_name($tinfo); + + if ( ! $glob_use_running_server and ! $glob_use_embedded_server ) + { # FIXME give the args to the embedded server?! # FIXME what does $opt_local_master mean?! # FIXME split up start and check that started so that can do @@ -1385,9 +1408,7 @@ sub run_testcase ($) { unlink("r/$tname.reject"); unlink($path_timefile); - mtr_report_test_name($tinfo); - - my $res= run_mysqltest($tinfo); + my $res= run_mysqltest($tinfo, $tinfo->{'master_opt'}); if ( $res == 0 ) { @@ -1470,7 +1491,7 @@ sub do_before_start_master ($$) { if ( $master_init_script and mtr_run($master_init_script, [], "", "", "", "") != 0 ) { - mtr_error("can't run $master_init_script"); + mtr_error("Can't run $master_init_script"); } # for gcov FIXME needed? If so we need more absolute paths # chdir($glob_basedir); @@ -1501,7 +1522,7 @@ sub do_before_start_slave ($$) { if ( $slave_init_script and mtr_run($slave_init_script, [], "", "", "", "") != 0 ) { - mtr_error("can't run $slave_init_script"); + mtr_error("Can't run $slave_init_script"); } unlink("$glob_mysql_test_dir/var/slave-data/log.*"); @@ -1525,9 +1546,11 @@ sub mysqld_arguments ($$$$$) { if ( $glob_use_embedded_server ) { $prefix= "--server-arg="; + } else { + # We can't pass embedded server --no-defaults + mtr_add_arg($args, "%s--no-defaults", $prefix); } - mtr_add_arg($args, "%s--no-defaults", $prefix); mtr_add_arg($args, "%s--basedir=%s", $prefix, $path_my_basedir); mtr_add_arg($args, "%s--character-sets-dir=%s", $prefix, $path_charsetsdir); mtr_add_arg($args, "%s--core", $prefix); @@ -1815,7 +1838,7 @@ sub mysqld_start ($$$$) { } } - die "Can't start mysqld FIXME"; + mtr_error("Can't start mysqld FIXME"); } sub stop_masters_slaves () { @@ -1870,8 +1893,9 @@ sub stop_slaves () { } -sub run_mysqltest ($) { - my $tinfo= shift; +sub run_mysqltest ($$) { + my $tinfo= shift; + my $master_opts= shift; # FIXME set where???? my $cmdline_mysqldump= "$exe_mysqldump --no-defaults -uroot " . @@ -1901,19 +1925,11 @@ sub run_mysqltest ($) { $ENV{'CLIENT_BINDIR'}= $path_client_bindir; $ENV{'TESTS_BINDIR'}= $path_tests_bindir; - my $exe= $exe_mysqltest; - my $args; # Arg vector + my $exe= $exe_mysqltest; + my $args; mtr_init_args(\$args); - if ( $opt_strace_client ) - { - $exe= "strace"; # FIXME there are ktrace, .... - mtr_add_arg($args, "-o"); - mtr_add_arg($args, "%s/var/log/mysqltest.strace", $glob_mysql_test_dir); - mtr_add_arg($args, "$exe_mysqltest"); - } - mtr_add_arg($args, "--no-defaults"); mtr_add_arg($args, "--socket=%s", $master->[0]->{'path_mysock'}); mtr_add_arg($args, "--database=test"); @@ -1925,6 +1941,19 @@ sub run_mysqltest ($) { mtr_add_arg($args, "--tmpdir=%s", $opt_tmpdir); mtr_add_arg($args, "--port=%d", $master->[0]->{'path_myport'}); + if ( $opt_ps_protocol ) + { + mtr_add_arg($args, "--ps-protocol"); + } + + if ( $opt_strace_client ) + { + $exe= "strace"; # FIXME there are ktrace, .... + mtr_add_arg($args, "-o"); + mtr_add_arg($args, "%s/var/log/mysqltest.strace", $glob_mysql_test_dir); + mtr_add_arg($args, "$exe_mysqltest"); + } + if ( $opt_timer ) { mtr_add_arg($args, "--timer-file=var/log/timer"); @@ -1966,6 +1995,10 @@ sub run_mysqltest ($) { mtr_add_arg($args, "-R"); mtr_add_arg($args, $tinfo->{'result_file'}); + # ---------------------------------------------------------------------- + # If embedded server, we create server args to give mysqltest to pass on + # ---------------------------------------------------------------------- + if ( $glob_use_embedded_server ) { mysqld_arguments($args,'master',0,$tinfo->{'master_opt'},[]); From e2d17faa2bfb291c51581b96a48968681b9d16f8 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 1 Jan 2005 22:40:40 +0100 Subject: [PATCH 0624/1063] Fixed failed merge --- sql/ha_ndbcluster.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 699a75a94c7..9e50ef9ed2a 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -2784,7 +2784,7 @@ int ha_ndbcluster::extra(enum ha_extra_function operation) { DBUG_PRINT("info", ("Ignoring duplicate key")); m_ignore_dup_key= TRUE; - + } break; case HA_EXTRA_NO_IGNORE_DUP_KEY: DBUG_PRINT("info", ("HA_EXTRA_NO_IGNORE_DUP_KEY")); @@ -3661,15 +3661,16 @@ int ha_ndbcluster::rename_table(const char *from, const char *to) if (check_ndb_connection()) DBUG_RETURN(my_errno= HA_ERR_NO_CONNECTION); - - dict= m_ndb->getDictionary(); + + Ndb *ndb= get_ndb(); + dict= ndb->getDictionary(); if (!(orig_tab= dict->getTable(m_tabname))) ERR_RETURN(dict->getNdbError()); m_table= (void *)orig_tab; // Change current database to that of target table set_dbname(to); - m_ndb->setDatabaseName(m_dbname); + ndb->setDatabaseName(m_dbname); if (!(result= alter_table_name(new_tabname))) { // Rename .ndb file @@ -3688,7 +3689,6 @@ int ha_ndbcluster::alter_table_name(const char *to) { Ndb *ndb= get_ndb(); NDBDICT *dict= ndb->getDictionary(); - NDBDICT * dict= m_ndb->getDictionary(); const NDBTAB *orig_tab= (const NDBTAB *) m_table; int ret; DBUG_ENTER("alter_table_name_table"); From 7a18eb7a6bee68767b0b2d59722d0bdfe551f7ce Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 1 Jan 2005 22:47:50 +0100 Subject: [PATCH 0625/1063] Fixed failed merge --- sql/ha_ndbcluster.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 9e50ef9ed2a..3c6cd83d5dc 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -212,6 +212,7 @@ Thd_ndb::~Thd_ndb() { if (ndb) delete ndb; + ndb= 0; } inline @@ -2687,7 +2688,6 @@ void ha_ndbcluster::info(uint flag) { DBUG_PRINT("info", ("HA_STATUS_ERRKEY")); errkey= m_dupkey; - errkey= m_dupkey; } if (flag & HA_STATUS_AUTO) DBUG_PRINT("info", ("HA_STATUS_AUTO")); From 55d9781de318581368d4b94c12ce4e2205f6f23f Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 2 Jan 2005 19:58:49 +0500 Subject: [PATCH 0626/1063] WL#964 move my_end() after free_used_memory() client/mysqltest.c: move my_end() after free_used_memory() --- client/mysqltest.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client/mysqltest.c b/client/mysqltest.c index 18d5660d1a7..abacd73d878 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -538,7 +538,6 @@ static void free_used_memory() mysql_server_end(); if (ps_protocol) ps_free_reg(); - my_end(MY_CHECK_ERROR); DBUG_VOID_RETURN; } @@ -556,6 +555,7 @@ static void die(const char* fmt, ...) } va_end(args); free_used_memory(); + my_end(MY_CHECK_ERROR); exit(1); } @@ -568,6 +568,7 @@ static void abort_not_supported_test() if (!silent) printf("skipped\n"); free_used_memory(); + my_end(MY_CHECK_ERROR); exit(2); } @@ -3655,6 +3656,7 @@ int main(int argc, char **argv) if (!got_end_timer) timer_output(); /* No end_timer cmd, end it */ free_used_memory(); + my_end(MY_CHECK_ERROR); exit(error ? 1 : 0); return error ? 1 : 0; /* Keep compiler happy */ } From 4d5ef21f04664986aaf9c32536e9a8be88db7425 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 2 Jan 2005 16:57:21 +0100 Subject: [PATCH 0627/1063] mysql-test-run.pl: Added initial support for multiple test suites Added usage information, i.e. --help mysql-test/mysql-test-run.pl: Added initial support for multiple test suites Added usage information, i.e. --help --- mysql-test/mysql-test-run.pl | 234 +++++++++++++++++++++++++++++------ 1 file changed, 194 insertions(+), 40 deletions(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index a69dcdce5c6..5565d29fb7b 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -172,6 +172,9 @@ our $path_slave_load_tmpdir; # What is this?! our $path_my_basedir; our $opt_tmpdir; # A path but set directly on cmd line +our $opt_usage; +our $opt_suite; + our $opt_netware; our $opt_script_debug= 0; # Script debugging, enable with --script-debug @@ -290,6 +293,7 @@ sub initial_setup (); sub command_line_setup (); sub executable_setup (); sub kill_and_cleanup (); +sub collect_test_cases ($); sub sleep_until_file_created ($$); sub ndbcluster_start (); sub ndbcluster_stop (); @@ -306,6 +310,7 @@ sub stop_masters_slaves (); sub stop_masters (); sub stop_slaves (); sub run_mysqltest ($$); +sub usage ($); ###################################################################### # @@ -423,6 +428,7 @@ sub command_line_setup () { # These are defaults for things that are set on the command line + $opt_suite= "main"; # Special default suite $opt_tmpdir= "$glob_mysql_test_dir/var/tmp"; # FIXME maybe unneded? $path_manager_log= "$glob_mysql_test_dir/var/log/manager.log"; @@ -436,61 +442,85 @@ sub command_line_setup () { my $opt_user; # Read the command line + # Note: Keep list, and the order, in sync with usage at end of this file GetOptions( - 'bench' => \$opt_bench, - 'big-test' => \$opt_big_test, - 'client-gdb' => \$opt_client_gdb, - 'compress' => \$opt_compress, - 'ddd' => \$opt_ddd, - 'debug' => \$opt_debug, - 'do-test=s' => \$opt_do_test, + # Control what engine/variation to run 'embedded-server' => \$opt_embedded_server, 'ps-protocol' => \$opt_ps_protocol, - 'extern' => \$opt_extern, - 'fast' => \$opt_fast, - 'force' => \$opt_force, - 'gcov' => \$opt_gcov, - 'gdb' => \$opt_gdb, - 'gprof' => \$opt_gprof, - 'local' => \$opt_local, - 'local-master' => \$opt_local_master, - 'manual-gdb' => \$opt_manual_gdb, - 'master-binary=s' => \$exe_master_mysqld, - 'master_port=i' => \$opt_master_myport, - 'mysqld=s' => \$opt_extra_mysqld_opt, - 'ndbcluster_port=i' => \$opt_ndbcluster_port, - 'ndbconnectstring=s' => \$opt_ndbconnectstring, - 'netware' => \$opt_netware, + 'bench' => \$opt_bench, + 'small-bench' => \$opt_small_bench, 'no-manager' => \$opt_no_manager, - 'old-master' => \$opt_old_master, - 'ps-protocol' => \$opt_ps_protocol, - 'record' => \$opt_record, - 'script-debug' => \$opt_script_debug, + + # Control what test suites or cases to run + 'force' => \$opt_force, + 'with-ndbcluster' => \$opt_with_ndbcluster, + 'do-test=s' => \$opt_do_test, + 'suite=s' => \$opt_suite, 'skip-rpl' => \$opt_skip_rpl, 'skip-test=s' => \$opt_skip_test, - 'slave-binary=s' => \$exe_slave_mysqld, + + # Specify ports + 'master_port=i' => \$opt_master_myport, 'slave_port=i' => \$opt_slave_myport, + 'ndbcluster_port=i' => \$opt_ndbcluster_port, + + # Test case authoring + 'record' => \$opt_record, + + # ??? + 'mysqld=s' => \$opt_extra_mysqld_opt, + + # Run test on running server + 'extern' => \$opt_extern, + 'ndbconnectstring=s' => \$opt_ndbconnectstring, + + # Debugging + 'gdb' => \$opt_gdb, + 'manual-gdb' => \$opt_manual_gdb, + 'client-gdb' => \$opt_client_gdb, + 'ddd' => \$opt_ddd, + 'strace-client' => \$opt_strace_client, + 'master-binary=s' => \$exe_master_mysqld, + 'slave-binary=s' => \$exe_slave_mysqld, + + # Coverage, profiling etc + 'gcov' => \$opt_gcov, + 'gprof' => \$opt_gprof, + 'valgrind' => \$opt_valgrind, + 'valgrind-all' => \$opt_valgrind_all, + 'valgrind-options=s' => \$opt_valgrind_options, + + # Misc + 'big-test' => \$opt_big_test, + 'compress' => \$opt_compress, + 'debug' => \$opt_debug, + 'fast' => \$opt_fast, + 'local' => \$opt_local, + 'local-master' => \$opt_local_master, + 'netware' => \$opt_netware, + 'old-master' => \$opt_old_master, + 'script-debug' => \$opt_script_debug, 'sleep=i' => \$opt_sleep, - 'small-bench' => \$opt_small_bench, 'socket=s' => \$opt_socket, 'start-and-exit' => \$opt_start_and_exit, 'start-from=s' => \$opt_start_from, - 'strace-client' => \$opt_strace_client, 'timer' => \$opt_timer, 'tmpdir=s' => \$opt_tmpdir, 'user-test=s' => \$opt_user_test, 'user=s' => \$opt_user, - 'valgrind' => \$opt_valgrind, - 'valgrind-all' => \$opt_valgrind_all, - 'valgrind-options=s' => \$opt_valgrind_options, 'verbose' => \$opt_verbose, 'wait-timeout=i' => \$opt_wait_timeout, 'warnings|log-warnings' => \$opt_warnings, - 'with-ndbcluster' => \$opt_with_ndbcluster, 'with-openssl' => \$opt_with_openssl, + + 'help|h' => \$opt_usage, ) or usage("Can't read options"); + if ( $opt_usage ) + { + usage(""); + } # Put this into a hash, will be a C struct @@ -593,7 +623,7 @@ sub command_line_setup () { if ( $opt_sleep ) { - $opt_sleep_time_after_restart= $opt_sleep; + $opt_sleep_time_after_restart= $opt_sleep; } if ( $opt_gcov and ! $opt_source_dist ) @@ -811,8 +841,22 @@ sub handle_int_signal () { # ############################################################################## -sub collect_test_cases () { - my $testdir= "$glob_mysql_test_dir/t"; +sub collect_test_cases ($) { + my $suite= shift; # Test suite name + + my $testdir; + my $resdir; + + if ( $suite eq "main" ) + { + $testdir= "$glob_mysql_test_dir/t"; + $resdir= "$glob_mysql_test_dir/r"; + } + else + { + $testdir= "$glob_mysql_test_dir/suite/$suite/t"; + $resdir= "$glob_mysql_test_dir/suite/$suite/r"; + } my @tests; # Array of hash, will be array of C struct @@ -839,7 +883,7 @@ sub collect_test_cases () { my $tinfo= {}; $tinfo->{'name'}= $tname; - $tinfo->{'result_file'}= "r/$tname.result"; + $tinfo->{'result_file'}= "$resdir/$tname.result"; push(@tests, $tinfo); if ( $opt_skip_test and defined mtr_match_prefix($tname,$opt_skip_test) ) @@ -1180,13 +1224,22 @@ sub run_benchmarks ($) { # ############################################################################## +# FIXME how to specify several suites to run? Comma separated list? + sub run_tests () { + run_suite($opt_suite); +} - mtr_report("Finding Tests"); +sub run_suite () { + my $suite= shift; - my $tests= collect_test_cases(); + mtr_print_thick_line(); - mtr_report("Starting Tests"); + mtr_report("Finding Tests in $suite suite"); + + my $tests= collect_test_cases($suite); + + mtr_report("Starting Tests in $suite suite"); mtr_print_header(); @@ -2006,3 +2059,104 @@ sub run_mysqltest ($$) { return mtr_run($exe_mysqltest,$args,$tinfo->{'path'},"",$path_timefile,""); } + +############################################################################## +# +# Usage +# +############################################################################## + +sub usage ($) +{ + print STDERR < Date: Sun, 2 Jan 2005 15:10:08 -0600 Subject: [PATCH 0628/1063] set_var.cc: Silence compiler warning. sql/set_var.cc: Silence compiler warning. BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted --- BitKeeper/etc/logging_ok | 1 + sql/set_var.cc | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok index f8dd043ff10..d6ab5ae3180 100644 --- a/BitKeeper/etc/logging_ok +++ b/BitKeeper/etc/logging_ok @@ -164,6 +164,7 @@ paul@frost.snake.net paul@ice.local paul@ice.snake.net paul@kite-hub.kitebird.com +paul@snake-hub.snake.net paul@teton.kitebird.com pekka@mysql.com pem@mysql.com diff --git a/sql/set_var.cc b/sql/set_var.cc index e39d9934278..082c55db188 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -2948,7 +2948,7 @@ bool sys_var_thd_storage_engine::check(THD *thd, set_var *var) enum db_type db_type; if (!(res=var->value->val_str(&str)) || !(var->save_result.ulong_value= - (ulong) db_type= ha_resolve_by_name(res->ptr(), res->length())) || + (ulong) (db_type= ha_resolve_by_name(res->ptr(), res->length()))) || ha_checktype(db_type) != db_type) { value= res ? res->c_ptr() : "NULL"; From d942c9a87b9fedd6559f97650f3223cfb10819b0 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 3 Jan 2005 17:33:04 +0400 Subject: [PATCH 0629/1063] Fix for bug #7545 (Undefined symbols if --without-geometry) myisam/mi_check.c: This code should be ifdefed in no HAVE_SPATIAL case --- myisam/mi_check.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/myisam/mi_check.c b/myisam/mi_check.c index f7e7ffd42f6..0123278a23f 100644 --- a/myisam/mi_check.c +++ b/myisam/mi_check.c @@ -1466,12 +1466,14 @@ static int writekeys(MI_CHECK *param, register MI_INFO *info, byte *buff, if (_mi_ft_add(info,i,(char*) key,buff,filepos)) goto err; } +#ifdef HAVE_SPATIAL else if (info->s->keyinfo[i].flag & HA_SPATIAL) { uint key_length=_mi_make_key(info,i,key,buff,filepos); if (rtree_insert(info, i, key, key_length)) goto err; } +#endif /*HAVE_SPATIAL*/ else { uint key_length=_mi_make_key(info,i,key,buff,filepos); From 8bf7b342bce4ac58b075f3e36c95fc57731f13aa Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 3 Jan 2005 18:37:08 +0500 Subject: [PATCH 0630/1063] WL#964 added sort of file names for all OS BitKeeper/etc/ignore: Added mysql-test/mysql-test-run.log mysql-test/r/alter_table.err mysql-test/r/archive.err mysql-test/r/bdb-alter-table-1.err mysql-test/r/bdb-alter-table-2.err mysql-test/r/bdb-crash.err mysql-test/r/bdb-deadlock.err mysql-test/r/bdb.err mysql-test/r/bdb_cache.err mysql-test/r/client_test.err mysql-test/r/csv.err mysql-test/r/ctype_ucs.err mysql-test/r/derived.err mysql-test/r/exampledb.err mysql-test/r/func_encrypt.err mysql-test/r/isam.err mysql-test/r/lowercase_table2.err mysql-test/r/multi_update.err mysql-test/r/mysql_protocols.err mysql-test/r/mysqlbinlog.err mysql-test/r/mysqlbinlog2.err mysql-test/r/mysqldump.err mysql-test/r/mysqltest.err mysql-test/r/ndb_alter_table.err mysql-test/r/ndb_autodiscover.err mysql-test/r/ndb_autodiscover2.err mysql-test/r/ndb_basic.err mysql-test/r/ndb_blob.err mysql-test/r/ndb_cache.err mysql-test/r/ndb_charset.err mysql-test/r/ndb_index.err mysql-test/r/ndb_index_ordered.err mysql-test/r/ndb_index_unique.err mysql-test/r/ndb_insert.err mysql-test/r/ndb_limit.err m mysql-test/mysql_test_run_new.c: added sort of file names for all OS --- .bzrignore | 54 +++++++++++++++++++++++++++++++++ mysql-test/mysql_test_run_new.c | 37 +++++++++++----------- 2 files changed, 72 insertions(+), 19 deletions(-) diff --git a/.bzrignore b/.bzrignore index ee48342fd37..bfa4ef2058c 100644 --- a/.bzrignore +++ b/.bzrignore @@ -948,3 +948,57 @@ client/mysqladmin.c mysql-4.1.8-win-src.zip ndb/include/ndb_version.h ndb/include/ndb_global.h +mysql-test/mysql-test-run.log +mysql-test/r/alter_table.err +mysql-test/r/archive.err +mysql-test/r/bdb-alter-table-1.err +mysql-test/r/bdb-alter-table-2.err +mysql-test/r/bdb-crash.err +mysql-test/r/bdb-deadlock.err +mysql-test/r/bdb.err +mysql-test/r/bdb_cache.err +mysql-test/r/client_test.err +mysql-test/r/csv.err +mysql-test/r/ctype_ucs.err +mysql-test/r/derived.err +mysql-test/r/exampledb.err +mysql-test/r/func_encrypt.err +mysql-test/r/isam.err +mysql-test/r/lowercase_table2.err +mysql-test/r/multi_update.err +mysql-test/r/mysql_protocols.err +mysql-test/r/mysqlbinlog.err +mysql-test/r/mysqlbinlog2.err +mysql-test/r/mysqldump.err +mysql-test/r/mysqltest.err +mysql-test/r/ndb_alter_table.err +mysql-test/r/ndb_autodiscover.err +mysql-test/r/ndb_autodiscover2.err +mysql-test/r/ndb_basic.err +mysql-test/r/ndb_blob.err +mysql-test/r/ndb_cache.err +mysql-test/r/ndb_charset.err +mysql-test/r/ndb_index.err +mysql-test/r/ndb_index_ordered.err +mysql-test/r/ndb_index_unique.err +mysql-test/r/ndb_insert.err +mysql-test/r/ndb_limit.err +mysql-test/r/ndb_lock.err +mysql-test/r/ndb_minmax.err +mysql-test/r/ndb_replace.err +mysql-test/r/ndb_subquery.err +mysql-test/r/ndb_transaction.err +mysql-test/r/ndb_truncate.err +mysql-test/r/ndb_types.err +mysql-test/r/ndb_update.err +mysql-test/r/openssl_1.err +mysql-test/r/ps_1general.err +mysql-test/r/ps_6bdb.err +mysql-test/r/ps_7ndb.err +mysql-test/r/query_cache.err +mysql-test/r/query_cache_merge.err +mysql-test/r/raid.err +mysql-test/r/repair.err +mysql-test/r/replace.err +mysql-test/r/rpl000001.err +mysql-test/r/rpl000015.err diff --git a/mysql-test/mysql_test_run_new.c b/mysql-test/mysql_test_run_new.c index fe13d71c1c2..7b77fc5ced8 100644 --- a/mysql-test/mysql_test_run_new.c +++ b/mysql-test/mysql_test_run_new.c @@ -89,15 +89,15 @@ static char master_socket[FN_REFLEN]= "./var/tmp/master.sock"; static char slave_socket[FN_REFLEN]= "./var/tmp/slave.sock"; #endif +#define MAX_COUNT_TESTES 1024 /* comma delimited list of tests to skip or empty string */ #ifndef __WIN__ static char skip_test[FN_REFLEN]= " lowercase_table3 , system_mysql_db_fix "; +#define _stricmp strcasecmp #else /* The most ignore testes contain the calls of system command -*/ -#define MAX_COUNT_TESTES 1024 -/* + lowercase_table3 is disabled by Gerg system_mysql_db_fix is disabled by Gerg sp contains a command system @@ -1437,12 +1437,11 @@ void setup(char *file __attribute__((unused))) /* Compare names of testes for right order */ -#ifdef __WIN__ int compare( const void *arg1, const void *arg2 ) { return _stricmp( * ( char** ) arg1, * ( char** ) arg2 ); } -#endif + /****************************************************************************** @@ -1454,6 +1453,10 @@ int compare( const void *arg1, const void *arg2 ) int main(int argc, char **argv) { int is_ignore_list= 0; + char **names= 0; + char **testes= 0; + int name_index; + int index; /* setup */ setup(argv[0]); @@ -1517,6 +1520,9 @@ int main(int argc, char **argv) else { /* run all tests */ + names= malloc(MAX_COUNT_TESTES*4); + testes= names; + name_index= 0; #ifndef __WIN__ struct dirent *entry; DIR *parent; @@ -1536,8 +1542,11 @@ int main(int argc, char **argv) { /* null terminate at the suffix */ *(test + position - 1)= '\0'; - /* run test */ - run_test(test); + /* insert test */ + *names= malloc(FN_REFLEN); + strcpy(*names,test); + names++; + name_index++; } } closedir(parent); @@ -1549,10 +1558,6 @@ int main(int argc, char **argv) char mask[FN_REFLEN]; char *p; int position; - char **names= 0; - char **testes= 0; - int name_index; - int index; /* single test */ single_test= FALSE; @@ -1564,9 +1569,6 @@ int main(int argc, char **argv) die("Unable to open tests directory."); } - names= malloc(MAX_COUNT_TESTES*4); - testes= names; - name_index= 0; do { @@ -1577,10 +1579,8 @@ int main(int argc, char **argv) /* find the test suffix */ if ((position= strinstr(test, TEST_SUFFIX)) != 0) { - p= test + position - 1; /* null terminate at the suffix */ - *p= 0; - + *(test + position - 1)= '\0'; /* insert test */ *names= malloc(FN_REFLEN); strcpy(*names,test); @@ -1591,7 +1591,7 @@ int main(int argc, char **argv) }while (_findnext(handle,&dir) == 0); _findclose(handle); - +#endif qsort( (void *)testes, name_index, sizeof( char * ), compare ); for (index= 0; index <= name_index; index++) @@ -1601,7 +1601,6 @@ int main(int argc, char **argv) } free(testes); -#endif } /* stop server */ From a35a9c985b93bfab556f4d377cf6911a9b027a3d Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 3 Jan 2005 18:50:51 +0400 Subject: [PATCH 0631/1063] Fix for bug #6434 (bad memory deletion in app using libmysqld) We should build libmysqld in SAFEMALLOC mode. VC++Files/libmysqld/libmysqld.dsp: SAFEMALLOC define added to the libmysqld/Debug configuration --- VC++Files/libmysqld/libmysqld.dsp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VC++Files/libmysqld/libmysqld.dsp b/VC++Files/libmysqld/libmysqld.dsp index 820ca30509c..8205461c26f 100644 --- a/VC++Files/libmysqld/libmysqld.dsp +++ b/VC++Files/libmysqld/libmysqld.dsp @@ -73,7 +73,7 @@ LINK32=xilink6.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBMYSQLD_EXPORTS" /YX /FD /GZ /c -# ADD CPP /nologo /MT /W3 /Z7 /Od /I "../include" /I "../libmysqld" /I "../sql" /I "../regex" /I "../bdb/build_win32" /I "../zlib" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "HAVE_BERKELEY_DB" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "HAVE_INNOBASE_DB" /D "USE_TLS" /D "__WIN__" /FD /GZ /c +# ADD CPP /nologo /MT /W3 /Z7 /Od /I "../include" /I "../libmysqld" /I "../sql" /I "../regex" /I "../bdb/build_win32" /I "../zlib" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "SAFEMALLOC" /D "HAVE_BERKELEY_DB" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "HAVE_INNOBASE_DB" /D "USE_TLS" /D "__WIN__" /FD /GZ /c # SUBTRACT CPP /X /Fr # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 From d3be3cbcfdf74f4131e16b201c7eb5dfde0a8257 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 3 Jan 2005 19:21:54 +0400 Subject: [PATCH 0632/1063] fix for bug #5920 (embedded-server mysql doesn't handle --defaults-file) client/mysql.cc: bug #5920 (embedded-server mysql doesn't handle --defaults-file) defaults files handled include/my_sys.h: bug #5920 (embedded-server mysql doesn't handle --defaults-file) get_defaults_file interface added libmysqld/libmysqld.c: just small fix, not related to the bug. mysys/default.c: bug #5920 (embedded-server mysql doesn't handle --defaults-file) get_defaults_files implementation --- client/mysql.cc | 12 +++++++++- include/my_sys.h | 2 ++ libmysqld/libmysqld.c | 3 +++ mysys/default.c | 55 ++++++++++++++++++++++++++++++------------- 4 files changed, 55 insertions(+), 17 deletions(-) diff --git a/client/mysql.cc b/client/mysql.cc index 0ea0f10f5d7..5739d3203e7 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -330,6 +330,16 @@ static sig_handler mysql_end(int sig); int main(int argc,char *argv[]) { char buff[80]; + char *defaults, *extra_defaults; + char *emb_argv[3]; + int emb_argc= 1; + + emb_argv[0]= argv[0]; + get_defaults_files(argc, argv, &defaults, &extra_defaults); + if (defaults) + emb_argv[emb_argc++]= defaults; + if (extra_defaults) + emb_argv[emb_argc++]= extra_defaults; MY_INIT(argv[0]); DBUG_ENTER("main"); @@ -375,7 +385,7 @@ int main(int argc,char *argv[]) my_end(0); exit(1); } - if (mysql_server_init(0, NULL, (char**) server_default_groups)) + if (mysql_server_init(emb_argc, emb_argv, (char**) server_default_groups)) { free_defaults(defaults_argv); my_end(0); diff --git a/include/my_sys.h b/include/my_sys.h index a8e21ea2f98..5e56f0bdc2c 100644 --- a/include/my_sys.h +++ b/include/my_sys.h @@ -738,6 +738,8 @@ extern void reset_root_defaults(MEM_ROOT *mem_root, uint block_size, extern char *strdup_root(MEM_ROOT *root,const char *str); extern char *strmake_root(MEM_ROOT *root,const char *str,uint len); extern char *memdup_root(MEM_ROOT *root,const char *str,uint len); +extern void get_defaults_files(int argc, char **argv, + char **defaults, char **extra_defaults); extern int load_defaults(const char *conf_file, const char **groups, int *argc, char ***argv); extern void free_defaults(char **argv); diff --git a/libmysqld/libmysqld.c b/libmysqld/libmysqld.c index a2c4be1a078..6fa41fb3fd0 100644 --- a/libmysqld/libmysqld.c +++ b/libmysqld/libmysqld.c @@ -143,6 +143,9 @@ mysql_real_connect(MYSQL *mysql,const char *host, const char *user, db ? db : "(Null)", user ? user : "(Null)")); + if (!host || !host[0]) + host= mysql->options.host; + if (mysql->options.methods_to_use == MYSQL_OPT_USE_REMOTE_CONNECTION || (mysql->options.methods_to_use == MYSQL_OPT_GUESS_CONNECTION && host && *host && strcmp(host,LOCAL_HOST))) diff --git a/mysys/default.c b/mysys/default.c index ea23bbb6693..5f554ac36f6 100644 --- a/mysys/default.c +++ b/mysys/default.c @@ -78,6 +78,36 @@ static int search_default_file_with_ext(DYNAMIC_ARRAY *args, MEM_ROOT *alloc, static char *remove_end_comment(char *ptr); +/* + Gets --defaults-file and --defaults-extra-file options from command line. + + SYNOPSIS + get_defaults_files() + argc Pointer to argc of original program + argv Pointer to argv of original program + defaults --defaults-file option + extra_defaults --defaults-extra-file option + + RETURN + defaults and extra_defaults will be set to appropriate items + of argv array, or to NULL if there are no such options +*/ + +void get_defaults_files(int argc, char **argv, + char **defaults, char **extra_defaults) +{ + *defaults=0; + *extra_defaults=0; + if (argc >= 2) + { + if (is_prefix(argv[1],"--defaults-file=")) + *defaults= argv[1]; + else if (is_prefix(argv[1],"--defaults-extra-file=")) + *extra_defaults= argv[1]; + } +} + + /* Read options from configurations files @@ -111,7 +141,7 @@ static char *remove_end_comment(char *ptr); int load_defaults(const char *conf_file, const char **groups, - int *argc, char ***argv) + int *argc, char ***argv) { DYNAMIC_ARRAY args; const char **dirs, *forced_default_file; @@ -143,21 +173,14 @@ int load_defaults(const char *conf_file, const char **groups, DBUG_RETURN(0); } - /* Check if we want to force the use a specific default file */ - forced_default_file=0; - if (*argc >= 2) - { - if (is_prefix(argv[0][1],"--defaults-file=")) - { - forced_default_file=strchr(argv[0][1],'=')+1; - args_used++; - } - else if (is_prefix(argv[0][1],"--defaults-extra-file=")) - { - defaults_extra_file=strchr(argv[0][1],'=')+1; - args_used++; - } - } + get_defaults_files(*argc, *argv, + (char **)&forced_default_file, &defaults_extra_file); + if (forced_default_file) + forced_default_file= strchr(forced_default_file,'=')+1; + if (defaults_extra_file) + defaults_extra_file= strchr(defaults_extra_file,'=')+1; + + args_used+= (forced_default_file ? 1 : 0) + (defaults_extra_file ? 1 : 0); group.count=0; group.name= "defaults"; From c8cfe3d211366b353eaefe47a78817508d3dac9a Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 3 Jan 2005 16:54:08 +0100 Subject: [PATCH 0633/1063] mtr_process.pl: Added missing stop_reap_all() if returns early from function mysql-test-run.pl: Improved output from --script-debug Initial Cygwin support Improved mysqld process termination mysql-test/mysql-test-run.pl: Improved output from --script-debug Initial Cygwin support Improved mysqld process termination mysql-test/lib/mtr_process.pl: Added missing stop_reap_all() if returns early from function --- mysql-test/lib/mtr_process.pl | 384 +++++++++++++++++++--------------- mysql-test/lib/mtr_report.pl | 7 +- mysql-test/mysql-test-run.pl | 56 +++-- 3 files changed, 259 insertions(+), 188 deletions(-) diff --git a/mysql-test/lib/mtr_process.pl b/mysql-test/lib/mtr_process.pl index 2263ef5bc24..8c584802b8e 100644 --- a/mysql-test/lib/mtr_process.pl +++ b/mysql-test/lib/mtr_process.pl @@ -4,13 +4,14 @@ # and is part of the translation of the Bourne shell script with the # same name. +use Carp qw(cluck); use strict; use POSIX ":sys_wait_h"; sub mtr_run ($$$$$$); sub mtr_spawn ($$$$$$); -sub mtr_stop_servers ($); +sub mtr_stop_mysqld_servers ($$); sub mtr_kill_leftovers (); # static in C @@ -77,13 +78,21 @@ sub spawn_impl ($$$$$$$) { if ( $::opt_script_debug ) { - print STDERR "-" x 78, "\n"; - print STDERR "STDIN $input\n" if $input; - print STDERR "STDOUT $output\n" if $output; - print STDERR "STDERR $error\n" if $error; - print STDERR "DAEMON\n" if !$join; - print STDERR "EXEC $path ", join(" ",@$arg_list_t), "\n"; - print STDERR "-" x 78, "\n"; + print STDERR "\n"; + print STDERR "#### ", "-" x 78, "\n"; + print STDERR "#### ", "STDIN $input\n" if $input; + print STDERR "#### ", "STDOUT $output\n" if $output; + print STDERR "#### ", "STDERR $error\n" if $error; + if ( $join ) + { + print STDERR "#### ", "run"; + } + else + { + print STDERR "#### ", "spawn"; + } + print STDERR "$path ", join(" ",@$arg_list_t), "\n"; + print STDERR "#### ", "-" x 78, "\n"; } my $pid= fork(); @@ -101,11 +110,11 @@ sub spawn_impl ($$$$$$$) { my $dumped_core= $? & 128; if ( $signal_num ) { - die("spawn got signal $signal_num"); + mtr_error("spawn got signal $signal_num"); } if ( $dumped_core ) { - die("spawn dumped core"); + mtr_error("spawn dumped core"); } return $exit_value; } @@ -127,22 +136,34 @@ sub spawn_impl ($$$$$$$) { if ( $output ) { - open(STDOUT,">",$output) or die "Can't redirect STDOUT to \"$output\": $!"; + if ( ! open(STDOUT,">",$output) ) + { + mtr_error("can't redirect STDOUT to \"$output\": $!"); + } } if ( $error ) { if ( $output eq $error ) { - open(STDERR,">&STDOUT") or die "Can't dup STDOUT: $!"; + if ( ! open(STDERR,">&STDOUT") ) + { + mtr_error("can't dup STDOUT: $!"); + } } else { - open(STDERR,">",$error) or die "Can't redirect STDERR to \"$output\": $!"; + if ( ! open(STDERR,">",$error) ) + { + mtr_error("can't redirect STDERR to \"$output\": $!"); + } } } if ( $input ) { - open(STDIN,"<",$input) or die "Can't redirect STDIN to \"$input\": $!"; + if ( ! open(STDIN,"<",$input) ) + { + mtr_error("can't redirect STDIN to \"$input\": $!"); + } } exec($path,@$arg_list_t); } @@ -163,27 +184,25 @@ sub mtr_kill_leftovers () { for ( my $idx; $idx < 2; $idx++ ) { -# if ( $::master->[$idx]->{'pid'} ) -# { - push(@args, - $::master->[$idx]->{'path_mypid'}, - $::master->[$idx]->{'path_mysock'}, - ); -# } + push(@args,{ + pid => 0, # We don't know the PID + pidfile => $::master->[$idx]->{'path_mypid'}, + sockfile => $::master->[$idx]->{'path_mysock'}, + port => $::master->[$idx]->{'path_myport'}, + }); } for ( my $idx; $idx < 3; $idx++ ) { -# if ( $::slave->[$idx]->{'pid'} ) -# { - push(@args, - $::slave->[$idx]->{'path_mypid'}, - $::slave->[$idx]->{'path_mysock'}, - ); -# } + push(@args,{ + pid => 0, # We don't know the PID + pidfile => $::slave->[$idx]->{'path_mypid'}, + sockfile => $::slave->[$idx]->{'path_mysock'}, + port => $::slave->[$idx]->{'path_myport'}, + }); } - mtr_stop_servers(\@args); + mtr_stop_mysqld_servers(\@args, 1); # We scan the "var/run/" directory for other process id's to kill my $rundir= "$::glob_mysql_test_dir/var/run"; # FIXME $path_run_dir or something @@ -211,17 +230,29 @@ sub mtr_kill_leftovers () { } closedir(RUNDIR); - my $retries= 10; # 10 seconds - do - { - kill(9, @pids); - } while ( $retries-- and kill(0, @pids) ); + start_reap_all(); - if ( kill(0, @pids) ) + if ( $::glob_cygwin_perl ) { - mtr_error("can't kill processes " . join(" ", @pids)); + # We have no (easy) way of knowing the Cygwin controlling + # process, in the PID file we only have the Windows process id. + system("kill -f " . join(" ",@pids)); # Hope for the best.... + } + else + { + my $retries= 10; # 10 seconds + do + { + kill(9, @pids); + } while ( $retries-- and kill(0, @pids) ); + + if ( kill(0, @pids) ) + { + mtr_error("can't kill processes " . join(" ", @pids)); + } } + stop_reap_all(); } } @@ -237,185 +268,200 @@ sub mtr_kill_leftovers () { # This is not perfect, there could still be other server processes # left. -sub mtr_stop_servers ($) { - my $spec= shift; +# Force flag is to be set only for killing mysqld servers this script +# didn't create in this run, i.e. initial cleanup before we start working. +# If force flag is set, we try to kill all with mysqladmin, and +# give up if we have no PIDs. +# FIXME On some operating systems, $srv->{'pid'} and $srv->{'pidfile'} +# will not be the same PID. We need to try to kill both I think. + +sub mtr_stop_mysqld_servers ($$) { + my $spec= shift; + my $force= shift; + + # ---------------------------------------------------------------------- + # If the process was not started from this file, we got no PID, + # we try to find it in the PID file. + # ---------------------------------------------------------------------- + + my $any_pid= 0; # If we have any PIDs + + foreach my $srv ( @$spec ) + { + if ( ! $srv->{'pid'} and -f $srv->{'pidfile'} ) + { + $srv->{'pid'}= mtr_get_pid_from_file($srv->{'pidfile'}); + } + if ( $srv->{'pid'} ) + { + $any_pid= 1; + } + } + + # If the processes where started from this script, and we know + # no PIDs, then we don't have to do anything. + + if ( ! $any_pid and ! $force ) + { + # cluck "This is how we got here!"; + return; + } + + # ---------------------------------------------------------------------- # First try nice normal shutdown using 'mysqladmin' + # ---------------------------------------------------------------------- + start_reap_all(); # Don't require waitpid() of children + + foreach my $srv ( @$spec ) { - my @args= @$spec; - while ( @args ) + if ( -e $srv->{'sockfile'} or $srv->{'port'} ) { - my $pidfile= shift @args; # FIXME not used here.... - my $sockfile= shift @args; + # FIXME wrong log..... + # FIXME, stderr..... + # Shutdown time must be high as slave may be in reconnect + my $args; - if ( -f $sockfile ) + mtr_init_args(\$args); + + mtr_add_arg($args, "--no-defaults"); + mtr_add_arg($args, "-uroot"); + if ( -e $srv->{'sockfile'} ) { - - # FIXME wrong log..... - # FIXME, stderr..... - # Shutdown time must be high as slave may be in reconnect - my $opts= - [ - "--no-defaults", - "-uroot", - "--socket=$sockfile", - "--connect_timeout=5", - "--shutdown_timeout=70", - "shutdown", - ]; - # We don't wait for termination of mysqladmin - mtr_spawn($::exe_mysqladmin, $opts, - "", $::path_manager_log, $::path_manager_log, ""); + mtr_add_arg($args, "--socket=%s", $srv->{'sockfile'}); } + if ( $srv->{'port'} ) + { + mtr_add_arg($args, "--port=%s", $srv->{'port'}); + } + mtr_add_arg($args, "--connect_timeout=5"); + mtr_add_arg($args, "--shutdown_timeout=70"); + mtr_add_arg($args, "shutdown"); + # We don't wait for termination of mysqladmin + mtr_spawn($::exe_mysqladmin, $args, + "", $::path_manager_log, $::path_manager_log, ""); } } - # Wait for them all to remove their socket file + # Wait for them all to remove their pid and socket file - SOCKREMOVED: + PIDSOCKFILEREMOVED: for (my $loop= $::opt_sleep_time_for_delete; $loop; $loop--) { - my $sockfiles_left= 0; - my @args= @$spec; - while ( @args ) + my $pidsockfiles_left= 0; + foreach my $srv ( @$spec ) { - my $pidfile= shift @args; - my $sockfile= shift @args; - if ( -f $sockfile or -f $pidfile ) + if ( -e $srv->{'sockfile'} or -f $srv->{'pidfile'} ) { - $sockfiles_left++; # Could be that pidfile is left + $pidsockfiles_left++; # Could be that pidfile is left } } - if ( ! $sockfiles_left ) + if ( ! $pidsockfiles_left ) { - last SOCKREMOVED; - } - if ( $loop > 1 ) - { - sleep(1); # One second + last PIDSOCKFILEREMOVED; } + mtr_debug("Sleep for 1 second waiting for pid and socket file removal"); + sleep(1); # One second } + # ---------------------------------------------------------------------- + # If no known PIDs, we have nothing more to try + # ---------------------------------------------------------------------- + + if ( ! $any_pid ) + { + stop_reap_all(); + return; + } + + # ---------------------------------------------------------------------- # We may have killed all that left a socket, but we are not sure we got - # them all killed. We now check the PID file, if any - - # Try nice kill with SIG_TERM + # them all killed. If we suspect it lives, try nice kill with SIG_TERM. + # Note that for true Win32 processes, kill(0,$pid) will not return 1. + # ---------------------------------------------------------------------- + SIGNAL: + foreach my $sig (15,9) { - my @args= @$spec; - while ( @args ) + my $process_left= 0; + foreach my $srv ( @$spec ) { - my $pidfile= shift @args; - my $sockfile= shift @args; - if (-f $pidfile) + if ( $srv->{'pid'} and + ( -f $srv->{'pidfile'} or kill(0,$srv->{'pid'}) ) ) { - my $pid= mtr_get_pid_from_file($pidfile); - mtr_warning("process $pid not cooperating with mysqladmin, " . - "will send TERM signal to process"); - kill(15,$pid); # SIG_TERM + $process_left++; + mtr_warning("process $srv->{'pid'} not cooperating, " . + "will send signal $sig to process"); + kill($sig,$srv->{'pid'}); # SIG_TERM + } + if ( ! $process_left ) + { + last SIGNAL; } } + mtr_debug("Sleep for 5 seconds waiting for processes to die"); + sleep(5); # We wait longer than usual } - # Wait for them all to die - - for (my $loop= $::opt_sleep_time_for_delete; $loop; $loop--) - { - my $pidfiles_left= 0; - my @args= @$spec; - while ( @args ) - { - my $pidfile= shift @args; - my $sockfile= shift @args; - if ( -f $pidfile ) - { - $pidfiles_left++; - } - } - if ( ! $pidfiles_left ) - { - return; - } - if ( $loop > 1 ) - { - sleep(1); # One second - } - } - - # Try hard kill with SIG_KILL + # ---------------------------------------------------------------------- + # Now, we check if all we can find using kill(0,$pid) are dead, + # and just assume the rest are. We cleanup socket and PID files. + # ---------------------------------------------------------------------- { - my @args= @$spec; - while ( @args ) + my $errors= 0; + foreach my $srv ( @$spec ) { - my $pidfile= shift @args; - my $sockfile= shift @args; - if (-f $pidfile) + if ( $srv->{'pid'} ) { - my $pid= mtr_get_pid_from_file($pidfile); - mtr_warning("$pid did not die from TERM signal, ", - "will send KILL signal to process"); - kill(9,$pid); - } - } - } - - # We check with Perl "kill 0" if process still exists - - PIDFILES: - for (my $loop= $::opt_sleep_time_for_delete; $loop; $loop--) - { - my $not_terminated= 0; - my @args= @$spec; - while ( @args ) - { - my $pidfile= shift @args; - my $sockfile= shift @args; - if (-f $pidfile) - { - my $pid= mtr_get_pid_from_file($pidfile); - if ( ! kill(0,$pid) ) + if ( kill(0,$srv->{'pid'}) ) { - $not_terminated++; - mtr_warning("could't kill $pid"); + # FIXME In Cygwin there seem to be some fast reuse + # of PIDs, so dying may not be the right thing to do. + $errors++; + mtr_warning("can't kill process $srv->{'pid'}"); + } + else + { + # We managed to kill it at last + # FIXME In Cygwin, we will get here even if the process lives. + + # Not needed as we know the process is dead, but to be safe + # we unlink and check success in two steps. We first unlink + # without checking the error code, and then check if the + # file still exists. + + foreach my $file ($srv->{'pidfile'}, $srv->{'sockfile'}) + { + unlink($file); + if ( -e $file ) + { + $errors++; + mtr_warning("couldn't delete $file"); + } + } } } } - if ( ! $not_terminated ) + if ( $errors ) { - last PIDFILES; - } - if ( $loop > 1 ) - { - sleep(1); # One second + # We are in trouble, just die.... + mtr_error("we could not kill or clean up all processes"); } } - { - my $pidfiles_left= 0; - my @args= @$spec; - while ( @args ) - { - my $pidfile= shift @args; - my $sockfile= shift @args; - if ( -f $pidfile ) - { - if ( ! unlink($pidfile) ) - { - $pidfiles_left++; - mtr_warning("could't delete $pidfile"); - } - } - } - if ( $pidfiles_left ) - { - mtr_error("one or more pid files could not be deleted"); - } - } + stop_reap_all(); # FIXME We just assume they are all dead, we don't know.... } +sub start_reap_all { + $SIG{CHLD}= 'IGNORE'; # FIXME is this enough? +} + +sub stop_reap_all { + $SIG{CHLD}= 'DEFAULT'; +} 1; diff --git a/mysql-test/lib/mtr_report.pl b/mysql-test/lib/mtr_report.pl index 350cd993f19..0f75fc1341a 100644 --- a/mysql-test/lib/mtr_report.pl +++ b/mysql-test/lib/mtr_report.pl @@ -14,6 +14,7 @@ sub mtr_report_test_skipped($); sub mtr_show_failed_diff ($); sub mtr_report_stats ($); sub mtr_print_line (); +sub mtr_print_thick_line (); sub mtr_print_header (); sub mtr_report (@); sub mtr_warning (@); @@ -214,6 +215,10 @@ sub mtr_print_line () { print '-' x 55, "\n"; } +sub mtr_print_thick_line () { + print '=' x 55, "\n"; +} + sub mtr_print_header () { print "\n"; if ( $::opt_timer ) @@ -250,7 +255,7 @@ sub mtr_error (@) { sub mtr_debug (@) { if ( $::opt_script_debug ) { - print "mysql-test-run: DEBUG: ",join(" ", @_),"\n"; + print STDERR "####: ",join(" ", @_),"\n"; } } diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 5565d29fb7b..01729aa1018 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -67,6 +67,11 @@ # is to use the Devel::Trace package found at # "http://www.plover.com/~mjd/perl/Trace/" and run this script like # "perl -d:Trace mysql-test-run.pl" +# +# FIXME Save a PID file from this code as well, to record the process +# id we think it has. In Cygwin, a fork creates one Cygwin process, +# and then the real Win32 process. Cygwin Perl can only kill Cygwin +# processes. And "mysqld --bootstrap ..." doesn't save a PID file. $Devel::Trace::TRACE= 0; # Don't trace boring init stuff @@ -147,7 +152,9 @@ our @mysqld_src_dirs= # Misc global variables -our $glob_win32= 0; +our $glob_win32= 0; # OS and native Win32 executables +our $glob_win32_perl= 0; # ActiveState Win32 Perl +our $glob_cygwin_perl= 0; # Cygwin Perl our $glob_mysql_test_dir= undef; our $glob_mysql_bench_dir= undef; our $glob_hostname= undef; @@ -383,7 +390,9 @@ sub initial_setup () { $glob_scriptname= basename($0); - $glob_win32= ($^O eq "MSWin32"); + $glob_win32_perl= ($^O eq "MSWin32"); + $glob_cygwin_perl= ($^O eq "cygwin"); + $glob_win32= ($glob_win32_perl or $glob_cygwin_perl); # We require that we are in the "mysql-test" directory # to run mysql-test-run @@ -404,6 +413,12 @@ sub initial_setup () { # 'basedir' is always parent of "mysql-test" directory $glob_mysql_test_dir= cwd(); + if ( $glob_cygwin_perl ) + { + # Windows programs like 'mysqld' needs Windows paths + $glob_mysql_test_dir= `cygpath -m $glob_mysql_test_dir`; + chomp($glob_mysql_test_dir); + } $glob_basedir= dirname($glob_mysql_test_dir); $glob_mysql_bench_dir= "$glob_basedir/mysql-bench"; # FIXME make configurable @@ -991,7 +1006,7 @@ sub collect_test_cases ($) { if ( -f $master_sh ) { - if ( $glob_win32 ) + if ( $glob_win32_perl ) { $tinfo->{'skip'}= 1; } @@ -1004,7 +1019,7 @@ sub collect_test_cases ($) { if ( -f $slave_sh ) { - if ( $glob_win32 ) + if ( $glob_win32_perl ) { $tinfo->{'skip'}= 1; } @@ -1115,6 +1130,7 @@ sub sleep_until_file_created ($$) { { return; } + mtr_debug("Sleep for 1 second waiting for creation of $pidfile"); sleep(1); } @@ -1396,6 +1412,8 @@ sub run_testcase ($) { # the preparation. # ---------------------------------------------------------------------- + mtr_report_test_name($tinfo); + mtr_tofile($master->[0]->{'path_myerr'},"CURRENT_TEST: $tname\n"); do_before_start_master($tname,$tinfo->{'master_sh'}); @@ -1403,8 +1421,6 @@ sub run_testcase ($) { # Start masters # ---------------------------------------------------------------------- - mtr_report_test_name($tinfo); - if ( ! $glob_use_running_server and ! $glob_use_embedded_server ) { # FIXME give the args to the embedded server?! @@ -1914,15 +1930,17 @@ sub stop_masters () { # the mysqld process from being killed if ( $master->[$idx]->{'pid'} ) { - push(@args, - $master->[$idx]->{'path_mypid'}, - $master->[$idx]->{'path_mysock'}, - ); - $master->[$idx]->{'pid'}= 0; + push(@args,{ + pid => $master->[$idx]->{'pid'}, + pidfile => $master->[$idx]->{'path_mypid'}, + sockfile => $master->[$idx]->{'path_mysock'}, + port => $master->[$idx]->{'path_myport'}, + }); + $master->[$idx]->{'pid'}= 0; # Assume we are done with it } } - mtr_stop_servers(\@args); + mtr_stop_mysqld_servers(\@args, 0); } sub stop_slaves () { @@ -1934,15 +1952,17 @@ sub stop_slaves () { { if ( $slave->[$idx]->{'pid'} ) { - push(@args, - $slave->[$idx]->{'path_mypid'}, - $slave->[$idx]->{'path_mysock'}, - ); - $slave->[$idx]->{'pid'}= 0; + push(@args,{ + pid => $slave->[$idx]->{'pid'}, + pidfile => $slave->[$idx]->{'path_mypid'}, + sockfile => $slave->[$idx]->{'path_mysock'}, + port => $slave->[$idx]->{'path_myport'}, + }); + $slave->[$idx]->{'pid'}= 0; # Assume we are done with it } } - mtr_stop_servers(\@args); + mtr_stop_mysqld_servers(\@args, 0); } From e197fa459d331be2027aa7ce8e4bf61a9da4f4f7 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 3 Jan 2005 19:39:09 +0100 Subject: [PATCH 0634/1063] bug#7626 - ndb UintPtr handling ndb/include/ndb_types.h: redo UintPtr handling --- ndb/include/ndb_types.h | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/ndb/include/ndb_types.h b/ndb/include/ndb_types.h index 0d603cc2ab3..1284ace3bbc 100644 --- a/ndb/include/ndb_types.h +++ b/ndb/include/ndb_types.h @@ -30,31 +30,22 @@ typedef unsigned int Uint32; typedef unsigned int UintR; -#ifdef __SIZE_TYPE__ -typedef __SIZE_TYPE__ UintPtr; -#else -#include -#ifdef HAVE_STDINT_H -#include -#endif -#ifdef HAVE_INTTYPES_H -#include -#endif -#if defined(WIN32) || defined(NDB_WIN32) -typedef Uint32 UintPtr; -#else -typedef uintptr_t UintPtr; -#endif -#endif - #if defined(WIN32) || defined(NDB_WIN32) typedef unsigned __int64 Uint64; typedef signed __int64 Int64; -typedef UintPtr ssize_t; #else typedef unsigned long long Uint64; typedef signed long long Int64; #endif +#ifdef __SIZE_TYPE__ +typedef __SIZE_TYPE__ UintPtr; +#else +#if SIZEOF_CHARP == 4 +typedef Uint32 UintPtr; +#else +typedef Uint64 UintPtr; +#endif +#endif #endif From 9ecd9ac6b984f999b89a62fae782e1d6f277495a Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 3 Jan 2005 20:10:23 +0100 Subject: [PATCH 0635/1063] bug#7626 - post review version ndb/include/ndb_global.h.in: move types into ndb_global.h.in Check sizeof of Uint8, Uint32 & Uint64 ndb/include/ndb_types.h: move types into ndb_global.h.in --- ndb/include/ndb_global.h.in | 36 ++++++++++++++++++++++++++++++++++++ ndb/include/ndb_types.h | 27 +-------------------------- 2 files changed, 37 insertions(+), 26 deletions(-) diff --git a/ndb/include/ndb_global.h.in b/ndb/include/ndb_global.h.in index aefb319730c..cadbb8cabf2 100644 --- a/ndb/include/ndb_global.h.in +++ b/ndb/include/ndb_global.h.in @@ -16,12 +16,48 @@ #define HAVE_STRCASECMP #define strcasecmp _strcmpi #pragma warning(disable: 4503 4786) +typedef unsigned __int64 Uint64; +typedef signed __int64 Int64; #else #undef NDB_WIN32 #define DIR_SEPARATOR "/" +typedef unsigned long long Uint64; +typedef signed long long Int64; #endif #include + +typedef signed char Int8; +typedef unsigned char Uint8; +typedef signed short Int16; +typedef unsigned short Uint16; +typedef signed int Int32; +typedef unsigned int Uint32; + +typedef unsigned int UintR; + +#ifdef __SIZE_TYPE__ +typedef __SIZE_TYPE__ UintPtr; +#elif SIZEOF_CHARP == 4 +typedef Uint32 UintPtr; +#elif SIZEOF_CHARP == 8 +typedef Uint64 UintPtr; +#else +#error "Unknown size of (char *)" +#endif + +#if ! (SIZEOF_CHAR == 1) +#error "Invalid define for Uint8" +#endif + +#if ! (SIZEOF_INT == 4) +#error "Invalid define for Uint32" +#endif + +#if ! (SIZEOF_LONG_LONG == 8) +#error "Invalid define for Uint64" +#endif + #include #ifdef _AIX diff --git a/ndb/include/ndb_types.h b/ndb/include/ndb_types.h index 1284ace3bbc..6cf9bb40d7f 100644 --- a/ndb/include/ndb_types.h +++ b/ndb/include/ndb_types.h @@ -21,31 +21,6 @@ #ifndef NDB_TYPES_H #define NDB_TYPES_H -typedef signed char Int8; -typedef unsigned char Uint8; -typedef signed short Int16; -typedef unsigned short Uint16; -typedef signed int Int32; -typedef unsigned int Uint32; - -typedef unsigned int UintR; - -#if defined(WIN32) || defined(NDB_WIN32) -typedef unsigned __int64 Uint64; -typedef signed __int64 Int64; -#else -typedef unsigned long long Uint64; -typedef signed long long Int64; -#endif - -#ifdef __SIZE_TYPE__ -typedef __SIZE_TYPE__ UintPtr; -#else -#if SIZEOF_CHARP == 4 -typedef Uint32 UintPtr; -#else -typedef Uint64 UintPtr; -#endif -#endif +#include "ndb_global.h" #endif From dcc3c7c3639ec04d736def54d48bd96911c9874d Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 3 Jan 2005 20:48:49 +0100 Subject: [PATCH 0636/1063] Fixed a typo. --- mysys/mf_keycaches.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysys/mf_keycaches.c b/mysys/mf_keycaches.c index 8bf203e249f..fee3096de52 100644 --- a/mysys/mf_keycaches.c +++ b/mysys/mf_keycaches.c @@ -235,7 +235,7 @@ static my_bool safe_hash_set(SAFE_HASH *hash, const byte *key, uint length, if (my_hash_insert(&hash->hash, (byte*) entry)) { /* This can only happen if hash got out of memory */ - my_delete((char*) entry, MYF(0)); + my_free((char*) entry, MYF(0)); error= 1; goto end; } From 82e5d5ef952226203e6edee4ae7cab1d632aeeab Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 3 Jan 2005 22:00:32 +0200 Subject: [PATCH 0637/1063] added ndb/include/ndb_global.h ndb/include/ndb_version.h to ignore BitKeeper/etc/ignore: added ndb/include/ndb_global.h ndb/include/ndb_version.h --- .bzrignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.bzrignore b/.bzrignore index ee48342fd37..8354f398d9a 100644 --- a/.bzrignore +++ b/.bzrignore @@ -948,3 +948,5 @@ client/mysqladmin.c mysql-4.1.8-win-src.zip ndb/include/ndb_version.h ndb/include/ndb_global.h +ndb/include/ndb_global.h +ndb/include/ndb_version.h From 7b7216e1f40c2c68378b35a9a4f0ae28bd60228d Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 3 Jan 2005 21:28:14 +0100 Subject: [PATCH 0638/1063] - Updated Bootstrap to include merge ChangeSets in the source distribution's ChangeLog, too (to be more exact when tagging a release that's based on a merge ChangeSet) Build-tools/Bootstrap: - include merge ChangeSets into the ChangeLog, too (to be more exact when tagging a release that's based on a merge ChangeSet) --- Build-tools/Bootstrap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Build-tools/Bootstrap b/Build-tools/Bootstrap index fc36c51ec85..10211dbb59c 100755 --- a/Build-tools/Bootstrap +++ b/Build-tools/Bootstrap @@ -252,7 +252,7 @@ if (defined $opt_changelog) $msg= "Adding $target_dir/ChangeLog"; $msg.= " (down to revision $opt_changelog)" if $opt_changelog ne ""; &logger($msg); - $command= "bk changes -mv"; + $command= "bk changes -v"; $command.= " -r" if ($opt_changelog ne "" || $opt_revision); $command.= $opt_changelog if $opt_changelog ne ""; $command.= ".." if ($opt_changelog ne "" && !$opt_revision); From b709bb0df8331cb4fee21209d3691d4a5e771349 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 3 Jan 2005 23:02:26 +0100 Subject: [PATCH 0639/1063] Fix typo in crash-me 'MATCHES' test (Bug # 5875) sql-bench/crash-me.sh: Fix typo --- sql-bench/crash-me.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql-bench/crash-me.sh b/sql-bench/crash-me.sh index 8ec62442b11..a40ef8fbc7d 100644 --- a/sql-bench/crash-me.sh +++ b/sql-bench/crash-me.sh @@ -1039,7 +1039,7 @@ try_and_report("Automatic row id", "automatic_rowid", ["MATCH UNIQUE","match_unique", "1 match unique (select a from crash_me)",1,0], ["MATCH","match","1 match (select a from crash_me)",1,0], - ["MATCHES","matches","b matcjhes 'a*'",1,0], + ["MATCHES","matches","b matches 'a*'",1,0], ["NOT BETWEEN","not_between","7 not between 4 and 6",1,0], ["NOT EXISTS","not_exists", "not exists (select * from crash_me where a = 2)",1,0], From 33aa4e381b60c2bf209a345f55e598fe6819f9aa Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 4 Jan 2005 01:49:29 +0100 Subject: [PATCH 0640/1063] Use 'ps xaww' in mysqld_safe (on Linux) so whole command-line is searched for port and/or pid-file parameters. (Bug #5878) scripts/mysqld_safe.sh: Change 'ps xa' to 'ps xaww' so whole command-line is examined --- scripts/mysqld_safe.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index 1f4d17f8885..270c08679eb 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -322,13 +322,13 @@ do # but should work for the rest of the servers. # The only thing is ps x => redhat 5 gives warnings when using ps -x. # kill -9 is used or the process won't react on the kill. - numofproces=`ps xa | grep -v "grep" | grep "$ledir/$MYSQLD\>" | grep -c "pid-file=$pid_file"` + numofproces=`ps xaww | grep -v "grep" | grep "$ledir/$MYSQLD\>" | grep -c "pid-file=$pid_file"` echo -e "\nNumber of processes running now: $numofproces" | tee -a $err_log I=1 while test "$I" -le "$numofproces" do - PROC=`ps xa | grep "$ledir/$MYSQLD\>" | grep -v "grep" | grep "pid-file=$pid_file" | sed -n '$p'` + PROC=`ps xaww | grep "$ledir/$MYSQLD\>" | grep -v "grep" | grep "pid-file=$pid_file" | sed -n '$p'` for T in $PROC do From 8ffe8ab3028b5f6f601a257169218c077397b947 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 4 Jan 2005 02:45:01 +0100 Subject: [PATCH 0641/1063] Make query_cache_wlock_invalidate visible in SHOW VARIABLES (Bug #7594) sql/set_var.cc: Make query_cache_wlock_invalidate visible in SHOW VARIABLES --- sql/set_var.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sql/set_var.cc b/sql/set_var.cc index d5aadbfbdab..122daa0ea95 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -593,6 +593,8 @@ struct show_var_st init_vars[]= { {sys_query_cache_limit.name,(char*) &sys_query_cache_limit, SHOW_SYS}, {sys_query_cache_size.name, (char*) &sys_query_cache_size, SHOW_SYS}, {sys_query_cache_type.name, (char*) &sys_query_cache_type, SHOW_SYS}, + {sys_query_cache_wlock_invalidate.name, + (char*) &sys_query_cache_wlock_invalidate, SHOW_SYS}, #endif /* HAVE_QUERY_CACHE */ {sys_query_prealloc_size.name, (char*) &sys_query_prealloc_size, SHOW_SYS}, {sys_range_alloc_block_size.name, (char*) &sys_range_alloc_block_size, From 54d86c873689715b1e3199af28dcac384a310464 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 4 Jan 2005 10:32:42 -0600 Subject: [PATCH 0642/1063] client.c: Make multi-statements the preferred option name (to coincide with the renaming of the CLIENT_MULTI_RESULTS symbol to CLIENT_MULTI_STATEMENTS). Continue to allow multi-queries for backward compatibility. sql-common/client.c: Make multi-statements the preferred option name (to coincide with the renaming of the CLIENT_MULTI_RESULTS symbol to CLIENT_MULTI_STATEMENTS). Continue to allow multi-queries for backward compatibility. --- sql-common/client.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sql-common/client.c b/sql-common/client.c index 87a781e0a0d..b6813ee4cfc 100644 --- a/sql-common/client.c +++ b/sql-common/client.c @@ -882,7 +882,7 @@ static const char *default_options[]= "connect-timeout", "local-infile", "disable-local-infile", "replication-probe", "enable-reads-from-master", "repl-parse-query", "ssl-cipher", "max-allowed-packet", "protocol", "shared-memory-base-name", - "multi-results", "multi-queries", "secure-auth", + "multi-results", "multi-statements", "multi-queries", "secure-auth", NullS }; @@ -1088,9 +1088,10 @@ void mysql_read_default_options(struct st_mysql_options *options, options->client_flag|= CLIENT_MULTI_RESULTS; break; case 31: + case 32: options->client_flag|= CLIENT_MULTI_STATEMENTS | CLIENT_MULTI_RESULTS; break; - case 32: /* secure-auth */ + case 33: /* secure-auth */ options->secure_auth= TRUE; break; default: From b2dcf8f4888feeaa41e214d1566c2973f2319509 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 4 Jan 2005 23:07:29 +0100 Subject: [PATCH 0643/1063] mysql_test_run_new.dsp: Link mysql_test_run_new as console application my_manage.c: The type intptr_t isn't defined for VC 6.0 Changed return type for CreateProcess() to bool mysql_test_run_new.c: The type intptr_t isn't defined for VC 6.0 mysqltest.dsp: Added regex to additional build types for mysqltest mysqldump.dsp: Added mysys.lib for linking mysqldump VC++Files/client/mysqldump.dsp: Added mysys.lib for linking mysqldump VC++Files/client/mysqltest.dsp: Added regex to additional build types for mysqltest mysql-test/mysql_test_run_new.c: The type intptr_t isn't defined for VC 6.0 mysql-test/my_manage.c: The type intptr_t isn't defined for VC 6.0 Changed return type for CreateProcess() to bool VC++Files/mysql-test/mysql_test_run_new.dsp: Link mysql_test_run_new as console application --- VC++Files/client/mysqldump.dsp | 12 ++++++------ VC++Files/client/mysqltest.dsp | 16 ++++++++-------- VC++Files/mysql-test/mysql_test_run_new.dsp | 4 ++-- mysql-test/my_manage.c | 10 +++++++++- mysql-test/mysql_test_run_new.c | 7 ++++++- 5 files changed, 31 insertions(+), 18 deletions(-) diff --git a/VC++Files/client/mysqldump.dsp b/VC++Files/client/mysqldump.dsp index a1ebdfe11a6..3c955639596 100644 --- a/VC++Files/client/mysqldump.dsp +++ b/VC++Files/client/mysqldump.dsp @@ -51,8 +51,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=xilink6.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"../client_release/mysqldump.exe" /libpath:"..\lib_release\\" +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib mysys.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib mysys.lib /nologo /subsystem:console /machine:I386 /out:"../client_release/mysqldump.exe" /libpath:"..\lib_release\\" !ELSEIF "$(CFG)" == "mysqldump - Win32 Debug" @@ -76,8 +76,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=xilink6.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../client_debug/mysqldump.exe" /pdbtype:sept /libpath:"..\lib_debug\\" +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib mysys.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib mysys.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../client_debug/mysqldump.exe" /pdbtype:sept /libpath:"..\lib_debug\\" !ELSEIF "$(CFG)" == "mysqldump - Win32 classic" @@ -103,8 +103,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=xilink6.exe -# ADD BASE LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"../client_release/mysqldump.exe" /libpath:"..\lib_release\\" -# ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"../client_classic/mysqldump.exe" /libpath:"..\lib_release\\" +# ADD BASE LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib mysys.lib /nologo /subsystem:console /machine:I386 /out:"../client_release/mysqldump.exe" /libpath:"..\lib_release\\" +# ADD LINK32 mysqlclient.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib mysys.lib /nologo /subsystem:console /machine:I386 /out:"../client_classic/mysqldump.exe" /libpath:"..\lib_release\\" !ENDIF diff --git a/VC++Files/client/mysqltest.dsp b/VC++Files/client/mysqltest.dsp index 1f1613026a9..d04dc5bfce8 100644 --- a/VC++Files/client/mysqltest.dsp +++ b/VC++Files/client/mysqltest.dsp @@ -67,8 +67,8 @@ LINK32=link.exe # PROP Output_Dir ".\classic" # PROP Intermediate_Dir ".\classic" # PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /I "../include" /I "../" /W3 /Ob1 /G6 /D "_CONSOLE" /D "_WINDOWS" /D "LICENSE=Commercial" /D "DBUG_OFF" /D "NDEBUG" /D "_MBCS" /GF /Gy /Fp".\classic/mysqltest.pch" /Fo".\classic/" /Fd".\classic/" /c /GX -# ADD CPP /nologo /MT /I "../include" /I "../" /W3 /Ob1 /G6 /D "_CONSOLE" /D "_WINDOWS" /D "LICENSE=Commercial" /D "DBUG_OFF" /D "NDEBUG" /D "_MBCS" /GF /Gy /Fp".\classic/mysqltest.pch" /Fo".\classic/" /Fd".\classic/" /c /GX +# ADD BASE CPP /nologo /MT /I "../include" /I "../regex" /I "../" /W3 /Ob1 /G6 /D "_CONSOLE" /D "_WINDOWS" /D "LICENSE=Commercial" /D "DBUG_OFF" /D "NDEBUG" /D "_MBCS" /GF /Gy /Fp".\classic/mysqltest.pch" /Fo".\classic/" /Fd".\classic/" /c /GX +# ADD CPP /nologo /MT /I "../include" /I "../regex" /I "../" /W3 /Ob1 /G6 /D "_CONSOLE" /D "_WINDOWS" /D "LICENSE=Commercial" /D "DBUG_OFF" /D "NDEBUG" /D "_MBCS" /GF /Gy /Fp".\classic/mysqltest.pch" /Fo".\classic/" /Fd".\classic/" /c /GX # ADD BASE MTL /nologo /tlb".\classic\mysqltest.tlb" /win32 # ADD MTL /nologo /tlb".\classic\mysqltest.tlb" /win32 # ADD BASE RSC /l 1033 /d "NDEBUG" @@ -77,8 +77,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib /nologo /out:"..\client_classic\mysqltest.exe" /incremental:no /libpath:"..\lib_release\" /pdb:".\classic\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib /nologo /out:"..\client_classic\mysqltest.exe" /incremental:no /libpath:"..\lib_release\" /pdb:".\classic\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386 +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib mysys.lib regex.lib /nologo /out:"..\client_classic\mysqltest.exe" /incremental:no /libpath:"..\lib_release\" /pdb:".\classic\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib mysys.lib regex.lib /nologo /out:"..\client_classic\mysqltest.exe" /incremental:no /libpath:"..\lib_release\" /pdb:".\classic\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386 !ELSEIF "$(CFG)" == "mysqltest - Win32 Release" @@ -92,8 +92,8 @@ LINK32=link.exe # PROP Output_Dir ".\release" # PROP Intermediate_Dir ".\release" # PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /I "../include" /I "../" /W3 /Ob1 /G6 /D "DBUG_OFF" /D "_CONSOLE" /D "_WINDOWS" /D "NDEBUG" /D "_MBCS" /GF /Gy /Fp".\release/mysqltest.pch" /Fo".\release/" /Fd".\release/" /c /GX -# ADD CPP /nologo /MT /I "../include" /I "../" /W3 /Ob1 /G6 /D "DBUG_OFF" /D "_CONSOLE" /D "_WINDOWS" /D "NDEBUG" /D "_MBCS" /GF /Gy /Fp".\release/mysqltest.pch" /Fo".\release/" /Fd".\release/" /c /GX +# ADD BASE CPP /nologo /MT /I "../include" /I "../regex" /I "../" /W3 /Ob1 /G6 /D "DBUG_OFF" /D "_CONSOLE" /D "_WINDOWS" /D "NDEBUG" /D "_MBCS" /GF /Gy /Fp".\release/mysqltest.pch" /Fo".\release/" /Fd".\release/" /c /GX +# ADD CPP /nologo /MT /I "../include" /I "../regex" /I "../" /W3 /Ob1 /G6 /D "DBUG_OFF" /D "_CONSOLE" /D "_WINDOWS" /D "NDEBUG" /D "_MBCS" /GF /Gy /Fp".\release/mysqltest.pch" /Fo".\release/" /Fd".\release/" /c /GX # ADD BASE MTL /nologo /tlb".\release\mysqltest.tlb" /win32 # ADD MTL /nologo /tlb".\release\mysqltest.tlb" /win32 # ADD BASE RSC /l 1033 /d "NDEBUG" @@ -102,8 +102,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib /nologo /out:"..\client_release\mysqltest.exe" /incremental:no /libpath:"..\lib_release\" /pdb:".\release\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib /nologo /out:"..\client_release\mysqltest.exe" /incremental:no /libpath:"..\lib_release\" /pdb:".\release\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386 +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib mysys.lib regex.lib /nologo /out:"..\client_release\mysqltest.exe" /incremental:no /libpath:"..\lib_release\" /pdb:".\release\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib mysys.lib regex.lib /nologo /out:"..\client_release\mysqltest.exe" /incremental:no /libpath:"..\lib_release\" /pdb:".\release\mysqltest.pdb" /pdbtype:sept /subsystem:console /MACHINE:I386 !ENDIF diff --git a/VC++Files/mysql-test/mysql_test_run_new.dsp b/VC++Files/mysql-test/mysql_test_run_new.dsp index 7e43da20b26..61392b00b94 100644 --- a/VC++Files/mysql-test/mysql_test_run_new.dsp +++ b/VC++Files/mysql-test/mysql_test_run_new.dsp @@ -76,8 +76,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib Ws2_32.lib /nologo /out:"..\mysql-test\mysql_test_run_new.exe" /incremental:no /pdb:".\Release\mysql_test_run_new.pdb" /pdbtype:sept /subsystem:windows -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib Ws2_32.lib /nologo /out:"..\mysql-test\mysql_test_run_new.exe" /incremental:no /pdb:".\Release\mysql_test_run_new.pdb" /pdbtype:sept /subsystem:windows +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib Ws2_32.lib /nologo /out:"..\mysql-test\mysql_test_run_new.exe" /incremental:no /pdb:".\Release\mysql_test_run_new.pdb" /pdbtype:sept /subsystem:console +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib Ws2_32.lib /nologo /out:"..\mysql-test\mysql_test_run_new.exe" /incremental:no /pdb:".\Release\mysql_test_run_new.pdb" /pdbtype:sept /subsystem:console !ENDIF diff --git a/mysql-test/my_manage.c b/mysql-test/my_manage.c index 472b0d32683..1f006f7ab90 100644 --- a/mysql-test/my_manage.c +++ b/mysql-test/my_manage.c @@ -327,7 +327,7 @@ int spawn(char *path, arg_list_t *al, int join, char *input, int spawn(char *path, arg_list_t *al, int join, char *input, char *output, char *error, HANDLE *pid) { - intptr_t result; + bool result; int i; STARTUPINFO startup_info; PROCESS_INFORMATION process_information; @@ -665,7 +665,11 @@ void del_tree(char *dir) rmdir(dir); #else struct _finddata_t parent; +#if defined(_MSC_VER) && _MSC_VER > 1200 intptr_t handle; +#else + long handle; +#endif /* _MSC_VER && _MSC_VER > 1200 */ char temp[FN_REFLEN]; char mask[FN_REFLEN]; @@ -728,7 +732,11 @@ int removef(const char *format, ...) va_list ap; char path[FN_REFLEN]; struct _finddata_t parent; +#if defined(_MSC_VER) && _MSC_VER > 1200 intptr_t handle; +#else + long handle; +#endif /* _MSC_VER && _MSC_VER > 1200 */ char temp[FN_REFLEN]; char *p; diff --git a/mysql-test/mysql_test_run_new.c b/mysql-test/mysql_test_run_new.c index fe13d71c1c2..3ffe7b28296 100644 --- a/mysql-test/mysql_test_run_new.c +++ b/mysql-test/mysql_test_run_new.c @@ -37,7 +37,8 @@ #include #endif #ifdef __WIN__ -#include +#include +#include #include #endif @@ -1544,7 +1545,11 @@ int main(int argc, char **argv) } #else struct _finddata_t dir; +#if defined(_MSC_VER) && _MSC_VER > 1200 intptr_t handle; +#else + long handle; +#endif /* _MSC_VER && _MSC_VER > 1200 */ char test[FN_LEN]; char mask[FN_REFLEN]; char *p; From 284780167d6ad8bcefb087c7c989fdd99992f053 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 5 Jan 2005 01:08:45 +0100 Subject: [PATCH 0644/1063] Change mysqld_safe search for mysqld relative to the current working directory to only look for the mysqld binary (and english error strings) and assume the datadir from that. Then, if that datadir turns out to not exist, startup will fail. This avoids the behavior where mysqld_safe would go off and run a totally different binary because the data directory had been moved (even when --datadir was specified on the command line). (Bug #7249) scripts/mysqld_safe.sh: Don't actually verify that datadir exists when using relatively-located mysqld -- just assume that it does and either let it fail when it doesn't, or do the right thing when datadir is then set via the command line or my.cnf file. --- scripts/mysqld_safe.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index 270c08679eb..f6b0169d230 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -86,7 +86,7 @@ parse_arguments() { MY_PWD=`pwd` # Check if we are starting this relative (for the binary release) -if test -d $MY_PWD/data/mysql -a -f ./share/mysql/english/errmsg.sys -a \ +if test -f ./share/mysql/english/errmsg.sys -a \ -x ./bin/mysqld then MY_BASEDIR_VERSION=$MY_PWD # Where bin, share and data are @@ -97,7 +97,7 @@ then defaults="--defaults-extra-file=$MY_BASEDIR_VERSION/data/my.cnf" fi # Check if this is a 'moved install directory' -elif test -f ./var/mysql/db.frm -a -f ./share/mysql/english/errmsg.sys -a \ +elif test -f ./share/mysql/english/errmsg.sys -a \ -x ./libexec/mysqld then MY_BASEDIR_VERSION=$MY_PWD # Where libexec, share and var are From f89207c2e6cbec6e6bf2324a2f9af49bd59fd623 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 5 Jan 2005 02:04:12 +0100 Subject: [PATCH 0645/1063] Make sure to include ZLIB_LIBS in mysql_config --libs_r (Bug #7021) scripts/mysql_config.sh: include ZLIB_LIBS in --libs_r --- scripts/mysql_config.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/mysql_config.sh b/scripts/mysql_config.sh index 86cbe944416..79d8eef868b 100644 --- a/scripts/mysql_config.sh +++ b/scripts/mysql_config.sh @@ -88,7 +88,7 @@ client_libs='@CLIENT_LIBS@' libs="$ldflags -L$pkglibdir -lmysqlclient $client_libs" libs=`echo "$libs" | sed -e 's; \+; ;g' | sed -e 's;^ *;;' | sed -e 's; *\$;;'` -libs_r="$ldflags -L$pkglibdir -lmysqlclient_r @LIBS@ @openssl_libs@" +libs_r="$ldflags -L$pkglibdir -lmysqlclient_r @LIBS@ @ZLIB_LIBS@ @openssl_libs@" libs_r=`echo "$libs_r" | sed -e 's; \+; ;g' | sed -e 's;^ *;;' | sed -e 's; *\$;;'` cflags="-I$pkgincludedir @CFLAGS@ " #note: end space! include="-I$pkgincludedir" From 72801bc21b01214a08adb93db4a1c50fa4c53e8f Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 5 Jan 2005 03:05:19 +0100 Subject: [PATCH 0646/1063] Use ZLIB_LIBS when linking libmysqlclient_r (Bug #6418) libmysql_r/Makefile.am: Make sure we link against zlib --- libmysql_r/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libmysql_r/Makefile.am b/libmysql_r/Makefile.am index 939cb4c73dd..0a5c380ff35 100644 --- a/libmysql_r/Makefile.am +++ b/libmysql_r/Makefile.am @@ -22,7 +22,7 @@ target = libmysqlclient_r.la target_defs = -DDONT_USE_RAID -DMYSQL_CLIENT @LIB_EXTRA_CCFLAGS@ -LIBS = @LIBS@ @openssl_libs@ +LIBS = @LIBS@ @ZLIB_LIBS@ @openssl_libs@ INCLUDES = @MT_INCLUDES@ \ -I$(top_srcdir)/include $(openssl_includes) @ZLIB_INCLUDES@ From 329a6e9c2225096ac7301204cec828d38f30e4a6 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 5 Jan 2005 03:43:37 +0100 Subject: [PATCH 0647/1063] Protect flags like -Wl,-O2 from being mangled by mysql_config (Bug #6964) (Second commit of this patch -- first included wrong changes.) scripts/mysql_config.sh: Make sure we are only removing whole options (protects -Wl,-O2, for example) --- scripts/mysql_config.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/mysql_config.sh b/scripts/mysql_config.sh index 86cbe944416..35ddbcac471 100644 --- a/scripts/mysql_config.sh +++ b/scripts/mysql_config.sh @@ -100,7 +100,7 @@ for remove in DDBUG_OFF DSAFEMALLOC USAFEMALLOC DSAFE_MUTEX \ DPEDANTIC_SAFEMALLOC DUNIV_MUST_NOT_INLINE DFORCE_INIT_OF_VARS \ DEXTRA_DEBUG DHAVE_purify 'O[0-9]' 'W[-A-Za-z]*' do - cflags=`echo "$cflags"|sed -e "s/-$remove *//g"` + cflags=`echo "$cflags"|sed -e "s/ -$remove */ /g"` done cflags=`echo "$cflags"|sed -e 's/ *\$//'` From 8a1e77e23f56c31984155bb14e7c5b68738091f8 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 5 Jan 2005 16:26:53 +0500 Subject: [PATCH 0648/1063] WL#964 _stricmp was replaved on sting_compare_func added breakes for windows mysql-test/mysql_test_run_new.c: _stricmp was replaved on sting_compare_func added breakes for windows --- mysql-test/mysql_test_run_new.c | 110 +++++++++++++++++++------------- 1 file changed, 67 insertions(+), 43 deletions(-) diff --git a/mysql-test/mysql_test_run_new.c b/mysql-test/mysql_test_run_new.c index 7b77fc5ced8..5f949015ee7 100644 --- a/mysql-test/mysql_test_run_new.c +++ b/mysql-test/mysql_test_run_new.c @@ -90,10 +90,20 @@ static char slave_socket[FN_REFLEN]= "./var/tmp/slave.sock"; #endif #define MAX_COUNT_TESTES 1024 + +#ifdef __WIN__ +# define sting_compare_func _stricmp +#else +# ifdef HAVE_STRCASECMP +# define sting_compare_func strcasecmp +# else +# define sting_compare_func strcmp +# endif +#endif + /* comma delimited list of tests to skip or empty string */ #ifndef __WIN__ static char skip_test[FN_REFLEN]= " lowercase_table3 , system_mysql_db_fix "; -#define _stricmp strcasecmp #else /* The most ignore testes contain the calls of system command @@ -1439,7 +1449,7 @@ void setup(char *file __attribute__((unused))) */ int compare( const void *arg1, const void *arg2 ) { - return _stricmp( * ( char** ) arg1, * ( char** ) arg2 ); + return sting_compare_func( * ( char** ) arg1, * ( char** ) arg2 ); } @@ -1520,7 +1530,9 @@ int main(int argc, char **argv) else { /* run all tests */ - names= malloc(MAX_COUNT_TESTES*4); + names= malloc(MAX_COUNT_TESTES*sizeof(void*)); + if (!names) + die("can not allcate memory for sorting"); testes= names; name_index= 0; #ifndef __WIN__ @@ -1540,57 +1552,69 @@ int main(int argc, char **argv) /* find the test suffix */ if ((position= strinstr(test, TEST_SUFFIX)) != 0) { - /* null terminate at the suffix */ - *(test + position - 1)= '\0'; - /* insert test */ - *names= malloc(FN_REFLEN); - strcpy(*names,test); - names++; - name_index++; + if (name_index < MAX_COUNT_TESTES) + { + /* null terminate at the suffix */ + *(test + position - 1)= '\0'; + /* insert test */ + *names= malloc(FN_REFLEN); + strcpy(*names,test); + names++; + name_index++; + } + else + die("can not sort files, array is overloaded"); } } closedir(parent); } #else - struct _finddata_t dir; - intptr_t handle; - char test[FN_LEN]; - char mask[FN_REFLEN]; - char *p; - int position; - - /* single test */ - single_test= FALSE; - - snprintf(mask,FN_REFLEN,"%s/*.test",test_dir); - - if ((handle=_findfirst(mask,&dir)) == -1L) { - die("Unable to open tests directory."); - } + struct _finddata_t dir; + int* handle; + char test[FN_LEN]; + char mask[FN_REFLEN]; + char *p; + int position; + /* single test */ + single_test= FALSE; - do - { - if (!(dir.attrib & _A_SUBDIR)) + snprintf(mask,FN_REFLEN,"%s/*.test",test_dir); + + if ((handle=_findfirst(mask,&dir)) == -1L) { - strcpy(test, strlwr(dir.name)); - - /* find the test suffix */ - if ((position= strinstr(test, TEST_SUFFIX)) != 0) - { - /* null terminate at the suffix */ - *(test + position - 1)= '\0'; - /* insert test */ - *names= malloc(FN_REFLEN); - strcpy(*names,test); - names++; - name_index++; - } + die("Unable to open tests directory."); } - }while (_findnext(handle,&dir) == 0); - _findclose(handle); + + do + { + if (!(dir.attrib & _A_SUBDIR)) + { + strcpy(test, strlwr(dir.name)); + + /* find the test suffix */ + if ((position= strinstr(test, TEST_SUFFIX)) != 0) + { + if (name_index < MAX_COUNT_TESTES) + { + /* null terminate at the suffix */ + *(test + position - 1)= '\0'; + /* insert test */ + *names= malloc(FN_REFLEN); + strcpy(*names,test); + names++; + name_index++; + } + else + die("can not sort files, array is overloaded"); + } + } + }while (_findnext(handle,&dir) == 0); + + _findclose(handle); + } #endif qsort( (void *)testes, name_index, sizeof( char * ), compare ); From af4ef15f82603b78e97f6b9c9eefbfaa3344b2fe Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 5 Jan 2005 14:09:31 +0200 Subject: [PATCH 0649/1063] mysql-test/mysql-test-run.sh report test mode if case of failure (default/ps-protocol/embedded) mysql-test/mysql-test-run.sh: report test mode if case of failure (default/ps-protocol/embedded) --- mysql-test/mysql-test-run.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index 4c141e75baa..9684a880510 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -239,11 +239,12 @@ MYSQL_TEST_SSL_OPTS="" USE_TIMER="" USE_EMBEDDED_SERVER="" RESULT_EXT="" +TEST_MODE="default" while test $# -gt 0; do case "$1" in - --embedded-server) USE_EMBEDDED_SERVER=1 ; USE_MANAGER=0 ; NO_SLAVE=1 ; \ - USE_RUNNING_SERVER="" RESULT_EXT=".es" ;; + --embedded-server) USE_EMBEDDED_SERVER=1 USE_MANAGER=0 NO_SLAVE=1 ; \ + USE_RUNNING_SERVER="" RESULT_EXT=".es" TEST_MODE="embedded" ;; --user=*) DBUSER=`$ECHO "$1" | $SED -e "s;--user=;;"` ;; --force) FORCE=1 ;; --timer) USE_TIMER=1 ;; @@ -323,7 +324,7 @@ while test $# -gt 0; do SLEEP_TIME_AFTER_RESTART=`$ECHO "$1" | $SED -e "s;--sleep=;;"` ;; --ps-protocol) - EXTRA_MYSQL_TEST_OPT="$EXTRA_MYSQL_TEST_OPT $1" ;; + TEST_MODE="ps-protocol" EXTRA_MYSQL_TEST_OPT="$EXTRA_MYSQL_TEST_OPT $1" ;; --user-test=*) USER_TEST=`$ECHO "$1" | $SED -e "s;--user-test=;;"` ;; @@ -1561,7 +1562,7 @@ run_testcase () show_failed_diff $tname $ECHO if [ x$FORCE != x1 ] ; then - $ECHO "Aborting: $tname failed. To continue, re-run with '--force'." + $ECHO "Aborting: $tname failed in $TEST_MODE mode. To continue, re-run with '--force'." $ECHO if [ -z "$DO_GDB" ] && [ -z "$USE_RUNNING_SERVER" ] && \ [ -z "$DO_DDD" ] && [ -z "$USE_EMBEDDED_SERVER" ] @@ -1742,7 +1743,7 @@ $ECHO [ "$DO_GPROF" ] && gprof_collect # collect coverage information if [ $TOT_FAIL -ne 0 ]; then - $ECHO "mysql-test-run: *** Failing the test(s):$FAILED_CASES" + $ECHO "mysql-test-run in $TEST_MODE mode: *** Failing the test(s):$FAILED_CASES" $ECHO exit 1 else From c99b4964ca7da035bf2895812ef02bcfbdefa67a Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 5 Jan 2005 17:14:29 +0500 Subject: [PATCH 0650/1063] replace position names and testes fixed bug --- mysql-test/mysql_test_run_new.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mysql-test/mysql_test_run_new.c b/mysql-test/mysql_test_run_new.c index ecae0b6ad4d..bdebe912b97 100644 --- a/mysql-test/mysql_test_run_new.c +++ b/mysql-test/mysql_test_run_new.c @@ -1531,10 +1531,10 @@ int main(int argc, char **argv) else { /* run all tests */ - names= malloc(MAX_COUNT_TESTES*sizeof(void*)); - if (!names) + testes= malloc(MAX_COUNT_TESTES*sizeof(void*)); + if (!testes) die("can not allcate memory for sorting"); - testes= names; + names= testes; name_index= 0; #ifndef __WIN__ struct dirent *entry; @@ -1619,7 +1619,7 @@ int main(int argc, char **argv) #endif qsort( (void *)testes, name_index, sizeof( char * ), compare ); - for (index= 0; index <= name_index; index++) + for (index= 0; index < name_index; index++) { run_test(testes[index]); free(testes[index]); From 6f2f0d5cf3a7cb9a638bc753a3f3ec1b518bc4ed Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 5 Jan 2005 16:35:43 +0100 Subject: [PATCH 0651/1063] my_sleep.c: On Windows my_sleep() always gave a zero microsecond sleep mysys/my_sleep.c: On Windows my_sleep() always gave a zero microsecond sleep --- mysys/my_sleep.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mysys/my_sleep.c b/mysys/my_sleep.c index 3de2d2abd13..31eaf7eeb96 100644 --- a/mysys/my_sleep.c +++ b/mysys/my_sleep.c @@ -23,6 +23,8 @@ void my_sleep(ulong m_seconds) { #ifdef __NETWARE__ delay(m_seconds/1000+1); +#elif defined(__WIN__) + Sleep(m_seconds/1000+1); /* Sleep() has millisecond arg */ #elif defined(OS2) DosSleep(m_seconds/1000+1); #elif defined(HAVE_SELECT) From 3edb7774edf059834cb6b29fc4a9634802ea7dc7 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 5 Jan 2005 19:02:17 +0100 Subject: [PATCH 0652/1063] Allow DEFAULT_THREAD_STACK to be set via -DDEFAULT_THREAD_STACK=... so our official binary builds for Linux that are built against a static glibc with a 128k thread stack size limit can be compiled with a default that doesn't result in a harmless (but oft-misunderstood) warning message. (Bug #6226) include/my_pthread.h: Allow DEFAULT_THREAD_STACK to be set via -DDEFAULT_THREAD_STACK=... --- include/my_pthread.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/my_pthread.h b/include/my_pthread.h index 40302f48bd5..7620b46e08b 100644 --- a/include/my_pthread.h +++ b/include/my_pthread.h @@ -624,6 +624,7 @@ extern int pthread_dummy(int); /* All thread specific variables are in the following struct */ #define THREAD_NAME_SIZE 10 +#ifndef DEFAULT_THREAD_STACK #if defined(__ia64__) /* MySQL can survive with 32K, but some glibc libraries require > 128K stack @@ -633,6 +634,7 @@ extern int pthread_dummy(int); #else #define DEFAULT_THREAD_STACK (192*1024L) #endif +#endif struct st_my_thread_var { From 190f7a6f451f01b4b336b8825178ec3e38d24a9c Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 5 Jan 2005 21:56:18 +0100 Subject: [PATCH 0653/1063] Fix "mysqladmin password" to use correct password scrambling function when talking to pre-4.1 servers or 4.1 and later servers where the old_passwords option is enabled. "mysqladmin old-password" is unchanged. (Bug #7451) client/mysqladmin.cc: Check old_passwords from server, and use that to determine which scramble function to use (except in the case of the old-password command, which always use the old scramble function). --- client/mysqladmin.cc | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/client/mysqladmin.cc b/client/mysqladmin.cc index 2e8b3cd588a..6916b4ea808 100644 --- a/client/mysqladmin.cc +++ b/client/mysqladmin.cc @@ -826,13 +826,39 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv) if (argv[1][0]) { char *pw= argv[1]; + bool old= find_type(argv[0], &command_typelib, 2) == ADMIN_OLD_PASSWORD; #ifdef __WIN__ uint pw_len= strlen(pw); if (pw_len > 1 && pw[0] == '\'' && pw[pw_len-1] == '\'') printf("Warning: single quotes were not trimmed from the password by" " your command\nline client, as you might have expected.\n"); #endif - if (find_type(argv[0], &command_typelib, 2) == ADMIN_OLD_PASSWORD) + /* + If we don't already know to use an old-style password, see what + the server is using + */ + if (!old) { + if (mysql_query(mysql, "SHOW VARIABLES LIKE 'old_passwords'")) { + my_printf_error(0, "Could not determine old_passwords setting from server; error: '%s'", + MYF(ME_BELL),mysql_error(mysql)); + return -1; + } else { + MYSQL_RES *res= mysql_store_result(mysql); + if (!res) { + my_printf_error(0, "Could not get old_passwords setting from server; error: '%s'", + MYF(ME_BELL),mysql_error(mysql)); + return -1; + } + if (!mysql_num_rows(res)) { + old= 1; + } else { + MYSQL_ROW row= mysql_fetch_row(res); + old= !strncmp(row[1], "ON", 2); + } + mysql_free_result(res); + } + } + if (old) make_scrambled_password_323(crypted_pw, pw); else make_scrambled_password(crypted_pw, pw); From 0f00947b5d219fe252c978cbada03fdb669fac46 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 6 Jan 2005 01:08:03 +0100 Subject: [PATCH 0654/1063] Add support for --default-character-set to mysqladmin (Bug #7524) client/mysqladmin.cc: Handle default-character-set being specified --- client/mysqladmin.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/client/mysqladmin.cc b/client/mysqladmin.cc index 2e8b3cd588a..ae92765dfdf 100644 --- a/client/mysqladmin.cc +++ b/client/mysqladmin.cc @@ -33,7 +33,8 @@ #define SHUTDOWN_DEF_TIMEOUT 3600 /* Wait for shutdown */ #define MAX_TRUNC_LENGTH 3 -char *host= NULL, *user= 0, *opt_password= 0; +char *host= NULL, *user= 0, *opt_password= 0, + *default_charset= NULL; char truncated_var_names[MAX_MYSQL_VAR][MAX_TRUNC_LENGTH]; char ex_var_names[MAX_MYSQL_VAR][FN_REFLEN]; ulonglong last_values[MAX_MYSQL_VAR]; @@ -145,6 +146,9 @@ static struct my_option my_long_options[] = {"character-sets-dir", OPT_CHARSETS_DIR, "Directory where character sets are.", (gptr*) &charsets_dir, (gptr*) &charsets_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"default-character-set", OPT_DEFAULT_CHARSET, + "Set the default character set.", (gptr*) &default_charset, + (gptr*) &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"help", '?', "Display this help and exit.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, {"host", 'h', "Connect to host.", (gptr*) &host, (gptr*) &host, 0, GET_STR, @@ -343,6 +347,8 @@ int main(int argc,char *argv[]) if (shared_memory_base_name) mysql_options(&mysql,MYSQL_SHARED_MEMORY_BASE_NAME,shared_memory_base_name); #endif + if (default_charset) + mysql_options(&mysql, MYSQL_SET_CHARSET_NAME, default_charset); if (sql_connect(&mysql, option_wait)) { unsigned int err= mysql_errno(&mysql); From f0cf742fd3e87dbe6cfb065bb371b1cbc93c00e5 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 6 Jan 2005 10:49:26 +0200 Subject: [PATCH 0655/1063] Fix for BUG#7331. The problem was that when a QUICK_SELECT access method is chosen, test_if_skip_sort_order() discovered that the index being used by the quick select will not deliver tuples in sorted order. In this case test_if_skip_sort_order() tried to change the index used by the quick select, but it didn't properly set the other members of the quick select, and especially the range flags of the ranges in QUICK_SELECT::ranges. The fix re-invokes the function SQL_SELECT::test_quick_select to correctly create a valid QUICK_SELECT object. mysql-test/r/order_by.result: Added test results. mysql-test/t/order_by.test: Added test for BUG#7331. sql/sql_select.cc: Fix for BUG#7331. --- mysql-test/r/order_by.result | 38 ++++++++++++++++++++++++++++++++++++ mysql-test/t/order_by.test | 34 ++++++++++++++++++++++++++++++++ sql/sql_select.cc | 21 ++++++++++++++++---- 3 files changed, 89 insertions(+), 4 deletions(-) diff --git a/mysql-test/r/order_by.result b/mysql-test/r/order_by.result index 94d56bbc2fa..ab71a6b53e6 100644 --- a/mysql-test/r/order_by.result +++ b/mysql-test/r/order_by.result @@ -733,3 +733,41 @@ xxxxxxxxxxxxxxxxxxxaa xxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxz drop table t1; +create table t1 ( +`sid` decimal(8,0) default null, +`wnid` varchar(11) not null default '', +key `wnid14` (`wnid`(4)), +key `wnid` (`wnid`) +) engine=myisam default charset=latin1; +insert into t1 (`sid`, `wnid`) values +('10100','01019000000'),('37986','01019000000'),('37987','01019010000'), +('39560','01019090000'),('37989','01019000000'),('37990','01019011000'), +('37991','01019011000'),('37992','01019019000'),('37993','01019030000'), +('37994','01019090000'),('475','02070000000'),('25253','02071100000'), +('25255','02071100000'),('25256','02071110000'),('25258','02071130000'), +('25259','02071190000'),('25260','02071200000'),('25261','02071210000'), +('25262','02071290000'),('25263','02071300000'),('25264','02071310000'), +('25265','02071310000'),('25266','02071320000'),('25267','02071320000'), +('25269','02071330000'),('25270','02071340000'),('25271','02071350000'), +('25272','02071360000'),('25273','02071370000'),('25281','02071391000'), +('25282','02071391000'),('25283','02071399000'),('25284','02071400000'), +('25285','02071410000'),('25286','02071410000'),('25287','02071420000'), +('25288','02071420000'),('25291','02071430000'),('25290','02071440000'), +('25292','02071450000'),('25293','02071460000'),('25294','02071470000'), +('25295','02071491000'),('25296','02071491000'),('25297','02071499000'); +explain select * from t1 where wnid like '0101%' order by wnid; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range wnid14,wnid wnid 11 NULL 10 Using where +select * from t1 where wnid like '0101%' order by wnid; +sid wnid +10100 01019000000 +37986 01019000000 +37989 01019000000 +37987 01019010000 +37990 01019011000 +37991 01019011000 +37992 01019019000 +37993 01019030000 +39560 01019090000 +37994 01019090000 +drop table t1; diff --git a/mysql-test/t/order_by.test b/mysql-test/t/order_by.test index 988c106bf21..ab5e93603e4 100644 --- a/mysql-test/t/order_by.test +++ b/mysql-test/t/order_by.test @@ -500,3 +500,37 @@ insert into t1 set a = concat(repeat('x', 19), 'aa'); set max_sort_length=20; select a from t1 order by a; drop table t1; + +# +# Bug #7331 +# + +create table t1 ( + `sid` decimal(8,0) default null, + `wnid` varchar(11) not null default '', + key `wnid14` (`wnid`(4)), + key `wnid` (`wnid`) +) engine=myisam default charset=latin1; + +insert into t1 (`sid`, `wnid`) values +('10100','01019000000'),('37986','01019000000'),('37987','01019010000'), +('39560','01019090000'),('37989','01019000000'),('37990','01019011000'), +('37991','01019011000'),('37992','01019019000'),('37993','01019030000'), +('37994','01019090000'),('475','02070000000'),('25253','02071100000'), +('25255','02071100000'),('25256','02071110000'),('25258','02071130000'), +('25259','02071190000'),('25260','02071200000'),('25261','02071210000'), +('25262','02071290000'),('25263','02071300000'),('25264','02071310000'), +('25265','02071310000'),('25266','02071320000'),('25267','02071320000'), +('25269','02071330000'),('25270','02071340000'),('25271','02071350000'), +('25272','02071360000'),('25273','02071370000'),('25281','02071391000'), +('25282','02071391000'),('25283','02071399000'),('25284','02071400000'), +('25285','02071410000'),('25286','02071410000'),('25287','02071420000'), +('25288','02071420000'),('25291','02071430000'),('25290','02071440000'), +('25292','02071450000'),('25293','02071460000'),('25294','02071470000'), +('25295','02071491000'),('25296','02071491000'),('25297','02071499000'); + +explain select * from t1 where wnid like '0101%' order by wnid; + +select * from t1 where wnid like '0101%' order by wnid; + +drop table t1; diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 610a98d1983..acff1180e8c 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -7153,11 +7153,24 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit, } else { - select->quick->file->ha_index_end(); - select->quick->index= new_ref_key; - select->quick->init(); + /* + The range optimizer constructed QUICK_RANGE for ref_key, and + we want to use instead new_ref_key as the index. We can't + just change the index of the quick select, because this may + result in an incosistent QUICK_SELECT object. Below we + create a new QUICK_SELECT from scratch so that all its + parameres are set correctly by the range optimizer. + */ + key_map new_ref_key_map; + new_ref_key_map.clear_all(); /* Force the creation of quick select */ + new_ref_key_map.set_bit(new_ref_key); /* only for new_ref_key. */ + + if (select->test_quick_select(tab->join->thd, new_ref_key_map, 0, + (tab->join->select_options & OPTION_FOUND_ROWS) ? + HA_POS_ERROR : tab->join->unit->select_limit_cnt) <= 0) + DBUG_RETURN(0); } - ref_key= new_ref_key; + ref_key= new_ref_key; } } /* Check if we get the rows in requested sorted order by using the key */ From 51cae387a9a2c67b0f6249864714b8659c951670 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 6 Jan 2005 11:19:20 +0200 Subject: [PATCH 0656/1063] os0file.c: Use the fcntl() file flush method on OS X; Apple disabled fsync() for internal disk drives, which caused corruption in power outages; the patch was recommended by an Apple engineer innobase/os/os0file.c: Use the fcntl() file flush method on OS X; Apple disabled fsync() for internal disk drives, which caused corruption in power outages; the patch was recommended by an Apple engineer --- innobase/os/os0file.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/innobase/os/os0file.c b/innobase/os/os0file.c index aa45030d93b..f02b81b8fd8 100644 --- a/innobase/os/os0file.c +++ b/innobase/os/os0file.c @@ -1763,7 +1763,21 @@ os_file_flush( #else int ret; -#ifdef HAVE_FDATASYNC +#ifdef HAVE_DARWIN_THREADS + /* Apple has disabled fsync() for internal disk drives in OS X. That + caused corruption for a user when he tested a power outage. Let us in + OS X use a nonstandard flush method recommended by an Apple + engineer. */ + + ret = fcntl(file, F_FULLFSYNC, NULL); + + if (ret) { + /* If we are not on a file system that supports this, then + fall back to a plain fsync. */ + + ret = fsync(file); + } +#elif HAVE_FDATASYNC ret = fdatasync(file); #else /* fprintf(stderr, "Flushing to file %p\n", file); */ From 10844e41da65bd86a781e314a15a60b8b21d40d8 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 6 Jan 2005 14:35:14 +0100 Subject: [PATCH 0657/1063] - enable "with-extra-charsets=complex" for the "compile-dist" distribution build (to make the test suite pass) BUILD/compile-dist: - enable "with-extra-charsets=complex" for the distribution build (to make the test suite pass) --- BUILD/compile-dist | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/BUILD/compile-dist b/BUILD/compile-dist index 2344d4dfffd..ef6302f0d9c 100755 --- a/BUILD/compile-dist +++ b/BUILD/compile-dist @@ -42,5 +42,6 @@ fi --with-embedded-server \ --with-berkeley-db \ --with-innodb \ - --enable-thread-safe-client + --enable-thread-safe-client \ + --with-extra-charsets=complex make From 5360632639bce0558734c0119063b225a92509cb Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 6 Jan 2005 17:08:38 +0200 Subject: [PATCH 0658/1063] removed unused label --- sql/sql_parse.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 55d26a68116..cd8e73c446d 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -2429,7 +2429,6 @@ mysql_execute_command(THD *thd) create_table_local); break; -create_error: res= 1; //error reported unsent_create_error: // put tables back for PS rexecuting From 928c20f8e33512e00d6e5936cfe1c9f206c951dd Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 6 Jan 2005 19:13:58 +0200 Subject: [PATCH 0659/1063] fixed comparation with string constant on some platform (BUG#7651) client/mysqldump.c: fixed comparation with string constant on some platform --- client/mysqldump.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/client/mysqldump.c b/client/mysqldump.c index 98de9e0b069..da409d44cd1 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -106,7 +106,14 @@ FILE *md_result_file; static char *shared_memory_base_name=0; #endif static uint opt_protocol= 0; -static char *default_charset= (char*) MYSQL_UNIVERSAL_CLIENT_CHARSET; +/* + Constant for detection default value of default_charset (if + default_charset equal to mysql_universal_client_charset, then it is + default value which assigned in very beginning on main()) +*/ +const static char *mysql_universal_client_charset= + MYSQL_UNIVERSAL_CLIENT_CHARSET; +static char *default_charset; static CHARSET_INFO *charset_info= &my_charset_latin1; const char *default_dbug_option="d:t:o,/tmp/mysqldump.trace"; @@ -678,7 +685,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), Set charset to the default compiled value if it hasn't been reset yet by --default-character-set=xxx. */ - if (default_charset == (char*) MYSQL_UNIVERSAL_CLIENT_CHARSET) + if (default_charset == mysql_universal_client_charset) default_charset= (char*) MYSQL_DEFAULT_CHARSET_NAME; break; } @@ -2403,6 +2410,7 @@ cleanup: int main(int argc, char **argv) { compatible_mode_normal_str[0]= 0; + default_charset= (char *)mysql_universal_client_charset; MY_INIT(argv[0]); if (get_options(&argc, &argv)) From babb77767a48662fb1c9c80658538b5492a5cc34 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 6 Jan 2005 20:47:08 +0200 Subject: [PATCH 0660/1063] postreview changes client/mysqldump.c: fixed comment fixed compiler warning --- client/mysqldump.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/client/mysqldump.c b/client/mysqldump.c index da409d44cd1..d511dc3bbde 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -107,11 +107,11 @@ static char *shared_memory_base_name=0; #endif static uint opt_protocol= 0; /* - Constant for detection default value of default_charset (if - default_charset equal to mysql_universal_client_charset, then it is - default value which assigned in very beginning on main()) + Constant for detection of default value of default_charset. + If default_charset is equal to mysql_universal_client_charset, then + it is the default value which assigned at the very beginning of main(). */ -const static char *mysql_universal_client_charset= +static const char *mysql_universal_client_charset= MYSQL_UNIVERSAL_CLIENT_CHARSET; static char *default_charset; static CHARSET_INFO *charset_info= &my_charset_latin1; From eb6f4f85f054094d9c6cfd0394d455e7c55a9c57 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 6 Jan 2005 19:57:02 +0100 Subject: [PATCH 0661/1063] Add comment to make code for option-stripping in mysql_config more clear scripts/mysql_config.sh: Add comment to clarify why we can safely only strip flags with a leading space --- scripts/mysql_config.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/mysql_config.sh b/scripts/mysql_config.sh index 35ddbcac471..3676e03ab48 100644 --- a/scripts/mysql_config.sh +++ b/scripts/mysql_config.sh @@ -100,6 +100,8 @@ for remove in DDBUG_OFF DSAFEMALLOC USAFEMALLOC DSAFE_MUTEX \ DPEDANTIC_SAFEMALLOC DUNIV_MUST_NOT_INLINE DFORCE_INIT_OF_VARS \ DEXTRA_DEBUG DHAVE_purify 'O[0-9]' 'W[-A-Za-z]*' do + # The first option we might strip will always have a space before it because + # we set -I$pkgincludedir as the first option cflags=`echo "$cflags"|sed -e "s/ -$remove */ /g"` done cflags=`echo "$cflags"|sed -e 's/ *\$//'` From 5728b1daa75090b61489ef6cfc408ea53ce1b364 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 6 Jan 2005 20:42:06 +0100 Subject: [PATCH 0662/1063] Make sure all char columns in the mysql.* tables have the proper width in mysql_fix_privilege_tables.sql, or they may get truncated during conversion to utf8. (Bug #7539) scripts/mysql_fix_privilege_tables.sql: Reset widths of all text fields at the same time as vonersion to utf8 to avoid length changes --- scripts/mysql_fix_privilege_tables.sql | 39 +++++++++++++++++++++----- 1 file changed, 32 insertions(+), 7 deletions(-) diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql index a60d987f8b5..536b263f7bd 100644 --- a/scripts/mysql_fix_privilege_tables.sql +++ b/scripts/mysql_fix_privilege_tables.sql @@ -9,13 +9,38 @@ -- this sql script. -- On windows you should do 'mysql --force mysql < mysql_fix_privilege_tables.sql' -ALTER TABLE user type=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; -ALTER TABLE db type=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; -ALTER TABLE host type=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; -ALTER TABLE func type=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; -ALTER TABLE columns_priv type=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; -ALTER TABLE tables_priv type=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; -ALTER TABLE user change Password Password char(41) binary not null; +-- Convert all tables to UTF-8 with binary collation +-- and reset all char columns to correct width +ALTER TABLE user + MODIFY Host char(60) NOT NULL default '', + MODIFY User char(16) NOT NULL default '', + MODIFY Password char(41) NOT NULL default '', + ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; +ALTER TABLE db + MODIFY Host char(60) NOT NULL default '', + MODIFY Db char(64) NOT NULL default '', + MODIFY User char(16) NOT NULL default '', + ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; +ALTER TABLE host + MODIFY Host char(60) NOT NULL default '', + MODIFY Db char(64) NOT NULL default '', + ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; +ALTER TABLE func + ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; +ALTER TABLE columns_priv + MODIFY Host char(60) NOT NULL default '', + MODIFY Db char(64) NOT NULL default '', + MODIFY User char(16) NOT NULL default '', + MODIFY Table_name char(64) NOT NULL default '', + MODIFY Column_name char(64) NOT NULL default '', + ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; +ALTER TABLE tables_priv + MODIFY Host char(60) NOT NULL default '', + MODIFY Db char(64) NOT NULL default '', + MODIFY User char(16) NOT NULL default '', + MODIFY Table_name char(64) NOT NULL default '', + MODIFY Grantor char(77) NOT NULL default '', + ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; ALTER TABLE user add File_priv enum('N','Y') NOT NULL; CREATE TABLE IF NOT EXISTS func ( name char(64) binary DEFAULT '' NOT NULL, From 5b47aaed3a34c0b4c9f4c756dc7c65c8bb3a0393 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 6 Jan 2005 21:30:39 +0100 Subject: [PATCH 0663/1063] Fix for BUG#7714 "if disk full, sometimes MyISAM doesn't wait for free space, corrupts table" This happened only if my_write() couldn't write even one byte. I cannot easily add a .test for this, but I tested by hand before and after the change. mysys/my_write.c: Monty and I could not find a reason why a write should not wait for free disk space (if disk is full) because it could not write at least one byte; doing so certainly corrupts tables. my_pwrite() and my_fwrite() don't test for -1, so no problem. --- mysys/my_write.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mysys/my_write.c b/mysys/my_write.c index da378d115f1..1d1a893090a 100644 --- a/mysys/my_write.c +++ b/mysys/my_write.c @@ -49,8 +49,7 @@ uint my_write(int Filedes, const byte *Buffer, uint Count, myf MyFlags) MyFlags&= ~ MY_WAIT_IF_FULL; /* End if aborted by user */ #endif if ((my_errno == ENOSPC || my_errno == EDQUOT) && - (MyFlags & MY_WAIT_IF_FULL) && - (uint) writenbytes != (uint) -1) + (MyFlags & MY_WAIT_IF_FULL)) { if (!(errors++ % MY_WAIT_GIVE_USER_A_MESSAGE)) my_error(EE_DISK_FULL,MYF(ME_BELL | ME_NOREFRESH), From 888f2fce984d64d4762317f44ac7b443366a5be7 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 6 Jan 2005 23:53:58 +0100 Subject: [PATCH 0664/1063] 2 small fixes for binlog (sorry for grouping them - I won't do it again): WL#2335 (wait if binlog or binlog index file hits disk full or quota exceeded), fix for BUG#7236 ("--expire_logs_days does not apply if all statements happen in transactions"), and a behaviour change: abort if mysqld can't start binlog at startup (if running with --log-bin of course). sql/log.cc: 2 small fixes for binlog: 1) We create binlog and binlog index file with flag MY_WAIT_IF_FULL, so that they have the same behaviour as MyISAM tables when disk is full or quota exceeded (wait, try to finish write every minute, warn in error log every 10 minutes). That's WL#2335. 2) Honour expire-log-days when we write a transaction to binlog (we honoured it already when writing an autocommit statement). This fixes BUG#7236. sql/mysqld.cc: If we fail to create binlog or binlog index file or write to them at mysqld's startup, mysqld will exit. The former behaviour was to print error and continue, which led to stupid things like if you mispell a directory name in --log-bin, you don't immediately notice your mistake and you corrupt your recovery/replication. New behaviour is consistent with if you mispelt innodb_data_file_path. --- sql/log.cc | 22 ++++++++++++++++++---- sql/mysqld.cc | 6 ++++-- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/sql/log.cc b/sql/log.cc index ab0cb823f15..4504b286506 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -255,7 +255,9 @@ bool MYSQL_LOG::open(const char *log_name, enum_log_type log_type_arg, if ((file=my_open(log_file_name,open_flags, MYF(MY_WME | ME_WAITTANG))) < 0 || init_io_cache(&log_file, file, IO_SIZE, io_cache_type, - my_tell(file,MYF(MY_WME)), 0, MYF(MY_WME | MY_NABP))) + my_tell(file,MYF(MY_WME)), 0, + MYF(MY_WME | MY_NABP | + ((log_type == LOG_BIN) ? MY_WAIT_IF_FULL : 0)))) goto err; switch (log_type) { @@ -333,6 +335,8 @@ bool MYSQL_LOG::open(const char *log_name, enum_log_type log_type_arg, First open of this class instance Create an index file that will hold all file names uses for logging. Add new entries to the end of it. + Index file (and binlog) are so critical for recovery/replication + that we create them with MY_WAIT_IF_FULL. */ fn_format(index_file_name, index_file_name_arg, mysql_data_home, ".index", opt); @@ -343,7 +347,7 @@ bool MYSQL_LOG::open(const char *log_name, enum_log_type log_type_arg, init_io_cache(&index_file, index_file_nr, IO_SIZE, WRITE_CACHE, my_seek(index_file_nr,0L,MY_SEEK_END,MYF(0)), - 0, MYF(MY_WME))) + 0, MYF(MY_WME | MY_WAIT_IF_FULL))) goto err; } else @@ -1574,6 +1578,7 @@ uint MYSQL_LOG::next_file_id() bool MYSQL_LOG::write(THD *thd, IO_CACHE *cache, bool commit_or_rollback) { + bool should_rotate= 0, error= 0; VOID(pthread_mutex_lock(&LOCK_log)); DBUG_ENTER("MYSQL_LOG::write(cache"); @@ -1671,7 +1676,7 @@ bool MYSQL_LOG::write(THD *thd, IO_CACHE *cache, bool commit_or_rollback) goto err; signal_update(); DBUG_PRINT("info",("max_size: %lu",max_size)); - if (my_b_tell(&log_file) >= (my_off_t) max_size) + if (should_rotate= (my_b_tell(&log_file) >= (my_off_t) max_size)) { pthread_mutex_lock(&LOCK_index); new_file(0); // inside mutex @@ -1687,7 +1692,16 @@ bool MYSQL_LOG::write(THD *thd, IO_CACHE *cache, bool commit_or_rollback) ha_commit_complete(thd); - DBUG_RETURN(0); +#ifdef HAVE_REPLICATION + if (should_rotate && expire_logs_days) + { + long purge_time= time(0) - expire_logs_days*24*60*60; + if (purge_time >= 0) + error= purge_logs_before_date(purge_time); + } +#endif + + DBUG_RETURN(error); err: if (!write_error) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 476d7e440e9..d1fef3519bf 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -2591,8 +2591,10 @@ static int init_server_components() if (opt_bin_log) { - open_log(&mysql_bin_log, glob_hostname, opt_bin_logname, "-bin", - opt_binlog_index_name, LOG_BIN, 0, 0, max_binlog_size); + /* If we fail to open binlog, it's going to hinder our recovery, so die */ + if (open_log(&mysql_bin_log, glob_hostname, opt_bin_logname, "-bin", + opt_binlog_index_name, LOG_BIN, 0, 0, max_binlog_size)) + unireg_abort(1); using_update_log=1; #ifdef HAVE_REPLICATION if (expire_logs_days) From dd02fd59b6032ae9a44ae578b17555f3a6c59756 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 7 Jan 2005 04:53:05 +0100 Subject: [PATCH 0665/1063] Skip client_test when testing embedded server mysql-test/t/client_test.test: Doesn't make sense to run this test when running the embedded server --- mysql-test/t/client_test.test | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mysql-test/t/client_test.test b/mysql-test/t/client_test.test index 66f5e69eb36..29e7c23ab35 100644 --- a/mysql-test/t/client_test.test +++ b/mysql-test/t/client_test.test @@ -1,2 +1,4 @@ +# Skip when testing the embedded server +--source include/not_embedded.inc --disable_result_log --exec $TESTS_BINDIR/client_test --no-defaults --testcase --user=root --socket=$MASTER_MYSOCK --port=$MYSQL_TCP_PORT --silent From 04498c2a4f1eb9e3f33ec4f66fe0cd85c41380a4 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 6 Jan 2005 22:30:23 -0600 Subject: [PATCH 0666/1063] Bootstrap: Made the default --mail address to be . Build-tools/Bootstrap: Made the default --mail address to be . --- Build-tools/Bootstrap | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Build-tools/Bootstrap b/Build-tools/Bootstrap index 10211dbb59c..10ebc5c2dd1 100755 --- a/Build-tools/Bootstrap +++ b/Build-tools/Bootstrap @@ -38,7 +38,7 @@ $opt_dry_run= undef; $opt_export_only= undef; $opt_help= $opt_verbose= 0; $opt_log= undef; -$opt_mail= ""; +$opt_mail= "build\@mysql.com"; $opt_pull= undef; $opt_revision= undef; $opt_suffix= ""; @@ -431,6 +431,7 @@ Options: include a log file snippet, if logging is enabled) Note that the \@-Sign needs to be quoted! Example: --mail=user\\\@domain.com + Default: build\@mysql.com -q, --quiet Be quiet -p, --pull Update the source BK trees before building -r, --revision= Export the tree as of revision From 647906259c457314eb8cedb2e336aeda1b2a0ada Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 7 Jan 2005 00:32:31 -0800 Subject: [PATCH 0667/1063] Added test data and test case files. --- .../suite/jp/std_data/jisx0201_ucs2.dat | Bin 0 -> 346 bytes .../suite/jp/std_data/jisx0208_sjis2.dat | 2 + mysql-test/suite/jp/t/jp_subquery_ujis.test | 142 ++++++++++++++++++ 3 files changed, 144 insertions(+) create mode 100755 mysql-test/suite/jp/std_data/jisx0201_ucs2.dat create mode 100755 mysql-test/suite/jp/std_data/jisx0208_sjis2.dat create mode 100755 mysql-test/suite/jp/t/jp_subquery_ujis.test diff --git a/mysql-test/suite/jp/std_data/jisx0201_ucs2.dat b/mysql-test/suite/jp/std_data/jisx0201_ucs2.dat new file mode 100755 index 0000000000000000000000000000000000000000..777f956a6cf1d44b7388101cddae0cf6c033294a GIT binary patch literal 346 zcmW;E)lvdr00rT_<|(kdySuwv2bB;Ml@O4yySw#GJ^thD?Ki7mD@i1iLMmyblR+j~ zWRpWKdE`@og+hubri4<;D5ru-s;H)hTI#5$!H7nhXr_f$+GwYPPP*u(hhF;VXTXR- zh8SjqQN|c&f=Q;BW`GC-E<=*tDo6Ez2&4oN{SJZh5q-HF>oz^U$Vz@++XAwiHrW5p64~nBq!k$B13+ xX Date: Fri, 7 Jan 2005 00:40:29 -0800 Subject: [PATCH 0668/1063] Added test case files --- mysql-test/suite/jp/t/jp_subquery_ucs2.test | 143 ++++++++++++++++++++ 1 file changed, 143 insertions(+) create mode 100755 mysql-test/suite/jp/t/jp_subquery_ucs2.test diff --git a/mysql-test/suite/jp/t/jp_subquery_ucs2.test b/mysql-test/suite/jp/t/jp_subquery_ucs2.test new file mode 100755 index 00000000000..311433438f4 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_subquery_ucs2.test @@ -0,0 +1,143 @@ +--source include/have_ucs2.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +--enable_warnings + +# +# Test subquery using Japanese characters in ucs2 encoding +# + +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; + +CREATE TABLE `£Ô£±a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£±b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£´b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µa` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µb` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£·b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£±a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£±b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£²a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£²b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = heap; + +#insert the following data in each table +# jisx0201 hankaku-katakana data +# jisx0208 data +# jisx0212 supplemental character data + +INSERT INTO `£Ô£±a` VALUES ('ޱ'),('޶'),('Ž»'); +INSERT INTO `£Ô£±b` VALUES ('ޱ'); +INSERT INTO `£Ô£²a` VALUES ('¤¢'),('¤«'),('¤µ'); +INSERT INTO `£Ô£²b` VALUES ('¤¢'); +INSERT INTO `£Ô£³a` VALUES ('íÜ'),('íÝ'),('íÞ'); +INSERT INTO `£Ô£³b` VALUES ('íÜ'); +INSERT INTO `£Ô£´a` VALUES ('ޱ'),('޶'),('Ž»'); +INSERT INTO `£Ô£´b` VALUES ('ޱ'); +INSERT INTO `£Ô£µa` VALUES ('¤¢'),('¤«'),('¤µ'); +INSERT INTO `£Ô£µb` VALUES ('¤¢'); +INSERT INTO `£Ô£¶a` VALUES ('íÜ'),('íÝ'),('íÞ'); +INSERT INTO `£Ô£¶b` VALUES ('íÜ'); +INSERT INTO `£Ô£·a` VALUES ('ޱ'),('޶'),('Ž»'); +INSERT INTO `£Ô£·b` VALUES ('ޱ'); +INSERT INTO `£Ô£¸a` VALUES ('¤¢'),('¤«'),('¤µ'); +INSERT INTO `£Ô£¸b` VALUES ('¤¢'); +INSERT INTO `£Ô£¹a` VALUES ('íÜ'),('íÝ'),('íÞ'); +INSERT INTO `£Ô£¹b` VALUES ('íÜ'); +INSERT INTO `£Ô£±£°a` VALUES ('ޱ'),('޶'),('Ž»'); +INSERT INTO `£Ô£±£°b` VALUES ('ޱ'); +INSERT INTO `£Ô£±£±a` VALUES ('¤¢'),('¤«'),('¤µ'); +INSERT INTO `£Ô£±£±b` VALUES ('¤¢'); +INSERT INTO `£Ô£±£²a` VALUES ('íÜ'),('íÝ'),('íÞ'); +INSERT INTO `£Ô£±£²b` VALUES ('íÜ'); + +#Test for innodb +SELECT `£Ã£±` FROM `£Ô£±a` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£±b`); +SELECT `£Ã£±` FROM `£Ô£±a` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£±b` WHERE `£Ô£±a`.`£Ã£±` = `£Ô£±b`.`£Ã£±`); +SELECT `£Ã£±` FROM `£Ô£±a` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£±b` WHERE `£Ô£±a`.`£Ã£±` = `£Ô£±b`.`£Ã£±`); +SELECT `£Ã£±` FROM `£Ô£²a` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£²b`); +SELECT `£Ã£±` FROM `£Ô£²a` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£²b` WHERE `£Ô£²a`.`£Ã£±` = `£Ô£²b`.`£Ã£±`); +SELECT `£Ã£±` FROM `£Ô£²a` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£²b` WHERE `£Ô£²a`.`£Ã£±` = `£Ô£²b`.`£Ã£±`); +SELECT `£Ã£±` FROM `£Ô£³a` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£³b`); +SELECT `£Ã£±` FROM `£Ô£³a` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£³b` WHERE `£Ô£³a`.`£Ã£±` = `£Ô£³b`.`£Ã£±`); +SELECT `£Ã£±` FROM `£Ô£³a` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£³b` WHERE `£Ô£³a`.`£Ã£±` = `£Ô£³b`.`£Ã£±`); +SELECT `£Ã£±` FROM `£Ô£´a` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£´b`); +SELECT `£Ã£±` FROM `£Ô£´a` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£´b` WHERE `£Ô£´a`.`£Ã£±` = `£Ô£´b`.`£Ã£±`); +SELECT `£Ã£±` FROM `£Ô£´a` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£´b` WHERE `£Ô£´a`.`£Ã£±` = `£Ô£´b`.`£Ã£±`); +SELECT `£Ã£±` FROM `£Ô£µa` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£µb`); +SELECT `£Ã£±` FROM `£Ô£µa` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£µb` WHERE `£Ô£µa`.`£Ã£±` = `£Ô£µb`.`£Ã£±`); +SELECT `£Ã£±` FROM `£Ô£µa` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£µb` WHERE `£Ô£µa`.`£Ã£±` = `£Ô£µb`.`£Ã£±`); +SELECT `£Ã£±` FROM `£Ô£¶a` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£¶b`); +SELECT `£Ã£±` FROM `£Ô£¶a` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£¶b` WHERE `£Ô£¶a`.`£Ã£±` = `£Ô£¶b`.`£Ã£±`); +SELECT `£Ã£±` FROM `£Ô£¶a` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£¶b` WHERE `£Ô£¶a`.`£Ã£±` = `£Ô£¶b`.`£Ã£±`); +SELECT `£Ã£±` FROM `£Ô£·a` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£·b`); +SELECT `£Ã£±` FROM `£Ô£·a` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£·b` WHERE `£Ô£·a`.`£Ã£±` = `£Ô£·b`.`£Ã£±`); +SELECT `£Ã£±` FROM `£Ô£·a` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£·b` WHERE `£Ô£·a`.`£Ã£±` = `£Ô£·b`.`£Ã£±`); +SELECT `£Ã£±` FROM `£Ô£¸a` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£¸b`); +SELECT `£Ã£±` FROM `£Ô£¸a` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£¸b` WHERE `£Ô£¸a`.`£Ã£±` = `£Ô£¸b`.`£Ã£±`); +SELECT `£Ã£±` FROM `£Ô£¸a` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£¸b` WHERE `£Ô£¸a`.`£Ã£±` = `£Ô£¸b`.`£Ã£±`); +SELECT `£Ã£±` FROM `£Ô£¹a` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£¹b`); +SELECT `£Ã£±` FROM `£Ô£¹a` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£¹b` WHERE `£Ô£¹a`.`£Ã£±` = `£Ô£¹b`.`£Ã£±`); +SELECT `£Ã£±` FROM `£Ô£¹a` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£¹b` WHERE `£Ô£¹a`.`£Ã£±` = `£Ô£¹b`.`£Ã£±`); +SELECT `£Ã£±` FROM `£Ô£±£°a` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£±£°b`); +SELECT `£Ã£±` FROM `£Ô£±£°a` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£±£°b` WHERE `£Ô£±£°a`.`£Ã£±` = `£Ô£±£°b`.`£Ã£±`); +SELECT `£Ã£±` FROM `£Ô£±£°a` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£±£°b` WHERE `£Ô£±£°a`.`£Ã£±` = `£Ô£±£°b`.`£Ã£±`); +SELECT `£Ã£±` FROM `£Ô£±£±a` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£±£±b`); +SELECT `£Ã£±` FROM `£Ô£±£±a` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£±£±b` WHERE `£Ô£±£±a`.`£Ã£±` = `£Ô£±£±b`.`£Ã£±`); +SELECT `£Ã£±` FROM `£Ô£±£±a` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£±£±b` WHERE `£Ô£±£±a`.`£Ã£±` = `£Ô£±£±b`.`£Ã£±`); +SELECT `£Ã£±` FROM `£Ô£±£²a` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£±£²b`); +SELECT `£Ã£±` FROM `£Ô£±£²a` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£±£²b` WHERE `£Ô£±£²a`.`£Ã£±` = `£Ô£±£²b`.`£Ã£±`); +SELECT `£Ã£±` FROM `£Ô£±£²a` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£±£²b` WHERE `£Ô£±£²a`.`£Ã£±` = `£Ô£±£²b`.`£Ã£±`); + +DROP TABLE `£Ô£±a`; +DROP TABLE `£Ô£±b`; +DROP TABLE `£Ô£²a`; +DROP TABLE `£Ô£²b`; +DROP TABLE `£Ô£³a`; +DROP TABLE `£Ô£³b`; +DROP TABLE `£Ô£´a`; +DROP TABLE `£Ô£´b`; +DROP TABLE `£Ô£µa`; +DROP TABLE `£Ô£µb`; +DROP TABLE `£Ô£¶a`; +DROP TABLE `£Ô£¶b`; +DROP TABLE `£Ô£·a`; +DROP TABLE `£Ô£·b`; +DROP TABLE `£Ô£¸a`; +DROP TABLE `£Ô£¸b`; +DROP TABLE `£Ô£¹a`; +DROP TABLE `£Ô£¹b`; +DROP TABLE `£Ô£±£°a`; +DROP TABLE `£Ô£±£°b`; +DROP TABLE `£Ô£±£±a`; +DROP TABLE `£Ô£±£±b`; +DROP TABLE `£Ô£±£²a`; +DROP TABLE `£Ô£±£²b`; + From 888b665e6cb0cd8ee3b915c66c683afc4ece1963 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 7 Jan 2005 00:48:38 -0800 Subject: [PATCH 0669/1063] Added test data, test case and test result files for Japanese characters test. I have put the tests into a separate "suite", the first one actually. Currently this can only be run by the Perl version of mysql-test-run that is not quite finished. It should, or at least will, be able to be run with the line ./mysql-test-run.pl --suite=jp --- mysql-test/suite/jp/r/jp_alter_sjis.result | 647 ++++ mysql-test/suite/jp/r/jp_alter_ucs2.result | 648 ++++ mysql-test/suite/jp/r/jp_alter_ujis.result | 647 ++++ mysql-test/suite/jp/r/jp_alter_utf8.result | 647 ++++ .../suite/jp/r/jp_charlength_sjis.result | 146 + .../suite/jp/r/jp_charlength_ucs2.result | 147 + .../suite/jp/r/jp_charlength_ujis.result | 146 + .../suite/jp/r/jp_charlength_utf8.result | 146 + mysql-test/suite/jp/r/jp_charset_sjis.result | 230 ++ mysql-test/suite/jp/r/jp_charset_ucs2.result | 306 ++ mysql-test/suite/jp/r/jp_charset_ujis.result | 230 ++ mysql-test/suite/jp/r/jp_charset_utf8.result | 230 ++ mysql-test/suite/jp/r/jp_convert_sjis.result | 1046 +++++++ mysql-test/suite/jp/r/jp_convert_ucs2.result | 427 +++ mysql-test/suite/jp/r/jp_convert_ujis.result | 1514 +++++++++ mysql-test/suite/jp/r/jp_convert_utf8.result | 1514 +++++++++ .../suite/jp/r/jp_create_db_sjis.result | 21 + .../suite/jp/r/jp_create_db_ucs2.result | 22 + .../suite/jp/r/jp_create_db_ujis.result | 21 + .../suite/jp/r/jp_create_db_utf8.result | 21 + .../suite/jp/r/jp_create_tbl_sjis.result | 641 ++++ .../suite/jp/r/jp_create_tbl_ucs2.result | 641 ++++ .../suite/jp/r/jp_create_tbl_ujis.result | 641 ++++ .../suite/jp/r/jp_create_tbl_utf8.result | 641 ++++ mysql-test/suite/jp/r/jp_enum_sjis.result | 362 +++ mysql-test/suite/jp/r/jp_enum_ucs2.result | 219 ++ mysql-test/suite/jp/r/jp_enum_ujis.result | 362 +++ mysql-test/suite/jp/r/jp_enum_utf8.result | 362 +++ mysql-test/suite/jp/r/jp_insert_sjis.result | 905 ++++++ mysql-test/suite/jp/r/jp_insert_ucs2.result | 906 ++++++ mysql-test/suite/jp/r/jp_insert_ujis.result | 906 ++++++ mysql-test/suite/jp/r/jp_insert_utf8.result | 905 ++++++ mysql-test/suite/jp/r/jp_instr_sjis.result | 264 ++ mysql-test/suite/jp/r/jp_instr_ucs2.result | 265 ++ mysql-test/suite/jp/r/jp_instr_ujis.result | 264 ++ mysql-test/suite/jp/r/jp_instr_utf8.result | 264 ++ mysql-test/suite/jp/r/jp_join_sjis.result | 578 ++++ mysql-test/suite/jp/r/jp_join_ucs2.result | 579 ++++ mysql-test/suite/jp/r/jp_join_ujis.result | 578 ++++ mysql-test/suite/jp/r/jp_join_utf8.result | 578 ++++ mysql-test/suite/jp/r/jp_left_sjis.result | 626 ++++ mysql-test/suite/jp/r/jp_left_ucs2.result | 627 ++++ mysql-test/suite/jp/r/jp_left_ujis.result | 626 ++++ mysql-test/suite/jp/r/jp_left_utf8.result | 626 ++++ mysql-test/suite/jp/r/jp_length_sjis.result | 146 + mysql-test/suite/jp/r/jp_length_ucs2.result | 147 + mysql-test/suite/jp/r/jp_length_ujis.result | 146 + mysql-test/suite/jp/r/jp_length_utf8.result | 146 + mysql-test/suite/jp/r/jp_like_sjis.result | 322 ++ mysql-test/suite/jp/r/jp_like_ucs2.result | 419 +++ mysql-test/suite/jp/r/jp_like_ujis.result | 322 ++ mysql-test/suite/jp/r/jp_like_utf8.result | 319 ++ mysql-test/suite/jp/r/jp_locate_sjis.result | 264 ++ mysql-test/suite/jp/r/jp_locate_ucs2.result | 265 ++ mysql-test/suite/jp/r/jp_locate_ujis.result | 264 ++ mysql-test/suite/jp/r/jp_locate_utf8.result | 264 ++ mysql-test/suite/jp/r/jp_lpad_sjis.result | 146 + mysql-test/suite/jp/r/jp_lpad_ucs2.result | 147 + mysql-test/suite/jp/r/jp_lpad_ujis.result | 146 + mysql-test/suite/jp/r/jp_lpad_utf8.result | 146 + mysql-test/suite/jp/r/jp_ltrim_sjis.result | 228 ++ mysql-test/suite/jp/r/jp_ltrim_ucs2.result | 229 ++ mysql-test/suite/jp/r/jp_ltrim_ujis.result | 228 ++ mysql-test/suite/jp/r/jp_ltrim_utf8.result | 228 ++ mysql-test/suite/jp/r/jp_ps_sjis.result | 896 ++++++ mysql-test/suite/jp/r/jp_ps_ujis.result | 896 ++++++ mysql-test/suite/jp/r/jp_replace_sjis.result | 230 ++ mysql-test/suite/jp/r/jp_replace_ucs2.result | 231 ++ mysql-test/suite/jp/r/jp_replace_ujis.result | 230 ++ mysql-test/suite/jp/r/jp_replace_utf8.result | 230 ++ mysql-test/suite/jp/r/jp_reverse_sjis.result | 86 + mysql-test/suite/jp/r/jp_reverse_ucs2.result | 87 + mysql-test/suite/jp/r/jp_reverse_ujis.result | 86 + mysql-test/suite/jp/r/jp_reverse_utf8.result | 86 + mysql-test/suite/jp/r/jp_right_sjis.result | 626 ++++ mysql-test/suite/jp/r/jp_right_ucs2.result | 627 ++++ mysql-test/suite/jp/r/jp_right_ujis.result | 626 ++++ mysql-test/suite/jp/r/jp_right_utf8.result | 626 ++++ mysql-test/suite/jp/r/jp_rpad_sjis.result | 146 + mysql-test/suite/jp/r/jp_rpad_ucs2.result | 147 + mysql-test/suite/jp/r/jp_rpad_ujis.result | 146 + mysql-test/suite/jp/r/jp_rpad_utf8.result | 146 + mysql-test/suite/jp/r/jp_rtrim_sjis.result | 228 ++ mysql-test/suite/jp/r/jp_rtrim_ucs2.result | 229 ++ mysql-test/suite/jp/r/jp_rtrim_ujis.result | 228 ++ mysql-test/suite/jp/r/jp_rtrim_utf8.result | 228 ++ mysql-test/suite/jp/r/jp_select_sjis.result | 382 +++ mysql-test/suite/jp/r/jp_select_ucs2.result | 227 ++ mysql-test/suite/jp/r/jp_select_ujis.result | 538 ++++ mysql-test/suite/jp/r/jp_select_utf8.result | 538 ++++ mysql-test/suite/jp/r/jp_subquery_sjis.result | 206 ++ mysql-test/suite/jp/r/jp_subquery_ucs2.result | 207 ++ mysql-test/suite/jp/r/jp_subquery_ujis.result | 206 ++ mysql-test/suite/jp/r/jp_subquery_utf8.result | 206 ++ .../suite/jp/r/jp_substring_sjis.result | 2738 +++++++++++++++++ .../suite/jp/r/jp_substring_ucs2.result | 1395 +++++++++ .../suite/jp/r/jp_substring_ujis.result | 2738 +++++++++++++++++ .../suite/jp/r/jp_substring_utf8.result | 2738 +++++++++++++++++ mysql-test/suite/jp/r/jp_trim_sjis.result | 672 ++++ mysql-test/suite/jp/r/jp_trim_ucs2.result | 673 ++++ mysql-test/suite/jp/r/jp_trim_ujis.result | 672 ++++ mysql-test/suite/jp/r/jp_trim_utf8.result | 672 ++++ mysql-test/suite/jp/r/jp_union_ujis.result | 422 +++ mysql-test/suite/jp/r/jp_update_sjis.result | 98 + mysql-test/suite/jp/r/jp_update_ucs2.result | 99 + mysql-test/suite/jp/r/jp_update_ujis.result | 98 + mysql-test/suite/jp/r/jp_update_utf8.result | 98 + mysql-test/suite/jp/r/jp_where_sjis.result | 118 + mysql-test/suite/jp/r/jp_where_ucs2.result | 163 + mysql-test/suite/jp/r/jp_where_ujis.result | 86 + mysql-test/suite/jp/r/jp_where_utf8.result | 86 + .../suite/jp/std_data/jisx0201_sjis.dat | 10 + .../suite/jp/std_data/jisx0201_ujis.dat | 10 + .../suite/jp/std_data/jisx0201_utf8.dat | 10 + .../suite/jp/std_data/jisx0208_sjis.dat | 66 + .../suite/jp/std_data/jisx0208_sjis3.dat | 5 + .../suite/jp/std_data/jisx0208_ucs2.dat | Bin 0 -> 2782 bytes .../suite/jp/std_data/jisx0208_ujis.dat | 66 + .../suite/jp/std_data/jisx0208_utf8.dat | 66 + .../suite/jp/std_data/jisx0212_ucs2.dat | Bin 0 -> 1682 bytes .../suite/jp/std_data/jisx0212_ujis.dat | 40 + .../suite/jp/std_data/jisx0212_utf8.dat | 40 + mysql-test/suite/jp/t/jp_alter_sjis.test | 416 +++ mysql-test/suite/jp/t/jp_alter_ucs2.test | 419 +++ mysql-test/suite/jp/t/jp_alter_ujis.test | 418 +++ mysql-test/suite/jp/t/jp_alter_utf8.test | 416 +++ mysql-test/suite/jp/t/jp_charlength_sjis.test | 81 + mysql-test/suite/jp/t/jp_charlength_ucs2.test | 83 + mysql-test/suite/jp/t/jp_charlength_ujis.test | 82 + mysql-test/suite/jp/t/jp_charlength_utf8.test | 80 + mysql-test/suite/jp/t/jp_charset_sjis.test | 133 + mysql-test/suite/jp/t/jp_charset_ucs2.test | 221 ++ mysql-test/suite/jp/t/jp_charset_ujis.test | 135 + mysql-test/suite/jp/t/jp_charset_utf8.test | 133 + mysql-test/suite/jp/t/jp_convert_sjis.test | 110 + mysql-test/suite/jp/t/jp_convert_ucs2.test | 203 ++ mysql-test/suite/jp/t/jp_convert_ujis.test | 115 + mysql-test/suite/jp/t/jp_convert_utf8.test | 113 + mysql-test/suite/jp/t/jp_create_db_sjis.test | 26 + mysql-test/suite/jp/t/jp_create_db_ucs2.test | 29 + mysql-test/suite/jp/t/jp_create_db_ujis.test | 28 + mysql-test/suite/jp/t/jp_create_db_utf8.test | 26 + mysql-test/suite/jp/t/jp_create_tbl_sjis.test | 308 ++ mysql-test/suite/jp/t/jp_create_tbl_ucs2.test | 314 ++ mysql-test/suite/jp/t/jp_create_tbl_ujis.test | 314 ++ mysql-test/suite/jp/t/jp_create_tbl_utf8.test | 312 ++ mysql-test/suite/jp/t/jp_enum_sjis.test | 153 + mysql-test/suite/jp/t/jp_enum_ucs2.test | 149 + mysql-test/suite/jp/t/jp_enum_ujis.test | 144 + mysql-test/suite/jp/t/jp_enum_utf8.test | 142 + mysql-test/suite/jp/t/jp_insert_sjis.test | 354 +++ mysql-test/suite/jp/t/jp_insert_ucs2.test | 356 +++ mysql-test/suite/jp/t/jp_insert_ujis.test | 356 +++ mysql-test/suite/jp/t/jp_insert_utf8.test | 353 +++ mysql-test/suite/jp/t/jp_instr_sjis.test | 139 + mysql-test/suite/jp/t/jp_instr_ucs2.test | 141 + mysql-test/suite/jp/t/jp_instr_ujis.test | 140 + mysql-test/suite/jp/t/jp_instr_utf8.test | 138 + mysql-test/suite/jp/t/jp_join_sjis.test | 218 ++ mysql-test/suite/jp/t/jp_join_ucs2.test | 220 ++ mysql-test/suite/jp/t/jp_join_ujis.test | 219 ++ mysql-test/suite/jp/t/jp_join_utf8.test | 217 ++ mysql-test/suite/jp/t/jp_left_sjis.test | 141 + mysql-test/suite/jp/t/jp_left_ucs2.test | 143 + mysql-test/suite/jp/t/jp_left_ujis.test | 142 + mysql-test/suite/jp/t/jp_left_utf8.test | 140 + mysql-test/suite/jp/t/jp_length_sjis.test | 81 + mysql-test/suite/jp/t/jp_length_ucs2.test | 83 + mysql-test/suite/jp/t/jp_length_ujis.test | 82 + mysql-test/suite/jp/t/jp_length_utf8.test | 80 + mysql-test/suite/jp/t/jp_like_sjis.test | 168 + mysql-test/suite/jp/t/jp_like_ucs2.test | 271 ++ mysql-test/suite/jp/t/jp_like_ujis.test | 170 + mysql-test/suite/jp/t/jp_like_utf8.test | 168 + mysql-test/suite/jp/t/jp_locate_sjis.test | 141 + mysql-test/suite/jp/t/jp_locate_ucs2.test | 144 + mysql-test/suite/jp/t/jp_locate_ujis.test | 143 + mysql-test/suite/jp/t/jp_locate_utf8.test | 141 + mysql-test/suite/jp/t/jp_lpad_sjis.test | 81 + mysql-test/suite/jp/t/jp_lpad_ucs2.test | 83 + mysql-test/suite/jp/t/jp_lpad_ujis.test | 82 + mysql-test/suite/jp/t/jp_lpad_utf8.test | 80 + mysql-test/suite/jp/t/jp_ltrim_sjis.test | 163 + mysql-test/suite/jp/t/jp_ltrim_ucs2.test | 165 + mysql-test/suite/jp/t/jp_ltrim_ujis.test | 164 + mysql-test/suite/jp/t/jp_ltrim_utf8.test | 162 + mysql-test/suite/jp/t/jp_ps_sjis.test | 454 +++ mysql-test/suite/jp/t/jp_ps_ujis.test | 455 +++ mysql-test/suite/jp/t/jp_replace_sjis.test | 129 + mysql-test/suite/jp/t/jp_replace_ucs2.test | 131 + mysql-test/suite/jp/t/jp_replace_ujis.test | 130 + mysql-test/suite/jp/t/jp_replace_utf8.test | 128 + mysql-test/suite/jp/t/jp_reverse_sjis.test | 81 + mysql-test/suite/jp/t/jp_reverse_ucs2.test | 83 + mysql-test/suite/jp/t/jp_reverse_ujis.test | 82 + mysql-test/suite/jp/t/jp_reverse_utf8.test | 80 + mysql-test/suite/jp/t/jp_right_sjis.test | 141 + mysql-test/suite/jp/t/jp_right_ucs2.test | 143 + mysql-test/suite/jp/t/jp_right_ujis.test | 142 + mysql-test/suite/jp/t/jp_right_utf8.test | 140 + mysql-test/suite/jp/t/jp_rpad_sjis.test | 81 + mysql-test/suite/jp/t/jp_rpad_ucs2.test | 83 + mysql-test/suite/jp/t/jp_rpad_ujis.test | 82 + mysql-test/suite/jp/t/jp_rpad_utf8.test | 80 + mysql-test/suite/jp/t/jp_rtrim_sjis.test | 163 + mysql-test/suite/jp/t/jp_rtrim_ucs2.test | 165 + mysql-test/suite/jp/t/jp_rtrim_ujis.test | 164 + mysql-test/suite/jp/t/jp_rtrim_utf8.test | 162 + mysql-test/suite/jp/t/jp_select_sjis.test | 83 + mysql-test/suite/jp/t/jp_select_ucs2.test | 172 ++ mysql-test/suite/jp/t/jp_select_ujis.test | 84 + mysql-test/suite/jp/t/jp_select_utf8.test | 82 + mysql-test/suite/jp/t/jp_subquery_sjis.test | 140 + mysql-test/suite/jp/t/jp_subquery_utf8.test | 139 + mysql-test/suite/jp/t/jp_substring_sjis.test | 413 +++ mysql-test/suite/jp/t/jp_substring_ucs2.test | 418 +++ mysql-test/suite/jp/t/jp_substring_ujis.test | 414 +++ mysql-test/suite/jp/t/jp_substring_utf8.test | 412 +++ mysql-test/suite/jp/t/jp_trim_sjis.test | 219 ++ mysql-test/suite/jp/t/jp_trim_ucs2.test | 221 ++ mysql-test/suite/jp/t/jp_trim_ujis.test | 220 ++ mysql-test/suite/jp/t/jp_trim_utf8.test | 218 ++ mysql-test/suite/jp/t/jp_union_ujis.test | 129 + mysql-test/suite/jp/t/jp_update_sjis.test | 94 + mysql-test/suite/jp/t/jp_update_ucs2.test | 96 + mysql-test/suite/jp/t/jp_update_ujis.test | 95 + mysql-test/suite/jp/t/jp_update_utf8.test | 93 + mysql-test/suite/jp/t/jp_where_sjis.test | 104 + mysql-test/suite/jp/t/jp_where_ucs2.test | 175 ++ mysql-test/suite/jp/t/jp_where_ujis.test | 87 + mysql-test/suite/jp/t/jp_where_utf8.test | 85 + 231 files changed, 68758 insertions(+) create mode 100755 mysql-test/suite/jp/r/jp_alter_sjis.result create mode 100755 mysql-test/suite/jp/r/jp_alter_ucs2.result create mode 100755 mysql-test/suite/jp/r/jp_alter_ujis.result create mode 100755 mysql-test/suite/jp/r/jp_alter_utf8.result create mode 100755 mysql-test/suite/jp/r/jp_charlength_sjis.result create mode 100755 mysql-test/suite/jp/r/jp_charlength_ucs2.result create mode 100755 mysql-test/suite/jp/r/jp_charlength_ujis.result create mode 100755 mysql-test/suite/jp/r/jp_charlength_utf8.result create mode 100755 mysql-test/suite/jp/r/jp_charset_sjis.result create mode 100755 mysql-test/suite/jp/r/jp_charset_ucs2.result create mode 100755 mysql-test/suite/jp/r/jp_charset_ujis.result create mode 100755 mysql-test/suite/jp/r/jp_charset_utf8.result create mode 100755 mysql-test/suite/jp/r/jp_convert_sjis.result create mode 100755 mysql-test/suite/jp/r/jp_convert_ucs2.result create mode 100755 mysql-test/suite/jp/r/jp_convert_ujis.result create mode 100755 mysql-test/suite/jp/r/jp_convert_utf8.result create mode 100755 mysql-test/suite/jp/r/jp_create_db_sjis.result create mode 100755 mysql-test/suite/jp/r/jp_create_db_ucs2.result create mode 100755 mysql-test/suite/jp/r/jp_create_db_ujis.result create mode 100755 mysql-test/suite/jp/r/jp_create_db_utf8.result create mode 100755 mysql-test/suite/jp/r/jp_create_tbl_sjis.result create mode 100755 mysql-test/suite/jp/r/jp_create_tbl_ucs2.result create mode 100755 mysql-test/suite/jp/r/jp_create_tbl_ujis.result create mode 100755 mysql-test/suite/jp/r/jp_create_tbl_utf8.result create mode 100755 mysql-test/suite/jp/r/jp_enum_sjis.result create mode 100755 mysql-test/suite/jp/r/jp_enum_ucs2.result create mode 100755 mysql-test/suite/jp/r/jp_enum_ujis.result create mode 100755 mysql-test/suite/jp/r/jp_enum_utf8.result create mode 100755 mysql-test/suite/jp/r/jp_insert_sjis.result create mode 100755 mysql-test/suite/jp/r/jp_insert_ucs2.result create mode 100755 mysql-test/suite/jp/r/jp_insert_ujis.result create mode 100755 mysql-test/suite/jp/r/jp_insert_utf8.result create mode 100755 mysql-test/suite/jp/r/jp_instr_sjis.result create mode 100755 mysql-test/suite/jp/r/jp_instr_ucs2.result create mode 100755 mysql-test/suite/jp/r/jp_instr_ujis.result create mode 100755 mysql-test/suite/jp/r/jp_instr_utf8.result create mode 100755 mysql-test/suite/jp/r/jp_join_sjis.result create mode 100755 mysql-test/suite/jp/r/jp_join_ucs2.result create mode 100755 mysql-test/suite/jp/r/jp_join_ujis.result create mode 100755 mysql-test/suite/jp/r/jp_join_utf8.result create mode 100755 mysql-test/suite/jp/r/jp_left_sjis.result create mode 100755 mysql-test/suite/jp/r/jp_left_ucs2.result create mode 100755 mysql-test/suite/jp/r/jp_left_ujis.result create mode 100755 mysql-test/suite/jp/r/jp_left_utf8.result create mode 100755 mysql-test/suite/jp/r/jp_length_sjis.result create mode 100755 mysql-test/suite/jp/r/jp_length_ucs2.result create mode 100755 mysql-test/suite/jp/r/jp_length_ujis.result create mode 100755 mysql-test/suite/jp/r/jp_length_utf8.result create mode 100755 mysql-test/suite/jp/r/jp_like_sjis.result create mode 100755 mysql-test/suite/jp/r/jp_like_ucs2.result create mode 100755 mysql-test/suite/jp/r/jp_like_ujis.result create mode 100755 mysql-test/suite/jp/r/jp_like_utf8.result create mode 100755 mysql-test/suite/jp/r/jp_locate_sjis.result create mode 100755 mysql-test/suite/jp/r/jp_locate_ucs2.result create mode 100755 mysql-test/suite/jp/r/jp_locate_ujis.result create mode 100755 mysql-test/suite/jp/r/jp_locate_utf8.result create mode 100755 mysql-test/suite/jp/r/jp_lpad_sjis.result create mode 100755 mysql-test/suite/jp/r/jp_lpad_ucs2.result create mode 100755 mysql-test/suite/jp/r/jp_lpad_ujis.result create mode 100755 mysql-test/suite/jp/r/jp_lpad_utf8.result create mode 100755 mysql-test/suite/jp/r/jp_ltrim_sjis.result create mode 100755 mysql-test/suite/jp/r/jp_ltrim_ucs2.result create mode 100755 mysql-test/suite/jp/r/jp_ltrim_ujis.result create mode 100755 mysql-test/suite/jp/r/jp_ltrim_utf8.result create mode 100755 mysql-test/suite/jp/r/jp_ps_sjis.result create mode 100755 mysql-test/suite/jp/r/jp_ps_ujis.result create mode 100755 mysql-test/suite/jp/r/jp_replace_sjis.result create mode 100755 mysql-test/suite/jp/r/jp_replace_ucs2.result create mode 100755 mysql-test/suite/jp/r/jp_replace_ujis.result create mode 100755 mysql-test/suite/jp/r/jp_replace_utf8.result create mode 100755 mysql-test/suite/jp/r/jp_reverse_sjis.result create mode 100755 mysql-test/suite/jp/r/jp_reverse_ucs2.result create mode 100755 mysql-test/suite/jp/r/jp_reverse_ujis.result create mode 100755 mysql-test/suite/jp/r/jp_reverse_utf8.result create mode 100755 mysql-test/suite/jp/r/jp_right_sjis.result create mode 100755 mysql-test/suite/jp/r/jp_right_ucs2.result create mode 100755 mysql-test/suite/jp/r/jp_right_ujis.result create mode 100755 mysql-test/suite/jp/r/jp_right_utf8.result create mode 100755 mysql-test/suite/jp/r/jp_rpad_sjis.result create mode 100755 mysql-test/suite/jp/r/jp_rpad_ucs2.result create mode 100755 mysql-test/suite/jp/r/jp_rpad_ujis.result create mode 100755 mysql-test/suite/jp/r/jp_rpad_utf8.result create mode 100755 mysql-test/suite/jp/r/jp_rtrim_sjis.result create mode 100755 mysql-test/suite/jp/r/jp_rtrim_ucs2.result create mode 100755 mysql-test/suite/jp/r/jp_rtrim_ujis.result create mode 100755 mysql-test/suite/jp/r/jp_rtrim_utf8.result create mode 100755 mysql-test/suite/jp/r/jp_select_sjis.result create mode 100755 mysql-test/suite/jp/r/jp_select_ucs2.result create mode 100755 mysql-test/suite/jp/r/jp_select_ujis.result create mode 100755 mysql-test/suite/jp/r/jp_select_utf8.result create mode 100755 mysql-test/suite/jp/r/jp_subquery_sjis.result create mode 100755 mysql-test/suite/jp/r/jp_subquery_ucs2.result create mode 100755 mysql-test/suite/jp/r/jp_subquery_ujis.result create mode 100755 mysql-test/suite/jp/r/jp_subquery_utf8.result create mode 100755 mysql-test/suite/jp/r/jp_substring_sjis.result create mode 100755 mysql-test/suite/jp/r/jp_substring_ucs2.result create mode 100755 mysql-test/suite/jp/r/jp_substring_ujis.result create mode 100755 mysql-test/suite/jp/r/jp_substring_utf8.result create mode 100755 mysql-test/suite/jp/r/jp_trim_sjis.result create mode 100755 mysql-test/suite/jp/r/jp_trim_ucs2.result create mode 100755 mysql-test/suite/jp/r/jp_trim_ujis.result create mode 100755 mysql-test/suite/jp/r/jp_trim_utf8.result create mode 100755 mysql-test/suite/jp/r/jp_union_ujis.result create mode 100755 mysql-test/suite/jp/r/jp_update_sjis.result create mode 100755 mysql-test/suite/jp/r/jp_update_ucs2.result create mode 100755 mysql-test/suite/jp/r/jp_update_ujis.result create mode 100755 mysql-test/suite/jp/r/jp_update_utf8.result create mode 100755 mysql-test/suite/jp/r/jp_where_sjis.result create mode 100755 mysql-test/suite/jp/r/jp_where_ucs2.result create mode 100755 mysql-test/suite/jp/r/jp_where_ujis.result create mode 100755 mysql-test/suite/jp/r/jp_where_utf8.result create mode 100755 mysql-test/suite/jp/std_data/jisx0201_sjis.dat create mode 100755 mysql-test/suite/jp/std_data/jisx0201_ujis.dat create mode 100755 mysql-test/suite/jp/std_data/jisx0201_utf8.dat create mode 100755 mysql-test/suite/jp/std_data/jisx0208_sjis.dat create mode 100755 mysql-test/suite/jp/std_data/jisx0208_sjis3.dat create mode 100755 mysql-test/suite/jp/std_data/jisx0208_ucs2.dat create mode 100755 mysql-test/suite/jp/std_data/jisx0208_ujis.dat create mode 100755 mysql-test/suite/jp/std_data/jisx0208_utf8.dat create mode 100755 mysql-test/suite/jp/std_data/jisx0212_ucs2.dat create mode 100755 mysql-test/suite/jp/std_data/jisx0212_ujis.dat create mode 100755 mysql-test/suite/jp/std_data/jisx0212_utf8.dat create mode 100755 mysql-test/suite/jp/t/jp_alter_sjis.test create mode 100755 mysql-test/suite/jp/t/jp_alter_ucs2.test create mode 100755 mysql-test/suite/jp/t/jp_alter_ujis.test create mode 100755 mysql-test/suite/jp/t/jp_alter_utf8.test create mode 100755 mysql-test/suite/jp/t/jp_charlength_sjis.test create mode 100755 mysql-test/suite/jp/t/jp_charlength_ucs2.test create mode 100755 mysql-test/suite/jp/t/jp_charlength_ujis.test create mode 100755 mysql-test/suite/jp/t/jp_charlength_utf8.test create mode 100755 mysql-test/suite/jp/t/jp_charset_sjis.test create mode 100755 mysql-test/suite/jp/t/jp_charset_ucs2.test create mode 100755 mysql-test/suite/jp/t/jp_charset_ujis.test create mode 100755 mysql-test/suite/jp/t/jp_charset_utf8.test create mode 100755 mysql-test/suite/jp/t/jp_convert_sjis.test create mode 100755 mysql-test/suite/jp/t/jp_convert_ucs2.test create mode 100755 mysql-test/suite/jp/t/jp_convert_ujis.test create mode 100755 mysql-test/suite/jp/t/jp_convert_utf8.test create mode 100755 mysql-test/suite/jp/t/jp_create_db_sjis.test create mode 100755 mysql-test/suite/jp/t/jp_create_db_ucs2.test create mode 100755 mysql-test/suite/jp/t/jp_create_db_ujis.test create mode 100755 mysql-test/suite/jp/t/jp_create_db_utf8.test create mode 100755 mysql-test/suite/jp/t/jp_create_tbl_sjis.test create mode 100755 mysql-test/suite/jp/t/jp_create_tbl_ucs2.test create mode 100755 mysql-test/suite/jp/t/jp_create_tbl_ujis.test create mode 100755 mysql-test/suite/jp/t/jp_create_tbl_utf8.test create mode 100755 mysql-test/suite/jp/t/jp_enum_sjis.test create mode 100755 mysql-test/suite/jp/t/jp_enum_ucs2.test create mode 100755 mysql-test/suite/jp/t/jp_enum_ujis.test create mode 100755 mysql-test/suite/jp/t/jp_enum_utf8.test create mode 100755 mysql-test/suite/jp/t/jp_insert_sjis.test create mode 100755 mysql-test/suite/jp/t/jp_insert_ucs2.test create mode 100755 mysql-test/suite/jp/t/jp_insert_ujis.test create mode 100755 mysql-test/suite/jp/t/jp_insert_utf8.test create mode 100755 mysql-test/suite/jp/t/jp_instr_sjis.test create mode 100755 mysql-test/suite/jp/t/jp_instr_ucs2.test create mode 100755 mysql-test/suite/jp/t/jp_instr_ujis.test create mode 100755 mysql-test/suite/jp/t/jp_instr_utf8.test create mode 100755 mysql-test/suite/jp/t/jp_join_sjis.test create mode 100755 mysql-test/suite/jp/t/jp_join_ucs2.test create mode 100755 mysql-test/suite/jp/t/jp_join_ujis.test create mode 100755 mysql-test/suite/jp/t/jp_join_utf8.test create mode 100755 mysql-test/suite/jp/t/jp_left_sjis.test create mode 100755 mysql-test/suite/jp/t/jp_left_ucs2.test create mode 100755 mysql-test/suite/jp/t/jp_left_ujis.test create mode 100755 mysql-test/suite/jp/t/jp_left_utf8.test create mode 100755 mysql-test/suite/jp/t/jp_length_sjis.test create mode 100755 mysql-test/suite/jp/t/jp_length_ucs2.test create mode 100755 mysql-test/suite/jp/t/jp_length_ujis.test create mode 100755 mysql-test/suite/jp/t/jp_length_utf8.test create mode 100755 mysql-test/suite/jp/t/jp_like_sjis.test create mode 100755 mysql-test/suite/jp/t/jp_like_ucs2.test create mode 100755 mysql-test/suite/jp/t/jp_like_ujis.test create mode 100755 mysql-test/suite/jp/t/jp_like_utf8.test create mode 100755 mysql-test/suite/jp/t/jp_locate_sjis.test create mode 100755 mysql-test/suite/jp/t/jp_locate_ucs2.test create mode 100755 mysql-test/suite/jp/t/jp_locate_ujis.test create mode 100755 mysql-test/suite/jp/t/jp_locate_utf8.test create mode 100755 mysql-test/suite/jp/t/jp_lpad_sjis.test create mode 100755 mysql-test/suite/jp/t/jp_lpad_ucs2.test create mode 100755 mysql-test/suite/jp/t/jp_lpad_ujis.test create mode 100755 mysql-test/suite/jp/t/jp_lpad_utf8.test create mode 100755 mysql-test/suite/jp/t/jp_ltrim_sjis.test create mode 100755 mysql-test/suite/jp/t/jp_ltrim_ucs2.test create mode 100755 mysql-test/suite/jp/t/jp_ltrim_ujis.test create mode 100755 mysql-test/suite/jp/t/jp_ltrim_utf8.test create mode 100755 mysql-test/suite/jp/t/jp_ps_sjis.test create mode 100755 mysql-test/suite/jp/t/jp_ps_ujis.test create mode 100755 mysql-test/suite/jp/t/jp_replace_sjis.test create mode 100755 mysql-test/suite/jp/t/jp_replace_ucs2.test create mode 100755 mysql-test/suite/jp/t/jp_replace_ujis.test create mode 100755 mysql-test/suite/jp/t/jp_replace_utf8.test create mode 100755 mysql-test/suite/jp/t/jp_reverse_sjis.test create mode 100755 mysql-test/suite/jp/t/jp_reverse_ucs2.test create mode 100755 mysql-test/suite/jp/t/jp_reverse_ujis.test create mode 100755 mysql-test/suite/jp/t/jp_reverse_utf8.test create mode 100755 mysql-test/suite/jp/t/jp_right_sjis.test create mode 100755 mysql-test/suite/jp/t/jp_right_ucs2.test create mode 100755 mysql-test/suite/jp/t/jp_right_ujis.test create mode 100755 mysql-test/suite/jp/t/jp_right_utf8.test create mode 100755 mysql-test/suite/jp/t/jp_rpad_sjis.test create mode 100755 mysql-test/suite/jp/t/jp_rpad_ucs2.test create mode 100755 mysql-test/suite/jp/t/jp_rpad_ujis.test create mode 100755 mysql-test/suite/jp/t/jp_rpad_utf8.test create mode 100755 mysql-test/suite/jp/t/jp_rtrim_sjis.test create mode 100755 mysql-test/suite/jp/t/jp_rtrim_ucs2.test create mode 100755 mysql-test/suite/jp/t/jp_rtrim_ujis.test create mode 100755 mysql-test/suite/jp/t/jp_rtrim_utf8.test create mode 100755 mysql-test/suite/jp/t/jp_select_sjis.test create mode 100755 mysql-test/suite/jp/t/jp_select_ucs2.test create mode 100755 mysql-test/suite/jp/t/jp_select_ujis.test create mode 100755 mysql-test/suite/jp/t/jp_select_utf8.test create mode 100755 mysql-test/suite/jp/t/jp_subquery_sjis.test create mode 100755 mysql-test/suite/jp/t/jp_subquery_utf8.test create mode 100755 mysql-test/suite/jp/t/jp_substring_sjis.test create mode 100755 mysql-test/suite/jp/t/jp_substring_ucs2.test create mode 100755 mysql-test/suite/jp/t/jp_substring_ujis.test create mode 100755 mysql-test/suite/jp/t/jp_substring_utf8.test create mode 100755 mysql-test/suite/jp/t/jp_trim_sjis.test create mode 100755 mysql-test/suite/jp/t/jp_trim_ucs2.test create mode 100755 mysql-test/suite/jp/t/jp_trim_ujis.test create mode 100755 mysql-test/suite/jp/t/jp_trim_utf8.test create mode 100755 mysql-test/suite/jp/t/jp_union_ujis.test create mode 100755 mysql-test/suite/jp/t/jp_update_sjis.test create mode 100755 mysql-test/suite/jp/t/jp_update_ucs2.test create mode 100755 mysql-test/suite/jp/t/jp_update_ujis.test create mode 100755 mysql-test/suite/jp/t/jp_update_utf8.test create mode 100755 mysql-test/suite/jp/t/jp_where_sjis.test create mode 100755 mysql-test/suite/jp/t/jp_where_ucs2.test create mode 100755 mysql-test/suite/jp/t/jp_where_ujis.test create mode 100755 mysql-test/suite/jp/t/jp_where_utf8.test diff --git a/mysql-test/suite/jp/r/jp_alter_sjis.result b/mysql-test/suite/jp/r/jp_alter_sjis.result new file mode 100755 index 00000000000..f970508229a --- /dev/null +++ b/mysql-test/suite/jp/r/jp_alter_sjis.result @@ -0,0 +1,647 @@ +SET NAMES sjis; +SET character_set_database = sjis; +DROP TABLE IF EXISTS `±±±`; +DROP TABLE IF EXISTS `²²²`; +DROP TABLE IF EXISTS `‚ ‚ ‚ `; +DROP TABLE IF EXISTS `‚¢‚¢‚¢`; +DROP TABLE IF EXISTS `ƒ\ƒ\ƒ\`; +DROP TABLE IF EXISTS `\\\`; +CREATE TABLE `±±±`(`···` char(5)) DEFAULT CHARSET = sjis engine=INNODB; +CREATE TABLE `²²²`(`¹¹¹` char(5)) DEFAULT CHARSET = sjis engine=INNODB; +CREATE TABLE `‚ ‚ ‚ `(`‚«‚«‚«` char(5)) DEFAULT CHARSET = sjis engine=INNODB; +CREATE TABLE `‚¢‚¢‚¢`(`‚¯‚¯‚¯` char(5)) DEFAULT CHARSET = sjis engine=INNODB; +CREATE TABLE `ƒ\ƒ\ƒ\`(`•\•\•\` char(5)) DEFAULT CHARSET = sjis engine=INNODB; +CREATE TABLE `\\\`(`—\—\—\` char(5)) DEFAULT CHARSET = sjis engine=INNODB; +INSERT INTO `±±±` VALUES ('±±±±±'),('²²²²²'),('³³³³³'); +INSERT INTO `‚ ‚ ‚ ` VALUES ('‚ ‚ ‚ ‚ ‚ '),('‚¢‚¢‚¢‚¢‚¢'),('‚¤‚¤‚¤‚¤‚¤'); +INSERT INTO `ƒ\ƒ\ƒ\` VALUES ('•\•\•\•\•\'),('\\\\\'),('”\”\”\”\”\'); +ALTER TABLE `±±±` ADD `¶¶¶` char(1) FIRST; +ALTER TABLE `±±±` ADD `¸¸¸` char(1) AFTER `···`; +ALTER TABLE `±±±` ADD `¹¹¹` char(1); +ALTER TABLE `±±±` ADD INDEX (`¶¶¶`); +ALTER TABLE `±±±` ADD PRIMARY KEY (`···`); +ALTER TABLE `±±±` ADD UNIQUE (`¸¸¸`); +ALTER TABLE `±±±` CHANGE `¶¶¶` `¶¶` char(1); +ALTER TABLE `±±±` MODIFY `···` char(6); +SELECT * FROM `±±±`; +¶¶ ··· ¸¸¸ ¹¹¹ +NULL ±±±±± NULL NULL +NULL ²²²²² NULL NULL +NULL ³³³³³ NULL NULL +DESC `±±±`; +Field Type Null Key Default Extra +¶¶ char(1) YES MUL NULL +··· char(6) PRI +¸¸¸ char(1) YES MUL NULL +¹¹¹ char(1) YES NULL +SHOW CREATE TABLE `±±±`; +Table Create Table +±±± CREATE TABLE `±±±` ( + `¶¶` char(1) default NULL, + `···` char(6) NOT NULL default '', + `¸¸¸` char(1) default NULL, + `¹¹¹` char(1) default NULL, + PRIMARY KEY (`···`), + UNIQUE KEY `¸¸¸` (`¸¸¸`), + KEY `¶¶¶` (`¶¶`) +) ENGINE=InnoDB DEFAULT CHARSET=sjis +ALTER TABLE `±±±` DROP INDEX `¶¶¶`; +ALTER TABLE `±±±` DROP PRIMARY KEY; +ALTER TABLE `±±±` DROP INDEX `¸¸¸`; +ALTER TABLE `±±±` DROP `¶¶`; +ALTER TABLE `±±±` DROP `¸¸¸`; +ALTER TABLE `±±±` DROP `¹¹¹`; +SELECT * FROM `±±±`; +··· +±±±±± +²²²²² +³³³³³ +DESC `±±±`; +Field Type Null Key Default Extra +··· char(6) +SHOW CREATE TABLE `±±±`; +Table Create Table +±±± CREATE TABLE `±±±` ( + `···` char(6) NOT NULL default '' +) ENGINE=InnoDB DEFAULT CHARSET=sjis +ALTER TABLE `‚ ‚ ‚ ` ADD `‚©‚©‚©` char(1) FIRST; +ALTER TABLE `‚ ‚ ‚ ` ADD `‚­‚­‚­` char(1) AFTER `‚«‚«‚«`; +ALTER TABLE `‚ ‚ ‚ ` ADD `‚¯‚¯‚¯` char(1); +ALTER TABLE `‚ ‚ ‚ ` ADD INDEX (`‚©‚©‚©`); +ALTER TABLE `‚ ‚ ‚ ` ADD PRIMARY KEY (`‚«‚«‚«`); +ALTER TABLE `‚ ‚ ‚ ` ADD UNIQUE (`‚­‚­‚­`); +ALTER TABLE `‚ ‚ ‚ ` CHANGE `‚©‚©‚©` `‚©‚©` char(1); +ALTER TABLE `‚ ‚ ‚ ` MODIFY `‚«‚«‚«` char(6); +SELECT * FROM `‚ ‚ ‚ `; +‚©‚© ‚«‚«‚« ‚­‚­‚­ ‚¯‚¯‚¯ +NULL ‚ ‚ ‚ ‚ ‚  NULL NULL +NULL ‚¢‚¢‚¢‚¢‚¢ NULL NULL +NULL ‚¤‚¤‚¤‚¤‚¤ NULL NULL +DESC `‚ ‚ ‚ `; +Field Type Null Key Default Extra +‚©‚© char(1) YES MUL NULL +‚«‚«‚« char(6) PRI +‚­‚­‚­ char(1) YES MUL NULL +‚¯‚¯‚¯ char(1) YES NULL +SHOW CREATE TABLE `‚ ‚ ‚ `; +Table Create Table +‚ ‚ ‚  CREATE TABLE `‚ ‚ ‚ ` ( + `‚©‚©` char(1) default NULL, + `‚«‚«‚«` char(6) NOT NULL default '', + `‚­‚­‚­` char(1) default NULL, + `‚¯‚¯‚¯` char(1) default NULL, + PRIMARY KEY (`‚«‚«‚«`), + UNIQUE KEY `‚­‚­‚­` (`‚­‚­‚­`), + KEY `‚©‚©‚©` (`‚©‚©`) +) ENGINE=InnoDB DEFAULT CHARSET=sjis +ALTER TABLE `‚ ‚ ‚ ` DROP INDEX `‚©‚©‚©`; +ALTER TABLE `‚ ‚ ‚ ` DROP PRIMARY KEY; +ALTER TABLE `‚ ‚ ‚ ` DROP INDEX `‚­‚­‚­`; +ALTER TABLE `‚ ‚ ‚ ` DROP `‚©‚©`; +ALTER TABLE `‚ ‚ ‚ ` DROP `‚­‚­‚­`; +ALTER TABLE `‚ ‚ ‚ ` DROP `‚¯‚¯‚¯`; +SELECT * FROM `‚ ‚ ‚ `; +‚«‚«‚« +‚ ‚ ‚ ‚ ‚  +‚¢‚¢‚¢‚¢‚¢ +‚¤‚¤‚¤‚¤‚¤ +DESC `‚ ‚ ‚ `; +Field Type Null Key Default Extra +‚«‚«‚« char(6) +SHOW CREATE TABLE `‚ ‚ ‚ `; +Table Create Table +‚ ‚ ‚  CREATE TABLE `‚ ‚ ‚ ` ( + `‚«‚«‚«` char(6) NOT NULL default '' +) ENGINE=InnoDB DEFAULT CHARSET=sjis +ALTER TABLE `ƒ\ƒ\ƒ\` ADD `\\\` char(1) FIRST; +ALTER TABLE `ƒ\ƒ\ƒ\` ADD `”\”\”\` char(1) AFTER `•\•\•\`; +ALTER TABLE `ƒ\ƒ\ƒ\` ADD `—\—\—\` char(1); +ALTER TABLE `ƒ\ƒ\ƒ\` ADD INDEX (`\\\`); +ALTER TABLE `ƒ\ƒ\ƒ\` ADD PRIMARY KEY (`•\•\•\`); +ALTER TABLE `ƒ\ƒ\ƒ\` ADD UNIQUE (`”\”\”\`); +ALTER TABLE `ƒ\ƒ\ƒ\` CHANGE `\\\` `\\` char(1); +ALTER TABLE `ƒ\ƒ\ƒ\` MODIFY `•\•\•\` char(6); +SELECT * FROM `ƒ\ƒ\ƒ\`; +\\ •\•\•\ ”\”\”\ —\—\—\ +NULL \\\\\ NULL NULL +NULL ”\”\”\”\”\ NULL NULL +NULL •\•\•\•\•\ NULL NULL +DESC `ƒ\ƒ\ƒ\`; +Field Type Null Key Default Extra +\\ char(1) YES MUL NULL +•\•\•\ char(6) PRI +”\”\”\ char(1) YES MUL NULL +—\—\—\ char(1) YES NULL +SHOW CREATE TABLE `ƒ\ƒ\ƒ\`; +Table Create Table +ƒ\ƒ\ƒ\ CREATE TABLE `ƒ\ƒ\ƒ\` ( + `\\` char(1) default NULL, + `•\•\•\` char(6) NOT NULL default '', + `”\”\”\` char(1) default NULL, + `—\—\—\` char(1) default NULL, + PRIMARY KEY (`•\•\•\`), + UNIQUE KEY `”\”\”\` (`”\”\”\`), + KEY `\\\` (`\\`) +) ENGINE=InnoDB DEFAULT CHARSET=sjis +ALTER TABLE `ƒ\ƒ\ƒ\` DROP INDEX `\\\`; +ALTER TABLE `ƒ\ƒ\ƒ\` DROP PRIMARY KEY; +ALTER TABLE `ƒ\ƒ\ƒ\` DROP INDEX `”\”\”\`; +ALTER TABLE `ƒ\ƒ\ƒ\` DROP `\\`; +ALTER TABLE `ƒ\ƒ\ƒ\` DROP `”\”\”\`; +ALTER TABLE `ƒ\ƒ\ƒ\` DROP `—\—\—\`; +SELECT * FROM `ƒ\ƒ\ƒ\`; +•\•\•\ +\\\\\ +”\”\”\”\”\ +•\•\•\•\•\ +DESC `ƒ\ƒ\ƒ\`; +Field Type Null Key Default Extra +•\•\•\ char(6) +SHOW CREATE TABLE `ƒ\ƒ\ƒ\`; +Table Create Table +ƒ\ƒ\ƒ\ CREATE TABLE `ƒ\ƒ\ƒ\` ( + `•\•\•\` char(6) NOT NULL default '' +) ENGINE=InnoDB DEFAULT CHARSET=sjis +DROP TABLE `±±±`; +DROP TABLE `²²²`; +DROP TABLE `‚ ‚ ‚ `; +DROP TABLE `‚¢‚¢‚¢`; +DROP TABLE `ƒ\ƒ\ƒ\`; +DROP TABLE `\\\`; +CREATE TABLE `±±±`(`···` char(5)) DEFAULT CHARSET = sjis engine=MYISAM; +CREATE TABLE `²²²`(`¹¹¹` char(5)) DEFAULT CHARSET = sjis engine=MYISAM; +CREATE TABLE `‚ ‚ ‚ `(`‚«‚«‚«` char(5)) DEFAULT CHARSET = sjis engine=MYISAM; +CREATE TABLE `‚¢‚¢‚¢`(`‚¯‚¯‚¯` char(5)) DEFAULT CHARSET = sjis engine=MYISAM; +CREATE TABLE `ƒ\ƒ\ƒ\`(`•\•\•\` char(5)) DEFAULT CHARSET = sjis engine=MYISAM; +CREATE TABLE `\\\`(`—\—\—\` char(5)) DEFAULT CHARSET = sjis engine=MYISAM; +INSERT INTO `±±±` VALUES ('±±±±±'),('²²²²²'),('³³³³³'); +INSERT INTO `‚ ‚ ‚ ` VALUES ('‚ ‚ ‚ ‚ ‚ '),('‚¢‚¢‚¢‚¢‚¢'),('‚¤‚¤‚¤‚¤‚¤'); +INSERT INTO `ƒ\ƒ\ƒ\` VALUES ('•\•\•\•\•\'),('\\\\\'),('”\”\”\”\”\'); +ALTER TABLE `±±±` ADD `¶¶¶` char(1) FIRST; +ALTER TABLE `±±±` ADD `¸¸¸` char(1) AFTER `···`; +ALTER TABLE `±±±` ADD `¹¹¹` char(1); +ALTER TABLE `±±±` ADD INDEX (`¶¶¶`); +ALTER TABLE `±±±` ADD PRIMARY KEY (`···`); +ALTER TABLE `±±±` ADD UNIQUE (`¸¸¸`); +ALTER TABLE `±±±` CHANGE `¶¶¶` `¶¶` char(1); +ALTER TABLE `±±±` MODIFY `···` char(6); +SELECT * FROM `±±±`; +¶¶ ··· ¸¸¸ ¹¹¹ +NULL ±±±±± NULL NULL +NULL ²²²²² NULL NULL +NULL ³³³³³ NULL NULL +DESC `±±±`; +Field Type Null Key Default Extra +¶¶ char(1) YES MUL NULL +··· char(6) PRI +¸¸¸ char(1) YES MUL NULL +¹¹¹ char(1) YES NULL +SHOW CREATE TABLE `±±±`; +Table Create Table +±±± CREATE TABLE `±±±` ( + `¶¶` char(1) default NULL, + `···` char(6) NOT NULL default '', + `¸¸¸` char(1) default NULL, + `¹¹¹` char(1) default NULL, + PRIMARY KEY (`···`), + UNIQUE KEY `¸¸¸` (`¸¸¸`), + KEY `¶¶¶` (`¶¶`) +) ENGINE=MyISAM DEFAULT CHARSET=sjis +ALTER TABLE `±±±` DROP INDEX `¶¶¶`; +ALTER TABLE `±±±` DROP PRIMARY KEY; +ALTER TABLE `±±±` DROP INDEX `¸¸¸`; +ALTER TABLE `±±±` DROP `¶¶`; +ALTER TABLE `±±±` DROP `¸¸¸`; +ALTER TABLE `±±±` DROP `¹¹¹`; +SELECT * FROM `±±±`; +··· +±±±±± +²²²²² +³³³³³ +DESC `±±±`; +Field Type Null Key Default Extra +··· char(6) +SHOW CREATE TABLE `±±±`; +Table Create Table +±±± CREATE TABLE `±±±` ( + `···` char(6) NOT NULL default '' +) ENGINE=MyISAM DEFAULT CHARSET=sjis +ALTER TABLE `‚ ‚ ‚ ` ADD `‚©‚©‚©` char(1) FIRST; +ALTER TABLE `‚ ‚ ‚ ` ADD `‚­‚­‚­` char(1) AFTER `‚«‚«‚«`; +ALTER TABLE `‚ ‚ ‚ ` ADD `‚¯‚¯‚¯` char(1); +ALTER TABLE `‚ ‚ ‚ ` ADD INDEX (`‚©‚©‚©`); +ALTER TABLE `‚ ‚ ‚ ` ADD PRIMARY KEY (`‚«‚«‚«`); +ALTER TABLE `‚ ‚ ‚ ` ADD UNIQUE (`‚­‚­‚­`); +ALTER TABLE `‚ ‚ ‚ ` CHANGE `‚©‚©‚©` `‚©‚©` char(1); +ALTER TABLE `‚ ‚ ‚ ` MODIFY `‚«‚«‚«` char(6); +SELECT * FROM `‚ ‚ ‚ `; +‚©‚© ‚«‚«‚« ‚­‚­‚­ ‚¯‚¯‚¯ +NULL ‚ ‚ ‚ ‚ ‚  NULL NULL +NULL ‚¢‚¢‚¢‚¢‚¢ NULL NULL +NULL ‚¤‚¤‚¤‚¤‚¤ NULL NULL +DESC `‚ ‚ ‚ `; +Field Type Null Key Default Extra +‚©‚© char(1) YES MUL NULL +‚«‚«‚« char(6) PRI +‚­‚­‚­ char(1) YES MUL NULL +‚¯‚¯‚¯ char(1) YES NULL +SHOW CREATE TABLE `‚ ‚ ‚ `; +Table Create Table +‚ ‚ ‚  CREATE TABLE `‚ ‚ ‚ ` ( + `‚©‚©` char(1) default NULL, + `‚«‚«‚«` char(6) NOT NULL default '', + `‚­‚­‚­` char(1) default NULL, + `‚¯‚¯‚¯` char(1) default NULL, + PRIMARY KEY (`‚«‚«‚«`), + UNIQUE KEY `‚­‚­‚­` (`‚­‚­‚­`), + KEY `‚©‚©‚©` (`‚©‚©`) +) ENGINE=MyISAM DEFAULT CHARSET=sjis +ALTER TABLE `‚ ‚ ‚ ` DROP INDEX `‚©‚©‚©`; +ALTER TABLE `‚ ‚ ‚ ` DROP PRIMARY KEY; +ALTER TABLE `‚ ‚ ‚ ` DROP INDEX `‚­‚­‚­`; +ALTER TABLE `‚ ‚ ‚ ` DROP `‚©‚©`; +ALTER TABLE `‚ ‚ ‚ ` DROP `‚­‚­‚­`; +ALTER TABLE `‚ ‚ ‚ ` DROP `‚¯‚¯‚¯`; +SELECT * FROM `‚ ‚ ‚ `; +‚«‚«‚« +‚ ‚ ‚ ‚ ‚  +‚¢‚¢‚¢‚¢‚¢ +‚¤‚¤‚¤‚¤‚¤ +DESC `‚ ‚ ‚ `; +Field Type Null Key Default Extra +‚«‚«‚« char(6) +SHOW CREATE TABLE `‚ ‚ ‚ `; +Table Create Table +‚ ‚ ‚  CREATE TABLE `‚ ‚ ‚ ` ( + `‚«‚«‚«` char(6) NOT NULL default '' +) ENGINE=MyISAM DEFAULT CHARSET=sjis +ALTER TABLE `ƒ\ƒ\ƒ\` ADD `\\\` char(1) FIRST; +ALTER TABLE `ƒ\ƒ\ƒ\` ADD `”\”\”\` char(1) AFTER `•\•\•\`; +ALTER TABLE `ƒ\ƒ\ƒ\` ADD `—\—\—\` char(1); +ALTER TABLE `ƒ\ƒ\ƒ\` ADD INDEX (`\\\`); +ALTER TABLE `ƒ\ƒ\ƒ\` ADD PRIMARY KEY (`•\•\•\`); +ALTER TABLE `ƒ\ƒ\ƒ\` ADD UNIQUE (`”\”\”\`); +ALTER TABLE `ƒ\ƒ\ƒ\` CHANGE `\\\` `\\` char(1); +ALTER TABLE `ƒ\ƒ\ƒ\` MODIFY `•\•\•\` char(6); +SELECT * FROM `ƒ\ƒ\ƒ\`; +\\ •\•\•\ ”\”\”\ —\—\—\ +NULL •\•\•\•\•\ NULL NULL +NULL \\\\\ NULL NULL +NULL ”\”\”\”\”\ NULL NULL +DESC `ƒ\ƒ\ƒ\`; +Field Type Null Key Default Extra +\\ char(1) YES MUL NULL +•\•\•\ char(6) PRI +”\”\”\ char(1) YES MUL NULL +—\—\—\ char(1) YES NULL +SHOW CREATE TABLE `ƒ\ƒ\ƒ\`; +Table Create Table +ƒ\ƒ\ƒ\ CREATE TABLE `ƒ\ƒ\ƒ\` ( + `\\` char(1) default NULL, + `•\•\•\` char(6) NOT NULL default '', + `”\”\”\` char(1) default NULL, + `—\—\—\` char(1) default NULL, + PRIMARY KEY (`•\•\•\`), + UNIQUE KEY `”\”\”\` (`”\”\”\`), + KEY `\\\` (`\\`) +) ENGINE=MyISAM DEFAULT CHARSET=sjis +ALTER TABLE `ƒ\ƒ\ƒ\` DROP INDEX `\\\`; +ALTER TABLE `ƒ\ƒ\ƒ\` DROP PRIMARY KEY; +ALTER TABLE `ƒ\ƒ\ƒ\` DROP INDEX `”\”\”\`; +ALTER TABLE `ƒ\ƒ\ƒ\` DROP `\\`; +ALTER TABLE `ƒ\ƒ\ƒ\` DROP `”\”\”\`; +ALTER TABLE `ƒ\ƒ\ƒ\` DROP `—\—\—\`; +SELECT * FROM `ƒ\ƒ\ƒ\`; +•\•\•\ +•\•\•\•\•\ +\\\\\ +”\”\”\”\”\ +DESC `ƒ\ƒ\ƒ\`; +Field Type Null Key Default Extra +•\•\•\ char(6) +SHOW CREATE TABLE `ƒ\ƒ\ƒ\`; +Table Create Table +ƒ\ƒ\ƒ\ CREATE TABLE `ƒ\ƒ\ƒ\` ( + `•\•\•\` char(6) NOT NULL default '' +) ENGINE=MyISAM DEFAULT CHARSET=sjis +DROP TABLE `±±±`; +DROP TABLE `²²²`; +DROP TABLE `‚ ‚ ‚ `; +DROP TABLE `‚¢‚¢‚¢`; +DROP TABLE `ƒ\ƒ\ƒ\`; +DROP TABLE `\\\`; +CREATE TABLE `±±±`(`···` char(5)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TABLE `²²²`(`¹¹¹` char(5)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TABLE `‚ ‚ ‚ `(`‚«‚«‚«` char(5)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TABLE `‚¢‚¢‚¢`(`‚¯‚¯‚¯` char(5)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TABLE `ƒ\ƒ\ƒ\`(`•\•\•\` char(5)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TABLE `\\\`(`—\—\—\` char(5)) DEFAULT CHARSET = sjis engine=HEAP; +INSERT INTO `±±±` VALUES ('±±±±±'),('²²²²²'),('³³³³³'); +INSERT INTO `‚ ‚ ‚ ` VALUES ('‚ ‚ ‚ ‚ ‚ '),('‚¢‚¢‚¢‚¢‚¢'),('‚¤‚¤‚¤‚¤‚¤'); +INSERT INTO `ƒ\ƒ\ƒ\` VALUES ('•\•\•\•\•\'),('\\\\\'),('”\”\”\”\”\'); +ALTER TABLE `±±±` ADD `¶¶¶` char(1) FIRST; +ALTER TABLE `±±±` ADD `¸¸¸` char(1) AFTER `···`; +ALTER TABLE `±±±` ADD `¹¹¹` char(1); +ALTER TABLE `±±±` ADD INDEX (`¶¶¶`); +ALTER TABLE `±±±` ADD PRIMARY KEY (`···`); +ALTER TABLE `±±±` ADD UNIQUE (`¸¸¸`); +ALTER TABLE `±±±` CHANGE `¶¶¶` `¶¶` char(1); +ALTER TABLE `±±±` MODIFY `···` char(6); +SELECT * FROM `±±±`; +¶¶ ··· ¸¸¸ ¹¹¹ +NULL ±±±±± NULL NULL +NULL ²²²²² NULL NULL +NULL ³³³³³ NULL NULL +DESC `±±±`; +Field Type Null Key Default Extra +¶¶ char(1) YES MUL NULL +··· char(6) PRI +¸¸¸ char(1) YES MUL NULL +¹¹¹ char(1) YES NULL +SHOW CREATE TABLE `±±±`; +Table Create Table +±±± CREATE TABLE `±±±` ( + `¶¶` char(1) default NULL, + `···` char(6) NOT NULL default '', + `¸¸¸` char(1) default NULL, + `¹¹¹` char(1) default NULL, + PRIMARY KEY (`···`), + UNIQUE KEY `¸¸¸` (`¸¸¸`), + KEY `¶¶¶` (`¶¶`) +) ENGINE=HEAP DEFAULT CHARSET=sjis +ALTER TABLE `±±±` DROP INDEX `¶¶¶`; +ALTER TABLE `±±±` DROP PRIMARY KEY; +ALTER TABLE `±±±` DROP INDEX `¸¸¸`; +ALTER TABLE `±±±` DROP `¶¶`; +ALTER TABLE `±±±` DROP `¸¸¸`; +ALTER TABLE `±±±` DROP `¹¹¹`; +SELECT * FROM `±±±`; +··· +±±±±± +²²²²² +³³³³³ +DESC `±±±`; +Field Type Null Key Default Extra +··· char(6) +SHOW CREATE TABLE `±±±`; +Table Create Table +±±± CREATE TABLE `±±±` ( + `···` char(6) NOT NULL default '' +) ENGINE=HEAP DEFAULT CHARSET=sjis +ALTER TABLE `‚ ‚ ‚ ` ADD `‚©‚©‚©` char(1) FIRST; +ALTER TABLE `‚ ‚ ‚ ` ADD `‚­‚­‚­` char(1) AFTER `‚«‚«‚«`; +ALTER TABLE `‚ ‚ ‚ ` ADD `‚¯‚¯‚¯` char(1); +ALTER TABLE `‚ ‚ ‚ ` ADD INDEX (`‚©‚©‚©`); +ALTER TABLE `‚ ‚ ‚ ` ADD PRIMARY KEY (`‚«‚«‚«`); +ALTER TABLE `‚ ‚ ‚ ` ADD UNIQUE (`‚­‚­‚­`); +ALTER TABLE `‚ ‚ ‚ ` CHANGE `‚©‚©‚©` `‚©‚©` char(1); +ALTER TABLE `‚ ‚ ‚ ` MODIFY `‚«‚«‚«` char(6); +SELECT * FROM `‚ ‚ ‚ `; +‚©‚© ‚«‚«‚« ‚­‚­‚­ ‚¯‚¯‚¯ +NULL ‚ ‚ ‚ ‚ ‚  NULL NULL +NULL ‚¢‚¢‚¢‚¢‚¢ NULL NULL +NULL ‚¤‚¤‚¤‚¤‚¤ NULL NULL +DESC `‚ ‚ ‚ `; +Field Type Null Key Default Extra +‚©‚© char(1) YES MUL NULL +‚«‚«‚« char(6) PRI +‚­‚­‚­ char(1) YES MUL NULL +‚¯‚¯‚¯ char(1) YES NULL +SHOW CREATE TABLE `‚ ‚ ‚ `; +Table Create Table +‚ ‚ ‚  CREATE TABLE `‚ ‚ ‚ ` ( + `‚©‚©` char(1) default NULL, + `‚«‚«‚«` char(6) NOT NULL default '', + `‚­‚­‚­` char(1) default NULL, + `‚¯‚¯‚¯` char(1) default NULL, + PRIMARY KEY (`‚«‚«‚«`), + UNIQUE KEY `‚­‚­‚­` (`‚­‚­‚­`), + KEY `‚©‚©‚©` (`‚©‚©`) +) ENGINE=HEAP DEFAULT CHARSET=sjis +ALTER TABLE `‚ ‚ ‚ ` DROP INDEX `‚©‚©‚©`; +ALTER TABLE `‚ ‚ ‚ ` DROP PRIMARY KEY; +ALTER TABLE `‚ ‚ ‚ ` DROP INDEX `‚­‚­‚­`; +ALTER TABLE `‚ ‚ ‚ ` DROP `‚©‚©`; +ALTER TABLE `‚ ‚ ‚ ` DROP `‚­‚­‚­`; +ALTER TABLE `‚ ‚ ‚ ` DROP `‚¯‚¯‚¯`; +SELECT * FROM `‚ ‚ ‚ `; +‚«‚«‚« +‚ ‚ ‚ ‚ ‚  +‚¢‚¢‚¢‚¢‚¢ +‚¤‚¤‚¤‚¤‚¤ +DESC `‚ ‚ ‚ `; +Field Type Null Key Default Extra +‚«‚«‚« char(6) +SHOW CREATE TABLE `‚ ‚ ‚ `; +Table Create Table +‚ ‚ ‚  CREATE TABLE `‚ ‚ ‚ ` ( + `‚«‚«‚«` char(6) NOT NULL default '' +) ENGINE=HEAP DEFAULT CHARSET=sjis +ALTER TABLE `ƒ\ƒ\ƒ\` ADD `\\\` char(1) FIRST; +ALTER TABLE `ƒ\ƒ\ƒ\` ADD `”\”\”\` char(1) AFTER `•\•\•\`; +ALTER TABLE `ƒ\ƒ\ƒ\` ADD `—\—\—\` char(1); +ALTER TABLE `ƒ\ƒ\ƒ\` ADD INDEX (`\\\`); +ALTER TABLE `ƒ\ƒ\ƒ\` ADD PRIMARY KEY (`•\•\•\`); +ALTER TABLE `ƒ\ƒ\ƒ\` ADD UNIQUE (`”\”\”\`); +ALTER TABLE `ƒ\ƒ\ƒ\` CHANGE `\\\` `\\` char(1); +ALTER TABLE `ƒ\ƒ\ƒ\` MODIFY `•\•\•\` char(6); +SELECT * FROM `ƒ\ƒ\ƒ\`; +\\ •\•\•\ ”\”\”\ —\—\—\ +NULL •\•\•\•\•\ NULL NULL +NULL \\\\\ NULL NULL +NULL ”\”\”\”\”\ NULL NULL +DESC `ƒ\ƒ\ƒ\`; +Field Type Null Key Default Extra +\\ char(1) YES MUL NULL +•\•\•\ char(6) PRI +”\”\”\ char(1) YES MUL NULL +—\—\—\ char(1) YES NULL +SHOW CREATE TABLE `ƒ\ƒ\ƒ\`; +Table Create Table +ƒ\ƒ\ƒ\ CREATE TABLE `ƒ\ƒ\ƒ\` ( + `\\` char(1) default NULL, + `•\•\•\` char(6) NOT NULL default '', + `”\”\”\` char(1) default NULL, + `—\—\—\` char(1) default NULL, + PRIMARY KEY (`•\•\•\`), + UNIQUE KEY `”\”\”\` (`”\”\”\`), + KEY `\\\` (`\\`) +) ENGINE=HEAP DEFAULT CHARSET=sjis +ALTER TABLE `ƒ\ƒ\ƒ\` DROP INDEX `\\\`; +ALTER TABLE `ƒ\ƒ\ƒ\` DROP PRIMARY KEY; +ALTER TABLE `ƒ\ƒ\ƒ\` DROP INDEX `”\”\”\`; +ALTER TABLE `ƒ\ƒ\ƒ\` DROP `\\`; +ALTER TABLE `ƒ\ƒ\ƒ\` DROP `”\”\”\`; +ALTER TABLE `ƒ\ƒ\ƒ\` DROP `—\—\—\`; +SELECT * FROM `ƒ\ƒ\ƒ\`; +•\•\•\ +•\•\•\•\•\ +\\\\\ +”\”\”\”\”\ +DESC `ƒ\ƒ\ƒ\`; +Field Type Null Key Default Extra +•\•\•\ char(6) +SHOW CREATE TABLE `ƒ\ƒ\ƒ\`; +Table Create Table +ƒ\ƒ\ƒ\ CREATE TABLE `ƒ\ƒ\ƒ\` ( + `•\•\•\` char(6) NOT NULL default '' +) ENGINE=HEAP DEFAULT CHARSET=sjis +DROP TABLE `±±±`; +DROP TABLE `²²²`; +DROP TABLE `‚ ‚ ‚ `; +DROP TABLE `‚¢‚¢‚¢`; +DROP TABLE `ƒ\ƒ\ƒ\`; +DROP TABLE `\\\`; +CREATE TABLE `±±±`(`···` char(5)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TABLE `²²²`(`¹¹¹` char(5)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TABLE `‚ ‚ ‚ `(`‚«‚«‚«` char(5)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TABLE `‚¢‚¢‚¢`(`‚¯‚¯‚¯` char(5)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TABLE `ƒ\ƒ\ƒ\`(`•\•\•\` char(5)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TABLE `\\\`(`—\—\—\` char(5)) DEFAULT CHARSET = sjis engine=BDB; +INSERT INTO `±±±` VALUES ('±±±±±'),('²²²²²'),('³³³³³'); +INSERT INTO `‚ ‚ ‚ ` VALUES ('‚ ‚ ‚ ‚ ‚ '),('‚¢‚¢‚¢‚¢‚¢'),('‚¤‚¤‚¤‚¤‚¤'); +INSERT INTO `ƒ\ƒ\ƒ\` VALUES ('•\•\•\•\•\'),('\\\\\'),('”\”\”\”\”\'); +ALTER TABLE `±±±` ADD `¶¶¶` char(1) FIRST; +ALTER TABLE `±±±` ADD `¸¸¸` char(1) AFTER `···`; +ALTER TABLE `±±±` ADD `¹¹¹` char(1); +ALTER TABLE `±±±` ADD INDEX (`¶¶¶`); +ALTER TABLE `±±±` ADD PRIMARY KEY (`···`); +ALTER TABLE `±±±` CHANGE `¶¶¶` `¶¶` char(1); +ALTER TABLE `±±±` MODIFY `···` char(6); +SELECT * FROM `±±±`; +¶¶ ··· ¸¸¸ ¹¹¹ +NULL ±±±±± NULL NULL +NULL ²²²²² NULL NULL +NULL ³³³³³ NULL NULL +DESC `±±±`; +Field Type Null Key Default Extra +¶¶ char(1) YES MUL NULL +··· char(6) PRI +¸¸¸ char(1) YES NULL +¹¹¹ char(1) YES NULL +SHOW CREATE TABLE `±±±`; +Table Create Table +±±± CREATE TABLE `±±±` ( + `¶¶` char(1) default NULL, + `···` char(6) NOT NULL default '', + `¸¸¸` char(1) default NULL, + `¹¹¹` char(1) default NULL, + PRIMARY KEY (`···`), + KEY `¶¶¶` (`¶¶`) +) ENGINE=BerkeleyDB DEFAULT CHARSET=sjis +ALTER TABLE `±±±` DROP INDEX `¶¶¶`; +ALTER TABLE `±±±` DROP PRIMARY KEY; +ALTER TABLE `±±±` DROP `¶¶`; +ALTER TABLE `±±±` DROP `¸¸¸`; +ALTER TABLE `±±±` DROP `¹¹¹`; +SELECT * FROM `±±±`; +··· +±±±±± +²²²²² +³³³³³ +DESC `±±±`; +Field Type Null Key Default Extra +··· char(6) +SHOW CREATE TABLE `±±±`; +Table Create Table +±±± CREATE TABLE `±±±` ( + `···` char(6) NOT NULL default '' +) ENGINE=BerkeleyDB DEFAULT CHARSET=sjis +ALTER TABLE `‚ ‚ ‚ ` ADD `‚©‚©‚©` char(1) FIRST; +ALTER TABLE `‚ ‚ ‚ ` ADD `‚­‚­‚­` char(1) AFTER `‚«‚«‚«`; +ALTER TABLE `‚ ‚ ‚ ` ADD `‚¯‚¯‚¯` char(1); +ALTER TABLE `‚ ‚ ‚ ` ADD INDEX (`‚©‚©‚©`); +ALTER TABLE `‚ ‚ ‚ ` ADD PRIMARY KEY (`‚«‚«‚«`); +ALTER TABLE `‚ ‚ ‚ ` CHANGE `‚©‚©‚©` `‚©‚©` char(1); +ALTER TABLE `‚ ‚ ‚ ` MODIFY `‚«‚«‚«` char(6); +SELECT * FROM `‚ ‚ ‚ `; +‚©‚© ‚«‚«‚« ‚­‚­‚­ ‚¯‚¯‚¯ +NULL ‚ ‚ ‚ ‚ ‚  NULL NULL +NULL ‚¢‚¢‚¢‚¢‚¢ NULL NULL +NULL ‚¤‚¤‚¤‚¤‚¤ NULL NULL +DESC `‚ ‚ ‚ `; +Field Type Null Key Default Extra +‚©‚© char(1) YES MUL NULL +‚«‚«‚« char(6) PRI +‚­‚­‚­ char(1) YES NULL +‚¯‚¯‚¯ char(1) YES NULL +SHOW CREATE TABLE `‚ ‚ ‚ `; +Table Create Table +‚ ‚ ‚  CREATE TABLE `‚ ‚ ‚ ` ( + `‚©‚©` char(1) default NULL, + `‚«‚«‚«` char(6) NOT NULL default '', + `‚­‚­‚­` char(1) default NULL, + `‚¯‚¯‚¯` char(1) default NULL, + PRIMARY KEY (`‚«‚«‚«`), + KEY `‚©‚©‚©` (`‚©‚©`) +) ENGINE=BerkeleyDB DEFAULT CHARSET=sjis +ALTER TABLE `‚ ‚ ‚ ` DROP INDEX `‚©‚©‚©`; +ALTER TABLE `‚ ‚ ‚ ` DROP PRIMARY KEY; +ALTER TABLE `‚ ‚ ‚ ` DROP `‚©‚©`; +ALTER TABLE `‚ ‚ ‚ ` DROP `‚­‚­‚­`; +ALTER TABLE `‚ ‚ ‚ ` DROP `‚¯‚¯‚¯`; +SELECT * FROM `‚ ‚ ‚ `; +‚«‚«‚« +‚ ‚ ‚ ‚ ‚  +‚¢‚¢‚¢‚¢‚¢ +‚¤‚¤‚¤‚¤‚¤ +DESC `‚ ‚ ‚ `; +Field Type Null Key Default Extra +‚«‚«‚« char(6) +SHOW CREATE TABLE `‚ ‚ ‚ `; +Table Create Table +‚ ‚ ‚  CREATE TABLE `‚ ‚ ‚ ` ( + `‚«‚«‚«` char(6) NOT NULL default '' +) ENGINE=BerkeleyDB DEFAULT CHARSET=sjis +ALTER TABLE `ƒ\ƒ\ƒ\` ADD `\\\` char(1) FIRST; +ALTER TABLE `ƒ\ƒ\ƒ\` ADD `”\”\”\` char(1) AFTER `•\•\•\`; +ALTER TABLE `ƒ\ƒ\ƒ\` ADD `—\—\—\` char(1); +ALTER TABLE `ƒ\ƒ\ƒ\` ADD INDEX (`\\\`); +ALTER TABLE `ƒ\ƒ\ƒ\` ADD PRIMARY KEY (`•\•\•\`); +ALTER TABLE `ƒ\ƒ\ƒ\` CHANGE `\\\` `\\` char(1); +ALTER TABLE `ƒ\ƒ\ƒ\` MODIFY `•\•\•\` char(6); +SELECT * FROM `ƒ\ƒ\ƒ\`; +\\ •\•\•\ ”\”\”\ —\—\—\ +NULL \\\\\ NULL NULL +NULL ”\”\”\”\”\ NULL NULL +NULL •\•\•\•\•\ NULL NULL +DESC `ƒ\ƒ\ƒ\`; +Field Type Null Key Default Extra +\\ char(1) YES MUL NULL +•\•\•\ char(6) PRI +”\”\”\ char(1) YES NULL +—\—\—\ char(1) YES NULL +SHOW CREATE TABLE `ƒ\ƒ\ƒ\`; +Table Create Table +ƒ\ƒ\ƒ\ CREATE TABLE `ƒ\ƒ\ƒ\` ( + `\\` char(1) default NULL, + `•\•\•\` char(6) NOT NULL default '', + `”\”\”\` char(1) default NULL, + `—\—\—\` char(1) default NULL, + PRIMARY KEY (`•\•\•\`), + KEY `\\\` (`\\`) +) ENGINE=BerkeleyDB DEFAULT CHARSET=sjis +ALTER TABLE `ƒ\ƒ\ƒ\` DROP INDEX `\\\`; +ALTER TABLE `ƒ\ƒ\ƒ\` DROP PRIMARY KEY; +ALTER TABLE `ƒ\ƒ\ƒ\` DROP `\\`; +ALTER TABLE `ƒ\ƒ\ƒ\` DROP `”\”\”\`; +ALTER TABLE `ƒ\ƒ\ƒ\` DROP `—\—\—\`; +SELECT * FROM `ƒ\ƒ\ƒ\`; +•\•\•\ +\\\\\ +”\”\”\”\”\ +•\•\•\•\•\ +DESC `ƒ\ƒ\ƒ\`; +Field Type Null Key Default Extra +•\•\•\ char(6) +SHOW CREATE TABLE `ƒ\ƒ\ƒ\`; +Table Create Table +ƒ\ƒ\ƒ\ CREATE TABLE `ƒ\ƒ\ƒ\` ( + `•\•\•\` char(6) NOT NULL default '' +) ENGINE=BerkeleyDB DEFAULT CHARSET=sjis +DROP TABLE `±±±`; +DROP TABLE `²²²`; +DROP TABLE `‚ ‚ ‚ `; +DROP TABLE `‚¢‚¢‚¢`; +DROP TABLE `ƒ\ƒ\ƒ\`; +DROP TABLE `\\\`; diff --git a/mysql-test/suite/jp/r/jp_alter_ucs2.result b/mysql-test/suite/jp/r/jp_alter_ucs2.result new file mode 100755 index 00000000000..2756e5a758d --- /dev/null +++ b/mysql-test/suite/jp/r/jp_alter_ucs2.result @@ -0,0 +1,648 @@ +DROP TABLE IF EXISTS `ޱޱޱ`; +DROP TABLE IF EXISTS `޲޲޲`; +DROP TABLE IF EXISTS `¤¢¤¢¤¢`; +DROP TABLE IF EXISTS `¤¤¤¤¤¤`; +DROP TABLE IF EXISTS `íÝíÝíÝ`; +DROP TABLE IF EXISTS `íÞíÞíÞ`; +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; +CREATE TABLE `ޱޱޱ`(`Ž·Ž·Ž·` char(5)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TABLE `޲޲޲`(`޹޹޹` char(5)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TABLE `¤¢¤¢¤¢`(`¤­¤­¤­` char(5)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TABLE `¤¤¤¤¤¤`(`¤±¤±¤±` char(5)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TABLE `íÝíÝíÝ`(`°¡°¡°¡` char(5)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TABLE `íÞíÞíÞ`(`°´°´°´` char(5)) DEFAULT CHARSET = ucs2 engine=INNODB; +INSERT INTO `ޱޱޱ` VALUES ('ޱޱޱޱޱ'),('޲޲޲޲޲'),('޳޳޳޳޳'); +INSERT INTO `¤¢¤¢¤¢` VALUES ('¤¢¤¢¤¢¤¢¤¢'),('¤¤¤¤¤¤¤¤¤¤'),('¤¦¤¦¤¦¤¦¤¦'); +INSERT INTO `íÝíÝíÝ` VALUES ('°¡°¡°¡°¡°¡'),('°¢°¢°¢°¢°¢'),('°£°£°£°£°£'); +ALTER TABLE `ޱޱޱ` ADD `޶޶޶` char(1) FIRST; +ALTER TABLE `ޱޱޱ` ADD `ޏޏޏ` char(1) AFTER `Ž·Ž·Ž·`; +ALTER TABLE `ޱޱޱ` ADD `޹޹޹` char(1); +ALTER TABLE `ޱޱޱ` ADD INDEX (`޶޶޶`); +ALTER TABLE `ޱޱޱ` ADD PRIMARY KEY (`Ž·Ž·Ž·`); +ALTER TABLE `ޱޱޱ` ADD UNIQUE (`ޏޏޏ`); +ALTER TABLE `ޱޱޱ` CHANGE `޶޶޶` `޶޶` char(1); +ALTER TABLE `ޱޱޱ` MODIFY `Ž·Ž·Ž·` char(6); +SELECT * FROM `ޱޱޱ`; +޶޶ Ž·Ž·Ž· ޏޏޏ ޹޹޹ +NULL ޱޱޱޱޱ NULL NULL +NULL ޲޲޲޲޲ NULL NULL +NULL ޳޳޳޳޳ NULL NULL +DESC `ޱޱޱ`; +Field Type Null Key Default Extra +޶޶ char(1) YES MUL NULL +Ž·Ž·Ž· char(6) PRI +ޏޏޏ char(1) YES MUL NULL +޹޹޹ char(1) YES NULL +SHOW CREATE TABLE `ޱޱޱ`; +Table Create Table +ޱޱޱ CREATE TABLE `ޱޱޱ` ( + `޶޶` char(1) default NULL, + `Ž·Ž·Ž·` char(6) NOT NULL default '', + `ޏޏޏ` char(1) default NULL, + `޹޹޹` char(1) default NULL, + PRIMARY KEY (`Ž·Ž·Ž·`), + UNIQUE KEY `ޏޏޏ` (`ޏޏޏ`), + KEY `޶޶޶` (`޶޶`) +) ENGINE=InnoDB DEFAULT CHARSET=ucs2 +ALTER TABLE `ޱޱޱ` DROP INDEX `޶޶޶`; +ALTER TABLE `ޱޱޱ` DROP PRIMARY KEY; +ALTER TABLE `ޱޱޱ` DROP INDEX `ޏޏޏ`; +ALTER TABLE `ޱޱޱ` DROP `޶޶`; +ALTER TABLE `ޱޱޱ` DROP `ޏޏޏ`; +ALTER TABLE `ޱޱޱ` DROP `޹޹޹`; +SELECT * FROM `ޱޱޱ`; +Ž·Ž·Ž· +ޱޱޱޱޱ +޲޲޲޲޲ +޳޳޳޳޳ +DESC `ޱޱޱ`; +Field Type Null Key Default Extra +Ž·Ž·Ž· char(6) +SHOW CREATE TABLE `ޱޱޱ`; +Table Create Table +ޱޱޱ CREATE TABLE `ޱޱޱ` ( + `Ž·Ž·Ž·` char(6) NOT NULL default '' +) ENGINE=InnoDB DEFAULT CHARSET=ucs2 +ALTER TABLE `¤¢¤¢¤¢` ADD `¤«¤«¤«` char(1) FIRST; +ALTER TABLE `¤¢¤¢¤¢` ADD `¤¯¤¯¤¯` char(1) AFTER `¤­¤­¤­`; +ALTER TABLE `¤¢¤¢¤¢` ADD `¤±¤±¤±` char(1); +ALTER TABLE `¤¢¤¢¤¢` ADD INDEX (`¤«¤«¤«`); +ALTER TABLE `¤¢¤¢¤¢` ADD PRIMARY KEY (`¤­¤­¤­`); +ALTER TABLE `¤¢¤¢¤¢` ADD UNIQUE (`¤¯¤¯¤¯`); +ALTER TABLE `¤¢¤¢¤¢` CHANGE `¤«¤«¤«` `¤«¤«` char(1); +ALTER TABLE `¤¢¤¢¤¢` MODIFY `¤­¤­¤­` char(6); +SELECT * FROM `¤¢¤¢¤¢`; +¤«¤« ¤­¤­¤­ ¤¯¤¯¤¯ ¤±¤±¤± +NULL ¤¢¤¢¤¢¤¢¤¢ NULL NULL +NULL ¤¤¤¤¤¤¤¤¤¤ NULL NULL +NULL ¤¦¤¦¤¦¤¦¤¦ NULL NULL +DESC `¤¢¤¢¤¢`; +Field Type Null Key Default Extra +¤«¤« char(1) YES MUL NULL +¤­¤­¤­ char(6) PRI +¤¯¤¯¤¯ char(1) YES MUL NULL +¤±¤±¤± char(1) YES NULL +SHOW CREATE TABLE `¤¢¤¢¤¢`; +Table Create Table +¤¢¤¢¤¢ CREATE TABLE `¤¢¤¢¤¢` ( + `¤«¤«` char(1) default NULL, + `¤­¤­¤­` char(6) NOT NULL default '', + `¤¯¤¯¤¯` char(1) default NULL, + `¤±¤±¤±` char(1) default NULL, + PRIMARY KEY (`¤­¤­¤­`), + UNIQUE KEY `¤¯¤¯¤¯` (`¤¯¤¯¤¯`), + KEY `¤«¤«¤«` (`¤«¤«`) +) ENGINE=InnoDB DEFAULT CHARSET=ucs2 +ALTER TABLE `¤¢¤¢¤¢` DROP INDEX `¤«¤«¤«`; +ALTER TABLE `¤¢¤¢¤¢` DROP PRIMARY KEY; +ALTER TABLE `¤¢¤¢¤¢` DROP INDEX `¤¯¤¯¤¯`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤«¤«`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤¯¤¯¤¯`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤±¤±¤±`; +SELECT * FROM `¤¢¤¢¤¢`; +¤­¤­¤­ +¤¢¤¢¤¢¤¢¤¢ +¤¤¤¤¤¤¤¤¤¤ +¤¦¤¦¤¦¤¦¤¦ +DESC `¤¢¤¢¤¢`; +Field Type Null Key Default Extra +¤­¤­¤­ char(6) +SHOW CREATE TABLE `¤¢¤¢¤¢`; +Table Create Table +¤¢¤¢¤¢ CREATE TABLE `¤¢¤¢¤¢` ( + `¤­¤­¤­` char(6) NOT NULL default '' +) ENGINE=InnoDB DEFAULT CHARSET=ucs2 +ALTER TABLE `íÝíÝíÝ` ADD `°¢°¢°¢` char(1) FIRST; +ALTER TABLE `íÝíÝíÝ` ADD `°£°£°£` char(1) AFTER `°¡°¡°¡`; +ALTER TABLE `íÝíÝíÝ` ADD `°´°´°´` char(1); +ALTER TABLE `íÝíÝíÝ` ADD INDEX (`°¢°¢°¢`); +ALTER TABLE `íÝíÝíÝ` ADD PRIMARY KEY (`°¡°¡°¡`); +ALTER TABLE `íÝíÝíÝ` ADD UNIQUE (`°£°£°£`); +ALTER TABLE `íÝíÝíÝ` CHANGE `°¢°¢°¢` `°¢°¢` char(1); +ALTER TABLE `íÝíÝíÝ` MODIFY `°¡°¡°¡` char(6); +SELECT * FROM `íÝíÝíÝ`; +°¢°¢ °¡°¡°¡ °£°£°£ °´°´°´ +NULL °¡°¡°¡°¡°¡ NULL NULL +NULL °¢°¢°¢°¢°¢ NULL NULL +NULL °£°£°£°£°£ NULL NULL +DESC `íÝíÝíÝ`; +Field Type Null Key Default Extra +°¢°¢ char(1) YES MUL NULL +°¡°¡°¡ char(6) PRI +°£°£°£ char(1) YES MUL NULL +°´°´°´ char(1) YES NULL +SHOW CREATE TABLE `íÝíÝíÝ`; +Table Create Table +íÝíÝíÝ CREATE TABLE `íÝíÝíÝ` ( + `°¢°¢` char(1) default NULL, + `°¡°¡°¡` char(6) NOT NULL default '', + `°£°£°£` char(1) default NULL, + `°´°´°´` char(1) default NULL, + PRIMARY KEY (`°¡°¡°¡`), + UNIQUE KEY `°£°£°£` (`°£°£°£`), + KEY `°¢°¢°¢` (`°¢°¢`) +) ENGINE=InnoDB DEFAULT CHARSET=ucs2 +ALTER TABLE `íÝíÝíÝ` DROP INDEX `°¢°¢°¢`; +ALTER TABLE `íÝíÝíÝ` DROP PRIMARY KEY; +ALTER TABLE `íÝíÝíÝ` DROP INDEX `°£°£°£`; +ALTER TABLE `íÝíÝíÝ` DROP `°¢°¢`; +ALTER TABLE `íÝíÝíÝ` DROP `°£°£°£`; +ALTER TABLE `íÝíÝíÝ` DROP `°´°´°´`; +SELECT * FROM `íÝíÝíÝ`; +°¡°¡°¡ +°¡°¡°¡°¡°¡ +°¢°¢°¢°¢°¢ +°£°£°£°£°£ +DESC `íÝíÝíÝ`; +Field Type Null Key Default Extra +°¡°¡°¡ char(6) +SHOW CREATE TABLE `íÝíÝíÝ`; +Table Create Table +íÝíÝíÝ CREATE TABLE `íÝíÝíÝ` ( + `°¡°¡°¡` char(6) NOT NULL default '' +) ENGINE=InnoDB DEFAULT CHARSET=ucs2 +DROP TABLE `ޱޱޱ`; +DROP TABLE `޲޲޲`; +DROP TABLE `¤¢¤¢¤¢`; +DROP TABLE `¤¤¤¤¤¤`; +DROP TABLE `íÝíÝíÝ`; +DROP TABLE `íÞíÞíÞ`; +CREATE TABLE `ޱޱޱ`(`Ž·Ž·Ž·` char(5)) DEFAULT CHARSET = ucs2 engine=MYISAM; +CREATE TABLE `޲޲޲`(`޹޹޹` char(5)) DEFAULT CHARSET = ucs2 engine=MYISAM; +CREATE TABLE `¤¢¤¢¤¢`(`¤­¤­¤­` char(5)) DEFAULT CHARSET = ucs2 engine=MYISAM; +CREATE TABLE `¤¤¤¤¤¤`(`¤±¤±¤±` char(5)) DEFAULT CHARSET = ucs2 engine=MYISAM; +CREATE TABLE `íÝíÝíÝ`(`°¡°¡°¡` char(5)) DEFAULT CHARSET = ucs2 engine=MYISAM; +CREATE TABLE `íÞíÞíÞ`(`°´°´°´` char(5)) DEFAULT CHARSET = ucs2 engine=MYISAM; +INSERT INTO `ޱޱޱ` VALUES ('ޱޱޱޱޱ'),('޲޲޲޲޲'),('޳޳޳޳޳'); +INSERT INTO `¤¢¤¢¤¢` VALUES ('¤¢¤¢¤¢¤¢¤¢'),('¤¤¤¤¤¤¤¤¤¤'),('¤¦¤¦¤¦¤¦¤¦'); +INSERT INTO `íÝíÝíÝ` VALUES ('°¡°¡°¡°¡°¡'),('°¢°¢°¢°¢°¢'),('°£°£°£°£°£'); +ALTER TABLE `ޱޱޱ` ADD `޶޶޶` char(1) FIRST; +ALTER TABLE `ޱޱޱ` ADD `ޏޏޏ` char(1) AFTER `Ž·Ž·Ž·`; +ALTER TABLE `ޱޱޱ` ADD `޹޹޹` char(1); +ALTER TABLE `ޱޱޱ` ADD INDEX (`޶޶޶`); +ALTER TABLE `ޱޱޱ` ADD PRIMARY KEY (`Ž·Ž·Ž·`); +ALTER TABLE `ޱޱޱ` ADD UNIQUE (`ޏޏޏ`); +ALTER TABLE `ޱޱޱ` CHANGE `޶޶޶` `޶޶` char(1); +ALTER TABLE `ޱޱޱ` MODIFY `Ž·Ž·Ž·` char(6); +SELECT * FROM `ޱޱޱ`; +޶޶ Ž·Ž·Ž· ޏޏޏ ޹޹޹ +NULL ޱޱޱޱޱ NULL NULL +NULL ޲޲޲޲޲ NULL NULL +NULL ޳޳޳޳޳ NULL NULL +DESC `ޱޱޱ`; +Field Type Null Key Default Extra +޶޶ char(1) YES MUL NULL +Ž·Ž·Ž· char(6) PRI +ޏޏޏ char(1) YES MUL NULL +޹޹޹ char(1) YES NULL +SHOW CREATE TABLE `ޱޱޱ`; +Table Create Table +ޱޱޱ CREATE TABLE `ޱޱޱ` ( + `޶޶` char(1) default NULL, + `Ž·Ž·Ž·` char(6) NOT NULL default '', + `ޏޏޏ` char(1) default NULL, + `޹޹޹` char(1) default NULL, + PRIMARY KEY (`Ž·Ž·Ž·`), + UNIQUE KEY `ޏޏޏ` (`ޏޏޏ`), + KEY `޶޶޶` (`޶޶`) +) ENGINE=MyISAM DEFAULT CHARSET=ucs2 +ALTER TABLE `ޱޱޱ` DROP INDEX `޶޶޶`; +ALTER TABLE `ޱޱޱ` DROP PRIMARY KEY; +ALTER TABLE `ޱޱޱ` DROP INDEX `ޏޏޏ`; +ALTER TABLE `ޱޱޱ` DROP `޶޶`; +ALTER TABLE `ޱޱޱ` DROP `ޏޏޏ`; +ALTER TABLE `ޱޱޱ` DROP `޹޹޹`; +SELECT * FROM `ޱޱޱ`; +Ž·Ž·Ž· +ޱޱޱޱޱ +޲޲޲޲޲ +޳޳޳޳޳ +DESC `ޱޱޱ`; +Field Type Null Key Default Extra +Ž·Ž·Ž· char(6) +SHOW CREATE TABLE `ޱޱޱ`; +Table Create Table +ޱޱޱ CREATE TABLE `ޱޱޱ` ( + `Ž·Ž·Ž·` char(6) NOT NULL default '' +) ENGINE=MyISAM DEFAULT CHARSET=ucs2 +ALTER TABLE `¤¢¤¢¤¢` ADD `¤«¤«¤«` char(1) FIRST; +ALTER TABLE `¤¢¤¢¤¢` ADD `¤¯¤¯¤¯` char(1) AFTER `¤­¤­¤­`; +ALTER TABLE `¤¢¤¢¤¢` ADD `¤±¤±¤±` char(1); +ALTER TABLE `¤¢¤¢¤¢` ADD INDEX (`¤«¤«¤«`); +ALTER TABLE `¤¢¤¢¤¢` ADD PRIMARY KEY (`¤­¤­¤­`); +ALTER TABLE `¤¢¤¢¤¢` ADD UNIQUE (`¤¯¤¯¤¯`); +ALTER TABLE `¤¢¤¢¤¢` CHANGE `¤«¤«¤«` `¤«¤«` char(1); +ALTER TABLE `¤¢¤¢¤¢` MODIFY `¤­¤­¤­` char(6); +SELECT * FROM `¤¢¤¢¤¢`; +¤«¤« ¤­¤­¤­ ¤¯¤¯¤¯ ¤±¤±¤± +NULL ¤¢¤¢¤¢¤¢¤¢ NULL NULL +NULL ¤¤¤¤¤¤¤¤¤¤ NULL NULL +NULL ¤¦¤¦¤¦¤¦¤¦ NULL NULL +DESC `¤¢¤¢¤¢`; +Field Type Null Key Default Extra +¤«¤« char(1) YES MUL NULL +¤­¤­¤­ char(6) PRI +¤¯¤¯¤¯ char(1) YES MUL NULL +¤±¤±¤± char(1) YES NULL +SHOW CREATE TABLE `¤¢¤¢¤¢`; +Table Create Table +¤¢¤¢¤¢ CREATE TABLE `¤¢¤¢¤¢` ( + `¤«¤«` char(1) default NULL, + `¤­¤­¤­` char(6) NOT NULL default '', + `¤¯¤¯¤¯` char(1) default NULL, + `¤±¤±¤±` char(1) default NULL, + PRIMARY KEY (`¤­¤­¤­`), + UNIQUE KEY `¤¯¤¯¤¯` (`¤¯¤¯¤¯`), + KEY `¤«¤«¤«` (`¤«¤«`) +) ENGINE=MyISAM DEFAULT CHARSET=ucs2 +ALTER TABLE `¤¢¤¢¤¢` DROP INDEX `¤«¤«¤«`; +ALTER TABLE `¤¢¤¢¤¢` DROP PRIMARY KEY; +ALTER TABLE `¤¢¤¢¤¢` DROP INDEX `¤¯¤¯¤¯`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤«¤«`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤¯¤¯¤¯`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤±¤±¤±`; +SELECT * FROM `¤¢¤¢¤¢`; +¤­¤­¤­ +¤¢¤¢¤¢¤¢¤¢ +¤¤¤¤¤¤¤¤¤¤ +¤¦¤¦¤¦¤¦¤¦ +DESC `¤¢¤¢¤¢`; +Field Type Null Key Default Extra +¤­¤­¤­ char(6) +SHOW CREATE TABLE `¤¢¤¢¤¢`; +Table Create Table +¤¢¤¢¤¢ CREATE TABLE `¤¢¤¢¤¢` ( + `¤­¤­¤­` char(6) NOT NULL default '' +) ENGINE=MyISAM DEFAULT CHARSET=ucs2 +ALTER TABLE `íÝíÝíÝ` ADD `°¢°¢°¢` char(1) FIRST; +ALTER TABLE `íÝíÝíÝ` ADD `°£°£°£` char(1) AFTER `°¡°¡°¡`; +ALTER TABLE `íÝíÝíÝ` ADD `°´°´°´` char(1); +ALTER TABLE `íÝíÝíÝ` ADD INDEX (`°¢°¢°¢`); +ALTER TABLE `íÝíÝíÝ` ADD PRIMARY KEY (`°¡°¡°¡`); +ALTER TABLE `íÝíÝíÝ` ADD UNIQUE (`°£°£°£`); +ALTER TABLE `íÝíÝíÝ` CHANGE `°¢°¢°¢` `°¢°¢` char(1); +ALTER TABLE `íÝíÝíÝ` MODIFY `°¡°¡°¡` char(6); +SELECT * FROM `íÝíÝíÝ`; +°¢°¢ °¡°¡°¡ °£°£°£ °´°´°´ +NULL °¡°¡°¡°¡°¡ NULL NULL +NULL °¢°¢°¢°¢°¢ NULL NULL +NULL °£°£°£°£°£ NULL NULL +DESC `íÝíÝíÝ`; +Field Type Null Key Default Extra +°¢°¢ char(1) YES MUL NULL +°¡°¡°¡ char(6) PRI +°£°£°£ char(1) YES MUL NULL +°´°´°´ char(1) YES NULL +SHOW CREATE TABLE `íÝíÝíÝ`; +Table Create Table +íÝíÝíÝ CREATE TABLE `íÝíÝíÝ` ( + `°¢°¢` char(1) default NULL, + `°¡°¡°¡` char(6) NOT NULL default '', + `°£°£°£` char(1) default NULL, + `°´°´°´` char(1) default NULL, + PRIMARY KEY (`°¡°¡°¡`), + UNIQUE KEY `°£°£°£` (`°£°£°£`), + KEY `°¢°¢°¢` (`°¢°¢`) +) ENGINE=MyISAM DEFAULT CHARSET=ucs2 +ALTER TABLE `íÝíÝíÝ` DROP INDEX `°¢°¢°¢`; +ALTER TABLE `íÝíÝíÝ` DROP PRIMARY KEY; +ALTER TABLE `íÝíÝíÝ` DROP INDEX `°£°£°£`; +ALTER TABLE `íÝíÝíÝ` DROP `°¢°¢`; +ALTER TABLE `íÝíÝíÝ` DROP `°£°£°£`; +ALTER TABLE `íÝíÝíÝ` DROP `°´°´°´`; +SELECT * FROM `íÝíÝíÝ`; +°¡°¡°¡ +°¡°¡°¡°¡°¡ +°¢°¢°¢°¢°¢ +°£°£°£°£°£ +DESC `íÝíÝíÝ`; +Field Type Null Key Default Extra +°¡°¡°¡ char(6) +SHOW CREATE TABLE `íÝíÝíÝ`; +Table Create Table +íÝíÝíÝ CREATE TABLE `íÝíÝíÝ` ( + `°¡°¡°¡` char(6) NOT NULL default '' +) ENGINE=MyISAM DEFAULT CHARSET=ucs2 +DROP TABLE `ޱޱޱ`; +DROP TABLE `޲޲޲`; +DROP TABLE `¤¢¤¢¤¢`; +DROP TABLE `¤¤¤¤¤¤`; +DROP TABLE `íÝíÝíÝ`; +DROP TABLE `íÞíÞíÞ`; +CREATE TABLE `ޱޱޱ`(`Ž·Ž·Ž·` char(5)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TABLE `޲޲޲`(`޹޹޹` char(5)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TABLE `¤¢¤¢¤¢`(`¤­¤­¤­` char(5)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TABLE `¤¤¤¤¤¤`(`¤±¤±¤±` char(5)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TABLE `íÝíÝíÝ`(`°¡°¡°¡` char(5)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TABLE `íÞíÞíÞ`(`°´°´°´` char(5)) DEFAULT CHARSET = ucs2 engine=HEAP; +INSERT INTO `ޱޱޱ` VALUES ('ޱޱޱޱޱ'),('޲޲޲޲޲'),('޳޳޳޳޳'); +INSERT INTO `¤¢¤¢¤¢` VALUES ('¤¢¤¢¤¢¤¢¤¢'),('¤¤¤¤¤¤¤¤¤¤'),('¤¦¤¦¤¦¤¦¤¦'); +INSERT INTO `íÝíÝíÝ` VALUES ('°¡°¡°¡°¡°¡'),('°¢°¢°¢°¢°¢'),('°£°£°£°£°£'); +ALTER TABLE `ޱޱޱ` ADD `޶޶޶` char(1) FIRST; +ALTER TABLE `ޱޱޱ` ADD `ޏޏޏ` char(1) AFTER `Ž·Ž·Ž·`; +ALTER TABLE `ޱޱޱ` ADD `޹޹޹` char(1); +ALTER TABLE `ޱޱޱ` ADD INDEX (`޶޶޶`); +ALTER TABLE `ޱޱޱ` ADD PRIMARY KEY (`Ž·Ž·Ž·`); +ALTER TABLE `ޱޱޱ` ADD UNIQUE (`ޏޏޏ`); +ALTER TABLE `ޱޱޱ` CHANGE `޶޶޶` `޶޶` char(1); +ALTER TABLE `ޱޱޱ` MODIFY `Ž·Ž·Ž·` char(6); +SELECT * FROM `ޱޱޱ`; +޶޶ Ž·Ž·Ž· ޏޏޏ ޹޹޹ +NULL ޱޱޱޱޱ NULL NULL +NULL ޲޲޲޲޲ NULL NULL +NULL ޳޳޳޳޳ NULL NULL +DESC `ޱޱޱ`; +Field Type Null Key Default Extra +޶޶ char(1) YES MUL NULL +Ž·Ž·Ž· char(6) PRI +ޏޏޏ char(1) YES MUL NULL +޹޹޹ char(1) YES NULL +SHOW CREATE TABLE `ޱޱޱ`; +Table Create Table +ޱޱޱ CREATE TABLE `ޱޱޱ` ( + `޶޶` char(1) default NULL, + `Ž·Ž·Ž·` char(6) NOT NULL default '', + `ޏޏޏ` char(1) default NULL, + `޹޹޹` char(1) default NULL, + PRIMARY KEY (`Ž·Ž·Ž·`), + UNIQUE KEY `ޏޏޏ` (`ޏޏޏ`), + KEY `޶޶޶` (`޶޶`) +) ENGINE=HEAP DEFAULT CHARSET=ucs2 +ALTER TABLE `ޱޱޱ` DROP INDEX `޶޶޶`; +ALTER TABLE `ޱޱޱ` DROP PRIMARY KEY; +ALTER TABLE `ޱޱޱ` DROP INDEX `ޏޏޏ`; +ALTER TABLE `ޱޱޱ` DROP `޶޶`; +ALTER TABLE `ޱޱޱ` DROP `ޏޏޏ`; +ALTER TABLE `ޱޱޱ` DROP `޹޹޹`; +SELECT * FROM `ޱޱޱ`; +Ž·Ž·Ž· +ޱޱޱޱޱ +޲޲޲޲޲ +޳޳޳޳޳ +DESC `ޱޱޱ`; +Field Type Null Key Default Extra +Ž·Ž·Ž· char(6) +SHOW CREATE TABLE `ޱޱޱ`; +Table Create Table +ޱޱޱ CREATE TABLE `ޱޱޱ` ( + `Ž·Ž·Ž·` char(6) NOT NULL default '' +) ENGINE=HEAP DEFAULT CHARSET=ucs2 +ALTER TABLE `¤¢¤¢¤¢` ADD `¤«¤«¤«` char(1) FIRST; +ALTER TABLE `¤¢¤¢¤¢` ADD `¤¯¤¯¤¯` char(1) AFTER `¤­¤­¤­`; +ALTER TABLE `¤¢¤¢¤¢` ADD `¤±¤±¤±` char(1); +ALTER TABLE `¤¢¤¢¤¢` ADD INDEX (`¤«¤«¤«`); +ALTER TABLE `¤¢¤¢¤¢` ADD PRIMARY KEY (`¤­¤­¤­`); +ALTER TABLE `¤¢¤¢¤¢` ADD UNIQUE (`¤¯¤¯¤¯`); +ALTER TABLE `¤¢¤¢¤¢` CHANGE `¤«¤«¤«` `¤«¤«` char(1); +ALTER TABLE `¤¢¤¢¤¢` MODIFY `¤­¤­¤­` char(6); +SELECT * FROM `¤¢¤¢¤¢`; +¤«¤« ¤­¤­¤­ ¤¯¤¯¤¯ ¤±¤±¤± +NULL ¤¢¤¢¤¢¤¢¤¢ NULL NULL +NULL ¤¤¤¤¤¤¤¤¤¤ NULL NULL +NULL ¤¦¤¦¤¦¤¦¤¦ NULL NULL +DESC `¤¢¤¢¤¢`; +Field Type Null Key Default Extra +¤«¤« char(1) YES MUL NULL +¤­¤­¤­ char(6) PRI +¤¯¤¯¤¯ char(1) YES MUL NULL +¤±¤±¤± char(1) YES NULL +SHOW CREATE TABLE `¤¢¤¢¤¢`; +Table Create Table +¤¢¤¢¤¢ CREATE TABLE `¤¢¤¢¤¢` ( + `¤«¤«` char(1) default NULL, + `¤­¤­¤­` char(6) NOT NULL default '', + `¤¯¤¯¤¯` char(1) default NULL, + `¤±¤±¤±` char(1) default NULL, + PRIMARY KEY (`¤­¤­¤­`), + UNIQUE KEY `¤¯¤¯¤¯` (`¤¯¤¯¤¯`), + KEY `¤«¤«¤«` (`¤«¤«`) +) ENGINE=HEAP DEFAULT CHARSET=ucs2 +ALTER TABLE `¤¢¤¢¤¢` DROP INDEX `¤«¤«¤«`; +ALTER TABLE `¤¢¤¢¤¢` DROP PRIMARY KEY; +ALTER TABLE `¤¢¤¢¤¢` DROP INDEX `¤¯¤¯¤¯`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤«¤«`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤¯¤¯¤¯`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤±¤±¤±`; +SELECT * FROM `¤¢¤¢¤¢`; +¤­¤­¤­ +¤¢¤¢¤¢¤¢¤¢ +¤¤¤¤¤¤¤¤¤¤ +¤¦¤¦¤¦¤¦¤¦ +DESC `¤¢¤¢¤¢`; +Field Type Null Key Default Extra +¤­¤­¤­ char(6) +SHOW CREATE TABLE `¤¢¤¢¤¢`; +Table Create Table +¤¢¤¢¤¢ CREATE TABLE `¤¢¤¢¤¢` ( + `¤­¤­¤­` char(6) NOT NULL default '' +) ENGINE=HEAP DEFAULT CHARSET=ucs2 +ALTER TABLE `íÝíÝíÝ` ADD `°¢°¢°¢` char(1) FIRST; +ALTER TABLE `íÝíÝíÝ` ADD `°£°£°£` char(1) AFTER `°¡°¡°¡`; +ALTER TABLE `íÝíÝíÝ` ADD `°´°´°´` char(1); +ALTER TABLE `íÝíÝíÝ` ADD INDEX (`°¢°¢°¢`); +ALTER TABLE `íÝíÝíÝ` ADD PRIMARY KEY (`°¡°¡°¡`); +ALTER TABLE `íÝíÝíÝ` ADD UNIQUE (`°£°£°£`); +ALTER TABLE `íÝíÝíÝ` CHANGE `°¢°¢°¢` `°¢°¢` char(1); +ALTER TABLE `íÝíÝíÝ` MODIFY `°¡°¡°¡` char(6); +SELECT * FROM `íÝíÝíÝ`; +°¢°¢ °¡°¡°¡ °£°£°£ °´°´°´ +NULL °¡°¡°¡°¡°¡ NULL NULL +NULL °¢°¢°¢°¢°¢ NULL NULL +NULL °£°£°£°£°£ NULL NULL +DESC `íÝíÝíÝ`; +Field Type Null Key Default Extra +°¢°¢ char(1) YES MUL NULL +°¡°¡°¡ char(6) PRI +°£°£°£ char(1) YES MUL NULL +°´°´°´ char(1) YES NULL +SHOW CREATE TABLE `íÝíÝíÝ`; +Table Create Table +íÝíÝíÝ CREATE TABLE `íÝíÝíÝ` ( + `°¢°¢` char(1) default NULL, + `°¡°¡°¡` char(6) NOT NULL default '', + `°£°£°£` char(1) default NULL, + `°´°´°´` char(1) default NULL, + PRIMARY KEY (`°¡°¡°¡`), + UNIQUE KEY `°£°£°£` (`°£°£°£`), + KEY `°¢°¢°¢` (`°¢°¢`) +) ENGINE=HEAP DEFAULT CHARSET=ucs2 +ALTER TABLE `íÝíÝíÝ` DROP INDEX `°¢°¢°¢`; +ALTER TABLE `íÝíÝíÝ` DROP PRIMARY KEY; +ALTER TABLE `íÝíÝíÝ` DROP INDEX `°£°£°£`; +ALTER TABLE `íÝíÝíÝ` DROP `°¢°¢`; +ALTER TABLE `íÝíÝíÝ` DROP `°£°£°£`; +ALTER TABLE `íÝíÝíÝ` DROP `°´°´°´`; +SELECT * FROM `íÝíÝíÝ`; +°¡°¡°¡ +°¡°¡°¡°¡°¡ +°¢°¢°¢°¢°¢ +°£°£°£°£°£ +DESC `íÝíÝíÝ`; +Field Type Null Key Default Extra +°¡°¡°¡ char(6) +SHOW CREATE TABLE `íÝíÝíÝ`; +Table Create Table +íÝíÝíÝ CREATE TABLE `íÝíÝíÝ` ( + `°¡°¡°¡` char(6) NOT NULL default '' +) ENGINE=HEAP DEFAULT CHARSET=ucs2 +DROP TABLE `ޱޱޱ`; +DROP TABLE `޲޲޲`; +DROP TABLE `¤¢¤¢¤¢`; +DROP TABLE `¤¤¤¤¤¤`; +DROP TABLE `íÝíÝíÝ`; +DROP TABLE `íÞíÞíÞ`; +CREATE TABLE `ޱޱޱ`(`Ž·Ž·Ž·` char(5)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TABLE `޲޲޲`(`޹޹޹` char(5)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TABLE `¤¢¤¢¤¢`(`¤­¤­¤­` char(5)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TABLE `¤¤¤¤¤¤`(`¤±¤±¤±` char(5)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TABLE `íÝíÝíÝ`(`°¡°¡°¡` char(5)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TABLE `íÞíÞíÞ`(`°´°´°´` char(5)) DEFAULT CHARSET = ucs2 engine=BDB; +INSERT INTO `ޱޱޱ` VALUES ('ޱޱޱޱޱ'),('޲޲޲޲޲'),('޳޳޳޳޳'); +INSERT INTO `¤¢¤¢¤¢` VALUES ('¤¢¤¢¤¢¤¢¤¢'),('¤¤¤¤¤¤¤¤¤¤'),('¤¦¤¦¤¦¤¦¤¦'); +INSERT INTO `íÝíÝíÝ` VALUES ('°¡°¡°¡°¡°¡'),('°¢°¢°¢°¢°¢'),('°£°£°£°£°£'); +ALTER TABLE `ޱޱޱ` ADD `޶޶޶` char(1) FIRST; +ALTER TABLE `ޱޱޱ` ADD `ޏޏޏ` char(1) AFTER `Ž·Ž·Ž·`; +ALTER TABLE `ޱޱޱ` ADD `޹޹޹` char(1); +ALTER TABLE `ޱޱޱ` ADD INDEX (`޶޶޶`); +ALTER TABLE `ޱޱޱ` ADD PRIMARY KEY (`Ž·Ž·Ž·`); +ALTER TABLE `ޱޱޱ` CHANGE `޶޶޶` `޶޶` char(1); +ALTER TABLE `ޱޱޱ` MODIFY `Ž·Ž·Ž·` char(6); +SELECT * FROM `ޱޱޱ`; +޶޶ Ž·Ž·Ž· ޏޏޏ ޹޹޹ +NULL ޱޱޱޱޱ NULL NULL +NULL ޲޲޲޲޲ NULL NULL +NULL ޳޳޳޳޳ NULL NULL +DESC `ޱޱޱ`; +Field Type Null Key Default Extra +޶޶ char(1) YES MUL NULL +Ž·Ž·Ž· char(6) PRI +ޏޏޏ char(1) YES NULL +޹޹޹ char(1) YES NULL +SHOW CREATE TABLE `ޱޱޱ`; +Table Create Table +ޱޱޱ CREATE TABLE `ޱޱޱ` ( + `޶޶` char(1) default NULL, + `Ž·Ž·Ž·` char(6) NOT NULL default '', + `ޏޏޏ` char(1) default NULL, + `޹޹޹` char(1) default NULL, + PRIMARY KEY (`Ž·Ž·Ž·`), + KEY `޶޶޶` (`޶޶`) +) ENGINE=BerkeleyDB DEFAULT CHARSET=ucs2 +ALTER TABLE `ޱޱޱ` DROP INDEX `޶޶޶`; +ALTER TABLE `ޱޱޱ` DROP PRIMARY KEY; +ALTER TABLE `ޱޱޱ` DROP `޶޶`; +ALTER TABLE `ޱޱޱ` DROP `ޏޏޏ`; +ALTER TABLE `ޱޱޱ` DROP `޹޹޹`; +SELECT * FROM `ޱޱޱ`; +Ž·Ž·Ž· +ޱޱޱޱޱ +޲޲޲޲޲ +޳޳޳޳޳ +DESC `ޱޱޱ`; +Field Type Null Key Default Extra +Ž·Ž·Ž· char(6) +SHOW CREATE TABLE `ޱޱޱ`; +Table Create Table +ޱޱޱ CREATE TABLE `ޱޱޱ` ( + `Ž·Ž·Ž·` char(6) NOT NULL default '' +) ENGINE=BerkeleyDB DEFAULT CHARSET=ucs2 +ALTER TABLE `¤¢¤¢¤¢` ADD `¤«¤«¤«` char(1) FIRST; +ALTER TABLE `¤¢¤¢¤¢` ADD `¤¯¤¯¤¯` char(1) AFTER `¤­¤­¤­`; +ALTER TABLE `¤¢¤¢¤¢` ADD `¤±¤±¤±` char(1); +ALTER TABLE `¤¢¤¢¤¢` ADD INDEX (`¤«¤«¤«`); +ALTER TABLE `¤¢¤¢¤¢` ADD PRIMARY KEY (`¤­¤­¤­`); +ALTER TABLE `¤¢¤¢¤¢` CHANGE `¤«¤«¤«` `¤«¤«` char(1); +ALTER TABLE `¤¢¤¢¤¢` MODIFY `¤­¤­¤­` char(6); +SELECT * FROM `¤¢¤¢¤¢`; +¤«¤« ¤­¤­¤­ ¤¯¤¯¤¯ ¤±¤±¤± +NULL ¤¢¤¢¤¢¤¢¤¢ NULL NULL +NULL ¤¤¤¤¤¤¤¤¤¤ NULL NULL +NULL ¤¦¤¦¤¦¤¦¤¦ NULL NULL +DESC `¤¢¤¢¤¢`; +Field Type Null Key Default Extra +¤«¤« char(1) YES MUL NULL +¤­¤­¤­ char(6) PRI +¤¯¤¯¤¯ char(1) YES NULL +¤±¤±¤± char(1) YES NULL +SHOW CREATE TABLE `¤¢¤¢¤¢`; +Table Create Table +¤¢¤¢¤¢ CREATE TABLE `¤¢¤¢¤¢` ( + `¤«¤«` char(1) default NULL, + `¤­¤­¤­` char(6) NOT NULL default '', + `¤¯¤¯¤¯` char(1) default NULL, + `¤±¤±¤±` char(1) default NULL, + PRIMARY KEY (`¤­¤­¤­`), + KEY `¤«¤«¤«` (`¤«¤«`) +) ENGINE=BerkeleyDB DEFAULT CHARSET=ucs2 +ALTER TABLE `¤¢¤¢¤¢` DROP INDEX `¤«¤«¤«`; +ALTER TABLE `¤¢¤¢¤¢` DROP PRIMARY KEY; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤«¤«`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤¯¤¯¤¯`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤±¤±¤±`; +SELECT * FROM `¤¢¤¢¤¢`; +¤­¤­¤­ +¤¢¤¢¤¢¤¢¤¢ +¤¤¤¤¤¤¤¤¤¤ +¤¦¤¦¤¦¤¦¤¦ +DESC `¤¢¤¢¤¢`; +Field Type Null Key Default Extra +¤­¤­¤­ char(6) +SHOW CREATE TABLE `¤¢¤¢¤¢`; +Table Create Table +¤¢¤¢¤¢ CREATE TABLE `¤¢¤¢¤¢` ( + `¤­¤­¤­` char(6) NOT NULL default '' +) ENGINE=BerkeleyDB DEFAULT CHARSET=ucs2 +ALTER TABLE `íÝíÝíÝ` ADD `°¢°¢°¢` char(1) FIRST; +ALTER TABLE `íÝíÝíÝ` ADD `°£°£°£` char(1) AFTER `°¡°¡°¡`; +ALTER TABLE `íÝíÝíÝ` ADD `°´°´°´` char(1); +ALTER TABLE `íÝíÝíÝ` ADD INDEX (`°¢°¢°¢`); +ALTER TABLE `íÝíÝíÝ` ADD PRIMARY KEY (`°¡°¡°¡`); +ALTER TABLE `íÝíÝíÝ` CHANGE `°¢°¢°¢` `°¢°¢` char(1); +ALTER TABLE `íÝíÝíÝ` MODIFY `°¡°¡°¡` char(6); +SELECT * FROM `íÝíÝíÝ`; +°¢°¢ °¡°¡°¡ °£°£°£ °´°´°´ +NULL °¡°¡°¡°¡°¡ NULL NULL +NULL °¢°¢°¢°¢°¢ NULL NULL +NULL °£°£°£°£°£ NULL NULL +DESC `íÝíÝíÝ`; +Field Type Null Key Default Extra +°¢°¢ char(1) YES MUL NULL +°¡°¡°¡ char(6) PRI +°£°£°£ char(1) YES NULL +°´°´°´ char(1) YES NULL +SHOW CREATE TABLE `íÝíÝíÝ`; +Table Create Table +íÝíÝíÝ CREATE TABLE `íÝíÝíÝ` ( + `°¢°¢` char(1) default NULL, + `°¡°¡°¡` char(6) NOT NULL default '', + `°£°£°£` char(1) default NULL, + `°´°´°´` char(1) default NULL, + PRIMARY KEY (`°¡°¡°¡`), + KEY `°¢°¢°¢` (`°¢°¢`) +) ENGINE=BerkeleyDB DEFAULT CHARSET=ucs2 +ALTER TABLE `íÝíÝíÝ` DROP INDEX `°¢°¢°¢`; +ALTER TABLE `íÝíÝíÝ` DROP PRIMARY KEY; +ALTER TABLE `íÝíÝíÝ` DROP `°¢°¢`; +ALTER TABLE `íÝíÝíÝ` DROP `°£°£°£`; +ALTER TABLE `íÝíÝíÝ` DROP `°´°´°´`; +SELECT * FROM `íÝíÝíÝ`; +°¡°¡°¡ +°¡°¡°¡°¡°¡ +°¢°¢°¢°¢°¢ +°£°£°£°£°£ +DESC `íÝíÝíÝ`; +Field Type Null Key Default Extra +°¡°¡°¡ char(6) +SHOW CREATE TABLE `íÝíÝíÝ`; +Table Create Table +íÝíÝíÝ CREATE TABLE `íÝíÝíÝ` ( + `°¡°¡°¡` char(6) NOT NULL default '' +) ENGINE=BerkeleyDB DEFAULT CHARSET=ucs2 +DROP TABLE `ޱޱޱ`; +DROP TABLE `޲޲޲`; +DROP TABLE `¤¢¤¢¤¢`; +DROP TABLE `¤¤¤¤¤¤`; +DROP TABLE `íÝíÝíÝ`; +DROP TABLE `íÞíÞíÞ`; diff --git a/mysql-test/suite/jp/r/jp_alter_ujis.result b/mysql-test/suite/jp/r/jp_alter_ujis.result new file mode 100755 index 00000000000..afa3c79cbce --- /dev/null +++ b/mysql-test/suite/jp/r/jp_alter_ujis.result @@ -0,0 +1,647 @@ +DROP TABLE IF EXISTS `ޱޱޱ`; +DROP TABLE IF EXISTS `޲޲޲`; +DROP TABLE IF EXISTS `¤¢¤¢¤¢`; +DROP TABLE IF EXISTS `¤¤¤¤¤¤`; +DROP TABLE IF EXISTS `íÝíÝíÝ`; +DROP TABLE IF EXISTS `íÞíÞíÞ`; +SET NAMES ujis; +SET character_set_database = ujis; +CREATE TABLE `ޱޱޱ`(`Ž·Ž·Ž·` char(5)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TABLE `޲޲޲`(`޹޹޹` char(5)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TABLE `¤¢¤¢¤¢`(`¤­¤­¤­` char(5)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TABLE `¤¤¤¤¤¤`(`¤±¤±¤±` char(5)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TABLE `íÝíÝíÝ`(`°¡°¡°¡` char(5)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TABLE `íÞíÞíÞ`(`°´°´°´` char(5)) DEFAULT CHARSET = ujis engine=INNODB; +INSERT INTO `ޱޱޱ` VALUES ('ޱޱޱޱޱ'),('޲޲޲޲޲'),('޳޳޳޳޳'); +INSERT INTO `¤¢¤¢¤¢` VALUES ('¤¢¤¢¤¢¤¢¤¢'),('¤¤¤¤¤¤¤¤¤¤'),('¤¦¤¦¤¦¤¦¤¦'); +INSERT INTO `íÝíÝíÝ` VALUES ('°¡°¡°¡°¡°¡'),('°¢°¢°¢°¢°¢'),('°£°£°£°£°£'); +ALTER TABLE `ޱޱޱ` ADD `޶޶޶` char(1) FIRST; +ALTER TABLE `ޱޱޱ` ADD `ޏޏޏ` char(1) AFTER `Ž·Ž·Ž·`; +ALTER TABLE `ޱޱޱ` ADD `޹޹޹` char(1); +ALTER TABLE `ޱޱޱ` ADD INDEX (`޶޶޶`); +ALTER TABLE `ޱޱޱ` ADD PRIMARY KEY (`Ž·Ž·Ž·`); +ALTER TABLE `ޱޱޱ` ADD UNIQUE (`ޏޏޏ`); +ALTER TABLE `ޱޱޱ` CHANGE `޶޶޶` `޶޶` char(1); +ALTER TABLE `ޱޱޱ` MODIFY `Ž·Ž·Ž·` char(6); +SELECT * FROM `ޱޱޱ`; +޶޶ Ž·Ž·Ž· ޏޏޏ ޹޹޹ +NULL ޱޱޱޱޱ NULL NULL +NULL ޲޲޲޲޲ NULL NULL +NULL ޳޳޳޳޳ NULL NULL +DESC `ޱޱޱ`; +Field Type Null Key Default Extra +޶޶ char(1) YES MUL NULL +Ž·Ž·Ž· char(6) PRI +ޏޏޏ char(1) YES MUL NULL +޹޹޹ char(1) YES NULL +SHOW CREATE TABLE `ޱޱޱ`; +Table Create Table +ޱޱޱ CREATE TABLE `ޱޱޱ` ( + `޶޶` char(1) default NULL, + `Ž·Ž·Ž·` char(6) NOT NULL default '', + `ޏޏޏ` char(1) default NULL, + `޹޹޹` char(1) default NULL, + PRIMARY KEY (`Ž·Ž·Ž·`), + UNIQUE KEY `ޏޏޏ` (`ޏޏޏ`), + KEY `޶޶޶` (`޶޶`) +) ENGINE=InnoDB DEFAULT CHARSET=ujis +ALTER TABLE `ޱޱޱ` DROP INDEX `޶޶޶`; +ALTER TABLE `ޱޱޱ` DROP PRIMARY KEY; +ALTER TABLE `ޱޱޱ` DROP INDEX `ޏޏޏ`; +ALTER TABLE `ޱޱޱ` DROP `޶޶`; +ALTER TABLE `ޱޱޱ` DROP `ޏޏޏ`; +ALTER TABLE `ޱޱޱ` DROP `޹޹޹`; +SELECT * FROM `ޱޱޱ`; +Ž·Ž·Ž· +ޱޱޱޱޱ +޲޲޲޲޲ +޳޳޳޳޳ +DESC `ޱޱޱ`; +Field Type Null Key Default Extra +Ž·Ž·Ž· char(6) +SHOW CREATE TABLE `ޱޱޱ`; +Table Create Table +ޱޱޱ CREATE TABLE `ޱޱޱ` ( + `Ž·Ž·Ž·` char(6) NOT NULL default '' +) ENGINE=InnoDB DEFAULT CHARSET=ujis +ALTER TABLE `¤¢¤¢¤¢` ADD `¤«¤«¤«` char(1) FIRST; +ALTER TABLE `¤¢¤¢¤¢` ADD `¤¯¤¯¤¯` char(1) AFTER `¤­¤­¤­`; +ALTER TABLE `¤¢¤¢¤¢` ADD `¤±¤±¤±` char(1); +ALTER TABLE `¤¢¤¢¤¢` ADD INDEX (`¤«¤«¤«`); +ALTER TABLE `¤¢¤¢¤¢` ADD PRIMARY KEY (`¤­¤­¤­`); +ALTER TABLE `¤¢¤¢¤¢` ADD UNIQUE (`¤¯¤¯¤¯`); +ALTER TABLE `¤¢¤¢¤¢` CHANGE `¤«¤«¤«` `¤«¤«` char(1); +ALTER TABLE `¤¢¤¢¤¢` MODIFY `¤­¤­¤­` char(6); +SELECT * FROM `¤¢¤¢¤¢`; +¤«¤« ¤­¤­¤­ ¤¯¤¯¤¯ ¤±¤±¤± +NULL ¤¢¤¢¤¢¤¢¤¢ NULL NULL +NULL ¤¤¤¤¤¤¤¤¤¤ NULL NULL +NULL ¤¦¤¦¤¦¤¦¤¦ NULL NULL +DESC `¤¢¤¢¤¢`; +Field Type Null Key Default Extra +¤«¤« char(1) YES MUL NULL +¤­¤­¤­ char(6) PRI +¤¯¤¯¤¯ char(1) YES MUL NULL +¤±¤±¤± char(1) YES NULL +SHOW CREATE TABLE `¤¢¤¢¤¢`; +Table Create Table +¤¢¤¢¤¢ CREATE TABLE `¤¢¤¢¤¢` ( + `¤«¤«` char(1) default NULL, + `¤­¤­¤­` char(6) NOT NULL default '', + `¤¯¤¯¤¯` char(1) default NULL, + `¤±¤±¤±` char(1) default NULL, + PRIMARY KEY (`¤­¤­¤­`), + UNIQUE KEY `¤¯¤¯¤¯` (`¤¯¤¯¤¯`), + KEY `¤«¤«¤«` (`¤«¤«`) +) ENGINE=InnoDB DEFAULT CHARSET=ujis +ALTER TABLE `¤¢¤¢¤¢` DROP INDEX `¤«¤«¤«`; +ALTER TABLE `¤¢¤¢¤¢` DROP PRIMARY KEY; +ALTER TABLE `¤¢¤¢¤¢` DROP INDEX `¤¯¤¯¤¯`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤«¤«`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤¯¤¯¤¯`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤±¤±¤±`; +SELECT * FROM `¤¢¤¢¤¢`; +¤­¤­¤­ +¤¢¤¢¤¢¤¢¤¢ +¤¤¤¤¤¤¤¤¤¤ +¤¦¤¦¤¦¤¦¤¦ +DESC `¤¢¤¢¤¢`; +Field Type Null Key Default Extra +¤­¤­¤­ char(6) +SHOW CREATE TABLE `¤¢¤¢¤¢`; +Table Create Table +¤¢¤¢¤¢ CREATE TABLE `¤¢¤¢¤¢` ( + `¤­¤­¤­` char(6) NOT NULL default '' +) ENGINE=InnoDB DEFAULT CHARSET=ujis +ALTER TABLE `íÝíÝíÝ` ADD `°¢°¢°¢` char(1) FIRST; +ALTER TABLE `íÝíÝíÝ` ADD `°£°£°£` char(1) AFTER `°¡°¡°¡`; +ALTER TABLE `íÝíÝíÝ` ADD `°´°´°´` char(1); +ALTER TABLE `íÝíÝíÝ` ADD INDEX (`°¢°¢°¢`); +ALTER TABLE `íÝíÝíÝ` ADD PRIMARY KEY (`°¡°¡°¡`); +ALTER TABLE `íÝíÝíÝ` ADD UNIQUE (`°£°£°£`); +ALTER TABLE `íÝíÝíÝ` CHANGE `°¢°¢°¢` `°¢°¢` char(1); +ALTER TABLE `íÝíÝíÝ` MODIFY `°¡°¡°¡` char(6); +SELECT * FROM `íÝíÝíÝ`; +°¢°¢ °¡°¡°¡ °£°£°£ °´°´°´ +NULL °¡°¡°¡°¡°¡ NULL NULL +NULL °¢°¢°¢°¢°¢ NULL NULL +NULL °£°£°£°£°£ NULL NULL +DESC `íÝíÝíÝ`; +Field Type Null Key Default Extra +°¢°¢ char(1) YES MUL NULL +°¡°¡°¡ char(6) PRI +°£°£°£ char(1) YES MUL NULL +°´°´°´ char(1) YES NULL +SHOW CREATE TABLE `íÝíÝíÝ`; +Table Create Table +íÝíÝíÝ CREATE TABLE `íÝíÝíÝ` ( + `°¢°¢` char(1) default NULL, + `°¡°¡°¡` char(6) NOT NULL default '', + `°£°£°£` char(1) default NULL, + `°´°´°´` char(1) default NULL, + PRIMARY KEY (`°¡°¡°¡`), + UNIQUE KEY `°£°£°£` (`°£°£°£`), + KEY `°¢°¢°¢` (`°¢°¢`) +) ENGINE=InnoDB DEFAULT CHARSET=ujis +ALTER TABLE `íÝíÝíÝ` DROP INDEX `°¢°¢°¢`; +ALTER TABLE `íÝíÝíÝ` DROP PRIMARY KEY; +ALTER TABLE `íÝíÝíÝ` DROP INDEX `°£°£°£`; +ALTER TABLE `íÝíÝíÝ` DROP `°¢°¢`; +ALTER TABLE `íÝíÝíÝ` DROP `°£°£°£`; +ALTER TABLE `íÝíÝíÝ` DROP `°´°´°´`; +SELECT * FROM `íÝíÝíÝ`; +°¡°¡°¡ +°¡°¡°¡°¡°¡ +°¢°¢°¢°¢°¢ +°£°£°£°£°£ +DESC `íÝíÝíÝ`; +Field Type Null Key Default Extra +°¡°¡°¡ char(6) +SHOW CREATE TABLE `íÝíÝíÝ`; +Table Create Table +íÝíÝíÝ CREATE TABLE `íÝíÝíÝ` ( + `°¡°¡°¡` char(6) NOT NULL default '' +) ENGINE=InnoDB DEFAULT CHARSET=ujis +DROP TABLE `ޱޱޱ`; +DROP TABLE `޲޲޲`; +DROP TABLE `¤¢¤¢¤¢`; +DROP TABLE `¤¤¤¤¤¤`; +DROP TABLE `íÝíÝíÝ`; +DROP TABLE `íÞíÞíÞ`; +CREATE TABLE `ޱޱޱ`(`Ž·Ž·Ž·` char(5)) DEFAULT CHARSET = ujis engine=MYISAM; +CREATE TABLE `޲޲޲`(`޹޹޹` char(5)) DEFAULT CHARSET = ujis engine=MYISAM; +CREATE TABLE `¤¢¤¢¤¢`(`¤­¤­¤­` char(5)) DEFAULT CHARSET = ujis engine=MYISAM; +CREATE TABLE `¤¤¤¤¤¤`(`¤±¤±¤±` char(5)) DEFAULT CHARSET = ujis engine=MYISAM; +CREATE TABLE `íÝíÝíÝ`(`°¡°¡°¡` char(5)) DEFAULT CHARSET = ujis engine=MYISAM; +CREATE TABLE `íÞíÞíÞ`(`°´°´°´` char(5)) DEFAULT CHARSET = ujis engine=MYISAM; +INSERT INTO `ޱޱޱ` VALUES ('ޱޱޱޱޱ'),('޲޲޲޲޲'),('޳޳޳޳޳'); +INSERT INTO `¤¢¤¢¤¢` VALUES ('¤¢¤¢¤¢¤¢¤¢'),('¤¤¤¤¤¤¤¤¤¤'),('¤¦¤¦¤¦¤¦¤¦'); +INSERT INTO `íÝíÝíÝ` VALUES ('°¡°¡°¡°¡°¡'),('°¢°¢°¢°¢°¢'),('°£°£°£°£°£'); +ALTER TABLE `ޱޱޱ` ADD `޶޶޶` char(1) FIRST; +ALTER TABLE `ޱޱޱ` ADD `ޏޏޏ` char(1) AFTER `Ž·Ž·Ž·`; +ALTER TABLE `ޱޱޱ` ADD `޹޹޹` char(1); +ALTER TABLE `ޱޱޱ` ADD INDEX (`޶޶޶`); +ALTER TABLE `ޱޱޱ` ADD PRIMARY KEY (`Ž·Ž·Ž·`); +ALTER TABLE `ޱޱޱ` ADD UNIQUE (`ޏޏޏ`); +ALTER TABLE `ޱޱޱ` CHANGE `޶޶޶` `޶޶` char(1); +ALTER TABLE `ޱޱޱ` MODIFY `Ž·Ž·Ž·` char(6); +SELECT * FROM `ޱޱޱ`; +޶޶ Ž·Ž·Ž· ޏޏޏ ޹޹޹ +NULL ޱޱޱޱޱ NULL NULL +NULL ޲޲޲޲޲ NULL NULL +NULL ޳޳޳޳޳ NULL NULL +DESC `ޱޱޱ`; +Field Type Null Key Default Extra +޶޶ char(1) YES MUL NULL +Ž·Ž·Ž· char(6) PRI +ޏޏޏ char(1) YES MUL NULL +޹޹޹ char(1) YES NULL +SHOW CREATE TABLE `ޱޱޱ`; +Table Create Table +ޱޱޱ CREATE TABLE `ޱޱޱ` ( + `޶޶` char(1) default NULL, + `Ž·Ž·Ž·` char(6) NOT NULL default '', + `ޏޏޏ` char(1) default NULL, + `޹޹޹` char(1) default NULL, + PRIMARY KEY (`Ž·Ž·Ž·`), + UNIQUE KEY `ޏޏޏ` (`ޏޏޏ`), + KEY `޶޶޶` (`޶޶`) +) ENGINE=MyISAM DEFAULT CHARSET=ujis +ALTER TABLE `ޱޱޱ` DROP INDEX `޶޶޶`; +ALTER TABLE `ޱޱޱ` DROP PRIMARY KEY; +ALTER TABLE `ޱޱޱ` DROP INDEX `ޏޏޏ`; +ALTER TABLE `ޱޱޱ` DROP `޶޶`; +ALTER TABLE `ޱޱޱ` DROP `ޏޏޏ`; +ALTER TABLE `ޱޱޱ` DROP `޹޹޹`; +SELECT * FROM `ޱޱޱ`; +Ž·Ž·Ž· +ޱޱޱޱޱ +޲޲޲޲޲ +޳޳޳޳޳ +DESC `ޱޱޱ`; +Field Type Null Key Default Extra +Ž·Ž·Ž· char(6) +SHOW CREATE TABLE `ޱޱޱ`; +Table Create Table +ޱޱޱ CREATE TABLE `ޱޱޱ` ( + `Ž·Ž·Ž·` char(6) NOT NULL default '' +) ENGINE=MyISAM DEFAULT CHARSET=ujis +ALTER TABLE `¤¢¤¢¤¢` ADD `¤«¤«¤«` char(1) FIRST; +ALTER TABLE `¤¢¤¢¤¢` ADD `¤¯¤¯¤¯` char(1) AFTER `¤­¤­¤­`; +ALTER TABLE `¤¢¤¢¤¢` ADD `¤±¤±¤±` char(1); +ALTER TABLE `¤¢¤¢¤¢` ADD INDEX (`¤«¤«¤«`); +ALTER TABLE `¤¢¤¢¤¢` ADD PRIMARY KEY (`¤­¤­¤­`); +ALTER TABLE `¤¢¤¢¤¢` ADD UNIQUE (`¤¯¤¯¤¯`); +ALTER TABLE `¤¢¤¢¤¢` CHANGE `¤«¤«¤«` `¤«¤«` char(1); +ALTER TABLE `¤¢¤¢¤¢` MODIFY `¤­¤­¤­` char(6); +SELECT * FROM `¤¢¤¢¤¢`; +¤«¤« ¤­¤­¤­ ¤¯¤¯¤¯ ¤±¤±¤± +NULL ¤¢¤¢¤¢¤¢¤¢ NULL NULL +NULL ¤¤¤¤¤¤¤¤¤¤ NULL NULL +NULL ¤¦¤¦¤¦¤¦¤¦ NULL NULL +DESC `¤¢¤¢¤¢`; +Field Type Null Key Default Extra +¤«¤« char(1) YES MUL NULL +¤­¤­¤­ char(6) PRI +¤¯¤¯¤¯ char(1) YES MUL NULL +¤±¤±¤± char(1) YES NULL +SHOW CREATE TABLE `¤¢¤¢¤¢`; +Table Create Table +¤¢¤¢¤¢ CREATE TABLE `¤¢¤¢¤¢` ( + `¤«¤«` char(1) default NULL, + `¤­¤­¤­` char(6) NOT NULL default '', + `¤¯¤¯¤¯` char(1) default NULL, + `¤±¤±¤±` char(1) default NULL, + PRIMARY KEY (`¤­¤­¤­`), + UNIQUE KEY `¤¯¤¯¤¯` (`¤¯¤¯¤¯`), + KEY `¤«¤«¤«` (`¤«¤«`) +) ENGINE=MyISAM DEFAULT CHARSET=ujis +ALTER TABLE `¤¢¤¢¤¢` DROP INDEX `¤«¤«¤«`; +ALTER TABLE `¤¢¤¢¤¢` DROP PRIMARY KEY; +ALTER TABLE `¤¢¤¢¤¢` DROP INDEX `¤¯¤¯¤¯`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤«¤«`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤¯¤¯¤¯`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤±¤±¤±`; +SELECT * FROM `¤¢¤¢¤¢`; +¤­¤­¤­ +¤¢¤¢¤¢¤¢¤¢ +¤¤¤¤¤¤¤¤¤¤ +¤¦¤¦¤¦¤¦¤¦ +DESC `¤¢¤¢¤¢`; +Field Type Null Key Default Extra +¤­¤­¤­ char(6) +SHOW CREATE TABLE `¤¢¤¢¤¢`; +Table Create Table +¤¢¤¢¤¢ CREATE TABLE `¤¢¤¢¤¢` ( + `¤­¤­¤­` char(6) NOT NULL default '' +) ENGINE=MyISAM DEFAULT CHARSET=ujis +ALTER TABLE `íÝíÝíÝ` ADD `°¢°¢°¢` char(1) FIRST; +ALTER TABLE `íÝíÝíÝ` ADD `°£°£°£` char(1) AFTER `°¡°¡°¡`; +ALTER TABLE `íÝíÝíÝ` ADD `°´°´°´` char(1); +ALTER TABLE `íÝíÝíÝ` ADD INDEX (`°¢°¢°¢`); +ALTER TABLE `íÝíÝíÝ` ADD PRIMARY KEY (`°¡°¡°¡`); +ALTER TABLE `íÝíÝíÝ` ADD UNIQUE (`°£°£°£`); +ALTER TABLE `íÝíÝíÝ` CHANGE `°¢°¢°¢` `°¢°¢` char(1); +ALTER TABLE `íÝíÝíÝ` MODIFY `°¡°¡°¡` char(6); +SELECT * FROM `íÝíÝíÝ`; +°¢°¢ °¡°¡°¡ °£°£°£ °´°´°´ +NULL °¡°¡°¡°¡°¡ NULL NULL +NULL °¢°¢°¢°¢°¢ NULL NULL +NULL °£°£°£°£°£ NULL NULL +DESC `íÝíÝíÝ`; +Field Type Null Key Default Extra +°¢°¢ char(1) YES MUL NULL +°¡°¡°¡ char(6) PRI +°£°£°£ char(1) YES MUL NULL +°´°´°´ char(1) YES NULL +SHOW CREATE TABLE `íÝíÝíÝ`; +Table Create Table +íÝíÝíÝ CREATE TABLE `íÝíÝíÝ` ( + `°¢°¢` char(1) default NULL, + `°¡°¡°¡` char(6) NOT NULL default '', + `°£°£°£` char(1) default NULL, + `°´°´°´` char(1) default NULL, + PRIMARY KEY (`°¡°¡°¡`), + UNIQUE KEY `°£°£°£` (`°£°£°£`), + KEY `°¢°¢°¢` (`°¢°¢`) +) ENGINE=MyISAM DEFAULT CHARSET=ujis +ALTER TABLE `íÝíÝíÝ` DROP INDEX `°¢°¢°¢`; +ALTER TABLE `íÝíÝíÝ` DROP PRIMARY KEY; +ALTER TABLE `íÝíÝíÝ` DROP INDEX `°£°£°£`; +ALTER TABLE `íÝíÝíÝ` DROP `°¢°¢`; +ALTER TABLE `íÝíÝíÝ` DROP `°£°£°£`; +ALTER TABLE `íÝíÝíÝ` DROP `°´°´°´`; +SELECT * FROM `íÝíÝíÝ`; +°¡°¡°¡ +°¡°¡°¡°¡°¡ +°¢°¢°¢°¢°¢ +°£°£°£°£°£ +DESC `íÝíÝíÝ`; +Field Type Null Key Default Extra +°¡°¡°¡ char(6) +SHOW CREATE TABLE `íÝíÝíÝ`; +Table Create Table +íÝíÝíÝ CREATE TABLE `íÝíÝíÝ` ( + `°¡°¡°¡` char(6) NOT NULL default '' +) ENGINE=MyISAM DEFAULT CHARSET=ujis +DROP TABLE `ޱޱޱ`; +DROP TABLE `޲޲޲`; +DROP TABLE `¤¢¤¢¤¢`; +DROP TABLE `¤¤¤¤¤¤`; +DROP TABLE `íÝíÝíÝ`; +DROP TABLE `íÞíÞíÞ`; +CREATE TABLE `ޱޱޱ`(`Ž·Ž·Ž·` char(5)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TABLE `޲޲޲`(`޹޹޹` char(5)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TABLE `¤¢¤¢¤¢`(`¤­¤­¤­` char(5)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TABLE `¤¤¤¤¤¤`(`¤±¤±¤±` char(5)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TABLE `íÝíÝíÝ`(`°¡°¡°¡` char(5)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TABLE `íÞíÞíÞ`(`°´°´°´` char(5)) DEFAULT CHARSET = ujis engine=HEAP; +INSERT INTO `ޱޱޱ` VALUES ('ޱޱޱޱޱ'),('޲޲޲޲޲'),('޳޳޳޳޳'); +INSERT INTO `¤¢¤¢¤¢` VALUES ('¤¢¤¢¤¢¤¢¤¢'),('¤¤¤¤¤¤¤¤¤¤'),('¤¦¤¦¤¦¤¦¤¦'); +INSERT INTO `íÝíÝíÝ` VALUES ('°¡°¡°¡°¡°¡'),('°¢°¢°¢°¢°¢'),('°£°£°£°£°£'); +ALTER TABLE `ޱޱޱ` ADD `޶޶޶` char(1) FIRST; +ALTER TABLE `ޱޱޱ` ADD `ޏޏޏ` char(1) AFTER `Ž·Ž·Ž·`; +ALTER TABLE `ޱޱޱ` ADD `޹޹޹` char(1); +ALTER TABLE `ޱޱޱ` ADD INDEX (`޶޶޶`); +ALTER TABLE `ޱޱޱ` ADD PRIMARY KEY (`Ž·Ž·Ž·`); +ALTER TABLE `ޱޱޱ` ADD UNIQUE (`ޏޏޏ`); +ALTER TABLE `ޱޱޱ` CHANGE `޶޶޶` `޶޶` char(1); +ALTER TABLE `ޱޱޱ` MODIFY `Ž·Ž·Ž·` char(6); +SELECT * FROM `ޱޱޱ`; +޶޶ Ž·Ž·Ž· ޏޏޏ ޹޹޹ +NULL ޱޱޱޱޱ NULL NULL +NULL ޲޲޲޲޲ NULL NULL +NULL ޳޳޳޳޳ NULL NULL +DESC `ޱޱޱ`; +Field Type Null Key Default Extra +޶޶ char(1) YES MUL NULL +Ž·Ž·Ž· char(6) PRI +ޏޏޏ char(1) YES MUL NULL +޹޹޹ char(1) YES NULL +SHOW CREATE TABLE `ޱޱޱ`; +Table Create Table +ޱޱޱ CREATE TABLE `ޱޱޱ` ( + `޶޶` char(1) default NULL, + `Ž·Ž·Ž·` char(6) NOT NULL default '', + `ޏޏޏ` char(1) default NULL, + `޹޹޹` char(1) default NULL, + PRIMARY KEY (`Ž·Ž·Ž·`), + UNIQUE KEY `ޏޏޏ` (`ޏޏޏ`), + KEY `޶޶޶` (`޶޶`) +) ENGINE=HEAP DEFAULT CHARSET=ujis +ALTER TABLE `ޱޱޱ` DROP INDEX `޶޶޶`; +ALTER TABLE `ޱޱޱ` DROP PRIMARY KEY; +ALTER TABLE `ޱޱޱ` DROP INDEX `ޏޏޏ`; +ALTER TABLE `ޱޱޱ` DROP `޶޶`; +ALTER TABLE `ޱޱޱ` DROP `ޏޏޏ`; +ALTER TABLE `ޱޱޱ` DROP `޹޹޹`; +SELECT * FROM `ޱޱޱ`; +Ž·Ž·Ž· +ޱޱޱޱޱ +޲޲޲޲޲ +޳޳޳޳޳ +DESC `ޱޱޱ`; +Field Type Null Key Default Extra +Ž·Ž·Ž· char(6) +SHOW CREATE TABLE `ޱޱޱ`; +Table Create Table +ޱޱޱ CREATE TABLE `ޱޱޱ` ( + `Ž·Ž·Ž·` char(6) NOT NULL default '' +) ENGINE=HEAP DEFAULT CHARSET=ujis +ALTER TABLE `¤¢¤¢¤¢` ADD `¤«¤«¤«` char(1) FIRST; +ALTER TABLE `¤¢¤¢¤¢` ADD `¤¯¤¯¤¯` char(1) AFTER `¤­¤­¤­`; +ALTER TABLE `¤¢¤¢¤¢` ADD `¤±¤±¤±` char(1); +ALTER TABLE `¤¢¤¢¤¢` ADD INDEX (`¤«¤«¤«`); +ALTER TABLE `¤¢¤¢¤¢` ADD PRIMARY KEY (`¤­¤­¤­`); +ALTER TABLE `¤¢¤¢¤¢` ADD UNIQUE (`¤¯¤¯¤¯`); +ALTER TABLE `¤¢¤¢¤¢` CHANGE `¤«¤«¤«` `¤«¤«` char(1); +ALTER TABLE `¤¢¤¢¤¢` MODIFY `¤­¤­¤­` char(6); +SELECT * FROM `¤¢¤¢¤¢`; +¤«¤« ¤­¤­¤­ ¤¯¤¯¤¯ ¤±¤±¤± +NULL ¤¢¤¢¤¢¤¢¤¢ NULL NULL +NULL ¤¤¤¤¤¤¤¤¤¤ NULL NULL +NULL ¤¦¤¦¤¦¤¦¤¦ NULL NULL +DESC `¤¢¤¢¤¢`; +Field Type Null Key Default Extra +¤«¤« char(1) YES MUL NULL +¤­¤­¤­ char(6) PRI +¤¯¤¯¤¯ char(1) YES MUL NULL +¤±¤±¤± char(1) YES NULL +SHOW CREATE TABLE `¤¢¤¢¤¢`; +Table Create Table +¤¢¤¢¤¢ CREATE TABLE `¤¢¤¢¤¢` ( + `¤«¤«` char(1) default NULL, + `¤­¤­¤­` char(6) NOT NULL default '', + `¤¯¤¯¤¯` char(1) default NULL, + `¤±¤±¤±` char(1) default NULL, + PRIMARY KEY (`¤­¤­¤­`), + UNIQUE KEY `¤¯¤¯¤¯` (`¤¯¤¯¤¯`), + KEY `¤«¤«¤«` (`¤«¤«`) +) ENGINE=HEAP DEFAULT CHARSET=ujis +ALTER TABLE `¤¢¤¢¤¢` DROP INDEX `¤«¤«¤«`; +ALTER TABLE `¤¢¤¢¤¢` DROP PRIMARY KEY; +ALTER TABLE `¤¢¤¢¤¢` DROP INDEX `¤¯¤¯¤¯`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤«¤«`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤¯¤¯¤¯`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤±¤±¤±`; +SELECT * FROM `¤¢¤¢¤¢`; +¤­¤­¤­ +¤¢¤¢¤¢¤¢¤¢ +¤¤¤¤¤¤¤¤¤¤ +¤¦¤¦¤¦¤¦¤¦ +DESC `¤¢¤¢¤¢`; +Field Type Null Key Default Extra +¤­¤­¤­ char(6) +SHOW CREATE TABLE `¤¢¤¢¤¢`; +Table Create Table +¤¢¤¢¤¢ CREATE TABLE `¤¢¤¢¤¢` ( + `¤­¤­¤­` char(6) NOT NULL default '' +) ENGINE=HEAP DEFAULT CHARSET=ujis +ALTER TABLE `íÝíÝíÝ` ADD `°¢°¢°¢` char(1) FIRST; +ALTER TABLE `íÝíÝíÝ` ADD `°£°£°£` char(1) AFTER `°¡°¡°¡`; +ALTER TABLE `íÝíÝíÝ` ADD `°´°´°´` char(1); +ALTER TABLE `íÝíÝíÝ` ADD INDEX (`°¢°¢°¢`); +ALTER TABLE `íÝíÝíÝ` ADD PRIMARY KEY (`°¡°¡°¡`); +ALTER TABLE `íÝíÝíÝ` ADD UNIQUE (`°£°£°£`); +ALTER TABLE `íÝíÝíÝ` CHANGE `°¢°¢°¢` `°¢°¢` char(1); +ALTER TABLE `íÝíÝíÝ` MODIFY `°¡°¡°¡` char(6); +SELECT * FROM `íÝíÝíÝ`; +°¢°¢ °¡°¡°¡ °£°£°£ °´°´°´ +NULL °¡°¡°¡°¡°¡ NULL NULL +NULL °¢°¢°¢°¢°¢ NULL NULL +NULL °£°£°£°£°£ NULL NULL +DESC `íÝíÝíÝ`; +Field Type Null Key Default Extra +°¢°¢ char(1) YES MUL NULL +°¡°¡°¡ char(6) PRI +°£°£°£ char(1) YES MUL NULL +°´°´°´ char(1) YES NULL +SHOW CREATE TABLE `íÝíÝíÝ`; +Table Create Table +íÝíÝíÝ CREATE TABLE `íÝíÝíÝ` ( + `°¢°¢` char(1) default NULL, + `°¡°¡°¡` char(6) NOT NULL default '', + `°£°£°£` char(1) default NULL, + `°´°´°´` char(1) default NULL, + PRIMARY KEY (`°¡°¡°¡`), + UNIQUE KEY `°£°£°£` (`°£°£°£`), + KEY `°¢°¢°¢` (`°¢°¢`) +) ENGINE=HEAP DEFAULT CHARSET=ujis +ALTER TABLE `íÝíÝíÝ` DROP INDEX `°¢°¢°¢`; +ALTER TABLE `íÝíÝíÝ` DROP PRIMARY KEY; +ALTER TABLE `íÝíÝíÝ` DROP INDEX `°£°£°£`; +ALTER TABLE `íÝíÝíÝ` DROP `°¢°¢`; +ALTER TABLE `íÝíÝíÝ` DROP `°£°£°£`; +ALTER TABLE `íÝíÝíÝ` DROP `°´°´°´`; +SELECT * FROM `íÝíÝíÝ`; +°¡°¡°¡ +°¡°¡°¡°¡°¡ +°¢°¢°¢°¢°¢ +°£°£°£°£°£ +DESC `íÝíÝíÝ`; +Field Type Null Key Default Extra +°¡°¡°¡ char(6) +SHOW CREATE TABLE `íÝíÝíÝ`; +Table Create Table +íÝíÝíÝ CREATE TABLE `íÝíÝíÝ` ( + `°¡°¡°¡` char(6) NOT NULL default '' +) ENGINE=HEAP DEFAULT CHARSET=ujis +DROP TABLE `ޱޱޱ`; +DROP TABLE `޲޲޲`; +DROP TABLE `¤¢¤¢¤¢`; +DROP TABLE `¤¤¤¤¤¤`; +DROP TABLE `íÝíÝíÝ`; +DROP TABLE `íÞíÞíÞ`; +CREATE TABLE `ޱޱޱ`(`Ž·Ž·Ž·` char(5)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TABLE `޲޲޲`(`޹޹޹` char(5)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TABLE `¤¢¤¢¤¢`(`¤­¤­¤­` char(5)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TABLE `¤¤¤¤¤¤`(`¤±¤±¤±` char(5)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TABLE `íÝíÝíÝ`(`°¡°¡°¡` char(5)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TABLE `íÞíÞíÞ`(`°´°´°´` char(5)) DEFAULT CHARSET = ujis engine=BDB; +INSERT INTO `ޱޱޱ` VALUES ('ޱޱޱޱޱ'),('޲޲޲޲޲'),('޳޳޳޳޳'); +INSERT INTO `¤¢¤¢¤¢` VALUES ('¤¢¤¢¤¢¤¢¤¢'),('¤¤¤¤¤¤¤¤¤¤'),('¤¦¤¦¤¦¤¦¤¦'); +INSERT INTO `íÝíÝíÝ` VALUES ('°¡°¡°¡°¡°¡'),('°¢°¢°¢°¢°¢'),('°£°£°£°£°£'); +ALTER TABLE `ޱޱޱ` ADD `޶޶޶` char(1) FIRST; +ALTER TABLE `ޱޱޱ` ADD `ޏޏޏ` char(1) AFTER `Ž·Ž·Ž·`; +ALTER TABLE `ޱޱޱ` ADD `޹޹޹` char(1); +ALTER TABLE `ޱޱޱ` ADD INDEX (`޶޶޶`); +ALTER TABLE `ޱޱޱ` ADD PRIMARY KEY (`Ž·Ž·Ž·`); +ALTER TABLE `ޱޱޱ` CHANGE `޶޶޶` `޶޶` char(1); +ALTER TABLE `ޱޱޱ` MODIFY `Ž·Ž·Ž·` char(6); +SELECT * FROM `ޱޱޱ`; +޶޶ Ž·Ž·Ž· ޏޏޏ ޹޹޹ +NULL ޱޱޱޱޱ NULL NULL +NULL ޲޲޲޲޲ NULL NULL +NULL ޳޳޳޳޳ NULL NULL +DESC `ޱޱޱ`; +Field Type Null Key Default Extra +޶޶ char(1) YES MUL NULL +Ž·Ž·Ž· char(6) PRI +ޏޏޏ char(1) YES NULL +޹޹޹ char(1) YES NULL +SHOW CREATE TABLE `ޱޱޱ`; +Table Create Table +ޱޱޱ CREATE TABLE `ޱޱޱ` ( + `޶޶` char(1) default NULL, + `Ž·Ž·Ž·` char(6) NOT NULL default '', + `ޏޏޏ` char(1) default NULL, + `޹޹޹` char(1) default NULL, + PRIMARY KEY (`Ž·Ž·Ž·`), + KEY `޶޶޶` (`޶޶`) +) ENGINE=BerkeleyDB DEFAULT CHARSET=ujis +ALTER TABLE `ޱޱޱ` DROP INDEX `޶޶޶`; +ALTER TABLE `ޱޱޱ` DROP PRIMARY KEY; +ALTER TABLE `ޱޱޱ` DROP `޶޶`; +ALTER TABLE `ޱޱޱ` DROP `ޏޏޏ`; +ALTER TABLE `ޱޱޱ` DROP `޹޹޹`; +SELECT * FROM `ޱޱޱ`; +Ž·Ž·Ž· +ޱޱޱޱޱ +޲޲޲޲޲ +޳޳޳޳޳ +DESC `ޱޱޱ`; +Field Type Null Key Default Extra +Ž·Ž·Ž· char(6) +SHOW CREATE TABLE `ޱޱޱ`; +Table Create Table +ޱޱޱ CREATE TABLE `ޱޱޱ` ( + `Ž·Ž·Ž·` char(6) NOT NULL default '' +) ENGINE=BerkeleyDB DEFAULT CHARSET=ujis +ALTER TABLE `¤¢¤¢¤¢` ADD `¤«¤«¤«` char(1) FIRST; +ALTER TABLE `¤¢¤¢¤¢` ADD `¤¯¤¯¤¯` char(1) AFTER `¤­¤­¤­`; +ALTER TABLE `¤¢¤¢¤¢` ADD `¤±¤±¤±` char(1); +ALTER TABLE `¤¢¤¢¤¢` ADD INDEX (`¤«¤«¤«`); +ALTER TABLE `¤¢¤¢¤¢` ADD PRIMARY KEY (`¤­¤­¤­`); +ALTER TABLE `¤¢¤¢¤¢` CHANGE `¤«¤«¤«` `¤«¤«` char(1); +ALTER TABLE `¤¢¤¢¤¢` MODIFY `¤­¤­¤­` char(6); +SELECT * FROM `¤¢¤¢¤¢`; +¤«¤« ¤­¤­¤­ ¤¯¤¯¤¯ ¤±¤±¤± +NULL ¤¢¤¢¤¢¤¢¤¢ NULL NULL +NULL ¤¤¤¤¤¤¤¤¤¤ NULL NULL +NULL ¤¦¤¦¤¦¤¦¤¦ NULL NULL +DESC `¤¢¤¢¤¢`; +Field Type Null Key Default Extra +¤«¤« char(1) YES MUL NULL +¤­¤­¤­ char(6) PRI +¤¯¤¯¤¯ char(1) YES NULL +¤±¤±¤± char(1) YES NULL +SHOW CREATE TABLE `¤¢¤¢¤¢`; +Table Create Table +¤¢¤¢¤¢ CREATE TABLE `¤¢¤¢¤¢` ( + `¤«¤«` char(1) default NULL, + `¤­¤­¤­` char(6) NOT NULL default '', + `¤¯¤¯¤¯` char(1) default NULL, + `¤±¤±¤±` char(1) default NULL, + PRIMARY KEY (`¤­¤­¤­`), + KEY `¤«¤«¤«` (`¤«¤«`) +) ENGINE=BerkeleyDB DEFAULT CHARSET=ujis +ALTER TABLE `¤¢¤¢¤¢` DROP INDEX `¤«¤«¤«`; +ALTER TABLE `¤¢¤¢¤¢` DROP PRIMARY KEY; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤«¤«`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤¯¤¯¤¯`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤±¤±¤±`; +SELECT * FROM `¤¢¤¢¤¢`; +¤­¤­¤­ +¤¢¤¢¤¢¤¢¤¢ +¤¤¤¤¤¤¤¤¤¤ +¤¦¤¦¤¦¤¦¤¦ +DESC `¤¢¤¢¤¢`; +Field Type Null Key Default Extra +¤­¤­¤­ char(6) +SHOW CREATE TABLE `¤¢¤¢¤¢`; +Table Create Table +¤¢¤¢¤¢ CREATE TABLE `¤¢¤¢¤¢` ( + `¤­¤­¤­` char(6) NOT NULL default '' +) ENGINE=BerkeleyDB DEFAULT CHARSET=ujis +ALTER TABLE `íÝíÝíÝ` ADD `°¢°¢°¢` char(1) FIRST; +ALTER TABLE `íÝíÝíÝ` ADD `°£°£°£` char(1) AFTER `°¡°¡°¡`; +ALTER TABLE `íÝíÝíÝ` ADD `°´°´°´` char(1); +ALTER TABLE `íÝíÝíÝ` ADD INDEX (`°¢°¢°¢`); +ALTER TABLE `íÝíÝíÝ` ADD PRIMARY KEY (`°¡°¡°¡`); +ALTER TABLE `íÝíÝíÝ` CHANGE `°¢°¢°¢` `°¢°¢` char(1); +ALTER TABLE `íÝíÝíÝ` MODIFY `°¡°¡°¡` char(6); +SELECT * FROM `íÝíÝíÝ`; +°¢°¢ °¡°¡°¡ °£°£°£ °´°´°´ +NULL °¡°¡°¡°¡°¡ NULL NULL +NULL °¢°¢°¢°¢°¢ NULL NULL +NULL °£°£°£°£°£ NULL NULL +DESC `íÝíÝíÝ`; +Field Type Null Key Default Extra +°¢°¢ char(1) YES MUL NULL +°¡°¡°¡ char(6) PRI +°£°£°£ char(1) YES NULL +°´°´°´ char(1) YES NULL +SHOW CREATE TABLE `íÝíÝíÝ`; +Table Create Table +íÝíÝíÝ CREATE TABLE `íÝíÝíÝ` ( + `°¢°¢` char(1) default NULL, + `°¡°¡°¡` char(6) NOT NULL default '', + `°£°£°£` char(1) default NULL, + `°´°´°´` char(1) default NULL, + PRIMARY KEY (`°¡°¡°¡`), + KEY `°¢°¢°¢` (`°¢°¢`) +) ENGINE=BerkeleyDB DEFAULT CHARSET=ujis +ALTER TABLE `íÝíÝíÝ` DROP INDEX `°¢°¢°¢`; +ALTER TABLE `íÝíÝíÝ` DROP PRIMARY KEY; +ALTER TABLE `íÝíÝíÝ` DROP `°¢°¢`; +ALTER TABLE `íÝíÝíÝ` DROP `°£°£°£`; +ALTER TABLE `íÝíÝíÝ` DROP `°´°´°´`; +SELECT * FROM `íÝíÝíÝ`; +°¡°¡°¡ +°¡°¡°¡°¡°¡ +°¢°¢°¢°¢°¢ +°£°£°£°£°£ +DESC `íÝíÝíÝ`; +Field Type Null Key Default Extra +°¡°¡°¡ char(6) +SHOW CREATE TABLE `íÝíÝíÝ`; +Table Create Table +íÝíÝíÝ CREATE TABLE `íÝíÝíÝ` ( + `°¡°¡°¡` char(6) NOT NULL default '' +) ENGINE=BerkeleyDB DEFAULT CHARSET=ujis +DROP TABLE `ޱޱޱ`; +DROP TABLE `޲޲޲`; +DROP TABLE `¤¢¤¢¤¢`; +DROP TABLE `¤¤¤¤¤¤`; +DROP TABLE `íÝíÝíÝ`; +DROP TABLE `íÞíÞíÞ`; diff --git a/mysql-test/suite/jp/r/jp_alter_utf8.result b/mysql-test/suite/jp/r/jp_alter_utf8.result new file mode 100755 index 00000000000..19475e06a87 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_alter_utf8.result @@ -0,0 +1,647 @@ +DROP TABLE IF EXISTS `アアア`; +DROP TABLE IF EXISTS `イイイ`; +DROP TABLE IF EXISTS `ã‚ã‚ã‚`; +DROP TABLE IF EXISTS `ã„ã„ã„`; +DROP TABLE IF EXISTS `é¾–é¾–é¾–`; +DROP TABLE IF EXISTS `é¾—é¾—é¾—`; +SET NAMES utf8; +SET character_set_database = utf8; +CREATE TABLE `アアア`(`ï½·ï½·ï½·` char(5)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TABLE `イイイ`(`ケケケ` char(5)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TABLE `ã‚ã‚ã‚`(`ããã` char(5)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TABLE `ã„ã„ã„`(`ã‘ã‘ã‘` char(5)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TABLE `é¾–é¾–é¾–`(`丂丂丂` char(5)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TABLE `é¾—é¾—é¾—`(`乚乚乚` char(5)) DEFAULT CHARSET = utf8 engine=INNODB; +INSERT INTO `アアア` VALUES ('アアアアア'),('イイイイイ'),('ウウウウウ'); +INSERT INTO `ã‚ã‚ã‚` VALUES ('ã‚ã‚ã‚ã‚ã‚'),('ã„ã„ã„ã„ã„'),('ã†ã†ã†ã†ã†'); +INSERT INTO `é¾–é¾–é¾–` VALUES ('丂丂丂丂丂'),('丄丄丄丄丄'),('丅丅丅丅丅'); +ALTER TABLE `アアア` ADD `ï½¶ï½¶ï½¶` char(1) FIRST; +ALTER TABLE `アアア` ADD `ククク` char(1) AFTER `ï½·ï½·ï½·`; +ALTER TABLE `アアア` ADD `ケケケ` char(1); +ALTER TABLE `アアア` ADD INDEX (`ï½¶ï½¶ï½¶`); +ALTER TABLE `アアア` ADD PRIMARY KEY (`ï½·ï½·ï½·`); +ALTER TABLE `アアア` ADD UNIQUE (`ククク`); +ALTER TABLE `アアア` CHANGE `ï½¶ï½¶ï½¶` `ï½¶ï½¶` char(1); +ALTER TABLE `アアア` MODIFY `ï½·ï½·ï½·` char(6); +SELECT * FROM `アアア`; +ï½¶ï½¶ ï½·ï½·ï½· ククク ケケケ +NULL アアアアア NULL NULL +NULL イイイイイ NULL NULL +NULL ウウウウウ NULL NULL +DESC `アアア`; +Field Type Null Key Default Extra +ï½¶ï½¶ char(1) YES MUL NULL +ï½·ï½·ï½· char(6) PRI +ククク char(1) YES MUL NULL +ケケケ char(1) YES NULL +SHOW CREATE TABLE `アアア`; +Table Create Table +アアア CREATE TABLE `アアア` ( + `ï½¶ï½¶` char(1) default NULL, + `ï½·ï½·ï½·` char(6) NOT NULL default '', + `ククク` char(1) default NULL, + `ケケケ` char(1) default NULL, + PRIMARY KEY (`ï½·ï½·ï½·`), + UNIQUE KEY `ククク` (`ククク`), + KEY `ï½¶ï½¶ï½¶` (`ï½¶ï½¶`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 +ALTER TABLE `アアア` DROP INDEX `ï½¶ï½¶ï½¶`; +ALTER TABLE `アアア` DROP PRIMARY KEY; +ALTER TABLE `アアア` DROP INDEX `ククク`; +ALTER TABLE `アアア` DROP `ï½¶ï½¶`; +ALTER TABLE `アアア` DROP `ククク`; +ALTER TABLE `アアア` DROP `ケケケ`; +SELECT * FROM `アアア`; +ï½·ï½·ï½· +アアアアア +イイイイイ +ウウウウウ +DESC `アアア`; +Field Type Null Key Default Extra +ï½·ï½·ï½· char(6) +SHOW CREATE TABLE `アアア`; +Table Create Table +アアア CREATE TABLE `アアア` ( + `ï½·ï½·ï½·` char(6) NOT NULL default '' +) ENGINE=InnoDB DEFAULT CHARSET=utf8 +ALTER TABLE `ã‚ã‚ã‚` ADD `ã‹ã‹ã‹` char(1) FIRST; +ALTER TABLE `ã‚ã‚ã‚` ADD `ããã` char(1) AFTER `ããã`; +ALTER TABLE `ã‚ã‚ã‚` ADD `ã‘ã‘ã‘` char(1); +ALTER TABLE `ã‚ã‚ã‚` ADD INDEX (`ã‹ã‹ã‹`); +ALTER TABLE `ã‚ã‚ã‚` ADD PRIMARY KEY (`ããã`); +ALTER TABLE `ã‚ã‚ã‚` ADD UNIQUE (`ããã`); +ALTER TABLE `ã‚ã‚ã‚` CHANGE `ã‹ã‹ã‹` `ã‹ã‹` char(1); +ALTER TABLE `ã‚ã‚ã‚` MODIFY `ããã` char(6); +SELECT * FROM `ã‚ã‚ã‚`; +ã‹ã‹ ããã ããã ã‘ã‘ã‘ +NULL ã‚ã‚ã‚ã‚ã‚ NULL NULL +NULL ã„ã„ã„ã„ã„ NULL NULL +NULL ã†ã†ã†ã†ã† NULL NULL +DESC `ã‚ã‚ã‚`; +Field Type Null Key Default Extra +ã‹ã‹ char(1) YES MUL NULL +ããã char(6) PRI +ããã char(1) YES MUL NULL +ã‘ã‘ã‘ char(1) YES NULL +SHOW CREATE TABLE `ã‚ã‚ã‚`; +Table Create Table +ã‚ã‚ã‚ CREATE TABLE `ã‚ã‚ã‚` ( + `ã‹ã‹` char(1) default NULL, + `ããã` char(6) NOT NULL default '', + `ããã` char(1) default NULL, + `ã‘ã‘ã‘` char(1) default NULL, + PRIMARY KEY (`ããã`), + UNIQUE KEY `ããã` (`ããã`), + KEY `ã‹ã‹ã‹` (`ã‹ã‹`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 +ALTER TABLE `ã‚ã‚ã‚` DROP INDEX `ã‹ã‹ã‹`; +ALTER TABLE `ã‚ã‚ã‚` DROP PRIMARY KEY; +ALTER TABLE `ã‚ã‚ã‚` DROP INDEX `ããã`; +ALTER TABLE `ã‚ã‚ã‚` DROP `ã‹ã‹`; +ALTER TABLE `ã‚ã‚ã‚` DROP `ããã`; +ALTER TABLE `ã‚ã‚ã‚` DROP `ã‘ã‘ã‘`; +SELECT * FROM `ã‚ã‚ã‚`; +ããã +ã‚ã‚ã‚ã‚ã‚ +ã„ã„ã„ã„ã„ +ã†ã†ã†ã†ã† +DESC `ã‚ã‚ã‚`; +Field Type Null Key Default Extra +ããã char(6) +SHOW CREATE TABLE `ã‚ã‚ã‚`; +Table Create Table +ã‚ã‚ã‚ CREATE TABLE `ã‚ã‚ã‚` ( + `ããã` char(6) NOT NULL default '' +) ENGINE=InnoDB DEFAULT CHARSET=utf8 +ALTER TABLE `é¾–é¾–é¾–` ADD `丄丄丄` char(1) FIRST; +ALTER TABLE `é¾–é¾–é¾–` ADD `丅丅丅` char(1) AFTER `丂丂丂`; +ALTER TABLE `é¾–é¾–é¾–` ADD `乚乚乚` char(1); +ALTER TABLE `é¾–é¾–é¾–` ADD INDEX (`丄丄丄`); +ALTER TABLE `é¾–é¾–é¾–` ADD PRIMARY KEY (`丂丂丂`); +ALTER TABLE `é¾–é¾–é¾–` ADD UNIQUE (`丅丅丅`); +ALTER TABLE `é¾–é¾–é¾–` CHANGE `丄丄丄` `丄丄` char(1); +ALTER TABLE `é¾–é¾–é¾–` MODIFY `丂丂丂` char(6); +SELECT * FROM `é¾–é¾–é¾–`; +丄丄 丂丂丂 丅丅丅 乚乚乚 +NULL 丂丂丂丂丂 NULL NULL +NULL 丄丄丄丄丄 NULL NULL +NULL 丅丅丅丅丅 NULL NULL +DESC `é¾–é¾–é¾–`; +Field Type Null Key Default Extra +丄丄 char(1) YES MUL NULL +丂丂丂 char(6) PRI +丅丅丅 char(1) YES MUL NULL +乚乚乚 char(1) YES NULL +SHOW CREATE TABLE `é¾–é¾–é¾–`; +Table Create Table +é¾–é¾–é¾– CREATE TABLE `é¾–é¾–é¾–` ( + `丄丄` char(1) default NULL, + `丂丂丂` char(6) NOT NULL default '', + `丅丅丅` char(1) default NULL, + `乚乚乚` char(1) default NULL, + PRIMARY KEY (`丂丂丂`), + UNIQUE KEY `丅丅丅` (`丅丅丅`), + KEY `丄丄丄` (`丄丄`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 +ALTER TABLE `é¾–é¾–é¾–` DROP INDEX `丄丄丄`; +ALTER TABLE `é¾–é¾–é¾–` DROP PRIMARY KEY; +ALTER TABLE `é¾–é¾–é¾–` DROP INDEX `丅丅丅`; +ALTER TABLE `é¾–é¾–é¾–` DROP `丄丄`; +ALTER TABLE `é¾–é¾–é¾–` DROP `丅丅丅`; +ALTER TABLE `é¾–é¾–é¾–` DROP `乚乚乚`; +SELECT * FROM `é¾–é¾–é¾–`; +丂丂丂 +丂丂丂丂丂 +丄丄丄丄丄 +丅丅丅丅丅 +DESC `é¾–é¾–é¾–`; +Field Type Null Key Default Extra +丂丂丂 char(6) +SHOW CREATE TABLE `é¾–é¾–é¾–`; +Table Create Table +é¾–é¾–é¾– CREATE TABLE `é¾–é¾–é¾–` ( + `丂丂丂` char(6) NOT NULL default '' +) ENGINE=InnoDB DEFAULT CHARSET=utf8 +DROP TABLE `アアア`; +DROP TABLE `イイイ`; +DROP TABLE `ã‚ã‚ã‚`; +DROP TABLE `ã„ã„ã„`; +DROP TABLE `é¾–é¾–é¾–`; +DROP TABLE `é¾—é¾—é¾—`; +CREATE TABLE `アアア`(`ï½·ï½·ï½·` char(5)) DEFAULT CHARSET = utf8 engine=MYISAM; +CREATE TABLE `イイイ`(`ケケケ` char(5)) DEFAULT CHARSET = utf8 engine=MYISAM; +CREATE TABLE `ã‚ã‚ã‚`(`ããã` char(5)) DEFAULT CHARSET = utf8 engine=MYISAM; +CREATE TABLE `ã„ã„ã„`(`ã‘ã‘ã‘` char(5)) DEFAULT CHARSET = utf8 engine=MYISAM; +CREATE TABLE `é¾–é¾–é¾–`(`丂丂丂` char(5)) DEFAULT CHARSET = utf8 engine=MYISAM; +CREATE TABLE `é¾—é¾—é¾—`(`乚乚乚` char(5)) DEFAULT CHARSET = utf8 engine=MYISAM; +INSERT INTO `アアア` VALUES ('アアアアア'),('イイイイイ'),('ウウウウウ'); +INSERT INTO `ã‚ã‚ã‚` VALUES ('ã‚ã‚ã‚ã‚ã‚'),('ã„ã„ã„ã„ã„'),('ã†ã†ã†ã†ã†'); +INSERT INTO `é¾–é¾–é¾–` VALUES ('丂丂丂丂丂'),('丄丄丄丄丄'),('丅丅丅丅丅'); +ALTER TABLE `アアア` ADD `ï½¶ï½¶ï½¶` char(1) FIRST; +ALTER TABLE `アアア` ADD `ククク` char(1) AFTER `ï½·ï½·ï½·`; +ALTER TABLE `アアア` ADD `ケケケ` char(1); +ALTER TABLE `アアア` ADD INDEX (`ï½¶ï½¶ï½¶`); +ALTER TABLE `アアア` ADD PRIMARY KEY (`ï½·ï½·ï½·`); +ALTER TABLE `アアア` ADD UNIQUE (`ククク`); +ALTER TABLE `アアア` CHANGE `ï½¶ï½¶ï½¶` `ï½¶ï½¶` char(1); +ALTER TABLE `アアア` MODIFY `ï½·ï½·ï½·` char(6); +SELECT * FROM `アアア`; +ï½¶ï½¶ ï½·ï½·ï½· ククク ケケケ +NULL アアアアア NULL NULL +NULL イイイイイ NULL NULL +NULL ウウウウウ NULL NULL +DESC `アアア`; +Field Type Null Key Default Extra +ï½¶ï½¶ char(1) YES MUL NULL +ï½·ï½·ï½· char(6) PRI +ククク char(1) YES MUL NULL +ケケケ char(1) YES NULL +SHOW CREATE TABLE `アアア`; +Table Create Table +アアア CREATE TABLE `アアア` ( + `ï½¶ï½¶` char(1) default NULL, + `ï½·ï½·ï½·` char(6) NOT NULL default '', + `ククク` char(1) default NULL, + `ケケケ` char(1) default NULL, + PRIMARY KEY (`ï½·ï½·ï½·`), + UNIQUE KEY `ククク` (`ククク`), + KEY `ï½¶ï½¶ï½¶` (`ï½¶ï½¶`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 +ALTER TABLE `アアア` DROP INDEX `ï½¶ï½¶ï½¶`; +ALTER TABLE `アアア` DROP PRIMARY KEY; +ALTER TABLE `アアア` DROP INDEX `ククク`; +ALTER TABLE `アアア` DROP `ï½¶ï½¶`; +ALTER TABLE `アアア` DROP `ククク`; +ALTER TABLE `アアア` DROP `ケケケ`; +SELECT * FROM `アアア`; +ï½·ï½·ï½· +アアアアア +イイイイイ +ウウウウウ +DESC `アアア`; +Field Type Null Key Default Extra +ï½·ï½·ï½· char(6) +SHOW CREATE TABLE `アアア`; +Table Create Table +アアア CREATE TABLE `アアア` ( + `ï½·ï½·ï½·` char(6) NOT NULL default '' +) ENGINE=MyISAM DEFAULT CHARSET=utf8 +ALTER TABLE `ã‚ã‚ã‚` ADD `ã‹ã‹ã‹` char(1) FIRST; +ALTER TABLE `ã‚ã‚ã‚` ADD `ããã` char(1) AFTER `ããã`; +ALTER TABLE `ã‚ã‚ã‚` ADD `ã‘ã‘ã‘` char(1); +ALTER TABLE `ã‚ã‚ã‚` ADD INDEX (`ã‹ã‹ã‹`); +ALTER TABLE `ã‚ã‚ã‚` ADD PRIMARY KEY (`ããã`); +ALTER TABLE `ã‚ã‚ã‚` ADD UNIQUE (`ããã`); +ALTER TABLE `ã‚ã‚ã‚` CHANGE `ã‹ã‹ã‹` `ã‹ã‹` char(1); +ALTER TABLE `ã‚ã‚ã‚` MODIFY `ããã` char(6); +SELECT * FROM `ã‚ã‚ã‚`; +ã‹ã‹ ããã ããã ã‘ã‘ã‘ +NULL ã‚ã‚ã‚ã‚ã‚ NULL NULL +NULL ã„ã„ã„ã„ã„ NULL NULL +NULL ã†ã†ã†ã†ã† NULL NULL +DESC `ã‚ã‚ã‚`; +Field Type Null Key Default Extra +ã‹ã‹ char(1) YES MUL NULL +ããã char(6) PRI +ããã char(1) YES MUL NULL +ã‘ã‘ã‘ char(1) YES NULL +SHOW CREATE TABLE `ã‚ã‚ã‚`; +Table Create Table +ã‚ã‚ã‚ CREATE TABLE `ã‚ã‚ã‚` ( + `ã‹ã‹` char(1) default NULL, + `ããã` char(6) NOT NULL default '', + `ããã` char(1) default NULL, + `ã‘ã‘ã‘` char(1) default NULL, + PRIMARY KEY (`ããã`), + UNIQUE KEY `ããã` (`ããã`), + KEY `ã‹ã‹ã‹` (`ã‹ã‹`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 +ALTER TABLE `ã‚ã‚ã‚` DROP INDEX `ã‹ã‹ã‹`; +ALTER TABLE `ã‚ã‚ã‚` DROP PRIMARY KEY; +ALTER TABLE `ã‚ã‚ã‚` DROP INDEX `ããã`; +ALTER TABLE `ã‚ã‚ã‚` DROP `ã‹ã‹`; +ALTER TABLE `ã‚ã‚ã‚` DROP `ããã`; +ALTER TABLE `ã‚ã‚ã‚` DROP `ã‘ã‘ã‘`; +SELECT * FROM `ã‚ã‚ã‚`; +ããã +ã‚ã‚ã‚ã‚ã‚ +ã„ã„ã„ã„ã„ +ã†ã†ã†ã†ã† +DESC `ã‚ã‚ã‚`; +Field Type Null Key Default Extra +ããã char(6) +SHOW CREATE TABLE `ã‚ã‚ã‚`; +Table Create Table +ã‚ã‚ã‚ CREATE TABLE `ã‚ã‚ã‚` ( + `ããã` char(6) NOT NULL default '' +) ENGINE=MyISAM DEFAULT CHARSET=utf8 +ALTER TABLE `é¾–é¾–é¾–` ADD `丄丄丄` char(1) FIRST; +ALTER TABLE `é¾–é¾–é¾–` ADD `丅丅丅` char(1) AFTER `丂丂丂`; +ALTER TABLE `é¾–é¾–é¾–` ADD `乚乚乚` char(1); +ALTER TABLE `é¾–é¾–é¾–` ADD INDEX (`丄丄丄`); +ALTER TABLE `é¾–é¾–é¾–` ADD PRIMARY KEY (`丂丂丂`); +ALTER TABLE `é¾–é¾–é¾–` ADD UNIQUE (`丅丅丅`); +ALTER TABLE `é¾–é¾–é¾–` CHANGE `丄丄丄` `丄丄` char(1); +ALTER TABLE `é¾–é¾–é¾–` MODIFY `丂丂丂` char(6); +SELECT * FROM `é¾–é¾–é¾–`; +丄丄 丂丂丂 丅丅丅 乚乚乚 +NULL 丂丂丂丂丂 NULL NULL +NULL 丄丄丄丄丄 NULL NULL +NULL 丅丅丅丅丅 NULL NULL +DESC `é¾–é¾–é¾–`; +Field Type Null Key Default Extra +丄丄 char(1) YES MUL NULL +丂丂丂 char(6) PRI +丅丅丅 char(1) YES MUL NULL +乚乚乚 char(1) YES NULL +SHOW CREATE TABLE `é¾–é¾–é¾–`; +Table Create Table +é¾–é¾–é¾– CREATE TABLE `é¾–é¾–é¾–` ( + `丄丄` char(1) default NULL, + `丂丂丂` char(6) NOT NULL default '', + `丅丅丅` char(1) default NULL, + `乚乚乚` char(1) default NULL, + PRIMARY KEY (`丂丂丂`), + UNIQUE KEY `丅丅丅` (`丅丅丅`), + KEY `丄丄丄` (`丄丄`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 +ALTER TABLE `é¾–é¾–é¾–` DROP INDEX `丄丄丄`; +ALTER TABLE `é¾–é¾–é¾–` DROP PRIMARY KEY; +ALTER TABLE `é¾–é¾–é¾–` DROP INDEX `丅丅丅`; +ALTER TABLE `é¾–é¾–é¾–` DROP `丄丄`; +ALTER TABLE `é¾–é¾–é¾–` DROP `丅丅丅`; +ALTER TABLE `é¾–é¾–é¾–` DROP `乚乚乚`; +SELECT * FROM `é¾–é¾–é¾–`; +丂丂丂 +丂丂丂丂丂 +丄丄丄丄丄 +丅丅丅丅丅 +DESC `é¾–é¾–é¾–`; +Field Type Null Key Default Extra +丂丂丂 char(6) +SHOW CREATE TABLE `é¾–é¾–é¾–`; +Table Create Table +é¾–é¾–é¾– CREATE TABLE `é¾–é¾–é¾–` ( + `丂丂丂` char(6) NOT NULL default '' +) ENGINE=MyISAM DEFAULT CHARSET=utf8 +DROP TABLE `アアア`; +DROP TABLE `イイイ`; +DROP TABLE `ã‚ã‚ã‚`; +DROP TABLE `ã„ã„ã„`; +DROP TABLE `é¾–é¾–é¾–`; +DROP TABLE `é¾—é¾—é¾—`; +CREATE TABLE `アアア`(`ï½·ï½·ï½·` char(5)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TABLE `イイイ`(`ケケケ` char(5)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TABLE `ã‚ã‚ã‚`(`ããã` char(5)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TABLE `ã„ã„ã„`(`ã‘ã‘ã‘` char(5)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TABLE `é¾–é¾–é¾–`(`丂丂丂` char(5)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TABLE `é¾—é¾—é¾—`(`乚乚乚` char(5)) DEFAULT CHARSET = utf8 engine=HEAP; +INSERT INTO `アアア` VALUES ('アアアアア'),('イイイイイ'),('ウウウウウ'); +INSERT INTO `ã‚ã‚ã‚` VALUES ('ã‚ã‚ã‚ã‚ã‚'),('ã„ã„ã„ã„ã„'),('ã†ã†ã†ã†ã†'); +INSERT INTO `é¾–é¾–é¾–` VALUES ('丂丂丂丂丂'),('丄丄丄丄丄'),('丅丅丅丅丅'); +ALTER TABLE `アアア` ADD `ï½¶ï½¶ï½¶` char(1) FIRST; +ALTER TABLE `アアア` ADD `ククク` char(1) AFTER `ï½·ï½·ï½·`; +ALTER TABLE `アアア` ADD `ケケケ` char(1); +ALTER TABLE `アアア` ADD INDEX (`ï½¶ï½¶ï½¶`); +ALTER TABLE `アアア` ADD PRIMARY KEY (`ï½·ï½·ï½·`); +ALTER TABLE `アアア` ADD UNIQUE (`ククク`); +ALTER TABLE `アアア` CHANGE `ï½¶ï½¶ï½¶` `ï½¶ï½¶` char(1); +ALTER TABLE `アアア` MODIFY `ï½·ï½·ï½·` char(6); +SELECT * FROM `アアア`; +ï½¶ï½¶ ï½·ï½·ï½· ククク ケケケ +NULL アアアアア NULL NULL +NULL イイイイイ NULL NULL +NULL ウウウウウ NULL NULL +DESC `アアア`; +Field Type Null Key Default Extra +ï½¶ï½¶ char(1) YES MUL NULL +ï½·ï½·ï½· char(6) PRI +ククク char(1) YES MUL NULL +ケケケ char(1) YES NULL +SHOW CREATE TABLE `アアア`; +Table Create Table +アアア CREATE TABLE `アアア` ( + `ï½¶ï½¶` char(1) default NULL, + `ï½·ï½·ï½·` char(6) NOT NULL default '', + `ククク` char(1) default NULL, + `ケケケ` char(1) default NULL, + PRIMARY KEY (`ï½·ï½·ï½·`), + UNIQUE KEY `ククク` (`ククク`), + KEY `ï½¶ï½¶ï½¶` (`ï½¶ï½¶`) +) ENGINE=HEAP DEFAULT CHARSET=utf8 +ALTER TABLE `アアア` DROP INDEX `ï½¶ï½¶ï½¶`; +ALTER TABLE `アアア` DROP PRIMARY KEY; +ALTER TABLE `アアア` DROP INDEX `ククク`; +ALTER TABLE `アアア` DROP `ï½¶ï½¶`; +ALTER TABLE `アアア` DROP `ククク`; +ALTER TABLE `アアア` DROP `ケケケ`; +SELECT * FROM `アアア`; +ï½·ï½·ï½· +アアアアア +イイイイイ +ウウウウウ +DESC `アアア`; +Field Type Null Key Default Extra +ï½·ï½·ï½· char(6) +SHOW CREATE TABLE `アアア`; +Table Create Table +アアア CREATE TABLE `アアア` ( + `ï½·ï½·ï½·` char(6) NOT NULL default '' +) ENGINE=HEAP DEFAULT CHARSET=utf8 +ALTER TABLE `ã‚ã‚ã‚` ADD `ã‹ã‹ã‹` char(1) FIRST; +ALTER TABLE `ã‚ã‚ã‚` ADD `ããã` char(1) AFTER `ããã`; +ALTER TABLE `ã‚ã‚ã‚` ADD `ã‘ã‘ã‘` char(1); +ALTER TABLE `ã‚ã‚ã‚` ADD INDEX (`ã‹ã‹ã‹`); +ALTER TABLE `ã‚ã‚ã‚` ADD PRIMARY KEY (`ããã`); +ALTER TABLE `ã‚ã‚ã‚` ADD UNIQUE (`ããã`); +ALTER TABLE `ã‚ã‚ã‚` CHANGE `ã‹ã‹ã‹` `ã‹ã‹` char(1); +ALTER TABLE `ã‚ã‚ã‚` MODIFY `ããã` char(6); +SELECT * FROM `ã‚ã‚ã‚`; +ã‹ã‹ ããã ããã ã‘ã‘ã‘ +NULL ã‚ã‚ã‚ã‚ã‚ NULL NULL +NULL ã„ã„ã„ã„ã„ NULL NULL +NULL ã†ã†ã†ã†ã† NULL NULL +DESC `ã‚ã‚ã‚`; +Field Type Null Key Default Extra +ã‹ã‹ char(1) YES MUL NULL +ããã char(6) PRI +ããã char(1) YES MUL NULL +ã‘ã‘ã‘ char(1) YES NULL +SHOW CREATE TABLE `ã‚ã‚ã‚`; +Table Create Table +ã‚ã‚ã‚ CREATE TABLE `ã‚ã‚ã‚` ( + `ã‹ã‹` char(1) default NULL, + `ããã` char(6) NOT NULL default '', + `ããã` char(1) default NULL, + `ã‘ã‘ã‘` char(1) default NULL, + PRIMARY KEY (`ããã`), + UNIQUE KEY `ããã` (`ããã`), + KEY `ã‹ã‹ã‹` (`ã‹ã‹`) +) ENGINE=HEAP DEFAULT CHARSET=utf8 +ALTER TABLE `ã‚ã‚ã‚` DROP INDEX `ã‹ã‹ã‹`; +ALTER TABLE `ã‚ã‚ã‚` DROP PRIMARY KEY; +ALTER TABLE `ã‚ã‚ã‚` DROP INDEX `ããã`; +ALTER TABLE `ã‚ã‚ã‚` DROP `ã‹ã‹`; +ALTER TABLE `ã‚ã‚ã‚` DROP `ããã`; +ALTER TABLE `ã‚ã‚ã‚` DROP `ã‘ã‘ã‘`; +SELECT * FROM `ã‚ã‚ã‚`; +ããã +ã‚ã‚ã‚ã‚ã‚ +ã„ã„ã„ã„ã„ +ã†ã†ã†ã†ã† +DESC `ã‚ã‚ã‚`; +Field Type Null Key Default Extra +ããã char(6) +SHOW CREATE TABLE `ã‚ã‚ã‚`; +Table Create Table +ã‚ã‚ã‚ CREATE TABLE `ã‚ã‚ã‚` ( + `ããã` char(6) NOT NULL default '' +) ENGINE=HEAP DEFAULT CHARSET=utf8 +ALTER TABLE `é¾–é¾–é¾–` ADD `丄丄丄` char(1) FIRST; +ALTER TABLE `é¾–é¾–é¾–` ADD `丅丅丅` char(1) AFTER `丂丂丂`; +ALTER TABLE `é¾–é¾–é¾–` ADD `乚乚乚` char(1); +ALTER TABLE `é¾–é¾–é¾–` ADD INDEX (`丄丄丄`); +ALTER TABLE `é¾–é¾–é¾–` ADD PRIMARY KEY (`丂丂丂`); +ALTER TABLE `é¾–é¾–é¾–` ADD UNIQUE (`丅丅丅`); +ALTER TABLE `é¾–é¾–é¾–` CHANGE `丄丄丄` `丄丄` char(1); +ALTER TABLE `é¾–é¾–é¾–` MODIFY `丂丂丂` char(6); +SELECT * FROM `é¾–é¾–é¾–`; +丄丄 丂丂丂 丅丅丅 乚乚乚 +NULL 丂丂丂丂丂 NULL NULL +NULL 丄丄丄丄丄 NULL NULL +NULL 丅丅丅丅丅 NULL NULL +DESC `é¾–é¾–é¾–`; +Field Type Null Key Default Extra +丄丄 char(1) YES MUL NULL +丂丂丂 char(6) PRI +丅丅丅 char(1) YES MUL NULL +乚乚乚 char(1) YES NULL +SHOW CREATE TABLE `é¾–é¾–é¾–`; +Table Create Table +é¾–é¾–é¾– CREATE TABLE `é¾–é¾–é¾–` ( + `丄丄` char(1) default NULL, + `丂丂丂` char(6) NOT NULL default '', + `丅丅丅` char(1) default NULL, + `乚乚乚` char(1) default NULL, + PRIMARY KEY (`丂丂丂`), + UNIQUE KEY `丅丅丅` (`丅丅丅`), + KEY `丄丄丄` (`丄丄`) +) ENGINE=HEAP DEFAULT CHARSET=utf8 +ALTER TABLE `é¾–é¾–é¾–` DROP INDEX `丄丄丄`; +ALTER TABLE `é¾–é¾–é¾–` DROP PRIMARY KEY; +ALTER TABLE `é¾–é¾–é¾–` DROP INDEX `丅丅丅`; +ALTER TABLE `é¾–é¾–é¾–` DROP `丄丄`; +ALTER TABLE `é¾–é¾–é¾–` DROP `丅丅丅`; +ALTER TABLE `é¾–é¾–é¾–` DROP `乚乚乚`; +SELECT * FROM `é¾–é¾–é¾–`; +丂丂丂 +丂丂丂丂丂 +丄丄丄丄丄 +丅丅丅丅丅 +DESC `é¾–é¾–é¾–`; +Field Type Null Key Default Extra +丂丂丂 char(6) +SHOW CREATE TABLE `é¾–é¾–é¾–`; +Table Create Table +é¾–é¾–é¾– CREATE TABLE `é¾–é¾–é¾–` ( + `丂丂丂` char(6) NOT NULL default '' +) ENGINE=HEAP DEFAULT CHARSET=utf8 +DROP TABLE `アアア`; +DROP TABLE `イイイ`; +DROP TABLE `ã‚ã‚ã‚`; +DROP TABLE `ã„ã„ã„`; +DROP TABLE `é¾–é¾–é¾–`; +DROP TABLE `é¾—é¾—é¾—`; +CREATE TABLE `アアア`(`ï½·ï½·ï½·` char(5)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TABLE `イイイ`(`ケケケ` char(5)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TABLE `ã‚ã‚ã‚`(`ããã` char(5)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TABLE `ã„ã„ã„`(`ã‘ã‘ã‘` char(5)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TABLE `é¾–é¾–é¾–`(`丂丂丂` char(5)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TABLE `é¾—é¾—é¾—`(`乚乚乚` char(5)) DEFAULT CHARSET = utf8 engine=BDB; +INSERT INTO `アアア` VALUES ('アアアアア'),('イイイイイ'),('ウウウウウ'); +INSERT INTO `ã‚ã‚ã‚` VALUES ('ã‚ã‚ã‚ã‚ã‚'),('ã„ã„ã„ã„ã„'),('ã†ã†ã†ã†ã†'); +INSERT INTO `é¾–é¾–é¾–` VALUES ('丂丂丂丂丂'),('丄丄丄丄丄'),('丅丅丅丅丅'); +ALTER TABLE `アアア` ADD `ï½¶ï½¶ï½¶` char(1) FIRST; +ALTER TABLE `アアア` ADD `ククク` char(1) AFTER `ï½·ï½·ï½·`; +ALTER TABLE `アアア` ADD `ケケケ` char(1); +ALTER TABLE `アアア` ADD INDEX (`ï½¶ï½¶ï½¶`); +ALTER TABLE `アアア` ADD PRIMARY KEY (`ï½·ï½·ï½·`); +ALTER TABLE `アアア` CHANGE `ï½¶ï½¶ï½¶` `ï½¶ï½¶` char(1); +ALTER TABLE `アアア` MODIFY `ï½·ï½·ï½·` char(6); +SELECT * FROM `アアア`; +ï½¶ï½¶ ï½·ï½·ï½· ククク ケケケ +NULL アアアアア NULL NULL +NULL イイイイイ NULL NULL +NULL ウウウウウ NULL NULL +DESC `アアア`; +Field Type Null Key Default Extra +ï½¶ï½¶ char(1) YES MUL NULL +ï½·ï½·ï½· char(6) PRI +ククク char(1) YES NULL +ケケケ char(1) YES NULL +SHOW CREATE TABLE `アアア`; +Table Create Table +アアア CREATE TABLE `アアア` ( + `ï½¶ï½¶` char(1) default NULL, + `ï½·ï½·ï½·` char(6) NOT NULL default '', + `ククク` char(1) default NULL, + `ケケケ` char(1) default NULL, + PRIMARY KEY (`ï½·ï½·ï½·`), + KEY `ï½¶ï½¶ï½¶` (`ï½¶ï½¶`) +) ENGINE=BerkeleyDB DEFAULT CHARSET=utf8 +ALTER TABLE `アアア` DROP INDEX `ï½¶ï½¶ï½¶`; +ALTER TABLE `アアア` DROP PRIMARY KEY; +ALTER TABLE `アアア` DROP `ï½¶ï½¶`; +ALTER TABLE `アアア` DROP `ククク`; +ALTER TABLE `アアア` DROP `ケケケ`; +SELECT * FROM `アアア`; +ï½·ï½·ï½· +アアアアア +イイイイイ +ウウウウウ +DESC `アアア`; +Field Type Null Key Default Extra +ï½·ï½·ï½· char(6) +SHOW CREATE TABLE `アアア`; +Table Create Table +アアア CREATE TABLE `アアア` ( + `ï½·ï½·ï½·` char(6) NOT NULL default '' +) ENGINE=BerkeleyDB DEFAULT CHARSET=utf8 +ALTER TABLE `ã‚ã‚ã‚` ADD `ã‹ã‹ã‹` char(1) FIRST; +ALTER TABLE `ã‚ã‚ã‚` ADD `ããã` char(1) AFTER `ããã`; +ALTER TABLE `ã‚ã‚ã‚` ADD `ã‘ã‘ã‘` char(1); +ALTER TABLE `ã‚ã‚ã‚` ADD INDEX (`ã‹ã‹ã‹`); +ALTER TABLE `ã‚ã‚ã‚` ADD PRIMARY KEY (`ããã`); +ALTER TABLE `ã‚ã‚ã‚` CHANGE `ã‹ã‹ã‹` `ã‹ã‹` char(1); +ALTER TABLE `ã‚ã‚ã‚` MODIFY `ããã` char(6); +SELECT * FROM `ã‚ã‚ã‚`; +ã‹ã‹ ããã ããã ã‘ã‘ã‘ +NULL ã‚ã‚ã‚ã‚ã‚ NULL NULL +NULL ã„ã„ã„ã„ã„ NULL NULL +NULL ã†ã†ã†ã†ã† NULL NULL +DESC `ã‚ã‚ã‚`; +Field Type Null Key Default Extra +ã‹ã‹ char(1) YES MUL NULL +ããã char(6) PRI +ããã char(1) YES NULL +ã‘ã‘ã‘ char(1) YES NULL +SHOW CREATE TABLE `ã‚ã‚ã‚`; +Table Create Table +ã‚ã‚ã‚ CREATE TABLE `ã‚ã‚ã‚` ( + `ã‹ã‹` char(1) default NULL, + `ããã` char(6) NOT NULL default '', + `ããã` char(1) default NULL, + `ã‘ã‘ã‘` char(1) default NULL, + PRIMARY KEY (`ããã`), + KEY `ã‹ã‹ã‹` (`ã‹ã‹`) +) ENGINE=BerkeleyDB DEFAULT CHARSET=utf8 +ALTER TABLE `ã‚ã‚ã‚` DROP INDEX `ã‹ã‹ã‹`; +ALTER TABLE `ã‚ã‚ã‚` DROP PRIMARY KEY; +ALTER TABLE `ã‚ã‚ã‚` DROP `ã‹ã‹`; +ALTER TABLE `ã‚ã‚ã‚` DROP `ããã`; +ALTER TABLE `ã‚ã‚ã‚` DROP `ã‘ã‘ã‘`; +SELECT * FROM `ã‚ã‚ã‚`; +ããã +ã‚ã‚ã‚ã‚ã‚ +ã„ã„ã„ã„ã„ +ã†ã†ã†ã†ã† +DESC `ã‚ã‚ã‚`; +Field Type Null Key Default Extra +ããã char(6) +SHOW CREATE TABLE `ã‚ã‚ã‚`; +Table Create Table +ã‚ã‚ã‚ CREATE TABLE `ã‚ã‚ã‚` ( + `ããã` char(6) NOT NULL default '' +) ENGINE=BerkeleyDB DEFAULT CHARSET=utf8 +ALTER TABLE `é¾–é¾–é¾–` ADD `丄丄丄` char(1) FIRST; +ALTER TABLE `é¾–é¾–é¾–` ADD `丅丅丅` char(1) AFTER `丂丂丂`; +ALTER TABLE `é¾–é¾–é¾–` ADD `乚乚乚` char(1); +ALTER TABLE `é¾–é¾–é¾–` ADD INDEX (`丄丄丄`); +ALTER TABLE `é¾–é¾–é¾–` ADD PRIMARY KEY (`丂丂丂`); +ALTER TABLE `é¾–é¾–é¾–` CHANGE `丄丄丄` `丄丄` char(1); +ALTER TABLE `é¾–é¾–é¾–` MODIFY `丂丂丂` char(6); +SELECT * FROM `é¾–é¾–é¾–`; +丄丄 丂丂丂 丅丅丅 乚乚乚 +NULL 丂丂丂丂丂 NULL NULL +NULL 丄丄丄丄丄 NULL NULL +NULL 丅丅丅丅丅 NULL NULL +DESC `é¾–é¾–é¾–`; +Field Type Null Key Default Extra +丄丄 char(1) YES MUL NULL +丂丂丂 char(6) PRI +丅丅丅 char(1) YES NULL +乚乚乚 char(1) YES NULL +SHOW CREATE TABLE `é¾–é¾–é¾–`; +Table Create Table +é¾–é¾–é¾– CREATE TABLE `é¾–é¾–é¾–` ( + `丄丄` char(1) default NULL, + `丂丂丂` char(6) NOT NULL default '', + `丅丅丅` char(1) default NULL, + `乚乚乚` char(1) default NULL, + PRIMARY KEY (`丂丂丂`), + KEY `丄丄丄` (`丄丄`) +) ENGINE=BerkeleyDB DEFAULT CHARSET=utf8 +ALTER TABLE `é¾–é¾–é¾–` DROP INDEX `丄丄丄`; +ALTER TABLE `é¾–é¾–é¾–` DROP PRIMARY KEY; +ALTER TABLE `é¾–é¾–é¾–` DROP `丄丄`; +ALTER TABLE `é¾–é¾–é¾–` DROP `丅丅丅`; +ALTER TABLE `é¾–é¾–é¾–` DROP `乚乚乚`; +SELECT * FROM `é¾–é¾–é¾–`; +丂丂丂 +丂丂丂丂丂 +丄丄丄丄丄 +丅丅丅丅丅 +DESC `é¾–é¾–é¾–`; +Field Type Null Key Default Extra +丂丂丂 char(6) +SHOW CREATE TABLE `é¾–é¾–é¾–`; +Table Create Table +é¾–é¾–é¾– CREATE TABLE `é¾–é¾–é¾–` ( + `丂丂丂` char(6) NOT NULL default '' +) ENGINE=BerkeleyDB DEFAULT CHARSET=utf8 +DROP TABLE `アアア`; +DROP TABLE `イイイ`; +DROP TABLE `ã‚ã‚ã‚`; +DROP TABLE `ã„ã„ã„`; +DROP TABLE `é¾–é¾–é¾–`; +DROP TABLE `é¾—é¾—é¾—`; diff --git a/mysql-test/suite/jp/r/jp_charlength_sjis.result b/mysql-test/suite/jp/r/jp_charlength_sjis.result new file mode 100755 index 00000000000..57d538ef8d0 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_charlength_sjis.result @@ -0,0 +1,146 @@ +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +drop table if exists `‚s‚P‚P`; +drop table if exists `‚s‚P‚Q`; +SET NAMES sjis; +SET character_set_database = sjis; +CREATE TABLE `‚s‚P` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Q` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚R` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚S` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚T` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚U` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚V` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚W` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚X` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚O` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚P` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚Q` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +INSERT INTO `‚s‚P` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +INSERT INTO `‚s‚S` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +INSERT INTO `‚s‚V` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +SELECT `‚b‚P`, CHAR_LENGTH(`‚b‚P`) FROM `‚s‚P`; +‚b‚P CHAR_LENGTH(`‚b‚P`) + 0 +± 1 +±² 2 +±²³ 3 +±²³´ 4 +±²³´µ 5 +SELECT `‚b‚P`, CHAR_LENGTH(`‚b‚P`) FROM `‚s‚Q`; +‚b‚P CHAR_LENGTH(`‚b‚P`) + 0 +‚  1 +‚ ‚¢ 2 +‚ ‚¢‚¤ 3 +‚ ‚¢‚¤‚¦ 4 +‚ ‚¢‚¤‚¦‚¨ 5 +SELECT `‚b‚P`, CHAR_LENGTH(`‚b‚P`) FROM `‚s‚R`; +‚b‚P CHAR_LENGTH(`‚b‚P`) + 0 +ƒ\ 1 +ƒ\\ 2 +ƒ\\•\ 3 +ƒ\\•\—\ 4 +ƒ\\•\—\\ 5 +SELECT `‚b‚P`, CHAR_LENGTH(`‚b‚P`) FROM `‚s‚S`; +‚b‚P CHAR_LENGTH(`‚b‚P`) + 0 +± 1 +±² 2 +±²³ 3 +±²³´ 4 +±²³´µ 5 +SELECT `‚b‚P`, CHAR_LENGTH(`‚b‚P`) FROM `‚s‚T`; +‚b‚P CHAR_LENGTH(`‚b‚P`) + 0 +‚  1 +‚ ‚¢ 2 +‚ ‚¢‚¤ 3 +‚ ‚¢‚¤‚¦ 4 +‚ ‚¢‚¤‚¦‚¨ 5 +SELECT `‚b‚P`, CHAR_LENGTH(`‚b‚P`) FROM `‚s‚U`; +‚b‚P CHAR_LENGTH(`‚b‚P`) + 0 +ƒ\ 1 +ƒ\\ 2 +ƒ\\•\ 3 +ƒ\\•\—\ 4 +ƒ\\•\—\\ 5 +SELECT `‚b‚P`, CHAR_LENGTH(`‚b‚P`) FROM `‚s‚V`; +‚b‚P CHAR_LENGTH(`‚b‚P`) +±²³´µ 5 +±²³´ 4 +±²³ 3 +±² 2 +± 1 + 0 +SELECT `‚b‚P`, CHAR_LENGTH(`‚b‚P`) FROM `‚s‚W`; +‚b‚P CHAR_LENGTH(`‚b‚P`) +‚ ‚¢‚¤‚¦‚¨ 5 +‚ ‚¢‚¤‚¦ 4 +‚ ‚¢‚¤ 3 +‚ ‚¢ 2 +‚  1 + 0 +SELECT `‚b‚P`, CHAR_LENGTH(`‚b‚P`) FROM `‚s‚X`; +‚b‚P CHAR_LENGTH(`‚b‚P`) +ƒ\\•\—\\ 5 +ƒ\\•\—\ 4 +ƒ\\•\ 3 +ƒ\\ 2 +ƒ\ 1 + 0 +SELECT `‚b‚P`, CHAR_LENGTH(`‚b‚P`) FROM `‚s‚P‚O`; +‚b‚P CHAR_LENGTH(`‚b‚P`) +±²³´µ 5 +±²³´ 4 +±²³ 3 +±² 2 +± 1 + 0 +SELECT `‚b‚P`, CHAR_LENGTH(`‚b‚P`) FROM `‚s‚P‚P`; +‚b‚P CHAR_LENGTH(`‚b‚P`) +‚ ‚¢‚¤‚¦‚¨ 5 +‚ ‚¢‚¤‚¦ 4 +‚ ‚¢‚¤ 3 +‚ ‚¢ 2 +‚  1 + 0 +SELECT `‚b‚P`, CHAR_LENGTH(`‚b‚P`) FROM `‚s‚P‚Q`; +‚b‚P CHAR_LENGTH(`‚b‚P`) +ƒ\\•\—\\ 5 +ƒ\\•\—\ 4 +ƒ\\•\ 3 +ƒ\\ 2 +ƒ\ 1 + 0 +DROP TABLE `‚s‚P`; +DROP TABLE `‚s‚Q`; +DROP TABLE `‚s‚R`; +DROP TABLE `‚s‚S`; +DROP TABLE `‚s‚T`; +DROP TABLE `‚s‚U`; +DROP TABLE `‚s‚V`; +DROP TABLE `‚s‚W`; +DROP TABLE `‚s‚X`; +DROP TABLE `‚s‚P‚O`; +DROP TABLE `‚s‚P‚P`; +DROP TABLE `‚s‚P‚Q`; diff --git a/mysql-test/suite/jp/r/jp_charlength_ucs2.result b/mysql-test/suite/jp/r/jp_charlength_ucs2.result new file mode 100755 index 00000000000..3695ee5159a --- /dev/null +++ b/mysql-test/suite/jp/r/jp_charlength_ucs2.result @@ -0,0 +1,147 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; +CREATE TABLE `£Ô£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£±`; +£Ã£± CHAR_LENGTH(`£Ã£±`) + 0 +ޱ 1 +ޱ޲ 2 +ޱ޲޳ 3 +ޱ޲޳޴ 4 +ޱ޲޳޴޵ 5 +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£²`; +£Ã£± CHAR_LENGTH(`£Ã£±`) + 0 +¤¢ 1 +¤¢¤¤ 2 +¤¢¤¤¤¦ 3 +¤¢¤¤¤¦¤¨ 4 +¤¢¤¤¤¦¤¨¤ª 5 +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£³`; +£Ã£± CHAR_LENGTH(`£Ã£±`) + 0 +íÜ 1 +íÜíÝ 2 +íÜíÝíÞ 3 +íÜíÝíÞíß 4 +íÜíÝíÞíßíà 5 +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£´`; +£Ã£± CHAR_LENGTH(`£Ã£±`) + 0 +ޱ 1 +ޱ޲ 2 +ޱ޲޳ 3 +ޱ޲޳޴ 4 +ޱ޲޳޴޵ 5 +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£µ`; +£Ã£± CHAR_LENGTH(`£Ã£±`) + 0 +¤¢ 1 +¤¢¤¤ 2 +¤¢¤¤¤¦ 3 +¤¢¤¤¤¦¤¨ 4 +¤¢¤¤¤¦¤¨¤ª 5 +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£¶`; +£Ã£± CHAR_LENGTH(`£Ã£±`) + 0 +íÜ 1 +íÜíÝ 2 +íÜíÝíÞ 3 +íÜíÝíÞíß 4 +íÜíÝíÞíßíà 5 +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£·`; +£Ã£± CHAR_LENGTH(`£Ã£±`) +ޱ޲޳޴޵ 5 +ޱ޲޳޴ 4 +ޱ޲޳ 3 +ޱ޲ 2 +ޱ 1 + 0 +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£¸`; +£Ã£± CHAR_LENGTH(`£Ã£±`) +¤¢¤¤¤¦¤¨¤ª 5 +¤¢¤¤¤¦¤¨ 4 +¤¢¤¤¤¦ 3 +¤¢¤¤ 2 +¤¢ 1 + 0 +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£¹`; +£Ã£± CHAR_LENGTH(`£Ã£±`) +íÜíÝíÞíßíà 5 +íÜíÝíÞíß 4 +íÜíÝíÞ 3 +íÜíÝ 2 +íÜ 1 + 0 +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£±£°`; +£Ã£± CHAR_LENGTH(`£Ã£±`) +ޱ޲޳޴޵ 5 +ޱ޲޳޴ 4 +ޱ޲޳ 3 +ޱ޲ 2 +ޱ 1 + 0 +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£±£±`; +£Ã£± CHAR_LENGTH(`£Ã£±`) +¤¢¤¤¤¦¤¨¤ª 5 +¤¢¤¤¤¦¤¨ 4 +¤¢¤¤¤¦ 3 +¤¢¤¤ 2 +¤¢ 1 + 0 +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£±£²`; +£Ã£± CHAR_LENGTH(`£Ã£±`) +íÜíÝíÞíßíà 5 +íÜíÝíÞíß 4 +íÜíÝíÞ 3 +íÜíÝ 2 +íÜ 1 + 0 +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/r/jp_charlength_ujis.result b/mysql-test/suite/jp/r/jp_charlength_ujis.result new file mode 100755 index 00000000000..ccfbf4fa3a1 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_charlength_ujis.result @@ -0,0 +1,146 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +SET NAMES ujis; +SET character_set_database = ujis; +CREATE TABLE `£Ô£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£±`; +£Ã£± CHAR_LENGTH(`£Ã£±`) + 0 +ޱ 1 +ޱ޲ 2 +ޱ޲޳ 3 +ޱ޲޳޴ 4 +ޱ޲޳޴޵ 5 +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£²`; +£Ã£± CHAR_LENGTH(`£Ã£±`) + 0 +¤¢ 1 +¤¢¤¤ 2 +¤¢¤¤¤¦ 3 +¤¢¤¤¤¦¤¨ 4 +¤¢¤¤¤¦¤¨¤ª 5 +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£³`; +£Ã£± CHAR_LENGTH(`£Ã£±`) + 0 +íÜ 1 +íÜíÝ 2 +íÜíÝíÞ 3 +íÜíÝíÞíß 4 +íÜíÝíÞíßíà 5 +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£´`; +£Ã£± CHAR_LENGTH(`£Ã£±`) + 0 +ޱ 1 +ޱ޲ 2 +ޱ޲޳ 3 +ޱ޲޳޴ 4 +ޱ޲޳޴޵ 5 +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£µ`; +£Ã£± CHAR_LENGTH(`£Ã£±`) + 0 +¤¢ 1 +¤¢¤¤ 2 +¤¢¤¤¤¦ 3 +¤¢¤¤¤¦¤¨ 4 +¤¢¤¤¤¦¤¨¤ª 5 +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£¶`; +£Ã£± CHAR_LENGTH(`£Ã£±`) + 0 +íÜ 1 +íÜíÝ 2 +íÜíÝíÞ 3 +íÜíÝíÞíß 4 +íÜíÝíÞíßíà 5 +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£·`; +£Ã£± CHAR_LENGTH(`£Ã£±`) +ޱ޲޳޴޵ 5 +ޱ޲޳޴ 4 +ޱ޲޳ 3 +ޱ޲ 2 +ޱ 1 + 0 +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£¸`; +£Ã£± CHAR_LENGTH(`£Ã£±`) +¤¢¤¤¤¦¤¨¤ª 5 +¤¢¤¤¤¦¤¨ 4 +¤¢¤¤¤¦ 3 +¤¢¤¤ 2 +¤¢ 1 + 0 +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£¹`; +£Ã£± CHAR_LENGTH(`£Ã£±`) +íÜíÝíÞíßíà 5 +íÜíÝíÞíß 4 +íÜíÝíÞ 3 +íÜíÝ 2 +íÜ 1 + 0 +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£±£°`; +£Ã£± CHAR_LENGTH(`£Ã£±`) +ޱ޲޳޴޵ 5 +ޱ޲޳޴ 4 +ޱ޲޳ 3 +ޱ޲ 2 +ޱ 1 + 0 +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£±£±`; +£Ã£± CHAR_LENGTH(`£Ã£±`) +¤¢¤¤¤¦¤¨¤ª 5 +¤¢¤¤¤¦¤¨ 4 +¤¢¤¤¤¦ 3 +¤¢¤¤ 2 +¤¢ 1 + 0 +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£±£²`; +£Ã£± CHAR_LENGTH(`£Ã£±`) +íÜíÝíÞíßíà 5 +íÜíÝíÞíß 4 +íÜíÝíÞ 3 +íÜíÝ 2 +íÜ 1 + 0 +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/r/jp_charlength_utf8.result b/mysql-test/suite/jp/r/jp_charlength_utf8.result new file mode 100755 index 00000000000..d4d7f68f933 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_charlength_utf8.result @@ -0,0 +1,146 @@ +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +drop table if exists `T11`; +drop table if exists `T12`; +SET NAMES utf8; +SET character_set_database = utf8; +CREATE TABLE `T1` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T11` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T12` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +INSERT INTO `T1` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `T3` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +INSERT INTO `T1ï¼` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `T12` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +SELECT `C1`, CHAR_LENGTH(`C1`) FROM `T1`; +C1 CHAR_LENGTH(`C1`) + 0 +ï½± 1 +アイ 2 +アイウ 3 +アイウエ 4 +アイウエオ 5 +SELECT `C1`, CHAR_LENGTH(`C1`) FROM `ï¼´ï¼’`; +C1 CHAR_LENGTH(`C1`) + 0 +ã‚ 1 +ã‚ã„ 2 +ã‚ã„ㆠ3 +ã‚ã„ã†ãˆ 4 +ã‚ã„ã†ãˆãŠ 5 +SELECT `C1`, CHAR_LENGTH(`C1`) FROM `T3`; +C1 CHAR_LENGTH(`C1`) + 0 +é¾” 1 +龔龖 2 +龔龖龗 3 +龔龖龗龞 4 +龔龖龗龞龡 5 +SELECT `C1`, CHAR_LENGTH(`C1`) FROM `ï¼´ï¼”`; +C1 CHAR_LENGTH(`C1`) + 0 +ï½± 1 +アイ 2 +アイウ 3 +アイウエ 4 +アイウエオ 5 +SELECT `C1`, CHAR_LENGTH(`C1`) FROM `T5`; +C1 CHAR_LENGTH(`C1`) + 0 +ã‚ 1 +ã‚ã„ 2 +ã‚ã„ㆠ3 +ã‚ã„ã†ãˆ 4 +ã‚ã„ã†ãˆãŠ 5 +SELECT `C1`, CHAR_LENGTH(`C1`) FROM `ï¼´ï¼–`; +C1 CHAR_LENGTH(`C1`) + 0 +é¾” 1 +龔龖 2 +龔龖龗 3 +龔龖龗龞 4 +龔龖龗龞龡 5 +SELECT `C1`, CHAR_LENGTH(`C1`) FROM `ï¼´ï¼—`; +C1 CHAR_LENGTH(`C1`) +アイウエオ 5 +アイウエ 4 +アイウ 3 +アイ 2 +ï½± 1 + 0 +SELECT `C1`, CHAR_LENGTH(`C1`) FROM `T8`; +C1 CHAR_LENGTH(`C1`) +ã‚ã„ã†ãˆãŠ 5 +ã‚ã„ã†ãˆ 4 +ã‚ã„ㆠ3 +ã‚ã„ 2 +ã‚ 1 + 0 +SELECT `C1`, CHAR_LENGTH(`C1`) FROM `ï¼´ï¼™`; +C1 CHAR_LENGTH(`C1`) +龔龖龗龞龡 5 +龔龖龗龞 4 +龔龖龗 3 +龔龖 2 +é¾” 1 + 0 +SELECT `C1`, CHAR_LENGTH(`C1`) FROM `T1ï¼`; +C1 CHAR_LENGTH(`C1`) +アイウエオ 5 +アイウエ 4 +アイウ 3 +アイ 2 +ï½± 1 + 0 +SELECT `C1`, CHAR_LENGTH(`C1`) FROM `T11`; +C1 CHAR_LENGTH(`C1`) +ã‚ã„ã†ãˆãŠ 5 +ã‚ã„ã†ãˆ 4 +ã‚ã„ㆠ3 +ã‚ã„ 2 +ã‚ 1 + 0 +SELECT `C1`, CHAR_LENGTH(`C1`) FROM `T12`; +C1 CHAR_LENGTH(`C1`) +龔龖龗龞龡 5 +龔龖龗龞 4 +龔龖龗 3 +龔龖 2 +é¾” 1 + 0 +DROP TABLE `T1`; +DROP TABLE `ï¼´ï¼’`; +DROP TABLE `T3`; +DROP TABLE `ï¼´ï¼”`; +DROP TABLE `T5`; +DROP TABLE `ï¼´ï¼–`; +DROP TABLE `ï¼´ï¼—`; +DROP TABLE `T8`; +DROP TABLE `ï¼´ï¼™`; +DROP TABLE `T1ï¼`; +DROP TABLE `T11`; +DROP TABLE `T12`; diff --git a/mysql-test/suite/jp/r/jp_charset_sjis.result b/mysql-test/suite/jp/r/jp_charset_sjis.result new file mode 100755 index 00000000000..80ef24a7334 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_charset_sjis.result @@ -0,0 +1,230 @@ +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +drop table if exists `‚s‚P‚P`; +drop table if exists `‚s‚P‚Q`; +SET NAMES sjis; +SET character_set_database = sjis; +CREATE TABLE `‚s‚P` (`‚b‚P` char(20)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Q` (`‚b‚P` char(20)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚R` (`‚b‚P` char(20)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚S` (`‚b‚P` char(20)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚T` (`‚b‚P` char(20)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚U` (`‚b‚P` char(20)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚V` (`‚b‚P` char(20)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚W` (`‚b‚P` char(20)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚X` (`‚b‚P` char(20)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚O` (`‚b‚P` char(20)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚P` (`‚b‚P` char(20)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚Q` (`‚b‚P` char(20)) DEFAULT CHARSET = sjis engine = bdb; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `‚s‚P`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `‚s‚Q`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `‚s‚R`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `‚s‚S`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `‚s‚T`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `‚s‚U`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `‚s‚V`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `‚s‚W`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `‚s‚X`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `‚s‚P‚O`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `‚s‚P‚P`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `‚s‚P‚Q`; +SELECT DISTINCT CHARSET(`‚b‚P`) FROM `‚s‚P`; +CHARSET(`‚b‚P`) +sjis +SELECT DISTINCT CHARSET(`‚b‚P`) FROM `‚s‚Q`; +CHARSET(`‚b‚P`) +sjis +SELECT DISTINCT CHARSET(`‚b‚P`) FROM `‚s‚R`; +CHARSET(`‚b‚P`) +sjis +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING utf8)) FROM `‚s‚P`; +CHARSET(CONVERT(`‚b‚P` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ucs2)) FROM `‚s‚P`; +CHARSET(CONVERT(`‚b‚P` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING sjis)) FROM `‚s‚P`; +CHARSET(CONVERT(`‚b‚P` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ujis)) FROM `‚s‚P`; +CHARSET(CONVERT(`‚b‚P` USING ujis)) +ujis +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING utf8)) FROM `‚s‚Q`; +CHARSET(CONVERT(`‚b‚P` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ucs2)) FROM `‚s‚Q`; +CHARSET(CONVERT(`‚b‚P` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING sjis)) FROM `‚s‚Q`; +CHARSET(CONVERT(`‚b‚P` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ujis)) FROM `‚s‚Q`; +CHARSET(CONVERT(`‚b‚P` USING ujis)) +ujis +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING utf8)) FROM `‚s‚R`; +CHARSET(CONVERT(`‚b‚P` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ucs2)) FROM `‚s‚R`; +CHARSET(CONVERT(`‚b‚P` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING sjis)) FROM `‚s‚R`; +CHARSET(CONVERT(`‚b‚P` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ujis)) FROM `‚s‚R`; +CHARSET(CONVERT(`‚b‚P` USING ujis)) +ujis +SELECT DISTINCT CHARSET(`‚b‚P`) FROM `‚s‚S`; +CHARSET(`‚b‚P`) +sjis +SELECT DISTINCT CHARSET(`‚b‚P`) FROM `‚s‚T`; +CHARSET(`‚b‚P`) +sjis +SELECT DISTINCT CHARSET(`‚b‚P`) FROM `‚s‚U`; +CHARSET(`‚b‚P`) +sjis +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING utf8)) FROM `‚s‚S`; +CHARSET(CONVERT(`‚b‚P` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ucs2)) FROM `‚s‚S`; +CHARSET(CONVERT(`‚b‚P` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING sjis)) FROM `‚s‚S`; +CHARSET(CONVERT(`‚b‚P` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ujis)) FROM `‚s‚S`; +CHARSET(CONVERT(`‚b‚P` USING ujis)) +ujis +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING utf8)) FROM `‚s‚T`; +CHARSET(CONVERT(`‚b‚P` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ucs2)) FROM `‚s‚T`; +CHARSET(CONVERT(`‚b‚P` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING sjis)) FROM `‚s‚T`; +CHARSET(CONVERT(`‚b‚P` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ujis)) FROM `‚s‚T`; +CHARSET(CONVERT(`‚b‚P` USING ujis)) +ujis +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING utf8)) FROM `‚s‚U`; +CHARSET(CONVERT(`‚b‚P` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ucs2)) FROM `‚s‚U`; +CHARSET(CONVERT(`‚b‚P` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING sjis)) FROM `‚s‚U`; +CHARSET(CONVERT(`‚b‚P` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ujis)) FROM `‚s‚U`; +CHARSET(CONVERT(`‚b‚P` USING ujis)) +ujis +SELECT DISTINCT CHARSET(`‚b‚P`) FROM `‚s‚V`; +CHARSET(`‚b‚P`) +sjis +SELECT DISTINCT CHARSET(`‚b‚P`) FROM `‚s‚W`; +CHARSET(`‚b‚P`) +sjis +SELECT DISTINCT CHARSET(`‚b‚P`) FROM `‚s‚X`; +CHARSET(`‚b‚P`) +sjis +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING utf8)) FROM `‚s‚V`; +CHARSET(CONVERT(`‚b‚P` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ucs2)) FROM `‚s‚V`; +CHARSET(CONVERT(`‚b‚P` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING sjis)) FROM `‚s‚V`; +CHARSET(CONVERT(`‚b‚P` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ujis)) FROM `‚s‚V`; +CHARSET(CONVERT(`‚b‚P` USING ujis)) +ujis +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING utf8)) FROM `‚s‚W`; +CHARSET(CONVERT(`‚b‚P` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ucs2)) FROM `‚s‚W`; +CHARSET(CONVERT(`‚b‚P` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING sjis)) FROM `‚s‚W`; +CHARSET(CONVERT(`‚b‚P` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ujis)) FROM `‚s‚W`; +CHARSET(CONVERT(`‚b‚P` USING ujis)) +ujis +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING utf8)) FROM `‚s‚X`; +CHARSET(CONVERT(`‚b‚P` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ucs2)) FROM `‚s‚X`; +CHARSET(CONVERT(`‚b‚P` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING sjis)) FROM `‚s‚X`; +CHARSET(CONVERT(`‚b‚P` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ujis)) FROM `‚s‚X`; +CHARSET(CONVERT(`‚b‚P` USING ujis)) +ujis +SELECT DISTINCT CHARSET(`‚b‚P`) FROM `‚s‚P‚O`; +CHARSET(`‚b‚P`) +sjis +SELECT DISTINCT CHARSET(`‚b‚P`) FROM `‚s‚P‚P`; +CHARSET(`‚b‚P`) +sjis +SELECT DISTINCT CHARSET(`‚b‚P`) FROM `‚s‚P‚Q`; +CHARSET(`‚b‚P`) +sjis +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING utf8)) FROM `‚s‚P‚O`; +CHARSET(CONVERT(`‚b‚P` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ucs2)) FROM `‚s‚P‚O`; +CHARSET(CONVERT(`‚b‚P` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING sjis)) FROM `‚s‚P‚O`; +CHARSET(CONVERT(`‚b‚P` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ujis)) FROM `‚s‚P‚O`; +CHARSET(CONVERT(`‚b‚P` USING ujis)) +ujis +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING utf8)) FROM `‚s‚P‚P`; +CHARSET(CONVERT(`‚b‚P` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ucs2)) FROM `‚s‚P‚P`; +CHARSET(CONVERT(`‚b‚P` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING sjis)) FROM `‚s‚P‚P`; +CHARSET(CONVERT(`‚b‚P` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ujis)) FROM `‚s‚P‚P`; +CHARSET(CONVERT(`‚b‚P` USING ujis)) +ujis +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING utf8)) FROM `‚s‚P‚Q`; +CHARSET(CONVERT(`‚b‚P` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ucs2)) FROM `‚s‚P‚Q`; +CHARSET(CONVERT(`‚b‚P` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING sjis)) FROM `‚s‚P‚Q`; +CHARSET(CONVERT(`‚b‚P` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ujis)) FROM `‚s‚P‚Q`; +CHARSET(CONVERT(`‚b‚P` USING ujis)) +ujis +drop table `‚s‚P`; +drop table `‚s‚Q`; +drop table `‚s‚R`; +drop table `‚s‚S`; +drop table `‚s‚T`; +drop table `‚s‚U`; +drop table `‚s‚V`; +drop table `‚s‚W`; +drop table `‚s‚X`; +drop table `‚s‚P‚O`; +drop table `‚s‚P‚P`; +drop table `‚s‚P‚Q`; diff --git a/mysql-test/suite/jp/r/jp_charset_ucs2.result b/mysql-test/suite/jp/r/jp_charset_ucs2.result new file mode 100755 index 00000000000..d121e98fc00 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_charset_ucs2.result @@ -0,0 +1,306 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +SET NAMES ujis; +SET character_set_database = ucs2; +CREATE TABLE `£Ô£±` (`£Ã£±` char(20)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(20)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(20)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(20)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(20)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(20)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(20)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(20)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(20)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(20)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(20)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(20)) DEFAULT CHARSET = ucs2 engine = bdb; +INSERT INTO `£Ô£±` VALUES +('PQRSTUVWXYZ[\\]^_') +,(' Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯') +,('Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿') +,('ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ') +,('ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß'); +INSERT INTO `£Ô£²` VALUES +('¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç') +,('¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û') +,('¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³') +,('¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³') +,('¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³') +,('¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³') +,('¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³'); +INSERT INTO `£Ô£³` VALUES +('¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦') +,('°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç') +,('°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û') +,('°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï') +,('¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³') +,('í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ') +,('íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ'); +INSERT INTO `£Ô£´` VALUES +('PQRSTUVWXYZ[\\]^_') +,(' Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯') +,('Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿') +,('ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ') +,('ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß'); +INSERT INTO `£Ô£µ` VALUES +('¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç') +,('¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û') +,('¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³') +,('¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³') +,('¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³') +,('¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³') +,('¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³'); +INSERT INTO `£Ô£¶` VALUES +('¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦') +,('°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç') +,('°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û') +,('°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï') +,('¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³') +,('í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ') +,('íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ'); +INSERT INTO `£Ô£·` VALUES +('PQRSTUVWXYZ[\\]^_') +,(' Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯') +,('Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿') +,('ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ') +,('ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß'); +INSERT INTO `£Ô£¸` VALUES +('¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç') +,('¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û') +,('¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³') +,('¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³') +,('¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³') +,('¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³') +,('¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³'); +INSERT INTO `£Ô£¹` VALUES +('¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦') +,('°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç') +,('°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û') +,('°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï') +,('¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³') +,('í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ') +,('íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ'); +INSERT INTO `£Ô£±£°` VALUES +('PQRSTUVWXYZ[\\]^_') +,(' Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯') +,('Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿') +,('ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ') +,('ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß'); +INSERT INTO `£Ô£±£±` VALUES +('¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç') +,('¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û') +,('¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³') +,('¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³') +,('¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³') +,('¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³') +,('¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³'); +INSERT INTO `£Ô£±£²` VALUES +('¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦') +,('°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç') +,('°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û') +,('°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï') +,('¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³') +,('í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ') +,('íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ'); +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£±`; +CHARSET(`£Ã£±`) +ucs2 +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£²`; +CHARSET(`£Ã£±`) +ucs2 +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£³`; +CHARSET(`£Ã£±`) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£±`; +CHARSET(CONVERT(`£Ã£±` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£±`; +CHARSET(CONVERT(`£Ã£±` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£±`; +CHARSET(CONVERT(`£Ã£±` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£±`; +CHARSET(CONVERT(`£Ã£±` USING ujis)) +ujis +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£²`; +CHARSET(CONVERT(`£Ã£±` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£²`; +CHARSET(CONVERT(`£Ã£±` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£²`; +CHARSET(CONVERT(`£Ã£±` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£²`; +CHARSET(CONVERT(`£Ã£±` USING ujis)) +ujis +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£³`; +CHARSET(CONVERT(`£Ã£±` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£³`; +CHARSET(CONVERT(`£Ã£±` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£³`; +CHARSET(CONVERT(`£Ã£±` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£³`; +CHARSET(CONVERT(`£Ã£±` USING ujis)) +ujis +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£´`; +CHARSET(`£Ã£±`) +ucs2 +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£µ`; +CHARSET(`£Ã£±`) +ucs2 +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£¶`; +CHARSET(`£Ã£±`) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£´`; +CHARSET(CONVERT(`£Ã£±` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£´`; +CHARSET(CONVERT(`£Ã£±` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£´`; +CHARSET(CONVERT(`£Ã£±` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£´`; +CHARSET(CONVERT(`£Ã£±` USING ujis)) +ujis +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£µ`; +CHARSET(CONVERT(`£Ã£±` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£µ`; +CHARSET(CONVERT(`£Ã£±` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£µ`; +CHARSET(CONVERT(`£Ã£±` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£µ`; +CHARSET(CONVERT(`£Ã£±` USING ujis)) +ujis +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£¶`; +CHARSET(CONVERT(`£Ã£±` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£¶`; +CHARSET(CONVERT(`£Ã£±` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£¶`; +CHARSET(CONVERT(`£Ã£±` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£¶`; +CHARSET(CONVERT(`£Ã£±` USING ujis)) +ujis +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£·`; +CHARSET(`£Ã£±`) +ucs2 +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£¸`; +CHARSET(`£Ã£±`) +ucs2 +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£¹`; +CHARSET(`£Ã£±`) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£·`; +CHARSET(CONVERT(`£Ã£±` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£·`; +CHARSET(CONVERT(`£Ã£±` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£·`; +CHARSET(CONVERT(`£Ã£±` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£·`; +CHARSET(CONVERT(`£Ã£±` USING ujis)) +ujis +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£¸`; +CHARSET(CONVERT(`£Ã£±` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£¸`; +CHARSET(CONVERT(`£Ã£±` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£¸`; +CHARSET(CONVERT(`£Ã£±` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£¸`; +CHARSET(CONVERT(`£Ã£±` USING ujis)) +ujis +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£¹`; +CHARSET(CONVERT(`£Ã£±` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£¹`; +CHARSET(CONVERT(`£Ã£±` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£¹`; +CHARSET(CONVERT(`£Ã£±` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£¹`; +CHARSET(CONVERT(`£Ã£±` USING ujis)) +ujis +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£±£°`; +CHARSET(`£Ã£±`) +ucs2 +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£±£±`; +CHARSET(`£Ã£±`) +ucs2 +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£±£²`; +CHARSET(`£Ã£±`) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£±£°`; +CHARSET(CONVERT(`£Ã£±` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£±£°`; +CHARSET(CONVERT(`£Ã£±` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£±£°`; +CHARSET(CONVERT(`£Ã£±` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£±£°`; +CHARSET(CONVERT(`£Ã£±` USING ujis)) +ujis +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£±£±`; +CHARSET(CONVERT(`£Ã£±` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£±£±`; +CHARSET(CONVERT(`£Ã£±` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£±£±`; +CHARSET(CONVERT(`£Ã£±` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£±£±`; +CHARSET(CONVERT(`£Ã£±` USING ujis)) +ujis +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£±£²`; +CHARSET(CONVERT(`£Ã£±` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£±£²`; +CHARSET(CONVERT(`£Ã£±` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£±£²`; +CHARSET(CONVERT(`£Ã£±` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£±£²`; +CHARSET(CONVERT(`£Ã£±` USING ujis)) +ujis +drop table `£Ô£±`; +drop table `£Ô£²`; +drop table `£Ô£³`; +drop table `£Ô£´`; +drop table `£Ô£µ`; +drop table `£Ô£¶`; +drop table `£Ô£·`; +drop table `£Ô£¸`; +drop table `£Ô£¹`; +drop table `£Ô£±£°`; +drop table `£Ô£±£±`; +drop table `£Ô£±£²`; diff --git a/mysql-test/suite/jp/r/jp_charset_ujis.result b/mysql-test/suite/jp/r/jp_charset_ujis.result new file mode 100755 index 00000000000..964477896bd --- /dev/null +++ b/mysql-test/suite/jp/r/jp_charset_ujis.result @@ -0,0 +1,230 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +SET NAMES ujis; +SET character_set_database = ujis; +CREATE TABLE `£Ô£±` (`£Ã£±` char(20)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(20)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(20)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(20)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(20)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(20)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(20)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(20)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(20)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(20)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(20)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(20)) DEFAULT CHARSET = ujis engine = bdb; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_ujis.dat' INTO TABLE `£Ô£±`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_ujis.dat' INTO TABLE `£Ô£²`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_ujis.dat' INTO TABLE `£Ô£³`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_ujis.dat' INTO TABLE `£Ô£´`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_ujis.dat' INTO TABLE `£Ô£µ`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_ujis.dat' INTO TABLE `£Ô£¶`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_ujis.dat' INTO TABLE `£Ô£·`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_ujis.dat' INTO TABLE `£Ô£¸`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_ujis.dat' INTO TABLE `£Ô£¹`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_ujis.dat' INTO TABLE `£Ô£±£°`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_ujis.dat' INTO TABLE `£Ô£±£±`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_ujis.dat' INTO TABLE `£Ô£±£²`; +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£±`; +CHARSET(`£Ã£±`) +ujis +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£²`; +CHARSET(`£Ã£±`) +ujis +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£³`; +CHARSET(`£Ã£±`) +ujis +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£±`; +CHARSET(CONVERT(`£Ã£±` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£±`; +CHARSET(CONVERT(`£Ã£±` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£±`; +CHARSET(CONVERT(`£Ã£±` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£±`; +CHARSET(CONVERT(`£Ã£±` USING ujis)) +ujis +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£²`; +CHARSET(CONVERT(`£Ã£±` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£²`; +CHARSET(CONVERT(`£Ã£±` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£²`; +CHARSET(CONVERT(`£Ã£±` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£²`; +CHARSET(CONVERT(`£Ã£±` USING ujis)) +ujis +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£³`; +CHARSET(CONVERT(`£Ã£±` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£³`; +CHARSET(CONVERT(`£Ã£±` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£³`; +CHARSET(CONVERT(`£Ã£±` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£³`; +CHARSET(CONVERT(`£Ã£±` USING ujis)) +ujis +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£´`; +CHARSET(`£Ã£±`) +ujis +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£µ`; +CHARSET(`£Ã£±`) +ujis +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£¶`; +CHARSET(`£Ã£±`) +ujis +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£´`; +CHARSET(CONVERT(`£Ã£±` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£´`; +CHARSET(CONVERT(`£Ã£±` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£´`; +CHARSET(CONVERT(`£Ã£±` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£´`; +CHARSET(CONVERT(`£Ã£±` USING ujis)) +ujis +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£µ`; +CHARSET(CONVERT(`£Ã£±` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£µ`; +CHARSET(CONVERT(`£Ã£±` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£µ`; +CHARSET(CONVERT(`£Ã£±` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£µ`; +CHARSET(CONVERT(`£Ã£±` USING ujis)) +ujis +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£¶`; +CHARSET(CONVERT(`£Ã£±` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£¶`; +CHARSET(CONVERT(`£Ã£±` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£¶`; +CHARSET(CONVERT(`£Ã£±` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£¶`; +CHARSET(CONVERT(`£Ã£±` USING ujis)) +ujis +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£·`; +CHARSET(`£Ã£±`) +ujis +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£¸`; +CHARSET(`£Ã£±`) +ujis +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£¹`; +CHARSET(`£Ã£±`) +ujis +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£·`; +CHARSET(CONVERT(`£Ã£±` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£·`; +CHARSET(CONVERT(`£Ã£±` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£·`; +CHARSET(CONVERT(`£Ã£±` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£·`; +CHARSET(CONVERT(`£Ã£±` USING ujis)) +ujis +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£¸`; +CHARSET(CONVERT(`£Ã£±` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£¸`; +CHARSET(CONVERT(`£Ã£±` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£¸`; +CHARSET(CONVERT(`£Ã£±` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£¸`; +CHARSET(CONVERT(`£Ã£±` USING ujis)) +ujis +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£¹`; +CHARSET(CONVERT(`£Ã£±` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£¹`; +CHARSET(CONVERT(`£Ã£±` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£¹`; +CHARSET(CONVERT(`£Ã£±` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£¹`; +CHARSET(CONVERT(`£Ã£±` USING ujis)) +ujis +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£±£°`; +CHARSET(`£Ã£±`) +ujis +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£±£±`; +CHARSET(`£Ã£±`) +ujis +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£±£²`; +CHARSET(`£Ã£±`) +ujis +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£±£°`; +CHARSET(CONVERT(`£Ã£±` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£±£°`; +CHARSET(CONVERT(`£Ã£±` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£±£°`; +CHARSET(CONVERT(`£Ã£±` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£±£°`; +CHARSET(CONVERT(`£Ã£±` USING ujis)) +ujis +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£±£±`; +CHARSET(CONVERT(`£Ã£±` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£±£±`; +CHARSET(CONVERT(`£Ã£±` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£±£±`; +CHARSET(CONVERT(`£Ã£±` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£±£±`; +CHARSET(CONVERT(`£Ã£±` USING ujis)) +ujis +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£±£²`; +CHARSET(CONVERT(`£Ã£±` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£±£²`; +CHARSET(CONVERT(`£Ã£±` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£±£²`; +CHARSET(CONVERT(`£Ã£±` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£±£²`; +CHARSET(CONVERT(`£Ã£±` USING ujis)) +ujis +drop table `£Ô£±`; +drop table `£Ô£²`; +drop table `£Ô£³`; +drop table `£Ô£´`; +drop table `£Ô£µ`; +drop table `£Ô£¶`; +drop table `£Ô£·`; +drop table `£Ô£¸`; +drop table `£Ô£¹`; +drop table `£Ô£±£°`; +drop table `£Ô£±£±`; +drop table `£Ô£±£²`; diff --git a/mysql-test/suite/jp/r/jp_charset_utf8.result b/mysql-test/suite/jp/r/jp_charset_utf8.result new file mode 100755 index 00000000000..2fdd3fb1a6b --- /dev/null +++ b/mysql-test/suite/jp/r/jp_charset_utf8.result @@ -0,0 +1,230 @@ +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +drop table if exists `T11`; +drop table if exists `T12`; +SET NAMES utf8; +SET character_set_database = utf8; +CREATE TABLE `T1` (`C1` char(20)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’` (`C1` char(20)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3` (`C1` char(20)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”` (`C1` char(20)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5` (`C1` char(20)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–` (`C1` char(20)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—` (`C1` char(20)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8` (`C1` char(20)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™` (`C1` char(20)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼` (`C1` char(20)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T11` (`C1` char(20)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T12` (`C1` char(20)) DEFAULT CHARSET = utf8 engine = bdb; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_utf8.dat' INTO TABLE `T1`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_utf8.dat' INTO TABLE `ï¼´ï¼’`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_utf8.dat' INTO TABLE `T3`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_utf8.dat' INTO TABLE `ï¼´ï¼”`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_utf8.dat' INTO TABLE `T5`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_utf8.dat' INTO TABLE `ï¼´ï¼–`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_utf8.dat' INTO TABLE `ï¼´ï¼—`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_utf8.dat' INTO TABLE `T8`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_utf8.dat' INTO TABLE `ï¼´ï¼™`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_utf8.dat' INTO TABLE `T1ï¼`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_utf8.dat' INTO TABLE `T11`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_utf8.dat' INTO TABLE `T12`; +SELECT DISTINCT CHARSET(`C1`) FROM `T1`; +CHARSET(`C1`) +utf8 +SELECT DISTINCT CHARSET(`C1`) FROM `ï¼´ï¼’`; +CHARSET(`C1`) +utf8 +SELECT DISTINCT CHARSET(`C1`) FROM `T3`; +CHARSET(`C1`) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`C1` USING utf8)) FROM `T1`; +CHARSET(CONVERT(`C1` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ucs2)) FROM `T1`; +CHARSET(CONVERT(`C1` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`C1` USING sjis)) FROM `T1`; +CHARSET(CONVERT(`C1` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ujis)) FROM `T1`; +CHARSET(CONVERT(`C1` USING ujis)) +ujis +SELECT DISTINCT CHARSET(CONVERT(`C1` USING utf8)) FROM `ï¼´ï¼’`; +CHARSET(CONVERT(`C1` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ucs2)) FROM `ï¼´ï¼’`; +CHARSET(CONVERT(`C1` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`C1` USING sjis)) FROM `ï¼´ï¼’`; +CHARSET(CONVERT(`C1` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ujis)) FROM `ï¼´ï¼’`; +CHARSET(CONVERT(`C1` USING ujis)) +ujis +SELECT DISTINCT CHARSET(CONVERT(`C1` USING utf8)) FROM `T3`; +CHARSET(CONVERT(`C1` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ucs2)) FROM `T3`; +CHARSET(CONVERT(`C1` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`C1` USING sjis)) FROM `T3`; +CHARSET(CONVERT(`C1` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ujis)) FROM `T3`; +CHARSET(CONVERT(`C1` USING ujis)) +ujis +SELECT DISTINCT CHARSET(`C1`) FROM `ï¼´ï¼”`; +CHARSET(`C1`) +utf8 +SELECT DISTINCT CHARSET(`C1`) FROM `T5`; +CHARSET(`C1`) +utf8 +SELECT DISTINCT CHARSET(`C1`) FROM `ï¼´ï¼–`; +CHARSET(`C1`) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`C1` USING utf8)) FROM `ï¼´ï¼”`; +CHARSET(CONVERT(`C1` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ucs2)) FROM `ï¼´ï¼”`; +CHARSET(CONVERT(`C1` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`C1` USING sjis)) FROM `ï¼´ï¼”`; +CHARSET(CONVERT(`C1` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ujis)) FROM `ï¼´ï¼”`; +CHARSET(CONVERT(`C1` USING ujis)) +ujis +SELECT DISTINCT CHARSET(CONVERT(`C1` USING utf8)) FROM `T5`; +CHARSET(CONVERT(`C1` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ucs2)) FROM `T5`; +CHARSET(CONVERT(`C1` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`C1` USING sjis)) FROM `T5`; +CHARSET(CONVERT(`C1` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ujis)) FROM `T5`; +CHARSET(CONVERT(`C1` USING ujis)) +ujis +SELECT DISTINCT CHARSET(CONVERT(`C1` USING utf8)) FROM `ï¼´ï¼–`; +CHARSET(CONVERT(`C1` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ucs2)) FROM `ï¼´ï¼–`; +CHARSET(CONVERT(`C1` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`C1` USING sjis)) FROM `ï¼´ï¼–`; +CHARSET(CONVERT(`C1` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ujis)) FROM `ï¼´ï¼–`; +CHARSET(CONVERT(`C1` USING ujis)) +ujis +SELECT DISTINCT CHARSET(`C1`) FROM `ï¼´ï¼—`; +CHARSET(`C1`) +utf8 +SELECT DISTINCT CHARSET(`C1`) FROM `T8`; +CHARSET(`C1`) +utf8 +SELECT DISTINCT CHARSET(`C1`) FROM `ï¼´ï¼™`; +CHARSET(`C1`) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`C1` USING utf8)) FROM `ï¼´ï¼—`; +CHARSET(CONVERT(`C1` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ucs2)) FROM `ï¼´ï¼—`; +CHARSET(CONVERT(`C1` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`C1` USING sjis)) FROM `ï¼´ï¼—`; +CHARSET(CONVERT(`C1` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ujis)) FROM `ï¼´ï¼—`; +CHARSET(CONVERT(`C1` USING ujis)) +ujis +SELECT DISTINCT CHARSET(CONVERT(`C1` USING utf8)) FROM `T8`; +CHARSET(CONVERT(`C1` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ucs2)) FROM `T8`; +CHARSET(CONVERT(`C1` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`C1` USING sjis)) FROM `T8`; +CHARSET(CONVERT(`C1` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ujis)) FROM `T8`; +CHARSET(CONVERT(`C1` USING ujis)) +ujis +SELECT DISTINCT CHARSET(CONVERT(`C1` USING utf8)) FROM `ï¼´ï¼™`; +CHARSET(CONVERT(`C1` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ucs2)) FROM `ï¼´ï¼™`; +CHARSET(CONVERT(`C1` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`C1` USING sjis)) FROM `ï¼´ï¼™`; +CHARSET(CONVERT(`C1` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ujis)) FROM `ï¼´ï¼™`; +CHARSET(CONVERT(`C1` USING ujis)) +ujis +SELECT DISTINCT CHARSET(`C1`) FROM `T1ï¼`; +CHARSET(`C1`) +utf8 +SELECT DISTINCT CHARSET(`C1`) FROM `T11`; +CHARSET(`C1`) +utf8 +SELECT DISTINCT CHARSET(`C1`) FROM `T12`; +CHARSET(`C1`) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`C1` USING utf8)) FROM `T1ï¼`; +CHARSET(CONVERT(`C1` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ucs2)) FROM `T1ï¼`; +CHARSET(CONVERT(`C1` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`C1` USING sjis)) FROM `T1ï¼`; +CHARSET(CONVERT(`C1` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ujis)) FROM `T1ï¼`; +CHARSET(CONVERT(`C1` USING ujis)) +ujis +SELECT DISTINCT CHARSET(CONVERT(`C1` USING utf8)) FROM `T11`; +CHARSET(CONVERT(`C1` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ucs2)) FROM `T11`; +CHARSET(CONVERT(`C1` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`C1` USING sjis)) FROM `T11`; +CHARSET(CONVERT(`C1` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ujis)) FROM `T11`; +CHARSET(CONVERT(`C1` USING ujis)) +ujis +SELECT DISTINCT CHARSET(CONVERT(`C1` USING utf8)) FROM `T12`; +CHARSET(CONVERT(`C1` USING utf8)) +utf8 +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ucs2)) FROM `T12`; +CHARSET(CONVERT(`C1` USING ucs2)) +ucs2 +SELECT DISTINCT CHARSET(CONVERT(`C1` USING sjis)) FROM `T12`; +CHARSET(CONVERT(`C1` USING sjis)) +sjis +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ujis)) FROM `T12`; +CHARSET(CONVERT(`C1` USING ujis)) +ujis +drop table `T1`; +drop table `ï¼´ï¼’`; +drop table `T3`; +drop table `ï¼´ï¼”`; +drop table `T5`; +drop table `ï¼´ï¼–`; +drop table `ï¼´ï¼—`; +drop table `T8`; +drop table `ï¼´ï¼™`; +drop table `T1ï¼`; +drop table `T11`; +drop table `T12`; diff --git a/mysql-test/suite/jp/r/jp_convert_sjis.result b/mysql-test/suite/jp/r/jp_convert_sjis.result new file mode 100755 index 00000000000..8c9df3606c8 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_convert_sjis.result @@ -0,0 +1,1046 @@ +SET NAMES sjis; +SET character_set_database = sjis; +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +drop table if exists `‚s‚P‚P`; +drop table if exists `‚s‚P‚Q`; +CREATE TABLE `‚s‚P` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Q` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚R` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚S` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚T` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚U` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚V` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚W` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚X` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚O` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚P` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚Q` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `‚s‚P`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `‚s‚Q`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `‚s‚R`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `‚s‚S`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `‚s‚T`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `‚s‚U`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `‚s‚V`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `‚s‚W`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `‚s‚X`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `‚s‚P‚O`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `‚s‚P‚P`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `‚s‚P‚Q`; +SELECT `‚b‚P`, CONVERT(`‚b‚P` using utf8) FROM `‚s‚P`; +‚b‚P CONVERT(`‚b‚P` using utf8) + !"#$%&'()*+,-./ !"#$%&'()*+,-./ + ¡¢£¤¥¦§¨©ª«¬­®¯ ¡¢£¤¥¦§¨©ª«¬­®¯ +0123456789:;<=>? 0123456789:;<=>? +@ABCDEFGHIJKLMNO @ABCDEFGHIJKLMNO +abcdefghijklmno abcdefghijklmno +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[_]^_ +pqrstuvwxyz{|}~ pqrstuvwxyz{|}~ +°±²³´µ¶·¸¹º»¼½¾¿ °±²³´µ¶·¸¹º»¼½¾¿ +ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ +ÐÑÒÓÔÕÖרÙÚÛÜÝÞß ÐÑÒÓÔÕÖרÙÚÛÜÝÞß +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ucs2) FROM `‚s‚P`; +‚b‚P CONVERT(`‚b‚P` using ucs2) + !"#$%&'()*+,-./ !"#$%&'()*+,-./ + ¡¢£¤¥¦§¨©ª«¬­®¯ ¡¢£¤¥¦§¨©ª«¬­®¯ +0123456789:;<=>? 0123456789:;<=>? +@ABCDEFGHIJKLMNO @ABCDEFGHIJKLMNO +abcdefghijklmno abcdefghijklmno +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[_]^_ +pqrstuvwxyz{|}~ pqrstuvwxyz{|}~ +°±²³´µ¶·¸¹º»¼½¾¿ °±²³´µ¶·¸¹º»¼½¾¿ +ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ +ÐÑÒÓÔÕÖרÙÚÛÜÝÞß ÐÑÒÓÔÕÖרÙÚÛÜÝÞß +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ujis) FROM `‚s‚P`; +‚b‚P CONVERT(`‚b‚P` using ujis) + !"#$%&'()*+,-./ !"#$%&'()*+,-./ + ¡¢£¤¥¦§¨©ª«¬­®¯ ¡¢£¤¥¦§¨©ª«¬­®¯ +0123456789:;<=>? 0123456789:;<=>? +@ABCDEFGHIJKLMNO @ABCDEFGHIJKLMNO +abcdefghijklmno abcdefghijklmno +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[_]^_ +pqrstuvwxyz{|}~ pqrstuvwxyz{|}~ +°±²³´µ¶·¸¹º»¼½¾¿ °±²³´µ¶·¸¹º»¼½¾¿ +ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ +ÐÑÒÓÔÕÖרÙÚÛÜÝÞß ÐÑÒÓÔÕÖרÙÚÛÜÝÞß +SELECT `‚b‚P`, CONVERT(`‚b‚P` using utf8) FROM `‚s‚Q`; +‚b‚P CONVERT(`‚b‚P` using utf8) +@@ABCDEFGHIJKLMNOPQR @@ABCDEFGHIJKLMNOPQR +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEE‚O‚P‚Q‚R EEEEEEEEEEEEEEEE‚O‚P‚Q‚R +EEEEEEEEE„p„q„r„s„t„u„v„w„x„y„z EEEEEEEEE„p„q„r„s„t„u„v„w„x„y„z +EEEEEE¸¹º»¼½¾¿EEEEEE EEEEEE¸¹º»¼½¾¿EEEEEE +EEEEE‚‚‚‚ƒ‚„‚…‚†‚‡‚ˆ‚‰‚Š‚‹‚Œ‚‚Ž‚ EEEEE‚‚‚‚ƒ‚„‚…‚†‚‡‚ˆ‚‰‚Š‚‹‚Œ‚‚Ž‚ +EEÈÉÊËÌÍÎEEEEEEEEEEE EEÈÉÊËÌÍÎEEEEEEEEEEE +EEðñòóôõö÷EEEEüEEEE@ EEðñòóôõö÷EEEEüEEEE@ +EŸ ¡¢£¤¥¦§¨©ª«¬EEEEE EŸ ¡¢£¤¥¦§¨©ª«¬EEEEE +E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚­‚®‚¯‚°‚± E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚­‚®‚¯‚°‚± +Eƒ@ƒAƒBƒCƒDƒEƒFƒGƒHƒIƒJƒKƒLƒMƒNƒOƒPƒQƒR Eƒ@ƒAƒBƒCƒDƒEƒFƒGƒHƒIƒJƒKƒLƒMƒNƒOƒPƒQƒR +EƒŸƒ ƒ¡ƒ¢ƒ£ƒ¤ƒ¥ƒ¦ƒ§ƒ¨ƒ©ƒªƒ«ƒ¬ƒ­ƒ®ƒ¯ƒ°ƒ± EƒŸƒ ƒ¡ƒ¢ƒ£ƒ¤ƒ¥ƒ¦ƒ§ƒ¨ƒ©ƒªƒ«ƒ¬ƒ­ƒ®ƒ¯ƒ°ƒ± +E„@„A„B„C„D„E„F„G„H„I„J„K„L„M„N„O„P„Q„R E„@„A„B„C„D„E„F„G„H„I„J„K„L„M„N„O„P„Q„R +E„Ÿ„ „¡„¢„£„¤„¥„¦„§„¨„©„ª„«„¬„­„®„¯„°„± E„Ÿ„ „¡„¢„£„¤„¥„¦„§„¨„©„ª„«„¬„­„®„¯„°„± +EˆŸˆ ˆ¡ˆ¢ˆ£ˆ¤ˆ¥ˆ¦ˆ§ˆ¨ˆ©ˆªˆ«ˆ¬ˆ­ˆ®ˆ¯ˆ°ˆ± EˆŸˆ ˆ¡ˆ¢ˆ£ˆ¤ˆ¥ˆ¦ˆ§ˆ¨ˆ©ˆªˆ«ˆ¬ˆ­ˆ®ˆ¯ˆ°ˆ± +E˜@˜A˜B˜C˜D˜E˜F˜G˜H˜I˜J˜K˜L˜M˜N˜O˜P˜Q˜R E˜@˜A˜B˜C˜D˜E˜F˜G˜H˜I˜J˜K˜L˜M˜N˜O˜P˜Q˜R +E˜Ÿ˜ ˜¡˜¢˜£˜¤˜¥˜¦˜§˜¨˜©˜ª˜«˜¬˜­˜®˜¯˜°˜± E˜Ÿ˜ ˜¡˜¢˜£˜¤˜¥˜¦˜§˜¨˜©˜ª˜«˜¬˜­˜®˜¯˜°˜± +Eê@êAêBêCêDêEêFêGêHêIêJêKêLêMêNêOêPêQêR Eê@êAêBêCêDêEêFêGêHêIêJêKêLêMêNêOêPêQêR +EêŸê ê¡ê¢ê£ê¤EEEEEEEEEEEEE EêŸê ê¡ê¢ê£ê¤EEEEEEEEEEEEE +STUVWXYZ[\]^_`abcdef STUVWXYZ[\]^_`abcdef +ghijklmnopqrstuvwxyz ghijklmnopqrstuvwxyz +{]}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ {]}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ +‘’“”•–—˜™š›œžEEEEE ‘’“”•–—˜™š›œžEEEEE +ÚÛÜÝÞßàáâãäåæçèEEEEE ÚÛÜÝÞßàáâãäåæçèEEEEE +‚S‚T‚U‚V‚W‚XEEEEEEE‚`‚a‚b‚c‚d‚e‚f ‚S‚T‚U‚V‚W‚XEEEEEEE‚`‚a‚b‚c‚d‚e‚f +‚g‚h‚i‚j‚k‚l‚m‚n‚o‚p‚q‚r‚s‚t‚u‚v‚w‚x‚yE ‚g‚h‚i‚j‚k‚l‚m‚n‚o‚p‚q‚r‚s‚t‚u‚v‚w‚x‚yE +‚‚‘‚’‚“‚”‚•‚–‚—‚˜‚™‚šEEEEEEEEE ‚‚‘‚’‚“‚”‚•‚–‚—‚˜‚™‚šEEEEEEEEE +‚²‚³‚´‚µ‚¶‚·‚¸‚¹‚º‚»‚¼‚½‚¾‚¿‚À‚Á‚‚ÂĂŠ‚²‚³‚´‚µ‚¶‚·‚¸‚¹‚º‚»‚¼‚½‚¾‚¿‚À‚Á‚‚ÂĂŠ+‚ƂǂȂɂʂ˂̂͂΂ςЂт҂ӂԂՂւׂ؂٠‚ƂǂȂɂʂ˂̂͂΂ςЂт҂ӂԂՂւׂ؂٠+‚ڂۂ܂݂ނ߂à‚á‚â‚ã‚ä‚傿‚ç‚è‚é‚ê‚ë‚ì‚í ‚Ú‚Û‚Ü‚Ý‚Þ‚ß‚à‚á‚â‚ã‚ä‚傿‚ç‚è‚é‚ê‚ë‚ì‚í +‚î‚ï‚ð‚ñEEEEEEEEEEEEEEEE ‚î‚ï‚ð‚ñEEEEEEEEEEEEEEEE +ƒSƒTƒUƒVƒWƒXƒYƒZƒ[ƒ\ƒ]ƒ^ƒ_ƒ`ƒaƒbƒcƒdƒeƒf ƒSƒTƒUƒVƒWƒXƒYƒZƒ[ƒ\ƒ]ƒ^ƒ_ƒ`ƒaƒbƒcƒdƒeƒf +ƒgƒhƒiƒjƒkƒlƒmƒnƒoƒpƒqƒrƒsƒtƒuƒvƒwƒxƒyƒz ƒgƒhƒiƒjƒkƒlƒmƒnƒoƒpƒqƒrƒsƒtƒuƒvƒwƒxƒyƒz +ƒ{ƒ|ƒ}ƒ~ƒ€ƒƒ‚ƒƒƒ„ƒ…ƒ†ƒ‡ƒˆƒ‰ƒŠƒ‹ƒŒƒƒŽƒ ƒ{ƒ|ƒ}ƒ~ƒ€ƒƒ‚ƒƒƒ„ƒ…ƒ†ƒ‡ƒˆƒ‰ƒŠƒ‹ƒŒƒƒŽƒ +ƒƒ‘ƒ’ƒ“ƒ”ƒ•ƒ–EEEEEEEEEEEEE ƒƒ‘ƒ’ƒ“ƒ”ƒ•ƒ–EEEEEEEEEEEEE +ƒ²ƒ³ƒ´ƒµƒ¶EEEEEEEEƒ¿ƒÀƒÁƒÂƒÃƒÄƒÅ ƒ²ƒ³ƒ´ƒµƒ¶EEEEEEEEƒ¿ƒÀƒÁƒÂƒÃƒÄƒÅ +ƒÆƒÇƒÈƒÉƒÊƒËƒÌƒÍƒÎƒÏƒÐƒÑƒÒƒÓƒÔƒÕƒÖEEE ƒÆƒÇƒÈƒÉƒÊƒËƒÌƒÍƒÎƒÏƒÐƒÑƒÒƒÓƒÔƒÕƒÖEEE +„S„T„U„V„W„X„Y„Z„[„\„]„^„_„`EEEEEE „S„T„U„V„W„X„Y„Z„[„\„]„^„_„`EEEEEE +„{„|„}„~„€„„‚„ƒ„„„…„†„‡„ˆ„‰„Š„‹„Œ„„Ž„ „{„|„}„~„€„„‚„ƒ„„„…„†„‡„ˆ„‰„Š„‹„Œ„„Ž„ +„„‘EEEEEEEEEEEEEEEEEE „„‘EEEEEEEEEEEEEEEEEE +„²„³„´„µ„¶„·„¸„¹„º„»„¼„½„¾EEEEEEE „²„³„´„µ„¶„·„¸„¹„º„»„¼„½„¾EEEEEEE +ˆ²ˆ³ˆ´ˆµˆ¶ˆ·ˆ¸ˆ¹ˆºˆ»ˆ¼ˆ½ˆ¾ˆ¿ˆÀˆÁˆÂˆÃˆÄˆÅ ˆ²ˆ³ˆ´ˆµˆ¶ˆ·ˆ¸ˆ¹ˆºˆ»ˆ¼ˆ½ˆ¾ˆ¿ˆÀˆÁˆÂˆÃˆÄˆÅ +ˆÆˆÇˆÈˆÉˆÊˆËˆÌˆÍˆÎˆÏˆÐˆÑˆÒˆÓˆÔˆÕˆÖˆ×ˆØˆÙ ˆÆˆÇˆÈˆÉˆÊˆËˆÌˆÍˆÎˆÏˆÐˆÑˆÒˆÓˆÔˆÕˆÖˆ×ˆØˆÙ +ˆÚˆÛˆÜˆÝˆÞˆßˆàˆáˆâˆãˆäˆåˆæˆçˆèˆéˆêˆëˆìˆí ˆÚˆÛˆÜˆÝˆÞˆßˆàˆáˆâˆãˆäˆåˆæˆçˆèˆéˆêˆëˆìˆí +ˆîˆïˆðˆñˆòˆóˆôˆõˆöˆ÷ˆøˆùˆúˆûˆüEEEEE ˆîˆïˆðˆñˆòˆóˆôˆõˆöˆ÷ˆøˆùˆúˆûˆüEEEEE +˜S˜T˜U˜V˜W˜X˜Y˜Z˜[˜\˜]˜^˜_˜`˜a˜b˜c˜d˜e˜f ˜S˜T˜U˜V˜W˜X˜Y˜Z˜[˜\˜]˜^˜_˜`˜a˜b˜c˜d˜e˜f +˜g˜h˜i˜j˜k˜l˜m˜n˜o˜p˜q˜rEEEEEEEE ˜g˜h˜i˜j˜k˜l˜m˜n˜o˜p˜q˜rEEEEEEEE +˜²˜³˜´˜µ˜¶˜·˜¸˜¹˜º˜»˜¼˜½˜¾˜¿˜À˜Á˜Â˜Ã˜Ä˜Å ˜²˜³˜´˜µ˜¶˜·˜¸˜¹˜º˜»˜¼˜½˜¾˜¿˜À˜Á˜Â˜Ã˜Ä˜Å +˜Æ˜Ç˜È˜É˜Ê˜Ë˜Ì˜Í˜Î˜Ï˜Ð˜Ñ˜Ò˜Ó˜Ô˜Õ˜Ö˜×˜Ø˜Ù ˜Æ˜Ç˜È˜É˜Ê˜Ë˜Ì˜Í˜Î˜Ï˜Ð˜Ñ˜Ò˜Ó˜Ô˜Õ˜Ö˜×˜Ø˜Ù +˜Ú˜Û˜Ü˜Ý˜Þ˜ß˜à˜á˜â˜ã˜ä˜å˜æ˜ç˜è˜é˜ê˜ë˜ì˜í ˜Ú˜Û˜Ü˜Ý˜Þ˜ß˜à˜á˜â˜ã˜ä˜å˜æ˜ç˜è˜é˜ê˜ë˜ì˜í +˜î˜ï˜ð˜ñ˜ò˜ó˜ô˜õ˜ö˜÷˜ø˜ù˜ú˜û˜üEEEEE ˜î˜ï˜ð˜ñ˜ò˜ó˜ô˜õ˜ö˜÷˜ø˜ù˜ú˜û˜üEEEEE +êSêTêUêVêWêXêYêZê[ê\ê]ê^ê_ê`êaêbêcêdêeêf êSêTêUêVêWêXêYêZê[ê\ê]ê^ê_ê`êaêbêcêdêeêf +êgêhêiêjêkêlêmênêoêpêqêrêsêtêuêvêwêxêyêz êgêhêiêjêkêlêmênêoêpêqêrêsêtêuêvêwêxêyêz +ê{ê|ê}ê~ê€êê‚êƒê„ê…ê†ê‡êˆê‰êŠê‹êŒêêŽê ê{ê|ê}ê~ê€êê‚êƒê„ê…ê†ê‡êˆê‰êŠê‹êŒêêŽê +êê‘ê’ê“ê”ê•ê–ê—ê˜ê™êšê›êœêêžEEEEE êê‘ê’ê“ê”ê•ê–ê—ê˜ê™êšê›êœêêžEEEEE +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ucs2) FROM `‚s‚Q`; +‚b‚P CONVERT(`‚b‚P` using ucs2) +@@ABCDEFGHIJKLMNOPQR @@ABCDEFGHIJKLMNOPQR +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEE‚O‚P‚Q‚R EEEEEEEEEEEEEEEE‚O‚P‚Q‚R +EEEEEEEEE„p„q„r„s„t„u„v„w„x„y„z EEEEEEEEE„p„q„r„s„t„u„v„w„x„y„z +EEEEEE¸¹º»¼½¾¿EEEEEE EEEEEE¸¹º»¼½¾¿EEEEEE +EEEEE‚‚‚‚ƒ‚„‚…‚†‚‡‚ˆ‚‰‚Š‚‹‚Œ‚‚Ž‚ EEEEE‚‚‚‚ƒ‚„‚…‚†‚‡‚ˆ‚‰‚Š‚‹‚Œ‚‚Ž‚ +EEÈÉÊËÌÍÎEEEEEEEEEEE EEÈÉÊËÌÍÎEEEEEEEEEEE +EEðñòóôõö÷EEEEüEEEE@ EEðñòóôõö÷EEEEüEEEE@ +EŸ ¡¢£¤¥¦§¨©ª«¬EEEEE EŸ ¡¢£¤¥¦§¨©ª«¬EEEEE +E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚­‚®‚¯‚°‚± E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚­‚®‚¯‚°‚± +Eƒ@ƒAƒBƒCƒDƒEƒFƒGƒHƒIƒJƒKƒLƒMƒNƒOƒPƒQƒR Eƒ@ƒAƒBƒCƒDƒEƒFƒGƒHƒIƒJƒKƒLƒMƒNƒOƒPƒQƒR +EƒŸƒ ƒ¡ƒ¢ƒ£ƒ¤ƒ¥ƒ¦ƒ§ƒ¨ƒ©ƒªƒ«ƒ¬ƒ­ƒ®ƒ¯ƒ°ƒ± EƒŸƒ ƒ¡ƒ¢ƒ£ƒ¤ƒ¥ƒ¦ƒ§ƒ¨ƒ©ƒªƒ«ƒ¬ƒ­ƒ®ƒ¯ƒ°ƒ± +E„@„A„B„C„D„E„F„G„H„I„J„K„L„M„N„O„P„Q„R E„@„A„B„C„D„E„F„G„H„I„J„K„L„M„N„O„P„Q„R +E„Ÿ„ „¡„¢„£„¤„¥„¦„§„¨„©„ª„«„¬„­„®„¯„°„± E„Ÿ„ „¡„¢„£„¤„¥„¦„§„¨„©„ª„«„¬„­„®„¯„°„± +EˆŸˆ ˆ¡ˆ¢ˆ£ˆ¤ˆ¥ˆ¦ˆ§ˆ¨ˆ©ˆªˆ«ˆ¬ˆ­ˆ®ˆ¯ˆ°ˆ± EˆŸˆ ˆ¡ˆ¢ˆ£ˆ¤ˆ¥ˆ¦ˆ§ˆ¨ˆ©ˆªˆ«ˆ¬ˆ­ˆ®ˆ¯ˆ°ˆ± +E˜@˜A˜B˜C˜D˜E˜F˜G˜H˜I˜J˜K˜L˜M˜N˜O˜P˜Q˜R E˜@˜A˜B˜C˜D˜E˜F˜G˜H˜I˜J˜K˜L˜M˜N˜O˜P˜Q˜R +E˜Ÿ˜ ˜¡˜¢˜£˜¤˜¥˜¦˜§˜¨˜©˜ª˜«˜¬˜­˜®˜¯˜°˜± E˜Ÿ˜ ˜¡˜¢˜£˜¤˜¥˜¦˜§˜¨˜©˜ª˜«˜¬˜­˜®˜¯˜°˜± +Eê@êAêBêCêDêEêFêGêHêIêJêKêLêMêNêOêPêQêR Eê@êAêBêCêDêEêFêGêHêIêJêKêLêMêNêOêPêQêR +EêŸê ê¡ê¢ê£ê¤EEEEEEEEEEEEE EêŸê ê¡ê¢ê£ê¤EEEEEEEEEEEEE +STUVWXYZ[\]^_`abcdef STUVWXYZ[\]^_`abcdef +ghijklmnopqrstuvwxyz ghijklmnopqrstuvwxyz +{]}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ {]}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ +‘’“”•–—˜™š›œžEEEEE ‘’“”•–—˜™š›œžEEEEE +ÚÛÜÝÞßàáâãäåæçèEEEEE ÚÛÜÝÞßàáâãäåæçèEEEEE +‚S‚T‚U‚V‚W‚XEEEEEEE‚`‚a‚b‚c‚d‚e‚f ‚S‚T‚U‚V‚W‚XEEEEEEE‚`‚a‚b‚c‚d‚e‚f +‚g‚h‚i‚j‚k‚l‚m‚n‚o‚p‚q‚r‚s‚t‚u‚v‚w‚x‚yE ‚g‚h‚i‚j‚k‚l‚m‚n‚o‚p‚q‚r‚s‚t‚u‚v‚w‚x‚yE +‚‚‘‚’‚“‚”‚•‚–‚—‚˜‚™‚šEEEEEEEEE ‚‚‘‚’‚“‚”‚•‚–‚—‚˜‚™‚šEEEEEEEEE +‚²‚³‚´‚µ‚¶‚·‚¸‚¹‚º‚»‚¼‚½‚¾‚¿‚À‚Á‚‚ÂĂŠ‚²‚³‚´‚µ‚¶‚·‚¸‚¹‚º‚»‚¼‚½‚¾‚¿‚À‚Á‚‚ÂĂŠ+‚ƂǂȂɂʂ˂̂͂΂ςЂт҂ӂԂՂւׂ؂٠‚ƂǂȂɂʂ˂̂͂΂ςЂт҂ӂԂՂւׂ؂٠+‚ڂۂ܂݂ނ߂à‚á‚â‚ã‚ä‚傿‚ç‚è‚é‚ê‚ë‚ì‚í ‚Ú‚Û‚Ü‚Ý‚Þ‚ß‚à‚á‚â‚ã‚ä‚傿‚ç‚è‚é‚ê‚ë‚ì‚í +‚î‚ï‚ð‚ñEEEEEEEEEEEEEEEE ‚î‚ï‚ð‚ñEEEEEEEEEEEEEEEE +ƒSƒTƒUƒVƒWƒXƒYƒZƒ[ƒ\ƒ]ƒ^ƒ_ƒ`ƒaƒbƒcƒdƒeƒf ƒSƒTƒUƒVƒWƒXƒYƒZƒ[ƒ\ƒ]ƒ^ƒ_ƒ`ƒaƒbƒcƒdƒeƒf +ƒgƒhƒiƒjƒkƒlƒmƒnƒoƒpƒqƒrƒsƒtƒuƒvƒwƒxƒyƒz ƒgƒhƒiƒjƒkƒlƒmƒnƒoƒpƒqƒrƒsƒtƒuƒvƒwƒxƒyƒz +ƒ{ƒ|ƒ}ƒ~ƒ€ƒƒ‚ƒƒƒ„ƒ…ƒ†ƒ‡ƒˆƒ‰ƒŠƒ‹ƒŒƒƒŽƒ ƒ{ƒ|ƒ}ƒ~ƒ€ƒƒ‚ƒƒƒ„ƒ…ƒ†ƒ‡ƒˆƒ‰ƒŠƒ‹ƒŒƒƒŽƒ +ƒƒ‘ƒ’ƒ“ƒ”ƒ•ƒ–EEEEEEEEEEEEE ƒƒ‘ƒ’ƒ“ƒ”ƒ•ƒ–EEEEEEEEEEEEE +ƒ²ƒ³ƒ´ƒµƒ¶EEEEEEEEƒ¿ƒÀƒÁƒÂƒÃƒÄƒÅ ƒ²ƒ³ƒ´ƒµƒ¶EEEEEEEEƒ¿ƒÀƒÁƒÂƒÃƒÄƒÅ +ƒÆƒÇƒÈƒÉƒÊƒËƒÌƒÍƒÎƒÏƒÐƒÑƒÒƒÓƒÔƒÕƒÖEEE ƒÆƒÇƒÈƒÉƒÊƒËƒÌƒÍƒÎƒÏƒÐƒÑƒÒƒÓƒÔƒÕƒÖEEE +„S„T„U„V„W„X„Y„Z„[„\„]„^„_„`EEEEEE „S„T„U„V„W„X„Y„Z„[„\„]„^„_„`EEEEEE +„{„|„}„~„€„„‚„ƒ„„„…„†„‡„ˆ„‰„Š„‹„Œ„„Ž„ „{„|„}„~„€„„‚„ƒ„„„…„†„‡„ˆ„‰„Š„‹„Œ„„Ž„ +„„‘EEEEEEEEEEEEEEEEEE „„‘EEEEEEEEEEEEEEEEEE +„²„³„´„µ„¶„·„¸„¹„º„»„¼„½„¾EEEEEEE „²„³„´„µ„¶„·„¸„¹„º„»„¼„½„¾EEEEEEE +ˆ²ˆ³ˆ´ˆµˆ¶ˆ·ˆ¸ˆ¹ˆºˆ»ˆ¼ˆ½ˆ¾ˆ¿ˆÀˆÁˆÂˆÃˆÄˆÅ ˆ²ˆ³ˆ´ˆµˆ¶ˆ·ˆ¸ˆ¹ˆºˆ»ˆ¼ˆ½ˆ¾ˆ¿ˆÀˆÁˆÂˆÃˆÄˆÅ +ˆÆˆÇˆÈˆÉˆÊˆËˆÌˆÍˆÎˆÏˆÐˆÑˆÒˆÓˆÔˆÕˆÖˆ×ˆØˆÙ ˆÆˆÇˆÈˆÉˆÊˆËˆÌˆÍˆÎˆÏˆÐˆÑˆÒˆÓˆÔˆÕˆÖˆ×ˆØˆÙ +ˆÚˆÛˆÜˆÝˆÞˆßˆàˆáˆâˆãˆäˆåˆæˆçˆèˆéˆêˆëˆìˆí ˆÚˆÛˆÜˆÝˆÞˆßˆàˆáˆâˆãˆäˆåˆæˆçˆèˆéˆêˆëˆìˆí +ˆîˆïˆðˆñˆòˆóˆôˆõˆöˆ÷ˆøˆùˆúˆûˆüEEEEE ˆîˆïˆðˆñˆòˆóˆôˆõˆöˆ÷ˆøˆùˆúˆûˆüEEEEE +˜S˜T˜U˜V˜W˜X˜Y˜Z˜[˜\˜]˜^˜_˜`˜a˜b˜c˜d˜e˜f ˜S˜T˜U˜V˜W˜X˜Y˜Z˜[˜\˜]˜^˜_˜`˜a˜b˜c˜d˜e˜f +˜g˜h˜i˜j˜k˜l˜m˜n˜o˜p˜q˜rEEEEEEEE ˜g˜h˜i˜j˜k˜l˜m˜n˜o˜p˜q˜rEEEEEEEE +˜²˜³˜´˜µ˜¶˜·˜¸˜¹˜º˜»˜¼˜½˜¾˜¿˜À˜Á˜Â˜Ã˜Ä˜Å ˜²˜³˜´˜µ˜¶˜·˜¸˜¹˜º˜»˜¼˜½˜¾˜¿˜À˜Á˜Â˜Ã˜Ä˜Å +˜Æ˜Ç˜È˜É˜Ê˜Ë˜Ì˜Í˜Î˜Ï˜Ð˜Ñ˜Ò˜Ó˜Ô˜Õ˜Ö˜×˜Ø˜Ù ˜Æ˜Ç˜È˜É˜Ê˜Ë˜Ì˜Í˜Î˜Ï˜Ð˜Ñ˜Ò˜Ó˜Ô˜Õ˜Ö˜×˜Ø˜Ù +˜Ú˜Û˜Ü˜Ý˜Þ˜ß˜à˜á˜â˜ã˜ä˜å˜æ˜ç˜è˜é˜ê˜ë˜ì˜í ˜Ú˜Û˜Ü˜Ý˜Þ˜ß˜à˜á˜â˜ã˜ä˜å˜æ˜ç˜è˜é˜ê˜ë˜ì˜í +˜î˜ï˜ð˜ñ˜ò˜ó˜ô˜õ˜ö˜÷˜ø˜ù˜ú˜û˜üEEEEE ˜î˜ï˜ð˜ñ˜ò˜ó˜ô˜õ˜ö˜÷˜ø˜ù˜ú˜û˜üEEEEE +êSêTêUêVêWêXêYêZê[ê\ê]ê^ê_ê`êaêbêcêdêeêf êSêTêUêVêWêXêYêZê[ê\ê]ê^ê_ê`êaêbêcêdêeêf +êgêhêiêjêkêlêmênêoêpêqêrêsêtêuêvêwêxêyêz êgêhêiêjêkêlêmênêoêpêqêrêsêtêuêvêwêxêyêz +ê{ê|ê}ê~ê€êê‚êƒê„ê…ê†ê‡êˆê‰êŠê‹êŒêêŽê ê{ê|ê}ê~ê€êê‚êƒê„ê…ê†ê‡êˆê‰êŠê‹êŒêêŽê +êê‘ê’ê“ê”ê•ê–ê—ê˜ê™êšê›êœêêžEEEEE êê‘ê’ê“ê”ê•ê–ê—ê˜ê™êšê›êœêêžEEEEE +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ujis) FROM `‚s‚Q`; +‚b‚P CONVERT(`‚b‚P` using ujis) +@@ABCDEFGHIJKLMNOPQR @@ABCDEFGHIJKLMNOPQR +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEE‚O‚P‚Q‚R EEEEEEEEEEEEEEEE‚O‚P‚Q‚R +EEEEEEEEE„p„q„r„s„t„u„v„w„x„y„z EEEEEEEEE„p„q„r„s„t„u„v„w„x„y„z +EEEEEE¸¹º»¼½¾¿EEEEEE EEEEEE¸¹º»¼½¾¿EEEEEE +EEEEE‚‚‚‚ƒ‚„‚…‚†‚‡‚ˆ‚‰‚Š‚‹‚Œ‚‚Ž‚ EEEEE‚‚‚‚ƒ‚„‚…‚†‚‡‚ˆ‚‰‚Š‚‹‚Œ‚‚Ž‚ +EEÈÉÊËÌÍÎEEEEEEEEEEE EEÈÉÊËÌÍÎEEEEEEEEEEE +EEðñòóôõö÷EEEEüEEEE@ EEðñòóôõö÷EEEEüEEEE@ +EŸ ¡¢£¤¥¦§¨©ª«¬EEEEE EŸ ¡¢£¤¥¦§¨©ª«¬EEEEE +E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚­‚®‚¯‚°‚± E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚­‚®‚¯‚°‚± +Eƒ@ƒAƒBƒCƒDƒEƒFƒGƒHƒIƒJƒKƒLƒMƒNƒOƒPƒQƒR Eƒ@ƒAƒBƒCƒDƒEƒFƒGƒHƒIƒJƒKƒLƒMƒNƒOƒPƒQƒR +EƒŸƒ ƒ¡ƒ¢ƒ£ƒ¤ƒ¥ƒ¦ƒ§ƒ¨ƒ©ƒªƒ«ƒ¬ƒ­ƒ®ƒ¯ƒ°ƒ± EƒŸƒ ƒ¡ƒ¢ƒ£ƒ¤ƒ¥ƒ¦ƒ§ƒ¨ƒ©ƒªƒ«ƒ¬ƒ­ƒ®ƒ¯ƒ°ƒ± +E„@„A„B„C„D„E„F„G„H„I„J„K„L„M„N„O„P„Q„R E„@„A„B„C„D„E„F„G„H„I„J„K„L„M„N„O„P„Q„R +E„Ÿ„ „¡„¢„£„¤„¥„¦„§„¨„©„ª„«„¬„­„®„¯„°„± E„Ÿ„ „¡„¢„£„¤„¥„¦„§„¨„©„ª„«„¬„­„®„¯„°„± +EˆŸˆ ˆ¡ˆ¢ˆ£ˆ¤ˆ¥ˆ¦ˆ§ˆ¨ˆ©ˆªˆ«ˆ¬ˆ­ˆ®ˆ¯ˆ°ˆ± EˆŸˆ ˆ¡ˆ¢ˆ£ˆ¤ˆ¥ˆ¦ˆ§ˆ¨ˆ©ˆªˆ«ˆ¬ˆ­ˆ®ˆ¯ˆ°ˆ± +E˜@˜A˜B˜C˜D˜E˜F˜G˜H˜I˜J˜K˜L˜M˜N˜O˜P˜Q˜R E˜@˜A˜B˜C˜D˜E˜F˜G˜H˜I˜J˜K˜L˜M˜N˜O˜P˜Q˜R +E˜Ÿ˜ ˜¡˜¢˜£˜¤˜¥˜¦˜§˜¨˜©˜ª˜«˜¬˜­˜®˜¯˜°˜± E˜Ÿ˜ ˜¡˜¢˜£˜¤˜¥˜¦˜§˜¨˜©˜ª˜«˜¬˜­˜®˜¯˜°˜± +Eê@êAêBêCêDêEêFêGêHêIêJêKêLêMêNêOêPêQêR Eê@êAêBêCêDêEêFêGêHêIêJêKêLêMêNêOêPêQêR +EêŸê ê¡ê¢ê£ê¤EEEEEEEEEEEEE EêŸê ê¡ê¢ê£ê¤EEEEEEEEEEEEE +STUVWXYZ[\]^_`abcdef STUVWXYZ[\]^_`abcdef +ghijklmnopqrstuvwxyz ghijklmnopqrstuvwxyz +{]}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ {]}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ +‘’“”•–—˜™š›œžEEEEE ‘’“”•–—˜™š›œžEEEEE +ÚÛÜÝÞßàáâãäåæçèEEEEE ÚÛÜÝÞßàáâãäåæçèEEEEE +‚S‚T‚U‚V‚W‚XEEEEEEE‚`‚a‚b‚c‚d‚e‚f ‚S‚T‚U‚V‚W‚XEEEEEEE‚`‚a‚b‚c‚d‚e‚f +‚g‚h‚i‚j‚k‚l‚m‚n‚o‚p‚q‚r‚s‚t‚u‚v‚w‚x‚yE ‚g‚h‚i‚j‚k‚l‚m‚n‚o‚p‚q‚r‚s‚t‚u‚v‚w‚x‚yE +‚‚‘‚’‚“‚”‚•‚–‚—‚˜‚™‚šEEEEEEEEE ‚‚‘‚’‚“‚”‚•‚–‚—‚˜‚™‚šEEEEEEEEE +‚²‚³‚´‚µ‚¶‚·‚¸‚¹‚º‚»‚¼‚½‚¾‚¿‚À‚Á‚‚ÂĂŠ‚²‚³‚´‚µ‚¶‚·‚¸‚¹‚º‚»‚¼‚½‚¾‚¿‚À‚Á‚‚ÂĂŠ+‚ƂǂȂɂʂ˂̂͂΂ςЂт҂ӂԂՂւׂ؂٠‚ƂǂȂɂʂ˂̂͂΂ςЂт҂ӂԂՂւׂ؂٠+‚ڂۂ܂݂ނ߂à‚á‚â‚ã‚ä‚傿‚ç‚è‚é‚ê‚ë‚ì‚í ‚Ú‚Û‚Ü‚Ý‚Þ‚ß‚à‚á‚â‚ã‚ä‚傿‚ç‚è‚é‚ê‚ë‚ì‚í +‚î‚ï‚ð‚ñEEEEEEEEEEEEEEEE ‚î‚ï‚ð‚ñEEEEEEEEEEEEEEEE +ƒSƒTƒUƒVƒWƒXƒYƒZƒ[ƒ\ƒ]ƒ^ƒ_ƒ`ƒaƒbƒcƒdƒeƒf ƒSƒTƒUƒVƒWƒXƒYƒZƒ[ƒ\ƒ]ƒ^ƒ_ƒ`ƒaƒbƒcƒdƒeƒf +ƒgƒhƒiƒjƒkƒlƒmƒnƒoƒpƒqƒrƒsƒtƒuƒvƒwƒxƒyƒz ƒgƒhƒiƒjƒkƒlƒmƒnƒoƒpƒqƒrƒsƒtƒuƒvƒwƒxƒyƒz +ƒ{ƒ|ƒ}ƒ~ƒ€ƒƒ‚ƒƒƒ„ƒ…ƒ†ƒ‡ƒˆƒ‰ƒŠƒ‹ƒŒƒƒŽƒ ƒ{ƒ|ƒ}ƒ~ƒ€ƒƒ‚ƒƒƒ„ƒ…ƒ†ƒ‡ƒˆƒ‰ƒŠƒ‹ƒŒƒƒŽƒ +ƒƒ‘ƒ’ƒ“ƒ”ƒ•ƒ–EEEEEEEEEEEEE ƒƒ‘ƒ’ƒ“ƒ”ƒ•ƒ–EEEEEEEEEEEEE +ƒ²ƒ³ƒ´ƒµƒ¶EEEEEEEEƒ¿ƒÀƒÁƒÂƒÃƒÄƒÅ ƒ²ƒ³ƒ´ƒµƒ¶EEEEEEEEƒ¿ƒÀƒÁƒÂƒÃƒÄƒÅ +ƒÆƒÇƒÈƒÉƒÊƒËƒÌƒÍƒÎƒÏƒÐƒÑƒÒƒÓƒÔƒÕƒÖEEE ƒÆƒÇƒÈƒÉƒÊƒËƒÌƒÍƒÎƒÏƒÐƒÑƒÒƒÓƒÔƒÕƒÖEEE +„S„T„U„V„W„X„Y„Z„[„\„]„^„_„`EEEEEE „S„T„U„V„W„X„Y„Z„[„\„]„^„_„`EEEEEE +„{„|„}„~„€„„‚„ƒ„„„…„†„‡„ˆ„‰„Š„‹„Œ„„Ž„ „{„|„}„~„€„„‚„ƒ„„„…„†„‡„ˆ„‰„Š„‹„Œ„„Ž„ +„„‘EEEEEEEEEEEEEEEEEE „„‘EEEEEEEEEEEEEEEEEE +„²„³„´„µ„¶„·„¸„¹„º„»„¼„½„¾EEEEEEE „²„³„´„µ„¶„·„¸„¹„º„»„¼„½„¾EEEEEEE +ˆ²ˆ³ˆ´ˆµˆ¶ˆ·ˆ¸ˆ¹ˆºˆ»ˆ¼ˆ½ˆ¾ˆ¿ˆÀˆÁˆÂˆÃˆÄˆÅ ˆ²ˆ³ˆ´ˆµˆ¶ˆ·ˆ¸ˆ¹ˆºˆ»ˆ¼ˆ½ˆ¾ˆ¿ˆÀˆÁˆÂˆÃˆÄˆÅ +ˆÆˆÇˆÈˆÉˆÊˆËˆÌˆÍˆÎˆÏˆÐˆÑˆÒˆÓˆÔˆÕˆÖˆ×ˆØˆÙ ˆÆˆÇˆÈˆÉˆÊˆËˆÌˆÍˆÎˆÏˆÐˆÑˆÒˆÓˆÔˆÕˆÖˆ×ˆØˆÙ +ˆÚˆÛˆÜˆÝˆÞˆßˆàˆáˆâˆãˆäˆåˆæˆçˆèˆéˆêˆëˆìˆí ˆÚˆÛˆÜˆÝˆÞˆßˆàˆáˆâˆãˆäˆåˆæˆçˆèˆéˆêˆëˆìˆí +ˆîˆïˆðˆñˆòˆóˆôˆõˆöˆ÷ˆøˆùˆúˆûˆüEEEEE ˆîˆïˆðˆñˆòˆóˆôˆõˆöˆ÷ˆøˆùˆúˆûˆüEEEEE +˜S˜T˜U˜V˜W˜X˜Y˜Z˜[˜\˜]˜^˜_˜`˜a˜b˜c˜d˜e˜f ˜S˜T˜U˜V˜W˜X˜Y˜Z˜[˜\˜]˜^˜_˜`˜a˜b˜c˜d˜e˜f +˜g˜h˜i˜j˜k˜l˜m˜n˜o˜p˜q˜rEEEEEEEE ˜g˜h˜i˜j˜k˜l˜m˜n˜o˜p˜q˜rEEEEEEEE +˜²˜³˜´˜µ˜¶˜·˜¸˜¹˜º˜»˜¼˜½˜¾˜¿˜À˜Á˜Â˜Ã˜Ä˜Å ˜²˜³˜´˜µ˜¶˜·˜¸˜¹˜º˜»˜¼˜½˜¾˜¿˜À˜Á˜Â˜Ã˜Ä˜Å +˜Æ˜Ç˜È˜É˜Ê˜Ë˜Ì˜Í˜Î˜Ï˜Ð˜Ñ˜Ò˜Ó˜Ô˜Õ˜Ö˜×˜Ø˜Ù ˜Æ˜Ç˜È˜É˜Ê˜Ë˜Ì˜Í˜Î˜Ï˜Ð˜Ñ˜Ò˜Ó˜Ô˜Õ˜Ö˜×˜Ø˜Ù +˜Ú˜Û˜Ü˜Ý˜Þ˜ß˜à˜á˜â˜ã˜ä˜å˜æ˜ç˜è˜é˜ê˜ë˜ì˜í ˜Ú˜Û˜Ü˜Ý˜Þ˜ß˜à˜á˜â˜ã˜ä˜å˜æ˜ç˜è˜é˜ê˜ë˜ì˜í +˜î˜ï˜ð˜ñ˜ò˜ó˜ô˜õ˜ö˜÷˜ø˜ù˜ú˜û˜üEEEEE ˜î˜ï˜ð˜ñ˜ò˜ó˜ô˜õ˜ö˜÷˜ø˜ù˜ú˜û˜üEEEEE +êSêTêUêVêWêXêYêZê[ê\ê]ê^ê_ê`êaêbêcêdêeêf êSêTêUêVêWêXêYêZê[ê\ê]ê^ê_ê`êaêbêcêdêeêf +êgêhêiêjêkêlêmênêoêpêqêrêsêtêuêvêwêxêyêz êgêhêiêjêkêlêmênêoêpêqêrêsêtêuêvêwêxêyêz +ê{ê|ê}ê~ê€êê‚êƒê„ê…ê†ê‡êˆê‰êŠê‹êŒêêŽê ê{ê|ê}ê~ê€êê‚êƒê„ê…ê†ê‡êˆê‰êŠê‹êŒêêŽê +êê‘ê’ê“ê”ê•ê–ê—ê˜ê™êšê›êœêêžEEEEE êê‘ê’ê“ê”ê•ê–ê—ê˜ê™êšê›êœêêžEEEEE +SELECT `‚b‚P`, CONVERT(`‚b‚P` using utf8) FROM `‚s‚R`; +‚b‚P CONVERT(`‚b‚P` using utf8) +ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ucs2) FROM `‚s‚R`; +‚b‚P CONVERT(`‚b‚P` using ucs2) +ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ujis) FROM `‚s‚R`; +‚b‚P CONVERT(`‚b‚P` using ujis) +ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ +SELECT `‚b‚P`, CONVERT(`‚b‚P` using utf8) FROM `‚s‚S`; +‚b‚P CONVERT(`‚b‚P` using utf8) + !"#$%&'()*+,-./ !"#$%&'()*+,-./ + ¡¢£¤¥¦§¨©ª«¬­®¯ ¡¢£¤¥¦§¨©ª«¬­®¯ +0123456789:;<=>? 0123456789:;<=>? +@ABCDEFGHIJKLMNO @ABCDEFGHIJKLMNO +abcdefghijklmno abcdefghijklmno +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[_]^_ +pqrstuvwxyz{|}~ pqrstuvwxyz{|}~ +°±²³´µ¶·¸¹º»¼½¾¿ °±²³´µ¶·¸¹º»¼½¾¿ +ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ +ÐÑÒÓÔÕÖרÙÚÛÜÝÞß ÐÑÒÓÔÕÖרÙÚÛÜÝÞß +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ucs2) FROM `‚s‚S`; +‚b‚P CONVERT(`‚b‚P` using ucs2) + !"#$%&'()*+,-./ !"#$%&'()*+,-./ + ¡¢£¤¥¦§¨©ª«¬­®¯ ¡¢£¤¥¦§¨©ª«¬­®¯ +0123456789:;<=>? 0123456789:;<=>? +@ABCDEFGHIJKLMNO @ABCDEFGHIJKLMNO +abcdefghijklmno abcdefghijklmno +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[_]^_ +pqrstuvwxyz{|}~ pqrstuvwxyz{|}~ +°±²³´µ¶·¸¹º»¼½¾¿ °±²³´µ¶·¸¹º»¼½¾¿ +ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ +ÐÑÒÓÔÕÖרÙÚÛÜÝÞß ÐÑÒÓÔÕÖרÙÚÛÜÝÞß +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ujis) FROM `‚s‚S`; +‚b‚P CONVERT(`‚b‚P` using ujis) + !"#$%&'()*+,-./ !"#$%&'()*+,-./ + ¡¢£¤¥¦§¨©ª«¬­®¯ ¡¢£¤¥¦§¨©ª«¬­®¯ +0123456789:;<=>? 0123456789:;<=>? +@ABCDEFGHIJKLMNO @ABCDEFGHIJKLMNO +abcdefghijklmno abcdefghijklmno +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[_]^_ +pqrstuvwxyz{|}~ pqrstuvwxyz{|}~ +°±²³´µ¶·¸¹º»¼½¾¿ °±²³´µ¶·¸¹º»¼½¾¿ +ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ +ÐÑÒÓÔÕÖרÙÚÛÜÝÞß ÐÑÒÓÔÕÖרÙÚÛÜÝÞß +SELECT `‚b‚P`, CONVERT(`‚b‚P` using utf8) FROM `‚s‚T`; +‚b‚P CONVERT(`‚b‚P` using utf8) +@@ABCDEFGHIJKLMNOPQR @@ABCDEFGHIJKLMNOPQR +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEE‚O‚P‚Q‚R EEEEEEEEEEEEEEEE‚O‚P‚Q‚R +EEEEEEEEE„p„q„r„s„t„u„v„w„x„y„z EEEEEEEEE„p„q„r„s„t„u„v„w„x„y„z +EEEEEE¸¹º»¼½¾¿EEEEEE EEEEEE¸¹º»¼½¾¿EEEEEE +EEEEE‚‚‚‚ƒ‚„‚…‚†‚‡‚ˆ‚‰‚Š‚‹‚Œ‚‚Ž‚ EEEEE‚‚‚‚ƒ‚„‚…‚†‚‡‚ˆ‚‰‚Š‚‹‚Œ‚‚Ž‚ +EEÈÉÊËÌÍÎEEEEEEEEEEE EEÈÉÊËÌÍÎEEEEEEEEEEE +EEðñòóôõö÷EEEEüEEEE@ EEðñòóôõö÷EEEEüEEEE@ +EŸ ¡¢£¤¥¦§¨©ª«¬EEEEE EŸ ¡¢£¤¥¦§¨©ª«¬EEEEE +E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚­‚®‚¯‚°‚± E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚­‚®‚¯‚°‚± +Eƒ@ƒAƒBƒCƒDƒEƒFƒGƒHƒIƒJƒKƒLƒMƒNƒOƒPƒQƒR Eƒ@ƒAƒBƒCƒDƒEƒFƒGƒHƒIƒJƒKƒLƒMƒNƒOƒPƒQƒR +EƒŸƒ ƒ¡ƒ¢ƒ£ƒ¤ƒ¥ƒ¦ƒ§ƒ¨ƒ©ƒªƒ«ƒ¬ƒ­ƒ®ƒ¯ƒ°ƒ± EƒŸƒ ƒ¡ƒ¢ƒ£ƒ¤ƒ¥ƒ¦ƒ§ƒ¨ƒ©ƒªƒ«ƒ¬ƒ­ƒ®ƒ¯ƒ°ƒ± +E„@„A„B„C„D„E„F„G„H„I„J„K„L„M„N„O„P„Q„R E„@„A„B„C„D„E„F„G„H„I„J„K„L„M„N„O„P„Q„R +E„Ÿ„ „¡„¢„£„¤„¥„¦„§„¨„©„ª„«„¬„­„®„¯„°„± E„Ÿ„ „¡„¢„£„¤„¥„¦„§„¨„©„ª„«„¬„­„®„¯„°„± +EˆŸˆ ˆ¡ˆ¢ˆ£ˆ¤ˆ¥ˆ¦ˆ§ˆ¨ˆ©ˆªˆ«ˆ¬ˆ­ˆ®ˆ¯ˆ°ˆ± EˆŸˆ ˆ¡ˆ¢ˆ£ˆ¤ˆ¥ˆ¦ˆ§ˆ¨ˆ©ˆªˆ«ˆ¬ˆ­ˆ®ˆ¯ˆ°ˆ± +E˜@˜A˜B˜C˜D˜E˜F˜G˜H˜I˜J˜K˜L˜M˜N˜O˜P˜Q˜R E˜@˜A˜B˜C˜D˜E˜F˜G˜H˜I˜J˜K˜L˜M˜N˜O˜P˜Q˜R +E˜Ÿ˜ ˜¡˜¢˜£˜¤˜¥˜¦˜§˜¨˜©˜ª˜«˜¬˜­˜®˜¯˜°˜± E˜Ÿ˜ ˜¡˜¢˜£˜¤˜¥˜¦˜§˜¨˜©˜ª˜«˜¬˜­˜®˜¯˜°˜± +Eê@êAêBêCêDêEêFêGêHêIêJêKêLêMêNêOêPêQêR Eê@êAêBêCêDêEêFêGêHêIêJêKêLêMêNêOêPêQêR +EêŸê ê¡ê¢ê£ê¤EEEEEEEEEEEEE EêŸê ê¡ê¢ê£ê¤EEEEEEEEEEEEE +STUVWXYZ[\]^_`abcdef STUVWXYZ[\]^_`abcdef +ghijklmnopqrstuvwxyz ghijklmnopqrstuvwxyz +{]}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ {]}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ +‘’“”•–—˜™š›œžEEEEE ‘’“”•–—˜™š›œžEEEEE +ÚÛÜÝÞßàáâãäåæçèEEEEE ÚÛÜÝÞßàáâãäåæçèEEEEE +‚S‚T‚U‚V‚W‚XEEEEEEE‚`‚a‚b‚c‚d‚e‚f ‚S‚T‚U‚V‚W‚XEEEEEEE‚`‚a‚b‚c‚d‚e‚f +‚g‚h‚i‚j‚k‚l‚m‚n‚o‚p‚q‚r‚s‚t‚u‚v‚w‚x‚yE ‚g‚h‚i‚j‚k‚l‚m‚n‚o‚p‚q‚r‚s‚t‚u‚v‚w‚x‚yE +‚‚‘‚’‚“‚”‚•‚–‚—‚˜‚™‚šEEEEEEEEE ‚‚‘‚’‚“‚”‚•‚–‚—‚˜‚™‚šEEEEEEEEE +‚²‚³‚´‚µ‚¶‚·‚¸‚¹‚º‚»‚¼‚½‚¾‚¿‚À‚Á‚‚ÂĂŠ‚²‚³‚´‚µ‚¶‚·‚¸‚¹‚º‚»‚¼‚½‚¾‚¿‚À‚Á‚‚ÂĂŠ+‚ƂǂȂɂʂ˂̂͂΂ςЂт҂ӂԂՂւׂ؂٠‚ƂǂȂɂʂ˂̂͂΂ςЂт҂ӂԂՂւׂ؂٠+‚ڂۂ܂݂ނ߂à‚á‚â‚ã‚ä‚傿‚ç‚è‚é‚ê‚ë‚ì‚í ‚Ú‚Û‚Ü‚Ý‚Þ‚ß‚à‚á‚â‚ã‚ä‚傿‚ç‚è‚é‚ê‚ë‚ì‚í +‚î‚ï‚ð‚ñEEEEEEEEEEEEEEEE ‚î‚ï‚ð‚ñEEEEEEEEEEEEEEEE +ƒSƒTƒUƒVƒWƒXƒYƒZƒ[ƒ\ƒ]ƒ^ƒ_ƒ`ƒaƒbƒcƒdƒeƒf ƒSƒTƒUƒVƒWƒXƒYƒZƒ[ƒ\ƒ]ƒ^ƒ_ƒ`ƒaƒbƒcƒdƒeƒf +ƒgƒhƒiƒjƒkƒlƒmƒnƒoƒpƒqƒrƒsƒtƒuƒvƒwƒxƒyƒz ƒgƒhƒiƒjƒkƒlƒmƒnƒoƒpƒqƒrƒsƒtƒuƒvƒwƒxƒyƒz +ƒ{ƒ|ƒ}ƒ~ƒ€ƒƒ‚ƒƒƒ„ƒ…ƒ†ƒ‡ƒˆƒ‰ƒŠƒ‹ƒŒƒƒŽƒ ƒ{ƒ|ƒ}ƒ~ƒ€ƒƒ‚ƒƒƒ„ƒ…ƒ†ƒ‡ƒˆƒ‰ƒŠƒ‹ƒŒƒƒŽƒ +ƒƒ‘ƒ’ƒ“ƒ”ƒ•ƒ–EEEEEEEEEEEEE ƒƒ‘ƒ’ƒ“ƒ”ƒ•ƒ–EEEEEEEEEEEEE +ƒ²ƒ³ƒ´ƒµƒ¶EEEEEEEEƒ¿ƒÀƒÁƒÂƒÃƒÄƒÅ ƒ²ƒ³ƒ´ƒµƒ¶EEEEEEEEƒ¿ƒÀƒÁƒÂƒÃƒÄƒÅ +ƒÆƒÇƒÈƒÉƒÊƒËƒÌƒÍƒÎƒÏƒÐƒÑƒÒƒÓƒÔƒÕƒÖEEE ƒÆƒÇƒÈƒÉƒÊƒËƒÌƒÍƒÎƒÏƒÐƒÑƒÒƒÓƒÔƒÕƒÖEEE +„S„T„U„V„W„X„Y„Z„[„\„]„^„_„`EEEEEE „S„T„U„V„W„X„Y„Z„[„\„]„^„_„`EEEEEE +„{„|„}„~„€„„‚„ƒ„„„…„†„‡„ˆ„‰„Š„‹„Œ„„Ž„ „{„|„}„~„€„„‚„ƒ„„„…„†„‡„ˆ„‰„Š„‹„Œ„„Ž„ +„„‘EEEEEEEEEEEEEEEEEE „„‘EEEEEEEEEEEEEEEEEE +„²„³„´„µ„¶„·„¸„¹„º„»„¼„½„¾EEEEEEE „²„³„´„µ„¶„·„¸„¹„º„»„¼„½„¾EEEEEEE +ˆ²ˆ³ˆ´ˆµˆ¶ˆ·ˆ¸ˆ¹ˆºˆ»ˆ¼ˆ½ˆ¾ˆ¿ˆÀˆÁˆÂˆÃˆÄˆÅ ˆ²ˆ³ˆ´ˆµˆ¶ˆ·ˆ¸ˆ¹ˆºˆ»ˆ¼ˆ½ˆ¾ˆ¿ˆÀˆÁˆÂˆÃˆÄˆÅ +ˆÆˆÇˆÈˆÉˆÊˆËˆÌˆÍˆÎˆÏˆÐˆÑˆÒˆÓˆÔˆÕˆÖˆ×ˆØˆÙ ˆÆˆÇˆÈˆÉˆÊˆËˆÌˆÍˆÎˆÏˆÐˆÑˆÒˆÓˆÔˆÕˆÖˆ×ˆØˆÙ +ˆÚˆÛˆÜˆÝˆÞˆßˆàˆáˆâˆãˆäˆåˆæˆçˆèˆéˆêˆëˆìˆí ˆÚˆÛˆÜˆÝˆÞˆßˆàˆáˆâˆãˆäˆåˆæˆçˆèˆéˆêˆëˆìˆí +ˆîˆïˆðˆñˆòˆóˆôˆõˆöˆ÷ˆøˆùˆúˆûˆüEEEEE ˆîˆïˆðˆñˆòˆóˆôˆõˆöˆ÷ˆøˆùˆúˆûˆüEEEEE +˜S˜T˜U˜V˜W˜X˜Y˜Z˜[˜\˜]˜^˜_˜`˜a˜b˜c˜d˜e˜f ˜S˜T˜U˜V˜W˜X˜Y˜Z˜[˜\˜]˜^˜_˜`˜a˜b˜c˜d˜e˜f +˜g˜h˜i˜j˜k˜l˜m˜n˜o˜p˜q˜rEEEEEEEE ˜g˜h˜i˜j˜k˜l˜m˜n˜o˜p˜q˜rEEEEEEEE +˜²˜³˜´˜µ˜¶˜·˜¸˜¹˜º˜»˜¼˜½˜¾˜¿˜À˜Á˜Â˜Ã˜Ä˜Å ˜²˜³˜´˜µ˜¶˜·˜¸˜¹˜º˜»˜¼˜½˜¾˜¿˜À˜Á˜Â˜Ã˜Ä˜Å +˜Æ˜Ç˜È˜É˜Ê˜Ë˜Ì˜Í˜Î˜Ï˜Ð˜Ñ˜Ò˜Ó˜Ô˜Õ˜Ö˜×˜Ø˜Ù ˜Æ˜Ç˜È˜É˜Ê˜Ë˜Ì˜Í˜Î˜Ï˜Ð˜Ñ˜Ò˜Ó˜Ô˜Õ˜Ö˜×˜Ø˜Ù +˜Ú˜Û˜Ü˜Ý˜Þ˜ß˜à˜á˜â˜ã˜ä˜å˜æ˜ç˜è˜é˜ê˜ë˜ì˜í ˜Ú˜Û˜Ü˜Ý˜Þ˜ß˜à˜á˜â˜ã˜ä˜å˜æ˜ç˜è˜é˜ê˜ë˜ì˜í +˜î˜ï˜ð˜ñ˜ò˜ó˜ô˜õ˜ö˜÷˜ø˜ù˜ú˜û˜üEEEEE ˜î˜ï˜ð˜ñ˜ò˜ó˜ô˜õ˜ö˜÷˜ø˜ù˜ú˜û˜üEEEEE +êSêTêUêVêWêXêYêZê[ê\ê]ê^ê_ê`êaêbêcêdêeêf êSêTêUêVêWêXêYêZê[ê\ê]ê^ê_ê`êaêbêcêdêeêf +êgêhêiêjêkêlêmênêoêpêqêrêsêtêuêvêwêxêyêz êgêhêiêjêkêlêmênêoêpêqêrêsêtêuêvêwêxêyêz +ê{ê|ê}ê~ê€êê‚êƒê„ê…ê†ê‡êˆê‰êŠê‹êŒêêŽê ê{ê|ê}ê~ê€êê‚êƒê„ê…ê†ê‡êˆê‰êŠê‹êŒêêŽê +êê‘ê’ê“ê”ê•ê–ê—ê˜ê™êšê›êœêêžEEEEE êê‘ê’ê“ê”ê•ê–ê—ê˜ê™êšê›êœêêžEEEEE +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ucs2) FROM `‚s‚T`; +‚b‚P CONVERT(`‚b‚P` using ucs2) +@@ABCDEFGHIJKLMNOPQR @@ABCDEFGHIJKLMNOPQR +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEE‚O‚P‚Q‚R EEEEEEEEEEEEEEEE‚O‚P‚Q‚R +EEEEEEEEE„p„q„r„s„t„u„v„w„x„y„z EEEEEEEEE„p„q„r„s„t„u„v„w„x„y„z +EEEEEE¸¹º»¼½¾¿EEEEEE EEEEEE¸¹º»¼½¾¿EEEEEE +EEEEE‚‚‚‚ƒ‚„‚…‚†‚‡‚ˆ‚‰‚Š‚‹‚Œ‚‚Ž‚ EEEEE‚‚‚‚ƒ‚„‚…‚†‚‡‚ˆ‚‰‚Š‚‹‚Œ‚‚Ž‚ +EEÈÉÊËÌÍÎEEEEEEEEEEE EEÈÉÊËÌÍÎEEEEEEEEEEE +EEðñòóôõö÷EEEEüEEEE@ EEðñòóôõö÷EEEEüEEEE@ +EŸ ¡¢£¤¥¦§¨©ª«¬EEEEE EŸ ¡¢£¤¥¦§¨©ª«¬EEEEE +E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚­‚®‚¯‚°‚± E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚­‚®‚¯‚°‚± +Eƒ@ƒAƒBƒCƒDƒEƒFƒGƒHƒIƒJƒKƒLƒMƒNƒOƒPƒQƒR Eƒ@ƒAƒBƒCƒDƒEƒFƒGƒHƒIƒJƒKƒLƒMƒNƒOƒPƒQƒR +EƒŸƒ ƒ¡ƒ¢ƒ£ƒ¤ƒ¥ƒ¦ƒ§ƒ¨ƒ©ƒªƒ«ƒ¬ƒ­ƒ®ƒ¯ƒ°ƒ± EƒŸƒ ƒ¡ƒ¢ƒ£ƒ¤ƒ¥ƒ¦ƒ§ƒ¨ƒ©ƒªƒ«ƒ¬ƒ­ƒ®ƒ¯ƒ°ƒ± +E„@„A„B„C„D„E„F„G„H„I„J„K„L„M„N„O„P„Q„R E„@„A„B„C„D„E„F„G„H„I„J„K„L„M„N„O„P„Q„R +E„Ÿ„ „¡„¢„£„¤„¥„¦„§„¨„©„ª„«„¬„­„®„¯„°„± E„Ÿ„ „¡„¢„£„¤„¥„¦„§„¨„©„ª„«„¬„­„®„¯„°„± +EˆŸˆ ˆ¡ˆ¢ˆ£ˆ¤ˆ¥ˆ¦ˆ§ˆ¨ˆ©ˆªˆ«ˆ¬ˆ­ˆ®ˆ¯ˆ°ˆ± EˆŸˆ ˆ¡ˆ¢ˆ£ˆ¤ˆ¥ˆ¦ˆ§ˆ¨ˆ©ˆªˆ«ˆ¬ˆ­ˆ®ˆ¯ˆ°ˆ± +E˜@˜A˜B˜C˜D˜E˜F˜G˜H˜I˜J˜K˜L˜M˜N˜O˜P˜Q˜R E˜@˜A˜B˜C˜D˜E˜F˜G˜H˜I˜J˜K˜L˜M˜N˜O˜P˜Q˜R +E˜Ÿ˜ ˜¡˜¢˜£˜¤˜¥˜¦˜§˜¨˜©˜ª˜«˜¬˜­˜®˜¯˜°˜± E˜Ÿ˜ ˜¡˜¢˜£˜¤˜¥˜¦˜§˜¨˜©˜ª˜«˜¬˜­˜®˜¯˜°˜± +Eê@êAêBêCêDêEêFêGêHêIêJêKêLêMêNêOêPêQêR Eê@êAêBêCêDêEêFêGêHêIêJêKêLêMêNêOêPêQêR +EêŸê ê¡ê¢ê£ê¤EEEEEEEEEEEEE EêŸê ê¡ê¢ê£ê¤EEEEEEEEEEEEE +STUVWXYZ[\]^_`abcdef STUVWXYZ[\]^_`abcdef +ghijklmnopqrstuvwxyz ghijklmnopqrstuvwxyz +{]}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ {]}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ +‘’“”•–—˜™š›œžEEEEE ‘’“”•–—˜™š›œžEEEEE +ÚÛÜÝÞßàáâãäåæçèEEEEE ÚÛÜÝÞßàáâãäåæçèEEEEE +‚S‚T‚U‚V‚W‚XEEEEEEE‚`‚a‚b‚c‚d‚e‚f ‚S‚T‚U‚V‚W‚XEEEEEEE‚`‚a‚b‚c‚d‚e‚f +‚g‚h‚i‚j‚k‚l‚m‚n‚o‚p‚q‚r‚s‚t‚u‚v‚w‚x‚yE ‚g‚h‚i‚j‚k‚l‚m‚n‚o‚p‚q‚r‚s‚t‚u‚v‚w‚x‚yE +‚‚‘‚’‚“‚”‚•‚–‚—‚˜‚™‚šEEEEEEEEE ‚‚‘‚’‚“‚”‚•‚–‚—‚˜‚™‚šEEEEEEEEE +‚²‚³‚´‚µ‚¶‚·‚¸‚¹‚º‚»‚¼‚½‚¾‚¿‚À‚Á‚‚ÂĂŠ‚²‚³‚´‚µ‚¶‚·‚¸‚¹‚º‚»‚¼‚½‚¾‚¿‚À‚Á‚‚ÂĂŠ+‚ƂǂȂɂʂ˂̂͂΂ςЂт҂ӂԂՂւׂ؂٠‚ƂǂȂɂʂ˂̂͂΂ςЂт҂ӂԂՂւׂ؂٠+‚ڂۂ܂݂ނ߂à‚á‚â‚ã‚ä‚傿‚ç‚è‚é‚ê‚ë‚ì‚í ‚Ú‚Û‚Ü‚Ý‚Þ‚ß‚à‚á‚â‚ã‚ä‚傿‚ç‚è‚é‚ê‚ë‚ì‚í +‚î‚ï‚ð‚ñEEEEEEEEEEEEEEEE ‚î‚ï‚ð‚ñEEEEEEEEEEEEEEEE +ƒSƒTƒUƒVƒWƒXƒYƒZƒ[ƒ\ƒ]ƒ^ƒ_ƒ`ƒaƒbƒcƒdƒeƒf ƒSƒTƒUƒVƒWƒXƒYƒZƒ[ƒ\ƒ]ƒ^ƒ_ƒ`ƒaƒbƒcƒdƒeƒf +ƒgƒhƒiƒjƒkƒlƒmƒnƒoƒpƒqƒrƒsƒtƒuƒvƒwƒxƒyƒz ƒgƒhƒiƒjƒkƒlƒmƒnƒoƒpƒqƒrƒsƒtƒuƒvƒwƒxƒyƒz +ƒ{ƒ|ƒ}ƒ~ƒ€ƒƒ‚ƒƒƒ„ƒ…ƒ†ƒ‡ƒˆƒ‰ƒŠƒ‹ƒŒƒƒŽƒ ƒ{ƒ|ƒ}ƒ~ƒ€ƒƒ‚ƒƒƒ„ƒ…ƒ†ƒ‡ƒˆƒ‰ƒŠƒ‹ƒŒƒƒŽƒ +ƒƒ‘ƒ’ƒ“ƒ”ƒ•ƒ–EEEEEEEEEEEEE ƒƒ‘ƒ’ƒ“ƒ”ƒ•ƒ–EEEEEEEEEEEEE +ƒ²ƒ³ƒ´ƒµƒ¶EEEEEEEEƒ¿ƒÀƒÁƒÂƒÃƒÄƒÅ ƒ²ƒ³ƒ´ƒµƒ¶EEEEEEEEƒ¿ƒÀƒÁƒÂƒÃƒÄƒÅ +ƒÆƒÇƒÈƒÉƒÊƒËƒÌƒÍƒÎƒÏƒÐƒÑƒÒƒÓƒÔƒÕƒÖEEE ƒÆƒÇƒÈƒÉƒÊƒËƒÌƒÍƒÎƒÏƒÐƒÑƒÒƒÓƒÔƒÕƒÖEEE +„S„T„U„V„W„X„Y„Z„[„\„]„^„_„`EEEEEE „S„T„U„V„W„X„Y„Z„[„\„]„^„_„`EEEEEE +„{„|„}„~„€„„‚„ƒ„„„…„†„‡„ˆ„‰„Š„‹„Œ„„Ž„ „{„|„}„~„€„„‚„ƒ„„„…„†„‡„ˆ„‰„Š„‹„Œ„„Ž„ +„„‘EEEEEEEEEEEEEEEEEE „„‘EEEEEEEEEEEEEEEEEE +„²„³„´„µ„¶„·„¸„¹„º„»„¼„½„¾EEEEEEE „²„³„´„µ„¶„·„¸„¹„º„»„¼„½„¾EEEEEEE +ˆ²ˆ³ˆ´ˆµˆ¶ˆ·ˆ¸ˆ¹ˆºˆ»ˆ¼ˆ½ˆ¾ˆ¿ˆÀˆÁˆÂˆÃˆÄˆÅ ˆ²ˆ³ˆ´ˆµˆ¶ˆ·ˆ¸ˆ¹ˆºˆ»ˆ¼ˆ½ˆ¾ˆ¿ˆÀˆÁˆÂˆÃˆÄˆÅ +ˆÆˆÇˆÈˆÉˆÊˆËˆÌˆÍˆÎˆÏˆÐˆÑˆÒˆÓˆÔˆÕˆÖˆ×ˆØˆÙ ˆÆˆÇˆÈˆÉˆÊˆËˆÌˆÍˆÎˆÏˆÐˆÑˆÒˆÓˆÔˆÕˆÖˆ×ˆØˆÙ +ˆÚˆÛˆÜˆÝˆÞˆßˆàˆáˆâˆãˆäˆåˆæˆçˆèˆéˆêˆëˆìˆí ˆÚˆÛˆÜˆÝˆÞˆßˆàˆáˆâˆãˆäˆåˆæˆçˆèˆéˆêˆëˆìˆí +ˆîˆïˆðˆñˆòˆóˆôˆõˆöˆ÷ˆøˆùˆúˆûˆüEEEEE ˆîˆïˆðˆñˆòˆóˆôˆõˆöˆ÷ˆøˆùˆúˆûˆüEEEEE +˜S˜T˜U˜V˜W˜X˜Y˜Z˜[˜\˜]˜^˜_˜`˜a˜b˜c˜d˜e˜f ˜S˜T˜U˜V˜W˜X˜Y˜Z˜[˜\˜]˜^˜_˜`˜a˜b˜c˜d˜e˜f +˜g˜h˜i˜j˜k˜l˜m˜n˜o˜p˜q˜rEEEEEEEE ˜g˜h˜i˜j˜k˜l˜m˜n˜o˜p˜q˜rEEEEEEEE +˜²˜³˜´˜µ˜¶˜·˜¸˜¹˜º˜»˜¼˜½˜¾˜¿˜À˜Á˜Â˜Ã˜Ä˜Å ˜²˜³˜´˜µ˜¶˜·˜¸˜¹˜º˜»˜¼˜½˜¾˜¿˜À˜Á˜Â˜Ã˜Ä˜Å +˜Æ˜Ç˜È˜É˜Ê˜Ë˜Ì˜Í˜Î˜Ï˜Ð˜Ñ˜Ò˜Ó˜Ô˜Õ˜Ö˜×˜Ø˜Ù ˜Æ˜Ç˜È˜É˜Ê˜Ë˜Ì˜Í˜Î˜Ï˜Ð˜Ñ˜Ò˜Ó˜Ô˜Õ˜Ö˜×˜Ø˜Ù +˜Ú˜Û˜Ü˜Ý˜Þ˜ß˜à˜á˜â˜ã˜ä˜å˜æ˜ç˜è˜é˜ê˜ë˜ì˜í ˜Ú˜Û˜Ü˜Ý˜Þ˜ß˜à˜á˜â˜ã˜ä˜å˜æ˜ç˜è˜é˜ê˜ë˜ì˜í +˜î˜ï˜ð˜ñ˜ò˜ó˜ô˜õ˜ö˜÷˜ø˜ù˜ú˜û˜üEEEEE ˜î˜ï˜ð˜ñ˜ò˜ó˜ô˜õ˜ö˜÷˜ø˜ù˜ú˜û˜üEEEEE +êSêTêUêVêWêXêYêZê[ê\ê]ê^ê_ê`êaêbêcêdêeêf êSêTêUêVêWêXêYêZê[ê\ê]ê^ê_ê`êaêbêcêdêeêf +êgêhêiêjêkêlêmênêoêpêqêrêsêtêuêvêwêxêyêz êgêhêiêjêkêlêmênêoêpêqêrêsêtêuêvêwêxêyêz +ê{ê|ê}ê~ê€êê‚êƒê„ê…ê†ê‡êˆê‰êŠê‹êŒêêŽê ê{ê|ê}ê~ê€êê‚êƒê„ê…ê†ê‡êˆê‰êŠê‹êŒêêŽê +êê‘ê’ê“ê”ê•ê–ê—ê˜ê™êšê›êœêêžEEEEE êê‘ê’ê“ê”ê•ê–ê—ê˜ê™êšê›êœêêžEEEEE +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ujis) FROM `‚s‚T`; +‚b‚P CONVERT(`‚b‚P` using ujis) +@@ABCDEFGHIJKLMNOPQR @@ABCDEFGHIJKLMNOPQR +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEE‚O‚P‚Q‚R EEEEEEEEEEEEEEEE‚O‚P‚Q‚R +EEEEEEEEE„p„q„r„s„t„u„v„w„x„y„z EEEEEEEEE„p„q„r„s„t„u„v„w„x„y„z +EEEEEE¸¹º»¼½¾¿EEEEEE EEEEEE¸¹º»¼½¾¿EEEEEE +EEEEE‚‚‚‚ƒ‚„‚…‚†‚‡‚ˆ‚‰‚Š‚‹‚Œ‚‚Ž‚ EEEEE‚‚‚‚ƒ‚„‚…‚†‚‡‚ˆ‚‰‚Š‚‹‚Œ‚‚Ž‚ +EEÈÉÊËÌÍÎEEEEEEEEEEE EEÈÉÊËÌÍÎEEEEEEEEEEE +EEðñòóôõö÷EEEEüEEEE@ EEðñòóôõö÷EEEEüEEEE@ +EŸ ¡¢£¤¥¦§¨©ª«¬EEEEE EŸ ¡¢£¤¥¦§¨©ª«¬EEEEE +E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚­‚®‚¯‚°‚± E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚­‚®‚¯‚°‚± +Eƒ@ƒAƒBƒCƒDƒEƒFƒGƒHƒIƒJƒKƒLƒMƒNƒOƒPƒQƒR Eƒ@ƒAƒBƒCƒDƒEƒFƒGƒHƒIƒJƒKƒLƒMƒNƒOƒPƒQƒR +EƒŸƒ ƒ¡ƒ¢ƒ£ƒ¤ƒ¥ƒ¦ƒ§ƒ¨ƒ©ƒªƒ«ƒ¬ƒ­ƒ®ƒ¯ƒ°ƒ± EƒŸƒ ƒ¡ƒ¢ƒ£ƒ¤ƒ¥ƒ¦ƒ§ƒ¨ƒ©ƒªƒ«ƒ¬ƒ­ƒ®ƒ¯ƒ°ƒ± +E„@„A„B„C„D„E„F„G„H„I„J„K„L„M„N„O„P„Q„R E„@„A„B„C„D„E„F„G„H„I„J„K„L„M„N„O„P„Q„R +E„Ÿ„ „¡„¢„£„¤„¥„¦„§„¨„©„ª„«„¬„­„®„¯„°„± E„Ÿ„ „¡„¢„£„¤„¥„¦„§„¨„©„ª„«„¬„­„®„¯„°„± +EˆŸˆ ˆ¡ˆ¢ˆ£ˆ¤ˆ¥ˆ¦ˆ§ˆ¨ˆ©ˆªˆ«ˆ¬ˆ­ˆ®ˆ¯ˆ°ˆ± EˆŸˆ ˆ¡ˆ¢ˆ£ˆ¤ˆ¥ˆ¦ˆ§ˆ¨ˆ©ˆªˆ«ˆ¬ˆ­ˆ®ˆ¯ˆ°ˆ± +E˜@˜A˜B˜C˜D˜E˜F˜G˜H˜I˜J˜K˜L˜M˜N˜O˜P˜Q˜R E˜@˜A˜B˜C˜D˜E˜F˜G˜H˜I˜J˜K˜L˜M˜N˜O˜P˜Q˜R +E˜Ÿ˜ ˜¡˜¢˜£˜¤˜¥˜¦˜§˜¨˜©˜ª˜«˜¬˜­˜®˜¯˜°˜± E˜Ÿ˜ ˜¡˜¢˜£˜¤˜¥˜¦˜§˜¨˜©˜ª˜«˜¬˜­˜®˜¯˜°˜± +Eê@êAêBêCêDêEêFêGêHêIêJêKêLêMêNêOêPêQêR Eê@êAêBêCêDêEêFêGêHêIêJêKêLêMêNêOêPêQêR +EêŸê ê¡ê¢ê£ê¤EEEEEEEEEEEEE EêŸê ê¡ê¢ê£ê¤EEEEEEEEEEEEE +STUVWXYZ[\]^_`abcdef STUVWXYZ[\]^_`abcdef +ghijklmnopqrstuvwxyz ghijklmnopqrstuvwxyz +{]}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ {]}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ +‘’“”•–—˜™š›œžEEEEE ‘’“”•–—˜™š›œžEEEEE +ÚÛÜÝÞßàáâãäåæçèEEEEE ÚÛÜÝÞßàáâãäåæçèEEEEE +‚S‚T‚U‚V‚W‚XEEEEEEE‚`‚a‚b‚c‚d‚e‚f ‚S‚T‚U‚V‚W‚XEEEEEEE‚`‚a‚b‚c‚d‚e‚f +‚g‚h‚i‚j‚k‚l‚m‚n‚o‚p‚q‚r‚s‚t‚u‚v‚w‚x‚yE ‚g‚h‚i‚j‚k‚l‚m‚n‚o‚p‚q‚r‚s‚t‚u‚v‚w‚x‚yE +‚‚‘‚’‚“‚”‚•‚–‚—‚˜‚™‚šEEEEEEEEE ‚‚‘‚’‚“‚”‚•‚–‚—‚˜‚™‚šEEEEEEEEE +‚²‚³‚´‚µ‚¶‚·‚¸‚¹‚º‚»‚¼‚½‚¾‚¿‚À‚Á‚‚ÂĂŠ‚²‚³‚´‚µ‚¶‚·‚¸‚¹‚º‚»‚¼‚½‚¾‚¿‚À‚Á‚‚ÂĂŠ+‚ƂǂȂɂʂ˂̂͂΂ςЂт҂ӂԂՂւׂ؂٠‚ƂǂȂɂʂ˂̂͂΂ςЂт҂ӂԂՂւׂ؂٠+‚ڂۂ܂݂ނ߂à‚á‚â‚ã‚ä‚傿‚ç‚è‚é‚ê‚ë‚ì‚í ‚Ú‚Û‚Ü‚Ý‚Þ‚ß‚à‚á‚â‚ã‚ä‚傿‚ç‚è‚é‚ê‚ë‚ì‚í +‚î‚ï‚ð‚ñEEEEEEEEEEEEEEEE ‚î‚ï‚ð‚ñEEEEEEEEEEEEEEEE +ƒSƒTƒUƒVƒWƒXƒYƒZƒ[ƒ\ƒ]ƒ^ƒ_ƒ`ƒaƒbƒcƒdƒeƒf ƒSƒTƒUƒVƒWƒXƒYƒZƒ[ƒ\ƒ]ƒ^ƒ_ƒ`ƒaƒbƒcƒdƒeƒf +ƒgƒhƒiƒjƒkƒlƒmƒnƒoƒpƒqƒrƒsƒtƒuƒvƒwƒxƒyƒz ƒgƒhƒiƒjƒkƒlƒmƒnƒoƒpƒqƒrƒsƒtƒuƒvƒwƒxƒyƒz +ƒ{ƒ|ƒ}ƒ~ƒ€ƒƒ‚ƒƒƒ„ƒ…ƒ†ƒ‡ƒˆƒ‰ƒŠƒ‹ƒŒƒƒŽƒ ƒ{ƒ|ƒ}ƒ~ƒ€ƒƒ‚ƒƒƒ„ƒ…ƒ†ƒ‡ƒˆƒ‰ƒŠƒ‹ƒŒƒƒŽƒ +ƒƒ‘ƒ’ƒ“ƒ”ƒ•ƒ–EEEEEEEEEEEEE ƒƒ‘ƒ’ƒ“ƒ”ƒ•ƒ–EEEEEEEEEEEEE +ƒ²ƒ³ƒ´ƒµƒ¶EEEEEEEEƒ¿ƒÀƒÁƒÂƒÃƒÄƒÅ ƒ²ƒ³ƒ´ƒµƒ¶EEEEEEEEƒ¿ƒÀƒÁƒÂƒÃƒÄƒÅ +ƒÆƒÇƒÈƒÉƒÊƒËƒÌƒÍƒÎƒÏƒÐƒÑƒÒƒÓƒÔƒÕƒÖEEE ƒÆƒÇƒÈƒÉƒÊƒËƒÌƒÍƒÎƒÏƒÐƒÑƒÒƒÓƒÔƒÕƒÖEEE +„S„T„U„V„W„X„Y„Z„[„\„]„^„_„`EEEEEE „S„T„U„V„W„X„Y„Z„[„\„]„^„_„`EEEEEE +„{„|„}„~„€„„‚„ƒ„„„…„†„‡„ˆ„‰„Š„‹„Œ„„Ž„ „{„|„}„~„€„„‚„ƒ„„„…„†„‡„ˆ„‰„Š„‹„Œ„„Ž„ +„„‘EEEEEEEEEEEEEEEEEE „„‘EEEEEEEEEEEEEEEEEE +„²„³„´„µ„¶„·„¸„¹„º„»„¼„½„¾EEEEEEE „²„³„´„µ„¶„·„¸„¹„º„»„¼„½„¾EEEEEEE +ˆ²ˆ³ˆ´ˆµˆ¶ˆ·ˆ¸ˆ¹ˆºˆ»ˆ¼ˆ½ˆ¾ˆ¿ˆÀˆÁˆÂˆÃˆÄˆÅ ˆ²ˆ³ˆ´ˆµˆ¶ˆ·ˆ¸ˆ¹ˆºˆ»ˆ¼ˆ½ˆ¾ˆ¿ˆÀˆÁˆÂˆÃˆÄˆÅ +ˆÆˆÇˆÈˆÉˆÊˆËˆÌˆÍˆÎˆÏˆÐˆÑˆÒˆÓˆÔˆÕˆÖˆ×ˆØˆÙ ˆÆˆÇˆÈˆÉˆÊˆËˆÌˆÍˆÎˆÏˆÐˆÑˆÒˆÓˆÔˆÕˆÖˆ×ˆØˆÙ +ˆÚˆÛˆÜˆÝˆÞˆßˆàˆáˆâˆãˆäˆåˆæˆçˆèˆéˆêˆëˆìˆí ˆÚˆÛˆÜˆÝˆÞˆßˆàˆáˆâˆãˆäˆåˆæˆçˆèˆéˆêˆëˆìˆí +ˆîˆïˆðˆñˆòˆóˆôˆõˆöˆ÷ˆøˆùˆúˆûˆüEEEEE ˆîˆïˆðˆñˆòˆóˆôˆõˆöˆ÷ˆøˆùˆúˆûˆüEEEEE +˜S˜T˜U˜V˜W˜X˜Y˜Z˜[˜\˜]˜^˜_˜`˜a˜b˜c˜d˜e˜f ˜S˜T˜U˜V˜W˜X˜Y˜Z˜[˜\˜]˜^˜_˜`˜a˜b˜c˜d˜e˜f +˜g˜h˜i˜j˜k˜l˜m˜n˜o˜p˜q˜rEEEEEEEE ˜g˜h˜i˜j˜k˜l˜m˜n˜o˜p˜q˜rEEEEEEEE +˜²˜³˜´˜µ˜¶˜·˜¸˜¹˜º˜»˜¼˜½˜¾˜¿˜À˜Á˜Â˜Ã˜Ä˜Å ˜²˜³˜´˜µ˜¶˜·˜¸˜¹˜º˜»˜¼˜½˜¾˜¿˜À˜Á˜Â˜Ã˜Ä˜Å +˜Æ˜Ç˜È˜É˜Ê˜Ë˜Ì˜Í˜Î˜Ï˜Ð˜Ñ˜Ò˜Ó˜Ô˜Õ˜Ö˜×˜Ø˜Ù ˜Æ˜Ç˜È˜É˜Ê˜Ë˜Ì˜Í˜Î˜Ï˜Ð˜Ñ˜Ò˜Ó˜Ô˜Õ˜Ö˜×˜Ø˜Ù +˜Ú˜Û˜Ü˜Ý˜Þ˜ß˜à˜á˜â˜ã˜ä˜å˜æ˜ç˜è˜é˜ê˜ë˜ì˜í ˜Ú˜Û˜Ü˜Ý˜Þ˜ß˜à˜á˜â˜ã˜ä˜å˜æ˜ç˜è˜é˜ê˜ë˜ì˜í +˜î˜ï˜ð˜ñ˜ò˜ó˜ô˜õ˜ö˜÷˜ø˜ù˜ú˜û˜üEEEEE ˜î˜ï˜ð˜ñ˜ò˜ó˜ô˜õ˜ö˜÷˜ø˜ù˜ú˜û˜üEEEEE +êSêTêUêVêWêXêYêZê[ê\ê]ê^ê_ê`êaêbêcêdêeêf êSêTêUêVêWêXêYêZê[ê\ê]ê^ê_ê`êaêbêcêdêeêf +êgêhêiêjêkêlêmênêoêpêqêrêsêtêuêvêwêxêyêz êgêhêiêjêkêlêmênêoêpêqêrêsêtêuêvêwêxêyêz +ê{ê|ê}ê~ê€êê‚êƒê„ê…ê†ê‡êˆê‰êŠê‹êŒêêŽê ê{ê|ê}ê~ê€êê‚êƒê„ê…ê†ê‡êˆê‰êŠê‹êŒêêŽê +êê‘ê’ê“ê”ê•ê–ê—ê˜ê™êšê›êœêêžEEEEE êê‘ê’ê“ê”ê•ê–ê—ê˜ê™êšê›êœêêžEEEEE +SELECT `‚b‚P`, CONVERT(`‚b‚P` using utf8) FROM `‚s‚U`; +‚b‚P CONVERT(`‚b‚P` using utf8) +ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ucs2) FROM `‚s‚U`; +‚b‚P CONVERT(`‚b‚P` using ucs2) +ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ujis) FROM `‚s‚U`; +‚b‚P CONVERT(`‚b‚P` using ujis) +ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ +SELECT `‚b‚P`, CONVERT(`‚b‚P` using utf8) FROM `‚s‚V`; +‚b‚P CONVERT(`‚b‚P` using utf8) + !"#$%&'()*+,-./ !"#$%&'()*+,-./ +0123456789:;<=>? 0123456789:;<=>? +@ABCDEFGHIJKLMNO @ABCDEFGHIJKLMNO +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[_]^_ +abcdefghijklmno abcdefghijklmno +pqrstuvwxyz{|}~ pqrstuvwxyz{|}~ + ¡¢£¤¥¦§¨©ª«¬­®¯ ¡¢£¤¥¦§¨©ª«¬­®¯ +°±²³´µ¶·¸¹º»¼½¾¿ °±²³´µ¶·¸¹º»¼½¾¿ +ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ +ÐÑÒÓÔÕÖרÙÚÛÜÝÞß ÐÑÒÓÔÕÖרÙÚÛÜÝÞß +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ucs2) FROM `‚s‚V`; +‚b‚P CONVERT(`‚b‚P` using ucs2) + !"#$%&'()*+,-./ !"#$%&'()*+,-./ +0123456789:;<=>? 0123456789:;<=>? +@ABCDEFGHIJKLMNO @ABCDEFGHIJKLMNO +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[_]^_ +abcdefghijklmno abcdefghijklmno +pqrstuvwxyz{|}~ pqrstuvwxyz{|}~ + ¡¢£¤¥¦§¨©ª«¬­®¯ ¡¢£¤¥¦§¨©ª«¬­®¯ +°±²³´µ¶·¸¹º»¼½¾¿ °±²³´µ¶·¸¹º»¼½¾¿ +ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ +ÐÑÒÓÔÕÖרÙÚÛÜÝÞß ÐÑÒÓÔÕÖרÙÚÛÜÝÞß +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ujis) FROM `‚s‚V`; +‚b‚P CONVERT(`‚b‚P` using ujis) + !"#$%&'()*+,-./ !"#$%&'()*+,-./ +0123456789:;<=>? 0123456789:;<=>? +@ABCDEFGHIJKLMNO @ABCDEFGHIJKLMNO +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[_]^_ +abcdefghijklmno abcdefghijklmno +pqrstuvwxyz{|}~ pqrstuvwxyz{|}~ + ¡¢£¤¥¦§¨©ª«¬­®¯ ¡¢£¤¥¦§¨©ª«¬­®¯ +°±²³´µ¶·¸¹º»¼½¾¿ °±²³´µ¶·¸¹º»¼½¾¿ +ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ +ÐÑÒÓÔÕÖרÙÚÛÜÝÞß ÐÑÒÓÔÕÖרÙÚÛÜÝÞß +SELECT `‚b‚P`, CONVERT(`‚b‚P` using utf8) FROM `‚s‚W`; +‚b‚P CONVERT(`‚b‚P` using utf8) +@@ABCDEFGHIJKLMNOPQR @@ABCDEFGHIJKLMNOPQR +STUVWXYZ[\]^_`abcdef STUVWXYZ[\]^_`abcdef +ghijklmnopqrstuvwxyz ghijklmnopqrstuvwxyz +{]}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ {]}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ +‘’“”•–—˜™š›œžEEEEE ‘’“”•–—˜™š›œžEEEEE +EŸ ¡¢£¤¥¦§¨©ª«¬EEEEE EŸ ¡¢£¤¥¦§¨©ª«¬EEEEE +EEEEEE¸¹º»¼½¾¿EEEEEE EEEEEE¸¹º»¼½¾¿EEEEEE +EEÈÉÊËÌÍÎEEEEEEEEEEE EEÈÉÊËÌÍÎEEEEEEEEEEE +ÚÛÜÝÞßàáâãäåæçèEEEEE ÚÛÜÝÞßàáâãäåæçèEEEEE +EEðñòóôõö÷EEEEüEEEE@ EEðñòóôõö÷EEEEüEEEE@ +EEEEEEEEEEEEEEEE‚O‚P‚Q‚R EEEEEEEEEEEEEEEE‚O‚P‚Q‚R +‚S‚T‚U‚V‚W‚XEEEEEEE‚`‚a‚b‚c‚d‚e‚f ‚S‚T‚U‚V‚W‚XEEEEEEE‚`‚a‚b‚c‚d‚e‚f +‚g‚h‚i‚j‚k‚l‚m‚n‚o‚p‚q‚r‚s‚t‚u‚v‚w‚x‚yE ‚g‚h‚i‚j‚k‚l‚m‚n‚o‚p‚q‚r‚s‚t‚u‚v‚w‚x‚yE +EEEEE‚‚‚‚ƒ‚„‚…‚†‚‡‚ˆ‚‰‚Š‚‹‚Œ‚‚Ž‚ EEEEE‚‚‚‚ƒ‚„‚…‚†‚‡‚ˆ‚‰‚Š‚‹‚Œ‚‚Ž‚ +‚‚‘‚’‚“‚”‚•‚–‚—‚˜‚™‚šEEEEEEEEE ‚‚‘‚’‚“‚”‚•‚–‚—‚˜‚™‚šEEEEEEEEE +E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚­‚®‚¯‚°‚± E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚­‚®‚¯‚°‚± +‚²‚³‚´‚µ‚¶‚·‚¸‚¹‚º‚»‚¼‚½‚¾‚¿‚À‚Á‚‚ÂĂŠ‚²‚³‚´‚µ‚¶‚·‚¸‚¹‚º‚»‚¼‚½‚¾‚¿‚À‚Á‚‚ÂĂŠ+‚ƂǂȂɂʂ˂̂͂΂ςЂт҂ӂԂՂւׂ؂٠‚ƂǂȂɂʂ˂̂͂΂ςЂт҂ӂԂՂւׂ؂٠+‚ڂۂ܂݂ނ߂à‚á‚â‚ã‚ä‚傿‚ç‚è‚é‚ê‚ë‚ì‚í ‚Ú‚Û‚Ü‚Ý‚Þ‚ß‚à‚á‚â‚ã‚ä‚傿‚ç‚è‚é‚ê‚ë‚ì‚í +‚î‚ï‚ð‚ñEEEEEEEEEEEEEEEE ‚î‚ï‚ð‚ñEEEEEEEEEEEEEEEE +Eƒ@ƒAƒBƒCƒDƒEƒFƒGƒHƒIƒJƒKƒLƒMƒNƒOƒPƒQƒR Eƒ@ƒAƒBƒCƒDƒEƒFƒGƒHƒIƒJƒKƒLƒMƒNƒOƒPƒQƒR +ƒSƒTƒUƒVƒWƒXƒYƒZƒ[ƒ\ƒ]ƒ^ƒ_ƒ`ƒaƒbƒcƒdƒeƒf ƒSƒTƒUƒVƒWƒXƒYƒZƒ[ƒ\ƒ]ƒ^ƒ_ƒ`ƒaƒbƒcƒdƒeƒf +ƒgƒhƒiƒjƒkƒlƒmƒnƒoƒpƒqƒrƒsƒtƒuƒvƒwƒxƒyƒz ƒgƒhƒiƒjƒkƒlƒmƒnƒoƒpƒqƒrƒsƒtƒuƒvƒwƒxƒyƒz +ƒ{ƒ|ƒ}ƒ~ƒ€ƒƒ‚ƒƒƒ„ƒ…ƒ†ƒ‡ƒˆƒ‰ƒŠƒ‹ƒŒƒƒŽƒ ƒ{ƒ|ƒ}ƒ~ƒ€ƒƒ‚ƒƒƒ„ƒ…ƒ†ƒ‡ƒˆƒ‰ƒŠƒ‹ƒŒƒƒŽƒ +ƒƒ‘ƒ’ƒ“ƒ”ƒ•ƒ–EEEEEEEEEEEEE ƒƒ‘ƒ’ƒ“ƒ”ƒ•ƒ–EEEEEEEEEEEEE +EƒŸƒ ƒ¡ƒ¢ƒ£ƒ¤ƒ¥ƒ¦ƒ§ƒ¨ƒ©ƒªƒ«ƒ¬ƒ­ƒ®ƒ¯ƒ°ƒ± EƒŸƒ ƒ¡ƒ¢ƒ£ƒ¤ƒ¥ƒ¦ƒ§ƒ¨ƒ©ƒªƒ«ƒ¬ƒ­ƒ®ƒ¯ƒ°ƒ± +ƒ²ƒ³ƒ´ƒµƒ¶EEEEEEEEƒ¿ƒÀƒÁƒÂƒÃƒÄƒÅ ƒ²ƒ³ƒ´ƒµƒ¶EEEEEEEEƒ¿ƒÀƒÁƒÂƒÃƒÄƒÅ +ƒÆƒÇƒÈƒÉƒÊƒËƒÌƒÍƒÎƒÏƒÐƒÑƒÒƒÓƒÔƒÕƒÖEEE ƒÆƒÇƒÈƒÉƒÊƒËƒÌƒÍƒÎƒÏƒÐƒÑƒÒƒÓƒÔƒÕƒÖEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +E„@„A„B„C„D„E„F„G„H„I„J„K„L„M„N„O„P„Q„R E„@„A„B„C„D„E„F„G„H„I„J„K„L„M„N„O„P„Q„R +„S„T„U„V„W„X„Y„Z„[„\„]„^„_„`EEEEEE „S„T„U„V„W„X„Y„Z„[„\„]„^„_„`EEEEEE +EEEEEEEEE„p„q„r„s„t„u„v„w„x„y„z EEEEEEEEE„p„q„r„s„t„u„v„w„x„y„z +„{„|„}„~„€„„‚„ƒ„„„…„†„‡„ˆ„‰„Š„‹„Œ„„Ž„ „{„|„}„~„€„„‚„ƒ„„„…„†„‡„ˆ„‰„Š„‹„Œ„„Ž„ +„„‘EEEEEEEEEEEEEEEEEE „„‘EEEEEEEEEEEEEEEEEE +E„Ÿ„ „¡„¢„£„¤„¥„¦„§„¨„©„ª„«„¬„­„®„¯„°„± E„Ÿ„ „¡„¢„£„¤„¥„¦„§„¨„©„ª„«„¬„­„®„¯„°„± +„²„³„´„µ„¶„·„¸„¹„º„»„¼„½„¾EEEEEEE „²„³„´„µ„¶„·„¸„¹„º„»„¼„½„¾EEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EˆŸˆ ˆ¡ˆ¢ˆ£ˆ¤ˆ¥ˆ¦ˆ§ˆ¨ˆ©ˆªˆ«ˆ¬ˆ­ˆ®ˆ¯ˆ°ˆ± EˆŸˆ ˆ¡ˆ¢ˆ£ˆ¤ˆ¥ˆ¦ˆ§ˆ¨ˆ©ˆªˆ«ˆ¬ˆ­ˆ®ˆ¯ˆ°ˆ± +ˆ²ˆ³ˆ´ˆµˆ¶ˆ·ˆ¸ˆ¹ˆºˆ»ˆ¼ˆ½ˆ¾ˆ¿ˆÀˆÁˆÂˆÃˆÄˆÅ ˆ²ˆ³ˆ´ˆµˆ¶ˆ·ˆ¸ˆ¹ˆºˆ»ˆ¼ˆ½ˆ¾ˆ¿ˆÀˆÁˆÂˆÃˆÄˆÅ +ˆÆˆÇˆÈˆÉˆÊˆËˆÌˆÍˆÎˆÏˆÐˆÑˆÒˆÓˆÔˆÕˆÖˆ×ˆØˆÙ ˆÆˆÇˆÈˆÉˆÊˆËˆÌˆÍˆÎˆÏˆÐˆÑˆÒˆÓˆÔˆÕˆÖˆ×ˆØˆÙ +ˆÚˆÛˆÜˆÝˆÞˆßˆàˆáˆâˆãˆäˆåˆæˆçˆèˆéˆêˆëˆìˆí ˆÚˆÛˆÜˆÝˆÞˆßˆàˆáˆâˆãˆäˆåˆæˆçˆèˆéˆêˆëˆìˆí +ˆîˆïˆðˆñˆòˆóˆôˆõˆöˆ÷ˆøˆùˆúˆûˆüEEEEE ˆîˆïˆðˆñˆòˆóˆôˆõˆöˆ÷ˆøˆùˆúˆûˆüEEEEE +E˜@˜A˜B˜C˜D˜E˜F˜G˜H˜I˜J˜K˜L˜M˜N˜O˜P˜Q˜R E˜@˜A˜B˜C˜D˜E˜F˜G˜H˜I˜J˜K˜L˜M˜N˜O˜P˜Q˜R +˜S˜T˜U˜V˜W˜X˜Y˜Z˜[˜\˜]˜^˜_˜`˜a˜b˜c˜d˜e˜f ˜S˜T˜U˜V˜W˜X˜Y˜Z˜[˜\˜]˜^˜_˜`˜a˜b˜c˜d˜e˜f +˜g˜h˜i˜j˜k˜l˜m˜n˜o˜p˜q˜rEEEEEEEE ˜g˜h˜i˜j˜k˜l˜m˜n˜o˜p˜q˜rEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +E˜Ÿ˜ ˜¡˜¢˜£˜¤˜¥˜¦˜§˜¨˜©˜ª˜«˜¬˜­˜®˜¯˜°˜± E˜Ÿ˜ ˜¡˜¢˜£˜¤˜¥˜¦˜§˜¨˜©˜ª˜«˜¬˜­˜®˜¯˜°˜± +˜²˜³˜´˜µ˜¶˜·˜¸˜¹˜º˜»˜¼˜½˜¾˜¿˜À˜Á˜Â˜Ã˜Ä˜Å ˜²˜³˜´˜µ˜¶˜·˜¸˜¹˜º˜»˜¼˜½˜¾˜¿˜À˜Á˜Â˜Ã˜Ä˜Å +˜Æ˜Ç˜È˜É˜Ê˜Ë˜Ì˜Í˜Î˜Ï˜Ð˜Ñ˜Ò˜Ó˜Ô˜Õ˜Ö˜×˜Ø˜Ù ˜Æ˜Ç˜È˜É˜Ê˜Ë˜Ì˜Í˜Î˜Ï˜Ð˜Ñ˜Ò˜Ó˜Ô˜Õ˜Ö˜×˜Ø˜Ù +˜Ú˜Û˜Ü˜Ý˜Þ˜ß˜à˜á˜â˜ã˜ä˜å˜æ˜ç˜è˜é˜ê˜ë˜ì˜í ˜Ú˜Û˜Ü˜Ý˜Þ˜ß˜à˜á˜â˜ã˜ä˜å˜æ˜ç˜è˜é˜ê˜ë˜ì˜í +˜î˜ï˜ð˜ñ˜ò˜ó˜ô˜õ˜ö˜÷˜ø˜ù˜ú˜û˜üEEEEE ˜î˜ï˜ð˜ñ˜ò˜ó˜ô˜õ˜ö˜÷˜ø˜ù˜ú˜û˜üEEEEE +Eê@êAêBêCêDêEêFêGêHêIêJêKêLêMêNêOêPêQêR Eê@êAêBêCêDêEêFêGêHêIêJêKêLêMêNêOêPêQêR +êSêTêUêVêWêXêYêZê[ê\ê]ê^ê_ê`êaêbêcêdêeêf êSêTêUêVêWêXêYêZê[ê\ê]ê^ê_ê`êaêbêcêdêeêf +êgêhêiêjêkêlêmênêoêpêqêrêsêtêuêvêwêxêyêz êgêhêiêjêkêlêmênêoêpêqêrêsêtêuêvêwêxêyêz +ê{ê|ê}ê~ê€êê‚êƒê„ê…ê†ê‡êˆê‰êŠê‹êŒêêŽê ê{ê|ê}ê~ê€êê‚êƒê„ê…ê†ê‡êˆê‰êŠê‹êŒêêŽê +êê‘ê’ê“ê”ê•ê–ê—ê˜ê™êšê›êœêêžEEEEE êê‘ê’ê“ê”ê•ê–ê—ê˜ê™êšê›êœêêžEEEEE +EêŸê ê¡ê¢ê£ê¤EEEEEEEEEEEEE EêŸê ê¡ê¢ê£ê¤EEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ucs2) FROM `‚s‚W`; +‚b‚P CONVERT(`‚b‚P` using ucs2) +@@ABCDEFGHIJKLMNOPQR @@ABCDEFGHIJKLMNOPQR +STUVWXYZ[\]^_`abcdef STUVWXYZ[\]^_`abcdef +ghijklmnopqrstuvwxyz ghijklmnopqrstuvwxyz +{]}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ {]}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ +‘’“”•–—˜™š›œžEEEEE ‘’“”•–—˜™š›œžEEEEE +EŸ ¡¢£¤¥¦§¨©ª«¬EEEEE EŸ ¡¢£¤¥¦§¨©ª«¬EEEEE +EEEEEE¸¹º»¼½¾¿EEEEEE EEEEEE¸¹º»¼½¾¿EEEEEE +EEÈÉÊËÌÍÎEEEEEEEEEEE EEÈÉÊËÌÍÎEEEEEEEEEEE +ÚÛÜÝÞßàáâãäåæçèEEEEE ÚÛÜÝÞßàáâãäåæçèEEEEE +EEðñòóôõö÷EEEEüEEEE@ EEðñòóôõö÷EEEEüEEEE@ +EEEEEEEEEEEEEEEE‚O‚P‚Q‚R EEEEEEEEEEEEEEEE‚O‚P‚Q‚R +‚S‚T‚U‚V‚W‚XEEEEEEE‚`‚a‚b‚c‚d‚e‚f ‚S‚T‚U‚V‚W‚XEEEEEEE‚`‚a‚b‚c‚d‚e‚f +‚g‚h‚i‚j‚k‚l‚m‚n‚o‚p‚q‚r‚s‚t‚u‚v‚w‚x‚yE ‚g‚h‚i‚j‚k‚l‚m‚n‚o‚p‚q‚r‚s‚t‚u‚v‚w‚x‚yE +EEEEE‚‚‚‚ƒ‚„‚…‚†‚‡‚ˆ‚‰‚Š‚‹‚Œ‚‚Ž‚ EEEEE‚‚‚‚ƒ‚„‚…‚†‚‡‚ˆ‚‰‚Š‚‹‚Œ‚‚Ž‚ +‚‚‘‚’‚“‚”‚•‚–‚—‚˜‚™‚šEEEEEEEEE ‚‚‘‚’‚“‚”‚•‚–‚—‚˜‚™‚šEEEEEEEEE +E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚­‚®‚¯‚°‚± E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚­‚®‚¯‚°‚± +‚²‚³‚´‚µ‚¶‚·‚¸‚¹‚º‚»‚¼‚½‚¾‚¿‚À‚Á‚‚ÂĂŠ‚²‚³‚´‚µ‚¶‚·‚¸‚¹‚º‚»‚¼‚½‚¾‚¿‚À‚Á‚‚ÂĂŠ+‚ƂǂȂɂʂ˂̂͂΂ςЂт҂ӂԂՂւׂ؂٠‚ƂǂȂɂʂ˂̂͂΂ςЂт҂ӂԂՂւׂ؂٠+‚ڂۂ܂݂ނ߂à‚á‚â‚ã‚ä‚傿‚ç‚è‚é‚ê‚ë‚ì‚í ‚Ú‚Û‚Ü‚Ý‚Þ‚ß‚à‚á‚â‚ã‚ä‚傿‚ç‚è‚é‚ê‚ë‚ì‚í +‚î‚ï‚ð‚ñEEEEEEEEEEEEEEEE ‚î‚ï‚ð‚ñEEEEEEEEEEEEEEEE +Eƒ@ƒAƒBƒCƒDƒEƒFƒGƒHƒIƒJƒKƒLƒMƒNƒOƒPƒQƒR Eƒ@ƒAƒBƒCƒDƒEƒFƒGƒHƒIƒJƒKƒLƒMƒNƒOƒPƒQƒR +ƒSƒTƒUƒVƒWƒXƒYƒZƒ[ƒ\ƒ]ƒ^ƒ_ƒ`ƒaƒbƒcƒdƒeƒf ƒSƒTƒUƒVƒWƒXƒYƒZƒ[ƒ\ƒ]ƒ^ƒ_ƒ`ƒaƒbƒcƒdƒeƒf +ƒgƒhƒiƒjƒkƒlƒmƒnƒoƒpƒqƒrƒsƒtƒuƒvƒwƒxƒyƒz ƒgƒhƒiƒjƒkƒlƒmƒnƒoƒpƒqƒrƒsƒtƒuƒvƒwƒxƒyƒz +ƒ{ƒ|ƒ}ƒ~ƒ€ƒƒ‚ƒƒƒ„ƒ…ƒ†ƒ‡ƒˆƒ‰ƒŠƒ‹ƒŒƒƒŽƒ ƒ{ƒ|ƒ}ƒ~ƒ€ƒƒ‚ƒƒƒ„ƒ…ƒ†ƒ‡ƒˆƒ‰ƒŠƒ‹ƒŒƒƒŽƒ +ƒƒ‘ƒ’ƒ“ƒ”ƒ•ƒ–EEEEEEEEEEEEE ƒƒ‘ƒ’ƒ“ƒ”ƒ•ƒ–EEEEEEEEEEEEE +EƒŸƒ ƒ¡ƒ¢ƒ£ƒ¤ƒ¥ƒ¦ƒ§ƒ¨ƒ©ƒªƒ«ƒ¬ƒ­ƒ®ƒ¯ƒ°ƒ± EƒŸƒ ƒ¡ƒ¢ƒ£ƒ¤ƒ¥ƒ¦ƒ§ƒ¨ƒ©ƒªƒ«ƒ¬ƒ­ƒ®ƒ¯ƒ°ƒ± +ƒ²ƒ³ƒ´ƒµƒ¶EEEEEEEEƒ¿ƒÀƒÁƒÂƒÃƒÄƒÅ ƒ²ƒ³ƒ´ƒµƒ¶EEEEEEEEƒ¿ƒÀƒÁƒÂƒÃƒÄƒÅ +ƒÆƒÇƒÈƒÉƒÊƒËƒÌƒÍƒÎƒÏƒÐƒÑƒÒƒÓƒÔƒÕƒÖEEE ƒÆƒÇƒÈƒÉƒÊƒËƒÌƒÍƒÎƒÏƒÐƒÑƒÒƒÓƒÔƒÕƒÖEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +E„@„A„B„C„D„E„F„G„H„I„J„K„L„M„N„O„P„Q„R E„@„A„B„C„D„E„F„G„H„I„J„K„L„M„N„O„P„Q„R +„S„T„U„V„W„X„Y„Z„[„\„]„^„_„`EEEEEE „S„T„U„V„W„X„Y„Z„[„\„]„^„_„`EEEEEE +EEEEEEEEE„p„q„r„s„t„u„v„w„x„y„z EEEEEEEEE„p„q„r„s„t„u„v„w„x„y„z +„{„|„}„~„€„„‚„ƒ„„„…„†„‡„ˆ„‰„Š„‹„Œ„„Ž„ „{„|„}„~„€„„‚„ƒ„„„…„†„‡„ˆ„‰„Š„‹„Œ„„Ž„ +„„‘EEEEEEEEEEEEEEEEEE „„‘EEEEEEEEEEEEEEEEEE +E„Ÿ„ „¡„¢„£„¤„¥„¦„§„¨„©„ª„«„¬„­„®„¯„°„± E„Ÿ„ „¡„¢„£„¤„¥„¦„§„¨„©„ª„«„¬„­„®„¯„°„± +„²„³„´„µ„¶„·„¸„¹„º„»„¼„½„¾EEEEEEE „²„³„´„µ„¶„·„¸„¹„º„»„¼„½„¾EEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EˆŸˆ ˆ¡ˆ¢ˆ£ˆ¤ˆ¥ˆ¦ˆ§ˆ¨ˆ©ˆªˆ«ˆ¬ˆ­ˆ®ˆ¯ˆ°ˆ± EˆŸˆ ˆ¡ˆ¢ˆ£ˆ¤ˆ¥ˆ¦ˆ§ˆ¨ˆ©ˆªˆ«ˆ¬ˆ­ˆ®ˆ¯ˆ°ˆ± +ˆ²ˆ³ˆ´ˆµˆ¶ˆ·ˆ¸ˆ¹ˆºˆ»ˆ¼ˆ½ˆ¾ˆ¿ˆÀˆÁˆÂˆÃˆÄˆÅ ˆ²ˆ³ˆ´ˆµˆ¶ˆ·ˆ¸ˆ¹ˆºˆ»ˆ¼ˆ½ˆ¾ˆ¿ˆÀˆÁˆÂˆÃˆÄˆÅ +ˆÆˆÇˆÈˆÉˆÊˆËˆÌˆÍˆÎˆÏˆÐˆÑˆÒˆÓˆÔˆÕˆÖˆ×ˆØˆÙ ˆÆˆÇˆÈˆÉˆÊˆËˆÌˆÍˆÎˆÏˆÐˆÑˆÒˆÓˆÔˆÕˆÖˆ×ˆØˆÙ +ˆÚˆÛˆÜˆÝˆÞˆßˆàˆáˆâˆãˆäˆåˆæˆçˆèˆéˆêˆëˆìˆí ˆÚˆÛˆÜˆÝˆÞˆßˆàˆáˆâˆãˆäˆåˆæˆçˆèˆéˆêˆëˆìˆí +ˆîˆïˆðˆñˆòˆóˆôˆõˆöˆ÷ˆøˆùˆúˆûˆüEEEEE ˆîˆïˆðˆñˆòˆóˆôˆõˆöˆ÷ˆøˆùˆúˆûˆüEEEEE +E˜@˜A˜B˜C˜D˜E˜F˜G˜H˜I˜J˜K˜L˜M˜N˜O˜P˜Q˜R E˜@˜A˜B˜C˜D˜E˜F˜G˜H˜I˜J˜K˜L˜M˜N˜O˜P˜Q˜R +˜S˜T˜U˜V˜W˜X˜Y˜Z˜[˜\˜]˜^˜_˜`˜a˜b˜c˜d˜e˜f ˜S˜T˜U˜V˜W˜X˜Y˜Z˜[˜\˜]˜^˜_˜`˜a˜b˜c˜d˜e˜f +˜g˜h˜i˜j˜k˜l˜m˜n˜o˜p˜q˜rEEEEEEEE ˜g˜h˜i˜j˜k˜l˜m˜n˜o˜p˜q˜rEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +E˜Ÿ˜ ˜¡˜¢˜£˜¤˜¥˜¦˜§˜¨˜©˜ª˜«˜¬˜­˜®˜¯˜°˜± E˜Ÿ˜ ˜¡˜¢˜£˜¤˜¥˜¦˜§˜¨˜©˜ª˜«˜¬˜­˜®˜¯˜°˜± +˜²˜³˜´˜µ˜¶˜·˜¸˜¹˜º˜»˜¼˜½˜¾˜¿˜À˜Á˜Â˜Ã˜Ä˜Å ˜²˜³˜´˜µ˜¶˜·˜¸˜¹˜º˜»˜¼˜½˜¾˜¿˜À˜Á˜Â˜Ã˜Ä˜Å +˜Æ˜Ç˜È˜É˜Ê˜Ë˜Ì˜Í˜Î˜Ï˜Ð˜Ñ˜Ò˜Ó˜Ô˜Õ˜Ö˜×˜Ø˜Ù ˜Æ˜Ç˜È˜É˜Ê˜Ë˜Ì˜Í˜Î˜Ï˜Ð˜Ñ˜Ò˜Ó˜Ô˜Õ˜Ö˜×˜Ø˜Ù +˜Ú˜Û˜Ü˜Ý˜Þ˜ß˜à˜á˜â˜ã˜ä˜å˜æ˜ç˜è˜é˜ê˜ë˜ì˜í ˜Ú˜Û˜Ü˜Ý˜Þ˜ß˜à˜á˜â˜ã˜ä˜å˜æ˜ç˜è˜é˜ê˜ë˜ì˜í +˜î˜ï˜ð˜ñ˜ò˜ó˜ô˜õ˜ö˜÷˜ø˜ù˜ú˜û˜üEEEEE ˜î˜ï˜ð˜ñ˜ò˜ó˜ô˜õ˜ö˜÷˜ø˜ù˜ú˜û˜üEEEEE +Eê@êAêBêCêDêEêFêGêHêIêJêKêLêMêNêOêPêQêR Eê@êAêBêCêDêEêFêGêHêIêJêKêLêMêNêOêPêQêR +êSêTêUêVêWêXêYêZê[ê\ê]ê^ê_ê`êaêbêcêdêeêf êSêTêUêVêWêXêYêZê[ê\ê]ê^ê_ê`êaêbêcêdêeêf +êgêhêiêjêkêlêmênêoêpêqêrêsêtêuêvêwêxêyêz êgêhêiêjêkêlêmênêoêpêqêrêsêtêuêvêwêxêyêz +ê{ê|ê}ê~ê€êê‚êƒê„ê…ê†ê‡êˆê‰êŠê‹êŒêêŽê ê{ê|ê}ê~ê€êê‚êƒê„ê…ê†ê‡êˆê‰êŠê‹êŒêêŽê +êê‘ê’ê“ê”ê•ê–ê—ê˜ê™êšê›êœêêžEEEEE êê‘ê’ê“ê”ê•ê–ê—ê˜ê™êšê›êœêêžEEEEE +EêŸê ê¡ê¢ê£ê¤EEEEEEEEEEEEE EêŸê ê¡ê¢ê£ê¤EEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ujis) FROM `‚s‚W`; +‚b‚P CONVERT(`‚b‚P` using ujis) +@@ABCDEFGHIJKLMNOPQR @@ABCDEFGHIJKLMNOPQR +STUVWXYZ[\]^_`abcdef STUVWXYZ[\]^_`abcdef +ghijklmnopqrstuvwxyz ghijklmnopqrstuvwxyz +{]}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ {]}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ +‘’“”•–—˜™š›œžEEEEE ‘’“”•–—˜™š›œžEEEEE +EŸ ¡¢£¤¥¦§¨©ª«¬EEEEE EŸ ¡¢£¤¥¦§¨©ª«¬EEEEE +EEEEEE¸¹º»¼½¾¿EEEEEE EEEEEE¸¹º»¼½¾¿EEEEEE +EEÈÉÊËÌÍÎEEEEEEEEEEE EEÈÉÊËÌÍÎEEEEEEEEEEE +ÚÛÜÝÞßàáâãäåæçèEEEEE ÚÛÜÝÞßàáâãäåæçèEEEEE +EEðñòóôõö÷EEEEüEEEE@ EEðñòóôõö÷EEEEüEEEE@ +EEEEEEEEEEEEEEEE‚O‚P‚Q‚R EEEEEEEEEEEEEEEE‚O‚P‚Q‚R +‚S‚T‚U‚V‚W‚XEEEEEEE‚`‚a‚b‚c‚d‚e‚f ‚S‚T‚U‚V‚W‚XEEEEEEE‚`‚a‚b‚c‚d‚e‚f +‚g‚h‚i‚j‚k‚l‚m‚n‚o‚p‚q‚r‚s‚t‚u‚v‚w‚x‚yE ‚g‚h‚i‚j‚k‚l‚m‚n‚o‚p‚q‚r‚s‚t‚u‚v‚w‚x‚yE +EEEEE‚‚‚‚ƒ‚„‚…‚†‚‡‚ˆ‚‰‚Š‚‹‚Œ‚‚Ž‚ EEEEE‚‚‚‚ƒ‚„‚…‚†‚‡‚ˆ‚‰‚Š‚‹‚Œ‚‚Ž‚ +‚‚‘‚’‚“‚”‚•‚–‚—‚˜‚™‚šEEEEEEEEE ‚‚‘‚’‚“‚”‚•‚–‚—‚˜‚™‚šEEEEEEEEE +E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚­‚®‚¯‚°‚± E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚­‚®‚¯‚°‚± +‚²‚³‚´‚µ‚¶‚·‚¸‚¹‚º‚»‚¼‚½‚¾‚¿‚À‚Á‚‚ÂĂŠ‚²‚³‚´‚µ‚¶‚·‚¸‚¹‚º‚»‚¼‚½‚¾‚¿‚À‚Á‚‚ÂĂŠ+‚ƂǂȂɂʂ˂̂͂΂ςЂт҂ӂԂՂւׂ؂٠‚ƂǂȂɂʂ˂̂͂΂ςЂт҂ӂԂՂւׂ؂٠+‚ڂۂ܂݂ނ߂à‚á‚â‚ã‚ä‚傿‚ç‚è‚é‚ê‚ë‚ì‚í ‚Ú‚Û‚Ü‚Ý‚Þ‚ß‚à‚á‚â‚ã‚ä‚傿‚ç‚è‚é‚ê‚ë‚ì‚í +‚î‚ï‚ð‚ñEEEEEEEEEEEEEEEE ‚î‚ï‚ð‚ñEEEEEEEEEEEEEEEE +Eƒ@ƒAƒBƒCƒDƒEƒFƒGƒHƒIƒJƒKƒLƒMƒNƒOƒPƒQƒR Eƒ@ƒAƒBƒCƒDƒEƒFƒGƒHƒIƒJƒKƒLƒMƒNƒOƒPƒQƒR +ƒSƒTƒUƒVƒWƒXƒYƒZƒ[ƒ\ƒ]ƒ^ƒ_ƒ`ƒaƒbƒcƒdƒeƒf ƒSƒTƒUƒVƒWƒXƒYƒZƒ[ƒ\ƒ]ƒ^ƒ_ƒ`ƒaƒbƒcƒdƒeƒf +ƒgƒhƒiƒjƒkƒlƒmƒnƒoƒpƒqƒrƒsƒtƒuƒvƒwƒxƒyƒz ƒgƒhƒiƒjƒkƒlƒmƒnƒoƒpƒqƒrƒsƒtƒuƒvƒwƒxƒyƒz +ƒ{ƒ|ƒ}ƒ~ƒ€ƒƒ‚ƒƒƒ„ƒ…ƒ†ƒ‡ƒˆƒ‰ƒŠƒ‹ƒŒƒƒŽƒ ƒ{ƒ|ƒ}ƒ~ƒ€ƒƒ‚ƒƒƒ„ƒ…ƒ†ƒ‡ƒˆƒ‰ƒŠƒ‹ƒŒƒƒŽƒ +ƒƒ‘ƒ’ƒ“ƒ”ƒ•ƒ–EEEEEEEEEEEEE ƒƒ‘ƒ’ƒ“ƒ”ƒ•ƒ–EEEEEEEEEEEEE +EƒŸƒ ƒ¡ƒ¢ƒ£ƒ¤ƒ¥ƒ¦ƒ§ƒ¨ƒ©ƒªƒ«ƒ¬ƒ­ƒ®ƒ¯ƒ°ƒ± EƒŸƒ ƒ¡ƒ¢ƒ£ƒ¤ƒ¥ƒ¦ƒ§ƒ¨ƒ©ƒªƒ«ƒ¬ƒ­ƒ®ƒ¯ƒ°ƒ± +ƒ²ƒ³ƒ´ƒµƒ¶EEEEEEEEƒ¿ƒÀƒÁƒÂƒÃƒÄƒÅ ƒ²ƒ³ƒ´ƒµƒ¶EEEEEEEEƒ¿ƒÀƒÁƒÂƒÃƒÄƒÅ +ƒÆƒÇƒÈƒÉƒÊƒËƒÌƒÍƒÎƒÏƒÐƒÑƒÒƒÓƒÔƒÕƒÖEEE ƒÆƒÇƒÈƒÉƒÊƒËƒÌƒÍƒÎƒÏƒÐƒÑƒÒƒÓƒÔƒÕƒÖEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +E„@„A„B„C„D„E„F„G„H„I„J„K„L„M„N„O„P„Q„R E„@„A„B„C„D„E„F„G„H„I„J„K„L„M„N„O„P„Q„R +„S„T„U„V„W„X„Y„Z„[„\„]„^„_„`EEEEEE „S„T„U„V„W„X„Y„Z„[„\„]„^„_„`EEEEEE +EEEEEEEEE„p„q„r„s„t„u„v„w„x„y„z EEEEEEEEE„p„q„r„s„t„u„v„w„x„y„z +„{„|„}„~„€„„‚„ƒ„„„…„†„‡„ˆ„‰„Š„‹„Œ„„Ž„ „{„|„}„~„€„„‚„ƒ„„„…„†„‡„ˆ„‰„Š„‹„Œ„„Ž„ +„„‘EEEEEEEEEEEEEEEEEE „„‘EEEEEEEEEEEEEEEEEE +E„Ÿ„ „¡„¢„£„¤„¥„¦„§„¨„©„ª„«„¬„­„®„¯„°„± E„Ÿ„ „¡„¢„£„¤„¥„¦„§„¨„©„ª„«„¬„­„®„¯„°„± +„²„³„´„µ„¶„·„¸„¹„º„»„¼„½„¾EEEEEEE „²„³„´„µ„¶„·„¸„¹„º„»„¼„½„¾EEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EˆŸˆ ˆ¡ˆ¢ˆ£ˆ¤ˆ¥ˆ¦ˆ§ˆ¨ˆ©ˆªˆ«ˆ¬ˆ­ˆ®ˆ¯ˆ°ˆ± EˆŸˆ ˆ¡ˆ¢ˆ£ˆ¤ˆ¥ˆ¦ˆ§ˆ¨ˆ©ˆªˆ«ˆ¬ˆ­ˆ®ˆ¯ˆ°ˆ± +ˆ²ˆ³ˆ´ˆµˆ¶ˆ·ˆ¸ˆ¹ˆºˆ»ˆ¼ˆ½ˆ¾ˆ¿ˆÀˆÁˆÂˆÃˆÄˆÅ ˆ²ˆ³ˆ´ˆµˆ¶ˆ·ˆ¸ˆ¹ˆºˆ»ˆ¼ˆ½ˆ¾ˆ¿ˆÀˆÁˆÂˆÃˆÄˆÅ +ˆÆˆÇˆÈˆÉˆÊˆËˆÌˆÍˆÎˆÏˆÐˆÑˆÒˆÓˆÔˆÕˆÖˆ×ˆØˆÙ ˆÆˆÇˆÈˆÉˆÊˆËˆÌˆÍˆÎˆÏˆÐˆÑˆÒˆÓˆÔˆÕˆÖˆ×ˆØˆÙ +ˆÚˆÛˆÜˆÝˆÞˆßˆàˆáˆâˆãˆäˆåˆæˆçˆèˆéˆêˆëˆìˆí ˆÚˆÛˆÜˆÝˆÞˆßˆàˆáˆâˆãˆäˆåˆæˆçˆèˆéˆêˆëˆìˆí +ˆîˆïˆðˆñˆòˆóˆôˆõˆöˆ÷ˆøˆùˆúˆûˆüEEEEE ˆîˆïˆðˆñˆòˆóˆôˆõˆöˆ÷ˆøˆùˆúˆûˆüEEEEE +E˜@˜A˜B˜C˜D˜E˜F˜G˜H˜I˜J˜K˜L˜M˜N˜O˜P˜Q˜R E˜@˜A˜B˜C˜D˜E˜F˜G˜H˜I˜J˜K˜L˜M˜N˜O˜P˜Q˜R +˜S˜T˜U˜V˜W˜X˜Y˜Z˜[˜\˜]˜^˜_˜`˜a˜b˜c˜d˜e˜f ˜S˜T˜U˜V˜W˜X˜Y˜Z˜[˜\˜]˜^˜_˜`˜a˜b˜c˜d˜e˜f +˜g˜h˜i˜j˜k˜l˜m˜n˜o˜p˜q˜rEEEEEEEE ˜g˜h˜i˜j˜k˜l˜m˜n˜o˜p˜q˜rEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +E˜Ÿ˜ ˜¡˜¢˜£˜¤˜¥˜¦˜§˜¨˜©˜ª˜«˜¬˜­˜®˜¯˜°˜± E˜Ÿ˜ ˜¡˜¢˜£˜¤˜¥˜¦˜§˜¨˜©˜ª˜«˜¬˜­˜®˜¯˜°˜± +˜²˜³˜´˜µ˜¶˜·˜¸˜¹˜º˜»˜¼˜½˜¾˜¿˜À˜Á˜Â˜Ã˜Ä˜Å ˜²˜³˜´˜µ˜¶˜·˜¸˜¹˜º˜»˜¼˜½˜¾˜¿˜À˜Á˜Â˜Ã˜Ä˜Å +˜Æ˜Ç˜È˜É˜Ê˜Ë˜Ì˜Í˜Î˜Ï˜Ð˜Ñ˜Ò˜Ó˜Ô˜Õ˜Ö˜×˜Ø˜Ù ˜Æ˜Ç˜È˜É˜Ê˜Ë˜Ì˜Í˜Î˜Ï˜Ð˜Ñ˜Ò˜Ó˜Ô˜Õ˜Ö˜×˜Ø˜Ù +˜Ú˜Û˜Ü˜Ý˜Þ˜ß˜à˜á˜â˜ã˜ä˜å˜æ˜ç˜è˜é˜ê˜ë˜ì˜í ˜Ú˜Û˜Ü˜Ý˜Þ˜ß˜à˜á˜â˜ã˜ä˜å˜æ˜ç˜è˜é˜ê˜ë˜ì˜í +˜î˜ï˜ð˜ñ˜ò˜ó˜ô˜õ˜ö˜÷˜ø˜ù˜ú˜û˜üEEEEE ˜î˜ï˜ð˜ñ˜ò˜ó˜ô˜õ˜ö˜÷˜ø˜ù˜ú˜û˜üEEEEE +Eê@êAêBêCêDêEêFêGêHêIêJêKêLêMêNêOêPêQêR Eê@êAêBêCêDêEêFêGêHêIêJêKêLêMêNêOêPêQêR +êSêTêUêVêWêXêYêZê[ê\ê]ê^ê_ê`êaêbêcêdêeêf êSêTêUêVêWêXêYêZê[ê\ê]ê^ê_ê`êaêbêcêdêeêf +êgêhêiêjêkêlêmênêoêpêqêrêsêtêuêvêwêxêyêz êgêhêiêjêkêlêmênêoêpêqêrêsêtêuêvêwêxêyêz +ê{ê|ê}ê~ê€êê‚êƒê„ê…ê†ê‡êˆê‰êŠê‹êŒêêŽê ê{ê|ê}ê~ê€êê‚êƒê„ê…ê†ê‡êˆê‰êŠê‹êŒêêŽê +êê‘ê’ê“ê”ê•ê–ê—ê˜ê™êšê›êœêêžEEEEE êê‘ê’ê“ê”ê•ê–ê—ê˜ê™êšê›êœêêžEEEEE +EêŸê ê¡ê¢ê£ê¤EEEEEEEEEEEEE EêŸê ê¡ê¢ê£ê¤EEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +SELECT `‚b‚P`, CONVERT(`‚b‚P` using utf8) FROM `‚s‚X`; +‚b‚P CONVERT(`‚b‚P` using utf8) +ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ucs2) FROM `‚s‚X`; +‚b‚P CONVERT(`‚b‚P` using ucs2) +ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ujis) FROM `‚s‚X`; +‚b‚P CONVERT(`‚b‚P` using ujis) +ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ +SELECT `‚b‚P`, CONVERT(`‚b‚P` using utf8) FROM `‚s‚P‚O`; +‚b‚P CONVERT(`‚b‚P` using utf8) + !"#$%&'()*+,-./ !"#$%&'()*+,-./ +0123456789:;<=>? 0123456789:;<=>? +@ABCDEFGHIJKLMNO @ABCDEFGHIJKLMNO +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[_]^_ +abcdefghijklmno abcdefghijklmno +pqrstuvwxyz{|}~ pqrstuvwxyz{|}~ + ¡¢£¤¥¦§¨©ª«¬­®¯ ¡¢£¤¥¦§¨©ª«¬­®¯ +°±²³´µ¶·¸¹º»¼½¾¿ °±²³´µ¶·¸¹º»¼½¾¿ +ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ +ÐÑÒÓÔÕÖרÙÚÛÜÝÞß ÐÑÒÓÔÕÖרÙÚÛÜÝÞß +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ucs2) FROM `‚s‚P‚O`; +‚b‚P CONVERT(`‚b‚P` using ucs2) + !"#$%&'()*+,-./ !"#$%&'()*+,-./ +0123456789:;<=>? 0123456789:;<=>? +@ABCDEFGHIJKLMNO @ABCDEFGHIJKLMNO +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[_]^_ +abcdefghijklmno abcdefghijklmno +pqrstuvwxyz{|}~ pqrstuvwxyz{|}~ + ¡¢£¤¥¦§¨©ª«¬­®¯ ¡¢£¤¥¦§¨©ª«¬­®¯ +°±²³´µ¶·¸¹º»¼½¾¿ °±²³´µ¶·¸¹º»¼½¾¿ +ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ +ÐÑÒÓÔÕÖרÙÚÛÜÝÞß ÐÑÒÓÔÕÖרÙÚÛÜÝÞß +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ujis) FROM `‚s‚P‚O`; +‚b‚P CONVERT(`‚b‚P` using ujis) + !"#$%&'()*+,-./ !"#$%&'()*+,-./ +0123456789:;<=>? 0123456789:;<=>? +@ABCDEFGHIJKLMNO @ABCDEFGHIJKLMNO +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[_]^_ +abcdefghijklmno abcdefghijklmno +pqrstuvwxyz{|}~ pqrstuvwxyz{|}~ + ¡¢£¤¥¦§¨©ª«¬­®¯ ¡¢£¤¥¦§¨©ª«¬­®¯ +°±²³´µ¶·¸¹º»¼½¾¿ °±²³´µ¶·¸¹º»¼½¾¿ +ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ +ÐÑÒÓÔÕÖרÙÚÛÜÝÞß ÐÑÒÓÔÕÖרÙÚÛÜÝÞß +SELECT `‚b‚P`, CONVERT(`‚b‚P` using utf8) FROM `‚s‚P‚P`; +‚b‚P CONVERT(`‚b‚P` using utf8) +@@ABCDEFGHIJKLMNOPQR @@ABCDEFGHIJKLMNOPQR +STUVWXYZ[\]^_`abcdef STUVWXYZ[\]^_`abcdef +ghijklmnopqrstuvwxyz ghijklmnopqrstuvwxyz +{]}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ {]}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ +‘’“”•–—˜™š›œžEEEEE ‘’“”•–—˜™š›œžEEEEE +EŸ ¡¢£¤¥¦§¨©ª«¬EEEEE EŸ ¡¢£¤¥¦§¨©ª«¬EEEEE +EEEEEE¸¹º»¼½¾¿EEEEEE EEEEEE¸¹º»¼½¾¿EEEEEE +EEÈÉÊËÌÍÎEEEEEEEEEEE EEÈÉÊËÌÍÎEEEEEEEEEEE +ÚÛÜÝÞßàáâãäåæçèEEEEE ÚÛÜÝÞßàáâãäåæçèEEEEE +EEðñòóôõö÷EEEEüEEEE@ EEðñòóôõö÷EEEEüEEEE@ +EEEEEEEEEEEEEEEE‚O‚P‚Q‚R EEEEEEEEEEEEEEEE‚O‚P‚Q‚R +‚S‚T‚U‚V‚W‚XEEEEEEE‚`‚a‚b‚c‚d‚e‚f ‚S‚T‚U‚V‚W‚XEEEEEEE‚`‚a‚b‚c‚d‚e‚f +‚g‚h‚i‚j‚k‚l‚m‚n‚o‚p‚q‚r‚s‚t‚u‚v‚w‚x‚yE ‚g‚h‚i‚j‚k‚l‚m‚n‚o‚p‚q‚r‚s‚t‚u‚v‚w‚x‚yE +EEEEE‚‚‚‚ƒ‚„‚…‚†‚‡‚ˆ‚‰‚Š‚‹‚Œ‚‚Ž‚ EEEEE‚‚‚‚ƒ‚„‚…‚†‚‡‚ˆ‚‰‚Š‚‹‚Œ‚‚Ž‚ +‚‚‘‚’‚“‚”‚•‚–‚—‚˜‚™‚šEEEEEEEEE ‚‚‘‚’‚“‚”‚•‚–‚—‚˜‚™‚šEEEEEEEEE +E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚­‚®‚¯‚°‚± E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚­‚®‚¯‚°‚± +‚²‚³‚´‚µ‚¶‚·‚¸‚¹‚º‚»‚¼‚½‚¾‚¿‚À‚Á‚‚ÂĂŠ‚²‚³‚´‚µ‚¶‚·‚¸‚¹‚º‚»‚¼‚½‚¾‚¿‚À‚Á‚‚ÂĂŠ+‚ƂǂȂɂʂ˂̂͂΂ςЂт҂ӂԂՂւׂ؂٠‚ƂǂȂɂʂ˂̂͂΂ςЂт҂ӂԂՂւׂ؂٠+‚ڂۂ܂݂ނ߂à‚á‚â‚ã‚ä‚傿‚ç‚è‚é‚ê‚ë‚ì‚í ‚Ú‚Û‚Ü‚Ý‚Þ‚ß‚à‚á‚â‚ã‚ä‚傿‚ç‚è‚é‚ê‚ë‚ì‚í +‚î‚ï‚ð‚ñEEEEEEEEEEEEEEEE ‚î‚ï‚ð‚ñEEEEEEEEEEEEEEEE +Eƒ@ƒAƒBƒCƒDƒEƒFƒGƒHƒIƒJƒKƒLƒMƒNƒOƒPƒQƒR Eƒ@ƒAƒBƒCƒDƒEƒFƒGƒHƒIƒJƒKƒLƒMƒNƒOƒPƒQƒR +ƒSƒTƒUƒVƒWƒXƒYƒZƒ[ƒ\ƒ]ƒ^ƒ_ƒ`ƒaƒbƒcƒdƒeƒf ƒSƒTƒUƒVƒWƒXƒYƒZƒ[ƒ\ƒ]ƒ^ƒ_ƒ`ƒaƒbƒcƒdƒeƒf +ƒgƒhƒiƒjƒkƒlƒmƒnƒoƒpƒqƒrƒsƒtƒuƒvƒwƒxƒyƒz ƒgƒhƒiƒjƒkƒlƒmƒnƒoƒpƒqƒrƒsƒtƒuƒvƒwƒxƒyƒz +ƒ{ƒ|ƒ}ƒ~ƒ€ƒƒ‚ƒƒƒ„ƒ…ƒ†ƒ‡ƒˆƒ‰ƒŠƒ‹ƒŒƒƒŽƒ ƒ{ƒ|ƒ}ƒ~ƒ€ƒƒ‚ƒƒƒ„ƒ…ƒ†ƒ‡ƒˆƒ‰ƒŠƒ‹ƒŒƒƒŽƒ +ƒƒ‘ƒ’ƒ“ƒ”ƒ•ƒ–EEEEEEEEEEEEE ƒƒ‘ƒ’ƒ“ƒ”ƒ•ƒ–EEEEEEEEEEEEE +EƒŸƒ ƒ¡ƒ¢ƒ£ƒ¤ƒ¥ƒ¦ƒ§ƒ¨ƒ©ƒªƒ«ƒ¬ƒ­ƒ®ƒ¯ƒ°ƒ± EƒŸƒ ƒ¡ƒ¢ƒ£ƒ¤ƒ¥ƒ¦ƒ§ƒ¨ƒ©ƒªƒ«ƒ¬ƒ­ƒ®ƒ¯ƒ°ƒ± +ƒ²ƒ³ƒ´ƒµƒ¶EEEEEEEEƒ¿ƒÀƒÁƒÂƒÃƒÄƒÅ ƒ²ƒ³ƒ´ƒµƒ¶EEEEEEEEƒ¿ƒÀƒÁƒÂƒÃƒÄƒÅ +ƒÆƒÇƒÈƒÉƒÊƒËƒÌƒÍƒÎƒÏƒÐƒÑƒÒƒÓƒÔƒÕƒÖEEE ƒÆƒÇƒÈƒÉƒÊƒËƒÌƒÍƒÎƒÏƒÐƒÑƒÒƒÓƒÔƒÕƒÖEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +E„@„A„B„C„D„E„F„G„H„I„J„K„L„M„N„O„P„Q„R E„@„A„B„C„D„E„F„G„H„I„J„K„L„M„N„O„P„Q„R +„S„T„U„V„W„X„Y„Z„[„\„]„^„_„`EEEEEE „S„T„U„V„W„X„Y„Z„[„\„]„^„_„`EEEEEE +EEEEEEEEE„p„q„r„s„t„u„v„w„x„y„z EEEEEEEEE„p„q„r„s„t„u„v„w„x„y„z +„{„|„}„~„€„„‚„ƒ„„„…„†„‡„ˆ„‰„Š„‹„Œ„„Ž„ „{„|„}„~„€„„‚„ƒ„„„…„†„‡„ˆ„‰„Š„‹„Œ„„Ž„ +„„‘EEEEEEEEEEEEEEEEEE „„‘EEEEEEEEEEEEEEEEEE +E„Ÿ„ „¡„¢„£„¤„¥„¦„§„¨„©„ª„«„¬„­„®„¯„°„± E„Ÿ„ „¡„¢„£„¤„¥„¦„§„¨„©„ª„«„¬„­„®„¯„°„± +„²„³„´„µ„¶„·„¸„¹„º„»„¼„½„¾EEEEEEE „²„³„´„µ„¶„·„¸„¹„º„»„¼„½„¾EEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EˆŸˆ ˆ¡ˆ¢ˆ£ˆ¤ˆ¥ˆ¦ˆ§ˆ¨ˆ©ˆªˆ«ˆ¬ˆ­ˆ®ˆ¯ˆ°ˆ± EˆŸˆ ˆ¡ˆ¢ˆ£ˆ¤ˆ¥ˆ¦ˆ§ˆ¨ˆ©ˆªˆ«ˆ¬ˆ­ˆ®ˆ¯ˆ°ˆ± +ˆ²ˆ³ˆ´ˆµˆ¶ˆ·ˆ¸ˆ¹ˆºˆ»ˆ¼ˆ½ˆ¾ˆ¿ˆÀˆÁˆÂˆÃˆÄˆÅ ˆ²ˆ³ˆ´ˆµˆ¶ˆ·ˆ¸ˆ¹ˆºˆ»ˆ¼ˆ½ˆ¾ˆ¿ˆÀˆÁˆÂˆÃˆÄˆÅ +ˆÆˆÇˆÈˆÉˆÊˆËˆÌˆÍˆÎˆÏˆÐˆÑˆÒˆÓˆÔˆÕˆÖˆ×ˆØˆÙ ˆÆˆÇˆÈˆÉˆÊˆËˆÌˆÍˆÎˆÏˆÐˆÑˆÒˆÓˆÔˆÕˆÖˆ×ˆØˆÙ +ˆÚˆÛˆÜˆÝˆÞˆßˆàˆáˆâˆãˆäˆåˆæˆçˆèˆéˆêˆëˆìˆí ˆÚˆÛˆÜˆÝˆÞˆßˆàˆáˆâˆãˆäˆåˆæˆçˆèˆéˆêˆëˆìˆí +ˆîˆïˆðˆñˆòˆóˆôˆõˆöˆ÷ˆøˆùˆúˆûˆüEEEEE ˆîˆïˆðˆñˆòˆóˆôˆõˆöˆ÷ˆøˆùˆúˆûˆüEEEEE +E˜@˜A˜B˜C˜D˜E˜F˜G˜H˜I˜J˜K˜L˜M˜N˜O˜P˜Q˜R E˜@˜A˜B˜C˜D˜E˜F˜G˜H˜I˜J˜K˜L˜M˜N˜O˜P˜Q˜R +˜S˜T˜U˜V˜W˜X˜Y˜Z˜[˜\˜]˜^˜_˜`˜a˜b˜c˜d˜e˜f ˜S˜T˜U˜V˜W˜X˜Y˜Z˜[˜\˜]˜^˜_˜`˜a˜b˜c˜d˜e˜f +˜g˜h˜i˜j˜k˜l˜m˜n˜o˜p˜q˜rEEEEEEEE ˜g˜h˜i˜j˜k˜l˜m˜n˜o˜p˜q˜rEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +E˜Ÿ˜ ˜¡˜¢˜£˜¤˜¥˜¦˜§˜¨˜©˜ª˜«˜¬˜­˜®˜¯˜°˜± E˜Ÿ˜ ˜¡˜¢˜£˜¤˜¥˜¦˜§˜¨˜©˜ª˜«˜¬˜­˜®˜¯˜°˜± +˜²˜³˜´˜µ˜¶˜·˜¸˜¹˜º˜»˜¼˜½˜¾˜¿˜À˜Á˜Â˜Ã˜Ä˜Å ˜²˜³˜´˜µ˜¶˜·˜¸˜¹˜º˜»˜¼˜½˜¾˜¿˜À˜Á˜Â˜Ã˜Ä˜Å +˜Æ˜Ç˜È˜É˜Ê˜Ë˜Ì˜Í˜Î˜Ï˜Ð˜Ñ˜Ò˜Ó˜Ô˜Õ˜Ö˜×˜Ø˜Ù ˜Æ˜Ç˜È˜É˜Ê˜Ë˜Ì˜Í˜Î˜Ï˜Ð˜Ñ˜Ò˜Ó˜Ô˜Õ˜Ö˜×˜Ø˜Ù +˜Ú˜Û˜Ü˜Ý˜Þ˜ß˜à˜á˜â˜ã˜ä˜å˜æ˜ç˜è˜é˜ê˜ë˜ì˜í ˜Ú˜Û˜Ü˜Ý˜Þ˜ß˜à˜á˜â˜ã˜ä˜å˜æ˜ç˜è˜é˜ê˜ë˜ì˜í +˜î˜ï˜ð˜ñ˜ò˜ó˜ô˜õ˜ö˜÷˜ø˜ù˜ú˜û˜üEEEEE ˜î˜ï˜ð˜ñ˜ò˜ó˜ô˜õ˜ö˜÷˜ø˜ù˜ú˜û˜üEEEEE +Eê@êAêBêCêDêEêFêGêHêIêJêKêLêMêNêOêPêQêR Eê@êAêBêCêDêEêFêGêHêIêJêKêLêMêNêOêPêQêR +êSêTêUêVêWêXêYêZê[ê\ê]ê^ê_ê`êaêbêcêdêeêf êSêTêUêVêWêXêYêZê[ê\ê]ê^ê_ê`êaêbêcêdêeêf +êgêhêiêjêkêlêmênêoêpêqêrêsêtêuêvêwêxêyêz êgêhêiêjêkêlêmênêoêpêqêrêsêtêuêvêwêxêyêz +ê{ê|ê}ê~ê€êê‚êƒê„ê…ê†ê‡êˆê‰êŠê‹êŒêêŽê ê{ê|ê}ê~ê€êê‚êƒê„ê…ê†ê‡êˆê‰êŠê‹êŒêêŽê +êê‘ê’ê“ê”ê•ê–ê—ê˜ê™êšê›êœêêžEEEEE êê‘ê’ê“ê”ê•ê–ê—ê˜ê™êšê›êœêêžEEEEE +EêŸê ê¡ê¢ê£ê¤EEEEEEEEEEEEE EêŸê ê¡ê¢ê£ê¤EEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ucs2) FROM `‚s‚P‚P`; +‚b‚P CONVERT(`‚b‚P` using ucs2) +@@ABCDEFGHIJKLMNOPQR @@ABCDEFGHIJKLMNOPQR +STUVWXYZ[\]^_`abcdef STUVWXYZ[\]^_`abcdef +ghijklmnopqrstuvwxyz ghijklmnopqrstuvwxyz +{]}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ {]}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ +‘’“”•–—˜™š›œžEEEEE ‘’“”•–—˜™š›œžEEEEE +EŸ ¡¢£¤¥¦§¨©ª«¬EEEEE EŸ ¡¢£¤¥¦§¨©ª«¬EEEEE +EEEEEE¸¹º»¼½¾¿EEEEEE EEEEEE¸¹º»¼½¾¿EEEEEE +EEÈÉÊËÌÍÎEEEEEEEEEEE EEÈÉÊËÌÍÎEEEEEEEEEEE +ÚÛÜÝÞßàáâãäåæçèEEEEE ÚÛÜÝÞßàáâãäåæçèEEEEE +EEðñòóôõö÷EEEEüEEEE@ EEðñòóôõö÷EEEEüEEEE@ +EEEEEEEEEEEEEEEE‚O‚P‚Q‚R EEEEEEEEEEEEEEEE‚O‚P‚Q‚R +‚S‚T‚U‚V‚W‚XEEEEEEE‚`‚a‚b‚c‚d‚e‚f ‚S‚T‚U‚V‚W‚XEEEEEEE‚`‚a‚b‚c‚d‚e‚f +‚g‚h‚i‚j‚k‚l‚m‚n‚o‚p‚q‚r‚s‚t‚u‚v‚w‚x‚yE ‚g‚h‚i‚j‚k‚l‚m‚n‚o‚p‚q‚r‚s‚t‚u‚v‚w‚x‚yE +EEEEE‚‚‚‚ƒ‚„‚…‚†‚‡‚ˆ‚‰‚Š‚‹‚Œ‚‚Ž‚ EEEEE‚‚‚‚ƒ‚„‚…‚†‚‡‚ˆ‚‰‚Š‚‹‚Œ‚‚Ž‚ +‚‚‘‚’‚“‚”‚•‚–‚—‚˜‚™‚šEEEEEEEEE ‚‚‘‚’‚“‚”‚•‚–‚—‚˜‚™‚šEEEEEEEEE +E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚­‚®‚¯‚°‚± E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚­‚®‚¯‚°‚± +‚²‚³‚´‚µ‚¶‚·‚¸‚¹‚º‚»‚¼‚½‚¾‚¿‚À‚Á‚‚ÂĂŠ‚²‚³‚´‚µ‚¶‚·‚¸‚¹‚º‚»‚¼‚½‚¾‚¿‚À‚Á‚‚ÂĂŠ+‚ƂǂȂɂʂ˂̂͂΂ςЂт҂ӂԂՂւׂ؂٠‚ƂǂȂɂʂ˂̂͂΂ςЂт҂ӂԂՂւׂ؂٠+‚ڂۂ܂݂ނ߂à‚á‚â‚ã‚ä‚傿‚ç‚è‚é‚ê‚ë‚ì‚í ‚Ú‚Û‚Ü‚Ý‚Þ‚ß‚à‚á‚â‚ã‚ä‚傿‚ç‚è‚é‚ê‚ë‚ì‚í +‚î‚ï‚ð‚ñEEEEEEEEEEEEEEEE ‚î‚ï‚ð‚ñEEEEEEEEEEEEEEEE +Eƒ@ƒAƒBƒCƒDƒEƒFƒGƒHƒIƒJƒKƒLƒMƒNƒOƒPƒQƒR Eƒ@ƒAƒBƒCƒDƒEƒFƒGƒHƒIƒJƒKƒLƒMƒNƒOƒPƒQƒR +ƒSƒTƒUƒVƒWƒXƒYƒZƒ[ƒ\ƒ]ƒ^ƒ_ƒ`ƒaƒbƒcƒdƒeƒf ƒSƒTƒUƒVƒWƒXƒYƒZƒ[ƒ\ƒ]ƒ^ƒ_ƒ`ƒaƒbƒcƒdƒeƒf +ƒgƒhƒiƒjƒkƒlƒmƒnƒoƒpƒqƒrƒsƒtƒuƒvƒwƒxƒyƒz ƒgƒhƒiƒjƒkƒlƒmƒnƒoƒpƒqƒrƒsƒtƒuƒvƒwƒxƒyƒz +ƒ{ƒ|ƒ}ƒ~ƒ€ƒƒ‚ƒƒƒ„ƒ…ƒ†ƒ‡ƒˆƒ‰ƒŠƒ‹ƒŒƒƒŽƒ ƒ{ƒ|ƒ}ƒ~ƒ€ƒƒ‚ƒƒƒ„ƒ…ƒ†ƒ‡ƒˆƒ‰ƒŠƒ‹ƒŒƒƒŽƒ +ƒƒ‘ƒ’ƒ“ƒ”ƒ•ƒ–EEEEEEEEEEEEE ƒƒ‘ƒ’ƒ“ƒ”ƒ•ƒ–EEEEEEEEEEEEE +EƒŸƒ ƒ¡ƒ¢ƒ£ƒ¤ƒ¥ƒ¦ƒ§ƒ¨ƒ©ƒªƒ«ƒ¬ƒ­ƒ®ƒ¯ƒ°ƒ± EƒŸƒ ƒ¡ƒ¢ƒ£ƒ¤ƒ¥ƒ¦ƒ§ƒ¨ƒ©ƒªƒ«ƒ¬ƒ­ƒ®ƒ¯ƒ°ƒ± +ƒ²ƒ³ƒ´ƒµƒ¶EEEEEEEEƒ¿ƒÀƒÁƒÂƒÃƒÄƒÅ ƒ²ƒ³ƒ´ƒµƒ¶EEEEEEEEƒ¿ƒÀƒÁƒÂƒÃƒÄƒÅ +ƒÆƒÇƒÈƒÉƒÊƒËƒÌƒÍƒÎƒÏƒÐƒÑƒÒƒÓƒÔƒÕƒÖEEE ƒÆƒÇƒÈƒÉƒÊƒËƒÌƒÍƒÎƒÏƒÐƒÑƒÒƒÓƒÔƒÕƒÖEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +E„@„A„B„C„D„E„F„G„H„I„J„K„L„M„N„O„P„Q„R E„@„A„B„C„D„E„F„G„H„I„J„K„L„M„N„O„P„Q„R +„S„T„U„V„W„X„Y„Z„[„\„]„^„_„`EEEEEE „S„T„U„V„W„X„Y„Z„[„\„]„^„_„`EEEEEE +EEEEEEEEE„p„q„r„s„t„u„v„w„x„y„z EEEEEEEEE„p„q„r„s„t„u„v„w„x„y„z +„{„|„}„~„€„„‚„ƒ„„„…„†„‡„ˆ„‰„Š„‹„Œ„„Ž„ „{„|„}„~„€„„‚„ƒ„„„…„†„‡„ˆ„‰„Š„‹„Œ„„Ž„ +„„‘EEEEEEEEEEEEEEEEEE „„‘EEEEEEEEEEEEEEEEEE +E„Ÿ„ „¡„¢„£„¤„¥„¦„§„¨„©„ª„«„¬„­„®„¯„°„± E„Ÿ„ „¡„¢„£„¤„¥„¦„§„¨„©„ª„«„¬„­„®„¯„°„± +„²„³„´„µ„¶„·„¸„¹„º„»„¼„½„¾EEEEEEE „²„³„´„µ„¶„·„¸„¹„º„»„¼„½„¾EEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EˆŸˆ ˆ¡ˆ¢ˆ£ˆ¤ˆ¥ˆ¦ˆ§ˆ¨ˆ©ˆªˆ«ˆ¬ˆ­ˆ®ˆ¯ˆ°ˆ± EˆŸˆ ˆ¡ˆ¢ˆ£ˆ¤ˆ¥ˆ¦ˆ§ˆ¨ˆ©ˆªˆ«ˆ¬ˆ­ˆ®ˆ¯ˆ°ˆ± +ˆ²ˆ³ˆ´ˆµˆ¶ˆ·ˆ¸ˆ¹ˆºˆ»ˆ¼ˆ½ˆ¾ˆ¿ˆÀˆÁˆÂˆÃˆÄˆÅ ˆ²ˆ³ˆ´ˆµˆ¶ˆ·ˆ¸ˆ¹ˆºˆ»ˆ¼ˆ½ˆ¾ˆ¿ˆÀˆÁˆÂˆÃˆÄˆÅ +ˆÆˆÇˆÈˆÉˆÊˆËˆÌˆÍˆÎˆÏˆÐˆÑˆÒˆÓˆÔˆÕˆÖˆ×ˆØˆÙ ˆÆˆÇˆÈˆÉˆÊˆËˆÌˆÍˆÎˆÏˆÐˆÑˆÒˆÓˆÔˆÕˆÖˆ×ˆØˆÙ +ˆÚˆÛˆÜˆÝˆÞˆßˆàˆáˆâˆãˆäˆåˆæˆçˆèˆéˆêˆëˆìˆí ˆÚˆÛˆÜˆÝˆÞˆßˆàˆáˆâˆãˆäˆåˆæˆçˆèˆéˆêˆëˆìˆí +ˆîˆïˆðˆñˆòˆóˆôˆõˆöˆ÷ˆøˆùˆúˆûˆüEEEEE ˆîˆïˆðˆñˆòˆóˆôˆõˆöˆ÷ˆøˆùˆúˆûˆüEEEEE +E˜@˜A˜B˜C˜D˜E˜F˜G˜H˜I˜J˜K˜L˜M˜N˜O˜P˜Q˜R E˜@˜A˜B˜C˜D˜E˜F˜G˜H˜I˜J˜K˜L˜M˜N˜O˜P˜Q˜R +˜S˜T˜U˜V˜W˜X˜Y˜Z˜[˜\˜]˜^˜_˜`˜a˜b˜c˜d˜e˜f ˜S˜T˜U˜V˜W˜X˜Y˜Z˜[˜\˜]˜^˜_˜`˜a˜b˜c˜d˜e˜f +˜g˜h˜i˜j˜k˜l˜m˜n˜o˜p˜q˜rEEEEEEEE ˜g˜h˜i˜j˜k˜l˜m˜n˜o˜p˜q˜rEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +E˜Ÿ˜ ˜¡˜¢˜£˜¤˜¥˜¦˜§˜¨˜©˜ª˜«˜¬˜­˜®˜¯˜°˜± E˜Ÿ˜ ˜¡˜¢˜£˜¤˜¥˜¦˜§˜¨˜©˜ª˜«˜¬˜­˜®˜¯˜°˜± +˜²˜³˜´˜µ˜¶˜·˜¸˜¹˜º˜»˜¼˜½˜¾˜¿˜À˜Á˜Â˜Ã˜Ä˜Å ˜²˜³˜´˜µ˜¶˜·˜¸˜¹˜º˜»˜¼˜½˜¾˜¿˜À˜Á˜Â˜Ã˜Ä˜Å +˜Æ˜Ç˜È˜É˜Ê˜Ë˜Ì˜Í˜Î˜Ï˜Ð˜Ñ˜Ò˜Ó˜Ô˜Õ˜Ö˜×˜Ø˜Ù ˜Æ˜Ç˜È˜É˜Ê˜Ë˜Ì˜Í˜Î˜Ï˜Ð˜Ñ˜Ò˜Ó˜Ô˜Õ˜Ö˜×˜Ø˜Ù +˜Ú˜Û˜Ü˜Ý˜Þ˜ß˜à˜á˜â˜ã˜ä˜å˜æ˜ç˜è˜é˜ê˜ë˜ì˜í ˜Ú˜Û˜Ü˜Ý˜Þ˜ß˜à˜á˜â˜ã˜ä˜å˜æ˜ç˜è˜é˜ê˜ë˜ì˜í +˜î˜ï˜ð˜ñ˜ò˜ó˜ô˜õ˜ö˜÷˜ø˜ù˜ú˜û˜üEEEEE ˜î˜ï˜ð˜ñ˜ò˜ó˜ô˜õ˜ö˜÷˜ø˜ù˜ú˜û˜üEEEEE +Eê@êAêBêCêDêEêFêGêHêIêJêKêLêMêNêOêPêQêR Eê@êAêBêCêDêEêFêGêHêIêJêKêLêMêNêOêPêQêR +êSêTêUêVêWêXêYêZê[ê\ê]ê^ê_ê`êaêbêcêdêeêf êSêTêUêVêWêXêYêZê[ê\ê]ê^ê_ê`êaêbêcêdêeêf +êgêhêiêjêkêlêmênêoêpêqêrêsêtêuêvêwêxêyêz êgêhêiêjêkêlêmênêoêpêqêrêsêtêuêvêwêxêyêz +ê{ê|ê}ê~ê€êê‚êƒê„ê…ê†ê‡êˆê‰êŠê‹êŒêêŽê ê{ê|ê}ê~ê€êê‚êƒê„ê…ê†ê‡êˆê‰êŠê‹êŒêêŽê +êê‘ê’ê“ê”ê•ê–ê—ê˜ê™êšê›êœêêžEEEEE êê‘ê’ê“ê”ê•ê–ê—ê˜ê™êšê›êœêêžEEEEE +EêŸê ê¡ê¢ê£ê¤EEEEEEEEEEEEE EêŸê ê¡ê¢ê£ê¤EEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ujis) FROM `‚s‚P‚P`; +‚b‚P CONVERT(`‚b‚P` using ujis) +@@ABCDEFGHIJKLMNOPQR @@ABCDEFGHIJKLMNOPQR +STUVWXYZ[\]^_`abcdef STUVWXYZ[\]^_`abcdef +ghijklmnopqrstuvwxyz ghijklmnopqrstuvwxyz +{]}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ {]}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ +‘’“”•–—˜™š›œžEEEEE ‘’“”•–—˜™š›œžEEEEE +EŸ ¡¢£¤¥¦§¨©ª«¬EEEEE EŸ ¡¢£¤¥¦§¨©ª«¬EEEEE +EEEEEE¸¹º»¼½¾¿EEEEEE EEEEEE¸¹º»¼½¾¿EEEEEE +EEÈÉÊËÌÍÎEEEEEEEEEEE EEÈÉÊËÌÍÎEEEEEEEEEEE +ÚÛÜÝÞßàáâãäåæçèEEEEE ÚÛÜÝÞßàáâãäåæçèEEEEE +EEðñòóôõö÷EEEEüEEEE@ EEðñòóôõö÷EEEEüEEEE@ +EEEEEEEEEEEEEEEE‚O‚P‚Q‚R EEEEEEEEEEEEEEEE‚O‚P‚Q‚R +‚S‚T‚U‚V‚W‚XEEEEEEE‚`‚a‚b‚c‚d‚e‚f ‚S‚T‚U‚V‚W‚XEEEEEEE‚`‚a‚b‚c‚d‚e‚f +‚g‚h‚i‚j‚k‚l‚m‚n‚o‚p‚q‚r‚s‚t‚u‚v‚w‚x‚yE ‚g‚h‚i‚j‚k‚l‚m‚n‚o‚p‚q‚r‚s‚t‚u‚v‚w‚x‚yE +EEEEE‚‚‚‚ƒ‚„‚…‚†‚‡‚ˆ‚‰‚Š‚‹‚Œ‚‚Ž‚ EEEEE‚‚‚‚ƒ‚„‚…‚†‚‡‚ˆ‚‰‚Š‚‹‚Œ‚‚Ž‚ +‚‚‘‚’‚“‚”‚•‚–‚—‚˜‚™‚šEEEEEEEEE ‚‚‘‚’‚“‚”‚•‚–‚—‚˜‚™‚šEEEEEEEEE +E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚­‚®‚¯‚°‚± E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚­‚®‚¯‚°‚± +‚²‚³‚´‚µ‚¶‚·‚¸‚¹‚º‚»‚¼‚½‚¾‚¿‚À‚Á‚‚ÂĂŠ‚²‚³‚´‚µ‚¶‚·‚¸‚¹‚º‚»‚¼‚½‚¾‚¿‚À‚Á‚‚ÂĂŠ+‚ƂǂȂɂʂ˂̂͂΂ςЂт҂ӂԂՂւׂ؂٠‚ƂǂȂɂʂ˂̂͂΂ςЂт҂ӂԂՂւׂ؂٠+‚ڂۂ܂݂ނ߂à‚á‚â‚ã‚ä‚傿‚ç‚è‚é‚ê‚ë‚ì‚í ‚Ú‚Û‚Ü‚Ý‚Þ‚ß‚à‚á‚â‚ã‚ä‚傿‚ç‚è‚é‚ê‚ë‚ì‚í +‚î‚ï‚ð‚ñEEEEEEEEEEEEEEEE ‚î‚ï‚ð‚ñEEEEEEEEEEEEEEEE +Eƒ@ƒAƒBƒCƒDƒEƒFƒGƒHƒIƒJƒKƒLƒMƒNƒOƒPƒQƒR Eƒ@ƒAƒBƒCƒDƒEƒFƒGƒHƒIƒJƒKƒLƒMƒNƒOƒPƒQƒR +ƒSƒTƒUƒVƒWƒXƒYƒZƒ[ƒ\ƒ]ƒ^ƒ_ƒ`ƒaƒbƒcƒdƒeƒf ƒSƒTƒUƒVƒWƒXƒYƒZƒ[ƒ\ƒ]ƒ^ƒ_ƒ`ƒaƒbƒcƒdƒeƒf +ƒgƒhƒiƒjƒkƒlƒmƒnƒoƒpƒqƒrƒsƒtƒuƒvƒwƒxƒyƒz ƒgƒhƒiƒjƒkƒlƒmƒnƒoƒpƒqƒrƒsƒtƒuƒvƒwƒxƒyƒz +ƒ{ƒ|ƒ}ƒ~ƒ€ƒƒ‚ƒƒƒ„ƒ…ƒ†ƒ‡ƒˆƒ‰ƒŠƒ‹ƒŒƒƒŽƒ ƒ{ƒ|ƒ}ƒ~ƒ€ƒƒ‚ƒƒƒ„ƒ…ƒ†ƒ‡ƒˆƒ‰ƒŠƒ‹ƒŒƒƒŽƒ +ƒƒ‘ƒ’ƒ“ƒ”ƒ•ƒ–EEEEEEEEEEEEE ƒƒ‘ƒ’ƒ“ƒ”ƒ•ƒ–EEEEEEEEEEEEE +EƒŸƒ ƒ¡ƒ¢ƒ£ƒ¤ƒ¥ƒ¦ƒ§ƒ¨ƒ©ƒªƒ«ƒ¬ƒ­ƒ®ƒ¯ƒ°ƒ± EƒŸƒ ƒ¡ƒ¢ƒ£ƒ¤ƒ¥ƒ¦ƒ§ƒ¨ƒ©ƒªƒ«ƒ¬ƒ­ƒ®ƒ¯ƒ°ƒ± +ƒ²ƒ³ƒ´ƒµƒ¶EEEEEEEEƒ¿ƒÀƒÁƒÂƒÃƒÄƒÅ ƒ²ƒ³ƒ´ƒµƒ¶EEEEEEEEƒ¿ƒÀƒÁƒÂƒÃƒÄƒÅ +ƒÆƒÇƒÈƒÉƒÊƒËƒÌƒÍƒÎƒÏƒÐƒÑƒÒƒÓƒÔƒÕƒÖEEE ƒÆƒÇƒÈƒÉƒÊƒËƒÌƒÍƒÎƒÏƒÐƒÑƒÒƒÓƒÔƒÕƒÖEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +E„@„A„B„C„D„E„F„G„H„I„J„K„L„M„N„O„P„Q„R E„@„A„B„C„D„E„F„G„H„I„J„K„L„M„N„O„P„Q„R +„S„T„U„V„W„X„Y„Z„[„\„]„^„_„`EEEEEE „S„T„U„V„W„X„Y„Z„[„\„]„^„_„`EEEEEE +EEEEEEEEE„p„q„r„s„t„u„v„w„x„y„z EEEEEEEEE„p„q„r„s„t„u„v„w„x„y„z +„{„|„}„~„€„„‚„ƒ„„„…„†„‡„ˆ„‰„Š„‹„Œ„„Ž„ „{„|„}„~„€„„‚„ƒ„„„…„†„‡„ˆ„‰„Š„‹„Œ„„Ž„ +„„‘EEEEEEEEEEEEEEEEEE „„‘EEEEEEEEEEEEEEEEEE +E„Ÿ„ „¡„¢„£„¤„¥„¦„§„¨„©„ª„«„¬„­„®„¯„°„± E„Ÿ„ „¡„¢„£„¤„¥„¦„§„¨„©„ª„«„¬„­„®„¯„°„± +„²„³„´„µ„¶„·„¸„¹„º„»„¼„½„¾EEEEEEE „²„³„´„µ„¶„·„¸„¹„º„»„¼„½„¾EEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EˆŸˆ ˆ¡ˆ¢ˆ£ˆ¤ˆ¥ˆ¦ˆ§ˆ¨ˆ©ˆªˆ«ˆ¬ˆ­ˆ®ˆ¯ˆ°ˆ± EˆŸˆ ˆ¡ˆ¢ˆ£ˆ¤ˆ¥ˆ¦ˆ§ˆ¨ˆ©ˆªˆ«ˆ¬ˆ­ˆ®ˆ¯ˆ°ˆ± +ˆ²ˆ³ˆ´ˆµˆ¶ˆ·ˆ¸ˆ¹ˆºˆ»ˆ¼ˆ½ˆ¾ˆ¿ˆÀˆÁˆÂˆÃˆÄˆÅ ˆ²ˆ³ˆ´ˆµˆ¶ˆ·ˆ¸ˆ¹ˆºˆ»ˆ¼ˆ½ˆ¾ˆ¿ˆÀˆÁˆÂˆÃˆÄˆÅ +ˆÆˆÇˆÈˆÉˆÊˆËˆÌˆÍˆÎˆÏˆÐˆÑˆÒˆÓˆÔˆÕˆÖˆ×ˆØˆÙ ˆÆˆÇˆÈˆÉˆÊˆËˆÌˆÍˆÎˆÏˆÐˆÑˆÒˆÓˆÔˆÕˆÖˆ×ˆØˆÙ +ˆÚˆÛˆÜˆÝˆÞˆßˆàˆáˆâˆãˆäˆåˆæˆçˆèˆéˆêˆëˆìˆí ˆÚˆÛˆÜˆÝˆÞˆßˆàˆáˆâˆãˆäˆåˆæˆçˆèˆéˆêˆëˆìˆí +ˆîˆïˆðˆñˆòˆóˆôˆõˆöˆ÷ˆøˆùˆúˆûˆüEEEEE ˆîˆïˆðˆñˆòˆóˆôˆõˆöˆ÷ˆøˆùˆúˆûˆüEEEEE +E˜@˜A˜B˜C˜D˜E˜F˜G˜H˜I˜J˜K˜L˜M˜N˜O˜P˜Q˜R E˜@˜A˜B˜C˜D˜E˜F˜G˜H˜I˜J˜K˜L˜M˜N˜O˜P˜Q˜R +˜S˜T˜U˜V˜W˜X˜Y˜Z˜[˜\˜]˜^˜_˜`˜a˜b˜c˜d˜e˜f ˜S˜T˜U˜V˜W˜X˜Y˜Z˜[˜\˜]˜^˜_˜`˜a˜b˜c˜d˜e˜f +˜g˜h˜i˜j˜k˜l˜m˜n˜o˜p˜q˜rEEEEEEEE ˜g˜h˜i˜j˜k˜l˜m˜n˜o˜p˜q˜rEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +E˜Ÿ˜ ˜¡˜¢˜£˜¤˜¥˜¦˜§˜¨˜©˜ª˜«˜¬˜­˜®˜¯˜°˜± E˜Ÿ˜ ˜¡˜¢˜£˜¤˜¥˜¦˜§˜¨˜©˜ª˜«˜¬˜­˜®˜¯˜°˜± +˜²˜³˜´˜µ˜¶˜·˜¸˜¹˜º˜»˜¼˜½˜¾˜¿˜À˜Á˜Â˜Ã˜Ä˜Å ˜²˜³˜´˜µ˜¶˜·˜¸˜¹˜º˜»˜¼˜½˜¾˜¿˜À˜Á˜Â˜Ã˜Ä˜Å +˜Æ˜Ç˜È˜É˜Ê˜Ë˜Ì˜Í˜Î˜Ï˜Ð˜Ñ˜Ò˜Ó˜Ô˜Õ˜Ö˜×˜Ø˜Ù ˜Æ˜Ç˜È˜É˜Ê˜Ë˜Ì˜Í˜Î˜Ï˜Ð˜Ñ˜Ò˜Ó˜Ô˜Õ˜Ö˜×˜Ø˜Ù +˜Ú˜Û˜Ü˜Ý˜Þ˜ß˜à˜á˜â˜ã˜ä˜å˜æ˜ç˜è˜é˜ê˜ë˜ì˜í ˜Ú˜Û˜Ü˜Ý˜Þ˜ß˜à˜á˜â˜ã˜ä˜å˜æ˜ç˜è˜é˜ê˜ë˜ì˜í +˜î˜ï˜ð˜ñ˜ò˜ó˜ô˜õ˜ö˜÷˜ø˜ù˜ú˜û˜üEEEEE ˜î˜ï˜ð˜ñ˜ò˜ó˜ô˜õ˜ö˜÷˜ø˜ù˜ú˜û˜üEEEEE +Eê@êAêBêCêDêEêFêGêHêIêJêKêLêMêNêOêPêQêR Eê@êAêBêCêDêEêFêGêHêIêJêKêLêMêNêOêPêQêR +êSêTêUêVêWêXêYêZê[ê\ê]ê^ê_ê`êaêbêcêdêeêf êSêTêUêVêWêXêYêZê[ê\ê]ê^ê_ê`êaêbêcêdêeêf +êgêhêiêjêkêlêmênêoêpêqêrêsêtêuêvêwêxêyêz êgêhêiêjêkêlêmênêoêpêqêrêsêtêuêvêwêxêyêz +ê{ê|ê}ê~ê€êê‚êƒê„ê…ê†ê‡êˆê‰êŠê‹êŒêêŽê ê{ê|ê}ê~ê€êê‚êƒê„ê…ê†ê‡êˆê‰êŠê‹êŒêêŽê +êê‘ê’ê“ê”ê•ê–ê—ê˜ê™êšê›êœêêžEEEEE êê‘ê’ê“ê”ê•ê–ê—ê˜ê™êšê›êœêêžEEEEE +EêŸê ê¡ê¢ê£ê¤EEEEEEEEEEEEE EêŸê ê¡ê¢ê£ê¤EEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEE +SELECT `‚b‚P`, CONVERT(`‚b‚P` using utf8) FROM `‚s‚P‚Q`; +‚b‚P CONVERT(`‚b‚P` using utf8) +ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ucs2) FROM `‚s‚P‚Q`; +‚b‚P CONVERT(`‚b‚P` using ucs2) +ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ujis) FROM `‚s‚P‚Q`; +‚b‚P CONVERT(`‚b‚P` using ujis) +ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ +drop table `‚s‚P`; +drop table `‚s‚Q`; +drop table `‚s‚R`; +drop table `‚s‚S`; +drop table `‚s‚T`; +drop table `‚s‚U`; +drop table `‚s‚V`; +drop table `‚s‚W`; +drop table `‚s‚X`; +drop table `‚s‚P‚O`; +drop table `‚s‚P‚P`; +drop table `‚s‚P‚Q`; diff --git a/mysql-test/suite/jp/r/jp_convert_ucs2.result b/mysql-test/suite/jp/r/jp_convert_ucs2.result new file mode 100755 index 00000000000..92c2032993e --- /dev/null +++ b/mysql-test/suite/jp/r/jp_convert_ucs2.result @@ -0,0 +1,427 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; +CREATE TABLE `£Ô£±` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +INSERT INTO `£Ô£±` VALUES +('PQRSTUVWXYZ[\\]^_') +,(' Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯') +,('Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿') +,('ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ') +,('ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß'); +INSERT INTO `£Ô£²` VALUES +('¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç') +,('¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û') +,('¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³') +,('¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³') +,('¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³') +,('¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³') +,('¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³'); +INSERT INTO `£Ô£³` VALUES +('¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦') +,('°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç') +,('°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û') +,('°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï') +,('¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³') +,('í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ') +,('íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ'); +INSERT INTO `£Ô£´` VALUES +('PQRSTUVWXYZ[\\]^_') +,(' Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯') +,('Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿') +,('ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ') +,('ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß'); +INSERT INTO `£Ô£µ` VALUES +('¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç') +,('¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û') +,('¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³') +,('¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³') +,('¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³') +,('¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³') +,('¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³'); +INSERT INTO `£Ô£¶` VALUES +('¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦') +,('°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç') +,('°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û') +,('°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï') +,('¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³') +,('í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ') +,('íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ'); +INSERT INTO `£Ô£·` VALUES +('PQRSTUVWXYZ[\\]^_') +,(' Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯') +,('Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿') +,('ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ') +,('ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß'); +INSERT INTO `£Ô£¸` VALUES +('¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç') +,('¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û') +,('¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³') +,('¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³') +,('¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³') +,('¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³') +,('¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³'); +INSERT INTO `£Ô£¹` VALUES +('¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦') +,('°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç') +,('°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û') +,('°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï') +,('¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³') +,('í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ') +,('íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ'); +INSERT INTO `£Ô£±£°` VALUES +('PQRSTUVWXYZ[\\]^_') +,(' Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯') +,('Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿') +,('ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ') +,('ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß'); +INSERT INTO `£Ô£±£±` VALUES +('¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç') +,('¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û') +,('¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³') +,('¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³') +,('¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³') +,('¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³') +,('¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³'); +INSERT INTO `£Ô£±£²` VALUES +('¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦') +,('°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç') +,('°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û') +,('°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï') +,('¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³') +,('í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ') +,('íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ'); +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£±`; +£Ã£± CONVERT(`£Ã£±` using utf8) + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯ Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯ +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[\]^_ +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ +ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£±`; +£Ã£± CONVERT(`£Ã£±` using ucs2) + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯ Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯ +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[\]^_ +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ +ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£±`; +£Ã£± CONVERT(`£Ã£±` using sjis) + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯ Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯ +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[\]^_ +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ +ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£²`; +£Ã£± CONVERT(`£Ã£±` using utf8) +¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û ¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ ¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ +¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³ ¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³ ¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³ +¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³ ¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³ +¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³ ¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³ +¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿\¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç ¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿\¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£²`; +£Ã£± CONVERT(`£Ã£±` using ucs2) +¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û ¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ ¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ +¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³ ¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³ ¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³ +¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³ ¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³ +¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³ ¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³ +¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿\¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç ¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿\¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£²`; +£Ã£± CONVERT(`£Ã£±` using sjis) +¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û ¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ ¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ +¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³ ¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³ ¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³ +¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³ ¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³ +¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³ ¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³ +¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿\¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç ¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿\¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£³`; +£Ã£± CONVERT(`£Ã£±` using utf8) +¡¦¢µ¢¶~¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ ¡¦¢µ¢¶~¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ +¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³ ¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç °´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û °È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï °Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£³`; +£Ã£± CONVERT(`£Ã£±` using ucs2) +¡¦¢µ¢¶~¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ ¡¦¢µ¢¶~¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ +¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³ ¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç °´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û °È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï °Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£³`; +£Ã£± CONVERT(`£Ã£±` using sjis) +¡¦¢µ¢¶~¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ ¡¦??~??¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦???¡¦¡¦¡¦ +¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³ ¡¦??????????????????? +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç ???????????????????? +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û ???????????????????? +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï ???????????????????? +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ ???????????????????? +íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ ???????????????????? +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£´`; +£Ã£± CONVERT(`£Ã£±` using utf8) + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯ Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯ +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[\]^_ +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ +ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£´`; +£Ã£± CONVERT(`£Ã£±` using ucs2) + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯ Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯ +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[\]^_ +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ +ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£´`; +£Ã£± CONVERT(`£Ã£±` using sjis) + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯ Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯ +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[\]^_ +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ +ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£µ`; +£Ã£± CONVERT(`£Ã£±` using utf8) +¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û ¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ ¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ +¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³ ¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³ ¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³ +¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³ ¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³ +¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³ ¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³ +¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿\¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç ¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿\¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£µ`; +£Ã£± CONVERT(`£Ã£±` using ucs2) +¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û ¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ ¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ +¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³ ¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³ ¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³ +¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³ ¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³ +¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³ ¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³ +¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿\¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç ¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿\¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£µ`; +£Ã£± CONVERT(`£Ã£±` using sjis) +¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û ¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ ¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ +¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³ ¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³ ¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³ +¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³ ¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³ +¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³ ¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³ +¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿\¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç ¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿\¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£¶`; +£Ã£± CONVERT(`£Ã£±` using utf8) +¡¦¢µ¢¶~¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ ¡¦¢µ¢¶~¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ +¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³ ¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç °´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û °È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï °Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£¶`; +£Ã£± CONVERT(`£Ã£±` using ucs2) +¡¦¢µ¢¶~¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ ¡¦¢µ¢¶~¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ +¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³ ¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç °´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û °È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï °Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£¶`; +£Ã£± CONVERT(`£Ã£±` using sjis) +¡¦¢µ¢¶~¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ ¡¦??~??¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦???¡¦¡¦¡¦ +¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³ ¡¦??????????????????? +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç ???????????????????? +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û ???????????????????? +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï ???????????????????? +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ ???????????????????? +íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ ???????????????????? +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£·`; +£Ã£± CONVERT(`£Ã£±` using utf8) +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[\]^_ + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯ Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯ +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ +ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£·`; +£Ã£± CONVERT(`£Ã£±` using ucs2) +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[\]^_ + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯ Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯ +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ +ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£·`; +£Ã£± CONVERT(`£Ã£±` using sjis) +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[\]^_ + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯ Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯ +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ +ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£¸`; +£Ã£± CONVERT(`£Ã£±` using utf8) +¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿\¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç ¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿\¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç +¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û ¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ ¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ +¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³ ¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³ ¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³ +¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³ ¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³ +¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³ ¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³ +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£¸`; +£Ã£± CONVERT(`£Ã£±` using ucs2) +¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿\¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç ¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿\¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç +¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û ¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ ¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ +¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³ ¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³ ¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³ +¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³ ¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³ +¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³ ¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³ +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£¸`; +£Ã£± CONVERT(`£Ã£±` using sjis) +¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿\¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç ¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿\¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç +¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û ¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ ¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ +¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³ ¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³ ¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³ +¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³ ¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³ +¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³ ¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³ +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£¹`; +£Ã£± CONVERT(`£Ã£±` using utf8) +¡¦¢µ¢¶~¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ ¡¦¢µ¢¶~¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç °´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û °È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï °Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï +¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³ ¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³ +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£¹`; +£Ã£± CONVERT(`£Ã£±` using ucs2) +¡¦¢µ¢¶~¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ ¡¦¢µ¢¶~¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç °´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û °È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï °Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï +¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³ ¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³ +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£¹`; +£Ã£± CONVERT(`£Ã£±` using sjis) +¡¦¢µ¢¶~¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ ¡¦??~??¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦???¡¦¡¦¡¦ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç ???????????????????? +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û ???????????????????? +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï ???????????????????? +¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³ ¡¦??????????????????? +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ ???????????????????? +íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ ???????????????????? +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£±£°`; +£Ã£± CONVERT(`£Ã£±` using utf8) +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[\]^_ + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯ Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯ +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ +ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£±£°`; +£Ã£± CONVERT(`£Ã£±` using ucs2) +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[\]^_ + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯ Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯ +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ +ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£±£°`; +£Ã£± CONVERT(`£Ã£±` using sjis) +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[\]^_ + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯ Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯ +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ +ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£±£±`; +£Ã£± CONVERT(`£Ã£±` using utf8) +¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿\¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç ¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿\¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç +¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û ¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ ¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ +¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³ ¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³ ¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³ +¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³ ¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³ +¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³ ¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³ +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£±£±`; +£Ã£± CONVERT(`£Ã£±` using ucs2) +¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿\¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç ¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿\¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç +¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û ¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ ¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ +¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³ ¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³ ¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³ +¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³ ¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³ +¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³ ¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³ +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£±£±`; +£Ã£± CONVERT(`£Ã£±` using sjis) +¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿\¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç ¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿\¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç +¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û ¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ ¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ +¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³ ¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³ ¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³ +¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³ ¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³ +¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³ ¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³ +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£±£²`; +£Ã£± CONVERT(`£Ã£±` using utf8) +¡¦¢µ¢¶~¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ ¡¦¢µ¢¶~¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç °´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û °È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï °Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï +¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³ ¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³ +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£±£²`; +£Ã£± CONVERT(`£Ã£±` using ucs2) +¡¦¢µ¢¶~¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ ¡¦¢µ¢¶~¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç °´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û °È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï °Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï +¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³ ¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³ +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£±£²`; +£Ã£± CONVERT(`£Ã£±` using sjis) +¡¦¢µ¢¶~¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ ¡¦??~??¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦???¡¦¡¦¡¦ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç ???????????????????? +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û ???????????????????? +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï ???????????????????? +¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³ ¡¦??????????????????? +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ ???????????????????? +íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ ???????????????????? +drop table `£Ô£±`; +drop table `£Ô£²`; +drop table `£Ô£³`; +drop table `£Ô£´`; +drop table `£Ô£µ`; +drop table `£Ô£¶`; +drop table `£Ô£·`; +drop table `£Ô£¸`; +drop table `£Ô£¹`; +drop table `£Ô£±£°`; +drop table `£Ô£±£±`; +drop table `£Ô£±£²`; diff --git a/mysql-test/suite/jp/r/jp_convert_ujis.result b/mysql-test/suite/jp/r/jp_convert_ujis.result new file mode 100755 index 00000000000..55f2ab0aea3 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_convert_ujis.result @@ -0,0 +1,1514 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +SET NAMES ujis; +SET character_set_database = ujis; +CREATE TABLE `£Ô£±` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_ujis.dat' INTO TABLE `£Ô£±`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_ujis.dat' INTO TABLE `£Ô£²`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_ujis.dat' INTO TABLE `£Ô£³`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_ujis.dat' INTO TABLE `£Ô£´`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_ujis.dat' INTO TABLE `£Ô£µ`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_ujis.dat' INTO TABLE `£Ô£¶`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_ujis.dat' INTO TABLE `£Ô£·`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_ujis.dat' INTO TABLE `£Ô£¸`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_ujis.dat' INTO TABLE `£Ô£¹`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_ujis.dat' INTO TABLE `£Ô£±£°`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_ujis.dat' INTO TABLE `£Ô£±£±`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_ujis.dat' INTO TABLE `£Ô£±£²`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£±`; +£Ã£± CONVERT(`£Ã£±` using utf8) + !"#$%&'()*+,-./ !"#$%&'()*+,-./ + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯ Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯ +0123456789:;<=>? 0123456789:;<=>? +@ABCDEFGHIJKLMNO @ABCDEFGHIJKLMNO +abcdefghijklmno abcdefghijklmno +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[\]^_ +pqrstuvwxyz{|}~ pqrstuvwxyz{|}~ +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ +ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£±`; +£Ã£± CONVERT(`£Ã£±` using ucs2) + !"#$%&'()*+,-./ !"#$%&'()*+,-./ + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯ Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯ +0123456789:;<=>? 0123456789:;<=>? +@ABCDEFGHIJKLMNO @ABCDEFGHIJKLMNO +abcdefghijklmno abcdefghijklmno +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[\]^_ +pqrstuvwxyz{|}~ pqrstuvwxyz{|}~ +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ +ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£±`; +£Ã£± CONVERT(`£Ã£±` using sjis) + !"#$%&'()*+,-./ !"#$%&'()*+,-./ + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯ Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯ +0123456789:;<=>? 0123456789:;<=>? +@ABCDEFGHIJKLMNO @ABCDEFGHIJKLMNO +abcdefghijklmno abcdefghijklmno +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[\]^_ +pqrstuvwxyz{|}~ pqrstuvwxyz{|}~ +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ +ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£²`; +£Ã£± CONVERT(`£Ã£±` using utf8) +¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡­¡®¡¯¡°¡±¡²¡³ ¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡­¡®¡¯¡°¡±¡²¡³ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦£°£±£²£³ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦£°£±£²£³ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Ñ§Ò§Ó§Ô§Õ§Ö§×§Ø§Ù§Ú§Û ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Ñ§Ò§Ó§Ô§Õ§Ö§×§Ø§Ù§Ú§Û +¡¦¡¦¡¦¡¦¡¦¡¦¢º¢»¢¼¢½¢¾¢¿¢À¢Á¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¢º¢»¢¼¢½¢¾¢¿¢À¢Á¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦£á£â£ã£ä£å£æ£ç£è£é£ê£ë£ì£í£î£ï ¡¦¡¦¡¦¡¦¡¦£á£â£ã£ä£å£æ£ç£è£é£ê£ë£ì£í£î£ï +¡¦¡¦¢Ê¢Ë¢Ì¢Í¢Î¢Ï¢Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¢Ê¢Ë¢Ì¢Í¢Î¢Ï¢Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¢ò¢ó¢ô¢õ¢ö¢÷¢ø¢ù¡¦¡¦¡¦¡¦¢þ¡¦¡¦¡¦¡¦¡¡ ¡¦¡¦¢ò¢ó¢ô¢õ¢ö¢÷¢ø¢ù¡¦¡¦¡¦¡¦¢þ¡¦¡¦¡¦¡¦¡¡ +¡¦¢¡¢¢¢£¢¤¢¥¢¦¢§¢¨¢©¢ª¢«¢¬¢­¢®¡¦¡¦¡¦¡¦¡¦ ¡¦¢¡¢¢¢£¢¤¢¥¢¦¢§¢¨¢©¢ª¢«¢¬¢­¢®¡¦¡¦¡¦¡¦¡¦ +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ ¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ +¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³ ¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³ +¡¦¦¡¦¢¦£¦¤¦¥¦¦¦§¦¨¦©¦ª¦«¦¬¦­¦®¦¯¦°¦±¦²¦³ ¡¦¦¡¦¢¦£¦¤¦¥¦¦¦§¦¨¦©¦ª¦«¦¬¦­¦®¦¯¦°¦±¦²¦³ +¡¦§¡§¢§£§¤§¥§¦§§§¨§©§ª§«§¬§­§®§¯§°§±§²§³ ¡¦§¡§¢§£§¤§¥§¦§§§¨§©§ª§«§¬§­§®§¯§°§±§²§³ +¡¦¨¡¨¢¨£¨¤¨¥¨¦¨§¨¨¨©¨ª¨«¨¬¨­¨®¨¯¨°¨±¨²¨³ ¡¦¨¡¨¢¨£¨¤¨¥¨¦¨§¨¨¨©¨ª¨«¨¬¨­¨®¨¯¨°¨±¨²¨³ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³ ¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³ +¡¦Ï¡Ï¢Ï£Ï¤Ï¥Ï¦Ï§Ï¨Ï©ÏªÏ«Ï¬Ï­Ï®Ï¯Ï°Ï±Ï²Ï³ ¡¦Ï¡Ï¢Ï£Ï¤Ï¥Ï¦Ï§Ï¨Ï©ÏªÏ«Ï¬Ï­Ï®Ï¯Ï°Ï±Ï²Ï³ +¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³ ¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³ +¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³ ¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³ +¡¦ô¡ô¢ô£ô¤ô¥ô¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦ô¡ô¢ô£ô¤ô¥ô¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç ¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿\¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç +¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û ¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û +¡Ü¡¾¡Þ¡ß¡à¡á¡â¡ã¡ä¡å¡æ¡ç¡è¡é¡ê¡ë¡ì¡í¡î¡ï ¡Ü¡¾¡Þ¡ß¡à¡á¡â¡ã¡ä¡å¡æ¡ç¡è¡é¡ê¡ë¡ì¡í¡î¡ï +¡ð¡ñ¡ò¡ó¡ô¡õ¡ö¡÷¡ø¡ù¡ú¡û¡ü¡ý¡þ¡¦¡¦¡¦¡¦¡¦ ¡ð¡ñ¡ò¡ó¡ô¡õ¡ö¡÷¡ø¡ù¡ú¡û¡ü¡ý¡þ¡¦¡¦¡¦¡¦¡¦ +¢Ü¢Ý¢Þ¢ß¢à¢á¢â¢ã¢ä¢å¢æ¢ç¢è¢é¢ê¡¦¡¦¡¦¡¦¡¦ ¢Ü¢Ý¢Þ¢ß¢à¢á¢â¢ã¢ä¢å¢æ¢ç¢è¢é¢ê¡¦¡¦¡¦¡¦¡¦ +£´£µ£¶£·£¸£¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦£Á£Â£Ã£Ä£Å£Æ£Ç £´£µ£¶£·£¸£¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦£Á£Â£Ã£Ä£Å£Æ£Ç +£È£É£Ê£Ë£Ì£Í£Î£Ï£Ð£Ñ£Ò£Ó£Ô£Õ£Ö£×£Ø£Ù£Ú¡¦ £È£É£Ê£Ë£Ì£Í£Î£Ï£Ð£Ñ£Ò£Ó£Ô£Õ£Ö£×£Ø£Ù£Ú¡¦ +£ð£ñ£ò£ó£ô£õ£ö£÷£ø£ù£ú¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ £ð£ñ£ò£ó£ô£õ£ö£÷£ø£ù£ú¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¤´¤µ¤¶¤·¤¸¤¹¤º¤»¤¼¤½¤¾¤¿¤À¤Á¤Â¤Ã¤Ä¤Å¤Æ¤Ç ¤´¤µ¤¶¤·¤¸¤¹¤º¤»¤¼¤½¤¾¤¿¤À¤Á¤Â¤Ã¤Ä¤Å¤Æ¤Ç +¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û ¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û +¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï ¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï +¤ð¤ñ¤ò¤ó¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¤ð¤ñ¤ò¤ó¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¥´¥µ¥¶¥·¥¸¥¹¥º¥»¥¼¥½¥¾¥¿¥À¥Á¥Â¥Ã¥Ä¥Å¥Æ¥Ç ¥´¥µ¥¶¥·¥¸¥¹¥º¥»¥¼¥½¥¾¥¿¥À¥Á¥Â¥Ã¥Ä¥Å¥Æ¥Ç +¥È¥É¥Ê¥Ë¥Ì¥Í¥Î¥Ï¥Ð¥Ñ¥Ò¥Ó¥Ô¥Õ¥Ö¥×¥Ø¥Ù¥Ú¥Û ¥È¥É¥Ê¥Ë¥Ì¥Í¥Î¥Ï¥Ð¥Ñ¥Ò¥Ó¥Ô¥Õ¥Ö¥×¥Ø¥Ù¥Ú¥Û +¥Ü¥Ý¥Þ¥ß¥à¥á¥â¥ã¥ä¥å¥æ¥ç¥è¥é¥ê¥ë¥ì¥í¥î¥ï ¥Ü¥Ý¥Þ¥ß¥à¥á¥â¥ã¥ä¥å¥æ¥ç¥è¥é¥ê¥ë¥ì¥í¥î¥ï +¥ð¥ñ¥ò¥ó¥ô¥õ¥ö¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¥ð¥ñ¥ò¥ó¥ô¥õ¥ö¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¦´¦µ¦¶¦·¦¸¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¦Á¦Â¦Ã¦Ä¦Å¦Æ¦Ç ¦´¦µ¦¶¦·¦¸¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¦Á¦Â¦Ã¦Ä¦Å¦Æ¦Ç +¦È¦É¦Ê¦Ë¦Ì¦Í¦Î¦Ï¦Ð¦Ñ¦Ò¦Ó¦Ô¦Õ¦Ö¦×¦Ø¡¦¡¦¡¦ ¦È¦É¦Ê¦Ë¦Ì¦Í¦Î¦Ï¦Ð¦Ñ¦Ò¦Ó¦Ô¦Õ¦Ö¦×¦Ø¡¦¡¦¡¦ +§´§µ§¶§·§¸§¹§º§»§¼§½§¾§¿§À§Á¡¦¡¦¡¦¡¦¡¦¡¦ §´§µ§¶§·§¸§¹§º§»§¼§½§¾§¿§À§Á¡¦¡¦¡¦¡¦¡¦¡¦ +§Ü§Ý§Þ§ß§à§á§â§ã§ä§å§æ§ç§è§é§ê§ë§ì§í§î§ï §Ü§Ý§Þ§ß§à§á§â§ã§ä§å§æ§ç§è§é§ê§ë§ì§í§î§ï +§ð§ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ §ð§ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¨´¨µ¨¶¨·¨¸¨¹¨º¨»¨¼¨½¨¾¨¿¨À¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¨´¨µ¨¶¨·¨¸¨¹¨º¨»¨¼¨½¨¾¨¿¨À¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç °´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û °È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï °Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï +°ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ °ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ +ϴϵ϶ϷϸϹϺϻϼϽϾϿÏÀÏÁÏÂÏÃÏÄÏÅÏÆÏÇ Ï´ÏµÏ¶Ï·Ï¸Ï¹ÏºÏ»Ï¼Ï½Ï¾Ï¿ÏÀÏÁÏÂÏÃÏÄÏÅÏÆÏÇ +ÏÈÏÉÏÊÏËÏÌÏÍÏÎÏÏÏÐÏÑÏÒÏÓ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ÏÈÏÉÏÊÏËÏÌÏÍÏÎÏÏÏÐÏÑÏÒÏÓ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +дежзийклмнопÐÀÐÁÐÂÐÃÐÄÐÅÐÆÐÇ Ð´ÐµÐ¶Ð·Ð¸Ð¹ÐºÐ»Ð¼Ð½Ð¾Ð¿ÐÀÐÁÐÂÐÃÐÄÐÅÐÆÐÇ +ÐÈÐÉÐÊÐËÐÌÐÍÐÎÐÏÐÐÐÑÐÒÐÓÐÔÐÕÐÖÐ×ÐØÐÙÐÚÐÛ ÐÈÐÉÐÊÐËÐÌÐÍÐÎÐÏÐÐÐÑÐÒÐÓÐÔÐÕÐÖÐ×ÐØÐÙÐÚÐÛ +ÐÜÐÝÐÞÐßÐàÐáÐâÐãÐäÐåÐæÐçÐèÐéÐêÐëÐìÐíÐîÐï ÐÜÐÝÐÞÐßÐàÐáÐâÐãÐäÐåÐæÐçÐèÐéÐêÐëÐìÐíÐîÐï +ÐðÐñÐòÐóÐôÐõÐöÐ÷ÐøÐùÐúÐûÐüÐýÐþ¡¦¡¦¡¦¡¦¡¦ ÐðÐñÐòÐóÐôÐõÐöÐ÷ÐøÐùÐúÐûÐüÐýÐþ¡¦¡¦¡¦¡¦¡¦ +ó´óµó¶ó·ó¸ó¹óºó»ó¼ó½ó¾ó¿óÀóÁóÂóÃóÄóÅóÆóÇ ó´óµó¶ó·ó¸ó¹óºó»ó¼ó½ó¾ó¿óÀóÁóÂóÃóÄóÅóÆóÇ +óÈóÉóÊóËóÌóÍóÎóÏóÐóÑóÒóÓóÔóÕóÖó×óØóÙóÚóÛ óÈóÉóÊóËóÌóÍóÎóÏóÐóÑóÒóÓóÔóÕóÖó×óØóÙóÚóÛ +óÜóÝóÞóßóàóáóâóãóäóåóæóçóèóéóêóëóìóíóîóï óÜóÝóÞóßóàóáóâóãóäóåóæóçóèóéóêóëóìóíóîóï +óðóñóòóóóôóõóöó÷óøóùóúóûóüóýóþ¡¦¡¦¡¦¡¦¡¦ óðóñóòóóóôóõóöó÷óøóùóúóûóüóýóþ¡¦¡¦¡¦¡¦¡¦ +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£²`; +£Ã£± CONVERT(`£Ã£±` using ucs2) +¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡­¡®¡¯¡°¡±¡²¡³ ¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡­¡®¡¯¡°¡±¡²¡³ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦£°£±£²£³ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦£°£±£²£³ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Ñ§Ò§Ó§Ô§Õ§Ö§×§Ø§Ù§Ú§Û ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Ñ§Ò§Ó§Ô§Õ§Ö§×§Ø§Ù§Ú§Û +¡¦¡¦¡¦¡¦¡¦¡¦¢º¢»¢¼¢½¢¾¢¿¢À¢Á¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¢º¢»¢¼¢½¢¾¢¿¢À¢Á¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦£á£â£ã£ä£å£æ£ç£è£é£ê£ë£ì£í£î£ï ¡¦¡¦¡¦¡¦¡¦£á£â£ã£ä£å£æ£ç£è£é£ê£ë£ì£í£î£ï +¡¦¡¦¢Ê¢Ë¢Ì¢Í¢Î¢Ï¢Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¢Ê¢Ë¢Ì¢Í¢Î¢Ï¢Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¢ò¢ó¢ô¢õ¢ö¢÷¢ø¢ù¡¦¡¦¡¦¡¦¢þ¡¦¡¦¡¦¡¦¡¡ ¡¦¡¦¢ò¢ó¢ô¢õ¢ö¢÷¢ø¢ù¡¦¡¦¡¦¡¦¢þ¡¦¡¦¡¦¡¦¡¡ +¡¦¢¡¢¢¢£¢¤¢¥¢¦¢§¢¨¢©¢ª¢«¢¬¢­¢®¡¦¡¦¡¦¡¦¡¦ ¡¦¢¡¢¢¢£¢¤¢¥¢¦¢§¢¨¢©¢ª¢«¢¬¢­¢®¡¦¡¦¡¦¡¦¡¦ +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ ¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ +¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³ ¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³ +¡¦¦¡¦¢¦£¦¤¦¥¦¦¦§¦¨¦©¦ª¦«¦¬¦­¦®¦¯¦°¦±¦²¦³ ¡¦¦¡¦¢¦£¦¤¦¥¦¦¦§¦¨¦©¦ª¦«¦¬¦­¦®¦¯¦°¦±¦²¦³ +¡¦§¡§¢§£§¤§¥§¦§§§¨§©§ª§«§¬§­§®§¯§°§±§²§³ ¡¦§¡§¢§£§¤§¥§¦§§§¨§©§ª§«§¬§­§®§¯§°§±§²§³ +¡¦¨¡¨¢¨£¨¤¨¥¨¦¨§¨¨¨©¨ª¨«¨¬¨­¨®¨¯¨°¨±¨²¨³ ¡¦¨¡¨¢¨£¨¤¨¥¨¦¨§¨¨¨©¨ª¨«¨¬¨­¨®¨¯¨°¨±¨²¨³ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³ ¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³ +¡¦Ï¡Ï¢Ï£Ï¤Ï¥Ï¦Ï§Ï¨Ï©ÏªÏ«Ï¬Ï­Ï®Ï¯Ï°Ï±Ï²Ï³ ¡¦Ï¡Ï¢Ï£Ï¤Ï¥Ï¦Ï§Ï¨Ï©ÏªÏ«Ï¬Ï­Ï®Ï¯Ï°Ï±Ï²Ï³ +¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³ ¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³ +¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³ ¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³ +¡¦ô¡ô¢ô£ô¤ô¥ô¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦ô¡ô¢ô£ô¤ô¥ô¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç ¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿\¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç +¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û ¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û +¡Ü¡¾¡Þ¡ß¡à¡á¡â¡ã¡ä¡å¡æ¡ç¡è¡é¡ê¡ë¡ì¡í¡î¡ï ¡Ü¡¾¡Þ¡ß¡à¡á¡â¡ã¡ä¡å¡æ¡ç¡è¡é¡ê¡ë¡ì¡í¡î¡ï +¡ð¡ñ¡ò¡ó¡ô¡õ¡ö¡÷¡ø¡ù¡ú¡û¡ü¡ý¡þ¡¦¡¦¡¦¡¦¡¦ ¡ð¡ñ¡ò¡ó¡ô¡õ¡ö¡÷¡ø¡ù¡ú¡û¡ü¡ý¡þ¡¦¡¦¡¦¡¦¡¦ +¢Ü¢Ý¢Þ¢ß¢à¢á¢â¢ã¢ä¢å¢æ¢ç¢è¢é¢ê¡¦¡¦¡¦¡¦¡¦ ¢Ü¢Ý¢Þ¢ß¢à¢á¢â¢ã¢ä¢å¢æ¢ç¢è¢é¢ê¡¦¡¦¡¦¡¦¡¦ +£´£µ£¶£·£¸£¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦£Á£Â£Ã£Ä£Å£Æ£Ç £´£µ£¶£·£¸£¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦£Á£Â£Ã£Ä£Å£Æ£Ç +£È£É£Ê£Ë£Ì£Í£Î£Ï£Ð£Ñ£Ò£Ó£Ô£Õ£Ö£×£Ø£Ù£Ú¡¦ £È£É£Ê£Ë£Ì£Í£Î£Ï£Ð£Ñ£Ò£Ó£Ô£Õ£Ö£×£Ø£Ù£Ú¡¦ +£ð£ñ£ò£ó£ô£õ£ö£÷£ø£ù£ú¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ £ð£ñ£ò£ó£ô£õ£ö£÷£ø£ù£ú¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¤´¤µ¤¶¤·¤¸¤¹¤º¤»¤¼¤½¤¾¤¿¤À¤Á¤Â¤Ã¤Ä¤Å¤Æ¤Ç ¤´¤µ¤¶¤·¤¸¤¹¤º¤»¤¼¤½¤¾¤¿¤À¤Á¤Â¤Ã¤Ä¤Å¤Æ¤Ç +¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û ¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û +¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï ¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï +¤ð¤ñ¤ò¤ó¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¤ð¤ñ¤ò¤ó¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¥´¥µ¥¶¥·¥¸¥¹¥º¥»¥¼¥½¥¾¥¿¥À¥Á¥Â¥Ã¥Ä¥Å¥Æ¥Ç ¥´¥µ¥¶¥·¥¸¥¹¥º¥»¥¼¥½¥¾¥¿¥À¥Á¥Â¥Ã¥Ä¥Å¥Æ¥Ç +¥È¥É¥Ê¥Ë¥Ì¥Í¥Î¥Ï¥Ð¥Ñ¥Ò¥Ó¥Ô¥Õ¥Ö¥×¥Ø¥Ù¥Ú¥Û ¥È¥É¥Ê¥Ë¥Ì¥Í¥Î¥Ï¥Ð¥Ñ¥Ò¥Ó¥Ô¥Õ¥Ö¥×¥Ø¥Ù¥Ú¥Û +¥Ü¥Ý¥Þ¥ß¥à¥á¥â¥ã¥ä¥å¥æ¥ç¥è¥é¥ê¥ë¥ì¥í¥î¥ï ¥Ü¥Ý¥Þ¥ß¥à¥á¥â¥ã¥ä¥å¥æ¥ç¥è¥é¥ê¥ë¥ì¥í¥î¥ï +¥ð¥ñ¥ò¥ó¥ô¥õ¥ö¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¥ð¥ñ¥ò¥ó¥ô¥õ¥ö¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¦´¦µ¦¶¦·¦¸¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¦Á¦Â¦Ã¦Ä¦Å¦Æ¦Ç ¦´¦µ¦¶¦·¦¸¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¦Á¦Â¦Ã¦Ä¦Å¦Æ¦Ç +¦È¦É¦Ê¦Ë¦Ì¦Í¦Î¦Ï¦Ð¦Ñ¦Ò¦Ó¦Ô¦Õ¦Ö¦×¦Ø¡¦¡¦¡¦ ¦È¦É¦Ê¦Ë¦Ì¦Í¦Î¦Ï¦Ð¦Ñ¦Ò¦Ó¦Ô¦Õ¦Ö¦×¦Ø¡¦¡¦¡¦ +§´§µ§¶§·§¸§¹§º§»§¼§½§¾§¿§À§Á¡¦¡¦¡¦¡¦¡¦¡¦ §´§µ§¶§·§¸§¹§º§»§¼§½§¾§¿§À§Á¡¦¡¦¡¦¡¦¡¦¡¦ +§Ü§Ý§Þ§ß§à§á§â§ã§ä§å§æ§ç§è§é§ê§ë§ì§í§î§ï §Ü§Ý§Þ§ß§à§á§â§ã§ä§å§æ§ç§è§é§ê§ë§ì§í§î§ï +§ð§ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ §ð§ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¨´¨µ¨¶¨·¨¸¨¹¨º¨»¨¼¨½¨¾¨¿¨À¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¨´¨µ¨¶¨·¨¸¨¹¨º¨»¨¼¨½¨¾¨¿¨À¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç °´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û °È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï °Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï +°ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ °ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ +ϴϵ϶ϷϸϹϺϻϼϽϾϿÏÀÏÁÏÂÏÃÏÄÏÅÏÆÏÇ Ï´ÏµÏ¶Ï·Ï¸Ï¹ÏºÏ»Ï¼Ï½Ï¾Ï¿ÏÀÏÁÏÂÏÃÏÄÏÅÏÆÏÇ +ÏÈÏÉÏÊÏËÏÌÏÍÏÎÏÏÏÐÏÑÏÒÏÓ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ÏÈÏÉÏÊÏËÏÌÏÍÏÎÏÏÏÐÏÑÏÒÏÓ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +дежзийклмнопÐÀÐÁÐÂÐÃÐÄÐÅÐÆÐÇ Ð´ÐµÐ¶Ð·Ð¸Ð¹ÐºÐ»Ð¼Ð½Ð¾Ð¿ÐÀÐÁÐÂÐÃÐÄÐÅÐÆÐÇ +ÐÈÐÉÐÊÐËÐÌÐÍÐÎÐÏÐÐÐÑÐÒÐÓÐÔÐÕÐÖÐ×ÐØÐÙÐÚÐÛ ÐÈÐÉÐÊÐËÐÌÐÍÐÎÐÏÐÐÐÑÐÒÐÓÐÔÐÕÐÖÐ×ÐØÐÙÐÚÐÛ +ÐÜÐÝÐÞÐßÐàÐáÐâÐãÐäÐåÐæÐçÐèÐéÐêÐëÐìÐíÐîÐï ÐÜÐÝÐÞÐßÐàÐáÐâÐãÐäÐåÐæÐçÐèÐéÐêÐëÐìÐíÐîÐï +ÐðÐñÐòÐóÐôÐõÐöÐ÷ÐøÐùÐúÐûÐüÐýÐþ¡¦¡¦¡¦¡¦¡¦ ÐðÐñÐòÐóÐôÐõÐöÐ÷ÐøÐùÐúÐûÐüÐýÐþ¡¦¡¦¡¦¡¦¡¦ +ó´óµó¶ó·ó¸ó¹óºó»ó¼ó½ó¾ó¿óÀóÁóÂóÃóÄóÅóÆóÇ ó´óµó¶ó·ó¸ó¹óºó»ó¼ó½ó¾ó¿óÀóÁóÂóÃóÄóÅóÆóÇ +óÈóÉóÊóËóÌóÍóÎóÏóÐóÑóÒóÓóÔóÕóÖó×óØóÙóÚóÛ óÈóÉóÊóËóÌóÍóÎóÏóÐóÑóÒóÓóÔóÕóÖó×óØóÙóÚóÛ +óÜóÝóÞóßóàóáóâóãóäóåóæóçóèóéóêóëóìóíóîóï óÜóÝóÞóßóàóáóâóãóäóåóæóçóèóéóêóëóìóíóîóï +óðóñóòóóóôóõóöó÷óøóùóúóûóüóýóþ¡¦¡¦¡¦¡¦¡¦ óðóñóòóóóôóõóöó÷óøóùóúóûóüóýóþ¡¦¡¦¡¦¡¦¡¦ +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£²`; +£Ã£± CONVERT(`£Ã£±` using sjis) +¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡­¡®¡¯¡°¡±¡²¡³ ¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡­¡®¡¯¡°¡±¡²¡³ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦£°£±£²£³ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦£°£±£²£³ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Ñ§Ò§Ó§Ô§Õ§Ö§×§Ø§Ù§Ú§Û ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Ñ§Ò§Ó§Ô§Õ§Ö§×§Ø§Ù§Ú§Û +¡¦¡¦¡¦¡¦¡¦¡¦¢º¢»¢¼¢½¢¾¢¿¢À¢Á¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¢º¢»¢¼¢½¢¾¢¿¢À¢Á¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦£á£â£ã£ä£å£æ£ç£è£é£ê£ë£ì£í£î£ï ¡¦¡¦¡¦¡¦¡¦£á£â£ã£ä£å£æ£ç£è£é£ê£ë£ì£í£î£ï +¡¦¡¦¢Ê¢Ë¢Ì¢Í¢Î¢Ï¢Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¢Ê¢Ë¢Ì¢Í¢Î¢Ï¢Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¢ò¢ó¢ô¢õ¢ö¢÷¢ø¢ù¡¦¡¦¡¦¡¦¢þ¡¦¡¦¡¦¡¦¡¡ ¡¦¡¦¢ò¢ó¢ô¢õ¢ö¢÷¢ø¢ù¡¦¡¦¡¦¡¦¢þ¡¦¡¦¡¦¡¦¡¡ +¡¦¢¡¢¢¢£¢¤¢¥¢¦¢§¢¨¢©¢ª¢«¢¬¢­¢®¡¦¡¦¡¦¡¦¡¦ ¡¦¢¡¢¢¢£¢¤¢¥¢¦¢§¢¨¢©¢ª¢«¢¬¢­¢®¡¦¡¦¡¦¡¦¡¦ +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ ¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ +¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³ ¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³ +¡¦¦¡¦¢¦£¦¤¦¥¦¦¦§¦¨¦©¦ª¦«¦¬¦­¦®¦¯¦°¦±¦²¦³ ¡¦¦¡¦¢¦£¦¤¦¥¦¦¦§¦¨¦©¦ª¦«¦¬¦­¦®¦¯¦°¦±¦²¦³ +¡¦§¡§¢§£§¤§¥§¦§§§¨§©§ª§«§¬§­§®§¯§°§±§²§³ ¡¦§¡§¢§£§¤§¥§¦§§§¨§©§ª§«§¬§­§®§¯§°§±§²§³ +¡¦¨¡¨¢¨£¨¤¨¥¨¦¨§¨¨¨©¨ª¨«¨¬¨­¨®¨¯¨°¨±¨²¨³ ¡¦¨¡¨¢¨£¨¤¨¥¨¦¨§¨¨¨©¨ª¨«¨¬¨­¨®¨¯¨°¨±¨²¨³ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³ ¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³ +¡¦Ï¡Ï¢Ï£Ï¤Ï¥Ï¦Ï§Ï¨Ï©ÏªÏ«Ï¬Ï­Ï®Ï¯Ï°Ï±Ï²Ï³ ¡¦Ï¡Ï¢Ï£Ï¤Ï¥Ï¦Ï§Ï¨Ï©ÏªÏ«Ï¬Ï­Ï®Ï¯Ï°Ï±Ï²Ï³ +¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³ ¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³ +¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³ ¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³ +¡¦ô¡ô¢ô£ô¤ô¥ô¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦ô¡ô¢ô£ô¤ô¥ô¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç ¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿\¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç +¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û ¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û +¡Ü¡¾¡Þ¡ß¡à¡á¡â¡ã¡ä¡å¡æ¡ç¡è¡é¡ê¡ë¡ì¡í¡î¡ï ¡Ü¡¾¡Þ¡ß¡à¡á¡â¡ã¡ä¡å¡æ¡ç¡è¡é¡ê¡ë¡ì¡í¡î¡ï +¡ð¡ñ¡ò¡ó¡ô¡õ¡ö¡÷¡ø¡ù¡ú¡û¡ü¡ý¡þ¡¦¡¦¡¦¡¦¡¦ ¡ð¡ñ¡ò¡ó¡ô¡õ¡ö¡÷¡ø¡ù¡ú¡û¡ü¡ý¡þ¡¦¡¦¡¦¡¦¡¦ +¢Ü¢Ý¢Þ¢ß¢à¢á¢â¢ã¢ä¢å¢æ¢ç¢è¢é¢ê¡¦¡¦¡¦¡¦¡¦ ¢Ü¢Ý¢Þ¢ß¢à¢á¢â¢ã¢ä¢å¢æ¢ç¢è¢é¢ê¡¦¡¦¡¦¡¦¡¦ +£´£µ£¶£·£¸£¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦£Á£Â£Ã£Ä£Å£Æ£Ç £´£µ£¶£·£¸£¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦£Á£Â£Ã£Ä£Å£Æ£Ç +£È£É£Ê£Ë£Ì£Í£Î£Ï£Ð£Ñ£Ò£Ó£Ô£Õ£Ö£×£Ø£Ù£Ú¡¦ £È£É£Ê£Ë£Ì£Í£Î£Ï£Ð£Ñ£Ò£Ó£Ô£Õ£Ö£×£Ø£Ù£Ú¡¦ +£ð£ñ£ò£ó£ô£õ£ö£÷£ø£ù£ú¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ £ð£ñ£ò£ó£ô£õ£ö£÷£ø£ù£ú¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¤´¤µ¤¶¤·¤¸¤¹¤º¤»¤¼¤½¤¾¤¿¤À¤Á¤Â¤Ã¤Ä¤Å¤Æ¤Ç ¤´¤µ¤¶¤·¤¸¤¹¤º¤»¤¼¤½¤¾¤¿¤À¤Á¤Â¤Ã¤Ä¤Å¤Æ¤Ç +¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û ¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û +¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï ¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï +¤ð¤ñ¤ò¤ó¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¤ð¤ñ¤ò¤ó¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¥´¥µ¥¶¥·¥¸¥¹¥º¥»¥¼¥½¥¾¥¿¥À¥Á¥Â¥Ã¥Ä¥Å¥Æ¥Ç ¥´¥µ¥¶¥·¥¸¥¹¥º¥»¥¼¥½¥¾¥¿¥À¥Á¥Â¥Ã¥Ä¥Å¥Æ¥Ç +¥È¥É¥Ê¥Ë¥Ì¥Í¥Î¥Ï¥Ð¥Ñ¥Ò¥Ó¥Ô¥Õ¥Ö¥×¥Ø¥Ù¥Ú¥Û ¥È¥É¥Ê¥Ë¥Ì¥Í¥Î¥Ï¥Ð¥Ñ¥Ò¥Ó¥Ô¥Õ¥Ö¥×¥Ø¥Ù¥Ú¥Û +¥Ü¥Ý¥Þ¥ß¥à¥á¥â¥ã¥ä¥å¥æ¥ç¥è¥é¥ê¥ë¥ì¥í¥î¥ï ¥Ü¥Ý¥Þ¥ß¥à¥á¥â¥ã¥ä¥å¥æ¥ç¥è¥é¥ê¥ë¥ì¥í¥î¥ï +¥ð¥ñ¥ò¥ó¥ô¥õ¥ö¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¥ð¥ñ¥ò¥ó¥ô¥õ¥ö¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¦´¦µ¦¶¦·¦¸¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¦Á¦Â¦Ã¦Ä¦Å¦Æ¦Ç ¦´¦µ¦¶¦·¦¸¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¦Á¦Â¦Ã¦Ä¦Å¦Æ¦Ç +¦È¦É¦Ê¦Ë¦Ì¦Í¦Î¦Ï¦Ð¦Ñ¦Ò¦Ó¦Ô¦Õ¦Ö¦×¦Ø¡¦¡¦¡¦ ¦È¦É¦Ê¦Ë¦Ì¦Í¦Î¦Ï¦Ð¦Ñ¦Ò¦Ó¦Ô¦Õ¦Ö¦×¦Ø¡¦¡¦¡¦ +§´§µ§¶§·§¸§¹§º§»§¼§½§¾§¿§À§Á¡¦¡¦¡¦¡¦¡¦¡¦ §´§µ§¶§·§¸§¹§º§»§¼§½§¾§¿§À§Á¡¦¡¦¡¦¡¦¡¦¡¦ +§Ü§Ý§Þ§ß§à§á§â§ã§ä§å§æ§ç§è§é§ê§ë§ì§í§î§ï §Ü§Ý§Þ§ß§à§á§â§ã§ä§å§æ§ç§è§é§ê§ë§ì§í§î§ï +§ð§ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ §ð§ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¨´¨µ¨¶¨·¨¸¨¹¨º¨»¨¼¨½¨¾¨¿¨À¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¨´¨µ¨¶¨·¨¸¨¹¨º¨»¨¼¨½¨¾¨¿¨À¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç °´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û °È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï °Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï +°ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ °ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ +ϴϵ϶ϷϸϹϺϻϼϽϾϿÏÀÏÁÏÂÏÃÏÄÏÅÏÆÏÇ Ï´ÏµÏ¶Ï·Ï¸Ï¹ÏºÏ»Ï¼Ï½Ï¾Ï¿ÏÀÏÁÏÂÏÃÏÄÏÅÏÆÏÇ +ÏÈÏÉÏÊÏËÏÌÏÍÏÎÏÏÏÐÏÑÏÒÏÓ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ÏÈÏÉÏÊÏËÏÌÏÍÏÎÏÏÏÐÏÑÏÒÏÓ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +дежзийклмнопÐÀÐÁÐÂÐÃÐÄÐÅÐÆÐÇ Ð´ÐµÐ¶Ð·Ð¸Ð¹ÐºÐ»Ð¼Ð½Ð¾Ð¿ÐÀÐÁÐÂÐÃÐÄÐÅÐÆÐÇ +ÐÈÐÉÐÊÐËÐÌÐÍÐÎÐÏÐÐÐÑÐÒÐÓÐÔÐÕÐÖÐ×ÐØÐÙÐÚÐÛ ÐÈÐÉÐÊÐËÐÌÐÍÐÎÐÏÐÐÐÑÐÒÐÓÐÔÐÕÐÖÐ×ÐØÐÙÐÚÐÛ +ÐÜÐÝÐÞÐßÐàÐáÐâÐãÐäÐåÐæÐçÐèÐéÐêÐëÐìÐíÐîÐï ÐÜÐÝÐÞÐßÐàÐáÐâÐãÐäÐåÐæÐçÐèÐéÐêÐëÐìÐíÐîÐï +ÐðÐñÐòÐóÐôÐõÐöÐ÷ÐøÐùÐúÐûÐüÐýÐþ¡¦¡¦¡¦¡¦¡¦ ÐðÐñÐòÐóÐôÐõÐöÐ÷ÐøÐùÐúÐûÐüÐýÐþ¡¦¡¦¡¦¡¦¡¦ +ó´óµó¶ó·ó¸ó¹óºó»ó¼ó½ó¾ó¿óÀóÁóÂóÃóÄóÅóÆóÇ ó´óµó¶ó·ó¸ó¹óºó»ó¼ó½ó¾ó¿óÀóÁóÂóÃóÄóÅóÆóÇ +óÈóÉóÊóËóÌóÍóÎóÏóÐóÑóÒóÓóÔóÕóÖó×óØóÙóÚóÛ óÈóÉóÊóËóÌóÍóÎóÏóÐóÑóÒóÓóÔóÕóÖó×óØóÙóÚóÛ +óÜóÝóÞóßóàóáóâóãóäóåóæóçóèóéóêóëóìóíóîóï óÜóÝóÞóßóàóáóâóãóäóåóæóçóèóéóêóëóìóíóîóï +óðóñóòóóóôóõóöó÷óøóùóúóûóüóýóþ¡¦¡¦¡¦¡¦¡¦ óðóñóòóóóôóõóöó÷óøóùóúóûóüóýóþ¡¦¡¦¡¦¡¦¡¦ +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£³`; +£Ã£± CONVERT(`£Ã£±` using utf8) +¢ð¢ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¢ð¢ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +§È§É§Ê§Ë§Ì§Í§Î¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ §È§É§Ê§Ë§Ì§Í§Î¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +©È©É©Ê©Ë©Ì©Í©Î©Ï©Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ©È©É©Ê©Ë©Ì©Í©Î©Ï©Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +ª´ªµª¶ª·ª¸¡¦ªºª»ª¼ª½ª¾ª¿ªÀªÁªÂªÃªÄªÅªÆªÇ ª´ªµª¶ª·ª¸¡¦ªºª»ª¼ª½ª¾ª¿ªÀªÁªÂªÃªÄªÅªÆªÇ +ªÈªÉªÊªËªÌªÍªÎªÏªÐªÑªÒªÓªÔªÕªÖª×ªØªÙªÚªÛ ªÈªÉªÊªËªÌªÍªÎªÏªÐªÑªÒªÓªÔªÕªÖª×ªØªÙªÚªÛ +ªÜªÝªÞªßªàªáªâªãªäªåªæªçªèªéªêªëªìªíªîªï ªÜªÝªÞªßªàªáªâªãªäªåªæªçªèªéªêªëªìªíªîªï +ªðªñªòªóªôªõªöª÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ªðªñªòªóªôªõªöª÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +«´«µ«¶«·«¸«¹«º«»¡¦«½«¾«¿«À«Á«Â«Ã¡¦«Å«Æ«Ç «´«µ«¶«·«¸«¹«º«»¡¦«½«¾«¿«À«Á«Â«Ã¡¦«Å«Æ«Ç +«È«É«Ê«Ë«Ì«Í«Î«Ï«Ð«Ñ«Ò«Ó«Ô«Õ«Ö«×«Ø«Ù«Ú«Û «È«É«Ê«Ë«Ì«Í«Î«Ï«Ð«Ñ«Ò«Ó«Ô«Õ«Ö«×«Ø«Ù«Ú«Û +«Ü«Ý«Þ«ß«à«á«â«ã«ä«å«æ«ç«è«é«ê«ë«ì«í«î«ï «Ü«Ý«Þ«ß«à«á«â«ã«ä«å«æ«ç«è«é«ê«ë«ì«í«î«ï +«ð«ñ«ò«ó«ô«õ«ö«÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ «ð«ñ«ò«ó«ô«õ«ö«÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç °´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û °È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï °Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï +°ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ °ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ +íÜíÝíÞíßíàíáíâí㡦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ íÜíÝíÞíßíàíáíâí㡦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ ¡¦¢µ¢¶~¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ +¡¦¦ñ¦ò¦ó¦ô¦õ¦ö¦÷¦ø¦ù¦ú¦û¦ü¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¦ñ¦ò¦ó¦ô¦õ¦ö¦÷¦ø¦ù¦ú¦û¦ü¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦©¡©¢¡¦©¤¡¦©¦¡¦©¨©©¡¦©«©¬©­¡¦©¯©°¡¦¡¦¡¦ ¡¦©¡©¢¡¦©¤¡¦©¦¡¦©¨©©¡¦©«©¬©­¡¦©¯©°¡¦¡¦¡¦ +¡¦ª¡ª¢ª£ª¤ª¥ª¦ª§ª¨ª©ªªª«ª¬ª­ª®ª¯ª°ª±ª²ª³ ¡¦ª¡ª¢ª£ª¤ª¥ª¦ª§ª¨ª©ªªª«ª¬ª­ª®ª¯ª°ª±ª²ª³ +¡¦«¡«¢«£«¤«¥«¦«§«¨«©«ª«««¬«­«®«¯«°«±«²«³ ¡¦«¡«¢«£«¤«¥«¦«§«¨«©«ª«««¬«­«®«¯«°«±«²«³ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³ ¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³ +¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³ ¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³ +¡¦¡¦§ò§ó§ô§õ§ö§÷§ø§ù§ú§û§ü§ý§þ¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦§ò§ó§ô§õ§ö§÷§ø§ù§ú§û§ü§ý§þ¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¦á¦â¦ã¦ä¦å¡¦¦ç¡¦¦é¦ê¡¦¦ì¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¦á¦â¦ã¦ä¦å¡¦¦ç¡¦¦é¦ê¡¦¦ì¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦©Á©Â©Ã©Ä©Å©Æ©Ç ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦©Á©Â©Ã©Ä©Å©Æ©Ç +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Â§Ã§Ä§Å§Æ§Ç ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Â§Ã§Ä§Å§Æ§Ç +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢¯¢°¢±¢²¢³ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢¯¢°¢±¢²¢³ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢ë¢ì¢í¢î¢ï ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢ë¢ì¢í¢î¢ï +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£³`; +£Ã£± CONVERT(`£Ã£±` using ucs2) +¢ð¢ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¢ð¢ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +§È§É§Ê§Ë§Ì§Í§Î¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ §È§É§Ê§Ë§Ì§Í§Î¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +©È©É©Ê©Ë©Ì©Í©Î©Ï©Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ©È©É©Ê©Ë©Ì©Í©Î©Ï©Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +ª´ªµª¶ª·ª¸¡¦ªºª»ª¼ª½ª¾ª¿ªÀªÁªÂªÃªÄªÅªÆªÇ ª´ªµª¶ª·ª¸¡¦ªºª»ª¼ª½ª¾ª¿ªÀªÁªÂªÃªÄªÅªÆªÇ +ªÈªÉªÊªËªÌªÍªÎªÏªÐªÑªÒªÓªÔªÕªÖª×ªØªÙªÚªÛ ªÈªÉªÊªËªÌªÍªÎªÏªÐªÑªÒªÓªÔªÕªÖª×ªØªÙªÚªÛ +ªÜªÝªÞªßªàªáªâªãªäªåªæªçªèªéªêªëªìªíªîªï ªÜªÝªÞªßªàªáªâªãªäªåªæªçªèªéªêªëªìªíªîªï +ªðªñªòªóªôªõªöª÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ªðªñªòªóªôªõªöª÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +«´«µ«¶«·«¸«¹«º«»¡¦«½«¾«¿«À«Á«Â«Ã¡¦«Å«Æ«Ç «´«µ«¶«·«¸«¹«º«»¡¦«½«¾«¿«À«Á«Â«Ã¡¦«Å«Æ«Ç +«È«É«Ê«Ë«Ì«Í«Î«Ï«Ð«Ñ«Ò«Ó«Ô«Õ«Ö«×«Ø«Ù«Ú«Û «È«É«Ê«Ë«Ì«Í«Î«Ï«Ð«Ñ«Ò«Ó«Ô«Õ«Ö«×«Ø«Ù«Ú«Û +«Ü«Ý«Þ«ß«à«á«â«ã«ä«å«æ«ç«è«é«ê«ë«ì«í«î«ï «Ü«Ý«Þ«ß«à«á«â«ã«ä«å«æ«ç«è«é«ê«ë«ì«í«î«ï +«ð«ñ«ò«ó«ô«õ«ö«÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ «ð«ñ«ò«ó«ô«õ«ö«÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç °´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û °È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï °Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï +°ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ °ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ +íÜíÝíÞíßíàíáíâí㡦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ íÜíÝíÞíßíàíáíâí㡦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ ¡¦¢µ¢¶~¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ +¡¦¦ñ¦ò¦ó¦ô¦õ¦ö¦÷¦ø¦ù¦ú¦û¦ü¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¦ñ¦ò¦ó¦ô¦õ¦ö¦÷¦ø¦ù¦ú¦û¦ü¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦©¡©¢¡¦©¤¡¦©¦¡¦©¨©©¡¦©«©¬©­¡¦©¯©°¡¦¡¦¡¦ ¡¦©¡©¢¡¦©¤¡¦©¦¡¦©¨©©¡¦©«©¬©­¡¦©¯©°¡¦¡¦¡¦ +¡¦ª¡ª¢ª£ª¤ª¥ª¦ª§ª¨ª©ªªª«ª¬ª­ª®ª¯ª°ª±ª²ª³ ¡¦ª¡ª¢ª£ª¤ª¥ª¦ª§ª¨ª©ªªª«ª¬ª­ª®ª¯ª°ª±ª²ª³ +¡¦«¡«¢«£«¤«¥«¦«§«¨«©«ª«««¬«­«®«¯«°«±«²«³ ¡¦«¡«¢«£«¤«¥«¦«§«¨«©«ª«««¬«­«®«¯«°«±«²«³ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³ ¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³ +¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³ ¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³ +¡¦¡¦§ò§ó§ô§õ§ö§÷§ø§ù§ú§û§ü§ý§þ¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦§ò§ó§ô§õ§ö§÷§ø§ù§ú§û§ü§ý§þ¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¦á¦â¦ã¦ä¦å¡¦¦ç¡¦¦é¦ê¡¦¦ì¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¦á¦â¦ã¦ä¦å¡¦¦ç¡¦¦é¦ê¡¦¦ì¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦©Á©Â©Ã©Ä©Å©Æ©Ç ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦©Á©Â©Ã©Ä©Å©Æ©Ç +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Â§Ã§Ä§Å§Æ§Ç ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Â§Ã§Ä§Å§Æ§Ç +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢¯¢°¢±¢²¢³ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢¯¢°¢±¢²¢³ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢ë¢ì¢í¢î¢ï ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢ë¢ì¢í¢î¢ï +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£³`; +£Ã£± CONVERT(`£Ã£±` using sjis) +¢ð¢ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ??¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +§È§É§Ê§Ë§Ì§Í§Î¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ???????¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +©È©É©Ê©Ë©Ì©Í©Î©Ï©Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ?????????¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +ª´ªµª¶ª·ª¸¡¦ªºª»ª¼ª½ª¾ª¿ªÀªÁªÂªÃªÄªÅªÆªÇ ?????¡¦?????????????? +ªÈªÉªÊªËªÌªÍªÎªÏªÐªÑªÒªÓªÔªÕªÖª×ªØªÙªÚªÛ ???????????????????? +ªÜªÝªÞªßªàªáªâªãªäªåªæªçªèªéªêªëªìªíªîªï ???????????????????? +ªðªñªòªóªôªõªöª÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ????????¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +«´«µ«¶«·«¸«¹«º«»¡¦«½«¾«¿«À«Á«Â«Ã¡¦«Å«Æ«Ç ????????¡¦???????¡¦??? +«È«É«Ê«Ë«Ì«Í«Î«Ï«Ð«Ñ«Ò«Ó«Ô«Õ«Ö«×«Ø«Ù«Ú«Û ???????????????????? +«Ü«Ý«Þ«ß«à«á«â«ã«ä«å«æ«ç«è«é«ê«ë«ì«í«î«ï ???????????????????? +«ð«ñ«ò«ó«ô«õ«ö«÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ????????¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç ???????????????????? +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û ???????????????????? +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï ???????????????????? +°ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ ???????????????¡¦¡¦¡¦¡¦¡¦ +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ ???????????????????? +íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ ???????????????????? +íÜíÝíÞíßíàíáíâí㡦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ????????¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ ¡¦??~??¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦???¡¦¡¦¡¦ +¡¦¦ñ¦ò¦ó¦ô¦õ¦ö¦÷¦ø¦ù¦ú¦û¦ü¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦????????????¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦©¡©¢¡¦©¤¡¦©¦¡¦©¨©©¡¦©«©¬©­¡¦©¯©°¡¦¡¦¡¦ ¡¦??¡¦?¡¦?¡¦??¡¦???¡¦??¡¦¡¦¡¦ +¡¦ª¡ª¢ª£ª¤ª¥ª¦ª§ª¨ª©ªªª«ª¬ª­ª®ª¯ª°ª±ª²ª³ ¡¦??????????????????? +¡¦«¡«¢«£«¤«¥«¦«§«¨«©«ª«««¬«­«®«¯«°«±«²«³ ¡¦??????????????????? +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³ ¡¦??????????????????? +¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³ ¡¦??????????????????? +¡¦¡¦§ò§ó§ô§õ§ö§÷§ø§ù§ú§û§ü§ý§þ¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦?????????????¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¦á¦â¦ã¦ä¦å¡¦¦ç¡¦¦é¦ê¡¦¦ì¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦?????¡¦?¡¦??¡¦?¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦©Á©Â©Ã©Ä©Å©Æ©Ç ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦??????? +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Â§Ã§Ä§Å§Æ§Ç ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦?????? +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢¯¢°¢±¢²¢³ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦????? +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢ë¢ì¢í¢î¢ï ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦????? +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£´`; +£Ã£± CONVERT(`£Ã£±` using utf8) + !"#$%&'()*+,-./ !"#$%&'()*+,-./ + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯ Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯ +0123456789:;<=>? 0123456789:;<=>? +@ABCDEFGHIJKLMNO @ABCDEFGHIJKLMNO +abcdefghijklmno abcdefghijklmno +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[\]^_ +pqrstuvwxyz{|}~ pqrstuvwxyz{|}~ +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ +ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£´`; +£Ã£± CONVERT(`£Ã£±` using ucs2) + !"#$%&'()*+,-./ !"#$%&'()*+,-./ + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯ Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯ +0123456789:;<=>? 0123456789:;<=>? +@ABCDEFGHIJKLMNO @ABCDEFGHIJKLMNO +abcdefghijklmno abcdefghijklmno +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[\]^_ +pqrstuvwxyz{|}~ pqrstuvwxyz{|}~ +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ +ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£´`; +£Ã£± CONVERT(`£Ã£±` using sjis) + !"#$%&'()*+,-./ !"#$%&'()*+,-./ + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯ Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯ +0123456789:;<=>? 0123456789:;<=>? +@ABCDEFGHIJKLMNO @ABCDEFGHIJKLMNO +abcdefghijklmno abcdefghijklmno +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[\]^_ +pqrstuvwxyz{|}~ pqrstuvwxyz{|}~ +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ +ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£µ`; +£Ã£± CONVERT(`£Ã£±` using utf8) +¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡­¡®¡¯¡°¡±¡²¡³ ¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡­¡®¡¯¡°¡±¡²¡³ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦£°£±£²£³ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦£°£±£²£³ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Ñ§Ò§Ó§Ô§Õ§Ö§×§Ø§Ù§Ú§Û ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Ñ§Ò§Ó§Ô§Õ§Ö§×§Ø§Ù§Ú§Û +¡¦¡¦¡¦¡¦¡¦¡¦¢º¢»¢¼¢½¢¾¢¿¢À¢Á¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¢º¢»¢¼¢½¢¾¢¿¢À¢Á¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦£á£â£ã£ä£å£æ£ç£è£é£ê£ë£ì£í£î£ï ¡¦¡¦¡¦¡¦¡¦£á£â£ã£ä£å£æ£ç£è£é£ê£ë£ì£í£î£ï +¡¦¡¦¢Ê¢Ë¢Ì¢Í¢Î¢Ï¢Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¢Ê¢Ë¢Ì¢Í¢Î¢Ï¢Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¢ò¢ó¢ô¢õ¢ö¢÷¢ø¢ù¡¦¡¦¡¦¡¦¢þ¡¦¡¦¡¦¡¦¡¡ ¡¦¡¦¢ò¢ó¢ô¢õ¢ö¢÷¢ø¢ù¡¦¡¦¡¦¡¦¢þ¡¦¡¦¡¦¡¦¡¡ +¡¦¢¡¢¢¢£¢¤¢¥¢¦¢§¢¨¢©¢ª¢«¢¬¢­¢®¡¦¡¦¡¦¡¦¡¦ ¡¦¢¡¢¢¢£¢¤¢¥¢¦¢§¢¨¢©¢ª¢«¢¬¢­¢®¡¦¡¦¡¦¡¦¡¦ +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ ¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ +¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³ ¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³ +¡¦¦¡¦¢¦£¦¤¦¥¦¦¦§¦¨¦©¦ª¦«¦¬¦­¦®¦¯¦°¦±¦²¦³ ¡¦¦¡¦¢¦£¦¤¦¥¦¦¦§¦¨¦©¦ª¦«¦¬¦­¦®¦¯¦°¦±¦²¦³ +¡¦§¡§¢§£§¤§¥§¦§§§¨§©§ª§«§¬§­§®§¯§°§±§²§³ ¡¦§¡§¢§£§¤§¥§¦§§§¨§©§ª§«§¬§­§®§¯§°§±§²§³ +¡¦¨¡¨¢¨£¨¤¨¥¨¦¨§¨¨¨©¨ª¨«¨¬¨­¨®¨¯¨°¨±¨²¨³ ¡¦¨¡¨¢¨£¨¤¨¥¨¦¨§¨¨¨©¨ª¨«¨¬¨­¨®¨¯¨°¨±¨²¨³ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³ ¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³ +¡¦Ï¡Ï¢Ï£Ï¤Ï¥Ï¦Ï§Ï¨Ï©ÏªÏ«Ï¬Ï­Ï®Ï¯Ï°Ï±Ï²Ï³ ¡¦Ï¡Ï¢Ï£Ï¤Ï¥Ï¦Ï§Ï¨Ï©ÏªÏ«Ï¬Ï­Ï®Ï¯Ï°Ï±Ï²Ï³ +¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³ ¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³ +¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³ ¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³ +¡¦ô¡ô¢ô£ô¤ô¥ô¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦ô¡ô¢ô£ô¤ô¥ô¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç ¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿\¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç +¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û ¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û +¡Ü¡¾¡Þ¡ß¡à¡á¡â¡ã¡ä¡å¡æ¡ç¡è¡é¡ê¡ë¡ì¡í¡î¡ï ¡Ü¡¾¡Þ¡ß¡à¡á¡â¡ã¡ä¡å¡æ¡ç¡è¡é¡ê¡ë¡ì¡í¡î¡ï +¡ð¡ñ¡ò¡ó¡ô¡õ¡ö¡÷¡ø¡ù¡ú¡û¡ü¡ý¡þ¡¦¡¦¡¦¡¦¡¦ ¡ð¡ñ¡ò¡ó¡ô¡õ¡ö¡÷¡ø¡ù¡ú¡û¡ü¡ý¡þ¡¦¡¦¡¦¡¦¡¦ +¢Ü¢Ý¢Þ¢ß¢à¢á¢â¢ã¢ä¢å¢æ¢ç¢è¢é¢ê¡¦¡¦¡¦¡¦¡¦ ¢Ü¢Ý¢Þ¢ß¢à¢á¢â¢ã¢ä¢å¢æ¢ç¢è¢é¢ê¡¦¡¦¡¦¡¦¡¦ +£´£µ£¶£·£¸£¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦£Á£Â£Ã£Ä£Å£Æ£Ç £´£µ£¶£·£¸£¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦£Á£Â£Ã£Ä£Å£Æ£Ç +£È£É£Ê£Ë£Ì£Í£Î£Ï£Ð£Ñ£Ò£Ó£Ô£Õ£Ö£×£Ø£Ù£Ú¡¦ £È£É£Ê£Ë£Ì£Í£Î£Ï£Ð£Ñ£Ò£Ó£Ô£Õ£Ö£×£Ø£Ù£Ú¡¦ +£ð£ñ£ò£ó£ô£õ£ö£÷£ø£ù£ú¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ £ð£ñ£ò£ó£ô£õ£ö£÷£ø£ù£ú¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¤´¤µ¤¶¤·¤¸¤¹¤º¤»¤¼¤½¤¾¤¿¤À¤Á¤Â¤Ã¤Ä¤Å¤Æ¤Ç ¤´¤µ¤¶¤·¤¸¤¹¤º¤»¤¼¤½¤¾¤¿¤À¤Á¤Â¤Ã¤Ä¤Å¤Æ¤Ç +¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û ¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û +¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï ¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï +¤ð¤ñ¤ò¤ó¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¤ð¤ñ¤ò¤ó¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¥´¥µ¥¶¥·¥¸¥¹¥º¥»¥¼¥½¥¾¥¿¥À¥Á¥Â¥Ã¥Ä¥Å¥Æ¥Ç ¥´¥µ¥¶¥·¥¸¥¹¥º¥»¥¼¥½¥¾¥¿¥À¥Á¥Â¥Ã¥Ä¥Å¥Æ¥Ç +¥È¥É¥Ê¥Ë¥Ì¥Í¥Î¥Ï¥Ð¥Ñ¥Ò¥Ó¥Ô¥Õ¥Ö¥×¥Ø¥Ù¥Ú¥Û ¥È¥É¥Ê¥Ë¥Ì¥Í¥Î¥Ï¥Ð¥Ñ¥Ò¥Ó¥Ô¥Õ¥Ö¥×¥Ø¥Ù¥Ú¥Û +¥Ü¥Ý¥Þ¥ß¥à¥á¥â¥ã¥ä¥å¥æ¥ç¥è¥é¥ê¥ë¥ì¥í¥î¥ï ¥Ü¥Ý¥Þ¥ß¥à¥á¥â¥ã¥ä¥å¥æ¥ç¥è¥é¥ê¥ë¥ì¥í¥î¥ï +¥ð¥ñ¥ò¥ó¥ô¥õ¥ö¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¥ð¥ñ¥ò¥ó¥ô¥õ¥ö¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¦´¦µ¦¶¦·¦¸¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¦Á¦Â¦Ã¦Ä¦Å¦Æ¦Ç ¦´¦µ¦¶¦·¦¸¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¦Á¦Â¦Ã¦Ä¦Å¦Æ¦Ç +¦È¦É¦Ê¦Ë¦Ì¦Í¦Î¦Ï¦Ð¦Ñ¦Ò¦Ó¦Ô¦Õ¦Ö¦×¦Ø¡¦¡¦¡¦ ¦È¦É¦Ê¦Ë¦Ì¦Í¦Î¦Ï¦Ð¦Ñ¦Ò¦Ó¦Ô¦Õ¦Ö¦×¦Ø¡¦¡¦¡¦ +§´§µ§¶§·§¸§¹§º§»§¼§½§¾§¿§À§Á¡¦¡¦¡¦¡¦¡¦¡¦ §´§µ§¶§·§¸§¹§º§»§¼§½§¾§¿§À§Á¡¦¡¦¡¦¡¦¡¦¡¦ +§Ü§Ý§Þ§ß§à§á§â§ã§ä§å§æ§ç§è§é§ê§ë§ì§í§î§ï §Ü§Ý§Þ§ß§à§á§â§ã§ä§å§æ§ç§è§é§ê§ë§ì§í§î§ï +§ð§ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ §ð§ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¨´¨µ¨¶¨·¨¸¨¹¨º¨»¨¼¨½¨¾¨¿¨À¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¨´¨µ¨¶¨·¨¸¨¹¨º¨»¨¼¨½¨¾¨¿¨À¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç °´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û °È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï °Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï +°ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ °ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ +ϴϵ϶ϷϸϹϺϻϼϽϾϿÏÀÏÁÏÂÏÃÏÄÏÅÏÆÏÇ Ï´ÏµÏ¶Ï·Ï¸Ï¹ÏºÏ»Ï¼Ï½Ï¾Ï¿ÏÀÏÁÏÂÏÃÏÄÏÅÏÆÏÇ +ÏÈÏÉÏÊÏËÏÌÏÍÏÎÏÏÏÐÏÑÏÒÏÓ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ÏÈÏÉÏÊÏËÏÌÏÍÏÎÏÏÏÐÏÑÏÒÏÓ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +дежзийклмнопÐÀÐÁÐÂÐÃÐÄÐÅÐÆÐÇ Ð´ÐµÐ¶Ð·Ð¸Ð¹ÐºÐ»Ð¼Ð½Ð¾Ð¿ÐÀÐÁÐÂÐÃÐÄÐÅÐÆÐÇ +ÐÈÐÉÐÊÐËÐÌÐÍÐÎÐÏÐÐÐÑÐÒÐÓÐÔÐÕÐÖÐ×ÐØÐÙÐÚÐÛ ÐÈÐÉÐÊÐËÐÌÐÍÐÎÐÏÐÐÐÑÐÒÐÓÐÔÐÕÐÖÐ×ÐØÐÙÐÚÐÛ +ÐÜÐÝÐÞÐßÐàÐáÐâÐãÐäÐåÐæÐçÐèÐéÐêÐëÐìÐíÐîÐï ÐÜÐÝÐÞÐßÐàÐáÐâÐãÐäÐåÐæÐçÐèÐéÐêÐëÐìÐíÐîÐï +ÐðÐñÐòÐóÐôÐõÐöÐ÷ÐøÐùÐúÐûÐüÐýÐþ¡¦¡¦¡¦¡¦¡¦ ÐðÐñÐòÐóÐôÐõÐöÐ÷ÐøÐùÐúÐûÐüÐýÐþ¡¦¡¦¡¦¡¦¡¦ +ó´óµó¶ó·ó¸ó¹óºó»ó¼ó½ó¾ó¿óÀóÁóÂóÃóÄóÅóÆóÇ ó´óµó¶ó·ó¸ó¹óºó»ó¼ó½ó¾ó¿óÀóÁóÂóÃóÄóÅóÆóÇ +óÈóÉóÊóËóÌóÍóÎóÏóÐóÑóÒóÓóÔóÕóÖó×óØóÙóÚóÛ óÈóÉóÊóËóÌóÍóÎóÏóÐóÑóÒóÓóÔóÕóÖó×óØóÙóÚóÛ +óÜóÝóÞóßóàóáóâóãóäóåóæóçóèóéóêóëóìóíóîóï óÜóÝóÞóßóàóáóâóãóäóåóæóçóèóéóêóëóìóíóîóï +óðóñóòóóóôóõóöó÷óøóùóúóûóüóýóþ¡¦¡¦¡¦¡¦¡¦ óðóñóòóóóôóõóöó÷óøóùóúóûóüóýóþ¡¦¡¦¡¦¡¦¡¦ +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£µ`; +£Ã£± CONVERT(`£Ã£±` using ucs2) +¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡­¡®¡¯¡°¡±¡²¡³ ¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡­¡®¡¯¡°¡±¡²¡³ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦£°£±£²£³ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦£°£±£²£³ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Ñ§Ò§Ó§Ô§Õ§Ö§×§Ø§Ù§Ú§Û ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Ñ§Ò§Ó§Ô§Õ§Ö§×§Ø§Ù§Ú§Û +¡¦¡¦¡¦¡¦¡¦¡¦¢º¢»¢¼¢½¢¾¢¿¢À¢Á¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¢º¢»¢¼¢½¢¾¢¿¢À¢Á¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦£á£â£ã£ä£å£æ£ç£è£é£ê£ë£ì£í£î£ï ¡¦¡¦¡¦¡¦¡¦£á£â£ã£ä£å£æ£ç£è£é£ê£ë£ì£í£î£ï +¡¦¡¦¢Ê¢Ë¢Ì¢Í¢Î¢Ï¢Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¢Ê¢Ë¢Ì¢Í¢Î¢Ï¢Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¢ò¢ó¢ô¢õ¢ö¢÷¢ø¢ù¡¦¡¦¡¦¡¦¢þ¡¦¡¦¡¦¡¦¡¡ ¡¦¡¦¢ò¢ó¢ô¢õ¢ö¢÷¢ø¢ù¡¦¡¦¡¦¡¦¢þ¡¦¡¦¡¦¡¦¡¡ +¡¦¢¡¢¢¢£¢¤¢¥¢¦¢§¢¨¢©¢ª¢«¢¬¢­¢®¡¦¡¦¡¦¡¦¡¦ ¡¦¢¡¢¢¢£¢¤¢¥¢¦¢§¢¨¢©¢ª¢«¢¬¢­¢®¡¦¡¦¡¦¡¦¡¦ +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ ¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ +¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³ ¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³ +¡¦¦¡¦¢¦£¦¤¦¥¦¦¦§¦¨¦©¦ª¦«¦¬¦­¦®¦¯¦°¦±¦²¦³ ¡¦¦¡¦¢¦£¦¤¦¥¦¦¦§¦¨¦©¦ª¦«¦¬¦­¦®¦¯¦°¦±¦²¦³ +¡¦§¡§¢§£§¤§¥§¦§§§¨§©§ª§«§¬§­§®§¯§°§±§²§³ ¡¦§¡§¢§£§¤§¥§¦§§§¨§©§ª§«§¬§­§®§¯§°§±§²§³ +¡¦¨¡¨¢¨£¨¤¨¥¨¦¨§¨¨¨©¨ª¨«¨¬¨­¨®¨¯¨°¨±¨²¨³ ¡¦¨¡¨¢¨£¨¤¨¥¨¦¨§¨¨¨©¨ª¨«¨¬¨­¨®¨¯¨°¨±¨²¨³ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³ ¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³ +¡¦Ï¡Ï¢Ï£Ï¤Ï¥Ï¦Ï§Ï¨Ï©ÏªÏ«Ï¬Ï­Ï®Ï¯Ï°Ï±Ï²Ï³ ¡¦Ï¡Ï¢Ï£Ï¤Ï¥Ï¦Ï§Ï¨Ï©ÏªÏ«Ï¬Ï­Ï®Ï¯Ï°Ï±Ï²Ï³ +¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³ ¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³ +¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³ ¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³ +¡¦ô¡ô¢ô£ô¤ô¥ô¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦ô¡ô¢ô£ô¤ô¥ô¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç ¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿\¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç +¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û ¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û +¡Ü¡¾¡Þ¡ß¡à¡á¡â¡ã¡ä¡å¡æ¡ç¡è¡é¡ê¡ë¡ì¡í¡î¡ï ¡Ü¡¾¡Þ¡ß¡à¡á¡â¡ã¡ä¡å¡æ¡ç¡è¡é¡ê¡ë¡ì¡í¡î¡ï +¡ð¡ñ¡ò¡ó¡ô¡õ¡ö¡÷¡ø¡ù¡ú¡û¡ü¡ý¡þ¡¦¡¦¡¦¡¦¡¦ ¡ð¡ñ¡ò¡ó¡ô¡õ¡ö¡÷¡ø¡ù¡ú¡û¡ü¡ý¡þ¡¦¡¦¡¦¡¦¡¦ +¢Ü¢Ý¢Þ¢ß¢à¢á¢â¢ã¢ä¢å¢æ¢ç¢è¢é¢ê¡¦¡¦¡¦¡¦¡¦ ¢Ü¢Ý¢Þ¢ß¢à¢á¢â¢ã¢ä¢å¢æ¢ç¢è¢é¢ê¡¦¡¦¡¦¡¦¡¦ +£´£µ£¶£·£¸£¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦£Á£Â£Ã£Ä£Å£Æ£Ç £´£µ£¶£·£¸£¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦£Á£Â£Ã£Ä£Å£Æ£Ç +£È£É£Ê£Ë£Ì£Í£Î£Ï£Ð£Ñ£Ò£Ó£Ô£Õ£Ö£×£Ø£Ù£Ú¡¦ £È£É£Ê£Ë£Ì£Í£Î£Ï£Ð£Ñ£Ò£Ó£Ô£Õ£Ö£×£Ø£Ù£Ú¡¦ +£ð£ñ£ò£ó£ô£õ£ö£÷£ø£ù£ú¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ £ð£ñ£ò£ó£ô£õ£ö£÷£ø£ù£ú¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¤´¤µ¤¶¤·¤¸¤¹¤º¤»¤¼¤½¤¾¤¿¤À¤Á¤Â¤Ã¤Ä¤Å¤Æ¤Ç ¤´¤µ¤¶¤·¤¸¤¹¤º¤»¤¼¤½¤¾¤¿¤À¤Á¤Â¤Ã¤Ä¤Å¤Æ¤Ç +¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û ¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û +¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï ¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï +¤ð¤ñ¤ò¤ó¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¤ð¤ñ¤ò¤ó¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¥´¥µ¥¶¥·¥¸¥¹¥º¥»¥¼¥½¥¾¥¿¥À¥Á¥Â¥Ã¥Ä¥Å¥Æ¥Ç ¥´¥µ¥¶¥·¥¸¥¹¥º¥»¥¼¥½¥¾¥¿¥À¥Á¥Â¥Ã¥Ä¥Å¥Æ¥Ç +¥È¥É¥Ê¥Ë¥Ì¥Í¥Î¥Ï¥Ð¥Ñ¥Ò¥Ó¥Ô¥Õ¥Ö¥×¥Ø¥Ù¥Ú¥Û ¥È¥É¥Ê¥Ë¥Ì¥Í¥Î¥Ï¥Ð¥Ñ¥Ò¥Ó¥Ô¥Õ¥Ö¥×¥Ø¥Ù¥Ú¥Û +¥Ü¥Ý¥Þ¥ß¥à¥á¥â¥ã¥ä¥å¥æ¥ç¥è¥é¥ê¥ë¥ì¥í¥î¥ï ¥Ü¥Ý¥Þ¥ß¥à¥á¥â¥ã¥ä¥å¥æ¥ç¥è¥é¥ê¥ë¥ì¥í¥î¥ï +¥ð¥ñ¥ò¥ó¥ô¥õ¥ö¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¥ð¥ñ¥ò¥ó¥ô¥õ¥ö¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¦´¦µ¦¶¦·¦¸¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¦Á¦Â¦Ã¦Ä¦Å¦Æ¦Ç ¦´¦µ¦¶¦·¦¸¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¦Á¦Â¦Ã¦Ä¦Å¦Æ¦Ç +¦È¦É¦Ê¦Ë¦Ì¦Í¦Î¦Ï¦Ð¦Ñ¦Ò¦Ó¦Ô¦Õ¦Ö¦×¦Ø¡¦¡¦¡¦ ¦È¦É¦Ê¦Ë¦Ì¦Í¦Î¦Ï¦Ð¦Ñ¦Ò¦Ó¦Ô¦Õ¦Ö¦×¦Ø¡¦¡¦¡¦ +§´§µ§¶§·§¸§¹§º§»§¼§½§¾§¿§À§Á¡¦¡¦¡¦¡¦¡¦¡¦ §´§µ§¶§·§¸§¹§º§»§¼§½§¾§¿§À§Á¡¦¡¦¡¦¡¦¡¦¡¦ +§Ü§Ý§Þ§ß§à§á§â§ã§ä§å§æ§ç§è§é§ê§ë§ì§í§î§ï §Ü§Ý§Þ§ß§à§á§â§ã§ä§å§æ§ç§è§é§ê§ë§ì§í§î§ï +§ð§ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ §ð§ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¨´¨µ¨¶¨·¨¸¨¹¨º¨»¨¼¨½¨¾¨¿¨À¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¨´¨µ¨¶¨·¨¸¨¹¨º¨»¨¼¨½¨¾¨¿¨À¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç °´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û °È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï °Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï +°ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ °ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ +ϴϵ϶ϷϸϹϺϻϼϽϾϿÏÀÏÁÏÂÏÃÏÄÏÅÏÆÏÇ Ï´ÏµÏ¶Ï·Ï¸Ï¹ÏºÏ»Ï¼Ï½Ï¾Ï¿ÏÀÏÁÏÂÏÃÏÄÏÅÏÆÏÇ +ÏÈÏÉÏÊÏËÏÌÏÍÏÎÏÏÏÐÏÑÏÒÏÓ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ÏÈÏÉÏÊÏËÏÌÏÍÏÎÏÏÏÐÏÑÏÒÏÓ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +дежзийклмнопÐÀÐÁÐÂÐÃÐÄÐÅÐÆÐÇ Ð´ÐµÐ¶Ð·Ð¸Ð¹ÐºÐ»Ð¼Ð½Ð¾Ð¿ÐÀÐÁÐÂÐÃÐÄÐÅÐÆÐÇ +ÐÈÐÉÐÊÐËÐÌÐÍÐÎÐÏÐÐÐÑÐÒÐÓÐÔÐÕÐÖÐ×ÐØÐÙÐÚÐÛ ÐÈÐÉÐÊÐËÐÌÐÍÐÎÐÏÐÐÐÑÐÒÐÓÐÔÐÕÐÖÐ×ÐØÐÙÐÚÐÛ +ÐÜÐÝÐÞÐßÐàÐáÐâÐãÐäÐåÐæÐçÐèÐéÐêÐëÐìÐíÐîÐï ÐÜÐÝÐÞÐßÐàÐáÐâÐãÐäÐåÐæÐçÐèÐéÐêÐëÐìÐíÐîÐï +ÐðÐñÐòÐóÐôÐõÐöÐ÷ÐøÐùÐúÐûÐüÐýÐþ¡¦¡¦¡¦¡¦¡¦ ÐðÐñÐòÐóÐôÐõÐöÐ÷ÐøÐùÐúÐûÐüÐýÐþ¡¦¡¦¡¦¡¦¡¦ +ó´óµó¶ó·ó¸ó¹óºó»ó¼ó½ó¾ó¿óÀóÁóÂóÃóÄóÅóÆóÇ ó´óµó¶ó·ó¸ó¹óºó»ó¼ó½ó¾ó¿óÀóÁóÂóÃóÄóÅóÆóÇ +óÈóÉóÊóËóÌóÍóÎóÏóÐóÑóÒóÓóÔóÕóÖó×óØóÙóÚóÛ óÈóÉóÊóËóÌóÍóÎóÏóÐóÑóÒóÓóÔóÕóÖó×óØóÙóÚóÛ +óÜóÝóÞóßóàóáóâóãóäóåóæóçóèóéóêóëóìóíóîóï óÜóÝóÞóßóàóáóâóãóäóåóæóçóèóéóêóëóìóíóîóï +óðóñóòóóóôóõóöó÷óøóùóúóûóüóýóþ¡¦¡¦¡¦¡¦¡¦ óðóñóòóóóôóõóöó÷óøóùóúóûóüóýóþ¡¦¡¦¡¦¡¦¡¦ +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£µ`; +£Ã£± CONVERT(`£Ã£±` using sjis) +¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡­¡®¡¯¡°¡±¡²¡³ ¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡­¡®¡¯¡°¡±¡²¡³ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦£°£±£²£³ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦£°£±£²£³ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Ñ§Ò§Ó§Ô§Õ§Ö§×§Ø§Ù§Ú§Û ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Ñ§Ò§Ó§Ô§Õ§Ö§×§Ø§Ù§Ú§Û +¡¦¡¦¡¦¡¦¡¦¡¦¢º¢»¢¼¢½¢¾¢¿¢À¢Á¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¢º¢»¢¼¢½¢¾¢¿¢À¢Á¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦£á£â£ã£ä£å£æ£ç£è£é£ê£ë£ì£í£î£ï ¡¦¡¦¡¦¡¦¡¦£á£â£ã£ä£å£æ£ç£è£é£ê£ë£ì£í£î£ï +¡¦¡¦¢Ê¢Ë¢Ì¢Í¢Î¢Ï¢Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¢Ê¢Ë¢Ì¢Í¢Î¢Ï¢Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¢ò¢ó¢ô¢õ¢ö¢÷¢ø¢ù¡¦¡¦¡¦¡¦¢þ¡¦¡¦¡¦¡¦¡¡ ¡¦¡¦¢ò¢ó¢ô¢õ¢ö¢÷¢ø¢ù¡¦¡¦¡¦¡¦¢þ¡¦¡¦¡¦¡¦¡¡ +¡¦¢¡¢¢¢£¢¤¢¥¢¦¢§¢¨¢©¢ª¢«¢¬¢­¢®¡¦¡¦¡¦¡¦¡¦ ¡¦¢¡¢¢¢£¢¤¢¥¢¦¢§¢¨¢©¢ª¢«¢¬¢­¢®¡¦¡¦¡¦¡¦¡¦ +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ ¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ +¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³ ¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³ +¡¦¦¡¦¢¦£¦¤¦¥¦¦¦§¦¨¦©¦ª¦«¦¬¦­¦®¦¯¦°¦±¦²¦³ ¡¦¦¡¦¢¦£¦¤¦¥¦¦¦§¦¨¦©¦ª¦«¦¬¦­¦®¦¯¦°¦±¦²¦³ +¡¦§¡§¢§£§¤§¥§¦§§§¨§©§ª§«§¬§­§®§¯§°§±§²§³ ¡¦§¡§¢§£§¤§¥§¦§§§¨§©§ª§«§¬§­§®§¯§°§±§²§³ +¡¦¨¡¨¢¨£¨¤¨¥¨¦¨§¨¨¨©¨ª¨«¨¬¨­¨®¨¯¨°¨±¨²¨³ ¡¦¨¡¨¢¨£¨¤¨¥¨¦¨§¨¨¨©¨ª¨«¨¬¨­¨®¨¯¨°¨±¨²¨³ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³ ¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³ +¡¦Ï¡Ï¢Ï£Ï¤Ï¥Ï¦Ï§Ï¨Ï©ÏªÏ«Ï¬Ï­Ï®Ï¯Ï°Ï±Ï²Ï³ ¡¦Ï¡Ï¢Ï£Ï¤Ï¥Ï¦Ï§Ï¨Ï©ÏªÏ«Ï¬Ï­Ï®Ï¯Ï°Ï±Ï²Ï³ +¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³ ¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³ +¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³ ¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³ +¡¦ô¡ô¢ô£ô¤ô¥ô¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦ô¡ô¢ô£ô¤ô¥ô¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç ¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿\¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç +¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û ¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û +¡Ü¡¾¡Þ¡ß¡à¡á¡â¡ã¡ä¡å¡æ¡ç¡è¡é¡ê¡ë¡ì¡í¡î¡ï ¡Ü¡¾¡Þ¡ß¡à¡á¡â¡ã¡ä¡å¡æ¡ç¡è¡é¡ê¡ë¡ì¡í¡î¡ï +¡ð¡ñ¡ò¡ó¡ô¡õ¡ö¡÷¡ø¡ù¡ú¡û¡ü¡ý¡þ¡¦¡¦¡¦¡¦¡¦ ¡ð¡ñ¡ò¡ó¡ô¡õ¡ö¡÷¡ø¡ù¡ú¡û¡ü¡ý¡þ¡¦¡¦¡¦¡¦¡¦ +¢Ü¢Ý¢Þ¢ß¢à¢á¢â¢ã¢ä¢å¢æ¢ç¢è¢é¢ê¡¦¡¦¡¦¡¦¡¦ ¢Ü¢Ý¢Þ¢ß¢à¢á¢â¢ã¢ä¢å¢æ¢ç¢è¢é¢ê¡¦¡¦¡¦¡¦¡¦ +£´£µ£¶£·£¸£¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦£Á£Â£Ã£Ä£Å£Æ£Ç £´£µ£¶£·£¸£¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦£Á£Â£Ã£Ä£Å£Æ£Ç +£È£É£Ê£Ë£Ì£Í£Î£Ï£Ð£Ñ£Ò£Ó£Ô£Õ£Ö£×£Ø£Ù£Ú¡¦ £È£É£Ê£Ë£Ì£Í£Î£Ï£Ð£Ñ£Ò£Ó£Ô£Õ£Ö£×£Ø£Ù£Ú¡¦ +£ð£ñ£ò£ó£ô£õ£ö£÷£ø£ù£ú¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ £ð£ñ£ò£ó£ô£õ£ö£÷£ø£ù£ú¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¤´¤µ¤¶¤·¤¸¤¹¤º¤»¤¼¤½¤¾¤¿¤À¤Á¤Â¤Ã¤Ä¤Å¤Æ¤Ç ¤´¤µ¤¶¤·¤¸¤¹¤º¤»¤¼¤½¤¾¤¿¤À¤Á¤Â¤Ã¤Ä¤Å¤Æ¤Ç +¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û ¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û +¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï ¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï +¤ð¤ñ¤ò¤ó¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¤ð¤ñ¤ò¤ó¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¥´¥µ¥¶¥·¥¸¥¹¥º¥»¥¼¥½¥¾¥¿¥À¥Á¥Â¥Ã¥Ä¥Å¥Æ¥Ç ¥´¥µ¥¶¥·¥¸¥¹¥º¥»¥¼¥½¥¾¥¿¥À¥Á¥Â¥Ã¥Ä¥Å¥Æ¥Ç +¥È¥É¥Ê¥Ë¥Ì¥Í¥Î¥Ï¥Ð¥Ñ¥Ò¥Ó¥Ô¥Õ¥Ö¥×¥Ø¥Ù¥Ú¥Û ¥È¥É¥Ê¥Ë¥Ì¥Í¥Î¥Ï¥Ð¥Ñ¥Ò¥Ó¥Ô¥Õ¥Ö¥×¥Ø¥Ù¥Ú¥Û +¥Ü¥Ý¥Þ¥ß¥à¥á¥â¥ã¥ä¥å¥æ¥ç¥è¥é¥ê¥ë¥ì¥í¥î¥ï ¥Ü¥Ý¥Þ¥ß¥à¥á¥â¥ã¥ä¥å¥æ¥ç¥è¥é¥ê¥ë¥ì¥í¥î¥ï +¥ð¥ñ¥ò¥ó¥ô¥õ¥ö¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¥ð¥ñ¥ò¥ó¥ô¥õ¥ö¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¦´¦µ¦¶¦·¦¸¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¦Á¦Â¦Ã¦Ä¦Å¦Æ¦Ç ¦´¦µ¦¶¦·¦¸¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¦Á¦Â¦Ã¦Ä¦Å¦Æ¦Ç +¦È¦É¦Ê¦Ë¦Ì¦Í¦Î¦Ï¦Ð¦Ñ¦Ò¦Ó¦Ô¦Õ¦Ö¦×¦Ø¡¦¡¦¡¦ ¦È¦É¦Ê¦Ë¦Ì¦Í¦Î¦Ï¦Ð¦Ñ¦Ò¦Ó¦Ô¦Õ¦Ö¦×¦Ø¡¦¡¦¡¦ +§´§µ§¶§·§¸§¹§º§»§¼§½§¾§¿§À§Á¡¦¡¦¡¦¡¦¡¦¡¦ §´§µ§¶§·§¸§¹§º§»§¼§½§¾§¿§À§Á¡¦¡¦¡¦¡¦¡¦¡¦ +§Ü§Ý§Þ§ß§à§á§â§ã§ä§å§æ§ç§è§é§ê§ë§ì§í§î§ï §Ü§Ý§Þ§ß§à§á§â§ã§ä§å§æ§ç§è§é§ê§ë§ì§í§î§ï +§ð§ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ §ð§ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¨´¨µ¨¶¨·¨¸¨¹¨º¨»¨¼¨½¨¾¨¿¨À¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¨´¨µ¨¶¨·¨¸¨¹¨º¨»¨¼¨½¨¾¨¿¨À¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç °´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û °È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï °Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï +°ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ °ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ +ϴϵ϶ϷϸϹϺϻϼϽϾϿÏÀÏÁÏÂÏÃÏÄÏÅÏÆÏÇ Ï´ÏµÏ¶Ï·Ï¸Ï¹ÏºÏ»Ï¼Ï½Ï¾Ï¿ÏÀÏÁÏÂÏÃÏÄÏÅÏÆÏÇ +ÏÈÏÉÏÊÏËÏÌÏÍÏÎÏÏÏÐÏÑÏÒÏÓ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ÏÈÏÉÏÊÏËÏÌÏÍÏÎÏÏÏÐÏÑÏÒÏÓ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +дежзийклмнопÐÀÐÁÐÂÐÃÐÄÐÅÐÆÐÇ Ð´ÐµÐ¶Ð·Ð¸Ð¹ÐºÐ»Ð¼Ð½Ð¾Ð¿ÐÀÐÁÐÂÐÃÐÄÐÅÐÆÐÇ +ÐÈÐÉÐÊÐËÐÌÐÍÐÎÐÏÐÐÐÑÐÒÐÓÐÔÐÕÐÖÐ×ÐØÐÙÐÚÐÛ ÐÈÐÉÐÊÐËÐÌÐÍÐÎÐÏÐÐÐÑÐÒÐÓÐÔÐÕÐÖÐ×ÐØÐÙÐÚÐÛ +ÐÜÐÝÐÞÐßÐàÐáÐâÐãÐäÐåÐæÐçÐèÐéÐêÐëÐìÐíÐîÐï ÐÜÐÝÐÞÐßÐàÐáÐâÐãÐäÐåÐæÐçÐèÐéÐêÐëÐìÐíÐîÐï +ÐðÐñÐòÐóÐôÐõÐöÐ÷ÐøÐùÐúÐûÐüÐýÐþ¡¦¡¦¡¦¡¦¡¦ ÐðÐñÐòÐóÐôÐõÐöÐ÷ÐøÐùÐúÐûÐüÐýÐþ¡¦¡¦¡¦¡¦¡¦ +ó´óµó¶ó·ó¸ó¹óºó»ó¼ó½ó¾ó¿óÀóÁóÂóÃóÄóÅóÆóÇ ó´óµó¶ó·ó¸ó¹óºó»ó¼ó½ó¾ó¿óÀóÁóÂóÃóÄóÅóÆóÇ +óÈóÉóÊóËóÌóÍóÎóÏóÐóÑóÒóÓóÔóÕóÖó×óØóÙóÚóÛ óÈóÉóÊóËóÌóÍóÎóÏóÐóÑóÒóÓóÔóÕóÖó×óØóÙóÚóÛ +óÜóÝóÞóßóàóáóâóãóäóåóæóçóèóéóêóëóìóíóîóï óÜóÝóÞóßóàóáóâóãóäóåóæóçóèóéóêóëóìóíóîóï +óðóñóòóóóôóõóöó÷óøóùóúóûóüóýóþ¡¦¡¦¡¦¡¦¡¦ óðóñóòóóóôóõóöó÷óøóùóúóûóüóýóþ¡¦¡¦¡¦¡¦¡¦ +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£¶`; +£Ã£± CONVERT(`£Ã£±` using utf8) +¢ð¢ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¢ð¢ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +§È§É§Ê§Ë§Ì§Í§Î¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ §È§É§Ê§Ë§Ì§Í§Î¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +©È©É©Ê©Ë©Ì©Í©Î©Ï©Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ©È©É©Ê©Ë©Ì©Í©Î©Ï©Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +ª´ªµª¶ª·ª¸¡¦ªºª»ª¼ª½ª¾ª¿ªÀªÁªÂªÃªÄªÅªÆªÇ ª´ªµª¶ª·ª¸¡¦ªºª»ª¼ª½ª¾ª¿ªÀªÁªÂªÃªÄªÅªÆªÇ +ªÈªÉªÊªËªÌªÍªÎªÏªÐªÑªÒªÓªÔªÕªÖª×ªØªÙªÚªÛ ªÈªÉªÊªËªÌªÍªÎªÏªÐªÑªÒªÓªÔªÕªÖª×ªØªÙªÚªÛ +ªÜªÝªÞªßªàªáªâªãªäªåªæªçªèªéªêªëªìªíªîªï ªÜªÝªÞªßªàªáªâªãªäªåªæªçªèªéªêªëªìªíªîªï +ªðªñªòªóªôªõªöª÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ªðªñªòªóªôªõªöª÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +«´«µ«¶«·«¸«¹«º«»¡¦«½«¾«¿«À«Á«Â«Ã¡¦«Å«Æ«Ç «´«µ«¶«·«¸«¹«º«»¡¦«½«¾«¿«À«Á«Â«Ã¡¦«Å«Æ«Ç +«È«É«Ê«Ë«Ì«Í«Î«Ï«Ð«Ñ«Ò«Ó«Ô«Õ«Ö«×«Ø«Ù«Ú«Û «È«É«Ê«Ë«Ì«Í«Î«Ï«Ð«Ñ«Ò«Ó«Ô«Õ«Ö«×«Ø«Ù«Ú«Û +«Ü«Ý«Þ«ß«à«á«â«ã«ä«å«æ«ç«è«é«ê«ë«ì«í«î«ï «Ü«Ý«Þ«ß«à«á«â«ã«ä«å«æ«ç«è«é«ê«ë«ì«í«î«ï +«ð«ñ«ò«ó«ô«õ«ö«÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ «ð«ñ«ò«ó«ô«õ«ö«÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç °´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û °È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï °Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï +°ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ °ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ +íÜíÝíÞíßíàíáíâí㡦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ íÜíÝíÞíßíàíáíâí㡦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ ¡¦¢µ¢¶~¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ +¡¦¦ñ¦ò¦ó¦ô¦õ¦ö¦÷¦ø¦ù¦ú¦û¦ü¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¦ñ¦ò¦ó¦ô¦õ¦ö¦÷¦ø¦ù¦ú¦û¦ü¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦©¡©¢¡¦©¤¡¦©¦¡¦©¨©©¡¦©«©¬©­¡¦©¯©°¡¦¡¦¡¦ ¡¦©¡©¢¡¦©¤¡¦©¦¡¦©¨©©¡¦©«©¬©­¡¦©¯©°¡¦¡¦¡¦ +¡¦ª¡ª¢ª£ª¤ª¥ª¦ª§ª¨ª©ªªª«ª¬ª­ª®ª¯ª°ª±ª²ª³ ¡¦ª¡ª¢ª£ª¤ª¥ª¦ª§ª¨ª©ªªª«ª¬ª­ª®ª¯ª°ª±ª²ª³ +¡¦«¡«¢«£«¤«¥«¦«§«¨«©«ª«««¬«­«®«¯«°«±«²«³ ¡¦«¡«¢«£«¤«¥«¦«§«¨«©«ª«««¬«­«®«¯«°«±«²«³ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³ ¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³ +¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³ ¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³ +¡¦¡¦§ò§ó§ô§õ§ö§÷§ø§ù§ú§û§ü§ý§þ¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦§ò§ó§ô§õ§ö§÷§ø§ù§ú§û§ü§ý§þ¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¦á¦â¦ã¦ä¦å¡¦¦ç¡¦¦é¦ê¡¦¦ì¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¦á¦â¦ã¦ä¦å¡¦¦ç¡¦¦é¦ê¡¦¦ì¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦©Á©Â©Ã©Ä©Å©Æ©Ç ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦©Á©Â©Ã©Ä©Å©Æ©Ç +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Â§Ã§Ä§Å§Æ§Ç ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Â§Ã§Ä§Å§Æ§Ç +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢¯¢°¢±¢²¢³ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢¯¢°¢±¢²¢³ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢ë¢ì¢í¢î¢ï ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢ë¢ì¢í¢î¢ï +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£¶`; +£Ã£± CONVERT(`£Ã£±` using ucs2) +¢ð¢ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¢ð¢ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +§È§É§Ê§Ë§Ì§Í§Î¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ §È§É§Ê§Ë§Ì§Í§Î¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +©È©É©Ê©Ë©Ì©Í©Î©Ï©Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ©È©É©Ê©Ë©Ì©Í©Î©Ï©Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +ª´ªµª¶ª·ª¸¡¦ªºª»ª¼ª½ª¾ª¿ªÀªÁªÂªÃªÄªÅªÆªÇ ª´ªµª¶ª·ª¸¡¦ªºª»ª¼ª½ª¾ª¿ªÀªÁªÂªÃªÄªÅªÆªÇ +ªÈªÉªÊªËªÌªÍªÎªÏªÐªÑªÒªÓªÔªÕªÖª×ªØªÙªÚªÛ ªÈªÉªÊªËªÌªÍªÎªÏªÐªÑªÒªÓªÔªÕªÖª×ªØªÙªÚªÛ +ªÜªÝªÞªßªàªáªâªãªäªåªæªçªèªéªêªëªìªíªîªï ªÜªÝªÞªßªàªáªâªãªäªåªæªçªèªéªêªëªìªíªîªï +ªðªñªòªóªôªõªöª÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ªðªñªòªóªôªõªöª÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +«´«µ«¶«·«¸«¹«º«»¡¦«½«¾«¿«À«Á«Â«Ã¡¦«Å«Æ«Ç «´«µ«¶«·«¸«¹«º«»¡¦«½«¾«¿«À«Á«Â«Ã¡¦«Å«Æ«Ç +«È«É«Ê«Ë«Ì«Í«Î«Ï«Ð«Ñ«Ò«Ó«Ô«Õ«Ö«×«Ø«Ù«Ú«Û «È«É«Ê«Ë«Ì«Í«Î«Ï«Ð«Ñ«Ò«Ó«Ô«Õ«Ö«×«Ø«Ù«Ú«Û +«Ü«Ý«Þ«ß«à«á«â«ã«ä«å«æ«ç«è«é«ê«ë«ì«í«î«ï «Ü«Ý«Þ«ß«à«á«â«ã«ä«å«æ«ç«è«é«ê«ë«ì«í«î«ï +«ð«ñ«ò«ó«ô«õ«ö«÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ «ð«ñ«ò«ó«ô«õ«ö«÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç °´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û °È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï °Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï +°ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ °ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ +íÜíÝíÞíßíàíáíâí㡦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ íÜíÝíÞíßíàíáíâí㡦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ ¡¦¢µ¢¶~¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ +¡¦¦ñ¦ò¦ó¦ô¦õ¦ö¦÷¦ø¦ù¦ú¦û¦ü¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¦ñ¦ò¦ó¦ô¦õ¦ö¦÷¦ø¦ù¦ú¦û¦ü¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦©¡©¢¡¦©¤¡¦©¦¡¦©¨©©¡¦©«©¬©­¡¦©¯©°¡¦¡¦¡¦ ¡¦©¡©¢¡¦©¤¡¦©¦¡¦©¨©©¡¦©«©¬©­¡¦©¯©°¡¦¡¦¡¦ +¡¦ª¡ª¢ª£ª¤ª¥ª¦ª§ª¨ª©ªªª«ª¬ª­ª®ª¯ª°ª±ª²ª³ ¡¦ª¡ª¢ª£ª¤ª¥ª¦ª§ª¨ª©ªªª«ª¬ª­ª®ª¯ª°ª±ª²ª³ +¡¦«¡«¢«£«¤«¥«¦«§«¨«©«ª«««¬«­«®«¯«°«±«²«³ ¡¦«¡«¢«£«¤«¥«¦«§«¨«©«ª«««¬«­«®«¯«°«±«²«³ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³ ¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³ +¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³ ¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³ +¡¦¡¦§ò§ó§ô§õ§ö§÷§ø§ù§ú§û§ü§ý§þ¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦§ò§ó§ô§õ§ö§÷§ø§ù§ú§û§ü§ý§þ¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¦á¦â¦ã¦ä¦å¡¦¦ç¡¦¦é¦ê¡¦¦ì¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¦á¦â¦ã¦ä¦å¡¦¦ç¡¦¦é¦ê¡¦¦ì¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦©Á©Â©Ã©Ä©Å©Æ©Ç ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦©Á©Â©Ã©Ä©Å©Æ©Ç +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Â§Ã§Ä§Å§Æ§Ç ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Â§Ã§Ä§Å§Æ§Ç +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢¯¢°¢±¢²¢³ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢¯¢°¢±¢²¢³ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢ë¢ì¢í¢î¢ï ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢ë¢ì¢í¢î¢ï +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£¶`; +£Ã£± CONVERT(`£Ã£±` using sjis) +¢ð¢ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ??¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +§È§É§Ê§Ë§Ì§Í§Î¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ???????¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +©È©É©Ê©Ë©Ì©Í©Î©Ï©Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ?????????¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +ª´ªµª¶ª·ª¸¡¦ªºª»ª¼ª½ª¾ª¿ªÀªÁªÂªÃªÄªÅªÆªÇ ?????¡¦?????????????? +ªÈªÉªÊªËªÌªÍªÎªÏªÐªÑªÒªÓªÔªÕªÖª×ªØªÙªÚªÛ ???????????????????? +ªÜªÝªÞªßªàªáªâªãªäªåªæªçªèªéªêªëªìªíªîªï ???????????????????? +ªðªñªòªóªôªõªöª÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ????????¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +«´«µ«¶«·«¸«¹«º«»¡¦«½«¾«¿«À«Á«Â«Ã¡¦«Å«Æ«Ç ????????¡¦???????¡¦??? +«È«É«Ê«Ë«Ì«Í«Î«Ï«Ð«Ñ«Ò«Ó«Ô«Õ«Ö«×«Ø«Ù«Ú«Û ???????????????????? +«Ü«Ý«Þ«ß«à«á«â«ã«ä«å«æ«ç«è«é«ê«ë«ì«í«î«ï ???????????????????? +«ð«ñ«ò«ó«ô«õ«ö«÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ????????¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç ???????????????????? +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û ???????????????????? +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï ???????????????????? +°ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ ???????????????¡¦¡¦¡¦¡¦¡¦ +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ ???????????????????? +íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ ???????????????????? +íÜíÝíÞíßíàíáíâí㡦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ????????¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ ¡¦??~??¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦???¡¦¡¦¡¦ +¡¦¦ñ¦ò¦ó¦ô¦õ¦ö¦÷¦ø¦ù¦ú¦û¦ü¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦????????????¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦©¡©¢¡¦©¤¡¦©¦¡¦©¨©©¡¦©«©¬©­¡¦©¯©°¡¦¡¦¡¦ ¡¦??¡¦?¡¦?¡¦??¡¦???¡¦??¡¦¡¦¡¦ +¡¦ª¡ª¢ª£ª¤ª¥ª¦ª§ª¨ª©ªªª«ª¬ª­ª®ª¯ª°ª±ª²ª³ ¡¦??????????????????? +¡¦«¡«¢«£«¤«¥«¦«§«¨«©«ª«««¬«­«®«¯«°«±«²«³ ¡¦??????????????????? +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³ ¡¦??????????????????? +¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³ ¡¦??????????????????? +¡¦¡¦§ò§ó§ô§õ§ö§÷§ø§ù§ú§û§ü§ý§þ¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦?????????????¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¦á¦â¦ã¦ä¦å¡¦¦ç¡¦¦é¦ê¡¦¦ì¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦?????¡¦?¡¦??¡¦?¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦©Á©Â©Ã©Ä©Å©Æ©Ç ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦??????? +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Â§Ã§Ä§Å§Æ§Ç ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦?????? +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢¯¢°¢±¢²¢³ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦????? +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢ë¢ì¢í¢î¢ï ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦????? +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£·`; +£Ã£± CONVERT(`£Ã£±` using utf8) + !"#$%&'()*+,-./ !"#$%&'()*+,-./ +0123456789:;<=>? 0123456789:;<=>? +@ABCDEFGHIJKLMNO @ABCDEFGHIJKLMNO +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[\]^_ +abcdefghijklmno abcdefghijklmno +pqrstuvwxyz{|}~ pqrstuvwxyz{|}~ + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯ Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯ +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ +ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£·`; +£Ã£± CONVERT(`£Ã£±` using ucs2) + !"#$%&'()*+,-./ !"#$%&'()*+,-./ +0123456789:;<=>? 0123456789:;<=>? +@ABCDEFGHIJKLMNO @ABCDEFGHIJKLMNO +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[\]^_ +abcdefghijklmno abcdefghijklmno +pqrstuvwxyz{|}~ pqrstuvwxyz{|}~ + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯ Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯ +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ +ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£·`; +£Ã£± CONVERT(`£Ã£±` using sjis) + !"#$%&'()*+,-./ !"#$%&'()*+,-./ +0123456789:;<=>? 0123456789:;<=>? +@ABCDEFGHIJKLMNO @ABCDEFGHIJKLMNO +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[\]^_ +abcdefghijklmno abcdefghijklmno +pqrstuvwxyz{|}~ pqrstuvwxyz{|}~ + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯ Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯ +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ +ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£¸`; +£Ã£± CONVERT(`£Ã£±` using utf8) +¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡­¡®¡¯¡°¡±¡²¡³ ¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡­¡®¡¯¡°¡±¡²¡³ +¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç ¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿\¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç +¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û ¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û +¡Ü¡¾¡Þ¡ß¡à¡á¡â¡ã¡ä¡å¡æ¡ç¡è¡é¡ê¡ë¡ì¡í¡î¡ï ¡Ü¡¾¡Þ¡ß¡à¡á¡â¡ã¡ä¡å¡æ¡ç¡è¡é¡ê¡ë¡ì¡í¡î¡ï +¡ð¡ñ¡ò¡ó¡ô¡õ¡ö¡÷¡ø¡ù¡ú¡û¡ü¡ý¡þ¡¦¡¦¡¦¡¦¡¦ ¡ð¡ñ¡ò¡ó¡ô¡õ¡ö¡÷¡ø¡ù¡ú¡û¡ü¡ý¡þ¡¦¡¦¡¦¡¦¡¦ +¡¦¢¡¢¢¢£¢¤¢¥¢¦¢§¢¨¢©¢ª¢«¢¬¢­¢®¡¦¡¦¡¦¡¦¡¦ ¡¦¢¡¢¢¢£¢¤¢¥¢¦¢§¢¨¢©¢ª¢«¢¬¢­¢®¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¢º¢»¢¼¢½¢¾¢¿¢À¢Á¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¢º¢»¢¼¢½¢¾¢¿¢À¢Á¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¢Ê¢Ë¢Ì¢Í¢Î¢Ï¢Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¢Ê¢Ë¢Ì¢Í¢Î¢Ï¢Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¢Ü¢Ý¢Þ¢ß¢à¢á¢â¢ã¢ä¢å¢æ¢ç¢è¢é¢ê¡¦¡¦¡¦¡¦¡¦ ¢Ü¢Ý¢Þ¢ß¢à¢á¢â¢ã¢ä¢å¢æ¢ç¢è¢é¢ê¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¢ò¢ó¢ô¢õ¢ö¢÷¢ø¢ù¡¦¡¦¡¦¡¦¢þ¡¦¡¦¡¦¡¦¡¡ ¡¦¡¦¢ò¢ó¢ô¢õ¢ö¢÷¢ø¢ù¡¦¡¦¡¦¡¦¢þ¡¦¡¦¡¦¡¦¡¡ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦£°£±£²£³ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦£°£±£²£³ +£´£µ£¶£·£¸£¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦£Á£Â£Ã£Ä£Å£Æ£Ç £´£µ£¶£·£¸£¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦£Á£Â£Ã£Ä£Å£Æ£Ç +£È£É£Ê£Ë£Ì£Í£Î£Ï£Ð£Ñ£Ò£Ó£Ô£Õ£Ö£×£Ø£Ù£Ú¡¦ £È£É£Ê£Ë£Ì£Í£Î£Ï£Ð£Ñ£Ò£Ó£Ô£Õ£Ö£×£Ø£Ù£Ú¡¦ +¡¦¡¦¡¦¡¦¡¦£á£â£ã£ä£å£æ£ç£è£é£ê£ë£ì£í£î£ï ¡¦¡¦¡¦¡¦¡¦£á£â£ã£ä£å£æ£ç£è£é£ê£ë£ì£í£î£ï +£ð£ñ£ò£ó£ô£õ£ö£÷£ø£ù£ú¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ £ð£ñ£ò£ó£ô£õ£ö£÷£ø£ù£ú¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ ¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ +¤´¤µ¤¶¤·¤¸¤¹¤º¤»¤¼¤½¤¾¤¿¤À¤Á¤Â¤Ã¤Ä¤Å¤Æ¤Ç ¤´¤µ¤¶¤·¤¸¤¹¤º¤»¤¼¤½¤¾¤¿¤À¤Á¤Â¤Ã¤Ä¤Å¤Æ¤Ç +¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û ¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û +¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï ¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï +¤ð¤ñ¤ò¤ó¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¤ð¤ñ¤ò¤ó¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³ ¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³ +¥´¥µ¥¶¥·¥¸¥¹¥º¥»¥¼¥½¥¾¥¿¥À¥Á¥Â¥Ã¥Ä¥Å¥Æ¥Ç ¥´¥µ¥¶¥·¥¸¥¹¥º¥»¥¼¥½¥¾¥¿¥À¥Á¥Â¥Ã¥Ä¥Å¥Æ¥Ç +¥È¥É¥Ê¥Ë¥Ì¥Í¥Î¥Ï¥Ð¥Ñ¥Ò¥Ó¥Ô¥Õ¥Ö¥×¥Ø¥Ù¥Ú¥Û ¥È¥É¥Ê¥Ë¥Ì¥Í¥Î¥Ï¥Ð¥Ñ¥Ò¥Ó¥Ô¥Õ¥Ö¥×¥Ø¥Ù¥Ú¥Û +¥Ü¥Ý¥Þ¥ß¥à¥á¥â¥ã¥ä¥å¥æ¥ç¥è¥é¥ê¥ë¥ì¥í¥î¥ï ¥Ü¥Ý¥Þ¥ß¥à¥á¥â¥ã¥ä¥å¥æ¥ç¥è¥é¥ê¥ë¥ì¥í¥î¥ï +¥ð¥ñ¥ò¥ó¥ô¥õ¥ö¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¥ð¥ñ¥ò¥ó¥ô¥õ¥ö¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¦¡¦¢¦£¦¤¦¥¦¦¦§¦¨¦©¦ª¦«¦¬¦­¦®¦¯¦°¦±¦²¦³ ¡¦¦¡¦¢¦£¦¤¦¥¦¦¦§¦¨¦©¦ª¦«¦¬¦­¦®¦¯¦°¦±¦²¦³ +¦´¦µ¦¶¦·¦¸¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¦Á¦Â¦Ã¦Ä¦Å¦Æ¦Ç ¦´¦µ¦¶¦·¦¸¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¦Á¦Â¦Ã¦Ä¦Å¦Æ¦Ç +¦È¦É¦Ê¦Ë¦Ì¦Í¦Î¦Ï¦Ð¦Ñ¦Ò¦Ó¦Ô¦Õ¦Ö¦×¦Ø¡¦¡¦¡¦ ¦È¦É¦Ê¦Ë¦Ì¦Í¦Î¦Ï¦Ð¦Ñ¦Ò¦Ó¦Ô¦Õ¦Ö¦×¦Ø¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦§¡§¢§£§¤§¥§¦§§§¨§©§ª§«§¬§­§®§¯§°§±§²§³ ¡¦§¡§¢§£§¤§¥§¦§§§¨§©§ª§«§¬§­§®§¯§°§±§²§³ +§´§µ§¶§·§¸§¹§º§»§¼§½§¾§¿§À§Á¡¦¡¦¡¦¡¦¡¦¡¦ §´§µ§¶§·§¸§¹§º§»§¼§½§¾§¿§À§Á¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Ñ§Ò§Ó§Ô§Õ§Ö§×§Ø§Ù§Ú§Û ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Ñ§Ò§Ó§Ô§Õ§Ö§×§Ø§Ù§Ú§Û +§Ü§Ý§Þ§ß§à§á§â§ã§ä§å§æ§ç§è§é§ê§ë§ì§í§î§ï §Ü§Ý§Þ§ß§à§á§â§ã§ä§å§æ§ç§è§é§ê§ë§ì§í§î§ï +§ð§ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ §ð§ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¨¡¨¢¨£¨¤¨¥¨¦¨§¨¨¨©¨ª¨«¨¬¨­¨®¨¯¨°¨±¨²¨³ ¡¦¨¡¨¢¨£¨¤¨¥¨¦¨§¨¨¨©¨ª¨«¨¬¨­¨®¨¯¨°¨±¨²¨³ +¨´¨µ¨¶¨·¨¸¨¹¨º¨»¨¼¨½¨¾¨¿¨À¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¨´¨µ¨¶¨·¨¸¨¹¨º¨»¨¼¨½¨¾¨¿¨À¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³ ¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç °´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û °È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï °Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï +°ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ °ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ +¡¦Ï¡Ï¢Ï£Ï¤Ï¥Ï¦Ï§Ï¨Ï©ÏªÏ«Ï¬Ï­Ï®Ï¯Ï°Ï±Ï²Ï³ ¡¦Ï¡Ï¢Ï£Ï¤Ï¥Ï¦Ï§Ï¨Ï©ÏªÏ«Ï¬Ï­Ï®Ï¯Ï°Ï±Ï²Ï³ +ϴϵ϶ϷϸϹϺϻϼϽϾϿÏÀÏÁÏÂÏÃÏÄÏÅÏÆÏÇ Ï´ÏµÏ¶Ï·Ï¸Ï¹ÏºÏ»Ï¼Ï½Ï¾Ï¿ÏÀÏÁÏÂÏÃÏÄÏÅÏÆÏÇ +ÏÈÏÉÏÊÏËÏÌÏÍÏÎÏÏÏÐÏÑÏÒÏÓ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ÏÈÏÉÏÊÏËÏÌÏÍÏÎÏÏÏÐÏÑÏÒÏÓ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³ ¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³ +дежзийклмнопÐÀÐÁÐÂÐÃÐÄÐÅÐÆÐÇ Ð´ÐµÐ¶Ð·Ð¸Ð¹ÐºÐ»Ð¼Ð½Ð¾Ð¿ÐÀÐÁÐÂÐÃÐÄÐÅÐÆÐÇ +ÐÈÐÉÐÊÐËÐÌÐÍÐÎÐÏÐÐÐÑÐÒÐÓÐÔÐÕÐÖÐ×ÐØÐÙÐÚÐÛ ÐÈÐÉÐÊÐËÐÌÐÍÐÎÐÏÐÐÐÑÐÒÐÓÐÔÐÕÐÖÐ×ÐØÐÙÐÚÐÛ +ÐÜÐÝÐÞÐßÐàÐáÐâÐãÐäÐåÐæÐçÐèÐéÐêÐëÐìÐíÐîÐï ÐÜÐÝÐÞÐßÐàÐáÐâÐãÐäÐåÐæÐçÐèÐéÐêÐëÐìÐíÐîÐï +ÐðÐñÐòÐóÐôÐõÐöÐ÷ÐøÐùÐúÐûÐüÐýÐþ¡¦¡¦¡¦¡¦¡¦ ÐðÐñÐòÐóÐôÐõÐöÐ÷ÐøÐùÐúÐûÐüÐýÐþ¡¦¡¦¡¦¡¦¡¦ +¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³ ¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³ +ó´óµó¶ó·ó¸ó¹óºó»ó¼ó½ó¾ó¿óÀóÁóÂóÃóÄóÅóÆóÇ ó´óµó¶ó·ó¸ó¹óºó»ó¼ó½ó¾ó¿óÀóÁóÂóÃóÄóÅóÆóÇ +óÈóÉóÊóËóÌóÍóÎóÏóÐóÑóÒóÓóÔóÕóÖó×óØóÙóÚóÛ óÈóÉóÊóËóÌóÍóÎóÏóÐóÑóÒóÓóÔóÕóÖó×óØóÙóÚóÛ +óÜóÝóÞóßóàóáóâóãóäóåóæóçóèóéóêóëóìóíóîóï óÜóÝóÞóßóàóáóâóãóäóåóæóçóèóéóêóëóìóíóîóï +óðóñóòóóóôóõóöó÷óøóùóúóûóüóýóþ¡¦¡¦¡¦¡¦¡¦ óðóñóòóóóôóõóöó÷óøóùóúóûóüóýóþ¡¦¡¦¡¦¡¦¡¦ +¡¦ô¡ô¢ô£ô¤ô¥ô¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦ô¡ô¢ô£ô¤ô¥ô¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£¸`; +£Ã£± CONVERT(`£Ã£±` using ucs2) +¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡­¡®¡¯¡°¡±¡²¡³ ¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡­¡®¡¯¡°¡±¡²¡³ +¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç ¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿\¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç +¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û ¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û +¡Ü¡¾¡Þ¡ß¡à¡á¡â¡ã¡ä¡å¡æ¡ç¡è¡é¡ê¡ë¡ì¡í¡î¡ï ¡Ü¡¾¡Þ¡ß¡à¡á¡â¡ã¡ä¡å¡æ¡ç¡è¡é¡ê¡ë¡ì¡í¡î¡ï +¡ð¡ñ¡ò¡ó¡ô¡õ¡ö¡÷¡ø¡ù¡ú¡û¡ü¡ý¡þ¡¦¡¦¡¦¡¦¡¦ ¡ð¡ñ¡ò¡ó¡ô¡õ¡ö¡÷¡ø¡ù¡ú¡û¡ü¡ý¡þ¡¦¡¦¡¦¡¦¡¦ +¡¦¢¡¢¢¢£¢¤¢¥¢¦¢§¢¨¢©¢ª¢«¢¬¢­¢®¡¦¡¦¡¦¡¦¡¦ ¡¦¢¡¢¢¢£¢¤¢¥¢¦¢§¢¨¢©¢ª¢«¢¬¢­¢®¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¢º¢»¢¼¢½¢¾¢¿¢À¢Á¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¢º¢»¢¼¢½¢¾¢¿¢À¢Á¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¢Ê¢Ë¢Ì¢Í¢Î¢Ï¢Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¢Ê¢Ë¢Ì¢Í¢Î¢Ï¢Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¢Ü¢Ý¢Þ¢ß¢à¢á¢â¢ã¢ä¢å¢æ¢ç¢è¢é¢ê¡¦¡¦¡¦¡¦¡¦ ¢Ü¢Ý¢Þ¢ß¢à¢á¢â¢ã¢ä¢å¢æ¢ç¢è¢é¢ê¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¢ò¢ó¢ô¢õ¢ö¢÷¢ø¢ù¡¦¡¦¡¦¡¦¢þ¡¦¡¦¡¦¡¦¡¡ ¡¦¡¦¢ò¢ó¢ô¢õ¢ö¢÷¢ø¢ù¡¦¡¦¡¦¡¦¢þ¡¦¡¦¡¦¡¦¡¡ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦£°£±£²£³ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦£°£±£²£³ +£´£µ£¶£·£¸£¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦£Á£Â£Ã£Ä£Å£Æ£Ç £´£µ£¶£·£¸£¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦£Á£Â£Ã£Ä£Å£Æ£Ç +£È£É£Ê£Ë£Ì£Í£Î£Ï£Ð£Ñ£Ò£Ó£Ô£Õ£Ö£×£Ø£Ù£Ú¡¦ £È£É£Ê£Ë£Ì£Í£Î£Ï£Ð£Ñ£Ò£Ó£Ô£Õ£Ö£×£Ø£Ù£Ú¡¦ +¡¦¡¦¡¦¡¦¡¦£á£â£ã£ä£å£æ£ç£è£é£ê£ë£ì£í£î£ï ¡¦¡¦¡¦¡¦¡¦£á£â£ã£ä£å£æ£ç£è£é£ê£ë£ì£í£î£ï +£ð£ñ£ò£ó£ô£õ£ö£÷£ø£ù£ú¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ £ð£ñ£ò£ó£ô£õ£ö£÷£ø£ù£ú¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ ¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ +¤´¤µ¤¶¤·¤¸¤¹¤º¤»¤¼¤½¤¾¤¿¤À¤Á¤Â¤Ã¤Ä¤Å¤Æ¤Ç ¤´¤µ¤¶¤·¤¸¤¹¤º¤»¤¼¤½¤¾¤¿¤À¤Á¤Â¤Ã¤Ä¤Å¤Æ¤Ç +¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û ¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û +¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï ¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï +¤ð¤ñ¤ò¤ó¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¤ð¤ñ¤ò¤ó¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³ ¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³ +¥´¥µ¥¶¥·¥¸¥¹¥º¥»¥¼¥½¥¾¥¿¥À¥Á¥Â¥Ã¥Ä¥Å¥Æ¥Ç ¥´¥µ¥¶¥·¥¸¥¹¥º¥»¥¼¥½¥¾¥¿¥À¥Á¥Â¥Ã¥Ä¥Å¥Æ¥Ç +¥È¥É¥Ê¥Ë¥Ì¥Í¥Î¥Ï¥Ð¥Ñ¥Ò¥Ó¥Ô¥Õ¥Ö¥×¥Ø¥Ù¥Ú¥Û ¥È¥É¥Ê¥Ë¥Ì¥Í¥Î¥Ï¥Ð¥Ñ¥Ò¥Ó¥Ô¥Õ¥Ö¥×¥Ø¥Ù¥Ú¥Û +¥Ü¥Ý¥Þ¥ß¥à¥á¥â¥ã¥ä¥å¥æ¥ç¥è¥é¥ê¥ë¥ì¥í¥î¥ï ¥Ü¥Ý¥Þ¥ß¥à¥á¥â¥ã¥ä¥å¥æ¥ç¥è¥é¥ê¥ë¥ì¥í¥î¥ï +¥ð¥ñ¥ò¥ó¥ô¥õ¥ö¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¥ð¥ñ¥ò¥ó¥ô¥õ¥ö¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¦¡¦¢¦£¦¤¦¥¦¦¦§¦¨¦©¦ª¦«¦¬¦­¦®¦¯¦°¦±¦²¦³ ¡¦¦¡¦¢¦£¦¤¦¥¦¦¦§¦¨¦©¦ª¦«¦¬¦­¦®¦¯¦°¦±¦²¦³ +¦´¦µ¦¶¦·¦¸¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¦Á¦Â¦Ã¦Ä¦Å¦Æ¦Ç ¦´¦µ¦¶¦·¦¸¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¦Á¦Â¦Ã¦Ä¦Å¦Æ¦Ç +¦È¦É¦Ê¦Ë¦Ì¦Í¦Î¦Ï¦Ð¦Ñ¦Ò¦Ó¦Ô¦Õ¦Ö¦×¦Ø¡¦¡¦¡¦ ¦È¦É¦Ê¦Ë¦Ì¦Í¦Î¦Ï¦Ð¦Ñ¦Ò¦Ó¦Ô¦Õ¦Ö¦×¦Ø¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦§¡§¢§£§¤§¥§¦§§§¨§©§ª§«§¬§­§®§¯§°§±§²§³ ¡¦§¡§¢§£§¤§¥§¦§§§¨§©§ª§«§¬§­§®§¯§°§±§²§³ +§´§µ§¶§·§¸§¹§º§»§¼§½§¾§¿§À§Á¡¦¡¦¡¦¡¦¡¦¡¦ §´§µ§¶§·§¸§¹§º§»§¼§½§¾§¿§À§Á¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Ñ§Ò§Ó§Ô§Õ§Ö§×§Ø§Ù§Ú§Û ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Ñ§Ò§Ó§Ô§Õ§Ö§×§Ø§Ù§Ú§Û +§Ü§Ý§Þ§ß§à§á§â§ã§ä§å§æ§ç§è§é§ê§ë§ì§í§î§ï §Ü§Ý§Þ§ß§à§á§â§ã§ä§å§æ§ç§è§é§ê§ë§ì§í§î§ï +§ð§ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ §ð§ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¨¡¨¢¨£¨¤¨¥¨¦¨§¨¨¨©¨ª¨«¨¬¨­¨®¨¯¨°¨±¨²¨³ ¡¦¨¡¨¢¨£¨¤¨¥¨¦¨§¨¨¨©¨ª¨«¨¬¨­¨®¨¯¨°¨±¨²¨³ +¨´¨µ¨¶¨·¨¸¨¹¨º¨»¨¼¨½¨¾¨¿¨À¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¨´¨µ¨¶¨·¨¸¨¹¨º¨»¨¼¨½¨¾¨¿¨À¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³ ¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç °´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û °È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï °Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï +°ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ °ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ +¡¦Ï¡Ï¢Ï£Ï¤Ï¥Ï¦Ï§Ï¨Ï©ÏªÏ«Ï¬Ï­Ï®Ï¯Ï°Ï±Ï²Ï³ ¡¦Ï¡Ï¢Ï£Ï¤Ï¥Ï¦Ï§Ï¨Ï©ÏªÏ«Ï¬Ï­Ï®Ï¯Ï°Ï±Ï²Ï³ +ϴϵ϶ϷϸϹϺϻϼϽϾϿÏÀÏÁÏÂÏÃÏÄÏÅÏÆÏÇ Ï´ÏµÏ¶Ï·Ï¸Ï¹ÏºÏ»Ï¼Ï½Ï¾Ï¿ÏÀÏÁÏÂÏÃÏÄÏÅÏÆÏÇ +ÏÈÏÉÏÊÏËÏÌÏÍÏÎÏÏÏÐÏÑÏÒÏÓ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ÏÈÏÉÏÊÏËÏÌÏÍÏÎÏÏÏÐÏÑÏÒÏÓ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³ ¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³ +дежзийклмнопÐÀÐÁÐÂÐÃÐÄÐÅÐÆÐÇ Ð´ÐµÐ¶Ð·Ð¸Ð¹ÐºÐ»Ð¼Ð½Ð¾Ð¿ÐÀÐÁÐÂÐÃÐÄÐÅÐÆÐÇ +ÐÈÐÉÐÊÐËÐÌÐÍÐÎÐÏÐÐÐÑÐÒÐÓÐÔÐÕÐÖÐ×ÐØÐÙÐÚÐÛ ÐÈÐÉÐÊÐËÐÌÐÍÐÎÐÏÐÐÐÑÐÒÐÓÐÔÐÕÐÖÐ×ÐØÐÙÐÚÐÛ +ÐÜÐÝÐÞÐßÐàÐáÐâÐãÐäÐåÐæÐçÐèÐéÐêÐëÐìÐíÐîÐï ÐÜÐÝÐÞÐßÐàÐáÐâÐãÐäÐåÐæÐçÐèÐéÐêÐëÐìÐíÐîÐï +ÐðÐñÐòÐóÐôÐõÐöÐ÷ÐøÐùÐúÐûÐüÐýÐþ¡¦¡¦¡¦¡¦¡¦ ÐðÐñÐòÐóÐôÐõÐöÐ÷ÐøÐùÐúÐûÐüÐýÐþ¡¦¡¦¡¦¡¦¡¦ +¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³ ¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³ +ó´óµó¶ó·ó¸ó¹óºó»ó¼ó½ó¾ó¿óÀóÁóÂóÃóÄóÅóÆóÇ ó´óµó¶ó·ó¸ó¹óºó»ó¼ó½ó¾ó¿óÀóÁóÂóÃóÄóÅóÆóÇ +óÈóÉóÊóËóÌóÍóÎóÏóÐóÑóÒóÓóÔóÕóÖó×óØóÙóÚóÛ óÈóÉóÊóËóÌóÍóÎóÏóÐóÑóÒóÓóÔóÕóÖó×óØóÙóÚóÛ +óÜóÝóÞóßóàóáóâóãóäóåóæóçóèóéóêóëóìóíóîóï óÜóÝóÞóßóàóáóâóãóäóåóæóçóèóéóêóëóìóíóîóï +óðóñóòóóóôóõóöó÷óøóùóúóûóüóýóþ¡¦¡¦¡¦¡¦¡¦ óðóñóòóóóôóõóöó÷óøóùóúóûóüóýóþ¡¦¡¦¡¦¡¦¡¦ +¡¦ô¡ô¢ô£ô¤ô¥ô¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦ô¡ô¢ô£ô¤ô¥ô¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£¸`; +£Ã£± CONVERT(`£Ã£±` using sjis) +¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡­¡®¡¯¡°¡±¡²¡³ ¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡­¡®¡¯¡°¡±¡²¡³ +¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç ¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿\¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç +¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û ¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û +¡Ü¡¾¡Þ¡ß¡à¡á¡â¡ã¡ä¡å¡æ¡ç¡è¡é¡ê¡ë¡ì¡í¡î¡ï ¡Ü¡¾¡Þ¡ß¡à¡á¡â¡ã¡ä¡å¡æ¡ç¡è¡é¡ê¡ë¡ì¡í¡î¡ï +¡ð¡ñ¡ò¡ó¡ô¡õ¡ö¡÷¡ø¡ù¡ú¡û¡ü¡ý¡þ¡¦¡¦¡¦¡¦¡¦ ¡ð¡ñ¡ò¡ó¡ô¡õ¡ö¡÷¡ø¡ù¡ú¡û¡ü¡ý¡þ¡¦¡¦¡¦¡¦¡¦ +¡¦¢¡¢¢¢£¢¤¢¥¢¦¢§¢¨¢©¢ª¢«¢¬¢­¢®¡¦¡¦¡¦¡¦¡¦ ¡¦¢¡¢¢¢£¢¤¢¥¢¦¢§¢¨¢©¢ª¢«¢¬¢­¢®¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¢º¢»¢¼¢½¢¾¢¿¢À¢Á¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¢º¢»¢¼¢½¢¾¢¿¢À¢Á¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¢Ê¢Ë¢Ì¢Í¢Î¢Ï¢Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¢Ê¢Ë¢Ì¢Í¢Î¢Ï¢Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¢Ü¢Ý¢Þ¢ß¢à¢á¢â¢ã¢ä¢å¢æ¢ç¢è¢é¢ê¡¦¡¦¡¦¡¦¡¦ ¢Ü¢Ý¢Þ¢ß¢à¢á¢â¢ã¢ä¢å¢æ¢ç¢è¢é¢ê¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¢ò¢ó¢ô¢õ¢ö¢÷¢ø¢ù¡¦¡¦¡¦¡¦¢þ¡¦¡¦¡¦¡¦¡¡ ¡¦¡¦¢ò¢ó¢ô¢õ¢ö¢÷¢ø¢ù¡¦¡¦¡¦¡¦¢þ¡¦¡¦¡¦¡¦¡¡ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦£°£±£²£³ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦£°£±£²£³ +£´£µ£¶£·£¸£¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦£Á£Â£Ã£Ä£Å£Æ£Ç £´£µ£¶£·£¸£¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦£Á£Â£Ã£Ä£Å£Æ£Ç +£È£É£Ê£Ë£Ì£Í£Î£Ï£Ð£Ñ£Ò£Ó£Ô£Õ£Ö£×£Ø£Ù£Ú¡¦ £È£É£Ê£Ë£Ì£Í£Î£Ï£Ð£Ñ£Ò£Ó£Ô£Õ£Ö£×£Ø£Ù£Ú¡¦ +¡¦¡¦¡¦¡¦¡¦£á£â£ã£ä£å£æ£ç£è£é£ê£ë£ì£í£î£ï ¡¦¡¦¡¦¡¦¡¦£á£â£ã£ä£å£æ£ç£è£é£ê£ë£ì£í£î£ï +£ð£ñ£ò£ó£ô£õ£ö£÷£ø£ù£ú¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ £ð£ñ£ò£ó£ô£õ£ö£÷£ø£ù£ú¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ ¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ +¤´¤µ¤¶¤·¤¸¤¹¤º¤»¤¼¤½¤¾¤¿¤À¤Á¤Â¤Ã¤Ä¤Å¤Æ¤Ç ¤´¤µ¤¶¤·¤¸¤¹¤º¤»¤¼¤½¤¾¤¿¤À¤Á¤Â¤Ã¤Ä¤Å¤Æ¤Ç +¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û ¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û +¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï ¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï +¤ð¤ñ¤ò¤ó¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¤ð¤ñ¤ò¤ó¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³ ¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³ +¥´¥µ¥¶¥·¥¸¥¹¥º¥»¥¼¥½¥¾¥¿¥À¥Á¥Â¥Ã¥Ä¥Å¥Æ¥Ç ¥´¥µ¥¶¥·¥¸¥¹¥º¥»¥¼¥½¥¾¥¿¥À¥Á¥Â¥Ã¥Ä¥Å¥Æ¥Ç +¥È¥É¥Ê¥Ë¥Ì¥Í¥Î¥Ï¥Ð¥Ñ¥Ò¥Ó¥Ô¥Õ¥Ö¥×¥Ø¥Ù¥Ú¥Û ¥È¥É¥Ê¥Ë¥Ì¥Í¥Î¥Ï¥Ð¥Ñ¥Ò¥Ó¥Ô¥Õ¥Ö¥×¥Ø¥Ù¥Ú¥Û +¥Ü¥Ý¥Þ¥ß¥à¥á¥â¥ã¥ä¥å¥æ¥ç¥è¥é¥ê¥ë¥ì¥í¥î¥ï ¥Ü¥Ý¥Þ¥ß¥à¥á¥â¥ã¥ä¥å¥æ¥ç¥è¥é¥ê¥ë¥ì¥í¥î¥ï +¥ð¥ñ¥ò¥ó¥ô¥õ¥ö¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¥ð¥ñ¥ò¥ó¥ô¥õ¥ö¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¦¡¦¢¦£¦¤¦¥¦¦¦§¦¨¦©¦ª¦«¦¬¦­¦®¦¯¦°¦±¦²¦³ ¡¦¦¡¦¢¦£¦¤¦¥¦¦¦§¦¨¦©¦ª¦«¦¬¦­¦®¦¯¦°¦±¦²¦³ +¦´¦µ¦¶¦·¦¸¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¦Á¦Â¦Ã¦Ä¦Å¦Æ¦Ç ¦´¦µ¦¶¦·¦¸¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¦Á¦Â¦Ã¦Ä¦Å¦Æ¦Ç +¦È¦É¦Ê¦Ë¦Ì¦Í¦Î¦Ï¦Ð¦Ñ¦Ò¦Ó¦Ô¦Õ¦Ö¦×¦Ø¡¦¡¦¡¦ ¦È¦É¦Ê¦Ë¦Ì¦Í¦Î¦Ï¦Ð¦Ñ¦Ò¦Ó¦Ô¦Õ¦Ö¦×¦Ø¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦§¡§¢§£§¤§¥§¦§§§¨§©§ª§«§¬§­§®§¯§°§±§²§³ ¡¦§¡§¢§£§¤§¥§¦§§§¨§©§ª§«§¬§­§®§¯§°§±§²§³ +§´§µ§¶§·§¸§¹§º§»§¼§½§¾§¿§À§Á¡¦¡¦¡¦¡¦¡¦¡¦ §´§µ§¶§·§¸§¹§º§»§¼§½§¾§¿§À§Á¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Ñ§Ò§Ó§Ô§Õ§Ö§×§Ø§Ù§Ú§Û ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Ñ§Ò§Ó§Ô§Õ§Ö§×§Ø§Ù§Ú§Û +§Ü§Ý§Þ§ß§à§á§â§ã§ä§å§æ§ç§è§é§ê§ë§ì§í§î§ï §Ü§Ý§Þ§ß§à§á§â§ã§ä§å§æ§ç§è§é§ê§ë§ì§í§î§ï +§ð§ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ §ð§ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¨¡¨¢¨£¨¤¨¥¨¦¨§¨¨¨©¨ª¨«¨¬¨­¨®¨¯¨°¨±¨²¨³ ¡¦¨¡¨¢¨£¨¤¨¥¨¦¨§¨¨¨©¨ª¨«¨¬¨­¨®¨¯¨°¨±¨²¨³ +¨´¨µ¨¶¨·¨¸¨¹¨º¨»¨¼¨½¨¾¨¿¨À¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¨´¨µ¨¶¨·¨¸¨¹¨º¨»¨¼¨½¨¾¨¿¨À¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³ ¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç °´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û °È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï °Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï +°ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ °ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ +¡¦Ï¡Ï¢Ï£Ï¤Ï¥Ï¦Ï§Ï¨Ï©ÏªÏ«Ï¬Ï­Ï®Ï¯Ï°Ï±Ï²Ï³ ¡¦Ï¡Ï¢Ï£Ï¤Ï¥Ï¦Ï§Ï¨Ï©ÏªÏ«Ï¬Ï­Ï®Ï¯Ï°Ï±Ï²Ï³ +ϴϵ϶ϷϸϹϺϻϼϽϾϿÏÀÏÁÏÂÏÃÏÄÏÅÏÆÏÇ Ï´ÏµÏ¶Ï·Ï¸Ï¹ÏºÏ»Ï¼Ï½Ï¾Ï¿ÏÀÏÁÏÂÏÃÏÄÏÅÏÆÏÇ +ÏÈÏÉÏÊÏËÏÌÏÍÏÎÏÏÏÐÏÑÏÒÏÓ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ÏÈÏÉÏÊÏËÏÌÏÍÏÎÏÏÏÐÏÑÏÒÏÓ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³ ¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³ +дежзийклмнопÐÀÐÁÐÂÐÃÐÄÐÅÐÆÐÇ Ð´ÐµÐ¶Ð·Ð¸Ð¹ÐºÐ»Ð¼Ð½Ð¾Ð¿ÐÀÐÁÐÂÐÃÐÄÐÅÐÆÐÇ +ÐÈÐÉÐÊÐËÐÌÐÍÐÎÐÏÐÐÐÑÐÒÐÓÐÔÐÕÐÖÐ×ÐØÐÙÐÚÐÛ ÐÈÐÉÐÊÐËÐÌÐÍÐÎÐÏÐÐÐÑÐÒÐÓÐÔÐÕÐÖÐ×ÐØÐÙÐÚÐÛ +ÐÜÐÝÐÞÐßÐàÐáÐâÐãÐäÐåÐæÐçÐèÐéÐêÐëÐìÐíÐîÐï ÐÜÐÝÐÞÐßÐàÐáÐâÐãÐäÐåÐæÐçÐèÐéÐêÐëÐìÐíÐîÐï +ÐðÐñÐòÐóÐôÐõÐöÐ÷ÐøÐùÐúÐûÐüÐýÐþ¡¦¡¦¡¦¡¦¡¦ ÐðÐñÐòÐóÐôÐõÐöÐ÷ÐøÐùÐúÐûÐüÐýÐþ¡¦¡¦¡¦¡¦¡¦ +¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³ ¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³ +ó´óµó¶ó·ó¸ó¹óºó»ó¼ó½ó¾ó¿óÀóÁóÂóÃóÄóÅóÆóÇ ó´óµó¶ó·ó¸ó¹óºó»ó¼ó½ó¾ó¿óÀóÁóÂóÃóÄóÅóÆóÇ +óÈóÉóÊóËóÌóÍóÎóÏóÐóÑóÒóÓóÔóÕóÖó×óØóÙóÚóÛ óÈóÉóÊóËóÌóÍóÎóÏóÐóÑóÒóÓóÔóÕóÖó×óØóÙóÚóÛ +óÜóÝóÞóßóàóáóâóãóäóåóæóçóèóéóêóëóìóíóîóï óÜóÝóÞóßóàóáóâóãóäóåóæóçóèóéóêóëóìóíóîóï +óðóñóòóóóôóõóöó÷óøóùóúóûóüóýóþ¡¦¡¦¡¦¡¦¡¦ óðóñóòóóóôóõóöó÷óøóùóúóûóüóýóþ¡¦¡¦¡¦¡¦¡¦ +¡¦ô¡ô¢ô£ô¤ô¥ô¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦ô¡ô¢ô£ô¤ô¥ô¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£¹`; +£Ã£± CONVERT(`£Ã£±` using utf8) +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢¯¢°¢±¢²¢³ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢¯¢°¢±¢²¢³ +¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ ¡¦¢µ¢¶~¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢ë¢ì¢í¢î¢ï ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢ë¢ì¢í¢î¢ï +¢ð¢ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¢ð¢ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¦á¦â¦ã¦ä¦å¡¦¦ç¡¦¦é¦ê¡¦¦ì¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¦á¦â¦ã¦ä¦å¡¦¦ç¡¦¦é¦ê¡¦¦ì¡¦¡¦¡¦ +¡¦¦ñ¦ò¦ó¦ô¦õ¦ö¦÷¦ø¦ù¦ú¦û¦ü¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¦ñ¦ò¦ó¦ô¦õ¦ö¦÷¦ø¦ù¦ú¦û¦ü¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Â§Ã§Ä§Å§Æ§Ç ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Â§Ã§Ä§Å§Æ§Ç +§È§É§Ê§Ë§Ì§Í§Î¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ §È§É§Ê§Ë§Ì§Í§Î¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦§ò§ó§ô§õ§ö§÷§ø§ù§ú§û§ü§ý§þ¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦§ò§ó§ô§õ§ö§÷§ø§ù§ú§û§ü§ý§þ¡¦¡¦¡¦¡¦¡¦ +¡¦©¡©¢¡¦©¤¡¦©¦¡¦©¨©©¡¦©«©¬©­¡¦©¯©°¡¦¡¦¡¦ ¡¦©¡©¢¡¦©¤¡¦©¦¡¦©¨©©¡¦©«©¬©­¡¦©¯©°¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦©Á©Â©Ã©Ä©Å©Æ©Ç ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦©Á©Â©Ã©Ä©Å©Æ©Ç +©È©É©Ê©Ë©Ì©Í©Î©Ï©Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ©È©É©Ê©Ë©Ì©Í©Î©Ï©Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦ª¡ª¢ª£ª¤ª¥ª¦ª§ª¨ª©ªªª«ª¬ª­ª®ª¯ª°ª±ª²ª³ ¡¦ª¡ª¢ª£ª¤ª¥ª¦ª§ª¨ª©ªªª«ª¬ª­ª®ª¯ª°ª±ª²ª³ +ª´ªµª¶ª·ª¸¡¦ªºª»ª¼ª½ª¾ª¿ªÀªÁªÂªÃªÄªÅªÆªÇ ª´ªµª¶ª·ª¸¡¦ªºª»ª¼ª½ª¾ª¿ªÀªÁªÂªÃªÄªÅªÆªÇ +ªÈªÉªÊªËªÌªÍªÎªÏªÐªÑªÒªÓªÔªÕªÖª×ªØªÙªÚªÛ ªÈªÉªÊªËªÌªÍªÎªÏªÐªÑªÒªÓªÔªÕªÖª×ªØªÙªÚªÛ +ªÜªÝªÞªßªàªáªâªãªäªåªæªçªèªéªêªëªìªíªîªï ªÜªÝªÞªßªàªáªâªãªäªåªæªçªèªéªêªëªìªíªîªï +ªðªñªòªóªôªõªöª÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ªðªñªòªóªôªõªöª÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦«¡«¢«£«¤«¥«¦«§«¨«©«ª«««¬«­«®«¯«°«±«²«³ ¡¦«¡«¢«£«¤«¥«¦«§«¨«©«ª«««¬«­«®«¯«°«±«²«³ +«´«µ«¶«·«¸«¹«º«»¡¦«½«¾«¿«À«Á«Â«Ã¡¦«Å«Æ«Ç «´«µ«¶«·«¸«¹«º«»¡¦«½«¾«¿«À«Á«Â«Ã¡¦«Å«Æ«Ç +«È«É«Ê«Ë«Ì«Í«Î«Ï«Ð«Ñ«Ò«Ó«Ô«Õ«Ö«×«Ø«Ù«Ú«Û «È«É«Ê«Ë«Ì«Í«Î«Ï«Ð«Ñ«Ò«Ó«Ô«Õ«Ö«×«Ø«Ù«Ú«Û +«Ü«Ý«Þ«ß«à«á«â«ã«ä«å«æ«ç«è«é«ê«ë«ì«í«î«ï «Ü«Ý«Þ«ß«à«á«â«ã«ä«å«æ«ç«è«é«ê«ë«ì«í«î«ï +«ð«ñ«ò«ó«ô«õ«ö«÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ «ð«ñ«ò«ó«ô«õ«ö«÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³ ¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç °´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û °È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï °Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï +°ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ °ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ +¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³ ¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³ +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ +íÜíÝíÞíßíàíáíâí㡦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ íÜíÝíÞíßíàíáíâí㡦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£¹`; +£Ã£± CONVERT(`£Ã£±` using ucs2) +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢¯¢°¢±¢²¢³ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢¯¢°¢±¢²¢³ +¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ ¡¦¢µ¢¶~¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢ë¢ì¢í¢î¢ï ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢ë¢ì¢í¢î¢ï +¢ð¢ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¢ð¢ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¦á¦â¦ã¦ä¦å¡¦¦ç¡¦¦é¦ê¡¦¦ì¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¦á¦â¦ã¦ä¦å¡¦¦ç¡¦¦é¦ê¡¦¦ì¡¦¡¦¡¦ +¡¦¦ñ¦ò¦ó¦ô¦õ¦ö¦÷¦ø¦ù¦ú¦û¦ü¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¦ñ¦ò¦ó¦ô¦õ¦ö¦÷¦ø¦ù¦ú¦û¦ü¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Â§Ã§Ä§Å§Æ§Ç ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Â§Ã§Ä§Å§Æ§Ç +§È§É§Ê§Ë§Ì§Í§Î¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ §È§É§Ê§Ë§Ì§Í§Î¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦§ò§ó§ô§õ§ö§÷§ø§ù§ú§û§ü§ý§þ¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦§ò§ó§ô§õ§ö§÷§ø§ù§ú§û§ü§ý§þ¡¦¡¦¡¦¡¦¡¦ +¡¦©¡©¢¡¦©¤¡¦©¦¡¦©¨©©¡¦©«©¬©­¡¦©¯©°¡¦¡¦¡¦ ¡¦©¡©¢¡¦©¤¡¦©¦¡¦©¨©©¡¦©«©¬©­¡¦©¯©°¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦©Á©Â©Ã©Ä©Å©Æ©Ç ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦©Á©Â©Ã©Ä©Å©Æ©Ç +©È©É©Ê©Ë©Ì©Í©Î©Ï©Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ©È©É©Ê©Ë©Ì©Í©Î©Ï©Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦ª¡ª¢ª£ª¤ª¥ª¦ª§ª¨ª©ªªª«ª¬ª­ª®ª¯ª°ª±ª²ª³ ¡¦ª¡ª¢ª£ª¤ª¥ª¦ª§ª¨ª©ªªª«ª¬ª­ª®ª¯ª°ª±ª²ª³ +ª´ªµª¶ª·ª¸¡¦ªºª»ª¼ª½ª¾ª¿ªÀªÁªÂªÃªÄªÅªÆªÇ ª´ªµª¶ª·ª¸¡¦ªºª»ª¼ª½ª¾ª¿ªÀªÁªÂªÃªÄªÅªÆªÇ +ªÈªÉªÊªËªÌªÍªÎªÏªÐªÑªÒªÓªÔªÕªÖª×ªØªÙªÚªÛ ªÈªÉªÊªËªÌªÍªÎªÏªÐªÑªÒªÓªÔªÕªÖª×ªØªÙªÚªÛ +ªÜªÝªÞªßªàªáªâªãªäªåªæªçªèªéªêªëªìªíªîªï ªÜªÝªÞªßªàªáªâªãªäªåªæªçªèªéªêªëªìªíªîªï +ªðªñªòªóªôªõªöª÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ªðªñªòªóªôªõªöª÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦«¡«¢«£«¤«¥«¦«§«¨«©«ª«««¬«­«®«¯«°«±«²«³ ¡¦«¡«¢«£«¤«¥«¦«§«¨«©«ª«««¬«­«®«¯«°«±«²«³ +«´«µ«¶«·«¸«¹«º«»¡¦«½«¾«¿«À«Á«Â«Ã¡¦«Å«Æ«Ç «´«µ«¶«·«¸«¹«º«»¡¦«½«¾«¿«À«Á«Â«Ã¡¦«Å«Æ«Ç +«È«É«Ê«Ë«Ì«Í«Î«Ï«Ð«Ñ«Ò«Ó«Ô«Õ«Ö«×«Ø«Ù«Ú«Û «È«É«Ê«Ë«Ì«Í«Î«Ï«Ð«Ñ«Ò«Ó«Ô«Õ«Ö«×«Ø«Ù«Ú«Û +«Ü«Ý«Þ«ß«à«á«â«ã«ä«å«æ«ç«è«é«ê«ë«ì«í«î«ï «Ü«Ý«Þ«ß«à«á«â«ã«ä«å«æ«ç«è«é«ê«ë«ì«í«î«ï +«ð«ñ«ò«ó«ô«õ«ö«÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ «ð«ñ«ò«ó«ô«õ«ö«÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³ ¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç °´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û °È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï °Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï +°ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ °ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ +¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³ ¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³ +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ +íÜíÝíÞíßíàíáíâí㡦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ íÜíÝíÞíßíàíáíâí㡦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£¹`; +£Ã£± CONVERT(`£Ã£±` using sjis) +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢¯¢°¢±¢²¢³ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦????? +¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ ¡¦??~??¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦???¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢ë¢ì¢í¢î¢ï ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦????? +¢ð¢ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ??¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¦á¦â¦ã¦ä¦å¡¦¦ç¡¦¦é¦ê¡¦¦ì¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦?????¡¦?¡¦??¡¦?¡¦¡¦¡¦ +¡¦¦ñ¦ò¦ó¦ô¦õ¦ö¦÷¦ø¦ù¦ú¦û¦ü¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦????????????¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Â§Ã§Ä§Å§Æ§Ç ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦?????? +§È§É§Ê§Ë§Ì§Í§Î¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ???????¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦§ò§ó§ô§õ§ö§÷§ø§ù§ú§û§ü§ý§þ¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦?????????????¡¦¡¦¡¦¡¦¡¦ +¡¦©¡©¢¡¦©¤¡¦©¦¡¦©¨©©¡¦©«©¬©­¡¦©¯©°¡¦¡¦¡¦ ¡¦??¡¦?¡¦?¡¦??¡¦???¡¦??¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦©Á©Â©Ã©Ä©Å©Æ©Ç ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦??????? +©È©É©Ê©Ë©Ì©Í©Î©Ï©Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ?????????¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦ª¡ª¢ª£ª¤ª¥ª¦ª§ª¨ª©ªªª«ª¬ª­ª®ª¯ª°ª±ª²ª³ ¡¦??????????????????? +ª´ªµª¶ª·ª¸¡¦ªºª»ª¼ª½ª¾ª¿ªÀªÁªÂªÃªÄªÅªÆªÇ ?????¡¦?????????????? +ªÈªÉªÊªËªÌªÍªÎªÏªÐªÑªÒªÓªÔªÕªÖª×ªØªÙªÚªÛ ???????????????????? +ªÜªÝªÞªßªàªáªâªãªäªåªæªçªèªéªêªëªìªíªîªï ???????????????????? +ªðªñªòªóªôªõªöª÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ????????¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦«¡«¢«£«¤«¥«¦«§«¨«©«ª«««¬«­«®«¯«°«±«²«³ ¡¦??????????????????? +«´«µ«¶«·«¸«¹«º«»¡¦«½«¾«¿«À«Á«Â«Ã¡¦«Å«Æ«Ç ????????¡¦???????¡¦??? +«È«É«Ê«Ë«Ì«Í«Î«Ï«Ð«Ñ«Ò«Ó«Ô«Õ«Ö«×«Ø«Ù«Ú«Û ???????????????????? +«Ü«Ý«Þ«ß«à«á«â«ã«ä«å«æ«ç«è«é«ê«ë«ì«í«î«ï ???????????????????? +«ð«ñ«ò«ó«ô«õ«ö«÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ????????¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³ ¡¦??????????????????? +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç ???????????????????? +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û ???????????????????? +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï ???????????????????? +°ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ ???????????????¡¦¡¦¡¦¡¦¡¦ +¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³ ¡¦??????????????????? +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ ???????????????????? +íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ ???????????????????? +íÜíÝíÞíßíàíáíâí㡦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ????????¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£±£°`; +£Ã£± CONVERT(`£Ã£±` using utf8) + !"#$%&'()*+,-./ !"#$%&'()*+,-./ +0123456789:;<=>? 0123456789:;<=>? +@ABCDEFGHIJKLMNO @ABCDEFGHIJKLMNO +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[\]^_ +abcdefghijklmno abcdefghijklmno +pqrstuvwxyz{|}~ pqrstuvwxyz{|}~ + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯ Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯ +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ +ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£±£°`; +£Ã£± CONVERT(`£Ã£±` using ucs2) + !"#$%&'()*+,-./ !"#$%&'()*+,-./ +0123456789:;<=>? 0123456789:;<=>? +@ABCDEFGHIJKLMNO @ABCDEFGHIJKLMNO +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[\]^_ +abcdefghijklmno abcdefghijklmno +pqrstuvwxyz{|}~ pqrstuvwxyz{|}~ + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯ Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯ +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ +ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£±£°`; +£Ã£± CONVERT(`£Ã£±` using sjis) + !"#$%&'()*+,-./ !"#$%&'()*+,-./ +0123456789:;<=>? 0123456789:;<=>? +@ABCDEFGHIJKLMNO @ABCDEFGHIJKLMNO +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[\]^_ +abcdefghijklmno abcdefghijklmno +pqrstuvwxyz{|}~ pqrstuvwxyz{|}~ + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯ Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯ +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ +ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£±£±`; +£Ã£± CONVERT(`£Ã£±` using utf8) +¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡­¡®¡¯¡°¡±¡²¡³ ¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡­¡®¡¯¡°¡±¡²¡³ +¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç ¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿\¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç +¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û ¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û +¡Ü¡¾¡Þ¡ß¡à¡á¡â¡ã¡ä¡å¡æ¡ç¡è¡é¡ê¡ë¡ì¡í¡î¡ï ¡Ü¡¾¡Þ¡ß¡à¡á¡â¡ã¡ä¡å¡æ¡ç¡è¡é¡ê¡ë¡ì¡í¡î¡ï +¡ð¡ñ¡ò¡ó¡ô¡õ¡ö¡÷¡ø¡ù¡ú¡û¡ü¡ý¡þ¡¦¡¦¡¦¡¦¡¦ ¡ð¡ñ¡ò¡ó¡ô¡õ¡ö¡÷¡ø¡ù¡ú¡û¡ü¡ý¡þ¡¦¡¦¡¦¡¦¡¦ +¡¦¢¡¢¢¢£¢¤¢¥¢¦¢§¢¨¢©¢ª¢«¢¬¢­¢®¡¦¡¦¡¦¡¦¡¦ ¡¦¢¡¢¢¢£¢¤¢¥¢¦¢§¢¨¢©¢ª¢«¢¬¢­¢®¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¢º¢»¢¼¢½¢¾¢¿¢À¢Á¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¢º¢»¢¼¢½¢¾¢¿¢À¢Á¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¢Ê¢Ë¢Ì¢Í¢Î¢Ï¢Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¢Ê¢Ë¢Ì¢Í¢Î¢Ï¢Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¢Ü¢Ý¢Þ¢ß¢à¢á¢â¢ã¢ä¢å¢æ¢ç¢è¢é¢ê¡¦¡¦¡¦¡¦¡¦ ¢Ü¢Ý¢Þ¢ß¢à¢á¢â¢ã¢ä¢å¢æ¢ç¢è¢é¢ê¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¢ò¢ó¢ô¢õ¢ö¢÷¢ø¢ù¡¦¡¦¡¦¡¦¢þ¡¦¡¦¡¦¡¦¡¡ ¡¦¡¦¢ò¢ó¢ô¢õ¢ö¢÷¢ø¢ù¡¦¡¦¡¦¡¦¢þ¡¦¡¦¡¦¡¦¡¡ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦£°£±£²£³ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦£°£±£²£³ +£´£µ£¶£·£¸£¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦£Á£Â£Ã£Ä£Å£Æ£Ç £´£µ£¶£·£¸£¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦£Á£Â£Ã£Ä£Å£Æ£Ç +£È£É£Ê£Ë£Ì£Í£Î£Ï£Ð£Ñ£Ò£Ó£Ô£Õ£Ö£×£Ø£Ù£Ú¡¦ £È£É£Ê£Ë£Ì£Í£Î£Ï£Ð£Ñ£Ò£Ó£Ô£Õ£Ö£×£Ø£Ù£Ú¡¦ +¡¦¡¦¡¦¡¦¡¦£á£â£ã£ä£å£æ£ç£è£é£ê£ë£ì£í£î£ï ¡¦¡¦¡¦¡¦¡¦£á£â£ã£ä£å£æ£ç£è£é£ê£ë£ì£í£î£ï +£ð£ñ£ò£ó£ô£õ£ö£÷£ø£ù£ú¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ £ð£ñ£ò£ó£ô£õ£ö£÷£ø£ù£ú¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ ¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ +¤´¤µ¤¶¤·¤¸¤¹¤º¤»¤¼¤½¤¾¤¿¤À¤Á¤Â¤Ã¤Ä¤Å¤Æ¤Ç ¤´¤µ¤¶¤·¤¸¤¹¤º¤»¤¼¤½¤¾¤¿¤À¤Á¤Â¤Ã¤Ä¤Å¤Æ¤Ç +¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û ¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û +¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï ¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï +¤ð¤ñ¤ò¤ó¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¤ð¤ñ¤ò¤ó¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³ ¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³ +¥´¥µ¥¶¥·¥¸¥¹¥º¥»¥¼¥½¥¾¥¿¥À¥Á¥Â¥Ã¥Ä¥Å¥Æ¥Ç ¥´¥µ¥¶¥·¥¸¥¹¥º¥»¥¼¥½¥¾¥¿¥À¥Á¥Â¥Ã¥Ä¥Å¥Æ¥Ç +¥È¥É¥Ê¥Ë¥Ì¥Í¥Î¥Ï¥Ð¥Ñ¥Ò¥Ó¥Ô¥Õ¥Ö¥×¥Ø¥Ù¥Ú¥Û ¥È¥É¥Ê¥Ë¥Ì¥Í¥Î¥Ï¥Ð¥Ñ¥Ò¥Ó¥Ô¥Õ¥Ö¥×¥Ø¥Ù¥Ú¥Û +¥Ü¥Ý¥Þ¥ß¥à¥á¥â¥ã¥ä¥å¥æ¥ç¥è¥é¥ê¥ë¥ì¥í¥î¥ï ¥Ü¥Ý¥Þ¥ß¥à¥á¥â¥ã¥ä¥å¥æ¥ç¥è¥é¥ê¥ë¥ì¥í¥î¥ï +¥ð¥ñ¥ò¥ó¥ô¥õ¥ö¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¥ð¥ñ¥ò¥ó¥ô¥õ¥ö¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¦¡¦¢¦£¦¤¦¥¦¦¦§¦¨¦©¦ª¦«¦¬¦­¦®¦¯¦°¦±¦²¦³ ¡¦¦¡¦¢¦£¦¤¦¥¦¦¦§¦¨¦©¦ª¦«¦¬¦­¦®¦¯¦°¦±¦²¦³ +¦´¦µ¦¶¦·¦¸¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¦Á¦Â¦Ã¦Ä¦Å¦Æ¦Ç ¦´¦µ¦¶¦·¦¸¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¦Á¦Â¦Ã¦Ä¦Å¦Æ¦Ç +¦È¦É¦Ê¦Ë¦Ì¦Í¦Î¦Ï¦Ð¦Ñ¦Ò¦Ó¦Ô¦Õ¦Ö¦×¦Ø¡¦¡¦¡¦ ¦È¦É¦Ê¦Ë¦Ì¦Í¦Î¦Ï¦Ð¦Ñ¦Ò¦Ó¦Ô¦Õ¦Ö¦×¦Ø¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦§¡§¢§£§¤§¥§¦§§§¨§©§ª§«§¬§­§®§¯§°§±§²§³ ¡¦§¡§¢§£§¤§¥§¦§§§¨§©§ª§«§¬§­§®§¯§°§±§²§³ +§´§µ§¶§·§¸§¹§º§»§¼§½§¾§¿§À§Á¡¦¡¦¡¦¡¦¡¦¡¦ §´§µ§¶§·§¸§¹§º§»§¼§½§¾§¿§À§Á¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Ñ§Ò§Ó§Ô§Õ§Ö§×§Ø§Ù§Ú§Û ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Ñ§Ò§Ó§Ô§Õ§Ö§×§Ø§Ù§Ú§Û +§Ü§Ý§Þ§ß§à§á§â§ã§ä§å§æ§ç§è§é§ê§ë§ì§í§î§ï §Ü§Ý§Þ§ß§à§á§â§ã§ä§å§æ§ç§è§é§ê§ë§ì§í§î§ï +§ð§ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ §ð§ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¨¡¨¢¨£¨¤¨¥¨¦¨§¨¨¨©¨ª¨«¨¬¨­¨®¨¯¨°¨±¨²¨³ ¡¦¨¡¨¢¨£¨¤¨¥¨¦¨§¨¨¨©¨ª¨«¨¬¨­¨®¨¯¨°¨±¨²¨³ +¨´¨µ¨¶¨·¨¸¨¹¨º¨»¨¼¨½¨¾¨¿¨À¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¨´¨µ¨¶¨·¨¸¨¹¨º¨»¨¼¨½¨¾¨¿¨À¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³ ¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç °´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û °È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï °Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï +°ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ °ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ +¡¦Ï¡Ï¢Ï£Ï¤Ï¥Ï¦Ï§Ï¨Ï©ÏªÏ«Ï¬Ï­Ï®Ï¯Ï°Ï±Ï²Ï³ ¡¦Ï¡Ï¢Ï£Ï¤Ï¥Ï¦Ï§Ï¨Ï©ÏªÏ«Ï¬Ï­Ï®Ï¯Ï°Ï±Ï²Ï³ +ϴϵ϶ϷϸϹϺϻϼϽϾϿÏÀÏÁÏÂÏÃÏÄÏÅÏÆÏÇ Ï´ÏµÏ¶Ï·Ï¸Ï¹ÏºÏ»Ï¼Ï½Ï¾Ï¿ÏÀÏÁÏÂÏÃÏÄÏÅÏÆÏÇ +ÏÈÏÉÏÊÏËÏÌÏÍÏÎÏÏÏÐÏÑÏÒÏÓ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ÏÈÏÉÏÊÏËÏÌÏÍÏÎÏÏÏÐÏÑÏÒÏÓ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³ ¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³ +дежзийклмнопÐÀÐÁÐÂÐÃÐÄÐÅÐÆÐÇ Ð´ÐµÐ¶Ð·Ð¸Ð¹ÐºÐ»Ð¼Ð½Ð¾Ð¿ÐÀÐÁÐÂÐÃÐÄÐÅÐÆÐÇ +ÐÈÐÉÐÊÐËÐÌÐÍÐÎÐÏÐÐÐÑÐÒÐÓÐÔÐÕÐÖÐ×ÐØÐÙÐÚÐÛ ÐÈÐÉÐÊÐËÐÌÐÍÐÎÐÏÐÐÐÑÐÒÐÓÐÔÐÕÐÖÐ×ÐØÐÙÐÚÐÛ +ÐÜÐÝÐÞÐßÐàÐáÐâÐãÐäÐåÐæÐçÐèÐéÐêÐëÐìÐíÐîÐï ÐÜÐÝÐÞÐßÐàÐáÐâÐãÐäÐåÐæÐçÐèÐéÐêÐëÐìÐíÐîÐï +ÐðÐñÐòÐóÐôÐõÐöÐ÷ÐøÐùÐúÐûÐüÐýÐþ¡¦¡¦¡¦¡¦¡¦ ÐðÐñÐòÐóÐôÐõÐöÐ÷ÐøÐùÐúÐûÐüÐýÐþ¡¦¡¦¡¦¡¦¡¦ +¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³ ¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³ +ó´óµó¶ó·ó¸ó¹óºó»ó¼ó½ó¾ó¿óÀóÁóÂóÃóÄóÅóÆóÇ ó´óµó¶ó·ó¸ó¹óºó»ó¼ó½ó¾ó¿óÀóÁóÂóÃóÄóÅóÆóÇ +óÈóÉóÊóËóÌóÍóÎóÏóÐóÑóÒóÓóÔóÕóÖó×óØóÙóÚóÛ óÈóÉóÊóËóÌóÍóÎóÏóÐóÑóÒóÓóÔóÕóÖó×óØóÙóÚóÛ +óÜóÝóÞóßóàóáóâóãóäóåóæóçóèóéóêóëóìóíóîóï óÜóÝóÞóßóàóáóâóãóäóåóæóçóèóéóêóëóìóíóîóï +óðóñóòóóóôóõóöó÷óøóùóúóûóüóýóþ¡¦¡¦¡¦¡¦¡¦ óðóñóòóóóôóõóöó÷óøóùóúóûóüóýóþ¡¦¡¦¡¦¡¦¡¦ +¡¦ô¡ô¢ô£ô¤ô¥ô¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦ô¡ô¢ô£ô¤ô¥ô¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£±£±`; +£Ã£± CONVERT(`£Ã£±` using ucs2) +¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡­¡®¡¯¡°¡±¡²¡³ ¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡­¡®¡¯¡°¡±¡²¡³ +¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç ¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿\¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç +¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û ¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û +¡Ü¡¾¡Þ¡ß¡à¡á¡â¡ã¡ä¡å¡æ¡ç¡è¡é¡ê¡ë¡ì¡í¡î¡ï ¡Ü¡¾¡Þ¡ß¡à¡á¡â¡ã¡ä¡å¡æ¡ç¡è¡é¡ê¡ë¡ì¡í¡î¡ï +¡ð¡ñ¡ò¡ó¡ô¡õ¡ö¡÷¡ø¡ù¡ú¡û¡ü¡ý¡þ¡¦¡¦¡¦¡¦¡¦ ¡ð¡ñ¡ò¡ó¡ô¡õ¡ö¡÷¡ø¡ù¡ú¡û¡ü¡ý¡þ¡¦¡¦¡¦¡¦¡¦ +¡¦¢¡¢¢¢£¢¤¢¥¢¦¢§¢¨¢©¢ª¢«¢¬¢­¢®¡¦¡¦¡¦¡¦¡¦ ¡¦¢¡¢¢¢£¢¤¢¥¢¦¢§¢¨¢©¢ª¢«¢¬¢­¢®¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¢º¢»¢¼¢½¢¾¢¿¢À¢Á¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¢º¢»¢¼¢½¢¾¢¿¢À¢Á¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¢Ê¢Ë¢Ì¢Í¢Î¢Ï¢Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¢Ê¢Ë¢Ì¢Í¢Î¢Ï¢Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¢Ü¢Ý¢Þ¢ß¢à¢á¢â¢ã¢ä¢å¢æ¢ç¢è¢é¢ê¡¦¡¦¡¦¡¦¡¦ ¢Ü¢Ý¢Þ¢ß¢à¢á¢â¢ã¢ä¢å¢æ¢ç¢è¢é¢ê¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¢ò¢ó¢ô¢õ¢ö¢÷¢ø¢ù¡¦¡¦¡¦¡¦¢þ¡¦¡¦¡¦¡¦¡¡ ¡¦¡¦¢ò¢ó¢ô¢õ¢ö¢÷¢ø¢ù¡¦¡¦¡¦¡¦¢þ¡¦¡¦¡¦¡¦¡¡ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦£°£±£²£³ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦£°£±£²£³ +£´£µ£¶£·£¸£¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦£Á£Â£Ã£Ä£Å£Æ£Ç £´£µ£¶£·£¸£¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦£Á£Â£Ã£Ä£Å£Æ£Ç +£È£É£Ê£Ë£Ì£Í£Î£Ï£Ð£Ñ£Ò£Ó£Ô£Õ£Ö£×£Ø£Ù£Ú¡¦ £È£É£Ê£Ë£Ì£Í£Î£Ï£Ð£Ñ£Ò£Ó£Ô£Õ£Ö£×£Ø£Ù£Ú¡¦ +¡¦¡¦¡¦¡¦¡¦£á£â£ã£ä£å£æ£ç£è£é£ê£ë£ì£í£î£ï ¡¦¡¦¡¦¡¦¡¦£á£â£ã£ä£å£æ£ç£è£é£ê£ë£ì£í£î£ï +£ð£ñ£ò£ó£ô£õ£ö£÷£ø£ù£ú¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ £ð£ñ£ò£ó£ô£õ£ö£÷£ø£ù£ú¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ ¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ +¤´¤µ¤¶¤·¤¸¤¹¤º¤»¤¼¤½¤¾¤¿¤À¤Á¤Â¤Ã¤Ä¤Å¤Æ¤Ç ¤´¤µ¤¶¤·¤¸¤¹¤º¤»¤¼¤½¤¾¤¿¤À¤Á¤Â¤Ã¤Ä¤Å¤Æ¤Ç +¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û ¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û +¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï ¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï +¤ð¤ñ¤ò¤ó¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¤ð¤ñ¤ò¤ó¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³ ¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³ +¥´¥µ¥¶¥·¥¸¥¹¥º¥»¥¼¥½¥¾¥¿¥À¥Á¥Â¥Ã¥Ä¥Å¥Æ¥Ç ¥´¥µ¥¶¥·¥¸¥¹¥º¥»¥¼¥½¥¾¥¿¥À¥Á¥Â¥Ã¥Ä¥Å¥Æ¥Ç +¥È¥É¥Ê¥Ë¥Ì¥Í¥Î¥Ï¥Ð¥Ñ¥Ò¥Ó¥Ô¥Õ¥Ö¥×¥Ø¥Ù¥Ú¥Û ¥È¥É¥Ê¥Ë¥Ì¥Í¥Î¥Ï¥Ð¥Ñ¥Ò¥Ó¥Ô¥Õ¥Ö¥×¥Ø¥Ù¥Ú¥Û +¥Ü¥Ý¥Þ¥ß¥à¥á¥â¥ã¥ä¥å¥æ¥ç¥è¥é¥ê¥ë¥ì¥í¥î¥ï ¥Ü¥Ý¥Þ¥ß¥à¥á¥â¥ã¥ä¥å¥æ¥ç¥è¥é¥ê¥ë¥ì¥í¥î¥ï +¥ð¥ñ¥ò¥ó¥ô¥õ¥ö¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¥ð¥ñ¥ò¥ó¥ô¥õ¥ö¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¦¡¦¢¦£¦¤¦¥¦¦¦§¦¨¦©¦ª¦«¦¬¦­¦®¦¯¦°¦±¦²¦³ ¡¦¦¡¦¢¦£¦¤¦¥¦¦¦§¦¨¦©¦ª¦«¦¬¦­¦®¦¯¦°¦±¦²¦³ +¦´¦µ¦¶¦·¦¸¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¦Á¦Â¦Ã¦Ä¦Å¦Æ¦Ç ¦´¦µ¦¶¦·¦¸¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¦Á¦Â¦Ã¦Ä¦Å¦Æ¦Ç +¦È¦É¦Ê¦Ë¦Ì¦Í¦Î¦Ï¦Ð¦Ñ¦Ò¦Ó¦Ô¦Õ¦Ö¦×¦Ø¡¦¡¦¡¦ ¦È¦É¦Ê¦Ë¦Ì¦Í¦Î¦Ï¦Ð¦Ñ¦Ò¦Ó¦Ô¦Õ¦Ö¦×¦Ø¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦§¡§¢§£§¤§¥§¦§§§¨§©§ª§«§¬§­§®§¯§°§±§²§³ ¡¦§¡§¢§£§¤§¥§¦§§§¨§©§ª§«§¬§­§®§¯§°§±§²§³ +§´§µ§¶§·§¸§¹§º§»§¼§½§¾§¿§À§Á¡¦¡¦¡¦¡¦¡¦¡¦ §´§µ§¶§·§¸§¹§º§»§¼§½§¾§¿§À§Á¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Ñ§Ò§Ó§Ô§Õ§Ö§×§Ø§Ù§Ú§Û ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Ñ§Ò§Ó§Ô§Õ§Ö§×§Ø§Ù§Ú§Û +§Ü§Ý§Þ§ß§à§á§â§ã§ä§å§æ§ç§è§é§ê§ë§ì§í§î§ï §Ü§Ý§Þ§ß§à§á§â§ã§ä§å§æ§ç§è§é§ê§ë§ì§í§î§ï +§ð§ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ §ð§ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¨¡¨¢¨£¨¤¨¥¨¦¨§¨¨¨©¨ª¨«¨¬¨­¨®¨¯¨°¨±¨²¨³ ¡¦¨¡¨¢¨£¨¤¨¥¨¦¨§¨¨¨©¨ª¨«¨¬¨­¨®¨¯¨°¨±¨²¨³ +¨´¨µ¨¶¨·¨¸¨¹¨º¨»¨¼¨½¨¾¨¿¨À¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¨´¨µ¨¶¨·¨¸¨¹¨º¨»¨¼¨½¨¾¨¿¨À¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³ ¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç °´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û °È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï °Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï +°ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ °ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ +¡¦Ï¡Ï¢Ï£Ï¤Ï¥Ï¦Ï§Ï¨Ï©ÏªÏ«Ï¬Ï­Ï®Ï¯Ï°Ï±Ï²Ï³ ¡¦Ï¡Ï¢Ï£Ï¤Ï¥Ï¦Ï§Ï¨Ï©ÏªÏ«Ï¬Ï­Ï®Ï¯Ï°Ï±Ï²Ï³ +ϴϵ϶ϷϸϹϺϻϼϽϾϿÏÀÏÁÏÂÏÃÏÄÏÅÏÆÏÇ Ï´ÏµÏ¶Ï·Ï¸Ï¹ÏºÏ»Ï¼Ï½Ï¾Ï¿ÏÀÏÁÏÂÏÃÏÄÏÅÏÆÏÇ +ÏÈÏÉÏÊÏËÏÌÏÍÏÎÏÏÏÐÏÑÏÒÏÓ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ÏÈÏÉÏÊÏËÏÌÏÍÏÎÏÏÏÐÏÑÏÒÏÓ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³ ¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³ +дежзийклмнопÐÀÐÁÐÂÐÃÐÄÐÅÐÆÐÇ Ð´ÐµÐ¶Ð·Ð¸Ð¹ÐºÐ»Ð¼Ð½Ð¾Ð¿ÐÀÐÁÐÂÐÃÐÄÐÅÐÆÐÇ +ÐÈÐÉÐÊÐËÐÌÐÍÐÎÐÏÐÐÐÑÐÒÐÓÐÔÐÕÐÖÐ×ÐØÐÙÐÚÐÛ ÐÈÐÉÐÊÐËÐÌÐÍÐÎÐÏÐÐÐÑÐÒÐÓÐÔÐÕÐÖÐ×ÐØÐÙÐÚÐÛ +ÐÜÐÝÐÞÐßÐàÐáÐâÐãÐäÐåÐæÐçÐèÐéÐêÐëÐìÐíÐîÐï ÐÜÐÝÐÞÐßÐàÐáÐâÐãÐäÐåÐæÐçÐèÐéÐêÐëÐìÐíÐîÐï +ÐðÐñÐòÐóÐôÐõÐöÐ÷ÐøÐùÐúÐûÐüÐýÐþ¡¦¡¦¡¦¡¦¡¦ ÐðÐñÐòÐóÐôÐõÐöÐ÷ÐøÐùÐúÐûÐüÐýÐþ¡¦¡¦¡¦¡¦¡¦ +¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³ ¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³ +ó´óµó¶ó·ó¸ó¹óºó»ó¼ó½ó¾ó¿óÀóÁóÂóÃóÄóÅóÆóÇ ó´óµó¶ó·ó¸ó¹óºó»ó¼ó½ó¾ó¿óÀóÁóÂóÃóÄóÅóÆóÇ +óÈóÉóÊóËóÌóÍóÎóÏóÐóÑóÒóÓóÔóÕóÖó×óØóÙóÚóÛ óÈóÉóÊóËóÌóÍóÎóÏóÐóÑóÒóÓóÔóÕóÖó×óØóÙóÚóÛ +óÜóÝóÞóßóàóáóâóãóäóåóæóçóèóéóêóëóìóíóîóï óÜóÝóÞóßóàóáóâóãóäóåóæóçóèóéóêóëóìóíóîóï +óðóñóòóóóôóõóöó÷óøóùóúóûóüóýóþ¡¦¡¦¡¦¡¦¡¦ óðóñóòóóóôóõóöó÷óøóùóúóûóüóýóþ¡¦¡¦¡¦¡¦¡¦ +¡¦ô¡ô¢ô£ô¤ô¥ô¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦ô¡ô¢ô£ô¤ô¥ô¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£±£±`; +£Ã£± CONVERT(`£Ã£±` using sjis) +¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡­¡®¡¯¡°¡±¡²¡³ ¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡­¡®¡¯¡°¡±¡²¡³ +¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç ¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿\¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç +¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û ¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û +¡Ü¡¾¡Þ¡ß¡à¡á¡â¡ã¡ä¡å¡æ¡ç¡è¡é¡ê¡ë¡ì¡í¡î¡ï ¡Ü¡¾¡Þ¡ß¡à¡á¡â¡ã¡ä¡å¡æ¡ç¡è¡é¡ê¡ë¡ì¡í¡î¡ï +¡ð¡ñ¡ò¡ó¡ô¡õ¡ö¡÷¡ø¡ù¡ú¡û¡ü¡ý¡þ¡¦¡¦¡¦¡¦¡¦ ¡ð¡ñ¡ò¡ó¡ô¡õ¡ö¡÷¡ø¡ù¡ú¡û¡ü¡ý¡þ¡¦¡¦¡¦¡¦¡¦ +¡¦¢¡¢¢¢£¢¤¢¥¢¦¢§¢¨¢©¢ª¢«¢¬¢­¢®¡¦¡¦¡¦¡¦¡¦ ¡¦¢¡¢¢¢£¢¤¢¥¢¦¢§¢¨¢©¢ª¢«¢¬¢­¢®¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¢º¢»¢¼¢½¢¾¢¿¢À¢Á¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¢º¢»¢¼¢½¢¾¢¿¢À¢Á¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¢Ê¢Ë¢Ì¢Í¢Î¢Ï¢Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¢Ê¢Ë¢Ì¢Í¢Î¢Ï¢Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¢Ü¢Ý¢Þ¢ß¢à¢á¢â¢ã¢ä¢å¢æ¢ç¢è¢é¢ê¡¦¡¦¡¦¡¦¡¦ ¢Ü¢Ý¢Þ¢ß¢à¢á¢â¢ã¢ä¢å¢æ¢ç¢è¢é¢ê¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¢ò¢ó¢ô¢õ¢ö¢÷¢ø¢ù¡¦¡¦¡¦¡¦¢þ¡¦¡¦¡¦¡¦¡¡ ¡¦¡¦¢ò¢ó¢ô¢õ¢ö¢÷¢ø¢ù¡¦¡¦¡¦¡¦¢þ¡¦¡¦¡¦¡¦¡¡ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦£°£±£²£³ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦£°£±£²£³ +£´£µ£¶£·£¸£¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦£Á£Â£Ã£Ä£Å£Æ£Ç £´£µ£¶£·£¸£¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦£Á£Â£Ã£Ä£Å£Æ£Ç +£È£É£Ê£Ë£Ì£Í£Î£Ï£Ð£Ñ£Ò£Ó£Ô£Õ£Ö£×£Ø£Ù£Ú¡¦ £È£É£Ê£Ë£Ì£Í£Î£Ï£Ð£Ñ£Ò£Ó£Ô£Õ£Ö£×£Ø£Ù£Ú¡¦ +¡¦¡¦¡¦¡¦¡¦£á£â£ã£ä£å£æ£ç£è£é£ê£ë£ì£í£î£ï ¡¦¡¦¡¦¡¦¡¦£á£â£ã£ä£å£æ£ç£è£é£ê£ë£ì£í£î£ï +£ð£ñ£ò£ó£ô£õ£ö£÷£ø£ù£ú¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ £ð£ñ£ò£ó£ô£õ£ö£÷£ø£ù£ú¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ ¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ +¤´¤µ¤¶¤·¤¸¤¹¤º¤»¤¼¤½¤¾¤¿¤À¤Á¤Â¤Ã¤Ä¤Å¤Æ¤Ç ¤´¤µ¤¶¤·¤¸¤¹¤º¤»¤¼¤½¤¾¤¿¤À¤Á¤Â¤Ã¤Ä¤Å¤Æ¤Ç +¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û ¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û +¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï ¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï +¤ð¤ñ¤ò¤ó¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¤ð¤ñ¤ò¤ó¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³ ¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³ +¥´¥µ¥¶¥·¥¸¥¹¥º¥»¥¼¥½¥¾¥¿¥À¥Á¥Â¥Ã¥Ä¥Å¥Æ¥Ç ¥´¥µ¥¶¥·¥¸¥¹¥º¥»¥¼¥½¥¾¥¿¥À¥Á¥Â¥Ã¥Ä¥Å¥Æ¥Ç +¥È¥É¥Ê¥Ë¥Ì¥Í¥Î¥Ï¥Ð¥Ñ¥Ò¥Ó¥Ô¥Õ¥Ö¥×¥Ø¥Ù¥Ú¥Û ¥È¥É¥Ê¥Ë¥Ì¥Í¥Î¥Ï¥Ð¥Ñ¥Ò¥Ó¥Ô¥Õ¥Ö¥×¥Ø¥Ù¥Ú¥Û +¥Ü¥Ý¥Þ¥ß¥à¥á¥â¥ã¥ä¥å¥æ¥ç¥è¥é¥ê¥ë¥ì¥í¥î¥ï ¥Ü¥Ý¥Þ¥ß¥à¥á¥â¥ã¥ä¥å¥æ¥ç¥è¥é¥ê¥ë¥ì¥í¥î¥ï +¥ð¥ñ¥ò¥ó¥ô¥õ¥ö¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¥ð¥ñ¥ò¥ó¥ô¥õ¥ö¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¦¡¦¢¦£¦¤¦¥¦¦¦§¦¨¦©¦ª¦«¦¬¦­¦®¦¯¦°¦±¦²¦³ ¡¦¦¡¦¢¦£¦¤¦¥¦¦¦§¦¨¦©¦ª¦«¦¬¦­¦®¦¯¦°¦±¦²¦³ +¦´¦µ¦¶¦·¦¸¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¦Á¦Â¦Ã¦Ä¦Å¦Æ¦Ç ¦´¦µ¦¶¦·¦¸¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¦Á¦Â¦Ã¦Ä¦Å¦Æ¦Ç +¦È¦É¦Ê¦Ë¦Ì¦Í¦Î¦Ï¦Ð¦Ñ¦Ò¦Ó¦Ô¦Õ¦Ö¦×¦Ø¡¦¡¦¡¦ ¦È¦É¦Ê¦Ë¦Ì¦Í¦Î¦Ï¦Ð¦Ñ¦Ò¦Ó¦Ô¦Õ¦Ö¦×¦Ø¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦§¡§¢§£§¤§¥§¦§§§¨§©§ª§«§¬§­§®§¯§°§±§²§³ ¡¦§¡§¢§£§¤§¥§¦§§§¨§©§ª§«§¬§­§®§¯§°§±§²§³ +§´§µ§¶§·§¸§¹§º§»§¼§½§¾§¿§À§Á¡¦¡¦¡¦¡¦¡¦¡¦ §´§µ§¶§·§¸§¹§º§»§¼§½§¾§¿§À§Á¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Ñ§Ò§Ó§Ô§Õ§Ö§×§Ø§Ù§Ú§Û ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Ñ§Ò§Ó§Ô§Õ§Ö§×§Ø§Ù§Ú§Û +§Ü§Ý§Þ§ß§à§á§â§ã§ä§å§æ§ç§è§é§ê§ë§ì§í§î§ï §Ü§Ý§Þ§ß§à§á§â§ã§ä§å§æ§ç§è§é§ê§ë§ì§í§î§ï +§ð§ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ §ð§ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¨¡¨¢¨£¨¤¨¥¨¦¨§¨¨¨©¨ª¨«¨¬¨­¨®¨¯¨°¨±¨²¨³ ¡¦¨¡¨¢¨£¨¤¨¥¨¦¨§¨¨¨©¨ª¨«¨¬¨­¨®¨¯¨°¨±¨²¨³ +¨´¨µ¨¶¨·¨¸¨¹¨º¨»¨¼¨½¨¾¨¿¨À¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¨´¨µ¨¶¨·¨¸¨¹¨º¨»¨¼¨½¨¾¨¿¨À¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³ ¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç °´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û °È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï °Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï +°ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ °ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ +¡¦Ï¡Ï¢Ï£Ï¤Ï¥Ï¦Ï§Ï¨Ï©ÏªÏ«Ï¬Ï­Ï®Ï¯Ï°Ï±Ï²Ï³ ¡¦Ï¡Ï¢Ï£Ï¤Ï¥Ï¦Ï§Ï¨Ï©ÏªÏ«Ï¬Ï­Ï®Ï¯Ï°Ï±Ï²Ï³ +ϴϵ϶ϷϸϹϺϻϼϽϾϿÏÀÏÁÏÂÏÃÏÄÏÅÏÆÏÇ Ï´ÏµÏ¶Ï·Ï¸Ï¹ÏºÏ»Ï¼Ï½Ï¾Ï¿ÏÀÏÁÏÂÏÃÏÄÏÅÏÆÏÇ +ÏÈÏÉÏÊÏËÏÌÏÍÏÎÏÏÏÐÏÑÏÒÏÓ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ÏÈÏÉÏÊÏËÏÌÏÍÏÎÏÏÏÐÏÑÏÒÏÓ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³ ¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³ +дежзийклмнопÐÀÐÁÐÂÐÃÐÄÐÅÐÆÐÇ Ð´ÐµÐ¶Ð·Ð¸Ð¹ÐºÐ»Ð¼Ð½Ð¾Ð¿ÐÀÐÁÐÂÐÃÐÄÐÅÐÆÐÇ +ÐÈÐÉÐÊÐËÐÌÐÍÐÎÐÏÐÐÐÑÐÒÐÓÐÔÐÕÐÖÐ×ÐØÐÙÐÚÐÛ ÐÈÐÉÐÊÐËÐÌÐÍÐÎÐÏÐÐÐÑÐÒÐÓÐÔÐÕÐÖÐ×ÐØÐÙÐÚÐÛ +ÐÜÐÝÐÞÐßÐàÐáÐâÐãÐäÐåÐæÐçÐèÐéÐêÐëÐìÐíÐîÐï ÐÜÐÝÐÞÐßÐàÐáÐâÐãÐäÐåÐæÐçÐèÐéÐêÐëÐìÐíÐîÐï +ÐðÐñÐòÐóÐôÐõÐöÐ÷ÐøÐùÐúÐûÐüÐýÐþ¡¦¡¦¡¦¡¦¡¦ ÐðÐñÐòÐóÐôÐõÐöÐ÷ÐøÐùÐúÐûÐüÐýÐþ¡¦¡¦¡¦¡¦¡¦ +¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³ ¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³ +ó´óµó¶ó·ó¸ó¹óºó»ó¼ó½ó¾ó¿óÀóÁóÂóÃóÄóÅóÆóÇ ó´óµó¶ó·ó¸ó¹óºó»ó¼ó½ó¾ó¿óÀóÁóÂóÃóÄóÅóÆóÇ +óÈóÉóÊóËóÌóÍóÎóÏóÐóÑóÒóÓóÔóÕóÖó×óØóÙóÚóÛ óÈóÉóÊóËóÌóÍóÎóÏóÐóÑóÒóÓóÔóÕóÖó×óØóÙóÚóÛ +óÜóÝóÞóßóàóáóâóãóäóåóæóçóèóéóêóëóìóíóîóï óÜóÝóÞóßóàóáóâóãóäóåóæóçóèóéóêóëóìóíóîóï +óðóñóòóóóôóõóöó÷óøóùóúóûóüóýóþ¡¦¡¦¡¦¡¦¡¦ óðóñóòóóóôóõóöó÷óøóùóúóûóüóýóþ¡¦¡¦¡¦¡¦¡¦ +¡¦ô¡ô¢ô£ô¤ô¥ô¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦ô¡ô¢ô£ô¤ô¥ô¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£±£²`; +£Ã£± CONVERT(`£Ã£±` using utf8) +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢¯¢°¢±¢²¢³ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢¯¢°¢±¢²¢³ +¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ ¡¦¢µ¢¶~¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢ë¢ì¢í¢î¢ï ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢ë¢ì¢í¢î¢ï +¢ð¢ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¢ð¢ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¦á¦â¦ã¦ä¦å¡¦¦ç¡¦¦é¦ê¡¦¦ì¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¦á¦â¦ã¦ä¦å¡¦¦ç¡¦¦é¦ê¡¦¦ì¡¦¡¦¡¦ +¡¦¦ñ¦ò¦ó¦ô¦õ¦ö¦÷¦ø¦ù¦ú¦û¦ü¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¦ñ¦ò¦ó¦ô¦õ¦ö¦÷¦ø¦ù¦ú¦û¦ü¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Â§Ã§Ä§Å§Æ§Ç ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Â§Ã§Ä§Å§Æ§Ç +§È§É§Ê§Ë§Ì§Í§Î¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ §È§É§Ê§Ë§Ì§Í§Î¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦§ò§ó§ô§õ§ö§÷§ø§ù§ú§û§ü§ý§þ¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦§ò§ó§ô§õ§ö§÷§ø§ù§ú§û§ü§ý§þ¡¦¡¦¡¦¡¦¡¦ +¡¦©¡©¢¡¦©¤¡¦©¦¡¦©¨©©¡¦©«©¬©­¡¦©¯©°¡¦¡¦¡¦ ¡¦©¡©¢¡¦©¤¡¦©¦¡¦©¨©©¡¦©«©¬©­¡¦©¯©°¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦©Á©Â©Ã©Ä©Å©Æ©Ç ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦©Á©Â©Ã©Ä©Å©Æ©Ç +©È©É©Ê©Ë©Ì©Í©Î©Ï©Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ©È©É©Ê©Ë©Ì©Í©Î©Ï©Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦ª¡ª¢ª£ª¤ª¥ª¦ª§ª¨ª©ªªª«ª¬ª­ª®ª¯ª°ª±ª²ª³ ¡¦ª¡ª¢ª£ª¤ª¥ª¦ª§ª¨ª©ªªª«ª¬ª­ª®ª¯ª°ª±ª²ª³ +ª´ªµª¶ª·ª¸¡¦ªºª»ª¼ª½ª¾ª¿ªÀªÁªÂªÃªÄªÅªÆªÇ ª´ªµª¶ª·ª¸¡¦ªºª»ª¼ª½ª¾ª¿ªÀªÁªÂªÃªÄªÅªÆªÇ +ªÈªÉªÊªËªÌªÍªÎªÏªÐªÑªÒªÓªÔªÕªÖª×ªØªÙªÚªÛ ªÈªÉªÊªËªÌªÍªÎªÏªÐªÑªÒªÓªÔªÕªÖª×ªØªÙªÚªÛ +ªÜªÝªÞªßªàªáªâªãªäªåªæªçªèªéªêªëªìªíªîªï ªÜªÝªÞªßªàªáªâªãªäªåªæªçªèªéªêªëªìªíªîªï +ªðªñªòªóªôªõªöª÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ªðªñªòªóªôªõªöª÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦«¡«¢«£«¤«¥«¦«§«¨«©«ª«««¬«­«®«¯«°«±«²«³ ¡¦«¡«¢«£«¤«¥«¦«§«¨«©«ª«««¬«­«®«¯«°«±«²«³ +«´«µ«¶«·«¸«¹«º«»¡¦«½«¾«¿«À«Á«Â«Ã¡¦«Å«Æ«Ç «´«µ«¶«·«¸«¹«º«»¡¦«½«¾«¿«À«Á«Â«Ã¡¦«Å«Æ«Ç +«È«É«Ê«Ë«Ì«Í«Î«Ï«Ð«Ñ«Ò«Ó«Ô«Õ«Ö«×«Ø«Ù«Ú«Û «È«É«Ê«Ë«Ì«Í«Î«Ï«Ð«Ñ«Ò«Ó«Ô«Õ«Ö«×«Ø«Ù«Ú«Û +«Ü«Ý«Þ«ß«à«á«â«ã«ä«å«æ«ç«è«é«ê«ë«ì«í«î«ï «Ü«Ý«Þ«ß«à«á«â«ã«ä«å«æ«ç«è«é«ê«ë«ì«í«î«ï +«ð«ñ«ò«ó«ô«õ«ö«÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ «ð«ñ«ò«ó«ô«õ«ö«÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³ ¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç °´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û °È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï °Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï +°ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ °ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ +¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³ ¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³ +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ +íÜíÝíÞíßíàíáíâí㡦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ íÜíÝíÞíßíàíáíâí㡦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£±£²`; +£Ã£± CONVERT(`£Ã£±` using ucs2) +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢¯¢°¢±¢²¢³ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢¯¢°¢±¢²¢³ +¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ ¡¦¢µ¢¶~¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢ë¢ì¢í¢î¢ï ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢ë¢ì¢í¢î¢ï +¢ð¢ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¢ð¢ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¦á¦â¦ã¦ä¦å¡¦¦ç¡¦¦é¦ê¡¦¦ì¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¦á¦â¦ã¦ä¦å¡¦¦ç¡¦¦é¦ê¡¦¦ì¡¦¡¦¡¦ +¡¦¦ñ¦ò¦ó¦ô¦õ¦ö¦÷¦ø¦ù¦ú¦û¦ü¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¦ñ¦ò¦ó¦ô¦õ¦ö¦÷¦ø¦ù¦ú¦û¦ü¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Â§Ã§Ä§Å§Æ§Ç ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Â§Ã§Ä§Å§Æ§Ç +§È§É§Ê§Ë§Ì§Í§Î¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ §È§É§Ê§Ë§Ì§Í§Î¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦§ò§ó§ô§õ§ö§÷§ø§ù§ú§û§ü§ý§þ¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦§ò§ó§ô§õ§ö§÷§ø§ù§ú§û§ü§ý§þ¡¦¡¦¡¦¡¦¡¦ +¡¦©¡©¢¡¦©¤¡¦©¦¡¦©¨©©¡¦©«©¬©­¡¦©¯©°¡¦¡¦¡¦ ¡¦©¡©¢¡¦©¤¡¦©¦¡¦©¨©©¡¦©«©¬©­¡¦©¯©°¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦©Á©Â©Ã©Ä©Å©Æ©Ç ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦©Á©Â©Ã©Ä©Å©Æ©Ç +©È©É©Ê©Ë©Ì©Í©Î©Ï©Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ©È©É©Ê©Ë©Ì©Í©Î©Ï©Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦ª¡ª¢ª£ª¤ª¥ª¦ª§ª¨ª©ªªª«ª¬ª­ª®ª¯ª°ª±ª²ª³ ¡¦ª¡ª¢ª£ª¤ª¥ª¦ª§ª¨ª©ªªª«ª¬ª­ª®ª¯ª°ª±ª²ª³ +ª´ªµª¶ª·ª¸¡¦ªºª»ª¼ª½ª¾ª¿ªÀªÁªÂªÃªÄªÅªÆªÇ ª´ªµª¶ª·ª¸¡¦ªºª»ª¼ª½ª¾ª¿ªÀªÁªÂªÃªÄªÅªÆªÇ +ªÈªÉªÊªËªÌªÍªÎªÏªÐªÑªÒªÓªÔªÕªÖª×ªØªÙªÚªÛ ªÈªÉªÊªËªÌªÍªÎªÏªÐªÑªÒªÓªÔªÕªÖª×ªØªÙªÚªÛ +ªÜªÝªÞªßªàªáªâªãªäªåªæªçªèªéªêªëªìªíªîªï ªÜªÝªÞªßªàªáªâªãªäªåªæªçªèªéªêªëªìªíªîªï +ªðªñªòªóªôªõªöª÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ªðªñªòªóªôªõªöª÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦«¡«¢«£«¤«¥«¦«§«¨«©«ª«««¬«­«®«¯«°«±«²«³ ¡¦«¡«¢«£«¤«¥«¦«§«¨«©«ª«««¬«­«®«¯«°«±«²«³ +«´«µ«¶«·«¸«¹«º«»¡¦«½«¾«¿«À«Á«Â«Ã¡¦«Å«Æ«Ç «´«µ«¶«·«¸«¹«º«»¡¦«½«¾«¿«À«Á«Â«Ã¡¦«Å«Æ«Ç +«È«É«Ê«Ë«Ì«Í«Î«Ï«Ð«Ñ«Ò«Ó«Ô«Õ«Ö«×«Ø«Ù«Ú«Û «È«É«Ê«Ë«Ì«Í«Î«Ï«Ð«Ñ«Ò«Ó«Ô«Õ«Ö«×«Ø«Ù«Ú«Û +«Ü«Ý«Þ«ß«à«á«â«ã«ä«å«æ«ç«è«é«ê«ë«ì«í«î«ï «Ü«Ý«Þ«ß«à«á«â«ã«ä«å«æ«ç«è«é«ê«ë«ì«í«î«ï +«ð«ñ«ò«ó«ô«õ«ö«÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ «ð«ñ«ò«ó«ô«õ«ö«÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³ ¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç °´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û °È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï °Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï +°ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ °ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ +¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³ ¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³ +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ +íÜíÝíÞíßíàíáíâí㡦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ íÜíÝíÞíßíàíáíâí㡦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£±£²`; +£Ã£± CONVERT(`£Ã£±` using sjis) +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢¯¢°¢±¢²¢³ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦????? +¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ ¡¦??~??¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦???¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢ë¢ì¢í¢î¢ï ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦????? +¢ð¢ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ??¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¦á¦â¦ã¦ä¦å¡¦¦ç¡¦¦é¦ê¡¦¦ì¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦?????¡¦?¡¦??¡¦?¡¦¡¦¡¦ +¡¦¦ñ¦ò¦ó¦ô¦õ¦ö¦÷¦ø¦ù¦ú¦û¦ü¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦????????????¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Â§Ã§Ä§Å§Æ§Ç ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦?????? +§È§É§Ê§Ë§Ì§Í§Î¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ???????¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦§ò§ó§ô§õ§ö§÷§ø§ù§ú§û§ü§ý§þ¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦?????????????¡¦¡¦¡¦¡¦¡¦ +¡¦©¡©¢¡¦©¤¡¦©¦¡¦©¨©©¡¦©«©¬©­¡¦©¯©°¡¦¡¦¡¦ ¡¦??¡¦?¡¦?¡¦??¡¦???¡¦??¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦©Á©Â©Ã©Ä©Å©Æ©Ç ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦??????? +©È©É©Ê©Ë©Ì©Í©Î©Ï©Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ?????????¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦ª¡ª¢ª£ª¤ª¥ª¦ª§ª¨ª©ªªª«ª¬ª­ª®ª¯ª°ª±ª²ª³ ¡¦??????????????????? +ª´ªµª¶ª·ª¸¡¦ªºª»ª¼ª½ª¾ª¿ªÀªÁªÂªÃªÄªÅªÆªÇ ?????¡¦?????????????? +ªÈªÉªÊªËªÌªÍªÎªÏªÐªÑªÒªÓªÔªÕªÖª×ªØªÙªÚªÛ ???????????????????? +ªÜªÝªÞªßªàªáªâªãªäªåªæªçªèªéªêªëªìªíªîªï ???????????????????? +ªðªñªòªóªôªõªöª÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ????????¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦«¡«¢«£«¤«¥«¦«§«¨«©«ª«««¬«­«®«¯«°«±«²«³ ¡¦??????????????????? +«´«µ«¶«·«¸«¹«º«»¡¦«½«¾«¿«À«Á«Â«Ã¡¦«Å«Æ«Ç ????????¡¦???????¡¦??? +«È«É«Ê«Ë«Ì«Í«Î«Ï«Ð«Ñ«Ò«Ó«Ô«Õ«Ö«×«Ø«Ù«Ú«Û ???????????????????? +«Ü«Ý«Þ«ß«à«á«â«ã«ä«å«æ«ç«è«é«ê«ë«ì«í«î«ï ???????????????????? +«ð«ñ«ò«ó«ô«õ«ö«÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ????????¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³ ¡¦??????????????????? +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç ???????????????????? +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û ???????????????????? +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï ???????????????????? +°ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ ???????????????¡¦¡¦¡¦¡¦¡¦ +¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³ ¡¦??????????????????? +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ ???????????????????? +íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ ???????????????????? +íÜíÝíÞíßíàíáíâí㡦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ????????¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +drop table `£Ô£±`; +drop table `£Ô£²`; +drop table `£Ô£³`; +drop table `£Ô£´`; +drop table `£Ô£µ`; +drop table `£Ô£¶`; +drop table `£Ô£·`; +drop table `£Ô£¸`; +drop table `£Ô£¹`; +drop table `£Ô£±£°`; +drop table `£Ô£±£±`; +drop table `£Ô£±£²`; diff --git a/mysql-test/suite/jp/r/jp_convert_utf8.result b/mysql-test/suite/jp/r/jp_convert_utf8.result new file mode 100755 index 00000000000..505d6c1cebf --- /dev/null +++ b/mysql-test/suite/jp/r/jp_convert_utf8.result @@ -0,0 +1,1514 @@ +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +drop table if exists `T11`; +drop table if exists `T12`; +SET NAMES utf8; +SET character_set_database = utf8; +CREATE TABLE `T1` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T11` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T12` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_utf8.dat' INTO TABLE `T1`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_utf8.dat' INTO TABLE `ï¼´ï¼’`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_utf8.dat' INTO TABLE `T3`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_utf8.dat' INTO TABLE `ï¼´ï¼”`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_utf8.dat' INTO TABLE `T5`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_utf8.dat' INTO TABLE `ï¼´ï¼–`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_utf8.dat' INTO TABLE `ï¼´ï¼—`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_utf8.dat' INTO TABLE `T8`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_utf8.dat' INTO TABLE `ï¼´ï¼™`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_utf8.dat' INTO TABLE `T1ï¼`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_utf8.dat' INTO TABLE `T11`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_utf8.dat' INTO TABLE `T12`; +SELECT `C1`, CONVERT(`C1` using ujis) FROM `T1`; +C1 CONVERT(`C1` using ujis) + !"#$%&'()*+,-./ !"#$%&'()*+,-./ + 。「」、・ヲァィゥェォャュョッ 。「」、・ヲァィゥェォャュョッ +0123456789:;<=>? 0123456789:;<=>? +@ABCDEFGHIJKLMNO @ABCDEFGHIJKLMNO +abcdefghijklmno abcdefghijklmno +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[\]^_ +pqrstuvwxyz{|}~ pqrstuvwxyz{|}~ +ーアイウエオカキクケコサシスセソ ーアイウエオカキクケコサシスセソ +ï¾€ï¾ï¾‚テトナニヌネノハヒフï¾ï¾Žï¾ ï¾€ï¾ï¾‚テトナニヌネノハヒフï¾ï¾Žï¾ +ï¾ï¾‘メモヤユヨラリルレロワï¾ï¾žï¾Ÿ ï¾ï¾‘メモヤユヨラリルレロワï¾ï¾žï¾Ÿ +SELECT `C1`, CONVERT(`C1` using ucs2) FROM `T1`; +C1 CONVERT(`C1` using ucs2) + !"#$%&'()*+,-./ !"#$%&'()*+,-./ + 。「」、・ヲァィゥェォャュョッ 。「」、・ヲァィゥェォャュョッ +0123456789:;<=>? 0123456789:;<=>? +@ABCDEFGHIJKLMNO @ABCDEFGHIJKLMNO +abcdefghijklmno abcdefghijklmno +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[\]^_ +pqrstuvwxyz{|}~ pqrstuvwxyz{|}~ +ーアイウエオカキクケコサシスセソ ーアイウエオカキクケコサシスセソ +ï¾€ï¾ï¾‚テトナニヌネノハヒフï¾ï¾Žï¾ ï¾€ï¾ï¾‚テトナニヌネノハヒフï¾ï¾Žï¾ +ï¾ï¾‘メモヤユヨラリルレロワï¾ï¾žï¾Ÿ ï¾ï¾‘メモヤユヨラリルレロワï¾ï¾žï¾Ÿ +SELECT `C1`, CONVERT(`C1` using sjis) FROM `T1`; +C1 CONVERT(`C1` using sjis) + !"#$%&'()*+,-./ !"#$%&'()*+,-./ + 。「」、・ヲァィゥェォャュョッ 。「」、・ヲァィゥェォャュョッ +0123456789:;<=>? 0123456789:;<=>? +@ABCDEFGHIJKLMNO @ABCDEFGHIJKLMNO +abcdefghijklmno abcdefghijklmno +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[\]^_ +pqrstuvwxyz{|}~ pqrstuvwxyz{|}~ +ーアイウエオカキクケコサシスセソ ーアイウエオカキクケコサシスセソ +ï¾€ï¾ï¾‚テトナニヌネノハヒフï¾ï¾Žï¾ ï¾€ï¾ï¾‚テトナニヌネノハヒフï¾ï¾Žï¾ +ï¾ï¾‘メモヤユヨラリルレロワï¾ï¾žï¾Ÿ ï¾ï¾‘メモヤユヨラリルレロワï¾ï¾žï¾Ÿ +SELECT `C1`, CONVERT(`C1` using ujis) FROM `ï¼´ï¼’`; +C1 CONVERT(`C1` using ujis) +θικλμνξοπÏστυφχψω・・・ θικλμνξοπÏστυφχψω・・・ +ΥΦΧΨΩ・・・・・・・・αβγδεζη ΥΦΧΨΩ・・・・・・・・αβγδεζη +клмнопрÑÑ‚ÑƒÑ„Ñ…Ñ†Ñ‡ÑˆÑ‰ÑŠÑ‹ÑŒÑ ÐºÐ»Ð¼Ð½Ð¾Ð¿Ñ€ÑÑ‚ÑƒÑ„Ñ…Ñ†Ñ‡ÑˆÑ‰ÑŠÑ‹ÑŒÑ +ТУФХЦЧШЩЪЫЬЭЮЯ・・・・・・ ТУФХЦЧШЩЪЫЬЭЮЯ・・・・・・ +ÑŽÑ・・・・・・・・・・・・・・・・・・ ÑŽÑ・・・・・・・・・・・・・・・・・・ +“â€ï¼ˆï¼‰ã€”〕[]{ï½ã€ˆã€‰ã€Šã€‹ã€Œã€ã€Žã€ã€ã€‘ “â€ï¼ˆï¼‰ã€”〕[]{ï½ã€ˆã€‰ã€Šã€‹ã€Œã€ã€Žã€ã€ã€‘ +∠⊥⌒∂∇≡≒≪≫√∽âˆâˆµâˆ«âˆ¬ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» ∠⊥⌒∂∇≡≒≪≫√∽âˆâˆµâˆ«âˆ¬ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» +┫┻╋┠┯┨┷┿â”┰┥┸╂・・・・・・・ ┫┻╋┠┯┨┷┿â”┰┥┸╂・・・・・・・ +  ã€ã€‚,.・:;?ï¼ã‚›ã‚œÂ´ï½€Â¨ï¼¾ï¿£ï¼¿ãƒ½   ã€ã€‚,.・:;?ï¼ã‚›ã‚œÂ´ï½€Â¨ï¼¾ï¿£ï¼¿ãƒ½ +ã”ã•ã–ã—ã˜ã™ãšã›ãœããžãŸã ã¡ã¢ã£ã¤ã¥ã¦ã§ ã”ã•ã–ã—ã˜ã™ãšã›ãœããžãŸã ã¡ã¢ã£ã¤ã¥ã¦ã§ +ã¨ã©ãªã«ã¬ã­ã®ã¯ã°ã±ã²ã³ã´ãµã¶ã·ã¸ã¹ãºã» ã¨ã©ãªã«ã¬ã­ã®ã¯ã°ã±ã²ã³ã´ãµã¶ã·ã¸ã¹ãºã» +ã¼ã½ã¾ã¿ã‚€ã‚もゃやゅゆょよらりるれã‚ゎ゠ã¼ã½ã¾ã¿ã‚€ã‚もゃやゅゆょよらりるれã‚ゎ゠+ã‚ゑをん・・・・・・・・・・・・・・・・ ã‚ゑをん・・・・・・・・・・・・・・・・ +ゴサザシジスズセゼソゾタダãƒãƒ‚ッツヅテデ ゴサザシジスズセゼソゾタダãƒãƒ‚ッツヅテデ +トドナニヌãƒãƒŽãƒãƒãƒ‘ヒビピフブプヘベペホ トドナニヌãƒãƒŽãƒãƒãƒ‘ヒビピフブプヘベペホ +ボãƒãƒžãƒŸãƒ ãƒ¡ãƒ¢ãƒ£ãƒ¤ãƒ¥ãƒ¦ãƒ§ãƒ¨ãƒ©ãƒªãƒ«ãƒ¬ãƒ­ãƒ®ãƒ¯ ボãƒãƒžãƒŸãƒ ãƒ¡ãƒ¢ãƒ£ãƒ¤ãƒ¥ãƒ¦ãƒ§ãƒ¨ãƒ©ãƒªãƒ«ãƒ¬ãƒ­ãƒ®ãƒ¯ +ヰヱヲンヴヵヶ・・・・・・・・・・・・・ ヰヱヲンヴヵヶ・・・・・・・・・・・・・ +・ΑΒΓΔΕΖΗΘΙΚΛΜÎΞΟΠΡΣΤ ・ΑΒΓΔΕΖΗΘΙΚΛΜÎΞΟΠΡΣΤ +・ÐБВГДЕÐЖЗИЙКЛМÐОПРС ・ÐБВГДЕÐЖЗИЙКЛМÐОПРС +・─│┌â”┘└├┬┤┴┼â”┃â”┓┛┗┣┳ ・─│┌â”┘└├┬┤┴┼â”┃â”┓┛┗┣┳ +・◆□■△▲▽▼※〒→â†â†‘↓〓・・・・・ ・◆□■△▲▽▼※〒→â†â†‘↓〓・・・・・ +・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’㓠・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“ +・ァアィイゥウェエォオカガキギクグケゲコ ・ァアィイゥウェエォオカガキギクグケゲコ +・・ʼn♯♭♪†‡¶・・・・◯・・・・  ・・ʼn♯♭♪†‡¶・・・・◯・・・・  +・・∧∨¬⇒⇔∀∃・・・・・・・・・・・ ・・∧∨¬⇒⇔∀∃・・・・・・・・・・・ +・・・・・・∈∋⊆⊇⊂⊃∪∩・・・・・・ ・・・・・・∈∋⊆⊇⊂⊃∪∩・・・・・・ +・・・・・・・・・абвгдеёжзий ・・・・・・・・・абвгдеёжзий +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・ï¼ï¼‘23 ・・・・・・・・・・・・・・・・ï¼ï¼‘23 +・・・・・ï½ï½‚cdefghijklï½ï½Žï½ ・・・・・ï½ï½‚cdefghijklï½ï½Žï½ +ãƒ»äºœå”–å¨ƒé˜¿å“€æ„›æŒ¨å§¶é€¢è‘µèŒœç©æ‚ªæ¡æ¸¥æ—­è‘¦èЦ靵 ãƒ»äºœå”–å¨ƒé˜¿å“€æ„›æŒ¨å§¶é€¢è‘µèŒœç©æ‚ªæ¡æ¸¥æ—­è‘¦èЦ靵 +・堯槇é™ç‘¤å‡œç†™ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» ・堯槇é™ç‘¤å‡œç†™ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» +・弌ä¸ä¸•个丱丶丼丿乂乖乘亂亅豫亊舒å¼äºŽäºž ・弌ä¸ä¸•个丱丶丼丿乂乖乘亂亅豫亊舒å¼äºŽäºž +・蓮連錬呂魯櫓炉賂路露労å©å»Šå¼„æœ—æ¥¼æ¦”æµªæ¼ ãƒ»è“®é€£éŒ¬å‘‚é­¯æ«“ç‚‰è³‚è·¯éœ²åŠ´å©å»Šå¼„æœ—æ¥¼æ¦”æµªæ¼ +・éµéµžéµ¤éµ‘éµéµ™éµ²é¶‰é¶‡é¶«éµ¯éµºé¶šé¶¤é¶©é¶²é·„é·é¶» ・éµéµžéµ¤éµ‘éµéµ™éµ²é¶‰é¶‡é¶«éµ¯éµºé¶šé¶¤é¶©é¶²é·„é·é¶» +ヾã‚ゞ〃ä»ã€…〆〇ー―â€ï¼ï¼¼ã€œâ€–|…‥‘’ ヾã‚ゞ〃ä»ã€…〆〇ー―â€ï¼?〜‖|…‥‘’ +亟亠亢亰亳亶从ä»ä»„仆仂仗仞仭仟价伉佚估佛 亟亠亢亰亳亶从ä»ä»„仆仂仗仞仭仟价伉佚估佛 +ä½ä½—佇佶侈ä¾ä¾˜ä½»ä½©ä½°ä¾‘佯來侖儘俔俟俎俘俛 ä½ä½—佇佶侈ä¾ä¾˜ä½»ä½©ä½°ä¾‘佯來侖儘俔俟俎俘俛 +俑俚ä¿ä¿¤ä¿¥å€šå€¨å€”倪倥倅伜俶倡倩倬俾俯們倆 俑俚ä¿ä¿¤ä¿¥å€šå€¨å€”倪倥倅伜俶倡倩倬俾俯們倆 +åƒå‡æœƒå•ååˆåšå–å¬å¸å‚€å‚šå‚…傴傲・・・・・ åƒå‡æœƒå•ååˆåšå–å¬å¸å‚€å‚šå‚…傴傲・・・・・ +枠鷲亙亘é°è©«è—蕨椀湾碗腕・・・・・・・・ 枠鷲亙亘é°è©«è—蕨椀湾碗腕・・・・・・・・ +梓圧斡扱宛å§è™»é£´çµ¢ç¶¾é®Žæˆ–粟袷安庵按暗案闇 梓圧斡扱宛å§è™»é£´çµ¢ç¶¾é®Žæˆ–粟袷安庵按暗案闇 +牢狼篭è€è¾è‹éƒŽå…­éº“禄肋録論倭和話歪賄脇惑 牢狼篭è€è¾è‹éƒŽå…­éº“禄肋録論倭和話歪賄脇惑 +移維緯胃èŽè¡£è¬‚é•éºåŒ»äº•亥域育éƒç£¯ä¸€å£±æº¢é€¸ 移維緯胃èŽè¡£è¬‚é•éºåŒ»äº•亥域育éƒç£¯ä¸€å£±æº¢é€¸ +稲茨芋鰯å…å°å’½å“¡å› å§»å¼•飲淫胤蔭・・・・・ 稲茨芋鰯å…å°å’½å“¡å› å§»å¼•飲淫胤蔭・・・・・ +éžæä»¥ä¼Šä½ä¾å‰å›²å¤·å§”å¨å°‰æƒŸæ„慰易椅為ç•ç•° éžæä»¥ä¼Šä½ä¾å‰å›²å¤·å§”å¨å°‰æƒŸæ„慰易椅為ç•ç•° +鶸鶺鷆é·é·‚鷙鷓鷸鷦鷭鷯鷽鸚鸛鸞鹵鹹鹽éºéºˆ 鶸鶺鷆é·é·‚鷙鷓鷸鷦鷭鷯鷽鸚鸛鸞鹵鹹鹽éºéºˆ +麋麌麒麕麑éºéº¥éº©éº¸éºªéº­é¡é»Œé»Žé»é»é»”é»œé»žé» éº‹éºŒéº’éº•éº‘éºéº¥éº©éº¸éºªéº­é¡é»Œé»Žé»é»é»”é»œé»žé» +黠黥黨黯黴黶黷黹黻黼黽鼇鼈皷鼕鼡鼬鼾齊齒 黠黥黨黯黴黶黷黹黻黼黽鼇鼈皷鼕鼡鼬鼾齊齒 +齔齣齟齠齡齦齧齬齪齷齲齶龕龜龠・・・・・ 齔齣齟齠齡齦齧齬齪齷齲齶龕龜龠・・・・・ +$¢£%#&*@§☆★○â—◎◇・・・・・ $¢£%#&*@§☆★○â—◎◇・・・・・ ++â€Â±Ã—÷ï¼â‰ ï¼œï¼žâ‰¦â‰§âˆžâˆ´â™‚♀°′″℃¥ +â€Â±Ã—÷ï¼â‰ ï¼œï¼žâ‰¦â‰§âˆžâˆ´â™‚♀°′″℃¥ +456789・・・・・・・ABCDEFG 456789・・・・・・・ABCDEFG +HIJKLMNOPQRSTUVWXYZ・ HIJKLMNOPQRSTUVWXYZ・ +ï½ï½‘rstuvwxyz・・・・・・・・・ ï½ï½‘rstuvwxyz・・・・・・・・・ +SELECT `C1`, CONVERT(`C1` using ucs2) FROM `ï¼´ï¼’`; +C1 CONVERT(`C1` using ucs2) +θικλμνξοπÏστυφχψω・・・ θικλμνξοπÏστυφχψω・・・ +ΥΦΧΨΩ・・・・・・・・αβγδεζη ΥΦΧΨΩ・・・・・・・・αβγδεζη +клмнопрÑÑ‚ÑƒÑ„Ñ…Ñ†Ñ‡ÑˆÑ‰ÑŠÑ‹ÑŒÑ ÐºÐ»Ð¼Ð½Ð¾Ð¿Ñ€ÑÑ‚ÑƒÑ„Ñ…Ñ†Ñ‡ÑˆÑ‰ÑŠÑ‹ÑŒÑ +ТУФХЦЧШЩЪЫЬЭЮЯ・・・・・・ ТУФХЦЧШЩЪЫЬЭЮЯ・・・・・・ +ÑŽÑ・・・・・・・・・・・・・・・・・・ ÑŽÑ・・・・・・・・・・・・・・・・・・ +“â€ï¼ˆï¼‰ã€”〕[]{ï½ã€ˆã€‰ã€Šã€‹ã€Œã€ã€Žã€ã€ã€‘ “â€ï¼ˆï¼‰ã€”〕[]{ï½ã€ˆã€‰ã€Šã€‹ã€Œã€ã€Žã€ã€ã€‘ +∠⊥⌒∂∇≡≒≪≫√∽âˆâˆµâˆ«âˆ¬ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» ∠⊥⌒∂∇≡≒≪≫√∽âˆâˆµâˆ«âˆ¬ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» +┫┻╋┠┯┨┷┿â”┰┥┸╂・・・・・・・ ┫┻╋┠┯┨┷┿â”┰┥┸╂・・・・・・・ +  ã€ã€‚,.・:;?ï¼ã‚›ã‚œÂ´ï½€Â¨ï¼¾ï¿£ï¼¿ãƒ½   ã€ã€‚,.・:;?ï¼ã‚›ã‚œÂ´ï½€Â¨ï¼¾ï¿£ï¼¿ãƒ½ +ã”ã•ã–ã—ã˜ã™ãšã›ãœããžãŸã ã¡ã¢ã£ã¤ã¥ã¦ã§ ã”ã•ã–ã—ã˜ã™ãšã›ãœããžãŸã ã¡ã¢ã£ã¤ã¥ã¦ã§ +ã¨ã©ãªã«ã¬ã­ã®ã¯ã°ã±ã²ã³ã´ãµã¶ã·ã¸ã¹ãºã» ã¨ã©ãªã«ã¬ã­ã®ã¯ã°ã±ã²ã³ã´ãµã¶ã·ã¸ã¹ãºã» +ã¼ã½ã¾ã¿ã‚€ã‚もゃやゅゆょよらりるれã‚ゎ゠ã¼ã½ã¾ã¿ã‚€ã‚もゃやゅゆょよらりるれã‚ゎ゠+ã‚ゑをん・・・・・・・・・・・・・・・・ ã‚ゑをん・・・・・・・・・・・・・・・・ +ゴサザシジスズセゼソゾタダãƒãƒ‚ッツヅテデ ゴサザシジスズセゼソゾタダãƒãƒ‚ッツヅテデ +トドナニヌãƒãƒŽãƒãƒãƒ‘ヒビピフブプヘベペホ トドナニヌãƒãƒŽãƒãƒãƒ‘ヒビピフブプヘベペホ +ボãƒãƒžãƒŸãƒ ãƒ¡ãƒ¢ãƒ£ãƒ¤ãƒ¥ãƒ¦ãƒ§ãƒ¨ãƒ©ãƒªãƒ«ãƒ¬ãƒ­ãƒ®ãƒ¯ ボãƒãƒžãƒŸãƒ ãƒ¡ãƒ¢ãƒ£ãƒ¤ãƒ¥ãƒ¦ãƒ§ãƒ¨ãƒ©ãƒªãƒ«ãƒ¬ãƒ­ãƒ®ãƒ¯ +ヰヱヲンヴヵヶ・・・・・・・・・・・・・ ヰヱヲンヴヵヶ・・・・・・・・・・・・・ +・ΑΒΓΔΕΖΗΘΙΚΛΜÎΞΟΠΡΣΤ ・ΑΒΓΔΕΖΗΘΙΚΛΜÎΞΟΠΡΣΤ +・ÐБВГДЕÐЖЗИЙКЛМÐОПРС ・ÐБВГДЕÐЖЗИЙКЛМÐОПРС +・─│┌â”┘└├┬┤┴┼â”┃â”┓┛┗┣┳ ・─│┌â”┘└├┬┤┴┼â”┃â”┓┛┗┣┳ +・◆□■△▲▽▼※〒→â†â†‘↓〓・・・・・ ・◆□■△▲▽▼※〒→â†â†‘↓〓・・・・・ +・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’㓠・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“ +・ァアィイゥウェエォオカガキギクグケゲコ ・ァアィイゥウェエォオカガキギクグケゲコ +・・ʼn♯♭♪†‡¶・・・・◯・・・・  ・・ʼn♯♭♪†‡¶・・・・◯・・・・  +・・∧∨¬⇒⇔∀∃・・・・・・・・・・・ ・・∧∨¬⇒⇔∀∃・・・・・・・・・・・ +・・・・・・∈∋⊆⊇⊂⊃∪∩・・・・・・ ・・・・・・∈∋⊆⊇⊂⊃∪∩・・・・・・ +・・・・・・・・・абвгдеёжзий ・・・・・・・・・абвгдеёжзий +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・ï¼ï¼‘23 ・・・・・・・・・・・・・・・・ï¼ï¼‘23 +・・・・・ï½ï½‚cdefghijklï½ï½Žï½ ・・・・・ï½ï½‚cdefghijklï½ï½Žï½ +ãƒ»äºœå”–å¨ƒé˜¿å“€æ„›æŒ¨å§¶é€¢è‘µèŒœç©æ‚ªæ¡æ¸¥æ—­è‘¦èЦ靵 ãƒ»äºœå”–å¨ƒé˜¿å“€æ„›æŒ¨å§¶é€¢è‘µèŒœç©æ‚ªæ¡æ¸¥æ—­è‘¦èЦ靵 +・堯槇é™ç‘¤å‡œç†™ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» ・堯槇é™ç‘¤å‡œç†™ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» +・弌ä¸ä¸•个丱丶丼丿乂乖乘亂亅豫亊舒å¼äºŽäºž ・弌ä¸ä¸•个丱丶丼丿乂乖乘亂亅豫亊舒å¼äºŽäºž +・蓮連錬呂魯櫓炉賂路露労å©å»Šå¼„æœ—æ¥¼æ¦”æµªæ¼ ãƒ»è“®é€£éŒ¬å‘‚é­¯æ«“ç‚‰è³‚è·¯éœ²åŠ´å©å»Šå¼„æœ—æ¥¼æ¦”æµªæ¼ +・éµéµžéµ¤éµ‘éµéµ™éµ²é¶‰é¶‡é¶«éµ¯éµºé¶šé¶¤é¶©é¶²é·„é·é¶» ・éµéµžéµ¤éµ‘éµéµ™éµ²é¶‰é¶‡é¶«éµ¯éµºé¶šé¶¤é¶©é¶²é·„é·é¶» +ヾã‚ゞ〃ä»ã€…〆〇ー―â€ï¼ï¼¼ã€œâ€–|…‥‘’ ヾã‚ゞ〃ä»ã€…〆〇ー―â€ï¼ï¼¼ã€œâ€–|…‥‘’ +亟亠亢亰亳亶从ä»ä»„仆仂仗仞仭仟价伉佚估佛 亟亠亢亰亳亶从ä»ä»„仆仂仗仞仭仟价伉佚估佛 +ä½ä½—佇佶侈ä¾ä¾˜ä½»ä½©ä½°ä¾‘佯來侖儘俔俟俎俘俛 ä½ä½—佇佶侈ä¾ä¾˜ä½»ä½©ä½°ä¾‘佯來侖儘俔俟俎俘俛 +俑俚ä¿ä¿¤ä¿¥å€šå€¨å€”倪倥倅伜俶倡倩倬俾俯們倆 俑俚ä¿ä¿¤ä¿¥å€šå€¨å€”倪倥倅伜俶倡倩倬俾俯們倆 +åƒå‡æœƒå•ååˆåšå–å¬å¸å‚€å‚šå‚…傴傲・・・・・ åƒå‡æœƒå•ååˆåšå–å¬å¸å‚€å‚šå‚…傴傲・・・・・ +枠鷲亙亘é°è©«è—蕨椀湾碗腕・・・・・・・・ 枠鷲亙亘é°è©«è—蕨椀湾碗腕・・・・・・・・ +梓圧斡扱宛å§è™»é£´çµ¢ç¶¾é®Žæˆ–粟袷安庵按暗案闇 梓圧斡扱宛å§è™»é£´çµ¢ç¶¾é®Žæˆ–粟袷安庵按暗案闇 +牢狼篭è€è¾è‹éƒŽå…­éº“禄肋録論倭和話歪賄脇惑 牢狼篭è€è¾è‹éƒŽå…­éº“禄肋録論倭和話歪賄脇惑 +移維緯胃èŽè¡£è¬‚é•éºåŒ»äº•亥域育éƒç£¯ä¸€å£±æº¢é€¸ 移維緯胃èŽè¡£è¬‚é•éºåŒ»äº•亥域育éƒç£¯ä¸€å£±æº¢é€¸ +稲茨芋鰯å…å°å’½å“¡å› å§»å¼•飲淫胤蔭・・・・・ 稲茨芋鰯å…å°å’½å“¡å› å§»å¼•飲淫胤蔭・・・・・ +éžæä»¥ä¼Šä½ä¾å‰å›²å¤·å§”å¨å°‰æƒŸæ„慰易椅為ç•ç•° éžæä»¥ä¼Šä½ä¾å‰å›²å¤·å§”å¨å°‰æƒŸæ„慰易椅為ç•ç•° +鶸鶺鷆é·é·‚鷙鷓鷸鷦鷭鷯鷽鸚鸛鸞鹵鹹鹽éºéºˆ 鶸鶺鷆é·é·‚鷙鷓鷸鷦鷭鷯鷽鸚鸛鸞鹵鹹鹽éºéºˆ +麋麌麒麕麑éºéº¥éº©éº¸éºªéº­é¡é»Œé»Žé»é»é»”é»œé»žé» éº‹éºŒéº’éº•éº‘éºéº¥éº©éº¸éºªéº­é¡é»Œé»Žé»é»é»”é»œé»žé» +黠黥黨黯黴黶黷黹黻黼黽鼇鼈皷鼕鼡鼬鼾齊齒 黠黥黨黯黴黶黷黹黻黼黽鼇鼈皷鼕鼡鼬鼾齊齒 +齔齣齟齠齡齦齧齬齪齷齲齶龕龜龠・・・・・ 齔齣齟齠齡齦齧齬齪齷齲齶龕龜龠・・・・・ +$¢£%#&*@§☆★○â—◎◇・・・・・ $¢£%#&*@§☆★○â—◎◇・・・・・ ++â€Â±Ã—÷ï¼â‰ ï¼œï¼žâ‰¦â‰§âˆžâˆ´â™‚♀°′″℃¥ +â€Â±Ã—÷ï¼â‰ ï¼œï¼žâ‰¦â‰§âˆžâˆ´â™‚♀°′″℃¥ +456789・・・・・・・ABCDEFG 456789・・・・・・・ABCDEFG +HIJKLMNOPQRSTUVWXYZ・ HIJKLMNOPQRSTUVWXYZ・ +ï½ï½‘rstuvwxyz・・・・・・・・・ ï½ï½‘rstuvwxyz・・・・・・・・・ +SELECT `C1`, CONVERT(`C1` using sjis) FROM `ï¼´ï¼’`; +C1 CONVERT(`C1` using sjis) +θικλμνξοπÏστυφχψω・・・ θικλμνξοπÏστυφχψω・・・ +ΥΦΧΨΩ・・・・・・・・αβγδεζη ΥΦΧΨΩ・・・・・・・・αβγδεζη +клмнопрÑÑ‚ÑƒÑ„Ñ…Ñ†Ñ‡ÑˆÑ‰ÑŠÑ‹ÑŒÑ ÐºÐ»Ð¼Ð½Ð¾Ð¿Ñ€ÑÑ‚ÑƒÑ„Ñ…Ñ†Ñ‡ÑˆÑ‰ÑŠÑ‹ÑŒÑ +ТУФХЦЧШЩЪЫЬЭЮЯ・・・・・・ ТУФХЦЧШЩЪЫЬЭЮЯ・・・・・・ +ÑŽÑ・・・・・・・・・・・・・・・・・・ ÑŽÑ・・・・・・・・・・・・・・・・・・ +“â€ï¼ˆï¼‰ã€”〕[]{ï½ã€ˆã€‰ã€Šã€‹ã€Œã€ã€Žã€ã€ã€‘ “â€ï¼ˆï¼‰ã€”〕[]{ï½ã€ˆã€‰ã€Šã€‹ã€Œã€ã€Žã€ã€ã€‘ +∠⊥⌒∂∇≡≒≪≫√∽âˆâˆµâˆ«âˆ¬ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» ∠⊥⌒∂∇≡≒≪≫√∽âˆâˆµâˆ«âˆ¬ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» +┫┻╋┠┯┨┷┿â”┰┥┸╂・・・・・・・ ┫┻╋┠┯┨┷┿â”┰┥┸╂・・・・・・・ +  ã€ã€‚,.・:;?ï¼ã‚›ã‚œÂ´ï½€Â¨ï¼¾ï¿£ï¼¿ãƒ½   ã€ã€‚,.・:;?ï¼ã‚›ã‚œÂ´ï½€Â¨ï¼¾ï¿£ï¼¿ãƒ½ +ã”ã•ã–ã—ã˜ã™ãšã›ãœããžãŸã ã¡ã¢ã£ã¤ã¥ã¦ã§ ã”ã•ã–ã—ã˜ã™ãšã›ãœããžãŸã ã¡ã¢ã£ã¤ã¥ã¦ã§ +ã¨ã©ãªã«ã¬ã­ã®ã¯ã°ã±ã²ã³ã´ãµã¶ã·ã¸ã¹ãºã» ã¨ã©ãªã«ã¬ã­ã®ã¯ã°ã±ã²ã³ã´ãµã¶ã·ã¸ã¹ãºã» +ã¼ã½ã¾ã¿ã‚€ã‚もゃやゅゆょよらりるれã‚ゎ゠ã¼ã½ã¾ã¿ã‚€ã‚もゃやゅゆょよらりるれã‚ゎ゠+ã‚ゑをん・・・・・・・・・・・・・・・・ ã‚ゑをん・・・・・・・・・・・・・・・・ +ゴサザシジスズセゼソゾタダãƒãƒ‚ッツヅテデ ゴサザシジスズセゼソゾタダãƒãƒ‚ッツヅテデ +トドナニヌãƒãƒŽãƒãƒãƒ‘ヒビピフブプヘベペホ トドナニヌãƒãƒŽãƒãƒãƒ‘ヒビピフブプヘベペホ +ボãƒãƒžãƒŸãƒ ãƒ¡ãƒ¢ãƒ£ãƒ¤ãƒ¥ãƒ¦ãƒ§ãƒ¨ãƒ©ãƒªãƒ«ãƒ¬ãƒ­ãƒ®ãƒ¯ ボãƒãƒžãƒŸãƒ ãƒ¡ãƒ¢ãƒ£ãƒ¤ãƒ¥ãƒ¦ãƒ§ãƒ¨ãƒ©ãƒªãƒ«ãƒ¬ãƒ­ãƒ®ãƒ¯ +ヰヱヲンヴヵヶ・・・・・・・・・・・・・ ヰヱヲンヴヵヶ・・・・・・・・・・・・・ +・ΑΒΓΔΕΖΗΘΙΚΛΜÎΞΟΠΡΣΤ ・ΑΒΓΔΕΖΗΘΙΚΛΜÎΞΟΠΡΣΤ +・ÐБВГДЕÐЖЗИЙКЛМÐОПРС ・ÐБВГДЕÐЖЗИЙКЛМÐОПРС +・─│┌â”┘└├┬┤┴┼â”┃â”┓┛┗┣┳ ・─│┌â”┘└├┬┤┴┼â”┃â”┓┛┗┣┳ +・◆□■△▲▽▼※〒→â†â†‘↓〓・・・・・ ・◆□■△▲▽▼※〒→â†â†‘↓〓・・・・・ +・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’㓠・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“ +・ァアィイゥウェエォオカガキギクグケゲコ ・ァアィイゥウェエォオカガキギクグケゲコ +・・ʼn♯♭♪†‡¶・・・・◯・・・・  ・・ʼn♯♭♪†‡¶・・・・◯・・・・  +・・∧∨¬⇒⇔∀∃・・・・・・・・・・・ ・・∧∨¬⇒⇔∀∃・・・・・・・・・・・ +・・・・・・∈∋⊆⊇⊂⊃∪∩・・・・・・ ・・・・・・∈∋⊆⊇⊂⊃∪∩・・・・・・ +・・・・・・・・・абвгдеёжзий ・・・・・・・・・абвгдеёжзий +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・ï¼ï¼‘23 ・・・・・・・・・・・・・・・・ï¼ï¼‘23 +・・・・・ï½ï½‚cdefghijklï½ï½Žï½ ・・・・・ï½ï½‚cdefghijklï½ï½Žï½ +ãƒ»äºœå”–å¨ƒé˜¿å“€æ„›æŒ¨å§¶é€¢è‘µèŒœç©æ‚ªæ¡æ¸¥æ—­è‘¦èЦ靵 ãƒ»äºœå”–å¨ƒé˜¿å“€æ„›æŒ¨å§¶é€¢è‘µèŒœç©æ‚ªæ¡æ¸¥æ—­è‘¦èЦ靵 +・堯槇é™ç‘¤å‡œç†™ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» ・堯槇é™ç‘¤å‡œç†™ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» +・弌ä¸ä¸•个丱丶丼丿乂乖乘亂亅豫亊舒å¼äºŽäºž ・弌ä¸ä¸•个丱丶丼丿乂乖乘亂亅豫亊舒å¼äºŽäºž +・蓮連錬呂魯櫓炉賂路露労å©å»Šå¼„æœ—æ¥¼æ¦”æµªæ¼ ãƒ»è“®é€£éŒ¬å‘‚é­¯æ«“ç‚‰è³‚è·¯éœ²åŠ´å©å»Šå¼„æœ—æ¥¼æ¦”æµªæ¼ +・éµéµžéµ¤éµ‘éµéµ™éµ²é¶‰é¶‡é¶«éµ¯éµºé¶šé¶¤é¶©é¶²é·„é·é¶» ・éµéµžéµ¤éµ‘éµéµ™éµ²é¶‰é¶‡é¶«éµ¯éµºé¶šé¶¤é¶©é¶²é·„é·é¶» +ヾã‚ゞ〃ä»ã€…〆〇ー―â€ï¼ï¼¼ã€œâ€–|…‥‘’ ヾã‚ゞ〃ä»ã€…〆〇ー―â€ï¼?〜‖|…‥‘’ +亟亠亢亰亳亶从ä»ä»„仆仂仗仞仭仟价伉佚估佛 亟亠亢亰亳亶从ä»ä»„仆仂仗仞仭仟价伉佚估佛 +ä½ä½—佇佶侈ä¾ä¾˜ä½»ä½©ä½°ä¾‘佯來侖儘俔俟俎俘俛 ä½ä½—佇佶侈ä¾ä¾˜ä½»ä½©ä½°ä¾‘佯來侖儘俔俟俎俘俛 +俑俚ä¿ä¿¤ä¿¥å€šå€¨å€”倪倥倅伜俶倡倩倬俾俯們倆 俑俚ä¿ä¿¤ä¿¥å€šå€¨å€”倪倥倅伜俶倡倩倬俾俯們倆 +åƒå‡æœƒå•ååˆåšå–å¬å¸å‚€å‚šå‚…傴傲・・・・・ åƒå‡æœƒå•ååˆåšå–å¬å¸å‚€å‚šå‚…傴傲・・・・・ +枠鷲亙亘é°è©«è—蕨椀湾碗腕・・・・・・・・ 枠鷲亙亘é°è©«è—蕨椀湾碗腕・・・・・・・・ +梓圧斡扱宛å§è™»é£´çµ¢ç¶¾é®Žæˆ–粟袷安庵按暗案闇 梓圧斡扱宛å§è™»é£´çµ¢ç¶¾é®Žæˆ–粟袷安庵按暗案闇 +牢狼篭è€è¾è‹éƒŽå…­éº“禄肋録論倭和話歪賄脇惑 牢狼篭è€è¾è‹éƒŽå…­éº“禄肋録論倭和話歪賄脇惑 +移維緯胃èŽè¡£è¬‚é•éºåŒ»äº•亥域育éƒç£¯ä¸€å£±æº¢é€¸ 移維緯胃èŽè¡£è¬‚é•éºåŒ»äº•亥域育éƒç£¯ä¸€å£±æº¢é€¸ +稲茨芋鰯å…å°å’½å“¡å› å§»å¼•飲淫胤蔭・・・・・ 稲茨芋鰯å…å°å’½å“¡å› å§»å¼•飲淫胤蔭・・・・・ +éžæä»¥ä¼Šä½ä¾å‰å›²å¤·å§”å¨å°‰æƒŸæ„慰易椅為ç•ç•° éžæä»¥ä¼Šä½ä¾å‰å›²å¤·å§”å¨å°‰æƒŸæ„慰易椅為ç•ç•° +鶸鶺鷆é·é·‚鷙鷓鷸鷦鷭鷯鷽鸚鸛鸞鹵鹹鹽éºéºˆ 鶸鶺鷆é·é·‚鷙鷓鷸鷦鷭鷯鷽鸚鸛鸞鹵鹹鹽éºéºˆ +麋麌麒麕麑éºéº¥éº©éº¸éºªéº­é¡é»Œé»Žé»é»é»”é»œé»žé» éº‹éºŒéº’éº•éº‘éºéº¥éº©éº¸éºªéº­é¡é»Œé»Žé»é»é»”é»œé»žé» +黠黥黨黯黴黶黷黹黻黼黽鼇鼈皷鼕鼡鼬鼾齊齒 黠黥黨黯黴黶黷黹黻黼黽鼇鼈皷鼕鼡鼬鼾齊齒 +齔齣齟齠齡齦齧齬齪齷齲齶龕龜龠・・・・・ 齔齣齟齠齡齦齧齬齪齷齲齶龕龜龠・・・・・ +$¢£%#&*@§☆★○â—◎◇・・・・・ $¢£%#&*@§☆★○â—◎◇・・・・・ ++â€Â±Ã—÷ï¼â‰ ï¼œï¼žâ‰¦â‰§âˆžâˆ´â™‚♀°′″℃¥ +â€Â±Ã—÷ï¼â‰ ï¼œï¼žâ‰¦â‰§âˆžâˆ´â™‚♀°′″℃¥ +456789・・・・・・・ABCDEFG 456789・・・・・・・ABCDEFG +HIJKLMNOPQRSTUVWXYZ・ HIJKLMNOPQRSTUVWXYZ・ +ï½ï½‘rstuvwxyz・・・・・・・・・ ï½ï½‘rstuvwxyz・・・・・・・・・ +SELECT `C1`, CONVERT(`C1` using ujis) FROM `T3`; +C1 CONVERT(`C1` using ujis) +êěėēęǵÄğ・ġĥíìïîÇ・īįĩ êěėēęǵÄğ・ġĥíìïîÇ・īįĩ +ÊĚĖĒĘ・ĜĞĢĠĤÃÃŒÃÃŽÇİĪĮĨ ÊĚĖĒĘ・ĜĞĢĠĤÃÃŒÃÃŽÇİĪĮĨ +ĴĶĹĽĻŃŇŅÑÓÒÖÔǑÅŌÕŔŘŖ ĴĶĹĽĻŃŇŅÑÓÒÖÔǑÅŌÕŔŘŖ +ĵķĺľļńňņñóòöôǒőÅõŕřŗ ĵķĺľļńňņñóòöôǒőÅõŕřŗ +ŚŜŠŞŤŢÚÙÜÛŬǓŰŪŲŮŨǗǛǙ ŚŜŠŞŤŢÚÙÜÛŬǓŰŪŲŮŨǗǛǙ +śŚşťţúùüûŭǔűūųůũǘǜǚ śŚşťţúùüûŭǔűūųůũǘǜǚ +ǕŴßŶŹŽŻ・・・・・・・・・・・・ ǕŴßŶŹŽŻ・・・・・・・・・・・・ +ǖŵýÿŷźžż・・・・・・・・・・・・ ǖŵýÿŷźžż・・・・・・・・・・・・ +¤№・・・・・・・・・・・・・・・・・・ ¤№・・・・・・・・・・・・・・・・・・ +łŀʼnŋøœßŧþ・・・・・・・・・・・ łŀʼnŋøœßŧþ・・・・・・・・・・・ +ЈЉЊЋЌЎÐ・・・・・・・・・・・・・ ЈЉЊЋЌЎÐ・・・・・・・・・・・・・ +・ÃÀÄÂĂÇĀĄÅÃĆĈČÇĊĎÉÈË ・ÃÀÄÂĂÇĀĄÅÃĆĈČÇĊĎÉÈË +・áàäâăǎÄąåãćĉÄçċÄéèë ・áàäâăǎÄąåãćĉÄçċÄéèë +・ÆÄ・Ħ・IJ・ÅĿ・ŊØŒ・ŦÞ・・・ ・ÆÄ・Ħ・IJ・ÅĿ・ŊØŒ・ŦÞ・・・ +・˛˚~΄΅・・・・・・・・¡¦¿・・・ ・˛˚?΄΅・・・・・・・・¡¦¿・・・ +・άέήίϊÎόςÏϋΰώ・・・・・・・ ・άέήίϊÎόςÏϋΰώ・・・・・・・ +・・ђѓєѕіїјљњћќўџ・・・・・ ・・ђѓєѕіїјљњћќўџ・・・・・ +・・・・・ΆΈΉΊΪ・Ό・ΎΫ・Î・・・ ・・・・・ΆΈΉΊΪ・Ό・ΎΫ・Î・・・ +・・・・・・・・・・・・・æđðħıijĸ ・・・・・・・・・・・・・æđðħıijĸ +・・・・・・・・・・・・・・ЂЃЄЅІЇ ・・・・・・・・・・・・・・ЂЃЄЅІЇ +・・・・・・・・・・・・・・・ºª©®™ ・・・・・・・・・・・・・・・ºª©®™ +ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»Ë˜Ë‡Â¸Ë™Ë ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»Ë˜Ë‡Â¸Ë™Ë +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・丂丄丅丌丒丟丣两丨丫丮丯丰丵乀ä¹ä¹„乇乑 ・丂丄丅丌丒丟丣两丨丫丮丯丰丵乀ä¹ä¹„乇乑 +・黸黿鼂鼃鼉é¼é¼é¼‘鼒鼔鼖鼗鼙鼚鼛鼟鼢鼦鼪 ・黸黿鼂鼃鼉é¼é¼é¼‘鼒鼔鼖鼗鼙鼚鼛鼟鼢鼦鼪 +乚乜乣乨乩乴乵乹乿äºäº–亗äºäº¯äº¹ä»ƒä»ä»šä»›ä»  乚乜乣乨乩乴乵乹乿äºäº–亗äºäº¯äº¹ä»ƒä»ä»šä»›ä»  +仡仢仨仯仱仳仵份仾仿伀伂伃伈伋伌伒伕伖众 仡仢仨仯仱仳仵份仾仿伀伂伃伈伋伌伒伕伖众 +伙伮伱你伳伵伷伹伻伾佀佂佈佉佋佌佒佔佖佘 伙伮伱你伳伵伷伹伻伾佀佂佈佉佋佌佒佔佖佘 +佟佣佪佬佮佱佷佸佹佺佽佾ä¾ä¾‚侄・・・・・ 佟佣佪佬佮佱佷佸佹佺佽佾ä¾ä¾‚侄・・・・・ +鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 +齗齘齚é½é½žé½¨é½©é½­é½®é½¯é½°é½±é½³é½µé½ºé½½é¾é¾é¾‘é¾’ 齗齘齚é½é½žé½¨é½©é½­é½®é½¯é½°é½±é½³é½µé½ºé½½é¾é¾é¾‘é¾’ +龔龖龗龞龡龢龣龥・・・・・・・・・・・・ 龔龖龗龞龡龢龣龥・・・・・・・・・・・・ +SELECT `C1`, CONVERT(`C1` using ucs2) FROM `T3`; +C1 CONVERT(`C1` using ucs2) +êěėēęǵÄğ・ġĥíìïîÇ・īįĩ êěėēęǵÄğ・ġĥíìïîÇ・īįĩ +ÊĚĖĒĘ・ĜĞĢĠĤÃÃŒÃÃŽÇİĪĮĨ ÊĚĖĒĘ・ĜĞĢĠĤÃÃŒÃÃŽÇİĪĮĨ +ĴĶĹĽĻŃŇŅÑÓÒÖÔǑÅŌÕŔŘŖ ĴĶĹĽĻŃŇŅÑÓÒÖÔǑÅŌÕŔŘŖ +ĵķĺľļńňņñóòöôǒőÅõŕřŗ ĵķĺľļńňņñóòöôǒőÅõŕřŗ +ŚŜŠŞŤŢÚÙÜÛŬǓŰŪŲŮŨǗǛǙ ŚŜŠŞŤŢÚÙÜÛŬǓŰŪŲŮŨǗǛǙ +śŚşťţúùüûŭǔűūųůũǘǜǚ śŚşťţúùüûŭǔűūųůũǘǜǚ +ǕŴßŶŹŽŻ・・・・・・・・・・・・ ǕŴßŶŹŽŻ・・・・・・・・・・・・ +ǖŵýÿŷźžż・・・・・・・・・・・・ ǖŵýÿŷźžż・・・・・・・・・・・・ +¤№・・・・・・・・・・・・・・・・・・ ¤№・・・・・・・・・・・・・・・・・・ +łŀʼnŋøœßŧþ・・・・・・・・・・・ łŀʼnŋøœßŧþ・・・・・・・・・・・ +ЈЉЊЋЌЎÐ・・・・・・・・・・・・・ ЈЉЊЋЌЎÐ・・・・・・・・・・・・・ +・ÃÀÄÂĂÇĀĄÅÃĆĈČÇĊĎÉÈË ・ÃÀÄÂĂÇĀĄÅÃĆĈČÇĊĎÉÈË +・áàäâăǎÄąåãćĉÄçċÄéèë ・áàäâăǎÄąåãćĉÄçċÄéèë +・ÆÄ・Ħ・IJ・ÅĿ・ŊØŒ・ŦÞ・・・ ・ÆÄ・Ħ・IJ・ÅĿ・ŊØŒ・ŦÞ・・・ +・˛˚~΄΅・・・・・・・・¡¦¿・・・ ・˛˚~΄΅・・・・・・・・¡¦¿・・・ +・άέήίϊÎόςÏϋΰώ・・・・・・・ ・άέήίϊÎόςÏϋΰώ・・・・・・・ +・・ђѓєѕіїјљњћќўџ・・・・・ ・・ђѓєѕіїјљњћќўџ・・・・・ +・・・・・ΆΈΉΊΪ・Ό・ΎΫ・Î・・・ ・・・・・ΆΈΉΊΪ・Ό・ΎΫ・Î・・・ +・・・・・・・・・・・・・æđðħıijĸ ・・・・・・・・・・・・・æđðħıijĸ +・・・・・・・・・・・・・・ЂЃЄЅІЇ ・・・・・・・・・・・・・・ЂЃЄЅІЇ +・・・・・・・・・・・・・・・ºª©®™ ・・・・・・・・・・・・・・・ºª©®™ +ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»Ë˜Ë‡Â¸Ë™Ë ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»Ë˜Ë‡Â¸Ë™Ë +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・丂丄丅丌丒丟丣两丨丫丮丯丰丵乀ä¹ä¹„乇乑 ・丂丄丅丌丒丟丣两丨丫丮丯丰丵乀ä¹ä¹„乇乑 +・黸黿鼂鼃鼉é¼é¼é¼‘鼒鼔鼖鼗鼙鼚鼛鼟鼢鼦鼪 ・黸黿鼂鼃鼉é¼é¼é¼‘鼒鼔鼖鼗鼙鼚鼛鼟鼢鼦鼪 +乚乜乣乨乩乴乵乹乿äºäº–亗äºäº¯äº¹ä»ƒä»ä»šä»›ä»  乚乜乣乨乩乴乵乹乿äºäº–亗äºäº¯äº¹ä»ƒä»ä»šä»›ä»  +仡仢仨仯仱仳仵份仾仿伀伂伃伈伋伌伒伕伖众 仡仢仨仯仱仳仵份仾仿伀伂伃伈伋伌伒伕伖众 +伙伮伱你伳伵伷伹伻伾佀佂佈佉佋佌佒佔佖佘 伙伮伱你伳伵伷伹伻伾佀佂佈佉佋佌佒佔佖佘 +佟佣佪佬佮佱佷佸佹佺佽佾ä¾ä¾‚侄・・・・・ 佟佣佪佬佮佱佷佸佹佺佽佾ä¾ä¾‚侄・・・・・ +鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 +齗齘齚é½é½žé½¨é½©é½­é½®é½¯é½°é½±é½³é½µé½ºé½½é¾é¾é¾‘é¾’ 齗齘齚é½é½žé½¨é½©é½­é½®é½¯é½°é½±é½³é½µé½ºé½½é¾é¾é¾‘é¾’ +龔龖龗龞龡龢龣龥・・・・・・・・・・・・ 龔龖龗龞龡龢龣龥・・・・・・・・・・・・ +SELECT `C1`, CONVERT(`C1` using sjis) FROM `T3`; +C1 CONVERT(`C1` using sjis) +êěėēęǵÄğ・ġĥíìïîÇ・īįĩ ????????・???????・??? +ÊĚĖĒĘ・ĜĞĢĠĤÃÃŒÃÃŽÇİĪĮĨ ?????・?????????????? +ĴĶĹĽĻŃŇŅÑÓÒÖÔǑÅŌÕŔŘŖ ???????????????????? +ĵķĺľļńňņñóòöôǒőÅõŕřŗ ???????????????????? +ŚŜŠŞŤŢÚÙÜÛŬǓŰŪŲŮŨǗǛǙ ???????????????????? +śŚşťţúùüûŭǔűūųůũǘǜǚ ???????????????????? +ǕŴßŶŹŽŻ・・・・・・・・・・・・ ????????・・・・・・・・・・・・ +ǖŵýÿŷźžż・・・・・・・・・・・・ ????????・・・・・・・・・・・・ +¤№・・・・・・・・・・・・・・・・・・ ??・・・・・・・・・・・・・・・・・・ +łŀʼnŋøœßŧþ・・・・・・・・・・・ ?????????・・・・・・・・・・・ +ЈЉЊЋЌЎÐ・・・・・・・・・・・・・ ???????・・・・・・・・・・・・・ +・ÃÀÄÂĂÇĀĄÅÃĆĈČÇĊĎÉÈË ・??????????????????? +・áàäâăǎÄąåãćĉÄçċÄéèë ・??????????????????? +・ÆÄ・Ħ・IJ・ÅĿ・ŊØŒ・ŦÞ・・・ ・??・?・?・??・???・??・・・ +・˛˚~΄΅・・・・・・・・¡¦¿・・・ ・?????・・・・・・・・???・・・ +・άέήίϊÎόςÏϋΰώ・・・・・・・ ・????????????・・・・・・・ +・・ђѓєѕіїјљњћќўџ・・・・・ ・・?????????????・・・・・ +・・・・・ΆΈΉΊΪ・Ό・ΎΫ・Î・・・ ・・・・・?????・?・??・?・・・ +・・・・・・・・・・・・・æđðħıijĸ ・・・・・・・・・・・・・??????? +・・・・・・・・・・・・・・ЂЃЄЅІЇ ・・・・・・・・・・・・・・?????? +・・・・・・・・・・・・・・・ºª©®™ ・・・・・・・・・・・・・・・????? +ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»Ë˜Ë‡Â¸Ë™Ë ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»????? +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・丂丄丅丌丒丟丣两丨丫丮丯丰丵乀ä¹ä¹„乇乑 ・??????????????????? +・黸黿鼂鼃鼉é¼é¼é¼‘鼒鼔鼖鼗鼙鼚鼛鼟鼢鼦鼪 ・??????????????????? +乚乜乣乨乩乴乵乹乿äºäº–亗äºäº¯äº¹ä»ƒä»ä»šä»›ä»  ???????????????????? +仡仢仨仯仱仳仵份仾仿伀伂伃伈伋伌伒伕伖众 ???????????????????? +伙伮伱你伳伵伷伹伻伾佀佂佈佉佋佌佒佔佖佘 ???????????????????? +佟佣佪佬佮佱佷佸佹佺佽佾ä¾ä¾‚侄・・・・・ ???????????????・・・・・ +鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 ???????????????????? +齗齘齚é½é½žé½¨é½©é½­é½®é½¯é½°é½±é½³é½µé½ºé½½é¾é¾é¾‘é¾’ ???????????????????? +龔龖龗龞龡龢龣龥・・・・・・・・・・・・ ????????・・・・・・・・・・・・ +SELECT `C1`, CONVERT(`C1` using ujis) FROM `ï¼´ï¼”`; +C1 CONVERT(`C1` using ujis) + !"#$%&'()*+,-./ !"#$%&'()*+,-./ + 。「」、・ヲァィゥェォャュョッ 。「」、・ヲァィゥェォャュョッ +0123456789:;<=>? 0123456789:;<=>? +@ABCDEFGHIJKLMNO @ABCDEFGHIJKLMNO +abcdefghijklmno abcdefghijklmno +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[\]^_ +pqrstuvwxyz{|}~ pqrstuvwxyz{|}~ +ーアイウエオカキクケコサシスセソ ーアイウエオカキクケコサシスセソ +ï¾€ï¾ï¾‚テトナニヌネノハヒフï¾ï¾Žï¾ ï¾€ï¾ï¾‚テトナニヌネノハヒフï¾ï¾Žï¾ +ï¾ï¾‘メモヤユヨラリルレロワï¾ï¾žï¾Ÿ ï¾ï¾‘メモヤユヨラリルレロワï¾ï¾žï¾Ÿ +SELECT `C1`, CONVERT(`C1` using ucs2) FROM `ï¼´ï¼”`; +C1 CONVERT(`C1` using ucs2) + !"#$%&'()*+,-./ !"#$%&'()*+,-./ + 。「」、・ヲァィゥェォャュョッ 。「」、・ヲァィゥェォャュョッ +0123456789:;<=>? 0123456789:;<=>? +@ABCDEFGHIJKLMNO @ABCDEFGHIJKLMNO +abcdefghijklmno abcdefghijklmno +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[\]^_ +pqrstuvwxyz{|}~ pqrstuvwxyz{|}~ +ーアイウエオカキクケコサシスセソ ーアイウエオカキクケコサシスセソ +ï¾€ï¾ï¾‚テトナニヌネノハヒフï¾ï¾Žï¾ ï¾€ï¾ï¾‚テトナニヌネノハヒフï¾ï¾Žï¾ +ï¾ï¾‘メモヤユヨラリルレロワï¾ï¾žï¾Ÿ ï¾ï¾‘メモヤユヨラリルレロワï¾ï¾žï¾Ÿ +SELECT `C1`, CONVERT(`C1` using sjis) FROM `ï¼´ï¼”`; +C1 CONVERT(`C1` using sjis) + !"#$%&'()*+,-./ !"#$%&'()*+,-./ + 。「」、・ヲァィゥェォャュョッ 。「」、・ヲァィゥェォャュョッ +0123456789:;<=>? 0123456789:;<=>? +@ABCDEFGHIJKLMNO @ABCDEFGHIJKLMNO +abcdefghijklmno abcdefghijklmno +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[\]^_ +pqrstuvwxyz{|}~ pqrstuvwxyz{|}~ +ーアイウエオカキクケコサシスセソ ーアイウエオカキクケコサシスセソ +ï¾€ï¾ï¾‚テトナニヌネノハヒフï¾ï¾Žï¾ ï¾€ï¾ï¾‚テトナニヌネノハヒフï¾ï¾Žï¾ +ï¾ï¾‘メモヤユヨラリルレロワï¾ï¾žï¾Ÿ ï¾ï¾‘メモヤユヨラリルレロワï¾ï¾žï¾Ÿ +SELECT `C1`, CONVERT(`C1` using ujis) FROM `T5`; +C1 CONVERT(`C1` using ujis) +θικλμνξοπÏστυφχψω・・・ θικλμνξοπÏστυφχψω・・・ +ΥΦΧΨΩ・・・・・・・・αβγδεζη ΥΦΧΨΩ・・・・・・・・αβγδεζη +клмнопрÑÑ‚ÑƒÑ„Ñ…Ñ†Ñ‡ÑˆÑ‰ÑŠÑ‹ÑŒÑ ÐºÐ»Ð¼Ð½Ð¾Ð¿Ñ€ÑÑ‚ÑƒÑ„Ñ…Ñ†Ñ‡ÑˆÑ‰ÑŠÑ‹ÑŒÑ +ТУФХЦЧШЩЪЫЬЭЮЯ・・・・・・ ТУФХЦЧШЩЪЫЬЭЮЯ・・・・・・ +ÑŽÑ・・・・・・・・・・・・・・・・・・ ÑŽÑ・・・・・・・・・・・・・・・・・・ +“â€ï¼ˆï¼‰ã€”〕[]{ï½ã€ˆã€‰ã€Šã€‹ã€Œã€ã€Žã€ã€ã€‘ “â€ï¼ˆï¼‰ã€”〕[]{ï½ã€ˆã€‰ã€Šã€‹ã€Œã€ã€Žã€ã€ã€‘ +∠⊥⌒∂∇≡≒≪≫√∽âˆâˆµâˆ«âˆ¬ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» ∠⊥⌒∂∇≡≒≪≫√∽âˆâˆµâˆ«âˆ¬ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» +┫┻╋┠┯┨┷┿â”┰┥┸╂・・・・・・・ ┫┻╋┠┯┨┷┿â”┰┥┸╂・・・・・・・ +  ã€ã€‚,.・:;?ï¼ã‚›ã‚œÂ´ï½€Â¨ï¼¾ï¿£ï¼¿ãƒ½   ã€ã€‚,.・:;?ï¼ã‚›ã‚œÂ´ï½€Â¨ï¼¾ï¿£ï¼¿ãƒ½ +ã”ã•ã–ã—ã˜ã™ãšã›ãœããžãŸã ã¡ã¢ã£ã¤ã¥ã¦ã§ ã”ã•ã–ã—ã˜ã™ãšã›ãœããžãŸã ã¡ã¢ã£ã¤ã¥ã¦ã§ +ã¨ã©ãªã«ã¬ã­ã®ã¯ã°ã±ã²ã³ã´ãµã¶ã·ã¸ã¹ãºã» ã¨ã©ãªã«ã¬ã­ã®ã¯ã°ã±ã²ã³ã´ãµã¶ã·ã¸ã¹ãºã» +ã¼ã½ã¾ã¿ã‚€ã‚もゃやゅゆょよらりるれã‚ゎ゠ã¼ã½ã¾ã¿ã‚€ã‚もゃやゅゆょよらりるれã‚ゎ゠+ã‚ゑをん・・・・・・・・・・・・・・・・ ã‚ゑをん・・・・・・・・・・・・・・・・ +ゴサザシジスズセゼソゾタダãƒãƒ‚ッツヅテデ ゴサザシジスズセゼソゾタダãƒãƒ‚ッツヅテデ +トドナニヌãƒãƒŽãƒãƒãƒ‘ヒビピフブプヘベペホ トドナニヌãƒãƒŽãƒãƒãƒ‘ヒビピフブプヘベペホ +ボãƒãƒžãƒŸãƒ ãƒ¡ãƒ¢ãƒ£ãƒ¤ãƒ¥ãƒ¦ãƒ§ãƒ¨ãƒ©ãƒªãƒ«ãƒ¬ãƒ­ãƒ®ãƒ¯ ボãƒãƒžãƒŸãƒ ãƒ¡ãƒ¢ãƒ£ãƒ¤ãƒ¥ãƒ¦ãƒ§ãƒ¨ãƒ©ãƒªãƒ«ãƒ¬ãƒ­ãƒ®ãƒ¯ +ヰヱヲンヴヵヶ・・・・・・・・・・・・・ ヰヱヲンヴヵヶ・・・・・・・・・・・・・ +・ΑΒΓΔΕΖΗΘΙΚΛΜÎΞΟΠΡΣΤ ・ΑΒΓΔΕΖΗΘΙΚΛΜÎΞΟΠΡΣΤ +・ÐБВГДЕÐЖЗИЙКЛМÐОПРС ・ÐБВГДЕÐЖЗИЙКЛМÐОПРС +・─│┌â”┘└├┬┤┴┼â”┃â”┓┛┗┣┳ ・─│┌â”┘└├┬┤┴┼â”┃â”┓┛┗┣┳ +・◆□■△▲▽▼※〒→â†â†‘↓〓・・・・・ ・◆□■△▲▽▼※〒→â†â†‘↓〓・・・・・ +・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’㓠・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“ +・ァアィイゥウェエォオカガキギクグケゲコ ・ァアィイゥウェエォオカガキギクグケゲコ +・・ʼn♯♭♪†‡¶・・・・◯・・・・  ・・ʼn♯♭♪†‡¶・・・・◯・・・・  +・・∧∨¬⇒⇔∀∃・・・・・・・・・・・ ・・∧∨¬⇒⇔∀∃・・・・・・・・・・・ +・・・・・・∈∋⊆⊇⊂⊃∪∩・・・・・・ ・・・・・・∈∋⊆⊇⊂⊃∪∩・・・・・・ +・・・・・・・・・абвгдеёжзий ・・・・・・・・・абвгдеёжзий +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・ï¼ï¼‘23 ・・・・・・・・・・・・・・・・ï¼ï¼‘23 +・・・・・ï½ï½‚cdefghijklï½ï½Žï½ ・・・・・ï½ï½‚cdefghijklï½ï½Žï½ +ãƒ»äºœå”–å¨ƒé˜¿å“€æ„›æŒ¨å§¶é€¢è‘µèŒœç©æ‚ªæ¡æ¸¥æ—­è‘¦èЦ靵 ãƒ»äºœå”–å¨ƒé˜¿å“€æ„›æŒ¨å§¶é€¢è‘µèŒœç©æ‚ªæ¡æ¸¥æ—­è‘¦èЦ靵 +・堯槇é™ç‘¤å‡œç†™ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» ・堯槇é™ç‘¤å‡œç†™ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» +・弌ä¸ä¸•个丱丶丼丿乂乖乘亂亅豫亊舒å¼äºŽäºž ・弌ä¸ä¸•个丱丶丼丿乂乖乘亂亅豫亊舒å¼äºŽäºž +・蓮連錬呂魯櫓炉賂路露労å©å»Šå¼„æœ—æ¥¼æ¦”æµªæ¼ ãƒ»è“®é€£éŒ¬å‘‚é­¯æ«“ç‚‰è³‚è·¯éœ²åŠ´å©å»Šå¼„æœ—æ¥¼æ¦”æµªæ¼ +・éµéµžéµ¤éµ‘éµéµ™éµ²é¶‰é¶‡é¶«éµ¯éµºé¶šé¶¤é¶©é¶²é·„é·é¶» ・éµéµžéµ¤éµ‘éµéµ™éµ²é¶‰é¶‡é¶«éµ¯éµºé¶šé¶¤é¶©é¶²é·„é·é¶» +ヾã‚ゞ〃ä»ã€…〆〇ー―â€ï¼ï¼¼ã€œâ€–|…‥‘’ ヾã‚ゞ〃ä»ã€…〆〇ー―â€ï¼?〜‖|…‥‘’ +亟亠亢亰亳亶从ä»ä»„仆仂仗仞仭仟价伉佚估佛 亟亠亢亰亳亶从ä»ä»„仆仂仗仞仭仟价伉佚估佛 +ä½ä½—佇佶侈ä¾ä¾˜ä½»ä½©ä½°ä¾‘佯來侖儘俔俟俎俘俛 ä½ä½—佇佶侈ä¾ä¾˜ä½»ä½©ä½°ä¾‘佯來侖儘俔俟俎俘俛 +俑俚ä¿ä¿¤ä¿¥å€šå€¨å€”倪倥倅伜俶倡倩倬俾俯們倆 俑俚ä¿ä¿¤ä¿¥å€šå€¨å€”倪倥倅伜俶倡倩倬俾俯們倆 +åƒå‡æœƒå•ååˆåšå–å¬å¸å‚€å‚šå‚…傴傲・・・・・ åƒå‡æœƒå•ååˆåšå–å¬å¸å‚€å‚šå‚…傴傲・・・・・ +枠鷲亙亘é°è©«è—蕨椀湾碗腕・・・・・・・・ 枠鷲亙亘é°è©«è—蕨椀湾碗腕・・・・・・・・ +梓圧斡扱宛å§è™»é£´çµ¢ç¶¾é®Žæˆ–粟袷安庵按暗案闇 梓圧斡扱宛å§è™»é£´çµ¢ç¶¾é®Žæˆ–粟袷安庵按暗案闇 +牢狼篭è€è¾è‹éƒŽå…­éº“禄肋録論倭和話歪賄脇惑 牢狼篭è€è¾è‹éƒŽå…­éº“禄肋録論倭和話歪賄脇惑 +移維緯胃èŽè¡£è¬‚é•éºåŒ»äº•亥域育éƒç£¯ä¸€å£±æº¢é€¸ 移維緯胃èŽè¡£è¬‚é•éºåŒ»äº•亥域育éƒç£¯ä¸€å£±æº¢é€¸ +稲茨芋鰯å…å°å’½å“¡å› å§»å¼•飲淫胤蔭・・・・・ 稲茨芋鰯å…å°å’½å“¡å› å§»å¼•飲淫胤蔭・・・・・ +éžæä»¥ä¼Šä½ä¾å‰å›²å¤·å§”å¨å°‰æƒŸæ„慰易椅為ç•ç•° éžæä»¥ä¼Šä½ä¾å‰å›²å¤·å§”å¨å°‰æƒŸæ„慰易椅為ç•ç•° +鶸鶺鷆é·é·‚鷙鷓鷸鷦鷭鷯鷽鸚鸛鸞鹵鹹鹽éºéºˆ 鶸鶺鷆é·é·‚鷙鷓鷸鷦鷭鷯鷽鸚鸛鸞鹵鹹鹽éºéºˆ +麋麌麒麕麑éºéº¥éº©éº¸éºªéº­é¡é»Œé»Žé»é»é»”é»œé»žé» éº‹éºŒéº’éº•éº‘éºéº¥éº©éº¸éºªéº­é¡é»Œé»Žé»é»é»”é»œé»žé» +黠黥黨黯黴黶黷黹黻黼黽鼇鼈皷鼕鼡鼬鼾齊齒 黠黥黨黯黴黶黷黹黻黼黽鼇鼈皷鼕鼡鼬鼾齊齒 +齔齣齟齠齡齦齧齬齪齷齲齶龕龜龠・・・・・ 齔齣齟齠齡齦齧齬齪齷齲齶龕龜龠・・・・・ +$¢£%#&*@§☆★○â—◎◇・・・・・ $¢£%#&*@§☆★○â—◎◇・・・・・ ++â€Â±Ã—÷ï¼â‰ ï¼œï¼žâ‰¦â‰§âˆžâˆ´â™‚♀°′″℃¥ +â€Â±Ã—÷ï¼â‰ ï¼œï¼žâ‰¦â‰§âˆžâˆ´â™‚♀°′″℃¥ +456789・・・・・・・ABCDEFG 456789・・・・・・・ABCDEFG +HIJKLMNOPQRSTUVWXYZ・ HIJKLMNOPQRSTUVWXYZ・ +ï½ï½‘rstuvwxyz・・・・・・・・・ ï½ï½‘rstuvwxyz・・・・・・・・・ +SELECT `C1`, CONVERT(`C1` using ucs2) FROM `T5`; +C1 CONVERT(`C1` using ucs2) +θικλμνξοπÏστυφχψω・・・ θικλμνξοπÏστυφχψω・・・ +ΥΦΧΨΩ・・・・・・・・αβγδεζη ΥΦΧΨΩ・・・・・・・・αβγδεζη +клмнопрÑÑ‚ÑƒÑ„Ñ…Ñ†Ñ‡ÑˆÑ‰ÑŠÑ‹ÑŒÑ ÐºÐ»Ð¼Ð½Ð¾Ð¿Ñ€ÑÑ‚ÑƒÑ„Ñ…Ñ†Ñ‡ÑˆÑ‰ÑŠÑ‹ÑŒÑ +ТУФХЦЧШЩЪЫЬЭЮЯ・・・・・・ ТУФХЦЧШЩЪЫЬЭЮЯ・・・・・・ +ÑŽÑ・・・・・・・・・・・・・・・・・・ ÑŽÑ・・・・・・・・・・・・・・・・・・ +“â€ï¼ˆï¼‰ã€”〕[]{ï½ã€ˆã€‰ã€Šã€‹ã€Œã€ã€Žã€ã€ã€‘ “â€ï¼ˆï¼‰ã€”〕[]{ï½ã€ˆã€‰ã€Šã€‹ã€Œã€ã€Žã€ã€ã€‘ +∠⊥⌒∂∇≡≒≪≫√∽âˆâˆµâˆ«âˆ¬ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» ∠⊥⌒∂∇≡≒≪≫√∽âˆâˆµâˆ«âˆ¬ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» +┫┻╋┠┯┨┷┿â”┰┥┸╂・・・・・・・ ┫┻╋┠┯┨┷┿â”┰┥┸╂・・・・・・・ +  ã€ã€‚,.・:;?ï¼ã‚›ã‚œÂ´ï½€Â¨ï¼¾ï¿£ï¼¿ãƒ½   ã€ã€‚,.・:;?ï¼ã‚›ã‚œÂ´ï½€Â¨ï¼¾ï¿£ï¼¿ãƒ½ +ã”ã•ã–ã—ã˜ã™ãšã›ãœããžãŸã ã¡ã¢ã£ã¤ã¥ã¦ã§ ã”ã•ã–ã—ã˜ã™ãšã›ãœããžãŸã ã¡ã¢ã£ã¤ã¥ã¦ã§ +ã¨ã©ãªã«ã¬ã­ã®ã¯ã°ã±ã²ã³ã´ãµã¶ã·ã¸ã¹ãºã» ã¨ã©ãªã«ã¬ã­ã®ã¯ã°ã±ã²ã³ã´ãµã¶ã·ã¸ã¹ãºã» +ã¼ã½ã¾ã¿ã‚€ã‚もゃやゅゆょよらりるれã‚ゎ゠ã¼ã½ã¾ã¿ã‚€ã‚もゃやゅゆょよらりるれã‚ゎ゠+ã‚ゑをん・・・・・・・・・・・・・・・・ ã‚ゑをん・・・・・・・・・・・・・・・・ +ゴサザシジスズセゼソゾタダãƒãƒ‚ッツヅテデ ゴサザシジスズセゼソゾタダãƒãƒ‚ッツヅテデ +トドナニヌãƒãƒŽãƒãƒãƒ‘ヒビピフブプヘベペホ トドナニヌãƒãƒŽãƒãƒãƒ‘ヒビピフブプヘベペホ +ボãƒãƒžãƒŸãƒ ãƒ¡ãƒ¢ãƒ£ãƒ¤ãƒ¥ãƒ¦ãƒ§ãƒ¨ãƒ©ãƒªãƒ«ãƒ¬ãƒ­ãƒ®ãƒ¯ ボãƒãƒžãƒŸãƒ ãƒ¡ãƒ¢ãƒ£ãƒ¤ãƒ¥ãƒ¦ãƒ§ãƒ¨ãƒ©ãƒªãƒ«ãƒ¬ãƒ­ãƒ®ãƒ¯ +ヰヱヲンヴヵヶ・・・・・・・・・・・・・ ヰヱヲンヴヵヶ・・・・・・・・・・・・・ +・ΑΒΓΔΕΖΗΘΙΚΛΜÎΞΟΠΡΣΤ ・ΑΒΓΔΕΖΗΘΙΚΛΜÎΞΟΠΡΣΤ +・ÐБВГДЕÐЖЗИЙКЛМÐОПРС ・ÐБВГДЕÐЖЗИЙКЛМÐОПРС +・─│┌â”┘└├┬┤┴┼â”┃â”┓┛┗┣┳ ・─│┌â”┘└├┬┤┴┼â”┃â”┓┛┗┣┳ +・◆□■△▲▽▼※〒→â†â†‘↓〓・・・・・ ・◆□■△▲▽▼※〒→â†â†‘↓〓・・・・・ +・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’㓠・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“ +・ァアィイゥウェエォオカガキギクグケゲコ ・ァアィイゥウェエォオカガキギクグケゲコ +・・ʼn♯♭♪†‡¶・・・・◯・・・・  ・・ʼn♯♭♪†‡¶・・・・◯・・・・  +・・∧∨¬⇒⇔∀∃・・・・・・・・・・・ ・・∧∨¬⇒⇔∀∃・・・・・・・・・・・ +・・・・・・∈∋⊆⊇⊂⊃∪∩・・・・・・ ・・・・・・∈∋⊆⊇⊂⊃∪∩・・・・・・ +・・・・・・・・・абвгдеёжзий ・・・・・・・・・абвгдеёжзий +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・ï¼ï¼‘23 ・・・・・・・・・・・・・・・・ï¼ï¼‘23 +・・・・・ï½ï½‚cdefghijklï½ï½Žï½ ・・・・・ï½ï½‚cdefghijklï½ï½Žï½ +ãƒ»äºœå”–å¨ƒé˜¿å“€æ„›æŒ¨å§¶é€¢è‘µèŒœç©æ‚ªæ¡æ¸¥æ—­è‘¦èЦ靵 ãƒ»äºœå”–å¨ƒé˜¿å“€æ„›æŒ¨å§¶é€¢è‘µèŒœç©æ‚ªæ¡æ¸¥æ—­è‘¦èЦ靵 +・堯槇é™ç‘¤å‡œç†™ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» ・堯槇é™ç‘¤å‡œç†™ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» +・弌ä¸ä¸•个丱丶丼丿乂乖乘亂亅豫亊舒å¼äºŽäºž ・弌ä¸ä¸•个丱丶丼丿乂乖乘亂亅豫亊舒å¼äºŽäºž +・蓮連錬呂魯櫓炉賂路露労å©å»Šå¼„æœ—æ¥¼æ¦”æµªæ¼ ãƒ»è“®é€£éŒ¬å‘‚é­¯æ«“ç‚‰è³‚è·¯éœ²åŠ´å©å»Šå¼„æœ—æ¥¼æ¦”æµªæ¼ +・éµéµžéµ¤éµ‘éµéµ™éµ²é¶‰é¶‡é¶«éµ¯éµºé¶šé¶¤é¶©é¶²é·„é·é¶» ・éµéµžéµ¤éµ‘éµéµ™éµ²é¶‰é¶‡é¶«éµ¯éµºé¶šé¶¤é¶©é¶²é·„é·é¶» +ヾã‚ゞ〃ä»ã€…〆〇ー―â€ï¼ï¼¼ã€œâ€–|…‥‘’ ヾã‚ゞ〃ä»ã€…〆〇ー―â€ï¼ï¼¼ã€œâ€–|…‥‘’ +亟亠亢亰亳亶从ä»ä»„仆仂仗仞仭仟价伉佚估佛 亟亠亢亰亳亶从ä»ä»„仆仂仗仞仭仟价伉佚估佛 +ä½ä½—佇佶侈ä¾ä¾˜ä½»ä½©ä½°ä¾‘佯來侖儘俔俟俎俘俛 ä½ä½—佇佶侈ä¾ä¾˜ä½»ä½©ä½°ä¾‘佯來侖儘俔俟俎俘俛 +俑俚ä¿ä¿¤ä¿¥å€šå€¨å€”倪倥倅伜俶倡倩倬俾俯們倆 俑俚ä¿ä¿¤ä¿¥å€šå€¨å€”倪倥倅伜俶倡倩倬俾俯們倆 +åƒå‡æœƒå•ååˆåšå–å¬å¸å‚€å‚šå‚…傴傲・・・・・ åƒå‡æœƒå•ååˆåšå–å¬å¸å‚€å‚šå‚…傴傲・・・・・ +枠鷲亙亘é°è©«è—蕨椀湾碗腕・・・・・・・・ 枠鷲亙亘é°è©«è—蕨椀湾碗腕・・・・・・・・ +梓圧斡扱宛å§è™»é£´çµ¢ç¶¾é®Žæˆ–粟袷安庵按暗案闇 梓圧斡扱宛å§è™»é£´çµ¢ç¶¾é®Žæˆ–粟袷安庵按暗案闇 +牢狼篭è€è¾è‹éƒŽå…­éº“禄肋録論倭和話歪賄脇惑 牢狼篭è€è¾è‹éƒŽå…­éº“禄肋録論倭和話歪賄脇惑 +移維緯胃èŽè¡£è¬‚é•éºåŒ»äº•亥域育éƒç£¯ä¸€å£±æº¢é€¸ 移維緯胃èŽè¡£è¬‚é•éºåŒ»äº•亥域育éƒç£¯ä¸€å£±æº¢é€¸ +稲茨芋鰯å…å°å’½å“¡å› å§»å¼•飲淫胤蔭・・・・・ 稲茨芋鰯å…å°å’½å“¡å› å§»å¼•飲淫胤蔭・・・・・ +éžæä»¥ä¼Šä½ä¾å‰å›²å¤·å§”å¨å°‰æƒŸæ„慰易椅為ç•ç•° éžæä»¥ä¼Šä½ä¾å‰å›²å¤·å§”å¨å°‰æƒŸæ„慰易椅為ç•ç•° +鶸鶺鷆é·é·‚鷙鷓鷸鷦鷭鷯鷽鸚鸛鸞鹵鹹鹽éºéºˆ 鶸鶺鷆é·é·‚鷙鷓鷸鷦鷭鷯鷽鸚鸛鸞鹵鹹鹽éºéºˆ +麋麌麒麕麑éºéº¥éº©éº¸éºªéº­é¡é»Œé»Žé»é»é»”é»œé»žé» éº‹éºŒéº’éº•éº‘éºéº¥éº©éº¸éºªéº­é¡é»Œé»Žé»é»é»”é»œé»žé» +黠黥黨黯黴黶黷黹黻黼黽鼇鼈皷鼕鼡鼬鼾齊齒 黠黥黨黯黴黶黷黹黻黼黽鼇鼈皷鼕鼡鼬鼾齊齒 +齔齣齟齠齡齦齧齬齪齷齲齶龕龜龠・・・・・ 齔齣齟齠齡齦齧齬齪齷齲齶龕龜龠・・・・・ +$¢£%#&*@§☆★○â—◎◇・・・・・ $¢£%#&*@§☆★○â—◎◇・・・・・ ++â€Â±Ã—÷ï¼â‰ ï¼œï¼žâ‰¦â‰§âˆžâˆ´â™‚♀°′″℃¥ +â€Â±Ã—÷ï¼â‰ ï¼œï¼žâ‰¦â‰§âˆžâˆ´â™‚♀°′″℃¥ +456789・・・・・・・ABCDEFG 456789・・・・・・・ABCDEFG +HIJKLMNOPQRSTUVWXYZ・ HIJKLMNOPQRSTUVWXYZ・ +ï½ï½‘rstuvwxyz・・・・・・・・・ ï½ï½‘rstuvwxyz・・・・・・・・・ +SELECT `C1`, CONVERT(`C1` using sjis) FROM `T5`; +C1 CONVERT(`C1` using sjis) +θικλμνξοπÏστυφχψω・・・ θικλμνξοπÏστυφχψω・・・ +ΥΦΧΨΩ・・・・・・・・αβγδεζη ΥΦΧΨΩ・・・・・・・・αβγδεζη +клмнопрÑÑ‚ÑƒÑ„Ñ…Ñ†Ñ‡ÑˆÑ‰ÑŠÑ‹ÑŒÑ ÐºÐ»Ð¼Ð½Ð¾Ð¿Ñ€ÑÑ‚ÑƒÑ„Ñ…Ñ†Ñ‡ÑˆÑ‰ÑŠÑ‹ÑŒÑ +ТУФХЦЧШЩЪЫЬЭЮЯ・・・・・・ ТУФХЦЧШЩЪЫЬЭЮЯ・・・・・・ +ÑŽÑ・・・・・・・・・・・・・・・・・・ ÑŽÑ・・・・・・・・・・・・・・・・・・ +“â€ï¼ˆï¼‰ã€”〕[]{ï½ã€ˆã€‰ã€Šã€‹ã€Œã€ã€Žã€ã€ã€‘ “â€ï¼ˆï¼‰ã€”〕[]{ï½ã€ˆã€‰ã€Šã€‹ã€Œã€ã€Žã€ã€ã€‘ +∠⊥⌒∂∇≡≒≪≫√∽âˆâˆµâˆ«âˆ¬ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» ∠⊥⌒∂∇≡≒≪≫√∽âˆâˆµâˆ«âˆ¬ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» +┫┻╋┠┯┨┷┿â”┰┥┸╂・・・・・・・ ┫┻╋┠┯┨┷┿â”┰┥┸╂・・・・・・・ +  ã€ã€‚,.・:;?ï¼ã‚›ã‚œÂ´ï½€Â¨ï¼¾ï¿£ï¼¿ãƒ½   ã€ã€‚,.・:;?ï¼ã‚›ã‚œÂ´ï½€Â¨ï¼¾ï¿£ï¼¿ãƒ½ +ã”ã•ã–ã—ã˜ã™ãšã›ãœããžãŸã ã¡ã¢ã£ã¤ã¥ã¦ã§ ã”ã•ã–ã—ã˜ã™ãšã›ãœããžãŸã ã¡ã¢ã£ã¤ã¥ã¦ã§ +ã¨ã©ãªã«ã¬ã­ã®ã¯ã°ã±ã²ã³ã´ãµã¶ã·ã¸ã¹ãºã» ã¨ã©ãªã«ã¬ã­ã®ã¯ã°ã±ã²ã³ã´ãµã¶ã·ã¸ã¹ãºã» +ã¼ã½ã¾ã¿ã‚€ã‚もゃやゅゆょよらりるれã‚ゎ゠ã¼ã½ã¾ã¿ã‚€ã‚もゃやゅゆょよらりるれã‚ゎ゠+ã‚ゑをん・・・・・・・・・・・・・・・・ ã‚ゑをん・・・・・・・・・・・・・・・・ +ゴサザシジスズセゼソゾタダãƒãƒ‚ッツヅテデ ゴサザシジスズセゼソゾタダãƒãƒ‚ッツヅテデ +トドナニヌãƒãƒŽãƒãƒãƒ‘ヒビピフブプヘベペホ トドナニヌãƒãƒŽãƒãƒãƒ‘ヒビピフブプヘベペホ +ボãƒãƒžãƒŸãƒ ãƒ¡ãƒ¢ãƒ£ãƒ¤ãƒ¥ãƒ¦ãƒ§ãƒ¨ãƒ©ãƒªãƒ«ãƒ¬ãƒ­ãƒ®ãƒ¯ ボãƒãƒžãƒŸãƒ ãƒ¡ãƒ¢ãƒ£ãƒ¤ãƒ¥ãƒ¦ãƒ§ãƒ¨ãƒ©ãƒªãƒ«ãƒ¬ãƒ­ãƒ®ãƒ¯ +ヰヱヲンヴヵヶ・・・・・・・・・・・・・ ヰヱヲンヴヵヶ・・・・・・・・・・・・・ +・ΑΒΓΔΕΖΗΘΙΚΛΜÎΞΟΠΡΣΤ ・ΑΒΓΔΕΖΗΘΙΚΛΜÎΞΟΠΡΣΤ +・ÐБВГДЕÐЖЗИЙКЛМÐОПРС ・ÐБВГДЕÐЖЗИЙКЛМÐОПРС +・─│┌â”┘└├┬┤┴┼â”┃â”┓┛┗┣┳ ・─│┌â”┘└├┬┤┴┼â”┃â”┓┛┗┣┳ +・◆□■△▲▽▼※〒→â†â†‘↓〓・・・・・ ・◆□■△▲▽▼※〒→â†â†‘↓〓・・・・・ +・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’㓠・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“ +・ァアィイゥウェエォオカガキギクグケゲコ ・ァアィイゥウェエォオカガキギクグケゲコ +・・ʼn♯♭♪†‡¶・・・・◯・・・・  ・・ʼn♯♭♪†‡¶・・・・◯・・・・  +・・∧∨¬⇒⇔∀∃・・・・・・・・・・・ ・・∧∨¬⇒⇔∀∃・・・・・・・・・・・ +・・・・・・∈∋⊆⊇⊂⊃∪∩・・・・・・ ・・・・・・∈∋⊆⊇⊂⊃∪∩・・・・・・ +・・・・・・・・・абвгдеёжзий ・・・・・・・・・абвгдеёжзий +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・ï¼ï¼‘23 ・・・・・・・・・・・・・・・・ï¼ï¼‘23 +・・・・・ï½ï½‚cdefghijklï½ï½Žï½ ・・・・・ï½ï½‚cdefghijklï½ï½Žï½ +ãƒ»äºœå”–å¨ƒé˜¿å“€æ„›æŒ¨å§¶é€¢è‘µèŒœç©æ‚ªæ¡æ¸¥æ—­è‘¦èЦ靵 ãƒ»äºœå”–å¨ƒé˜¿å“€æ„›æŒ¨å§¶é€¢è‘µèŒœç©æ‚ªæ¡æ¸¥æ—­è‘¦èЦ靵 +・堯槇é™ç‘¤å‡œç†™ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» ・堯槇é™ç‘¤å‡œç†™ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» +・弌ä¸ä¸•个丱丶丼丿乂乖乘亂亅豫亊舒å¼äºŽäºž ・弌ä¸ä¸•个丱丶丼丿乂乖乘亂亅豫亊舒å¼äºŽäºž +・蓮連錬呂魯櫓炉賂路露労å©å»Šå¼„æœ—æ¥¼æ¦”æµªæ¼ ãƒ»è“®é€£éŒ¬å‘‚é­¯æ«“ç‚‰è³‚è·¯éœ²åŠ´å©å»Šå¼„æœ—æ¥¼æ¦”æµªæ¼ +・éµéµžéµ¤éµ‘éµéµ™éµ²é¶‰é¶‡é¶«éµ¯éµºé¶šé¶¤é¶©é¶²é·„é·é¶» ・éµéµžéµ¤éµ‘éµéµ™éµ²é¶‰é¶‡é¶«éµ¯éµºé¶šé¶¤é¶©é¶²é·„é·é¶» +ヾã‚ゞ〃ä»ã€…〆〇ー―â€ï¼ï¼¼ã€œâ€–|…‥‘’ ヾã‚ゞ〃ä»ã€…〆〇ー―â€ï¼?〜‖|…‥‘’ +亟亠亢亰亳亶从ä»ä»„仆仂仗仞仭仟价伉佚估佛 亟亠亢亰亳亶从ä»ä»„仆仂仗仞仭仟价伉佚估佛 +ä½ä½—佇佶侈ä¾ä¾˜ä½»ä½©ä½°ä¾‘佯來侖儘俔俟俎俘俛 ä½ä½—佇佶侈ä¾ä¾˜ä½»ä½©ä½°ä¾‘佯來侖儘俔俟俎俘俛 +俑俚ä¿ä¿¤ä¿¥å€šå€¨å€”倪倥倅伜俶倡倩倬俾俯們倆 俑俚ä¿ä¿¤ä¿¥å€šå€¨å€”倪倥倅伜俶倡倩倬俾俯們倆 +åƒå‡æœƒå•ååˆåšå–å¬å¸å‚€å‚šå‚…傴傲・・・・・ åƒå‡æœƒå•ååˆåšå–å¬å¸å‚€å‚šå‚…傴傲・・・・・ +枠鷲亙亘é°è©«è—蕨椀湾碗腕・・・・・・・・ 枠鷲亙亘é°è©«è—蕨椀湾碗腕・・・・・・・・ +梓圧斡扱宛å§è™»é£´çµ¢ç¶¾é®Žæˆ–粟袷安庵按暗案闇 梓圧斡扱宛å§è™»é£´çµ¢ç¶¾é®Žæˆ–粟袷安庵按暗案闇 +牢狼篭è€è¾è‹éƒŽå…­éº“禄肋録論倭和話歪賄脇惑 牢狼篭è€è¾è‹éƒŽå…­éº“禄肋録論倭和話歪賄脇惑 +移維緯胃èŽè¡£è¬‚é•éºåŒ»äº•亥域育éƒç£¯ä¸€å£±æº¢é€¸ 移維緯胃èŽè¡£è¬‚é•éºåŒ»äº•亥域育éƒç£¯ä¸€å£±æº¢é€¸ +稲茨芋鰯å…å°å’½å“¡å› å§»å¼•飲淫胤蔭・・・・・ 稲茨芋鰯å…å°å’½å“¡å› å§»å¼•飲淫胤蔭・・・・・ +éžæä»¥ä¼Šä½ä¾å‰å›²å¤·å§”å¨å°‰æƒŸæ„慰易椅為ç•ç•° éžæä»¥ä¼Šä½ä¾å‰å›²å¤·å§”å¨å°‰æƒŸæ„慰易椅為ç•ç•° +鶸鶺鷆é·é·‚鷙鷓鷸鷦鷭鷯鷽鸚鸛鸞鹵鹹鹽éºéºˆ 鶸鶺鷆é·é·‚鷙鷓鷸鷦鷭鷯鷽鸚鸛鸞鹵鹹鹽éºéºˆ +麋麌麒麕麑éºéº¥éº©éº¸éºªéº­é¡é»Œé»Žé»é»é»”é»œé»žé» éº‹éºŒéº’éº•éº‘éºéº¥éº©éº¸éºªéº­é¡é»Œé»Žé»é»é»”é»œé»žé» +黠黥黨黯黴黶黷黹黻黼黽鼇鼈皷鼕鼡鼬鼾齊齒 黠黥黨黯黴黶黷黹黻黼黽鼇鼈皷鼕鼡鼬鼾齊齒 +齔齣齟齠齡齦齧齬齪齷齲齶龕龜龠・・・・・ 齔齣齟齠齡齦齧齬齪齷齲齶龕龜龠・・・・・ +$¢£%#&*@§☆★○â—◎◇・・・・・ $¢£%#&*@§☆★○â—◎◇・・・・・ ++â€Â±Ã—÷ï¼â‰ ï¼œï¼žâ‰¦â‰§âˆžâˆ´â™‚♀°′″℃¥ +â€Â±Ã—÷ï¼â‰ ï¼œï¼žâ‰¦â‰§âˆžâˆ´â™‚♀°′″℃¥ +456789・・・・・・・ABCDEFG 456789・・・・・・・ABCDEFG +HIJKLMNOPQRSTUVWXYZ・ HIJKLMNOPQRSTUVWXYZ・ +ï½ï½‘rstuvwxyz・・・・・・・・・ ï½ï½‘rstuvwxyz・・・・・・・・・ +SELECT `C1`, CONVERT(`C1` using ujis) FROM `ï¼´ï¼–`; +C1 CONVERT(`C1` using ujis) +êěėēęǵÄğ・ġĥíìïîÇ・īįĩ êěėēęǵÄğ・ġĥíìïîÇ・īįĩ +ÊĚĖĒĘ・ĜĞĢĠĤÃÃŒÃÃŽÇİĪĮĨ ÊĚĖĒĘ・ĜĞĢĠĤÃÃŒÃÃŽÇİĪĮĨ +ĴĶĹĽĻŃŇŅÑÓÒÖÔǑÅŌÕŔŘŖ ĴĶĹĽĻŃŇŅÑÓÒÖÔǑÅŌÕŔŘŖ +ĵķĺľļńňņñóòöôǒőÅõŕřŗ ĵķĺľļńňņñóòöôǒőÅõŕřŗ +ŚŜŠŞŤŢÚÙÜÛŬǓŰŪŲŮŨǗǛǙ ŚŜŠŞŤŢÚÙÜÛŬǓŰŪŲŮŨǗǛǙ +śŚşťţúùüûŭǔűūųůũǘǜǚ śŚşťţúùüûŭǔűūųůũǘǜǚ +ǕŴßŶŹŽŻ・・・・・・・・・・・・ ǕŴßŶŹŽŻ・・・・・・・・・・・・ +ǖŵýÿŷźžż・・・・・・・・・・・・ ǖŵýÿŷźžż・・・・・・・・・・・・ +¤№・・・・・・・・・・・・・・・・・・ ¤№・・・・・・・・・・・・・・・・・・ +łŀʼnŋøœßŧþ・・・・・・・・・・・ łŀʼnŋøœßŧþ・・・・・・・・・・・ +ЈЉЊЋЌЎÐ・・・・・・・・・・・・・ ЈЉЊЋЌЎÐ・・・・・・・・・・・・・ +・ÃÀÄÂĂÇĀĄÅÃĆĈČÇĊĎÉÈË ・ÃÀÄÂĂÇĀĄÅÃĆĈČÇĊĎÉÈË +・áàäâăǎÄąåãćĉÄçċÄéèë ・áàäâăǎÄąåãćĉÄçċÄéèë +・ÆÄ・Ħ・IJ・ÅĿ・ŊØŒ・ŦÞ・・・ ・ÆÄ・Ħ・IJ・ÅĿ・ŊØŒ・ŦÞ・・・ +・˛˚~΄΅・・・・・・・・¡¦¿・・・ ・˛˚?΄΅・・・・・・・・¡¦¿・・・ +・άέήίϊÎόςÏϋΰώ・・・・・・・ ・άέήίϊÎόςÏϋΰώ・・・・・・・ +・・ђѓєѕіїјљњћќўџ・・・・・ ・・ђѓєѕіїјљњћќўџ・・・・・ +・・・・・ΆΈΉΊΪ・Ό・ΎΫ・Î・・・ ・・・・・ΆΈΉΊΪ・Ό・ΎΫ・Î・・・ +・・・・・・・・・・・・・æđðħıijĸ ・・・・・・・・・・・・・æđðħıijĸ +・・・・・・・・・・・・・・ЂЃЄЅІЇ ・・・・・・・・・・・・・・ЂЃЄЅІЇ +・・・・・・・・・・・・・・・ºª©®™ ・・・・・・・・・・・・・・・ºª©®™ +ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»Ë˜Ë‡Â¸Ë™Ë ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»Ë˜Ë‡Â¸Ë™Ë +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・丂丄丅丌丒丟丣两丨丫丮丯丰丵乀ä¹ä¹„乇乑 ・丂丄丅丌丒丟丣两丨丫丮丯丰丵乀ä¹ä¹„乇乑 +・黸黿鼂鼃鼉é¼é¼é¼‘鼒鼔鼖鼗鼙鼚鼛鼟鼢鼦鼪 ・黸黿鼂鼃鼉é¼é¼é¼‘鼒鼔鼖鼗鼙鼚鼛鼟鼢鼦鼪 +乚乜乣乨乩乴乵乹乿äºäº–亗äºäº¯äº¹ä»ƒä»ä»šä»›ä»  乚乜乣乨乩乴乵乹乿äºäº–亗äºäº¯äº¹ä»ƒä»ä»šä»›ä»  +仡仢仨仯仱仳仵份仾仿伀伂伃伈伋伌伒伕伖众 仡仢仨仯仱仳仵份仾仿伀伂伃伈伋伌伒伕伖众 +伙伮伱你伳伵伷伹伻伾佀佂佈佉佋佌佒佔佖佘 伙伮伱你伳伵伷伹伻伾佀佂佈佉佋佌佒佔佖佘 +佟佣佪佬佮佱佷佸佹佺佽佾ä¾ä¾‚侄・・・・・ 佟佣佪佬佮佱佷佸佹佺佽佾ä¾ä¾‚侄・・・・・ +鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 +齗齘齚é½é½žé½¨é½©é½­é½®é½¯é½°é½±é½³é½µé½ºé½½é¾é¾é¾‘é¾’ 齗齘齚é½é½žé½¨é½©é½­é½®é½¯é½°é½±é½³é½µé½ºé½½é¾é¾é¾‘é¾’ +龔龖龗龞龡龢龣龥・・・・・・・・・・・・ 龔龖龗龞龡龢龣龥・・・・・・・・・・・・ +SELECT `C1`, CONVERT(`C1` using ucs2) FROM `ï¼´ï¼–`; +C1 CONVERT(`C1` using ucs2) +êěėēęǵÄğ・ġĥíìïîÇ・īįĩ êěėēęǵÄğ・ġĥíìïîÇ・īįĩ +ÊĚĖĒĘ・ĜĞĢĠĤÃÃŒÃÃŽÇİĪĮĨ ÊĚĖĒĘ・ĜĞĢĠĤÃÃŒÃÃŽÇİĪĮĨ +ĴĶĹĽĻŃŇŅÑÓÒÖÔǑÅŌÕŔŘŖ ĴĶĹĽĻŃŇŅÑÓÒÖÔǑÅŌÕŔŘŖ +ĵķĺľļńňņñóòöôǒőÅõŕřŗ ĵķĺľļńňņñóòöôǒőÅõŕřŗ +ŚŜŠŞŤŢÚÙÜÛŬǓŰŪŲŮŨǗǛǙ ŚŜŠŞŤŢÚÙÜÛŬǓŰŪŲŮŨǗǛǙ +śŚşťţúùüûŭǔűūųůũǘǜǚ śŚşťţúùüûŭǔűūųůũǘǜǚ +ǕŴßŶŹŽŻ・・・・・・・・・・・・ ǕŴßŶŹŽŻ・・・・・・・・・・・・ +ǖŵýÿŷźžż・・・・・・・・・・・・ ǖŵýÿŷźžż・・・・・・・・・・・・ +¤№・・・・・・・・・・・・・・・・・・ ¤№・・・・・・・・・・・・・・・・・・ +łŀʼnŋøœßŧþ・・・・・・・・・・・ łŀʼnŋøœßŧþ・・・・・・・・・・・ +ЈЉЊЋЌЎÐ・・・・・・・・・・・・・ ЈЉЊЋЌЎÐ・・・・・・・・・・・・・ +・ÃÀÄÂĂÇĀĄÅÃĆĈČÇĊĎÉÈË ・ÃÀÄÂĂÇĀĄÅÃĆĈČÇĊĎÉÈË +・áàäâăǎÄąåãćĉÄçċÄéèë ・áàäâăǎÄąåãćĉÄçċÄéèë +・ÆÄ・Ħ・IJ・ÅĿ・ŊØŒ・ŦÞ・・・ ・ÆÄ・Ħ・IJ・ÅĿ・ŊØŒ・ŦÞ・・・ +・˛˚~΄΅・・・・・・・・¡¦¿・・・ ・˛˚~΄΅・・・・・・・・¡¦¿・・・ +・άέήίϊÎόςÏϋΰώ・・・・・・・ ・άέήίϊÎόςÏϋΰώ・・・・・・・ +・・ђѓєѕіїјљњћќўџ・・・・・ ・・ђѓєѕіїјљњћќўџ・・・・・ +・・・・・ΆΈΉΊΪ・Ό・ΎΫ・Î・・・ ・・・・・ΆΈΉΊΪ・Ό・ΎΫ・Î・・・ +・・・・・・・・・・・・・æđðħıijĸ ・・・・・・・・・・・・・æđðħıijĸ +・・・・・・・・・・・・・・ЂЃЄЅІЇ ・・・・・・・・・・・・・・ЂЃЄЅІЇ +・・・・・・・・・・・・・・・ºª©®™ ・・・・・・・・・・・・・・・ºª©®™ +ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»Ë˜Ë‡Â¸Ë™Ë ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»Ë˜Ë‡Â¸Ë™Ë +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・丂丄丅丌丒丟丣两丨丫丮丯丰丵乀ä¹ä¹„乇乑 ・丂丄丅丌丒丟丣两丨丫丮丯丰丵乀ä¹ä¹„乇乑 +・黸黿鼂鼃鼉é¼é¼é¼‘鼒鼔鼖鼗鼙鼚鼛鼟鼢鼦鼪 ・黸黿鼂鼃鼉é¼é¼é¼‘鼒鼔鼖鼗鼙鼚鼛鼟鼢鼦鼪 +乚乜乣乨乩乴乵乹乿äºäº–亗äºäº¯äº¹ä»ƒä»ä»šä»›ä»  乚乜乣乨乩乴乵乹乿äºäº–亗äºäº¯äº¹ä»ƒä»ä»šä»›ä»  +仡仢仨仯仱仳仵份仾仿伀伂伃伈伋伌伒伕伖众 仡仢仨仯仱仳仵份仾仿伀伂伃伈伋伌伒伕伖众 +伙伮伱你伳伵伷伹伻伾佀佂佈佉佋佌佒佔佖佘 伙伮伱你伳伵伷伹伻伾佀佂佈佉佋佌佒佔佖佘 +佟佣佪佬佮佱佷佸佹佺佽佾ä¾ä¾‚侄・・・・・ 佟佣佪佬佮佱佷佸佹佺佽佾ä¾ä¾‚侄・・・・・ +鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 +齗齘齚é½é½žé½¨é½©é½­é½®é½¯é½°é½±é½³é½µé½ºé½½é¾é¾é¾‘é¾’ 齗齘齚é½é½žé½¨é½©é½­é½®é½¯é½°é½±é½³é½µé½ºé½½é¾é¾é¾‘é¾’ +龔龖龗龞龡龢龣龥・・・・・・・・・・・・ 龔龖龗龞龡龢龣龥・・・・・・・・・・・・ +SELECT `C1`, CONVERT(`C1` using sjis) FROM `ï¼´ï¼–`; +C1 CONVERT(`C1` using sjis) +êěėēęǵÄğ・ġĥíìïîÇ・īįĩ ????????・???????・??? +ÊĚĖĒĘ・ĜĞĢĠĤÃÃŒÃÃŽÇİĪĮĨ ?????・?????????????? +ĴĶĹĽĻŃŇŅÑÓÒÖÔǑÅŌÕŔŘŖ ???????????????????? +ĵķĺľļńňņñóòöôǒőÅõŕřŗ ???????????????????? +ŚŜŠŞŤŢÚÙÜÛŬǓŰŪŲŮŨǗǛǙ ???????????????????? +śŚşťţúùüûŭǔűūųůũǘǜǚ ???????????????????? +ǕŴßŶŹŽŻ・・・・・・・・・・・・ ????????・・・・・・・・・・・・ +ǖŵýÿŷźžż・・・・・・・・・・・・ ????????・・・・・・・・・・・・ +¤№・・・・・・・・・・・・・・・・・・ ??・・・・・・・・・・・・・・・・・・ +łŀʼnŋøœßŧþ・・・・・・・・・・・ ?????????・・・・・・・・・・・ +ЈЉЊЋЌЎÐ・・・・・・・・・・・・・ ???????・・・・・・・・・・・・・ +・ÃÀÄÂĂÇĀĄÅÃĆĈČÇĊĎÉÈË ・??????????????????? +・áàäâăǎÄąåãćĉÄçċÄéèë ・??????????????????? +・ÆÄ・Ħ・IJ・ÅĿ・ŊØŒ・ŦÞ・・・ ・??・?・?・??・???・??・・・ +・˛˚~΄΅・・・・・・・・¡¦¿・・・ ・?????・・・・・・・・???・・・ +・άέήίϊÎόςÏϋΰώ・・・・・・・ ・????????????・・・・・・・ +・・ђѓєѕіїјљњћќўџ・・・・・ ・・?????????????・・・・・ +・・・・・ΆΈΉΊΪ・Ό・ΎΫ・Î・・・ ・・・・・?????・?・??・?・・・ +・・・・・・・・・・・・・æđðħıijĸ ・・・・・・・・・・・・・??????? +・・・・・・・・・・・・・・ЂЃЄЅІЇ ・・・・・・・・・・・・・・?????? +・・・・・・・・・・・・・・・ºª©®™ ・・・・・・・・・・・・・・・????? +ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»Ë˜Ë‡Â¸Ë™Ë ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»????? +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・丂丄丅丌丒丟丣两丨丫丮丯丰丵乀ä¹ä¹„乇乑 ・??????????????????? +・黸黿鼂鼃鼉é¼é¼é¼‘鼒鼔鼖鼗鼙鼚鼛鼟鼢鼦鼪 ・??????????????????? +乚乜乣乨乩乴乵乹乿äºäº–亗äºäº¯äº¹ä»ƒä»ä»šä»›ä»  ???????????????????? +仡仢仨仯仱仳仵份仾仿伀伂伃伈伋伌伒伕伖众 ???????????????????? +伙伮伱你伳伵伷伹伻伾佀佂佈佉佋佌佒佔佖佘 ???????????????????? +佟佣佪佬佮佱佷佸佹佺佽佾ä¾ä¾‚侄・・・・・ ???????????????・・・・・ +鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 ???????????????????? +齗齘齚é½é½žé½¨é½©é½­é½®é½¯é½°é½±é½³é½µé½ºé½½é¾é¾é¾‘é¾’ ???????????????????? +龔龖龗龞龡龢龣龥・・・・・・・・・・・・ ????????・・・・・・・・・・・・ +SELECT `C1`, CONVERT(`C1` using ujis) FROM `ï¼´ï¼—`; +C1 CONVERT(`C1` using ujis) + !"#$%&'()*+,-./ !"#$%&'()*+,-./ +0123456789:;<=>? 0123456789:;<=>? +@ABCDEFGHIJKLMNO @ABCDEFGHIJKLMNO +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[\]^_ +abcdefghijklmno abcdefghijklmno +pqrstuvwxyz{|}~ pqrstuvwxyz{|}~ + 。「」、・ヲァィゥェォャュョッ 。「」、・ヲァィゥェォャュョッ +ーアイウエオカキクケコサシスセソ ーアイウエオカキクケコサシスセソ +ï¾€ï¾ï¾‚テトナニヌネノハヒフï¾ï¾Žï¾ ï¾€ï¾ï¾‚テトナニヌネノハヒフï¾ï¾Žï¾ +ï¾ï¾‘メモヤユヨラリルレロワï¾ï¾žï¾Ÿ ï¾ï¾‘メモヤユヨラリルレロワï¾ï¾žï¾Ÿ +SELECT `C1`, CONVERT(`C1` using ucs2) FROM `ï¼´ï¼—`; +C1 CONVERT(`C1` using ucs2) + !"#$%&'()*+,-./ !"#$%&'()*+,-./ +0123456789:;<=>? 0123456789:;<=>? +@ABCDEFGHIJKLMNO @ABCDEFGHIJKLMNO +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[\]^_ +abcdefghijklmno abcdefghijklmno +pqrstuvwxyz{|}~ pqrstuvwxyz{|}~ + 。「」、・ヲァィゥェォャュョッ 。「」、・ヲァィゥェォャュョッ +ーアイウエオカキクケコサシスセソ ーアイウエオカキクケコサシスセソ +ï¾€ï¾ï¾‚テトナニヌネノハヒフï¾ï¾Žï¾ ï¾€ï¾ï¾‚テトナニヌネノハヒフï¾ï¾Žï¾ +ï¾ï¾‘メモヤユヨラリルレロワï¾ï¾žï¾Ÿ ï¾ï¾‘メモヤユヨラリルレロワï¾ï¾žï¾Ÿ +SELECT `C1`, CONVERT(`C1` using sjis) FROM `ï¼´ï¼—`; +C1 CONVERT(`C1` using sjis) + !"#$%&'()*+,-./ !"#$%&'()*+,-./ +0123456789:;<=>? 0123456789:;<=>? +@ABCDEFGHIJKLMNO @ABCDEFGHIJKLMNO +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[\]^_ +abcdefghijklmno abcdefghijklmno +pqrstuvwxyz{|}~ pqrstuvwxyz{|}~ + 。「」、・ヲァィゥェォャュョッ 。「」、・ヲァィゥェォャュョッ +ーアイウエオカキクケコサシスセソ ーアイウエオカキクケコサシスセソ +ï¾€ï¾ï¾‚テトナニヌネノハヒフï¾ï¾Žï¾ ï¾€ï¾ï¾‚テトナニヌネノハヒフï¾ï¾Žï¾ +ï¾ï¾‘メモヤユヨラリルレロワï¾ï¾žï¾Ÿ ï¾ï¾‘メモヤユヨラリルレロワï¾ï¾žï¾Ÿ +SELECT `C1`, CONVERT(`C1` using ujis) FROM `T8`; +C1 CONVERT(`C1` using ujis) +  ã€ã€‚,.・:;?ï¼ã‚›ã‚œÂ´ï½€Â¨ï¼¾ï¿£ï¼¿ãƒ½   ã€ã€‚,.・:;?ï¼ã‚›ã‚œÂ´ï½€Â¨ï¼¾ï¿£ï¼¿ãƒ½ +ヾã‚ゞ〃ä»ã€…〆〇ー―â€ï¼ï¼¼ã€œâ€–|…‥‘’ ヾã‚ゞ〃ä»ã€…〆〇ー―â€ï¼?〜‖|…‥‘’ +“â€ï¼ˆï¼‰ã€”〕[]{ï½ã€ˆã€‰ã€Šã€‹ã€Œã€ã€Žã€ã€ã€‘ “â€ï¼ˆï¼‰ã€”〕[]{ï½ã€ˆã€‰ã€Šã€‹ã€Œã€ã€Žã€ã€ã€‘ ++â€Â±Ã—÷ï¼â‰ ï¼œï¼žâ‰¦â‰§âˆžâˆ´â™‚♀°′″℃¥ +â€Â±Ã—÷ï¼â‰ ï¼œï¼žâ‰¦â‰§âˆžâˆ´â™‚♀°′″℃¥ +$¢£%#&*@§☆★○â—◎◇・・・・・ $¢£%#&*@§☆★○â—◎◇・・・・・ +・◆□■△▲▽▼※〒→â†â†‘↓〓・・・・・ ・◆□■△▲▽▼※〒→â†â†‘↓〓・・・・・ +・・・・・・∈∋⊆⊇⊂⊃∪∩・・・・・・ ・・・・・・∈∋⊆⊇⊂⊃∪∩・・・・・・ +・・∧∨¬⇒⇔∀∃・・・・・・・・・・・ ・・∧∨¬⇒⇔∀∃・・・・・・・・・・・ +∠⊥⌒∂∇≡≒≪≫√∽âˆâˆµâˆ«âˆ¬ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» ∠⊥⌒∂∇≡≒≪≫√∽âˆâˆµâˆ«âˆ¬ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» +・・ʼn♯♭♪†‡¶・・・・◯・・・・  ・・ʼn♯♭♪†‡¶・・・・◯・・・・  +・・・・・・・・・・・・・・・・ï¼ï¼‘23 ・・・・・・・・・・・・・・・・ï¼ï¼‘23 +456789・・・・・・・ABCDEFG 456789・・・・・・・ABCDEFG +HIJKLMNOPQRSTUVWXYZ・ HIJKLMNOPQRSTUVWXYZ・ +・・・・・ï½ï½‚cdefghijklï½ï½Žï½ ・・・・・ï½ï½‚cdefghijklï½ï½Žï½ +ï½ï½‘rstuvwxyz・・・・・・・・・ ï½ï½‘rstuvwxyz・・・・・・・・・ +・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’㓠・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“ +ã”ã•ã–ã—ã˜ã™ãšã›ãœããžãŸã ã¡ã¢ã£ã¤ã¥ã¦ã§ ã”ã•ã–ã—ã˜ã™ãšã›ãœããžãŸã ã¡ã¢ã£ã¤ã¥ã¦ã§ +ã¨ã©ãªã«ã¬ã­ã®ã¯ã°ã±ã²ã³ã´ãµã¶ã·ã¸ã¹ãºã» ã¨ã©ãªã«ã¬ã­ã®ã¯ã°ã±ã²ã³ã´ãµã¶ã·ã¸ã¹ãºã» +ã¼ã½ã¾ã¿ã‚€ã‚もゃやゅゆょよらりるれã‚ゎ゠ã¼ã½ã¾ã¿ã‚€ã‚もゃやゅゆょよらりるれã‚ゎ゠+ã‚ゑをん・・・・・・・・・・・・・・・・ ã‚ゑをん・・・・・・・・・・・・・・・・ +・ァアィイゥウェエォオカガキギクグケゲコ ・ァアィイゥウェエォオカガキギクグケゲコ +ゴサザシジスズセゼソゾタダãƒãƒ‚ッツヅテデ ゴサザシジスズセゼソゾタダãƒãƒ‚ッツヅテデ +トドナニヌãƒãƒŽãƒãƒãƒ‘ヒビピフブプヘベペホ トドナニヌãƒãƒŽãƒãƒãƒ‘ヒビピフブプヘベペホ +ボãƒãƒžãƒŸãƒ ãƒ¡ãƒ¢ãƒ£ãƒ¤ãƒ¥ãƒ¦ãƒ§ãƒ¨ãƒ©ãƒªãƒ«ãƒ¬ãƒ­ãƒ®ãƒ¯ ボãƒãƒžãƒŸãƒ ãƒ¡ãƒ¢ãƒ£ãƒ¤ãƒ¥ãƒ¦ãƒ§ãƒ¨ãƒ©ãƒªãƒ«ãƒ¬ãƒ­ãƒ®ãƒ¯ +ヰヱヲンヴヵヶ・・・・・・・・・・・・・ ヰヱヲンヴヵヶ・・・・・・・・・・・・・ +・ΑΒΓΔΕΖΗΘΙΚΛΜÎΞΟΠΡΣΤ ・ΑΒΓΔΕΖΗΘΙΚΛΜÎΞΟΠΡΣΤ +ΥΦΧΨΩ・・・・・・・・αβγδεζη ΥΦΧΨΩ・・・・・・・・αβγδεζη +θικλμνξοπÏστυφχψω・・・ θικλμνξοπÏστυφχψω・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・ÐБВГДЕÐЖЗИЙКЛМÐОПРС ・ÐБВГДЕÐЖЗИЙКЛМÐОПРС +ТУФХЦЧШЩЪЫЬЭЮЯ・・・・・・ ТУФХЦЧШЩЪЫЬЭЮЯ・・・・・・ +・・・・・・・・・абвгдеёжзий ・・・・・・・・・абвгдеёжзий +клмнопрÑÑ‚ÑƒÑ„Ñ…Ñ†Ñ‡ÑˆÑ‰ÑŠÑ‹ÑŒÑ ÐºÐ»Ð¼Ð½Ð¾Ð¿Ñ€ÑÑ‚ÑƒÑ„Ñ…Ñ†Ñ‡ÑˆÑ‰ÑŠÑ‹ÑŒÑ +ÑŽÑ・・・・・・・・・・・・・・・・・・ ÑŽÑ・・・・・・・・・・・・・・・・・・ +・─│┌â”┘└├┬┤┴┼â”┃â”┓┛┗┣┳ ・─│┌â”┘└├┬┤┴┼â”┃â”┓┛┗┣┳ +┫┻╋┠┯┨┷┿â”┰┥┸╂・・・・・・・ ┫┻╋┠┯┨┷┿â”┰┥┸╂・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +ãƒ»äºœå”–å¨ƒé˜¿å“€æ„›æŒ¨å§¶é€¢è‘µèŒœç©æ‚ªæ¡æ¸¥æ—­è‘¦èЦ靵 ãƒ»äºœå”–å¨ƒé˜¿å“€æ„›æŒ¨å§¶é€¢è‘µèŒœç©æ‚ªæ¡æ¸¥æ—­è‘¦èЦ靵 +梓圧斡扱宛å§è™»é£´çµ¢ç¶¾é®Žæˆ–粟袷安庵按暗案闇 梓圧斡扱宛å§è™»é£´çµ¢ç¶¾é®Žæˆ–粟袷安庵按暗案闇 +éžæä»¥ä¼Šä½ä¾å‰å›²å¤·å§”å¨å°‰æƒŸæ„慰易椅為ç•ç•° éžæä»¥ä¼Šä½ä¾å‰å›²å¤·å§”å¨å°‰æƒŸæ„慰易椅為ç•ç•° +移維緯胃èŽè¡£è¬‚é•éºåŒ»äº•亥域育éƒç£¯ä¸€å£±æº¢é€¸ 移維緯胃èŽè¡£è¬‚é•éºåŒ»äº•亥域育éƒç£¯ä¸€å£±æº¢é€¸ +稲茨芋鰯å…å°å’½å“¡å› å§»å¼•飲淫胤蔭・・・・・ 稲茨芋鰯å…å°å’½å“¡å› å§»å¼•飲淫胤蔭・・・・・ +・蓮連錬呂魯櫓炉賂路露労å©å»Šå¼„æœ—æ¥¼æ¦”æµªæ¼ ãƒ»è“®é€£éŒ¬å‘‚é­¯æ«“ç‚‰è³‚è·¯éœ²åŠ´å©å»Šå¼„æœ—æ¥¼æ¦”æµªæ¼ +牢狼篭è€è¾è‹éƒŽå…­éº“禄肋録論倭和話歪賄脇惑 牢狼篭è€è¾è‹éƒŽå…­éº“禄肋録論倭和話歪賄脇惑 +枠鷲亙亘é°è©«è—蕨椀湾碗腕・・・・・・・・ 枠鷲亙亘é°è©«è—蕨椀湾碗腕・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・弌ä¸ä¸•个丱丶丼丿乂乖乘亂亅豫亊舒å¼äºŽäºž ・弌ä¸ä¸•个丱丶丼丿乂乖乘亂亅豫亊舒å¼äºŽäºž +亟亠亢亰亳亶从ä»ä»„仆仂仗仞仭仟价伉佚估佛 亟亠亢亰亳亶从ä»ä»„仆仂仗仞仭仟价伉佚估佛 +ä½ä½—佇佶侈ä¾ä¾˜ä½»ä½©ä½°ä¾‘佯來侖儘俔俟俎俘俛 ä½ä½—佇佶侈ä¾ä¾˜ä½»ä½©ä½°ä¾‘佯來侖儘俔俟俎俘俛 +俑俚ä¿ä¿¤ä¿¥å€šå€¨å€”倪倥倅伜俶倡倩倬俾俯們倆 俑俚ä¿ä¿¤ä¿¥å€šå€¨å€”倪倥倅伜俶倡倩倬俾俯們倆 +åƒå‡æœƒå•ååˆåšå–å¬å¸å‚€å‚šå‚…傴傲・・・・・ åƒå‡æœƒå•ååˆåšå–å¬å¸å‚€å‚šå‚…傴傲・・・・・ +・éµéµžéµ¤éµ‘éµéµ™éµ²é¶‰é¶‡é¶«éµ¯éµºé¶šé¶¤é¶©é¶²é·„é·é¶» ・éµéµžéµ¤éµ‘éµéµ™éµ²é¶‰é¶‡é¶«éµ¯éµºé¶šé¶¤é¶©é¶²é·„é·é¶» +鶸鶺鷆é·é·‚鷙鷓鷸鷦鷭鷯鷽鸚鸛鸞鹵鹹鹽éºéºˆ 鶸鶺鷆é·é·‚鷙鷓鷸鷦鷭鷯鷽鸚鸛鸞鹵鹹鹽éºéºˆ +麋麌麒麕麑éºéº¥éº©éº¸éºªéº­é¡é»Œé»Žé»é»é»”é»œé»žé» éº‹éºŒéº’éº•éº‘éºéº¥éº©éº¸éºªéº­é¡é»Œé»Žé»é»é»”é»œé»žé» +黠黥黨黯黴黶黷黹黻黼黽鼇鼈皷鼕鼡鼬鼾齊齒 黠黥黨黯黴黶黷黹黻黼黽鼇鼈皷鼕鼡鼬鼾齊齒 +齔齣齟齠齡齦齧齬齪齷齲齶龕龜龠・・・・・ 齔齣齟齠齡齦齧齬齪齷齲齶龕龜龠・・・・・ +・堯槇é™ç‘¤å‡œç†™ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» ・堯槇é™ç‘¤å‡œç†™ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +SELECT `C1`, CONVERT(`C1` using ucs2) FROM `T8`; +C1 CONVERT(`C1` using ucs2) +  ã€ã€‚,.・:;?ï¼ã‚›ã‚œÂ´ï½€Â¨ï¼¾ï¿£ï¼¿ãƒ½   ã€ã€‚,.・:;?ï¼ã‚›ã‚œÂ´ï½€Â¨ï¼¾ï¿£ï¼¿ãƒ½ +ヾã‚ゞ〃ä»ã€…〆〇ー―â€ï¼ï¼¼ã€œâ€–|…‥‘’ ヾã‚ゞ〃ä»ã€…〆〇ー―â€ï¼ï¼¼ã€œâ€–|…‥‘’ +“â€ï¼ˆï¼‰ã€”〕[]{ï½ã€ˆã€‰ã€Šã€‹ã€Œã€ã€Žã€ã€ã€‘ “â€ï¼ˆï¼‰ã€”〕[]{ï½ã€ˆã€‰ã€Šã€‹ã€Œã€ã€Žã€ã€ã€‘ ++â€Â±Ã—÷ï¼â‰ ï¼œï¼žâ‰¦â‰§âˆžâˆ´â™‚♀°′″℃¥ +â€Â±Ã—÷ï¼â‰ ï¼œï¼žâ‰¦â‰§âˆžâˆ´â™‚♀°′″℃¥ +$¢£%#&*@§☆★○â—◎◇・・・・・ $¢£%#&*@§☆★○â—◎◇・・・・・ +・◆□■△▲▽▼※〒→â†â†‘↓〓・・・・・ ・◆□■△▲▽▼※〒→â†â†‘↓〓・・・・・ +・・・・・・∈∋⊆⊇⊂⊃∪∩・・・・・・ ・・・・・・∈∋⊆⊇⊂⊃∪∩・・・・・・ +・・∧∨¬⇒⇔∀∃・・・・・・・・・・・ ・・∧∨¬⇒⇔∀∃・・・・・・・・・・・ +∠⊥⌒∂∇≡≒≪≫√∽âˆâˆµâˆ«âˆ¬ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» ∠⊥⌒∂∇≡≒≪≫√∽âˆâˆµâˆ«âˆ¬ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» +・・ʼn♯♭♪†‡¶・・・・◯・・・・  ・・ʼn♯♭♪†‡¶・・・・◯・・・・  +・・・・・・・・・・・・・・・・ï¼ï¼‘23 ・・・・・・・・・・・・・・・・ï¼ï¼‘23 +456789・・・・・・・ABCDEFG 456789・・・・・・・ABCDEFG +HIJKLMNOPQRSTUVWXYZ・ HIJKLMNOPQRSTUVWXYZ・ +・・・・・ï½ï½‚cdefghijklï½ï½Žï½ ・・・・・ï½ï½‚cdefghijklï½ï½Žï½ +ï½ï½‘rstuvwxyz・・・・・・・・・ ï½ï½‘rstuvwxyz・・・・・・・・・ +・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’㓠・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“ +ã”ã•ã–ã—ã˜ã™ãšã›ãœããžãŸã ã¡ã¢ã£ã¤ã¥ã¦ã§ ã”ã•ã–ã—ã˜ã™ãšã›ãœããžãŸã ã¡ã¢ã£ã¤ã¥ã¦ã§ +ã¨ã©ãªã«ã¬ã­ã®ã¯ã°ã±ã²ã³ã´ãµã¶ã·ã¸ã¹ãºã» ã¨ã©ãªã«ã¬ã­ã®ã¯ã°ã±ã²ã³ã´ãµã¶ã·ã¸ã¹ãºã» +ã¼ã½ã¾ã¿ã‚€ã‚もゃやゅゆょよらりるれã‚ゎ゠ã¼ã½ã¾ã¿ã‚€ã‚もゃやゅゆょよらりるれã‚ゎ゠+ã‚ゑをん・・・・・・・・・・・・・・・・ ã‚ゑをん・・・・・・・・・・・・・・・・ +・ァアィイゥウェエォオカガキギクグケゲコ ・ァアィイゥウェエォオカガキギクグケゲコ +ゴサザシジスズセゼソゾタダãƒãƒ‚ッツヅテデ ゴサザシジスズセゼソゾタダãƒãƒ‚ッツヅテデ +トドナニヌãƒãƒŽãƒãƒãƒ‘ヒビピフブプヘベペホ トドナニヌãƒãƒŽãƒãƒãƒ‘ヒビピフブプヘベペホ +ボãƒãƒžãƒŸãƒ ãƒ¡ãƒ¢ãƒ£ãƒ¤ãƒ¥ãƒ¦ãƒ§ãƒ¨ãƒ©ãƒªãƒ«ãƒ¬ãƒ­ãƒ®ãƒ¯ ボãƒãƒžãƒŸãƒ ãƒ¡ãƒ¢ãƒ£ãƒ¤ãƒ¥ãƒ¦ãƒ§ãƒ¨ãƒ©ãƒªãƒ«ãƒ¬ãƒ­ãƒ®ãƒ¯ +ヰヱヲンヴヵヶ・・・・・・・・・・・・・ ヰヱヲンヴヵヶ・・・・・・・・・・・・・ +・ΑΒΓΔΕΖΗΘΙΚΛΜÎΞΟΠΡΣΤ ・ΑΒΓΔΕΖΗΘΙΚΛΜÎΞΟΠΡΣΤ +ΥΦΧΨΩ・・・・・・・・αβγδεζη ΥΦΧΨΩ・・・・・・・・αβγδεζη +θικλμνξοπÏστυφχψω・・・ θικλμνξοπÏστυφχψω・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・ÐБВГДЕÐЖЗИЙКЛМÐОПРС ・ÐБВГДЕÐЖЗИЙКЛМÐОПРС +ТУФХЦЧШЩЪЫЬЭЮЯ・・・・・・ ТУФХЦЧШЩЪЫЬЭЮЯ・・・・・・ +・・・・・・・・・абвгдеёжзий ・・・・・・・・・абвгдеёжзий +клмнопрÑÑ‚ÑƒÑ„Ñ…Ñ†Ñ‡ÑˆÑ‰ÑŠÑ‹ÑŒÑ ÐºÐ»Ð¼Ð½Ð¾Ð¿Ñ€ÑÑ‚ÑƒÑ„Ñ…Ñ†Ñ‡ÑˆÑ‰ÑŠÑ‹ÑŒÑ +ÑŽÑ・・・・・・・・・・・・・・・・・・ ÑŽÑ・・・・・・・・・・・・・・・・・・ +・─│┌â”┘└├┬┤┴┼â”┃â”┓┛┗┣┳ ・─│┌â”┘└├┬┤┴┼â”┃â”┓┛┗┣┳ +┫┻╋┠┯┨┷┿â”┰┥┸╂・・・・・・・ ┫┻╋┠┯┨┷┿â”┰┥┸╂・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +ãƒ»äºœå”–å¨ƒé˜¿å“€æ„›æŒ¨å§¶é€¢è‘µèŒœç©æ‚ªæ¡æ¸¥æ—­è‘¦èЦ靵 ãƒ»äºœå”–å¨ƒé˜¿å“€æ„›æŒ¨å§¶é€¢è‘µèŒœç©æ‚ªæ¡æ¸¥æ—­è‘¦èЦ靵 +梓圧斡扱宛å§è™»é£´çµ¢ç¶¾é®Žæˆ–粟袷安庵按暗案闇 梓圧斡扱宛å§è™»é£´çµ¢ç¶¾é®Žæˆ–粟袷安庵按暗案闇 +éžæä»¥ä¼Šä½ä¾å‰å›²å¤·å§”å¨å°‰æƒŸæ„慰易椅為ç•ç•° éžæä»¥ä¼Šä½ä¾å‰å›²å¤·å§”å¨å°‰æƒŸæ„慰易椅為ç•ç•° +移維緯胃èŽè¡£è¬‚é•éºåŒ»äº•亥域育éƒç£¯ä¸€å£±æº¢é€¸ 移維緯胃èŽè¡£è¬‚é•éºåŒ»äº•亥域育éƒç£¯ä¸€å£±æº¢é€¸ +稲茨芋鰯å…å°å’½å“¡å› å§»å¼•飲淫胤蔭・・・・・ 稲茨芋鰯å…å°å’½å“¡å› å§»å¼•飲淫胤蔭・・・・・ +・蓮連錬呂魯櫓炉賂路露労å©å»Šå¼„æœ—æ¥¼æ¦”æµªæ¼ ãƒ»è“®é€£éŒ¬å‘‚é­¯æ«“ç‚‰è³‚è·¯éœ²åŠ´å©å»Šå¼„æœ—æ¥¼æ¦”æµªæ¼ +牢狼篭è€è¾è‹éƒŽå…­éº“禄肋録論倭和話歪賄脇惑 牢狼篭è€è¾è‹éƒŽå…­éº“禄肋録論倭和話歪賄脇惑 +枠鷲亙亘é°è©«è—蕨椀湾碗腕・・・・・・・・ 枠鷲亙亘é°è©«è—蕨椀湾碗腕・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・弌ä¸ä¸•个丱丶丼丿乂乖乘亂亅豫亊舒å¼äºŽäºž ・弌ä¸ä¸•个丱丶丼丿乂乖乘亂亅豫亊舒å¼äºŽäºž +亟亠亢亰亳亶从ä»ä»„仆仂仗仞仭仟价伉佚估佛 亟亠亢亰亳亶从ä»ä»„仆仂仗仞仭仟价伉佚估佛 +ä½ä½—佇佶侈ä¾ä¾˜ä½»ä½©ä½°ä¾‘佯來侖儘俔俟俎俘俛 ä½ä½—佇佶侈ä¾ä¾˜ä½»ä½©ä½°ä¾‘佯來侖儘俔俟俎俘俛 +俑俚ä¿ä¿¤ä¿¥å€šå€¨å€”倪倥倅伜俶倡倩倬俾俯們倆 俑俚ä¿ä¿¤ä¿¥å€šå€¨å€”倪倥倅伜俶倡倩倬俾俯們倆 +åƒå‡æœƒå•ååˆåšå–å¬å¸å‚€å‚šå‚…傴傲・・・・・ åƒå‡æœƒå•ååˆåšå–å¬å¸å‚€å‚šå‚…傴傲・・・・・ +・éµéµžéµ¤éµ‘éµéµ™éµ²é¶‰é¶‡é¶«éµ¯éµºé¶šé¶¤é¶©é¶²é·„é·é¶» ・éµéµžéµ¤éµ‘éµéµ™éµ²é¶‰é¶‡é¶«éµ¯éµºé¶šé¶¤é¶©é¶²é·„é·é¶» +鶸鶺鷆é·é·‚鷙鷓鷸鷦鷭鷯鷽鸚鸛鸞鹵鹹鹽éºéºˆ 鶸鶺鷆é·é·‚鷙鷓鷸鷦鷭鷯鷽鸚鸛鸞鹵鹹鹽éºéºˆ +麋麌麒麕麑éºéº¥éº©éº¸éºªéº­é¡é»Œé»Žé»é»é»”é»œé»žé» éº‹éºŒéº’éº•éº‘éºéº¥éº©éº¸éºªéº­é¡é»Œé»Žé»é»é»”é»œé»žé» +黠黥黨黯黴黶黷黹黻黼黽鼇鼈皷鼕鼡鼬鼾齊齒 黠黥黨黯黴黶黷黹黻黼黽鼇鼈皷鼕鼡鼬鼾齊齒 +齔齣齟齠齡齦齧齬齪齷齲齶龕龜龠・・・・・ 齔齣齟齠齡齦齧齬齪齷齲齶龕龜龠・・・・・ +・堯槇é™ç‘¤å‡œç†™ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» ・堯槇é™ç‘¤å‡œç†™ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +SELECT `C1`, CONVERT(`C1` using sjis) FROM `T8`; +C1 CONVERT(`C1` using sjis) +  ã€ã€‚,.・:;?ï¼ã‚›ã‚œÂ´ï½€Â¨ï¼¾ï¿£ï¼¿ãƒ½   ã€ã€‚,.・:;?ï¼ã‚›ã‚œÂ´ï½€Â¨ï¼¾ï¿£ï¼¿ãƒ½ +ヾã‚ゞ〃ä»ã€…〆〇ー―â€ï¼ï¼¼ã€œâ€–|…‥‘’ ヾã‚ゞ〃ä»ã€…〆〇ー―â€ï¼?〜‖|…‥‘’ +“â€ï¼ˆï¼‰ã€”〕[]{ï½ã€ˆã€‰ã€Šã€‹ã€Œã€ã€Žã€ã€ã€‘ “â€ï¼ˆï¼‰ã€”〕[]{ï½ã€ˆã€‰ã€Šã€‹ã€Œã€ã€Žã€ã€ã€‘ ++â€Â±Ã—÷ï¼â‰ ï¼œï¼žâ‰¦â‰§âˆžâˆ´â™‚♀°′″℃¥ +â€Â±Ã—÷ï¼â‰ ï¼œï¼žâ‰¦â‰§âˆžâˆ´â™‚♀°′″℃¥ +$¢£%#&*@§☆★○â—◎◇・・・・・ $¢£%#&*@§☆★○â—◎◇・・・・・ +・◆□■△▲▽▼※〒→â†â†‘↓〓・・・・・ ・◆□■△▲▽▼※〒→â†â†‘↓〓・・・・・ +・・・・・・∈∋⊆⊇⊂⊃∪∩・・・・・・ ・・・・・・∈∋⊆⊇⊂⊃∪∩・・・・・・ +・・∧∨¬⇒⇔∀∃・・・・・・・・・・・ ・・∧∨¬⇒⇔∀∃・・・・・・・・・・・ +∠⊥⌒∂∇≡≒≪≫√∽âˆâˆµâˆ«âˆ¬ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» ∠⊥⌒∂∇≡≒≪≫√∽âˆâˆµâˆ«âˆ¬ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» +・・ʼn♯♭♪†‡¶・・・・◯・・・・  ・・ʼn♯♭♪†‡¶・・・・◯・・・・  +・・・・・・・・・・・・・・・・ï¼ï¼‘23 ・・・・・・・・・・・・・・・・ï¼ï¼‘23 +456789・・・・・・・ABCDEFG 456789・・・・・・・ABCDEFG +HIJKLMNOPQRSTUVWXYZ・ HIJKLMNOPQRSTUVWXYZ・ +・・・・・ï½ï½‚cdefghijklï½ï½Žï½ ・・・・・ï½ï½‚cdefghijklï½ï½Žï½ +ï½ï½‘rstuvwxyz・・・・・・・・・ ï½ï½‘rstuvwxyz・・・・・・・・・ +・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’㓠・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“ +ã”ã•ã–ã—ã˜ã™ãšã›ãœããžãŸã ã¡ã¢ã£ã¤ã¥ã¦ã§ ã”ã•ã–ã—ã˜ã™ãšã›ãœããžãŸã ã¡ã¢ã£ã¤ã¥ã¦ã§ +ã¨ã©ãªã«ã¬ã­ã®ã¯ã°ã±ã²ã³ã´ãµã¶ã·ã¸ã¹ãºã» ã¨ã©ãªã«ã¬ã­ã®ã¯ã°ã±ã²ã³ã´ãµã¶ã·ã¸ã¹ãºã» +ã¼ã½ã¾ã¿ã‚€ã‚もゃやゅゆょよらりるれã‚ゎ゠ã¼ã½ã¾ã¿ã‚€ã‚もゃやゅゆょよらりるれã‚ゎ゠+ã‚ゑをん・・・・・・・・・・・・・・・・ ã‚ゑをん・・・・・・・・・・・・・・・・ +・ァアィイゥウェエォオカガキギクグケゲコ ・ァアィイゥウェエォオカガキギクグケゲコ +ゴサザシジスズセゼソゾタダãƒãƒ‚ッツヅテデ ゴサザシジスズセゼソゾタダãƒãƒ‚ッツヅテデ +トドナニヌãƒãƒŽãƒãƒãƒ‘ヒビピフブプヘベペホ トドナニヌãƒãƒŽãƒãƒãƒ‘ヒビピフブプヘベペホ +ボãƒãƒžãƒŸãƒ ãƒ¡ãƒ¢ãƒ£ãƒ¤ãƒ¥ãƒ¦ãƒ§ãƒ¨ãƒ©ãƒªãƒ«ãƒ¬ãƒ­ãƒ®ãƒ¯ ボãƒãƒžãƒŸãƒ ãƒ¡ãƒ¢ãƒ£ãƒ¤ãƒ¥ãƒ¦ãƒ§ãƒ¨ãƒ©ãƒªãƒ«ãƒ¬ãƒ­ãƒ®ãƒ¯ +ヰヱヲンヴヵヶ・・・・・・・・・・・・・ ヰヱヲンヴヵヶ・・・・・・・・・・・・・ +・ΑΒΓΔΕΖΗΘΙΚΛΜÎΞΟΠΡΣΤ ・ΑΒΓΔΕΖΗΘΙΚΛΜÎΞΟΠΡΣΤ +ΥΦΧΨΩ・・・・・・・・αβγδεζη ΥΦΧΨΩ・・・・・・・・αβγδεζη +θικλμνξοπÏστυφχψω・・・ θικλμνξοπÏστυφχψω・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・ÐБВГДЕÐЖЗИЙКЛМÐОПРС ・ÐБВГДЕÐЖЗИЙКЛМÐОПРС +ТУФХЦЧШЩЪЫЬЭЮЯ・・・・・・ ТУФХЦЧШЩЪЫЬЭЮЯ・・・・・・ +・・・・・・・・・абвгдеёжзий ・・・・・・・・・абвгдеёжзий +клмнопрÑÑ‚ÑƒÑ„Ñ…Ñ†Ñ‡ÑˆÑ‰ÑŠÑ‹ÑŒÑ ÐºÐ»Ð¼Ð½Ð¾Ð¿Ñ€ÑÑ‚ÑƒÑ„Ñ…Ñ†Ñ‡ÑˆÑ‰ÑŠÑ‹ÑŒÑ +ÑŽÑ・・・・・・・・・・・・・・・・・・ ÑŽÑ・・・・・・・・・・・・・・・・・・ +・─│┌â”┘└├┬┤┴┼â”┃â”┓┛┗┣┳ ・─│┌â”┘└├┬┤┴┼â”┃â”┓┛┗┣┳ +┫┻╋┠┯┨┷┿â”┰┥┸╂・・・・・・・ ┫┻╋┠┯┨┷┿â”┰┥┸╂・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +ãƒ»äºœå”–å¨ƒé˜¿å“€æ„›æŒ¨å§¶é€¢è‘µèŒœç©æ‚ªæ¡æ¸¥æ—­è‘¦èЦ靵 ãƒ»äºœå”–å¨ƒé˜¿å“€æ„›æŒ¨å§¶é€¢è‘µèŒœç©æ‚ªæ¡æ¸¥æ—­è‘¦èЦ靵 +梓圧斡扱宛å§è™»é£´çµ¢ç¶¾é®Žæˆ–粟袷安庵按暗案闇 梓圧斡扱宛å§è™»é£´çµ¢ç¶¾é®Žæˆ–粟袷安庵按暗案闇 +éžæä»¥ä¼Šä½ä¾å‰å›²å¤·å§”å¨å°‰æƒŸæ„慰易椅為ç•ç•° éžæä»¥ä¼Šä½ä¾å‰å›²å¤·å§”å¨å°‰æƒŸæ„慰易椅為ç•ç•° +移維緯胃èŽè¡£è¬‚é•éºåŒ»äº•亥域育éƒç£¯ä¸€å£±æº¢é€¸ 移維緯胃èŽè¡£è¬‚é•éºåŒ»äº•亥域育éƒç£¯ä¸€å£±æº¢é€¸ +稲茨芋鰯å…å°å’½å“¡å› å§»å¼•飲淫胤蔭・・・・・ 稲茨芋鰯å…å°å’½å“¡å› å§»å¼•飲淫胤蔭・・・・・ +・蓮連錬呂魯櫓炉賂路露労å©å»Šå¼„æœ—æ¥¼æ¦”æµªæ¼ ãƒ»è“®é€£éŒ¬å‘‚é­¯æ«“ç‚‰è³‚è·¯éœ²åŠ´å©å»Šå¼„æœ—æ¥¼æ¦”æµªæ¼ +牢狼篭è€è¾è‹éƒŽå…­éº“禄肋録論倭和話歪賄脇惑 牢狼篭è€è¾è‹éƒŽå…­éº“禄肋録論倭和話歪賄脇惑 +枠鷲亙亘é°è©«è—蕨椀湾碗腕・・・・・・・・ 枠鷲亙亘é°è©«è—蕨椀湾碗腕・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・弌ä¸ä¸•个丱丶丼丿乂乖乘亂亅豫亊舒å¼äºŽäºž ・弌ä¸ä¸•个丱丶丼丿乂乖乘亂亅豫亊舒å¼äºŽäºž +亟亠亢亰亳亶从ä»ä»„仆仂仗仞仭仟价伉佚估佛 亟亠亢亰亳亶从ä»ä»„仆仂仗仞仭仟价伉佚估佛 +ä½ä½—佇佶侈ä¾ä¾˜ä½»ä½©ä½°ä¾‘佯來侖儘俔俟俎俘俛 ä½ä½—佇佶侈ä¾ä¾˜ä½»ä½©ä½°ä¾‘佯來侖儘俔俟俎俘俛 +俑俚ä¿ä¿¤ä¿¥å€šå€¨å€”倪倥倅伜俶倡倩倬俾俯們倆 俑俚ä¿ä¿¤ä¿¥å€šå€¨å€”倪倥倅伜俶倡倩倬俾俯們倆 +åƒå‡æœƒå•ååˆåšå–å¬å¸å‚€å‚šå‚…傴傲・・・・・ åƒå‡æœƒå•ååˆåšå–å¬å¸å‚€å‚šå‚…傴傲・・・・・ +・éµéµžéµ¤éµ‘éµéµ™éµ²é¶‰é¶‡é¶«éµ¯éµºé¶šé¶¤é¶©é¶²é·„é·é¶» ・éµéµžéµ¤éµ‘éµéµ™éµ²é¶‰é¶‡é¶«éµ¯éµºé¶šé¶¤é¶©é¶²é·„é·é¶» +鶸鶺鷆é·é·‚鷙鷓鷸鷦鷭鷯鷽鸚鸛鸞鹵鹹鹽éºéºˆ 鶸鶺鷆é·é·‚鷙鷓鷸鷦鷭鷯鷽鸚鸛鸞鹵鹹鹽éºéºˆ +麋麌麒麕麑éºéº¥éº©éº¸éºªéº­é¡é»Œé»Žé»é»é»”é»œé»žé» éº‹éºŒéº’éº•éº‘éºéº¥éº©éº¸éºªéº­é¡é»Œé»Žé»é»é»”é»œé»žé» +黠黥黨黯黴黶黷黹黻黼黽鼇鼈皷鼕鼡鼬鼾齊齒 黠黥黨黯黴黶黷黹黻黼黽鼇鼈皷鼕鼡鼬鼾齊齒 +齔齣齟齠齡齦齧齬齪齷齲齶龕龜龠・・・・・ 齔齣齟齠齡齦齧齬齪齷齲齶龕龜龠・・・・・ +・堯槇é™ç‘¤å‡œç†™ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» ・堯槇é™ç‘¤å‡œç†™ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +SELECT `C1`, CONVERT(`C1` using ujis) FROM `ï¼´ï¼™`; +C1 CONVERT(`C1` using ujis) +ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»Ë˜Ë‡Â¸Ë™Ë ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»Ë˜Ë‡Â¸Ë™Ë +・˛˚~΄΅・・・・・・・・¡¦¿・・・ ・˛˚?΄΅・・・・・・・・¡¦¿・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・ºª©®™ ・・・・・・・・・・・・・・・ºª©®™ +¤№・・・・・・・・・・・・・・・・・・ ¤№・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・ΆΈΉΊΪ・Ό・ΎΫ・Î・・・ ・・・・・ΆΈΉΊΪ・Ό・ΎΫ・Î・・・ +・άέήίϊÎόςÏϋΰώ・・・・・・・ ・άέήίϊÎόςÏϋΰώ・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・ЂЃЄЅІЇ ・・・・・・・・・・・・・・ЂЃЄЅІЇ +ЈЉЊЋЌЎÐ・・・・・・・・・・・・・ ЈЉЊЋЌЎÐ・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・ђѓєѕіїјљњћќўџ・・・・・ ・・ђѓєѕіїјљњћќўџ・・・・・ +・ÆÄ・Ħ・IJ・ÅĿ・ŊØŒ・ŦÞ・・・ ・ÆÄ・Ħ・IJ・ÅĿ・ŊØŒ・ŦÞ・・・ +・・・・・・・・・・・・・æđðħıijĸ ・・・・・・・・・・・・・æđðħıijĸ +łŀʼnŋøœßŧþ・・・・・・・・・・・ łŀʼnŋøœßŧþ・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・ÃÀÄÂĂÇĀĄÅÃĆĈČÇĊĎÉÈË ・ÃÀÄÂĂÇĀĄÅÃĆĈČÇĊĎÉÈË +ÊĚĖĒĘ・ĜĞĢĠĤÃÃŒÃÃŽÇİĪĮĨ ÊĚĖĒĘ・ĜĞĢĠĤÃÃŒÃÃŽÇİĪĮĨ +ĴĶĹĽĻŃŇŅÑÓÒÖÔǑÅŌÕŔŘŖ ĴĶĹĽĻŃŇŅÑÓÒÖÔǑÅŌÕŔŘŖ +ŚŜŠŞŤŢÚÙÜÛŬǓŰŪŲŮŨǗǛǙ ŚŜŠŞŤŢÚÙÜÛŬǓŰŪŲŮŨǗǛǙ +ǕŴßŶŹŽŻ・・・・・・・・・・・・ ǕŴßŶŹŽŻ・・・・・・・・・・・・ +・áàäâăǎÄąåãćĉÄçċÄéèë ・áàäâăǎÄąåãćĉÄçċÄéèë +êěėēęǵÄğ・ġĥíìïîÇ・īįĩ êěėēęǵÄğ・ġĥíìïîÇ・īįĩ +ĵķĺľļńňņñóòöôǒőÅõŕřŗ ĵķĺľļńňņñóòöôǒőÅõŕřŗ +śŚşťţúùüûŭǔűūųůũǘǜǚ śŚşťţúùüûŭǔűūųůũǘǜǚ +ǖŵýÿŷźžż・・・・・・・・・・・・ ǖŵýÿŷźžż・・・・・・・・・・・・ +・丂丄丅丌丒丟丣两丨丫丮丯丰丵乀ä¹ä¹„乇乑 ・丂丄丅丌丒丟丣两丨丫丮丯丰丵乀ä¹ä¹„乇乑 +乚乜乣乨乩乴乵乹乿äºäº–亗äºäº¯äº¹ä»ƒä»ä»šä»›ä»  乚乜乣乨乩乴乵乹乿äºäº–亗äºäº¯äº¹ä»ƒä»ä»šä»›ä»  +仡仢仨仯仱仳仵份仾仿伀伂伃伈伋伌伒伕伖众 仡仢仨仯仱仳仵份仾仿伀伂伃伈伋伌伒伕伖众 +伙伮伱你伳伵伷伹伻伾佀佂佈佉佋佌佒佔佖佘 伙伮伱你伳伵伷伹伻伾佀佂佈佉佋佌佒佔佖佘 +佟佣佪佬佮佱佷佸佹佺佽佾ä¾ä¾‚侄・・・・・ 佟佣佪佬佮佱佷佸佹佺佽佾ä¾ä¾‚侄・・・・・ +・黸黿鼂鼃鼉é¼é¼é¼‘鼒鼔鼖鼗鼙鼚鼛鼟鼢鼦鼪 ・黸黿鼂鼃鼉é¼é¼é¼‘鼒鼔鼖鼗鼙鼚鼛鼟鼢鼦鼪 +鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 +齗齘齚é½é½žé½¨é½©é½­é½®é½¯é½°é½±é½³é½µé½ºé½½é¾é¾é¾‘é¾’ 齗齘齚é½é½žé½¨é½©é½­é½®é½¯é½°é½±é½³é½µé½ºé½½é¾é¾é¾‘é¾’ +龔龖龗龞龡龢龣龥・・・・・・・・・・・・ 龔龖龗龞龡龢龣龥・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +SELECT `C1`, CONVERT(`C1` using ucs2) FROM `ï¼´ï¼™`; +C1 CONVERT(`C1` using ucs2) +ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»Ë˜Ë‡Â¸Ë™Ë ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»Ë˜Ë‡Â¸Ë™Ë +・˛˚~΄΅・・・・・・・・¡¦¿・・・ ・˛˚~΄΅・・・・・・・・¡¦¿・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・ºª©®™ ・・・・・・・・・・・・・・・ºª©®™ +¤№・・・・・・・・・・・・・・・・・・ ¤№・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・ΆΈΉΊΪ・Ό・ΎΫ・Î・・・ ・・・・・ΆΈΉΊΪ・Ό・ΎΫ・Î・・・ +・άέήίϊÎόςÏϋΰώ・・・・・・・ ・άέήίϊÎόςÏϋΰώ・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・ЂЃЄЅІЇ ・・・・・・・・・・・・・・ЂЃЄЅІЇ +ЈЉЊЋЌЎÐ・・・・・・・・・・・・・ ЈЉЊЋЌЎÐ・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・ђѓєѕіїјљњћќўџ・・・・・ ・・ђѓєѕіїјљњћќўџ・・・・・ +・ÆÄ・Ħ・IJ・ÅĿ・ŊØŒ・ŦÞ・・・ ・ÆÄ・Ħ・IJ・ÅĿ・ŊØŒ・ŦÞ・・・ +・・・・・・・・・・・・・æđðħıijĸ ・・・・・・・・・・・・・æđðħıijĸ +łŀʼnŋøœßŧþ・・・・・・・・・・・ łŀʼnŋøœßŧþ・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・ÃÀÄÂĂÇĀĄÅÃĆĈČÇĊĎÉÈË ・ÃÀÄÂĂÇĀĄÅÃĆĈČÇĊĎÉÈË +ÊĚĖĒĘ・ĜĞĢĠĤÃÃŒÃÃŽÇİĪĮĨ ÊĚĖĒĘ・ĜĞĢĠĤÃÃŒÃÃŽÇİĪĮĨ +ĴĶĹĽĻŃŇŅÑÓÒÖÔǑÅŌÕŔŘŖ ĴĶĹĽĻŃŇŅÑÓÒÖÔǑÅŌÕŔŘŖ +ŚŜŠŞŤŢÚÙÜÛŬǓŰŪŲŮŨǗǛǙ ŚŜŠŞŤŢÚÙÜÛŬǓŰŪŲŮŨǗǛǙ +ǕŴßŶŹŽŻ・・・・・・・・・・・・ ǕŴßŶŹŽŻ・・・・・・・・・・・・ +・áàäâăǎÄąåãćĉÄçċÄéèë ・áàäâăǎÄąåãćĉÄçċÄéèë +êěėēęǵÄğ・ġĥíìïîÇ・īįĩ êěėēęǵÄğ・ġĥíìïîÇ・īįĩ +ĵķĺľļńňņñóòöôǒőÅõŕřŗ ĵķĺľļńňņñóòöôǒőÅõŕřŗ +śŚşťţúùüûŭǔűūųůũǘǜǚ śŚşťţúùüûŭǔűūųůũǘǜǚ +ǖŵýÿŷźžż・・・・・・・・・・・・ ǖŵýÿŷźžż・・・・・・・・・・・・ +・丂丄丅丌丒丟丣两丨丫丮丯丰丵乀ä¹ä¹„乇乑 ・丂丄丅丌丒丟丣两丨丫丮丯丰丵乀ä¹ä¹„乇乑 +乚乜乣乨乩乴乵乹乿äºäº–亗äºäº¯äº¹ä»ƒä»ä»šä»›ä»  乚乜乣乨乩乴乵乹乿äºäº–亗äºäº¯äº¹ä»ƒä»ä»šä»›ä»  +仡仢仨仯仱仳仵份仾仿伀伂伃伈伋伌伒伕伖众 仡仢仨仯仱仳仵份仾仿伀伂伃伈伋伌伒伕伖众 +伙伮伱你伳伵伷伹伻伾佀佂佈佉佋佌佒佔佖佘 伙伮伱你伳伵伷伹伻伾佀佂佈佉佋佌佒佔佖佘 +佟佣佪佬佮佱佷佸佹佺佽佾ä¾ä¾‚侄・・・・・ 佟佣佪佬佮佱佷佸佹佺佽佾ä¾ä¾‚侄・・・・・ +・黸黿鼂鼃鼉é¼é¼é¼‘鼒鼔鼖鼗鼙鼚鼛鼟鼢鼦鼪 ・黸黿鼂鼃鼉é¼é¼é¼‘鼒鼔鼖鼗鼙鼚鼛鼟鼢鼦鼪 +鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 +齗齘齚é½é½žé½¨é½©é½­é½®é½¯é½°é½±é½³é½µé½ºé½½é¾é¾é¾‘é¾’ 齗齘齚é½é½žé½¨é½©é½­é½®é½¯é½°é½±é½³é½µé½ºé½½é¾é¾é¾‘é¾’ +龔龖龗龞龡龢龣龥・・・・・・・・・・・・ 龔龖龗龞龡龢龣龥・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +SELECT `C1`, CONVERT(`C1` using sjis) FROM `ï¼´ï¼™`; +C1 CONVERT(`C1` using sjis) +ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»Ë˜Ë‡Â¸Ë™Ë ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»????? +・˛˚~΄΅・・・・・・・・¡¦¿・・・ ・?????・・・・・・・・???・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・ºª©®™ ・・・・・・・・・・・・・・・????? +¤№・・・・・・・・・・・・・・・・・・ ??・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・ΆΈΉΊΪ・Ό・ΎΫ・Î・・・ ・・・・・?????・?・??・?・・・ +・άέήίϊÎόςÏϋΰώ・・・・・・・ ・????????????・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・ЂЃЄЅІЇ ・・・・・・・・・・・・・・?????? +ЈЉЊЋЌЎÐ・・・・・・・・・・・・・ ???????・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・ђѓєѕіїјљњћќўџ・・・・・ ・・?????????????・・・・・ +・ÆÄ・Ħ・IJ・ÅĿ・ŊØŒ・ŦÞ・・・ ・??・?・?・??・???・??・・・ +・・・・・・・・・・・・・æđðħıijĸ ・・・・・・・・・・・・・??????? +łŀʼnŋøœßŧþ・・・・・・・・・・・ ?????????・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・ÃÀÄÂĂÇĀĄÅÃĆĈČÇĊĎÉÈË ・??????????????????? +ÊĚĖĒĘ・ĜĞĢĠĤÃÃŒÃÃŽÇİĪĮĨ ?????・?????????????? +ĴĶĹĽĻŃŇŅÑÓÒÖÔǑÅŌÕŔŘŖ ???????????????????? +ŚŜŠŞŤŢÚÙÜÛŬǓŰŪŲŮŨǗǛǙ ???????????????????? +ǕŴßŶŹŽŻ・・・・・・・・・・・・ ????????・・・・・・・・・・・・ +・áàäâăǎÄąåãćĉÄçċÄéèë ・??????????????????? +êěėēęǵÄğ・ġĥíìïîÇ・īįĩ ????????・???????・??? +ĵķĺľļńňņñóòöôǒőÅõŕřŗ ???????????????????? +śŚşťţúùüûŭǔűūųůũǘǜǚ ???????????????????? +ǖŵýÿŷźžż・・・・・・・・・・・・ ????????・・・・・・・・・・・・ +・丂丄丅丌丒丟丣两丨丫丮丯丰丵乀ä¹ä¹„乇乑 ・??????????????????? +乚乜乣乨乩乴乵乹乿äºäº–亗äºäº¯äº¹ä»ƒä»ä»šä»›ä»  ???????????????????? +仡仢仨仯仱仳仵份仾仿伀伂伃伈伋伌伒伕伖众 ???????????????????? +伙伮伱你伳伵伷伹伻伾佀佂佈佉佋佌佒佔佖佘 ???????????????????? +佟佣佪佬佮佱佷佸佹佺佽佾ä¾ä¾‚侄・・・・・ ???????????????・・・・・ +・黸黿鼂鼃鼉é¼é¼é¼‘鼒鼔鼖鼗鼙鼚鼛鼟鼢鼦鼪 ・??????????????????? +鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 ???????????????????? +齗齘齚é½é½žé½¨é½©é½­é½®é½¯é½°é½±é½³é½µé½ºé½½é¾é¾é¾‘é¾’ ???????????????????? +龔龖龗龞龡龢龣龥・・・・・・・・・・・・ ????????・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +SELECT `C1`, CONVERT(`C1` using ujis) FROM `T1ï¼`; +C1 CONVERT(`C1` using ujis) + !"#$%&'()*+,-./ !"#$%&'()*+,-./ +0123456789:;<=>? 0123456789:;<=>? +@ABCDEFGHIJKLMNO @ABCDEFGHIJKLMNO +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[\]^_ +abcdefghijklmno abcdefghijklmno +pqrstuvwxyz{|}~ pqrstuvwxyz{|}~ + 。「」、・ヲァィゥェォャュョッ 。「」、・ヲァィゥェォャュョッ +ーアイウエオカキクケコサシスセソ ーアイウエオカキクケコサシスセソ +ï¾€ï¾ï¾‚テトナニヌネノハヒフï¾ï¾Žï¾ ï¾€ï¾ï¾‚テトナニヌネノハヒフï¾ï¾Žï¾ +ï¾ï¾‘メモヤユヨラリルレロワï¾ï¾žï¾Ÿ ï¾ï¾‘メモヤユヨラリルレロワï¾ï¾žï¾Ÿ +SELECT `C1`, CONVERT(`C1` using ucs2) FROM `T1ï¼`; +C1 CONVERT(`C1` using ucs2) + !"#$%&'()*+,-./ !"#$%&'()*+,-./ +0123456789:;<=>? 0123456789:;<=>? +@ABCDEFGHIJKLMNO @ABCDEFGHIJKLMNO +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[\]^_ +abcdefghijklmno abcdefghijklmno +pqrstuvwxyz{|}~ pqrstuvwxyz{|}~ + 。「」、・ヲァィゥェォャュョッ 。「」、・ヲァィゥェォャュョッ +ーアイウエオカキクケコサシスセソ ーアイウエオカキクケコサシスセソ +ï¾€ï¾ï¾‚テトナニヌネノハヒフï¾ï¾Žï¾ ï¾€ï¾ï¾‚テトナニヌネノハヒフï¾ï¾Žï¾ +ï¾ï¾‘メモヤユヨラリルレロワï¾ï¾žï¾Ÿ ï¾ï¾‘メモヤユヨラリルレロワï¾ï¾žï¾Ÿ +SELECT `C1`, CONVERT(`C1` using sjis) FROM `T1ï¼`; +C1 CONVERT(`C1` using sjis) + !"#$%&'()*+,-./ !"#$%&'()*+,-./ +0123456789:;<=>? 0123456789:;<=>? +@ABCDEFGHIJKLMNO @ABCDEFGHIJKLMNO +PQRSTUVWXYZ[\]^_ PQRSTUVWXYZ[\]^_ +abcdefghijklmno abcdefghijklmno +pqrstuvwxyz{|}~ pqrstuvwxyz{|}~ + 。「」、・ヲァィゥェォャュョッ 。「」、・ヲァィゥェォャュョッ +ーアイウエオカキクケコサシスセソ ーアイウエオカキクケコサシスセソ +ï¾€ï¾ï¾‚テトナニヌネノハヒフï¾ï¾Žï¾ ï¾€ï¾ï¾‚テトナニヌネノハヒフï¾ï¾Žï¾ +ï¾ï¾‘メモヤユヨラリルレロワï¾ï¾žï¾Ÿ ï¾ï¾‘メモヤユヨラリルレロワï¾ï¾žï¾Ÿ +SELECT `C1`, CONVERT(`C1` using ujis) FROM `T11`; +C1 CONVERT(`C1` using ujis) +  ã€ã€‚,.・:;?ï¼ã‚›ã‚œÂ´ï½€Â¨ï¼¾ï¿£ï¼¿ãƒ½   ã€ã€‚,.・:;?ï¼ã‚›ã‚œÂ´ï½€Â¨ï¼¾ï¿£ï¼¿ãƒ½ +ヾã‚ゞ〃ä»ã€…〆〇ー―â€ï¼ï¼¼ã€œâ€–|…‥‘’ ヾã‚ゞ〃ä»ã€…〆〇ー―â€ï¼?〜‖|…‥‘’ +“â€ï¼ˆï¼‰ã€”〕[]{ï½ã€ˆã€‰ã€Šã€‹ã€Œã€ã€Žã€ã€ã€‘ “â€ï¼ˆï¼‰ã€”〕[]{ï½ã€ˆã€‰ã€Šã€‹ã€Œã€ã€Žã€ã€ã€‘ ++â€Â±Ã—÷ï¼â‰ ï¼œï¼žâ‰¦â‰§âˆžâˆ´â™‚♀°′″℃¥ +â€Â±Ã—÷ï¼â‰ ï¼œï¼žâ‰¦â‰§âˆžâˆ´â™‚♀°′″℃¥ +$¢£%#&*@§☆★○â—◎◇・・・・・ $¢£%#&*@§☆★○â—◎◇・・・・・ +・◆□■△▲▽▼※〒→â†â†‘↓〓・・・・・ ・◆□■△▲▽▼※〒→â†â†‘↓〓・・・・・ +・・・・・・∈∋⊆⊇⊂⊃∪∩・・・・・・ ・・・・・・∈∋⊆⊇⊂⊃∪∩・・・・・・ +・・∧∨¬⇒⇔∀∃・・・・・・・・・・・ ・・∧∨¬⇒⇔∀∃・・・・・・・・・・・ +∠⊥⌒∂∇≡≒≪≫√∽âˆâˆµâˆ«âˆ¬ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» ∠⊥⌒∂∇≡≒≪≫√∽âˆâˆµâˆ«âˆ¬ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» +・・ʼn♯♭♪†‡¶・・・・◯・・・・  ・・ʼn♯♭♪†‡¶・・・・◯・・・・  +・・・・・・・・・・・・・・・・ï¼ï¼‘23 ・・・・・・・・・・・・・・・・ï¼ï¼‘23 +456789・・・・・・・ABCDEFG 456789・・・・・・・ABCDEFG +HIJKLMNOPQRSTUVWXYZ・ HIJKLMNOPQRSTUVWXYZ・ +・・・・・ï½ï½‚cdefghijklï½ï½Žï½ ・・・・・ï½ï½‚cdefghijklï½ï½Žï½ +ï½ï½‘rstuvwxyz・・・・・・・・・ ï½ï½‘rstuvwxyz・・・・・・・・・ +・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’㓠・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“ +ã”ã•ã–ã—ã˜ã™ãšã›ãœããžãŸã ã¡ã¢ã£ã¤ã¥ã¦ã§ ã”ã•ã–ã—ã˜ã™ãšã›ãœããžãŸã ã¡ã¢ã£ã¤ã¥ã¦ã§ +ã¨ã©ãªã«ã¬ã­ã®ã¯ã°ã±ã²ã³ã´ãµã¶ã·ã¸ã¹ãºã» ã¨ã©ãªã«ã¬ã­ã®ã¯ã°ã±ã²ã³ã´ãµã¶ã·ã¸ã¹ãºã» +ã¼ã½ã¾ã¿ã‚€ã‚もゃやゅゆょよらりるれã‚ゎ゠ã¼ã½ã¾ã¿ã‚€ã‚もゃやゅゆょよらりるれã‚ゎ゠+ã‚ゑをん・・・・・・・・・・・・・・・・ ã‚ゑをん・・・・・・・・・・・・・・・・ +・ァアィイゥウェエォオカガキギクグケゲコ ・ァアィイゥウェエォオカガキギクグケゲコ +ゴサザシジスズセゼソゾタダãƒãƒ‚ッツヅテデ ゴサザシジスズセゼソゾタダãƒãƒ‚ッツヅテデ +トドナニヌãƒãƒŽãƒãƒãƒ‘ヒビピフブプヘベペホ トドナニヌãƒãƒŽãƒãƒãƒ‘ヒビピフブプヘベペホ +ボãƒãƒžãƒŸãƒ ãƒ¡ãƒ¢ãƒ£ãƒ¤ãƒ¥ãƒ¦ãƒ§ãƒ¨ãƒ©ãƒªãƒ«ãƒ¬ãƒ­ãƒ®ãƒ¯ ボãƒãƒžãƒŸãƒ ãƒ¡ãƒ¢ãƒ£ãƒ¤ãƒ¥ãƒ¦ãƒ§ãƒ¨ãƒ©ãƒªãƒ«ãƒ¬ãƒ­ãƒ®ãƒ¯ +ヰヱヲンヴヵヶ・・・・・・・・・・・・・ ヰヱヲンヴヵヶ・・・・・・・・・・・・・ +・ΑΒΓΔΕΖΗΘΙΚΛΜÎΞΟΠΡΣΤ ・ΑΒΓΔΕΖΗΘΙΚΛΜÎΞΟΠΡΣΤ +ΥΦΧΨΩ・・・・・・・・αβγδεζη ΥΦΧΨΩ・・・・・・・・αβγδεζη +θικλμνξοπÏστυφχψω・・・ θικλμνξοπÏστυφχψω・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・ÐБВГДЕÐЖЗИЙКЛМÐОПРС ・ÐБВГДЕÐЖЗИЙКЛМÐОПРС +ТУФХЦЧШЩЪЫЬЭЮЯ・・・・・・ ТУФХЦЧШЩЪЫЬЭЮЯ・・・・・・ +・・・・・・・・・абвгдеёжзий ・・・・・・・・・абвгдеёжзий +клмнопрÑÑ‚ÑƒÑ„Ñ…Ñ†Ñ‡ÑˆÑ‰ÑŠÑ‹ÑŒÑ ÐºÐ»Ð¼Ð½Ð¾Ð¿Ñ€ÑÑ‚ÑƒÑ„Ñ…Ñ†Ñ‡ÑˆÑ‰ÑŠÑ‹ÑŒÑ +ÑŽÑ・・・・・・・・・・・・・・・・・・ ÑŽÑ・・・・・・・・・・・・・・・・・・ +・─│┌â”┘└├┬┤┴┼â”┃â”┓┛┗┣┳ ・─│┌â”┘└├┬┤┴┼â”┃â”┓┛┗┣┳ +┫┻╋┠┯┨┷┿â”┰┥┸╂・・・・・・・ ┫┻╋┠┯┨┷┿â”┰┥┸╂・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +ãƒ»äºœå”–å¨ƒé˜¿å“€æ„›æŒ¨å§¶é€¢è‘µèŒœç©æ‚ªæ¡æ¸¥æ—­è‘¦èЦ靵 ãƒ»äºœå”–å¨ƒé˜¿å“€æ„›æŒ¨å§¶é€¢è‘µèŒœç©æ‚ªæ¡æ¸¥æ—­è‘¦èЦ靵 +梓圧斡扱宛å§è™»é£´çµ¢ç¶¾é®Žæˆ–粟袷安庵按暗案闇 梓圧斡扱宛å§è™»é£´çµ¢ç¶¾é®Žæˆ–粟袷安庵按暗案闇 +éžæä»¥ä¼Šä½ä¾å‰å›²å¤·å§”å¨å°‰æƒŸæ„慰易椅為ç•ç•° éžæä»¥ä¼Šä½ä¾å‰å›²å¤·å§”å¨å°‰æƒŸæ„慰易椅為ç•ç•° +移維緯胃èŽè¡£è¬‚é•éºåŒ»äº•亥域育éƒç£¯ä¸€å£±æº¢é€¸ 移維緯胃èŽè¡£è¬‚é•éºåŒ»äº•亥域育éƒç£¯ä¸€å£±æº¢é€¸ +稲茨芋鰯å…å°å’½å“¡å› å§»å¼•飲淫胤蔭・・・・・ 稲茨芋鰯å…å°å’½å“¡å› å§»å¼•飲淫胤蔭・・・・・ +・蓮連錬呂魯櫓炉賂路露労å©å»Šå¼„æœ—æ¥¼æ¦”æµªæ¼ ãƒ»è“®é€£éŒ¬å‘‚é­¯æ«“ç‚‰è³‚è·¯éœ²åŠ´å©å»Šå¼„æœ—æ¥¼æ¦”æµªæ¼ +牢狼篭è€è¾è‹éƒŽå…­éº“禄肋録論倭和話歪賄脇惑 牢狼篭è€è¾è‹éƒŽå…­éº“禄肋録論倭和話歪賄脇惑 +枠鷲亙亘é°è©«è—蕨椀湾碗腕・・・・・・・・ 枠鷲亙亘é°è©«è—蕨椀湾碗腕・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・弌ä¸ä¸•个丱丶丼丿乂乖乘亂亅豫亊舒å¼äºŽäºž ・弌ä¸ä¸•个丱丶丼丿乂乖乘亂亅豫亊舒å¼äºŽäºž +亟亠亢亰亳亶从ä»ä»„仆仂仗仞仭仟价伉佚估佛 亟亠亢亰亳亶从ä»ä»„仆仂仗仞仭仟价伉佚估佛 +ä½ä½—佇佶侈ä¾ä¾˜ä½»ä½©ä½°ä¾‘佯來侖儘俔俟俎俘俛 ä½ä½—佇佶侈ä¾ä¾˜ä½»ä½©ä½°ä¾‘佯來侖儘俔俟俎俘俛 +俑俚ä¿ä¿¤ä¿¥å€šå€¨å€”倪倥倅伜俶倡倩倬俾俯們倆 俑俚ä¿ä¿¤ä¿¥å€šå€¨å€”倪倥倅伜俶倡倩倬俾俯們倆 +åƒå‡æœƒå•ååˆåšå–å¬å¸å‚€å‚šå‚…傴傲・・・・・ åƒå‡æœƒå•ååˆåšå–å¬å¸å‚€å‚šå‚…傴傲・・・・・ +・éµéµžéµ¤éµ‘éµéµ™éµ²é¶‰é¶‡é¶«éµ¯éµºé¶šé¶¤é¶©é¶²é·„é·é¶» ・éµéµžéµ¤éµ‘éµéµ™éµ²é¶‰é¶‡é¶«éµ¯éµºé¶šé¶¤é¶©é¶²é·„é·é¶» +鶸鶺鷆é·é·‚鷙鷓鷸鷦鷭鷯鷽鸚鸛鸞鹵鹹鹽éºéºˆ 鶸鶺鷆é·é·‚鷙鷓鷸鷦鷭鷯鷽鸚鸛鸞鹵鹹鹽éºéºˆ +麋麌麒麕麑éºéº¥éº©éº¸éºªéº­é¡é»Œé»Žé»é»é»”é»œé»žé» éº‹éºŒéº’éº•éº‘éºéº¥éº©éº¸éºªéº­é¡é»Œé»Žé»é»é»”é»œé»žé» +黠黥黨黯黴黶黷黹黻黼黽鼇鼈皷鼕鼡鼬鼾齊齒 黠黥黨黯黴黶黷黹黻黼黽鼇鼈皷鼕鼡鼬鼾齊齒 +齔齣齟齠齡齦齧齬齪齷齲齶龕龜龠・・・・・ 齔齣齟齠齡齦齧齬齪齷齲齶龕龜龠・・・・・ +・堯槇é™ç‘¤å‡œç†™ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» ・堯槇é™ç‘¤å‡œç†™ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +SELECT `C1`, CONVERT(`C1` using ucs2) FROM `T11`; +C1 CONVERT(`C1` using ucs2) +  ã€ã€‚,.・:;?ï¼ã‚›ã‚œÂ´ï½€Â¨ï¼¾ï¿£ï¼¿ãƒ½   ã€ã€‚,.・:;?ï¼ã‚›ã‚œÂ´ï½€Â¨ï¼¾ï¿£ï¼¿ãƒ½ +ヾã‚ゞ〃ä»ã€…〆〇ー―â€ï¼ï¼¼ã€œâ€–|…‥‘’ ヾã‚ゞ〃ä»ã€…〆〇ー―â€ï¼ï¼¼ã€œâ€–|…‥‘’ +“â€ï¼ˆï¼‰ã€”〕[]{ï½ã€ˆã€‰ã€Šã€‹ã€Œã€ã€Žã€ã€ã€‘ “â€ï¼ˆï¼‰ã€”〕[]{ï½ã€ˆã€‰ã€Šã€‹ã€Œã€ã€Žã€ã€ã€‘ ++â€Â±Ã—÷ï¼â‰ ï¼œï¼žâ‰¦â‰§âˆžâˆ´â™‚♀°′″℃¥ +â€Â±Ã—÷ï¼â‰ ï¼œï¼žâ‰¦â‰§âˆžâˆ´â™‚♀°′″℃¥ +$¢£%#&*@§☆★○â—◎◇・・・・・ $¢£%#&*@§☆★○â—◎◇・・・・・ +・◆□■△▲▽▼※〒→â†â†‘↓〓・・・・・ ・◆□■△▲▽▼※〒→â†â†‘↓〓・・・・・ +・・・・・・∈∋⊆⊇⊂⊃∪∩・・・・・・ ・・・・・・∈∋⊆⊇⊂⊃∪∩・・・・・・ +・・∧∨¬⇒⇔∀∃・・・・・・・・・・・ ・・∧∨¬⇒⇔∀∃・・・・・・・・・・・ +∠⊥⌒∂∇≡≒≪≫√∽âˆâˆµâˆ«âˆ¬ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» ∠⊥⌒∂∇≡≒≪≫√∽âˆâˆµâˆ«âˆ¬ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» +・・ʼn♯♭♪†‡¶・・・・◯・・・・  ・・ʼn♯♭♪†‡¶・・・・◯・・・・  +・・・・・・・・・・・・・・・・ï¼ï¼‘23 ・・・・・・・・・・・・・・・・ï¼ï¼‘23 +456789・・・・・・・ABCDEFG 456789・・・・・・・ABCDEFG +HIJKLMNOPQRSTUVWXYZ・ HIJKLMNOPQRSTUVWXYZ・ +・・・・・ï½ï½‚cdefghijklï½ï½Žï½ ・・・・・ï½ï½‚cdefghijklï½ï½Žï½ +ï½ï½‘rstuvwxyz・・・・・・・・・ ï½ï½‘rstuvwxyz・・・・・・・・・ +・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’㓠・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“ +ã”ã•ã–ã—ã˜ã™ãšã›ãœããžãŸã ã¡ã¢ã£ã¤ã¥ã¦ã§ ã”ã•ã–ã—ã˜ã™ãšã›ãœããžãŸã ã¡ã¢ã£ã¤ã¥ã¦ã§ +ã¨ã©ãªã«ã¬ã­ã®ã¯ã°ã±ã²ã³ã´ãµã¶ã·ã¸ã¹ãºã» ã¨ã©ãªã«ã¬ã­ã®ã¯ã°ã±ã²ã³ã´ãµã¶ã·ã¸ã¹ãºã» +ã¼ã½ã¾ã¿ã‚€ã‚もゃやゅゆょよらりるれã‚ゎ゠ã¼ã½ã¾ã¿ã‚€ã‚もゃやゅゆょよらりるれã‚ゎ゠+ã‚ゑをん・・・・・・・・・・・・・・・・ ã‚ゑをん・・・・・・・・・・・・・・・・ +・ァアィイゥウェエォオカガキギクグケゲコ ・ァアィイゥウェエォオカガキギクグケゲコ +ゴサザシジスズセゼソゾタダãƒãƒ‚ッツヅテデ ゴサザシジスズセゼソゾタダãƒãƒ‚ッツヅテデ +トドナニヌãƒãƒŽãƒãƒãƒ‘ヒビピフブプヘベペホ トドナニヌãƒãƒŽãƒãƒãƒ‘ヒビピフブプヘベペホ +ボãƒãƒžãƒŸãƒ ãƒ¡ãƒ¢ãƒ£ãƒ¤ãƒ¥ãƒ¦ãƒ§ãƒ¨ãƒ©ãƒªãƒ«ãƒ¬ãƒ­ãƒ®ãƒ¯ ボãƒãƒžãƒŸãƒ ãƒ¡ãƒ¢ãƒ£ãƒ¤ãƒ¥ãƒ¦ãƒ§ãƒ¨ãƒ©ãƒªãƒ«ãƒ¬ãƒ­ãƒ®ãƒ¯ +ヰヱヲンヴヵヶ・・・・・・・・・・・・・ ヰヱヲンヴヵヶ・・・・・・・・・・・・・ +・ΑΒΓΔΕΖΗΘΙΚΛΜÎΞΟΠΡΣΤ ・ΑΒΓΔΕΖΗΘΙΚΛΜÎΞΟΠΡΣΤ +ΥΦΧΨΩ・・・・・・・・αβγδεζη ΥΦΧΨΩ・・・・・・・・αβγδεζη +θικλμνξοπÏστυφχψω・・・ θικλμνξοπÏστυφχψω・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・ÐБВГДЕÐЖЗИЙКЛМÐОПРС ・ÐБВГДЕÐЖЗИЙКЛМÐОПРС +ТУФХЦЧШЩЪЫЬЭЮЯ・・・・・・ ТУФХЦЧШЩЪЫЬЭЮЯ・・・・・・ +・・・・・・・・・абвгдеёжзий ・・・・・・・・・абвгдеёжзий +клмнопрÑÑ‚ÑƒÑ„Ñ…Ñ†Ñ‡ÑˆÑ‰ÑŠÑ‹ÑŒÑ ÐºÐ»Ð¼Ð½Ð¾Ð¿Ñ€ÑÑ‚ÑƒÑ„Ñ…Ñ†Ñ‡ÑˆÑ‰ÑŠÑ‹ÑŒÑ +ÑŽÑ・・・・・・・・・・・・・・・・・・ ÑŽÑ・・・・・・・・・・・・・・・・・・ +・─│┌â”┘└├┬┤┴┼â”┃â”┓┛┗┣┳ ・─│┌â”┘└├┬┤┴┼â”┃â”┓┛┗┣┳ +┫┻╋┠┯┨┷┿â”┰┥┸╂・・・・・・・ ┫┻╋┠┯┨┷┿â”┰┥┸╂・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +ãƒ»äºœå”–å¨ƒé˜¿å“€æ„›æŒ¨å§¶é€¢è‘µèŒœç©æ‚ªæ¡æ¸¥æ—­è‘¦èЦ靵 ãƒ»äºœå”–å¨ƒé˜¿å“€æ„›æŒ¨å§¶é€¢è‘µèŒœç©æ‚ªæ¡æ¸¥æ—­è‘¦èЦ靵 +梓圧斡扱宛å§è™»é£´çµ¢ç¶¾é®Žæˆ–粟袷安庵按暗案闇 梓圧斡扱宛å§è™»é£´çµ¢ç¶¾é®Žæˆ–粟袷安庵按暗案闇 +éžæä»¥ä¼Šä½ä¾å‰å›²å¤·å§”å¨å°‰æƒŸæ„慰易椅為ç•ç•° éžæä»¥ä¼Šä½ä¾å‰å›²å¤·å§”å¨å°‰æƒŸæ„慰易椅為ç•ç•° +移維緯胃èŽè¡£è¬‚é•éºåŒ»äº•亥域育éƒç£¯ä¸€å£±æº¢é€¸ 移維緯胃èŽè¡£è¬‚é•éºåŒ»äº•亥域育éƒç£¯ä¸€å£±æº¢é€¸ +稲茨芋鰯å…å°å’½å“¡å› å§»å¼•飲淫胤蔭・・・・・ 稲茨芋鰯å…å°å’½å“¡å› å§»å¼•飲淫胤蔭・・・・・ +・蓮連錬呂魯櫓炉賂路露労å©å»Šå¼„æœ—æ¥¼æ¦”æµªæ¼ ãƒ»è“®é€£éŒ¬å‘‚é­¯æ«“ç‚‰è³‚è·¯éœ²åŠ´å©å»Šå¼„æœ—æ¥¼æ¦”æµªæ¼ +牢狼篭è€è¾è‹éƒŽå…­éº“禄肋録論倭和話歪賄脇惑 牢狼篭è€è¾è‹éƒŽå…­éº“禄肋録論倭和話歪賄脇惑 +枠鷲亙亘é°è©«è—蕨椀湾碗腕・・・・・・・・ 枠鷲亙亘é°è©«è—蕨椀湾碗腕・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・弌ä¸ä¸•个丱丶丼丿乂乖乘亂亅豫亊舒å¼äºŽäºž ・弌ä¸ä¸•个丱丶丼丿乂乖乘亂亅豫亊舒å¼äºŽäºž +亟亠亢亰亳亶从ä»ä»„仆仂仗仞仭仟价伉佚估佛 亟亠亢亰亳亶从ä»ä»„仆仂仗仞仭仟价伉佚估佛 +ä½ä½—佇佶侈ä¾ä¾˜ä½»ä½©ä½°ä¾‘佯來侖儘俔俟俎俘俛 ä½ä½—佇佶侈ä¾ä¾˜ä½»ä½©ä½°ä¾‘佯來侖儘俔俟俎俘俛 +俑俚ä¿ä¿¤ä¿¥å€šå€¨å€”倪倥倅伜俶倡倩倬俾俯們倆 俑俚ä¿ä¿¤ä¿¥å€šå€¨å€”倪倥倅伜俶倡倩倬俾俯們倆 +åƒå‡æœƒå•ååˆåšå–å¬å¸å‚€å‚šå‚…傴傲・・・・・ åƒå‡æœƒå•ååˆåšå–å¬å¸å‚€å‚šå‚…傴傲・・・・・ +・éµéµžéµ¤éµ‘éµéµ™éµ²é¶‰é¶‡é¶«éµ¯éµºé¶šé¶¤é¶©é¶²é·„é·é¶» ・éµéµžéµ¤éµ‘éµéµ™éµ²é¶‰é¶‡é¶«éµ¯éµºé¶šé¶¤é¶©é¶²é·„é·é¶» +鶸鶺鷆é·é·‚鷙鷓鷸鷦鷭鷯鷽鸚鸛鸞鹵鹹鹽éºéºˆ 鶸鶺鷆é·é·‚鷙鷓鷸鷦鷭鷯鷽鸚鸛鸞鹵鹹鹽éºéºˆ +麋麌麒麕麑éºéº¥éº©éº¸éºªéº­é¡é»Œé»Žé»é»é»”é»œé»žé» éº‹éºŒéº’éº•éº‘éºéº¥éº©éº¸éºªéº­é¡é»Œé»Žé»é»é»”é»œé»žé» +黠黥黨黯黴黶黷黹黻黼黽鼇鼈皷鼕鼡鼬鼾齊齒 黠黥黨黯黴黶黷黹黻黼黽鼇鼈皷鼕鼡鼬鼾齊齒 +齔齣齟齠齡齦齧齬齪齷齲齶龕龜龠・・・・・ 齔齣齟齠齡齦齧齬齪齷齲齶龕龜龠・・・・・ +・堯槇é™ç‘¤å‡œç†™ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» ・堯槇é™ç‘¤å‡œç†™ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +SELECT `C1`, CONVERT(`C1` using sjis) FROM `T11`; +C1 CONVERT(`C1` using sjis) +  ã€ã€‚,.・:;?ï¼ã‚›ã‚œÂ´ï½€Â¨ï¼¾ï¿£ï¼¿ãƒ½   ã€ã€‚,.・:;?ï¼ã‚›ã‚œÂ´ï½€Â¨ï¼¾ï¿£ï¼¿ãƒ½ +ヾã‚ゞ〃ä»ã€…〆〇ー―â€ï¼ï¼¼ã€œâ€–|…‥‘’ ヾã‚ゞ〃ä»ã€…〆〇ー―â€ï¼?〜‖|…‥‘’ +“â€ï¼ˆï¼‰ã€”〕[]{ï½ã€ˆã€‰ã€Šã€‹ã€Œã€ã€Žã€ã€ã€‘ “â€ï¼ˆï¼‰ã€”〕[]{ï½ã€ˆã€‰ã€Šã€‹ã€Œã€ã€Žã€ã€ã€‘ ++â€Â±Ã—÷ï¼â‰ ï¼œï¼žâ‰¦â‰§âˆžâˆ´â™‚♀°′″℃¥ +â€Â±Ã—÷ï¼â‰ ï¼œï¼žâ‰¦â‰§âˆžâˆ´â™‚♀°′″℃¥ +$¢£%#&*@§☆★○â—◎◇・・・・・ $¢£%#&*@§☆★○â—◎◇・・・・・ +・◆□■△▲▽▼※〒→â†â†‘↓〓・・・・・ ・◆□■△▲▽▼※〒→â†â†‘↓〓・・・・・ +・・・・・・∈∋⊆⊇⊂⊃∪∩・・・・・・ ・・・・・・∈∋⊆⊇⊂⊃∪∩・・・・・・ +・・∧∨¬⇒⇔∀∃・・・・・・・・・・・ ・・∧∨¬⇒⇔∀∃・・・・・・・・・・・ +∠⊥⌒∂∇≡≒≪≫√∽âˆâˆµâˆ«âˆ¬ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» ∠⊥⌒∂∇≡≒≪≫√∽âˆâˆµâˆ«âˆ¬ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» +・・ʼn♯♭♪†‡¶・・・・◯・・・・  ・・ʼn♯♭♪†‡¶・・・・◯・・・・  +・・・・・・・・・・・・・・・・ï¼ï¼‘23 ・・・・・・・・・・・・・・・・ï¼ï¼‘23 +456789・・・・・・・ABCDEFG 456789・・・・・・・ABCDEFG +HIJKLMNOPQRSTUVWXYZ・ HIJKLMNOPQRSTUVWXYZ・ +・・・・・ï½ï½‚cdefghijklï½ï½Žï½ ・・・・・ï½ï½‚cdefghijklï½ï½Žï½ +ï½ï½‘rstuvwxyz・・・・・・・・・ ï½ï½‘rstuvwxyz・・・・・・・・・ +・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’㓠・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“ +ã”ã•ã–ã—ã˜ã™ãšã›ãœããžãŸã ã¡ã¢ã£ã¤ã¥ã¦ã§ ã”ã•ã–ã—ã˜ã™ãšã›ãœããžãŸã ã¡ã¢ã£ã¤ã¥ã¦ã§ +ã¨ã©ãªã«ã¬ã­ã®ã¯ã°ã±ã²ã³ã´ãµã¶ã·ã¸ã¹ãºã» ã¨ã©ãªã«ã¬ã­ã®ã¯ã°ã±ã²ã³ã´ãµã¶ã·ã¸ã¹ãºã» +ã¼ã½ã¾ã¿ã‚€ã‚もゃやゅゆょよらりるれã‚ゎ゠ã¼ã½ã¾ã¿ã‚€ã‚もゃやゅゆょよらりるれã‚ゎ゠+ã‚ゑをん・・・・・・・・・・・・・・・・ ã‚ゑをん・・・・・・・・・・・・・・・・ +・ァアィイゥウェエォオカガキギクグケゲコ ・ァアィイゥウェエォオカガキギクグケゲコ +ゴサザシジスズセゼソゾタダãƒãƒ‚ッツヅテデ ゴサザシジスズセゼソゾタダãƒãƒ‚ッツヅテデ +トドナニヌãƒãƒŽãƒãƒãƒ‘ヒビピフブプヘベペホ トドナニヌãƒãƒŽãƒãƒãƒ‘ヒビピフブプヘベペホ +ボãƒãƒžãƒŸãƒ ãƒ¡ãƒ¢ãƒ£ãƒ¤ãƒ¥ãƒ¦ãƒ§ãƒ¨ãƒ©ãƒªãƒ«ãƒ¬ãƒ­ãƒ®ãƒ¯ ボãƒãƒžãƒŸãƒ ãƒ¡ãƒ¢ãƒ£ãƒ¤ãƒ¥ãƒ¦ãƒ§ãƒ¨ãƒ©ãƒªãƒ«ãƒ¬ãƒ­ãƒ®ãƒ¯ +ヰヱヲンヴヵヶ・・・・・・・・・・・・・ ヰヱヲンヴヵヶ・・・・・・・・・・・・・ +・ΑΒΓΔΕΖΗΘΙΚΛΜÎΞΟΠΡΣΤ ・ΑΒΓΔΕΖΗΘΙΚΛΜÎΞΟΠΡΣΤ +ΥΦΧΨΩ・・・・・・・・αβγδεζη ΥΦΧΨΩ・・・・・・・・αβγδεζη +θικλμνξοπÏστυφχψω・・・ θικλμνξοπÏστυφχψω・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・ÐБВГДЕÐЖЗИЙКЛМÐОПРС ・ÐБВГДЕÐЖЗИЙКЛМÐОПРС +ТУФХЦЧШЩЪЫЬЭЮЯ・・・・・・ ТУФХЦЧШЩЪЫЬЭЮЯ・・・・・・ +・・・・・・・・・абвгдеёжзий ・・・・・・・・・абвгдеёжзий +клмнопрÑÑ‚ÑƒÑ„Ñ…Ñ†Ñ‡ÑˆÑ‰ÑŠÑ‹ÑŒÑ ÐºÐ»Ð¼Ð½Ð¾Ð¿Ñ€ÑÑ‚ÑƒÑ„Ñ…Ñ†Ñ‡ÑˆÑ‰ÑŠÑ‹ÑŒÑ +ÑŽÑ・・・・・・・・・・・・・・・・・・ ÑŽÑ・・・・・・・・・・・・・・・・・・ +・─│┌â”┘└├┬┤┴┼â”┃â”┓┛┗┣┳ ・─│┌â”┘└├┬┤┴┼â”┃â”┓┛┗┣┳ +┫┻╋┠┯┨┷┿â”┰┥┸╂・・・・・・・ ┫┻╋┠┯┨┷┿â”┰┥┸╂・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +ãƒ»äºœå”–å¨ƒé˜¿å“€æ„›æŒ¨å§¶é€¢è‘µèŒœç©æ‚ªæ¡æ¸¥æ—­è‘¦èЦ靵 ãƒ»äºœå”–å¨ƒé˜¿å“€æ„›æŒ¨å§¶é€¢è‘µèŒœç©æ‚ªæ¡æ¸¥æ—­è‘¦èЦ靵 +梓圧斡扱宛å§è™»é£´çµ¢ç¶¾é®Žæˆ–粟袷安庵按暗案闇 梓圧斡扱宛å§è™»é£´çµ¢ç¶¾é®Žæˆ–粟袷安庵按暗案闇 +éžæä»¥ä¼Šä½ä¾å‰å›²å¤·å§”å¨å°‰æƒŸæ„慰易椅為ç•ç•° éžæä»¥ä¼Šä½ä¾å‰å›²å¤·å§”å¨å°‰æƒŸæ„慰易椅為ç•ç•° +移維緯胃èŽè¡£è¬‚é•éºåŒ»äº•亥域育éƒç£¯ä¸€å£±æº¢é€¸ 移維緯胃èŽè¡£è¬‚é•éºåŒ»äº•亥域育éƒç£¯ä¸€å£±æº¢é€¸ +稲茨芋鰯å…å°å’½å“¡å› å§»å¼•飲淫胤蔭・・・・・ 稲茨芋鰯å…å°å’½å“¡å› å§»å¼•飲淫胤蔭・・・・・ +・蓮連錬呂魯櫓炉賂路露労å©å»Šå¼„æœ—æ¥¼æ¦”æµªæ¼ ãƒ»è“®é€£éŒ¬å‘‚é­¯æ«“ç‚‰è³‚è·¯éœ²åŠ´å©å»Šå¼„æœ—æ¥¼æ¦”æµªæ¼ +牢狼篭è€è¾è‹éƒŽå…­éº“禄肋録論倭和話歪賄脇惑 牢狼篭è€è¾è‹éƒŽå…­éº“禄肋録論倭和話歪賄脇惑 +枠鷲亙亘é°è©«è—蕨椀湾碗腕・・・・・・・・ 枠鷲亙亘é°è©«è—蕨椀湾碗腕・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・弌ä¸ä¸•个丱丶丼丿乂乖乘亂亅豫亊舒å¼äºŽäºž ・弌ä¸ä¸•个丱丶丼丿乂乖乘亂亅豫亊舒å¼äºŽäºž +亟亠亢亰亳亶从ä»ä»„仆仂仗仞仭仟价伉佚估佛 亟亠亢亰亳亶从ä»ä»„仆仂仗仞仭仟价伉佚估佛 +ä½ä½—佇佶侈ä¾ä¾˜ä½»ä½©ä½°ä¾‘佯來侖儘俔俟俎俘俛 ä½ä½—佇佶侈ä¾ä¾˜ä½»ä½©ä½°ä¾‘佯來侖儘俔俟俎俘俛 +俑俚ä¿ä¿¤ä¿¥å€šå€¨å€”倪倥倅伜俶倡倩倬俾俯們倆 俑俚ä¿ä¿¤ä¿¥å€šå€¨å€”倪倥倅伜俶倡倩倬俾俯們倆 +åƒå‡æœƒå•ååˆåšå–å¬å¸å‚€å‚šå‚…傴傲・・・・・ åƒå‡æœƒå•ååˆåšå–å¬å¸å‚€å‚šå‚…傴傲・・・・・ +・éµéµžéµ¤éµ‘éµéµ™éµ²é¶‰é¶‡é¶«éµ¯éµºé¶šé¶¤é¶©é¶²é·„é·é¶» ・éµéµžéµ¤éµ‘éµéµ™éµ²é¶‰é¶‡é¶«éµ¯éµºé¶šé¶¤é¶©é¶²é·„é·é¶» +鶸鶺鷆é·é·‚鷙鷓鷸鷦鷭鷯鷽鸚鸛鸞鹵鹹鹽éºéºˆ 鶸鶺鷆é·é·‚鷙鷓鷸鷦鷭鷯鷽鸚鸛鸞鹵鹹鹽éºéºˆ +麋麌麒麕麑éºéº¥éº©éº¸éºªéº­é¡é»Œé»Žé»é»é»”é»œé»žé» éº‹éºŒéº’éº•éº‘éºéº¥éº©éº¸éºªéº­é¡é»Œé»Žé»é»é»”é»œé»žé» +黠黥黨黯黴黶黷黹黻黼黽鼇鼈皷鼕鼡鼬鼾齊齒 黠黥黨黯黴黶黷黹黻黼黽鼇鼈皷鼕鼡鼬鼾齊齒 +齔齣齟齠齡齦齧齬齪齷齲齶龕龜龠・・・・・ 齔齣齟齠齡齦齧齬齪齷齲齶龕龜龠・・・・・ +・堯槇é™ç‘¤å‡œç†™ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» ・堯槇é™ç‘¤å‡œç†™ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +SELECT `C1`, CONVERT(`C1` using ujis) FROM `T12`; +C1 CONVERT(`C1` using ujis) +ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»Ë˜Ë‡Â¸Ë™Ë ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»Ë˜Ë‡Â¸Ë™Ë +・˛˚~΄΅・・・・・・・・¡¦¿・・・ ・˛˚?΄΅・・・・・・・・¡¦¿・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・ºª©®™ ・・・・・・・・・・・・・・・ºª©®™ +¤№・・・・・・・・・・・・・・・・・・ ¤№・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・ΆΈΉΊΪ・Ό・ΎΫ・Î・・・ ・・・・・ΆΈΉΊΪ・Ό・ΎΫ・Î・・・ +・άέήίϊÎόςÏϋΰώ・・・・・・・ ・άέήίϊÎόςÏϋΰώ・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・ЂЃЄЅІЇ ・・・・・・・・・・・・・・ЂЃЄЅІЇ +ЈЉЊЋЌЎÐ・・・・・・・・・・・・・ ЈЉЊЋЌЎÐ・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・ђѓєѕіїјљњћќўџ・・・・・ ・・ђѓєѕіїјљњћќўџ・・・・・ +・ÆÄ・Ħ・IJ・ÅĿ・ŊØŒ・ŦÞ・・・ ・ÆÄ・Ħ・IJ・ÅĿ・ŊØŒ・ŦÞ・・・ +・・・・・・・・・・・・・æđðħıijĸ ・・・・・・・・・・・・・æđðħıijĸ +łŀʼnŋøœßŧþ・・・・・・・・・・・ łŀʼnŋøœßŧþ・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・ÃÀÄÂĂÇĀĄÅÃĆĈČÇĊĎÉÈË ・ÃÀÄÂĂÇĀĄÅÃĆĈČÇĊĎÉÈË +ÊĚĖĒĘ・ĜĞĢĠĤÃÃŒÃÃŽÇİĪĮĨ ÊĚĖĒĘ・ĜĞĢĠĤÃÃŒÃÃŽÇİĪĮĨ +ĴĶĹĽĻŃŇŅÑÓÒÖÔǑÅŌÕŔŘŖ ĴĶĹĽĻŃŇŅÑÓÒÖÔǑÅŌÕŔŘŖ +ŚŜŠŞŤŢÚÙÜÛŬǓŰŪŲŮŨǗǛǙ ŚŜŠŞŤŢÚÙÜÛŬǓŰŪŲŮŨǗǛǙ +ǕŴßŶŹŽŻ・・・・・・・・・・・・ ǕŴßŶŹŽŻ・・・・・・・・・・・・ +・áàäâăǎÄąåãćĉÄçċÄéèë ・áàäâăǎÄąåãćĉÄçċÄéèë +êěėēęǵÄğ・ġĥíìïîÇ・īįĩ êěėēęǵÄğ・ġĥíìïîÇ・īįĩ +ĵķĺľļńňņñóòöôǒőÅõŕřŗ ĵķĺľļńňņñóòöôǒőÅõŕřŗ +śŚşťţúùüûŭǔűūųůũǘǜǚ śŚşťţúùüûŭǔűūųůũǘǜǚ +ǖŵýÿŷźžż・・・・・・・・・・・・ ǖŵýÿŷźžż・・・・・・・・・・・・ +・丂丄丅丌丒丟丣两丨丫丮丯丰丵乀ä¹ä¹„乇乑 ・丂丄丅丌丒丟丣两丨丫丮丯丰丵乀ä¹ä¹„乇乑 +乚乜乣乨乩乴乵乹乿äºäº–亗äºäº¯äº¹ä»ƒä»ä»šä»›ä»  乚乜乣乨乩乴乵乹乿äºäº–亗äºäº¯äº¹ä»ƒä»ä»šä»›ä»  +仡仢仨仯仱仳仵份仾仿伀伂伃伈伋伌伒伕伖众 仡仢仨仯仱仳仵份仾仿伀伂伃伈伋伌伒伕伖众 +伙伮伱你伳伵伷伹伻伾佀佂佈佉佋佌佒佔佖佘 伙伮伱你伳伵伷伹伻伾佀佂佈佉佋佌佒佔佖佘 +佟佣佪佬佮佱佷佸佹佺佽佾ä¾ä¾‚侄・・・・・ 佟佣佪佬佮佱佷佸佹佺佽佾ä¾ä¾‚侄・・・・・ +・黸黿鼂鼃鼉é¼é¼é¼‘鼒鼔鼖鼗鼙鼚鼛鼟鼢鼦鼪 ・黸黿鼂鼃鼉é¼é¼é¼‘鼒鼔鼖鼗鼙鼚鼛鼟鼢鼦鼪 +鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 +齗齘齚é½é½žé½¨é½©é½­é½®é½¯é½°é½±é½³é½µé½ºé½½é¾é¾é¾‘é¾’ 齗齘齚é½é½žé½¨é½©é½­é½®é½¯é½°é½±é½³é½µé½ºé½½é¾é¾é¾‘é¾’ +龔龖龗龞龡龢龣龥・・・・・・・・・・・・ 龔龖龗龞龡龢龣龥・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +SELECT `C1`, CONVERT(`C1` using ucs2) FROM `T12`; +C1 CONVERT(`C1` using ucs2) +ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»Ë˜Ë‡Â¸Ë™Ë ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»Ë˜Ë‡Â¸Ë™Ë +・˛˚~΄΅・・・・・・・・¡¦¿・・・ ・˛˚~΄΅・・・・・・・・¡¦¿・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・ºª©®™ ・・・・・・・・・・・・・・・ºª©®™ +¤№・・・・・・・・・・・・・・・・・・ ¤№・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・ΆΈΉΊΪ・Ό・ΎΫ・Î・・・ ・・・・・ΆΈΉΊΪ・Ό・ΎΫ・Î・・・ +・άέήίϊÎόςÏϋΰώ・・・・・・・ ・άέήίϊÎόςÏϋΰώ・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・ЂЃЄЅІЇ ・・・・・・・・・・・・・・ЂЃЄЅІЇ +ЈЉЊЋЌЎÐ・・・・・・・・・・・・・ ЈЉЊЋЌЎÐ・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・ђѓєѕіїјљњћќўџ・・・・・ ・・ђѓєѕіїјљњћќўџ・・・・・ +・ÆÄ・Ħ・IJ・ÅĿ・ŊØŒ・ŦÞ・・・ ・ÆÄ・Ħ・IJ・ÅĿ・ŊØŒ・ŦÞ・・・ +・・・・・・・・・・・・・æđðħıijĸ ・・・・・・・・・・・・・æđðħıijĸ +łŀʼnŋøœßŧþ・・・・・・・・・・・ łŀʼnŋøœßŧþ・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・ÃÀÄÂĂÇĀĄÅÃĆĈČÇĊĎÉÈË ・ÃÀÄÂĂÇĀĄÅÃĆĈČÇĊĎÉÈË +ÊĚĖĒĘ・ĜĞĢĠĤÃÃŒÃÃŽÇİĪĮĨ ÊĚĖĒĘ・ĜĞĢĠĤÃÃŒÃÃŽÇİĪĮĨ +ĴĶĹĽĻŃŇŅÑÓÒÖÔǑÅŌÕŔŘŖ ĴĶĹĽĻŃŇŅÑÓÒÖÔǑÅŌÕŔŘŖ +ŚŜŠŞŤŢÚÙÜÛŬǓŰŪŲŮŨǗǛǙ ŚŜŠŞŤŢÚÙÜÛŬǓŰŪŲŮŨǗǛǙ +ǕŴßŶŹŽŻ・・・・・・・・・・・・ ǕŴßŶŹŽŻ・・・・・・・・・・・・ +・áàäâăǎÄąåãćĉÄçċÄéèë ・áàäâăǎÄąåãćĉÄçċÄéèë +êěėēęǵÄğ・ġĥíìïîÇ・īįĩ êěėēęǵÄğ・ġĥíìïîÇ・īįĩ +ĵķĺľļńňņñóòöôǒőÅõŕřŗ ĵķĺľļńňņñóòöôǒőÅõŕřŗ +śŚşťţúùüûŭǔűūųůũǘǜǚ śŚşťţúùüûŭǔűūųůũǘǜǚ +ǖŵýÿŷźžż・・・・・・・・・・・・ ǖŵýÿŷźžż・・・・・・・・・・・・ +・丂丄丅丌丒丟丣两丨丫丮丯丰丵乀ä¹ä¹„乇乑 ・丂丄丅丌丒丟丣两丨丫丮丯丰丵乀ä¹ä¹„乇乑 +乚乜乣乨乩乴乵乹乿äºäº–亗äºäº¯äº¹ä»ƒä»ä»šä»›ä»  乚乜乣乨乩乴乵乹乿äºäº–亗äºäº¯äº¹ä»ƒä»ä»šä»›ä»  +仡仢仨仯仱仳仵份仾仿伀伂伃伈伋伌伒伕伖众 仡仢仨仯仱仳仵份仾仿伀伂伃伈伋伌伒伕伖众 +伙伮伱你伳伵伷伹伻伾佀佂佈佉佋佌佒佔佖佘 伙伮伱你伳伵伷伹伻伾佀佂佈佉佋佌佒佔佖佘 +佟佣佪佬佮佱佷佸佹佺佽佾ä¾ä¾‚侄・・・・・ 佟佣佪佬佮佱佷佸佹佺佽佾ä¾ä¾‚侄・・・・・ +・黸黿鼂鼃鼉é¼é¼é¼‘鼒鼔鼖鼗鼙鼚鼛鼟鼢鼦鼪 ・黸黿鼂鼃鼉é¼é¼é¼‘鼒鼔鼖鼗鼙鼚鼛鼟鼢鼦鼪 +鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 +齗齘齚é½é½žé½¨é½©é½­é½®é½¯é½°é½±é½³é½µé½ºé½½é¾é¾é¾‘é¾’ 齗齘齚é½é½žé½¨é½©é½­é½®é½¯é½°é½±é½³é½µé½ºé½½é¾é¾é¾‘é¾’ +龔龖龗龞龡龢龣龥・・・・・・・・・・・・ 龔龖龗龞龡龢龣龥・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +SELECT `C1`, CONVERT(`C1` using sjis) FROM `T12`; +C1 CONVERT(`C1` using sjis) +ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»Ë˜Ë‡Â¸Ë™Ë ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»????? +・˛˚~΄΅・・・・・・・・¡¦¿・・・ ・?????・・・・・・・・???・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・ºª©®™ ・・・・・・・・・・・・・・・????? +¤№・・・・・・・・・・・・・・・・・・ ??・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・ΆΈΉΊΪ・Ό・ΎΫ・Î・・・ ・・・・・?????・?・??・?・・・ +・άέήίϊÎόςÏϋΰώ・・・・・・・ ・????????????・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・ЂЃЄЅІЇ ・・・・・・・・・・・・・・?????? +ЈЉЊЋЌЎÐ・・・・・・・・・・・・・ ???????・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・ђѓєѕіїјљњћќўџ・・・・・ ・・?????????????・・・・・ +・ÆÄ・Ħ・IJ・ÅĿ・ŊØŒ・ŦÞ・・・ ・??・?・?・??・???・??・・・ +・・・・・・・・・・・・・æđðħıijĸ ・・・・・・・・・・・・・??????? +łŀʼnŋøœßŧþ・・・・・・・・・・・ ?????????・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +・ÃÀÄÂĂÇĀĄÅÃĆĈČÇĊĎÉÈË ・??????????????????? +ÊĚĖĒĘ・ĜĞĢĠĤÃÃŒÃÃŽÇİĪĮĨ ?????・?????????????? +ĴĶĹĽĻŃŇŅÑÓÒÖÔǑÅŌÕŔŘŖ ???????????????????? +ŚŜŠŞŤŢÚÙÜÛŬǓŰŪŲŮŨǗǛǙ ???????????????????? +ǕŴßŶŹŽŻ・・・・・・・・・・・・ ????????・・・・・・・・・・・・ +・áàäâăǎÄąåãćĉÄçċÄéèë ・??????????????????? +êěėēęǵÄğ・ġĥíìïîÇ・īįĩ ????????・???????・??? +ĵķĺľļńňņñóòöôǒőÅõŕřŗ ???????????????????? +śŚşťţúùüûŭǔűūųůũǘǜǚ ???????????????????? +ǖŵýÿŷźžż・・・・・・・・・・・・ ????????・・・・・・・・・・・・ +・丂丄丅丌丒丟丣两丨丫丮丯丰丵乀ä¹ä¹„乇乑 ・??????????????????? +乚乜乣乨乩乴乵乹乿äºäº–亗äºäº¯äº¹ä»ƒä»ä»šä»›ä»  ???????????????????? +仡仢仨仯仱仳仵份仾仿伀伂伃伈伋伌伒伕伖众 ???????????????????? +伙伮伱你伳伵伷伹伻伾佀佂佈佉佋佌佒佔佖佘 ???????????????????? +佟佣佪佬佮佱佷佸佹佺佽佾ä¾ä¾‚侄・・・・・ ???????????????・・・・・ +・黸黿鼂鼃鼉é¼é¼é¼‘鼒鼔鼖鼗鼙鼚鼛鼟鼢鼦鼪 ・??????????????????? +鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 ???????????????????? +齗齘齚é½é½žé½¨é½©é½­é½®é½¯é½°é½±é½³é½µé½ºé½½é¾é¾é¾‘é¾’ ???????????????????? +龔龖龗龞龡龢龣龥・・・・・・・・・・・・ ????????・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ ・・・・・・・・・・・・・・・・・・・・ +drop table `T1`; +drop table `ï¼´ï¼’`; +drop table `T3`; +drop table `ï¼´ï¼”`; +drop table `T5`; +drop table `ï¼´ï¼–`; +drop table `ï¼´ï¼—`; +drop table `T8`; +drop table `ï¼´ï¼™`; +drop table `T1ï¼`; +drop table `T11`; +drop table `T12`; diff --git a/mysql-test/suite/jp/r/jp_create_db_sjis.result b/mysql-test/suite/jp/r/jp_create_db_sjis.result new file mode 100755 index 00000000000..1ce0b7228d5 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_create_db_sjis.result @@ -0,0 +1,21 @@ +SET NAMES sjis; +SET character_set_database = sjis; +drop database if exists `ÆÎݺÞ`; +drop database if exists `“ú–{Œê`; +drop database if exists `ƒ\\•\`; +CREATE DATABASE `ÆÎݺÞ`; +CREATE DATABASE `“ú–{Œê`; +CREATE DATABASE `ƒ\\•\`; +SHOW DATABASES; +Database +mysql +test +ƒ\\•\ +“ú–{Œê +ÆÎÝºÞ +USE `ÆÎݺÞ`; +USE `“ú–{Œê`; +USE `ƒ\\•\`; +DROP DATABASE `ÆÎݺÞ`; +DROP DATABASE `“ú–{Œê`; +DROP DATABASE `ƒ\\•\`; diff --git a/mysql-test/suite/jp/r/jp_create_db_ucs2.result b/mysql-test/suite/jp/r/jp_create_db_ucs2.result new file mode 100755 index 00000000000..8fd921ea8e6 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_create_db_ucs2.result @@ -0,0 +1,22 @@ +drop database if exists `ŽÆŽÎŽÝŽºŽÞ`; +drop database if exists `ÆüËܸì`; +drop database if exists `íÜíÝíÞ`; +SET NAMES ujis; +SET character_set_database = ucs2; +SET character_set_server = ucs2; +CREATE DATABASE `ŽÆŽÎŽÝŽºŽÞ`; +CREATE DATABASE `ÆüËܸì`; +CREATE DATABASE `íÜíÝíÞ`; +SHOW DATABASES; +Database +mysql +test +ÆüËܸì +íÜíÝíÞ +ŽÆŽÎŽÝŽºŽÞ +USE `ŽÆŽÎŽÝŽºŽÞ`; +USE `ÆüËܸì`; +USE `íÜíÝíÞ`; +DROP DATABASE `ŽÆŽÎŽÝŽºŽÞ`; +DROP DATABASE `ÆüËܸì`; +DROP DATABASE `íÜíÝíÞ`; diff --git a/mysql-test/suite/jp/r/jp_create_db_ujis.result b/mysql-test/suite/jp/r/jp_create_db_ujis.result new file mode 100755 index 00000000000..45fdb34717b --- /dev/null +++ b/mysql-test/suite/jp/r/jp_create_db_ujis.result @@ -0,0 +1,21 @@ +drop database if exists `ŽÆŽÎŽÝŽºŽÞ`; +drop database if exists `ÆüËܸì`; +drop database if exists `íÜíÝíÞ`; +SET NAMES ujis; +SET character_set_database = ujis; +CREATE DATABASE `ŽÆŽÎŽÝŽºŽÞ`; +CREATE DATABASE `ÆüËܸì`; +CREATE DATABASE `íÜíÝíÞ`; +SHOW DATABASES; +Database +mysql +test +ÆüËܸì +íÜíÝíÞ +ŽÆŽÎŽÝŽºŽÞ +USE `ŽÆŽÎŽÝŽºŽÞ`; +USE `ÆüËܸì`; +USE `íÜíÝíÞ`; +DROP DATABASE `ŽÆŽÎŽÝŽºŽÞ`; +DROP DATABASE `ÆüËܸì`; +DROP DATABASE `íÜíÝíÞ`; diff --git a/mysql-test/suite/jp/r/jp_create_db_utf8.result b/mysql-test/suite/jp/r/jp_create_db_utf8.result new file mode 100755 index 00000000000..c0e996040de --- /dev/null +++ b/mysql-test/suite/jp/r/jp_create_db_utf8.result @@ -0,0 +1,21 @@ +drop database if exists `ニホï¾ï½ºï¾ž`; +drop database if exists `日本語`; +drop database if exists `龔龖龗`; +SET NAMES utf8; +SET character_set_database = utf8; +CREATE DATABASE `ニホï¾ï½ºï¾ž`; +CREATE DATABASE `日本語`; +CREATE DATABASE `龔龖龗`; +SHOW DATABASES; +Database +mysql +test +日本語 +龔龖龗 +ニホï¾ï½ºï¾ž +USE `ニホï¾ï½ºï¾ž`; +USE `日本語`; +USE `龔龖龗`; +DROP DATABASE `ニホï¾ï½ºï¾ž`; +DROP DATABASE `日本語`; +DROP DATABASE `龔龖龗`; diff --git a/mysql-test/suite/jp/r/jp_create_tbl_sjis.result b/mysql-test/suite/jp/r/jp_create_tbl_sjis.result new file mode 100755 index 00000000000..ecc72f9d91b --- /dev/null +++ b/mysql-test/suite/jp/r/jp_create_tbl_sjis.result @@ -0,0 +1,641 @@ +SET NAMES sjis; +SET character_set_database = sjis; +DROP TABLE IF EXISTS `±±±`; +DROP TABLE IF EXISTS `²²²`; +DROP TABLE IF EXISTS `³³³`; +DROP TABLE IF EXISTS `´´´`; +DROP TABLE IF EXISTS `µµµ`; +DROP TABLE IF EXISTS `‚ ‚ ‚ `; +DROP TABLE IF EXISTS `‚¢‚¢‚¢`; +DROP TABLE IF EXISTS `‚¤‚¤‚¤`; +DROP TABLE IF EXISTS `‚¦‚¦‚¦`; +DROP TABLE IF EXISTS `‚¨‚¨‚¨`; +DROP TABLE IF EXISTS `ƒ\ƒ\ƒ\`; +DROP TABLE IF EXISTS `\\\`; +DROP TABLE IF EXISTS `•\•\•\`; +DROP TABLE IF EXISTS `—\—\—\`; +DROP TABLE IF EXISTS `\\\`; +CREATE TABLE `±±±`(`¶¶¶` char(1)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TABLE `²²²`(`···` char(1)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TABLE `‚ ‚ ‚ `(`‚©‚©‚©` char(1)) DEFAULT CHARSET = sjis engine=INNODB; +CREATE TABLE `‚¢‚¢‚¢`(`‚«‚«‚«` char(1)) DEFAULT CHARSET = sjis engine=INNODB; +CREATE TABLE `ƒ\ƒ\ƒ\`(`‰\‰\‰\` char(1)) DEFAULT CHARSET = sjis engine=INNODB; +CREATE TABLE `\\\`(`Ž\Ž\Ž\` char(1)) DEFAULT CHARSET = sjis engine=INNODB; +CREATE TABLE IF NOT EXISTS `±±±`(`¶¶¶` char(1)) DEFAULT CHARSET = sjis engine=INNODB; +CREATE TABLE IF NOT EXISTS `²²²`(`···` char(1)) DEFAULT CHARSET = sjis engine=INNODB; +CREATE TABLE IF NOT EXISTS `‚ ‚ ‚ `(`‚©‚©‚©` char(1)) DEFAULT CHARSET = sjis engine=INNODB; +CREATE TABLE IF NOT EXISTS `‚¢‚¢‚¢`(`‚«‚«‚«` char(1)) DEFAULT CHARSET = sjis engine=INNODB; +CREATE TABLE IF NOT EXISTS `ƒ\ƒ\ƒ\`(`‰\‰\‰\` char(1)) DEFAULT CHARSET = sjis engine=INNODB; +CREATE TABLE IF NOT EXISTS `\\\`(`Ž\Ž\Ž\` char(1)) DEFAULT CHARSET = sjis engine=INNODB; +CREATE TABLE IF NOT EXISTS `³³³`(`¸¸¸` char(1)) DEFAULT CHARSET = sjis engine=INNODB; +CREATE TABLE IF NOT EXISTS `‚¤‚¤‚¤`(`‚­‚­‚­` char(1)) DEFAULT CHARSET = sjis engine=INNODB; +CREATE TABLE IF NOT EXISTS `•\•\•\`(`\\\`char(1)) DEFAULT CHARSET = sjis engine=INNODB; +CREATE TEMPORARY TABLE `´´´`(`¹¹¹` char(1)) DEFAULT CHARSET = sjis engine=INNODB; +CREATE TEMPORARY TABLE `µµµ`(`ººº` char(1)) DEFAULT CHARSET = sjis engine=INNODB; +CREATE TEMPORARY TABLE `‚¦‚¦‚¦`(`‚¯‚¯‚¯` char(1)) DEFAULT CHARSET = sjis engine=INNODB; +CREATE TEMPORARY TABLE `‚¨‚¨‚¨`(`‚±‚±‚±` char(1)) DEFAULT CHARSET = sjis engine=INNODB; +CREATE TEMPORARY TABLE `—\—\—\`(`“\“\“\` char(1)) DEFAULT CHARSET = sjis engine=INNODB; +CREATE TEMPORARY TABLE `\\\`(`”\”\”\` char(1)) DEFAULT CHARSET = sjis engine=INNODB; +DESC `±±±`; +Field Type Null Key Default Extra +¶¶¶ char(1) YES NULL +DESC `²²²`; +Field Type Null Key Default Extra +··· char(1) YES NULL +DESC `³³³`; +Field Type Null Key Default Extra +¸¸¸ char(1) YES NULL +DESC `´´´`; +Field Type Null Key Default Extra +¹¹¹ char(1) YES NULL +DESC `µµµ`; +Field Type Null Key Default Extra +ººº char(1) YES NULL +DESC `‚ ‚ ‚ `; +Field Type Null Key Default Extra +‚©‚©‚© char(1) YES NULL +DESC `‚¢‚¢‚¢`; +Field Type Null Key Default Extra +‚«‚«‚« char(1) YES NULL +DESC `‚¤‚¤‚¤`; +Field Type Null Key Default Extra +‚­‚­‚­ char(1) YES NULL +DESC `‚¦‚¦‚¦`; +Field Type Null Key Default Extra +‚¯‚¯‚¯ char(1) YES NULL +DESC `‚¨‚¨‚¨`; +Field Type Null Key Default Extra +‚±‚±‚± char(1) YES NULL +DESC `ƒ\ƒ\ƒ\`; +Field Type Null Key Default Extra +‰\‰\‰\ char(1) YES NULL +DESC `\\\`; +Field Type Null Key Default Extra +Ž\Ž\Ž\ char(1) YES NULL +DESC `•\•\•\`; +Field Type Null Key Default Extra +\\\ char(1) YES NULL +DESC `—\—\—\`; +Field Type Null Key Default Extra +“\“\“\ char(1) YES NULL +DESC `\\\`; +Field Type Null Key Default Extra +”\”\”\ char(1) YES NULL +SHOW CREATE TABLE `±±±`; +Table Create Table +±±± CREATE TABLE `±±±` ( + `¶¶¶` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=ujis +SHOW CREATE TABLE `²²²`; +Table Create Table +²²² CREATE TABLE `²²²` ( + `···` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=ujis +SHOW CREATE TABLE `³³³`; +Table Create Table +³³³ CREATE TABLE `³³³` ( + `¸¸¸` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=sjis +SHOW CREATE TABLE `´´´`; +Table Create Table +´´´ CREATE TEMPORARY TABLE `´´´` ( + `¹¹¹` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=sjis +SHOW CREATE TABLE `µµµ`; +Table Create Table +µµµ CREATE TEMPORARY TABLE `µµµ` ( + `ººº` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=sjis +SHOW CREATE TABLE `‚ ‚ ‚ `; +Table Create Table +‚ ‚ ‚  CREATE TABLE `‚ ‚ ‚ ` ( + `‚©‚©‚©` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=sjis +SHOW CREATE TABLE `‚¢‚¢‚¢`; +Table Create Table +‚¢‚¢‚¢ CREATE TABLE `‚¢‚¢‚¢` ( + `‚«‚«‚«` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=sjis +SHOW CREATE TABLE `‚¤‚¤‚¤`; +Table Create Table +‚¤‚¤‚¤ CREATE TABLE `‚¤‚¤‚¤` ( + `‚­‚­‚­` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=sjis +SHOW CREATE TABLE `‚¦‚¦‚¦`; +Table Create Table +‚¦‚¦‚¦ CREATE TEMPORARY TABLE `‚¦‚¦‚¦` ( + `‚¯‚¯‚¯` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=sjis +SHOW CREATE TABLE `‚¨‚¨‚¨`; +Table Create Table +‚¨‚¨‚¨ CREATE TEMPORARY TABLE `‚¨‚¨‚¨` ( + `‚±‚±‚±` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=sjis +SHOW CREATE TABLE `ƒ\ƒ\ƒ\`; +Table Create Table +ƒ\ƒ\ƒ\ CREATE TABLE `ƒ\ƒ\ƒ\` ( + `‰\‰\‰\` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=sjis +SHOW CREATE TABLE `\\\`; +Table Create Table +\\\ CREATE TABLE `\\\` ( + `Ž\Ž\Ž\` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=sjis +SHOW CREATE TABLE `•\•\•\`; +Table Create Table +•\•\•\ CREATE TABLE `•\•\•\` ( + `\\\` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=sjis +SHOW CREATE TABLE `—\—\—\`; +Table Create Table +—\—\—\ CREATE TEMPORARY TABLE `—\—\—\` ( + `“\“\“\` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=sjis +SHOW CREATE TABLE `\\\`; +Table Create Table +\\\ CREATE TEMPORARY TABLE `\\\` ( + `”\”\”\` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=sjis +DROP TABLE `±±±`; +DROP TABLE `²²²`; +DROP TABLE `³³³`; +DROP TABLE `´´´`; +DROP TABLE `µµµ`; +DROP TABLE `‚ ‚ ‚ `; +DROP TABLE `‚¢‚¢‚¢`; +DROP TABLE `‚¤‚¤‚¤`; +DROP TABLE `‚¦‚¦‚¦`; +DROP TABLE `‚¨‚¨‚¨`; +DROP TABLE `ƒ\ƒ\ƒ\`; +DROP TABLE `\\\`; +DROP TABLE `•\•\•\`; +DROP TABLE `—\—\—\`; +DROP TABLE `\\\`; +CREATE TABLE `±±±`(`¶¶¶` char(1)) DEFAULT CHARSET = sjis engine=MyISAM; +CREATE TABLE `²²²`(`···` char(1)) DEFAULT CHARSET = sjis engine=MyISAM; +CREATE TABLE `‚ ‚ ‚ `(`‚©‚©‚©` char(1)) DEFAULT CHARSET = sjis engine=MyISAM; +CREATE TABLE `‚¢‚¢‚¢`(`‚«‚«‚«` char(1)) DEFAULT CHARSET = sjis engine=MyISAM; +CREATE TABLE `ƒ\ƒ\ƒ\`(`‰\‰\‰\` char(1)) DEFAULT CHARSET = sjis engine=MyISAM; +CREATE TABLE `\\\`(`Ž\Ž\Ž\` char(1)) DEFAULT CHARSET = sjis engine=MyISAM; +CREATE TABLE IF NOT EXISTS `±±±`(`¶¶¶` char(1)) DEFAULT CHARSET = sjis engine=MyISAM; +CREATE TABLE IF NOT EXISTS `²²²`(`···` char(1)) DEFAULT CHARSET = sjis engine=MyISAM; +CREATE TABLE IF NOT EXISTS `‚ ‚ ‚ `(`‚©‚©‚©` char(1)) DEFAULT CHARSET = sjis engine=MyISAM; +CREATE TABLE IF NOT EXISTS `‚¢‚¢‚¢`(`‚«‚«‚«` char(1)) DEFAULT CHARSET = sjis engine=MyISAM; +CREATE TABLE IF NOT EXISTS `ƒ\ƒ\ƒ\`(`‰\‰\‰\` char(1)) DEFAULT CHARSET = sjis engine=MyISAM; +CREATE TABLE IF NOT EXISTS `\\\`(`Ž\Ž\Ž\` char(1)) DEFAULT CHARSET = sjis engine=MyISAM; +CREATE TABLE IF NOT EXISTS `³³³`(`¸¸¸` char(1)) DEFAULT CHARSET = sjis engine=MyISAM; +CREATE TABLE IF NOT EXISTS `‚¤‚¤‚¤`(`‚­‚­‚­` char(1)) DEFAULT CHARSET = sjis engine=MyISAM; +CREATE TABLE IF NOT EXISTS `•\•\•\`(`\\\`char(1)) DEFAULT CHARSET = sjis engine=MyISAM; +CREATE TEMPORARY TABLE `´´´`(`¹¹¹` char(1)) DEFAULT CHARSET = sjis engine=MyISAM; +CREATE TEMPORARY TABLE `µµµ`(`ººº` char(1)) DEFAULT CHARSET = sjis engine=MyISAM; +CREATE TEMPORARY TABLE `‚¦‚¦‚¦`(`‚¯‚¯‚¯` char(1)) DEFAULT CHARSET = sjis engine=MyISAM; +CREATE TEMPORARY TABLE `‚¨‚¨‚¨`(`‚±‚±‚±` char(1)) DEFAULT CHARSET = sjis engine=MyISAM; +CREATE TEMPORARY TABLE `—\—\—\`(`“\“\“\` char(1)) DEFAULT CHARSET = sjis engine=MyISAM; +CREATE TEMPORARY TABLE `\\\`(`”\”\”\` char(1)) DEFAULT CHARSET = sjis engine=MyISAM; +DESC `±±±`; +Field Type Null Key Default Extra +¶¶¶ char(1) YES NULL +DESC `²²²`; +Field Type Null Key Default Extra +··· char(1) YES NULL +DESC `³³³`; +Field Type Null Key Default Extra +¸¸¸ char(1) YES NULL +DESC `´´´`; +Field Type Null Key Default Extra +¹¹¹ char(1) YES NULL +DESC `µµµ`; +Field Type Null Key Default Extra +ººº char(1) YES NULL +DESC `‚ ‚ ‚ `; +Field Type Null Key Default Extra +‚©‚©‚© char(1) YES NULL +DESC `‚¢‚¢‚¢`; +Field Type Null Key Default Extra +‚«‚«‚« char(1) YES NULL +DESC `‚¤‚¤‚¤`; +Field Type Null Key Default Extra +‚­‚­‚­ char(1) YES NULL +DESC `‚¦‚¦‚¦`; +Field Type Null Key Default Extra +‚¯‚¯‚¯ char(1) YES NULL +DESC `‚¨‚¨‚¨`; +Field Type Null Key Default Extra +‚±‚±‚± char(1) YES NULL +DESC `ƒ\ƒ\ƒ\`; +Field Type Null Key Default Extra +‰\‰\‰\ char(1) YES NULL +DESC `\\\`; +Field Type Null Key Default Extra +Ž\Ž\Ž\ char(1) YES NULL +DESC `•\•\•\`; +Field Type Null Key Default Extra +\\\ char(1) YES NULL +DESC `—\—\—\`; +Field Type Null Key Default Extra +“\“\“\ char(1) YES NULL +DESC `\\\`; +Field Type Null Key Default Extra +”\”\”\ char(1) YES NULL +SHOW CREATE TABLE `±±±`; +Table Create Table +±±± CREATE TABLE `±±±` ( + `¶¶¶` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=sjis +SHOW CREATE TABLE `²²²`; +Table Create Table +²²² CREATE TABLE `²²²` ( + `···` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=sjis +SHOW CREATE TABLE `³³³`; +Table Create Table +³³³ CREATE TABLE `³³³` ( + `¸¸¸` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=sjis +SHOW CREATE TABLE `´´´`; +Table Create Table +´´´ CREATE TEMPORARY TABLE `´´´` ( + `¹¹¹` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=sjis +SHOW CREATE TABLE `µµµ`; +Table Create Table +µµµ CREATE TEMPORARY TABLE `µµµ` ( + `ººº` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=sjis +SHOW CREATE TABLE `‚ ‚ ‚ `; +Table Create Table +‚ ‚ ‚  CREATE TABLE `‚ ‚ ‚ ` ( + `‚©‚©‚©` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=sjis +SHOW CREATE TABLE `‚¢‚¢‚¢`; +Table Create Table +‚¢‚¢‚¢ CREATE TABLE `‚¢‚¢‚¢` ( + `‚«‚«‚«` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=sjis +SHOW CREATE TABLE `‚¤‚¤‚¤`; +Table Create Table +‚¤‚¤‚¤ CREATE TABLE `‚¤‚¤‚¤` ( + `‚­‚­‚­` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=sjis +SHOW CREATE TABLE `‚¦‚¦‚¦`; +Table Create Table +‚¦‚¦‚¦ CREATE TEMPORARY TABLE `‚¦‚¦‚¦` ( + `‚¯‚¯‚¯` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=sjis +SHOW CREATE TABLE `‚¨‚¨‚¨`; +Table Create Table +‚¨‚¨‚¨ CREATE TEMPORARY TABLE `‚¨‚¨‚¨` ( + `‚±‚±‚±` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=sjis +SHOW CREATE TABLE `ƒ\ƒ\ƒ\`; +Table Create Table +ƒ\ƒ\ƒ\ CREATE TABLE `ƒ\ƒ\ƒ\` ( + `‰\‰\‰\` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=sjis +SHOW CREATE TABLE `\\\`; +Table Create Table +\\\ CREATE TABLE `\\\` ( + `Ž\Ž\Ž\` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=sjis +SHOW CREATE TABLE `•\•\•\`; +Table Create Table +•\•\•\ CREATE TABLE `•\•\•\` ( + `\\\` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=sjis +SHOW CREATE TABLE `—\—\—\`; +Table Create Table +—\—\—\ CREATE TEMPORARY TABLE `—\—\—\` ( + `“\“\“\` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=sjis +SHOW CREATE TABLE `\\\`; +Table Create Table +\\\ CREATE TEMPORARY TABLE `\\\` ( + `”\”\”\` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=sjis +DROP TABLE `±±±`; +DROP TABLE `²²²`; +DROP TABLE `³³³`; +DROP TABLE `´´´`; +DROP TABLE `µµµ`; +DROP TABLE `‚ ‚ ‚ `; +DROP TABLE `‚¢‚¢‚¢`; +DROP TABLE `‚¤‚¤‚¤`; +DROP TABLE `‚¦‚¦‚¦`; +DROP TABLE `‚¨‚¨‚¨`; +DROP TABLE `ƒ\ƒ\ƒ\`; +DROP TABLE `\\\`; +DROP TABLE `•\•\•\`; +DROP TABLE `—\—\—\`; +DROP TABLE `\\\`; +CREATE TABLE `±±±`(`¶¶¶` char(1)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TABLE `²²²`(`···` char(1)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TABLE `‚ ‚ ‚ `(`‚©‚©‚©` char(1)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TABLE `‚¢‚¢‚¢`(`‚«‚«‚«` char(1)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TABLE `ƒ\ƒ\ƒ\`(`‰\‰\‰\` char(1)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TABLE `\\\`(`Ž\Ž\Ž\` char(1)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TABLE IF NOT EXISTS `±±±`(`¶¶¶` char(1)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TABLE IF NOT EXISTS `²²²`(`···` char(1)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TABLE IF NOT EXISTS `‚ ‚ ‚ `(`‚©‚©‚©` char(1)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TABLE IF NOT EXISTS `‚¢‚¢‚¢`(`‚«‚«‚«` char(1)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TABLE IF NOT EXISTS `ƒ\ƒ\ƒ\`(`‰\‰\‰\` char(1)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TABLE IF NOT EXISTS `\\\`(`Ž\Ž\Ž\` char(1)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TABLE IF NOT EXISTS `³³³`(`¸¸¸` char(1)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TABLE IF NOT EXISTS `‚¤‚¤‚¤`(`‚­‚­‚­` char(1)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TABLE IF NOT EXISTS `•\•\•\`(`\\\`char(1)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TEMPORARY TABLE `´´´`(`¹¹¹` char(1)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TEMPORARY TABLE `µµµ`(`ººº` char(1)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TEMPORARY TABLE `‚¦‚¦‚¦`(`‚¯‚¯‚¯` char(1)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TEMPORARY TABLE `‚¨‚¨‚¨`(`‚±‚±‚±` char(1)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TEMPORARY TABLE `—\—\—\`(`“\“\“\` char(1)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TEMPORARY TABLE `\\\`(`”\”\”\` char(1)) DEFAULT CHARSET = sjis engine=HEAP; +DESC `±±±`; +Field Type Null Key Default Extra +¶¶¶ char(1) YES NULL +DESC `²²²`; +Field Type Null Key Default Extra +··· char(1) YES NULL +DESC `³³³`; +Field Type Null Key Default Extra +¸¸¸ char(1) YES NULL +DESC `´´´`; +Field Type Null Key Default Extra +¹¹¹ char(1) YES NULL +DESC `µµµ`; +Field Type Null Key Default Extra +ººº char(1) YES NULL +DESC `‚ ‚ ‚ `; +Field Type Null Key Default Extra +‚©‚©‚© char(1) YES NULL +DESC `‚¢‚¢‚¢`; +Field Type Null Key Default Extra +‚«‚«‚« char(1) YES NULL +DESC `‚¤‚¤‚¤`; +Field Type Null Key Default Extra +‚­‚­‚­ char(1) YES NULL +DESC `‚¦‚¦‚¦`; +Field Type Null Key Default Extra +‚¯‚¯‚¯ char(1) YES NULL +DESC `‚¨‚¨‚¨`; +Field Type Null Key Default Extra +‚±‚±‚± char(1) YES NULL +DESC `ƒ\ƒ\ƒ\`; +Field Type Null Key Default Extra +‰\‰\‰\ char(1) YES NULL +DESC `\\\`; +Field Type Null Key Default Extra +Ž\Ž\Ž\ char(1) YES NULL +DESC `•\•\•\`; +Field Type Null Key Default Extra +\\\ char(1) YES NULL +DESC `—\—\—\`; +Field Type Null Key Default Extra +“\“\“\ char(1) YES NULL +DESC `\\\`; +Field Type Null Key Default Extra +”\”\”\ char(1) YES NULL +SHOW CREATE TABLE `±±±`; +Table Create Table +±±± CREATE TABLE `±±±` ( + `¶¶¶` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=sjis +SHOW CREATE TABLE `²²²`; +Table Create Table +²²² CREATE TABLE `²²²` ( + `···` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=sjis +SHOW CREATE TABLE `³³³`; +Table Create Table +³³³ CREATE TABLE `³³³` ( + `¸¸¸` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=sjis +SHOW CREATE TABLE `´´´`; +Table Create Table +´´´ CREATE TEMPORARY TABLE `´´´` ( + `¹¹¹` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=sjis +SHOW CREATE TABLE `µµµ`; +Table Create Table +µµµ CREATE TEMPORARY TABLE `µµµ` ( + `ººº` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=sjis +SHOW CREATE TABLE `‚ ‚ ‚ `; +Table Create Table +‚ ‚ ‚  CREATE TABLE `‚ ‚ ‚ ` ( + `‚©‚©‚©` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=sjis +SHOW CREATE TABLE `‚¢‚¢‚¢`; +Table Create Table +‚¢‚¢‚¢ CREATE TABLE `‚¢‚¢‚¢` ( + `‚«‚«‚«` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=sjis +SHOW CREATE TABLE `‚¤‚¤‚¤`; +Table Create Table +‚¤‚¤‚¤ CREATE TABLE `‚¤‚¤‚¤` ( + `‚­‚­‚­` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=sjis +SHOW CREATE TABLE `‚¦‚¦‚¦`; +Table Create Table +‚¦‚¦‚¦ CREATE TEMPORARY TABLE `‚¦‚¦‚¦` ( + `‚¯‚¯‚¯` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=sjis +SHOW CREATE TABLE `‚¨‚¨‚¨`; +Table Create Table +‚¨‚¨‚¨ CREATE TEMPORARY TABLE `‚¨‚¨‚¨` ( + `‚±‚±‚±` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=sjis +SHOW CREATE TABLE `ƒ\ƒ\ƒ\`; +Table Create Table +ƒ\ƒ\ƒ\ CREATE TABLE `ƒ\ƒ\ƒ\` ( + `‰\‰\‰\` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=sjis +SHOW CREATE TABLE `\\\`; +Table Create Table +\\\ CREATE TABLE `\\\` ( + `Ž\Ž\Ž\` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=sjis +SHOW CREATE TABLE `•\•\•\`; +Table Create Table +•\•\•\ CREATE TABLE `•\•\•\` ( + `\\\` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=sjis +SHOW CREATE TABLE `—\—\—\`; +Table Create Table +—\—\—\ CREATE TEMPORARY TABLE `—\—\—\` ( + `“\“\“\` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=sjis +SHOW CREATE TABLE `\\\`; +Table Create Table +\\\ CREATE TEMPORARY TABLE `\\\` ( + `”\”\”\` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=sjis +DROP TABLE `±±±`; +DROP TABLE `²²²`; +DROP TABLE `³³³`; +DROP TABLE `´´´`; +DROP TABLE `µµµ`; +DROP TABLE `‚ ‚ ‚ `; +DROP TABLE `‚¢‚¢‚¢`; +DROP TABLE `‚¤‚¤‚¤`; +DROP TABLE `‚¦‚¦‚¦`; +DROP TABLE `‚¨‚¨‚¨`; +DROP TABLE `ƒ\ƒ\ƒ\`; +DROP TABLE `\\\`; +DROP TABLE `•\•\•\`; +DROP TABLE `—\—\—\`; +DROP TABLE `\\\`; +CREATE TABLE `±±±`(`¶¶¶` char(1)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TABLE `²²²`(`···` char(1)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TABLE `‚ ‚ ‚ `(`‚©‚©‚©` char(1)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TABLE `‚¢‚¢‚¢`(`‚«‚«‚«` char(1)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TABLE `ƒ\ƒ\ƒ\`(`‰\‰\‰\` char(1)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TABLE `\\\`(`Ž\Ž\Ž\` char(1)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TABLE IF NOT EXISTS `±±±`(`¶¶¶` char(1)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TABLE IF NOT EXISTS `²²²`(`···` char(1)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TABLE IF NOT EXISTS `‚ ‚ ‚ `(`‚©‚©‚©` char(1)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TABLE IF NOT EXISTS `‚¢‚¢‚¢`(`‚«‚«‚«` char(1)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TABLE IF NOT EXISTS `ƒ\ƒ\ƒ\`(`‰\‰\‰\` char(1)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TABLE IF NOT EXISTS `\\\`(`Ž\Ž\Ž\` char(1)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TABLE IF NOT EXISTS `³³³`(`¸¸¸` char(1)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TABLE IF NOT EXISTS `‚¤‚¤‚¤`(`‚­‚­‚­` char(1)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TABLE IF NOT EXISTS `•\•\•\`(`\\\`char(1)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TEMPORARY TABLE `´´´`(`¹¹¹` char(1)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TEMPORARY TABLE `µµµ`(`ººº` char(1)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TEMPORARY TABLE `‚¦‚¦‚¦`(`‚¯‚¯‚¯` char(1)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TEMPORARY TABLE `‚¨‚¨‚¨`(`‚±‚±‚±` char(1)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TEMPORARY TABLE `—\—\—\`(`“\“\“\` char(1)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TEMPORARY TABLE `\\\`(`”\”\”\` char(1)) DEFAULT CHARSET = sjis engine=BDB; +DESC `±±±`; +Field Type Null Key Default Extra +¶¶¶ char(1) YES NULL +DESC `²²²`; +Field Type Null Key Default Extra +··· char(1) YES NULL +DESC `³³³`; +Field Type Null Key Default Extra +¸¸¸ char(1) YES NULL +DESC `´´´`; +Field Type Null Key Default Extra +¹¹¹ char(1) YES NULL +DESC `µµµ`; +Field Type Null Key Default Extra +ººº char(1) YES NULL +DESC `‚ ‚ ‚ `; +Field Type Null Key Default Extra +‚©‚©‚© char(1) YES NULL +DESC `‚¢‚¢‚¢`; +Field Type Null Key Default Extra +‚«‚«‚« char(1) YES NULL +DESC `‚¤‚¤‚¤`; +Field Type Null Key Default Extra +‚­‚­‚­ char(1) YES NULL +DESC `‚¦‚¦‚¦`; +Field Type Null Key Default Extra +‚¯‚¯‚¯ char(1) YES NULL +DESC `‚¨‚¨‚¨`; +Field Type Null Key Default Extra +‚±‚±‚± char(1) YES NULL +DESC `ƒ\ƒ\ƒ\`; +Field Type Null Key Default Extra +‰\‰\‰\ char(1) YES NULL +DESC `\\\`; +Field Type Null Key Default Extra +Ž\Ž\Ž\ char(1) YES NULL +DESC `•\•\•\`; +Field Type Null Key Default Extra +\\\ char(1) YES NULL +DESC `—\—\—\`; +Field Type Null Key Default Extra +“\“\“\ char(1) YES NULL +DESC `\\\`; +Field Type Null Key Default Extra +”\”\”\ char(1) YES NULL +SHOW CREATE TABLE `±±±`; +Table Create Table +±±± CREATE TABLE `±±±` ( + `¶¶¶` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=sjis +SHOW CREATE TABLE `²²²`; +Table Create Table +²²² CREATE TABLE `²²²` ( + `···` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=sjis +SHOW CREATE TABLE `³³³`; +Table Create Table +³³³ CREATE TABLE `³³³` ( + `¸¸¸` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=sjis +SHOW CREATE TABLE `´´´`; +Table Create Table +´´´ CREATE TEMPORARY TABLE `´´´` ( + `¹¹¹` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=sjis +SHOW CREATE TABLE `µµµ`; +Table Create Table +µµµ CREATE TEMPORARY TABLE `µµµ` ( + `ººº` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=sjis +SHOW CREATE TABLE `‚ ‚ ‚ `; +Table Create Table +‚ ‚ ‚  CREATE TABLE `‚ ‚ ‚ ` ( + `‚©‚©‚©` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=sjis +SHOW CREATE TABLE `‚¢‚¢‚¢`; +Table Create Table +‚¢‚¢‚¢ CREATE TABLE `‚¢‚¢‚¢` ( + `‚«‚«‚«` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=sjis +SHOW CREATE TABLE `‚¤‚¤‚¤`; +Table Create Table +‚¤‚¤‚¤ CREATE TABLE `‚¤‚¤‚¤` ( + `‚­‚­‚­` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=sjis +SHOW CREATE TABLE `‚¦‚¦‚¦`; +Table Create Table +‚¦‚¦‚¦ CREATE TEMPORARY TABLE `‚¦‚¦‚¦` ( + `‚¯‚¯‚¯` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=sjis +SHOW CREATE TABLE `‚¨‚¨‚¨`; +Table Create Table +‚¨‚¨‚¨ CREATE TEMPORARY TABLE `‚¨‚¨‚¨` ( + `‚±‚±‚±` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=sjis +SHOW CREATE TABLE `ƒ\ƒ\ƒ\`; +Table Create Table +ƒ\ƒ\ƒ\ CREATE TABLE `ƒ\ƒ\ƒ\` ( + `‰\‰\‰\` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=sjis +SHOW CREATE TABLE `\\\`; +Table Create Table +\\\ CREATE TABLE `\\\` ( + `Ž\Ž\Ž\` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=sjis +SHOW CREATE TABLE `•\•\•\`; +Table Create Table +•\•\•\ CREATE TABLE `•\•\•\` ( + `\\\` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=sjis +SHOW CREATE TABLE `—\—\—\`; +Table Create Table +—\—\—\ CREATE TEMPORARY TABLE `—\—\—\` ( + `“\“\“\` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=sjis +SHOW CREATE TABLE `\\\`; +Table Create Table +\\\ CREATE TEMPORARY TABLE `\\\` ( + `”\”\”\` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=sjis +DROP TABLE `±±±`; +DROP TABLE `²²²`; +DROP TABLE `³³³`; +DROP TABLE `´´´`; +DROP TABLE `µµµ`; +DROP TABLE `‚ ‚ ‚ `; +DROP TABLE `‚¢‚¢‚¢`; +DROP TABLE `‚¤‚¤‚¤`; +DROP TABLE `‚¦‚¦‚¦`; +DROP TABLE `‚¨‚¨‚¨`; +DROP TABLE `ƒ\ƒ\ƒ\`; +DROP TABLE `\\\`; +DROP TABLE `•\•\•\`; +DROP TABLE `—\—\—\`; +DROP TABLE `\\\`; diff --git a/mysql-test/suite/jp/r/jp_create_tbl_ucs2.result b/mysql-test/suite/jp/r/jp_create_tbl_ucs2.result new file mode 100755 index 00000000000..0bf5a6891b0 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_create_tbl_ucs2.result @@ -0,0 +1,641 @@ +DROP TABLE IF EXISTS `ޱޱޱ`; +DROP TABLE IF EXISTS `޲޲޲`; +DROP TABLE IF EXISTS `޳޳޳`; +DROP TABLE IF EXISTS `Ž´Ž´Ž´`; +DROP TABLE IF EXISTS `޵޵޵`; +DROP TABLE IF EXISTS `¤¢¤¢¤¢`; +DROP TABLE IF EXISTS `¤¤¤¤¤¤`; +DROP TABLE IF EXISTS `¤¦¤¦¤¦`; +DROP TABLE IF EXISTS `¤¨¤¨¤¨`; +DROP TABLE IF EXISTS `¤ª¤ª¤ª`; +DROP TABLE IF EXISTS `íÝíÝíÝ`; +DROP TABLE IF EXISTS `íÞíÞíÞ`; +DROP TABLE IF EXISTS `íßíßíß`; +DROP TABLE IF EXISTS `íàíàíà`; +DROP TABLE IF EXISTS `íáíáíá`; +SET NAMES ujis; +SET character_set_database = ucs2; +CREATE TABLE `ޱޱޱ`(`޶޶޶` char(1)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TABLE `޲޲޲`(`Ž·Ž·Ž·` char(1)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TABLE `¤¢¤¢¤¢`(`¤«¤«¤«` char(1)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TABLE `¤¤¤¤¤¤`(`¤­¤­¤­` char(1)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TABLE `íÝíÝíÝ`(`°¡°¡°¡` char(1)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TABLE `íÞíÞíÞ`(`°¢°¢°¢` char(1)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TABLE IF NOT EXISTS `ޱޱޱ`(`޶޶޶` char(1)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TABLE IF NOT EXISTS `޲޲޲`(`Ž·Ž·Ž·` char(1)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TABLE IF NOT EXISTS `¤¢¤¢¤¢`(`¤«¤«¤«` char(1)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TABLE IF NOT EXISTS `¤¤¤¤¤¤`(`¤­¤­¤­` char(1)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TABLE IF NOT EXISTS `íÝíÝíÝ`(`°¡°¡°¡` char(1)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TABLE IF NOT EXISTS `íÞíÞíÞ`(`°¢°¢°¢` char(1)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TABLE IF NOT EXISTS `޳޳޳`(`ޏޏޏ` char(1)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TABLE IF NOT EXISTS `¤¦¤¦¤¦`(`¤¯¤¯¤¯` char(1)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TABLE IF NOT EXISTS `íßíßíß`(`°£°£°£`char(1)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TEMPORARY TABLE `Ž´Ž´Ž´`(`޹޹޹` char(1)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TEMPORARY TABLE `޵޵޵`(`ŽºŽºŽº` char(1)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TEMPORARY TABLE `¤¨¤¨¤¨`(`¤±¤±¤±` char(1)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TEMPORARY TABLE `¤ª¤ª¤ª`(`¤³¤³¤³` char(1)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TEMPORARY TABLE `íàíàíà`(`°¤°¤°¤` char(1)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TEMPORARY TABLE `íáíáíá`(`°¥°¥°¥` char(1)) DEFAULT CHARSET = ucs2 engine=INNODB; +DESC `ޱޱޱ`; +Field Type Null Key Default Extra +޶޶޶ char(1) YES NULL +DESC `޲޲޲`; +Field Type Null Key Default Extra +Ž·Ž·Ž· char(1) YES NULL +DESC `޳޳޳`; +Field Type Null Key Default Extra +ޏޏޏ char(1) YES NULL +DESC `Ž´Ž´Ž´`; +Field Type Null Key Default Extra +޹޹޹ char(1) YES NULL +DESC `޵޵޵`; +Field Type Null Key Default Extra +ŽºŽºŽº char(1) YES NULL +DESC `¤¢¤¢¤¢`; +Field Type Null Key Default Extra +¤«¤«¤« char(1) YES NULL +DESC `¤¤¤¤¤¤`; +Field Type Null Key Default Extra +¤­¤­¤­ char(1) YES NULL +DESC `¤¦¤¦¤¦`; +Field Type Null Key Default Extra +¤¯¤¯¤¯ char(1) YES NULL +DESC `¤¨¤¨¤¨`; +Field Type Null Key Default Extra +¤±¤±¤± char(1) YES NULL +DESC `¤ª¤ª¤ª`; +Field Type Null Key Default Extra +¤³¤³¤³ char(1) YES NULL +DESC `íÝíÝíÝ`; +Field Type Null Key Default Extra +°¡°¡°¡ char(1) YES NULL +DESC `íÞíÞíÞ`; +Field Type Null Key Default Extra +°¢°¢°¢ char(1) YES NULL +DESC `íßíßíß`; +Field Type Null Key Default Extra +°£°£°£ char(1) YES NULL +DESC `íàíàíà`; +Field Type Null Key Default Extra +°¤°¤°¤ char(1) YES NULL +DESC `íáíáíá`; +Field Type Null Key Default Extra +°¥°¥°¥ char(1) YES NULL +SHOW CREATE TABLE `ޱޱޱ`; +Table Create Table +ޱޱޱ CREATE TABLE `ޱޱޱ` ( + `޶޶޶` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `޲޲޲`; +Table Create Table +޲޲޲ CREATE TABLE `޲޲޲` ( + `Ž·Ž·Ž·` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `޳޳޳`; +Table Create Table +޳޳޳ CREATE TABLE `޳޳޳` ( + `ޏޏޏ` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `Ž´Ž´Ž´`; +Table Create Table +Ž´Ž´Ž´ CREATE TEMPORARY TABLE `Ž´Ž´Ž´` ( + `޹޹޹` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `޵޵޵`; +Table Create Table +޵޵޵ CREATE TEMPORARY TABLE `޵޵޵` ( + `ŽºŽºŽº` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `¤¢¤¢¤¢`; +Table Create Table +¤¢¤¢¤¢ CREATE TABLE `¤¢¤¢¤¢` ( + `¤«¤«¤«` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `¤¤¤¤¤¤`; +Table Create Table +¤¤¤¤¤¤ CREATE TABLE `¤¤¤¤¤¤` ( + `¤­¤­¤­` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `¤¦¤¦¤¦`; +Table Create Table +¤¦¤¦¤¦ CREATE TABLE `¤¦¤¦¤¦` ( + `¤¯¤¯¤¯` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `¤¨¤¨¤¨`; +Table Create Table +¤¨¤¨¤¨ CREATE TEMPORARY TABLE `¤¨¤¨¤¨` ( + `¤±¤±¤±` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `¤ª¤ª¤ª`; +Table Create Table +¤ª¤ª¤ª CREATE TEMPORARY TABLE `¤ª¤ª¤ª` ( + `¤³¤³¤³` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `íÝíÝíÝ`; +Table Create Table +íÝíÝíÝ CREATE TABLE `íÝíÝíÝ` ( + `°¡°¡°¡` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `íÞíÞíÞ`; +Table Create Table +íÞíÞíÞ CREATE TABLE `íÞíÞíÞ` ( + `°¢°¢°¢` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `íßíßíß`; +Table Create Table +íßíßíß CREATE TABLE `íßíßíß` ( + `°£°£°£` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `íàíàíà`; +Table Create Table +íàíàíà CREATE TEMPORARY TABLE `íàíàíà` ( + `°¤°¤°¤` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `íáíáíá`; +Table Create Table +íáíáíá CREATE TEMPORARY TABLE `íáíáíá` ( + `°¥°¥°¥` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=ucs2 +DROP TABLE `ޱޱޱ`; +DROP TABLE `޲޲޲`; +DROP TABLE `޳޳޳`; +DROP TABLE `Ž´Ž´Ž´`; +DROP TABLE `޵޵޵`; +DROP TABLE `¤¢¤¢¤¢`; +DROP TABLE `¤¤¤¤¤¤`; +DROP TABLE `¤¦¤¦¤¦`; +DROP TABLE `¤¨¤¨¤¨`; +DROP TABLE `¤ª¤ª¤ª`; +DROP TABLE `íÝíÝíÝ`; +DROP TABLE `íÞíÞíÞ`; +DROP TABLE `íßíßíß`; +DROP TABLE `íàíàíà`; +DROP TABLE `íáíáíá`; +CREATE TABLE `ޱޱޱ`(`޶޶޶` char(1)) DEFAULT CHARSET = ucs2 engine=MyISAM; +CREATE TABLE `޲޲޲`(`Ž·Ž·Ž·` char(1)) DEFAULT CHARSET = ucs2 engine=MyISAM; +CREATE TABLE `¤¢¤¢¤¢`(`¤«¤«¤«` char(1)) DEFAULT CHARSET = ucs2 engine=MyISAM; +CREATE TABLE `¤¤¤¤¤¤`(`¤­¤­¤­` char(1)) DEFAULT CHARSET = ucs2 engine=MyISAM; +CREATE TABLE `íÝíÝíÝ`(`°¡°¡°¡` char(1)) DEFAULT CHARSET = ucs2 engine=MyISAM; +CREATE TABLE `íÞíÞíÞ`(`°¢°¢°¢` char(1)) DEFAULT CHARSET = ucs2 engine=MyISAM; +CREATE TABLE IF NOT EXISTS `ޱޱޱ`(`޶޶޶` char(1)) DEFAULT CHARSET = ucs2 engine=MyISAM; +CREATE TABLE IF NOT EXISTS `޲޲޲`(`Ž·Ž·Ž·` char(1)) DEFAULT CHARSET = ucs2 engine=MyISAM; +CREATE TABLE IF NOT EXISTS `¤¢¤¢¤¢`(`¤«¤«¤«` char(1)) DEFAULT CHARSET = ucs2 engine=MyISAM; +CREATE TABLE IF NOT EXISTS `¤¤¤¤¤¤`(`¤­¤­¤­` char(1)) DEFAULT CHARSET = ucs2 engine=MyISAM; +CREATE TABLE IF NOT EXISTS `íÝíÝíÝ`(`°¡°¡°¡` char(1)) DEFAULT CHARSET = ucs2 engine=MyISAM; +CREATE TABLE IF NOT EXISTS `íÞíÞíÞ`(`°¢°¢°¢` char(1)) DEFAULT CHARSET = ucs2 engine=MyISAM; +CREATE TABLE IF NOT EXISTS `޳޳޳`(`ޏޏޏ` char(1)) DEFAULT CHARSET = ucs2 engine=MyISAM; +CREATE TABLE IF NOT EXISTS `¤¦¤¦¤¦`(`¤¯¤¯¤¯` char(1)) DEFAULT CHARSET = ucs2 engine=MyISAM; +CREATE TABLE IF NOT EXISTS `íßíßíß`(`°£°£°£`char(1)) DEFAULT CHARSET = ucs2 engine=MyISAM; +CREATE TEMPORARY TABLE `Ž´Ž´Ž´`(`޹޹޹` char(1)) DEFAULT CHARSET = ucs2 engine=MyISAM; +CREATE TEMPORARY TABLE `޵޵޵`(`ŽºŽºŽº` char(1)) DEFAULT CHARSET = ucs2 engine=MyISAM; +CREATE TEMPORARY TABLE `¤¨¤¨¤¨`(`¤±¤±¤±` char(1)) DEFAULT CHARSET = ucs2 engine=MyISAM; +CREATE TEMPORARY TABLE `¤ª¤ª¤ª`(`¤³¤³¤³` char(1)) DEFAULT CHARSET = ucs2 engine=MyISAM; +CREATE TEMPORARY TABLE `íàíàíà`(`°¤°¤°¤` char(1)) DEFAULT CHARSET = ucs2 engine=MyISAM; +CREATE TEMPORARY TABLE `íáíáíá`(`°¥°¥°¥` char(1)) DEFAULT CHARSET = ucs2 engine=MyISAM; +DESC `ޱޱޱ`; +Field Type Null Key Default Extra +޶޶޶ char(1) YES NULL +DESC `޲޲޲`; +Field Type Null Key Default Extra +Ž·Ž·Ž· char(1) YES NULL +DESC `޳޳޳`; +Field Type Null Key Default Extra +ޏޏޏ char(1) YES NULL +DESC `Ž´Ž´Ž´`; +Field Type Null Key Default Extra +޹޹޹ char(1) YES NULL +DESC `޵޵޵`; +Field Type Null Key Default Extra +ŽºŽºŽº char(1) YES NULL +DESC `¤¢¤¢¤¢`; +Field Type Null Key Default Extra +¤«¤«¤« char(1) YES NULL +DESC `¤¤¤¤¤¤`; +Field Type Null Key Default Extra +¤­¤­¤­ char(1) YES NULL +DESC `¤¦¤¦¤¦`; +Field Type Null Key Default Extra +¤¯¤¯¤¯ char(1) YES NULL +DESC `¤¨¤¨¤¨`; +Field Type Null Key Default Extra +¤±¤±¤± char(1) YES NULL +DESC `¤ª¤ª¤ª`; +Field Type Null Key Default Extra +¤³¤³¤³ char(1) YES NULL +DESC `íÝíÝíÝ`; +Field Type Null Key Default Extra +°¡°¡°¡ char(1) YES NULL +DESC `íÞíÞíÞ`; +Field Type Null Key Default Extra +°¢°¢°¢ char(1) YES NULL +DESC `íßíßíß`; +Field Type Null Key Default Extra +°£°£°£ char(1) YES NULL +DESC `íàíàíà`; +Field Type Null Key Default Extra +°¤°¤°¤ char(1) YES NULL +DESC `íáíáíá`; +Field Type Null Key Default Extra +°¥°¥°¥ char(1) YES NULL +SHOW CREATE TABLE `ޱޱޱ`; +Table Create Table +ޱޱޱ CREATE TABLE `ޱޱޱ` ( + `޶޶޶` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `޲޲޲`; +Table Create Table +޲޲޲ CREATE TABLE `޲޲޲` ( + `Ž·Ž·Ž·` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `޳޳޳`; +Table Create Table +޳޳޳ CREATE TABLE `޳޳޳` ( + `ޏޏޏ` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `Ž´Ž´Ž´`; +Table Create Table +Ž´Ž´Ž´ CREATE TEMPORARY TABLE `Ž´Ž´Ž´` ( + `޹޹޹` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `޵޵޵`; +Table Create Table +޵޵޵ CREATE TEMPORARY TABLE `޵޵޵` ( + `ŽºŽºŽº` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `¤¢¤¢¤¢`; +Table Create Table +¤¢¤¢¤¢ CREATE TABLE `¤¢¤¢¤¢` ( + `¤«¤«¤«` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `¤¤¤¤¤¤`; +Table Create Table +¤¤¤¤¤¤ CREATE TABLE `¤¤¤¤¤¤` ( + `¤­¤­¤­` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `¤¦¤¦¤¦`; +Table Create Table +¤¦¤¦¤¦ CREATE TABLE `¤¦¤¦¤¦` ( + `¤¯¤¯¤¯` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `¤¨¤¨¤¨`; +Table Create Table +¤¨¤¨¤¨ CREATE TEMPORARY TABLE `¤¨¤¨¤¨` ( + `¤±¤±¤±` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `¤ª¤ª¤ª`; +Table Create Table +¤ª¤ª¤ª CREATE TEMPORARY TABLE `¤ª¤ª¤ª` ( + `¤³¤³¤³` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `íÝíÝíÝ`; +Table Create Table +íÝíÝíÝ CREATE TABLE `íÝíÝíÝ` ( + `°¡°¡°¡` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `íÞíÞíÞ`; +Table Create Table +íÞíÞíÞ CREATE TABLE `íÞíÞíÞ` ( + `°¢°¢°¢` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `íßíßíß`; +Table Create Table +íßíßíß CREATE TABLE `íßíßíß` ( + `°£°£°£` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `íàíàíà`; +Table Create Table +íàíàíà CREATE TEMPORARY TABLE `íàíàíà` ( + `°¤°¤°¤` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `íáíáíá`; +Table Create Table +íáíáíá CREATE TEMPORARY TABLE `íáíáíá` ( + `°¥°¥°¥` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=ucs2 +DROP TABLE `ޱޱޱ`; +DROP TABLE `޲޲޲`; +DROP TABLE `޳޳޳`; +DROP TABLE `Ž´Ž´Ž´`; +DROP TABLE `޵޵޵`; +DROP TABLE `¤¢¤¢¤¢`; +DROP TABLE `¤¤¤¤¤¤`; +DROP TABLE `¤¦¤¦¤¦`; +DROP TABLE `¤¨¤¨¤¨`; +DROP TABLE `¤ª¤ª¤ª`; +DROP TABLE `íÝíÝíÝ`; +DROP TABLE `íÞíÞíÞ`; +DROP TABLE `íßíßíß`; +DROP TABLE `íàíàíà`; +DROP TABLE `íáíáíá`; +CREATE TABLE `ޱޱޱ`(`޶޶޶` char(1)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TABLE `޲޲޲`(`Ž·Ž·Ž·` char(1)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TABLE `¤¢¤¢¤¢`(`¤«¤«¤«` char(1)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TABLE `¤¤¤¤¤¤`(`¤­¤­¤­` char(1)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TABLE `íÝíÝíÝ`(`°¡°¡°¡` char(1)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TABLE `íÞíÞíÞ`(`°¢°¢°¢` char(1)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TABLE IF NOT EXISTS `ޱޱޱ`(`޶޶޶` char(1)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TABLE IF NOT EXISTS `޲޲޲`(`Ž·Ž·Ž·` char(1)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TABLE IF NOT EXISTS `¤¢¤¢¤¢`(`¤«¤«¤«` char(1)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TABLE IF NOT EXISTS `¤¤¤¤¤¤`(`¤­¤­¤­` char(1)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TABLE IF NOT EXISTS `íÝíÝíÝ`(`°¡°¡°¡` char(1)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TABLE IF NOT EXISTS `íÞíÞíÞ`(`°¢°¢°¢` char(1)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TABLE IF NOT EXISTS `޳޳޳`(`ޏޏޏ` char(1)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TABLE IF NOT EXISTS `¤¦¤¦¤¦`(`¤¯¤¯¤¯` char(1)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TABLE IF NOT EXISTS `íßíßíß`(`°£°£°£`char(1)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TEMPORARY TABLE `Ž´Ž´Ž´`(`޹޹޹` char(1)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TEMPORARY TABLE `޵޵޵`(`ŽºŽºŽº` char(1)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TEMPORARY TABLE `¤¨¤¨¤¨`(`¤±¤±¤±` char(1)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TEMPORARY TABLE `¤ª¤ª¤ª`(`¤³¤³¤³` char(1)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TEMPORARY TABLE `íàíàíà`(`°¤°¤°¤` char(1)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TEMPORARY TABLE `íáíáíá`(`°¥°¥°¥` char(1)) DEFAULT CHARSET = ucs2 engine=HEAP; +DESC `ޱޱޱ`; +Field Type Null Key Default Extra +޶޶޶ char(1) YES NULL +DESC `޲޲޲`; +Field Type Null Key Default Extra +Ž·Ž·Ž· char(1) YES NULL +DESC `޳޳޳`; +Field Type Null Key Default Extra +ޏޏޏ char(1) YES NULL +DESC `Ž´Ž´Ž´`; +Field Type Null Key Default Extra +޹޹޹ char(1) YES NULL +DESC `޵޵޵`; +Field Type Null Key Default Extra +ŽºŽºŽº char(1) YES NULL +DESC `¤¢¤¢¤¢`; +Field Type Null Key Default Extra +¤«¤«¤« char(1) YES NULL +DESC `¤¤¤¤¤¤`; +Field Type Null Key Default Extra +¤­¤­¤­ char(1) YES NULL +DESC `¤¦¤¦¤¦`; +Field Type Null Key Default Extra +¤¯¤¯¤¯ char(1) YES NULL +DESC `¤¨¤¨¤¨`; +Field Type Null Key Default Extra +¤±¤±¤± char(1) YES NULL +DESC `¤ª¤ª¤ª`; +Field Type Null Key Default Extra +¤³¤³¤³ char(1) YES NULL +DESC `íÝíÝíÝ`; +Field Type Null Key Default Extra +°¡°¡°¡ char(1) YES NULL +DESC `íÞíÞíÞ`; +Field Type Null Key Default Extra +°¢°¢°¢ char(1) YES NULL +DESC `íßíßíß`; +Field Type Null Key Default Extra +°£°£°£ char(1) YES NULL +DESC `íàíàíà`; +Field Type Null Key Default Extra +°¤°¤°¤ char(1) YES NULL +DESC `íáíáíá`; +Field Type Null Key Default Extra +°¥°¥°¥ char(1) YES NULL +SHOW CREATE TABLE `ޱޱޱ`; +Table Create Table +ޱޱޱ CREATE TABLE `ޱޱޱ` ( + `޶޶޶` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `޲޲޲`; +Table Create Table +޲޲޲ CREATE TABLE `޲޲޲` ( + `Ž·Ž·Ž·` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `޳޳޳`; +Table Create Table +޳޳޳ CREATE TABLE `޳޳޳` ( + `ޏޏޏ` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `Ž´Ž´Ž´`; +Table Create Table +Ž´Ž´Ž´ CREATE TEMPORARY TABLE `Ž´Ž´Ž´` ( + `޹޹޹` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `޵޵޵`; +Table Create Table +޵޵޵ CREATE TEMPORARY TABLE `޵޵޵` ( + `ŽºŽºŽº` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `¤¢¤¢¤¢`; +Table Create Table +¤¢¤¢¤¢ CREATE TABLE `¤¢¤¢¤¢` ( + `¤«¤«¤«` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `¤¤¤¤¤¤`; +Table Create Table +¤¤¤¤¤¤ CREATE TABLE `¤¤¤¤¤¤` ( + `¤­¤­¤­` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `¤¦¤¦¤¦`; +Table Create Table +¤¦¤¦¤¦ CREATE TABLE `¤¦¤¦¤¦` ( + `¤¯¤¯¤¯` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `¤¨¤¨¤¨`; +Table Create Table +¤¨¤¨¤¨ CREATE TEMPORARY TABLE `¤¨¤¨¤¨` ( + `¤±¤±¤±` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `¤ª¤ª¤ª`; +Table Create Table +¤ª¤ª¤ª CREATE TEMPORARY TABLE `¤ª¤ª¤ª` ( + `¤³¤³¤³` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `íÝíÝíÝ`; +Table Create Table +íÝíÝíÝ CREATE TABLE `íÝíÝíÝ` ( + `°¡°¡°¡` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `íÞíÞíÞ`; +Table Create Table +íÞíÞíÞ CREATE TABLE `íÞíÞíÞ` ( + `°¢°¢°¢` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `íßíßíß`; +Table Create Table +íßíßíß CREATE TABLE `íßíßíß` ( + `°£°£°£` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `íàíàíà`; +Table Create Table +íàíàíà CREATE TEMPORARY TABLE `íàíàíà` ( + `°¤°¤°¤` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `íáíáíá`; +Table Create Table +íáíáíá CREATE TEMPORARY TABLE `íáíáíá` ( + `°¥°¥°¥` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=ucs2 +DROP TABLE `ޱޱޱ`; +DROP TABLE `޲޲޲`; +DROP TABLE `޳޳޳`; +DROP TABLE `Ž´Ž´Ž´`; +DROP TABLE `޵޵޵`; +DROP TABLE `¤¢¤¢¤¢`; +DROP TABLE `¤¤¤¤¤¤`; +DROP TABLE `¤¦¤¦¤¦`; +DROP TABLE `¤¨¤¨¤¨`; +DROP TABLE `¤ª¤ª¤ª`; +DROP TABLE `íÝíÝíÝ`; +DROP TABLE `íÞíÞíÞ`; +DROP TABLE `íßíßíß`; +DROP TABLE `íàíàíà`; +DROP TABLE `íáíáíá`; +CREATE TABLE `ޱޱޱ`(`޶޶޶` char(1)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TABLE `޲޲޲`(`Ž·Ž·Ž·` char(1)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TABLE `¤¢¤¢¤¢`(`¤«¤«¤«` char(1)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TABLE `¤¤¤¤¤¤`(`¤­¤­¤­` char(1)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TABLE `íÝíÝíÝ`(`°¡°¡°¡` char(1)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TABLE `íÞíÞíÞ`(`°¢°¢°¢` char(1)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TABLE IF NOT EXISTS `ޱޱޱ`(`޶޶޶` char(1)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TABLE IF NOT EXISTS `޲޲޲`(`Ž·Ž·Ž·` char(1)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TABLE IF NOT EXISTS `¤¢¤¢¤¢`(`¤«¤«¤«` char(1)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TABLE IF NOT EXISTS `¤¤¤¤¤¤`(`¤­¤­¤­` char(1)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TABLE IF NOT EXISTS `íÝíÝíÝ`(`°¡°¡°¡` char(1)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TABLE IF NOT EXISTS `íÞíÞíÞ`(`°¢°¢°¢` char(1)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TABLE IF NOT EXISTS `޳޳޳`(`ޏޏޏ` char(1)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TABLE IF NOT EXISTS `¤¦¤¦¤¦`(`¤¯¤¯¤¯` char(1)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TABLE IF NOT EXISTS `íßíßíß`(`°£°£°£`char(1)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TEMPORARY TABLE `Ž´Ž´Ž´`(`޹޹޹` char(1)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TEMPORARY TABLE `޵޵޵`(`ŽºŽºŽº` char(1)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TEMPORARY TABLE `¤¨¤¨¤¨`(`¤±¤±¤±` char(1)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TEMPORARY TABLE `¤ª¤ª¤ª`(`¤³¤³¤³` char(1)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TEMPORARY TABLE `íàíàíà`(`°¤°¤°¤` char(1)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TEMPORARY TABLE `íáíáíá`(`°¥°¥°¥` char(1)) DEFAULT CHARSET = ucs2 engine=BDB; +DESC `ޱޱޱ`; +Field Type Null Key Default Extra +޶޶޶ char(1) YES NULL +DESC `޲޲޲`; +Field Type Null Key Default Extra +Ž·Ž·Ž· char(1) YES NULL +DESC `޳޳޳`; +Field Type Null Key Default Extra +ޏޏޏ char(1) YES NULL +DESC `Ž´Ž´Ž´`; +Field Type Null Key Default Extra +޹޹޹ char(1) YES NULL +DESC `޵޵޵`; +Field Type Null Key Default Extra +ŽºŽºŽº char(1) YES NULL +DESC `¤¢¤¢¤¢`; +Field Type Null Key Default Extra +¤«¤«¤« char(1) YES NULL +DESC `¤¤¤¤¤¤`; +Field Type Null Key Default Extra +¤­¤­¤­ char(1) YES NULL +DESC `¤¦¤¦¤¦`; +Field Type Null Key Default Extra +¤¯¤¯¤¯ char(1) YES NULL +DESC `¤¨¤¨¤¨`; +Field Type Null Key Default Extra +¤±¤±¤± char(1) YES NULL +DESC `¤ª¤ª¤ª`; +Field Type Null Key Default Extra +¤³¤³¤³ char(1) YES NULL +DESC `íÝíÝíÝ`; +Field Type Null Key Default Extra +°¡°¡°¡ char(1) YES NULL +DESC `íÞíÞíÞ`; +Field Type Null Key Default Extra +°¢°¢°¢ char(1) YES NULL +DESC `íßíßíß`; +Field Type Null Key Default Extra +°£°£°£ char(1) YES NULL +DESC `íàíàíà`; +Field Type Null Key Default Extra +°¤°¤°¤ char(1) YES NULL +DESC `íáíáíá`; +Field Type Null Key Default Extra +°¥°¥°¥ char(1) YES NULL +SHOW CREATE TABLE `ޱޱޱ`; +Table Create Table +ޱޱޱ CREATE TABLE `ޱޱޱ` ( + `޶޶޶` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `޲޲޲`; +Table Create Table +޲޲޲ CREATE TABLE `޲޲޲` ( + `Ž·Ž·Ž·` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `޳޳޳`; +Table Create Table +޳޳޳ CREATE TABLE `޳޳޳` ( + `ޏޏޏ` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `Ž´Ž´Ž´`; +Table Create Table +Ž´Ž´Ž´ CREATE TEMPORARY TABLE `Ž´Ž´Ž´` ( + `޹޹޹` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `޵޵޵`; +Table Create Table +޵޵޵ CREATE TEMPORARY TABLE `޵޵޵` ( + `ŽºŽºŽº` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `¤¢¤¢¤¢`; +Table Create Table +¤¢¤¢¤¢ CREATE TABLE `¤¢¤¢¤¢` ( + `¤«¤«¤«` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `¤¤¤¤¤¤`; +Table Create Table +¤¤¤¤¤¤ CREATE TABLE `¤¤¤¤¤¤` ( + `¤­¤­¤­` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `¤¦¤¦¤¦`; +Table Create Table +¤¦¤¦¤¦ CREATE TABLE `¤¦¤¦¤¦` ( + `¤¯¤¯¤¯` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `¤¨¤¨¤¨`; +Table Create Table +¤¨¤¨¤¨ CREATE TEMPORARY TABLE `¤¨¤¨¤¨` ( + `¤±¤±¤±` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `¤ª¤ª¤ª`; +Table Create Table +¤ª¤ª¤ª CREATE TEMPORARY TABLE `¤ª¤ª¤ª` ( + `¤³¤³¤³` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `íÝíÝíÝ`; +Table Create Table +íÝíÝíÝ CREATE TABLE `íÝíÝíÝ` ( + `°¡°¡°¡` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `íÞíÞíÞ`; +Table Create Table +íÞíÞíÞ CREATE TABLE `íÞíÞíÞ` ( + `°¢°¢°¢` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `íßíßíß`; +Table Create Table +íßíßíß CREATE TABLE `íßíßíß` ( + `°£°£°£` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `íàíàíà`; +Table Create Table +íàíàíà CREATE TEMPORARY TABLE `íàíàíà` ( + `°¤°¤°¤` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `íáíáíá`; +Table Create Table +íáíáíá CREATE TEMPORARY TABLE `íáíáíá` ( + `°¥°¥°¥` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=ucs2 +DROP TABLE `ޱޱޱ`; +DROP TABLE `޲޲޲`; +DROP TABLE `޳޳޳`; +DROP TABLE `Ž´Ž´Ž´`; +DROP TABLE `޵޵޵`; +DROP TABLE `¤¢¤¢¤¢`; +DROP TABLE `¤¤¤¤¤¤`; +DROP TABLE `¤¦¤¦¤¦`; +DROP TABLE `¤¨¤¨¤¨`; +DROP TABLE `¤ª¤ª¤ª`; +DROP TABLE `íÝíÝíÝ`; +DROP TABLE `íÞíÞíÞ`; +DROP TABLE `íßíßíß`; +DROP TABLE `íàíàíà`; +DROP TABLE `íáíáíá`; diff --git a/mysql-test/suite/jp/r/jp_create_tbl_ujis.result b/mysql-test/suite/jp/r/jp_create_tbl_ujis.result new file mode 100755 index 00000000000..ae555e5af15 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_create_tbl_ujis.result @@ -0,0 +1,641 @@ +DROP TABLE IF EXISTS `ޱޱޱ`; +DROP TABLE IF EXISTS `޲޲޲`; +DROP TABLE IF EXISTS `޳޳޳`; +DROP TABLE IF EXISTS `Ž´Ž´Ž´`; +DROP TABLE IF EXISTS `޵޵޵`; +DROP TABLE IF EXISTS `¤¢¤¢¤¢`; +DROP TABLE IF EXISTS `¤¤¤¤¤¤`; +DROP TABLE IF EXISTS `¤¦¤¦¤¦`; +DROP TABLE IF EXISTS `¤¨¤¨¤¨`; +DROP TABLE IF EXISTS `¤ª¤ª¤ª`; +DROP TABLE IF EXISTS `íÝíÝíÝ`; +DROP TABLE IF EXISTS `íÞíÞíÞ`; +DROP TABLE IF EXISTS `íßíßíß`; +DROP TABLE IF EXISTS `íàíàíà`; +DROP TABLE IF EXISTS `íáíáíá`; +SET NAMES ujis; +SET character_set_database = ujis; +CREATE TABLE `ޱޱޱ`(`޶޶޶` char(1)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TABLE `޲޲޲`(`Ž·Ž·Ž·` char(1)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TABLE `¤¢¤¢¤¢`(`¤«¤«¤«` char(1)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TABLE `¤¤¤¤¤¤`(`¤­¤­¤­` char(1)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TABLE `íÝíÝíÝ`(`°¡°¡°¡` char(1)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TABLE `íÞíÞíÞ`(`°¢°¢°¢` char(1)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TABLE IF NOT EXISTS `ޱޱޱ`(`޶޶޶` char(1)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TABLE IF NOT EXISTS `޲޲޲`(`Ž·Ž·Ž·` char(1)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TABLE IF NOT EXISTS `¤¢¤¢¤¢`(`¤«¤«¤«` char(1)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TABLE IF NOT EXISTS `¤¤¤¤¤¤`(`¤­¤­¤­` char(1)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TABLE IF NOT EXISTS `íÝíÝíÝ`(`°¡°¡°¡` char(1)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TABLE IF NOT EXISTS `íÞíÞíÞ`(`°¢°¢°¢` char(1)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TABLE IF NOT EXISTS `޳޳޳`(`ޏޏޏ` char(1)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TABLE IF NOT EXISTS `¤¦¤¦¤¦`(`¤¯¤¯¤¯` char(1)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TABLE IF NOT EXISTS `íßíßíß`(`°£°£°£`char(1)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TEMPORARY TABLE `Ž´Ž´Ž´`(`޹޹޹` char(1)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TEMPORARY TABLE `޵޵޵`(`ŽºŽºŽº` char(1)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TEMPORARY TABLE `¤¨¤¨¤¨`(`¤±¤±¤±` char(1)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TEMPORARY TABLE `¤ª¤ª¤ª`(`¤³¤³¤³` char(1)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TEMPORARY TABLE `íàíàíà`(`°¤°¤°¤` char(1)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TEMPORARY TABLE `íáíáíá`(`°¥°¥°¥` char(1)) DEFAULT CHARSET = ujis engine=INNODB; +DESC `ޱޱޱ`; +Field Type Null Key Default Extra +޶޶޶ char(1) YES NULL +DESC `޲޲޲`; +Field Type Null Key Default Extra +Ž·Ž·Ž· char(1) YES NULL +DESC `޳޳޳`; +Field Type Null Key Default Extra +ޏޏޏ char(1) YES NULL +DESC `Ž´Ž´Ž´`; +Field Type Null Key Default Extra +޹޹޹ char(1) YES NULL +DESC `޵޵޵`; +Field Type Null Key Default Extra +ŽºŽºŽº char(1) YES NULL +DESC `¤¢¤¢¤¢`; +Field Type Null Key Default Extra +¤«¤«¤« char(1) YES NULL +DESC `¤¤¤¤¤¤`; +Field Type Null Key Default Extra +¤­¤­¤­ char(1) YES NULL +DESC `¤¦¤¦¤¦`; +Field Type Null Key Default Extra +¤¯¤¯¤¯ char(1) YES NULL +DESC `¤¨¤¨¤¨`; +Field Type Null Key Default Extra +¤±¤±¤± char(1) YES NULL +DESC `¤ª¤ª¤ª`; +Field Type Null Key Default Extra +¤³¤³¤³ char(1) YES NULL +DESC `íÝíÝíÝ`; +Field Type Null Key Default Extra +°¡°¡°¡ char(1) YES NULL +DESC `íÞíÞíÞ`; +Field Type Null Key Default Extra +°¢°¢°¢ char(1) YES NULL +DESC `íßíßíß`; +Field Type Null Key Default Extra +°£°£°£ char(1) YES NULL +DESC `íàíàíà`; +Field Type Null Key Default Extra +°¤°¤°¤ char(1) YES NULL +DESC `íáíáíá`; +Field Type Null Key Default Extra +°¥°¥°¥ char(1) YES NULL +SHOW CREATE TABLE `ޱޱޱ`; +Table Create Table +ޱޱޱ CREATE TABLE `ޱޱޱ` ( + `޶޶޶` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=ujis +SHOW CREATE TABLE `޲޲޲`; +Table Create Table +޲޲޲ CREATE TABLE `޲޲޲` ( + `Ž·Ž·Ž·` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=ujis +SHOW CREATE TABLE `޳޳޳`; +Table Create Table +޳޳޳ CREATE TABLE `޳޳޳` ( + `ޏޏޏ` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=ujis +SHOW CREATE TABLE `Ž´Ž´Ž´`; +Table Create Table +Ž´Ž´Ž´ CREATE TEMPORARY TABLE `Ž´Ž´Ž´` ( + `޹޹޹` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=ujis +SHOW CREATE TABLE `޵޵޵`; +Table Create Table +޵޵޵ CREATE TEMPORARY TABLE `޵޵޵` ( + `ŽºŽºŽº` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=ujis +SHOW CREATE TABLE `¤¢¤¢¤¢`; +Table Create Table +¤¢¤¢¤¢ CREATE TABLE `¤¢¤¢¤¢` ( + `¤«¤«¤«` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=ujis +SHOW CREATE TABLE `¤¤¤¤¤¤`; +Table Create Table +¤¤¤¤¤¤ CREATE TABLE `¤¤¤¤¤¤` ( + `¤­¤­¤­` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=ujis +SHOW CREATE TABLE `¤¦¤¦¤¦`; +Table Create Table +¤¦¤¦¤¦ CREATE TABLE `¤¦¤¦¤¦` ( + `¤¯¤¯¤¯` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=ujis +SHOW CREATE TABLE `¤¨¤¨¤¨`; +Table Create Table +¤¨¤¨¤¨ CREATE TEMPORARY TABLE `¤¨¤¨¤¨` ( + `¤±¤±¤±` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=ujis +SHOW CREATE TABLE `¤ª¤ª¤ª`; +Table Create Table +¤ª¤ª¤ª CREATE TEMPORARY TABLE `¤ª¤ª¤ª` ( + `¤³¤³¤³` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=ujis +SHOW CREATE TABLE `íÝíÝíÝ`; +Table Create Table +íÝíÝíÝ CREATE TABLE `íÝíÝíÝ` ( + `°¡°¡°¡` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=ujis +SHOW CREATE TABLE `íÞíÞíÞ`; +Table Create Table +íÞíÞíÞ CREATE TABLE `íÞíÞíÞ` ( + `°¢°¢°¢` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=ujis +SHOW CREATE TABLE `íßíßíß`; +Table Create Table +íßíßíß CREATE TABLE `íßíßíß` ( + `°£°£°£` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=ujis +SHOW CREATE TABLE `íàíàíà`; +Table Create Table +íàíàíà CREATE TEMPORARY TABLE `íàíàíà` ( + `°¤°¤°¤` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=ujis +SHOW CREATE TABLE `íáíáíá`; +Table Create Table +íáíáíá CREATE TEMPORARY TABLE `íáíáíá` ( + `°¥°¥°¥` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=ujis +DROP TABLE `ޱޱޱ`; +DROP TABLE `޲޲޲`; +DROP TABLE `޳޳޳`; +DROP TABLE `Ž´Ž´Ž´`; +DROP TABLE `޵޵޵`; +DROP TABLE `¤¢¤¢¤¢`; +DROP TABLE `¤¤¤¤¤¤`; +DROP TABLE `¤¦¤¦¤¦`; +DROP TABLE `¤¨¤¨¤¨`; +DROP TABLE `¤ª¤ª¤ª`; +DROP TABLE `íÝíÝíÝ`; +DROP TABLE `íÞíÞíÞ`; +DROP TABLE `íßíßíß`; +DROP TABLE `íàíàíà`; +DROP TABLE `íáíáíá`; +CREATE TABLE `ޱޱޱ`(`޶޶޶` char(1)) DEFAULT CHARSET = ujis engine=MyISAM; +CREATE TABLE `޲޲޲`(`Ž·Ž·Ž·` char(1)) DEFAULT CHARSET = ujis engine=MyISAM; +CREATE TABLE `¤¢¤¢¤¢`(`¤«¤«¤«` char(1)) DEFAULT CHARSET = ujis engine=MyISAM; +CREATE TABLE `¤¤¤¤¤¤`(`¤­¤­¤­` char(1)) DEFAULT CHARSET = ujis engine=MyISAM; +CREATE TABLE `íÝíÝíÝ`(`°¡°¡°¡` char(1)) DEFAULT CHARSET = ujis engine=MyISAM; +CREATE TABLE `íÞíÞíÞ`(`°¢°¢°¢` char(1)) DEFAULT CHARSET = ujis engine=MyISAM; +CREATE TABLE IF NOT EXISTS `ޱޱޱ`(`޶޶޶` char(1)) DEFAULT CHARSET = ujis engine=MyISAM; +CREATE TABLE IF NOT EXISTS `޲޲޲`(`Ž·Ž·Ž·` char(1)) DEFAULT CHARSET = ujis engine=MyISAM; +CREATE TABLE IF NOT EXISTS `¤¢¤¢¤¢`(`¤«¤«¤«` char(1)) DEFAULT CHARSET = ujis engine=MyISAM; +CREATE TABLE IF NOT EXISTS `¤¤¤¤¤¤`(`¤­¤­¤­` char(1)) DEFAULT CHARSET = ujis engine=MyISAM; +CREATE TABLE IF NOT EXISTS `íÝíÝíÝ`(`°¡°¡°¡` char(1)) DEFAULT CHARSET = ujis engine=MyISAM; +CREATE TABLE IF NOT EXISTS `íÞíÞíÞ`(`°¢°¢°¢` char(1)) DEFAULT CHARSET = ujis engine=MyISAM; +CREATE TABLE IF NOT EXISTS `޳޳޳`(`ޏޏޏ` char(1)) DEFAULT CHARSET = ujis engine=MyISAM; +CREATE TABLE IF NOT EXISTS `¤¦¤¦¤¦`(`¤¯¤¯¤¯` char(1)) DEFAULT CHARSET = ujis engine=MyISAM; +CREATE TABLE IF NOT EXISTS `íßíßíß`(`°£°£°£`char(1)) DEFAULT CHARSET = ujis engine=MyISAM; +CREATE TEMPORARY TABLE `Ž´Ž´Ž´`(`޹޹޹` char(1)) DEFAULT CHARSET = ujis engine=MyISAM; +CREATE TEMPORARY TABLE `޵޵޵`(`ŽºŽºŽº` char(1)) DEFAULT CHARSET = ujis engine=MyISAM; +CREATE TEMPORARY TABLE `¤¨¤¨¤¨`(`¤±¤±¤±` char(1)) DEFAULT CHARSET = ujis engine=MyISAM; +CREATE TEMPORARY TABLE `¤ª¤ª¤ª`(`¤³¤³¤³` char(1)) DEFAULT CHARSET = ujis engine=MyISAM; +CREATE TEMPORARY TABLE `íàíàíà`(`°¤°¤°¤` char(1)) DEFAULT CHARSET = ujis engine=MyISAM; +CREATE TEMPORARY TABLE `íáíáíá`(`°¥°¥°¥` char(1)) DEFAULT CHARSET = ujis engine=MyISAM; +DESC `ޱޱޱ`; +Field Type Null Key Default Extra +޶޶޶ char(1) YES NULL +DESC `޲޲޲`; +Field Type Null Key Default Extra +Ž·Ž·Ž· char(1) YES NULL +DESC `޳޳޳`; +Field Type Null Key Default Extra +ޏޏޏ char(1) YES NULL +DESC `Ž´Ž´Ž´`; +Field Type Null Key Default Extra +޹޹޹ char(1) YES NULL +DESC `޵޵޵`; +Field Type Null Key Default Extra +ŽºŽºŽº char(1) YES NULL +DESC `¤¢¤¢¤¢`; +Field Type Null Key Default Extra +¤«¤«¤« char(1) YES NULL +DESC `¤¤¤¤¤¤`; +Field Type Null Key Default Extra +¤­¤­¤­ char(1) YES NULL +DESC `¤¦¤¦¤¦`; +Field Type Null Key Default Extra +¤¯¤¯¤¯ char(1) YES NULL +DESC `¤¨¤¨¤¨`; +Field Type Null Key Default Extra +¤±¤±¤± char(1) YES NULL +DESC `¤ª¤ª¤ª`; +Field Type Null Key Default Extra +¤³¤³¤³ char(1) YES NULL +DESC `íÝíÝíÝ`; +Field Type Null Key Default Extra +°¡°¡°¡ char(1) YES NULL +DESC `íÞíÞíÞ`; +Field Type Null Key Default Extra +°¢°¢°¢ char(1) YES NULL +DESC `íßíßíß`; +Field Type Null Key Default Extra +°£°£°£ char(1) YES NULL +DESC `íàíàíà`; +Field Type Null Key Default Extra +°¤°¤°¤ char(1) YES NULL +DESC `íáíáíá`; +Field Type Null Key Default Extra +°¥°¥°¥ char(1) YES NULL +SHOW CREATE TABLE `ޱޱޱ`; +Table Create Table +ޱޱޱ CREATE TABLE `ޱޱޱ` ( + `޶޶޶` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=ujis +SHOW CREATE TABLE `޲޲޲`; +Table Create Table +޲޲޲ CREATE TABLE `޲޲޲` ( + `Ž·Ž·Ž·` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=ujis +SHOW CREATE TABLE `޳޳޳`; +Table Create Table +޳޳޳ CREATE TABLE `޳޳޳` ( + `ޏޏޏ` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=ujis +SHOW CREATE TABLE `Ž´Ž´Ž´`; +Table Create Table +Ž´Ž´Ž´ CREATE TEMPORARY TABLE `Ž´Ž´Ž´` ( + `޹޹޹` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=ujis +SHOW CREATE TABLE `޵޵޵`; +Table Create Table +޵޵޵ CREATE TEMPORARY TABLE `޵޵޵` ( + `ŽºŽºŽº` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=ujis +SHOW CREATE TABLE `¤¢¤¢¤¢`; +Table Create Table +¤¢¤¢¤¢ CREATE TABLE `¤¢¤¢¤¢` ( + `¤«¤«¤«` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=ujis +SHOW CREATE TABLE `¤¤¤¤¤¤`; +Table Create Table +¤¤¤¤¤¤ CREATE TABLE `¤¤¤¤¤¤` ( + `¤­¤­¤­` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=ujis +SHOW CREATE TABLE `¤¦¤¦¤¦`; +Table Create Table +¤¦¤¦¤¦ CREATE TABLE `¤¦¤¦¤¦` ( + `¤¯¤¯¤¯` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=ujis +SHOW CREATE TABLE `¤¨¤¨¤¨`; +Table Create Table +¤¨¤¨¤¨ CREATE TEMPORARY TABLE `¤¨¤¨¤¨` ( + `¤±¤±¤±` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=ujis +SHOW CREATE TABLE `¤ª¤ª¤ª`; +Table Create Table +¤ª¤ª¤ª CREATE TEMPORARY TABLE `¤ª¤ª¤ª` ( + `¤³¤³¤³` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=ujis +SHOW CREATE TABLE `íÝíÝíÝ`; +Table Create Table +íÝíÝíÝ CREATE TABLE `íÝíÝíÝ` ( + `°¡°¡°¡` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=ujis +SHOW CREATE TABLE `íÞíÞíÞ`; +Table Create Table +íÞíÞíÞ CREATE TABLE `íÞíÞíÞ` ( + `°¢°¢°¢` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=ujis +SHOW CREATE TABLE `íßíßíß`; +Table Create Table +íßíßíß CREATE TABLE `íßíßíß` ( + `°£°£°£` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=ujis +SHOW CREATE TABLE `íàíàíà`; +Table Create Table +íàíàíà CREATE TEMPORARY TABLE `íàíàíà` ( + `°¤°¤°¤` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=ujis +SHOW CREATE TABLE `íáíáíá`; +Table Create Table +íáíáíá CREATE TEMPORARY TABLE `íáíáíá` ( + `°¥°¥°¥` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=ujis +DROP TABLE `ޱޱޱ`; +DROP TABLE `޲޲޲`; +DROP TABLE `޳޳޳`; +DROP TABLE `Ž´Ž´Ž´`; +DROP TABLE `޵޵޵`; +DROP TABLE `¤¢¤¢¤¢`; +DROP TABLE `¤¤¤¤¤¤`; +DROP TABLE `¤¦¤¦¤¦`; +DROP TABLE `¤¨¤¨¤¨`; +DROP TABLE `¤ª¤ª¤ª`; +DROP TABLE `íÝíÝíÝ`; +DROP TABLE `íÞíÞíÞ`; +DROP TABLE `íßíßíß`; +DROP TABLE `íàíàíà`; +DROP TABLE `íáíáíá`; +CREATE TABLE `ޱޱޱ`(`޶޶޶` char(1)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TABLE `޲޲޲`(`Ž·Ž·Ž·` char(1)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TABLE `¤¢¤¢¤¢`(`¤«¤«¤«` char(1)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TABLE `¤¤¤¤¤¤`(`¤­¤­¤­` char(1)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TABLE `íÝíÝíÝ`(`°¡°¡°¡` char(1)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TABLE `íÞíÞíÞ`(`°¢°¢°¢` char(1)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TABLE IF NOT EXISTS `ޱޱޱ`(`޶޶޶` char(1)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TABLE IF NOT EXISTS `޲޲޲`(`Ž·Ž·Ž·` char(1)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TABLE IF NOT EXISTS `¤¢¤¢¤¢`(`¤«¤«¤«` char(1)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TABLE IF NOT EXISTS `¤¤¤¤¤¤`(`¤­¤­¤­` char(1)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TABLE IF NOT EXISTS `íÝíÝíÝ`(`°¡°¡°¡` char(1)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TABLE IF NOT EXISTS `íÞíÞíÞ`(`°¢°¢°¢` char(1)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TABLE IF NOT EXISTS `޳޳޳`(`ޏޏޏ` char(1)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TABLE IF NOT EXISTS `¤¦¤¦¤¦`(`¤¯¤¯¤¯` char(1)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TABLE IF NOT EXISTS `íßíßíß`(`°£°£°£`char(1)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TEMPORARY TABLE `Ž´Ž´Ž´`(`޹޹޹` char(1)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TEMPORARY TABLE `޵޵޵`(`ŽºŽºŽº` char(1)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TEMPORARY TABLE `¤¨¤¨¤¨`(`¤±¤±¤±` char(1)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TEMPORARY TABLE `¤ª¤ª¤ª`(`¤³¤³¤³` char(1)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TEMPORARY TABLE `íàíàíà`(`°¤°¤°¤` char(1)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TEMPORARY TABLE `íáíáíá`(`°¥°¥°¥` char(1)) DEFAULT CHARSET = ujis engine=HEAP; +DESC `ޱޱޱ`; +Field Type Null Key Default Extra +޶޶޶ char(1) YES NULL +DESC `޲޲޲`; +Field Type Null Key Default Extra +Ž·Ž·Ž· char(1) YES NULL +DESC `޳޳޳`; +Field Type Null Key Default Extra +ޏޏޏ char(1) YES NULL +DESC `Ž´Ž´Ž´`; +Field Type Null Key Default Extra +޹޹޹ char(1) YES NULL +DESC `޵޵޵`; +Field Type Null Key Default Extra +ŽºŽºŽº char(1) YES NULL +DESC `¤¢¤¢¤¢`; +Field Type Null Key Default Extra +¤«¤«¤« char(1) YES NULL +DESC `¤¤¤¤¤¤`; +Field Type Null Key Default Extra +¤­¤­¤­ char(1) YES NULL +DESC `¤¦¤¦¤¦`; +Field Type Null Key Default Extra +¤¯¤¯¤¯ char(1) YES NULL +DESC `¤¨¤¨¤¨`; +Field Type Null Key Default Extra +¤±¤±¤± char(1) YES NULL +DESC `¤ª¤ª¤ª`; +Field Type Null Key Default Extra +¤³¤³¤³ char(1) YES NULL +DESC `íÝíÝíÝ`; +Field Type Null Key Default Extra +°¡°¡°¡ char(1) YES NULL +DESC `íÞíÞíÞ`; +Field Type Null Key Default Extra +°¢°¢°¢ char(1) YES NULL +DESC `íßíßíß`; +Field Type Null Key Default Extra +°£°£°£ char(1) YES NULL +DESC `íàíàíà`; +Field Type Null Key Default Extra +°¤°¤°¤ char(1) YES NULL +DESC `íáíáíá`; +Field Type Null Key Default Extra +°¥°¥°¥ char(1) YES NULL +SHOW CREATE TABLE `ޱޱޱ`; +Table Create Table +ޱޱޱ CREATE TABLE `ޱޱޱ` ( + `޶޶޶` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=ujis +SHOW CREATE TABLE `޲޲޲`; +Table Create Table +޲޲޲ CREATE TABLE `޲޲޲` ( + `Ž·Ž·Ž·` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=ujis +SHOW CREATE TABLE `޳޳޳`; +Table Create Table +޳޳޳ CREATE TABLE `޳޳޳` ( + `ޏޏޏ` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=ujis +SHOW CREATE TABLE `Ž´Ž´Ž´`; +Table Create Table +Ž´Ž´Ž´ CREATE TEMPORARY TABLE `Ž´Ž´Ž´` ( + `޹޹޹` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=ujis +SHOW CREATE TABLE `޵޵޵`; +Table Create Table +޵޵޵ CREATE TEMPORARY TABLE `޵޵޵` ( + `ŽºŽºŽº` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=ujis +SHOW CREATE TABLE `¤¢¤¢¤¢`; +Table Create Table +¤¢¤¢¤¢ CREATE TABLE `¤¢¤¢¤¢` ( + `¤«¤«¤«` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=ujis +SHOW CREATE TABLE `¤¤¤¤¤¤`; +Table Create Table +¤¤¤¤¤¤ CREATE TABLE `¤¤¤¤¤¤` ( + `¤­¤­¤­` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=ujis +SHOW CREATE TABLE `¤¦¤¦¤¦`; +Table Create Table +¤¦¤¦¤¦ CREATE TABLE `¤¦¤¦¤¦` ( + `¤¯¤¯¤¯` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=ujis +SHOW CREATE TABLE `¤¨¤¨¤¨`; +Table Create Table +¤¨¤¨¤¨ CREATE TEMPORARY TABLE `¤¨¤¨¤¨` ( + `¤±¤±¤±` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=ujis +SHOW CREATE TABLE `¤ª¤ª¤ª`; +Table Create Table +¤ª¤ª¤ª CREATE TEMPORARY TABLE `¤ª¤ª¤ª` ( + `¤³¤³¤³` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=ujis +SHOW CREATE TABLE `íÝíÝíÝ`; +Table Create Table +íÝíÝíÝ CREATE TABLE `íÝíÝíÝ` ( + `°¡°¡°¡` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=ujis +SHOW CREATE TABLE `íÞíÞíÞ`; +Table Create Table +íÞíÞíÞ CREATE TABLE `íÞíÞíÞ` ( + `°¢°¢°¢` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=ujis +SHOW CREATE TABLE `íßíßíß`; +Table Create Table +íßíßíß CREATE TABLE `íßíßíß` ( + `°£°£°£` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=ujis +SHOW CREATE TABLE `íàíàíà`; +Table Create Table +íàíàíà CREATE TEMPORARY TABLE `íàíàíà` ( + `°¤°¤°¤` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=ujis +SHOW CREATE TABLE `íáíáíá`; +Table Create Table +íáíáíá CREATE TEMPORARY TABLE `íáíáíá` ( + `°¥°¥°¥` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=ujis +DROP TABLE `ޱޱޱ`; +DROP TABLE `޲޲޲`; +DROP TABLE `޳޳޳`; +DROP TABLE `Ž´Ž´Ž´`; +DROP TABLE `޵޵޵`; +DROP TABLE `¤¢¤¢¤¢`; +DROP TABLE `¤¤¤¤¤¤`; +DROP TABLE `¤¦¤¦¤¦`; +DROP TABLE `¤¨¤¨¤¨`; +DROP TABLE `¤ª¤ª¤ª`; +DROP TABLE `íÝíÝíÝ`; +DROP TABLE `íÞíÞíÞ`; +DROP TABLE `íßíßíß`; +DROP TABLE `íàíàíà`; +DROP TABLE `íáíáíá`; +CREATE TABLE `ޱޱޱ`(`޶޶޶` char(1)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TABLE `޲޲޲`(`Ž·Ž·Ž·` char(1)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TABLE `¤¢¤¢¤¢`(`¤«¤«¤«` char(1)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TABLE `¤¤¤¤¤¤`(`¤­¤­¤­` char(1)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TABLE `íÝíÝíÝ`(`°¡°¡°¡` char(1)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TABLE `íÞíÞíÞ`(`°¢°¢°¢` char(1)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TABLE IF NOT EXISTS `ޱޱޱ`(`޶޶޶` char(1)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TABLE IF NOT EXISTS `޲޲޲`(`Ž·Ž·Ž·` char(1)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TABLE IF NOT EXISTS `¤¢¤¢¤¢`(`¤«¤«¤«` char(1)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TABLE IF NOT EXISTS `¤¤¤¤¤¤`(`¤­¤­¤­` char(1)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TABLE IF NOT EXISTS `íÝíÝíÝ`(`°¡°¡°¡` char(1)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TABLE IF NOT EXISTS `íÞíÞíÞ`(`°¢°¢°¢` char(1)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TABLE IF NOT EXISTS `޳޳޳`(`ޏޏޏ` char(1)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TABLE IF NOT EXISTS `¤¦¤¦¤¦`(`¤¯¤¯¤¯` char(1)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TABLE IF NOT EXISTS `íßíßíß`(`°£°£°£`char(1)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TEMPORARY TABLE `Ž´Ž´Ž´`(`޹޹޹` char(1)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TEMPORARY TABLE `޵޵޵`(`ŽºŽºŽº` char(1)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TEMPORARY TABLE `¤¨¤¨¤¨`(`¤±¤±¤±` char(1)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TEMPORARY TABLE `¤ª¤ª¤ª`(`¤³¤³¤³` char(1)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TEMPORARY TABLE `íàíàíà`(`°¤°¤°¤` char(1)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TEMPORARY TABLE `íáíáíá`(`°¥°¥°¥` char(1)) DEFAULT CHARSET = ujis engine=BDB; +DESC `ޱޱޱ`; +Field Type Null Key Default Extra +޶޶޶ char(1) YES NULL +DESC `޲޲޲`; +Field Type Null Key Default Extra +Ž·Ž·Ž· char(1) YES NULL +DESC `޳޳޳`; +Field Type Null Key Default Extra +ޏޏޏ char(1) YES NULL +DESC `Ž´Ž´Ž´`; +Field Type Null Key Default Extra +޹޹޹ char(1) YES NULL +DESC `޵޵޵`; +Field Type Null Key Default Extra +ŽºŽºŽº char(1) YES NULL +DESC `¤¢¤¢¤¢`; +Field Type Null Key Default Extra +¤«¤«¤« char(1) YES NULL +DESC `¤¤¤¤¤¤`; +Field Type Null Key Default Extra +¤­¤­¤­ char(1) YES NULL +DESC `¤¦¤¦¤¦`; +Field Type Null Key Default Extra +¤¯¤¯¤¯ char(1) YES NULL +DESC `¤¨¤¨¤¨`; +Field Type Null Key Default Extra +¤±¤±¤± char(1) YES NULL +DESC `¤ª¤ª¤ª`; +Field Type Null Key Default Extra +¤³¤³¤³ char(1) YES NULL +DESC `íÝíÝíÝ`; +Field Type Null Key Default Extra +°¡°¡°¡ char(1) YES NULL +DESC `íÞíÞíÞ`; +Field Type Null Key Default Extra +°¢°¢°¢ char(1) YES NULL +DESC `íßíßíß`; +Field Type Null Key Default Extra +°£°£°£ char(1) YES NULL +DESC `íàíàíà`; +Field Type Null Key Default Extra +°¤°¤°¤ char(1) YES NULL +DESC `íáíáíá`; +Field Type Null Key Default Extra +°¥°¥°¥ char(1) YES NULL +SHOW CREATE TABLE `ޱޱޱ`; +Table Create Table +ޱޱޱ CREATE TABLE `ޱޱޱ` ( + `޶޶޶` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=ujis +SHOW CREATE TABLE `޲޲޲`; +Table Create Table +޲޲޲ CREATE TABLE `޲޲޲` ( + `Ž·Ž·Ž·` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=ujis +SHOW CREATE TABLE `޳޳޳`; +Table Create Table +޳޳޳ CREATE TABLE `޳޳޳` ( + `ޏޏޏ` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=ujis +SHOW CREATE TABLE `Ž´Ž´Ž´`; +Table Create Table +Ž´Ž´Ž´ CREATE TEMPORARY TABLE `Ž´Ž´Ž´` ( + `޹޹޹` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=ujis +SHOW CREATE TABLE `޵޵޵`; +Table Create Table +޵޵޵ CREATE TEMPORARY TABLE `޵޵޵` ( + `ŽºŽºŽº` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=ujis +SHOW CREATE TABLE `¤¢¤¢¤¢`; +Table Create Table +¤¢¤¢¤¢ CREATE TABLE `¤¢¤¢¤¢` ( + `¤«¤«¤«` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=ujis +SHOW CREATE TABLE `¤¤¤¤¤¤`; +Table Create Table +¤¤¤¤¤¤ CREATE TABLE `¤¤¤¤¤¤` ( + `¤­¤­¤­` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=ujis +SHOW CREATE TABLE `¤¦¤¦¤¦`; +Table Create Table +¤¦¤¦¤¦ CREATE TABLE `¤¦¤¦¤¦` ( + `¤¯¤¯¤¯` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=ujis +SHOW CREATE TABLE `¤¨¤¨¤¨`; +Table Create Table +¤¨¤¨¤¨ CREATE TEMPORARY TABLE `¤¨¤¨¤¨` ( + `¤±¤±¤±` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=ujis +SHOW CREATE TABLE `¤ª¤ª¤ª`; +Table Create Table +¤ª¤ª¤ª CREATE TEMPORARY TABLE `¤ª¤ª¤ª` ( + `¤³¤³¤³` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=ujis +SHOW CREATE TABLE `íÝíÝíÝ`; +Table Create Table +íÝíÝíÝ CREATE TABLE `íÝíÝíÝ` ( + `°¡°¡°¡` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=ujis +SHOW CREATE TABLE `íÞíÞíÞ`; +Table Create Table +íÞíÞíÞ CREATE TABLE `íÞíÞíÞ` ( + `°¢°¢°¢` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=ujis +SHOW CREATE TABLE `íßíßíß`; +Table Create Table +íßíßíß CREATE TABLE `íßíßíß` ( + `°£°£°£` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=ujis +SHOW CREATE TABLE `íàíàíà`; +Table Create Table +íàíàíà CREATE TEMPORARY TABLE `íàíàíà` ( + `°¤°¤°¤` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=ujis +SHOW CREATE TABLE `íáíáíá`; +Table Create Table +íáíáíá CREATE TEMPORARY TABLE `íáíáíá` ( + `°¥°¥°¥` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=ujis +DROP TABLE `ޱޱޱ`; +DROP TABLE `޲޲޲`; +DROP TABLE `޳޳޳`; +DROP TABLE `Ž´Ž´Ž´`; +DROP TABLE `޵޵޵`; +DROP TABLE `¤¢¤¢¤¢`; +DROP TABLE `¤¤¤¤¤¤`; +DROP TABLE `¤¦¤¦¤¦`; +DROP TABLE `¤¨¤¨¤¨`; +DROP TABLE `¤ª¤ª¤ª`; +DROP TABLE `íÝíÝíÝ`; +DROP TABLE `íÞíÞíÞ`; +DROP TABLE `íßíßíß`; +DROP TABLE `íàíàíà`; +DROP TABLE `íáíáíá`; diff --git a/mysql-test/suite/jp/r/jp_create_tbl_utf8.result b/mysql-test/suite/jp/r/jp_create_tbl_utf8.result new file mode 100755 index 00000000000..d4873406c46 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_create_tbl_utf8.result @@ -0,0 +1,641 @@ +DROP TABLE IF EXISTS `アアア`; +DROP TABLE IF EXISTS `イイイ`; +DROP TABLE IF EXISTS `ウウウ`; +DROP TABLE IF EXISTS `ï½´ï½´ï½´`; +DROP TABLE IF EXISTS `オオオ`; +DROP TABLE IF EXISTS `ã‚ã‚ã‚`; +DROP TABLE IF EXISTS `ã„ã„ã„`; +DROP TABLE IF EXISTS `ã†ã†ã†`; +DROP TABLE IF EXISTS `ãˆãˆãˆ`; +DROP TABLE IF EXISTS `ãŠãŠãŠ`; +DROP TABLE IF EXISTS `é¾–é¾–é¾–`; +DROP TABLE IF EXISTS `é¾—é¾—é¾—`; +DROP TABLE IF EXISTS `龞龞龞`; +DROP TABLE IF EXISTS `龡龡龡`; +DROP TABLE IF EXISTS `龢龢龢`; +SET NAMES utf8; +SET character_set_database = utf8; +CREATE TABLE `アアア`(`ï½¶ï½¶ï½¶` char(1)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TABLE `イイイ`(`ï½·ï½·ï½·` char(1)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TABLE `ã‚ã‚ã‚`(`ã‹ã‹ã‹` char(1)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TABLE `ã„ã„ã„`(`ããã` char(1)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TABLE `é¾–é¾–é¾–`(`丂丂丂` char(1)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TABLE `é¾—é¾—é¾—`(`丄丄丄` char(1)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TABLE IF NOT EXISTS `アアア`(`ï½¶ï½¶ï½¶` char(1)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TABLE IF NOT EXISTS `イイイ`(`ï½·ï½·ï½·` char(1)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TABLE IF NOT EXISTS `ã‚ã‚ã‚`(`ã‹ã‹ã‹` char(1)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TABLE IF NOT EXISTS `ã„ã„ã„`(`ããã` char(1)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TABLE IF NOT EXISTS `é¾–é¾–é¾–`(`丂丂丂` char(1)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TABLE IF NOT EXISTS `é¾—é¾—é¾—`(`丄丄丄` char(1)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TABLE IF NOT EXISTS `ウウウ`(`ククク` char(1)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TABLE IF NOT EXISTS `ã†ã†ã†`(`ããã` char(1)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TABLE IF NOT EXISTS `龞龞龞`(`丅丅丅`char(1)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TEMPORARY TABLE `ï½´ï½´ï½´`(`ケケケ` char(1)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TEMPORARY TABLE `オオオ`(`コココ` char(1)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TEMPORARY TABLE `ãˆãˆãˆ`(`ã‘ã‘ã‘` char(1)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TEMPORARY TABLE `ãŠãŠãŠ`(`ã“ã“ã“` char(1)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TEMPORARY TABLE `龡龡龡`(`丌丌丌` char(1)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TEMPORARY TABLE `龢龢龢`(`丒丒丒` char(1)) DEFAULT CHARSET = utf8 engine=INNODB; +DESC `アアア`; +Field Type Null Key Default Extra +ï½¶ï½¶ï½¶ char(1) YES NULL +DESC `イイイ`; +Field Type Null Key Default Extra +ï½·ï½·ï½· char(1) YES NULL +DESC `ウウウ`; +Field Type Null Key Default Extra +ククク char(1) YES NULL +DESC `ï½´ï½´ï½´`; +Field Type Null Key Default Extra +ケケケ char(1) YES NULL +DESC `オオオ`; +Field Type Null Key Default Extra +コココ char(1) YES NULL +DESC `ã‚ã‚ã‚`; +Field Type Null Key Default Extra +ã‹ã‹ã‹ char(1) YES NULL +DESC `ã„ã„ã„`; +Field Type Null Key Default Extra +ããã char(1) YES NULL +DESC `ã†ã†ã†`; +Field Type Null Key Default Extra +ããã char(1) YES NULL +DESC `ãˆãˆãˆ`; +Field Type Null Key Default Extra +ã‘ã‘ã‘ char(1) YES NULL +DESC `ãŠãŠãŠ`; +Field Type Null Key Default Extra +ã“ã“ã“ char(1) YES NULL +DESC `é¾–é¾–é¾–`; +Field Type Null Key Default Extra +丂丂丂 char(1) YES NULL +DESC `é¾—é¾—é¾—`; +Field Type Null Key Default Extra +丄丄丄 char(1) YES NULL +DESC `龞龞龞`; +Field Type Null Key Default Extra +丅丅丅 char(1) YES NULL +DESC `龡龡龡`; +Field Type Null Key Default Extra +丌丌丌 char(1) YES NULL +DESC `龢龢龢`; +Field Type Null Key Default Extra +丒丒丒 char(1) YES NULL +SHOW CREATE TABLE `アアア`; +Table Create Table +アアア CREATE TABLE `アアア` ( + `ï½¶ï½¶ï½¶` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `イイイ`; +Table Create Table +イイイ CREATE TABLE `イイイ` ( + `ï½·ï½·ï½·` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `ウウウ`; +Table Create Table +ウウウ CREATE TABLE `ウウウ` ( + `ククク` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `ï½´ï½´ï½´`; +Table Create Table +ï½´ï½´ï½´ CREATE TEMPORARY TABLE `ï½´ï½´ï½´` ( + `ケケケ` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `オオオ`; +Table Create Table +オオオ CREATE TEMPORARY TABLE `オオオ` ( + `コココ` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `ã‚ã‚ã‚`; +Table Create Table +ã‚ã‚ã‚ CREATE TABLE `ã‚ã‚ã‚` ( + `ã‹ã‹ã‹` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `ã„ã„ã„`; +Table Create Table +ã„ã„ã„ CREATE TABLE `ã„ã„ã„` ( + `ããã` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `ã†ã†ã†`; +Table Create Table +ã†ã†ã† CREATE TABLE `ã†ã†ã†` ( + `ããã` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `ãˆãˆãˆ`; +Table Create Table +ãˆãˆãˆ CREATE TEMPORARY TABLE `ãˆãˆãˆ` ( + `ã‘ã‘ã‘` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `ãŠãŠãŠ`; +Table Create Table +ãŠãŠãŠ CREATE TEMPORARY TABLE `ãŠãŠãŠ` ( + `ã“ã“ã“` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `é¾–é¾–é¾–`; +Table Create Table +é¾–é¾–é¾– CREATE TABLE `é¾–é¾–é¾–` ( + `丂丂丂` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `é¾—é¾—é¾—`; +Table Create Table +é¾—é¾—é¾— CREATE TABLE `é¾—é¾—é¾—` ( + `丄丄丄` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `龞龞龞`; +Table Create Table +龞龞龞 CREATE TABLE `龞龞龞` ( + `丅丅丅` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `龡龡龡`; +Table Create Table +龡龡龡 CREATE TEMPORARY TABLE `龡龡龡` ( + `丌丌丌` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `龢龢龢`; +Table Create Table +龢龢龢 CREATE TEMPORARY TABLE `龢龢龢` ( + `丒丒丒` char(1) default NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8 +DROP TABLE `アアア`; +DROP TABLE `イイイ`; +DROP TABLE `ウウウ`; +DROP TABLE `ï½´ï½´ï½´`; +DROP TABLE `オオオ`; +DROP TABLE `ã‚ã‚ã‚`; +DROP TABLE `ã„ã„ã„`; +DROP TABLE `ã†ã†ã†`; +DROP TABLE `ãˆãˆãˆ`; +DROP TABLE `ãŠãŠãŠ`; +DROP TABLE `é¾–é¾–é¾–`; +DROP TABLE `é¾—é¾—é¾—`; +DROP TABLE `龞龞龞`; +DROP TABLE `龡龡龡`; +DROP TABLE `龢龢龢`; +CREATE TABLE `アアア`(`ï½¶ï½¶ï½¶` char(1)) DEFAULT CHARSET = utf8 engine=MyISAM; +CREATE TABLE `イイイ`(`ï½·ï½·ï½·` char(1)) DEFAULT CHARSET = utf8 engine=MyISAM; +CREATE TABLE `ã‚ã‚ã‚`(`ã‹ã‹ã‹` char(1)) DEFAULT CHARSET = utf8 engine=MyISAM; +CREATE TABLE `ã„ã„ã„`(`ããã` char(1)) DEFAULT CHARSET = utf8 engine=MyISAM; +CREATE TABLE `é¾–é¾–é¾–`(`丂丂丂` char(1)) DEFAULT CHARSET = utf8 engine=MyISAM; +CREATE TABLE `é¾—é¾—é¾—`(`丄丄丄` char(1)) DEFAULT CHARSET = utf8 engine=MyISAM; +CREATE TABLE IF NOT EXISTS `アアア`(`ï½¶ï½¶ï½¶` char(1)) DEFAULT CHARSET = utf8 engine=MyISAM; +CREATE TABLE IF NOT EXISTS `イイイ`(`ï½·ï½·ï½·` char(1)) DEFAULT CHARSET = utf8 engine=MyISAM; +CREATE TABLE IF NOT EXISTS `ã‚ã‚ã‚`(`ã‹ã‹ã‹` char(1)) DEFAULT CHARSET = utf8 engine=MyISAM; +CREATE TABLE IF NOT EXISTS `ã„ã„ã„`(`ããã` char(1)) DEFAULT CHARSET = utf8 engine=MyISAM; +CREATE TABLE IF NOT EXISTS `é¾–é¾–é¾–`(`丂丂丂` char(1)) DEFAULT CHARSET = utf8 engine=MyISAM; +CREATE TABLE IF NOT EXISTS `é¾—é¾—é¾—`(`丄丄丄` char(1)) DEFAULT CHARSET = utf8 engine=MyISAM; +CREATE TABLE IF NOT EXISTS `ウウウ`(`ククク` char(1)) DEFAULT CHARSET = utf8 engine=MyISAM; +CREATE TABLE IF NOT EXISTS `ã†ã†ã†`(`ããã` char(1)) DEFAULT CHARSET = utf8 engine=MyISAM; +CREATE TABLE IF NOT EXISTS `龞龞龞`(`丅丅丅`char(1)) DEFAULT CHARSET = utf8 engine=MyISAM; +CREATE TEMPORARY TABLE `ï½´ï½´ï½´`(`ケケケ` char(1)) DEFAULT CHARSET = utf8 engine=MyISAM; +CREATE TEMPORARY TABLE `オオオ`(`コココ` char(1)) DEFAULT CHARSET = utf8 engine=MyISAM; +CREATE TEMPORARY TABLE `ãˆãˆãˆ`(`ã‘ã‘ã‘` char(1)) DEFAULT CHARSET = utf8 engine=MyISAM; +CREATE TEMPORARY TABLE `ãŠãŠãŠ`(`ã“ã“ã“` char(1)) DEFAULT CHARSET = utf8 engine=MyISAM; +CREATE TEMPORARY TABLE `龡龡龡`(`丌丌丌` char(1)) DEFAULT CHARSET = utf8 engine=MyISAM; +CREATE TEMPORARY TABLE `龢龢龢`(`丒丒丒` char(1)) DEFAULT CHARSET = utf8 engine=MyISAM; +DESC `アアア`; +Field Type Null Key Default Extra +ï½¶ï½¶ï½¶ char(1) YES NULL +DESC `イイイ`; +Field Type Null Key Default Extra +ï½·ï½·ï½· char(1) YES NULL +DESC `ウウウ`; +Field Type Null Key Default Extra +ククク char(1) YES NULL +DESC `ï½´ï½´ï½´`; +Field Type Null Key Default Extra +ケケケ char(1) YES NULL +DESC `オオオ`; +Field Type Null Key Default Extra +コココ char(1) YES NULL +DESC `ã‚ã‚ã‚`; +Field Type Null Key Default Extra +ã‹ã‹ã‹ char(1) YES NULL +DESC `ã„ã„ã„`; +Field Type Null Key Default Extra +ããã char(1) YES NULL +DESC `ã†ã†ã†`; +Field Type Null Key Default Extra +ããã char(1) YES NULL +DESC `ãˆãˆãˆ`; +Field Type Null Key Default Extra +ã‘ã‘ã‘ char(1) YES NULL +DESC `ãŠãŠãŠ`; +Field Type Null Key Default Extra +ã“ã“ã“ char(1) YES NULL +DESC `é¾–é¾–é¾–`; +Field Type Null Key Default Extra +丂丂丂 char(1) YES NULL +DESC `é¾—é¾—é¾—`; +Field Type Null Key Default Extra +丄丄丄 char(1) YES NULL +DESC `龞龞龞`; +Field Type Null Key Default Extra +丅丅丅 char(1) YES NULL +DESC `龡龡龡`; +Field Type Null Key Default Extra +丌丌丌 char(1) YES NULL +DESC `龢龢龢`; +Field Type Null Key Default Extra +丒丒丒 char(1) YES NULL +SHOW CREATE TABLE `アアア`; +Table Create Table +アアア CREATE TABLE `アアア` ( + `ï½¶ï½¶ï½¶` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `イイイ`; +Table Create Table +イイイ CREATE TABLE `イイイ` ( + `ï½·ï½·ï½·` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `ウウウ`; +Table Create Table +ウウウ CREATE TABLE `ウウウ` ( + `ククク` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `ï½´ï½´ï½´`; +Table Create Table +ï½´ï½´ï½´ CREATE TEMPORARY TABLE `ï½´ï½´ï½´` ( + `ケケケ` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `オオオ`; +Table Create Table +オオオ CREATE TEMPORARY TABLE `オオオ` ( + `コココ` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `ã‚ã‚ã‚`; +Table Create Table +ã‚ã‚ã‚ CREATE TABLE `ã‚ã‚ã‚` ( + `ã‹ã‹ã‹` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `ã„ã„ã„`; +Table Create Table +ã„ã„ã„ CREATE TABLE `ã„ã„ã„` ( + `ããã` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `ã†ã†ã†`; +Table Create Table +ã†ã†ã† CREATE TABLE `ã†ã†ã†` ( + `ããã` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `ãˆãˆãˆ`; +Table Create Table +ãˆãˆãˆ CREATE TEMPORARY TABLE `ãˆãˆãˆ` ( + `ã‘ã‘ã‘` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `ãŠãŠãŠ`; +Table Create Table +ãŠãŠãŠ CREATE TEMPORARY TABLE `ãŠãŠãŠ` ( + `ã“ã“ã“` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `é¾–é¾–é¾–`; +Table Create Table +é¾–é¾–é¾– CREATE TABLE `é¾–é¾–é¾–` ( + `丂丂丂` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `é¾—é¾—é¾—`; +Table Create Table +é¾—é¾—é¾— CREATE TABLE `é¾—é¾—é¾—` ( + `丄丄丄` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `龞龞龞`; +Table Create Table +龞龞龞 CREATE TABLE `龞龞龞` ( + `丅丅丅` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `龡龡龡`; +Table Create Table +龡龡龡 CREATE TEMPORARY TABLE `龡龡龡` ( + `丌丌丌` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `龢龢龢`; +Table Create Table +龢龢龢 CREATE TEMPORARY TABLE `龢龢龢` ( + `丒丒丒` char(1) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=utf8 +DROP TABLE `アアア`; +DROP TABLE `イイイ`; +DROP TABLE `ウウウ`; +DROP TABLE `ï½´ï½´ï½´`; +DROP TABLE `オオオ`; +DROP TABLE `ã‚ã‚ã‚`; +DROP TABLE `ã„ã„ã„`; +DROP TABLE `ã†ã†ã†`; +DROP TABLE `ãˆãˆãˆ`; +DROP TABLE `ãŠãŠãŠ`; +DROP TABLE `é¾–é¾–é¾–`; +DROP TABLE `é¾—é¾—é¾—`; +DROP TABLE `龞龞龞`; +DROP TABLE `龡龡龡`; +DROP TABLE `龢龢龢`; +CREATE TABLE `アアア`(`ï½¶ï½¶ï½¶` char(1)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TABLE `イイイ`(`ï½·ï½·ï½·` char(1)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TABLE `ã‚ã‚ã‚`(`ã‹ã‹ã‹` char(1)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TABLE `ã„ã„ã„`(`ããã` char(1)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TABLE `é¾–é¾–é¾–`(`丂丂丂` char(1)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TABLE `é¾—é¾—é¾—`(`丄丄丄` char(1)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TABLE IF NOT EXISTS `アアア`(`ï½¶ï½¶ï½¶` char(1)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TABLE IF NOT EXISTS `イイイ`(`ï½·ï½·ï½·` char(1)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TABLE IF NOT EXISTS `ã‚ã‚ã‚`(`ã‹ã‹ã‹` char(1)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TABLE IF NOT EXISTS `ã„ã„ã„`(`ããã` char(1)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TABLE IF NOT EXISTS `é¾–é¾–é¾–`(`丂丂丂` char(1)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TABLE IF NOT EXISTS `é¾—é¾—é¾—`(`丄丄丄` char(1)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TABLE IF NOT EXISTS `ウウウ`(`ククク` char(1)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TABLE IF NOT EXISTS `ã†ã†ã†`(`ããã` char(1)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TABLE IF NOT EXISTS `龞龞龞`(`丅丅丅`char(1)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TEMPORARY TABLE `ï½´ï½´ï½´`(`ケケケ` char(1)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TEMPORARY TABLE `オオオ`(`コココ` char(1)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TEMPORARY TABLE `ãˆãˆãˆ`(`ã‘ã‘ã‘` char(1)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TEMPORARY TABLE `ãŠãŠãŠ`(`ã“ã“ã“` char(1)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TEMPORARY TABLE `龡龡龡`(`丌丌丌` char(1)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TEMPORARY TABLE `龢龢龢`(`丒丒丒` char(1)) DEFAULT CHARSET = utf8 engine=HEAP; +DESC `アアア`; +Field Type Null Key Default Extra +ï½¶ï½¶ï½¶ char(1) YES NULL +DESC `イイイ`; +Field Type Null Key Default Extra +ï½·ï½·ï½· char(1) YES NULL +DESC `ウウウ`; +Field Type Null Key Default Extra +ククク char(1) YES NULL +DESC `ï½´ï½´ï½´`; +Field Type Null Key Default Extra +ケケケ char(1) YES NULL +DESC `オオオ`; +Field Type Null Key Default Extra +コココ char(1) YES NULL +DESC `ã‚ã‚ã‚`; +Field Type Null Key Default Extra +ã‹ã‹ã‹ char(1) YES NULL +DESC `ã„ã„ã„`; +Field Type Null Key Default Extra +ããã char(1) YES NULL +DESC `ã†ã†ã†`; +Field Type Null Key Default Extra +ããã char(1) YES NULL +DESC `ãˆãˆãˆ`; +Field Type Null Key Default Extra +ã‘ã‘ã‘ char(1) YES NULL +DESC `ãŠãŠãŠ`; +Field Type Null Key Default Extra +ã“ã“ã“ char(1) YES NULL +DESC `é¾–é¾–é¾–`; +Field Type Null Key Default Extra +丂丂丂 char(1) YES NULL +DESC `é¾—é¾—é¾—`; +Field Type Null Key Default Extra +丄丄丄 char(1) YES NULL +DESC `龞龞龞`; +Field Type Null Key Default Extra +丅丅丅 char(1) YES NULL +DESC `龡龡龡`; +Field Type Null Key Default Extra +丌丌丌 char(1) YES NULL +DESC `龢龢龢`; +Field Type Null Key Default Extra +丒丒丒 char(1) YES NULL +SHOW CREATE TABLE `アアア`; +Table Create Table +アアア CREATE TABLE `アアア` ( + `ï½¶ï½¶ï½¶` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `イイイ`; +Table Create Table +イイイ CREATE TABLE `イイイ` ( + `ï½·ï½·ï½·` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `ウウウ`; +Table Create Table +ウウウ CREATE TABLE `ウウウ` ( + `ククク` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `ï½´ï½´ï½´`; +Table Create Table +ï½´ï½´ï½´ CREATE TEMPORARY TABLE `ï½´ï½´ï½´` ( + `ケケケ` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `オオオ`; +Table Create Table +オオオ CREATE TEMPORARY TABLE `オオオ` ( + `コココ` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `ã‚ã‚ã‚`; +Table Create Table +ã‚ã‚ã‚ CREATE TABLE `ã‚ã‚ã‚` ( + `ã‹ã‹ã‹` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `ã„ã„ã„`; +Table Create Table +ã„ã„ã„ CREATE TABLE `ã„ã„ã„` ( + `ããã` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `ã†ã†ã†`; +Table Create Table +ã†ã†ã† CREATE TABLE `ã†ã†ã†` ( + `ããã` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `ãˆãˆãˆ`; +Table Create Table +ãˆãˆãˆ CREATE TEMPORARY TABLE `ãˆãˆãˆ` ( + `ã‘ã‘ã‘` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `ãŠãŠãŠ`; +Table Create Table +ãŠãŠãŠ CREATE TEMPORARY TABLE `ãŠãŠãŠ` ( + `ã“ã“ã“` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `é¾–é¾–é¾–`; +Table Create Table +é¾–é¾–é¾– CREATE TABLE `é¾–é¾–é¾–` ( + `丂丂丂` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `é¾—é¾—é¾—`; +Table Create Table +é¾—é¾—é¾— CREATE TABLE `é¾—é¾—é¾—` ( + `丄丄丄` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `龞龞龞`; +Table Create Table +龞龞龞 CREATE TABLE `龞龞龞` ( + `丅丅丅` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `龡龡龡`; +Table Create Table +龡龡龡 CREATE TEMPORARY TABLE `龡龡龡` ( + `丌丌丌` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `龢龢龢`; +Table Create Table +龢龢龢 CREATE TEMPORARY TABLE `龢龢龢` ( + `丒丒丒` char(1) default NULL +) ENGINE=HEAP DEFAULT CHARSET=utf8 +DROP TABLE `アアア`; +DROP TABLE `イイイ`; +DROP TABLE `ウウウ`; +DROP TABLE `ï½´ï½´ï½´`; +DROP TABLE `オオオ`; +DROP TABLE `ã‚ã‚ã‚`; +DROP TABLE `ã„ã„ã„`; +DROP TABLE `ã†ã†ã†`; +DROP TABLE `ãˆãˆãˆ`; +DROP TABLE `ãŠãŠãŠ`; +DROP TABLE `é¾–é¾–é¾–`; +DROP TABLE `é¾—é¾—é¾—`; +DROP TABLE `龞龞龞`; +DROP TABLE `龡龡龡`; +DROP TABLE `龢龢龢`; +CREATE TABLE `アアア`(`ï½¶ï½¶ï½¶` char(1)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TABLE `イイイ`(`ï½·ï½·ï½·` char(1)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TABLE `ã‚ã‚ã‚`(`ã‹ã‹ã‹` char(1)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TABLE `ã„ã„ã„`(`ããã` char(1)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TABLE `é¾–é¾–é¾–`(`丂丂丂` char(1)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TABLE `é¾—é¾—é¾—`(`丄丄丄` char(1)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TABLE IF NOT EXISTS `アアア`(`ï½¶ï½¶ï½¶` char(1)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TABLE IF NOT EXISTS `イイイ`(`ï½·ï½·ï½·` char(1)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TABLE IF NOT EXISTS `ã‚ã‚ã‚`(`ã‹ã‹ã‹` char(1)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TABLE IF NOT EXISTS `ã„ã„ã„`(`ããã` char(1)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TABLE IF NOT EXISTS `é¾–é¾–é¾–`(`丂丂丂` char(1)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TABLE IF NOT EXISTS `é¾—é¾—é¾—`(`丄丄丄` char(1)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TABLE IF NOT EXISTS `ウウウ`(`ククク` char(1)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TABLE IF NOT EXISTS `ã†ã†ã†`(`ããã` char(1)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TABLE IF NOT EXISTS `龞龞龞`(`丅丅丅`char(1)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TEMPORARY TABLE `ï½´ï½´ï½´`(`ケケケ` char(1)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TEMPORARY TABLE `オオオ`(`コココ` char(1)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TEMPORARY TABLE `ãˆãˆãˆ`(`ã‘ã‘ã‘` char(1)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TEMPORARY TABLE `ãŠãŠãŠ`(`ã“ã“ã“` char(1)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TEMPORARY TABLE `龡龡龡`(`丌丌丌` char(1)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TEMPORARY TABLE `龢龢龢`(`丒丒丒` char(1)) DEFAULT CHARSET = utf8 engine=BDB; +DESC `アアア`; +Field Type Null Key Default Extra +ï½¶ï½¶ï½¶ char(1) YES NULL +DESC `イイイ`; +Field Type Null Key Default Extra +ï½·ï½·ï½· char(1) YES NULL +DESC `ウウウ`; +Field Type Null Key Default Extra +ククク char(1) YES NULL +DESC `ï½´ï½´ï½´`; +Field Type Null Key Default Extra +ケケケ char(1) YES NULL +DESC `オオオ`; +Field Type Null Key Default Extra +コココ char(1) YES NULL +DESC `ã‚ã‚ã‚`; +Field Type Null Key Default Extra +ã‹ã‹ã‹ char(1) YES NULL +DESC `ã„ã„ã„`; +Field Type Null Key Default Extra +ããã char(1) YES NULL +DESC `ã†ã†ã†`; +Field Type Null Key Default Extra +ããã char(1) YES NULL +DESC `ãˆãˆãˆ`; +Field Type Null Key Default Extra +ã‘ã‘ã‘ char(1) YES NULL +DESC `ãŠãŠãŠ`; +Field Type Null Key Default Extra +ã“ã“ã“ char(1) YES NULL +DESC `é¾–é¾–é¾–`; +Field Type Null Key Default Extra +丂丂丂 char(1) YES NULL +DESC `é¾—é¾—é¾—`; +Field Type Null Key Default Extra +丄丄丄 char(1) YES NULL +DESC `龞龞龞`; +Field Type Null Key Default Extra +丅丅丅 char(1) YES NULL +DESC `龡龡龡`; +Field Type Null Key Default Extra +丌丌丌 char(1) YES NULL +DESC `龢龢龢`; +Field Type Null Key Default Extra +丒丒丒 char(1) YES NULL +SHOW CREATE TABLE `アアア`; +Table Create Table +アアア CREATE TABLE `アアア` ( + `ï½¶ï½¶ï½¶` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `イイイ`; +Table Create Table +イイイ CREATE TABLE `イイイ` ( + `ï½·ï½·ï½·` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `ウウウ`; +Table Create Table +ウウウ CREATE TABLE `ウウウ` ( + `ククク` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `ï½´ï½´ï½´`; +Table Create Table +ï½´ï½´ï½´ CREATE TEMPORARY TABLE `ï½´ï½´ï½´` ( + `ケケケ` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `オオオ`; +Table Create Table +オオオ CREATE TEMPORARY TABLE `オオオ` ( + `コココ` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `ã‚ã‚ã‚`; +Table Create Table +ã‚ã‚ã‚ CREATE TABLE `ã‚ã‚ã‚` ( + `ã‹ã‹ã‹` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `ã„ã„ã„`; +Table Create Table +ã„ã„ã„ CREATE TABLE `ã„ã„ã„` ( + `ããã` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `ã†ã†ã†`; +Table Create Table +ã†ã†ã† CREATE TABLE `ã†ã†ã†` ( + `ããã` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `ãˆãˆãˆ`; +Table Create Table +ãˆãˆãˆ CREATE TEMPORARY TABLE `ãˆãˆãˆ` ( + `ã‘ã‘ã‘` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `ãŠãŠãŠ`; +Table Create Table +ãŠãŠãŠ CREATE TEMPORARY TABLE `ãŠãŠãŠ` ( + `ã“ã“ã“` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `é¾–é¾–é¾–`; +Table Create Table +é¾–é¾–é¾– CREATE TABLE `é¾–é¾–é¾–` ( + `丂丂丂` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `é¾—é¾—é¾—`; +Table Create Table +é¾—é¾—é¾— CREATE TABLE `é¾—é¾—é¾—` ( + `丄丄丄` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `龞龞龞`; +Table Create Table +龞龞龞 CREATE TABLE `龞龞龞` ( + `丅丅丅` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `龡龡龡`; +Table Create Table +龡龡龡 CREATE TEMPORARY TABLE `龡龡龡` ( + `丌丌丌` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `龢龢龢`; +Table Create Table +龢龢龢 CREATE TEMPORARY TABLE `龢龢龢` ( + `丒丒丒` char(1) default NULL +) ENGINE=BerkeleyDB DEFAULT CHARSET=utf8 +DROP TABLE `アアア`; +DROP TABLE `イイイ`; +DROP TABLE `ウウウ`; +DROP TABLE `ï½´ï½´ï½´`; +DROP TABLE `オオオ`; +DROP TABLE `ã‚ã‚ã‚`; +DROP TABLE `ã„ã„ã„`; +DROP TABLE `ã†ã†ã†`; +DROP TABLE `ãˆãˆãˆ`; +DROP TABLE `ãŠãŠãŠ`; +DROP TABLE `é¾–é¾–é¾–`; +DROP TABLE `é¾—é¾—é¾—`; +DROP TABLE `龞龞龞`; +DROP TABLE `龡龡龡`; +DROP TABLE `龢龢龢`; diff --git a/mysql-test/suite/jp/r/jp_enum_sjis.result b/mysql-test/suite/jp/r/jp_enum_sjis.result new file mode 100755 index 00000000000..1e46dbffbb1 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_enum_sjis.result @@ -0,0 +1,362 @@ +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +drop table if exists `‚s‚P‚P`; +drop table if exists `‚s‚P‚Q`; +SET NAMES sjis; +SET character_set_database = sjis; +CREATE TABLE `‚s‚P` (`‚b‚P` ENUM('±','²','³'), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Q` (`‚b‚P` ENUM('‚ ','‚¢','‚¤'), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚R` (`‚b‚P` ENUM('ƒ\','\','•\'), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚S` (`‚b‚P` ENUM('±','²','³'), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚T` (`‚b‚P` ENUM('‚ ','‚¢','‚¤'), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚U` (`‚b‚P` ENUM('ƒ\','\','•\'), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚V` (`‚b‚P` ENUM('±','²','³'), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚W` (`‚b‚P` ENUM('‚ ','‚¢','‚¤'), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚X` (`‚b‚P` ENUM('ƒ\','\','•\'), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚O` (`‚b‚P` ENUM('±','²','³'), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚P` (`‚b‚P` ENUM('‚ ','‚¢','‚¤'), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚Q` (`‚b‚P` ENUM('ƒ\','\','•\'), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +INSERT INTO `‚s‚P` VALUES ('±'),('²'),('³'); +INSERT INTO `‚s‚Q` VALUES ('‚ '),('‚¢'),('‚¤'); +INSERT INTO `‚s‚R` VALUES ('ƒ\'),('\'),('•\'); +INSERT INTO `‚s‚S` VALUES ('±'),('²'),('³'); +INSERT INTO `‚s‚T` VALUES ('‚ '),('‚¢'),('‚¤'); +INSERT INTO `‚s‚U` VALUES ('ƒ\'),('\'),('•\'); +INSERT INTO `‚s‚V` VALUES ('±'),('²'),('³'); +INSERT INTO `‚s‚W` VALUES ('‚ '),('‚¢'),('‚¤'); +INSERT INTO `‚s‚X` VALUES ('ƒ\'),('\'),('•\'); +INSERT INTO `‚s‚P‚O` VALUES ('±'),('²'),('³'); +INSERT INTO `‚s‚P‚P` VALUES ('‚ '),('‚¢'),('‚¤'); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\'),('\'),('•\'); +SELECT * FROM `‚s‚P`; +‚b‚P +± +² +³ +SELECT * FROM `‚s‚Q`; +‚b‚P +‚  +‚¢ +‚¤ +SELECT * FROM `‚s‚R`; +‚b‚P +ƒ\ +\ +•\ +SELECT * FROM `‚s‚S`; +‚b‚P +± +² +³ +SELECT * FROM `‚s‚T`; +‚b‚P +‚  +‚¢ +‚¤ +SELECT * FROM `‚s‚U`; +‚b‚P +ƒ\ +\ +•\ +SELECT * FROM `‚s‚V`; +‚b‚P +± +² +³ +SELECT * FROM `‚s‚W`; +‚b‚P +‚  +‚¢ +‚¤ +SELECT * FROM `‚s‚X`; +‚b‚P +ƒ\ +\ +•\ +SELECT * FROM `‚s‚P‚O`; +‚b‚P +± +² +³ +SELECT * FROM `‚s‚P‚P`; +‚b‚P +‚  +‚¢ +‚¤ +SELECT * FROM `‚s‚P‚Q`; +‚b‚P +ƒ\ +\ +•\ +SHOW CREATE TABLE `‚s‚P`; +Table Create Table +‚s‚P CREATE TABLE `‚s‚P` ( + `‚b‚P` enum('±','²','³') default NULL, + KEY `‚b‚P` (`‚b‚P`) +) ENGINE=InnoDB DEFAULT CHARSET=sjis +SHOW CREATE TABLE `‚s‚Q`; +Table Create Table +‚s‚Q CREATE TABLE `‚s‚Q` ( + `‚b‚P` enum('‚ ','‚¢','‚¤') default NULL, + KEY `‚b‚P` (`‚b‚P`) +) ENGINE=InnoDB DEFAULT CHARSET=sjis +SHOW CREATE TABLE `‚s‚R`; +Table Create Table +‚s‚R CREATE TABLE `‚s‚R` ( + `‚b‚P` enum('ƒ\','\','•\') default NULL, + KEY `‚b‚P` (`‚b‚P`) +) ENGINE=InnoDB DEFAULT CHARSET=sjis +SHOW CREATE TABLE `‚s‚S`; +Table Create Table +‚s‚S CREATE TABLE `‚s‚S` ( + `‚b‚P` enum('±','²','³') default NULL, + KEY `‚b‚P` (`‚b‚P`) +) ENGINE=MyISAM DEFAULT CHARSET=sjis +SHOW CREATE TABLE `‚s‚T`; +Table Create Table +‚s‚T CREATE TABLE `‚s‚T` ( + `‚b‚P` enum('‚ ','‚¢','‚¤') default NULL, + KEY `‚b‚P` (`‚b‚P`) +) ENGINE=MyISAM DEFAULT CHARSET=sjis +SHOW CREATE TABLE `‚s‚U`; +Table Create Table +‚s‚U CREATE TABLE `‚s‚U` ( + `‚b‚P` enum('ƒ\','\','•\') default NULL, + KEY `‚b‚P` (`‚b‚P`) +) ENGINE=MyISAM DEFAULT CHARSET=sjis +SHOW CREATE TABLE `‚s‚V`; +Table Create Table +‚s‚V CREATE TABLE `‚s‚V` ( + `‚b‚P` enum('±','²','³') default NULL, + KEY `‚b‚P` (`‚b‚P`) +) ENGINE=HEAP DEFAULT CHARSET=sjis +SHOW CREATE TABLE `‚s‚W`; +Table Create Table +‚s‚W CREATE TABLE `‚s‚W` ( + `‚b‚P` enum('‚ ','‚¢','‚¤') default NULL, + KEY `‚b‚P` (`‚b‚P`) +) ENGINE=HEAP DEFAULT CHARSET=sjis +SHOW CREATE TABLE `‚s‚X`; +Table Create Table +‚s‚X CREATE TABLE `‚s‚X` ( + `‚b‚P` enum('ƒ\','\','•\') default NULL, + KEY `‚b‚P` (`‚b‚P`) +) ENGINE=HEAP DEFAULT CHARSET=sjis +SHOW CREATE TABLE `‚s‚P‚O`; +Table Create Table +‚s‚P‚O CREATE TABLE `‚s‚P‚O` ( + `‚b‚P` enum('±','²','³') default NULL, + KEY `‚b‚P` (`‚b‚P`) +) ENGINE=BerkeleyDB DEFAULT CHARSET=sjis +SHOW CREATE TABLE `‚s‚P‚P`; +Table Create Table +‚s‚P‚P CREATE TABLE `‚s‚P‚P` ( + `‚b‚P` enum('‚ ','‚¢','‚¤') default NULL, + KEY `‚b‚P` (`‚b‚P`) +) ENGINE=BerkeleyDB DEFAULT CHARSET=sjis +SHOW CREATE TABLE `‚s‚P‚Q`; +Table Create Table +‚s‚P‚Q CREATE TABLE `‚s‚P‚Q` ( + `‚b‚P` enum('ƒ\','\','•\') default NULL, + KEY `‚b‚P` (`‚b‚P`) +) ENGINE=BerkeleyDB DEFAULT CHARSET=sjis +DESC `‚s‚P`; +Field Type Null Key Default Extra +‚b‚P enum('±','²','³') YES MUL NULL +DESC `‚s‚Q`; +Field Type Null Key Default Extra +‚b‚P enum('‚ ','‚¢','‚¤') YES MUL NULL +DESC `‚s‚R`; +Field Type Null Key Default Extra +‚b‚P enum('ƒ\','\','•\') YES MUL NULL +DESC `‚s‚S`; +Field Type Null Key Default Extra +‚b‚P enum('±','²','³') YES MUL NULL +DESC `‚s‚T`; +Field Type Null Key Default Extra +‚b‚P enum('‚ ','‚¢','‚¤') YES MUL NULL +DESC `‚s‚U`; +Field Type Null Key Default Extra +‚b‚P enum('ƒ\','\','•\') YES MUL NULL +DESC `‚s‚V`; +Field Type Null Key Default Extra +‚b‚P enum('±','²','³') YES MUL NULL +DESC `‚s‚W`; +Field Type Null Key Default Extra +‚b‚P enum('‚ ','‚¢','‚¤') YES MUL NULL +DESC `‚s‚X`; +Field Type Null Key Default Extra +‚b‚P enum('ƒ\','\','•\') YES MUL NULL +DESC `‚s‚P‚O`; +Field Type Null Key Default Extra +‚b‚P enum('±','²','³') YES MUL NULL +DESC `‚s‚P‚P`; +Field Type Null Key Default Extra +‚b‚P enum('‚ ','‚¢','‚¤') YES MUL NULL +DESC `‚s‚P‚Q`; +Field Type Null Key Default Extra +‚b‚P enum('ƒ\','\','•\') YES MUL NULL +ALTER TABLE `‚s‚P` ADD `‚b‚Q` CHAR(1) NOT NULL FIRST; +ALTER TABLE `‚s‚Q` ADD `‚b‚Q` CHAR(1) NOT NULL FIRST; +ALTER TABLE `‚s‚R` ADD `‚b‚Q` CHAR(1) NOT NULL FIRST; +ALTER TABLE `‚s‚S` ADD `‚b‚Q` CHAR(1) NOT NULL FIRST; +ALTER TABLE `‚s‚T` ADD `‚b‚Q` CHAR(1) NOT NULL FIRST; +ALTER TABLE `‚s‚U` ADD `‚b‚Q` CHAR(1) NOT NULL FIRST; +ALTER TABLE `‚s‚V` ADD `‚b‚Q` CHAR(1) NOT NULL FIRST; +ALTER TABLE `‚s‚W` ADD `‚b‚Q` CHAR(1) NOT NULL FIRST; +ALTER TABLE `‚s‚X` ADD `‚b‚Q` CHAR(1) NOT NULL FIRST; +ALTER TABLE `‚s‚P‚O` ADD `‚b‚Q` CHAR(1) NOT NULL FIRST; +ALTER TABLE `‚s‚P‚P` ADD `‚b‚Q` CHAR(1) NOT NULL FIRST; +ALTER TABLE `‚s‚P‚Q` ADD `‚b‚Q` CHAR(1) NOT NULL FIRST; +SHOW CREATE TABLE `‚s‚P`; +Table Create Table +‚s‚P CREATE TABLE `‚s‚P` ( + `‚b‚Q` char(1) NOT NULL default '', + `‚b‚P` enum('±','²','³') default NULL, + KEY `‚b‚P` (`‚b‚P`) +) ENGINE=InnoDB DEFAULT CHARSET=sjis +SHOW CREATE TABLE `‚s‚Q`; +Table Create Table +‚s‚Q CREATE TABLE `‚s‚Q` ( + `‚b‚Q` char(1) NOT NULL default '', + `‚b‚P` enum('‚ ','‚¢','‚¤') default NULL, + KEY `‚b‚P` (`‚b‚P`) +) ENGINE=InnoDB DEFAULT CHARSET=sjis +SHOW CREATE TABLE `‚s‚R`; +Table Create Table +‚s‚R CREATE TABLE `‚s‚R` ( + `‚b‚Q` char(1) NOT NULL default '', + `‚b‚P` enum('ƒ\','\','•\') default NULL, + KEY `‚b‚P` (`‚b‚P`) +) ENGINE=InnoDB DEFAULT CHARSET=sjis +SHOW CREATE TABLE `‚s‚S`; +Table Create Table +‚s‚S CREATE TABLE `‚s‚S` ( + `‚b‚Q` char(1) NOT NULL default '', + `‚b‚P` enum('±','²','³') default NULL, + KEY `‚b‚P` (`‚b‚P`) +) ENGINE=MyISAM DEFAULT CHARSET=sjis +SHOW CREATE TABLE `‚s‚T`; +Table Create Table +‚s‚T CREATE TABLE `‚s‚T` ( + `‚b‚Q` char(1) NOT NULL default '', + `‚b‚P` enum('‚ ','‚¢','‚¤') default NULL, + KEY `‚b‚P` (`‚b‚P`) +) ENGINE=MyISAM DEFAULT CHARSET=sjis +SHOW CREATE TABLE `‚s‚U`; +Table Create Table +‚s‚U CREATE TABLE `‚s‚U` ( + `‚b‚Q` char(1) NOT NULL default '', + `‚b‚P` enum('ƒ\','\','•\') default NULL, + KEY `‚b‚P` (`‚b‚P`) +) ENGINE=MyISAM DEFAULT CHARSET=sjis +SHOW CREATE TABLE `‚s‚V`; +Table Create Table +‚s‚V CREATE TABLE `‚s‚V` ( + `‚b‚Q` char(1) NOT NULL default '', + `‚b‚P` enum('±','²','³') default NULL, + KEY `‚b‚P` (`‚b‚P`) +) ENGINE=HEAP DEFAULT CHARSET=sjis +SHOW CREATE TABLE `‚s‚W`; +Table Create Table +‚s‚W CREATE TABLE `‚s‚W` ( + `‚b‚Q` char(1) NOT NULL default '', + `‚b‚P` enum('‚ ','‚¢','‚¤') default NULL, + KEY `‚b‚P` (`‚b‚P`) +) ENGINE=HEAP DEFAULT CHARSET=sjis +SHOW CREATE TABLE `‚s‚X`; +Table Create Table +‚s‚X CREATE TABLE `‚s‚X` ( + `‚b‚Q` char(1) NOT NULL default '', + `‚b‚P` enum('ƒ\','\','•\') default NULL, + KEY `‚b‚P` (`‚b‚P`) +) ENGINE=HEAP DEFAULT CHARSET=sjis +SHOW CREATE TABLE `‚s‚P‚O`; +Table Create Table +‚s‚P‚O CREATE TABLE `‚s‚P‚O` ( + `‚b‚Q` char(1) NOT NULL default '', + `‚b‚P` enum('±','²','³') default NULL, + KEY `‚b‚P` (`‚b‚P`) +) ENGINE=BerkeleyDB DEFAULT CHARSET=sjis +SHOW CREATE TABLE `‚s‚P‚P`; +Table Create Table +‚s‚P‚P CREATE TABLE `‚s‚P‚P` ( + `‚b‚Q` char(1) NOT NULL default '', + `‚b‚P` enum('‚ ','‚¢','‚¤') default NULL, + KEY `‚b‚P` (`‚b‚P`) +) ENGINE=BerkeleyDB DEFAULT CHARSET=sjis +SHOW CREATE TABLE `‚s‚P‚Q`; +Table Create Table +‚s‚P‚Q CREATE TABLE `‚s‚P‚Q` ( + `‚b‚Q` char(1) NOT NULL default '', + `‚b‚P` enum('ƒ\','\','•\') default NULL, + KEY `‚b‚P` (`‚b‚P`) +) ENGINE=BerkeleyDB DEFAULT CHARSET=sjis +DESC `‚s‚P`; +Field Type Null Key Default Extra +‚b‚Q char(1) +‚b‚P enum('±','²','³') YES MUL NULL +DESC `‚s‚Q`; +Field Type Null Key Default Extra +‚b‚Q char(1) +‚b‚P enum('‚ ','‚¢','‚¤') YES MUL NULL +DESC `‚s‚R`; +Field Type Null Key Default Extra +‚b‚Q char(1) +‚b‚P enum('ƒ\','\','•\') YES MUL NULL +DESC `‚s‚S`; +Field Type Null Key Default Extra +‚b‚Q char(1) +‚b‚P enum('±','²','³') YES MUL NULL +DESC `‚s‚T`; +Field Type Null Key Default Extra +‚b‚Q char(1) +‚b‚P enum('‚ ','‚¢','‚¤') YES MUL NULL +DESC `‚s‚U`; +Field Type Null Key Default Extra +‚b‚Q char(1) +‚b‚P enum('ƒ\','\','•\') YES MUL NULL +DESC `‚s‚V`; +Field Type Null Key Default Extra +‚b‚Q char(1) +‚b‚P enum('±','²','³') YES MUL NULL +DESC `‚s‚W`; +Field Type Null Key Default Extra +‚b‚Q char(1) +‚b‚P enum('‚ ','‚¢','‚¤') YES MUL NULL +DESC `‚s‚X`; +Field Type Null Key Default Extra +‚b‚Q char(1) +‚b‚P enum('ƒ\','\','•\') YES MUL NULL +DESC `‚s‚P‚O`; +Field Type Null Key Default Extra +‚b‚Q char(1) +‚b‚P enum('±','²','³') YES MUL NULL +DESC `‚s‚P‚P`; +Field Type Null Key Default Extra +‚b‚Q char(1) +‚b‚P enum('‚ ','‚¢','‚¤') YES MUL NULL +DESC `‚s‚P‚Q`; +Field Type Null Key Default Extra +‚b‚Q char(1) +‚b‚P enum('ƒ\','\','•\') YES MUL NULL +DROP TABLE `‚s‚P`; +DROP TABLE `‚s‚Q`; +DROP TABLE `‚s‚R`; +DROP TABLE `‚s‚S`; +DROP TABLE `‚s‚T`; +DROP TABLE `‚s‚U`; +DROP TABLE `‚s‚V`; +DROP TABLE `‚s‚W`; +DROP TABLE `‚s‚X`; +DROP TABLE `‚s‚P‚O`; +DROP TABLE `‚s‚P‚P`; +DROP TABLE `‚s‚P‚Q`; diff --git a/mysql-test/suite/jp/r/jp_enum_ucs2.result b/mysql-test/suite/jp/r/jp_enum_ucs2.result new file mode 100755 index 00000000000..a84cace35fe --- /dev/null +++ b/mysql-test/suite/jp/r/jp_enum_ucs2.result @@ -0,0 +1,219 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; +CREATE TABLE `£Ô£±` (`£Ã£±` ENUM('ޱ','޲','޳'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` ENUM('¤¢','¤¤','¤¦'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` ENUM('íÜ','íÝ','íÞ'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` ENUM('ޱ','޲','޳'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` ENUM('¤¢','¤¤','¤¦'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` ENUM('íÜ','íÝ','íÞ'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` ENUM('ޱ','޲','޳'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` ENUM('¤¢','¤¤','¤¦'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` ENUM('íÜ','íÝ','íÞ'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` ENUM('ޱ','޲','޳'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` ENUM('¤¢','¤¤','¤¦'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` ENUM('íÜ','íÝ','íÞ'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +INSERT INTO `£Ô£±` VALUES ('ޱ'),('޲'),('޳'); +INSERT INTO `£Ô£²` VALUES ('¤¢'),('¤¤'),('¤¦'); +INSERT INTO `£Ô£³` VALUES ('íÜ'),('íÝ'),('íÞ'); +INSERT INTO `£Ô£´` VALUES ('ޱ'),('޲'),('޳'); +INSERT INTO `£Ô£µ` VALUES ('¤¢'),('¤¤'),('¤¦'); +INSERT INTO `£Ô£¶` VALUES ('íÜ'),('íÝ'),('íÞ'); +INSERT INTO `£Ô£·` VALUES ('ޱ'),('޲'),('޳'); +INSERT INTO `£Ô£¸` VALUES ('¤¢'),('¤¤'),('¤¦'); +INSERT INTO `£Ô£¹` VALUES ('íÜ'),('íÝ'),('íÞ'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ'),('޲'),('޳'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢'),('¤¤'),('¤¦'); +INSERT INTO `£Ô£±£²` VALUES ('íÜ'),('íÝ'),('íÞ'); +SELECT * FROM `£Ô£±`; +£Ã£± +ޱ +޲ +޳ +SELECT * FROM `£Ô£²`; +£Ã£± +¤¢ +¤¤ +¤¦ +SELECT * FROM `£Ô£³`; +£Ã£± +íÜ +íÝ +íÞ +SELECT * FROM `£Ô£´`; +£Ã£± +ޱ +޲ +޳ +SELECT * FROM `£Ô£µ`; +£Ã£± +¤¢ +¤¤ +¤¦ +SELECT * FROM `£Ô£¶`; +£Ã£± +íÜ +íÝ +íÞ +SELECT * FROM `£Ô£·`; +£Ã£± +ޱ +޲ +޳ +SELECT * FROM `£Ô£¸`; +£Ã£± +¤¢ +¤¤ +¤¦ +SELECT * FROM `£Ô£¹`; +£Ã£± +íÜ +íÝ +íÞ +SELECT * FROM `£Ô£±£°`; +£Ã£± +ޱ +޲ +޳ +SELECT * FROM `£Ô£±£±`; +£Ã£± +¤¢ +¤¤ +¤¦ +SELECT * FROM `£Ô£±£²`; +£Ã£± +íÜ +íÝ +íÞ +SHOW CREATE TABLE `£Ô£±`; +Table Create Table +£Ô£± CREATE TABLE `£Ô£±` ( + `£Ã£±` enum('ޱ','޲','޳') default NULL, + KEY `£Ã£±` (`£Ã£±`) +) ENGINE=InnoDB DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `£Ô£²`; +Table Create Table +£Ô£² CREATE TABLE `£Ô£²` ( + `£Ã£±` enum('¤¢','¤¤','¤¦') default NULL, + KEY `£Ã£±` (`£Ã£±`) +) ENGINE=InnoDB DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `£Ô£³`; +Table Create Table +£Ô£³ CREATE TABLE `£Ô£³` ( + `£Ã£±` enum('íÜ','íÝ','íÞ') default NULL, + KEY `£Ã£±` (`£Ã£±`) +) ENGINE=InnoDB DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `£Ô£´`; +Table Create Table +£Ô£´ CREATE TABLE `£Ô£´` ( + `£Ã£±` enum('ޱ','޲','޳') default NULL, + KEY `£Ã£±` (`£Ã£±`) +) ENGINE=MyISAM DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `£Ô£µ`; +Table Create Table +£Ô£µ CREATE TABLE `£Ô£µ` ( + `£Ã£±` enum('¤¢','¤¤','¤¦') default NULL, + KEY `£Ã£±` (`£Ã£±`) +) ENGINE=MyISAM DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `£Ô£¶`; +Table Create Table +£Ô£¶ CREATE TABLE `£Ô£¶` ( + `£Ã£±` enum('íÜ','íÝ','íÞ') default NULL, + KEY `£Ã£±` (`£Ã£±`) +) ENGINE=MyISAM DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `£Ô£·`; +Table Create Table +£Ô£· CREATE TABLE `£Ô£·` ( + `£Ã£±` enum('ޱ','޲','޳') default NULL, + KEY `£Ã£±` (`£Ã£±`) +) ENGINE=HEAP DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `£Ô£¸`; +Table Create Table +£Ô£¸ CREATE TABLE `£Ô£¸` ( + `£Ã£±` enum('¤¢','¤¤','¤¦') default NULL, + KEY `£Ã£±` (`£Ã£±`) +) ENGINE=HEAP DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `£Ô£¹`; +Table Create Table +£Ô£¹ CREATE TABLE `£Ô£¹` ( + `£Ã£±` enum('íÜ','íÝ','íÞ') default NULL, + KEY `£Ã£±` (`£Ã£±`) +) ENGINE=HEAP DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `£Ô£±£°`; +Table Create Table +£Ô£±£° CREATE TABLE `£Ô£±£°` ( + `£Ã£±` enum('ޱ','޲','޳') default NULL, + KEY `£Ã£±` (`£Ã£±`) +) ENGINE=BerkeleyDB DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `£Ô£±£±`; +Table Create Table +£Ô£±£± CREATE TABLE `£Ô£±£±` ( + `£Ã£±` enum('¤¢','¤¤','¤¦') default NULL, + KEY `£Ã£±` (`£Ã£±`) +) ENGINE=BerkeleyDB DEFAULT CHARSET=ucs2 +SHOW CREATE TABLE `£Ô£±£²`; +Table Create Table +£Ô£±£² CREATE TABLE `£Ô£±£²` ( + `£Ã£±` enum('íÜ','íÝ','íÞ') default NULL, + KEY `£Ã£±` (`£Ã£±`) +) ENGINE=BerkeleyDB DEFAULT CHARSET=ucs2 +DESC `£Ô£±`; +Field Type Null Key Default Extra +£Ã£± enum('ޱ','޲','޳') YES MUL NULL +DESC `£Ô£²`; +Field Type Null Key Default Extra +£Ã£± enum('¤¢','¤¤','¤¦') YES MUL NULL +DESC `£Ô£³`; +Field Type Null Key Default Extra +£Ã£± enum('íÜ','íÝ','íÞ') YES MUL NULL +DESC `£Ô£´`; +Field Type Null Key Default Extra +£Ã£± enum('ޱ','޲','޳') YES MUL NULL +DESC `£Ô£µ`; +Field Type Null Key Default Extra +£Ã£± enum('¤¢','¤¤','¤¦') YES MUL NULL +DESC `£Ô£¶`; +Field Type Null Key Default Extra +£Ã£± enum('íÜ','íÝ','íÞ') YES MUL NULL +DESC `£Ô£·`; +Field Type Null Key Default Extra +£Ã£± enum('ޱ','޲','޳') YES MUL NULL +DESC `£Ô£¸`; +Field Type Null Key Default Extra +£Ã£± enum('¤¢','¤¤','¤¦') YES MUL NULL +DESC `£Ô£¹`; +Field Type Null Key Default Extra +£Ã£± enum('íÜ','íÝ','íÞ') YES MUL NULL +DESC `£Ô£±£°`; +Field Type Null Key Default Extra +£Ã£± enum('ޱ','޲','޳') YES MUL NULL +DESC `£Ô£±£±`; +Field Type Null Key Default Extra +£Ã£± enum('¤¢','¤¤','¤¦') YES MUL NULL +DESC `£Ô£±£²`; +Field Type Null Key Default Extra +£Ã£± enum('íÜ','íÝ','íÞ') YES MUL NULL +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/r/jp_enum_ujis.result b/mysql-test/suite/jp/r/jp_enum_ujis.result new file mode 100755 index 00000000000..dbc850b1368 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_enum_ujis.result @@ -0,0 +1,362 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +SET NAMES ujis; +SET character_set_database = ujis; +CREATE TABLE `£Ô£±` (`£Ã£±` ENUM('ޱ','޲','޳'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` ENUM('¤¢','¤¤','¤¦'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` ENUM('íÜ','íÝ','íÞ'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` ENUM('ޱ','޲','޳'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` ENUM('¤¢','¤¤','¤¦'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` ENUM('íÜ','íÝ','íÞ'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` ENUM('ޱ','޲','޳'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` ENUM('¤¢','¤¤','¤¦'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` ENUM('íÜ','íÝ','íÞ'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` ENUM('ޱ','޲','޳'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` ENUM('¤¢','¤¤','¤¦'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` ENUM('íÜ','íÝ','íÞ'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +INSERT INTO `£Ô£±` VALUES ('ޱ'),('޲'),('޳'); +INSERT INTO `£Ô£²` VALUES ('¤¢'),('¤¤'),('¤¦'); +INSERT INTO `£Ô£³` VALUES ('íÜ'),('íÝ'),('íÞ'); +INSERT INTO `£Ô£´` VALUES ('ޱ'),('޲'),('޳'); +INSERT INTO `£Ô£µ` VALUES ('¤¢'),('¤¤'),('¤¦'); +INSERT INTO `£Ô£¶` VALUES ('íÜ'),('íÝ'),('íÞ'); +INSERT INTO `£Ô£·` VALUES ('ޱ'),('޲'),('޳'); +INSERT INTO `£Ô£¸` VALUES ('¤¢'),('¤¤'),('¤¦'); +INSERT INTO `£Ô£¹` VALUES ('íÜ'),('íÝ'),('íÞ'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ'),('޲'),('޳'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢'),('¤¤'),('¤¦'); +INSERT INTO `£Ô£±£²` VALUES ('íÜ'),('íÝ'),('íÞ'); +SELECT * FROM `£Ô£±`; +£Ã£± +ޱ +޲ +޳ +SELECT * FROM `£Ô£²`; +£Ã£± +¤¢ +¤¤ +¤¦ +SELECT * FROM `£Ô£³`; +£Ã£± +íÜ +íÝ +íÞ +SELECT * FROM `£Ô£´`; +£Ã£± +ޱ +޲ +޳ +SELECT * FROM `£Ô£µ`; +£Ã£± +¤¢ +¤¤ +¤¦ +SELECT * FROM `£Ô£¶`; +£Ã£± +íÜ +íÝ +íÞ +SELECT * FROM `£Ô£·`; +£Ã£± +ޱ +޲ +޳ +SELECT * FROM `£Ô£¸`; +£Ã£± +¤¢ +¤¤ +¤¦ +SELECT * FROM `£Ô£¹`; +£Ã£± +íÜ +íÝ +íÞ +SELECT * FROM `£Ô£±£°`; +£Ã£± +ޱ +޲ +޳ +SELECT * FROM `£Ô£±£±`; +£Ã£± +¤¢ +¤¤ +¤¦ +SELECT * FROM `£Ô£±£²`; +£Ã£± +íÜ +íÝ +íÞ +SHOW CREATE TABLE `£Ô£±`; +Table Create Table +£Ô£± CREATE TABLE `£Ô£±` ( + `£Ã£±` enum('ޱ','޲','޳') default NULL, + KEY `£Ã£±` (`£Ã£±`) +) ENGINE=InnoDB DEFAULT CHARSET=ujis +SHOW CREATE TABLE `£Ô£²`; +Table Create Table +£Ô£² CREATE TABLE `£Ô£²` ( + `£Ã£±` enum('¤¢','¤¤','¤¦') default NULL, + KEY `£Ã£±` (`£Ã£±`) +) ENGINE=InnoDB DEFAULT CHARSET=ujis +SHOW CREATE TABLE `£Ô£³`; +Table Create Table +£Ô£³ CREATE TABLE `£Ô£³` ( + `£Ã£±` enum('íÜ','íÝ','íÞ') default NULL, + KEY `£Ã£±` (`£Ã£±`) +) ENGINE=InnoDB DEFAULT CHARSET=ujis +SHOW CREATE TABLE `£Ô£´`; +Table Create Table +£Ô£´ CREATE TABLE `£Ô£´` ( + `£Ã£±` enum('ޱ','޲','޳') default NULL, + KEY `£Ã£±` (`£Ã£±`) +) ENGINE=MyISAM DEFAULT CHARSET=ujis +SHOW CREATE TABLE `£Ô£µ`; +Table Create Table +£Ô£µ CREATE TABLE `£Ô£µ` ( + `£Ã£±` enum('¤¢','¤¤','¤¦') default NULL, + KEY `£Ã£±` (`£Ã£±`) +) ENGINE=MyISAM DEFAULT CHARSET=ujis +SHOW CREATE TABLE `£Ô£¶`; +Table Create Table +£Ô£¶ CREATE TABLE `£Ô£¶` ( + `£Ã£±` enum('íÜ','íÝ','íÞ') default NULL, + KEY `£Ã£±` (`£Ã£±`) +) ENGINE=MyISAM DEFAULT CHARSET=ujis +SHOW CREATE TABLE `£Ô£·`; +Table Create Table +£Ô£· CREATE TABLE `£Ô£·` ( + `£Ã£±` enum('ޱ','޲','޳') default NULL, + KEY `£Ã£±` (`£Ã£±`) +) ENGINE=HEAP DEFAULT CHARSET=ujis +SHOW CREATE TABLE `£Ô£¸`; +Table Create Table +£Ô£¸ CREATE TABLE `£Ô£¸` ( + `£Ã£±` enum('¤¢','¤¤','¤¦') default NULL, + KEY `£Ã£±` (`£Ã£±`) +) ENGINE=HEAP DEFAULT CHARSET=ujis +SHOW CREATE TABLE `£Ô£¹`; +Table Create Table +£Ô£¹ CREATE TABLE `£Ô£¹` ( + `£Ã£±` enum('íÜ','íÝ','íÞ') default NULL, + KEY `£Ã£±` (`£Ã£±`) +) ENGINE=HEAP DEFAULT CHARSET=ujis +SHOW CREATE TABLE `£Ô£±£°`; +Table Create Table +£Ô£±£° CREATE TABLE `£Ô£±£°` ( + `£Ã£±` enum('ޱ','޲','޳') default NULL, + KEY `£Ã£±` (`£Ã£±`) +) ENGINE=BerkeleyDB DEFAULT CHARSET=ujis +SHOW CREATE TABLE `£Ô£±£±`; +Table Create Table +£Ô£±£± CREATE TABLE `£Ô£±£±` ( + `£Ã£±` enum('¤¢','¤¤','¤¦') default NULL, + KEY `£Ã£±` (`£Ã£±`) +) ENGINE=BerkeleyDB DEFAULT CHARSET=ujis +SHOW CREATE TABLE `£Ô£±£²`; +Table Create Table +£Ô£±£² CREATE TABLE `£Ô£±£²` ( + `£Ã£±` enum('íÜ','íÝ','íÞ') default NULL, + KEY `£Ã£±` (`£Ã£±`) +) ENGINE=BerkeleyDB DEFAULT CHARSET=ujis +DESC `£Ô£±`; +Field Type Null Key Default Extra +£Ã£± enum('ޱ','޲','޳') YES MUL NULL +DESC `£Ô£²`; +Field Type Null Key Default Extra +£Ã£± enum('¤¢','¤¤','¤¦') YES MUL NULL +DESC `£Ô£³`; +Field Type Null Key Default Extra +£Ã£± enum('íÜ','íÝ','íÞ') YES MUL NULL +DESC `£Ô£´`; +Field Type Null Key Default Extra +£Ã£± enum('ޱ','޲','޳') YES MUL NULL +DESC `£Ô£µ`; +Field Type Null Key Default Extra +£Ã£± enum('¤¢','¤¤','¤¦') YES MUL NULL +DESC `£Ô£¶`; +Field Type Null Key Default Extra +£Ã£± enum('íÜ','íÝ','íÞ') YES MUL NULL +DESC `£Ô£·`; +Field Type Null Key Default Extra +£Ã£± enum('ޱ','޲','޳') YES MUL NULL +DESC `£Ô£¸`; +Field Type Null Key Default Extra +£Ã£± enum('¤¢','¤¤','¤¦') YES MUL NULL +DESC `£Ô£¹`; +Field Type Null Key Default Extra +£Ã£± enum('íÜ','íÝ','íÞ') YES MUL NULL +DESC `£Ô£±£°`; +Field Type Null Key Default Extra +£Ã£± enum('ޱ','޲','޳') YES MUL NULL +DESC `£Ô£±£±`; +Field Type Null Key Default Extra +£Ã£± enum('¤¢','¤¤','¤¦') YES MUL NULL +DESC `£Ô£±£²`; +Field Type Null Key Default Extra +£Ã£± enum('íÜ','íÝ','íÞ') YES MUL NULL +ALTER TABLE `£Ô£±` ADD `£Ã£²` CHAR(1) NOT NULL FIRST; +ALTER TABLE `£Ô£²` ADD `£Ã£²` CHAR(1) NOT NULL FIRST; +ALTER TABLE `£Ô£³` ADD `£Ã£²` CHAR(1) NOT NULL FIRST; +ALTER TABLE `£Ô£´` ADD `£Ã£²` CHAR(1) NOT NULL FIRST; +ALTER TABLE `£Ô£µ` ADD `£Ã£²` CHAR(1) NOT NULL FIRST; +ALTER TABLE `£Ô£¶` ADD `£Ã£²` CHAR(1) NOT NULL FIRST; +ALTER TABLE `£Ô£·` ADD `£Ã£²` CHAR(1) NOT NULL FIRST; +ALTER TABLE `£Ô£¸` ADD `£Ã£²` CHAR(1) NOT NULL FIRST; +ALTER TABLE `£Ô£¹` ADD `£Ã£²` CHAR(1) NOT NULL FIRST; +ALTER TABLE `£Ô£±£°` ADD `£Ã£²` CHAR(1) NOT NULL FIRST; +ALTER TABLE `£Ô£±£±` ADD `£Ã£²` CHAR(1) NOT NULL FIRST; +ALTER TABLE `£Ô£±£²` ADD `£Ã£²` CHAR(1) NOT NULL FIRST; +SHOW CREATE TABLE `£Ô£±`; +Table Create Table +£Ô£± CREATE TABLE `£Ô£±` ( + `£Ã£²` char(1) NOT NULL default '', + `£Ã£±` enum('ޱ','޲','޳') default NULL, + KEY `£Ã£±` (`£Ã£±`) +) ENGINE=InnoDB DEFAULT CHARSET=ujis +SHOW CREATE TABLE `£Ô£²`; +Table Create Table +£Ô£² CREATE TABLE `£Ô£²` ( + `£Ã£²` char(1) NOT NULL default '', + `£Ã£±` enum('¤¢','¤¤','¤¦') default NULL, + KEY `£Ã£±` (`£Ã£±`) +) ENGINE=InnoDB DEFAULT CHARSET=ujis +SHOW CREATE TABLE `£Ô£³`; +Table Create Table +£Ô£³ CREATE TABLE `£Ô£³` ( + `£Ã£²` char(1) NOT NULL default '', + `£Ã£±` enum('íÜ','íÝ','íÞ') default NULL, + KEY `£Ã£±` (`£Ã£±`) +) ENGINE=InnoDB DEFAULT CHARSET=ujis +SHOW CREATE TABLE `£Ô£´`; +Table Create Table +£Ô£´ CREATE TABLE `£Ô£´` ( + `£Ã£²` char(1) NOT NULL default '', + `£Ã£±` enum('ޱ','޲','޳') default NULL, + KEY `£Ã£±` (`£Ã£±`) +) ENGINE=MyISAM DEFAULT CHARSET=ujis +SHOW CREATE TABLE `£Ô£µ`; +Table Create Table +£Ô£µ CREATE TABLE `£Ô£µ` ( + `£Ã£²` char(1) NOT NULL default '', + `£Ã£±` enum('¤¢','¤¤','¤¦') default NULL, + KEY `£Ã£±` (`£Ã£±`) +) ENGINE=MyISAM DEFAULT CHARSET=ujis +SHOW CREATE TABLE `£Ô£¶`; +Table Create Table +£Ô£¶ CREATE TABLE `£Ô£¶` ( + `£Ã£²` char(1) NOT NULL default '', + `£Ã£±` enum('íÜ','íÝ','íÞ') default NULL, + KEY `£Ã£±` (`£Ã£±`) +) ENGINE=MyISAM DEFAULT CHARSET=ujis +SHOW CREATE TABLE `£Ô£·`; +Table Create Table +£Ô£· CREATE TABLE `£Ô£·` ( + `£Ã£²` char(1) NOT NULL default '', + `£Ã£±` enum('ޱ','޲','޳') default NULL, + KEY `£Ã£±` (`£Ã£±`) +) ENGINE=HEAP DEFAULT CHARSET=ujis +SHOW CREATE TABLE `£Ô£¸`; +Table Create Table +£Ô£¸ CREATE TABLE `£Ô£¸` ( + `£Ã£²` char(1) NOT NULL default '', + `£Ã£±` enum('¤¢','¤¤','¤¦') default NULL, + KEY `£Ã£±` (`£Ã£±`) +) ENGINE=HEAP DEFAULT CHARSET=ujis +SHOW CREATE TABLE `£Ô£¹`; +Table Create Table +£Ô£¹ CREATE TABLE `£Ô£¹` ( + `£Ã£²` char(1) NOT NULL default '', + `£Ã£±` enum('íÜ','íÝ','íÞ') default NULL, + KEY `£Ã£±` (`£Ã£±`) +) ENGINE=HEAP DEFAULT CHARSET=ujis +SHOW CREATE TABLE `£Ô£±£°`; +Table Create Table +£Ô£±£° CREATE TABLE `£Ô£±£°` ( + `£Ã£²` char(1) NOT NULL default '', + `£Ã£±` enum('ޱ','޲','޳') default NULL, + KEY `£Ã£±` (`£Ã£±`) +) ENGINE=BerkeleyDB DEFAULT CHARSET=ujis +SHOW CREATE TABLE `£Ô£±£±`; +Table Create Table +£Ô£±£± CREATE TABLE `£Ô£±£±` ( + `£Ã£²` char(1) NOT NULL default '', + `£Ã£±` enum('¤¢','¤¤','¤¦') default NULL, + KEY `£Ã£±` (`£Ã£±`) +) ENGINE=BerkeleyDB DEFAULT CHARSET=ujis +SHOW CREATE TABLE `£Ô£±£²`; +Table Create Table +£Ô£±£² CREATE TABLE `£Ô£±£²` ( + `£Ã£²` char(1) NOT NULL default '', + `£Ã£±` enum('íÜ','íÝ','íÞ') default NULL, + KEY `£Ã£±` (`£Ã£±`) +) ENGINE=BerkeleyDB DEFAULT CHARSET=ujis +DESC `£Ô£±`; +Field Type Null Key Default Extra +£Ã£² char(1) +£Ã£± enum('ޱ','޲','޳') YES MUL NULL +DESC `£Ô£²`; +Field Type Null Key Default Extra +£Ã£² char(1) +£Ã£± enum('¤¢','¤¤','¤¦') YES MUL NULL +DESC `£Ô£³`; +Field Type Null Key Default Extra +£Ã£² char(1) +£Ã£± enum('íÜ','íÝ','íÞ') YES MUL NULL +DESC `£Ô£´`; +Field Type Null Key Default Extra +£Ã£² char(1) +£Ã£± enum('ޱ','޲','޳') YES MUL NULL +DESC `£Ô£µ`; +Field Type Null Key Default Extra +£Ã£² char(1) +£Ã£± enum('¤¢','¤¤','¤¦') YES MUL NULL +DESC `£Ô£¶`; +Field Type Null Key Default Extra +£Ã£² char(1) +£Ã£± enum('íÜ','íÝ','íÞ') YES MUL NULL +DESC `£Ô£·`; +Field Type Null Key Default Extra +£Ã£² char(1) +£Ã£± enum('ޱ','޲','޳') YES MUL NULL +DESC `£Ô£¸`; +Field Type Null Key Default Extra +£Ã£² char(1) +£Ã£± enum('¤¢','¤¤','¤¦') YES MUL NULL +DESC `£Ô£¹`; +Field Type Null Key Default Extra +£Ã£² char(1) +£Ã£± enum('íÜ','íÝ','íÞ') YES MUL NULL +DESC `£Ô£±£°`; +Field Type Null Key Default Extra +£Ã£² char(1) +£Ã£± enum('ޱ','޲','޳') YES MUL NULL +DESC `£Ô£±£±`; +Field Type Null Key Default Extra +£Ã£² char(1) +£Ã£± enum('¤¢','¤¤','¤¦') YES MUL NULL +DESC `£Ô£±£²`; +Field Type Null Key Default Extra +£Ã£² char(1) +£Ã£± enum('íÜ','íÝ','íÞ') YES MUL NULL +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/r/jp_enum_utf8.result b/mysql-test/suite/jp/r/jp_enum_utf8.result new file mode 100755 index 00000000000..f2515871ece --- /dev/null +++ b/mysql-test/suite/jp/r/jp_enum_utf8.result @@ -0,0 +1,362 @@ +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +drop table if exists `T11`; +drop table if exists `T12`; +SET NAMES utf8; +SET character_set_database = utf8; +CREATE TABLE `T1` (`C1` ENUM('ï½±','ï½²','ï½³'), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’` (`C1` ENUM('ã‚','ã„','ã†'), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3` (`C1` ENUM('é¾”','é¾–','é¾—'), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”` (`C1` ENUM('ï½±','ï½²','ï½³'), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5` (`C1` ENUM('ã‚','ã„','ã†'), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–` (`C1` ENUM('é¾”','é¾–','é¾—'), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—` (`C1` ENUM('ï½±','ï½²','ï½³'), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8` (`C1` ENUM('ã‚','ã„','ã†'), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™` (`C1` ENUM('é¾”','é¾–','é¾—'), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼` (`C1` ENUM('ï½±','ï½²','ï½³'), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T11` (`C1` ENUM('ã‚','ã„','ã†'), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T12` (`C1` ENUM('é¾”','é¾–','é¾—'), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +INSERT INTO `T1` VALUES ('ï½±'),('ï½²'),('ï½³'); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚'),('ã„'),('ã†'); +INSERT INTO `T3` VALUES ('é¾”'),('é¾–'),('é¾—'); +INSERT INTO `ï¼´ï¼”` VALUES ('ï½±'),('ï½²'),('ï½³'); +INSERT INTO `T5` VALUES ('ã‚'),('ã„'),('ã†'); +INSERT INTO `ï¼´ï¼–` VALUES ('é¾”'),('é¾–'),('é¾—'); +INSERT INTO `ï¼´ï¼—` VALUES ('ï½±'),('ï½²'),('ï½³'); +INSERT INTO `T8` VALUES ('ã‚'),('ã„'),('ã†'); +INSERT INTO `ï¼´ï¼™` VALUES ('é¾”'),('é¾–'),('é¾—'); +INSERT INTO `T1ï¼` VALUES ('ï½±'),('ï½²'),('ï½³'); +INSERT INTO `T11` VALUES ('ã‚'),('ã„'),('ã†'); +INSERT INTO `T12` VALUES ('é¾”'),('é¾–'),('é¾—'); +SELECT * FROM `T1`; +C1 +ï½± +ï½² +ï½³ +SELECT * FROM `ï¼´ï¼’`; +C1 +ã‚ +ã„ +ㆠ+SELECT * FROM `T3`; +C1 +é¾” +é¾– +é¾— +SELECT * FROM `ï¼´ï¼”`; +C1 +ï½± +ï½² +ï½³ +SELECT * FROM `T5`; +C1 +ã‚ +ã„ +ㆠ+SELECT * FROM `ï¼´ï¼–`; +C1 +é¾” +é¾– +é¾— +SELECT * FROM `ï¼´ï¼—`; +C1 +ï½± +ï½² +ï½³ +SELECT * FROM `T8`; +C1 +ã‚ +ã„ +ㆠ+SELECT * FROM `ï¼´ï¼™`; +C1 +é¾” +é¾– +é¾— +SELECT * FROM `T1ï¼`; +C1 +ï½± +ï½² +ï½³ +SELECT * FROM `T11`; +C1 +ã‚ +ã„ +ㆠ+SELECT * FROM `T12`; +C1 +é¾” +é¾– +é¾— +SHOW CREATE TABLE `T1`; +Table Create Table +T1 CREATE TABLE `T1` ( + `C1` enum('ï½±','ï½²','ï½³') default NULL, + KEY `C1` (`C1`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `ï¼´ï¼’`; +Table Create Table +ï¼´ï¼’ CREATE TABLE `ï¼´ï¼’` ( + `C1` enum('ã‚','ã„','ã†') default NULL, + KEY `C1` (`C1`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `T3`; +Table Create Table +T3 CREATE TABLE `T3` ( + `C1` enum('é¾”','é¾–','é¾—') default NULL, + KEY `C1` (`C1`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `ï¼´ï¼”`; +Table Create Table +ï¼´ï¼” CREATE TABLE `ï¼´ï¼”` ( + `C1` enum('ï½±','ï½²','ï½³') default NULL, + KEY `C1` (`C1`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `T5`; +Table Create Table +T5 CREATE TABLE `T5` ( + `C1` enum('ã‚','ã„','ã†') default NULL, + KEY `C1` (`C1`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `ï¼´ï¼–`; +Table Create Table +ï¼´ï¼– CREATE TABLE `ï¼´ï¼–` ( + `C1` enum('é¾”','é¾–','é¾—') default NULL, + KEY `C1` (`C1`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `ï¼´ï¼—`; +Table Create Table +ï¼´ï¼— CREATE TABLE `ï¼´ï¼—` ( + `C1` enum('ï½±','ï½²','ï½³') default NULL, + KEY `C1` (`C1`) +) ENGINE=HEAP DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `T8`; +Table Create Table +T8 CREATE TABLE `T8` ( + `C1` enum('ã‚','ã„','ã†') default NULL, + KEY `C1` (`C1`) +) ENGINE=HEAP DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `ï¼´ï¼™`; +Table Create Table +ï¼´ï¼™ CREATE TABLE `ï¼´ï¼™` ( + `C1` enum('é¾”','é¾–','é¾—') default NULL, + KEY `C1` (`C1`) +) ENGINE=HEAP DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `T1ï¼`; +Table Create Table +ï¼´ï¼‘ï¼ CREATE TABLE `T1ï¼` ( + `C1` enum('ï½±','ï½²','ï½³') default NULL, + KEY `C1` (`C1`) +) ENGINE=BerkeleyDB DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `T11`; +Table Create Table +T11 CREATE TABLE `T11` ( + `C1` enum('ã‚','ã„','ã†') default NULL, + KEY `C1` (`C1`) +) ENGINE=BerkeleyDB DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `T12`; +Table Create Table +T12 CREATE TABLE `T12` ( + `C1` enum('é¾”','é¾–','é¾—') default NULL, + KEY `C1` (`C1`) +) ENGINE=BerkeleyDB DEFAULT CHARSET=utf8 +DESC `T1`; +Field Type Null Key Default Extra +C1 enum('ï½±','ï½²','ï½³') YES MUL NULL +DESC `ï¼´ï¼’`; +Field Type Null Key Default Extra +C1 enum('ã‚','ã„','ã†') YES MUL NULL +DESC `T3`; +Field Type Null Key Default Extra +C1 enum('é¾”','é¾–','é¾—') YES MUL NULL +DESC `ï¼´ï¼”`; +Field Type Null Key Default Extra +C1 enum('ï½±','ï½²','ï½³') YES MUL NULL +DESC `T5`; +Field Type Null Key Default Extra +C1 enum('ã‚','ã„','ã†') YES MUL NULL +DESC `ï¼´ï¼–`; +Field Type Null Key Default Extra +C1 enum('é¾”','é¾–','é¾—') YES MUL NULL +DESC `ï¼´ï¼—`; +Field Type Null Key Default Extra +C1 enum('ï½±','ï½²','ï½³') YES MUL NULL +DESC `T8`; +Field Type Null Key Default Extra +C1 enum('ã‚','ã„','ã†') YES MUL NULL +DESC `ï¼´ï¼™`; +Field Type Null Key Default Extra +C1 enum('é¾”','é¾–','é¾—') YES MUL NULL +DESC `T1ï¼`; +Field Type Null Key Default Extra +C1 enum('ï½±','ï½²','ï½³') YES MUL NULL +DESC `T11`; +Field Type Null Key Default Extra +C1 enum('ã‚','ã„','ã†') YES MUL NULL +DESC `T12`; +Field Type Null Key Default Extra +C1 enum('é¾”','é¾–','é¾—') YES MUL NULL +ALTER TABLE `T1` ADD `C2` CHAR(1) NOT NULL FIRST; +ALTER TABLE `ï¼´ï¼’` ADD `C2` CHAR(1) NOT NULL FIRST; +ALTER TABLE `T3` ADD `C2` CHAR(1) NOT NULL FIRST; +ALTER TABLE `ï¼´ï¼”` ADD `C2` CHAR(1) NOT NULL FIRST; +ALTER TABLE `T5` ADD `C2` CHAR(1) NOT NULL FIRST; +ALTER TABLE `ï¼´ï¼–` ADD `C2` CHAR(1) NOT NULL FIRST; +ALTER TABLE `ï¼´ï¼—` ADD `C2` CHAR(1) NOT NULL FIRST; +ALTER TABLE `T8` ADD `C2` CHAR(1) NOT NULL FIRST; +ALTER TABLE `ï¼´ï¼™` ADD `C2` CHAR(1) NOT NULL FIRST; +ALTER TABLE `T1ï¼` ADD `C2` CHAR(1) NOT NULL FIRST; +ALTER TABLE `T11` ADD `C2` CHAR(1) NOT NULL FIRST; +ALTER TABLE `T12` ADD `C2` CHAR(1) NOT NULL FIRST; +SHOW CREATE TABLE `T1`; +Table Create Table +T1 CREATE TABLE `T1` ( + `C2` char(1) NOT NULL default '', + `C1` enum('ï½±','ï½²','ï½³') default NULL, + KEY `C1` (`C1`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `ï¼´ï¼’`; +Table Create Table +ï¼´ï¼’ CREATE TABLE `ï¼´ï¼’` ( + `C2` char(1) NOT NULL default '', + `C1` enum('ã‚','ã„','ã†') default NULL, + KEY `C1` (`C1`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `T3`; +Table Create Table +T3 CREATE TABLE `T3` ( + `C2` char(1) NOT NULL default '', + `C1` enum('é¾”','é¾–','é¾—') default NULL, + KEY `C1` (`C1`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `ï¼´ï¼”`; +Table Create Table +ï¼´ï¼” CREATE TABLE `ï¼´ï¼”` ( + `C2` char(1) NOT NULL default '', + `C1` enum('ï½±','ï½²','ï½³') default NULL, + KEY `C1` (`C1`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `T5`; +Table Create Table +T5 CREATE TABLE `T5` ( + `C2` char(1) NOT NULL default '', + `C1` enum('ã‚','ã„','ã†') default NULL, + KEY `C1` (`C1`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `ï¼´ï¼–`; +Table Create Table +ï¼´ï¼– CREATE TABLE `ï¼´ï¼–` ( + `C2` char(1) NOT NULL default '', + `C1` enum('é¾”','é¾–','é¾—') default NULL, + KEY `C1` (`C1`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `ï¼´ï¼—`; +Table Create Table +ï¼´ï¼— CREATE TABLE `ï¼´ï¼—` ( + `C2` char(1) NOT NULL default '', + `C1` enum('ï½±','ï½²','ï½³') default NULL, + KEY `C1` (`C1`) +) ENGINE=HEAP DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `T8`; +Table Create Table +T8 CREATE TABLE `T8` ( + `C2` char(1) NOT NULL default '', + `C1` enum('ã‚','ã„','ã†') default NULL, + KEY `C1` (`C1`) +) ENGINE=HEAP DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `ï¼´ï¼™`; +Table Create Table +ï¼´ï¼™ CREATE TABLE `ï¼´ï¼™` ( + `C2` char(1) NOT NULL default '', + `C1` enum('é¾”','é¾–','é¾—') default NULL, + KEY `C1` (`C1`) +) ENGINE=HEAP DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `T1ï¼`; +Table Create Table +ï¼´ï¼‘ï¼ CREATE TABLE `T1ï¼` ( + `C2` char(1) NOT NULL default '', + `C1` enum('ï½±','ï½²','ï½³') default NULL, + KEY `C1` (`C1`) +) ENGINE=BerkeleyDB DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `T11`; +Table Create Table +T11 CREATE TABLE `T11` ( + `C2` char(1) NOT NULL default '', + `C1` enum('ã‚','ã„','ã†') default NULL, + KEY `C1` (`C1`) +) ENGINE=BerkeleyDB DEFAULT CHARSET=utf8 +SHOW CREATE TABLE `T12`; +Table Create Table +T12 CREATE TABLE `T12` ( + `C2` char(1) NOT NULL default '', + `C1` enum('é¾”','é¾–','é¾—') default NULL, + KEY `C1` (`C1`) +) ENGINE=BerkeleyDB DEFAULT CHARSET=utf8 +DESC `T1`; +Field Type Null Key Default Extra +C2 char(1) +C1 enum('ï½±','ï½²','ï½³') YES MUL NULL +DESC `ï¼´ï¼’`; +Field Type Null Key Default Extra +C2 char(1) +C1 enum('ã‚','ã„','ã†') YES MUL NULL +DESC `T3`; +Field Type Null Key Default Extra +C2 char(1) +C1 enum('é¾”','é¾–','é¾—') YES MUL NULL +DESC `ï¼´ï¼”`; +Field Type Null Key Default Extra +C2 char(1) +C1 enum('ï½±','ï½²','ï½³') YES MUL NULL +DESC `T5`; +Field Type Null Key Default Extra +C2 char(1) +C1 enum('ã‚','ã„','ã†') YES MUL NULL +DESC `ï¼´ï¼–`; +Field Type Null Key Default Extra +C2 char(1) +C1 enum('é¾”','é¾–','é¾—') YES MUL NULL +DESC `ï¼´ï¼—`; +Field Type Null Key Default Extra +C2 char(1) +C1 enum('ï½±','ï½²','ï½³') YES MUL NULL +DESC `T8`; +Field Type Null Key Default Extra +C2 char(1) +C1 enum('ã‚','ã„','ã†') YES MUL NULL +DESC `ï¼´ï¼™`; +Field Type Null Key Default Extra +C2 char(1) +C1 enum('é¾”','é¾–','é¾—') YES MUL NULL +DESC `T1ï¼`; +Field Type Null Key Default Extra +C2 char(1) +C1 enum('ï½±','ï½²','ï½³') YES MUL NULL +DESC `T11`; +Field Type Null Key Default Extra +C2 char(1) +C1 enum('ã‚','ã„','ã†') YES MUL NULL +DESC `T12`; +Field Type Null Key Default Extra +C2 char(1) +C1 enum('é¾”','é¾–','é¾—') YES MUL NULL +DROP TABLE `T1`; +DROP TABLE `ï¼´ï¼’`; +DROP TABLE `T3`; +DROP TABLE `ï¼´ï¼”`; +DROP TABLE `T5`; +DROP TABLE `ï¼´ï¼–`; +DROP TABLE `ï¼´ï¼—`; +DROP TABLE `T8`; +DROP TABLE `ï¼´ï¼™`; +DROP TABLE `T1ï¼`; +DROP TABLE `T11`; +DROP TABLE `T12`; diff --git a/mysql-test/suite/jp/r/jp_insert_sjis.result b/mysql-test/suite/jp/r/jp_insert_sjis.result new file mode 100755 index 00000000000..c516986a256 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_insert_sjis.result @@ -0,0 +1,905 @@ +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +drop table if exists `‚s‚P‚P`; +drop table if exists `‚s‚P‚Q`; +SET NAMES sjis; +SET character_set_database = sjis; +CREATE TABLE `‚s‚P` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Q` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚R` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚S` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚T` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚U` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚V` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚W` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚X` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚O` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚P` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚Q` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = bdb; +INSERT INTO `‚s‚P` VALUES ('±²³´µ'); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚S` VALUES ('±²³´µ'); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚V` VALUES ('±²³´µ'); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ'); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\'); +SELECT INSERT(`‚b‚P`,1,1,'¶') FROM `‚s‚P`; +INSERT(`‚b‚P`,1,1,'¶') +¶²³´µ +SELECT INSERT(`‚b‚P`,1,2,'¶·') FROM `‚s‚P`; +INSERT(`‚b‚P`,1,2,'¶·') +¶·³´µ +SELECT INSERT(`‚b‚P`,1,3,'¶·¸') FROM `‚s‚P`; +INSERT(`‚b‚P`,1,3,'¶·¸') +¶·¸´µ +SELECT INSERT(`‚b‚P`,1,4,'¶·¸¹') FROM `‚s‚P`; +INSERT(`‚b‚P`,1,4,'¶·¸¹') +¶·¸¹µ +SELECT INSERT(`‚b‚P`,1,5,'¶·¸¹º') FROM `‚s‚P`; +INSERT(`‚b‚P`,1,5,'¶·¸¹º') +¶·¸¹º +SELECT INSERT(`‚b‚P`,2,1,'·') FROM `‚s‚P`; +INSERT(`‚b‚P`,2,1,'·') +±·³´µ +SELECT INSERT(`‚b‚P`,2,2,'·¸') FROM `‚s‚P`; +INSERT(`‚b‚P`,2,2,'·¸') +±·¸´µ +SELECT INSERT(`‚b‚P`,2,3,'·¸¹') FROM `‚s‚P`; +INSERT(`‚b‚P`,2,3,'·¸¹') +±·¸¹µ +SELECT INSERT(`‚b‚P`,2,4,'·¸¹º') FROM `‚s‚P`; +INSERT(`‚b‚P`,2,4,'·¸¹º') +±·¸¹º +SELECT INSERT(`‚b‚P`,3,1,'¸') FROM `‚s‚P`; +INSERT(`‚b‚P`,3,1,'¸') +±²¸´µ +SELECT INSERT(`‚b‚P`,3,2,'¸¹') FROM `‚s‚P`; +INSERT(`‚b‚P`,3,2,'¸¹') +±²¸¹µ +SELECT INSERT(`‚b‚P`,3,3,'¸¹º') FROM `‚s‚P`; +INSERT(`‚b‚P`,3,3,'¸¹º') +±²¸¹º +SELECT INSERT(`‚b‚P`,4,1,'¹') FROM `‚s‚P`; +INSERT(`‚b‚P`,4,1,'¹') +±²³¹µ +SELECT INSERT(`‚b‚P`,4,2,'¹º') FROM `‚s‚P`; +INSERT(`‚b‚P`,4,2,'¹º') +±²³¹º +SELECT INSERT(`‚b‚P`,5,1,'º') FROM `‚s‚P`; +INSERT(`‚b‚P`,5,1,'º') +±²³´º +SELECT INSERT(`‚b‚P`,1,1,' ') FROM `‚s‚P`; +INSERT(`‚b‚P`,1,1,' ') + ²³´µ +SELECT INSERT(`‚b‚P`,1,2,' ') FROM `‚s‚P`; +INSERT(`‚b‚P`,1,2,' ') + ³´µ +SELECT INSERT(`‚b‚P`,1,3,' ') FROM `‚s‚P`; +INSERT(`‚b‚P`,1,3,' ') + ´µ +SELECT INSERT(`‚b‚P`,1,4,' ') FROM `‚s‚P`; +INSERT(`‚b‚P`,1,4,' ') + µ +SELECT INSERT(`‚b‚P`,1,5,' ') FROM `‚s‚P`; +INSERT(`‚b‚P`,1,5,' ') + +SELECT INSERT(`‚b‚P`,2,1,' ') FROM `‚s‚P`; +INSERT(`‚b‚P`,2,1,' ') +± ³´µ +SELECT INSERT(`‚b‚P`,2,2,' ') FROM `‚s‚P`; +INSERT(`‚b‚P`,2,2,' ') +± ´µ +SELECT INSERT(`‚b‚P`,2,3,' ') FROM `‚s‚P`; +INSERT(`‚b‚P`,2,3,' ') +± µ +SELECT INSERT(`‚b‚P`,2,4,' ') FROM `‚s‚P`; +INSERT(`‚b‚P`,2,4,' ') +± +SELECT INSERT(`‚b‚P`,3,1,' ') FROM `‚s‚P`; +INSERT(`‚b‚P`,3,1,' ') +±² ´µ +SELECT INSERT(`‚b‚P`,3,2,' ') FROM `‚s‚P`; +INSERT(`‚b‚P`,3,2,' ') +±² µ +SELECT INSERT(`‚b‚P`,3,3,' ') FROM `‚s‚P`; +INSERT(`‚b‚P`,3,3,' ') +±² +SELECT INSERT(`‚b‚P`,4,1,' ') FROM `‚s‚P`; +INSERT(`‚b‚P`,4,1,' ') +±²³ µ +SELECT INSERT(`‚b‚P`,4,2,' ') FROM `‚s‚P`; +INSERT(`‚b‚P`,4,2,' ') +±²³ +SELECT INSERT(`‚b‚P`,5,1,' ') FROM `‚s‚P`; +INSERT(`‚b‚P`,5,1,' ') +±²³´ +SELECT INSERT(`‚b‚P`,1,1,'‚©') FROM `‚s‚Q`; +INSERT(`‚b‚P`,1,1,'‚©') +‚©‚¢‚¤‚¦‚¨ +SELECT INSERT(`‚b‚P`,1,2,'‚©‚«') FROM `‚s‚Q`; +INSERT(`‚b‚P`,1,2,'‚©‚«') +‚©‚«‚¤‚¦‚¨ +SELECT INSERT(`‚b‚P`,1,3,'‚©‚«‚­') FROM `‚s‚Q`; +INSERT(`‚b‚P`,1,3,'‚©‚«‚­') +‚©‚«‚­‚¦‚¨ +SELECT INSERT(`‚b‚P`,1,4,'‚©‚«‚­‚¯') FROM `‚s‚Q`; +INSERT(`‚b‚P`,1,4,'‚©‚«‚­‚¯') +‚©‚«‚­‚¯‚¨ +SELECT INSERT(`‚b‚P`,1,5,'‚©‚«‚­‚¯‚±') FROM `‚s‚Q`; +INSERT(`‚b‚P`,1,5,'‚©‚«‚­‚¯‚±') +‚©‚«‚­‚¯‚± +SELECT INSERT(`‚b‚P`,2,1,'‚«') FROM `‚s‚Q`; +INSERT(`‚b‚P`,2,1,'‚«') +‚ ‚«‚¤‚¦‚¨ +SELECT INSERT(`‚b‚P`,2,2,'‚«‚­') FROM `‚s‚Q`; +INSERT(`‚b‚P`,2,2,'‚«‚­') +‚ ‚«‚­‚¦‚¨ +SELECT INSERT(`‚b‚P`,2,3,'‚«‚­‚¯') FROM `‚s‚Q`; +INSERT(`‚b‚P`,2,3,'‚«‚­‚¯') +‚ ‚«‚­‚¯‚¨ +SELECT INSERT(`‚b‚P`,2,4,'‚«‚­‚¯‚±') FROM `‚s‚Q`; +INSERT(`‚b‚P`,2,4,'‚«‚­‚¯‚±') +‚ ‚«‚­‚¯‚± +SELECT INSERT(`‚b‚P`,3,1,'‚­') FROM `‚s‚Q`; +INSERT(`‚b‚P`,3,1,'‚­') +‚ ‚¢‚­‚¦‚¨ +SELECT INSERT(`‚b‚P`,3,2,'‚­‚¯') FROM `‚s‚Q`; +INSERT(`‚b‚P`,3,2,'‚­‚¯') +‚ ‚¢‚­‚¯‚¨ +SELECT INSERT(`‚b‚P`,3,3,'‚­‚¯‚±') FROM `‚s‚Q`; +INSERT(`‚b‚P`,3,3,'‚­‚¯‚±') +‚ ‚¢‚­‚¯‚± +SELECT INSERT(`‚b‚P`,4,1,'‚¯') FROM `‚s‚Q`; +INSERT(`‚b‚P`,4,1,'‚¯') +‚ ‚¢‚¤‚¯‚¨ +SELECT INSERT(`‚b‚P`,4,2,'‚¯‚±') FROM `‚s‚Q`; +INSERT(`‚b‚P`,4,2,'‚¯‚±') +‚ ‚¢‚¤‚¯‚± +SELECT INSERT(`‚b‚P`,5,1,'‚±') FROM `‚s‚Q`; +INSERT(`‚b‚P`,5,1,'‚±') +‚ ‚¢‚¤‚¦‚± +SELECT INSERT(`‚b‚P`,1,1,'@') FROM `‚s‚Q`; +INSERT(`‚b‚P`,1,1,'@') +@‚¢‚¤‚¦‚¨ +SELECT INSERT(`‚b‚P`,1,2,'@@') FROM `‚s‚Q`; +INSERT(`‚b‚P`,1,2,'@@') +@@‚¤‚¦‚¨ +SELECT INSERT(`‚b‚P`,1,3,'@@@') FROM `‚s‚Q`; +INSERT(`‚b‚P`,1,3,'@@@') +@@@‚¦‚¨ +SELECT INSERT(`‚b‚P`,1,4,'@@@@') FROM `‚s‚Q`; +INSERT(`‚b‚P`,1,4,'@@@@') +@@@@‚¨ +SELECT INSERT(`‚b‚P`,1,5,'@@@@@') FROM `‚s‚Q`; +INSERT(`‚b‚P`,1,5,'@@@@@') +@@@@@ +SELECT INSERT(`‚b‚P`,2,1,'@') FROM `‚s‚Q`; +INSERT(`‚b‚P`,2,1,'@') +‚ @‚¤‚¦‚¨ +SELECT INSERT(`‚b‚P`,2,2,'@@') FROM `‚s‚Q`; +INSERT(`‚b‚P`,2,2,'@@') +‚ @@‚¦‚¨ +SELECT INSERT(`‚b‚P`,2,3,'@@@') FROM `‚s‚Q`; +INSERT(`‚b‚P`,2,3,'@@@') +‚ @@@‚¨ +SELECT INSERT(`‚b‚P`,2,4,'@@@@') FROM `‚s‚Q`; +INSERT(`‚b‚P`,2,4,'@@@@') +‚ @@@@ +SELECT INSERT(`‚b‚P`,3,1,'@') FROM `‚s‚Q`; +INSERT(`‚b‚P`,3,1,'@') +‚ ‚¢@‚¦‚¨ +SELECT INSERT(`‚b‚P`,3,2,'@@') FROM `‚s‚Q`; +INSERT(`‚b‚P`,3,2,'@@') +‚ ‚¢@@‚¨ +SELECT INSERT(`‚b‚P`,3,3,'@@@') FROM `‚s‚Q`; +INSERT(`‚b‚P`,3,3,'@@@') +‚ ‚¢@@@ +SELECT INSERT(`‚b‚P`,4,1,'@') FROM `‚s‚Q`; +INSERT(`‚b‚P`,4,1,'@') +‚ ‚¢‚¤@‚¨ +SELECT INSERT(`‚b‚P`,4,2,'@@') FROM `‚s‚Q`; +INSERT(`‚b‚P`,4,2,'@@') +‚ ‚¢‚¤@@ +SELECT INSERT(`‚b‚P`,5,1,'@') FROM `‚s‚Q`; +INSERT(`‚b‚P`,5,1,'@') +‚ ‚¢‚¤‚¦@ +SELECT INSERT(`‚b‚P`,1,1,'”\') FROM `‚s‚R`; +INSERT(`‚b‚P`,1,1,'”\') +”\\•\—\\ +SELECT INSERT(`‚b‚P`,1,2,'”\”\' ) FROM `‚s‚R`; +INSERT(`‚b‚P`,1,2,'”\”\' ) +”\”\•\—\\ +SELECT INSERT(`‚b‚P`,1,3,'”\”\”\' ) FROM `‚s‚R`; +INSERT(`‚b‚P`,1,3,'”\”\”\' ) +”\”\”\—\\ +SELECT INSERT(`‚b‚P`,1,4,'”\”\”\”\' ) FROM `‚s‚R`; +INSERT(`‚b‚P`,1,4,'”\”\”\”\' ) +”\”\”\”\\ +SELECT INSERT(`‚b‚P`,1,5,'”\”\”\”\”\' ) FROM `‚s‚R`; +INSERT(`‚b‚P`,1,5,'”\”\”\”\”\' ) +”\”\”\”\”\ +SELECT INSERT(`‚b‚P`,2,1,'”\') FROM `‚s‚R`; +INSERT(`‚b‚P`,2,1,'”\') +ƒ\”\•\—\\ +SELECT INSERT(`‚b‚P`,2,2,'”\”\' ) FROM `‚s‚R`; +INSERT(`‚b‚P`,2,2,'”\”\' ) +ƒ\”\”\—\\ +SELECT INSERT(`‚b‚P`,2,3,'”\”\”\' ) FROM `‚s‚R`; +INSERT(`‚b‚P`,2,3,'”\”\”\' ) +ƒ\”\”\”\\ +SELECT INSERT(`‚b‚P`,2,4,'”\”\”\”\' ) FROM `‚s‚R`; +INSERT(`‚b‚P`,2,4,'”\”\”\”\' ) +ƒ\”\”\”\”\ +SELECT INSERT(`‚b‚P`,3,1,'”\') FROM `‚s‚R`; +INSERT(`‚b‚P`,3,1,'”\') +ƒ\\”\—\\ +SELECT INSERT(`‚b‚P`,3,2,'”\”\' ) FROM `‚s‚R`; +INSERT(`‚b‚P`,3,2,'”\”\' ) +ƒ\\”\”\\ +SELECT INSERT(`‚b‚P`,3,3,'”\”\”\' ) FROM `‚s‚R`; +INSERT(`‚b‚P`,3,3,'”\”\”\' ) +ƒ\\”\”\”\ +SELECT INSERT(`‚b‚P`,4,1,'”\') FROM `‚s‚R`; +INSERT(`‚b‚P`,4,1,'”\') +ƒ\\•\”\\ +SELECT INSERT(`‚b‚P`,4,2,'”\”\' ) FROM `‚s‚R`; +INSERT(`‚b‚P`,4,2,'”\”\' ) +ƒ\\•\”\”\ +SELECT INSERT(`‚b‚P`,5,1,'”\') FROM `‚s‚R`; +INSERT(`‚b‚P`,5,1,'”\') +ƒ\\•\—\”\ +SELECT INSERT(`‚b‚P`,1,1,'¶') FROM `‚s‚S`; +INSERT(`‚b‚P`,1,1,'¶') +¶²³´µ +SELECT INSERT(`‚b‚P`,1,2,'¶·') FROM `‚s‚S`; +INSERT(`‚b‚P`,1,2,'¶·') +¶·³´µ +SELECT INSERT(`‚b‚P`,1,3,'¶·¸') FROM `‚s‚S`; +INSERT(`‚b‚P`,1,3,'¶·¸') +¶·¸´µ +SELECT INSERT(`‚b‚P`,1,4,'¶·¸¹') FROM `‚s‚S`; +INSERT(`‚b‚P`,1,4,'¶·¸¹') +¶·¸¹µ +SELECT INSERT(`‚b‚P`,1,5,'¶·¸¹º') FROM `‚s‚S`; +INSERT(`‚b‚P`,1,5,'¶·¸¹º') +¶·¸¹º +SELECT INSERT(`‚b‚P`,2,1,'·') FROM `‚s‚S`; +INSERT(`‚b‚P`,2,1,'·') +±·³´µ +SELECT INSERT(`‚b‚P`,2,2,'·¸') FROM `‚s‚S`; +INSERT(`‚b‚P`,2,2,'·¸') +±·¸´µ +SELECT INSERT(`‚b‚P`,2,3,'·¸¹') FROM `‚s‚S`; +INSERT(`‚b‚P`,2,3,'·¸¹') +±·¸¹µ +SELECT INSERT(`‚b‚P`,2,4,'·¸¹º') FROM `‚s‚S`; +INSERT(`‚b‚P`,2,4,'·¸¹º') +±·¸¹º +SELECT INSERT(`‚b‚P`,3,1,'¸') FROM `‚s‚S`; +INSERT(`‚b‚P`,3,1,'¸') +±²¸´µ +SELECT INSERT(`‚b‚P`,3,2,'¸¹') FROM `‚s‚S`; +INSERT(`‚b‚P`,3,2,'¸¹') +±²¸¹µ +SELECT INSERT(`‚b‚P`,3,3,'¸¹º') FROM `‚s‚S`; +INSERT(`‚b‚P`,3,3,'¸¹º') +±²¸¹º +SELECT INSERT(`‚b‚P`,4,1,'¹') FROM `‚s‚S`; +INSERT(`‚b‚P`,4,1,'¹') +±²³¹µ +SELECT INSERT(`‚b‚P`,4,2,'¹º') FROM `‚s‚S`; +INSERT(`‚b‚P`,4,2,'¹º') +±²³¹º +SELECT INSERT(`‚b‚P`,5,1,'º') FROM `‚s‚S`; +INSERT(`‚b‚P`,5,1,'º') +±²³´º +SELECT INSERT(`‚b‚P`,1,1,' ') FROM `‚s‚S`; +INSERT(`‚b‚P`,1,1,' ') + ²³´µ +SELECT INSERT(`‚b‚P`,1,2,' ') FROM `‚s‚S`; +INSERT(`‚b‚P`,1,2,' ') + ³´µ +SELECT INSERT(`‚b‚P`,1,3,' ') FROM `‚s‚S`; +INSERT(`‚b‚P`,1,3,' ') + ´µ +SELECT INSERT(`‚b‚P`,1,4,' ') FROM `‚s‚S`; +INSERT(`‚b‚P`,1,4,' ') + µ +SELECT INSERT(`‚b‚P`,1,5,' ') FROM `‚s‚S`; +INSERT(`‚b‚P`,1,5,' ') + +SELECT INSERT(`‚b‚P`,2,1,' ') FROM `‚s‚S`; +INSERT(`‚b‚P`,2,1,' ') +± ³´µ +SELECT INSERT(`‚b‚P`,2,2,' ') FROM `‚s‚S`; +INSERT(`‚b‚P`,2,2,' ') +± ´µ +SELECT INSERT(`‚b‚P`,2,3,' ') FROM `‚s‚S`; +INSERT(`‚b‚P`,2,3,' ') +± µ +SELECT INSERT(`‚b‚P`,2,4,' ') FROM `‚s‚S`; +INSERT(`‚b‚P`,2,4,' ') +± +SELECT INSERT(`‚b‚P`,3,1,' ') FROM `‚s‚S`; +INSERT(`‚b‚P`,3,1,' ') +±² ´µ +SELECT INSERT(`‚b‚P`,3,2,' ') FROM `‚s‚S`; +INSERT(`‚b‚P`,3,2,' ') +±² µ +SELECT INSERT(`‚b‚P`,3,3,' ') FROM `‚s‚S`; +INSERT(`‚b‚P`,3,3,' ') +±² +SELECT INSERT(`‚b‚P`,4,1,' ') FROM `‚s‚S`; +INSERT(`‚b‚P`,4,1,' ') +±²³ µ +SELECT INSERT(`‚b‚P`,4,2,' ') FROM `‚s‚S`; +INSERT(`‚b‚P`,4,2,' ') +±²³ +SELECT INSERT(`‚b‚P`,5,1,' ') FROM `‚s‚S`; +INSERT(`‚b‚P`,5,1,' ') +±²³´ +SELECT INSERT(`‚b‚P`,1,1,'‚©') FROM `‚s‚T`; +INSERT(`‚b‚P`,1,1,'‚©') +‚©‚¢‚¤‚¦‚¨ +SELECT INSERT(`‚b‚P`,1,2,'‚©‚«') FROM `‚s‚T`; +INSERT(`‚b‚P`,1,2,'‚©‚«') +‚©‚«‚¤‚¦‚¨ +SELECT INSERT(`‚b‚P`,1,3,'‚©‚«‚­') FROM `‚s‚T`; +INSERT(`‚b‚P`,1,3,'‚©‚«‚­') +‚©‚«‚­‚¦‚¨ +SELECT INSERT(`‚b‚P`,1,4,'‚©‚«‚­‚¯') FROM `‚s‚T`; +INSERT(`‚b‚P`,1,4,'‚©‚«‚­‚¯') +‚©‚«‚­‚¯‚¨ +SELECT INSERT(`‚b‚P`,1,5,'‚©‚«‚­‚¯‚±') FROM `‚s‚T`; +INSERT(`‚b‚P`,1,5,'‚©‚«‚­‚¯‚±') +‚©‚«‚­‚¯‚± +SELECT INSERT(`‚b‚P`,2,1,'‚«') FROM `‚s‚T`; +INSERT(`‚b‚P`,2,1,'‚«') +‚ ‚«‚¤‚¦‚¨ +SELECT INSERT(`‚b‚P`,2,2,'‚«‚­') FROM `‚s‚T`; +INSERT(`‚b‚P`,2,2,'‚«‚­') +‚ ‚«‚­‚¦‚¨ +SELECT INSERT(`‚b‚P`,2,3,'‚«‚­‚¯') FROM `‚s‚T`; +INSERT(`‚b‚P`,2,3,'‚«‚­‚¯') +‚ ‚«‚­‚¯‚¨ +SELECT INSERT(`‚b‚P`,2,4,'‚«‚­‚¯‚±') FROM `‚s‚T`; +INSERT(`‚b‚P`,2,4,'‚«‚­‚¯‚±') +‚ ‚«‚­‚¯‚± +SELECT INSERT(`‚b‚P`,3,1,'‚­') FROM `‚s‚T`; +INSERT(`‚b‚P`,3,1,'‚­') +‚ ‚¢‚­‚¦‚¨ +SELECT INSERT(`‚b‚P`,3,2,'‚­‚¯') FROM `‚s‚T`; +INSERT(`‚b‚P`,3,2,'‚­‚¯') +‚ ‚¢‚­‚¯‚¨ +SELECT INSERT(`‚b‚P`,3,3,'‚­‚¯‚±') FROM `‚s‚T`; +INSERT(`‚b‚P`,3,3,'‚­‚¯‚±') +‚ ‚¢‚­‚¯‚± +SELECT INSERT(`‚b‚P`,4,1,'‚¯') FROM `‚s‚T`; +INSERT(`‚b‚P`,4,1,'‚¯') +‚ ‚¢‚¤‚¯‚¨ +SELECT INSERT(`‚b‚P`,4,2,'‚¯‚±') FROM `‚s‚T`; +INSERT(`‚b‚P`,4,2,'‚¯‚±') +‚ ‚¢‚¤‚¯‚± +SELECT INSERT(`‚b‚P`,5,1,'‚±') FROM `‚s‚T`; +INSERT(`‚b‚P`,5,1,'‚±') +‚ ‚¢‚¤‚¦‚± +SELECT INSERT(`‚b‚P`,1,1,'@') FROM `‚s‚T`; +INSERT(`‚b‚P`,1,1,'@') +@‚¢‚¤‚¦‚¨ +SELECT INSERT(`‚b‚P`,1,2,'@@') FROM `‚s‚T`; +INSERT(`‚b‚P`,1,2,'@@') +@@‚¤‚¦‚¨ +SELECT INSERT(`‚b‚P`,1,3,'@@@') FROM `‚s‚T`; +INSERT(`‚b‚P`,1,3,'@@@') +@@@‚¦‚¨ +SELECT INSERT(`‚b‚P`,1,4,'@@@@') FROM `‚s‚T`; +INSERT(`‚b‚P`,1,4,'@@@@') +@@@@‚¨ +SELECT INSERT(`‚b‚P`,1,5,'@@@@@') FROM `‚s‚T`; +INSERT(`‚b‚P`,1,5,'@@@@@') +@@@@@ +SELECT INSERT(`‚b‚P`,2,1,'@') FROM `‚s‚T`; +INSERT(`‚b‚P`,2,1,'@') +‚ @‚¤‚¦‚¨ +SELECT INSERT(`‚b‚P`,2,2,'@@') FROM `‚s‚T`; +INSERT(`‚b‚P`,2,2,'@@') +‚ @@‚¦‚¨ +SELECT INSERT(`‚b‚P`,2,3,'@@@') FROM `‚s‚T`; +INSERT(`‚b‚P`,2,3,'@@@') +‚ @@@‚¨ +SELECT INSERT(`‚b‚P`,2,4,'@@@@') FROM `‚s‚T`; +INSERT(`‚b‚P`,2,4,'@@@@') +‚ @@@@ +SELECT INSERT(`‚b‚P`,3,1,'@') FROM `‚s‚T`; +INSERT(`‚b‚P`,3,1,'@') +‚ ‚¢@‚¦‚¨ +SELECT INSERT(`‚b‚P`,3,2,'@@') FROM `‚s‚T`; +INSERT(`‚b‚P`,3,2,'@@') +‚ ‚¢@@‚¨ +SELECT INSERT(`‚b‚P`,3,3,'@@@') FROM `‚s‚T`; +INSERT(`‚b‚P`,3,3,'@@@') +‚ ‚¢@@@ +SELECT INSERT(`‚b‚P`,4,1,'@') FROM `‚s‚T`; +INSERT(`‚b‚P`,4,1,'@') +‚ ‚¢‚¤@‚¨ +SELECT INSERT(`‚b‚P`,4,2,'@@') FROM `‚s‚T`; +INSERT(`‚b‚P`,4,2,'@@') +‚ ‚¢‚¤@@ +SELECT INSERT(`‚b‚P`,5,1,'@') FROM `‚s‚T`; +INSERT(`‚b‚P`,5,1,'@') +‚ ‚¢‚¤‚¦@ +SELECT INSERT(`‚b‚P`,1,1,'”\') FROM `‚s‚U`; +INSERT(`‚b‚P`,1,1,'”\') +”\\•\—\\ +SELECT INSERT(`‚b‚P`,1,2,'”\”\' ) FROM `‚s‚U`; +INSERT(`‚b‚P`,1,2,'”\”\' ) +”\”\•\—\\ +SELECT INSERT(`‚b‚P`,1,3,'”\”\”\' ) FROM `‚s‚U`; +INSERT(`‚b‚P`,1,3,'”\”\”\' ) +”\”\”\—\\ +SELECT INSERT(`‚b‚P`,1,4,'”\”\”\”\' ) FROM `‚s‚U`; +INSERT(`‚b‚P`,1,4,'”\”\”\”\' ) +”\”\”\”\\ +SELECT INSERT(`‚b‚P`,1,5,'”\”\”\”\”\' ) FROM `‚s‚U`; +INSERT(`‚b‚P`,1,5,'”\”\”\”\”\' ) +”\”\”\”\”\ +SELECT INSERT(`‚b‚P`,2,1,'”\') FROM `‚s‚U`; +INSERT(`‚b‚P`,2,1,'”\') +ƒ\”\•\—\\ +SELECT INSERT(`‚b‚P`,2,2,'”\”\') FROM `‚s‚U`; +INSERT(`‚b‚P`,2,2,'”\”\') +ƒ\”\”\—\\ +SELECT INSERT(`‚b‚P`,2,3,'”\”\”\' ) FROM `‚s‚U`; +INSERT(`‚b‚P`,2,3,'”\”\”\' ) +ƒ\”\”\”\\ +SELECT INSERT(`‚b‚P`,2,4,'”\”\”\”\' ) FROM `‚s‚U`; +INSERT(`‚b‚P`,2,4,'”\”\”\”\' ) +ƒ\”\”\”\”\ +SELECT INSERT(`‚b‚P`,3,1,'”\') FROM `‚s‚U`; +INSERT(`‚b‚P`,3,1,'”\') +ƒ\\”\—\\ +SELECT INSERT(`‚b‚P`,3,2,'”\”\' ) FROM `‚s‚U`; +INSERT(`‚b‚P`,3,2,'”\”\' ) +ƒ\\”\”\\ +SELECT INSERT(`‚b‚P`,3,3,'”\”\”\' ) FROM `‚s‚U`; +INSERT(`‚b‚P`,3,3,'”\”\”\' ) +ƒ\\”\”\”\ +SELECT INSERT(`‚b‚P`,4,1,'”\') FROM `‚s‚U`; +INSERT(`‚b‚P`,4,1,'”\') +ƒ\\•\”\\ +SELECT INSERT(`‚b‚P`,4,2,'”\”\' ) FROM `‚s‚U`; +INSERT(`‚b‚P`,4,2,'”\”\' ) +ƒ\\•\”\”\ +SELECT INSERT(`‚b‚P`,5,1,'”\') FROM `‚s‚U`; +INSERT(`‚b‚P`,5,1,'”\') +ƒ\\•\—\”\ +SELECT INSERT(`‚b‚P`,1,1,'¶') FROM `‚s‚V`; +INSERT(`‚b‚P`,1,1,'¶') +¶²³´µ +SELECT INSERT(`‚b‚P`,1,2,'¶·') FROM `‚s‚V`; +INSERT(`‚b‚P`,1,2,'¶·') +¶·³´µ +SELECT INSERT(`‚b‚P`,1,3,'¶·¸') FROM `‚s‚V`; +INSERT(`‚b‚P`,1,3,'¶·¸') +¶·¸´µ +SELECT INSERT(`‚b‚P`,1,4,'¶·¸¹') FROM `‚s‚V`; +INSERT(`‚b‚P`,1,4,'¶·¸¹') +¶·¸¹µ +SELECT INSERT(`‚b‚P`,1,5,'¶·¸¹º') FROM `‚s‚V`; +INSERT(`‚b‚P`,1,5,'¶·¸¹º') +¶·¸¹º +SELECT INSERT(`‚b‚P`,2,1,'·') FROM `‚s‚V`; +INSERT(`‚b‚P`,2,1,'·') +±·³´µ +SELECT INSERT(`‚b‚P`,2,2,'·¸') FROM `‚s‚V`; +INSERT(`‚b‚P`,2,2,'·¸') +±·¸´µ +SELECT INSERT(`‚b‚P`,2,3,'·¸¹') FROM `‚s‚V`; +INSERT(`‚b‚P`,2,3,'·¸¹') +±·¸¹µ +SELECT INSERT(`‚b‚P`,2,4,'·¸¹º') FROM `‚s‚V`; +INSERT(`‚b‚P`,2,4,'·¸¹º') +±·¸¹º +SELECT INSERT(`‚b‚P`,3,1,'¸') FROM `‚s‚V`; +INSERT(`‚b‚P`,3,1,'¸') +±²¸´µ +SELECT INSERT(`‚b‚P`,3,2,'¸¹') FROM `‚s‚V`; +INSERT(`‚b‚P`,3,2,'¸¹') +±²¸¹µ +SELECT INSERT(`‚b‚P`,3,3,'¸¹º') FROM `‚s‚V`; +INSERT(`‚b‚P`,3,3,'¸¹º') +±²¸¹º +SELECT INSERT(`‚b‚P`,4,1,'¹') FROM `‚s‚V`; +INSERT(`‚b‚P`,4,1,'¹') +±²³¹µ +SELECT INSERT(`‚b‚P`,4,2,'¹º') FROM `‚s‚V`; +INSERT(`‚b‚P`,4,2,'¹º') +±²³¹º +SELECT INSERT(`‚b‚P`,5,1,'º') FROM `‚s‚V`; +INSERT(`‚b‚P`,5,1,'º') +±²³´º +SELECT INSERT(`‚b‚P`,1,1,' ') FROM `‚s‚V`; +INSERT(`‚b‚P`,1,1,' ') + ²³´µ +SELECT INSERT(`‚b‚P`,1,2,' ') FROM `‚s‚V`; +INSERT(`‚b‚P`,1,2,' ') + ³´µ +SELECT INSERT(`‚b‚P`,1,3,' ') FROM `‚s‚V`; +INSERT(`‚b‚P`,1,3,' ') + ´µ +SELECT INSERT(`‚b‚P`,1,4,' ') FROM `‚s‚V`; +INSERT(`‚b‚P`,1,4,' ') + µ +SELECT INSERT(`‚b‚P`,1,5,' ') FROM `‚s‚V`; +INSERT(`‚b‚P`,1,5,' ') + +SELECT INSERT(`‚b‚P`,2,1,' ') FROM `‚s‚V`; +INSERT(`‚b‚P`,2,1,' ') +± ³´µ +SELECT INSERT(`‚b‚P`,2,2,' ') FROM `‚s‚V`; +INSERT(`‚b‚P`,2,2,' ') +± ´µ +SELECT INSERT(`‚b‚P`,2,3,' ') FROM `‚s‚V`; +INSERT(`‚b‚P`,2,3,' ') +± µ +SELECT INSERT(`‚b‚P`,2,4,' ') FROM `‚s‚V`; +INSERT(`‚b‚P`,2,4,' ') +± +SELECT INSERT(`‚b‚P`,3,1,' ') FROM `‚s‚V`; +INSERT(`‚b‚P`,3,1,' ') +±² ´µ +SELECT INSERT(`‚b‚P`,3,2,' ') FROM `‚s‚V`; +INSERT(`‚b‚P`,3,2,' ') +±² µ +SELECT INSERT(`‚b‚P`,3,3,' ') FROM `‚s‚V`; +INSERT(`‚b‚P`,3,3,' ') +±² +SELECT INSERT(`‚b‚P`,4,1,' ') FROM `‚s‚V`; +INSERT(`‚b‚P`,4,1,' ') +±²³ µ +SELECT INSERT(`‚b‚P`,4,2,' ') FROM `‚s‚V`; +INSERT(`‚b‚P`,4,2,' ') +±²³ +SELECT INSERT(`‚b‚P`,5,1,' ') FROM `‚s‚V`; +INSERT(`‚b‚P`,5,1,' ') +±²³´ +SELECT INSERT(`‚b‚P`,1,1,'‚©') FROM `‚s‚W`; +INSERT(`‚b‚P`,1,1,'‚©') +‚©‚¢‚¤‚¦‚¨ +SELECT INSERT(`‚b‚P`,1,2,'‚©‚«') FROM `‚s‚W`; +INSERT(`‚b‚P`,1,2,'‚©‚«') +‚©‚«‚¤‚¦‚¨ +SELECT INSERT(`‚b‚P`,1,3,'‚©‚«‚­') FROM `‚s‚W`; +INSERT(`‚b‚P`,1,3,'‚©‚«‚­') +‚©‚«‚­‚¦‚¨ +SELECT INSERT(`‚b‚P`,1,4,'‚©‚«‚­‚¯') FROM `‚s‚W`; +INSERT(`‚b‚P`,1,4,'‚©‚«‚­‚¯') +‚©‚«‚­‚¯‚¨ +SELECT INSERT(`‚b‚P`,1,5,'‚©‚«‚­‚¯‚±') FROM `‚s‚W`; +INSERT(`‚b‚P`,1,5,'‚©‚«‚­‚¯‚±') +‚©‚«‚­‚¯‚± +SELECT INSERT(`‚b‚P`,2,1,'‚«') FROM `‚s‚W`; +INSERT(`‚b‚P`,2,1,'‚«') +‚ ‚«‚¤‚¦‚¨ +SELECT INSERT(`‚b‚P`,2,2,'‚«‚­') FROM `‚s‚W`; +INSERT(`‚b‚P`,2,2,'‚«‚­') +‚ ‚«‚­‚¦‚¨ +SELECT INSERT(`‚b‚P`,2,3,'‚«‚­‚¯') FROM `‚s‚W`; +INSERT(`‚b‚P`,2,3,'‚«‚­‚¯') +‚ ‚«‚­‚¯‚¨ +SELECT INSERT(`‚b‚P`,2,4,'‚«‚­‚¯‚±') FROM `‚s‚W`; +INSERT(`‚b‚P`,2,4,'‚«‚­‚¯‚±') +‚ ‚«‚­‚¯‚± +SELECT INSERT(`‚b‚P`,3,1,'‚­') FROM `‚s‚W`; +INSERT(`‚b‚P`,3,1,'‚­') +‚ ‚¢‚­‚¦‚¨ +SELECT INSERT(`‚b‚P`,3,2,'‚­‚¯') FROM `‚s‚W`; +INSERT(`‚b‚P`,3,2,'‚­‚¯') +‚ ‚¢‚­‚¯‚¨ +SELECT INSERT(`‚b‚P`,3,3,'‚­‚¯‚±') FROM `‚s‚W`; +INSERT(`‚b‚P`,3,3,'‚­‚¯‚±') +‚ ‚¢‚­‚¯‚± +SELECT INSERT(`‚b‚P`,4,1,'‚¯') FROM `‚s‚W`; +INSERT(`‚b‚P`,4,1,'‚¯') +‚ ‚¢‚¤‚¯‚¨ +SELECT INSERT(`‚b‚P`,4,2,'‚¯‚±') FROM `‚s‚W`; +INSERT(`‚b‚P`,4,2,'‚¯‚±') +‚ ‚¢‚¤‚¯‚± +SELECT INSERT(`‚b‚P`,5,1,'‚±') FROM `‚s‚W`; +INSERT(`‚b‚P`,5,1,'‚±') +‚ ‚¢‚¤‚¦‚± +SELECT INSERT(`‚b‚P`,1,1,'@') FROM `‚s‚W`; +INSERT(`‚b‚P`,1,1,'@') +@‚¢‚¤‚¦‚¨ +SELECT INSERT(`‚b‚P`,1,2,'@@') FROM `‚s‚W`; +INSERT(`‚b‚P`,1,2,'@@') +@@‚¤‚¦‚¨ +SELECT INSERT(`‚b‚P`,1,3,'@@@') FROM `‚s‚W`; +INSERT(`‚b‚P`,1,3,'@@@') +@@@‚¦‚¨ +SELECT INSERT(`‚b‚P`,1,4,'@@@@') FROM `‚s‚W`; +INSERT(`‚b‚P`,1,4,'@@@@') +@@@@‚¨ +SELECT INSERT(`‚b‚P`,1,5,'@@@@@') FROM `‚s‚W`; +INSERT(`‚b‚P`,1,5,'@@@@@') +@@@@@ +SELECT INSERT(`‚b‚P`,2,1,'@') FROM `‚s‚W`; +INSERT(`‚b‚P`,2,1,'@') +‚ @‚¤‚¦‚¨ +SELECT INSERT(`‚b‚P`,2,2,'@@') FROM `‚s‚W`; +INSERT(`‚b‚P`,2,2,'@@') +‚ @@‚¦‚¨ +SELECT INSERT(`‚b‚P`,2,3,'@@@') FROM `‚s‚W`; +INSERT(`‚b‚P`,2,3,'@@@') +‚ @@@‚¨ +SELECT INSERT(`‚b‚P`,2,4,'@@@@') FROM `‚s‚W`; +INSERT(`‚b‚P`,2,4,'@@@@') +‚ @@@@ +SELECT INSERT(`‚b‚P`,3,1,'@') FROM `‚s‚W`; +INSERT(`‚b‚P`,3,1,'@') +‚ ‚¢@‚¦‚¨ +SELECT INSERT(`‚b‚P`,3,2,'@@') FROM `‚s‚W`; +INSERT(`‚b‚P`,3,2,'@@') +‚ ‚¢@@‚¨ +SELECT INSERT(`‚b‚P`,3,3,'@@@') FROM `‚s‚W`; +INSERT(`‚b‚P`,3,3,'@@@') +‚ ‚¢@@@ +SELECT INSERT(`‚b‚P`,4,1,'@') FROM `‚s‚W`; +INSERT(`‚b‚P`,4,1,'@') +‚ ‚¢‚¤@‚¨ +SELECT INSERT(`‚b‚P`,4,2,'@@') FROM `‚s‚W`; +INSERT(`‚b‚P`,4,2,'@@') +‚ ‚¢‚¤@@ +SELECT INSERT(`‚b‚P`,5,1,'@') FROM `‚s‚W`; +INSERT(`‚b‚P`,5,1,'@') +‚ ‚¢‚¤‚¦@ +SELECT INSERT(`‚b‚P`,1,1,'”\') FROM `‚s‚X`; +INSERT(`‚b‚P`,1,1,'”\') +”\\•\—\\ +SELECT INSERT(`‚b‚P`,1,2,'”\”\' ) FROM `‚s‚X`; +INSERT(`‚b‚P`,1,2,'”\”\' ) +”\”\•\—\\ +SELECT INSERT(`‚b‚P`,1,3,'”\”\”\' ) FROM `‚s‚X`; +INSERT(`‚b‚P`,1,3,'”\”\”\' ) +”\”\”\—\\ +SELECT INSERT(`‚b‚P`,1,4,'”\”\”\”\' ) FROM `‚s‚X`; +INSERT(`‚b‚P`,1,4,'”\”\”\”\' ) +”\”\”\”\\ +SELECT INSERT(`‚b‚P`,1,5,'”\”\”\”\”\' ) FROM `‚s‚X`; +INSERT(`‚b‚P`,1,5,'”\”\”\”\”\' ) +”\”\”\”\”\ +SELECT INSERT(`‚b‚P`,2,1,'”\') FROM `‚s‚X`; +INSERT(`‚b‚P`,2,1,'”\') +ƒ\”\•\—\\ +SELECT INSERT(`‚b‚P`,2,2,'”\”\' ) FROM `‚s‚X`; +INSERT(`‚b‚P`,2,2,'”\”\' ) +ƒ\”\”\—\\ +SELECT INSERT(`‚b‚P`,2,3,'”\”\”\' ) FROM `‚s‚X`; +INSERT(`‚b‚P`,2,3,'”\”\”\' ) +ƒ\”\”\”\\ +SELECT INSERT(`‚b‚P`,2,4,'”\”\”\”\' ) FROM `‚s‚X`; +INSERT(`‚b‚P`,2,4,'”\”\”\”\' ) +ƒ\”\”\”\”\ +SELECT INSERT(`‚b‚P`,3,1,'”\') FROM `‚s‚X`; +INSERT(`‚b‚P`,3,1,'”\') +ƒ\\”\—\\ +SELECT INSERT(`‚b‚P`,3,2,'”\”\' ) FROM `‚s‚X`; +INSERT(`‚b‚P`,3,2,'”\”\' ) +ƒ\\”\”\\ +SELECT INSERT(`‚b‚P`,3,3,'”\”\”\' ) FROM `‚s‚X`; +INSERT(`‚b‚P`,3,3,'”\”\”\' ) +ƒ\\”\”\”\ +SELECT INSERT(`‚b‚P`,4,1,'”\') FROM `‚s‚X`; +INSERT(`‚b‚P`,4,1,'”\') +ƒ\\•\”\\ +SELECT INSERT(`‚b‚P`,4,2,'”\”\' ) FROM `‚s‚X`; +INSERT(`‚b‚P`,4,2,'”\”\' ) +ƒ\\•\”\”\ +SELECT INSERT(`‚b‚P`,5,1,'”\') FROM `‚s‚X`; +INSERT(`‚b‚P`,5,1,'”\') +ƒ\\•\—\”\ +SELECT INSERT(`‚b‚P`,1,1,'¶') FROM `‚s‚P‚O`; +INSERT(`‚b‚P`,1,1,'¶') +¶²³´µ +SELECT INSERT(`‚b‚P`,1,2,'¶·') FROM `‚s‚P‚O`; +INSERT(`‚b‚P`,1,2,'¶·') +¶·³´µ +SELECT INSERT(`‚b‚P`,1,3,'¶·¸') FROM `‚s‚P‚O`; +INSERT(`‚b‚P`,1,3,'¶·¸') +¶·¸´µ +SELECT INSERT(`‚b‚P`,1,4,'¶·¸¹') FROM `‚s‚P‚O`; +INSERT(`‚b‚P`,1,4,'¶·¸¹') +¶·¸¹µ +SELECT INSERT(`‚b‚P`,1,5,'¶·¸¹º') FROM `‚s‚P‚O`; +INSERT(`‚b‚P`,1,5,'¶·¸¹º') +¶·¸¹º +SELECT INSERT(`‚b‚P`,2,1,'·') FROM `‚s‚P‚O`; +INSERT(`‚b‚P`,2,1,'·') +±·³´µ +SELECT INSERT(`‚b‚P`,2,2,'·¸') FROM `‚s‚P‚O`; +INSERT(`‚b‚P`,2,2,'·¸') +±·¸´µ +SELECT INSERT(`‚b‚P`,2,3,'·¸¹') FROM `‚s‚P‚O`; +INSERT(`‚b‚P`,2,3,'·¸¹') +±·¸¹µ +SELECT INSERT(`‚b‚P`,2,4,'·¸¹º') FROM `‚s‚P‚O`; +INSERT(`‚b‚P`,2,4,'·¸¹º') +±·¸¹º +SELECT INSERT(`‚b‚P`,3,1,'¸') FROM `‚s‚P‚O`; +INSERT(`‚b‚P`,3,1,'¸') +±²¸´µ +SELECT INSERT(`‚b‚P`,3,2,'¸¹') FROM `‚s‚P‚O`; +INSERT(`‚b‚P`,3,2,'¸¹') +±²¸¹µ +SELECT INSERT(`‚b‚P`,3,3,'¸¹º') FROM `‚s‚P‚O`; +INSERT(`‚b‚P`,3,3,'¸¹º') +±²¸¹º +SELECT INSERT(`‚b‚P`,4,1,'¹') FROM `‚s‚P‚O`; +INSERT(`‚b‚P`,4,1,'¹') +±²³¹µ +SELECT INSERT(`‚b‚P`,4,2,'¹º') FROM `‚s‚P‚O`; +INSERT(`‚b‚P`,4,2,'¹º') +±²³¹º +SELECT INSERT(`‚b‚P`,5,1,'º') FROM `‚s‚P‚O`; +INSERT(`‚b‚P`,5,1,'º') +±²³´º +SELECT INSERT(`‚b‚P`,1,1,'‚©') FROM `‚s‚P‚P`; +INSERT(`‚b‚P`,1,1,'‚©') +‚©‚¢‚¤‚¦‚¨ +SELECT INSERT(`‚b‚P`,1,2,'‚©‚«') FROM `‚s‚P‚P`; +INSERT(`‚b‚P`,1,2,'‚©‚«') +‚©‚«‚¤‚¦‚¨ +SELECT INSERT(`‚b‚P`,1,3,'‚©‚«‚­') FROM `‚s‚P‚P`; +INSERT(`‚b‚P`,1,3,'‚©‚«‚­') +‚©‚«‚­‚¦‚¨ +SELECT INSERT(`‚b‚P`,1,4,'‚©‚«‚­‚¯') FROM `‚s‚P‚P`; +INSERT(`‚b‚P`,1,4,'‚©‚«‚­‚¯') +‚©‚«‚­‚¯‚¨ +SELECT INSERT(`‚b‚P`,1,5,'‚©‚«‚­‚¯‚±') FROM `‚s‚P‚P`; +INSERT(`‚b‚P`,1,5,'‚©‚«‚­‚¯‚±') +‚©‚«‚­‚¯‚± +SELECT INSERT(`‚b‚P`,2,1,'‚«') FROM `‚s‚P‚P`; +INSERT(`‚b‚P`,2,1,'‚«') +‚ ‚«‚¤‚¦‚¨ +SELECT INSERT(`‚b‚P`,2,2,'‚«‚­') FROM `‚s‚P‚P`; +INSERT(`‚b‚P`,2,2,'‚«‚­') +‚ ‚«‚­‚¦‚¨ +SELECT INSERT(`‚b‚P`,2,3,'‚«‚­‚¯') FROM `‚s‚P‚P`; +INSERT(`‚b‚P`,2,3,'‚«‚­‚¯') +‚ ‚«‚­‚¯‚¨ +SELECT INSERT(`‚b‚P`,2,4,'‚«‚­‚¯‚±') FROM `‚s‚P‚P`; +INSERT(`‚b‚P`,2,4,'‚«‚­‚¯‚±') +‚ ‚«‚­‚¯‚± +SELECT INSERT(`‚b‚P`,3,1,'‚­') FROM `‚s‚P‚P`; +INSERT(`‚b‚P`,3,1,'‚­') +‚ ‚¢‚­‚¦‚¨ +SELECT INSERT(`‚b‚P`,3,2,'‚­‚¯') FROM `‚s‚P‚P`; +INSERT(`‚b‚P`,3,2,'‚­‚¯') +‚ ‚¢‚­‚¯‚¨ +SELECT INSERT(`‚b‚P`,3,3,'‚­‚¯‚±') FROM `‚s‚P‚P`; +INSERT(`‚b‚P`,3,3,'‚­‚¯‚±') +‚ ‚¢‚­‚¯‚± +SELECT INSERT(`‚b‚P`,4,1,'‚¯') FROM `‚s‚P‚P`; +INSERT(`‚b‚P`,4,1,'‚¯') +‚ ‚¢‚¤‚¯‚¨ +SELECT INSERT(`‚b‚P`,4,2,'‚¯‚±') FROM `‚s‚P‚P`; +INSERT(`‚b‚P`,4,2,'‚¯‚±') +‚ ‚¢‚¤‚¯‚± +SELECT INSERT(`‚b‚P`,5,1,'‚±') FROM `‚s‚P‚P`; +INSERT(`‚b‚P`,5,1,'‚±') +‚ ‚¢‚¤‚¦‚± +SELECT INSERT(`‚b‚P`,1,1,'@') FROM `‚s‚P‚P`; +INSERT(`‚b‚P`,1,1,'@') +@‚¢‚¤‚¦‚¨ +SELECT INSERT(`‚b‚P`,1,2,'@@') FROM `‚s‚P‚P`; +INSERT(`‚b‚P`,1,2,'@@') +@@‚¤‚¦‚¨ +SELECT INSERT(`‚b‚P`,1,3,'@@@') FROM `‚s‚P‚P`; +INSERT(`‚b‚P`,1,3,'@@@') +@@@‚¦‚¨ +SELECT INSERT(`‚b‚P`,1,4,'@@@@') FROM `‚s‚P‚P`; +INSERT(`‚b‚P`,1,4,'@@@@') +@@@@‚¨ +SELECT INSERT(`‚b‚P`,1,5,'@@@@@') FROM `‚s‚P‚P`; +INSERT(`‚b‚P`,1,5,'@@@@@') +@@@@@ +SELECT INSERT(`‚b‚P`,2,1,'@') FROM `‚s‚P‚P`; +INSERT(`‚b‚P`,2,1,'@') +‚ @‚¤‚¦‚¨ +SELECT INSERT(`‚b‚P`,2,2,'@@') FROM `‚s‚P‚P`; +INSERT(`‚b‚P`,2,2,'@@') +‚ @@‚¦‚¨ +SELECT INSERT(`‚b‚P`,2,3,'@@@') FROM `‚s‚P‚P`; +INSERT(`‚b‚P`,2,3,'@@@') +‚ @@@‚¨ +SELECT INSERT(`‚b‚P`,2,4,'@@@@') FROM `‚s‚P‚P`; +INSERT(`‚b‚P`,2,4,'@@@@') +‚ @@@@ +SELECT INSERT(`‚b‚P`,3,1,'@') FROM `‚s‚P‚P`; +INSERT(`‚b‚P`,3,1,'@') +‚ ‚¢@‚¦‚¨ +SELECT INSERT(`‚b‚P`,3,2,'@@') FROM `‚s‚P‚P`; +INSERT(`‚b‚P`,3,2,'@@') +‚ ‚¢@@‚¨ +SELECT INSERT(`‚b‚P`,3,3,'@@@') FROM `‚s‚P‚P`; +INSERT(`‚b‚P`,3,3,'@@@') +‚ ‚¢@@@ +SELECT INSERT(`‚b‚P`,4,1,'@') FROM `‚s‚P‚P`; +INSERT(`‚b‚P`,4,1,'@') +‚ ‚¢‚¤@‚¨ +SELECT INSERT(`‚b‚P`,4,2,'@@') FROM `‚s‚P‚P`; +INSERT(`‚b‚P`,4,2,'@@') +‚ ‚¢‚¤@@ +SELECT INSERT(`‚b‚P`,5,1,'@') FROM `‚s‚P‚P`; +INSERT(`‚b‚P`,5,1,'@') +‚ ‚¢‚¤‚¦@ +SELECT INSERT(`‚b‚P`,1,1,'”\') FROM `‚s‚P‚Q`; +INSERT(`‚b‚P`,1,1,'”\') +”\\•\—\\ +SELECT INSERT(`‚b‚P`,1,2,'”\”\') FROM `‚s‚P‚Q`; +INSERT(`‚b‚P`,1,2,'”\”\') +”\”\•\—\\ +SELECT INSERT(`‚b‚P`,1,3,'”\”\”\') FROM `‚s‚P‚Q`; +INSERT(`‚b‚P`,1,3,'”\”\”\') +”\”\”\—\\ +SELECT INSERT(`‚b‚P`,1,4,'”\”\”\”\') FROM `‚s‚P‚Q`; +INSERT(`‚b‚P`,1,4,'”\”\”\”\') +”\”\”\”\\ +SELECT INSERT(`‚b‚P`,1,5,'”\”\”\”\”\') FROM `‚s‚P‚Q`; +INSERT(`‚b‚P`,1,5,'”\”\”\”\”\') +”\”\”\”\”\ +SELECT INSERT(`‚b‚P`,2,1,'”\') FROM `‚s‚P‚Q`; +INSERT(`‚b‚P`,2,1,'”\') +ƒ\”\•\—\\ +SELECT INSERT(`‚b‚P`,2,2,'”\”\') FROM `‚s‚P‚Q`; +INSERT(`‚b‚P`,2,2,'”\”\') +ƒ\”\”\—\\ +SELECT INSERT(`‚b‚P`,2,3,'”\”\”\') FROM `‚s‚P‚Q`; +INSERT(`‚b‚P`,2,3,'”\”\”\') +ƒ\”\”\”\\ +SELECT INSERT(`‚b‚P`,2,4,'”\”\”\”\') FROM `‚s‚P‚Q`; +INSERT(`‚b‚P`,2,4,'”\”\”\”\') +ƒ\”\”\”\”\ +SELECT INSERT(`‚b‚P`,3,1,'”\') FROM `‚s‚P‚Q`; +INSERT(`‚b‚P`,3,1,'”\') +ƒ\\”\—\\ +SELECT INSERT(`‚b‚P`,3,2,'”\”\') FROM `‚s‚P‚Q`; +INSERT(`‚b‚P`,3,2,'”\”\') +ƒ\\”\”\\ +SELECT INSERT(`‚b‚P`,3,3,'”\”\”\') FROM `‚s‚P‚Q`; +INSERT(`‚b‚P`,3,3,'”\”\”\') +ƒ\\”\”\”\ +SELECT INSERT(`‚b‚P`,4,1,'”\') FROM `‚s‚P‚Q`; +INSERT(`‚b‚P`,4,1,'”\') +ƒ\\•\”\\ +SELECT INSERT(`‚b‚P`,4,2,'”\”\') FROM `‚s‚P‚Q`; +INSERT(`‚b‚P`,4,2,'”\”\') +ƒ\\•\”\”\ +SELECT INSERT(`‚b‚P`,5,1,'”\') FROM `‚s‚P‚Q`; +INSERT(`‚b‚P`,5,1,'”\') +ƒ\\•\—\”\ +DROP TABLE `‚s‚P`; +DROP TABLE `‚s‚Q`; +DROP TABLE `‚s‚R`; +DROP TABLE `‚s‚S`; +DROP TABLE `‚s‚T`; +DROP TABLE `‚s‚U`; +DROP TABLE `‚s‚V`; +DROP TABLE `‚s‚W`; +DROP TABLE `‚s‚X`; +DROP TABLE `‚s‚P‚O`; +DROP TABLE `‚s‚P‚P`; +DROP TABLE `‚s‚P‚Q`; diff --git a/mysql-test/suite/jp/r/jp_insert_ucs2.result b/mysql-test/suite/jp/r/jp_insert_ucs2.result new file mode 100755 index 00000000000..45487f65138 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_insert_ucs2.result @@ -0,0 +1,906 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; +CREATE TABLE `£Ô£±` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = bdb; +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'); +SELECT INSERT(`£Ã£±`,1,1,'޶') FROM `£Ô£±`; +INSERT(`£Ã£±`,1,1,'޶') +޶޲޳޴޵ +SELECT INSERT(`£Ã£±`,1,2,'޶޶') FROM `£Ô£±`; +INSERT(`£Ã£±`,1,2,'޶޶') +޶޶޳޴޵ +SELECT INSERT(`£Ã£±`,1,3,'޶޶޶') FROM `£Ô£±`; +INSERT(`£Ã£±`,1,3,'޶޶޶') +޶޶޶޴޵ +SELECT INSERT(`£Ã£±`,1,4,'޶޶޶޶') FROM `£Ô£±`; +INSERT(`£Ã£±`,1,4,'޶޶޶޶') +޶޶޶޶޵ +SELECT INSERT(`£Ã£±`,1,5,'޶޶޶޶޶') FROM `£Ô£±`; +INSERT(`£Ã£±`,1,5,'޶޶޶޶޶') +޶޶޶޶޶ +SELECT INSERT(`£Ã£±`,2,1,'޶') FROM `£Ô£±`; +INSERT(`£Ã£±`,2,1,'޶') +ޱ޶޳޴޵ +SELECT INSERT(`£Ã£±`,2,2,'޶޶') FROM `£Ô£±`; +INSERT(`£Ã£±`,2,2,'޶޶') +ޱ޶޶޴޵ +SELECT INSERT(`£Ã£±`,2,3,'޶޶޶') FROM `£Ô£±`; +INSERT(`£Ã£±`,2,3,'޶޶޶') +ޱ޶޶޶޵ +SELECT INSERT(`£Ã£±`,2,4,'޶޶޶޶') FROM `£Ô£±`; +INSERT(`£Ã£±`,2,4,'޶޶޶޶') +ޱ޶޶޶޶ +SELECT INSERT(`£Ã£±`,3,1,'޶') FROM `£Ô£±`; +INSERT(`£Ã£±`,3,1,'޶') +ޱ޲޶޴޵ +SELECT INSERT(`£Ã£±`,3,2,'޶޶') FROM `£Ô£±`; +INSERT(`£Ã£±`,3,2,'޶޶') +ޱ޲޶޶޵ +SELECT INSERT(`£Ã£±`,3,3,'޶޶޶') FROM `£Ô£±`; +INSERT(`£Ã£±`,3,3,'޶޶޶') +ޱ޲޶޶޶ +SELECT INSERT(`£Ã£±`,4,1,'޶') FROM `£Ô£±`; +INSERT(`£Ã£±`,4,1,'޶') +ޱ޲޳޶޵ +SELECT INSERT(`£Ã£±`,4,2,'޶޶') FROM `£Ô£±`; +INSERT(`£Ã£±`,4,2,'޶޶') +ޱ޲޳޶޶ +SELECT INSERT(`£Ã£±`,5,1,'޶') FROM `£Ô£±`; +INSERT(`£Ã£±`,5,1,'޶') +ޱ޲޳޴޶ +SELECT INSERT(`£Ã£±`,1,1,' ') FROM `£Ô£±`; +INSERT(`£Ã£±`,1,1,' ') + ޲޳޴޵ +SELECT INSERT(`£Ã£±`,1,2,' ') FROM `£Ô£±`; +INSERT(`£Ã£±`,1,2,' ') + ޳޴޵ +SELECT INSERT(`£Ã£±`,1,3,' ') FROM `£Ô£±`; +INSERT(`£Ã£±`,1,3,' ') + ޴޵ +SELECT INSERT(`£Ã£±`,1,4,' ') FROM `£Ô£±`; +INSERT(`£Ã£±`,1,4,' ') + ޵ +SELECT INSERT(`£Ã£±`,1,5,' ') FROM `£Ô£±`; +INSERT(`£Ã£±`,1,5,' ') + +SELECT INSERT(`£Ã£±`,2,1,' ') FROM `£Ô£±`; +INSERT(`£Ã£±`,2,1,' ') +ޱ ޳޴޵ +SELECT INSERT(`£Ã£±`,2,2,' ') FROM `£Ô£±`; +INSERT(`£Ã£±`,2,2,' ') +ޱ ޴޵ +SELECT INSERT(`£Ã£±`,2,3,' ') FROM `£Ô£±`; +INSERT(`£Ã£±`,2,3,' ') +ޱ ޵ +SELECT INSERT(`£Ã£±`,2,4,' ') FROM `£Ô£±`; +INSERT(`£Ã£±`,2,4,' ') +ޱ +SELECT INSERT(`£Ã£±`,3,1,' ') FROM `£Ô£±`; +INSERT(`£Ã£±`,3,1,' ') +ޱ޲ ޴޵ +SELECT INSERT(`£Ã£±`,3,2,' ') FROM `£Ô£±`; +INSERT(`£Ã£±`,3,2,' ') +ޱ޲ ޵ +SELECT INSERT(`£Ã£±`,3,3,' ') FROM `£Ô£±`; +INSERT(`£Ã£±`,3,3,' ') +ޱ޲ +SELECT INSERT(`£Ã£±`,4,1,' ') FROM `£Ô£±`; +INSERT(`£Ã£±`,4,1,' ') +ޱ޲޳ ޵ +SELECT INSERT(`£Ã£±`,4,2,' ') FROM `£Ô£±`; +INSERT(`£Ã£±`,4,2,' ') +ޱ޲޳ +SELECT INSERT(`£Ã£±`,5,1,' ') FROM `£Ô£±`; +INSERT(`£Ã£±`,5,1,' ') +ޱ޲޳޴ +SELECT INSERT(`£Ã£±`,1,1,'¤«') FROM `£Ô£²`; +INSERT(`£Ã£±`,1,1,'¤«') +¤«¤¤¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,1,2,'¤«¤«') FROM `£Ô£²`; +INSERT(`£Ã£±`,1,2,'¤«¤«') +¤«¤«¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,1,3,'¤«¤«¤«') FROM `£Ô£²`; +INSERT(`£Ã£±`,1,3,'¤«¤«¤«') +¤«¤«¤«¤¨¤ª +SELECT INSERT(`£Ã£±`,1,4,'¤«¤«¤«¤«') FROM `£Ô£²`; +INSERT(`£Ã£±`,1,4,'¤«¤«¤«¤«') +¤«¤«¤«¤«¤ª +SELECT INSERT(`£Ã£±`,1,5,'¤«¤«¤«¤«¤«') FROM `£Ô£²`; +INSERT(`£Ã£±`,1,5,'¤«¤«¤«¤«¤«') +¤«¤«¤«¤«¤« +SELECT INSERT(`£Ã£±`,2,1,'¤«') FROM `£Ô£²`; +INSERT(`£Ã£±`,2,1,'¤«') +¤¢¤«¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,2,2,'¤«¤«') FROM `£Ô£²`; +INSERT(`£Ã£±`,2,2,'¤«¤«') +¤¢¤«¤«¤¨¤ª +SELECT INSERT(`£Ã£±`,2,3,'¤«¤«¤«') FROM `£Ô£²`; +INSERT(`£Ã£±`,2,3,'¤«¤«¤«') +¤¢¤«¤«¤«¤ª +SELECT INSERT(`£Ã£±`,2,4,'¤«¤«¤«¤«') FROM `£Ô£²`; +INSERT(`£Ã£±`,2,4,'¤«¤«¤«¤«') +¤¢¤«¤«¤«¤« +SELECT INSERT(`£Ã£±`,3,1,'¤«') FROM `£Ô£²`; +INSERT(`£Ã£±`,3,1,'¤«') +¤¢¤¤¤«¤¨¤ª +SELECT INSERT(`£Ã£±`,3,2,'¤«¤«') FROM `£Ô£²`; +INSERT(`£Ã£±`,3,2,'¤«¤«') +¤¢¤¤¤«¤«¤ª +SELECT INSERT(`£Ã£±`,3,3,'¤«¤«¤«') FROM `£Ô£²`; +INSERT(`£Ã£±`,3,3,'¤«¤«¤«') +¤¢¤¤¤«¤«¤« +SELECT INSERT(`£Ã£±`,4,1,'¤«') FROM `£Ô£²`; +INSERT(`£Ã£±`,4,1,'¤«') +¤¢¤¤¤¦¤«¤ª +SELECT INSERT(`£Ã£±`,4,2,'¤«¤«') FROM `£Ô£²`; +INSERT(`£Ã£±`,4,2,'¤«¤«') +¤¢¤¤¤¦¤«¤« +SELECT INSERT(`£Ã£±`,5,1,'¤«') FROM `£Ô£²`; +INSERT(`£Ã£±`,5,1,'¤«') +¤¢¤¤¤¦¤¨¤« +SELECT INSERT(`£Ã£±`,1,1,'¡¡') FROM `£Ô£²`; +INSERT(`£Ã£±`,1,1,'¡¡') +¡¡¤¤¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,1,2,'¡¡¡¡') FROM `£Ô£²`; +INSERT(`£Ã£±`,1,2,'¡¡¡¡') +¡¡¡¡¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,1,3,'¡¡¡¡¡¡') FROM `£Ô£²`; +INSERT(`£Ã£±`,1,3,'¡¡¡¡¡¡') +¡¡¡¡¡¡¤¨¤ª +SELECT INSERT(`£Ã£±`,1,4,'¡¡¡¡¡¡¡¡') FROM `£Ô£²`; +INSERT(`£Ã£±`,1,4,'¡¡¡¡¡¡¡¡') +¡¡¡¡¡¡¡¡¤ª +SELECT INSERT(`£Ã£±`,1,5,'¡¡¡¡¡¡¡¡¡¡') FROM `£Ô£²`; +INSERT(`£Ã£±`,1,5,'¡¡¡¡¡¡¡¡¡¡') +¡¡¡¡¡¡¡¡¡¡ +SELECT INSERT(`£Ã£±`,2,1,'¡¡') FROM `£Ô£²`; +INSERT(`£Ã£±`,2,1,'¡¡') +¤¢¡¡¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,2,2,'¡¡¡¡') FROM `£Ô£²`; +INSERT(`£Ã£±`,2,2,'¡¡¡¡') +¤¢¡¡¡¡¤¨¤ª +SELECT INSERT(`£Ã£±`,2,3,'¡¡¡¡¡¡') FROM `£Ô£²`; +INSERT(`£Ã£±`,2,3,'¡¡¡¡¡¡') +¤¢¡¡¡¡¡¡¤ª +SELECT INSERT(`£Ã£±`,2,4,'¡¡¡¡¡¡¡¡') FROM `£Ô£²`; +INSERT(`£Ã£±`,2,4,'¡¡¡¡¡¡¡¡') +¤¢¡¡¡¡¡¡¡¡ +SELECT INSERT(`£Ã£±`,3,1,'¡¡') FROM `£Ô£²`; +INSERT(`£Ã£±`,3,1,'¡¡') +¤¢¤¤¡¡¤¨¤ª +SELECT INSERT(`£Ã£±`,3,2,'¡¡¡¡') FROM `£Ô£²`; +INSERT(`£Ã£±`,3,2,'¡¡¡¡') +¤¢¤¤¡¡¡¡¤ª +SELECT INSERT(`£Ã£±`,3,3,'¡¡¡¡¡¡') FROM `£Ô£²`; +INSERT(`£Ã£±`,3,3,'¡¡¡¡¡¡') +¤¢¤¤¡¡¡¡¡¡ +SELECT INSERT(`£Ã£±`,4,1,'¡¡') FROM `£Ô£²`; +INSERT(`£Ã£±`,4,1,'¡¡') +¤¢¤¤¤¦¡¡¤ª +SELECT INSERT(`£Ã£±`,4,2,'¡¡¡¡') FROM `£Ô£²`; +INSERT(`£Ã£±`,4,2,'¡¡¡¡') +¤¢¤¤¤¦¡¡¡¡ +SELECT INSERT(`£Ã£±`,5,1,'¡¡') FROM `£Ô£²`; +INSERT(`£Ã£±`,5,1,'¡¡') +¤¢¤¤¤¦¤¨¡¡ +SELECT INSERT(`£Ã£±`,1,1,'°¡') FROM `£Ô£³`; +INSERT(`£Ã£±`,1,1,'°¡') +°¡íÝíÞíßíà +SELECT INSERT(`£Ã£±`,1,2,'°¡°¡' ) FROM `£Ô£³`; +INSERT(`£Ã£±`,1,2,'°¡°¡' ) +°¡°¡íÞíßíà +SELECT INSERT(`£Ã£±`,1,3,'°¡°¡°¡' ) FROM `£Ô£³`; +INSERT(`£Ã£±`,1,3,'°¡°¡°¡' ) +°¡°¡°¡íßíà +SELECT INSERT(`£Ã£±`,1,4,'°¡°¡°¡°¡' ) FROM `£Ô£³`; +INSERT(`£Ã£±`,1,4,'°¡°¡°¡°¡' ) +°¡°¡°¡°¡íà +SELECT INSERT(`£Ã£±`,1,5,'°¡°¡°¡°¡°¡' ) FROM `£Ô£³`; +INSERT(`£Ã£±`,1,5,'°¡°¡°¡°¡°¡' ) +°¡°¡°¡°¡°¡ +SELECT INSERT(`£Ã£±`,2,1,'°¡') FROM `£Ô£³`; +INSERT(`£Ã£±`,2,1,'°¡') +íܰ¡íÞíßíà +SELECT INSERT(`£Ã£±`,2,2,'°¡°¡' ) FROM `£Ô£³`; +INSERT(`£Ã£±`,2,2,'°¡°¡' ) +íܰ¡°¡íßíà +SELECT INSERT(`£Ã£±`,2,3,'°¡°¡°¡' ) FROM `£Ô£³`; +INSERT(`£Ã£±`,2,3,'°¡°¡°¡' ) +íܰ¡°¡°¡íà +SELECT INSERT(`£Ã£±`,2,4,'°¡°¡°¡°¡' ) FROM `£Ô£³`; +INSERT(`£Ã£±`,2,4,'°¡°¡°¡°¡' ) +íܰ¡°¡°¡°¡ +SELECT INSERT(`£Ã£±`,3,1,'°¡') FROM `£Ô£³`; +INSERT(`£Ã£±`,3,1,'°¡') +íÜíݰ¡íßíà +SELECT INSERT(`£Ã£±`,3,2,'°¡°¡' ) FROM `£Ô£³`; +INSERT(`£Ã£±`,3,2,'°¡°¡' ) +íÜíݰ¡°¡íà +SELECT INSERT(`£Ã£±`,3,3,'°¡°¡°¡' ) FROM `£Ô£³`; +INSERT(`£Ã£±`,3,3,'°¡°¡°¡' ) +íÜíݰ¡°¡°¡ +SELECT INSERT(`£Ã£±`,4,1,'°¡') FROM `£Ô£³`; +INSERT(`£Ã£±`,4,1,'°¡') +íÜíÝíÞ°¡íà +SELECT INSERT(`£Ã£±`,4,2,'°¡°¡' ) FROM `£Ô£³`; +INSERT(`£Ã£±`,4,2,'°¡°¡' ) +íÜíÝíÞ°¡°¡ +SELECT INSERT(`£Ã£±`,5,1,'°¡') FROM `£Ô£³`; +INSERT(`£Ã£±`,5,1,'°¡') +íÜíÝíÞíß°¡ +SELECT INSERT(`£Ã£±`,1,1,'޶') FROM `£Ô£´`; +INSERT(`£Ã£±`,1,1,'޶') +޶޲޳޴޵ +SELECT INSERT(`£Ã£±`,1,2,'޶޶') FROM `£Ô£´`; +INSERT(`£Ã£±`,1,2,'޶޶') +޶޶޳޴޵ +SELECT INSERT(`£Ã£±`,1,3,'޶޶޶') FROM `£Ô£´`; +INSERT(`£Ã£±`,1,3,'޶޶޶') +޶޶޶޴޵ +SELECT INSERT(`£Ã£±`,1,4,'޶޶޶޶') FROM `£Ô£´`; +INSERT(`£Ã£±`,1,4,'޶޶޶޶') +޶޶޶޶޵ +SELECT INSERT(`£Ã£±`,1,5,'޶޶޶޶޶') FROM `£Ô£´`; +INSERT(`£Ã£±`,1,5,'޶޶޶޶޶') +޶޶޶޶޶ +SELECT INSERT(`£Ã£±`,2,1,'޶') FROM `£Ô£´`; +INSERT(`£Ã£±`,2,1,'޶') +ޱ޶޳޴޵ +SELECT INSERT(`£Ã£±`,2,2,'޶޶') FROM `£Ô£´`; +INSERT(`£Ã£±`,2,2,'޶޶') +ޱ޶޶޴޵ +SELECT INSERT(`£Ã£±`,2,3,'޶޶޶') FROM `£Ô£´`; +INSERT(`£Ã£±`,2,3,'޶޶޶') +ޱ޶޶޶޵ +SELECT INSERT(`£Ã£±`,2,4,'޶޶޶޶') FROM `£Ô£´`; +INSERT(`£Ã£±`,2,4,'޶޶޶޶') +ޱ޶޶޶޶ +SELECT INSERT(`£Ã£±`,3,1,'޶') FROM `£Ô£´`; +INSERT(`£Ã£±`,3,1,'޶') +ޱ޲޶޴޵ +SELECT INSERT(`£Ã£±`,3,2,'޶޶') FROM `£Ô£´`; +INSERT(`£Ã£±`,3,2,'޶޶') +ޱ޲޶޶޵ +SELECT INSERT(`£Ã£±`,3,3,'޶޶޶') FROM `£Ô£´`; +INSERT(`£Ã£±`,3,3,'޶޶޶') +ޱ޲޶޶޶ +SELECT INSERT(`£Ã£±`,4,1,'޶') FROM `£Ô£´`; +INSERT(`£Ã£±`,4,1,'޶') +ޱ޲޳޶޵ +SELECT INSERT(`£Ã£±`,4,2,'޶޶') FROM `£Ô£´`; +INSERT(`£Ã£±`,4,2,'޶޶') +ޱ޲޳޶޶ +SELECT INSERT(`£Ã£±`,5,1,'޶') FROM `£Ô£´`; +INSERT(`£Ã£±`,5,1,'޶') +ޱ޲޳޴޶ +SELECT INSERT(`£Ã£±`,1,1,' ') FROM `£Ô£´`; +INSERT(`£Ã£±`,1,1,' ') + ޲޳޴޵ +SELECT INSERT(`£Ã£±`,1,2,' ') FROM `£Ô£´`; +INSERT(`£Ã£±`,1,2,' ') + ޳޴޵ +SELECT INSERT(`£Ã£±`,1,3,' ') FROM `£Ô£´`; +INSERT(`£Ã£±`,1,3,' ') + ޴޵ +SELECT INSERT(`£Ã£±`,1,4,' ') FROM `£Ô£´`; +INSERT(`£Ã£±`,1,4,' ') + ޵ +SELECT INSERT(`£Ã£±`,1,5,' ') FROM `£Ô£´`; +INSERT(`£Ã£±`,1,5,' ') + +SELECT INSERT(`£Ã£±`,2,1,' ') FROM `£Ô£´`; +INSERT(`£Ã£±`,2,1,' ') +ޱ ޳޴޵ +SELECT INSERT(`£Ã£±`,2,2,' ') FROM `£Ô£´`; +INSERT(`£Ã£±`,2,2,' ') +ޱ ޴޵ +SELECT INSERT(`£Ã£±`,2,3,' ') FROM `£Ô£´`; +INSERT(`£Ã£±`,2,3,' ') +ޱ ޵ +SELECT INSERT(`£Ã£±`,2,4,' ') FROM `£Ô£´`; +INSERT(`£Ã£±`,2,4,' ') +ޱ +SELECT INSERT(`£Ã£±`,3,1,' ') FROM `£Ô£´`; +INSERT(`£Ã£±`,3,1,' ') +ޱ޲ ޴޵ +SELECT INSERT(`£Ã£±`,3,2,' ') FROM `£Ô£´`; +INSERT(`£Ã£±`,3,2,' ') +ޱ޲ ޵ +SELECT INSERT(`£Ã£±`,3,3,' ') FROM `£Ô£´`; +INSERT(`£Ã£±`,3,3,' ') +ޱ޲ +SELECT INSERT(`£Ã£±`,4,1,' ') FROM `£Ô£´`; +INSERT(`£Ã£±`,4,1,' ') +ޱ޲޳ ޵ +SELECT INSERT(`£Ã£±`,4,2,' ') FROM `£Ô£´`; +INSERT(`£Ã£±`,4,2,' ') +ޱ޲޳ +SELECT INSERT(`£Ã£±`,5,1,' ') FROM `£Ô£´`; +INSERT(`£Ã£±`,5,1,' ') +ޱ޲޳޴ +SELECT INSERT(`£Ã£±`,1,1,'¤«') FROM `£Ô£µ`; +INSERT(`£Ã£±`,1,1,'¤«') +¤«¤¤¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,1,2,'¤«¤«') FROM `£Ô£µ`; +INSERT(`£Ã£±`,1,2,'¤«¤«') +¤«¤«¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,1,3,'¤«¤«¤«') FROM `£Ô£µ`; +INSERT(`£Ã£±`,1,3,'¤«¤«¤«') +¤«¤«¤«¤¨¤ª +SELECT INSERT(`£Ã£±`,1,4,'¤«¤«¤«¤«') FROM `£Ô£µ`; +INSERT(`£Ã£±`,1,4,'¤«¤«¤«¤«') +¤«¤«¤«¤«¤ª +SELECT INSERT(`£Ã£±`,1,5,'¤«¤«¤«¤«¤«') FROM `£Ô£µ`; +INSERT(`£Ã£±`,1,5,'¤«¤«¤«¤«¤«') +¤«¤«¤«¤«¤« +SELECT INSERT(`£Ã£±`,2,1,'¤«') FROM `£Ô£µ`; +INSERT(`£Ã£±`,2,1,'¤«') +¤¢¤«¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,2,2,'¤«¤«') FROM `£Ô£µ`; +INSERT(`£Ã£±`,2,2,'¤«¤«') +¤¢¤«¤«¤¨¤ª +SELECT INSERT(`£Ã£±`,2,3,'¤«¤«¤«') FROM `£Ô£µ`; +INSERT(`£Ã£±`,2,3,'¤«¤«¤«') +¤¢¤«¤«¤«¤ª +SELECT INSERT(`£Ã£±`,2,4,'¤«¤«¤«¤«') FROM `£Ô£µ`; +INSERT(`£Ã£±`,2,4,'¤«¤«¤«¤«') +¤¢¤«¤«¤«¤« +SELECT INSERT(`£Ã£±`,3,1,'¤«') FROM `£Ô£µ`; +INSERT(`£Ã£±`,3,1,'¤«') +¤¢¤¤¤«¤¨¤ª +SELECT INSERT(`£Ã£±`,3,2,'¤«¤«') FROM `£Ô£µ`; +INSERT(`£Ã£±`,3,2,'¤«¤«') +¤¢¤¤¤«¤«¤ª +SELECT INSERT(`£Ã£±`,3,3,'¤«¤«¤«') FROM `£Ô£µ`; +INSERT(`£Ã£±`,3,3,'¤«¤«¤«') +¤¢¤¤¤«¤«¤« +SELECT INSERT(`£Ã£±`,4,1,'¤«') FROM `£Ô£µ`; +INSERT(`£Ã£±`,4,1,'¤«') +¤¢¤¤¤¦¤«¤ª +SELECT INSERT(`£Ã£±`,4,2,'¤«¤«') FROM `£Ô£µ`; +INSERT(`£Ã£±`,4,2,'¤«¤«') +¤¢¤¤¤¦¤«¤« +SELECT INSERT(`£Ã£±`,5,1,'¤«') FROM `£Ô£µ`; +INSERT(`£Ã£±`,5,1,'¤«') +¤¢¤¤¤¦¤¨¤« +SELECT INSERT(`£Ã£±`,1,1,'¡¡') FROM `£Ô£µ`; +INSERT(`£Ã£±`,1,1,'¡¡') +¡¡¤¤¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,1,2,'¡¡¡¡') FROM `£Ô£µ`; +INSERT(`£Ã£±`,1,2,'¡¡¡¡') +¡¡¡¡¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,1,3,'¡¡¡¡¡¡') FROM `£Ô£µ`; +INSERT(`£Ã£±`,1,3,'¡¡¡¡¡¡') +¡¡¡¡¡¡¤¨¤ª +SELECT INSERT(`£Ã£±`,1,4,'¡¡¡¡¡¡¡¡') FROM `£Ô£µ`; +INSERT(`£Ã£±`,1,4,'¡¡¡¡¡¡¡¡') +¡¡¡¡¡¡¡¡¤ª +SELECT INSERT(`£Ã£±`,1,5,'¡¡¡¡¡¡¡¡¡¡') FROM `£Ô£µ`; +INSERT(`£Ã£±`,1,5,'¡¡¡¡¡¡¡¡¡¡') +¡¡¡¡¡¡¡¡¡¡ +SELECT INSERT(`£Ã£±`,2,1,'¡¡') FROM `£Ô£µ`; +INSERT(`£Ã£±`,2,1,'¡¡') +¤¢¡¡¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,2,2,'¡¡¡¡') FROM `£Ô£µ`; +INSERT(`£Ã£±`,2,2,'¡¡¡¡') +¤¢¡¡¡¡¤¨¤ª +SELECT INSERT(`£Ã£±`,2,3,'¡¡¡¡¡¡') FROM `£Ô£µ`; +INSERT(`£Ã£±`,2,3,'¡¡¡¡¡¡') +¤¢¡¡¡¡¡¡¤ª +SELECT INSERT(`£Ã£±`,2,4,'¡¡¡¡¡¡¡¡') FROM `£Ô£µ`; +INSERT(`£Ã£±`,2,4,'¡¡¡¡¡¡¡¡') +¤¢¡¡¡¡¡¡¡¡ +SELECT INSERT(`£Ã£±`,3,1,'¡¡') FROM `£Ô£µ`; +INSERT(`£Ã£±`,3,1,'¡¡') +¤¢¤¤¡¡¤¨¤ª +SELECT INSERT(`£Ã£±`,3,2,'¡¡¡¡') FROM `£Ô£µ`; +INSERT(`£Ã£±`,3,2,'¡¡¡¡') +¤¢¤¤¡¡¡¡¤ª +SELECT INSERT(`£Ã£±`,3,3,'¡¡¡¡¡¡') FROM `£Ô£µ`; +INSERT(`£Ã£±`,3,3,'¡¡¡¡¡¡') +¤¢¤¤¡¡¡¡¡¡ +SELECT INSERT(`£Ã£±`,4,1,'¡¡') FROM `£Ô£µ`; +INSERT(`£Ã£±`,4,1,'¡¡') +¤¢¤¤¤¦¡¡¤ª +SELECT INSERT(`£Ã£±`,4,2,'¡¡¡¡') FROM `£Ô£µ`; +INSERT(`£Ã£±`,4,2,'¡¡¡¡') +¤¢¤¤¤¦¡¡¡¡ +SELECT INSERT(`£Ã£±`,5,1,'¡¡') FROM `£Ô£µ`; +INSERT(`£Ã£±`,5,1,'¡¡') +¤¢¤¤¤¦¤¨¡¡ +SELECT INSERT(`£Ã£±`,1,1,'°¡') FROM `£Ô£¶`; +INSERT(`£Ã£±`,1,1,'°¡') +°¡íÝíÞíßíà +SELECT INSERT(`£Ã£±`,1,2,'°¡°¡' ) FROM `£Ô£¶`; +INSERT(`£Ã£±`,1,2,'°¡°¡' ) +°¡°¡íÞíßíà +SELECT INSERT(`£Ã£±`,1,3,'°¡°¡°¡' ) FROM `£Ô£¶`; +INSERT(`£Ã£±`,1,3,'°¡°¡°¡' ) +°¡°¡°¡íßíà +SELECT INSERT(`£Ã£±`,1,4,'°¡°¡°¡°¡' ) FROM `£Ô£¶`; +INSERT(`£Ã£±`,1,4,'°¡°¡°¡°¡' ) +°¡°¡°¡°¡íà +SELECT INSERT(`£Ã£±`,1,5,'°¡°¡°¡°¡°¡' ) FROM `£Ô£¶`; +INSERT(`£Ã£±`,1,5,'°¡°¡°¡°¡°¡' ) +°¡°¡°¡°¡°¡ +SELECT INSERT(`£Ã£±`,2,1,'°¡') FROM `£Ô£¶`; +INSERT(`£Ã£±`,2,1,'°¡') +íܰ¡íÞíßíà +SELECT INSERT(`£Ã£±`,2,2,'°¡°¡') FROM `£Ô£¶`; +INSERT(`£Ã£±`,2,2,'°¡°¡') +íܰ¡°¡íßíà +SELECT INSERT(`£Ã£±`,2,3,'°¡°¡°¡' ) FROM `£Ô£¶`; +INSERT(`£Ã£±`,2,3,'°¡°¡°¡' ) +íܰ¡°¡°¡íà +SELECT INSERT(`£Ã£±`,2,4,'°¡°¡°¡°¡' ) FROM `£Ô£¶`; +INSERT(`£Ã£±`,2,4,'°¡°¡°¡°¡' ) +íܰ¡°¡°¡°¡ +SELECT INSERT(`£Ã£±`,3,1,'°¡') FROM `£Ô£¶`; +INSERT(`£Ã£±`,3,1,'°¡') +íÜíݰ¡íßíà +SELECT INSERT(`£Ã£±`,3,2,'°¡°¡' ) FROM `£Ô£¶`; +INSERT(`£Ã£±`,3,2,'°¡°¡' ) +íÜíݰ¡°¡íà +SELECT INSERT(`£Ã£±`,3,3,'°¡°¡°¡' ) FROM `£Ô£¶`; +INSERT(`£Ã£±`,3,3,'°¡°¡°¡' ) +íÜíݰ¡°¡°¡ +SELECT INSERT(`£Ã£±`,4,1,'°¡') FROM `£Ô£¶`; +INSERT(`£Ã£±`,4,1,'°¡') +íÜíÝíÞ°¡íà +SELECT INSERT(`£Ã£±`,4,2,'°¡°¡' ) FROM `£Ô£¶`; +INSERT(`£Ã£±`,4,2,'°¡°¡' ) +íÜíÝíÞ°¡°¡ +SELECT INSERT(`£Ã£±`,5,1,'°¡') FROM `£Ô£¶`; +INSERT(`£Ã£±`,5,1,'°¡') +íÜíÝíÞíß°¡ +SELECT INSERT(`£Ã£±`,1,1,'޶') FROM `£Ô£·`; +INSERT(`£Ã£±`,1,1,'޶') +޶޲޳޴޵ +SELECT INSERT(`£Ã£±`,1,2,'޶޶') FROM `£Ô£·`; +INSERT(`£Ã£±`,1,2,'޶޶') +޶޶޳޴޵ +SELECT INSERT(`£Ã£±`,1,3,'޶޶޶') FROM `£Ô£·`; +INSERT(`£Ã£±`,1,3,'޶޶޶') +޶޶޶޴޵ +SELECT INSERT(`£Ã£±`,1,4,'޶޶޶޶') FROM `£Ô£·`; +INSERT(`£Ã£±`,1,4,'޶޶޶޶') +޶޶޶޶޵ +SELECT INSERT(`£Ã£±`,1,5,'޶޶޶޶޶') FROM `£Ô£·`; +INSERT(`£Ã£±`,1,5,'޶޶޶޶޶') +޶޶޶޶޶ +SELECT INSERT(`£Ã£±`,2,1,'޶') FROM `£Ô£·`; +INSERT(`£Ã£±`,2,1,'޶') +ޱ޶޳޴޵ +SELECT INSERT(`£Ã£±`,2,2,'޶޶') FROM `£Ô£·`; +INSERT(`£Ã£±`,2,2,'޶޶') +ޱ޶޶޴޵ +SELECT INSERT(`£Ã£±`,2,3,'޶޶޶') FROM `£Ô£·`; +INSERT(`£Ã£±`,2,3,'޶޶޶') +ޱ޶޶޶޵ +SELECT INSERT(`£Ã£±`,2,4,'޶޶޶޶') FROM `£Ô£·`; +INSERT(`£Ã£±`,2,4,'޶޶޶޶') +ޱ޶޶޶޶ +SELECT INSERT(`£Ã£±`,3,1,'޶') FROM `£Ô£·`; +INSERT(`£Ã£±`,3,1,'޶') +ޱ޲޶޴޵ +SELECT INSERT(`£Ã£±`,3,2,'޶޶') FROM `£Ô£·`; +INSERT(`£Ã£±`,3,2,'޶޶') +ޱ޲޶޶޵ +SELECT INSERT(`£Ã£±`,3,3,'޶޶޶') FROM `£Ô£·`; +INSERT(`£Ã£±`,3,3,'޶޶޶') +ޱ޲޶޶޶ +SELECT INSERT(`£Ã£±`,4,1,'޶') FROM `£Ô£·`; +INSERT(`£Ã£±`,4,1,'޶') +ޱ޲޳޶޵ +SELECT INSERT(`£Ã£±`,4,2,'޶޶') FROM `£Ô£·`; +INSERT(`£Ã£±`,4,2,'޶޶') +ޱ޲޳޶޶ +SELECT INSERT(`£Ã£±`,5,1,'޶') FROM `£Ô£·`; +INSERT(`£Ã£±`,5,1,'޶') +ޱ޲޳޴޶ +SELECT INSERT(`£Ã£±`,1,1,' ') FROM `£Ô£·`; +INSERT(`£Ã£±`,1,1,' ') + ޲޳޴޵ +SELECT INSERT(`£Ã£±`,1,2,' ') FROM `£Ô£·`; +INSERT(`£Ã£±`,1,2,' ') + ޳޴޵ +SELECT INSERT(`£Ã£±`,1,3,' ') FROM `£Ô£·`; +INSERT(`£Ã£±`,1,3,' ') + ޴޵ +SELECT INSERT(`£Ã£±`,1,4,' ') FROM `£Ô£·`; +INSERT(`£Ã£±`,1,4,' ') + ޵ +SELECT INSERT(`£Ã£±`,1,5,' ') FROM `£Ô£·`; +INSERT(`£Ã£±`,1,5,' ') + +SELECT INSERT(`£Ã£±`,2,1,' ') FROM `£Ô£·`; +INSERT(`£Ã£±`,2,1,' ') +ޱ ޳޴޵ +SELECT INSERT(`£Ã£±`,2,2,' ') FROM `£Ô£·`; +INSERT(`£Ã£±`,2,2,' ') +ޱ ޴޵ +SELECT INSERT(`£Ã£±`,2,3,' ') FROM `£Ô£·`; +INSERT(`£Ã£±`,2,3,' ') +ޱ ޵ +SELECT INSERT(`£Ã£±`,2,4,' ') FROM `£Ô£·`; +INSERT(`£Ã£±`,2,4,' ') +ޱ +SELECT INSERT(`£Ã£±`,3,1,' ') FROM `£Ô£·`; +INSERT(`£Ã£±`,3,1,' ') +ޱ޲ ޴޵ +SELECT INSERT(`£Ã£±`,3,2,' ') FROM `£Ô£·`; +INSERT(`£Ã£±`,3,2,' ') +ޱ޲ ޵ +SELECT INSERT(`£Ã£±`,3,3,' ') FROM `£Ô£·`; +INSERT(`£Ã£±`,3,3,' ') +ޱ޲ +SELECT INSERT(`£Ã£±`,4,1,' ') FROM `£Ô£·`; +INSERT(`£Ã£±`,4,1,' ') +ޱ޲޳ ޵ +SELECT INSERT(`£Ã£±`,4,2,' ') FROM `£Ô£·`; +INSERT(`£Ã£±`,4,2,' ') +ޱ޲޳ +SELECT INSERT(`£Ã£±`,5,1,' ') FROM `£Ô£·`; +INSERT(`£Ã£±`,5,1,' ') +ޱ޲޳޴ +SELECT INSERT(`£Ã£±`,1,1,'¤«') FROM `£Ô£¸`; +INSERT(`£Ã£±`,1,1,'¤«') +¤«¤¤¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,1,2,'¤«¤«') FROM `£Ô£¸`; +INSERT(`£Ã£±`,1,2,'¤«¤«') +¤«¤«¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,1,3,'¤«¤«¤«') FROM `£Ô£¸`; +INSERT(`£Ã£±`,1,3,'¤«¤«¤«') +¤«¤«¤«¤¨¤ª +SELECT INSERT(`£Ã£±`,1,4,'¤«¤«¤«¤«') FROM `£Ô£¸`; +INSERT(`£Ã£±`,1,4,'¤«¤«¤«¤«') +¤«¤«¤«¤«¤ª +SELECT INSERT(`£Ã£±`,1,5,'¤«¤«¤«¤«¤«') FROM `£Ô£¸`; +INSERT(`£Ã£±`,1,5,'¤«¤«¤«¤«¤«') +¤«¤«¤«¤«¤« +SELECT INSERT(`£Ã£±`,2,1,'¤«') FROM `£Ô£¸`; +INSERT(`£Ã£±`,2,1,'¤«') +¤¢¤«¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,2,2,'¤«¤«') FROM `£Ô£¸`; +INSERT(`£Ã£±`,2,2,'¤«¤«') +¤¢¤«¤«¤¨¤ª +SELECT INSERT(`£Ã£±`,2,3,'¤«¤«¤«') FROM `£Ô£¸`; +INSERT(`£Ã£±`,2,3,'¤«¤«¤«') +¤¢¤«¤«¤«¤ª +SELECT INSERT(`£Ã£±`,2,4,'¤«¤«¤«¤«') FROM `£Ô£¸`; +INSERT(`£Ã£±`,2,4,'¤«¤«¤«¤«') +¤¢¤«¤«¤«¤« +SELECT INSERT(`£Ã£±`,3,1,'¤«') FROM `£Ô£¸`; +INSERT(`£Ã£±`,3,1,'¤«') +¤¢¤¤¤«¤¨¤ª +SELECT INSERT(`£Ã£±`,3,2,'¤«¤«') FROM `£Ô£¸`; +INSERT(`£Ã£±`,3,2,'¤«¤«') +¤¢¤¤¤«¤«¤ª +SELECT INSERT(`£Ã£±`,3,3,'¤«¤«¤«') FROM `£Ô£¸`; +INSERT(`£Ã£±`,3,3,'¤«¤«¤«') +¤¢¤¤¤«¤«¤« +SELECT INSERT(`£Ã£±`,4,1,'¤«') FROM `£Ô£¸`; +INSERT(`£Ã£±`,4,1,'¤«') +¤¢¤¤¤¦¤«¤ª +SELECT INSERT(`£Ã£±`,4,2,'¤«¤«') FROM `£Ô£¸`; +INSERT(`£Ã£±`,4,2,'¤«¤«') +¤¢¤¤¤¦¤«¤« +SELECT INSERT(`£Ã£±`,5,1,'¤«') FROM `£Ô£¸`; +INSERT(`£Ã£±`,5,1,'¤«') +¤¢¤¤¤¦¤¨¤« +SELECT INSERT(`£Ã£±`,1,1,'¡¡') FROM `£Ô£¸`; +INSERT(`£Ã£±`,1,1,'¡¡') +¡¡¤¤¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,1,2,'¡¡¡¡') FROM `£Ô£¸`; +INSERT(`£Ã£±`,1,2,'¡¡¡¡') +¡¡¡¡¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,1,3,'¡¡¡¡¡¡') FROM `£Ô£¸`; +INSERT(`£Ã£±`,1,3,'¡¡¡¡¡¡') +¡¡¡¡¡¡¤¨¤ª +SELECT INSERT(`£Ã£±`,1,4,'¡¡¡¡¡¡¡¡') FROM `£Ô£¸`; +INSERT(`£Ã£±`,1,4,'¡¡¡¡¡¡¡¡') +¡¡¡¡¡¡¡¡¤ª +SELECT INSERT(`£Ã£±`,1,5,'¡¡¡¡¡¡¡¡¡¡') FROM `£Ô£¸`; +INSERT(`£Ã£±`,1,5,'¡¡¡¡¡¡¡¡¡¡') +¡¡¡¡¡¡¡¡¡¡ +SELECT INSERT(`£Ã£±`,2,1,'¡¡') FROM `£Ô£¸`; +INSERT(`£Ã£±`,2,1,'¡¡') +¤¢¡¡¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,2,2,'¡¡¡¡') FROM `£Ô£¸`; +INSERT(`£Ã£±`,2,2,'¡¡¡¡') +¤¢¡¡¡¡¤¨¤ª +SELECT INSERT(`£Ã£±`,2,3,'¡¡¡¡¡¡') FROM `£Ô£¸`; +INSERT(`£Ã£±`,2,3,'¡¡¡¡¡¡') +¤¢¡¡¡¡¡¡¤ª +SELECT INSERT(`£Ã£±`,2,4,'¡¡¡¡¡¡¡¡') FROM `£Ô£¸`; +INSERT(`£Ã£±`,2,4,'¡¡¡¡¡¡¡¡') +¤¢¡¡¡¡¡¡¡¡ +SELECT INSERT(`£Ã£±`,3,1,'¡¡') FROM `£Ô£¸`; +INSERT(`£Ã£±`,3,1,'¡¡') +¤¢¤¤¡¡¤¨¤ª +SELECT INSERT(`£Ã£±`,3,2,'¡¡¡¡') FROM `£Ô£¸`; +INSERT(`£Ã£±`,3,2,'¡¡¡¡') +¤¢¤¤¡¡¡¡¤ª +SELECT INSERT(`£Ã£±`,3,3,'¡¡¡¡¡¡') FROM `£Ô£¸`; +INSERT(`£Ã£±`,3,3,'¡¡¡¡¡¡') +¤¢¤¤¡¡¡¡¡¡ +SELECT INSERT(`£Ã£±`,4,1,'¡¡') FROM `£Ô£¸`; +INSERT(`£Ã£±`,4,1,'¡¡') +¤¢¤¤¤¦¡¡¤ª +SELECT INSERT(`£Ã£±`,4,2,'¡¡¡¡') FROM `£Ô£¸`; +INSERT(`£Ã£±`,4,2,'¡¡¡¡') +¤¢¤¤¤¦¡¡¡¡ +SELECT INSERT(`£Ã£±`,5,1,'¡¡') FROM `£Ô£¸`; +INSERT(`£Ã£±`,5,1,'¡¡') +¤¢¤¤¤¦¤¨¡¡ +SELECT INSERT(`£Ã£±`,1,1,'°¡') FROM `£Ô£¹`; +INSERT(`£Ã£±`,1,1,'°¡') +°¡íÝíÞíßíà +SELECT INSERT(`£Ã£±`,1,2,'°¡°¡' ) FROM `£Ô£¹`; +INSERT(`£Ã£±`,1,2,'°¡°¡' ) +°¡°¡íÞíßíà +SELECT INSERT(`£Ã£±`,1,3,'°¡°¡°¡' ) FROM `£Ô£¹`; +INSERT(`£Ã£±`,1,3,'°¡°¡°¡' ) +°¡°¡°¡íßíà +SELECT INSERT(`£Ã£±`,1,4,'°¡°¡°¡°¡' ) FROM `£Ô£¹`; +INSERT(`£Ã£±`,1,4,'°¡°¡°¡°¡' ) +°¡°¡°¡°¡íà +SELECT INSERT(`£Ã£±`,1,5,'°¡°¡°¡°¡°¡' ) FROM `£Ô£¹`; +INSERT(`£Ã£±`,1,5,'°¡°¡°¡°¡°¡' ) +°¡°¡°¡°¡°¡ +SELECT INSERT(`£Ã£±`,2,1,'°¡') FROM `£Ô£¹`; +INSERT(`£Ã£±`,2,1,'°¡') +íܰ¡íÞíßíà +SELECT INSERT(`£Ã£±`,2,2,'°¡°¡' ) FROM `£Ô£¹`; +INSERT(`£Ã£±`,2,2,'°¡°¡' ) +íܰ¡°¡íßíà +SELECT INSERT(`£Ã£±`,2,3,'°¡°¡°¡' ) FROM `£Ô£¹`; +INSERT(`£Ã£±`,2,3,'°¡°¡°¡' ) +íܰ¡°¡°¡íà +SELECT INSERT(`£Ã£±`,2,4,'°¡°¡°¡°¡' ) FROM `£Ô£¹`; +INSERT(`£Ã£±`,2,4,'°¡°¡°¡°¡' ) +íܰ¡°¡°¡°¡ +SELECT INSERT(`£Ã£±`,3,1,'°¡') FROM `£Ô£¹`; +INSERT(`£Ã£±`,3,1,'°¡') +íÜíݰ¡íßíà +SELECT INSERT(`£Ã£±`,3,2,'°¡°¡' ) FROM `£Ô£¹`; +INSERT(`£Ã£±`,3,2,'°¡°¡' ) +íÜíݰ¡°¡íà +SELECT INSERT(`£Ã£±`,3,3,'°¡°¡°¡' ) FROM `£Ô£¹`; +INSERT(`£Ã£±`,3,3,'°¡°¡°¡' ) +íÜíݰ¡°¡°¡ +SELECT INSERT(`£Ã£±`,4,1,'°¡') FROM `£Ô£¹`; +INSERT(`£Ã£±`,4,1,'°¡') +íÜíÝíÞ°¡íà +SELECT INSERT(`£Ã£±`,4,2,'°¡°¡' ) FROM `£Ô£¹`; +INSERT(`£Ã£±`,4,2,'°¡°¡' ) +íÜíÝíÞ°¡°¡ +SELECT INSERT(`£Ã£±`,5,1,'°¡') FROM `£Ô£¹`; +INSERT(`£Ã£±`,5,1,'°¡') +íÜíÝíÞíß°¡ +SELECT INSERT(`£Ã£±`,1,1,'޶') FROM `£Ô£±£°`; +INSERT(`£Ã£±`,1,1,'޶') +޶޲޳޴޵ +SELECT INSERT(`£Ã£±`,1,2,'޶޶') FROM `£Ô£±£°`; +INSERT(`£Ã£±`,1,2,'޶޶') +޶޶޳޴޵ +SELECT INSERT(`£Ã£±`,1,3,'޶޶޶') FROM `£Ô£±£°`; +INSERT(`£Ã£±`,1,3,'޶޶޶') +޶޶޶޴޵ +SELECT INSERT(`£Ã£±`,1,4,'޶޶޶޶') FROM `£Ô£±£°`; +INSERT(`£Ã£±`,1,4,'޶޶޶޶') +޶޶޶޶޵ +SELECT INSERT(`£Ã£±`,1,5,'޶޶޶޶޶') FROM `£Ô£±£°`; +INSERT(`£Ã£±`,1,5,'޶޶޶޶޶') +޶޶޶޶޶ +SELECT INSERT(`£Ã£±`,2,1,'޶') FROM `£Ô£±£°`; +INSERT(`£Ã£±`,2,1,'޶') +ޱ޶޳޴޵ +SELECT INSERT(`£Ã£±`,2,2,'޶޶') FROM `£Ô£±£°`; +INSERT(`£Ã£±`,2,2,'޶޶') +ޱ޶޶޴޵ +SELECT INSERT(`£Ã£±`,2,3,'޶޶޶') FROM `£Ô£±£°`; +INSERT(`£Ã£±`,2,3,'޶޶޶') +ޱ޶޶޶޵ +SELECT INSERT(`£Ã£±`,2,4,'޶޶޶޶') FROM `£Ô£±£°`; +INSERT(`£Ã£±`,2,4,'޶޶޶޶') +ޱ޶޶޶޶ +SELECT INSERT(`£Ã£±`,3,1,'޶') FROM `£Ô£±£°`; +INSERT(`£Ã£±`,3,1,'޶') +ޱ޲޶޴޵ +SELECT INSERT(`£Ã£±`,3,2,'޶޶') FROM `£Ô£±£°`; +INSERT(`£Ã£±`,3,2,'޶޶') +ޱ޲޶޶޵ +SELECT INSERT(`£Ã£±`,3,3,'޶޶޶') FROM `£Ô£±£°`; +INSERT(`£Ã£±`,3,3,'޶޶޶') +ޱ޲޶޶޶ +SELECT INSERT(`£Ã£±`,4,1,'޶') FROM `£Ô£±£°`; +INSERT(`£Ã£±`,4,1,'޶') +ޱ޲޳޶޵ +SELECT INSERT(`£Ã£±`,4,2,'޶޶') FROM `£Ô£±£°`; +INSERT(`£Ã£±`,4,2,'޶޶') +ޱ޲޳޶޶ +SELECT INSERT(`£Ã£±`,5,1,'޶') FROM `£Ô£±£°`; +INSERT(`£Ã£±`,5,1,'޶') +ޱ޲޳޴޶ +SELECT INSERT(`£Ã£±`,1,1,'¤«') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,1,1,'¤«') +¤«¤¤¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,1,2,'¤«¤«') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,1,2,'¤«¤«') +¤«¤«¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,1,3,'¤«¤«¤«') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,1,3,'¤«¤«¤«') +¤«¤«¤«¤¨¤ª +SELECT INSERT(`£Ã£±`,1,4,'¤«¤«¤«¤«') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,1,4,'¤«¤«¤«¤«') +¤«¤«¤«¤«¤ª +SELECT INSERT(`£Ã£±`,1,5,'¤«¤«¤«¤«¤«') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,1,5,'¤«¤«¤«¤«¤«') +¤«¤«¤«¤«¤« +SELECT INSERT(`£Ã£±`,2,1,'¤«') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,2,1,'¤«') +¤¢¤«¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,2,2,'¤«¤«') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,2,2,'¤«¤«') +¤¢¤«¤«¤¨¤ª +SELECT INSERT(`£Ã£±`,2,3,'¤«¤«¤«') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,2,3,'¤«¤«¤«') +¤¢¤«¤«¤«¤ª +SELECT INSERT(`£Ã£±`,2,4,'¤«¤«¤«¤«') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,2,4,'¤«¤«¤«¤«') +¤¢¤«¤«¤«¤« +SELECT INSERT(`£Ã£±`,3,1,'¤«') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,3,1,'¤«') +¤¢¤¤¤«¤¨¤ª +SELECT INSERT(`£Ã£±`,3,2,'¤«¤«') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,3,2,'¤«¤«') +¤¢¤¤¤«¤«¤ª +SELECT INSERT(`£Ã£±`,3,3,'¤«¤«¤«') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,3,3,'¤«¤«¤«') +¤¢¤¤¤«¤«¤« +SELECT INSERT(`£Ã£±`,4,1,'¤«') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,4,1,'¤«') +¤¢¤¤¤¦¤«¤ª +SELECT INSERT(`£Ã£±`,4,2,'¤«¤«') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,4,2,'¤«¤«') +¤¢¤¤¤¦¤«¤« +SELECT INSERT(`£Ã£±`,5,1,'¤«') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,5,1,'¤«') +¤¢¤¤¤¦¤¨¤« +SELECT INSERT(`£Ã£±`,1,1,'¡¡') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,1,1,'¡¡') +¡¡¤¤¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,1,2,'¡¡¡¡') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,1,2,'¡¡¡¡') +¡¡¡¡¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,1,3,'¡¡¡¡¡¡') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,1,3,'¡¡¡¡¡¡') +¡¡¡¡¡¡¤¨¤ª +SELECT INSERT(`£Ã£±`,1,4,'¡¡¡¡¡¡¡¡') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,1,4,'¡¡¡¡¡¡¡¡') +¡¡¡¡¡¡¡¡¤ª +SELECT INSERT(`£Ã£±`,1,5,'¡¡¡¡¡¡¡¡¡¡') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,1,5,'¡¡¡¡¡¡¡¡¡¡') +¡¡¡¡¡¡¡¡¡¡ +SELECT INSERT(`£Ã£±`,2,1,'¡¡') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,2,1,'¡¡') +¤¢¡¡¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,2,2,'¡¡¡¡') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,2,2,'¡¡¡¡') +¤¢¡¡¡¡¤¨¤ª +SELECT INSERT(`£Ã£±`,2,3,'¡¡¡¡¡¡') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,2,3,'¡¡¡¡¡¡') +¤¢¡¡¡¡¡¡¤ª +SELECT INSERT(`£Ã£±`,2,4,'¡¡¡¡¡¡¡¡') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,2,4,'¡¡¡¡¡¡¡¡') +¤¢¡¡¡¡¡¡¡¡ +SELECT INSERT(`£Ã£±`,3,1,'¡¡') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,3,1,'¡¡') +¤¢¤¤¡¡¤¨¤ª +SELECT INSERT(`£Ã£±`,3,2,'¡¡¡¡') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,3,2,'¡¡¡¡') +¤¢¤¤¡¡¡¡¤ª +SELECT INSERT(`£Ã£±`,3,3,'¡¡¡¡¡¡') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,3,3,'¡¡¡¡¡¡') +¤¢¤¤¡¡¡¡¡¡ +SELECT INSERT(`£Ã£±`,4,1,'¡¡') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,4,1,'¡¡') +¤¢¤¤¤¦¡¡¤ª +SELECT INSERT(`£Ã£±`,4,2,'¡¡¡¡') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,4,2,'¡¡¡¡') +¤¢¤¤¤¦¡¡¡¡ +SELECT INSERT(`£Ã£±`,5,1,'¡¡') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,5,1,'¡¡') +¤¢¤¤¤¦¤¨¡¡ +SELECT INSERT(`£Ã£±`,1,1,'°¡') FROM `£Ô£±£²`; +INSERT(`£Ã£±`,1,1,'°¡') +°¡íÝíÞíßíà +SELECT INSERT(`£Ã£±`,1,2,'°¡°¡') FROM `£Ô£±£²`; +INSERT(`£Ã£±`,1,2,'°¡°¡') +°¡°¡íÞíßíà +SELECT INSERT(`£Ã£±`,1,3,'°¡°¡°¡') FROM `£Ô£±£²`; +INSERT(`£Ã£±`,1,3,'°¡°¡°¡') +°¡°¡°¡íßíà +SELECT INSERT(`£Ã£±`,1,4,'°¡°¡°¡°¡') FROM `£Ô£±£²`; +INSERT(`£Ã£±`,1,4,'°¡°¡°¡°¡') +°¡°¡°¡°¡íà +SELECT INSERT(`£Ã£±`,1,5,'°¡°¡°¡°¡°¡') FROM `£Ô£±£²`; +INSERT(`£Ã£±`,1,5,'°¡°¡°¡°¡°¡') +°¡°¡°¡°¡°¡ +SELECT INSERT(`£Ã£±`,2,1,'°¡') FROM `£Ô£±£²`; +INSERT(`£Ã£±`,2,1,'°¡') +íܰ¡íÞíßíà +SELECT INSERT(`£Ã£±`,2,2,'°¡°¡') FROM `£Ô£±£²`; +INSERT(`£Ã£±`,2,2,'°¡°¡') +íܰ¡°¡íßíà +SELECT INSERT(`£Ã£±`,2,3,'°¡°¡°¡') FROM `£Ô£±£²`; +INSERT(`£Ã£±`,2,3,'°¡°¡°¡') +íܰ¡°¡°¡íà +SELECT INSERT(`£Ã£±`,2,4,'°¡°¡°¡°¡') FROM `£Ô£±£²`; +INSERT(`£Ã£±`,2,4,'°¡°¡°¡°¡') +íܰ¡°¡°¡°¡ +SELECT INSERT(`£Ã£±`,3,1,'°¡') FROM `£Ô£±£²`; +INSERT(`£Ã£±`,3,1,'°¡') +íÜíݰ¡íßíà +SELECT INSERT(`£Ã£±`,3,2,'°¡°¡') FROM `£Ô£±£²`; +INSERT(`£Ã£±`,3,2,'°¡°¡') +íÜíݰ¡°¡íà +SELECT INSERT(`£Ã£±`,3,3,'°¡°¡°¡') FROM `£Ô£±£²`; +INSERT(`£Ã£±`,3,3,'°¡°¡°¡') +íÜíݰ¡°¡°¡ +SELECT INSERT(`£Ã£±`,4,1,'°¡') FROM `£Ô£±£²`; +INSERT(`£Ã£±`,4,1,'°¡') +íÜíÝíÞ°¡íà +SELECT INSERT(`£Ã£±`,4,2,'°¡°¡') FROM `£Ô£±£²`; +INSERT(`£Ã£±`,4,2,'°¡°¡') +íÜíÝíÞ°¡°¡ +SELECT INSERT(`£Ã£±`,5,1,'°¡') FROM `£Ô£±£²`; +INSERT(`£Ã£±`,5,1,'°¡') +íÜíÝíÞíß°¡ +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/r/jp_insert_ujis.result b/mysql-test/suite/jp/r/jp_insert_ujis.result new file mode 100755 index 00000000000..7f42d66c565 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_insert_ujis.result @@ -0,0 +1,906 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +SET NAMES ujis; +SET character_set_database = ujis; +SET collation_connection = ujis_japanese_ci; +CREATE TABLE `£Ô£±` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = bdb; +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'); +SELECT INSERT(`£Ã£±`,1,1,'޶') FROM `£Ô£±`; +INSERT(`£Ã£±`,1,1,'޶') +޶޲޳޴޵ +SELECT INSERT(`£Ã£±`,1,2,'޶޶') FROM `£Ô£±`; +INSERT(`£Ã£±`,1,2,'޶޶') +޶޶޳޴޵ +SELECT INSERT(`£Ã£±`,1,3,'޶޶޶') FROM `£Ô£±`; +INSERT(`£Ã£±`,1,3,'޶޶޶') +޶޶޶޴޵ +SELECT INSERT(`£Ã£±`,1,4,'޶޶޶޶') FROM `£Ô£±`; +INSERT(`£Ã£±`,1,4,'޶޶޶޶') +޶޶޶޶޵ +SELECT INSERT(`£Ã£±`,1,5,'޶޶޶޶޶') FROM `£Ô£±`; +INSERT(`£Ã£±`,1,5,'޶޶޶޶޶') +޶޶޶޶޶ +SELECT INSERT(`£Ã£±`,2,1,'޶') FROM `£Ô£±`; +INSERT(`£Ã£±`,2,1,'޶') +ޱ޶޳޴޵ +SELECT INSERT(`£Ã£±`,2,2,'޶޶') FROM `£Ô£±`; +INSERT(`£Ã£±`,2,2,'޶޶') +ޱ޶޶޴޵ +SELECT INSERT(`£Ã£±`,2,3,'޶޶޶') FROM `£Ô£±`; +INSERT(`£Ã£±`,2,3,'޶޶޶') +ޱ޶޶޶޵ +SELECT INSERT(`£Ã£±`,2,4,'޶޶޶޶') FROM `£Ô£±`; +INSERT(`£Ã£±`,2,4,'޶޶޶޶') +ޱ޶޶޶޶ +SELECT INSERT(`£Ã£±`,3,1,'޶') FROM `£Ô£±`; +INSERT(`£Ã£±`,3,1,'޶') +ޱ޲޶޴޵ +SELECT INSERT(`£Ã£±`,3,2,'޶޶') FROM `£Ô£±`; +INSERT(`£Ã£±`,3,2,'޶޶') +ޱ޲޶޶޵ +SELECT INSERT(`£Ã£±`,3,3,'޶޶޶') FROM `£Ô£±`; +INSERT(`£Ã£±`,3,3,'޶޶޶') +ޱ޲޶޶޶ +SELECT INSERT(`£Ã£±`,4,1,'޶') FROM `£Ô£±`; +INSERT(`£Ã£±`,4,1,'޶') +ޱ޲޳޶޵ +SELECT INSERT(`£Ã£±`,4,2,'޶޶') FROM `£Ô£±`; +INSERT(`£Ã£±`,4,2,'޶޶') +ޱ޲޳޶޶ +SELECT INSERT(`£Ã£±`,5,1,'޶') FROM `£Ô£±`; +INSERT(`£Ã£±`,5,1,'޶') +ޱ޲޳޴޶ +SELECT INSERT(`£Ã£±`,1,1,' ') FROM `£Ô£±`; +INSERT(`£Ã£±`,1,1,' ') + ޲޳޴޵ +SELECT INSERT(`£Ã£±`,1,2,' ') FROM `£Ô£±`; +INSERT(`£Ã£±`,1,2,' ') + ޳޴޵ +SELECT INSERT(`£Ã£±`,1,3,' ') FROM `£Ô£±`; +INSERT(`£Ã£±`,1,3,' ') + ޴޵ +SELECT INSERT(`£Ã£±`,1,4,' ') FROM `£Ô£±`; +INSERT(`£Ã£±`,1,4,' ') + ޵ +SELECT INSERT(`£Ã£±`,1,5,' ') FROM `£Ô£±`; +INSERT(`£Ã£±`,1,5,' ') + +SELECT INSERT(`£Ã£±`,2,1,' ') FROM `£Ô£±`; +INSERT(`£Ã£±`,2,1,' ') +ޱ ޳޴޵ +SELECT INSERT(`£Ã£±`,2,2,' ') FROM `£Ô£±`; +INSERT(`£Ã£±`,2,2,' ') +ޱ ޴޵ +SELECT INSERT(`£Ã£±`,2,3,' ') FROM `£Ô£±`; +INSERT(`£Ã£±`,2,3,' ') +ޱ ޵ +SELECT INSERT(`£Ã£±`,2,4,' ') FROM `£Ô£±`; +INSERT(`£Ã£±`,2,4,' ') +ޱ +SELECT INSERT(`£Ã£±`,3,1,' ') FROM `£Ô£±`; +INSERT(`£Ã£±`,3,1,' ') +ޱ޲ ޴޵ +SELECT INSERT(`£Ã£±`,3,2,' ') FROM `£Ô£±`; +INSERT(`£Ã£±`,3,2,' ') +ޱ޲ ޵ +SELECT INSERT(`£Ã£±`,3,3,' ') FROM `£Ô£±`; +INSERT(`£Ã£±`,3,3,' ') +ޱ޲ +SELECT INSERT(`£Ã£±`,4,1,' ') FROM `£Ô£±`; +INSERT(`£Ã£±`,4,1,' ') +ޱ޲޳ ޵ +SELECT INSERT(`£Ã£±`,4,2,' ') FROM `£Ô£±`; +INSERT(`£Ã£±`,4,2,' ') +ޱ޲޳ +SELECT INSERT(`£Ã£±`,5,1,' ') FROM `£Ô£±`; +INSERT(`£Ã£±`,5,1,' ') +ޱ޲޳޴ +SELECT INSERT(`£Ã£±`,1,1,'¤«') FROM `£Ô£²`; +INSERT(`£Ã£±`,1,1,'¤«') +¤«¤¤¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,1,2,'¤«¤«') FROM `£Ô£²`; +INSERT(`£Ã£±`,1,2,'¤«¤«') +¤«¤«¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,1,3,'¤«¤«¤«') FROM `£Ô£²`; +INSERT(`£Ã£±`,1,3,'¤«¤«¤«') +¤«¤«¤«¤¨¤ª +SELECT INSERT(`£Ã£±`,1,4,'¤«¤«¤«¤«') FROM `£Ô£²`; +INSERT(`£Ã£±`,1,4,'¤«¤«¤«¤«') +¤«¤«¤«¤«¤ª +SELECT INSERT(`£Ã£±`,1,5,'¤«¤«¤«¤«¤«') FROM `£Ô£²`; +INSERT(`£Ã£±`,1,5,'¤«¤«¤«¤«¤«') +¤«¤«¤«¤«¤« +SELECT INSERT(`£Ã£±`,2,1,'¤«') FROM `£Ô£²`; +INSERT(`£Ã£±`,2,1,'¤«') +¤¢¤«¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,2,2,'¤«¤«') FROM `£Ô£²`; +INSERT(`£Ã£±`,2,2,'¤«¤«') +¤¢¤«¤«¤¨¤ª +SELECT INSERT(`£Ã£±`,2,3,'¤«¤«¤«') FROM `£Ô£²`; +INSERT(`£Ã£±`,2,3,'¤«¤«¤«') +¤¢¤«¤«¤«¤ª +SELECT INSERT(`£Ã£±`,2,4,'¤«¤«¤«¤«') FROM `£Ô£²`; +INSERT(`£Ã£±`,2,4,'¤«¤«¤«¤«') +¤¢¤«¤«¤«¤« +SELECT INSERT(`£Ã£±`,3,1,'¤«') FROM `£Ô£²`; +INSERT(`£Ã£±`,3,1,'¤«') +¤¢¤¤¤«¤¨¤ª +SELECT INSERT(`£Ã£±`,3,2,'¤«¤«') FROM `£Ô£²`; +INSERT(`£Ã£±`,3,2,'¤«¤«') +¤¢¤¤¤«¤«¤ª +SELECT INSERT(`£Ã£±`,3,3,'¤«¤«¤«') FROM `£Ô£²`; +INSERT(`£Ã£±`,3,3,'¤«¤«¤«') +¤¢¤¤¤«¤«¤« +SELECT INSERT(`£Ã£±`,4,1,'¤«') FROM `£Ô£²`; +INSERT(`£Ã£±`,4,1,'¤«') +¤¢¤¤¤¦¤«¤ª +SELECT INSERT(`£Ã£±`,4,2,'¤«¤«') FROM `£Ô£²`; +INSERT(`£Ã£±`,4,2,'¤«¤«') +¤¢¤¤¤¦¤«¤« +SELECT INSERT(`£Ã£±`,5,1,'¤«') FROM `£Ô£²`; +INSERT(`£Ã£±`,5,1,'¤«') +¤¢¤¤¤¦¤¨¤« +SELECT INSERT(`£Ã£±`,1,1,'¡¡') FROM `£Ô£²`; +INSERT(`£Ã£±`,1,1,'¡¡') +¡¡¤¤¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,1,2,'¡¡¡¡') FROM `£Ô£²`; +INSERT(`£Ã£±`,1,2,'¡¡¡¡') +¡¡¡¡¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,1,3,'¡¡¡¡¡¡') FROM `£Ô£²`; +INSERT(`£Ã£±`,1,3,'¡¡¡¡¡¡') +¡¡¡¡¡¡¤¨¤ª +SELECT INSERT(`£Ã£±`,1,4,'¡¡¡¡¡¡¡¡') FROM `£Ô£²`; +INSERT(`£Ã£±`,1,4,'¡¡¡¡¡¡¡¡') +¡¡¡¡¡¡¡¡¤ª +SELECT INSERT(`£Ã£±`,1,5,'¡¡¡¡¡¡¡¡¡¡') FROM `£Ô£²`; +INSERT(`£Ã£±`,1,5,'¡¡¡¡¡¡¡¡¡¡') +¡¡¡¡¡¡¡¡¡¡ +SELECT INSERT(`£Ã£±`,2,1,'¡¡') FROM `£Ô£²`; +INSERT(`£Ã£±`,2,1,'¡¡') +¤¢¡¡¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,2,2,'¡¡¡¡') FROM `£Ô£²`; +INSERT(`£Ã£±`,2,2,'¡¡¡¡') +¤¢¡¡¡¡¤¨¤ª +SELECT INSERT(`£Ã£±`,2,3,'¡¡¡¡¡¡') FROM `£Ô£²`; +INSERT(`£Ã£±`,2,3,'¡¡¡¡¡¡') +¤¢¡¡¡¡¡¡¤ª +SELECT INSERT(`£Ã£±`,2,4,'¡¡¡¡¡¡¡¡') FROM `£Ô£²`; +INSERT(`£Ã£±`,2,4,'¡¡¡¡¡¡¡¡') +¤¢¡¡¡¡¡¡¡¡ +SELECT INSERT(`£Ã£±`,3,1,'¡¡') FROM `£Ô£²`; +INSERT(`£Ã£±`,3,1,'¡¡') +¤¢¤¤¡¡¤¨¤ª +SELECT INSERT(`£Ã£±`,3,2,'¡¡¡¡') FROM `£Ô£²`; +INSERT(`£Ã£±`,3,2,'¡¡¡¡') +¤¢¤¤¡¡¡¡¤ª +SELECT INSERT(`£Ã£±`,3,3,'¡¡¡¡¡¡') FROM `£Ô£²`; +INSERT(`£Ã£±`,3,3,'¡¡¡¡¡¡') +¤¢¤¤¡¡¡¡¡¡ +SELECT INSERT(`£Ã£±`,4,1,'¡¡') FROM `£Ô£²`; +INSERT(`£Ã£±`,4,1,'¡¡') +¤¢¤¤¤¦¡¡¤ª +SELECT INSERT(`£Ã£±`,4,2,'¡¡¡¡') FROM `£Ô£²`; +INSERT(`£Ã£±`,4,2,'¡¡¡¡') +¤¢¤¤¤¦¡¡¡¡ +SELECT INSERT(`£Ã£±`,5,1,'¡¡') FROM `£Ô£²`; +INSERT(`£Ã£±`,5,1,'¡¡') +¤¢¤¤¤¦¤¨¡¡ +SELECT INSERT(`£Ã£±`,1,1,'°¡') FROM `£Ô£³`; +INSERT(`£Ã£±`,1,1,'°¡') +°¡íÝíÞíßíà +SELECT INSERT(`£Ã£±`,1,2,'°¡°¡' ) FROM `£Ô£³`; +INSERT(`£Ã£±`,1,2,'°¡°¡' ) +°¡°¡íÞíßíà +SELECT INSERT(`£Ã£±`,1,3,'°¡°¡°¡' ) FROM `£Ô£³`; +INSERT(`£Ã£±`,1,3,'°¡°¡°¡' ) +°¡°¡°¡íßíà +SELECT INSERT(`£Ã£±`,1,4,'°¡°¡°¡°¡' ) FROM `£Ô£³`; +INSERT(`£Ã£±`,1,4,'°¡°¡°¡°¡' ) +°¡°¡°¡°¡íà +SELECT INSERT(`£Ã£±`,1,5,'°¡°¡°¡°¡°¡' ) FROM `£Ô£³`; +INSERT(`£Ã£±`,1,5,'°¡°¡°¡°¡°¡' ) +°¡°¡°¡°¡°¡ +SELECT INSERT(`£Ã£±`,2,1,'°¡') FROM `£Ô£³`; +INSERT(`£Ã£±`,2,1,'°¡') +íܰ¡íÞíßíà +SELECT INSERT(`£Ã£±`,2,2,'°¡°¡' ) FROM `£Ô£³`; +INSERT(`£Ã£±`,2,2,'°¡°¡' ) +íܰ¡°¡íßíà +SELECT INSERT(`£Ã£±`,2,3,'°¡°¡°¡' ) FROM `£Ô£³`; +INSERT(`£Ã£±`,2,3,'°¡°¡°¡' ) +íܰ¡°¡°¡íà +SELECT INSERT(`£Ã£±`,2,4,'°¡°¡°¡°¡' ) FROM `£Ô£³`; +INSERT(`£Ã£±`,2,4,'°¡°¡°¡°¡' ) +íܰ¡°¡°¡°¡ +SELECT INSERT(`£Ã£±`,3,1,'°¡') FROM `£Ô£³`; +INSERT(`£Ã£±`,3,1,'°¡') +íÜíݰ¡íßíà +SELECT INSERT(`£Ã£±`,3,2,'°¡°¡' ) FROM `£Ô£³`; +INSERT(`£Ã£±`,3,2,'°¡°¡' ) +íÜíݰ¡°¡íà +SELECT INSERT(`£Ã£±`,3,3,'°¡°¡°¡' ) FROM `£Ô£³`; +INSERT(`£Ã£±`,3,3,'°¡°¡°¡' ) +íÜíݰ¡°¡°¡ +SELECT INSERT(`£Ã£±`,4,1,'°¡') FROM `£Ô£³`; +INSERT(`£Ã£±`,4,1,'°¡') +íÜíÝíÞ°¡íà +SELECT INSERT(`£Ã£±`,4,2,'°¡°¡' ) FROM `£Ô£³`; +INSERT(`£Ã£±`,4,2,'°¡°¡' ) +íÜíÝíÞ°¡°¡ +SELECT INSERT(`£Ã£±`,5,1,'°¡') FROM `£Ô£³`; +INSERT(`£Ã£±`,5,1,'°¡') +íÜíÝíÞíß°¡ +SELECT INSERT(`£Ã£±`,1,1,'޶') FROM `£Ô£´`; +INSERT(`£Ã£±`,1,1,'޶') +޶޲޳޴޵ +SELECT INSERT(`£Ã£±`,1,2,'޶޶') FROM `£Ô£´`; +INSERT(`£Ã£±`,1,2,'޶޶') +޶޶޳޴޵ +SELECT INSERT(`£Ã£±`,1,3,'޶޶޶') FROM `£Ô£´`; +INSERT(`£Ã£±`,1,3,'޶޶޶') +޶޶޶޴޵ +SELECT INSERT(`£Ã£±`,1,4,'޶޶޶޶') FROM `£Ô£´`; +INSERT(`£Ã£±`,1,4,'޶޶޶޶') +޶޶޶޶޵ +SELECT INSERT(`£Ã£±`,1,5,'޶޶޶޶޶') FROM `£Ô£´`; +INSERT(`£Ã£±`,1,5,'޶޶޶޶޶') +޶޶޶޶޶ +SELECT INSERT(`£Ã£±`,2,1,'޶') FROM `£Ô£´`; +INSERT(`£Ã£±`,2,1,'޶') +ޱ޶޳޴޵ +SELECT INSERT(`£Ã£±`,2,2,'޶޶') FROM `£Ô£´`; +INSERT(`£Ã£±`,2,2,'޶޶') +ޱ޶޶޴޵ +SELECT INSERT(`£Ã£±`,2,3,'޶޶޶') FROM `£Ô£´`; +INSERT(`£Ã£±`,2,3,'޶޶޶') +ޱ޶޶޶޵ +SELECT INSERT(`£Ã£±`,2,4,'޶޶޶޶') FROM `£Ô£´`; +INSERT(`£Ã£±`,2,4,'޶޶޶޶') +ޱ޶޶޶޶ +SELECT INSERT(`£Ã£±`,3,1,'޶') FROM `£Ô£´`; +INSERT(`£Ã£±`,3,1,'޶') +ޱ޲޶޴޵ +SELECT INSERT(`£Ã£±`,3,2,'޶޶') FROM `£Ô£´`; +INSERT(`£Ã£±`,3,2,'޶޶') +ޱ޲޶޶޵ +SELECT INSERT(`£Ã£±`,3,3,'޶޶޶') FROM `£Ô£´`; +INSERT(`£Ã£±`,3,3,'޶޶޶') +ޱ޲޶޶޶ +SELECT INSERT(`£Ã£±`,4,1,'޶') FROM `£Ô£´`; +INSERT(`£Ã£±`,4,1,'޶') +ޱ޲޳޶޵ +SELECT INSERT(`£Ã£±`,4,2,'޶޶') FROM `£Ô£´`; +INSERT(`£Ã£±`,4,2,'޶޶') +ޱ޲޳޶޶ +SELECT INSERT(`£Ã£±`,5,1,'޶') FROM `£Ô£´`; +INSERT(`£Ã£±`,5,1,'޶') +ޱ޲޳޴޶ +SELECT INSERT(`£Ã£±`,1,1,' ') FROM `£Ô£´`; +INSERT(`£Ã£±`,1,1,' ') + ޲޳޴޵ +SELECT INSERT(`£Ã£±`,1,2,' ') FROM `£Ô£´`; +INSERT(`£Ã£±`,1,2,' ') + ޳޴޵ +SELECT INSERT(`£Ã£±`,1,3,' ') FROM `£Ô£´`; +INSERT(`£Ã£±`,1,3,' ') + ޴޵ +SELECT INSERT(`£Ã£±`,1,4,' ') FROM `£Ô£´`; +INSERT(`£Ã£±`,1,4,' ') + ޵ +SELECT INSERT(`£Ã£±`,1,5,' ') FROM `£Ô£´`; +INSERT(`£Ã£±`,1,5,' ') + +SELECT INSERT(`£Ã£±`,2,1,' ') FROM `£Ô£´`; +INSERT(`£Ã£±`,2,1,' ') +ޱ ޳޴޵ +SELECT INSERT(`£Ã£±`,2,2,' ') FROM `£Ô£´`; +INSERT(`£Ã£±`,2,2,' ') +ޱ ޴޵ +SELECT INSERT(`£Ã£±`,2,3,' ') FROM `£Ô£´`; +INSERT(`£Ã£±`,2,3,' ') +ޱ ޵ +SELECT INSERT(`£Ã£±`,2,4,' ') FROM `£Ô£´`; +INSERT(`£Ã£±`,2,4,' ') +ޱ +SELECT INSERT(`£Ã£±`,3,1,' ') FROM `£Ô£´`; +INSERT(`£Ã£±`,3,1,' ') +ޱ޲ ޴޵ +SELECT INSERT(`£Ã£±`,3,2,' ') FROM `£Ô£´`; +INSERT(`£Ã£±`,3,2,' ') +ޱ޲ ޵ +SELECT INSERT(`£Ã£±`,3,3,' ') FROM `£Ô£´`; +INSERT(`£Ã£±`,3,3,' ') +ޱ޲ +SELECT INSERT(`£Ã£±`,4,1,' ') FROM `£Ô£´`; +INSERT(`£Ã£±`,4,1,' ') +ޱ޲޳ ޵ +SELECT INSERT(`£Ã£±`,4,2,' ') FROM `£Ô£´`; +INSERT(`£Ã£±`,4,2,' ') +ޱ޲޳ +SELECT INSERT(`£Ã£±`,5,1,' ') FROM `£Ô£´`; +INSERT(`£Ã£±`,5,1,' ') +ޱ޲޳޴ +SELECT INSERT(`£Ã£±`,1,1,'¤«') FROM `£Ô£µ`; +INSERT(`£Ã£±`,1,1,'¤«') +¤«¤¤¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,1,2,'¤«¤«') FROM `£Ô£µ`; +INSERT(`£Ã£±`,1,2,'¤«¤«') +¤«¤«¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,1,3,'¤«¤«¤«') FROM `£Ô£µ`; +INSERT(`£Ã£±`,1,3,'¤«¤«¤«') +¤«¤«¤«¤¨¤ª +SELECT INSERT(`£Ã£±`,1,4,'¤«¤«¤«¤«') FROM `£Ô£µ`; +INSERT(`£Ã£±`,1,4,'¤«¤«¤«¤«') +¤«¤«¤«¤«¤ª +SELECT INSERT(`£Ã£±`,1,5,'¤«¤«¤«¤«¤«') FROM `£Ô£µ`; +INSERT(`£Ã£±`,1,5,'¤«¤«¤«¤«¤«') +¤«¤«¤«¤«¤« +SELECT INSERT(`£Ã£±`,2,1,'¤«') FROM `£Ô£µ`; +INSERT(`£Ã£±`,2,1,'¤«') +¤¢¤«¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,2,2,'¤«¤«') FROM `£Ô£µ`; +INSERT(`£Ã£±`,2,2,'¤«¤«') +¤¢¤«¤«¤¨¤ª +SELECT INSERT(`£Ã£±`,2,3,'¤«¤«¤«') FROM `£Ô£µ`; +INSERT(`£Ã£±`,2,3,'¤«¤«¤«') +¤¢¤«¤«¤«¤ª +SELECT INSERT(`£Ã£±`,2,4,'¤«¤«¤«¤«') FROM `£Ô£µ`; +INSERT(`£Ã£±`,2,4,'¤«¤«¤«¤«') +¤¢¤«¤«¤«¤« +SELECT INSERT(`£Ã£±`,3,1,'¤«') FROM `£Ô£µ`; +INSERT(`£Ã£±`,3,1,'¤«') +¤¢¤¤¤«¤¨¤ª +SELECT INSERT(`£Ã£±`,3,2,'¤«¤«') FROM `£Ô£µ`; +INSERT(`£Ã£±`,3,2,'¤«¤«') +¤¢¤¤¤«¤«¤ª +SELECT INSERT(`£Ã£±`,3,3,'¤«¤«¤«') FROM `£Ô£µ`; +INSERT(`£Ã£±`,3,3,'¤«¤«¤«') +¤¢¤¤¤«¤«¤« +SELECT INSERT(`£Ã£±`,4,1,'¤«') FROM `£Ô£µ`; +INSERT(`£Ã£±`,4,1,'¤«') +¤¢¤¤¤¦¤«¤ª +SELECT INSERT(`£Ã£±`,4,2,'¤«¤«') FROM `£Ô£µ`; +INSERT(`£Ã£±`,4,2,'¤«¤«') +¤¢¤¤¤¦¤«¤« +SELECT INSERT(`£Ã£±`,5,1,'¤«') FROM `£Ô£µ`; +INSERT(`£Ã£±`,5,1,'¤«') +¤¢¤¤¤¦¤¨¤« +SELECT INSERT(`£Ã£±`,1,1,'¡¡') FROM `£Ô£µ`; +INSERT(`£Ã£±`,1,1,'¡¡') +¡¡¤¤¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,1,2,'¡¡¡¡') FROM `£Ô£µ`; +INSERT(`£Ã£±`,1,2,'¡¡¡¡') +¡¡¡¡¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,1,3,'¡¡¡¡¡¡') FROM `£Ô£µ`; +INSERT(`£Ã£±`,1,3,'¡¡¡¡¡¡') +¡¡¡¡¡¡¤¨¤ª +SELECT INSERT(`£Ã£±`,1,4,'¡¡¡¡¡¡¡¡') FROM `£Ô£µ`; +INSERT(`£Ã£±`,1,4,'¡¡¡¡¡¡¡¡') +¡¡¡¡¡¡¡¡¤ª +SELECT INSERT(`£Ã£±`,1,5,'¡¡¡¡¡¡¡¡¡¡') FROM `£Ô£µ`; +INSERT(`£Ã£±`,1,5,'¡¡¡¡¡¡¡¡¡¡') +¡¡¡¡¡¡¡¡¡¡ +SELECT INSERT(`£Ã£±`,2,1,'¡¡') FROM `£Ô£µ`; +INSERT(`£Ã£±`,2,1,'¡¡') +¤¢¡¡¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,2,2,'¡¡¡¡') FROM `£Ô£µ`; +INSERT(`£Ã£±`,2,2,'¡¡¡¡') +¤¢¡¡¡¡¤¨¤ª +SELECT INSERT(`£Ã£±`,2,3,'¡¡¡¡¡¡') FROM `£Ô£µ`; +INSERT(`£Ã£±`,2,3,'¡¡¡¡¡¡') +¤¢¡¡¡¡¡¡¤ª +SELECT INSERT(`£Ã£±`,2,4,'¡¡¡¡¡¡¡¡') FROM `£Ô£µ`; +INSERT(`£Ã£±`,2,4,'¡¡¡¡¡¡¡¡') +¤¢¡¡¡¡¡¡¡¡ +SELECT INSERT(`£Ã£±`,3,1,'¡¡') FROM `£Ô£µ`; +INSERT(`£Ã£±`,3,1,'¡¡') +¤¢¤¤¡¡¤¨¤ª +SELECT INSERT(`£Ã£±`,3,2,'¡¡¡¡') FROM `£Ô£µ`; +INSERT(`£Ã£±`,3,2,'¡¡¡¡') +¤¢¤¤¡¡¡¡¤ª +SELECT INSERT(`£Ã£±`,3,3,'¡¡¡¡¡¡') FROM `£Ô£µ`; +INSERT(`£Ã£±`,3,3,'¡¡¡¡¡¡') +¤¢¤¤¡¡¡¡¡¡ +SELECT INSERT(`£Ã£±`,4,1,'¡¡') FROM `£Ô£µ`; +INSERT(`£Ã£±`,4,1,'¡¡') +¤¢¤¤¤¦¡¡¤ª +SELECT INSERT(`£Ã£±`,4,2,'¡¡¡¡') FROM `£Ô£µ`; +INSERT(`£Ã£±`,4,2,'¡¡¡¡') +¤¢¤¤¤¦¡¡¡¡ +SELECT INSERT(`£Ã£±`,5,1,'¡¡') FROM `£Ô£µ`; +INSERT(`£Ã£±`,5,1,'¡¡') +¤¢¤¤¤¦¤¨¡¡ +SELECT INSERT(`£Ã£±`,1,1,'°¡') FROM `£Ô£¶`; +INSERT(`£Ã£±`,1,1,'°¡') +°¡íÝíÞíßíà +SELECT INSERT(`£Ã£±`,1,2,'°¡°¡' ) FROM `£Ô£¶`; +INSERT(`£Ã£±`,1,2,'°¡°¡' ) +°¡°¡íÞíßíà +SELECT INSERT(`£Ã£±`,1,3,'°¡°¡°¡' ) FROM `£Ô£¶`; +INSERT(`£Ã£±`,1,3,'°¡°¡°¡' ) +°¡°¡°¡íßíà +SELECT INSERT(`£Ã£±`,1,4,'°¡°¡°¡°¡' ) FROM `£Ô£¶`; +INSERT(`£Ã£±`,1,4,'°¡°¡°¡°¡' ) +°¡°¡°¡°¡íà +SELECT INSERT(`£Ã£±`,1,5,'°¡°¡°¡°¡°¡' ) FROM `£Ô£¶`; +INSERT(`£Ã£±`,1,5,'°¡°¡°¡°¡°¡' ) +°¡°¡°¡°¡°¡ +SELECT INSERT(`£Ã£±`,2,1,'°¡') FROM `£Ô£¶`; +INSERT(`£Ã£±`,2,1,'°¡') +íܰ¡íÞíßíà +SELECT INSERT(`£Ã£±`,2,2,'°¡°¡') FROM `£Ô£¶`; +INSERT(`£Ã£±`,2,2,'°¡°¡') +íܰ¡°¡íßíà +SELECT INSERT(`£Ã£±`,2,3,'°¡°¡°¡' ) FROM `£Ô£¶`; +INSERT(`£Ã£±`,2,3,'°¡°¡°¡' ) +íܰ¡°¡°¡íà +SELECT INSERT(`£Ã£±`,2,4,'°¡°¡°¡°¡' ) FROM `£Ô£¶`; +INSERT(`£Ã£±`,2,4,'°¡°¡°¡°¡' ) +íܰ¡°¡°¡°¡ +SELECT INSERT(`£Ã£±`,3,1,'°¡') FROM `£Ô£¶`; +INSERT(`£Ã£±`,3,1,'°¡') +íÜíݰ¡íßíà +SELECT INSERT(`£Ã£±`,3,2,'°¡°¡' ) FROM `£Ô£¶`; +INSERT(`£Ã£±`,3,2,'°¡°¡' ) +íÜíݰ¡°¡íà +SELECT INSERT(`£Ã£±`,3,3,'°¡°¡°¡' ) FROM `£Ô£¶`; +INSERT(`£Ã£±`,3,3,'°¡°¡°¡' ) +íÜíݰ¡°¡°¡ +SELECT INSERT(`£Ã£±`,4,1,'°¡') FROM `£Ô£¶`; +INSERT(`£Ã£±`,4,1,'°¡') +íÜíÝíÞ°¡íà +SELECT INSERT(`£Ã£±`,4,2,'°¡°¡' ) FROM `£Ô£¶`; +INSERT(`£Ã£±`,4,2,'°¡°¡' ) +íÜíÝíÞ°¡°¡ +SELECT INSERT(`£Ã£±`,5,1,'°¡') FROM `£Ô£¶`; +INSERT(`£Ã£±`,5,1,'°¡') +íÜíÝíÞíß°¡ +SELECT INSERT(`£Ã£±`,1,1,'޶') FROM `£Ô£·`; +INSERT(`£Ã£±`,1,1,'޶') +޶޲޳޴޵ +SELECT INSERT(`£Ã£±`,1,2,'޶޶') FROM `£Ô£·`; +INSERT(`£Ã£±`,1,2,'޶޶') +޶޶޳޴޵ +SELECT INSERT(`£Ã£±`,1,3,'޶޶޶') FROM `£Ô£·`; +INSERT(`£Ã£±`,1,3,'޶޶޶') +޶޶޶޴޵ +SELECT INSERT(`£Ã£±`,1,4,'޶޶޶޶') FROM `£Ô£·`; +INSERT(`£Ã£±`,1,4,'޶޶޶޶') +޶޶޶޶޵ +SELECT INSERT(`£Ã£±`,1,5,'޶޶޶޶޶') FROM `£Ô£·`; +INSERT(`£Ã£±`,1,5,'޶޶޶޶޶') +޶޶޶޶޶ +SELECT INSERT(`£Ã£±`,2,1,'޶') FROM `£Ô£·`; +INSERT(`£Ã£±`,2,1,'޶') +ޱ޶޳޴޵ +SELECT INSERT(`£Ã£±`,2,2,'޶޶') FROM `£Ô£·`; +INSERT(`£Ã£±`,2,2,'޶޶') +ޱ޶޶޴޵ +SELECT INSERT(`£Ã£±`,2,3,'޶޶޶') FROM `£Ô£·`; +INSERT(`£Ã£±`,2,3,'޶޶޶') +ޱ޶޶޶޵ +SELECT INSERT(`£Ã£±`,2,4,'޶޶޶޶') FROM `£Ô£·`; +INSERT(`£Ã£±`,2,4,'޶޶޶޶') +ޱ޶޶޶޶ +SELECT INSERT(`£Ã£±`,3,1,'޶') FROM `£Ô£·`; +INSERT(`£Ã£±`,3,1,'޶') +ޱ޲޶޴޵ +SELECT INSERT(`£Ã£±`,3,2,'޶޶') FROM `£Ô£·`; +INSERT(`£Ã£±`,3,2,'޶޶') +ޱ޲޶޶޵ +SELECT INSERT(`£Ã£±`,3,3,'޶޶޶') FROM `£Ô£·`; +INSERT(`£Ã£±`,3,3,'޶޶޶') +ޱ޲޶޶޶ +SELECT INSERT(`£Ã£±`,4,1,'޶') FROM `£Ô£·`; +INSERT(`£Ã£±`,4,1,'޶') +ޱ޲޳޶޵ +SELECT INSERT(`£Ã£±`,4,2,'޶޶') FROM `£Ô£·`; +INSERT(`£Ã£±`,4,2,'޶޶') +ޱ޲޳޶޶ +SELECT INSERT(`£Ã£±`,5,1,'޶') FROM `£Ô£·`; +INSERT(`£Ã£±`,5,1,'޶') +ޱ޲޳޴޶ +SELECT INSERT(`£Ã£±`,1,1,' ') FROM `£Ô£·`; +INSERT(`£Ã£±`,1,1,' ') + ޲޳޴޵ +SELECT INSERT(`£Ã£±`,1,2,' ') FROM `£Ô£·`; +INSERT(`£Ã£±`,1,2,' ') + ޳޴޵ +SELECT INSERT(`£Ã£±`,1,3,' ') FROM `£Ô£·`; +INSERT(`£Ã£±`,1,3,' ') + ޴޵ +SELECT INSERT(`£Ã£±`,1,4,' ') FROM `£Ô£·`; +INSERT(`£Ã£±`,1,4,' ') + ޵ +SELECT INSERT(`£Ã£±`,1,5,' ') FROM `£Ô£·`; +INSERT(`£Ã£±`,1,5,' ') + +SELECT INSERT(`£Ã£±`,2,1,' ') FROM `£Ô£·`; +INSERT(`£Ã£±`,2,1,' ') +ޱ ޳޴޵ +SELECT INSERT(`£Ã£±`,2,2,' ') FROM `£Ô£·`; +INSERT(`£Ã£±`,2,2,' ') +ޱ ޴޵ +SELECT INSERT(`£Ã£±`,2,3,' ') FROM `£Ô£·`; +INSERT(`£Ã£±`,2,3,' ') +ޱ ޵ +SELECT INSERT(`£Ã£±`,2,4,' ') FROM `£Ô£·`; +INSERT(`£Ã£±`,2,4,' ') +ޱ +SELECT INSERT(`£Ã£±`,3,1,' ') FROM `£Ô£·`; +INSERT(`£Ã£±`,3,1,' ') +ޱ޲ ޴޵ +SELECT INSERT(`£Ã£±`,3,2,' ') FROM `£Ô£·`; +INSERT(`£Ã£±`,3,2,' ') +ޱ޲ ޵ +SELECT INSERT(`£Ã£±`,3,3,' ') FROM `£Ô£·`; +INSERT(`£Ã£±`,3,3,' ') +ޱ޲ +SELECT INSERT(`£Ã£±`,4,1,' ') FROM `£Ô£·`; +INSERT(`£Ã£±`,4,1,' ') +ޱ޲޳ ޵ +SELECT INSERT(`£Ã£±`,4,2,' ') FROM `£Ô£·`; +INSERT(`£Ã£±`,4,2,' ') +ޱ޲޳ +SELECT INSERT(`£Ã£±`,5,1,' ') FROM `£Ô£·`; +INSERT(`£Ã£±`,5,1,' ') +ޱ޲޳޴ +SELECT INSERT(`£Ã£±`,1,1,'¤«') FROM `£Ô£¸`; +INSERT(`£Ã£±`,1,1,'¤«') +¤«¤¤¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,1,2,'¤«¤«') FROM `£Ô£¸`; +INSERT(`£Ã£±`,1,2,'¤«¤«') +¤«¤«¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,1,3,'¤«¤«¤«') FROM `£Ô£¸`; +INSERT(`£Ã£±`,1,3,'¤«¤«¤«') +¤«¤«¤«¤¨¤ª +SELECT INSERT(`£Ã£±`,1,4,'¤«¤«¤«¤«') FROM `£Ô£¸`; +INSERT(`£Ã£±`,1,4,'¤«¤«¤«¤«') +¤«¤«¤«¤«¤ª +SELECT INSERT(`£Ã£±`,1,5,'¤«¤«¤«¤«¤«') FROM `£Ô£¸`; +INSERT(`£Ã£±`,1,5,'¤«¤«¤«¤«¤«') +¤«¤«¤«¤«¤« +SELECT INSERT(`£Ã£±`,2,1,'¤«') FROM `£Ô£¸`; +INSERT(`£Ã£±`,2,1,'¤«') +¤¢¤«¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,2,2,'¤«¤«') FROM `£Ô£¸`; +INSERT(`£Ã£±`,2,2,'¤«¤«') +¤¢¤«¤«¤¨¤ª +SELECT INSERT(`£Ã£±`,2,3,'¤«¤«¤«') FROM `£Ô£¸`; +INSERT(`£Ã£±`,2,3,'¤«¤«¤«') +¤¢¤«¤«¤«¤ª +SELECT INSERT(`£Ã£±`,2,4,'¤«¤«¤«¤«') FROM `£Ô£¸`; +INSERT(`£Ã£±`,2,4,'¤«¤«¤«¤«') +¤¢¤«¤«¤«¤« +SELECT INSERT(`£Ã£±`,3,1,'¤«') FROM `£Ô£¸`; +INSERT(`£Ã£±`,3,1,'¤«') +¤¢¤¤¤«¤¨¤ª +SELECT INSERT(`£Ã£±`,3,2,'¤«¤«') FROM `£Ô£¸`; +INSERT(`£Ã£±`,3,2,'¤«¤«') +¤¢¤¤¤«¤«¤ª +SELECT INSERT(`£Ã£±`,3,3,'¤«¤«¤«') FROM `£Ô£¸`; +INSERT(`£Ã£±`,3,3,'¤«¤«¤«') +¤¢¤¤¤«¤«¤« +SELECT INSERT(`£Ã£±`,4,1,'¤«') FROM `£Ô£¸`; +INSERT(`£Ã£±`,4,1,'¤«') +¤¢¤¤¤¦¤«¤ª +SELECT INSERT(`£Ã£±`,4,2,'¤«¤«') FROM `£Ô£¸`; +INSERT(`£Ã£±`,4,2,'¤«¤«') +¤¢¤¤¤¦¤«¤« +SELECT INSERT(`£Ã£±`,5,1,'¤«') FROM `£Ô£¸`; +INSERT(`£Ã£±`,5,1,'¤«') +¤¢¤¤¤¦¤¨¤« +SELECT INSERT(`£Ã£±`,1,1,'¡¡') FROM `£Ô£¸`; +INSERT(`£Ã£±`,1,1,'¡¡') +¡¡¤¤¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,1,2,'¡¡¡¡') FROM `£Ô£¸`; +INSERT(`£Ã£±`,1,2,'¡¡¡¡') +¡¡¡¡¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,1,3,'¡¡¡¡¡¡') FROM `£Ô£¸`; +INSERT(`£Ã£±`,1,3,'¡¡¡¡¡¡') +¡¡¡¡¡¡¤¨¤ª +SELECT INSERT(`£Ã£±`,1,4,'¡¡¡¡¡¡¡¡') FROM `£Ô£¸`; +INSERT(`£Ã£±`,1,4,'¡¡¡¡¡¡¡¡') +¡¡¡¡¡¡¡¡¤ª +SELECT INSERT(`£Ã£±`,1,5,'¡¡¡¡¡¡¡¡¡¡') FROM `£Ô£¸`; +INSERT(`£Ã£±`,1,5,'¡¡¡¡¡¡¡¡¡¡') +¡¡¡¡¡¡¡¡¡¡ +SELECT INSERT(`£Ã£±`,2,1,'¡¡') FROM `£Ô£¸`; +INSERT(`£Ã£±`,2,1,'¡¡') +¤¢¡¡¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,2,2,'¡¡¡¡') FROM `£Ô£¸`; +INSERT(`£Ã£±`,2,2,'¡¡¡¡') +¤¢¡¡¡¡¤¨¤ª +SELECT INSERT(`£Ã£±`,2,3,'¡¡¡¡¡¡') FROM `£Ô£¸`; +INSERT(`£Ã£±`,2,3,'¡¡¡¡¡¡') +¤¢¡¡¡¡¡¡¤ª +SELECT INSERT(`£Ã£±`,2,4,'¡¡¡¡¡¡¡¡') FROM `£Ô£¸`; +INSERT(`£Ã£±`,2,4,'¡¡¡¡¡¡¡¡') +¤¢¡¡¡¡¡¡¡¡ +SELECT INSERT(`£Ã£±`,3,1,'¡¡') FROM `£Ô£¸`; +INSERT(`£Ã£±`,3,1,'¡¡') +¤¢¤¤¡¡¤¨¤ª +SELECT INSERT(`£Ã£±`,3,2,'¡¡¡¡') FROM `£Ô£¸`; +INSERT(`£Ã£±`,3,2,'¡¡¡¡') +¤¢¤¤¡¡¡¡¤ª +SELECT INSERT(`£Ã£±`,3,3,'¡¡¡¡¡¡') FROM `£Ô£¸`; +INSERT(`£Ã£±`,3,3,'¡¡¡¡¡¡') +¤¢¤¤¡¡¡¡¡¡ +SELECT INSERT(`£Ã£±`,4,1,'¡¡') FROM `£Ô£¸`; +INSERT(`£Ã£±`,4,1,'¡¡') +¤¢¤¤¤¦¡¡¤ª +SELECT INSERT(`£Ã£±`,4,2,'¡¡¡¡') FROM `£Ô£¸`; +INSERT(`£Ã£±`,4,2,'¡¡¡¡') +¤¢¤¤¤¦¡¡¡¡ +SELECT INSERT(`£Ã£±`,5,1,'¡¡') FROM `£Ô£¸`; +INSERT(`£Ã£±`,5,1,'¡¡') +¤¢¤¤¤¦¤¨¡¡ +SELECT INSERT(`£Ã£±`,1,1,'°¡') FROM `£Ô£¹`; +INSERT(`£Ã£±`,1,1,'°¡') +°¡íÝíÞíßíà +SELECT INSERT(`£Ã£±`,1,2,'°¡°¡' ) FROM `£Ô£¹`; +INSERT(`£Ã£±`,1,2,'°¡°¡' ) +°¡°¡íÞíßíà +SELECT INSERT(`£Ã£±`,1,3,'°¡°¡°¡' ) FROM `£Ô£¹`; +INSERT(`£Ã£±`,1,3,'°¡°¡°¡' ) +°¡°¡°¡íßíà +SELECT INSERT(`£Ã£±`,1,4,'°¡°¡°¡°¡' ) FROM `£Ô£¹`; +INSERT(`£Ã£±`,1,4,'°¡°¡°¡°¡' ) +°¡°¡°¡°¡íà +SELECT INSERT(`£Ã£±`,1,5,'°¡°¡°¡°¡°¡' ) FROM `£Ô£¹`; +INSERT(`£Ã£±`,1,5,'°¡°¡°¡°¡°¡' ) +°¡°¡°¡°¡°¡ +SELECT INSERT(`£Ã£±`,2,1,'°¡') FROM `£Ô£¹`; +INSERT(`£Ã£±`,2,1,'°¡') +íܰ¡íÞíßíà +SELECT INSERT(`£Ã£±`,2,2,'°¡°¡' ) FROM `£Ô£¹`; +INSERT(`£Ã£±`,2,2,'°¡°¡' ) +íܰ¡°¡íßíà +SELECT INSERT(`£Ã£±`,2,3,'°¡°¡°¡' ) FROM `£Ô£¹`; +INSERT(`£Ã£±`,2,3,'°¡°¡°¡' ) +íܰ¡°¡°¡íà +SELECT INSERT(`£Ã£±`,2,4,'°¡°¡°¡°¡' ) FROM `£Ô£¹`; +INSERT(`£Ã£±`,2,4,'°¡°¡°¡°¡' ) +íܰ¡°¡°¡°¡ +SELECT INSERT(`£Ã£±`,3,1,'°¡') FROM `£Ô£¹`; +INSERT(`£Ã£±`,3,1,'°¡') +íÜíݰ¡íßíà +SELECT INSERT(`£Ã£±`,3,2,'°¡°¡' ) FROM `£Ô£¹`; +INSERT(`£Ã£±`,3,2,'°¡°¡' ) +íÜíݰ¡°¡íà +SELECT INSERT(`£Ã£±`,3,3,'°¡°¡°¡' ) FROM `£Ô£¹`; +INSERT(`£Ã£±`,3,3,'°¡°¡°¡' ) +íÜíݰ¡°¡°¡ +SELECT INSERT(`£Ã£±`,4,1,'°¡') FROM `£Ô£¹`; +INSERT(`£Ã£±`,4,1,'°¡') +íÜíÝíÞ°¡íà +SELECT INSERT(`£Ã£±`,4,2,'°¡°¡' ) FROM `£Ô£¹`; +INSERT(`£Ã£±`,4,2,'°¡°¡' ) +íÜíÝíÞ°¡°¡ +SELECT INSERT(`£Ã£±`,5,1,'°¡') FROM `£Ô£¹`; +INSERT(`£Ã£±`,5,1,'°¡') +íÜíÝíÞíß°¡ +SELECT INSERT(`£Ã£±`,1,1,'޶') FROM `£Ô£±£°`; +INSERT(`£Ã£±`,1,1,'޶') +޶޲޳޴޵ +SELECT INSERT(`£Ã£±`,1,2,'޶޶') FROM `£Ô£±£°`; +INSERT(`£Ã£±`,1,2,'޶޶') +޶޶޳޴޵ +SELECT INSERT(`£Ã£±`,1,3,'޶޶޶') FROM `£Ô£±£°`; +INSERT(`£Ã£±`,1,3,'޶޶޶') +޶޶޶޴޵ +SELECT INSERT(`£Ã£±`,1,4,'޶޶޶޶') FROM `£Ô£±£°`; +INSERT(`£Ã£±`,1,4,'޶޶޶޶') +޶޶޶޶޵ +SELECT INSERT(`£Ã£±`,1,5,'޶޶޶޶޶') FROM `£Ô£±£°`; +INSERT(`£Ã£±`,1,5,'޶޶޶޶޶') +޶޶޶޶޶ +SELECT INSERT(`£Ã£±`,2,1,'޶') FROM `£Ô£±£°`; +INSERT(`£Ã£±`,2,1,'޶') +ޱ޶޳޴޵ +SELECT INSERT(`£Ã£±`,2,2,'޶޶') FROM `£Ô£±£°`; +INSERT(`£Ã£±`,2,2,'޶޶') +ޱ޶޶޴޵ +SELECT INSERT(`£Ã£±`,2,3,'޶޶޶') FROM `£Ô£±£°`; +INSERT(`£Ã£±`,2,3,'޶޶޶') +ޱ޶޶޶޵ +SELECT INSERT(`£Ã£±`,2,4,'޶޶޶޶') FROM `£Ô£±£°`; +INSERT(`£Ã£±`,2,4,'޶޶޶޶') +ޱ޶޶޶޶ +SELECT INSERT(`£Ã£±`,3,1,'޶') FROM `£Ô£±£°`; +INSERT(`£Ã£±`,3,1,'޶') +ޱ޲޶޴޵ +SELECT INSERT(`£Ã£±`,3,2,'޶޶') FROM `£Ô£±£°`; +INSERT(`£Ã£±`,3,2,'޶޶') +ޱ޲޶޶޵ +SELECT INSERT(`£Ã£±`,3,3,'޶޶޶') FROM `£Ô£±£°`; +INSERT(`£Ã£±`,3,3,'޶޶޶') +ޱ޲޶޶޶ +SELECT INSERT(`£Ã£±`,4,1,'޶') FROM `£Ô£±£°`; +INSERT(`£Ã£±`,4,1,'޶') +ޱ޲޳޶޵ +SELECT INSERT(`£Ã£±`,4,2,'޶޶') FROM `£Ô£±£°`; +INSERT(`£Ã£±`,4,2,'޶޶') +ޱ޲޳޶޶ +SELECT INSERT(`£Ã£±`,5,1,'޶') FROM `£Ô£±£°`; +INSERT(`£Ã£±`,5,1,'޶') +ޱ޲޳޴޶ +SELECT INSERT(`£Ã£±`,1,1,'¤«') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,1,1,'¤«') +¤«¤¤¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,1,2,'¤«¤«') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,1,2,'¤«¤«') +¤«¤«¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,1,3,'¤«¤«¤«') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,1,3,'¤«¤«¤«') +¤«¤«¤«¤¨¤ª +SELECT INSERT(`£Ã£±`,1,4,'¤«¤«¤«¤«') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,1,4,'¤«¤«¤«¤«') +¤«¤«¤«¤«¤ª +SELECT INSERT(`£Ã£±`,1,5,'¤«¤«¤«¤«¤«') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,1,5,'¤«¤«¤«¤«¤«') +¤«¤«¤«¤«¤« +SELECT INSERT(`£Ã£±`,2,1,'¤«') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,2,1,'¤«') +¤¢¤«¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,2,2,'¤«¤«') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,2,2,'¤«¤«') +¤¢¤«¤«¤¨¤ª +SELECT INSERT(`£Ã£±`,2,3,'¤«¤«¤«') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,2,3,'¤«¤«¤«') +¤¢¤«¤«¤«¤ª +SELECT INSERT(`£Ã£±`,2,4,'¤«¤«¤«¤«') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,2,4,'¤«¤«¤«¤«') +¤¢¤«¤«¤«¤« +SELECT INSERT(`£Ã£±`,3,1,'¤«') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,3,1,'¤«') +¤¢¤¤¤«¤¨¤ª +SELECT INSERT(`£Ã£±`,3,2,'¤«¤«') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,3,2,'¤«¤«') +¤¢¤¤¤«¤«¤ª +SELECT INSERT(`£Ã£±`,3,3,'¤«¤«¤«') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,3,3,'¤«¤«¤«') +¤¢¤¤¤«¤«¤« +SELECT INSERT(`£Ã£±`,4,1,'¤«') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,4,1,'¤«') +¤¢¤¤¤¦¤«¤ª +SELECT INSERT(`£Ã£±`,4,2,'¤«¤«') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,4,2,'¤«¤«') +¤¢¤¤¤¦¤«¤« +SELECT INSERT(`£Ã£±`,5,1,'¤«') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,5,1,'¤«') +¤¢¤¤¤¦¤¨¤« +SELECT INSERT(`£Ã£±`,1,1,'¡¡') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,1,1,'¡¡') +¡¡¤¤¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,1,2,'¡¡¡¡') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,1,2,'¡¡¡¡') +¡¡¡¡¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,1,3,'¡¡¡¡¡¡') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,1,3,'¡¡¡¡¡¡') +¡¡¡¡¡¡¤¨¤ª +SELECT INSERT(`£Ã£±`,1,4,'¡¡¡¡¡¡¡¡') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,1,4,'¡¡¡¡¡¡¡¡') +¡¡¡¡¡¡¡¡¤ª +SELECT INSERT(`£Ã£±`,1,5,'¡¡¡¡¡¡¡¡¡¡') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,1,5,'¡¡¡¡¡¡¡¡¡¡') +¡¡¡¡¡¡¡¡¡¡ +SELECT INSERT(`£Ã£±`,2,1,'¡¡') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,2,1,'¡¡') +¤¢¡¡¤¦¤¨¤ª +SELECT INSERT(`£Ã£±`,2,2,'¡¡¡¡') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,2,2,'¡¡¡¡') +¤¢¡¡¡¡¤¨¤ª +SELECT INSERT(`£Ã£±`,2,3,'¡¡¡¡¡¡') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,2,3,'¡¡¡¡¡¡') +¤¢¡¡¡¡¡¡¤ª +SELECT INSERT(`£Ã£±`,2,4,'¡¡¡¡¡¡¡¡') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,2,4,'¡¡¡¡¡¡¡¡') +¤¢¡¡¡¡¡¡¡¡ +SELECT INSERT(`£Ã£±`,3,1,'¡¡') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,3,1,'¡¡') +¤¢¤¤¡¡¤¨¤ª +SELECT INSERT(`£Ã£±`,3,2,'¡¡¡¡') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,3,2,'¡¡¡¡') +¤¢¤¤¡¡¡¡¤ª +SELECT INSERT(`£Ã£±`,3,3,'¡¡¡¡¡¡') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,3,3,'¡¡¡¡¡¡') +¤¢¤¤¡¡¡¡¡¡ +SELECT INSERT(`£Ã£±`,4,1,'¡¡') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,4,1,'¡¡') +¤¢¤¤¤¦¡¡¤ª +SELECT INSERT(`£Ã£±`,4,2,'¡¡¡¡') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,4,2,'¡¡¡¡') +¤¢¤¤¤¦¡¡¡¡ +SELECT INSERT(`£Ã£±`,5,1,'¡¡') FROM `£Ô£±£±`; +INSERT(`£Ã£±`,5,1,'¡¡') +¤¢¤¤¤¦¤¨¡¡ +SELECT INSERT(`£Ã£±`,1,1,'°¡') FROM `£Ô£±£²`; +INSERT(`£Ã£±`,1,1,'°¡') +°¡íÝíÞíßíà +SELECT INSERT(`£Ã£±`,1,2,'°¡°¡') FROM `£Ô£±£²`; +INSERT(`£Ã£±`,1,2,'°¡°¡') +°¡°¡íÞíßíà +SELECT INSERT(`£Ã£±`,1,3,'°¡°¡°¡') FROM `£Ô£±£²`; +INSERT(`£Ã£±`,1,3,'°¡°¡°¡') +°¡°¡°¡íßíà +SELECT INSERT(`£Ã£±`,1,4,'°¡°¡°¡°¡') FROM `£Ô£±£²`; +INSERT(`£Ã£±`,1,4,'°¡°¡°¡°¡') +°¡°¡°¡°¡íà +SELECT INSERT(`£Ã£±`,1,5,'°¡°¡°¡°¡°¡') FROM `£Ô£±£²`; +INSERT(`£Ã£±`,1,5,'°¡°¡°¡°¡°¡') +°¡°¡°¡°¡°¡ +SELECT INSERT(`£Ã£±`,2,1,'°¡') FROM `£Ô£±£²`; +INSERT(`£Ã£±`,2,1,'°¡') +íܰ¡íÞíßíà +SELECT INSERT(`£Ã£±`,2,2,'°¡°¡') FROM `£Ô£±£²`; +INSERT(`£Ã£±`,2,2,'°¡°¡') +íܰ¡°¡íßíà +SELECT INSERT(`£Ã£±`,2,3,'°¡°¡°¡') FROM `£Ô£±£²`; +INSERT(`£Ã£±`,2,3,'°¡°¡°¡') +íܰ¡°¡°¡íà +SELECT INSERT(`£Ã£±`,2,4,'°¡°¡°¡°¡') FROM `£Ô£±£²`; +INSERT(`£Ã£±`,2,4,'°¡°¡°¡°¡') +íܰ¡°¡°¡°¡ +SELECT INSERT(`£Ã£±`,3,1,'°¡') FROM `£Ô£±£²`; +INSERT(`£Ã£±`,3,1,'°¡') +íÜíݰ¡íßíà +SELECT INSERT(`£Ã£±`,3,2,'°¡°¡') FROM `£Ô£±£²`; +INSERT(`£Ã£±`,3,2,'°¡°¡') +íÜíݰ¡°¡íà +SELECT INSERT(`£Ã£±`,3,3,'°¡°¡°¡') FROM `£Ô£±£²`; +INSERT(`£Ã£±`,3,3,'°¡°¡°¡') +íÜíݰ¡°¡°¡ +SELECT INSERT(`£Ã£±`,4,1,'°¡') FROM `£Ô£±£²`; +INSERT(`£Ã£±`,4,1,'°¡') +íÜíÝíÞ°¡íà +SELECT INSERT(`£Ã£±`,4,2,'°¡°¡') FROM `£Ô£±£²`; +INSERT(`£Ã£±`,4,2,'°¡°¡') +íÜíÝíÞ°¡°¡ +SELECT INSERT(`£Ã£±`,5,1,'°¡') FROM `£Ô£±£²`; +INSERT(`£Ã£±`,5,1,'°¡') +íÜíÝíÞíß°¡ +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/r/jp_insert_utf8.result b/mysql-test/suite/jp/r/jp_insert_utf8.result new file mode 100755 index 00000000000..368ba35f637 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_insert_utf8.result @@ -0,0 +1,905 @@ +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +drop table if exists `T11`; +drop table if exists `T12`; +SET NAMES utf8; +SET character_set_database = utf8; +CREATE TABLE `T1` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T11` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T12` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = bdb; +INSERT INTO `T1` VALUES ('アイウエオ'); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T3` VALUES ('龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオ'); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオ'); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡'); +INSERT INTO `T1ï¼` VALUES ('アイウエオ'); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T12` VALUES ('龔龖龗龞龡'); +SELECT INSERT(`C1`,1,1,'ï½¶') FROM `T1`; +INSERT(`C1`,1,1,'ï½¶') +カイウエオ +SELECT INSERT(`C1`,1,2,'ï½¶ï½¶') FROM `T1`; +INSERT(`C1`,1,2,'ï½¶ï½¶') +カカウエオ +SELECT INSERT(`C1`,1,3,'ï½¶ï½¶ï½¶') FROM `T1`; +INSERT(`C1`,1,3,'ï½¶ï½¶ï½¶') +ï½¶ï½¶ï½¶ï½´ï½µ +SELECT INSERT(`C1`,1,4,'ï½¶ï½¶ï½¶ï½¶') FROM `T1`; +INSERT(`C1`,1,4,'ï½¶ï½¶ï½¶ï½¶') +ï½¶ï½¶ï½¶ï½¶ï½µ +SELECT INSERT(`C1`,1,5,'ï½¶ï½¶ï½¶ï½¶ï½¶') FROM `T1`; +INSERT(`C1`,1,5,'ï½¶ï½¶ï½¶ï½¶ï½¶') +ï½¶ï½¶ï½¶ï½¶ï½¶ +SELECT INSERT(`C1`,2,1,'ï½¶') FROM `T1`; +INSERT(`C1`,2,1,'ï½¶') +アカウエオ +SELECT INSERT(`C1`,2,2,'ï½¶ï½¶') FROM `T1`; +INSERT(`C1`,2,2,'ï½¶ï½¶') +アカカエオ +SELECT INSERT(`C1`,2,3,'ï½¶ï½¶ï½¶') FROM `T1`; +INSERT(`C1`,2,3,'ï½¶ï½¶ï½¶') +アカカカオ +SELECT INSERT(`C1`,2,4,'ï½¶ï½¶ï½¶ï½¶') FROM `T1`; +INSERT(`C1`,2,4,'ï½¶ï½¶ï½¶ï½¶') +アカカカカ +SELECT INSERT(`C1`,3,1,'ï½¶') FROM `T1`; +INSERT(`C1`,3,1,'ï½¶') +アイカエオ +SELECT INSERT(`C1`,3,2,'ï½¶ï½¶') FROM `T1`; +INSERT(`C1`,3,2,'ï½¶ï½¶') +アイカカオ +SELECT INSERT(`C1`,3,3,'ï½¶ï½¶ï½¶') FROM `T1`; +INSERT(`C1`,3,3,'ï½¶ï½¶ï½¶') +アイカカカ +SELECT INSERT(`C1`,4,1,'ï½¶') FROM `T1`; +INSERT(`C1`,4,1,'ï½¶') +アイウカオ +SELECT INSERT(`C1`,4,2,'ï½¶ï½¶') FROM `T1`; +INSERT(`C1`,4,2,'ï½¶ï½¶') +アイウカカ +SELECT INSERT(`C1`,5,1,'ï½¶') FROM `T1`; +INSERT(`C1`,5,1,'ï½¶') +アイウエカ +SELECT INSERT(`C1`,1,1,' ') FROM `T1`; +INSERT(`C1`,1,1,' ') + イウエオ +SELECT INSERT(`C1`,1,2,' ') FROM `T1`; +INSERT(`C1`,1,2,' ') + ウエオ +SELECT INSERT(`C1`,1,3,' ') FROM `T1`; +INSERT(`C1`,1,3,' ') + ï½´ï½µ +SELECT INSERT(`C1`,1,4,' ') FROM `T1`; +INSERT(`C1`,1,4,' ') + ï½µ +SELECT INSERT(`C1`,1,5,' ') FROM `T1`; +INSERT(`C1`,1,5,' ') + +SELECT INSERT(`C1`,2,1,' ') FROM `T1`; +INSERT(`C1`,2,1,' ') +ï½± ウエオ +SELECT INSERT(`C1`,2,2,' ') FROM `T1`; +INSERT(`C1`,2,2,' ') +ï½± ï½´ï½µ +SELECT INSERT(`C1`,2,3,' ') FROM `T1`; +INSERT(`C1`,2,3,' ') +ï½± ï½µ +SELECT INSERT(`C1`,2,4,' ') FROM `T1`; +INSERT(`C1`,2,4,' ') +ï½± +SELECT INSERT(`C1`,3,1,' ') FROM `T1`; +INSERT(`C1`,3,1,' ') +アイ ï½´ï½µ +SELECT INSERT(`C1`,3,2,' ') FROM `T1`; +INSERT(`C1`,3,2,' ') +アイ ï½µ +SELECT INSERT(`C1`,3,3,' ') FROM `T1`; +INSERT(`C1`,3,3,' ') +アイ +SELECT INSERT(`C1`,4,1,' ') FROM `T1`; +INSERT(`C1`,4,1,' ') +アイウ ï½µ +SELECT INSERT(`C1`,4,2,' ') FROM `T1`; +INSERT(`C1`,4,2,' ') +アイウ +SELECT INSERT(`C1`,5,1,' ') FROM `T1`; +INSERT(`C1`,5,1,' ') +アイウエ +SELECT INSERT(`C1`,1,1,'ã‹') FROM `ï¼´ï¼’`; +INSERT(`C1`,1,1,'ã‹') +ã‹ã„ã†ãˆãŠ +SELECT INSERT(`C1`,1,2,'ã‹ã‹') FROM `ï¼´ï¼’`; +INSERT(`C1`,1,2,'ã‹ã‹') +ã‹ã‹ã†ãˆãŠ +SELECT INSERT(`C1`,1,3,'ã‹ã‹ã‹') FROM `ï¼´ï¼’`; +INSERT(`C1`,1,3,'ã‹ã‹ã‹') +ã‹ã‹ã‹ãˆãŠ +SELECT INSERT(`C1`,1,4,'ã‹ã‹ã‹ã‹') FROM `ï¼´ï¼’`; +INSERT(`C1`,1,4,'ã‹ã‹ã‹ã‹') +ã‹ã‹ã‹ã‹ãŠ +SELECT INSERT(`C1`,1,5,'ã‹ã‹ã‹ã‹ã‹') FROM `ï¼´ï¼’`; +INSERT(`C1`,1,5,'ã‹ã‹ã‹ã‹ã‹') +ã‹ã‹ã‹ã‹ã‹ +SELECT INSERT(`C1`,2,1,'ã‹') FROM `ï¼´ï¼’`; +INSERT(`C1`,2,1,'ã‹') +ã‚ã‹ã†ãˆãŠ +SELECT INSERT(`C1`,2,2,'ã‹ã‹') FROM `ï¼´ï¼’`; +INSERT(`C1`,2,2,'ã‹ã‹') +ã‚ã‹ã‹ãˆãŠ +SELECT INSERT(`C1`,2,3,'ã‹ã‹ã‹') FROM `ï¼´ï¼’`; +INSERT(`C1`,2,3,'ã‹ã‹ã‹') +ã‚ã‹ã‹ã‹ãŠ +SELECT INSERT(`C1`,2,4,'ã‹ã‹ã‹ã‹') FROM `ï¼´ï¼’`; +INSERT(`C1`,2,4,'ã‹ã‹ã‹ã‹') +ã‚ã‹ã‹ã‹ã‹ +SELECT INSERT(`C1`,3,1,'ã‹') FROM `ï¼´ï¼’`; +INSERT(`C1`,3,1,'ã‹') +ã‚ã„ã‹ãˆãŠ +SELECT INSERT(`C1`,3,2,'ã‹ã‹') FROM `ï¼´ï¼’`; +INSERT(`C1`,3,2,'ã‹ã‹') +ã‚ã„ã‹ã‹ãŠ +SELECT INSERT(`C1`,3,3,'ã‹ã‹ã‹') FROM `ï¼´ï¼’`; +INSERT(`C1`,3,3,'ã‹ã‹ã‹') +ã‚ã„ã‹ã‹ã‹ +SELECT INSERT(`C1`,4,1,'ã‹') FROM `ï¼´ï¼’`; +INSERT(`C1`,4,1,'ã‹') +ã‚ã„ã†ã‹ãŠ +SELECT INSERT(`C1`,4,2,'ã‹ã‹') FROM `ï¼´ï¼’`; +INSERT(`C1`,4,2,'ã‹ã‹') +ã‚ã„ã†ã‹ã‹ +SELECT INSERT(`C1`,5,1,'ã‹') FROM `ï¼´ï¼’`; +INSERT(`C1`,5,1,'ã‹') +ã‚ã„ã†ãˆã‹ +SELECT INSERT(`C1`,1,1,' ') FROM `ï¼´ï¼’`; +INSERT(`C1`,1,1,' ') + ã„ã†ãˆãŠ +SELECT INSERT(`C1`,1,2,'  ') FROM `ï¼´ï¼’`; +INSERT(`C1`,1,2,'  ') +  ã†ãˆãŠ +SELECT INSERT(`C1`,1,3,'   ') FROM `ï¼´ï¼’`; +INSERT(`C1`,1,3,'   ') +   ãˆãŠ +SELECT INSERT(`C1`,1,4,'    ') FROM `ï¼´ï¼’`; +INSERT(`C1`,1,4,'    ') +    ㊠+SELECT INSERT(`C1`,1,5,'     ') FROM `ï¼´ï¼’`; +INSERT(`C1`,1,5,'     ') +      +SELECT INSERT(`C1`,2,1,' ') FROM `ï¼´ï¼’`; +INSERT(`C1`,2,1,' ') +ã‚ ã†ãˆãŠ +SELECT INSERT(`C1`,2,2,'  ') FROM `ï¼´ï¼’`; +INSERT(`C1`,2,2,'  ') +ã‚  ãˆãŠ +SELECT INSERT(`C1`,2,3,'   ') FROM `ï¼´ï¼’`; +INSERT(`C1`,2,3,'   ') +ã‚   ㊠+SELECT INSERT(`C1`,2,4,'    ') FROM `ï¼´ï¼’`; +INSERT(`C1`,2,4,'    ') +ã‚     +SELECT INSERT(`C1`,3,1,' ') FROM `ï¼´ï¼’`; +INSERT(`C1`,3,1,' ') +ã‚ã„ ãˆãŠ +SELECT INSERT(`C1`,3,2,'  ') FROM `ï¼´ï¼’`; +INSERT(`C1`,3,2,'  ') +ã‚ã„  ㊠+SELECT INSERT(`C1`,3,3,'   ') FROM `ï¼´ï¼’`; +INSERT(`C1`,3,3,'   ') +ã‚ã„    +SELECT INSERT(`C1`,4,1,' ') FROM `ï¼´ï¼’`; +INSERT(`C1`,4,1,' ') +ã‚ã„ã†ã€€ãŠ +SELECT INSERT(`C1`,4,2,'  ') FROM `ï¼´ï¼’`; +INSERT(`C1`,4,2,'  ') +ã‚ã„ã†ã€€ã€€ +SELECT INSERT(`C1`,5,1,' ') FROM `ï¼´ï¼’`; +INSERT(`C1`,5,1,' ') +ã‚ã„ã†ãˆã€€ +SELECT INSERT(`C1`,1,1,'丂') FROM `T3`; +INSERT(`C1`,1,1,'丂') +丂龖龗龞龡 +SELECT INSERT(`C1`,1,2,'丂丂' ) FROM `T3`; +INSERT(`C1`,1,2,'丂丂' ) +丂丂龗龞龡 +SELECT INSERT(`C1`,1,3,'丂丂丂' ) FROM `T3`; +INSERT(`C1`,1,3,'丂丂丂' ) +丂丂丂龞龡 +SELECT INSERT(`C1`,1,4,'丂丂丂丂' ) FROM `T3`; +INSERT(`C1`,1,4,'丂丂丂丂' ) +丂丂丂丂龡 +SELECT INSERT(`C1`,1,5,'丂丂丂丂丂' ) FROM `T3`; +INSERT(`C1`,1,5,'丂丂丂丂丂' ) +丂丂丂丂丂 +SELECT INSERT(`C1`,2,1,'丂') FROM `T3`; +INSERT(`C1`,2,1,'丂') +龔丂龗龞龡 +SELECT INSERT(`C1`,2,2,'丂丂' ) FROM `T3`; +INSERT(`C1`,2,2,'丂丂' ) +龔丂丂龞龡 +SELECT INSERT(`C1`,2,3,'丂丂丂' ) FROM `T3`; +INSERT(`C1`,2,3,'丂丂丂' ) +龔丂丂丂龡 +SELECT INSERT(`C1`,2,4,'丂丂丂丂' ) FROM `T3`; +INSERT(`C1`,2,4,'丂丂丂丂' ) +龔丂丂丂丂 +SELECT INSERT(`C1`,3,1,'丂') FROM `T3`; +INSERT(`C1`,3,1,'丂') +龔龖丂龞龡 +SELECT INSERT(`C1`,3,2,'丂丂' ) FROM `T3`; +INSERT(`C1`,3,2,'丂丂' ) +龔龖丂丂龡 +SELECT INSERT(`C1`,3,3,'丂丂丂' ) FROM `T3`; +INSERT(`C1`,3,3,'丂丂丂' ) +龔龖丂丂丂 +SELECT INSERT(`C1`,4,1,'丂') FROM `T3`; +INSERT(`C1`,4,1,'丂') +龔龖龗丂龡 +SELECT INSERT(`C1`,4,2,'丂丂' ) FROM `T3`; +INSERT(`C1`,4,2,'丂丂' ) +龔龖龗丂丂 +SELECT INSERT(`C1`,5,1,'丂') FROM `T3`; +INSERT(`C1`,5,1,'丂') +龔龖龗龞丂 +SELECT INSERT(`C1`,1,1,'ï½¶') FROM `ï¼´ï¼”`; +INSERT(`C1`,1,1,'ï½¶') +カイウエオ +SELECT INSERT(`C1`,1,2,'ï½¶ï½¶') FROM `ï¼´ï¼”`; +INSERT(`C1`,1,2,'ï½¶ï½¶') +カカウエオ +SELECT INSERT(`C1`,1,3,'ï½¶ï½¶ï½¶') FROM `ï¼´ï¼”`; +INSERT(`C1`,1,3,'ï½¶ï½¶ï½¶') +ï½¶ï½¶ï½¶ï½´ï½µ +SELECT INSERT(`C1`,1,4,'ï½¶ï½¶ï½¶ï½¶') FROM `ï¼´ï¼”`; +INSERT(`C1`,1,4,'ï½¶ï½¶ï½¶ï½¶') +ï½¶ï½¶ï½¶ï½¶ï½µ +SELECT INSERT(`C1`,1,5,'ï½¶ï½¶ï½¶ï½¶ï½¶') FROM `ï¼´ï¼”`; +INSERT(`C1`,1,5,'ï½¶ï½¶ï½¶ï½¶ï½¶') +ï½¶ï½¶ï½¶ï½¶ï½¶ +SELECT INSERT(`C1`,2,1,'ï½¶') FROM `ï¼´ï¼”`; +INSERT(`C1`,2,1,'ï½¶') +アカウエオ +SELECT INSERT(`C1`,2,2,'ï½¶ï½¶') FROM `ï¼´ï¼”`; +INSERT(`C1`,2,2,'ï½¶ï½¶') +アカカエオ +SELECT INSERT(`C1`,2,3,'ï½¶ï½¶ï½¶') FROM `ï¼´ï¼”`; +INSERT(`C1`,2,3,'ï½¶ï½¶ï½¶') +アカカカオ +SELECT INSERT(`C1`,2,4,'ï½¶ï½¶ï½¶ï½¶') FROM `ï¼´ï¼”`; +INSERT(`C1`,2,4,'ï½¶ï½¶ï½¶ï½¶') +アカカカカ +SELECT INSERT(`C1`,3,1,'ï½¶') FROM `ï¼´ï¼”`; +INSERT(`C1`,3,1,'ï½¶') +アイカエオ +SELECT INSERT(`C1`,3,2,'ï½¶ï½¶') FROM `ï¼´ï¼”`; +INSERT(`C1`,3,2,'ï½¶ï½¶') +アイカカオ +SELECT INSERT(`C1`,3,3,'ï½¶ï½¶ï½¶') FROM `ï¼´ï¼”`; +INSERT(`C1`,3,3,'ï½¶ï½¶ï½¶') +アイカカカ +SELECT INSERT(`C1`,4,1,'ï½¶') FROM `ï¼´ï¼”`; +INSERT(`C1`,4,1,'ï½¶') +アイウカオ +SELECT INSERT(`C1`,4,2,'ï½¶ï½¶') FROM `ï¼´ï¼”`; +INSERT(`C1`,4,2,'ï½¶ï½¶') +アイウカカ +SELECT INSERT(`C1`,5,1,'ï½¶') FROM `ï¼´ï¼”`; +INSERT(`C1`,5,1,'ï½¶') +アイウエカ +SELECT INSERT(`C1`,1,1,' ') FROM `ï¼´ï¼”`; +INSERT(`C1`,1,1,' ') + イウエオ +SELECT INSERT(`C1`,1,2,' ') FROM `ï¼´ï¼”`; +INSERT(`C1`,1,2,' ') + ウエオ +SELECT INSERT(`C1`,1,3,' ') FROM `ï¼´ï¼”`; +INSERT(`C1`,1,3,' ') + ï½´ï½µ +SELECT INSERT(`C1`,1,4,' ') FROM `ï¼´ï¼”`; +INSERT(`C1`,1,4,' ') + ï½µ +SELECT INSERT(`C1`,1,5,' ') FROM `ï¼´ï¼”`; +INSERT(`C1`,1,5,' ') + +SELECT INSERT(`C1`,2,1,' ') FROM `ï¼´ï¼”`; +INSERT(`C1`,2,1,' ') +ï½± ウエオ +SELECT INSERT(`C1`,2,2,' ') FROM `ï¼´ï¼”`; +INSERT(`C1`,2,2,' ') +ï½± ï½´ï½µ +SELECT INSERT(`C1`,2,3,' ') FROM `ï¼´ï¼”`; +INSERT(`C1`,2,3,' ') +ï½± ï½µ +SELECT INSERT(`C1`,2,4,' ') FROM `ï¼´ï¼”`; +INSERT(`C1`,2,4,' ') +ï½± +SELECT INSERT(`C1`,3,1,' ') FROM `ï¼´ï¼”`; +INSERT(`C1`,3,1,' ') +アイ ï½´ï½µ +SELECT INSERT(`C1`,3,2,' ') FROM `ï¼´ï¼”`; +INSERT(`C1`,3,2,' ') +アイ ï½µ +SELECT INSERT(`C1`,3,3,' ') FROM `ï¼´ï¼”`; +INSERT(`C1`,3,3,' ') +アイ +SELECT INSERT(`C1`,4,1,' ') FROM `ï¼´ï¼”`; +INSERT(`C1`,4,1,' ') +アイウ ï½µ +SELECT INSERT(`C1`,4,2,' ') FROM `ï¼´ï¼”`; +INSERT(`C1`,4,2,' ') +アイウ +SELECT INSERT(`C1`,5,1,' ') FROM `ï¼´ï¼”`; +INSERT(`C1`,5,1,' ') +アイウエ +SELECT INSERT(`C1`,1,1,'ã‹') FROM `T5`; +INSERT(`C1`,1,1,'ã‹') +ã‹ã„ã†ãˆãŠ +SELECT INSERT(`C1`,1,2,'ã‹ã‹') FROM `T5`; +INSERT(`C1`,1,2,'ã‹ã‹') +ã‹ã‹ã†ãˆãŠ +SELECT INSERT(`C1`,1,3,'ã‹ã‹ã‹') FROM `T5`; +INSERT(`C1`,1,3,'ã‹ã‹ã‹') +ã‹ã‹ã‹ãˆãŠ +SELECT INSERT(`C1`,1,4,'ã‹ã‹ã‹ã‹') FROM `T5`; +INSERT(`C1`,1,4,'ã‹ã‹ã‹ã‹') +ã‹ã‹ã‹ã‹ãŠ +SELECT INSERT(`C1`,1,5,'ã‹ã‹ã‹ã‹ã‹') FROM `T5`; +INSERT(`C1`,1,5,'ã‹ã‹ã‹ã‹ã‹') +ã‹ã‹ã‹ã‹ã‹ +SELECT INSERT(`C1`,2,1,'ã‹') FROM `T5`; +INSERT(`C1`,2,1,'ã‹') +ã‚ã‹ã†ãˆãŠ +SELECT INSERT(`C1`,2,2,'ã‹ã‹') FROM `T5`; +INSERT(`C1`,2,2,'ã‹ã‹') +ã‚ã‹ã‹ãˆãŠ +SELECT INSERT(`C1`,2,3,'ã‹ã‹ã‹') FROM `T5`; +INSERT(`C1`,2,3,'ã‹ã‹ã‹') +ã‚ã‹ã‹ã‹ãŠ +SELECT INSERT(`C1`,2,4,'ã‹ã‹ã‹ã‹') FROM `T5`; +INSERT(`C1`,2,4,'ã‹ã‹ã‹ã‹') +ã‚ã‹ã‹ã‹ã‹ +SELECT INSERT(`C1`,3,1,'ã‹') FROM `T5`; +INSERT(`C1`,3,1,'ã‹') +ã‚ã„ã‹ãˆãŠ +SELECT INSERT(`C1`,3,2,'ã‹ã‹') FROM `T5`; +INSERT(`C1`,3,2,'ã‹ã‹') +ã‚ã„ã‹ã‹ãŠ +SELECT INSERT(`C1`,3,3,'ã‹ã‹ã‹') FROM `T5`; +INSERT(`C1`,3,3,'ã‹ã‹ã‹') +ã‚ã„ã‹ã‹ã‹ +SELECT INSERT(`C1`,4,1,'ã‹') FROM `T5`; +INSERT(`C1`,4,1,'ã‹') +ã‚ã„ã†ã‹ãŠ +SELECT INSERT(`C1`,4,2,'ã‹ã‹') FROM `T5`; +INSERT(`C1`,4,2,'ã‹ã‹') +ã‚ã„ã†ã‹ã‹ +SELECT INSERT(`C1`,5,1,'ã‹') FROM `T5`; +INSERT(`C1`,5,1,'ã‹') +ã‚ã„ã†ãˆã‹ +SELECT INSERT(`C1`,1,1,' ') FROM `T5`; +INSERT(`C1`,1,1,' ') + ã„ã†ãˆãŠ +SELECT INSERT(`C1`,1,2,'  ') FROM `T5`; +INSERT(`C1`,1,2,'  ') +  ã†ãˆãŠ +SELECT INSERT(`C1`,1,3,'   ') FROM `T5`; +INSERT(`C1`,1,3,'   ') +   ãˆãŠ +SELECT INSERT(`C1`,1,4,'    ') FROM `T5`; +INSERT(`C1`,1,4,'    ') +    ㊠+SELECT INSERT(`C1`,1,5,'     ') FROM `T5`; +INSERT(`C1`,1,5,'     ') +      +SELECT INSERT(`C1`,2,1,' ') FROM `T5`; +INSERT(`C1`,2,1,' ') +ã‚ ã†ãˆãŠ +SELECT INSERT(`C1`,2,2,'  ') FROM `T5`; +INSERT(`C1`,2,2,'  ') +ã‚  ãˆãŠ +SELECT INSERT(`C1`,2,3,'   ') FROM `T5`; +INSERT(`C1`,2,3,'   ') +ã‚   ㊠+SELECT INSERT(`C1`,2,4,'    ') FROM `T5`; +INSERT(`C1`,2,4,'    ') +ã‚     +SELECT INSERT(`C1`,3,1,' ') FROM `T5`; +INSERT(`C1`,3,1,' ') +ã‚ã„ ãˆãŠ +SELECT INSERT(`C1`,3,2,'  ') FROM `T5`; +INSERT(`C1`,3,2,'  ') +ã‚ã„  ㊠+SELECT INSERT(`C1`,3,3,'   ') FROM `T5`; +INSERT(`C1`,3,3,'   ') +ã‚ã„    +SELECT INSERT(`C1`,4,1,' ') FROM `T5`; +INSERT(`C1`,4,1,' ') +ã‚ã„ã†ã€€ãŠ +SELECT INSERT(`C1`,4,2,'  ') FROM `T5`; +INSERT(`C1`,4,2,'  ') +ã‚ã„ã†ã€€ã€€ +SELECT INSERT(`C1`,5,1,' ') FROM `T5`; +INSERT(`C1`,5,1,' ') +ã‚ã„ã†ãˆã€€ +SELECT INSERT(`C1`,1,1,'丂') FROM `ï¼´ï¼–`; +INSERT(`C1`,1,1,'丂') +丂龖龗龞龡 +SELECT INSERT(`C1`,1,2,'丂丂' ) FROM `ï¼´ï¼–`; +INSERT(`C1`,1,2,'丂丂' ) +丂丂龗龞龡 +SELECT INSERT(`C1`,1,3,'丂丂丂' ) FROM `ï¼´ï¼–`; +INSERT(`C1`,1,3,'丂丂丂' ) +丂丂丂龞龡 +SELECT INSERT(`C1`,1,4,'丂丂丂丂' ) FROM `ï¼´ï¼–`; +INSERT(`C1`,1,4,'丂丂丂丂' ) +丂丂丂丂龡 +SELECT INSERT(`C1`,1,5,'丂丂丂丂丂' ) FROM `ï¼´ï¼–`; +INSERT(`C1`,1,5,'丂丂丂丂丂' ) +丂丂丂丂丂 +SELECT INSERT(`C1`,2,1,'丂') FROM `ï¼´ï¼–`; +INSERT(`C1`,2,1,'丂') +龔丂龗龞龡 +SELECT INSERT(`C1`,2,2,'丂丂') FROM `ï¼´ï¼–`; +INSERT(`C1`,2,2,'丂丂') +龔丂丂龞龡 +SELECT INSERT(`C1`,2,3,'丂丂丂' ) FROM `ï¼´ï¼–`; +INSERT(`C1`,2,3,'丂丂丂' ) +龔丂丂丂龡 +SELECT INSERT(`C1`,2,4,'丂丂丂丂' ) FROM `ï¼´ï¼–`; +INSERT(`C1`,2,4,'丂丂丂丂' ) +龔丂丂丂丂 +SELECT INSERT(`C1`,3,1,'丂') FROM `ï¼´ï¼–`; +INSERT(`C1`,3,1,'丂') +龔龖丂龞龡 +SELECT INSERT(`C1`,3,2,'丂丂' ) FROM `ï¼´ï¼–`; +INSERT(`C1`,3,2,'丂丂' ) +龔龖丂丂龡 +SELECT INSERT(`C1`,3,3,'丂丂丂' ) FROM `ï¼´ï¼–`; +INSERT(`C1`,3,3,'丂丂丂' ) +龔龖丂丂丂 +SELECT INSERT(`C1`,4,1,'丂') FROM `ï¼´ï¼–`; +INSERT(`C1`,4,1,'丂') +龔龖龗丂龡 +SELECT INSERT(`C1`,4,2,'丂丂' ) FROM `ï¼´ï¼–`; +INSERT(`C1`,4,2,'丂丂' ) +龔龖龗丂丂 +SELECT INSERT(`C1`,5,1,'丂') FROM `ï¼´ï¼–`; +INSERT(`C1`,5,1,'丂') +龔龖龗龞丂 +SELECT INSERT(`C1`,1,1,'ï½¶') FROM `ï¼´ï¼—`; +INSERT(`C1`,1,1,'ï½¶') +カイウエオ +SELECT INSERT(`C1`,1,2,'ï½¶ï½¶') FROM `ï¼´ï¼—`; +INSERT(`C1`,1,2,'ï½¶ï½¶') +カカウエオ +SELECT INSERT(`C1`,1,3,'ï½¶ï½¶ï½¶') FROM `ï¼´ï¼—`; +INSERT(`C1`,1,3,'ï½¶ï½¶ï½¶') +ï½¶ï½¶ï½¶ï½´ï½µ +SELECT INSERT(`C1`,1,4,'ï½¶ï½¶ï½¶ï½¶') FROM `ï¼´ï¼—`; +INSERT(`C1`,1,4,'ï½¶ï½¶ï½¶ï½¶') +ï½¶ï½¶ï½¶ï½¶ï½µ +SELECT INSERT(`C1`,1,5,'ï½¶ï½¶ï½¶ï½¶ï½¶') FROM `ï¼´ï¼—`; +INSERT(`C1`,1,5,'ï½¶ï½¶ï½¶ï½¶ï½¶') +ï½¶ï½¶ï½¶ï½¶ï½¶ +SELECT INSERT(`C1`,2,1,'ï½¶') FROM `ï¼´ï¼—`; +INSERT(`C1`,2,1,'ï½¶') +アカウエオ +SELECT INSERT(`C1`,2,2,'ï½¶ï½¶') FROM `ï¼´ï¼—`; +INSERT(`C1`,2,2,'ï½¶ï½¶') +アカカエオ +SELECT INSERT(`C1`,2,3,'ï½¶ï½¶ï½¶') FROM `ï¼´ï¼—`; +INSERT(`C1`,2,3,'ï½¶ï½¶ï½¶') +アカカカオ +SELECT INSERT(`C1`,2,4,'ï½¶ï½¶ï½¶ï½¶') FROM `ï¼´ï¼—`; +INSERT(`C1`,2,4,'ï½¶ï½¶ï½¶ï½¶') +アカカカカ +SELECT INSERT(`C1`,3,1,'ï½¶') FROM `ï¼´ï¼—`; +INSERT(`C1`,3,1,'ï½¶') +アイカエオ +SELECT INSERT(`C1`,3,2,'ï½¶ï½¶') FROM `ï¼´ï¼—`; +INSERT(`C1`,3,2,'ï½¶ï½¶') +アイカカオ +SELECT INSERT(`C1`,3,3,'ï½¶ï½¶ï½¶') FROM `ï¼´ï¼—`; +INSERT(`C1`,3,3,'ï½¶ï½¶ï½¶') +アイカカカ +SELECT INSERT(`C1`,4,1,'ï½¶') FROM `ï¼´ï¼—`; +INSERT(`C1`,4,1,'ï½¶') +アイウカオ +SELECT INSERT(`C1`,4,2,'ï½¶ï½¶') FROM `ï¼´ï¼—`; +INSERT(`C1`,4,2,'ï½¶ï½¶') +アイウカカ +SELECT INSERT(`C1`,5,1,'ï½¶') FROM `ï¼´ï¼—`; +INSERT(`C1`,5,1,'ï½¶') +アイウエカ +SELECT INSERT(`C1`,1,1,' ') FROM `ï¼´ï¼—`; +INSERT(`C1`,1,1,' ') + イウエオ +SELECT INSERT(`C1`,1,2,' ') FROM `ï¼´ï¼—`; +INSERT(`C1`,1,2,' ') + ウエオ +SELECT INSERT(`C1`,1,3,' ') FROM `ï¼´ï¼—`; +INSERT(`C1`,1,3,' ') + ï½´ï½µ +SELECT INSERT(`C1`,1,4,' ') FROM `ï¼´ï¼—`; +INSERT(`C1`,1,4,' ') + ï½µ +SELECT INSERT(`C1`,1,5,' ') FROM `ï¼´ï¼—`; +INSERT(`C1`,1,5,' ') + +SELECT INSERT(`C1`,2,1,' ') FROM `ï¼´ï¼—`; +INSERT(`C1`,2,1,' ') +ï½± ウエオ +SELECT INSERT(`C1`,2,2,' ') FROM `ï¼´ï¼—`; +INSERT(`C1`,2,2,' ') +ï½± ï½´ï½µ +SELECT INSERT(`C1`,2,3,' ') FROM `ï¼´ï¼—`; +INSERT(`C1`,2,3,' ') +ï½± ï½µ +SELECT INSERT(`C1`,2,4,' ') FROM `ï¼´ï¼—`; +INSERT(`C1`,2,4,' ') +ï½± +SELECT INSERT(`C1`,3,1,' ') FROM `ï¼´ï¼—`; +INSERT(`C1`,3,1,' ') +アイ ï½´ï½µ +SELECT INSERT(`C1`,3,2,' ') FROM `ï¼´ï¼—`; +INSERT(`C1`,3,2,' ') +アイ ï½µ +SELECT INSERT(`C1`,3,3,' ') FROM `ï¼´ï¼—`; +INSERT(`C1`,3,3,' ') +アイ +SELECT INSERT(`C1`,4,1,' ') FROM `ï¼´ï¼—`; +INSERT(`C1`,4,1,' ') +アイウ ï½µ +SELECT INSERT(`C1`,4,2,' ') FROM `ï¼´ï¼—`; +INSERT(`C1`,4,2,' ') +アイウ +SELECT INSERT(`C1`,5,1,' ') FROM `ï¼´ï¼—`; +INSERT(`C1`,5,1,' ') +アイウエ +SELECT INSERT(`C1`,1,1,'ã‹') FROM `T8`; +INSERT(`C1`,1,1,'ã‹') +ã‹ã„ã†ãˆãŠ +SELECT INSERT(`C1`,1,2,'ã‹ã‹') FROM `T8`; +INSERT(`C1`,1,2,'ã‹ã‹') +ã‹ã‹ã†ãˆãŠ +SELECT INSERT(`C1`,1,3,'ã‹ã‹ã‹') FROM `T8`; +INSERT(`C1`,1,3,'ã‹ã‹ã‹') +ã‹ã‹ã‹ãˆãŠ +SELECT INSERT(`C1`,1,4,'ã‹ã‹ã‹ã‹') FROM `T8`; +INSERT(`C1`,1,4,'ã‹ã‹ã‹ã‹') +ã‹ã‹ã‹ã‹ãŠ +SELECT INSERT(`C1`,1,5,'ã‹ã‹ã‹ã‹ã‹') FROM `T8`; +INSERT(`C1`,1,5,'ã‹ã‹ã‹ã‹ã‹') +ã‹ã‹ã‹ã‹ã‹ +SELECT INSERT(`C1`,2,1,'ã‹') FROM `T8`; +INSERT(`C1`,2,1,'ã‹') +ã‚ã‹ã†ãˆãŠ +SELECT INSERT(`C1`,2,2,'ã‹ã‹') FROM `T8`; +INSERT(`C1`,2,2,'ã‹ã‹') +ã‚ã‹ã‹ãˆãŠ +SELECT INSERT(`C1`,2,3,'ã‹ã‹ã‹') FROM `T8`; +INSERT(`C1`,2,3,'ã‹ã‹ã‹') +ã‚ã‹ã‹ã‹ãŠ +SELECT INSERT(`C1`,2,4,'ã‹ã‹ã‹ã‹') FROM `T8`; +INSERT(`C1`,2,4,'ã‹ã‹ã‹ã‹') +ã‚ã‹ã‹ã‹ã‹ +SELECT INSERT(`C1`,3,1,'ã‹') FROM `T8`; +INSERT(`C1`,3,1,'ã‹') +ã‚ã„ã‹ãˆãŠ +SELECT INSERT(`C1`,3,2,'ã‹ã‹') FROM `T8`; +INSERT(`C1`,3,2,'ã‹ã‹') +ã‚ã„ã‹ã‹ãŠ +SELECT INSERT(`C1`,3,3,'ã‹ã‹ã‹') FROM `T8`; +INSERT(`C1`,3,3,'ã‹ã‹ã‹') +ã‚ã„ã‹ã‹ã‹ +SELECT INSERT(`C1`,4,1,'ã‹') FROM `T8`; +INSERT(`C1`,4,1,'ã‹') +ã‚ã„ã†ã‹ãŠ +SELECT INSERT(`C1`,4,2,'ã‹ã‹') FROM `T8`; +INSERT(`C1`,4,2,'ã‹ã‹') +ã‚ã„ã†ã‹ã‹ +SELECT INSERT(`C1`,5,1,'ã‹') FROM `T8`; +INSERT(`C1`,5,1,'ã‹') +ã‚ã„ã†ãˆã‹ +SELECT INSERT(`C1`,1,1,' ') FROM `T8`; +INSERT(`C1`,1,1,' ') + ã„ã†ãˆãŠ +SELECT INSERT(`C1`,1,2,'  ') FROM `T8`; +INSERT(`C1`,1,2,'  ') +  ã†ãˆãŠ +SELECT INSERT(`C1`,1,3,'   ') FROM `T8`; +INSERT(`C1`,1,3,'   ') +   ãˆãŠ +SELECT INSERT(`C1`,1,4,'    ') FROM `T8`; +INSERT(`C1`,1,4,'    ') +    ㊠+SELECT INSERT(`C1`,1,5,'     ') FROM `T8`; +INSERT(`C1`,1,5,'     ') +      +SELECT INSERT(`C1`,2,1,' ') FROM `T8`; +INSERT(`C1`,2,1,' ') +ã‚ ã†ãˆãŠ +SELECT INSERT(`C1`,2,2,'  ') FROM `T8`; +INSERT(`C1`,2,2,'  ') +ã‚  ãˆãŠ +SELECT INSERT(`C1`,2,3,'   ') FROM `T8`; +INSERT(`C1`,2,3,'   ') +ã‚   ㊠+SELECT INSERT(`C1`,2,4,'    ') FROM `T8`; +INSERT(`C1`,2,4,'    ') +ã‚     +SELECT INSERT(`C1`,3,1,' ') FROM `T8`; +INSERT(`C1`,3,1,' ') +ã‚ã„ ãˆãŠ +SELECT INSERT(`C1`,3,2,'  ') FROM `T8`; +INSERT(`C1`,3,2,'  ') +ã‚ã„  ㊠+SELECT INSERT(`C1`,3,3,'   ') FROM `T8`; +INSERT(`C1`,3,3,'   ') +ã‚ã„    +SELECT INSERT(`C1`,4,1,' ') FROM `T8`; +INSERT(`C1`,4,1,' ') +ã‚ã„ã†ã€€ãŠ +SELECT INSERT(`C1`,4,2,'  ') FROM `T8`; +INSERT(`C1`,4,2,'  ') +ã‚ã„ã†ã€€ã€€ +SELECT INSERT(`C1`,5,1,' ') FROM `T8`; +INSERT(`C1`,5,1,' ') +ã‚ã„ã†ãˆã€€ +SELECT INSERT(`C1`,1,1,'丂') FROM `ï¼´ï¼™`; +INSERT(`C1`,1,1,'丂') +丂龖龗龞龡 +SELECT INSERT(`C1`,1,2,'丂丂' ) FROM `ï¼´ï¼™`; +INSERT(`C1`,1,2,'丂丂' ) +丂丂龗龞龡 +SELECT INSERT(`C1`,1,3,'丂丂丂' ) FROM `ï¼´ï¼™`; +INSERT(`C1`,1,3,'丂丂丂' ) +丂丂丂龞龡 +SELECT INSERT(`C1`,1,4,'丂丂丂丂' ) FROM `ï¼´ï¼™`; +INSERT(`C1`,1,4,'丂丂丂丂' ) +丂丂丂丂龡 +SELECT INSERT(`C1`,1,5,'丂丂丂丂丂' ) FROM `ï¼´ï¼™`; +INSERT(`C1`,1,5,'丂丂丂丂丂' ) +丂丂丂丂丂 +SELECT INSERT(`C1`,2,1,'丂') FROM `ï¼´ï¼™`; +INSERT(`C1`,2,1,'丂') +龔丂龗龞龡 +SELECT INSERT(`C1`,2,2,'丂丂' ) FROM `ï¼´ï¼™`; +INSERT(`C1`,2,2,'丂丂' ) +龔丂丂龞龡 +SELECT INSERT(`C1`,2,3,'丂丂丂' ) FROM `ï¼´ï¼™`; +INSERT(`C1`,2,3,'丂丂丂' ) +龔丂丂丂龡 +SELECT INSERT(`C1`,2,4,'丂丂丂丂' ) FROM `ï¼´ï¼™`; +INSERT(`C1`,2,4,'丂丂丂丂' ) +龔丂丂丂丂 +SELECT INSERT(`C1`,3,1,'丂') FROM `ï¼´ï¼™`; +INSERT(`C1`,3,1,'丂') +龔龖丂龞龡 +SELECT INSERT(`C1`,3,2,'丂丂' ) FROM `ï¼´ï¼™`; +INSERT(`C1`,3,2,'丂丂' ) +龔龖丂丂龡 +SELECT INSERT(`C1`,3,3,'丂丂丂' ) FROM `ï¼´ï¼™`; +INSERT(`C1`,3,3,'丂丂丂' ) +龔龖丂丂丂 +SELECT INSERT(`C1`,4,1,'丂') FROM `ï¼´ï¼™`; +INSERT(`C1`,4,1,'丂') +龔龖龗丂龡 +SELECT INSERT(`C1`,4,2,'丂丂' ) FROM `ï¼´ï¼™`; +INSERT(`C1`,4,2,'丂丂' ) +龔龖龗丂丂 +SELECT INSERT(`C1`,5,1,'丂') FROM `ï¼´ï¼™`; +INSERT(`C1`,5,1,'丂') +龔龖龗龞丂 +SELECT INSERT(`C1`,1,1,'ï½¶') FROM `T1ï¼`; +INSERT(`C1`,1,1,'ï½¶') +カイウエオ +SELECT INSERT(`C1`,1,2,'ï½¶ï½¶') FROM `T1ï¼`; +INSERT(`C1`,1,2,'ï½¶ï½¶') +カカウエオ +SELECT INSERT(`C1`,1,3,'ï½¶ï½¶ï½¶') FROM `T1ï¼`; +INSERT(`C1`,1,3,'ï½¶ï½¶ï½¶') +ï½¶ï½¶ï½¶ï½´ï½µ +SELECT INSERT(`C1`,1,4,'ï½¶ï½¶ï½¶ï½¶') FROM `T1ï¼`; +INSERT(`C1`,1,4,'ï½¶ï½¶ï½¶ï½¶') +ï½¶ï½¶ï½¶ï½¶ï½µ +SELECT INSERT(`C1`,1,5,'ï½¶ï½¶ï½¶ï½¶ï½¶') FROM `T1ï¼`; +INSERT(`C1`,1,5,'ï½¶ï½¶ï½¶ï½¶ï½¶') +ï½¶ï½¶ï½¶ï½¶ï½¶ +SELECT INSERT(`C1`,2,1,'ï½¶') FROM `T1ï¼`; +INSERT(`C1`,2,1,'ï½¶') +アカウエオ +SELECT INSERT(`C1`,2,2,'ï½¶ï½¶') FROM `T1ï¼`; +INSERT(`C1`,2,2,'ï½¶ï½¶') +アカカエオ +SELECT INSERT(`C1`,2,3,'ï½¶ï½¶ï½¶') FROM `T1ï¼`; +INSERT(`C1`,2,3,'ï½¶ï½¶ï½¶') +アカカカオ +SELECT INSERT(`C1`,2,4,'ï½¶ï½¶ï½¶ï½¶') FROM `T1ï¼`; +INSERT(`C1`,2,4,'ï½¶ï½¶ï½¶ï½¶') +アカカカカ +SELECT INSERT(`C1`,3,1,'ï½¶') FROM `T1ï¼`; +INSERT(`C1`,3,1,'ï½¶') +アイカエオ +SELECT INSERT(`C1`,3,2,'ï½¶ï½¶') FROM `T1ï¼`; +INSERT(`C1`,3,2,'ï½¶ï½¶') +アイカカオ +SELECT INSERT(`C1`,3,3,'ï½¶ï½¶ï½¶') FROM `T1ï¼`; +INSERT(`C1`,3,3,'ï½¶ï½¶ï½¶') +アイカカカ +SELECT INSERT(`C1`,4,1,'ï½¶') FROM `T1ï¼`; +INSERT(`C1`,4,1,'ï½¶') +アイウカオ +SELECT INSERT(`C1`,4,2,'ï½¶ï½¶') FROM `T1ï¼`; +INSERT(`C1`,4,2,'ï½¶ï½¶') +アイウカカ +SELECT INSERT(`C1`,5,1,'ï½¶') FROM `T1ï¼`; +INSERT(`C1`,5,1,'ï½¶') +アイウエカ +SELECT INSERT(`C1`,1,1,'ã‹') FROM `T11`; +INSERT(`C1`,1,1,'ã‹') +ã‹ã„ã†ãˆãŠ +SELECT INSERT(`C1`,1,2,'ã‹ã‹') FROM `T11`; +INSERT(`C1`,1,2,'ã‹ã‹') +ã‹ã‹ã†ãˆãŠ +SELECT INSERT(`C1`,1,3,'ã‹ã‹ã‹') FROM `T11`; +INSERT(`C1`,1,3,'ã‹ã‹ã‹') +ã‹ã‹ã‹ãˆãŠ +SELECT INSERT(`C1`,1,4,'ã‹ã‹ã‹ã‹') FROM `T11`; +INSERT(`C1`,1,4,'ã‹ã‹ã‹ã‹') +ã‹ã‹ã‹ã‹ãŠ +SELECT INSERT(`C1`,1,5,'ã‹ã‹ã‹ã‹ã‹') FROM `T11`; +INSERT(`C1`,1,5,'ã‹ã‹ã‹ã‹ã‹') +ã‹ã‹ã‹ã‹ã‹ +SELECT INSERT(`C1`,2,1,'ã‹') FROM `T11`; +INSERT(`C1`,2,1,'ã‹') +ã‚ã‹ã†ãˆãŠ +SELECT INSERT(`C1`,2,2,'ã‹ã‹') FROM `T11`; +INSERT(`C1`,2,2,'ã‹ã‹') +ã‚ã‹ã‹ãˆãŠ +SELECT INSERT(`C1`,2,3,'ã‹ã‹ã‹') FROM `T11`; +INSERT(`C1`,2,3,'ã‹ã‹ã‹') +ã‚ã‹ã‹ã‹ãŠ +SELECT INSERT(`C1`,2,4,'ã‹ã‹ã‹ã‹') FROM `T11`; +INSERT(`C1`,2,4,'ã‹ã‹ã‹ã‹') +ã‚ã‹ã‹ã‹ã‹ +SELECT INSERT(`C1`,3,1,'ã‹') FROM `T11`; +INSERT(`C1`,3,1,'ã‹') +ã‚ã„ã‹ãˆãŠ +SELECT INSERT(`C1`,3,2,'ã‹ã‹') FROM `T11`; +INSERT(`C1`,3,2,'ã‹ã‹') +ã‚ã„ã‹ã‹ãŠ +SELECT INSERT(`C1`,3,3,'ã‹ã‹ã‹') FROM `T11`; +INSERT(`C1`,3,3,'ã‹ã‹ã‹') +ã‚ã„ã‹ã‹ã‹ +SELECT INSERT(`C1`,4,1,'ã‹') FROM `T11`; +INSERT(`C1`,4,1,'ã‹') +ã‚ã„ã†ã‹ãŠ +SELECT INSERT(`C1`,4,2,'ã‹ã‹') FROM `T11`; +INSERT(`C1`,4,2,'ã‹ã‹') +ã‚ã„ã†ã‹ã‹ +SELECT INSERT(`C1`,5,1,'ã‹') FROM `T11`; +INSERT(`C1`,5,1,'ã‹') +ã‚ã„ã†ãˆã‹ +SELECT INSERT(`C1`,1,1,' ') FROM `T11`; +INSERT(`C1`,1,1,' ') + ã„ã†ãˆãŠ +SELECT INSERT(`C1`,1,2,'  ') FROM `T11`; +INSERT(`C1`,1,2,'  ') +  ã†ãˆãŠ +SELECT INSERT(`C1`,1,3,'   ') FROM `T11`; +INSERT(`C1`,1,3,'   ') +   ãˆãŠ +SELECT INSERT(`C1`,1,4,'    ') FROM `T11`; +INSERT(`C1`,1,4,'    ') +    ㊠+SELECT INSERT(`C1`,1,5,'     ') FROM `T11`; +INSERT(`C1`,1,5,'     ') +      +SELECT INSERT(`C1`,2,1,' ') FROM `T11`; +INSERT(`C1`,2,1,' ') +ã‚ ã†ãˆãŠ +SELECT INSERT(`C1`,2,2,'  ') FROM `T11`; +INSERT(`C1`,2,2,'  ') +ã‚  ãˆãŠ +SELECT INSERT(`C1`,2,3,'   ') FROM `T11`; +INSERT(`C1`,2,3,'   ') +ã‚   ㊠+SELECT INSERT(`C1`,2,4,'    ') FROM `T11`; +INSERT(`C1`,2,4,'    ') +ã‚     +SELECT INSERT(`C1`,3,1,' ') FROM `T11`; +INSERT(`C1`,3,1,' ') +ã‚ã„ ãˆãŠ +SELECT INSERT(`C1`,3,2,'  ') FROM `T11`; +INSERT(`C1`,3,2,'  ') +ã‚ã„  ㊠+SELECT INSERT(`C1`,3,3,'   ') FROM `T11`; +INSERT(`C1`,3,3,'   ') +ã‚ã„    +SELECT INSERT(`C1`,4,1,' ') FROM `T11`; +INSERT(`C1`,4,1,' ') +ã‚ã„ã†ã€€ãŠ +SELECT INSERT(`C1`,4,2,'  ') FROM `T11`; +INSERT(`C1`,4,2,'  ') +ã‚ã„ã†ã€€ã€€ +SELECT INSERT(`C1`,5,1,' ') FROM `T11`; +INSERT(`C1`,5,1,' ') +ã‚ã„ã†ãˆã€€ +SELECT INSERT(`C1`,1,1,'丂') FROM `T12`; +INSERT(`C1`,1,1,'丂') +丂龖龗龞龡 +SELECT INSERT(`C1`,1,2,'丂丂') FROM `T12`; +INSERT(`C1`,1,2,'丂丂') +丂丂龗龞龡 +SELECT INSERT(`C1`,1,3,'丂丂丂') FROM `T12`; +INSERT(`C1`,1,3,'丂丂丂') +丂丂丂龞龡 +SELECT INSERT(`C1`,1,4,'丂丂丂丂') FROM `T12`; +INSERT(`C1`,1,4,'丂丂丂丂') +丂丂丂丂龡 +SELECT INSERT(`C1`,1,5,'丂丂丂丂丂') FROM `T12`; +INSERT(`C1`,1,5,'丂丂丂丂丂') +丂丂丂丂丂 +SELECT INSERT(`C1`,2,1,'丂') FROM `T12`; +INSERT(`C1`,2,1,'丂') +龔丂龗龞龡 +SELECT INSERT(`C1`,2,2,'丂丂') FROM `T12`; +INSERT(`C1`,2,2,'丂丂') +龔丂丂龞龡 +SELECT INSERT(`C1`,2,3,'丂丂丂') FROM `T12`; +INSERT(`C1`,2,3,'丂丂丂') +龔丂丂丂龡 +SELECT INSERT(`C1`,2,4,'丂丂丂丂') FROM `T12`; +INSERT(`C1`,2,4,'丂丂丂丂') +龔丂丂丂丂 +SELECT INSERT(`C1`,3,1,'丂') FROM `T12`; +INSERT(`C1`,3,1,'丂') +龔龖丂龞龡 +SELECT INSERT(`C1`,3,2,'丂丂') FROM `T12`; +INSERT(`C1`,3,2,'丂丂') +龔龖丂丂龡 +SELECT INSERT(`C1`,3,3,'丂丂丂') FROM `T12`; +INSERT(`C1`,3,3,'丂丂丂') +龔龖丂丂丂 +SELECT INSERT(`C1`,4,1,'丂') FROM `T12`; +INSERT(`C1`,4,1,'丂') +龔龖龗丂龡 +SELECT INSERT(`C1`,4,2,'丂丂') FROM `T12`; +INSERT(`C1`,4,2,'丂丂') +龔龖龗丂丂 +SELECT INSERT(`C1`,5,1,'丂') FROM `T12`; +INSERT(`C1`,5,1,'丂') +龔龖龗龞丂 +DROP TABLE `T1`; +DROP TABLE `ï¼´ï¼’`; +DROP TABLE `T3`; +DROP TABLE `ï¼´ï¼”`; +DROP TABLE `T5`; +DROP TABLE `ï¼´ï¼–`; +DROP TABLE `ï¼´ï¼—`; +DROP TABLE `T8`; +DROP TABLE `ï¼´ï¼™`; +DROP TABLE `T1ï¼`; +DROP TABLE `T11`; +DROP TABLE `T12`; diff --git a/mysql-test/suite/jp/r/jp_instr_sjis.result b/mysql-test/suite/jp/r/jp_instr_sjis.result new file mode 100755 index 00000000000..9a6dea5a426 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_instr_sjis.result @@ -0,0 +1,264 @@ +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +SET NAMES sjis; +SET character_set_database = sjis; +CREATE TABLE `‚s‚P` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Q` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚R` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚S` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚T` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚U` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚V` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚W` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚X` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚O` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚P` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚Q` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +INSERT INTO `‚s‚P` VALUES ('±²³´µ'); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚S` VALUES ('±²³´µ'); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚V` VALUES ('±²³´µ'); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ'); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\'); +SELECT INSTR(`‚b‚P`,'±') from `‚s‚P`; +INSTR(`‚b‚P`,'±') +1 +SELECT INSTR(`‚b‚P`,'²') from `‚s‚P`; +INSTR(`‚b‚P`,'²') +2 +SELECT INSTR(`‚b‚P`,'³') from `‚s‚P`; +INSTR(`‚b‚P`,'³') +3 +SELECT INSTR(`‚b‚P`,'´') from `‚s‚P`; +INSTR(`‚b‚P`,'´') +4 +SELECT INSTR(`‚b‚P`,'µ') from `‚s‚P`; +INSTR(`‚b‚P`,'µ') +5 +SELECT INSTR(`‚b‚P`,'Ý') from `‚s‚P`; +INSTR(`‚b‚P`,'Ý') +0 +SELECT INSTR(`‚b‚P`,'‚ ') from `‚s‚Q`; +INSTR(`‚b‚P`,'‚ ') +1 +SELECT INSTR(`‚b‚P`,'‚¢') from `‚s‚Q`; +INSTR(`‚b‚P`,'‚¢') +2 +SELECT INSTR(`‚b‚P`,'‚¤') from `‚s‚Q`; +INSTR(`‚b‚P`,'‚¤') +3 +SELECT INSTR(`‚b‚P`,'‚¦') from `‚s‚Q`; +INSTR(`‚b‚P`,'‚¦') +4 +SELECT INSTR(`‚b‚P`,'‚¨') from `‚s‚Q`; +INSTR(`‚b‚P`,'‚¨') +5 +SELECT INSTR(`‚b‚P`,'‚ñ') from `‚s‚Q`; +INSTR(`‚b‚P`,'‚ñ') +0 +SELECT INSTR(`‚b‚P`,'ƒ\') from `‚s‚R`; +INSTR(`‚b‚P`,'ƒ\') +1 +SELECT INSTR(`‚b‚P`,'\') from `‚s‚R`; +INSTR(`‚b‚P`,'\') +2 +SELECT INSTR(`‚b‚P`,'•\') from `‚s‚R`; +INSTR(`‚b‚P`,'•\') +3 +SELECT INSTR(`‚b‚P`,'—\') from `‚s‚R`; +INSTR(`‚b‚P`,'—\') +4 +SELECT INSTR(`‚b‚P`,'\') from `‚s‚R`; +INSTR(`‚b‚P`,'\') +5 +SELECT INSTR(`‚b‚P`,'‰\') from `‚s‚R`; +INSTR(`‚b‚P`,'‰\') +0 +SELECT INSTR(`‚b‚P`,'±') from `‚s‚S`; +INSTR(`‚b‚P`,'±') +1 +SELECT INSTR(`‚b‚P`,'²') from `‚s‚S`; +INSTR(`‚b‚P`,'²') +2 +SELECT INSTR(`‚b‚P`,'³') from `‚s‚S`; +INSTR(`‚b‚P`,'³') +3 +SELECT INSTR(`‚b‚P`,'´') from `‚s‚S`; +INSTR(`‚b‚P`,'´') +4 +SELECT INSTR(`‚b‚P`,'µ') from `‚s‚S`; +INSTR(`‚b‚P`,'µ') +5 +SELECT INSTR(`‚b‚P`,'Ý') from `‚s‚S`; +INSTR(`‚b‚P`,'Ý') +0 +SELECT INSTR(`‚b‚P`,'‚ ') from `‚s‚T`; +INSTR(`‚b‚P`,'‚ ') +1 +SELECT INSTR(`‚b‚P`,'‚¢') from `‚s‚T`; +INSTR(`‚b‚P`,'‚¢') +2 +SELECT INSTR(`‚b‚P`,'‚¤') from `‚s‚T`; +INSTR(`‚b‚P`,'‚¤') +3 +SELECT INSTR(`‚b‚P`,'‚¦') from `‚s‚T`; +INSTR(`‚b‚P`,'‚¦') +4 +SELECT INSTR(`‚b‚P`,'‚¨') from `‚s‚T`; +INSTR(`‚b‚P`,'‚¨') +5 +SELECT INSTR(`‚b‚P`,'‚ñ') from `‚s‚T`; +INSTR(`‚b‚P`,'‚ñ') +0 +SELECT INSTR(`‚b‚P`,'ƒ\') from `‚s‚U`; +INSTR(`‚b‚P`,'ƒ\') +1 +SELECT INSTR(`‚b‚P`,'\') from `‚s‚U`; +INSTR(`‚b‚P`,'\') +2 +SELECT INSTR(`‚b‚P`,'•\') from `‚s‚U`; +INSTR(`‚b‚P`,'•\') +3 +SELECT INSTR(`‚b‚P`,'—\') from `‚s‚U`; +INSTR(`‚b‚P`,'—\') +4 +SELECT INSTR(`‚b‚P`,'\') from `‚s‚U`; +INSTR(`‚b‚P`,'\') +5 +SELECT INSTR(`‚b‚P`,'‰\') from `‚s‚U`; +INSTR(`‚b‚P`,'‰\') +0 +SELECT INSTR(`‚b‚P`,'±') from `‚s‚V`; +INSTR(`‚b‚P`,'±') +1 +SELECT INSTR(`‚b‚P`,'²') from `‚s‚V`; +INSTR(`‚b‚P`,'²') +2 +SELECT INSTR(`‚b‚P`,'³') from `‚s‚V`; +INSTR(`‚b‚P`,'³') +3 +SELECT INSTR(`‚b‚P`,'´') from `‚s‚V`; +INSTR(`‚b‚P`,'´') +4 +SELECT INSTR(`‚b‚P`,'µ') from `‚s‚V`; +INSTR(`‚b‚P`,'µ') +5 +SELECT INSTR(`‚b‚P`,'Ý') from `‚s‚V`; +INSTR(`‚b‚P`,'Ý') +0 +SELECT INSTR(`‚b‚P`,'‚ ') from `‚s‚W`; +INSTR(`‚b‚P`,'‚ ') +1 +SELECT INSTR(`‚b‚P`,'‚¢') from `‚s‚W`; +INSTR(`‚b‚P`,'‚¢') +2 +SELECT INSTR(`‚b‚P`,'‚¤') from `‚s‚W`; +INSTR(`‚b‚P`,'‚¤') +3 +SELECT INSTR(`‚b‚P`,'‚¦') from `‚s‚W`; +INSTR(`‚b‚P`,'‚¦') +4 +SELECT INSTR(`‚b‚P`,'‚¨') from `‚s‚W`; +INSTR(`‚b‚P`,'‚¨') +5 +SELECT INSTR(`‚b‚P`,'‚ñ') from `‚s‚W`; +INSTR(`‚b‚P`,'‚ñ') +0 +SELECT INSTR(`‚b‚P`,'ƒ\') from `‚s‚X`; +INSTR(`‚b‚P`,'ƒ\') +1 +SELECT INSTR(`‚b‚P`,'\') from `‚s‚X`; +INSTR(`‚b‚P`,'\') +2 +SELECT INSTR(`‚b‚P`,'•\') from `‚s‚X`; +INSTR(`‚b‚P`,'•\') +3 +SELECT INSTR(`‚b‚P`,'—\') from `‚s‚X`; +INSTR(`‚b‚P`,'—\') +4 +SELECT INSTR(`‚b‚P`,'\') from `‚s‚X`; +INSTR(`‚b‚P`,'\') +5 +SELECT INSTR(`‚b‚P`,'‰\') from `‚s‚X`; +INSTR(`‚b‚P`,'‰\') +0 +SELECT INSTR(`‚b‚P`,'±') from `‚s‚P‚O`; +INSTR(`‚b‚P`,'±') +1 +SELECT INSTR(`‚b‚P`,'²') from `‚s‚P‚O`; +INSTR(`‚b‚P`,'²') +2 +SELECT INSTR(`‚b‚P`,'³') from `‚s‚P‚O`; +INSTR(`‚b‚P`,'³') +3 +SELECT INSTR(`‚b‚P`,'´') from `‚s‚P‚O`; +INSTR(`‚b‚P`,'´') +4 +SELECT INSTR(`‚b‚P`,'µ') from `‚s‚P‚O`; +INSTR(`‚b‚P`,'µ') +5 +SELECT INSTR(`‚b‚P`,'Ý') from `‚s‚P‚O`; +INSTR(`‚b‚P`,'Ý') +0 +SELECT INSTR(`‚b‚P`,'‚ ') from `‚s‚P‚P`; +INSTR(`‚b‚P`,'‚ ') +1 +SELECT INSTR(`‚b‚P`,'‚¢') from `‚s‚P‚P`; +INSTR(`‚b‚P`,'‚¢') +2 +SELECT INSTR(`‚b‚P`,'‚¤') from `‚s‚P‚P`; +INSTR(`‚b‚P`,'‚¤') +3 +SELECT INSTR(`‚b‚P`,'‚¦') from `‚s‚P‚P`; +INSTR(`‚b‚P`,'‚¦') +4 +SELECT INSTR(`‚b‚P`,'‚¨') from `‚s‚P‚P`; +INSTR(`‚b‚P`,'‚¨') +5 +SELECT INSTR(`‚b‚P`,'‚ñ') from `‚s‚P‚P`; +INSTR(`‚b‚P`,'‚ñ') +0 +SELECT INSTR(`‚b‚P`,'ƒ\') from `‚s‚P‚Q`; +INSTR(`‚b‚P`,'ƒ\') +1 +SELECT INSTR(`‚b‚P`,'\') from `‚s‚P‚Q`; +INSTR(`‚b‚P`,'\') +2 +SELECT INSTR(`‚b‚P`,'•\') from `‚s‚P‚Q`; +INSTR(`‚b‚P`,'•\') +3 +SELECT INSTR(`‚b‚P`,'—\') from `‚s‚P‚Q`; +INSTR(`‚b‚P`,'—\') +4 +SELECT INSTR(`‚b‚P`,'\') from `‚s‚P‚Q`; +INSTR(`‚b‚P`,'\') +5 +SELECT INSTR(`‚b‚P`,'‰\') from `‚s‚P‚Q`; +INSTR(`‚b‚P`,'‰\') +0 +DROP TABLE `‚s‚P`; +DROP TABLE `‚s‚Q`; +DROP TABLE `‚s‚R`; +DROP TABLE `‚s‚S`; +DROP TABLE `‚s‚T`; +DROP TABLE `‚s‚U`; +DROP TABLE `‚s‚V`; +DROP TABLE `‚s‚W`; +DROP TABLE `‚s‚X`; +DROP TABLE `‚s‚P‚O`; +DROP TABLE `‚s‚P‚P`; +DROP TABLE `‚s‚P‚Q`; diff --git a/mysql-test/suite/jp/r/jp_instr_ucs2.result b/mysql-test/suite/jp/r/jp_instr_ucs2.result new file mode 100755 index 00000000000..352525eee0b --- /dev/null +++ b/mysql-test/suite/jp/r/jp_instr_ucs2.result @@ -0,0 +1,265 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; +CREATE TABLE `£Ô£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'); +SELECT INSTR(`£Ã£±`,'ޱ') from `£Ô£±`; +INSTR(`£Ã£±`,'ޱ') +1 +SELECT INSTR(`£Ã£±`,'޲') from `£Ô£±`; +INSTR(`£Ã£±`,'޲') +2 +SELECT INSTR(`£Ã£±`,'޳') from `£Ô£±`; +INSTR(`£Ã£±`,'޳') +3 +SELECT INSTR(`£Ã£±`,'Ž´') from `£Ô£±`; +INSTR(`£Ã£±`,'Ž´') +4 +SELECT INSTR(`£Ã£±`,'޵') from `£Ô£±`; +INSTR(`£Ã£±`,'޵') +5 +SELECT INSTR(`£Ã£±`,'ŽÝ') from `£Ô£±`; +INSTR(`£Ã£±`,'ŽÝ') +0 +SELECT INSTR(`£Ã£±`,'¤¢') from `£Ô£²`; +INSTR(`£Ã£±`,'¤¢') +1 +SELECT INSTR(`£Ã£±`,'¤¤') from `£Ô£²`; +INSTR(`£Ã£±`,'¤¤') +2 +SELECT INSTR(`£Ã£±`,'¤¦') from `£Ô£²`; +INSTR(`£Ã£±`,'¤¦') +3 +SELECT INSTR(`£Ã£±`,'¤¨') from `£Ô£²`; +INSTR(`£Ã£±`,'¤¨') +4 +SELECT INSTR(`£Ã£±`,'¤ª') from `£Ô£²`; +INSTR(`£Ã£±`,'¤ª') +5 +SELECT INSTR(`£Ã£±`,'¤ó') from `£Ô£²`; +INSTR(`£Ã£±`,'¤ó') +0 +SELECT INSTR(`£Ã£±`,'íÜ') from `£Ô£³`; +INSTR(`£Ã£±`,'íÜ') +1 +SELECT INSTR(`£Ã£±`,'íÝ') from `£Ô£³`; +INSTR(`£Ã£±`,'íÝ') +2 +SELECT INSTR(`£Ã£±`,'íÞ') from `£Ô£³`; +INSTR(`£Ã£±`,'íÞ') +3 +SELECT INSTR(`£Ã£±`,'íß') from `£Ô£³`; +INSTR(`£Ã£±`,'íß') +4 +SELECT INSTR(`£Ã£±`,'íà') from `£Ô£³`; +INSTR(`£Ã£±`,'íà') +5 +SELECT INSTR(`£Ã£±`,'°¡') from `£Ô£³`; +INSTR(`£Ã£±`,'°¡') +0 +SELECT INSTR(`£Ã£±`,'ޱ') from `£Ô£´`; +INSTR(`£Ã£±`,'ޱ') +1 +SELECT INSTR(`£Ã£±`,'޲') from `£Ô£´`; +INSTR(`£Ã£±`,'޲') +2 +SELECT INSTR(`£Ã£±`,'޳') from `£Ô£´`; +INSTR(`£Ã£±`,'޳') +3 +SELECT INSTR(`£Ã£±`,'Ž´') from `£Ô£´`; +INSTR(`£Ã£±`,'Ž´') +4 +SELECT INSTR(`£Ã£±`,'޵') from `£Ô£´`; +INSTR(`£Ã£±`,'޵') +5 +SELECT INSTR(`£Ã£±`,'ŽÝ') from `£Ô£´`; +INSTR(`£Ã£±`,'ŽÝ') +0 +SELECT INSTR(`£Ã£±`,'¤¢') from `£Ô£µ`; +INSTR(`£Ã£±`,'¤¢') +1 +SELECT INSTR(`£Ã£±`,'¤¤') from `£Ô£µ`; +INSTR(`£Ã£±`,'¤¤') +2 +SELECT INSTR(`£Ã£±`,'¤¦') from `£Ô£µ`; +INSTR(`£Ã£±`,'¤¦') +3 +SELECT INSTR(`£Ã£±`,'¤¨') from `£Ô£µ`; +INSTR(`£Ã£±`,'¤¨') +4 +SELECT INSTR(`£Ã£±`,'¤ª') from `£Ô£µ`; +INSTR(`£Ã£±`,'¤ª') +5 +SELECT INSTR(`£Ã£±`,'¤ó') from `£Ô£µ`; +INSTR(`£Ã£±`,'¤ó') +0 +SELECT INSTR(`£Ã£±`,'íÜ') from `£Ô£¶`; +INSTR(`£Ã£±`,'íÜ') +1 +SELECT INSTR(`£Ã£±`,'íÝ') from `£Ô£¶`; +INSTR(`£Ã£±`,'íÝ') +2 +SELECT INSTR(`£Ã£±`,'íÞ') from `£Ô£¶`; +INSTR(`£Ã£±`,'íÞ') +3 +SELECT INSTR(`£Ã£±`,'íß') from `£Ô£¶`; +INSTR(`£Ã£±`,'íß') +4 +SELECT INSTR(`£Ã£±`,'íà') from `£Ô£¶`; +INSTR(`£Ã£±`,'íà') +5 +SELECT INSTR(`£Ã£±`,'°¡') from `£Ô£¶`; +INSTR(`£Ã£±`,'°¡') +0 +SELECT INSTR(`£Ã£±`,'ޱ') from `£Ô£·`; +INSTR(`£Ã£±`,'ޱ') +1 +SELECT INSTR(`£Ã£±`,'޲') from `£Ô£·`; +INSTR(`£Ã£±`,'޲') +2 +SELECT INSTR(`£Ã£±`,'޳') from `£Ô£·`; +INSTR(`£Ã£±`,'޳') +3 +SELECT INSTR(`£Ã£±`,'Ž´') from `£Ô£·`; +INSTR(`£Ã£±`,'Ž´') +4 +SELECT INSTR(`£Ã£±`,'޵') from `£Ô£·`; +INSTR(`£Ã£±`,'޵') +5 +SELECT INSTR(`£Ã£±`,'ŽÝ') from `£Ô£·`; +INSTR(`£Ã£±`,'ŽÝ') +0 +SELECT INSTR(`£Ã£±`,'¤¢') from `£Ô£¸`; +INSTR(`£Ã£±`,'¤¢') +1 +SELECT INSTR(`£Ã£±`,'¤¤') from `£Ô£¸`; +INSTR(`£Ã£±`,'¤¤') +2 +SELECT INSTR(`£Ã£±`,'¤¦') from `£Ô£¸`; +INSTR(`£Ã£±`,'¤¦') +3 +SELECT INSTR(`£Ã£±`,'¤¨') from `£Ô£¸`; +INSTR(`£Ã£±`,'¤¨') +4 +SELECT INSTR(`£Ã£±`,'¤ª') from `£Ô£¸`; +INSTR(`£Ã£±`,'¤ª') +5 +SELECT INSTR(`£Ã£±`,'¤ó') from `£Ô£¸`; +INSTR(`£Ã£±`,'¤ó') +0 +SELECT INSTR(`£Ã£±`,'íÜ') from `£Ô£¹`; +INSTR(`£Ã£±`,'íÜ') +1 +SELECT INSTR(`£Ã£±`,'íÝ') from `£Ô£¹`; +INSTR(`£Ã£±`,'íÝ') +2 +SELECT INSTR(`£Ã£±`,'íÞ') from `£Ô£¹`; +INSTR(`£Ã£±`,'íÞ') +3 +SELECT INSTR(`£Ã£±`,'íß') from `£Ô£¹`; +INSTR(`£Ã£±`,'íß') +4 +SELECT INSTR(`£Ã£±`,'íà') from `£Ô£¹`; +INSTR(`£Ã£±`,'íà') +5 +SELECT INSTR(`£Ã£±`,'°¡') from `£Ô£¹`; +INSTR(`£Ã£±`,'°¡') +0 +SELECT INSTR(`£Ã£±`,'ޱ') from `£Ô£±£°`; +INSTR(`£Ã£±`,'ޱ') +1 +SELECT INSTR(`£Ã£±`,'޲') from `£Ô£±£°`; +INSTR(`£Ã£±`,'޲') +2 +SELECT INSTR(`£Ã£±`,'޳') from `£Ô£±£°`; +INSTR(`£Ã£±`,'޳') +3 +SELECT INSTR(`£Ã£±`,'Ž´') from `£Ô£±£°`; +INSTR(`£Ã£±`,'Ž´') +4 +SELECT INSTR(`£Ã£±`,'޵') from `£Ô£±£°`; +INSTR(`£Ã£±`,'޵') +5 +SELECT INSTR(`£Ã£±`,'ŽÝ') from `£Ô£±£°`; +INSTR(`£Ã£±`,'ŽÝ') +0 +SELECT INSTR(`£Ã£±`,'¤¢') from `£Ô£±£±`; +INSTR(`£Ã£±`,'¤¢') +1 +SELECT INSTR(`£Ã£±`,'¤¤') from `£Ô£±£±`; +INSTR(`£Ã£±`,'¤¤') +2 +SELECT INSTR(`£Ã£±`,'¤¦') from `£Ô£±£±`; +INSTR(`£Ã£±`,'¤¦') +3 +SELECT INSTR(`£Ã£±`,'¤¨') from `£Ô£±£±`; +INSTR(`£Ã£±`,'¤¨') +4 +SELECT INSTR(`£Ã£±`,'¤ª') from `£Ô£±£±`; +INSTR(`£Ã£±`,'¤ª') +5 +SELECT INSTR(`£Ã£±`,'¤ó') from `£Ô£±£±`; +INSTR(`£Ã£±`,'¤ó') +0 +SELECT INSTR(`£Ã£±`,'íÜ') from `£Ô£±£²`; +INSTR(`£Ã£±`,'íÜ') +1 +SELECT INSTR(`£Ã£±`,'íÝ') from `£Ô£±£²`; +INSTR(`£Ã£±`,'íÝ') +2 +SELECT INSTR(`£Ã£±`,'íÞ') from `£Ô£±£²`; +INSTR(`£Ã£±`,'íÞ') +3 +SELECT INSTR(`£Ã£±`,'íß') from `£Ô£±£²`; +INSTR(`£Ã£±`,'íß') +4 +SELECT INSTR(`£Ã£±`,'íà') from `£Ô£±£²`; +INSTR(`£Ã£±`,'íà') +5 +SELECT INSTR(`£Ã£±`,'°¡') from `£Ô£±£²`; +INSTR(`£Ã£±`,'°¡') +0 +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/r/jp_instr_ujis.result b/mysql-test/suite/jp/r/jp_instr_ujis.result new file mode 100755 index 00000000000..0cf9895a740 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_instr_ujis.result @@ -0,0 +1,264 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +SET NAMES ujis; +SET character_set_database = ujis; +CREATE TABLE `£Ô£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'); +SELECT INSTR(`£Ã£±`,'ޱ') from `£Ô£±`; +INSTR(`£Ã£±`,'ޱ') +1 +SELECT INSTR(`£Ã£±`,'޲') from `£Ô£±`; +INSTR(`£Ã£±`,'޲') +2 +SELECT INSTR(`£Ã£±`,'޳') from `£Ô£±`; +INSTR(`£Ã£±`,'޳') +3 +SELECT INSTR(`£Ã£±`,'Ž´') from `£Ô£±`; +INSTR(`£Ã£±`,'Ž´') +4 +SELECT INSTR(`£Ã£±`,'޵') from `£Ô£±`; +INSTR(`£Ã£±`,'޵') +5 +SELECT INSTR(`£Ã£±`,'ŽÝ') from `£Ô£±`; +INSTR(`£Ã£±`,'ŽÝ') +0 +SELECT INSTR(`£Ã£±`,'¤¢') from `£Ô£²`; +INSTR(`£Ã£±`,'¤¢') +1 +SELECT INSTR(`£Ã£±`,'¤¤') from `£Ô£²`; +INSTR(`£Ã£±`,'¤¤') +2 +SELECT INSTR(`£Ã£±`,'¤¦') from `£Ô£²`; +INSTR(`£Ã£±`,'¤¦') +3 +SELECT INSTR(`£Ã£±`,'¤¨') from `£Ô£²`; +INSTR(`£Ã£±`,'¤¨') +4 +SELECT INSTR(`£Ã£±`,'¤ª') from `£Ô£²`; +INSTR(`£Ã£±`,'¤ª') +5 +SELECT INSTR(`£Ã£±`,'¤ó') from `£Ô£²`; +INSTR(`£Ã£±`,'¤ó') +0 +SELECT INSTR(`£Ã£±`,'íÜ') from `£Ô£³`; +INSTR(`£Ã£±`,'íÜ') +1 +SELECT INSTR(`£Ã£±`,'íÝ') from `£Ô£³`; +INSTR(`£Ã£±`,'íÝ') +2 +SELECT INSTR(`£Ã£±`,'íÞ') from `£Ô£³`; +INSTR(`£Ã£±`,'íÞ') +3 +SELECT INSTR(`£Ã£±`,'íß') from `£Ô£³`; +INSTR(`£Ã£±`,'íß') +4 +SELECT INSTR(`£Ã£±`,'íà') from `£Ô£³`; +INSTR(`£Ã£±`,'íà') +5 +SELECT INSTR(`£Ã£±`,'°¡') from `£Ô£³`; +INSTR(`£Ã£±`,'°¡') +0 +SELECT INSTR(`£Ã£±`,'ޱ') from `£Ô£´`; +INSTR(`£Ã£±`,'ޱ') +1 +SELECT INSTR(`£Ã£±`,'޲') from `£Ô£´`; +INSTR(`£Ã£±`,'޲') +2 +SELECT INSTR(`£Ã£±`,'޳') from `£Ô£´`; +INSTR(`£Ã£±`,'޳') +3 +SELECT INSTR(`£Ã£±`,'Ž´') from `£Ô£´`; +INSTR(`£Ã£±`,'Ž´') +4 +SELECT INSTR(`£Ã£±`,'޵') from `£Ô£´`; +INSTR(`£Ã£±`,'޵') +5 +SELECT INSTR(`£Ã£±`,'ŽÝ') from `£Ô£´`; +INSTR(`£Ã£±`,'ŽÝ') +0 +SELECT INSTR(`£Ã£±`,'¤¢') from `£Ô£µ`; +INSTR(`£Ã£±`,'¤¢') +1 +SELECT INSTR(`£Ã£±`,'¤¤') from `£Ô£µ`; +INSTR(`£Ã£±`,'¤¤') +2 +SELECT INSTR(`£Ã£±`,'¤¦') from `£Ô£µ`; +INSTR(`£Ã£±`,'¤¦') +3 +SELECT INSTR(`£Ã£±`,'¤¨') from `£Ô£µ`; +INSTR(`£Ã£±`,'¤¨') +4 +SELECT INSTR(`£Ã£±`,'¤ª') from `£Ô£µ`; +INSTR(`£Ã£±`,'¤ª') +5 +SELECT INSTR(`£Ã£±`,'¤ó') from `£Ô£µ`; +INSTR(`£Ã£±`,'¤ó') +0 +SELECT INSTR(`£Ã£±`,'íÜ') from `£Ô£¶`; +INSTR(`£Ã£±`,'íÜ') +1 +SELECT INSTR(`£Ã£±`,'íÝ') from `£Ô£¶`; +INSTR(`£Ã£±`,'íÝ') +2 +SELECT INSTR(`£Ã£±`,'íÞ') from `£Ô£¶`; +INSTR(`£Ã£±`,'íÞ') +3 +SELECT INSTR(`£Ã£±`,'íß') from `£Ô£¶`; +INSTR(`£Ã£±`,'íß') +4 +SELECT INSTR(`£Ã£±`,'íà') from `£Ô£¶`; +INSTR(`£Ã£±`,'íà') +5 +SELECT INSTR(`£Ã£±`,'°¡') from `£Ô£¶`; +INSTR(`£Ã£±`,'°¡') +0 +SELECT INSTR(`£Ã£±`,'ޱ') from `£Ô£·`; +INSTR(`£Ã£±`,'ޱ') +1 +SELECT INSTR(`£Ã£±`,'޲') from `£Ô£·`; +INSTR(`£Ã£±`,'޲') +2 +SELECT INSTR(`£Ã£±`,'޳') from `£Ô£·`; +INSTR(`£Ã£±`,'޳') +3 +SELECT INSTR(`£Ã£±`,'Ž´') from `£Ô£·`; +INSTR(`£Ã£±`,'Ž´') +4 +SELECT INSTR(`£Ã£±`,'޵') from `£Ô£·`; +INSTR(`£Ã£±`,'޵') +5 +SELECT INSTR(`£Ã£±`,'ŽÝ') from `£Ô£·`; +INSTR(`£Ã£±`,'ŽÝ') +0 +SELECT INSTR(`£Ã£±`,'¤¢') from `£Ô£¸`; +INSTR(`£Ã£±`,'¤¢') +1 +SELECT INSTR(`£Ã£±`,'¤¤') from `£Ô£¸`; +INSTR(`£Ã£±`,'¤¤') +2 +SELECT INSTR(`£Ã£±`,'¤¦') from `£Ô£¸`; +INSTR(`£Ã£±`,'¤¦') +3 +SELECT INSTR(`£Ã£±`,'¤¨') from `£Ô£¸`; +INSTR(`£Ã£±`,'¤¨') +4 +SELECT INSTR(`£Ã£±`,'¤ª') from `£Ô£¸`; +INSTR(`£Ã£±`,'¤ª') +5 +SELECT INSTR(`£Ã£±`,'¤ó') from `£Ô£¸`; +INSTR(`£Ã£±`,'¤ó') +0 +SELECT INSTR(`£Ã£±`,'íÜ') from `£Ô£¹`; +INSTR(`£Ã£±`,'íÜ') +1 +SELECT INSTR(`£Ã£±`,'íÝ') from `£Ô£¹`; +INSTR(`£Ã£±`,'íÝ') +2 +SELECT INSTR(`£Ã£±`,'íÞ') from `£Ô£¹`; +INSTR(`£Ã£±`,'íÞ') +3 +SELECT INSTR(`£Ã£±`,'íß') from `£Ô£¹`; +INSTR(`£Ã£±`,'íß') +4 +SELECT INSTR(`£Ã£±`,'íà') from `£Ô£¹`; +INSTR(`£Ã£±`,'íà') +5 +SELECT INSTR(`£Ã£±`,'°¡') from `£Ô£¹`; +INSTR(`£Ã£±`,'°¡') +0 +SELECT INSTR(`£Ã£±`,'ޱ') from `£Ô£±£°`; +INSTR(`£Ã£±`,'ޱ') +1 +SELECT INSTR(`£Ã£±`,'޲') from `£Ô£±£°`; +INSTR(`£Ã£±`,'޲') +2 +SELECT INSTR(`£Ã£±`,'޳') from `£Ô£±£°`; +INSTR(`£Ã£±`,'޳') +3 +SELECT INSTR(`£Ã£±`,'Ž´') from `£Ô£±£°`; +INSTR(`£Ã£±`,'Ž´') +4 +SELECT INSTR(`£Ã£±`,'޵') from `£Ô£±£°`; +INSTR(`£Ã£±`,'޵') +5 +SELECT INSTR(`£Ã£±`,'ŽÝ') from `£Ô£±£°`; +INSTR(`£Ã£±`,'ŽÝ') +0 +SELECT INSTR(`£Ã£±`,'¤¢') from `£Ô£±£±`; +INSTR(`£Ã£±`,'¤¢') +1 +SELECT INSTR(`£Ã£±`,'¤¤') from `£Ô£±£±`; +INSTR(`£Ã£±`,'¤¤') +2 +SELECT INSTR(`£Ã£±`,'¤¦') from `£Ô£±£±`; +INSTR(`£Ã£±`,'¤¦') +3 +SELECT INSTR(`£Ã£±`,'¤¨') from `£Ô£±£±`; +INSTR(`£Ã£±`,'¤¨') +4 +SELECT INSTR(`£Ã£±`,'¤ª') from `£Ô£±£±`; +INSTR(`£Ã£±`,'¤ª') +5 +SELECT INSTR(`£Ã£±`,'¤ó') from `£Ô£±£±`; +INSTR(`£Ã£±`,'¤ó') +0 +SELECT INSTR(`£Ã£±`,'íÜ') from `£Ô£±£²`; +INSTR(`£Ã£±`,'íÜ') +1 +SELECT INSTR(`£Ã£±`,'íÝ') from `£Ô£±£²`; +INSTR(`£Ã£±`,'íÝ') +2 +SELECT INSTR(`£Ã£±`,'íÞ') from `£Ô£±£²`; +INSTR(`£Ã£±`,'íÞ') +3 +SELECT INSTR(`£Ã£±`,'íß') from `£Ô£±£²`; +INSTR(`£Ã£±`,'íß') +4 +SELECT INSTR(`£Ã£±`,'íà') from `£Ô£±£²`; +INSTR(`£Ã£±`,'íà') +5 +SELECT INSTR(`£Ã£±`,'°¡') from `£Ô£±£²`; +INSTR(`£Ã£±`,'°¡') +0 +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/r/jp_instr_utf8.result b/mysql-test/suite/jp/r/jp_instr_utf8.result new file mode 100755 index 00000000000..0e55227e4b7 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_instr_utf8.result @@ -0,0 +1,264 @@ +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +SET NAMES utf8; +SET character_set_database = utf8; +CREATE TABLE `T1` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T11` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T12` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +INSERT INTO `T1` VALUES ('アイウエオ'); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T3` VALUES ('龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオ'); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオ'); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡'); +INSERT INTO `T1ï¼` VALUES ('アイウエオ'); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T12` VALUES ('龔龖龗龞龡'); +SELECT INSTR(`C1`,'ï½±') from `T1`; +INSTR(`C1`,'ï½±') +1 +SELECT INSTR(`C1`,'ï½²') from `T1`; +INSTR(`C1`,'ï½²') +2 +SELECT INSTR(`C1`,'ï½³') from `T1`; +INSTR(`C1`,'ï½³') +3 +SELECT INSTR(`C1`,'ï½´') from `T1`; +INSTR(`C1`,'ï½´') +4 +SELECT INSTR(`C1`,'ï½µ') from `T1`; +INSTR(`C1`,'ï½µ') +5 +SELECT INSTR(`C1`,'ï¾') from `T1`; +INSTR(`C1`,'ï¾') +0 +SELECT INSTR(`C1`,'ã‚') from `ï¼´ï¼’`; +INSTR(`C1`,'ã‚') +1 +SELECT INSTR(`C1`,'ã„') from `ï¼´ï¼’`; +INSTR(`C1`,'ã„') +2 +SELECT INSTR(`C1`,'ã†') from `ï¼´ï¼’`; +INSTR(`C1`,'ã†') +3 +SELECT INSTR(`C1`,'ãˆ') from `ï¼´ï¼’`; +INSTR(`C1`,'ãˆ') +4 +SELECT INSTR(`C1`,'ãŠ') from `ï¼´ï¼’`; +INSTR(`C1`,'ãŠ') +5 +SELECT INSTR(`C1`,'ã‚“') from `ï¼´ï¼’`; +INSTR(`C1`,'ã‚“') +0 +SELECT INSTR(`C1`,'é¾”') from `T3`; +INSTR(`C1`,'é¾”') +1 +SELECT INSTR(`C1`,'é¾–') from `T3`; +INSTR(`C1`,'é¾–') +2 +SELECT INSTR(`C1`,'é¾—') from `T3`; +INSTR(`C1`,'é¾—') +3 +SELECT INSTR(`C1`,'龞') from `T3`; +INSTR(`C1`,'龞') +4 +SELECT INSTR(`C1`,'龡') from `T3`; +INSTR(`C1`,'龡') +5 +SELECT INSTR(`C1`,'丂') from `T3`; +INSTR(`C1`,'丂') +0 +SELECT INSTR(`C1`,'ï½±') from `ï¼´ï¼”`; +INSTR(`C1`,'ï½±') +1 +SELECT INSTR(`C1`,'ï½²') from `ï¼´ï¼”`; +INSTR(`C1`,'ï½²') +2 +SELECT INSTR(`C1`,'ï½³') from `ï¼´ï¼”`; +INSTR(`C1`,'ï½³') +3 +SELECT INSTR(`C1`,'ï½´') from `ï¼´ï¼”`; +INSTR(`C1`,'ï½´') +4 +SELECT INSTR(`C1`,'ï½µ') from `ï¼´ï¼”`; +INSTR(`C1`,'ï½µ') +5 +SELECT INSTR(`C1`,'ï¾') from `ï¼´ï¼”`; +INSTR(`C1`,'ï¾') +0 +SELECT INSTR(`C1`,'ã‚') from `T5`; +INSTR(`C1`,'ã‚') +1 +SELECT INSTR(`C1`,'ã„') from `T5`; +INSTR(`C1`,'ã„') +2 +SELECT INSTR(`C1`,'ã†') from `T5`; +INSTR(`C1`,'ã†') +3 +SELECT INSTR(`C1`,'ãˆ') from `T5`; +INSTR(`C1`,'ãˆ') +4 +SELECT INSTR(`C1`,'ãŠ') from `T5`; +INSTR(`C1`,'ãŠ') +5 +SELECT INSTR(`C1`,'ã‚“') from `T5`; +INSTR(`C1`,'ã‚“') +0 +SELECT INSTR(`C1`,'é¾”') from `ï¼´ï¼–`; +INSTR(`C1`,'é¾”') +1 +SELECT INSTR(`C1`,'é¾–') from `ï¼´ï¼–`; +INSTR(`C1`,'é¾–') +2 +SELECT INSTR(`C1`,'é¾—') from `ï¼´ï¼–`; +INSTR(`C1`,'é¾—') +3 +SELECT INSTR(`C1`,'龞') from `ï¼´ï¼–`; +INSTR(`C1`,'龞') +4 +SELECT INSTR(`C1`,'龡') from `ï¼´ï¼–`; +INSTR(`C1`,'龡') +5 +SELECT INSTR(`C1`,'丂') from `ï¼´ï¼–`; +INSTR(`C1`,'丂') +0 +SELECT INSTR(`C1`,'ï½±') from `ï¼´ï¼—`; +INSTR(`C1`,'ï½±') +1 +SELECT INSTR(`C1`,'ï½²') from `ï¼´ï¼—`; +INSTR(`C1`,'ï½²') +2 +SELECT INSTR(`C1`,'ï½³') from `ï¼´ï¼—`; +INSTR(`C1`,'ï½³') +3 +SELECT INSTR(`C1`,'ï½´') from `ï¼´ï¼—`; +INSTR(`C1`,'ï½´') +4 +SELECT INSTR(`C1`,'ï½µ') from `ï¼´ï¼—`; +INSTR(`C1`,'ï½µ') +5 +SELECT INSTR(`C1`,'ï¾') from `ï¼´ï¼—`; +INSTR(`C1`,'ï¾') +0 +SELECT INSTR(`C1`,'ã‚') from `T8`; +INSTR(`C1`,'ã‚') +1 +SELECT INSTR(`C1`,'ã„') from `T8`; +INSTR(`C1`,'ã„') +2 +SELECT INSTR(`C1`,'ã†') from `T8`; +INSTR(`C1`,'ã†') +3 +SELECT INSTR(`C1`,'ãˆ') from `T8`; +INSTR(`C1`,'ãˆ') +4 +SELECT INSTR(`C1`,'ãŠ') from `T8`; +INSTR(`C1`,'ãŠ') +5 +SELECT INSTR(`C1`,'ã‚“') from `T8`; +INSTR(`C1`,'ã‚“') +0 +SELECT INSTR(`C1`,'é¾”') from `ï¼´ï¼™`; +INSTR(`C1`,'é¾”') +1 +SELECT INSTR(`C1`,'é¾–') from `ï¼´ï¼™`; +INSTR(`C1`,'é¾–') +2 +SELECT INSTR(`C1`,'é¾—') from `ï¼´ï¼™`; +INSTR(`C1`,'é¾—') +3 +SELECT INSTR(`C1`,'龞') from `ï¼´ï¼™`; +INSTR(`C1`,'龞') +4 +SELECT INSTR(`C1`,'龡') from `ï¼´ï¼™`; +INSTR(`C1`,'龡') +5 +SELECT INSTR(`C1`,'丂') from `ï¼´ï¼™`; +INSTR(`C1`,'丂') +0 +SELECT INSTR(`C1`,'ï½±') from `T1ï¼`; +INSTR(`C1`,'ï½±') +1 +SELECT INSTR(`C1`,'ï½²') from `T1ï¼`; +INSTR(`C1`,'ï½²') +2 +SELECT INSTR(`C1`,'ï½³') from `T1ï¼`; +INSTR(`C1`,'ï½³') +3 +SELECT INSTR(`C1`,'ï½´') from `T1ï¼`; +INSTR(`C1`,'ï½´') +4 +SELECT INSTR(`C1`,'ï½µ') from `T1ï¼`; +INSTR(`C1`,'ï½µ') +5 +SELECT INSTR(`C1`,'ï¾') from `T1ï¼`; +INSTR(`C1`,'ï¾') +0 +SELECT INSTR(`C1`,'ã‚') from `T11`; +INSTR(`C1`,'ã‚') +1 +SELECT INSTR(`C1`,'ã„') from `T11`; +INSTR(`C1`,'ã„') +2 +SELECT INSTR(`C1`,'ã†') from `T11`; +INSTR(`C1`,'ã†') +3 +SELECT INSTR(`C1`,'ãˆ') from `T11`; +INSTR(`C1`,'ãˆ') +4 +SELECT INSTR(`C1`,'ãŠ') from `T11`; +INSTR(`C1`,'ãŠ') +5 +SELECT INSTR(`C1`,'ã‚“') from `T11`; +INSTR(`C1`,'ã‚“') +0 +SELECT INSTR(`C1`,'é¾”') from `T12`; +INSTR(`C1`,'é¾”') +1 +SELECT INSTR(`C1`,'é¾–') from `T12`; +INSTR(`C1`,'é¾–') +2 +SELECT INSTR(`C1`,'é¾—') from `T12`; +INSTR(`C1`,'é¾—') +3 +SELECT INSTR(`C1`,'龞') from `T12`; +INSTR(`C1`,'龞') +4 +SELECT INSTR(`C1`,'龡') from `T12`; +INSTR(`C1`,'龡') +5 +SELECT INSTR(`C1`,'丂') from `T12`; +INSTR(`C1`,'丂') +0 +DROP TABLE `T1`; +DROP TABLE `ï¼´ï¼’`; +DROP TABLE `T3`; +DROP TABLE `ï¼´ï¼”`; +DROP TABLE `T5`; +DROP TABLE `ï¼´ï¼–`; +DROP TABLE `ï¼´ï¼—`; +DROP TABLE `T8`; +DROP TABLE `ï¼´ï¼™`; +DROP TABLE `T1ï¼`; +DROP TABLE `T11`; +DROP TABLE `T12`; diff --git a/mysql-test/suite/jp/r/jp_join_sjis.result b/mysql-test/suite/jp/r/jp_join_sjis.result new file mode 100755 index 00000000000..a5ccc58ae4c --- /dev/null +++ b/mysql-test/suite/jp/r/jp_join_sjis.result @@ -0,0 +1,578 @@ +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +drop table if exists `‚s‚P‚P`; +drop table if exists `‚s‚P‚Q`; +SET NAMES sjis; +SET character_set_database = sjis; +CREATE TABLE `‚s‚Pa` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Pb` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Qa` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Qb` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Ra` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Rb` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Sa` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚Sb` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚Ta` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚Tb` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚Ua` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚Ub` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚Va` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚Vb` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚Wa` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚Wb` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚Xa` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚Xb` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚Oa` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚Ob` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚Pa` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚Pb` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚Qa` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚Qb` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +INSERT INTO `‚s‚Pa` VALUES ('±'),('¶'),('»'); +INSERT INTO `‚s‚Pb` VALUES ('±'); +INSERT INTO `‚s‚Qa` VALUES ('‚ '),('‚©'),('‚³'); +INSERT INTO `‚s‚Qb` VALUES ('‚ '); +INSERT INTO `‚s‚Ra` VALUES ('ƒ\'),('\'),('•\'); +INSERT INTO `‚s‚Rb` VALUES ('ƒ\'); +INSERT INTO `‚s‚Sa` VALUES ('±'),('¶'),('»'); +INSERT INTO `‚s‚Sb` VALUES ('±'); +INSERT INTO `‚s‚Ta` VALUES ('‚ '),('‚©'),('‚³'); +INSERT INTO `‚s‚Tb` VALUES ('‚ '); +INSERT INTO `‚s‚Ua` VALUES ('ƒ\'),('\'),('•\'); +INSERT INTO `‚s‚Ub` VALUES ('ƒ\'); +INSERT INTO `‚s‚Va` VALUES ('±'),('¶'),('»'); +INSERT INTO `‚s‚Vb` VALUES ('±'); +INSERT INTO `‚s‚Wa` VALUES ('‚ '),('‚©'),('‚³'); +INSERT INTO `‚s‚Wb` VALUES ('‚ '); +INSERT INTO `‚s‚Xa` VALUES ('ƒ\'),('\'),('•\'); +INSERT INTO `‚s‚Xb` VALUES ('ƒ\'); +INSERT INTO `‚s‚P‚Oa` VALUES ('±'),('¶'),('»'); +INSERT INTO `‚s‚P‚Ob` VALUES ('±'); +INSERT INTO `‚s‚P‚Pa` VALUES ('‚ '),('‚©'),('‚³'); +INSERT INTO `‚s‚P‚Pb` VALUES ('‚ '); +INSERT INTO `‚s‚P‚Qa` VALUES ('ƒ\'),('\'),('•\'); +INSERT INTO `‚s‚P‚Qb` VALUES ('ƒ\'); +SELECT * FROM `‚s‚Pa` JOIN `‚s‚Pb`; +‚b‚P ‚b‚P +± ± +¶ ± +» ± +SELECT * FROM `‚s‚Pa` INNER JOIN `‚s‚Pb`; +‚b‚P ‚b‚P +± ± +¶ ± +» ± +SELECT * FROM `‚s‚Pa` JOIN `‚s‚Pb` USING (`‚b‚P`); +‚b‚P ‚b‚P +± ± +SELECT * FROM `‚s‚Pa` INNER JOIN `‚s‚Pb` USING (`‚b‚P`); +‚b‚P ‚b‚P +± ± +SELECT * FROM `‚s‚Pa` CROSS JOIN `‚s‚Pb`; +‚b‚P ‚b‚P +± ± +¶ ± +» ± +SELECT * FROM `‚s‚Pa` LEFT JOIN `‚s‚Pb` USING (`‚b‚P`); +‚b‚P ‚b‚P +± ± +¶ NULL +» NULL +SELECT * FROM `‚s‚Pa` LEFT JOIN `‚s‚Pb` ON (`‚s‚Pa`.`‚b‚P` = `‚s‚Pb`.`‚b‚P`); +‚b‚P ‚b‚P +± ± +¶ NULL +» NULL +SELECT * FROM `‚s‚Pb` RIGHT JOIN `‚s‚Pa` USING (`‚b‚P`); +‚b‚P ‚b‚P +± ± +NULL ¶ +NULL » +SELECT * FROM `‚s‚Pb` RIGHT JOIN `‚s‚Pa` ON (`‚s‚Pa`.`‚b‚P` = `‚s‚Pb`.`‚b‚P`); +‚b‚P ‚b‚P +± ± +NULL ¶ +NULL » +SELECT * FROM `‚s‚Qa` JOIN `‚s‚Qb`; +‚b‚P ‚b‚P +‚  ‚  +‚© ‚  +‚³ ‚  +SELECT * FROM `‚s‚Qa` INNER JOIN `‚s‚Qb`; +‚b‚P ‚b‚P +‚  ‚  +‚© ‚  +‚³ ‚  +SELECT * FROM `‚s‚Qa` JOIN `‚s‚Qb` USING (`‚b‚P`); +‚b‚P ‚b‚P +‚  ‚  +SELECT * FROM `‚s‚Qa` INNER JOIN `‚s‚Qb` USING (`‚b‚P`); +‚b‚P ‚b‚P +‚  ‚  +SELECT * FROM `‚s‚Qa` CROSS JOIN `‚s‚Qb`; +‚b‚P ‚b‚P +‚  ‚  +‚© ‚  +‚³ ‚  +SELECT * FROM `‚s‚Qa` LEFT JOIN `‚s‚Qb` USING (`‚b‚P`); +‚b‚P ‚b‚P +‚  ‚  +‚© NULL +‚³ NULL +SELECT * FROM `‚s‚Qa` LEFT JOIN `‚s‚Qb` ON (`‚s‚Qa`.`‚b‚P` = `‚s‚Qb`.`‚b‚P`); +‚b‚P ‚b‚P +‚  ‚  +‚© NULL +‚³ NULL +SELECT * FROM `‚s‚Qb` RIGHT JOIN `‚s‚Qa` USING (`‚b‚P`); +‚b‚P ‚b‚P +‚  ‚  +NULL ‚© +NULL ‚³ +SELECT * FROM `‚s‚Qb` RIGHT JOIN `‚s‚Qa` ON (`‚s‚Qa`.`‚b‚P` = `‚s‚Qb`.`‚b‚P`); +‚b‚P ‚b‚P +‚  ‚  +NULL ‚© +NULL ‚³ +SELECT * FROM `‚s‚Ra` JOIN `‚s‚Rb`; +‚b‚P ‚b‚P +ƒ\ ƒ\ +\ ƒ\ +•\ ƒ\ +SELECT * FROM `‚s‚Ra` INNER JOIN `‚s‚Rb`; +‚b‚P ‚b‚P +ƒ\ ƒ\ +\ ƒ\ +•\ ƒ\ +SELECT * FROM `‚s‚Ra` JOIN `‚s‚Rb` USING (`‚b‚P`); +‚b‚P ‚b‚P +ƒ\ ƒ\ +SELECT * FROM `‚s‚Ra` INNER JOIN `‚s‚Rb` USING (`‚b‚P`); +‚b‚P ‚b‚P +ƒ\ ƒ\ +SELECT * FROM `‚s‚Ra` CROSS JOIN `‚s‚Rb`; +‚b‚P ‚b‚P +ƒ\ ƒ\ +\ ƒ\ +•\ ƒ\ +SELECT * FROM `‚s‚Ra` LEFT JOIN `‚s‚Rb` USING (`‚b‚P`); +‚b‚P ‚b‚P +ƒ\ ƒ\ +\ NULL +•\ NULL +SELECT * FROM `‚s‚Ra` LEFT JOIN `‚s‚Rb` ON (`‚s‚Ra`.`‚b‚P` = `‚s‚Rb`.`‚b‚P`); +‚b‚P ‚b‚P +ƒ\ ƒ\ +\ NULL +•\ NULL +SELECT * FROM `‚s‚Rb` RIGHT JOIN `‚s‚Ra` USING (`‚b‚P`); +‚b‚P ‚b‚P +ƒ\ ƒ\ +NULL \ +NULL •\ +SELECT * FROM `‚s‚Rb` RIGHT JOIN `‚s‚Ra` ON (`‚s‚Ra`.`‚b‚P` = `‚s‚Rb`.`‚b‚P`); +‚b‚P ‚b‚P +ƒ\ ƒ\ +NULL \ +NULL •\ +SELECT * FROM `‚s‚Sa` JOIN `‚s‚Sb`; +‚b‚P ‚b‚P +± ± +¶ ± +» ± +SELECT * FROM `‚s‚Sa` INNER JOIN `‚s‚Sb`; +‚b‚P ‚b‚P +± ± +¶ ± +» ± +SELECT * FROM `‚s‚Sa` JOIN `‚s‚Sb` USING (`‚b‚P`); +‚b‚P ‚b‚P +± ± +SELECT * FROM `‚s‚Sa` INNER JOIN `‚s‚Sb` USING (`‚b‚P`); +‚b‚P ‚b‚P +± ± +SELECT * FROM `‚s‚Sa` CROSS JOIN `‚s‚Sb`; +‚b‚P ‚b‚P +± ± +¶ ± +» ± +SELECT * FROM `‚s‚Sa` LEFT JOIN `‚s‚Sb` USING (`‚b‚P`); +‚b‚P ‚b‚P +± ± +¶ NULL +» NULL +SELECT * FROM `‚s‚Sa` LEFT JOIN `‚s‚Sb` ON (`‚s‚Sa`.`‚b‚P` = `‚s‚Sb`.`‚b‚P`); +‚b‚P ‚b‚P +± ± +¶ NULL +» NULL +SELECT * FROM `‚s‚Sb` RIGHT JOIN `‚s‚Sa` USING (`‚b‚P`); +‚b‚P ‚b‚P +± ± +NULL ¶ +NULL » +SELECT * FROM `‚s‚Sb` RIGHT JOIN `‚s‚Sa` ON (`‚s‚Sa`.`‚b‚P` = `‚s‚Sb`.`‚b‚P`); +‚b‚P ‚b‚P +± ± +NULL ¶ +NULL » +SELECT * FROM `‚s‚Ta` JOIN `‚s‚Tb`; +‚b‚P ‚b‚P +‚  ‚  +‚© ‚  +‚³ ‚  +SELECT * FROM `‚s‚Ta` INNER JOIN `‚s‚Tb`; +‚b‚P ‚b‚P +‚  ‚  +‚© ‚  +‚³ ‚  +SELECT * FROM `‚s‚Ta` JOIN `‚s‚Tb` USING (`‚b‚P`); +‚b‚P ‚b‚P +‚  ‚  +SELECT * FROM `‚s‚Ta` INNER JOIN `‚s‚Tb` USING (`‚b‚P`); +‚b‚P ‚b‚P +‚  ‚  +SELECT * FROM `‚s‚Ta` CROSS JOIN `‚s‚Tb`; +‚b‚P ‚b‚P +‚  ‚  +‚© ‚  +‚³ ‚  +SELECT * FROM `‚s‚Ta` LEFT JOIN `‚s‚Tb` USING (`‚b‚P`); +‚b‚P ‚b‚P +‚  ‚  +‚© NULL +‚³ NULL +SELECT * FROM `‚s‚Ta` LEFT JOIN `‚s‚Tb` ON (`‚s‚Ta`.`‚b‚P` = `‚s‚Tb`.`‚b‚P`); +‚b‚P ‚b‚P +‚  ‚  +‚© NULL +‚³ NULL +SELECT * FROM `‚s‚Tb` RIGHT JOIN `‚s‚Ta` USING (`‚b‚P`); +‚b‚P ‚b‚P +‚  ‚  +NULL ‚© +NULL ‚³ +SELECT * FROM `‚s‚Tb` RIGHT JOIN `‚s‚Ta` ON (`‚s‚Ta`.`‚b‚P` = `‚s‚Tb`.`‚b‚P`); +‚b‚P ‚b‚P +‚  ‚  +NULL ‚© +NULL ‚³ +SELECT * FROM `‚s‚Ua` JOIN `‚s‚Ub`; +‚b‚P ‚b‚P +ƒ\ ƒ\ +\ ƒ\ +•\ ƒ\ +SELECT * FROM `‚s‚Ua` INNER JOIN `‚s‚Ub`; +‚b‚P ‚b‚P +ƒ\ ƒ\ +\ ƒ\ +•\ ƒ\ +SELECT * FROM `‚s‚Ua` JOIN `‚s‚Ub` USING (`‚b‚P`); +‚b‚P ‚b‚P +ƒ\ ƒ\ +SELECT * FROM `‚s‚Ua` INNER JOIN `‚s‚Ub` USING (`‚b‚P`); +‚b‚P ‚b‚P +ƒ\ ƒ\ +SELECT * FROM `‚s‚Ua` CROSS JOIN `‚s‚Ub`; +‚b‚P ‚b‚P +ƒ\ ƒ\ +\ ƒ\ +•\ ƒ\ +SELECT * FROM `‚s‚Ua` LEFT JOIN `‚s‚Ub` USING (`‚b‚P`); +‚b‚P ‚b‚P +ƒ\ ƒ\ +\ NULL +•\ NULL +SELECT * FROM `‚s‚Ua` LEFT JOIN `‚s‚Ub` ON (`‚s‚Ua`.`‚b‚P` = `‚s‚Ub`.`‚b‚P`); +‚b‚P ‚b‚P +ƒ\ ƒ\ +\ NULL +•\ NULL +SELECT * FROM `‚s‚Ub` RIGHT JOIN `‚s‚Ua` USING (`‚b‚P`); +‚b‚P ‚b‚P +ƒ\ ƒ\ +NULL \ +NULL •\ +SELECT * FROM `‚s‚Ub` RIGHT JOIN `‚s‚Ua` ON (`‚s‚Ua`.`‚b‚P` = `‚s‚Ub`.`‚b‚P`); +‚b‚P ‚b‚P +ƒ\ ƒ\ +NULL \ +NULL •\ +SELECT * FROM `‚s‚Va` JOIN `‚s‚Vb`; +‚b‚P ‚b‚P +± ± +¶ ± +» ± +SELECT * FROM `‚s‚Va` INNER JOIN `‚s‚Vb`; +‚b‚P ‚b‚P +± ± +¶ ± +» ± +SELECT * FROM `‚s‚Va` JOIN `‚s‚Vb` USING (`‚b‚P`); +‚b‚P ‚b‚P +± ± +SELECT * FROM `‚s‚Va` INNER JOIN `‚s‚Vb` USING (`‚b‚P`); +‚b‚P ‚b‚P +± ± +SELECT * FROM `‚s‚Va` CROSS JOIN `‚s‚Vb`; +‚b‚P ‚b‚P +± ± +¶ ± +» ± +SELECT * FROM `‚s‚Va` LEFT JOIN `‚s‚Vb` USING (`‚b‚P`); +‚b‚P ‚b‚P +± ± +¶ NULL +» NULL +SELECT * FROM `‚s‚Va` LEFT JOIN `‚s‚Vb` ON (`‚s‚Va`.`‚b‚P` = `‚s‚Vb`.`‚b‚P`); +‚b‚P ‚b‚P +± ± +¶ NULL +» NULL +SELECT * FROM `‚s‚Vb` RIGHT JOIN `‚s‚Va` USING (`‚b‚P`); +‚b‚P ‚b‚P +± ± +NULL ¶ +NULL » +SELECT * FROM `‚s‚Vb` RIGHT JOIN `‚s‚Va` ON (`‚s‚Va`.`‚b‚P` = `‚s‚Vb`.`‚b‚P`); +‚b‚P ‚b‚P +± ± +NULL ¶ +NULL » +SELECT * FROM `‚s‚Wa` JOIN `‚s‚Wb`; +‚b‚P ‚b‚P +‚  ‚  +‚© ‚  +‚³ ‚  +SELECT * FROM `‚s‚Wa` INNER JOIN `‚s‚Wb`; +‚b‚P ‚b‚P +‚  ‚  +‚© ‚  +‚³ ‚  +SELECT * FROM `‚s‚Wa` JOIN `‚s‚Wb` USING (`‚b‚P`); +‚b‚P ‚b‚P +‚  ‚  +SELECT * FROM `‚s‚Wa` INNER JOIN `‚s‚Wb` USING (`‚b‚P`); +‚b‚P ‚b‚P +‚  ‚  +SELECT * FROM `‚s‚Wa` CROSS JOIN `‚s‚Wb`; +‚b‚P ‚b‚P +‚  ‚  +‚© ‚  +‚³ ‚  +SELECT * FROM `‚s‚Wa` LEFT JOIN `‚s‚Wb` USING (`‚b‚P`); +‚b‚P ‚b‚P +‚  ‚  +‚© NULL +‚³ NULL +SELECT * FROM `‚s‚Wa` LEFT JOIN `‚s‚Wb` ON (`‚s‚Wa`.`‚b‚P` = `‚s‚Wb`.`‚b‚P`); +‚b‚P ‚b‚P +‚  ‚  +‚© NULL +‚³ NULL +SELECT * FROM `‚s‚Wb` RIGHT JOIN `‚s‚Wa` USING (`‚b‚P`); +‚b‚P ‚b‚P +‚  ‚  +NULL ‚© +NULL ‚³ +SELECT * FROM `‚s‚Wb` RIGHT JOIN `‚s‚Wa` ON (`‚s‚Wa`.`‚b‚P` = `‚s‚Wb`.`‚b‚P`); +‚b‚P ‚b‚P +‚  ‚  +NULL ‚© +NULL ‚³ +SELECT * FROM `‚s‚Xa` JOIN `‚s‚Xb`; +‚b‚P ‚b‚P +ƒ\ ƒ\ +\ ƒ\ +•\ ƒ\ +SELECT * FROM `‚s‚Xa` INNER JOIN `‚s‚Xb`; +‚b‚P ‚b‚P +ƒ\ ƒ\ +\ ƒ\ +•\ ƒ\ +SELECT * FROM `‚s‚Xa` JOIN `‚s‚Xb` USING (`‚b‚P`); +‚b‚P ‚b‚P +ƒ\ ƒ\ +SELECT * FROM `‚s‚Xa` INNER JOIN `‚s‚Xb` USING (`‚b‚P`); +‚b‚P ‚b‚P +ƒ\ ƒ\ +SELECT * FROM `‚s‚Xa` CROSS JOIN `‚s‚Xb`; +‚b‚P ‚b‚P +ƒ\ ƒ\ +\ ƒ\ +•\ ƒ\ +SELECT * FROM `‚s‚Xa` LEFT JOIN `‚s‚Xb` USING (`‚b‚P`); +‚b‚P ‚b‚P +ƒ\ ƒ\ +\ NULL +•\ NULL +SELECT * FROM `‚s‚Xa` LEFT JOIN `‚s‚Xb` ON (`‚s‚Xa`.`‚b‚P` = `‚s‚Xb`.`‚b‚P`); +‚b‚P ‚b‚P +ƒ\ ƒ\ +\ NULL +•\ NULL +SELECT * FROM `‚s‚Xb` RIGHT JOIN `‚s‚Xa` USING (`‚b‚P`); +‚b‚P ‚b‚P +ƒ\ ƒ\ +NULL \ +NULL •\ +SELECT * FROM `‚s‚Xb` RIGHT JOIN `‚s‚Xa` ON (`‚s‚Xa`.`‚b‚P` = `‚s‚Xb`.`‚b‚P`); +‚b‚P ‚b‚P +ƒ\ ƒ\ +NULL \ +NULL •\ +SELECT * FROM `‚s‚P‚Oa` JOIN `‚s‚P‚Ob`; +‚b‚P ‚b‚P +± ± +¶ ± +» ± +SELECT * FROM `‚s‚P‚Oa` INNER JOIN `‚s‚P‚Ob`; +‚b‚P ‚b‚P +± ± +¶ ± +» ± +SELECT * FROM `‚s‚P‚Oa` JOIN `‚s‚P‚Ob` USING (`‚b‚P`); +‚b‚P ‚b‚P +± ± +SELECT * FROM `‚s‚P‚Oa` INNER JOIN `‚s‚P‚Ob` USING (`‚b‚P`); +‚b‚P ‚b‚P +± ± +SELECT * FROM `‚s‚P‚Oa` CROSS JOIN `‚s‚P‚Ob`; +‚b‚P ‚b‚P +± ± +¶ ± +» ± +SELECT * FROM `‚s‚P‚Oa` LEFT JOIN `‚s‚P‚Ob` USING (`‚b‚P`); +‚b‚P ‚b‚P +± ± +¶ NULL +» NULL +SELECT * FROM `‚s‚P‚Oa` LEFT JOIN `‚s‚P‚Ob` ON (`‚s‚P‚Oa`.`‚b‚P` = `‚s‚P‚Ob`.`‚b‚P`); +‚b‚P ‚b‚P +± ± +¶ NULL +» NULL +SELECT * FROM `‚s‚P‚Ob` RIGHT JOIN `‚s‚P‚Oa` USING (`‚b‚P`); +‚b‚P ‚b‚P +± ± +NULL ¶ +NULL » +SELECT * FROM `‚s‚P‚Ob` RIGHT JOIN `‚s‚P‚Oa` ON (`‚s‚P‚Oa`.`‚b‚P` = `‚s‚P‚Ob`.`‚b‚P`); +‚b‚P ‚b‚P +± ± +NULL ¶ +NULL » +SELECT * FROM `‚s‚P‚Pa` JOIN `‚s‚P‚Pb`; +‚b‚P ‚b‚P +‚  ‚  +‚© ‚  +‚³ ‚  +SELECT * FROM `‚s‚P‚Pa` INNER JOIN `‚s‚P‚Pb`; +‚b‚P ‚b‚P +‚  ‚  +‚© ‚  +‚³ ‚  +SELECT * FROM `‚s‚P‚Pa` JOIN `‚s‚P‚Pb` USING (`‚b‚P`); +‚b‚P ‚b‚P +‚  ‚  +SELECT * FROM `‚s‚P‚Pa` INNER JOIN `‚s‚P‚Pb` USING (`‚b‚P`); +‚b‚P ‚b‚P +‚  ‚  +SELECT * FROM `‚s‚P‚Pa` CROSS JOIN `‚s‚P‚Pb`; +‚b‚P ‚b‚P +‚  ‚  +‚© ‚  +‚³ ‚  +SELECT * FROM `‚s‚P‚Pa` LEFT JOIN `‚s‚P‚Pb` USING (`‚b‚P`); +‚b‚P ‚b‚P +‚  ‚  +‚© NULL +‚³ NULL +SELECT * FROM `‚s‚P‚Pa` LEFT JOIN `‚s‚P‚Pb` ON (`‚s‚P‚Pa`.`‚b‚P` = `‚s‚P‚Pb`.`‚b‚P`); +‚b‚P ‚b‚P +‚  ‚  +‚© NULL +‚³ NULL +SELECT * FROM `‚s‚P‚Pb` RIGHT JOIN `‚s‚P‚Pa` USING (`‚b‚P`); +‚b‚P ‚b‚P +‚  ‚  +NULL ‚© +NULL ‚³ +SELECT * FROM `‚s‚P‚Pb` RIGHT JOIN `‚s‚P‚Pa` ON (`‚s‚P‚Pa`.`‚b‚P` = `‚s‚P‚Pb`.`‚b‚P`); +‚b‚P ‚b‚P +‚  ‚  +NULL ‚© +NULL ‚³ +SELECT * FROM `‚s‚P‚Qa` JOIN `‚s‚P‚Qb`; +‚b‚P ‚b‚P +ƒ\ ƒ\ +\ ƒ\ +•\ ƒ\ +SELECT * FROM `‚s‚P‚Qa` INNER JOIN `‚s‚P‚Qb`; +‚b‚P ‚b‚P +ƒ\ ƒ\ +\ ƒ\ +•\ ƒ\ +SELECT * FROM `‚s‚P‚Qa` JOIN `‚s‚P‚Qb` USING (`‚b‚P`); +‚b‚P ‚b‚P +ƒ\ ƒ\ +SELECT * FROM `‚s‚P‚Qa` INNER JOIN `‚s‚P‚Qb` USING (`‚b‚P`); +‚b‚P ‚b‚P +ƒ\ ƒ\ +SELECT * FROM `‚s‚P‚Qa` CROSS JOIN `‚s‚P‚Qb`; +‚b‚P ‚b‚P +ƒ\ ƒ\ +\ ƒ\ +•\ ƒ\ +SELECT * FROM `‚s‚P‚Qa` LEFT JOIN `‚s‚P‚Qb` USING (`‚b‚P`); +‚b‚P ‚b‚P +ƒ\ ƒ\ +\ NULL +•\ NULL +SELECT * FROM `‚s‚P‚Qa` LEFT JOIN `‚s‚P‚Qb` ON (`‚s‚P‚Qa`.`‚b‚P` = `‚s‚P‚Qb`.`‚b‚P`); +‚b‚P ‚b‚P +ƒ\ ƒ\ +\ NULL +•\ NULL +SELECT * FROM `‚s‚P‚Qb` RIGHT JOIN `‚s‚P‚Qa` USING (`‚b‚P`); +‚b‚P ‚b‚P +ƒ\ ƒ\ +NULL \ +NULL •\ +SELECT * FROM `‚s‚P‚Qb` RIGHT JOIN `‚s‚P‚Qa` ON (`‚s‚P‚Qa`.`‚b‚P` = `‚s‚P‚Qb`.`‚b‚P`); +‚b‚P ‚b‚P +ƒ\ ƒ\ +NULL \ +NULL •\ +DROP TABLE `‚s‚Pa`; +DROP TABLE `‚s‚Pb`; +DROP TABLE `‚s‚Qa`; +DROP TABLE `‚s‚Qb`; +DROP TABLE `‚s‚Ra`; +DROP TABLE `‚s‚Rb`; +DROP TABLE `‚s‚Sa`; +DROP TABLE `‚s‚Sb`; +DROP TABLE `‚s‚Ta`; +DROP TABLE `‚s‚Tb`; +DROP TABLE `‚s‚Ua`; +DROP TABLE `‚s‚Ub`; +DROP TABLE `‚s‚Va`; +DROP TABLE `‚s‚Vb`; +DROP TABLE `‚s‚Wa`; +DROP TABLE `‚s‚Wb`; +DROP TABLE `‚s‚Xa`; +DROP TABLE `‚s‚Xb`; +DROP TABLE `‚s‚P‚Oa`; +DROP TABLE `‚s‚P‚Ob`; +DROP TABLE `‚s‚P‚Pa`; +DROP TABLE `‚s‚P‚Pb`; +DROP TABLE `‚s‚P‚Qa`; +DROP TABLE `‚s‚P‚Qb`; diff --git a/mysql-test/suite/jp/r/jp_join_ucs2.result b/mysql-test/suite/jp/r/jp_join_ucs2.result new file mode 100755 index 00000000000..76988f15cc4 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_join_ucs2.result @@ -0,0 +1,579 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; +CREATE TABLE `£Ô£±a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£±b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£µa` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£µb` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£¶a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£¶b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£·a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£·b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£¸a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£¸b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£¹a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£¹b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£±£°a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£±£°b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£±£±a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£±£±b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£±£²a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£±£²b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +INSERT INTO `£Ô£±a` VALUES ('ޱ'),('޶'),('Ž»'); +INSERT INTO `£Ô£±b` VALUES ('ޱ'); +INSERT INTO `£Ô£²a` VALUES ('¤¢'),('¤«'),('¤µ'); +INSERT INTO `£Ô£²b` VALUES ('¤¢'); +INSERT INTO `£Ô£³a` VALUES ('íÜ'),('íÝ'),('íÞ'); +INSERT INTO `£Ô£³b` VALUES ('íÜ'); +INSERT INTO `£Ô£´a` VALUES ('ޱ'),('޶'),('Ž»'); +INSERT INTO `£Ô£´b` VALUES ('ޱ'); +INSERT INTO `£Ô£µa` VALUES ('¤¢'),('¤«'),('¤µ'); +INSERT INTO `£Ô£µb` VALUES ('¤¢'); +INSERT INTO `£Ô£¶a` VALUES ('íÜ'),('íÝ'),('íÞ'); +INSERT INTO `£Ô£¶b` VALUES ('íÜ'); +INSERT INTO `£Ô£·a` VALUES ('ޱ'),('޶'),('Ž»'); +INSERT INTO `£Ô£·b` VALUES ('ޱ'); +INSERT INTO `£Ô£¸a` VALUES ('¤¢'),('¤«'),('¤µ'); +INSERT INTO `£Ô£¸b` VALUES ('¤¢'); +INSERT INTO `£Ô£¹a` VALUES ('íÜ'),('íÝ'),('íÞ'); +INSERT INTO `£Ô£¹b` VALUES ('íÜ'); +INSERT INTO `£Ô£±£°a` VALUES ('ޱ'),('޶'),('Ž»'); +INSERT INTO `£Ô£±£°b` VALUES ('ޱ'); +INSERT INTO `£Ô£±£±a` VALUES ('¤¢'),('¤«'),('¤µ'); +INSERT INTO `£Ô£±£±b` VALUES ('¤¢'); +INSERT INTO `£Ô£±£²a` VALUES ('íÜ'),('íÝ'),('íÞ'); +INSERT INTO `£Ô£±£²b` VALUES ('íÜ'); +SELECT * FROM `£Ô£±a` JOIN `£Ô£±b`; +£Ã£± £Ã£± +ޱ ޱ +޶ ޱ +Ž» ޱ +SELECT * FROM `£Ô£±a` INNER JOIN `£Ô£±b`; +£Ã£± £Ã£± +ޱ ޱ +޶ ޱ +Ž» ޱ +SELECT * FROM `£Ô£±a` JOIN `£Ô£±b` USING (`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +SELECT * FROM `£Ô£±a` INNER JOIN `£Ô£±b` USING (`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +SELECT * FROM `£Ô£±a` CROSS JOIN `£Ô£±b`; +£Ã£± £Ã£± +ޱ ޱ +޶ ޱ +Ž» ޱ +SELECT * FROM `£Ô£±a` LEFT JOIN `£Ô£±b` USING (`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +޶ NULL +Ž» NULL +SELECT * FROM `£Ô£±a` LEFT JOIN `£Ô£±b` ON (`£Ô£±a`.`£Ã£±` = `£Ô£±b`.`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +޶ NULL +Ž» NULL +SELECT * FROM `£Ô£±b` RIGHT JOIN `£Ô£±a` USING (`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +NULL ޶ +NULL Ž» +SELECT * FROM `£Ô£±b` RIGHT JOIN `£Ô£±a` ON (`£Ô£±a`.`£Ã£±` = `£Ô£±b`.`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +NULL ޶ +NULL Ž» +SELECT * FROM `£Ô£²a` JOIN `£Ô£²b`; +£Ã£± £Ã£± +¤¢ ¤¢ +¤« ¤¢ +¤µ ¤¢ +SELECT * FROM `£Ô£²a` INNER JOIN `£Ô£²b`; +£Ã£± £Ã£± +¤¢ ¤¢ +¤« ¤¢ +¤µ ¤¢ +SELECT * FROM `£Ô£²a` JOIN `£Ô£²b` USING (`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +SELECT * FROM `£Ô£²a` INNER JOIN `£Ô£²b` USING (`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +SELECT * FROM `£Ô£²a` CROSS JOIN `£Ô£²b`; +£Ã£± £Ã£± +¤¢ ¤¢ +¤« ¤¢ +¤µ ¤¢ +SELECT * FROM `£Ô£²a` LEFT JOIN `£Ô£²b` USING (`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +¤« NULL +¤µ NULL +SELECT * FROM `£Ô£²a` LEFT JOIN `£Ô£²b` ON (`£Ô£²a`.`£Ã£±` = `£Ô£²b`.`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +¤« NULL +¤µ NULL +SELECT * FROM `£Ô£²b` RIGHT JOIN `£Ô£²a` USING (`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +NULL ¤« +NULL ¤µ +SELECT * FROM `£Ô£²b` RIGHT JOIN `£Ô£²a` ON (`£Ô£²a`.`£Ã£±` = `£Ô£²b`.`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +NULL ¤« +NULL ¤µ +SELECT * FROM `£Ô£³a` JOIN `£Ô£³b`; +£Ã£± £Ã£± +íÜ íÜ +íÝ íÜ +íÞ íÜ +SELECT * FROM `£Ô£³a` INNER JOIN `£Ô£³b`; +£Ã£± £Ã£± +íÜ íÜ +íÝ íÜ +íÞ íÜ +SELECT * FROM `£Ô£³a` JOIN `£Ô£³b` USING (`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +SELECT * FROM `£Ô£³a` INNER JOIN `£Ô£³b` USING (`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +SELECT * FROM `£Ô£³a` CROSS JOIN `£Ô£³b`; +£Ã£± £Ã£± +íÜ íÜ +íÝ íÜ +íÞ íÜ +SELECT * FROM `£Ô£³a` LEFT JOIN `£Ô£³b` USING (`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +íÝ NULL +íÞ NULL +SELECT * FROM `£Ô£³a` LEFT JOIN `£Ô£³b` ON (`£Ô£³a`.`£Ã£±` = `£Ô£³b`.`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +íÝ NULL +íÞ NULL +SELECT * FROM `£Ô£³b` RIGHT JOIN `£Ô£³a` USING (`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +NULL íÝ +NULL íÞ +SELECT * FROM `£Ô£³b` RIGHT JOIN `£Ô£³a` ON (`£Ô£³a`.`£Ã£±` = `£Ô£³b`.`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +NULL íÝ +NULL íÞ +SELECT * FROM `£Ô£´a` JOIN `£Ô£´b`; +£Ã£± £Ã£± +ޱ ޱ +޶ ޱ +Ž» ޱ +SELECT * FROM `£Ô£´a` INNER JOIN `£Ô£´b`; +£Ã£± £Ã£± +ޱ ޱ +޶ ޱ +Ž» ޱ +SELECT * FROM `£Ô£´a` JOIN `£Ô£´b` USING (`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +SELECT * FROM `£Ô£´a` INNER JOIN `£Ô£´b` USING (`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +SELECT * FROM `£Ô£´a` CROSS JOIN `£Ô£´b`; +£Ã£± £Ã£± +ޱ ޱ +޶ ޱ +Ž» ޱ +SELECT * FROM `£Ô£´a` LEFT JOIN `£Ô£´b` USING (`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +޶ NULL +Ž» NULL +SELECT * FROM `£Ô£´a` LEFT JOIN `£Ô£´b` ON (`£Ô£´a`.`£Ã£±` = `£Ô£´b`.`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +޶ NULL +Ž» NULL +SELECT * FROM `£Ô£´b` RIGHT JOIN `£Ô£´a` USING (`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +NULL ޶ +NULL Ž» +SELECT * FROM `£Ô£´b` RIGHT JOIN `£Ô£´a` ON (`£Ô£´a`.`£Ã£±` = `£Ô£´b`.`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +NULL ޶ +NULL Ž» +SELECT * FROM `£Ô£µa` JOIN `£Ô£µb`; +£Ã£± £Ã£± +¤¢ ¤¢ +¤« ¤¢ +¤µ ¤¢ +SELECT * FROM `£Ô£µa` INNER JOIN `£Ô£µb`; +£Ã£± £Ã£± +¤¢ ¤¢ +¤« ¤¢ +¤µ ¤¢ +SELECT * FROM `£Ô£µa` JOIN `£Ô£µb` USING (`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +SELECT * FROM `£Ô£µa` INNER JOIN `£Ô£µb` USING (`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +SELECT * FROM `£Ô£µa` CROSS JOIN `£Ô£µb`; +£Ã£± £Ã£± +¤¢ ¤¢ +¤« ¤¢ +¤µ ¤¢ +SELECT * FROM `£Ô£µa` LEFT JOIN `£Ô£µb` USING (`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +¤« NULL +¤µ NULL +SELECT * FROM `£Ô£µa` LEFT JOIN `£Ô£µb` ON (`£Ô£µa`.`£Ã£±` = `£Ô£µb`.`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +¤« NULL +¤µ NULL +SELECT * FROM `£Ô£µb` RIGHT JOIN `£Ô£µa` USING (`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +NULL ¤« +NULL ¤µ +SELECT * FROM `£Ô£µb` RIGHT JOIN `£Ô£µa` ON (`£Ô£µa`.`£Ã£±` = `£Ô£µb`.`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +NULL ¤« +NULL ¤µ +SELECT * FROM `£Ô£¶a` JOIN `£Ô£¶b`; +£Ã£± £Ã£± +íÜ íÜ +íÝ íÜ +íÞ íÜ +SELECT * FROM `£Ô£¶a` INNER JOIN `£Ô£¶b`; +£Ã£± £Ã£± +íÜ íÜ +íÝ íÜ +íÞ íÜ +SELECT * FROM `£Ô£¶a` JOIN `£Ô£¶b` USING (`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +SELECT * FROM `£Ô£¶a` INNER JOIN `£Ô£¶b` USING (`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +SELECT * FROM `£Ô£¶a` CROSS JOIN `£Ô£¶b`; +£Ã£± £Ã£± +íÜ íÜ +íÝ íÜ +íÞ íÜ +SELECT * FROM `£Ô£¶a` LEFT JOIN `£Ô£¶b` USING (`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +íÝ NULL +íÞ NULL +SELECT * FROM `£Ô£¶a` LEFT JOIN `£Ô£¶b` ON (`£Ô£¶a`.`£Ã£±` = `£Ô£¶b`.`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +íÝ NULL +íÞ NULL +SELECT * FROM `£Ô£¶b` RIGHT JOIN `£Ô£¶a` USING (`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +NULL íÝ +NULL íÞ +SELECT * FROM `£Ô£¶b` RIGHT JOIN `£Ô£¶a` ON (`£Ô£¶a`.`£Ã£±` = `£Ô£¶b`.`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +NULL íÝ +NULL íÞ +SELECT * FROM `£Ô£·a` JOIN `£Ô£·b`; +£Ã£± £Ã£± +ޱ ޱ +޶ ޱ +Ž» ޱ +SELECT * FROM `£Ô£·a` INNER JOIN `£Ô£·b`; +£Ã£± £Ã£± +ޱ ޱ +޶ ޱ +Ž» ޱ +SELECT * FROM `£Ô£·a` JOIN `£Ô£·b` USING (`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +SELECT * FROM `£Ô£·a` INNER JOIN `£Ô£·b` USING (`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +SELECT * FROM `£Ô£·a` CROSS JOIN `£Ô£·b`; +£Ã£± £Ã£± +ޱ ޱ +޶ ޱ +Ž» ޱ +SELECT * FROM `£Ô£·a` LEFT JOIN `£Ô£·b` USING (`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +޶ NULL +Ž» NULL +SELECT * FROM `£Ô£·a` LEFT JOIN `£Ô£·b` ON (`£Ô£·a`.`£Ã£±` = `£Ô£·b`.`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +޶ NULL +Ž» NULL +SELECT * FROM `£Ô£·b` RIGHT JOIN `£Ô£·a` USING (`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +NULL ޶ +NULL Ž» +SELECT * FROM `£Ô£·b` RIGHT JOIN `£Ô£·a` ON (`£Ô£·a`.`£Ã£±` = `£Ô£·b`.`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +NULL ޶ +NULL Ž» +SELECT * FROM `£Ô£¸a` JOIN `£Ô£¸b`; +£Ã£± £Ã£± +¤¢ ¤¢ +¤« ¤¢ +¤µ ¤¢ +SELECT * FROM `£Ô£¸a` INNER JOIN `£Ô£¸b`; +£Ã£± £Ã£± +¤¢ ¤¢ +¤« ¤¢ +¤µ ¤¢ +SELECT * FROM `£Ô£¸a` JOIN `£Ô£¸b` USING (`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +SELECT * FROM `£Ô£¸a` INNER JOIN `£Ô£¸b` USING (`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +SELECT * FROM `£Ô£¸a` CROSS JOIN `£Ô£¸b`; +£Ã£± £Ã£± +¤¢ ¤¢ +¤« ¤¢ +¤µ ¤¢ +SELECT * FROM `£Ô£¸a` LEFT JOIN `£Ô£¸b` USING (`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +¤« NULL +¤µ NULL +SELECT * FROM `£Ô£¸a` LEFT JOIN `£Ô£¸b` ON (`£Ô£¸a`.`£Ã£±` = `£Ô£¸b`.`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +¤« NULL +¤µ NULL +SELECT * FROM `£Ô£¸b` RIGHT JOIN `£Ô£¸a` USING (`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +NULL ¤« +NULL ¤µ +SELECT * FROM `£Ô£¸b` RIGHT JOIN `£Ô£¸a` ON (`£Ô£¸a`.`£Ã£±` = `£Ô£¸b`.`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +NULL ¤« +NULL ¤µ +SELECT * FROM `£Ô£¹a` JOIN `£Ô£¹b`; +£Ã£± £Ã£± +íÜ íÜ +íÝ íÜ +íÞ íÜ +SELECT * FROM `£Ô£¹a` INNER JOIN `£Ô£¹b`; +£Ã£± £Ã£± +íÜ íÜ +íÝ íÜ +íÞ íÜ +SELECT * FROM `£Ô£¹a` JOIN `£Ô£¹b` USING (`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +SELECT * FROM `£Ô£¹a` INNER JOIN `£Ô£¹b` USING (`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +SELECT * FROM `£Ô£¹a` CROSS JOIN `£Ô£¹b`; +£Ã£± £Ã£± +íÜ íÜ +íÝ íÜ +íÞ íÜ +SELECT * FROM `£Ô£¹a` LEFT JOIN `£Ô£¹b` USING (`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +íÝ NULL +íÞ NULL +SELECT * FROM `£Ô£¹a` LEFT JOIN `£Ô£¹b` ON (`£Ô£¹a`.`£Ã£±` = `£Ô£¹b`.`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +íÝ NULL +íÞ NULL +SELECT * FROM `£Ô£¹b` RIGHT JOIN `£Ô£¹a` USING (`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +NULL íÝ +NULL íÞ +SELECT * FROM `£Ô£¹b` RIGHT JOIN `£Ô£¹a` ON (`£Ô£¹a`.`£Ã£±` = `£Ô£¹b`.`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +NULL íÝ +NULL íÞ +SELECT * FROM `£Ô£±£°a` JOIN `£Ô£±£°b`; +£Ã£± £Ã£± +ޱ ޱ +޶ ޱ +Ž» ޱ +SELECT * FROM `£Ô£±£°a` INNER JOIN `£Ô£±£°b`; +£Ã£± £Ã£± +ޱ ޱ +޶ ޱ +Ž» ޱ +SELECT * FROM `£Ô£±£°a` JOIN `£Ô£±£°b` USING (`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +SELECT * FROM `£Ô£±£°a` INNER JOIN `£Ô£±£°b` USING (`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +SELECT * FROM `£Ô£±£°a` CROSS JOIN `£Ô£±£°b`; +£Ã£± £Ã£± +ޱ ޱ +޶ ޱ +Ž» ޱ +SELECT * FROM `£Ô£±£°a` LEFT JOIN `£Ô£±£°b` USING (`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +޶ NULL +Ž» NULL +SELECT * FROM `£Ô£±£°a` LEFT JOIN `£Ô£±£°b` ON (`£Ô£±£°a`.`£Ã£±` = `£Ô£±£°b`.`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +޶ NULL +Ž» NULL +SELECT * FROM `£Ô£±£°b` RIGHT JOIN `£Ô£±£°a` USING (`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +NULL ޶ +NULL Ž» +SELECT * FROM `£Ô£±£°b` RIGHT JOIN `£Ô£±£°a` ON (`£Ô£±£°a`.`£Ã£±` = `£Ô£±£°b`.`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +NULL ޶ +NULL Ž» +SELECT * FROM `£Ô£±£±a` JOIN `£Ô£±£±b`; +£Ã£± £Ã£± +¤¢ ¤¢ +¤« ¤¢ +¤µ ¤¢ +SELECT * FROM `£Ô£±£±a` INNER JOIN `£Ô£±£±b`; +£Ã£± £Ã£± +¤¢ ¤¢ +¤« ¤¢ +¤µ ¤¢ +SELECT * FROM `£Ô£±£±a` JOIN `£Ô£±£±b` USING (`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +SELECT * FROM `£Ô£±£±a` INNER JOIN `£Ô£±£±b` USING (`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +SELECT * FROM `£Ô£±£±a` CROSS JOIN `£Ô£±£±b`; +£Ã£± £Ã£± +¤¢ ¤¢ +¤« ¤¢ +¤µ ¤¢ +SELECT * FROM `£Ô£±£±a` LEFT JOIN `£Ô£±£±b` USING (`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +¤« NULL +¤µ NULL +SELECT * FROM `£Ô£±£±a` LEFT JOIN `£Ô£±£±b` ON (`£Ô£±£±a`.`£Ã£±` = `£Ô£±£±b`.`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +¤« NULL +¤µ NULL +SELECT * FROM `£Ô£±£±b` RIGHT JOIN `£Ô£±£±a` USING (`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +NULL ¤« +NULL ¤µ +SELECT * FROM `£Ô£±£±b` RIGHT JOIN `£Ô£±£±a` ON (`£Ô£±£±a`.`£Ã£±` = `£Ô£±£±b`.`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +NULL ¤« +NULL ¤µ +SELECT * FROM `£Ô£±£²a` JOIN `£Ô£±£²b`; +£Ã£± £Ã£± +íÜ íÜ +íÝ íÜ +íÞ íÜ +SELECT * FROM `£Ô£±£²a` INNER JOIN `£Ô£±£²b`; +£Ã£± £Ã£± +íÜ íÜ +íÝ íÜ +íÞ íÜ +SELECT * FROM `£Ô£±£²a` JOIN `£Ô£±£²b` USING (`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +SELECT * FROM `£Ô£±£²a` INNER JOIN `£Ô£±£²b` USING (`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +SELECT * FROM `£Ô£±£²a` CROSS JOIN `£Ô£±£²b`; +£Ã£± £Ã£± +íÜ íÜ +íÝ íÜ +íÞ íÜ +SELECT * FROM `£Ô£±£²a` LEFT JOIN `£Ô£±£²b` USING (`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +íÝ NULL +íÞ NULL +SELECT * FROM `£Ô£±£²a` LEFT JOIN `£Ô£±£²b` ON (`£Ô£±£²a`.`£Ã£±` = `£Ô£±£²b`.`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +íÝ NULL +íÞ NULL +SELECT * FROM `£Ô£±£²b` RIGHT JOIN `£Ô£±£²a` USING (`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +NULL íÝ +NULL íÞ +SELECT * FROM `£Ô£±£²b` RIGHT JOIN `£Ô£±£²a` ON (`£Ô£±£²a`.`£Ã£±` = `£Ô£±£²b`.`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +NULL íÝ +NULL íÞ +DROP TABLE `£Ô£±a`; +DROP TABLE `£Ô£±b`; +DROP TABLE `£Ô£²a`; +DROP TABLE `£Ô£²b`; +DROP TABLE `£Ô£³a`; +DROP TABLE `£Ô£³b`; +DROP TABLE `£Ô£´a`; +DROP TABLE `£Ô£´b`; +DROP TABLE `£Ô£µa`; +DROP TABLE `£Ô£µb`; +DROP TABLE `£Ô£¶a`; +DROP TABLE `£Ô£¶b`; +DROP TABLE `£Ô£·a`; +DROP TABLE `£Ô£·b`; +DROP TABLE `£Ô£¸a`; +DROP TABLE `£Ô£¸b`; +DROP TABLE `£Ô£¹a`; +DROP TABLE `£Ô£¹b`; +DROP TABLE `£Ô£±£°a`; +DROP TABLE `£Ô£±£°b`; +DROP TABLE `£Ô£±£±a`; +DROP TABLE `£Ô£±£±b`; +DROP TABLE `£Ô£±£²a`; +DROP TABLE `£Ô£±£²b`; diff --git a/mysql-test/suite/jp/r/jp_join_ujis.result b/mysql-test/suite/jp/r/jp_join_ujis.result new file mode 100755 index 00000000000..ac430cd9b5e --- /dev/null +++ b/mysql-test/suite/jp/r/jp_join_ujis.result @@ -0,0 +1,578 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +SET NAMES ujis; +SET character_set_database = ujis; +CREATE TABLE `£Ô£±a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£±b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£µa` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£µb` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£¶a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£¶b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£·a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£·b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£¸a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£¸b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£¹a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£¹b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£±£°a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£±£°b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£±£±a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£±£±b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£±£²a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£±£²b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +INSERT INTO `£Ô£±a` VALUES ('ޱ'),('޶'),('Ž»'); +INSERT INTO `£Ô£±b` VALUES ('ޱ'); +INSERT INTO `£Ô£²a` VALUES ('¤¢'),('¤«'),('¤µ'); +INSERT INTO `£Ô£²b` VALUES ('¤¢'); +INSERT INTO `£Ô£³a` VALUES ('íÜ'),('íÝ'),('íÞ'); +INSERT INTO `£Ô£³b` VALUES ('íÜ'); +INSERT INTO `£Ô£´a` VALUES ('ޱ'),('޶'),('Ž»'); +INSERT INTO `£Ô£´b` VALUES ('ޱ'); +INSERT INTO `£Ô£µa` VALUES ('¤¢'),('¤«'),('¤µ'); +INSERT INTO `£Ô£µb` VALUES ('¤¢'); +INSERT INTO `£Ô£¶a` VALUES ('íÜ'),('íÝ'),('íÞ'); +INSERT INTO `£Ô£¶b` VALUES ('íÜ'); +INSERT INTO `£Ô£·a` VALUES ('ޱ'),('޶'),('Ž»'); +INSERT INTO `£Ô£·b` VALUES ('ޱ'); +INSERT INTO `£Ô£¸a` VALUES ('¤¢'),('¤«'),('¤µ'); +INSERT INTO `£Ô£¸b` VALUES ('¤¢'); +INSERT INTO `£Ô£¹a` VALUES ('íÜ'),('íÝ'),('íÞ'); +INSERT INTO `£Ô£¹b` VALUES ('íÜ'); +INSERT INTO `£Ô£±£°a` VALUES ('ޱ'),('޶'),('Ž»'); +INSERT INTO `£Ô£±£°b` VALUES ('ޱ'); +INSERT INTO `£Ô£±£±a` VALUES ('¤¢'),('¤«'),('¤µ'); +INSERT INTO `£Ô£±£±b` VALUES ('¤¢'); +INSERT INTO `£Ô£±£²a` VALUES ('íÜ'),('íÝ'),('íÞ'); +INSERT INTO `£Ô£±£²b` VALUES ('íÜ'); +SELECT * FROM `£Ô£±a` JOIN `£Ô£±b`; +£Ã£± £Ã£± +ޱ ޱ +޶ ޱ +Ž» ޱ +SELECT * FROM `£Ô£±a` INNER JOIN `£Ô£±b`; +£Ã£± £Ã£± +ޱ ޱ +޶ ޱ +Ž» ޱ +SELECT * FROM `£Ô£±a` JOIN `£Ô£±b` USING (`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +SELECT * FROM `£Ô£±a` INNER JOIN `£Ô£±b` USING (`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +SELECT * FROM `£Ô£±a` CROSS JOIN `£Ô£±b`; +£Ã£± £Ã£± +ޱ ޱ +޶ ޱ +Ž» ޱ +SELECT * FROM `£Ô£±a` LEFT JOIN `£Ô£±b` USING (`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +޶ NULL +Ž» NULL +SELECT * FROM `£Ô£±a` LEFT JOIN `£Ô£±b` ON (`£Ô£±a`.`£Ã£±` = `£Ô£±b`.`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +޶ NULL +Ž» NULL +SELECT * FROM `£Ô£±b` RIGHT JOIN `£Ô£±a` USING (`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +NULL ޶ +NULL Ž» +SELECT * FROM `£Ô£±b` RIGHT JOIN `£Ô£±a` ON (`£Ô£±a`.`£Ã£±` = `£Ô£±b`.`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +NULL ޶ +NULL Ž» +SELECT * FROM `£Ô£²a` JOIN `£Ô£²b`; +£Ã£± £Ã£± +¤¢ ¤¢ +¤« ¤¢ +¤µ ¤¢ +SELECT * FROM `£Ô£²a` INNER JOIN `£Ô£²b`; +£Ã£± £Ã£± +¤¢ ¤¢ +¤« ¤¢ +¤µ ¤¢ +SELECT * FROM `£Ô£²a` JOIN `£Ô£²b` USING (`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +SELECT * FROM `£Ô£²a` INNER JOIN `£Ô£²b` USING (`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +SELECT * FROM `£Ô£²a` CROSS JOIN `£Ô£²b`; +£Ã£± £Ã£± +¤¢ ¤¢ +¤« ¤¢ +¤µ ¤¢ +SELECT * FROM `£Ô£²a` LEFT JOIN `£Ô£²b` USING (`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +¤« NULL +¤µ NULL +SELECT * FROM `£Ô£²a` LEFT JOIN `£Ô£²b` ON (`£Ô£²a`.`£Ã£±` = `£Ô£²b`.`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +¤« NULL +¤µ NULL +SELECT * FROM `£Ô£²b` RIGHT JOIN `£Ô£²a` USING (`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +NULL ¤« +NULL ¤µ +SELECT * FROM `£Ô£²b` RIGHT JOIN `£Ô£²a` ON (`£Ô£²a`.`£Ã£±` = `£Ô£²b`.`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +NULL ¤« +NULL ¤µ +SELECT * FROM `£Ô£³a` JOIN `£Ô£³b`; +£Ã£± £Ã£± +íÜ íÜ +íÝ íÜ +íÞ íÜ +SELECT * FROM `£Ô£³a` INNER JOIN `£Ô£³b`; +£Ã£± £Ã£± +íÜ íÜ +íÝ íÜ +íÞ íÜ +SELECT * FROM `£Ô£³a` JOIN `£Ô£³b` USING (`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +SELECT * FROM `£Ô£³a` INNER JOIN `£Ô£³b` USING (`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +SELECT * FROM `£Ô£³a` CROSS JOIN `£Ô£³b`; +£Ã£± £Ã£± +íÜ íÜ +íÝ íÜ +íÞ íÜ +SELECT * FROM `£Ô£³a` LEFT JOIN `£Ô£³b` USING (`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +íÝ NULL +íÞ NULL +SELECT * FROM `£Ô£³a` LEFT JOIN `£Ô£³b` ON (`£Ô£³a`.`£Ã£±` = `£Ô£³b`.`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +íÝ NULL +íÞ NULL +SELECT * FROM `£Ô£³b` RIGHT JOIN `£Ô£³a` USING (`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +NULL íÝ +NULL íÞ +SELECT * FROM `£Ô£³b` RIGHT JOIN `£Ô£³a` ON (`£Ô£³a`.`£Ã£±` = `£Ô£³b`.`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +NULL íÝ +NULL íÞ +SELECT * FROM `£Ô£´a` JOIN `£Ô£´b`; +£Ã£± £Ã£± +ޱ ޱ +޶ ޱ +Ž» ޱ +SELECT * FROM `£Ô£´a` INNER JOIN `£Ô£´b`; +£Ã£± £Ã£± +ޱ ޱ +޶ ޱ +Ž» ޱ +SELECT * FROM `£Ô£´a` JOIN `£Ô£´b` USING (`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +SELECT * FROM `£Ô£´a` INNER JOIN `£Ô£´b` USING (`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +SELECT * FROM `£Ô£´a` CROSS JOIN `£Ô£´b`; +£Ã£± £Ã£± +ޱ ޱ +޶ ޱ +Ž» ޱ +SELECT * FROM `£Ô£´a` LEFT JOIN `£Ô£´b` USING (`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +޶ NULL +Ž» NULL +SELECT * FROM `£Ô£´a` LEFT JOIN `£Ô£´b` ON (`£Ô£´a`.`£Ã£±` = `£Ô£´b`.`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +޶ NULL +Ž» NULL +SELECT * FROM `£Ô£´b` RIGHT JOIN `£Ô£´a` USING (`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +NULL ޶ +NULL Ž» +SELECT * FROM `£Ô£´b` RIGHT JOIN `£Ô£´a` ON (`£Ô£´a`.`£Ã£±` = `£Ô£´b`.`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +NULL ޶ +NULL Ž» +SELECT * FROM `£Ô£µa` JOIN `£Ô£µb`; +£Ã£± £Ã£± +¤¢ ¤¢ +¤« ¤¢ +¤µ ¤¢ +SELECT * FROM `£Ô£µa` INNER JOIN `£Ô£µb`; +£Ã£± £Ã£± +¤¢ ¤¢ +¤« ¤¢ +¤µ ¤¢ +SELECT * FROM `£Ô£µa` JOIN `£Ô£µb` USING (`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +SELECT * FROM `£Ô£µa` INNER JOIN `£Ô£µb` USING (`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +SELECT * FROM `£Ô£µa` CROSS JOIN `£Ô£µb`; +£Ã£± £Ã£± +¤¢ ¤¢ +¤« ¤¢ +¤µ ¤¢ +SELECT * FROM `£Ô£µa` LEFT JOIN `£Ô£µb` USING (`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +¤« NULL +¤µ NULL +SELECT * FROM `£Ô£µa` LEFT JOIN `£Ô£µb` ON (`£Ô£µa`.`£Ã£±` = `£Ô£µb`.`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +¤« NULL +¤µ NULL +SELECT * FROM `£Ô£µb` RIGHT JOIN `£Ô£µa` USING (`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +NULL ¤« +NULL ¤µ +SELECT * FROM `£Ô£µb` RIGHT JOIN `£Ô£µa` ON (`£Ô£µa`.`£Ã£±` = `£Ô£µb`.`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +NULL ¤« +NULL ¤µ +SELECT * FROM `£Ô£¶a` JOIN `£Ô£¶b`; +£Ã£± £Ã£± +íÜ íÜ +íÝ íÜ +íÞ íÜ +SELECT * FROM `£Ô£¶a` INNER JOIN `£Ô£¶b`; +£Ã£± £Ã£± +íÜ íÜ +íÝ íÜ +íÞ íÜ +SELECT * FROM `£Ô£¶a` JOIN `£Ô£¶b` USING (`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +SELECT * FROM `£Ô£¶a` INNER JOIN `£Ô£¶b` USING (`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +SELECT * FROM `£Ô£¶a` CROSS JOIN `£Ô£¶b`; +£Ã£± £Ã£± +íÜ íÜ +íÝ íÜ +íÞ íÜ +SELECT * FROM `£Ô£¶a` LEFT JOIN `£Ô£¶b` USING (`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +íÝ NULL +íÞ NULL +SELECT * FROM `£Ô£¶a` LEFT JOIN `£Ô£¶b` ON (`£Ô£¶a`.`£Ã£±` = `£Ô£¶b`.`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +íÝ NULL +íÞ NULL +SELECT * FROM `£Ô£¶b` RIGHT JOIN `£Ô£¶a` USING (`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +NULL íÝ +NULL íÞ +SELECT * FROM `£Ô£¶b` RIGHT JOIN `£Ô£¶a` ON (`£Ô£¶a`.`£Ã£±` = `£Ô£¶b`.`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +NULL íÝ +NULL íÞ +SELECT * FROM `£Ô£·a` JOIN `£Ô£·b`; +£Ã£± £Ã£± +ޱ ޱ +޶ ޱ +Ž» ޱ +SELECT * FROM `£Ô£·a` INNER JOIN `£Ô£·b`; +£Ã£± £Ã£± +ޱ ޱ +޶ ޱ +Ž» ޱ +SELECT * FROM `£Ô£·a` JOIN `£Ô£·b` USING (`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +SELECT * FROM `£Ô£·a` INNER JOIN `£Ô£·b` USING (`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +SELECT * FROM `£Ô£·a` CROSS JOIN `£Ô£·b`; +£Ã£± £Ã£± +ޱ ޱ +޶ ޱ +Ž» ޱ +SELECT * FROM `£Ô£·a` LEFT JOIN `£Ô£·b` USING (`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +޶ NULL +Ž» NULL +SELECT * FROM `£Ô£·a` LEFT JOIN `£Ô£·b` ON (`£Ô£·a`.`£Ã£±` = `£Ô£·b`.`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +޶ NULL +Ž» NULL +SELECT * FROM `£Ô£·b` RIGHT JOIN `£Ô£·a` USING (`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +NULL ޶ +NULL Ž» +SELECT * FROM `£Ô£·b` RIGHT JOIN `£Ô£·a` ON (`£Ô£·a`.`£Ã£±` = `£Ô£·b`.`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +NULL ޶ +NULL Ž» +SELECT * FROM `£Ô£¸a` JOIN `£Ô£¸b`; +£Ã£± £Ã£± +¤¢ ¤¢ +¤« ¤¢ +¤µ ¤¢ +SELECT * FROM `£Ô£¸a` INNER JOIN `£Ô£¸b`; +£Ã£± £Ã£± +¤¢ ¤¢ +¤« ¤¢ +¤µ ¤¢ +SELECT * FROM `£Ô£¸a` JOIN `£Ô£¸b` USING (`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +SELECT * FROM `£Ô£¸a` INNER JOIN `£Ô£¸b` USING (`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +SELECT * FROM `£Ô£¸a` CROSS JOIN `£Ô£¸b`; +£Ã£± £Ã£± +¤¢ ¤¢ +¤« ¤¢ +¤µ ¤¢ +SELECT * FROM `£Ô£¸a` LEFT JOIN `£Ô£¸b` USING (`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +¤« NULL +¤µ NULL +SELECT * FROM `£Ô£¸a` LEFT JOIN `£Ô£¸b` ON (`£Ô£¸a`.`£Ã£±` = `£Ô£¸b`.`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +¤« NULL +¤µ NULL +SELECT * FROM `£Ô£¸b` RIGHT JOIN `£Ô£¸a` USING (`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +NULL ¤« +NULL ¤µ +SELECT * FROM `£Ô£¸b` RIGHT JOIN `£Ô£¸a` ON (`£Ô£¸a`.`£Ã£±` = `£Ô£¸b`.`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +NULL ¤« +NULL ¤µ +SELECT * FROM `£Ô£¹a` JOIN `£Ô£¹b`; +£Ã£± £Ã£± +íÜ íÜ +íÝ íÜ +íÞ íÜ +SELECT * FROM `£Ô£¹a` INNER JOIN `£Ô£¹b`; +£Ã£± £Ã£± +íÜ íÜ +íÝ íÜ +íÞ íÜ +SELECT * FROM `£Ô£¹a` JOIN `£Ô£¹b` USING (`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +SELECT * FROM `£Ô£¹a` INNER JOIN `£Ô£¹b` USING (`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +SELECT * FROM `£Ô£¹a` CROSS JOIN `£Ô£¹b`; +£Ã£± £Ã£± +íÜ íÜ +íÝ íÜ +íÞ íÜ +SELECT * FROM `£Ô£¹a` LEFT JOIN `£Ô£¹b` USING (`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +íÝ NULL +íÞ NULL +SELECT * FROM `£Ô£¹a` LEFT JOIN `£Ô£¹b` ON (`£Ô£¹a`.`£Ã£±` = `£Ô£¹b`.`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +íÝ NULL +íÞ NULL +SELECT * FROM `£Ô£¹b` RIGHT JOIN `£Ô£¹a` USING (`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +NULL íÝ +NULL íÞ +SELECT * FROM `£Ô£¹b` RIGHT JOIN `£Ô£¹a` ON (`£Ô£¹a`.`£Ã£±` = `£Ô£¹b`.`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +NULL íÝ +NULL íÞ +SELECT * FROM `£Ô£±£°a` JOIN `£Ô£±£°b`; +£Ã£± £Ã£± +ޱ ޱ +޶ ޱ +Ž» ޱ +SELECT * FROM `£Ô£±£°a` INNER JOIN `£Ô£±£°b`; +£Ã£± £Ã£± +ޱ ޱ +޶ ޱ +Ž» ޱ +SELECT * FROM `£Ô£±£°a` JOIN `£Ô£±£°b` USING (`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +SELECT * FROM `£Ô£±£°a` INNER JOIN `£Ô£±£°b` USING (`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +SELECT * FROM `£Ô£±£°a` CROSS JOIN `£Ô£±£°b`; +£Ã£± £Ã£± +ޱ ޱ +޶ ޱ +Ž» ޱ +SELECT * FROM `£Ô£±£°a` LEFT JOIN `£Ô£±£°b` USING (`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +޶ NULL +Ž» NULL +SELECT * FROM `£Ô£±£°a` LEFT JOIN `£Ô£±£°b` ON (`£Ô£±£°a`.`£Ã£±` = `£Ô£±£°b`.`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +޶ NULL +Ž» NULL +SELECT * FROM `£Ô£±£°b` RIGHT JOIN `£Ô£±£°a` USING (`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +NULL ޶ +NULL Ž» +SELECT * FROM `£Ô£±£°b` RIGHT JOIN `£Ô£±£°a` ON (`£Ô£±£°a`.`£Ã£±` = `£Ô£±£°b`.`£Ã£±`); +£Ã£± £Ã£± +ޱ ޱ +NULL ޶ +NULL Ž» +SELECT * FROM `£Ô£±£±a` JOIN `£Ô£±£±b`; +£Ã£± £Ã£± +¤¢ ¤¢ +¤« ¤¢ +¤µ ¤¢ +SELECT * FROM `£Ô£±£±a` INNER JOIN `£Ô£±£±b`; +£Ã£± £Ã£± +¤¢ ¤¢ +¤« ¤¢ +¤µ ¤¢ +SELECT * FROM `£Ô£±£±a` JOIN `£Ô£±£±b` USING (`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +SELECT * FROM `£Ô£±£±a` INNER JOIN `£Ô£±£±b` USING (`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +SELECT * FROM `£Ô£±£±a` CROSS JOIN `£Ô£±£±b`; +£Ã£± £Ã£± +¤¢ ¤¢ +¤« ¤¢ +¤µ ¤¢ +SELECT * FROM `£Ô£±£±a` LEFT JOIN `£Ô£±£±b` USING (`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +¤« NULL +¤µ NULL +SELECT * FROM `£Ô£±£±a` LEFT JOIN `£Ô£±£±b` ON (`£Ô£±£±a`.`£Ã£±` = `£Ô£±£±b`.`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +¤« NULL +¤µ NULL +SELECT * FROM `£Ô£±£±b` RIGHT JOIN `£Ô£±£±a` USING (`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +NULL ¤« +NULL ¤µ +SELECT * FROM `£Ô£±£±b` RIGHT JOIN `£Ô£±£±a` ON (`£Ô£±£±a`.`£Ã£±` = `£Ô£±£±b`.`£Ã£±`); +£Ã£± £Ã£± +¤¢ ¤¢ +NULL ¤« +NULL ¤µ +SELECT * FROM `£Ô£±£²a` JOIN `£Ô£±£²b`; +£Ã£± £Ã£± +íÜ íÜ +íÝ íÜ +íÞ íÜ +SELECT * FROM `£Ô£±£²a` INNER JOIN `£Ô£±£²b`; +£Ã£± £Ã£± +íÜ íÜ +íÝ íÜ +íÞ íÜ +SELECT * FROM `£Ô£±£²a` JOIN `£Ô£±£²b` USING (`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +SELECT * FROM `£Ô£±£²a` INNER JOIN `£Ô£±£²b` USING (`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +SELECT * FROM `£Ô£±£²a` CROSS JOIN `£Ô£±£²b`; +£Ã£± £Ã£± +íÜ íÜ +íÝ íÜ +íÞ íÜ +SELECT * FROM `£Ô£±£²a` LEFT JOIN `£Ô£±£²b` USING (`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +íÝ NULL +íÞ NULL +SELECT * FROM `£Ô£±£²a` LEFT JOIN `£Ô£±£²b` ON (`£Ô£±£²a`.`£Ã£±` = `£Ô£±£²b`.`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +íÝ NULL +íÞ NULL +SELECT * FROM `£Ô£±£²b` RIGHT JOIN `£Ô£±£²a` USING (`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +NULL íÝ +NULL íÞ +SELECT * FROM `£Ô£±£²b` RIGHT JOIN `£Ô£±£²a` ON (`£Ô£±£²a`.`£Ã£±` = `£Ô£±£²b`.`£Ã£±`); +£Ã£± £Ã£± +íÜ íÜ +NULL íÝ +NULL íÞ +DROP TABLE `£Ô£±a`; +DROP TABLE `£Ô£±b`; +DROP TABLE `£Ô£²a`; +DROP TABLE `£Ô£²b`; +DROP TABLE `£Ô£³a`; +DROP TABLE `£Ô£³b`; +DROP TABLE `£Ô£´a`; +DROP TABLE `£Ô£´b`; +DROP TABLE `£Ô£µa`; +DROP TABLE `£Ô£µb`; +DROP TABLE `£Ô£¶a`; +DROP TABLE `£Ô£¶b`; +DROP TABLE `£Ô£·a`; +DROP TABLE `£Ô£·b`; +DROP TABLE `£Ô£¸a`; +DROP TABLE `£Ô£¸b`; +DROP TABLE `£Ô£¹a`; +DROP TABLE `£Ô£¹b`; +DROP TABLE `£Ô£±£°a`; +DROP TABLE `£Ô£±£°b`; +DROP TABLE `£Ô£±£±a`; +DROP TABLE `£Ô£±£±b`; +DROP TABLE `£Ô£±£²a`; +DROP TABLE `£Ô£±£²b`; diff --git a/mysql-test/suite/jp/r/jp_join_utf8.result b/mysql-test/suite/jp/r/jp_join_utf8.result new file mode 100755 index 00000000000..716e97a2bb3 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_join_utf8.result @@ -0,0 +1,578 @@ +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +drop table if exists `T11`; +drop table if exists `T12`; +SET NAMES utf8; +SET character_set_database = utf8; +CREATE TABLE `T1a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T1b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T5a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T5b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼–a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼–b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼—a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼—b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T8a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T8b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼™a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼™b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T1ï¼a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T1ï¼b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T11a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T11b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T12a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T12b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +INSERT INTO `T1a` VALUES ('ï½±'),('ï½¶'),('ï½»'); +INSERT INTO `T1b` VALUES ('ï½±'); +INSERT INTO `ï¼´ï¼’a` VALUES ('ã‚'),('ã‹'),('ã•'); +INSERT INTO `ï¼´ï¼’b` VALUES ('ã‚'); +INSERT INTO `T3a` VALUES ('é¾”'),('é¾–'),('é¾—'); +INSERT INTO `T3b` VALUES ('é¾”'); +INSERT INTO `ï¼´ï¼”a` VALUES ('ï½±'),('ï½¶'),('ï½»'); +INSERT INTO `ï¼´ï¼”b` VALUES ('ï½±'); +INSERT INTO `T5a` VALUES ('ã‚'),('ã‹'),('ã•'); +INSERT INTO `T5b` VALUES ('ã‚'); +INSERT INTO `ï¼´ï¼–a` VALUES ('é¾”'),('é¾–'),('é¾—'); +INSERT INTO `ï¼´ï¼–b` VALUES ('é¾”'); +INSERT INTO `ï¼´ï¼—a` VALUES ('ï½±'),('ï½¶'),('ï½»'); +INSERT INTO `ï¼´ï¼—b` VALUES ('ï½±'); +INSERT INTO `T8a` VALUES ('ã‚'),('ã‹'),('ã•'); +INSERT INTO `T8b` VALUES ('ã‚'); +INSERT INTO `ï¼´ï¼™a` VALUES ('é¾”'),('é¾–'),('é¾—'); +INSERT INTO `ï¼´ï¼™b` VALUES ('é¾”'); +INSERT INTO `T1ï¼a` VALUES ('ï½±'),('ï½¶'),('ï½»'); +INSERT INTO `T1ï¼b` VALUES ('ï½±'); +INSERT INTO `T11a` VALUES ('ã‚'),('ã‹'),('ã•'); +INSERT INTO `T11b` VALUES ('ã‚'); +INSERT INTO `T12a` VALUES ('é¾”'),('é¾–'),('é¾—'); +INSERT INTO `T12b` VALUES ('é¾”'); +SELECT * FROM `T1a` JOIN `T1b`; +C1 C1 +ï½± ï½± +ï½¶ ï½± +ï½» ï½± +SELECT * FROM `T1a` INNER JOIN `T1b`; +C1 C1 +ï½± ï½± +ï½¶ ï½± +ï½» ï½± +SELECT * FROM `T1a` JOIN `T1b` USING (`C1`); +C1 C1 +ï½± ï½± +SELECT * FROM `T1a` INNER JOIN `T1b` USING (`C1`); +C1 C1 +ï½± ï½± +SELECT * FROM `T1a` CROSS JOIN `T1b`; +C1 C1 +ï½± ï½± +ï½¶ ï½± +ï½» ï½± +SELECT * FROM `T1a` LEFT JOIN `T1b` USING (`C1`); +C1 C1 +ï½± ï½± +ï½¶ NULL +ï½» NULL +SELECT * FROM `T1a` LEFT JOIN `T1b` ON (`T1a`.`C1` = `T1b`.`C1`); +C1 C1 +ï½± ï½± +ï½¶ NULL +ï½» NULL +SELECT * FROM `T1b` RIGHT JOIN `T1a` USING (`C1`); +C1 C1 +ï½± ï½± +NULL ï½¶ +NULL ï½» +SELECT * FROM `T1b` RIGHT JOIN `T1a` ON (`T1a`.`C1` = `T1b`.`C1`); +C1 C1 +ï½± ï½± +NULL ï½¶ +NULL ï½» +SELECT * FROM `ï¼´ï¼’a` JOIN `ï¼´ï¼’b`; +C1 C1 +ã‚ ã‚ +ã‹ ã‚ +ã• ã‚ +SELECT * FROM `ï¼´ï¼’a` INNER JOIN `ï¼´ï¼’b`; +C1 C1 +ã‚ ã‚ +ã‹ ã‚ +ã• ã‚ +SELECT * FROM `ï¼´ï¼’a` JOIN `ï¼´ï¼’b` USING (`C1`); +C1 C1 +ã‚ ã‚ +SELECT * FROM `ï¼´ï¼’a` INNER JOIN `ï¼´ï¼’b` USING (`C1`); +C1 C1 +ã‚ ã‚ +SELECT * FROM `ï¼´ï¼’a` CROSS JOIN `ï¼´ï¼’b`; +C1 C1 +ã‚ ã‚ +ã‹ ã‚ +ã• ã‚ +SELECT * FROM `ï¼´ï¼’a` LEFT JOIN `ï¼´ï¼’b` USING (`C1`); +C1 C1 +ã‚ ã‚ +ã‹ NULL +ã• NULL +SELECT * FROM `ï¼´ï¼’a` LEFT JOIN `ï¼´ï¼’b` ON (`ï¼´ï¼’a`.`C1` = `ï¼´ï¼’b`.`C1`); +C1 C1 +ã‚ ã‚ +ã‹ NULL +ã• NULL +SELECT * FROM `ï¼´ï¼’b` RIGHT JOIN `ï¼´ï¼’a` USING (`C1`); +C1 C1 +ã‚ ã‚ +NULL ã‹ +NULL ã• +SELECT * FROM `ï¼´ï¼’b` RIGHT JOIN `ï¼´ï¼’a` ON (`ï¼´ï¼’a`.`C1` = `ï¼´ï¼’b`.`C1`); +C1 C1 +ã‚ ã‚ +NULL ã‹ +NULL ã• +SELECT * FROM `T3a` JOIN `T3b`; +C1 C1 +é¾” é¾” +é¾– é¾” +é¾— é¾” +SELECT * FROM `T3a` INNER JOIN `T3b`; +C1 C1 +é¾” é¾” +é¾– é¾” +é¾— é¾” +SELECT * FROM `T3a` JOIN `T3b` USING (`C1`); +C1 C1 +é¾” é¾” +SELECT * FROM `T3a` INNER JOIN `T3b` USING (`C1`); +C1 C1 +é¾” é¾” +SELECT * FROM `T3a` CROSS JOIN `T3b`; +C1 C1 +é¾” é¾” +é¾– é¾” +é¾— é¾” +SELECT * FROM `T3a` LEFT JOIN `T3b` USING (`C1`); +C1 C1 +é¾” é¾” +é¾– NULL +é¾— NULL +SELECT * FROM `T3a` LEFT JOIN `T3b` ON (`T3a`.`C1` = `T3b`.`C1`); +C1 C1 +é¾” é¾” +é¾– NULL +é¾— NULL +SELECT * FROM `T3b` RIGHT JOIN `T3a` USING (`C1`); +C1 C1 +é¾” é¾” +NULL é¾– +NULL é¾— +SELECT * FROM `T3b` RIGHT JOIN `T3a` ON (`T3a`.`C1` = `T3b`.`C1`); +C1 C1 +é¾” é¾” +NULL é¾– +NULL é¾— +SELECT * FROM `ï¼´ï¼”a` JOIN `ï¼´ï¼”b`; +C1 C1 +ï½± ï½± +ï½¶ ï½± +ï½» ï½± +SELECT * FROM `ï¼´ï¼”a` INNER JOIN `ï¼´ï¼”b`; +C1 C1 +ï½± ï½± +ï½¶ ï½± +ï½» ï½± +SELECT * FROM `ï¼´ï¼”a` JOIN `ï¼´ï¼”b` USING (`C1`); +C1 C1 +ï½± ï½± +SELECT * FROM `ï¼´ï¼”a` INNER JOIN `ï¼´ï¼”b` USING (`C1`); +C1 C1 +ï½± ï½± +SELECT * FROM `ï¼´ï¼”a` CROSS JOIN `ï¼´ï¼”b`; +C1 C1 +ï½± ï½± +ï½¶ ï½± +ï½» ï½± +SELECT * FROM `ï¼´ï¼”a` LEFT JOIN `ï¼´ï¼”b` USING (`C1`); +C1 C1 +ï½± ï½± +ï½¶ NULL +ï½» NULL +SELECT * FROM `ï¼´ï¼”a` LEFT JOIN `ï¼´ï¼”b` ON (`ï¼´ï¼”a`.`C1` = `ï¼´ï¼”b`.`C1`); +C1 C1 +ï½± ï½± +ï½¶ NULL +ï½» NULL +SELECT * FROM `ï¼´ï¼”b` RIGHT JOIN `ï¼´ï¼”a` USING (`C1`); +C1 C1 +ï½± ï½± +NULL ï½¶ +NULL ï½» +SELECT * FROM `ï¼´ï¼”b` RIGHT JOIN `ï¼´ï¼”a` ON (`ï¼´ï¼”a`.`C1` = `ï¼´ï¼”b`.`C1`); +C1 C1 +ï½± ï½± +NULL ï½¶ +NULL ï½» +SELECT * FROM `T5a` JOIN `T5b`; +C1 C1 +ã‚ ã‚ +ã‹ ã‚ +ã• ã‚ +SELECT * FROM `T5a` INNER JOIN `T5b`; +C1 C1 +ã‚ ã‚ +ã‹ ã‚ +ã• ã‚ +SELECT * FROM `T5a` JOIN `T5b` USING (`C1`); +C1 C1 +ã‚ ã‚ +SELECT * FROM `T5a` INNER JOIN `T5b` USING (`C1`); +C1 C1 +ã‚ ã‚ +SELECT * FROM `T5a` CROSS JOIN `T5b`; +C1 C1 +ã‚ ã‚ +ã‹ ã‚ +ã• ã‚ +SELECT * FROM `T5a` LEFT JOIN `T5b` USING (`C1`); +C1 C1 +ã‚ ã‚ +ã‹ NULL +ã• NULL +SELECT * FROM `T5a` LEFT JOIN `T5b` ON (`T5a`.`C1` = `T5b`.`C1`); +C1 C1 +ã‚ ã‚ +ã‹ NULL +ã• NULL +SELECT * FROM `T5b` RIGHT JOIN `T5a` USING (`C1`); +C1 C1 +ã‚ ã‚ +NULL ã‹ +NULL ã• +SELECT * FROM `T5b` RIGHT JOIN `T5a` ON (`T5a`.`C1` = `T5b`.`C1`); +C1 C1 +ã‚ ã‚ +NULL ã‹ +NULL ã• +SELECT * FROM `ï¼´ï¼–a` JOIN `ï¼´ï¼–b`; +C1 C1 +é¾” é¾” +é¾– é¾” +é¾— é¾” +SELECT * FROM `ï¼´ï¼–a` INNER JOIN `ï¼´ï¼–b`; +C1 C1 +é¾” é¾” +é¾– é¾” +é¾— é¾” +SELECT * FROM `ï¼´ï¼–a` JOIN `ï¼´ï¼–b` USING (`C1`); +C1 C1 +é¾” é¾” +SELECT * FROM `ï¼´ï¼–a` INNER JOIN `ï¼´ï¼–b` USING (`C1`); +C1 C1 +é¾” é¾” +SELECT * FROM `ï¼´ï¼–a` CROSS JOIN `ï¼´ï¼–b`; +C1 C1 +é¾” é¾” +é¾– é¾” +é¾— é¾” +SELECT * FROM `ï¼´ï¼–a` LEFT JOIN `ï¼´ï¼–b` USING (`C1`); +C1 C1 +é¾” é¾” +é¾– NULL +é¾— NULL +SELECT * FROM `ï¼´ï¼–a` LEFT JOIN `ï¼´ï¼–b` ON (`ï¼´ï¼–a`.`C1` = `ï¼´ï¼–b`.`C1`); +C1 C1 +é¾” é¾” +é¾– NULL +é¾— NULL +SELECT * FROM `ï¼´ï¼–b` RIGHT JOIN `ï¼´ï¼–a` USING (`C1`); +C1 C1 +é¾” é¾” +NULL é¾– +NULL é¾— +SELECT * FROM `ï¼´ï¼–b` RIGHT JOIN `ï¼´ï¼–a` ON (`ï¼´ï¼–a`.`C1` = `ï¼´ï¼–b`.`C1`); +C1 C1 +é¾” é¾” +NULL é¾– +NULL é¾— +SELECT * FROM `ï¼´ï¼—a` JOIN `ï¼´ï¼—b`; +C1 C1 +ï½± ï½± +ï½¶ ï½± +ï½» ï½± +SELECT * FROM `ï¼´ï¼—a` INNER JOIN `ï¼´ï¼—b`; +C1 C1 +ï½± ï½± +ï½¶ ï½± +ï½» ï½± +SELECT * FROM `ï¼´ï¼—a` JOIN `ï¼´ï¼—b` USING (`C1`); +C1 C1 +ï½± ï½± +SELECT * FROM `ï¼´ï¼—a` INNER JOIN `ï¼´ï¼—b` USING (`C1`); +C1 C1 +ï½± ï½± +SELECT * FROM `ï¼´ï¼—a` CROSS JOIN `ï¼´ï¼—b`; +C1 C1 +ï½± ï½± +ï½¶ ï½± +ï½» ï½± +SELECT * FROM `ï¼´ï¼—a` LEFT JOIN `ï¼´ï¼—b` USING (`C1`); +C1 C1 +ï½± ï½± +ï½¶ NULL +ï½» NULL +SELECT * FROM `ï¼´ï¼—a` LEFT JOIN `ï¼´ï¼—b` ON (`ï¼´ï¼—a`.`C1` = `ï¼´ï¼—b`.`C1`); +C1 C1 +ï½± ï½± +ï½¶ NULL +ï½» NULL +SELECT * FROM `ï¼´ï¼—b` RIGHT JOIN `ï¼´ï¼—a` USING (`C1`); +C1 C1 +ï½± ï½± +NULL ï½¶ +NULL ï½» +SELECT * FROM `ï¼´ï¼—b` RIGHT JOIN `ï¼´ï¼—a` ON (`ï¼´ï¼—a`.`C1` = `ï¼´ï¼—b`.`C1`); +C1 C1 +ï½± ï½± +NULL ï½¶ +NULL ï½» +SELECT * FROM `T8a` JOIN `T8b`; +C1 C1 +ã‚ ã‚ +ã‹ ã‚ +ã• ã‚ +SELECT * FROM `T8a` INNER JOIN `T8b`; +C1 C1 +ã‚ ã‚ +ã‹ ã‚ +ã• ã‚ +SELECT * FROM `T8a` JOIN `T8b` USING (`C1`); +C1 C1 +ã‚ ã‚ +SELECT * FROM `T8a` INNER JOIN `T8b` USING (`C1`); +C1 C1 +ã‚ ã‚ +SELECT * FROM `T8a` CROSS JOIN `T8b`; +C1 C1 +ã‚ ã‚ +ã‹ ã‚ +ã• ã‚ +SELECT * FROM `T8a` LEFT JOIN `T8b` USING (`C1`); +C1 C1 +ã‚ ã‚ +ã‹ NULL +ã• NULL +SELECT * FROM `T8a` LEFT JOIN `T8b` ON (`T8a`.`C1` = `T8b`.`C1`); +C1 C1 +ã‚ ã‚ +ã‹ NULL +ã• NULL +SELECT * FROM `T8b` RIGHT JOIN `T8a` USING (`C1`); +C1 C1 +ã‚ ã‚ +NULL ã‹ +NULL ã• +SELECT * FROM `T8b` RIGHT JOIN `T8a` ON (`T8a`.`C1` = `T8b`.`C1`); +C1 C1 +ã‚ ã‚ +NULL ã‹ +NULL ã• +SELECT * FROM `ï¼´ï¼™a` JOIN `ï¼´ï¼™b`; +C1 C1 +é¾” é¾” +é¾– é¾” +é¾— é¾” +SELECT * FROM `ï¼´ï¼™a` INNER JOIN `ï¼´ï¼™b`; +C1 C1 +é¾” é¾” +é¾– é¾” +é¾— é¾” +SELECT * FROM `ï¼´ï¼™a` JOIN `ï¼´ï¼™b` USING (`C1`); +C1 C1 +é¾” é¾” +SELECT * FROM `ï¼´ï¼™a` INNER JOIN `ï¼´ï¼™b` USING (`C1`); +C1 C1 +é¾” é¾” +SELECT * FROM `ï¼´ï¼™a` CROSS JOIN `ï¼´ï¼™b`; +C1 C1 +é¾” é¾” +é¾– é¾” +é¾— é¾” +SELECT * FROM `ï¼´ï¼™a` LEFT JOIN `ï¼´ï¼™b` USING (`C1`); +C1 C1 +é¾” é¾” +é¾– NULL +é¾— NULL +SELECT * FROM `ï¼´ï¼™a` LEFT JOIN `ï¼´ï¼™b` ON (`ï¼´ï¼™a`.`C1` = `ï¼´ï¼™b`.`C1`); +C1 C1 +é¾” é¾” +é¾– NULL +é¾— NULL +SELECT * FROM `ï¼´ï¼™b` RIGHT JOIN `ï¼´ï¼™a` USING (`C1`); +C1 C1 +é¾” é¾” +NULL é¾– +NULL é¾— +SELECT * FROM `ï¼´ï¼™b` RIGHT JOIN `ï¼´ï¼™a` ON (`ï¼´ï¼™a`.`C1` = `ï¼´ï¼™b`.`C1`); +C1 C1 +é¾” é¾” +NULL é¾– +NULL é¾— +SELECT * FROM `T1ï¼a` JOIN `T1ï¼b`; +C1 C1 +ï½± ï½± +ï½¶ ï½± +ï½» ï½± +SELECT * FROM `T1ï¼a` INNER JOIN `T1ï¼b`; +C1 C1 +ï½± ï½± +ï½¶ ï½± +ï½» ï½± +SELECT * FROM `T1ï¼a` JOIN `T1ï¼b` USING (`C1`); +C1 C1 +ï½± ï½± +SELECT * FROM `T1ï¼a` INNER JOIN `T1ï¼b` USING (`C1`); +C1 C1 +ï½± ï½± +SELECT * FROM `T1ï¼a` CROSS JOIN `T1ï¼b`; +C1 C1 +ï½± ï½± +ï½¶ ï½± +ï½» ï½± +SELECT * FROM `T1ï¼a` LEFT JOIN `T1ï¼b` USING (`C1`); +C1 C1 +ï½± ï½± +ï½¶ NULL +ï½» NULL +SELECT * FROM `T1ï¼a` LEFT JOIN `T1ï¼b` ON (`T1ï¼a`.`C1` = `T1ï¼b`.`C1`); +C1 C1 +ï½± ï½± +ï½¶ NULL +ï½» NULL +SELECT * FROM `T1ï¼b` RIGHT JOIN `T1ï¼a` USING (`C1`); +C1 C1 +ï½± ï½± +NULL ï½¶ +NULL ï½» +SELECT * FROM `T1ï¼b` RIGHT JOIN `T1ï¼a` ON (`T1ï¼a`.`C1` = `T1ï¼b`.`C1`); +C1 C1 +ï½± ï½± +NULL ï½¶ +NULL ï½» +SELECT * FROM `T11a` JOIN `T11b`; +C1 C1 +ã‚ ã‚ +ã‹ ã‚ +ã• ã‚ +SELECT * FROM `T11a` INNER JOIN `T11b`; +C1 C1 +ã‚ ã‚ +ã‹ ã‚ +ã• ã‚ +SELECT * FROM `T11a` JOIN `T11b` USING (`C1`); +C1 C1 +ã‚ ã‚ +SELECT * FROM `T11a` INNER JOIN `T11b` USING (`C1`); +C1 C1 +ã‚ ã‚ +SELECT * FROM `T11a` CROSS JOIN `T11b`; +C1 C1 +ã‚ ã‚ +ã‹ ã‚ +ã• ã‚ +SELECT * FROM `T11a` LEFT JOIN `T11b` USING (`C1`); +C1 C1 +ã‚ ã‚ +ã‹ NULL +ã• NULL +SELECT * FROM `T11a` LEFT JOIN `T11b` ON (`T11a`.`C1` = `T11b`.`C1`); +C1 C1 +ã‚ ã‚ +ã‹ NULL +ã• NULL +SELECT * FROM `T11b` RIGHT JOIN `T11a` USING (`C1`); +C1 C1 +ã‚ ã‚ +NULL ã‹ +NULL ã• +SELECT * FROM `T11b` RIGHT JOIN `T11a` ON (`T11a`.`C1` = `T11b`.`C1`); +C1 C1 +ã‚ ã‚ +NULL ã‹ +NULL ã• +SELECT * FROM `T12a` JOIN `T12b`; +C1 C1 +é¾” é¾” +é¾– é¾” +é¾— é¾” +SELECT * FROM `T12a` INNER JOIN `T12b`; +C1 C1 +é¾” é¾” +é¾– é¾” +é¾— é¾” +SELECT * FROM `T12a` JOIN `T12b` USING (`C1`); +C1 C1 +é¾” é¾” +SELECT * FROM `T12a` INNER JOIN `T12b` USING (`C1`); +C1 C1 +é¾” é¾” +SELECT * FROM `T12a` CROSS JOIN `T12b`; +C1 C1 +é¾” é¾” +é¾– é¾” +é¾— é¾” +SELECT * FROM `T12a` LEFT JOIN `T12b` USING (`C1`); +C1 C1 +é¾” é¾” +é¾– NULL +é¾— NULL +SELECT * FROM `T12a` LEFT JOIN `T12b` ON (`T12a`.`C1` = `T12b`.`C1`); +C1 C1 +é¾” é¾” +é¾– NULL +é¾— NULL +SELECT * FROM `T12b` RIGHT JOIN `T12a` USING (`C1`); +C1 C1 +é¾” é¾” +NULL é¾– +NULL é¾— +SELECT * FROM `T12b` RIGHT JOIN `T12a` ON (`T12a`.`C1` = `T12b`.`C1`); +C1 C1 +é¾” é¾” +NULL é¾– +NULL é¾— +DROP TABLE `T1a`; +DROP TABLE `T1b`; +DROP TABLE `ï¼´ï¼’a`; +DROP TABLE `ï¼´ï¼’b`; +DROP TABLE `T3a`; +DROP TABLE `T3b`; +DROP TABLE `ï¼´ï¼”a`; +DROP TABLE `ï¼´ï¼”b`; +DROP TABLE `T5a`; +DROP TABLE `T5b`; +DROP TABLE `ï¼´ï¼–a`; +DROP TABLE `ï¼´ï¼–b`; +DROP TABLE `ï¼´ï¼—a`; +DROP TABLE `ï¼´ï¼—b`; +DROP TABLE `T8a`; +DROP TABLE `T8b`; +DROP TABLE `ï¼´ï¼™a`; +DROP TABLE `ï¼´ï¼™b`; +DROP TABLE `T1ï¼a`; +DROP TABLE `T1ï¼b`; +DROP TABLE `T11a`; +DROP TABLE `T11b`; +DROP TABLE `T12a`; +DROP TABLE `T12b`; diff --git a/mysql-test/suite/jp/r/jp_left_sjis.result b/mysql-test/suite/jp/r/jp_left_sjis.result new file mode 100755 index 00000000000..ae5564186ab --- /dev/null +++ b/mysql-test/suite/jp/r/jp_left_sjis.result @@ -0,0 +1,626 @@ +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +drop table if exists `‚s‚P‚P`; +drop table if exists `‚s‚P‚Q`; +SET NAMES sjis; +SET character_set_database = sjis; +CREATE TABLE `‚s‚P` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Q` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚R` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚S` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚T` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚U` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚V` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚W` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚X` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚O` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚P` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚Q` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +INSERT INTO `‚s‚P` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +INSERT INTO `‚s‚S` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +INSERT INTO `‚s‚V` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +SELECT `‚b‚P`, LEFT(`‚b‚P`,0) FROM `‚s‚P`; +‚b‚P LEFT(`‚b‚P`,0) + +± +±² +±²³ +±²³´ +±²³´µ +SELECT `‚b‚P`, LEFT(`‚b‚P`,1) FROM `‚s‚P`; +‚b‚P LEFT(`‚b‚P`,1) + +± ± +±² ± +±²³ ± +±²³´ ± +±²³´µ ± +SELECT `‚b‚P`, LEFT(`‚b‚P`,2) FROM `‚s‚P`; +‚b‚P LEFT(`‚b‚P`,2) + +± ± +±² ±² +±²³ ±² +±²³´ ±² +±²³´µ ±² +SELECT `‚b‚P`, LEFT(`‚b‚P`,3) FROM `‚s‚P`; +‚b‚P LEFT(`‚b‚P`,3) + +± ± +±² ±² +±²³ ±²³ +±²³´ ±²³ +±²³´µ ±²³ +SELECT `‚b‚P`, LEFT(`‚b‚P`,4) FROM `‚s‚P`; +‚b‚P LEFT(`‚b‚P`,4) + +± ± +±² ±² +±²³ ±²³ +±²³´ ±²³´ +±²³´µ ±²³´ +SELECT `‚b‚P`, LEFT(`‚b‚P`,5) FROM `‚s‚P`; +‚b‚P LEFT(`‚b‚P`,5) + +± ± +±² ±² +±²³ ±²³ +±²³´ ±²³´ +±²³´µ ±²³´µ +SELECT `‚b‚P`, LEFT(`‚b‚P`,0) FROM `‚s‚Q`; +‚b‚P LEFT(`‚b‚P`,0) + +‚  +‚ ‚¢ +‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`, LEFT(`‚b‚P`,1) FROM `‚s‚Q`; +‚b‚P LEFT(`‚b‚P`,1) + +‚  ‚  +‚ ‚¢ ‚  +‚ ‚¢‚¤ ‚  +‚ ‚¢‚¤‚¦ ‚  +‚ ‚¢‚¤‚¦‚¨ ‚  +SELECT `‚b‚P`, LEFT(`‚b‚P`,2) FROM `‚s‚Q`; +‚b‚P LEFT(`‚b‚P`,2) + +‚  ‚  +‚ ‚¢ ‚ ‚¢ +‚ ‚¢‚¤ ‚ ‚¢ +‚ ‚¢‚¤‚¦ ‚ ‚¢ +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢ +SELECT `‚b‚P`, LEFT(`‚b‚P`,3) FROM `‚s‚Q`; +‚b‚P LEFT(`‚b‚P`,3) + +‚  ‚  +‚ ‚¢ ‚ ‚¢ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤ +SELECT `‚b‚P`, LEFT(`‚b‚P`,4) FROM `‚s‚Q`; +‚b‚P LEFT(`‚b‚P`,4) + +‚  ‚  +‚ ‚¢ ‚ ‚¢ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦ +SELECT `‚b‚P`, LEFT(`‚b‚P`,5) FROM `‚s‚Q`; +‚b‚P LEFT(`‚b‚P`,5) + +‚  ‚  +‚ ‚¢ ‚ ‚¢ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`, LEFT(`‚b‚P`,0) FROM `‚s‚R`; +‚b‚P LEFT(`‚b‚P`,0) + +ƒ\ +ƒ\\ +ƒ\\•\ +ƒ\\•\—\ +ƒ\\•\—\\ +SELECT `‚b‚P`, LEFT(`‚b‚P`,1) FROM `‚s‚R`; +‚b‚P LEFT(`‚b‚P`,1) + +ƒ\ ƒ\ +ƒ\\ ƒ\ +ƒ\\•\ ƒ\ +ƒ\\•\—\ ƒ\ +ƒ\\•\—\\ ƒ\ +SELECT `‚b‚P`, LEFT(`‚b‚P`,2) FROM `‚s‚R`; +‚b‚P LEFT(`‚b‚P`,2) + +ƒ\ ƒ\ +ƒ\\ ƒ\\ +ƒ\\•\ ƒ\\ +ƒ\\•\—\ ƒ\\ +ƒ\\•\—\\ ƒ\\ +SELECT `‚b‚P`, LEFT(`‚b‚P`,3) FROM `‚s‚R`; +‚b‚P LEFT(`‚b‚P`,3) + +ƒ\ ƒ\ +ƒ\\ ƒ\\ +ƒ\\•\ ƒ\\•\ +ƒ\\•\—\ ƒ\\•\ +ƒ\\•\—\\ ƒ\\•\ +SELECT `‚b‚P`, LEFT(`‚b‚P`,4) FROM `‚s‚R`; +‚b‚P LEFT(`‚b‚P`,4) + +ƒ\ ƒ\ +ƒ\\ ƒ\\ +ƒ\\•\ ƒ\\•\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\—\\ ƒ\\•\—\ +SELECT `‚b‚P`, LEFT(`‚b‚P`,5) FROM `‚s‚R`; +‚b‚P LEFT(`‚b‚P`,5) + +ƒ\ ƒ\ +ƒ\\ ƒ\\ +ƒ\\•\ ƒ\\•\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\—\\ ƒ\\•\—\\ +SELECT `‚b‚P`, LEFT(`‚b‚P`,0) FROM `‚s‚S`; +‚b‚P LEFT(`‚b‚P`,0) + +± +±² +±²³ +±²³´ +±²³´µ +SELECT `‚b‚P`, LEFT(`‚b‚P`,1) FROM `‚s‚S`; +‚b‚P LEFT(`‚b‚P`,1) + +± ± +±² ± +±²³ ± +±²³´ ± +±²³´µ ± +SELECT `‚b‚P`, LEFT(`‚b‚P`,2) FROM `‚s‚S`; +‚b‚P LEFT(`‚b‚P`,2) + +± ± +±² ±² +±²³ ±² +±²³´ ±² +±²³´µ ±² +SELECT `‚b‚P`, LEFT(`‚b‚P`,3) FROM `‚s‚S`; +‚b‚P LEFT(`‚b‚P`,3) + +± ± +±² ±² +±²³ ±²³ +±²³´ ±²³ +±²³´µ ±²³ +SELECT `‚b‚P`, LEFT(`‚b‚P`,4) FROM `‚s‚S`; +‚b‚P LEFT(`‚b‚P`,4) + +± ± +±² ±² +±²³ ±²³ +±²³´ ±²³´ +±²³´µ ±²³´ +SELECT `‚b‚P`, LEFT(`‚b‚P`,5) FROM `‚s‚S`; +‚b‚P LEFT(`‚b‚P`,5) + +± ± +±² ±² +±²³ ±²³ +±²³´ ±²³´ +±²³´µ ±²³´µ +SELECT `‚b‚P`, LEFT(`‚b‚P`,0) FROM `‚s‚T`; +‚b‚P LEFT(`‚b‚P`,0) + +‚  +‚ ‚¢ +‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`, LEFT(`‚b‚P`,1) FROM `‚s‚T`; +‚b‚P LEFT(`‚b‚P`,1) + +‚  ‚  +‚ ‚¢ ‚  +‚ ‚¢‚¤ ‚  +‚ ‚¢‚¤‚¦ ‚  +‚ ‚¢‚¤‚¦‚¨ ‚  +SELECT `‚b‚P`, LEFT(`‚b‚P`,2) FROM `‚s‚T`; +‚b‚P LEFT(`‚b‚P`,2) + +‚  ‚  +‚ ‚¢ ‚ ‚¢ +‚ ‚¢‚¤ ‚ ‚¢ +‚ ‚¢‚¤‚¦ ‚ ‚¢ +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢ +SELECT `‚b‚P`, LEFT(`‚b‚P`,3) FROM `‚s‚T`; +‚b‚P LEFT(`‚b‚P`,3) + +‚  ‚  +‚ ‚¢ ‚ ‚¢ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤ +SELECT `‚b‚P`, LEFT(`‚b‚P`,4) FROM `‚s‚T`; +‚b‚P LEFT(`‚b‚P`,4) + +‚  ‚  +‚ ‚¢ ‚ ‚¢ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦ +SELECT `‚b‚P`, LEFT(`‚b‚P`,5) FROM `‚s‚T`; +‚b‚P LEFT(`‚b‚P`,5) + +‚  ‚  +‚ ‚¢ ‚ ‚¢ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`, LEFT(`‚b‚P`,0) FROM `‚s‚U`; +‚b‚P LEFT(`‚b‚P`,0) + +ƒ\ +ƒ\\ +ƒ\\•\ +ƒ\\•\—\ +ƒ\\•\—\\ +SELECT `‚b‚P`, LEFT(`‚b‚P`,1) FROM `‚s‚U`; +‚b‚P LEFT(`‚b‚P`,1) + +ƒ\ ƒ\ +ƒ\\ ƒ\ +ƒ\\•\ ƒ\ +ƒ\\•\—\ ƒ\ +ƒ\\•\—\\ ƒ\ +SELECT `‚b‚P`, LEFT(`‚b‚P`,2) FROM `‚s‚U`; +‚b‚P LEFT(`‚b‚P`,2) + +ƒ\ ƒ\ +ƒ\\ ƒ\\ +ƒ\\•\ ƒ\\ +ƒ\\•\—\ ƒ\\ +ƒ\\•\—\\ ƒ\\ +SELECT `‚b‚P`, LEFT(`‚b‚P`,3) FROM `‚s‚U`; +‚b‚P LEFT(`‚b‚P`,3) + +ƒ\ ƒ\ +ƒ\\ ƒ\\ +ƒ\\•\ ƒ\\•\ +ƒ\\•\—\ ƒ\\•\ +ƒ\\•\—\\ ƒ\\•\ +SELECT `‚b‚P`, LEFT(`‚b‚P`,4) FROM `‚s‚U`; +‚b‚P LEFT(`‚b‚P`,4) + +ƒ\ ƒ\ +ƒ\\ ƒ\\ +ƒ\\•\ ƒ\\•\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\—\\ ƒ\\•\—\ +SELECT `‚b‚P`, LEFT(`‚b‚P`,5) FROM `‚s‚U`; +‚b‚P LEFT(`‚b‚P`,5) + +ƒ\ ƒ\ +ƒ\\ ƒ\\ +ƒ\\•\ ƒ\\•\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\—\\ ƒ\\•\—\\ +SELECT `‚b‚P`, LEFT(`‚b‚P`,0) FROM `‚s‚V`; +‚b‚P LEFT(`‚b‚P`,0) +±²³´µ +±²³´ +±²³ +±² +± + +SELECT `‚b‚P`, LEFT(`‚b‚P`,1) FROM `‚s‚V`; +‚b‚P LEFT(`‚b‚P`,1) +±²³´µ ± +±²³´ ± +±²³ ± +±² ± +± ± + +SELECT `‚b‚P`, LEFT(`‚b‚P`,2) FROM `‚s‚V`; +‚b‚P LEFT(`‚b‚P`,2) +±²³´µ ±² +±²³´ ±² +±²³ ±² +±² ±² +± ± + +SELECT `‚b‚P`, LEFT(`‚b‚P`,3) FROM `‚s‚V`; +‚b‚P LEFT(`‚b‚P`,3) +±²³´µ ±²³ +±²³´ ±²³ +±²³ ±²³ +±² ±² +± ± + +SELECT `‚b‚P`, LEFT(`‚b‚P`,4) FROM `‚s‚V`; +‚b‚P LEFT(`‚b‚P`,4) +±²³´µ ±²³´ +±²³´ ±²³´ +±²³ ±²³ +±² ±² +± ± + +SELECT `‚b‚P`, LEFT(`‚b‚P`,5) FROM `‚s‚V`; +‚b‚P LEFT(`‚b‚P`,5) +±²³´µ ±²³´µ +±²³´ ±²³´ +±²³ ±²³ +±² ±² +± ± + +SELECT `‚b‚P`, LEFT(`‚b‚P`,0) FROM `‚s‚W`; +‚b‚P LEFT(`‚b‚P`,0) +‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ +‚ ‚¢ +‚  + +SELECT `‚b‚P`, LEFT(`‚b‚P`,1) FROM `‚s‚W`; +‚b‚P LEFT(`‚b‚P`,1) +‚ ‚¢‚¤‚¦‚¨ ‚  +‚ ‚¢‚¤‚¦ ‚  +‚ ‚¢‚¤ ‚  +‚ ‚¢ ‚  +‚  ‚  + +SELECT `‚b‚P`, LEFT(`‚b‚P`,2) FROM `‚s‚W`; +‚b‚P LEFT(`‚b‚P`,2) +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢ +‚ ‚¢‚¤‚¦ ‚ ‚¢ +‚ ‚¢‚¤ ‚ ‚¢ +‚ ‚¢ ‚ ‚¢ +‚  ‚  + +SELECT `‚b‚P`, LEFT(`‚b‚P`,3) FROM `‚s‚W`; +‚b‚P LEFT(`‚b‚P`,3) +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢ ‚ ‚¢ +‚  ‚  + +SELECT `‚b‚P`, LEFT(`‚b‚P`,4) FROM `‚s‚W`; +‚b‚P LEFT(`‚b‚P`,4) +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢ ‚ ‚¢ +‚  ‚  + +SELECT `‚b‚P`, LEFT(`‚b‚P`,5) FROM `‚s‚W`; +‚b‚P LEFT(`‚b‚P`,5) +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢ ‚ ‚¢ +‚  ‚  + +SELECT `‚b‚P`, LEFT(`‚b‚P`,0) FROM `‚s‚X`; +‚b‚P LEFT(`‚b‚P`,0) +ƒ\\•\—\\ +ƒ\\•\—\ +ƒ\\•\ +ƒ\\ +ƒ\ + +SELECT `‚b‚P`, LEFT(`‚b‚P`,1) FROM `‚s‚X`; +‚b‚P LEFT(`‚b‚P`,1) +ƒ\\•\—\\ ƒ\ +ƒ\\•\—\ ƒ\ +ƒ\\•\ ƒ\ +ƒ\\ ƒ\ +ƒ\ ƒ\ + +SELECT `‚b‚P`, LEFT(`‚b‚P`,2) FROM `‚s‚X`; +‚b‚P LEFT(`‚b‚P`,2) +ƒ\\•\—\\ ƒ\\ +ƒ\\•\—\ ƒ\\ +ƒ\\•\ ƒ\\ +ƒ\\ ƒ\\ +ƒ\ ƒ\ + +SELECT `‚b‚P`, LEFT(`‚b‚P`,3) FROM `‚s‚X`; +‚b‚P LEFT(`‚b‚P`,3) +ƒ\\•\—\\ ƒ\\•\ +ƒ\\•\—\ ƒ\\•\ +ƒ\\•\ ƒ\\•\ +ƒ\\ ƒ\\ +ƒ\ ƒ\ + +SELECT `‚b‚P`, LEFT(`‚b‚P`,4) FROM `‚s‚X`; +‚b‚P LEFT(`‚b‚P`,4) +ƒ\\•\—\\ ƒ\\•\—\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\ ƒ\\•\ +ƒ\\ ƒ\\ +ƒ\ ƒ\ + +SELECT `‚b‚P`, LEFT(`‚b‚P`,5) FROM `‚s‚X`; +‚b‚P LEFT(`‚b‚P`,5) +ƒ\\•\—\\ ƒ\\•\—\\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\ ƒ\\•\ +ƒ\\ ƒ\\ +ƒ\ ƒ\ + +SELECT `‚b‚P`, LEFT(`‚b‚P`,0) FROM `‚s‚P‚O`; +‚b‚P LEFT(`‚b‚P`,0) +±²³´µ +±²³´ +±²³ +±² +± + +SELECT `‚b‚P`, LEFT(`‚b‚P`,1) FROM `‚s‚P‚O`; +‚b‚P LEFT(`‚b‚P`,1) +±²³´µ ± +±²³´ ± +±²³ ± +±² ± +± ± + +SELECT `‚b‚P`, LEFT(`‚b‚P`,2) FROM `‚s‚P‚O`; +‚b‚P LEFT(`‚b‚P`,2) +±²³´µ ±² +±²³´ ±² +±²³ ±² +±² ±² +± ± + +SELECT `‚b‚P`, LEFT(`‚b‚P`,3) FROM `‚s‚P‚O`; +‚b‚P LEFT(`‚b‚P`,3) +±²³´µ ±²³ +±²³´ ±²³ +±²³ ±²³ +±² ±² +± ± + +SELECT `‚b‚P`, LEFT(`‚b‚P`,4) FROM `‚s‚P‚O`; +‚b‚P LEFT(`‚b‚P`,4) +±²³´µ ±²³´ +±²³´ ±²³´ +±²³ ±²³ +±² ±² +± ± + +SELECT `‚b‚P`, LEFT(`‚b‚P`,5) FROM `‚s‚P‚O`; +‚b‚P LEFT(`‚b‚P`,5) +±²³´µ ±²³´µ +±²³´ ±²³´ +±²³ ±²³ +±² ±² +± ± + +SELECT `‚b‚P`, LEFT(`‚b‚P`,0) FROM `‚s‚P‚P`; +‚b‚P LEFT(`‚b‚P`,0) +‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ +‚ ‚¢ +‚  + +SELECT `‚b‚P`, LEFT(`‚b‚P`,1) FROM `‚s‚P‚P`; +‚b‚P LEFT(`‚b‚P`,1) +‚ ‚¢‚¤‚¦‚¨ ‚  +‚ ‚¢‚¤‚¦ ‚  +‚ ‚¢‚¤ ‚  +‚ ‚¢ ‚  +‚  ‚  + +SELECT `‚b‚P`, LEFT(`‚b‚P`,2) FROM `‚s‚P‚P`; +‚b‚P LEFT(`‚b‚P`,2) +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢ +‚ ‚¢‚¤‚¦ ‚ ‚¢ +‚ ‚¢‚¤ ‚ ‚¢ +‚ ‚¢ ‚ ‚¢ +‚  ‚  + +SELECT `‚b‚P`, LEFT(`‚b‚P`,3) FROM `‚s‚P‚P`; +‚b‚P LEFT(`‚b‚P`,3) +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢ ‚ ‚¢ +‚  ‚  + +SELECT `‚b‚P`, LEFT(`‚b‚P`,4) FROM `‚s‚P‚P`; +‚b‚P LEFT(`‚b‚P`,4) +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢ ‚ ‚¢ +‚  ‚  + +SELECT `‚b‚P`, LEFT(`‚b‚P`,5) FROM `‚s‚P‚P`; +‚b‚P LEFT(`‚b‚P`,5) +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢ ‚ ‚¢ +‚  ‚  + +SELECT `‚b‚P`, LEFT(`‚b‚P`,0) FROM `‚s‚P‚Q`; +‚b‚P LEFT(`‚b‚P`,0) +ƒ\\•\—\\ +ƒ\\•\—\ +ƒ\\•\ +ƒ\\ +ƒ\ + +SELECT `‚b‚P`, LEFT(`‚b‚P`,1) FROM `‚s‚P‚Q`; +‚b‚P LEFT(`‚b‚P`,1) +ƒ\\•\—\\ ƒ\ +ƒ\\•\—\ ƒ\ +ƒ\\•\ ƒ\ +ƒ\\ ƒ\ +ƒ\ ƒ\ + +SELECT `‚b‚P`, LEFT(`‚b‚P`,2) FROM `‚s‚P‚Q`; +‚b‚P LEFT(`‚b‚P`,2) +ƒ\\•\—\\ ƒ\\ +ƒ\\•\—\ ƒ\\ +ƒ\\•\ ƒ\\ +ƒ\\ ƒ\\ +ƒ\ ƒ\ + +SELECT `‚b‚P`, LEFT(`‚b‚P`,3) FROM `‚s‚P‚Q`; +‚b‚P LEFT(`‚b‚P`,3) +ƒ\\•\—\\ ƒ\\•\ +ƒ\\•\—\ ƒ\\•\ +ƒ\\•\ ƒ\\•\ +ƒ\\ ƒ\\ +ƒ\ ƒ\ + +SELECT `‚b‚P`, LEFT(`‚b‚P`,4) FROM `‚s‚P‚Q`; +‚b‚P LEFT(`‚b‚P`,4) +ƒ\\•\—\\ ƒ\\•\—\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\ ƒ\\•\ +ƒ\\ ƒ\\ +ƒ\ ƒ\ + +SELECT `‚b‚P`, LEFT(`‚b‚P`,5) FROM `‚s‚P‚Q`; +‚b‚P LEFT(`‚b‚P`,5) +ƒ\\•\—\\ ƒ\\•\—\\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\ ƒ\\•\ +ƒ\\ ƒ\\ +ƒ\ ƒ\ + +DROP TABLE `‚s‚P`; +DROP TABLE `‚s‚Q`; +DROP TABLE `‚s‚R`; +DROP TABLE `‚s‚S`; +DROP TABLE `‚s‚T`; +DROP TABLE `‚s‚U`; +DROP TABLE `‚s‚V`; +DROP TABLE `‚s‚W`; +DROP TABLE `‚s‚X`; +DROP TABLE `‚s‚P‚O`; +DROP TABLE `‚s‚P‚P`; +DROP TABLE `‚s‚P‚Q`; diff --git a/mysql-test/suite/jp/r/jp_left_ucs2.result b/mysql-test/suite/jp/r/jp_left_ucs2.result new file mode 100755 index 00000000000..349883e9064 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_left_ucs2.result @@ -0,0 +1,627 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; +CREATE TABLE `£Ô£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£±`; +£Ã£± LEFT(`£Ã£±`,0) + +ޱ +ޱ޲ +ޱ޲޳ +ޱ޲޳޴ +ޱ޲޳޴޵ +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£±`; +£Ã£± LEFT(`£Ã£±`,1) + +ޱ ޱ +ޱ޲ ޱ +ޱ޲޳ ޱ +ޱ޲޳޴ ޱ +ޱ޲޳޴޵ ޱ +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£±`; +£Ã£± LEFT(`£Ã£±`,2) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲ +ޱ޲޳޴ ޱ޲ +ޱ޲޳޴޵ ޱ޲ +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£±`; +£Ã£± LEFT(`£Ã£±`,3) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳ +ޱ޲޳޴޵ ޱ޲޳ +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£±`; +£Ã£± LEFT(`£Ã£±`,4) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳޴޵ ޱ޲޳޴ +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£±`; +£Ã£± LEFT(`£Ã£±`,5) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£²`; +£Ã£± LEFT(`£Ã£±`,0) + +¤¢ +¤¢¤¤ +¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£²`; +£Ã£± LEFT(`£Ã£±`,1) + +¤¢ ¤¢ +¤¢¤¤ ¤¢ +¤¢¤¤¤¦ ¤¢ +¤¢¤¤¤¦¤¨ ¤¢ +¤¢¤¤¤¦¤¨¤ª ¤¢ +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£²`; +£Ã£± LEFT(`£Ã£±`,2) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤ +¤¢¤¤¤¦¤¨ ¤¢¤¤ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤ +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£²`; +£Ã£± LEFT(`£Ã£±`,3) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦ +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£²`; +£Ã£± LEFT(`£Ã£±`,4) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨ +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£²`; +£Ã£± LEFT(`£Ã£±`,5) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£³`; +£Ã£± LEFT(`£Ã£±`,0) + +íÜ +íÜíÝ +íÜíÝíÞ +íÜíÝíÞíß +íÜíÝíÞíßíà +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£³`; +£Ã£± LEFT(`£Ã£±`,1) + +íÜ íÜ +íÜíÝ íÜ +íÜíÝíÞ íÜ +íÜíÝíÞíß íÜ +íÜíÝíÞíßíà íÜ +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£³`; +£Ã£± LEFT(`£Ã£±`,2) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝ +íÜíÝíÞíß íÜíÝ +íÜíÝíÞíßíà íÜíÝ +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£³`; +£Ã£± LEFT(`£Ã£±`,3) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞ +íÜíÝíÞíßíà íÜíÝíÞ +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£³`; +£Ã£± LEFT(`£Ã£±`,4) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞíßíà íÜíÝíÞíß +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£³`; +£Ã£± LEFT(`£Ã£±`,5) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£´`; +£Ã£± LEFT(`£Ã£±`,0) + +ޱ +ޱ޲ +ޱ޲޳ +ޱ޲޳޴ +ޱ޲޳޴޵ +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£´`; +£Ã£± LEFT(`£Ã£±`,1) + +ޱ ޱ +ޱ޲ ޱ +ޱ޲޳ ޱ +ޱ޲޳޴ ޱ +ޱ޲޳޴޵ ޱ +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£´`; +£Ã£± LEFT(`£Ã£±`,2) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲ +ޱ޲޳޴ ޱ޲ +ޱ޲޳޴޵ ޱ޲ +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£´`; +£Ã£± LEFT(`£Ã£±`,3) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳ +ޱ޲޳޴޵ ޱ޲޳ +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£´`; +£Ã£± LEFT(`£Ã£±`,4) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳޴޵ ޱ޲޳޴ +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£´`; +£Ã£± LEFT(`£Ã£±`,5) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£µ`; +£Ã£± LEFT(`£Ã£±`,0) + +¤¢ +¤¢¤¤ +¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£µ`; +£Ã£± LEFT(`£Ã£±`,1) + +¤¢ ¤¢ +¤¢¤¤ ¤¢ +¤¢¤¤¤¦ ¤¢ +¤¢¤¤¤¦¤¨ ¤¢ +¤¢¤¤¤¦¤¨¤ª ¤¢ +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£µ`; +£Ã£± LEFT(`£Ã£±`,2) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤ +¤¢¤¤¤¦¤¨ ¤¢¤¤ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤ +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£µ`; +£Ã£± LEFT(`£Ã£±`,3) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦ +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£µ`; +£Ã£± LEFT(`£Ã£±`,4) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨ +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£µ`; +£Ã£± LEFT(`£Ã£±`,5) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£¶`; +£Ã£± LEFT(`£Ã£±`,0) + +íÜ +íÜíÝ +íÜíÝíÞ +íÜíÝíÞíß +íÜíÝíÞíßíà +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£¶`; +£Ã£± LEFT(`£Ã£±`,1) + +íÜ íÜ +íÜíÝ íÜ +íÜíÝíÞ íÜ +íÜíÝíÞíß íÜ +íÜíÝíÞíßíà íÜ +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£¶`; +£Ã£± LEFT(`£Ã£±`,2) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝ +íÜíÝíÞíß íÜíÝ +íÜíÝíÞíßíà íÜíÝ +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£¶`; +£Ã£± LEFT(`£Ã£±`,3) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞ +íÜíÝíÞíßíà íÜíÝíÞ +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£¶`; +£Ã£± LEFT(`£Ã£±`,4) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞíßíà íÜíÝíÞíß +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£¶`; +£Ã£± LEFT(`£Ã£±`,5) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£·`; +£Ã£± LEFT(`£Ã£±`,0) +ޱ޲޳޴޵ +ޱ޲޳޴ +ޱ޲޳ +ޱ޲ +ޱ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£·`; +£Ã£± LEFT(`£Ã£±`,1) +ޱ޲޳޴޵ ޱ +ޱ޲޳޴ ޱ +ޱ޲޳ ޱ +ޱ޲ ޱ +ޱ ޱ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£·`; +£Ã£± LEFT(`£Ã£±`,2) +ޱ޲޳޴޵ ޱ޲ +ޱ޲޳޴ ޱ޲ +ޱ޲޳ ޱ޲ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£·`; +£Ã£± LEFT(`£Ã£±`,3) +ޱ޲޳޴޵ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£·`; +£Ã£± LEFT(`£Ã£±`,4) +ޱ޲޳޴޵ ޱ޲޳޴ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£·`; +£Ã£± LEFT(`£Ã£±`,5) +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£¸`; +£Ã£± LEFT(`£Ã£±`,0) +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ +¤¢¤¤ +¤¢ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£¸`; +£Ã£± LEFT(`£Ã£±`,1) +¤¢¤¤¤¦¤¨¤ª ¤¢ +¤¢¤¤¤¦¤¨ ¤¢ +¤¢¤¤¤¦ ¤¢ +¤¢¤¤ ¤¢ +¤¢ ¤¢ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£¸`; +£Ã£± LEFT(`£Ã£±`,2) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤ +¤¢¤¤¤¦¤¨ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£¸`; +£Ã£± LEFT(`£Ã£±`,3) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£¸`; +£Ã£± LEFT(`£Ã£±`,4) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£¸`; +£Ã£± LEFT(`£Ã£±`,5) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£¹`; +£Ã£± LEFT(`£Ã£±`,0) +íÜíÝíÞíßíà +íÜíÝíÞíß +íÜíÝíÞ +íÜíÝ +íÜ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£¹`; +£Ã£± LEFT(`£Ã£±`,1) +íÜíÝíÞíßíà íÜ +íÜíÝíÞíß íÜ +íÜíÝíÞ íÜ +íÜíÝ íÜ +íÜ íÜ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£¹`; +£Ã£± LEFT(`£Ã£±`,2) +íÜíÝíÞíßíà íÜíÝ +íÜíÝíÞíß íÜíÝ +íÜíÝíÞ íÜíÝ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£¹`; +£Ã£± LEFT(`£Ã£±`,3) +íÜíÝíÞíßíà íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞ +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£¹`; +£Ã£± LEFT(`£Ã£±`,4) +íÜíÝíÞíßíà íÜíÝíÞíß +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£¹`; +£Ã£± LEFT(`£Ã£±`,5) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£±£°`; +£Ã£± LEFT(`£Ã£±`,0) +ޱ޲޳޴޵ +ޱ޲޳޴ +ޱ޲޳ +ޱ޲ +ޱ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£±£°`; +£Ã£± LEFT(`£Ã£±`,1) +ޱ޲޳޴޵ ޱ +ޱ޲޳޴ ޱ +ޱ޲޳ ޱ +ޱ޲ ޱ +ޱ ޱ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£±£°`; +£Ã£± LEFT(`£Ã£±`,2) +ޱ޲޳޴޵ ޱ޲ +ޱ޲޳޴ ޱ޲ +ޱ޲޳ ޱ޲ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£±£°`; +£Ã£± LEFT(`£Ã£±`,3) +ޱ޲޳޴޵ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£±£°`; +£Ã£± LEFT(`£Ã£±`,4) +ޱ޲޳޴޵ ޱ޲޳޴ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£±£°`; +£Ã£± LEFT(`£Ã£±`,5) +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£±£±`; +£Ã£± LEFT(`£Ã£±`,0) +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ +¤¢¤¤ +¤¢ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£±£±`; +£Ã£± LEFT(`£Ã£±`,1) +¤¢¤¤¤¦¤¨¤ª ¤¢ +¤¢¤¤¤¦¤¨ ¤¢ +¤¢¤¤¤¦ ¤¢ +¤¢¤¤ ¤¢ +¤¢ ¤¢ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£±£±`; +£Ã£± LEFT(`£Ã£±`,2) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤ +¤¢¤¤¤¦¤¨ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£±£±`; +£Ã£± LEFT(`£Ã£±`,3) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£±£±`; +£Ã£± LEFT(`£Ã£±`,4) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£±£±`; +£Ã£± LEFT(`£Ã£±`,5) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£±£²`; +£Ã£± LEFT(`£Ã£±`,0) +íÜíÝíÞíßíà +íÜíÝíÞíß +íÜíÝíÞ +íÜíÝ +íÜ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£±£²`; +£Ã£± LEFT(`£Ã£±`,1) +íÜíÝíÞíßíà íÜ +íÜíÝíÞíß íÜ +íÜíÝíÞ íÜ +íÜíÝ íÜ +íÜ íÜ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£±£²`; +£Ã£± LEFT(`£Ã£±`,2) +íÜíÝíÞíßíà íÜíÝ +íÜíÝíÞíß íÜíÝ +íÜíÝíÞ íÜíÝ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£±£²`; +£Ã£± LEFT(`£Ã£±`,3) +íÜíÝíÞíßíà íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞ +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£±£²`; +£Ã£± LEFT(`£Ã£±`,4) +íÜíÝíÞíßíà íÜíÝíÞíß +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£±£²`; +£Ã£± LEFT(`£Ã£±`,5) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/r/jp_left_ujis.result b/mysql-test/suite/jp/r/jp_left_ujis.result new file mode 100755 index 00000000000..bd3efc67eec --- /dev/null +++ b/mysql-test/suite/jp/r/jp_left_ujis.result @@ -0,0 +1,626 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +SET NAMES ujis; +SET character_set_database = ujis; +CREATE TABLE `£Ô£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£±`; +£Ã£± LEFT(`£Ã£±`,0) + +ޱ +ޱ޲ +ޱ޲޳ +ޱ޲޳޴ +ޱ޲޳޴޵ +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£±`; +£Ã£± LEFT(`£Ã£±`,1) + +ޱ ޱ +ޱ޲ ޱ +ޱ޲޳ ޱ +ޱ޲޳޴ ޱ +ޱ޲޳޴޵ ޱ +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£±`; +£Ã£± LEFT(`£Ã£±`,2) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲ +ޱ޲޳޴ ޱ޲ +ޱ޲޳޴޵ ޱ޲ +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£±`; +£Ã£± LEFT(`£Ã£±`,3) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳ +ޱ޲޳޴޵ ޱ޲޳ +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£±`; +£Ã£± LEFT(`£Ã£±`,4) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳޴޵ ޱ޲޳޴ +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£±`; +£Ã£± LEFT(`£Ã£±`,5) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£²`; +£Ã£± LEFT(`£Ã£±`,0) + +¤¢ +¤¢¤¤ +¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£²`; +£Ã£± LEFT(`£Ã£±`,1) + +¤¢ ¤¢ +¤¢¤¤ ¤¢ +¤¢¤¤¤¦ ¤¢ +¤¢¤¤¤¦¤¨ ¤¢ +¤¢¤¤¤¦¤¨¤ª ¤¢ +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£²`; +£Ã£± LEFT(`£Ã£±`,2) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤ +¤¢¤¤¤¦¤¨ ¤¢¤¤ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤ +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£²`; +£Ã£± LEFT(`£Ã£±`,3) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦ +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£²`; +£Ã£± LEFT(`£Ã£±`,4) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨ +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£²`; +£Ã£± LEFT(`£Ã£±`,5) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£³`; +£Ã£± LEFT(`£Ã£±`,0) + +íÜ +íÜíÝ +íÜíÝíÞ +íÜíÝíÞíß +íÜíÝíÞíßíà +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£³`; +£Ã£± LEFT(`£Ã£±`,1) + +íÜ íÜ +íÜíÝ íÜ +íÜíÝíÞ íÜ +íÜíÝíÞíß íÜ +íÜíÝíÞíßíà íÜ +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£³`; +£Ã£± LEFT(`£Ã£±`,2) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝ +íÜíÝíÞíß íÜíÝ +íÜíÝíÞíßíà íÜíÝ +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£³`; +£Ã£± LEFT(`£Ã£±`,3) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞ +íÜíÝíÞíßíà íÜíÝíÞ +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£³`; +£Ã£± LEFT(`£Ã£±`,4) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞíßíà íÜíÝíÞíß +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£³`; +£Ã£± LEFT(`£Ã£±`,5) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£´`; +£Ã£± LEFT(`£Ã£±`,0) + +ޱ +ޱ޲ +ޱ޲޳ +ޱ޲޳޴ +ޱ޲޳޴޵ +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£´`; +£Ã£± LEFT(`£Ã£±`,1) + +ޱ ޱ +ޱ޲ ޱ +ޱ޲޳ ޱ +ޱ޲޳޴ ޱ +ޱ޲޳޴޵ ޱ +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£´`; +£Ã£± LEFT(`£Ã£±`,2) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲ +ޱ޲޳޴ ޱ޲ +ޱ޲޳޴޵ ޱ޲ +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£´`; +£Ã£± LEFT(`£Ã£±`,3) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳ +ޱ޲޳޴޵ ޱ޲޳ +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£´`; +£Ã£± LEFT(`£Ã£±`,4) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳޴޵ ޱ޲޳޴ +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£´`; +£Ã£± LEFT(`£Ã£±`,5) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£µ`; +£Ã£± LEFT(`£Ã£±`,0) + +¤¢ +¤¢¤¤ +¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£µ`; +£Ã£± LEFT(`£Ã£±`,1) + +¤¢ ¤¢ +¤¢¤¤ ¤¢ +¤¢¤¤¤¦ ¤¢ +¤¢¤¤¤¦¤¨ ¤¢ +¤¢¤¤¤¦¤¨¤ª ¤¢ +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£µ`; +£Ã£± LEFT(`£Ã£±`,2) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤ +¤¢¤¤¤¦¤¨ ¤¢¤¤ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤ +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£µ`; +£Ã£± LEFT(`£Ã£±`,3) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦ +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£µ`; +£Ã£± LEFT(`£Ã£±`,4) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨ +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£µ`; +£Ã£± LEFT(`£Ã£±`,5) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£¶`; +£Ã£± LEFT(`£Ã£±`,0) + +íÜ +íÜíÝ +íÜíÝíÞ +íÜíÝíÞíß +íÜíÝíÞíßíà +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£¶`; +£Ã£± LEFT(`£Ã£±`,1) + +íÜ íÜ +íÜíÝ íÜ +íÜíÝíÞ íÜ +íÜíÝíÞíß íÜ +íÜíÝíÞíßíà íÜ +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£¶`; +£Ã£± LEFT(`£Ã£±`,2) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝ +íÜíÝíÞíß íÜíÝ +íÜíÝíÞíßíà íÜíÝ +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£¶`; +£Ã£± LEFT(`£Ã£±`,3) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞ +íÜíÝíÞíßíà íÜíÝíÞ +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£¶`; +£Ã£± LEFT(`£Ã£±`,4) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞíßíà íÜíÝíÞíß +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£¶`; +£Ã£± LEFT(`£Ã£±`,5) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£·`; +£Ã£± LEFT(`£Ã£±`,0) +ޱ޲޳޴޵ +ޱ޲޳޴ +ޱ޲޳ +ޱ޲ +ޱ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£·`; +£Ã£± LEFT(`£Ã£±`,1) +ޱ޲޳޴޵ ޱ +ޱ޲޳޴ ޱ +ޱ޲޳ ޱ +ޱ޲ ޱ +ޱ ޱ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£·`; +£Ã£± LEFT(`£Ã£±`,2) +ޱ޲޳޴޵ ޱ޲ +ޱ޲޳޴ ޱ޲ +ޱ޲޳ ޱ޲ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£·`; +£Ã£± LEFT(`£Ã£±`,3) +ޱ޲޳޴޵ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£·`; +£Ã£± LEFT(`£Ã£±`,4) +ޱ޲޳޴޵ ޱ޲޳޴ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£·`; +£Ã£± LEFT(`£Ã£±`,5) +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£¸`; +£Ã£± LEFT(`£Ã£±`,0) +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ +¤¢¤¤ +¤¢ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£¸`; +£Ã£± LEFT(`£Ã£±`,1) +¤¢¤¤¤¦¤¨¤ª ¤¢ +¤¢¤¤¤¦¤¨ ¤¢ +¤¢¤¤¤¦ ¤¢ +¤¢¤¤ ¤¢ +¤¢ ¤¢ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£¸`; +£Ã£± LEFT(`£Ã£±`,2) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤ +¤¢¤¤¤¦¤¨ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£¸`; +£Ã£± LEFT(`£Ã£±`,3) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£¸`; +£Ã£± LEFT(`£Ã£±`,4) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£¸`; +£Ã£± LEFT(`£Ã£±`,5) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£¹`; +£Ã£± LEFT(`£Ã£±`,0) +íÜíÝíÞíßíà +íÜíÝíÞíß +íÜíÝíÞ +íÜíÝ +íÜ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£¹`; +£Ã£± LEFT(`£Ã£±`,1) +íÜíÝíÞíßíà íÜ +íÜíÝíÞíß íÜ +íÜíÝíÞ íÜ +íÜíÝ íÜ +íÜ íÜ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£¹`; +£Ã£± LEFT(`£Ã£±`,2) +íÜíÝíÞíßíà íÜíÝ +íÜíÝíÞíß íÜíÝ +íÜíÝíÞ íÜíÝ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£¹`; +£Ã£± LEFT(`£Ã£±`,3) +íÜíÝíÞíßíà íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞ +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£¹`; +£Ã£± LEFT(`£Ã£±`,4) +íÜíÝíÞíßíà íÜíÝíÞíß +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£¹`; +£Ã£± LEFT(`£Ã£±`,5) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£±£°`; +£Ã£± LEFT(`£Ã£±`,0) +ޱ޲޳޴޵ +ޱ޲޳޴ +ޱ޲޳ +ޱ޲ +ޱ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£±£°`; +£Ã£± LEFT(`£Ã£±`,1) +ޱ޲޳޴޵ ޱ +ޱ޲޳޴ ޱ +ޱ޲޳ ޱ +ޱ޲ ޱ +ޱ ޱ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£±£°`; +£Ã£± LEFT(`£Ã£±`,2) +ޱ޲޳޴޵ ޱ޲ +ޱ޲޳޴ ޱ޲ +ޱ޲޳ ޱ޲ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£±£°`; +£Ã£± LEFT(`£Ã£±`,3) +ޱ޲޳޴޵ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£±£°`; +£Ã£± LEFT(`£Ã£±`,4) +ޱ޲޳޴޵ ޱ޲޳޴ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£±£°`; +£Ã£± LEFT(`£Ã£±`,5) +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£±£±`; +£Ã£± LEFT(`£Ã£±`,0) +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ +¤¢¤¤ +¤¢ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£±£±`; +£Ã£± LEFT(`£Ã£±`,1) +¤¢¤¤¤¦¤¨¤ª ¤¢ +¤¢¤¤¤¦¤¨ ¤¢ +¤¢¤¤¤¦ ¤¢ +¤¢¤¤ ¤¢ +¤¢ ¤¢ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£±£±`; +£Ã£± LEFT(`£Ã£±`,2) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤ +¤¢¤¤¤¦¤¨ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£±£±`; +£Ã£± LEFT(`£Ã£±`,3) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£±£±`; +£Ã£± LEFT(`£Ã£±`,4) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£±£±`; +£Ã£± LEFT(`£Ã£±`,5) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£±£²`; +£Ã£± LEFT(`£Ã£±`,0) +íÜíÝíÞíßíà +íÜíÝíÞíß +íÜíÝíÞ +íÜíÝ +íÜ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£±£²`; +£Ã£± LEFT(`£Ã£±`,1) +íÜíÝíÞíßíà íÜ +íÜíÝíÞíß íÜ +íÜíÝíÞ íÜ +íÜíÝ íÜ +íÜ íÜ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£±£²`; +£Ã£± LEFT(`£Ã£±`,2) +íÜíÝíÞíßíà íÜíÝ +íÜíÝíÞíß íÜíÝ +íÜíÝíÞ íÜíÝ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£±£²`; +£Ã£± LEFT(`£Ã£±`,3) +íÜíÝíÞíßíà íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞ +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£±£²`; +£Ã£± LEFT(`£Ã£±`,4) +íÜíÝíÞíßíà íÜíÝíÞíß +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£±£²`; +£Ã£± LEFT(`£Ã£±`,5) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/r/jp_left_utf8.result b/mysql-test/suite/jp/r/jp_left_utf8.result new file mode 100755 index 00000000000..62cca976fe0 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_left_utf8.result @@ -0,0 +1,626 @@ +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +drop table if exists `T11`; +drop table if exists `T12`; +SET NAMES utf8; +SET character_set_database = utf8; +CREATE TABLE `T1` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T11` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T12` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +INSERT INTO `T1` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `T3` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +INSERT INTO `T1ï¼` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `T12` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +SELECT `C1`, LEFT(`C1`,0) FROM `T1`; +C1 LEFT(`C1`,0) + +ï½± +アイ +アイウ +アイウエ +アイウエオ +SELECT `C1`, LEFT(`C1`,1) FROM `T1`; +C1 LEFT(`C1`,1) + +ï½± ï½± +アイ ï½± +アイウ ï½± +アイウエ ï½± +アイウエオ ï½± +SELECT `C1`, LEFT(`C1`,2) FROM `T1`; +C1 LEFT(`C1`,2) + +ï½± ï½± +アイ アイ +アイウ アイ +アイウエ アイ +アイウエオ アイ +SELECT `C1`, LEFT(`C1`,3) FROM `T1`; +C1 LEFT(`C1`,3) + +ï½± ï½± +アイ アイ +アイウ アイウ +アイウエ アイウ +アイウエオ アイウ +SELECT `C1`, LEFT(`C1`,4) FROM `T1`; +C1 LEFT(`C1`,4) + +ï½± ï½± +アイ アイ +アイウ アイウ +アイウエ アイウエ +アイウエオ アイウエ +SELECT `C1`, LEFT(`C1`,5) FROM `T1`; +C1 LEFT(`C1`,5) + +ï½± ï½± +アイ アイ +アイウ アイウ +アイウエ アイウエ +アイウエオ アイウエオ +SELECT `C1`, LEFT(`C1`,0) FROM `ï¼´ï¼’`; +C1 LEFT(`C1`,0) + +ã‚ +ã‚ã„ +ã‚ã„ㆠ+ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ +SELECT `C1`, LEFT(`C1`,1) FROM `ï¼´ï¼’`; +C1 LEFT(`C1`,1) + +ã‚ ã‚ +ã‚ã„ ã‚ +ã‚ã„ㆠ゠+ã‚ã„ã†ãˆ ã‚ +ã‚ã„ã†ãˆãŠ ã‚ +SELECT `C1`, LEFT(`C1`,2) FROM `ï¼´ï¼’`; +C1 LEFT(`C1`,2) + +ã‚ ã‚ +ã‚ã„ ã‚ã„ +ã‚ã„ㆠã‚ã„ +ã‚ã„ã†ãˆ ã‚ã„ +ã‚ã„ã†ãˆãŠ ã‚ã„ +SELECT `C1`, LEFT(`C1`,3) FROM `ï¼´ï¼’`; +C1 LEFT(`C1`,3) + +ã‚ ã‚ +ã‚ã„ ã‚ã„ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ã†ãˆ ã‚ã„ㆠ+ã‚ã„ã†ãˆãŠ ã‚ã„ㆠ+SELECT `C1`, LEFT(`C1`,4) FROM `ï¼´ï¼’`; +C1 LEFT(`C1`,4) + +ã‚ ã‚ +ã‚ã„ ã‚ã„ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆ +SELECT `C1`, LEFT(`C1`,5) FROM `ï¼´ï¼’`; +C1 LEFT(`C1`,5) + +ã‚ ã‚ +ã‚ã„ ã‚ã„ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +SELECT `C1`, LEFT(`C1`,0) FROM `T3`; +C1 LEFT(`C1`,0) + +é¾” +龔龖 +龔龖龗 +龔龖龗龞 +龔龖龗龞龡 +SELECT `C1`, LEFT(`C1`,1) FROM `T3`; +C1 LEFT(`C1`,1) + +é¾” é¾” +龔龖 é¾” +龔龖龗 é¾” +龔龖龗龞 é¾” +龔龖龗龞龡 é¾” +SELECT `C1`, LEFT(`C1`,2) FROM `T3`; +C1 LEFT(`C1`,2) + +é¾” é¾” +龔龖 龔龖 +龔龖龗 龔龖 +龔龖龗龞 龔龖 +龔龖龗龞龡 龔龖 +SELECT `C1`, LEFT(`C1`,3) FROM `T3`; +C1 LEFT(`C1`,3) + +é¾” é¾” +龔龖 龔龖 +龔龖龗 龔龖龗 +龔龖龗龞 龔龖龗 +龔龖龗龞龡 龔龖龗 +SELECT `C1`, LEFT(`C1`,4) FROM `T3`; +C1 LEFT(`C1`,4) + +é¾” é¾” +龔龖 龔龖 +龔龖龗 龔龖龗 +龔龖龗龞 龔龖龗龞 +龔龖龗龞龡 龔龖龗龞 +SELECT `C1`, LEFT(`C1`,5) FROM `T3`; +C1 LEFT(`C1`,5) + +é¾” é¾” +龔龖 龔龖 +龔龖龗 龔龖龗 +龔龖龗龞 龔龖龗龞 +龔龖龗龞龡 龔龖龗龞龡 +SELECT `C1`, LEFT(`C1`,0) FROM `ï¼´ï¼”`; +C1 LEFT(`C1`,0) + +ï½± +アイ +アイウ +アイウエ +アイウエオ +SELECT `C1`, LEFT(`C1`,1) FROM `ï¼´ï¼”`; +C1 LEFT(`C1`,1) + +ï½± ï½± +アイ ï½± +アイウ ï½± +アイウエ ï½± +アイウエオ ï½± +SELECT `C1`, LEFT(`C1`,2) FROM `ï¼´ï¼”`; +C1 LEFT(`C1`,2) + +ï½± ï½± +アイ アイ +アイウ アイ +アイウエ アイ +アイウエオ アイ +SELECT `C1`, LEFT(`C1`,3) FROM `ï¼´ï¼”`; +C1 LEFT(`C1`,3) + +ï½± ï½± +アイ アイ +アイウ アイウ +アイウエ アイウ +アイウエオ アイウ +SELECT `C1`, LEFT(`C1`,4) FROM `ï¼´ï¼”`; +C1 LEFT(`C1`,4) + +ï½± ï½± +アイ アイ +アイウ アイウ +アイウエ アイウエ +アイウエオ アイウエ +SELECT `C1`, LEFT(`C1`,5) FROM `ï¼´ï¼”`; +C1 LEFT(`C1`,5) + +ï½± ï½± +アイ アイ +アイウ アイウ +アイウエ アイウエ +アイウエオ アイウエオ +SELECT `C1`, LEFT(`C1`,0) FROM `T5`; +C1 LEFT(`C1`,0) + +ã‚ +ã‚ã„ +ã‚ã„ㆠ+ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ +SELECT `C1`, LEFT(`C1`,1) FROM `T5`; +C1 LEFT(`C1`,1) + +ã‚ ã‚ +ã‚ã„ ã‚ +ã‚ã„ㆠ゠+ã‚ã„ã†ãˆ ã‚ +ã‚ã„ã†ãˆãŠ ã‚ +SELECT `C1`, LEFT(`C1`,2) FROM `T5`; +C1 LEFT(`C1`,2) + +ã‚ ã‚ +ã‚ã„ ã‚ã„ +ã‚ã„ㆠã‚ã„ +ã‚ã„ã†ãˆ ã‚ã„ +ã‚ã„ã†ãˆãŠ ã‚ã„ +SELECT `C1`, LEFT(`C1`,3) FROM `T5`; +C1 LEFT(`C1`,3) + +ã‚ ã‚ +ã‚ã„ ã‚ã„ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ã†ãˆ ã‚ã„ㆠ+ã‚ã„ã†ãˆãŠ ã‚ã„ㆠ+SELECT `C1`, LEFT(`C1`,4) FROM `T5`; +C1 LEFT(`C1`,4) + +ã‚ ã‚ +ã‚ã„ ã‚ã„ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆ +SELECT `C1`, LEFT(`C1`,5) FROM `T5`; +C1 LEFT(`C1`,5) + +ã‚ ã‚ +ã‚ã„ ã‚ã„ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +SELECT `C1`, LEFT(`C1`,0) FROM `ï¼´ï¼–`; +C1 LEFT(`C1`,0) + +é¾” +龔龖 +龔龖龗 +龔龖龗龞 +龔龖龗龞龡 +SELECT `C1`, LEFT(`C1`,1) FROM `ï¼´ï¼–`; +C1 LEFT(`C1`,1) + +é¾” é¾” +龔龖 é¾” +龔龖龗 é¾” +龔龖龗龞 é¾” +龔龖龗龞龡 é¾” +SELECT `C1`, LEFT(`C1`,2) FROM `ï¼´ï¼–`; +C1 LEFT(`C1`,2) + +é¾” é¾” +龔龖 龔龖 +龔龖龗 龔龖 +龔龖龗龞 龔龖 +龔龖龗龞龡 龔龖 +SELECT `C1`, LEFT(`C1`,3) FROM `ï¼´ï¼–`; +C1 LEFT(`C1`,3) + +é¾” é¾” +龔龖 龔龖 +龔龖龗 龔龖龗 +龔龖龗龞 龔龖龗 +龔龖龗龞龡 龔龖龗 +SELECT `C1`, LEFT(`C1`,4) FROM `ï¼´ï¼–`; +C1 LEFT(`C1`,4) + +é¾” é¾” +龔龖 龔龖 +龔龖龗 龔龖龗 +龔龖龗龞 龔龖龗龞 +龔龖龗龞龡 龔龖龗龞 +SELECT `C1`, LEFT(`C1`,5) FROM `ï¼´ï¼–`; +C1 LEFT(`C1`,5) + +é¾” é¾” +龔龖 龔龖 +龔龖龗 龔龖龗 +龔龖龗龞 龔龖龗龞 +龔龖龗龞龡 龔龖龗龞龡 +SELECT `C1`, LEFT(`C1`,0) FROM `ï¼´ï¼—`; +C1 LEFT(`C1`,0) +アイウエオ +アイウエ +アイウ +アイ +ï½± + +SELECT `C1`, LEFT(`C1`,1) FROM `ï¼´ï¼—`; +C1 LEFT(`C1`,1) +アイウエオ ï½± +アイウエ ï½± +アイウ ï½± +アイ ï½± +ï½± ï½± + +SELECT `C1`, LEFT(`C1`,2) FROM `ï¼´ï¼—`; +C1 LEFT(`C1`,2) +アイウエオ アイ +アイウエ アイ +アイウ アイ +アイ アイ +ï½± ï½± + +SELECT `C1`, LEFT(`C1`,3) FROM `ï¼´ï¼—`; +C1 LEFT(`C1`,3) +アイウエオ アイウ +アイウエ アイウ +アイウ アイウ +アイ アイ +ï½± ï½± + +SELECT `C1`, LEFT(`C1`,4) FROM `ï¼´ï¼—`; +C1 LEFT(`C1`,4) +アイウエオ アイウエ +アイウエ アイウエ +アイウ アイウ +アイ アイ +ï½± ï½± + +SELECT `C1`, LEFT(`C1`,5) FROM `ï¼´ï¼—`; +C1 LEFT(`C1`,5) +アイウエオ アイウエオ +アイウエ アイウエ +アイウ アイウ +アイ アイ +ï½± ï½± + +SELECT `C1`, LEFT(`C1`,0) FROM `T8`; +C1 LEFT(`C1`,0) +ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆ +ã‚ã„ㆠ+ã‚ã„ +ã‚ + +SELECT `C1`, LEFT(`C1`,1) FROM `T8`; +C1 LEFT(`C1`,1) +ã‚ã„ã†ãˆãŠ ã‚ +ã‚ã„ã†ãˆ ã‚ +ã‚ã„ㆠ゠+ã‚ã„ ã‚ +ã‚ ã‚ + +SELECT `C1`, LEFT(`C1`,2) FROM `T8`; +C1 LEFT(`C1`,2) +ã‚ã„ã†ãˆãŠ ã‚ã„ +ã‚ã„ã†ãˆ ã‚ã„ +ã‚ã„ㆠã‚ã„ +ã‚ã„ ã‚ã„ +ã‚ ã‚ + +SELECT `C1`, LEFT(`C1`,3) FROM `T8`; +C1 LEFT(`C1`,3) +ã‚ã„ã†ãˆãŠ ã‚ã„ㆠ+ã‚ã„ã†ãˆ ã‚ã„ㆠ+ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ ã‚ã„ +ã‚ ã‚ + +SELECT `C1`, LEFT(`C1`,4) FROM `T8`; +C1 LEFT(`C1`,4) +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ ã‚ã„ +ã‚ ã‚ + +SELECT `C1`, LEFT(`C1`,5) FROM `T8`; +C1 LEFT(`C1`,5) +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ ã‚ã„ +ã‚ ã‚ + +SELECT `C1`, LEFT(`C1`,0) FROM `ï¼´ï¼™`; +C1 LEFT(`C1`,0) +龔龖龗龞龡 +龔龖龗龞 +龔龖龗 +龔龖 +é¾” + +SELECT `C1`, LEFT(`C1`,1) FROM `ï¼´ï¼™`; +C1 LEFT(`C1`,1) +龔龖龗龞龡 é¾” +龔龖龗龞 é¾” +龔龖龗 é¾” +龔龖 é¾” +é¾” é¾” + +SELECT `C1`, LEFT(`C1`,2) FROM `ï¼´ï¼™`; +C1 LEFT(`C1`,2) +龔龖龗龞龡 龔龖 +龔龖龗龞 龔龖 +龔龖龗 龔龖 +龔龖 龔龖 +é¾” é¾” + +SELECT `C1`, LEFT(`C1`,3) FROM `ï¼´ï¼™`; +C1 LEFT(`C1`,3) +龔龖龗龞龡 龔龖龗 +龔龖龗龞 龔龖龗 +龔龖龗 龔龖龗 +龔龖 龔龖 +é¾” é¾” + +SELECT `C1`, LEFT(`C1`,4) FROM `ï¼´ï¼™`; +C1 LEFT(`C1`,4) +龔龖龗龞龡 龔龖龗龞 +龔龖龗龞 龔龖龗龞 +龔龖龗 龔龖龗 +龔龖 龔龖 +é¾” é¾” + +SELECT `C1`, LEFT(`C1`,5) FROM `ï¼´ï¼™`; +C1 LEFT(`C1`,5) +龔龖龗龞龡 龔龖龗龞龡 +龔龖龗龞 龔龖龗龞 +龔龖龗 龔龖龗 +龔龖 龔龖 +é¾” é¾” + +SELECT `C1`, LEFT(`C1`,0) FROM `T1ï¼`; +C1 LEFT(`C1`,0) +アイウエオ +アイウエ +アイウ +アイ +ï½± + +SELECT `C1`, LEFT(`C1`,1) FROM `T1ï¼`; +C1 LEFT(`C1`,1) +アイウエオ ï½± +アイウエ ï½± +アイウ ï½± +アイ ï½± +ï½± ï½± + +SELECT `C1`, LEFT(`C1`,2) FROM `T1ï¼`; +C1 LEFT(`C1`,2) +アイウエオ アイ +アイウエ アイ +アイウ アイ +アイ アイ +ï½± ï½± + +SELECT `C1`, LEFT(`C1`,3) FROM `T1ï¼`; +C1 LEFT(`C1`,3) +アイウエオ アイウ +アイウエ アイウ +アイウ アイウ +アイ アイ +ï½± ï½± + +SELECT `C1`, LEFT(`C1`,4) FROM `T1ï¼`; +C1 LEFT(`C1`,4) +アイウエオ アイウエ +アイウエ アイウエ +アイウ アイウ +アイ アイ +ï½± ï½± + +SELECT `C1`, LEFT(`C1`,5) FROM `T1ï¼`; +C1 LEFT(`C1`,5) +アイウエオ アイウエオ +アイウエ アイウエ +アイウ アイウ +アイ アイ +ï½± ï½± + +SELECT `C1`, LEFT(`C1`,0) FROM `T11`; +C1 LEFT(`C1`,0) +ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆ +ã‚ã„ㆠ+ã‚ã„ +ã‚ + +SELECT `C1`, LEFT(`C1`,1) FROM `T11`; +C1 LEFT(`C1`,1) +ã‚ã„ã†ãˆãŠ ã‚ +ã‚ã„ã†ãˆ ã‚ +ã‚ã„ㆠ゠+ã‚ã„ ã‚ +ã‚ ã‚ + +SELECT `C1`, LEFT(`C1`,2) FROM `T11`; +C1 LEFT(`C1`,2) +ã‚ã„ã†ãˆãŠ ã‚ã„ +ã‚ã„ã†ãˆ ã‚ã„ +ã‚ã„ㆠã‚ã„ +ã‚ã„ ã‚ã„ +ã‚ ã‚ + +SELECT `C1`, LEFT(`C1`,3) FROM `T11`; +C1 LEFT(`C1`,3) +ã‚ã„ã†ãˆãŠ ã‚ã„ㆠ+ã‚ã„ã†ãˆ ã‚ã„ㆠ+ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ ã‚ã„ +ã‚ ã‚ + +SELECT `C1`, LEFT(`C1`,4) FROM `T11`; +C1 LEFT(`C1`,4) +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ ã‚ã„ +ã‚ ã‚ + +SELECT `C1`, LEFT(`C1`,5) FROM `T11`; +C1 LEFT(`C1`,5) +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ ã‚ã„ +ã‚ ã‚ + +SELECT `C1`, LEFT(`C1`,0) FROM `T12`; +C1 LEFT(`C1`,0) +龔龖龗龞龡 +龔龖龗龞 +龔龖龗 +龔龖 +é¾” + +SELECT `C1`, LEFT(`C1`,1) FROM `T12`; +C1 LEFT(`C1`,1) +龔龖龗龞龡 é¾” +龔龖龗龞 é¾” +龔龖龗 é¾” +龔龖 é¾” +é¾” é¾” + +SELECT `C1`, LEFT(`C1`,2) FROM `T12`; +C1 LEFT(`C1`,2) +龔龖龗龞龡 龔龖 +龔龖龗龞 龔龖 +龔龖龗 龔龖 +龔龖 龔龖 +é¾” é¾” + +SELECT `C1`, LEFT(`C1`,3) FROM `T12`; +C1 LEFT(`C1`,3) +龔龖龗龞龡 龔龖龗 +龔龖龗龞 龔龖龗 +龔龖龗 龔龖龗 +龔龖 龔龖 +é¾” é¾” + +SELECT `C1`, LEFT(`C1`,4) FROM `T12`; +C1 LEFT(`C1`,4) +龔龖龗龞龡 龔龖龗龞 +龔龖龗龞 龔龖龗龞 +龔龖龗 龔龖龗 +龔龖 龔龖 +é¾” é¾” + +SELECT `C1`, LEFT(`C1`,5) FROM `T12`; +C1 LEFT(`C1`,5) +龔龖龗龞龡 龔龖龗龞龡 +龔龖龗龞 龔龖龗龞 +龔龖龗 龔龖龗 +龔龖 龔龖 +é¾” é¾” + +DROP TABLE `T1`; +DROP TABLE `ï¼´ï¼’`; +DROP TABLE `T3`; +DROP TABLE `ï¼´ï¼”`; +DROP TABLE `T5`; +DROP TABLE `ï¼´ï¼–`; +DROP TABLE `ï¼´ï¼—`; +DROP TABLE `T8`; +DROP TABLE `ï¼´ï¼™`; +DROP TABLE `T1ï¼`; +DROP TABLE `T11`; +DROP TABLE `T12`; diff --git a/mysql-test/suite/jp/r/jp_length_sjis.result b/mysql-test/suite/jp/r/jp_length_sjis.result new file mode 100755 index 00000000000..51055e09233 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_length_sjis.result @@ -0,0 +1,146 @@ +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +drop table if exists `‚s‚P‚P`; +drop table if exists `‚s‚P‚Q`; +SET NAMES sjis; +SET character_set_database = sjis; +CREATE TABLE `‚s‚P` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Q` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚R` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚S` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚T` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚U` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚V` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚W` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚X` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚O` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚P` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚Q` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +INSERT INTO `‚s‚P` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +INSERT INTO `‚s‚S` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +INSERT INTO `‚s‚V` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +SELECT `‚b‚P`, LENGTH(`‚b‚P`) FROM `‚s‚P`; +‚b‚P LENGTH(`‚b‚P`) + 0 +± 1 +±² 2 +±²³ 3 +±²³´ 4 +±²³´µ 5 +SELECT `‚b‚P`, LENGTH(`‚b‚P`) FROM `‚s‚Q`; +‚b‚P LENGTH(`‚b‚P`) + 0 +‚  2 +‚ ‚¢ 4 +‚ ‚¢‚¤ 6 +‚ ‚¢‚¤‚¦ 8 +‚ ‚¢‚¤‚¦‚¨ 10 +SELECT `‚b‚P`, LENGTH(`‚b‚P`) FROM `‚s‚R`; +‚b‚P LENGTH(`‚b‚P`) + 0 +ƒ\ 2 +ƒ\\ 4 +ƒ\\•\ 6 +ƒ\\•\—\ 8 +ƒ\\•\—\\ 10 +SELECT `‚b‚P`, LENGTH(`‚b‚P`) FROM `‚s‚S`; +‚b‚P LENGTH(`‚b‚P`) + 0 +± 1 +±² 2 +±²³ 3 +±²³´ 4 +±²³´µ 5 +SELECT `‚b‚P`, LENGTH(`‚b‚P`) FROM `‚s‚T`; +‚b‚P LENGTH(`‚b‚P`) + 0 +‚  2 +‚ ‚¢ 4 +‚ ‚¢‚¤ 6 +‚ ‚¢‚¤‚¦ 8 +‚ ‚¢‚¤‚¦‚¨ 10 +SELECT `‚b‚P`, LENGTH(`‚b‚P`) FROM `‚s‚U`; +‚b‚P LENGTH(`‚b‚P`) + 0 +ƒ\ 2 +ƒ\\ 4 +ƒ\\•\ 6 +ƒ\\•\—\ 8 +ƒ\\•\—\\ 10 +SELECT `‚b‚P`, LENGTH(`‚b‚P`) FROM `‚s‚V`; +‚b‚P LENGTH(`‚b‚P`) +±²³´µ 5 +±²³´ 4 +±²³ 3 +±² 2 +± 1 + 0 +SELECT `‚b‚P`, LENGTH(`‚b‚P`) FROM `‚s‚W`; +‚b‚P LENGTH(`‚b‚P`) +‚ ‚¢‚¤‚¦‚¨ 10 +‚ ‚¢‚¤‚¦ 8 +‚ ‚¢‚¤ 6 +‚ ‚¢ 4 +‚  2 + 0 +SELECT `‚b‚P`, LENGTH(`‚b‚P`) FROM `‚s‚X`; +‚b‚P LENGTH(`‚b‚P`) +ƒ\\•\—\\ 10 +ƒ\\•\—\ 8 +ƒ\\•\ 6 +ƒ\\ 4 +ƒ\ 2 + 0 +SELECT `‚b‚P`, LENGTH(`‚b‚P`) FROM `‚s‚P‚O`; +‚b‚P LENGTH(`‚b‚P`) +±²³´µ 5 +±²³´ 4 +±²³ 3 +±² 2 +± 1 + 0 +SELECT `‚b‚P`, LENGTH(`‚b‚P`) FROM `‚s‚P‚P`; +‚b‚P LENGTH(`‚b‚P`) +‚ ‚¢‚¤‚¦‚¨ 10 +‚ ‚¢‚¤‚¦ 8 +‚ ‚¢‚¤ 6 +‚ ‚¢ 4 +‚  2 + 0 +SELECT `‚b‚P`, LENGTH(`‚b‚P`) FROM `‚s‚P‚Q`; +‚b‚P LENGTH(`‚b‚P`) +ƒ\\•\—\\ 10 +ƒ\\•\—\ 8 +ƒ\\•\ 6 +ƒ\\ 4 +ƒ\ 2 + 0 +DROP TABLE `‚s‚P`; +DROP TABLE `‚s‚Q`; +DROP TABLE `‚s‚R`; +DROP TABLE `‚s‚S`; +DROP TABLE `‚s‚T`; +DROP TABLE `‚s‚U`; +DROP TABLE `‚s‚V`; +DROP TABLE `‚s‚W`; +DROP TABLE `‚s‚X`; +DROP TABLE `‚s‚P‚O`; +DROP TABLE `‚s‚P‚P`; +DROP TABLE `‚s‚P‚Q`; diff --git a/mysql-test/suite/jp/r/jp_length_ucs2.result b/mysql-test/suite/jp/r/jp_length_ucs2.result new file mode 100755 index 00000000000..569e012f7d3 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_length_ucs2.result @@ -0,0 +1,147 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; +CREATE TABLE `£Ô£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£±`; +£Ã£± LENGTH(`£Ã£±`) + 0 +ޱ 2 +ޱ޲ 4 +ޱ޲޳ 6 +ޱ޲޳޴ 8 +ޱ޲޳޴޵ 10 +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£²`; +£Ã£± LENGTH(`£Ã£±`) + 0 +¤¢ 2 +¤¢¤¤ 4 +¤¢¤¤¤¦ 6 +¤¢¤¤¤¦¤¨ 8 +¤¢¤¤¤¦¤¨¤ª 10 +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£³`; +£Ã£± LENGTH(`£Ã£±`) + 0 +íÜ 2 +íÜíÝ 4 +íÜíÝíÞ 6 +íÜíÝíÞíß 8 +íÜíÝíÞíßíà 10 +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£´`; +£Ã£± LENGTH(`£Ã£±`) + 0 +ޱ 2 +ޱ޲ 4 +ޱ޲޳ 6 +ޱ޲޳޴ 8 +ޱ޲޳޴޵ 10 +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£µ`; +£Ã£± LENGTH(`£Ã£±`) + 0 +¤¢ 2 +¤¢¤¤ 4 +¤¢¤¤¤¦ 6 +¤¢¤¤¤¦¤¨ 8 +¤¢¤¤¤¦¤¨¤ª 10 +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£¶`; +£Ã£± LENGTH(`£Ã£±`) + 0 +íÜ 2 +íÜíÝ 4 +íÜíÝíÞ 6 +íÜíÝíÞíß 8 +íÜíÝíÞíßíà 10 +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£·`; +£Ã£± LENGTH(`£Ã£±`) +ޱ޲޳޴޵ 10 +ޱ޲޳޴ 8 +ޱ޲޳ 6 +ޱ޲ 4 +ޱ 2 + 0 +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£¸`; +£Ã£± LENGTH(`£Ã£±`) +¤¢¤¤¤¦¤¨¤ª 10 +¤¢¤¤¤¦¤¨ 8 +¤¢¤¤¤¦ 6 +¤¢¤¤ 4 +¤¢ 2 + 0 +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£¹`; +£Ã£± LENGTH(`£Ã£±`) +íÜíÝíÞíßíà 10 +íÜíÝíÞíß 8 +íÜíÝíÞ 6 +íÜíÝ 4 +íÜ 2 + 0 +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£±£°`; +£Ã£± LENGTH(`£Ã£±`) +ޱ޲޳޴޵ 10 +ޱ޲޳޴ 8 +ޱ޲޳ 6 +ޱ޲ 4 +ޱ 2 + 0 +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£±£±`; +£Ã£± LENGTH(`£Ã£±`) +¤¢¤¤¤¦¤¨¤ª 10 +¤¢¤¤¤¦¤¨ 8 +¤¢¤¤¤¦ 6 +¤¢¤¤ 4 +¤¢ 2 + 0 +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£±£²`; +£Ã£± LENGTH(`£Ã£±`) +íÜíÝíÞíßíà 10 +íÜíÝíÞíß 8 +íÜíÝíÞ 6 +íÜíÝ 4 +íÜ 2 + 0 +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/r/jp_length_ujis.result b/mysql-test/suite/jp/r/jp_length_ujis.result new file mode 100755 index 00000000000..288cc06a2ef --- /dev/null +++ b/mysql-test/suite/jp/r/jp_length_ujis.result @@ -0,0 +1,146 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +SET NAMES ujis; +SET character_set_database = ujis; +CREATE TABLE `£Ô£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£±`; +£Ã£± LENGTH(`£Ã£±`) + 0 +ޱ 2 +ޱ޲ 4 +ޱ޲޳ 6 +ޱ޲޳޴ 8 +ޱ޲޳޴޵ 10 +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£²`; +£Ã£± LENGTH(`£Ã£±`) + 0 +¤¢ 2 +¤¢¤¤ 4 +¤¢¤¤¤¦ 6 +¤¢¤¤¤¦¤¨ 8 +¤¢¤¤¤¦¤¨¤ª 10 +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£³`; +£Ã£± LENGTH(`£Ã£±`) + 0 +íÜ 3 +íÜíÝ 6 +íÜíÝíÞ 9 +íÜíÝíÞíß 12 +íÜíÝíÞíßíà 15 +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£´`; +£Ã£± LENGTH(`£Ã£±`) + 0 +ޱ 2 +ޱ޲ 4 +ޱ޲޳ 6 +ޱ޲޳޴ 8 +ޱ޲޳޴޵ 10 +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£µ`; +£Ã£± LENGTH(`£Ã£±`) + 0 +¤¢ 2 +¤¢¤¤ 4 +¤¢¤¤¤¦ 6 +¤¢¤¤¤¦¤¨ 8 +¤¢¤¤¤¦¤¨¤ª 10 +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£¶`; +£Ã£± LENGTH(`£Ã£±`) + 0 +íÜ 3 +íÜíÝ 6 +íÜíÝíÞ 9 +íÜíÝíÞíß 12 +íÜíÝíÞíßíà 15 +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£·`; +£Ã£± LENGTH(`£Ã£±`) +ޱ޲޳޴޵ 10 +ޱ޲޳޴ 8 +ޱ޲޳ 6 +ޱ޲ 4 +ޱ 2 + 0 +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£¸`; +£Ã£± LENGTH(`£Ã£±`) +¤¢¤¤¤¦¤¨¤ª 10 +¤¢¤¤¤¦¤¨ 8 +¤¢¤¤¤¦ 6 +¤¢¤¤ 4 +¤¢ 2 + 0 +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£¹`; +£Ã£± LENGTH(`£Ã£±`) +íÜíÝíÞíßíà 15 +íÜíÝíÞíß 12 +íÜíÝíÞ 9 +íÜíÝ 6 +íÜ 3 + 0 +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£±£°`; +£Ã£± LENGTH(`£Ã£±`) +ޱ޲޳޴޵ 10 +ޱ޲޳޴ 8 +ޱ޲޳ 6 +ޱ޲ 4 +ޱ 2 + 0 +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£±£±`; +£Ã£± LENGTH(`£Ã£±`) +¤¢¤¤¤¦¤¨¤ª 10 +¤¢¤¤¤¦¤¨ 8 +¤¢¤¤¤¦ 6 +¤¢¤¤ 4 +¤¢ 2 + 0 +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£±£²`; +£Ã£± LENGTH(`£Ã£±`) +íÜíÝíÞíßíà 15 +íÜíÝíÞíß 12 +íÜíÝíÞ 9 +íÜíÝ 6 +íÜ 3 + 0 +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/r/jp_length_utf8.result b/mysql-test/suite/jp/r/jp_length_utf8.result new file mode 100755 index 00000000000..11b4c523053 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_length_utf8.result @@ -0,0 +1,146 @@ +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +drop table if exists `T11`; +drop table if exists `T12`; +SET NAMES utf8; +SET character_set_database = utf8; +CREATE TABLE `T1` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T11` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T12` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +INSERT INTO `T1` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `T3` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +INSERT INTO `T1ï¼` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `T12` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +SELECT `C1`, LENGTH(`C1`) FROM `T1`; +C1 LENGTH(`C1`) + 0 +ï½± 3 +アイ 6 +アイウ 9 +アイウエ 12 +アイウエオ 15 +SELECT `C1`, LENGTH(`C1`) FROM `ï¼´ï¼’`; +C1 LENGTH(`C1`) + 0 +ã‚ 3 +ã‚ã„ 6 +ã‚ã„ㆠ9 +ã‚ã„ã†ãˆ 12 +ã‚ã„ã†ãˆãŠ 15 +SELECT `C1`, LENGTH(`C1`) FROM `T3`; +C1 LENGTH(`C1`) + 0 +é¾” 3 +龔龖 6 +龔龖龗 9 +龔龖龗龞 12 +龔龖龗龞龡 15 +SELECT `C1`, LENGTH(`C1`) FROM `ï¼´ï¼”`; +C1 LENGTH(`C1`) + 0 +ï½± 3 +アイ 6 +アイウ 9 +アイウエ 12 +アイウエオ 15 +SELECT `C1`, LENGTH(`C1`) FROM `T5`; +C1 LENGTH(`C1`) + 0 +ã‚ 3 +ã‚ã„ 6 +ã‚ã„ㆠ9 +ã‚ã„ã†ãˆ 12 +ã‚ã„ã†ãˆãŠ 15 +SELECT `C1`, LENGTH(`C1`) FROM `ï¼´ï¼–`; +C1 LENGTH(`C1`) + 0 +é¾” 3 +龔龖 6 +龔龖龗 9 +龔龖龗龞 12 +龔龖龗龞龡 15 +SELECT `C1`, LENGTH(`C1`) FROM `ï¼´ï¼—`; +C1 LENGTH(`C1`) +アイウエオ 15 +アイウエ 12 +アイウ 9 +アイ 6 +ï½± 3 + 0 +SELECT `C1`, LENGTH(`C1`) FROM `T8`; +C1 LENGTH(`C1`) +ã‚ã„ã†ãˆãŠ 15 +ã‚ã„ã†ãˆ 12 +ã‚ã„ㆠ9 +ã‚ã„ 6 +ã‚ 3 + 0 +SELECT `C1`, LENGTH(`C1`) FROM `ï¼´ï¼™`; +C1 LENGTH(`C1`) +龔龖龗龞龡 15 +龔龖龗龞 12 +龔龖龗 9 +龔龖 6 +é¾” 3 + 0 +SELECT `C1`, LENGTH(`C1`) FROM `T1ï¼`; +C1 LENGTH(`C1`) +アイウエオ 15 +アイウエ 12 +アイウ 9 +アイ 6 +ï½± 3 + 0 +SELECT `C1`, LENGTH(`C1`) FROM `T11`; +C1 LENGTH(`C1`) +ã‚ã„ã†ãˆãŠ 15 +ã‚ã„ã†ãˆ 12 +ã‚ã„ㆠ9 +ã‚ã„ 6 +ã‚ 3 + 0 +SELECT `C1`, LENGTH(`C1`) FROM `T12`; +C1 LENGTH(`C1`) +龔龖龗龞龡 15 +龔龖龗龞 12 +龔龖龗 9 +龔龖 6 +é¾” 3 + 0 +DROP TABLE `T1`; +DROP TABLE `ï¼´ï¼’`; +DROP TABLE `T3`; +DROP TABLE `ï¼´ï¼”`; +DROP TABLE `T5`; +DROP TABLE `ï¼´ï¼–`; +DROP TABLE `ï¼´ï¼—`; +DROP TABLE `T8`; +DROP TABLE `ï¼´ï¼™`; +DROP TABLE `T1ï¼`; +DROP TABLE `T11`; +DROP TABLE `T12`; diff --git a/mysql-test/suite/jp/r/jp_like_sjis.result b/mysql-test/suite/jp/r/jp_like_sjis.result new file mode 100755 index 00000000000..a8145fb08f0 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_like_sjis.result @@ -0,0 +1,322 @@ +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +drop table if exists `‚s‚P‚P`; +drop table if exists `‚s‚P‚Q`; +SET NAMES sjis; +SET character_set_database = sjis; +CREATE TABLE `‚s‚P` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Q` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚R` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚S` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚T` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚U` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚V` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚W` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚X` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚O` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚P` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚Q` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `‚s‚P`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `‚s‚Q`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `‚s‚R`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `‚s‚S`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `‚s‚T`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `‚s‚U`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `‚s‚V`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `‚s‚W`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `‚s‚X`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `‚s‚P‚O`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `‚s‚P‚P`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `‚s‚P‚Q`; +SELECT * FROM `‚s‚P` WHERE `‚b‚P` LIKE ' %'; +‚b‚P + !"#$%&'()*+,-./ + ¡¢£¤¥¦§¨©ª«¬­®¯ +SELECT * FROM `‚s‚P` WHERE `‚b‚P` LIKE '% %'; +‚b‚P + !"#$%&'()*+,-./ + ¡¢£¤¥¦§¨©ª«¬­®¯ +SELECT * FROM `‚s‚P` WHERE `‚b‚P` LIKE '% '; +‚b‚P +SELECT * FROM `‚s‚P` WHERE `‚b‚P` LIKE 'À%'; +‚b‚P +ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ +SELECT * FROM `‚s‚P` WHERE `‚b‚P` LIKE '%ר%'; +‚b‚P +ÐÑÒÓÔÕÖרÙÚÛÜÝÞß +SELECT * FROM `‚s‚P` WHERE `‚b‚P` LIKE '%¿'; +‚b‚P +°±²³´µ¶·¸¹º»¼½¾¿ +SELECT * FROM `‚s‚P` WHERE `‚b‚P` LIKE '°±²³´µ¶·¸¹º»¼½¾¿%'; +‚b‚P +°±²³´µ¶·¸¹º»¼½¾¿ +SELECT * FROM `‚s‚P` WHERE `‚b‚P` LIKE '%°±²³´µ¶·¸¹º»¼½¾¿%'; +‚b‚P +°±²³´µ¶·¸¹º»¼½¾¿ +SELECT * FROM `‚s‚P` WHERE `‚b‚P` LIKE '%°±²³´µ¶·¸¹º»¼½¾¿'; +‚b‚P +°±²³´µ¶·¸¹º»¼½¾¿ +SELECT * FROM `‚s‚Q` WHERE `‚b‚P` LIKE '@%'; +‚b‚P +@@ABCDEFGHIJKLMNOPQR +SELECT * FROM `‚s‚Q` WHERE `‚b‚P` LIKE '%@%'; +‚b‚P +@@ABCDEFGHIJKLMNOPQR +EEðñòóôõö÷EEEEüEEEE@ +SELECT * FROM `‚s‚Q` WHERE `‚b‚P` LIKE '%@'; +‚b‚P +EEðñòóôõö÷EEEEüEEEE@ +SELECT * FROM `‚s‚Q` WHERE `‚b‚P` LIKE '‚Æ%'; +‚b‚P +‚ƂǂȂɂʂ˂̂͂΂ςЂт҂ӂԂՂւׂ؂٠+SELECT * FROM `‚s‚Q` WHERE `‚b‚P` LIKE '%‚ %'; +‚b‚P +E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚­‚®‚¯‚°‚± +SELECT * FROM `‚s‚Q` WHERE `‚b‚P` LIKE '%‚í'; +‚b‚P +‚ڂۂ܂݂ނ߂à‚á‚â‚ã‚ä‚傿‚ç‚è‚é‚ê‚ë‚ì‚í +SELECT * FROM `‚s‚Q` WHERE `‚b‚P` LIKE 'E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚­‚®‚¯‚°‚±%'; +‚b‚P +E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚­‚®‚¯‚°‚± +SELECT * FROM `‚s‚Q` WHERE `‚b‚P` LIKE '%E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚­‚®‚¯‚°‚±%'; +‚b‚P +E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚­‚®‚¯‚°‚± +SELECT * FROM `‚s‚Q` WHERE `‚b‚P` LIKE '%E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚­‚®‚¯‚°‚±'; +‚b‚P +E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚­‚®‚¯‚°‚± +SELECT * FROM `‚s‚R` WHERE `‚b‚P` LIKE 'ƒ\%'; +‚b‚P +ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ +SELECT * FROM `‚s‚R` WHERE `‚b‚P` LIKE '%–\%'; +‚b‚P +ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ +SELECT * FROM `‚s‚R` WHERE `‚b‚P` LIKE '%ž\'; +‚b‚P +ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ +SELECT * FROM `‚s‚R` WHERE `‚b‚P` LIKE 'ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\%'; +‚b‚P +ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ +SELECT * FROM `‚s‚R` WHERE `‚b‚P` LIKE '%ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\%'; +‚b‚P +ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ +SELECT * FROM `‚s‚R` WHERE `‚b‚P` LIKE '%ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\'; +‚b‚P +ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ +SELECT * FROM `‚s‚S` WHERE `‚b‚P` LIKE ' %'; +‚b‚P + !"#$%&'()*+,-./ + ¡¢£¤¥¦§¨©ª«¬­®¯ +SELECT * FROM `‚s‚S` WHERE `‚b‚P` LIKE '% %'; +‚b‚P + !"#$%&'()*+,-./ + ¡¢£¤¥¦§¨©ª«¬­®¯ +SELECT * FROM `‚s‚S` WHERE `‚b‚P` LIKE '% '; +‚b‚P +SELECT * FROM `‚s‚S` WHERE `‚b‚P` LIKE 'À%'; +‚b‚P +ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ +SELECT * FROM `‚s‚S` WHERE `‚b‚P` LIKE '%ר%'; +‚b‚P +ÐÑÒÓÔÕÖרÙÚÛÜÝÞß +SELECT * FROM `‚s‚S` WHERE `‚b‚P` LIKE '%¿'; +‚b‚P +°±²³´µ¶·¸¹º»¼½¾¿ +SELECT * FROM `‚s‚S` WHERE `‚b‚P` LIKE '°±²³´µ¶·¸¹º»¼½¾¿%'; +‚b‚P +°±²³´µ¶·¸¹º»¼½¾¿ +SELECT * FROM `‚s‚S` WHERE `‚b‚P` LIKE '%°±²³´µ¶·¸¹º»¼½¾¿%'; +‚b‚P +°±²³´µ¶·¸¹º»¼½¾¿ +SELECT * FROM `‚s‚S` WHERE `‚b‚P` LIKE '%°±²³´µ¶·¸¹º»¼½¾¿'; +‚b‚P +°±²³´µ¶·¸¹º»¼½¾¿ +SELECT * FROM `‚s‚T` WHERE `‚b‚P` LIKE '@%'; +‚b‚P +@@ABCDEFGHIJKLMNOPQR +SELECT * FROM `‚s‚T` WHERE `‚b‚P` LIKE '%@%'; +‚b‚P +@@ABCDEFGHIJKLMNOPQR +EEðñòóôõö÷EEEEüEEEE@ +SELECT * FROM `‚s‚T` WHERE `‚b‚P` LIKE '%@'; +‚b‚P +EEðñòóôõö÷EEEEüEEEE@ +SELECT * FROM `‚s‚T` WHERE `‚b‚P` LIKE '‚Æ%'; +‚b‚P +‚ƂǂȂɂʂ˂̂͂΂ςЂт҂ӂԂՂւׂ؂٠+SELECT * FROM `‚s‚T` WHERE `‚b‚P` LIKE '%‚ %'; +‚b‚P +E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚­‚®‚¯‚°‚± +SELECT * FROM `‚s‚T` WHERE `‚b‚P` LIKE '%‚í'; +‚b‚P +‚ڂۂ܂݂ނ߂à‚á‚â‚ã‚ä‚傿‚ç‚è‚é‚ê‚ë‚ì‚í +SELECT * FROM `‚s‚T` WHERE `‚b‚P` LIKE 'E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚­‚®‚¯‚°‚±%'; +‚b‚P +E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚­‚®‚¯‚°‚± +SELECT * FROM `‚s‚T` WHERE `‚b‚P` LIKE '%E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚­‚®‚¯‚°‚±%'; +‚b‚P +E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚­‚®‚¯‚°‚± +SELECT * FROM `‚s‚T` WHERE `‚b‚P` LIKE '%E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚­‚®‚¯‚°‚±'; +‚b‚P +E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚­‚®‚¯‚°‚± +SELECT * FROM `‚s‚U` WHERE `‚b‚P` LIKE 'ƒ\%'; +‚b‚P +ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ +SELECT * FROM `‚s‚U` WHERE `‚b‚P` LIKE '%–\%'; +‚b‚P +ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ +SELECT * FROM `‚s‚U` WHERE `‚b‚P` LIKE '%ž\'; +‚b‚P +ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ +SELECT * FROM `‚s‚U` WHERE `‚b‚P` LIKE 'ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\%'; +‚b‚P +ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ +SELECT * FROM `‚s‚U` WHERE `‚b‚P` LIKE '%ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\%'; +‚b‚P +ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ +SELECT * FROM `‚s‚U` WHERE `‚b‚P` LIKE '%ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\'; +‚b‚P +ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ +SELECT * FROM `‚s‚V` WHERE `‚b‚P` LIKE ' %'; +‚b‚P + !"#$%&'()*+,-./ + ¡¢£¤¥¦§¨©ª«¬­®¯ +SELECT * FROM `‚s‚V` WHERE `‚b‚P` LIKE '% %'; +‚b‚P + !"#$%&'()*+,-./ + ¡¢£¤¥¦§¨©ª«¬­®¯ +SELECT * FROM `‚s‚V` WHERE `‚b‚P` LIKE '% '; +‚b‚P +SELECT * FROM `‚s‚V` WHERE `‚b‚P` LIKE 'À%'; +‚b‚P +ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ +SELECT * FROM `‚s‚V` WHERE `‚b‚P` LIKE '%ר%'; +‚b‚P +ÐÑÒÓÔÕÖרÙÚÛÜÝÞß +SELECT * FROM `‚s‚V` WHERE `‚b‚P` LIKE '%¿'; +‚b‚P +°±²³´µ¶·¸¹º»¼½¾¿ +SELECT * FROM `‚s‚V` WHERE `‚b‚P` LIKE '°±²³´µ¶·¸¹º»¼½¾¿%'; +‚b‚P +°±²³´µ¶·¸¹º»¼½¾¿ +SELECT * FROM `‚s‚V` WHERE `‚b‚P` LIKE '%°±²³´µ¶·¸¹º»¼½¾¿%'; +‚b‚P +°±²³´µ¶·¸¹º»¼½¾¿ +SELECT * FROM `‚s‚V` WHERE `‚b‚P` LIKE '%°±²³´µ¶·¸¹º»¼½¾¿'; +‚b‚P +°±²³´µ¶·¸¹º»¼½¾¿ +SELECT * FROM `‚s‚W` WHERE `‚b‚P` LIKE '@%'; +‚b‚P +@@ABCDEFGHIJKLMNOPQR +SELECT * FROM `‚s‚W` WHERE `‚b‚P` LIKE '%@%'; +‚b‚P +@@ABCDEFGHIJKLMNOPQR +EEðñòóôõö÷EEEEüEEEE@ +SELECT * FROM `‚s‚W` WHERE `‚b‚P` LIKE '%@'; +‚b‚P +EEðñòóôõö÷EEEEüEEEE@ +SELECT * FROM `‚s‚W` WHERE `‚b‚P` LIKE '‚Æ%'; +‚b‚P +‚ƂǂȂɂʂ˂̂͂΂ςЂт҂ӂԂՂւׂ؂٠+SELECT * FROM `‚s‚W` WHERE `‚b‚P` LIKE '%‚ %'; +‚b‚P +E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚­‚®‚¯‚°‚± +SELECT * FROM `‚s‚W` WHERE `‚b‚P` LIKE '%‚í'; +‚b‚P +‚ڂۂ܂݂ނ߂à‚á‚â‚ã‚ä‚傿‚ç‚è‚é‚ê‚ë‚ì‚í +SELECT * FROM `‚s‚W` WHERE `‚b‚P` LIKE 'E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚­‚®‚¯‚°‚±%'; +‚b‚P +E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚­‚®‚¯‚°‚± +SELECT * FROM `‚s‚W` WHERE `‚b‚P` LIKE '%E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚­‚®‚¯‚°‚±%'; +‚b‚P +E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚­‚®‚¯‚°‚± +SELECT * FROM `‚s‚W` WHERE `‚b‚P` LIKE '%E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚­‚®‚¯‚°‚±'; +‚b‚P +E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚­‚®‚¯‚°‚± +SELECT * FROM `‚s‚X` WHERE `‚b‚P` LIKE 'ƒ\%'; +‚b‚P +ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ +SELECT * FROM `‚s‚X` WHERE `‚b‚P` LIKE '%–\%'; +‚b‚P +ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ +SELECT * FROM `‚s‚X` WHERE `‚b‚P` LIKE '%ž\'; +‚b‚P +ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ +SELECT * FROM `‚s‚X` WHERE `‚b‚P` LIKE 'ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\%'; +‚b‚P +ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ +SELECT * FROM `‚s‚X` WHERE `‚b‚P` LIKE '%ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\%'; +‚b‚P +ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ +SELECT * FROM `‚s‚X` WHERE `‚b‚P` LIKE '%ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\'; +‚b‚P +ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ +SELECT * FROM `‚s‚P‚O` WHERE `‚b‚P` LIKE ' %'; +‚b‚P + !"#$%&'()*+,-./ + ¡¢£¤¥¦§¨©ª«¬­®¯ +SELECT * FROM `‚s‚P‚O` WHERE `‚b‚P` LIKE '% %'; +‚b‚P + !"#$%&'()*+,-./ + ¡¢£¤¥¦§¨©ª«¬­®¯ +SELECT * FROM `‚s‚P‚O` WHERE `‚b‚P` LIKE '% '; +‚b‚P +SELECT * FROM `‚s‚P‚O` WHERE `‚b‚P` LIKE 'À%'; +‚b‚P +ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ +SELECT * FROM `‚s‚P‚O` WHERE `‚b‚P` LIKE '%ר%'; +‚b‚P +ÐÑÒÓÔÕÖרÙÚÛÜÝÞß +SELECT * FROM `‚s‚P‚O` WHERE `‚b‚P` LIKE '%¿'; +‚b‚P +°±²³´µ¶·¸¹º»¼½¾¿ +SELECT * FROM `‚s‚P‚O` WHERE `‚b‚P` LIKE '%°±²³´µ¶·¸¹º»¼½¾¿'; +‚b‚P +°±²³´µ¶·¸¹º»¼½¾¿ +SELECT * FROM `‚s‚P‚P` WHERE `‚b‚P` LIKE '@%'; +‚b‚P +@@ABCDEFGHIJKLMNOPQR +SELECT * FROM `‚s‚P‚P` WHERE `‚b‚P` LIKE '%@%'; +‚b‚P +@@ABCDEFGHIJKLMNOPQR +EEðñòóôõö÷EEEEüEEEE@ +SELECT * FROM `‚s‚P‚P` WHERE `‚b‚P` LIKE '%@'; +‚b‚P +EEðñòóôõö÷EEEEüEEEE@ +SELECT * FROM `‚s‚P‚P` WHERE `‚b‚P` LIKE '‚Æ%'; +‚b‚P +‚ƂǂȂɂʂ˂̂͂΂ςЂт҂ӂԂՂւׂ؂٠+SELECT * FROM `‚s‚P‚P` WHERE `‚b‚P` LIKE '%‚ %'; +‚b‚P +E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚­‚®‚¯‚°‚± +SELECT * FROM `‚s‚P‚P` WHERE `‚b‚P` LIKE '%‚í'; +‚b‚P +‚ڂۂ܂݂ނ߂à‚á‚â‚ã‚ä‚傿‚ç‚è‚é‚ê‚ë‚ì‚í +SELECT * FROM `‚s‚P‚Q` WHERE `‚b‚P` LIKE 'ƒ\%'; +‚b‚P +ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ +SELECT * FROM `‚s‚P‚Q` WHERE `‚b‚P` LIKE '%–\%'; +‚b‚P +ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ +SELECT * FROM `‚s‚P‚Q` WHERE `‚b‚P` LIKE '%ž\'; +‚b‚P +ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ +DROP TABLE `‚s‚P`; +DROP TABLE `‚s‚Q`; +DROP TABLE `‚s‚R`; +DROP TABLE `‚s‚S`; +DROP TABLE `‚s‚T`; +DROP TABLE `‚s‚U`; +DROP TABLE `‚s‚V`; +DROP TABLE `‚s‚W`; +DROP TABLE `‚s‚X`; +DROP TABLE `‚s‚P‚O`; +DROP TABLE `‚s‚P‚P`; +DROP TABLE `‚s‚P‚Q`; diff --git a/mysql-test/suite/jp/r/jp_like_ucs2.result b/mysql-test/suite/jp/r/jp_like_ucs2.result new file mode 100755 index 00000000000..229ef12a118 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_like_ucs2.result @@ -0,0 +1,419 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; +CREATE TABLE `£Ô£±` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +INSERT INTO `£Ô£±` VALUES +('PQRSTUVWXYZ[\\]^_') +,(' Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯') +,('Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿') +,('ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ') +,('ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß'); +INSERT INTO `£Ô£²` VALUES +('¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡­¡®¡¯¡°¡±¡²¡³') +,('¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç') +,('¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û') +,('¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³') +,('¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û') +,('¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï') +,('¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³') +,('¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³') +,('¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³') +,('¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³'); +INSERT INTO `£Ô£³` VALUES +('¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦') +,('°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç') +,('°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û') +,('°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï') +,('¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³') +,('í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ') +,('íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ'); +INSERT INTO `£Ô£´` VALUES +('PQRSTUVWXYZ[\\]^_') +,(' Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯') +,('Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿') +,('ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ') +,('ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß'); +INSERT INTO `£Ô£µ` VALUES +('¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡­¡®¡¯¡°¡±¡²¡³') +,('¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç') +,('¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û') +,('¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³') +,('¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û') +,('¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï') +,('¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³') +,('¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³') +,('¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³') +,('¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³'); +INSERT INTO `£Ô£¶` VALUES +('¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦') +,('°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç') +,('°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û') +,('°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï') +,('¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³') +,('í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ') +,('íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ'); +INSERT INTO `£Ô£·` VALUES +('PQRSTUVWXYZ[\\]^_') +,(' Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯') +,('Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿') +,('ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ') +,('ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß'); +INSERT INTO `£Ô£¸` VALUES +('¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡­¡®¡¯¡°¡±¡²¡³') +,('¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç') +,('¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û') +,('¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³') +,('¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û') +,('¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï') +,('¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³') +,('¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³') +,('¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³') +,('¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³'); +INSERT INTO `£Ô£¹` VALUES +('¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦') +,('°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç') +,('°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û') +,('°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï') +,('¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³') +,('í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ') +,('íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ'); +INSERT INTO `£Ô£±£°` VALUES +('PQRSTUVWXYZ[\\]^_') +,(' Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯') +,('Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿') +,('ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ') +,('ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß'); +INSERT INTO `£Ô£±£±` VALUES +('¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡­¡®¡¯¡°¡±¡²¡³') +,('¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç') +,('¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û') +,('¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³') +,('¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û') +,('¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï') +,('¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³') +,('¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³') +,('¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³') +,('¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³'); +INSERT INTO `£Ô£±£²` VALUES +('¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦') +,('°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç') +,('°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û') +,('°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï') +,('¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³') +,('í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ') +,('íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ'); +SELECT * FROM `£Ô£±` WHERE `£Ã£±` LIKE ' %'; +£Ã£± + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯ +SELECT * FROM `£Ô£±` WHERE `£Ã£±` LIKE '% %'; +£Ã£± + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯ +SELECT * FROM `£Ô£±` WHERE `£Ã£±` LIKE '% '; +£Ã£± +SELECT * FROM `£Ô£±` WHERE `£Ã£±` LIKE 'ŽÀ%'; +£Ã£± +ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ +SELECT * FROM `£Ô£±` WHERE `£Ã£±` LIKE '%Ž×ŽØ%'; +£Ã£± +ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß +SELECT * FROM `£Ô£±` WHERE `£Ã£±` LIKE '%Ž¿'; +£Ã£± +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +SELECT * FROM `£Ô£±` WHERE `£Ã£±` LIKE 'Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿%'; +£Ã£± +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +SELECT * FROM `£Ô£±` WHERE `£Ã£±` LIKE '%Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿%'; +£Ã£± +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +SELECT * FROM `£Ô£±` WHERE `£Ã£±` LIKE '%Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿'; +£Ã£± +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +SELECT * FROM `£Ô£²` WHERE `£Ã£±` LIKE '¡¡%'; +£Ã£± +¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡­¡®¡¯¡°¡±¡²¡³ +SELECT * FROM `£Ô£²` WHERE `£Ã£±` LIKE '%¡¡%'; +£Ã£± +¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡­¡®¡¯¡°¡±¡²¡³ +SELECT * FROM `£Ô£²` WHERE `£Ã£±` LIKE '%¡¡'; +£Ã£± +SELECT * FROM `£Ô£²` WHERE `£Ã£±` LIKE '¤È%'; +£Ã£± +¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û +SELECT * FROM `£Ô£²` WHERE `£Ã£±` LIKE '%¤¢%'; +£Ã£± +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ +SELECT * FROM `£Ô£²` WHERE `£Ã£±` LIKE '%¤ï'; +£Ã£± +¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï +SELECT * FROM `£Ô£²` WHERE `£Ã£±` LIKE '¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³%'; +£Ã£± +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ +SELECT * FROM `£Ô£²` WHERE `£Ã£±` LIKE '%¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³%'; +£Ã£± +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ +SELECT * FROM `£Ô£²` WHERE `£Ã£±` LIKE '%¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³'; +£Ã£± +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ +SELECT * FROM `£Ô£³` WHERE `£Ã£±` LIKE 'í´%'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£³` WHERE `£Ã£±` LIKE '%í»%'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£³` WHERE `£Ã£±` LIKE '%íÇ'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£³` WHERE `£Ã£±` LIKE 'í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ%'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£³` WHERE `£Ã£±` LIKE '%í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ%'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£³` WHERE `£Ã£±` LIKE '%í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£´` WHERE `£Ã£±` LIKE ' %'; +£Ã£± + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯ +SELECT * FROM `£Ô£´` WHERE `£Ã£±` LIKE '% %'; +£Ã£± + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯ +SELECT * FROM `£Ô£´` WHERE `£Ã£±` LIKE '% '; +£Ã£± +SELECT * FROM `£Ô£´` WHERE `£Ã£±` LIKE 'ŽÀ%'; +£Ã£± +ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ +SELECT * FROM `£Ô£´` WHERE `£Ã£±` LIKE '%Ž×ŽØ%'; +£Ã£± +ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß +SELECT * FROM `£Ô£´` WHERE `£Ã£±` LIKE '%Ž¿'; +£Ã£± +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +SELECT * FROM `£Ô£´` WHERE `£Ã£±` LIKE 'Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿%'; +£Ã£± +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +SELECT * FROM `£Ô£´` WHERE `£Ã£±` LIKE '%Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿%'; +£Ã£± +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +SELECT * FROM `£Ô£´` WHERE `£Ã£±` LIKE '%Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿'; +£Ã£± +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +SELECT * FROM `£Ô£µ` WHERE `£Ã£±` LIKE '¡¡%'; +£Ã£± +¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡­¡®¡¯¡°¡±¡²¡³ +SELECT * FROM `£Ô£µ` WHERE `£Ã£±` LIKE '%¡¡%'; +£Ã£± +¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡­¡®¡¯¡°¡±¡²¡³ +SELECT * FROM `£Ô£µ` WHERE `£Ã£±` LIKE '%¡¡'; +£Ã£± +SELECT * FROM `£Ô£µ` WHERE `£Ã£±` LIKE '¤È%'; +£Ã£± +¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û +SELECT * FROM `£Ô£µ` WHERE `£Ã£±` LIKE '%¤¢%'; +£Ã£± +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ +SELECT * FROM `£Ô£µ` WHERE `£Ã£±` LIKE '%¤ï'; +£Ã£± +¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï +SELECT * FROM `£Ô£µ` WHERE `£Ã£±` LIKE '¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³%'; +£Ã£± +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ +SELECT * FROM `£Ô£µ` WHERE `£Ã£±` LIKE '%¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³%'; +£Ã£± +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ +SELECT * FROM `£Ô£µ` WHERE `£Ã£±` LIKE '%¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³'; +£Ã£± +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ +SELECT * FROM `£Ô£¶` WHERE `£Ã£±` LIKE 'í´%'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£¶` WHERE `£Ã£±` LIKE '%í»%'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£¶` WHERE `£Ã£±` LIKE '%íÇ'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£¶` WHERE `£Ã£±` LIKE 'í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ%'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£¶` WHERE `£Ã£±` LIKE '%í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ%'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£¶` WHERE `£Ã£±` LIKE '%í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£·` WHERE `£Ã£±` LIKE ' %'; +£Ã£± + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯ +SELECT * FROM `£Ô£·` WHERE `£Ã£±` LIKE '% %'; +£Ã£± + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯ +SELECT * FROM `£Ô£·` WHERE `£Ã£±` LIKE '% '; +£Ã£± +SELECT * FROM `£Ô£·` WHERE `£Ã£±` LIKE 'ŽÀ%'; +£Ã£± +ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ +SELECT * FROM `£Ô£·` WHERE `£Ã£±` LIKE '%Ž×ŽØ%'; +£Ã£± +ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß +SELECT * FROM `£Ô£·` WHERE `£Ã£±` LIKE '%Ž¿'; +£Ã£± +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +SELECT * FROM `£Ô£·` WHERE `£Ã£±` LIKE 'Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿%'; +£Ã£± +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +SELECT * FROM `£Ô£·` WHERE `£Ã£±` LIKE '%Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿%'; +£Ã£± +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +SELECT * FROM `£Ô£·` WHERE `£Ã£±` LIKE '%Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿'; +£Ã£± +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +SELECT * FROM `£Ô£¸` WHERE `£Ã£±` LIKE '¡¡%'; +£Ã£± +¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡­¡®¡¯¡°¡±¡²¡³ +SELECT * FROM `£Ô£¸` WHERE `£Ã£±` LIKE '%¡¡%'; +£Ã£± +¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡­¡®¡¯¡°¡±¡²¡³ +SELECT * FROM `£Ô£¸` WHERE `£Ã£±` LIKE '%¡¡'; +£Ã£± +SELECT * FROM `£Ô£¸` WHERE `£Ã£±` LIKE '¤È%'; +£Ã£± +¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û +SELECT * FROM `£Ô£¸` WHERE `£Ã£±` LIKE '%¤¢%'; +£Ã£± +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ +SELECT * FROM `£Ô£¸` WHERE `£Ã£±` LIKE '%¤ï'; +£Ã£± +¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï +SELECT * FROM `£Ô£¸` WHERE `£Ã£±` LIKE '¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³%'; +£Ã£± +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ +SELECT * FROM `£Ô£¸` WHERE `£Ã£±` LIKE '%¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³%'; +£Ã£± +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ +SELECT * FROM `£Ô£¸` WHERE `£Ã£±` LIKE '%¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³'; +£Ã£± +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ +SELECT * FROM `£Ô£¹` WHERE `£Ã£±` LIKE 'í´%'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£¹` WHERE `£Ã£±` LIKE '%í»%'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£¹` WHERE `£Ã£±` LIKE '%íÇ'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£¹` WHERE `£Ã£±` LIKE 'í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ%'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£¹` WHERE `£Ã£±` LIKE '%í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ%'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£¹` WHERE `£Ã£±` LIKE '%í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£±£°` WHERE `£Ã£±` LIKE ' %'; +£Ã£± + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯ +SELECT * FROM `£Ô£±£°` WHERE `£Ã£±` LIKE '% %'; +£Ã£± + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯ +SELECT * FROM `£Ô£±£°` WHERE `£Ã£±` LIKE '% '; +£Ã£± +SELECT * FROM `£Ô£±£°` WHERE `£Ã£±` LIKE 'ŽÀ%'; +£Ã£± +ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ +SELECT * FROM `£Ô£±£°` WHERE `£Ã£±` LIKE '%Ž×ŽØ%'; +£Ã£± +ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß +SELECT * FROM `£Ô£±£°` WHERE `£Ã£±` LIKE '%Ž¿'; +£Ã£± +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +SELECT * FROM `£Ô£±£°` WHERE `£Ã£±` LIKE 'Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿%'; +£Ã£± +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +SELECT * FROM `£Ô£±£°` WHERE `£Ã£±` LIKE '%Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿%'; +£Ã£± +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +SELECT * FROM `£Ô£±£°` WHERE `£Ã£±` LIKE '%Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿'; +£Ã£± +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +SELECT * FROM `£Ô£±£±` WHERE `£Ã£±` LIKE '¡¡%'; +£Ã£± +¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡­¡®¡¯¡°¡±¡²¡³ +SELECT * FROM `£Ô£±£±` WHERE `£Ã£±` LIKE '%¡¡%'; +£Ã£± +¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡­¡®¡¯¡°¡±¡²¡³ +SELECT * FROM `£Ô£±£±` WHERE `£Ã£±` LIKE '%¡¡'; +£Ã£± +SELECT * FROM `£Ô£±£±` WHERE `£Ã£±` LIKE '¤È%'; +£Ã£± +¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û +SELECT * FROM `£Ô£±£±` WHERE `£Ã£±` LIKE '%¤¢%'; +£Ã£± +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ +SELECT * FROM `£Ô£±£±` WHERE `£Ã£±` LIKE '%¤ï'; +£Ã£± +¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï +SELECT * FROM `£Ô£±£±` WHERE `£Ã£±` LIKE '¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³%'; +£Ã£± +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ +SELECT * FROM `£Ô£±£±` WHERE `£Ã£±` LIKE '%¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³%'; +£Ã£± +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ +SELECT * FROM `£Ô£±£±` WHERE `£Ã£±` LIKE '%¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³'; +£Ã£± +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ +SELECT * FROM `£Ô£±£²` WHERE `£Ã£±` LIKE 'í´%'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£±£²` WHERE `£Ã£±` LIKE '%í»%'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£±£²` WHERE `£Ã£±` LIKE '%íÇ'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£±£²` WHERE `£Ã£±` LIKE 'í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ%'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£±£²` WHERE `£Ã£±` LIKE '%í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ%'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£±£²` WHERE `£Ã£±` LIKE '%í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/r/jp_like_ujis.result b/mysql-test/suite/jp/r/jp_like_ujis.result new file mode 100755 index 00000000000..5d623df0384 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_like_ujis.result @@ -0,0 +1,322 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +SET NAMES ujis; +SET character_set_database = ujis; +CREATE TABLE `£Ô£±` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_ujis.dat' INTO TABLE `£Ô£±`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_ujis.dat' INTO TABLE `£Ô£²`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_ujis.dat' INTO TABLE `£Ô£³`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_ujis.dat' INTO TABLE `£Ô£´`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_ujis.dat' INTO TABLE `£Ô£µ`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_ujis.dat' INTO TABLE `£Ô£¶`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_ujis.dat' INTO TABLE `£Ô£·`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_ujis.dat' INTO TABLE `£Ô£¸`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_ujis.dat' INTO TABLE `£Ô£¹`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_ujis.dat' INTO TABLE `£Ô£±£°`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_ujis.dat' INTO TABLE `£Ô£±£±`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_ujis.dat' INTO TABLE `£Ô£±£²`; +SELECT * FROM `£Ô£±` WHERE `£Ã£±` LIKE ' %'; +£Ã£± + !"#$%&'()*+,-./ + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯ +SELECT * FROM `£Ô£±` WHERE `£Ã£±` LIKE '% %'; +£Ã£± + !"#$%&'()*+,-./ + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯ +SELECT * FROM `£Ô£±` WHERE `£Ã£±` LIKE '% '; +£Ã£± +SELECT * FROM `£Ô£±` WHERE `£Ã£±` LIKE 'ŽÀ%'; +£Ã£± +ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ +SELECT * FROM `£Ô£±` WHERE `£Ã£±` LIKE '%Ž×ŽØ%'; +£Ã£± +ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß +SELECT * FROM `£Ô£±` WHERE `£Ã£±` LIKE '%Ž¿'; +£Ã£± +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +SELECT * FROM `£Ô£±` WHERE `£Ã£±` LIKE 'Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿%'; +£Ã£± +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +SELECT * FROM `£Ô£±` WHERE `£Ã£±` LIKE '%Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿%'; +£Ã£± +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +SELECT * FROM `£Ô£±` WHERE `£Ã£±` LIKE '%Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿'; +£Ã£± +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +SELECT * FROM `£Ô£²` WHERE `£Ã£±` LIKE '¡¡%'; +£Ã£± +¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡­¡®¡¯¡°¡±¡²¡³ +SELECT * FROM `£Ô£²` WHERE `£Ã£±` LIKE '%¡¡%'; +£Ã£± +¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡­¡®¡¯¡°¡±¡²¡³ +¡¦¡¦¢ò¢ó¢ô¢õ¢ö¢÷¢ø¢ù¡¦¡¦¡¦¡¦¢þ¡¦¡¦¡¦¡¦¡¡ +SELECT * FROM `£Ô£²` WHERE `£Ã£±` LIKE '%¡¡'; +£Ã£± +¡¦¡¦¢ò¢ó¢ô¢õ¢ö¢÷¢ø¢ù¡¦¡¦¡¦¡¦¢þ¡¦¡¦¡¦¡¦¡¡ +SELECT * FROM `£Ô£²` WHERE `£Ã£±` LIKE '¤È%'; +£Ã£± +¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û +SELECT * FROM `£Ô£²` WHERE `£Ã£±` LIKE '%¤¢%'; +£Ã£± +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ +SELECT * FROM `£Ô£²` WHERE `£Ã£±` LIKE '%¤ï'; +£Ã£± +¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï +SELECT * FROM `£Ô£²` WHERE `£Ã£±` LIKE '¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³%'; +£Ã£± +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ +SELECT * FROM `£Ô£²` WHERE `£Ã£±` LIKE '%¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³%'; +£Ã£± +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ +SELECT * FROM `£Ô£²` WHERE `£Ã£±` LIKE '%¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³'; +£Ã£± +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ +SELECT * FROM `£Ô£³` WHERE `£Ã£±` LIKE 'í´%'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£³` WHERE `£Ã£±` LIKE '%í»%'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£³` WHERE `£Ã£±` LIKE '%íÇ'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£³` WHERE `£Ã£±` LIKE 'í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ%'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£³` WHERE `£Ã£±` LIKE '%í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ%'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£³` WHERE `£Ã£±` LIKE '%í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£´` WHERE `£Ã£±` LIKE ' %'; +£Ã£± + !"#$%&'()*+,-./ + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯ +SELECT * FROM `£Ô£´` WHERE `£Ã£±` LIKE '% %'; +£Ã£± + !"#$%&'()*+,-./ + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯ +SELECT * FROM `£Ô£´` WHERE `£Ã£±` LIKE '% '; +£Ã£± +SELECT * FROM `£Ô£´` WHERE `£Ã£±` LIKE 'ŽÀ%'; +£Ã£± +ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ +SELECT * FROM `£Ô£´` WHERE `£Ã£±` LIKE '%Ž×ŽØ%'; +£Ã£± +ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß +SELECT * FROM `£Ô£´` WHERE `£Ã£±` LIKE '%Ž¿'; +£Ã£± +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +SELECT * FROM `£Ô£´` WHERE `£Ã£±` LIKE 'Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿%'; +£Ã£± +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +SELECT * FROM `£Ô£´` WHERE `£Ã£±` LIKE '%Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿%'; +£Ã£± +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +SELECT * FROM `£Ô£´` WHERE `£Ã£±` LIKE '%Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿'; +£Ã£± +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +SELECT * FROM `£Ô£µ` WHERE `£Ã£±` LIKE '¡¡%'; +£Ã£± +¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡­¡®¡¯¡°¡±¡²¡³ +SELECT * FROM `£Ô£µ` WHERE `£Ã£±` LIKE '%¡¡%'; +£Ã£± +¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡­¡®¡¯¡°¡±¡²¡³ +¡¦¡¦¢ò¢ó¢ô¢õ¢ö¢÷¢ø¢ù¡¦¡¦¡¦¡¦¢þ¡¦¡¦¡¦¡¦¡¡ +SELECT * FROM `£Ô£µ` WHERE `£Ã£±` LIKE '%¡¡'; +£Ã£± +¡¦¡¦¢ò¢ó¢ô¢õ¢ö¢÷¢ø¢ù¡¦¡¦¡¦¡¦¢þ¡¦¡¦¡¦¡¦¡¡ +SELECT * FROM `£Ô£µ` WHERE `£Ã£±` LIKE '¤È%'; +£Ã£± +¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û +SELECT * FROM `£Ô£µ` WHERE `£Ã£±` LIKE '%¤¢%'; +£Ã£± +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ +SELECT * FROM `£Ô£µ` WHERE `£Ã£±` LIKE '%¤ï'; +£Ã£± +¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï +SELECT * FROM `£Ô£µ` WHERE `£Ã£±` LIKE '¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³%'; +£Ã£± +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ +SELECT * FROM `£Ô£µ` WHERE `£Ã£±` LIKE '%¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³%'; +£Ã£± +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ +SELECT * FROM `£Ô£µ` WHERE `£Ã£±` LIKE '%¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³'; +£Ã£± +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ +SELECT * FROM `£Ô£¶` WHERE `£Ã£±` LIKE 'í´%'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£¶` WHERE `£Ã£±` LIKE '%í»%'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£¶` WHERE `£Ã£±` LIKE '%íÇ'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£¶` WHERE `£Ã£±` LIKE 'í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ%'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£¶` WHERE `£Ã£±` LIKE '%í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ%'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£¶` WHERE `£Ã£±` LIKE '%í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£·` WHERE `£Ã£±` LIKE ' %'; +£Ã£± + !"#$%&'()*+,-./ + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯ +SELECT * FROM `£Ô£·` WHERE `£Ã£±` LIKE '% %'; +£Ã£± + !"#$%&'()*+,-./ + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯ +SELECT * FROM `£Ô£·` WHERE `£Ã£±` LIKE '% '; +£Ã£± +SELECT * FROM `£Ô£·` WHERE `£Ã£±` LIKE 'ŽÀ%'; +£Ã£± +ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ +SELECT * FROM `£Ô£·` WHERE `£Ã£±` LIKE '%Ž×ŽØ%'; +£Ã£± +ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß +SELECT * FROM `£Ô£·` WHERE `£Ã£±` LIKE '%Ž¿'; +£Ã£± +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +SELECT * FROM `£Ô£·` WHERE `£Ã£±` LIKE 'Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿%'; +£Ã£± +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +SELECT * FROM `£Ô£·` WHERE `£Ã£±` LIKE '%Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿%'; +£Ã£± +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +SELECT * FROM `£Ô£·` WHERE `£Ã£±` LIKE '%Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿'; +£Ã£± +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +SELECT * FROM `£Ô£¸` WHERE `£Ã£±` LIKE '¡¡%'; +£Ã£± +¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡­¡®¡¯¡°¡±¡²¡³ +SELECT * FROM `£Ô£¸` WHERE `£Ã£±` LIKE '%¡¡%'; +£Ã£± +¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡­¡®¡¯¡°¡±¡²¡³ +¡¦¡¦¢ò¢ó¢ô¢õ¢ö¢÷¢ø¢ù¡¦¡¦¡¦¡¦¢þ¡¦¡¦¡¦¡¦¡¡ +SELECT * FROM `£Ô£¸` WHERE `£Ã£±` LIKE '%¡¡'; +£Ã£± +¡¦¡¦¢ò¢ó¢ô¢õ¢ö¢÷¢ø¢ù¡¦¡¦¡¦¡¦¢þ¡¦¡¦¡¦¡¦¡¡ +SELECT * FROM `£Ô£¸` WHERE `£Ã£±` LIKE '¤È%'; +£Ã£± +¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û +SELECT * FROM `£Ô£¸` WHERE `£Ã£±` LIKE '%¤¢%'; +£Ã£± +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ +SELECT * FROM `£Ô£¸` WHERE `£Ã£±` LIKE '%¤ï'; +£Ã£± +¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï +SELECT * FROM `£Ô£¸` WHERE `£Ã£±` LIKE '¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³%'; +£Ã£± +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ +SELECT * FROM `£Ô£¸` WHERE `£Ã£±` LIKE '%¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³%'; +£Ã£± +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ +SELECT * FROM `£Ô£¸` WHERE `£Ã£±` LIKE '%¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³'; +£Ã£± +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ +SELECT * FROM `£Ô£¹` WHERE `£Ã£±` LIKE 'í´%'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£¹` WHERE `£Ã£±` LIKE '%í»%'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£¹` WHERE `£Ã£±` LIKE '%íÇ'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£¹` WHERE `£Ã£±` LIKE 'í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ%'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£¹` WHERE `£Ã£±` LIKE '%í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ%'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£¹` WHERE `£Ã£±` LIKE '%í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£±£°` WHERE `£Ã£±` LIKE ' %'; +£Ã£± + !"#$%&'()*+,-./ + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯ +SELECT * FROM `£Ô£±£°` WHERE `£Ã£±` LIKE '% %'; +£Ã£± + !"#$%&'()*+,-./ + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯ +SELECT * FROM `£Ô£±£°` WHERE `£Ã£±` LIKE '% '; +£Ã£± +SELECT * FROM `£Ô£±£°` WHERE `£Ã£±` LIKE 'ŽÀ%'; +£Ã£± +ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ +SELECT * FROM `£Ô£±£°` WHERE `£Ã£±` LIKE '%Ž×ŽØ%'; +£Ã£± +ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß +SELECT * FROM `£Ô£±£°` WHERE `£Ã£±` LIKE '%Ž¿'; +£Ã£± +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +SELECT * FROM `£Ô£±£°` WHERE `£Ã£±` LIKE '%Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿'; +£Ã£± +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +SELECT * FROM `£Ô£±£±` WHERE `£Ã£±` LIKE '¡¡%'; +£Ã£± +¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡­¡®¡¯¡°¡±¡²¡³ +SELECT * FROM `£Ô£±£±` WHERE `£Ã£±` LIKE '%¡¡%'; +£Ã£± +¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡­¡®¡¯¡°¡±¡²¡³ +¡¦¡¦¢ò¢ó¢ô¢õ¢ö¢÷¢ø¢ù¡¦¡¦¡¦¡¦¢þ¡¦¡¦¡¦¡¦¡¡ +SELECT * FROM `£Ô£±£±` WHERE `£Ã£±` LIKE '%¡¡'; +£Ã£± +¡¦¡¦¢ò¢ó¢ô¢õ¢ö¢÷¢ø¢ù¡¦¡¦¡¦¡¦¢þ¡¦¡¦¡¦¡¦¡¡ +SELECT * FROM `£Ô£±£±` WHERE `£Ã£±` LIKE '¤È%'; +£Ã£± +¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û +SELECT * FROM `£Ô£±£±` WHERE `£Ã£±` LIKE '%¤¢%'; +£Ã£± +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ +SELECT * FROM `£Ô£±£±` WHERE `£Ã£±` LIKE '%¤ï'; +£Ã£± +¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï +SELECT * FROM `£Ô£±£²` WHERE `£Ã£±` LIKE 'í´%'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£±£²` WHERE `£Ã£±` LIKE '%í»%'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£±£²` WHERE `£Ã£±` LIKE '%íÇ'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/r/jp_like_utf8.result b/mysql-test/suite/jp/r/jp_like_utf8.result new file mode 100755 index 00000000000..bf48da79951 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_like_utf8.result @@ -0,0 +1,319 @@ +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +drop table if exists `T11`; +drop table if exists `T12`; +SET NAMES utf8; +SET character_set_database = utf8; +CREATE TABLE `T1` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T11` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T12` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_utf8.dat' INTO TABLE `T1`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_utf8.dat' INTO TABLE `ï¼´ï¼’`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_utf8.dat' INTO TABLE `T3`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_utf8.dat' INTO TABLE `ï¼´ï¼”`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_utf8.dat' INTO TABLE `T5`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_utf8.dat' INTO TABLE `ï¼´ï¼–`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_utf8.dat' INTO TABLE `ï¼´ï¼—`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_utf8.dat' INTO TABLE `T8`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_utf8.dat' INTO TABLE `ï¼´ï¼™`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_utf8.dat' INTO TABLE `T1ï¼`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_utf8.dat' INTO TABLE `T11`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_utf8.dat' INTO TABLE `T12`; +SELECT * FROM `T1` WHERE `C1` LIKE ' %'; +C1 + !"#$%&'()*+,-./ + 。「」、・ヲァィゥェォャュョッ +SELECT * FROM `T1` WHERE `C1` LIKE '% %'; +C1 + !"#$%&'()*+,-./ + 。「」、・ヲァィゥェォャュョッ +SELECT * FROM `T1` WHERE `C1` LIKE '% '; +C1 +SELECT * FROM `T1` WHERE `C1` LIKE 'ï¾€%'; +C1 +ï¾€ï¾ï¾‚テトナニヌネノハヒフï¾ï¾Žï¾ +SELECT * FROM `T1` WHERE `C1` LIKE '%ラリ%'; +C1 +ï¾ï¾‘メモヤユヨラリルレロワï¾ï¾žï¾Ÿ +SELECT * FROM `T1` WHERE `C1` LIKE '%ソ'; +C1 +ーアイウエオカキクケコサシスセソ +SELECT * FROM `T1` WHERE `C1` LIKE 'ーアイウエオカキクケコサシスセソ%'; +C1 +ーアイウエオカキクケコサシスセソ +SELECT * FROM `T1` WHERE `C1` LIKE '%ーアイウエオカキクケコサシスセソ%'; +C1 +ーアイウエオカキクケコサシスセソ +SELECT * FROM `T1` WHERE `C1` LIKE '%ーアイウエオカキクケコサシスセソ'; +C1 +ーアイウエオカキクケコサシスセソ +SELECT * FROM `ï¼´ï¼’` WHERE `C1` LIKE ' %'; +C1 +  ã€ã€‚,.・:;?ï¼ã‚›ã‚œÂ´ï½€Â¨ï¼¾ï¿£ï¼¿ãƒ½ +SELECT * FROM `ï¼´ï¼’` WHERE `C1` LIKE '% %'; +C1 +  ã€ã€‚,.・:;?ï¼ã‚›ã‚œÂ´ï½€Â¨ï¼¾ï¿£ï¼¿ãƒ½ +・・ʼn♯♭♪†‡¶・・・・◯・・・・  +SELECT * FROM `ï¼´ï¼’` WHERE `C1` LIKE '% '; +C1 +・・ʼn♯♭♪†‡¶・・・・◯・・・・  +SELECT * FROM `ï¼´ï¼’` WHERE `C1` LIKE 'ã¨%'; +C1 +ã¨ã©ãªã«ã¬ã­ã®ã¯ã°ã±ã²ã³ã´ãµã¶ã·ã¸ã¹ãºã» +SELECT * FROM `ï¼´ï¼’` WHERE `C1` LIKE '%ã‚%'; +C1 +・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“ +SELECT * FROM `ï¼´ï¼’` WHERE `C1` LIKE '%ã‚'; +C1 +ã¼ã½ã¾ã¿ã‚€ã‚もゃやゅゆょよらりるれã‚ゎ゠+SELECT * FROM `ï¼´ï¼’` WHERE `C1` LIKE '・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“%'; +C1 +・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“ +SELECT * FROM `ï¼´ï¼’` WHERE `C1` LIKE '%・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“%'; +C1 +・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“ +SELECT * FROM `ï¼´ï¼’` WHERE `C1` LIKE '%・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“'; +C1 +・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“ +SELECT * FROM `T3` WHERE `C1` LIKE '鼫%'; +C1 +鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 +SELECT * FROM `T3` WHERE `C1` LIKE '%鼺%'; +C1 +鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 +SELECT * FROM `T3` WHERE `C1` LIKE '%é½–'; +C1 +鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 +SELECT * FROM `T3` WHERE `C1` LIKE '鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖%'; +C1 +鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 +SELECT * FROM `T3` WHERE `C1` LIKE '%鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖%'; +C1 +鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 +SELECT * FROM `T3` WHERE `C1` LIKE '%鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖'; +C1 +鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 +SELECT * FROM `ï¼´ï¼”` WHERE `C1` LIKE ' %'; +C1 + !"#$%&'()*+,-./ + 。「」、・ヲァィゥェォャュョッ +SELECT * FROM `ï¼´ï¼”` WHERE `C1` LIKE '% %'; +C1 + !"#$%&'()*+,-./ + 。「」、・ヲァィゥェォャュョッ +SELECT * FROM `ï¼´ï¼”` WHERE `C1` LIKE '% '; +C1 +SELECT * FROM `ï¼´ï¼”` WHERE `C1` LIKE 'ï¾€%'; +C1 +ï¾€ï¾ï¾‚テトナニヌネノハヒフï¾ï¾Žï¾ +SELECT * FROM `ï¼´ï¼”` WHERE `C1` LIKE '%ラリ%'; +C1 +ï¾ï¾‘メモヤユヨラリルレロワï¾ï¾žï¾Ÿ +SELECT * FROM `ï¼´ï¼”` WHERE `C1` LIKE '%ソ'; +C1 +ーアイウエオカキクケコサシスセソ +SELECT * FROM `ï¼´ï¼”` WHERE `C1` LIKE 'ーアイウエオカキクケコサシスセソ%'; +C1 +ーアイウエオカキクケコサシスセソ +SELECT * FROM `ï¼´ï¼”` WHERE `C1` LIKE '%ーアイウエオカキクケコサシスセソ%'; +C1 +ーアイウエオカキクケコサシスセソ +SELECT * FROM `ï¼´ï¼”` WHERE `C1` LIKE '%ーアイウエオカキクケコサシスセソ'; +C1 +ーアイウエオカキクケコサシスセソ +SELECT * FROM `T5` WHERE `C1` LIKE ' %'; +C1 +  ã€ã€‚,.・:;?ï¼ã‚›ã‚œÂ´ï½€Â¨ï¼¾ï¿£ï¼¿ãƒ½ +SELECT * FROM `T5` WHERE `C1` LIKE '% %'; +C1 +  ã€ã€‚,.・:;?ï¼ã‚›ã‚œÂ´ï½€Â¨ï¼¾ï¿£ï¼¿ãƒ½ +・・ʼn♯♭♪†‡¶・・・・◯・・・・  +SELECT * FROM `T5` WHERE `C1` LIKE '% '; +C1 +・・ʼn♯♭♪†‡¶・・・・◯・・・・  +SELECT * FROM `T5` WHERE `C1` LIKE 'ã¨%'; +C1 +ã¨ã©ãªã«ã¬ã­ã®ã¯ã°ã±ã²ã³ã´ãµã¶ã·ã¸ã¹ãºã» +SELECT * FROM `T5` WHERE `C1` LIKE '%ã‚%'; +C1 +・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“ +SELECT * FROM `T5` WHERE `C1` LIKE '%ã‚'; +C1 +ã¼ã½ã¾ã¿ã‚€ã‚もゃやゅゆょよらりるれã‚ゎ゠+SELECT * FROM `T5` WHERE `C1` LIKE '・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“%'; +C1 +・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“ +SELECT * FROM `T5` WHERE `C1` LIKE '%・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“%'; +C1 +・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“ +SELECT * FROM `T5` WHERE `C1` LIKE '%・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“'; +C1 +・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“ +SELECT * FROM `ï¼´ï¼–` WHERE `C1` LIKE '鼫%'; +C1 +鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 +SELECT * FROM `ï¼´ï¼–` WHERE `C1` LIKE '%鼺%'; +C1 +鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 +SELECT * FROM `ï¼´ï¼–` WHERE `C1` LIKE '%é½–'; +C1 +鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 +SELECT * FROM `ï¼´ï¼–` WHERE `C1` LIKE '鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖%'; +C1 +鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 +SELECT * FROM `ï¼´ï¼–` WHERE `C1` LIKE '%鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖%'; +C1 +鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 +SELECT * FROM `ï¼´ï¼–` WHERE `C1` LIKE '%鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖'; +C1 +鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 +SELECT * FROM `ï¼´ï¼—` WHERE `C1` LIKE ' %'; +C1 + !"#$%&'()*+,-./ + 。「」、・ヲァィゥェォャュョッ +SELECT * FROM `ï¼´ï¼—` WHERE `C1` LIKE '% %'; +C1 + !"#$%&'()*+,-./ + 。「」、・ヲァィゥェォャュョッ +SELECT * FROM `ï¼´ï¼—` WHERE `C1` LIKE '% '; +C1 +SELECT * FROM `ï¼´ï¼—` WHERE `C1` LIKE 'ï¾€%'; +C1 +ï¾€ï¾ï¾‚テトナニヌネノハヒフï¾ï¾Žï¾ +SELECT * FROM `ï¼´ï¼—` WHERE `C1` LIKE '%ラリ%'; +C1 +ï¾ï¾‘メモヤユヨラリルレロワï¾ï¾žï¾Ÿ +SELECT * FROM `ï¼´ï¼—` WHERE `C1` LIKE '%ソ'; +C1 +ーアイウエオカキクケコサシスセソ +SELECT * FROM `ï¼´ï¼—` WHERE `C1` LIKE 'ーアイウエオカキクケコサシスセソ%'; +C1 +ーアイウエオカキクケコサシスセソ +SELECT * FROM `ï¼´ï¼—` WHERE `C1` LIKE '%ーアイウエオカキクケコサシスセソ%'; +C1 +ーアイウエオカキクケコサシスセソ +SELECT * FROM `ï¼´ï¼—` WHERE `C1` LIKE '%ーアイウエオカキクケコサシスセソ'; +C1 +ーアイウエオカキクケコサシスセソ +SELECT * FROM `T8` WHERE `C1` LIKE ' %'; +C1 +  ã€ã€‚,.・:;?ï¼ã‚›ã‚œÂ´ï½€Â¨ï¼¾ï¿£ï¼¿ãƒ½ +SELECT * FROM `T8` WHERE `C1` LIKE '% %'; +C1 +  ã€ã€‚,.・:;?ï¼ã‚›ã‚œÂ´ï½€Â¨ï¼¾ï¿£ï¼¿ãƒ½ +・・ʼn♯♭♪†‡¶・・・・◯・・・・  +SELECT * FROM `T8` WHERE `C1` LIKE '% '; +C1 +・・ʼn♯♭♪†‡¶・・・・◯・・・・  +SELECT * FROM `T8` WHERE `C1` LIKE 'ã¨%'; +C1 +ã¨ã©ãªã«ã¬ã­ã®ã¯ã°ã±ã²ã³ã´ãµã¶ã·ã¸ã¹ãºã» +SELECT * FROM `T8` WHERE `C1` LIKE '%ã‚%'; +C1 +・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“ +SELECT * FROM `T8` WHERE `C1` LIKE '%ã‚'; +C1 +ã¼ã½ã¾ã¿ã‚€ã‚もゃやゅゆょよらりるれã‚ゎ゠+SELECT * FROM `T8` WHERE `C1` LIKE '・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“%'; +C1 +・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“ +SELECT * FROM `T8` WHERE `C1` LIKE '%・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“%'; +C1 +・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“ +SELECT * FROM `T8` WHERE `C1` LIKE '%・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“'; +C1 +・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“ +SELECT * FROM `ï¼´ï¼™` WHERE `C1` LIKE '鼫%'; +C1 +鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 +SELECT * FROM `ï¼´ï¼™` WHERE `C1` LIKE '%鼺%'; +C1 +鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 +SELECT * FROM `ï¼´ï¼™` WHERE `C1` LIKE '%é½–'; +C1 +鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 +SELECT * FROM `ï¼´ï¼™` WHERE `C1` LIKE '鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖%'; +C1 +鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 +SELECT * FROM `ï¼´ï¼™` WHERE `C1` LIKE '%鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖%'; +C1 +鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 +SELECT * FROM `ï¼´ï¼™` WHERE `C1` LIKE '%鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖'; +C1 +鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 +SELECT * FROM `T1ï¼` WHERE `C1` LIKE ' %'; +C1 + !"#$%&'()*+,-./ + 。「」、・ヲァィゥェォャュョッ +SELECT * FROM `T1ï¼` WHERE `C1` LIKE '% %'; +C1 + !"#$%&'()*+,-./ + 。「」、・ヲァィゥェォャュョッ +SELECT * FROM `T1ï¼` WHERE `C1` LIKE '% '; +C1 +SELECT * FROM `T1ï¼` WHERE `C1` LIKE 'ï¾€%'; +C1 +ï¾€ï¾ï¾‚テトナニヌネノハヒフï¾ï¾Žï¾ +SELECT * FROM `T1ï¼` WHERE `C1` LIKE '%ラリ%'; +C1 +ï¾ï¾‘メモヤユヨラリルレロワï¾ï¾žï¾Ÿ +SELECT * FROM `T1ï¼` WHERE `C1` LIKE '%ソ'; +C1 +ーアイウエオカキクケコサシスセソ +SELECT * FROM `T11` WHERE `C1` LIKE ' %'; +C1 +  ã€ã€‚,.・:;?ï¼ã‚›ã‚œÂ´ï½€Â¨ï¼¾ï¿£ï¼¿ãƒ½ +SELECT * FROM `T11` WHERE `C1` LIKE '% %'; +C1 +  ã€ã€‚,.・:;?ï¼ã‚›ã‚œÂ´ï½€Â¨ï¼¾ï¿£ï¼¿ãƒ½ +・・ʼn♯♭♪†‡¶・・・・◯・・・・  +SELECT * FROM `T11` WHERE `C1` LIKE '% '; +C1 +・・ʼn♯♭♪†‡¶・・・・◯・・・・  +SELECT * FROM `T11` WHERE `C1` LIKE 'ã¨%'; +C1 +ã¨ã©ãªã«ã¬ã­ã®ã¯ã°ã±ã²ã³ã´ãµã¶ã·ã¸ã¹ãºã» +SELECT * FROM `T11` WHERE `C1` LIKE '%ã‚%'; +C1 +・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“ +SELECT * FROM `T11` WHERE `C1` LIKE '%ã‚'; +C1 +ã¼ã½ã¾ã¿ã‚€ã‚もゃやゅゆょよらりるれã‚ゎ゠+SELECT * FROM `T12` WHERE `C1` LIKE '鼫%'; +C1 +鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 +SELECT * FROM `T12` WHERE `C1` LIKE '%鼺%'; +C1 +鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 +SELECT * FROM `T12` WHERE `C1` LIKE '%é½–'; +C1 +鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 +DROP TABLE `T1`; +DROP TABLE `ï¼´ï¼’`; +DROP TABLE `T3`; +DROP TABLE `ï¼´ï¼”`; +DROP TABLE `T5`; +DROP TABLE `ï¼´ï¼–`; +DROP TABLE `ï¼´ï¼—`; +DROP TABLE `T8`; +DROP TABLE `ï¼´ï¼™`; +DROP TABLE `T1ï¼`; +DROP TABLE `T11`; +DROP TABLE `T12`; diff --git a/mysql-test/suite/jp/r/jp_locate_sjis.result b/mysql-test/suite/jp/r/jp_locate_sjis.result new file mode 100755 index 00000000000..b2455401db8 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_locate_sjis.result @@ -0,0 +1,264 @@ +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +SET NAMES sjis; +SET character_set_database = sjis; +CREATE TABLE `‚s‚P` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Q` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚R` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚S` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚T` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚U` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚V` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚W` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚X` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚O` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚P` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚Q` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +INSERT INTO `‚s‚P` VALUES ('±²³´µ'); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚S` VALUES ('±²³´µ'); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚V` VALUES ('±²³´µ'); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ'); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\'); +SELECT LOCATE('±',`‚b‚P`) from `‚s‚P`; +LOCATE('±',`‚b‚P`) +1 +SELECT LOCATE('²',`‚b‚P`) from `‚s‚P`; +LOCATE('²',`‚b‚P`) +2 +SELECT LOCATE('³',`‚b‚P`) from `‚s‚P`; +LOCATE('³',`‚b‚P`) +3 +SELECT LOCATE('´',`‚b‚P`) from `‚s‚P`; +LOCATE('´',`‚b‚P`) +4 +SELECT LOCATE('µ',`‚b‚P`) from `‚s‚P`; +LOCATE('µ',`‚b‚P`) +5 +SELECT LOCATE('Ý',`‚b‚P`) from `‚s‚P`; +LOCATE('Ý',`‚b‚P`) +0 +SELECT LOCATE('‚ ',`‚b‚P`) from `‚s‚Q`; +LOCATE('‚ ',`‚b‚P`) +1 +SELECT LOCATE('‚¢',`‚b‚P`) from `‚s‚Q`; +LOCATE('‚¢',`‚b‚P`) +2 +SELECT LOCATE('‚¤',`‚b‚P`) from `‚s‚Q`; +LOCATE('‚¤',`‚b‚P`) +3 +SELECT LOCATE('‚¦',`‚b‚P`) from `‚s‚Q`; +LOCATE('‚¦',`‚b‚P`) +4 +SELECT LOCATE('‚¨',`‚b‚P`) from `‚s‚Q`; +LOCATE('‚¨',`‚b‚P`) +5 +SELECT LOCATE('‚ñ',`‚b‚P`) from `‚s‚Q`; +LOCATE('‚ñ',`‚b‚P`) +0 +SELECT LOCATE('ƒ\',`‚b‚P`) from `‚s‚R`; +LOCATE('ƒ\',`‚b‚P`) +1 +SELECT LOCATE('\',`‚b‚P`) from `‚s‚R`; +LOCATE('\',`‚b‚P`) +2 +SELECT LOCATE('•\',`‚b‚P`) from `‚s‚R`; +LOCATE('•\',`‚b‚P`) +3 +SELECT LOCATE('—\',`‚b‚P`) from `‚s‚R`; +LOCATE('—\',`‚b‚P`) +4 +SELECT LOCATE('\',`‚b‚P`) from `‚s‚R`; +LOCATE('\',`‚b‚P`) +5 +SELECT LOCATE('‰\',`‚b‚P`) from `‚s‚R`; +LOCATE('‰\',`‚b‚P`) +0 +SELECT LOCATE('±',`‚b‚P`) from `‚s‚S`; +LOCATE('±',`‚b‚P`) +1 +SELECT LOCATE('²',`‚b‚P`) from `‚s‚S`; +LOCATE('²',`‚b‚P`) +2 +SELECT LOCATE('³',`‚b‚P`) from `‚s‚S`; +LOCATE('³',`‚b‚P`) +3 +SELECT LOCATE('´',`‚b‚P`) from `‚s‚S`; +LOCATE('´',`‚b‚P`) +4 +SELECT LOCATE('µ',`‚b‚P`) from `‚s‚S`; +LOCATE('µ',`‚b‚P`) +5 +SELECT LOCATE('Ý',`‚b‚P`) from `‚s‚S`; +LOCATE('Ý',`‚b‚P`) +0 +SELECT LOCATE('‚ ',`‚b‚P`) from `‚s‚T`; +LOCATE('‚ ',`‚b‚P`) +1 +SELECT LOCATE('‚¢',`‚b‚P`) from `‚s‚T`; +LOCATE('‚¢',`‚b‚P`) +2 +SELECT LOCATE('‚¤',`‚b‚P`) from `‚s‚T`; +LOCATE('‚¤',`‚b‚P`) +3 +SELECT LOCATE('‚¦',`‚b‚P`) from `‚s‚T`; +LOCATE('‚¦',`‚b‚P`) +4 +SELECT LOCATE('‚¨',`‚b‚P`) from `‚s‚T`; +LOCATE('‚¨',`‚b‚P`) +5 +SELECT LOCATE('‚ñ',`‚b‚P`) from `‚s‚T`; +LOCATE('‚ñ',`‚b‚P`) +0 +SELECT LOCATE('ƒ\',`‚b‚P`) from `‚s‚U`; +LOCATE('ƒ\',`‚b‚P`) +1 +SELECT LOCATE('\',`‚b‚P`) from `‚s‚U`; +LOCATE('\',`‚b‚P`) +2 +SELECT LOCATE('•\',`‚b‚P`) from `‚s‚U`; +LOCATE('•\',`‚b‚P`) +3 +SELECT LOCATE('—\',`‚b‚P`) from `‚s‚U`; +LOCATE('—\',`‚b‚P`) +4 +SELECT LOCATE('\',`‚b‚P`) from `‚s‚U`; +LOCATE('\',`‚b‚P`) +5 +SELECT LOCATE('‰\',`‚b‚P`) from `‚s‚U`; +LOCATE('‰\',`‚b‚P`) +0 +SELECT LOCATE('±',`‚b‚P`) from `‚s‚V`; +LOCATE('±',`‚b‚P`) +1 +SELECT LOCATE('²',`‚b‚P`) from `‚s‚V`; +LOCATE('²',`‚b‚P`) +2 +SELECT LOCATE('³',`‚b‚P`) from `‚s‚V`; +LOCATE('³',`‚b‚P`) +3 +SELECT LOCATE('´',`‚b‚P`) from `‚s‚V`; +LOCATE('´',`‚b‚P`) +4 +SELECT LOCATE('µ',`‚b‚P`) from `‚s‚V`; +LOCATE('µ',`‚b‚P`) +5 +SELECT LOCATE('Ý',`‚b‚P`) from `‚s‚V`; +LOCATE('Ý',`‚b‚P`) +0 +SELECT LOCATE('‚ ',`‚b‚P`) from `‚s‚W`; +LOCATE('‚ ',`‚b‚P`) +1 +SELECT LOCATE('‚¢',`‚b‚P`) from `‚s‚W`; +LOCATE('‚¢',`‚b‚P`) +2 +SELECT LOCATE('‚¤',`‚b‚P`) from `‚s‚W`; +LOCATE('‚¤',`‚b‚P`) +3 +SELECT LOCATE('‚¦',`‚b‚P`) from `‚s‚W`; +LOCATE('‚¦',`‚b‚P`) +4 +SELECT LOCATE('‚¨',`‚b‚P`) from `‚s‚W`; +LOCATE('‚¨',`‚b‚P`) +5 +SELECT LOCATE('‚ñ',`‚b‚P`) from `‚s‚W`; +LOCATE('‚ñ',`‚b‚P`) +0 +SELECT LOCATE('ƒ\',`‚b‚P`) from `‚s‚X`; +LOCATE('ƒ\',`‚b‚P`) +1 +SELECT LOCATE('\',`‚b‚P`) from `‚s‚X`; +LOCATE('\',`‚b‚P`) +2 +SELECT LOCATE('•\',`‚b‚P`) from `‚s‚X`; +LOCATE('•\',`‚b‚P`) +3 +SELECT LOCATE('—\',`‚b‚P`) from `‚s‚X`; +LOCATE('—\',`‚b‚P`) +4 +SELECT LOCATE('\',`‚b‚P`) from `‚s‚X`; +LOCATE('\',`‚b‚P`) +5 +SELECT LOCATE('‰\',`‚b‚P`) from `‚s‚X`; +LOCATE('‰\',`‚b‚P`) +0 +SELECT LOCATE('±',`‚b‚P`) from `‚s‚P‚O`; +LOCATE('±',`‚b‚P`) +1 +SELECT LOCATE('²',`‚b‚P`) from `‚s‚P‚O`; +LOCATE('²',`‚b‚P`) +2 +SELECT LOCATE('³',`‚b‚P`) from `‚s‚P‚O`; +LOCATE('³',`‚b‚P`) +3 +SELECT LOCATE('´',`‚b‚P`) from `‚s‚P‚O`; +LOCATE('´',`‚b‚P`) +4 +SELECT LOCATE('µ',`‚b‚P`) from `‚s‚P‚O`; +LOCATE('µ',`‚b‚P`) +5 +SELECT LOCATE('Ý',`‚b‚P`) from `‚s‚P‚O`; +LOCATE('Ý',`‚b‚P`) +0 +SELECT LOCATE('‚ ',`‚b‚P`) from `‚s‚P‚P`; +LOCATE('‚ ',`‚b‚P`) +1 +SELECT LOCATE('‚¢',`‚b‚P`) from `‚s‚P‚P`; +LOCATE('‚¢',`‚b‚P`) +2 +SELECT LOCATE('‚¤',`‚b‚P`) from `‚s‚P‚P`; +LOCATE('‚¤',`‚b‚P`) +3 +SELECT LOCATE('‚¦',`‚b‚P`) from `‚s‚P‚P`; +LOCATE('‚¦',`‚b‚P`) +4 +SELECT LOCATE('‚¨',`‚b‚P`) from `‚s‚P‚P`; +LOCATE('‚¨',`‚b‚P`) +5 +SELECT LOCATE('‚ñ',`‚b‚P`) from `‚s‚P‚P`; +LOCATE('‚ñ',`‚b‚P`) +0 +SELECT LOCATE('ƒ\',`‚b‚P`) from `‚s‚P‚Q`; +LOCATE('ƒ\',`‚b‚P`) +1 +SELECT LOCATE('\',`‚b‚P`) from `‚s‚P‚Q`; +LOCATE('\',`‚b‚P`) +2 +SELECT LOCATE('•\',`‚b‚P`) from `‚s‚P‚Q`; +LOCATE('•\',`‚b‚P`) +3 +SELECT LOCATE('—\',`‚b‚P`) from `‚s‚P‚Q`; +LOCATE('—\',`‚b‚P`) +4 +SELECT LOCATE('\',`‚b‚P`) from `‚s‚P‚Q`; +LOCATE('\',`‚b‚P`) +5 +SELECT LOCATE('‰\',`‚b‚P`) from `‚s‚P‚Q`; +LOCATE('‰\',`‚b‚P`) +0 +DROP TABLE `‚s‚P`; +DROP TABLE `‚s‚Q`; +DROP TABLE `‚s‚R`; +DROP TABLE `‚s‚S`; +DROP TABLE `‚s‚T`; +DROP TABLE `‚s‚U`; +DROP TABLE `‚s‚V`; +DROP TABLE `‚s‚W`; +DROP TABLE `‚s‚X`; +DROP TABLE `‚s‚P‚O`; +DROP TABLE `‚s‚P‚P`; +DROP TABLE `‚s‚P‚Q`; diff --git a/mysql-test/suite/jp/r/jp_locate_ucs2.result b/mysql-test/suite/jp/r/jp_locate_ucs2.result new file mode 100755 index 00000000000..37b219b3335 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_locate_ucs2.result @@ -0,0 +1,265 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; +CREATE TABLE `£Ô£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'); +SELECT LOCATE('ޱ',`£Ã£±`) from `£Ô£±`; +LOCATE('ޱ',`£Ã£±`) +1 +SELECT LOCATE('޲',`£Ã£±`) from `£Ô£±`; +LOCATE('޲',`£Ã£±`) +2 +SELECT LOCATE('޳',`£Ã£±`) from `£Ô£±`; +LOCATE('޳',`£Ã£±`) +3 +SELECT LOCATE('Ž´',`£Ã£±`) from `£Ô£±`; +LOCATE('Ž´',`£Ã£±`) +4 +SELECT LOCATE('޵',`£Ã£±`) from `£Ô£±`; +LOCATE('޵',`£Ã£±`) +5 +SELECT LOCATE('ŽÝ',`£Ã£±`) from `£Ô£±`; +LOCATE('ŽÝ',`£Ã£±`) +0 +SELECT LOCATE('¤¢',`£Ã£±`) from `£Ô£²`; +LOCATE('¤¢',`£Ã£±`) +1 +SELECT LOCATE('¤¤',`£Ã£±`) from `£Ô£²`; +LOCATE('¤¤',`£Ã£±`) +2 +SELECT LOCATE('¤¦',`£Ã£±`) from `£Ô£²`; +LOCATE('¤¦',`£Ã£±`) +3 +SELECT LOCATE('¤¨',`£Ã£±`) from `£Ô£²`; +LOCATE('¤¨',`£Ã£±`) +4 +SELECT LOCATE('¤ª',`£Ã£±`) from `£Ô£²`; +LOCATE('¤ª',`£Ã£±`) +5 +SELECT LOCATE('¤ó',`£Ã£±`) from `£Ô£²`; +LOCATE('¤ó',`£Ã£±`) +0 +SELECT LOCATE('íÜ',`£Ã£±`) from `£Ô£³`; +LOCATE('íÜ',`£Ã£±`) +1 +SELECT LOCATE('íÝ',`£Ã£±`) from `£Ô£³`; +LOCATE('íÝ',`£Ã£±`) +2 +SELECT LOCATE('íÞ',`£Ã£±`) from `£Ô£³`; +LOCATE('íÞ',`£Ã£±`) +3 +SELECT LOCATE('íß',`£Ã£±`) from `£Ô£³`; +LOCATE('íß',`£Ã£±`) +4 +SELECT LOCATE('íà',`£Ã£±`) from `£Ô£³`; +LOCATE('íà',`£Ã£±`) +5 +SELECT LOCATE('°¡',`£Ã£±`) from `£Ô£³`; +LOCATE('°¡',`£Ã£±`) +0 +SELECT LOCATE('ޱ',`£Ã£±`) from `£Ô£´`; +LOCATE('ޱ',`£Ã£±`) +1 +SELECT LOCATE('޲',`£Ã£±`) from `£Ô£´`; +LOCATE('޲',`£Ã£±`) +2 +SELECT LOCATE('޳',`£Ã£±`) from `£Ô£´`; +LOCATE('޳',`£Ã£±`) +3 +SELECT LOCATE('Ž´',`£Ã£±`) from `£Ô£´`; +LOCATE('Ž´',`£Ã£±`) +4 +SELECT LOCATE('޵',`£Ã£±`) from `£Ô£´`; +LOCATE('޵',`£Ã£±`) +5 +SELECT LOCATE('ŽÝ',`£Ã£±`) from `£Ô£´`; +LOCATE('ŽÝ',`£Ã£±`) +0 +SELECT LOCATE('¤¢',`£Ã£±`) from `£Ô£µ`; +LOCATE('¤¢',`£Ã£±`) +1 +SELECT LOCATE('¤¤',`£Ã£±`) from `£Ô£µ`; +LOCATE('¤¤',`£Ã£±`) +2 +SELECT LOCATE('¤¦',`£Ã£±`) from `£Ô£µ`; +LOCATE('¤¦',`£Ã£±`) +3 +SELECT LOCATE('¤¨',`£Ã£±`) from `£Ô£µ`; +LOCATE('¤¨',`£Ã£±`) +4 +SELECT LOCATE('¤ª',`£Ã£±`) from `£Ô£µ`; +LOCATE('¤ª',`£Ã£±`) +5 +SELECT LOCATE('¤ó',`£Ã£±`) from `£Ô£µ`; +LOCATE('¤ó',`£Ã£±`) +0 +SELECT LOCATE('íÜ',`£Ã£±`) from `£Ô£¶`; +LOCATE('íÜ',`£Ã£±`) +1 +SELECT LOCATE('íÝ',`£Ã£±`) from `£Ô£¶`; +LOCATE('íÝ',`£Ã£±`) +2 +SELECT LOCATE('íÞ',`£Ã£±`) from `£Ô£¶`; +LOCATE('íÞ',`£Ã£±`) +3 +SELECT LOCATE('íß',`£Ã£±`) from `£Ô£¶`; +LOCATE('íß',`£Ã£±`) +4 +SELECT LOCATE('íà',`£Ã£±`) from `£Ô£¶`; +LOCATE('íà',`£Ã£±`) +5 +SELECT LOCATE('°¡',`£Ã£±`) from `£Ô£¶`; +LOCATE('°¡',`£Ã£±`) +0 +SELECT LOCATE('ޱ',`£Ã£±`) from `£Ô£·`; +LOCATE('ޱ',`£Ã£±`) +1 +SELECT LOCATE('޲',`£Ã£±`) from `£Ô£·`; +LOCATE('޲',`£Ã£±`) +2 +SELECT LOCATE('޳',`£Ã£±`) from `£Ô£·`; +LOCATE('޳',`£Ã£±`) +3 +SELECT LOCATE('Ž´',`£Ã£±`) from `£Ô£·`; +LOCATE('Ž´',`£Ã£±`) +4 +SELECT LOCATE('޵',`£Ã£±`) from `£Ô£·`; +LOCATE('޵',`£Ã£±`) +5 +SELECT LOCATE('ŽÝ',`£Ã£±`) from `£Ô£·`; +LOCATE('ŽÝ',`£Ã£±`) +0 +SELECT LOCATE('¤¢',`£Ã£±`) from `£Ô£¸`; +LOCATE('¤¢',`£Ã£±`) +1 +SELECT LOCATE('¤¤',`£Ã£±`) from `£Ô£¸`; +LOCATE('¤¤',`£Ã£±`) +2 +SELECT LOCATE('¤¦',`£Ã£±`) from `£Ô£¸`; +LOCATE('¤¦',`£Ã£±`) +3 +SELECT LOCATE('¤¨',`£Ã£±`) from `£Ô£¸`; +LOCATE('¤¨',`£Ã£±`) +4 +SELECT LOCATE('¤ª',`£Ã£±`) from `£Ô£¸`; +LOCATE('¤ª',`£Ã£±`) +5 +SELECT LOCATE('¤ó',`£Ã£±`) from `£Ô£¸`; +LOCATE('¤ó',`£Ã£±`) +0 +SELECT LOCATE('íÜ',`£Ã£±`) from `£Ô£¹`; +LOCATE('íÜ',`£Ã£±`) +1 +SELECT LOCATE('íÝ',`£Ã£±`) from `£Ô£¹`; +LOCATE('íÝ',`£Ã£±`) +2 +SELECT LOCATE('íÞ',`£Ã£±`) from `£Ô£¹`; +LOCATE('íÞ',`£Ã£±`) +3 +SELECT LOCATE('íß',`£Ã£±`) from `£Ô£¹`; +LOCATE('íß',`£Ã£±`) +4 +SELECT LOCATE('íà',`£Ã£±`) from `£Ô£¹`; +LOCATE('íà',`£Ã£±`) +5 +SELECT LOCATE('°¡',`£Ã£±`) from `£Ô£¹`; +LOCATE('°¡',`£Ã£±`) +0 +SELECT LOCATE('ޱ',`£Ã£±`) from `£Ô£±£°`; +LOCATE('ޱ',`£Ã£±`) +1 +SELECT LOCATE('޲',`£Ã£±`) from `£Ô£±£°`; +LOCATE('޲',`£Ã£±`) +2 +SELECT LOCATE('޳',`£Ã£±`) from `£Ô£±£°`; +LOCATE('޳',`£Ã£±`) +3 +SELECT LOCATE('Ž´',`£Ã£±`) from `£Ô£±£°`; +LOCATE('Ž´',`£Ã£±`) +4 +SELECT LOCATE('޵',`£Ã£±`) from `£Ô£±£°`; +LOCATE('޵',`£Ã£±`) +5 +SELECT LOCATE('ŽÝ',`£Ã£±`) from `£Ô£±£°`; +LOCATE('ŽÝ',`£Ã£±`) +0 +SELECT LOCATE('¤¢',`£Ã£±`) from `£Ô£±£±`; +LOCATE('¤¢',`£Ã£±`) +1 +SELECT LOCATE('¤¤',`£Ã£±`) from `£Ô£±£±`; +LOCATE('¤¤',`£Ã£±`) +2 +SELECT LOCATE('¤¦',`£Ã£±`) from `£Ô£±£±`; +LOCATE('¤¦',`£Ã£±`) +3 +SELECT LOCATE('¤¨',`£Ã£±`) from `£Ô£±£±`; +LOCATE('¤¨',`£Ã£±`) +4 +SELECT LOCATE('¤ª',`£Ã£±`) from `£Ô£±£±`; +LOCATE('¤ª',`£Ã£±`) +5 +SELECT LOCATE('¤ó',`£Ã£±`) from `£Ô£±£±`; +LOCATE('¤ó',`£Ã£±`) +0 +SELECT LOCATE('íÜ',`£Ã£±`) from `£Ô£±£²`; +LOCATE('íÜ',`£Ã£±`) +1 +SELECT LOCATE('íÝ',`£Ã£±`) from `£Ô£±£²`; +LOCATE('íÝ',`£Ã£±`) +2 +SELECT LOCATE('íÞ',`£Ã£±`) from `£Ô£±£²`; +LOCATE('íÞ',`£Ã£±`) +3 +SELECT LOCATE('íß',`£Ã£±`) from `£Ô£±£²`; +LOCATE('íß',`£Ã£±`) +4 +SELECT LOCATE('íà',`£Ã£±`) from `£Ô£±£²`; +LOCATE('íà',`£Ã£±`) +5 +SELECT LOCATE('°¡',`£Ã£±`) from `£Ô£±£²`; +LOCATE('°¡',`£Ã£±`) +0 +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/r/jp_locate_ujis.result b/mysql-test/suite/jp/r/jp_locate_ujis.result new file mode 100755 index 00000000000..d139fa9203c --- /dev/null +++ b/mysql-test/suite/jp/r/jp_locate_ujis.result @@ -0,0 +1,264 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +SET NAMES ujis; +SET character_set_database = ujis; +CREATE TABLE `£Ô£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'); +SELECT LOCATE('ޱ',`£Ã£±`) from `£Ô£±`; +LOCATE('ޱ',`£Ã£±`) +1 +SELECT LOCATE('޲',`£Ã£±`) from `£Ô£±`; +LOCATE('޲',`£Ã£±`) +2 +SELECT LOCATE('޳',`£Ã£±`) from `£Ô£±`; +LOCATE('޳',`£Ã£±`) +3 +SELECT LOCATE('Ž´',`£Ã£±`) from `£Ô£±`; +LOCATE('Ž´',`£Ã£±`) +4 +SELECT LOCATE('޵',`£Ã£±`) from `£Ô£±`; +LOCATE('޵',`£Ã£±`) +5 +SELECT LOCATE('ŽÝ',`£Ã£±`) from `£Ô£±`; +LOCATE('ŽÝ',`£Ã£±`) +0 +SELECT LOCATE('¤¢',`£Ã£±`) from `£Ô£²`; +LOCATE('¤¢',`£Ã£±`) +1 +SELECT LOCATE('¤¤',`£Ã£±`) from `£Ô£²`; +LOCATE('¤¤',`£Ã£±`) +2 +SELECT LOCATE('¤¦',`£Ã£±`) from `£Ô£²`; +LOCATE('¤¦',`£Ã£±`) +3 +SELECT LOCATE('¤¨',`£Ã£±`) from `£Ô£²`; +LOCATE('¤¨',`£Ã£±`) +4 +SELECT LOCATE('¤ª',`£Ã£±`) from `£Ô£²`; +LOCATE('¤ª',`£Ã£±`) +5 +SELECT LOCATE('¤ó',`£Ã£±`) from `£Ô£²`; +LOCATE('¤ó',`£Ã£±`) +0 +SELECT LOCATE('íÜ',`£Ã£±`) from `£Ô£³`; +LOCATE('íÜ',`£Ã£±`) +1 +SELECT LOCATE('íÝ',`£Ã£±`) from `£Ô£³`; +LOCATE('íÝ',`£Ã£±`) +2 +SELECT LOCATE('íÞ',`£Ã£±`) from `£Ô£³`; +LOCATE('íÞ',`£Ã£±`) +3 +SELECT LOCATE('íß',`£Ã£±`) from `£Ô£³`; +LOCATE('íß',`£Ã£±`) +4 +SELECT LOCATE('íà',`£Ã£±`) from `£Ô£³`; +LOCATE('íà',`£Ã£±`) +5 +SELECT LOCATE('°¡',`£Ã£±`) from `£Ô£³`; +LOCATE('°¡',`£Ã£±`) +0 +SELECT LOCATE('ޱ',`£Ã£±`) from `£Ô£´`; +LOCATE('ޱ',`£Ã£±`) +1 +SELECT LOCATE('޲',`£Ã£±`) from `£Ô£´`; +LOCATE('޲',`£Ã£±`) +2 +SELECT LOCATE('޳',`£Ã£±`) from `£Ô£´`; +LOCATE('޳',`£Ã£±`) +3 +SELECT LOCATE('Ž´',`£Ã£±`) from `£Ô£´`; +LOCATE('Ž´',`£Ã£±`) +4 +SELECT LOCATE('޵',`£Ã£±`) from `£Ô£´`; +LOCATE('޵',`£Ã£±`) +5 +SELECT LOCATE('ŽÝ',`£Ã£±`) from `£Ô£´`; +LOCATE('ŽÝ',`£Ã£±`) +0 +SELECT LOCATE('¤¢',`£Ã£±`) from `£Ô£µ`; +LOCATE('¤¢',`£Ã£±`) +1 +SELECT LOCATE('¤¤',`£Ã£±`) from `£Ô£µ`; +LOCATE('¤¤',`£Ã£±`) +2 +SELECT LOCATE('¤¦',`£Ã£±`) from `£Ô£µ`; +LOCATE('¤¦',`£Ã£±`) +3 +SELECT LOCATE('¤¨',`£Ã£±`) from `£Ô£µ`; +LOCATE('¤¨',`£Ã£±`) +4 +SELECT LOCATE('¤ª',`£Ã£±`) from `£Ô£µ`; +LOCATE('¤ª',`£Ã£±`) +5 +SELECT LOCATE('¤ó',`£Ã£±`) from `£Ô£µ`; +LOCATE('¤ó',`£Ã£±`) +0 +SELECT LOCATE('íÜ',`£Ã£±`) from `£Ô£¶`; +LOCATE('íÜ',`£Ã£±`) +1 +SELECT LOCATE('íÝ',`£Ã£±`) from `£Ô£¶`; +LOCATE('íÝ',`£Ã£±`) +2 +SELECT LOCATE('íÞ',`£Ã£±`) from `£Ô£¶`; +LOCATE('íÞ',`£Ã£±`) +3 +SELECT LOCATE('íß',`£Ã£±`) from `£Ô£¶`; +LOCATE('íß',`£Ã£±`) +4 +SELECT LOCATE('íà',`£Ã£±`) from `£Ô£¶`; +LOCATE('íà',`£Ã£±`) +5 +SELECT LOCATE('°¡',`£Ã£±`) from `£Ô£¶`; +LOCATE('°¡',`£Ã£±`) +0 +SELECT LOCATE('ޱ',`£Ã£±`) from `£Ô£·`; +LOCATE('ޱ',`£Ã£±`) +1 +SELECT LOCATE('޲',`£Ã£±`) from `£Ô£·`; +LOCATE('޲',`£Ã£±`) +2 +SELECT LOCATE('޳',`£Ã£±`) from `£Ô£·`; +LOCATE('޳',`£Ã£±`) +3 +SELECT LOCATE('Ž´',`£Ã£±`) from `£Ô£·`; +LOCATE('Ž´',`£Ã£±`) +4 +SELECT LOCATE('޵',`£Ã£±`) from `£Ô£·`; +LOCATE('޵',`£Ã£±`) +5 +SELECT LOCATE('ŽÝ',`£Ã£±`) from `£Ô£·`; +LOCATE('ŽÝ',`£Ã£±`) +0 +SELECT LOCATE('¤¢',`£Ã£±`) from `£Ô£¸`; +LOCATE('¤¢',`£Ã£±`) +1 +SELECT LOCATE('¤¤',`£Ã£±`) from `£Ô£¸`; +LOCATE('¤¤',`£Ã£±`) +2 +SELECT LOCATE('¤¦',`£Ã£±`) from `£Ô£¸`; +LOCATE('¤¦',`£Ã£±`) +3 +SELECT LOCATE('¤¨',`£Ã£±`) from `£Ô£¸`; +LOCATE('¤¨',`£Ã£±`) +4 +SELECT LOCATE('¤ª',`£Ã£±`) from `£Ô£¸`; +LOCATE('¤ª',`£Ã£±`) +5 +SELECT LOCATE('¤ó',`£Ã£±`) from `£Ô£¸`; +LOCATE('¤ó',`£Ã£±`) +0 +SELECT LOCATE('íÜ',`£Ã£±`) from `£Ô£¹`; +LOCATE('íÜ',`£Ã£±`) +1 +SELECT LOCATE('íÝ',`£Ã£±`) from `£Ô£¹`; +LOCATE('íÝ',`£Ã£±`) +2 +SELECT LOCATE('íÞ',`£Ã£±`) from `£Ô£¹`; +LOCATE('íÞ',`£Ã£±`) +3 +SELECT LOCATE('íß',`£Ã£±`) from `£Ô£¹`; +LOCATE('íß',`£Ã£±`) +4 +SELECT LOCATE('íà',`£Ã£±`) from `£Ô£¹`; +LOCATE('íà',`£Ã£±`) +5 +SELECT LOCATE('°¡',`£Ã£±`) from `£Ô£¹`; +LOCATE('°¡',`£Ã£±`) +0 +SELECT LOCATE('ޱ',`£Ã£±`) from `£Ô£±£°`; +LOCATE('ޱ',`£Ã£±`) +1 +SELECT LOCATE('޲',`£Ã£±`) from `£Ô£±£°`; +LOCATE('޲',`£Ã£±`) +2 +SELECT LOCATE('޳',`£Ã£±`) from `£Ô£±£°`; +LOCATE('޳',`£Ã£±`) +3 +SELECT LOCATE('Ž´',`£Ã£±`) from `£Ô£±£°`; +LOCATE('Ž´',`£Ã£±`) +4 +SELECT LOCATE('޵',`£Ã£±`) from `£Ô£±£°`; +LOCATE('޵',`£Ã£±`) +5 +SELECT LOCATE('ŽÝ',`£Ã£±`) from `£Ô£±£°`; +LOCATE('ŽÝ',`£Ã£±`) +0 +SELECT LOCATE('¤¢',`£Ã£±`) from `£Ô£±£±`; +LOCATE('¤¢',`£Ã£±`) +1 +SELECT LOCATE('¤¤',`£Ã£±`) from `£Ô£±£±`; +LOCATE('¤¤',`£Ã£±`) +2 +SELECT LOCATE('¤¦',`£Ã£±`) from `£Ô£±£±`; +LOCATE('¤¦',`£Ã£±`) +3 +SELECT LOCATE('¤¨',`£Ã£±`) from `£Ô£±£±`; +LOCATE('¤¨',`£Ã£±`) +4 +SELECT LOCATE('¤ª',`£Ã£±`) from `£Ô£±£±`; +LOCATE('¤ª',`£Ã£±`) +5 +SELECT LOCATE('¤ó',`£Ã£±`) from `£Ô£±£±`; +LOCATE('¤ó',`£Ã£±`) +0 +SELECT LOCATE('íÜ',`£Ã£±`) from `£Ô£±£²`; +LOCATE('íÜ',`£Ã£±`) +1 +SELECT LOCATE('íÝ',`£Ã£±`) from `£Ô£±£²`; +LOCATE('íÝ',`£Ã£±`) +2 +SELECT LOCATE('íÞ',`£Ã£±`) from `£Ô£±£²`; +LOCATE('íÞ',`£Ã£±`) +3 +SELECT LOCATE('íß',`£Ã£±`) from `£Ô£±£²`; +LOCATE('íß',`£Ã£±`) +4 +SELECT LOCATE('íà',`£Ã£±`) from `£Ô£±£²`; +LOCATE('íà',`£Ã£±`) +5 +SELECT LOCATE('°¡',`£Ã£±`) from `£Ô£±£²`; +LOCATE('°¡',`£Ã£±`) +0 +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/r/jp_locate_utf8.result b/mysql-test/suite/jp/r/jp_locate_utf8.result new file mode 100755 index 00000000000..a1ce9e8d2dc --- /dev/null +++ b/mysql-test/suite/jp/r/jp_locate_utf8.result @@ -0,0 +1,264 @@ +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +SET NAMES utf8; +SET character_set_database = utf8; +CREATE TABLE `T1` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T11` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T12` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +INSERT INTO `T1` VALUES ('アイウエオ'); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T3` VALUES ('龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオ'); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオ'); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡'); +INSERT INTO `T1ï¼` VALUES ('アイウエオ'); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T12` VALUES ('龔龖龗龞龡'); +SELECT LOCATE('ï½±',`C1`) from `T1`; +LOCATE('ï½±',`C1`) +1 +SELECT LOCATE('ï½²',`C1`) from `T1`; +LOCATE('ï½²',`C1`) +2 +SELECT LOCATE('ï½³',`C1`) from `T1`; +LOCATE('ï½³',`C1`) +3 +SELECT LOCATE('ï½´',`C1`) from `T1`; +LOCATE('ï½´',`C1`) +4 +SELECT LOCATE('ï½µ',`C1`) from `T1`; +LOCATE('ï½µ',`C1`) +5 +SELECT LOCATE('ï¾',`C1`) from `T1`; +LOCATE('ï¾',`C1`) +0 +SELECT LOCATE('ã‚',`C1`) from `ï¼´ï¼’`; +LOCATE('ã‚',`C1`) +1 +SELECT LOCATE('ã„',`C1`) from `ï¼´ï¼’`; +LOCATE('ã„',`C1`) +2 +SELECT LOCATE('ã†',`C1`) from `ï¼´ï¼’`; +LOCATE('ã†',`C1`) +3 +SELECT LOCATE('ãˆ',`C1`) from `ï¼´ï¼’`; +LOCATE('ãˆ',`C1`) +4 +SELECT LOCATE('ãŠ',`C1`) from `ï¼´ï¼’`; +LOCATE('ãŠ',`C1`) +5 +SELECT LOCATE('ã‚“',`C1`) from `ï¼´ï¼’`; +LOCATE('ã‚“',`C1`) +0 +SELECT LOCATE('é¾”',`C1`) from `T3`; +LOCATE('é¾”',`C1`) +1 +SELECT LOCATE('é¾–',`C1`) from `T3`; +LOCATE('é¾–',`C1`) +2 +SELECT LOCATE('é¾—',`C1`) from `T3`; +LOCATE('é¾—',`C1`) +3 +SELECT LOCATE('龞',`C1`) from `T3`; +LOCATE('龞',`C1`) +4 +SELECT LOCATE('龡',`C1`) from `T3`; +LOCATE('龡',`C1`) +5 +SELECT LOCATE('丂',`C1`) from `T3`; +LOCATE('丂',`C1`) +0 +SELECT LOCATE('ï½±',`C1`) from `ï¼´ï¼”`; +LOCATE('ï½±',`C1`) +1 +SELECT LOCATE('ï½²',`C1`) from `ï¼´ï¼”`; +LOCATE('ï½²',`C1`) +2 +SELECT LOCATE('ï½³',`C1`) from `ï¼´ï¼”`; +LOCATE('ï½³',`C1`) +3 +SELECT LOCATE('ï½´',`C1`) from `ï¼´ï¼”`; +LOCATE('ï½´',`C1`) +4 +SELECT LOCATE('ï½µ',`C1`) from `ï¼´ï¼”`; +LOCATE('ï½µ',`C1`) +5 +SELECT LOCATE('ï¾',`C1`) from `ï¼´ï¼”`; +LOCATE('ï¾',`C1`) +0 +SELECT LOCATE('ã‚',`C1`) from `T5`; +LOCATE('ã‚',`C1`) +1 +SELECT LOCATE('ã„',`C1`) from `T5`; +LOCATE('ã„',`C1`) +2 +SELECT LOCATE('ã†',`C1`) from `T5`; +LOCATE('ã†',`C1`) +3 +SELECT LOCATE('ãˆ',`C1`) from `T5`; +LOCATE('ãˆ',`C1`) +4 +SELECT LOCATE('ãŠ',`C1`) from `T5`; +LOCATE('ãŠ',`C1`) +5 +SELECT LOCATE('ã‚“',`C1`) from `T5`; +LOCATE('ã‚“',`C1`) +0 +SELECT LOCATE('é¾”',`C1`) from `ï¼´ï¼–`; +LOCATE('é¾”',`C1`) +1 +SELECT LOCATE('é¾–',`C1`) from `ï¼´ï¼–`; +LOCATE('é¾–',`C1`) +2 +SELECT LOCATE('é¾—',`C1`) from `ï¼´ï¼–`; +LOCATE('é¾—',`C1`) +3 +SELECT LOCATE('龞',`C1`) from `ï¼´ï¼–`; +LOCATE('龞',`C1`) +4 +SELECT LOCATE('龡',`C1`) from `ï¼´ï¼–`; +LOCATE('龡',`C1`) +5 +SELECT LOCATE('丂',`C1`) from `ï¼´ï¼–`; +LOCATE('丂',`C1`) +0 +SELECT LOCATE('ï½±',`C1`) from `ï¼´ï¼—`; +LOCATE('ï½±',`C1`) +1 +SELECT LOCATE('ï½²',`C1`) from `ï¼´ï¼—`; +LOCATE('ï½²',`C1`) +2 +SELECT LOCATE('ï½³',`C1`) from `ï¼´ï¼—`; +LOCATE('ï½³',`C1`) +3 +SELECT LOCATE('ï½´',`C1`) from `ï¼´ï¼—`; +LOCATE('ï½´',`C1`) +4 +SELECT LOCATE('ï½µ',`C1`) from `ï¼´ï¼—`; +LOCATE('ï½µ',`C1`) +5 +SELECT LOCATE('ï¾',`C1`) from `ï¼´ï¼—`; +LOCATE('ï¾',`C1`) +0 +SELECT LOCATE('ã‚',`C1`) from `T8`; +LOCATE('ã‚',`C1`) +1 +SELECT LOCATE('ã„',`C1`) from `T8`; +LOCATE('ã„',`C1`) +2 +SELECT LOCATE('ã†',`C1`) from `T8`; +LOCATE('ã†',`C1`) +3 +SELECT LOCATE('ãˆ',`C1`) from `T8`; +LOCATE('ãˆ',`C1`) +4 +SELECT LOCATE('ãŠ',`C1`) from `T8`; +LOCATE('ãŠ',`C1`) +5 +SELECT LOCATE('ã‚“',`C1`) from `T8`; +LOCATE('ã‚“',`C1`) +0 +SELECT LOCATE('é¾”',`C1`) from `ï¼´ï¼™`; +LOCATE('é¾”',`C1`) +1 +SELECT LOCATE('é¾–',`C1`) from `ï¼´ï¼™`; +LOCATE('é¾–',`C1`) +2 +SELECT LOCATE('é¾—',`C1`) from `ï¼´ï¼™`; +LOCATE('é¾—',`C1`) +3 +SELECT LOCATE('龞',`C1`) from `ï¼´ï¼™`; +LOCATE('龞',`C1`) +4 +SELECT LOCATE('龡',`C1`) from `ï¼´ï¼™`; +LOCATE('龡',`C1`) +5 +SELECT LOCATE('丂',`C1`) from `ï¼´ï¼™`; +LOCATE('丂',`C1`) +0 +SELECT LOCATE('ï½±',`C1`) from `T1ï¼`; +LOCATE('ï½±',`C1`) +1 +SELECT LOCATE('ï½²',`C1`) from `T1ï¼`; +LOCATE('ï½²',`C1`) +2 +SELECT LOCATE('ï½³',`C1`) from `T1ï¼`; +LOCATE('ï½³',`C1`) +3 +SELECT LOCATE('ï½´',`C1`) from `T1ï¼`; +LOCATE('ï½´',`C1`) +4 +SELECT LOCATE('ï½µ',`C1`) from `T1ï¼`; +LOCATE('ï½µ',`C1`) +5 +SELECT LOCATE('ï¾',`C1`) from `T1ï¼`; +LOCATE('ï¾',`C1`) +0 +SELECT LOCATE('ã‚',`C1`) from `T11`; +LOCATE('ã‚',`C1`) +1 +SELECT LOCATE('ã„',`C1`) from `T11`; +LOCATE('ã„',`C1`) +2 +SELECT LOCATE('ã†',`C1`) from `T11`; +LOCATE('ã†',`C1`) +3 +SELECT LOCATE('ãˆ',`C1`) from `T11`; +LOCATE('ãˆ',`C1`) +4 +SELECT LOCATE('ãŠ',`C1`) from `T11`; +LOCATE('ãŠ',`C1`) +5 +SELECT LOCATE('ã‚“',`C1`) from `T11`; +LOCATE('ã‚“',`C1`) +0 +SELECT LOCATE('é¾”',`C1`) from `T12`; +LOCATE('é¾”',`C1`) +1 +SELECT LOCATE('é¾–',`C1`) from `T12`; +LOCATE('é¾–',`C1`) +2 +SELECT LOCATE('é¾—',`C1`) from `T12`; +LOCATE('é¾—',`C1`) +3 +SELECT LOCATE('龞',`C1`) from `T12`; +LOCATE('龞',`C1`) +4 +SELECT LOCATE('龡',`C1`) from `T12`; +LOCATE('龡',`C1`) +5 +SELECT LOCATE('丂',`C1`) from `T12`; +LOCATE('丂',`C1`) +0 +DROP TABLE `T1`; +DROP TABLE `ï¼´ï¼’`; +DROP TABLE `T3`; +DROP TABLE `ï¼´ï¼”`; +DROP TABLE `T5`; +DROP TABLE `ï¼´ï¼–`; +DROP TABLE `ï¼´ï¼—`; +DROP TABLE `T8`; +DROP TABLE `ï¼´ï¼™`; +DROP TABLE `T1ï¼`; +DROP TABLE `T11`; +DROP TABLE `T12`; diff --git a/mysql-test/suite/jp/r/jp_lpad_sjis.result b/mysql-test/suite/jp/r/jp_lpad_sjis.result new file mode 100755 index 00000000000..b45427ebf3d --- /dev/null +++ b/mysql-test/suite/jp/r/jp_lpad_sjis.result @@ -0,0 +1,146 @@ +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +drop table if exists `‚s‚P‚P`; +drop table if exists `‚s‚P‚Q`; +SET NAMES sjis; +SET character_set_database = sjis; +CREATE TABLE `‚s‚P` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Q` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚R` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚S` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚T` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚U` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚V` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚W` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚X` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚O` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚P` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚Q` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +INSERT INTO `‚s‚P` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +INSERT INTO `‚s‚S` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +INSERT INTO `‚s‚V` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +SELECT `‚b‚P`, LPAD(`‚b‚P`,5,'¡') FROM `‚s‚P`; +‚b‚P LPAD(`‚b‚P`,5,'¡') + ¡¡¡¡¡ +± ¡¡¡¡± +±² ¡¡¡±² +±²³ ¡¡±²³ +±²³´ ¡±²³´ +±²³´µ ±²³´µ +SELECT `‚b‚P`, LPAD(`‚b‚P`,5,'‚w') FROM `‚s‚Q`; +‚b‚P LPAD(`‚b‚P`,5,'‚w') + ‚w‚w‚w‚w‚w +‚  ‚w‚w‚w‚w‚  +‚ ‚¢ ‚w‚w‚w‚ ‚¢ +‚ ‚¢‚¤ ‚w‚w‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚w‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`, LPAD(`‚b‚P`,5,'–\') FROM `‚s‚R`; +‚b‚P LPAD(`‚b‚P`,5,'–\') + –\–\–\–\–\ +ƒ\ –\–\–\–\ƒ\ +ƒ\\ –\–\–\ƒ\\ +ƒ\\•\ –\–\ƒ\\•\ +ƒ\\•\—\ –\ƒ\\•\—\ +ƒ\\•\—\\ ƒ\\•\—\\ +SELECT `‚b‚P`, LPAD(`‚b‚P`,5,'¡') FROM `‚s‚S`; +‚b‚P LPAD(`‚b‚P`,5,'¡') + ¡¡¡¡¡ +± ¡¡¡¡± +±² ¡¡¡±² +±²³ ¡¡±²³ +±²³´ ¡±²³´ +±²³´µ ±²³´µ +SELECT `‚b‚P`, LPAD(`‚b‚P`,5,'‚w') FROM `‚s‚T`; +‚b‚P LPAD(`‚b‚P`,5,'‚w') + ‚w‚w‚w‚w‚w +‚  ‚w‚w‚w‚w‚  +‚ ‚¢ ‚w‚w‚w‚ ‚¢ +‚ ‚¢‚¤ ‚w‚w‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚w‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`, LPAD(`‚b‚P`,5,'–\' ) FROM `‚s‚U`; +‚b‚P LPAD(`‚b‚P`,5,'–\' ) + –\–\–\–\–\ +ƒ\ –\–\–\–\ƒ\ +ƒ\\ –\–\–\ƒ\\ +ƒ\\•\ –\–\ƒ\\•\ +ƒ\\•\—\ –\ƒ\\•\—\ +ƒ\\•\—\\ ƒ\\•\—\\ +SELECT `‚b‚P`, LPAD(`‚b‚P`,5,'¡') FROM `‚s‚V`; +‚b‚P LPAD(`‚b‚P`,5,'¡') +±²³´µ ±²³´µ +±²³´ ¡±²³´ +±²³ ¡¡±²³ +±² ¡¡¡±² +± ¡¡¡¡± + ¡¡¡¡¡ +SELECT `‚b‚P`, LPAD(`‚b‚P`,5,'‚w') FROM `‚s‚W`; +‚b‚P LPAD(`‚b‚P`,5,'‚w') +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ ‚w‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ ‚w‚w‚ ‚¢‚¤ +‚ ‚¢ ‚w‚w‚w‚ ‚¢ +‚  ‚w‚w‚w‚w‚  + ‚w‚w‚w‚w‚w +SELECT `‚b‚P`, LPAD(`‚b‚P`,5,'–\' ) FROM `‚s‚X`; +‚b‚P LPAD(`‚b‚P`,5,'–\' ) +ƒ\\•\—\\ ƒ\\•\—\\ +ƒ\\•\—\ –\ƒ\\•\—\ +ƒ\\•\ –\–\ƒ\\•\ +ƒ\\ –\–\–\ƒ\\ +ƒ\ –\–\–\–\ƒ\ + –\–\–\–\–\ +SELECT `‚b‚P`, LPAD(`‚b‚P`,5,'¡') FROM `‚s‚P‚O`; +‚b‚P LPAD(`‚b‚P`,5,'¡') +±²³´µ ±²³´µ +±²³´ ¡±²³´ +±²³ ¡¡±²³ +±² ¡¡¡±² +± ¡¡¡¡± + ¡¡¡¡¡ +SELECT `‚b‚P`, LPAD(`‚b‚P`,5,'‚w') FROM `‚s‚P‚P`; +‚b‚P LPAD(`‚b‚P`,5,'‚w') +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ ‚w‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ ‚w‚w‚ ‚¢‚¤ +‚ ‚¢ ‚w‚w‚w‚ ‚¢ +‚  ‚w‚w‚w‚w‚  + ‚w‚w‚w‚w‚w +SELECT `‚b‚P`, LPAD(`‚b‚P`,5,'–\' ) FROM `‚s‚P‚Q`; +‚b‚P LPAD(`‚b‚P`,5,'–\' ) +ƒ\\•\—\\ ƒ\\•\—\\ +ƒ\\•\—\ –\ƒ\\•\—\ +ƒ\\•\ –\–\ƒ\\•\ +ƒ\\ –\–\–\ƒ\\ +ƒ\ –\–\–\–\ƒ\ + –\–\–\–\–\ +DROP TABLE `‚s‚P`; +DROP TABLE `‚s‚Q`; +DROP TABLE `‚s‚R`; +DROP TABLE `‚s‚S`; +DROP TABLE `‚s‚T`; +DROP TABLE `‚s‚U`; +DROP TABLE `‚s‚V`; +DROP TABLE `‚s‚W`; +DROP TABLE `‚s‚X`; +DROP TABLE `‚s‚P‚O`; +DROP TABLE `‚s‚P‚P`; +DROP TABLE `‚s‚P‚Q`; diff --git a/mysql-test/suite/jp/r/jp_lpad_ucs2.result b/mysql-test/suite/jp/r/jp_lpad_ucs2.result new file mode 100755 index 00000000000..951c5508a8f --- /dev/null +++ b/mysql-test/suite/jp/r/jp_lpad_ucs2.result @@ -0,0 +1,147 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; +CREATE TABLE `£Ô£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'Ž¡') FROM `£Ô£±`; +£Ã£± LPAD(`£Ã£±`,5,'Ž¡') + ޡޡޡޡޡ +ޱ ޡޡޡޡޱ +ޱ޲ ޡޡޡޱ޲ +ޱ޲޳ ޡޡޱ޲޳ +ޱ޲޳޴ ޡޱ޲޳޴ +ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'£Ø') FROM `£Ô£²`; +£Ã£± LPAD(`£Ã£±`,5,'£Ø') + £Ø£Ø£Ø£Ø£Ø +¤¢ £Ø£Ø£Ø£Ø¤¢ +¤¢¤¤ £Ø£Ø£Ø¤¢¤¤ +¤¢¤¤¤¦ £Ø£Ø¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ £Ø¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'°¢') FROM `£Ô£³`; +£Ã£± LPAD(`£Ã£±`,5,'°¢') + °¢°¢°¢°¢°¢ +íÜ °¢°¢°¢°¢íÜ +íÜíÝ °¢°¢°¢íÜíÝ +íÜíÝíÞ °¢°¢íÜíÝíÞ +íÜíÝíÞíß °¢íÜíÝíÞíß +íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'Ž¡') FROM `£Ô£´`; +£Ã£± LPAD(`£Ã£±`,5,'Ž¡') + ޡޡޡޡޡ +ޱ ޡޡޡޡޱ +ޱ޲ ޡޡޡޱ޲ +ޱ޲޳ ޡޡޱ޲޳ +ޱ޲޳޴ ޡޱ޲޳޴ +ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'£Ø') FROM `£Ô£µ`; +£Ã£± LPAD(`£Ã£±`,5,'£Ø') + £Ø£Ø£Ø£Ø£Ø +¤¢ £Ø£Ø£Ø£Ø¤¢ +¤¢¤¤ £Ø£Ø£Ø¤¢¤¤ +¤¢¤¤¤¦ £Ø£Ø¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ £Ø¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'°¢' ) FROM `£Ô£¶`; +£Ã£± LPAD(`£Ã£±`,5,'°¢' ) + °¢°¢°¢°¢°¢ +íÜ °¢°¢°¢°¢íÜ +íÜíÝ °¢°¢°¢íÜíÝ +íÜíÝíÞ °¢°¢íÜíÝíÞ +íÜíÝíÞíß °¢íÜíÝíÞíß +íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'Ž¡') FROM `£Ô£·`; +£Ã£± LPAD(`£Ã£±`,5,'Ž¡') +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴ ޡޱ޲޳޴ +ޱ޲޳ ޡޡޱ޲޳ +ޱ޲ ޡޡޡޱ޲ +ޱ ޡޡޡޡޱ + ޡޡޡޡޡ +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'£Ø') FROM `£Ô£¸`; +£Ã£± LPAD(`£Ã£±`,5,'£Ø') +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ £Ø¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ £Ø£Ø¤¢¤¤¤¦ +¤¢¤¤ £Ø£Ø£Ø¤¢¤¤ +¤¢ £Ø£Ø£Ø£Ø¤¢ + £Ø£Ø£Ø£Ø£Ø +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'°¢' ) FROM `£Ô£¹`; +£Ã£± LPAD(`£Ã£±`,5,'°¢' ) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíß °¢íÜíÝíÞíß +íÜíÝíÞ °¢°¢íÜíÝíÞ +íÜíÝ °¢°¢°¢íÜíÝ +íÜ °¢°¢°¢°¢íÜ + °¢°¢°¢°¢°¢ +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'Ž¡') FROM `£Ô£±£°`; +£Ã£± LPAD(`£Ã£±`,5,'Ž¡') +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴ ޡޱ޲޳޴ +ޱ޲޳ ޡޡޱ޲޳ +ޱ޲ ޡޡޡޱ޲ +ޱ ޡޡޡޡޱ + ޡޡޡޡޡ +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'£Ø') FROM `£Ô£±£±`; +£Ã£± LPAD(`£Ã£±`,5,'£Ø') +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ £Ø¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ £Ø£Ø¤¢¤¤¤¦ +¤¢¤¤ £Ø£Ø£Ø¤¢¤¤ +¤¢ £Ø£Ø£Ø£Ø¤¢ + £Ø£Ø£Ø£Ø£Ø +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'°¢' ) FROM `£Ô£±£²`; +£Ã£± LPAD(`£Ã£±`,5,'°¢' ) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíß °¢íÜíÝíÞíß +íÜíÝíÞ °¢°¢íÜíÝíÞ +íÜíÝ °¢°¢°¢íÜíÝ +íÜ °¢°¢°¢°¢íÜ + °¢°¢°¢°¢°¢ +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/r/jp_lpad_ujis.result b/mysql-test/suite/jp/r/jp_lpad_ujis.result new file mode 100755 index 00000000000..945e513d066 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_lpad_ujis.result @@ -0,0 +1,146 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +SET NAMES ujis; +SET character_set_database = ujis; +CREATE TABLE `£Ô£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'Ž¡') FROM `£Ô£±`; +£Ã£± LPAD(`£Ã£±`,5,'Ž¡') + ޡޡޡޡޡ +ޱ ޡޡޡޡޱ +ޱ޲ ޡޡޡޱ޲ +ޱ޲޳ ޡޡޱ޲޳ +ޱ޲޳޴ ޡޱ޲޳޴ +ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'£Ø') FROM `£Ô£²`; +£Ã£± LPAD(`£Ã£±`,5,'£Ø') + £Ø£Ø£Ø£Ø£Ø +¤¢ £Ø£Ø£Ø£Ø¤¢ +¤¢¤¤ £Ø£Ø£Ø¤¢¤¤ +¤¢¤¤¤¦ £Ø£Ø¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ £Ø¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'°¢') FROM `£Ô£³`; +£Ã£± LPAD(`£Ã£±`,5,'°¢') + °¢°¢°¢°¢°¢ +íÜ °¢°¢°¢°¢íÜ +íÜíÝ °¢°¢°¢íÜíÝ +íÜíÝíÞ °¢°¢íÜíÝíÞ +íÜíÝíÞíß °¢íÜíÝíÞíß +íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'Ž¡') FROM `£Ô£´`; +£Ã£± LPAD(`£Ã£±`,5,'Ž¡') + ޡޡޡޡޡ +ޱ ޡޡޡޡޱ +ޱ޲ ޡޡޡޱ޲ +ޱ޲޳ ޡޡޱ޲޳ +ޱ޲޳޴ ޡޱ޲޳޴ +ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'£Ø') FROM `£Ô£µ`; +£Ã£± LPAD(`£Ã£±`,5,'£Ø') + £Ø£Ø£Ø£Ø£Ø +¤¢ £Ø£Ø£Ø£Ø¤¢ +¤¢¤¤ £Ø£Ø£Ø¤¢¤¤ +¤¢¤¤¤¦ £Ø£Ø¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ £Ø¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'°¢' ) FROM `£Ô£¶`; +£Ã£± LPAD(`£Ã£±`,5,'°¢' ) + °¢°¢°¢°¢°¢ +íÜ °¢°¢°¢°¢íÜ +íÜíÝ °¢°¢°¢íÜíÝ +íÜíÝíÞ °¢°¢íÜíÝíÞ +íÜíÝíÞíß °¢íÜíÝíÞíß +íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'Ž¡') FROM `£Ô£·`; +£Ã£± LPAD(`£Ã£±`,5,'Ž¡') +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴ ޡޱ޲޳޴ +ޱ޲޳ ޡޡޱ޲޳ +ޱ޲ ޡޡޡޱ޲ +ޱ ޡޡޡޡޱ + ޡޡޡޡޡ +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'£Ø') FROM `£Ô£¸`; +£Ã£± LPAD(`£Ã£±`,5,'£Ø') +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ £Ø¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ £Ø£Ø¤¢¤¤¤¦ +¤¢¤¤ £Ø£Ø£Ø¤¢¤¤ +¤¢ £Ø£Ø£Ø£Ø¤¢ + £Ø£Ø£Ø£Ø£Ø +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'°¢' ) FROM `£Ô£¹`; +£Ã£± LPAD(`£Ã£±`,5,'°¢' ) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíß °¢íÜíÝíÞíß +íÜíÝíÞ °¢°¢íÜíÝíÞ +íÜíÝ °¢°¢°¢íÜíÝ +íÜ °¢°¢°¢°¢íÜ + °¢°¢°¢°¢°¢ +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'Ž¡') FROM `£Ô£±£°`; +£Ã£± LPAD(`£Ã£±`,5,'Ž¡') +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴ ޡޱ޲޳޴ +ޱ޲޳ ޡޡޱ޲޳ +ޱ޲ ޡޡޡޱ޲ +ޱ ޡޡޡޡޱ + ޡޡޡޡޡ +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'£Ø') FROM `£Ô£±£±`; +£Ã£± LPAD(`£Ã£±`,5,'£Ø') +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ £Ø¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ £Ø£Ø¤¢¤¤¤¦ +¤¢¤¤ £Ø£Ø£Ø¤¢¤¤ +¤¢ £Ø£Ø£Ø£Ø¤¢ + £Ø£Ø£Ø£Ø£Ø +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'°¢' ) FROM `£Ô£±£²`; +£Ã£± LPAD(`£Ã£±`,5,'°¢' ) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíß °¢íÜíÝíÞíß +íÜíÝíÞ °¢°¢íÜíÝíÞ +íÜíÝ °¢°¢°¢íÜíÝ +íÜ °¢°¢°¢°¢íÜ + °¢°¢°¢°¢°¢ +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/r/jp_lpad_utf8.result b/mysql-test/suite/jp/r/jp_lpad_utf8.result new file mode 100755 index 00000000000..8a3bae0153e --- /dev/null +++ b/mysql-test/suite/jp/r/jp_lpad_utf8.result @@ -0,0 +1,146 @@ +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +drop table if exists `T11`; +drop table if exists `T12`; +SET NAMES utf8; +SET character_set_database = utf8; +CREATE TABLE `T1` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T11` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T12` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +INSERT INTO `T1` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `T3` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +INSERT INTO `T1ï¼` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `T12` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +SELECT `C1`, LPAD(`C1`,5,'。') FROM `T1`; +C1 LPAD(`C1`,5,'。') + 。。。。。 +ï½± 。。。。ア +アイ 。。。アイ +アイウ 。。アイウ +アイウエ 。アイウエ +アイウエオ アイウエオ +SELECT `C1`, LPAD(`C1`,5,'X') FROM `ï¼´ï¼’`; +C1 LPAD(`C1`,5,'X') + XXXXX +゠XXXX゠+ã‚ㄠXXXã‚ã„ +ã‚ã„ㆠXXã‚ã„ㆠ+ã‚ã„ã†ãˆ Xã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +SELECT `C1`, LPAD(`C1`,5,'丄') FROM `T3`; +C1 LPAD(`C1`,5,'丄') + 丄丄丄丄丄 +é¾” 丄丄丄丄龔 +龔龖 丄丄丄龔龖 +龔龖龗 丄丄龔龖龗 +龔龖龗龞 丄龔龖龗龞 +龔龖龗龞龡 龔龖龗龞龡 +SELECT `C1`, LPAD(`C1`,5,'。') FROM `ï¼´ï¼”`; +C1 LPAD(`C1`,5,'。') + 。。。。。 +ï½± 。。。。ア +アイ 。。。アイ +アイウ 。。アイウ +アイウエ 。アイウエ +アイウエオ アイウエオ +SELECT `C1`, LPAD(`C1`,5,'X') FROM `T5`; +C1 LPAD(`C1`,5,'X') + XXXXX +゠XXXX゠+ã‚ㄠXXXã‚ã„ +ã‚ã„ㆠXXã‚ã„ㆠ+ã‚ã„ã†ãˆ Xã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +SELECT `C1`, LPAD(`C1`,5,'丄' ) FROM `ï¼´ï¼–`; +C1 LPAD(`C1`,5,'丄' ) + 丄丄丄丄丄 +é¾” 丄丄丄丄龔 +龔龖 丄丄丄龔龖 +龔龖龗 丄丄龔龖龗 +龔龖龗龞 丄龔龖龗龞 +龔龖龗龞龡 龔龖龗龞龡 +SELECT `C1`, LPAD(`C1`,5,'。') FROM `ï¼´ï¼—`; +C1 LPAD(`C1`,5,'。') +アイウエオ アイウエオ +アイウエ 。アイウエ +アイウ 。。アイウ +アイ 。。。アイ +ï½± 。。。。ア + 。。。。。 +SELECT `C1`, LPAD(`C1`,5,'X') FROM `T8`; +C1 LPAD(`C1`,5,'X') +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆ Xã‚ã„ã†ãˆ +ã‚ã„ㆠXXã‚ã„ㆠ+ã‚ㄠXXXã‚ã„ +゠XXXX゠+ XXXXX +SELECT `C1`, LPAD(`C1`,5,'丄' ) FROM `ï¼´ï¼™`; +C1 LPAD(`C1`,5,'丄' ) +龔龖龗龞龡 龔龖龗龞龡 +龔龖龗龞 丄龔龖龗龞 +龔龖龗 丄丄龔龖龗 +龔龖 丄丄丄龔龖 +é¾” 丄丄丄丄龔 + 丄丄丄丄丄 +SELECT `C1`, LPAD(`C1`,5,'。') FROM `T1ï¼`; +C1 LPAD(`C1`,5,'。') +アイウエオ アイウエオ +アイウエ 。アイウエ +アイウ 。。アイウ +アイ 。。。アイ +ï½± 。。。。ア + 。。。。。 +SELECT `C1`, LPAD(`C1`,5,'X') FROM `T11`; +C1 LPAD(`C1`,5,'X') +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆ Xã‚ã„ã†ãˆ +ã‚ã„ㆠXXã‚ã„ㆠ+ã‚ㄠXXXã‚ã„ +゠XXXX゠+ XXXXX +SELECT `C1`, LPAD(`C1`,5,'丄' ) FROM `T12`; +C1 LPAD(`C1`,5,'丄' ) +龔龖龗龞龡 龔龖龗龞龡 +龔龖龗龞 丄龔龖龗龞 +龔龖龗 丄丄龔龖龗 +龔龖 丄丄丄龔龖 +é¾” 丄丄丄丄龔 + 丄丄丄丄丄 +DROP TABLE `T1`; +DROP TABLE `ï¼´ï¼’`; +DROP TABLE `T3`; +DROP TABLE `ï¼´ï¼”`; +DROP TABLE `T5`; +DROP TABLE `ï¼´ï¼–`; +DROP TABLE `ï¼´ï¼—`; +DROP TABLE `T8`; +DROP TABLE `ï¼´ï¼™`; +DROP TABLE `T1ï¼`; +DROP TABLE `T11`; +DROP TABLE `T12`; diff --git a/mysql-test/suite/jp/r/jp_ltrim_sjis.result b/mysql-test/suite/jp/r/jp_ltrim_sjis.result new file mode 100755 index 00000000000..23032d65c56 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_ltrim_sjis.result @@ -0,0 +1,228 @@ +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +SET NAMES sjis; +SET character_set_database = sjis; +CREATE TABLE `‚s‚P` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Q` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚R` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚S` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚T` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚U` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚V` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚W` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚X` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚O` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚P` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚Q` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +INSERT INTO `‚s‚P` VALUES ('±²³´µ'); +INSERT INTO `‚s‚P` VALUES (' ±²³´µ'); +INSERT INTO `‚s‚P` VALUES (' ±²³´µ'); +INSERT INTO `‚s‚P` VALUES (' ±²³´µ'); +INSERT INTO `‚s‚P` VALUES ('@±²³´µ'); +INSERT INTO `‚s‚P` VALUES ('@@±²³´µ'); +INSERT INTO `‚s‚P` VALUES ('@@@±²³´µ'); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚Q` VALUES (' ‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚Q` VALUES (' ‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚Q` VALUES (' ‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚Q` VALUES ('@‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚Q` VALUES ('@@‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚Q` VALUES ('@@@‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚R` VALUES (' ƒ\\•\—\\'); +INSERT INTO `‚s‚R` VALUES (' ƒ\\•\—\\'); +INSERT INTO `‚s‚R` VALUES (' ƒ\\•\—\\'); +INSERT INTO `‚s‚R` VALUES ('@ƒ\\•\—\\'); +INSERT INTO `‚s‚R` VALUES ('@@ƒ\\•\—\\'); +INSERT INTO `‚s‚R` VALUES ('@@@ƒ\\•\—\\'); +INSERT INTO `‚s‚S` VALUES ('±²³´µ'); +INSERT INTO `‚s‚S` VALUES (' ±²³´µ'); +INSERT INTO `‚s‚S` VALUES (' ±²³´µ'); +INSERT INTO `‚s‚S` VALUES (' ±²³´µ'); +INSERT INTO `‚s‚S` VALUES ('@±²³´µ'); +INSERT INTO `‚s‚S` VALUES ('@@±²³´µ'); +INSERT INTO `‚s‚S` VALUES ('@@@±²³´µ'); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚T` VALUES (' ‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚T` VALUES (' ‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚T` VALUES (' ‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚T` VALUES ('@‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚T` VALUES ('@@‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚T` VALUES ('@@@‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚U` VALUES (' ƒ\\•\—\\'); +INSERT INTO `‚s‚U` VALUES (' ƒ\\•\—\\'); +INSERT INTO `‚s‚U` VALUES (' ƒ\\•\—\\'); +INSERT INTO `‚s‚U` VALUES ('@ƒ\\•\—\\'); +INSERT INTO `‚s‚U` VALUES ('@@ƒ\\•\—\\'); +INSERT INTO `‚s‚U` VALUES ('@@@ƒ\\•\—\\'); +INSERT INTO `‚s‚V` VALUES ('±²³´µ'); +INSERT INTO `‚s‚V` VALUES (' ±²³´µ'); +INSERT INTO `‚s‚V` VALUES (' ±²³´µ'); +INSERT INTO `‚s‚V` VALUES (' ±²³´µ'); +INSERT INTO `‚s‚V` VALUES ('@±²³´µ'); +INSERT INTO `‚s‚V` VALUES ('@@±²³´µ'); +INSERT INTO `‚s‚V` VALUES ('@@@±²³´µ'); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚W` VALUES (' ‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚W` VALUES (' ‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚W` VALUES (' ‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚W` VALUES ('@‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚W` VALUES ('@@‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚W` VALUES ('@@@‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚X` VALUES (' ƒ\\•\—\\'); +INSERT INTO `‚s‚X` VALUES (' ƒ\\•\—\\'); +INSERT INTO `‚s‚X` VALUES (' ƒ\\•\—\\'); +INSERT INTO `‚s‚X` VALUES ('@ƒ\\•\—\\'); +INSERT INTO `‚s‚X` VALUES ('@@ƒ\\•\—\\'); +INSERT INTO `‚s‚X` VALUES ('@@@ƒ\\•\—\\'); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ'); +INSERT INTO `‚s‚P‚O` VALUES (' ±²³´µ'); +INSERT INTO `‚s‚P‚O` VALUES (' ±²³´µ'); +INSERT INTO `‚s‚P‚O` VALUES (' ±²³´µ'); +INSERT INTO `‚s‚P‚O` VALUES ('@±²³´µ'); +INSERT INTO `‚s‚P‚O` VALUES ('@@±²³´µ'); +INSERT INTO `‚s‚P‚O` VALUES ('@@@±²³´µ'); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚P‚P` VALUES (' ‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚P‚P` VALUES (' ‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚P‚P` VALUES (' ‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚P‚P` VALUES ('@‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚P‚P` VALUES ('@@‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚P‚P` VALUES ('@@@‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚P‚Q` VALUES (' ƒ\\•\—\\'); +INSERT INTO `‚s‚P‚Q` VALUES (' ƒ\\•\—\\'); +INSERT INTO `‚s‚P‚Q` VALUES (' ƒ\\•\—\\'); +INSERT INTO `‚s‚P‚Q` VALUES ('@ƒ\\•\—\\'); +INSERT INTO `‚s‚P‚Q` VALUES ('@@ƒ\\•\—\\'); +INSERT INTO `‚s‚P‚Q` VALUES ('@@@ƒ\\•\—\\'); +SELECT LTRIM(`‚b‚P`) from `‚s‚P`; +LTRIM(`‚b‚P`) +±²³´µ +±²³´µ +±²³´µ +@@@±²³´µ +@@±²³´µ +@±²³´µ +±²³´µ +SELECT LTRIM(`‚b‚P`) from `‚s‚Q`; +LTRIM(`‚b‚P`) +‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨ +@@@‚ ‚¢‚¤‚¦‚¨ +@@‚ ‚¢‚¤‚¦‚¨ +@‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨ +SELECT LTRIM(`‚b‚P`) from `‚s‚R`; +LTRIM(`‚b‚P`) +ƒ\\•\—\\ +ƒ\\•\—\\ +ƒ\\•\—\\ +@@@ƒ\\•\—\\ +@@ƒ\\•\—\\ +@ƒ\\•\—\\ +ƒ\\•\—\\ +SELECT LTRIM(`‚b‚P`) from `‚s‚S`; +LTRIM(`‚b‚P`) +±²³´µ +±²³´µ +±²³´µ +@@@±²³´µ +@@±²³´µ +@±²³´µ +±²³´µ +SELECT LTRIM(`‚b‚P`) from `‚s‚T`; +LTRIM(`‚b‚P`) +‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨ +@@@‚ ‚¢‚¤‚¦‚¨ +@@‚ ‚¢‚¤‚¦‚¨ +@‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨ +SELECT LTRIM(`‚b‚P`) from `‚s‚U`; +LTRIM(`‚b‚P`) +ƒ\\•\—\\ +ƒ\\•\—\\ +ƒ\\•\—\\ +@@@ƒ\\•\—\\ +@@ƒ\\•\—\\ +@ƒ\\•\—\\ +ƒ\\•\—\\ +SELECT LTRIM(`‚b‚P`) from `‚s‚V`; +LTRIM(`‚b‚P`) +±²³´µ +±²³´µ +±²³´µ +±²³´µ +@±²³´µ +@@±²³´µ +@@@±²³´µ +SELECT LTRIM(`‚b‚P`) from `‚s‚W`; +LTRIM(`‚b‚P`) +‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨ +@‚ ‚¢‚¤‚¦‚¨ +@@‚ ‚¢‚¤‚¦‚¨ +@@@‚ ‚¢‚¤‚¦‚¨ +SELECT LTRIM(`‚b‚P`) from `‚s‚X`; +LTRIM(`‚b‚P`) +ƒ\\•\—\\ +ƒ\\•\—\\ +ƒ\\•\—\\ +ƒ\\•\—\\ +@ƒ\\•\—\\ +@@ƒ\\•\—\\ +@@@ƒ\\•\—\\ +SELECT LTRIM(`‚b‚P`) from `‚s‚P‚O`; +LTRIM(`‚b‚P`) +±²³´µ +±²³´µ +±²³´µ +±²³´µ +@±²³´µ +@@±²³´µ +@@@±²³´µ +SELECT LTRIM(`‚b‚P`) from `‚s‚P‚P`; +LTRIM(`‚b‚P`) +‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨ +@‚ ‚¢‚¤‚¦‚¨ +@@‚ ‚¢‚¤‚¦‚¨ +@@@‚ ‚¢‚¤‚¦‚¨ +SELECT LTRIM(`‚b‚P`) from `‚s‚P‚Q`; +LTRIM(`‚b‚P`) +ƒ\\•\—\\ +ƒ\\•\—\\ +ƒ\\•\—\\ +ƒ\\•\—\\ +@ƒ\\•\—\\ +@@ƒ\\•\—\\ +@@@ƒ\\•\—\\ +DROP TABLE `‚s‚P`; +DROP TABLE `‚s‚Q`; +DROP TABLE `‚s‚R`; +DROP TABLE `‚s‚S`; +DROP TABLE `‚s‚T`; +DROP TABLE `‚s‚U`; +DROP TABLE `‚s‚V`; +DROP TABLE `‚s‚W`; +DROP TABLE `‚s‚X`; +DROP TABLE `‚s‚P‚O`; +DROP TABLE `‚s‚P‚P`; +DROP TABLE `‚s‚P‚Q`; diff --git a/mysql-test/suite/jp/r/jp_ltrim_ucs2.result b/mysql-test/suite/jp/r/jp_ltrim_ucs2.result new file mode 100755 index 00000000000..533cf95a976 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_ltrim_ucs2.result @@ -0,0 +1,229 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; +CREATE TABLE `£Ô£±` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±` VALUES (' ޱ޲޳޴޵'); +INSERT INTO `£Ô£±` VALUES (' ޱ޲޳޴޵'); +INSERT INTO `£Ô£±` VALUES (' ޱ޲޳޴޵'); +INSERT INTO `£Ô£±` VALUES ('¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£±` VALUES ('¡¡¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£±` VALUES ('¡¡¡¡¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£²` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£²` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£²` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£²` VALUES ('¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£²` VALUES ('¡¡¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£²` VALUES ('¡¡¡¡¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£³` VALUES (' íÜíÝíÞíßíà'); +INSERT INTO `£Ô£³` VALUES (' íÜíÝíÞíßíà'); +INSERT INTO `£Ô£³` VALUES (' íÜíÝíÞíßíà'); +INSERT INTO `£Ô£³` VALUES ('¡¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£³` VALUES ('¡¡¡¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£³` VALUES ('¡¡¡¡¡¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£´` VALUES (' ޱ޲޳޴޵'); +INSERT INTO `£Ô£´` VALUES (' ޱ޲޳޴޵'); +INSERT INTO `£Ô£´` VALUES (' ޱ޲޳޴޵'); +INSERT INTO `£Ô£´` VALUES ('¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£´` VALUES ('¡¡¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£´` VALUES ('¡¡¡¡¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£µ` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£µ` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£µ` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£µ` VALUES ('¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£µ` VALUES ('¡¡¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£µ` VALUES ('¡¡¡¡¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¶` VALUES (' íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¶` VALUES (' íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¶` VALUES (' íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¶` VALUES ('¡¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¶` VALUES ('¡¡¡¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¶` VALUES ('¡¡¡¡¡¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£·` VALUES (' ޱ޲޳޴޵'); +INSERT INTO `£Ô£·` VALUES (' ޱ޲޳޴޵'); +INSERT INTO `£Ô£·` VALUES (' ޱ޲޳޴޵'); +INSERT INTO `£Ô£·` VALUES ('¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£·` VALUES ('¡¡¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£·` VALUES ('¡¡¡¡¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¸` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¸` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¸` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¸` VALUES ('¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¸` VALUES ('¡¡¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¸` VALUES ('¡¡¡¡¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¹` VALUES (' íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¹` VALUES (' íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¹` VALUES (' íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¹` VALUES ('¡¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¹` VALUES ('¡¡¡¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¹` VALUES ('¡¡¡¡¡¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£°` VALUES (' ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£°` VALUES (' ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£°` VALUES (' ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£°` VALUES ('¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£±£°` VALUES ('¡¡¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£±£°` VALUES ('¡¡¡¡¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£±` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£±` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£±` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£±` VALUES ('¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£±` VALUES ('¡¡¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£±` VALUES ('¡¡¡¡¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£²` VALUES (' íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£²` VALUES (' íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£²` VALUES (' íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£²` VALUES ('¡¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£²` VALUES ('¡¡¡¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£²` VALUES ('¡¡¡¡¡¡íÜíÝíÞíßíà'); +SELECT LTRIM(`£Ã£±`) from `£Ô£±`; +LTRIM(`£Ã£±`) +ޱ޲޳޴޵ +ޱ޲޳޴޵ +ޱ޲޳޴޵ +¡¡¡¡¡¡Ž±Ž²Ž³Ž´Žµ +¡¡¡¡Ž±Ž²Ž³Ž´Žµ +¡¡Ž±Ž²Ž³Ž´Žµ +ޱ޲޳޴޵ +SELECT LTRIM(`£Ã£±`) from `£Ô£²`; +LTRIM(`£Ã£±`) +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +¡¡¡¡¡¡¤¢¤¤¤¦¤¨¤ª +¡¡¡¡¤¢¤¤¤¦¤¨¤ª +¡¡¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +SELECT LTRIM(`£Ã£±`) from `£Ô£³`; +LTRIM(`£Ã£±`) +íÜíÝíÞíßíà +íÜíÝíÞíßíà +íÜíÝíÞíßíà +¡¡¡¡¡¡íÜíÝíÞíßíà +¡¡¡¡íÜíÝíÞíßíà +¡¡íÜíÝíÞíßíà +íÜíÝíÞíßíà +SELECT LTRIM(`£Ã£±`) from `£Ô£´`; +LTRIM(`£Ã£±`) +ޱ޲޳޴޵ +ޱ޲޳޴޵ +ޱ޲޳޴޵ +¡¡¡¡¡¡Ž±Ž²Ž³Ž´Žµ +¡¡¡¡Ž±Ž²Ž³Ž´Žµ +¡¡Ž±Ž²Ž³Ž´Žµ +ޱ޲޳޴޵ +SELECT LTRIM(`£Ã£±`) from `£Ô£µ`; +LTRIM(`£Ã£±`) +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +¡¡¡¡¡¡¤¢¤¤¤¦¤¨¤ª +¡¡¡¡¤¢¤¤¤¦¤¨¤ª +¡¡¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +SELECT LTRIM(`£Ã£±`) from `£Ô£¶`; +LTRIM(`£Ã£±`) +íÜíÝíÞíßíà +íÜíÝíÞíßíà +íÜíÝíÞíßíà +¡¡¡¡¡¡íÜíÝíÞíßíà +¡¡¡¡íÜíÝíÞíßíà +¡¡íÜíÝíÞíßíà +íÜíÝíÞíßíà +SELECT LTRIM(`£Ã£±`) from `£Ô£·`; +LTRIM(`£Ã£±`) +ޱ޲޳޴޵ +ޱ޲޳޴޵ +ޱ޲޳޴޵ +ޱ޲޳޴޵ +¡¡Ž±Ž²Ž³Ž´Žµ +¡¡¡¡Ž±Ž²Ž³Ž´Žµ +¡¡¡¡¡¡Ž±Ž²Ž³Ž´Žµ +SELECT LTRIM(`£Ã£±`) from `£Ô£¸`; +LTRIM(`£Ã£±`) +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +¡¡¤¢¤¤¤¦¤¨¤ª +¡¡¡¡¤¢¤¤¤¦¤¨¤ª +¡¡¡¡¡¡¤¢¤¤¤¦¤¨¤ª +SELECT LTRIM(`£Ã£±`) from `£Ô£¹`; +LTRIM(`£Ã£±`) +íÜíÝíÞíßíà +íÜíÝíÞíßíà +íÜíÝíÞíßíà +íÜíÝíÞíßíà +¡¡íÜíÝíÞíßíà +¡¡¡¡íÜíÝíÞíßíà +¡¡¡¡¡¡íÜíÝíÞíßíà +SELECT LTRIM(`£Ã£±`) from `£Ô£±£°`; +LTRIM(`£Ã£±`) +ޱ޲޳޴޵ +ޱ޲޳޴޵ +ޱ޲޳޴޵ +ޱ޲޳޴޵ +¡¡Ž±Ž²Ž³Ž´Žµ +¡¡¡¡Ž±Ž²Ž³Ž´Žµ +¡¡¡¡¡¡Ž±Ž²Ž³Ž´Žµ +SELECT LTRIM(`£Ã£±`) from `£Ô£±£±`; +LTRIM(`£Ã£±`) +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +¡¡¤¢¤¤¤¦¤¨¤ª +¡¡¡¡¤¢¤¤¤¦¤¨¤ª +¡¡¡¡¡¡¤¢¤¤¤¦¤¨¤ª +SELECT LTRIM(`£Ã£±`) from `£Ô£±£²`; +LTRIM(`£Ã£±`) +íÜíÝíÞíßíà +íÜíÝíÞíßíà +íÜíÝíÞíßíà +íÜíÝíÞíßíà +¡¡íÜíÝíÞíßíà +¡¡¡¡íÜíÝíÞíßíà +¡¡¡¡¡¡íÜíÝíÞíßíà +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/r/jp_ltrim_ujis.result b/mysql-test/suite/jp/r/jp_ltrim_ujis.result new file mode 100755 index 00000000000..1c95f28907f --- /dev/null +++ b/mysql-test/suite/jp/r/jp_ltrim_ujis.result @@ -0,0 +1,228 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +SET NAMES ujis; +SET character_set_database = ujis; +CREATE TABLE `£Ô£±` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±` VALUES (' ޱ޲޳޴޵'); +INSERT INTO `£Ô£±` VALUES (' ޱ޲޳޴޵'); +INSERT INTO `£Ô£±` VALUES (' ޱ޲޳޴޵'); +INSERT INTO `£Ô£±` VALUES ('¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£±` VALUES ('¡¡¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£±` VALUES ('¡¡¡¡¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£²` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£²` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£²` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£²` VALUES ('¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£²` VALUES ('¡¡¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£²` VALUES ('¡¡¡¡¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£³` VALUES (' íÜíÝíÞíßíà'); +INSERT INTO `£Ô£³` VALUES (' íÜíÝíÞíßíà'); +INSERT INTO `£Ô£³` VALUES (' íÜíÝíÞíßíà'); +INSERT INTO `£Ô£³` VALUES ('¡¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£³` VALUES ('¡¡¡¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£³` VALUES ('¡¡¡¡¡¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£´` VALUES (' ޱ޲޳޴޵'); +INSERT INTO `£Ô£´` VALUES (' ޱ޲޳޴޵'); +INSERT INTO `£Ô£´` VALUES (' ޱ޲޳޴޵'); +INSERT INTO `£Ô£´` VALUES ('¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£´` VALUES ('¡¡¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£´` VALUES ('¡¡¡¡¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£µ` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£µ` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£µ` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£µ` VALUES ('¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£µ` VALUES ('¡¡¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£µ` VALUES ('¡¡¡¡¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¶` VALUES (' íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¶` VALUES (' íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¶` VALUES (' íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¶` VALUES ('¡¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¶` VALUES ('¡¡¡¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¶` VALUES ('¡¡¡¡¡¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£·` VALUES (' ޱ޲޳޴޵'); +INSERT INTO `£Ô£·` VALUES (' ޱ޲޳޴޵'); +INSERT INTO `£Ô£·` VALUES (' ޱ޲޳޴޵'); +INSERT INTO `£Ô£·` VALUES ('¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£·` VALUES ('¡¡¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£·` VALUES ('¡¡¡¡¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¸` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¸` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¸` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¸` VALUES ('¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¸` VALUES ('¡¡¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¸` VALUES ('¡¡¡¡¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¹` VALUES (' íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¹` VALUES (' íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¹` VALUES (' íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¹` VALUES ('¡¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¹` VALUES ('¡¡¡¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¹` VALUES ('¡¡¡¡¡¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£°` VALUES (' ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£°` VALUES (' ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£°` VALUES (' ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£°` VALUES ('¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£±£°` VALUES ('¡¡¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£±£°` VALUES ('¡¡¡¡¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£±` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£±` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£±` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£±` VALUES ('¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£±` VALUES ('¡¡¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£±` VALUES ('¡¡¡¡¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£²` VALUES (' íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£²` VALUES (' íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£²` VALUES (' íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£²` VALUES ('¡¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£²` VALUES ('¡¡¡¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£²` VALUES ('¡¡¡¡¡¡íÜíÝíÞíßíà'); +SELECT LTRIM(`£Ã£±`) from `£Ô£±`; +LTRIM(`£Ã£±`) +ޱ޲޳޴޵ +ޱ޲޳޴޵ +ޱ޲޳޴޵ +ޱ޲޳޴޵ +¡¡Ž±Ž²Ž³Ž´Žµ +¡¡¡¡Ž±Ž²Ž³Ž´Žµ +¡¡¡¡¡¡Ž±Ž²Ž³Ž´Žµ +SELECT LTRIM(`£Ã£±`) from `£Ô£²`; +LTRIM(`£Ã£±`) +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +¡¡¡¡¡¡¤¢¤¤¤¦¤¨¤ª +¡¡¡¡¤¢¤¤¤¦¤¨¤ª +¡¡¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +SELECT LTRIM(`£Ã£±`) from `£Ô£³`; +LTRIM(`£Ã£±`) +íÜíÝíÞíßíà +íÜíÝíÞíßíà +íÜíÝíÞíßíà +íÜíÝíÞíßíà +¡¡íÜíÝíÞíßíà +¡¡¡¡íÜíÝíÞíßíà +¡¡¡¡¡¡íÜíÝíÞíßíà +SELECT LTRIM(`£Ã£±`) from `£Ô£´`; +LTRIM(`£Ã£±`) +ޱ޲޳޴޵ +ޱ޲޳޴޵ +ޱ޲޳޴޵ +ޱ޲޳޴޵ +¡¡Ž±Ž²Ž³Ž´Žµ +¡¡¡¡Ž±Ž²Ž³Ž´Žµ +¡¡¡¡¡¡Ž±Ž²Ž³Ž´Žµ +SELECT LTRIM(`£Ã£±`) from `£Ô£µ`; +LTRIM(`£Ã£±`) +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +¡¡¡¡¡¡¤¢¤¤¤¦¤¨¤ª +¡¡¡¡¤¢¤¤¤¦¤¨¤ª +¡¡¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +SELECT LTRIM(`£Ã£±`) from `£Ô£¶`; +LTRIM(`£Ã£±`) +íÜíÝíÞíßíà +íÜíÝíÞíßíà +íÜíÝíÞíßíà +íÜíÝíÞíßíà +¡¡íÜíÝíÞíßíà +¡¡¡¡íÜíÝíÞíßíà +¡¡¡¡¡¡íÜíÝíÞíßíà +SELECT LTRIM(`£Ã£±`) from `£Ô£·`; +LTRIM(`£Ã£±`) +ޱ޲޳޴޵ +ޱ޲޳޴޵ +ޱ޲޳޴޵ +ޱ޲޳޴޵ +¡¡Ž±Ž²Ž³Ž´Žµ +¡¡¡¡Ž±Ž²Ž³Ž´Žµ +¡¡¡¡¡¡Ž±Ž²Ž³Ž´Žµ +SELECT LTRIM(`£Ã£±`) from `£Ô£¸`; +LTRIM(`£Ã£±`) +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +¡¡¤¢¤¤¤¦¤¨¤ª +¡¡¡¡¤¢¤¤¤¦¤¨¤ª +¡¡¡¡¡¡¤¢¤¤¤¦¤¨¤ª +SELECT LTRIM(`£Ã£±`) from `£Ô£¹`; +LTRIM(`£Ã£±`) +íÜíÝíÞíßíà +íÜíÝíÞíßíà +íÜíÝíÞíßíà +íÜíÝíÞíßíà +¡¡íÜíÝíÞíßíà +¡¡¡¡íÜíÝíÞíßíà +¡¡¡¡¡¡íÜíÝíÞíßíà +SELECT LTRIM(`£Ã£±`) from `£Ô£±£°`; +LTRIM(`£Ã£±`) +ޱ޲޳޴޵ +ޱ޲޳޴޵ +ޱ޲޳޴޵ +ޱ޲޳޴޵ +¡¡Ž±Ž²Ž³Ž´Žµ +¡¡¡¡Ž±Ž²Ž³Ž´Žµ +¡¡¡¡¡¡Ž±Ž²Ž³Ž´Žµ +SELECT LTRIM(`£Ã£±`) from `£Ô£±£±`; +LTRIM(`£Ã£±`) +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +¡¡¤¢¤¤¤¦¤¨¤ª +¡¡¡¡¤¢¤¤¤¦¤¨¤ª +¡¡¡¡¡¡¤¢¤¤¤¦¤¨¤ª +SELECT LTRIM(`£Ã£±`) from `£Ô£±£²`; +LTRIM(`£Ã£±`) +íÜíÝíÞíßíà +íÜíÝíÞíßíà +íÜíÝíÞíßíà +íÜíÝíÞíßíà +¡¡íÜíÝíÞíßíà +¡¡¡¡íÜíÝíÞíßíà +¡¡¡¡¡¡íÜíÝíÞíßíà +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/r/jp_ltrim_utf8.result b/mysql-test/suite/jp/r/jp_ltrim_utf8.result new file mode 100755 index 00000000000..c6fae7233f1 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_ltrim_utf8.result @@ -0,0 +1,228 @@ +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +SET NAMES utf8; +SET character_set_database = utf8; +CREATE TABLE `T1` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T11` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T12` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +INSERT INTO `T1` VALUES ('アイウエオ'); +INSERT INTO `T1` VALUES (' アイウエオ'); +INSERT INTO `T1` VALUES (' アイウエオ'); +INSERT INTO `T1` VALUES (' アイウエオ'); +INSERT INTO `T1` VALUES (' アイウエオ'); +INSERT INTO `T1` VALUES ('  アイウエオ'); +INSERT INTO `T1` VALUES ('   アイウエオ'); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼’` VALUES (' ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼’` VALUES (' ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼’` VALUES (' ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼’` VALUES (' ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼’` VALUES ('  ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼’` VALUES ('   ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T3` VALUES ('龔龖龗龞龡'); +INSERT INTO `T3` VALUES (' 龔龖龗龞龡'); +INSERT INTO `T3` VALUES (' 龔龖龗龞龡'); +INSERT INTO `T3` VALUES (' 龔龖龗龞龡'); +INSERT INTO `T3` VALUES (' 龔龖龗龞龡'); +INSERT INTO `T3` VALUES ('  龔龖龗龞龡'); +INSERT INTO `T3` VALUES ('   龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオ'); +INSERT INTO `ï¼´ï¼”` VALUES (' アイウエオ'); +INSERT INTO `ï¼´ï¼”` VALUES (' アイウエオ'); +INSERT INTO `ï¼´ï¼”` VALUES (' アイウエオ'); +INSERT INTO `ï¼´ï¼”` VALUES (' アイウエオ'); +INSERT INTO `ï¼´ï¼”` VALUES ('  アイウエオ'); +INSERT INTO `ï¼´ï¼”` VALUES ('   アイウエオ'); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T5` VALUES (' ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T5` VALUES (' ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T5` VALUES (' ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T5` VALUES (' ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T5` VALUES ('  ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T5` VALUES ('   ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼–` VALUES (' 龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼–` VALUES (' 龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼–` VALUES (' 龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼–` VALUES (' 龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼–` VALUES ('  龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼–` VALUES ('   龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオ'); +INSERT INTO `ï¼´ï¼—` VALUES (' アイウエオ'); +INSERT INTO `ï¼´ï¼—` VALUES (' アイウエオ'); +INSERT INTO `ï¼´ï¼—` VALUES (' アイウエオ'); +INSERT INTO `ï¼´ï¼—` VALUES (' アイウエオ'); +INSERT INTO `ï¼´ï¼—` VALUES ('  アイウエオ'); +INSERT INTO `ï¼´ï¼—` VALUES ('   アイウエオ'); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T8` VALUES (' ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T8` VALUES (' ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T8` VALUES (' ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T8` VALUES (' ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T8` VALUES ('  ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T8` VALUES ('   ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼™` VALUES (' 龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼™` VALUES (' 龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼™` VALUES (' 龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼™` VALUES (' 龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼™` VALUES ('  龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼™` VALUES ('   龔龖龗龞龡'); +INSERT INTO `T1ï¼` VALUES ('アイウエオ'); +INSERT INTO `T1ï¼` VALUES (' アイウエオ'); +INSERT INTO `T1ï¼` VALUES (' アイウエオ'); +INSERT INTO `T1ï¼` VALUES (' アイウエオ'); +INSERT INTO `T1ï¼` VALUES (' アイウエオ'); +INSERT INTO `T1ï¼` VALUES ('  アイウエオ'); +INSERT INTO `T1ï¼` VALUES ('   アイウエオ'); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T11` VALUES (' ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T11` VALUES (' ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T11` VALUES (' ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T11` VALUES (' ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T11` VALUES ('  ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T11` VALUES ('   ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T12` VALUES ('龔龖龗龞龡'); +INSERT INTO `T12` VALUES (' 龔龖龗龞龡'); +INSERT INTO `T12` VALUES (' 龔龖龗龞龡'); +INSERT INTO `T12` VALUES (' 龔龖龗龞龡'); +INSERT INTO `T12` VALUES (' 龔龖龗龞龡'); +INSERT INTO `T12` VALUES ('  龔龖龗龞龡'); +INSERT INTO `T12` VALUES ('   龔龖龗龞龡'); +SELECT LTRIM(`C1`) from `T1`; +LTRIM(`C1`) +アイウエオ +アイウエオ +アイウエオ +   アイウエオ +  アイウエオ + アイウエオ +アイウエオ +SELECT LTRIM(`C1`) from `ï¼´ï¼’`; +LTRIM(`C1`) +ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠ +   ã‚ã„ã†ãˆãŠ +  ã‚ã„ã†ãˆãŠ + ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠ +SELECT LTRIM(`C1`) from `T3`; +LTRIM(`C1`) +龔龖龗龞龡 +龔龖龗龞龡 +龔龖龗龞龡 +   龔龖龗龞龡 +  龔龖龗龞龡 + 龔龖龗龞龡 +龔龖龗龞龡 +SELECT LTRIM(`C1`) from `ï¼´ï¼”`; +LTRIM(`C1`) +アイウエオ +アイウエオ +アイウエオ +   アイウエオ +  アイウエオ + アイウエオ +アイウエオ +SELECT LTRIM(`C1`) from `T5`; +LTRIM(`C1`) +ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠ +   ã‚ã„ã†ãˆãŠ +  ã‚ã„ã†ãˆãŠ + ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠ +SELECT LTRIM(`C1`) from `ï¼´ï¼–`; +LTRIM(`C1`) +龔龖龗龞龡 +龔龖龗龞龡 +龔龖龗龞龡 +   龔龖龗龞龡 +  龔龖龗龞龡 + 龔龖龗龞龡 +龔龖龗龞龡 +SELECT LTRIM(`C1`) from `ï¼´ï¼—`; +LTRIM(`C1`) +アイウエオ +アイウエオ +アイウエオ +アイウエオ + アイウエオ +  アイウエオ +   アイウエオ +SELECT LTRIM(`C1`) from `T8`; +LTRIM(`C1`) +ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠ + ã‚ã„ã†ãˆãŠ +  ã‚ã„ã†ãˆãŠ +   ã‚ã„ã†ãˆãŠ +SELECT LTRIM(`C1`) from `ï¼´ï¼™`; +LTRIM(`C1`) +龔龖龗龞龡 +龔龖龗龞龡 +龔龖龗龞龡 +龔龖龗龞龡 + 龔龖龗龞龡 +  龔龖龗龞龡 +   龔龖龗龞龡 +SELECT LTRIM(`C1`) from `T1ï¼`; +LTRIM(`C1`) +アイウエオ +アイウエオ +アイウエオ +アイウエオ + アイウエオ +  アイウエオ +   アイウエオ +SELECT LTRIM(`C1`) from `T11`; +LTRIM(`C1`) +ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠ + ã‚ã„ã†ãˆãŠ +  ã‚ã„ã†ãˆãŠ +   ã‚ã„ã†ãˆãŠ +SELECT LTRIM(`C1`) from `T12`; +LTRIM(`C1`) +龔龖龗龞龡 +龔龖龗龞龡 +龔龖龗龞龡 +龔龖龗龞龡 + 龔龖龗龞龡 +  龔龖龗龞龡 +   龔龖龗龞龡 +DROP TABLE `T1`; +DROP TABLE `ï¼´ï¼’`; +DROP TABLE `T3`; +DROP TABLE `ï¼´ï¼”`; +DROP TABLE `T5`; +DROP TABLE `ï¼´ï¼–`; +DROP TABLE `ï¼´ï¼—`; +DROP TABLE `T8`; +DROP TABLE `ï¼´ï¼™`; +DROP TABLE `T1ï¼`; +DROP TABLE `T11`; +DROP TABLE `T12`; diff --git a/mysql-test/suite/jp/r/jp_ps_sjis.result b/mysql-test/suite/jp/r/jp_ps_sjis.result new file mode 100755 index 00000000000..2397bc78c5b --- /dev/null +++ b/mysql-test/suite/jp/r/jp_ps_sjis.result @@ -0,0 +1,896 @@ +DROP TABLE IF EXISTS t1; +DROP TABLE IF EXISTS t2; +DROP TABLE IF EXISTS t3; +DROP TABLE IF EXISTS t4; +SET NAMES sjis; +SET character_set_database = sjis; +CREATE TABLE t1(c1 char(3)) DEFAULT CHARSET = sjis ENGINE = InnoDB; +CREATE TABLE t2(c1 char(3)) DEFAULT CHARSET = sjis ENGINE = InnoDB; +CREATE TABLE t3( +`±` char(1), +`‚ ` char(1), +`•\` char(1) +)DEFAULT CHARSET = sjis ENGINE = InnoDB; +CREATE TABLE t4(c1 char(1)) DEFAULT CHARSET = sjis ENGINE = InnoDB; +INSERT INTO t1 VALUES ('xxx'); +INSERT INTO t2 VALUES ('±‚ •\'); +INSERT INTO t3 VALUES ('x','x','x'),('x','x','x'),('y','y','y'),('y','y','y'),('z','z','z'),('z','z','z'); +INSERT INTO t4 VALUES ('±'),('‚ '),('•\'); +PREPARE stmt1 FROM 'SELECT ? FROM t3'; +PREPARE stmt2 FROM 'SELECT * FROM t3 ORDER BY ?'; +PREPARE stmt3 FROM 'SELECT COUNT(*) FROM t3 GROUP BY ?'; +PREPARE stmt4 FROM 'SELECT CHAR_LENGTH(?)'; +PREPARE stmt5 FROM 'SELECT CHARSET(?)'; +PREPARE stmt6 FROM 'SELECT INSERT(c1,1,1,?) FROM t1'; +PREPARE stmt7 FROM 'SELECT INSTR(c1,?) FROM t2'; +PREPARE stmt8 FROM 'SELECT LOCATE(?,c1) FROM t2'; +PREPARE stmt9 FROM 'SELECT LPAD(c1,10,?) FROM t1'; +PREPARE stmt10 FROM 'SELECT REPLACE(c1,?,\'x\') FROM t2'; +PREPARE stmt11 FROM 'SELECT REPLACE(c1,\'x\',?) FROM t1'; +PREPARE stmt12 FROM 'SELECT RPAD(c1,10,?) FROM t1'; +PREPARE stmt13 FROM 'UPDATE t4 SET c1=\'x\' WHERE c1=?'; +PREPARE stmt14 FROM 'UPDATE t4 SET c1=? WHERE c1=\'x\''; +SET @arg = '±'; +EXECUTE stmt1 USING @arg; +? +± +± +± +± +± +± +EXECUTE stmt2 USING @arg; +± ‚  •\ +x x x +x x x +y y y +y y y +z z z +z z z +EXECUTE stmt3 USING @arg; +COUNT(*) +6 +EXECUTE stmt4 USING @arg; +CHAR_LENGTH(?) +1 +EXECUTE stmt5 USING @arg; +CHARSET(?) +sjis +EXECUTE stmt6 USING @arg; +INSERT(c1,1,1,?) +±xx +EXECUTE stmt7 USING @arg; +INSTR(c1,?) +1 +EXECUTE stmt8 USING @arg; +LOCATE(?,c1) +1 +EXECUTE stmt9 USING @arg; +LPAD(c1,10,?) +±±±±±±±xxx +EXECUTE stmt10 USING @arg; +REPLACE(c1,?,'x') +x‚ •\ +EXECUTE stmt11 USING @arg; +REPLACE(c1,'x',?) +±±± +EXECUTE stmt12 USING @arg; +RPAD(c1,10,?) +xxx±±±±±±± +EXECUTE stmt13 USING @arg; +SELECT * FROM t4; +c1 +x +‚  +•\ +EXECUTE stmt14 USING @arg; +SELECT * FROM t4; +c1 +± +‚  +•\ +SET @arg = '‚ '; +EXECUTE stmt1 USING @arg; +? +‚  +‚  +‚  +‚  +‚  +‚  +EXECUTE stmt2 USING @arg; +± ‚  •\ +x x x +x x x +y y y +y y y +z z z +z z z +EXECUTE stmt3 USING @arg; +COUNT(*) +6 +EXECUTE stmt4 USING @arg; +CHAR_LENGTH(?) +1 +EXECUTE stmt5 USING @arg; +CHARSET(?) +sjis +EXECUTE stmt6 USING @arg; +INSERT(c1,1,1,?) +‚ xx +EXECUTE stmt7 USING @arg; +INSTR(c1,?) +2 +EXECUTE stmt8 USING @arg; +LOCATE(?,c1) +2 +EXECUTE stmt9 USING @arg; +LPAD(c1,10,?) +‚ ‚ ‚ ‚ ‚ ‚ ‚ xxx +EXECUTE stmt10 USING @arg; +REPLACE(c1,?,'x') +±x•\ +EXECUTE stmt11 USING @arg; +REPLACE(c1,'x',?) +‚ ‚ ‚  +EXECUTE stmt12 USING @arg; +RPAD(c1,10,?) +xxx‚ ‚ ‚ ‚ ‚ ‚ ‚  +EXECUTE stmt13 USING @arg; +SELECT * FROM t4; +c1 +± +x +•\ +EXECUTE stmt14 USING @arg; +SELECT * FROM t4; +c1 +± +‚  +•\ +SET @arg = '•\'; +EXECUTE stmt1 USING @arg; +? +•\ +•\ +•\ +•\ +•\ +•\ +EXECUTE stmt2 USING @arg; +± ‚  •\ +x x x +x x x +y y y +y y y +z z z +z z z +EXECUTE stmt3 USING @arg; +COUNT(*) +6 +EXECUTE stmt4 USING @arg; +CHAR_LENGTH(?) +1 +EXECUTE stmt5 USING @arg; +CHARSET(?) +sjis +EXECUTE stmt6 USING @arg; +INSERT(c1,1,1,?) +•\xx +EXECUTE stmt7 USING @arg; +INSTR(c1,?) +3 +EXECUTE stmt8 USING @arg; +LOCATE(?,c1) +3 +EXECUTE stmt9 USING @arg; +LPAD(c1,10,?) +•\•\•\•\•\•\•\xxx +EXECUTE stmt10 USING @arg; +REPLACE(c1,?,'x') +±‚ x +EXECUTE stmt11 USING @arg; +REPLACE(c1,'x',?) +•\•\•\ +EXECUTE stmt12 USING @arg; +RPAD(c1,10,?) +xxx•\•\•\•\•\•\•\ +EXECUTE stmt13 USING @arg; +SELECT * FROM t4; +c1 +± +‚  +x +EXECUTE stmt14 USING @arg; +SELECT * FROM t4; +c1 +± +‚  +•\ +DEALLOCATE PREPARE stmt1; +DEALLOCATE PREPARE stmt2; +DEALLOCATE PREPARE stmt3; +DEALLOCATE PREPARE stmt4; +DEALLOCATE PREPARE stmt5; +DEALLOCATE PREPARE stmt6; +DEALLOCATE PREPARE stmt7; +DEALLOCATE PREPARE stmt8; +DEALLOCATE PREPARE stmt9; +DEALLOCATE PREPARE stmt10; +DEALLOCATE PREPARE stmt11; +DEALLOCATE PREPARE stmt12; +DEALLOCATE PREPARE stmt13; +DEALLOCATE PREPARE stmt14; +DROP TABLE t1; +DROP TABLE t2; +DROP TABLE t3; +DROP TABLE t4; +CREATE TABLE t1(c1 char(3)) DEFAULT CHARSET = sjis ENGINE = MyISAM; +CREATE TABLE t2(c1 char(3)) DEFAULT CHARSET = sjis ENGINE = MyISAM; +CREATE TABLE t3( +`±` char(1), +`‚ ` char(1), +`•\` char(1) +)DEFAULT CHARSET = sjis ENGINE = MyISAM; +CREATE TABLE t4(c1 char(1)) DEFAULT CHARSET = sjis ENGINE = MyISAM; +INSERT INTO t1 VALUES ('xxx'); +INSERT INTO t2 VALUES ('±‚ •\'); +INSERT INTO t3 VALUES ('x','x','x'),('x','x','x'),('y','y','y'),('y','y','y'),('z','z','z'),('z','z','z'); +INSERT INTO t4 VALUES ('±'),('‚ '),('•\' ); +PREPARE stmt1 FROM 'SELECT ? FROM t3'; +PREPARE stmt2 FROM 'SELECT * FROM t3 ORDER BY ?'; +PREPARE stmt3 FROM 'SELECT COUNT(*) FROM t3 GROUP BY ?'; +PREPARE stmt4 FROM 'SELECT CHAR_LENGTH(?)'; +PREPARE stmt5 FROM 'SELECT CHARSET(?)'; +PREPARE stmt6 FROM 'SELECT INSERT(c1,1,1,?) FROM t1'; +PREPARE stmt7 FROM 'SELECT INSTR(c1,?) FROM t2'; +PREPARE stmt8 FROM 'SELECT LOCATE(?,c1) FROM t2'; +PREPARE stmt9 FROM 'SELECT LPAD(c1,10,?) FROM t1'; +PREPARE stmt10 FROM 'SELECT REPLACE(c1,?,\'x\') FROM t2'; +PREPARE stmt11 FROM 'SELECT REPLACE(c1,\'x\',?) FROM t1'; +PREPARE stmt12 FROM 'SELECT RPAD(c1,10,?) FROM t1'; +PREPARE stmt13 FROM 'UPDATE t4 SET c1=\'x\' WHERE c1=?'; +PREPARE stmt14 FROM 'UPDATE t4 SET c1=? WHERE c1=\'x\''; +SET @arg = '±'; +EXECUTE stmt1 USING @arg; +? +± +± +± +± +± +± +EXECUTE stmt2 USING @arg; +± ‚  •\ +x x x +x x x +y y y +y y y +z z z +z z z +EXECUTE stmt3 USING @arg; +COUNT(*) +6 +EXECUTE stmt4 USING @arg; +CHAR_LENGTH(?) +1 +EXECUTE stmt5 USING @arg; +CHARSET(?) +sjis +EXECUTE stmt6 USING @arg; +INSERT(c1,1,1,?) +±xx +EXECUTE stmt7 USING @arg; +INSTR(c1,?) +1 +EXECUTE stmt8 USING @arg; +LOCATE(?,c1) +1 +EXECUTE stmt9 USING @arg; +LPAD(c1,10,?) +±±±±±±±xxx +EXECUTE stmt10 USING @arg; +REPLACE(c1,?,'x') +x‚ •\ +EXECUTE stmt11 USING @arg; +REPLACE(c1,'x',?) +±±± +EXECUTE stmt12 USING @arg; +RPAD(c1,10,?) +xxx±±±±±±± +EXECUTE stmt13 USING @arg; +SELECT * FROM t4; +c1 +x +‚  +•\ +EXECUTE stmt14 USING @arg; +SELECT * FROM t4; +c1 +± +‚  +•\ +SET @arg = '‚ '; +EXECUTE stmt1 USING @arg; +? +‚  +‚  +‚  +‚  +‚  +‚  +EXECUTE stmt2 USING @arg; +± ‚  •\ +x x x +x x x +y y y +y y y +z z z +z z z +EXECUTE stmt3 USING @arg; +COUNT(*) +6 +EXECUTE stmt4 USING @arg; +CHAR_LENGTH(?) +1 +EXECUTE stmt5 USING @arg; +CHARSET(?) +sjis +EXECUTE stmt6 USING @arg; +INSERT(c1,1,1,?) +‚ xx +EXECUTE stmt7 USING @arg; +INSTR(c1,?) +2 +EXECUTE stmt8 USING @arg; +LOCATE(?,c1) +2 +EXECUTE stmt9 USING @arg; +LPAD(c1,10,?) +‚ ‚ ‚ ‚ ‚ ‚ ‚ xxx +EXECUTE stmt10 USING @arg; +REPLACE(c1,?,'x') +±x•\ +EXECUTE stmt11 USING @arg; +REPLACE(c1,'x',?) +‚ ‚ ‚  +EXECUTE stmt12 USING @arg; +RPAD(c1,10,?) +xxx‚ ‚ ‚ ‚ ‚ ‚ ‚  +EXECUTE stmt13 USING @arg; +SELECT * FROM t4; +c1 +± +x +•\ +EXECUTE stmt14 USING @arg; +SELECT * FROM t4; +c1 +± +‚  +•\ +SET @arg = '•\'; +EXECUTE stmt1 USING @arg; +? +•\ +•\ +•\ +•\ +•\ +•\ +EXECUTE stmt2 USING @arg; +± ‚  •\ +x x x +x x x +y y y +y y y +z z z +z z z +EXECUTE stmt3 USING @arg; +COUNT(*) +6 +EXECUTE stmt4 USING @arg; +CHAR_LENGTH(?) +1 +EXECUTE stmt5 USING @arg; +CHARSET(?) +sjis +EXECUTE stmt6 USING @arg; +INSERT(c1,1,1,?) +•\xx +EXECUTE stmt7 USING @arg; +INSTR(c1,?) +3 +EXECUTE stmt8 USING @arg; +LOCATE(?,c1) +3 +EXECUTE stmt9 USING @arg; +LPAD(c1,10,?) +•\•\•\•\•\•\•\xxx +EXECUTE stmt10 USING @arg; +REPLACE(c1,?,'x') +±‚ x +EXECUTE stmt11 USING @arg; +REPLACE(c1,'x',?) +•\•\•\ +EXECUTE stmt12 USING @arg; +RPAD(c1,10,?) +xxx•\•\•\•\•\•\•\ +EXECUTE stmt13 USING @arg; +SELECT * FROM t4; +c1 +± +‚  +x +EXECUTE stmt14 USING @arg; +SELECT * FROM t4; +c1 +± +‚  +•\ +DEALLOCATE PREPARE stmt1; +DEALLOCATE PREPARE stmt2; +DEALLOCATE PREPARE stmt3; +DEALLOCATE PREPARE stmt4; +DEALLOCATE PREPARE stmt5; +DEALLOCATE PREPARE stmt6; +DEALLOCATE PREPARE stmt7; +DEALLOCATE PREPARE stmt8; +DEALLOCATE PREPARE stmt9; +DEALLOCATE PREPARE stmt10; +DEALLOCATE PREPARE stmt11; +DEALLOCATE PREPARE stmt12; +DEALLOCATE PREPARE stmt13; +DEALLOCATE PREPARE stmt14; +DROP TABLE t1; +DROP TABLE t2; +DROP TABLE t3; +DROP TABLE t4; +CREATE TABLE t1(c1 char(3)) DEFAULT CHARSET = sjis ENGINE = HEAP; +CREATE TABLE t2(c1 char(3)) DEFAULT CHARSET = sjis ENGINE = HEAP; +CREATE TABLE t3( +`±` char(1), +`‚ ` char(1), +`•\` char(1) +)DEFAULT CHARSET = sjis ENGINE = HEAP; +CREATE TABLE t4(c1 char(1)) DEFAULT CHARSET = sjis ENGINE =HEAP; +INSERT INTO t1 VALUES ('xxx'); +INSERT INTO t2 VALUES ('±‚ •\'); +INSERT INTO t3 VALUES ('x','x','x'),('x','x','x'),('y','y','y'),('y','y','y'),('z','z','z'),('z','z','z'); +INSERT INTO t4 VALUES ('±'),('‚ '),('•\' ); +PREPARE stmt1 FROM 'SELECT ? FROM t3'; +PREPARE stmt2 FROM 'SELECT * FROM t3 ORDER BY ?'; +PREPARE stmt3 FROM 'SELECT COUNT(*) FROM t3 GROUP BY ?'; +PREPARE stmt4 FROM 'SELECT CHAR_LENGTH(?)'; +PREPARE stmt5 FROM 'SELECT CHARSET(?)'; +PREPARE stmt6 FROM 'SELECT INSERT(c1,1,1,?) FROM t1'; +PREPARE stmt7 FROM 'SELECT INSTR(c1,?) FROM t2'; +PREPARE stmt8 FROM 'SELECT LOCATE(?,c1) FROM t2'; +PREPARE stmt9 FROM 'SELECT LPAD(c1,10,?) FROM t1'; +PREPARE stmt10 FROM 'SELECT REPLACE(c1,?,\'x\') FROM t2'; +PREPARE stmt11 FROM 'SELECT REPLACE(c1,\'x\',?) FROM t1'; +PREPARE stmt12 FROM 'SELECT RPAD(c1,10,?) FROM t1'; +PREPARE stmt13 FROM 'UPDATE t4 SET c1=\'x\' WHERE c1=?'; +PREPARE stmt14 FROM 'UPDATE t4 SET c1=? WHERE c1=\'x\''; +SET @arg = '±'; +EXECUTE stmt1 USING @arg; +? +± +± +± +± +± +± +EXECUTE stmt2 USING @arg; +± ‚  •\ +x x x +x x x +y y y +y y y +z z z +z z z +EXECUTE stmt3 USING @arg; +COUNT(*) +6 +EXECUTE stmt4 USING @arg; +CHAR_LENGTH(?) +1 +EXECUTE stmt5 USING @arg; +CHARSET(?) +sjis +EXECUTE stmt6 USING @arg; +INSERT(c1,1,1,?) +±xx +EXECUTE stmt7 USING @arg; +INSTR(c1,?) +1 +EXECUTE stmt8 USING @arg; +LOCATE(?,c1) +1 +EXECUTE stmt9 USING @arg; +LPAD(c1,10,?) +±±±±±±±xxx +EXECUTE stmt10 USING @arg; +REPLACE(c1,?,'x') +x‚ •\ +EXECUTE stmt11 USING @arg; +REPLACE(c1,'x',?) +±±± +EXECUTE stmt12 USING @arg; +RPAD(c1,10,?) +xxx±±±±±±± +EXECUTE stmt13 USING @arg; +SELECT * FROM t4; +c1 +x +‚  +•\ +EXECUTE stmt14 USING @arg; +SELECT * FROM t4; +c1 +± +‚  +•\ +SET @arg = '‚ '; +EXECUTE stmt1 USING @arg; +? +‚  +‚  +‚  +‚  +‚  +‚  +EXECUTE stmt2 USING @arg; +± ‚  •\ +x x x +x x x +y y y +y y y +z z z +z z z +EXECUTE stmt3 USING @arg; +COUNT(*) +6 +EXECUTE stmt4 USING @arg; +CHAR_LENGTH(?) +1 +EXECUTE stmt5 USING @arg; +CHARSET(?) +sjis +EXECUTE stmt6 USING @arg; +INSERT(c1,1,1,?) +‚ xx +EXECUTE stmt7 USING @arg; +INSTR(c1,?) +2 +EXECUTE stmt8 USING @arg; +LOCATE(?,c1) +2 +EXECUTE stmt9 USING @arg; +LPAD(c1,10,?) +‚ ‚ ‚ ‚ ‚ ‚ ‚ xxx +EXECUTE stmt10 USING @arg; +REPLACE(c1,?,'x') +±x•\ +EXECUTE stmt11 USING @arg; +REPLACE(c1,'x',?) +‚ ‚ ‚  +EXECUTE stmt12 USING @arg; +RPAD(c1,10,?) +xxx‚ ‚ ‚ ‚ ‚ ‚ ‚  +EXECUTE stmt13 USING @arg; +SELECT * FROM t4; +c1 +± +x +•\ +EXECUTE stmt14 USING @arg; +SELECT * FROM t4; +c1 +± +‚  +•\ +SET @arg = '•\'; +EXECUTE stmt1 USING @arg; +? +•\ +•\ +•\ +•\ +•\ +•\ +EXECUTE stmt2 USING @arg; +± ‚  •\ +x x x +x x x +y y y +y y y +z z z +z z z +EXECUTE stmt3 USING @arg; +COUNT(*) +6 +EXECUTE stmt4 USING @arg; +CHAR_LENGTH(?) +1 +EXECUTE stmt5 USING @arg; +CHARSET(?) +sjis +EXECUTE stmt6 USING @arg; +INSERT(c1,1,1,?) +•\xx +EXECUTE stmt7 USING @arg; +INSTR(c1,?) +3 +EXECUTE stmt8 USING @arg; +LOCATE(?,c1) +3 +EXECUTE stmt9 USING @arg; +LPAD(c1,10,?) +•\•\•\•\•\•\•\xxx +EXECUTE stmt10 USING @arg; +REPLACE(c1,?,'x') +±‚ x +EXECUTE stmt11 USING @arg; +REPLACE(c1,'x',?) +•\•\•\ +EXECUTE stmt12 USING @arg; +RPAD(c1,10,?) +xxx•\•\•\•\•\•\•\ +EXECUTE stmt13 USING @arg; +SELECT * FROM t4; +c1 +± +‚  +x +EXECUTE stmt14 USING @arg; +SELECT * FROM t4; +c1 +± +‚  +•\ +DEALLOCATE PREPARE stmt1; +DEALLOCATE PREPARE stmt2; +DEALLOCATE PREPARE stmt3; +DEALLOCATE PREPARE stmt4; +DEALLOCATE PREPARE stmt5; +DEALLOCATE PREPARE stmt6; +DEALLOCATE PREPARE stmt7; +DEALLOCATE PREPARE stmt8; +DEALLOCATE PREPARE stmt9; +DEALLOCATE PREPARE stmt10; +DEALLOCATE PREPARE stmt11; +DEALLOCATE PREPARE stmt12; +DEALLOCATE PREPARE stmt13; +DEALLOCATE PREPARE stmt14; +DROP TABLE t1; +DROP TABLE t2; +DROP TABLE t3; +DROP TABLE t4; +CREATE TABLE t1(c1 char(3)) DEFAULT CHARSET = sjis ENGINE = BDB; +CREATE TABLE t2(c1 char(3)) DEFAULT CHARSET = sjis ENGINE = BDB; +CREATE TABLE t3( +`±` char(1), +`‚ ` char(1), +`•\` char(1) +)DEFAULT CHARSET = sjis ENGINE = BDB; +CREATE TABLE t4(c1 char(1)) DEFAULT CHARSET = sjis ENGINE = BDB; +INSERT INTO t1 VALUES ('xxx'); +INSERT INTO t2 VALUES ('±‚ •\'); +INSERT INTO t3 VALUES ('x','x','x'),('x','x','x'),('y','y','y'),('y','y','y'),('z','z','z'),('z','z','z'); +INSERT INTO t4 VALUES ('±'),('‚ '),('•\' ); +PREPARE stmt1 FROM 'SELECT ? FROM t3'; +PREPARE stmt2 FROM 'SELECT * FROM t3 ORDER BY ?'; +PREPARE stmt3 FROM 'SELECT COUNT(*) FROM t3 GROUP BY ?'; +PREPARE stmt4 FROM 'SELECT CHAR_LENGTH(?)'; +PREPARE stmt5 FROM 'SELECT CHARSET(?)'; +PREPARE stmt6 FROM 'SELECT INSERT(c1,1,1,?) FROM t1'; +PREPARE stmt7 FROM 'SELECT INSTR(c1,?) FROM t2'; +PREPARE stmt8 FROM 'SELECT LOCATE(?,c1) FROM t2'; +PREPARE stmt9 FROM 'SELECT LPAD(c1,10,?) FROM t1'; +PREPARE stmt10 FROM 'SELECT REPLACE(c1,?,\'x\') FROM t2'; +PREPARE stmt11 FROM 'SELECT REPLACE(c1,\'x\',?) FROM t1'; +PREPARE stmt12 FROM 'SELECT RPAD(c1,10,?) FROM t1'; +PREPARE stmt13 FROM 'UPDATE t4 SET c1=\'x\' WHERE c1=?'; +PREPARE stmt14 FROM 'UPDATE t4 SET c1=? WHERE c1=\'x\''; +SET @arg = '±'; +EXECUTE stmt1 USING @arg; +? +± +± +± +± +± +± +EXECUTE stmt2 USING @arg; +± ‚  •\ +x x x +x x x +y y y +y y y +z z z +z z z +EXECUTE stmt3 USING @arg; +COUNT(*) +6 +EXECUTE stmt4 USING @arg; +CHAR_LENGTH(?) +1 +EXECUTE stmt5 USING @arg; +CHARSET(?) +sjis +EXECUTE stmt6 USING @arg; +INSERT(c1,1,1,?) +±xx +EXECUTE stmt7 USING @arg; +INSTR(c1,?) +1 +EXECUTE stmt8 USING @arg; +LOCATE(?,c1) +1 +EXECUTE stmt9 USING @arg; +LPAD(c1,10,?) +±±±±±±±xxx +EXECUTE stmt10 USING @arg; +REPLACE(c1,?,'x') +x‚ •\ +EXECUTE stmt11 USING @arg; +REPLACE(c1,'x',?) +±±± +EXECUTE stmt12 USING @arg; +RPAD(c1,10,?) +xxx±±±±±±± +EXECUTE stmt13 USING @arg; +SELECT * FROM t3; +± ‚  •\ +x x x +x x x +y y y +y y y +z z z +z z z +EXECUTE stmt14 USING @arg; +SELECT * FROM t3; +± ‚  •\ +x x x +x x x +y y y +y y y +z z z +z z z +SET @arg = '‚ '; +EXECUTE stmt1 USING @arg; +? +‚  +‚  +‚  +‚  +‚  +‚  +EXECUTE stmt2 USING @arg; +± ‚  •\ +x x x +x x x +y y y +y y y +z z z +z z z +EXECUTE stmt3 USING @arg; +COUNT(*) +6 +EXECUTE stmt4 USING @arg; +CHAR_LENGTH(?) +1 +EXECUTE stmt5 USING @arg; +CHARSET(?) +sjis +EXECUTE stmt6 USING @arg; +INSERT(c1,1,1,?) +‚ xx +EXECUTE stmt7 USING @arg; +INSTR(c1,?) +2 +EXECUTE stmt8 USING @arg; +LOCATE(?,c1) +2 +EXECUTE stmt9 USING @arg; +LPAD(c1,10,?) +‚ ‚ ‚ ‚ ‚ ‚ ‚ xxx +EXECUTE stmt10 USING @arg; +REPLACE(c1,?,'x') +±x•\ +EXECUTE stmt11 USING @arg; +REPLACE(c1,'x',?) +‚ ‚ ‚  +EXECUTE stmt12 USING @arg; +RPAD(c1,10,?) +xxx‚ ‚ ‚ ‚ ‚ ‚ ‚  +EXECUTE stmt13 USING @arg; +SELECT * FROM t4; +c1 +± +x +•\ +EXECUTE stmt14 USING @arg; +SELECT * FROM t4; +c1 +± +‚  +•\ +SET @arg = '•\'; +EXECUTE stmt1 USING @arg; +? +•\ +•\ +•\ +•\ +•\ +•\ +EXECUTE stmt2 USING @arg; +± ‚  •\ +x x x +x x x +y y y +y y y +z z z +z z z +EXECUTE stmt3 USING @arg; +COUNT(*) +6 +EXECUTE stmt4 USING @arg; +CHAR_LENGTH(?) +1 +EXECUTE stmt5 USING @arg; +CHARSET(?) +sjis +EXECUTE stmt6 USING @arg; +INSERT(c1,1,1,?) +•\xx +EXECUTE stmt7 USING @arg; +INSTR(c1,?) +3 +EXECUTE stmt8 USING @arg; +LOCATE(?,c1) +3 +EXECUTE stmt9 USING @arg; +LPAD(c1,10,?) +•\•\•\•\•\•\•\xxx +EXECUTE stmt10 USING @arg; +REPLACE(c1,?,'x') +±‚ x +EXECUTE stmt11 USING @arg; +REPLACE(c1,'x',?) +•\•\•\ +EXECUTE stmt12 USING @arg; +RPAD(c1,10,?) +xxx•\•\•\•\•\•\•\ +EXECUTE stmt13 USING @arg; +SELECT * FROM t4; +c1 +± +‚  +x +EXECUTE stmt14 USING @arg; +SELECT * FROM t4; +c1 +± +‚  +•\ +DEALLOCATE PREPARE stmt1; +DEALLOCATE PREPARE stmt2; +DEALLOCATE PREPARE stmt3; +DEALLOCATE PREPARE stmt4; +DEALLOCATE PREPARE stmt5; +DEALLOCATE PREPARE stmt6; +DEALLOCATE PREPARE stmt7; +DEALLOCATE PREPARE stmt8; +DEALLOCATE PREPARE stmt9; +DEALLOCATE PREPARE stmt10; +DEALLOCATE PREPARE stmt11; +DEALLOCATE PREPARE stmt12; +DEALLOCATE PREPARE stmt13; +DEALLOCATE PREPARE stmt14; +DROP TABLE t1; +DROP TABLE t2; +DROP TABLE t3; +DROP TABLE t4; diff --git a/mysql-test/suite/jp/r/jp_ps_ujis.result b/mysql-test/suite/jp/r/jp_ps_ujis.result new file mode 100755 index 00000000000..9afef7f76d1 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_ps_ujis.result @@ -0,0 +1,896 @@ +DROP TABLE IF EXISTS t1; +DROP TABLE IF EXISTS t2; +DROP TABLE IF EXISTS t3; +DROP TABLE IF EXISTS t4; +SET NAMES ujis; +SET character_set_database = ujis; +CREATE TABLE t1(c1 char(3)) DEFAULT CHARSET = ujis ENGINE = InnoDB; +CREATE TABLE t2(c1 char(3)) DEFAULT CHARSET = ujis ENGINE = InnoDB; +CREATE TABLE t3( +`ޱ` char(1), +`¤¢` char(1), +`íÜ` char(1) +)DEFAULT CHARSET = ujis ENGINE = InnoDB; +CREATE TABLE t4(c1 char(1)) DEFAULT CHARSET = ujis ENGINE = InnoDB; +INSERT INTO t1 VALUES ('xxx'); +INSERT INTO t2 VALUES ('ޱ¤¢íÜ'); +INSERT INTO t3 VALUES ('x','x','x'),('x','x','x'),('y','y','y'),('y','y','y'),('z','z','z'),('z','z','z'); +INSERT INTO t4 VALUES ('ޱ'),('¤¢'),('íÜ'); +PREPARE stmt1 FROM 'SELECT ? FROM t3'; +PREPARE stmt2 FROM 'SELECT * FROM t3 ORDER BY ?'; +PREPARE stmt3 FROM 'SELECT COUNT(*) FROM t3 GROUP BY ?'; +PREPARE stmt4 FROM 'SELECT CHAR_LENGTH(?)'; +PREPARE stmt5 FROM 'SELECT CHARSET(?)'; +PREPARE stmt6 FROM 'SELECT INSERT(c1,1,1,?) FROM t1'; +PREPARE stmt7 FROM 'SELECT INSTR(c1,?) FROM t2'; +PREPARE stmt8 FROM 'SELECT LOCATE(?,c1) FROM t2'; +PREPARE stmt9 FROM 'SELECT LPAD(c1,9,?) FROM t1'; +PREPARE stmt10 FROM 'SELECT REPLACE(c1,?,\'x\') FROM t2'; +PREPARE stmt11 FROM 'SELECT REPLACE(c1,\'x\',?) FROM t1'; +PREPARE stmt12 FROM 'SELECT RPAD(c1,9,?) FROM t1'; +PREPARE stmt13 FROM 'UPDATE t4 SET c1=\'x\' WHERE c1=?'; +PREPARE stmt14 FROM 'UPDATE t4 SET c1=? WHERE c1=\'x\''; +SET @arg = 'ޱ'; +EXECUTE stmt1 USING @arg; +? +ޱ +ޱ +ޱ +ޱ +ޱ +ޱ +EXECUTE stmt2 USING @arg; +ޱ ¤¢ íÜ +x x x +x x x +y y y +y y y +z z z +z z z +EXECUTE stmt3 USING @arg; +COUNT(*) +6 +EXECUTE stmt4 USING @arg; +CHAR_LENGTH(?) +1 +EXECUTE stmt5 USING @arg; +CHARSET(?) +ujis +EXECUTE stmt6 USING @arg; +INSERT(c1,1,1,?) +ޱxx +EXECUTE stmt7 USING @arg; +INSTR(c1,?) +1 +EXECUTE stmt8 USING @arg; +LOCATE(?,c1) +1 +EXECUTE stmt9 USING @arg; +LPAD(c1,9,?) +ޱޱޱޱޱޱxxx +EXECUTE stmt10 USING @arg; +REPLACE(c1,?,'x') +x¤¢íÜ +EXECUTE stmt11 USING @arg; +REPLACE(c1,'x',?) +ޱޱޱ +EXECUTE stmt12 USING @arg; +RPAD(c1,9,?) +xxxޱޱޱޱޱޱ +EXECUTE stmt13 USING @arg; +SELECT * FROM t4; +c1 +x +¤¢ +íÜ +EXECUTE stmt14 USING @arg; +SELECT * FROM t4; +c1 +ޱ +¤¢ +íÜ +SET @arg = '¤¢'; +EXECUTE stmt1 USING @arg; +? +¤¢ +¤¢ +¤¢ +¤¢ +¤¢ +¤¢ +EXECUTE stmt2 USING @arg; +ޱ ¤¢ íÜ +x x x +x x x +y y y +y y y +z z z +z z z +EXECUTE stmt3 USING @arg; +COUNT(*) +6 +EXECUTE stmt4 USING @arg; +CHAR_LENGTH(?) +1 +EXECUTE stmt5 USING @arg; +CHARSET(?) +ujis +EXECUTE stmt6 USING @arg; +INSERT(c1,1,1,?) +¤¢xx +EXECUTE stmt7 USING @arg; +INSTR(c1,?) +2 +EXECUTE stmt8 USING @arg; +LOCATE(?,c1) +2 +EXECUTE stmt9 USING @arg; +LPAD(c1,9,?) +¤¢¤¢¤¢¤¢¤¢¤¢xxx +EXECUTE stmt10 USING @arg; +REPLACE(c1,?,'x') +ޱxíÜ +EXECUTE stmt11 USING @arg; +REPLACE(c1,'x',?) +¤¢¤¢¤¢ +EXECUTE stmt12 USING @arg; +RPAD(c1,9,?) +xxx¤¢¤¢¤¢¤¢¤¢¤¢ +EXECUTE stmt13 USING @arg; +SELECT * FROM t4; +c1 +ޱ +x +íÜ +EXECUTE stmt14 USING @arg; +SELECT * FROM t4; +c1 +ޱ +¤¢ +íÜ +SET @arg = 'íÜ'; +EXECUTE stmt1 USING @arg; +? +íÜ +íÜ +íÜ +íÜ +íÜ +íÜ +EXECUTE stmt2 USING @arg; +ޱ ¤¢ íÜ +x x x +x x x +y y y +y y y +z z z +z z z +EXECUTE stmt3 USING @arg; +COUNT(*) +6 +EXECUTE stmt4 USING @arg; +CHAR_LENGTH(?) +1 +EXECUTE stmt5 USING @arg; +CHARSET(?) +ujis +EXECUTE stmt6 USING @arg; +INSERT(c1,1,1,?) +íÜxx +EXECUTE stmt7 USING @arg; +INSTR(c1,?) +3 +EXECUTE stmt8 USING @arg; +LOCATE(?,c1) +3 +EXECUTE stmt9 USING @arg; +LPAD(c1,9,?) +íÜíÜíÜíÜíÜíÜxxx +EXECUTE stmt10 USING @arg; +REPLACE(c1,?,'x') +ޱ¤¢x +EXECUTE stmt11 USING @arg; +REPLACE(c1,'x',?) +íÜíÜíÜ +EXECUTE stmt12 USING @arg; +RPAD(c1,9,?) +xxxíÜíÜíÜíÜíÜíÜ +EXECUTE stmt13 USING @arg; +SELECT * FROM t4; +c1 +ޱ +¤¢ +x +EXECUTE stmt14 USING @arg; +SELECT * FROM t4; +c1 +ޱ +¤¢ +íÜ +DEALLOCATE PREPARE stmt1; +DEALLOCATE PREPARE stmt2; +DEALLOCATE PREPARE stmt3; +DEALLOCATE PREPARE stmt4; +DEALLOCATE PREPARE stmt5; +DEALLOCATE PREPARE stmt6; +DEALLOCATE PREPARE stmt7; +DEALLOCATE PREPARE stmt8; +DEALLOCATE PREPARE stmt9; +DEALLOCATE PREPARE stmt10; +DEALLOCATE PREPARE stmt11; +DEALLOCATE PREPARE stmt12; +DEALLOCATE PREPARE stmt13; +DEALLOCATE PREPARE stmt14; +DROP TABLE t1; +DROP TABLE t2; +DROP TABLE t3; +DROP TABLE t4; +CREATE TABLE t1(c1 char(3)) DEFAULT CHARSET = ujis ENGINE = MyISAM; +CREATE TABLE t2(c1 char(3)) DEFAULT CHARSET = ujis ENGINE = MyISAM; +CREATE TABLE t3( +`ޱ` char(1), +`¤¢` char(1), +`íÜ` char(1) +)DEFAULT CHARSET = ujis ENGINE = MyISAM; +CREATE TABLE t4(c1 char(1)) DEFAULT CHARSET = ujis ENGINE = MyISAM; +INSERT INTO t1 VALUES ('xxx'); +INSERT INTO t2 VALUES ('ޱ¤¢íÜ'); +INSERT INTO t3 VALUES ('x','x','x'),('x','x','x'),('y','y','y'),('y','y','y'),('z','z','z'),('z','z','z'); +INSERT INTO t4 VALUES ('ޱ'),('¤¢'),('íÜ' ); +PREPARE stmt1 FROM 'SELECT ? FROM t3'; +PREPARE stmt2 FROM 'SELECT * FROM t3 ORDER BY ?'; +PREPARE stmt3 FROM 'SELECT COUNT(*) FROM t3 GROUP BY ?'; +PREPARE stmt4 FROM 'SELECT CHAR_LENGTH(?)'; +PREPARE stmt5 FROM 'SELECT CHARSET(?)'; +PREPARE stmt6 FROM 'SELECT INSERT(c1,1,1,?) FROM t1'; +PREPARE stmt7 FROM 'SELECT INSTR(c1,?) FROM t2'; +PREPARE stmt8 FROM 'SELECT LOCATE(?,c1) FROM t2'; +PREPARE stmt9 FROM 'SELECT LPAD(c1,9,?) FROM t1'; +PREPARE stmt10 FROM 'SELECT REPLACE(c1,?,\'x\') FROM t2'; +PREPARE stmt11 FROM 'SELECT REPLACE(c1,\'x\',?) FROM t1'; +PREPARE stmt12 FROM 'SELECT RPAD(c1,9,?) FROM t1'; +PREPARE stmt13 FROM 'UPDATE t4 SET c1=\'x\' WHERE c1=?'; +PREPARE stmt14 FROM 'UPDATE t4 SET c1=? WHERE c1=\'x\''; +SET @arg = 'ޱ'; +EXECUTE stmt1 USING @arg; +? +ޱ +ޱ +ޱ +ޱ +ޱ +ޱ +EXECUTE stmt2 USING @arg; +ޱ ¤¢ íÜ +x x x +x x x +y y y +y y y +z z z +z z z +EXECUTE stmt3 USING @arg; +COUNT(*) +6 +EXECUTE stmt4 USING @arg; +CHAR_LENGTH(?) +1 +EXECUTE stmt5 USING @arg; +CHARSET(?) +ujis +EXECUTE stmt6 USING @arg; +INSERT(c1,1,1,?) +ޱxx +EXECUTE stmt7 USING @arg; +INSTR(c1,?) +1 +EXECUTE stmt8 USING @arg; +LOCATE(?,c1) +1 +EXECUTE stmt9 USING @arg; +LPAD(c1,9,?) +ޱޱޱޱޱޱxxx +EXECUTE stmt10 USING @arg; +REPLACE(c1,?,'x') +x¤¢íÜ +EXECUTE stmt11 USING @arg; +REPLACE(c1,'x',?) +ޱޱޱ +EXECUTE stmt12 USING @arg; +RPAD(c1,9,?) +xxxޱޱޱޱޱޱ +EXECUTE stmt13 USING @arg; +SELECT * FROM t4; +c1 +x +¤¢ +íÜ +EXECUTE stmt14 USING @arg; +SELECT * FROM t4; +c1 +ޱ +¤¢ +íÜ +SET @arg = '¤¢'; +EXECUTE stmt1 USING @arg; +? +¤¢ +¤¢ +¤¢ +¤¢ +¤¢ +¤¢ +EXECUTE stmt2 USING @arg; +ޱ ¤¢ íÜ +x x x +x x x +y y y +y y y +z z z +z z z +EXECUTE stmt3 USING @arg; +COUNT(*) +6 +EXECUTE stmt4 USING @arg; +CHAR_LENGTH(?) +1 +EXECUTE stmt5 USING @arg; +CHARSET(?) +ujis +EXECUTE stmt6 USING @arg; +INSERT(c1,1,1,?) +¤¢xx +EXECUTE stmt7 USING @arg; +INSTR(c1,?) +2 +EXECUTE stmt8 USING @arg; +LOCATE(?,c1) +2 +EXECUTE stmt9 USING @arg; +LPAD(c1,9,?) +¤¢¤¢¤¢¤¢¤¢¤¢xxx +EXECUTE stmt10 USING @arg; +REPLACE(c1,?,'x') +ޱxíÜ +EXECUTE stmt11 USING @arg; +REPLACE(c1,'x',?) +¤¢¤¢¤¢ +EXECUTE stmt12 USING @arg; +RPAD(c1,9,?) +xxx¤¢¤¢¤¢¤¢¤¢¤¢ +EXECUTE stmt13 USING @arg; +SELECT * FROM t4; +c1 +ޱ +x +íÜ +EXECUTE stmt14 USING @arg; +SELECT * FROM t4; +c1 +ޱ +¤¢ +íÜ +SET @arg = 'íÜ'; +EXECUTE stmt1 USING @arg; +? +íÜ +íÜ +íÜ +íÜ +íÜ +íÜ +EXECUTE stmt2 USING @arg; +ޱ ¤¢ íÜ +x x x +x x x +y y y +y y y +z z z +z z z +EXECUTE stmt3 USING @arg; +COUNT(*) +6 +EXECUTE stmt4 USING @arg; +CHAR_LENGTH(?) +1 +EXECUTE stmt5 USING @arg; +CHARSET(?) +ujis +EXECUTE stmt6 USING @arg; +INSERT(c1,1,1,?) +íÜxx +EXECUTE stmt7 USING @arg; +INSTR(c1,?) +3 +EXECUTE stmt8 USING @arg; +LOCATE(?,c1) +3 +EXECUTE stmt9 USING @arg; +LPAD(c1,9,?) +íÜíÜíÜíÜíÜíÜxxx +EXECUTE stmt10 USING @arg; +REPLACE(c1,?,'x') +ޱ¤¢x +EXECUTE stmt11 USING @arg; +REPLACE(c1,'x',?) +íÜíÜíÜ +EXECUTE stmt12 USING @arg; +RPAD(c1,9,?) +xxxíÜíÜíÜíÜíÜíÜ +EXECUTE stmt13 USING @arg; +SELECT * FROM t4; +c1 +ޱ +¤¢ +x +EXECUTE stmt14 USING @arg; +SELECT * FROM t4; +c1 +ޱ +¤¢ +íÜ +DEALLOCATE PREPARE stmt1; +DEALLOCATE PREPARE stmt2; +DEALLOCATE PREPARE stmt3; +DEALLOCATE PREPARE stmt4; +DEALLOCATE PREPARE stmt5; +DEALLOCATE PREPARE stmt6; +DEALLOCATE PREPARE stmt7; +DEALLOCATE PREPARE stmt8; +DEALLOCATE PREPARE stmt9; +DEALLOCATE PREPARE stmt10; +DEALLOCATE PREPARE stmt11; +DEALLOCATE PREPARE stmt12; +DEALLOCATE PREPARE stmt13; +DEALLOCATE PREPARE stmt14; +DROP TABLE t1; +DROP TABLE t2; +DROP TABLE t3; +DROP TABLE t4; +CREATE TABLE t1(c1 char(3)) DEFAULT CHARSET = ujis ENGINE = HEAP; +CREATE TABLE t2(c1 char(3)) DEFAULT CHARSET = ujis ENGINE = HEAP; +CREATE TABLE t3( +`ޱ` char(1), +`¤¢` char(1), +`íÜ` char(1) +)DEFAULT CHARSET = ujis ENGINE = HEAP; +CREATE TABLE t4(c1 char(1)) DEFAULT CHARSET = ujis ENGINE =HEAP; +INSERT INTO t1 VALUES ('xxx'); +INSERT INTO t2 VALUES ('ޱ¤¢íÜ'); +INSERT INTO t3 VALUES ('x','x','x'),('x','x','x'),('y','y','y'),('y','y','y'),('z','z','z'),('z','z','z'); +INSERT INTO t4 VALUES ('ޱ'),('¤¢'),('íÜ' ); +PREPARE stmt1 FROM 'SELECT ? FROM t3'; +PREPARE stmt2 FROM 'SELECT * FROM t3 ORDER BY ?'; +PREPARE stmt3 FROM 'SELECT COUNT(*) FROM t3 GROUP BY ?'; +PREPARE stmt4 FROM 'SELECT CHAR_LENGTH(?)'; +PREPARE stmt5 FROM 'SELECT CHARSET(?)'; +PREPARE stmt6 FROM 'SELECT INSERT(c1,1,1,?) FROM t1'; +PREPARE stmt7 FROM 'SELECT INSTR(c1,?) FROM t2'; +PREPARE stmt8 FROM 'SELECT LOCATE(?,c1) FROM t2'; +PREPARE stmt9 FROM 'SELECT LPAD(c1,9,?) FROM t1'; +PREPARE stmt10 FROM 'SELECT REPLACE(c1,?,\'x\') FROM t2'; +PREPARE stmt11 FROM 'SELECT REPLACE(c1,\'x\',?) FROM t1'; +PREPARE stmt12 FROM 'SELECT RPAD(c1,9,?) FROM t1'; +PREPARE stmt13 FROM 'UPDATE t4 SET c1=\'x\' WHERE c1=?'; +PREPARE stmt14 FROM 'UPDATE t4 SET c1=? WHERE c1=\'x\''; +SET @arg = 'ޱ'; +EXECUTE stmt1 USING @arg; +? +ޱ +ޱ +ޱ +ޱ +ޱ +ޱ +EXECUTE stmt2 USING @arg; +ޱ ¤¢ íÜ +x x x +x x x +y y y +y y y +z z z +z z z +EXECUTE stmt3 USING @arg; +COUNT(*) +6 +EXECUTE stmt4 USING @arg; +CHAR_LENGTH(?) +1 +EXECUTE stmt5 USING @arg; +CHARSET(?) +ujis +EXECUTE stmt6 USING @arg; +INSERT(c1,1,1,?) +ޱxx +EXECUTE stmt7 USING @arg; +INSTR(c1,?) +1 +EXECUTE stmt8 USING @arg; +LOCATE(?,c1) +1 +EXECUTE stmt9 USING @arg; +LPAD(c1,9,?) +ޱޱޱޱޱޱxxx +EXECUTE stmt10 USING @arg; +REPLACE(c1,?,'x') +x¤¢íÜ +EXECUTE stmt11 USING @arg; +REPLACE(c1,'x',?) +ޱޱޱ +EXECUTE stmt12 USING @arg; +RPAD(c1,9,?) +xxxޱޱޱޱޱޱ +EXECUTE stmt13 USING @arg; +SELECT * FROM t4; +c1 +x +¤¢ +íÜ +EXECUTE stmt14 USING @arg; +SELECT * FROM t4; +c1 +ޱ +¤¢ +íÜ +SET @arg = '¤¢'; +EXECUTE stmt1 USING @arg; +? +¤¢ +¤¢ +¤¢ +¤¢ +¤¢ +¤¢ +EXECUTE stmt2 USING @arg; +ޱ ¤¢ íÜ +x x x +x x x +y y y +y y y +z z z +z z z +EXECUTE stmt3 USING @arg; +COUNT(*) +6 +EXECUTE stmt4 USING @arg; +CHAR_LENGTH(?) +1 +EXECUTE stmt5 USING @arg; +CHARSET(?) +ujis +EXECUTE stmt6 USING @arg; +INSERT(c1,1,1,?) +¤¢xx +EXECUTE stmt7 USING @arg; +INSTR(c1,?) +2 +EXECUTE stmt8 USING @arg; +LOCATE(?,c1) +2 +EXECUTE stmt9 USING @arg; +LPAD(c1,9,?) +¤¢¤¢¤¢¤¢¤¢¤¢xxx +EXECUTE stmt10 USING @arg; +REPLACE(c1,?,'x') +ޱxíÜ +EXECUTE stmt11 USING @arg; +REPLACE(c1,'x',?) +¤¢¤¢¤¢ +EXECUTE stmt12 USING @arg; +RPAD(c1,9,?) +xxx¤¢¤¢¤¢¤¢¤¢¤¢ +EXECUTE stmt13 USING @arg; +SELECT * FROM t4; +c1 +ޱ +x +íÜ +EXECUTE stmt14 USING @arg; +SELECT * FROM t4; +c1 +ޱ +¤¢ +íÜ +SET @arg = 'íÜ'; +EXECUTE stmt1 USING @arg; +? +íÜ +íÜ +íÜ +íÜ +íÜ +íÜ +EXECUTE stmt2 USING @arg; +ޱ ¤¢ íÜ +x x x +x x x +y y y +y y y +z z z +z z z +EXECUTE stmt3 USING @arg; +COUNT(*) +6 +EXECUTE stmt4 USING @arg; +CHAR_LENGTH(?) +1 +EXECUTE stmt5 USING @arg; +CHARSET(?) +ujis +EXECUTE stmt6 USING @arg; +INSERT(c1,1,1,?) +íÜxx +EXECUTE stmt7 USING @arg; +INSTR(c1,?) +3 +EXECUTE stmt8 USING @arg; +LOCATE(?,c1) +3 +EXECUTE stmt9 USING @arg; +LPAD(c1,9,?) +íÜíÜíÜíÜíÜíÜxxx +EXECUTE stmt10 USING @arg; +REPLACE(c1,?,'x') +ޱ¤¢x +EXECUTE stmt11 USING @arg; +REPLACE(c1,'x',?) +íÜíÜíÜ +EXECUTE stmt12 USING @arg; +RPAD(c1,9,?) +xxxíÜíÜíÜíÜíÜíÜ +EXECUTE stmt13 USING @arg; +SELECT * FROM t4; +c1 +ޱ +¤¢ +x +EXECUTE stmt14 USING @arg; +SELECT * FROM t4; +c1 +ޱ +¤¢ +íÜ +DEALLOCATE PREPARE stmt1; +DEALLOCATE PREPARE stmt2; +DEALLOCATE PREPARE stmt3; +DEALLOCATE PREPARE stmt4; +DEALLOCATE PREPARE stmt5; +DEALLOCATE PREPARE stmt6; +DEALLOCATE PREPARE stmt7; +DEALLOCATE PREPARE stmt8; +DEALLOCATE PREPARE stmt9; +DEALLOCATE PREPARE stmt10; +DEALLOCATE PREPARE stmt11; +DEALLOCATE PREPARE stmt12; +DEALLOCATE PREPARE stmt13; +DEALLOCATE PREPARE stmt14; +DROP TABLE t1; +DROP TABLE t2; +DROP TABLE t3; +DROP TABLE t4; +CREATE TABLE t1(c1 char(3)) DEFAULT CHARSET = ujis ENGINE = BDB; +CREATE TABLE t2(c1 char(3)) DEFAULT CHARSET = ujis ENGINE = BDB; +CREATE TABLE t3( +`ޱ` char(1), +`¤¢` char(1), +`íÜ` char(1) +)DEFAULT CHARSET = ujis ENGINE = BDB; +CREATE TABLE t4(c1 char(1)) DEFAULT CHARSET = ujis ENGINE = BDB; +INSERT INTO t1 VALUES ('xxx'); +INSERT INTO t2 VALUES ('ޱ¤¢íÜ'); +INSERT INTO t3 VALUES ('x','x','x'),('x','x','x'),('y','y','y'),('y','y','y'),('z','z','z'),('z','z','z'); +INSERT INTO t4 VALUES ('ޱ'),('¤¢'),('íÜ' ); +PREPARE stmt1 FROM 'SELECT ? FROM t3'; +PREPARE stmt2 FROM 'SELECT * FROM t3 ORDER BY ?'; +PREPARE stmt3 FROM 'SELECT COUNT(*) FROM t3 GROUP BY ?'; +PREPARE stmt4 FROM 'SELECT CHAR_LENGTH(?)'; +PREPARE stmt5 FROM 'SELECT CHARSET(?)'; +PREPARE stmt6 FROM 'SELECT INSERT(c1,1,1,?) FROM t1'; +PREPARE stmt7 FROM 'SELECT INSTR(c1,?) FROM t2'; +PREPARE stmt8 FROM 'SELECT LOCATE(?,c1) FROM t2'; +PREPARE stmt9 FROM 'SELECT LPAD(c1,9,?) FROM t1'; +PREPARE stmt10 FROM 'SELECT REPLACE(c1,?,\'x\') FROM t2'; +PREPARE stmt11 FROM 'SELECT REPLACE(c1,\'x\',?) FROM t1'; +PREPARE stmt12 FROM 'SELECT RPAD(c1,9,?) FROM t1'; +PREPARE stmt13 FROM 'UPDATE t4 SET c1=\'x\' WHERE c1=?'; +PREPARE stmt14 FROM 'UPDATE t4 SET c1=? WHERE c1=\'x\''; +SET @arg = 'ޱ'; +EXECUTE stmt1 USING @arg; +? +ޱ +ޱ +ޱ +ޱ +ޱ +ޱ +EXECUTE stmt2 USING @arg; +ޱ ¤¢ íÜ +x x x +x x x +y y y +y y y +z z z +z z z +EXECUTE stmt3 USING @arg; +COUNT(*) +6 +EXECUTE stmt4 USING @arg; +CHAR_LENGTH(?) +1 +EXECUTE stmt5 USING @arg; +CHARSET(?) +ujis +EXECUTE stmt6 USING @arg; +INSERT(c1,1,1,?) +ޱxx +EXECUTE stmt7 USING @arg; +INSTR(c1,?) +1 +EXECUTE stmt8 USING @arg; +LOCATE(?,c1) +1 +EXECUTE stmt9 USING @arg; +LPAD(c1,9,?) +ޱޱޱޱޱޱxxx +EXECUTE stmt10 USING @arg; +REPLACE(c1,?,'x') +x¤¢íÜ +EXECUTE stmt11 USING @arg; +REPLACE(c1,'x',?) +ޱޱޱ +EXECUTE stmt12 USING @arg; +RPAD(c1,9,?) +xxxޱޱޱޱޱޱ +EXECUTE stmt13 USING @arg; +SELECT * FROM t3; +ޱ ¤¢ íÜ +x x x +x x x +y y y +y y y +z z z +z z z +EXECUTE stmt14 USING @arg; +SELECT * FROM t3; +ޱ ¤¢ íÜ +x x x +x x x +y y y +y y y +z z z +z z z +SET @arg = '¤¢'; +EXECUTE stmt1 USING @arg; +? +¤¢ +¤¢ +¤¢ +¤¢ +¤¢ +¤¢ +EXECUTE stmt2 USING @arg; +ޱ ¤¢ íÜ +x x x +x x x +y y y +y y y +z z z +z z z +EXECUTE stmt3 USING @arg; +COUNT(*) +6 +EXECUTE stmt4 USING @arg; +CHAR_LENGTH(?) +1 +EXECUTE stmt5 USING @arg; +CHARSET(?) +ujis +EXECUTE stmt6 USING @arg; +INSERT(c1,1,1,?) +¤¢xx +EXECUTE stmt7 USING @arg; +INSTR(c1,?) +2 +EXECUTE stmt8 USING @arg; +LOCATE(?,c1) +2 +EXECUTE stmt9 USING @arg; +LPAD(c1,9,?) +¤¢¤¢¤¢¤¢¤¢¤¢xxx +EXECUTE stmt10 USING @arg; +REPLACE(c1,?,'x') +ޱxíÜ +EXECUTE stmt11 USING @arg; +REPLACE(c1,'x',?) +¤¢¤¢¤¢ +EXECUTE stmt12 USING @arg; +RPAD(c1,9,?) +xxx¤¢¤¢¤¢¤¢¤¢¤¢ +EXECUTE stmt13 USING @arg; +SELECT * FROM t4; +c1 +ޱ +x +íÜ +EXECUTE stmt14 USING @arg; +SELECT * FROM t4; +c1 +ޱ +¤¢ +íÜ +SET @arg = 'íÜ'; +EXECUTE stmt1 USING @arg; +? +íÜ +íÜ +íÜ +íÜ +íÜ +íÜ +EXECUTE stmt2 USING @arg; +ޱ ¤¢ íÜ +x x x +x x x +y y y +y y y +z z z +z z z +EXECUTE stmt3 USING @arg; +COUNT(*) +6 +EXECUTE stmt4 USING @arg; +CHAR_LENGTH(?) +1 +EXECUTE stmt5 USING @arg; +CHARSET(?) +ujis +EXECUTE stmt6 USING @arg; +INSERT(c1,1,1,?) +íÜxx +EXECUTE stmt7 USING @arg; +INSTR(c1,?) +3 +EXECUTE stmt8 USING @arg; +LOCATE(?,c1) +3 +EXECUTE stmt9 USING @arg; +LPAD(c1,9,?) +íÜíÜíÜíÜíÜíÜxxx +EXECUTE stmt10 USING @arg; +REPLACE(c1,?,'x') +ޱ¤¢x +EXECUTE stmt11 USING @arg; +REPLACE(c1,'x',?) +íÜíÜíÜ +EXECUTE stmt12 USING @arg; +RPAD(c1,9,?) +xxxíÜíÜíÜíÜíÜíÜ +EXECUTE stmt13 USING @arg; +SELECT * FROM t4; +c1 +ޱ +¤¢ +x +EXECUTE stmt14 USING @arg; +SELECT * FROM t4; +c1 +ޱ +¤¢ +íÜ +DEALLOCATE PREPARE stmt1; +DEALLOCATE PREPARE stmt2; +DEALLOCATE PREPARE stmt3; +DEALLOCATE PREPARE stmt4; +DEALLOCATE PREPARE stmt5; +DEALLOCATE PREPARE stmt6; +DEALLOCATE PREPARE stmt7; +DEALLOCATE PREPARE stmt8; +DEALLOCATE PREPARE stmt9; +DEALLOCATE PREPARE stmt10; +DEALLOCATE PREPARE stmt11; +DEALLOCATE PREPARE stmt12; +DEALLOCATE PREPARE stmt13; +DEALLOCATE PREPARE stmt14; +DROP TABLE t1; +DROP TABLE t2; +DROP TABLE t3; +DROP TABLE t4; diff --git a/mysql-test/suite/jp/r/jp_replace_sjis.result b/mysql-test/suite/jp/r/jp_replace_sjis.result new file mode 100755 index 00000000000..08e45968fdd --- /dev/null +++ b/mysql-test/suite/jp/r/jp_replace_sjis.result @@ -0,0 +1,230 @@ +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +drop table if exists `‚s‚P‚P`; +drop table if exists `‚s‚P‚Q`; +SET NAMES sjis; +SET character_set_database = sjis; +CREATE TABLE `‚s‚P` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Q` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚R` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚S` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚T` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚U` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚V` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚W` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚X` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚O` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚P` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚Q` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = bdb; +INSERT INTO `‚s‚P` VALUES ('±²³´µ'); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚S` VALUES ('±²³´µ'); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚V` VALUES ('±²³´µ'); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ'); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\'); +SELECT REPLACE(`‚b‚P`,'±','±±') FROM `‚s‚P`; +REPLACE(`‚b‚P`,'±','±±') +±±²³´µ +SELECT REPLACE(`‚b‚P`,'²','²²') FROM `‚s‚P`; +REPLACE(`‚b‚P`,'²','²²') +±²²³´µ +SELECT REPLACE(`‚b‚P`,'³','³³') FROM `‚s‚P`; +REPLACE(`‚b‚P`,'³','³³') +±²³³´µ +SELECT REPLACE(`‚b‚P`,'´','´´') FROM `‚s‚P`; +REPLACE(`‚b‚P`,'´','´´') +±²³´´µ +SELECT REPLACE(`‚b‚P`,'µ','µµ') FROM `‚s‚P`; +REPLACE(`‚b‚P`,'µ','µµ') +±²³´µµ +SELECT REPLACE(`‚b‚P`,'‚ ','‚ ‚ ') FROM `‚s‚Q`; +REPLACE(`‚b‚P`,'‚ ','‚ ‚ ') +‚ ‚ ‚¢‚¤‚¦‚¨ +SELECT REPLACE(`‚b‚P`,'‚¢','‚¢‚¢') FROM `‚s‚Q`; +REPLACE(`‚b‚P`,'‚¢','‚¢‚¢') +‚ ‚¢‚¢‚¤‚¦‚¨ +SELECT REPLACE(`‚b‚P`,'‚¤','‚¤‚¤') FROM `‚s‚Q`; +REPLACE(`‚b‚P`,'‚¤','‚¤‚¤') +‚ ‚¢‚¤‚¤‚¦‚¨ +SELECT REPLACE(`‚b‚P`,'‚¦','‚¦‚¦') FROM `‚s‚Q`; +REPLACE(`‚b‚P`,'‚¦','‚¦‚¦') +‚ ‚¢‚¤‚¦‚¦‚¨ +SELECT REPLACE(`‚b‚P`,'‚¨','‚¨‚¨') FROM `‚s‚Q`; +REPLACE(`‚b‚P`,'‚¨','‚¨‚¨') +‚ ‚¢‚¤‚¦‚¨‚¨ +SELECT REPLACE(`‚b‚P`,'ƒ\','ƒ\ƒ\') FROM `‚s‚R`; +REPLACE(`‚b‚P`,'ƒ\','ƒ\ƒ\') +ƒ\ƒ\\•\—\\ +SELECT REPLACE(`‚b‚P`,'\','\\') FROM `‚s‚R`; +REPLACE(`‚b‚P`,'\','\\') +ƒ\\\•\—\\ +SELECT REPLACE(`‚b‚P`,'•\','•\•\') FROM `‚s‚R`; +REPLACE(`‚b‚P`,'•\','•\•\') +ƒ\\•\•\—\\ +SELECT REPLACE(`‚b‚P`,'—\','—\—\') FROM `‚s‚R`; +REPLACE(`‚b‚P`,'—\','—\—\') +ƒ\\•\—\—\\ +SELECT REPLACE(`‚b‚P`,'\','\\') FROM `‚s‚R`; +REPLACE(`‚b‚P`,'\','\\') +ƒ\\•\—\\\ +SELECT REPLACE(`‚b‚P`,'±','±±') FROM `‚s‚S`; +REPLACE(`‚b‚P`,'±','±±') +±±²³´µ +SELECT REPLACE(`‚b‚P`,'²','²²') FROM `‚s‚S`; +REPLACE(`‚b‚P`,'²','²²') +±²²³´µ +SELECT REPLACE(`‚b‚P`,'³','³³') FROM `‚s‚S`; +REPLACE(`‚b‚P`,'³','³³') +±²³³´µ +SELECT REPLACE(`‚b‚P`,'´','´´') FROM `‚s‚S`; +REPLACE(`‚b‚P`,'´','´´') +±²³´´µ +SELECT REPLACE(`‚b‚P`,'µ','µµ') FROM `‚s‚S`; +REPLACE(`‚b‚P`,'µ','µµ') +±²³´µµ +SELECT REPLACE(`‚b‚P`,'‚ ','‚ ‚ ') FROM `‚s‚T`; +REPLACE(`‚b‚P`,'‚ ','‚ ‚ ') +‚ ‚ ‚¢‚¤‚¦‚¨ +SELECT REPLACE(`‚b‚P`,'‚¢','‚¢‚¢') FROM `‚s‚T`; +REPLACE(`‚b‚P`,'‚¢','‚¢‚¢') +‚ ‚¢‚¢‚¤‚¦‚¨ +SELECT REPLACE(`‚b‚P`,'‚¤','‚¤‚¤') FROM `‚s‚T`; +REPLACE(`‚b‚P`,'‚¤','‚¤‚¤') +‚ ‚¢‚¤‚¤‚¦‚¨ +SELECT REPLACE(`‚b‚P`,'‚¦','‚¦‚¦') FROM `‚s‚T`; +REPLACE(`‚b‚P`,'‚¦','‚¦‚¦') +‚ ‚¢‚¤‚¦‚¦‚¨ +SELECT REPLACE(`‚b‚P`,'‚¨','‚¨‚¨') FROM `‚s‚T`; +REPLACE(`‚b‚P`,'‚¨','‚¨‚¨') +‚ ‚¢‚¤‚¦‚¨‚¨ +SELECT REPLACE(`‚b‚P`,'ƒ\','ƒ\ƒ\') FROM `‚s‚U`; +REPLACE(`‚b‚P`,'ƒ\','ƒ\ƒ\') +ƒ\ƒ\\•\—\\ +SELECT REPLACE(`‚b‚P`,'\','\\') FROM `‚s‚U`; +REPLACE(`‚b‚P`,'\','\\') +ƒ\\\•\—\\ +SELECT REPLACE(`‚b‚P`,'•\','•\•\') FROM `‚s‚U`; +REPLACE(`‚b‚P`,'•\','•\•\') +ƒ\\•\•\—\\ +SELECT REPLACE(`‚b‚P`,'—\','—\—\') FROM `‚s‚U`; +REPLACE(`‚b‚P`,'—\','—\—\') +ƒ\\•\—\—\\ +SELECT REPLACE(`‚b‚P`,'\','\\') FROM `‚s‚U`; +REPLACE(`‚b‚P`,'\','\\') +ƒ\\•\—\\\ +SELECT REPLACE(`‚b‚P`,'±','±±') FROM `‚s‚V`; +REPLACE(`‚b‚P`,'±','±±') +±±²³´µ +SELECT REPLACE(`‚b‚P`,'²','²²') FROM `‚s‚V`; +REPLACE(`‚b‚P`,'²','²²') +±²²³´µ +SELECT REPLACE(`‚b‚P`,'³','³³') FROM `‚s‚V`; +REPLACE(`‚b‚P`,'³','³³') +±²³³´µ +SELECT REPLACE(`‚b‚P`,'´','´´') FROM `‚s‚V`; +REPLACE(`‚b‚P`,'´','´´') +±²³´´µ +SELECT REPLACE(`‚b‚P`,'µ','µµ') FROM `‚s‚V`; +REPLACE(`‚b‚P`,'µ','µµ') +±²³´µµ +SELECT REPLACE(`‚b‚P`,'‚ ','‚ ‚ ') FROM `‚s‚W`; +REPLACE(`‚b‚P`,'‚ ','‚ ‚ ') +‚ ‚ ‚¢‚¤‚¦‚¨ +SELECT REPLACE(`‚b‚P`,'‚¢','‚¢‚¢') FROM `‚s‚W`; +REPLACE(`‚b‚P`,'‚¢','‚¢‚¢') +‚ ‚¢‚¢‚¤‚¦‚¨ +SELECT REPLACE(`‚b‚P`,'‚¤','‚¤‚¤') FROM `‚s‚W`; +REPLACE(`‚b‚P`,'‚¤','‚¤‚¤') +‚ ‚¢‚¤‚¤‚¦‚¨ +SELECT REPLACE(`‚b‚P`,'‚¦','‚¦‚¦') FROM `‚s‚W`; +REPLACE(`‚b‚P`,'‚¦','‚¦‚¦') +‚ ‚¢‚¤‚¦‚¦‚¨ +SELECT REPLACE(`‚b‚P`,'‚¨','‚¨‚¨') FROM `‚s‚W`; +REPLACE(`‚b‚P`,'‚¨','‚¨‚¨') +‚ ‚¢‚¤‚¦‚¨‚¨ +SELECT REPLACE(`‚b‚P`,'ƒ\','ƒ\ƒ\') FROM `‚s‚X`; +REPLACE(`‚b‚P`,'ƒ\','ƒ\ƒ\') +ƒ\ƒ\\•\—\\ +SELECT REPLACE(`‚b‚P`,'\','\\') FROM `‚s‚X`; +REPLACE(`‚b‚P`,'\','\\') +ƒ\\\•\—\\ +SELECT REPLACE(`‚b‚P`,'•\','•\•\') FROM `‚s‚X`; +REPLACE(`‚b‚P`,'•\','•\•\') +ƒ\\•\•\—\\ +SELECT REPLACE(`‚b‚P`,'—\','—\—\') FROM `‚s‚X`; +REPLACE(`‚b‚P`,'—\','—\—\') +ƒ\\•\—\—\\ +SELECT REPLACE(`‚b‚P`,'\','\\') FROM `‚s‚X`; +REPLACE(`‚b‚P`,'\','\\') +ƒ\\•\—\\\ +SELECT REPLACE(`‚b‚P`,'±','±±') FROM `‚s‚P‚O`; +REPLACE(`‚b‚P`,'±','±±') +±±²³´µ +SELECT REPLACE(`‚b‚P`,'²','²²') FROM `‚s‚P‚O`; +REPLACE(`‚b‚P`,'²','²²') +±²²³´µ +SELECT REPLACE(`‚b‚P`,'³','³³') FROM `‚s‚P‚O`; +REPLACE(`‚b‚P`,'³','³³') +±²³³´µ +SELECT REPLACE(`‚b‚P`,'´','´´') FROM `‚s‚P‚O`; +REPLACE(`‚b‚P`,'´','´´') +±²³´´µ +SELECT REPLACE(`‚b‚P`,'µ','µµ') FROM `‚s‚P‚O`; +REPLACE(`‚b‚P`,'µ','µµ') +±²³´µµ +SELECT REPLACE(`‚b‚P`,'‚ ','‚ ‚ ') FROM `‚s‚P‚P`; +REPLACE(`‚b‚P`,'‚ ','‚ ‚ ') +‚ ‚ ‚¢‚¤‚¦‚¨ +SELECT REPLACE(`‚b‚P`,'‚¢','‚¢‚¢') FROM `‚s‚P‚P`; +REPLACE(`‚b‚P`,'‚¢','‚¢‚¢') +‚ ‚¢‚¢‚¤‚¦‚¨ +SELECT REPLACE(`‚b‚P`,'‚¤','‚¤‚¤') FROM `‚s‚P‚P`; +REPLACE(`‚b‚P`,'‚¤','‚¤‚¤') +‚ ‚¢‚¤‚¤‚¦‚¨ +SELECT REPLACE(`‚b‚P`,'‚¦','‚¦‚¦') FROM `‚s‚P‚P`; +REPLACE(`‚b‚P`,'‚¦','‚¦‚¦') +‚ ‚¢‚¤‚¦‚¦‚¨ +SELECT REPLACE(`‚b‚P`,'‚¨','‚¨‚¨') FROM `‚s‚P‚P`; +REPLACE(`‚b‚P`,'‚¨','‚¨‚¨') +‚ ‚¢‚¤‚¦‚¨‚¨ +SELECT REPLACE(`‚b‚P`,'ƒ\','ƒ\ƒ\') FROM `‚s‚P‚Q`; +REPLACE(`‚b‚P`,'ƒ\','ƒ\ƒ\') +ƒ\ƒ\\•\—\\ +SELECT REPLACE(`‚b‚P`,'\','\\') FROM `‚s‚P‚Q`; +REPLACE(`‚b‚P`,'\','\\') +ƒ\\\•\—\\ +SELECT REPLACE(`‚b‚P`,'•\','•\•\') FROM `‚s‚P‚Q`; +REPLACE(`‚b‚P`,'•\','•\•\') +ƒ\\•\•\—\\ +SELECT REPLACE(`‚b‚P`,'—\','—\—\') FROM `‚s‚P‚Q`; +REPLACE(`‚b‚P`,'—\','—\—\') +ƒ\\•\—\—\\ +SELECT REPLACE(`‚b‚P`,'\','\\') FROM `‚s‚P‚Q`; +REPLACE(`‚b‚P`,'\','\\') +ƒ\\•\—\\\ +DROP TABLE `‚s‚P`; +DROP TABLE `‚s‚Q`; +DROP TABLE `‚s‚R`; +DROP TABLE `‚s‚S`; +DROP TABLE `‚s‚T`; +DROP TABLE `‚s‚U`; +DROP TABLE `‚s‚V`; +DROP TABLE `‚s‚W`; +DROP TABLE `‚s‚X`; +DROP TABLE `‚s‚P‚O`; +DROP TABLE `‚s‚P‚P`; +DROP TABLE `‚s‚P‚Q`; diff --git a/mysql-test/suite/jp/r/jp_replace_ucs2.result b/mysql-test/suite/jp/r/jp_replace_ucs2.result new file mode 100755 index 00000000000..2911fe69b9a --- /dev/null +++ b/mysql-test/suite/jp/r/jp_replace_ucs2.result @@ -0,0 +1,231 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; +CREATE TABLE `£Ô£±` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = bdb; +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'); +SELECT REPLACE(`£Ã£±`,'ޱ','ޱޱ') FROM `£Ô£±`; +REPLACE(`£Ã£±`,'ޱ','ޱޱ') +ޱޱ޲޳޴޵ +SELECT REPLACE(`£Ã£±`,'޲','޲޲') FROM `£Ô£±`; +REPLACE(`£Ã£±`,'޲','޲޲') +ޱ޲޲޳޴޵ +SELECT REPLACE(`£Ã£±`,'޳','޳޳') FROM `£Ô£±`; +REPLACE(`£Ã£±`,'޳','޳޳') +ޱ޲޳޳޴޵ +SELECT REPLACE(`£Ã£±`,'Ž´','Ž´Ž´') FROM `£Ô£±`; +REPLACE(`£Ã£±`,'Ž´','Ž´Ž´') +ޱ޲޳޴޴޵ +SELECT REPLACE(`£Ã£±`,'޵','޵޵') FROM `£Ô£±`; +REPLACE(`£Ã£±`,'޵','޵޵') +ޱ޲޳޴޵޵ +SELECT REPLACE(`£Ã£±`,'¤¢','¤¢¤¢') FROM `£Ô£²`; +REPLACE(`£Ã£±`,'¤¢','¤¢¤¢') +¤¢¤¢¤¤¤¦¤¨¤ª +SELECT REPLACE(`£Ã£±`,'¤¤','¤¤¤¤') FROM `£Ô£²`; +REPLACE(`£Ã£±`,'¤¤','¤¤¤¤') +¤¢¤¤¤¤¤¦¤¨¤ª +SELECT REPLACE(`£Ã£±`,'¤¦','¤¦¤¦') FROM `£Ô£²`; +REPLACE(`£Ã£±`,'¤¦','¤¦¤¦') +¤¢¤¤¤¦¤¦¤¨¤ª +SELECT REPLACE(`£Ã£±`,'¤¨','¤¨¤¨') FROM `£Ô£²`; +REPLACE(`£Ã£±`,'¤¨','¤¨¤¨') +¤¢¤¤¤¦¤¨¤¨¤ª +SELECT REPLACE(`£Ã£±`,'¤ª','¤ª¤ª') FROM `£Ô£²`; +REPLACE(`£Ã£±`,'¤ª','¤ª¤ª') +¤¢¤¤¤¦¤¨¤ª¤ª +SELECT REPLACE(`£Ã£±`,'íÜ','íÜíÜ') FROM `£Ô£³`; +REPLACE(`£Ã£±`,'íÜ','íÜíÜ') +íÜíÜíÝíÞíßíà +SELECT REPLACE(`£Ã£±`,'íÝ','íÝíÝ') FROM `£Ô£³`; +REPLACE(`£Ã£±`,'íÝ','íÝíÝ') +íÜíÝíÝíÞíßíà +SELECT REPLACE(`£Ã£±`,'íÞ','íÞíÞ') FROM `£Ô£³`; +REPLACE(`£Ã£±`,'íÞ','íÞíÞ') +íÜíÝíÞíÞíßíà +SELECT REPLACE(`£Ã£±`,'íß','íßíß') FROM `£Ô£³`; +REPLACE(`£Ã£±`,'íß','íßíß') +íÜíÝíÞíßíßíà +SELECT REPLACE(`£Ã£±`,'íà','íàíà') FROM `£Ô£³`; +REPLACE(`£Ã£±`,'íà','íàíà') +íÜíÝíÞíßíàíà +SELECT REPLACE(`£Ã£±`,'ޱ','ޱޱ') FROM `£Ô£´`; +REPLACE(`£Ã£±`,'ޱ','ޱޱ') +ޱޱ޲޳޴޵ +SELECT REPLACE(`£Ã£±`,'޲','޲޲') FROM `£Ô£´`; +REPLACE(`£Ã£±`,'޲','޲޲') +ޱ޲޲޳޴޵ +SELECT REPLACE(`£Ã£±`,'޳','޳޳') FROM `£Ô£´`; +REPLACE(`£Ã£±`,'޳','޳޳') +ޱ޲޳޳޴޵ +SELECT REPLACE(`£Ã£±`,'Ž´','Ž´Ž´') FROM `£Ô£´`; +REPLACE(`£Ã£±`,'Ž´','Ž´Ž´') +ޱ޲޳޴޴޵ +SELECT REPLACE(`£Ã£±`,'޵','޵޵') FROM `£Ô£´`; +REPLACE(`£Ã£±`,'޵','޵޵') +ޱ޲޳޴޵޵ +SELECT REPLACE(`£Ã£±`,'¤¢','¤¢¤¢') FROM `£Ô£µ`; +REPLACE(`£Ã£±`,'¤¢','¤¢¤¢') +¤¢¤¢¤¤¤¦¤¨¤ª +SELECT REPLACE(`£Ã£±`,'¤¤','¤¤¤¤') FROM `£Ô£µ`; +REPLACE(`£Ã£±`,'¤¤','¤¤¤¤') +¤¢¤¤¤¤¤¦¤¨¤ª +SELECT REPLACE(`£Ã£±`,'¤¦','¤¦¤¦') FROM `£Ô£µ`; +REPLACE(`£Ã£±`,'¤¦','¤¦¤¦') +¤¢¤¤¤¦¤¦¤¨¤ª +SELECT REPLACE(`£Ã£±`,'¤¨','¤¨¤¨') FROM `£Ô£µ`; +REPLACE(`£Ã£±`,'¤¨','¤¨¤¨') +¤¢¤¤¤¦¤¨¤¨¤ª +SELECT REPLACE(`£Ã£±`,'¤ª','¤ª¤ª') FROM `£Ô£µ`; +REPLACE(`£Ã£±`,'¤ª','¤ª¤ª') +¤¢¤¤¤¦¤¨¤ª¤ª +SELECT REPLACE(`£Ã£±`,'íÜ','íÜíÜ') FROM `£Ô£¶`; +REPLACE(`£Ã£±`,'íÜ','íÜíÜ') +íÜíÜíÝíÞíßíà +SELECT REPLACE(`£Ã£±`,'íÝ','íÝíÝ') FROM `£Ô£¶`; +REPLACE(`£Ã£±`,'íÝ','íÝíÝ') +íÜíÝíÝíÞíßíà +SELECT REPLACE(`£Ã£±`,'íÞ','íÞíÞ') FROM `£Ô£¶`; +REPLACE(`£Ã£±`,'íÞ','íÞíÞ') +íÜíÝíÞíÞíßíà +SELECT REPLACE(`£Ã£±`,'íß','íßíß') FROM `£Ô£¶`; +REPLACE(`£Ã£±`,'íß','íßíß') +íÜíÝíÞíßíßíà +SELECT REPLACE(`£Ã£±`,'íà','íàíà') FROM `£Ô£¶`; +REPLACE(`£Ã£±`,'íà','íàíà') +íÜíÝíÞíßíàíà +SELECT REPLACE(`£Ã£±`,'ޱ','ޱޱ') FROM `£Ô£·`; +REPLACE(`£Ã£±`,'ޱ','ޱޱ') +ޱޱ޲޳޴޵ +SELECT REPLACE(`£Ã£±`,'޲','޲޲') FROM `£Ô£·`; +REPLACE(`£Ã£±`,'޲','޲޲') +ޱ޲޲޳޴޵ +SELECT REPLACE(`£Ã£±`,'޳','޳޳') FROM `£Ô£·`; +REPLACE(`£Ã£±`,'޳','޳޳') +ޱ޲޳޳޴޵ +SELECT REPLACE(`£Ã£±`,'Ž´','Ž´Ž´') FROM `£Ô£·`; +REPLACE(`£Ã£±`,'Ž´','Ž´Ž´') +ޱ޲޳޴޴޵ +SELECT REPLACE(`£Ã£±`,'޵','޵޵') FROM `£Ô£·`; +REPLACE(`£Ã£±`,'޵','޵޵') +ޱ޲޳޴޵޵ +SELECT REPLACE(`£Ã£±`,'¤¢','¤¢¤¢') FROM `£Ô£¸`; +REPLACE(`£Ã£±`,'¤¢','¤¢¤¢') +¤¢¤¢¤¤¤¦¤¨¤ª +SELECT REPLACE(`£Ã£±`,'¤¤','¤¤¤¤') FROM `£Ô£¸`; +REPLACE(`£Ã£±`,'¤¤','¤¤¤¤') +¤¢¤¤¤¤¤¦¤¨¤ª +SELECT REPLACE(`£Ã£±`,'¤¦','¤¦¤¦') FROM `£Ô£¸`; +REPLACE(`£Ã£±`,'¤¦','¤¦¤¦') +¤¢¤¤¤¦¤¦¤¨¤ª +SELECT REPLACE(`£Ã£±`,'¤¨','¤¨¤¨') FROM `£Ô£¸`; +REPLACE(`£Ã£±`,'¤¨','¤¨¤¨') +¤¢¤¤¤¦¤¨¤¨¤ª +SELECT REPLACE(`£Ã£±`,'¤ª','¤ª¤ª') FROM `£Ô£¸`; +REPLACE(`£Ã£±`,'¤ª','¤ª¤ª') +¤¢¤¤¤¦¤¨¤ª¤ª +SELECT REPLACE(`£Ã£±`,'íÜ','íÜíÜ') FROM `£Ô£¹`; +REPLACE(`£Ã£±`,'íÜ','íÜíÜ') +íÜíÜíÝíÞíßíà +SELECT REPLACE(`£Ã£±`,'íÝ','íÝíÝ') FROM `£Ô£¹`; +REPLACE(`£Ã£±`,'íÝ','íÝíÝ') +íÜíÝíÝíÞíßíà +SELECT REPLACE(`£Ã£±`,'íÞ','íÞíÞ') FROM `£Ô£¹`; +REPLACE(`£Ã£±`,'íÞ','íÞíÞ') +íÜíÝíÞíÞíßíà +SELECT REPLACE(`£Ã£±`,'íß','íßíß') FROM `£Ô£¹`; +REPLACE(`£Ã£±`,'íß','íßíß') +íÜíÝíÞíßíßíà +SELECT REPLACE(`£Ã£±`,'íà','íàíà') FROM `£Ô£¹`; +REPLACE(`£Ã£±`,'íà','íàíà') +íÜíÝíÞíßíàíà +SELECT REPLACE(`£Ã£±`,'ޱ','ޱޱ') FROM `£Ô£±£°`; +REPLACE(`£Ã£±`,'ޱ','ޱޱ') +ޱޱ޲޳޴޵ +SELECT REPLACE(`£Ã£±`,'޲','޲޲') FROM `£Ô£±£°`; +REPLACE(`£Ã£±`,'޲','޲޲') +ޱ޲޲޳޴޵ +SELECT REPLACE(`£Ã£±`,'޳','޳޳') FROM `£Ô£±£°`; +REPLACE(`£Ã£±`,'޳','޳޳') +ޱ޲޳޳޴޵ +SELECT REPLACE(`£Ã£±`,'Ž´','Ž´Ž´') FROM `£Ô£±£°`; +REPLACE(`£Ã£±`,'Ž´','Ž´Ž´') +ޱ޲޳޴޴޵ +SELECT REPLACE(`£Ã£±`,'޵','޵޵') FROM `£Ô£±£°`; +REPLACE(`£Ã£±`,'޵','޵޵') +ޱ޲޳޴޵޵ +SELECT REPLACE(`£Ã£±`,'¤¢','¤¢¤¢') FROM `£Ô£±£±`; +REPLACE(`£Ã£±`,'¤¢','¤¢¤¢') +¤¢¤¢¤¤¤¦¤¨¤ª +SELECT REPLACE(`£Ã£±`,'¤¤','¤¤¤¤') FROM `£Ô£±£±`; +REPLACE(`£Ã£±`,'¤¤','¤¤¤¤') +¤¢¤¤¤¤¤¦¤¨¤ª +SELECT REPLACE(`£Ã£±`,'¤¦','¤¦¤¦') FROM `£Ô£±£±`; +REPLACE(`£Ã£±`,'¤¦','¤¦¤¦') +¤¢¤¤¤¦¤¦¤¨¤ª +SELECT REPLACE(`£Ã£±`,'¤¨','¤¨¤¨') FROM `£Ô£±£±`; +REPLACE(`£Ã£±`,'¤¨','¤¨¤¨') +¤¢¤¤¤¦¤¨¤¨¤ª +SELECT REPLACE(`£Ã£±`,'¤ª','¤ª¤ª') FROM `£Ô£±£±`; +REPLACE(`£Ã£±`,'¤ª','¤ª¤ª') +¤¢¤¤¤¦¤¨¤ª¤ª +SELECT REPLACE(`£Ã£±`,'íÜ','íÜíÜ') FROM `£Ô£±£²`; +REPLACE(`£Ã£±`,'íÜ','íÜíÜ') +íÜíÜíÝíÞíßíà +SELECT REPLACE(`£Ã£±`,'íÝ','íÝíÝ') FROM `£Ô£±£²`; +REPLACE(`£Ã£±`,'íÝ','íÝíÝ') +íÜíÝíÝíÞíßíà +SELECT REPLACE(`£Ã£±`,'íÞ','íÞíÞ') FROM `£Ô£±£²`; +REPLACE(`£Ã£±`,'íÞ','íÞíÞ') +íÜíÝíÞíÞíßíà +SELECT REPLACE(`£Ã£±`,'íß','íßíß') FROM `£Ô£±£²`; +REPLACE(`£Ã£±`,'íß','íßíß') +íÜíÝíÞíßíßíà +SELECT REPLACE(`£Ã£±`,'íà','íàíà') FROM `£Ô£±£²`; +REPLACE(`£Ã£±`,'íà','íàíà') +íÜíÝíÞíßíàíà +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/r/jp_replace_ujis.result b/mysql-test/suite/jp/r/jp_replace_ujis.result new file mode 100755 index 00000000000..7f776804ee9 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_replace_ujis.result @@ -0,0 +1,230 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +SET NAMES ujis; +SET character_set_database = ujis; +CREATE TABLE `£Ô£±` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = bdb; +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'); +SELECT REPLACE(`£Ã£±`,'ޱ','ޱޱ') FROM `£Ô£±`; +REPLACE(`£Ã£±`,'ޱ','ޱޱ') +ޱޱ޲޳޴޵ +SELECT REPLACE(`£Ã£±`,'޲','޲޲') FROM `£Ô£±`; +REPLACE(`£Ã£±`,'޲','޲޲') +ޱ޲޲޳޴޵ +SELECT REPLACE(`£Ã£±`,'޳','޳޳') FROM `£Ô£±`; +REPLACE(`£Ã£±`,'޳','޳޳') +ޱ޲޳޳޴޵ +SELECT REPLACE(`£Ã£±`,'Ž´','Ž´Ž´') FROM `£Ô£±`; +REPLACE(`£Ã£±`,'Ž´','Ž´Ž´') +ޱ޲޳޴޴޵ +SELECT REPLACE(`£Ã£±`,'޵','޵޵') FROM `£Ô£±`; +REPLACE(`£Ã£±`,'޵','޵޵') +ޱ޲޳޴޵޵ +SELECT REPLACE(`£Ã£±`,'¤¢','¤¢¤¢') FROM `£Ô£²`; +REPLACE(`£Ã£±`,'¤¢','¤¢¤¢') +¤¢¤¢¤¤¤¦¤¨¤ª +SELECT REPLACE(`£Ã£±`,'¤¤','¤¤¤¤') FROM `£Ô£²`; +REPLACE(`£Ã£±`,'¤¤','¤¤¤¤') +¤¢¤¤¤¤¤¦¤¨¤ª +SELECT REPLACE(`£Ã£±`,'¤¦','¤¦¤¦') FROM `£Ô£²`; +REPLACE(`£Ã£±`,'¤¦','¤¦¤¦') +¤¢¤¤¤¦¤¦¤¨¤ª +SELECT REPLACE(`£Ã£±`,'¤¨','¤¨¤¨') FROM `£Ô£²`; +REPLACE(`£Ã£±`,'¤¨','¤¨¤¨') +¤¢¤¤¤¦¤¨¤¨¤ª +SELECT REPLACE(`£Ã£±`,'¤ª','¤ª¤ª') FROM `£Ô£²`; +REPLACE(`£Ã£±`,'¤ª','¤ª¤ª') +¤¢¤¤¤¦¤¨¤ª¤ª +SELECT REPLACE(`£Ã£±`,'íÜ','íÜíÜ') FROM `£Ô£³`; +REPLACE(`£Ã£±`,'íÜ','íÜíÜ') +íÜíÜíÝíÞíßíà +SELECT REPLACE(`£Ã£±`,'íÝ','íÝíÝ') FROM `£Ô£³`; +REPLACE(`£Ã£±`,'íÝ','íÝíÝ') +íÜíÝíÝíÞíßíà +SELECT REPLACE(`£Ã£±`,'íÞ','íÞíÞ') FROM `£Ô£³`; +REPLACE(`£Ã£±`,'íÞ','íÞíÞ') +íÜíÝíÞíÞíßíà +SELECT REPLACE(`£Ã£±`,'íß','íßíß') FROM `£Ô£³`; +REPLACE(`£Ã£±`,'íß','íßíß') +íÜíÝíÞíßíßíà +SELECT REPLACE(`£Ã£±`,'íà','íàíà') FROM `£Ô£³`; +REPLACE(`£Ã£±`,'íà','íàíà') +íÜíÝíÞíßíàíà +SELECT REPLACE(`£Ã£±`,'ޱ','ޱޱ') FROM `£Ô£´`; +REPLACE(`£Ã£±`,'ޱ','ޱޱ') +ޱޱ޲޳޴޵ +SELECT REPLACE(`£Ã£±`,'޲','޲޲') FROM `£Ô£´`; +REPLACE(`£Ã£±`,'޲','޲޲') +ޱ޲޲޳޴޵ +SELECT REPLACE(`£Ã£±`,'޳','޳޳') FROM `£Ô£´`; +REPLACE(`£Ã£±`,'޳','޳޳') +ޱ޲޳޳޴޵ +SELECT REPLACE(`£Ã£±`,'Ž´','Ž´Ž´') FROM `£Ô£´`; +REPLACE(`£Ã£±`,'Ž´','Ž´Ž´') +ޱ޲޳޴޴޵ +SELECT REPLACE(`£Ã£±`,'޵','޵޵') FROM `£Ô£´`; +REPLACE(`£Ã£±`,'޵','޵޵') +ޱ޲޳޴޵޵ +SELECT REPLACE(`£Ã£±`,'¤¢','¤¢¤¢') FROM `£Ô£µ`; +REPLACE(`£Ã£±`,'¤¢','¤¢¤¢') +¤¢¤¢¤¤¤¦¤¨¤ª +SELECT REPLACE(`£Ã£±`,'¤¤','¤¤¤¤') FROM `£Ô£µ`; +REPLACE(`£Ã£±`,'¤¤','¤¤¤¤') +¤¢¤¤¤¤¤¦¤¨¤ª +SELECT REPLACE(`£Ã£±`,'¤¦','¤¦¤¦') FROM `£Ô£µ`; +REPLACE(`£Ã£±`,'¤¦','¤¦¤¦') +¤¢¤¤¤¦¤¦¤¨¤ª +SELECT REPLACE(`£Ã£±`,'¤¨','¤¨¤¨') FROM `£Ô£µ`; +REPLACE(`£Ã£±`,'¤¨','¤¨¤¨') +¤¢¤¤¤¦¤¨¤¨¤ª +SELECT REPLACE(`£Ã£±`,'¤ª','¤ª¤ª') FROM `£Ô£µ`; +REPLACE(`£Ã£±`,'¤ª','¤ª¤ª') +¤¢¤¤¤¦¤¨¤ª¤ª +SELECT REPLACE(`£Ã£±`,'íÜ','íÜíÜ') FROM `£Ô£¶`; +REPLACE(`£Ã£±`,'íÜ','íÜíÜ') +íÜíÜíÝíÞíßíà +SELECT REPLACE(`£Ã£±`,'íÝ','íÝíÝ') FROM `£Ô£¶`; +REPLACE(`£Ã£±`,'íÝ','íÝíÝ') +íÜíÝíÝíÞíßíà +SELECT REPLACE(`£Ã£±`,'íÞ','íÞíÞ') FROM `£Ô£¶`; +REPLACE(`£Ã£±`,'íÞ','íÞíÞ') +íÜíÝíÞíÞíßíà +SELECT REPLACE(`£Ã£±`,'íß','íßíß') FROM `£Ô£¶`; +REPLACE(`£Ã£±`,'íß','íßíß') +íÜíÝíÞíßíßíà +SELECT REPLACE(`£Ã£±`,'íà','íàíà') FROM `£Ô£¶`; +REPLACE(`£Ã£±`,'íà','íàíà') +íÜíÝíÞíßíàíà +SELECT REPLACE(`£Ã£±`,'ޱ','ޱޱ') FROM `£Ô£·`; +REPLACE(`£Ã£±`,'ޱ','ޱޱ') +ޱޱ޲޳޴޵ +SELECT REPLACE(`£Ã£±`,'޲','޲޲') FROM `£Ô£·`; +REPLACE(`£Ã£±`,'޲','޲޲') +ޱ޲޲޳޴޵ +SELECT REPLACE(`£Ã£±`,'޳','޳޳') FROM `£Ô£·`; +REPLACE(`£Ã£±`,'޳','޳޳') +ޱ޲޳޳޴޵ +SELECT REPLACE(`£Ã£±`,'Ž´','Ž´Ž´') FROM `£Ô£·`; +REPLACE(`£Ã£±`,'Ž´','Ž´Ž´') +ޱ޲޳޴޴޵ +SELECT REPLACE(`£Ã£±`,'޵','޵޵') FROM `£Ô£·`; +REPLACE(`£Ã£±`,'޵','޵޵') +ޱ޲޳޴޵޵ +SELECT REPLACE(`£Ã£±`,'¤¢','¤¢¤¢') FROM `£Ô£¸`; +REPLACE(`£Ã£±`,'¤¢','¤¢¤¢') +¤¢¤¢¤¤¤¦¤¨¤ª +SELECT REPLACE(`£Ã£±`,'¤¤','¤¤¤¤') FROM `£Ô£¸`; +REPLACE(`£Ã£±`,'¤¤','¤¤¤¤') +¤¢¤¤¤¤¤¦¤¨¤ª +SELECT REPLACE(`£Ã£±`,'¤¦','¤¦¤¦') FROM `£Ô£¸`; +REPLACE(`£Ã£±`,'¤¦','¤¦¤¦') +¤¢¤¤¤¦¤¦¤¨¤ª +SELECT REPLACE(`£Ã£±`,'¤¨','¤¨¤¨') FROM `£Ô£¸`; +REPLACE(`£Ã£±`,'¤¨','¤¨¤¨') +¤¢¤¤¤¦¤¨¤¨¤ª +SELECT REPLACE(`£Ã£±`,'¤ª','¤ª¤ª') FROM `£Ô£¸`; +REPLACE(`£Ã£±`,'¤ª','¤ª¤ª') +¤¢¤¤¤¦¤¨¤ª¤ª +SELECT REPLACE(`£Ã£±`,'íÜ','íÜíÜ') FROM `£Ô£¹`; +REPLACE(`£Ã£±`,'íÜ','íÜíÜ') +íÜíÜíÝíÞíßíà +SELECT REPLACE(`£Ã£±`,'íÝ','íÝíÝ') FROM `£Ô£¹`; +REPLACE(`£Ã£±`,'íÝ','íÝíÝ') +íÜíÝíÝíÞíßíà +SELECT REPLACE(`£Ã£±`,'íÞ','íÞíÞ') FROM `£Ô£¹`; +REPLACE(`£Ã£±`,'íÞ','íÞíÞ') +íÜíÝíÞíÞíßíà +SELECT REPLACE(`£Ã£±`,'íß','íßíß') FROM `£Ô£¹`; +REPLACE(`£Ã£±`,'íß','íßíß') +íÜíÝíÞíßíßíà +SELECT REPLACE(`£Ã£±`,'íà','íàíà') FROM `£Ô£¹`; +REPLACE(`£Ã£±`,'íà','íàíà') +íÜíÝíÞíßíàíà +SELECT REPLACE(`£Ã£±`,'ޱ','ޱޱ') FROM `£Ô£±£°`; +REPLACE(`£Ã£±`,'ޱ','ޱޱ') +ޱޱ޲޳޴޵ +SELECT REPLACE(`£Ã£±`,'޲','޲޲') FROM `£Ô£±£°`; +REPLACE(`£Ã£±`,'޲','޲޲') +ޱ޲޲޳޴޵ +SELECT REPLACE(`£Ã£±`,'޳','޳޳') FROM `£Ô£±£°`; +REPLACE(`£Ã£±`,'޳','޳޳') +ޱ޲޳޳޴޵ +SELECT REPLACE(`£Ã£±`,'Ž´','Ž´Ž´') FROM `£Ô£±£°`; +REPLACE(`£Ã£±`,'Ž´','Ž´Ž´') +ޱ޲޳޴޴޵ +SELECT REPLACE(`£Ã£±`,'޵','޵޵') FROM `£Ô£±£°`; +REPLACE(`£Ã£±`,'޵','޵޵') +ޱ޲޳޴޵޵ +SELECT REPLACE(`£Ã£±`,'¤¢','¤¢¤¢') FROM `£Ô£±£±`; +REPLACE(`£Ã£±`,'¤¢','¤¢¤¢') +¤¢¤¢¤¤¤¦¤¨¤ª +SELECT REPLACE(`£Ã£±`,'¤¤','¤¤¤¤') FROM `£Ô£±£±`; +REPLACE(`£Ã£±`,'¤¤','¤¤¤¤') +¤¢¤¤¤¤¤¦¤¨¤ª +SELECT REPLACE(`£Ã£±`,'¤¦','¤¦¤¦') FROM `£Ô£±£±`; +REPLACE(`£Ã£±`,'¤¦','¤¦¤¦') +¤¢¤¤¤¦¤¦¤¨¤ª +SELECT REPLACE(`£Ã£±`,'¤¨','¤¨¤¨') FROM `£Ô£±£±`; +REPLACE(`£Ã£±`,'¤¨','¤¨¤¨') +¤¢¤¤¤¦¤¨¤¨¤ª +SELECT REPLACE(`£Ã£±`,'¤ª','¤ª¤ª') FROM `£Ô£±£±`; +REPLACE(`£Ã£±`,'¤ª','¤ª¤ª') +¤¢¤¤¤¦¤¨¤ª¤ª +SELECT REPLACE(`£Ã£±`,'íÜ','íÜíÜ') FROM `£Ô£±£²`; +REPLACE(`£Ã£±`,'íÜ','íÜíÜ') +íÜíÜíÝíÞíßíà +SELECT REPLACE(`£Ã£±`,'íÝ','íÝíÝ') FROM `£Ô£±£²`; +REPLACE(`£Ã£±`,'íÝ','íÝíÝ') +íÜíÝíÝíÞíßíà +SELECT REPLACE(`£Ã£±`,'íÞ','íÞíÞ') FROM `£Ô£±£²`; +REPLACE(`£Ã£±`,'íÞ','íÞíÞ') +íÜíÝíÞíÞíßíà +SELECT REPLACE(`£Ã£±`,'íß','íßíß') FROM `£Ô£±£²`; +REPLACE(`£Ã£±`,'íß','íßíß') +íÜíÝíÞíßíßíà +SELECT REPLACE(`£Ã£±`,'íà','íàíà') FROM `£Ô£±£²`; +REPLACE(`£Ã£±`,'íà','íàíà') +íÜíÝíÞíßíàíà +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/r/jp_replace_utf8.result b/mysql-test/suite/jp/r/jp_replace_utf8.result new file mode 100755 index 00000000000..16981fcd0d8 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_replace_utf8.result @@ -0,0 +1,230 @@ +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +drop table if exists `T11`; +drop table if exists `T12`; +SET NAMES utf8; +SET character_set_database = utf8; +CREATE TABLE `T1` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T11` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T12` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = bdb; +INSERT INTO `T1` VALUES ('アイウエオ'); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T3` VALUES ('龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオ'); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオ'); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡'); +INSERT INTO `T1ï¼` VALUES ('アイウエオ'); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T12` VALUES ('龔龖龗龞龡'); +SELECT REPLACE(`C1`,'ï½±','アア') FROM `T1`; +REPLACE(`C1`,'ï½±','アア') +アアイウエオ +SELECT REPLACE(`C1`,'ï½²','イイ') FROM `T1`; +REPLACE(`C1`,'ï½²','イイ') +アイイウエオ +SELECT REPLACE(`C1`,'ï½³','ウウ') FROM `T1`; +REPLACE(`C1`,'ï½³','ウウ') +アイウウエオ +SELECT REPLACE(`C1`,'ï½´','ï½´ï½´') FROM `T1`; +REPLACE(`C1`,'ï½´','ï½´ï½´') +アイウエエオ +SELECT REPLACE(`C1`,'ï½µ','オオ') FROM `T1`; +REPLACE(`C1`,'ï½µ','オオ') +アイウエオオ +SELECT REPLACE(`C1`,'ã‚','ã‚ã‚') FROM `ï¼´ï¼’`; +REPLACE(`C1`,'ã‚','ã‚ã‚') +ã‚ã‚ã„ã†ãˆãŠ +SELECT REPLACE(`C1`,'ã„','ã„ã„') FROM `ï¼´ï¼’`; +REPLACE(`C1`,'ã„','ã„ã„') +ã‚ã„ã„ã†ãˆãŠ +SELECT REPLACE(`C1`,'ã†','ã†ã†') FROM `ï¼´ï¼’`; +REPLACE(`C1`,'ã†','ã†ã†') +ã‚ã„ã†ã†ãˆãŠ +SELECT REPLACE(`C1`,'ãˆ','ãˆãˆ') FROM `ï¼´ï¼’`; +REPLACE(`C1`,'ãˆ','ãˆãˆ') +ã‚ã„ã†ãˆãˆãŠ +SELECT REPLACE(`C1`,'ãŠ','ãŠãŠ') FROM `ï¼´ï¼’`; +REPLACE(`C1`,'ãŠ','ãŠãŠ') +ã‚ã„ã†ãˆãŠãŠ +SELECT REPLACE(`C1`,'é¾”','龔龔') FROM `T3`; +REPLACE(`C1`,'é¾”','龔龔') +龔龔龖龗龞龡 +SELECT REPLACE(`C1`,'é¾–','é¾–é¾–') FROM `T3`; +REPLACE(`C1`,'é¾–','é¾–é¾–') +龔龖龖龗龞龡 +SELECT REPLACE(`C1`,'é¾—','é¾—é¾—') FROM `T3`; +REPLACE(`C1`,'é¾—','é¾—é¾—') +龔龖龗龗龞龡 +SELECT REPLACE(`C1`,'龞','龞龞') FROM `T3`; +REPLACE(`C1`,'龞','龞龞') +龔龖龗龞龞龡 +SELECT REPLACE(`C1`,'龡','龡龡') FROM `T3`; +REPLACE(`C1`,'龡','龡龡') +龔龖龗龞龡龡 +SELECT REPLACE(`C1`,'ï½±','アア') FROM `ï¼´ï¼”`; +REPLACE(`C1`,'ï½±','アア') +アアイウエオ +SELECT REPLACE(`C1`,'ï½²','イイ') FROM `ï¼´ï¼”`; +REPLACE(`C1`,'ï½²','イイ') +アイイウエオ +SELECT REPLACE(`C1`,'ï½³','ウウ') FROM `ï¼´ï¼”`; +REPLACE(`C1`,'ï½³','ウウ') +アイウウエオ +SELECT REPLACE(`C1`,'ï½´','ï½´ï½´') FROM `ï¼´ï¼”`; +REPLACE(`C1`,'ï½´','ï½´ï½´') +アイウエエオ +SELECT REPLACE(`C1`,'ï½µ','オオ') FROM `ï¼´ï¼”`; +REPLACE(`C1`,'ï½µ','オオ') +アイウエオオ +SELECT REPLACE(`C1`,'ã‚','ã‚ã‚') FROM `T5`; +REPLACE(`C1`,'ã‚','ã‚ã‚') +ã‚ã‚ã„ã†ãˆãŠ +SELECT REPLACE(`C1`,'ã„','ã„ã„') FROM `T5`; +REPLACE(`C1`,'ã„','ã„ã„') +ã‚ã„ã„ã†ãˆãŠ +SELECT REPLACE(`C1`,'ã†','ã†ã†') FROM `T5`; +REPLACE(`C1`,'ã†','ã†ã†') +ã‚ã„ã†ã†ãˆãŠ +SELECT REPLACE(`C1`,'ãˆ','ãˆãˆ') FROM `T5`; +REPLACE(`C1`,'ãˆ','ãˆãˆ') +ã‚ã„ã†ãˆãˆãŠ +SELECT REPLACE(`C1`,'ãŠ','ãŠãŠ') FROM `T5`; +REPLACE(`C1`,'ãŠ','ãŠãŠ') +ã‚ã„ã†ãˆãŠãŠ +SELECT REPLACE(`C1`,'é¾”','龔龔') FROM `ï¼´ï¼–`; +REPLACE(`C1`,'é¾”','龔龔') +龔龔龖龗龞龡 +SELECT REPLACE(`C1`,'é¾–','é¾–é¾–') FROM `ï¼´ï¼–`; +REPLACE(`C1`,'é¾–','é¾–é¾–') +龔龖龖龗龞龡 +SELECT REPLACE(`C1`,'é¾—','é¾—é¾—') FROM `ï¼´ï¼–`; +REPLACE(`C1`,'é¾—','é¾—é¾—') +龔龖龗龗龞龡 +SELECT REPLACE(`C1`,'龞','龞龞') FROM `ï¼´ï¼–`; +REPLACE(`C1`,'龞','龞龞') +龔龖龗龞龞龡 +SELECT REPLACE(`C1`,'龡','龡龡') FROM `ï¼´ï¼–`; +REPLACE(`C1`,'龡','龡龡') +龔龖龗龞龡龡 +SELECT REPLACE(`C1`,'ï½±','アア') FROM `ï¼´ï¼—`; +REPLACE(`C1`,'ï½±','アア') +アアイウエオ +SELECT REPLACE(`C1`,'ï½²','イイ') FROM `ï¼´ï¼—`; +REPLACE(`C1`,'ï½²','イイ') +アイイウエオ +SELECT REPLACE(`C1`,'ï½³','ウウ') FROM `ï¼´ï¼—`; +REPLACE(`C1`,'ï½³','ウウ') +アイウウエオ +SELECT REPLACE(`C1`,'ï½´','ï½´ï½´') FROM `ï¼´ï¼—`; +REPLACE(`C1`,'ï½´','ï½´ï½´') +アイウエエオ +SELECT REPLACE(`C1`,'ï½µ','オオ') FROM `ï¼´ï¼—`; +REPLACE(`C1`,'ï½µ','オオ') +アイウエオオ +SELECT REPLACE(`C1`,'ã‚','ã‚ã‚') FROM `T8`; +REPLACE(`C1`,'ã‚','ã‚ã‚') +ã‚ã‚ã„ã†ãˆãŠ +SELECT REPLACE(`C1`,'ã„','ã„ã„') FROM `T8`; +REPLACE(`C1`,'ã„','ã„ã„') +ã‚ã„ã„ã†ãˆãŠ +SELECT REPLACE(`C1`,'ã†','ã†ã†') FROM `T8`; +REPLACE(`C1`,'ã†','ã†ã†') +ã‚ã„ã†ã†ãˆãŠ +SELECT REPLACE(`C1`,'ãˆ','ãˆãˆ') FROM `T8`; +REPLACE(`C1`,'ãˆ','ãˆãˆ') +ã‚ã„ã†ãˆãˆãŠ +SELECT REPLACE(`C1`,'ãŠ','ãŠãŠ') FROM `T8`; +REPLACE(`C1`,'ãŠ','ãŠãŠ') +ã‚ã„ã†ãˆãŠãŠ +SELECT REPLACE(`C1`,'é¾”','龔龔') FROM `ï¼´ï¼™`; +REPLACE(`C1`,'é¾”','龔龔') +龔龔龖龗龞龡 +SELECT REPLACE(`C1`,'é¾–','é¾–é¾–') FROM `ï¼´ï¼™`; +REPLACE(`C1`,'é¾–','é¾–é¾–') +龔龖龖龗龞龡 +SELECT REPLACE(`C1`,'é¾—','é¾—é¾—') FROM `ï¼´ï¼™`; +REPLACE(`C1`,'é¾—','é¾—é¾—') +龔龖龗龗龞龡 +SELECT REPLACE(`C1`,'龞','龞龞') FROM `ï¼´ï¼™`; +REPLACE(`C1`,'龞','龞龞') +龔龖龗龞龞龡 +SELECT REPLACE(`C1`,'龡','龡龡') FROM `ï¼´ï¼™`; +REPLACE(`C1`,'龡','龡龡') +龔龖龗龞龡龡 +SELECT REPLACE(`C1`,'ï½±','アア') FROM `T1ï¼`; +REPLACE(`C1`,'ï½±','アア') +アアイウエオ +SELECT REPLACE(`C1`,'ï½²','イイ') FROM `T1ï¼`; +REPLACE(`C1`,'ï½²','イイ') +アイイウエオ +SELECT REPLACE(`C1`,'ï½³','ウウ') FROM `T1ï¼`; +REPLACE(`C1`,'ï½³','ウウ') +アイウウエオ +SELECT REPLACE(`C1`,'ï½´','ï½´ï½´') FROM `T1ï¼`; +REPLACE(`C1`,'ï½´','ï½´ï½´') +アイウエエオ +SELECT REPLACE(`C1`,'ï½µ','オオ') FROM `T1ï¼`; +REPLACE(`C1`,'ï½µ','オオ') +アイウエオオ +SELECT REPLACE(`C1`,'ã‚','ã‚ã‚') FROM `T11`; +REPLACE(`C1`,'ã‚','ã‚ã‚') +ã‚ã‚ã„ã†ãˆãŠ +SELECT REPLACE(`C1`,'ã„','ã„ã„') FROM `T11`; +REPLACE(`C1`,'ã„','ã„ã„') +ã‚ã„ã„ã†ãˆãŠ +SELECT REPLACE(`C1`,'ã†','ã†ã†') FROM `T11`; +REPLACE(`C1`,'ã†','ã†ã†') +ã‚ã„ã†ã†ãˆãŠ +SELECT REPLACE(`C1`,'ãˆ','ãˆãˆ') FROM `T11`; +REPLACE(`C1`,'ãˆ','ãˆãˆ') +ã‚ã„ã†ãˆãˆãŠ +SELECT REPLACE(`C1`,'ãŠ','ãŠãŠ') FROM `T11`; +REPLACE(`C1`,'ãŠ','ãŠãŠ') +ã‚ã„ã†ãˆãŠãŠ +SELECT REPLACE(`C1`,'é¾”','龔龔') FROM `T12`; +REPLACE(`C1`,'é¾”','龔龔') +龔龔龖龗龞龡 +SELECT REPLACE(`C1`,'é¾–','é¾–é¾–') FROM `T12`; +REPLACE(`C1`,'é¾–','é¾–é¾–') +龔龖龖龗龞龡 +SELECT REPLACE(`C1`,'é¾—','é¾—é¾—') FROM `T12`; +REPLACE(`C1`,'é¾—','é¾—é¾—') +龔龖龗龗龞龡 +SELECT REPLACE(`C1`,'龞','龞龞') FROM `T12`; +REPLACE(`C1`,'龞','龞龞') +龔龖龗龞龞龡 +SELECT REPLACE(`C1`,'龡','龡龡') FROM `T12`; +REPLACE(`C1`,'龡','龡龡') +龔龖龗龞龡龡 +DROP TABLE `T1`; +DROP TABLE `ï¼´ï¼’`; +DROP TABLE `T3`; +DROP TABLE `ï¼´ï¼”`; +DROP TABLE `T5`; +DROP TABLE `ï¼´ï¼–`; +DROP TABLE `ï¼´ï¼—`; +DROP TABLE `T8`; +DROP TABLE `ï¼´ï¼™`; +DROP TABLE `T1ï¼`; +DROP TABLE `T11`; +DROP TABLE `T12`; diff --git a/mysql-test/suite/jp/r/jp_reverse_sjis.result b/mysql-test/suite/jp/r/jp_reverse_sjis.result new file mode 100755 index 00000000000..76cf9d6b571 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_reverse_sjis.result @@ -0,0 +1,86 @@ +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +drop table if exists `‚s‚P‚P`; +drop table if exists `‚s‚P‚Q`; +SET NAMES sjis; +SET character_set_database = sjis; +CREATE TABLE `‚s‚P` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Q` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚R` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚S` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚T` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚U` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚V` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚W` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚X` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚O` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚P` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚Q` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +INSERT INTO `‚s‚P` VALUES ('±²³´µ'); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚S` VALUES ('±²³´µ'); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚V` VALUES ('±²³´µ'); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ'); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\'); +SELECT REVERSE(`‚b‚P`) FROM `‚s‚P`; +REVERSE(`‚b‚P`) +µ´³²± +SELECT REVERSE(`‚b‚P`) FROM `‚s‚Q`; +REVERSE(`‚b‚P`) +‚¨‚¦‚¤‚¢‚  +SELECT REVERSE(`‚b‚P`) FROM `‚s‚R`; +REVERSE(`‚b‚P`) +\—\•\\ƒ\ +SELECT REVERSE(`‚b‚P`) FROM `‚s‚S`; +REVERSE(`‚b‚P`) +µ´³²± +SELECT REVERSE(`‚b‚P`) FROM `‚s‚T`; +REVERSE(`‚b‚P`) +‚¨‚¦‚¤‚¢‚  +SELECT REVERSE(`‚b‚P`) FROM `‚s‚U`; +REVERSE(`‚b‚P`) +\—\•\\ƒ\ +SELECT REVERSE(`‚b‚P`) FROM `‚s‚V`; +REVERSE(`‚b‚P`) +µ´³²± +SELECT REVERSE(`‚b‚P`) FROM `‚s‚W`; +REVERSE(`‚b‚P`) +‚¨‚¦‚¤‚¢‚  +SELECT REVERSE(`‚b‚P`) FROM `‚s‚X`; +REVERSE(`‚b‚P`) +\—\•\\ƒ\ +SELECT REVERSE(`‚b‚P`) FROM `‚s‚P‚O`; +REVERSE(`‚b‚P`) +µ´³²± +SELECT REVERSE(`‚b‚P`) FROM `‚s‚P‚P`; +REVERSE(`‚b‚P`) +‚¨‚¦‚¤‚¢‚  +SELECT REVERSE(`‚b‚P`) FROM `‚s‚P‚Q`; +REVERSE(`‚b‚P`) +\—\•\\ƒ\ +DROP TABLE `‚s‚P`; +DROP TABLE `‚s‚Q`; +DROP TABLE `‚s‚R`; +DROP TABLE `‚s‚S`; +DROP TABLE `‚s‚T`; +DROP TABLE `‚s‚U`; +DROP TABLE `‚s‚V`; +DROP TABLE `‚s‚W`; +DROP TABLE `‚s‚X`; +DROP TABLE `‚s‚P‚O`; +DROP TABLE `‚s‚P‚P`; +DROP TABLE `‚s‚P‚Q`; diff --git a/mysql-test/suite/jp/r/jp_reverse_ucs2.result b/mysql-test/suite/jp/r/jp_reverse_ucs2.result new file mode 100755 index 00000000000..ad9782d5048 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_reverse_ucs2.result @@ -0,0 +1,87 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; +CREATE TABLE `£Ô£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'); +SELECT REVERSE(`£Ã£±`) FROM `£Ô£±`; +REVERSE(`£Ã£±`) +޵޴޳޲ޱ +SELECT REVERSE(`£Ã£±`) FROM `£Ô£²`; +REVERSE(`£Ã£±`) +¤ª¤¨¤¦¤¤¤¢ +SELECT REVERSE(`£Ã£±`) FROM `£Ô£³`; +REVERSE(`£Ã£±`) +íàíßíÞíÝíÜ +SELECT REVERSE(`£Ã£±`) FROM `£Ô£´`; +REVERSE(`£Ã£±`) +޵޴޳޲ޱ +SELECT REVERSE(`£Ã£±`) FROM `£Ô£µ`; +REVERSE(`£Ã£±`) +¤ª¤¨¤¦¤¤¤¢ +SELECT REVERSE(`£Ã£±`) FROM `£Ô£¶`; +REVERSE(`£Ã£±`) +íàíßíÞíÝíÜ +SELECT REVERSE(`£Ã£±`) FROM `£Ô£·`; +REVERSE(`£Ã£±`) +޵޴޳޲ޱ +SELECT REVERSE(`£Ã£±`) FROM `£Ô£¸`; +REVERSE(`£Ã£±`) +¤ª¤¨¤¦¤¤¤¢ +SELECT REVERSE(`£Ã£±`) FROM `£Ô£¹`; +REVERSE(`£Ã£±`) +íàíßíÞíÝíÜ +SELECT REVERSE(`£Ã£±`) FROM `£Ô£±£°`; +REVERSE(`£Ã£±`) +޵޴޳޲ޱ +SELECT REVERSE(`£Ã£±`) FROM `£Ô£±£±`; +REVERSE(`£Ã£±`) +¤ª¤¨¤¦¤¤¤¢ +SELECT REVERSE(`£Ã£±`) FROM `£Ô£±£²`; +REVERSE(`£Ã£±`) +íàíßíÞíÝíÜ +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/r/jp_reverse_ujis.result b/mysql-test/suite/jp/r/jp_reverse_ujis.result new file mode 100755 index 00000000000..888f7f9e054 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_reverse_ujis.result @@ -0,0 +1,86 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +SET NAMES ujis; +SET character_set_database = ujis; +CREATE TABLE `£Ô£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'); +SELECT REVERSE(`£Ã£±`) FROM `£Ô£±`; +REVERSE(`£Ã£±`) +޵޴޳޲ޱ +SELECT REVERSE(`£Ã£±`) FROM `£Ô£²`; +REVERSE(`£Ã£±`) +¤ª¤¨¤¦¤¤¤¢ +SELECT REVERSE(`£Ã£±`) FROM `£Ô£³`; +REVERSE(`£Ã£±`) +íàíßíÞíÝíÜ +SELECT REVERSE(`£Ã£±`) FROM `£Ô£´`; +REVERSE(`£Ã£±`) +޵޴޳޲ޱ +SELECT REVERSE(`£Ã£±`) FROM `£Ô£µ`; +REVERSE(`£Ã£±`) +¤ª¤¨¤¦¤¤¤¢ +SELECT REVERSE(`£Ã£±`) FROM `£Ô£¶`; +REVERSE(`£Ã£±`) +íàíßíÞíÝíÜ +SELECT REVERSE(`£Ã£±`) FROM `£Ô£·`; +REVERSE(`£Ã£±`) +޵޴޳޲ޱ +SELECT REVERSE(`£Ã£±`) FROM `£Ô£¸`; +REVERSE(`£Ã£±`) +¤ª¤¨¤¦¤¤¤¢ +SELECT REVERSE(`£Ã£±`) FROM `£Ô£¹`; +REVERSE(`£Ã£±`) +íàíßíÞíÝíÜ +SELECT REVERSE(`£Ã£±`) FROM `£Ô£±£°`; +REVERSE(`£Ã£±`) +޵޴޳޲ޱ +SELECT REVERSE(`£Ã£±`) FROM `£Ô£±£±`; +REVERSE(`£Ã£±`) +¤ª¤¨¤¦¤¤¤¢ +SELECT REVERSE(`£Ã£±`) FROM `£Ô£±£²`; +REVERSE(`£Ã£±`) +íàíßíÞíÝíÜ +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/r/jp_reverse_utf8.result b/mysql-test/suite/jp/r/jp_reverse_utf8.result new file mode 100755 index 00000000000..4e02cf69645 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_reverse_utf8.result @@ -0,0 +1,86 @@ +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +drop table if exists `T11`; +drop table if exists `T12`; +SET NAMES utf8; +SET character_set_database = utf8; +CREATE TABLE `T1` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T11` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T12` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +INSERT INTO `T1` VALUES ('アイウエオ'); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T3` VALUES ('龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオ'); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオ'); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡'); +INSERT INTO `T1ï¼` VALUES ('アイウエオ'); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T12` VALUES ('龔龖龗龞龡'); +SELECT REVERSE(`C1`) FROM `T1`; +REVERSE(`C1`) +オエウイア +SELECT REVERSE(`C1`) FROM `ï¼´ï¼’`; +REVERSE(`C1`) +ãŠãˆã†ã„ã‚ +SELECT REVERSE(`C1`) FROM `T3`; +REVERSE(`C1`) +龡龞龗龖龔 +SELECT REVERSE(`C1`) FROM `ï¼´ï¼”`; +REVERSE(`C1`) +オエウイア +SELECT REVERSE(`C1`) FROM `T5`; +REVERSE(`C1`) +ãŠãˆã†ã„ã‚ +SELECT REVERSE(`C1`) FROM `ï¼´ï¼–`; +REVERSE(`C1`) +龡龞龗龖龔 +SELECT REVERSE(`C1`) FROM `ï¼´ï¼—`; +REVERSE(`C1`) +オエウイア +SELECT REVERSE(`C1`) FROM `T8`; +REVERSE(`C1`) +ãŠãˆã†ã„ã‚ +SELECT REVERSE(`C1`) FROM `ï¼´ï¼™`; +REVERSE(`C1`) +龡龞龗龖龔 +SELECT REVERSE(`C1`) FROM `T1ï¼`; +REVERSE(`C1`) +オエウイア +SELECT REVERSE(`C1`) FROM `T11`; +REVERSE(`C1`) +ãŠãˆã†ã„ã‚ +SELECT REVERSE(`C1`) FROM `T12`; +REVERSE(`C1`) +龡龞龗龖龔 +DROP TABLE `T1`; +DROP TABLE `ï¼´ï¼’`; +DROP TABLE `T3`; +DROP TABLE `ï¼´ï¼”`; +DROP TABLE `T5`; +DROP TABLE `ï¼´ï¼–`; +DROP TABLE `ï¼´ï¼—`; +DROP TABLE `T8`; +DROP TABLE `ï¼´ï¼™`; +DROP TABLE `T1ï¼`; +DROP TABLE `T11`; +DROP TABLE `T12`; diff --git a/mysql-test/suite/jp/r/jp_right_sjis.result b/mysql-test/suite/jp/r/jp_right_sjis.result new file mode 100755 index 00000000000..249d7bbb0bc --- /dev/null +++ b/mysql-test/suite/jp/r/jp_right_sjis.result @@ -0,0 +1,626 @@ +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +drop table if exists `‚s‚P‚P`; +drop table if exists `‚s‚P‚Q`; +SET NAMES sjis; +SET character_set_database = sjis; +CREATE TABLE `‚s‚P` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Q` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚R` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚S` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚T` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚U` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚V` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚W` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚X` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚O` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚P` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚Q` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +INSERT INTO `‚s‚P` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +INSERT INTO `‚s‚S` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +INSERT INTO `‚s‚V` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +SELECT `‚b‚P`, RIGHT(`‚b‚P`,0) FROM `‚s‚P`; +‚b‚P RIGHT(`‚b‚P`,0) + +± +±² +±²³ +±²³´ +±²³´µ +SELECT `‚b‚P`, RIGHT(`‚b‚P`,1) FROM `‚s‚P`; +‚b‚P RIGHT(`‚b‚P`,1) + +± ± +±² ² +±²³ ³ +±²³´ ´ +±²³´µ µ +SELECT `‚b‚P`, RIGHT(`‚b‚P`,2) FROM `‚s‚P`; +‚b‚P RIGHT(`‚b‚P`,2) + +± ± +±² ±² +±²³ ²³ +±²³´ ³´ +±²³´µ ´µ +SELECT `‚b‚P`, RIGHT(`‚b‚P`,3) FROM `‚s‚P`; +‚b‚P RIGHT(`‚b‚P`,3) + +± ± +±² ±² +±²³ ±²³ +±²³´ ²³´ +±²³´µ ³´µ +SELECT `‚b‚P`, RIGHT(`‚b‚P`,4) FROM `‚s‚P`; +‚b‚P RIGHT(`‚b‚P`,4) + +± ± +±² ±² +±²³ ±²³ +±²³´ ±²³´ +±²³´µ ²³´µ +SELECT `‚b‚P`, RIGHT(`‚b‚P`,5) FROM `‚s‚P`; +‚b‚P RIGHT(`‚b‚P`,5) + +± ± +±² ±² +±²³ ±²³ +±²³´ ±²³´ +±²³´µ ±²³´µ +SELECT `‚b‚P`, RIGHT(`‚b‚P`,0) FROM `‚s‚Q`; +‚b‚P RIGHT(`‚b‚P`,0) + +‚  +‚ ‚¢ +‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`, RIGHT(`‚b‚P`,1) FROM `‚s‚Q`; +‚b‚P RIGHT(`‚b‚P`,1) + +‚  ‚  +‚ ‚¢ ‚¢ +‚ ‚¢‚¤ ‚¤ +‚ ‚¢‚¤‚¦ ‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚¨ +SELECT `‚b‚P`, RIGHT(`‚b‚P`,2) FROM `‚s‚Q`; +‚b‚P RIGHT(`‚b‚P`,2) + +‚  ‚  +‚ ‚¢ ‚ ‚¢ +‚ ‚¢‚¤ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚¦‚¨ +SELECT `‚b‚P`, RIGHT(`‚b‚P`,3) FROM `‚s‚Q`; +‚b‚P RIGHT(`‚b‚P`,3) + +‚  ‚  +‚ ‚¢ ‚ ‚¢ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚¤‚¦‚¨ +SELECT `‚b‚P`, RIGHT(`‚b‚P`,4) FROM `‚s‚Q`; +‚b‚P RIGHT(`‚b‚P`,4) + +‚  ‚  +‚ ‚¢ ‚ ‚¢ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`, RIGHT(`‚b‚P`,5) FROM `‚s‚Q`; +‚b‚P RIGHT(`‚b‚P`,5) + +‚  ‚  +‚ ‚¢ ‚ ‚¢ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`, RIGHT(`‚b‚P`,0) FROM `‚s‚R`; +‚b‚P RIGHT(`‚b‚P`,0) + +ƒ\ +ƒ\\ +ƒ\\•\ +ƒ\\•\—\ +ƒ\\•\—\\ +SELECT `‚b‚P`, RIGHT(`‚b‚P`,1) FROM `‚s‚R`; +‚b‚P RIGHT(`‚b‚P`,1) + +ƒ\ ƒ\ +ƒ\\ \ +ƒ\\•\ •\ +ƒ\\•\—\ —\ +ƒ\\•\—\\ \ +SELECT `‚b‚P`, RIGHT(`‚b‚P`,2) FROM `‚s‚R`; +‚b‚P RIGHT(`‚b‚P`,2) + +ƒ\ ƒ\ +ƒ\\ ƒ\\ +ƒ\\•\ \•\ +ƒ\\•\—\ •\—\ +ƒ\\•\—\\ —\\ +SELECT `‚b‚P`, RIGHT(`‚b‚P`,3) FROM `‚s‚R`; +‚b‚P RIGHT(`‚b‚P`,3) + +ƒ\ ƒ\ +ƒ\\ ƒ\\ +ƒ\\•\ ƒ\\•\ +ƒ\\•\—\ \•\—\ +ƒ\\•\—\\ •\—\\ +SELECT `‚b‚P`, RIGHT(`‚b‚P`,4) FROM `‚s‚R`; +‚b‚P RIGHT(`‚b‚P`,4) + +ƒ\ ƒ\ +ƒ\\ ƒ\\ +ƒ\\•\ ƒ\\•\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\—\\ \•\—\\ +SELECT `‚b‚P`, RIGHT(`‚b‚P`,5) FROM `‚s‚R`; +‚b‚P RIGHT(`‚b‚P`,5) + +ƒ\ ƒ\ +ƒ\\ ƒ\\ +ƒ\\•\ ƒ\\•\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\—\\ ƒ\\•\—\\ +SELECT `‚b‚P`, RIGHT(`‚b‚P`,0) FROM `‚s‚S`; +‚b‚P RIGHT(`‚b‚P`,0) + +± +±² +±²³ +±²³´ +±²³´µ +SELECT `‚b‚P`, RIGHT(`‚b‚P`,1) FROM `‚s‚S`; +‚b‚P RIGHT(`‚b‚P`,1) + +± ± +±² ² +±²³ ³ +±²³´ ´ +±²³´µ µ +SELECT `‚b‚P`, RIGHT(`‚b‚P`,2) FROM `‚s‚S`; +‚b‚P RIGHT(`‚b‚P`,2) + +± ± +±² ±² +±²³ ²³ +±²³´ ³´ +±²³´µ ´µ +SELECT `‚b‚P`, RIGHT(`‚b‚P`,3) FROM `‚s‚S`; +‚b‚P RIGHT(`‚b‚P`,3) + +± ± +±² ±² +±²³ ±²³ +±²³´ ²³´ +±²³´µ ³´µ +SELECT `‚b‚P`, RIGHT(`‚b‚P`,4) FROM `‚s‚S`; +‚b‚P RIGHT(`‚b‚P`,4) + +± ± +±² ±² +±²³ ±²³ +±²³´ ±²³´ +±²³´µ ²³´µ +SELECT `‚b‚P`, RIGHT(`‚b‚P`,5) FROM `‚s‚S`; +‚b‚P RIGHT(`‚b‚P`,5) + +± ± +±² ±² +±²³ ±²³ +±²³´ ±²³´ +±²³´µ ±²³´µ +SELECT `‚b‚P`, RIGHT(`‚b‚P`,0) FROM `‚s‚T`; +‚b‚P RIGHT(`‚b‚P`,0) + +‚  +‚ ‚¢ +‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`, RIGHT(`‚b‚P`,1) FROM `‚s‚T`; +‚b‚P RIGHT(`‚b‚P`,1) + +‚  ‚  +‚ ‚¢ ‚¢ +‚ ‚¢‚¤ ‚¤ +‚ ‚¢‚¤‚¦ ‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚¨ +SELECT `‚b‚P`, RIGHT(`‚b‚P`,2) FROM `‚s‚T`; +‚b‚P RIGHT(`‚b‚P`,2) + +‚  ‚  +‚ ‚¢ ‚ ‚¢ +‚ ‚¢‚¤ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚¦‚¨ +SELECT `‚b‚P`, RIGHT(`‚b‚P`,3) FROM `‚s‚T`; +‚b‚P RIGHT(`‚b‚P`,3) + +‚  ‚  +‚ ‚¢ ‚ ‚¢ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚¤‚¦‚¨ +SELECT `‚b‚P`, RIGHT(`‚b‚P`,4) FROM `‚s‚T`; +‚b‚P RIGHT(`‚b‚P`,4) + +‚  ‚  +‚ ‚¢ ‚ ‚¢ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`, RIGHT(`‚b‚P`,5) FROM `‚s‚T`; +‚b‚P RIGHT(`‚b‚P`,5) + +‚  ‚  +‚ ‚¢ ‚ ‚¢ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`, RIGHT(`‚b‚P`,0) FROM `‚s‚U`; +‚b‚P RIGHT(`‚b‚P`,0) + +ƒ\ +ƒ\\ +ƒ\\•\ +ƒ\\•\—\ +ƒ\\•\—\\ +SELECT `‚b‚P`, RIGHT(`‚b‚P`,1) FROM `‚s‚U`; +‚b‚P RIGHT(`‚b‚P`,1) + +ƒ\ ƒ\ +ƒ\\ \ +ƒ\\•\ •\ +ƒ\\•\—\ —\ +ƒ\\•\—\\ \ +SELECT `‚b‚P`, RIGHT(`‚b‚P`,2) FROM `‚s‚U`; +‚b‚P RIGHT(`‚b‚P`,2) + +ƒ\ ƒ\ +ƒ\\ ƒ\\ +ƒ\\•\ \•\ +ƒ\\•\—\ •\—\ +ƒ\\•\—\\ —\\ +SELECT `‚b‚P`, RIGHT(`‚b‚P`,3) FROM `‚s‚U`; +‚b‚P RIGHT(`‚b‚P`,3) + +ƒ\ ƒ\ +ƒ\\ ƒ\\ +ƒ\\•\ ƒ\\•\ +ƒ\\•\—\ \•\—\ +ƒ\\•\—\\ •\—\\ +SELECT `‚b‚P`, RIGHT(`‚b‚P`,4) FROM `‚s‚U`; +‚b‚P RIGHT(`‚b‚P`,4) + +ƒ\ ƒ\ +ƒ\\ ƒ\\ +ƒ\\•\ ƒ\\•\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\—\\ \•\—\\ +SELECT `‚b‚P`, RIGHT(`‚b‚P`,5) FROM `‚s‚U`; +‚b‚P RIGHT(`‚b‚P`,5) + +ƒ\ ƒ\ +ƒ\\ ƒ\\ +ƒ\\•\ ƒ\\•\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\—\\ ƒ\\•\—\\ +SELECT `‚b‚P`, RIGHT(`‚b‚P`,0) FROM `‚s‚V`; +‚b‚P RIGHT(`‚b‚P`,0) +±²³´µ +±²³´ +±²³ +±² +± + +SELECT `‚b‚P`, RIGHT(`‚b‚P`,1) FROM `‚s‚V`; +‚b‚P RIGHT(`‚b‚P`,1) +±²³´µ µ +±²³´ ´ +±²³ ³ +±² ² +± ± + +SELECT `‚b‚P`, RIGHT(`‚b‚P`,2) FROM `‚s‚V`; +‚b‚P RIGHT(`‚b‚P`,2) +±²³´µ ´µ +±²³´ ³´ +±²³ ²³ +±² ±² +± ± + +SELECT `‚b‚P`, RIGHT(`‚b‚P`,3) FROM `‚s‚V`; +‚b‚P RIGHT(`‚b‚P`,3) +±²³´µ ³´µ +±²³´ ²³´ +±²³ ±²³ +±² ±² +± ± + +SELECT `‚b‚P`, RIGHT(`‚b‚P`,4) FROM `‚s‚V`; +‚b‚P RIGHT(`‚b‚P`,4) +±²³´µ ²³´µ +±²³´ ±²³´ +±²³ ±²³ +±² ±² +± ± + +SELECT `‚b‚P`, RIGHT(`‚b‚P`,5) FROM `‚s‚V`; +‚b‚P RIGHT(`‚b‚P`,5) +±²³´µ ±²³´µ +±²³´ ±²³´ +±²³ ±²³ +±² ±² +± ± + +SELECT `‚b‚P`, RIGHT(`‚b‚P`,0) FROM `‚s‚W`; +‚b‚P RIGHT(`‚b‚P`,0) +‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ +‚ ‚¢ +‚  + +SELECT `‚b‚P`, RIGHT(`‚b‚P`,1) FROM `‚s‚W`; +‚b‚P RIGHT(`‚b‚P`,1) +‚ ‚¢‚¤‚¦‚¨ ‚¨ +‚ ‚¢‚¤‚¦ ‚¦ +‚ ‚¢‚¤ ‚¤ +‚ ‚¢ ‚¢ +‚  ‚  + +SELECT `‚b‚P`, RIGHT(`‚b‚P`,2) FROM `‚s‚W`; +‚b‚P RIGHT(`‚b‚P`,2) +‚ ‚¢‚¤‚¦‚¨ ‚¦‚¨ +‚ ‚¢‚¤‚¦ ‚¤‚¦ +‚ ‚¢‚¤ ‚¢‚¤ +‚ ‚¢ ‚ ‚¢ +‚  ‚  + +SELECT `‚b‚P`, RIGHT(`‚b‚P`,3) FROM `‚s‚W`; +‚b‚P RIGHT(`‚b‚P`,3) +‚ ‚¢‚¤‚¦‚¨ ‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ ‚¢‚¤‚¦ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢ ‚ ‚¢ +‚  ‚  + +SELECT `‚b‚P`, RIGHT(`‚b‚P`,4) FROM `‚s‚W`; +‚b‚P RIGHT(`‚b‚P`,4) +‚ ‚¢‚¤‚¦‚¨ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢ ‚ ‚¢ +‚  ‚  + +SELECT `‚b‚P`, RIGHT(`‚b‚P`,5) FROM `‚s‚W`; +‚b‚P RIGHT(`‚b‚P`,5) +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢ ‚ ‚¢ +‚  ‚  + +SELECT `‚b‚P`, RIGHT(`‚b‚P`,0) FROM `‚s‚X`; +‚b‚P RIGHT(`‚b‚P`,0) +ƒ\\•\—\\ +ƒ\\•\—\ +ƒ\\•\ +ƒ\\ +ƒ\ + +SELECT `‚b‚P`, RIGHT(`‚b‚P`,1) FROM `‚s‚X`; +‚b‚P RIGHT(`‚b‚P`,1) +ƒ\\•\—\\ \ +ƒ\\•\—\ —\ +ƒ\\•\ •\ +ƒ\\ \ +ƒ\ ƒ\ + +SELECT `‚b‚P`, RIGHT(`‚b‚P`,2) FROM `‚s‚X`; +‚b‚P RIGHT(`‚b‚P`,2) +ƒ\\•\—\\ —\\ +ƒ\\•\—\ •\—\ +ƒ\\•\ \•\ +ƒ\\ ƒ\\ +ƒ\ ƒ\ + +SELECT `‚b‚P`, RIGHT(`‚b‚P`,3) FROM `‚s‚X`; +‚b‚P RIGHT(`‚b‚P`,3) +ƒ\\•\—\\ •\—\\ +ƒ\\•\—\ \•\—\ +ƒ\\•\ ƒ\\•\ +ƒ\\ ƒ\\ +ƒ\ ƒ\ + +SELECT `‚b‚P`, RIGHT(`‚b‚P`,4) FROM `‚s‚X`; +‚b‚P RIGHT(`‚b‚P`,4) +ƒ\\•\—\\ \•\—\\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\ ƒ\\•\ +ƒ\\ ƒ\\ +ƒ\ ƒ\ + +SELECT `‚b‚P`, RIGHT(`‚b‚P`,5) FROM `‚s‚X`; +‚b‚P RIGHT(`‚b‚P`,5) +ƒ\\•\—\\ ƒ\\•\—\\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\ ƒ\\•\ +ƒ\\ ƒ\\ +ƒ\ ƒ\ + +SELECT `‚b‚P`, RIGHT(`‚b‚P`,0) FROM `‚s‚P‚O`; +‚b‚P RIGHT(`‚b‚P`,0) +±²³´µ +±²³´ +±²³ +±² +± + +SELECT `‚b‚P`, RIGHT(`‚b‚P`,1) FROM `‚s‚P‚O`; +‚b‚P RIGHT(`‚b‚P`,1) +±²³´µ µ +±²³´ ´ +±²³ ³ +±² ² +± ± + +SELECT `‚b‚P`, RIGHT(`‚b‚P`,2) FROM `‚s‚P‚O`; +‚b‚P RIGHT(`‚b‚P`,2) +±²³´µ ´µ +±²³´ ³´ +±²³ ²³ +±² ±² +± ± + +SELECT `‚b‚P`, RIGHT(`‚b‚P`,3) FROM `‚s‚P‚O`; +‚b‚P RIGHT(`‚b‚P`,3) +±²³´µ ³´µ +±²³´ ²³´ +±²³ ±²³ +±² ±² +± ± + +SELECT `‚b‚P`, RIGHT(`‚b‚P`,4) FROM `‚s‚P‚O`; +‚b‚P RIGHT(`‚b‚P`,4) +±²³´µ ²³´µ +±²³´ ±²³´ +±²³ ±²³ +±² ±² +± ± + +SELECT `‚b‚P`, RIGHT(`‚b‚P`,5) FROM `‚s‚P‚O`; +‚b‚P RIGHT(`‚b‚P`,5) +±²³´µ ±²³´µ +±²³´ ±²³´ +±²³ ±²³ +±² ±² +± ± + +SELECT `‚b‚P`, RIGHT(`‚b‚P`,0) FROM `‚s‚P‚P`; +‚b‚P RIGHT(`‚b‚P`,0) +‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ +‚ ‚¢ +‚  + +SELECT `‚b‚P`, RIGHT(`‚b‚P`,1) FROM `‚s‚P‚P`; +‚b‚P RIGHT(`‚b‚P`,1) +‚ ‚¢‚¤‚¦‚¨ ‚¨ +‚ ‚¢‚¤‚¦ ‚¦ +‚ ‚¢‚¤ ‚¤ +‚ ‚¢ ‚¢ +‚  ‚  + +SELECT `‚b‚P`, RIGHT(`‚b‚P`,2) FROM `‚s‚P‚P`; +‚b‚P RIGHT(`‚b‚P`,2) +‚ ‚¢‚¤‚¦‚¨ ‚¦‚¨ +‚ ‚¢‚¤‚¦ ‚¤‚¦ +‚ ‚¢‚¤ ‚¢‚¤ +‚ ‚¢ ‚ ‚¢ +‚  ‚  + +SELECT `‚b‚P`, RIGHT(`‚b‚P`,3) FROM `‚s‚P‚P`; +‚b‚P RIGHT(`‚b‚P`,3) +‚ ‚¢‚¤‚¦‚¨ ‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ ‚¢‚¤‚¦ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢ ‚ ‚¢ +‚  ‚  + +SELECT `‚b‚P`, RIGHT(`‚b‚P`,4) FROM `‚s‚P‚P`; +‚b‚P RIGHT(`‚b‚P`,4) +‚ ‚¢‚¤‚¦‚¨ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢ ‚ ‚¢ +‚  ‚  + +SELECT `‚b‚P`, RIGHT(`‚b‚P`,5) FROM `‚s‚P‚P`; +‚b‚P RIGHT(`‚b‚P`,5) +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢ ‚ ‚¢ +‚  ‚  + +SELECT `‚b‚P`, RIGHT(`‚b‚P`,0) FROM `‚s‚P‚Q`; +‚b‚P RIGHT(`‚b‚P`,0) +ƒ\\•\—\\ +ƒ\\•\—\ +ƒ\\•\ +ƒ\\ +ƒ\ + +SELECT `‚b‚P`, RIGHT(`‚b‚P`,1) FROM `‚s‚P‚Q`; +‚b‚P RIGHT(`‚b‚P`,1) +ƒ\\•\—\\ \ +ƒ\\•\—\ —\ +ƒ\\•\ •\ +ƒ\\ \ +ƒ\ ƒ\ + +SELECT `‚b‚P`, RIGHT(`‚b‚P`,2) FROM `‚s‚P‚Q`; +‚b‚P RIGHT(`‚b‚P`,2) +ƒ\\•\—\\ —\\ +ƒ\\•\—\ •\—\ +ƒ\\•\ \•\ +ƒ\\ ƒ\\ +ƒ\ ƒ\ + +SELECT `‚b‚P`, RIGHT(`‚b‚P`,3) FROM `‚s‚P‚Q`; +‚b‚P RIGHT(`‚b‚P`,3) +ƒ\\•\—\\ •\—\\ +ƒ\\•\—\ \•\—\ +ƒ\\•\ ƒ\\•\ +ƒ\\ ƒ\\ +ƒ\ ƒ\ + +SELECT `‚b‚P`, RIGHT(`‚b‚P`,4) FROM `‚s‚P‚Q`; +‚b‚P RIGHT(`‚b‚P`,4) +ƒ\\•\—\\ \•\—\\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\ ƒ\\•\ +ƒ\\ ƒ\\ +ƒ\ ƒ\ + +SELECT `‚b‚P`, RIGHT(`‚b‚P`,5) FROM `‚s‚P‚Q`; +‚b‚P RIGHT(`‚b‚P`,5) +ƒ\\•\—\\ ƒ\\•\—\\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\ ƒ\\•\ +ƒ\\ ƒ\\ +ƒ\ ƒ\ + +DROP TABLE `‚s‚P`; +DROP TABLE `‚s‚Q`; +DROP TABLE `‚s‚R`; +DROP TABLE `‚s‚S`; +DROP TABLE `‚s‚T`; +DROP TABLE `‚s‚U`; +DROP TABLE `‚s‚V`; +DROP TABLE `‚s‚W`; +DROP TABLE `‚s‚X`; +DROP TABLE `‚s‚P‚O`; +DROP TABLE `‚s‚P‚P`; +DROP TABLE `‚s‚P‚Q`; diff --git a/mysql-test/suite/jp/r/jp_right_ucs2.result b/mysql-test/suite/jp/r/jp_right_ucs2.result new file mode 100755 index 00000000000..a8a3fba0f92 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_right_ucs2.result @@ -0,0 +1,627 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; +CREATE TABLE `£Ô£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£±`; +£Ã£± RIGHT(`£Ã£±`,0) + +ޱ +ޱ޲ +ޱ޲޳ +ޱ޲޳޴ +ޱ޲޳޴޵ +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£±`; +£Ã£± RIGHT(`£Ã£±`,1) + +ޱ ޱ +ޱ޲ ޲ +ޱ޲޳ ޳ +ޱ޲޳޴ Ž´ +ޱ޲޳޴޵ ޵ +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£±`; +£Ã£± RIGHT(`£Ã£±`,2) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޲޳ +ޱ޲޳޴ ޳޴ +ޱ޲޳޴޵ ޴޵ +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£±`; +£Ã£± RIGHT(`£Ã£±`,3) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޲޳޴ +ޱ޲޳޴޵ ޳޴޵ +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£±`; +£Ã£± RIGHT(`£Ã£±`,4) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳޴޵ ޲޳޴޵ +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£±`; +£Ã£± RIGHT(`£Ã£±`,5) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£²`; +£Ã£± RIGHT(`£Ã£±`,0) + +¤¢ +¤¢¤¤ +¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£²`; +£Ã£± RIGHT(`£Ã£±`,1) + +¤¢ ¤¢ +¤¢¤¤ ¤¤ +¤¢¤¤¤¦ ¤¦ +¤¢¤¤¤¦¤¨ ¤¨ +¤¢¤¤¤¦¤¨¤ª ¤ª +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£²`; +£Ã£± RIGHT(`£Ã£±`,2) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¨¤ª +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£²`; +£Ã£± RIGHT(`£Ã£±`,3) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¦¤¨¤ª +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£²`; +£Ã£± RIGHT(`£Ã£±`,4) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£²`; +£Ã£± RIGHT(`£Ã£±`,5) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£³`; +£Ã£± RIGHT(`£Ã£±`,0) + +íÜ +íÜíÝ +íÜíÝíÞ +íÜíÝíÞíß +íÜíÝíÞíßíà +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£³`; +£Ã£± RIGHT(`£Ã£±`,1) + +íÜ íÜ +íÜíÝ íÝ +íÜíÝíÞ íÞ +íÜíÝíÞíß íß +íÜíÝíÞíßíà íà +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£³`; +£Ã£± RIGHT(`£Ã£±`,2) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÝíÞ +íÜíÝíÞíß íÞíß +íÜíÝíÞíßíà íßíà +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£³`; +£Ã£± RIGHT(`£Ã£±`,3) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÝíÞíß +íÜíÝíÞíßíà íÞíßíà +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£³`; +£Ã£± RIGHT(`£Ã£±`,4) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞíßíà íÝíÞíßíà +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£³`; +£Ã£± RIGHT(`£Ã£±`,5) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£´`; +£Ã£± RIGHT(`£Ã£±`,0) + +ޱ +ޱ޲ +ޱ޲޳ +ޱ޲޳޴ +ޱ޲޳޴޵ +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£´`; +£Ã£± RIGHT(`£Ã£±`,1) + +ޱ ޱ +ޱ޲ ޲ +ޱ޲޳ ޳ +ޱ޲޳޴ Ž´ +ޱ޲޳޴޵ ޵ +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£´`; +£Ã£± RIGHT(`£Ã£±`,2) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޲޳ +ޱ޲޳޴ ޳޴ +ޱ޲޳޴޵ ޴޵ +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£´`; +£Ã£± RIGHT(`£Ã£±`,3) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޲޳޴ +ޱ޲޳޴޵ ޳޴޵ +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£´`; +£Ã£± RIGHT(`£Ã£±`,4) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳޴޵ ޲޳޴޵ +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£´`; +£Ã£± RIGHT(`£Ã£±`,5) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£µ`; +£Ã£± RIGHT(`£Ã£±`,0) + +¤¢ +¤¢¤¤ +¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£µ`; +£Ã£± RIGHT(`£Ã£±`,1) + +¤¢ ¤¢ +¤¢¤¤ ¤¤ +¤¢¤¤¤¦ ¤¦ +¤¢¤¤¤¦¤¨ ¤¨ +¤¢¤¤¤¦¤¨¤ª ¤ª +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£µ`; +£Ã£± RIGHT(`£Ã£±`,2) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¨¤ª +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£µ`; +£Ã£± RIGHT(`£Ã£±`,3) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¦¤¨¤ª +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£µ`; +£Ã£± RIGHT(`£Ã£±`,4) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£µ`; +£Ã£± RIGHT(`£Ã£±`,5) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£¶`; +£Ã£± RIGHT(`£Ã£±`,0) + +íÜ +íÜíÝ +íÜíÝíÞ +íÜíÝíÞíß +íÜíÝíÞíßíà +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£¶`; +£Ã£± RIGHT(`£Ã£±`,1) + +íÜ íÜ +íÜíÝ íÝ +íÜíÝíÞ íÞ +íÜíÝíÞíß íß +íÜíÝíÞíßíà íà +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£¶`; +£Ã£± RIGHT(`£Ã£±`,2) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÝíÞ +íÜíÝíÞíß íÞíß +íÜíÝíÞíßíà íßíà +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£¶`; +£Ã£± RIGHT(`£Ã£±`,3) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÝíÞíß +íÜíÝíÞíßíà íÞíßíà +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£¶`; +£Ã£± RIGHT(`£Ã£±`,4) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞíßíà íÝíÞíßíà +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£¶`; +£Ã£± RIGHT(`£Ã£±`,5) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£·`; +£Ã£± RIGHT(`£Ã£±`,0) +ޱ޲޳޴޵ +ޱ޲޳޴ +ޱ޲޳ +ޱ޲ +ޱ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£·`; +£Ã£± RIGHT(`£Ã£±`,1) +ޱ޲޳޴޵ ޵ +ޱ޲޳޴ Ž´ +ޱ޲޳ ޳ +ޱ޲ ޲ +ޱ ޱ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£·`; +£Ã£± RIGHT(`£Ã£±`,2) +ޱ޲޳޴޵ ޴޵ +ޱ޲޳޴ ޳޴ +ޱ޲޳ ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£·`; +£Ã£± RIGHT(`£Ã£±`,3) +ޱ޲޳޴޵ ޳޴޵ +ޱ޲޳޴ ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£·`; +£Ã£± RIGHT(`£Ã£±`,4) +ޱ޲޳޴޵ ޲޳޴޵ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£·`; +£Ã£± RIGHT(`£Ã£±`,5) +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£¸`; +£Ã£± RIGHT(`£Ã£±`,0) +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ +¤¢¤¤ +¤¢ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£¸`; +£Ã£± RIGHT(`£Ã£±`,1) +¤¢¤¤¤¦¤¨¤ª ¤ª +¤¢¤¤¤¦¤¨ ¤¨ +¤¢¤¤¤¦ ¤¦ +¤¢¤¤ ¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£¸`; +£Ã£± RIGHT(`£Ã£±`,2) +¤¢¤¤¤¦¤¨¤ª ¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¦¤¨ +¤¢¤¤¤¦ ¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£¸`; +£Ã£± RIGHT(`£Ã£±`,3) +¤¢¤¤¤¦¤¨¤ª ¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£¸`; +£Ã£± RIGHT(`£Ã£±`,4) +¤¢¤¤¤¦¤¨¤ª ¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£¸`; +£Ã£± RIGHT(`£Ã£±`,5) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£¹`; +£Ã£± RIGHT(`£Ã£±`,0) +íÜíÝíÞíßíà +íÜíÝíÞíß +íÜíÝíÞ +íÜíÝ +íÜ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£¹`; +£Ã£± RIGHT(`£Ã£±`,1) +íÜíÝíÞíßíà íà +íÜíÝíÞíß íß +íÜíÝíÞ íÞ +íÜíÝ íÝ +íÜ íÜ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£¹`; +£Ã£± RIGHT(`£Ã£±`,2) +íÜíÝíÞíßíà íßíà +íÜíÝíÞíß íÞíß +íÜíÝíÞ íÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£¹`; +£Ã£± RIGHT(`£Ã£±`,3) +íÜíÝíÞíßíà íÞíßíà +íÜíÝíÞíß íÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£¹`; +£Ã£± RIGHT(`£Ã£±`,4) +íÜíÝíÞíßíà íÝíÞíßíà +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£¹`; +£Ã£± RIGHT(`£Ã£±`,5) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£±£°`; +£Ã£± RIGHT(`£Ã£±`,0) +ޱ޲޳޴޵ +ޱ޲޳޴ +ޱ޲޳ +ޱ޲ +ޱ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£±£°`; +£Ã£± RIGHT(`£Ã£±`,1) +ޱ޲޳޴޵ ޵ +ޱ޲޳޴ Ž´ +ޱ޲޳ ޳ +ޱ޲ ޲ +ޱ ޱ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£±£°`; +£Ã£± RIGHT(`£Ã£±`,2) +ޱ޲޳޴޵ ޴޵ +ޱ޲޳޴ ޳޴ +ޱ޲޳ ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£±£°`; +£Ã£± RIGHT(`£Ã£±`,3) +ޱ޲޳޴޵ ޳޴޵ +ޱ޲޳޴ ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£±£°`; +£Ã£± RIGHT(`£Ã£±`,4) +ޱ޲޳޴޵ ޲޳޴޵ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£±£°`; +£Ã£± RIGHT(`£Ã£±`,5) +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£±£±`; +£Ã£± RIGHT(`£Ã£±`,0) +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ +¤¢¤¤ +¤¢ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£±£±`; +£Ã£± RIGHT(`£Ã£±`,1) +¤¢¤¤¤¦¤¨¤ª ¤ª +¤¢¤¤¤¦¤¨ ¤¨ +¤¢¤¤¤¦ ¤¦ +¤¢¤¤ ¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£±£±`; +£Ã£± RIGHT(`£Ã£±`,2) +¤¢¤¤¤¦¤¨¤ª ¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¦¤¨ +¤¢¤¤¤¦ ¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£±£±`; +£Ã£± RIGHT(`£Ã£±`,3) +¤¢¤¤¤¦¤¨¤ª ¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£±£±`; +£Ã£± RIGHT(`£Ã£±`,4) +¤¢¤¤¤¦¤¨¤ª ¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£±£±`; +£Ã£± RIGHT(`£Ã£±`,5) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£±£²`; +£Ã£± RIGHT(`£Ã£±`,0) +íÜíÝíÞíßíà +íÜíÝíÞíß +íÜíÝíÞ +íÜíÝ +íÜ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£±£²`; +£Ã£± RIGHT(`£Ã£±`,1) +íÜíÝíÞíßíà íà +íÜíÝíÞíß íß +íÜíÝíÞ íÞ +íÜíÝ íÝ +íÜ íÜ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£±£²`; +£Ã£± RIGHT(`£Ã£±`,2) +íÜíÝíÞíßíà íßíà +íÜíÝíÞíß íÞíß +íÜíÝíÞ íÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£±£²`; +£Ã£± RIGHT(`£Ã£±`,3) +íÜíÝíÞíßíà íÞíßíà +íÜíÝíÞíß íÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£±£²`; +£Ã£± RIGHT(`£Ã£±`,4) +íÜíÝíÞíßíà íÝíÞíßíà +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£±£²`; +£Ã£± RIGHT(`£Ã£±`,5) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/r/jp_right_ujis.result b/mysql-test/suite/jp/r/jp_right_ujis.result new file mode 100755 index 00000000000..bb182853d95 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_right_ujis.result @@ -0,0 +1,626 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +SET NAMES ujis; +SET character_set_database = ujis; +CREATE TABLE `£Ô£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£±`; +£Ã£± RIGHT(`£Ã£±`,0) + +ޱ +ޱ޲ +ޱ޲޳ +ޱ޲޳޴ +ޱ޲޳޴޵ +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£±`; +£Ã£± RIGHT(`£Ã£±`,1) + +ޱ ޱ +ޱ޲ ޲ +ޱ޲޳ ޳ +ޱ޲޳޴ Ž´ +ޱ޲޳޴޵ ޵ +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£±`; +£Ã£± RIGHT(`£Ã£±`,2) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޲޳ +ޱ޲޳޴ ޳޴ +ޱ޲޳޴޵ ޴޵ +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£±`; +£Ã£± RIGHT(`£Ã£±`,3) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޲޳޴ +ޱ޲޳޴޵ ޳޴޵ +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£±`; +£Ã£± RIGHT(`£Ã£±`,4) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳޴޵ ޲޳޴޵ +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£±`; +£Ã£± RIGHT(`£Ã£±`,5) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£²`; +£Ã£± RIGHT(`£Ã£±`,0) + +¤¢ +¤¢¤¤ +¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£²`; +£Ã£± RIGHT(`£Ã£±`,1) + +¤¢ ¤¢ +¤¢¤¤ ¤¤ +¤¢¤¤¤¦ ¤¦ +¤¢¤¤¤¦¤¨ ¤¨ +¤¢¤¤¤¦¤¨¤ª ¤ª +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£²`; +£Ã£± RIGHT(`£Ã£±`,2) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¨¤ª +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£²`; +£Ã£± RIGHT(`£Ã£±`,3) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¦¤¨¤ª +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£²`; +£Ã£± RIGHT(`£Ã£±`,4) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£²`; +£Ã£± RIGHT(`£Ã£±`,5) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£³`; +£Ã£± RIGHT(`£Ã£±`,0) + +íÜ +íÜíÝ +íÜíÝíÞ +íÜíÝíÞíß +íÜíÝíÞíßíà +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£³`; +£Ã£± RIGHT(`£Ã£±`,1) + +íÜ íÜ +íÜíÝ íÝ +íÜíÝíÞ íÞ +íÜíÝíÞíß íß +íÜíÝíÞíßíà íà +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£³`; +£Ã£± RIGHT(`£Ã£±`,2) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÝíÞ +íÜíÝíÞíß íÞíß +íÜíÝíÞíßíà íßíà +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£³`; +£Ã£± RIGHT(`£Ã£±`,3) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÝíÞíß +íÜíÝíÞíßíà íÞíßíà +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£³`; +£Ã£± RIGHT(`£Ã£±`,4) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞíßíà íÝíÞíßíà +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£³`; +£Ã£± RIGHT(`£Ã£±`,5) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£´`; +£Ã£± RIGHT(`£Ã£±`,0) + +ޱ +ޱ޲ +ޱ޲޳ +ޱ޲޳޴ +ޱ޲޳޴޵ +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£´`; +£Ã£± RIGHT(`£Ã£±`,1) + +ޱ ޱ +ޱ޲ ޲ +ޱ޲޳ ޳ +ޱ޲޳޴ Ž´ +ޱ޲޳޴޵ ޵ +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£´`; +£Ã£± RIGHT(`£Ã£±`,2) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޲޳ +ޱ޲޳޴ ޳޴ +ޱ޲޳޴޵ ޴޵ +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£´`; +£Ã£± RIGHT(`£Ã£±`,3) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޲޳޴ +ޱ޲޳޴޵ ޳޴޵ +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£´`; +£Ã£± RIGHT(`£Ã£±`,4) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳޴޵ ޲޳޴޵ +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£´`; +£Ã£± RIGHT(`£Ã£±`,5) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£µ`; +£Ã£± RIGHT(`£Ã£±`,0) + +¤¢ +¤¢¤¤ +¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£µ`; +£Ã£± RIGHT(`£Ã£±`,1) + +¤¢ ¤¢ +¤¢¤¤ ¤¤ +¤¢¤¤¤¦ ¤¦ +¤¢¤¤¤¦¤¨ ¤¨ +¤¢¤¤¤¦¤¨¤ª ¤ª +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£µ`; +£Ã£± RIGHT(`£Ã£±`,2) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¨¤ª +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£µ`; +£Ã£± RIGHT(`£Ã£±`,3) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¦¤¨¤ª +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£µ`; +£Ã£± RIGHT(`£Ã£±`,4) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£µ`; +£Ã£± RIGHT(`£Ã£±`,5) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£¶`; +£Ã£± RIGHT(`£Ã£±`,0) + +íÜ +íÜíÝ +íÜíÝíÞ +íÜíÝíÞíß +íÜíÝíÞíßíà +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£¶`; +£Ã£± RIGHT(`£Ã£±`,1) + +íÜ íÜ +íÜíÝ íÝ +íÜíÝíÞ íÞ +íÜíÝíÞíß íß +íÜíÝíÞíßíà íà +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£¶`; +£Ã£± RIGHT(`£Ã£±`,2) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÝíÞ +íÜíÝíÞíß íÞíß +íÜíÝíÞíßíà íßíà +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£¶`; +£Ã£± RIGHT(`£Ã£±`,3) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÝíÞíß +íÜíÝíÞíßíà íÞíßíà +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£¶`; +£Ã£± RIGHT(`£Ã£±`,4) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞíßíà íÝíÞíßíà +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£¶`; +£Ã£± RIGHT(`£Ã£±`,5) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£·`; +£Ã£± RIGHT(`£Ã£±`,0) +ޱ޲޳޴޵ +ޱ޲޳޴ +ޱ޲޳ +ޱ޲ +ޱ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£·`; +£Ã£± RIGHT(`£Ã£±`,1) +ޱ޲޳޴޵ ޵ +ޱ޲޳޴ Ž´ +ޱ޲޳ ޳ +ޱ޲ ޲ +ޱ ޱ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£·`; +£Ã£± RIGHT(`£Ã£±`,2) +ޱ޲޳޴޵ ޴޵ +ޱ޲޳޴ ޳޴ +ޱ޲޳ ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£·`; +£Ã£± RIGHT(`£Ã£±`,3) +ޱ޲޳޴޵ ޳޴޵ +ޱ޲޳޴ ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£·`; +£Ã£± RIGHT(`£Ã£±`,4) +ޱ޲޳޴޵ ޲޳޴޵ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£·`; +£Ã£± RIGHT(`£Ã£±`,5) +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£¸`; +£Ã£± RIGHT(`£Ã£±`,0) +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ +¤¢¤¤ +¤¢ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£¸`; +£Ã£± RIGHT(`£Ã£±`,1) +¤¢¤¤¤¦¤¨¤ª ¤ª +¤¢¤¤¤¦¤¨ ¤¨ +¤¢¤¤¤¦ ¤¦ +¤¢¤¤ ¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£¸`; +£Ã£± RIGHT(`£Ã£±`,2) +¤¢¤¤¤¦¤¨¤ª ¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¦¤¨ +¤¢¤¤¤¦ ¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£¸`; +£Ã£± RIGHT(`£Ã£±`,3) +¤¢¤¤¤¦¤¨¤ª ¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£¸`; +£Ã£± RIGHT(`£Ã£±`,4) +¤¢¤¤¤¦¤¨¤ª ¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£¸`; +£Ã£± RIGHT(`£Ã£±`,5) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£¹`; +£Ã£± RIGHT(`£Ã£±`,0) +íÜíÝíÞíßíà +íÜíÝíÞíß +íÜíÝíÞ +íÜíÝ +íÜ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£¹`; +£Ã£± RIGHT(`£Ã£±`,1) +íÜíÝíÞíßíà íà +íÜíÝíÞíß íß +íÜíÝíÞ íÞ +íÜíÝ íÝ +íÜ íÜ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£¹`; +£Ã£± RIGHT(`£Ã£±`,2) +íÜíÝíÞíßíà íßíà +íÜíÝíÞíß íÞíß +íÜíÝíÞ íÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£¹`; +£Ã£± RIGHT(`£Ã£±`,3) +íÜíÝíÞíßíà íÞíßíà +íÜíÝíÞíß íÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£¹`; +£Ã£± RIGHT(`£Ã£±`,4) +íÜíÝíÞíßíà íÝíÞíßíà +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£¹`; +£Ã£± RIGHT(`£Ã£±`,5) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£±£°`; +£Ã£± RIGHT(`£Ã£±`,0) +ޱ޲޳޴޵ +ޱ޲޳޴ +ޱ޲޳ +ޱ޲ +ޱ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£±£°`; +£Ã£± RIGHT(`£Ã£±`,1) +ޱ޲޳޴޵ ޵ +ޱ޲޳޴ Ž´ +ޱ޲޳ ޳ +ޱ޲ ޲ +ޱ ޱ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£±£°`; +£Ã£± RIGHT(`£Ã£±`,2) +ޱ޲޳޴޵ ޴޵ +ޱ޲޳޴ ޳޴ +ޱ޲޳ ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£±£°`; +£Ã£± RIGHT(`£Ã£±`,3) +ޱ޲޳޴޵ ޳޴޵ +ޱ޲޳޴ ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£±£°`; +£Ã£± RIGHT(`£Ã£±`,4) +ޱ޲޳޴޵ ޲޳޴޵ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£±£°`; +£Ã£± RIGHT(`£Ã£±`,5) +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£±£±`; +£Ã£± RIGHT(`£Ã£±`,0) +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ +¤¢¤¤ +¤¢ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£±£±`; +£Ã£± RIGHT(`£Ã£±`,1) +¤¢¤¤¤¦¤¨¤ª ¤ª +¤¢¤¤¤¦¤¨ ¤¨ +¤¢¤¤¤¦ ¤¦ +¤¢¤¤ ¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£±£±`; +£Ã£± RIGHT(`£Ã£±`,2) +¤¢¤¤¤¦¤¨¤ª ¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¦¤¨ +¤¢¤¤¤¦ ¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£±£±`; +£Ã£± RIGHT(`£Ã£±`,3) +¤¢¤¤¤¦¤¨¤ª ¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£±£±`; +£Ã£± RIGHT(`£Ã£±`,4) +¤¢¤¤¤¦¤¨¤ª ¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£±£±`; +£Ã£± RIGHT(`£Ã£±`,5) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£±£²`; +£Ã£± RIGHT(`£Ã£±`,0) +íÜíÝíÞíßíà +íÜíÝíÞíß +íÜíÝíÞ +íÜíÝ +íÜ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£±£²`; +£Ã£± RIGHT(`£Ã£±`,1) +íÜíÝíÞíßíà íà +íÜíÝíÞíß íß +íÜíÝíÞ íÞ +íÜíÝ íÝ +íÜ íÜ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£±£²`; +£Ã£± RIGHT(`£Ã£±`,2) +íÜíÝíÞíßíà íßíà +íÜíÝíÞíß íÞíß +íÜíÝíÞ íÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£±£²`; +£Ã£± RIGHT(`£Ã£±`,3) +íÜíÝíÞíßíà íÞíßíà +íÜíÝíÞíß íÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£±£²`; +£Ã£± RIGHT(`£Ã£±`,4) +íÜíÝíÞíßíà íÝíÞíßíà +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£±£²`; +£Ã£± RIGHT(`£Ã£±`,5) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/r/jp_right_utf8.result b/mysql-test/suite/jp/r/jp_right_utf8.result new file mode 100755 index 00000000000..50ba18ce3c4 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_right_utf8.result @@ -0,0 +1,626 @@ +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +drop table if exists `T11`; +drop table if exists `T12`; +SET NAMES utf8; +SET character_set_database = utf8; +CREATE TABLE `T1` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T11` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T12` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +INSERT INTO `T1` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `T3` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +INSERT INTO `T1ï¼` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `T12` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +SELECT `C1`, RIGHT(`C1`,0) FROM `T1`; +C1 RIGHT(`C1`,0) + +ï½± +アイ +アイウ +アイウエ +アイウエオ +SELECT `C1`, RIGHT(`C1`,1) FROM `T1`; +C1 RIGHT(`C1`,1) + +ï½± ï½± +アイ ï½² +アイウ ï½³ +アイウエ ï½´ +アイウエオ ï½µ +SELECT `C1`, RIGHT(`C1`,2) FROM `T1`; +C1 RIGHT(`C1`,2) + +ï½± ï½± +アイ アイ +アイウ イウ +アイウエ ウエ +アイウエオ ï½´ï½µ +SELECT `C1`, RIGHT(`C1`,3) FROM `T1`; +C1 RIGHT(`C1`,3) + +ï½± ï½± +アイ アイ +アイウ アイウ +アイウエ イウエ +アイウエオ ウエオ +SELECT `C1`, RIGHT(`C1`,4) FROM `T1`; +C1 RIGHT(`C1`,4) + +ï½± ï½± +アイ アイ +アイウ アイウ +アイウエ アイウエ +アイウエオ イウエオ +SELECT `C1`, RIGHT(`C1`,5) FROM `T1`; +C1 RIGHT(`C1`,5) + +ï½± ï½± +アイ アイ +アイウ アイウ +アイウエ アイウエ +アイウエオ アイウエオ +SELECT `C1`, RIGHT(`C1`,0) FROM `ï¼´ï¼’`; +C1 RIGHT(`C1`,0) + +ã‚ +ã‚ã„ +ã‚ã„ㆠ+ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ +SELECT `C1`, RIGHT(`C1`,1) FROM `ï¼´ï¼’`; +C1 RIGHT(`C1`,1) + +ã‚ ã‚ +ã‚ã„ ã„ +ã‚ã„ㆠㆠ+ã‚ã„ã†ãˆ ㈠+ã‚ã„ã†ãˆãŠ ãŠ +SELECT `C1`, RIGHT(`C1`,2) FROM `ï¼´ï¼’`; +C1 RIGHT(`C1`,2) + +ã‚ ã‚ +ã‚ã„ ã‚ã„ +ã‚ã„ㆠã„ㆠ+ã‚ã„ã†ãˆ ã†ãˆ +ã‚ã„ã†ãˆãŠ ãˆãŠ +SELECT `C1`, RIGHT(`C1`,3) FROM `ï¼´ï¼’`; +C1 RIGHT(`C1`,3) + +ã‚ ã‚ +ã‚ã„ ã‚ã„ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ã†ãˆ ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ ã†ãˆãŠ +SELECT `C1`, RIGHT(`C1`,4) FROM `ï¼´ï¼’`; +C1 RIGHT(`C1`,4) + +ã‚ ã‚ +ã‚ã„ ã‚ã„ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ ã„ã†ãˆãŠ +SELECT `C1`, RIGHT(`C1`,5) FROM `ï¼´ï¼’`; +C1 RIGHT(`C1`,5) + +ã‚ ã‚ +ã‚ã„ ã‚ã„ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +SELECT `C1`, RIGHT(`C1`,0) FROM `T3`; +C1 RIGHT(`C1`,0) + +é¾” +龔龖 +龔龖龗 +龔龖龗龞 +龔龖龗龞龡 +SELECT `C1`, RIGHT(`C1`,1) FROM `T3`; +C1 RIGHT(`C1`,1) + +é¾” é¾” +龔龖 é¾– +龔龖龗 é¾— +龔龖龗龞 龞 +龔龖龗龞龡 龡 +SELECT `C1`, RIGHT(`C1`,2) FROM `T3`; +C1 RIGHT(`C1`,2) + +é¾” é¾” +龔龖 龔龖 +龔龖龗 é¾–é¾— +龔龖龗龞 龗龞 +龔龖龗龞龡 龞龡 +SELECT `C1`, RIGHT(`C1`,3) FROM `T3`; +C1 RIGHT(`C1`,3) + +é¾” é¾” +龔龖 龔龖 +龔龖龗 龔龖龗 +龔龖龗龞 龖龗龞 +龔龖龗龞龡 龗龞龡 +SELECT `C1`, RIGHT(`C1`,4) FROM `T3`; +C1 RIGHT(`C1`,4) + +é¾” é¾” +龔龖 龔龖 +龔龖龗 龔龖龗 +龔龖龗龞 龔龖龗龞 +龔龖龗龞龡 龖龗龞龡 +SELECT `C1`, RIGHT(`C1`,5) FROM `T3`; +C1 RIGHT(`C1`,5) + +é¾” é¾” +龔龖 龔龖 +龔龖龗 龔龖龗 +龔龖龗龞 龔龖龗龞 +龔龖龗龞龡 龔龖龗龞龡 +SELECT `C1`, RIGHT(`C1`,0) FROM `ï¼´ï¼”`; +C1 RIGHT(`C1`,0) + +ï½± +アイ +アイウ +アイウエ +アイウエオ +SELECT `C1`, RIGHT(`C1`,1) FROM `ï¼´ï¼”`; +C1 RIGHT(`C1`,1) + +ï½± ï½± +アイ ï½² +アイウ ï½³ +アイウエ ï½´ +アイウエオ ï½µ +SELECT `C1`, RIGHT(`C1`,2) FROM `ï¼´ï¼”`; +C1 RIGHT(`C1`,2) + +ï½± ï½± +アイ アイ +アイウ イウ +アイウエ ウエ +アイウエオ ï½´ï½µ +SELECT `C1`, RIGHT(`C1`,3) FROM `ï¼´ï¼”`; +C1 RIGHT(`C1`,3) + +ï½± ï½± +アイ アイ +アイウ アイウ +アイウエ イウエ +アイウエオ ウエオ +SELECT `C1`, RIGHT(`C1`,4) FROM `ï¼´ï¼”`; +C1 RIGHT(`C1`,4) + +ï½± ï½± +アイ アイ +アイウ アイウ +アイウエ アイウエ +アイウエオ イウエオ +SELECT `C1`, RIGHT(`C1`,5) FROM `ï¼´ï¼”`; +C1 RIGHT(`C1`,5) + +ï½± ï½± +アイ アイ +アイウ アイウ +アイウエ アイウエ +アイウエオ アイウエオ +SELECT `C1`, RIGHT(`C1`,0) FROM `T5`; +C1 RIGHT(`C1`,0) + +ã‚ +ã‚ã„ +ã‚ã„ㆠ+ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ +SELECT `C1`, RIGHT(`C1`,1) FROM `T5`; +C1 RIGHT(`C1`,1) + +ã‚ ã‚ +ã‚ã„ ã„ +ã‚ã„ㆠㆠ+ã‚ã„ã†ãˆ ㈠+ã‚ã„ã†ãˆãŠ ãŠ +SELECT `C1`, RIGHT(`C1`,2) FROM `T5`; +C1 RIGHT(`C1`,2) + +ã‚ ã‚ +ã‚ã„ ã‚ã„ +ã‚ã„ㆠã„ㆠ+ã‚ã„ã†ãˆ ã†ãˆ +ã‚ã„ã†ãˆãŠ ãˆãŠ +SELECT `C1`, RIGHT(`C1`,3) FROM `T5`; +C1 RIGHT(`C1`,3) + +ã‚ ã‚ +ã‚ã„ ã‚ã„ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ã†ãˆ ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ ã†ãˆãŠ +SELECT `C1`, RIGHT(`C1`,4) FROM `T5`; +C1 RIGHT(`C1`,4) + +ã‚ ã‚ +ã‚ã„ ã‚ã„ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ ã„ã†ãˆãŠ +SELECT `C1`, RIGHT(`C1`,5) FROM `T5`; +C1 RIGHT(`C1`,5) + +ã‚ ã‚ +ã‚ã„ ã‚ã„ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +SELECT `C1`, RIGHT(`C1`,0) FROM `ï¼´ï¼–`; +C1 RIGHT(`C1`,0) + +é¾” +龔龖 +龔龖龗 +龔龖龗龞 +龔龖龗龞龡 +SELECT `C1`, RIGHT(`C1`,1) FROM `ï¼´ï¼–`; +C1 RIGHT(`C1`,1) + +é¾” é¾” +龔龖 é¾– +龔龖龗 é¾— +龔龖龗龞 龞 +龔龖龗龞龡 龡 +SELECT `C1`, RIGHT(`C1`,2) FROM `ï¼´ï¼–`; +C1 RIGHT(`C1`,2) + +é¾” é¾” +龔龖 龔龖 +龔龖龗 é¾–é¾— +龔龖龗龞 龗龞 +龔龖龗龞龡 龞龡 +SELECT `C1`, RIGHT(`C1`,3) FROM `ï¼´ï¼–`; +C1 RIGHT(`C1`,3) + +é¾” é¾” +龔龖 龔龖 +龔龖龗 龔龖龗 +龔龖龗龞 龖龗龞 +龔龖龗龞龡 龗龞龡 +SELECT `C1`, RIGHT(`C1`,4) FROM `ï¼´ï¼–`; +C1 RIGHT(`C1`,4) + +é¾” é¾” +龔龖 龔龖 +龔龖龗 龔龖龗 +龔龖龗龞 龔龖龗龞 +龔龖龗龞龡 龖龗龞龡 +SELECT `C1`, RIGHT(`C1`,5) FROM `ï¼´ï¼–`; +C1 RIGHT(`C1`,5) + +é¾” é¾” +龔龖 龔龖 +龔龖龗 龔龖龗 +龔龖龗龞 龔龖龗龞 +龔龖龗龞龡 龔龖龗龞龡 +SELECT `C1`, RIGHT(`C1`,0) FROM `ï¼´ï¼—`; +C1 RIGHT(`C1`,0) +アイウエオ +アイウエ +アイウ +アイ +ï½± + +SELECT `C1`, RIGHT(`C1`,1) FROM `ï¼´ï¼—`; +C1 RIGHT(`C1`,1) +アイウエオ ï½µ +アイウエ ï½´ +アイウ ï½³ +アイ ï½² +ï½± ï½± + +SELECT `C1`, RIGHT(`C1`,2) FROM `ï¼´ï¼—`; +C1 RIGHT(`C1`,2) +アイウエオ ï½´ï½µ +アイウエ ウエ +アイウ イウ +アイ アイ +ï½± ï½± + +SELECT `C1`, RIGHT(`C1`,3) FROM `ï¼´ï¼—`; +C1 RIGHT(`C1`,3) +アイウエオ ウエオ +アイウエ イウエ +アイウ アイウ +アイ アイ +ï½± ï½± + +SELECT `C1`, RIGHT(`C1`,4) FROM `ï¼´ï¼—`; +C1 RIGHT(`C1`,4) +アイウエオ イウエオ +アイウエ アイウエ +アイウ アイウ +アイ アイ +ï½± ï½± + +SELECT `C1`, RIGHT(`C1`,5) FROM `ï¼´ï¼—`; +C1 RIGHT(`C1`,5) +アイウエオ アイウエオ +アイウエ アイウエ +アイウ アイウ +アイ アイ +ï½± ï½± + +SELECT `C1`, RIGHT(`C1`,0) FROM `T8`; +C1 RIGHT(`C1`,0) +ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆ +ã‚ã„ㆠ+ã‚ã„ +ã‚ + +SELECT `C1`, RIGHT(`C1`,1) FROM `T8`; +C1 RIGHT(`C1`,1) +ã‚ã„ã†ãˆãŠ ãŠ +ã‚ã„ã†ãˆ ㈠+ã‚ã„ㆠㆠ+ã‚ã„ ã„ +ã‚ ã‚ + +SELECT `C1`, RIGHT(`C1`,2) FROM `T8`; +C1 RIGHT(`C1`,2) +ã‚ã„ã†ãˆãŠ ãˆãŠ +ã‚ã„ã†ãˆ ã†ãˆ +ã‚ã„ㆠã„ㆠ+ã‚ã„ ã‚ã„ +ã‚ ã‚ + +SELECT `C1`, RIGHT(`C1`,3) FROM `T8`; +C1 RIGHT(`C1`,3) +ã‚ã„ã†ãˆãŠ ã†ãˆãŠ +ã‚ã„ã†ãˆ ã„ã†ãˆ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ ã‚ã„ +ã‚ ã‚ + +SELECT `C1`, RIGHT(`C1`,4) FROM `T8`; +C1 RIGHT(`C1`,4) +ã‚ã„ã†ãˆãŠ ã„ã†ãˆãŠ +ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ ã‚ã„ +ã‚ ã‚ + +SELECT `C1`, RIGHT(`C1`,5) FROM `T8`; +C1 RIGHT(`C1`,5) +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ ã‚ã„ +ã‚ ã‚ + +SELECT `C1`, RIGHT(`C1`,0) FROM `ï¼´ï¼™`; +C1 RIGHT(`C1`,0) +龔龖龗龞龡 +龔龖龗龞 +龔龖龗 +龔龖 +é¾” + +SELECT `C1`, RIGHT(`C1`,1) FROM `ï¼´ï¼™`; +C1 RIGHT(`C1`,1) +龔龖龗龞龡 龡 +龔龖龗龞 龞 +龔龖龗 é¾— +龔龖 é¾– +é¾” é¾” + +SELECT `C1`, RIGHT(`C1`,2) FROM `ï¼´ï¼™`; +C1 RIGHT(`C1`,2) +龔龖龗龞龡 龞龡 +龔龖龗龞 龗龞 +龔龖龗 é¾–é¾— +龔龖 龔龖 +é¾” é¾” + +SELECT `C1`, RIGHT(`C1`,3) FROM `ï¼´ï¼™`; +C1 RIGHT(`C1`,3) +龔龖龗龞龡 龗龞龡 +龔龖龗龞 龖龗龞 +龔龖龗 龔龖龗 +龔龖 龔龖 +é¾” é¾” + +SELECT `C1`, RIGHT(`C1`,4) FROM `ï¼´ï¼™`; +C1 RIGHT(`C1`,4) +龔龖龗龞龡 龖龗龞龡 +龔龖龗龞 龔龖龗龞 +龔龖龗 龔龖龗 +龔龖 龔龖 +é¾” é¾” + +SELECT `C1`, RIGHT(`C1`,5) FROM `ï¼´ï¼™`; +C1 RIGHT(`C1`,5) +龔龖龗龞龡 龔龖龗龞龡 +龔龖龗龞 龔龖龗龞 +龔龖龗 龔龖龗 +龔龖 龔龖 +é¾” é¾” + +SELECT `C1`, RIGHT(`C1`,0) FROM `T1ï¼`; +C1 RIGHT(`C1`,0) +アイウエオ +アイウエ +アイウ +アイ +ï½± + +SELECT `C1`, RIGHT(`C1`,1) FROM `T1ï¼`; +C1 RIGHT(`C1`,1) +アイウエオ ï½µ +アイウエ ï½´ +アイウ ï½³ +アイ ï½² +ï½± ï½± + +SELECT `C1`, RIGHT(`C1`,2) FROM `T1ï¼`; +C1 RIGHT(`C1`,2) +アイウエオ ï½´ï½µ +アイウエ ウエ +アイウ イウ +アイ アイ +ï½± ï½± + +SELECT `C1`, RIGHT(`C1`,3) FROM `T1ï¼`; +C1 RIGHT(`C1`,3) +アイウエオ ウエオ +アイウエ イウエ +アイウ アイウ +アイ アイ +ï½± ï½± + +SELECT `C1`, RIGHT(`C1`,4) FROM `T1ï¼`; +C1 RIGHT(`C1`,4) +アイウエオ イウエオ +アイウエ アイウエ +アイウ アイウ +アイ アイ +ï½± ï½± + +SELECT `C1`, RIGHT(`C1`,5) FROM `T1ï¼`; +C1 RIGHT(`C1`,5) +アイウエオ アイウエオ +アイウエ アイウエ +アイウ アイウ +アイ アイ +ï½± ï½± + +SELECT `C1`, RIGHT(`C1`,0) FROM `T11`; +C1 RIGHT(`C1`,0) +ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆ +ã‚ã„ㆠ+ã‚ã„ +ã‚ + +SELECT `C1`, RIGHT(`C1`,1) FROM `T11`; +C1 RIGHT(`C1`,1) +ã‚ã„ã†ãˆãŠ ãŠ +ã‚ã„ã†ãˆ ㈠+ã‚ã„ㆠㆠ+ã‚ã„ ã„ +ã‚ ã‚ + +SELECT `C1`, RIGHT(`C1`,2) FROM `T11`; +C1 RIGHT(`C1`,2) +ã‚ã„ã†ãˆãŠ ãˆãŠ +ã‚ã„ã†ãˆ ã†ãˆ +ã‚ã„ㆠã„ㆠ+ã‚ã„ ã‚ã„ +ã‚ ã‚ + +SELECT `C1`, RIGHT(`C1`,3) FROM `T11`; +C1 RIGHT(`C1`,3) +ã‚ã„ã†ãˆãŠ ã†ãˆãŠ +ã‚ã„ã†ãˆ ã„ã†ãˆ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ ã‚ã„ +ã‚ ã‚ + +SELECT `C1`, RIGHT(`C1`,4) FROM `T11`; +C1 RIGHT(`C1`,4) +ã‚ã„ã†ãˆãŠ ã„ã†ãˆãŠ +ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ ã‚ã„ +ã‚ ã‚ + +SELECT `C1`, RIGHT(`C1`,5) FROM `T11`; +C1 RIGHT(`C1`,5) +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ ã‚ã„ +ã‚ ã‚ + +SELECT `C1`, RIGHT(`C1`,0) FROM `T12`; +C1 RIGHT(`C1`,0) +龔龖龗龞龡 +龔龖龗龞 +龔龖龗 +龔龖 +é¾” + +SELECT `C1`, RIGHT(`C1`,1) FROM `T12`; +C1 RIGHT(`C1`,1) +龔龖龗龞龡 龡 +龔龖龗龞 龞 +龔龖龗 é¾— +龔龖 é¾– +é¾” é¾” + +SELECT `C1`, RIGHT(`C1`,2) FROM `T12`; +C1 RIGHT(`C1`,2) +龔龖龗龞龡 龞龡 +龔龖龗龞 龗龞 +龔龖龗 é¾–é¾— +龔龖 龔龖 +é¾” é¾” + +SELECT `C1`, RIGHT(`C1`,3) FROM `T12`; +C1 RIGHT(`C1`,3) +龔龖龗龞龡 龗龞龡 +龔龖龗龞 龖龗龞 +龔龖龗 龔龖龗 +龔龖 龔龖 +é¾” é¾” + +SELECT `C1`, RIGHT(`C1`,4) FROM `T12`; +C1 RIGHT(`C1`,4) +龔龖龗龞龡 龖龗龞龡 +龔龖龗龞 龔龖龗龞 +龔龖龗 龔龖龗 +龔龖 龔龖 +é¾” é¾” + +SELECT `C1`, RIGHT(`C1`,5) FROM `T12`; +C1 RIGHT(`C1`,5) +龔龖龗龞龡 龔龖龗龞龡 +龔龖龗龞 龔龖龗龞 +龔龖龗 龔龖龗 +龔龖 龔龖 +é¾” é¾” + +DROP TABLE `T1`; +DROP TABLE `ï¼´ï¼’`; +DROP TABLE `T3`; +DROP TABLE `ï¼´ï¼”`; +DROP TABLE `T5`; +DROP TABLE `ï¼´ï¼–`; +DROP TABLE `ï¼´ï¼—`; +DROP TABLE `T8`; +DROP TABLE `ï¼´ï¼™`; +DROP TABLE `T1ï¼`; +DROP TABLE `T11`; +DROP TABLE `T12`; diff --git a/mysql-test/suite/jp/r/jp_rpad_sjis.result b/mysql-test/suite/jp/r/jp_rpad_sjis.result new file mode 100755 index 00000000000..9c61c200672 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_rpad_sjis.result @@ -0,0 +1,146 @@ +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +drop table if exists `‚s‚P‚P`; +drop table if exists `‚s‚P‚Q`; +SET NAMES sjis; +SET character_set_database = sjis; +CREATE TABLE `‚s‚P` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Q` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚R` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚S` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚T` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚U` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚V` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚W` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚X` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚O` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚P` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚Q` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +INSERT INTO `‚s‚P` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +INSERT INTO `‚s‚S` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +INSERT INTO `‚s‚V` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +SELECT `‚b‚P`, RPAD(`‚b‚P`,5,'¡') FROM `‚s‚P`; +‚b‚P RPAD(`‚b‚P`,5,'¡') + ¡¡¡¡¡ +± ±¡¡¡¡ +±² ±²¡¡¡ +±²³ ±²³¡¡ +±²³´ ±²³´¡ +±²³´µ ±²³´µ +SELECT `‚b‚P`, RPAD(`‚b‚P`,5,'‚w') FROM `‚s‚Q`; +‚b‚P RPAD(`‚b‚P`,5,'‚w') + ‚w‚w‚w‚w‚w +‚  ‚ ‚w‚w‚w‚w +‚ ‚¢ ‚ ‚¢‚w‚w‚w +‚ ‚¢‚¤ ‚ ‚¢‚¤‚w‚w +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦‚w +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`, RPAD(`‚b‚P`,5,'–\') FROM `‚s‚R`; +‚b‚P RPAD(`‚b‚P`,5,'–\') + –\–\–\–\–\ +ƒ\ ƒ\–\–\–\–\ +ƒ\\ ƒ\\–\–\–\ +ƒ\\•\ ƒ\\•\–\–\ +ƒ\\•\—\ ƒ\\•\—\–\ +ƒ\\•\—\\ ƒ\\•\—\\ +SELECT `‚b‚P`, RPAD(`‚b‚P`,5,'¡') FROM `‚s‚S`; +‚b‚P RPAD(`‚b‚P`,5,'¡') + ¡¡¡¡¡ +± ±¡¡¡¡ +±² ±²¡¡¡ +±²³ ±²³¡¡ +±²³´ ±²³´¡ +±²³´µ ±²³´µ +SELECT `‚b‚P`, RPAD(`‚b‚P`,5,'‚w') FROM `‚s‚T`; +‚b‚P RPAD(`‚b‚P`,5,'‚w') + ‚w‚w‚w‚w‚w +‚  ‚ ‚w‚w‚w‚w +‚ ‚¢ ‚ ‚¢‚w‚w‚w +‚ ‚¢‚¤ ‚ ‚¢‚¤‚w‚w +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦‚w +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`, RPAD(`‚b‚P`,5,'–\' ) FROM `‚s‚U`; +‚b‚P RPAD(`‚b‚P`,5,'–\' ) + –\–\–\–\–\ +ƒ\ ƒ\–\–\–\–\ +ƒ\\ ƒ\\–\–\–\ +ƒ\\•\ ƒ\\•\–\–\ +ƒ\\•\—\ ƒ\\•\—\–\ +ƒ\\•\—\\ ƒ\\•\—\\ +SELECT `‚b‚P`, RPAD(`‚b‚P`,5,'¡') FROM `‚s‚V`; +‚b‚P RPAD(`‚b‚P`,5,'¡') +±²³´µ ±²³´µ +±²³´ ±²³´¡ +±²³ ±²³¡¡ +±² ±²¡¡¡ +± ±¡¡¡¡ + ¡¡¡¡¡ +SELECT `‚b‚P`, RPAD(`‚b‚P`,5,'‚w') FROM `‚s‚W`; +‚b‚P RPAD(`‚b‚P`,5,'‚w') +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦‚w +‚ ‚¢‚¤ ‚ ‚¢‚¤‚w‚w +‚ ‚¢ ‚ ‚¢‚w‚w‚w +‚  ‚ ‚w‚w‚w‚w + ‚w‚w‚w‚w‚w +SELECT `‚b‚P`, RPAD(`‚b‚P`,5,'–\' ) FROM `‚s‚X`; +‚b‚P RPAD(`‚b‚P`,5,'–\' ) +ƒ\\•\—\\ ƒ\\•\—\\ +ƒ\\•\—\ ƒ\\•\—\–\ +ƒ\\•\ ƒ\\•\–\–\ +ƒ\\ ƒ\\–\–\–\ +ƒ\ ƒ\–\–\–\–\ + –\–\–\–\–\ +SELECT `‚b‚P`, RPAD(`‚b‚P`,5,'¡') FROM `‚s‚P‚O`; +‚b‚P RPAD(`‚b‚P`,5,'¡') +±²³´µ ±²³´µ +±²³´ ±²³´¡ +±²³ ±²³¡¡ +±² ±²¡¡¡ +± ±¡¡¡¡ + ¡¡¡¡¡ +SELECT `‚b‚P`, RPAD(`‚b‚P`,5,'‚w') FROM `‚s‚P‚P`; +‚b‚P RPAD(`‚b‚P`,5,'‚w') +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦‚w +‚ ‚¢‚¤ ‚ ‚¢‚¤‚w‚w +‚ ‚¢ ‚ ‚¢‚w‚w‚w +‚  ‚ ‚w‚w‚w‚w + ‚w‚w‚w‚w‚w +SELECT `‚b‚P`, RPAD(`‚b‚P`,5,'–\' ) FROM `‚s‚P‚Q`; +‚b‚P RPAD(`‚b‚P`,5,'–\' ) +ƒ\\•\—\\ ƒ\\•\—\\ +ƒ\\•\—\ ƒ\\•\—\–\ +ƒ\\•\ ƒ\\•\–\–\ +ƒ\\ ƒ\\–\–\–\ +ƒ\ ƒ\–\–\–\–\ + –\–\–\–\–\ +DROP TABLE `‚s‚P`; +DROP TABLE `‚s‚Q`; +DROP TABLE `‚s‚R`; +DROP TABLE `‚s‚S`; +DROP TABLE `‚s‚T`; +DROP TABLE `‚s‚U`; +DROP TABLE `‚s‚V`; +DROP TABLE `‚s‚W`; +DROP TABLE `‚s‚X`; +DROP TABLE `‚s‚P‚O`; +DROP TABLE `‚s‚P‚P`; +DROP TABLE `‚s‚P‚Q`; diff --git a/mysql-test/suite/jp/r/jp_rpad_ucs2.result b/mysql-test/suite/jp/r/jp_rpad_ucs2.result new file mode 100755 index 00000000000..b9df4cf6783 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_rpad_ucs2.result @@ -0,0 +1,147 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; +CREATE TABLE `£Ô£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'Ž¡') FROM `£Ô£±`; +£Ã£± RPAD(`£Ã£±`,5,'Ž¡') + ޡޡޡޡޡ +ޱ ޱޡޡޡޡ +ޱ޲ ޱ޲ޡޡޡ +ޱ޲޳ ޱ޲޳ޡޡ +ޱ޲޳޴ ޱ޲޳޴ޡ +ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'£Ø') FROM `£Ô£²`; +£Ã£± RPAD(`£Ã£±`,5,'£Ø') + £Ø£Ø£Ø£Ø£Ø +¤¢ ¤¢£Ø£Ø£Ø£Ø +¤¢¤¤ ¤¢¤¤£Ø£Ø£Ø +¤¢¤¤¤¦ ¤¢¤¤¤¦£Ø£Ø +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨£Ø +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'°¢') FROM `£Ô£³`; +£Ã£± RPAD(`£Ã£±`,5,'°¢') + °¢°¢°¢°¢°¢ +íÜ íܰ¢°¢°¢°¢ +íÜíÝ íÜíݰ¢°¢°¢ +íÜíÝíÞ íÜíÝíÞ°¢°¢ +íÜíÝíÞíß íÜíÝíÞíß°¢ +íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'Ž¡') FROM `£Ô£´`; +£Ã£± RPAD(`£Ã£±`,5,'Ž¡') + ޡޡޡޡޡ +ޱ ޱޡޡޡޡ +ޱ޲ ޱ޲ޡޡޡ +ޱ޲޳ ޱ޲޳ޡޡ +ޱ޲޳޴ ޱ޲޳޴ޡ +ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'£Ø') FROM `£Ô£µ`; +£Ã£± RPAD(`£Ã£±`,5,'£Ø') + £Ø£Ø£Ø£Ø£Ø +¤¢ ¤¢£Ø£Ø£Ø£Ø +¤¢¤¤ ¤¢¤¤£Ø£Ø£Ø +¤¢¤¤¤¦ ¤¢¤¤¤¦£Ø£Ø +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨£Ø +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'°¢' ) FROM `£Ô£¶`; +£Ã£± RPAD(`£Ã£±`,5,'°¢' ) + °¢°¢°¢°¢°¢ +íÜ íܰ¢°¢°¢°¢ +íÜíÝ íÜíݰ¢°¢°¢ +íÜíÝíÞ íÜíÝíÞ°¢°¢ +íÜíÝíÞíß íÜíÝíÞíß°¢ +íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'Ž¡') FROM `£Ô£·`; +£Ã£± RPAD(`£Ã£±`,5,'Ž¡') +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴ ޱ޲޳޴ޡ +ޱ޲޳ ޱ޲޳ޡޡ +ޱ޲ ޱ޲ޡޡޡ +ޱ ޱޡޡޡޡ + ޡޡޡޡޡ +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'£Ø') FROM `£Ô£¸`; +£Ã£± RPAD(`£Ã£±`,5,'£Ø') +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨£Ø +¤¢¤¤¤¦ ¤¢¤¤¤¦£Ø£Ø +¤¢¤¤ ¤¢¤¤£Ø£Ø£Ø +¤¢ ¤¢£Ø£Ø£Ø£Ø + £Ø£Ø£Ø£Ø£Ø +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'°¢' ) FROM `£Ô£¹`; +£Ã£± RPAD(`£Ã£±`,5,'°¢' ) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíß íÜíÝíÞíß°¢ +íÜíÝíÞ íÜíÝíÞ°¢°¢ +íÜíÝ íÜíݰ¢°¢°¢ +íÜ íܰ¢°¢°¢°¢ + °¢°¢°¢°¢°¢ +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'Ž¡') FROM `£Ô£±£°`; +£Ã£± RPAD(`£Ã£±`,5,'Ž¡') +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴ ޱ޲޳޴ޡ +ޱ޲޳ ޱ޲޳ޡޡ +ޱ޲ ޱ޲ޡޡޡ +ޱ ޱޡޡޡޡ + ޡޡޡޡޡ +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'£Ø') FROM `£Ô£±£±`; +£Ã£± RPAD(`£Ã£±`,5,'£Ø') +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨£Ø +¤¢¤¤¤¦ ¤¢¤¤¤¦£Ø£Ø +¤¢¤¤ ¤¢¤¤£Ø£Ø£Ø +¤¢ ¤¢£Ø£Ø£Ø£Ø + £Ø£Ø£Ø£Ø£Ø +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'°¢' ) FROM `£Ô£±£²`; +£Ã£± RPAD(`£Ã£±`,5,'°¢' ) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíß íÜíÝíÞíß°¢ +íÜíÝíÞ íÜíÝíÞ°¢°¢ +íÜíÝ íÜíݰ¢°¢°¢ +íÜ íܰ¢°¢°¢°¢ + °¢°¢°¢°¢°¢ +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/r/jp_rpad_ujis.result b/mysql-test/suite/jp/r/jp_rpad_ujis.result new file mode 100755 index 00000000000..3183b4f5fcd --- /dev/null +++ b/mysql-test/suite/jp/r/jp_rpad_ujis.result @@ -0,0 +1,146 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +SET NAMES ujis; +SET character_set_database = ujis; +CREATE TABLE `£Ô£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'Ž¡') FROM `£Ô£±`; +£Ã£± RPAD(`£Ã£±`,5,'Ž¡') + ޡޡޡޡޡ +ޱ ޱޡޡޡޡ +ޱ޲ ޱ޲ޡޡޡ +ޱ޲޳ ޱ޲޳ޡޡ +ޱ޲޳޴ ޱ޲޳޴ޡ +ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'£Ø') FROM `£Ô£²`; +£Ã£± RPAD(`£Ã£±`,5,'£Ø') + £Ø£Ø£Ø£Ø£Ø +¤¢ ¤¢£Ø£Ø£Ø£Ø +¤¢¤¤ ¤¢¤¤£Ø£Ø£Ø +¤¢¤¤¤¦ ¤¢¤¤¤¦£Ø£Ø +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨£Ø +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'°¢') FROM `£Ô£³`; +£Ã£± RPAD(`£Ã£±`,5,'°¢') + °¢°¢°¢°¢°¢ +íÜ íܰ¢°¢°¢°¢ +íÜíÝ íÜíݰ¢°¢°¢ +íÜíÝíÞ íÜíÝíÞ°¢°¢ +íÜíÝíÞíß íÜíÝíÞíß°¢ +íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'Ž¡') FROM `£Ô£´`; +£Ã£± RPAD(`£Ã£±`,5,'Ž¡') + ޡޡޡޡޡ +ޱ ޱޡޡޡޡ +ޱ޲ ޱ޲ޡޡޡ +ޱ޲޳ ޱ޲޳ޡޡ +ޱ޲޳޴ ޱ޲޳޴ޡ +ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'£Ø') FROM `£Ô£µ`; +£Ã£± RPAD(`£Ã£±`,5,'£Ø') + £Ø£Ø£Ø£Ø£Ø +¤¢ ¤¢£Ø£Ø£Ø£Ø +¤¢¤¤ ¤¢¤¤£Ø£Ø£Ø +¤¢¤¤¤¦ ¤¢¤¤¤¦£Ø£Ø +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨£Ø +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'°¢' ) FROM `£Ô£¶`; +£Ã£± RPAD(`£Ã£±`,5,'°¢' ) + °¢°¢°¢°¢°¢ +íÜ íܰ¢°¢°¢°¢ +íÜíÝ íÜíݰ¢°¢°¢ +íÜíÝíÞ íÜíÝíÞ°¢°¢ +íÜíÝíÞíß íÜíÝíÞíß°¢ +íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'Ž¡') FROM `£Ô£·`; +£Ã£± RPAD(`£Ã£±`,5,'Ž¡') +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴ ޱ޲޳޴ޡ +ޱ޲޳ ޱ޲޳ޡޡ +ޱ޲ ޱ޲ޡޡޡ +ޱ ޱޡޡޡޡ + ޡޡޡޡޡ +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'£Ø') FROM `£Ô£¸`; +£Ã£± RPAD(`£Ã£±`,5,'£Ø') +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨£Ø +¤¢¤¤¤¦ ¤¢¤¤¤¦£Ø£Ø +¤¢¤¤ ¤¢¤¤£Ø£Ø£Ø +¤¢ ¤¢£Ø£Ø£Ø£Ø + £Ø£Ø£Ø£Ø£Ø +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'°¢' ) FROM `£Ô£¹`; +£Ã£± RPAD(`£Ã£±`,5,'°¢' ) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíß íÜíÝíÞíß°¢ +íÜíÝíÞ íÜíÝíÞ°¢°¢ +íÜíÝ íÜíݰ¢°¢°¢ +íÜ íܰ¢°¢°¢°¢ + °¢°¢°¢°¢°¢ +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'Ž¡') FROM `£Ô£±£°`; +£Ã£± RPAD(`£Ã£±`,5,'Ž¡') +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴ ޱ޲޳޴ޡ +ޱ޲޳ ޱ޲޳ޡޡ +ޱ޲ ޱ޲ޡޡޡ +ޱ ޱޡޡޡޡ + ޡޡޡޡޡ +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'£Ø') FROM `£Ô£±£±`; +£Ã£± RPAD(`£Ã£±`,5,'£Ø') +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨£Ø +¤¢¤¤¤¦ ¤¢¤¤¤¦£Ø£Ø +¤¢¤¤ ¤¢¤¤£Ø£Ø£Ø +¤¢ ¤¢£Ø£Ø£Ø£Ø + £Ø£Ø£Ø£Ø£Ø +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'°¢' ) FROM `£Ô£±£²`; +£Ã£± RPAD(`£Ã£±`,5,'°¢' ) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíß íÜíÝíÞíß°¢ +íÜíÝíÞ íÜíÝíÞ°¢°¢ +íÜíÝ íÜíݰ¢°¢°¢ +íÜ íܰ¢°¢°¢°¢ + °¢°¢°¢°¢°¢ +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/r/jp_rpad_utf8.result b/mysql-test/suite/jp/r/jp_rpad_utf8.result new file mode 100755 index 00000000000..c482a058bd8 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_rpad_utf8.result @@ -0,0 +1,146 @@ +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +drop table if exists `T11`; +drop table if exists `T12`; +SET NAMES utf8; +SET character_set_database = utf8; +CREATE TABLE `T1` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T11` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T12` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +INSERT INTO `T1` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `T3` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +INSERT INTO `T1ï¼` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `T12` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +SELECT `C1`, RPAD(`C1`,5,'。') FROM `T1`; +C1 RPAD(`C1`,5,'。') + 。。。。。 +ï½± ア。。。。 +アイ アイ。。。 +アイウ アイウ。。 +アイウエ アイウエ。 +アイウエオ アイウエオ +SELECT `C1`, RPAD(`C1`,5,'X') FROM `ï¼´ï¼’`; +C1 RPAD(`C1`,5,'X') + XXXXX +ã‚ ã‚XXXX +ã‚ã„ ã‚ã„XXX +ã‚ã„ㆠã‚ã„ã†ï¼¸ï¼¸ +ã‚ã„ã†ãˆ ã‚ã„ã†ãˆï¼¸ +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +SELECT `C1`, RPAD(`C1`,5,'丄') FROM `T3`; +C1 RPAD(`C1`,5,'丄') + 丄丄丄丄丄 +é¾” 龔丄丄丄丄 +龔龖 龔龖丄丄丄 +龔龖龗 龔龖龗丄丄 +龔龖龗龞 龔龖龗龞丄 +龔龖龗龞龡 龔龖龗龞龡 +SELECT `C1`, RPAD(`C1`,5,'。') FROM `ï¼´ï¼”`; +C1 RPAD(`C1`,5,'。') + 。。。。。 +ï½± ア。。。。 +アイ アイ。。。 +アイウ アイウ。。 +アイウエ アイウエ。 +アイウエオ アイウエオ +SELECT `C1`, RPAD(`C1`,5,'X') FROM `T5`; +C1 RPAD(`C1`,5,'X') + XXXXX +ã‚ ã‚XXXX +ã‚ã„ ã‚ã„XXX +ã‚ã„ㆠã‚ã„ã†ï¼¸ï¼¸ +ã‚ã„ã†ãˆ ã‚ã„ã†ãˆï¼¸ +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +SELECT `C1`, RPAD(`C1`,5,'丄' ) FROM `ï¼´ï¼–`; +C1 RPAD(`C1`,5,'丄' ) + 丄丄丄丄丄 +é¾” 龔丄丄丄丄 +龔龖 龔龖丄丄丄 +龔龖龗 龔龖龗丄丄 +龔龖龗龞 龔龖龗龞丄 +龔龖龗龞龡 龔龖龗龞龡 +SELECT `C1`, RPAD(`C1`,5,'。') FROM `ï¼´ï¼—`; +C1 RPAD(`C1`,5,'。') +アイウエオ アイウエオ +アイウエ アイウエ。 +アイウ アイウ。。 +アイ アイ。。。 +ï½± ア。。。。 + 。。。。。 +SELECT `C1`, RPAD(`C1`,5,'X') FROM `T8`; +C1 RPAD(`C1`,5,'X') +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆ ã‚ã„ã†ãˆï¼¸ +ã‚ã„ㆠã‚ã„ã†ï¼¸ï¼¸ +ã‚ã„ ã‚ã„XXX +ã‚ ã‚XXXX + XXXXX +SELECT `C1`, RPAD(`C1`,5,'丄' ) FROM `ï¼´ï¼™`; +C1 RPAD(`C1`,5,'丄' ) +龔龖龗龞龡 龔龖龗龞龡 +龔龖龗龞 龔龖龗龞丄 +龔龖龗 龔龖龗丄丄 +龔龖 龔龖丄丄丄 +é¾” 龔丄丄丄丄 + 丄丄丄丄丄 +SELECT `C1`, RPAD(`C1`,5,'。') FROM `T1ï¼`; +C1 RPAD(`C1`,5,'。') +アイウエオ アイウエオ +アイウエ アイウエ。 +アイウ アイウ。。 +アイ アイ。。。 +ï½± ア。。。。 + 。。。。。 +SELECT `C1`, RPAD(`C1`,5,'X') FROM `T11`; +C1 RPAD(`C1`,5,'X') +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆ ã‚ã„ã†ãˆï¼¸ +ã‚ã„ㆠã‚ã„ã†ï¼¸ï¼¸ +ã‚ã„ ã‚ã„XXX +ã‚ ã‚XXXX + XXXXX +SELECT `C1`, RPAD(`C1`,5,'丄' ) FROM `T12`; +C1 RPAD(`C1`,5,'丄' ) +龔龖龗龞龡 龔龖龗龞龡 +龔龖龗龞 龔龖龗龞丄 +龔龖龗 龔龖龗丄丄 +龔龖 龔龖丄丄丄 +é¾” 龔丄丄丄丄 + 丄丄丄丄丄 +DROP TABLE `T1`; +DROP TABLE `ï¼´ï¼’`; +DROP TABLE `T3`; +DROP TABLE `ï¼´ï¼”`; +DROP TABLE `T5`; +DROP TABLE `ï¼´ï¼–`; +DROP TABLE `ï¼´ï¼—`; +DROP TABLE `T8`; +DROP TABLE `ï¼´ï¼™`; +DROP TABLE `T1ï¼`; +DROP TABLE `T11`; +DROP TABLE `T12`; diff --git a/mysql-test/suite/jp/r/jp_rtrim_sjis.result b/mysql-test/suite/jp/r/jp_rtrim_sjis.result new file mode 100755 index 00000000000..01ab173c982 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_rtrim_sjis.result @@ -0,0 +1,228 @@ +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +SET NAMES sjis; +SET character_set_database = sjis; +CREATE TABLE `‚s‚P` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Q` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚R` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚S` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚T` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚U` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚V` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚W` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚X` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚O` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚P` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚Q` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +INSERT INTO `‚s‚P` VALUES ('±²³´µ'); +INSERT INTO `‚s‚P` VALUES ('±²³´µ '); +INSERT INTO `‚s‚P` VALUES ('±²³´µ '); +INSERT INTO `‚s‚P` VALUES ('±²³´µ '); +INSERT INTO `‚s‚P` VALUES ('±²³´µ@'); +INSERT INTO `‚s‚P` VALUES ('±²³´µ@@'); +INSERT INTO `‚s‚P` VALUES ('±²³´µ@@@'); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨ '); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨ '); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨ '); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨@'); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨@@'); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨@@@'); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\ '); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\ '); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\ '); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\@'); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\@@'); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\@@@'); +INSERT INTO `‚s‚S` VALUES ('±²³´µ'); +INSERT INTO `‚s‚S` VALUES ('±²³´µ '); +INSERT INTO `‚s‚S` VALUES ('±²³´µ '); +INSERT INTO `‚s‚S` VALUES ('±²³´µ '); +INSERT INTO `‚s‚S` VALUES ('±²³´µ@'); +INSERT INTO `‚s‚S` VALUES ('±²³´µ@@'); +INSERT INTO `‚s‚S` VALUES ('±²³´µ@@@'); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨ '); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨ '); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨ '); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨@'); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨@@'); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨@@@'); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\ '); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\ '); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\ '); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\@'); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\@@'); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\@@@'); +INSERT INTO `‚s‚V` VALUES ('±²³´µ'); +INSERT INTO `‚s‚V` VALUES ('±²³´µ '); +INSERT INTO `‚s‚V` VALUES ('±²³´µ '); +INSERT INTO `‚s‚V` VALUES ('±²³´µ '); +INSERT INTO `‚s‚V` VALUES ('±²³´µ@'); +INSERT INTO `‚s‚V` VALUES ('±²³´µ@@'); +INSERT INTO `‚s‚V` VALUES ('±²³´µ@@@'); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨ '); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨ '); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨ '); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨@'); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨@@'); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨@@@'); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\ '); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\ '); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\ '); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\@'); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\@@'); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\@@@'); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ'); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ '); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ '); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ '); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ@'); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ@@'); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ@@@'); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨ '); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨ '); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨ '); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨@'); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨@@'); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨@@@'); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\ '); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\ '); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\ '); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\@'); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\@@'); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\@@@'); +SELECT RTRIM(`‚b‚P`) from `‚s‚P`; +RTRIM(`‚b‚P`) +±²³´µ +±²³´µ +±²³´µ +±²³´µ +±²³´µ@ +±²³´µ@@ +±²³´µ@@@ +SELECT RTRIM(`‚b‚P`) from `‚s‚Q`; +RTRIM(`‚b‚P`) +‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨@ +‚ ‚¢‚¤‚¦‚¨@@ +‚ ‚¢‚¤‚¦‚¨@@@ +SELECT RTRIM(`‚b‚P`) from `‚s‚R`; +RTRIM(`‚b‚P`) +ƒ\\•\—\\ +ƒ\\•\—\\ +ƒ\\•\—\\ +ƒ\\•\—\\ +ƒ\\•\—\\@ +ƒ\\•\—\\@@ +ƒ\\•\—\\@@@ +SELECT RTRIM(`‚b‚P`) from `‚s‚S`; +RTRIM(`‚b‚P`) +±²³´µ +±²³´µ +±²³´µ +±²³´µ +±²³´µ@ +±²³´µ@@ +±²³´µ@@@ +SELECT RTRIM(`‚b‚P`) from `‚s‚T`; +RTRIM(`‚b‚P`) +‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨@ +‚ ‚¢‚¤‚¦‚¨@@ +‚ ‚¢‚¤‚¦‚¨@@@ +SELECT RTRIM(`‚b‚P`) from `‚s‚U`; +RTRIM(`‚b‚P`) +ƒ\\•\—\\ +ƒ\\•\—\\ +ƒ\\•\—\\ +ƒ\\•\—\\ +ƒ\\•\—\\@ +ƒ\\•\—\\@@ +ƒ\\•\—\\@@@ +SELECT RTRIM(`‚b‚P`) from `‚s‚V`; +RTRIM(`‚b‚P`) +±²³´µ +±²³´µ +±²³´µ +±²³´µ +±²³´µ@ +±²³´µ@@ +±²³´µ@@@ +SELECT RTRIM(`‚b‚P`) from `‚s‚W`; +RTRIM(`‚b‚P`) +‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨@ +‚ ‚¢‚¤‚¦‚¨@@ +‚ ‚¢‚¤‚¦‚¨@@@ +SELECT RTRIM(`‚b‚P`) from `‚s‚X`; +RTRIM(`‚b‚P`) +ƒ\\•\—\\ +ƒ\\•\—\\ +ƒ\\•\—\\ +ƒ\\•\—\\ +ƒ\\•\—\\@ +ƒ\\•\—\\@@ +ƒ\\•\—\\@@@ +SELECT RTRIM(`‚b‚P`) from `‚s‚P‚O`; +RTRIM(`‚b‚P`) +±²³´µ +±²³´µ +±²³´µ +±²³´µ +±²³´µ@ +±²³´µ@@ +±²³´µ@@@ +SELECT RTRIM(`‚b‚P`) from `‚s‚P‚P`; +RTRIM(`‚b‚P`) +‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨@ +‚ ‚¢‚¤‚¦‚¨@@ +‚ ‚¢‚¤‚¦‚¨@@@ +SELECT RTRIM(`‚b‚P`) from `‚s‚P‚Q`; +RTRIM(`‚b‚P`) +ƒ\\•\—\\ +ƒ\\•\—\\ +ƒ\\•\—\\ +ƒ\\•\—\\ +ƒ\\•\—\\@ +ƒ\\•\—\\@@ +ƒ\\•\—\\@@@ +DROP TABLE `‚s‚P`; +DROP TABLE `‚s‚Q`; +DROP TABLE `‚s‚R`; +DROP TABLE `‚s‚S`; +DROP TABLE `‚s‚T`; +DROP TABLE `‚s‚U`; +DROP TABLE `‚s‚V`; +DROP TABLE `‚s‚W`; +DROP TABLE `‚s‚X`; +DROP TABLE `‚s‚P‚O`; +DROP TABLE `‚s‚P‚P`; +DROP TABLE `‚s‚P‚Q`; diff --git a/mysql-test/suite/jp/r/jp_rtrim_ucs2.result b/mysql-test/suite/jp/r/jp_rtrim_ucs2.result new file mode 100755 index 00000000000..905f5bef08f --- /dev/null +++ b/mysql-test/suite/jp/r/jp_rtrim_ucs2.result @@ -0,0 +1,229 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; +CREATE TABLE `£Ô£±` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵ '); +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵ '); +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵ '); +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵¡¡'); +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵¡¡¡¡'); +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵¡¡¡¡¡¡'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡¡¡'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡¡¡¡¡'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà '); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà '); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà '); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà¡¡'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà¡¡¡¡'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà¡¡¡¡¡¡'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵ '); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵ '); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵ '); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵¡¡'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵¡¡¡¡'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵¡¡¡¡¡¡'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡¡¡'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡¡¡¡¡'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà '); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà '); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà '); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà¡¡'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà¡¡¡¡'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà¡¡¡¡¡¡'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵ '); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵ '); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵ '); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵¡¡'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵¡¡¡¡'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵¡¡¡¡¡¡'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡¡¡'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡¡¡¡¡'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà '); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà '); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà '); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà¡¡'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà¡¡¡¡'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà¡¡¡¡¡¡'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵ '); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵ '); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵ '); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵¡¡'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵¡¡¡¡'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵¡¡¡¡¡¡'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡¡¡'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡¡¡¡¡'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà '); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà '); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà '); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà¡¡'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà¡¡¡¡'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà¡¡¡¡¡¡'); +SELECT RTRIM(`£Ã£±`) from `£Ô£±`; +RTRIM(`£Ã£±`) +ޱ޲޳޴޵ +ޱ޲޳޴޵ +ޱ޲޳޴޵ +ޱ޲޳޴޵ +ޱ޲޳޴޵¡¡ +ޱ޲޳޴޵¡¡¡¡ +ޱ޲޳޴޵¡¡¡¡¡¡ +SELECT RTRIM(`£Ã£±`) from `£Ô£²`; +RTRIM(`£Ã£±`) +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¡¡ +¤¢¤¤¤¦¤¨¤ª¡¡¡¡ +¤¢¤¤¤¦¤¨¤ª¡¡¡¡¡¡ +SELECT RTRIM(`£Ã£±`) from `£Ô£³`; +RTRIM(`£Ã£±`) +íÜíÝíÞíßíà +íÜíÝíÞíßíà +íÜíÝíÞíßíà +íÜíÝíÞíßíà +íÜíÝíÞíßíà¡¡ +íÜíÝíÞíßíà¡¡¡¡ +íÜíÝíÞíßíà¡¡¡¡¡¡ +SELECT RTRIM(`£Ã£±`) from `£Ô£´`; +RTRIM(`£Ã£±`) +ޱ޲޳޴޵ +ޱ޲޳޴޵ +ޱ޲޳޴޵ +ޱ޲޳޴޵ +ޱ޲޳޴޵¡¡ +ޱ޲޳޴޵¡¡¡¡ +ޱ޲޳޴޵¡¡¡¡¡¡ +SELECT RTRIM(`£Ã£±`) from `£Ô£µ`; +RTRIM(`£Ã£±`) +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¡¡ +¤¢¤¤¤¦¤¨¤ª¡¡¡¡ +¤¢¤¤¤¦¤¨¤ª¡¡¡¡¡¡ +SELECT RTRIM(`£Ã£±`) from `£Ô£¶`; +RTRIM(`£Ã£±`) +íÜíÝíÞíßíà +íÜíÝíÞíßíà +íÜíÝíÞíßíà +íÜíÝíÞíßíà +íÜíÝíÞíßíà¡¡ +íÜíÝíÞíßíà¡¡¡¡ +íÜíÝíÞíßíà¡¡¡¡¡¡ +SELECT RTRIM(`£Ã£±`) from `£Ô£·`; +RTRIM(`£Ã£±`) +ޱ޲޳޴޵ +ޱ޲޳޴޵ +ޱ޲޳޴޵ +ޱ޲޳޴޵ +ޱ޲޳޴޵¡¡ +ޱ޲޳޴޵¡¡¡¡ +ޱ޲޳޴޵¡¡¡¡¡¡ +SELECT RTRIM(`£Ã£±`) from `£Ô£¸`; +RTRIM(`£Ã£±`) +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¡¡ +¤¢¤¤¤¦¤¨¤ª¡¡¡¡ +¤¢¤¤¤¦¤¨¤ª¡¡¡¡¡¡ +SELECT RTRIM(`£Ã£±`) from `£Ô£¹`; +RTRIM(`£Ã£±`) +íÜíÝíÞíßíà +íÜíÝíÞíßíà +íÜíÝíÞíßíà +íÜíÝíÞíßíà +íÜíÝíÞíßíà¡¡ +íÜíÝíÞíßíà¡¡¡¡ +íÜíÝíÞíßíà¡¡¡¡¡¡ +SELECT RTRIM(`£Ã£±`) from `£Ô£±£°`; +RTRIM(`£Ã£±`) +ޱ޲޳޴޵ +ޱ޲޳޴޵ +ޱ޲޳޴޵ +ޱ޲޳޴޵ +ޱ޲޳޴޵¡¡ +ޱ޲޳޴޵¡¡¡¡ +ޱ޲޳޴޵¡¡¡¡¡¡ +SELECT RTRIM(`£Ã£±`) from `£Ô£±£±`; +RTRIM(`£Ã£±`) +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¡¡ +¤¢¤¤¤¦¤¨¤ª¡¡¡¡ +¤¢¤¤¤¦¤¨¤ª¡¡¡¡¡¡ +SELECT RTRIM(`£Ã£±`) from `£Ô£±£²`; +RTRIM(`£Ã£±`) +íÜíÝíÞíßíà +íÜíÝíÞíßíà +íÜíÝíÞíßíà +íÜíÝíÞíßíà +íÜíÝíÞíßíà¡¡ +íÜíÝíÞíßíà¡¡¡¡ +íÜíÝíÞíßíà¡¡¡¡¡¡ +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/r/jp_rtrim_ujis.result b/mysql-test/suite/jp/r/jp_rtrim_ujis.result new file mode 100755 index 00000000000..84b141c16dc --- /dev/null +++ b/mysql-test/suite/jp/r/jp_rtrim_ujis.result @@ -0,0 +1,228 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +SET NAMES ujis; +SET character_set_database = ujis; +CREATE TABLE `£Ô£±` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵ '); +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵ '); +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵ '); +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵¡¡'); +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵¡¡¡¡'); +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵¡¡¡¡¡¡'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡¡¡'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡¡¡¡¡'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà '); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà '); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà '); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà¡¡'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà¡¡¡¡'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà¡¡¡¡¡¡'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵ '); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵ '); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵ '); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵¡¡'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵¡¡¡¡'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵¡¡¡¡¡¡'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡¡¡'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡¡¡¡¡'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà '); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà '); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà '); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà¡¡'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà¡¡¡¡'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà¡¡¡¡¡¡'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵ '); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵ '); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵ '); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵¡¡'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵¡¡¡¡'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵¡¡¡¡¡¡'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡¡¡'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡¡¡¡¡'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà '); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà '); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà '); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà¡¡'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà¡¡¡¡'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà¡¡¡¡¡¡'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵ '); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵ '); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵ '); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵¡¡'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵¡¡¡¡'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵¡¡¡¡¡¡'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡¡¡'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡¡¡¡¡'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà '); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà '); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà '); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà¡¡'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà¡¡¡¡'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà¡¡¡¡¡¡'); +SELECT RTRIM(`£Ã£±`) from `£Ô£±`; +RTRIM(`£Ã£±`) +ޱ޲޳޴޵ +ޱ޲޳޴޵ +ޱ޲޳޴޵ +ޱ޲޳޴޵ +ޱ޲޳޴޵¡¡ +ޱ޲޳޴޵¡¡¡¡ +ޱ޲޳޴޵¡¡¡¡¡¡ +SELECT RTRIM(`£Ã£±`) from `£Ô£²`; +RTRIM(`£Ã£±`) +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¡¡ +¤¢¤¤¤¦¤¨¤ª¡¡¡¡ +¤¢¤¤¤¦¤¨¤ª¡¡¡¡¡¡ +SELECT RTRIM(`£Ã£±`) from `£Ô£³`; +RTRIM(`£Ã£±`) +íÜíÝíÞíßíà +íÜíÝíÞíßíà +íÜíÝíÞíßíà +íÜíÝíÞíßíà +íÜíÝíÞíßíà¡¡ +íÜíÝíÞíßíà¡¡¡¡ +íÜíÝíÞíßíà¡¡¡¡¡¡ +SELECT RTRIM(`£Ã£±`) from `£Ô£´`; +RTRIM(`£Ã£±`) +ޱ޲޳޴޵ +ޱ޲޳޴޵ +ޱ޲޳޴޵ +ޱ޲޳޴޵ +ޱ޲޳޴޵¡¡ +ޱ޲޳޴޵¡¡¡¡ +ޱ޲޳޴޵¡¡¡¡¡¡ +SELECT RTRIM(`£Ã£±`) from `£Ô£µ`; +RTRIM(`£Ã£±`) +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¡¡ +¤¢¤¤¤¦¤¨¤ª¡¡¡¡ +¤¢¤¤¤¦¤¨¤ª¡¡¡¡¡¡ +SELECT RTRIM(`£Ã£±`) from `£Ô£¶`; +RTRIM(`£Ã£±`) +íÜíÝíÞíßíà +íÜíÝíÞíßíà +íÜíÝíÞíßíà +íÜíÝíÞíßíà +íÜíÝíÞíßíà¡¡ +íÜíÝíÞíßíà¡¡¡¡ +íÜíÝíÞíßíà¡¡¡¡¡¡ +SELECT RTRIM(`£Ã£±`) from `£Ô£·`; +RTRIM(`£Ã£±`) +ޱ޲޳޴޵ +ޱ޲޳޴޵ +ޱ޲޳޴޵ +ޱ޲޳޴޵ +ޱ޲޳޴޵¡¡ +ޱ޲޳޴޵¡¡¡¡ +ޱ޲޳޴޵¡¡¡¡¡¡ +SELECT RTRIM(`£Ã£±`) from `£Ô£¸`; +RTRIM(`£Ã£±`) +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¡¡ +¤¢¤¤¤¦¤¨¤ª¡¡¡¡ +¤¢¤¤¤¦¤¨¤ª¡¡¡¡¡¡ +SELECT RTRIM(`£Ã£±`) from `£Ô£¹`; +RTRIM(`£Ã£±`) +íÜíÝíÞíßíà +íÜíÝíÞíßíà +íÜíÝíÞíßíà +íÜíÝíÞíßíà +íÜíÝíÞíßíà¡¡ +íÜíÝíÞíßíà¡¡¡¡ +íÜíÝíÞíßíà¡¡¡¡¡¡ +SELECT RTRIM(`£Ã£±`) from `£Ô£±£°`; +RTRIM(`£Ã£±`) +ޱ޲޳޴޵ +ޱ޲޳޴޵ +ޱ޲޳޴޵ +ޱ޲޳޴޵ +ޱ޲޳޴޵¡¡ +ޱ޲޳޴޵¡¡¡¡ +ޱ޲޳޴޵¡¡¡¡¡¡ +SELECT RTRIM(`£Ã£±`) from `£Ô£±£±`; +RTRIM(`£Ã£±`) +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¡¡ +¤¢¤¤¤¦¤¨¤ª¡¡¡¡ +¤¢¤¤¤¦¤¨¤ª¡¡¡¡¡¡ +SELECT RTRIM(`£Ã£±`) from `£Ô£±£²`; +RTRIM(`£Ã£±`) +íÜíÝíÞíßíà +íÜíÝíÞíßíà +íÜíÝíÞíßíà +íÜíÝíÞíßíà +íÜíÝíÞíßíà¡¡ +íÜíÝíÞíßíà¡¡¡¡ +íÜíÝíÞíßíà¡¡¡¡¡¡ +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/r/jp_rtrim_utf8.result b/mysql-test/suite/jp/r/jp_rtrim_utf8.result new file mode 100755 index 00000000000..09d719f3386 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_rtrim_utf8.result @@ -0,0 +1,228 @@ +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +SET NAMES utf8; +SET character_set_database = utf8; +CREATE TABLE `T1` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T11` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T12` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +INSERT INTO `T1` VALUES ('アイウエオ'); +INSERT INTO `T1` VALUES ('アイウエオ '); +INSERT INTO `T1` VALUES ('アイウエオ '); +INSERT INTO `T1` VALUES ('アイウエオ '); +INSERT INTO `T1` VALUES ('アイウエオ '); +INSERT INTO `T1` VALUES ('アイウエオ  '); +INSERT INTO `T1` VALUES ('アイウエオ   '); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠ '); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠ '); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠ '); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠã€€'); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠã€€ã€€'); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠã€€ã€€ã€€'); +INSERT INTO `T3` VALUES ('龔龖龗龞龡'); +INSERT INTO `T3` VALUES ('龔龖龗龞龡 '); +INSERT INTO `T3` VALUES ('龔龖龗龞龡 '); +INSERT INTO `T3` VALUES ('龔龖龗龞龡 '); +INSERT INTO `T3` VALUES ('龔龖龗龞龡 '); +INSERT INTO `T3` VALUES ('龔龖龗龞龡  '); +INSERT INTO `T3` VALUES ('龔龖龗龞龡   '); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオ'); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオ '); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオ '); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオ '); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオ '); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオ  '); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオ   '); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠ '); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠ '); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠ '); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠã€€'); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠã€€ã€€'); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠã€€ã€€ã€€'); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡 '); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡 '); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡 '); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡 '); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡  '); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡   '); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオ'); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオ '); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオ '); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオ '); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオ '); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオ  '); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオ   '); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠ '); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠ '); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠ '); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠã€€'); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠã€€ã€€'); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠã€€ã€€ã€€'); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡 '); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡 '); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡 '); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡 '); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡  '); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡   '); +INSERT INTO `T1ï¼` VALUES ('アイウエオ'); +INSERT INTO `T1ï¼` VALUES ('アイウエオ '); +INSERT INTO `T1ï¼` VALUES ('アイウエオ '); +INSERT INTO `T1ï¼` VALUES ('アイウエオ '); +INSERT INTO `T1ï¼` VALUES ('アイウエオ '); +INSERT INTO `T1ï¼` VALUES ('アイウエオ  '); +INSERT INTO `T1ï¼` VALUES ('アイウエオ   '); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠ '); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠ '); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠ '); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠã€€'); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠã€€ã€€'); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠã€€ã€€ã€€'); +INSERT INTO `T12` VALUES ('龔龖龗龞龡'); +INSERT INTO `T12` VALUES ('龔龖龗龞龡 '); +INSERT INTO `T12` VALUES ('龔龖龗龞龡 '); +INSERT INTO `T12` VALUES ('龔龖龗龞龡 '); +INSERT INTO `T12` VALUES ('龔龖龗龞龡 '); +INSERT INTO `T12` VALUES ('龔龖龗龞龡  '); +INSERT INTO `T12` VALUES ('龔龖龗龞龡   '); +SELECT RTRIM(`C1`) from `T1`; +RTRIM(`C1`) +アイウエオ +アイウエオ +アイウエオ +アイウエオ +アイウエオ  +アイウエオ   +アイウエオ    +SELECT RTRIM(`C1`) from `ï¼´ï¼’`; +RTRIM(`C1`) +ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠã€€ +ã‚ã„ã†ãˆãŠã€€ã€€ +ã‚ã„ã†ãˆãŠã€€ã€€ã€€ +SELECT RTRIM(`C1`) from `T3`; +RTRIM(`C1`) +龔龖龗龞龡 +龔龖龗龞龡 +龔龖龗龞龡 +龔龖龗龞龡 +龔龖龗龞龡  +龔龖龗龞龡   +龔龖龗龞龡    +SELECT RTRIM(`C1`) from `ï¼´ï¼”`; +RTRIM(`C1`) +アイウエオ +アイウエオ +アイウエオ +アイウエオ +アイウエオ  +アイウエオ   +アイウエオ    +SELECT RTRIM(`C1`) from `T5`; +RTRIM(`C1`) +ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠã€€ +ã‚ã„ã†ãˆãŠã€€ã€€ +ã‚ã„ã†ãˆãŠã€€ã€€ã€€ +SELECT RTRIM(`C1`) from `ï¼´ï¼–`; +RTRIM(`C1`) +龔龖龗龞龡 +龔龖龗龞龡 +龔龖龗龞龡 +龔龖龗龞龡 +龔龖龗龞龡  +龔龖龗龞龡   +龔龖龗龞龡    +SELECT RTRIM(`C1`) from `ï¼´ï¼—`; +RTRIM(`C1`) +アイウエオ +アイウエオ +アイウエオ +アイウエオ +アイウエオ  +アイウエオ   +アイウエオ    +SELECT RTRIM(`C1`) from `T8`; +RTRIM(`C1`) +ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠã€€ +ã‚ã„ã†ãˆãŠã€€ã€€ +ã‚ã„ã†ãˆãŠã€€ã€€ã€€ +SELECT RTRIM(`C1`) from `ï¼´ï¼™`; +RTRIM(`C1`) +龔龖龗龞龡 +龔龖龗龞龡 +龔龖龗龞龡 +龔龖龗龞龡 +龔龖龗龞龡  +龔龖龗龞龡   +龔龖龗龞龡    +SELECT RTRIM(`C1`) from `T1ï¼`; +RTRIM(`C1`) +アイウエオ +アイウエオ +アイウエオ +アイウエオ +アイウエオ  +アイウエオ   +アイウエオ    +SELECT RTRIM(`C1`) from `T11`; +RTRIM(`C1`) +ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠã€€ +ã‚ã„ã†ãˆãŠã€€ã€€ +ã‚ã„ã†ãˆãŠã€€ã€€ã€€ +SELECT RTRIM(`C1`) from `T12`; +RTRIM(`C1`) +龔龖龗龞龡 +龔龖龗龞龡 +龔龖龗龞龡 +龔龖龗龞龡 +龔龖龗龞龡  +龔龖龗龞龡   +龔龖龗龞龡    +DROP TABLE `T1`; +DROP TABLE `ï¼´ï¼’`; +DROP TABLE `T3`; +DROP TABLE `ï¼´ï¼”`; +DROP TABLE `T5`; +DROP TABLE `ï¼´ï¼–`; +DROP TABLE `ï¼´ï¼—`; +DROP TABLE `T8`; +DROP TABLE `ï¼´ï¼™`; +DROP TABLE `T1ï¼`; +DROP TABLE `T11`; +DROP TABLE `T12`; diff --git a/mysql-test/suite/jp/r/jp_select_sjis.result b/mysql-test/suite/jp/r/jp_select_sjis.result new file mode 100755 index 00000000000..d48d08d745f --- /dev/null +++ b/mysql-test/suite/jp/r/jp_select_sjis.result @@ -0,0 +1,382 @@ +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +drop table if exists `‚s‚P‚P`; +drop table if exists `‚s‚P‚Q`; +SET NAMES sjis; +SET character_set_database = sjis; +CREATE TABLE `‚s‚P` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Q` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚R` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚S` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚T` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚U` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚V` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚W` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚X` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚O` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚P` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚Q` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `‚s‚P`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `‚s‚Q`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `‚s‚R`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `‚s‚S`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `‚s‚T`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `‚s‚U`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `‚s‚V`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `‚s‚W`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `‚s‚X`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `‚s‚P‚O`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `‚s‚P‚P`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `‚s‚P‚Q`; +SELECT * FROM `‚s‚P`; +‚b‚P + !"#$%&'()*+,-./ + ¡¢£¤¥¦§¨©ª«¬­®¯ +0123456789:;<=>? +@ABCDEFGHIJKLMNO +abcdefghijklmno +PQRSTUVWXYZ[\]^_ +pqrstuvwxyz{|}~ +°±²³´µ¶·¸¹º»¼½¾¿ +ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ +ÐÑÒÓÔÕÖרÙÚÛÜÝÞß +SELECT * FROM `‚s‚Q`; +‚b‚P +@@ABCDEFGHIJKLMNOPQR +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEE‚O‚P‚Q‚R +EEEEEEEEE„p„q„r„s„t„u„v„w„x„y„z +EEEEEE¸¹º»¼½¾¿EEEEEE +EEEEE‚‚‚‚ƒ‚„‚…‚†‚‡‚ˆ‚‰‚Š‚‹‚Œ‚‚Ž‚ +EEÈÉÊËÌÍÎEEEEEEEEEEE +EEðñòóôõö÷EEEEüEEEE@ +EŸ ¡¢£¤¥¦§¨©ª«¬EEEEE +E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚­‚®‚¯‚°‚± +Eƒ@ƒAƒBƒCƒDƒEƒFƒGƒHƒIƒJƒKƒLƒMƒNƒOƒPƒQƒR +EƒŸƒ ƒ¡ƒ¢ƒ£ƒ¤ƒ¥ƒ¦ƒ§ƒ¨ƒ©ƒªƒ«ƒ¬ƒ­ƒ®ƒ¯ƒ°ƒ± +E„@„A„B„C„D„E„F„G„H„I„J„K„L„M„N„O„P„Q„R +E„Ÿ„ „¡„¢„£„¤„¥„¦„§„¨„©„ª„«„¬„­„®„¯„°„± +EˆŸˆ ˆ¡ˆ¢ˆ£ˆ¤ˆ¥ˆ¦ˆ§ˆ¨ˆ©ˆªˆ«ˆ¬ˆ­ˆ®ˆ¯ˆ°ˆ± +E˜@˜A˜B˜C˜D˜E˜F˜G˜H˜I˜J˜K˜L˜M˜N˜O˜P˜Q˜R +E˜Ÿ˜ ˜¡˜¢˜£˜¤˜¥˜¦˜§˜¨˜©˜ª˜«˜¬˜­˜®˜¯˜°˜± +Eê@êAêBêCêDêEêFêGêHêIêJêKêLêMêNêOêPêQêR +EêŸê ê¡ê¢ê£ê¤EEEEEEEEEEEEE +STUVWXYZ[\]^_`abcdef +ghijklmnopqrstuvwxyz +{]}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ +‘’“”•–—˜™š›œžEEEEE +ÚÛÜÝÞßàáâãäåæçèEEEEE +‚S‚T‚U‚V‚W‚XEEEEEEE‚`‚a‚b‚c‚d‚e‚f +‚g‚h‚i‚j‚k‚l‚m‚n‚o‚p‚q‚r‚s‚t‚u‚v‚w‚x‚yE +‚‚‘‚’‚“‚”‚•‚–‚—‚˜‚™‚šEEEEEEEEE +‚²‚³‚´‚µ‚¶‚·‚¸‚¹‚º‚»‚¼‚½‚¾‚¿‚À‚Á‚‚ÂĂŠ+‚ƂǂȂɂʂ˂̂͂΂ςЂт҂ӂԂՂւׂ؂٠+‚ڂۂ܂݂ނ߂à‚á‚â‚ã‚ä‚傿‚ç‚è‚é‚ê‚ë‚ì‚í +‚î‚ï‚ð‚ñEEEEEEEEEEEEEEEE +ƒSƒTƒUƒVƒWƒXƒYƒZƒ[ƒ\ƒ]ƒ^ƒ_ƒ`ƒaƒbƒcƒdƒeƒf +ƒgƒhƒiƒjƒkƒlƒmƒnƒoƒpƒqƒrƒsƒtƒuƒvƒwƒxƒyƒz +ƒ{ƒ|ƒ}ƒ~ƒ€ƒƒ‚ƒƒƒ„ƒ…ƒ†ƒ‡ƒˆƒ‰ƒŠƒ‹ƒŒƒƒŽƒ +ƒƒ‘ƒ’ƒ“ƒ”ƒ•ƒ–EEEEEEEEEEEEE +ƒ²ƒ³ƒ´ƒµƒ¶EEEEEEEEƒ¿ƒÀƒÁƒÂƒÃƒÄƒÅ +ƒÆƒÇƒÈƒÉƒÊƒËƒÌƒÍƒÎƒÏƒÐƒÑƒÒƒÓƒÔƒÕƒÖEEE +„S„T„U„V„W„X„Y„Z„[„\„]„^„_„`EEEEEE +„{„|„}„~„€„„‚„ƒ„„„…„†„‡„ˆ„‰„Š„‹„Œ„„Ž„ +„„‘EEEEEEEEEEEEEEEEEE +„²„³„´„µ„¶„·„¸„¹„º„»„¼„½„¾EEEEEEE +ˆ²ˆ³ˆ´ˆµˆ¶ˆ·ˆ¸ˆ¹ˆºˆ»ˆ¼ˆ½ˆ¾ˆ¿ˆÀˆÁˆÂˆÃˆÄˆÅ +ˆÆˆÇˆÈˆÉˆÊˆËˆÌˆÍˆÎˆÏˆÐˆÑˆÒˆÓˆÔˆÕˆÖˆ×ˆØˆÙ +ˆÚˆÛˆÜˆÝˆÞˆßˆàˆáˆâˆãˆäˆåˆæˆçˆèˆéˆêˆëˆìˆí +ˆîˆïˆðˆñˆòˆóˆôˆõˆöˆ÷ˆøˆùˆúˆûˆüEEEEE +˜S˜T˜U˜V˜W˜X˜Y˜Z˜[˜\˜]˜^˜_˜`˜a˜b˜c˜d˜e˜f +˜g˜h˜i˜j˜k˜l˜m˜n˜o˜p˜q˜rEEEEEEEE +˜²˜³˜´˜µ˜¶˜·˜¸˜¹˜º˜»˜¼˜½˜¾˜¿˜À˜Á˜Â˜Ã˜Ä˜Å +˜Æ˜Ç˜È˜É˜Ê˜Ë˜Ì˜Í˜Î˜Ï˜Ð˜Ñ˜Ò˜Ó˜Ô˜Õ˜Ö˜×˜Ø˜Ù +˜Ú˜Û˜Ü˜Ý˜Þ˜ß˜à˜á˜â˜ã˜ä˜å˜æ˜ç˜è˜é˜ê˜ë˜ì˜í +˜î˜ï˜ð˜ñ˜ò˜ó˜ô˜õ˜ö˜÷˜ø˜ù˜ú˜û˜üEEEEE +êSêTêUêVêWêXêYêZê[ê\ê]ê^ê_ê`êaêbêcêdêeêf +êgêhêiêjêkêlêmênêoêpêqêrêsêtêuêvêwêxêyêz +ê{ê|ê}ê~ê€êê‚êƒê„ê…ê†ê‡êˆê‰êŠê‹êŒêêŽê +êê‘ê’ê“ê”ê•ê–ê—ê˜ê™êšê›êœêêžEEEEE +SELECT * FROM `‚s‚R`; +‚b‚P +ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ +SELECT * FROM `‚s‚S`; +‚b‚P + !"#$%&'()*+,-./ + ¡¢£¤¥¦§¨©ª«¬­®¯ +0123456789:;<=>? +@ABCDEFGHIJKLMNO +abcdefghijklmno +PQRSTUVWXYZ[\]^_ +pqrstuvwxyz{|}~ +°±²³´µ¶·¸¹º»¼½¾¿ +ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ +ÐÑÒÓÔÕÖרÙÚÛÜÝÞß +SELECT * FROM `‚s‚T`; +‚b‚P +@@ABCDEFGHIJKLMNOPQR +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEE‚O‚P‚Q‚R +EEEEEEEEE„p„q„r„s„t„u„v„w„x„y„z +EEEEEE¸¹º»¼½¾¿EEEEEE +EEEEE‚‚‚‚ƒ‚„‚…‚†‚‡‚ˆ‚‰‚Š‚‹‚Œ‚‚Ž‚ +EEÈÉÊËÌÍÎEEEEEEEEEEE +EEðñòóôõö÷EEEEüEEEE@ +EŸ ¡¢£¤¥¦§¨©ª«¬EEEEE +E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚­‚®‚¯‚°‚± +Eƒ@ƒAƒBƒCƒDƒEƒFƒGƒHƒIƒJƒKƒLƒMƒNƒOƒPƒQƒR +EƒŸƒ ƒ¡ƒ¢ƒ£ƒ¤ƒ¥ƒ¦ƒ§ƒ¨ƒ©ƒªƒ«ƒ¬ƒ­ƒ®ƒ¯ƒ°ƒ± +E„@„A„B„C„D„E„F„G„H„I„J„K„L„M„N„O„P„Q„R +E„Ÿ„ „¡„¢„£„¤„¥„¦„§„¨„©„ª„«„¬„­„®„¯„°„± +EˆŸˆ ˆ¡ˆ¢ˆ£ˆ¤ˆ¥ˆ¦ˆ§ˆ¨ˆ©ˆªˆ«ˆ¬ˆ­ˆ®ˆ¯ˆ°ˆ± +E˜@˜A˜B˜C˜D˜E˜F˜G˜H˜I˜J˜K˜L˜M˜N˜O˜P˜Q˜R +E˜Ÿ˜ ˜¡˜¢˜£˜¤˜¥˜¦˜§˜¨˜©˜ª˜«˜¬˜­˜®˜¯˜°˜± +Eê@êAêBêCêDêEêFêGêHêIêJêKêLêMêNêOêPêQêR +EêŸê ê¡ê¢ê£ê¤EEEEEEEEEEEEE +STUVWXYZ[\]^_`abcdef +ghijklmnopqrstuvwxyz +{]}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ +‘’“”•–—˜™š›œžEEEEE +ÚÛÜÝÞßàáâãäåæçèEEEEE +‚S‚T‚U‚V‚W‚XEEEEEEE‚`‚a‚b‚c‚d‚e‚f +‚g‚h‚i‚j‚k‚l‚m‚n‚o‚p‚q‚r‚s‚t‚u‚v‚w‚x‚yE +‚‚‘‚’‚“‚”‚•‚–‚—‚˜‚™‚šEEEEEEEEE +‚²‚³‚´‚µ‚¶‚·‚¸‚¹‚º‚»‚¼‚½‚¾‚¿‚À‚Á‚‚ÂĂŠ+‚ƂǂȂɂʂ˂̂͂΂ςЂт҂ӂԂՂւׂ؂٠+‚ڂۂ܂݂ނ߂à‚á‚â‚ã‚ä‚傿‚ç‚è‚é‚ê‚ë‚ì‚í +‚î‚ï‚ð‚ñEEEEEEEEEEEEEEEE +ƒSƒTƒUƒVƒWƒXƒYƒZƒ[ƒ\ƒ]ƒ^ƒ_ƒ`ƒaƒbƒcƒdƒeƒf +ƒgƒhƒiƒjƒkƒlƒmƒnƒoƒpƒqƒrƒsƒtƒuƒvƒwƒxƒyƒz +ƒ{ƒ|ƒ}ƒ~ƒ€ƒƒ‚ƒƒƒ„ƒ…ƒ†ƒ‡ƒˆƒ‰ƒŠƒ‹ƒŒƒƒŽƒ +ƒƒ‘ƒ’ƒ“ƒ”ƒ•ƒ–EEEEEEEEEEEEE +ƒ²ƒ³ƒ´ƒµƒ¶EEEEEEEEƒ¿ƒÀƒÁƒÂƒÃƒÄƒÅ +ƒÆƒÇƒÈƒÉƒÊƒËƒÌƒÍƒÎƒÏƒÐƒÑƒÒƒÓƒÔƒÕƒÖEEE +„S„T„U„V„W„X„Y„Z„[„\„]„^„_„`EEEEEE +„{„|„}„~„€„„‚„ƒ„„„…„†„‡„ˆ„‰„Š„‹„Œ„„Ž„ +„„‘EEEEEEEEEEEEEEEEEE +„²„³„´„µ„¶„·„¸„¹„º„»„¼„½„¾EEEEEEE +ˆ²ˆ³ˆ´ˆµˆ¶ˆ·ˆ¸ˆ¹ˆºˆ»ˆ¼ˆ½ˆ¾ˆ¿ˆÀˆÁˆÂˆÃˆÄˆÅ +ˆÆˆÇˆÈˆÉˆÊˆËˆÌˆÍˆÎˆÏˆÐˆÑˆÒˆÓˆÔˆÕˆÖˆ×ˆØˆÙ +ˆÚˆÛˆÜˆÝˆÞˆßˆàˆáˆâˆãˆäˆåˆæˆçˆèˆéˆêˆëˆìˆí +ˆîˆïˆðˆñˆòˆóˆôˆõˆöˆ÷ˆøˆùˆúˆûˆüEEEEE +˜S˜T˜U˜V˜W˜X˜Y˜Z˜[˜\˜]˜^˜_˜`˜a˜b˜c˜d˜e˜f +˜g˜h˜i˜j˜k˜l˜m˜n˜o˜p˜q˜rEEEEEEEE +˜²˜³˜´˜µ˜¶˜·˜¸˜¹˜º˜»˜¼˜½˜¾˜¿˜À˜Á˜Â˜Ã˜Ä˜Å +˜Æ˜Ç˜È˜É˜Ê˜Ë˜Ì˜Í˜Î˜Ï˜Ð˜Ñ˜Ò˜Ó˜Ô˜Õ˜Ö˜×˜Ø˜Ù +˜Ú˜Û˜Ü˜Ý˜Þ˜ß˜à˜á˜â˜ã˜ä˜å˜æ˜ç˜è˜é˜ê˜ë˜ì˜í +˜î˜ï˜ð˜ñ˜ò˜ó˜ô˜õ˜ö˜÷˜ø˜ù˜ú˜û˜üEEEEE +êSêTêUêVêWêXêYêZê[ê\ê]ê^ê_ê`êaêbêcêdêeêf +êgêhêiêjêkêlêmênêoêpêqêrêsêtêuêvêwêxêyêz +ê{ê|ê}ê~ê€êê‚êƒê„ê…ê†ê‡êˆê‰êŠê‹êŒêêŽê +êê‘ê’ê“ê”ê•ê–ê—ê˜ê™êšê›êœêêžEEEEE +SELECT * FROM `‚s‚U`; +‚b‚P +ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ +SELECT * FROM `‚s‚V`; +‚b‚P + !"#$%&'()*+,-./ +0123456789:;<=>? +@ABCDEFGHIJKLMNO +PQRSTUVWXYZ[\]^_ +abcdefghijklmno +pqrstuvwxyz{|}~ + ¡¢£¤¥¦§¨©ª«¬­®¯ +°±²³´µ¶·¸¹º»¼½¾¿ +ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ +ÐÑÒÓÔÕÖרÙÚÛÜÝÞß +SELECT * FROM `‚s‚W`; +‚b‚P +@@ABCDEFGHIJKLMNOPQR +STUVWXYZ[\]^_`abcdef +ghijklmnopqrstuvwxyz +{]}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ +‘’“”•–—˜™š›œžEEEEE +EŸ ¡¢£¤¥¦§¨©ª«¬EEEEE +EEEEEE¸¹º»¼½¾¿EEEEEE +EEÈÉÊËÌÍÎEEEEEEEEEEE +ÚÛÜÝÞßàáâãäåæçèEEEEE +EEðñòóôõö÷EEEEüEEEE@ +EEEEEEEEEEEEEEEE‚O‚P‚Q‚R +‚S‚T‚U‚V‚W‚XEEEEEEE‚`‚a‚b‚c‚d‚e‚f +‚g‚h‚i‚j‚k‚l‚m‚n‚o‚p‚q‚r‚s‚t‚u‚v‚w‚x‚yE +EEEEE‚‚‚‚ƒ‚„‚…‚†‚‡‚ˆ‚‰‚Š‚‹‚Œ‚‚Ž‚ +‚‚‘‚’‚“‚”‚•‚–‚—‚˜‚™‚šEEEEEEEEE +E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚­‚®‚¯‚°‚± +‚²‚³‚´‚µ‚¶‚·‚¸‚¹‚º‚»‚¼‚½‚¾‚¿‚À‚Á‚‚ÂĂŠ+‚ƂǂȂɂʂ˂̂͂΂ςЂт҂ӂԂՂւׂ؂٠+‚ڂۂ܂݂ނ߂à‚á‚â‚ã‚ä‚傿‚ç‚è‚é‚ê‚ë‚ì‚í +‚î‚ï‚ð‚ñEEEEEEEEEEEEEEEE +Eƒ@ƒAƒBƒCƒDƒEƒFƒGƒHƒIƒJƒKƒLƒMƒNƒOƒPƒQƒR +ƒSƒTƒUƒVƒWƒXƒYƒZƒ[ƒ\ƒ]ƒ^ƒ_ƒ`ƒaƒbƒcƒdƒeƒf +ƒgƒhƒiƒjƒkƒlƒmƒnƒoƒpƒqƒrƒsƒtƒuƒvƒwƒxƒyƒz +ƒ{ƒ|ƒ}ƒ~ƒ€ƒƒ‚ƒƒƒ„ƒ…ƒ†ƒ‡ƒˆƒ‰ƒŠƒ‹ƒŒƒƒŽƒ +ƒƒ‘ƒ’ƒ“ƒ”ƒ•ƒ–EEEEEEEEEEEEE +EƒŸƒ ƒ¡ƒ¢ƒ£ƒ¤ƒ¥ƒ¦ƒ§ƒ¨ƒ©ƒªƒ«ƒ¬ƒ­ƒ®ƒ¯ƒ°ƒ± +ƒ²ƒ³ƒ´ƒµƒ¶EEEEEEEEƒ¿ƒÀƒÁƒÂƒÃƒÄƒÅ +ƒÆƒÇƒÈƒÉƒÊƒËƒÌƒÍƒÎƒÏƒÐƒÑƒÒƒÓƒÔƒÕƒÖEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +E„@„A„B„C„D„E„F„G„H„I„J„K„L„M„N„O„P„Q„R +„S„T„U„V„W„X„Y„Z„[„\„]„^„_„`EEEEEE +EEEEEEEEE„p„q„r„s„t„u„v„w„x„y„z +„{„|„}„~„€„„‚„ƒ„„„…„†„‡„ˆ„‰„Š„‹„Œ„„Ž„ +„„‘EEEEEEEEEEEEEEEEEE +E„Ÿ„ „¡„¢„£„¤„¥„¦„§„¨„©„ª„«„¬„­„®„¯„°„± +„²„³„´„µ„¶„·„¸„¹„º„»„¼„½„¾EEEEEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +EˆŸˆ ˆ¡ˆ¢ˆ£ˆ¤ˆ¥ˆ¦ˆ§ˆ¨ˆ©ˆªˆ«ˆ¬ˆ­ˆ®ˆ¯ˆ°ˆ± +ˆ²ˆ³ˆ´ˆµˆ¶ˆ·ˆ¸ˆ¹ˆºˆ»ˆ¼ˆ½ˆ¾ˆ¿ˆÀˆÁˆÂˆÃˆÄˆÅ +ˆÆˆÇˆÈˆÉˆÊˆËˆÌˆÍˆÎˆÏˆÐˆÑˆÒˆÓˆÔˆÕˆÖˆ×ˆØˆÙ +ˆÚˆÛˆÜˆÝˆÞˆßˆàˆáˆâˆãˆäˆåˆæˆçˆèˆéˆêˆëˆìˆí +ˆîˆïˆðˆñˆòˆóˆôˆõˆöˆ÷ˆøˆùˆúˆûˆüEEEEE +E˜@˜A˜B˜C˜D˜E˜F˜G˜H˜I˜J˜K˜L˜M˜N˜O˜P˜Q˜R +˜S˜T˜U˜V˜W˜X˜Y˜Z˜[˜\˜]˜^˜_˜`˜a˜b˜c˜d˜e˜f +˜g˜h˜i˜j˜k˜l˜m˜n˜o˜p˜q˜rEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +E˜Ÿ˜ ˜¡˜¢˜£˜¤˜¥˜¦˜§˜¨˜©˜ª˜«˜¬˜­˜®˜¯˜°˜± +˜²˜³˜´˜µ˜¶˜·˜¸˜¹˜º˜»˜¼˜½˜¾˜¿˜À˜Á˜Â˜Ã˜Ä˜Å +˜Æ˜Ç˜È˜É˜Ê˜Ë˜Ì˜Í˜Î˜Ï˜Ð˜Ñ˜Ò˜Ó˜Ô˜Õ˜Ö˜×˜Ø˜Ù +˜Ú˜Û˜Ü˜Ý˜Þ˜ß˜à˜á˜â˜ã˜ä˜å˜æ˜ç˜è˜é˜ê˜ë˜ì˜í +˜î˜ï˜ð˜ñ˜ò˜ó˜ô˜õ˜ö˜÷˜ø˜ù˜ú˜û˜üEEEEE +Eê@êAêBêCêDêEêFêGêHêIêJêKêLêMêNêOêPêQêR +êSêTêUêVêWêXêYêZê[ê\ê]ê^ê_ê`êaêbêcêdêeêf +êgêhêiêjêkêlêmênêoêpêqêrêsêtêuêvêwêxêyêz +ê{ê|ê}ê~ê€êê‚êƒê„ê…ê†ê‡êˆê‰êŠê‹êŒêêŽê +êê‘ê’ê“ê”ê•ê–ê—ê˜ê™êšê›êœêêžEEEEE +EêŸê ê¡ê¢ê£ê¤EEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +SELECT * FROM `‚s‚X`; +‚b‚P +ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ +SELECT * FROM `‚s‚P‚O`; +‚b‚P + !"#$%&'()*+,-./ +0123456789:;<=>? +@ABCDEFGHIJKLMNO +PQRSTUVWXYZ[\]^_ +abcdefghijklmno +pqrstuvwxyz{|}~ + ¡¢£¤¥¦§¨©ª«¬­®¯ +°±²³´µ¶·¸¹º»¼½¾¿ +ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ +ÐÑÒÓÔÕÖרÙÚÛÜÝÞß +SELECT * FROM `‚s‚P‚P`; +‚b‚P +@@ABCDEFGHIJKLMNOPQR +STUVWXYZ[\]^_`abcdef +ghijklmnopqrstuvwxyz +{]}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ +‘’“”•–—˜™š›œžEEEEE +EŸ ¡¢£¤¥¦§¨©ª«¬EEEEE +EEEEEE¸¹º»¼½¾¿EEEEEE +EEÈÉÊËÌÍÎEEEEEEEEEEE +ÚÛÜÝÞßàáâãäåæçèEEEEE +EEðñòóôõö÷EEEEüEEEE@ +EEEEEEEEEEEEEEEE‚O‚P‚Q‚R +‚S‚T‚U‚V‚W‚XEEEEEEE‚`‚a‚b‚c‚d‚e‚f +‚g‚h‚i‚j‚k‚l‚m‚n‚o‚p‚q‚r‚s‚t‚u‚v‚w‚x‚yE +EEEEE‚‚‚‚ƒ‚„‚…‚†‚‡‚ˆ‚‰‚Š‚‹‚Œ‚‚Ž‚ +‚‚‘‚’‚“‚”‚•‚–‚—‚˜‚™‚šEEEEEEEEE +E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚­‚®‚¯‚°‚± +‚²‚³‚´‚µ‚¶‚·‚¸‚¹‚º‚»‚¼‚½‚¾‚¿‚À‚Á‚‚ÂĂŠ+‚ƂǂȂɂʂ˂̂͂΂ςЂт҂ӂԂՂւׂ؂٠+‚ڂۂ܂݂ނ߂à‚á‚â‚ã‚ä‚傿‚ç‚è‚é‚ê‚ë‚ì‚í +‚î‚ï‚ð‚ñEEEEEEEEEEEEEEEE +Eƒ@ƒAƒBƒCƒDƒEƒFƒGƒHƒIƒJƒKƒLƒMƒNƒOƒPƒQƒR +ƒSƒTƒUƒVƒWƒXƒYƒZƒ[ƒ\ƒ]ƒ^ƒ_ƒ`ƒaƒbƒcƒdƒeƒf +ƒgƒhƒiƒjƒkƒlƒmƒnƒoƒpƒqƒrƒsƒtƒuƒvƒwƒxƒyƒz +ƒ{ƒ|ƒ}ƒ~ƒ€ƒƒ‚ƒƒƒ„ƒ…ƒ†ƒ‡ƒˆƒ‰ƒŠƒ‹ƒŒƒƒŽƒ +ƒƒ‘ƒ’ƒ“ƒ”ƒ•ƒ–EEEEEEEEEEEEE +EƒŸƒ ƒ¡ƒ¢ƒ£ƒ¤ƒ¥ƒ¦ƒ§ƒ¨ƒ©ƒªƒ«ƒ¬ƒ­ƒ®ƒ¯ƒ°ƒ± +ƒ²ƒ³ƒ´ƒµƒ¶EEEEEEEEƒ¿ƒÀƒÁƒÂƒÃƒÄƒÅ +ƒÆƒÇƒÈƒÉƒÊƒËƒÌƒÍƒÎƒÏƒÐƒÑƒÒƒÓƒÔƒÕƒÖEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +E„@„A„B„C„D„E„F„G„H„I„J„K„L„M„N„O„P„Q„R +„S„T„U„V„W„X„Y„Z„[„\„]„^„_„`EEEEEE +EEEEEEEEE„p„q„r„s„t„u„v„w„x„y„z +„{„|„}„~„€„„‚„ƒ„„„…„†„‡„ˆ„‰„Š„‹„Œ„„Ž„ +„„‘EEEEEEEEEEEEEEEEEE +E„Ÿ„ „¡„¢„£„¤„¥„¦„§„¨„©„ª„«„¬„­„®„¯„°„± +„²„³„´„µ„¶„·„¸„¹„º„»„¼„½„¾EEEEEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +EˆŸˆ ˆ¡ˆ¢ˆ£ˆ¤ˆ¥ˆ¦ˆ§ˆ¨ˆ©ˆªˆ«ˆ¬ˆ­ˆ®ˆ¯ˆ°ˆ± +ˆ²ˆ³ˆ´ˆµˆ¶ˆ·ˆ¸ˆ¹ˆºˆ»ˆ¼ˆ½ˆ¾ˆ¿ˆÀˆÁˆÂˆÃˆÄˆÅ +ˆÆˆÇˆÈˆÉˆÊˆËˆÌˆÍˆÎˆÏˆÐˆÑˆÒˆÓˆÔˆÕˆÖˆ×ˆØˆÙ +ˆÚˆÛˆÜˆÝˆÞˆßˆàˆáˆâˆãˆäˆåˆæˆçˆèˆéˆêˆëˆìˆí +ˆîˆïˆðˆñˆòˆóˆôˆõˆöˆ÷ˆøˆùˆúˆûˆüEEEEE +E˜@˜A˜B˜C˜D˜E˜F˜G˜H˜I˜J˜K˜L˜M˜N˜O˜P˜Q˜R +˜S˜T˜U˜V˜W˜X˜Y˜Z˜[˜\˜]˜^˜_˜`˜a˜b˜c˜d˜e˜f +˜g˜h˜i˜j˜k˜l˜m˜n˜o˜p˜q˜rEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +E˜Ÿ˜ ˜¡˜¢˜£˜¤˜¥˜¦˜§˜¨˜©˜ª˜«˜¬˜­˜®˜¯˜°˜± +˜²˜³˜´˜µ˜¶˜·˜¸˜¹˜º˜»˜¼˜½˜¾˜¿˜À˜Á˜Â˜Ã˜Ä˜Å +˜Æ˜Ç˜È˜É˜Ê˜Ë˜Ì˜Í˜Î˜Ï˜Ð˜Ñ˜Ò˜Ó˜Ô˜Õ˜Ö˜×˜Ø˜Ù +˜Ú˜Û˜Ü˜Ý˜Þ˜ß˜à˜á˜â˜ã˜ä˜å˜æ˜ç˜è˜é˜ê˜ë˜ì˜í +˜î˜ï˜ð˜ñ˜ò˜ó˜ô˜õ˜ö˜÷˜ø˜ù˜ú˜û˜üEEEEE +Eê@êAêBêCêDêEêFêGêHêIêJêKêLêMêNêOêPêQêR +êSêTêUêVêWêXêYêZê[ê\ê]ê^ê_ê`êaêbêcêdêeêf +êgêhêiêjêkêlêmênêoêpêqêrêsêtêuêvêwêxêyêz +ê{ê|ê}ê~ê€êê‚êƒê„ê…ê†ê‡êˆê‰êŠê‹êŒêêŽê +êê‘ê’ê“ê”ê•ê–ê—ê˜ê™êšê›êœêêžEEEEE +EêŸê ê¡ê¢ê£ê¤EEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +SELECT * FROM `‚s‚P‚Q`; +‚b‚P +ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ +drop table `‚s‚P`; +drop table `‚s‚Q`; +drop table `‚s‚R`; +drop table `‚s‚S`; +drop table `‚s‚T`; +drop table `‚s‚U`; +drop table `‚s‚V`; +drop table `‚s‚W`; +drop table `‚s‚X`; +drop table `‚s‚P‚O`; +drop table `‚s‚P‚P`; +drop table `‚s‚P‚Q`; diff --git a/mysql-test/suite/jp/r/jp_select_ucs2.result b/mysql-test/suite/jp/r/jp_select_ucs2.result new file mode 100755 index 00000000000..39d057ed107 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_select_ucs2.result @@ -0,0 +1,227 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; +CREATE TABLE `£Ô£±` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µ` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£±` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£²` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ucs2 engine = bdb; +INSERT INTO `£Ô£±` VALUES +('PQRSTUVWXYZ[\\]^_') +,(' Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯') +,('Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿') +,('ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ') +,('ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß'); +INSERT INTO `£Ô£²` VALUES +('¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç') +,('¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û') +,('¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³') +,('¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³') +,('¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³') +,('¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³') +,('¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³'); +INSERT INTO `£Ô£³` VALUES +('¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦') +,('°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç') +,('°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û') +,('°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï') +,('¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³') +,('í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ') +,('íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ'); +INSERT INTO `£Ô£´` VALUES +('PQRSTUVWXYZ[\\]^_') +,(' Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯') +,('Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿') +,('ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ') +,('ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß'); +INSERT INTO `£Ô£µ` VALUES +('¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç') +,('¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û') +,('¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³') +,('¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³') +,('¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³') +,('¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³') +,('¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³'); +INSERT INTO `£Ô£¶` VALUES +('¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦') +,('°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç') +,('°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û') +,('°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï') +,('¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³') +,('í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ') +,('íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ'); +INSERT INTO `£Ô£·` VALUES +('PQRSTUVWXYZ[\\]^_') +,(' Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯') +,('Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿') +,('ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ') +,('ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß'); +INSERT INTO `£Ô£¸` VALUES +('¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç') +,('¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û') +,('¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³') +,('¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³') +,('¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³') +,('¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³') +,('¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³'); +INSERT INTO `£Ô£¹` VALUES +('¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦') +,('°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç') +,('°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û') +,('°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï') +,('¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³') +,('í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ') +,('íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ'); +INSERT INTO `£Ô£±£°` VALUES +('PQRSTUVWXYZ[\\]^_') +,(' Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯') +,('Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿') +,('ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ') +,('ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß'); +INSERT INTO `£Ô£±£±` VALUES +('¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç') +,('¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û') +,('¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³') +,('¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³') +,('¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³') +,('¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³') +,('¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³'); +INSERT INTO `£Ô£±£²` VALUES +('¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦') +,('°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç') +,('°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û') +,('°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï') +,('¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³') +,('í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ') +,('íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ'); +SELECT * FROM `£Ô£±`; +c1 + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯ +PQRSTUVWXYZ[\]^_ +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ +ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß +SELECT * FROM `£Ô£²`; +c1 +¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ +¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³ +¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³ +¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³ +¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿\¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç +SELECT * FROM `£Ô£³`; +c1 +¡¦¢µ¢¶~¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ +¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ +SELECT * FROM `£Ô£´`; +c1 + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯ +PQRSTUVWXYZ[\]^_ +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ +ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß +SELECT * FROM `£Ô£µ`; +c1 +¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ +¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³ +¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³ +¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³ +¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿\¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç +SELECT * FROM `£Ô£¶`; +c1 +¡¦¢µ¢¶~¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ +¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ +SELECT * FROM `£Ô£·`; +c1 +PQRSTUVWXYZ[\]^_ + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯ +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ +ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß +SELECT * FROM `£Ô£¸`; +c1 +¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿\¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç +¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ +¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³ +¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³ +¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³ +SELECT * FROM `£Ô£¹`; +c1 +¡¦¢µ¢¶~¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï +¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³ +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ +SELECT * FROM `£Ô£±£°`; +c1 +PQRSTUVWXYZ[\]^_ + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯ +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ +ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß +SELECT * FROM `£Ô£±£±`; +c1 +¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿\¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç +¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ +¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³ +¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³ +¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³ +SELECT * FROM `£Ô£±£²`; +c1 +¡¦¢µ¢¶~¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï +¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³ +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ +drop table `£Ô£±`; +drop table `£Ô£²`; +drop table `£Ô£³`; +drop table `£Ô£´`; +drop table `£Ô£µ`; +drop table `£Ô£¶`; +drop table `£Ô£·`; +drop table `£Ô£¸`; +drop table `£Ô£¹`; +drop table `£Ô£±£°`; +drop table `£Ô£±£±`; +drop table `£Ô£±£²`; diff --git a/mysql-test/suite/jp/r/jp_select_ujis.result b/mysql-test/suite/jp/r/jp_select_ujis.result new file mode 100755 index 00000000000..3eea73c8083 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_select_ujis.result @@ -0,0 +1,538 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +SET NAMES ujis; +SET character_set_database = ujis; +CREATE TABLE `£Ô£±` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µ` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£±` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£²` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ujis engine = bdb; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_ujis.dat' INTO TABLE `£Ô£±`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_ujis.dat' INTO TABLE `£Ô£²`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_ujis.dat' INTO TABLE `£Ô£³`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_ujis.dat' INTO TABLE `£Ô£´`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_ujis.dat' INTO TABLE `£Ô£µ`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_ujis.dat' INTO TABLE `£Ô£¶`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_ujis.dat' INTO TABLE `£Ô£·`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_ujis.dat' INTO TABLE `£Ô£¸`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_ujis.dat' INTO TABLE `£Ô£¹`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_ujis.dat' INTO TABLE `£Ô£±£°`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_ujis.dat' INTO TABLE `£Ô£±£±`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_ujis.dat' INTO TABLE `£Ô£±£²`; +SELECT * FROM `£Ô£±`; +c1 + !"#$%&'()*+,-./ + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯ +0123456789:;<=>? +@ABCDEFGHIJKLMNO +abcdefghijklmno +PQRSTUVWXYZ[\]^_ +pqrstuvwxyz{|}~ +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ +ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß +SELECT * FROM `£Ô£²`; +c1 +¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡­¡®¡¯¡°¡±¡²¡³ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦£°£±£²£³ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Ñ§Ò§Ó§Ô§Õ§Ö§×§Ø§Ù§Ú§Û +¡¦¡¦¡¦¡¦¡¦¡¦¢º¢»¢¼¢½¢¾¢¿¢À¢Á¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦£á£â£ã£ä£å£æ£ç£è£é£ê£ë£ì£í£î£ï +¡¦¡¦¢Ê¢Ë¢Ì¢Í¢Î¢Ï¢Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¢ò¢ó¢ô¢õ¢ö¢÷¢ø¢ù¡¦¡¦¡¦¡¦¢þ¡¦¡¦¡¦¡¦¡¡ +¡¦¢¡¢¢¢£¢¤¢¥¢¦¢§¢¨¢©¢ª¢«¢¬¢­¢®¡¦¡¦¡¦¡¦¡¦ +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ +¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³ +¡¦¦¡¦¢¦£¦¤¦¥¦¦¦§¦¨¦©¦ª¦«¦¬¦­¦®¦¯¦°¦±¦²¦³ +¡¦§¡§¢§£§¤§¥§¦§§§¨§©§ª§«§¬§­§®§¯§°§±§²§³ +¡¦¨¡¨¢¨£¨¤¨¥¨¦¨§¨¨¨©¨ª¨«¨¬¨­¨®¨¯¨°¨±¨²¨³ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³ +¡¦Ï¡Ï¢Ï£Ï¤Ï¥Ï¦Ï§Ï¨Ï©ÏªÏ«Ï¬Ï­Ï®Ï¯Ï°Ï±Ï²Ï³ +¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³ +¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³ +¡¦ô¡ô¢ô£ô¤ô¥ô¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç +¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û +¡Ü¡¾¡Þ¡ß¡à¡á¡â¡ã¡ä¡å¡æ¡ç¡è¡é¡ê¡ë¡ì¡í¡î¡ï +¡ð¡ñ¡ò¡ó¡ô¡õ¡ö¡÷¡ø¡ù¡ú¡û¡ü¡ý¡þ¡¦¡¦¡¦¡¦¡¦ +¢Ü¢Ý¢Þ¢ß¢à¢á¢â¢ã¢ä¢å¢æ¢ç¢è¢é¢ê¡¦¡¦¡¦¡¦¡¦ +£´£µ£¶£·£¸£¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦£Á£Â£Ã£Ä£Å£Æ£Ç +£È£É£Ê£Ë£Ì£Í£Î£Ï£Ð£Ñ£Ò£Ó£Ô£Õ£Ö£×£Ø£Ù£Ú¡¦ +£ð£ñ£ò£ó£ô£õ£ö£÷£ø£ù£ú¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¤´¤µ¤¶¤·¤¸¤¹¤º¤»¤¼¤½¤¾¤¿¤À¤Á¤Â¤Ã¤Ä¤Å¤Æ¤Ç +¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û +¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï +¤ð¤ñ¤ò¤ó¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¥´¥µ¥¶¥·¥¸¥¹¥º¥»¥¼¥½¥¾¥¿¥À¥Á¥Â¥Ã¥Ä¥Å¥Æ¥Ç +¥È¥É¥Ê¥Ë¥Ì¥Í¥Î¥Ï¥Ð¥Ñ¥Ò¥Ó¥Ô¥Õ¥Ö¥×¥Ø¥Ù¥Ú¥Û +¥Ü¥Ý¥Þ¥ß¥à¥á¥â¥ã¥ä¥å¥æ¥ç¥è¥é¥ê¥ë¥ì¥í¥î¥ï +¥ð¥ñ¥ò¥ó¥ô¥õ¥ö¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¦´¦µ¦¶¦·¦¸¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¦Á¦Â¦Ã¦Ä¦Å¦Æ¦Ç +¦È¦É¦Ê¦Ë¦Ì¦Í¦Î¦Ï¦Ð¦Ñ¦Ò¦Ó¦Ô¦Õ¦Ö¦×¦Ø¡¦¡¦¡¦ +§´§µ§¶§·§¸§¹§º§»§¼§½§¾§¿§À§Á¡¦¡¦¡¦¡¦¡¦¡¦ +§Ü§Ý§Þ§ß§à§á§â§ã§ä§å§æ§ç§è§é§ê§ë§ì§í§î§ï +§ð§ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¨´¨µ¨¶¨·¨¸¨¹¨º¨»¨¼¨½¨¾¨¿¨À¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï +°ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ +ϴϵ϶ϷϸϹϺϻϼϽϾϿÏÀÏÁÏÂÏÃÏÄÏÅÏÆÏÇ +ÏÈÏÉÏÊÏËÏÌÏÍÏÎÏÏÏÐÏÑÏÒÏÓ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +дежзийклмнопÐÀÐÁÐÂÐÃÐÄÐÅÐÆÐÇ +ÐÈÐÉÐÊÐËÐÌÐÍÐÎÐÏÐÐÐÑÐÒÐÓÐÔÐÕÐÖÐ×ÐØÐÙÐÚÐÛ +ÐÜÐÝÐÞÐßÐàÐáÐâÐãÐäÐåÐæÐçÐèÐéÐêÐëÐìÐíÐîÐï +ÐðÐñÐòÐóÐôÐõÐöÐ÷ÐøÐùÐúÐûÐüÐýÐþ¡¦¡¦¡¦¡¦¡¦ +ó´óµó¶ó·ó¸ó¹óºó»ó¼ó½ó¾ó¿óÀóÁóÂóÃóÄóÅóÆóÇ +óÈóÉóÊóËóÌóÍóÎóÏóÐóÑóÒóÓóÔóÕóÖó×óØóÙóÚóÛ +óÜóÝóÞóßóàóáóâóãóäóåóæóçóèóéóêóëóìóíóîóï +óðóñóòóóóôóõóöó÷óøóùóúóûóüóýóþ¡¦¡¦¡¦¡¦¡¦ +SELECT * FROM `£Ô£³`; +c1 +¢ð¢ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +§È§É§Ê§Ë§Ì§Í§Î¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +©È©É©Ê©Ë©Ì©Í©Î©Ï©Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +ª´ªµª¶ª·ª¸¡¦ªºª»ª¼ª½ª¾ª¿ªÀªÁªÂªÃªÄªÅªÆªÇ +ªÈªÉªÊªËªÌªÍªÎªÏªÐªÑªÒªÓªÔªÕªÖª×ªØªÙªÚªÛ +ªÜªÝªÞªßªàªáªâªãªäªåªæªçªèªéªêªëªìªíªîªï +ªðªñªòªóªôªõªöª÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +«´«µ«¶«·«¸«¹«º«»¡¦«½«¾«¿«À«Á«Â«Ã¡¦«Å«Æ«Ç +«È«É«Ê«Ë«Ì«Í«Î«Ï«Ð«Ñ«Ò«Ó«Ô«Õ«Ö«×«Ø«Ù«Ú«Û +«Ü«Ý«Þ«ß«à«á«â«ã«ä«å«æ«ç«è«é«ê«ë«ì«í«î«ï +«ð«ñ«ò«ó«ô«õ«ö«÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï +°ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ +íÜíÝíÞíßíàíáíâí㡦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ +¡¦¦ñ¦ò¦ó¦ô¦õ¦ö¦÷¦ø¦ù¦ú¦û¦ü¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦©¡©¢¡¦©¤¡¦©¦¡¦©¨©©¡¦©«©¬©­¡¦©¯©°¡¦¡¦¡¦ +¡¦ª¡ª¢ª£ª¤ª¥ª¦ª§ª¨ª©ªªª«ª¬ª­ª®ª¯ª°ª±ª²ª³ +¡¦«¡«¢«£«¤«¥«¦«§«¨«©«ª«««¬«­«®«¯«°«±«²«³ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³ +¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³ +¡¦¡¦§ò§ó§ô§õ§ö§÷§ø§ù§ú§û§ü§ý§þ¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¦á¦â¦ã¦ä¦å¡¦¦ç¡¦¦é¦ê¡¦¦ì¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦©Á©Â©Ã©Ä©Å©Æ©Ç +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Â§Ã§Ä§Å§Æ§Ç +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢¯¢°¢±¢²¢³ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢ë¢ì¢í¢î¢ï +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +SELECT * FROM `£Ô£´`; +c1 + !"#$%&'()*+,-./ + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯ +0123456789:;<=>? +@ABCDEFGHIJKLMNO +abcdefghijklmno +PQRSTUVWXYZ[\]^_ +pqrstuvwxyz{|}~ +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ +ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß +SELECT * FROM `£Ô£µ`; +c1 +¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡­¡®¡¯¡°¡±¡²¡³ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦£°£±£²£³ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Ñ§Ò§Ó§Ô§Õ§Ö§×§Ø§Ù§Ú§Û +¡¦¡¦¡¦¡¦¡¦¡¦¢º¢»¢¼¢½¢¾¢¿¢À¢Á¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦£á£â£ã£ä£å£æ£ç£è£é£ê£ë£ì£í£î£ï +¡¦¡¦¢Ê¢Ë¢Ì¢Í¢Î¢Ï¢Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¢ò¢ó¢ô¢õ¢ö¢÷¢ø¢ù¡¦¡¦¡¦¡¦¢þ¡¦¡¦¡¦¡¦¡¡ +¡¦¢¡¢¢¢£¢¤¢¥¢¦¢§¢¨¢©¢ª¢«¢¬¢­¢®¡¦¡¦¡¦¡¦¡¦ +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ +¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³ +¡¦¦¡¦¢¦£¦¤¦¥¦¦¦§¦¨¦©¦ª¦«¦¬¦­¦®¦¯¦°¦±¦²¦³ +¡¦§¡§¢§£§¤§¥§¦§§§¨§©§ª§«§¬§­§®§¯§°§±§²§³ +¡¦¨¡¨¢¨£¨¤¨¥¨¦¨§¨¨¨©¨ª¨«¨¬¨­¨®¨¯¨°¨±¨²¨³ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³ +¡¦Ï¡Ï¢Ï£Ï¤Ï¥Ï¦Ï§Ï¨Ï©ÏªÏ«Ï¬Ï­Ï®Ï¯Ï°Ï±Ï²Ï³ +¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³ +¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³ +¡¦ô¡ô¢ô£ô¤ô¥ô¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç +¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û +¡Ü¡¾¡Þ¡ß¡à¡á¡â¡ã¡ä¡å¡æ¡ç¡è¡é¡ê¡ë¡ì¡í¡î¡ï +¡ð¡ñ¡ò¡ó¡ô¡õ¡ö¡÷¡ø¡ù¡ú¡û¡ü¡ý¡þ¡¦¡¦¡¦¡¦¡¦ +¢Ü¢Ý¢Þ¢ß¢à¢á¢â¢ã¢ä¢å¢æ¢ç¢è¢é¢ê¡¦¡¦¡¦¡¦¡¦ +£´£µ£¶£·£¸£¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦£Á£Â£Ã£Ä£Å£Æ£Ç +£È£É£Ê£Ë£Ì£Í£Î£Ï£Ð£Ñ£Ò£Ó£Ô£Õ£Ö£×£Ø£Ù£Ú¡¦ +£ð£ñ£ò£ó£ô£õ£ö£÷£ø£ù£ú¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¤´¤µ¤¶¤·¤¸¤¹¤º¤»¤¼¤½¤¾¤¿¤À¤Á¤Â¤Ã¤Ä¤Å¤Æ¤Ç +¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û +¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï +¤ð¤ñ¤ò¤ó¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¥´¥µ¥¶¥·¥¸¥¹¥º¥»¥¼¥½¥¾¥¿¥À¥Á¥Â¥Ã¥Ä¥Å¥Æ¥Ç +¥È¥É¥Ê¥Ë¥Ì¥Í¥Î¥Ï¥Ð¥Ñ¥Ò¥Ó¥Ô¥Õ¥Ö¥×¥Ø¥Ù¥Ú¥Û +¥Ü¥Ý¥Þ¥ß¥à¥á¥â¥ã¥ä¥å¥æ¥ç¥è¥é¥ê¥ë¥ì¥í¥î¥ï +¥ð¥ñ¥ò¥ó¥ô¥õ¥ö¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¦´¦µ¦¶¦·¦¸¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¦Á¦Â¦Ã¦Ä¦Å¦Æ¦Ç +¦È¦É¦Ê¦Ë¦Ì¦Í¦Î¦Ï¦Ð¦Ñ¦Ò¦Ó¦Ô¦Õ¦Ö¦×¦Ø¡¦¡¦¡¦ +§´§µ§¶§·§¸§¹§º§»§¼§½§¾§¿§À§Á¡¦¡¦¡¦¡¦¡¦¡¦ +§Ü§Ý§Þ§ß§à§á§â§ã§ä§å§æ§ç§è§é§ê§ë§ì§í§î§ï +§ð§ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¨´¨µ¨¶¨·¨¸¨¹¨º¨»¨¼¨½¨¾¨¿¨À¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï +°ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ +ϴϵ϶ϷϸϹϺϻϼϽϾϿÏÀÏÁÏÂÏÃÏÄÏÅÏÆÏÇ +ÏÈÏÉÏÊÏËÏÌÏÍÏÎÏÏÏÐÏÑÏÒÏÓ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +дежзийклмнопÐÀÐÁÐÂÐÃÐÄÐÅÐÆÐÇ +ÐÈÐÉÐÊÐËÐÌÐÍÐÎÐÏÐÐÐÑÐÒÐÓÐÔÐÕÐÖÐ×ÐØÐÙÐÚÐÛ +ÐÜÐÝÐÞÐßÐàÐáÐâÐãÐäÐåÐæÐçÐèÐéÐêÐëÐìÐíÐîÐï +ÐðÐñÐòÐóÐôÐõÐöÐ÷ÐøÐùÐúÐûÐüÐýÐþ¡¦¡¦¡¦¡¦¡¦ +ó´óµó¶ó·ó¸ó¹óºó»ó¼ó½ó¾ó¿óÀóÁóÂóÃóÄóÅóÆóÇ +óÈóÉóÊóËóÌóÍóÎóÏóÐóÑóÒóÓóÔóÕóÖó×óØóÙóÚóÛ +óÜóÝóÞóßóàóáóâóãóäóåóæóçóèóéóêóëóìóíóîóï +óðóñóòóóóôóõóöó÷óøóùóúóûóüóýóþ¡¦¡¦¡¦¡¦¡¦ +SELECT * FROM `£Ô£¶`; +c1 +¢ð¢ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +§È§É§Ê§Ë§Ì§Í§Î¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +©È©É©Ê©Ë©Ì©Í©Î©Ï©Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +ª´ªµª¶ª·ª¸¡¦ªºª»ª¼ª½ª¾ª¿ªÀªÁªÂªÃªÄªÅªÆªÇ +ªÈªÉªÊªËªÌªÍªÎªÏªÐªÑªÒªÓªÔªÕªÖª×ªØªÙªÚªÛ +ªÜªÝªÞªßªàªáªâªãªäªåªæªçªèªéªêªëªìªíªîªï +ªðªñªòªóªôªõªöª÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +«´«µ«¶«·«¸«¹«º«»¡¦«½«¾«¿«À«Á«Â«Ã¡¦«Å«Æ«Ç +«È«É«Ê«Ë«Ì«Í«Î«Ï«Ð«Ñ«Ò«Ó«Ô«Õ«Ö«×«Ø«Ù«Ú«Û +«Ü«Ý«Þ«ß«à«á«â«ã«ä«å«æ«ç«è«é«ê«ë«ì«í«î«ï +«ð«ñ«ò«ó«ô«õ«ö«÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï +°ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ +íÜíÝíÞíßíàíáíâí㡦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ +¡¦¦ñ¦ò¦ó¦ô¦õ¦ö¦÷¦ø¦ù¦ú¦û¦ü¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦©¡©¢¡¦©¤¡¦©¦¡¦©¨©©¡¦©«©¬©­¡¦©¯©°¡¦¡¦¡¦ +¡¦ª¡ª¢ª£ª¤ª¥ª¦ª§ª¨ª©ªªª«ª¬ª­ª®ª¯ª°ª±ª²ª³ +¡¦«¡«¢«£«¤«¥«¦«§«¨«©«ª«««¬«­«®«¯«°«±«²«³ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³ +¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³ +¡¦¡¦§ò§ó§ô§õ§ö§÷§ø§ù§ú§û§ü§ý§þ¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¦á¦â¦ã¦ä¦å¡¦¦ç¡¦¦é¦ê¡¦¦ì¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦©Á©Â©Ã©Ä©Å©Æ©Ç +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Â§Ã§Ä§Å§Æ§Ç +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢¯¢°¢±¢²¢³ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢ë¢ì¢í¢î¢ï +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +SELECT * FROM `£Ô£·`; +c1 + !"#$%&'()*+,-./ +0123456789:;<=>? +@ABCDEFGHIJKLMNO +PQRSTUVWXYZ[\]^_ +abcdefghijklmno +pqrstuvwxyz{|}~ + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯ +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ +ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß +SELECT * FROM `£Ô£¸`; +c1 +¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡­¡®¡¯¡°¡±¡²¡³ +¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç +¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û +¡Ü¡¾¡Þ¡ß¡à¡á¡â¡ã¡ä¡å¡æ¡ç¡è¡é¡ê¡ë¡ì¡í¡î¡ï +¡ð¡ñ¡ò¡ó¡ô¡õ¡ö¡÷¡ø¡ù¡ú¡û¡ü¡ý¡þ¡¦¡¦¡¦¡¦¡¦ +¡¦¢¡¢¢¢£¢¤¢¥¢¦¢§¢¨¢©¢ª¢«¢¬¢­¢®¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¢º¢»¢¼¢½¢¾¢¿¢À¢Á¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¢Ê¢Ë¢Ì¢Í¢Î¢Ï¢Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¢Ü¢Ý¢Þ¢ß¢à¢á¢â¢ã¢ä¢å¢æ¢ç¢è¢é¢ê¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¢ò¢ó¢ô¢õ¢ö¢÷¢ø¢ù¡¦¡¦¡¦¡¦¢þ¡¦¡¦¡¦¡¦¡¡ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦£°£±£²£³ +£´£µ£¶£·£¸£¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦£Á£Â£Ã£Ä£Å£Æ£Ç +£È£É£Ê£Ë£Ì£Í£Î£Ï£Ð£Ñ£Ò£Ó£Ô£Õ£Ö£×£Ø£Ù£Ú¡¦ +¡¦¡¦¡¦¡¦¡¦£á£â£ã£ä£å£æ£ç£è£é£ê£ë£ì£í£î£ï +£ð£ñ£ò£ó£ô£õ£ö£÷£ø£ù£ú¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ +¤´¤µ¤¶¤·¤¸¤¹¤º¤»¤¼¤½¤¾¤¿¤À¤Á¤Â¤Ã¤Ä¤Å¤Æ¤Ç +¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û +¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï +¤ð¤ñ¤ò¤ó¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³ +¥´¥µ¥¶¥·¥¸¥¹¥º¥»¥¼¥½¥¾¥¿¥À¥Á¥Â¥Ã¥Ä¥Å¥Æ¥Ç +¥È¥É¥Ê¥Ë¥Ì¥Í¥Î¥Ï¥Ð¥Ñ¥Ò¥Ó¥Ô¥Õ¥Ö¥×¥Ø¥Ù¥Ú¥Û +¥Ü¥Ý¥Þ¥ß¥à¥á¥â¥ã¥ä¥å¥æ¥ç¥è¥é¥ê¥ë¥ì¥í¥î¥ï +¥ð¥ñ¥ò¥ó¥ô¥õ¥ö¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¦¡¦¢¦£¦¤¦¥¦¦¦§¦¨¦©¦ª¦«¦¬¦­¦®¦¯¦°¦±¦²¦³ +¦´¦µ¦¶¦·¦¸¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¦Á¦Â¦Ã¦Ä¦Å¦Æ¦Ç +¦È¦É¦Ê¦Ë¦Ì¦Í¦Î¦Ï¦Ð¦Ñ¦Ò¦Ó¦Ô¦Õ¦Ö¦×¦Ø¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦§¡§¢§£§¤§¥§¦§§§¨§©§ª§«§¬§­§®§¯§°§±§²§³ +§´§µ§¶§·§¸§¹§º§»§¼§½§¾§¿§À§Á¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Ñ§Ò§Ó§Ô§Õ§Ö§×§Ø§Ù§Ú§Û +§Ü§Ý§Þ§ß§à§á§â§ã§ä§å§æ§ç§è§é§ê§ë§ì§í§î§ï +§ð§ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¨¡¨¢¨£¨¤¨¥¨¦¨§¨¨¨©¨ª¨«¨¬¨­¨®¨¯¨°¨±¨²¨³ +¨´¨µ¨¶¨·¨¸¨¹¨º¨»¨¼¨½¨¾¨¿¨À¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï +°ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ +¡¦Ï¡Ï¢Ï£Ï¤Ï¥Ï¦Ï§Ï¨Ï©ÏªÏ«Ï¬Ï­Ï®Ï¯Ï°Ï±Ï²Ï³ +ϴϵ϶ϷϸϹϺϻϼϽϾϿÏÀÏÁÏÂÏÃÏÄÏÅÏÆÏÇ +ÏÈÏÉÏÊÏËÏÌÏÍÏÎÏÏÏÐÏÑÏÒÏÓ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³ +дежзийклмнопÐÀÐÁÐÂÐÃÐÄÐÅÐÆÐÇ +ÐÈÐÉÐÊÐËÐÌÐÍÐÎÐÏÐÐÐÑÐÒÐÓÐÔÐÕÐÖÐ×ÐØÐÙÐÚÐÛ +ÐÜÐÝÐÞÐßÐàÐáÐâÐãÐäÐåÐæÐçÐèÐéÐêÐëÐìÐíÐîÐï +ÐðÐñÐòÐóÐôÐõÐöÐ÷ÐøÐùÐúÐûÐüÐýÐþ¡¦¡¦¡¦¡¦¡¦ +¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³ +ó´óµó¶ó·ó¸ó¹óºó»ó¼ó½ó¾ó¿óÀóÁóÂóÃóÄóÅóÆóÇ +óÈóÉóÊóËóÌóÍóÎóÏóÐóÑóÒóÓóÔóÕóÖó×óØóÙóÚóÛ +óÜóÝóÞóßóàóáóâóãóäóåóæóçóèóéóêóëóìóíóîóï +óðóñóòóóóôóõóöó÷óøóùóúóûóüóýóþ¡¦¡¦¡¦¡¦¡¦ +¡¦ô¡ô¢ô£ô¤ô¥ô¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +SELECT * FROM `£Ô£¹`; +c1 +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢¯¢°¢±¢²¢³ +¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢ë¢ì¢í¢î¢ï +¢ð¢ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¦á¦â¦ã¦ä¦å¡¦¦ç¡¦¦é¦ê¡¦¦ì¡¦¡¦¡¦ +¡¦¦ñ¦ò¦ó¦ô¦õ¦ö¦÷¦ø¦ù¦ú¦û¦ü¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Â§Ã§Ä§Å§Æ§Ç +§È§É§Ê§Ë§Ì§Í§Î¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦§ò§ó§ô§õ§ö§÷§ø§ù§ú§û§ü§ý§þ¡¦¡¦¡¦¡¦¡¦ +¡¦©¡©¢¡¦©¤¡¦©¦¡¦©¨©©¡¦©«©¬©­¡¦©¯©°¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦©Á©Â©Ã©Ä©Å©Æ©Ç +©È©É©Ê©Ë©Ì©Í©Î©Ï©Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦ª¡ª¢ª£ª¤ª¥ª¦ª§ª¨ª©ªªª«ª¬ª­ª®ª¯ª°ª±ª²ª³ +ª´ªµª¶ª·ª¸¡¦ªºª»ª¼ª½ª¾ª¿ªÀªÁªÂªÃªÄªÅªÆªÇ +ªÈªÉªÊªËªÌªÍªÎªÏªÐªÑªÒªÓªÔªÕªÖª×ªØªÙªÚªÛ +ªÜªÝªÞªßªàªáªâªãªäªåªæªçªèªéªêªëªìªíªîªï +ªðªñªòªóªôªõªöª÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦«¡«¢«£«¤«¥«¦«§«¨«©«ª«««¬«­«®«¯«°«±«²«³ +«´«µ«¶«·«¸«¹«º«»¡¦«½«¾«¿«À«Á«Â«Ã¡¦«Å«Æ«Ç +«È«É«Ê«Ë«Ì«Í«Î«Ï«Ð«Ñ«Ò«Ó«Ô«Õ«Ö«×«Ø«Ù«Ú«Û +«Ü«Ý«Þ«ß«à«á«â«ã«ä«å«æ«ç«è«é«ê«ë«ì«í«î«ï +«ð«ñ«ò«ó«ô«õ«ö«÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï +°ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ +¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³ +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ +íÜíÝíÞíßíàíáíâí㡦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +SELECT * FROM `£Ô£±£°`; +c1 + !"#$%&'()*+,-./ +0123456789:;<=>? +@ABCDEFGHIJKLMNO +PQRSTUVWXYZ[\]^_ +abcdefghijklmno +pqrstuvwxyz{|}~ + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯ +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ +ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß +SELECT * FROM `£Ô£±£±`; +c1 +¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡­¡®¡¯¡°¡±¡²¡³ +¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç +¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û +¡Ü¡¾¡Þ¡ß¡à¡á¡â¡ã¡ä¡å¡æ¡ç¡è¡é¡ê¡ë¡ì¡í¡î¡ï +¡ð¡ñ¡ò¡ó¡ô¡õ¡ö¡÷¡ø¡ù¡ú¡û¡ü¡ý¡þ¡¦¡¦¡¦¡¦¡¦ +¡¦¢¡¢¢¢£¢¤¢¥¢¦¢§¢¨¢©¢ª¢«¢¬¢­¢®¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¢º¢»¢¼¢½¢¾¢¿¢À¢Á¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¢Ê¢Ë¢Ì¢Í¢Î¢Ï¢Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¢Ü¢Ý¢Þ¢ß¢à¢á¢â¢ã¢ä¢å¢æ¢ç¢è¢é¢ê¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¢ò¢ó¢ô¢õ¢ö¢÷¢ø¢ù¡¦¡¦¡¦¡¦¢þ¡¦¡¦¡¦¡¦¡¡ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦£°£±£²£³ +£´£µ£¶£·£¸£¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦£Á£Â£Ã£Ä£Å£Æ£Ç +£È£É£Ê£Ë£Ì£Í£Î£Ï£Ð£Ñ£Ò£Ó£Ô£Õ£Ö£×£Ø£Ù£Ú¡¦ +¡¦¡¦¡¦¡¦¡¦£á£â£ã£ä£å£æ£ç£è£é£ê£ë£ì£í£î£ï +£ð£ñ£ò£ó£ô£õ£ö£÷£ø£ù£ú¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ +¤´¤µ¤¶¤·¤¸¤¹¤º¤»¤¼¤½¤¾¤¿¤À¤Á¤Â¤Ã¤Ä¤Å¤Æ¤Ç +¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û +¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï +¤ð¤ñ¤ò¤ó¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³ +¥´¥µ¥¶¥·¥¸¥¹¥º¥»¥¼¥½¥¾¥¿¥À¥Á¥Â¥Ã¥Ä¥Å¥Æ¥Ç +¥È¥É¥Ê¥Ë¥Ì¥Í¥Î¥Ï¥Ð¥Ñ¥Ò¥Ó¥Ô¥Õ¥Ö¥×¥Ø¥Ù¥Ú¥Û +¥Ü¥Ý¥Þ¥ß¥à¥á¥â¥ã¥ä¥å¥æ¥ç¥è¥é¥ê¥ë¥ì¥í¥î¥ï +¥ð¥ñ¥ò¥ó¥ô¥õ¥ö¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¦¡¦¢¦£¦¤¦¥¦¦¦§¦¨¦©¦ª¦«¦¬¦­¦®¦¯¦°¦±¦²¦³ +¦´¦µ¦¶¦·¦¸¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¦Á¦Â¦Ã¦Ä¦Å¦Æ¦Ç +¦È¦É¦Ê¦Ë¦Ì¦Í¦Î¦Ï¦Ð¦Ñ¦Ò¦Ó¦Ô¦Õ¦Ö¦×¦Ø¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦§¡§¢§£§¤§¥§¦§§§¨§©§ª§«§¬§­§®§¯§°§±§²§³ +§´§µ§¶§·§¸§¹§º§»§¼§½§¾§¿§À§Á¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Ñ§Ò§Ó§Ô§Õ§Ö§×§Ø§Ù§Ú§Û +§Ü§Ý§Þ§ß§à§á§â§ã§ä§å§æ§ç§è§é§ê§ë§ì§í§î§ï +§ð§ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¨¡¨¢¨£¨¤¨¥¨¦¨§¨¨¨©¨ª¨«¨¬¨­¨®¨¯¨°¨±¨²¨³ +¨´¨µ¨¶¨·¨¸¨¹¨º¨»¨¼¨½¨¾¨¿¨À¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï +°ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ +¡¦Ï¡Ï¢Ï£Ï¤Ï¥Ï¦Ï§Ï¨Ï©ÏªÏ«Ï¬Ï­Ï®Ï¯Ï°Ï±Ï²Ï³ +ϴϵ϶ϷϸϹϺϻϼϽϾϿÏÀÏÁÏÂÏÃÏÄÏÅÏÆÏÇ +ÏÈÏÉÏÊÏËÏÌÏÍÏÎÏÏÏÐÏÑÏÒÏÓ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³ +дежзийклмнопÐÀÐÁÐÂÐÃÐÄÐÅÐÆÐÇ +ÐÈÐÉÐÊÐËÐÌÐÍÐÎÐÏÐÐÐÑÐÒÐÓÐÔÐÕÐÖÐ×ÐØÐÙÐÚÐÛ +ÐÜÐÝÐÞÐßÐàÐáÐâÐãÐäÐåÐæÐçÐèÐéÐêÐëÐìÐíÐîÐï +ÐðÐñÐòÐóÐôÐõÐöÐ÷ÐøÐùÐúÐûÐüÐýÐþ¡¦¡¦¡¦¡¦¡¦ +¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³ +ó´óµó¶ó·ó¸ó¹óºó»ó¼ó½ó¾ó¿óÀóÁóÂóÃóÄóÅóÆóÇ +óÈóÉóÊóËóÌóÍóÎóÏóÐóÑóÒóÓóÔóÕóÖó×óØóÙóÚóÛ +óÜóÝóÞóßóàóáóâóãóäóåóæóçóèóéóêóëóìóíóîóï +óðóñóòóóóôóõóöó÷óøóùóúóûóüóýóþ¡¦¡¦¡¦¡¦¡¦ +¡¦ô¡ô¢ô£ô¤ô¥ô¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +SELECT * FROM `£Ô£±£²`; +c1 +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢¯¢°¢±¢²¢³ +¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢ë¢ì¢í¢î¢ï +¢ð¢ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¦á¦â¦ã¦ä¦å¡¦¦ç¡¦¦é¦ê¡¦¦ì¡¦¡¦¡¦ +¡¦¦ñ¦ò¦ó¦ô¦õ¦ö¦÷¦ø¦ù¦ú¦û¦ü¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Â§Ã§Ä§Å§Æ§Ç +§È§É§Ê§Ë§Ì§Í§Î¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦§ò§ó§ô§õ§ö§÷§ø§ù§ú§û§ü§ý§þ¡¦¡¦¡¦¡¦¡¦ +¡¦©¡©¢¡¦©¤¡¦©¦¡¦©¨©©¡¦©«©¬©­¡¦©¯©°¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦©Á©Â©Ã©Ä©Å©Æ©Ç +©È©É©Ê©Ë©Ì©Í©Î©Ï©Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦ª¡ª¢ª£ª¤ª¥ª¦ª§ª¨ª©ªªª«ª¬ª­ª®ª¯ª°ª±ª²ª³ +ª´ªµª¶ª·ª¸¡¦ªºª»ª¼ª½ª¾ª¿ªÀªÁªÂªÃªÄªÅªÆªÇ +ªÈªÉªÊªËªÌªÍªÎªÏªÐªÑªÒªÓªÔªÕªÖª×ªØªÙªÚªÛ +ªÜªÝªÞªßªàªáªâªãªäªåªæªçªèªéªêªëªìªíªîªï +ªðªñªòªóªôªõªöª÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦«¡«¢«£«¤«¥«¦«§«¨«©«ª«««¬«­«®«¯«°«±«²«³ +«´«µ«¶«·«¸«¹«º«»¡¦«½«¾«¿«À«Á«Â«Ã¡¦«Å«Æ«Ç +«È«É«Ê«Ë«Ì«Í«Î«Ï«Ð«Ñ«Ò«Ó«Ô«Õ«Ö«×«Ø«Ù«Ú«Û +«Ü«Ý«Þ«ß«à«á«â«ã«ä«å«æ«ç«è«é«ê«ë«ì«í«î«ï +«ð«ñ«ò«ó«ô«õ«ö«÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï +°ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ +¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³ +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ +íÜíÝíÞíßíàíáíâí㡦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +drop table `£Ô£±`; +drop table `£Ô£²`; +drop table `£Ô£³`; +drop table `£Ô£´`; +drop table `£Ô£µ`; +drop table `£Ô£¶`; +drop table `£Ô£·`; +drop table `£Ô£¸`; +drop table `£Ô£¹`; +drop table `£Ô£±£°`; +drop table `£Ô£±£±`; +drop table `£Ô£±£²`; diff --git a/mysql-test/suite/jp/r/jp_select_utf8.result b/mysql-test/suite/jp/r/jp_select_utf8.result new file mode 100755 index 00000000000..43704ad2f6e --- /dev/null +++ b/mysql-test/suite/jp/r/jp_select_utf8.result @@ -0,0 +1,538 @@ +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +drop table if exists `T11`; +drop table if exists `T12`; +SET NAMES utf8; +SET character_set_database = utf8; +CREATE TABLE `T1` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T11` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T12` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = utf8 engine = bdb; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_utf8.dat' INTO TABLE `T1`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_utf8.dat' INTO TABLE `ï¼´ï¼’`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_utf8.dat' INTO TABLE `T3`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_utf8.dat' INTO TABLE `ï¼´ï¼”`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_utf8.dat' INTO TABLE `T5`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_utf8.dat' INTO TABLE `ï¼´ï¼–`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_utf8.dat' INTO TABLE `ï¼´ï¼—`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_utf8.dat' INTO TABLE `T8`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_utf8.dat' INTO TABLE `ï¼´ï¼™`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_utf8.dat' INTO TABLE `T1ï¼`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_utf8.dat' INTO TABLE `T11`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_utf8.dat' INTO TABLE `T12`; +SELECT * FROM `T1`; +c1 + !"#$%&'()*+,-./ + 。「」、・ヲァィゥェォャュョッ +0123456789:;<=>? +@ABCDEFGHIJKLMNO +abcdefghijklmno +PQRSTUVWXYZ[\]^_ +pqrstuvwxyz{|}~ +ーアイウエオカキクケコサシスセソ +ï¾€ï¾ï¾‚テトナニヌネノハヒフï¾ï¾Žï¾ +ï¾ï¾‘メモヤユヨラリルレロワï¾ï¾žï¾Ÿ +SELECT * FROM `ï¼´ï¼’`; +c1 +θικλμνξοπÏστυφχψω・・・ +ΥΦΧΨΩ・・・・・・・・αβγδεζη +клмнопрÑÑ‚ÑƒÑ„Ñ…Ñ†Ñ‡ÑˆÑ‰ÑŠÑ‹ÑŒÑ +ТУФХЦЧШЩЪЫЬЭЮЯ・・・・・・ +ÑŽÑ・・・・・・・・・・・・・・・・・・ +“â€ï¼ˆï¼‰ã€”〕[]{ï½ã€ˆã€‰ã€Šã€‹ã€Œã€ã€Žã€ã€ã€‘ +∠⊥⌒∂∇≡≒≪≫√∽âˆâˆµâˆ«âˆ¬ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» +┫┻╋┠┯┨┷┿â”┰┥┸╂・・・・・・・ +  ã€ã€‚,.・:;?ï¼ã‚›ã‚œÂ´ï½€Â¨ï¼¾ï¿£ï¼¿ãƒ½ +ã”ã•ã–ã—ã˜ã™ãšã›ãœããžãŸã ã¡ã¢ã£ã¤ã¥ã¦ã§ +ã¨ã©ãªã«ã¬ã­ã®ã¯ã°ã±ã²ã³ã´ãµã¶ã·ã¸ã¹ãºã» +ã¼ã½ã¾ã¿ã‚€ã‚もゃやゅゆょよらりるれã‚ゎ゠+ã‚ゑをん・・・・・・・・・・・・・・・・ +ゴサザシジスズセゼソゾタダãƒãƒ‚ッツヅテデ +トドナニヌãƒãƒŽãƒãƒãƒ‘ヒビピフブプヘベペホ +ボãƒãƒžãƒŸãƒ ãƒ¡ãƒ¢ãƒ£ãƒ¤ãƒ¥ãƒ¦ãƒ§ãƒ¨ãƒ©ãƒªãƒ«ãƒ¬ãƒ­ãƒ®ãƒ¯ +ヰヱヲンヴヵヶ・・・・・・・・・・・・・ +・ΑΒΓΔΕΖΗΘΙΚΛΜÎΞΟΠΡΣΤ +・ÐБВГДЕÐЖЗИЙКЛМÐОПРС +・─│┌â”┘└├┬┤┴┼â”┃â”┓┛┗┣┳ +・◆□■△▲▽▼※〒→â†â†‘↓〓・・・・・ +・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“ +・ァアィイゥウェエォオカガキギクグケゲコ +・・ʼn♯♭♪†‡¶・・・・◯・・・・  +・・∧∨¬⇒⇔∀∃・・・・・・・・・・・ +・・・・・・∈∋⊆⊇⊂⊃∪∩・・・・・・ +・・・・・・・・・абвгдеёжзий +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・ï¼ï¼‘23 +・・・・・ï½ï½‚cdefghijklï½ï½Žï½ +ãƒ»äºœå”–å¨ƒé˜¿å“€æ„›æŒ¨å§¶é€¢è‘µèŒœç©æ‚ªæ¡æ¸¥æ—­è‘¦èЦ靵 +・堯槇é™ç‘¤å‡œç†™ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» +・弌ä¸ä¸•个丱丶丼丿乂乖乘亂亅豫亊舒å¼äºŽäºž +・蓮連錬呂魯櫓炉賂路露労å©å»Šå¼„æœ—æ¥¼æ¦”æµªæ¼ +・éµéµžéµ¤éµ‘éµéµ™éµ²é¶‰é¶‡é¶«éµ¯éµºé¶šé¶¤é¶©é¶²é·„é·é¶» +ヾã‚ゞ〃ä»ã€…〆〇ー―â€ï¼ï¼¼ã€œâ€–|…‥‘’ +亟亠亢亰亳亶从ä»ä»„仆仂仗仞仭仟价伉佚估佛 +ä½ä½—佇佶侈ä¾ä¾˜ä½»ä½©ä½°ä¾‘佯來侖儘俔俟俎俘俛 +俑俚ä¿ä¿¤ä¿¥å€šå€¨å€”倪倥倅伜俶倡倩倬俾俯們倆 +åƒå‡æœƒå•ååˆåšå–å¬å¸å‚€å‚šå‚…傴傲・・・・・ +枠鷲亙亘é°è©«è—蕨椀湾碗腕・・・・・・・・ +梓圧斡扱宛å§è™»é£´çµ¢ç¶¾é®Žæˆ–粟袷安庵按暗案闇 +牢狼篭è€è¾è‹éƒŽå…­éº“禄肋録論倭和話歪賄脇惑 +移維緯胃èŽè¡£è¬‚é•éºåŒ»äº•亥域育éƒç£¯ä¸€å£±æº¢é€¸ +稲茨芋鰯å…å°å’½å“¡å› å§»å¼•飲淫胤蔭・・・・・ +éžæä»¥ä¼Šä½ä¾å‰å›²å¤·å§”å¨å°‰æƒŸæ„慰易椅為ç•ç•° +鶸鶺鷆é·é·‚鷙鷓鷸鷦鷭鷯鷽鸚鸛鸞鹵鹹鹽éºéºˆ +麋麌麒麕麑éºéº¥éº©éº¸éºªéº­é¡é»Œé»Žé»é»é»”é»œé»žé» +黠黥黨黯黴黶黷黹黻黼黽鼇鼈皷鼕鼡鼬鼾齊齒 +齔齣齟齠齡齦齧齬齪齷齲齶龕龜龠・・・・・ +$¢£%#&*@§☆★○â—◎◇・・・・・ ++â€Â±Ã—÷ï¼â‰ ï¼œï¼žâ‰¦â‰§âˆžâˆ´â™‚♀°′″℃¥ +456789・・・・・・・ABCDEFG +HIJKLMNOPQRSTUVWXYZ・ +ï½ï½‘rstuvwxyz・・・・・・・・・ +SELECT * FROM `T3`; +c1 +êěėēęǵÄğ・ġĥíìïîÇ・īįĩ +ÊĚĖĒĘ・ĜĞĢĠĤÃÃŒÃÃŽÇİĪĮĨ +ĴĶĹĽĻŃŇŅÑÓÒÖÔǑÅŌÕŔŘŖ +ĵķĺľļńňņñóòöôǒőÅõŕřŗ +ŚŜŠŞŤŢÚÙÜÛŬǓŰŪŲŮŨǗǛǙ +śŚşťţúùüûŭǔűūųůũǘǜǚ +ǕŴßŶŹŽŻ・・・・・・・・・・・・ +ǖŵýÿŷźžż・・・・・・・・・・・・ +¤№・・・・・・・・・・・・・・・・・・ +łŀʼnŋøœßŧþ・・・・・・・・・・・ +ЈЉЊЋЌЎÐ・・・・・・・・・・・・・ +・ÃÀÄÂĂÇĀĄÅÃĆĈČÇĊĎÉÈË +・áàäâăǎÄąåãćĉÄçċÄéèë +・ÆÄ・Ħ・IJ・ÅĿ・ŊØŒ・ŦÞ・・・ +・˛˚~΄΅・・・・・・・・¡¦¿・・・ +・άέήίϊÎόςÏϋΰώ・・・・・・・ +・・ђѓєѕіїјљњћќўџ・・・・・ +・・・・・ΆΈΉΊΪ・Ό・ΎΫ・Î・・・ +・・・・・・・・・・・・・æđðħıijĸ +・・・・・・・・・・・・・・ЂЃЄЅІЇ +・・・・・・・・・・・・・・・ºª©®™ +ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»Ë˜Ë‡Â¸Ë™Ë +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・丂丄丅丌丒丟丣两丨丫丮丯丰丵乀ä¹ä¹„乇乑 +・黸黿鼂鼃鼉é¼é¼é¼‘鼒鼔鼖鼗鼙鼚鼛鼟鼢鼦鼪 +乚乜乣乨乩乴乵乹乿äºäº–亗äºäº¯äº¹ä»ƒä»ä»šä»›ä»  +仡仢仨仯仱仳仵份仾仿伀伂伃伈伋伌伒伕伖众 +伙伮伱你伳伵伷伹伻伾佀佂佈佉佋佌佒佔佖佘 +佟佣佪佬佮佱佷佸佹佺佽佾ä¾ä¾‚侄・・・・・ +鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 +齗齘齚é½é½žé½¨é½©é½­é½®é½¯é½°é½±é½³é½µé½ºé½½é¾é¾é¾‘é¾’ +龔龖龗龞龡龢龣龥・・・・・・・・・・・・ +SELECT * FROM `ï¼´ï¼”`; +c1 + !"#$%&'()*+,-./ + 。「」、・ヲァィゥェォャュョッ +0123456789:;<=>? +@ABCDEFGHIJKLMNO +abcdefghijklmno +PQRSTUVWXYZ[\]^_ +pqrstuvwxyz{|}~ +ーアイウエオカキクケコサシスセソ +ï¾€ï¾ï¾‚テトナニヌネノハヒフï¾ï¾Žï¾ +ï¾ï¾‘メモヤユヨラリルレロワï¾ï¾žï¾Ÿ +SELECT * FROM `T5`; +c1 +θικλμνξοπÏστυφχψω・・・ +ΥΦΧΨΩ・・・・・・・・αβγδεζη +клмнопрÑÑ‚ÑƒÑ„Ñ…Ñ†Ñ‡ÑˆÑ‰ÑŠÑ‹ÑŒÑ +ТУФХЦЧШЩЪЫЬЭЮЯ・・・・・・ +ÑŽÑ・・・・・・・・・・・・・・・・・・ +“â€ï¼ˆï¼‰ã€”〕[]{ï½ã€ˆã€‰ã€Šã€‹ã€Œã€ã€Žã€ã€ã€‘ +∠⊥⌒∂∇≡≒≪≫√∽âˆâˆµâˆ«âˆ¬ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» +┫┻╋┠┯┨┷┿â”┰┥┸╂・・・・・・・ +  ã€ã€‚,.・:;?ï¼ã‚›ã‚œÂ´ï½€Â¨ï¼¾ï¿£ï¼¿ãƒ½ +ã”ã•ã–ã—ã˜ã™ãšã›ãœããžãŸã ã¡ã¢ã£ã¤ã¥ã¦ã§ +ã¨ã©ãªã«ã¬ã­ã®ã¯ã°ã±ã²ã³ã´ãµã¶ã·ã¸ã¹ãºã» +ã¼ã½ã¾ã¿ã‚€ã‚もゃやゅゆょよらりるれã‚ゎ゠+ã‚ゑをん・・・・・・・・・・・・・・・・ +ゴサザシジスズセゼソゾタダãƒãƒ‚ッツヅテデ +トドナニヌãƒãƒŽãƒãƒãƒ‘ヒビピフブプヘベペホ +ボãƒãƒžãƒŸãƒ ãƒ¡ãƒ¢ãƒ£ãƒ¤ãƒ¥ãƒ¦ãƒ§ãƒ¨ãƒ©ãƒªãƒ«ãƒ¬ãƒ­ãƒ®ãƒ¯ +ヰヱヲンヴヵヶ・・・・・・・・・・・・・ +・ΑΒΓΔΕΖΗΘΙΚΛΜÎΞΟΠΡΣΤ +・ÐБВГДЕÐЖЗИЙКЛМÐОПРС +・─│┌â”┘└├┬┤┴┼â”┃â”┓┛┗┣┳ +・◆□■△▲▽▼※〒→â†â†‘↓〓・・・・・ +・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“ +・ァアィイゥウェエォオカガキギクグケゲコ +・・ʼn♯♭♪†‡¶・・・・◯・・・・  +・・∧∨¬⇒⇔∀∃・・・・・・・・・・・ +・・・・・・∈∋⊆⊇⊂⊃∪∩・・・・・・ +・・・・・・・・・абвгдеёжзий +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・ï¼ï¼‘23 +・・・・・ï½ï½‚cdefghijklï½ï½Žï½ +ãƒ»äºœå”–å¨ƒé˜¿å“€æ„›æŒ¨å§¶é€¢è‘µèŒœç©æ‚ªæ¡æ¸¥æ—­è‘¦èЦ靵 +・堯槇é™ç‘¤å‡œç†™ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» +・弌ä¸ä¸•个丱丶丼丿乂乖乘亂亅豫亊舒å¼äºŽäºž +・蓮連錬呂魯櫓炉賂路露労å©å»Šå¼„æœ—æ¥¼æ¦”æµªæ¼ +・éµéµžéµ¤éµ‘éµéµ™éµ²é¶‰é¶‡é¶«éµ¯éµºé¶šé¶¤é¶©é¶²é·„é·é¶» +ヾã‚ゞ〃ä»ã€…〆〇ー―â€ï¼ï¼¼ã€œâ€–|…‥‘’ +亟亠亢亰亳亶从ä»ä»„仆仂仗仞仭仟价伉佚估佛 +ä½ä½—佇佶侈ä¾ä¾˜ä½»ä½©ä½°ä¾‘佯來侖儘俔俟俎俘俛 +俑俚ä¿ä¿¤ä¿¥å€šå€¨å€”倪倥倅伜俶倡倩倬俾俯們倆 +åƒå‡æœƒå•ååˆåšå–å¬å¸å‚€å‚šå‚…傴傲・・・・・ +枠鷲亙亘é°è©«è—蕨椀湾碗腕・・・・・・・・ +梓圧斡扱宛å§è™»é£´çµ¢ç¶¾é®Žæˆ–粟袷安庵按暗案闇 +牢狼篭è€è¾è‹éƒŽå…­éº“禄肋録論倭和話歪賄脇惑 +移維緯胃èŽè¡£è¬‚é•éºåŒ»äº•亥域育éƒç£¯ä¸€å£±æº¢é€¸ +稲茨芋鰯å…å°å’½å“¡å› å§»å¼•飲淫胤蔭・・・・・ +éžæä»¥ä¼Šä½ä¾å‰å›²å¤·å§”å¨å°‰æƒŸæ„慰易椅為ç•ç•° +鶸鶺鷆é·é·‚鷙鷓鷸鷦鷭鷯鷽鸚鸛鸞鹵鹹鹽éºéºˆ +麋麌麒麕麑éºéº¥éº©éº¸éºªéº­é¡é»Œé»Žé»é»é»”é»œé»žé» +黠黥黨黯黴黶黷黹黻黼黽鼇鼈皷鼕鼡鼬鼾齊齒 +齔齣齟齠齡齦齧齬齪齷齲齶龕龜龠・・・・・ +$¢£%#&*@§☆★○â—◎◇・・・・・ ++â€Â±Ã—÷ï¼â‰ ï¼œï¼žâ‰¦â‰§âˆžâˆ´â™‚♀°′″℃¥ +456789・・・・・・・ABCDEFG +HIJKLMNOPQRSTUVWXYZ・ +ï½ï½‘rstuvwxyz・・・・・・・・・ +SELECT * FROM `ï¼´ï¼–`; +c1 +êěėēęǵÄğ・ġĥíìïîÇ・īįĩ +ÊĚĖĒĘ・ĜĞĢĠĤÃÃŒÃÃŽÇİĪĮĨ +ĴĶĹĽĻŃŇŅÑÓÒÖÔǑÅŌÕŔŘŖ +ĵķĺľļńňņñóòöôǒőÅõŕřŗ +ŚŜŠŞŤŢÚÙÜÛŬǓŰŪŲŮŨǗǛǙ +śŚşťţúùüûŭǔűūųůũǘǜǚ +ǕŴßŶŹŽŻ・・・・・・・・・・・・ +ǖŵýÿŷźžż・・・・・・・・・・・・ +¤№・・・・・・・・・・・・・・・・・・ +łŀʼnŋøœßŧþ・・・・・・・・・・・ +ЈЉЊЋЌЎÐ・・・・・・・・・・・・・ +・ÃÀÄÂĂÇĀĄÅÃĆĈČÇĊĎÉÈË +・áàäâăǎÄąåãćĉÄçċÄéèë +・ÆÄ・Ħ・IJ・ÅĿ・ŊØŒ・ŦÞ・・・ +・˛˚~΄΅・・・・・・・・¡¦¿・・・ +・άέήίϊÎόςÏϋΰώ・・・・・・・ +・・ђѓєѕіїјљњћќўџ・・・・・ +・・・・・ΆΈΉΊΪ・Ό・ΎΫ・Î・・・ +・・・・・・・・・・・・・æđðħıijĸ +・・・・・・・・・・・・・・ЂЃЄЅІЇ +・・・・・・・・・・・・・・・ºª©®™ +ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»Ë˜Ë‡Â¸Ë™Ë +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・丂丄丅丌丒丟丣两丨丫丮丯丰丵乀ä¹ä¹„乇乑 +・黸黿鼂鼃鼉é¼é¼é¼‘鼒鼔鼖鼗鼙鼚鼛鼟鼢鼦鼪 +乚乜乣乨乩乴乵乹乿äºäº–亗äºäº¯äº¹ä»ƒä»ä»šä»›ä»  +仡仢仨仯仱仳仵份仾仿伀伂伃伈伋伌伒伕伖众 +伙伮伱你伳伵伷伹伻伾佀佂佈佉佋佌佒佔佖佘 +佟佣佪佬佮佱佷佸佹佺佽佾ä¾ä¾‚侄・・・・・ +鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 +齗齘齚é½é½žé½¨é½©é½­é½®é½¯é½°é½±é½³é½µé½ºé½½é¾é¾é¾‘é¾’ +龔龖龗龞龡龢龣龥・・・・・・・・・・・・ +SELECT * FROM `ï¼´ï¼—`; +c1 + !"#$%&'()*+,-./ +0123456789:;<=>? +@ABCDEFGHIJKLMNO +PQRSTUVWXYZ[\]^_ +abcdefghijklmno +pqrstuvwxyz{|}~ + 。「」、・ヲァィゥェォャュョッ +ーアイウエオカキクケコサシスセソ +ï¾€ï¾ï¾‚テトナニヌネノハヒフï¾ï¾Žï¾ +ï¾ï¾‘メモヤユヨラリルレロワï¾ï¾žï¾Ÿ +SELECT * FROM `T8`; +c1 +  ã€ã€‚,.・:;?ï¼ã‚›ã‚œÂ´ï½€Â¨ï¼¾ï¿£ï¼¿ãƒ½ +ヾã‚ゞ〃ä»ã€…〆〇ー―â€ï¼ï¼¼ã€œâ€–|…‥‘’ +“â€ï¼ˆï¼‰ã€”〕[]{ï½ã€ˆã€‰ã€Šã€‹ã€Œã€ã€Žã€ã€ã€‘ ++â€Â±Ã—÷ï¼â‰ ï¼œï¼žâ‰¦â‰§âˆžâˆ´â™‚♀°′″℃¥ +$¢£%#&*@§☆★○â—◎◇・・・・・ +・◆□■△▲▽▼※〒→â†â†‘↓〓・・・・・ +・・・・・・∈∋⊆⊇⊂⊃∪∩・・・・・・ +・・∧∨¬⇒⇔∀∃・・・・・・・・・・・ +∠⊥⌒∂∇≡≒≪≫√∽âˆâˆµâˆ«âˆ¬ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» +・・ʼn♯♭♪†‡¶・・・・◯・・・・  +・・・・・・・・・・・・・・・・ï¼ï¼‘23 +456789・・・・・・・ABCDEFG +HIJKLMNOPQRSTUVWXYZ・ +・・・・・ï½ï½‚cdefghijklï½ï½Žï½ +ï½ï½‘rstuvwxyz・・・・・・・・・ +・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“ +ã”ã•ã–ã—ã˜ã™ãšã›ãœããžãŸã ã¡ã¢ã£ã¤ã¥ã¦ã§ +ã¨ã©ãªã«ã¬ã­ã®ã¯ã°ã±ã²ã³ã´ãµã¶ã·ã¸ã¹ãºã» +ã¼ã½ã¾ã¿ã‚€ã‚もゃやゅゆょよらりるれã‚ゎ゠+ã‚ゑをん・・・・・・・・・・・・・・・・ +・ァアィイゥウェエォオカガキギクグケゲコ +ゴサザシジスズセゼソゾタダãƒãƒ‚ッツヅテデ +トドナニヌãƒãƒŽãƒãƒãƒ‘ヒビピフブプヘベペホ +ボãƒãƒžãƒŸãƒ ãƒ¡ãƒ¢ãƒ£ãƒ¤ãƒ¥ãƒ¦ãƒ§ãƒ¨ãƒ©ãƒªãƒ«ãƒ¬ãƒ­ãƒ®ãƒ¯ +ヰヱヲンヴヵヶ・・・・・・・・・・・・・ +・ΑΒΓΔΕΖΗΘΙΚΛΜÎΞΟΠΡΣΤ +ΥΦΧΨΩ・・・・・・・・αβγδεζη +θικλμνξοπÏστυφχψω・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・ÐБВГДЕÐЖЗИЙКЛМÐОПРС +ТУФХЦЧШЩЪЫЬЭЮЯ・・・・・・ +・・・・・・・・・абвгдеёжзий +клмнопрÑÑ‚ÑƒÑ„Ñ…Ñ†Ñ‡ÑˆÑ‰ÑŠÑ‹ÑŒÑ +ÑŽÑ・・・・・・・・・・・・・・・・・・ +・─│┌â”┘└├┬┤┴┼â”┃â”┓┛┗┣┳ +┫┻╋┠┯┨┷┿â”┰┥┸╂・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +ãƒ»äºœå”–å¨ƒé˜¿å“€æ„›æŒ¨å§¶é€¢è‘µèŒœç©æ‚ªæ¡æ¸¥æ—­è‘¦èЦ靵 +梓圧斡扱宛å§è™»é£´çµ¢ç¶¾é®Žæˆ–粟袷安庵按暗案闇 +éžæä»¥ä¼Šä½ä¾å‰å›²å¤·å§”å¨å°‰æƒŸæ„慰易椅為ç•ç•° +移維緯胃èŽè¡£è¬‚é•éºåŒ»äº•亥域育éƒç£¯ä¸€å£±æº¢é€¸ +稲茨芋鰯å…å°å’½å“¡å› å§»å¼•飲淫胤蔭・・・・・ +・蓮連錬呂魯櫓炉賂路露労å©å»Šå¼„æœ—æ¥¼æ¦”æµªæ¼ +牢狼篭è€è¾è‹éƒŽå…­éº“禄肋録論倭和話歪賄脇惑 +枠鷲亙亘é°è©«è—蕨椀湾碗腕・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・弌ä¸ä¸•个丱丶丼丿乂乖乘亂亅豫亊舒å¼äºŽäºž +亟亠亢亰亳亶从ä»ä»„仆仂仗仞仭仟价伉佚估佛 +ä½ä½—佇佶侈ä¾ä¾˜ä½»ä½©ä½°ä¾‘佯來侖儘俔俟俎俘俛 +俑俚ä¿ä¿¤ä¿¥å€šå€¨å€”倪倥倅伜俶倡倩倬俾俯們倆 +åƒå‡æœƒå•ååˆåšå–å¬å¸å‚€å‚šå‚…傴傲・・・・・ +・éµéµžéµ¤éµ‘éµéµ™éµ²é¶‰é¶‡é¶«éµ¯éµºé¶šé¶¤é¶©é¶²é·„é·é¶» +鶸鶺鷆é·é·‚鷙鷓鷸鷦鷭鷯鷽鸚鸛鸞鹵鹹鹽éºéºˆ +麋麌麒麕麑éºéº¥éº©éº¸éºªéº­é¡é»Œé»Žé»é»é»”é»œé»žé» +黠黥黨黯黴黶黷黹黻黼黽鼇鼈皷鼕鼡鼬鼾齊齒 +齔齣齟齠齡齦齧齬齪齷齲齶龕龜龠・・・・・ +・堯槇é™ç‘¤å‡œç†™ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +SELECT * FROM `ï¼´ï¼™`; +c1 +ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»Ë˜Ë‡Â¸Ë™Ë +・˛˚~΄΅・・・・・・・・¡¦¿・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・ºª©®™ +¤№・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・ΆΈΉΊΪ・Ό・ΎΫ・Î・・・ +・άέήίϊÎόςÏϋΰώ・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・ЂЃЄЅІЇ +ЈЉЊЋЌЎÐ・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・ђѓєѕіїјљњћќўџ・・・・・ +・ÆÄ・Ħ・IJ・ÅĿ・ŊØŒ・ŦÞ・・・ +・・・・・・・・・・・・・æđðħıijĸ +łŀʼnŋøœßŧþ・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・ÃÀÄÂĂÇĀĄÅÃĆĈČÇĊĎÉÈË +ÊĚĖĒĘ・ĜĞĢĠĤÃÃŒÃÃŽÇİĪĮĨ +ĴĶĹĽĻŃŇŅÑÓÒÖÔǑÅŌÕŔŘŖ +ŚŜŠŞŤŢÚÙÜÛŬǓŰŪŲŮŨǗǛǙ +ǕŴßŶŹŽŻ・・・・・・・・・・・・ +・áàäâăǎÄąåãćĉÄçċÄéèë +êěėēęǵÄğ・ġĥíìïîÇ・īįĩ +ĵķĺľļńňņñóòöôǒőÅõŕřŗ +śŚşťţúùüûŭǔűūųůũǘǜǚ +ǖŵýÿŷźžż・・・・・・・・・・・・ +・丂丄丅丌丒丟丣两丨丫丮丯丰丵乀ä¹ä¹„乇乑 +乚乜乣乨乩乴乵乹乿äºäº–亗äºäº¯äº¹ä»ƒä»ä»šä»›ä»  +仡仢仨仯仱仳仵份仾仿伀伂伃伈伋伌伒伕伖众 +伙伮伱你伳伵伷伹伻伾佀佂佈佉佋佌佒佔佖佘 +佟佣佪佬佮佱佷佸佹佺佽佾ä¾ä¾‚侄・・・・・ +・黸黿鼂鼃鼉é¼é¼é¼‘鼒鼔鼖鼗鼙鼚鼛鼟鼢鼦鼪 +鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 +齗齘齚é½é½žé½¨é½©é½­é½®é½¯é½°é½±é½³é½µé½ºé½½é¾é¾é¾‘é¾’ +龔龖龗龞龡龢龣龥・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +SELECT * FROM `T1ï¼`; +c1 + !"#$%&'()*+,-./ +0123456789:;<=>? +@ABCDEFGHIJKLMNO +PQRSTUVWXYZ[\]^_ +abcdefghijklmno +pqrstuvwxyz{|}~ + 。「」、・ヲァィゥェォャュョッ +ーアイウエオカキクケコサシスセソ +ï¾€ï¾ï¾‚テトナニヌネノハヒフï¾ï¾Žï¾ +ï¾ï¾‘メモヤユヨラリルレロワï¾ï¾žï¾Ÿ +SELECT * FROM `T11`; +c1 +  ã€ã€‚,.・:;?ï¼ã‚›ã‚œÂ´ï½€Â¨ï¼¾ï¿£ï¼¿ãƒ½ +ヾã‚ゞ〃ä»ã€…〆〇ー―â€ï¼ï¼¼ã€œâ€–|…‥‘’ +“â€ï¼ˆï¼‰ã€”〕[]{ï½ã€ˆã€‰ã€Šã€‹ã€Œã€ã€Žã€ã€ã€‘ ++â€Â±Ã—÷ï¼â‰ ï¼œï¼žâ‰¦â‰§âˆžâˆ´â™‚♀°′″℃¥ +$¢£%#&*@§☆★○â—◎◇・・・・・ +・◆□■△▲▽▼※〒→â†â†‘↓〓・・・・・ +・・・・・・∈∋⊆⊇⊂⊃∪∩・・・・・・ +・・∧∨¬⇒⇔∀∃・・・・・・・・・・・ +∠⊥⌒∂∇≡≒≪≫√∽âˆâˆµâˆ«âˆ¬ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» +・・ʼn♯♭♪†‡¶・・・・◯・・・・  +・・・・・・・・・・・・・・・・ï¼ï¼‘23 +456789・・・・・・・ABCDEFG +HIJKLMNOPQRSTUVWXYZ・ +・・・・・ï½ï½‚cdefghijklï½ï½Žï½ +ï½ï½‘rstuvwxyz・・・・・・・・・ +・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“ +ã”ã•ã–ã—ã˜ã™ãšã›ãœããžãŸã ã¡ã¢ã£ã¤ã¥ã¦ã§ +ã¨ã©ãªã«ã¬ã­ã®ã¯ã°ã±ã²ã³ã´ãµã¶ã·ã¸ã¹ãºã» +ã¼ã½ã¾ã¿ã‚€ã‚もゃやゅゆょよらりるれã‚ゎ゠+ã‚ゑをん・・・・・・・・・・・・・・・・ +・ァアィイゥウェエォオカガキギクグケゲコ +ゴサザシジスズセゼソゾタダãƒãƒ‚ッツヅテデ +トドナニヌãƒãƒŽãƒãƒãƒ‘ヒビピフブプヘベペホ +ボãƒãƒžãƒŸãƒ ãƒ¡ãƒ¢ãƒ£ãƒ¤ãƒ¥ãƒ¦ãƒ§ãƒ¨ãƒ©ãƒªãƒ«ãƒ¬ãƒ­ãƒ®ãƒ¯ +ヰヱヲンヴヵヶ・・・・・・・・・・・・・ +・ΑΒΓΔΕΖΗΘΙΚΛΜÎΞΟΠΡΣΤ +ΥΦΧΨΩ・・・・・・・・αβγδεζη +θικλμνξοπÏστυφχψω・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・ÐБВГДЕÐЖЗИЙКЛМÐОПРС +ТУФХЦЧШЩЪЫЬЭЮЯ・・・・・・ +・・・・・・・・・абвгдеёжзий +клмнопрÑÑ‚ÑƒÑ„Ñ…Ñ†Ñ‡ÑˆÑ‰ÑŠÑ‹ÑŒÑ +ÑŽÑ・・・・・・・・・・・・・・・・・・ +・─│┌â”┘└├┬┤┴┼â”┃â”┓┛┗┣┳ +┫┻╋┠┯┨┷┿â”┰┥┸╂・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +ãƒ»äºœå”–å¨ƒé˜¿å“€æ„›æŒ¨å§¶é€¢è‘µèŒœç©æ‚ªæ¡æ¸¥æ—­è‘¦èЦ靵 +梓圧斡扱宛å§è™»é£´çµ¢ç¶¾é®Žæˆ–粟袷安庵按暗案闇 +éžæä»¥ä¼Šä½ä¾å‰å›²å¤·å§”å¨å°‰æƒŸæ„慰易椅為ç•ç•° +移維緯胃èŽè¡£è¬‚é•éºåŒ»äº•亥域育éƒç£¯ä¸€å£±æº¢é€¸ +稲茨芋鰯å…å°å’½å“¡å› å§»å¼•飲淫胤蔭・・・・・ +・蓮連錬呂魯櫓炉賂路露労å©å»Šå¼„æœ—æ¥¼æ¦”æµªæ¼ +牢狼篭è€è¾è‹éƒŽå…­éº“禄肋録論倭和話歪賄脇惑 +枠鷲亙亘é°è©«è—蕨椀湾碗腕・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・弌ä¸ä¸•个丱丶丼丿乂乖乘亂亅豫亊舒å¼äºŽäºž +亟亠亢亰亳亶从ä»ä»„仆仂仗仞仭仟价伉佚估佛 +ä½ä½—佇佶侈ä¾ä¾˜ä½»ä½©ä½°ä¾‘佯來侖儘俔俟俎俘俛 +俑俚ä¿ä¿¤ä¿¥å€šå€¨å€”倪倥倅伜俶倡倩倬俾俯們倆 +åƒå‡æœƒå•ååˆåšå–å¬å¸å‚€å‚šå‚…傴傲・・・・・ +・éµéµžéµ¤éµ‘éµéµ™éµ²é¶‰é¶‡é¶«éµ¯éµºé¶šé¶¤é¶©é¶²é·„é·é¶» +鶸鶺鷆é·é·‚鷙鷓鷸鷦鷭鷯鷽鸚鸛鸞鹵鹹鹽éºéºˆ +麋麌麒麕麑éºéº¥éº©éº¸éºªéº­é¡é»Œé»Žé»é»é»”é»œé»žé» +黠黥黨黯黴黶黷黹黻黼黽鼇鼈皷鼕鼡鼬鼾齊齒 +齔齣齟齠齡齦齧齬齪齷齲齶龕龜龠・・・・・ +・堯槇é™ç‘¤å‡œç†™ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ» +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +SELECT * FROM `T12`; +c1 +ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»Ë˜Ë‡Â¸Ë™Ë +・˛˚~΄΅・・・・・・・・¡¦¿・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・ºª©®™ +¤№・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・ΆΈΉΊΪ・Ό・ΎΫ・Î・・・ +・άέήίϊÎόςÏϋΰώ・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・ЂЃЄЅІЇ +ЈЉЊЋЌЎÐ・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・ђѓєѕіїјљњћќўџ・・・・・ +・ÆÄ・Ħ・IJ・ÅĿ・ŊØŒ・ŦÞ・・・ +・・・・・・・・・・・・・æđðħıijĸ +łŀʼnŋøœßŧþ・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・ÃÀÄÂĂÇĀĄÅÃĆĈČÇĊĎÉÈË +ÊĚĖĒĘ・ĜĞĢĠĤÃÃŒÃÃŽÇİĪĮĨ +ĴĶĹĽĻŃŇŅÑÓÒÖÔǑÅŌÕŔŘŖ +ŚŜŠŞŤŢÚÙÜÛŬǓŰŪŲŮŨǗǛǙ +ǕŴßŶŹŽŻ・・・・・・・・・・・・ +・áàäâăǎÄąåãćĉÄçċÄéèë +êěėēęǵÄğ・ġĥíìïîÇ・īįĩ +ĵķĺľļńňņñóòöôǒőÅõŕřŗ +śŚşťţúùüûŭǔűūųůũǘǜǚ +ǖŵýÿŷźžż・・・・・・・・・・・・ +・丂丄丅丌丒丟丣两丨丫丮丯丰丵乀ä¹ä¹„乇乑 +乚乜乣乨乩乴乵乹乿äºäº–亗äºäº¯äº¹ä»ƒä»ä»šä»›ä»  +仡仢仨仯仱仳仵份仾仿伀伂伃伈伋伌伒伕伖众 +伙伮伱你伳伵伷伹伻伾佀佂佈佉佋佌佒佔佖佘 +佟佣佪佬佮佱佷佸佹佺佽佾ä¾ä¾‚侄・・・・・ +・黸黿鼂鼃鼉é¼é¼é¼‘鼒鼔鼖鼗鼙鼚鼛鼟鼢鼦鼪 +鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 +齗齘齚é½é½žé½¨é½©é½­é½®é½¯é½°é½±é½³é½µé½ºé½½é¾é¾é¾‘é¾’ +龔龖龗龞龡龢龣龥・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +drop table `T1`; +drop table `ï¼´ï¼’`; +drop table `T3`; +drop table `ï¼´ï¼”`; +drop table `T5`; +drop table `ï¼´ï¼–`; +drop table `ï¼´ï¼—`; +drop table `T8`; +drop table `ï¼´ï¼™`; +drop table `T1ï¼`; +drop table `T11`; +drop table `T12`; diff --git a/mysql-test/suite/jp/r/jp_subquery_sjis.result b/mysql-test/suite/jp/r/jp_subquery_sjis.result new file mode 100755 index 00000000000..b94de3630af --- /dev/null +++ b/mysql-test/suite/jp/r/jp_subquery_sjis.result @@ -0,0 +1,206 @@ +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +drop table if exists `‚s‚P‚P`; +drop table if exists `‚s‚P‚Q`; +SET NAMES sjis; +SET character_set_database = sjis; +CREATE TABLE `‚s‚Pa` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Pb` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Qa` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Qb` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Ra` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Rb` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Sa` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚Sb` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚Ta` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚Tb` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚Ua` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚Ub` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚Va` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚Vb` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚Wa` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚Wb` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚Xa` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚Xb` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚Oa` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚Ob` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚Pa` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚Pb` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚Qa` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚Qb` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +INSERT INTO `‚s‚Pa` VALUES ('±'),('¶'),('»'); +INSERT INTO `‚s‚Pb` VALUES ('±'); +INSERT INTO `‚s‚Qa` VALUES ('‚ '),('‚©'),('‚³'); +INSERT INTO `‚s‚Qb` VALUES ('‚ '); +INSERT INTO `‚s‚Ra` VALUES ('ƒ\'),('\'),('•\'); +INSERT INTO `‚s‚Rb` VALUES ('ƒ\'); +INSERT INTO `‚s‚Sa` VALUES ('±'),('¶'),('»'); +INSERT INTO `‚s‚Sb` VALUES ('±'); +INSERT INTO `‚s‚Ta` VALUES ('‚ '),('‚©'),('‚³'); +INSERT INTO `‚s‚Tb` VALUES ('‚ '); +INSERT INTO `‚s‚Ua` VALUES ('ƒ\'),('\'),('•\'); +INSERT INTO `‚s‚Ub` VALUES ('ƒ\'); +INSERT INTO `‚s‚Va` VALUES ('±'),('¶'),('»'); +INSERT INTO `‚s‚Vb` VALUES ('±'); +INSERT INTO `‚s‚Wa` VALUES ('‚ '),('‚©'),('‚³'); +INSERT INTO `‚s‚Wb` VALUES ('‚ '); +INSERT INTO `‚s‚Xa` VALUES ('ƒ\'),('\'),('•\'); +INSERT INTO `‚s‚Xb` VALUES ('ƒ\'); +INSERT INTO `‚s‚P‚Oa` VALUES ('±'),('¶'),('»'); +INSERT INTO `‚s‚P‚Ob` VALUES ('±'); +INSERT INTO `‚s‚P‚Pa` VALUES ('‚ '),('‚©'),('‚³'); +INSERT INTO `‚s‚P‚Pb` VALUES ('‚ '); +INSERT INTO `‚s‚P‚Qa` VALUES ('ƒ\'),('\'),('•\'); +INSERT INTO `‚s‚P‚Qb` VALUES ('ƒ\'); +SELECT `‚b‚P` FROM `‚s‚Pa` WHERE `‚b‚P` IN (SELECT `‚b‚P` FROM `‚s‚Pb`); +‚b‚P +± +SELECT `‚b‚P` FROM `‚s‚Pa` WHERE EXISTS (SELECT `‚b‚P` FROM `‚s‚Pb` WHERE `‚s‚Pa`.`‚b‚P` = `‚s‚Pb`.`‚b‚P`); +‚b‚P +± +SELECT `‚b‚P` FROM `‚s‚Pa` WHERE NOT EXISTS (SELECT `‚b‚P` FROM `‚s‚Pb` WHERE `‚s‚Pa`.`‚b‚P` = `‚s‚Pb`.`‚b‚P`); +‚b‚P +¶ +» +SELECT `‚b‚P` FROM `‚s‚Qa` WHERE `‚b‚P` IN (SELECT `‚b‚P` FROM `‚s‚Qb`); +‚b‚P +‚  +SELECT `‚b‚P` FROM `‚s‚Qa` WHERE EXISTS (SELECT `‚b‚P` FROM `‚s‚Qb` WHERE `‚s‚Qa`.`‚b‚P` = `‚s‚Qb`.`‚b‚P`); +‚b‚P +‚  +SELECT `‚b‚P` FROM `‚s‚Qa` WHERE NOT EXISTS (SELECT `‚b‚P` FROM `‚s‚Qb` WHERE `‚s‚Qa`.`‚b‚P` = `‚s‚Qb`.`‚b‚P`); +‚b‚P +‚© +‚³ +SELECT `‚b‚P` FROM `‚s‚Ra` WHERE `‚b‚P` IN (SELECT `‚b‚P` FROM `‚s‚Rb`); +‚b‚P +ƒ\ +SELECT `‚b‚P` FROM `‚s‚Ra` WHERE EXISTS (SELECT `‚b‚P` FROM `‚s‚Rb` WHERE `‚s‚Ra`.`‚b‚P` = `‚s‚Rb`.`‚b‚P`); +‚b‚P +ƒ\ +SELECT `‚b‚P` FROM `‚s‚Ra` WHERE NOT EXISTS (SELECT `‚b‚P` FROM `‚s‚Rb` WHERE `‚s‚Ra`.`‚b‚P` = `‚s‚Rb`.`‚b‚P`); +‚b‚P +\ +•\ +SELECT `‚b‚P` FROM `‚s‚Sa` WHERE `‚b‚P` IN (SELECT `‚b‚P` FROM `‚s‚Sb`); +‚b‚P +± +SELECT `‚b‚P` FROM `‚s‚Sa` WHERE EXISTS (SELECT `‚b‚P` FROM `‚s‚Sb` WHERE `‚s‚Sa`.`‚b‚P` = `‚s‚Sb`.`‚b‚P`); +‚b‚P +± +SELECT `‚b‚P` FROM `‚s‚Sa` WHERE NOT EXISTS (SELECT `‚b‚P` FROM `‚s‚Sb` WHERE `‚s‚Sa`.`‚b‚P` = `‚s‚Sb`.`‚b‚P`); +‚b‚P +¶ +» +SELECT `‚b‚P` FROM `‚s‚Ta` WHERE `‚b‚P` IN (SELECT `‚b‚P` FROM `‚s‚Tb`); +‚b‚P +‚  +SELECT `‚b‚P` FROM `‚s‚Ta` WHERE EXISTS (SELECT `‚b‚P` FROM `‚s‚Tb` WHERE `‚s‚Ta`.`‚b‚P` = `‚s‚Tb`.`‚b‚P`); +‚b‚P +‚  +SELECT `‚b‚P` FROM `‚s‚Ta` WHERE NOT EXISTS (SELECT `‚b‚P` FROM `‚s‚Tb` WHERE `‚s‚Ta`.`‚b‚P` = `‚s‚Tb`.`‚b‚P`); +‚b‚P +‚© +‚³ +SELECT `‚b‚P` FROM `‚s‚Ua` WHERE `‚b‚P` IN (SELECT `‚b‚P` FROM `‚s‚Ub`); +‚b‚P +ƒ\ +SELECT `‚b‚P` FROM `‚s‚Ua` WHERE EXISTS (SELECT `‚b‚P` FROM `‚s‚Ub` WHERE `‚s‚Ua`.`‚b‚P` = `‚s‚Ub`.`‚b‚P`); +‚b‚P +ƒ\ +SELECT `‚b‚P` FROM `‚s‚Ua` WHERE NOT EXISTS (SELECT `‚b‚P` FROM `‚s‚Ub` WHERE `‚s‚Ua`.`‚b‚P` = `‚s‚Ub`.`‚b‚P`); +‚b‚P +\ +•\ +SELECT `‚b‚P` FROM `‚s‚Va` WHERE `‚b‚P` IN (SELECT `‚b‚P` FROM `‚s‚Vb`); +‚b‚P +± +SELECT `‚b‚P` FROM `‚s‚Va` WHERE EXISTS (SELECT `‚b‚P` FROM `‚s‚Vb` WHERE `‚s‚Va`.`‚b‚P` = `‚s‚Vb`.`‚b‚P`); +‚b‚P +± +SELECT `‚b‚P` FROM `‚s‚Va` WHERE NOT EXISTS (SELECT `‚b‚P` FROM `‚s‚Vb` WHERE `‚s‚Va`.`‚b‚P` = `‚s‚Vb`.`‚b‚P`); +‚b‚P +¶ +» +SELECT `‚b‚P` FROM `‚s‚Wa` WHERE `‚b‚P` IN (SELECT `‚b‚P` FROM `‚s‚Wb`); +‚b‚P +‚  +SELECT `‚b‚P` FROM `‚s‚Wa` WHERE EXISTS (SELECT `‚b‚P` FROM `‚s‚Wb` WHERE `‚s‚Wa`.`‚b‚P` = `‚s‚Wb`.`‚b‚P`); +‚b‚P +‚  +SELECT `‚b‚P` FROM `‚s‚Wa` WHERE NOT EXISTS (SELECT `‚b‚P` FROM `‚s‚Wb` WHERE `‚s‚Wa`.`‚b‚P` = `‚s‚Wb`.`‚b‚P`); +‚b‚P +‚© +‚³ +SELECT `‚b‚P` FROM `‚s‚Xa` WHERE `‚b‚P` IN (SELECT `‚b‚P` FROM `‚s‚Xb`); +‚b‚P +ƒ\ +SELECT `‚b‚P` FROM `‚s‚Xa` WHERE EXISTS (SELECT `‚b‚P` FROM `‚s‚Xb` WHERE `‚s‚Xa`.`‚b‚P` = `‚s‚Xb`.`‚b‚P`); +‚b‚P +ƒ\ +SELECT `‚b‚P` FROM `‚s‚Xa` WHERE NOT EXISTS (SELECT `‚b‚P` FROM `‚s‚Xb` WHERE `‚s‚Xa`.`‚b‚P` = `‚s‚Xb`.`‚b‚P`); +‚b‚P +\ +•\ +SELECT `‚b‚P` FROM `‚s‚P‚Oa` WHERE `‚b‚P` IN (SELECT `‚b‚P` FROM `‚s‚P‚Ob`); +‚b‚P +± +SELECT `‚b‚P` FROM `‚s‚P‚Oa` WHERE EXISTS (SELECT `‚b‚P` FROM `‚s‚P‚Ob` WHERE `‚s‚P‚Oa`.`‚b‚P` = `‚s‚P‚Ob`.`‚b‚P`); +‚b‚P +± +SELECT `‚b‚P` FROM `‚s‚P‚Oa` WHERE NOT EXISTS (SELECT `‚b‚P` FROM `‚s‚P‚Ob` WHERE `‚s‚P‚Oa`.`‚b‚P` = `‚s‚P‚Ob`.`‚b‚P`); +‚b‚P +¶ +» +SELECT `‚b‚P` FROM `‚s‚P‚Pa` WHERE `‚b‚P` IN (SELECT `‚b‚P` FROM `‚s‚P‚Pb`); +‚b‚P +‚  +SELECT `‚b‚P` FROM `‚s‚P‚Pa` WHERE EXISTS (SELECT `‚b‚P` FROM `‚s‚P‚Pb` WHERE `‚s‚P‚Pa`.`‚b‚P` = `‚s‚P‚Pb`.`‚b‚P`); +‚b‚P +‚  +SELECT `‚b‚P` FROM `‚s‚P‚Pa` WHERE NOT EXISTS (SELECT `‚b‚P` FROM `‚s‚P‚Pb` WHERE `‚s‚P‚Pa`.`‚b‚P` = `‚s‚P‚Pb`.`‚b‚P`); +‚b‚P +‚© +‚³ +SELECT `‚b‚P` FROM `‚s‚P‚Qa` WHERE `‚b‚P` IN (SELECT `‚b‚P` FROM `‚s‚P‚Qb`); +‚b‚P +ƒ\ +SELECT `‚b‚P` FROM `‚s‚P‚Qa` WHERE EXISTS (SELECT `‚b‚P` FROM `‚s‚P‚Qb` WHERE `‚s‚P‚Qa`.`‚b‚P` = `‚s‚P‚Qb`.`‚b‚P`); +‚b‚P +ƒ\ +SELECT `‚b‚P` FROM `‚s‚P‚Qa` WHERE NOT EXISTS (SELECT `‚b‚P` FROM `‚s‚P‚Qb` WHERE `‚s‚P‚Qa`.`‚b‚P` = `‚s‚P‚Qb`.`‚b‚P`); +‚b‚P +\ +•\ +DROP TABLE `‚s‚Pa`; +DROP TABLE `‚s‚Pb`; +DROP TABLE `‚s‚Qa`; +DROP TABLE `‚s‚Qb`; +DROP TABLE `‚s‚Ra`; +DROP TABLE `‚s‚Rb`; +DROP TABLE `‚s‚Sa`; +DROP TABLE `‚s‚Sb`; +DROP TABLE `‚s‚Ta`; +DROP TABLE `‚s‚Tb`; +DROP TABLE `‚s‚Ua`; +DROP TABLE `‚s‚Ub`; +DROP TABLE `‚s‚Va`; +DROP TABLE `‚s‚Vb`; +DROP TABLE `‚s‚Wa`; +DROP TABLE `‚s‚Wb`; +DROP TABLE `‚s‚Xa`; +DROP TABLE `‚s‚Xb`; +DROP TABLE `‚s‚P‚Oa`; +DROP TABLE `‚s‚P‚Ob`; +DROP TABLE `‚s‚P‚Pa`; +DROP TABLE `‚s‚P‚Pb`; +DROP TABLE `‚s‚P‚Qa`; +DROP TABLE `‚s‚P‚Qb`; diff --git a/mysql-test/suite/jp/r/jp_subquery_ucs2.result b/mysql-test/suite/jp/r/jp_subquery_ucs2.result new file mode 100755 index 00000000000..023100ecce3 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_subquery_ucs2.result @@ -0,0 +1,207 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; +CREATE TABLE `£Ô£±a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£±b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£´b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µa` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µb` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£·b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£±a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£±b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£²a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£²b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = heap; +INSERT INTO `£Ô£±a` VALUES ('ޱ'),('޶'),('Ž»'); +INSERT INTO `£Ô£±b` VALUES ('ޱ'); +INSERT INTO `£Ô£²a` VALUES ('¤¢'),('¤«'),('¤µ'); +INSERT INTO `£Ô£²b` VALUES ('¤¢'); +INSERT INTO `£Ô£³a` VALUES ('íÜ'),('íÝ'),('íÞ'); +INSERT INTO `£Ô£³b` VALUES ('íÜ'); +INSERT INTO `£Ô£´a` VALUES ('ޱ'),('޶'),('Ž»'); +INSERT INTO `£Ô£´b` VALUES ('ޱ'); +INSERT INTO `£Ô£µa` VALUES ('¤¢'),('¤«'),('¤µ'); +INSERT INTO `£Ô£µb` VALUES ('¤¢'); +INSERT INTO `£Ô£¶a` VALUES ('íÜ'),('íÝ'),('íÞ'); +INSERT INTO `£Ô£¶b` VALUES ('íÜ'); +INSERT INTO `£Ô£·a` VALUES ('ޱ'),('޶'),('Ž»'); +INSERT INTO `£Ô£·b` VALUES ('ޱ'); +INSERT INTO `£Ô£¸a` VALUES ('¤¢'),('¤«'),('¤µ'); +INSERT INTO `£Ô£¸b` VALUES ('¤¢'); +INSERT INTO `£Ô£¹a` VALUES ('íÜ'),('íÝ'),('íÞ'); +INSERT INTO `£Ô£¹b` VALUES ('íÜ'); +INSERT INTO `£Ô£±£°a` VALUES ('ޱ'),('޶'),('Ž»'); +INSERT INTO `£Ô£±£°b` VALUES ('ޱ'); +INSERT INTO `£Ô£±£±a` VALUES ('¤¢'),('¤«'),('¤µ'); +INSERT INTO `£Ô£±£±b` VALUES ('¤¢'); +INSERT INTO `£Ô£±£²a` VALUES ('íÜ'),('íÝ'),('íÞ'); +INSERT INTO `£Ô£±£²b` VALUES ('íÜ'); +SELECT `£Ã£±` FROM `£Ô£±a` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£±b`); +£Ã£± +ޱ +SELECT `£Ã£±` FROM `£Ô£±a` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£±b` WHERE `£Ô£±a`.`£Ã£±` = `£Ô£±b`.`£Ã£±`); +£Ã£± +ޱ +SELECT `£Ã£±` FROM `£Ô£±a` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£±b` WHERE `£Ô£±a`.`£Ã£±` = `£Ô£±b`.`£Ã£±`); +£Ã£± +޶ +Ž» +SELECT `£Ã£±` FROM `£Ô£²a` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£²b`); +£Ã£± +¤¢ +SELECT `£Ã£±` FROM `£Ô£²a` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£²b` WHERE `£Ô£²a`.`£Ã£±` = `£Ô£²b`.`£Ã£±`); +£Ã£± +¤¢ +SELECT `£Ã£±` FROM `£Ô£²a` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£²b` WHERE `£Ô£²a`.`£Ã£±` = `£Ô£²b`.`£Ã£±`); +£Ã£± +¤« +¤µ +SELECT `£Ã£±` FROM `£Ô£³a` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£³b`); +£Ã£± +íÜ +SELECT `£Ã£±` FROM `£Ô£³a` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£³b` WHERE `£Ô£³a`.`£Ã£±` = `£Ô£³b`.`£Ã£±`); +£Ã£± +íÜ +SELECT `£Ã£±` FROM `£Ô£³a` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£³b` WHERE `£Ô£³a`.`£Ã£±` = `£Ô£³b`.`£Ã£±`); +£Ã£± +íÝ +íÞ +SELECT `£Ã£±` FROM `£Ô£´a` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£´b`); +£Ã£± +ޱ +SELECT `£Ã£±` FROM `£Ô£´a` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£´b` WHERE `£Ô£´a`.`£Ã£±` = `£Ô£´b`.`£Ã£±`); +£Ã£± +ޱ +SELECT `£Ã£±` FROM `£Ô£´a` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£´b` WHERE `£Ô£´a`.`£Ã£±` = `£Ô£´b`.`£Ã£±`); +£Ã£± +޶ +Ž» +SELECT `£Ã£±` FROM `£Ô£µa` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£µb`); +£Ã£± +¤¢ +SELECT `£Ã£±` FROM `£Ô£µa` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£µb` WHERE `£Ô£µa`.`£Ã£±` = `£Ô£µb`.`£Ã£±`); +£Ã£± +¤¢ +SELECT `£Ã£±` FROM `£Ô£µa` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£µb` WHERE `£Ô£µa`.`£Ã£±` = `£Ô£µb`.`£Ã£±`); +£Ã£± +¤« +¤µ +SELECT `£Ã£±` FROM `£Ô£¶a` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£¶b`); +£Ã£± +íÜ +SELECT `£Ã£±` FROM `£Ô£¶a` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£¶b` WHERE `£Ô£¶a`.`£Ã£±` = `£Ô£¶b`.`£Ã£±`); +£Ã£± +íÜ +SELECT `£Ã£±` FROM `£Ô£¶a` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£¶b` WHERE `£Ô£¶a`.`£Ã£±` = `£Ô£¶b`.`£Ã£±`); +£Ã£± +íÝ +íÞ +SELECT `£Ã£±` FROM `£Ô£·a` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£·b`); +£Ã£± +ޱ +SELECT `£Ã£±` FROM `£Ô£·a` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£·b` WHERE `£Ô£·a`.`£Ã£±` = `£Ô£·b`.`£Ã£±`); +£Ã£± +ޱ +SELECT `£Ã£±` FROM `£Ô£·a` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£·b` WHERE `£Ô£·a`.`£Ã£±` = `£Ô£·b`.`£Ã£±`); +£Ã£± +޶ +Ž» +SELECT `£Ã£±` FROM `£Ô£¸a` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£¸b`); +£Ã£± +¤¢ +SELECT `£Ã£±` FROM `£Ô£¸a` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£¸b` WHERE `£Ô£¸a`.`£Ã£±` = `£Ô£¸b`.`£Ã£±`); +£Ã£± +¤¢ +SELECT `£Ã£±` FROM `£Ô£¸a` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£¸b` WHERE `£Ô£¸a`.`£Ã£±` = `£Ô£¸b`.`£Ã£±`); +£Ã£± +¤« +¤µ +SELECT `£Ã£±` FROM `£Ô£¹a` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£¹b`); +£Ã£± +íÜ +SELECT `£Ã£±` FROM `£Ô£¹a` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£¹b` WHERE `£Ô£¹a`.`£Ã£±` = `£Ô£¹b`.`£Ã£±`); +£Ã£± +íÜ +SELECT `£Ã£±` FROM `£Ô£¹a` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£¹b` WHERE `£Ô£¹a`.`£Ã£±` = `£Ô£¹b`.`£Ã£±`); +£Ã£± +íÝ +íÞ +SELECT `£Ã£±` FROM `£Ô£±£°a` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£±£°b`); +£Ã£± +ޱ +SELECT `£Ã£±` FROM `£Ô£±£°a` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£±£°b` WHERE `£Ô£±£°a`.`£Ã£±` = `£Ô£±£°b`.`£Ã£±`); +£Ã£± +ޱ +SELECT `£Ã£±` FROM `£Ô£±£°a` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£±£°b` WHERE `£Ô£±£°a`.`£Ã£±` = `£Ô£±£°b`.`£Ã£±`); +£Ã£± +޶ +Ž» +SELECT `£Ã£±` FROM `£Ô£±£±a` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£±£±b`); +£Ã£± +¤¢ +SELECT `£Ã£±` FROM `£Ô£±£±a` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£±£±b` WHERE `£Ô£±£±a`.`£Ã£±` = `£Ô£±£±b`.`£Ã£±`); +£Ã£± +¤¢ +SELECT `£Ã£±` FROM `£Ô£±£±a` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£±£±b` WHERE `£Ô£±£±a`.`£Ã£±` = `£Ô£±£±b`.`£Ã£±`); +£Ã£± +¤« +¤µ +SELECT `£Ã£±` FROM `£Ô£±£²a` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£±£²b`); +£Ã£± +íÜ +SELECT `£Ã£±` FROM `£Ô£±£²a` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£±£²b` WHERE `£Ô£±£²a`.`£Ã£±` = `£Ô£±£²b`.`£Ã£±`); +£Ã£± +íÜ +SELECT `£Ã£±` FROM `£Ô£±£²a` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£±£²b` WHERE `£Ô£±£²a`.`£Ã£±` = `£Ô£±£²b`.`£Ã£±`); +£Ã£± +íÝ +íÞ +DROP TABLE `£Ô£±a`; +DROP TABLE `£Ô£±b`; +DROP TABLE `£Ô£²a`; +DROP TABLE `£Ô£²b`; +DROP TABLE `£Ô£³a`; +DROP TABLE `£Ô£³b`; +DROP TABLE `£Ô£´a`; +DROP TABLE `£Ô£´b`; +DROP TABLE `£Ô£µa`; +DROP TABLE `£Ô£µb`; +DROP TABLE `£Ô£¶a`; +DROP TABLE `£Ô£¶b`; +DROP TABLE `£Ô£·a`; +DROP TABLE `£Ô£·b`; +DROP TABLE `£Ô£¸a`; +DROP TABLE `£Ô£¸b`; +DROP TABLE `£Ô£¹a`; +DROP TABLE `£Ô£¹b`; +DROP TABLE `£Ô£±£°a`; +DROP TABLE `£Ô£±£°b`; +DROP TABLE `£Ô£±£±a`; +DROP TABLE `£Ô£±£±b`; +DROP TABLE `£Ô£±£²a`; +DROP TABLE `£Ô£±£²b`; diff --git a/mysql-test/suite/jp/r/jp_subquery_ujis.result b/mysql-test/suite/jp/r/jp_subquery_ujis.result new file mode 100755 index 00000000000..0b6aa03970f --- /dev/null +++ b/mysql-test/suite/jp/r/jp_subquery_ujis.result @@ -0,0 +1,206 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +SET NAMES ujis; +SET character_set_database = ujis; +CREATE TABLE `£Ô£±a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£±b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£´b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µa` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µb` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£·b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£±a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£±b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£²a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£²b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = heap; +INSERT INTO `£Ô£±a` VALUES ('ޱ'),('޶'),('Ž»'); +INSERT INTO `£Ô£±b` VALUES ('ޱ'); +INSERT INTO `£Ô£²a` VALUES ('¤¢'),('¤«'),('¤µ'); +INSERT INTO `£Ô£²b` VALUES ('¤¢'); +INSERT INTO `£Ô£³a` VALUES ('íÜ'),('íÝ'),('íÞ'); +INSERT INTO `£Ô£³b` VALUES ('íÜ'); +INSERT INTO `£Ô£´a` VALUES ('ޱ'),('޶'),('Ž»'); +INSERT INTO `£Ô£´b` VALUES ('ޱ'); +INSERT INTO `£Ô£µa` VALUES ('¤¢'),('¤«'),('¤µ'); +INSERT INTO `£Ô£µb` VALUES ('¤¢'); +INSERT INTO `£Ô£¶a` VALUES ('íÜ'),('íÝ'),('íÞ'); +INSERT INTO `£Ô£¶b` VALUES ('íÜ'); +INSERT INTO `£Ô£·a` VALUES ('ޱ'),('޶'),('Ž»'); +INSERT INTO `£Ô£·b` VALUES ('ޱ'); +INSERT INTO `£Ô£¸a` VALUES ('¤¢'),('¤«'),('¤µ'); +INSERT INTO `£Ô£¸b` VALUES ('¤¢'); +INSERT INTO `£Ô£¹a` VALUES ('íÜ'),('íÝ'),('íÞ'); +INSERT INTO `£Ô£¹b` VALUES ('íÜ'); +INSERT INTO `£Ô£±£°a` VALUES ('ޱ'),('޶'),('Ž»'); +INSERT INTO `£Ô£±£°b` VALUES ('ޱ'); +INSERT INTO `£Ô£±£±a` VALUES ('¤¢'),('¤«'),('¤µ'); +INSERT INTO `£Ô£±£±b` VALUES ('¤¢'); +INSERT INTO `£Ô£±£²a` VALUES ('íÜ'),('íÝ'),('íÞ'); +INSERT INTO `£Ô£±£²b` VALUES ('íÜ'); +SELECT `£Ã£±` FROM `£Ô£±a` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£±b`); +£Ã£± +ޱ +SELECT `£Ã£±` FROM `£Ô£±a` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£±b` WHERE `£Ô£±a`.`£Ã£±` = `£Ô£±b`.`£Ã£±`); +£Ã£± +ޱ +SELECT `£Ã£±` FROM `£Ô£±a` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£±b` WHERE `£Ô£±a`.`£Ã£±` = `£Ô£±b`.`£Ã£±`); +£Ã£± +޶ +Ž» +SELECT `£Ã£±` FROM `£Ô£²a` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£²b`); +£Ã£± +¤¢ +SELECT `£Ã£±` FROM `£Ô£²a` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£²b` WHERE `£Ô£²a`.`£Ã£±` = `£Ô£²b`.`£Ã£±`); +£Ã£± +¤¢ +SELECT `£Ã£±` FROM `£Ô£²a` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£²b` WHERE `£Ô£²a`.`£Ã£±` = `£Ô£²b`.`£Ã£±`); +£Ã£± +¤« +¤µ +SELECT `£Ã£±` FROM `£Ô£³a` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£³b`); +£Ã£± +íÜ +SELECT `£Ã£±` FROM `£Ô£³a` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£³b` WHERE `£Ô£³a`.`£Ã£±` = `£Ô£³b`.`£Ã£±`); +£Ã£± +íÜ +SELECT `£Ã£±` FROM `£Ô£³a` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£³b` WHERE `£Ô£³a`.`£Ã£±` = `£Ô£³b`.`£Ã£±`); +£Ã£± +íÝ +íÞ +SELECT `£Ã£±` FROM `£Ô£´a` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£´b`); +£Ã£± +ޱ +SELECT `£Ã£±` FROM `£Ô£´a` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£´b` WHERE `£Ô£´a`.`£Ã£±` = `£Ô£´b`.`£Ã£±`); +£Ã£± +ޱ +SELECT `£Ã£±` FROM `£Ô£´a` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£´b` WHERE `£Ô£´a`.`£Ã£±` = `£Ô£´b`.`£Ã£±`); +£Ã£± +޶ +Ž» +SELECT `£Ã£±` FROM `£Ô£µa` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£µb`); +£Ã£± +¤¢ +SELECT `£Ã£±` FROM `£Ô£µa` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£µb` WHERE `£Ô£µa`.`£Ã£±` = `£Ô£µb`.`£Ã£±`); +£Ã£± +¤¢ +SELECT `£Ã£±` FROM `£Ô£µa` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£µb` WHERE `£Ô£µa`.`£Ã£±` = `£Ô£µb`.`£Ã£±`); +£Ã£± +¤« +¤µ +SELECT `£Ã£±` FROM `£Ô£¶a` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£¶b`); +£Ã£± +íÜ +SELECT `£Ã£±` FROM `£Ô£¶a` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£¶b` WHERE `£Ô£¶a`.`£Ã£±` = `£Ô£¶b`.`£Ã£±`); +£Ã£± +íÜ +SELECT `£Ã£±` FROM `£Ô£¶a` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£¶b` WHERE `£Ô£¶a`.`£Ã£±` = `£Ô£¶b`.`£Ã£±`); +£Ã£± +íÝ +íÞ +SELECT `£Ã£±` FROM `£Ô£·a` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£·b`); +£Ã£± +ޱ +SELECT `£Ã£±` FROM `£Ô£·a` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£·b` WHERE `£Ô£·a`.`£Ã£±` = `£Ô£·b`.`£Ã£±`); +£Ã£± +ޱ +SELECT `£Ã£±` FROM `£Ô£·a` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£·b` WHERE `£Ô£·a`.`£Ã£±` = `£Ô£·b`.`£Ã£±`); +£Ã£± +޶ +Ž» +SELECT `£Ã£±` FROM `£Ô£¸a` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£¸b`); +£Ã£± +¤¢ +SELECT `£Ã£±` FROM `£Ô£¸a` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£¸b` WHERE `£Ô£¸a`.`£Ã£±` = `£Ô£¸b`.`£Ã£±`); +£Ã£± +¤¢ +SELECT `£Ã£±` FROM `£Ô£¸a` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£¸b` WHERE `£Ô£¸a`.`£Ã£±` = `£Ô£¸b`.`£Ã£±`); +£Ã£± +¤« +¤µ +SELECT `£Ã£±` FROM `£Ô£¹a` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£¹b`); +£Ã£± +íÜ +SELECT `£Ã£±` FROM `£Ô£¹a` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£¹b` WHERE `£Ô£¹a`.`£Ã£±` = `£Ô£¹b`.`£Ã£±`); +£Ã£± +íÜ +SELECT `£Ã£±` FROM `£Ô£¹a` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£¹b` WHERE `£Ô£¹a`.`£Ã£±` = `£Ô£¹b`.`£Ã£±`); +£Ã£± +íÝ +íÞ +SELECT `£Ã£±` FROM `£Ô£±£°a` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£±£°b`); +£Ã£± +ޱ +SELECT `£Ã£±` FROM `£Ô£±£°a` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£±£°b` WHERE `£Ô£±£°a`.`£Ã£±` = `£Ô£±£°b`.`£Ã£±`); +£Ã£± +ޱ +SELECT `£Ã£±` FROM `£Ô£±£°a` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£±£°b` WHERE `£Ô£±£°a`.`£Ã£±` = `£Ô£±£°b`.`£Ã£±`); +£Ã£± +޶ +Ž» +SELECT `£Ã£±` FROM `£Ô£±£±a` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£±£±b`); +£Ã£± +¤¢ +SELECT `£Ã£±` FROM `£Ô£±£±a` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£±£±b` WHERE `£Ô£±£±a`.`£Ã£±` = `£Ô£±£±b`.`£Ã£±`); +£Ã£± +¤¢ +SELECT `£Ã£±` FROM `£Ô£±£±a` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£±£±b` WHERE `£Ô£±£±a`.`£Ã£±` = `£Ô£±£±b`.`£Ã£±`); +£Ã£± +¤« +¤µ +SELECT `£Ã£±` FROM `£Ô£±£²a` WHERE `£Ã£±` IN (SELECT `£Ã£±` FROM `£Ô£±£²b`); +£Ã£± +íÜ +SELECT `£Ã£±` FROM `£Ô£±£²a` WHERE EXISTS (SELECT `£Ã£±` FROM `£Ô£±£²b` WHERE `£Ô£±£²a`.`£Ã£±` = `£Ô£±£²b`.`£Ã£±`); +£Ã£± +íÜ +SELECT `£Ã£±` FROM `£Ô£±£²a` WHERE NOT EXISTS (SELECT `£Ã£±` FROM `£Ô£±£²b` WHERE `£Ô£±£²a`.`£Ã£±` = `£Ô£±£²b`.`£Ã£±`); +£Ã£± +íÝ +íÞ +DROP TABLE `£Ô£±a`; +DROP TABLE `£Ô£±b`; +DROP TABLE `£Ô£²a`; +DROP TABLE `£Ô£²b`; +DROP TABLE `£Ô£³a`; +DROP TABLE `£Ô£³b`; +DROP TABLE `£Ô£´a`; +DROP TABLE `£Ô£´b`; +DROP TABLE `£Ô£µa`; +DROP TABLE `£Ô£µb`; +DROP TABLE `£Ô£¶a`; +DROP TABLE `£Ô£¶b`; +DROP TABLE `£Ô£·a`; +DROP TABLE `£Ô£·b`; +DROP TABLE `£Ô£¸a`; +DROP TABLE `£Ô£¸b`; +DROP TABLE `£Ô£¹a`; +DROP TABLE `£Ô£¹b`; +DROP TABLE `£Ô£±£°a`; +DROP TABLE `£Ô£±£°b`; +DROP TABLE `£Ô£±£±a`; +DROP TABLE `£Ô£±£±b`; +DROP TABLE `£Ô£±£²a`; +DROP TABLE `£Ô£±£²b`; diff --git a/mysql-test/suite/jp/r/jp_subquery_utf8.result b/mysql-test/suite/jp/r/jp_subquery_utf8.result new file mode 100755 index 00000000000..ce56e660a65 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_subquery_utf8.result @@ -0,0 +1,206 @@ +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +drop table if exists `T11`; +drop table if exists `T12`; +SET NAMES utf8; +SET character_set_database = utf8; +CREATE TABLE `T1a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T1b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼”b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼—b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T11a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T11b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T12a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T12b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = heap; +INSERT INTO `T1a` VALUES ('ï½±'),('ï½¶'),('ï½»'); +INSERT INTO `T1b` VALUES ('ï½±'); +INSERT INTO `ï¼´ï¼’a` VALUES ('ã‚'),('ã‹'),('ã•'); +INSERT INTO `ï¼´ï¼’b` VALUES ('ã‚'); +INSERT INTO `T3a` VALUES ('é¾”'),('é¾–'),('é¾—'); +INSERT INTO `T3b` VALUES ('é¾”'); +INSERT INTO `ï¼´ï¼”a` VALUES ('ï½±'),('ï½¶'),('ï½»'); +INSERT INTO `ï¼´ï¼”b` VALUES ('ï½±'); +INSERT INTO `T5a` VALUES ('ã‚'),('ã‹'),('ã•'); +INSERT INTO `T5b` VALUES ('ã‚'); +INSERT INTO `ï¼´ï¼–a` VALUES ('é¾”'),('é¾–'),('é¾—'); +INSERT INTO `ï¼´ï¼–b` VALUES ('é¾”'); +INSERT INTO `ï¼´ï¼—a` VALUES ('ï½±'),('ï½¶'),('ï½»'); +INSERT INTO `ï¼´ï¼—b` VALUES ('ï½±'); +INSERT INTO `T8a` VALUES ('ã‚'),('ã‹'),('ã•'); +INSERT INTO `T8b` VALUES ('ã‚'); +INSERT INTO `ï¼´ï¼™a` VALUES ('é¾”'),('é¾–'),('é¾—'); +INSERT INTO `ï¼´ï¼™b` VALUES ('é¾”'); +INSERT INTO `T1ï¼a` VALUES ('ï½±'),('ï½¶'),('ï½»'); +INSERT INTO `T1ï¼b` VALUES ('ï½±'); +INSERT INTO `T11a` VALUES ('ã‚'),('ã‹'),('ã•'); +INSERT INTO `T11b` VALUES ('ã‚'); +INSERT INTO `T12a` VALUES ('é¾”'),('é¾–'),('é¾—'); +INSERT INTO `T12b` VALUES ('é¾”'); +SELECT `C1` FROM `T1a` WHERE `C1` IN (SELECT `C1` FROM `T1b`); +C1 +ï½± +SELECT `C1` FROM `T1a` WHERE EXISTS (SELECT `C1` FROM `T1b` WHERE `T1a`.`C1` = `T1b`.`C1`); +C1 +ï½± +SELECT `C1` FROM `T1a` WHERE NOT EXISTS (SELECT `C1` FROM `T1b` WHERE `T1a`.`C1` = `T1b`.`C1`); +C1 +ï½¶ +ï½» +SELECT `C1` FROM `ï¼´ï¼’a` WHERE `C1` IN (SELECT `C1` FROM `ï¼´ï¼’b`); +C1 +ã‚ +SELECT `C1` FROM `ï¼´ï¼’a` WHERE EXISTS (SELECT `C1` FROM `ï¼´ï¼’b` WHERE `ï¼´ï¼’a`.`C1` = `ï¼´ï¼’b`.`C1`); +C1 +ã‚ +SELECT `C1` FROM `ï¼´ï¼’a` WHERE NOT EXISTS (SELECT `C1` FROM `ï¼´ï¼’b` WHERE `ï¼´ï¼’a`.`C1` = `ï¼´ï¼’b`.`C1`); +C1 +ã‹ +ã• +SELECT `C1` FROM `T3a` WHERE `C1` IN (SELECT `C1` FROM `T3b`); +C1 +é¾” +SELECT `C1` FROM `T3a` WHERE EXISTS (SELECT `C1` FROM `T3b` WHERE `T3a`.`C1` = `T3b`.`C1`); +C1 +é¾” +SELECT `C1` FROM `T3a` WHERE NOT EXISTS (SELECT `C1` FROM `T3b` WHERE `T3a`.`C1` = `T3b`.`C1`); +C1 +é¾– +é¾— +SELECT `C1` FROM `ï¼´ï¼”a` WHERE `C1` IN (SELECT `C1` FROM `ï¼´ï¼”b`); +C1 +ï½± +SELECT `C1` FROM `ï¼´ï¼”a` WHERE EXISTS (SELECT `C1` FROM `ï¼´ï¼”b` WHERE `ï¼´ï¼”a`.`C1` = `ï¼´ï¼”b`.`C1`); +C1 +ï½± +SELECT `C1` FROM `ï¼´ï¼”a` WHERE NOT EXISTS (SELECT `C1` FROM `ï¼´ï¼”b` WHERE `ï¼´ï¼”a`.`C1` = `ï¼´ï¼”b`.`C1`); +C1 +ï½¶ +ï½» +SELECT `C1` FROM `T5a` WHERE `C1` IN (SELECT `C1` FROM `T5b`); +C1 +ã‚ +SELECT `C1` FROM `T5a` WHERE EXISTS (SELECT `C1` FROM `T5b` WHERE `T5a`.`C1` = `T5b`.`C1`); +C1 +ã‚ +SELECT `C1` FROM `T5a` WHERE NOT EXISTS (SELECT `C1` FROM `T5b` WHERE `T5a`.`C1` = `T5b`.`C1`); +C1 +ã‹ +ã• +SELECT `C1` FROM `ï¼´ï¼–a` WHERE `C1` IN (SELECT `C1` FROM `ï¼´ï¼–b`); +C1 +é¾” +SELECT `C1` FROM `ï¼´ï¼–a` WHERE EXISTS (SELECT `C1` FROM `ï¼´ï¼–b` WHERE `ï¼´ï¼–a`.`C1` = `ï¼´ï¼–b`.`C1`); +C1 +é¾” +SELECT `C1` FROM `ï¼´ï¼–a` WHERE NOT EXISTS (SELECT `C1` FROM `ï¼´ï¼–b` WHERE `ï¼´ï¼–a`.`C1` = `ï¼´ï¼–b`.`C1`); +C1 +é¾– +é¾— +SELECT `C1` FROM `ï¼´ï¼—a` WHERE `C1` IN (SELECT `C1` FROM `ï¼´ï¼—b`); +C1 +ï½± +SELECT `C1` FROM `ï¼´ï¼—a` WHERE EXISTS (SELECT `C1` FROM `ï¼´ï¼—b` WHERE `ï¼´ï¼—a`.`C1` = `ï¼´ï¼—b`.`C1`); +C1 +ï½± +SELECT `C1` FROM `ï¼´ï¼—a` WHERE NOT EXISTS (SELECT `C1` FROM `ï¼´ï¼—b` WHERE `ï¼´ï¼—a`.`C1` = `ï¼´ï¼—b`.`C1`); +C1 +ï½¶ +ï½» +SELECT `C1` FROM `T8a` WHERE `C1` IN (SELECT `C1` FROM `T8b`); +C1 +ã‚ +SELECT `C1` FROM `T8a` WHERE EXISTS (SELECT `C1` FROM `T8b` WHERE `T8a`.`C1` = `T8b`.`C1`); +C1 +ã‚ +SELECT `C1` FROM `T8a` WHERE NOT EXISTS (SELECT `C1` FROM `T8b` WHERE `T8a`.`C1` = `T8b`.`C1`); +C1 +ã‹ +ã• +SELECT `C1` FROM `ï¼´ï¼™a` WHERE `C1` IN (SELECT `C1` FROM `ï¼´ï¼™b`); +C1 +é¾” +SELECT `C1` FROM `ï¼´ï¼™a` WHERE EXISTS (SELECT `C1` FROM `ï¼´ï¼™b` WHERE `ï¼´ï¼™a`.`C1` = `ï¼´ï¼™b`.`C1`); +C1 +é¾” +SELECT `C1` FROM `ï¼´ï¼™a` WHERE NOT EXISTS (SELECT `C1` FROM `ï¼´ï¼™b` WHERE `ï¼´ï¼™a`.`C1` = `ï¼´ï¼™b`.`C1`); +C1 +é¾– +é¾— +SELECT `C1` FROM `T1ï¼a` WHERE `C1` IN (SELECT `C1` FROM `T1ï¼b`); +C1 +ï½± +SELECT `C1` FROM `T1ï¼a` WHERE EXISTS (SELECT `C1` FROM `T1ï¼b` WHERE `T1ï¼a`.`C1` = `T1ï¼b`.`C1`); +C1 +ï½± +SELECT `C1` FROM `T1ï¼a` WHERE NOT EXISTS (SELECT `C1` FROM `T1ï¼b` WHERE `T1ï¼a`.`C1` = `T1ï¼b`.`C1`); +C1 +ï½¶ +ï½» +SELECT `C1` FROM `T11a` WHERE `C1` IN (SELECT `C1` FROM `T11b`); +C1 +ã‚ +SELECT `C1` FROM `T11a` WHERE EXISTS (SELECT `C1` FROM `T11b` WHERE `T11a`.`C1` = `T11b`.`C1`); +C1 +ã‚ +SELECT `C1` FROM `T11a` WHERE NOT EXISTS (SELECT `C1` FROM `T11b` WHERE `T11a`.`C1` = `T11b`.`C1`); +C1 +ã‹ +ã• +SELECT `C1` FROM `T12a` WHERE `C1` IN (SELECT `C1` FROM `T12b`); +C1 +é¾” +SELECT `C1` FROM `T12a` WHERE EXISTS (SELECT `C1` FROM `T12b` WHERE `T12a`.`C1` = `T12b`.`C1`); +C1 +é¾” +SELECT `C1` FROM `T12a` WHERE NOT EXISTS (SELECT `C1` FROM `T12b` WHERE `T12a`.`C1` = `T12b`.`C1`); +C1 +é¾– +é¾— +DROP TABLE `T1a`; +DROP TABLE `T1b`; +DROP TABLE `ï¼´ï¼’a`; +DROP TABLE `ï¼´ï¼’b`; +DROP TABLE `T3a`; +DROP TABLE `T3b`; +DROP TABLE `ï¼´ï¼”a`; +DROP TABLE `ï¼´ï¼”b`; +DROP TABLE `T5a`; +DROP TABLE `T5b`; +DROP TABLE `ï¼´ï¼–a`; +DROP TABLE `ï¼´ï¼–b`; +DROP TABLE `ï¼´ï¼—a`; +DROP TABLE `ï¼´ï¼—b`; +DROP TABLE `T8a`; +DROP TABLE `T8b`; +DROP TABLE `ï¼´ï¼™a`; +DROP TABLE `ï¼´ï¼™b`; +DROP TABLE `T1ï¼a`; +DROP TABLE `T1ï¼b`; +DROP TABLE `T11a`; +DROP TABLE `T11b`; +DROP TABLE `T12a`; +DROP TABLE `T12b`; diff --git a/mysql-test/suite/jp/r/jp_substring_sjis.result b/mysql-test/suite/jp/r/jp_substring_sjis.result new file mode 100755 index 00000000000..3fe5bf44b86 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_substring_sjis.result @@ -0,0 +1,2738 @@ +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +drop table if exists `‚s‚P‚P`; +drop table if exists `‚s‚P‚Q`; +SET NAMES sjis; +SET character_set_database = sjis; +CREATE TABLE `‚s‚P` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Q` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚R` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚S` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚T` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚U` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚V` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚W` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚X` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚O` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚P` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚Q` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +INSERT INTO `‚s‚P` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +INSERT INTO `‚s‚S` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +INSERT INTO `‚s‚V` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,0) FROM `‚s‚P`; +‚b‚P SUBSTRING(`‚b‚P`,0) + +± +±² +±²³ +±²³´ +±²³´µ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1) FROM `‚s‚P`; +‚b‚P SUBSTRING(`‚b‚P`,1) + +± ± +±² ±² +±²³ ±²³ +±²³´ ±²³´ +±²³´µ ±²³´µ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,2) FROM `‚s‚P`; +‚b‚P SUBSTRING(`‚b‚P`,2) + +± +±² ² +±²³ ²³ +±²³´ ²³´ +±²³´µ ²³´µ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,3) FROM `‚s‚P`; +‚b‚P SUBSTRING(`‚b‚P`,3) + +± +±² +±²³ ³ +±²³´ ³´ +±²³´µ ³´µ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,4) FROM `‚s‚P`; +‚b‚P SUBSTRING(`‚b‚P`,4) + +± +±² +±²³ +±²³´ ´ +±²³´µ ´µ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,5) FROM `‚s‚P`; +‚b‚P SUBSTRING(`‚b‚P`,5) + +± +±² +±²³ +±²³´ +±²³´µ µ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,6) FROM `‚s‚P`; +‚b‚P SUBSTRING(`‚b‚P`,6) + +± +±² +±²³ +±²³´ +±²³´µ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 0) FROM `‚s‚P`; +‚b‚P SUBSTRING(`‚b‚P` FROM 0) + +± +±² +±²³ +±²³´ +±²³´µ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1) FROM `‚s‚P`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1) + +± ± +±² ±² +±²³ ±²³ +±²³´ ±²³´ +±²³´µ ±²³´µ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 2) FROM `‚s‚P`; +‚b‚P SUBSTRING(`‚b‚P` FROM 2) + +± +±² ² +±²³ ²³ +±²³´ ²³´ +±²³´µ ²³´µ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 3) FROM `‚s‚P`; +‚b‚P SUBSTRING(`‚b‚P` FROM 3) + +± +±² +±²³ ³ +±²³´ ³´ +±²³´µ ³´µ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 4) FROM `‚s‚P`; +‚b‚P SUBSTRING(`‚b‚P` FROM 4) + +± +±² +±²³ +±²³´ ´ +±²³´µ ´µ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 5) FROM `‚s‚P`; +‚b‚P SUBSTRING(`‚b‚P` FROM 5) + +± +±² +±²³ +±²³´ +±²³´µ µ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 6) FROM `‚s‚P`; +‚b‚P SUBSTRING(`‚b‚P` FROM 6) + +± +±² +±²³ +±²³´ +±²³´µ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,0) FROM `‚s‚P`; +‚b‚P SUBSTRING(`‚b‚P`,1,0) + +± +±² +±²³ +±²³´ +±²³´µ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,1) FROM `‚s‚P`; +‚b‚P SUBSTRING(`‚b‚P`,1,1) + +± ± +±² ± +±²³ ± +±²³´ ± +±²³´µ ± +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,2) FROM `‚s‚P`; +‚b‚P SUBSTRING(`‚b‚P`,1,2) + +± ± +±² ±² +±²³ ±² +±²³´ ±² +±²³´µ ±² +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,3) FROM `‚s‚P`; +‚b‚P SUBSTRING(`‚b‚P`,1,3) + +± ± +±² ±² +±²³ ±²³ +±²³´ ±²³ +±²³´µ ±²³ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,4) FROM `‚s‚P`; +‚b‚P SUBSTRING(`‚b‚P`,1,4) + +± ± +±² ±² +±²³ ±²³ +±²³´ ±²³´ +±²³´µ ±²³´ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,5) FROM `‚s‚P`; +‚b‚P SUBSTRING(`‚b‚P`,1,5) + +± ± +±² ±² +±²³ ±²³ +±²³´ ±²³´ +±²³´µ ±²³´µ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,6) FROM `‚s‚P`; +‚b‚P SUBSTRING(`‚b‚P`,1,6) + +± ± +±² ±² +±²³ ±²³ +±²³´ ±²³´ +±²³´µ ±²³´µ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 0) FROM `‚s‚P`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 0) + +± +±² +±²³ +±²³´ +±²³´µ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 1) FROM `‚s‚P`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 1) + +± ± +±² ± +±²³ ± +±²³´ ± +±²³´µ ± +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 2) FROM `‚s‚P`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 2) + +± ± +±² ±² +±²³ ±² +±²³´ ±² +±²³´µ ±² +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 3) FROM `‚s‚P`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 3) + +± ± +±² ±² +±²³ ±²³ +±²³´ ±²³ +±²³´µ ±²³ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 4) FROM `‚s‚P`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 4) + +± ± +±² ±² +±²³ ±²³ +±²³´ ±²³´ +±²³´µ ±²³´ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 5) FROM `‚s‚P`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 5) + +± ± +±² ±² +±²³ ±²³ +±²³´ ±²³´ +±²³´µ ±²³´µ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 6) FROM `‚s‚P`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 6) + +± ± +±² ±² +±²³ ±²³ +±²³´ ±²³´ +±²³´µ ±²³´µ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,0) FROM `‚s‚Q`; +‚b‚P SUBSTRING(`‚b‚P`,0) + +‚  +‚ ‚¢ +‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1) FROM `‚s‚Q`; +‚b‚P SUBSTRING(`‚b‚P`,1) + +‚  ‚  +‚ ‚¢ ‚ ‚¢ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,2) FROM `‚s‚Q`; +‚b‚P SUBSTRING(`‚b‚P`,2) + +‚  +‚ ‚¢ ‚¢ +‚ ‚¢‚¤ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,3) FROM `‚s‚Q`; +‚b‚P SUBSTRING(`‚b‚P`,3) + +‚  +‚ ‚¢ +‚ ‚¢‚¤ ‚¤ +‚ ‚¢‚¤‚¦ ‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚¤‚¦‚¨ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,4) FROM `‚s‚Q`; +‚b‚P SUBSTRING(`‚b‚P`,4) + +‚  +‚ ‚¢ +‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚¦‚¨ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,5) FROM `‚s‚Q`; +‚b‚P SUBSTRING(`‚b‚P`,5) + +‚  +‚ ‚¢ +‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚¨ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,6) FROM `‚s‚Q`; +‚b‚P SUBSTRING(`‚b‚P`,6) + +‚  +‚ ‚¢ +‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 0) FROM `‚s‚Q`; +‚b‚P SUBSTRING(`‚b‚P` FROM 0) + +‚  +‚ ‚¢ +‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1) FROM `‚s‚Q`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1) + +‚  ‚  +‚ ‚¢ ‚ ‚¢ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 2) FROM `‚s‚Q`; +‚b‚P SUBSTRING(`‚b‚P` FROM 2) + +‚  +‚ ‚¢ ‚¢ +‚ ‚¢‚¤ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 3) FROM `‚s‚Q`; +‚b‚P SUBSTRING(`‚b‚P` FROM 3) + +‚  +‚ ‚¢ +‚ ‚¢‚¤ ‚¤ +‚ ‚¢‚¤‚¦ ‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚¤‚¦‚¨ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 4) FROM `‚s‚Q`; +‚b‚P SUBSTRING(`‚b‚P` FROM 4) + +‚  +‚ ‚¢ +‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚¦‚¨ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 5) FROM `‚s‚Q`; +‚b‚P SUBSTRING(`‚b‚P` FROM 5) + +‚  +‚ ‚¢ +‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚¨ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 6) FROM `‚s‚Q`; +‚b‚P SUBSTRING(`‚b‚P` FROM 6) + +‚  +‚ ‚¢ +‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,0) FROM `‚s‚Q`; +‚b‚P SUBSTRING(`‚b‚P`,1,0) + +‚  +‚ ‚¢ +‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,1) FROM `‚s‚Q`; +‚b‚P SUBSTRING(`‚b‚P`,1,1) + +‚  ‚  +‚ ‚¢ ‚  +‚ ‚¢‚¤ ‚  +‚ ‚¢‚¤‚¦ ‚  +‚ ‚¢‚¤‚¦‚¨ ‚  +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,2) FROM `‚s‚Q`; +‚b‚P SUBSTRING(`‚b‚P`,1,2) + +‚  ‚  +‚ ‚¢ ‚ ‚¢ +‚ ‚¢‚¤ ‚ ‚¢ +‚ ‚¢‚¤‚¦ ‚ ‚¢ +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,3) FROM `‚s‚Q`; +‚b‚P SUBSTRING(`‚b‚P`,1,3) + +‚  ‚  +‚ ‚¢ ‚ ‚¢ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,4) FROM `‚s‚Q`; +‚b‚P SUBSTRING(`‚b‚P`,1,4) + +‚  ‚  +‚ ‚¢ ‚ ‚¢ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,5) FROM `‚s‚Q`; +‚b‚P SUBSTRING(`‚b‚P`,1,5) + +‚  ‚  +‚ ‚¢ ‚ ‚¢ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,6) FROM `‚s‚Q`; +‚b‚P SUBSTRING(`‚b‚P`,1,6) + +‚  ‚  +‚ ‚¢ ‚ ‚¢ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 0) FROM `‚s‚Q`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 0) + +‚  +‚ ‚¢ +‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 1) FROM `‚s‚Q`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 1) + +‚  ‚  +‚ ‚¢ ‚  +‚ ‚¢‚¤ ‚  +‚ ‚¢‚¤‚¦ ‚  +‚ ‚¢‚¤‚¦‚¨ ‚  +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 2) FROM `‚s‚Q`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 2) + +‚  ‚  +‚ ‚¢ ‚ ‚¢ +‚ ‚¢‚¤ ‚ ‚¢ +‚ ‚¢‚¤‚¦ ‚ ‚¢ +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 3) FROM `‚s‚Q`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 3) + +‚  ‚  +‚ ‚¢ ‚ ‚¢ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 4) FROM `‚s‚Q`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 4) + +‚  ‚  +‚ ‚¢ ‚ ‚¢ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 5) FROM `‚s‚Q`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 5) + +‚  ‚  +‚ ‚¢ ‚ ‚¢ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 6) FROM `‚s‚Q`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 6) + +‚  ‚  +‚ ‚¢ ‚ ‚¢ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,0) FROM `‚s‚R`; +‚b‚P SUBSTRING(`‚b‚P`,0) + +ƒ\ +ƒ\\ +ƒ\\•\ +ƒ\\•\—\ +ƒ\\•\—\\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1) FROM `‚s‚R`; +‚b‚P SUBSTRING(`‚b‚P`,1) + +ƒ\ ƒ\ +ƒ\\ ƒ\\ +ƒ\\•\ ƒ\\•\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\—\\ ƒ\\•\—\\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,2) FROM `‚s‚R`; +‚b‚P SUBSTRING(`‚b‚P`,2) + +ƒ\ +ƒ\\ \ +ƒ\\•\ \•\ +ƒ\\•\—\ \•\—\ +ƒ\\•\—\\ \•\—\\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,3) FROM `‚s‚R`; +‚b‚P SUBSTRING(`‚b‚P`,3) + +ƒ\ +ƒ\\ +ƒ\\•\ •\ +ƒ\\•\—\ •\—\ +ƒ\\•\—\\ •\—\\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,4) FROM `‚s‚R`; +‚b‚P SUBSTRING(`‚b‚P`,4) + +ƒ\ +ƒ\\ +ƒ\\•\ +ƒ\\•\—\ —\ +ƒ\\•\—\\ —\\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,5) FROM `‚s‚R`; +‚b‚P SUBSTRING(`‚b‚P`,5) + +ƒ\ +ƒ\\ +ƒ\\•\ +ƒ\\•\—\ +ƒ\\•\—\\ \ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,6) FROM `‚s‚R`; +‚b‚P SUBSTRING(`‚b‚P`,6) + +ƒ\ +ƒ\\ +ƒ\\•\ +ƒ\\•\—\ +ƒ\\•\—\\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 0) FROM `‚s‚R`; +‚b‚P SUBSTRING(`‚b‚P` FROM 0) + +ƒ\ +ƒ\\ +ƒ\\•\ +ƒ\\•\—\ +ƒ\\•\—\\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1) FROM `‚s‚R`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1) + +ƒ\ ƒ\ +ƒ\\ ƒ\\ +ƒ\\•\ ƒ\\•\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\—\\ ƒ\\•\—\\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 2) FROM `‚s‚R`; +‚b‚P SUBSTRING(`‚b‚P` FROM 2) + +ƒ\ +ƒ\\ \ +ƒ\\•\ \•\ +ƒ\\•\—\ \•\—\ +ƒ\\•\—\\ \•\—\\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 3) FROM `‚s‚R`; +‚b‚P SUBSTRING(`‚b‚P` FROM 3) + +ƒ\ +ƒ\\ +ƒ\\•\ •\ +ƒ\\•\—\ •\—\ +ƒ\\•\—\\ •\—\\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 4) FROM `‚s‚R`; +‚b‚P SUBSTRING(`‚b‚P` FROM 4) + +ƒ\ +ƒ\\ +ƒ\\•\ +ƒ\\•\—\ —\ +ƒ\\•\—\\ —\\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 5) FROM `‚s‚R`; +‚b‚P SUBSTRING(`‚b‚P` FROM 5) + +ƒ\ +ƒ\\ +ƒ\\•\ +ƒ\\•\—\ +ƒ\\•\—\\ \ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 6) FROM `‚s‚R`; +‚b‚P SUBSTRING(`‚b‚P` FROM 6) + +ƒ\ +ƒ\\ +ƒ\\•\ +ƒ\\•\—\ +ƒ\\•\—\\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,0) FROM `‚s‚R`; +‚b‚P SUBSTRING(`‚b‚P`,1,0) + +ƒ\ +ƒ\\ +ƒ\\•\ +ƒ\\•\—\ +ƒ\\•\—\\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,1) FROM `‚s‚R`; +‚b‚P SUBSTRING(`‚b‚P`,1,1) + +ƒ\ ƒ\ +ƒ\\ ƒ\ +ƒ\\•\ ƒ\ +ƒ\\•\—\ ƒ\ +ƒ\\•\—\\ ƒ\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,2) FROM `‚s‚R`; +‚b‚P SUBSTRING(`‚b‚P`,1,2) + +ƒ\ ƒ\ +ƒ\\ ƒ\\ +ƒ\\•\ ƒ\\ +ƒ\\•\—\ ƒ\\ +ƒ\\•\—\\ ƒ\\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,3) FROM `‚s‚R`; +‚b‚P SUBSTRING(`‚b‚P`,1,3) + +ƒ\ ƒ\ +ƒ\\ ƒ\\ +ƒ\\•\ ƒ\\•\ +ƒ\\•\—\ ƒ\\•\ +ƒ\\•\—\\ ƒ\\•\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,4) FROM `‚s‚R`; +‚b‚P SUBSTRING(`‚b‚P`,1,4) + +ƒ\ ƒ\ +ƒ\\ ƒ\\ +ƒ\\•\ ƒ\\•\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\—\\ ƒ\\•\—\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,5) FROM `‚s‚R`; +‚b‚P SUBSTRING(`‚b‚P`,1,5) + +ƒ\ ƒ\ +ƒ\\ ƒ\\ +ƒ\\•\ ƒ\\•\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\—\\ ƒ\\•\—\\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,6) FROM `‚s‚R`; +‚b‚P SUBSTRING(`‚b‚P`,1,6) + +ƒ\ ƒ\ +ƒ\\ ƒ\\ +ƒ\\•\ ƒ\\•\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\—\\ ƒ\\•\—\\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 0) FROM `‚s‚R`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 0) + +ƒ\ +ƒ\\ +ƒ\\•\ +ƒ\\•\—\ +ƒ\\•\—\\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 1) FROM `‚s‚R`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 1) + +ƒ\ ƒ\ +ƒ\\ ƒ\ +ƒ\\•\ ƒ\ +ƒ\\•\—\ ƒ\ +ƒ\\•\—\\ ƒ\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 2) FROM `‚s‚R`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 2) + +ƒ\ ƒ\ +ƒ\\ ƒ\\ +ƒ\\•\ ƒ\\ +ƒ\\•\—\ ƒ\\ +ƒ\\•\—\\ ƒ\\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 3) FROM `‚s‚R`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 3) + +ƒ\ ƒ\ +ƒ\\ ƒ\\ +ƒ\\•\ ƒ\\•\ +ƒ\\•\—\ ƒ\\•\ +ƒ\\•\—\\ ƒ\\•\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 4) FROM `‚s‚R`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 4) + +ƒ\ ƒ\ +ƒ\\ ƒ\\ +ƒ\\•\ ƒ\\•\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\—\\ ƒ\\•\—\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 5) FROM `‚s‚R`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 5) + +ƒ\ ƒ\ +ƒ\\ ƒ\\ +ƒ\\•\ ƒ\\•\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\—\\ ƒ\\•\—\\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 6) FROM `‚s‚R`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 6) + +ƒ\ ƒ\ +ƒ\\ ƒ\\ +ƒ\\•\ ƒ\\•\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\—\\ ƒ\\•\—\\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,0) FROM `‚s‚S`; +‚b‚P SUBSTRING(`‚b‚P`,0) + +± +±² +±²³ +±²³´ +±²³´µ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1) FROM `‚s‚S`; +‚b‚P SUBSTRING(`‚b‚P`,1) + +± ± +±² ±² +±²³ ±²³ +±²³´ ±²³´ +±²³´µ ±²³´µ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,2) FROM `‚s‚S`; +‚b‚P SUBSTRING(`‚b‚P`,2) + +± +±² ² +±²³ ²³ +±²³´ ²³´ +±²³´µ ²³´µ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,3) FROM `‚s‚S`; +‚b‚P SUBSTRING(`‚b‚P`,3) + +± +±² +±²³ ³ +±²³´ ³´ +±²³´µ ³´µ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,4) FROM `‚s‚S`; +‚b‚P SUBSTRING(`‚b‚P`,4) + +± +±² +±²³ +±²³´ ´ +±²³´µ ´µ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,5) FROM `‚s‚S`; +‚b‚P SUBSTRING(`‚b‚P`,5) + +± +±² +±²³ +±²³´ +±²³´µ µ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,6) FROM `‚s‚S`; +‚b‚P SUBSTRING(`‚b‚P`,6) + +± +±² +±²³ +±²³´ +±²³´µ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 0) FROM `‚s‚S`; +‚b‚P SUBSTRING(`‚b‚P` FROM 0) + +± +±² +±²³ +±²³´ +±²³´µ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1) FROM `‚s‚S`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1) + +± ± +±² ±² +±²³ ±²³ +±²³´ ±²³´ +±²³´µ ±²³´µ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 2) FROM `‚s‚S`; +‚b‚P SUBSTRING(`‚b‚P` FROM 2) + +± +±² ² +±²³ ²³ +±²³´ ²³´ +±²³´µ ²³´µ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 3) FROM `‚s‚S`; +‚b‚P SUBSTRING(`‚b‚P` FROM 3) + +± +±² +±²³ ³ +±²³´ ³´ +±²³´µ ³´µ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 4) FROM `‚s‚S`; +‚b‚P SUBSTRING(`‚b‚P` FROM 4) + +± +±² +±²³ +±²³´ ´ +±²³´µ ´µ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 5) FROM `‚s‚S`; +‚b‚P SUBSTRING(`‚b‚P` FROM 5) + +± +±² +±²³ +±²³´ +±²³´µ µ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 6) FROM `‚s‚S`; +‚b‚P SUBSTRING(`‚b‚P` FROM 6) + +± +±² +±²³ +±²³´ +±²³´µ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,0) FROM `‚s‚S`; +‚b‚P SUBSTRING(`‚b‚P`,1,0) + +± +±² +±²³ +±²³´ +±²³´µ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,1) FROM `‚s‚S`; +‚b‚P SUBSTRING(`‚b‚P`,1,1) + +± ± +±² ± +±²³ ± +±²³´ ± +±²³´µ ± +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,2) FROM `‚s‚S`; +‚b‚P SUBSTRING(`‚b‚P`,1,2) + +± ± +±² ±² +±²³ ±² +±²³´ ±² +±²³´µ ±² +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,3) FROM `‚s‚S`; +‚b‚P SUBSTRING(`‚b‚P`,1,3) + +± ± +±² ±² +±²³ ±²³ +±²³´ ±²³ +±²³´µ ±²³ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,4) FROM `‚s‚S`; +‚b‚P SUBSTRING(`‚b‚P`,1,4) + +± ± +±² ±² +±²³ ±²³ +±²³´ ±²³´ +±²³´µ ±²³´ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,5) FROM `‚s‚S`; +‚b‚P SUBSTRING(`‚b‚P`,1,5) + +± ± +±² ±² +±²³ ±²³ +±²³´ ±²³´ +±²³´µ ±²³´µ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,6) FROM `‚s‚S`; +‚b‚P SUBSTRING(`‚b‚P`,1,6) + +± ± +±² ±² +±²³ ±²³ +±²³´ ±²³´ +±²³´µ ±²³´µ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 0) FROM `‚s‚S`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 0) + +± +±² +±²³ +±²³´ +±²³´µ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 1) FROM `‚s‚S`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 1) + +± ± +±² ± +±²³ ± +±²³´ ± +±²³´µ ± +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 2) FROM `‚s‚S`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 2) + +± ± +±² ±² +±²³ ±² +±²³´ ±² +±²³´µ ±² +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 3) FROM `‚s‚S`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 3) + +± ± +±² ±² +±²³ ±²³ +±²³´ ±²³ +±²³´µ ±²³ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 4) FROM `‚s‚S`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 4) + +± ± +±² ±² +±²³ ±²³ +±²³´ ±²³´ +±²³´µ ±²³´ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 5) FROM `‚s‚S`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 5) + +± ± +±² ±² +±²³ ±²³ +±²³´ ±²³´ +±²³´µ ±²³´µ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 6) FROM `‚s‚S`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 6) + +± ± +±² ±² +±²³ ±²³ +±²³´ ±²³´ +±²³´µ ±²³´µ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,0) FROM `‚s‚T`; +‚b‚P SUBSTRING(`‚b‚P`,0) + +‚  +‚ ‚¢ +‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1) FROM `‚s‚T`; +‚b‚P SUBSTRING(`‚b‚P`,1) + +‚  ‚  +‚ ‚¢ ‚ ‚¢ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,2) FROM `‚s‚T`; +‚b‚P SUBSTRING(`‚b‚P`,2) + +‚  +‚ ‚¢ ‚¢ +‚ ‚¢‚¤ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,3) FROM `‚s‚T`; +‚b‚P SUBSTRING(`‚b‚P`,3) + +‚  +‚ ‚¢ +‚ ‚¢‚¤ ‚¤ +‚ ‚¢‚¤‚¦ ‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚¤‚¦‚¨ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,4) FROM `‚s‚T`; +‚b‚P SUBSTRING(`‚b‚P`,4) + +‚  +‚ ‚¢ +‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚¦‚¨ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,5) FROM `‚s‚T`; +‚b‚P SUBSTRING(`‚b‚P`,5) + +‚  +‚ ‚¢ +‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚¨ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,6) FROM `‚s‚T`; +‚b‚P SUBSTRING(`‚b‚P`,6) + +‚  +‚ ‚¢ +‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 0) FROM `‚s‚T`; +‚b‚P SUBSTRING(`‚b‚P` FROM 0) + +‚  +‚ ‚¢ +‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1) FROM `‚s‚T`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1) + +‚  ‚  +‚ ‚¢ ‚ ‚¢ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 2) FROM `‚s‚T`; +‚b‚P SUBSTRING(`‚b‚P` FROM 2) + +‚  +‚ ‚¢ ‚¢ +‚ ‚¢‚¤ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 3) FROM `‚s‚T`; +‚b‚P SUBSTRING(`‚b‚P` FROM 3) + +‚  +‚ ‚¢ +‚ ‚¢‚¤ ‚¤ +‚ ‚¢‚¤‚¦ ‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚¤‚¦‚¨ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 4) FROM `‚s‚T`; +‚b‚P SUBSTRING(`‚b‚P` FROM 4) + +‚  +‚ ‚¢ +‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚¦‚¨ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 5) FROM `‚s‚T`; +‚b‚P SUBSTRING(`‚b‚P` FROM 5) + +‚  +‚ ‚¢ +‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚¨ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 6) FROM `‚s‚T`; +‚b‚P SUBSTRING(`‚b‚P` FROM 6) + +‚  +‚ ‚¢ +‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,0) FROM `‚s‚T`; +‚b‚P SUBSTRING(`‚b‚P`,1,0) + +‚  +‚ ‚¢ +‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,1) FROM `‚s‚T`; +‚b‚P SUBSTRING(`‚b‚P`,1,1) + +‚  ‚  +‚ ‚¢ ‚  +‚ ‚¢‚¤ ‚  +‚ ‚¢‚¤‚¦ ‚  +‚ ‚¢‚¤‚¦‚¨ ‚  +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,2) FROM `‚s‚T`; +‚b‚P SUBSTRING(`‚b‚P`,1,2) + +‚  ‚  +‚ ‚¢ ‚ ‚¢ +‚ ‚¢‚¤ ‚ ‚¢ +‚ ‚¢‚¤‚¦ ‚ ‚¢ +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,3) FROM `‚s‚T`; +‚b‚P SUBSTRING(`‚b‚P`,1,3) + +‚  ‚  +‚ ‚¢ ‚ ‚¢ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,4) FROM `‚s‚T`; +‚b‚P SUBSTRING(`‚b‚P`,1,4) + +‚  ‚  +‚ ‚¢ ‚ ‚¢ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,5) FROM `‚s‚T`; +‚b‚P SUBSTRING(`‚b‚P`,1,5) + +‚  ‚  +‚ ‚¢ ‚ ‚¢ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,6) FROM `‚s‚T`; +‚b‚P SUBSTRING(`‚b‚P`,1,6) + +‚  ‚  +‚ ‚¢ ‚ ‚¢ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 0) FROM `‚s‚T`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 0) + +‚  +‚ ‚¢ +‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 1) FROM `‚s‚T`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 1) + +‚  ‚  +‚ ‚¢ ‚  +‚ ‚¢‚¤ ‚  +‚ ‚¢‚¤‚¦ ‚  +‚ ‚¢‚¤‚¦‚¨ ‚  +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 2) FROM `‚s‚T`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 2) + +‚  ‚  +‚ ‚¢ ‚ ‚¢ +‚ ‚¢‚¤ ‚ ‚¢ +‚ ‚¢‚¤‚¦ ‚ ‚¢ +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 3) FROM `‚s‚T`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 3) + +‚  ‚  +‚ ‚¢ ‚ ‚¢ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 4) FROM `‚s‚T`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 4) + +‚  ‚  +‚ ‚¢ ‚ ‚¢ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 5) FROM `‚s‚T`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 5) + +‚  ‚  +‚ ‚¢ ‚ ‚¢ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 6) FROM `‚s‚T`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 6) + +‚  ‚  +‚ ‚¢ ‚ ‚¢ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,0) FROM `‚s‚U`; +‚b‚P SUBSTRING(`‚b‚P`,0) + +ƒ\ +ƒ\\ +ƒ\\•\ +ƒ\\•\—\ +ƒ\\•\—\\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1) FROM `‚s‚U`; +‚b‚P SUBSTRING(`‚b‚P`,1) + +ƒ\ ƒ\ +ƒ\\ ƒ\\ +ƒ\\•\ ƒ\\•\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\—\\ ƒ\\•\—\\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,2) FROM `‚s‚U`; +‚b‚P SUBSTRING(`‚b‚P`,2) + +ƒ\ +ƒ\\ \ +ƒ\\•\ \•\ +ƒ\\•\—\ \•\—\ +ƒ\\•\—\\ \•\—\\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,3) FROM `‚s‚U`; +‚b‚P SUBSTRING(`‚b‚P`,3) + +ƒ\ +ƒ\\ +ƒ\\•\ •\ +ƒ\\•\—\ •\—\ +ƒ\\•\—\\ •\—\\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,4) FROM `‚s‚U`; +‚b‚P SUBSTRING(`‚b‚P`,4) + +ƒ\ +ƒ\\ +ƒ\\•\ +ƒ\\•\—\ —\ +ƒ\\•\—\\ —\\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,5) FROM `‚s‚U`; +‚b‚P SUBSTRING(`‚b‚P`,5) + +ƒ\ +ƒ\\ +ƒ\\•\ +ƒ\\•\—\ +ƒ\\•\—\\ \ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,6) FROM `‚s‚U`; +‚b‚P SUBSTRING(`‚b‚P`,6) + +ƒ\ +ƒ\\ +ƒ\\•\ +ƒ\\•\—\ +ƒ\\•\—\\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 0) FROM `‚s‚U`; +‚b‚P SUBSTRING(`‚b‚P` FROM 0) + +ƒ\ +ƒ\\ +ƒ\\•\ +ƒ\\•\—\ +ƒ\\•\—\\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1) FROM `‚s‚U`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1) + +ƒ\ ƒ\ +ƒ\\ ƒ\\ +ƒ\\•\ ƒ\\•\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\—\\ ƒ\\•\—\\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 2) FROM `‚s‚U`; +‚b‚P SUBSTRING(`‚b‚P` FROM 2) + +ƒ\ +ƒ\\ \ +ƒ\\•\ \•\ +ƒ\\•\—\ \•\—\ +ƒ\\•\—\\ \•\—\\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 3) FROM `‚s‚U`; +‚b‚P SUBSTRING(`‚b‚P` FROM 3) + +ƒ\ +ƒ\\ +ƒ\\•\ •\ +ƒ\\•\—\ •\—\ +ƒ\\•\—\\ •\—\\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 4) FROM `‚s‚U`; +‚b‚P SUBSTRING(`‚b‚P` FROM 4) + +ƒ\ +ƒ\\ +ƒ\\•\ +ƒ\\•\—\ —\ +ƒ\\•\—\\ —\\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 5) FROM `‚s‚U`; +‚b‚P SUBSTRING(`‚b‚P` FROM 5) + +ƒ\ +ƒ\\ +ƒ\\•\ +ƒ\\•\—\ +ƒ\\•\—\\ \ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 6) FROM `‚s‚U`; +‚b‚P SUBSTRING(`‚b‚P` FROM 6) + +ƒ\ +ƒ\\ +ƒ\\•\ +ƒ\\•\—\ +ƒ\\•\—\\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,0) FROM `‚s‚U`; +‚b‚P SUBSTRING(`‚b‚P`,1,0) + +ƒ\ +ƒ\\ +ƒ\\•\ +ƒ\\•\—\ +ƒ\\•\—\\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,1) FROM `‚s‚U`; +‚b‚P SUBSTRING(`‚b‚P`,1,1) + +ƒ\ ƒ\ +ƒ\\ ƒ\ +ƒ\\•\ ƒ\ +ƒ\\•\—\ ƒ\ +ƒ\\•\—\\ ƒ\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,2) FROM `‚s‚U`; +‚b‚P SUBSTRING(`‚b‚P`,1,2) + +ƒ\ ƒ\ +ƒ\\ ƒ\\ +ƒ\\•\ ƒ\\ +ƒ\\•\—\ ƒ\\ +ƒ\\•\—\\ ƒ\\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,3) FROM `‚s‚U`; +‚b‚P SUBSTRING(`‚b‚P`,1,3) + +ƒ\ ƒ\ +ƒ\\ ƒ\\ +ƒ\\•\ ƒ\\•\ +ƒ\\•\—\ ƒ\\•\ +ƒ\\•\—\\ ƒ\\•\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,4) FROM `‚s‚U`; +‚b‚P SUBSTRING(`‚b‚P`,1,4) + +ƒ\ ƒ\ +ƒ\\ ƒ\\ +ƒ\\•\ ƒ\\•\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\—\\ ƒ\\•\—\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,5) FROM `‚s‚U`; +‚b‚P SUBSTRING(`‚b‚P`,1,5) + +ƒ\ ƒ\ +ƒ\\ ƒ\\ +ƒ\\•\ ƒ\\•\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\—\\ ƒ\\•\—\\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,6) FROM `‚s‚U`; +‚b‚P SUBSTRING(`‚b‚P`,1,6) + +ƒ\ ƒ\ +ƒ\\ ƒ\\ +ƒ\\•\ ƒ\\•\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\—\\ ƒ\\•\—\\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 0) FROM `‚s‚U`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 0) + +ƒ\ +ƒ\\ +ƒ\\•\ +ƒ\\•\—\ +ƒ\\•\—\\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 1) FROM `‚s‚U`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 1) + +ƒ\ ƒ\ +ƒ\\ ƒ\ +ƒ\\•\ ƒ\ +ƒ\\•\—\ ƒ\ +ƒ\\•\—\\ ƒ\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 2) FROM `‚s‚U`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 2) + +ƒ\ ƒ\ +ƒ\\ ƒ\\ +ƒ\\•\ ƒ\\ +ƒ\\•\—\ ƒ\\ +ƒ\\•\—\\ ƒ\\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 3) FROM `‚s‚U`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 3) + +ƒ\ ƒ\ +ƒ\\ ƒ\\ +ƒ\\•\ ƒ\\•\ +ƒ\\•\—\ ƒ\\•\ +ƒ\\•\—\\ ƒ\\•\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 4) FROM `‚s‚U`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 4) + +ƒ\ ƒ\ +ƒ\\ ƒ\\ +ƒ\\•\ ƒ\\•\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\—\\ ƒ\\•\—\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 5) FROM `‚s‚U`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 5) + +ƒ\ ƒ\ +ƒ\\ ƒ\\ +ƒ\\•\ ƒ\\•\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\—\\ ƒ\\•\—\\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 6) FROM `‚s‚U`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 6) + +ƒ\ ƒ\ +ƒ\\ ƒ\\ +ƒ\\•\ ƒ\\•\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\—\\ ƒ\\•\—\\ +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,0) FROM `‚s‚V`; +‚b‚P SUBSTRING(`‚b‚P`,0) +±²³´µ +±²³´ +±²³ +±² +± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1) FROM `‚s‚V`; +‚b‚P SUBSTRING(`‚b‚P`,1) +±²³´µ ±²³´µ +±²³´ ±²³´ +±²³ ±²³ +±² ±² +± ± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,2) FROM `‚s‚V`; +‚b‚P SUBSTRING(`‚b‚P`,2) +±²³´µ ²³´µ +±²³´ ²³´ +±²³ ²³ +±² ² +± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,3) FROM `‚s‚V`; +‚b‚P SUBSTRING(`‚b‚P`,3) +±²³´µ ³´µ +±²³´ ³´ +±²³ ³ +±² +± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,4) FROM `‚s‚V`; +‚b‚P SUBSTRING(`‚b‚P`,4) +±²³´µ ´µ +±²³´ ´ +±²³ +±² +± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,5) FROM `‚s‚V`; +‚b‚P SUBSTRING(`‚b‚P`,5) +±²³´µ µ +±²³´ +±²³ +±² +± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,6) FROM `‚s‚V`; +‚b‚P SUBSTRING(`‚b‚P`,6) +±²³´µ +±²³´ +±²³ +±² +± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 0) FROM `‚s‚V`; +‚b‚P SUBSTRING(`‚b‚P` FROM 0) +±²³´µ +±²³´ +±²³ +±² +± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1) FROM `‚s‚V`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1) +±²³´µ ±²³´µ +±²³´ ±²³´ +±²³ ±²³ +±² ±² +± ± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 2) FROM `‚s‚V`; +‚b‚P SUBSTRING(`‚b‚P` FROM 2) +±²³´µ ²³´µ +±²³´ ²³´ +±²³ ²³ +±² ² +± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 3) FROM `‚s‚V`; +‚b‚P SUBSTRING(`‚b‚P` FROM 3) +±²³´µ ³´µ +±²³´ ³´ +±²³ ³ +±² +± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 4) FROM `‚s‚V`; +‚b‚P SUBSTRING(`‚b‚P` FROM 4) +±²³´µ ´µ +±²³´ ´ +±²³ +±² +± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 5) FROM `‚s‚V`; +‚b‚P SUBSTRING(`‚b‚P` FROM 5) +±²³´µ µ +±²³´ +±²³ +±² +± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 6) FROM `‚s‚V`; +‚b‚P SUBSTRING(`‚b‚P` FROM 6) +±²³´µ +±²³´ +±²³ +±² +± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,0) FROM `‚s‚V`; +‚b‚P SUBSTRING(`‚b‚P`,1,0) +±²³´µ +±²³´ +±²³ +±² +± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,1) FROM `‚s‚V`; +‚b‚P SUBSTRING(`‚b‚P`,1,1) +±²³´µ ± +±²³´ ± +±²³ ± +±² ± +± ± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,2) FROM `‚s‚V`; +‚b‚P SUBSTRING(`‚b‚P`,1,2) +±²³´µ ±² +±²³´ ±² +±²³ ±² +±² ±² +± ± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,3) FROM `‚s‚V`; +‚b‚P SUBSTRING(`‚b‚P`,1,3) +±²³´µ ±²³ +±²³´ ±²³ +±²³ ±²³ +±² ±² +± ± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,4) FROM `‚s‚V`; +‚b‚P SUBSTRING(`‚b‚P`,1,4) +±²³´µ ±²³´ +±²³´ ±²³´ +±²³ ±²³ +±² ±² +± ± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,5) FROM `‚s‚V`; +‚b‚P SUBSTRING(`‚b‚P`,1,5) +±²³´µ ±²³´µ +±²³´ ±²³´ +±²³ ±²³ +±² ±² +± ± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,6) FROM `‚s‚V`; +‚b‚P SUBSTRING(`‚b‚P`,1,6) +±²³´µ ±²³´µ +±²³´ ±²³´ +±²³ ±²³ +±² ±² +± ± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 0) FROM `‚s‚V`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 0) +±²³´µ +±²³´ +±²³ +±² +± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 1) FROM `‚s‚V`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 1) +±²³´µ ± +±²³´ ± +±²³ ± +±² ± +± ± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 2) FROM `‚s‚V`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 2) +±²³´µ ±² +±²³´ ±² +±²³ ±² +±² ±² +± ± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 3) FROM `‚s‚V`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 3) +±²³´µ ±²³ +±²³´ ±²³ +±²³ ±²³ +±² ±² +± ± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 4) FROM `‚s‚V`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 4) +±²³´µ ±²³´ +±²³´ ±²³´ +±²³ ±²³ +±² ±² +± ± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 5) FROM `‚s‚V`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 5) +±²³´µ ±²³´µ +±²³´ ±²³´ +±²³ ±²³ +±² ±² +± ± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 6) FROM `‚s‚V`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 6) +±²³´µ ±²³´µ +±²³´ ±²³´ +±²³ ±²³ +±² ±² +± ± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,0) FROM `‚s‚W`; +‚b‚P SUBSTRING(`‚b‚P`,0) +‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ +‚ ‚¢ +‚  + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1) FROM `‚s‚W`; +‚b‚P SUBSTRING(`‚b‚P`,1) +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢ ‚ ‚¢ +‚  ‚  + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,2) FROM `‚s‚W`; +‚b‚P SUBSTRING(`‚b‚P`,2) +‚ ‚¢‚¤‚¦‚¨ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ ‚¢‚¤‚¦ +‚ ‚¢‚¤ ‚¢‚¤ +‚ ‚¢ ‚¢ +‚  + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,3) FROM `‚s‚W`; +‚b‚P SUBSTRING(`‚b‚P`,3) +‚ ‚¢‚¤‚¦‚¨ ‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ ‚¤‚¦ +‚ ‚¢‚¤ ‚¤ +‚ ‚¢ +‚  + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,4) FROM `‚s‚W`; +‚b‚P SUBSTRING(`‚b‚P`,4) +‚ ‚¢‚¤‚¦‚¨ ‚¦‚¨ +‚ ‚¢‚¤‚¦ ‚¦ +‚ ‚¢‚¤ +‚ ‚¢ +‚  + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,5) FROM `‚s‚W`; +‚b‚P SUBSTRING(`‚b‚P`,5) +‚ ‚¢‚¤‚¦‚¨ ‚¨ +‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ +‚ ‚¢ +‚  + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,6) FROM `‚s‚W`; +‚b‚P SUBSTRING(`‚b‚P`,6) +‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ +‚ ‚¢ +‚  + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 0) FROM `‚s‚W`; +‚b‚P SUBSTRING(`‚b‚P` FROM 0) +‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ +‚ ‚¢ +‚  + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1) FROM `‚s‚W`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1) +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢ ‚ ‚¢ +‚  ‚  + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 2) FROM `‚s‚W`; +‚b‚P SUBSTRING(`‚b‚P` FROM 2) +‚ ‚¢‚¤‚¦‚¨ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ ‚¢‚¤‚¦ +‚ ‚¢‚¤ ‚¢‚¤ +‚ ‚¢ ‚¢ +‚  + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 3) FROM `‚s‚W`; +‚b‚P SUBSTRING(`‚b‚P` FROM 3) +‚ ‚¢‚¤‚¦‚¨ ‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ ‚¤‚¦ +‚ ‚¢‚¤ ‚¤ +‚ ‚¢ +‚  + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 4) FROM `‚s‚W`; +‚b‚P SUBSTRING(`‚b‚P` FROM 4) +‚ ‚¢‚¤‚¦‚¨ ‚¦‚¨ +‚ ‚¢‚¤‚¦ ‚¦ +‚ ‚¢‚¤ +‚ ‚¢ +‚  + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 5) FROM `‚s‚W`; +‚b‚P SUBSTRING(`‚b‚P` FROM 5) +‚ ‚¢‚¤‚¦‚¨ ‚¨ +‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ +‚ ‚¢ +‚  + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 6) FROM `‚s‚W`; +‚b‚P SUBSTRING(`‚b‚P` FROM 6) +‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ +‚ ‚¢ +‚  + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,0) FROM `‚s‚W`; +‚b‚P SUBSTRING(`‚b‚P`,1,0) +‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ +‚ ‚¢ +‚  + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,1) FROM `‚s‚W`; +‚b‚P SUBSTRING(`‚b‚P`,1,1) +‚ ‚¢‚¤‚¦‚¨ ‚  +‚ ‚¢‚¤‚¦ ‚  +‚ ‚¢‚¤ ‚  +‚ ‚¢ ‚  +‚  ‚  + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,2) FROM `‚s‚W`; +‚b‚P SUBSTRING(`‚b‚P`,1,2) +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢ +‚ ‚¢‚¤‚¦ ‚ ‚¢ +‚ ‚¢‚¤ ‚ ‚¢ +‚ ‚¢ ‚ ‚¢ +‚  ‚  + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,3) FROM `‚s‚W`; +‚b‚P SUBSTRING(`‚b‚P`,1,3) +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢ ‚ ‚¢ +‚  ‚  + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,4) FROM `‚s‚W`; +‚b‚P SUBSTRING(`‚b‚P`,1,4) +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢ ‚ ‚¢ +‚  ‚  + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,5) FROM `‚s‚W`; +‚b‚P SUBSTRING(`‚b‚P`,1,5) +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢ ‚ ‚¢ +‚  ‚  + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,6) FROM `‚s‚W`; +‚b‚P SUBSTRING(`‚b‚P`,1,6) +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢ ‚ ‚¢ +‚  ‚  + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 0) FROM `‚s‚W`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 0) +‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ +‚ ‚¢ +‚  + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 1) FROM `‚s‚W`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 1) +‚ ‚¢‚¤‚¦‚¨ ‚  +‚ ‚¢‚¤‚¦ ‚  +‚ ‚¢‚¤ ‚  +‚ ‚¢ ‚  +‚  ‚  + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 2) FROM `‚s‚W`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 2) +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢ +‚ ‚¢‚¤‚¦ ‚ ‚¢ +‚ ‚¢‚¤ ‚ ‚¢ +‚ ‚¢ ‚ ‚¢ +‚  ‚  + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 3) FROM `‚s‚W`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 3) +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢ ‚ ‚¢ +‚  ‚  + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 4) FROM `‚s‚W`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 4) +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢ ‚ ‚¢ +‚  ‚  + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 5) FROM `‚s‚W`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 5) +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢ ‚ ‚¢ +‚  ‚  + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 6) FROM `‚s‚W`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 6) +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢ ‚ ‚¢ +‚  ‚  + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,0) FROM `‚s‚X`; +‚b‚P SUBSTRING(`‚b‚P`,0) +ƒ\\•\—\\ +ƒ\\•\—\ +ƒ\\•\ +ƒ\\ +ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1) FROM `‚s‚X`; +‚b‚P SUBSTRING(`‚b‚P`,1) +ƒ\\•\—\\ ƒ\\•\—\\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\ ƒ\\•\ +ƒ\\ ƒ\\ +ƒ\ ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,2) FROM `‚s‚X`; +‚b‚P SUBSTRING(`‚b‚P`,2) +ƒ\\•\—\\ \•\—\\ +ƒ\\•\—\ \•\—\ +ƒ\\•\ \•\ +ƒ\\ \ +ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,3) FROM `‚s‚X`; +‚b‚P SUBSTRING(`‚b‚P`,3) +ƒ\\•\—\\ •\—\\ +ƒ\\•\—\ •\—\ +ƒ\\•\ •\ +ƒ\\ +ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,4) FROM `‚s‚X`; +‚b‚P SUBSTRING(`‚b‚P`,4) +ƒ\\•\—\\ —\\ +ƒ\\•\—\ —\ +ƒ\\•\ +ƒ\\ +ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,5) FROM `‚s‚X`; +‚b‚P SUBSTRING(`‚b‚P`,5) +ƒ\\•\—\\ \ +ƒ\\•\—\ +ƒ\\•\ +ƒ\\ +ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,6) FROM `‚s‚X`; +‚b‚P SUBSTRING(`‚b‚P`,6) +ƒ\\•\—\\ +ƒ\\•\—\ +ƒ\\•\ +ƒ\\ +ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 0) FROM `‚s‚X`; +‚b‚P SUBSTRING(`‚b‚P` FROM 0) +ƒ\\•\—\\ +ƒ\\•\—\ +ƒ\\•\ +ƒ\\ +ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1) FROM `‚s‚X`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1) +ƒ\\•\—\\ ƒ\\•\—\\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\ ƒ\\•\ +ƒ\\ ƒ\\ +ƒ\ ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 2) FROM `‚s‚X`; +‚b‚P SUBSTRING(`‚b‚P` FROM 2) +ƒ\\•\—\\ \•\—\\ +ƒ\\•\—\ \•\—\ +ƒ\\•\ \•\ +ƒ\\ \ +ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 3) FROM `‚s‚X`; +‚b‚P SUBSTRING(`‚b‚P` FROM 3) +ƒ\\•\—\\ •\—\\ +ƒ\\•\—\ •\—\ +ƒ\\•\ •\ +ƒ\\ +ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 4) FROM `‚s‚X`; +‚b‚P SUBSTRING(`‚b‚P` FROM 4) +ƒ\\•\—\\ —\\ +ƒ\\•\—\ —\ +ƒ\\•\ +ƒ\\ +ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 5) FROM `‚s‚X`; +‚b‚P SUBSTRING(`‚b‚P` FROM 5) +ƒ\\•\—\\ \ +ƒ\\•\—\ +ƒ\\•\ +ƒ\\ +ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 6) FROM `‚s‚X`; +‚b‚P SUBSTRING(`‚b‚P` FROM 6) +ƒ\\•\—\\ +ƒ\\•\—\ +ƒ\\•\ +ƒ\\ +ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,0) FROM `‚s‚X`; +‚b‚P SUBSTRING(`‚b‚P`,1,0) +ƒ\\•\—\\ +ƒ\\•\—\ +ƒ\\•\ +ƒ\\ +ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,1) FROM `‚s‚X`; +‚b‚P SUBSTRING(`‚b‚P`,1,1) +ƒ\\•\—\\ ƒ\ +ƒ\\•\—\ ƒ\ +ƒ\\•\ ƒ\ +ƒ\\ ƒ\ +ƒ\ ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,2) FROM `‚s‚X`; +‚b‚P SUBSTRING(`‚b‚P`,1,2) +ƒ\\•\—\\ ƒ\\ +ƒ\\•\—\ ƒ\\ +ƒ\\•\ ƒ\\ +ƒ\\ ƒ\\ +ƒ\ ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,3) FROM `‚s‚X`; +‚b‚P SUBSTRING(`‚b‚P`,1,3) +ƒ\\•\—\\ ƒ\\•\ +ƒ\\•\—\ ƒ\\•\ +ƒ\\•\ ƒ\\•\ +ƒ\\ ƒ\\ +ƒ\ ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,4) FROM `‚s‚X`; +‚b‚P SUBSTRING(`‚b‚P`,1,4) +ƒ\\•\—\\ ƒ\\•\—\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\ ƒ\\•\ +ƒ\\ ƒ\\ +ƒ\ ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,5) FROM `‚s‚X`; +‚b‚P SUBSTRING(`‚b‚P`,1,5) +ƒ\\•\—\\ ƒ\\•\—\\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\ ƒ\\•\ +ƒ\\ ƒ\\ +ƒ\ ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,6) FROM `‚s‚X`; +‚b‚P SUBSTRING(`‚b‚P`,1,6) +ƒ\\•\—\\ ƒ\\•\—\\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\ ƒ\\•\ +ƒ\\ ƒ\\ +ƒ\ ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 0) FROM `‚s‚X`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 0) +ƒ\\•\—\\ +ƒ\\•\—\ +ƒ\\•\ +ƒ\\ +ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 1) FROM `‚s‚X`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 1) +ƒ\\•\—\\ ƒ\ +ƒ\\•\—\ ƒ\ +ƒ\\•\ ƒ\ +ƒ\\ ƒ\ +ƒ\ ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 2) FROM `‚s‚X`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 2) +ƒ\\•\—\\ ƒ\\ +ƒ\\•\—\ ƒ\\ +ƒ\\•\ ƒ\\ +ƒ\\ ƒ\\ +ƒ\ ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 3) FROM `‚s‚X`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 3) +ƒ\\•\—\\ ƒ\\•\ +ƒ\\•\—\ ƒ\\•\ +ƒ\\•\ ƒ\\•\ +ƒ\\ ƒ\\ +ƒ\ ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 4) FROM `‚s‚X`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 4) +ƒ\\•\—\\ ƒ\\•\—\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\ ƒ\\•\ +ƒ\\ ƒ\\ +ƒ\ ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 5) FROM `‚s‚X`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 5) +ƒ\\•\—\\ ƒ\\•\—\\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\ ƒ\\•\ +ƒ\\ ƒ\\ +ƒ\ ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 6) FROM `‚s‚X`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 6) +ƒ\\•\—\\ ƒ\\•\—\\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\ ƒ\\•\ +ƒ\\ ƒ\\ +ƒ\ ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,0) FROM `‚s‚P‚O`; +‚b‚P SUBSTRING(`‚b‚P`,0) +±²³´µ +±²³´ +±²³ +±² +± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1) FROM `‚s‚P‚O`; +‚b‚P SUBSTRING(`‚b‚P`,1) +±²³´µ ±²³´µ +±²³´ ±²³´ +±²³ ±²³ +±² ±² +± ± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,2) FROM `‚s‚P‚O`; +‚b‚P SUBSTRING(`‚b‚P`,2) +±²³´µ ²³´µ +±²³´ ²³´ +±²³ ²³ +±² ² +± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,3) FROM `‚s‚P‚O`; +‚b‚P SUBSTRING(`‚b‚P`,3) +±²³´µ ³´µ +±²³´ ³´ +±²³ ³ +±² +± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,4) FROM `‚s‚P‚O`; +‚b‚P SUBSTRING(`‚b‚P`,4) +±²³´µ ´µ +±²³´ ´ +±²³ +±² +± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,5) FROM `‚s‚P‚O`; +‚b‚P SUBSTRING(`‚b‚P`,5) +±²³´µ µ +±²³´ +±²³ +±² +± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,6) FROM `‚s‚P‚O`; +‚b‚P SUBSTRING(`‚b‚P`,6) +±²³´µ +±²³´ +±²³ +±² +± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 0) FROM `‚s‚P‚O`; +‚b‚P SUBSTRING(`‚b‚P` FROM 0) +±²³´µ +±²³´ +±²³ +±² +± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1) FROM `‚s‚P‚O`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1) +±²³´µ ±²³´µ +±²³´ ±²³´ +±²³ ±²³ +±² ±² +± ± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 2) FROM `‚s‚P‚O`; +‚b‚P SUBSTRING(`‚b‚P` FROM 2) +±²³´µ ²³´µ +±²³´ ²³´ +±²³ ²³ +±² ² +± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 3) FROM `‚s‚P‚O`; +‚b‚P SUBSTRING(`‚b‚P` FROM 3) +±²³´µ ³´µ +±²³´ ³´ +±²³ ³ +±² +± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 4) FROM `‚s‚P‚O`; +‚b‚P SUBSTRING(`‚b‚P` FROM 4) +±²³´µ ´µ +±²³´ ´ +±²³ +±² +± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 5) FROM `‚s‚P‚O`; +‚b‚P SUBSTRING(`‚b‚P` FROM 5) +±²³´µ µ +±²³´ +±²³ +±² +± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 6) FROM `‚s‚P‚O`; +‚b‚P SUBSTRING(`‚b‚P` FROM 6) +±²³´µ +±²³´ +±²³ +±² +± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,0) FROM `‚s‚P‚O`; +‚b‚P SUBSTRING(`‚b‚P`,1,0) +±²³´µ +±²³´ +±²³ +±² +± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,1) FROM `‚s‚P‚O`; +‚b‚P SUBSTRING(`‚b‚P`,1,1) +±²³´µ ± +±²³´ ± +±²³ ± +±² ± +± ± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,2) FROM `‚s‚P‚O`; +‚b‚P SUBSTRING(`‚b‚P`,1,2) +±²³´µ ±² +±²³´ ±² +±²³ ±² +±² ±² +± ± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,3) FROM `‚s‚P‚O`; +‚b‚P SUBSTRING(`‚b‚P`,1,3) +±²³´µ ±²³ +±²³´ ±²³ +±²³ ±²³ +±² ±² +± ± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,4) FROM `‚s‚P‚O`; +‚b‚P SUBSTRING(`‚b‚P`,1,4) +±²³´µ ±²³´ +±²³´ ±²³´ +±²³ ±²³ +±² ±² +± ± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,5) FROM `‚s‚P‚O`; +‚b‚P SUBSTRING(`‚b‚P`,1,5) +±²³´µ ±²³´µ +±²³´ ±²³´ +±²³ ±²³ +±² ±² +± ± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,6) FROM `‚s‚P‚O`; +‚b‚P SUBSTRING(`‚b‚P`,1,6) +±²³´µ ±²³´µ +±²³´ ±²³´ +±²³ ±²³ +±² ±² +± ± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 0) FROM `‚s‚P‚O`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 0) +±²³´µ +±²³´ +±²³ +±² +± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 1) FROM `‚s‚P‚O`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 1) +±²³´µ ± +±²³´ ± +±²³ ± +±² ± +± ± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 2) FROM `‚s‚P‚O`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 2) +±²³´µ ±² +±²³´ ±² +±²³ ±² +±² ±² +± ± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 3) FROM `‚s‚P‚O`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 3) +±²³´µ ±²³ +±²³´ ±²³ +±²³ ±²³ +±² ±² +± ± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 4) FROM `‚s‚P‚O`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 4) +±²³´µ ±²³´ +±²³´ ±²³´ +±²³ ±²³ +±² ±² +± ± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 5) FROM `‚s‚P‚O`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 5) +±²³´µ ±²³´µ +±²³´ ±²³´ +±²³ ±²³ +±² ±² +± ± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 6) FROM `‚s‚P‚O`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 6) +±²³´µ ±²³´µ +±²³´ ±²³´ +±²³ ±²³ +±² ±² +± ± + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,0) FROM `‚s‚P‚P`; +‚b‚P SUBSTRING(`‚b‚P`,0) +‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ +‚ ‚¢ +‚  + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1) FROM `‚s‚P‚P`; +‚b‚P SUBSTRING(`‚b‚P`,1) +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢ ‚ ‚¢ +‚  ‚  + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,2) FROM `‚s‚P‚P`; +‚b‚P SUBSTRING(`‚b‚P`,2) +‚ ‚¢‚¤‚¦‚¨ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ ‚¢‚¤‚¦ +‚ ‚¢‚¤ ‚¢‚¤ +‚ ‚¢ ‚¢ +‚  + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,3) FROM `‚s‚P‚P`; +‚b‚P SUBSTRING(`‚b‚P`,3) +‚ ‚¢‚¤‚¦‚¨ ‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ ‚¤‚¦ +‚ ‚¢‚¤ ‚¤ +‚ ‚¢ +‚  + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,4) FROM `‚s‚P‚P`; +‚b‚P SUBSTRING(`‚b‚P`,4) +‚ ‚¢‚¤‚¦‚¨ ‚¦‚¨ +‚ ‚¢‚¤‚¦ ‚¦ +‚ ‚¢‚¤ +‚ ‚¢ +‚  + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,5) FROM `‚s‚P‚P`; +‚b‚P SUBSTRING(`‚b‚P`,5) +‚ ‚¢‚¤‚¦‚¨ ‚¨ +‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ +‚ ‚¢ +‚  + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,6) FROM `‚s‚P‚P`; +‚b‚P SUBSTRING(`‚b‚P`,6) +‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ +‚ ‚¢ +‚  + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 0) FROM `‚s‚P‚P`; +‚b‚P SUBSTRING(`‚b‚P` FROM 0) +‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ +‚ ‚¢ +‚  + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1) FROM `‚s‚P‚P`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1) +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢ ‚ ‚¢ +‚  ‚  + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 2) FROM `‚s‚P‚P`; +‚b‚P SUBSTRING(`‚b‚P` FROM 2) +‚ ‚¢‚¤‚¦‚¨ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ ‚¢‚¤‚¦ +‚ ‚¢‚¤ ‚¢‚¤ +‚ ‚¢ ‚¢ +‚  + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 3) FROM `‚s‚P‚P`; +‚b‚P SUBSTRING(`‚b‚P` FROM 3) +‚ ‚¢‚¤‚¦‚¨ ‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ ‚¤‚¦ +‚ ‚¢‚¤ ‚¤ +‚ ‚¢ +‚  + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 4) FROM `‚s‚P‚P`; +‚b‚P SUBSTRING(`‚b‚P` FROM 4) +‚ ‚¢‚¤‚¦‚¨ ‚¦‚¨ +‚ ‚¢‚¤‚¦ ‚¦ +‚ ‚¢‚¤ +‚ ‚¢ +‚  + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 5) FROM `‚s‚P‚P`; +‚b‚P SUBSTRING(`‚b‚P` FROM 5) +‚ ‚¢‚¤‚¦‚¨ ‚¨ +‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ +‚ ‚¢ +‚  + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 6) FROM `‚s‚P‚P`; +‚b‚P SUBSTRING(`‚b‚P` FROM 6) +‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ +‚ ‚¢ +‚  + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,0) FROM `‚s‚P‚P`; +‚b‚P SUBSTRING(`‚b‚P`,1,0) +‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ +‚ ‚¢ +‚  + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,1) FROM `‚s‚P‚P`; +‚b‚P SUBSTRING(`‚b‚P`,1,1) +‚ ‚¢‚¤‚¦‚¨ ‚  +‚ ‚¢‚¤‚¦ ‚  +‚ ‚¢‚¤ ‚  +‚ ‚¢ ‚  +‚  ‚  + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,2) FROM `‚s‚P‚P`; +‚b‚P SUBSTRING(`‚b‚P`,1,2) +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢ +‚ ‚¢‚¤‚¦ ‚ ‚¢ +‚ ‚¢‚¤ ‚ ‚¢ +‚ ‚¢ ‚ ‚¢ +‚  ‚  + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,3) FROM `‚s‚P‚P`; +‚b‚P SUBSTRING(`‚b‚P`,1,3) +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢ ‚ ‚¢ +‚  ‚  + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,4) FROM `‚s‚P‚P`; +‚b‚P SUBSTRING(`‚b‚P`,1,4) +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢ ‚ ‚¢ +‚  ‚  + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,5) FROM `‚s‚P‚P`; +‚b‚P SUBSTRING(`‚b‚P`,1,5) +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢ ‚ ‚¢ +‚  ‚  + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,6) FROM `‚s‚P‚P`; +‚b‚P SUBSTRING(`‚b‚P`,1,6) +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢ ‚ ‚¢ +‚  ‚  + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 0) FROM `‚s‚P‚P`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 0) +‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ +‚ ‚¢ +‚  + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 1) FROM `‚s‚P‚P`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 1) +‚ ‚¢‚¤‚¦‚¨ ‚  +‚ ‚¢‚¤‚¦ ‚  +‚ ‚¢‚¤ ‚  +‚ ‚¢ ‚  +‚  ‚  + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 2) FROM `‚s‚P‚P`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 2) +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢ +‚ ‚¢‚¤‚¦ ‚ ‚¢ +‚ ‚¢‚¤ ‚ ‚¢ +‚ ‚¢ ‚ ‚¢ +‚  ‚  + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 3) FROM `‚s‚P‚P`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 3) +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢ ‚ ‚¢ +‚  ‚  + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 4) FROM `‚s‚P‚P`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 4) +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢ ‚ ‚¢ +‚  ‚  + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 5) FROM `‚s‚P‚P`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 5) +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢ ‚ ‚¢ +‚  ‚  + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 6) FROM `‚s‚P‚P`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 6) +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦ ‚ ‚¢‚¤‚¦ +‚ ‚¢‚¤ ‚ ‚¢‚¤ +‚ ‚¢ ‚ ‚¢ +‚  ‚  + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,0) FROM `‚s‚P‚Q`; +‚b‚P SUBSTRING(`‚b‚P`,0) +ƒ\\•\—\\ +ƒ\\•\—\ +ƒ\\•\ +ƒ\\ +ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1) FROM `‚s‚P‚Q`; +‚b‚P SUBSTRING(`‚b‚P`,1) +ƒ\\•\—\\ ƒ\\•\—\\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\ ƒ\\•\ +ƒ\\ ƒ\\ +ƒ\ ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,2) FROM `‚s‚P‚Q`; +‚b‚P SUBSTRING(`‚b‚P`,2) +ƒ\\•\—\\ \•\—\\ +ƒ\\•\—\ \•\—\ +ƒ\\•\ \•\ +ƒ\\ \ +ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,3) FROM `‚s‚P‚Q`; +‚b‚P SUBSTRING(`‚b‚P`,3) +ƒ\\•\—\\ •\—\\ +ƒ\\•\—\ •\—\ +ƒ\\•\ •\ +ƒ\\ +ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,4) FROM `‚s‚P‚Q`; +‚b‚P SUBSTRING(`‚b‚P`,4) +ƒ\\•\—\\ —\\ +ƒ\\•\—\ —\ +ƒ\\•\ +ƒ\\ +ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,5) FROM `‚s‚P‚Q`; +‚b‚P SUBSTRING(`‚b‚P`,5) +ƒ\\•\—\\ \ +ƒ\\•\—\ +ƒ\\•\ +ƒ\\ +ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,6) FROM `‚s‚P‚Q`; +‚b‚P SUBSTRING(`‚b‚P`,6) +ƒ\\•\—\\ +ƒ\\•\—\ +ƒ\\•\ +ƒ\\ +ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 0) FROM `‚s‚P‚Q`; +‚b‚P SUBSTRING(`‚b‚P` FROM 0) +ƒ\\•\—\\ +ƒ\\•\—\ +ƒ\\•\ +ƒ\\ +ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1) FROM `‚s‚P‚Q`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1) +ƒ\\•\—\\ ƒ\\•\—\\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\ ƒ\\•\ +ƒ\\ ƒ\\ +ƒ\ ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 2) FROM `‚s‚P‚Q`; +‚b‚P SUBSTRING(`‚b‚P` FROM 2) +ƒ\\•\—\\ \•\—\\ +ƒ\\•\—\ \•\—\ +ƒ\\•\ \•\ +ƒ\\ \ +ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 3) FROM `‚s‚P‚Q`; +‚b‚P SUBSTRING(`‚b‚P` FROM 3) +ƒ\\•\—\\ •\—\\ +ƒ\\•\—\ •\—\ +ƒ\\•\ •\ +ƒ\\ +ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 4) FROM `‚s‚P‚Q`; +‚b‚P SUBSTRING(`‚b‚P` FROM 4) +ƒ\\•\—\\ —\\ +ƒ\\•\—\ —\ +ƒ\\•\ +ƒ\\ +ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 5) FROM `‚s‚P‚Q`; +‚b‚P SUBSTRING(`‚b‚P` FROM 5) +ƒ\\•\—\\ \ +ƒ\\•\—\ +ƒ\\•\ +ƒ\\ +ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 6) FROM `‚s‚P‚Q`; +‚b‚P SUBSTRING(`‚b‚P` FROM 6) +ƒ\\•\—\\ +ƒ\\•\—\ +ƒ\\•\ +ƒ\\ +ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,0) FROM `‚s‚P‚Q`; +‚b‚P SUBSTRING(`‚b‚P`,1,0) +ƒ\\•\—\\ +ƒ\\•\—\ +ƒ\\•\ +ƒ\\ +ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,1) FROM `‚s‚P‚Q`; +‚b‚P SUBSTRING(`‚b‚P`,1,1) +ƒ\\•\—\\ ƒ\ +ƒ\\•\—\ ƒ\ +ƒ\\•\ ƒ\ +ƒ\\ ƒ\ +ƒ\ ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,2) FROM `‚s‚P‚Q`; +‚b‚P SUBSTRING(`‚b‚P`,1,2) +ƒ\\•\—\\ ƒ\\ +ƒ\\•\—\ ƒ\\ +ƒ\\•\ ƒ\\ +ƒ\\ ƒ\\ +ƒ\ ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,3) FROM `‚s‚P‚Q`; +‚b‚P SUBSTRING(`‚b‚P`,1,3) +ƒ\\•\—\\ ƒ\\•\ +ƒ\\•\—\ ƒ\\•\ +ƒ\\•\ ƒ\\•\ +ƒ\\ ƒ\\ +ƒ\ ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,4) FROM `‚s‚P‚Q`; +‚b‚P SUBSTRING(`‚b‚P`,1,4) +ƒ\\•\—\\ ƒ\\•\—\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\ ƒ\\•\ +ƒ\\ ƒ\\ +ƒ\ ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,5) FROM `‚s‚P‚Q`; +‚b‚P SUBSTRING(`‚b‚P`,1,5) +ƒ\\•\—\\ ƒ\\•\—\\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\ ƒ\\•\ +ƒ\\ ƒ\\ +ƒ\ ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,6) FROM `‚s‚P‚Q`; +‚b‚P SUBSTRING(`‚b‚P`,1,6) +ƒ\\•\—\\ ƒ\\•\—\\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\ ƒ\\•\ +ƒ\\ ƒ\\ +ƒ\ ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 0) FROM `‚s‚P‚Q`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 0) +ƒ\\•\—\\ +ƒ\\•\—\ +ƒ\\•\ +ƒ\\ +ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 1) FROM `‚s‚P‚Q`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 1) +ƒ\\•\—\\ ƒ\ +ƒ\\•\—\ ƒ\ +ƒ\\•\ ƒ\ +ƒ\\ ƒ\ +ƒ\ ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 2) FROM `‚s‚P‚Q`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 2) +ƒ\\•\—\\ ƒ\\ +ƒ\\•\—\ ƒ\\ +ƒ\\•\ ƒ\\ +ƒ\\ ƒ\\ +ƒ\ ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 3) FROM `‚s‚P‚Q`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 3) +ƒ\\•\—\\ ƒ\\•\ +ƒ\\•\—\ ƒ\\•\ +ƒ\\•\ ƒ\\•\ +ƒ\\ ƒ\\ +ƒ\ ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 4) FROM `‚s‚P‚Q`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 4) +ƒ\\•\—\\ ƒ\\•\—\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\ ƒ\\•\ +ƒ\\ ƒ\\ +ƒ\ ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 5) FROM `‚s‚P‚Q`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 5) +ƒ\\•\—\\ ƒ\\•\—\\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\ ƒ\\•\ +ƒ\\ ƒ\\ +ƒ\ ƒ\ + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 6) FROM `‚s‚P‚Q`; +‚b‚P SUBSTRING(`‚b‚P` FROM 1 FOR 6) +ƒ\\•\—\\ ƒ\\•\—\\ +ƒ\\•\—\ ƒ\\•\—\ +ƒ\\•\ ƒ\\•\ +ƒ\\ ƒ\\ +ƒ\ ƒ\ + +DROP TABLE `‚s‚P`; +DROP TABLE `‚s‚Q`; +DROP TABLE `‚s‚R`; +DROP TABLE `‚s‚S`; +DROP TABLE `‚s‚T`; +DROP TABLE `‚s‚U`; +DROP TABLE `‚s‚V`; +DROP TABLE `‚s‚W`; +DROP TABLE `‚s‚X`; +DROP TABLE `‚s‚P‚O`; +DROP TABLE `‚s‚P‚P`; +DROP TABLE `‚s‚P‚Q`; diff --git a/mysql-test/suite/jp/r/jp_substring_ucs2.result b/mysql-test/suite/jp/r/jp_substring_ucs2.result new file mode 100755 index 00000000000..cb2a5b5b946 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_substring_ucs2.result @@ -0,0 +1,1395 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; +CREATE TABLE `£Ô£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£±`; +£Ã£± SUBSTRING(`£Ã£±`,1,0) + +ޱ +ޱ޲ +ޱ޲޳ +ޱ޲޳޴ +ޱ޲޳޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£±`; +£Ã£± SUBSTRING(`£Ã£±`,1,1) + +ޱ ޱ +ޱ޲ ޱ +ޱ޲޳ ޱ +ޱ޲޳޴ ޱ +ޱ޲޳޴޵ ޱ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£±`; +£Ã£± SUBSTRING(`£Ã£±`,1,2) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲ +ޱ޲޳޴ ޱ޲ +ޱ޲޳޴޵ ޱ޲ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£±`; +£Ã£± SUBSTRING(`£Ã£±`,1,3) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳ +ޱ޲޳޴޵ ޱ޲޳ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£±`; +£Ã£± SUBSTRING(`£Ã£±`,1,4) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳޴޵ ޱ޲޳޴ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£±`; +£Ã£± SUBSTRING(`£Ã£±`,1,5) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£±`; +£Ã£± SUBSTRING(`£Ã£±`,1,6) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£±`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 0) + +ޱ +ޱ޲ +ޱ޲޳ +ޱ޲޳޴ +ޱ޲޳޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£±`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 1) + +ޱ ޱ +ޱ޲ ޱ +ޱ޲޳ ޱ +ޱ޲޳޴ ޱ +ޱ޲޳޴޵ ޱ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£±`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 2) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲ +ޱ޲޳޴ ޱ޲ +ޱ޲޳޴޵ ޱ޲ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£±`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 3) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳ +ޱ޲޳޴޵ ޱ޲޳ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£±`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 4) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳޴޵ ޱ޲޳޴ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£±`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 5) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£±`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 6) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£²`; +£Ã£± SUBSTRING(`£Ã£±`,1,0) + +¤¢ +¤¢¤¤ +¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£²`; +£Ã£± SUBSTRING(`£Ã£±`,1,1) + +¤¢ ¤¢ +¤¢¤¤ ¤¢ +¤¢¤¤¤¦ ¤¢ +¤¢¤¤¤¦¤¨ ¤¢ +¤¢¤¤¤¦¤¨¤ª ¤¢ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£²`; +£Ã£± SUBSTRING(`£Ã£±`,1,2) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤ +¤¢¤¤¤¦¤¨ ¤¢¤¤ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£²`; +£Ã£± SUBSTRING(`£Ã£±`,1,3) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£²`; +£Ã£± SUBSTRING(`£Ã£±`,1,4) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£²`; +£Ã£± SUBSTRING(`£Ã£±`,1,5) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£²`; +£Ã£± SUBSTRING(`£Ã£±`,1,6) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£²`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 0) + +¤¢ +¤¢¤¤ +¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£²`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 1) + +¤¢ ¤¢ +¤¢¤¤ ¤¢ +¤¢¤¤¤¦ ¤¢ +¤¢¤¤¤¦¤¨ ¤¢ +¤¢¤¤¤¦¤¨¤ª ¤¢ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£²`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 2) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤ +¤¢¤¤¤¦¤¨ ¤¢¤¤ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£²`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 3) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£²`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 4) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£²`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 5) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£²`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 6) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£³`; +£Ã£± SUBSTRING(`£Ã£±`,1,0) + +íÜ +íÜíÝ +íÜíÝíÞ +íÜíÝíÞíß +íÜíÝíÞíßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£³`; +£Ã£± SUBSTRING(`£Ã£±`,1,1) + +íÜ íÜ +íÜíÝ íÜ +íÜíÝíÞ íÜ +íÜíÝíÞíß íÜ +íÜíÝíÞíßíà íÜ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£³`; +£Ã£± SUBSTRING(`£Ã£±`,1,2) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝ +íÜíÝíÞíß íÜíÝ +íÜíÝíÞíßíà íÜíÝ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£³`; +£Ã£± SUBSTRING(`£Ã£±`,1,3) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞ +íÜíÝíÞíßíà íÜíÝíÞ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£³`; +£Ã£± SUBSTRING(`£Ã£±`,1,4) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞíßíà íÜíÝíÞíß +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£³`; +£Ã£± SUBSTRING(`£Ã£±`,1,5) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£³`; +£Ã£± SUBSTRING(`£Ã£±`,1,6) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£³`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 0) + +íÜ +íÜíÝ +íÜíÝíÞ +íÜíÝíÞíß +íÜíÝíÞíßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£³`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 1) + +íÜ íÜ +íÜíÝ íÜ +íÜíÝíÞ íÜ +íÜíÝíÞíß íÜ +íÜíÝíÞíßíà íÜ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£³`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 2) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝ +íÜíÝíÞíß íÜíÝ +íÜíÝíÞíßíà íÜíÝ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£³`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 3) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞ +íÜíÝíÞíßíà íÜíÝíÞ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£³`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 4) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞíßíà íÜíÝíÞíß +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£³`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 5) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£³`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 6) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£´`; +£Ã£± SUBSTRING(`£Ã£±`,1,0) + +ޱ +ޱ޲ +ޱ޲޳ +ޱ޲޳޴ +ޱ޲޳޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£´`; +£Ã£± SUBSTRING(`£Ã£±`,1,1) + +ޱ ޱ +ޱ޲ ޱ +ޱ޲޳ ޱ +ޱ޲޳޴ ޱ +ޱ޲޳޴޵ ޱ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£´`; +£Ã£± SUBSTRING(`£Ã£±`,1,2) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲ +ޱ޲޳޴ ޱ޲ +ޱ޲޳޴޵ ޱ޲ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£´`; +£Ã£± SUBSTRING(`£Ã£±`,1,3) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳ +ޱ޲޳޴޵ ޱ޲޳ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£´`; +£Ã£± SUBSTRING(`£Ã£±`,1,4) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳޴޵ ޱ޲޳޴ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£´`; +£Ã£± SUBSTRING(`£Ã£±`,1,5) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£´`; +£Ã£± SUBSTRING(`£Ã£±`,1,6) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£´`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 0) + +ޱ +ޱ޲ +ޱ޲޳ +ޱ޲޳޴ +ޱ޲޳޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£´`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 1) + +ޱ ޱ +ޱ޲ ޱ +ޱ޲޳ ޱ +ޱ޲޳޴ ޱ +ޱ޲޳޴޵ ޱ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£´`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 2) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲ +ޱ޲޳޴ ޱ޲ +ޱ޲޳޴޵ ޱ޲ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£´`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 3) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳ +ޱ޲޳޴޵ ޱ޲޳ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£´`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 4) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳޴޵ ޱ޲޳޴ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£´`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 5) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£´`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 6) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£µ`; +£Ã£± SUBSTRING(`£Ã£±`,1,0) + +¤¢ +¤¢¤¤ +¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£µ`; +£Ã£± SUBSTRING(`£Ã£±`,1,1) + +¤¢ ¤¢ +¤¢¤¤ ¤¢ +¤¢¤¤¤¦ ¤¢ +¤¢¤¤¤¦¤¨ ¤¢ +¤¢¤¤¤¦¤¨¤ª ¤¢ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£µ`; +£Ã£± SUBSTRING(`£Ã£±`,1,2) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤ +¤¢¤¤¤¦¤¨ ¤¢¤¤ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£µ`; +£Ã£± SUBSTRING(`£Ã£±`,1,3) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£µ`; +£Ã£± SUBSTRING(`£Ã£±`,1,4) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£µ`; +£Ã£± SUBSTRING(`£Ã£±`,1,5) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£µ`; +£Ã£± SUBSTRING(`£Ã£±`,1,6) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£µ`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 0) + +¤¢ +¤¢¤¤ +¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£µ`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 1) + +¤¢ ¤¢ +¤¢¤¤ ¤¢ +¤¢¤¤¤¦ ¤¢ +¤¢¤¤¤¦¤¨ ¤¢ +¤¢¤¤¤¦¤¨¤ª ¤¢ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£µ`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 2) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤ +¤¢¤¤¤¦¤¨ ¤¢¤¤ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£µ`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 3) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£µ`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 4) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£µ`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 5) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£µ`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 6) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£¶`; +£Ã£± SUBSTRING(`£Ã£±`,1,0) + +íÜ +íÜíÝ +íÜíÝíÞ +íÜíÝíÞíß +íÜíÝíÞíßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£¶`; +£Ã£± SUBSTRING(`£Ã£±`,1,1) + +íÜ íÜ +íÜíÝ íÜ +íÜíÝíÞ íÜ +íÜíÝíÞíß íÜ +íÜíÝíÞíßíà íÜ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£¶`; +£Ã£± SUBSTRING(`£Ã£±`,1,2) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝ +íÜíÝíÞíß íÜíÝ +íÜíÝíÞíßíà íÜíÝ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£¶`; +£Ã£± SUBSTRING(`£Ã£±`,1,3) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞ +íÜíÝíÞíßíà íÜíÝíÞ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£¶`; +£Ã£± SUBSTRING(`£Ã£±`,1,4) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞíßíà íÜíÝíÞíß +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£¶`; +£Ã£± SUBSTRING(`£Ã£±`,1,5) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£¶`; +£Ã£± SUBSTRING(`£Ã£±`,1,6) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£¶`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 0) + +íÜ +íÜíÝ +íÜíÝíÞ +íÜíÝíÞíß +íÜíÝíÞíßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£¶`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 1) + +íÜ íÜ +íÜíÝ íÜ +íÜíÝíÞ íÜ +íÜíÝíÞíß íÜ +íÜíÝíÞíßíà íÜ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£¶`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 2) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝ +íÜíÝíÞíß íÜíÝ +íÜíÝíÞíßíà íÜíÝ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£¶`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 3) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞ +íÜíÝíÞíßíà íÜíÝíÞ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£¶`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 4) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞíßíà íÜíÝíÞíß +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£¶`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 5) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£¶`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 6) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£·`; +£Ã£± SUBSTRING(`£Ã£±`,1,0) +ޱ޲޳޴޵ +ޱ޲޳޴ +ޱ޲޳ +ޱ޲ +ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£·`; +£Ã£± SUBSTRING(`£Ã£±`,1,1) +ޱ޲޳޴޵ ޱ +ޱ޲޳޴ ޱ +ޱ޲޳ ޱ +ޱ޲ ޱ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£·`; +£Ã£± SUBSTRING(`£Ã£±`,1,2) +ޱ޲޳޴޵ ޱ޲ +ޱ޲޳޴ ޱ޲ +ޱ޲޳ ޱ޲ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£·`; +£Ã£± SUBSTRING(`£Ã£±`,1,3) +ޱ޲޳޴޵ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£·`; +£Ã£± SUBSTRING(`£Ã£±`,1,4) +ޱ޲޳޴޵ ޱ޲޳޴ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£·`; +£Ã£± SUBSTRING(`£Ã£±`,1,5) +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£·`; +£Ã£± SUBSTRING(`£Ã£±`,1,6) +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£·`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 0) +ޱ޲޳޴޵ +ޱ޲޳޴ +ޱ޲޳ +ޱ޲ +ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£·`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 1) +ޱ޲޳޴޵ ޱ +ޱ޲޳޴ ޱ +ޱ޲޳ ޱ +ޱ޲ ޱ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£·`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 2) +ޱ޲޳޴޵ ޱ޲ +ޱ޲޳޴ ޱ޲ +ޱ޲޳ ޱ޲ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£·`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 3) +ޱ޲޳޴޵ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£·`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 4) +ޱ޲޳޴޵ ޱ޲޳޴ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£·`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 5) +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£·`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 6) +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£¸`; +£Ã£± SUBSTRING(`£Ã£±`,1,0) +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ +¤¢¤¤ +¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£¸`; +£Ã£± SUBSTRING(`£Ã£±`,1,1) +¤¢¤¤¤¦¤¨¤ª ¤¢ +¤¢¤¤¤¦¤¨ ¤¢ +¤¢¤¤¤¦ ¤¢ +¤¢¤¤ ¤¢ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£¸`; +£Ã£± SUBSTRING(`£Ã£±`,1,2) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤ +¤¢¤¤¤¦¤¨ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£¸`; +£Ã£± SUBSTRING(`£Ã£±`,1,3) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£¸`; +£Ã£± SUBSTRING(`£Ã£±`,1,4) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£¸`; +£Ã£± SUBSTRING(`£Ã£±`,1,5) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£¸`; +£Ã£± SUBSTRING(`£Ã£±`,1,6) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£¸`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 0) +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ +¤¢¤¤ +¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£¸`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 1) +¤¢¤¤¤¦¤¨¤ª ¤¢ +¤¢¤¤¤¦¤¨ ¤¢ +¤¢¤¤¤¦ ¤¢ +¤¢¤¤ ¤¢ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£¸`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 2) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤ +¤¢¤¤¤¦¤¨ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£¸`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 3) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£¸`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 4) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£¸`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 5) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£¸`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 6) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£¹`; +£Ã£± SUBSTRING(`£Ã£±`,1,0) +íÜíÝíÞíßíà +íÜíÝíÞíß +íÜíÝíÞ +íÜíÝ +íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£¹`; +£Ã£± SUBSTRING(`£Ã£±`,1,1) +íÜíÝíÞíßíà íÜ +íÜíÝíÞíß íÜ +íÜíÝíÞ íÜ +íÜíÝ íÜ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£¹`; +£Ã£± SUBSTRING(`£Ã£±`,1,2) +íÜíÝíÞíßíà íÜíÝ +íÜíÝíÞíß íÜíÝ +íÜíÝíÞ íÜíÝ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£¹`; +£Ã£± SUBSTRING(`£Ã£±`,1,3) +íÜíÝíÞíßíà íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞ +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£¹`; +£Ã£± SUBSTRING(`£Ã£±`,1,4) +íÜíÝíÞíßíà íÜíÝíÞíß +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£¹`; +£Ã£± SUBSTRING(`£Ã£±`,1,5) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£¹`; +£Ã£± SUBSTRING(`£Ã£±`,1,6) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£¹`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 0) +íÜíÝíÞíßíà +íÜíÝíÞíß +íÜíÝíÞ +íÜíÝ +íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£¹`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 1) +íÜíÝíÞíßíà íÜ +íÜíÝíÞíß íÜ +íÜíÝíÞ íÜ +íÜíÝ íÜ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£¹`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 2) +íÜíÝíÞíßíà íÜíÝ +íÜíÝíÞíß íÜíÝ +íÜíÝíÞ íÜíÝ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£¹`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 3) +íÜíÝíÞíßíà íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞ +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£¹`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 4) +íÜíÝíÞíßíà íÜíÝíÞíß +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£¹`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 5) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£¹`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 6) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£±£°`; +£Ã£± SUBSTRING(`£Ã£±`,1,0) +ޱ޲޳޴޵ +ޱ޲޳޴ +ޱ޲޳ +ޱ޲ +ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£±£°`; +£Ã£± SUBSTRING(`£Ã£±`,1,1) +ޱ޲޳޴޵ ޱ +ޱ޲޳޴ ޱ +ޱ޲޳ ޱ +ޱ޲ ޱ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£±£°`; +£Ã£± SUBSTRING(`£Ã£±`,1,2) +ޱ޲޳޴޵ ޱ޲ +ޱ޲޳޴ ޱ޲ +ޱ޲޳ ޱ޲ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£±£°`; +£Ã£± SUBSTRING(`£Ã£±`,1,3) +ޱ޲޳޴޵ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£±£°`; +£Ã£± SUBSTRING(`£Ã£±`,1,4) +ޱ޲޳޴޵ ޱ޲޳޴ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£±£°`; +£Ã£± SUBSTRING(`£Ã£±`,1,5) +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£±£°`; +£Ã£± SUBSTRING(`£Ã£±`,1,6) +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£±£°`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 0) +ޱ޲޳޴޵ +ޱ޲޳޴ +ޱ޲޳ +ޱ޲ +ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£±£°`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 1) +ޱ޲޳޴޵ ޱ +ޱ޲޳޴ ޱ +ޱ޲޳ ޱ +ޱ޲ ޱ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£±£°`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 2) +ޱ޲޳޴޵ ޱ޲ +ޱ޲޳޴ ޱ޲ +ޱ޲޳ ޱ޲ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£±£°`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 3) +ޱ޲޳޴޵ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£±£°`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 4) +ޱ޲޳޴޵ ޱ޲޳޴ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£±£°`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 5) +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£±£°`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 6) +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£±£±`; +£Ã£± SUBSTRING(`£Ã£±`,1,0) +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ +¤¢¤¤ +¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£±£±`; +£Ã£± SUBSTRING(`£Ã£±`,1,1) +¤¢¤¤¤¦¤¨¤ª ¤¢ +¤¢¤¤¤¦¤¨ ¤¢ +¤¢¤¤¤¦ ¤¢ +¤¢¤¤ ¤¢ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£±£±`; +£Ã£± SUBSTRING(`£Ã£±`,1,2) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤ +¤¢¤¤¤¦¤¨ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£±£±`; +£Ã£± SUBSTRING(`£Ã£±`,1,3) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£±£±`; +£Ã£± SUBSTRING(`£Ã£±`,1,4) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£±£±`; +£Ã£± SUBSTRING(`£Ã£±`,1,5) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£±£±`; +£Ã£± SUBSTRING(`£Ã£±`,1,6) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£±£±`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 0) +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ +¤¢¤¤ +¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£±£±`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 1) +¤¢¤¤¤¦¤¨¤ª ¤¢ +¤¢¤¤¤¦¤¨ ¤¢ +¤¢¤¤¤¦ ¤¢ +¤¢¤¤ ¤¢ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£±£±`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 2) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤ +¤¢¤¤¤¦¤¨ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£±£±`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 3) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£±£±`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 4) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£±£±`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 5) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£±£±`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 6) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£±£²`; +£Ã£± SUBSTRING(`£Ã£±`,1,0) +íÜíÝíÞíßíà +íÜíÝíÞíß +íÜíÝíÞ +íÜíÝ +íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£±£²`; +£Ã£± SUBSTRING(`£Ã£±`,1,1) +íÜíÝíÞíßíà íÜ +íÜíÝíÞíß íÜ +íÜíÝíÞ íÜ +íÜíÝ íÜ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£±£²`; +£Ã£± SUBSTRING(`£Ã£±`,1,2) +íÜíÝíÞíßíà íÜíÝ +íÜíÝíÞíß íÜíÝ +íÜíÝíÞ íÜíÝ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£±£²`; +£Ã£± SUBSTRING(`£Ã£±`,1,3) +íÜíÝíÞíßíà íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞ +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£±£²`; +£Ã£± SUBSTRING(`£Ã£±`,1,4) +íÜíÝíÞíßíà íÜíÝíÞíß +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£±£²`; +£Ã£± SUBSTRING(`£Ã£±`,1,5) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£±£²`; +£Ã£± SUBSTRING(`£Ã£±`,1,6) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£±£²`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 0) +íÜíÝíÞíßíà +íÜíÝíÞíß +íÜíÝíÞ +íÜíÝ +íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£±£²`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 1) +íÜíÝíÞíßíà íÜ +íÜíÝíÞíß íÜ +íÜíÝíÞ íÜ +íÜíÝ íÜ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£±£²`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 2) +íÜíÝíÞíßíà íÜíÝ +íÜíÝíÞíß íÜíÝ +íÜíÝíÞ íÜíÝ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£±£²`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 3) +íÜíÝíÞíßíà íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞ +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£±£²`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 4) +íÜíÝíÞíßíà íÜíÝíÞíß +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£±£²`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 5) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£±£²`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 6) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/r/jp_substring_ujis.result b/mysql-test/suite/jp/r/jp_substring_ujis.result new file mode 100755 index 00000000000..229de0c0236 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_substring_ujis.result @@ -0,0 +1,2738 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +SET NAMES ujis; +SET character_set_database = ujis; +CREATE TABLE `£Ô£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,0) FROM `£Ô£±`; +£Ã£± SUBSTRING(`£Ã£±`,0) + +ޱ +ޱ޲ +ޱ޲޳ +ޱ޲޳޴ +ޱ޲޳޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1) FROM `£Ô£±`; +£Ã£± SUBSTRING(`£Ã£±`,1) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,2) FROM `£Ô£±`; +£Ã£± SUBSTRING(`£Ã£±`,2) + +ޱ +ޱ޲ ޲ +ޱ޲޳ ޲޳ +ޱ޲޳޴ ޲޳޴ +ޱ޲޳޴޵ ޲޳޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,3) FROM `£Ô£±`; +£Ã£± SUBSTRING(`£Ã£±`,3) + +ޱ +ޱ޲ +ޱ޲޳ ޳ +ޱ޲޳޴ ޳޴ +ޱ޲޳޴޵ ޳޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,4) FROM `£Ô£±`; +£Ã£± SUBSTRING(`£Ã£±`,4) + +ޱ +ޱ޲ +ޱ޲޳ +ޱ޲޳޴ Ž´ +ޱ޲޳޴޵ ޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,5) FROM `£Ô£±`; +£Ã£± SUBSTRING(`£Ã£±`,5) + +ޱ +ޱ޲ +ޱ޲޳ +ޱ޲޳޴ +ޱ޲޳޴޵ ޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,6) FROM `£Ô£±`; +£Ã£± SUBSTRING(`£Ã£±`,6) + +ޱ +ޱ޲ +ޱ޲޳ +ޱ޲޳޴ +ޱ޲޳޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 0) FROM `£Ô£±`; +£Ã£± SUBSTRING(`£Ã£±` FROM 0) + +ޱ +ޱ޲ +ޱ޲޳ +ޱ޲޳޴ +ޱ޲޳޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1) FROM `£Ô£±`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 2) FROM `£Ô£±`; +£Ã£± SUBSTRING(`£Ã£±` FROM 2) + +ޱ +ޱ޲ ޲ +ޱ޲޳ ޲޳ +ޱ޲޳޴ ޲޳޴ +ޱ޲޳޴޵ ޲޳޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 3) FROM `£Ô£±`; +£Ã£± SUBSTRING(`£Ã£±` FROM 3) + +ޱ +ޱ޲ +ޱ޲޳ ޳ +ޱ޲޳޴ ޳޴ +ޱ޲޳޴޵ ޳޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 4) FROM `£Ô£±`; +£Ã£± SUBSTRING(`£Ã£±` FROM 4) + +ޱ +ޱ޲ +ޱ޲޳ +ޱ޲޳޴ Ž´ +ޱ޲޳޴޵ ޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 5) FROM `£Ô£±`; +£Ã£± SUBSTRING(`£Ã£±` FROM 5) + +ޱ +ޱ޲ +ޱ޲޳ +ޱ޲޳޴ +ޱ޲޳޴޵ ޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 6) FROM `£Ô£±`; +£Ã£± SUBSTRING(`£Ã£±` FROM 6) + +ޱ +ޱ޲ +ޱ޲޳ +ޱ޲޳޴ +ޱ޲޳޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£±`; +£Ã£± SUBSTRING(`£Ã£±`,1,0) + +ޱ +ޱ޲ +ޱ޲޳ +ޱ޲޳޴ +ޱ޲޳޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£±`; +£Ã£± SUBSTRING(`£Ã£±`,1,1) + +ޱ ޱ +ޱ޲ ޱ +ޱ޲޳ ޱ +ޱ޲޳޴ ޱ +ޱ޲޳޴޵ ޱ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£±`; +£Ã£± SUBSTRING(`£Ã£±`,1,2) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲ +ޱ޲޳޴ ޱ޲ +ޱ޲޳޴޵ ޱ޲ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£±`; +£Ã£± SUBSTRING(`£Ã£±`,1,3) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳ +ޱ޲޳޴޵ ޱ޲޳ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£±`; +£Ã£± SUBSTRING(`£Ã£±`,1,4) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳޴޵ ޱ޲޳޴ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£±`; +£Ã£± SUBSTRING(`£Ã£±`,1,5) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£±`; +£Ã£± SUBSTRING(`£Ã£±`,1,6) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£±`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 0) + +ޱ +ޱ޲ +ޱ޲޳ +ޱ޲޳޴ +ޱ޲޳޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£±`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 1) + +ޱ ޱ +ޱ޲ ޱ +ޱ޲޳ ޱ +ޱ޲޳޴ ޱ +ޱ޲޳޴޵ ޱ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£±`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 2) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲ +ޱ޲޳޴ ޱ޲ +ޱ޲޳޴޵ ޱ޲ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£±`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 3) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳ +ޱ޲޳޴޵ ޱ޲޳ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£±`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 4) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳޴޵ ޱ޲޳޴ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£±`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 5) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£±`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 6) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,0) FROM `£Ô£²`; +£Ã£± SUBSTRING(`£Ã£±`,0) + +¤¢ +¤¢¤¤ +¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1) FROM `£Ô£²`; +£Ã£± SUBSTRING(`£Ã£±`,1) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,2) FROM `£Ô£²`; +£Ã£± SUBSTRING(`£Ã£±`,2) + +¤¢ +¤¢¤¤ ¤¤ +¤¢¤¤¤¦ ¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,3) FROM `£Ô£²`; +£Ã£± SUBSTRING(`£Ã£±`,3) + +¤¢ +¤¢¤¤ +¤¢¤¤¤¦ ¤¦ +¤¢¤¤¤¦¤¨ ¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¦¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,4) FROM `£Ô£²`; +£Ã£± SUBSTRING(`£Ã£±`,4) + +¤¢ +¤¢¤¤ +¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,5) FROM `£Ô£²`; +£Ã£± SUBSTRING(`£Ã£±`,5) + +¤¢ +¤¢¤¤ +¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,6) FROM `£Ô£²`; +£Ã£± SUBSTRING(`£Ã£±`,6) + +¤¢ +¤¢¤¤ +¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 0) FROM `£Ô£²`; +£Ã£± SUBSTRING(`£Ã£±` FROM 0) + +¤¢ +¤¢¤¤ +¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1) FROM `£Ô£²`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 2) FROM `£Ô£²`; +£Ã£± SUBSTRING(`£Ã£±` FROM 2) + +¤¢ +¤¢¤¤ ¤¤ +¤¢¤¤¤¦ ¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 3) FROM `£Ô£²`; +£Ã£± SUBSTRING(`£Ã£±` FROM 3) + +¤¢ +¤¢¤¤ +¤¢¤¤¤¦ ¤¦ +¤¢¤¤¤¦¤¨ ¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¦¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 4) FROM `£Ô£²`; +£Ã£± SUBSTRING(`£Ã£±` FROM 4) + +¤¢ +¤¢¤¤ +¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 5) FROM `£Ô£²`; +£Ã£± SUBSTRING(`£Ã£±` FROM 5) + +¤¢ +¤¢¤¤ +¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 6) FROM `£Ô£²`; +£Ã£± SUBSTRING(`£Ã£±` FROM 6) + +¤¢ +¤¢¤¤ +¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£²`; +£Ã£± SUBSTRING(`£Ã£±`,1,0) + +¤¢ +¤¢¤¤ +¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£²`; +£Ã£± SUBSTRING(`£Ã£±`,1,1) + +¤¢ ¤¢ +¤¢¤¤ ¤¢ +¤¢¤¤¤¦ ¤¢ +¤¢¤¤¤¦¤¨ ¤¢ +¤¢¤¤¤¦¤¨¤ª ¤¢ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£²`; +£Ã£± SUBSTRING(`£Ã£±`,1,2) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤ +¤¢¤¤¤¦¤¨ ¤¢¤¤ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£²`; +£Ã£± SUBSTRING(`£Ã£±`,1,3) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£²`; +£Ã£± SUBSTRING(`£Ã£±`,1,4) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£²`; +£Ã£± SUBSTRING(`£Ã£±`,1,5) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£²`; +£Ã£± SUBSTRING(`£Ã£±`,1,6) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£²`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 0) + +¤¢ +¤¢¤¤ +¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£²`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 1) + +¤¢ ¤¢ +¤¢¤¤ ¤¢ +¤¢¤¤¤¦ ¤¢ +¤¢¤¤¤¦¤¨ ¤¢ +¤¢¤¤¤¦¤¨¤ª ¤¢ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£²`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 2) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤ +¤¢¤¤¤¦¤¨ ¤¢¤¤ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£²`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 3) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£²`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 4) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£²`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 5) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£²`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 6) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,0) FROM `£Ô£³`; +£Ã£± SUBSTRING(`£Ã£±`,0) + +íÜ +íÜíÝ +íÜíÝíÞ +íÜíÝíÞíß +íÜíÝíÞíßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1) FROM `£Ô£³`; +£Ã£± SUBSTRING(`£Ã£±`,1) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,2) FROM `£Ô£³`; +£Ã£± SUBSTRING(`£Ã£±`,2) + +íÜ +íÜíÝ íÝ +íÜíÝíÞ íÝíÞ +íÜíÝíÞíß íÝíÞíß +íÜíÝíÞíßíà íÝíÞíßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,3) FROM `£Ô£³`; +£Ã£± SUBSTRING(`£Ã£±`,3) + +íÜ +íÜíÝ +íÜíÝíÞ íÞ +íÜíÝíÞíß íÞíß +íÜíÝíÞíßíà íÞíßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,4) FROM `£Ô£³`; +£Ã£± SUBSTRING(`£Ã£±`,4) + +íÜ +íÜíÝ +íÜíÝíÞ +íÜíÝíÞíß íß +íÜíÝíÞíßíà íßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,5) FROM `£Ô£³`; +£Ã£± SUBSTRING(`£Ã£±`,5) + +íÜ +íÜíÝ +íÜíÝíÞ +íÜíÝíÞíß +íÜíÝíÞíßíà íà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,6) FROM `£Ô£³`; +£Ã£± SUBSTRING(`£Ã£±`,6) + +íÜ +íÜíÝ +íÜíÝíÞ +íÜíÝíÞíß +íÜíÝíÞíßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 0) FROM `£Ô£³`; +£Ã£± SUBSTRING(`£Ã£±` FROM 0) + +íÜ +íÜíÝ +íÜíÝíÞ +íÜíÝíÞíß +íÜíÝíÞíßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1) FROM `£Ô£³`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 2) FROM `£Ô£³`; +£Ã£± SUBSTRING(`£Ã£±` FROM 2) + +íÜ +íÜíÝ íÝ +íÜíÝíÞ íÝíÞ +íÜíÝíÞíß íÝíÞíß +íÜíÝíÞíßíà íÝíÞíßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 3) FROM `£Ô£³`; +£Ã£± SUBSTRING(`£Ã£±` FROM 3) + +íÜ +íÜíÝ +íÜíÝíÞ íÞ +íÜíÝíÞíß íÞíß +íÜíÝíÞíßíà íÞíßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 4) FROM `£Ô£³`; +£Ã£± SUBSTRING(`£Ã£±` FROM 4) + +íÜ +íÜíÝ +íÜíÝíÞ +íÜíÝíÞíß íß +íÜíÝíÞíßíà íßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 5) FROM `£Ô£³`; +£Ã£± SUBSTRING(`£Ã£±` FROM 5) + +íÜ +íÜíÝ +íÜíÝíÞ +íÜíÝíÞíß +íÜíÝíÞíßíà íà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 6) FROM `£Ô£³`; +£Ã£± SUBSTRING(`£Ã£±` FROM 6) + +íÜ +íÜíÝ +íÜíÝíÞ +íÜíÝíÞíß +íÜíÝíÞíßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£³`; +£Ã£± SUBSTRING(`£Ã£±`,1,0) + +íÜ +íÜíÝ +íÜíÝíÞ +íÜíÝíÞíß +íÜíÝíÞíßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£³`; +£Ã£± SUBSTRING(`£Ã£±`,1,1) + +íÜ íÜ +íÜíÝ íÜ +íÜíÝíÞ íÜ +íÜíÝíÞíß íÜ +íÜíÝíÞíßíà íÜ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£³`; +£Ã£± SUBSTRING(`£Ã£±`,1,2) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝ +íÜíÝíÞíß íÜíÝ +íÜíÝíÞíßíà íÜíÝ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£³`; +£Ã£± SUBSTRING(`£Ã£±`,1,3) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞ +íÜíÝíÞíßíà íÜíÝíÞ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£³`; +£Ã£± SUBSTRING(`£Ã£±`,1,4) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞíßíà íÜíÝíÞíß +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£³`; +£Ã£± SUBSTRING(`£Ã£±`,1,5) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£³`; +£Ã£± SUBSTRING(`£Ã£±`,1,6) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£³`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 0) + +íÜ +íÜíÝ +íÜíÝíÞ +íÜíÝíÞíß +íÜíÝíÞíßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£³`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 1) + +íÜ íÜ +íÜíÝ íÜ +íÜíÝíÞ íÜ +íÜíÝíÞíß íÜ +íÜíÝíÞíßíà íÜ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£³`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 2) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝ +íÜíÝíÞíß íÜíÝ +íÜíÝíÞíßíà íÜíÝ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£³`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 3) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞ +íÜíÝíÞíßíà íÜíÝíÞ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£³`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 4) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞíßíà íÜíÝíÞíß +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£³`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 5) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£³`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 6) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,0) FROM `£Ô£´`; +£Ã£± SUBSTRING(`£Ã£±`,0) + +ޱ +ޱ޲ +ޱ޲޳ +ޱ޲޳޴ +ޱ޲޳޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1) FROM `£Ô£´`; +£Ã£± SUBSTRING(`£Ã£±`,1) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,2) FROM `£Ô£´`; +£Ã£± SUBSTRING(`£Ã£±`,2) + +ޱ +ޱ޲ ޲ +ޱ޲޳ ޲޳ +ޱ޲޳޴ ޲޳޴ +ޱ޲޳޴޵ ޲޳޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,3) FROM `£Ô£´`; +£Ã£± SUBSTRING(`£Ã£±`,3) + +ޱ +ޱ޲ +ޱ޲޳ ޳ +ޱ޲޳޴ ޳޴ +ޱ޲޳޴޵ ޳޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,4) FROM `£Ô£´`; +£Ã£± SUBSTRING(`£Ã£±`,4) + +ޱ +ޱ޲ +ޱ޲޳ +ޱ޲޳޴ Ž´ +ޱ޲޳޴޵ ޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,5) FROM `£Ô£´`; +£Ã£± SUBSTRING(`£Ã£±`,5) + +ޱ +ޱ޲ +ޱ޲޳ +ޱ޲޳޴ +ޱ޲޳޴޵ ޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,6) FROM `£Ô£´`; +£Ã£± SUBSTRING(`£Ã£±`,6) + +ޱ +ޱ޲ +ޱ޲޳ +ޱ޲޳޴ +ޱ޲޳޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 0) FROM `£Ô£´`; +£Ã£± SUBSTRING(`£Ã£±` FROM 0) + +ޱ +ޱ޲ +ޱ޲޳ +ޱ޲޳޴ +ޱ޲޳޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1) FROM `£Ô£´`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 2) FROM `£Ô£´`; +£Ã£± SUBSTRING(`£Ã£±` FROM 2) + +ޱ +ޱ޲ ޲ +ޱ޲޳ ޲޳ +ޱ޲޳޴ ޲޳޴ +ޱ޲޳޴޵ ޲޳޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 3) FROM `£Ô£´`; +£Ã£± SUBSTRING(`£Ã£±` FROM 3) + +ޱ +ޱ޲ +ޱ޲޳ ޳ +ޱ޲޳޴ ޳޴ +ޱ޲޳޴޵ ޳޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 4) FROM `£Ô£´`; +£Ã£± SUBSTRING(`£Ã£±` FROM 4) + +ޱ +ޱ޲ +ޱ޲޳ +ޱ޲޳޴ Ž´ +ޱ޲޳޴޵ ޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 5) FROM `£Ô£´`; +£Ã£± SUBSTRING(`£Ã£±` FROM 5) + +ޱ +ޱ޲ +ޱ޲޳ +ޱ޲޳޴ +ޱ޲޳޴޵ ޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 6) FROM `£Ô£´`; +£Ã£± SUBSTRING(`£Ã£±` FROM 6) + +ޱ +ޱ޲ +ޱ޲޳ +ޱ޲޳޴ +ޱ޲޳޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£´`; +£Ã£± SUBSTRING(`£Ã£±`,1,0) + +ޱ +ޱ޲ +ޱ޲޳ +ޱ޲޳޴ +ޱ޲޳޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£´`; +£Ã£± SUBSTRING(`£Ã£±`,1,1) + +ޱ ޱ +ޱ޲ ޱ +ޱ޲޳ ޱ +ޱ޲޳޴ ޱ +ޱ޲޳޴޵ ޱ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£´`; +£Ã£± SUBSTRING(`£Ã£±`,1,2) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲ +ޱ޲޳޴ ޱ޲ +ޱ޲޳޴޵ ޱ޲ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£´`; +£Ã£± SUBSTRING(`£Ã£±`,1,3) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳ +ޱ޲޳޴޵ ޱ޲޳ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£´`; +£Ã£± SUBSTRING(`£Ã£±`,1,4) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳޴޵ ޱ޲޳޴ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£´`; +£Ã£± SUBSTRING(`£Ã£±`,1,5) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£´`; +£Ã£± SUBSTRING(`£Ã£±`,1,6) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£´`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 0) + +ޱ +ޱ޲ +ޱ޲޳ +ޱ޲޳޴ +ޱ޲޳޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£´`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 1) + +ޱ ޱ +ޱ޲ ޱ +ޱ޲޳ ޱ +ޱ޲޳޴ ޱ +ޱ޲޳޴޵ ޱ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£´`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 2) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲ +ޱ޲޳޴ ޱ޲ +ޱ޲޳޴޵ ޱ޲ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£´`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 3) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳ +ޱ޲޳޴޵ ޱ޲޳ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£´`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 4) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳޴޵ ޱ޲޳޴ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£´`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 5) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£´`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 6) + +ޱ ޱ +ޱ޲ ޱ޲ +ޱ޲޳ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,0) FROM `£Ô£µ`; +£Ã£± SUBSTRING(`£Ã£±`,0) + +¤¢ +¤¢¤¤ +¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1) FROM `£Ô£µ`; +£Ã£± SUBSTRING(`£Ã£±`,1) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,2) FROM `£Ô£µ`; +£Ã£± SUBSTRING(`£Ã£±`,2) + +¤¢ +¤¢¤¤ ¤¤ +¤¢¤¤¤¦ ¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,3) FROM `£Ô£µ`; +£Ã£± SUBSTRING(`£Ã£±`,3) + +¤¢ +¤¢¤¤ +¤¢¤¤¤¦ ¤¦ +¤¢¤¤¤¦¤¨ ¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¦¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,4) FROM `£Ô£µ`; +£Ã£± SUBSTRING(`£Ã£±`,4) + +¤¢ +¤¢¤¤ +¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,5) FROM `£Ô£µ`; +£Ã£± SUBSTRING(`£Ã£±`,5) + +¤¢ +¤¢¤¤ +¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,6) FROM `£Ô£µ`; +£Ã£± SUBSTRING(`£Ã£±`,6) + +¤¢ +¤¢¤¤ +¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 0) FROM `£Ô£µ`; +£Ã£± SUBSTRING(`£Ã£±` FROM 0) + +¤¢ +¤¢¤¤ +¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1) FROM `£Ô£µ`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 2) FROM `£Ô£µ`; +£Ã£± SUBSTRING(`£Ã£±` FROM 2) + +¤¢ +¤¢¤¤ ¤¤ +¤¢¤¤¤¦ ¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 3) FROM `£Ô£µ`; +£Ã£± SUBSTRING(`£Ã£±` FROM 3) + +¤¢ +¤¢¤¤ +¤¢¤¤¤¦ ¤¦ +¤¢¤¤¤¦¤¨ ¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¦¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 4) FROM `£Ô£µ`; +£Ã£± SUBSTRING(`£Ã£±` FROM 4) + +¤¢ +¤¢¤¤ +¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 5) FROM `£Ô£µ`; +£Ã£± SUBSTRING(`£Ã£±` FROM 5) + +¤¢ +¤¢¤¤ +¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 6) FROM `£Ô£µ`; +£Ã£± SUBSTRING(`£Ã£±` FROM 6) + +¤¢ +¤¢¤¤ +¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£µ`; +£Ã£± SUBSTRING(`£Ã£±`,1,0) + +¤¢ +¤¢¤¤ +¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£µ`; +£Ã£± SUBSTRING(`£Ã£±`,1,1) + +¤¢ ¤¢ +¤¢¤¤ ¤¢ +¤¢¤¤¤¦ ¤¢ +¤¢¤¤¤¦¤¨ ¤¢ +¤¢¤¤¤¦¤¨¤ª ¤¢ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£µ`; +£Ã£± SUBSTRING(`£Ã£±`,1,2) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤ +¤¢¤¤¤¦¤¨ ¤¢¤¤ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£µ`; +£Ã£± SUBSTRING(`£Ã£±`,1,3) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£µ`; +£Ã£± SUBSTRING(`£Ã£±`,1,4) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£µ`; +£Ã£± SUBSTRING(`£Ã£±`,1,5) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£µ`; +£Ã£± SUBSTRING(`£Ã£±`,1,6) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£µ`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 0) + +¤¢ +¤¢¤¤ +¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£µ`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 1) + +¤¢ ¤¢ +¤¢¤¤ ¤¢ +¤¢¤¤¤¦ ¤¢ +¤¢¤¤¤¦¤¨ ¤¢ +¤¢¤¤¤¦¤¨¤ª ¤¢ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£µ`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 2) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤ +¤¢¤¤¤¦¤¨ ¤¢¤¤ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£µ`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 3) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£µ`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 4) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£µ`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 5) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£µ`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 6) + +¤¢ ¤¢ +¤¢¤¤ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,0) FROM `£Ô£¶`; +£Ã£± SUBSTRING(`£Ã£±`,0) + +íÜ +íÜíÝ +íÜíÝíÞ +íÜíÝíÞíß +íÜíÝíÞíßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1) FROM `£Ô£¶`; +£Ã£± SUBSTRING(`£Ã£±`,1) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,2) FROM `£Ô£¶`; +£Ã£± SUBSTRING(`£Ã£±`,2) + +íÜ +íÜíÝ íÝ +íÜíÝíÞ íÝíÞ +íÜíÝíÞíß íÝíÞíß +íÜíÝíÞíßíà íÝíÞíßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,3) FROM `£Ô£¶`; +£Ã£± SUBSTRING(`£Ã£±`,3) + +íÜ +íÜíÝ +íÜíÝíÞ íÞ +íÜíÝíÞíß íÞíß +íÜíÝíÞíßíà íÞíßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,4) FROM `£Ô£¶`; +£Ã£± SUBSTRING(`£Ã£±`,4) + +íÜ +íÜíÝ +íÜíÝíÞ +íÜíÝíÞíß íß +íÜíÝíÞíßíà íßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,5) FROM `£Ô£¶`; +£Ã£± SUBSTRING(`£Ã£±`,5) + +íÜ +íÜíÝ +íÜíÝíÞ +íÜíÝíÞíß +íÜíÝíÞíßíà íà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,6) FROM `£Ô£¶`; +£Ã£± SUBSTRING(`£Ã£±`,6) + +íÜ +íÜíÝ +íÜíÝíÞ +íÜíÝíÞíß +íÜíÝíÞíßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 0) FROM `£Ô£¶`; +£Ã£± SUBSTRING(`£Ã£±` FROM 0) + +íÜ +íÜíÝ +íÜíÝíÞ +íÜíÝíÞíß +íÜíÝíÞíßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1) FROM `£Ô£¶`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 2) FROM `£Ô£¶`; +£Ã£± SUBSTRING(`£Ã£±` FROM 2) + +íÜ +íÜíÝ íÝ +íÜíÝíÞ íÝíÞ +íÜíÝíÞíß íÝíÞíß +íÜíÝíÞíßíà íÝíÞíßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 3) FROM `£Ô£¶`; +£Ã£± SUBSTRING(`£Ã£±` FROM 3) + +íÜ +íÜíÝ +íÜíÝíÞ íÞ +íÜíÝíÞíß íÞíß +íÜíÝíÞíßíà íÞíßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 4) FROM `£Ô£¶`; +£Ã£± SUBSTRING(`£Ã£±` FROM 4) + +íÜ +íÜíÝ +íÜíÝíÞ +íÜíÝíÞíß íß +íÜíÝíÞíßíà íßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 5) FROM `£Ô£¶`; +£Ã£± SUBSTRING(`£Ã£±` FROM 5) + +íÜ +íÜíÝ +íÜíÝíÞ +íÜíÝíÞíß +íÜíÝíÞíßíà íà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 6) FROM `£Ô£¶`; +£Ã£± SUBSTRING(`£Ã£±` FROM 6) + +íÜ +íÜíÝ +íÜíÝíÞ +íÜíÝíÞíß +íÜíÝíÞíßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£¶`; +£Ã£± SUBSTRING(`£Ã£±`,1,0) + +íÜ +íÜíÝ +íÜíÝíÞ +íÜíÝíÞíß +íÜíÝíÞíßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£¶`; +£Ã£± SUBSTRING(`£Ã£±`,1,1) + +íÜ íÜ +íÜíÝ íÜ +íÜíÝíÞ íÜ +íÜíÝíÞíß íÜ +íÜíÝíÞíßíà íÜ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£¶`; +£Ã£± SUBSTRING(`£Ã£±`,1,2) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝ +íÜíÝíÞíß íÜíÝ +íÜíÝíÞíßíà íÜíÝ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£¶`; +£Ã£± SUBSTRING(`£Ã£±`,1,3) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞ +íÜíÝíÞíßíà íÜíÝíÞ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£¶`; +£Ã£± SUBSTRING(`£Ã£±`,1,4) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞíßíà íÜíÝíÞíß +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£¶`; +£Ã£± SUBSTRING(`£Ã£±`,1,5) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£¶`; +£Ã£± SUBSTRING(`£Ã£±`,1,6) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£¶`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 0) + +íÜ +íÜíÝ +íÜíÝíÞ +íÜíÝíÞíß +íÜíÝíÞíßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£¶`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 1) + +íÜ íÜ +íÜíÝ íÜ +íÜíÝíÞ íÜ +íÜíÝíÞíß íÜ +íÜíÝíÞíßíà íÜ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£¶`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 2) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝ +íÜíÝíÞíß íÜíÝ +íÜíÝíÞíßíà íÜíÝ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£¶`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 3) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞ +íÜíÝíÞíßíà íÜíÝíÞ +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£¶`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 4) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞíßíà íÜíÝíÞíß +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£¶`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 5) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£¶`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 6) + +íÜ íÜ +íÜíÝ íÜíÝ +íÜíÝíÞ íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,0) FROM `£Ô£·`; +£Ã£± SUBSTRING(`£Ã£±`,0) +ޱ޲޳޴޵ +ޱ޲޳޴ +ޱ޲޳ +ޱ޲ +ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1) FROM `£Ô£·`; +£Ã£± SUBSTRING(`£Ã£±`,1) +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,2) FROM `£Ô£·`; +£Ã£± SUBSTRING(`£Ã£±`,2) +ޱ޲޳޴޵ ޲޳޴޵ +ޱ޲޳޴ ޲޳޴ +ޱ޲޳ ޲޳ +ޱ޲ ޲ +ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,3) FROM `£Ô£·`; +£Ã£± SUBSTRING(`£Ã£±`,3) +ޱ޲޳޴޵ ޳޴޵ +ޱ޲޳޴ ޳޴ +ޱ޲޳ ޳ +ޱ޲ +ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,4) FROM `£Ô£·`; +£Ã£± SUBSTRING(`£Ã£±`,4) +ޱ޲޳޴޵ ޴޵ +ޱ޲޳޴ Ž´ +ޱ޲޳ +ޱ޲ +ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,5) FROM `£Ô£·`; +£Ã£± SUBSTRING(`£Ã£±`,5) +ޱ޲޳޴޵ ޵ +ޱ޲޳޴ +ޱ޲޳ +ޱ޲ +ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,6) FROM `£Ô£·`; +£Ã£± SUBSTRING(`£Ã£±`,6) +ޱ޲޳޴޵ +ޱ޲޳޴ +ޱ޲޳ +ޱ޲ +ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 0) FROM `£Ô£·`; +£Ã£± SUBSTRING(`£Ã£±` FROM 0) +ޱ޲޳޴޵ +ޱ޲޳޴ +ޱ޲޳ +ޱ޲ +ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1) FROM `£Ô£·`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1) +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 2) FROM `£Ô£·`; +£Ã£± SUBSTRING(`£Ã£±` FROM 2) +ޱ޲޳޴޵ ޲޳޴޵ +ޱ޲޳޴ ޲޳޴ +ޱ޲޳ ޲޳ +ޱ޲ ޲ +ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 3) FROM `£Ô£·`; +£Ã£± SUBSTRING(`£Ã£±` FROM 3) +ޱ޲޳޴޵ ޳޴޵ +ޱ޲޳޴ ޳޴ +ޱ޲޳ ޳ +ޱ޲ +ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 4) FROM `£Ô£·`; +£Ã£± SUBSTRING(`£Ã£±` FROM 4) +ޱ޲޳޴޵ ޴޵ +ޱ޲޳޴ Ž´ +ޱ޲޳ +ޱ޲ +ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 5) FROM `£Ô£·`; +£Ã£± SUBSTRING(`£Ã£±` FROM 5) +ޱ޲޳޴޵ ޵ +ޱ޲޳޴ +ޱ޲޳ +ޱ޲ +ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 6) FROM `£Ô£·`; +£Ã£± SUBSTRING(`£Ã£±` FROM 6) +ޱ޲޳޴޵ +ޱ޲޳޴ +ޱ޲޳ +ޱ޲ +ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£·`; +£Ã£± SUBSTRING(`£Ã£±`,1,0) +ޱ޲޳޴޵ +ޱ޲޳޴ +ޱ޲޳ +ޱ޲ +ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£·`; +£Ã£± SUBSTRING(`£Ã£±`,1,1) +ޱ޲޳޴޵ ޱ +ޱ޲޳޴ ޱ +ޱ޲޳ ޱ +ޱ޲ ޱ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£·`; +£Ã£± SUBSTRING(`£Ã£±`,1,2) +ޱ޲޳޴޵ ޱ޲ +ޱ޲޳޴ ޱ޲ +ޱ޲޳ ޱ޲ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£·`; +£Ã£± SUBSTRING(`£Ã£±`,1,3) +ޱ޲޳޴޵ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£·`; +£Ã£± SUBSTRING(`£Ã£±`,1,4) +ޱ޲޳޴޵ ޱ޲޳޴ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£·`; +£Ã£± SUBSTRING(`£Ã£±`,1,5) +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£·`; +£Ã£± SUBSTRING(`£Ã£±`,1,6) +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£·`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 0) +ޱ޲޳޴޵ +ޱ޲޳޴ +ޱ޲޳ +ޱ޲ +ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£·`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 1) +ޱ޲޳޴޵ ޱ +ޱ޲޳޴ ޱ +ޱ޲޳ ޱ +ޱ޲ ޱ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£·`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 2) +ޱ޲޳޴޵ ޱ޲ +ޱ޲޳޴ ޱ޲ +ޱ޲޳ ޱ޲ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£·`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 3) +ޱ޲޳޴޵ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£·`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 4) +ޱ޲޳޴޵ ޱ޲޳޴ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£·`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 5) +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£·`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 6) +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,0) FROM `£Ô£¸`; +£Ã£± SUBSTRING(`£Ã£±`,0) +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ +¤¢¤¤ +¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1) FROM `£Ô£¸`; +£Ã£± SUBSTRING(`£Ã£±`,1) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,2) FROM `£Ô£¸`; +£Ã£± SUBSTRING(`£Ã£±`,2) +¤¢¤¤¤¦¤¨¤ª ¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¤¤¦ +¤¢¤¤ ¤¤ +¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,3) FROM `£Ô£¸`; +£Ã£± SUBSTRING(`£Ã£±`,3) +¤¢¤¤¤¦¤¨¤ª ¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¦¤¨ +¤¢¤¤¤¦ ¤¦ +¤¢¤¤ +¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,4) FROM `£Ô£¸`; +£Ã£± SUBSTRING(`£Ã£±`,4) +¤¢¤¤¤¦¤¨¤ª ¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¨ +¤¢¤¤¤¦ +¤¢¤¤ +¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,5) FROM `£Ô£¸`; +£Ã£± SUBSTRING(`£Ã£±`,5) +¤¢¤¤¤¦¤¨¤ª ¤ª +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ +¤¢¤¤ +¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,6) FROM `£Ô£¸`; +£Ã£± SUBSTRING(`£Ã£±`,6) +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ +¤¢¤¤ +¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 0) FROM `£Ô£¸`; +£Ã£± SUBSTRING(`£Ã£±` FROM 0) +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ +¤¢¤¤ +¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1) FROM `£Ô£¸`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 2) FROM `£Ô£¸`; +£Ã£± SUBSTRING(`£Ã£±` FROM 2) +¤¢¤¤¤¦¤¨¤ª ¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¤¤¦ +¤¢¤¤ ¤¤ +¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 3) FROM `£Ô£¸`; +£Ã£± SUBSTRING(`£Ã£±` FROM 3) +¤¢¤¤¤¦¤¨¤ª ¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¦¤¨ +¤¢¤¤¤¦ ¤¦ +¤¢¤¤ +¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 4) FROM `£Ô£¸`; +£Ã£± SUBSTRING(`£Ã£±` FROM 4) +¤¢¤¤¤¦¤¨¤ª ¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¨ +¤¢¤¤¤¦ +¤¢¤¤ +¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 5) FROM `£Ô£¸`; +£Ã£± SUBSTRING(`£Ã£±` FROM 5) +¤¢¤¤¤¦¤¨¤ª ¤ª +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ +¤¢¤¤ +¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 6) FROM `£Ô£¸`; +£Ã£± SUBSTRING(`£Ã£±` FROM 6) +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ +¤¢¤¤ +¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£¸`; +£Ã£± SUBSTRING(`£Ã£±`,1,0) +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ +¤¢¤¤ +¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£¸`; +£Ã£± SUBSTRING(`£Ã£±`,1,1) +¤¢¤¤¤¦¤¨¤ª ¤¢ +¤¢¤¤¤¦¤¨ ¤¢ +¤¢¤¤¤¦ ¤¢ +¤¢¤¤ ¤¢ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£¸`; +£Ã£± SUBSTRING(`£Ã£±`,1,2) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤ +¤¢¤¤¤¦¤¨ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£¸`; +£Ã£± SUBSTRING(`£Ã£±`,1,3) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£¸`; +£Ã£± SUBSTRING(`£Ã£±`,1,4) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£¸`; +£Ã£± SUBSTRING(`£Ã£±`,1,5) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£¸`; +£Ã£± SUBSTRING(`£Ã£±`,1,6) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£¸`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 0) +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ +¤¢¤¤ +¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£¸`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 1) +¤¢¤¤¤¦¤¨¤ª ¤¢ +¤¢¤¤¤¦¤¨ ¤¢ +¤¢¤¤¤¦ ¤¢ +¤¢¤¤ ¤¢ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£¸`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 2) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤ +¤¢¤¤¤¦¤¨ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£¸`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 3) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£¸`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 4) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£¸`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 5) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£¸`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 6) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,0) FROM `£Ô£¹`; +£Ã£± SUBSTRING(`£Ã£±`,0) +íÜíÝíÞíßíà +íÜíÝíÞíß +íÜíÝíÞ +íÜíÝ +íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1) FROM `£Ô£¹`; +£Ã£± SUBSTRING(`£Ã£±`,1) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,2) FROM `£Ô£¹`; +£Ã£± SUBSTRING(`£Ã£±`,2) +íÜíÝíÞíßíà íÝíÞíßíà +íÜíÝíÞíß íÝíÞíß +íÜíÝíÞ íÝíÞ +íÜíÝ íÝ +íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,3) FROM `£Ô£¹`; +£Ã£± SUBSTRING(`£Ã£±`,3) +íÜíÝíÞíßíà íÞíßíà +íÜíÝíÞíß íÞíß +íÜíÝíÞ íÞ +íÜíÝ +íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,4) FROM `£Ô£¹`; +£Ã£± SUBSTRING(`£Ã£±`,4) +íÜíÝíÞíßíà íßíà +íÜíÝíÞíß íß +íÜíÝíÞ +íÜíÝ +íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,5) FROM `£Ô£¹`; +£Ã£± SUBSTRING(`£Ã£±`,5) +íÜíÝíÞíßíà íà +íÜíÝíÞíß +íÜíÝíÞ +íÜíÝ +íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,6) FROM `£Ô£¹`; +£Ã£± SUBSTRING(`£Ã£±`,6) +íÜíÝíÞíßíà +íÜíÝíÞíß +íÜíÝíÞ +íÜíÝ +íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 0) FROM `£Ô£¹`; +£Ã£± SUBSTRING(`£Ã£±` FROM 0) +íÜíÝíÞíßíà +íÜíÝíÞíß +íÜíÝíÞ +íÜíÝ +íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1) FROM `£Ô£¹`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 2) FROM `£Ô£¹`; +£Ã£± SUBSTRING(`£Ã£±` FROM 2) +íÜíÝíÞíßíà íÝíÞíßíà +íÜíÝíÞíß íÝíÞíß +íÜíÝíÞ íÝíÞ +íÜíÝ íÝ +íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 3) FROM `£Ô£¹`; +£Ã£± SUBSTRING(`£Ã£±` FROM 3) +íÜíÝíÞíßíà íÞíßíà +íÜíÝíÞíß íÞíß +íÜíÝíÞ íÞ +íÜíÝ +íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 4) FROM `£Ô£¹`; +£Ã£± SUBSTRING(`£Ã£±` FROM 4) +íÜíÝíÞíßíà íßíà +íÜíÝíÞíß íß +íÜíÝíÞ +íÜíÝ +íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 5) FROM `£Ô£¹`; +£Ã£± SUBSTRING(`£Ã£±` FROM 5) +íÜíÝíÞíßíà íà +íÜíÝíÞíß +íÜíÝíÞ +íÜíÝ +íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 6) FROM `£Ô£¹`; +£Ã£± SUBSTRING(`£Ã£±` FROM 6) +íÜíÝíÞíßíà +íÜíÝíÞíß +íÜíÝíÞ +íÜíÝ +íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£¹`; +£Ã£± SUBSTRING(`£Ã£±`,1,0) +íÜíÝíÞíßíà +íÜíÝíÞíß +íÜíÝíÞ +íÜíÝ +íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£¹`; +£Ã£± SUBSTRING(`£Ã£±`,1,1) +íÜíÝíÞíßíà íÜ +íÜíÝíÞíß íÜ +íÜíÝíÞ íÜ +íÜíÝ íÜ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£¹`; +£Ã£± SUBSTRING(`£Ã£±`,1,2) +íÜíÝíÞíßíà íÜíÝ +íÜíÝíÞíß íÜíÝ +íÜíÝíÞ íÜíÝ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£¹`; +£Ã£± SUBSTRING(`£Ã£±`,1,3) +íÜíÝíÞíßíà íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞ +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£¹`; +£Ã£± SUBSTRING(`£Ã£±`,1,4) +íÜíÝíÞíßíà íÜíÝíÞíß +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£¹`; +£Ã£± SUBSTRING(`£Ã£±`,1,5) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£¹`; +£Ã£± SUBSTRING(`£Ã£±`,1,6) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£¹`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 0) +íÜíÝíÞíßíà +íÜíÝíÞíß +íÜíÝíÞ +íÜíÝ +íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£¹`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 1) +íÜíÝíÞíßíà íÜ +íÜíÝíÞíß íÜ +íÜíÝíÞ íÜ +íÜíÝ íÜ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£¹`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 2) +íÜíÝíÞíßíà íÜíÝ +íÜíÝíÞíß íÜíÝ +íÜíÝíÞ íÜíÝ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£¹`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 3) +íÜíÝíÞíßíà íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞ +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£¹`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 4) +íÜíÝíÞíßíà íÜíÝíÞíß +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£¹`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 5) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£¹`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 6) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,0) FROM `£Ô£±£°`; +£Ã£± SUBSTRING(`£Ã£±`,0) +ޱ޲޳޴޵ +ޱ޲޳޴ +ޱ޲޳ +ޱ޲ +ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1) FROM `£Ô£±£°`; +£Ã£± SUBSTRING(`£Ã£±`,1) +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,2) FROM `£Ô£±£°`; +£Ã£± SUBSTRING(`£Ã£±`,2) +ޱ޲޳޴޵ ޲޳޴޵ +ޱ޲޳޴ ޲޳޴ +ޱ޲޳ ޲޳ +ޱ޲ ޲ +ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,3) FROM `£Ô£±£°`; +£Ã£± SUBSTRING(`£Ã£±`,3) +ޱ޲޳޴޵ ޳޴޵ +ޱ޲޳޴ ޳޴ +ޱ޲޳ ޳ +ޱ޲ +ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,4) FROM `£Ô£±£°`; +£Ã£± SUBSTRING(`£Ã£±`,4) +ޱ޲޳޴޵ ޴޵ +ޱ޲޳޴ Ž´ +ޱ޲޳ +ޱ޲ +ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,5) FROM `£Ô£±£°`; +£Ã£± SUBSTRING(`£Ã£±`,5) +ޱ޲޳޴޵ ޵ +ޱ޲޳޴ +ޱ޲޳ +ޱ޲ +ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,6) FROM `£Ô£±£°`; +£Ã£± SUBSTRING(`£Ã£±`,6) +ޱ޲޳޴޵ +ޱ޲޳޴ +ޱ޲޳ +ޱ޲ +ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 0) FROM `£Ô£±£°`; +£Ã£± SUBSTRING(`£Ã£±` FROM 0) +ޱ޲޳޴޵ +ޱ޲޳޴ +ޱ޲޳ +ޱ޲ +ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1) FROM `£Ô£±£°`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1) +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 2) FROM `£Ô£±£°`; +£Ã£± SUBSTRING(`£Ã£±` FROM 2) +ޱ޲޳޴޵ ޲޳޴޵ +ޱ޲޳޴ ޲޳޴ +ޱ޲޳ ޲޳ +ޱ޲ ޲ +ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 3) FROM `£Ô£±£°`; +£Ã£± SUBSTRING(`£Ã£±` FROM 3) +ޱ޲޳޴޵ ޳޴޵ +ޱ޲޳޴ ޳޴ +ޱ޲޳ ޳ +ޱ޲ +ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 4) FROM `£Ô£±£°`; +£Ã£± SUBSTRING(`£Ã£±` FROM 4) +ޱ޲޳޴޵ ޴޵ +ޱ޲޳޴ Ž´ +ޱ޲޳ +ޱ޲ +ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 5) FROM `£Ô£±£°`; +£Ã£± SUBSTRING(`£Ã£±` FROM 5) +ޱ޲޳޴޵ ޵ +ޱ޲޳޴ +ޱ޲޳ +ޱ޲ +ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 6) FROM `£Ô£±£°`; +£Ã£± SUBSTRING(`£Ã£±` FROM 6) +ޱ޲޳޴޵ +ޱ޲޳޴ +ޱ޲޳ +ޱ޲ +ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£±£°`; +£Ã£± SUBSTRING(`£Ã£±`,1,0) +ޱ޲޳޴޵ +ޱ޲޳޴ +ޱ޲޳ +ޱ޲ +ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£±£°`; +£Ã£± SUBSTRING(`£Ã£±`,1,1) +ޱ޲޳޴޵ ޱ +ޱ޲޳޴ ޱ +ޱ޲޳ ޱ +ޱ޲ ޱ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£±£°`; +£Ã£± SUBSTRING(`£Ã£±`,1,2) +ޱ޲޳޴޵ ޱ޲ +ޱ޲޳޴ ޱ޲ +ޱ޲޳ ޱ޲ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£±£°`; +£Ã£± SUBSTRING(`£Ã£±`,1,3) +ޱ޲޳޴޵ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£±£°`; +£Ã£± SUBSTRING(`£Ã£±`,1,4) +ޱ޲޳޴޵ ޱ޲޳޴ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£±£°`; +£Ã£± SUBSTRING(`£Ã£±`,1,5) +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£±£°`; +£Ã£± SUBSTRING(`£Ã£±`,1,6) +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£±£°`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 0) +ޱ޲޳޴޵ +ޱ޲޳޴ +ޱ޲޳ +ޱ޲ +ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£±£°`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 1) +ޱ޲޳޴޵ ޱ +ޱ޲޳޴ ޱ +ޱ޲޳ ޱ +ޱ޲ ޱ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£±£°`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 2) +ޱ޲޳޴޵ ޱ޲ +ޱ޲޳޴ ޱ޲ +ޱ޲޳ ޱ޲ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£±£°`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 3) +ޱ޲޳޴޵ ޱ޲޳ +ޱ޲޳޴ ޱ޲޳ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£±£°`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 4) +ޱ޲޳޴޵ ޱ޲޳޴ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£±£°`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 5) +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£±£°`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 6) +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴ ޱ޲޳޴ +ޱ޲޳ ޱ޲޳ +ޱ޲ ޱ޲ +ޱ ޱ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,0) FROM `£Ô£±£±`; +£Ã£± SUBSTRING(`£Ã£±`,0) +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ +¤¢¤¤ +¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1) FROM `£Ô£±£±`; +£Ã£± SUBSTRING(`£Ã£±`,1) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,2) FROM `£Ô£±£±`; +£Ã£± SUBSTRING(`£Ã£±`,2) +¤¢¤¤¤¦¤¨¤ª ¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¤¤¦ +¤¢¤¤ ¤¤ +¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,3) FROM `£Ô£±£±`; +£Ã£± SUBSTRING(`£Ã£±`,3) +¤¢¤¤¤¦¤¨¤ª ¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¦¤¨ +¤¢¤¤¤¦ ¤¦ +¤¢¤¤ +¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,4) FROM `£Ô£±£±`; +£Ã£± SUBSTRING(`£Ã£±`,4) +¤¢¤¤¤¦¤¨¤ª ¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¨ +¤¢¤¤¤¦ +¤¢¤¤ +¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,5) FROM `£Ô£±£±`; +£Ã£± SUBSTRING(`£Ã£±`,5) +¤¢¤¤¤¦¤¨¤ª ¤ª +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ +¤¢¤¤ +¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,6) FROM `£Ô£±£±`; +£Ã£± SUBSTRING(`£Ã£±`,6) +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ +¤¢¤¤ +¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 0) FROM `£Ô£±£±`; +£Ã£± SUBSTRING(`£Ã£±` FROM 0) +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ +¤¢¤¤ +¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1) FROM `£Ô£±£±`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 2) FROM `£Ô£±£±`; +£Ã£± SUBSTRING(`£Ã£±` FROM 2) +¤¢¤¤¤¦¤¨¤ª ¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¤¤¦ +¤¢¤¤ ¤¤ +¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 3) FROM `£Ô£±£±`; +£Ã£± SUBSTRING(`£Ã£±` FROM 3) +¤¢¤¤¤¦¤¨¤ª ¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¦¤¨ +¤¢¤¤¤¦ ¤¦ +¤¢¤¤ +¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 4) FROM `£Ô£±£±`; +£Ã£± SUBSTRING(`£Ã£±` FROM 4) +¤¢¤¤¤¦¤¨¤ª ¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¨ +¤¢¤¤¤¦ +¤¢¤¤ +¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 5) FROM `£Ô£±£±`; +£Ã£± SUBSTRING(`£Ã£±` FROM 5) +¤¢¤¤¤¦¤¨¤ª ¤ª +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ +¤¢¤¤ +¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 6) FROM `£Ô£±£±`; +£Ã£± SUBSTRING(`£Ã£±` FROM 6) +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ +¤¢¤¤ +¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£±£±`; +£Ã£± SUBSTRING(`£Ã£±`,1,0) +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ +¤¢¤¤ +¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£±£±`; +£Ã£± SUBSTRING(`£Ã£±`,1,1) +¤¢¤¤¤¦¤¨¤ª ¤¢ +¤¢¤¤¤¦¤¨ ¤¢ +¤¢¤¤¤¦ ¤¢ +¤¢¤¤ ¤¢ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£±£±`; +£Ã£± SUBSTRING(`£Ã£±`,1,2) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤ +¤¢¤¤¤¦¤¨ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£±£±`; +£Ã£± SUBSTRING(`£Ã£±`,1,3) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£±£±`; +£Ã£± SUBSTRING(`£Ã£±`,1,4) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£±£±`; +£Ã£± SUBSTRING(`£Ã£±`,1,5) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£±£±`; +£Ã£± SUBSTRING(`£Ã£±`,1,6) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£±£±`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 0) +¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ +¤¢¤¤ +¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£±£±`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 1) +¤¢¤¤¤¦¤¨¤ª ¤¢ +¤¢¤¤¤¦¤¨ ¤¢ +¤¢¤¤¤¦ ¤¢ +¤¢¤¤ ¤¢ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£±£±`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 2) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤ +¤¢¤¤¤¦¤¨ ¤¢¤¤ +¤¢¤¤¤¦ ¤¢¤¤ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£±£±`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 3) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£±£±`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 4) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£±£±`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 5) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£±£±`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 6) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨ ¤¢¤¤¤¦¤¨ +¤¢¤¤¤¦ ¤¢¤¤¤¦ +¤¢¤¤ ¤¢¤¤ +¤¢ ¤¢ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,0) FROM `£Ô£±£²`; +£Ã£± SUBSTRING(`£Ã£±`,0) +íÜíÝíÞíßíà +íÜíÝíÞíß +íÜíÝíÞ +íÜíÝ +íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1) FROM `£Ô£±£²`; +£Ã£± SUBSTRING(`£Ã£±`,1) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,2) FROM `£Ô£±£²`; +£Ã£± SUBSTRING(`£Ã£±`,2) +íÜíÝíÞíßíà íÝíÞíßíà +íÜíÝíÞíß íÝíÞíß +íÜíÝíÞ íÝíÞ +íÜíÝ íÝ +íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,3) FROM `£Ô£±£²`; +£Ã£± SUBSTRING(`£Ã£±`,3) +íÜíÝíÞíßíà íÞíßíà +íÜíÝíÞíß íÞíß +íÜíÝíÞ íÞ +íÜíÝ +íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,4) FROM `£Ô£±£²`; +£Ã£± SUBSTRING(`£Ã£±`,4) +íÜíÝíÞíßíà íßíà +íÜíÝíÞíß íß +íÜíÝíÞ +íÜíÝ +íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,5) FROM `£Ô£±£²`; +£Ã£± SUBSTRING(`£Ã£±`,5) +íÜíÝíÞíßíà íà +íÜíÝíÞíß +íÜíÝíÞ +íÜíÝ +íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,6) FROM `£Ô£±£²`; +£Ã£± SUBSTRING(`£Ã£±`,6) +íÜíÝíÞíßíà +íÜíÝíÞíß +íÜíÝíÞ +íÜíÝ +íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 0) FROM `£Ô£±£²`; +£Ã£± SUBSTRING(`£Ã£±` FROM 0) +íÜíÝíÞíßíà +íÜíÝíÞíß +íÜíÝíÞ +íÜíÝ +íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1) FROM `£Ô£±£²`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 2) FROM `£Ô£±£²`; +£Ã£± SUBSTRING(`£Ã£±` FROM 2) +íÜíÝíÞíßíà íÝíÞíßíà +íÜíÝíÞíß íÝíÞíß +íÜíÝíÞ íÝíÞ +íÜíÝ íÝ +íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 3) FROM `£Ô£±£²`; +£Ã£± SUBSTRING(`£Ã£±` FROM 3) +íÜíÝíÞíßíà íÞíßíà +íÜíÝíÞíß íÞíß +íÜíÝíÞ íÞ +íÜíÝ +íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 4) FROM `£Ô£±£²`; +£Ã£± SUBSTRING(`£Ã£±` FROM 4) +íÜíÝíÞíßíà íßíà +íÜíÝíÞíß íß +íÜíÝíÞ +íÜíÝ +íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 5) FROM `£Ô£±£²`; +£Ã£± SUBSTRING(`£Ã£±` FROM 5) +íÜíÝíÞíßíà íà +íÜíÝíÞíß +íÜíÝíÞ +íÜíÝ +íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 6) FROM `£Ô£±£²`; +£Ã£± SUBSTRING(`£Ã£±` FROM 6) +íÜíÝíÞíßíà +íÜíÝíÞíß +íÜíÝíÞ +íÜíÝ +íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£±£²`; +£Ã£± SUBSTRING(`£Ã£±`,1,0) +íÜíÝíÞíßíà +íÜíÝíÞíß +íÜíÝíÞ +íÜíÝ +íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£±£²`; +£Ã£± SUBSTRING(`£Ã£±`,1,1) +íÜíÝíÞíßíà íÜ +íÜíÝíÞíß íÜ +íÜíÝíÞ íÜ +íÜíÝ íÜ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£±£²`; +£Ã£± SUBSTRING(`£Ã£±`,1,2) +íÜíÝíÞíßíà íÜíÝ +íÜíÝíÞíß íÜíÝ +íÜíÝíÞ íÜíÝ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£±£²`; +£Ã£± SUBSTRING(`£Ã£±`,1,3) +íÜíÝíÞíßíà íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞ +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£±£²`; +£Ã£± SUBSTRING(`£Ã£±`,1,4) +íÜíÝíÞíßíà íÜíÝíÞíß +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£±£²`; +£Ã£± SUBSTRING(`£Ã£±`,1,5) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£±£²`; +£Ã£± SUBSTRING(`£Ã£±`,1,6) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£±£²`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 0) +íÜíÝíÞíßíà +íÜíÝíÞíß +íÜíÝíÞ +íÜíÝ +íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£±£²`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 1) +íÜíÝíÞíßíà íÜ +íÜíÝíÞíß íÜ +íÜíÝíÞ íÜ +íÜíÝ íÜ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£±£²`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 2) +íÜíÝíÞíßíà íÜíÝ +íÜíÝíÞíß íÜíÝ +íÜíÝíÞ íÜíÝ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£±£²`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 3) +íÜíÝíÞíßíà íÜíÝíÞ +íÜíÝíÞíß íÜíÝíÞ +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£±£²`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 4) +íÜíÝíÞíßíà íÜíÝíÞíß +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£±£²`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 5) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£±£²`; +£Ã£± SUBSTRING(`£Ã£±` FROM 1 FOR 6) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíß íÜíÝíÞíß +íÜíÝíÞ íÜíÝíÞ +íÜíÝ íÜíÝ +íÜ íÜ + +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/r/jp_substring_utf8.result b/mysql-test/suite/jp/r/jp_substring_utf8.result new file mode 100755 index 00000000000..f838a2e75e2 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_substring_utf8.result @@ -0,0 +1,2738 @@ +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +drop table if exists `T11`; +drop table if exists `T12`; +SET NAMES utf8; +SET character_set_database = utf8; +CREATE TABLE `T1` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T11` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T12` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +INSERT INTO `T1` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `T3` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +INSERT INTO `T1ï¼` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `T12` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +SELECT `C1`, SUBSTRING(`C1`,0) FROM `T1`; +C1 SUBSTRING(`C1`,0) + +ï½± +アイ +アイウ +アイウエ +アイウエオ +SELECT `C1`, SUBSTRING(`C1`,1) FROM `T1`; +C1 SUBSTRING(`C1`,1) + +ï½± ï½± +アイ アイ +アイウ アイウ +アイウエ アイウエ +アイウエオ アイウエオ +SELECT `C1`, SUBSTRING(`C1`,2) FROM `T1`; +C1 SUBSTRING(`C1`,2) + +ï½± +アイ ï½² +アイウ イウ +アイウエ イウエ +アイウエオ イウエオ +SELECT `C1`, SUBSTRING(`C1`,3) FROM `T1`; +C1 SUBSTRING(`C1`,3) + +ï½± +アイ +アイウ ï½³ +アイウエ ウエ +アイウエオ ウエオ +SELECT `C1`, SUBSTRING(`C1`,4) FROM `T1`; +C1 SUBSTRING(`C1`,4) + +ï½± +アイ +アイウ +アイウエ ï½´ +アイウエオ ï½´ï½µ +SELECT `C1`, SUBSTRING(`C1`,5) FROM `T1`; +C1 SUBSTRING(`C1`,5) + +ï½± +アイ +アイウ +アイウエ +アイウエオ ï½µ +SELECT `C1`, SUBSTRING(`C1`,6) FROM `T1`; +C1 SUBSTRING(`C1`,6) + +ï½± +アイ +アイウ +アイウエ +アイウエオ +SELECT `C1`, SUBSTRING(`C1` FROM 0) FROM `T1`; +C1 SUBSTRING(`C1` FROM 0) + +ï½± +アイ +アイウ +アイウエ +アイウエオ +SELECT `C1`, SUBSTRING(`C1` FROM 1) FROM `T1`; +C1 SUBSTRING(`C1` FROM 1) + +ï½± ï½± +アイ アイ +アイウ アイウ +アイウエ アイウエ +アイウエオ アイウエオ +SELECT `C1`, SUBSTRING(`C1` FROM 2) FROM `T1`; +C1 SUBSTRING(`C1` FROM 2) + +ï½± +アイ ï½² +アイウ イウ +アイウエ イウエ +アイウエオ イウエオ +SELECT `C1`, SUBSTRING(`C1` FROM 3) FROM `T1`; +C1 SUBSTRING(`C1` FROM 3) + +ï½± +アイ +アイウ ï½³ +アイウエ ウエ +アイウエオ ウエオ +SELECT `C1`, SUBSTRING(`C1` FROM 4) FROM `T1`; +C1 SUBSTRING(`C1` FROM 4) + +ï½± +アイ +アイウ +アイウエ ï½´ +アイウエオ ï½´ï½µ +SELECT `C1`, SUBSTRING(`C1` FROM 5) FROM `T1`; +C1 SUBSTRING(`C1` FROM 5) + +ï½± +アイ +アイウ +アイウエ +アイウエオ ï½µ +SELECT `C1`, SUBSTRING(`C1` FROM 6) FROM `T1`; +C1 SUBSTRING(`C1` FROM 6) + +ï½± +アイ +アイウ +アイウエ +アイウエオ +SELECT `C1`, SUBSTRING(`C1`,1,0) FROM `T1`; +C1 SUBSTRING(`C1`,1,0) + +ï½± +アイ +アイウ +アイウエ +アイウエオ +SELECT `C1`, SUBSTRING(`C1`,1,1) FROM `T1`; +C1 SUBSTRING(`C1`,1,1) + +ï½± ï½± +アイ ï½± +アイウ ï½± +アイウエ ï½± +アイウエオ ï½± +SELECT `C1`, SUBSTRING(`C1`,1,2) FROM `T1`; +C1 SUBSTRING(`C1`,1,2) + +ï½± ï½± +アイ アイ +アイウ アイ +アイウエ アイ +アイウエオ アイ +SELECT `C1`, SUBSTRING(`C1`,1,3) FROM `T1`; +C1 SUBSTRING(`C1`,1,3) + +ï½± ï½± +アイ アイ +アイウ アイウ +アイウエ アイウ +アイウエオ アイウ +SELECT `C1`, SUBSTRING(`C1`,1,4) FROM `T1`; +C1 SUBSTRING(`C1`,1,4) + +ï½± ï½± +アイ アイ +アイウ アイウ +アイウエ アイウエ +アイウエオ アイウエ +SELECT `C1`, SUBSTRING(`C1`,1,5) FROM `T1`; +C1 SUBSTRING(`C1`,1,5) + +ï½± ï½± +アイ アイ +アイウ アイウ +アイウエ アイウエ +アイウエオ アイウエオ +SELECT `C1`, SUBSTRING(`C1`,1,6) FROM `T1`; +C1 SUBSTRING(`C1`,1,6) + +ï½± ï½± +アイ アイ +アイウ アイウ +アイウエ アイウエ +アイウエオ アイウエオ +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 0) FROM `T1`; +C1 SUBSTRING(`C1` FROM 1 FOR 0) + +ï½± +アイ +アイウ +アイウエ +アイウエオ +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 1) FROM `T1`; +C1 SUBSTRING(`C1` FROM 1 FOR 1) + +ï½± ï½± +アイ ï½± +アイウ ï½± +アイウエ ï½± +アイウエオ ï½± +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 2) FROM `T1`; +C1 SUBSTRING(`C1` FROM 1 FOR 2) + +ï½± ï½± +アイ アイ +アイウ アイ +アイウエ アイ +アイウエオ アイ +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 3) FROM `T1`; +C1 SUBSTRING(`C1` FROM 1 FOR 3) + +ï½± ï½± +アイ アイ +アイウ アイウ +アイウエ アイウ +アイウエオ アイウ +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 4) FROM `T1`; +C1 SUBSTRING(`C1` FROM 1 FOR 4) + +ï½± ï½± +アイ アイ +アイウ アイウ +アイウエ アイウエ +アイウエオ アイウエ +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 5) FROM `T1`; +C1 SUBSTRING(`C1` FROM 1 FOR 5) + +ï½± ï½± +アイ アイ +アイウ アイウ +アイウエ アイウエ +アイウエオ アイウエオ +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 6) FROM `T1`; +C1 SUBSTRING(`C1` FROM 1 FOR 6) + +ï½± ï½± +アイ アイ +アイウ アイウ +アイウエ アイウエ +アイウエオ アイウエオ +SELECT `C1`, SUBSTRING(`C1`,0) FROM `ï¼´ï¼’`; +C1 SUBSTRING(`C1`,0) + +ã‚ +ã‚ã„ +ã‚ã„ㆠ+ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ +SELECT `C1`, SUBSTRING(`C1`,1) FROM `ï¼´ï¼’`; +C1 SUBSTRING(`C1`,1) + +ã‚ ã‚ +ã‚ã„ ã‚ã„ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +SELECT `C1`, SUBSTRING(`C1`,2) FROM `ï¼´ï¼’`; +C1 SUBSTRING(`C1`,2) + +ã‚ +ã‚ã„ ã„ +ã‚ã„ㆠã„ㆠ+ã‚ã„ã†ãˆ ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ ã„ã†ãˆãŠ +SELECT `C1`, SUBSTRING(`C1`,3) FROM `ï¼´ï¼’`; +C1 SUBSTRING(`C1`,3) + +ã‚ +ã‚ã„ +ã‚ã„ㆠㆠ+ã‚ã„ã†ãˆ ã†ãˆ +ã‚ã„ã†ãˆãŠ ã†ãˆãŠ +SELECT `C1`, SUBSTRING(`C1`,4) FROM `ï¼´ï¼’`; +C1 SUBSTRING(`C1`,4) + +ã‚ +ã‚ã„ +ã‚ã„ㆠ+ã‚ã„ã†ãˆ ㈠+ã‚ã„ã†ãˆãŠ ãˆãŠ +SELECT `C1`, SUBSTRING(`C1`,5) FROM `ï¼´ï¼’`; +C1 SUBSTRING(`C1`,5) + +ã‚ +ã‚ã„ +ã‚ã„ㆠ+ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ ãŠ +SELECT `C1`, SUBSTRING(`C1`,6) FROM `ï¼´ï¼’`; +C1 SUBSTRING(`C1`,6) + +ã‚ +ã‚ã„ +ã‚ã„ㆠ+ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ +SELECT `C1`, SUBSTRING(`C1` FROM 0) FROM `ï¼´ï¼’`; +C1 SUBSTRING(`C1` FROM 0) + +ã‚ +ã‚ã„ +ã‚ã„ㆠ+ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ +SELECT `C1`, SUBSTRING(`C1` FROM 1) FROM `ï¼´ï¼’`; +C1 SUBSTRING(`C1` FROM 1) + +ã‚ ã‚ +ã‚ã„ ã‚ã„ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +SELECT `C1`, SUBSTRING(`C1` FROM 2) FROM `ï¼´ï¼’`; +C1 SUBSTRING(`C1` FROM 2) + +ã‚ +ã‚ã„ ã„ +ã‚ã„ㆠã„ㆠ+ã‚ã„ã†ãˆ ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ ã„ã†ãˆãŠ +SELECT `C1`, SUBSTRING(`C1` FROM 3) FROM `ï¼´ï¼’`; +C1 SUBSTRING(`C1` FROM 3) + +ã‚ +ã‚ã„ +ã‚ã„ㆠㆠ+ã‚ã„ã†ãˆ ã†ãˆ +ã‚ã„ã†ãˆãŠ ã†ãˆãŠ +SELECT `C1`, SUBSTRING(`C1` FROM 4) FROM `ï¼´ï¼’`; +C1 SUBSTRING(`C1` FROM 4) + +ã‚ +ã‚ã„ +ã‚ã„ㆠ+ã‚ã„ã†ãˆ ㈠+ã‚ã„ã†ãˆãŠ ãˆãŠ +SELECT `C1`, SUBSTRING(`C1` FROM 5) FROM `ï¼´ï¼’`; +C1 SUBSTRING(`C1` FROM 5) + +ã‚ +ã‚ã„ +ã‚ã„ㆠ+ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ ãŠ +SELECT `C1`, SUBSTRING(`C1` FROM 6) FROM `ï¼´ï¼’`; +C1 SUBSTRING(`C1` FROM 6) + +ã‚ +ã‚ã„ +ã‚ã„ㆠ+ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ +SELECT `C1`, SUBSTRING(`C1`,1,0) FROM `ï¼´ï¼’`; +C1 SUBSTRING(`C1`,1,0) + +ã‚ +ã‚ã„ +ã‚ã„ㆠ+ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ +SELECT `C1`, SUBSTRING(`C1`,1,1) FROM `ï¼´ï¼’`; +C1 SUBSTRING(`C1`,1,1) + +ã‚ ã‚ +ã‚ã„ ã‚ +ã‚ã„ㆠ゠+ã‚ã„ã†ãˆ ã‚ +ã‚ã„ã†ãˆãŠ ã‚ +SELECT `C1`, SUBSTRING(`C1`,1,2) FROM `ï¼´ï¼’`; +C1 SUBSTRING(`C1`,1,2) + +ã‚ ã‚ +ã‚ã„ ã‚ã„ +ã‚ã„ㆠã‚ã„ +ã‚ã„ã†ãˆ ã‚ã„ +ã‚ã„ã†ãˆãŠ ã‚ã„ +SELECT `C1`, SUBSTRING(`C1`,1,3) FROM `ï¼´ï¼’`; +C1 SUBSTRING(`C1`,1,3) + +ã‚ ã‚ +ã‚ã„ ã‚ã„ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ã†ãˆ ã‚ã„ㆠ+ã‚ã„ã†ãˆãŠ ã‚ã„ㆠ+SELECT `C1`, SUBSTRING(`C1`,1,4) FROM `ï¼´ï¼’`; +C1 SUBSTRING(`C1`,1,4) + +ã‚ ã‚ +ã‚ã„ ã‚ã„ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆ +SELECT `C1`, SUBSTRING(`C1`,1,5) FROM `ï¼´ï¼’`; +C1 SUBSTRING(`C1`,1,5) + +ã‚ ã‚ +ã‚ã„ ã‚ã„ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +SELECT `C1`, SUBSTRING(`C1`,1,6) FROM `ï¼´ï¼’`; +C1 SUBSTRING(`C1`,1,6) + +ã‚ ã‚ +ã‚ã„ ã‚ã„ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 0) FROM `ï¼´ï¼’`; +C1 SUBSTRING(`C1` FROM 1 FOR 0) + +ã‚ +ã‚ã„ +ã‚ã„ㆠ+ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 1) FROM `ï¼´ï¼’`; +C1 SUBSTRING(`C1` FROM 1 FOR 1) + +ã‚ ã‚ +ã‚ã„ ã‚ +ã‚ã„ㆠ゠+ã‚ã„ã†ãˆ ã‚ +ã‚ã„ã†ãˆãŠ ã‚ +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 2) FROM `ï¼´ï¼’`; +C1 SUBSTRING(`C1` FROM 1 FOR 2) + +ã‚ ã‚ +ã‚ã„ ã‚ã„ +ã‚ã„ㆠã‚ã„ +ã‚ã„ã†ãˆ ã‚ã„ +ã‚ã„ã†ãˆãŠ ã‚ã„ +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 3) FROM `ï¼´ï¼’`; +C1 SUBSTRING(`C1` FROM 1 FOR 3) + +ã‚ ã‚ +ã‚ã„ ã‚ã„ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ã†ãˆ ã‚ã„ㆠ+ã‚ã„ã†ãˆãŠ ã‚ã„ㆠ+SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 4) FROM `ï¼´ï¼’`; +C1 SUBSTRING(`C1` FROM 1 FOR 4) + +ã‚ ã‚ +ã‚ã„ ã‚ã„ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆ +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 5) FROM `ï¼´ï¼’`; +C1 SUBSTRING(`C1` FROM 1 FOR 5) + +ã‚ ã‚ +ã‚ã„ ã‚ã„ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 6) FROM `ï¼´ï¼’`; +C1 SUBSTRING(`C1` FROM 1 FOR 6) + +ã‚ ã‚ +ã‚ã„ ã‚ã„ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +SELECT `C1`, SUBSTRING(`C1`,0) FROM `T3`; +C1 SUBSTRING(`C1`,0) + +é¾” +龔龖 +龔龖龗 +龔龖龗龞 +龔龖龗龞龡 +SELECT `C1`, SUBSTRING(`C1`,1) FROM `T3`; +C1 SUBSTRING(`C1`,1) + +é¾” é¾” +龔龖 龔龖 +龔龖龗 龔龖龗 +龔龖龗龞 龔龖龗龞 +龔龖龗龞龡 龔龖龗龞龡 +SELECT `C1`, SUBSTRING(`C1`,2) FROM `T3`; +C1 SUBSTRING(`C1`,2) + +é¾” +龔龖 é¾– +龔龖龗 é¾–é¾— +龔龖龗龞 龖龗龞 +龔龖龗龞龡 龖龗龞龡 +SELECT `C1`, SUBSTRING(`C1`,3) FROM `T3`; +C1 SUBSTRING(`C1`,3) + +é¾” +龔龖 +龔龖龗 é¾— +龔龖龗龞 龗龞 +龔龖龗龞龡 龗龞龡 +SELECT `C1`, SUBSTRING(`C1`,4) FROM `T3`; +C1 SUBSTRING(`C1`,4) + +é¾” +龔龖 +龔龖龗 +龔龖龗龞 龞 +龔龖龗龞龡 龞龡 +SELECT `C1`, SUBSTRING(`C1`,5) FROM `T3`; +C1 SUBSTRING(`C1`,5) + +é¾” +龔龖 +龔龖龗 +龔龖龗龞 +龔龖龗龞龡 龡 +SELECT `C1`, SUBSTRING(`C1`,6) FROM `T3`; +C1 SUBSTRING(`C1`,6) + +é¾” +龔龖 +龔龖龗 +龔龖龗龞 +龔龖龗龞龡 +SELECT `C1`, SUBSTRING(`C1` FROM 0) FROM `T3`; +C1 SUBSTRING(`C1` FROM 0) + +é¾” +龔龖 +龔龖龗 +龔龖龗龞 +龔龖龗龞龡 +SELECT `C1`, SUBSTRING(`C1` FROM 1) FROM `T3`; +C1 SUBSTRING(`C1` FROM 1) + +é¾” é¾” +龔龖 龔龖 +龔龖龗 龔龖龗 +龔龖龗龞 龔龖龗龞 +龔龖龗龞龡 龔龖龗龞龡 +SELECT `C1`, SUBSTRING(`C1` FROM 2) FROM `T3`; +C1 SUBSTRING(`C1` FROM 2) + +é¾” +龔龖 é¾– +龔龖龗 é¾–é¾— +龔龖龗龞 龖龗龞 +龔龖龗龞龡 龖龗龞龡 +SELECT `C1`, SUBSTRING(`C1` FROM 3) FROM `T3`; +C1 SUBSTRING(`C1` FROM 3) + +é¾” +龔龖 +龔龖龗 é¾— +龔龖龗龞 龗龞 +龔龖龗龞龡 龗龞龡 +SELECT `C1`, SUBSTRING(`C1` FROM 4) FROM `T3`; +C1 SUBSTRING(`C1` FROM 4) + +é¾” +龔龖 +龔龖龗 +龔龖龗龞 龞 +龔龖龗龞龡 龞龡 +SELECT `C1`, SUBSTRING(`C1` FROM 5) FROM `T3`; +C1 SUBSTRING(`C1` FROM 5) + +é¾” +龔龖 +龔龖龗 +龔龖龗龞 +龔龖龗龞龡 龡 +SELECT `C1`, SUBSTRING(`C1` FROM 6) FROM `T3`; +C1 SUBSTRING(`C1` FROM 6) + +é¾” +龔龖 +龔龖龗 +龔龖龗龞 +龔龖龗龞龡 +SELECT `C1`, SUBSTRING(`C1`,1,0) FROM `T3`; +C1 SUBSTRING(`C1`,1,0) + +é¾” +龔龖 +龔龖龗 +龔龖龗龞 +龔龖龗龞龡 +SELECT `C1`, SUBSTRING(`C1`,1,1) FROM `T3`; +C1 SUBSTRING(`C1`,1,1) + +é¾” é¾” +龔龖 é¾” +龔龖龗 é¾” +龔龖龗龞 é¾” +龔龖龗龞龡 é¾” +SELECT `C1`, SUBSTRING(`C1`,1,2) FROM `T3`; +C1 SUBSTRING(`C1`,1,2) + +é¾” é¾” +龔龖 龔龖 +龔龖龗 龔龖 +龔龖龗龞 龔龖 +龔龖龗龞龡 龔龖 +SELECT `C1`, SUBSTRING(`C1`,1,3) FROM `T3`; +C1 SUBSTRING(`C1`,1,3) + +é¾” é¾” +龔龖 龔龖 +龔龖龗 龔龖龗 +龔龖龗龞 龔龖龗 +龔龖龗龞龡 龔龖龗 +SELECT `C1`, SUBSTRING(`C1`,1,4) FROM `T3`; +C1 SUBSTRING(`C1`,1,4) + +é¾” é¾” +龔龖 龔龖 +龔龖龗 龔龖龗 +龔龖龗龞 龔龖龗龞 +龔龖龗龞龡 龔龖龗龞 +SELECT `C1`, SUBSTRING(`C1`,1,5) FROM `T3`; +C1 SUBSTRING(`C1`,1,5) + +é¾” é¾” +龔龖 龔龖 +龔龖龗 龔龖龗 +龔龖龗龞 龔龖龗龞 +龔龖龗龞龡 龔龖龗龞龡 +SELECT `C1`, SUBSTRING(`C1`,1,6) FROM `T3`; +C1 SUBSTRING(`C1`,1,6) + +é¾” é¾” +龔龖 龔龖 +龔龖龗 龔龖龗 +龔龖龗龞 龔龖龗龞 +龔龖龗龞龡 龔龖龗龞龡 +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 0) FROM `T3`; +C1 SUBSTRING(`C1` FROM 1 FOR 0) + +é¾” +龔龖 +龔龖龗 +龔龖龗龞 +龔龖龗龞龡 +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 1) FROM `T3`; +C1 SUBSTRING(`C1` FROM 1 FOR 1) + +é¾” é¾” +龔龖 é¾” +龔龖龗 é¾” +龔龖龗龞 é¾” +龔龖龗龞龡 é¾” +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 2) FROM `T3`; +C1 SUBSTRING(`C1` FROM 1 FOR 2) + +é¾” é¾” +龔龖 龔龖 +龔龖龗 龔龖 +龔龖龗龞 龔龖 +龔龖龗龞龡 龔龖 +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 3) FROM `T3`; +C1 SUBSTRING(`C1` FROM 1 FOR 3) + +é¾” é¾” +龔龖 龔龖 +龔龖龗 龔龖龗 +龔龖龗龞 龔龖龗 +龔龖龗龞龡 龔龖龗 +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 4) FROM `T3`; +C1 SUBSTRING(`C1` FROM 1 FOR 4) + +é¾” é¾” +龔龖 龔龖 +龔龖龗 龔龖龗 +龔龖龗龞 龔龖龗龞 +龔龖龗龞龡 龔龖龗龞 +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 5) FROM `T3`; +C1 SUBSTRING(`C1` FROM 1 FOR 5) + +é¾” é¾” +龔龖 龔龖 +龔龖龗 龔龖龗 +龔龖龗龞 龔龖龗龞 +龔龖龗龞龡 龔龖龗龞龡 +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 6) FROM `T3`; +C1 SUBSTRING(`C1` FROM 1 FOR 6) + +é¾” é¾” +龔龖 龔龖 +龔龖龗 龔龖龗 +龔龖龗龞 龔龖龗龞 +龔龖龗龞龡 龔龖龗龞龡 +SELECT `C1`, SUBSTRING(`C1`,0) FROM `ï¼´ï¼”`; +C1 SUBSTRING(`C1`,0) + +ï½± +アイ +アイウ +アイウエ +アイウエオ +SELECT `C1`, SUBSTRING(`C1`,1) FROM `ï¼´ï¼”`; +C1 SUBSTRING(`C1`,1) + +ï½± ï½± +アイ アイ +アイウ アイウ +アイウエ アイウエ +アイウエオ アイウエオ +SELECT `C1`, SUBSTRING(`C1`,2) FROM `ï¼´ï¼”`; +C1 SUBSTRING(`C1`,2) + +ï½± +アイ ï½² +アイウ イウ +アイウエ イウエ +アイウエオ イウエオ +SELECT `C1`, SUBSTRING(`C1`,3) FROM `ï¼´ï¼”`; +C1 SUBSTRING(`C1`,3) + +ï½± +アイ +アイウ ï½³ +アイウエ ウエ +アイウエオ ウエオ +SELECT `C1`, SUBSTRING(`C1`,4) FROM `ï¼´ï¼”`; +C1 SUBSTRING(`C1`,4) + +ï½± +アイ +アイウ +アイウエ ï½´ +アイウエオ ï½´ï½µ +SELECT `C1`, SUBSTRING(`C1`,5) FROM `ï¼´ï¼”`; +C1 SUBSTRING(`C1`,5) + +ï½± +アイ +アイウ +アイウエ +アイウエオ ï½µ +SELECT `C1`, SUBSTRING(`C1`,6) FROM `ï¼´ï¼”`; +C1 SUBSTRING(`C1`,6) + +ï½± +アイ +アイウ +アイウエ +アイウエオ +SELECT `C1`, SUBSTRING(`C1` FROM 0) FROM `ï¼´ï¼”`; +C1 SUBSTRING(`C1` FROM 0) + +ï½± +アイ +アイウ +アイウエ +アイウエオ +SELECT `C1`, SUBSTRING(`C1` FROM 1) FROM `ï¼´ï¼”`; +C1 SUBSTRING(`C1` FROM 1) + +ï½± ï½± +アイ アイ +アイウ アイウ +アイウエ アイウエ +アイウエオ アイウエオ +SELECT `C1`, SUBSTRING(`C1` FROM 2) FROM `ï¼´ï¼”`; +C1 SUBSTRING(`C1` FROM 2) + +ï½± +アイ ï½² +アイウ イウ +アイウエ イウエ +アイウエオ イウエオ +SELECT `C1`, SUBSTRING(`C1` FROM 3) FROM `ï¼´ï¼”`; +C1 SUBSTRING(`C1` FROM 3) + +ï½± +アイ +アイウ ï½³ +アイウエ ウエ +アイウエオ ウエオ +SELECT `C1`, SUBSTRING(`C1` FROM 4) FROM `ï¼´ï¼”`; +C1 SUBSTRING(`C1` FROM 4) + +ï½± +アイ +アイウ +アイウエ ï½´ +アイウエオ ï½´ï½µ +SELECT `C1`, SUBSTRING(`C1` FROM 5) FROM `ï¼´ï¼”`; +C1 SUBSTRING(`C1` FROM 5) + +ï½± +アイ +アイウ +アイウエ +アイウエオ ï½µ +SELECT `C1`, SUBSTRING(`C1` FROM 6) FROM `ï¼´ï¼”`; +C1 SUBSTRING(`C1` FROM 6) + +ï½± +アイ +アイウ +アイウエ +アイウエオ +SELECT `C1`, SUBSTRING(`C1`,1,0) FROM `ï¼´ï¼”`; +C1 SUBSTRING(`C1`,1,0) + +ï½± +アイ +アイウ +アイウエ +アイウエオ +SELECT `C1`, SUBSTRING(`C1`,1,1) FROM `ï¼´ï¼”`; +C1 SUBSTRING(`C1`,1,1) + +ï½± ï½± +アイ ï½± +アイウ ï½± +アイウエ ï½± +アイウエオ ï½± +SELECT `C1`, SUBSTRING(`C1`,1,2) FROM `ï¼´ï¼”`; +C1 SUBSTRING(`C1`,1,2) + +ï½± ï½± +アイ アイ +アイウ アイ +アイウエ アイ +アイウエオ アイ +SELECT `C1`, SUBSTRING(`C1`,1,3) FROM `ï¼´ï¼”`; +C1 SUBSTRING(`C1`,1,3) + +ï½± ï½± +アイ アイ +アイウ アイウ +アイウエ アイウ +アイウエオ アイウ +SELECT `C1`, SUBSTRING(`C1`,1,4) FROM `ï¼´ï¼”`; +C1 SUBSTRING(`C1`,1,4) + +ï½± ï½± +アイ アイ +アイウ アイウ +アイウエ アイウエ +アイウエオ アイウエ +SELECT `C1`, SUBSTRING(`C1`,1,5) FROM `ï¼´ï¼”`; +C1 SUBSTRING(`C1`,1,5) + +ï½± ï½± +アイ アイ +アイウ アイウ +アイウエ アイウエ +アイウエオ アイウエオ +SELECT `C1`, SUBSTRING(`C1`,1,6) FROM `ï¼´ï¼”`; +C1 SUBSTRING(`C1`,1,6) + +ï½± ï½± +アイ アイ +アイウ アイウ +アイウエ アイウエ +アイウエオ アイウエオ +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 0) FROM `ï¼´ï¼”`; +C1 SUBSTRING(`C1` FROM 1 FOR 0) + +ï½± +アイ +アイウ +アイウエ +アイウエオ +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 1) FROM `ï¼´ï¼”`; +C1 SUBSTRING(`C1` FROM 1 FOR 1) + +ï½± ï½± +アイ ï½± +アイウ ï½± +アイウエ ï½± +アイウエオ ï½± +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 2) FROM `ï¼´ï¼”`; +C1 SUBSTRING(`C1` FROM 1 FOR 2) + +ï½± ï½± +アイ アイ +アイウ アイ +アイウエ アイ +アイウエオ アイ +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 3) FROM `ï¼´ï¼”`; +C1 SUBSTRING(`C1` FROM 1 FOR 3) + +ï½± ï½± +アイ アイ +アイウ アイウ +アイウエ アイウ +アイウエオ アイウ +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 4) FROM `ï¼´ï¼”`; +C1 SUBSTRING(`C1` FROM 1 FOR 4) + +ï½± ï½± +アイ アイ +アイウ アイウ +アイウエ アイウエ +アイウエオ アイウエ +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 5) FROM `ï¼´ï¼”`; +C1 SUBSTRING(`C1` FROM 1 FOR 5) + +ï½± ï½± +アイ アイ +アイウ アイウ +アイウエ アイウエ +アイウエオ アイウエオ +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 6) FROM `ï¼´ï¼”`; +C1 SUBSTRING(`C1` FROM 1 FOR 6) + +ï½± ï½± +アイ アイ +アイウ アイウ +アイウエ アイウエ +アイウエオ アイウエオ +SELECT `C1`, SUBSTRING(`C1`,0) FROM `T5`; +C1 SUBSTRING(`C1`,0) + +ã‚ +ã‚ã„ +ã‚ã„ㆠ+ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ +SELECT `C1`, SUBSTRING(`C1`,1) FROM `T5`; +C1 SUBSTRING(`C1`,1) + +ã‚ ã‚ +ã‚ã„ ã‚ã„ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +SELECT `C1`, SUBSTRING(`C1`,2) FROM `T5`; +C1 SUBSTRING(`C1`,2) + +ã‚ +ã‚ã„ ã„ +ã‚ã„ㆠã„ㆠ+ã‚ã„ã†ãˆ ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ ã„ã†ãˆãŠ +SELECT `C1`, SUBSTRING(`C1`,3) FROM `T5`; +C1 SUBSTRING(`C1`,3) + +ã‚ +ã‚ã„ +ã‚ã„ㆠㆠ+ã‚ã„ã†ãˆ ã†ãˆ +ã‚ã„ã†ãˆãŠ ã†ãˆãŠ +SELECT `C1`, SUBSTRING(`C1`,4) FROM `T5`; +C1 SUBSTRING(`C1`,4) + +ã‚ +ã‚ã„ +ã‚ã„ㆠ+ã‚ã„ã†ãˆ ㈠+ã‚ã„ã†ãˆãŠ ãˆãŠ +SELECT `C1`, SUBSTRING(`C1`,5) FROM `T5`; +C1 SUBSTRING(`C1`,5) + +ã‚ +ã‚ã„ +ã‚ã„ㆠ+ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ ãŠ +SELECT `C1`, SUBSTRING(`C1`,6) FROM `T5`; +C1 SUBSTRING(`C1`,6) + +ã‚ +ã‚ã„ +ã‚ã„ㆠ+ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ +SELECT `C1`, SUBSTRING(`C1` FROM 0) FROM `T5`; +C1 SUBSTRING(`C1` FROM 0) + +ã‚ +ã‚ã„ +ã‚ã„ㆠ+ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ +SELECT `C1`, SUBSTRING(`C1` FROM 1) FROM `T5`; +C1 SUBSTRING(`C1` FROM 1) + +ã‚ ã‚ +ã‚ã„ ã‚ã„ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +SELECT `C1`, SUBSTRING(`C1` FROM 2) FROM `T5`; +C1 SUBSTRING(`C1` FROM 2) + +ã‚ +ã‚ã„ ã„ +ã‚ã„ㆠã„ㆠ+ã‚ã„ã†ãˆ ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ ã„ã†ãˆãŠ +SELECT `C1`, SUBSTRING(`C1` FROM 3) FROM `T5`; +C1 SUBSTRING(`C1` FROM 3) + +ã‚ +ã‚ã„ +ã‚ã„ㆠㆠ+ã‚ã„ã†ãˆ ã†ãˆ +ã‚ã„ã†ãˆãŠ ã†ãˆãŠ +SELECT `C1`, SUBSTRING(`C1` FROM 4) FROM `T5`; +C1 SUBSTRING(`C1` FROM 4) + +ã‚ +ã‚ã„ +ã‚ã„ㆠ+ã‚ã„ã†ãˆ ㈠+ã‚ã„ã†ãˆãŠ ãˆãŠ +SELECT `C1`, SUBSTRING(`C1` FROM 5) FROM `T5`; +C1 SUBSTRING(`C1` FROM 5) + +ã‚ +ã‚ã„ +ã‚ã„ㆠ+ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ ãŠ +SELECT `C1`, SUBSTRING(`C1` FROM 6) FROM `T5`; +C1 SUBSTRING(`C1` FROM 6) + +ã‚ +ã‚ã„ +ã‚ã„ㆠ+ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ +SELECT `C1`, SUBSTRING(`C1`,1,0) FROM `T5`; +C1 SUBSTRING(`C1`,1,0) + +ã‚ +ã‚ã„ +ã‚ã„ㆠ+ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ +SELECT `C1`, SUBSTRING(`C1`,1,1) FROM `T5`; +C1 SUBSTRING(`C1`,1,1) + +ã‚ ã‚ +ã‚ã„ ã‚ +ã‚ã„ㆠ゠+ã‚ã„ã†ãˆ ã‚ +ã‚ã„ã†ãˆãŠ ã‚ +SELECT `C1`, SUBSTRING(`C1`,1,2) FROM `T5`; +C1 SUBSTRING(`C1`,1,2) + +ã‚ ã‚ +ã‚ã„ ã‚ã„ +ã‚ã„ㆠã‚ã„ +ã‚ã„ã†ãˆ ã‚ã„ +ã‚ã„ã†ãˆãŠ ã‚ã„ +SELECT `C1`, SUBSTRING(`C1`,1,3) FROM `T5`; +C1 SUBSTRING(`C1`,1,3) + +ã‚ ã‚ +ã‚ã„ ã‚ã„ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ã†ãˆ ã‚ã„ㆠ+ã‚ã„ã†ãˆãŠ ã‚ã„ㆠ+SELECT `C1`, SUBSTRING(`C1`,1,4) FROM `T5`; +C1 SUBSTRING(`C1`,1,4) + +ã‚ ã‚ +ã‚ã„ ã‚ã„ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆ +SELECT `C1`, SUBSTRING(`C1`,1,5) FROM `T5`; +C1 SUBSTRING(`C1`,1,5) + +ã‚ ã‚ +ã‚ã„ ã‚ã„ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +SELECT `C1`, SUBSTRING(`C1`,1,6) FROM `T5`; +C1 SUBSTRING(`C1`,1,6) + +ã‚ ã‚ +ã‚ã„ ã‚ã„ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 0) FROM `T5`; +C1 SUBSTRING(`C1` FROM 1 FOR 0) + +ã‚ +ã‚ã„ +ã‚ã„ㆠ+ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 1) FROM `T5`; +C1 SUBSTRING(`C1` FROM 1 FOR 1) + +ã‚ ã‚ +ã‚ã„ ã‚ +ã‚ã„ㆠ゠+ã‚ã„ã†ãˆ ã‚ +ã‚ã„ã†ãˆãŠ ã‚ +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 2) FROM `T5`; +C1 SUBSTRING(`C1` FROM 1 FOR 2) + +ã‚ ã‚ +ã‚ã„ ã‚ã„ +ã‚ã„ㆠã‚ã„ +ã‚ã„ã†ãˆ ã‚ã„ +ã‚ã„ã†ãˆãŠ ã‚ã„ +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 3) FROM `T5`; +C1 SUBSTRING(`C1` FROM 1 FOR 3) + +ã‚ ã‚ +ã‚ã„ ã‚ã„ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ã†ãˆ ã‚ã„ㆠ+ã‚ã„ã†ãˆãŠ ã‚ã„ㆠ+SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 4) FROM `T5`; +C1 SUBSTRING(`C1` FROM 1 FOR 4) + +ã‚ ã‚ +ã‚ã„ ã‚ã„ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆ +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 5) FROM `T5`; +C1 SUBSTRING(`C1` FROM 1 FOR 5) + +ã‚ ã‚ +ã‚ã„ ã‚ã„ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 6) FROM `T5`; +C1 SUBSTRING(`C1` FROM 1 FOR 6) + +ã‚ ã‚ +ã‚ã„ ã‚ã„ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +SELECT `C1`, SUBSTRING(`C1`,0) FROM `ï¼´ï¼–`; +C1 SUBSTRING(`C1`,0) + +é¾” +龔龖 +龔龖龗 +龔龖龗龞 +龔龖龗龞龡 +SELECT `C1`, SUBSTRING(`C1`,1) FROM `ï¼´ï¼–`; +C1 SUBSTRING(`C1`,1) + +é¾” é¾” +龔龖 龔龖 +龔龖龗 龔龖龗 +龔龖龗龞 龔龖龗龞 +龔龖龗龞龡 龔龖龗龞龡 +SELECT `C1`, SUBSTRING(`C1`,2) FROM `ï¼´ï¼–`; +C1 SUBSTRING(`C1`,2) + +é¾” +龔龖 é¾– +龔龖龗 é¾–é¾— +龔龖龗龞 龖龗龞 +龔龖龗龞龡 龖龗龞龡 +SELECT `C1`, SUBSTRING(`C1`,3) FROM `ï¼´ï¼–`; +C1 SUBSTRING(`C1`,3) + +é¾” +龔龖 +龔龖龗 é¾— +龔龖龗龞 龗龞 +龔龖龗龞龡 龗龞龡 +SELECT `C1`, SUBSTRING(`C1`,4) FROM `ï¼´ï¼–`; +C1 SUBSTRING(`C1`,4) + +é¾” +龔龖 +龔龖龗 +龔龖龗龞 龞 +龔龖龗龞龡 龞龡 +SELECT `C1`, SUBSTRING(`C1`,5) FROM `ï¼´ï¼–`; +C1 SUBSTRING(`C1`,5) + +é¾” +龔龖 +龔龖龗 +龔龖龗龞 +龔龖龗龞龡 龡 +SELECT `C1`, SUBSTRING(`C1`,6) FROM `ï¼´ï¼–`; +C1 SUBSTRING(`C1`,6) + +é¾” +龔龖 +龔龖龗 +龔龖龗龞 +龔龖龗龞龡 +SELECT `C1`, SUBSTRING(`C1` FROM 0) FROM `ï¼´ï¼–`; +C1 SUBSTRING(`C1` FROM 0) + +é¾” +龔龖 +龔龖龗 +龔龖龗龞 +龔龖龗龞龡 +SELECT `C1`, SUBSTRING(`C1` FROM 1) FROM `ï¼´ï¼–`; +C1 SUBSTRING(`C1` FROM 1) + +é¾” é¾” +龔龖 龔龖 +龔龖龗 龔龖龗 +龔龖龗龞 龔龖龗龞 +龔龖龗龞龡 龔龖龗龞龡 +SELECT `C1`, SUBSTRING(`C1` FROM 2) FROM `ï¼´ï¼–`; +C1 SUBSTRING(`C1` FROM 2) + +é¾” +龔龖 é¾– +龔龖龗 é¾–é¾— +龔龖龗龞 龖龗龞 +龔龖龗龞龡 龖龗龞龡 +SELECT `C1`, SUBSTRING(`C1` FROM 3) FROM `ï¼´ï¼–`; +C1 SUBSTRING(`C1` FROM 3) + +é¾” +龔龖 +龔龖龗 é¾— +龔龖龗龞 龗龞 +龔龖龗龞龡 龗龞龡 +SELECT `C1`, SUBSTRING(`C1` FROM 4) FROM `ï¼´ï¼–`; +C1 SUBSTRING(`C1` FROM 4) + +é¾” +龔龖 +龔龖龗 +龔龖龗龞 龞 +龔龖龗龞龡 龞龡 +SELECT `C1`, SUBSTRING(`C1` FROM 5) FROM `ï¼´ï¼–`; +C1 SUBSTRING(`C1` FROM 5) + +é¾” +龔龖 +龔龖龗 +龔龖龗龞 +龔龖龗龞龡 龡 +SELECT `C1`, SUBSTRING(`C1` FROM 6) FROM `ï¼´ï¼–`; +C1 SUBSTRING(`C1` FROM 6) + +é¾” +龔龖 +龔龖龗 +龔龖龗龞 +龔龖龗龞龡 +SELECT `C1`, SUBSTRING(`C1`,1,0) FROM `ï¼´ï¼–`; +C1 SUBSTRING(`C1`,1,0) + +é¾” +龔龖 +龔龖龗 +龔龖龗龞 +龔龖龗龞龡 +SELECT `C1`, SUBSTRING(`C1`,1,1) FROM `ï¼´ï¼–`; +C1 SUBSTRING(`C1`,1,1) + +é¾” é¾” +龔龖 é¾” +龔龖龗 é¾” +龔龖龗龞 é¾” +龔龖龗龞龡 é¾” +SELECT `C1`, SUBSTRING(`C1`,1,2) FROM `ï¼´ï¼–`; +C1 SUBSTRING(`C1`,1,2) + +é¾” é¾” +龔龖 龔龖 +龔龖龗 龔龖 +龔龖龗龞 龔龖 +龔龖龗龞龡 龔龖 +SELECT `C1`, SUBSTRING(`C1`,1,3) FROM `ï¼´ï¼–`; +C1 SUBSTRING(`C1`,1,3) + +é¾” é¾” +龔龖 龔龖 +龔龖龗 龔龖龗 +龔龖龗龞 龔龖龗 +龔龖龗龞龡 龔龖龗 +SELECT `C1`, SUBSTRING(`C1`,1,4) FROM `ï¼´ï¼–`; +C1 SUBSTRING(`C1`,1,4) + +é¾” é¾” +龔龖 龔龖 +龔龖龗 龔龖龗 +龔龖龗龞 龔龖龗龞 +龔龖龗龞龡 龔龖龗龞 +SELECT `C1`, SUBSTRING(`C1`,1,5) FROM `ï¼´ï¼–`; +C1 SUBSTRING(`C1`,1,5) + +é¾” é¾” +龔龖 龔龖 +龔龖龗 龔龖龗 +龔龖龗龞 龔龖龗龞 +龔龖龗龞龡 龔龖龗龞龡 +SELECT `C1`, SUBSTRING(`C1`,1,6) FROM `ï¼´ï¼–`; +C1 SUBSTRING(`C1`,1,6) + +é¾” é¾” +龔龖 龔龖 +龔龖龗 龔龖龗 +龔龖龗龞 龔龖龗龞 +龔龖龗龞龡 龔龖龗龞龡 +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 0) FROM `ï¼´ï¼–`; +C1 SUBSTRING(`C1` FROM 1 FOR 0) + +é¾” +龔龖 +龔龖龗 +龔龖龗龞 +龔龖龗龞龡 +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 1) FROM `ï¼´ï¼–`; +C1 SUBSTRING(`C1` FROM 1 FOR 1) + +é¾” é¾” +龔龖 é¾” +龔龖龗 é¾” +龔龖龗龞 é¾” +龔龖龗龞龡 é¾” +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 2) FROM `ï¼´ï¼–`; +C1 SUBSTRING(`C1` FROM 1 FOR 2) + +é¾” é¾” +龔龖 龔龖 +龔龖龗 龔龖 +龔龖龗龞 龔龖 +龔龖龗龞龡 龔龖 +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 3) FROM `ï¼´ï¼–`; +C1 SUBSTRING(`C1` FROM 1 FOR 3) + +é¾” é¾” +龔龖 龔龖 +龔龖龗 龔龖龗 +龔龖龗龞 龔龖龗 +龔龖龗龞龡 龔龖龗 +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 4) FROM `ï¼´ï¼–`; +C1 SUBSTRING(`C1` FROM 1 FOR 4) + +é¾” é¾” +龔龖 龔龖 +龔龖龗 龔龖龗 +龔龖龗龞 龔龖龗龞 +龔龖龗龞龡 龔龖龗龞 +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 5) FROM `ï¼´ï¼–`; +C1 SUBSTRING(`C1` FROM 1 FOR 5) + +é¾” é¾” +龔龖 龔龖 +龔龖龗 龔龖龗 +龔龖龗龞 龔龖龗龞 +龔龖龗龞龡 龔龖龗龞龡 +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 6) FROM `ï¼´ï¼–`; +C1 SUBSTRING(`C1` FROM 1 FOR 6) + +é¾” é¾” +龔龖 龔龖 +龔龖龗 龔龖龗 +龔龖龗龞 龔龖龗龞 +龔龖龗龞龡 龔龖龗龞龡 +SELECT `C1`, SUBSTRING(`C1`,0) FROM `ï¼´ï¼—`; +C1 SUBSTRING(`C1`,0) +アイウエオ +アイウエ +アイウ +アイ +ï½± + +SELECT `C1`, SUBSTRING(`C1`,1) FROM `ï¼´ï¼—`; +C1 SUBSTRING(`C1`,1) +アイウエオ アイウエオ +アイウエ アイウエ +アイウ アイウ +アイ アイ +ï½± ï½± + +SELECT `C1`, SUBSTRING(`C1`,2) FROM `ï¼´ï¼—`; +C1 SUBSTRING(`C1`,2) +アイウエオ イウエオ +アイウエ イウエ +アイウ イウ +アイ ï½² +ï½± + +SELECT `C1`, SUBSTRING(`C1`,3) FROM `ï¼´ï¼—`; +C1 SUBSTRING(`C1`,3) +アイウエオ ウエオ +アイウエ ウエ +アイウ ï½³ +アイ +ï½± + +SELECT `C1`, SUBSTRING(`C1`,4) FROM `ï¼´ï¼—`; +C1 SUBSTRING(`C1`,4) +アイウエオ ï½´ï½µ +アイウエ ï½´ +アイウ +アイ +ï½± + +SELECT `C1`, SUBSTRING(`C1`,5) FROM `ï¼´ï¼—`; +C1 SUBSTRING(`C1`,5) +アイウエオ ï½µ +アイウエ +アイウ +アイ +ï½± + +SELECT `C1`, SUBSTRING(`C1`,6) FROM `ï¼´ï¼—`; +C1 SUBSTRING(`C1`,6) +アイウエオ +アイウエ +アイウ +アイ +ï½± + +SELECT `C1`, SUBSTRING(`C1` FROM 0) FROM `ï¼´ï¼—`; +C1 SUBSTRING(`C1` FROM 0) +アイウエオ +アイウエ +アイウ +アイ +ï½± + +SELECT `C1`, SUBSTRING(`C1` FROM 1) FROM `ï¼´ï¼—`; +C1 SUBSTRING(`C1` FROM 1) +アイウエオ アイウエオ +アイウエ アイウエ +アイウ アイウ +アイ アイ +ï½± ï½± + +SELECT `C1`, SUBSTRING(`C1` FROM 2) FROM `ï¼´ï¼—`; +C1 SUBSTRING(`C1` FROM 2) +アイウエオ イウエオ +アイウエ イウエ +アイウ イウ +アイ ï½² +ï½± + +SELECT `C1`, SUBSTRING(`C1` FROM 3) FROM `ï¼´ï¼—`; +C1 SUBSTRING(`C1` FROM 3) +アイウエオ ウエオ +アイウエ ウエ +アイウ ï½³ +アイ +ï½± + +SELECT `C1`, SUBSTRING(`C1` FROM 4) FROM `ï¼´ï¼—`; +C1 SUBSTRING(`C1` FROM 4) +アイウエオ ï½´ï½µ +アイウエ ï½´ +アイウ +アイ +ï½± + +SELECT `C1`, SUBSTRING(`C1` FROM 5) FROM `ï¼´ï¼—`; +C1 SUBSTRING(`C1` FROM 5) +アイウエオ ï½µ +アイウエ +アイウ +アイ +ï½± + +SELECT `C1`, SUBSTRING(`C1` FROM 6) FROM `ï¼´ï¼—`; +C1 SUBSTRING(`C1` FROM 6) +アイウエオ +アイウエ +アイウ +アイ +ï½± + +SELECT `C1`, SUBSTRING(`C1`,1,0) FROM `ï¼´ï¼—`; +C1 SUBSTRING(`C1`,1,0) +アイウエオ +アイウエ +アイウ +アイ +ï½± + +SELECT `C1`, SUBSTRING(`C1`,1,1) FROM `ï¼´ï¼—`; +C1 SUBSTRING(`C1`,1,1) +アイウエオ ï½± +アイウエ ï½± +アイウ ï½± +アイ ï½± +ï½± ï½± + +SELECT `C1`, SUBSTRING(`C1`,1,2) FROM `ï¼´ï¼—`; +C1 SUBSTRING(`C1`,1,2) +アイウエオ アイ +アイウエ アイ +アイウ アイ +アイ アイ +ï½± ï½± + +SELECT `C1`, SUBSTRING(`C1`,1,3) FROM `ï¼´ï¼—`; +C1 SUBSTRING(`C1`,1,3) +アイウエオ アイウ +アイウエ アイウ +アイウ アイウ +アイ アイ +ï½± ï½± + +SELECT `C1`, SUBSTRING(`C1`,1,4) FROM `ï¼´ï¼—`; +C1 SUBSTRING(`C1`,1,4) +アイウエオ アイウエ +アイウエ アイウエ +アイウ アイウ +アイ アイ +ï½± ï½± + +SELECT `C1`, SUBSTRING(`C1`,1,5) FROM `ï¼´ï¼—`; +C1 SUBSTRING(`C1`,1,5) +アイウエオ アイウエオ +アイウエ アイウエ +アイウ アイウ +アイ アイ +ï½± ï½± + +SELECT `C1`, SUBSTRING(`C1`,1,6) FROM `ï¼´ï¼—`; +C1 SUBSTRING(`C1`,1,6) +アイウエオ アイウエオ +アイウエ アイウエ +アイウ アイウ +アイ アイ +ï½± ï½± + +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 0) FROM `ï¼´ï¼—`; +C1 SUBSTRING(`C1` FROM 1 FOR 0) +アイウエオ +アイウエ +アイウ +アイ +ï½± + +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 1) FROM `ï¼´ï¼—`; +C1 SUBSTRING(`C1` FROM 1 FOR 1) +アイウエオ ï½± +アイウエ ï½± +アイウ ï½± +アイ ï½± +ï½± ï½± + +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 2) FROM `ï¼´ï¼—`; +C1 SUBSTRING(`C1` FROM 1 FOR 2) +アイウエオ アイ +アイウエ アイ +アイウ アイ +アイ アイ +ï½± ï½± + +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 3) FROM `ï¼´ï¼—`; +C1 SUBSTRING(`C1` FROM 1 FOR 3) +アイウエオ アイウ +アイウエ アイウ +アイウ アイウ +アイ アイ +ï½± ï½± + +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 4) FROM `ï¼´ï¼—`; +C1 SUBSTRING(`C1` FROM 1 FOR 4) +アイウエオ アイウエ +アイウエ アイウエ +アイウ アイウ +アイ アイ +ï½± ï½± + +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 5) FROM `ï¼´ï¼—`; +C1 SUBSTRING(`C1` FROM 1 FOR 5) +アイウエオ アイウエオ +アイウエ アイウエ +アイウ アイウ +アイ アイ +ï½± ï½± + +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 6) FROM `ï¼´ï¼—`; +C1 SUBSTRING(`C1` FROM 1 FOR 6) +アイウエオ アイウエオ +アイウエ アイウエ +アイウ アイウ +アイ アイ +ï½± ï½± + +SELECT `C1`, SUBSTRING(`C1`,0) FROM `T8`; +C1 SUBSTRING(`C1`,0) +ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆ +ã‚ã„ㆠ+ã‚ã„ +ã‚ + +SELECT `C1`, SUBSTRING(`C1`,1) FROM `T8`; +C1 SUBSTRING(`C1`,1) +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ ã‚ã„ +ã‚ ã‚ + +SELECT `C1`, SUBSTRING(`C1`,2) FROM `T8`; +C1 SUBSTRING(`C1`,2) +ã‚ã„ã†ãˆãŠ ã„ã†ãˆãŠ +ã‚ã„ã†ãˆ ã„ã†ãˆ +ã‚ã„ㆠã„ㆠ+ã‚ã„ ã„ +ã‚ + +SELECT `C1`, SUBSTRING(`C1`,3) FROM `T8`; +C1 SUBSTRING(`C1`,3) +ã‚ã„ã†ãˆãŠ ã†ãˆãŠ +ã‚ã„ã†ãˆ ã†ãˆ +ã‚ã„ㆠㆠ+ã‚ã„ +ã‚ + +SELECT `C1`, SUBSTRING(`C1`,4) FROM `T8`; +C1 SUBSTRING(`C1`,4) +ã‚ã„ã†ãˆãŠ ãˆãŠ +ã‚ã„ã†ãˆ ㈠+ã‚ã„ㆠ+ã‚ã„ +ã‚ + +SELECT `C1`, SUBSTRING(`C1`,5) FROM `T8`; +C1 SUBSTRING(`C1`,5) +ã‚ã„ã†ãˆãŠ ãŠ +ã‚ã„ã†ãˆ +ã‚ã„ㆠ+ã‚ã„ +ã‚ + +SELECT `C1`, SUBSTRING(`C1`,6) FROM `T8`; +C1 SUBSTRING(`C1`,6) +ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆ +ã‚ã„ㆠ+ã‚ã„ +ã‚ + +SELECT `C1`, SUBSTRING(`C1` FROM 0) FROM `T8`; +C1 SUBSTRING(`C1` FROM 0) +ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆ +ã‚ã„ㆠ+ã‚ã„ +ã‚ + +SELECT `C1`, SUBSTRING(`C1` FROM 1) FROM `T8`; +C1 SUBSTRING(`C1` FROM 1) +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ ã‚ã„ +ã‚ ã‚ + +SELECT `C1`, SUBSTRING(`C1` FROM 2) FROM `T8`; +C1 SUBSTRING(`C1` FROM 2) +ã‚ã„ã†ãˆãŠ ã„ã†ãˆãŠ +ã‚ã„ã†ãˆ ã„ã†ãˆ +ã‚ã„ㆠã„ㆠ+ã‚ã„ ã„ +ã‚ + +SELECT `C1`, SUBSTRING(`C1` FROM 3) FROM `T8`; +C1 SUBSTRING(`C1` FROM 3) +ã‚ã„ã†ãˆãŠ ã†ãˆãŠ +ã‚ã„ã†ãˆ ã†ãˆ +ã‚ã„ㆠㆠ+ã‚ã„ +ã‚ + +SELECT `C1`, SUBSTRING(`C1` FROM 4) FROM `T8`; +C1 SUBSTRING(`C1` FROM 4) +ã‚ã„ã†ãˆãŠ ãˆãŠ +ã‚ã„ã†ãˆ ㈠+ã‚ã„ㆠ+ã‚ã„ +ã‚ + +SELECT `C1`, SUBSTRING(`C1` FROM 5) FROM `T8`; +C1 SUBSTRING(`C1` FROM 5) +ã‚ã„ã†ãˆãŠ ãŠ +ã‚ã„ã†ãˆ +ã‚ã„ㆠ+ã‚ã„ +ã‚ + +SELECT `C1`, SUBSTRING(`C1` FROM 6) FROM `T8`; +C1 SUBSTRING(`C1` FROM 6) +ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆ +ã‚ã„ㆠ+ã‚ã„ +ã‚ + +SELECT `C1`, SUBSTRING(`C1`,1,0) FROM `T8`; +C1 SUBSTRING(`C1`,1,0) +ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆ +ã‚ã„ㆠ+ã‚ã„ +ã‚ + +SELECT `C1`, SUBSTRING(`C1`,1,1) FROM `T8`; +C1 SUBSTRING(`C1`,1,1) +ã‚ã„ã†ãˆãŠ ã‚ +ã‚ã„ã†ãˆ ã‚ +ã‚ã„ㆠ゠+ã‚ã„ ã‚ +ã‚ ã‚ + +SELECT `C1`, SUBSTRING(`C1`,1,2) FROM `T8`; +C1 SUBSTRING(`C1`,1,2) +ã‚ã„ã†ãˆãŠ ã‚ã„ +ã‚ã„ã†ãˆ ã‚ã„ +ã‚ã„ㆠã‚ã„ +ã‚ã„ ã‚ã„ +ã‚ ã‚ + +SELECT `C1`, SUBSTRING(`C1`,1,3) FROM `T8`; +C1 SUBSTRING(`C1`,1,3) +ã‚ã„ã†ãˆãŠ ã‚ã„ㆠ+ã‚ã„ã†ãˆ ã‚ã„ㆠ+ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ ã‚ã„ +ã‚ ã‚ + +SELECT `C1`, SUBSTRING(`C1`,1,4) FROM `T8`; +C1 SUBSTRING(`C1`,1,4) +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ ã‚ã„ +ã‚ ã‚ + +SELECT `C1`, SUBSTRING(`C1`,1,5) FROM `T8`; +C1 SUBSTRING(`C1`,1,5) +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ ã‚ã„ +ã‚ ã‚ + +SELECT `C1`, SUBSTRING(`C1`,1,6) FROM `T8`; +C1 SUBSTRING(`C1`,1,6) +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ ã‚ã„ +ã‚ ã‚ + +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 0) FROM `T8`; +C1 SUBSTRING(`C1` FROM 1 FOR 0) +ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆ +ã‚ã„ㆠ+ã‚ã„ +ã‚ + +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 1) FROM `T8`; +C1 SUBSTRING(`C1` FROM 1 FOR 1) +ã‚ã„ã†ãˆãŠ ã‚ +ã‚ã„ã†ãˆ ã‚ +ã‚ã„ㆠ゠+ã‚ã„ ã‚ +ã‚ ã‚ + +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 2) FROM `T8`; +C1 SUBSTRING(`C1` FROM 1 FOR 2) +ã‚ã„ã†ãˆãŠ ã‚ã„ +ã‚ã„ã†ãˆ ã‚ã„ +ã‚ã„ㆠã‚ã„ +ã‚ã„ ã‚ã„ +ã‚ ã‚ + +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 3) FROM `T8`; +C1 SUBSTRING(`C1` FROM 1 FOR 3) +ã‚ã„ã†ãˆãŠ ã‚ã„ㆠ+ã‚ã„ã†ãˆ ã‚ã„ㆠ+ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ ã‚ã„ +ã‚ ã‚ + +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 4) FROM `T8`; +C1 SUBSTRING(`C1` FROM 1 FOR 4) +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ ã‚ã„ +ã‚ ã‚ + +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 5) FROM `T8`; +C1 SUBSTRING(`C1` FROM 1 FOR 5) +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ ã‚ã„ +ã‚ ã‚ + +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 6) FROM `T8`; +C1 SUBSTRING(`C1` FROM 1 FOR 6) +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ ã‚ã„ +ã‚ ã‚ + +SELECT `C1`, SUBSTRING(`C1`,0) FROM `ï¼´ï¼™`; +C1 SUBSTRING(`C1`,0) +龔龖龗龞龡 +龔龖龗龞 +龔龖龗 +龔龖 +é¾” + +SELECT `C1`, SUBSTRING(`C1`,1) FROM `ï¼´ï¼™`; +C1 SUBSTRING(`C1`,1) +龔龖龗龞龡 龔龖龗龞龡 +龔龖龗龞 龔龖龗龞 +龔龖龗 龔龖龗 +龔龖 龔龖 +é¾” é¾” + +SELECT `C1`, SUBSTRING(`C1`,2) FROM `ï¼´ï¼™`; +C1 SUBSTRING(`C1`,2) +龔龖龗龞龡 龖龗龞龡 +龔龖龗龞 龖龗龞 +龔龖龗 é¾–é¾— +龔龖 é¾– +é¾” + +SELECT `C1`, SUBSTRING(`C1`,3) FROM `ï¼´ï¼™`; +C1 SUBSTRING(`C1`,3) +龔龖龗龞龡 龗龞龡 +龔龖龗龞 龗龞 +龔龖龗 é¾— +龔龖 +é¾” + +SELECT `C1`, SUBSTRING(`C1`,4) FROM `ï¼´ï¼™`; +C1 SUBSTRING(`C1`,4) +龔龖龗龞龡 龞龡 +龔龖龗龞 龞 +龔龖龗 +龔龖 +é¾” + +SELECT `C1`, SUBSTRING(`C1`,5) FROM `ï¼´ï¼™`; +C1 SUBSTRING(`C1`,5) +龔龖龗龞龡 龡 +龔龖龗龞 +龔龖龗 +龔龖 +é¾” + +SELECT `C1`, SUBSTRING(`C1`,6) FROM `ï¼´ï¼™`; +C1 SUBSTRING(`C1`,6) +龔龖龗龞龡 +龔龖龗龞 +龔龖龗 +龔龖 +é¾” + +SELECT `C1`, SUBSTRING(`C1` FROM 0) FROM `ï¼´ï¼™`; +C1 SUBSTRING(`C1` FROM 0) +龔龖龗龞龡 +龔龖龗龞 +龔龖龗 +龔龖 +é¾” + +SELECT `C1`, SUBSTRING(`C1` FROM 1) FROM `ï¼´ï¼™`; +C1 SUBSTRING(`C1` FROM 1) +龔龖龗龞龡 龔龖龗龞龡 +龔龖龗龞 龔龖龗龞 +龔龖龗 龔龖龗 +龔龖 龔龖 +é¾” é¾” + +SELECT `C1`, SUBSTRING(`C1` FROM 2) FROM `ï¼´ï¼™`; +C1 SUBSTRING(`C1` FROM 2) +龔龖龗龞龡 龖龗龞龡 +龔龖龗龞 龖龗龞 +龔龖龗 é¾–é¾— +龔龖 é¾– +é¾” + +SELECT `C1`, SUBSTRING(`C1` FROM 3) FROM `ï¼´ï¼™`; +C1 SUBSTRING(`C1` FROM 3) +龔龖龗龞龡 龗龞龡 +龔龖龗龞 龗龞 +龔龖龗 é¾— +龔龖 +é¾” + +SELECT `C1`, SUBSTRING(`C1` FROM 4) FROM `ï¼´ï¼™`; +C1 SUBSTRING(`C1` FROM 4) +龔龖龗龞龡 龞龡 +龔龖龗龞 龞 +龔龖龗 +龔龖 +é¾” + +SELECT `C1`, SUBSTRING(`C1` FROM 5) FROM `ï¼´ï¼™`; +C1 SUBSTRING(`C1` FROM 5) +龔龖龗龞龡 龡 +龔龖龗龞 +龔龖龗 +龔龖 +é¾” + +SELECT `C1`, SUBSTRING(`C1` FROM 6) FROM `ï¼´ï¼™`; +C1 SUBSTRING(`C1` FROM 6) +龔龖龗龞龡 +龔龖龗龞 +龔龖龗 +龔龖 +é¾” + +SELECT `C1`, SUBSTRING(`C1`,1,0) FROM `ï¼´ï¼™`; +C1 SUBSTRING(`C1`,1,0) +龔龖龗龞龡 +龔龖龗龞 +龔龖龗 +龔龖 +é¾” + +SELECT `C1`, SUBSTRING(`C1`,1,1) FROM `ï¼´ï¼™`; +C1 SUBSTRING(`C1`,1,1) +龔龖龗龞龡 é¾” +龔龖龗龞 é¾” +龔龖龗 é¾” +龔龖 é¾” +é¾” é¾” + +SELECT `C1`, SUBSTRING(`C1`,1,2) FROM `ï¼´ï¼™`; +C1 SUBSTRING(`C1`,1,2) +龔龖龗龞龡 龔龖 +龔龖龗龞 龔龖 +龔龖龗 龔龖 +龔龖 龔龖 +é¾” é¾” + +SELECT `C1`, SUBSTRING(`C1`,1,3) FROM `ï¼´ï¼™`; +C1 SUBSTRING(`C1`,1,3) +龔龖龗龞龡 龔龖龗 +龔龖龗龞 龔龖龗 +龔龖龗 龔龖龗 +龔龖 龔龖 +é¾” é¾” + +SELECT `C1`, SUBSTRING(`C1`,1,4) FROM `ï¼´ï¼™`; +C1 SUBSTRING(`C1`,1,4) +龔龖龗龞龡 龔龖龗龞 +龔龖龗龞 龔龖龗龞 +龔龖龗 龔龖龗 +龔龖 龔龖 +é¾” é¾” + +SELECT `C1`, SUBSTRING(`C1`,1,5) FROM `ï¼´ï¼™`; +C1 SUBSTRING(`C1`,1,5) +龔龖龗龞龡 龔龖龗龞龡 +龔龖龗龞 龔龖龗龞 +龔龖龗 龔龖龗 +龔龖 龔龖 +é¾” é¾” + +SELECT `C1`, SUBSTRING(`C1`,1,6) FROM `ï¼´ï¼™`; +C1 SUBSTRING(`C1`,1,6) +龔龖龗龞龡 龔龖龗龞龡 +龔龖龗龞 龔龖龗龞 +龔龖龗 龔龖龗 +龔龖 龔龖 +é¾” é¾” + +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 0) FROM `ï¼´ï¼™`; +C1 SUBSTRING(`C1` FROM 1 FOR 0) +龔龖龗龞龡 +龔龖龗龞 +龔龖龗 +龔龖 +é¾” + +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 1) FROM `ï¼´ï¼™`; +C1 SUBSTRING(`C1` FROM 1 FOR 1) +龔龖龗龞龡 é¾” +龔龖龗龞 é¾” +龔龖龗 é¾” +龔龖 é¾” +é¾” é¾” + +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 2) FROM `ï¼´ï¼™`; +C1 SUBSTRING(`C1` FROM 1 FOR 2) +龔龖龗龞龡 龔龖 +龔龖龗龞 龔龖 +龔龖龗 龔龖 +龔龖 龔龖 +é¾” é¾” + +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 3) FROM `ï¼´ï¼™`; +C1 SUBSTRING(`C1` FROM 1 FOR 3) +龔龖龗龞龡 龔龖龗 +龔龖龗龞 龔龖龗 +龔龖龗 龔龖龗 +龔龖 龔龖 +é¾” é¾” + +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 4) FROM `ï¼´ï¼™`; +C1 SUBSTRING(`C1` FROM 1 FOR 4) +龔龖龗龞龡 龔龖龗龞 +龔龖龗龞 龔龖龗龞 +龔龖龗 龔龖龗 +龔龖 龔龖 +é¾” é¾” + +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 5) FROM `ï¼´ï¼™`; +C1 SUBSTRING(`C1` FROM 1 FOR 5) +龔龖龗龞龡 龔龖龗龞龡 +龔龖龗龞 龔龖龗龞 +龔龖龗 龔龖龗 +龔龖 龔龖 +é¾” é¾” + +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 6) FROM `ï¼´ï¼™`; +C1 SUBSTRING(`C1` FROM 1 FOR 6) +龔龖龗龞龡 龔龖龗龞龡 +龔龖龗龞 龔龖龗龞 +龔龖龗 龔龖龗 +龔龖 龔龖 +é¾” é¾” + +SELECT `C1`, SUBSTRING(`C1`,0) FROM `T1ï¼`; +C1 SUBSTRING(`C1`,0) +アイウエオ +アイウエ +アイウ +アイ +ï½± + +SELECT `C1`, SUBSTRING(`C1`,1) FROM `T1ï¼`; +C1 SUBSTRING(`C1`,1) +アイウエオ アイウエオ +アイウエ アイウエ +アイウ アイウ +アイ アイ +ï½± ï½± + +SELECT `C1`, SUBSTRING(`C1`,2) FROM `T1ï¼`; +C1 SUBSTRING(`C1`,2) +アイウエオ イウエオ +アイウエ イウエ +アイウ イウ +アイ ï½² +ï½± + +SELECT `C1`, SUBSTRING(`C1`,3) FROM `T1ï¼`; +C1 SUBSTRING(`C1`,3) +アイウエオ ウエオ +アイウエ ウエ +アイウ ï½³ +アイ +ï½± + +SELECT `C1`, SUBSTRING(`C1`,4) FROM `T1ï¼`; +C1 SUBSTRING(`C1`,4) +アイウエオ ï½´ï½µ +アイウエ ï½´ +アイウ +アイ +ï½± + +SELECT `C1`, SUBSTRING(`C1`,5) FROM `T1ï¼`; +C1 SUBSTRING(`C1`,5) +アイウエオ ï½µ +アイウエ +アイウ +アイ +ï½± + +SELECT `C1`, SUBSTRING(`C1`,6) FROM `T1ï¼`; +C1 SUBSTRING(`C1`,6) +アイウエオ +アイウエ +アイウ +アイ +ï½± + +SELECT `C1`, SUBSTRING(`C1` FROM 0) FROM `T1ï¼`; +C1 SUBSTRING(`C1` FROM 0) +アイウエオ +アイウエ +アイウ +アイ +ï½± + +SELECT `C1`, SUBSTRING(`C1` FROM 1) FROM `T1ï¼`; +C1 SUBSTRING(`C1` FROM 1) +アイウエオ アイウエオ +アイウエ アイウエ +アイウ アイウ +アイ アイ +ï½± ï½± + +SELECT `C1`, SUBSTRING(`C1` FROM 2) FROM `T1ï¼`; +C1 SUBSTRING(`C1` FROM 2) +アイウエオ イウエオ +アイウエ イウエ +アイウ イウ +アイ ï½² +ï½± + +SELECT `C1`, SUBSTRING(`C1` FROM 3) FROM `T1ï¼`; +C1 SUBSTRING(`C1` FROM 3) +アイウエオ ウエオ +アイウエ ウエ +アイウ ï½³ +アイ +ï½± + +SELECT `C1`, SUBSTRING(`C1` FROM 4) FROM `T1ï¼`; +C1 SUBSTRING(`C1` FROM 4) +アイウエオ ï½´ï½µ +アイウエ ï½´ +アイウ +アイ +ï½± + +SELECT `C1`, SUBSTRING(`C1` FROM 5) FROM `T1ï¼`; +C1 SUBSTRING(`C1` FROM 5) +アイウエオ ï½µ +アイウエ +アイウ +アイ +ï½± + +SELECT `C1`, SUBSTRING(`C1` FROM 6) FROM `T1ï¼`; +C1 SUBSTRING(`C1` FROM 6) +アイウエオ +アイウエ +アイウ +アイ +ï½± + +SELECT `C1`, SUBSTRING(`C1`,1,0) FROM `T1ï¼`; +C1 SUBSTRING(`C1`,1,0) +アイウエオ +アイウエ +アイウ +アイ +ï½± + +SELECT `C1`, SUBSTRING(`C1`,1,1) FROM `T1ï¼`; +C1 SUBSTRING(`C1`,1,1) +アイウエオ ï½± +アイウエ ï½± +アイウ ï½± +アイ ï½± +ï½± ï½± + +SELECT `C1`, SUBSTRING(`C1`,1,2) FROM `T1ï¼`; +C1 SUBSTRING(`C1`,1,2) +アイウエオ アイ +アイウエ アイ +アイウ アイ +アイ アイ +ï½± ï½± + +SELECT `C1`, SUBSTRING(`C1`,1,3) FROM `T1ï¼`; +C1 SUBSTRING(`C1`,1,3) +アイウエオ アイウ +アイウエ アイウ +アイウ アイウ +アイ アイ +ï½± ï½± + +SELECT `C1`, SUBSTRING(`C1`,1,4) FROM `T1ï¼`; +C1 SUBSTRING(`C1`,1,4) +アイウエオ アイウエ +アイウエ アイウエ +アイウ アイウ +アイ アイ +ï½± ï½± + +SELECT `C1`, SUBSTRING(`C1`,1,5) FROM `T1ï¼`; +C1 SUBSTRING(`C1`,1,5) +アイウエオ アイウエオ +アイウエ アイウエ +アイウ アイウ +アイ アイ +ï½± ï½± + +SELECT `C1`, SUBSTRING(`C1`,1,6) FROM `T1ï¼`; +C1 SUBSTRING(`C1`,1,6) +アイウエオ アイウエオ +アイウエ アイウエ +アイウ アイウ +アイ アイ +ï½± ï½± + +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 0) FROM `T1ï¼`; +C1 SUBSTRING(`C1` FROM 1 FOR 0) +アイウエオ +アイウエ +アイウ +アイ +ï½± + +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 1) FROM `T1ï¼`; +C1 SUBSTRING(`C1` FROM 1 FOR 1) +アイウエオ ï½± +アイウエ ï½± +アイウ ï½± +アイ ï½± +ï½± ï½± + +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 2) FROM `T1ï¼`; +C1 SUBSTRING(`C1` FROM 1 FOR 2) +アイウエオ アイ +アイウエ アイ +アイウ アイ +アイ アイ +ï½± ï½± + +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 3) FROM `T1ï¼`; +C1 SUBSTRING(`C1` FROM 1 FOR 3) +アイウエオ アイウ +アイウエ アイウ +アイウ アイウ +アイ アイ +ï½± ï½± + +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 4) FROM `T1ï¼`; +C1 SUBSTRING(`C1` FROM 1 FOR 4) +アイウエオ アイウエ +アイウエ アイウエ +アイウ アイウ +アイ アイ +ï½± ï½± + +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 5) FROM `T1ï¼`; +C1 SUBSTRING(`C1` FROM 1 FOR 5) +アイウエオ アイウエオ +アイウエ アイウエ +アイウ アイウ +アイ アイ +ï½± ï½± + +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 6) FROM `T1ï¼`; +C1 SUBSTRING(`C1` FROM 1 FOR 6) +アイウエオ アイウエオ +アイウエ アイウエ +アイウ アイウ +アイ アイ +ï½± ï½± + +SELECT `C1`, SUBSTRING(`C1`,0) FROM `T11`; +C1 SUBSTRING(`C1`,0) +ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆ +ã‚ã„ㆠ+ã‚ã„ +ã‚ + +SELECT `C1`, SUBSTRING(`C1`,1) FROM `T11`; +C1 SUBSTRING(`C1`,1) +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ ã‚ã„ +ã‚ ã‚ + +SELECT `C1`, SUBSTRING(`C1`,2) FROM `T11`; +C1 SUBSTRING(`C1`,2) +ã‚ã„ã†ãˆãŠ ã„ã†ãˆãŠ +ã‚ã„ã†ãˆ ã„ã†ãˆ +ã‚ã„ㆠã„ㆠ+ã‚ã„ ã„ +ã‚ + +SELECT `C1`, SUBSTRING(`C1`,3) FROM `T11`; +C1 SUBSTRING(`C1`,3) +ã‚ã„ã†ãˆãŠ ã†ãˆãŠ +ã‚ã„ã†ãˆ ã†ãˆ +ã‚ã„ㆠㆠ+ã‚ã„ +ã‚ + +SELECT `C1`, SUBSTRING(`C1`,4) FROM `T11`; +C1 SUBSTRING(`C1`,4) +ã‚ã„ã†ãˆãŠ ãˆãŠ +ã‚ã„ã†ãˆ ㈠+ã‚ã„ㆠ+ã‚ã„ +ã‚ + +SELECT `C1`, SUBSTRING(`C1`,5) FROM `T11`; +C1 SUBSTRING(`C1`,5) +ã‚ã„ã†ãˆãŠ ãŠ +ã‚ã„ã†ãˆ +ã‚ã„ㆠ+ã‚ã„ +ã‚ + +SELECT `C1`, SUBSTRING(`C1`,6) FROM `T11`; +C1 SUBSTRING(`C1`,6) +ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆ +ã‚ã„ㆠ+ã‚ã„ +ã‚ + +SELECT `C1`, SUBSTRING(`C1` FROM 0) FROM `T11`; +C1 SUBSTRING(`C1` FROM 0) +ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆ +ã‚ã„ㆠ+ã‚ã„ +ã‚ + +SELECT `C1`, SUBSTRING(`C1` FROM 1) FROM `T11`; +C1 SUBSTRING(`C1` FROM 1) +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ ã‚ã„ +ã‚ ã‚ + +SELECT `C1`, SUBSTRING(`C1` FROM 2) FROM `T11`; +C1 SUBSTRING(`C1` FROM 2) +ã‚ã„ã†ãˆãŠ ã„ã†ãˆãŠ +ã‚ã„ã†ãˆ ã„ã†ãˆ +ã‚ã„ㆠã„ㆠ+ã‚ã„ ã„ +ã‚ + +SELECT `C1`, SUBSTRING(`C1` FROM 3) FROM `T11`; +C1 SUBSTRING(`C1` FROM 3) +ã‚ã„ã†ãˆãŠ ã†ãˆãŠ +ã‚ã„ã†ãˆ ã†ãˆ +ã‚ã„ㆠㆠ+ã‚ã„ +ã‚ + +SELECT `C1`, SUBSTRING(`C1` FROM 4) FROM `T11`; +C1 SUBSTRING(`C1` FROM 4) +ã‚ã„ã†ãˆãŠ ãˆãŠ +ã‚ã„ã†ãˆ ㈠+ã‚ã„ㆠ+ã‚ã„ +ã‚ + +SELECT `C1`, SUBSTRING(`C1` FROM 5) FROM `T11`; +C1 SUBSTRING(`C1` FROM 5) +ã‚ã„ã†ãˆãŠ ãŠ +ã‚ã„ã†ãˆ +ã‚ã„ㆠ+ã‚ã„ +ã‚ + +SELECT `C1`, SUBSTRING(`C1` FROM 6) FROM `T11`; +C1 SUBSTRING(`C1` FROM 6) +ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆ +ã‚ã„ㆠ+ã‚ã„ +ã‚ + +SELECT `C1`, SUBSTRING(`C1`,1,0) FROM `T11`; +C1 SUBSTRING(`C1`,1,0) +ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆ +ã‚ã„ㆠ+ã‚ã„ +ã‚ + +SELECT `C1`, SUBSTRING(`C1`,1,1) FROM `T11`; +C1 SUBSTRING(`C1`,1,1) +ã‚ã„ã†ãˆãŠ ã‚ +ã‚ã„ã†ãˆ ã‚ +ã‚ã„ㆠ゠+ã‚ã„ ã‚ +ã‚ ã‚ + +SELECT `C1`, SUBSTRING(`C1`,1,2) FROM `T11`; +C1 SUBSTRING(`C1`,1,2) +ã‚ã„ã†ãˆãŠ ã‚ã„ +ã‚ã„ã†ãˆ ã‚ã„ +ã‚ã„ㆠã‚ã„ +ã‚ã„ ã‚ã„ +ã‚ ã‚ + +SELECT `C1`, SUBSTRING(`C1`,1,3) FROM `T11`; +C1 SUBSTRING(`C1`,1,3) +ã‚ã„ã†ãˆãŠ ã‚ã„ㆠ+ã‚ã„ã†ãˆ ã‚ã„ㆠ+ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ ã‚ã„ +ã‚ ã‚ + +SELECT `C1`, SUBSTRING(`C1`,1,4) FROM `T11`; +C1 SUBSTRING(`C1`,1,4) +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ ã‚ã„ +ã‚ ã‚ + +SELECT `C1`, SUBSTRING(`C1`,1,5) FROM `T11`; +C1 SUBSTRING(`C1`,1,5) +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ ã‚ã„ +ã‚ ã‚ + +SELECT `C1`, SUBSTRING(`C1`,1,6) FROM `T11`; +C1 SUBSTRING(`C1`,1,6) +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ ã‚ã„ +ã‚ ã‚ + +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 0) FROM `T11`; +C1 SUBSTRING(`C1` FROM 1 FOR 0) +ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆ +ã‚ã„ㆠ+ã‚ã„ +ã‚ + +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 1) FROM `T11`; +C1 SUBSTRING(`C1` FROM 1 FOR 1) +ã‚ã„ã†ãˆãŠ ã‚ +ã‚ã„ã†ãˆ ã‚ +ã‚ã„ㆠ゠+ã‚ã„ ã‚ +ã‚ ã‚ + +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 2) FROM `T11`; +C1 SUBSTRING(`C1` FROM 1 FOR 2) +ã‚ã„ã†ãˆãŠ ã‚ã„ +ã‚ã„ã†ãˆ ã‚ã„ +ã‚ã„ㆠã‚ã„ +ã‚ã„ ã‚ã„ +ã‚ ã‚ + +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 3) FROM `T11`; +C1 SUBSTRING(`C1` FROM 1 FOR 3) +ã‚ã„ã†ãˆãŠ ã‚ã„ㆠ+ã‚ã„ã†ãˆ ã‚ã„ㆠ+ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ ã‚ã„ +ã‚ ã‚ + +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 4) FROM `T11`; +C1 SUBSTRING(`C1` FROM 1 FOR 4) +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆ +ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ ã‚ã„ +ã‚ ã‚ + +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 5) FROM `T11`; +C1 SUBSTRING(`C1` FROM 1 FOR 5) +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ ã‚ã„ +ã‚ ã‚ + +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 6) FROM `T11`; +C1 SUBSTRING(`C1` FROM 1 FOR 6) +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆ ã‚ã„ã†ãˆ +ã‚ã„ㆠã‚ã„ㆠ+ã‚ã„ ã‚ã„ +ã‚ ã‚ + +SELECT `C1`, SUBSTRING(`C1`,0) FROM `T12`; +C1 SUBSTRING(`C1`,0) +龔龖龗龞龡 +龔龖龗龞 +龔龖龗 +龔龖 +é¾” + +SELECT `C1`, SUBSTRING(`C1`,1) FROM `T12`; +C1 SUBSTRING(`C1`,1) +龔龖龗龞龡 龔龖龗龞龡 +龔龖龗龞 龔龖龗龞 +龔龖龗 龔龖龗 +龔龖 龔龖 +é¾” é¾” + +SELECT `C1`, SUBSTRING(`C1`,2) FROM `T12`; +C1 SUBSTRING(`C1`,2) +龔龖龗龞龡 龖龗龞龡 +龔龖龗龞 龖龗龞 +龔龖龗 é¾–é¾— +龔龖 é¾– +é¾” + +SELECT `C1`, SUBSTRING(`C1`,3) FROM `T12`; +C1 SUBSTRING(`C1`,3) +龔龖龗龞龡 龗龞龡 +龔龖龗龞 龗龞 +龔龖龗 é¾— +龔龖 +é¾” + +SELECT `C1`, SUBSTRING(`C1`,4) FROM `T12`; +C1 SUBSTRING(`C1`,4) +龔龖龗龞龡 龞龡 +龔龖龗龞 龞 +龔龖龗 +龔龖 +é¾” + +SELECT `C1`, SUBSTRING(`C1`,5) FROM `T12`; +C1 SUBSTRING(`C1`,5) +龔龖龗龞龡 龡 +龔龖龗龞 +龔龖龗 +龔龖 +é¾” + +SELECT `C1`, SUBSTRING(`C1`,6) FROM `T12`; +C1 SUBSTRING(`C1`,6) +龔龖龗龞龡 +龔龖龗龞 +龔龖龗 +龔龖 +é¾” + +SELECT `C1`, SUBSTRING(`C1` FROM 0) FROM `T12`; +C1 SUBSTRING(`C1` FROM 0) +龔龖龗龞龡 +龔龖龗龞 +龔龖龗 +龔龖 +é¾” + +SELECT `C1`, SUBSTRING(`C1` FROM 1) FROM `T12`; +C1 SUBSTRING(`C1` FROM 1) +龔龖龗龞龡 龔龖龗龞龡 +龔龖龗龞 龔龖龗龞 +龔龖龗 龔龖龗 +龔龖 龔龖 +é¾” é¾” + +SELECT `C1`, SUBSTRING(`C1` FROM 2) FROM `T12`; +C1 SUBSTRING(`C1` FROM 2) +龔龖龗龞龡 龖龗龞龡 +龔龖龗龞 龖龗龞 +龔龖龗 é¾–é¾— +龔龖 é¾– +é¾” + +SELECT `C1`, SUBSTRING(`C1` FROM 3) FROM `T12`; +C1 SUBSTRING(`C1` FROM 3) +龔龖龗龞龡 龗龞龡 +龔龖龗龞 龗龞 +龔龖龗 é¾— +龔龖 +é¾” + +SELECT `C1`, SUBSTRING(`C1` FROM 4) FROM `T12`; +C1 SUBSTRING(`C1` FROM 4) +龔龖龗龞龡 龞龡 +龔龖龗龞 龞 +龔龖龗 +龔龖 +é¾” + +SELECT `C1`, SUBSTRING(`C1` FROM 5) FROM `T12`; +C1 SUBSTRING(`C1` FROM 5) +龔龖龗龞龡 龡 +龔龖龗龞 +龔龖龗 +龔龖 +é¾” + +SELECT `C1`, SUBSTRING(`C1` FROM 6) FROM `T12`; +C1 SUBSTRING(`C1` FROM 6) +龔龖龗龞龡 +龔龖龗龞 +龔龖龗 +龔龖 +é¾” + +SELECT `C1`, SUBSTRING(`C1`,1,0) FROM `T12`; +C1 SUBSTRING(`C1`,1,0) +龔龖龗龞龡 +龔龖龗龞 +龔龖龗 +龔龖 +é¾” + +SELECT `C1`, SUBSTRING(`C1`,1,1) FROM `T12`; +C1 SUBSTRING(`C1`,1,1) +龔龖龗龞龡 é¾” +龔龖龗龞 é¾” +龔龖龗 é¾” +龔龖 é¾” +é¾” é¾” + +SELECT `C1`, SUBSTRING(`C1`,1,2) FROM `T12`; +C1 SUBSTRING(`C1`,1,2) +龔龖龗龞龡 龔龖 +龔龖龗龞 龔龖 +龔龖龗 龔龖 +龔龖 龔龖 +é¾” é¾” + +SELECT `C1`, SUBSTRING(`C1`,1,3) FROM `T12`; +C1 SUBSTRING(`C1`,1,3) +龔龖龗龞龡 龔龖龗 +龔龖龗龞 龔龖龗 +龔龖龗 龔龖龗 +龔龖 龔龖 +é¾” é¾” + +SELECT `C1`, SUBSTRING(`C1`,1,4) FROM `T12`; +C1 SUBSTRING(`C1`,1,4) +龔龖龗龞龡 龔龖龗龞 +龔龖龗龞 龔龖龗龞 +龔龖龗 龔龖龗 +龔龖 龔龖 +é¾” é¾” + +SELECT `C1`, SUBSTRING(`C1`,1,5) FROM `T12`; +C1 SUBSTRING(`C1`,1,5) +龔龖龗龞龡 龔龖龗龞龡 +龔龖龗龞 龔龖龗龞 +龔龖龗 龔龖龗 +龔龖 龔龖 +é¾” é¾” + +SELECT `C1`, SUBSTRING(`C1`,1,6) FROM `T12`; +C1 SUBSTRING(`C1`,1,6) +龔龖龗龞龡 龔龖龗龞龡 +龔龖龗龞 龔龖龗龞 +龔龖龗 龔龖龗 +龔龖 龔龖 +é¾” é¾” + +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 0) FROM `T12`; +C1 SUBSTRING(`C1` FROM 1 FOR 0) +龔龖龗龞龡 +龔龖龗龞 +龔龖龗 +龔龖 +é¾” + +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 1) FROM `T12`; +C1 SUBSTRING(`C1` FROM 1 FOR 1) +龔龖龗龞龡 é¾” +龔龖龗龞 é¾” +龔龖龗 é¾” +龔龖 é¾” +é¾” é¾” + +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 2) FROM `T12`; +C1 SUBSTRING(`C1` FROM 1 FOR 2) +龔龖龗龞龡 龔龖 +龔龖龗龞 龔龖 +龔龖龗 龔龖 +龔龖 龔龖 +é¾” é¾” + +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 3) FROM `T12`; +C1 SUBSTRING(`C1` FROM 1 FOR 3) +龔龖龗龞龡 龔龖龗 +龔龖龗龞 龔龖龗 +龔龖龗 龔龖龗 +龔龖 龔龖 +é¾” é¾” + +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 4) FROM `T12`; +C1 SUBSTRING(`C1` FROM 1 FOR 4) +龔龖龗龞龡 龔龖龗龞 +龔龖龗龞 龔龖龗龞 +龔龖龗 龔龖龗 +龔龖 龔龖 +é¾” é¾” + +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 5) FROM `T12`; +C1 SUBSTRING(`C1` FROM 1 FOR 5) +龔龖龗龞龡 龔龖龗龞龡 +龔龖龗龞 龔龖龗龞 +龔龖龗 龔龖龗 +龔龖 龔龖 +é¾” é¾” + +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 6) FROM `T12`; +C1 SUBSTRING(`C1` FROM 1 FOR 6) +龔龖龗龞龡 龔龖龗龞龡 +龔龖龗龞 龔龖龗龞 +龔龖龗 龔龖龗 +龔龖 龔龖 +é¾” é¾” + +DROP TABLE `T1`; +DROP TABLE `ï¼´ï¼’`; +DROP TABLE `T3`; +DROP TABLE `ï¼´ï¼”`; +DROP TABLE `T5`; +DROP TABLE `ï¼´ï¼–`; +DROP TABLE `ï¼´ï¼—`; +DROP TABLE `T8`; +DROP TABLE `ï¼´ï¼™`; +DROP TABLE `T1ï¼`; +DROP TABLE `T11`; +DROP TABLE `T12`; diff --git a/mysql-test/suite/jp/r/jp_trim_sjis.result b/mysql-test/suite/jp/r/jp_trim_sjis.result new file mode 100755 index 00000000000..e6ab86fd20a --- /dev/null +++ b/mysql-test/suite/jp/r/jp_trim_sjis.result @@ -0,0 +1,672 @@ +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +SET NAMES sjis; +SET character_set_database = sjis; +CREATE TABLE `‚s‚P` (`‚b‚P` char(12), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Q` (`‚b‚P` char(12), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚R` (`‚b‚P` char(12), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚S` (`‚b‚P` char(12), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚T` (`‚b‚P` char(12), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚U` (`‚b‚P` char(12), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚V` (`‚b‚P` char(12), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚W` (`‚b‚P` char(12), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚X` (`‚b‚P` char(12), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚O` (`‚b‚P` char(12), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚P` (`‚b‚P` char(12), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚Q` (`‚b‚P` char(12), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +INSERT INTO `‚s‚P` VALUES ('±²³´µ'); +INSERT INTO `‚s‚P` VALUES ('±²³´µ¶'); +INSERT INTO `‚s‚P` VALUES ('±²³´µ¶¶'); +INSERT INTO `‚s‚P` VALUES ('±²³´µ¶¶¶'); +INSERT INTO `‚s‚P` VALUES ('¶±²³´µ'); +INSERT INTO `‚s‚P` VALUES ('¶¶±²³´µ'); +INSERT INTO `‚s‚P` VALUES ('¶¶¶±²³´µ'); +INSERT INTO `‚s‚P` VALUES ('¶¶¶±²³´µ¶¶¶'); +INSERT INTO `‚s‚P` VALUES (' ±²³´µ '); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨‚©'); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨‚©‚©'); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨‚©‚©‚©'); +INSERT INTO `‚s‚Q` VALUES ('‚©‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚Q` VALUES ('‚©‚©‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚Q` VALUES ('‚©‚©‚©‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚Q` VALUES ('‚©‚©‚©‚ ‚¢‚¤‚¦‚¨‚©‚©‚©'); +INSERT INTO `‚s‚Q` VALUES (' ‚ ‚¢‚¤‚¦‚¨ '); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\–\'); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\–\–\'); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\–\–\–\'); +INSERT INTO `‚s‚R` VALUES ('–\ƒ\\•\—\\'); +INSERT INTO `‚s‚R` VALUES ('–\–\ƒ\\•\—\\'); +INSERT INTO `‚s‚R` VALUES ('–\–\–\ƒ\\•\—\\'); +INSERT INTO `‚s‚R` VALUES ('–\–\–\ƒ\\•\—\\–\–\–\'); +INSERT INTO `‚s‚R` VALUES (' ƒ\\•\—\\ '); +INSERT INTO `‚s‚S` VALUES ('±²³´µ'); +INSERT INTO `‚s‚S` VALUES ('±²³´µ¶'); +INSERT INTO `‚s‚S` VALUES ('±²³´µ¶¶'); +INSERT INTO `‚s‚S` VALUES ('±²³´µ¶¶¶'); +INSERT INTO `‚s‚S` VALUES ('¶±²³´µ'); +INSERT INTO `‚s‚S` VALUES ('¶¶±²³´µ'); +INSERT INTO `‚s‚S` VALUES ('¶¶¶±²³´µ'); +INSERT INTO `‚s‚S` VALUES ('¶¶¶±²³´µ¶¶¶'); +INSERT INTO `‚s‚S` VALUES (' ±²³´µ '); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨‚©'); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨‚©‚©'); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨‚©‚©‚©'); +INSERT INTO `‚s‚T` VALUES ('‚©‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚T` VALUES ('‚©‚©‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚T` VALUES ('‚©‚©‚©‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚T` VALUES ('‚©‚©‚©‚ ‚¢‚¤‚¦‚¨‚©‚©‚©'); +INSERT INTO `‚s‚T` VALUES (' ‚ ‚¢‚¤‚¦‚¨ '); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\–\'); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\–\–\'); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\–\–\–\'); +INSERT INTO `‚s‚U` VALUES ('–\ƒ\\•\—\\'); +INSERT INTO `‚s‚U` VALUES ('–\–\ƒ\\•\—\\'); +INSERT INTO `‚s‚U` VALUES ('–\–\–\ƒ\\•\—\\'); +INSERT INTO `‚s‚U` VALUES ('–\–\–\ƒ\\•\—\\–\–\–\'); +INSERT INTO `‚s‚U` VALUES (' ƒ\\•\—\\ '); +INSERT INTO `‚s‚V` VALUES ('±²³´µ'); +INSERT INTO `‚s‚V` VALUES ('±²³´µ¶'); +INSERT INTO `‚s‚V` VALUES ('±²³´µ¶¶'); +INSERT INTO `‚s‚V` VALUES ('±²³´µ¶¶¶'); +INSERT INTO `‚s‚V` VALUES ('¶±²³´µ'); +INSERT INTO `‚s‚V` VALUES ('¶¶±²³´µ'); +INSERT INTO `‚s‚V` VALUES ('¶¶¶±²³´µ'); +INSERT INTO `‚s‚V` VALUES ('¶¶¶±²³´µ¶¶¶'); +INSERT INTO `‚s‚V` VALUES (' ±²³´µ '); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨‚©'); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨‚©‚©'); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨‚©‚©‚©'); +INSERT INTO `‚s‚W` VALUES ('‚©‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚W` VALUES ('‚©‚©‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚W` VALUES ('‚©‚©‚©‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚W` VALUES ('‚©‚©‚©‚ ‚¢‚¤‚¦‚¨‚©‚©‚©'); +INSERT INTO `‚s‚W` VALUES (' ‚ ‚¢‚¤‚¦‚¨ '); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\–\'); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\–\–\'); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\–\–\–\'); +INSERT INTO `‚s‚X` VALUES ('–\ƒ\\•\—\\'); +INSERT INTO `‚s‚X` VALUES ('–\–\ƒ\\•\—\\'); +INSERT INTO `‚s‚X` VALUES ('–\–\–\ƒ\\•\—\\'); +INSERT INTO `‚s‚X` VALUES ('–\–\–\ƒ\\•\—\\–\–\–\'); +INSERT INTO `‚s‚X` VALUES (' ƒ\\•\—\\ '); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ'); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ¶'); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ¶¶'); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ¶¶¶'); +INSERT INTO `‚s‚P‚O` VALUES ('¶±²³´µ'); +INSERT INTO `‚s‚P‚O` VALUES ('¶¶±²³´µ'); +INSERT INTO `‚s‚P‚O` VALUES ('¶¶¶±²³´µ'); +INSERT INTO `‚s‚P‚O` VALUES ('¶¶¶±²³´µ¶¶¶'); +INSERT INTO `‚s‚P‚O` VALUES (' ±²³´µ '); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨‚©'); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨‚©‚©'); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨‚©‚©‚©'); +INSERT INTO `‚s‚P‚P` VALUES ('‚©‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚P‚P` VALUES ('‚©‚©‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚P‚P` VALUES ('‚©‚©‚©‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚P‚P` VALUES ('‚©‚©‚©‚ ‚¢‚¤‚¦‚¨‚©‚©‚©'); +INSERT INTO `‚s‚P‚P` VALUES (' ‚ ‚¢‚¤‚¦‚¨ '); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\–\'); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\–\–\'); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\–\–\–\'); +INSERT INTO `‚s‚P‚Q` VALUES ('–\ƒ\\•\—\\'); +INSERT INTO `‚s‚P‚Q` VALUES ('–\–\ƒ\\•\—\\'); +INSERT INTO `‚s‚P‚Q` VALUES ('–\–\–\ƒ\\•\—\\'); +INSERT INTO `‚s‚P‚Q` VALUES ('–\–\–\ƒ\\•\—\\–\–\–\'); +INSERT INTO `‚s‚P‚Q` VALUES (' ƒ\\•\—\\ '); +SELECT `‚b‚P`,TRIM(TRAILING '¶' FROM `‚b‚P`) FROM `‚s‚P`; +‚b‚P TRIM(TRAILING '¶' FROM `‚b‚P`) + ±²³´µ ±²³´µ +±²³´µ ±²³´µ +±²³´µ¶ ±²³´µ +±²³´µ¶¶ ±²³´µ +±²³´µ¶¶¶ ±²³´µ +¶±²³´µ ¶±²³´µ +¶¶±²³´µ ¶¶±²³´µ +¶¶¶±²³´µ ¶¶¶±²³´µ +¶¶¶±²³´µ¶¶¶ ¶¶¶±²³´µ +SELECT `‚b‚P`,TRIM(LEADING '¶' FROM `‚b‚P`) FROM `‚s‚P`; +‚b‚P TRIM(LEADING '¶' FROM `‚b‚P`) + ±²³´µ ±²³´µ +±²³´µ ±²³´µ +±²³´µ¶ ±²³´µ¶ +±²³´µ¶¶ ±²³´µ¶¶ +±²³´µ¶¶¶ ±²³´µ¶¶¶ +¶±²³´µ ±²³´µ +¶¶±²³´µ ±²³´µ +¶¶¶±²³´µ ±²³´µ +¶¶¶±²³´µ¶¶¶ ±²³´µ¶¶¶ +SELECT `‚b‚P`,TRIM(BOTH '¶' FROM `‚b‚P`) FROM `‚s‚P`; +‚b‚P TRIM(BOTH '¶' FROM `‚b‚P`) + ±²³´µ ±²³´µ +±²³´µ ±²³´µ +±²³´µ¶ ±²³´µ +±²³´µ¶¶ ±²³´µ +±²³´µ¶¶¶ ±²³´µ +¶±²³´µ ±²³´µ +¶¶±²³´µ ±²³´µ +¶¶¶±²³´µ ±²³´µ +¶¶¶±²³´µ¶¶¶ ±²³´µ +SELECT `‚b‚P`,TRIM(`‚b‚P`) FROM `‚s‚P`; +‚b‚P TRIM(`‚b‚P`) + ±²³´µ ±²³´µ +±²³´µ ±²³´µ +±²³´µ¶ ±²³´µ¶ +±²³´µ¶¶ ±²³´µ¶¶ +±²³´µ¶¶¶ ±²³´µ¶¶¶ +¶±²³´µ ¶±²³´µ +¶¶±²³´µ ¶¶±²³´µ +¶¶¶±²³´µ ¶¶¶±²³´µ +¶¶¶±²³´µ¶¶¶ ¶¶¶±²³´µ¶¶¶ +SELECT `‚b‚P`,TRIM(TRAILING '‚©' FROM `‚b‚P`) FROM `‚s‚Q`; +‚b‚P TRIM(TRAILING '‚©' FROM `‚b‚P`) + ‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨‚© ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨‚©‚© ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨‚©‚©‚© ‚ ‚¢‚¤‚¦‚¨ +‚©‚ ‚¢‚¤‚¦‚¨ ‚©‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚ ‚¢‚¤‚¦‚¨ ‚©‚©‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚©‚ ‚¢‚¤‚¦‚¨ ‚©‚©‚©‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚©‚ ‚¢‚¤‚¦‚¨‚©‚©‚© ‚©‚©‚©‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`,TRIM(LEADING '‚©' FROM `‚b‚P`) FROM `‚s‚Q`; +‚b‚P TRIM(LEADING '‚©' FROM `‚b‚P`) + ‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨‚© ‚ ‚¢‚¤‚¦‚¨‚© +‚ ‚¢‚¤‚¦‚¨‚©‚© ‚ ‚¢‚¤‚¦‚¨‚©‚© +‚ ‚¢‚¤‚¦‚¨‚©‚©‚© ‚ ‚¢‚¤‚¦‚¨‚©‚©‚© +‚©‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚©‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚©‚ ‚¢‚¤‚¦‚¨‚©‚©‚© ‚ ‚¢‚¤‚¦‚¨‚©‚©‚© +SELECT `‚b‚P`,TRIM(BOTH '‚©' FROM `‚b‚P`) FROM `‚s‚Q`; +‚b‚P TRIM(BOTH '‚©' FROM `‚b‚P`) + ‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨‚© ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨‚©‚© ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨‚©‚©‚© ‚ ‚¢‚¤‚¦‚¨ +‚©‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚©‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚©‚ ‚¢‚¤‚¦‚¨‚©‚©‚© ‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`,TRIM(`‚b‚P`) FROM `‚s‚Q`; +‚b‚P TRIM(`‚b‚P`) + ‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨‚© ‚ ‚¢‚¤‚¦‚¨‚© +‚ ‚¢‚¤‚¦‚¨‚©‚© ‚ ‚¢‚¤‚¦‚¨‚©‚© +‚ ‚¢‚¤‚¦‚¨‚©‚©‚© ‚ ‚¢‚¤‚¦‚¨‚©‚©‚© +‚©‚ ‚¢‚¤‚¦‚¨ ‚©‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚ ‚¢‚¤‚¦‚¨ ‚©‚©‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚©‚ ‚¢‚¤‚¦‚¨ ‚©‚©‚©‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚©‚ ‚¢‚¤‚¦‚¨‚©‚©‚© ‚©‚©‚©‚ ‚¢‚¤‚¦‚¨‚©‚©‚© +SELECT `‚b‚P`,TRIM(TRAILING '–\'FROM `‚b‚P`) FROM `‚s‚R`; +‚b‚P TRIM(TRAILING '–\'FROM `‚b‚P`) + ƒ\\•\—\\ ƒ\\•\—\\ +ƒ\\•\—\\ ƒ\\•\—\\ +ƒ\\•\—\\–\ ƒ\\•\—\\ +ƒ\\•\—\\–\–\ ƒ\\•\—\\ +ƒ\\•\—\\–\–\–\ ƒ\\•\—\\ +–\ƒ\\•\—\\ –\ƒ\\•\—\\ +–\–\ƒ\\•\—\\ –\–\ƒ\\•\—\\ +–\–\–\ƒ\\•\—\\ –\–\–\ƒ\\•\—\\ +–\–\–\ƒ\\•\—\\–\–\–\ –\–\–\ƒ\\•\—\\ +SELECT `‚b‚P`,TRIM(LEADING '–\' FROM `‚b‚P`) FROM `‚s‚R`; +‚b‚P TRIM(LEADING '–\' FROM `‚b‚P`) + ƒ\\•\—\\ ƒ\\•\—\\ +ƒ\\•\—\\ ƒ\\•\—\\ +ƒ\\•\—\\–\ ƒ\\•\—\\–\ +ƒ\\•\—\\–\–\ ƒ\\•\—\\–\–\ +ƒ\\•\—\\–\–\–\ ƒ\\•\—\\–\–\–\ +–\ƒ\\•\—\\ ƒ\\•\—\\ +–\–\ƒ\\•\—\\ ƒ\\•\—\\ +–\–\–\ƒ\\•\—\\ ƒ\\•\—\\ +–\–\–\ƒ\\•\—\\–\–\–\ ƒ\\•\—\\–\–\–\ +SELECT `‚b‚P`,TRIM(BOTH '–\' FROM `‚b‚P`) FROM `‚s‚R`; +‚b‚P TRIM(BOTH '–\' FROM `‚b‚P`) + ƒ\\•\—\\ ƒ\\•\—\\ +ƒ\\•\—\\ ƒ\\•\—\\ +ƒ\\•\—\\–\ ƒ\\•\—\\ +ƒ\\•\—\\–\–\ ƒ\\•\—\\ +ƒ\\•\—\\–\–\–\ ƒ\\•\—\\ +–\ƒ\\•\—\\ ƒ\\•\—\\ +–\–\ƒ\\•\—\\ ƒ\\•\—\\ +–\–\–\ƒ\\•\—\\ ƒ\\•\—\\ +–\–\–\ƒ\\•\—\\–\–\–\ ƒ\\•\—\\ +SELECT `‚b‚P`,TRIM(`‚b‚P`) FROM `‚s‚R`; +‚b‚P TRIM(`‚b‚P`) + ƒ\\•\—\\ ƒ\\•\—\\ +ƒ\\•\—\\ ƒ\\•\—\\ +ƒ\\•\—\\–\ ƒ\\•\—\\–\ +ƒ\\•\—\\–\–\ ƒ\\•\—\\–\–\ +ƒ\\•\—\\–\–\–\ ƒ\\•\—\\–\–\–\ +–\ƒ\\•\—\\ –\ƒ\\•\—\\ +–\–\ƒ\\•\—\\ –\–\ƒ\\•\—\\ +–\–\–\ƒ\\•\—\\ –\–\–\ƒ\\•\—\\ +–\–\–\ƒ\\•\—\\–\–\–\ –\–\–\ƒ\\•\—\\–\–\–\ +SELECT `‚b‚P`,TRIM(TRAILING '¶' FROM `‚b‚P`) FROM `‚s‚S`; +‚b‚P TRIM(TRAILING '¶' FROM `‚b‚P`) + ±²³´µ ±²³´µ +±²³´µ ±²³´µ +±²³´µ¶ ±²³´µ +±²³´µ¶¶ ±²³´µ +±²³´µ¶¶¶ ±²³´µ +¶±²³´µ ¶±²³´µ +¶¶±²³´µ ¶¶±²³´µ +¶¶¶±²³´µ ¶¶¶±²³´µ +¶¶¶±²³´µ¶¶¶ ¶¶¶±²³´µ +SELECT `‚b‚P`,TRIM(LEADING '¶' FROM `‚b‚P`) FROM `‚s‚S`; +‚b‚P TRIM(LEADING '¶' FROM `‚b‚P`) + ±²³´µ ±²³´µ +±²³´µ ±²³´µ +±²³´µ¶ ±²³´µ¶ +±²³´µ¶¶ ±²³´µ¶¶ +±²³´µ¶¶¶ ±²³´µ¶¶¶ +¶±²³´µ ±²³´µ +¶¶±²³´µ ±²³´µ +¶¶¶±²³´µ ±²³´µ +¶¶¶±²³´µ¶¶¶ ±²³´µ¶¶¶ +SELECT `‚b‚P`,TRIM(BOTH '¶' FROM `‚b‚P`) FROM `‚s‚S`; +‚b‚P TRIM(BOTH '¶' FROM `‚b‚P`) + ±²³´µ ±²³´µ +±²³´µ ±²³´µ +±²³´µ¶ ±²³´µ +±²³´µ¶¶ ±²³´µ +±²³´µ¶¶¶ ±²³´µ +¶±²³´µ ±²³´µ +¶¶±²³´µ ±²³´µ +¶¶¶±²³´µ ±²³´µ +¶¶¶±²³´µ¶¶¶ ±²³´µ +SELECT `‚b‚P`,TRIM(`‚b‚P`) FROM `‚s‚S`; +‚b‚P TRIM(`‚b‚P`) + ±²³´µ ±²³´µ +±²³´µ ±²³´µ +±²³´µ¶ ±²³´µ¶ +±²³´µ¶¶ ±²³´µ¶¶ +±²³´µ¶¶¶ ±²³´µ¶¶¶ +¶±²³´µ ¶±²³´µ +¶¶±²³´µ ¶¶±²³´µ +¶¶¶±²³´µ ¶¶¶±²³´µ +¶¶¶±²³´µ¶¶¶ ¶¶¶±²³´µ¶¶¶ +SELECT `‚b‚P`,TRIM(TRAILING '‚©' FROM `‚b‚P`) FROM `‚s‚T`; +‚b‚P TRIM(TRAILING '‚©' FROM `‚b‚P`) + ‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨‚© ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨‚©‚© ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨‚©‚©‚© ‚ ‚¢‚¤‚¦‚¨ +‚©‚ ‚¢‚¤‚¦‚¨ ‚©‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚ ‚¢‚¤‚¦‚¨ ‚©‚©‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚©‚ ‚¢‚¤‚¦‚¨ ‚©‚©‚©‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚©‚ ‚¢‚¤‚¦‚¨‚©‚©‚© ‚©‚©‚©‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`,TRIM(LEADING '‚©' FROM `‚b‚P`) FROM `‚s‚T`; +‚b‚P TRIM(LEADING '‚©' FROM `‚b‚P`) + ‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨‚© ‚ ‚¢‚¤‚¦‚¨‚© +‚ ‚¢‚¤‚¦‚¨‚©‚© ‚ ‚¢‚¤‚¦‚¨‚©‚© +‚ ‚¢‚¤‚¦‚¨‚©‚©‚© ‚ ‚¢‚¤‚¦‚¨‚©‚©‚© +‚©‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚©‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚©‚ ‚¢‚¤‚¦‚¨‚©‚©‚© ‚ ‚¢‚¤‚¦‚¨‚©‚©‚© +SELECT `‚b‚P`,TRIM(BOTH '‚©' FROM `‚b‚P`) FROM `‚s‚T`; +‚b‚P TRIM(BOTH '‚©' FROM `‚b‚P`) + ‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨‚© ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨‚©‚© ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨‚©‚©‚© ‚ ‚¢‚¤‚¦‚¨ +‚©‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚©‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚©‚ ‚¢‚¤‚¦‚¨‚©‚©‚© ‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`,TRIM(`‚b‚P`) FROM `‚s‚T`; +‚b‚P TRIM(`‚b‚P`) + ‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨‚© ‚ ‚¢‚¤‚¦‚¨‚© +‚ ‚¢‚¤‚¦‚¨‚©‚© ‚ ‚¢‚¤‚¦‚¨‚©‚© +‚ ‚¢‚¤‚¦‚¨‚©‚©‚© ‚ ‚¢‚¤‚¦‚¨‚©‚©‚© +‚©‚ ‚¢‚¤‚¦‚¨ ‚©‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚ ‚¢‚¤‚¦‚¨ ‚©‚©‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚©‚ ‚¢‚¤‚¦‚¨ ‚©‚©‚©‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚©‚ ‚¢‚¤‚¦‚¨‚©‚©‚© ‚©‚©‚©‚ ‚¢‚¤‚¦‚¨‚©‚©‚© +SELECT `‚b‚P`,TRIM(TRAILING '–\' FROM `‚b‚P`) FROM `‚s‚U`; +‚b‚P TRIM(TRAILING '–\' FROM `‚b‚P`) + ƒ\\•\—\\ ƒ\\•\—\\ +ƒ\\•\—\\ ƒ\\•\—\\ +ƒ\\•\—\\–\ ƒ\\•\—\\ +ƒ\\•\—\\–\–\ ƒ\\•\—\\ +ƒ\\•\—\\–\–\–\ ƒ\\•\—\\ +–\ƒ\\•\—\\ –\ƒ\\•\—\\ +–\–\ƒ\\•\—\\ –\–\ƒ\\•\—\\ +–\–\–\ƒ\\•\—\\ –\–\–\ƒ\\•\—\\ +–\–\–\ƒ\\•\—\\–\–\–\ –\–\–\ƒ\\•\—\\ +SELECT `‚b‚P`,TRIM(LEADING '–\' FROM `‚b‚P`) FROM `‚s‚U`; +‚b‚P TRIM(LEADING '–\' FROM `‚b‚P`) + ƒ\\•\—\\ ƒ\\•\—\\ +ƒ\\•\—\\ ƒ\\•\—\\ +ƒ\\•\—\\–\ ƒ\\•\—\\–\ +ƒ\\•\—\\–\–\ ƒ\\•\—\\–\–\ +ƒ\\•\—\\–\–\–\ ƒ\\•\—\\–\–\–\ +–\ƒ\\•\—\\ ƒ\\•\—\\ +–\–\ƒ\\•\—\\ ƒ\\•\—\\ +–\–\–\ƒ\\•\—\\ ƒ\\•\—\\ +–\–\–\ƒ\\•\—\\–\–\–\ ƒ\\•\—\\–\–\–\ +SELECT `‚b‚P`,TRIM(BOTH '–\' FROM `‚b‚P`) FROM `‚s‚U`; +‚b‚P TRIM(BOTH '–\' FROM `‚b‚P`) + ƒ\\•\—\\ ƒ\\•\—\\ +ƒ\\•\—\\ ƒ\\•\—\\ +ƒ\\•\—\\–\ ƒ\\•\—\\ +ƒ\\•\—\\–\–\ ƒ\\•\—\\ +ƒ\\•\—\\–\–\–\ ƒ\\•\—\\ +–\ƒ\\•\—\\ ƒ\\•\—\\ +–\–\ƒ\\•\—\\ ƒ\\•\—\\ +–\–\–\ƒ\\•\—\\ ƒ\\•\—\\ +–\–\–\ƒ\\•\—\\–\–\–\ ƒ\\•\—\\ +SELECT `‚b‚P`,TRIM(`‚b‚P`) FROM `‚s‚U`; +‚b‚P TRIM(`‚b‚P`) + ƒ\\•\—\\ ƒ\\•\—\\ +ƒ\\•\—\\ ƒ\\•\—\\ +ƒ\\•\—\\–\ ƒ\\•\—\\–\ +ƒ\\•\—\\–\–\ ƒ\\•\—\\–\–\ +ƒ\\•\—\\–\–\–\ ƒ\\•\—\\–\–\–\ +–\ƒ\\•\—\\ –\ƒ\\•\—\\ +–\–\ƒ\\•\—\\ –\–\ƒ\\•\—\\ +–\–\–\ƒ\\•\—\\ –\–\–\ƒ\\•\—\\ +–\–\–\ƒ\\•\—\\–\–\–\ –\–\–\ƒ\\•\—\\–\–\–\ +SELECT `‚b‚P`,TRIM(TRAILING '¶' FROM `‚b‚P`) FROM `‚s‚V`; +‚b‚P TRIM(TRAILING '¶' FROM `‚b‚P`) +±²³´µ ±²³´µ +±²³´µ¶ ±²³´µ +±²³´µ¶¶ ±²³´µ +±²³´µ¶¶¶ ±²³´µ +¶±²³´µ ¶±²³´µ +¶¶±²³´µ ¶¶±²³´µ +¶¶¶±²³´µ ¶¶¶±²³´µ +¶¶¶±²³´µ¶¶¶ ¶¶¶±²³´µ + ±²³´µ ±²³´µ +SELECT `‚b‚P`,TRIM(LEADING '¶' FROM `‚b‚P`) FROM `‚s‚V`; +‚b‚P TRIM(LEADING '¶' FROM `‚b‚P`) +±²³´µ ±²³´µ +±²³´µ¶ ±²³´µ¶ +±²³´µ¶¶ ±²³´µ¶¶ +±²³´µ¶¶¶ ±²³´µ¶¶¶ +¶±²³´µ ±²³´µ +¶¶±²³´µ ±²³´µ +¶¶¶±²³´µ ±²³´µ +¶¶¶±²³´µ¶¶¶ ±²³´µ¶¶¶ + ±²³´µ ±²³´µ +SELECT `‚b‚P`,TRIM(BOTH '¶' FROM `‚b‚P`) FROM `‚s‚V`; +‚b‚P TRIM(BOTH '¶' FROM `‚b‚P`) +±²³´µ ±²³´µ +±²³´µ¶ ±²³´µ +±²³´µ¶¶ ±²³´µ +±²³´µ¶¶¶ ±²³´µ +¶±²³´µ ±²³´µ +¶¶±²³´µ ±²³´µ +¶¶¶±²³´µ ±²³´µ +¶¶¶±²³´µ¶¶¶ ±²³´µ + ±²³´µ ±²³´µ +SELECT `‚b‚P`,TRIM(`‚b‚P`) FROM `‚s‚V`; +‚b‚P TRIM(`‚b‚P`) +±²³´µ ±²³´µ +±²³´µ¶ ±²³´µ¶ +±²³´µ¶¶ ±²³´µ¶¶ +±²³´µ¶¶¶ ±²³´µ¶¶¶ +¶±²³´µ ¶±²³´µ +¶¶±²³´µ ¶¶±²³´µ +¶¶¶±²³´µ ¶¶¶±²³´µ +¶¶¶±²³´µ¶¶¶ ¶¶¶±²³´µ¶¶¶ + ±²³´µ ±²³´µ +SELECT `‚b‚P`,TRIM(TRAILING '‚©' FROM `‚b‚P`) FROM `‚s‚W`; +‚b‚P TRIM(TRAILING '‚©' FROM `‚b‚P`) +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨‚© ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨‚©‚© ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨‚©‚©‚© ‚ ‚¢‚¤‚¦‚¨ +‚©‚ ‚¢‚¤‚¦‚¨ ‚©‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚ ‚¢‚¤‚¦‚¨ ‚©‚©‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚©‚ ‚¢‚¤‚¦‚¨ ‚©‚©‚©‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚©‚ ‚¢‚¤‚¦‚¨‚©‚©‚© ‚©‚©‚©‚ ‚¢‚¤‚¦‚¨ + ‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`,TRIM(LEADING '‚©' FROM `‚b‚P`) FROM `‚s‚W`; +‚b‚P TRIM(LEADING '‚©' FROM `‚b‚P`) +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨‚© ‚ ‚¢‚¤‚¦‚¨‚© +‚ ‚¢‚¤‚¦‚¨‚©‚© ‚ ‚¢‚¤‚¦‚¨‚©‚© +‚ ‚¢‚¤‚¦‚¨‚©‚©‚© ‚ ‚¢‚¤‚¦‚¨‚©‚©‚© +‚©‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚©‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚©‚ ‚¢‚¤‚¦‚¨‚©‚©‚© ‚ ‚¢‚¤‚¦‚¨‚©‚©‚© + ‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`,TRIM(BOTH '‚©' FROM `‚b‚P`) FROM `‚s‚W`; +‚b‚P TRIM(BOTH '‚©' FROM `‚b‚P`) +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨‚© ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨‚©‚© ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨‚©‚©‚© ‚ ‚¢‚¤‚¦‚¨ +‚©‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚©‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚©‚ ‚¢‚¤‚¦‚¨‚©‚©‚© ‚ ‚¢‚¤‚¦‚¨ + ‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`,TRIM(`‚b‚P`) FROM `‚s‚W`; +‚b‚P TRIM(`‚b‚P`) +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨‚© ‚ ‚¢‚¤‚¦‚¨‚© +‚ ‚¢‚¤‚¦‚¨‚©‚© ‚ ‚¢‚¤‚¦‚¨‚©‚© +‚ ‚¢‚¤‚¦‚¨‚©‚©‚© ‚ ‚¢‚¤‚¦‚¨‚©‚©‚© +‚©‚ ‚¢‚¤‚¦‚¨ ‚©‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚ ‚¢‚¤‚¦‚¨ ‚©‚©‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚©‚ ‚¢‚¤‚¦‚¨ ‚©‚©‚©‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚©‚ ‚¢‚¤‚¦‚¨‚©‚©‚© ‚©‚©‚©‚ ‚¢‚¤‚¦‚¨‚©‚©‚© + ‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`,TRIM(TRAILING '–\' FROM `‚b‚P`) FROM `‚s‚X`; +‚b‚P TRIM(TRAILING '–\' FROM `‚b‚P`) +ƒ\\•\—\\ ƒ\\•\—\\ +ƒ\\•\—\\–\ ƒ\\•\—\\ +ƒ\\•\—\\–\–\ ƒ\\•\—\\ +ƒ\\•\—\\–\–\–\ ƒ\\•\—\\ +–\ƒ\\•\—\\ –\ƒ\\•\—\\ +–\–\ƒ\\•\—\\ –\–\ƒ\\•\—\\ +–\–\–\ƒ\\•\—\\ –\–\–\ƒ\\•\—\\ +–\–\–\ƒ\\•\—\\–\–\–\ –\–\–\ƒ\\•\—\\ + ƒ\\•\—\\ ƒ\\•\—\\ +SELECT `‚b‚P`,TRIM(LEADING '–\' FROM `‚b‚P`) FROM `‚s‚X`; +‚b‚P TRIM(LEADING '–\' FROM `‚b‚P`) +ƒ\\•\—\\ ƒ\\•\—\\ +ƒ\\•\—\\–\ ƒ\\•\—\\–\ +ƒ\\•\—\\–\–\ ƒ\\•\—\\–\–\ +ƒ\\•\—\\–\–\–\ ƒ\\•\—\\–\–\–\ +–\ƒ\\•\—\\ ƒ\\•\—\\ +–\–\ƒ\\•\—\\ ƒ\\•\—\\ +–\–\–\ƒ\\•\—\\ ƒ\\•\—\\ +–\–\–\ƒ\\•\—\\–\–\–\ ƒ\\•\—\\–\–\–\ + ƒ\\•\—\\ ƒ\\•\—\\ +SELECT `‚b‚P`,TRIM(BOTH '–\' FROM `‚b‚P`) FROM `‚s‚X`; +‚b‚P TRIM(BOTH '–\' FROM `‚b‚P`) +ƒ\\•\—\\ ƒ\\•\—\\ +ƒ\\•\—\\–\ ƒ\\•\—\\ +ƒ\\•\—\\–\–\ ƒ\\•\—\\ +ƒ\\•\—\\–\–\–\ ƒ\\•\—\\ +–\ƒ\\•\—\\ ƒ\\•\—\\ +–\–\ƒ\\•\—\\ ƒ\\•\—\\ +–\–\–\ƒ\\•\—\\ ƒ\\•\—\\ +–\–\–\ƒ\\•\—\\–\–\–\ ƒ\\•\—\\ + ƒ\\•\—\\ ƒ\\•\—\\ +SELECT `‚b‚P`,TRIM(`‚b‚P`) FROM `‚s‚X`; +‚b‚P TRIM(`‚b‚P`) +ƒ\\•\—\\ ƒ\\•\—\\ +ƒ\\•\—\\–\ ƒ\\•\—\\–\ +ƒ\\•\—\\–\–\ ƒ\\•\—\\–\–\ +ƒ\\•\—\\–\–\–\ ƒ\\•\—\\–\–\–\ +–\ƒ\\•\—\\ –\ƒ\\•\—\\ +–\–\ƒ\\•\—\\ –\–\ƒ\\•\—\\ +–\–\–\ƒ\\•\—\\ –\–\–\ƒ\\•\—\\ +–\–\–\ƒ\\•\—\\–\–\–\ –\–\–\ƒ\\•\—\\–\–\–\ + ƒ\\•\—\\ ƒ\\•\—\\ +SELECT `‚b‚P`,TRIM(TRAILING '¶' FROM `‚b‚P`) FROM `‚s‚P‚O`; +‚b‚P TRIM(TRAILING '¶' FROM `‚b‚P`) +±²³´µ ±²³´µ +±²³´µ¶ ±²³´µ +±²³´µ¶¶ ±²³´µ +±²³´µ¶¶¶ ±²³´µ +¶±²³´µ ¶±²³´µ +¶¶±²³´µ ¶¶±²³´µ +¶¶¶±²³´µ ¶¶¶±²³´µ +¶¶¶±²³´µ¶¶¶ ¶¶¶±²³´µ + ±²³´µ ±²³´µ +SELECT `‚b‚P`,TRIM(LEADING '¶' FROM `‚b‚P`) FROM `‚s‚P‚O`; +‚b‚P TRIM(LEADING '¶' FROM `‚b‚P`) +±²³´µ ±²³´µ +±²³´µ¶ ±²³´µ¶ +±²³´µ¶¶ ±²³´µ¶¶ +±²³´µ¶¶¶ ±²³´µ¶¶¶ +¶±²³´µ ±²³´µ +¶¶±²³´µ ±²³´µ +¶¶¶±²³´µ ±²³´µ +¶¶¶±²³´µ¶¶¶ ±²³´µ¶¶¶ + ±²³´µ ±²³´µ +SELECT `‚b‚P`,TRIM(BOTH '¶' FROM `‚b‚P`) FROM `‚s‚P‚O`; +‚b‚P TRIM(BOTH '¶' FROM `‚b‚P`) +±²³´µ ±²³´µ +±²³´µ¶ ±²³´µ +±²³´µ¶¶ ±²³´µ +±²³´µ¶¶¶ ±²³´µ +¶±²³´µ ±²³´µ +¶¶±²³´µ ±²³´µ +¶¶¶±²³´µ ±²³´µ +¶¶¶±²³´µ¶¶¶ ±²³´µ + ±²³´µ ±²³´µ +SELECT `‚b‚P`,TRIM(`‚b‚P`) FROM `‚s‚P‚O`; +‚b‚P TRIM(`‚b‚P`) +±²³´µ ±²³´µ +±²³´µ¶ ±²³´µ¶ +±²³´µ¶¶ ±²³´µ¶¶ +±²³´µ¶¶¶ ±²³´µ¶¶¶ +¶±²³´µ ¶±²³´µ +¶¶±²³´µ ¶¶±²³´µ +¶¶¶±²³´µ ¶¶¶±²³´µ +¶¶¶±²³´µ¶¶¶ ¶¶¶±²³´µ¶¶¶ + ±²³´µ ±²³´µ +SELECT `‚b‚P`,TRIM(TRAILING '‚©' FROM `‚b‚P`) FROM `‚s‚P‚P`; +‚b‚P TRIM(TRAILING '‚©' FROM `‚b‚P`) +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨‚© ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨‚©‚© ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨‚©‚©‚© ‚ ‚¢‚¤‚¦‚¨ +‚©‚ ‚¢‚¤‚¦‚¨ ‚©‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚ ‚¢‚¤‚¦‚¨ ‚©‚©‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚©‚ ‚¢‚¤‚¦‚¨ ‚©‚©‚©‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚©‚ ‚¢‚¤‚¦‚¨‚©‚©‚© ‚©‚©‚©‚ ‚¢‚¤‚¦‚¨ + ‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`,TRIM(LEADING '‚©' FROM `‚b‚P`) FROM `‚s‚P‚P`; +‚b‚P TRIM(LEADING '‚©' FROM `‚b‚P`) +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨‚© ‚ ‚¢‚¤‚¦‚¨‚© +‚ ‚¢‚¤‚¦‚¨‚©‚© ‚ ‚¢‚¤‚¦‚¨‚©‚© +‚ ‚¢‚¤‚¦‚¨‚©‚©‚© ‚ ‚¢‚¤‚¦‚¨‚©‚©‚© +‚©‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚©‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚©‚ ‚¢‚¤‚¦‚¨‚©‚©‚© ‚ ‚¢‚¤‚¦‚¨‚©‚©‚© + ‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`,TRIM(BOTH '‚©' FROM `‚b‚P`) FROM `‚s‚P‚P`; +‚b‚P TRIM(BOTH '‚©' FROM `‚b‚P`) +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨‚© ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨‚©‚© ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨‚©‚©‚© ‚ ‚¢‚¤‚¦‚¨ +‚©‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚©‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚©‚ ‚¢‚¤‚¦‚¨‚©‚©‚© ‚ ‚¢‚¤‚¦‚¨ + ‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`,TRIM(`‚b‚P`) FROM `‚s‚P‚P`; +‚b‚P TRIM(`‚b‚P`) +‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +‚ ‚¢‚¤‚¦‚¨‚© ‚ ‚¢‚¤‚¦‚¨‚© +‚ ‚¢‚¤‚¦‚¨‚©‚© ‚ ‚¢‚¤‚¦‚¨‚©‚© +‚ ‚¢‚¤‚¦‚¨‚©‚©‚© ‚ ‚¢‚¤‚¦‚¨‚©‚©‚© +‚©‚ ‚¢‚¤‚¦‚¨ ‚©‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚ ‚¢‚¤‚¦‚¨ ‚©‚©‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚©‚ ‚¢‚¤‚¦‚¨ ‚©‚©‚©‚ ‚¢‚¤‚¦‚¨ +‚©‚©‚©‚ ‚¢‚¤‚¦‚¨‚©‚©‚© ‚©‚©‚©‚ ‚¢‚¤‚¦‚¨‚©‚©‚© + ‚ ‚¢‚¤‚¦‚¨ ‚ ‚¢‚¤‚¦‚¨ +SELECT `‚b‚P`,TRIM(TRAILING '–\' FROM `‚b‚P`) FROM `‚s‚P‚Q`; +‚b‚P TRIM(TRAILING '–\' FROM `‚b‚P`) +ƒ\\•\—\\ ƒ\\•\—\\ +ƒ\\•\—\\–\ ƒ\\•\—\\ +ƒ\\•\—\\–\–\ ƒ\\•\—\\ +ƒ\\•\—\\–\–\–\ ƒ\\•\—\\ +–\ƒ\\•\—\\ –\ƒ\\•\—\\ +–\–\ƒ\\•\—\\ –\–\ƒ\\•\—\\ +–\–\–\ƒ\\•\—\\ –\–\–\ƒ\\•\—\\ +–\–\–\ƒ\\•\—\\–\–\–\ –\–\–\ƒ\\•\—\\ + ƒ\\•\—\\ ƒ\\•\—\\ +SELECT `‚b‚P`,TRIM(LEADING '–\' FROM `‚b‚P`) FROM `‚s‚P‚Q`; +‚b‚P TRIM(LEADING '–\' FROM `‚b‚P`) +ƒ\\•\—\\ ƒ\\•\—\\ +ƒ\\•\—\\–\ ƒ\\•\—\\–\ +ƒ\\•\—\\–\–\ ƒ\\•\—\\–\–\ +ƒ\\•\—\\–\–\–\ ƒ\\•\—\\–\–\–\ +–\ƒ\\•\—\\ ƒ\\•\—\\ +–\–\ƒ\\•\—\\ ƒ\\•\—\\ +–\–\–\ƒ\\•\—\\ ƒ\\•\—\\ +–\–\–\ƒ\\•\—\\–\–\–\ ƒ\\•\—\\–\–\–\ + ƒ\\•\—\\ ƒ\\•\—\\ +SELECT `‚b‚P`,TRIM(BOTH '–\' FROM `‚b‚P`) FROM `‚s‚P‚Q`; +‚b‚P TRIM(BOTH '–\' FROM `‚b‚P`) +ƒ\\•\—\\ ƒ\\•\—\\ +ƒ\\•\—\\–\ ƒ\\•\—\\ +ƒ\\•\—\\–\–\ ƒ\\•\—\\ +ƒ\\•\—\\–\–\–\ ƒ\\•\—\\ +–\ƒ\\•\—\\ ƒ\\•\—\\ +–\–\ƒ\\•\—\\ ƒ\\•\—\\ +–\–\–\ƒ\\•\—\\ ƒ\\•\—\\ +–\–\–\ƒ\\•\—\\–\–\–\ ƒ\\•\—\\ + ƒ\\•\—\\ ƒ\\•\—\\ +SELECT `‚b‚P`,TRIM(`‚b‚P`) FROM `‚s‚P‚Q`; +‚b‚P TRIM(`‚b‚P`) +ƒ\\•\—\\ ƒ\\•\—\\ +ƒ\\•\—\\–\ ƒ\\•\—\\–\ +ƒ\\•\—\\–\–\ ƒ\\•\—\\–\–\ +ƒ\\•\—\\–\–\–\ ƒ\\•\—\\–\–\–\ +–\ƒ\\•\—\\ –\ƒ\\•\—\\ +–\–\ƒ\\•\—\\ –\–\ƒ\\•\—\\ +–\–\–\ƒ\\•\—\\ –\–\–\ƒ\\•\—\\ +–\–\–\ƒ\\•\—\\–\–\–\ –\–\–\ƒ\\•\—\\–\–\–\ + ƒ\\•\—\\ ƒ\\•\—\\ +DROP TABLE `‚s‚P`; +DROP TABLE `‚s‚Q`; +DROP TABLE `‚s‚R`; +DROP TABLE `‚s‚S`; +DROP TABLE `‚s‚T`; +DROP TABLE `‚s‚U`; +DROP TABLE `‚s‚V`; +DROP TABLE `‚s‚W`; +DROP TABLE `‚s‚X`; +DROP TABLE `‚s‚P‚O`; +DROP TABLE `‚s‚P‚P`; +DROP TABLE `‚s‚P‚Q`; diff --git a/mysql-test/suite/jp/r/jp_trim_ucs2.result b/mysql-test/suite/jp/r/jp_trim_ucs2.result new file mode 100755 index 00000000000..6ef73301a49 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_trim_ucs2.result @@ -0,0 +1,673 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; +CREATE TABLE `£Ô£±` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵޶'); +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵޶޶'); +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵޶޶޶'); +INSERT INTO `£Ô£±` VALUES ('޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£±` VALUES ('޶޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£±` VALUES ('޶޶޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£±` VALUES ('޶޶޶ޱ޲޳޴޵޶޶޶'); +INSERT INTO `£Ô£±` VALUES (' ޱ޲޳޴޵ '); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«¤«'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«¤«¤«'); +INSERT INTO `£Ô£²` VALUES ('¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£²` VALUES ('¤«¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£²` VALUES ('¤«¤«¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£²` VALUES ('¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤«'); +INSERT INTO `£Ô£²` VALUES (' ¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà°¡'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà°¡°¡'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà°¡°¡°¡'); +INSERT INTO `£Ô£³` VALUES ('°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£³` VALUES ('°¡°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£³` VALUES ('°¡°¡°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£³` VALUES ('°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡'); +INSERT INTO `£Ô£³` VALUES (' íÜíÝíÞíßíà '); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵޶'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵޶޶'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵޶޶޶'); +INSERT INTO `£Ô£´` VALUES ('޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£´` VALUES ('޶޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£´` VALUES ('޶޶޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£´` VALUES ('޶޶޶ޱ޲޳޴޵޶޶޶'); +INSERT INTO `£Ô£´` VALUES (' ޱ޲޳޴޵ '); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«¤«'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«¤«¤«'); +INSERT INTO `£Ô£µ` VALUES ('¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£µ` VALUES ('¤«¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£µ` VALUES ('¤«¤«¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£µ` VALUES ('¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤«'); +INSERT INTO `£Ô£µ` VALUES (' ¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà°¡'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà°¡°¡'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà°¡°¡°¡'); +INSERT INTO `£Ô£¶` VALUES ('°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¶` VALUES ('°¡°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¶` VALUES ('°¡°¡°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¶` VALUES ('°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡'); +INSERT INTO `£Ô£¶` VALUES (' íÜíÝíÞíßíà '); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵޶'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵޶޶'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵޶޶޶'); +INSERT INTO `£Ô£·` VALUES ('޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£·` VALUES ('޶޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£·` VALUES ('޶޶޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£·` VALUES ('޶޶޶ޱ޲޳޴޵޶޶޶'); +INSERT INTO `£Ô£·` VALUES (' ޱ޲޳޴޵ '); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«¤«'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«¤«¤«'); +INSERT INTO `£Ô£¸` VALUES ('¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¸` VALUES ('¤«¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¸` VALUES ('¤«¤«¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¸` VALUES ('¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤«'); +INSERT INTO `£Ô£¸` VALUES (' ¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà°¡'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà°¡°¡'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà°¡°¡°¡'); +INSERT INTO `£Ô£¹` VALUES ('°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¹` VALUES ('°¡°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¹` VALUES ('°¡°¡°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¹` VALUES ('°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡'); +INSERT INTO `£Ô£¹` VALUES (' íÜíÝíÞíßíà '); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵޶'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵޶޶'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵޶޶޶'); +INSERT INTO `£Ô£±£°` VALUES ('޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£°` VALUES ('޶޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£°` VALUES ('޶޶޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£°` VALUES ('޶޶޶ޱ޲޳޴޵޶޶޶'); +INSERT INTO `£Ô£±£°` VALUES (' ޱ޲޳޴޵ '); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«¤«'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«¤«¤«'); +INSERT INTO `£Ô£±£±` VALUES ('¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£±` VALUES ('¤«¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£±` VALUES ('¤«¤«¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£±` VALUES ('¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤«'); +INSERT INTO `£Ô£±£±` VALUES (' ¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà°¡'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà°¡°¡'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà°¡°¡°¡'); +INSERT INTO `£Ô£±£²` VALUES ('°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£²` VALUES ('°¡°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£²` VALUES ('°¡°¡°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£²` VALUES ('°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡'); +INSERT INTO `£Ô£±£²` VALUES (' íÜíÝíÞíßíà '); +SELECT `£Ã£±`,TRIM(TRAILING '޶' FROM `£Ã£±`) FROM `£Ô£±`; +£Ã£± TRIM(TRAILING '޶' FROM `£Ã£±`) + ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵޶ ޱ޲޳޴޵ +ޱ޲޳޴޵޶޶ ޱ޲޳޴޵ +ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵ +޶ޱ޲޳޴޵ ޶ޱ޲޳޴޵ +޶޶ޱ޲޳޴޵ ޶޶ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵ ޶޶޶ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵޶޶޶ ޶޶޶ޱ޲޳޴޵ +SELECT `£Ã£±`,TRIM(LEADING '޶' FROM `£Ã£±`) FROM `£Ô£±`; +£Ã£± TRIM(LEADING '޶' FROM `£Ã£±`) + ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵޶ ޱ޲޳޴޵޶ +ޱ޲޳޴޵޶޶ ޱ޲޳޴޵޶޶ +ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵޶޶޶ +޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵޶޶޶ +SELECT `£Ã£±`,TRIM(BOTH '޶' FROM `£Ã£±`) FROM `£Ô£±`; +£Ã£± TRIM(BOTH '޶' FROM `£Ã£±`) + ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵޶ ޱ޲޳޴޵ +ޱ޲޳޴޵޶޶ ޱ޲޳޴޵ +ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵ +޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵ +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£±`; +£Ã£± TRIM(`£Ã£±`) + ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵޶ ޱ޲޳޴޵޶ +ޱ޲޳޴޵޶޶ ޱ޲޳޴޵޶޶ +ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵޶޶޶ +޶ޱ޲޳޴޵ ޶ޱ޲޳޴޵ +޶޶ޱ޲޳޴޵ ޶޶ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵ ޶޶޶ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵޶޶޶ ޶޶޶ޱ޲޳޴޵޶޶޶ +SELECT `£Ã£±`,TRIM(TRAILING '¤«' FROM `£Ã£±`) FROM `£Ô£²`; +£Ã£± TRIM(TRAILING '¤«' FROM `£Ã£±`) + ¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤« ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤«¤« ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª +¤«¤¢¤¤¤¦¤¨¤ª ¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤¢¤¤¤¦¤¨¤ª ¤«¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª ¤«¤«¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤«¤«¤«¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`,TRIM(LEADING '¤«' FROM `£Ã£±`) FROM `£Ô£²`; +£Ã£± TRIM(LEADING '¤«' FROM `£Ã£±`) + ¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤« ¤¢¤¤¤¦¤¨¤ª¤« +¤¢¤¤¤¦¤¨¤ª¤«¤« ¤¢¤¤¤¦¤¨¤ª¤«¤« +¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª¤«¤«¤« +¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª¤«¤«¤« +SELECT `£Ã£±`,TRIM(BOTH '¤«' FROM `£Ã£±`) FROM `£Ô£²`; +£Ã£± TRIM(BOTH '¤«' FROM `£Ã£±`) + ¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤« ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤«¤« ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª +¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£²`; +£Ã£± TRIM(`£Ã£±`) + ¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤« ¤¢¤¤¤¦¤¨¤ª¤« +¤¢¤¤¤¦¤¨¤ª¤«¤« ¤¢¤¤¤¦¤¨¤ª¤«¤« +¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª¤«¤«¤« +¤«¤¢¤¤¤¦¤¨¤ª ¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤¢¤¤¤¦¤¨¤ª ¤«¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª ¤«¤«¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤« +SELECT `£Ã£±`,TRIM(TRAILING '°¡'FROM `£Ã£±`) FROM `£Ô£³`; +£Ã£± TRIM(TRAILING '°¡'FROM `£Ã£±`) + íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà °¡°¡°¡íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡ °¡°¡°¡íÜíÝíÞíßíà +°¡°¡íÜíÝíÞíßíà °¡°¡íÜíÝíÞíßíà +°¡íÜíÝíÞíßíà °¡íÜíÝíÞíßíà +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡ íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡°¡ íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà +SELECT `£Ã£±`,TRIM(LEADING '°¡' FROM `£Ã£±`) FROM `£Ô£³`; +£Ã£± TRIM(LEADING '°¡' FROM `£Ã£±`) + íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà°¡°¡°¡ +°¡°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡ íÜíÝíÞíßíà°¡ +íÜíÝíÞíßíà°¡°¡ íÜíÝíÞíßíà°¡°¡ +íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà°¡°¡°¡ +SELECT `£Ã£±`,TRIM(BOTH '°¡' FROM `£Ã£±`) FROM `£Ô£³`; +£Ã£± TRIM(BOTH '°¡' FROM `£Ã£±`) + íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà +°¡°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡ íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡°¡ íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£³`; +£Ã£± TRIM(`£Ã£±`) + íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà °¡°¡°¡íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡ °¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡ +°¡°¡íÜíÝíÞíßíà °¡°¡íÜíÝíÞíßíà +°¡íÜíÝíÞíßíà °¡íÜíÝíÞíßíà +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡ íÜíÝíÞíßíà°¡ +íÜíÝíÞíßíà°¡°¡ íÜíÝíÞíßíà°¡°¡ +íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà°¡°¡°¡ +SELECT `£Ã£±`,TRIM(TRAILING '޶' FROM `£Ã£±`) FROM `£Ô£´`; +£Ã£± TRIM(TRAILING '޶' FROM `£Ã£±`) + ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵޶ ޱ޲޳޴޵ +ޱ޲޳޴޵޶޶ ޱ޲޳޴޵ +ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵ +޶ޱ޲޳޴޵ ޶ޱ޲޳޴޵ +޶޶ޱ޲޳޴޵ ޶޶ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵ ޶޶޶ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵޶޶޶ ޶޶޶ޱ޲޳޴޵ +SELECT `£Ã£±`,TRIM(LEADING '޶' FROM `£Ã£±`) FROM `£Ô£´`; +£Ã£± TRIM(LEADING '޶' FROM `£Ã£±`) + ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵޶ ޱ޲޳޴޵޶ +ޱ޲޳޴޵޶޶ ޱ޲޳޴޵޶޶ +ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵޶޶޶ +޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵޶޶޶ +SELECT `£Ã£±`,TRIM(BOTH '޶' FROM `£Ã£±`) FROM `£Ô£´`; +£Ã£± TRIM(BOTH '޶' FROM `£Ã£±`) + ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵޶ ޱ޲޳޴޵ +ޱ޲޳޴޵޶޶ ޱ޲޳޴޵ +ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵ +޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵ +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£´`; +£Ã£± TRIM(`£Ã£±`) + ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵޶ ޱ޲޳޴޵޶ +ޱ޲޳޴޵޶޶ ޱ޲޳޴޵޶޶ +ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵޶޶޶ +޶ޱ޲޳޴޵ ޶ޱ޲޳޴޵ +޶޶ޱ޲޳޴޵ ޶޶ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵ ޶޶޶ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵޶޶޶ ޶޶޶ޱ޲޳޴޵޶޶޶ +SELECT `£Ã£±`,TRIM(TRAILING '¤«' FROM `£Ã£±`) FROM `£Ô£µ`; +£Ã£± TRIM(TRAILING '¤«' FROM `£Ã£±`) + ¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤« ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤«¤« ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª +¤«¤¢¤¤¤¦¤¨¤ª ¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤¢¤¤¤¦¤¨¤ª ¤«¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª ¤«¤«¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤«¤«¤«¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`,TRIM(LEADING '¤«' FROM `£Ã£±`) FROM `£Ô£µ`; +£Ã£± TRIM(LEADING '¤«' FROM `£Ã£±`) + ¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤« ¤¢¤¤¤¦¤¨¤ª¤« +¤¢¤¤¤¦¤¨¤ª¤«¤« ¤¢¤¤¤¦¤¨¤ª¤«¤« +¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª¤«¤«¤« +¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª¤«¤«¤« +SELECT `£Ã£±`,TRIM(BOTH '¤«' FROM `£Ã£±`) FROM `£Ô£µ`; +£Ã£± TRIM(BOTH '¤«' FROM `£Ã£±`) + ¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤« ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤«¤« ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª +¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£µ`; +£Ã£± TRIM(`£Ã£±`) + ¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤« ¤¢¤¤¤¦¤¨¤ª¤« +¤¢¤¤¤¦¤¨¤ª¤«¤« ¤¢¤¤¤¦¤¨¤ª¤«¤« +¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª¤«¤«¤« +¤«¤¢¤¤¤¦¤¨¤ª ¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤¢¤¤¤¦¤¨¤ª ¤«¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª ¤«¤«¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤« +SELECT `£Ã£±`,TRIM(TRAILING '°¡' FROM `£Ã£±`) FROM `£Ô£¶`; +£Ã£± TRIM(TRAILING '°¡' FROM `£Ã£±`) + íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà °¡°¡°¡íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡ °¡°¡°¡íÜíÝíÞíßíà +°¡°¡íÜíÝíÞíßíà °¡°¡íÜíÝíÞíßíà +°¡íÜíÝíÞíßíà °¡íÜíÝíÞíßíà +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡ íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡°¡ íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà +SELECT `£Ã£±`,TRIM(LEADING '°¡' FROM `£Ã£±`) FROM `£Ô£¶`; +£Ã£± TRIM(LEADING '°¡' FROM `£Ã£±`) + íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà°¡°¡°¡ +°¡°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡ íÜíÝíÞíßíà°¡ +íÜíÝíÞíßíà°¡°¡ íÜíÝíÞíßíà°¡°¡ +íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà°¡°¡°¡ +SELECT `£Ã£±`,TRIM(BOTH '°¡' FROM `£Ã£±`) FROM `£Ô£¶`; +£Ã£± TRIM(BOTH '°¡' FROM `£Ã£±`) + íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà +°¡°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡ íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡°¡ íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£¶`; +£Ã£± TRIM(`£Ã£±`) + íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà °¡°¡°¡íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡ °¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡ +°¡°¡íÜíÝíÞíßíà °¡°¡íÜíÝíÞíßíà +°¡íÜíÝíÞíßíà °¡íÜíÝíÞíßíà +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡ íÜíÝíÞíßíà°¡ +íÜíÝíÞíßíà°¡°¡ íÜíÝíÞíßíà°¡°¡ +íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà°¡°¡°¡ +SELECT `£Ã£±`,TRIM(TRAILING '޶' FROM `£Ã£±`) FROM `£Ô£·`; +£Ã£± TRIM(TRAILING '޶' FROM `£Ã£±`) +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵޶ ޱ޲޳޴޵ +ޱ޲޳޴޵޶޶ ޱ޲޳޴޵ +ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵ +޶ޱ޲޳޴޵ ޶ޱ޲޳޴޵ +޶޶ޱ޲޳޴޵ ޶޶ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵ ޶޶޶ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵޶޶޶ ޶޶޶ޱ޲޳޴޵ + ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`,TRIM(LEADING '޶' FROM `£Ã£±`) FROM `£Ô£·`; +£Ã£± TRIM(LEADING '޶' FROM `£Ã£±`) +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵޶ ޱ޲޳޴޵޶ +ޱ޲޳޴޵޶޶ ޱ޲޳޴޵޶޶ +ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵޶޶޶ +޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵޶޶޶ + ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`,TRIM(BOTH '޶' FROM `£Ã£±`) FROM `£Ô£·`; +£Ã£± TRIM(BOTH '޶' FROM `£Ã£±`) +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵޶ ޱ޲޳޴޵ +ޱ޲޳޴޵޶޶ ޱ޲޳޴޵ +ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵ +޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵ + ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£·`; +£Ã£± TRIM(`£Ã£±`) +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵޶ ޱ޲޳޴޵޶ +ޱ޲޳޴޵޶޶ ޱ޲޳޴޵޶޶ +ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵޶޶޶ +޶ޱ޲޳޴޵ ޶ޱ޲޳޴޵ +޶޶ޱ޲޳޴޵ ޶޶ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵ ޶޶޶ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵޶޶޶ ޶޶޶ޱ޲޳޴޵޶޶޶ + ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`,TRIM(TRAILING '¤«' FROM `£Ã£±`) FROM `£Ô£¸`; +£Ã£± TRIM(TRAILING '¤«' FROM `£Ã£±`) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤« ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤«¤« ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª +¤«¤¢¤¤¤¦¤¨¤ª ¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤¢¤¤¤¦¤¨¤ª ¤«¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª ¤«¤«¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤«¤«¤«¤¢¤¤¤¦¤¨¤ª + ¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`,TRIM(LEADING '¤«' FROM `£Ã£±`) FROM `£Ô£¸`; +£Ã£± TRIM(LEADING '¤«' FROM `£Ã£±`) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤« ¤¢¤¤¤¦¤¨¤ª¤« +¤¢¤¤¤¦¤¨¤ª¤«¤« ¤¢¤¤¤¦¤¨¤ª¤«¤« +¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª¤«¤«¤« +¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª¤«¤«¤« + ¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`,TRIM(BOTH '¤«' FROM `£Ã£±`) FROM `£Ô£¸`; +£Ã£± TRIM(BOTH '¤«' FROM `£Ã£±`) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤« ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤«¤« ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª +¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª + ¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£¸`; +£Ã£± TRIM(`£Ã£±`) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤« ¤¢¤¤¤¦¤¨¤ª¤« +¤¢¤¤¤¦¤¨¤ª¤«¤« ¤¢¤¤¤¦¤¨¤ª¤«¤« +¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª¤«¤«¤« +¤«¤¢¤¤¤¦¤¨¤ª ¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤¢¤¤¤¦¤¨¤ª ¤«¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª ¤«¤«¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤« + ¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`,TRIM(TRAILING '°¡' FROM `£Ã£±`) FROM `£Ô£¹`; +£Ã£± TRIM(TRAILING '°¡' FROM `£Ã£±`) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡ íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡°¡ íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà +°¡íÜíÝíÞíßíà °¡íÜíÝíÞíßíà +°¡°¡íÜíÝíÞíßíà °¡°¡íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà °¡°¡°¡íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡ °¡°¡°¡íÜíÝíÞíßíà + íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`,TRIM(LEADING '°¡' FROM `£Ã£±`) FROM `£Ô£¹`; +£Ã£± TRIM(LEADING '°¡' FROM `£Ã£±`) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡ íÜíÝíÞíßíà°¡ +íÜíÝíÞíßíà°¡°¡ íÜíÝíÞíßíà°¡°¡ +íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà°¡°¡°¡ +°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà°¡°¡°¡ + íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`,TRIM(BOTH '°¡' FROM `£Ã£±`) FROM `£Ô£¹`; +£Ã£± TRIM(BOTH '°¡' FROM `£Ã£±`) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡ íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡°¡ íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà +°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà + íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£¹`; +£Ã£± TRIM(`£Ã£±`) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡ íÜíÝíÞíßíà°¡ +íÜíÝíÞíßíà°¡°¡ íÜíÝíÞíßíà°¡°¡ +íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà°¡°¡°¡ +°¡íÜíÝíÞíßíà °¡íÜíÝíÞíßíà +°¡°¡íÜíÝíÞíßíà °¡°¡íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà °¡°¡°¡íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡ °¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡ + íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`,TRIM(TRAILING '޶' FROM `£Ã£±`) FROM `£Ô£±£°`; +£Ã£± TRIM(TRAILING '޶' FROM `£Ã£±`) +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵޶ ޱ޲޳޴޵ +ޱ޲޳޴޵޶޶ ޱ޲޳޴޵ +ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵ +޶ޱ޲޳޴޵ ޶ޱ޲޳޴޵ +޶޶ޱ޲޳޴޵ ޶޶ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵ ޶޶޶ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵޶޶޶ ޶޶޶ޱ޲޳޴޵ + ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`,TRIM(LEADING '޶' FROM `£Ã£±`) FROM `£Ô£±£°`; +£Ã£± TRIM(LEADING '޶' FROM `£Ã£±`) +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵޶ ޱ޲޳޴޵޶ +ޱ޲޳޴޵޶޶ ޱ޲޳޴޵޶޶ +ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵޶޶޶ +޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵޶޶޶ + ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`,TRIM(BOTH '޶' FROM `£Ã£±`) FROM `£Ô£±£°`; +£Ã£± TRIM(BOTH '޶' FROM `£Ã£±`) +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵޶ ޱ޲޳޴޵ +ޱ޲޳޴޵޶޶ ޱ޲޳޴޵ +ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵ +޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵ + ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£±£°`; +£Ã£± TRIM(`£Ã£±`) +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵޶ ޱ޲޳޴޵޶ +ޱ޲޳޴޵޶޶ ޱ޲޳޴޵޶޶ +ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵޶޶޶ +޶ޱ޲޳޴޵ ޶ޱ޲޳޴޵ +޶޶ޱ޲޳޴޵ ޶޶ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵ ޶޶޶ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵޶޶޶ ޶޶޶ޱ޲޳޴޵޶޶޶ + ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`,TRIM(TRAILING '¤«' FROM `£Ã£±`) FROM `£Ô£±£±`; +£Ã£± TRIM(TRAILING '¤«' FROM `£Ã£±`) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤« ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤«¤« ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª +¤«¤¢¤¤¤¦¤¨¤ª ¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤¢¤¤¤¦¤¨¤ª ¤«¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª ¤«¤«¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤«¤«¤«¤¢¤¤¤¦¤¨¤ª + ¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`,TRIM(LEADING '¤«' FROM `£Ã£±`) FROM `£Ô£±£±`; +£Ã£± TRIM(LEADING '¤«' FROM `£Ã£±`) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤« ¤¢¤¤¤¦¤¨¤ª¤« +¤¢¤¤¤¦¤¨¤ª¤«¤« ¤¢¤¤¤¦¤¨¤ª¤«¤« +¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª¤«¤«¤« +¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª¤«¤«¤« + ¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`,TRIM(BOTH '¤«' FROM `£Ã£±`) FROM `£Ô£±£±`; +£Ã£± TRIM(BOTH '¤«' FROM `£Ã£±`) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤« ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤«¤« ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª +¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª + ¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£±£±`; +£Ã£± TRIM(`£Ã£±`) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤« ¤¢¤¤¤¦¤¨¤ª¤« +¤¢¤¤¤¦¤¨¤ª¤«¤« ¤¢¤¤¤¦¤¨¤ª¤«¤« +¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª¤«¤«¤« +¤«¤¢¤¤¤¦¤¨¤ª ¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤¢¤¤¤¦¤¨¤ª ¤«¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª ¤«¤«¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤« + ¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`,TRIM(TRAILING '°¡' FROM `£Ã£±`) FROM `£Ô£±£²`; +£Ã£± TRIM(TRAILING '°¡' FROM `£Ã£±`) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡ íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡°¡ íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà +°¡íÜíÝíÞíßíà °¡íÜíÝíÞíßíà +°¡°¡íÜíÝíÞíßíà °¡°¡íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà °¡°¡°¡íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡ °¡°¡°¡íÜíÝíÞíßíà + íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`,TRIM(LEADING '°¡' FROM `£Ã£±`) FROM `£Ô£±£²`; +£Ã£± TRIM(LEADING '°¡' FROM `£Ã£±`) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡ íÜíÝíÞíßíà°¡ +íÜíÝíÞíßíà°¡°¡ íÜíÝíÞíßíà°¡°¡ +íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà°¡°¡°¡ +°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà°¡°¡°¡ + íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`,TRIM(BOTH '°¡' FROM `£Ã£±`) FROM `£Ô£±£²`; +£Ã£± TRIM(BOTH '°¡' FROM `£Ã£±`) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡ íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡°¡ íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà +°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà + íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£±£²`; +£Ã£± TRIM(`£Ã£±`) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡ íÜíÝíÞíßíà°¡ +íÜíÝíÞíßíà°¡°¡ íÜíÝíÞíßíà°¡°¡ +íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà°¡°¡°¡ +°¡íÜíÝíÞíßíà °¡íÜíÝíÞíßíà +°¡°¡íÜíÝíÞíßíà °¡°¡íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà °¡°¡°¡íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡ °¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡ + íÜíÝíÞíßíà íÜíÝíÞíßíà +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/r/jp_trim_ujis.result b/mysql-test/suite/jp/r/jp_trim_ujis.result new file mode 100755 index 00000000000..b79a1b24a37 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_trim_ujis.result @@ -0,0 +1,672 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +SET NAMES ujis; +SET character_set_database = ujis; +CREATE TABLE `£Ô£±` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵޶'); +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵޶޶'); +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵޶޶޶'); +INSERT INTO `£Ô£±` VALUES ('޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£±` VALUES ('޶޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£±` VALUES ('޶޶޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£±` VALUES ('޶޶޶ޱ޲޳޴޵޶޶޶'); +INSERT INTO `£Ô£±` VALUES (' ޱ޲޳޴޵ '); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«¤«'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«¤«¤«'); +INSERT INTO `£Ô£²` VALUES ('¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£²` VALUES ('¤«¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£²` VALUES ('¤«¤«¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£²` VALUES ('¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤«'); +INSERT INTO `£Ô£²` VALUES (' ¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà°¡'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà°¡°¡'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà°¡°¡°¡'); +INSERT INTO `£Ô£³` VALUES ('°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£³` VALUES ('°¡°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£³` VALUES ('°¡°¡°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£³` VALUES ('°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡'); +INSERT INTO `£Ô£³` VALUES (' íÜíÝíÞíßíà '); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵޶'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵޶޶'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵޶޶޶'); +INSERT INTO `£Ô£´` VALUES ('޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£´` VALUES ('޶޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£´` VALUES ('޶޶޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£´` VALUES ('޶޶޶ޱ޲޳޴޵޶޶޶'); +INSERT INTO `£Ô£´` VALUES (' ޱ޲޳޴޵ '); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«¤«'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«¤«¤«'); +INSERT INTO `£Ô£µ` VALUES ('¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£µ` VALUES ('¤«¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£µ` VALUES ('¤«¤«¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£µ` VALUES ('¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤«'); +INSERT INTO `£Ô£µ` VALUES (' ¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà°¡'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà°¡°¡'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà°¡°¡°¡'); +INSERT INTO `£Ô£¶` VALUES ('°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¶` VALUES ('°¡°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¶` VALUES ('°¡°¡°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¶` VALUES ('°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡'); +INSERT INTO `£Ô£¶` VALUES (' íÜíÝíÞíßíà '); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵޶'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵޶޶'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵޶޶޶'); +INSERT INTO `£Ô£·` VALUES ('޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£·` VALUES ('޶޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£·` VALUES ('޶޶޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£·` VALUES ('޶޶޶ޱ޲޳޴޵޶޶޶'); +INSERT INTO `£Ô£·` VALUES (' ޱ޲޳޴޵ '); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«¤«'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«¤«¤«'); +INSERT INTO `£Ô£¸` VALUES ('¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¸` VALUES ('¤«¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¸` VALUES ('¤«¤«¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¸` VALUES ('¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤«'); +INSERT INTO `£Ô£¸` VALUES (' ¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà°¡'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà°¡°¡'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà°¡°¡°¡'); +INSERT INTO `£Ô£¹` VALUES ('°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¹` VALUES ('°¡°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¹` VALUES ('°¡°¡°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¹` VALUES ('°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡'); +INSERT INTO `£Ô£¹` VALUES (' íÜíÝíÞíßíà '); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵޶'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵޶޶'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵޶޶޶'); +INSERT INTO `£Ô£±£°` VALUES ('޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£°` VALUES ('޶޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£°` VALUES ('޶޶޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£°` VALUES ('޶޶޶ޱ޲޳޴޵޶޶޶'); +INSERT INTO `£Ô£±£°` VALUES (' ޱ޲޳޴޵ '); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«¤«'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«¤«¤«'); +INSERT INTO `£Ô£±£±` VALUES ('¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£±` VALUES ('¤«¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£±` VALUES ('¤«¤«¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£±` VALUES ('¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤«'); +INSERT INTO `£Ô£±£±` VALUES (' ¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà°¡'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà°¡°¡'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà°¡°¡°¡'); +INSERT INTO `£Ô£±£²` VALUES ('°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£²` VALUES ('°¡°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£²` VALUES ('°¡°¡°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£²` VALUES ('°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡'); +INSERT INTO `£Ô£±£²` VALUES (' íÜíÝíÞíßíà '); +SELECT `£Ã£±`,TRIM(TRAILING '޶' FROM `£Ã£±`) FROM `£Ô£±`; +£Ã£± TRIM(TRAILING '޶' FROM `£Ã£±`) + ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵޶ ޱ޲޳޴޵ +ޱ޲޳޴޵޶޶ ޱ޲޳޴޵ +ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵ +޶ޱ޲޳޴޵ ޶ޱ޲޳޴޵ +޶޶ޱ޲޳޴޵ ޶޶ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵ ޶޶޶ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵޶޶޶ ޶޶޶ޱ޲޳޴޵ +SELECT `£Ã£±`,TRIM(LEADING '޶' FROM `£Ã£±`) FROM `£Ô£±`; +£Ã£± TRIM(LEADING '޶' FROM `£Ã£±`) + ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵޶ ޱ޲޳޴޵޶ +ޱ޲޳޴޵޶޶ ޱ޲޳޴޵޶޶ +ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵޶޶޶ +޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵޶޶޶ +SELECT `£Ã£±`,TRIM(BOTH '޶' FROM `£Ã£±`) FROM `£Ô£±`; +£Ã£± TRIM(BOTH '޶' FROM `£Ã£±`) + ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵޶ ޱ޲޳޴޵ +ޱ޲޳޴޵޶޶ ޱ޲޳޴޵ +ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵ +޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵ +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£±`; +£Ã£± TRIM(`£Ã£±`) + ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵޶ ޱ޲޳޴޵޶ +ޱ޲޳޴޵޶޶ ޱ޲޳޴޵޶޶ +ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵޶޶޶ +޶ޱ޲޳޴޵ ޶ޱ޲޳޴޵ +޶޶ޱ޲޳޴޵ ޶޶ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵ ޶޶޶ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵޶޶޶ ޶޶޶ޱ޲޳޴޵޶޶޶ +SELECT `£Ã£±`,TRIM(TRAILING '¤«' FROM `£Ã£±`) FROM `£Ô£²`; +£Ã£± TRIM(TRAILING '¤«' FROM `£Ã£±`) + ¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤« ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤«¤« ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª +¤«¤¢¤¤¤¦¤¨¤ª ¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤¢¤¤¤¦¤¨¤ª ¤«¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª ¤«¤«¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤«¤«¤«¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`,TRIM(LEADING '¤«' FROM `£Ã£±`) FROM `£Ô£²`; +£Ã£± TRIM(LEADING '¤«' FROM `£Ã£±`) + ¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤« ¤¢¤¤¤¦¤¨¤ª¤« +¤¢¤¤¤¦¤¨¤ª¤«¤« ¤¢¤¤¤¦¤¨¤ª¤«¤« +¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª¤«¤«¤« +¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª¤«¤«¤« +SELECT `£Ã£±`,TRIM(BOTH '¤«' FROM `£Ã£±`) FROM `£Ô£²`; +£Ã£± TRIM(BOTH '¤«' FROM `£Ã£±`) + ¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤« ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤«¤« ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª +¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£²`; +£Ã£± TRIM(`£Ã£±`) + ¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤« ¤¢¤¤¤¦¤¨¤ª¤« +¤¢¤¤¤¦¤¨¤ª¤«¤« ¤¢¤¤¤¦¤¨¤ª¤«¤« +¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª¤«¤«¤« +¤«¤¢¤¤¤¦¤¨¤ª ¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤¢¤¤¤¦¤¨¤ª ¤«¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª ¤«¤«¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤« +SELECT `£Ã£±`,TRIM(TRAILING '°¡'FROM `£Ã£±`) FROM `£Ô£³`; +£Ã£± TRIM(TRAILING '°¡'FROM `£Ã£±`) + íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà °¡°¡°¡íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡ °¡°¡°¡íÜíÝíÞíßíà +°¡°¡íÜíÝíÞíßíà °¡°¡íÜíÝíÞíßíà +°¡íÜíÝíÞíßíà °¡íÜíÝíÞíßíà +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡ íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡°¡ íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà +SELECT `£Ã£±`,TRIM(LEADING '°¡' FROM `£Ã£±`) FROM `£Ô£³`; +£Ã£± TRIM(LEADING '°¡' FROM `£Ã£±`) + íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà°¡°¡°¡ +°¡°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡ íÜíÝíÞíßíà°¡ +íÜíÝíÞíßíà°¡°¡ íÜíÝíÞíßíà°¡°¡ +íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà°¡°¡°¡ +SELECT `£Ã£±`,TRIM(BOTH '°¡' FROM `£Ã£±`) FROM `£Ô£³`; +£Ã£± TRIM(BOTH '°¡' FROM `£Ã£±`) + íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà +°¡°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡ íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡°¡ íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£³`; +£Ã£± TRIM(`£Ã£±`) + íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà °¡°¡°¡íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡ °¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡ +°¡°¡íÜíÝíÞíßíà °¡°¡íÜíÝíÞíßíà +°¡íÜíÝíÞíßíà °¡íÜíÝíÞíßíà +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡ íÜíÝíÞíßíà°¡ +íÜíÝíÞíßíà°¡°¡ íÜíÝíÞíßíà°¡°¡ +íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà°¡°¡°¡ +SELECT `£Ã£±`,TRIM(TRAILING '޶' FROM `£Ã£±`) FROM `£Ô£´`; +£Ã£± TRIM(TRAILING '޶' FROM `£Ã£±`) + ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵޶ ޱ޲޳޴޵ +ޱ޲޳޴޵޶޶ ޱ޲޳޴޵ +ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵ +޶ޱ޲޳޴޵ ޶ޱ޲޳޴޵ +޶޶ޱ޲޳޴޵ ޶޶ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵ ޶޶޶ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵޶޶޶ ޶޶޶ޱ޲޳޴޵ +SELECT `£Ã£±`,TRIM(LEADING '޶' FROM `£Ã£±`) FROM `£Ô£´`; +£Ã£± TRIM(LEADING '޶' FROM `£Ã£±`) + ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵޶ ޱ޲޳޴޵޶ +ޱ޲޳޴޵޶޶ ޱ޲޳޴޵޶޶ +ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵޶޶޶ +޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵޶޶޶ +SELECT `£Ã£±`,TRIM(BOTH '޶' FROM `£Ã£±`) FROM `£Ô£´`; +£Ã£± TRIM(BOTH '޶' FROM `£Ã£±`) + ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵޶ ޱ޲޳޴޵ +ޱ޲޳޴޵޶޶ ޱ޲޳޴޵ +ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵ +޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵ +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£´`; +£Ã£± TRIM(`£Ã£±`) + ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵޶ ޱ޲޳޴޵޶ +ޱ޲޳޴޵޶޶ ޱ޲޳޴޵޶޶ +ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵޶޶޶ +޶ޱ޲޳޴޵ ޶ޱ޲޳޴޵ +޶޶ޱ޲޳޴޵ ޶޶ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵ ޶޶޶ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵޶޶޶ ޶޶޶ޱ޲޳޴޵޶޶޶ +SELECT `£Ã£±`,TRIM(TRAILING '¤«' FROM `£Ã£±`) FROM `£Ô£µ`; +£Ã£± TRIM(TRAILING '¤«' FROM `£Ã£±`) + ¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤« ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤«¤« ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª +¤«¤¢¤¤¤¦¤¨¤ª ¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤¢¤¤¤¦¤¨¤ª ¤«¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª ¤«¤«¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤«¤«¤«¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`,TRIM(LEADING '¤«' FROM `£Ã£±`) FROM `£Ô£µ`; +£Ã£± TRIM(LEADING '¤«' FROM `£Ã£±`) + ¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤« ¤¢¤¤¤¦¤¨¤ª¤« +¤¢¤¤¤¦¤¨¤ª¤«¤« ¤¢¤¤¤¦¤¨¤ª¤«¤« +¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª¤«¤«¤« +¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª¤«¤«¤« +SELECT `£Ã£±`,TRIM(BOTH '¤«' FROM `£Ã£±`) FROM `£Ô£µ`; +£Ã£± TRIM(BOTH '¤«' FROM `£Ã£±`) + ¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤« ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤«¤« ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª +¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£µ`; +£Ã£± TRIM(`£Ã£±`) + ¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤« ¤¢¤¤¤¦¤¨¤ª¤« +¤¢¤¤¤¦¤¨¤ª¤«¤« ¤¢¤¤¤¦¤¨¤ª¤«¤« +¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª¤«¤«¤« +¤«¤¢¤¤¤¦¤¨¤ª ¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤¢¤¤¤¦¤¨¤ª ¤«¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª ¤«¤«¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤« +SELECT `£Ã£±`,TRIM(TRAILING '°¡' FROM `£Ã£±`) FROM `£Ô£¶`; +£Ã£± TRIM(TRAILING '°¡' FROM `£Ã£±`) + íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà °¡°¡°¡íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡ °¡°¡°¡íÜíÝíÞíßíà +°¡°¡íÜíÝíÞíßíà °¡°¡íÜíÝíÞíßíà +°¡íÜíÝíÞíßíà °¡íÜíÝíÞíßíà +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡ íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡°¡ íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà +SELECT `£Ã£±`,TRIM(LEADING '°¡' FROM `£Ã£±`) FROM `£Ô£¶`; +£Ã£± TRIM(LEADING '°¡' FROM `£Ã£±`) + íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà°¡°¡°¡ +°¡°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡ íÜíÝíÞíßíà°¡ +íÜíÝíÞíßíà°¡°¡ íÜíÝíÞíßíà°¡°¡ +íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà°¡°¡°¡ +SELECT `£Ã£±`,TRIM(BOTH '°¡' FROM `£Ã£±`) FROM `£Ô£¶`; +£Ã£± TRIM(BOTH '°¡' FROM `£Ã£±`) + íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà +°¡°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡ íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡°¡ íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£¶`; +£Ã£± TRIM(`£Ã£±`) + íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà °¡°¡°¡íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡ °¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡ +°¡°¡íÜíÝíÞíßíà °¡°¡íÜíÝíÞíßíà +°¡íÜíÝíÞíßíà °¡íÜíÝíÞíßíà +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡ íÜíÝíÞíßíà°¡ +íÜíÝíÞíßíà°¡°¡ íÜíÝíÞíßíà°¡°¡ +íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà°¡°¡°¡ +SELECT `£Ã£±`,TRIM(TRAILING '޶' FROM `£Ã£±`) FROM `£Ô£·`; +£Ã£± TRIM(TRAILING '޶' FROM `£Ã£±`) +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵޶ ޱ޲޳޴޵ +ޱ޲޳޴޵޶޶ ޱ޲޳޴޵ +ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵ +޶ޱ޲޳޴޵ ޶ޱ޲޳޴޵ +޶޶ޱ޲޳޴޵ ޶޶ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵ ޶޶޶ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵޶޶޶ ޶޶޶ޱ޲޳޴޵ + ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`,TRIM(LEADING '޶' FROM `£Ã£±`) FROM `£Ô£·`; +£Ã£± TRIM(LEADING '޶' FROM `£Ã£±`) +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵޶ ޱ޲޳޴޵޶ +ޱ޲޳޴޵޶޶ ޱ޲޳޴޵޶޶ +ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵޶޶޶ +޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵޶޶޶ + ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`,TRIM(BOTH '޶' FROM `£Ã£±`) FROM `£Ô£·`; +£Ã£± TRIM(BOTH '޶' FROM `£Ã£±`) +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵޶ ޱ޲޳޴޵ +ޱ޲޳޴޵޶޶ ޱ޲޳޴޵ +ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵ +޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵ + ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£·`; +£Ã£± TRIM(`£Ã£±`) +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵޶ ޱ޲޳޴޵޶ +ޱ޲޳޴޵޶޶ ޱ޲޳޴޵޶޶ +ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵޶޶޶ +޶ޱ޲޳޴޵ ޶ޱ޲޳޴޵ +޶޶ޱ޲޳޴޵ ޶޶ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵ ޶޶޶ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵޶޶޶ ޶޶޶ޱ޲޳޴޵޶޶޶ + ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`,TRIM(TRAILING '¤«' FROM `£Ã£±`) FROM `£Ô£¸`; +£Ã£± TRIM(TRAILING '¤«' FROM `£Ã£±`) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤« ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤«¤« ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª +¤«¤¢¤¤¤¦¤¨¤ª ¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤¢¤¤¤¦¤¨¤ª ¤«¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª ¤«¤«¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤«¤«¤«¤¢¤¤¤¦¤¨¤ª + ¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`,TRIM(LEADING '¤«' FROM `£Ã£±`) FROM `£Ô£¸`; +£Ã£± TRIM(LEADING '¤«' FROM `£Ã£±`) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤« ¤¢¤¤¤¦¤¨¤ª¤« +¤¢¤¤¤¦¤¨¤ª¤«¤« ¤¢¤¤¤¦¤¨¤ª¤«¤« +¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª¤«¤«¤« +¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª¤«¤«¤« + ¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`,TRIM(BOTH '¤«' FROM `£Ã£±`) FROM `£Ô£¸`; +£Ã£± TRIM(BOTH '¤«' FROM `£Ã£±`) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤« ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤«¤« ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª +¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª + ¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£¸`; +£Ã£± TRIM(`£Ã£±`) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤« ¤¢¤¤¤¦¤¨¤ª¤« +¤¢¤¤¤¦¤¨¤ª¤«¤« ¤¢¤¤¤¦¤¨¤ª¤«¤« +¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª¤«¤«¤« +¤«¤¢¤¤¤¦¤¨¤ª ¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤¢¤¤¤¦¤¨¤ª ¤«¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª ¤«¤«¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤« + ¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`,TRIM(TRAILING '°¡' FROM `£Ã£±`) FROM `£Ô£¹`; +£Ã£± TRIM(TRAILING '°¡' FROM `£Ã£±`) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡ íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡°¡ íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà +°¡íÜíÝíÞíßíà °¡íÜíÝíÞíßíà +°¡°¡íÜíÝíÞíßíà °¡°¡íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà °¡°¡°¡íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡ °¡°¡°¡íÜíÝíÞíßíà + íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`,TRIM(LEADING '°¡' FROM `£Ã£±`) FROM `£Ô£¹`; +£Ã£± TRIM(LEADING '°¡' FROM `£Ã£±`) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡ íÜíÝíÞíßíà°¡ +íÜíÝíÞíßíà°¡°¡ íÜíÝíÞíßíà°¡°¡ +íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà°¡°¡°¡ +°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà°¡°¡°¡ + íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`,TRIM(BOTH '°¡' FROM `£Ã£±`) FROM `£Ô£¹`; +£Ã£± TRIM(BOTH '°¡' FROM `£Ã£±`) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡ íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡°¡ íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà +°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà + íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£¹`; +£Ã£± TRIM(`£Ã£±`) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡ íÜíÝíÞíßíà°¡ +íÜíÝíÞíßíà°¡°¡ íÜíÝíÞíßíà°¡°¡ +íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà°¡°¡°¡ +°¡íÜíÝíÞíßíà °¡íÜíÝíÞíßíà +°¡°¡íÜíÝíÞíßíà °¡°¡íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà °¡°¡°¡íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡ °¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡ + íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`,TRIM(TRAILING '޶' FROM `£Ã£±`) FROM `£Ô£±£°`; +£Ã£± TRIM(TRAILING '޶' FROM `£Ã£±`) +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵޶ ޱ޲޳޴޵ +ޱ޲޳޴޵޶޶ ޱ޲޳޴޵ +ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵ +޶ޱ޲޳޴޵ ޶ޱ޲޳޴޵ +޶޶ޱ޲޳޴޵ ޶޶ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵ ޶޶޶ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵޶޶޶ ޶޶޶ޱ޲޳޴޵ + ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`,TRIM(LEADING '޶' FROM `£Ã£±`) FROM `£Ô£±£°`; +£Ã£± TRIM(LEADING '޶' FROM `£Ã£±`) +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵޶ ޱ޲޳޴޵޶ +ޱ޲޳޴޵޶޶ ޱ޲޳޴޵޶޶ +ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵޶޶޶ +޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵޶޶޶ + ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`,TRIM(BOTH '޶' FROM `£Ã£±`) FROM `£Ô£±£°`; +£Ã£± TRIM(BOTH '޶' FROM `£Ã£±`) +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵޶ ޱ޲޳޴޵ +ޱ޲޳޴޵޶޶ ޱ޲޳޴޵ +ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵ +޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵ ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵ + ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£±£°`; +£Ã£± TRIM(`£Ã£±`) +ޱ޲޳޴޵ ޱ޲޳޴޵ +ޱ޲޳޴޵޶ ޱ޲޳޴޵޶ +ޱ޲޳޴޵޶޶ ޱ޲޳޴޵޶޶ +ޱ޲޳޴޵޶޶޶ ޱ޲޳޴޵޶޶޶ +޶ޱ޲޳޴޵ ޶ޱ޲޳޴޵ +޶޶ޱ޲޳޴޵ ޶޶ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵ ޶޶޶ޱ޲޳޴޵ +޶޶޶ޱ޲޳޴޵޶޶޶ ޶޶޶ޱ޲޳޴޵޶޶޶ + ޱ޲޳޴޵ ޱ޲޳޴޵ +SELECT `£Ã£±`,TRIM(TRAILING '¤«' FROM `£Ã£±`) FROM `£Ô£±£±`; +£Ã£± TRIM(TRAILING '¤«' FROM `£Ã£±`) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤« ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤«¤« ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª +¤«¤¢¤¤¤¦¤¨¤ª ¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤¢¤¤¤¦¤¨¤ª ¤«¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª ¤«¤«¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤«¤«¤«¤¢¤¤¤¦¤¨¤ª + ¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`,TRIM(LEADING '¤«' FROM `£Ã£±`) FROM `£Ô£±£±`; +£Ã£± TRIM(LEADING '¤«' FROM `£Ã£±`) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤« ¤¢¤¤¤¦¤¨¤ª¤« +¤¢¤¤¤¦¤¨¤ª¤«¤« ¤¢¤¤¤¦¤¨¤ª¤«¤« +¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª¤«¤«¤« +¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª¤«¤«¤« + ¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`,TRIM(BOTH '¤«' FROM `£Ã£±`) FROM `£Ô£±£±`; +£Ã£± TRIM(BOTH '¤«' FROM `£Ã£±`) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤« ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤«¤« ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª +¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª + ¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£±£±`; +£Ã£± TRIM(`£Ã£±`) +¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +¤¢¤¤¤¦¤¨¤ª¤« ¤¢¤¤¤¦¤¨¤ª¤« +¤¢¤¤¤¦¤¨¤ª¤«¤« ¤¢¤¤¤¦¤¨¤ª¤«¤« +¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤¢¤¤¤¦¤¨¤ª¤«¤«¤« +¤«¤¢¤¤¤¦¤¨¤ª ¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤¢¤¤¤¦¤¨¤ª ¤«¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª ¤«¤«¤«¤¢¤¤¤¦¤¨¤ª +¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤« ¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤« + ¤¢¤¤¤¦¤¨¤ª ¤¢¤¤¤¦¤¨¤ª +SELECT `£Ã£±`,TRIM(TRAILING '°¡' FROM `£Ã£±`) FROM `£Ô£±£²`; +£Ã£± TRIM(TRAILING '°¡' FROM `£Ã£±`) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡ íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡°¡ íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà +°¡íÜíÝíÞíßíà °¡íÜíÝíÞíßíà +°¡°¡íÜíÝíÞíßíà °¡°¡íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà °¡°¡°¡íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡ °¡°¡°¡íÜíÝíÞíßíà + íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`,TRIM(LEADING '°¡' FROM `£Ã£±`) FROM `£Ô£±£²`; +£Ã£± TRIM(LEADING '°¡' FROM `£Ã£±`) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡ íÜíÝíÞíßíà°¡ +íÜíÝíÞíßíà°¡°¡ íÜíÝíÞíßíà°¡°¡ +íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà°¡°¡°¡ +°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà°¡°¡°¡ + íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`,TRIM(BOTH '°¡' FROM `£Ã£±`) FROM `£Ô£±£²`; +£Ã£± TRIM(BOTH '°¡' FROM `£Ã£±`) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡ íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡°¡ íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà +°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà + íÜíÝíÞíßíà íÜíÝíÞíßíà +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£±£²`; +£Ã£± TRIM(`£Ã£±`) +íÜíÝíÞíßíà íÜíÝíÞíßíà +íÜíÝíÞíßíà°¡ íÜíÝíÞíßíà°¡ +íÜíÝíÞíßíà°¡°¡ íÜíÝíÞíßíà°¡°¡ +íÜíÝíÞíßíà°¡°¡°¡ íÜíÝíÞíßíà°¡°¡°¡ +°¡íÜíÝíÞíßíà °¡íÜíÝíÞíßíà +°¡°¡íÜíÝíÞíßíà °¡°¡íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà °¡°¡°¡íÜíÝíÞíßíà +°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡ °¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡ + íÜíÝíÞíßíà íÜíÝíÞíßíà +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/r/jp_trim_utf8.result b/mysql-test/suite/jp/r/jp_trim_utf8.result new file mode 100755 index 00000000000..99fb785e495 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_trim_utf8.result @@ -0,0 +1,672 @@ +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +SET NAMES utf8; +SET character_set_database = utf8; +CREATE TABLE `T1` (`C1` char(12), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’` (`C1` char(12), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3` (`C1` char(12), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”` (`C1` char(12), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5` (`C1` char(12), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–` (`C1` char(12), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—` (`C1` char(12), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8` (`C1` char(12), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™` (`C1` char(12), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼` (`C1` char(12), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T11` (`C1` char(12), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T12` (`C1` char(12), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +INSERT INTO `T1` VALUES ('アイウエオ'); +INSERT INTO `T1` VALUES ('アイウエオカ'); +INSERT INTO `T1` VALUES ('アイウエオカカ'); +INSERT INTO `T1` VALUES ('アイウエオカカカ'); +INSERT INTO `T1` VALUES ('カアイウエオ'); +INSERT INTO `T1` VALUES ('カカアイウエオ'); +INSERT INTO `T1` VALUES ('カカカアイウエオ'); +INSERT INTO `T1` VALUES ('カカカアイウエオカカカ'); +INSERT INTO `T1` VALUES (' アイウエオ '); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠã‹'); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠã‹ã‹'); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠã‹ã‹ã‹'); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‹ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‹ã‹ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‹ã‹ã‹ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‹ã‹ã‹ã‚ã„ã†ãˆãŠã‹ã‹ã‹'); +INSERT INTO `ï¼´ï¼’` VALUES (' ã‚ã„ã†ãˆãŠ '); +INSERT INTO `T3` VALUES ('龔龖龗龞龡'); +INSERT INTO `T3` VALUES ('龔龖龗龞龡丂'); +INSERT INTO `T3` VALUES ('龔龖龗龞龡丂丂'); +INSERT INTO `T3` VALUES ('龔龖龗龞龡丂丂丂'); +INSERT INTO `T3` VALUES ('丂龔龖龗龞龡'); +INSERT INTO `T3` VALUES ('丂丂龔龖龗龞龡'); +INSERT INTO `T3` VALUES ('丂丂丂龔龖龗龞龡'); +INSERT INTO `T3` VALUES ('丂丂丂龔龖龗龞龡丂丂丂'); +INSERT INTO `T3` VALUES (' 龔龖龗龞龡 '); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオ'); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオカ'); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオカカ'); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオカカカ'); +INSERT INTO `ï¼´ï¼”` VALUES ('カアイウエオ'); +INSERT INTO `ï¼´ï¼”` VALUES ('カカアイウエオ'); +INSERT INTO `ï¼´ï¼”` VALUES ('カカカアイウエオ'); +INSERT INTO `ï¼´ï¼”` VALUES ('カカカアイウエオカカカ'); +INSERT INTO `ï¼´ï¼”` VALUES (' アイウエオ '); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠã‹'); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠã‹ã‹'); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠã‹ã‹ã‹'); +INSERT INTO `T5` VALUES ('ã‹ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T5` VALUES ('ã‹ã‹ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T5` VALUES ('ã‹ã‹ã‹ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T5` VALUES ('ã‹ã‹ã‹ã‚ã„ã†ãˆãŠã‹ã‹ã‹'); +INSERT INTO `T5` VALUES (' ã‚ã„ã†ãˆãŠ '); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡丂'); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡丂丂'); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡丂丂丂'); +INSERT INTO `ï¼´ï¼–` VALUES ('丂龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼–` VALUES ('丂丂龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼–` VALUES ('丂丂丂龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼–` VALUES ('丂丂丂龔龖龗龞龡丂丂丂'); +INSERT INTO `ï¼´ï¼–` VALUES (' 龔龖龗龞龡 '); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオ'); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオカ'); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオカカ'); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオカカカ'); +INSERT INTO `ï¼´ï¼—` VALUES ('カアイウエオ'); +INSERT INTO `ï¼´ï¼—` VALUES ('カカアイウエオ'); +INSERT INTO `ï¼´ï¼—` VALUES ('カカカアイウエオ'); +INSERT INTO `ï¼´ï¼—` VALUES ('カカカアイウエオカカカ'); +INSERT INTO `ï¼´ï¼—` VALUES (' アイウエオ '); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠã‹'); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠã‹ã‹'); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠã‹ã‹ã‹'); +INSERT INTO `T8` VALUES ('ã‹ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T8` VALUES ('ã‹ã‹ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T8` VALUES ('ã‹ã‹ã‹ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T8` VALUES ('ã‹ã‹ã‹ã‚ã„ã†ãˆãŠã‹ã‹ã‹'); +INSERT INTO `T8` VALUES (' ã‚ã„ã†ãˆãŠ '); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡丂'); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡丂丂'); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡丂丂丂'); +INSERT INTO `ï¼´ï¼™` VALUES ('丂龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼™` VALUES ('丂丂龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼™` VALUES ('丂丂丂龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼™` VALUES ('丂丂丂龔龖龗龞龡丂丂丂'); +INSERT INTO `ï¼´ï¼™` VALUES (' 龔龖龗龞龡 '); +INSERT INTO `T1ï¼` VALUES ('アイウエオ'); +INSERT INTO `T1ï¼` VALUES ('アイウエオカ'); +INSERT INTO `T1ï¼` VALUES ('アイウエオカカ'); +INSERT INTO `T1ï¼` VALUES ('アイウエオカカカ'); +INSERT INTO `T1ï¼` VALUES ('カアイウエオ'); +INSERT INTO `T1ï¼` VALUES ('カカアイウエオ'); +INSERT INTO `T1ï¼` VALUES ('カカカアイウエオ'); +INSERT INTO `T1ï¼` VALUES ('カカカアイウエオカカカ'); +INSERT INTO `T1ï¼` VALUES (' アイウエオ '); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠã‹'); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠã‹ã‹'); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠã‹ã‹ã‹'); +INSERT INTO `T11` VALUES ('ã‹ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T11` VALUES ('ã‹ã‹ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T11` VALUES ('ã‹ã‹ã‹ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T11` VALUES ('ã‹ã‹ã‹ã‚ã„ã†ãˆãŠã‹ã‹ã‹'); +INSERT INTO `T11` VALUES (' ã‚ã„ã†ãˆãŠ '); +INSERT INTO `T12` VALUES ('龔龖龗龞龡'); +INSERT INTO `T12` VALUES ('龔龖龗龞龡丂'); +INSERT INTO `T12` VALUES ('龔龖龗龞龡丂丂'); +INSERT INTO `T12` VALUES ('龔龖龗龞龡丂丂丂'); +INSERT INTO `T12` VALUES ('丂龔龖龗龞龡'); +INSERT INTO `T12` VALUES ('丂丂龔龖龗龞龡'); +INSERT INTO `T12` VALUES ('丂丂丂龔龖龗龞龡'); +INSERT INTO `T12` VALUES ('丂丂丂龔龖龗龞龡丂丂丂'); +INSERT INTO `T12` VALUES (' 龔龖龗龞龡 '); +SELECT `C1`,TRIM(TRAILING 'ï½¶' FROM `C1`) FROM `T1`; +C1 TRIM(TRAILING 'ï½¶' FROM `C1`) + アイウエオ アイウエオ +アイウエオ アイウエオ +アイウエオカ アイウエオ +アイウエオカカ アイウエオ +アイウエオカカカ アイウエオ +カアイウエオ カアイウエオ +カカアイウエオ カカアイウエオ +カカカアイウエオ カカカアイウエオ +カカカアイウエオカカカ カカカアイウエオ +SELECT `C1`,TRIM(LEADING 'ï½¶' FROM `C1`) FROM `T1`; +C1 TRIM(LEADING 'ï½¶' FROM `C1`) + アイウエオ アイウエオ +アイウエオ アイウエオ +アイウエオカ アイウエオカ +アイウエオカカ アイウエオカカ +アイウエオカカカ アイウエオカカカ +カアイウエオ アイウエオ +カカアイウエオ アイウエオ +カカカアイウエオ アイウエオ +カカカアイウエオカカカ アイウエオカカカ +SELECT `C1`,TRIM(BOTH 'ï½¶' FROM `C1`) FROM `T1`; +C1 TRIM(BOTH 'ï½¶' FROM `C1`) + アイウエオ アイウエオ +アイウエオ アイウエオ +アイウエオカ アイウエオ +アイウエオカカ アイウエオ +アイウエオカカカ アイウエオ +カアイウエオ アイウエオ +カカアイウエオ アイウエオ +カカカアイウエオ アイウエオ +カカカアイウエオカカカ アイウエオ +SELECT `C1`,TRIM(`C1`) FROM `T1`; +C1 TRIM(`C1`) + アイウエオ アイウエオ +アイウエオ アイウエオ +アイウエオカ アイウエオカ +アイウエオカカ アイウエオカカ +アイウエオカカカ アイウエオカカカ +カアイウエオ カアイウエオ +カカアイウエオ カカアイウエオ +カカカアイウエオ カカカアイウエオ +カカカアイウエオカカカ カカカアイウエオカカカ +SELECT `C1`,TRIM(TRAILING 'ã‹' FROM `C1`) FROM `ï¼´ï¼’`; +C1 TRIM(TRAILING 'ã‹' FROM `C1`) + ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠã‹ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠã‹ã‹ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠã‹ã‹ã‹ ã‚ã„ã†ãˆãŠ +ã‹ã‚ã„ã†ãˆãŠ ã‹ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‚ã„ã†ãˆãŠ ã‹ã‹ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‹ã‚ã„ã†ãˆãŠ ã‹ã‹ã‹ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‹ã‚ã„ã†ãˆãŠã‹ã‹ã‹ ã‹ã‹ã‹ã‚ã„ã†ãˆãŠ +SELECT `C1`,TRIM(LEADING 'ã‹' FROM `C1`) FROM `ï¼´ï¼’`; +C1 TRIM(LEADING 'ã‹' FROM `C1`) + ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠã‹ ã‚ã„ã†ãˆãŠã‹ +ã‚ã„ã†ãˆãŠã‹ã‹ ã‚ã„ã†ãˆãŠã‹ã‹ +ã‚ã„ã†ãˆãŠã‹ã‹ã‹ ã‚ã„ã†ãˆãŠã‹ã‹ã‹ +ã‹ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‹ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‹ã‚ã„ã†ãˆãŠã‹ã‹ã‹ ã‚ã„ã†ãˆãŠã‹ã‹ã‹ +SELECT `C1`,TRIM(BOTH 'ã‹' FROM `C1`) FROM `ï¼´ï¼’`; +C1 TRIM(BOTH 'ã‹' FROM `C1`) + ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠã‹ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠã‹ã‹ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠã‹ã‹ã‹ ã‚ã„ã†ãˆãŠ +ã‹ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‹ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‹ã‚ã„ã†ãˆãŠã‹ã‹ã‹ ã‚ã„ã†ãˆãŠ +SELECT `C1`,TRIM(`C1`) FROM `ï¼´ï¼’`; +C1 TRIM(`C1`) + ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠã‹ ã‚ã„ã†ãˆãŠã‹ +ã‚ã„ã†ãˆãŠã‹ã‹ ã‚ã„ã†ãˆãŠã‹ã‹ +ã‚ã„ã†ãˆãŠã‹ã‹ã‹ ã‚ã„ã†ãˆãŠã‹ã‹ã‹ +ã‹ã‚ã„ã†ãˆãŠ ã‹ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‚ã„ã†ãˆãŠ ã‹ã‹ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‹ã‚ã„ã†ãˆãŠ ã‹ã‹ã‹ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‹ã‚ã„ã†ãˆãŠã‹ã‹ã‹ ã‹ã‹ã‹ã‚ã„ã†ãˆãŠã‹ã‹ã‹ +SELECT `C1`,TRIM(TRAILING '丂'FROM `C1`) FROM `T3`; +C1 TRIM(TRAILING '丂'FROM `C1`) + 龔龖龗龞龡 龔龖龗龞龡 +丂丂丂龔龖龗龞龡 丂丂丂龔龖龗龞龡 +丂丂丂龔龖龗龞龡丂丂丂 丂丂丂龔龖龗龞龡 +丂丂龔龖龗龞龡 丂丂龔龖龗龞龡 +丂龔龖龗龞龡 丂龔龖龗龞龡 +龔龖龗龞龡 龔龖龗龞龡 +龔龖龗龞龡丂 龔龖龗龞龡 +龔龖龗龞龡丂丂 龔龖龗龞龡 +龔龖龗龞龡丂丂丂 龔龖龗龞龡 +SELECT `C1`,TRIM(LEADING '丂' FROM `C1`) FROM `T3`; +C1 TRIM(LEADING '丂' FROM `C1`) + 龔龖龗龞龡 龔龖龗龞龡 +丂丂丂龔龖龗龞龡 龔龖龗龞龡 +丂丂丂龔龖龗龞龡丂丂丂 龔龖龗龞龡丂丂丂 +丂丂龔龖龗龞龡 龔龖龗龞龡 +丂龔龖龗龞龡 龔龖龗龞龡 +龔龖龗龞龡 龔龖龗龞龡 +龔龖龗龞龡丂 龔龖龗龞龡丂 +龔龖龗龞龡丂丂 龔龖龗龞龡丂丂 +龔龖龗龞龡丂丂丂 龔龖龗龞龡丂丂丂 +SELECT `C1`,TRIM(BOTH '丂' FROM `C1`) FROM `T3`; +C1 TRIM(BOTH '丂' FROM `C1`) + 龔龖龗龞龡 龔龖龗龞龡 +丂丂丂龔龖龗龞龡 龔龖龗龞龡 +丂丂丂龔龖龗龞龡丂丂丂 龔龖龗龞龡 +丂丂龔龖龗龞龡 龔龖龗龞龡 +丂龔龖龗龞龡 龔龖龗龞龡 +龔龖龗龞龡 龔龖龗龞龡 +龔龖龗龞龡丂 龔龖龗龞龡 +龔龖龗龞龡丂丂 龔龖龗龞龡 +龔龖龗龞龡丂丂丂 龔龖龗龞龡 +SELECT `C1`,TRIM(`C1`) FROM `T3`; +C1 TRIM(`C1`) + 龔龖龗龞龡 龔龖龗龞龡 +丂丂丂龔龖龗龞龡 丂丂丂龔龖龗龞龡 +丂丂丂龔龖龗龞龡丂丂丂 丂丂丂龔龖龗龞龡丂丂丂 +丂丂龔龖龗龞龡 丂丂龔龖龗龞龡 +丂龔龖龗龞龡 丂龔龖龗龞龡 +龔龖龗龞龡 龔龖龗龞龡 +龔龖龗龞龡丂 龔龖龗龞龡丂 +龔龖龗龞龡丂丂 龔龖龗龞龡丂丂 +龔龖龗龞龡丂丂丂 龔龖龗龞龡丂丂丂 +SELECT `C1`,TRIM(TRAILING 'ï½¶' FROM `C1`) FROM `ï¼´ï¼”`; +C1 TRIM(TRAILING 'ï½¶' FROM `C1`) + アイウエオ アイウエオ +アイウエオ アイウエオ +アイウエオカ アイウエオ +アイウエオカカ アイウエオ +アイウエオカカカ アイウエオ +カアイウエオ カアイウエオ +カカアイウエオ カカアイウエオ +カカカアイウエオ カカカアイウエオ +カカカアイウエオカカカ カカカアイウエオ +SELECT `C1`,TRIM(LEADING 'ï½¶' FROM `C1`) FROM `ï¼´ï¼”`; +C1 TRIM(LEADING 'ï½¶' FROM `C1`) + アイウエオ アイウエオ +アイウエオ アイウエオ +アイウエオカ アイウエオカ +アイウエオカカ アイウエオカカ +アイウエオカカカ アイウエオカカカ +カアイウエオ アイウエオ +カカアイウエオ アイウエオ +カカカアイウエオ アイウエオ +カカカアイウエオカカカ アイウエオカカカ +SELECT `C1`,TRIM(BOTH 'ï½¶' FROM `C1`) FROM `ï¼´ï¼”`; +C1 TRIM(BOTH 'ï½¶' FROM `C1`) + アイウエオ アイウエオ +アイウエオ アイウエオ +アイウエオカ アイウエオ +アイウエオカカ アイウエオ +アイウエオカカカ アイウエオ +カアイウエオ アイウエオ +カカアイウエオ アイウエオ +カカカアイウエオ アイウエオ +カカカアイウエオカカカ アイウエオ +SELECT `C1`,TRIM(`C1`) FROM `ï¼´ï¼”`; +C1 TRIM(`C1`) + アイウエオ アイウエオ +アイウエオ アイウエオ +アイウエオカ アイウエオカ +アイウエオカカ アイウエオカカ +アイウエオカカカ アイウエオカカカ +カアイウエオ カアイウエオ +カカアイウエオ カカアイウエオ +カカカアイウエオ カカカアイウエオ +カカカアイウエオカカカ カカカアイウエオカカカ +SELECT `C1`,TRIM(TRAILING 'ã‹' FROM `C1`) FROM `T5`; +C1 TRIM(TRAILING 'ã‹' FROM `C1`) + ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠã‹ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠã‹ã‹ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠã‹ã‹ã‹ ã‚ã„ã†ãˆãŠ +ã‹ã‚ã„ã†ãˆãŠ ã‹ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‚ã„ã†ãˆãŠ ã‹ã‹ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‹ã‚ã„ã†ãˆãŠ ã‹ã‹ã‹ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‹ã‚ã„ã†ãˆãŠã‹ã‹ã‹ ã‹ã‹ã‹ã‚ã„ã†ãˆãŠ +SELECT `C1`,TRIM(LEADING 'ã‹' FROM `C1`) FROM `T5`; +C1 TRIM(LEADING 'ã‹' FROM `C1`) + ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠã‹ ã‚ã„ã†ãˆãŠã‹ +ã‚ã„ã†ãˆãŠã‹ã‹ ã‚ã„ã†ãˆãŠã‹ã‹ +ã‚ã„ã†ãˆãŠã‹ã‹ã‹ ã‚ã„ã†ãˆãŠã‹ã‹ã‹ +ã‹ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‹ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‹ã‚ã„ã†ãˆãŠã‹ã‹ã‹ ã‚ã„ã†ãˆãŠã‹ã‹ã‹ +SELECT `C1`,TRIM(BOTH 'ã‹' FROM `C1`) FROM `T5`; +C1 TRIM(BOTH 'ã‹' FROM `C1`) + ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠã‹ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠã‹ã‹ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠã‹ã‹ã‹ ã‚ã„ã†ãˆãŠ +ã‹ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‹ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‹ã‚ã„ã†ãˆãŠã‹ã‹ã‹ ã‚ã„ã†ãˆãŠ +SELECT `C1`,TRIM(`C1`) FROM `T5`; +C1 TRIM(`C1`) + ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠã‹ ã‚ã„ã†ãˆãŠã‹ +ã‚ã„ã†ãˆãŠã‹ã‹ ã‚ã„ã†ãˆãŠã‹ã‹ +ã‚ã„ã†ãˆãŠã‹ã‹ã‹ ã‚ã„ã†ãˆãŠã‹ã‹ã‹ +ã‹ã‚ã„ã†ãˆãŠ ã‹ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‚ã„ã†ãˆãŠ ã‹ã‹ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‹ã‚ã„ã†ãˆãŠ ã‹ã‹ã‹ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‹ã‚ã„ã†ãˆãŠã‹ã‹ã‹ ã‹ã‹ã‹ã‚ã„ã†ãˆãŠã‹ã‹ã‹ +SELECT `C1`,TRIM(TRAILING '丂' FROM `C1`) FROM `ï¼´ï¼–`; +C1 TRIM(TRAILING '丂' FROM `C1`) + 龔龖龗龞龡 龔龖龗龞龡 +丂丂丂龔龖龗龞龡 丂丂丂龔龖龗龞龡 +丂丂丂龔龖龗龞龡丂丂丂 丂丂丂龔龖龗龞龡 +丂丂龔龖龗龞龡 丂丂龔龖龗龞龡 +丂龔龖龗龞龡 丂龔龖龗龞龡 +龔龖龗龞龡 龔龖龗龞龡 +龔龖龗龞龡丂 龔龖龗龞龡 +龔龖龗龞龡丂丂 龔龖龗龞龡 +龔龖龗龞龡丂丂丂 龔龖龗龞龡 +SELECT `C1`,TRIM(LEADING '丂' FROM `C1`) FROM `ï¼´ï¼–`; +C1 TRIM(LEADING '丂' FROM `C1`) + 龔龖龗龞龡 龔龖龗龞龡 +丂丂丂龔龖龗龞龡 龔龖龗龞龡 +丂丂丂龔龖龗龞龡丂丂丂 龔龖龗龞龡丂丂丂 +丂丂龔龖龗龞龡 龔龖龗龞龡 +丂龔龖龗龞龡 龔龖龗龞龡 +龔龖龗龞龡 龔龖龗龞龡 +龔龖龗龞龡丂 龔龖龗龞龡丂 +龔龖龗龞龡丂丂 龔龖龗龞龡丂丂 +龔龖龗龞龡丂丂丂 龔龖龗龞龡丂丂丂 +SELECT `C1`,TRIM(BOTH '丂' FROM `C1`) FROM `ï¼´ï¼–`; +C1 TRIM(BOTH '丂' FROM `C1`) + 龔龖龗龞龡 龔龖龗龞龡 +丂丂丂龔龖龗龞龡 龔龖龗龞龡 +丂丂丂龔龖龗龞龡丂丂丂 龔龖龗龞龡 +丂丂龔龖龗龞龡 龔龖龗龞龡 +丂龔龖龗龞龡 龔龖龗龞龡 +龔龖龗龞龡 龔龖龗龞龡 +龔龖龗龞龡丂 龔龖龗龞龡 +龔龖龗龞龡丂丂 龔龖龗龞龡 +龔龖龗龞龡丂丂丂 龔龖龗龞龡 +SELECT `C1`,TRIM(`C1`) FROM `ï¼´ï¼–`; +C1 TRIM(`C1`) + 龔龖龗龞龡 龔龖龗龞龡 +丂丂丂龔龖龗龞龡 丂丂丂龔龖龗龞龡 +丂丂丂龔龖龗龞龡丂丂丂 丂丂丂龔龖龗龞龡丂丂丂 +丂丂龔龖龗龞龡 丂丂龔龖龗龞龡 +丂龔龖龗龞龡 丂龔龖龗龞龡 +龔龖龗龞龡 龔龖龗龞龡 +龔龖龗龞龡丂 龔龖龗龞龡丂 +龔龖龗龞龡丂丂 龔龖龗龞龡丂丂 +龔龖龗龞龡丂丂丂 龔龖龗龞龡丂丂丂 +SELECT `C1`,TRIM(TRAILING 'ï½¶' FROM `C1`) FROM `ï¼´ï¼—`; +C1 TRIM(TRAILING 'ï½¶' FROM `C1`) +アイウエオ アイウエオ +アイウエオカ アイウエオ +アイウエオカカ アイウエオ +アイウエオカカカ アイウエオ +カアイウエオ カアイウエオ +カカアイウエオ カカアイウエオ +カカカアイウエオ カカカアイウエオ +カカカアイウエオカカカ カカカアイウエオ + アイウエオ アイウエオ +SELECT `C1`,TRIM(LEADING 'ï½¶' FROM `C1`) FROM `ï¼´ï¼—`; +C1 TRIM(LEADING 'ï½¶' FROM `C1`) +アイウエオ アイウエオ +アイウエオカ アイウエオカ +アイウエオカカ アイウエオカカ +アイウエオカカカ アイウエオカカカ +カアイウエオ アイウエオ +カカアイウエオ アイウエオ +カカカアイウエオ アイウエオ +カカカアイウエオカカカ アイウエオカカカ + アイウエオ アイウエオ +SELECT `C1`,TRIM(BOTH 'ï½¶' FROM `C1`) FROM `ï¼´ï¼—`; +C1 TRIM(BOTH 'ï½¶' FROM `C1`) +アイウエオ アイウエオ +アイウエオカ アイウエオ +アイウエオカカ アイウエオ +アイウエオカカカ アイウエオ +カアイウエオ アイウエオ +カカアイウエオ アイウエオ +カカカアイウエオ アイウエオ +カカカアイウエオカカカ アイウエオ + アイウエオ アイウエオ +SELECT `C1`,TRIM(`C1`) FROM `ï¼´ï¼—`; +C1 TRIM(`C1`) +アイウエオ アイウエオ +アイウエオカ アイウエオカ +アイウエオカカ アイウエオカカ +アイウエオカカカ アイウエオカカカ +カアイウエオ カアイウエオ +カカアイウエオ カカアイウエオ +カカカアイウエオ カカカアイウエオ +カカカアイウエオカカカ カカカアイウエオカカカ + アイウエオ アイウエオ +SELECT `C1`,TRIM(TRAILING 'ã‹' FROM `C1`) FROM `T8`; +C1 TRIM(TRAILING 'ã‹' FROM `C1`) +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠã‹ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠã‹ã‹ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠã‹ã‹ã‹ ã‚ã„ã†ãˆãŠ +ã‹ã‚ã„ã†ãˆãŠ ã‹ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‚ã„ã†ãˆãŠ ã‹ã‹ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‹ã‚ã„ã†ãˆãŠ ã‹ã‹ã‹ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‹ã‚ã„ã†ãˆãŠã‹ã‹ã‹ ã‹ã‹ã‹ã‚ã„ã†ãˆãŠ + ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +SELECT `C1`,TRIM(LEADING 'ã‹' FROM `C1`) FROM `T8`; +C1 TRIM(LEADING 'ã‹' FROM `C1`) +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠã‹ ã‚ã„ã†ãˆãŠã‹ +ã‚ã„ã†ãˆãŠã‹ã‹ ã‚ã„ã†ãˆãŠã‹ã‹ +ã‚ã„ã†ãˆãŠã‹ã‹ã‹ ã‚ã„ã†ãˆãŠã‹ã‹ã‹ +ã‹ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‹ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‹ã‚ã„ã†ãˆãŠã‹ã‹ã‹ ã‚ã„ã†ãˆãŠã‹ã‹ã‹ + ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +SELECT `C1`,TRIM(BOTH 'ã‹' FROM `C1`) FROM `T8`; +C1 TRIM(BOTH 'ã‹' FROM `C1`) +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠã‹ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠã‹ã‹ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠã‹ã‹ã‹ ã‚ã„ã†ãˆãŠ +ã‹ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‹ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‹ã‚ã„ã†ãˆãŠã‹ã‹ã‹ ã‚ã„ã†ãˆãŠ + ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +SELECT `C1`,TRIM(`C1`) FROM `T8`; +C1 TRIM(`C1`) +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠã‹ ã‚ã„ã†ãˆãŠã‹ +ã‚ã„ã†ãˆãŠã‹ã‹ ã‚ã„ã†ãˆãŠã‹ã‹ +ã‚ã„ã†ãˆãŠã‹ã‹ã‹ ã‚ã„ã†ãˆãŠã‹ã‹ã‹ +ã‹ã‚ã„ã†ãˆãŠ ã‹ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‚ã„ã†ãˆãŠ ã‹ã‹ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‹ã‚ã„ã†ãˆãŠ ã‹ã‹ã‹ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‹ã‚ã„ã†ãˆãŠã‹ã‹ã‹ ã‹ã‹ã‹ã‚ã„ã†ãˆãŠã‹ã‹ã‹ + ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +SELECT `C1`,TRIM(TRAILING '丂' FROM `C1`) FROM `ï¼´ï¼™`; +C1 TRIM(TRAILING '丂' FROM `C1`) +龔龖龗龞龡 龔龖龗龞龡 +龔龖龗龞龡丂 龔龖龗龞龡 +龔龖龗龞龡丂丂 龔龖龗龞龡 +龔龖龗龞龡丂丂丂 龔龖龗龞龡 +丂龔龖龗龞龡 丂龔龖龗龞龡 +丂丂龔龖龗龞龡 丂丂龔龖龗龞龡 +丂丂丂龔龖龗龞龡 丂丂丂龔龖龗龞龡 +丂丂丂龔龖龗龞龡丂丂丂 丂丂丂龔龖龗龞龡 + 龔龖龗龞龡 龔龖龗龞龡 +SELECT `C1`,TRIM(LEADING '丂' FROM `C1`) FROM `ï¼´ï¼™`; +C1 TRIM(LEADING '丂' FROM `C1`) +龔龖龗龞龡 龔龖龗龞龡 +龔龖龗龞龡丂 龔龖龗龞龡丂 +龔龖龗龞龡丂丂 龔龖龗龞龡丂丂 +龔龖龗龞龡丂丂丂 龔龖龗龞龡丂丂丂 +丂龔龖龗龞龡 龔龖龗龞龡 +丂丂龔龖龗龞龡 龔龖龗龞龡 +丂丂丂龔龖龗龞龡 龔龖龗龞龡 +丂丂丂龔龖龗龞龡丂丂丂 龔龖龗龞龡丂丂丂 + 龔龖龗龞龡 龔龖龗龞龡 +SELECT `C1`,TRIM(BOTH '丂' FROM `C1`) FROM `ï¼´ï¼™`; +C1 TRIM(BOTH '丂' FROM `C1`) +龔龖龗龞龡 龔龖龗龞龡 +龔龖龗龞龡丂 龔龖龗龞龡 +龔龖龗龞龡丂丂 龔龖龗龞龡 +龔龖龗龞龡丂丂丂 龔龖龗龞龡 +丂龔龖龗龞龡 龔龖龗龞龡 +丂丂龔龖龗龞龡 龔龖龗龞龡 +丂丂丂龔龖龗龞龡 龔龖龗龞龡 +丂丂丂龔龖龗龞龡丂丂丂 龔龖龗龞龡 + 龔龖龗龞龡 龔龖龗龞龡 +SELECT `C1`,TRIM(`C1`) FROM `ï¼´ï¼™`; +C1 TRIM(`C1`) +龔龖龗龞龡 龔龖龗龞龡 +龔龖龗龞龡丂 龔龖龗龞龡丂 +龔龖龗龞龡丂丂 龔龖龗龞龡丂丂 +龔龖龗龞龡丂丂丂 龔龖龗龞龡丂丂丂 +丂龔龖龗龞龡 丂龔龖龗龞龡 +丂丂龔龖龗龞龡 丂丂龔龖龗龞龡 +丂丂丂龔龖龗龞龡 丂丂丂龔龖龗龞龡 +丂丂丂龔龖龗龞龡丂丂丂 丂丂丂龔龖龗龞龡丂丂丂 + 龔龖龗龞龡 龔龖龗龞龡 +SELECT `C1`,TRIM(TRAILING 'ï½¶' FROM `C1`) FROM `T1ï¼`; +C1 TRIM(TRAILING 'ï½¶' FROM `C1`) +アイウエオ アイウエオ +アイウエオカ アイウエオ +アイウエオカカ アイウエオ +アイウエオカカカ アイウエオ +カアイウエオ カアイウエオ +カカアイウエオ カカアイウエオ +カカカアイウエオ カカカアイウエオ +カカカアイウエオカカカ カカカアイウエオ + アイウエオ アイウエオ +SELECT `C1`,TRIM(LEADING 'ï½¶' FROM `C1`) FROM `T1ï¼`; +C1 TRIM(LEADING 'ï½¶' FROM `C1`) +アイウエオ アイウエオ +アイウエオカ アイウエオカ +アイウエオカカ アイウエオカカ +アイウエオカカカ アイウエオカカカ +カアイウエオ アイウエオ +カカアイウエオ アイウエオ +カカカアイウエオ アイウエオ +カカカアイウエオカカカ アイウエオカカカ + アイウエオ アイウエオ +SELECT `C1`,TRIM(BOTH 'ï½¶' FROM `C1`) FROM `T1ï¼`; +C1 TRIM(BOTH 'ï½¶' FROM `C1`) +アイウエオ アイウエオ +アイウエオカ アイウエオ +アイウエオカカ アイウエオ +アイウエオカカカ アイウエオ +カアイウエオ アイウエオ +カカアイウエオ アイウエオ +カカカアイウエオ アイウエオ +カカカアイウエオカカカ アイウエオ + アイウエオ アイウエオ +SELECT `C1`,TRIM(`C1`) FROM `T1ï¼`; +C1 TRIM(`C1`) +アイウエオ アイウエオ +アイウエオカ アイウエオカ +アイウエオカカ アイウエオカカ +アイウエオカカカ アイウエオカカカ +カアイウエオ カアイウエオ +カカアイウエオ カカアイウエオ +カカカアイウエオ カカカアイウエオ +カカカアイウエオカカカ カカカアイウエオカカカ + アイウエオ アイウエオ +SELECT `C1`,TRIM(TRAILING 'ã‹' FROM `C1`) FROM `T11`; +C1 TRIM(TRAILING 'ã‹' FROM `C1`) +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠã‹ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠã‹ã‹ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠã‹ã‹ã‹ ã‚ã„ã†ãˆãŠ +ã‹ã‚ã„ã†ãˆãŠ ã‹ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‚ã„ã†ãˆãŠ ã‹ã‹ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‹ã‚ã„ã†ãˆãŠ ã‹ã‹ã‹ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‹ã‚ã„ã†ãˆãŠã‹ã‹ã‹ ã‹ã‹ã‹ã‚ã„ã†ãˆãŠ + ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +SELECT `C1`,TRIM(LEADING 'ã‹' FROM `C1`) FROM `T11`; +C1 TRIM(LEADING 'ã‹' FROM `C1`) +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠã‹ ã‚ã„ã†ãˆãŠã‹ +ã‚ã„ã†ãˆãŠã‹ã‹ ã‚ã„ã†ãˆãŠã‹ã‹ +ã‚ã„ã†ãˆãŠã‹ã‹ã‹ ã‚ã„ã†ãˆãŠã‹ã‹ã‹ +ã‹ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‹ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‹ã‚ã„ã†ãˆãŠã‹ã‹ã‹ ã‚ã„ã†ãˆãŠã‹ã‹ã‹ + ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +SELECT `C1`,TRIM(BOTH 'ã‹' FROM `C1`) FROM `T11`; +C1 TRIM(BOTH 'ã‹' FROM `C1`) +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠã‹ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠã‹ã‹ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠã‹ã‹ã‹ ã‚ã„ã†ãˆãŠ +ã‹ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‹ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‹ã‚ã„ã†ãˆãŠã‹ã‹ã‹ ã‚ã„ã†ãˆãŠ + ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +SELECT `C1`,TRIM(`C1`) FROM `T11`; +C1 TRIM(`C1`) +ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +ã‚ã„ã†ãˆãŠã‹ ã‚ã„ã†ãˆãŠã‹ +ã‚ã„ã†ãˆãŠã‹ã‹ ã‚ã„ã†ãˆãŠã‹ã‹ +ã‚ã„ã†ãˆãŠã‹ã‹ã‹ ã‚ã„ã†ãˆãŠã‹ã‹ã‹ +ã‹ã‚ã„ã†ãˆãŠ ã‹ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‚ã„ã†ãˆãŠ ã‹ã‹ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‹ã‚ã„ã†ãˆãŠ ã‹ã‹ã‹ã‚ã„ã†ãˆãŠ +ã‹ã‹ã‹ã‚ã„ã†ãˆãŠã‹ã‹ã‹ ã‹ã‹ã‹ã‚ã„ã†ãˆãŠã‹ã‹ã‹ + ã‚ã„ã†ãˆãŠ ã‚ã„ã†ãˆãŠ +SELECT `C1`,TRIM(TRAILING '丂' FROM `C1`) FROM `T12`; +C1 TRIM(TRAILING '丂' FROM `C1`) +龔龖龗龞龡 龔龖龗龞龡 +龔龖龗龞龡丂 龔龖龗龞龡 +龔龖龗龞龡丂丂 龔龖龗龞龡 +龔龖龗龞龡丂丂丂 龔龖龗龞龡 +丂龔龖龗龞龡 丂龔龖龗龞龡 +丂丂龔龖龗龞龡 丂丂龔龖龗龞龡 +丂丂丂龔龖龗龞龡 丂丂丂龔龖龗龞龡 +丂丂丂龔龖龗龞龡丂丂丂 丂丂丂龔龖龗龞龡 + 龔龖龗龞龡 龔龖龗龞龡 +SELECT `C1`,TRIM(LEADING '丂' FROM `C1`) FROM `T12`; +C1 TRIM(LEADING '丂' FROM `C1`) +龔龖龗龞龡 龔龖龗龞龡 +龔龖龗龞龡丂 龔龖龗龞龡丂 +龔龖龗龞龡丂丂 龔龖龗龞龡丂丂 +龔龖龗龞龡丂丂丂 龔龖龗龞龡丂丂丂 +丂龔龖龗龞龡 龔龖龗龞龡 +丂丂龔龖龗龞龡 龔龖龗龞龡 +丂丂丂龔龖龗龞龡 龔龖龗龞龡 +丂丂丂龔龖龗龞龡丂丂丂 龔龖龗龞龡丂丂丂 + 龔龖龗龞龡 龔龖龗龞龡 +SELECT `C1`,TRIM(BOTH '丂' FROM `C1`) FROM `T12`; +C1 TRIM(BOTH '丂' FROM `C1`) +龔龖龗龞龡 龔龖龗龞龡 +龔龖龗龞龡丂 龔龖龗龞龡 +龔龖龗龞龡丂丂 龔龖龗龞龡 +龔龖龗龞龡丂丂丂 龔龖龗龞龡 +丂龔龖龗龞龡 龔龖龗龞龡 +丂丂龔龖龗龞龡 龔龖龗龞龡 +丂丂丂龔龖龗龞龡 龔龖龗龞龡 +丂丂丂龔龖龗龞龡丂丂丂 龔龖龗龞龡 + 龔龖龗龞龡 龔龖龗龞龡 +SELECT `C1`,TRIM(`C1`) FROM `T12`; +C1 TRIM(`C1`) +龔龖龗龞龡 龔龖龗龞龡 +龔龖龗龞龡丂 龔龖龗龞龡丂 +龔龖龗龞龡丂丂 龔龖龗龞龡丂丂 +龔龖龗龞龡丂丂丂 龔龖龗龞龡丂丂丂 +丂龔龖龗龞龡 丂龔龖龗龞龡 +丂丂龔龖龗龞龡 丂丂龔龖龗龞龡 +丂丂丂龔龖龗龞龡 丂丂丂龔龖龗龞龡 +丂丂丂龔龖龗龞龡丂丂丂 丂丂丂龔龖龗龞龡丂丂丂 + 龔龖龗龞龡 龔龖龗龞龡 +DROP TABLE `T1`; +DROP TABLE `ï¼´ï¼’`; +DROP TABLE `T3`; +DROP TABLE `ï¼´ï¼”`; +DROP TABLE `T5`; +DROP TABLE `ï¼´ï¼–`; +DROP TABLE `ï¼´ï¼—`; +DROP TABLE `T8`; +DROP TABLE `ï¼´ï¼™`; +DROP TABLE `T1ï¼`; +DROP TABLE `T11`; +DROP TABLE `T12`; diff --git a/mysql-test/suite/jp/r/jp_union_ujis.result b/mysql-test/suite/jp/r/jp_union_ujis.result new file mode 100755 index 00000000000..4b74c570ffe --- /dev/null +++ b/mysql-test/suite/jp/r/jp_union_ujis.result @@ -0,0 +1,422 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +SET NAMES ujis; +SET character_set_database = ujis; +CREATE TABLE `£Ô£±` (`£Ã£±` char(1), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(1), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(1), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +INSERT INTO `£Ô£±` VALUES('ޱ'),('ޱ'),('¤¢'),('¤¢'),('íÜ'),('íÜ'); +INSERT INTO `£Ô£²` VALUES('޲'),('޲'),('¤¤'),('¤¤'),('íÝ'),('íÝ'); +INSERT INTO `£Ô£³` VALUES('޳'),('޳'),('¤¦'),('¤¦'),('íÞ'),('íÞ'); +SELECT * FROM `£Ô£±` UNION DISTINCT SELECT * FROM `£Ô£²` ORDER BY `£Ã£±`; +£Ã£± +ޱ +޲ +íÜ +íÝ +¤¢ +¤¤ +SELECT * FROM `£Ô£±` UNION ALL SELECT * FROM `£Ô£²` ORDER BY `£Ã£±`; +£Ã£± +ޱ +ޱ +޲ +޲ +íÜ +íÜ +íÝ +íÝ +¤¢ +¤¢ +¤¤ +¤¤ +(SELECT * FROM `£Ô£±`) UNION (SELECT * FROM `£Ô£²`) UNION (SELECT '¤¦') ORDER BY `£Ã£±`; +£Ã£± +ޱ +޲ +íÜ +íÝ +¤¢ +¤¤ +¤¦ +(SELECT '¤¦' AS `£Ã£±`) UNION (SELECT * FROM `£Ô£±`) UNION (SELECT * FROM `£Ô£²`) ORDER BY `£Ã£±`; +£Ã£± +ޱ +޲ +íÜ +íÝ +¤¢ +¤¤ +¤¦ +SELECT `£Ã£±`, COUNT(*) FROM `£Ô£±` GROUP BY `£Ã£±` UNION +SELECT `£Ã£±`, COUNT(*) FROM `£Ô£²` GROUP BY `£Ã£±` ORDER BY `£Ã£±`; +£Ã£± COUNT(*) +ޱ 2 +޲ 2 +íÜ 2 +íÝ 2 +¤¢ 2 +¤¤ 2 +SELECT * FROM `£Ô£±` UNION DISTINCT +SELECT * FROM `£Ô£²` UNION ALL +SELECT * FROM `£Ô£³` ORDER BY `£Ã£±`; +£Ã£± +ޱ +޲ +޳ +޳ +íÜ +íÝ +íÞ +íÞ +¤¢ +¤¤ +¤¦ +¤¦ +SELECT * FROM `£Ô£±` UNION ALL +SELECT * FROM `£Ô£²` UNION DISTINCT +SELECT * FROM `£Ô£³` ORDER BY `£Ã£±`; +£Ã£± +ޱ +޲ +޳ +íÜ +íÝ +íÞ +¤¢ +¤¤ +¤¦ +SELECT * FROM `£Ô£±` UNION SELECT REPEAT(`£Ã£±`,5) FROM `£Ô£²` ORDER BY `£Ã£±`; +£Ã£± +ޱ +޲޲޲޲޲ +íÜ +íÝíÝíÝíÝíÝ +¤¢ +¤¤¤¤¤¤¤¤¤¤ +DROP TABLE `£Ô£±` ; +DROP TABLE `£Ô£²` ; +DROP TABLE `£Ô£³` ; +CREATE TABLE `£Ô£±` (`£Ã£±` char(1), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = MYISAM; +CREATE TABLE `£Ô£²` (`£Ã£±` char(1), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = MYISAM; +CREATE TABLE `£Ô£³` (`£Ã£±` char(1), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = MYISAM; +INSERT INTO `£Ô£±` VALUES('ޱ'),('ޱ'),('¤¢'),('¤¢'),('íÜ'),('íÜ'); +INSERT INTO `£Ô£²` VALUES('޲'),('޲'),('¤¤'),('¤¤'),('íÝ'),('íÝ'); +INSERT INTO `£Ô£³` VALUES('޳'),('޳'),('¤¦'),('¤¦'),('íÞ'),('íÞ'); +SELECT * FROM `£Ô£±` UNION DISTINCT SELECT * FROM `£Ô£²` ORDER BY `£Ã£±`; +£Ã£± +ޱ +޲ +íÜ +íÝ +¤¢ +¤¤ +SELECT * FROM `£Ô£±` UNION ALL SELECT * FROM `£Ô£²` ORDER BY `£Ã£±`; +£Ã£± +ޱ +ޱ +޲ +޲ +íÜ +íÜ +íÝ +íÝ +¤¢ +¤¢ +¤¤ +¤¤ +(SELECT * FROM `£Ô£±`) UNION (SELECT * FROM `£Ô£²`) UNION (SELECT '¤¦') ORDER BY `£Ã£±`; +£Ã£± +ޱ +޲ +íÜ +íÝ +¤¢ +¤¤ +¤¦ +(SELECT '¤¦' AS `£Ã£±`) UNION (SELECT * FROM `£Ô£±`) UNION (SELECT * FROM `£Ô£²`) ORDER BY `£Ã£±`; +£Ã£± +ޱ +޲ +íÜ +íÝ +¤¢ +¤¤ +¤¦ +SELECT `£Ã£±`, COUNT(*) FROM `£Ô£±` GROUP BY `£Ã£±` UNION +SELECT `£Ã£±`, COUNT(*) FROM `£Ô£²` GROUP BY `£Ã£±` ORDER BY `£Ã£±`; +£Ã£± COUNT(*) +ޱ 2 +޲ 2 +íÜ 2 +íÝ 2 +¤¢ 2 +¤¤ 2 +SELECT * FROM `£Ô£±` UNION DISTINCT +SELECT * FROM `£Ô£²` UNION ALL +SELECT * FROM `£Ô£³` ORDER BY `£Ã£±`; +£Ã£± +ޱ +޲ +޳ +޳ +íÜ +íÝ +íÞ +íÞ +¤¢ +¤¤ +¤¦ +¤¦ +SELECT * FROM `£Ô£±` UNION ALL +SELECT * FROM `£Ô£²` UNION DISTINCT +SELECT * FROM `£Ô£³` ORDER BY `£Ã£±`; +£Ã£± +ޱ +޲ +޳ +íÜ +íÝ +íÞ +¤¢ +¤¤ +¤¦ +SELECT * FROM `£Ô£±` UNION SELECT REPEAT(`£Ã£±`,5) FROM `£Ô£²` ORDER BY `£Ã£±`; +£Ã£± +ޱ +޲޲޲޲޲ +íÜ +íÝíÝíÝíÝíÝ +¤¢ +¤¤¤¤¤¤¤¤¤¤ +DROP TABLE `£Ô£±` ; +DROP TABLE `£Ô£²` ; +DROP TABLE `£Ô£³` ; +CREATE TABLE `£Ô£±` (`£Ã£±` char(1), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = HEAP; +CREATE TABLE `£Ô£²` (`£Ã£±` char(1), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = HEAP; +CREATE TABLE `£Ô£³` (`£Ã£±` char(1), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = HEAP; +INSERT INTO `£Ô£±` VALUES('ޱ'),('ޱ'),('¤¢'),('¤¢'),('íÜ'),('íÜ'); +INSERT INTO `£Ô£²` VALUES('޲'),('޲'),('¤¤'),('¤¤'),('íÝ'),('íÝ'); +INSERT INTO `£Ô£³` VALUES('޳'),('޳'),('¤¦'),('¤¦'),('íÞ'),('íÞ'); +SELECT * FROM `£Ô£±` UNION DISTINCT SELECT * FROM `£Ô£²` ORDER BY `£Ã£±`; +£Ã£± +ޱ +޲ +íÜ +íÝ +¤¢ +¤¤ +SELECT * FROM `£Ô£±` UNION ALL SELECT * FROM `£Ô£²` ORDER BY `£Ã£±`; +£Ã£± +ޱ +ޱ +޲ +޲ +íÜ +íÜ +íÝ +íÝ +¤¢ +¤¢ +¤¤ +¤¤ +(SELECT * FROM `£Ô£±`) UNION (SELECT * FROM `£Ô£²`) UNION (SELECT '¤¦') ORDER BY `£Ã£±`; +£Ã£± +ޱ +޲ +íÜ +íÝ +¤¢ +¤¤ +¤¦ +(SELECT '¤¦' AS `£Ã£±`) UNION (SELECT * FROM `£Ô£±`) UNION (SELECT * FROM `£Ô£²`) ORDER BY `£Ã£±`; +£Ã£± +ޱ +޲ +íÜ +íÝ +¤¢ +¤¤ +¤¦ +SELECT `£Ã£±`, COUNT(*) FROM `£Ô£±` GROUP BY `£Ã£±` UNION +SELECT `£Ã£±`, COUNT(*) FROM `£Ô£²` GROUP BY `£Ã£±` ORDER BY `£Ã£±`; +£Ã£± COUNT(*) +ޱ 2 +޲ 2 +íÜ 2 +íÝ 2 +¤¢ 2 +¤¤ 2 +SELECT * FROM `£Ô£±` UNION DISTINCT +SELECT * FROM `£Ô£²` UNION ALL +SELECT * FROM `£Ô£³` ORDER BY `£Ã£±`; +£Ã£± +ޱ +޲ +޳ +޳ +íÜ +íÝ +íÞ +íÞ +¤¢ +¤¤ +¤¦ +¤¦ +SELECT * FROM `£Ô£±` UNION ALL +SELECT * FROM `£Ô£²` UNION DISTINCT +SELECT * FROM `£Ô£³` ORDER BY `£Ã£±`; +£Ã£± +ޱ +޲ +޳ +íÜ +íÝ +íÞ +¤¢ +¤¤ +¤¦ +SELECT * FROM `£Ô£±` UNION SELECT REPEAT(`£Ã£±`,5) FROM `£Ô£²` ORDER BY `£Ã£±`; +£Ã£± +ޱ +޲޲޲޲޲ +íÜ +íÝíÝíÝíÝíÝ +¤¢ +¤¤¤¤¤¤¤¤¤¤ +DROP TABLE `£Ô£±` ; +DROP TABLE `£Ô£²` ; +DROP TABLE `£Ô£³` ; +CREATE TABLE `£Ô£±` (`£Ã£±` char(1), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = BDB; +CREATE TABLE `£Ô£²` (`£Ã£±` char(1), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = BDB; +CREATE TABLE `£Ô£³` (`£Ã£±` char(1), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = BDB; +INSERT INTO `£Ô£±` VALUES('ޱ'),('ޱ'),('¤¢'),('¤¢'),('íÜ'),('íÜ'); +INSERT INTO `£Ô£²` VALUES('޲'),('޲'),('¤¤'),('¤¤'),('íÝ'),('íÝ'); +INSERT INTO `£Ô£³` VALUES('޳'),('޳'),('¤¦'),('¤¦'),('íÞ'),('íÞ'); +SELECT * FROM `£Ô£±` UNION DISTINCT SELECT * FROM `£Ô£²` ORDER BY `£Ã£±`; +£Ã£± +ޱ +޲ +íÜ +íÝ +¤¢ +¤¤ +SELECT * FROM `£Ô£±` UNION ALL SELECT * FROM `£Ô£²` ORDER BY `£Ã£±`; +£Ã£± +ޱ +ޱ +޲ +޲ +íÜ +íÜ +íÝ +íÝ +¤¢ +¤¢ +¤¤ +¤¤ +(SELECT * FROM `£Ô£±`) UNION (SELECT * FROM `£Ô£²`) UNION (SELECT '¤¦') ORDER BY `£Ã£±`; +£Ã£± +ޱ +޲ +íÜ +íÝ +¤¢ +¤¤ +¤¦ +(SELECT '¤¦' AS `£Ã£±`) UNION (SELECT * FROM `£Ô£±`) UNION (SELECT * FROM `£Ô£²`) ORDER BY `£Ã£±`; +£Ã£± +ޱ +޲ +íÜ +íÝ +¤¢ +¤¤ +¤¦ +SELECT `£Ã£±`, COUNT(*) FROM `£Ô£±` GROUP BY `£Ã£±` UNION +SELECT `£Ã£±`, COUNT(*) FROM `£Ô£²` GROUP BY `£Ã£±` ORDER BY `£Ã£±`; +£Ã£± COUNT(*) +ޱ 2 +޲ 2 +íÜ 2 +íÝ 2 +¤¢ 2 +¤¤ 2 +SELECT * FROM `£Ô£±` UNION DISTINCT +SELECT * FROM `£Ô£²` UNION ALL +SELECT * FROM `£Ô£³` ORDER BY `£Ã£±`; +£Ã£± +ޱ +޲ +޳ +޳ +íÜ +íÝ +íÞ +íÞ +¤¢ +¤¤ +¤¦ +¤¦ +SELECT * FROM `£Ô£±` UNION ALL +SELECT * FROM `£Ô£²` UNION DISTINCT +SELECT * FROM `£Ô£³` ORDER BY `£Ã£±`; +£Ã£± +ޱ +޲ +޳ +íÜ +íÝ +íÞ +¤¢ +¤¤ +¤¦ +SELECT * FROM `£Ô£±` UNION SELECT REPEAT(`£Ã£±`,5) FROM `£Ô£²` ORDER BY `£Ã£±`; +£Ã£± +ޱ +޲޲޲޲޲ +íÜ +íÝíÝíÝíÝíÝ +¤¢ +¤¤¤¤¤¤¤¤¤¤ +DROP TABLE `£Ô£±` ; +DROP TABLE `£Ô£²` ; +DROP TABLE `£Ô£³` ; +CREATE TABLE `£Ô£±` (`£Ã£±` char(1), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = InnoDB; +CREATE TABLE `£Ô£²` (`£Ã£±` char(1), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = MyISAM; +INSERT INTO `£Ô£±` VALUES('ޱ'),('ޱ'),('¤¢'),('¤¢'),('íÜ'),('íÜ'); +INSERT INTO `£Ô£²` VALUES('޲'),('޲'),('¤¤'),('¤¤'),('íÝ'),('íÝ'); +SELECT * FROM `£Ô£±` UNION DISTINCT SELECT * FROM `£Ô£²` ORDER BY `£Ã£±`; +£Ã£± +ޱ +޲ +íÜ +íÝ +¤¢ +¤¤ +SELECT * FROM `£Ô£±` UNION ALL SELECT * FROM `£Ô£²` ORDER BY `£Ã£±`; +£Ã£± +ޱ +ޱ +޲ +޲ +íÜ +íÜ +íÝ +íÝ +¤¢ +¤¢ +¤¤ +¤¤ +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; diff --git a/mysql-test/suite/jp/r/jp_update_sjis.result b/mysql-test/suite/jp/r/jp_update_sjis.result new file mode 100755 index 00000000000..65151cc7021 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_update_sjis.result @@ -0,0 +1,98 @@ +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +drop table if exists `‚s‚P‚P`; +drop table if exists `‚s‚P‚Q`; +SET NAMES sjis; +SET character_set_database = sjis; +CREATE TABLE `‚s‚P` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Q` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚R` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚S` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚T` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚U` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚V` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚W` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚X` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚O` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚P` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚Q` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +INSERT INTO `‚s‚P` VALUES ('±²³´µ'); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚S` VALUES ('±²³´µ'); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚V` VALUES ('±²³´µ'); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ'); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\'); +UPDATE `‚s‚P` SET `‚b‚P` = ('¶·¸¹º'); +UPDATE `‚s‚Q` SET `‚b‚P` = ('‚©‚«‚­‚¯‚±'); +UPDATE `‚s‚R` SET `‚b‚P` = ('‰\Ž\\“\”\'); +UPDATE `‚s‚S` SET `‚b‚P` = ('¶·¸¹º'); +UPDATE `‚s‚T` SET `‚b‚P` = ('‚©‚«‚­‚¯‚±'); +UPDATE `‚s‚U` SET `‚b‚P` = ('‰\Ž\\“\”\'); +UPDATE `‚s‚V` SET `‚b‚P` = ('¶·¸¹º'); +UPDATE `‚s‚W` SET `‚b‚P` = ('‚©‚«‚­‚¯‚±'); +UPDATE `‚s‚X` SET `‚b‚P` = ('‰\Ž\\“\”\'); +UPDATE `‚s‚P‚O` SET `‚b‚P` = ('¶·¸¹º'); +UPDATE `‚s‚P‚P` SET `‚b‚P` = ('‚©‚«‚­‚¯‚±'); +UPDATE `‚s‚P‚Q` SET `‚b‚P` = ('‰\Ž\\“\”\'); +SELECT * FROM `‚s‚P`; +‚b‚P +¶·¸¹º +SELECT * FROM `‚s‚Q`; +‚b‚P +‚©‚«‚­‚¯‚± +SELECT * FROM `‚s‚R`; +‚b‚P +‰\Ž\\“\”\ +SELECT * FROM `‚s‚S`; +‚b‚P +¶·¸¹º +SELECT * FROM `‚s‚T`; +‚b‚P +‚©‚«‚­‚¯‚± +SELECT * FROM `‚s‚U`; +‚b‚P +‰\Ž\\“\”\ +SELECT * FROM `‚s‚V`; +‚b‚P +¶·¸¹º +SELECT * FROM `‚s‚W`; +‚b‚P +‚©‚«‚­‚¯‚± +SELECT * FROM `‚s‚X`; +‚b‚P +‰\Ž\\“\”\ +SELECT * FROM `‚s‚P‚O`; +‚b‚P +¶·¸¹º +SELECT * FROM `‚s‚P‚P`; +‚b‚P +‚©‚«‚­‚¯‚± +SELECT * FROM `‚s‚P‚Q`; +‚b‚P +‰\Ž\\“\”\ +DROP TABLE `‚s‚P`; +DROP TABLE `‚s‚Q`; +DROP TABLE `‚s‚R`; +DROP TABLE `‚s‚S`; +DROP TABLE `‚s‚T`; +DROP TABLE `‚s‚U`; +DROP TABLE `‚s‚V`; +DROP TABLE `‚s‚W`; +DROP TABLE `‚s‚X`; +DROP TABLE `‚s‚P‚O`; +DROP TABLE `‚s‚P‚P`; +DROP TABLE `‚s‚P‚Q`; diff --git a/mysql-test/suite/jp/r/jp_update_ucs2.result b/mysql-test/suite/jp/r/jp_update_ucs2.result new file mode 100755 index 00000000000..2796958ac3e --- /dev/null +++ b/mysql-test/suite/jp/r/jp_update_ucs2.result @@ -0,0 +1,99 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; +CREATE TABLE `£Ô£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'); +UPDATE `£Ô£±` SET `£Ã£±` = ('Ž¶Ž·Ž¸Ž¹Žº'); +UPDATE `£Ô£²` SET `£Ã£±` = ('¤«¤­¤¯¤±¤³'); +UPDATE `£Ô£³` SET `£Ã£±` = ('íÈíÉíÊíËíÌ'); +UPDATE `£Ô£´` SET `£Ã£±` = ('Ž¶Ž·Ž¸Ž¹Žº'); +UPDATE `£Ô£µ` SET `£Ã£±` = ('¤«¤­¤¯¤±¤³'); +UPDATE `£Ô£¶` SET `£Ã£±` = ('íÈíÉíÊíËíÌ'); +UPDATE `£Ô£·` SET `£Ã£±` = ('Ž¶Ž·Ž¸Ž¹Žº'); +UPDATE `£Ô£¸` SET `£Ã£±` = ('¤«¤­¤¯¤±¤³'); +UPDATE `£Ô£¹` SET `£Ã£±` = ('íÈíÉíÊíËíÌ'); +UPDATE `£Ô£±£°` SET `£Ã£±` = ('Ž¶Ž·Ž¸Ž¹Žº'); +UPDATE `£Ô£±£±` SET `£Ã£±` = ('¤«¤­¤¯¤±¤³'); +UPDATE `£Ô£±£²` SET `£Ã£±` = ('íÈíÉíÊíËíÌ'); +SELECT * FROM `£Ô£±`; +£Ã£± +Ž¶Ž·Ž¸Ž¹Žº +SELECT * FROM `£Ô£²`; +£Ã£± +¤«¤­¤¯¤±¤³ +SELECT * FROM `£Ô£³`; +£Ã£± +íÈíÉíÊíËíÌ +SELECT * FROM `£Ô£´`; +£Ã£± +Ž¶Ž·Ž¸Ž¹Žº +SELECT * FROM `£Ô£µ`; +£Ã£± +¤«¤­¤¯¤±¤³ +SELECT * FROM `£Ô£¶`; +£Ã£± +íÈíÉíÊíËíÌ +SELECT * FROM `£Ô£·`; +£Ã£± +Ž¶Ž·Ž¸Ž¹Žº +SELECT * FROM `£Ô£¸`; +£Ã£± +¤«¤­¤¯¤±¤³ +SELECT * FROM `£Ô£¹`; +£Ã£± +íÈíÉíÊíËíÌ +SELECT * FROM `£Ô£±£°`; +£Ã£± +Ž¶Ž·Ž¸Ž¹Žº +SELECT * FROM `£Ô£±£±`; +£Ã£± +¤«¤­¤¯¤±¤³ +SELECT * FROM `£Ô£±£²`; +£Ã£± +íÈíÉíÊíËíÌ +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/r/jp_update_ujis.result b/mysql-test/suite/jp/r/jp_update_ujis.result new file mode 100755 index 00000000000..e9633d14f0c --- /dev/null +++ b/mysql-test/suite/jp/r/jp_update_ujis.result @@ -0,0 +1,98 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +SET NAMES ujis; +SET character_set_database = ujis; +CREATE TABLE `£Ô£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'); +UPDATE `£Ô£±` SET `£Ã£±` = ('Ž¶Ž·Ž¸Ž¹Žº'); +UPDATE `£Ô£²` SET `£Ã£±` = ('¤«¤­¤¯¤±¤³'); +UPDATE `£Ô£³` SET `£Ã£±` = ('íÈíÉíÊíËíÌ'); +UPDATE `£Ô£´` SET `£Ã£±` = ('Ž¶Ž·Ž¸Ž¹Žº'); +UPDATE `£Ô£µ` SET `£Ã£±` = ('¤«¤­¤¯¤±¤³'); +UPDATE `£Ô£¶` SET `£Ã£±` = ('íÈíÉíÊíËíÌ'); +UPDATE `£Ô£·` SET `£Ã£±` = ('Ž¶Ž·Ž¸Ž¹Žº'); +UPDATE `£Ô£¸` SET `£Ã£±` = ('¤«¤­¤¯¤±¤³'); +UPDATE `£Ô£¹` SET `£Ã£±` = ('íÈíÉíÊíËíÌ'); +UPDATE `£Ô£±£°` SET `£Ã£±` = ('Ž¶Ž·Ž¸Ž¹Žº'); +UPDATE `£Ô£±£±` SET `£Ã£±` = ('¤«¤­¤¯¤±¤³'); +UPDATE `£Ô£±£²` SET `£Ã£±` = ('íÈíÉíÊíËíÌ'); +SELECT * FROM `£Ô£±`; +£Ã£± +Ž¶Ž·Ž¸Ž¹Žº +SELECT * FROM `£Ô£²`; +£Ã£± +¤«¤­¤¯¤±¤³ +SELECT * FROM `£Ô£³`; +£Ã£± +íÈíÉíÊíËíÌ +SELECT * FROM `£Ô£´`; +£Ã£± +Ž¶Ž·Ž¸Ž¹Žº +SELECT * FROM `£Ô£µ`; +£Ã£± +¤«¤­¤¯¤±¤³ +SELECT * FROM `£Ô£¶`; +£Ã£± +íÈíÉíÊíËíÌ +SELECT * FROM `£Ô£·`; +£Ã£± +Ž¶Ž·Ž¸Ž¹Žº +SELECT * FROM `£Ô£¸`; +£Ã£± +¤«¤­¤¯¤±¤³ +SELECT * FROM `£Ô£¹`; +£Ã£± +íÈíÉíÊíËíÌ +SELECT * FROM `£Ô£±£°`; +£Ã£± +Ž¶Ž·Ž¸Ž¹Žº +SELECT * FROM `£Ô£±£±`; +£Ã£± +¤«¤­¤¯¤±¤³ +SELECT * FROM `£Ô£±£²`; +£Ã£± +íÈíÉíÊíËíÌ +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/r/jp_update_utf8.result b/mysql-test/suite/jp/r/jp_update_utf8.result new file mode 100755 index 00000000000..f690d2f0247 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_update_utf8.result @@ -0,0 +1,98 @@ +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +drop table if exists `T11`; +drop table if exists `T12`; +SET NAMES utf8; +SET character_set_database = utf8; +CREATE TABLE `T1` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T11` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T12` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +INSERT INTO `T1` VALUES ('アイウエオ'); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T3` VALUES ('龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオ'); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオ'); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡'); +INSERT INTO `T1ï¼` VALUES ('アイウエオ'); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T12` VALUES ('龔龖龗龞龡'); +UPDATE `T1` SET `C1` = ('カキクケコ'); +UPDATE `ï¼´ï¼’` SET `C1` = ('ã‹ããã‘ã“'); +UPDATE `T3` SET `C1` = ('齗齘齚é½é½ž'); +UPDATE `ï¼´ï¼”` SET `C1` = ('カキクケコ'); +UPDATE `T5` SET `C1` = ('ã‹ããã‘ã“'); +UPDATE `ï¼´ï¼–` SET `C1` = ('齗齘齚é½é½ž'); +UPDATE `ï¼´ï¼—` SET `C1` = ('カキクケコ'); +UPDATE `T8` SET `C1` = ('ã‹ããã‘ã“'); +UPDATE `ï¼´ï¼™` SET `C1` = ('齗齘齚é½é½ž'); +UPDATE `T1ï¼` SET `C1` = ('カキクケコ'); +UPDATE `T11` SET `C1` = ('ã‹ããã‘ã“'); +UPDATE `T12` SET `C1` = ('齗齘齚é½é½ž'); +SELECT * FROM `T1`; +C1 +カキクケコ +SELECT * FROM `ï¼´ï¼’`; +C1 +ã‹ããã‘ã“ +SELECT * FROM `T3`; +C1 +齗齘齚é½é½ž +SELECT * FROM `ï¼´ï¼”`; +C1 +カキクケコ +SELECT * FROM `T5`; +C1 +ã‹ããã‘ã“ +SELECT * FROM `ï¼´ï¼–`; +C1 +齗齘齚é½é½ž +SELECT * FROM `ï¼´ï¼—`; +C1 +カキクケコ +SELECT * FROM `T8`; +C1 +ã‹ããã‘ã“ +SELECT * FROM `ï¼´ï¼™`; +C1 +齗齘齚é½é½ž +SELECT * FROM `T1ï¼`; +C1 +カキクケコ +SELECT * FROM `T11`; +C1 +ã‹ããã‘ã“ +SELECT * FROM `T12`; +C1 +齗齘齚é½é½ž +DROP TABLE `T1`; +DROP TABLE `ï¼´ï¼’`; +DROP TABLE `T3`; +DROP TABLE `ï¼´ï¼”`; +DROP TABLE `T5`; +DROP TABLE `ï¼´ï¼–`; +DROP TABLE `ï¼´ï¼—`; +DROP TABLE `T8`; +DROP TABLE `ï¼´ï¼™`; +DROP TABLE `T1ï¼`; +DROP TABLE `T11`; +DROP TABLE `T12`; diff --git a/mysql-test/suite/jp/r/jp_where_sjis.result b/mysql-test/suite/jp/r/jp_where_sjis.result new file mode 100755 index 00000000000..a3cbc24c113 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_where_sjis.result @@ -0,0 +1,118 @@ +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +drop table if exists `‚s‚P‚P`; +drop table if exists `‚s‚P‚Q`; +SET NAMES sjis; +SET character_set_database = sjis; +CREATE TABLE `‚s‚P` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Q` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚R` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚S` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚T` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚U` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚V` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚W` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚X` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚O` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚P` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚Q` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `‚s‚P`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `‚s‚Q`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `‚s‚R`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `‚s‚S`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `‚s‚T`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `‚s‚U`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `‚s‚V`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `‚s‚W`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `‚s‚X`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `‚s‚P‚O`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `‚s‚P‚P`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `‚s‚P‚Q`; +SELECT * FROM `‚s‚P` WHERE `‚b‚P` = '°±²³´µ¶·¸¹º»¼½¾¿'; +‚b‚P +°±²³´µ¶·¸¹º»¼½¾¿ +SELECT * FROM `‚s‚Q` WHERE `‚b‚P` = 'E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚­‚®‚¯‚°‚±'; +‚b‚P +E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚­‚®‚¯‚°‚± +SELECT * FROM `‚s‚R` WHERE `‚b‚P` = 'ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\'; +‚b‚P +ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ +SELECT * FROM `‚s‚S` WHERE `‚b‚P` = '°±²³´µ¶·¸¹º»¼½¾¿'; +‚b‚P +°±²³´µ¶·¸¹º»¼½¾¿ +SELECT * FROM `‚s‚T` WHERE `‚b‚P` = 'E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚­‚®‚¯‚°‚±'; +‚b‚P +E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚­‚®‚¯‚°‚± +SELECT * FROM `‚s‚U` WHERE `‚b‚P` = 'ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\'; +‚b‚P +ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ +SELECT * FROM `‚s‚V` WHERE `‚b‚P` = '°±²³´µ¶·¸¹º»¼½¾¿'; +‚b‚P +°±²³´µ¶·¸¹º»¼½¾¿ +SELECT * FROM `‚s‚W` WHERE `‚b‚P` = 'E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚­‚®‚¯‚°‚±'; +‚b‚P +E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚­‚®‚¯‚°‚± +SELECT * FROM `‚s‚X` WHERE `‚b‚P` = 'ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\'; +‚b‚P +ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ +SELECT * FROM `‚s‚P‚O` WHERE `‚b‚P` = '°±²³´µ¶·¸¹º»¼½¾¿'; +‚b‚P +°±²³´µ¶·¸¹º»¼½¾¿ +SELECT * FROM `‚s‚P‚P` WHERE `‚b‚P` = 'E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚­‚®‚¯‚°‚±'; +‚b‚P +E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚­‚®‚¯‚°‚± +SELECT * FROM `‚s‚P‚Q` WHERE `‚b‚P` = 'ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\'; +‚b‚P +ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\ +CREATE TABLE t1(c1 char(1)) default charset = sjis engine=innodb; +CREATE TABLE t2(c1 char(1)) default charset = sjis engine=myisam; +CREATE TABLE t3(c1 char(1)) default charset = sjis engine=heap; +CREATE TABLE t4(c1 char(1)) default charset = sjis engine=bdb; +INSERT INTO t1 VALUES('“S'),('“s'); +INSERT INTO t2 VALUES('“S'),('“s'); +INSERT INTO t3 VALUES('“S'),('“s'); +INSERT INTO t4 VALUES('“S'),('“s'); +SELECT * FROM t1 WHERE c1 = '“S'; +c1 +“S +SELECT * FROM t2 WHERE c1 = '“S'; +c1 +“S +SELECT * FROM t3 WHERE c1 = '“S'; +c1 +“S +SELECT * FROM t4 WHERE c1 = '“S'; +c1 +“S +SELECT * FROM t1 WHERE c1 = '“s'; +c1 +“s +SELECT * FROM t2 WHERE c1 = '“s'; +c1 +“s +SELECT * FROM t3 WHERE c1 = '“s'; +c1 +“s +SELECT * FROM t4 WHERE c1 = '“s'; +c1 +“s +DROP TABLE `‚s‚P`; +DROP TABLE `‚s‚Q`; +DROP TABLE `‚s‚R`; +DROP TABLE `‚s‚S`; +DROP TABLE `‚s‚T`; +DROP TABLE `‚s‚U`; +DROP TABLE `‚s‚V`; +DROP TABLE `‚s‚W`; +DROP TABLE `‚s‚X`; +DROP TABLE `‚s‚P‚O`; +DROP TABLE `‚s‚P‚P`; +DROP TABLE `‚s‚P‚Q`; diff --git a/mysql-test/suite/jp/r/jp_where_ucs2.result b/mysql-test/suite/jp/r/jp_where_ucs2.result new file mode 100755 index 00000000000..a05b1da9b68 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_where_ucs2.result @@ -0,0 +1,163 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; +CREATE TABLE `£Ô£±` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +INSERT INTO `£Ô£±` VALUES +('PQRSTUVWXYZ[\\]^_') +,(' Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯') +,('Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿') +,('ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ') +,('ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß'); +INSERT INTO `£Ô£²` VALUES +('¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç') +,('¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û') +,('¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³') +,('¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³') +,('¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³') +,('¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³') +,('¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³'); +INSERT INTO `£Ô£³` VALUES +('¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦') +,('°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç') +,('°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û') +,('°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï') +,('¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³') +,('í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ') +,('íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ'); +INSERT INTO `£Ô£´` VALUES +('PQRSTUVWXYZ[\\]^_') +,(' Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯') +,('Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿') +,('ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ') +,('ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß'); +INSERT INTO `£Ô£µ` VALUES +('¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç') +,('¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û') +,('¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³') +,('¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³') +,('¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³') +,('¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³') +,('¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³'); +INSERT INTO `£Ô£¶` VALUES +('¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦') +,('°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç') +,('°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û') +,('°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï') +,('¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³') +,('í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ') +,('íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ'); +INSERT INTO `£Ô£·` VALUES +('PQRSTUVWXYZ[\\]^_') +,(' Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯') +,('Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿') +,('ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ') +,('ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß'); +INSERT INTO `£Ô£¸` VALUES +('¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç') +,('¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û') +,('¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³') +,('¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³') +,('¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³') +,('¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³') +,('¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³'); +INSERT INTO `£Ô£¹` VALUES +('¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦') +,('°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç') +,('°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û') +,('°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï') +,('¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³') +,('í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ') +,('íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ'); +INSERT INTO `£Ô£±£°` VALUES +('PQRSTUVWXYZ[\\]^_') +,(' Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯') +,('Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿') +,('ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ') +,('ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß'); +INSERT INTO `£Ô£±£±` VALUES +('¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç') +,('¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û') +,('¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³') +,('¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³') +,('¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³') +,('¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³') +,('¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³'); +INSERT INTO `£Ô£±£²` VALUES +('¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦') +,('°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç') +,('°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û') +,('°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï') +,('¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³') +,('í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ') +,('íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ'); +SELECT * FROM `£Ô£±` WHERE `£Ã£±` = 'Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿'; +£Ã£± +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +SELECT * FROM `£Ô£²` WHERE `£Ã£±` = '¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³'; +£Ã£± +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ +SELECT * FROM `£Ô£³` WHERE `£Ã£±` = 'í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£´` WHERE `£Ã£±` = 'Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿'; +£Ã£± +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +SELECT * FROM `£Ô£µ` WHERE `£Ã£±` = '¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³'; +£Ã£± +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ +SELECT * FROM `£Ô£¶` WHERE `£Ã£±` = 'í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£·` WHERE `£Ã£±` = 'Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿'; +£Ã£± +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +SELECT * FROM `£Ô£¸` WHERE `£Ã£±` = '¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³'; +£Ã£± +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ +SELECT * FROM `£Ô£¹` WHERE `£Ã£±` = 'í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£±£°` WHERE `£Ã£±` = 'Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿'; +£Ã£± +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +SELECT * FROM `£Ô£±£±` WHERE `£Ã£±` = '¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³'; +£Ã£± +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ +SELECT * FROM `£Ô£±£²` WHERE `£Ã£±` = 'í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/r/jp_where_ujis.result b/mysql-test/suite/jp/r/jp_where_ujis.result new file mode 100755 index 00000000000..b13b8a10ef8 --- /dev/null +++ b/mysql-test/suite/jp/r/jp_where_ujis.result @@ -0,0 +1,86 @@ +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +SET NAMES ujis; +SET character_set_database = ujis; +CREATE TABLE `£Ô£±` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_ujis.dat' INTO TABLE `£Ô£±`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_ujis.dat' INTO TABLE `£Ô£²`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_ujis.dat' INTO TABLE `£Ô£³`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_ujis.dat' INTO TABLE `£Ô£´`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_ujis.dat' INTO TABLE `£Ô£µ`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_ujis.dat' INTO TABLE `£Ô£¶`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_ujis.dat' INTO TABLE `£Ô£·`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_ujis.dat' INTO TABLE `£Ô£¸`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_ujis.dat' INTO TABLE `£Ô£¹`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_ujis.dat' INTO TABLE `£Ô£±£°`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_ujis.dat' INTO TABLE `£Ô£±£±`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_ujis.dat' INTO TABLE `£Ô£±£²`; +SELECT * FROM `£Ô£±` WHERE `£Ã£±` = 'Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿'; +£Ã£± +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +SELECT * FROM `£Ô£²` WHERE `£Ã£±` = '¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³'; +£Ã£± +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ +SELECT * FROM `£Ô£³` WHERE `£Ã£±` = 'í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£´` WHERE `£Ã£±` = 'Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿'; +£Ã£± +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +SELECT * FROM `£Ô£µ` WHERE `£Ã£±` = '¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³'; +£Ã£± +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ +SELECT * FROM `£Ô£¶` WHERE `£Ã£±` = 'í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£·` WHERE `£Ã£±` = 'Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿'; +£Ã£± +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +SELECT * FROM `£Ô£¸` WHERE `£Ã£±` = '¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³'; +£Ã£± +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ +SELECT * FROM `£Ô£¹` WHERE `£Ã£±` = 'í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +SELECT * FROM `£Ô£±£°` WHERE `£Ã£±` = 'Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿'; +£Ã£± +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +SELECT * FROM `£Ô£±£±` WHERE `£Ã£±` = '¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³'; +£Ã£± +¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³ +SELECT * FROM `£Ô£±£²` WHERE `£Ã£±` = 'í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ'; +£Ã£± +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/r/jp_where_utf8.result b/mysql-test/suite/jp/r/jp_where_utf8.result new file mode 100755 index 00000000000..d69aaf8715d --- /dev/null +++ b/mysql-test/suite/jp/r/jp_where_utf8.result @@ -0,0 +1,86 @@ +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +drop table if exists `T11`; +drop table if exists `T12`; +SET NAMES utf8; +SET character_set_database = utf8; +CREATE TABLE `T1` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T11` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T12` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_utf8.dat' INTO TABLE `T1`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_utf8.dat' INTO TABLE `ï¼´ï¼’`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_utf8.dat' INTO TABLE `T3`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_utf8.dat' INTO TABLE `ï¼´ï¼”`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_utf8.dat' INTO TABLE `T5`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_utf8.dat' INTO TABLE `ï¼´ï¼–`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_utf8.dat' INTO TABLE `ï¼´ï¼—`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_utf8.dat' INTO TABLE `T8`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_utf8.dat' INTO TABLE `ï¼´ï¼™`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_utf8.dat' INTO TABLE `T1ï¼`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_utf8.dat' INTO TABLE `T11`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_utf8.dat' INTO TABLE `T12`; +SELECT * FROM `T1` WHERE `C1` = 'ーアイウエオカキクケコサシスセソ'; +C1 +ーアイウエオカキクケコサシスセソ +SELECT * FROM `ï¼´ï¼’` WHERE `C1` = '・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“'; +C1 +・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“ +SELECT * FROM `T3` WHERE `C1` = '鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖'; +C1 +鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 +SELECT * FROM `ï¼´ï¼”` WHERE `C1` = 'ーアイウエオカキクケコサシスセソ'; +C1 +ーアイウエオカキクケコサシスセソ +SELECT * FROM `T5` WHERE `C1` = '・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“'; +C1 +・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“ +SELECT * FROM `ï¼´ï¼–` WHERE `C1` = '鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖'; +C1 +鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 +SELECT * FROM `ï¼´ï¼—` WHERE `C1` = 'ーアイウエオカキクケコサシスセソ'; +C1 +ーアイウエオカキクケコサシスセソ +SELECT * FROM `T8` WHERE `C1` = '・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“'; +C1 +・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“ +SELECT * FROM `ï¼´ï¼™` WHERE `C1` = '鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖'; +C1 +鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 +SELECT * FROM `T1ï¼` WHERE `C1` = 'ーアイウエオカキクケコサシスセソ'; +C1 +ーアイウエオカキクケコサシスセソ +SELECT * FROM `T11` WHERE `C1` = '・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“'; +C1 +・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“ +SELECT * FROM `T12` WHERE `C1` = '鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖'; +C1 +鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 +DROP TABLE `T1`; +DROP TABLE `ï¼´ï¼’`; +DROP TABLE `T3`; +DROP TABLE `ï¼´ï¼”`; +DROP TABLE `T5`; +DROP TABLE `ï¼´ï¼–`; +DROP TABLE `ï¼´ï¼—`; +DROP TABLE `T8`; +DROP TABLE `ï¼´ï¼™`; +DROP TABLE `T1ï¼`; +DROP TABLE `T11`; +DROP TABLE `T12`; diff --git a/mysql-test/suite/jp/std_data/jisx0201_sjis.dat b/mysql-test/suite/jp/std_data/jisx0201_sjis.dat new file mode 100755 index 00000000000..7556c4d3085 --- /dev/null +++ b/mysql-test/suite/jp/std_data/jisx0201_sjis.dat @@ -0,0 +1,10 @@ + !"#$%&'()*+,-./ +0123456789:;<=>? +@ABCDEFGHIJKLMNO +PQRSTUVWXYZ[\\]^_ +abcdefghijklmno +pqrstuvwxyz{|}~ + ¡¢£¤¥¦§¨©ª«¬­®¯ +°±²³´µ¶·¸¹º»¼½¾¿ +ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ +ÐÑÒÓÔÕÖרÙÚÛÜÝÞß diff --git a/mysql-test/suite/jp/std_data/jisx0201_ujis.dat b/mysql-test/suite/jp/std_data/jisx0201_ujis.dat new file mode 100755 index 00000000000..07169ec8ab2 --- /dev/null +++ b/mysql-test/suite/jp/std_data/jisx0201_ujis.dat @@ -0,0 +1,10 @@ + !"#$%&'()*+,-./ +0123456789:;<=>? +@ABCDEFGHIJKLMNO +PQRSTUVWXYZ[\\]^_ +abcdefghijklmno +pqrstuvwxyz{|}~ + Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯ +Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿ +ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ +ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß diff --git a/mysql-test/suite/jp/std_data/jisx0201_utf8.dat b/mysql-test/suite/jp/std_data/jisx0201_utf8.dat new file mode 100755 index 00000000000..3052e4fcc8b --- /dev/null +++ b/mysql-test/suite/jp/std_data/jisx0201_utf8.dat @@ -0,0 +1,10 @@ + !"#$%&'()*+,-./ +0123456789:;<=>? +@ABCDEFGHIJKLMNO +PQRSTUVWXYZ[\\]^_ +abcdefghijklmno +pqrstuvwxyz{|}~ + 。「」、・ヲァィゥェォャュョッ +ーアイウエオカキクケコサシスセソ +ï¾€ï¾ï¾‚テトナニヌネノハヒフï¾ï¾Žï¾ +ï¾ï¾‘メモヤユヨラリルレロワï¾ï¾žï¾Ÿ diff --git a/mysql-test/suite/jp/std_data/jisx0208_sjis.dat b/mysql-test/suite/jp/std_data/jisx0208_sjis.dat new file mode 100755 index 00000000000..767be2090ac --- /dev/null +++ b/mysql-test/suite/jp/std_data/jisx0208_sjis.dat @@ -0,0 +1,66 @@ +@@ABCDEFGHIJKLMNOPQR +STUVWXYZ[\]^_`abcdef +ghijklmnopqrstuvwxyz +{]}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ +‘’“”•–—˜™š›œžEEEEE +EŸ ¡¢£¤¥¦§¨©ª«¬EEEEE +EEEEEE¸¹º»¼½¾¿EEEEEE +EEÈÉÊËÌÍÎEEEEEEEEEEE +ÚÛÜÝÞßàáâãäåæçèEEEEE +EEðñòóôõö÷EEEEüEEEE@ +EEEEEEEEEEEEEEEE‚O‚P‚Q‚R +‚S‚T‚U‚V‚W‚XEEEEEEE‚`‚a‚b‚c‚d‚e‚f +‚g‚h‚i‚j‚k‚l‚m‚n‚o‚p‚q‚r‚s‚t‚u‚v‚w‚x‚yE +EEEEE‚‚‚‚ƒ‚„‚…‚†‚‡‚ˆ‚‰‚Š‚‹‚Œ‚‚Ž‚ +‚‚‘‚’‚“‚”‚•‚–‚—‚˜‚™‚šEEEEEEEEE +E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚­‚®‚¯‚°‚± +‚²‚³‚´‚µ‚¶‚·‚¸‚¹‚º‚»‚¼‚½‚¾‚¿‚À‚Á‚‚ÂĂŠ+‚ƂǂȂɂʂ˂̂͂΂ςЂт҂ӂԂՂւׂ؂٠+‚ڂۂ܂݂ނ߂à‚á‚â‚ã‚ä‚傿‚ç‚è‚é‚ê‚ë‚ì‚í +‚î‚ï‚ð‚ñEEEEEEEEEEEEEEEE +Eƒ@ƒAƒBƒCƒDƒEƒFƒGƒHƒIƒJƒKƒLƒMƒNƒOƒPƒQƒR +ƒSƒTƒUƒVƒWƒXƒYƒZƒ[ƒ\ƒ]ƒ^ƒ_ƒ`ƒaƒbƒcƒdƒeƒf +ƒgƒhƒiƒjƒkƒlƒmƒnƒoƒpƒqƒrƒsƒtƒuƒvƒwƒxƒyƒz +ƒ{ƒ|ƒ}ƒ~ƒ€ƒƒ‚ƒƒƒ„ƒ…ƒ†ƒ‡ƒˆƒ‰ƒŠƒ‹ƒŒƒƒŽƒ +ƒƒ‘ƒ’ƒ“ƒ”ƒ•ƒ–EEEEEEEEEEEEE +EƒŸƒ ƒ¡ƒ¢ƒ£ƒ¤ƒ¥ƒ¦ƒ§ƒ¨ƒ©ƒªƒ«ƒ¬ƒ­ƒ®ƒ¯ƒ°ƒ± +ƒ²ƒ³ƒ´ƒµƒ¶EEEEEEEEƒ¿ƒÀƒÁƒÂƒÃƒÄƒÅ +ƒÆƒÇƒÈƒÉƒÊƒËƒÌƒÍƒÎƒÏƒÐƒÑƒÒƒÓƒÔƒÕƒÖEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +E„@„A„B„C„D„E„F„G„H„I„J„K„L„M„N„O„P„Q„R +„S„T„U„V„W„X„Y„Z„[„\„]„^„_„`EEEEEE +EEEEEEEEE„p„q„r„s„t„u„v„w„x„y„z +„{„|„}„~„€„„‚„ƒ„„„…„†„‡„ˆ„‰„Š„‹„Œ„„Ž„ +„„‘EEEEEEEEEEEEEEEEEE +E„Ÿ„ „¡„¢„£„¤„¥„¦„§„¨„©„ª„«„¬„­„®„¯„°„± +„²„³„´„µ„¶„·„¸„¹„º„»„¼„½„¾EEEEEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +EˆŸˆ ˆ¡ˆ¢ˆ£ˆ¤ˆ¥ˆ¦ˆ§ˆ¨ˆ©ˆªˆ«ˆ¬ˆ­ˆ®ˆ¯ˆ°ˆ± +ˆ²ˆ³ˆ´ˆµˆ¶ˆ·ˆ¸ˆ¹ˆºˆ»ˆ¼ˆ½ˆ¾ˆ¿ˆÀˆÁˆÂˆÃˆÄˆÅ +ˆÆˆÇˆÈˆÉˆÊˆËˆÌˆÍˆÎˆÏˆÐˆÑˆÒˆÓˆÔˆÕˆÖˆ×ˆØˆÙ +ˆÚˆÛˆÜˆÝˆÞˆßˆàˆáˆâˆãˆäˆåˆæˆçˆèˆéˆêˆëˆìˆí +ˆîˆïˆðˆñˆòˆóˆôˆõˆöˆ÷ˆøˆùˆúˆûˆüEEEEE +E˜@˜A˜B˜C˜D˜E˜F˜G˜H˜I˜J˜K˜L˜M˜N˜O˜P˜Q˜R +˜S˜T˜U˜V˜W˜X˜Y˜Z˜[˜\˜]˜^˜_˜`˜a˜b˜c˜d˜e˜f +˜g˜h˜i˜j˜k˜l˜m˜n˜o˜p˜q˜rEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +E˜Ÿ˜ ˜¡˜¢˜£˜¤˜¥˜¦˜§˜¨˜©˜ª˜«˜¬˜­˜®˜¯˜°˜± +˜²˜³˜´˜µ˜¶˜·˜¸˜¹˜º˜»˜¼˜½˜¾˜¿˜À˜Á˜Â˜Ã˜Ä˜Å +˜Æ˜Ç˜È˜É˜Ê˜Ë˜Ì˜Í˜Î˜Ï˜Ð˜Ñ˜Ò˜Ó˜Ô˜Õ˜Ö˜×˜Ø˜Ù +˜Ú˜Û˜Ü˜Ý˜Þ˜ß˜à˜á˜â˜ã˜ä˜å˜æ˜ç˜è˜é˜ê˜ë˜ì˜í +˜î˜ï˜ð˜ñ˜ò˜ó˜ô˜õ˜ö˜÷˜ø˜ù˜ú˜û˜üEEEEE +Eê@êAêBêCêDêEêFêGêHêIêJêKêLêMêNêOêPêQêR +êSêTêUêVêWêXêYêZê[ê\ê]ê^ê_ê`êaêbêcêdêeêf +êgêhêiêjêkêlêmênêoêpêqêrêsêtêuêvêwêxêyêz +ê{ê|ê}ê~ê€êê‚êƒê„ê…ê†ê‡êˆê‰êŠê‹êŒêêŽê +êê‘ê’ê“ê”ê•ê–ê—ê˜ê™êšê›êœêêžEEEEE +EêŸê ê¡ê¢ê£ê¤EEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE +EEEEEEEEEEEEEEEEEEEE diff --git a/mysql-test/suite/jp/std_data/jisx0208_sjis3.dat b/mysql-test/suite/jp/std_data/jisx0208_sjis3.dat new file mode 100755 index 00000000000..b636aacdb62 --- /dev/null +++ b/mysql-test/suite/jp/std_data/jisx0208_sjis3.dat @@ -0,0 +1,5 @@ +ƒ\\•\—\\ +ƒ\\•\—\ +ƒ\\•\ +ƒ\\ +ƒ\ diff --git a/mysql-test/suite/jp/std_data/jisx0208_ucs2.dat b/mysql-test/suite/jp/std_data/jisx0208_ucs2.dat new file mode 100755 index 0000000000000000000000000000000000000000..3ac15368c055f30e95781e1d8d5b1638ed179215 GIT binary patch literal 2782 zcmcJQX;ch%1`@S_@GzzT%p=g8Nq8D4^g1h=Sk(I?=e{Ac89zlqf26 zH||T~L~)H<+@e`gqlsBmbfTHeWDFC>=*&UA(;Npuk7rKiho^qj?Nd*^@4dI`RMTSx z3OrB&)u{#*qaih-SIL8Nkc)jvPui|@ryr;XJ%USl3=)d19}~7std=(M7F|RqjmpN_Upq>nT_4xR>rJnX72kw1wItEmd2f zwbWW@<=38&%{4#mJ>^UHWw)ZSXV%MDm!fK0wAxK8XqB~SZK#%@P1G7{-L%G92d$On zUvAeE%~o!xiN2G46MR+GtsZ!qQPIdQorc zLw%_q^``+ekOt9U8bXqEN7JBS8cM?`ghDBdhSLZNr-Q~Va2Dqr@?(60Pw^Q(#}_ETd0fCne2GiAjIZ!D zuHYMdi|_EgLte!-Tt^{p;3oczA8-q|@gx3%pYT`w4L{@WxPxC%)@rTr+K z_pp4nm+fQw*#UOYArG++*kN{r9c9PZarPlQ!A`Q%>dayNG=8gI&*alw6g zbMD7m@Rqz4_vfwoYrG9FpZSa2!Q1ix-j28D9e6PB$UE`Q{B=k34c>)!<=uF9-h=n# zfjo%!;=Oqv-k0~|{rLbskPqU6`4EScTz|%;ykq&e#9a{;M0MdQ>WezUNBE0oqP^%U zJOmRpg_md~>WQYJop33wL>DngsG^PV6P-j4(O5tT(OCpNeVd*rzo??}o@MdNB6DTk zP!`c+&54jk(S9-a!?n!mX+8^#**l|d#)v6*#>b{@P5mv$rDRQLK77OYsbh0SUI?GF z@ZQ?7$;XpdWo;_MdQWwM$u^t;gM#E`5k@>I00sVV%M+hkHa+ z9aR`rGdd~SE4E_%;Us-}(sZYyS-X;pl2519NQ+rqVOePA?9491R?982aCm;o$;_ge ziu`rN#wndMT}r@gzXi)u+vElYCk;Cmax>&cSaG;_8iWzeF6%*nx7 zR@$s(DFInuFKumPgiKwUF!4-A<@pz*TuNTtU2~mWD?M{3E*sve<3AE~>P(fV+`pFTrhtiP?V)#vE(dXm0UPt+IcYxMfT zm-RxuK>tSn-XSmQ-{}|hTl#Iiq2XuLFqUAkqmtoLdKvu; z78hz5Mt>v12s0)bGmR8uy^(J0GxCkHUX^rdv^mBcX9k;w8E#H9mzaypcg;j|wz=Ni zZ0<1g%`@gn^N8uZdFEmBta;u%Wqxa3GXG`%Xx=f4%tvNJtC7{jnr_XqlCAmHV#}p0 zvofqz)@o~|Wm;RT9o8Xhr?tz9&i>pgu+Cc-tjpF_>$-K#A#Yf>t)HwS>z;MrdSLzA zDz+Y4kF3ge75m@}Z`*DA+uiMf_E6jTf7&s2q#b2P+p%_>J;_e6-?FFKGwjuNuAOH; iTTz=4=ipmFJ_Ebwi%_dGYuEkl?+t464tqXz1v^Qd{uY;@gv+>IyAD{fwMws)cIubS7)CbQXWH*3vKv&A%<9p-h@ za+Ww(>3>zHXN|Qs%nq;vtxw@L!umGSM%h6&+MdhRd+l%bJezL|Y@sc(#kR!GwWW5R zEwkme;!in3njg?$bOlDZG1`r6Om_2)Xr(;2-hog0aF)KLA^4H5MHymZA&`P>$PhE83}z4p9d!!agj;LfnlSRN-TEpv{p7upEbJCGJ5z8gZ|y z;h!Vq=qMeb&*>N$v;YXh7xWnoLKhSRXo{Usn=d!0G1LH6W6Oe-$n2wWlihiPB=x5rCIk*X(REW7KcH}(F$1SM9 z?Wn|W^eg>NU9=ecQH#5<3`J zoXjbl$^lO2EY9W}&gD7m`pIQn$yHp<%ejv0`F?(a*YSFOmN)a8yp?xzJ9qFAM;_&4 ze4J14Nj}A$e1^L@$RwT^371HTk{G#EVkJ&|ikB2glLazH(j`MOWxPz1ESVxRWTwoL z*^(y(QY0mgtdL4sD2t>Ka|EPwCT+d`8#ldTr7T`kX$mFKSO^e|_rDjr#+U Cmc1VU literal 0 HcmV?d00001 diff --git a/mysql-test/suite/jp/std_data/jisx0212_ujis.dat b/mysql-test/suite/jp/std_data/jisx0212_ujis.dat new file mode 100755 index 00000000000..40c8645825b --- /dev/null +++ b/mysql-test/suite/jp/std_data/jisx0212_ujis.dat @@ -0,0 +1,40 @@ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢¯¢°¢±¢²¢³ +¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢ë¢ì¢í¢î¢ï +¢ð¢ñ¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¦á¦â¦ã¦ä¦å¡¦¦ç¡¦¦é¦ê¡¦¦ì¡¦¡¦¡¦ +¡¦¦ñ¦ò¦ó¦ô¦õ¦ö¦÷¦ø¦ù¦ú¦û¦ü¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦§Â§Ã§Ä§Å§Æ§Ç +§È§É§Ê§Ë§Ì§Í§Î¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦§ò§ó§ô§õ§ö§÷§ø§ù§ú§û§ü§ý§þ¡¦¡¦¡¦¡¦¡¦ +¡¦©¡©¢¡¦©¤¡¦©¦¡¦©¨©©¡¦©«©¬©­¡¦©¯©°¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦©Á©Â©Ã©Ä©Å©Æ©Ç +©È©É©Ê©Ë©Ì©Í©Î©Ï©Ð¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦ª¡ª¢ª£ª¤ª¥ª¦ª§ª¨ª©ªªª«ª¬ª­ª®ª¯ª°ª±ª²ª³ +ª´ªµª¶ª·ª¸¡¦ªºª»ª¼ª½ª¾ª¿ªÀªÁªÂªÃªÄªÅªÆªÇ +ªÈªÉªÊªËªÌªÍªÎªÏªÐªÑªÒªÓªÔªÕªÖª×ªØªÙªÚªÛ +ªÜªÝªÞªßªàªáªâªãªäªåªæªçªèªéªêªëªìªíªîªï +ªðªñªòªóªôªõªöª÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦«¡«¢«£«¤«¥«¦«§«¨«©«ª«««¬«­«®«¯«°«±«²«³ +«´«µ«¶«·«¸«¹«º«»¡¦«½«¾«¿«À«Á«Â«Ã¡¦«Å«Æ«Ç +«È«É«Ê«Ë«Ì«Í«Î«Ï«Ð«Ñ«Ò«Ó«Ô«Õ«Ö«×«Ø«Ù«Ú«Û +«Ü«Ý«Þ«ß«à«á«â«ã«ä«å«æ«ç«è«é«ê«ë«ì«í«î«ï +«ð«ñ«ò«ó«ô«õ«ö«÷¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³ +°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç +°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û +°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï +°ð°ñ°ò°ó°ô°õ°ö°÷°ø°ù°ú°û°ü°ý°þ¡¦¡¦¡¦¡¦¡¦ +¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³ +í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ +íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ +íÜíÝíÞíßíàíáíâí㡦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ +¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦ diff --git a/mysql-test/suite/jp/std_data/jisx0212_utf8.dat b/mysql-test/suite/jp/std_data/jisx0212_utf8.dat new file mode 100755 index 00000000000..3f9354255d0 --- /dev/null +++ b/mysql-test/suite/jp/std_data/jisx0212_utf8.dat @@ -0,0 +1,40 @@ +ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»ãƒ»Ë˜Ë‡Â¸Ë™Ë +・˛˚~΄΅・・・・・・・・¡¦¿・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・ºª©®™ +¤№・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・ΆΈΉΊΪ・Ό・ΎΫ・Î・・・ +・άέήίϊÎόςÏϋΰώ・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・ЂЃЄЅІЇ +ЈЉЊЋЌЎÐ・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・ђѓєѕіїјљњћќўџ・・・・・ +・ÆÄ・Ħ・IJ・ÅĿ・ŊØŒ・ŦÞ・・・ +・・・・・・・・・・・・・æđðħıijĸ +łŀʼnŋøœßŧþ・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ +・ÃÀÄÂĂÇĀĄÅÃĆĈČÇĊĎÉÈË +ÊĚĖĒĘ・ĜĞĢĠĤÃÃŒÃÃŽÇİĪĮĨ +ĴĶĹĽĻŃŇŅÑÓÒÖÔǑÅŌÕŔŘŖ +ŚŜŠŞŤŢÚÙÜÛŬǓŰŪŲŮŨǗǛǙ +ǕŴßŶŹŽŻ・・・・・・・・・・・・ +・áàäâăǎÄąåãćĉÄçċÄéèë +êěėēęǵÄğ・ġĥíìïîÇ・īįĩ +ĵķĺľļńňņñóòöôǒőÅõŕřŗ +śŚşťţúùüûŭǔűūųůũǘǜǚ +ǖŵýÿŷźžż・・・・・・・・・・・・ +・丂丄丅丌丒丟丣两丨丫丮丯丰丵乀ä¹ä¹„乇乑 +乚乜乣乨乩乴乵乹乿äºäº–亗äºäº¯äº¹ä»ƒä»ä»šä»›ä»  +仡仢仨仯仱仳仵份仾仿伀伂伃伈伋伌伒伕伖众 +伙伮伱你伳伵伷伹伻伾佀佂佈佉佋佌佒佔佖佘 +佟佣佪佬佮佱佷佸佹佺佽佾ä¾ä¾‚侄・・・・・ +・黸黿鼂鼃鼉é¼é¼é¼‘鼒鼔鼖鼗鼙鼚鼛鼟鼢鼦鼪 +鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖 +齗齘齚é½é½žé½¨é½©é½­é½®é½¯é½°é½±é½³é½µé½ºé½½é¾é¾é¾‘é¾’ +龔龖龗龞龡龢龣龥・・・・・・・・・・・・ +・・・・・・・・・・・・・・・・・・・・ diff --git a/mysql-test/suite/jp/t/jp_alter_sjis.test b/mysql-test/suite/jp/t/jp_alter_sjis.test new file mode 100755 index 00000000000..b7b31862599 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_alter_sjis.test @@ -0,0 +1,416 @@ +--character_set sjis +SET NAMES sjis; +SET character_set_database = sjis; +--disable_warnings +DROP TABLE IF EXISTS `±±±`; +DROP TABLE IF EXISTS `²²²`; +DROP TABLE IF EXISTS `‚ ‚ ‚ `; +DROP TABLE IF EXISTS `‚¢‚¢‚¢`; +DROP TABLE IF EXISTS `ƒ\ƒ\ƒ\`; +DROP TABLE IF EXISTS `\\\`; +--enable_warnings + +# +# Test altering table with Japanese characters in sjis encoding +# + +# +# Test InnoDB +# +CREATE TABLE `±±±`(`···` char(5)) DEFAULT CHARSET = sjis engine=INNODB; +CREATE TABLE `²²²`(`¹¹¹` char(5)) DEFAULT CHARSET = sjis engine=INNODB; +CREATE TABLE `‚ ‚ ‚ `(`‚«‚«‚«` char(5)) DEFAULT CHARSET = sjis engine=INNODB; +CREATE TABLE `‚¢‚¢‚¢`(`‚¯‚¯‚¯` char(5)) DEFAULT CHARSET = sjis engine=INNODB; +CREATE TABLE `ƒ\ƒ\ƒ\`(`•\•\•\` char(5)) DEFAULT CHARSET = sjis engine=INNODB; +CREATE TABLE `\\\`(`—\—\—\` char(5)) DEFAULT CHARSET = sjis engine=INNODB; + +INSERT INTO `±±±` VALUES ('±±±±±'),('²²²²²'),('³³³³³'); +INSERT INTO `‚ ‚ ‚ ` VALUES ('‚ ‚ ‚ ‚ ‚ '),('‚¢‚¢‚¢‚¢‚¢'),('‚¤‚¤‚¤‚¤‚¤'); +INSERT INTO `ƒ\ƒ\ƒ\` VALUES ('•\•\•\•\•\'),('\\\\\'),('”\”\”\”\”\'); + +# Test basic alter operation + +ALTER TABLE `±±±` ADD `¶¶¶` char(1) FIRST; +ALTER TABLE `±±±` ADD `¸¸¸` char(1) AFTER `···`; +ALTER TABLE `±±±` ADD `¹¹¹` char(1); +ALTER TABLE `±±±` ADD INDEX (`¶¶¶`); +ALTER TABLE `±±±` ADD PRIMARY KEY (`···`); +ALTER TABLE `±±±` ADD UNIQUE (`¸¸¸`); +#Multi-byte field name is not allowed for FOREIGN KEY As of 4.1.4 +#ALTER TABLE `±±±` ADD FOREIGN KEY (`¹¹¹`) REFERENCES `²²²`(`¹¹¹`); +ALTER TABLE `±±±` CHANGE `¶¶¶` `¶¶` char(1); +ALTER TABLE `±±±` MODIFY `···` char(6); + +SELECT * FROM `±±±`; +DESC `±±±`; +SHOW CREATE TABLE `±±±`; + +ALTER TABLE `±±±` DROP INDEX `¶¶¶`; +ALTER TABLE `±±±` DROP PRIMARY KEY; +ALTER TABLE `±±±` DROP INDEX `¸¸¸`; +#ALTER TABLE `±±±` DROP FOREIGN KEY `¹¹¹`; +ALTER TABLE `±±±` DROP `¶¶`; +ALTER TABLE `±±±` DROP `¸¸¸`; +ALTER TABLE `±±±` DROP `¹¹¹`; +SELECT * FROM `±±±`; +DESC `±±±`; +SHOW CREATE TABLE `±±±`; + +ALTER TABLE `‚ ‚ ‚ ` ADD `‚©‚©‚©` char(1) FIRST; +ALTER TABLE `‚ ‚ ‚ ` ADD `‚­‚­‚­` char(1) AFTER `‚«‚«‚«`; +ALTER TABLE `‚ ‚ ‚ ` ADD `‚¯‚¯‚¯` char(1); +ALTER TABLE `‚ ‚ ‚ ` ADD INDEX (`‚©‚©‚©`); +ALTER TABLE `‚ ‚ ‚ ` ADD PRIMARY KEY (`‚«‚«‚«`); +ALTER TABLE `‚ ‚ ‚ ` ADD UNIQUE (`‚­‚­‚­`); +#Multi-byte field name is not allowed for FOREIGN KEY As of 4.1.4 +#ALTER TABLE `‚ ‚ ‚ ` ADD FOREIGN KEY (`‚¯‚¯‚¯`) REFERENCES `‚¢‚¢‚¢`(`‚¯‚¯‚¯`); +ALTER TABLE `‚ ‚ ‚ ` CHANGE `‚©‚©‚©` `‚©‚©` char(1); +ALTER TABLE `‚ ‚ ‚ ` MODIFY `‚«‚«‚«` char(6); + +SELECT * FROM `‚ ‚ ‚ `; +DESC `‚ ‚ ‚ `; +SHOW CREATE TABLE `‚ ‚ ‚ `; + +ALTER TABLE `‚ ‚ ‚ ` DROP INDEX `‚©‚©‚©`; +ALTER TABLE `‚ ‚ ‚ ` DROP PRIMARY KEY; +ALTER TABLE `‚ ‚ ‚ ` DROP INDEX `‚­‚­‚­`; +#ALTER TABLE `‚ ‚ ‚ ` DROP FOREIGN KEY `‚¯‚¯‚¯`; +ALTER TABLE `‚ ‚ ‚ ` DROP `‚©‚©`; +ALTER TABLE `‚ ‚ ‚ ` DROP `‚­‚­‚­`; +ALTER TABLE `‚ ‚ ‚ ` DROP `‚¯‚¯‚¯`; + +SELECT * FROM `‚ ‚ ‚ `; +DESC `‚ ‚ ‚ `; +SHOW CREATE TABLE `‚ ‚ ‚ `; + +ALTER TABLE `ƒ\ƒ\ƒ\` ADD `\\\` char(1) FIRST; +ALTER TABLE `ƒ\ƒ\ƒ\` ADD `”\”\”\` char(1) AFTER `•\•\•\`; +ALTER TABLE `ƒ\ƒ\ƒ\` ADD `—\—\—\` char(1); +ALTER TABLE `ƒ\ƒ\ƒ\` ADD INDEX (`\\\`); +ALTER TABLE `ƒ\ƒ\ƒ\` ADD PRIMARY KEY (`•\•\•\`); +ALTER TABLE `ƒ\ƒ\ƒ\` ADD UNIQUE (`”\”\”\`); +#Multi-byte field name is not allowed for FOREIGN KEY As of 4.1.4 +#ALTER TABLE `ƒ\ƒ\ƒ\` ADD FOREIGN KEY (`—\—\—\`) REFERENCES `\\\`(`—\—\—\`); +ALTER TABLE `ƒ\ƒ\ƒ\` CHANGE `\\\` `\\` char(1); +ALTER TABLE `ƒ\ƒ\ƒ\` MODIFY `•\•\•\` char(6); + +SELECT * FROM `ƒ\ƒ\ƒ\`; +DESC `ƒ\ƒ\ƒ\`; +SHOW CREATE TABLE `ƒ\ƒ\ƒ\`; + +ALTER TABLE `ƒ\ƒ\ƒ\` DROP INDEX `\\\`; +ALTER TABLE `ƒ\ƒ\ƒ\` DROP PRIMARY KEY; +ALTER TABLE `ƒ\ƒ\ƒ\` DROP INDEX `”\”\”\`; +#ALTER TABLE `ƒ\ƒ\ƒ\` DROP FOREIGN KEY `—\—\—\`; +ALTER TABLE `ƒ\ƒ\ƒ\` DROP `\\`; +ALTER TABLE `ƒ\ƒ\ƒ\` DROP `”\”\”\`; +ALTER TABLE `ƒ\ƒ\ƒ\` DROP `—\—\—\`; + +SELECT * FROM `ƒ\ƒ\ƒ\`; +DESC `ƒ\ƒ\ƒ\`; +SHOW CREATE TABLE `ƒ\ƒ\ƒ\`; + +DROP TABLE `±±±`; +DROP TABLE `²²²`; +DROP TABLE `‚ ‚ ‚ `; +DROP TABLE `‚¢‚¢‚¢`; +DROP TABLE `ƒ\ƒ\ƒ\`; +DROP TABLE `\\\`; + +# +# Test MyISAM +# + +CREATE TABLE `±±±`(`···` char(5)) DEFAULT CHARSET = sjis engine=MYISAM; +CREATE TABLE `²²²`(`¹¹¹` char(5)) DEFAULT CHARSET = sjis engine=MYISAM; +CREATE TABLE `‚ ‚ ‚ `(`‚«‚«‚«` char(5)) DEFAULT CHARSET = sjis engine=MYISAM; +CREATE TABLE `‚¢‚¢‚¢`(`‚¯‚¯‚¯` char(5)) DEFAULT CHARSET = sjis engine=MYISAM; +CREATE TABLE `ƒ\ƒ\ƒ\`(`•\•\•\` char(5)) DEFAULT CHARSET = sjis engine=MYISAM; +CREATE TABLE `\\\`(`—\—\—\` char(5)) DEFAULT CHARSET = sjis engine=MYISAM; + +INSERT INTO `±±±` VALUES ('±±±±±'),('²²²²²'),('³³³³³'); +INSERT INTO `‚ ‚ ‚ ` VALUES ('‚ ‚ ‚ ‚ ‚ '),('‚¢‚¢‚¢‚¢‚¢'),('‚¤‚¤‚¤‚¤‚¤'); +INSERT INTO `ƒ\ƒ\ƒ\` VALUES ('•\•\•\•\•\'),('\\\\\'),('”\”\”\”\”\'); + +ALTER TABLE `±±±` ADD `¶¶¶` char(1) FIRST; +ALTER TABLE `±±±` ADD `¸¸¸` char(1) AFTER `···`; +ALTER TABLE `±±±` ADD `¹¹¹` char(1); +ALTER TABLE `±±±` ADD INDEX (`¶¶¶`); +ALTER TABLE `±±±` ADD PRIMARY KEY (`···`); +ALTER TABLE `±±±` ADD UNIQUE (`¸¸¸`); +#ALTER TABLE `±±±` ADD FOREIGN KEY (`¹¹¹`) REFERENCES `²²²`(`¹¹¹`); +ALTER TABLE `±±±` CHANGE `¶¶¶` `¶¶` char(1); +ALTER TABLE `±±±` MODIFY `···` char(6); + +SELECT * FROM `±±±`; +DESC `±±±`; +SHOW CREATE TABLE `±±±`; + +ALTER TABLE `±±±` DROP INDEX `¶¶¶`; +ALTER TABLE `±±±` DROP PRIMARY KEY; +ALTER TABLE `±±±` DROP INDEX `¸¸¸`; +#ALTER TABLE `±±±` DROP FOREIGN KEY `¹¹¹`; +ALTER TABLE `±±±` DROP `¶¶`; +ALTER TABLE `±±±` DROP `¸¸¸`; +ALTER TABLE `±±±` DROP `¹¹¹`; +SELECT * FROM `±±±`; +DESC `±±±`; +SHOW CREATE TABLE `±±±`; + +ALTER TABLE `‚ ‚ ‚ ` ADD `‚©‚©‚©` char(1) FIRST; +ALTER TABLE `‚ ‚ ‚ ` ADD `‚­‚­‚­` char(1) AFTER `‚«‚«‚«`; +ALTER TABLE `‚ ‚ ‚ ` ADD `‚¯‚¯‚¯` char(1); +ALTER TABLE `‚ ‚ ‚ ` ADD INDEX (`‚©‚©‚©`); +ALTER TABLE `‚ ‚ ‚ ` ADD PRIMARY KEY (`‚«‚«‚«`); +ALTER TABLE `‚ ‚ ‚ ` ADD UNIQUE (`‚­‚­‚­`); +#ALTER TABLE `‚ ‚ ‚ ` ADD FOREIGN KEY (`‚¯‚¯‚¯`) REFERENCES `‚¢‚¢‚¢`(`‚¯‚¯‚¯`); +ALTER TABLE `‚ ‚ ‚ ` CHANGE `‚©‚©‚©` `‚©‚©` char(1); +ALTER TABLE `‚ ‚ ‚ ` MODIFY `‚«‚«‚«` char(6); + +SELECT * FROM `‚ ‚ ‚ `; +DESC `‚ ‚ ‚ `; +SHOW CREATE TABLE `‚ ‚ ‚ `; + +ALTER TABLE `‚ ‚ ‚ ` DROP INDEX `‚©‚©‚©`; +ALTER TABLE `‚ ‚ ‚ ` DROP PRIMARY KEY; +ALTER TABLE `‚ ‚ ‚ ` DROP INDEX `‚­‚­‚­`; +#ALTER TABLE `‚ ‚ ‚ ` DROP FOREIGN KEY `‚¯‚¯‚¯`; +ALTER TABLE `‚ ‚ ‚ ` DROP `‚©‚©`; +ALTER TABLE `‚ ‚ ‚ ` DROP `‚­‚­‚­`; +ALTER TABLE `‚ ‚ ‚ ` DROP `‚¯‚¯‚¯`; + +SELECT * FROM `‚ ‚ ‚ `; +DESC `‚ ‚ ‚ `; +SHOW CREATE TABLE `‚ ‚ ‚ `; + +ALTER TABLE `ƒ\ƒ\ƒ\` ADD `\\\` char(1) FIRST; +ALTER TABLE `ƒ\ƒ\ƒ\` ADD `”\”\”\` char(1) AFTER `•\•\•\`; +ALTER TABLE `ƒ\ƒ\ƒ\` ADD `—\—\—\` char(1); +ALTER TABLE `ƒ\ƒ\ƒ\` ADD INDEX (`\\\`); +ALTER TABLE `ƒ\ƒ\ƒ\` ADD PRIMARY KEY (`•\•\•\`); +ALTER TABLE `ƒ\ƒ\ƒ\` ADD UNIQUE (`”\”\”\`); +#ALTER TABLE `ƒ\ƒ\ƒ\` ADD FOREIGN KEY (`—\—\—\`) REFERENCES `\\\`(`—\—\—\`); +ALTER TABLE `ƒ\ƒ\ƒ\` CHANGE `\\\` `\\` char(1); +ALTER TABLE `ƒ\ƒ\ƒ\` MODIFY `•\•\•\` char(6); + +SELECT * FROM `ƒ\ƒ\ƒ\`; +DESC `ƒ\ƒ\ƒ\`; +SHOW CREATE TABLE `ƒ\ƒ\ƒ\`; + +ALTER TABLE `ƒ\ƒ\ƒ\` DROP INDEX `\\\`; +ALTER TABLE `ƒ\ƒ\ƒ\` DROP PRIMARY KEY; +ALTER TABLE `ƒ\ƒ\ƒ\` DROP INDEX `”\”\”\`; +#ALTER TABLE `ƒ\ƒ\ƒ\` DROP FOREIGN KEY `—\—\—\`; +ALTER TABLE `ƒ\ƒ\ƒ\` DROP `\\`; +ALTER TABLE `ƒ\ƒ\ƒ\` DROP `”\”\”\`; +ALTER TABLE `ƒ\ƒ\ƒ\` DROP `—\—\—\`; + +SELECT * FROM `ƒ\ƒ\ƒ\`; +DESC `ƒ\ƒ\ƒ\`; +SHOW CREATE TABLE `ƒ\ƒ\ƒ\`; + +DROP TABLE `±±±`; +DROP TABLE `²²²`; +DROP TABLE `‚ ‚ ‚ `; +DROP TABLE `‚¢‚¢‚¢`; +DROP TABLE `ƒ\ƒ\ƒ\`; +DROP TABLE `\\\`; + +# +# Test HEAP +# + +CREATE TABLE `±±±`(`···` char(5)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TABLE `²²²`(`¹¹¹` char(5)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TABLE `‚ ‚ ‚ `(`‚«‚«‚«` char(5)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TABLE `‚¢‚¢‚¢`(`‚¯‚¯‚¯` char(5)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TABLE `ƒ\ƒ\ƒ\`(`•\•\•\` char(5)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TABLE `\\\`(`—\—\—\` char(5)) DEFAULT CHARSET = sjis engine=HEAP; + +INSERT INTO `±±±` VALUES ('±±±±±'),('²²²²²'),('³³³³³'); +INSERT INTO `‚ ‚ ‚ ` VALUES ('‚ ‚ ‚ ‚ ‚ '),('‚¢‚¢‚¢‚¢‚¢'),('‚¤‚¤‚¤‚¤‚¤'); +INSERT INTO `ƒ\ƒ\ƒ\` VALUES ('•\•\•\•\•\'),('\\\\\'),('”\”\”\”\”\'); + +ALTER TABLE `±±±` ADD `¶¶¶` char(1) FIRST; +ALTER TABLE `±±±` ADD `¸¸¸` char(1) AFTER `···`; +ALTER TABLE `±±±` ADD `¹¹¹` char(1); +ALTER TABLE `±±±` ADD INDEX (`¶¶¶`); +ALTER TABLE `±±±` ADD PRIMARY KEY (`···`); +ALTER TABLE `±±±` ADD UNIQUE (`¸¸¸`); +#ALTER TABLE `±±±` ADD FOREIGN KEY (`¹¹¹`) REFERENCES `²²²`(`¹¹¹`); +ALTER TABLE `±±±` CHANGE `¶¶¶` `¶¶` char(1); +ALTER TABLE `±±±` MODIFY `···` char(6); + +SELECT * FROM `±±±`; +DESC `±±±`; +SHOW CREATE TABLE `±±±`; + +ALTER TABLE `±±±` DROP INDEX `¶¶¶`; +ALTER TABLE `±±±` DROP PRIMARY KEY; +ALTER TABLE `±±±` DROP INDEX `¸¸¸`; +#ALTER TABLE `±±±` DROP FOREIGN KEY `¹¹¹`; +ALTER TABLE `±±±` DROP `¶¶`; +ALTER TABLE `±±±` DROP `¸¸¸`; +ALTER TABLE `±±±` DROP `¹¹¹`; +SELECT * FROM `±±±`; +DESC `±±±`; +SHOW CREATE TABLE `±±±`; + +ALTER TABLE `‚ ‚ ‚ ` ADD `‚©‚©‚©` char(1) FIRST; +ALTER TABLE `‚ ‚ ‚ ` ADD `‚­‚­‚­` char(1) AFTER `‚«‚«‚«`; +ALTER TABLE `‚ ‚ ‚ ` ADD `‚¯‚¯‚¯` char(1); +ALTER TABLE `‚ ‚ ‚ ` ADD INDEX (`‚©‚©‚©`); +ALTER TABLE `‚ ‚ ‚ ` ADD PRIMARY KEY (`‚«‚«‚«`); +ALTER TABLE `‚ ‚ ‚ ` ADD UNIQUE (`‚­‚­‚­`); +#ALTER TABLE `‚ ‚ ‚ ` ADD FOREIGN KEY (`‚¯‚¯‚¯`) REFERENCES `‚¢‚¢‚¢`(`‚¯‚¯‚¯`); +ALTER TABLE `‚ ‚ ‚ ` CHANGE `‚©‚©‚©` `‚©‚©` char(1); +ALTER TABLE `‚ ‚ ‚ ` MODIFY `‚«‚«‚«` char(6); + +SELECT * FROM `‚ ‚ ‚ `; +DESC `‚ ‚ ‚ `; +SHOW CREATE TABLE `‚ ‚ ‚ `; + +ALTER TABLE `‚ ‚ ‚ ` DROP INDEX `‚©‚©‚©`; +ALTER TABLE `‚ ‚ ‚ ` DROP PRIMARY KEY; +ALTER TABLE `‚ ‚ ‚ ` DROP INDEX `‚­‚­‚­`; +#ALTER TABLE `‚ ‚ ‚ ` DROP FOREIGN KEY `‚¯‚¯‚¯`; +ALTER TABLE `‚ ‚ ‚ ` DROP `‚©‚©`; +ALTER TABLE `‚ ‚ ‚ ` DROP `‚­‚­‚­`; +ALTER TABLE `‚ ‚ ‚ ` DROP `‚¯‚¯‚¯`; + +SELECT * FROM `‚ ‚ ‚ `; +DESC `‚ ‚ ‚ `; +SHOW CREATE TABLE `‚ ‚ ‚ `; + +ALTER TABLE `ƒ\ƒ\ƒ\` ADD `\\\` char(1) FIRST; +ALTER TABLE `ƒ\ƒ\ƒ\` ADD `”\”\”\` char(1) AFTER `•\•\•\`; +ALTER TABLE `ƒ\ƒ\ƒ\` ADD `—\—\—\` char(1); +ALTER TABLE `ƒ\ƒ\ƒ\` ADD INDEX (`\\\`); +ALTER TABLE `ƒ\ƒ\ƒ\` ADD PRIMARY KEY (`•\•\•\`); +ALTER TABLE `ƒ\ƒ\ƒ\` ADD UNIQUE (`”\”\”\`); +#ALTER TABLE `ƒ\ƒ\ƒ\` ADD FOREIGN KEY (`—\—\—\`) REFERENCES `\\\`(`—\—\—\`); +ALTER TABLE `ƒ\ƒ\ƒ\` CHANGE `\\\` `\\` char(1); +ALTER TABLE `ƒ\ƒ\ƒ\` MODIFY `•\•\•\` char(6); + +SELECT * FROM `ƒ\ƒ\ƒ\`; +DESC `ƒ\ƒ\ƒ\`; +SHOW CREATE TABLE `ƒ\ƒ\ƒ\`; + +ALTER TABLE `ƒ\ƒ\ƒ\` DROP INDEX `\\\`; +ALTER TABLE `ƒ\ƒ\ƒ\` DROP PRIMARY KEY; +ALTER TABLE `ƒ\ƒ\ƒ\` DROP INDEX `”\”\”\`; +#ALTER TABLE `ƒ\ƒ\ƒ\` DROP FOREIGN KEY `—\—\—\`; +ALTER TABLE `ƒ\ƒ\ƒ\` DROP `\\`; +ALTER TABLE `ƒ\ƒ\ƒ\` DROP `”\”\”\`; +ALTER TABLE `ƒ\ƒ\ƒ\` DROP `—\—\—\`; + +SELECT * FROM `ƒ\ƒ\ƒ\`; +DESC `ƒ\ƒ\ƒ\`; +SHOW CREATE TABLE `ƒ\ƒ\ƒ\`; + +DROP TABLE `±±±`; +DROP TABLE `²²²`; +DROP TABLE `‚ ‚ ‚ `; +DROP TABLE `‚¢‚¢‚¢`; +DROP TABLE `ƒ\ƒ\ƒ\`; +DROP TABLE `\\\`; + +# +# Test BDB +# + +CREATE TABLE `±±±`(`···` char(5)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TABLE `²²²`(`¹¹¹` char(5)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TABLE `‚ ‚ ‚ `(`‚«‚«‚«` char(5)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TABLE `‚¢‚¢‚¢`(`‚¯‚¯‚¯` char(5)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TABLE `ƒ\ƒ\ƒ\`(`•\•\•\` char(5)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TABLE `\\\`(`—\—\—\` char(5)) DEFAULT CHARSET = sjis engine=BDB; + +INSERT INTO `±±±` VALUES ('±±±±±'),('²²²²²'),('³³³³³'); +INSERT INTO `‚ ‚ ‚ ` VALUES ('‚ ‚ ‚ ‚ ‚ '),('‚¢‚¢‚¢‚¢‚¢'),('‚¤‚¤‚¤‚¤‚¤'); +INSERT INTO `ƒ\ƒ\ƒ\` VALUES ('•\•\•\•\•\'),('\\\\\'),('”\”\”\”\”\'); + +ALTER TABLE `±±±` ADD `¶¶¶` char(1) FIRST; +ALTER TABLE `±±±` ADD `¸¸¸` char(1) AFTER `···`; +ALTER TABLE `±±±` ADD `¹¹¹` char(1); +ALTER TABLE `±±±` ADD INDEX (`¶¶¶`); +ALTER TABLE `±±±` ADD PRIMARY KEY (`···`); +#Multiple NULL fields are not allowed in BDB +#ALTER TABLE `±±±` ADD UNIQUE (`¸¸¸`); +#ALTER TABLE `±±±` ADD FOREIGN KEY (`¹¹¹`) REFERENCES `²²²`(`¹¹¹`); +ALTER TABLE `±±±` CHANGE `¶¶¶` `¶¶` char(1); +ALTER TABLE `±±±` MODIFY `···` char(6); + +SELECT * FROM `±±±`; +DESC `±±±`; +SHOW CREATE TABLE `±±±`; + +ALTER TABLE `±±±` DROP INDEX `¶¶¶`; +ALTER TABLE `±±±` DROP PRIMARY KEY; +#ALTER TABLE `±±±` DROP INDEX `¸¸¸`; +#ALTER TABLE `±±±` DROP FOREIGN KEY `¹¹¹`; +ALTER TABLE `±±±` DROP `¶¶`; +ALTER TABLE `±±±` DROP `¸¸¸`; +ALTER TABLE `±±±` DROP `¹¹¹`; +SELECT * FROM `±±±`; +DESC `±±±`; +SHOW CREATE TABLE `±±±`; + +ALTER TABLE `‚ ‚ ‚ ` ADD `‚©‚©‚©` char(1) FIRST; +ALTER TABLE `‚ ‚ ‚ ` ADD `‚­‚­‚­` char(1) AFTER `‚«‚«‚«`; +ALTER TABLE `‚ ‚ ‚ ` ADD `‚¯‚¯‚¯` char(1); +ALTER TABLE `‚ ‚ ‚ ` ADD INDEX (`‚©‚©‚©`); +ALTER TABLE `‚ ‚ ‚ ` ADD PRIMARY KEY (`‚«‚«‚«`); +#ALTER TABLE `‚ ‚ ‚ ` ADD UNIQUE (`‚­‚­‚­`); +#ALTER TABLE `‚ ‚ ‚ ` ADD FOREIGN KEY (`‚¯‚¯‚¯`) REFERENCES `‚¢‚¢‚¢`(`‚¯‚¯‚¯`); +ALTER TABLE `‚ ‚ ‚ ` CHANGE `‚©‚©‚©` `‚©‚©` char(1); +ALTER TABLE `‚ ‚ ‚ ` MODIFY `‚«‚«‚«` char(6); + +SELECT * FROM `‚ ‚ ‚ `; +DESC `‚ ‚ ‚ `; +SHOW CREATE TABLE `‚ ‚ ‚ `; + +ALTER TABLE `‚ ‚ ‚ ` DROP INDEX `‚©‚©‚©`; +ALTER TABLE `‚ ‚ ‚ ` DROP PRIMARY KEY; +#ALTER TABLE `‚ ‚ ‚ ` DROP INDEX `‚­‚­‚­`; +#ALTER TABLE `‚ ‚ ‚ ` DROP FOREIGN KEY `‚¯‚¯‚¯`; +ALTER TABLE `‚ ‚ ‚ ` DROP `‚©‚©`; +ALTER TABLE `‚ ‚ ‚ ` DROP `‚­‚­‚­`; +ALTER TABLE `‚ ‚ ‚ ` DROP `‚¯‚¯‚¯`; + +SELECT * FROM `‚ ‚ ‚ `; +DESC `‚ ‚ ‚ `; +SHOW CREATE TABLE `‚ ‚ ‚ `; + +ALTER TABLE `ƒ\ƒ\ƒ\` ADD `\\\` char(1) FIRST; +ALTER TABLE `ƒ\ƒ\ƒ\` ADD `”\”\”\` char(1) AFTER `•\•\•\`; +ALTER TABLE `ƒ\ƒ\ƒ\` ADD `—\—\—\` char(1); +ALTER TABLE `ƒ\ƒ\ƒ\` ADD INDEX (`\\\`); +ALTER TABLE `ƒ\ƒ\ƒ\` ADD PRIMARY KEY (`•\•\•\`); +#ALTER TABLE `ƒ\ƒ\ƒ\` ADD UNIQUE (`”\”\”\`); +#ALTER TABLE `ƒ\ƒ\ƒ\` ADD FOREIGN KEY (`—\—\—\`) REFERENCES `\\\`(`—\—\—\`); +ALTER TABLE `ƒ\ƒ\ƒ\` CHANGE `\\\` `\\` char(1); +ALTER TABLE `ƒ\ƒ\ƒ\` MODIFY `•\•\•\` char(6); + +SELECT * FROM `ƒ\ƒ\ƒ\`; +DESC `ƒ\ƒ\ƒ\`; +SHOW CREATE TABLE `ƒ\ƒ\ƒ\`; + +ALTER TABLE `ƒ\ƒ\ƒ\` DROP INDEX `\\\`; +ALTER TABLE `ƒ\ƒ\ƒ\` DROP PRIMARY KEY; +#ALTER TABLE `ƒ\ƒ\ƒ\` DROP INDEX `”\”\”\`; +#ALTER TABLE `ƒ\ƒ\ƒ\` DROP FOREIGN KEY `—\—\—\`; +ALTER TABLE `ƒ\ƒ\ƒ\` DROP `\\`; +ALTER TABLE `ƒ\ƒ\ƒ\` DROP `”\”\”\`; +ALTER TABLE `ƒ\ƒ\ƒ\` DROP `—\—\—\`; + +SELECT * FROM `ƒ\ƒ\ƒ\`; +DESC `ƒ\ƒ\ƒ\`; +SHOW CREATE TABLE `ƒ\ƒ\ƒ\`; + +DROP TABLE `±±±`; +DROP TABLE `²²²`; +DROP TABLE `‚ ‚ ‚ `; +DROP TABLE `‚¢‚¢‚¢`; +DROP TABLE `ƒ\ƒ\ƒ\`; +DROP TABLE `\\\`; diff --git a/mysql-test/suite/jp/t/jp_alter_ucs2.test b/mysql-test/suite/jp/t/jp_alter_ucs2.test new file mode 100755 index 00000000000..6c5b3132edf --- /dev/null +++ b/mysql-test/suite/jp/t/jp_alter_ucs2.test @@ -0,0 +1,419 @@ +--source include/have_ucs2.inc + +--disable_warnings +DROP TABLE IF EXISTS `ޱޱޱ`; +DROP TABLE IF EXISTS `޲޲޲`; +DROP TABLE IF EXISTS `¤¢¤¢¤¢`; +DROP TABLE IF EXISTS `¤¤¤¤¤¤`; +DROP TABLE IF EXISTS `íÝíÝíÝ`; +DROP TABLE IF EXISTS `íÞíÞíÞ`; +--enable_warnings + +# +# Test altering table with Japanese characters in ucs2 encoding +# + +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; + +# +# Test InnoDB +# +CREATE TABLE `ޱޱޱ`(`Ž·Ž·Ž·` char(5)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TABLE `޲޲޲`(`޹޹޹` char(5)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TABLE `¤¢¤¢¤¢`(`¤­¤­¤­` char(5)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TABLE `¤¤¤¤¤¤`(`¤±¤±¤±` char(5)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TABLE `íÝíÝíÝ`(`°¡°¡°¡` char(5)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TABLE `íÞíÞíÞ`(`°´°´°´` char(5)) DEFAULT CHARSET = ucs2 engine=INNODB; + +INSERT INTO `ޱޱޱ` VALUES ('ޱޱޱޱޱ'),('޲޲޲޲޲'),('޳޳޳޳޳'); +INSERT INTO `¤¢¤¢¤¢` VALUES ('¤¢¤¢¤¢¤¢¤¢'),('¤¤¤¤¤¤¤¤¤¤'),('¤¦¤¦¤¦¤¦¤¦'); +INSERT INTO `íÝíÝíÝ` VALUES ('°¡°¡°¡°¡°¡'),('°¢°¢°¢°¢°¢'),('°£°£°£°£°£'); + +# Test basic alter operation + +ALTER TABLE `ޱޱޱ` ADD `޶޶޶` char(1) FIRST; +ALTER TABLE `ޱޱޱ` ADD `ޏޏޏ` char(1) AFTER `Ž·Ž·Ž·`; +ALTER TABLE `ޱޱޱ` ADD `޹޹޹` char(1); +ALTER TABLE `ޱޱޱ` ADD INDEX (`޶޶޶`); +ALTER TABLE `ޱޱޱ` ADD PRIMARY KEY (`Ž·Ž·Ž·`); +ALTER TABLE `ޱޱޱ` ADD UNIQUE (`ޏޏޏ`); +#Multi-byte field name is not allowed for FOREIGN KEY As of 4.1.4 +#ALTER TABLE `ޱޱޱ` ADD FOREIGN KEY (`޹޹޹`) REFERENCES `޲޲޲`(`޹޹޹`); +ALTER TABLE `ޱޱޱ` CHANGE `޶޶޶` `޶޶` char(1); +ALTER TABLE `ޱޱޱ` MODIFY `Ž·Ž·Ž·` char(6); + +SELECT * FROM `ޱޱޱ`; +DESC `ޱޱޱ`; +SHOW CREATE TABLE `ޱޱޱ`; + +ALTER TABLE `ޱޱޱ` DROP INDEX `޶޶޶`; +ALTER TABLE `ޱޱޱ` DROP PRIMARY KEY; +ALTER TABLE `ޱޱޱ` DROP INDEX `ޏޏޏ`; +#ALTER TABLE `ޱޱޱ` DROP FOREIGN KEY `޹޹޹`; +ALTER TABLE `ޱޱޱ` DROP `޶޶`; +ALTER TABLE `ޱޱޱ` DROP `ޏޏޏ`; +ALTER TABLE `ޱޱޱ` DROP `޹޹޹`; +SELECT * FROM `ޱޱޱ`; +DESC `ޱޱޱ`; +SHOW CREATE TABLE `ޱޱޱ`; + +ALTER TABLE `¤¢¤¢¤¢` ADD `¤«¤«¤«` char(1) FIRST; +ALTER TABLE `¤¢¤¢¤¢` ADD `¤¯¤¯¤¯` char(1) AFTER `¤­¤­¤­`; +ALTER TABLE `¤¢¤¢¤¢` ADD `¤±¤±¤±` char(1); +ALTER TABLE `¤¢¤¢¤¢` ADD INDEX (`¤«¤«¤«`); +ALTER TABLE `¤¢¤¢¤¢` ADD PRIMARY KEY (`¤­¤­¤­`); +ALTER TABLE `¤¢¤¢¤¢` ADD UNIQUE (`¤¯¤¯¤¯`); +#Multi-byte field name is not allowed for FOREIGN KEY As of 4.1.4 +#ALTER TABLE `¤¢¤¢¤¢` ADD FOREIGN KEY (`¤±¤±¤±`) REFERENCES `¤¤¤¤¤¤`(`¤±¤±¤±`); +ALTER TABLE `¤¢¤¢¤¢` CHANGE `¤«¤«¤«` `¤«¤«` char(1); +ALTER TABLE `¤¢¤¢¤¢` MODIFY `¤­¤­¤­` char(6); + +SELECT * FROM `¤¢¤¢¤¢`; +DESC `¤¢¤¢¤¢`; +SHOW CREATE TABLE `¤¢¤¢¤¢`; + +ALTER TABLE `¤¢¤¢¤¢` DROP INDEX `¤«¤«¤«`; +ALTER TABLE `¤¢¤¢¤¢` DROP PRIMARY KEY; +ALTER TABLE `¤¢¤¢¤¢` DROP INDEX `¤¯¤¯¤¯`; +#ALTER TABLE `¤¢¤¢¤¢` DROP FOREIGN KEY `¤±¤±¤±`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤«¤«`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤¯¤¯¤¯`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤±¤±¤±`; + +SELECT * FROM `¤¢¤¢¤¢`; +DESC `¤¢¤¢¤¢`; +SHOW CREATE TABLE `¤¢¤¢¤¢`; + +ALTER TABLE `íÝíÝíÝ` ADD `°¢°¢°¢` char(1) FIRST; +ALTER TABLE `íÝíÝíÝ` ADD `°£°£°£` char(1) AFTER `°¡°¡°¡`; +ALTER TABLE `íÝíÝíÝ` ADD `°´°´°´` char(1); +ALTER TABLE `íÝíÝíÝ` ADD INDEX (`°¢°¢°¢`); +ALTER TABLE `íÝíÝíÝ` ADD PRIMARY KEY (`°¡°¡°¡`); +ALTER TABLE `íÝíÝíÝ` ADD UNIQUE (`°£°£°£`); +#Multi-byte field name is not allowed for FOREIGN KEY As of 4.1.4 +#ALTER TABLE `íÝíÝíÝ` ADD FOREIGN KEY (`°´°´°´`) REFERENCES `íÞíÞíÞ`(`°´°´°´`); +ALTER TABLE `íÝíÝíÝ` CHANGE `°¢°¢°¢` `°¢°¢` char(1); +ALTER TABLE `íÝíÝíÝ` MODIFY `°¡°¡°¡` char(6); + +SELECT * FROM `íÝíÝíÝ`; +DESC `íÝíÝíÝ`; +SHOW CREATE TABLE `íÝíÝíÝ`; + +ALTER TABLE `íÝíÝíÝ` DROP INDEX `°¢°¢°¢`; +ALTER TABLE `íÝíÝíÝ` DROP PRIMARY KEY; +ALTER TABLE `íÝíÝíÝ` DROP INDEX `°£°£°£`; +#ALTER TABLE `íÝíÝíÝ` DROP FOREIGN KEY `°´°´°´`; +ALTER TABLE `íÝíÝíÝ` DROP `°¢°¢`; +ALTER TABLE `íÝíÝíÝ` DROP `°£°£°£`; +ALTER TABLE `íÝíÝíÝ` DROP `°´°´°´`; + +SELECT * FROM `íÝíÝíÝ`; +DESC `íÝíÝíÝ`; +SHOW CREATE TABLE `íÝíÝíÝ`; + +DROP TABLE `ޱޱޱ`; +DROP TABLE `޲޲޲`; +DROP TABLE `¤¢¤¢¤¢`; +DROP TABLE `¤¤¤¤¤¤`; +DROP TABLE `íÝíÝíÝ`; +DROP TABLE `íÞíÞíÞ`; + +# +# Test MyISAM +# + +CREATE TABLE `ޱޱޱ`(`Ž·Ž·Ž·` char(5)) DEFAULT CHARSET = ucs2 engine=MYISAM; +CREATE TABLE `޲޲޲`(`޹޹޹` char(5)) DEFAULT CHARSET = ucs2 engine=MYISAM; +CREATE TABLE `¤¢¤¢¤¢`(`¤­¤­¤­` char(5)) DEFAULT CHARSET = ucs2 engine=MYISAM; +CREATE TABLE `¤¤¤¤¤¤`(`¤±¤±¤±` char(5)) DEFAULT CHARSET = ucs2 engine=MYISAM; +CREATE TABLE `íÝíÝíÝ`(`°¡°¡°¡` char(5)) DEFAULT CHARSET = ucs2 engine=MYISAM; +CREATE TABLE `íÞíÞíÞ`(`°´°´°´` char(5)) DEFAULT CHARSET = ucs2 engine=MYISAM; + +INSERT INTO `ޱޱޱ` VALUES ('ޱޱޱޱޱ'),('޲޲޲޲޲'),('޳޳޳޳޳'); +INSERT INTO `¤¢¤¢¤¢` VALUES ('¤¢¤¢¤¢¤¢¤¢'),('¤¤¤¤¤¤¤¤¤¤'),('¤¦¤¦¤¦¤¦¤¦'); +INSERT INTO `íÝíÝíÝ` VALUES ('°¡°¡°¡°¡°¡'),('°¢°¢°¢°¢°¢'),('°£°£°£°£°£'); + +ALTER TABLE `ޱޱޱ` ADD `޶޶޶` char(1) FIRST; +ALTER TABLE `ޱޱޱ` ADD `ޏޏޏ` char(1) AFTER `Ž·Ž·Ž·`; +ALTER TABLE `ޱޱޱ` ADD `޹޹޹` char(1); +ALTER TABLE `ޱޱޱ` ADD INDEX (`޶޶޶`); +ALTER TABLE `ޱޱޱ` ADD PRIMARY KEY (`Ž·Ž·Ž·`); +ALTER TABLE `ޱޱޱ` ADD UNIQUE (`ޏޏޏ`); +#ALTER TABLE `ޱޱޱ` ADD FOREIGN KEY (`޹޹޹`) REFERENCES `޲޲޲`(`޹޹޹`); +ALTER TABLE `ޱޱޱ` CHANGE `޶޶޶` `޶޶` char(1); +ALTER TABLE `ޱޱޱ` MODIFY `Ž·Ž·Ž·` char(6); + +SELECT * FROM `ޱޱޱ`; +DESC `ޱޱޱ`; +SHOW CREATE TABLE `ޱޱޱ`; + +ALTER TABLE `ޱޱޱ` DROP INDEX `޶޶޶`; +ALTER TABLE `ޱޱޱ` DROP PRIMARY KEY; +ALTER TABLE `ޱޱޱ` DROP INDEX `ޏޏޏ`; +#ALTER TABLE `ޱޱޱ` DROP FOREIGN KEY `޹޹޹`; +ALTER TABLE `ޱޱޱ` DROP `޶޶`; +ALTER TABLE `ޱޱޱ` DROP `ޏޏޏ`; +ALTER TABLE `ޱޱޱ` DROP `޹޹޹`; +SELECT * FROM `ޱޱޱ`; +DESC `ޱޱޱ`; +SHOW CREATE TABLE `ޱޱޱ`; + +ALTER TABLE `¤¢¤¢¤¢` ADD `¤«¤«¤«` char(1) FIRST; +ALTER TABLE `¤¢¤¢¤¢` ADD `¤¯¤¯¤¯` char(1) AFTER `¤­¤­¤­`; +ALTER TABLE `¤¢¤¢¤¢` ADD `¤±¤±¤±` char(1); +ALTER TABLE `¤¢¤¢¤¢` ADD INDEX (`¤«¤«¤«`); +ALTER TABLE `¤¢¤¢¤¢` ADD PRIMARY KEY (`¤­¤­¤­`); +ALTER TABLE `¤¢¤¢¤¢` ADD UNIQUE (`¤¯¤¯¤¯`); +#ALTER TABLE `¤¢¤¢¤¢` ADD FOREIGN KEY (`¤±¤±¤±`) REFERENCES `¤¤¤¤¤¤`(`¤±¤±¤±`); +ALTER TABLE `¤¢¤¢¤¢` CHANGE `¤«¤«¤«` `¤«¤«` char(1); +ALTER TABLE `¤¢¤¢¤¢` MODIFY `¤­¤­¤­` char(6); + +SELECT * FROM `¤¢¤¢¤¢`; +DESC `¤¢¤¢¤¢`; +SHOW CREATE TABLE `¤¢¤¢¤¢`; + +ALTER TABLE `¤¢¤¢¤¢` DROP INDEX `¤«¤«¤«`; +ALTER TABLE `¤¢¤¢¤¢` DROP PRIMARY KEY; +ALTER TABLE `¤¢¤¢¤¢` DROP INDEX `¤¯¤¯¤¯`; +#ALTER TABLE `¤¢¤¢¤¢` DROP FOREIGN KEY `¤±¤±¤±`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤«¤«`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤¯¤¯¤¯`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤±¤±¤±`; + +SELECT * FROM `¤¢¤¢¤¢`; +DESC `¤¢¤¢¤¢`; +SHOW CREATE TABLE `¤¢¤¢¤¢`; + +ALTER TABLE `íÝíÝíÝ` ADD `°¢°¢°¢` char(1) FIRST; +ALTER TABLE `íÝíÝíÝ` ADD `°£°£°£` char(1) AFTER `°¡°¡°¡`; +ALTER TABLE `íÝíÝíÝ` ADD `°´°´°´` char(1); +ALTER TABLE `íÝíÝíÝ` ADD INDEX (`°¢°¢°¢`); +ALTER TABLE `íÝíÝíÝ` ADD PRIMARY KEY (`°¡°¡°¡`); +ALTER TABLE `íÝíÝíÝ` ADD UNIQUE (`°£°£°£`); +#ALTER TABLE `íÝíÝíÝ` ADD FOREIGN KEY (`°´°´°´`) REFERENCES `íÞíÞíÞ`(`°´°´°´`); +ALTER TABLE `íÝíÝíÝ` CHANGE `°¢°¢°¢` `°¢°¢` char(1); +ALTER TABLE `íÝíÝíÝ` MODIFY `°¡°¡°¡` char(6); + +SELECT * FROM `íÝíÝíÝ`; +DESC `íÝíÝíÝ`; +SHOW CREATE TABLE `íÝíÝíÝ`; + +ALTER TABLE `íÝíÝíÝ` DROP INDEX `°¢°¢°¢`; +ALTER TABLE `íÝíÝíÝ` DROP PRIMARY KEY; +ALTER TABLE `íÝíÝíÝ` DROP INDEX `°£°£°£`; +#ALTER TABLE `íÝíÝíÝ` DROP FOREIGN KEY `°´°´°´`; +ALTER TABLE `íÝíÝíÝ` DROP `°¢°¢`; +ALTER TABLE `íÝíÝíÝ` DROP `°£°£°£`; +ALTER TABLE `íÝíÝíÝ` DROP `°´°´°´`; + +SELECT * FROM `íÝíÝíÝ`; +DESC `íÝíÝíÝ`; +SHOW CREATE TABLE `íÝíÝíÝ`; + +DROP TABLE `ޱޱޱ`; +DROP TABLE `޲޲޲`; +DROP TABLE `¤¢¤¢¤¢`; +DROP TABLE `¤¤¤¤¤¤`; +DROP TABLE `íÝíÝíÝ`; +DROP TABLE `íÞíÞíÞ`; + +# +# Test HEAP +# + +CREATE TABLE `ޱޱޱ`(`Ž·Ž·Ž·` char(5)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TABLE `޲޲޲`(`޹޹޹` char(5)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TABLE `¤¢¤¢¤¢`(`¤­¤­¤­` char(5)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TABLE `¤¤¤¤¤¤`(`¤±¤±¤±` char(5)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TABLE `íÝíÝíÝ`(`°¡°¡°¡` char(5)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TABLE `íÞíÞíÞ`(`°´°´°´` char(5)) DEFAULT CHARSET = ucs2 engine=HEAP; + +INSERT INTO `ޱޱޱ` VALUES ('ޱޱޱޱޱ'),('޲޲޲޲޲'),('޳޳޳޳޳'); +INSERT INTO `¤¢¤¢¤¢` VALUES ('¤¢¤¢¤¢¤¢¤¢'),('¤¤¤¤¤¤¤¤¤¤'),('¤¦¤¦¤¦¤¦¤¦'); +INSERT INTO `íÝíÝíÝ` VALUES ('°¡°¡°¡°¡°¡'),('°¢°¢°¢°¢°¢'),('°£°£°£°£°£'); + +ALTER TABLE `ޱޱޱ` ADD `޶޶޶` char(1) FIRST; +ALTER TABLE `ޱޱޱ` ADD `ޏޏޏ` char(1) AFTER `Ž·Ž·Ž·`; +ALTER TABLE `ޱޱޱ` ADD `޹޹޹` char(1); +ALTER TABLE `ޱޱޱ` ADD INDEX (`޶޶޶`); +ALTER TABLE `ޱޱޱ` ADD PRIMARY KEY (`Ž·Ž·Ž·`); +ALTER TABLE `ޱޱޱ` ADD UNIQUE (`ޏޏޏ`); +#ALTER TABLE `ޱޱޱ` ADD FOREIGN KEY (`޹޹޹`) REFERENCES `޲޲޲`(`޹޹޹`); +ALTER TABLE `ޱޱޱ` CHANGE `޶޶޶` `޶޶` char(1); +ALTER TABLE `ޱޱޱ` MODIFY `Ž·Ž·Ž·` char(6); + +SELECT * FROM `ޱޱޱ`; +DESC `ޱޱޱ`; +SHOW CREATE TABLE `ޱޱޱ`; + +ALTER TABLE `ޱޱޱ` DROP INDEX `޶޶޶`; +ALTER TABLE `ޱޱޱ` DROP PRIMARY KEY; +ALTER TABLE `ޱޱޱ` DROP INDEX `ޏޏޏ`; +#ALTER TABLE `ޱޱޱ` DROP FOREIGN KEY `޹޹޹`; +ALTER TABLE `ޱޱޱ` DROP `޶޶`; +ALTER TABLE `ޱޱޱ` DROP `ޏޏޏ`; +ALTER TABLE `ޱޱޱ` DROP `޹޹޹`; +SELECT * FROM `ޱޱޱ`; +DESC `ޱޱޱ`; +SHOW CREATE TABLE `ޱޱޱ`; + +ALTER TABLE `¤¢¤¢¤¢` ADD `¤«¤«¤«` char(1) FIRST; +ALTER TABLE `¤¢¤¢¤¢` ADD `¤¯¤¯¤¯` char(1) AFTER `¤­¤­¤­`; +ALTER TABLE `¤¢¤¢¤¢` ADD `¤±¤±¤±` char(1); +ALTER TABLE `¤¢¤¢¤¢` ADD INDEX (`¤«¤«¤«`); +ALTER TABLE `¤¢¤¢¤¢` ADD PRIMARY KEY (`¤­¤­¤­`); +ALTER TABLE `¤¢¤¢¤¢` ADD UNIQUE (`¤¯¤¯¤¯`); +#ALTER TABLE `¤¢¤¢¤¢` ADD FOREIGN KEY (`¤±¤±¤±`) REFERENCES `¤¤¤¤¤¤`(`¤±¤±¤±`); +ALTER TABLE `¤¢¤¢¤¢` CHANGE `¤«¤«¤«` `¤«¤«` char(1); +ALTER TABLE `¤¢¤¢¤¢` MODIFY `¤­¤­¤­` char(6); + +SELECT * FROM `¤¢¤¢¤¢`; +DESC `¤¢¤¢¤¢`; +SHOW CREATE TABLE `¤¢¤¢¤¢`; + +ALTER TABLE `¤¢¤¢¤¢` DROP INDEX `¤«¤«¤«`; +ALTER TABLE `¤¢¤¢¤¢` DROP PRIMARY KEY; +ALTER TABLE `¤¢¤¢¤¢` DROP INDEX `¤¯¤¯¤¯`; +#ALTER TABLE `¤¢¤¢¤¢` DROP FOREIGN KEY `¤±¤±¤±`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤«¤«`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤¯¤¯¤¯`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤±¤±¤±`; + +SELECT * FROM `¤¢¤¢¤¢`; +DESC `¤¢¤¢¤¢`; +SHOW CREATE TABLE `¤¢¤¢¤¢`; + +ALTER TABLE `íÝíÝíÝ` ADD `°¢°¢°¢` char(1) FIRST; +ALTER TABLE `íÝíÝíÝ` ADD `°£°£°£` char(1) AFTER `°¡°¡°¡`; +ALTER TABLE `íÝíÝíÝ` ADD `°´°´°´` char(1); +ALTER TABLE `íÝíÝíÝ` ADD INDEX (`°¢°¢°¢`); +ALTER TABLE `íÝíÝíÝ` ADD PRIMARY KEY (`°¡°¡°¡`); +ALTER TABLE `íÝíÝíÝ` ADD UNIQUE (`°£°£°£`); +#ALTER TABLE `íÝíÝíÝ` ADD FOREIGN KEY (`°´°´°´`) REFERENCES `íÞíÞíÞ`(`°´°´°´`); +ALTER TABLE `íÝíÝíÝ` CHANGE `°¢°¢°¢` `°¢°¢` char(1); +ALTER TABLE `íÝíÝíÝ` MODIFY `°¡°¡°¡` char(6); + +SELECT * FROM `íÝíÝíÝ`; +DESC `íÝíÝíÝ`; +SHOW CREATE TABLE `íÝíÝíÝ`; + +ALTER TABLE `íÝíÝíÝ` DROP INDEX `°¢°¢°¢`; +ALTER TABLE `íÝíÝíÝ` DROP PRIMARY KEY; +ALTER TABLE `íÝíÝíÝ` DROP INDEX `°£°£°£`; +#ALTER TABLE `íÝíÝíÝ` DROP FOREIGN KEY `°´°´°´`; +ALTER TABLE `íÝíÝíÝ` DROP `°¢°¢`; +ALTER TABLE `íÝíÝíÝ` DROP `°£°£°£`; +ALTER TABLE `íÝíÝíÝ` DROP `°´°´°´`; + +SELECT * FROM `íÝíÝíÝ`; +DESC `íÝíÝíÝ`; +SHOW CREATE TABLE `íÝíÝíÝ`; + +DROP TABLE `ޱޱޱ`; +DROP TABLE `޲޲޲`; +DROP TABLE `¤¢¤¢¤¢`; +DROP TABLE `¤¤¤¤¤¤`; +DROP TABLE `íÝíÝíÝ`; +DROP TABLE `íÞíÞíÞ`; + +# +# Test BDB +# + +CREATE TABLE `ޱޱޱ`(`Ž·Ž·Ž·` char(5)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TABLE `޲޲޲`(`޹޹޹` char(5)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TABLE `¤¢¤¢¤¢`(`¤­¤­¤­` char(5)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TABLE `¤¤¤¤¤¤`(`¤±¤±¤±` char(5)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TABLE `íÝíÝíÝ`(`°¡°¡°¡` char(5)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TABLE `íÞíÞíÞ`(`°´°´°´` char(5)) DEFAULT CHARSET = ucs2 engine=BDB; + +INSERT INTO `ޱޱޱ` VALUES ('ޱޱޱޱޱ'),('޲޲޲޲޲'),('޳޳޳޳޳'); +INSERT INTO `¤¢¤¢¤¢` VALUES ('¤¢¤¢¤¢¤¢¤¢'),('¤¤¤¤¤¤¤¤¤¤'),('¤¦¤¦¤¦¤¦¤¦'); +INSERT INTO `íÝíÝíÝ` VALUES ('°¡°¡°¡°¡°¡'),('°¢°¢°¢°¢°¢'),('°£°£°£°£°£'); + +ALTER TABLE `ޱޱޱ` ADD `޶޶޶` char(1) FIRST; +ALTER TABLE `ޱޱޱ` ADD `ޏޏޏ` char(1) AFTER `Ž·Ž·Ž·`; +ALTER TABLE `ޱޱޱ` ADD `޹޹޹` char(1); +ALTER TABLE `ޱޱޱ` ADD INDEX (`޶޶޶`); +ALTER TABLE `ޱޱޱ` ADD PRIMARY KEY (`Ž·Ž·Ž·`); +#Multiple NULL fields are not allowed in BDB +#ALTER TABLE `ޱޱޱ` ADD UNIQUE (`ޏޏޏ`); +#ALTER TABLE `ޱޱޱ` ADD FOREIGN KEY (`޹޹޹`) REFERENCES `޲޲޲`(`޹޹޹`); +ALTER TABLE `ޱޱޱ` CHANGE `޶޶޶` `޶޶` char(1); +ALTER TABLE `ޱޱޱ` MODIFY `Ž·Ž·Ž·` char(6); + +SELECT * FROM `ޱޱޱ`; +DESC `ޱޱޱ`; +SHOW CREATE TABLE `ޱޱޱ`; + +ALTER TABLE `ޱޱޱ` DROP INDEX `޶޶޶`; +ALTER TABLE `ޱޱޱ` DROP PRIMARY KEY; +#ALTER TABLE `ޱޱޱ` DROP INDEX `ޏޏޏ`; +#ALTER TABLE `ޱޱޱ` DROP FOREIGN KEY `޹޹޹`; +ALTER TABLE `ޱޱޱ` DROP `޶޶`; +ALTER TABLE `ޱޱޱ` DROP `ޏޏޏ`; +ALTER TABLE `ޱޱޱ` DROP `޹޹޹`; +SELECT * FROM `ޱޱޱ`; +DESC `ޱޱޱ`; +SHOW CREATE TABLE `ޱޱޱ`; + +ALTER TABLE `¤¢¤¢¤¢` ADD `¤«¤«¤«` char(1) FIRST; +ALTER TABLE `¤¢¤¢¤¢` ADD `¤¯¤¯¤¯` char(1) AFTER `¤­¤­¤­`; +ALTER TABLE `¤¢¤¢¤¢` ADD `¤±¤±¤±` char(1); +ALTER TABLE `¤¢¤¢¤¢` ADD INDEX (`¤«¤«¤«`); +ALTER TABLE `¤¢¤¢¤¢` ADD PRIMARY KEY (`¤­¤­¤­`); +#ALTER TABLE `¤¢¤¢¤¢` ADD UNIQUE (`¤¯¤¯¤¯`); +#ALTER TABLE `¤¢¤¢¤¢` ADD FOREIGN KEY (`¤±¤±¤±`) REFERENCES `¤¤¤¤¤¤`(`¤±¤±¤±`); +ALTER TABLE `¤¢¤¢¤¢` CHANGE `¤«¤«¤«` `¤«¤«` char(1); +ALTER TABLE `¤¢¤¢¤¢` MODIFY `¤­¤­¤­` char(6); + +SELECT * FROM `¤¢¤¢¤¢`; +DESC `¤¢¤¢¤¢`; +SHOW CREATE TABLE `¤¢¤¢¤¢`; + +ALTER TABLE `¤¢¤¢¤¢` DROP INDEX `¤«¤«¤«`; +ALTER TABLE `¤¢¤¢¤¢` DROP PRIMARY KEY; +#ALTER TABLE `¤¢¤¢¤¢` DROP INDEX `¤¯¤¯¤¯`; +#ALTER TABLE `¤¢¤¢¤¢` DROP FOREIGN KEY `¤±¤±¤±`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤«¤«`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤¯¤¯¤¯`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤±¤±¤±`; + +SELECT * FROM `¤¢¤¢¤¢`; +DESC `¤¢¤¢¤¢`; +SHOW CREATE TABLE `¤¢¤¢¤¢`; + +ALTER TABLE `íÝíÝíÝ` ADD `°¢°¢°¢` char(1) FIRST; +ALTER TABLE `íÝíÝíÝ` ADD `°£°£°£` char(1) AFTER `°¡°¡°¡`; +ALTER TABLE `íÝíÝíÝ` ADD `°´°´°´` char(1); +ALTER TABLE `íÝíÝíÝ` ADD INDEX (`°¢°¢°¢`); +ALTER TABLE `íÝíÝíÝ` ADD PRIMARY KEY (`°¡°¡°¡`); +#ALTER TABLE `íÝíÝíÝ` ADD UNIQUE (`°£°£°£`); +#ALTER TABLE `íÝíÝíÝ` ADD FOREIGN KEY (`°´°´°´`) REFERENCES `íÞíÞíÞ`(`°´°´°´`); +ALTER TABLE `íÝíÝíÝ` CHANGE `°¢°¢°¢` `°¢°¢` char(1); +ALTER TABLE `íÝíÝíÝ` MODIFY `°¡°¡°¡` char(6); + +SELECT * FROM `íÝíÝíÝ`; +DESC `íÝíÝíÝ`; +SHOW CREATE TABLE `íÝíÝíÝ`; + +ALTER TABLE `íÝíÝíÝ` DROP INDEX `°¢°¢°¢`; +ALTER TABLE `íÝíÝíÝ` DROP PRIMARY KEY; +#ALTER TABLE `íÝíÝíÝ` DROP INDEX `°£°£°£`; +#ALTER TABLE `íÝíÝíÝ` DROP FOREIGN KEY `°´°´°´`; +ALTER TABLE `íÝíÝíÝ` DROP `°¢°¢`; +ALTER TABLE `íÝíÝíÝ` DROP `°£°£°£`; +ALTER TABLE `íÝíÝíÝ` DROP `°´°´°´`; + +SELECT * FROM `íÝíÝíÝ`; +DESC `íÝíÝíÝ`; +SHOW CREATE TABLE `íÝíÝíÝ`; + +DROP TABLE `ޱޱޱ`; +DROP TABLE `޲޲޲`; +DROP TABLE `¤¢¤¢¤¢`; +DROP TABLE `¤¤¤¤¤¤`; +DROP TABLE `íÝíÝíÝ`; +DROP TABLE `íÞíÞíÞ`; diff --git a/mysql-test/suite/jp/t/jp_alter_ujis.test b/mysql-test/suite/jp/t/jp_alter_ujis.test new file mode 100755 index 00000000000..d388d20c49b --- /dev/null +++ b/mysql-test/suite/jp/t/jp_alter_ujis.test @@ -0,0 +1,418 @@ +--source include/have_ujis.inc + +--disable_warnings +DROP TABLE IF EXISTS `ޱޱޱ`; +DROP TABLE IF EXISTS `޲޲޲`; +DROP TABLE IF EXISTS `¤¢¤¢¤¢`; +DROP TABLE IF EXISTS `¤¤¤¤¤¤`; +DROP TABLE IF EXISTS `íÝíÝíÝ`; +DROP TABLE IF EXISTS `íÞíÞíÞ`; +--enable_warnings + +# +# Test altering table with Japanese characters in ujis encoding +# + +SET NAMES ujis; +SET character_set_database = ujis; + +# +# Test InnoDB +# +CREATE TABLE `ޱޱޱ`(`Ž·Ž·Ž·` char(5)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TABLE `޲޲޲`(`޹޹޹` char(5)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TABLE `¤¢¤¢¤¢`(`¤­¤­¤­` char(5)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TABLE `¤¤¤¤¤¤`(`¤±¤±¤±` char(5)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TABLE `íÝíÝíÝ`(`°¡°¡°¡` char(5)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TABLE `íÞíÞíÞ`(`°´°´°´` char(5)) DEFAULT CHARSET = ujis engine=INNODB; + +INSERT INTO `ޱޱޱ` VALUES ('ޱޱޱޱޱ'),('޲޲޲޲޲'),('޳޳޳޳޳'); +INSERT INTO `¤¢¤¢¤¢` VALUES ('¤¢¤¢¤¢¤¢¤¢'),('¤¤¤¤¤¤¤¤¤¤'),('¤¦¤¦¤¦¤¦¤¦'); +INSERT INTO `íÝíÝíÝ` VALUES ('°¡°¡°¡°¡°¡'),('°¢°¢°¢°¢°¢'),('°£°£°£°£°£'); + +# Test basic alter operation + +ALTER TABLE `ޱޱޱ` ADD `޶޶޶` char(1) FIRST; +ALTER TABLE `ޱޱޱ` ADD `ޏޏޏ` char(1) AFTER `Ž·Ž·Ž·`; +ALTER TABLE `ޱޱޱ` ADD `޹޹޹` char(1); +ALTER TABLE `ޱޱޱ` ADD INDEX (`޶޶޶`); +ALTER TABLE `ޱޱޱ` ADD PRIMARY KEY (`Ž·Ž·Ž·`); +ALTER TABLE `ޱޱޱ` ADD UNIQUE (`ޏޏޏ`); +#Multi-byte field name is not allowed for FOREIGN KEY As of 4.1.4 +#ALTER TABLE `ޱޱޱ` ADD FOREIGN KEY (`޹޹޹`) REFERENCES `޲޲޲`(`޹޹޹`); +ALTER TABLE `ޱޱޱ` CHANGE `޶޶޶` `޶޶` char(1); +ALTER TABLE `ޱޱޱ` MODIFY `Ž·Ž·Ž·` char(6); + +SELECT * FROM `ޱޱޱ`; +DESC `ޱޱޱ`; +SHOW CREATE TABLE `ޱޱޱ`; + +ALTER TABLE `ޱޱޱ` DROP INDEX `޶޶޶`; +ALTER TABLE `ޱޱޱ` DROP PRIMARY KEY; +ALTER TABLE `ޱޱޱ` DROP INDEX `ޏޏޏ`; +#ALTER TABLE `ޱޱޱ` DROP FOREIGN KEY `޹޹޹`; +ALTER TABLE `ޱޱޱ` DROP `޶޶`; +ALTER TABLE `ޱޱޱ` DROP `ޏޏޏ`; +ALTER TABLE `ޱޱޱ` DROP `޹޹޹`; +SELECT * FROM `ޱޱޱ`; +DESC `ޱޱޱ`; +SHOW CREATE TABLE `ޱޱޱ`; + +ALTER TABLE `¤¢¤¢¤¢` ADD `¤«¤«¤«` char(1) FIRST; +ALTER TABLE `¤¢¤¢¤¢` ADD `¤¯¤¯¤¯` char(1) AFTER `¤­¤­¤­`; +ALTER TABLE `¤¢¤¢¤¢` ADD `¤±¤±¤±` char(1); +ALTER TABLE `¤¢¤¢¤¢` ADD INDEX (`¤«¤«¤«`); +ALTER TABLE `¤¢¤¢¤¢` ADD PRIMARY KEY (`¤­¤­¤­`); +ALTER TABLE `¤¢¤¢¤¢` ADD UNIQUE (`¤¯¤¯¤¯`); +#Multi-byte field name is not allowed for FOREIGN KEY As of 4.1.4 +#ALTER TABLE `¤¢¤¢¤¢` ADD FOREIGN KEY (`¤±¤±¤±`) REFERENCES `¤¤¤¤¤¤`(`¤±¤±¤±`); +ALTER TABLE `¤¢¤¢¤¢` CHANGE `¤«¤«¤«` `¤«¤«` char(1); +ALTER TABLE `¤¢¤¢¤¢` MODIFY `¤­¤­¤­` char(6); + +SELECT * FROM `¤¢¤¢¤¢`; +DESC `¤¢¤¢¤¢`; +SHOW CREATE TABLE `¤¢¤¢¤¢`; + +ALTER TABLE `¤¢¤¢¤¢` DROP INDEX `¤«¤«¤«`; +ALTER TABLE `¤¢¤¢¤¢` DROP PRIMARY KEY; +ALTER TABLE `¤¢¤¢¤¢` DROP INDEX `¤¯¤¯¤¯`; +#ALTER TABLE `¤¢¤¢¤¢` DROP FOREIGN KEY `¤±¤±¤±`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤«¤«`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤¯¤¯¤¯`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤±¤±¤±`; + +SELECT * FROM `¤¢¤¢¤¢`; +DESC `¤¢¤¢¤¢`; +SHOW CREATE TABLE `¤¢¤¢¤¢`; + +ALTER TABLE `íÝíÝíÝ` ADD `°¢°¢°¢` char(1) FIRST; +ALTER TABLE `íÝíÝíÝ` ADD `°£°£°£` char(1) AFTER `°¡°¡°¡`; +ALTER TABLE `íÝíÝíÝ` ADD `°´°´°´` char(1); +ALTER TABLE `íÝíÝíÝ` ADD INDEX (`°¢°¢°¢`); +ALTER TABLE `íÝíÝíÝ` ADD PRIMARY KEY (`°¡°¡°¡`); +ALTER TABLE `íÝíÝíÝ` ADD UNIQUE (`°£°£°£`); +#Multi-byte field name is not allowed for FOREIGN KEY As of 4.1.4 +#ALTER TABLE `íÝíÝíÝ` ADD FOREIGN KEY (`°´°´°´`) REFERENCES `íÞíÞíÞ`(`°´°´°´`); +ALTER TABLE `íÝíÝíÝ` CHANGE `°¢°¢°¢` `°¢°¢` char(1); +ALTER TABLE `íÝíÝíÝ` MODIFY `°¡°¡°¡` char(6); + +SELECT * FROM `íÝíÝíÝ`; +DESC `íÝíÝíÝ`; +SHOW CREATE TABLE `íÝíÝíÝ`; + +ALTER TABLE `íÝíÝíÝ` DROP INDEX `°¢°¢°¢`; +ALTER TABLE `íÝíÝíÝ` DROP PRIMARY KEY; +ALTER TABLE `íÝíÝíÝ` DROP INDEX `°£°£°£`; +#ALTER TABLE `íÝíÝíÝ` DROP FOREIGN KEY `°´°´°´`; +ALTER TABLE `íÝíÝíÝ` DROP `°¢°¢`; +ALTER TABLE `íÝíÝíÝ` DROP `°£°£°£`; +ALTER TABLE `íÝíÝíÝ` DROP `°´°´°´`; + +SELECT * FROM `íÝíÝíÝ`; +DESC `íÝíÝíÝ`; +SHOW CREATE TABLE `íÝíÝíÝ`; + +DROP TABLE `ޱޱޱ`; +DROP TABLE `޲޲޲`; +DROP TABLE `¤¢¤¢¤¢`; +DROP TABLE `¤¤¤¤¤¤`; +DROP TABLE `íÝíÝíÝ`; +DROP TABLE `íÞíÞíÞ`; + +# +# Test MyISAM +# + +CREATE TABLE `ޱޱޱ`(`Ž·Ž·Ž·` char(5)) DEFAULT CHARSET = ujis engine=MYISAM; +CREATE TABLE `޲޲޲`(`޹޹޹` char(5)) DEFAULT CHARSET = ujis engine=MYISAM; +CREATE TABLE `¤¢¤¢¤¢`(`¤­¤­¤­` char(5)) DEFAULT CHARSET = ujis engine=MYISAM; +CREATE TABLE `¤¤¤¤¤¤`(`¤±¤±¤±` char(5)) DEFAULT CHARSET = ujis engine=MYISAM; +CREATE TABLE `íÝíÝíÝ`(`°¡°¡°¡` char(5)) DEFAULT CHARSET = ujis engine=MYISAM; +CREATE TABLE `íÞíÞíÞ`(`°´°´°´` char(5)) DEFAULT CHARSET = ujis engine=MYISAM; + +INSERT INTO `ޱޱޱ` VALUES ('ޱޱޱޱޱ'),('޲޲޲޲޲'),('޳޳޳޳޳'); +INSERT INTO `¤¢¤¢¤¢` VALUES ('¤¢¤¢¤¢¤¢¤¢'),('¤¤¤¤¤¤¤¤¤¤'),('¤¦¤¦¤¦¤¦¤¦'); +INSERT INTO `íÝíÝíÝ` VALUES ('°¡°¡°¡°¡°¡'),('°¢°¢°¢°¢°¢'),('°£°£°£°£°£'); + +ALTER TABLE `ޱޱޱ` ADD `޶޶޶` char(1) FIRST; +ALTER TABLE `ޱޱޱ` ADD `ޏޏޏ` char(1) AFTER `Ž·Ž·Ž·`; +ALTER TABLE `ޱޱޱ` ADD `޹޹޹` char(1); +ALTER TABLE `ޱޱޱ` ADD INDEX (`޶޶޶`); +ALTER TABLE `ޱޱޱ` ADD PRIMARY KEY (`Ž·Ž·Ž·`); +ALTER TABLE `ޱޱޱ` ADD UNIQUE (`ޏޏޏ`); +#ALTER TABLE `ޱޱޱ` ADD FOREIGN KEY (`޹޹޹`) REFERENCES `޲޲޲`(`޹޹޹`); +ALTER TABLE `ޱޱޱ` CHANGE `޶޶޶` `޶޶` char(1); +ALTER TABLE `ޱޱޱ` MODIFY `Ž·Ž·Ž·` char(6); + +SELECT * FROM `ޱޱޱ`; +DESC `ޱޱޱ`; +SHOW CREATE TABLE `ޱޱޱ`; + +ALTER TABLE `ޱޱޱ` DROP INDEX `޶޶޶`; +ALTER TABLE `ޱޱޱ` DROP PRIMARY KEY; +ALTER TABLE `ޱޱޱ` DROP INDEX `ޏޏޏ`; +#ALTER TABLE `ޱޱޱ` DROP FOREIGN KEY `޹޹޹`; +ALTER TABLE `ޱޱޱ` DROP `޶޶`; +ALTER TABLE `ޱޱޱ` DROP `ޏޏޏ`; +ALTER TABLE `ޱޱޱ` DROP `޹޹޹`; +SELECT * FROM `ޱޱޱ`; +DESC `ޱޱޱ`; +SHOW CREATE TABLE `ޱޱޱ`; + +ALTER TABLE `¤¢¤¢¤¢` ADD `¤«¤«¤«` char(1) FIRST; +ALTER TABLE `¤¢¤¢¤¢` ADD `¤¯¤¯¤¯` char(1) AFTER `¤­¤­¤­`; +ALTER TABLE `¤¢¤¢¤¢` ADD `¤±¤±¤±` char(1); +ALTER TABLE `¤¢¤¢¤¢` ADD INDEX (`¤«¤«¤«`); +ALTER TABLE `¤¢¤¢¤¢` ADD PRIMARY KEY (`¤­¤­¤­`); +ALTER TABLE `¤¢¤¢¤¢` ADD UNIQUE (`¤¯¤¯¤¯`); +#ALTER TABLE `¤¢¤¢¤¢` ADD FOREIGN KEY (`¤±¤±¤±`) REFERENCES `¤¤¤¤¤¤`(`¤±¤±¤±`); +ALTER TABLE `¤¢¤¢¤¢` CHANGE `¤«¤«¤«` `¤«¤«` char(1); +ALTER TABLE `¤¢¤¢¤¢` MODIFY `¤­¤­¤­` char(6); + +SELECT * FROM `¤¢¤¢¤¢`; +DESC `¤¢¤¢¤¢`; +SHOW CREATE TABLE `¤¢¤¢¤¢`; + +ALTER TABLE `¤¢¤¢¤¢` DROP INDEX `¤«¤«¤«`; +ALTER TABLE `¤¢¤¢¤¢` DROP PRIMARY KEY; +ALTER TABLE `¤¢¤¢¤¢` DROP INDEX `¤¯¤¯¤¯`; +#ALTER TABLE `¤¢¤¢¤¢` DROP FOREIGN KEY `¤±¤±¤±`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤«¤«`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤¯¤¯¤¯`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤±¤±¤±`; + +SELECT * FROM `¤¢¤¢¤¢`; +DESC `¤¢¤¢¤¢`; +SHOW CREATE TABLE `¤¢¤¢¤¢`; + +ALTER TABLE `íÝíÝíÝ` ADD `°¢°¢°¢` char(1) FIRST; +ALTER TABLE `íÝíÝíÝ` ADD `°£°£°£` char(1) AFTER `°¡°¡°¡`; +ALTER TABLE `íÝíÝíÝ` ADD `°´°´°´` char(1); +ALTER TABLE `íÝíÝíÝ` ADD INDEX (`°¢°¢°¢`); +ALTER TABLE `íÝíÝíÝ` ADD PRIMARY KEY (`°¡°¡°¡`); +ALTER TABLE `íÝíÝíÝ` ADD UNIQUE (`°£°£°£`); +#ALTER TABLE `íÝíÝíÝ` ADD FOREIGN KEY (`°´°´°´`) REFERENCES `íÞíÞíÞ`(`°´°´°´`); +ALTER TABLE `íÝíÝíÝ` CHANGE `°¢°¢°¢` `°¢°¢` char(1); +ALTER TABLE `íÝíÝíÝ` MODIFY `°¡°¡°¡` char(6); + +SELECT * FROM `íÝíÝíÝ`; +DESC `íÝíÝíÝ`; +SHOW CREATE TABLE `íÝíÝíÝ`; + +ALTER TABLE `íÝíÝíÝ` DROP INDEX `°¢°¢°¢`; +ALTER TABLE `íÝíÝíÝ` DROP PRIMARY KEY; +ALTER TABLE `íÝíÝíÝ` DROP INDEX `°£°£°£`; +#ALTER TABLE `íÝíÝíÝ` DROP FOREIGN KEY `°´°´°´`; +ALTER TABLE `íÝíÝíÝ` DROP `°¢°¢`; +ALTER TABLE `íÝíÝíÝ` DROP `°£°£°£`; +ALTER TABLE `íÝíÝíÝ` DROP `°´°´°´`; + +SELECT * FROM `íÝíÝíÝ`; +DESC `íÝíÝíÝ`; +SHOW CREATE TABLE `íÝíÝíÝ`; + +DROP TABLE `ޱޱޱ`; +DROP TABLE `޲޲޲`; +DROP TABLE `¤¢¤¢¤¢`; +DROP TABLE `¤¤¤¤¤¤`; +DROP TABLE `íÝíÝíÝ`; +DROP TABLE `íÞíÞíÞ`; + +# +# Test HEAP +# + +CREATE TABLE `ޱޱޱ`(`Ž·Ž·Ž·` char(5)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TABLE `޲޲޲`(`޹޹޹` char(5)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TABLE `¤¢¤¢¤¢`(`¤­¤­¤­` char(5)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TABLE `¤¤¤¤¤¤`(`¤±¤±¤±` char(5)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TABLE `íÝíÝíÝ`(`°¡°¡°¡` char(5)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TABLE `íÞíÞíÞ`(`°´°´°´` char(5)) DEFAULT CHARSET = ujis engine=HEAP; + +INSERT INTO `ޱޱޱ` VALUES ('ޱޱޱޱޱ'),('޲޲޲޲޲'),('޳޳޳޳޳'); +INSERT INTO `¤¢¤¢¤¢` VALUES ('¤¢¤¢¤¢¤¢¤¢'),('¤¤¤¤¤¤¤¤¤¤'),('¤¦¤¦¤¦¤¦¤¦'); +INSERT INTO `íÝíÝíÝ` VALUES ('°¡°¡°¡°¡°¡'),('°¢°¢°¢°¢°¢'),('°£°£°£°£°£'); + +ALTER TABLE `ޱޱޱ` ADD `޶޶޶` char(1) FIRST; +ALTER TABLE `ޱޱޱ` ADD `ޏޏޏ` char(1) AFTER `Ž·Ž·Ž·`; +ALTER TABLE `ޱޱޱ` ADD `޹޹޹` char(1); +ALTER TABLE `ޱޱޱ` ADD INDEX (`޶޶޶`); +ALTER TABLE `ޱޱޱ` ADD PRIMARY KEY (`Ž·Ž·Ž·`); +ALTER TABLE `ޱޱޱ` ADD UNIQUE (`ޏޏޏ`); +#ALTER TABLE `ޱޱޱ` ADD FOREIGN KEY (`޹޹޹`) REFERENCES `޲޲޲`(`޹޹޹`); +ALTER TABLE `ޱޱޱ` CHANGE `޶޶޶` `޶޶` char(1); +ALTER TABLE `ޱޱޱ` MODIFY `Ž·Ž·Ž·` char(6); + +SELECT * FROM `ޱޱޱ`; +DESC `ޱޱޱ`; +SHOW CREATE TABLE `ޱޱޱ`; + +ALTER TABLE `ޱޱޱ` DROP INDEX `޶޶޶`; +ALTER TABLE `ޱޱޱ` DROP PRIMARY KEY; +ALTER TABLE `ޱޱޱ` DROP INDEX `ޏޏޏ`; +#ALTER TABLE `ޱޱޱ` DROP FOREIGN KEY `޹޹޹`; +ALTER TABLE `ޱޱޱ` DROP `޶޶`; +ALTER TABLE `ޱޱޱ` DROP `ޏޏޏ`; +ALTER TABLE `ޱޱޱ` DROP `޹޹޹`; +SELECT * FROM `ޱޱޱ`; +DESC `ޱޱޱ`; +SHOW CREATE TABLE `ޱޱޱ`; + +ALTER TABLE `¤¢¤¢¤¢` ADD `¤«¤«¤«` char(1) FIRST; +ALTER TABLE `¤¢¤¢¤¢` ADD `¤¯¤¯¤¯` char(1) AFTER `¤­¤­¤­`; +ALTER TABLE `¤¢¤¢¤¢` ADD `¤±¤±¤±` char(1); +ALTER TABLE `¤¢¤¢¤¢` ADD INDEX (`¤«¤«¤«`); +ALTER TABLE `¤¢¤¢¤¢` ADD PRIMARY KEY (`¤­¤­¤­`); +ALTER TABLE `¤¢¤¢¤¢` ADD UNIQUE (`¤¯¤¯¤¯`); +#ALTER TABLE `¤¢¤¢¤¢` ADD FOREIGN KEY (`¤±¤±¤±`) REFERENCES `¤¤¤¤¤¤`(`¤±¤±¤±`); +ALTER TABLE `¤¢¤¢¤¢` CHANGE `¤«¤«¤«` `¤«¤«` char(1); +ALTER TABLE `¤¢¤¢¤¢` MODIFY `¤­¤­¤­` char(6); + +SELECT * FROM `¤¢¤¢¤¢`; +DESC `¤¢¤¢¤¢`; +SHOW CREATE TABLE `¤¢¤¢¤¢`; + +ALTER TABLE `¤¢¤¢¤¢` DROP INDEX `¤«¤«¤«`; +ALTER TABLE `¤¢¤¢¤¢` DROP PRIMARY KEY; +ALTER TABLE `¤¢¤¢¤¢` DROP INDEX `¤¯¤¯¤¯`; +#ALTER TABLE `¤¢¤¢¤¢` DROP FOREIGN KEY `¤±¤±¤±`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤«¤«`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤¯¤¯¤¯`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤±¤±¤±`; + +SELECT * FROM `¤¢¤¢¤¢`; +DESC `¤¢¤¢¤¢`; +SHOW CREATE TABLE `¤¢¤¢¤¢`; + +ALTER TABLE `íÝíÝíÝ` ADD `°¢°¢°¢` char(1) FIRST; +ALTER TABLE `íÝíÝíÝ` ADD `°£°£°£` char(1) AFTER `°¡°¡°¡`; +ALTER TABLE `íÝíÝíÝ` ADD `°´°´°´` char(1); +ALTER TABLE `íÝíÝíÝ` ADD INDEX (`°¢°¢°¢`); +ALTER TABLE `íÝíÝíÝ` ADD PRIMARY KEY (`°¡°¡°¡`); +ALTER TABLE `íÝíÝíÝ` ADD UNIQUE (`°£°£°£`); +#ALTER TABLE `íÝíÝíÝ` ADD FOREIGN KEY (`°´°´°´`) REFERENCES `íÞíÞíÞ`(`°´°´°´`); +ALTER TABLE `íÝíÝíÝ` CHANGE `°¢°¢°¢` `°¢°¢` char(1); +ALTER TABLE `íÝíÝíÝ` MODIFY `°¡°¡°¡` char(6); + +SELECT * FROM `íÝíÝíÝ`; +DESC `íÝíÝíÝ`; +SHOW CREATE TABLE `íÝíÝíÝ`; + +ALTER TABLE `íÝíÝíÝ` DROP INDEX `°¢°¢°¢`; +ALTER TABLE `íÝíÝíÝ` DROP PRIMARY KEY; +ALTER TABLE `íÝíÝíÝ` DROP INDEX `°£°£°£`; +#ALTER TABLE `íÝíÝíÝ` DROP FOREIGN KEY `°´°´°´`; +ALTER TABLE `íÝíÝíÝ` DROP `°¢°¢`; +ALTER TABLE `íÝíÝíÝ` DROP `°£°£°£`; +ALTER TABLE `íÝíÝíÝ` DROP `°´°´°´`; + +SELECT * FROM `íÝíÝíÝ`; +DESC `íÝíÝíÝ`; +SHOW CREATE TABLE `íÝíÝíÝ`; + +DROP TABLE `ޱޱޱ`; +DROP TABLE `޲޲޲`; +DROP TABLE `¤¢¤¢¤¢`; +DROP TABLE `¤¤¤¤¤¤`; +DROP TABLE `íÝíÝíÝ`; +DROP TABLE `íÞíÞíÞ`; + +# +# Test BDB +# + +CREATE TABLE `ޱޱޱ`(`Ž·Ž·Ž·` char(5)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TABLE `޲޲޲`(`޹޹޹` char(5)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TABLE `¤¢¤¢¤¢`(`¤­¤­¤­` char(5)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TABLE `¤¤¤¤¤¤`(`¤±¤±¤±` char(5)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TABLE `íÝíÝíÝ`(`°¡°¡°¡` char(5)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TABLE `íÞíÞíÞ`(`°´°´°´` char(5)) DEFAULT CHARSET = ujis engine=BDB; + +INSERT INTO `ޱޱޱ` VALUES ('ޱޱޱޱޱ'),('޲޲޲޲޲'),('޳޳޳޳޳'); +INSERT INTO `¤¢¤¢¤¢` VALUES ('¤¢¤¢¤¢¤¢¤¢'),('¤¤¤¤¤¤¤¤¤¤'),('¤¦¤¦¤¦¤¦¤¦'); +INSERT INTO `íÝíÝíÝ` VALUES ('°¡°¡°¡°¡°¡'),('°¢°¢°¢°¢°¢'),('°£°£°£°£°£'); + +ALTER TABLE `ޱޱޱ` ADD `޶޶޶` char(1) FIRST; +ALTER TABLE `ޱޱޱ` ADD `ޏޏޏ` char(1) AFTER `Ž·Ž·Ž·`; +ALTER TABLE `ޱޱޱ` ADD `޹޹޹` char(1); +ALTER TABLE `ޱޱޱ` ADD INDEX (`޶޶޶`); +ALTER TABLE `ޱޱޱ` ADD PRIMARY KEY (`Ž·Ž·Ž·`); +#Multiple NULL fields are not allowed in BDB +#ALTER TABLE `ޱޱޱ` ADD UNIQUE (`ޏޏޏ`); +#ALTER TABLE `ޱޱޱ` ADD FOREIGN KEY (`޹޹޹`) REFERENCES `޲޲޲`(`޹޹޹`); +ALTER TABLE `ޱޱޱ` CHANGE `޶޶޶` `޶޶` char(1); +ALTER TABLE `ޱޱޱ` MODIFY `Ž·Ž·Ž·` char(6); + +SELECT * FROM `ޱޱޱ`; +DESC `ޱޱޱ`; +SHOW CREATE TABLE `ޱޱޱ`; + +ALTER TABLE `ޱޱޱ` DROP INDEX `޶޶޶`; +ALTER TABLE `ޱޱޱ` DROP PRIMARY KEY; +#ALTER TABLE `ޱޱޱ` DROP INDEX `ޏޏޏ`; +#ALTER TABLE `ޱޱޱ` DROP FOREIGN KEY `޹޹޹`; +ALTER TABLE `ޱޱޱ` DROP `޶޶`; +ALTER TABLE `ޱޱޱ` DROP `ޏޏޏ`; +ALTER TABLE `ޱޱޱ` DROP `޹޹޹`; +SELECT * FROM `ޱޱޱ`; +DESC `ޱޱޱ`; +SHOW CREATE TABLE `ޱޱޱ`; + +ALTER TABLE `¤¢¤¢¤¢` ADD `¤«¤«¤«` char(1) FIRST; +ALTER TABLE `¤¢¤¢¤¢` ADD `¤¯¤¯¤¯` char(1) AFTER `¤­¤­¤­`; +ALTER TABLE `¤¢¤¢¤¢` ADD `¤±¤±¤±` char(1); +ALTER TABLE `¤¢¤¢¤¢` ADD INDEX (`¤«¤«¤«`); +ALTER TABLE `¤¢¤¢¤¢` ADD PRIMARY KEY (`¤­¤­¤­`); +#ALTER TABLE `¤¢¤¢¤¢` ADD UNIQUE (`¤¯¤¯¤¯`); +#ALTER TABLE `¤¢¤¢¤¢` ADD FOREIGN KEY (`¤±¤±¤±`) REFERENCES `¤¤¤¤¤¤`(`¤±¤±¤±`); +ALTER TABLE `¤¢¤¢¤¢` CHANGE `¤«¤«¤«` `¤«¤«` char(1); +ALTER TABLE `¤¢¤¢¤¢` MODIFY `¤­¤­¤­` char(6); + +SELECT * FROM `¤¢¤¢¤¢`; +DESC `¤¢¤¢¤¢`; +SHOW CREATE TABLE `¤¢¤¢¤¢`; + +ALTER TABLE `¤¢¤¢¤¢` DROP INDEX `¤«¤«¤«`; +ALTER TABLE `¤¢¤¢¤¢` DROP PRIMARY KEY; +#ALTER TABLE `¤¢¤¢¤¢` DROP INDEX `¤¯¤¯¤¯`; +#ALTER TABLE `¤¢¤¢¤¢` DROP FOREIGN KEY `¤±¤±¤±`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤«¤«`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤¯¤¯¤¯`; +ALTER TABLE `¤¢¤¢¤¢` DROP `¤±¤±¤±`; + +SELECT * FROM `¤¢¤¢¤¢`; +DESC `¤¢¤¢¤¢`; +SHOW CREATE TABLE `¤¢¤¢¤¢`; + +ALTER TABLE `íÝíÝíÝ` ADD `°¢°¢°¢` char(1) FIRST; +ALTER TABLE `íÝíÝíÝ` ADD `°£°£°£` char(1) AFTER `°¡°¡°¡`; +ALTER TABLE `íÝíÝíÝ` ADD `°´°´°´` char(1); +ALTER TABLE `íÝíÝíÝ` ADD INDEX (`°¢°¢°¢`); +ALTER TABLE `íÝíÝíÝ` ADD PRIMARY KEY (`°¡°¡°¡`); +#ALTER TABLE `íÝíÝíÝ` ADD UNIQUE (`°£°£°£`); +#ALTER TABLE `íÝíÝíÝ` ADD FOREIGN KEY (`°´°´°´`) REFERENCES `íÞíÞíÞ`(`°´°´°´`); +ALTER TABLE `íÝíÝíÝ` CHANGE `°¢°¢°¢` `°¢°¢` char(1); +ALTER TABLE `íÝíÝíÝ` MODIFY `°¡°¡°¡` char(6); + +SELECT * FROM `íÝíÝíÝ`; +DESC `íÝíÝíÝ`; +SHOW CREATE TABLE `íÝíÝíÝ`; + +ALTER TABLE `íÝíÝíÝ` DROP INDEX `°¢°¢°¢`; +ALTER TABLE `íÝíÝíÝ` DROP PRIMARY KEY; +#ALTER TABLE `íÝíÝíÝ` DROP INDEX `°£°£°£`; +#ALTER TABLE `íÝíÝíÝ` DROP FOREIGN KEY `°´°´°´`; +ALTER TABLE `íÝíÝíÝ` DROP `°¢°¢`; +ALTER TABLE `íÝíÝíÝ` DROP `°£°£°£`; +ALTER TABLE `íÝíÝíÝ` DROP `°´°´°´`; + +SELECT * FROM `íÝíÝíÝ`; +DESC `íÝíÝíÝ`; +SHOW CREATE TABLE `íÝíÝíÝ`; + +DROP TABLE `ޱޱޱ`; +DROP TABLE `޲޲޲`; +DROP TABLE `¤¢¤¢¤¢`; +DROP TABLE `¤¤¤¤¤¤`; +DROP TABLE `íÝíÝíÝ`; +DROP TABLE `íÞíÞíÞ`; diff --git a/mysql-test/suite/jp/t/jp_alter_utf8.test b/mysql-test/suite/jp/t/jp_alter_utf8.test new file mode 100755 index 00000000000..6771343f38f --- /dev/null +++ b/mysql-test/suite/jp/t/jp_alter_utf8.test @@ -0,0 +1,416 @@ +--disable_warnings +DROP TABLE IF EXISTS `アアア`; +DROP TABLE IF EXISTS `イイイ`; +DROP TABLE IF EXISTS `ã‚ã‚ã‚`; +DROP TABLE IF EXISTS `ã„ã„ã„`; +DROP TABLE IF EXISTS `é¾–é¾–é¾–`; +DROP TABLE IF EXISTS `é¾—é¾—é¾—`; +--enable_warnings + +# +# Test altering table with Japanese characters in utf8 encoding +# + +SET NAMES utf8; +SET character_set_database = utf8; + +# +# Test InnoDB +# +CREATE TABLE `アアア`(`ï½·ï½·ï½·` char(5)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TABLE `イイイ`(`ケケケ` char(5)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TABLE `ã‚ã‚ã‚`(`ããã` char(5)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TABLE `ã„ã„ã„`(`ã‘ã‘ã‘` char(5)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TABLE `é¾–é¾–é¾–`(`丂丂丂` char(5)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TABLE `é¾—é¾—é¾—`(`乚乚乚` char(5)) DEFAULT CHARSET = utf8 engine=INNODB; + +INSERT INTO `アアア` VALUES ('アアアアア'),('イイイイイ'),('ウウウウウ'); +INSERT INTO `ã‚ã‚ã‚` VALUES ('ã‚ã‚ã‚ã‚ã‚'),('ã„ã„ã„ã„ã„'),('ã†ã†ã†ã†ã†'); +INSERT INTO `é¾–é¾–é¾–` VALUES ('丂丂丂丂丂'),('丄丄丄丄丄'),('丅丅丅丅丅'); + +# Test basic alter operation + +ALTER TABLE `アアア` ADD `ï½¶ï½¶ï½¶` char(1) FIRST; +ALTER TABLE `アアア` ADD `ククク` char(1) AFTER `ï½·ï½·ï½·`; +ALTER TABLE `アアア` ADD `ケケケ` char(1); +ALTER TABLE `アアア` ADD INDEX (`ï½¶ï½¶ï½¶`); +ALTER TABLE `アアア` ADD PRIMARY KEY (`ï½·ï½·ï½·`); +ALTER TABLE `アアア` ADD UNIQUE (`ククク`); +#Multi-byte field name is not allowed for FOREIGN KEY As of 4.1.4 +#ALTER TABLE `アアア` ADD FOREIGN KEY (`ケケケ`) REFERENCES `イイイ`(`ケケケ`); +ALTER TABLE `アアア` CHANGE `ï½¶ï½¶ï½¶` `ï½¶ï½¶` char(1); +ALTER TABLE `アアア` MODIFY `ï½·ï½·ï½·` char(6); + +SELECT * FROM `アアア`; +DESC `アアア`; +SHOW CREATE TABLE `アアア`; + +ALTER TABLE `アアア` DROP INDEX `ï½¶ï½¶ï½¶`; +ALTER TABLE `アアア` DROP PRIMARY KEY; +ALTER TABLE `アアア` DROP INDEX `ククク`; +#ALTER TABLE `アアア` DROP FOREIGN KEY `ケケケ`; +ALTER TABLE `アアア` DROP `ï½¶ï½¶`; +ALTER TABLE `アアア` DROP `ククク`; +ALTER TABLE `アアア` DROP `ケケケ`; +SELECT * FROM `アアア`; +DESC `アアア`; +SHOW CREATE TABLE `アアア`; + +ALTER TABLE `ã‚ã‚ã‚` ADD `ã‹ã‹ã‹` char(1) FIRST; +ALTER TABLE `ã‚ã‚ã‚` ADD `ããã` char(1) AFTER `ããã`; +ALTER TABLE `ã‚ã‚ã‚` ADD `ã‘ã‘ã‘` char(1); +ALTER TABLE `ã‚ã‚ã‚` ADD INDEX (`ã‹ã‹ã‹`); +ALTER TABLE `ã‚ã‚ã‚` ADD PRIMARY KEY (`ããã`); +ALTER TABLE `ã‚ã‚ã‚` ADD UNIQUE (`ããã`); +#Multi-byte field name is not allowed for FOREIGN KEY As of 4.1.4 +#ALTER TABLE `ã‚ã‚ã‚` ADD FOREIGN KEY (`ã‘ã‘ã‘`) REFERENCES `ã„ã„ã„`(`ã‘ã‘ã‘`); +ALTER TABLE `ã‚ã‚ã‚` CHANGE `ã‹ã‹ã‹` `ã‹ã‹` char(1); +ALTER TABLE `ã‚ã‚ã‚` MODIFY `ããã` char(6); + +SELECT * FROM `ã‚ã‚ã‚`; +DESC `ã‚ã‚ã‚`; +SHOW CREATE TABLE `ã‚ã‚ã‚`; + +ALTER TABLE `ã‚ã‚ã‚` DROP INDEX `ã‹ã‹ã‹`; +ALTER TABLE `ã‚ã‚ã‚` DROP PRIMARY KEY; +ALTER TABLE `ã‚ã‚ã‚` DROP INDEX `ããã`; +#ALTER TABLE `ã‚ã‚ã‚` DROP FOREIGN KEY `ã‘ã‘ã‘`; +ALTER TABLE `ã‚ã‚ã‚` DROP `ã‹ã‹`; +ALTER TABLE `ã‚ã‚ã‚` DROP `ããã`; +ALTER TABLE `ã‚ã‚ã‚` DROP `ã‘ã‘ã‘`; + +SELECT * FROM `ã‚ã‚ã‚`; +DESC `ã‚ã‚ã‚`; +SHOW CREATE TABLE `ã‚ã‚ã‚`; + +ALTER TABLE `é¾–é¾–é¾–` ADD `丄丄丄` char(1) FIRST; +ALTER TABLE `é¾–é¾–é¾–` ADD `丅丅丅` char(1) AFTER `丂丂丂`; +ALTER TABLE `é¾–é¾–é¾–` ADD `乚乚乚` char(1); +ALTER TABLE `é¾–é¾–é¾–` ADD INDEX (`丄丄丄`); +ALTER TABLE `é¾–é¾–é¾–` ADD PRIMARY KEY (`丂丂丂`); +ALTER TABLE `é¾–é¾–é¾–` ADD UNIQUE (`丅丅丅`); +#Multi-byte field name is not allowed for FOREIGN KEY As of 4.1.4 +#ALTER TABLE `é¾–é¾–é¾–` ADD FOREIGN KEY (`乚乚乚`) REFERENCES `é¾—é¾—é¾—`(`乚乚乚`); +ALTER TABLE `é¾–é¾–é¾–` CHANGE `丄丄丄` `丄丄` char(1); +ALTER TABLE `é¾–é¾–é¾–` MODIFY `丂丂丂` char(6); + +SELECT * FROM `é¾–é¾–é¾–`; +DESC `é¾–é¾–é¾–`; +SHOW CREATE TABLE `é¾–é¾–é¾–`; + +ALTER TABLE `é¾–é¾–é¾–` DROP INDEX `丄丄丄`; +ALTER TABLE `é¾–é¾–é¾–` DROP PRIMARY KEY; +ALTER TABLE `é¾–é¾–é¾–` DROP INDEX `丅丅丅`; +#ALTER TABLE `é¾–é¾–é¾–` DROP FOREIGN KEY `乚乚乚`; +ALTER TABLE `é¾–é¾–é¾–` DROP `丄丄`; +ALTER TABLE `é¾–é¾–é¾–` DROP `丅丅丅`; +ALTER TABLE `é¾–é¾–é¾–` DROP `乚乚乚`; + +SELECT * FROM `é¾–é¾–é¾–`; +DESC `é¾–é¾–é¾–`; +SHOW CREATE TABLE `é¾–é¾–é¾–`; + +DROP TABLE `アアア`; +DROP TABLE `イイイ`; +DROP TABLE `ã‚ã‚ã‚`; +DROP TABLE `ã„ã„ã„`; +DROP TABLE `é¾–é¾–é¾–`; +DROP TABLE `é¾—é¾—é¾—`; + +# +# Test MyISAM +# + +CREATE TABLE `アアア`(`ï½·ï½·ï½·` char(5)) DEFAULT CHARSET = utf8 engine=MYISAM; +CREATE TABLE `イイイ`(`ケケケ` char(5)) DEFAULT CHARSET = utf8 engine=MYISAM; +CREATE TABLE `ã‚ã‚ã‚`(`ããã` char(5)) DEFAULT CHARSET = utf8 engine=MYISAM; +CREATE TABLE `ã„ã„ã„`(`ã‘ã‘ã‘` char(5)) DEFAULT CHARSET = utf8 engine=MYISAM; +CREATE TABLE `é¾–é¾–é¾–`(`丂丂丂` char(5)) DEFAULT CHARSET = utf8 engine=MYISAM; +CREATE TABLE `é¾—é¾—é¾—`(`乚乚乚` char(5)) DEFAULT CHARSET = utf8 engine=MYISAM; + +INSERT INTO `アアア` VALUES ('アアアアア'),('イイイイイ'),('ウウウウウ'); +INSERT INTO `ã‚ã‚ã‚` VALUES ('ã‚ã‚ã‚ã‚ã‚'),('ã„ã„ã„ã„ã„'),('ã†ã†ã†ã†ã†'); +INSERT INTO `é¾–é¾–é¾–` VALUES ('丂丂丂丂丂'),('丄丄丄丄丄'),('丅丅丅丅丅'); + +ALTER TABLE `アアア` ADD `ï½¶ï½¶ï½¶` char(1) FIRST; +ALTER TABLE `アアア` ADD `ククク` char(1) AFTER `ï½·ï½·ï½·`; +ALTER TABLE `アアア` ADD `ケケケ` char(1); +ALTER TABLE `アアア` ADD INDEX (`ï½¶ï½¶ï½¶`); +ALTER TABLE `アアア` ADD PRIMARY KEY (`ï½·ï½·ï½·`); +ALTER TABLE `アアア` ADD UNIQUE (`ククク`); +#ALTER TABLE `アアア` ADD FOREIGN KEY (`ケケケ`) REFERENCES `イイイ`(`ケケケ`); +ALTER TABLE `アアア` CHANGE `ï½¶ï½¶ï½¶` `ï½¶ï½¶` char(1); +ALTER TABLE `アアア` MODIFY `ï½·ï½·ï½·` char(6); + +SELECT * FROM `アアア`; +DESC `アアア`; +SHOW CREATE TABLE `アアア`; + +ALTER TABLE `アアア` DROP INDEX `ï½¶ï½¶ï½¶`; +ALTER TABLE `アアア` DROP PRIMARY KEY; +ALTER TABLE `アアア` DROP INDEX `ククク`; +#ALTER TABLE `アアア` DROP FOREIGN KEY `ケケケ`; +ALTER TABLE `アアア` DROP `ï½¶ï½¶`; +ALTER TABLE `アアア` DROP `ククク`; +ALTER TABLE `アアア` DROP `ケケケ`; +SELECT * FROM `アアア`; +DESC `アアア`; +SHOW CREATE TABLE `アアア`; + +ALTER TABLE `ã‚ã‚ã‚` ADD `ã‹ã‹ã‹` char(1) FIRST; +ALTER TABLE `ã‚ã‚ã‚` ADD `ããã` char(1) AFTER `ããã`; +ALTER TABLE `ã‚ã‚ã‚` ADD `ã‘ã‘ã‘` char(1); +ALTER TABLE `ã‚ã‚ã‚` ADD INDEX (`ã‹ã‹ã‹`); +ALTER TABLE `ã‚ã‚ã‚` ADD PRIMARY KEY (`ããã`); +ALTER TABLE `ã‚ã‚ã‚` ADD UNIQUE (`ããã`); +#ALTER TABLE `ã‚ã‚ã‚` ADD FOREIGN KEY (`ã‘ã‘ã‘`) REFERENCES `ã„ã„ã„`(`ã‘ã‘ã‘`); +ALTER TABLE `ã‚ã‚ã‚` CHANGE `ã‹ã‹ã‹` `ã‹ã‹` char(1); +ALTER TABLE `ã‚ã‚ã‚` MODIFY `ããã` char(6); + +SELECT * FROM `ã‚ã‚ã‚`; +DESC `ã‚ã‚ã‚`; +SHOW CREATE TABLE `ã‚ã‚ã‚`; + +ALTER TABLE `ã‚ã‚ã‚` DROP INDEX `ã‹ã‹ã‹`; +ALTER TABLE `ã‚ã‚ã‚` DROP PRIMARY KEY; +ALTER TABLE `ã‚ã‚ã‚` DROP INDEX `ããã`; +#ALTER TABLE `ã‚ã‚ã‚` DROP FOREIGN KEY `ã‘ã‘ã‘`; +ALTER TABLE `ã‚ã‚ã‚` DROP `ã‹ã‹`; +ALTER TABLE `ã‚ã‚ã‚` DROP `ããã`; +ALTER TABLE `ã‚ã‚ã‚` DROP `ã‘ã‘ã‘`; + +SELECT * FROM `ã‚ã‚ã‚`; +DESC `ã‚ã‚ã‚`; +SHOW CREATE TABLE `ã‚ã‚ã‚`; + +ALTER TABLE `é¾–é¾–é¾–` ADD `丄丄丄` char(1) FIRST; +ALTER TABLE `é¾–é¾–é¾–` ADD `丅丅丅` char(1) AFTER `丂丂丂`; +ALTER TABLE `é¾–é¾–é¾–` ADD `乚乚乚` char(1); +ALTER TABLE `é¾–é¾–é¾–` ADD INDEX (`丄丄丄`); +ALTER TABLE `é¾–é¾–é¾–` ADD PRIMARY KEY (`丂丂丂`); +ALTER TABLE `é¾–é¾–é¾–` ADD UNIQUE (`丅丅丅`); +#ALTER TABLE `é¾–é¾–é¾–` ADD FOREIGN KEY (`乚乚乚`) REFERENCES `é¾—é¾—é¾—`(`乚乚乚`); +ALTER TABLE `é¾–é¾–é¾–` CHANGE `丄丄丄` `丄丄` char(1); +ALTER TABLE `é¾–é¾–é¾–` MODIFY `丂丂丂` char(6); + +SELECT * FROM `é¾–é¾–é¾–`; +DESC `é¾–é¾–é¾–`; +SHOW CREATE TABLE `é¾–é¾–é¾–`; + +ALTER TABLE `é¾–é¾–é¾–` DROP INDEX `丄丄丄`; +ALTER TABLE `é¾–é¾–é¾–` DROP PRIMARY KEY; +ALTER TABLE `é¾–é¾–é¾–` DROP INDEX `丅丅丅`; +#ALTER TABLE `é¾–é¾–é¾–` DROP FOREIGN KEY `乚乚乚`; +ALTER TABLE `é¾–é¾–é¾–` DROP `丄丄`; +ALTER TABLE `é¾–é¾–é¾–` DROP `丅丅丅`; +ALTER TABLE `é¾–é¾–é¾–` DROP `乚乚乚`; + +SELECT * FROM `é¾–é¾–é¾–`; +DESC `é¾–é¾–é¾–`; +SHOW CREATE TABLE `é¾–é¾–é¾–`; + +DROP TABLE `アアア`; +DROP TABLE `イイイ`; +DROP TABLE `ã‚ã‚ã‚`; +DROP TABLE `ã„ã„ã„`; +DROP TABLE `é¾–é¾–é¾–`; +DROP TABLE `é¾—é¾—é¾—`; + +# +# Test HEAP +# + +CREATE TABLE `アアア`(`ï½·ï½·ï½·` char(5)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TABLE `イイイ`(`ケケケ` char(5)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TABLE `ã‚ã‚ã‚`(`ããã` char(5)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TABLE `ã„ã„ã„`(`ã‘ã‘ã‘` char(5)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TABLE `é¾–é¾–é¾–`(`丂丂丂` char(5)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TABLE `é¾—é¾—é¾—`(`乚乚乚` char(5)) DEFAULT CHARSET = utf8 engine=HEAP; + +INSERT INTO `アアア` VALUES ('アアアアア'),('イイイイイ'),('ウウウウウ'); +INSERT INTO `ã‚ã‚ã‚` VALUES ('ã‚ã‚ã‚ã‚ã‚'),('ã„ã„ã„ã„ã„'),('ã†ã†ã†ã†ã†'); +INSERT INTO `é¾–é¾–é¾–` VALUES ('丂丂丂丂丂'),('丄丄丄丄丄'),('丅丅丅丅丅'); + +ALTER TABLE `アアア` ADD `ï½¶ï½¶ï½¶` char(1) FIRST; +ALTER TABLE `アアア` ADD `ククク` char(1) AFTER `ï½·ï½·ï½·`; +ALTER TABLE `アアア` ADD `ケケケ` char(1); +ALTER TABLE `アアア` ADD INDEX (`ï½¶ï½¶ï½¶`); +ALTER TABLE `アアア` ADD PRIMARY KEY (`ï½·ï½·ï½·`); +ALTER TABLE `アアア` ADD UNIQUE (`ククク`); +#ALTER TABLE `アアア` ADD FOREIGN KEY (`ケケケ`) REFERENCES `イイイ`(`ケケケ`); +ALTER TABLE `アアア` CHANGE `ï½¶ï½¶ï½¶` `ï½¶ï½¶` char(1); +ALTER TABLE `アアア` MODIFY `ï½·ï½·ï½·` char(6); + +SELECT * FROM `アアア`; +DESC `アアア`; +SHOW CREATE TABLE `アアア`; + +ALTER TABLE `アアア` DROP INDEX `ï½¶ï½¶ï½¶`; +ALTER TABLE `アアア` DROP PRIMARY KEY; +ALTER TABLE `アアア` DROP INDEX `ククク`; +#ALTER TABLE `アアア` DROP FOREIGN KEY `ケケケ`; +ALTER TABLE `アアア` DROP `ï½¶ï½¶`; +ALTER TABLE `アアア` DROP `ククク`; +ALTER TABLE `アアア` DROP `ケケケ`; +SELECT * FROM `アアア`; +DESC `アアア`; +SHOW CREATE TABLE `アアア`; + +ALTER TABLE `ã‚ã‚ã‚` ADD `ã‹ã‹ã‹` char(1) FIRST; +ALTER TABLE `ã‚ã‚ã‚` ADD `ããã` char(1) AFTER `ããã`; +ALTER TABLE `ã‚ã‚ã‚` ADD `ã‘ã‘ã‘` char(1); +ALTER TABLE `ã‚ã‚ã‚` ADD INDEX (`ã‹ã‹ã‹`); +ALTER TABLE `ã‚ã‚ã‚` ADD PRIMARY KEY (`ããã`); +ALTER TABLE `ã‚ã‚ã‚` ADD UNIQUE (`ããã`); +#ALTER TABLE `ã‚ã‚ã‚` ADD FOREIGN KEY (`ã‘ã‘ã‘`) REFERENCES `ã„ã„ã„`(`ã‘ã‘ã‘`); +ALTER TABLE `ã‚ã‚ã‚` CHANGE `ã‹ã‹ã‹` `ã‹ã‹` char(1); +ALTER TABLE `ã‚ã‚ã‚` MODIFY `ããã` char(6); + +SELECT * FROM `ã‚ã‚ã‚`; +DESC `ã‚ã‚ã‚`; +SHOW CREATE TABLE `ã‚ã‚ã‚`; + +ALTER TABLE `ã‚ã‚ã‚` DROP INDEX `ã‹ã‹ã‹`; +ALTER TABLE `ã‚ã‚ã‚` DROP PRIMARY KEY; +ALTER TABLE `ã‚ã‚ã‚` DROP INDEX `ããã`; +#ALTER TABLE `ã‚ã‚ã‚` DROP FOREIGN KEY `ã‘ã‘ã‘`; +ALTER TABLE `ã‚ã‚ã‚` DROP `ã‹ã‹`; +ALTER TABLE `ã‚ã‚ã‚` DROP `ããã`; +ALTER TABLE `ã‚ã‚ã‚` DROP `ã‘ã‘ã‘`; + +SELECT * FROM `ã‚ã‚ã‚`; +DESC `ã‚ã‚ã‚`; +SHOW CREATE TABLE `ã‚ã‚ã‚`; + +ALTER TABLE `é¾–é¾–é¾–` ADD `丄丄丄` char(1) FIRST; +ALTER TABLE `é¾–é¾–é¾–` ADD `丅丅丅` char(1) AFTER `丂丂丂`; +ALTER TABLE `é¾–é¾–é¾–` ADD `乚乚乚` char(1); +ALTER TABLE `é¾–é¾–é¾–` ADD INDEX (`丄丄丄`); +ALTER TABLE `é¾–é¾–é¾–` ADD PRIMARY KEY (`丂丂丂`); +ALTER TABLE `é¾–é¾–é¾–` ADD UNIQUE (`丅丅丅`); +#ALTER TABLE `é¾–é¾–é¾–` ADD FOREIGN KEY (`乚乚乚`) REFERENCES `é¾—é¾—é¾—`(`乚乚乚`); +ALTER TABLE `é¾–é¾–é¾–` CHANGE `丄丄丄` `丄丄` char(1); +ALTER TABLE `é¾–é¾–é¾–` MODIFY `丂丂丂` char(6); + +SELECT * FROM `é¾–é¾–é¾–`; +DESC `é¾–é¾–é¾–`; +SHOW CREATE TABLE `é¾–é¾–é¾–`; + +ALTER TABLE `é¾–é¾–é¾–` DROP INDEX `丄丄丄`; +ALTER TABLE `é¾–é¾–é¾–` DROP PRIMARY KEY; +ALTER TABLE `é¾–é¾–é¾–` DROP INDEX `丅丅丅`; +#ALTER TABLE `é¾–é¾–é¾–` DROP FOREIGN KEY `乚乚乚`; +ALTER TABLE `é¾–é¾–é¾–` DROP `丄丄`; +ALTER TABLE `é¾–é¾–é¾–` DROP `丅丅丅`; +ALTER TABLE `é¾–é¾–é¾–` DROP `乚乚乚`; + +SELECT * FROM `é¾–é¾–é¾–`; +DESC `é¾–é¾–é¾–`; +SHOW CREATE TABLE `é¾–é¾–é¾–`; + +DROP TABLE `アアア`; +DROP TABLE `イイイ`; +DROP TABLE `ã‚ã‚ã‚`; +DROP TABLE `ã„ã„ã„`; +DROP TABLE `é¾–é¾–é¾–`; +DROP TABLE `é¾—é¾—é¾—`; + +# +# Test BDB +# + +CREATE TABLE `アアア`(`ï½·ï½·ï½·` char(5)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TABLE `イイイ`(`ケケケ` char(5)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TABLE `ã‚ã‚ã‚`(`ããã` char(5)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TABLE `ã„ã„ã„`(`ã‘ã‘ã‘` char(5)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TABLE `é¾–é¾–é¾–`(`丂丂丂` char(5)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TABLE `é¾—é¾—é¾—`(`乚乚乚` char(5)) DEFAULT CHARSET = utf8 engine=BDB; + +INSERT INTO `アアア` VALUES ('アアアアア'),('イイイイイ'),('ウウウウウ'); +INSERT INTO `ã‚ã‚ã‚` VALUES ('ã‚ã‚ã‚ã‚ã‚'),('ã„ã„ã„ã„ã„'),('ã†ã†ã†ã†ã†'); +INSERT INTO `é¾–é¾–é¾–` VALUES ('丂丂丂丂丂'),('丄丄丄丄丄'),('丅丅丅丅丅'); + +ALTER TABLE `アアア` ADD `ï½¶ï½¶ï½¶` char(1) FIRST; +ALTER TABLE `アアア` ADD `ククク` char(1) AFTER `ï½·ï½·ï½·`; +ALTER TABLE `アアア` ADD `ケケケ` char(1); +ALTER TABLE `アアア` ADD INDEX (`ï½¶ï½¶ï½¶`); +ALTER TABLE `アアア` ADD PRIMARY KEY (`ï½·ï½·ï½·`); +#Multiple NULL fields are not allowed in BDB +#ALTER TABLE `アアア` ADD UNIQUE (`ククク`); +#ALTER TABLE `アアア` ADD FOREIGN KEY (`ケケケ`) REFERENCES `イイイ`(`ケケケ`); +ALTER TABLE `アアア` CHANGE `ï½¶ï½¶ï½¶` `ï½¶ï½¶` char(1); +ALTER TABLE `アアア` MODIFY `ï½·ï½·ï½·` char(6); + +SELECT * FROM `アアア`; +DESC `アアア`; +SHOW CREATE TABLE `アアア`; + +ALTER TABLE `アアア` DROP INDEX `ï½¶ï½¶ï½¶`; +ALTER TABLE `アアア` DROP PRIMARY KEY; +#ALTER TABLE `アアア` DROP INDEX `ククク`; +#ALTER TABLE `アアア` DROP FOREIGN KEY `ケケケ`; +ALTER TABLE `アアア` DROP `ï½¶ï½¶`; +ALTER TABLE `アアア` DROP `ククク`; +ALTER TABLE `アアア` DROP `ケケケ`; +SELECT * FROM `アアア`; +DESC `アアア`; +SHOW CREATE TABLE `アアア`; + +ALTER TABLE `ã‚ã‚ã‚` ADD `ã‹ã‹ã‹` char(1) FIRST; +ALTER TABLE `ã‚ã‚ã‚` ADD `ããã` char(1) AFTER `ããã`; +ALTER TABLE `ã‚ã‚ã‚` ADD `ã‘ã‘ã‘` char(1); +ALTER TABLE `ã‚ã‚ã‚` ADD INDEX (`ã‹ã‹ã‹`); +ALTER TABLE `ã‚ã‚ã‚` ADD PRIMARY KEY (`ããã`); +#ALTER TABLE `ã‚ã‚ã‚` ADD UNIQUE (`ããã`); +#ALTER TABLE `ã‚ã‚ã‚` ADD FOREIGN KEY (`ã‘ã‘ã‘`) REFERENCES `ã„ã„ã„`(`ã‘ã‘ã‘`); +ALTER TABLE `ã‚ã‚ã‚` CHANGE `ã‹ã‹ã‹` `ã‹ã‹` char(1); +ALTER TABLE `ã‚ã‚ã‚` MODIFY `ããã` char(6); + +SELECT * FROM `ã‚ã‚ã‚`; +DESC `ã‚ã‚ã‚`; +SHOW CREATE TABLE `ã‚ã‚ã‚`; + +ALTER TABLE `ã‚ã‚ã‚` DROP INDEX `ã‹ã‹ã‹`; +ALTER TABLE `ã‚ã‚ã‚` DROP PRIMARY KEY; +#ALTER TABLE `ã‚ã‚ã‚` DROP INDEX `ããã`; +#ALTER TABLE `ã‚ã‚ã‚` DROP FOREIGN KEY `ã‘ã‘ã‘`; +ALTER TABLE `ã‚ã‚ã‚` DROP `ã‹ã‹`; +ALTER TABLE `ã‚ã‚ã‚` DROP `ããã`; +ALTER TABLE `ã‚ã‚ã‚` DROP `ã‘ã‘ã‘`; + +SELECT * FROM `ã‚ã‚ã‚`; +DESC `ã‚ã‚ã‚`; +SHOW CREATE TABLE `ã‚ã‚ã‚`; + +ALTER TABLE `é¾–é¾–é¾–` ADD `丄丄丄` char(1) FIRST; +ALTER TABLE `é¾–é¾–é¾–` ADD `丅丅丅` char(1) AFTER `丂丂丂`; +ALTER TABLE `é¾–é¾–é¾–` ADD `乚乚乚` char(1); +ALTER TABLE `é¾–é¾–é¾–` ADD INDEX (`丄丄丄`); +ALTER TABLE `é¾–é¾–é¾–` ADD PRIMARY KEY (`丂丂丂`); +#ALTER TABLE `é¾–é¾–é¾–` ADD UNIQUE (`丅丅丅`); +#ALTER TABLE `é¾–é¾–é¾–` ADD FOREIGN KEY (`乚乚乚`) REFERENCES `é¾—é¾—é¾—`(`乚乚乚`); +ALTER TABLE `é¾–é¾–é¾–` CHANGE `丄丄丄` `丄丄` char(1); +ALTER TABLE `é¾–é¾–é¾–` MODIFY `丂丂丂` char(6); + +SELECT * FROM `é¾–é¾–é¾–`; +DESC `é¾–é¾–é¾–`; +SHOW CREATE TABLE `é¾–é¾–é¾–`; + +ALTER TABLE `é¾–é¾–é¾–` DROP INDEX `丄丄丄`; +ALTER TABLE `é¾–é¾–é¾–` DROP PRIMARY KEY; +#ALTER TABLE `é¾–é¾–é¾–` DROP INDEX `丅丅丅`; +#ALTER TABLE `é¾–é¾–é¾–` DROP FOREIGN KEY `乚乚乚`; +ALTER TABLE `é¾–é¾–é¾–` DROP `丄丄`; +ALTER TABLE `é¾–é¾–é¾–` DROP `丅丅丅`; +ALTER TABLE `é¾–é¾–é¾–` DROP `乚乚乚`; + +SELECT * FROM `é¾–é¾–é¾–`; +DESC `é¾–é¾–é¾–`; +SHOW CREATE TABLE `é¾–é¾–é¾–`; + +DROP TABLE `アアア`; +DROP TABLE `イイイ`; +DROP TABLE `ã‚ã‚ã‚`; +DROP TABLE `ã„ã„ã„`; +DROP TABLE `é¾–é¾–é¾–`; +DROP TABLE `é¾—é¾—é¾—`; diff --git a/mysql-test/suite/jp/t/jp_charlength_sjis.test b/mysql-test/suite/jp/t/jp_charlength_sjis.test new file mode 100755 index 00000000000..5f3543bb7a6 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_charlength_sjis.test @@ -0,0 +1,81 @@ +--character_set sjis +--disable_warnings +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +drop table if exists `‚s‚P‚P`; +drop table if exists `‚s‚P‚Q`; +--enable_warnings + +# +# Test CHAR_LENGTH() function with Japanese character in sjis encoding +# + +SET NAMES sjis; +SET character_set_database = sjis; + +CREATE TABLE `‚s‚P` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Q` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚R` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚S` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚T` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚U` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚V` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚W` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚X` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚O` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚P` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚Q` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; + +INSERT INTO `‚s‚P` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +INSERT INTO `‚s‚S` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +INSERT INTO `‚s‚V` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); + +#InnoDB +SELECT `‚b‚P`, CHAR_LENGTH(`‚b‚P`) FROM `‚s‚P`; +SELECT `‚b‚P`, CHAR_LENGTH(`‚b‚P`) FROM `‚s‚Q`; +SELECT `‚b‚P`, CHAR_LENGTH(`‚b‚P`) FROM `‚s‚R`; + +#MyISAM +SELECT `‚b‚P`, CHAR_LENGTH(`‚b‚P`) FROM `‚s‚S`; +SELECT `‚b‚P`, CHAR_LENGTH(`‚b‚P`) FROM `‚s‚T`; +SELECT `‚b‚P`, CHAR_LENGTH(`‚b‚P`) FROM `‚s‚U`; + +#HEAP +SELECT `‚b‚P`, CHAR_LENGTH(`‚b‚P`) FROM `‚s‚V`; +SELECT `‚b‚P`, CHAR_LENGTH(`‚b‚P`) FROM `‚s‚W`; +SELECT `‚b‚P`, CHAR_LENGTH(`‚b‚P`) FROM `‚s‚X`; + +#BDB +SELECT `‚b‚P`, CHAR_LENGTH(`‚b‚P`) FROM `‚s‚P‚O`; +SELECT `‚b‚P`, CHAR_LENGTH(`‚b‚P`) FROM `‚s‚P‚P`; +SELECT `‚b‚P`, CHAR_LENGTH(`‚b‚P`) FROM `‚s‚P‚Q`; + +DROP TABLE `‚s‚P`; +DROP TABLE `‚s‚Q`; +DROP TABLE `‚s‚R`; +DROP TABLE `‚s‚S`; +DROP TABLE `‚s‚T`; +DROP TABLE `‚s‚U`; +DROP TABLE `‚s‚V`; +DROP TABLE `‚s‚W`; +DROP TABLE `‚s‚X`; +DROP TABLE `‚s‚P‚O`; +DROP TABLE `‚s‚P‚P`; +DROP TABLE `‚s‚P‚Q`; diff --git a/mysql-test/suite/jp/t/jp_charlength_ucs2.test b/mysql-test/suite/jp/t/jp_charlength_ucs2.test new file mode 100755 index 00000000000..2db9db7cfc6 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_charlength_ucs2.test @@ -0,0 +1,83 @@ +--source include/have_ucs2.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +--enable_warnings + +# +# Test CHAR_LENGTH() function with Japanese character in ucs2 encoding +# + +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; + +CREATE TABLE `£Ô£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; + +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); + +#InnoDB +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£±`; +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£²`; +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£³`; + +#MyISAM +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£´`; +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£µ`; +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£¶`; + +#HEAP +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£·`; +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£¸`; +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£¹`; + +#BDB +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£±£°`; +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£±£±`; +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£±£²`; + +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/t/jp_charlength_ujis.test b/mysql-test/suite/jp/t/jp_charlength_ujis.test new file mode 100755 index 00000000000..08973231f27 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_charlength_ujis.test @@ -0,0 +1,82 @@ +--source include/have_ujis.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +--enable_warnings + +# +# Test CHAR_LENGTH() function with Japanese character in ujis encoding +# + +SET NAMES ujis; +SET character_set_database = ujis; + +CREATE TABLE `£Ô£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; + +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); + +#InnoDB +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£±`; +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£²`; +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£³`; + +#MyISAM +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£´`; +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£µ`; +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£¶`; + +#HEAP +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£·`; +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£¸`; +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£¹`; + +#BDB +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£±£°`; +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£±£±`; +SELECT `£Ã£±`, CHAR_LENGTH(`£Ã£±`) FROM `£Ô£±£²`; + +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/t/jp_charlength_utf8.test b/mysql-test/suite/jp/t/jp_charlength_utf8.test new file mode 100755 index 00000000000..a3f74db27ee --- /dev/null +++ b/mysql-test/suite/jp/t/jp_charlength_utf8.test @@ -0,0 +1,80 @@ +--disable_warnings +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +drop table if exists `T11`; +drop table if exists `T12`; +--enable_warnings + +# +# Test CHAR_LENGTH() function with Japanese character in utf8 encoding +# + +SET NAMES utf8; +SET character_set_database = utf8; + +CREATE TABLE `T1` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T11` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T12` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; + +INSERT INTO `T1` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `T3` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +INSERT INTO `T1ï¼` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `T12` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); + +#InnoDB +SELECT `C1`, CHAR_LENGTH(`C1`) FROM `T1`; +SELECT `C1`, CHAR_LENGTH(`C1`) FROM `ï¼´ï¼’`; +SELECT `C1`, CHAR_LENGTH(`C1`) FROM `T3`; + +#MyISAM +SELECT `C1`, CHAR_LENGTH(`C1`) FROM `ï¼´ï¼”`; +SELECT `C1`, CHAR_LENGTH(`C1`) FROM `T5`; +SELECT `C1`, CHAR_LENGTH(`C1`) FROM `ï¼´ï¼–`; + +#HEAP +SELECT `C1`, CHAR_LENGTH(`C1`) FROM `ï¼´ï¼—`; +SELECT `C1`, CHAR_LENGTH(`C1`) FROM `T8`; +SELECT `C1`, CHAR_LENGTH(`C1`) FROM `ï¼´ï¼™`; + +#BDB +SELECT `C1`, CHAR_LENGTH(`C1`) FROM `T1ï¼`; +SELECT `C1`, CHAR_LENGTH(`C1`) FROM `T11`; +SELECT `C1`, CHAR_LENGTH(`C1`) FROM `T12`; + +DROP TABLE `T1`; +DROP TABLE `ï¼´ï¼’`; +DROP TABLE `T3`; +DROP TABLE `ï¼´ï¼”`; +DROP TABLE `T5`; +DROP TABLE `ï¼´ï¼–`; +DROP TABLE `ï¼´ï¼—`; +DROP TABLE `T8`; +DROP TABLE `ï¼´ï¼™`; +DROP TABLE `T1ï¼`; +DROP TABLE `T11`; +DROP TABLE `T12`; diff --git a/mysql-test/suite/jp/t/jp_charset_sjis.test b/mysql-test/suite/jp/t/jp_charset_sjis.test new file mode 100755 index 00000000000..3a9f264bdfe --- /dev/null +++ b/mysql-test/suite/jp/t/jp_charset_sjis.test @@ -0,0 +1,133 @@ +--character_set sjis +--disable_warnings +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +drop table if exists `‚s‚P‚P`; +drop table if exists `‚s‚P‚Q`; +--enable_warnings + +# +# Test CHARSET() function with Japanese characters in sjis encoding +# + +SET NAMES sjis; +SET character_set_database = sjis; + +CREATE TABLE `‚s‚P` (`‚b‚P` char(20)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Q` (`‚b‚P` char(20)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚R` (`‚b‚P` char(20)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚S` (`‚b‚P` char(20)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚T` (`‚b‚P` char(20)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚U` (`‚b‚P` char(20)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚V` (`‚b‚P` char(20)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚W` (`‚b‚P` char(20)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚X` (`‚b‚P` char(20)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚O` (`‚b‚P` char(20)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚P` (`‚b‚P` char(20)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚Q` (`‚b‚P` char(20)) DEFAULT CHARSET = sjis engine = bdb; + +#Load the following data in each table +# jisx0201 hankaku-katakana data +# jisx0208 data + + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `‚s‚P`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `‚s‚Q`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `‚s‚R`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `‚s‚S`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `‚s‚T`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `‚s‚U`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `‚s‚V`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `‚s‚W`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `‚s‚X`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `‚s‚P‚O`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `‚s‚P‚P`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `‚s‚P‚Q`; + +#InnoDB +SELECT DISTINCT CHARSET(`‚b‚P`) FROM `‚s‚P`; +SELECT DISTINCT CHARSET(`‚b‚P`) FROM `‚s‚Q`; +SELECT DISTINCT CHARSET(`‚b‚P`) FROM `‚s‚R`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING utf8)) FROM `‚s‚P`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ucs2)) FROM `‚s‚P`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING sjis)) FROM `‚s‚P`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ujis)) FROM `‚s‚P`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING utf8)) FROM `‚s‚Q`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ucs2)) FROM `‚s‚Q`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING sjis)) FROM `‚s‚Q`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ujis)) FROM `‚s‚Q`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING utf8)) FROM `‚s‚R`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ucs2)) FROM `‚s‚R`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING sjis)) FROM `‚s‚R`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ujis)) FROM `‚s‚R`; + +#MyISAM +SELECT DISTINCT CHARSET(`‚b‚P`) FROM `‚s‚S`; +SELECT DISTINCT CHARSET(`‚b‚P`) FROM `‚s‚T`; +SELECT DISTINCT CHARSET(`‚b‚P`) FROM `‚s‚U`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING utf8)) FROM `‚s‚S`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ucs2)) FROM `‚s‚S`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING sjis)) FROM `‚s‚S`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ujis)) FROM `‚s‚S`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING utf8)) FROM `‚s‚T`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ucs2)) FROM `‚s‚T`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING sjis)) FROM `‚s‚T`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ujis)) FROM `‚s‚T`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING utf8)) FROM `‚s‚U`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ucs2)) FROM `‚s‚U`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING sjis)) FROM `‚s‚U`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ujis)) FROM `‚s‚U`; + +#Heap +SELECT DISTINCT CHARSET(`‚b‚P`) FROM `‚s‚V`; +SELECT DISTINCT CHARSET(`‚b‚P`) FROM `‚s‚W`; +SELECT DISTINCT CHARSET(`‚b‚P`) FROM `‚s‚X`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING utf8)) FROM `‚s‚V`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ucs2)) FROM `‚s‚V`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING sjis)) FROM `‚s‚V`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ujis)) FROM `‚s‚V`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING utf8)) FROM `‚s‚W`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ucs2)) FROM `‚s‚W`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING sjis)) FROM `‚s‚W`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ujis)) FROM `‚s‚W`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING utf8)) FROM `‚s‚X`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ucs2)) FROM `‚s‚X`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING sjis)) FROM `‚s‚X`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ujis)) FROM `‚s‚X`; + +#BDB +SELECT DISTINCT CHARSET(`‚b‚P`) FROM `‚s‚P‚O`; +SELECT DISTINCT CHARSET(`‚b‚P`) FROM `‚s‚P‚P`; +SELECT DISTINCT CHARSET(`‚b‚P`) FROM `‚s‚P‚Q`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING utf8)) FROM `‚s‚P‚O`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ucs2)) FROM `‚s‚P‚O`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING sjis)) FROM `‚s‚P‚O`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ujis)) FROM `‚s‚P‚O`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING utf8)) FROM `‚s‚P‚P`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ucs2)) FROM `‚s‚P‚P`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING sjis)) FROM `‚s‚P‚P`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ujis)) FROM `‚s‚P‚P`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING utf8)) FROM `‚s‚P‚Q`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ucs2)) FROM `‚s‚P‚Q`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING sjis)) FROM `‚s‚P‚Q`; +SELECT DISTINCT CHARSET(CONVERT(`‚b‚P` USING ujis)) FROM `‚s‚P‚Q`; + +drop table `‚s‚P`; +drop table `‚s‚Q`; +drop table `‚s‚R`; +drop table `‚s‚S`; +drop table `‚s‚T`; +drop table `‚s‚U`; +drop table `‚s‚V`; +drop table `‚s‚W`; +drop table `‚s‚X`; +drop table `‚s‚P‚O`; +drop table `‚s‚P‚P`; +drop table `‚s‚P‚Q`; diff --git a/mysql-test/suite/jp/t/jp_charset_ucs2.test b/mysql-test/suite/jp/t/jp_charset_ucs2.test new file mode 100755 index 00000000000..5183071033b --- /dev/null +++ b/mysql-test/suite/jp/t/jp_charset_ucs2.test @@ -0,0 +1,221 @@ +--source include/have_ucs2.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +--enable_warnings + +# +# Test CHARSET() function with Japanese characters in ucs2 encoding +# + +SET NAMES ujis; +SET character_set_database = ucs2; +CREATE TABLE `£Ô£±` (`£Ã£±` char(20)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(20)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(20)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(20)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(20)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(20)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(20)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(20)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(20)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(20)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(20)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(20)) DEFAULT CHARSET = ucs2 engine = bdb; + +#Insert the following data in each table +# jisx0201 hankaku-katakana data +# jisx0208 data +# jisx0212 supplemental character data + +INSERT INTO `£Ô£±` VALUES + ('PQRSTUVWXYZ[\\]^_') +,(' Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯') +,('Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿') +,('ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ') +,('ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß'); + +INSERT INTO `£Ô£²` VALUES + ('¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç') +,('¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û') +,('¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³') +,('¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³') +,('¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³') +,('¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³') +,('¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³'); + +INSERT INTO `£Ô£³` VALUES + ('¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦') +,('°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç') +,('°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û') +,('°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï') +,('¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³') +,('í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ') +,('íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ'); + +INSERT INTO `£Ô£´` VALUES + ('PQRSTUVWXYZ[\\]^_') +,(' Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯') +,('Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿') +,('ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ') +,('ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß'); + +INSERT INTO `£Ô£µ` VALUES + ('¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç') +,('¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û') +,('¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³') +,('¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³') +,('¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³') +,('¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³') +,('¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³'); + +INSERT INTO `£Ô£¶` VALUES + ('¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦') +,('°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç') +,('°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û') +,('°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï') +,('¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³') +,('í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ') +,('íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ'); + +INSERT INTO `£Ô£·` VALUES + ('PQRSTUVWXYZ[\\]^_') +,(' Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯') +,('Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿') +,('ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ') +,('ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß'); + +INSERT INTO `£Ô£¸` VALUES + ('¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç') +,('¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û') +,('¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³') +,('¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³') +,('¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³') +,('¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³') +,('¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³'); + +INSERT INTO `£Ô£¹` VALUES + ('¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦') +,('°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç') +,('°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û') +,('°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï') +,('¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³') +,('í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ') +,('íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ'); + +INSERT INTO `£Ô£±£°` VALUES + ('PQRSTUVWXYZ[\\]^_') +,(' Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯') +,('Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿') +,('ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ') +,('ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß'); + +INSERT INTO `£Ô£±£±` VALUES + ('¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç') +,('¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û') +,('¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³') +,('¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³') +,('¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³') +,('¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³') +,('¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³'); + +INSERT INTO `£Ô£±£²` VALUES + ('¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦') +,('°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç') +,('°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û') +,('°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï') +,('¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³') +,('í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ') +,('íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ'); + +#InnoDB +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£±`; +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£²`; +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£³`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£±`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£±`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£±`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£±`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£²`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£²`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£²`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£²`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£³`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£³`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£³`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£³`; + +#MyISAM +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£´`; +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£µ`; +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£¶`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£´`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£´`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£´`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£´`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£µ`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£µ`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£µ`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£µ`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£¶`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£¶`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£¶`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£¶`; + +#Heap +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£·`; +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£¸`; +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£¹`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£·`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£·`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£·`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£·`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£¸`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£¸`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£¸`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£¸`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£¹`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£¹`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£¹`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£¹`; + +#BDB +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£±£°`; +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£±£±`; +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£±£²`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£±£°`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£±£°`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£±£°`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£±£°`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£±£±`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£±£±`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£±£±`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£±£±`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£±£²`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£±£²`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£±£²`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£±£²`; + +drop table `£Ô£±`; +drop table `£Ô£²`; +drop table `£Ô£³`; +drop table `£Ô£´`; +drop table `£Ô£µ`; +drop table `£Ô£¶`; +drop table `£Ô£·`; +drop table `£Ô£¸`; +drop table `£Ô£¹`; +drop table `£Ô£±£°`; +drop table `£Ô£±£±`; +drop table `£Ô£±£²`; diff --git a/mysql-test/suite/jp/t/jp_charset_ujis.test b/mysql-test/suite/jp/t/jp_charset_ujis.test new file mode 100755 index 00000000000..de9ef318530 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_charset_ujis.test @@ -0,0 +1,135 @@ +--source include/have_ujis.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +--enable_warnings + +# +# Test CHARSET() function with Japanese characters in ujis encoding +# + +SET NAMES ujis; +SET character_set_database = ujis; + +CREATE TABLE `£Ô£±` (`£Ã£±` char(20)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(20)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(20)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(20)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(20)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(20)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(20)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(20)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(20)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(20)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(20)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(20)) DEFAULT CHARSET = ujis engine = bdb; + +#Load the following data in each table +# jisx0201 hankaku-katakana data +# jisx0208 data +# jisx0212 supplemental character data + + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_ujis.dat' INTO TABLE `£Ô£±`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_ujis.dat' INTO TABLE `£Ô£²`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_ujis.dat' INTO TABLE `£Ô£³`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_ujis.dat' INTO TABLE `£Ô£´`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_ujis.dat' INTO TABLE `£Ô£µ`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_ujis.dat' INTO TABLE `£Ô£¶`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_ujis.dat' INTO TABLE `£Ô£·`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_ujis.dat' INTO TABLE `£Ô£¸`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_ujis.dat' INTO TABLE `£Ô£¹`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_ujis.dat' INTO TABLE `£Ô£±£°`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_ujis.dat' INTO TABLE `£Ô£±£±`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_ujis.dat' INTO TABLE `£Ô£±£²`; + +#InnoDB +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£±`; +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£²`; +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£³`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£±`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£±`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£±`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£±`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£²`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£²`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£²`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£²`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£³`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£³`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£³`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£³`; + +#MyISAM +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£´`; +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£µ`; +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£¶`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£´`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£´`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£´`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£´`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£µ`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£µ`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£µ`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£µ`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£¶`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£¶`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£¶`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£¶`; + +#Heap +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£·`; +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£¸`; +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£¹`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£·`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£·`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£·`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£·`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£¸`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£¸`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£¸`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£¸`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£¹`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£¹`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£¹`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£¹`; + +#BDB +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£±£°`; +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£±£±`; +SELECT DISTINCT CHARSET(`£Ã£±`) FROM `£Ô£±£²`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£±£°`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£±£°`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£±£°`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£±£°`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£±£±`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£±£±`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£±£±`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£±£±`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING utf8)) FROM `£Ô£±£²`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ucs2)) FROM `£Ô£±£²`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING sjis)) FROM `£Ô£±£²`; +SELECT DISTINCT CHARSET(CONVERT(`£Ã£±` USING ujis)) FROM `£Ô£±£²`; + +drop table `£Ô£±`; +drop table `£Ô£²`; +drop table `£Ô£³`; +drop table `£Ô£´`; +drop table `£Ô£µ`; +drop table `£Ô£¶`; +drop table `£Ô£·`; +drop table `£Ô£¸`; +drop table `£Ô£¹`; +drop table `£Ô£±£°`; +drop table `£Ô£±£±`; +drop table `£Ô£±£²`; diff --git a/mysql-test/suite/jp/t/jp_charset_utf8.test b/mysql-test/suite/jp/t/jp_charset_utf8.test new file mode 100755 index 00000000000..2d73daba42a --- /dev/null +++ b/mysql-test/suite/jp/t/jp_charset_utf8.test @@ -0,0 +1,133 @@ +--disable_warnings +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +drop table if exists `T11`; +drop table if exists `T12`; +--enable_warnings + +# +# Test CHARSET() function with Japanese characters in utf8 encoding +# + +SET NAMES utf8; +SET character_set_database = utf8; + +CREATE TABLE `T1` (`C1` char(20)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’` (`C1` char(20)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3` (`C1` char(20)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”` (`C1` char(20)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5` (`C1` char(20)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–` (`C1` char(20)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—` (`C1` char(20)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8` (`C1` char(20)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™` (`C1` char(20)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼` (`C1` char(20)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T11` (`C1` char(20)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T12` (`C1` char(20)) DEFAULT CHARSET = utf8 engine = bdb; + +#Load the following data in each table +# jisx0201 hankaku-katakana data +# jisx0208 data +# jisx0212 supplemental character data + + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_utf8.dat' INTO TABLE `T1`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_utf8.dat' INTO TABLE `ï¼´ï¼’`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_utf8.dat' INTO TABLE `T3`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_utf8.dat' INTO TABLE `ï¼´ï¼”`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_utf8.dat' INTO TABLE `T5`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_utf8.dat' INTO TABLE `ï¼´ï¼–`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_utf8.dat' INTO TABLE `ï¼´ï¼—`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_utf8.dat' INTO TABLE `T8`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_utf8.dat' INTO TABLE `ï¼´ï¼™`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_utf8.dat' INTO TABLE `T1ï¼`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_utf8.dat' INTO TABLE `T11`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_utf8.dat' INTO TABLE `T12`; + +#InnoDB +SELECT DISTINCT CHARSET(`C1`) FROM `T1`; +SELECT DISTINCT CHARSET(`C1`) FROM `ï¼´ï¼’`; +SELECT DISTINCT CHARSET(`C1`) FROM `T3`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING utf8)) FROM `T1`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ucs2)) FROM `T1`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING sjis)) FROM `T1`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ujis)) FROM `T1`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING utf8)) FROM `ï¼´ï¼’`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ucs2)) FROM `ï¼´ï¼’`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING sjis)) FROM `ï¼´ï¼’`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ujis)) FROM `ï¼´ï¼’`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING utf8)) FROM `T3`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ucs2)) FROM `T3`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING sjis)) FROM `T3`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ujis)) FROM `T3`; + +#MyISAM +SELECT DISTINCT CHARSET(`C1`) FROM `ï¼´ï¼”`; +SELECT DISTINCT CHARSET(`C1`) FROM `T5`; +SELECT DISTINCT CHARSET(`C1`) FROM `ï¼´ï¼–`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING utf8)) FROM `ï¼´ï¼”`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ucs2)) FROM `ï¼´ï¼”`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING sjis)) FROM `ï¼´ï¼”`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ujis)) FROM `ï¼´ï¼”`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING utf8)) FROM `T5`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ucs2)) FROM `T5`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING sjis)) FROM `T5`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ujis)) FROM `T5`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING utf8)) FROM `ï¼´ï¼–`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ucs2)) FROM `ï¼´ï¼–`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING sjis)) FROM `ï¼´ï¼–`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ujis)) FROM `ï¼´ï¼–`; + +#Heap +SELECT DISTINCT CHARSET(`C1`) FROM `ï¼´ï¼—`; +SELECT DISTINCT CHARSET(`C1`) FROM `T8`; +SELECT DISTINCT CHARSET(`C1`) FROM `ï¼´ï¼™`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING utf8)) FROM `ï¼´ï¼—`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ucs2)) FROM `ï¼´ï¼—`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING sjis)) FROM `ï¼´ï¼—`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ujis)) FROM `ï¼´ï¼—`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING utf8)) FROM `T8`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ucs2)) FROM `T8`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING sjis)) FROM `T8`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ujis)) FROM `T8`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING utf8)) FROM `ï¼´ï¼™`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ucs2)) FROM `ï¼´ï¼™`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING sjis)) FROM `ï¼´ï¼™`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ujis)) FROM `ï¼´ï¼™`; + +#BDB +SELECT DISTINCT CHARSET(`C1`) FROM `T1ï¼`; +SELECT DISTINCT CHARSET(`C1`) FROM `T11`; +SELECT DISTINCT CHARSET(`C1`) FROM `T12`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING utf8)) FROM `T1ï¼`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ucs2)) FROM `T1ï¼`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING sjis)) FROM `T1ï¼`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ujis)) FROM `T1ï¼`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING utf8)) FROM `T11`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ucs2)) FROM `T11`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING sjis)) FROM `T11`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ujis)) FROM `T11`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING utf8)) FROM `T12`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ucs2)) FROM `T12`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING sjis)) FROM `T12`; +SELECT DISTINCT CHARSET(CONVERT(`C1` USING ujis)) FROM `T12`; + +drop table `T1`; +drop table `ï¼´ï¼’`; +drop table `T3`; +drop table `ï¼´ï¼”`; +drop table `T5`; +drop table `ï¼´ï¼–`; +drop table `ï¼´ï¼—`; +drop table `T8`; +drop table `ï¼´ï¼™`; +drop table `T1ï¼`; +drop table `T11`; +drop table `T12`; diff --git a/mysql-test/suite/jp/t/jp_convert_sjis.test b/mysql-test/suite/jp/t/jp_convert_sjis.test new file mode 100755 index 00000000000..93fa33029bf --- /dev/null +++ b/mysql-test/suite/jp/t/jp_convert_sjis.test @@ -0,0 +1,110 @@ +--character_set sjis +SET NAMES sjis; +SET character_set_database = sjis; + +--disable_warnings +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +drop table if exists `‚s‚P‚P`; +drop table if exists `‚s‚P‚Q`; +--enable_warnings + +# +# Test CONVERT() function with Japanese character in sjis encoding +# + +CREATE TABLE `‚s‚P` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Q` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚R` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚S` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚T` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚U` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚V` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚W` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚X` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚O` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚P` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚Q` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; + +#Load the following data in each table +# jisx0201 hankaku-katakana data +# jisx0208 data +# jisx0212 supplemental character data + + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `‚s‚P`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `‚s‚Q`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `‚s‚R`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `‚s‚S`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `‚s‚T`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `‚s‚U`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `‚s‚V`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `‚s‚W`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `‚s‚X`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `‚s‚P‚O`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `‚s‚P‚P`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `‚s‚P‚Q`; + +#InnoDB +SELECT `‚b‚P`, CONVERT(`‚b‚P` using utf8) FROM `‚s‚P`; +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ucs2) FROM `‚s‚P`; +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ujis) FROM `‚s‚P`; +SELECT `‚b‚P`, CONVERT(`‚b‚P` using utf8) FROM `‚s‚Q`; +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ucs2) FROM `‚s‚Q`; +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ujis) FROM `‚s‚Q`; +SELECT `‚b‚P`, CONVERT(`‚b‚P` using utf8) FROM `‚s‚R`; +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ucs2) FROM `‚s‚R`; +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ujis) FROM `‚s‚R`; + +#MyISAM +SELECT `‚b‚P`, CONVERT(`‚b‚P` using utf8) FROM `‚s‚S`; +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ucs2) FROM `‚s‚S`; +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ujis) FROM `‚s‚S`; +SELECT `‚b‚P`, CONVERT(`‚b‚P` using utf8) FROM `‚s‚T`; +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ucs2) FROM `‚s‚T`; +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ujis) FROM `‚s‚T`; +SELECT `‚b‚P`, CONVERT(`‚b‚P` using utf8) FROM `‚s‚U`; +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ucs2) FROM `‚s‚U`; +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ujis) FROM `‚s‚U`; + +#Heap +SELECT `‚b‚P`, CONVERT(`‚b‚P` using utf8) FROM `‚s‚V`; +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ucs2) FROM `‚s‚V`; +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ujis) FROM `‚s‚V`; +SELECT `‚b‚P`, CONVERT(`‚b‚P` using utf8) FROM `‚s‚W`; +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ucs2) FROM `‚s‚W`; +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ujis) FROM `‚s‚W`; +SELECT `‚b‚P`, CONVERT(`‚b‚P` using utf8) FROM `‚s‚X`; +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ucs2) FROM `‚s‚X`; +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ujis) FROM `‚s‚X`; + +#BDB +SELECT `‚b‚P`, CONVERT(`‚b‚P` using utf8) FROM `‚s‚P‚O`; +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ucs2) FROM `‚s‚P‚O`; +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ujis) FROM `‚s‚P‚O`; +SELECT `‚b‚P`, CONVERT(`‚b‚P` using utf8) FROM `‚s‚P‚P`; +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ucs2) FROM `‚s‚P‚P`; +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ujis) FROM `‚s‚P‚P`; +SELECT `‚b‚P`, CONVERT(`‚b‚P` using utf8) FROM `‚s‚P‚Q`; +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ucs2) FROM `‚s‚P‚Q`; +SELECT `‚b‚P`, CONVERT(`‚b‚P` using ujis) FROM `‚s‚P‚Q`; + +drop table `‚s‚P`; +drop table `‚s‚Q`; +drop table `‚s‚R`; +drop table `‚s‚S`; +drop table `‚s‚T`; +drop table `‚s‚U`; +drop table `‚s‚V`; +drop table `‚s‚W`; +drop table `‚s‚X`; +drop table `‚s‚P‚O`; +drop table `‚s‚P‚P`; +drop table `‚s‚P‚Q`; diff --git a/mysql-test/suite/jp/t/jp_convert_ucs2.test b/mysql-test/suite/jp/t/jp_convert_ucs2.test new file mode 100755 index 00000000000..88b0d0c9cba --- /dev/null +++ b/mysql-test/suite/jp/t/jp_convert_ucs2.test @@ -0,0 +1,203 @@ +--source include/have_ucs2.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +--enable_warnings + +# +# Test CONVERT() function with Japanese character in ucs2 encoding +# + +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; + +CREATE TABLE `£Ô£±` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; + +#Insert the following data in each table +# jisx0201 hankaku-katakana data +# jisx0208 data +# jisx0212 supplemental character data + +INSERT INTO `£Ô£±` VALUES + ('PQRSTUVWXYZ[\\]^_') +,(' Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯') +,('Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿') +,('ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ') +,('ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß'); + +INSERT INTO `£Ô£²` VALUES + ('¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç') +,('¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û') +,('¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³') +,('¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³') +,('¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³') +,('¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³') +,('¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³'); + +INSERT INTO `£Ô£³` VALUES + ('¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦') +,('°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç') +,('°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û') +,('°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï') +,('¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³') +,('í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ') +,('íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ'); + +INSERT INTO `£Ô£´` VALUES + ('PQRSTUVWXYZ[\\]^_') +,(' Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯') +,('Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿') +,('ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ') +,('ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß'); + +INSERT INTO `£Ô£µ` VALUES + ('¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç') +,('¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û') +,('¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³') +,('¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³') +,('¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³') +,('¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³') +,('¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³'); + +INSERT INTO `£Ô£¶` VALUES + ('¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦') +,('°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç') +,('°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û') +,('°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï') +,('¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³') +,('í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ') +,('íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ'); + +INSERT INTO `£Ô£·` VALUES + ('PQRSTUVWXYZ[\\]^_') +,(' Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯') +,('Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿') +,('ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ') +,('ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß'); + +INSERT INTO `£Ô£¸` VALUES + ('¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç') +,('¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û') +,('¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³') +,('¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³') +,('¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³') +,('¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³') +,('¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³'); + +INSERT INTO `£Ô£¹` VALUES + ('¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦') +,('°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç') +,('°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û') +,('°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï') +,('¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³') +,('í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ') +,('íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ'); + +INSERT INTO `£Ô£±£°` VALUES + ('PQRSTUVWXYZ[\\]^_') +,(' Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯') +,('Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿') +,('ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ') +,('ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß'); + +INSERT INTO `£Ô£±£±` VALUES + ('¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç') +,('¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û') +,('¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³') +,('¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³') +,('¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³') +,('¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³') +,('¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³'); + +INSERT INTO `£Ô£±£²` VALUES + ('¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦') +,('°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç') +,('°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û') +,('°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï') +,('¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³') +,('í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ') +,('íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ'); + +#InnoDB +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£±`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£±`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£±`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£²`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£²`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£²`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£³`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£³`; +# The result will get garbled because jisx0212 is not included in sjis +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£³`; + +#MyISAM +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£´`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£´`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£´`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£µ`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£µ`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£µ`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£¶`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£¶`; +# The result will get garbled because jisx0212 is not included in sjis +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£¶`; + +#Heap +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£·`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£·`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£·`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£¸`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£¸`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£¸`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£¹`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£¹`; +# The result will get garbled because jisx0212 is not included in sjis +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£¹`; + +#BDB +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£±£°`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£±£°`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£±£°`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£±£±`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£±£±`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£±£±`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£±£²`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£±£²`; +# The result will get garbled because jisx0212 is not included in sjis +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£±£²`; + +drop table `£Ô£±`; +drop table `£Ô£²`; +drop table `£Ô£³`; +drop table `£Ô£´`; +drop table `£Ô£µ`; +drop table `£Ô£¶`; +drop table `£Ô£·`; +drop table `£Ô£¸`; +drop table `£Ô£¹`; +drop table `£Ô£±£°`; +drop table `£Ô£±£±`; +drop table `£Ô£±£²`; diff --git a/mysql-test/suite/jp/t/jp_convert_ujis.test b/mysql-test/suite/jp/t/jp_convert_ujis.test new file mode 100755 index 00000000000..d6303b66f34 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_convert_ujis.test @@ -0,0 +1,115 @@ +--source include/have_ujis.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +--enable_warnings + +# +# Test CONVERT() function with Japanese character in ujis encoding +# + +SET NAMES ujis; +SET character_set_database = ujis; + +CREATE TABLE `£Ô£±` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; + +#Load the following data in each table +# jisx0201 hankaku-katakana data +# jisx0208 data +# jisx0212 supplemental character data + + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_ujis.dat' INTO TABLE `£Ô£±`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_ujis.dat' INTO TABLE `£Ô£²`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_ujis.dat' INTO TABLE `£Ô£³`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_ujis.dat' INTO TABLE `£Ô£´`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_ujis.dat' INTO TABLE `£Ô£µ`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_ujis.dat' INTO TABLE `£Ô£¶`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_ujis.dat' INTO TABLE `£Ô£·`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_ujis.dat' INTO TABLE `£Ô£¸`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_ujis.dat' INTO TABLE `£Ô£¹`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_ujis.dat' INTO TABLE `£Ô£±£°`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_ujis.dat' INTO TABLE `£Ô£±£±`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_ujis.dat' INTO TABLE `£Ô£±£²`; + +#InnoDB +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£±`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£±`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£±`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£²`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£²`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£²`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£³`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£³`; +# The result will get garbled because jisx0212 is not included in sjis +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£³`; + +#MyISAM +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£´`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£´`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£´`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£µ`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£µ`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£µ`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£¶`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£¶`; +# The result will get garbled because jisx0212 is not included in sjis +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£¶`; + +#Heap +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£·`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£·`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£·`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£¸`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£¸`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£¸`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£¹`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£¹`; +# The result will get garbled because jisx0212 is not included in sjis +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£¹`; + +#BDB +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£±£°`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£±£°`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£±£°`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£±£±`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£±£±`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£±£±`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using utf8) FROM `£Ô£±£²`; +SELECT `£Ã£±`, CONVERT(`£Ã£±` using ucs2) FROM `£Ô£±£²`; +# The result will get garbled because jisx0212 is not included in sjis +SELECT `£Ã£±`, CONVERT(`£Ã£±` using sjis) FROM `£Ô£±£²`; + +drop table `£Ô£±`; +drop table `£Ô£²`; +drop table `£Ô£³`; +drop table `£Ô£´`; +drop table `£Ô£µ`; +drop table `£Ô£¶`; +drop table `£Ô£·`; +drop table `£Ô£¸`; +drop table `£Ô£¹`; +drop table `£Ô£±£°`; +drop table `£Ô£±£±`; +drop table `£Ô£±£²`; diff --git a/mysql-test/suite/jp/t/jp_convert_utf8.test b/mysql-test/suite/jp/t/jp_convert_utf8.test new file mode 100755 index 00000000000..a687b0f06cb --- /dev/null +++ b/mysql-test/suite/jp/t/jp_convert_utf8.test @@ -0,0 +1,113 @@ +--disable_warnings +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +drop table if exists `T11`; +drop table if exists `T12`; +--enable_warnings + +# +# Test CONVERT() function with Japanese character in utf8 encoding +# + +SET NAMES utf8; +SET character_set_database = utf8; + +CREATE TABLE `T1` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T11` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T12` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; + +#Load the following data in each table +# jisx0201 hankaku-katakana data +# jisx0208 data +# jisx0212 supplemental character data + + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_utf8.dat' INTO TABLE `T1`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_utf8.dat' INTO TABLE `ï¼´ï¼’`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_utf8.dat' INTO TABLE `T3`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_utf8.dat' INTO TABLE `ï¼´ï¼”`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_utf8.dat' INTO TABLE `T5`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_utf8.dat' INTO TABLE `ï¼´ï¼–`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_utf8.dat' INTO TABLE `ï¼´ï¼—`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_utf8.dat' INTO TABLE `T8`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_utf8.dat' INTO TABLE `ï¼´ï¼™`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_utf8.dat' INTO TABLE `T1ï¼`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_utf8.dat' INTO TABLE `T11`; + LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_utf8.dat' INTO TABLE `T12`; + +#InnoDB +SELECT `C1`, CONVERT(`C1` using ujis) FROM `T1`; +SELECT `C1`, CONVERT(`C1` using ucs2) FROM `T1`; +SELECT `C1`, CONVERT(`C1` using sjis) FROM `T1`; +SELECT `C1`, CONVERT(`C1` using ujis) FROM `ï¼´ï¼’`; +SELECT `C1`, CONVERT(`C1` using ucs2) FROM `ï¼´ï¼’`; +SELECT `C1`, CONVERT(`C1` using sjis) FROM `ï¼´ï¼’`; +SELECT `C1`, CONVERT(`C1` using ujis) FROM `T3`; +SELECT `C1`, CONVERT(`C1` using ucs2) FROM `T3`; +# The result will get garbled because jisx0212 is not included in sjis +SELECT `C1`, CONVERT(`C1` using sjis) FROM `T3`; + +#MyISAM +SELECT `C1`, CONVERT(`C1` using ujis) FROM `ï¼´ï¼”`; +SELECT `C1`, CONVERT(`C1` using ucs2) FROM `ï¼´ï¼”`; +SELECT `C1`, CONVERT(`C1` using sjis) FROM `ï¼´ï¼”`; +SELECT `C1`, CONVERT(`C1` using ujis) FROM `T5`; +SELECT `C1`, CONVERT(`C1` using ucs2) FROM `T5`; +SELECT `C1`, CONVERT(`C1` using sjis) FROM `T5`; +SELECT `C1`, CONVERT(`C1` using ujis) FROM `ï¼´ï¼–`; +SELECT `C1`, CONVERT(`C1` using ucs2) FROM `ï¼´ï¼–`; +# The result will get garbled because jisx0212 is not included in sjis +SELECT `C1`, CONVERT(`C1` using sjis) FROM `ï¼´ï¼–`; + +#Heap +SELECT `C1`, CONVERT(`C1` using ujis) FROM `ï¼´ï¼—`; +SELECT `C1`, CONVERT(`C1` using ucs2) FROM `ï¼´ï¼—`; +SELECT `C1`, CONVERT(`C1` using sjis) FROM `ï¼´ï¼—`; +SELECT `C1`, CONVERT(`C1` using ujis) FROM `T8`; +SELECT `C1`, CONVERT(`C1` using ucs2) FROM `T8`; +SELECT `C1`, CONVERT(`C1` using sjis) FROM `T8`; +SELECT `C1`, CONVERT(`C1` using ujis) FROM `ï¼´ï¼™`; +SELECT `C1`, CONVERT(`C1` using ucs2) FROM `ï¼´ï¼™`; +# The result will get garbled because jisx0212 is not included in sjis +SELECT `C1`, CONVERT(`C1` using sjis) FROM `ï¼´ï¼™`; + +#BDB +SELECT `C1`, CONVERT(`C1` using ujis) FROM `T1ï¼`; +SELECT `C1`, CONVERT(`C1` using ucs2) FROM `T1ï¼`; +SELECT `C1`, CONVERT(`C1` using sjis) FROM `T1ï¼`; +SELECT `C1`, CONVERT(`C1` using ujis) FROM `T11`; +SELECT `C1`, CONVERT(`C1` using ucs2) FROM `T11`; +SELECT `C1`, CONVERT(`C1` using sjis) FROM `T11`; +SELECT `C1`, CONVERT(`C1` using ujis) FROM `T12`; +SELECT `C1`, CONVERT(`C1` using ucs2) FROM `T12`; +# The result will get garbled because jisx0212 is not included in sjis +SELECT `C1`, CONVERT(`C1` using sjis) FROM `T12`; + +drop table `T1`; +drop table `ï¼´ï¼’`; +drop table `T3`; +drop table `ï¼´ï¼”`; +drop table `T5`; +drop table `ï¼´ï¼–`; +drop table `ï¼´ï¼—`; +drop table `T8`; +drop table `ï¼´ï¼™`; +drop table `T1ï¼`; +drop table `T11`; +drop table `T12`; diff --git a/mysql-test/suite/jp/t/jp_create_db_sjis.test b/mysql-test/suite/jp/t/jp_create_db_sjis.test new file mode 100755 index 00000000000..ef66d338fce --- /dev/null +++ b/mysql-test/suite/jp/t/jp_create_db_sjis.test @@ -0,0 +1,26 @@ +--character_set sjis +SET NAMES sjis; +SET character_set_database = sjis; +--disable_warnings +drop database if exists `ÆÎݺÞ`; +drop database if exists `“ú–{Œê`; +drop database if exists `ƒ\\•\`; +--enable_warnings + +# +# Test Creating databases using Japanese charact for DB name in ujis encoding +# + +CREATE DATABASE `ÆÎݺÞ`; +CREATE DATABASE `“ú–{Œê`; +CREATE DATABASE `ƒ\\•\`; + +SHOW DATABASES; + +USE `ÆÎݺÞ`; +USE `“ú–{Œê`; +USE `ƒ\\•\`; + +DROP DATABASE `ÆÎݺÞ`; +DROP DATABASE `“ú–{Œê`; +DROP DATABASE `ƒ\\•\`; diff --git a/mysql-test/suite/jp/t/jp_create_db_ucs2.test b/mysql-test/suite/jp/t/jp_create_db_ucs2.test new file mode 100755 index 00000000000..9e8ca7d2a0f --- /dev/null +++ b/mysql-test/suite/jp/t/jp_create_db_ucs2.test @@ -0,0 +1,29 @@ +--source include/have_ucs2.inc + +--disable_warnings +drop database if exists `ŽÆŽÎŽÝŽºŽÞ`; +drop database if exists `ÆüËܸì`; +drop database if exists `íÜíÝíÞ`; +--enable_warnings + +# +# Test Creating databases using Japanese charact for DB name in ucs2 encoding +# + +SET NAMES ujis; +SET character_set_database = ucs2; +SET character_set_server = ucs2; + +CREATE DATABASE `ŽÆŽÎŽÝŽºŽÞ`; +CREATE DATABASE `ÆüËܸì`; +CREATE DATABASE `íÜíÝíÞ`; + +SHOW DATABASES; + +USE `ŽÆŽÎŽÝŽºŽÞ`; +USE `ÆüËܸì`; +USE `íÜíÝíÞ`; + +DROP DATABASE `ŽÆŽÎŽÝŽºŽÞ`; +DROP DATABASE `ÆüËܸì`; +DROP DATABASE `íÜíÝíÞ`; diff --git a/mysql-test/suite/jp/t/jp_create_db_ujis.test b/mysql-test/suite/jp/t/jp_create_db_ujis.test new file mode 100755 index 00000000000..0095f864836 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_create_db_ujis.test @@ -0,0 +1,28 @@ +--source include/have_ujis.inc + +--disable_warnings +drop database if exists `ŽÆŽÎŽÝŽºŽÞ`; +drop database if exists `ÆüËܸì`; +drop database if exists `íÜíÝíÞ`; +--enable_warnings + +# +# Test Creating databases using Japanese charact for DB name in ujis encoding +# + +SET NAMES ujis; +SET character_set_database = ujis; + +CREATE DATABASE `ŽÆŽÎŽÝŽºŽÞ`; +CREATE DATABASE `ÆüËܸì`; +CREATE DATABASE `íÜíÝíÞ`; + +SHOW DATABASES; + +USE `ŽÆŽÎŽÝŽºŽÞ`; +USE `ÆüËܸì`; +USE `íÜíÝíÞ`; + +DROP DATABASE `ŽÆŽÎŽÝŽºŽÞ`; +DROP DATABASE `ÆüËܸì`; +DROP DATABASE `íÜíÝíÞ`; diff --git a/mysql-test/suite/jp/t/jp_create_db_utf8.test b/mysql-test/suite/jp/t/jp_create_db_utf8.test new file mode 100755 index 00000000000..4f8eb24cbe3 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_create_db_utf8.test @@ -0,0 +1,26 @@ +--disable_warnings +drop database if exists `ニホï¾ï½ºï¾ž`; +drop database if exists `日本語`; +drop database if exists `龔龖龗`; +--enable_warnings + +# +# Test Creating databases using Japanese charact for DB name in utf8 encoding +# + +SET NAMES utf8; +SET character_set_database = utf8; + +CREATE DATABASE `ニホï¾ï½ºï¾ž`; +CREATE DATABASE `日本語`; +CREATE DATABASE `龔龖龗`; + +SHOW DATABASES; + +USE `ニホï¾ï½ºï¾ž`; +USE `日本語`; +USE `龔龖龗`; + +DROP DATABASE `ニホï¾ï½ºï¾ž`; +DROP DATABASE `日本語`; +DROP DATABASE `龔龖龗`; diff --git a/mysql-test/suite/jp/t/jp_create_tbl_sjis.test b/mysql-test/suite/jp/t/jp_create_tbl_sjis.test new file mode 100755 index 00000000000..45c0b24388b --- /dev/null +++ b/mysql-test/suite/jp/t/jp_create_tbl_sjis.test @@ -0,0 +1,308 @@ +--character_set sjis +SET NAMES sjis; +SET character_set_database = sjis; +--disable_warnings +DROP TABLE IF EXISTS `±±±`; +DROP TABLE IF EXISTS `²²²`; +DROP TABLE IF EXISTS `³³³`; +DROP TABLE IF EXISTS `´´´`; +DROP TABLE IF EXISTS `µµµ`; +DROP TABLE IF EXISTS `‚ ‚ ‚ `; +DROP TABLE IF EXISTS `‚¢‚¢‚¢`; +DROP TABLE IF EXISTS `‚¤‚¤‚¤`; +DROP TABLE IF EXISTS `‚¦‚¦‚¦`; +DROP TABLE IF EXISTS `‚¨‚¨‚¨`; +DROP TABLE IF EXISTS `ƒ\ƒ\ƒ\`; +DROP TABLE IF EXISTS `\\\`; +DROP TABLE IF EXISTS `•\•\•\`; +DROP TABLE IF EXISTS `—\—\—\`; +DROP TABLE IF EXISTS `\\\`; +--enable_warnings + +CREATE TABLE `±±±`(`¶¶¶` char(1)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TABLE `²²²`(`···` char(1)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TABLE `‚ ‚ ‚ `(`‚©‚©‚©` char(1)) DEFAULT CHARSET = sjis engine=INNODB; +CREATE TABLE `‚¢‚¢‚¢`(`‚«‚«‚«` char(1)) DEFAULT CHARSET = sjis engine=INNODB; +CREATE TABLE `ƒ\ƒ\ƒ\`(`‰\‰\‰\` char(1)) DEFAULT CHARSET = sjis engine=INNODB; +CREATE TABLE `\\\`(`Ž\Ž\Ž\` char(1)) DEFAULT CHARSET = sjis engine=INNODB; +# Tables should not be created because table names exist +CREATE TABLE IF NOT EXISTS `±±±`(`¶¶¶` char(1)) DEFAULT CHARSET = sjis engine=INNODB; +CREATE TABLE IF NOT EXISTS `²²²`(`···` char(1)) DEFAULT CHARSET = sjis engine=INNODB; +CREATE TABLE IF NOT EXISTS `‚ ‚ ‚ `(`‚©‚©‚©` char(1)) DEFAULT CHARSET = sjis engine=INNODB; +CREATE TABLE IF NOT EXISTS `‚¢‚¢‚¢`(`‚«‚«‚«` char(1)) DEFAULT CHARSET = sjis engine=INNODB; +CREATE TABLE IF NOT EXISTS `ƒ\ƒ\ƒ\`(`‰\‰\‰\` char(1)) DEFAULT CHARSET = sjis engine=INNODB; +CREATE TABLE IF NOT EXISTS `\\\`(`Ž\Ž\Ž\` char(1)) DEFAULT CHARSET = sjis engine=INNODB; +# Tables should be created +CREATE TABLE IF NOT EXISTS `³³³`(`¸¸¸` char(1)) DEFAULT CHARSET = sjis engine=INNODB; +CREATE TABLE IF NOT EXISTS `‚¤‚¤‚¤`(`‚­‚­‚­` char(1)) DEFAULT CHARSET = sjis engine=INNODB; +CREATE TABLE IF NOT EXISTS `•\•\•\`(`\\\`char(1)) DEFAULT CHARSET = sjis engine=INNODB; +CREATE TEMPORARY TABLE `´´´`(`¹¹¹` char(1)) DEFAULT CHARSET = sjis engine=INNODB; +CREATE TEMPORARY TABLE `µµµ`(`ººº` char(1)) DEFAULT CHARSET = sjis engine=INNODB; +CREATE TEMPORARY TABLE `‚¦‚¦‚¦`(`‚¯‚¯‚¯` char(1)) DEFAULT CHARSET = sjis engine=INNODB; +CREATE TEMPORARY TABLE `‚¨‚¨‚¨`(`‚±‚±‚±` char(1)) DEFAULT CHARSET = sjis engine=INNODB; +CREATE TEMPORARY TABLE `—\—\—\`(`“\“\“\` char(1)) DEFAULT CHARSET = sjis engine=INNODB; +CREATE TEMPORARY TABLE `\\\`(`”\”\”\` char(1)) DEFAULT CHARSET = sjis engine=INNODB; + +DESC `±±±`; +DESC `²²²`; +DESC `³³³`; +DESC `´´´`; +DESC `µµµ`; +DESC `‚ ‚ ‚ `; +DESC `‚¢‚¢‚¢`; +DESC `‚¤‚¤‚¤`; +DESC `‚¦‚¦‚¦`; +DESC `‚¨‚¨‚¨`; +DESC `ƒ\ƒ\ƒ\`; +DESC `\\\`; +DESC `•\•\•\`; +DESC `—\—\—\`; +DESC `\\\`; + +SHOW CREATE TABLE `±±±`; +SHOW CREATE TABLE `²²²`; +SHOW CREATE TABLE `³³³`; +SHOW CREATE TABLE `´´´`; +SHOW CREATE TABLE `µµµ`; +SHOW CREATE TABLE `‚ ‚ ‚ `; +SHOW CREATE TABLE `‚¢‚¢‚¢`; +SHOW CREATE TABLE `‚¤‚¤‚¤`; +SHOW CREATE TABLE `‚¦‚¦‚¦`; +SHOW CREATE TABLE `‚¨‚¨‚¨`; +SHOW CREATE TABLE `ƒ\ƒ\ƒ\`; +SHOW CREATE TABLE `\\\`; +SHOW CREATE TABLE `•\•\•\`; +SHOW CREATE TABLE `—\—\—\`; +SHOW CREATE TABLE `\\\`; + +DROP TABLE `±±±`; +DROP TABLE `²²²`; +DROP TABLE `³³³`; +DROP TABLE `´´´`; +DROP TABLE `µµµ`; +DROP TABLE `‚ ‚ ‚ `; +DROP TABLE `‚¢‚¢‚¢`; +DROP TABLE `‚¤‚¤‚¤`; +DROP TABLE `‚¦‚¦‚¦`; +DROP TABLE `‚¨‚¨‚¨`; +DROP TABLE `ƒ\ƒ\ƒ\`; +DROP TABLE `\\\`; +DROP TABLE `•\•\•\`; +DROP TABLE `—\—\—\`; +DROP TABLE `\\\`; + +CREATE TABLE `±±±`(`¶¶¶` char(1)) DEFAULT CHARSET = sjis engine=MyISAM; +CREATE TABLE `²²²`(`···` char(1)) DEFAULT CHARSET = sjis engine=MyISAM; +CREATE TABLE `‚ ‚ ‚ `(`‚©‚©‚©` char(1)) DEFAULT CHARSET = sjis engine=MyISAM; +CREATE TABLE `‚¢‚¢‚¢`(`‚«‚«‚«` char(1)) DEFAULT CHARSET = sjis engine=MyISAM; +CREATE TABLE `ƒ\ƒ\ƒ\`(`‰\‰\‰\` char(1)) DEFAULT CHARSET = sjis engine=MyISAM; +CREATE TABLE `\\\`(`Ž\Ž\Ž\` char(1)) DEFAULT CHARSET = sjis engine=MyISAM; +# Tables should not be created because table names exist +CREATE TABLE IF NOT EXISTS `±±±`(`¶¶¶` char(1)) DEFAULT CHARSET = sjis engine=MyISAM; +CREATE TABLE IF NOT EXISTS `²²²`(`···` char(1)) DEFAULT CHARSET = sjis engine=MyISAM; +CREATE TABLE IF NOT EXISTS `‚ ‚ ‚ `(`‚©‚©‚©` char(1)) DEFAULT CHARSET = sjis engine=MyISAM; +CREATE TABLE IF NOT EXISTS `‚¢‚¢‚¢`(`‚«‚«‚«` char(1)) DEFAULT CHARSET = sjis engine=MyISAM; +CREATE TABLE IF NOT EXISTS `ƒ\ƒ\ƒ\`(`‰\‰\‰\` char(1)) DEFAULT CHARSET = sjis engine=MyISAM; +CREATE TABLE IF NOT EXISTS `\\\`(`Ž\Ž\Ž\` char(1)) DEFAULT CHARSET = sjis engine=MyISAM; +# Tables should be created +CREATE TABLE IF NOT EXISTS `³³³`(`¸¸¸` char(1)) DEFAULT CHARSET = sjis engine=MyISAM; +CREATE TABLE IF NOT EXISTS `‚¤‚¤‚¤`(`‚­‚­‚­` char(1)) DEFAULT CHARSET = sjis engine=MyISAM; +CREATE TABLE IF NOT EXISTS `•\•\•\`(`\\\`char(1)) DEFAULT CHARSET = sjis engine=MyISAM; +CREATE TEMPORARY TABLE `´´´`(`¹¹¹` char(1)) DEFAULT CHARSET = sjis engine=MyISAM; +CREATE TEMPORARY TABLE `µµµ`(`ººº` char(1)) DEFAULT CHARSET = sjis engine=MyISAM; +CREATE TEMPORARY TABLE `‚¦‚¦‚¦`(`‚¯‚¯‚¯` char(1)) DEFAULT CHARSET = sjis engine=MyISAM; +CREATE TEMPORARY TABLE `‚¨‚¨‚¨`(`‚±‚±‚±` char(1)) DEFAULT CHARSET = sjis engine=MyISAM; +CREATE TEMPORARY TABLE `—\—\—\`(`“\“\“\` char(1)) DEFAULT CHARSET = sjis engine=MyISAM; +CREATE TEMPORARY TABLE `\\\`(`”\”\”\` char(1)) DEFAULT CHARSET = sjis engine=MyISAM; + +DESC `±±±`; +DESC `²²²`; +DESC `³³³`; +DESC `´´´`; +DESC `µµµ`; +DESC `‚ ‚ ‚ `; +DESC `‚¢‚¢‚¢`; +DESC `‚¤‚¤‚¤`; +DESC `‚¦‚¦‚¦`; +DESC `‚¨‚¨‚¨`; +DESC `ƒ\ƒ\ƒ\`; +DESC `\\\`; +DESC `•\•\•\`; +DESC `—\—\—\`; +DESC `\\\`; + +SHOW CREATE TABLE `±±±`; +SHOW CREATE TABLE `²²²`; +SHOW CREATE TABLE `³³³`; +SHOW CREATE TABLE `´´´`; +SHOW CREATE TABLE `µµµ`; +SHOW CREATE TABLE `‚ ‚ ‚ `; +SHOW CREATE TABLE `‚¢‚¢‚¢`; +SHOW CREATE TABLE `‚¤‚¤‚¤`; +SHOW CREATE TABLE `‚¦‚¦‚¦`; +SHOW CREATE TABLE `‚¨‚¨‚¨`; +SHOW CREATE TABLE `ƒ\ƒ\ƒ\`; +SHOW CREATE TABLE `\\\`; +SHOW CREATE TABLE `•\•\•\`; +SHOW CREATE TABLE `—\—\—\`; +SHOW CREATE TABLE `\\\`; + +DROP TABLE `±±±`; +DROP TABLE `²²²`; +DROP TABLE `³³³`; +DROP TABLE `´´´`; +DROP TABLE `µµµ`; +DROP TABLE `‚ ‚ ‚ `; +DROP TABLE `‚¢‚¢‚¢`; +DROP TABLE `‚¤‚¤‚¤`; +DROP TABLE `‚¦‚¦‚¦`; +DROP TABLE `‚¨‚¨‚¨`; +DROP TABLE `ƒ\ƒ\ƒ\`; +DROP TABLE `\\\`; +DROP TABLE `•\•\•\`; +DROP TABLE `—\—\—\`; +DROP TABLE `\\\`; + +CREATE TABLE `±±±`(`¶¶¶` char(1)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TABLE `²²²`(`···` char(1)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TABLE `‚ ‚ ‚ `(`‚©‚©‚©` char(1)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TABLE `‚¢‚¢‚¢`(`‚«‚«‚«` char(1)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TABLE `ƒ\ƒ\ƒ\`(`‰\‰\‰\` char(1)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TABLE `\\\`(`Ž\Ž\Ž\` char(1)) DEFAULT CHARSET = sjis engine=HEAP; +# Tables should not be created because table names exist +CREATE TABLE IF NOT EXISTS `±±±`(`¶¶¶` char(1)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TABLE IF NOT EXISTS `²²²`(`···` char(1)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TABLE IF NOT EXISTS `‚ ‚ ‚ `(`‚©‚©‚©` char(1)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TABLE IF NOT EXISTS `‚¢‚¢‚¢`(`‚«‚«‚«` char(1)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TABLE IF NOT EXISTS `ƒ\ƒ\ƒ\`(`‰\‰\‰\` char(1)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TABLE IF NOT EXISTS `\\\`(`Ž\Ž\Ž\` char(1)) DEFAULT CHARSET = sjis engine=HEAP; +# Tables should be created +CREATE TABLE IF NOT EXISTS `³³³`(`¸¸¸` char(1)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TABLE IF NOT EXISTS `‚¤‚¤‚¤`(`‚­‚­‚­` char(1)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TABLE IF NOT EXISTS `•\•\•\`(`\\\`char(1)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TEMPORARY TABLE `´´´`(`¹¹¹` char(1)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TEMPORARY TABLE `µµµ`(`ººº` char(1)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TEMPORARY TABLE `‚¦‚¦‚¦`(`‚¯‚¯‚¯` char(1)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TEMPORARY TABLE `‚¨‚¨‚¨`(`‚±‚±‚±` char(1)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TEMPORARY TABLE `—\—\—\`(`“\“\“\` char(1)) DEFAULT CHARSET = sjis engine=HEAP; +CREATE TEMPORARY TABLE `\\\`(`”\”\”\` char(1)) DEFAULT CHARSET = sjis engine=HEAP; + +DESC `±±±`; +DESC `²²²`; +DESC `³³³`; +DESC `´´´`; +DESC `µµµ`; +DESC `‚ ‚ ‚ `; +DESC `‚¢‚¢‚¢`; +DESC `‚¤‚¤‚¤`; +DESC `‚¦‚¦‚¦`; +DESC `‚¨‚¨‚¨`; +DESC `ƒ\ƒ\ƒ\`; +DESC `\\\`; +DESC `•\•\•\`; +DESC `—\—\—\`; +DESC `\\\`; + +SHOW CREATE TABLE `±±±`; +SHOW CREATE TABLE `²²²`; +SHOW CREATE TABLE `³³³`; +SHOW CREATE TABLE `´´´`; +SHOW CREATE TABLE `µµµ`; +SHOW CREATE TABLE `‚ ‚ ‚ `; +SHOW CREATE TABLE `‚¢‚¢‚¢`; +SHOW CREATE TABLE `‚¤‚¤‚¤`; +SHOW CREATE TABLE `‚¦‚¦‚¦`; +SHOW CREATE TABLE `‚¨‚¨‚¨`; +SHOW CREATE TABLE `ƒ\ƒ\ƒ\`; +SHOW CREATE TABLE `\\\`; +SHOW CREATE TABLE `•\•\•\`; +SHOW CREATE TABLE `—\—\—\`; +SHOW CREATE TABLE `\\\`; + +DROP TABLE `±±±`; +DROP TABLE `²²²`; +DROP TABLE `³³³`; +DROP TABLE `´´´`; +DROP TABLE `µµµ`; +DROP TABLE `‚ ‚ ‚ `; +DROP TABLE `‚¢‚¢‚¢`; +DROP TABLE `‚¤‚¤‚¤`; +DROP TABLE `‚¦‚¦‚¦`; +DROP TABLE `‚¨‚¨‚¨`; +DROP TABLE `ƒ\ƒ\ƒ\`; +DROP TABLE `\\\`; +DROP TABLE `•\•\•\`; +DROP TABLE `—\—\—\`; +DROP TABLE `\\\`; + +CREATE TABLE `±±±`(`¶¶¶` char(1)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TABLE `²²²`(`···` char(1)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TABLE `‚ ‚ ‚ `(`‚©‚©‚©` char(1)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TABLE `‚¢‚¢‚¢`(`‚«‚«‚«` char(1)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TABLE `ƒ\ƒ\ƒ\`(`‰\‰\‰\` char(1)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TABLE `\\\`(`Ž\Ž\Ž\` char(1)) DEFAULT CHARSET = sjis engine=BDB; +# Tables should not be created because table names exist +CREATE TABLE IF NOT EXISTS `±±±`(`¶¶¶` char(1)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TABLE IF NOT EXISTS `²²²`(`···` char(1)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TABLE IF NOT EXISTS `‚ ‚ ‚ `(`‚©‚©‚©` char(1)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TABLE IF NOT EXISTS `‚¢‚¢‚¢`(`‚«‚«‚«` char(1)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TABLE IF NOT EXISTS `ƒ\ƒ\ƒ\`(`‰\‰\‰\` char(1)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TABLE IF NOT EXISTS `\\\`(`Ž\Ž\Ž\` char(1)) DEFAULT CHARSET = sjis engine=BDB; +# Tables should be created +CREATE TABLE IF NOT EXISTS `³³³`(`¸¸¸` char(1)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TABLE IF NOT EXISTS `‚¤‚¤‚¤`(`‚­‚­‚­` char(1)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TABLE IF NOT EXISTS `•\•\•\`(`\\\`char(1)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TEMPORARY TABLE `´´´`(`¹¹¹` char(1)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TEMPORARY TABLE `µµµ`(`ººº` char(1)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TEMPORARY TABLE `‚¦‚¦‚¦`(`‚¯‚¯‚¯` char(1)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TEMPORARY TABLE `‚¨‚¨‚¨`(`‚±‚±‚±` char(1)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TEMPORARY TABLE `—\—\—\`(`“\“\“\` char(1)) DEFAULT CHARSET = sjis engine=BDB; +CREATE TEMPORARY TABLE `\\\`(`”\”\”\` char(1)) DEFAULT CHARSET = sjis engine=BDB; + +DESC `±±±`; +DESC `²²²`; +DESC `³³³`; +DESC `´´´`; +DESC `µµµ`; +DESC `‚ ‚ ‚ `; +DESC `‚¢‚¢‚¢`; +DESC `‚¤‚¤‚¤`; +DESC `‚¦‚¦‚¦`; +DESC `‚¨‚¨‚¨`; +DESC `ƒ\ƒ\ƒ\`; +DESC `\\\`; +DESC `•\•\•\`; +DESC `—\—\—\`; +DESC `\\\`; + +SHOW CREATE TABLE `±±±`; +SHOW CREATE TABLE `²²²`; +SHOW CREATE TABLE `³³³`; +SHOW CREATE TABLE `´´´`; +SHOW CREATE TABLE `µµµ`; +SHOW CREATE TABLE `‚ ‚ ‚ `; +SHOW CREATE TABLE `‚¢‚¢‚¢`; +SHOW CREATE TABLE `‚¤‚¤‚¤`; +SHOW CREATE TABLE `‚¦‚¦‚¦`; +SHOW CREATE TABLE `‚¨‚¨‚¨`; +SHOW CREATE TABLE `ƒ\ƒ\ƒ\`; +SHOW CREATE TABLE `\\\`; +SHOW CREATE TABLE `•\•\•\`; +SHOW CREATE TABLE `—\—\—\`; +SHOW CREATE TABLE `\\\`; + +DROP TABLE `±±±`; +DROP TABLE `²²²`; +DROP TABLE `³³³`; +DROP TABLE `´´´`; +DROP TABLE `µµµ`; +DROP TABLE `‚ ‚ ‚ `; +DROP TABLE `‚¢‚¢‚¢`; +DROP TABLE `‚¤‚¤‚¤`; +DROP TABLE `‚¦‚¦‚¦`; +DROP TABLE `‚¨‚¨‚¨`; +DROP TABLE `ƒ\ƒ\ƒ\`; +DROP TABLE `\\\`; +DROP TABLE `•\•\•\`; +DROP TABLE `—\—\—\`; +DROP TABLE `\\\`; diff --git a/mysql-test/suite/jp/t/jp_create_tbl_ucs2.test b/mysql-test/suite/jp/t/jp_create_tbl_ucs2.test new file mode 100755 index 00000000000..519697e3530 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_create_tbl_ucs2.test @@ -0,0 +1,314 @@ +--source include/have_ucs2.inc + +--disable_warnings +DROP TABLE IF EXISTS `ޱޱޱ`; +DROP TABLE IF EXISTS `޲޲޲`; +DROP TABLE IF EXISTS `޳޳޳`; +DROP TABLE IF EXISTS `Ž´Ž´Ž´`; +DROP TABLE IF EXISTS `޵޵޵`; +DROP TABLE IF EXISTS `¤¢¤¢¤¢`; +DROP TABLE IF EXISTS `¤¤¤¤¤¤`; +DROP TABLE IF EXISTS `¤¦¤¦¤¦`; +DROP TABLE IF EXISTS `¤¨¤¨¤¨`; +DROP TABLE IF EXISTS `¤ª¤ª¤ª`; +DROP TABLE IF EXISTS `íÝíÝíÝ`; +DROP TABLE IF EXISTS `íÞíÞíÞ`; +DROP TABLE IF EXISTS `íßíßíß`; +DROP TABLE IF EXISTS `íàíàíà`; +DROP TABLE IF EXISTS `íáíáíá`; +--enable_warnings + +# +# Test creating table with Japanese characters in ucs2 encoding +# + +SET NAMES ujis; +SET character_set_database = ucs2; + +CREATE TABLE `ޱޱޱ`(`޶޶޶` char(1)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TABLE `޲޲޲`(`Ž·Ž·Ž·` char(1)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TABLE `¤¢¤¢¤¢`(`¤«¤«¤«` char(1)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TABLE `¤¤¤¤¤¤`(`¤­¤­¤­` char(1)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TABLE `íÝíÝíÝ`(`°¡°¡°¡` char(1)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TABLE `íÞíÞíÞ`(`°¢°¢°¢` char(1)) DEFAULT CHARSET = ucs2 engine=INNODB; +# Tables should not be created because table names exist +CREATE TABLE IF NOT EXISTS `ޱޱޱ`(`޶޶޶` char(1)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TABLE IF NOT EXISTS `޲޲޲`(`Ž·Ž·Ž·` char(1)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TABLE IF NOT EXISTS `¤¢¤¢¤¢`(`¤«¤«¤«` char(1)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TABLE IF NOT EXISTS `¤¤¤¤¤¤`(`¤­¤­¤­` char(1)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TABLE IF NOT EXISTS `íÝíÝíÝ`(`°¡°¡°¡` char(1)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TABLE IF NOT EXISTS `íÞíÞíÞ`(`°¢°¢°¢` char(1)) DEFAULT CHARSET = ucs2 engine=INNODB; +# Tables should be created +CREATE TABLE IF NOT EXISTS `޳޳޳`(`ޏޏޏ` char(1)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TABLE IF NOT EXISTS `¤¦¤¦¤¦`(`¤¯¤¯¤¯` char(1)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TABLE IF NOT EXISTS `íßíßíß`(`°£°£°£`char(1)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TEMPORARY TABLE `Ž´Ž´Ž´`(`޹޹޹` char(1)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TEMPORARY TABLE `޵޵޵`(`ŽºŽºŽº` char(1)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TEMPORARY TABLE `¤¨¤¨¤¨`(`¤±¤±¤±` char(1)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TEMPORARY TABLE `¤ª¤ª¤ª`(`¤³¤³¤³` char(1)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TEMPORARY TABLE `íàíàíà`(`°¤°¤°¤` char(1)) DEFAULT CHARSET = ucs2 engine=INNODB; +CREATE TEMPORARY TABLE `íáíáíá`(`°¥°¥°¥` char(1)) DEFAULT CHARSET = ucs2 engine=INNODB; + +DESC `ޱޱޱ`; +DESC `޲޲޲`; +DESC `޳޳޳`; +DESC `Ž´Ž´Ž´`; +DESC `޵޵޵`; +DESC `¤¢¤¢¤¢`; +DESC `¤¤¤¤¤¤`; +DESC `¤¦¤¦¤¦`; +DESC `¤¨¤¨¤¨`; +DESC `¤ª¤ª¤ª`; +DESC `íÝíÝíÝ`; +DESC `íÞíÞíÞ`; +DESC `íßíßíß`; +DESC `íàíàíà`; +DESC `íáíáíá`; + +SHOW CREATE TABLE `ޱޱޱ`; +SHOW CREATE TABLE `޲޲޲`; +SHOW CREATE TABLE `޳޳޳`; +SHOW CREATE TABLE `Ž´Ž´Ž´`; +SHOW CREATE TABLE `޵޵޵`; +SHOW CREATE TABLE `¤¢¤¢¤¢`; +SHOW CREATE TABLE `¤¤¤¤¤¤`; +SHOW CREATE TABLE `¤¦¤¦¤¦`; +SHOW CREATE TABLE `¤¨¤¨¤¨`; +SHOW CREATE TABLE `¤ª¤ª¤ª`; +SHOW CREATE TABLE `íÝíÝíÝ`; +SHOW CREATE TABLE `íÞíÞíÞ`; +SHOW CREATE TABLE `íßíßíß`; +SHOW CREATE TABLE `íàíàíà`; +SHOW CREATE TABLE `íáíáíá`; + +DROP TABLE `ޱޱޱ`; +DROP TABLE `޲޲޲`; +DROP TABLE `޳޳޳`; +DROP TABLE `Ž´Ž´Ž´`; +DROP TABLE `޵޵޵`; +DROP TABLE `¤¢¤¢¤¢`; +DROP TABLE `¤¤¤¤¤¤`; +DROP TABLE `¤¦¤¦¤¦`; +DROP TABLE `¤¨¤¨¤¨`; +DROP TABLE `¤ª¤ª¤ª`; +DROP TABLE `íÝíÝíÝ`; +DROP TABLE `íÞíÞíÞ`; +DROP TABLE `íßíßíß`; +DROP TABLE `íàíàíà`; +DROP TABLE `íáíáíá`; + +CREATE TABLE `ޱޱޱ`(`޶޶޶` char(1)) DEFAULT CHARSET = ucs2 engine=MyISAM; +CREATE TABLE `޲޲޲`(`Ž·Ž·Ž·` char(1)) DEFAULT CHARSET = ucs2 engine=MyISAM; +CREATE TABLE `¤¢¤¢¤¢`(`¤«¤«¤«` char(1)) DEFAULT CHARSET = ucs2 engine=MyISAM; +CREATE TABLE `¤¤¤¤¤¤`(`¤­¤­¤­` char(1)) DEFAULT CHARSET = ucs2 engine=MyISAM; +CREATE TABLE `íÝíÝíÝ`(`°¡°¡°¡` char(1)) DEFAULT CHARSET = ucs2 engine=MyISAM; +CREATE TABLE `íÞíÞíÞ`(`°¢°¢°¢` char(1)) DEFAULT CHARSET = ucs2 engine=MyISAM; +# Tables should not be created because table names exist +CREATE TABLE IF NOT EXISTS `ޱޱޱ`(`޶޶޶` char(1)) DEFAULT CHARSET = ucs2 engine=MyISAM; +CREATE TABLE IF NOT EXISTS `޲޲޲`(`Ž·Ž·Ž·` char(1)) DEFAULT CHARSET = ucs2 engine=MyISAM; +CREATE TABLE IF NOT EXISTS `¤¢¤¢¤¢`(`¤«¤«¤«` char(1)) DEFAULT CHARSET = ucs2 engine=MyISAM; +CREATE TABLE IF NOT EXISTS `¤¤¤¤¤¤`(`¤­¤­¤­` char(1)) DEFAULT CHARSET = ucs2 engine=MyISAM; +CREATE TABLE IF NOT EXISTS `íÝíÝíÝ`(`°¡°¡°¡` char(1)) DEFAULT CHARSET = ucs2 engine=MyISAM; +CREATE TABLE IF NOT EXISTS `íÞíÞíÞ`(`°¢°¢°¢` char(1)) DEFAULT CHARSET = ucs2 engine=MyISAM; +# Tables should be created +CREATE TABLE IF NOT EXISTS `޳޳޳`(`ޏޏޏ` char(1)) DEFAULT CHARSET = ucs2 engine=MyISAM; +CREATE TABLE IF NOT EXISTS `¤¦¤¦¤¦`(`¤¯¤¯¤¯` char(1)) DEFAULT CHARSET = ucs2 engine=MyISAM; +CREATE TABLE IF NOT EXISTS `íßíßíß`(`°£°£°£`char(1)) DEFAULT CHARSET = ucs2 engine=MyISAM; +CREATE TEMPORARY TABLE `Ž´Ž´Ž´`(`޹޹޹` char(1)) DEFAULT CHARSET = ucs2 engine=MyISAM; +CREATE TEMPORARY TABLE `޵޵޵`(`ŽºŽºŽº` char(1)) DEFAULT CHARSET = ucs2 engine=MyISAM; +CREATE TEMPORARY TABLE `¤¨¤¨¤¨`(`¤±¤±¤±` char(1)) DEFAULT CHARSET = ucs2 engine=MyISAM; +CREATE TEMPORARY TABLE `¤ª¤ª¤ª`(`¤³¤³¤³` char(1)) DEFAULT CHARSET = ucs2 engine=MyISAM; +CREATE TEMPORARY TABLE `íàíàíà`(`°¤°¤°¤` char(1)) DEFAULT CHARSET = ucs2 engine=MyISAM; +CREATE TEMPORARY TABLE `íáíáíá`(`°¥°¥°¥` char(1)) DEFAULT CHARSET = ucs2 engine=MyISAM; + +DESC `ޱޱޱ`; +DESC `޲޲޲`; +DESC `޳޳޳`; +DESC `Ž´Ž´Ž´`; +DESC `޵޵޵`; +DESC `¤¢¤¢¤¢`; +DESC `¤¤¤¤¤¤`; +DESC `¤¦¤¦¤¦`; +DESC `¤¨¤¨¤¨`; +DESC `¤ª¤ª¤ª`; +DESC `íÝíÝíÝ`; +DESC `íÞíÞíÞ`; +DESC `íßíßíß`; +DESC `íàíàíà`; +DESC `íáíáíá`; + +SHOW CREATE TABLE `ޱޱޱ`; +SHOW CREATE TABLE `޲޲޲`; +SHOW CREATE TABLE `޳޳޳`; +SHOW CREATE TABLE `Ž´Ž´Ž´`; +SHOW CREATE TABLE `޵޵޵`; +SHOW CREATE TABLE `¤¢¤¢¤¢`; +SHOW CREATE TABLE `¤¤¤¤¤¤`; +SHOW CREATE TABLE `¤¦¤¦¤¦`; +SHOW CREATE TABLE `¤¨¤¨¤¨`; +SHOW CREATE TABLE `¤ª¤ª¤ª`; +SHOW CREATE TABLE `íÝíÝíÝ`; +SHOW CREATE TABLE `íÞíÞíÞ`; +SHOW CREATE TABLE `íßíßíß`; +SHOW CREATE TABLE `íàíàíà`; +SHOW CREATE TABLE `íáíáíá`; + +DROP TABLE `ޱޱޱ`; +DROP TABLE `޲޲޲`; +DROP TABLE `޳޳޳`; +DROP TABLE `Ž´Ž´Ž´`; +DROP TABLE `޵޵޵`; +DROP TABLE `¤¢¤¢¤¢`; +DROP TABLE `¤¤¤¤¤¤`; +DROP TABLE `¤¦¤¦¤¦`; +DROP TABLE `¤¨¤¨¤¨`; +DROP TABLE `¤ª¤ª¤ª`; +DROP TABLE `íÝíÝíÝ`; +DROP TABLE `íÞíÞíÞ`; +DROP TABLE `íßíßíß`; +DROP TABLE `íàíàíà`; +DROP TABLE `íáíáíá`; + +CREATE TABLE `ޱޱޱ`(`޶޶޶` char(1)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TABLE `޲޲޲`(`Ž·Ž·Ž·` char(1)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TABLE `¤¢¤¢¤¢`(`¤«¤«¤«` char(1)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TABLE `¤¤¤¤¤¤`(`¤­¤­¤­` char(1)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TABLE `íÝíÝíÝ`(`°¡°¡°¡` char(1)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TABLE `íÞíÞíÞ`(`°¢°¢°¢` char(1)) DEFAULT CHARSET = ucs2 engine=HEAP; +# Tables should not be created because table names exist +CREATE TABLE IF NOT EXISTS `ޱޱޱ`(`޶޶޶` char(1)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TABLE IF NOT EXISTS `޲޲޲`(`Ž·Ž·Ž·` char(1)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TABLE IF NOT EXISTS `¤¢¤¢¤¢`(`¤«¤«¤«` char(1)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TABLE IF NOT EXISTS `¤¤¤¤¤¤`(`¤­¤­¤­` char(1)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TABLE IF NOT EXISTS `íÝíÝíÝ`(`°¡°¡°¡` char(1)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TABLE IF NOT EXISTS `íÞíÞíÞ`(`°¢°¢°¢` char(1)) DEFAULT CHARSET = ucs2 engine=HEAP; +# Tables should be created +CREATE TABLE IF NOT EXISTS `޳޳޳`(`ޏޏޏ` char(1)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TABLE IF NOT EXISTS `¤¦¤¦¤¦`(`¤¯¤¯¤¯` char(1)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TABLE IF NOT EXISTS `íßíßíß`(`°£°£°£`char(1)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TEMPORARY TABLE `Ž´Ž´Ž´`(`޹޹޹` char(1)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TEMPORARY TABLE `޵޵޵`(`ŽºŽºŽº` char(1)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TEMPORARY TABLE `¤¨¤¨¤¨`(`¤±¤±¤±` char(1)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TEMPORARY TABLE `¤ª¤ª¤ª`(`¤³¤³¤³` char(1)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TEMPORARY TABLE `íàíàíà`(`°¤°¤°¤` char(1)) DEFAULT CHARSET = ucs2 engine=HEAP; +CREATE TEMPORARY TABLE `íáíáíá`(`°¥°¥°¥` char(1)) DEFAULT CHARSET = ucs2 engine=HEAP; + +DESC `ޱޱޱ`; +DESC `޲޲޲`; +DESC `޳޳޳`; +DESC `Ž´Ž´Ž´`; +DESC `޵޵޵`; +DESC `¤¢¤¢¤¢`; +DESC `¤¤¤¤¤¤`; +DESC `¤¦¤¦¤¦`; +DESC `¤¨¤¨¤¨`; +DESC `¤ª¤ª¤ª`; +DESC `íÝíÝíÝ`; +DESC `íÞíÞíÞ`; +DESC `íßíßíß`; +DESC `íàíàíà`; +DESC `íáíáíá`; + +SHOW CREATE TABLE `ޱޱޱ`; +SHOW CREATE TABLE `޲޲޲`; +SHOW CREATE TABLE `޳޳޳`; +SHOW CREATE TABLE `Ž´Ž´Ž´`; +SHOW CREATE TABLE `޵޵޵`; +SHOW CREATE TABLE `¤¢¤¢¤¢`; +SHOW CREATE TABLE `¤¤¤¤¤¤`; +SHOW CREATE TABLE `¤¦¤¦¤¦`; +SHOW CREATE TABLE `¤¨¤¨¤¨`; +SHOW CREATE TABLE `¤ª¤ª¤ª`; +SHOW CREATE TABLE `íÝíÝíÝ`; +SHOW CREATE TABLE `íÞíÞíÞ`; +SHOW CREATE TABLE `íßíßíß`; +SHOW CREATE TABLE `íàíàíà`; +SHOW CREATE TABLE `íáíáíá`; + +DROP TABLE `ޱޱޱ`; +DROP TABLE `޲޲޲`; +DROP TABLE `޳޳޳`; +DROP TABLE `Ž´Ž´Ž´`; +DROP TABLE `޵޵޵`; +DROP TABLE `¤¢¤¢¤¢`; +DROP TABLE `¤¤¤¤¤¤`; +DROP TABLE `¤¦¤¦¤¦`; +DROP TABLE `¤¨¤¨¤¨`; +DROP TABLE `¤ª¤ª¤ª`; +DROP TABLE `íÝíÝíÝ`; +DROP TABLE `íÞíÞíÞ`; +DROP TABLE `íßíßíß`; +DROP TABLE `íàíàíà`; +DROP TABLE `íáíáíá`; + +CREATE TABLE `ޱޱޱ`(`޶޶޶` char(1)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TABLE `޲޲޲`(`Ž·Ž·Ž·` char(1)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TABLE `¤¢¤¢¤¢`(`¤«¤«¤«` char(1)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TABLE `¤¤¤¤¤¤`(`¤­¤­¤­` char(1)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TABLE `íÝíÝíÝ`(`°¡°¡°¡` char(1)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TABLE `íÞíÞíÞ`(`°¢°¢°¢` char(1)) DEFAULT CHARSET = ucs2 engine=BDB; +# Tables should not be created because table names exist +CREATE TABLE IF NOT EXISTS `ޱޱޱ`(`޶޶޶` char(1)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TABLE IF NOT EXISTS `޲޲޲`(`Ž·Ž·Ž·` char(1)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TABLE IF NOT EXISTS `¤¢¤¢¤¢`(`¤«¤«¤«` char(1)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TABLE IF NOT EXISTS `¤¤¤¤¤¤`(`¤­¤­¤­` char(1)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TABLE IF NOT EXISTS `íÝíÝíÝ`(`°¡°¡°¡` char(1)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TABLE IF NOT EXISTS `íÞíÞíÞ`(`°¢°¢°¢` char(1)) DEFAULT CHARSET = ucs2 engine=BDB; +# Tables should be created +CREATE TABLE IF NOT EXISTS `޳޳޳`(`ޏޏޏ` char(1)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TABLE IF NOT EXISTS `¤¦¤¦¤¦`(`¤¯¤¯¤¯` char(1)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TABLE IF NOT EXISTS `íßíßíß`(`°£°£°£`char(1)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TEMPORARY TABLE `Ž´Ž´Ž´`(`޹޹޹` char(1)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TEMPORARY TABLE `޵޵޵`(`ŽºŽºŽº` char(1)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TEMPORARY TABLE `¤¨¤¨¤¨`(`¤±¤±¤±` char(1)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TEMPORARY TABLE `¤ª¤ª¤ª`(`¤³¤³¤³` char(1)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TEMPORARY TABLE `íàíàíà`(`°¤°¤°¤` char(1)) DEFAULT CHARSET = ucs2 engine=BDB; +CREATE TEMPORARY TABLE `íáíáíá`(`°¥°¥°¥` char(1)) DEFAULT CHARSET = ucs2 engine=BDB; + +DESC `ޱޱޱ`; +DESC `޲޲޲`; +DESC `޳޳޳`; +DESC `Ž´Ž´Ž´`; +DESC `޵޵޵`; +DESC `¤¢¤¢¤¢`; +DESC `¤¤¤¤¤¤`; +DESC `¤¦¤¦¤¦`; +DESC `¤¨¤¨¤¨`; +DESC `¤ª¤ª¤ª`; +DESC `íÝíÝíÝ`; +DESC `íÞíÞíÞ`; +DESC `íßíßíß`; +DESC `íàíàíà`; +DESC `íáíáíá`; + +SHOW CREATE TABLE `ޱޱޱ`; +SHOW CREATE TABLE `޲޲޲`; +SHOW CREATE TABLE `޳޳޳`; +SHOW CREATE TABLE `Ž´Ž´Ž´`; +SHOW CREATE TABLE `޵޵޵`; +SHOW CREATE TABLE `¤¢¤¢¤¢`; +SHOW CREATE TABLE `¤¤¤¤¤¤`; +SHOW CREATE TABLE `¤¦¤¦¤¦`; +SHOW CREATE TABLE `¤¨¤¨¤¨`; +SHOW CREATE TABLE `¤ª¤ª¤ª`; +SHOW CREATE TABLE `íÝíÝíÝ`; +SHOW CREATE TABLE `íÞíÞíÞ`; +SHOW CREATE TABLE `íßíßíß`; +SHOW CREATE TABLE `íàíàíà`; +SHOW CREATE TABLE `íáíáíá`; + +DROP TABLE `ޱޱޱ`; +DROP TABLE `޲޲޲`; +DROP TABLE `޳޳޳`; +DROP TABLE `Ž´Ž´Ž´`; +DROP TABLE `޵޵޵`; +DROP TABLE `¤¢¤¢¤¢`; +DROP TABLE `¤¤¤¤¤¤`; +DROP TABLE `¤¦¤¦¤¦`; +DROP TABLE `¤¨¤¨¤¨`; +DROP TABLE `¤ª¤ª¤ª`; +DROP TABLE `íÝíÝíÝ`; +DROP TABLE `íÞíÞíÞ`; +DROP TABLE `íßíßíß`; +DROP TABLE `íàíàíà`; +DROP TABLE `íáíáíá`; diff --git a/mysql-test/suite/jp/t/jp_create_tbl_ujis.test b/mysql-test/suite/jp/t/jp_create_tbl_ujis.test new file mode 100755 index 00000000000..ac70facdce9 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_create_tbl_ujis.test @@ -0,0 +1,314 @@ +--source include/have_ujis.inc + +--disable_warnings +DROP TABLE IF EXISTS `ޱޱޱ`; +DROP TABLE IF EXISTS `޲޲޲`; +DROP TABLE IF EXISTS `޳޳޳`; +DROP TABLE IF EXISTS `Ž´Ž´Ž´`; +DROP TABLE IF EXISTS `޵޵޵`; +DROP TABLE IF EXISTS `¤¢¤¢¤¢`; +DROP TABLE IF EXISTS `¤¤¤¤¤¤`; +DROP TABLE IF EXISTS `¤¦¤¦¤¦`; +DROP TABLE IF EXISTS `¤¨¤¨¤¨`; +DROP TABLE IF EXISTS `¤ª¤ª¤ª`; +DROP TABLE IF EXISTS `íÝíÝíÝ`; +DROP TABLE IF EXISTS `íÞíÞíÞ`; +DROP TABLE IF EXISTS `íßíßíß`; +DROP TABLE IF EXISTS `íàíàíà`; +DROP TABLE IF EXISTS `íáíáíá`; +--enable_warnings + +# +# Test creating table with Japanese characters in ujis encoding +# + +SET NAMES ujis; +SET character_set_database = ujis; + +CREATE TABLE `ޱޱޱ`(`޶޶޶` char(1)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TABLE `޲޲޲`(`Ž·Ž·Ž·` char(1)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TABLE `¤¢¤¢¤¢`(`¤«¤«¤«` char(1)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TABLE `¤¤¤¤¤¤`(`¤­¤­¤­` char(1)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TABLE `íÝíÝíÝ`(`°¡°¡°¡` char(1)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TABLE `íÞíÞíÞ`(`°¢°¢°¢` char(1)) DEFAULT CHARSET = ujis engine=INNODB; +# Tables should not be created because table names exist +CREATE TABLE IF NOT EXISTS `ޱޱޱ`(`޶޶޶` char(1)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TABLE IF NOT EXISTS `޲޲޲`(`Ž·Ž·Ž·` char(1)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TABLE IF NOT EXISTS `¤¢¤¢¤¢`(`¤«¤«¤«` char(1)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TABLE IF NOT EXISTS `¤¤¤¤¤¤`(`¤­¤­¤­` char(1)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TABLE IF NOT EXISTS `íÝíÝíÝ`(`°¡°¡°¡` char(1)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TABLE IF NOT EXISTS `íÞíÞíÞ`(`°¢°¢°¢` char(1)) DEFAULT CHARSET = ujis engine=INNODB; +# Tables should be created +CREATE TABLE IF NOT EXISTS `޳޳޳`(`ޏޏޏ` char(1)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TABLE IF NOT EXISTS `¤¦¤¦¤¦`(`¤¯¤¯¤¯` char(1)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TABLE IF NOT EXISTS `íßíßíß`(`°£°£°£`char(1)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TEMPORARY TABLE `Ž´Ž´Ž´`(`޹޹޹` char(1)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TEMPORARY TABLE `޵޵޵`(`ŽºŽºŽº` char(1)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TEMPORARY TABLE `¤¨¤¨¤¨`(`¤±¤±¤±` char(1)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TEMPORARY TABLE `¤ª¤ª¤ª`(`¤³¤³¤³` char(1)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TEMPORARY TABLE `íàíàíà`(`°¤°¤°¤` char(1)) DEFAULT CHARSET = ujis engine=INNODB; +CREATE TEMPORARY TABLE `íáíáíá`(`°¥°¥°¥` char(1)) DEFAULT CHARSET = ujis engine=INNODB; + +DESC `ޱޱޱ`; +DESC `޲޲޲`; +DESC `޳޳޳`; +DESC `Ž´Ž´Ž´`; +DESC `޵޵޵`; +DESC `¤¢¤¢¤¢`; +DESC `¤¤¤¤¤¤`; +DESC `¤¦¤¦¤¦`; +DESC `¤¨¤¨¤¨`; +DESC `¤ª¤ª¤ª`; +DESC `íÝíÝíÝ`; +DESC `íÞíÞíÞ`; +DESC `íßíßíß`; +DESC `íàíàíà`; +DESC `íáíáíá`; + +SHOW CREATE TABLE `ޱޱޱ`; +SHOW CREATE TABLE `޲޲޲`; +SHOW CREATE TABLE `޳޳޳`; +SHOW CREATE TABLE `Ž´Ž´Ž´`; +SHOW CREATE TABLE `޵޵޵`; +SHOW CREATE TABLE `¤¢¤¢¤¢`; +SHOW CREATE TABLE `¤¤¤¤¤¤`; +SHOW CREATE TABLE `¤¦¤¦¤¦`; +SHOW CREATE TABLE `¤¨¤¨¤¨`; +SHOW CREATE TABLE `¤ª¤ª¤ª`; +SHOW CREATE TABLE `íÝíÝíÝ`; +SHOW CREATE TABLE `íÞíÞíÞ`; +SHOW CREATE TABLE `íßíßíß`; +SHOW CREATE TABLE `íàíàíà`; +SHOW CREATE TABLE `íáíáíá`; + +DROP TABLE `ޱޱޱ`; +DROP TABLE `޲޲޲`; +DROP TABLE `޳޳޳`; +DROP TABLE `Ž´Ž´Ž´`; +DROP TABLE `޵޵޵`; +DROP TABLE `¤¢¤¢¤¢`; +DROP TABLE `¤¤¤¤¤¤`; +DROP TABLE `¤¦¤¦¤¦`; +DROP TABLE `¤¨¤¨¤¨`; +DROP TABLE `¤ª¤ª¤ª`; +DROP TABLE `íÝíÝíÝ`; +DROP TABLE `íÞíÞíÞ`; +DROP TABLE `íßíßíß`; +DROP TABLE `íàíàíà`; +DROP TABLE `íáíáíá`; + +CREATE TABLE `ޱޱޱ`(`޶޶޶` char(1)) DEFAULT CHARSET = ujis engine=MyISAM; +CREATE TABLE `޲޲޲`(`Ž·Ž·Ž·` char(1)) DEFAULT CHARSET = ujis engine=MyISAM; +CREATE TABLE `¤¢¤¢¤¢`(`¤«¤«¤«` char(1)) DEFAULT CHARSET = ujis engine=MyISAM; +CREATE TABLE `¤¤¤¤¤¤`(`¤­¤­¤­` char(1)) DEFAULT CHARSET = ujis engine=MyISAM; +CREATE TABLE `íÝíÝíÝ`(`°¡°¡°¡` char(1)) DEFAULT CHARSET = ujis engine=MyISAM; +CREATE TABLE `íÞíÞíÞ`(`°¢°¢°¢` char(1)) DEFAULT CHARSET = ujis engine=MyISAM; +# Tables should not be created because table names exist +CREATE TABLE IF NOT EXISTS `ޱޱޱ`(`޶޶޶` char(1)) DEFAULT CHARSET = ujis engine=MyISAM; +CREATE TABLE IF NOT EXISTS `޲޲޲`(`Ž·Ž·Ž·` char(1)) DEFAULT CHARSET = ujis engine=MyISAM; +CREATE TABLE IF NOT EXISTS `¤¢¤¢¤¢`(`¤«¤«¤«` char(1)) DEFAULT CHARSET = ujis engine=MyISAM; +CREATE TABLE IF NOT EXISTS `¤¤¤¤¤¤`(`¤­¤­¤­` char(1)) DEFAULT CHARSET = ujis engine=MyISAM; +CREATE TABLE IF NOT EXISTS `íÝíÝíÝ`(`°¡°¡°¡` char(1)) DEFAULT CHARSET = ujis engine=MyISAM; +CREATE TABLE IF NOT EXISTS `íÞíÞíÞ`(`°¢°¢°¢` char(1)) DEFAULT CHARSET = ujis engine=MyISAM; +# Tables should be created +CREATE TABLE IF NOT EXISTS `޳޳޳`(`ޏޏޏ` char(1)) DEFAULT CHARSET = ujis engine=MyISAM; +CREATE TABLE IF NOT EXISTS `¤¦¤¦¤¦`(`¤¯¤¯¤¯` char(1)) DEFAULT CHARSET = ujis engine=MyISAM; +CREATE TABLE IF NOT EXISTS `íßíßíß`(`°£°£°£`char(1)) DEFAULT CHARSET = ujis engine=MyISAM; +CREATE TEMPORARY TABLE `Ž´Ž´Ž´`(`޹޹޹` char(1)) DEFAULT CHARSET = ujis engine=MyISAM; +CREATE TEMPORARY TABLE `޵޵޵`(`ŽºŽºŽº` char(1)) DEFAULT CHARSET = ujis engine=MyISAM; +CREATE TEMPORARY TABLE `¤¨¤¨¤¨`(`¤±¤±¤±` char(1)) DEFAULT CHARSET = ujis engine=MyISAM; +CREATE TEMPORARY TABLE `¤ª¤ª¤ª`(`¤³¤³¤³` char(1)) DEFAULT CHARSET = ujis engine=MyISAM; +CREATE TEMPORARY TABLE `íàíàíà`(`°¤°¤°¤` char(1)) DEFAULT CHARSET = ujis engine=MyISAM; +CREATE TEMPORARY TABLE `íáíáíá`(`°¥°¥°¥` char(1)) DEFAULT CHARSET = ujis engine=MyISAM; + +DESC `ޱޱޱ`; +DESC `޲޲޲`; +DESC `޳޳޳`; +DESC `Ž´Ž´Ž´`; +DESC `޵޵޵`; +DESC `¤¢¤¢¤¢`; +DESC `¤¤¤¤¤¤`; +DESC `¤¦¤¦¤¦`; +DESC `¤¨¤¨¤¨`; +DESC `¤ª¤ª¤ª`; +DESC `íÝíÝíÝ`; +DESC `íÞíÞíÞ`; +DESC `íßíßíß`; +DESC `íàíàíà`; +DESC `íáíáíá`; + +SHOW CREATE TABLE `ޱޱޱ`; +SHOW CREATE TABLE `޲޲޲`; +SHOW CREATE TABLE `޳޳޳`; +SHOW CREATE TABLE `Ž´Ž´Ž´`; +SHOW CREATE TABLE `޵޵޵`; +SHOW CREATE TABLE `¤¢¤¢¤¢`; +SHOW CREATE TABLE `¤¤¤¤¤¤`; +SHOW CREATE TABLE `¤¦¤¦¤¦`; +SHOW CREATE TABLE `¤¨¤¨¤¨`; +SHOW CREATE TABLE `¤ª¤ª¤ª`; +SHOW CREATE TABLE `íÝíÝíÝ`; +SHOW CREATE TABLE `íÞíÞíÞ`; +SHOW CREATE TABLE `íßíßíß`; +SHOW CREATE TABLE `íàíàíà`; +SHOW CREATE TABLE `íáíáíá`; + +DROP TABLE `ޱޱޱ`; +DROP TABLE `޲޲޲`; +DROP TABLE `޳޳޳`; +DROP TABLE `Ž´Ž´Ž´`; +DROP TABLE `޵޵޵`; +DROP TABLE `¤¢¤¢¤¢`; +DROP TABLE `¤¤¤¤¤¤`; +DROP TABLE `¤¦¤¦¤¦`; +DROP TABLE `¤¨¤¨¤¨`; +DROP TABLE `¤ª¤ª¤ª`; +DROP TABLE `íÝíÝíÝ`; +DROP TABLE `íÞíÞíÞ`; +DROP TABLE `íßíßíß`; +DROP TABLE `íàíàíà`; +DROP TABLE `íáíáíá`; + +CREATE TABLE `ޱޱޱ`(`޶޶޶` char(1)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TABLE `޲޲޲`(`Ž·Ž·Ž·` char(1)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TABLE `¤¢¤¢¤¢`(`¤«¤«¤«` char(1)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TABLE `¤¤¤¤¤¤`(`¤­¤­¤­` char(1)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TABLE `íÝíÝíÝ`(`°¡°¡°¡` char(1)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TABLE `íÞíÞíÞ`(`°¢°¢°¢` char(1)) DEFAULT CHARSET = ujis engine=HEAP; +# Tables should not be created because table names exist +CREATE TABLE IF NOT EXISTS `ޱޱޱ`(`޶޶޶` char(1)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TABLE IF NOT EXISTS `޲޲޲`(`Ž·Ž·Ž·` char(1)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TABLE IF NOT EXISTS `¤¢¤¢¤¢`(`¤«¤«¤«` char(1)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TABLE IF NOT EXISTS `¤¤¤¤¤¤`(`¤­¤­¤­` char(1)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TABLE IF NOT EXISTS `íÝíÝíÝ`(`°¡°¡°¡` char(1)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TABLE IF NOT EXISTS `íÞíÞíÞ`(`°¢°¢°¢` char(1)) DEFAULT CHARSET = ujis engine=HEAP; +# Tables should be created +CREATE TABLE IF NOT EXISTS `޳޳޳`(`ޏޏޏ` char(1)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TABLE IF NOT EXISTS `¤¦¤¦¤¦`(`¤¯¤¯¤¯` char(1)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TABLE IF NOT EXISTS `íßíßíß`(`°£°£°£`char(1)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TEMPORARY TABLE `Ž´Ž´Ž´`(`޹޹޹` char(1)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TEMPORARY TABLE `޵޵޵`(`ŽºŽºŽº` char(1)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TEMPORARY TABLE `¤¨¤¨¤¨`(`¤±¤±¤±` char(1)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TEMPORARY TABLE `¤ª¤ª¤ª`(`¤³¤³¤³` char(1)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TEMPORARY TABLE `íàíàíà`(`°¤°¤°¤` char(1)) DEFAULT CHARSET = ujis engine=HEAP; +CREATE TEMPORARY TABLE `íáíáíá`(`°¥°¥°¥` char(1)) DEFAULT CHARSET = ujis engine=HEAP; + +DESC `ޱޱޱ`; +DESC `޲޲޲`; +DESC `޳޳޳`; +DESC `Ž´Ž´Ž´`; +DESC `޵޵޵`; +DESC `¤¢¤¢¤¢`; +DESC `¤¤¤¤¤¤`; +DESC `¤¦¤¦¤¦`; +DESC `¤¨¤¨¤¨`; +DESC `¤ª¤ª¤ª`; +DESC `íÝíÝíÝ`; +DESC `íÞíÞíÞ`; +DESC `íßíßíß`; +DESC `íàíàíà`; +DESC `íáíáíá`; + +SHOW CREATE TABLE `ޱޱޱ`; +SHOW CREATE TABLE `޲޲޲`; +SHOW CREATE TABLE `޳޳޳`; +SHOW CREATE TABLE `Ž´Ž´Ž´`; +SHOW CREATE TABLE `޵޵޵`; +SHOW CREATE TABLE `¤¢¤¢¤¢`; +SHOW CREATE TABLE `¤¤¤¤¤¤`; +SHOW CREATE TABLE `¤¦¤¦¤¦`; +SHOW CREATE TABLE `¤¨¤¨¤¨`; +SHOW CREATE TABLE `¤ª¤ª¤ª`; +SHOW CREATE TABLE `íÝíÝíÝ`; +SHOW CREATE TABLE `íÞíÞíÞ`; +SHOW CREATE TABLE `íßíßíß`; +SHOW CREATE TABLE `íàíàíà`; +SHOW CREATE TABLE `íáíáíá`; + +DROP TABLE `ޱޱޱ`; +DROP TABLE `޲޲޲`; +DROP TABLE `޳޳޳`; +DROP TABLE `Ž´Ž´Ž´`; +DROP TABLE `޵޵޵`; +DROP TABLE `¤¢¤¢¤¢`; +DROP TABLE `¤¤¤¤¤¤`; +DROP TABLE `¤¦¤¦¤¦`; +DROP TABLE `¤¨¤¨¤¨`; +DROP TABLE `¤ª¤ª¤ª`; +DROP TABLE `íÝíÝíÝ`; +DROP TABLE `íÞíÞíÞ`; +DROP TABLE `íßíßíß`; +DROP TABLE `íàíàíà`; +DROP TABLE `íáíáíá`; + +CREATE TABLE `ޱޱޱ`(`޶޶޶` char(1)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TABLE `޲޲޲`(`Ž·Ž·Ž·` char(1)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TABLE `¤¢¤¢¤¢`(`¤«¤«¤«` char(1)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TABLE `¤¤¤¤¤¤`(`¤­¤­¤­` char(1)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TABLE `íÝíÝíÝ`(`°¡°¡°¡` char(1)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TABLE `íÞíÞíÞ`(`°¢°¢°¢` char(1)) DEFAULT CHARSET = ujis engine=BDB; +# Tables should not be created because table names exist +CREATE TABLE IF NOT EXISTS `ޱޱޱ`(`޶޶޶` char(1)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TABLE IF NOT EXISTS `޲޲޲`(`Ž·Ž·Ž·` char(1)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TABLE IF NOT EXISTS `¤¢¤¢¤¢`(`¤«¤«¤«` char(1)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TABLE IF NOT EXISTS `¤¤¤¤¤¤`(`¤­¤­¤­` char(1)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TABLE IF NOT EXISTS `íÝíÝíÝ`(`°¡°¡°¡` char(1)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TABLE IF NOT EXISTS `íÞíÞíÞ`(`°¢°¢°¢` char(1)) DEFAULT CHARSET = ujis engine=BDB; +# Tables should be created +CREATE TABLE IF NOT EXISTS `޳޳޳`(`ޏޏޏ` char(1)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TABLE IF NOT EXISTS `¤¦¤¦¤¦`(`¤¯¤¯¤¯` char(1)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TABLE IF NOT EXISTS `íßíßíß`(`°£°£°£`char(1)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TEMPORARY TABLE `Ž´Ž´Ž´`(`޹޹޹` char(1)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TEMPORARY TABLE `޵޵޵`(`ŽºŽºŽº` char(1)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TEMPORARY TABLE `¤¨¤¨¤¨`(`¤±¤±¤±` char(1)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TEMPORARY TABLE `¤ª¤ª¤ª`(`¤³¤³¤³` char(1)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TEMPORARY TABLE `íàíàíà`(`°¤°¤°¤` char(1)) DEFAULT CHARSET = ujis engine=BDB; +CREATE TEMPORARY TABLE `íáíáíá`(`°¥°¥°¥` char(1)) DEFAULT CHARSET = ujis engine=BDB; + +DESC `ޱޱޱ`; +DESC `޲޲޲`; +DESC `޳޳޳`; +DESC `Ž´Ž´Ž´`; +DESC `޵޵޵`; +DESC `¤¢¤¢¤¢`; +DESC `¤¤¤¤¤¤`; +DESC `¤¦¤¦¤¦`; +DESC `¤¨¤¨¤¨`; +DESC `¤ª¤ª¤ª`; +DESC `íÝíÝíÝ`; +DESC `íÞíÞíÞ`; +DESC `íßíßíß`; +DESC `íàíàíà`; +DESC `íáíáíá`; + +SHOW CREATE TABLE `ޱޱޱ`; +SHOW CREATE TABLE `޲޲޲`; +SHOW CREATE TABLE `޳޳޳`; +SHOW CREATE TABLE `Ž´Ž´Ž´`; +SHOW CREATE TABLE `޵޵޵`; +SHOW CREATE TABLE `¤¢¤¢¤¢`; +SHOW CREATE TABLE `¤¤¤¤¤¤`; +SHOW CREATE TABLE `¤¦¤¦¤¦`; +SHOW CREATE TABLE `¤¨¤¨¤¨`; +SHOW CREATE TABLE `¤ª¤ª¤ª`; +SHOW CREATE TABLE `íÝíÝíÝ`; +SHOW CREATE TABLE `íÞíÞíÞ`; +SHOW CREATE TABLE `íßíßíß`; +SHOW CREATE TABLE `íàíàíà`; +SHOW CREATE TABLE `íáíáíá`; + +DROP TABLE `ޱޱޱ`; +DROP TABLE `޲޲޲`; +DROP TABLE `޳޳޳`; +DROP TABLE `Ž´Ž´Ž´`; +DROP TABLE `޵޵޵`; +DROP TABLE `¤¢¤¢¤¢`; +DROP TABLE `¤¤¤¤¤¤`; +DROP TABLE `¤¦¤¦¤¦`; +DROP TABLE `¤¨¤¨¤¨`; +DROP TABLE `¤ª¤ª¤ª`; +DROP TABLE `íÝíÝíÝ`; +DROP TABLE `íÞíÞíÞ`; +DROP TABLE `íßíßíß`; +DROP TABLE `íàíàíà`; +DROP TABLE `íáíáíá`; diff --git a/mysql-test/suite/jp/t/jp_create_tbl_utf8.test b/mysql-test/suite/jp/t/jp_create_tbl_utf8.test new file mode 100755 index 00000000000..5c816eb169a --- /dev/null +++ b/mysql-test/suite/jp/t/jp_create_tbl_utf8.test @@ -0,0 +1,312 @@ +--disable_warnings +DROP TABLE IF EXISTS `アアア`; +DROP TABLE IF EXISTS `イイイ`; +DROP TABLE IF EXISTS `ウウウ`; +DROP TABLE IF EXISTS `ï½´ï½´ï½´`; +DROP TABLE IF EXISTS `オオオ`; +DROP TABLE IF EXISTS `ã‚ã‚ã‚`; +DROP TABLE IF EXISTS `ã„ã„ã„`; +DROP TABLE IF EXISTS `ã†ã†ã†`; +DROP TABLE IF EXISTS `ãˆãˆãˆ`; +DROP TABLE IF EXISTS `ãŠãŠãŠ`; +DROP TABLE IF EXISTS `é¾–é¾–é¾–`; +DROP TABLE IF EXISTS `é¾—é¾—é¾—`; +DROP TABLE IF EXISTS `龞龞龞`; +DROP TABLE IF EXISTS `龡龡龡`; +DROP TABLE IF EXISTS `龢龢龢`; +--enable_warnings + +# +# Test creating table with Japanese characters in utf8 encoding +# + +SET NAMES utf8; +SET character_set_database = utf8; + +CREATE TABLE `アアア`(`ï½¶ï½¶ï½¶` char(1)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TABLE `イイイ`(`ï½·ï½·ï½·` char(1)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TABLE `ã‚ã‚ã‚`(`ã‹ã‹ã‹` char(1)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TABLE `ã„ã„ã„`(`ããã` char(1)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TABLE `é¾–é¾–é¾–`(`丂丂丂` char(1)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TABLE `é¾—é¾—é¾—`(`丄丄丄` char(1)) DEFAULT CHARSET = utf8 engine=INNODB; +# Tables should not be created because table names exist +CREATE TABLE IF NOT EXISTS `アアア`(`ï½¶ï½¶ï½¶` char(1)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TABLE IF NOT EXISTS `イイイ`(`ï½·ï½·ï½·` char(1)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TABLE IF NOT EXISTS `ã‚ã‚ã‚`(`ã‹ã‹ã‹` char(1)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TABLE IF NOT EXISTS `ã„ã„ã„`(`ããã` char(1)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TABLE IF NOT EXISTS `é¾–é¾–é¾–`(`丂丂丂` char(1)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TABLE IF NOT EXISTS `é¾—é¾—é¾—`(`丄丄丄` char(1)) DEFAULT CHARSET = utf8 engine=INNODB; +# Tables should be created +CREATE TABLE IF NOT EXISTS `ウウウ`(`ククク` char(1)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TABLE IF NOT EXISTS `ã†ã†ã†`(`ããã` char(1)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TABLE IF NOT EXISTS `龞龞龞`(`丅丅丅`char(1)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TEMPORARY TABLE `ï½´ï½´ï½´`(`ケケケ` char(1)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TEMPORARY TABLE `オオオ`(`コココ` char(1)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TEMPORARY TABLE `ãˆãˆãˆ`(`ã‘ã‘ã‘` char(1)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TEMPORARY TABLE `ãŠãŠãŠ`(`ã“ã“ã“` char(1)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TEMPORARY TABLE `龡龡龡`(`丌丌丌` char(1)) DEFAULT CHARSET = utf8 engine=INNODB; +CREATE TEMPORARY TABLE `龢龢龢`(`丒丒丒` char(1)) DEFAULT CHARSET = utf8 engine=INNODB; + +DESC `アアア`; +DESC `イイイ`; +DESC `ウウウ`; +DESC `ï½´ï½´ï½´`; +DESC `オオオ`; +DESC `ã‚ã‚ã‚`; +DESC `ã„ã„ã„`; +DESC `ã†ã†ã†`; +DESC `ãˆãˆãˆ`; +DESC `ãŠãŠãŠ`; +DESC `é¾–é¾–é¾–`; +DESC `é¾—é¾—é¾—`; +DESC `龞龞龞`; +DESC `龡龡龡`; +DESC `龢龢龢`; + +SHOW CREATE TABLE `アアア`; +SHOW CREATE TABLE `イイイ`; +SHOW CREATE TABLE `ウウウ`; +SHOW CREATE TABLE `ï½´ï½´ï½´`; +SHOW CREATE TABLE `オオオ`; +SHOW CREATE TABLE `ã‚ã‚ã‚`; +SHOW CREATE TABLE `ã„ã„ã„`; +SHOW CREATE TABLE `ã†ã†ã†`; +SHOW CREATE TABLE `ãˆãˆãˆ`; +SHOW CREATE TABLE `ãŠãŠãŠ`; +SHOW CREATE TABLE `é¾–é¾–é¾–`; +SHOW CREATE TABLE `é¾—é¾—é¾—`; +SHOW CREATE TABLE `龞龞龞`; +SHOW CREATE TABLE `龡龡龡`; +SHOW CREATE TABLE `龢龢龢`; + +DROP TABLE `アアア`; +DROP TABLE `イイイ`; +DROP TABLE `ウウウ`; +DROP TABLE `ï½´ï½´ï½´`; +DROP TABLE `オオオ`; +DROP TABLE `ã‚ã‚ã‚`; +DROP TABLE `ã„ã„ã„`; +DROP TABLE `ã†ã†ã†`; +DROP TABLE `ãˆãˆãˆ`; +DROP TABLE `ãŠãŠãŠ`; +DROP TABLE `é¾–é¾–é¾–`; +DROP TABLE `é¾—é¾—é¾—`; +DROP TABLE `龞龞龞`; +DROP TABLE `龡龡龡`; +DROP TABLE `龢龢龢`; + +CREATE TABLE `アアア`(`ï½¶ï½¶ï½¶` char(1)) DEFAULT CHARSET = utf8 engine=MyISAM; +CREATE TABLE `イイイ`(`ï½·ï½·ï½·` char(1)) DEFAULT CHARSET = utf8 engine=MyISAM; +CREATE TABLE `ã‚ã‚ã‚`(`ã‹ã‹ã‹` char(1)) DEFAULT CHARSET = utf8 engine=MyISAM; +CREATE TABLE `ã„ã„ã„`(`ããã` char(1)) DEFAULT CHARSET = utf8 engine=MyISAM; +CREATE TABLE `é¾–é¾–é¾–`(`丂丂丂` char(1)) DEFAULT CHARSET = utf8 engine=MyISAM; +CREATE TABLE `é¾—é¾—é¾—`(`丄丄丄` char(1)) DEFAULT CHARSET = utf8 engine=MyISAM; +# Tables should not be created because table names exist +CREATE TABLE IF NOT EXISTS `アアア`(`ï½¶ï½¶ï½¶` char(1)) DEFAULT CHARSET = utf8 engine=MyISAM; +CREATE TABLE IF NOT EXISTS `イイイ`(`ï½·ï½·ï½·` char(1)) DEFAULT CHARSET = utf8 engine=MyISAM; +CREATE TABLE IF NOT EXISTS `ã‚ã‚ã‚`(`ã‹ã‹ã‹` char(1)) DEFAULT CHARSET = utf8 engine=MyISAM; +CREATE TABLE IF NOT EXISTS `ã„ã„ã„`(`ããã` char(1)) DEFAULT CHARSET = utf8 engine=MyISAM; +CREATE TABLE IF NOT EXISTS `é¾–é¾–é¾–`(`丂丂丂` char(1)) DEFAULT CHARSET = utf8 engine=MyISAM; +CREATE TABLE IF NOT EXISTS `é¾—é¾—é¾—`(`丄丄丄` char(1)) DEFAULT CHARSET = utf8 engine=MyISAM; +# Tables should be created +CREATE TABLE IF NOT EXISTS `ウウウ`(`ククク` char(1)) DEFAULT CHARSET = utf8 engine=MyISAM; +CREATE TABLE IF NOT EXISTS `ã†ã†ã†`(`ããã` char(1)) DEFAULT CHARSET = utf8 engine=MyISAM; +CREATE TABLE IF NOT EXISTS `龞龞龞`(`丅丅丅`char(1)) DEFAULT CHARSET = utf8 engine=MyISAM; +CREATE TEMPORARY TABLE `ï½´ï½´ï½´`(`ケケケ` char(1)) DEFAULT CHARSET = utf8 engine=MyISAM; +CREATE TEMPORARY TABLE `オオオ`(`コココ` char(1)) DEFAULT CHARSET = utf8 engine=MyISAM; +CREATE TEMPORARY TABLE `ãˆãˆãˆ`(`ã‘ã‘ã‘` char(1)) DEFAULT CHARSET = utf8 engine=MyISAM; +CREATE TEMPORARY TABLE `ãŠãŠãŠ`(`ã“ã“ã“` char(1)) DEFAULT CHARSET = utf8 engine=MyISAM; +CREATE TEMPORARY TABLE `龡龡龡`(`丌丌丌` char(1)) DEFAULT CHARSET = utf8 engine=MyISAM; +CREATE TEMPORARY TABLE `龢龢龢`(`丒丒丒` char(1)) DEFAULT CHARSET = utf8 engine=MyISAM; + +DESC `アアア`; +DESC `イイイ`; +DESC `ウウウ`; +DESC `ï½´ï½´ï½´`; +DESC `オオオ`; +DESC `ã‚ã‚ã‚`; +DESC `ã„ã„ã„`; +DESC `ã†ã†ã†`; +DESC `ãˆãˆãˆ`; +DESC `ãŠãŠãŠ`; +DESC `é¾–é¾–é¾–`; +DESC `é¾—é¾—é¾—`; +DESC `龞龞龞`; +DESC `龡龡龡`; +DESC `龢龢龢`; + +SHOW CREATE TABLE `アアア`; +SHOW CREATE TABLE `イイイ`; +SHOW CREATE TABLE `ウウウ`; +SHOW CREATE TABLE `ï½´ï½´ï½´`; +SHOW CREATE TABLE `オオオ`; +SHOW CREATE TABLE `ã‚ã‚ã‚`; +SHOW CREATE TABLE `ã„ã„ã„`; +SHOW CREATE TABLE `ã†ã†ã†`; +SHOW CREATE TABLE `ãˆãˆãˆ`; +SHOW CREATE TABLE `ãŠãŠãŠ`; +SHOW CREATE TABLE `é¾–é¾–é¾–`; +SHOW CREATE TABLE `é¾—é¾—é¾—`; +SHOW CREATE TABLE `龞龞龞`; +SHOW CREATE TABLE `龡龡龡`; +SHOW CREATE TABLE `龢龢龢`; + +DROP TABLE `アアア`; +DROP TABLE `イイイ`; +DROP TABLE `ウウウ`; +DROP TABLE `ï½´ï½´ï½´`; +DROP TABLE `オオオ`; +DROP TABLE `ã‚ã‚ã‚`; +DROP TABLE `ã„ã„ã„`; +DROP TABLE `ã†ã†ã†`; +DROP TABLE `ãˆãˆãˆ`; +DROP TABLE `ãŠãŠãŠ`; +DROP TABLE `é¾–é¾–é¾–`; +DROP TABLE `é¾—é¾—é¾—`; +DROP TABLE `龞龞龞`; +DROP TABLE `龡龡龡`; +DROP TABLE `龢龢龢`; + +CREATE TABLE `アアア`(`ï½¶ï½¶ï½¶` char(1)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TABLE `イイイ`(`ï½·ï½·ï½·` char(1)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TABLE `ã‚ã‚ã‚`(`ã‹ã‹ã‹` char(1)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TABLE `ã„ã„ã„`(`ããã` char(1)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TABLE `é¾–é¾–é¾–`(`丂丂丂` char(1)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TABLE `é¾—é¾—é¾—`(`丄丄丄` char(1)) DEFAULT CHARSET = utf8 engine=HEAP; +# Tables should not be created because table names exist +CREATE TABLE IF NOT EXISTS `アアア`(`ï½¶ï½¶ï½¶` char(1)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TABLE IF NOT EXISTS `イイイ`(`ï½·ï½·ï½·` char(1)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TABLE IF NOT EXISTS `ã‚ã‚ã‚`(`ã‹ã‹ã‹` char(1)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TABLE IF NOT EXISTS `ã„ã„ã„`(`ããã` char(1)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TABLE IF NOT EXISTS `é¾–é¾–é¾–`(`丂丂丂` char(1)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TABLE IF NOT EXISTS `é¾—é¾—é¾—`(`丄丄丄` char(1)) DEFAULT CHARSET = utf8 engine=HEAP; +# Tables should be created +CREATE TABLE IF NOT EXISTS `ウウウ`(`ククク` char(1)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TABLE IF NOT EXISTS `ã†ã†ã†`(`ããã` char(1)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TABLE IF NOT EXISTS `龞龞龞`(`丅丅丅`char(1)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TEMPORARY TABLE `ï½´ï½´ï½´`(`ケケケ` char(1)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TEMPORARY TABLE `オオオ`(`コココ` char(1)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TEMPORARY TABLE `ãˆãˆãˆ`(`ã‘ã‘ã‘` char(1)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TEMPORARY TABLE `ãŠãŠãŠ`(`ã“ã“ã“` char(1)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TEMPORARY TABLE `龡龡龡`(`丌丌丌` char(1)) DEFAULT CHARSET = utf8 engine=HEAP; +CREATE TEMPORARY TABLE `龢龢龢`(`丒丒丒` char(1)) DEFAULT CHARSET = utf8 engine=HEAP; + +DESC `アアア`; +DESC `イイイ`; +DESC `ウウウ`; +DESC `ï½´ï½´ï½´`; +DESC `オオオ`; +DESC `ã‚ã‚ã‚`; +DESC `ã„ã„ã„`; +DESC `ã†ã†ã†`; +DESC `ãˆãˆãˆ`; +DESC `ãŠãŠãŠ`; +DESC `é¾–é¾–é¾–`; +DESC `é¾—é¾—é¾—`; +DESC `龞龞龞`; +DESC `龡龡龡`; +DESC `龢龢龢`; + +SHOW CREATE TABLE `アアア`; +SHOW CREATE TABLE `イイイ`; +SHOW CREATE TABLE `ウウウ`; +SHOW CREATE TABLE `ï½´ï½´ï½´`; +SHOW CREATE TABLE `オオオ`; +SHOW CREATE TABLE `ã‚ã‚ã‚`; +SHOW CREATE TABLE `ã„ã„ã„`; +SHOW CREATE TABLE `ã†ã†ã†`; +SHOW CREATE TABLE `ãˆãˆãˆ`; +SHOW CREATE TABLE `ãŠãŠãŠ`; +SHOW CREATE TABLE `é¾–é¾–é¾–`; +SHOW CREATE TABLE `é¾—é¾—é¾—`; +SHOW CREATE TABLE `龞龞龞`; +SHOW CREATE TABLE `龡龡龡`; +SHOW CREATE TABLE `龢龢龢`; + +DROP TABLE `アアア`; +DROP TABLE `イイイ`; +DROP TABLE `ウウウ`; +DROP TABLE `ï½´ï½´ï½´`; +DROP TABLE `オオオ`; +DROP TABLE `ã‚ã‚ã‚`; +DROP TABLE `ã„ã„ã„`; +DROP TABLE `ã†ã†ã†`; +DROP TABLE `ãˆãˆãˆ`; +DROP TABLE `ãŠãŠãŠ`; +DROP TABLE `é¾–é¾–é¾–`; +DROP TABLE `é¾—é¾—é¾—`; +DROP TABLE `龞龞龞`; +DROP TABLE `龡龡龡`; +DROP TABLE `龢龢龢`; + +CREATE TABLE `アアア`(`ï½¶ï½¶ï½¶` char(1)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TABLE `イイイ`(`ï½·ï½·ï½·` char(1)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TABLE `ã‚ã‚ã‚`(`ã‹ã‹ã‹` char(1)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TABLE `ã„ã„ã„`(`ããã` char(1)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TABLE `é¾–é¾–é¾–`(`丂丂丂` char(1)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TABLE `é¾—é¾—é¾—`(`丄丄丄` char(1)) DEFAULT CHARSET = utf8 engine=BDB; +# Tables should not be created because table names exist +CREATE TABLE IF NOT EXISTS `アアア`(`ï½¶ï½¶ï½¶` char(1)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TABLE IF NOT EXISTS `イイイ`(`ï½·ï½·ï½·` char(1)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TABLE IF NOT EXISTS `ã‚ã‚ã‚`(`ã‹ã‹ã‹` char(1)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TABLE IF NOT EXISTS `ã„ã„ã„`(`ããã` char(1)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TABLE IF NOT EXISTS `é¾–é¾–é¾–`(`丂丂丂` char(1)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TABLE IF NOT EXISTS `é¾—é¾—é¾—`(`丄丄丄` char(1)) DEFAULT CHARSET = utf8 engine=BDB; +# Tables should be created +CREATE TABLE IF NOT EXISTS `ウウウ`(`ククク` char(1)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TABLE IF NOT EXISTS `ã†ã†ã†`(`ããã` char(1)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TABLE IF NOT EXISTS `龞龞龞`(`丅丅丅`char(1)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TEMPORARY TABLE `ï½´ï½´ï½´`(`ケケケ` char(1)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TEMPORARY TABLE `オオオ`(`コココ` char(1)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TEMPORARY TABLE `ãˆãˆãˆ`(`ã‘ã‘ã‘` char(1)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TEMPORARY TABLE `ãŠãŠãŠ`(`ã“ã“ã“` char(1)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TEMPORARY TABLE `龡龡龡`(`丌丌丌` char(1)) DEFAULT CHARSET = utf8 engine=BDB; +CREATE TEMPORARY TABLE `龢龢龢`(`丒丒丒` char(1)) DEFAULT CHARSET = utf8 engine=BDB; + +DESC `アアア`; +DESC `イイイ`; +DESC `ウウウ`; +DESC `ï½´ï½´ï½´`; +DESC `オオオ`; +DESC `ã‚ã‚ã‚`; +DESC `ã„ã„ã„`; +DESC `ã†ã†ã†`; +DESC `ãˆãˆãˆ`; +DESC `ãŠãŠãŠ`; +DESC `é¾–é¾–é¾–`; +DESC `é¾—é¾—é¾—`; +DESC `龞龞龞`; +DESC `龡龡龡`; +DESC `龢龢龢`; + +SHOW CREATE TABLE `アアア`; +SHOW CREATE TABLE `イイイ`; +SHOW CREATE TABLE `ウウウ`; +SHOW CREATE TABLE `ï½´ï½´ï½´`; +SHOW CREATE TABLE `オオオ`; +SHOW CREATE TABLE `ã‚ã‚ã‚`; +SHOW CREATE TABLE `ã„ã„ã„`; +SHOW CREATE TABLE `ã†ã†ã†`; +SHOW CREATE TABLE `ãˆãˆãˆ`; +SHOW CREATE TABLE `ãŠãŠãŠ`; +SHOW CREATE TABLE `é¾–é¾–é¾–`; +SHOW CREATE TABLE `é¾—é¾—é¾—`; +SHOW CREATE TABLE `龞龞龞`; +SHOW CREATE TABLE `龡龡龡`; +SHOW CREATE TABLE `龢龢龢`; + +DROP TABLE `アアア`; +DROP TABLE `イイイ`; +DROP TABLE `ウウウ`; +DROP TABLE `ï½´ï½´ï½´`; +DROP TABLE `オオオ`; +DROP TABLE `ã‚ã‚ã‚`; +DROP TABLE `ã„ã„ã„`; +DROP TABLE `ã†ã†ã†`; +DROP TABLE `ãˆãˆãˆ`; +DROP TABLE `ãŠãŠãŠ`; +DROP TABLE `é¾–é¾–é¾–`; +DROP TABLE `é¾—é¾—é¾—`; +DROP TABLE `龞龞龞`; +DROP TABLE `龡龡龡`; +DROP TABLE `龢龢龢`; diff --git a/mysql-test/suite/jp/t/jp_enum_sjis.test b/mysql-test/suite/jp/t/jp_enum_sjis.test new file mode 100755 index 00000000000..2ea1bf320e0 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_enum_sjis.test @@ -0,0 +1,153 @@ +--character_set sjis +--disable_warnings +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +drop table if exists `‚s‚P‚P`; +drop table if exists `‚s‚P‚Q`; +#drop table if exists t1; +--enable_warnings + +# +# Test ENUM values with Japanese characters in sjis encoding +# + +SET NAMES sjis; +SET character_set_database = sjis; + +CREATE TABLE `‚s‚P` (`‚b‚P` ENUM('±','²','³'), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Q` (`‚b‚P` ENUM('‚ ','‚¢','‚¤'), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚R` (`‚b‚P` ENUM('ƒ\','\','•\'), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚S` (`‚b‚P` ENUM('±','²','³'), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚T` (`‚b‚P` ENUM('‚ ','‚¢','‚¤'), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚U` (`‚b‚P` ENUM('ƒ\','\','•\'), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚V` (`‚b‚P` ENUM('±','²','³'), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚W` (`‚b‚P` ENUM('‚ ','‚¢','‚¤'), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚X` (`‚b‚P` ENUM('ƒ\','\','•\'), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚O` (`‚b‚P` ENUM('±','²','³'), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚P` (`‚b‚P` ENUM('‚ ','‚¢','‚¤'), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚Q` (`‚b‚P` ENUM('ƒ\','\','•\'), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; + +INSERT INTO `‚s‚P` VALUES ('±'),('²'),('³'); +INSERT INTO `‚s‚Q` VALUES ('‚ '),('‚¢'),('‚¤'); +INSERT INTO `‚s‚R` VALUES ('ƒ\'),('\'),('•\'); +INSERT INTO `‚s‚S` VALUES ('±'),('²'),('³'); +INSERT INTO `‚s‚T` VALUES ('‚ '),('‚¢'),('‚¤'); +INSERT INTO `‚s‚U` VALUES ('ƒ\'),('\'),('•\'); +INSERT INTO `‚s‚V` VALUES ('±'),('²'),('³'); +INSERT INTO `‚s‚W` VALUES ('‚ '),('‚¢'),('‚¤'); +INSERT INTO `‚s‚X` VALUES ('ƒ\'),('\'),('•\'); +INSERT INTO `‚s‚P‚O` VALUES ('±'),('²'),('³'); +INSERT INTO `‚s‚P‚P` VALUES ('‚ '),('‚¢'),('‚¤'); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\'),('\'),('•\'); + +SELECT * FROM `‚s‚P`; +SELECT * FROM `‚s‚Q`; +SELECT * FROM `‚s‚R`; +SELECT * FROM `‚s‚S`; +SELECT * FROM `‚s‚T`; +SELECT * FROM `‚s‚U`; +SELECT * FROM `‚s‚V`; +SELECT * FROM `‚s‚W`; +SELECT * FROM `‚s‚X`; +SELECT * FROM `‚s‚P‚O`; +SELECT * FROM `‚s‚P‚P`; +SELECT * FROM `‚s‚P‚Q`; + +SHOW CREATE TABLE `‚s‚P`; +SHOW CREATE TABLE `‚s‚Q`; +SHOW CREATE TABLE `‚s‚R`; +SHOW CREATE TABLE `‚s‚S`; +SHOW CREATE TABLE `‚s‚T`; +SHOW CREATE TABLE `‚s‚U`; +SHOW CREATE TABLE `‚s‚V`; +SHOW CREATE TABLE `‚s‚W`; +SHOW CREATE TABLE `‚s‚X`; +SHOW CREATE TABLE `‚s‚P‚O`; +SHOW CREATE TABLE `‚s‚P‚P`; +SHOW CREATE TABLE `‚s‚P‚Q`; + +DESC `‚s‚P`; +DESC `‚s‚Q`; +DESC `‚s‚R`; +DESC `‚s‚S`; +DESC `‚s‚T`; +DESC `‚s‚U`; +DESC `‚s‚V`; +DESC `‚s‚W`; +DESC `‚s‚X`; +DESC `‚s‚P‚O`; +DESC `‚s‚P‚P`; +DESC `‚s‚P‚Q`; + +# +# Test problem with enum values after the colum with NOT NULL restriction +# + +ALTER TABLE `‚s‚P` ADD `‚b‚Q` CHAR(1) NOT NULL FIRST; +ALTER TABLE `‚s‚Q` ADD `‚b‚Q` CHAR(1) NOT NULL FIRST; +ALTER TABLE `‚s‚R` ADD `‚b‚Q` CHAR(1) NOT NULL FIRST; +ALTER TABLE `‚s‚S` ADD `‚b‚Q` CHAR(1) NOT NULL FIRST; +ALTER TABLE `‚s‚T` ADD `‚b‚Q` CHAR(1) NOT NULL FIRST; +ALTER TABLE `‚s‚U` ADD `‚b‚Q` CHAR(1) NOT NULL FIRST; +ALTER TABLE `‚s‚V` ADD `‚b‚Q` CHAR(1) NOT NULL FIRST; +ALTER TABLE `‚s‚W` ADD `‚b‚Q` CHAR(1) NOT NULL FIRST; +ALTER TABLE `‚s‚X` ADD `‚b‚Q` CHAR(1) NOT NULL FIRST; +ALTER TABLE `‚s‚P‚O` ADD `‚b‚Q` CHAR(1) NOT NULL FIRST; +ALTER TABLE `‚s‚P‚P` ADD `‚b‚Q` CHAR(1) NOT NULL FIRST; +ALTER TABLE `‚s‚P‚Q` ADD `‚b‚Q` CHAR(1) NOT NULL FIRST; + +SHOW CREATE TABLE `‚s‚P`; +SHOW CREATE TABLE `‚s‚Q`; +SHOW CREATE TABLE `‚s‚R`; +SHOW CREATE TABLE `‚s‚S`; +SHOW CREATE TABLE `‚s‚T`; +SHOW CREATE TABLE `‚s‚U`; +SHOW CREATE TABLE `‚s‚V`; +SHOW CREATE TABLE `‚s‚W`; +SHOW CREATE TABLE `‚s‚X`; +SHOW CREATE TABLE `‚s‚P‚O`; +SHOW CREATE TABLE `‚s‚P‚P`; +SHOW CREATE TABLE `‚s‚P‚Q`; + +# +# Test to distinguish 0x9353 and 0x9373 +# bug #6206 need to be fixed + +#CREATE TABLE t1(c1 enum('“S','“s')) default character set = sjis; +#INSERT INTO t1 VALUES('“S'),('“s'); +#SELECT * FROM t1 WHERE c1 LIKE '“S'; +#DROP TABLE t1; + +DESC `‚s‚P`; +DESC `‚s‚Q`; +DESC `‚s‚R`; +DESC `‚s‚S`; +DESC `‚s‚T`; +DESC `‚s‚U`; +DESC `‚s‚V`; +DESC `‚s‚W`; +DESC `‚s‚X`; +DESC `‚s‚P‚O`; +DESC `‚s‚P‚P`; +DESC `‚s‚P‚Q`; + +DROP TABLE `‚s‚P`; +DROP TABLE `‚s‚Q`; +DROP TABLE `‚s‚R`; +DROP TABLE `‚s‚S`; +DROP TABLE `‚s‚T`; +DROP TABLE `‚s‚U`; +DROP TABLE `‚s‚V`; +DROP TABLE `‚s‚W`; +DROP TABLE `‚s‚X`; +DROP TABLE `‚s‚P‚O`; +DROP TABLE `‚s‚P‚P`; +DROP TABLE `‚s‚P‚Q`; diff --git a/mysql-test/suite/jp/t/jp_enum_ucs2.test b/mysql-test/suite/jp/t/jp_enum_ucs2.test new file mode 100755 index 00000000000..2239ebab478 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_enum_ucs2.test @@ -0,0 +1,149 @@ +--source include/have_ucs2.inc + +# half-with kana is not handled correctly in 4.1 +# because of bug #5174 +# It will be fixed in 5.0 + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +--enable_warnings + +# +# Test ENUM values with Japanese characters in ucs2 encoding +# + +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; + +CREATE TABLE `£Ô£±` (`£Ã£±` ENUM('ޱ','޲','޳'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` ENUM('¤¢','¤¤','¤¦'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` ENUM('íÜ','íÝ','íÞ'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` ENUM('ޱ','޲','޳'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` ENUM('¤¢','¤¤','¤¦'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` ENUM('íÜ','íÝ','íÞ'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` ENUM('ޱ','޲','޳'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` ENUM('¤¢','¤¤','¤¦'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` ENUM('íÜ','íÝ','íÞ'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` ENUM('ޱ','޲','޳'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` ENUM('¤¢','¤¤','¤¦'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` ENUM('íÜ','íÝ','íÞ'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; + +INSERT INTO `£Ô£±` VALUES ('ޱ'),('޲'),('޳'); +INSERT INTO `£Ô£²` VALUES ('¤¢'),('¤¤'),('¤¦'); +INSERT INTO `£Ô£³` VALUES ('íÜ'),('íÝ'),('íÞ'); +INSERT INTO `£Ô£´` VALUES ('ޱ'),('޲'),('޳'); +INSERT INTO `£Ô£µ` VALUES ('¤¢'),('¤¤'),('¤¦'); +INSERT INTO `£Ô£¶` VALUES ('íÜ'),('íÝ'),('íÞ'); +INSERT INTO `£Ô£·` VALUES ('ޱ'),('޲'),('޳'); +INSERT INTO `£Ô£¸` VALUES ('¤¢'),('¤¤'),('¤¦'); +INSERT INTO `£Ô£¹` VALUES ('íÜ'),('íÝ'),('íÞ'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ'),('޲'),('޳'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢'),('¤¤'),('¤¦'); +INSERT INTO `£Ô£±£²` VALUES ('íÜ'),('íÝ'),('íÞ'); + +SELECT * FROM `£Ô£±`; +SELECT * FROM `£Ô£²`; +SELECT * FROM `£Ô£³`; +SELECT * FROM `£Ô£´`; +SELECT * FROM `£Ô£µ`; +SELECT * FROM `£Ô£¶`; +SELECT * FROM `£Ô£·`; +SELECT * FROM `£Ô£¸`; +SELECT * FROM `£Ô£¹`; +SELECT * FROM `£Ô£±£°`; +SELECT * FROM `£Ô£±£±`; +SELECT * FROM `£Ô£±£²`; + +SHOW CREATE TABLE `£Ô£±`; +SHOW CREATE TABLE `£Ô£²`; +SHOW CREATE TABLE `£Ô£³`; +SHOW CREATE TABLE `£Ô£´`; +SHOW CREATE TABLE `£Ô£µ`; +SHOW CREATE TABLE `£Ô£¶`; +SHOW CREATE TABLE `£Ô£·`; +SHOW CREATE TABLE `£Ô£¸`; +SHOW CREATE TABLE `£Ô£¹`; +SHOW CREATE TABLE `£Ô£±£°`; +SHOW CREATE TABLE `£Ô£±£±`; +SHOW CREATE TABLE `£Ô£±£²`; + +DESC `£Ô£±`; +DESC `£Ô£²`; +DESC `£Ô£³`; +DESC `£Ô£´`; +DESC `£Ô£µ`; +DESC `£Ô£¶`; +DESC `£Ô£·`; +DESC `£Ô£¸`; +DESC `£Ô£¹`; +DESC `£Ô£±£°`; +DESC `£Ô£±£±`; +DESC `£Ô£±£²`; + +# +# Test problem with enum values after the colum with NOT NULL restriction +# Cannot test until the bug#7302 is fixed + +#ALTER TABLE `£Ô£±` ADD `£Ã£²` CHAR(1) NOT NULL FIRST; +#ALTER TABLE `£Ô£²` ADD `£Ã£²` CHAR(1) NOT NULL FIRST; +#ALTER TABLE `£Ô£³` ADD `£Ã£²` CHAR(1) NOT NULL FIRST; +#ALTER TABLE `£Ô£´` ADD `£Ã£²` CHAR(1) NOT NULL FIRST; +#ALTER TABLE `£Ô£µ` ADD `£Ã£²` CHAR(1) NOT NULL FIRST; +#ALTER TABLE `£Ô£¶` ADD `£Ã£²` CHAR(1) NOT NULL FIRST; +#ALTER TABLE `£Ô£·` ADD `£Ã£²` CHAR(1) NOT NULL FIRST; +#ALTER TABLE `£Ô£¸` ADD `£Ã£²` CHAR(1) NOT NULL FIRST; +#ALTER TABLE `£Ô£¹` ADD `£Ã£²` CHAR(1) NOT NULL FIRST; +#ALTER TABLE `£Ô£±£°` ADD `£Ã£²` CHAR(1) NOT NULL FIRST; +#ALTER TABLE `£Ô£±£±` ADD `£Ã£²` CHAR(1) NOT NULL FIRST; +#ALTER TABLE `£Ô£±£²` ADD `£Ã£²` CHAR(1) NOT NULL FIRST; + +#SHOW CREATE TABLE `£Ô£±`; +#SHOW CREATE TABLE `£Ô£²`; +#SHOW CREATE TABLE `£Ô£³`; +#SHOW CREATE TABLE `£Ô£´`; +#SHOW CREATE TABLE `£Ô£µ`; +#SHOW CREATE TABLE `£Ô£¶`; +#SHOW CREATE TABLE `£Ô£·`; +#SHOW CREATE TABLE `£Ô£¸`; +#SHOW CREATE TABLE `£Ô£¹`; +#SHOW CREATE TABLE `£Ô£±£°`; +#SHOW CREATE TABLE `£Ô£±£±`; +#SHOW CREATE TABLE `£Ô£±£²`; + +#DESC `£Ô£±`; +#DESC `£Ô£²`; +#DESC `£Ô£³`; +#DESC `£Ô£´`; +#DESC `£Ô£µ`; +#DESC `£Ô£¶`; +#DESC `£Ô£·`; +#DESC `£Ô£¸`; +#DESC `£Ô£¹`; +#DESC `£Ô£±£°`; +#DESC `£Ô£±£±`; +#DESC `£Ô£±£²`; + +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/t/jp_enum_ujis.test b/mysql-test/suite/jp/t/jp_enum_ujis.test new file mode 100755 index 00000000000..da41165aad0 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_enum_ujis.test @@ -0,0 +1,144 @@ +--source include/have_ujis.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +--enable_warnings + +# +# Test ENUM values with Japanese characters in ujis encoding +# + +SET NAMES ujis; +SET character_set_database = ujis; + +CREATE TABLE `£Ô£±` (`£Ã£±` ENUM('ޱ','޲','޳'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` ENUM('¤¢','¤¤','¤¦'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` ENUM('íÜ','íÝ','íÞ'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` ENUM('ޱ','޲','޳'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` ENUM('¤¢','¤¤','¤¦'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` ENUM('íÜ','íÝ','íÞ'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` ENUM('ޱ','޲','޳'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` ENUM('¤¢','¤¤','¤¦'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` ENUM('íÜ','íÝ','íÞ'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` ENUM('ޱ','޲','޳'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` ENUM('¤¢','¤¤','¤¦'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` ENUM('íÜ','íÝ','íÞ'), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; + +INSERT INTO `£Ô£±` VALUES ('ޱ'),('޲'),('޳'); +INSERT INTO `£Ô£²` VALUES ('¤¢'),('¤¤'),('¤¦'); +INSERT INTO `£Ô£³` VALUES ('íÜ'),('íÝ'),('íÞ'); +INSERT INTO `£Ô£´` VALUES ('ޱ'),('޲'),('޳'); +INSERT INTO `£Ô£µ` VALUES ('¤¢'),('¤¤'),('¤¦'); +INSERT INTO `£Ô£¶` VALUES ('íÜ'),('íÝ'),('íÞ'); +INSERT INTO `£Ô£·` VALUES ('ޱ'),('޲'),('޳'); +INSERT INTO `£Ô£¸` VALUES ('¤¢'),('¤¤'),('¤¦'); +INSERT INTO `£Ô£¹` VALUES ('íÜ'),('íÝ'),('íÞ'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ'),('޲'),('޳'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢'),('¤¤'),('¤¦'); +INSERT INTO `£Ô£±£²` VALUES ('íÜ'),('íÝ'),('íÞ'); + +SELECT * FROM `£Ô£±`; +SELECT * FROM `£Ô£²`; +SELECT * FROM `£Ô£³`; +SELECT * FROM `£Ô£´`; +SELECT * FROM `£Ô£µ`; +SELECT * FROM `£Ô£¶`; +SELECT * FROM `£Ô£·`; +SELECT * FROM `£Ô£¸`; +SELECT * FROM `£Ô£¹`; +SELECT * FROM `£Ô£±£°`; +SELECT * FROM `£Ô£±£±`; +SELECT * FROM `£Ô£±£²`; + +SHOW CREATE TABLE `£Ô£±`; +SHOW CREATE TABLE `£Ô£²`; +SHOW CREATE TABLE `£Ô£³`; +SHOW CREATE TABLE `£Ô£´`; +SHOW CREATE TABLE `£Ô£µ`; +SHOW CREATE TABLE `£Ô£¶`; +SHOW CREATE TABLE `£Ô£·`; +SHOW CREATE TABLE `£Ô£¸`; +SHOW CREATE TABLE `£Ô£¹`; +SHOW CREATE TABLE `£Ô£±£°`; +SHOW CREATE TABLE `£Ô£±£±`; +SHOW CREATE TABLE `£Ô£±£²`; + +DESC `£Ô£±`; +DESC `£Ô£²`; +DESC `£Ô£³`; +DESC `£Ô£´`; +DESC `£Ô£µ`; +DESC `£Ô£¶`; +DESC `£Ô£·`; +DESC `£Ô£¸`; +DESC `£Ô£¹`; +DESC `£Ô£±£°`; +DESC `£Ô£±£±`; +DESC `£Ô£±£²`; + +# +# Test problem with enum values after the colum with NOT NULL restriction +# + +ALTER TABLE `£Ô£±` ADD `£Ã£²` CHAR(1) NOT NULL FIRST; +ALTER TABLE `£Ô£²` ADD `£Ã£²` CHAR(1) NOT NULL FIRST; +ALTER TABLE `£Ô£³` ADD `£Ã£²` CHAR(1) NOT NULL FIRST; +ALTER TABLE `£Ô£´` ADD `£Ã£²` CHAR(1) NOT NULL FIRST; +ALTER TABLE `£Ô£µ` ADD `£Ã£²` CHAR(1) NOT NULL FIRST; +ALTER TABLE `£Ô£¶` ADD `£Ã£²` CHAR(1) NOT NULL FIRST; +ALTER TABLE `£Ô£·` ADD `£Ã£²` CHAR(1) NOT NULL FIRST; +ALTER TABLE `£Ô£¸` ADD `£Ã£²` CHAR(1) NOT NULL FIRST; +ALTER TABLE `£Ô£¹` ADD `£Ã£²` CHAR(1) NOT NULL FIRST; +ALTER TABLE `£Ô£±£°` ADD `£Ã£²` CHAR(1) NOT NULL FIRST; +ALTER TABLE `£Ô£±£±` ADD `£Ã£²` CHAR(1) NOT NULL FIRST; +ALTER TABLE `£Ô£±£²` ADD `£Ã£²` CHAR(1) NOT NULL FIRST; + +SHOW CREATE TABLE `£Ô£±`; +SHOW CREATE TABLE `£Ô£²`; +SHOW CREATE TABLE `£Ô£³`; +SHOW CREATE TABLE `£Ô£´`; +SHOW CREATE TABLE `£Ô£µ`; +SHOW CREATE TABLE `£Ô£¶`; +SHOW CREATE TABLE `£Ô£·`; +SHOW CREATE TABLE `£Ô£¸`; +SHOW CREATE TABLE `£Ô£¹`; +SHOW CREATE TABLE `£Ô£±£°`; +SHOW CREATE TABLE `£Ô£±£±`; +SHOW CREATE TABLE `£Ô£±£²`; + +DESC `£Ô£±`; +DESC `£Ô£²`; +DESC `£Ô£³`; +DESC `£Ô£´`; +DESC `£Ô£µ`; +DESC `£Ô£¶`; +DESC `£Ô£·`; +DESC `£Ô£¸`; +DESC `£Ô£¹`; +DESC `£Ô£±£°`; +DESC `£Ô£±£±`; +DESC `£Ô£±£²`; + +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/t/jp_enum_utf8.test b/mysql-test/suite/jp/t/jp_enum_utf8.test new file mode 100755 index 00000000000..4ce3576b604 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_enum_utf8.test @@ -0,0 +1,142 @@ +--disable_warnings +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +drop table if exists `T11`; +drop table if exists `T12`; +--enable_warnings + +# +# Test ENUM values with Japanese characters in utf8 encoding +# + +SET NAMES utf8; +SET character_set_database = utf8; + +CREATE TABLE `T1` (`C1` ENUM('ï½±','ï½²','ï½³'), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’` (`C1` ENUM('ã‚','ã„','ã†'), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3` (`C1` ENUM('é¾”','é¾–','é¾—'), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”` (`C1` ENUM('ï½±','ï½²','ï½³'), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5` (`C1` ENUM('ã‚','ã„','ã†'), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–` (`C1` ENUM('é¾”','é¾–','é¾—'), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—` (`C1` ENUM('ï½±','ï½²','ï½³'), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8` (`C1` ENUM('ã‚','ã„','ã†'), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™` (`C1` ENUM('é¾”','é¾–','é¾—'), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼` (`C1` ENUM('ï½±','ï½²','ï½³'), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T11` (`C1` ENUM('ã‚','ã„','ã†'), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T12` (`C1` ENUM('é¾”','é¾–','é¾—'), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; + +INSERT INTO `T1` VALUES ('ï½±'),('ï½²'),('ï½³'); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚'),('ã„'),('ã†'); +INSERT INTO `T3` VALUES ('é¾”'),('é¾–'),('é¾—'); +INSERT INTO `ï¼´ï¼”` VALUES ('ï½±'),('ï½²'),('ï½³'); +INSERT INTO `T5` VALUES ('ã‚'),('ã„'),('ã†'); +INSERT INTO `ï¼´ï¼–` VALUES ('é¾”'),('é¾–'),('é¾—'); +INSERT INTO `ï¼´ï¼—` VALUES ('ï½±'),('ï½²'),('ï½³'); +INSERT INTO `T8` VALUES ('ã‚'),('ã„'),('ã†'); +INSERT INTO `ï¼´ï¼™` VALUES ('é¾”'),('é¾–'),('é¾—'); +INSERT INTO `T1ï¼` VALUES ('ï½±'),('ï½²'),('ï½³'); +INSERT INTO `T11` VALUES ('ã‚'),('ã„'),('ã†'); +INSERT INTO `T12` VALUES ('é¾”'),('é¾–'),('é¾—'); + +SELECT * FROM `T1`; +SELECT * FROM `ï¼´ï¼’`; +SELECT * FROM `T3`; +SELECT * FROM `ï¼´ï¼”`; +SELECT * FROM `T5`; +SELECT * FROM `ï¼´ï¼–`; +SELECT * FROM `ï¼´ï¼—`; +SELECT * FROM `T8`; +SELECT * FROM `ï¼´ï¼™`; +SELECT * FROM `T1ï¼`; +SELECT * FROM `T11`; +SELECT * FROM `T12`; + +SHOW CREATE TABLE `T1`; +SHOW CREATE TABLE `ï¼´ï¼’`; +SHOW CREATE TABLE `T3`; +SHOW CREATE TABLE `ï¼´ï¼”`; +SHOW CREATE TABLE `T5`; +SHOW CREATE TABLE `ï¼´ï¼–`; +SHOW CREATE TABLE `ï¼´ï¼—`; +SHOW CREATE TABLE `T8`; +SHOW CREATE TABLE `ï¼´ï¼™`; +SHOW CREATE TABLE `T1ï¼`; +SHOW CREATE TABLE `T11`; +SHOW CREATE TABLE `T12`; + +DESC `T1`; +DESC `ï¼´ï¼’`; +DESC `T3`; +DESC `ï¼´ï¼”`; +DESC `T5`; +DESC `ï¼´ï¼–`; +DESC `ï¼´ï¼—`; +DESC `T8`; +DESC `ï¼´ï¼™`; +DESC `T1ï¼`; +DESC `T11`; +DESC `T12`; + +# +# Test problem with enum values after the colum with NOT NULL restriction +# + +ALTER TABLE `T1` ADD `C2` CHAR(1) NOT NULL FIRST; +ALTER TABLE `ï¼´ï¼’` ADD `C2` CHAR(1) NOT NULL FIRST; +ALTER TABLE `T3` ADD `C2` CHAR(1) NOT NULL FIRST; +ALTER TABLE `ï¼´ï¼”` ADD `C2` CHAR(1) NOT NULL FIRST; +ALTER TABLE `T5` ADD `C2` CHAR(1) NOT NULL FIRST; +ALTER TABLE `ï¼´ï¼–` ADD `C2` CHAR(1) NOT NULL FIRST; +ALTER TABLE `ï¼´ï¼—` ADD `C2` CHAR(1) NOT NULL FIRST; +ALTER TABLE `T8` ADD `C2` CHAR(1) NOT NULL FIRST; +ALTER TABLE `ï¼´ï¼™` ADD `C2` CHAR(1) NOT NULL FIRST; +ALTER TABLE `T1ï¼` ADD `C2` CHAR(1) NOT NULL FIRST; +ALTER TABLE `T11` ADD `C2` CHAR(1) NOT NULL FIRST; +ALTER TABLE `T12` ADD `C2` CHAR(1) NOT NULL FIRST; + +SHOW CREATE TABLE `T1`; +SHOW CREATE TABLE `ï¼´ï¼’`; +SHOW CREATE TABLE `T3`; +SHOW CREATE TABLE `ï¼´ï¼”`; +SHOW CREATE TABLE `T5`; +SHOW CREATE TABLE `ï¼´ï¼–`; +SHOW CREATE TABLE `ï¼´ï¼—`; +SHOW CREATE TABLE `T8`; +SHOW CREATE TABLE `ï¼´ï¼™`; +SHOW CREATE TABLE `T1ï¼`; +SHOW CREATE TABLE `T11`; +SHOW CREATE TABLE `T12`; + +DESC `T1`; +DESC `ï¼´ï¼’`; +DESC `T3`; +DESC `ï¼´ï¼”`; +DESC `T5`; +DESC `ï¼´ï¼–`; +DESC `ï¼´ï¼—`; +DESC `T8`; +DESC `ï¼´ï¼™`; +DESC `T1ï¼`; +DESC `T11`; +DESC `T12`; + +DROP TABLE `T1`; +DROP TABLE `ï¼´ï¼’`; +DROP TABLE `T3`; +DROP TABLE `ï¼´ï¼”`; +DROP TABLE `T5`; +DROP TABLE `ï¼´ï¼–`; +DROP TABLE `ï¼´ï¼—`; +DROP TABLE `T8`; +DROP TABLE `ï¼´ï¼™`; +DROP TABLE `T1ï¼`; +DROP TABLE `T11`; +DROP TABLE `T12`; diff --git a/mysql-test/suite/jp/t/jp_insert_sjis.test b/mysql-test/suite/jp/t/jp_insert_sjis.test new file mode 100755 index 00000000000..0266ad1eaca --- /dev/null +++ b/mysql-test/suite/jp/t/jp_insert_sjis.test @@ -0,0 +1,354 @@ +--character_set sjis +--disable_warnings +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +drop table if exists `‚s‚P‚P`; +drop table if exists `‚s‚P‚Q`; +--enable_warnings + +# +# Test INSERT() function with Japanese characters in sjis encoding +# + +SET NAMES sjis; +SET character_set_database = sjis; + +CREATE TABLE `‚s‚P` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Q` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚R` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚S` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚T` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚U` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚V` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚W` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚X` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚O` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚P` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚Q` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = bdb; + +INSERT INTO `‚s‚P` VALUES ('±²³´µ'); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚S` VALUES ('±²³´µ'); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚V` VALUES ('±²³´µ'); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ'); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\'); + +#InnoDB +SELECT INSERT(`‚b‚P`,1,1,'¶') FROM `‚s‚P`; +SELECT INSERT(`‚b‚P`,1,2,'¶·') FROM `‚s‚P`; +SELECT INSERT(`‚b‚P`,1,3,'¶·¸') FROM `‚s‚P`; +SELECT INSERT(`‚b‚P`,1,4,'¶·¸¹') FROM `‚s‚P`; +SELECT INSERT(`‚b‚P`,1,5,'¶·¸¹º') FROM `‚s‚P`; +SELECT INSERT(`‚b‚P`,2,1,'·') FROM `‚s‚P`; +SELECT INSERT(`‚b‚P`,2,2,'·¸') FROM `‚s‚P`; +SELECT INSERT(`‚b‚P`,2,3,'·¸¹') FROM `‚s‚P`; +SELECT INSERT(`‚b‚P`,2,4,'·¸¹º') FROM `‚s‚P`; +SELECT INSERT(`‚b‚P`,3,1,'¸') FROM `‚s‚P`; +SELECT INSERT(`‚b‚P`,3,2,'¸¹') FROM `‚s‚P`; +SELECT INSERT(`‚b‚P`,3,3,'¸¹º') FROM `‚s‚P`; +SELECT INSERT(`‚b‚P`,4,1,'¹') FROM `‚s‚P`; +SELECT INSERT(`‚b‚P`,4,2,'¹º') FROM `‚s‚P`; +SELECT INSERT(`‚b‚P`,5,1,'º') FROM `‚s‚P`; +SELECT INSERT(`‚b‚P`,1,1,' ') FROM `‚s‚P`; +SELECT INSERT(`‚b‚P`,1,2,' ') FROM `‚s‚P`; +SELECT INSERT(`‚b‚P`,1,3,' ') FROM `‚s‚P`; +SELECT INSERT(`‚b‚P`,1,4,' ') FROM `‚s‚P`; +SELECT INSERT(`‚b‚P`,1,5,' ') FROM `‚s‚P`; +SELECT INSERT(`‚b‚P`,2,1,' ') FROM `‚s‚P`; +SELECT INSERT(`‚b‚P`,2,2,' ') FROM `‚s‚P`; +SELECT INSERT(`‚b‚P`,2,3,' ') FROM `‚s‚P`; +SELECT INSERT(`‚b‚P`,2,4,' ') FROM `‚s‚P`; +SELECT INSERT(`‚b‚P`,3,1,' ') FROM `‚s‚P`; +SELECT INSERT(`‚b‚P`,3,2,' ') FROM `‚s‚P`; +SELECT INSERT(`‚b‚P`,3,3,' ') FROM `‚s‚P`; +SELECT INSERT(`‚b‚P`,4,1,' ') FROM `‚s‚P`; +SELECT INSERT(`‚b‚P`,4,2,' ') FROM `‚s‚P`; +SELECT INSERT(`‚b‚P`,5,1,' ') FROM `‚s‚P`; +SELECT INSERT(`‚b‚P`,1,1,'‚©') FROM `‚s‚Q`; +SELECT INSERT(`‚b‚P`,1,2,'‚©‚«') FROM `‚s‚Q`; +SELECT INSERT(`‚b‚P`,1,3,'‚©‚«‚­') FROM `‚s‚Q`; +SELECT INSERT(`‚b‚P`,1,4,'‚©‚«‚­‚¯') FROM `‚s‚Q`; +SELECT INSERT(`‚b‚P`,1,5,'‚©‚«‚­‚¯‚±') FROM `‚s‚Q`; +SELECT INSERT(`‚b‚P`,2,1,'‚«') FROM `‚s‚Q`; +SELECT INSERT(`‚b‚P`,2,2,'‚«‚­') FROM `‚s‚Q`; +SELECT INSERT(`‚b‚P`,2,3,'‚«‚­‚¯') FROM `‚s‚Q`; +SELECT INSERT(`‚b‚P`,2,4,'‚«‚­‚¯‚±') FROM `‚s‚Q`; +SELECT INSERT(`‚b‚P`,3,1,'‚­') FROM `‚s‚Q`; +SELECT INSERT(`‚b‚P`,3,2,'‚­‚¯') FROM `‚s‚Q`; +SELECT INSERT(`‚b‚P`,3,3,'‚­‚¯‚±') FROM `‚s‚Q`; +SELECT INSERT(`‚b‚P`,4,1,'‚¯') FROM `‚s‚Q`; +SELECT INSERT(`‚b‚P`,4,2,'‚¯‚±') FROM `‚s‚Q`; +SELECT INSERT(`‚b‚P`,5,1,'‚±') FROM `‚s‚Q`; +SELECT INSERT(`‚b‚P`,1,1,'@') FROM `‚s‚Q`; +SELECT INSERT(`‚b‚P`,1,2,'@@') FROM `‚s‚Q`; +SELECT INSERT(`‚b‚P`,1,3,'@@@') FROM `‚s‚Q`; +SELECT INSERT(`‚b‚P`,1,4,'@@@@') FROM `‚s‚Q`; +SELECT INSERT(`‚b‚P`,1,5,'@@@@@') FROM `‚s‚Q`; +SELECT INSERT(`‚b‚P`,2,1,'@') FROM `‚s‚Q`; +SELECT INSERT(`‚b‚P`,2,2,'@@') FROM `‚s‚Q`; +SELECT INSERT(`‚b‚P`,2,3,'@@@') FROM `‚s‚Q`; +SELECT INSERT(`‚b‚P`,2,4,'@@@@') FROM `‚s‚Q`; +SELECT INSERT(`‚b‚P`,3,1,'@') FROM `‚s‚Q`; +SELECT INSERT(`‚b‚P`,3,2,'@@') FROM `‚s‚Q`; +SELECT INSERT(`‚b‚P`,3,3,'@@@') FROM `‚s‚Q`; +SELECT INSERT(`‚b‚P`,4,1,'@') FROM `‚s‚Q`; +SELECT INSERT(`‚b‚P`,4,2,'@@') FROM `‚s‚Q`; +SELECT INSERT(`‚b‚P`,5,1,'@') FROM `‚s‚Q`; +SELECT INSERT(`‚b‚P`,1,1,'”\') FROM `‚s‚R`; +SELECT INSERT(`‚b‚P`,1,2,'”\”\' ) FROM `‚s‚R`; +SELECT INSERT(`‚b‚P`,1,3,'”\”\”\' ) FROM `‚s‚R`; +SELECT INSERT(`‚b‚P`,1,4,'”\”\”\”\' ) FROM `‚s‚R`; +SELECT INSERT(`‚b‚P`,1,5,'”\”\”\”\”\' ) FROM `‚s‚R`; +SELECT INSERT(`‚b‚P`,2,1,'”\') FROM `‚s‚R`; +SELECT INSERT(`‚b‚P`,2,2,'”\”\' ) FROM `‚s‚R`; +SELECT INSERT(`‚b‚P`,2,3,'”\”\”\' ) FROM `‚s‚R`; +SELECT INSERT(`‚b‚P`,2,4,'”\”\”\”\' ) FROM `‚s‚R`; +SELECT INSERT(`‚b‚P`,3,1,'”\') FROM `‚s‚R`; +SELECT INSERT(`‚b‚P`,3,2,'”\”\' ) FROM `‚s‚R`; +SELECT INSERT(`‚b‚P`,3,3,'”\”\”\' ) FROM `‚s‚R`; +SELECT INSERT(`‚b‚P`,4,1,'”\') FROM `‚s‚R`; +SELECT INSERT(`‚b‚P`,4,2,'”\”\' ) FROM `‚s‚R`; +SELECT INSERT(`‚b‚P`,5,1,'”\') FROM `‚s‚R`; + +#MyISAM +SELECT INSERT(`‚b‚P`,1,1,'¶') FROM `‚s‚S`; +SELECT INSERT(`‚b‚P`,1,2,'¶·') FROM `‚s‚S`; +SELECT INSERT(`‚b‚P`,1,3,'¶·¸') FROM `‚s‚S`; +SELECT INSERT(`‚b‚P`,1,4,'¶·¸¹') FROM `‚s‚S`; +SELECT INSERT(`‚b‚P`,1,5,'¶·¸¹º') FROM `‚s‚S`; +SELECT INSERT(`‚b‚P`,2,1,'·') FROM `‚s‚S`; +SELECT INSERT(`‚b‚P`,2,2,'·¸') FROM `‚s‚S`; +SELECT INSERT(`‚b‚P`,2,3,'·¸¹') FROM `‚s‚S`; +SELECT INSERT(`‚b‚P`,2,4,'·¸¹º') FROM `‚s‚S`; +SELECT INSERT(`‚b‚P`,3,1,'¸') FROM `‚s‚S`; +SELECT INSERT(`‚b‚P`,3,2,'¸¹') FROM `‚s‚S`; +SELECT INSERT(`‚b‚P`,3,3,'¸¹º') FROM `‚s‚S`; +SELECT INSERT(`‚b‚P`,4,1,'¹') FROM `‚s‚S`; +SELECT INSERT(`‚b‚P`,4,2,'¹º') FROM `‚s‚S`; +SELECT INSERT(`‚b‚P`,5,1,'º') FROM `‚s‚S`; +SELECT INSERT(`‚b‚P`,1,1,' ') FROM `‚s‚S`; +SELECT INSERT(`‚b‚P`,1,2,' ') FROM `‚s‚S`; +SELECT INSERT(`‚b‚P`,1,3,' ') FROM `‚s‚S`; +SELECT INSERT(`‚b‚P`,1,4,' ') FROM `‚s‚S`; +SELECT INSERT(`‚b‚P`,1,5,' ') FROM `‚s‚S`; +SELECT INSERT(`‚b‚P`,2,1,' ') FROM `‚s‚S`; +SELECT INSERT(`‚b‚P`,2,2,' ') FROM `‚s‚S`; +SELECT INSERT(`‚b‚P`,2,3,' ') FROM `‚s‚S`; +SELECT INSERT(`‚b‚P`,2,4,' ') FROM `‚s‚S`; +SELECT INSERT(`‚b‚P`,3,1,' ') FROM `‚s‚S`; +SELECT INSERT(`‚b‚P`,3,2,' ') FROM `‚s‚S`; +SELECT INSERT(`‚b‚P`,3,3,' ') FROM `‚s‚S`; +SELECT INSERT(`‚b‚P`,4,1,' ') FROM `‚s‚S`; +SELECT INSERT(`‚b‚P`,4,2,' ') FROM `‚s‚S`; +SELECT INSERT(`‚b‚P`,5,1,' ') FROM `‚s‚S`; +SELECT INSERT(`‚b‚P`,1,1,'‚©') FROM `‚s‚T`; +SELECT INSERT(`‚b‚P`,1,2,'‚©‚«') FROM `‚s‚T`; +SELECT INSERT(`‚b‚P`,1,3,'‚©‚«‚­') FROM `‚s‚T`; +SELECT INSERT(`‚b‚P`,1,4,'‚©‚«‚­‚¯') FROM `‚s‚T`; +SELECT INSERT(`‚b‚P`,1,5,'‚©‚«‚­‚¯‚±') FROM `‚s‚T`; +SELECT INSERT(`‚b‚P`,2,1,'‚«') FROM `‚s‚T`; +SELECT INSERT(`‚b‚P`,2,2,'‚«‚­') FROM `‚s‚T`; +SELECT INSERT(`‚b‚P`,2,3,'‚«‚­‚¯') FROM `‚s‚T`; +SELECT INSERT(`‚b‚P`,2,4,'‚«‚­‚¯‚±') FROM `‚s‚T`; +SELECT INSERT(`‚b‚P`,3,1,'‚­') FROM `‚s‚T`; +SELECT INSERT(`‚b‚P`,3,2,'‚­‚¯') FROM `‚s‚T`; +SELECT INSERT(`‚b‚P`,3,3,'‚­‚¯‚±') FROM `‚s‚T`; +SELECT INSERT(`‚b‚P`,4,1,'‚¯') FROM `‚s‚T`; +SELECT INSERT(`‚b‚P`,4,2,'‚¯‚±') FROM `‚s‚T`; +SELECT INSERT(`‚b‚P`,5,1,'‚±') FROM `‚s‚T`; +SELECT INSERT(`‚b‚P`,1,1,'@') FROM `‚s‚T`; +SELECT INSERT(`‚b‚P`,1,2,'@@') FROM `‚s‚T`; +SELECT INSERT(`‚b‚P`,1,3,'@@@') FROM `‚s‚T`; +SELECT INSERT(`‚b‚P`,1,4,'@@@@') FROM `‚s‚T`; +SELECT INSERT(`‚b‚P`,1,5,'@@@@@') FROM `‚s‚T`; +SELECT INSERT(`‚b‚P`,2,1,'@') FROM `‚s‚T`; +SELECT INSERT(`‚b‚P`,2,2,'@@') FROM `‚s‚T`; +SELECT INSERT(`‚b‚P`,2,3,'@@@') FROM `‚s‚T`; +SELECT INSERT(`‚b‚P`,2,4,'@@@@') FROM `‚s‚T`; +SELECT INSERT(`‚b‚P`,3,1,'@') FROM `‚s‚T`; +SELECT INSERT(`‚b‚P`,3,2,'@@') FROM `‚s‚T`; +SELECT INSERT(`‚b‚P`,3,3,'@@@') FROM `‚s‚T`; +SELECT INSERT(`‚b‚P`,4,1,'@') FROM `‚s‚T`; +SELECT INSERT(`‚b‚P`,4,2,'@@') FROM `‚s‚T`; +SELECT INSERT(`‚b‚P`,5,1,'@') FROM `‚s‚T`; +SELECT INSERT(`‚b‚P`,1,1,'”\') FROM `‚s‚U`; +SELECT INSERT(`‚b‚P`,1,2,'”\”\' ) FROM `‚s‚U`; +SELECT INSERT(`‚b‚P`,1,3,'”\”\”\' ) FROM `‚s‚U`; +SELECT INSERT(`‚b‚P`,1,4,'”\”\”\”\' ) FROM `‚s‚U`; +SELECT INSERT(`‚b‚P`,1,5,'”\”\”\”\”\' ) FROM `‚s‚U`; +SELECT INSERT(`‚b‚P`,2,1,'”\') FROM `‚s‚U`; +SELECT INSERT(`‚b‚P`,2,2,'”\”\') FROM `‚s‚U`; +SELECT INSERT(`‚b‚P`,2,3,'”\”\”\' ) FROM `‚s‚U`; +SELECT INSERT(`‚b‚P`,2,4,'”\”\”\”\' ) FROM `‚s‚U`; +SELECT INSERT(`‚b‚P`,3,1,'”\') FROM `‚s‚U`; +SELECT INSERT(`‚b‚P`,3,2,'”\”\' ) FROM `‚s‚U`; +SELECT INSERT(`‚b‚P`,3,3,'”\”\”\' ) FROM `‚s‚U`; +SELECT INSERT(`‚b‚P`,4,1,'”\') FROM `‚s‚U`; +SELECT INSERT(`‚b‚P`,4,2,'”\”\' ) FROM `‚s‚U`; +SELECT INSERT(`‚b‚P`,5,1,'”\') FROM `‚s‚U`; + +#HEAP +SELECT INSERT(`‚b‚P`,1,1,'¶') FROM `‚s‚V`; +SELECT INSERT(`‚b‚P`,1,2,'¶·') FROM `‚s‚V`; +SELECT INSERT(`‚b‚P`,1,3,'¶·¸') FROM `‚s‚V`; +SELECT INSERT(`‚b‚P`,1,4,'¶·¸¹') FROM `‚s‚V`; +SELECT INSERT(`‚b‚P`,1,5,'¶·¸¹º') FROM `‚s‚V`; +SELECT INSERT(`‚b‚P`,2,1,'·') FROM `‚s‚V`; +SELECT INSERT(`‚b‚P`,2,2,'·¸') FROM `‚s‚V`; +SELECT INSERT(`‚b‚P`,2,3,'·¸¹') FROM `‚s‚V`; +SELECT INSERT(`‚b‚P`,2,4,'·¸¹º') FROM `‚s‚V`; +SELECT INSERT(`‚b‚P`,3,1,'¸') FROM `‚s‚V`; +SELECT INSERT(`‚b‚P`,3,2,'¸¹') FROM `‚s‚V`; +SELECT INSERT(`‚b‚P`,3,3,'¸¹º') FROM `‚s‚V`; +SELECT INSERT(`‚b‚P`,4,1,'¹') FROM `‚s‚V`; +SELECT INSERT(`‚b‚P`,4,2,'¹º') FROM `‚s‚V`; +SELECT INSERT(`‚b‚P`,5,1,'º') FROM `‚s‚V`; +SELECT INSERT(`‚b‚P`,1,1,' ') FROM `‚s‚V`; +SELECT INSERT(`‚b‚P`,1,2,' ') FROM `‚s‚V`; +SELECT INSERT(`‚b‚P`,1,3,' ') FROM `‚s‚V`; +SELECT INSERT(`‚b‚P`,1,4,' ') FROM `‚s‚V`; +SELECT INSERT(`‚b‚P`,1,5,' ') FROM `‚s‚V`; +SELECT INSERT(`‚b‚P`,2,1,' ') FROM `‚s‚V`; +SELECT INSERT(`‚b‚P`,2,2,' ') FROM `‚s‚V`; +SELECT INSERT(`‚b‚P`,2,3,' ') FROM `‚s‚V`; +SELECT INSERT(`‚b‚P`,2,4,' ') FROM `‚s‚V`; +SELECT INSERT(`‚b‚P`,3,1,' ') FROM `‚s‚V`; +SELECT INSERT(`‚b‚P`,3,2,' ') FROM `‚s‚V`; +SELECT INSERT(`‚b‚P`,3,3,' ') FROM `‚s‚V`; +SELECT INSERT(`‚b‚P`,4,1,' ') FROM `‚s‚V`; +SELECT INSERT(`‚b‚P`,4,2,' ') FROM `‚s‚V`; +SELECT INSERT(`‚b‚P`,5,1,' ') FROM `‚s‚V`; +SELECT INSERT(`‚b‚P`,1,1,'‚©') FROM `‚s‚W`; +SELECT INSERT(`‚b‚P`,1,2,'‚©‚«') FROM `‚s‚W`; +SELECT INSERT(`‚b‚P`,1,3,'‚©‚«‚­') FROM `‚s‚W`; +SELECT INSERT(`‚b‚P`,1,4,'‚©‚«‚­‚¯') FROM `‚s‚W`; +SELECT INSERT(`‚b‚P`,1,5,'‚©‚«‚­‚¯‚±') FROM `‚s‚W`; +SELECT INSERT(`‚b‚P`,2,1,'‚«') FROM `‚s‚W`; +SELECT INSERT(`‚b‚P`,2,2,'‚«‚­') FROM `‚s‚W`; +SELECT INSERT(`‚b‚P`,2,3,'‚«‚­‚¯') FROM `‚s‚W`; +SELECT INSERT(`‚b‚P`,2,4,'‚«‚­‚¯‚±') FROM `‚s‚W`; +SELECT INSERT(`‚b‚P`,3,1,'‚­') FROM `‚s‚W`; +SELECT INSERT(`‚b‚P`,3,2,'‚­‚¯') FROM `‚s‚W`; +SELECT INSERT(`‚b‚P`,3,3,'‚­‚¯‚±') FROM `‚s‚W`; +SELECT INSERT(`‚b‚P`,4,1,'‚¯') FROM `‚s‚W`; +SELECT INSERT(`‚b‚P`,4,2,'‚¯‚±') FROM `‚s‚W`; +SELECT INSERT(`‚b‚P`,5,1,'‚±') FROM `‚s‚W`; +SELECT INSERT(`‚b‚P`,1,1,'@') FROM `‚s‚W`; +SELECT INSERT(`‚b‚P`,1,2,'@@') FROM `‚s‚W`; +SELECT INSERT(`‚b‚P`,1,3,'@@@') FROM `‚s‚W`; +SELECT INSERT(`‚b‚P`,1,4,'@@@@') FROM `‚s‚W`; +SELECT INSERT(`‚b‚P`,1,5,'@@@@@') FROM `‚s‚W`; +SELECT INSERT(`‚b‚P`,2,1,'@') FROM `‚s‚W`; +SELECT INSERT(`‚b‚P`,2,2,'@@') FROM `‚s‚W`; +SELECT INSERT(`‚b‚P`,2,3,'@@@') FROM `‚s‚W`; +SELECT INSERT(`‚b‚P`,2,4,'@@@@') FROM `‚s‚W`; +SELECT INSERT(`‚b‚P`,3,1,'@') FROM `‚s‚W`; +SELECT INSERT(`‚b‚P`,3,2,'@@') FROM `‚s‚W`; +SELECT INSERT(`‚b‚P`,3,3,'@@@') FROM `‚s‚W`; +SELECT INSERT(`‚b‚P`,4,1,'@') FROM `‚s‚W`; +SELECT INSERT(`‚b‚P`,4,2,'@@') FROM `‚s‚W`; +SELECT INSERT(`‚b‚P`,5,1,'@') FROM `‚s‚W`; +SELECT INSERT(`‚b‚P`,1,1,'”\') FROM `‚s‚X`; +SELECT INSERT(`‚b‚P`,1,2,'”\”\' ) FROM `‚s‚X`; +SELECT INSERT(`‚b‚P`,1,3,'”\”\”\' ) FROM `‚s‚X`; +SELECT INSERT(`‚b‚P`,1,4,'”\”\”\”\' ) FROM `‚s‚X`; +SELECT INSERT(`‚b‚P`,1,5,'”\”\”\”\”\' ) FROM `‚s‚X`; +SELECT INSERT(`‚b‚P`,2,1,'”\') FROM `‚s‚X`; +SELECT INSERT(`‚b‚P`,2,2,'”\”\' ) FROM `‚s‚X`; +SELECT INSERT(`‚b‚P`,2,3,'”\”\”\' ) FROM `‚s‚X`; +SELECT INSERT(`‚b‚P`,2,4,'”\”\”\”\' ) FROM `‚s‚X`; +SELECT INSERT(`‚b‚P`,3,1,'”\') FROM `‚s‚X`; +SELECT INSERT(`‚b‚P`,3,2,'”\”\' ) FROM `‚s‚X`; +SELECT INSERT(`‚b‚P`,3,3,'”\”\”\' ) FROM `‚s‚X`; +SELECT INSERT(`‚b‚P`,4,1,'”\') FROM `‚s‚X`; +SELECT INSERT(`‚b‚P`,4,2,'”\”\' ) FROM `‚s‚X`; +SELECT INSERT(`‚b‚P`,5,1,'”\') FROM `‚s‚X`; + +#BDB +SELECT INSERT(`‚b‚P`,1,1,'¶') FROM `‚s‚P‚O`; +SELECT INSERT(`‚b‚P`,1,2,'¶·') FROM `‚s‚P‚O`; +SELECT INSERT(`‚b‚P`,1,3,'¶·¸') FROM `‚s‚P‚O`; +SELECT INSERT(`‚b‚P`,1,4,'¶·¸¹') FROM `‚s‚P‚O`; +SELECT INSERT(`‚b‚P`,1,5,'¶·¸¹º') FROM `‚s‚P‚O`; +SELECT INSERT(`‚b‚P`,2,1,'·') FROM `‚s‚P‚O`; +SELECT INSERT(`‚b‚P`,2,2,'·¸') FROM `‚s‚P‚O`; +SELECT INSERT(`‚b‚P`,2,3,'·¸¹') FROM `‚s‚P‚O`; +SELECT INSERT(`‚b‚P`,2,4,'·¸¹º') FROM `‚s‚P‚O`; +SELECT INSERT(`‚b‚P`,3,1,'¸') FROM `‚s‚P‚O`; +SELECT INSERT(`‚b‚P`,3,2,'¸¹') FROM `‚s‚P‚O`; +SELECT INSERT(`‚b‚P`,3,3,'¸¹º') FROM `‚s‚P‚O`; +SELECT INSERT(`‚b‚P`,4,1,'¹') FROM `‚s‚P‚O`; +SELECT INSERT(`‚b‚P`,4,2,'¹º') FROM `‚s‚P‚O`; +SELECT INSERT(`‚b‚P`,5,1,'º') FROM `‚s‚P‚O`; +SELECT INSERT(`‚b‚P`,1,1,'‚©') FROM `‚s‚P‚P`; +SELECT INSERT(`‚b‚P`,1,2,'‚©‚«') FROM `‚s‚P‚P`; +SELECT INSERT(`‚b‚P`,1,3,'‚©‚«‚­') FROM `‚s‚P‚P`; +SELECT INSERT(`‚b‚P`,1,4,'‚©‚«‚­‚¯') FROM `‚s‚P‚P`; +SELECT INSERT(`‚b‚P`,1,5,'‚©‚«‚­‚¯‚±') FROM `‚s‚P‚P`; +SELECT INSERT(`‚b‚P`,2,1,'‚«') FROM `‚s‚P‚P`; +SELECT INSERT(`‚b‚P`,2,2,'‚«‚­') FROM `‚s‚P‚P`; +SELECT INSERT(`‚b‚P`,2,3,'‚«‚­‚¯') FROM `‚s‚P‚P`; +SELECT INSERT(`‚b‚P`,2,4,'‚«‚­‚¯‚±') FROM `‚s‚P‚P`; +SELECT INSERT(`‚b‚P`,3,1,'‚­') FROM `‚s‚P‚P`; +SELECT INSERT(`‚b‚P`,3,2,'‚­‚¯') FROM `‚s‚P‚P`; +SELECT INSERT(`‚b‚P`,3,3,'‚­‚¯‚±') FROM `‚s‚P‚P`; +SELECT INSERT(`‚b‚P`,4,1,'‚¯') FROM `‚s‚P‚P`; +SELECT INSERT(`‚b‚P`,4,2,'‚¯‚±') FROM `‚s‚P‚P`; +SELECT INSERT(`‚b‚P`,5,1,'‚±') FROM `‚s‚P‚P`; +SELECT INSERT(`‚b‚P`,1,1,'@') FROM `‚s‚P‚P`; +SELECT INSERT(`‚b‚P`,1,2,'@@') FROM `‚s‚P‚P`; +SELECT INSERT(`‚b‚P`,1,3,'@@@') FROM `‚s‚P‚P`; +SELECT INSERT(`‚b‚P`,1,4,'@@@@') FROM `‚s‚P‚P`; +SELECT INSERT(`‚b‚P`,1,5,'@@@@@') FROM `‚s‚P‚P`; +SELECT INSERT(`‚b‚P`,2,1,'@') FROM `‚s‚P‚P`; +SELECT INSERT(`‚b‚P`,2,2,'@@') FROM `‚s‚P‚P`; +SELECT INSERT(`‚b‚P`,2,3,'@@@') FROM `‚s‚P‚P`; +SELECT INSERT(`‚b‚P`,2,4,'@@@@') FROM `‚s‚P‚P`; +SELECT INSERT(`‚b‚P`,3,1,'@') FROM `‚s‚P‚P`; +SELECT INSERT(`‚b‚P`,3,2,'@@') FROM `‚s‚P‚P`; +SELECT INSERT(`‚b‚P`,3,3,'@@@') FROM `‚s‚P‚P`; +SELECT INSERT(`‚b‚P`,4,1,'@') FROM `‚s‚P‚P`; +SELECT INSERT(`‚b‚P`,4,2,'@@') FROM `‚s‚P‚P`; +SELECT INSERT(`‚b‚P`,5,1,'@') FROM `‚s‚P‚P`; +SELECT INSERT(`‚b‚P`,1,1,'”\') FROM `‚s‚P‚Q`; +SELECT INSERT(`‚b‚P`,1,2,'”\”\') FROM `‚s‚P‚Q`; +SELECT INSERT(`‚b‚P`,1,3,'”\”\”\') FROM `‚s‚P‚Q`; +SELECT INSERT(`‚b‚P`,1,4,'”\”\”\”\') FROM `‚s‚P‚Q`; +SELECT INSERT(`‚b‚P`,1,5,'”\”\”\”\”\') FROM `‚s‚P‚Q`; +SELECT INSERT(`‚b‚P`,2,1,'”\') FROM `‚s‚P‚Q`; +SELECT INSERT(`‚b‚P`,2,2,'”\”\') FROM `‚s‚P‚Q`; +SELECT INSERT(`‚b‚P`,2,3,'”\”\”\') FROM `‚s‚P‚Q`; +SELECT INSERT(`‚b‚P`,2,4,'”\”\”\”\') FROM `‚s‚P‚Q`; +SELECT INSERT(`‚b‚P`,3,1,'”\') FROM `‚s‚P‚Q`; +SELECT INSERT(`‚b‚P`,3,2,'”\”\') FROM `‚s‚P‚Q`; +SELECT INSERT(`‚b‚P`,3,3,'”\”\”\') FROM `‚s‚P‚Q`; +SELECT INSERT(`‚b‚P`,4,1,'”\') FROM `‚s‚P‚Q`; +SELECT INSERT(`‚b‚P`,4,2,'”\”\') FROM `‚s‚P‚Q`; +SELECT INSERT(`‚b‚P`,5,1,'”\') FROM `‚s‚P‚Q`; + +DROP TABLE `‚s‚P`; +DROP TABLE `‚s‚Q`; +DROP TABLE `‚s‚R`; +DROP TABLE `‚s‚S`; +DROP TABLE `‚s‚T`; +DROP TABLE `‚s‚U`; +DROP TABLE `‚s‚V`; +DROP TABLE `‚s‚W`; +DROP TABLE `‚s‚X`; +DROP TABLE `‚s‚P‚O`; +DROP TABLE `‚s‚P‚P`; +DROP TABLE `‚s‚P‚Q`; diff --git a/mysql-test/suite/jp/t/jp_insert_ucs2.test b/mysql-test/suite/jp/t/jp_insert_ucs2.test new file mode 100755 index 00000000000..9b0a02e57d8 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_insert_ucs2.test @@ -0,0 +1,356 @@ +--source include/have_ucs2.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +--enable_warnings + +# +# Test INSERT() function with Japanese characters in ucs2 encoding +# + +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; + +CREATE TABLE `£Ô£±` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = bdb; + +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'); + +#InnoDB +SELECT INSERT(`£Ã£±`,1,1,'޶') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,1,2,'޶޶') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,1,3,'޶޶޶') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,1,4,'޶޶޶޶') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,1,5,'޶޶޶޶޶') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,2,1,'޶') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,2,2,'޶޶') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,2,3,'޶޶޶') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,2,4,'޶޶޶޶') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,3,1,'޶') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,3,2,'޶޶') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,3,3,'޶޶޶') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,4,1,'޶') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,4,2,'޶޶') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,5,1,'޶') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,1,1,' ') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,1,2,' ') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,1,3,' ') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,1,4,' ') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,1,5,' ') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,2,1,' ') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,2,2,' ') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,2,3,' ') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,2,4,' ') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,3,1,' ') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,3,2,' ') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,3,3,' ') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,4,1,' ') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,4,2,' ') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,5,1,' ') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,1,1,'¤«') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,1,2,'¤«¤«') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,1,3,'¤«¤«¤«') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,1,4,'¤«¤«¤«¤«') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,1,5,'¤«¤«¤«¤«¤«') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,2,1,'¤«') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,2,2,'¤«¤«') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,2,3,'¤«¤«¤«') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,2,4,'¤«¤«¤«¤«') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,3,1,'¤«') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,3,2,'¤«¤«') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,3,3,'¤«¤«¤«') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,4,1,'¤«') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,4,2,'¤«¤«') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,5,1,'¤«') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,1,1,'¡¡') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,1,2,'¡¡¡¡') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,1,3,'¡¡¡¡¡¡') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,1,4,'¡¡¡¡¡¡¡¡') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,1,5,'¡¡¡¡¡¡¡¡¡¡') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,2,1,'¡¡') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,2,2,'¡¡¡¡') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,2,3,'¡¡¡¡¡¡') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,2,4,'¡¡¡¡¡¡¡¡') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,3,1,'¡¡') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,3,2,'¡¡¡¡') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,3,3,'¡¡¡¡¡¡') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,4,1,'¡¡') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,4,2,'¡¡¡¡') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,5,1,'¡¡') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,1,1,'°¡') FROM `£Ô£³`; +SELECT INSERT(`£Ã£±`,1,2,'°¡°¡' ) FROM `£Ô£³`; +SELECT INSERT(`£Ã£±`,1,3,'°¡°¡°¡' ) FROM `£Ô£³`; +SELECT INSERT(`£Ã£±`,1,4,'°¡°¡°¡°¡' ) FROM `£Ô£³`; +SELECT INSERT(`£Ã£±`,1,5,'°¡°¡°¡°¡°¡' ) FROM `£Ô£³`; +SELECT INSERT(`£Ã£±`,2,1,'°¡') FROM `£Ô£³`; +SELECT INSERT(`£Ã£±`,2,2,'°¡°¡' ) FROM `£Ô£³`; +SELECT INSERT(`£Ã£±`,2,3,'°¡°¡°¡' ) FROM `£Ô£³`; +SELECT INSERT(`£Ã£±`,2,4,'°¡°¡°¡°¡' ) FROM `£Ô£³`; +SELECT INSERT(`£Ã£±`,3,1,'°¡') FROM `£Ô£³`; +SELECT INSERT(`£Ã£±`,3,2,'°¡°¡' ) FROM `£Ô£³`; +SELECT INSERT(`£Ã£±`,3,3,'°¡°¡°¡' ) FROM `£Ô£³`; +SELECT INSERT(`£Ã£±`,4,1,'°¡') FROM `£Ô£³`; +SELECT INSERT(`£Ã£±`,4,2,'°¡°¡' ) FROM `£Ô£³`; +SELECT INSERT(`£Ã£±`,5,1,'°¡') FROM `£Ô£³`; + +#MyISAM +SELECT INSERT(`£Ã£±`,1,1,'޶') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,1,2,'޶޶') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,1,3,'޶޶޶') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,1,4,'޶޶޶޶') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,1,5,'޶޶޶޶޶') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,2,1,'޶') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,2,2,'޶޶') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,2,3,'޶޶޶') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,2,4,'޶޶޶޶') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,3,1,'޶') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,3,2,'޶޶') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,3,3,'޶޶޶') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,4,1,'޶') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,4,2,'޶޶') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,5,1,'޶') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,1,1,' ') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,1,2,' ') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,1,3,' ') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,1,4,' ') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,1,5,' ') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,2,1,' ') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,2,2,' ') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,2,3,' ') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,2,4,' ') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,3,1,' ') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,3,2,' ') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,3,3,' ') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,4,1,' ') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,4,2,' ') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,5,1,' ') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,1,1,'¤«') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,1,2,'¤«¤«') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,1,3,'¤«¤«¤«') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,1,4,'¤«¤«¤«¤«') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,1,5,'¤«¤«¤«¤«¤«') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,2,1,'¤«') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,2,2,'¤«¤«') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,2,3,'¤«¤«¤«') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,2,4,'¤«¤«¤«¤«') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,3,1,'¤«') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,3,2,'¤«¤«') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,3,3,'¤«¤«¤«') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,4,1,'¤«') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,4,2,'¤«¤«') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,5,1,'¤«') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,1,1,'¡¡') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,1,2,'¡¡¡¡') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,1,3,'¡¡¡¡¡¡') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,1,4,'¡¡¡¡¡¡¡¡') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,1,5,'¡¡¡¡¡¡¡¡¡¡') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,2,1,'¡¡') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,2,2,'¡¡¡¡') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,2,3,'¡¡¡¡¡¡') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,2,4,'¡¡¡¡¡¡¡¡') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,3,1,'¡¡') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,3,2,'¡¡¡¡') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,3,3,'¡¡¡¡¡¡') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,4,1,'¡¡') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,4,2,'¡¡¡¡') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,5,1,'¡¡') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,1,1,'°¡') FROM `£Ô£¶`; +SELECT INSERT(`£Ã£±`,1,2,'°¡°¡' ) FROM `£Ô£¶`; +SELECT INSERT(`£Ã£±`,1,3,'°¡°¡°¡' ) FROM `£Ô£¶`; +SELECT INSERT(`£Ã£±`,1,4,'°¡°¡°¡°¡' ) FROM `£Ô£¶`; +SELECT INSERT(`£Ã£±`,1,5,'°¡°¡°¡°¡°¡' ) FROM `£Ô£¶`; +SELECT INSERT(`£Ã£±`,2,1,'°¡') FROM `£Ô£¶`; +SELECT INSERT(`£Ã£±`,2,2,'°¡°¡') FROM `£Ô£¶`; +SELECT INSERT(`£Ã£±`,2,3,'°¡°¡°¡' ) FROM `£Ô£¶`; +SELECT INSERT(`£Ã£±`,2,4,'°¡°¡°¡°¡' ) FROM `£Ô£¶`; +SELECT INSERT(`£Ã£±`,3,1,'°¡') FROM `£Ô£¶`; +SELECT INSERT(`£Ã£±`,3,2,'°¡°¡' ) FROM `£Ô£¶`; +SELECT INSERT(`£Ã£±`,3,3,'°¡°¡°¡' ) FROM `£Ô£¶`; +SELECT INSERT(`£Ã£±`,4,1,'°¡') FROM `£Ô£¶`; +SELECT INSERT(`£Ã£±`,4,2,'°¡°¡' ) FROM `£Ô£¶`; +SELECT INSERT(`£Ã£±`,5,1,'°¡') FROM `£Ô£¶`; + +#HEAP +SELECT INSERT(`£Ã£±`,1,1,'޶') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,1,2,'޶޶') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,1,3,'޶޶޶') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,1,4,'޶޶޶޶') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,1,5,'޶޶޶޶޶') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,2,1,'޶') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,2,2,'޶޶') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,2,3,'޶޶޶') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,2,4,'޶޶޶޶') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,3,1,'޶') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,3,2,'޶޶') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,3,3,'޶޶޶') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,4,1,'޶') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,4,2,'޶޶') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,5,1,'޶') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,1,1,' ') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,1,2,' ') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,1,3,' ') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,1,4,' ') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,1,5,' ') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,2,1,' ') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,2,2,' ') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,2,3,' ') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,2,4,' ') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,3,1,' ') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,3,2,' ') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,3,3,' ') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,4,1,' ') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,4,2,' ') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,5,1,' ') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,1,1,'¤«') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,1,2,'¤«¤«') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,1,3,'¤«¤«¤«') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,1,4,'¤«¤«¤«¤«') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,1,5,'¤«¤«¤«¤«¤«') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,2,1,'¤«') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,2,2,'¤«¤«') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,2,3,'¤«¤«¤«') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,2,4,'¤«¤«¤«¤«') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,3,1,'¤«') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,3,2,'¤«¤«') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,3,3,'¤«¤«¤«') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,4,1,'¤«') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,4,2,'¤«¤«') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,5,1,'¤«') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,1,1,'¡¡') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,1,2,'¡¡¡¡') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,1,3,'¡¡¡¡¡¡') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,1,4,'¡¡¡¡¡¡¡¡') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,1,5,'¡¡¡¡¡¡¡¡¡¡') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,2,1,'¡¡') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,2,2,'¡¡¡¡') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,2,3,'¡¡¡¡¡¡') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,2,4,'¡¡¡¡¡¡¡¡') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,3,1,'¡¡') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,3,2,'¡¡¡¡') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,3,3,'¡¡¡¡¡¡') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,4,1,'¡¡') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,4,2,'¡¡¡¡') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,5,1,'¡¡') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,1,1,'°¡') FROM `£Ô£¹`; +SELECT INSERT(`£Ã£±`,1,2,'°¡°¡' ) FROM `£Ô£¹`; +SELECT INSERT(`£Ã£±`,1,3,'°¡°¡°¡' ) FROM `£Ô£¹`; +SELECT INSERT(`£Ã£±`,1,4,'°¡°¡°¡°¡' ) FROM `£Ô£¹`; +SELECT INSERT(`£Ã£±`,1,5,'°¡°¡°¡°¡°¡' ) FROM `£Ô£¹`; +SELECT INSERT(`£Ã£±`,2,1,'°¡') FROM `£Ô£¹`; +SELECT INSERT(`£Ã£±`,2,2,'°¡°¡' ) FROM `£Ô£¹`; +SELECT INSERT(`£Ã£±`,2,3,'°¡°¡°¡' ) FROM `£Ô£¹`; +SELECT INSERT(`£Ã£±`,2,4,'°¡°¡°¡°¡' ) FROM `£Ô£¹`; +SELECT INSERT(`£Ã£±`,3,1,'°¡') FROM `£Ô£¹`; +SELECT INSERT(`£Ã£±`,3,2,'°¡°¡' ) FROM `£Ô£¹`; +SELECT INSERT(`£Ã£±`,3,3,'°¡°¡°¡' ) FROM `£Ô£¹`; +SELECT INSERT(`£Ã£±`,4,1,'°¡') FROM `£Ô£¹`; +SELECT INSERT(`£Ã£±`,4,2,'°¡°¡' ) FROM `£Ô£¹`; +SELECT INSERT(`£Ã£±`,5,1,'°¡') FROM `£Ô£¹`; + +#BDB +SELECT INSERT(`£Ã£±`,1,1,'޶') FROM `£Ô£±£°`; +SELECT INSERT(`£Ã£±`,1,2,'޶޶') FROM `£Ô£±£°`; +SELECT INSERT(`£Ã£±`,1,3,'޶޶޶') FROM `£Ô£±£°`; +SELECT INSERT(`£Ã£±`,1,4,'޶޶޶޶') FROM `£Ô£±£°`; +SELECT INSERT(`£Ã£±`,1,5,'޶޶޶޶޶') FROM `£Ô£±£°`; +SELECT INSERT(`£Ã£±`,2,1,'޶') FROM `£Ô£±£°`; +SELECT INSERT(`£Ã£±`,2,2,'޶޶') FROM `£Ô£±£°`; +SELECT INSERT(`£Ã£±`,2,3,'޶޶޶') FROM `£Ô£±£°`; +SELECT INSERT(`£Ã£±`,2,4,'޶޶޶޶') FROM `£Ô£±£°`; +SELECT INSERT(`£Ã£±`,3,1,'޶') FROM `£Ô£±£°`; +SELECT INSERT(`£Ã£±`,3,2,'޶޶') FROM `£Ô£±£°`; +SELECT INSERT(`£Ã£±`,3,3,'޶޶޶') FROM `£Ô£±£°`; +SELECT INSERT(`£Ã£±`,4,1,'޶') FROM `£Ô£±£°`; +SELECT INSERT(`£Ã£±`,4,2,'޶޶') FROM `£Ô£±£°`; +SELECT INSERT(`£Ã£±`,5,1,'޶') FROM `£Ô£±£°`; +SELECT INSERT(`£Ã£±`,1,1,'¤«') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,1,2,'¤«¤«') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,1,3,'¤«¤«¤«') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,1,4,'¤«¤«¤«¤«') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,1,5,'¤«¤«¤«¤«¤«') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,2,1,'¤«') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,2,2,'¤«¤«') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,2,3,'¤«¤«¤«') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,2,4,'¤«¤«¤«¤«') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,3,1,'¤«') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,3,2,'¤«¤«') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,3,3,'¤«¤«¤«') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,4,1,'¤«') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,4,2,'¤«¤«') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,5,1,'¤«') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,1,1,'¡¡') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,1,2,'¡¡¡¡') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,1,3,'¡¡¡¡¡¡') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,1,4,'¡¡¡¡¡¡¡¡') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,1,5,'¡¡¡¡¡¡¡¡¡¡') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,2,1,'¡¡') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,2,2,'¡¡¡¡') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,2,3,'¡¡¡¡¡¡') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,2,4,'¡¡¡¡¡¡¡¡') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,3,1,'¡¡') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,3,2,'¡¡¡¡') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,3,3,'¡¡¡¡¡¡') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,4,1,'¡¡') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,4,2,'¡¡¡¡') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,5,1,'¡¡') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,1,1,'°¡') FROM `£Ô£±£²`; +SELECT INSERT(`£Ã£±`,1,2,'°¡°¡') FROM `£Ô£±£²`; +SELECT INSERT(`£Ã£±`,1,3,'°¡°¡°¡') FROM `£Ô£±£²`; +SELECT INSERT(`£Ã£±`,1,4,'°¡°¡°¡°¡') FROM `£Ô£±£²`; +SELECT INSERT(`£Ã£±`,1,5,'°¡°¡°¡°¡°¡') FROM `£Ô£±£²`; +SELECT INSERT(`£Ã£±`,2,1,'°¡') FROM `£Ô£±£²`; +SELECT INSERT(`£Ã£±`,2,2,'°¡°¡') FROM `£Ô£±£²`; +SELECT INSERT(`£Ã£±`,2,3,'°¡°¡°¡') FROM `£Ô£±£²`; +SELECT INSERT(`£Ã£±`,2,4,'°¡°¡°¡°¡') FROM `£Ô£±£²`; +SELECT INSERT(`£Ã£±`,3,1,'°¡') FROM `£Ô£±£²`; +SELECT INSERT(`£Ã£±`,3,2,'°¡°¡') FROM `£Ô£±£²`; +SELECT INSERT(`£Ã£±`,3,3,'°¡°¡°¡') FROM `£Ô£±£²`; +SELECT INSERT(`£Ã£±`,4,1,'°¡') FROM `£Ô£±£²`; +SELECT INSERT(`£Ã£±`,4,2,'°¡°¡') FROM `£Ô£±£²`; +SELECT INSERT(`£Ã£±`,5,1,'°¡') FROM `£Ô£±£²`; + +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/t/jp_insert_ujis.test b/mysql-test/suite/jp/t/jp_insert_ujis.test new file mode 100755 index 00000000000..7b6d2838386 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_insert_ujis.test @@ -0,0 +1,356 @@ +--source include/have_ujis.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +--enable_warnings + +# +# Test INSERT() function with Japanese characters in ujis encoding +# + +SET NAMES ujis; +SET character_set_database = ujis; +SET collation_connection = ujis_japanese_ci; + +CREATE TABLE `£Ô£±` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = bdb; + +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'); + +#InnoDB +SELECT INSERT(`£Ã£±`,1,1,'޶') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,1,2,'޶޶') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,1,3,'޶޶޶') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,1,4,'޶޶޶޶') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,1,5,'޶޶޶޶޶') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,2,1,'޶') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,2,2,'޶޶') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,2,3,'޶޶޶') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,2,4,'޶޶޶޶') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,3,1,'޶') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,3,2,'޶޶') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,3,3,'޶޶޶') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,4,1,'޶') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,4,2,'޶޶') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,5,1,'޶') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,1,1,' ') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,1,2,' ') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,1,3,' ') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,1,4,' ') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,1,5,' ') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,2,1,' ') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,2,2,' ') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,2,3,' ') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,2,4,' ') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,3,1,' ') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,3,2,' ') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,3,3,' ') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,4,1,' ') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,4,2,' ') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,5,1,' ') FROM `£Ô£±`; +SELECT INSERT(`£Ã£±`,1,1,'¤«') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,1,2,'¤«¤«') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,1,3,'¤«¤«¤«') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,1,4,'¤«¤«¤«¤«') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,1,5,'¤«¤«¤«¤«¤«') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,2,1,'¤«') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,2,2,'¤«¤«') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,2,3,'¤«¤«¤«') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,2,4,'¤«¤«¤«¤«') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,3,1,'¤«') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,3,2,'¤«¤«') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,3,3,'¤«¤«¤«') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,4,1,'¤«') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,4,2,'¤«¤«') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,5,1,'¤«') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,1,1,'¡¡') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,1,2,'¡¡¡¡') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,1,3,'¡¡¡¡¡¡') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,1,4,'¡¡¡¡¡¡¡¡') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,1,5,'¡¡¡¡¡¡¡¡¡¡') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,2,1,'¡¡') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,2,2,'¡¡¡¡') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,2,3,'¡¡¡¡¡¡') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,2,4,'¡¡¡¡¡¡¡¡') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,3,1,'¡¡') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,3,2,'¡¡¡¡') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,3,3,'¡¡¡¡¡¡') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,4,1,'¡¡') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,4,2,'¡¡¡¡') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,5,1,'¡¡') FROM `£Ô£²`; +SELECT INSERT(`£Ã£±`,1,1,'°¡') FROM `£Ô£³`; +SELECT INSERT(`£Ã£±`,1,2,'°¡°¡' ) FROM `£Ô£³`; +SELECT INSERT(`£Ã£±`,1,3,'°¡°¡°¡' ) FROM `£Ô£³`; +SELECT INSERT(`£Ã£±`,1,4,'°¡°¡°¡°¡' ) FROM `£Ô£³`; +SELECT INSERT(`£Ã£±`,1,5,'°¡°¡°¡°¡°¡' ) FROM `£Ô£³`; +SELECT INSERT(`£Ã£±`,2,1,'°¡') FROM `£Ô£³`; +SELECT INSERT(`£Ã£±`,2,2,'°¡°¡' ) FROM `£Ô£³`; +SELECT INSERT(`£Ã£±`,2,3,'°¡°¡°¡' ) FROM `£Ô£³`; +SELECT INSERT(`£Ã£±`,2,4,'°¡°¡°¡°¡' ) FROM `£Ô£³`; +SELECT INSERT(`£Ã£±`,3,1,'°¡') FROM `£Ô£³`; +SELECT INSERT(`£Ã£±`,3,2,'°¡°¡' ) FROM `£Ô£³`; +SELECT INSERT(`£Ã£±`,3,3,'°¡°¡°¡' ) FROM `£Ô£³`; +SELECT INSERT(`£Ã£±`,4,1,'°¡') FROM `£Ô£³`; +SELECT INSERT(`£Ã£±`,4,2,'°¡°¡' ) FROM `£Ô£³`; +SELECT INSERT(`£Ã£±`,5,1,'°¡') FROM `£Ô£³`; + +#MyISAM +SELECT INSERT(`£Ã£±`,1,1,'޶') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,1,2,'޶޶') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,1,3,'޶޶޶') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,1,4,'޶޶޶޶') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,1,5,'޶޶޶޶޶') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,2,1,'޶') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,2,2,'޶޶') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,2,3,'޶޶޶') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,2,4,'޶޶޶޶') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,3,1,'޶') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,3,2,'޶޶') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,3,3,'޶޶޶') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,4,1,'޶') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,4,2,'޶޶') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,5,1,'޶') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,1,1,' ') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,1,2,' ') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,1,3,' ') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,1,4,' ') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,1,5,' ') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,2,1,' ') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,2,2,' ') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,2,3,' ') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,2,4,' ') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,3,1,' ') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,3,2,' ') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,3,3,' ') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,4,1,' ') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,4,2,' ') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,5,1,' ') FROM `£Ô£´`; +SELECT INSERT(`£Ã£±`,1,1,'¤«') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,1,2,'¤«¤«') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,1,3,'¤«¤«¤«') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,1,4,'¤«¤«¤«¤«') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,1,5,'¤«¤«¤«¤«¤«') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,2,1,'¤«') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,2,2,'¤«¤«') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,2,3,'¤«¤«¤«') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,2,4,'¤«¤«¤«¤«') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,3,1,'¤«') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,3,2,'¤«¤«') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,3,3,'¤«¤«¤«') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,4,1,'¤«') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,4,2,'¤«¤«') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,5,1,'¤«') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,1,1,'¡¡') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,1,2,'¡¡¡¡') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,1,3,'¡¡¡¡¡¡') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,1,4,'¡¡¡¡¡¡¡¡') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,1,5,'¡¡¡¡¡¡¡¡¡¡') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,2,1,'¡¡') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,2,2,'¡¡¡¡') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,2,3,'¡¡¡¡¡¡') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,2,4,'¡¡¡¡¡¡¡¡') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,3,1,'¡¡') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,3,2,'¡¡¡¡') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,3,3,'¡¡¡¡¡¡') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,4,1,'¡¡') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,4,2,'¡¡¡¡') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,5,1,'¡¡') FROM `£Ô£µ`; +SELECT INSERT(`£Ã£±`,1,1,'°¡') FROM `£Ô£¶`; +SELECT INSERT(`£Ã£±`,1,2,'°¡°¡' ) FROM `£Ô£¶`; +SELECT INSERT(`£Ã£±`,1,3,'°¡°¡°¡' ) FROM `£Ô£¶`; +SELECT INSERT(`£Ã£±`,1,4,'°¡°¡°¡°¡' ) FROM `£Ô£¶`; +SELECT INSERT(`£Ã£±`,1,5,'°¡°¡°¡°¡°¡' ) FROM `£Ô£¶`; +SELECT INSERT(`£Ã£±`,2,1,'°¡') FROM `£Ô£¶`; +SELECT INSERT(`£Ã£±`,2,2,'°¡°¡') FROM `£Ô£¶`; +SELECT INSERT(`£Ã£±`,2,3,'°¡°¡°¡' ) FROM `£Ô£¶`; +SELECT INSERT(`£Ã£±`,2,4,'°¡°¡°¡°¡' ) FROM `£Ô£¶`; +SELECT INSERT(`£Ã£±`,3,1,'°¡') FROM `£Ô£¶`; +SELECT INSERT(`£Ã£±`,3,2,'°¡°¡' ) FROM `£Ô£¶`; +SELECT INSERT(`£Ã£±`,3,3,'°¡°¡°¡' ) FROM `£Ô£¶`; +SELECT INSERT(`£Ã£±`,4,1,'°¡') FROM `£Ô£¶`; +SELECT INSERT(`£Ã£±`,4,2,'°¡°¡' ) FROM `£Ô£¶`; +SELECT INSERT(`£Ã£±`,5,1,'°¡') FROM `£Ô£¶`; + +#HEAP +SELECT INSERT(`£Ã£±`,1,1,'޶') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,1,2,'޶޶') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,1,3,'޶޶޶') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,1,4,'޶޶޶޶') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,1,5,'޶޶޶޶޶') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,2,1,'޶') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,2,2,'޶޶') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,2,3,'޶޶޶') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,2,4,'޶޶޶޶') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,3,1,'޶') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,3,2,'޶޶') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,3,3,'޶޶޶') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,4,1,'޶') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,4,2,'޶޶') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,5,1,'޶') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,1,1,' ') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,1,2,' ') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,1,3,' ') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,1,4,' ') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,1,5,' ') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,2,1,' ') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,2,2,' ') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,2,3,' ') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,2,4,' ') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,3,1,' ') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,3,2,' ') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,3,3,' ') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,4,1,' ') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,4,2,' ') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,5,1,' ') FROM `£Ô£·`; +SELECT INSERT(`£Ã£±`,1,1,'¤«') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,1,2,'¤«¤«') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,1,3,'¤«¤«¤«') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,1,4,'¤«¤«¤«¤«') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,1,5,'¤«¤«¤«¤«¤«') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,2,1,'¤«') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,2,2,'¤«¤«') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,2,3,'¤«¤«¤«') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,2,4,'¤«¤«¤«¤«') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,3,1,'¤«') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,3,2,'¤«¤«') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,3,3,'¤«¤«¤«') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,4,1,'¤«') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,4,2,'¤«¤«') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,5,1,'¤«') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,1,1,'¡¡') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,1,2,'¡¡¡¡') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,1,3,'¡¡¡¡¡¡') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,1,4,'¡¡¡¡¡¡¡¡') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,1,5,'¡¡¡¡¡¡¡¡¡¡') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,2,1,'¡¡') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,2,2,'¡¡¡¡') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,2,3,'¡¡¡¡¡¡') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,2,4,'¡¡¡¡¡¡¡¡') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,3,1,'¡¡') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,3,2,'¡¡¡¡') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,3,3,'¡¡¡¡¡¡') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,4,1,'¡¡') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,4,2,'¡¡¡¡') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,5,1,'¡¡') FROM `£Ô£¸`; +SELECT INSERT(`£Ã£±`,1,1,'°¡') FROM `£Ô£¹`; +SELECT INSERT(`£Ã£±`,1,2,'°¡°¡' ) FROM `£Ô£¹`; +SELECT INSERT(`£Ã£±`,1,3,'°¡°¡°¡' ) FROM `£Ô£¹`; +SELECT INSERT(`£Ã£±`,1,4,'°¡°¡°¡°¡' ) FROM `£Ô£¹`; +SELECT INSERT(`£Ã£±`,1,5,'°¡°¡°¡°¡°¡' ) FROM `£Ô£¹`; +SELECT INSERT(`£Ã£±`,2,1,'°¡') FROM `£Ô£¹`; +SELECT INSERT(`£Ã£±`,2,2,'°¡°¡' ) FROM `£Ô£¹`; +SELECT INSERT(`£Ã£±`,2,3,'°¡°¡°¡' ) FROM `£Ô£¹`; +SELECT INSERT(`£Ã£±`,2,4,'°¡°¡°¡°¡' ) FROM `£Ô£¹`; +SELECT INSERT(`£Ã£±`,3,1,'°¡') FROM `£Ô£¹`; +SELECT INSERT(`£Ã£±`,3,2,'°¡°¡' ) FROM `£Ô£¹`; +SELECT INSERT(`£Ã£±`,3,3,'°¡°¡°¡' ) FROM `£Ô£¹`; +SELECT INSERT(`£Ã£±`,4,1,'°¡') FROM `£Ô£¹`; +SELECT INSERT(`£Ã£±`,4,2,'°¡°¡' ) FROM `£Ô£¹`; +SELECT INSERT(`£Ã£±`,5,1,'°¡') FROM `£Ô£¹`; + +#BDB +SELECT INSERT(`£Ã£±`,1,1,'޶') FROM `£Ô£±£°`; +SELECT INSERT(`£Ã£±`,1,2,'޶޶') FROM `£Ô£±£°`; +SELECT INSERT(`£Ã£±`,1,3,'޶޶޶') FROM `£Ô£±£°`; +SELECT INSERT(`£Ã£±`,1,4,'޶޶޶޶') FROM `£Ô£±£°`; +SELECT INSERT(`£Ã£±`,1,5,'޶޶޶޶޶') FROM `£Ô£±£°`; +SELECT INSERT(`£Ã£±`,2,1,'޶') FROM `£Ô£±£°`; +SELECT INSERT(`£Ã£±`,2,2,'޶޶') FROM `£Ô£±£°`; +SELECT INSERT(`£Ã£±`,2,3,'޶޶޶') FROM `£Ô£±£°`; +SELECT INSERT(`£Ã£±`,2,4,'޶޶޶޶') FROM `£Ô£±£°`; +SELECT INSERT(`£Ã£±`,3,1,'޶') FROM `£Ô£±£°`; +SELECT INSERT(`£Ã£±`,3,2,'޶޶') FROM `£Ô£±£°`; +SELECT INSERT(`£Ã£±`,3,3,'޶޶޶') FROM `£Ô£±£°`; +SELECT INSERT(`£Ã£±`,4,1,'޶') FROM `£Ô£±£°`; +SELECT INSERT(`£Ã£±`,4,2,'޶޶') FROM `£Ô£±£°`; +SELECT INSERT(`£Ã£±`,5,1,'޶') FROM `£Ô£±£°`; +SELECT INSERT(`£Ã£±`,1,1,'¤«') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,1,2,'¤«¤«') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,1,3,'¤«¤«¤«') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,1,4,'¤«¤«¤«¤«') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,1,5,'¤«¤«¤«¤«¤«') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,2,1,'¤«') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,2,2,'¤«¤«') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,2,3,'¤«¤«¤«') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,2,4,'¤«¤«¤«¤«') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,3,1,'¤«') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,3,2,'¤«¤«') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,3,3,'¤«¤«¤«') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,4,1,'¤«') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,4,2,'¤«¤«') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,5,1,'¤«') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,1,1,'¡¡') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,1,2,'¡¡¡¡') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,1,3,'¡¡¡¡¡¡') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,1,4,'¡¡¡¡¡¡¡¡') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,1,5,'¡¡¡¡¡¡¡¡¡¡') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,2,1,'¡¡') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,2,2,'¡¡¡¡') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,2,3,'¡¡¡¡¡¡') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,2,4,'¡¡¡¡¡¡¡¡') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,3,1,'¡¡') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,3,2,'¡¡¡¡') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,3,3,'¡¡¡¡¡¡') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,4,1,'¡¡') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,4,2,'¡¡¡¡') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,5,1,'¡¡') FROM `£Ô£±£±`; +SELECT INSERT(`£Ã£±`,1,1,'°¡') FROM `£Ô£±£²`; +SELECT INSERT(`£Ã£±`,1,2,'°¡°¡') FROM `£Ô£±£²`; +SELECT INSERT(`£Ã£±`,1,3,'°¡°¡°¡') FROM `£Ô£±£²`; +SELECT INSERT(`£Ã£±`,1,4,'°¡°¡°¡°¡') FROM `£Ô£±£²`; +SELECT INSERT(`£Ã£±`,1,5,'°¡°¡°¡°¡°¡') FROM `£Ô£±£²`; +SELECT INSERT(`£Ã£±`,2,1,'°¡') FROM `£Ô£±£²`; +SELECT INSERT(`£Ã£±`,2,2,'°¡°¡') FROM `£Ô£±£²`; +SELECT INSERT(`£Ã£±`,2,3,'°¡°¡°¡') FROM `£Ô£±£²`; +SELECT INSERT(`£Ã£±`,2,4,'°¡°¡°¡°¡') FROM `£Ô£±£²`; +SELECT INSERT(`£Ã£±`,3,1,'°¡') FROM `£Ô£±£²`; +SELECT INSERT(`£Ã£±`,3,2,'°¡°¡') FROM `£Ô£±£²`; +SELECT INSERT(`£Ã£±`,3,3,'°¡°¡°¡') FROM `£Ô£±£²`; +SELECT INSERT(`£Ã£±`,4,1,'°¡') FROM `£Ô£±£²`; +SELECT INSERT(`£Ã£±`,4,2,'°¡°¡') FROM `£Ô£±£²`; +SELECT INSERT(`£Ã£±`,5,1,'°¡') FROM `£Ô£±£²`; + +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/t/jp_insert_utf8.test b/mysql-test/suite/jp/t/jp_insert_utf8.test new file mode 100755 index 00000000000..ef6acb90063 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_insert_utf8.test @@ -0,0 +1,353 @@ +--disable_warnings +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +drop table if exists `T11`; +drop table if exists `T12`; +--enable_warnings + +# +# Test INSERT() function with Japanese characters in utf8 encoding +# + +SET NAMES utf8; +SET character_set_database = utf8; + +CREATE TABLE `T1` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T11` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T12` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = bdb; + +INSERT INTO `T1` VALUES ('アイウエオ'); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T3` VALUES ('龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオ'); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオ'); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡'); +INSERT INTO `T1ï¼` VALUES ('アイウエオ'); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T12` VALUES ('龔龖龗龞龡'); + +#InnoDB +SELECT INSERT(`C1`,1,1,'ï½¶') FROM `T1`; +SELECT INSERT(`C1`,1,2,'ï½¶ï½¶') FROM `T1`; +SELECT INSERT(`C1`,1,3,'ï½¶ï½¶ï½¶') FROM `T1`; +SELECT INSERT(`C1`,1,4,'ï½¶ï½¶ï½¶ï½¶') FROM `T1`; +SELECT INSERT(`C1`,1,5,'ï½¶ï½¶ï½¶ï½¶ï½¶') FROM `T1`; +SELECT INSERT(`C1`,2,1,'ï½¶') FROM `T1`; +SELECT INSERT(`C1`,2,2,'ï½¶ï½¶') FROM `T1`; +SELECT INSERT(`C1`,2,3,'ï½¶ï½¶ï½¶') FROM `T1`; +SELECT INSERT(`C1`,2,4,'ï½¶ï½¶ï½¶ï½¶') FROM `T1`; +SELECT INSERT(`C1`,3,1,'ï½¶') FROM `T1`; +SELECT INSERT(`C1`,3,2,'ï½¶ï½¶') FROM `T1`; +SELECT INSERT(`C1`,3,3,'ï½¶ï½¶ï½¶') FROM `T1`; +SELECT INSERT(`C1`,4,1,'ï½¶') FROM `T1`; +SELECT INSERT(`C1`,4,2,'ï½¶ï½¶') FROM `T1`; +SELECT INSERT(`C1`,5,1,'ï½¶') FROM `T1`; +SELECT INSERT(`C1`,1,1,' ') FROM `T1`; +SELECT INSERT(`C1`,1,2,' ') FROM `T1`; +SELECT INSERT(`C1`,1,3,' ') FROM `T1`; +SELECT INSERT(`C1`,1,4,' ') FROM `T1`; +SELECT INSERT(`C1`,1,5,' ') FROM `T1`; +SELECT INSERT(`C1`,2,1,' ') FROM `T1`; +SELECT INSERT(`C1`,2,2,' ') FROM `T1`; +SELECT INSERT(`C1`,2,3,' ') FROM `T1`; +SELECT INSERT(`C1`,2,4,' ') FROM `T1`; +SELECT INSERT(`C1`,3,1,' ') FROM `T1`; +SELECT INSERT(`C1`,3,2,' ') FROM `T1`; +SELECT INSERT(`C1`,3,3,' ') FROM `T1`; +SELECT INSERT(`C1`,4,1,' ') FROM `T1`; +SELECT INSERT(`C1`,4,2,' ') FROM `T1`; +SELECT INSERT(`C1`,5,1,' ') FROM `T1`; +SELECT INSERT(`C1`,1,1,'ã‹') FROM `ï¼´ï¼’`; +SELECT INSERT(`C1`,1,2,'ã‹ã‹') FROM `ï¼´ï¼’`; +SELECT INSERT(`C1`,1,3,'ã‹ã‹ã‹') FROM `ï¼´ï¼’`; +SELECT INSERT(`C1`,1,4,'ã‹ã‹ã‹ã‹') FROM `ï¼´ï¼’`; +SELECT INSERT(`C1`,1,5,'ã‹ã‹ã‹ã‹ã‹') FROM `ï¼´ï¼’`; +SELECT INSERT(`C1`,2,1,'ã‹') FROM `ï¼´ï¼’`; +SELECT INSERT(`C1`,2,2,'ã‹ã‹') FROM `ï¼´ï¼’`; +SELECT INSERT(`C1`,2,3,'ã‹ã‹ã‹') FROM `ï¼´ï¼’`; +SELECT INSERT(`C1`,2,4,'ã‹ã‹ã‹ã‹') FROM `ï¼´ï¼’`; +SELECT INSERT(`C1`,3,1,'ã‹') FROM `ï¼´ï¼’`; +SELECT INSERT(`C1`,3,2,'ã‹ã‹') FROM `ï¼´ï¼’`; +SELECT INSERT(`C1`,3,3,'ã‹ã‹ã‹') FROM `ï¼´ï¼’`; +SELECT INSERT(`C1`,4,1,'ã‹') FROM `ï¼´ï¼’`; +SELECT INSERT(`C1`,4,2,'ã‹ã‹') FROM `ï¼´ï¼’`; +SELECT INSERT(`C1`,5,1,'ã‹') FROM `ï¼´ï¼’`; +SELECT INSERT(`C1`,1,1,' ') FROM `ï¼´ï¼’`; +SELECT INSERT(`C1`,1,2,'  ') FROM `ï¼´ï¼’`; +SELECT INSERT(`C1`,1,3,'   ') FROM `ï¼´ï¼’`; +SELECT INSERT(`C1`,1,4,'    ') FROM `ï¼´ï¼’`; +SELECT INSERT(`C1`,1,5,'     ') FROM `ï¼´ï¼’`; +SELECT INSERT(`C1`,2,1,' ') FROM `ï¼´ï¼’`; +SELECT INSERT(`C1`,2,2,'  ') FROM `ï¼´ï¼’`; +SELECT INSERT(`C1`,2,3,'   ') FROM `ï¼´ï¼’`; +SELECT INSERT(`C1`,2,4,'    ') FROM `ï¼´ï¼’`; +SELECT INSERT(`C1`,3,1,' ') FROM `ï¼´ï¼’`; +SELECT INSERT(`C1`,3,2,'  ') FROM `ï¼´ï¼’`; +SELECT INSERT(`C1`,3,3,'   ') FROM `ï¼´ï¼’`; +SELECT INSERT(`C1`,4,1,' ') FROM `ï¼´ï¼’`; +SELECT INSERT(`C1`,4,2,'  ') FROM `ï¼´ï¼’`; +SELECT INSERT(`C1`,5,1,' ') FROM `ï¼´ï¼’`; +SELECT INSERT(`C1`,1,1,'丂') FROM `T3`; +SELECT INSERT(`C1`,1,2,'丂丂' ) FROM `T3`; +SELECT INSERT(`C1`,1,3,'丂丂丂' ) FROM `T3`; +SELECT INSERT(`C1`,1,4,'丂丂丂丂' ) FROM `T3`; +SELECT INSERT(`C1`,1,5,'丂丂丂丂丂' ) FROM `T3`; +SELECT INSERT(`C1`,2,1,'丂') FROM `T3`; +SELECT INSERT(`C1`,2,2,'丂丂' ) FROM `T3`; +SELECT INSERT(`C1`,2,3,'丂丂丂' ) FROM `T3`; +SELECT INSERT(`C1`,2,4,'丂丂丂丂' ) FROM `T3`; +SELECT INSERT(`C1`,3,1,'丂') FROM `T3`; +SELECT INSERT(`C1`,3,2,'丂丂' ) FROM `T3`; +SELECT INSERT(`C1`,3,3,'丂丂丂' ) FROM `T3`; +SELECT INSERT(`C1`,4,1,'丂') FROM `T3`; +SELECT INSERT(`C1`,4,2,'丂丂' ) FROM `T3`; +SELECT INSERT(`C1`,5,1,'丂') FROM `T3`; + +#MyISAM +SELECT INSERT(`C1`,1,1,'ï½¶') FROM `ï¼´ï¼”`; +SELECT INSERT(`C1`,1,2,'ï½¶ï½¶') FROM `ï¼´ï¼”`; +SELECT INSERT(`C1`,1,3,'ï½¶ï½¶ï½¶') FROM `ï¼´ï¼”`; +SELECT INSERT(`C1`,1,4,'ï½¶ï½¶ï½¶ï½¶') FROM `ï¼´ï¼”`; +SELECT INSERT(`C1`,1,5,'ï½¶ï½¶ï½¶ï½¶ï½¶') FROM `ï¼´ï¼”`; +SELECT INSERT(`C1`,2,1,'ï½¶') FROM `ï¼´ï¼”`; +SELECT INSERT(`C1`,2,2,'ï½¶ï½¶') FROM `ï¼´ï¼”`; +SELECT INSERT(`C1`,2,3,'ï½¶ï½¶ï½¶') FROM `ï¼´ï¼”`; +SELECT INSERT(`C1`,2,4,'ï½¶ï½¶ï½¶ï½¶') FROM `ï¼´ï¼”`; +SELECT INSERT(`C1`,3,1,'ï½¶') FROM `ï¼´ï¼”`; +SELECT INSERT(`C1`,3,2,'ï½¶ï½¶') FROM `ï¼´ï¼”`; +SELECT INSERT(`C1`,3,3,'ï½¶ï½¶ï½¶') FROM `ï¼´ï¼”`; +SELECT INSERT(`C1`,4,1,'ï½¶') FROM `ï¼´ï¼”`; +SELECT INSERT(`C1`,4,2,'ï½¶ï½¶') FROM `ï¼´ï¼”`; +SELECT INSERT(`C1`,5,1,'ï½¶') FROM `ï¼´ï¼”`; +SELECT INSERT(`C1`,1,1,' ') FROM `ï¼´ï¼”`; +SELECT INSERT(`C1`,1,2,' ') FROM `ï¼´ï¼”`; +SELECT INSERT(`C1`,1,3,' ') FROM `ï¼´ï¼”`; +SELECT INSERT(`C1`,1,4,' ') FROM `ï¼´ï¼”`; +SELECT INSERT(`C1`,1,5,' ') FROM `ï¼´ï¼”`; +SELECT INSERT(`C1`,2,1,' ') FROM `ï¼´ï¼”`; +SELECT INSERT(`C1`,2,2,' ') FROM `ï¼´ï¼”`; +SELECT INSERT(`C1`,2,3,' ') FROM `ï¼´ï¼”`; +SELECT INSERT(`C1`,2,4,' ') FROM `ï¼´ï¼”`; +SELECT INSERT(`C1`,3,1,' ') FROM `ï¼´ï¼”`; +SELECT INSERT(`C1`,3,2,' ') FROM `ï¼´ï¼”`; +SELECT INSERT(`C1`,3,3,' ') FROM `ï¼´ï¼”`; +SELECT INSERT(`C1`,4,1,' ') FROM `ï¼´ï¼”`; +SELECT INSERT(`C1`,4,2,' ') FROM `ï¼´ï¼”`; +SELECT INSERT(`C1`,5,1,' ') FROM `ï¼´ï¼”`; +SELECT INSERT(`C1`,1,1,'ã‹') FROM `T5`; +SELECT INSERT(`C1`,1,2,'ã‹ã‹') FROM `T5`; +SELECT INSERT(`C1`,1,3,'ã‹ã‹ã‹') FROM `T5`; +SELECT INSERT(`C1`,1,4,'ã‹ã‹ã‹ã‹') FROM `T5`; +SELECT INSERT(`C1`,1,5,'ã‹ã‹ã‹ã‹ã‹') FROM `T5`; +SELECT INSERT(`C1`,2,1,'ã‹') FROM `T5`; +SELECT INSERT(`C1`,2,2,'ã‹ã‹') FROM `T5`; +SELECT INSERT(`C1`,2,3,'ã‹ã‹ã‹') FROM `T5`; +SELECT INSERT(`C1`,2,4,'ã‹ã‹ã‹ã‹') FROM `T5`; +SELECT INSERT(`C1`,3,1,'ã‹') FROM `T5`; +SELECT INSERT(`C1`,3,2,'ã‹ã‹') FROM `T5`; +SELECT INSERT(`C1`,3,3,'ã‹ã‹ã‹') FROM `T5`; +SELECT INSERT(`C1`,4,1,'ã‹') FROM `T5`; +SELECT INSERT(`C1`,4,2,'ã‹ã‹') FROM `T5`; +SELECT INSERT(`C1`,5,1,'ã‹') FROM `T5`; +SELECT INSERT(`C1`,1,1,' ') FROM `T5`; +SELECT INSERT(`C1`,1,2,'  ') FROM `T5`; +SELECT INSERT(`C1`,1,3,'   ') FROM `T5`; +SELECT INSERT(`C1`,1,4,'    ') FROM `T5`; +SELECT INSERT(`C1`,1,5,'     ') FROM `T5`; +SELECT INSERT(`C1`,2,1,' ') FROM `T5`; +SELECT INSERT(`C1`,2,2,'  ') FROM `T5`; +SELECT INSERT(`C1`,2,3,'   ') FROM `T5`; +SELECT INSERT(`C1`,2,4,'    ') FROM `T5`; +SELECT INSERT(`C1`,3,1,' ') FROM `T5`; +SELECT INSERT(`C1`,3,2,'  ') FROM `T5`; +SELECT INSERT(`C1`,3,3,'   ') FROM `T5`; +SELECT INSERT(`C1`,4,1,' ') FROM `T5`; +SELECT INSERT(`C1`,4,2,'  ') FROM `T5`; +SELECT INSERT(`C1`,5,1,' ') FROM `T5`; +SELECT INSERT(`C1`,1,1,'丂') FROM `ï¼´ï¼–`; +SELECT INSERT(`C1`,1,2,'丂丂' ) FROM `ï¼´ï¼–`; +SELECT INSERT(`C1`,1,3,'丂丂丂' ) FROM `ï¼´ï¼–`; +SELECT INSERT(`C1`,1,4,'丂丂丂丂' ) FROM `ï¼´ï¼–`; +SELECT INSERT(`C1`,1,5,'丂丂丂丂丂' ) FROM `ï¼´ï¼–`; +SELECT INSERT(`C1`,2,1,'丂') FROM `ï¼´ï¼–`; +SELECT INSERT(`C1`,2,2,'丂丂') FROM `ï¼´ï¼–`; +SELECT INSERT(`C1`,2,3,'丂丂丂' ) FROM `ï¼´ï¼–`; +SELECT INSERT(`C1`,2,4,'丂丂丂丂' ) FROM `ï¼´ï¼–`; +SELECT INSERT(`C1`,3,1,'丂') FROM `ï¼´ï¼–`; +SELECT INSERT(`C1`,3,2,'丂丂' ) FROM `ï¼´ï¼–`; +SELECT INSERT(`C1`,3,3,'丂丂丂' ) FROM `ï¼´ï¼–`; +SELECT INSERT(`C1`,4,1,'丂') FROM `ï¼´ï¼–`; +SELECT INSERT(`C1`,4,2,'丂丂' ) FROM `ï¼´ï¼–`; +SELECT INSERT(`C1`,5,1,'丂') FROM `ï¼´ï¼–`; + +#HEAP +SELECT INSERT(`C1`,1,1,'ï½¶') FROM `ï¼´ï¼—`; +SELECT INSERT(`C1`,1,2,'ï½¶ï½¶') FROM `ï¼´ï¼—`; +SELECT INSERT(`C1`,1,3,'ï½¶ï½¶ï½¶') FROM `ï¼´ï¼—`; +SELECT INSERT(`C1`,1,4,'ï½¶ï½¶ï½¶ï½¶') FROM `ï¼´ï¼—`; +SELECT INSERT(`C1`,1,5,'ï½¶ï½¶ï½¶ï½¶ï½¶') FROM `ï¼´ï¼—`; +SELECT INSERT(`C1`,2,1,'ï½¶') FROM `ï¼´ï¼—`; +SELECT INSERT(`C1`,2,2,'ï½¶ï½¶') FROM `ï¼´ï¼—`; +SELECT INSERT(`C1`,2,3,'ï½¶ï½¶ï½¶') FROM `ï¼´ï¼—`; +SELECT INSERT(`C1`,2,4,'ï½¶ï½¶ï½¶ï½¶') FROM `ï¼´ï¼—`; +SELECT INSERT(`C1`,3,1,'ï½¶') FROM `ï¼´ï¼—`; +SELECT INSERT(`C1`,3,2,'ï½¶ï½¶') FROM `ï¼´ï¼—`; +SELECT INSERT(`C1`,3,3,'ï½¶ï½¶ï½¶') FROM `ï¼´ï¼—`; +SELECT INSERT(`C1`,4,1,'ï½¶') FROM `ï¼´ï¼—`; +SELECT INSERT(`C1`,4,2,'ï½¶ï½¶') FROM `ï¼´ï¼—`; +SELECT INSERT(`C1`,5,1,'ï½¶') FROM `ï¼´ï¼—`; +SELECT INSERT(`C1`,1,1,' ') FROM `ï¼´ï¼—`; +SELECT INSERT(`C1`,1,2,' ') FROM `ï¼´ï¼—`; +SELECT INSERT(`C1`,1,3,' ') FROM `ï¼´ï¼—`; +SELECT INSERT(`C1`,1,4,' ') FROM `ï¼´ï¼—`; +SELECT INSERT(`C1`,1,5,' ') FROM `ï¼´ï¼—`; +SELECT INSERT(`C1`,2,1,' ') FROM `ï¼´ï¼—`; +SELECT INSERT(`C1`,2,2,' ') FROM `ï¼´ï¼—`; +SELECT INSERT(`C1`,2,3,' ') FROM `ï¼´ï¼—`; +SELECT INSERT(`C1`,2,4,' ') FROM `ï¼´ï¼—`; +SELECT INSERT(`C1`,3,1,' ') FROM `ï¼´ï¼—`; +SELECT INSERT(`C1`,3,2,' ') FROM `ï¼´ï¼—`; +SELECT INSERT(`C1`,3,3,' ') FROM `ï¼´ï¼—`; +SELECT INSERT(`C1`,4,1,' ') FROM `ï¼´ï¼—`; +SELECT INSERT(`C1`,4,2,' ') FROM `ï¼´ï¼—`; +SELECT INSERT(`C1`,5,1,' ') FROM `ï¼´ï¼—`; +SELECT INSERT(`C1`,1,1,'ã‹') FROM `T8`; +SELECT INSERT(`C1`,1,2,'ã‹ã‹') FROM `T8`; +SELECT INSERT(`C1`,1,3,'ã‹ã‹ã‹') FROM `T8`; +SELECT INSERT(`C1`,1,4,'ã‹ã‹ã‹ã‹') FROM `T8`; +SELECT INSERT(`C1`,1,5,'ã‹ã‹ã‹ã‹ã‹') FROM `T8`; +SELECT INSERT(`C1`,2,1,'ã‹') FROM `T8`; +SELECT INSERT(`C1`,2,2,'ã‹ã‹') FROM `T8`; +SELECT INSERT(`C1`,2,3,'ã‹ã‹ã‹') FROM `T8`; +SELECT INSERT(`C1`,2,4,'ã‹ã‹ã‹ã‹') FROM `T8`; +SELECT INSERT(`C1`,3,1,'ã‹') FROM `T8`; +SELECT INSERT(`C1`,3,2,'ã‹ã‹') FROM `T8`; +SELECT INSERT(`C1`,3,3,'ã‹ã‹ã‹') FROM `T8`; +SELECT INSERT(`C1`,4,1,'ã‹') FROM `T8`; +SELECT INSERT(`C1`,4,2,'ã‹ã‹') FROM `T8`; +SELECT INSERT(`C1`,5,1,'ã‹') FROM `T8`; +SELECT INSERT(`C1`,1,1,' ') FROM `T8`; +SELECT INSERT(`C1`,1,2,'  ') FROM `T8`; +SELECT INSERT(`C1`,1,3,'   ') FROM `T8`; +SELECT INSERT(`C1`,1,4,'    ') FROM `T8`; +SELECT INSERT(`C1`,1,5,'     ') FROM `T8`; +SELECT INSERT(`C1`,2,1,' ') FROM `T8`; +SELECT INSERT(`C1`,2,2,'  ') FROM `T8`; +SELECT INSERT(`C1`,2,3,'   ') FROM `T8`; +SELECT INSERT(`C1`,2,4,'    ') FROM `T8`; +SELECT INSERT(`C1`,3,1,' ') FROM `T8`; +SELECT INSERT(`C1`,3,2,'  ') FROM `T8`; +SELECT INSERT(`C1`,3,3,'   ') FROM `T8`; +SELECT INSERT(`C1`,4,1,' ') FROM `T8`; +SELECT INSERT(`C1`,4,2,'  ') FROM `T8`; +SELECT INSERT(`C1`,5,1,' ') FROM `T8`; +SELECT INSERT(`C1`,1,1,'丂') FROM `ï¼´ï¼™`; +SELECT INSERT(`C1`,1,2,'丂丂' ) FROM `ï¼´ï¼™`; +SELECT INSERT(`C1`,1,3,'丂丂丂' ) FROM `ï¼´ï¼™`; +SELECT INSERT(`C1`,1,4,'丂丂丂丂' ) FROM `ï¼´ï¼™`; +SELECT INSERT(`C1`,1,5,'丂丂丂丂丂' ) FROM `ï¼´ï¼™`; +SELECT INSERT(`C1`,2,1,'丂') FROM `ï¼´ï¼™`; +SELECT INSERT(`C1`,2,2,'丂丂' ) FROM `ï¼´ï¼™`; +SELECT INSERT(`C1`,2,3,'丂丂丂' ) FROM `ï¼´ï¼™`; +SELECT INSERT(`C1`,2,4,'丂丂丂丂' ) FROM `ï¼´ï¼™`; +SELECT INSERT(`C1`,3,1,'丂') FROM `ï¼´ï¼™`; +SELECT INSERT(`C1`,3,2,'丂丂' ) FROM `ï¼´ï¼™`; +SELECT INSERT(`C1`,3,3,'丂丂丂' ) FROM `ï¼´ï¼™`; +SELECT INSERT(`C1`,4,1,'丂') FROM `ï¼´ï¼™`; +SELECT INSERT(`C1`,4,2,'丂丂' ) FROM `ï¼´ï¼™`; +SELECT INSERT(`C1`,5,1,'丂') FROM `ï¼´ï¼™`; + +#BDB +SELECT INSERT(`C1`,1,1,'ï½¶') FROM `T1ï¼`; +SELECT INSERT(`C1`,1,2,'ï½¶ï½¶') FROM `T1ï¼`; +SELECT INSERT(`C1`,1,3,'ï½¶ï½¶ï½¶') FROM `T1ï¼`; +SELECT INSERT(`C1`,1,4,'ï½¶ï½¶ï½¶ï½¶') FROM `T1ï¼`; +SELECT INSERT(`C1`,1,5,'ï½¶ï½¶ï½¶ï½¶ï½¶') FROM `T1ï¼`; +SELECT INSERT(`C1`,2,1,'ï½¶') FROM `T1ï¼`; +SELECT INSERT(`C1`,2,2,'ï½¶ï½¶') FROM `T1ï¼`; +SELECT INSERT(`C1`,2,3,'ï½¶ï½¶ï½¶') FROM `T1ï¼`; +SELECT INSERT(`C1`,2,4,'ï½¶ï½¶ï½¶ï½¶') FROM `T1ï¼`; +SELECT INSERT(`C1`,3,1,'ï½¶') FROM `T1ï¼`; +SELECT INSERT(`C1`,3,2,'ï½¶ï½¶') FROM `T1ï¼`; +SELECT INSERT(`C1`,3,3,'ï½¶ï½¶ï½¶') FROM `T1ï¼`; +SELECT INSERT(`C1`,4,1,'ï½¶') FROM `T1ï¼`; +SELECT INSERT(`C1`,4,2,'ï½¶ï½¶') FROM `T1ï¼`; +SELECT INSERT(`C1`,5,1,'ï½¶') FROM `T1ï¼`; +SELECT INSERT(`C1`,1,1,'ã‹') FROM `T11`; +SELECT INSERT(`C1`,1,2,'ã‹ã‹') FROM `T11`; +SELECT INSERT(`C1`,1,3,'ã‹ã‹ã‹') FROM `T11`; +SELECT INSERT(`C1`,1,4,'ã‹ã‹ã‹ã‹') FROM `T11`; +SELECT INSERT(`C1`,1,5,'ã‹ã‹ã‹ã‹ã‹') FROM `T11`; +SELECT INSERT(`C1`,2,1,'ã‹') FROM `T11`; +SELECT INSERT(`C1`,2,2,'ã‹ã‹') FROM `T11`; +SELECT INSERT(`C1`,2,3,'ã‹ã‹ã‹') FROM `T11`; +SELECT INSERT(`C1`,2,4,'ã‹ã‹ã‹ã‹') FROM `T11`; +SELECT INSERT(`C1`,3,1,'ã‹') FROM `T11`; +SELECT INSERT(`C1`,3,2,'ã‹ã‹') FROM `T11`; +SELECT INSERT(`C1`,3,3,'ã‹ã‹ã‹') FROM `T11`; +SELECT INSERT(`C1`,4,1,'ã‹') FROM `T11`; +SELECT INSERT(`C1`,4,2,'ã‹ã‹') FROM `T11`; +SELECT INSERT(`C1`,5,1,'ã‹') FROM `T11`; +SELECT INSERT(`C1`,1,1,' ') FROM `T11`; +SELECT INSERT(`C1`,1,2,'  ') FROM `T11`; +SELECT INSERT(`C1`,1,3,'   ') FROM `T11`; +SELECT INSERT(`C1`,1,4,'    ') FROM `T11`; +SELECT INSERT(`C1`,1,5,'     ') FROM `T11`; +SELECT INSERT(`C1`,2,1,' ') FROM `T11`; +SELECT INSERT(`C1`,2,2,'  ') FROM `T11`; +SELECT INSERT(`C1`,2,3,'   ') FROM `T11`; +SELECT INSERT(`C1`,2,4,'    ') FROM `T11`; +SELECT INSERT(`C1`,3,1,' ') FROM `T11`; +SELECT INSERT(`C1`,3,2,'  ') FROM `T11`; +SELECT INSERT(`C1`,3,3,'   ') FROM `T11`; +SELECT INSERT(`C1`,4,1,' ') FROM `T11`; +SELECT INSERT(`C1`,4,2,'  ') FROM `T11`; +SELECT INSERT(`C1`,5,1,' ') FROM `T11`; +SELECT INSERT(`C1`,1,1,'丂') FROM `T12`; +SELECT INSERT(`C1`,1,2,'丂丂') FROM `T12`; +SELECT INSERT(`C1`,1,3,'丂丂丂') FROM `T12`; +SELECT INSERT(`C1`,1,4,'丂丂丂丂') FROM `T12`; +SELECT INSERT(`C1`,1,5,'丂丂丂丂丂') FROM `T12`; +SELECT INSERT(`C1`,2,1,'丂') FROM `T12`; +SELECT INSERT(`C1`,2,2,'丂丂') FROM `T12`; +SELECT INSERT(`C1`,2,3,'丂丂丂') FROM `T12`; +SELECT INSERT(`C1`,2,4,'丂丂丂丂') FROM `T12`; +SELECT INSERT(`C1`,3,1,'丂') FROM `T12`; +SELECT INSERT(`C1`,3,2,'丂丂') FROM `T12`; +SELECT INSERT(`C1`,3,3,'丂丂丂') FROM `T12`; +SELECT INSERT(`C1`,4,1,'丂') FROM `T12`; +SELECT INSERT(`C1`,4,2,'丂丂') FROM `T12`; +SELECT INSERT(`C1`,5,1,'丂') FROM `T12`; + +DROP TABLE `T1`; +DROP TABLE `ï¼´ï¼’`; +DROP TABLE `T3`; +DROP TABLE `ï¼´ï¼”`; +DROP TABLE `T5`; +DROP TABLE `ï¼´ï¼–`; +DROP TABLE `ï¼´ï¼—`; +DROP TABLE `T8`; +DROP TABLE `ï¼´ï¼™`; +DROP TABLE `T1ï¼`; +DROP TABLE `T11`; +DROP TABLE `T12`; diff --git a/mysql-test/suite/jp/t/jp_instr_sjis.test b/mysql-test/suite/jp/t/jp_instr_sjis.test new file mode 100755 index 00000000000..c19b5f2b14c --- /dev/null +++ b/mysql-test/suite/jp/t/jp_instr_sjis.test @@ -0,0 +1,139 @@ +--character_set sjis +--disable_warnings +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +--enable_warnings + +# +# Test INSTR() function with Japanese characters in sjis encoding +# + +SET NAMES sjis; +SET character_set_database = sjis; + +CREATE TABLE `‚s‚P` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Q` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚R` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚S` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚T` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚U` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚V` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚W` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚X` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚O` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚P` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚Q` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; + +INSERT INTO `‚s‚P` VALUES ('±²³´µ'); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚S` VALUES ('±²³´µ'); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚V` VALUES ('±²³´µ'); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ'); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\'); + +#InnoDB +SELECT INSTR(`‚b‚P`,'±') from `‚s‚P`; +SELECT INSTR(`‚b‚P`,'²') from `‚s‚P`; +SELECT INSTR(`‚b‚P`,'³') from `‚s‚P`; +SELECT INSTR(`‚b‚P`,'´') from `‚s‚P`; +SELECT INSTR(`‚b‚P`,'µ') from `‚s‚P`; +SELECT INSTR(`‚b‚P`,'Ý') from `‚s‚P`; +SELECT INSTR(`‚b‚P`,'‚ ') from `‚s‚Q`; +SELECT INSTR(`‚b‚P`,'‚¢') from `‚s‚Q`; +SELECT INSTR(`‚b‚P`,'‚¤') from `‚s‚Q`; +SELECT INSTR(`‚b‚P`,'‚¦') from `‚s‚Q`; +SELECT INSTR(`‚b‚P`,'‚¨') from `‚s‚Q`; +SELECT INSTR(`‚b‚P`,'‚ñ') from `‚s‚Q`; +SELECT INSTR(`‚b‚P`,'ƒ\') from `‚s‚R`; +SELECT INSTR(`‚b‚P`,'\') from `‚s‚R`; +SELECT INSTR(`‚b‚P`,'•\') from `‚s‚R`; +SELECT INSTR(`‚b‚P`,'—\') from `‚s‚R`; +SELECT INSTR(`‚b‚P`,'\') from `‚s‚R`; +SELECT INSTR(`‚b‚P`,'‰\') from `‚s‚R`; + +#MyISAM +SELECT INSTR(`‚b‚P`,'±') from `‚s‚S`; +SELECT INSTR(`‚b‚P`,'²') from `‚s‚S`; +SELECT INSTR(`‚b‚P`,'³') from `‚s‚S`; +SELECT INSTR(`‚b‚P`,'´') from `‚s‚S`; +SELECT INSTR(`‚b‚P`,'µ') from `‚s‚S`; +SELECT INSTR(`‚b‚P`,'Ý') from `‚s‚S`; +SELECT INSTR(`‚b‚P`,'‚ ') from `‚s‚T`; +SELECT INSTR(`‚b‚P`,'‚¢') from `‚s‚T`; +SELECT INSTR(`‚b‚P`,'‚¤') from `‚s‚T`; +SELECT INSTR(`‚b‚P`,'‚¦') from `‚s‚T`; +SELECT INSTR(`‚b‚P`,'‚¨') from `‚s‚T`; +SELECT INSTR(`‚b‚P`,'‚ñ') from `‚s‚T`; +SELECT INSTR(`‚b‚P`,'ƒ\') from `‚s‚U`; +SELECT INSTR(`‚b‚P`,'\') from `‚s‚U`; +SELECT INSTR(`‚b‚P`,'•\') from `‚s‚U`; +SELECT INSTR(`‚b‚P`,'—\') from `‚s‚U`; +SELECT INSTR(`‚b‚P`,'\') from `‚s‚U`; +SELECT INSTR(`‚b‚P`,'‰\') from `‚s‚U`; + +#HEAP +SELECT INSTR(`‚b‚P`,'±') from `‚s‚V`; +SELECT INSTR(`‚b‚P`,'²') from `‚s‚V`; +SELECT INSTR(`‚b‚P`,'³') from `‚s‚V`; +SELECT INSTR(`‚b‚P`,'´') from `‚s‚V`; +SELECT INSTR(`‚b‚P`,'µ') from `‚s‚V`; +SELECT INSTR(`‚b‚P`,'Ý') from `‚s‚V`; +SELECT INSTR(`‚b‚P`,'‚ ') from `‚s‚W`; +SELECT INSTR(`‚b‚P`,'‚¢') from `‚s‚W`; +SELECT INSTR(`‚b‚P`,'‚¤') from `‚s‚W`; +SELECT INSTR(`‚b‚P`,'‚¦') from `‚s‚W`; +SELECT INSTR(`‚b‚P`,'‚¨') from `‚s‚W`; +SELECT INSTR(`‚b‚P`,'‚ñ') from `‚s‚W`; +SELECT INSTR(`‚b‚P`,'ƒ\') from `‚s‚X`; +SELECT INSTR(`‚b‚P`,'\') from `‚s‚X`; +SELECT INSTR(`‚b‚P`,'•\') from `‚s‚X`; +SELECT INSTR(`‚b‚P`,'—\') from `‚s‚X`; +SELECT INSTR(`‚b‚P`,'\') from `‚s‚X`; +SELECT INSTR(`‚b‚P`,'‰\') from `‚s‚X`; + +#BDB +SELECT INSTR(`‚b‚P`,'±') from `‚s‚P‚O`; +SELECT INSTR(`‚b‚P`,'²') from `‚s‚P‚O`; +SELECT INSTR(`‚b‚P`,'³') from `‚s‚P‚O`; +SELECT INSTR(`‚b‚P`,'´') from `‚s‚P‚O`; +SELECT INSTR(`‚b‚P`,'µ') from `‚s‚P‚O`; +SELECT INSTR(`‚b‚P`,'Ý') from `‚s‚P‚O`; +SELECT INSTR(`‚b‚P`,'‚ ') from `‚s‚P‚P`; +SELECT INSTR(`‚b‚P`,'‚¢') from `‚s‚P‚P`; +SELECT INSTR(`‚b‚P`,'‚¤') from `‚s‚P‚P`; +SELECT INSTR(`‚b‚P`,'‚¦') from `‚s‚P‚P`; +SELECT INSTR(`‚b‚P`,'‚¨') from `‚s‚P‚P`; +SELECT INSTR(`‚b‚P`,'‚ñ') from `‚s‚P‚P`; +SELECT INSTR(`‚b‚P`,'ƒ\') from `‚s‚P‚Q`; +SELECT INSTR(`‚b‚P`,'\') from `‚s‚P‚Q`; +SELECT INSTR(`‚b‚P`,'•\') from `‚s‚P‚Q`; +SELECT INSTR(`‚b‚P`,'—\') from `‚s‚P‚Q`; +SELECT INSTR(`‚b‚P`,'\') from `‚s‚P‚Q`; +SELECT INSTR(`‚b‚P`,'‰\') from `‚s‚P‚Q`; + +DROP TABLE `‚s‚P`; +DROP TABLE `‚s‚Q`; +DROP TABLE `‚s‚R`; +DROP TABLE `‚s‚S`; +DROP TABLE `‚s‚T`; +DROP TABLE `‚s‚U`; +DROP TABLE `‚s‚V`; +DROP TABLE `‚s‚W`; +DROP TABLE `‚s‚X`; +DROP TABLE `‚s‚P‚O`; +DROP TABLE `‚s‚P‚P`; +DROP TABLE `‚s‚P‚Q`; diff --git a/mysql-test/suite/jp/t/jp_instr_ucs2.test b/mysql-test/suite/jp/t/jp_instr_ucs2.test new file mode 100755 index 00000000000..b8f83961e90 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_instr_ucs2.test @@ -0,0 +1,141 @@ +--source include/have_ucs2.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +--enable_warnings + +# +# Test INSTR() function with Japanese characters in ucs2 encoding +# + +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; + +CREATE TABLE `£Ô£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; + +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'); + +#InnoDB +SELECT INSTR(`£Ã£±`,'ޱ') from `£Ô£±`; +SELECT INSTR(`£Ã£±`,'޲') from `£Ô£±`; +SELECT INSTR(`£Ã£±`,'޳') from `£Ô£±`; +SELECT INSTR(`£Ã£±`,'Ž´') from `£Ô£±`; +SELECT INSTR(`£Ã£±`,'޵') from `£Ô£±`; +SELECT INSTR(`£Ã£±`,'ŽÝ') from `£Ô£±`; +SELECT INSTR(`£Ã£±`,'¤¢') from `£Ô£²`; +SELECT INSTR(`£Ã£±`,'¤¤') from `£Ô£²`; +SELECT INSTR(`£Ã£±`,'¤¦') from `£Ô£²`; +SELECT INSTR(`£Ã£±`,'¤¨') from `£Ô£²`; +SELECT INSTR(`£Ã£±`,'¤ª') from `£Ô£²`; +SELECT INSTR(`£Ã£±`,'¤ó') from `£Ô£²`; +SELECT INSTR(`£Ã£±`,'íÜ') from `£Ô£³`; +SELECT INSTR(`£Ã£±`,'íÝ') from `£Ô£³`; +SELECT INSTR(`£Ã£±`,'íÞ') from `£Ô£³`; +SELECT INSTR(`£Ã£±`,'íß') from `£Ô£³`; +SELECT INSTR(`£Ã£±`,'íà') from `£Ô£³`; +SELECT INSTR(`£Ã£±`,'°¡') from `£Ô£³`; + +#MyISAM +SELECT INSTR(`£Ã£±`,'ޱ') from `£Ô£´`; +SELECT INSTR(`£Ã£±`,'޲') from `£Ô£´`; +SELECT INSTR(`£Ã£±`,'޳') from `£Ô£´`; +SELECT INSTR(`£Ã£±`,'Ž´') from `£Ô£´`; +SELECT INSTR(`£Ã£±`,'޵') from `£Ô£´`; +SELECT INSTR(`£Ã£±`,'ŽÝ') from `£Ô£´`; +SELECT INSTR(`£Ã£±`,'¤¢') from `£Ô£µ`; +SELECT INSTR(`£Ã£±`,'¤¤') from `£Ô£µ`; +SELECT INSTR(`£Ã£±`,'¤¦') from `£Ô£µ`; +SELECT INSTR(`£Ã£±`,'¤¨') from `£Ô£µ`; +SELECT INSTR(`£Ã£±`,'¤ª') from `£Ô£µ`; +SELECT INSTR(`£Ã£±`,'¤ó') from `£Ô£µ`; +SELECT INSTR(`£Ã£±`,'íÜ') from `£Ô£¶`; +SELECT INSTR(`£Ã£±`,'íÝ') from `£Ô£¶`; +SELECT INSTR(`£Ã£±`,'íÞ') from `£Ô£¶`; +SELECT INSTR(`£Ã£±`,'íß') from `£Ô£¶`; +SELECT INSTR(`£Ã£±`,'íà') from `£Ô£¶`; +SELECT INSTR(`£Ã£±`,'°¡') from `£Ô£¶`; + +#HEAP +SELECT INSTR(`£Ã£±`,'ޱ') from `£Ô£·`; +SELECT INSTR(`£Ã£±`,'޲') from `£Ô£·`; +SELECT INSTR(`£Ã£±`,'޳') from `£Ô£·`; +SELECT INSTR(`£Ã£±`,'Ž´') from `£Ô£·`; +SELECT INSTR(`£Ã£±`,'޵') from `£Ô£·`; +SELECT INSTR(`£Ã£±`,'ŽÝ') from `£Ô£·`; +SELECT INSTR(`£Ã£±`,'¤¢') from `£Ô£¸`; +SELECT INSTR(`£Ã£±`,'¤¤') from `£Ô£¸`; +SELECT INSTR(`£Ã£±`,'¤¦') from `£Ô£¸`; +SELECT INSTR(`£Ã£±`,'¤¨') from `£Ô£¸`; +SELECT INSTR(`£Ã£±`,'¤ª') from `£Ô£¸`; +SELECT INSTR(`£Ã£±`,'¤ó') from `£Ô£¸`; +SELECT INSTR(`£Ã£±`,'íÜ') from `£Ô£¹`; +SELECT INSTR(`£Ã£±`,'íÝ') from `£Ô£¹`; +SELECT INSTR(`£Ã£±`,'íÞ') from `£Ô£¹`; +SELECT INSTR(`£Ã£±`,'íß') from `£Ô£¹`; +SELECT INSTR(`£Ã£±`,'íà') from `£Ô£¹`; +SELECT INSTR(`£Ã£±`,'°¡') from `£Ô£¹`; + +#BDB +SELECT INSTR(`£Ã£±`,'ޱ') from `£Ô£±£°`; +SELECT INSTR(`£Ã£±`,'޲') from `£Ô£±£°`; +SELECT INSTR(`£Ã£±`,'޳') from `£Ô£±£°`; +SELECT INSTR(`£Ã£±`,'Ž´') from `£Ô£±£°`; +SELECT INSTR(`£Ã£±`,'޵') from `£Ô£±£°`; +SELECT INSTR(`£Ã£±`,'ŽÝ') from `£Ô£±£°`; +SELECT INSTR(`£Ã£±`,'¤¢') from `£Ô£±£±`; +SELECT INSTR(`£Ã£±`,'¤¤') from `£Ô£±£±`; +SELECT INSTR(`£Ã£±`,'¤¦') from `£Ô£±£±`; +SELECT INSTR(`£Ã£±`,'¤¨') from `£Ô£±£±`; +SELECT INSTR(`£Ã£±`,'¤ª') from `£Ô£±£±`; +SELECT INSTR(`£Ã£±`,'¤ó') from `£Ô£±£±`; +SELECT INSTR(`£Ã£±`,'íÜ') from `£Ô£±£²`; +SELECT INSTR(`£Ã£±`,'íÝ') from `£Ô£±£²`; +SELECT INSTR(`£Ã£±`,'íÞ') from `£Ô£±£²`; +SELECT INSTR(`£Ã£±`,'íß') from `£Ô£±£²`; +SELECT INSTR(`£Ã£±`,'íà') from `£Ô£±£²`; +SELECT INSTR(`£Ã£±`,'°¡') from `£Ô£±£²`; + +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/t/jp_instr_ujis.test b/mysql-test/suite/jp/t/jp_instr_ujis.test new file mode 100755 index 00000000000..696e1147372 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_instr_ujis.test @@ -0,0 +1,140 @@ +--source include/have_ujis.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +--enable_warnings + +# +# Test INSTR() function with Japanese characters in ujis encoding +# + +SET NAMES ujis; +SET character_set_database = ujis; + +CREATE TABLE `£Ô£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; + +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'); + +#InnoDB +SELECT INSTR(`£Ã£±`,'ޱ') from `£Ô£±`; +SELECT INSTR(`£Ã£±`,'޲') from `£Ô£±`; +SELECT INSTR(`£Ã£±`,'޳') from `£Ô£±`; +SELECT INSTR(`£Ã£±`,'Ž´') from `£Ô£±`; +SELECT INSTR(`£Ã£±`,'޵') from `£Ô£±`; +SELECT INSTR(`£Ã£±`,'ŽÝ') from `£Ô£±`; +SELECT INSTR(`£Ã£±`,'¤¢') from `£Ô£²`; +SELECT INSTR(`£Ã£±`,'¤¤') from `£Ô£²`; +SELECT INSTR(`£Ã£±`,'¤¦') from `£Ô£²`; +SELECT INSTR(`£Ã£±`,'¤¨') from `£Ô£²`; +SELECT INSTR(`£Ã£±`,'¤ª') from `£Ô£²`; +SELECT INSTR(`£Ã£±`,'¤ó') from `£Ô£²`; +SELECT INSTR(`£Ã£±`,'íÜ') from `£Ô£³`; +SELECT INSTR(`£Ã£±`,'íÝ') from `£Ô£³`; +SELECT INSTR(`£Ã£±`,'íÞ') from `£Ô£³`; +SELECT INSTR(`£Ã£±`,'íß') from `£Ô£³`; +SELECT INSTR(`£Ã£±`,'íà') from `£Ô£³`; +SELECT INSTR(`£Ã£±`,'°¡') from `£Ô£³`; + +#MyISAM +SELECT INSTR(`£Ã£±`,'ޱ') from `£Ô£´`; +SELECT INSTR(`£Ã£±`,'޲') from `£Ô£´`; +SELECT INSTR(`£Ã£±`,'޳') from `£Ô£´`; +SELECT INSTR(`£Ã£±`,'Ž´') from `£Ô£´`; +SELECT INSTR(`£Ã£±`,'޵') from `£Ô£´`; +SELECT INSTR(`£Ã£±`,'ŽÝ') from `£Ô£´`; +SELECT INSTR(`£Ã£±`,'¤¢') from `£Ô£µ`; +SELECT INSTR(`£Ã£±`,'¤¤') from `£Ô£µ`; +SELECT INSTR(`£Ã£±`,'¤¦') from `£Ô£µ`; +SELECT INSTR(`£Ã£±`,'¤¨') from `£Ô£µ`; +SELECT INSTR(`£Ã£±`,'¤ª') from `£Ô£µ`; +SELECT INSTR(`£Ã£±`,'¤ó') from `£Ô£µ`; +SELECT INSTR(`£Ã£±`,'íÜ') from `£Ô£¶`; +SELECT INSTR(`£Ã£±`,'íÝ') from `£Ô£¶`; +SELECT INSTR(`£Ã£±`,'íÞ') from `£Ô£¶`; +SELECT INSTR(`£Ã£±`,'íß') from `£Ô£¶`; +SELECT INSTR(`£Ã£±`,'íà') from `£Ô£¶`; +SELECT INSTR(`£Ã£±`,'°¡') from `£Ô£¶`; + +#HEAP +SELECT INSTR(`£Ã£±`,'ޱ') from `£Ô£·`; +SELECT INSTR(`£Ã£±`,'޲') from `£Ô£·`; +SELECT INSTR(`£Ã£±`,'޳') from `£Ô£·`; +SELECT INSTR(`£Ã£±`,'Ž´') from `£Ô£·`; +SELECT INSTR(`£Ã£±`,'޵') from `£Ô£·`; +SELECT INSTR(`£Ã£±`,'ŽÝ') from `£Ô£·`; +SELECT INSTR(`£Ã£±`,'¤¢') from `£Ô£¸`; +SELECT INSTR(`£Ã£±`,'¤¤') from `£Ô£¸`; +SELECT INSTR(`£Ã£±`,'¤¦') from `£Ô£¸`; +SELECT INSTR(`£Ã£±`,'¤¨') from `£Ô£¸`; +SELECT INSTR(`£Ã£±`,'¤ª') from `£Ô£¸`; +SELECT INSTR(`£Ã£±`,'¤ó') from `£Ô£¸`; +SELECT INSTR(`£Ã£±`,'íÜ') from `£Ô£¹`; +SELECT INSTR(`£Ã£±`,'íÝ') from `£Ô£¹`; +SELECT INSTR(`£Ã£±`,'íÞ') from `£Ô£¹`; +SELECT INSTR(`£Ã£±`,'íß') from `£Ô£¹`; +SELECT INSTR(`£Ã£±`,'íà') from `£Ô£¹`; +SELECT INSTR(`£Ã£±`,'°¡') from `£Ô£¹`; + +#BDB +SELECT INSTR(`£Ã£±`,'ޱ') from `£Ô£±£°`; +SELECT INSTR(`£Ã£±`,'޲') from `£Ô£±£°`; +SELECT INSTR(`£Ã£±`,'޳') from `£Ô£±£°`; +SELECT INSTR(`£Ã£±`,'Ž´') from `£Ô£±£°`; +SELECT INSTR(`£Ã£±`,'޵') from `£Ô£±£°`; +SELECT INSTR(`£Ã£±`,'ŽÝ') from `£Ô£±£°`; +SELECT INSTR(`£Ã£±`,'¤¢') from `£Ô£±£±`; +SELECT INSTR(`£Ã£±`,'¤¤') from `£Ô£±£±`; +SELECT INSTR(`£Ã£±`,'¤¦') from `£Ô£±£±`; +SELECT INSTR(`£Ã£±`,'¤¨') from `£Ô£±£±`; +SELECT INSTR(`£Ã£±`,'¤ª') from `£Ô£±£±`; +SELECT INSTR(`£Ã£±`,'¤ó') from `£Ô£±£±`; +SELECT INSTR(`£Ã£±`,'íÜ') from `£Ô£±£²`; +SELECT INSTR(`£Ã£±`,'íÝ') from `£Ô£±£²`; +SELECT INSTR(`£Ã£±`,'íÞ') from `£Ô£±£²`; +SELECT INSTR(`£Ã£±`,'íß') from `£Ô£±£²`; +SELECT INSTR(`£Ã£±`,'íà') from `£Ô£±£²`; +SELECT INSTR(`£Ã£±`,'°¡') from `£Ô£±£²`; + +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/t/jp_instr_utf8.test b/mysql-test/suite/jp/t/jp_instr_utf8.test new file mode 100755 index 00000000000..b25b72bc8d0 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_instr_utf8.test @@ -0,0 +1,138 @@ +--disable_warnings +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +--enable_warnings + +# +# Test INSTR() function with Japanese characters in utf8 encoding +# + +SET NAMES utf8; +SET character_set_database = utf8; + +CREATE TABLE `T1` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T11` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T12` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; + +INSERT INTO `T1` VALUES ('アイウエオ'); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T3` VALUES ('龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオ'); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオ'); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡'); +INSERT INTO `T1ï¼` VALUES ('アイウエオ'); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T12` VALUES ('龔龖龗龞龡'); + +#InnoDB +SELECT INSTR(`C1`,'ï½±') from `T1`; +SELECT INSTR(`C1`,'ï½²') from `T1`; +SELECT INSTR(`C1`,'ï½³') from `T1`; +SELECT INSTR(`C1`,'ï½´') from `T1`; +SELECT INSTR(`C1`,'ï½µ') from `T1`; +SELECT INSTR(`C1`,'ï¾') from `T1`; +SELECT INSTR(`C1`,'ã‚') from `ï¼´ï¼’`; +SELECT INSTR(`C1`,'ã„') from `ï¼´ï¼’`; +SELECT INSTR(`C1`,'ã†') from `ï¼´ï¼’`; +SELECT INSTR(`C1`,'ãˆ') from `ï¼´ï¼’`; +SELECT INSTR(`C1`,'ãŠ') from `ï¼´ï¼’`; +SELECT INSTR(`C1`,'ã‚“') from `ï¼´ï¼’`; +SELECT INSTR(`C1`,'é¾”') from `T3`; +SELECT INSTR(`C1`,'é¾–') from `T3`; +SELECT INSTR(`C1`,'é¾—') from `T3`; +SELECT INSTR(`C1`,'龞') from `T3`; +SELECT INSTR(`C1`,'龡') from `T3`; +SELECT INSTR(`C1`,'丂') from `T3`; + +#MyISAM +SELECT INSTR(`C1`,'ï½±') from `ï¼´ï¼”`; +SELECT INSTR(`C1`,'ï½²') from `ï¼´ï¼”`; +SELECT INSTR(`C1`,'ï½³') from `ï¼´ï¼”`; +SELECT INSTR(`C1`,'ï½´') from `ï¼´ï¼”`; +SELECT INSTR(`C1`,'ï½µ') from `ï¼´ï¼”`; +SELECT INSTR(`C1`,'ï¾') from `ï¼´ï¼”`; +SELECT INSTR(`C1`,'ã‚') from `T5`; +SELECT INSTR(`C1`,'ã„') from `T5`; +SELECT INSTR(`C1`,'ã†') from `T5`; +SELECT INSTR(`C1`,'ãˆ') from `T5`; +SELECT INSTR(`C1`,'ãŠ') from `T5`; +SELECT INSTR(`C1`,'ã‚“') from `T5`; +SELECT INSTR(`C1`,'é¾”') from `ï¼´ï¼–`; +SELECT INSTR(`C1`,'é¾–') from `ï¼´ï¼–`; +SELECT INSTR(`C1`,'é¾—') from `ï¼´ï¼–`; +SELECT INSTR(`C1`,'龞') from `ï¼´ï¼–`; +SELECT INSTR(`C1`,'龡') from `ï¼´ï¼–`; +SELECT INSTR(`C1`,'丂') from `ï¼´ï¼–`; + +#HEAP +SELECT INSTR(`C1`,'ï½±') from `ï¼´ï¼—`; +SELECT INSTR(`C1`,'ï½²') from `ï¼´ï¼—`; +SELECT INSTR(`C1`,'ï½³') from `ï¼´ï¼—`; +SELECT INSTR(`C1`,'ï½´') from `ï¼´ï¼—`; +SELECT INSTR(`C1`,'ï½µ') from `ï¼´ï¼—`; +SELECT INSTR(`C1`,'ï¾') from `ï¼´ï¼—`; +SELECT INSTR(`C1`,'ã‚') from `T8`; +SELECT INSTR(`C1`,'ã„') from `T8`; +SELECT INSTR(`C1`,'ã†') from `T8`; +SELECT INSTR(`C1`,'ãˆ') from `T8`; +SELECT INSTR(`C1`,'ãŠ') from `T8`; +SELECT INSTR(`C1`,'ã‚“') from `T8`; +SELECT INSTR(`C1`,'é¾”') from `ï¼´ï¼™`; +SELECT INSTR(`C1`,'é¾–') from `ï¼´ï¼™`; +SELECT INSTR(`C1`,'é¾—') from `ï¼´ï¼™`; +SELECT INSTR(`C1`,'龞') from `ï¼´ï¼™`; +SELECT INSTR(`C1`,'龡') from `ï¼´ï¼™`; +SELECT INSTR(`C1`,'丂') from `ï¼´ï¼™`; + +#BDB +SELECT INSTR(`C1`,'ï½±') from `T1ï¼`; +SELECT INSTR(`C1`,'ï½²') from `T1ï¼`; +SELECT INSTR(`C1`,'ï½³') from `T1ï¼`; +SELECT INSTR(`C1`,'ï½´') from `T1ï¼`; +SELECT INSTR(`C1`,'ï½µ') from `T1ï¼`; +SELECT INSTR(`C1`,'ï¾') from `T1ï¼`; +SELECT INSTR(`C1`,'ã‚') from `T11`; +SELECT INSTR(`C1`,'ã„') from `T11`; +SELECT INSTR(`C1`,'ã†') from `T11`; +SELECT INSTR(`C1`,'ãˆ') from `T11`; +SELECT INSTR(`C1`,'ãŠ') from `T11`; +SELECT INSTR(`C1`,'ã‚“') from `T11`; +SELECT INSTR(`C1`,'é¾”') from `T12`; +SELECT INSTR(`C1`,'é¾–') from `T12`; +SELECT INSTR(`C1`,'é¾—') from `T12`; +SELECT INSTR(`C1`,'龞') from `T12`; +SELECT INSTR(`C1`,'龡') from `T12`; +SELECT INSTR(`C1`,'丂') from `T12`; + +DROP TABLE `T1`; +DROP TABLE `ï¼´ï¼’`; +DROP TABLE `T3`; +DROP TABLE `ï¼´ï¼”`; +DROP TABLE `T5`; +DROP TABLE `ï¼´ï¼–`; +DROP TABLE `ï¼´ï¼—`; +DROP TABLE `T8`; +DROP TABLE `ï¼´ï¼™`; +DROP TABLE `T1ï¼`; +DROP TABLE `T11`; +DROP TABLE `T12`; diff --git a/mysql-test/suite/jp/t/jp_join_sjis.test b/mysql-test/suite/jp/t/jp_join_sjis.test new file mode 100755 index 00000000000..30b23913929 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_join_sjis.test @@ -0,0 +1,218 @@ +--character_set sjis +--disable_warnings +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +drop table if exists `‚s‚P‚P`; +drop table if exists `‚s‚P‚Q`; +--enable_warnings + +# +# Test table JOIN using Japanese characters in sjis encoding +# + +SET NAMES sjis; +SET character_set_database = sjis; + +CREATE TABLE `‚s‚Pa` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Pb` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Qa` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Qb` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Ra` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Rb` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Sa` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚Sb` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚Ta` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚Tb` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚Ua` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚Ub` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚Va` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚Vb` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚Wa` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚Wb` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚Xa` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚Xb` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚Oa` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚Ob` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚Pa` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚Pb` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚Qa` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚Qb` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; + +#insert the following data in each table +# jisx0201 hankaku-katakana data +# jisx0208 data +# jisx0212 supplemental character data + +INSERT INTO `‚s‚Pa` VALUES ('±'),('¶'),('»'); +INSERT INTO `‚s‚Pb` VALUES ('±'); +INSERT INTO `‚s‚Qa` VALUES ('‚ '),('‚©'),('‚³'); +INSERT INTO `‚s‚Qb` VALUES ('‚ '); +INSERT INTO `‚s‚Ra` VALUES ('ƒ\'),('\'),('•\'); +INSERT INTO `‚s‚Rb` VALUES ('ƒ\'); +INSERT INTO `‚s‚Sa` VALUES ('±'),('¶'),('»'); +INSERT INTO `‚s‚Sb` VALUES ('±'); +INSERT INTO `‚s‚Ta` VALUES ('‚ '),('‚©'),('‚³'); +INSERT INTO `‚s‚Tb` VALUES ('‚ '); +INSERT INTO `‚s‚Ua` VALUES ('ƒ\'),('\'),('•\'); +INSERT INTO `‚s‚Ub` VALUES ('ƒ\'); +INSERT INTO `‚s‚Va` VALUES ('±'),('¶'),('»'); +INSERT INTO `‚s‚Vb` VALUES ('±'); +INSERT INTO `‚s‚Wa` VALUES ('‚ '),('‚©'),('‚³'); +INSERT INTO `‚s‚Wb` VALUES ('‚ '); +INSERT INTO `‚s‚Xa` VALUES ('ƒ\'),('\'),('•\'); +INSERT INTO `‚s‚Xb` VALUES ('ƒ\'); +INSERT INTO `‚s‚P‚Oa` VALUES ('±'),('¶'),('»'); +INSERT INTO `‚s‚P‚Ob` VALUES ('±'); +INSERT INTO `‚s‚P‚Pa` VALUES ('‚ '),('‚©'),('‚³'); +INSERT INTO `‚s‚P‚Pb` VALUES ('‚ '); +INSERT INTO `‚s‚P‚Qa` VALUES ('ƒ\'),('\'),('•\'); +INSERT INTO `‚s‚P‚Qb` VALUES ('ƒ\'); + +#Test for innodb +SELECT * FROM `‚s‚Pa` JOIN `‚s‚Pb`; +SELECT * FROM `‚s‚Pa` INNER JOIN `‚s‚Pb`; +SELECT * FROM `‚s‚Pa` JOIN `‚s‚Pb` USING (`‚b‚P`); +SELECT * FROM `‚s‚Pa` INNER JOIN `‚s‚Pb` USING (`‚b‚P`); +SELECT * FROM `‚s‚Pa` CROSS JOIN `‚s‚Pb`; +SELECT * FROM `‚s‚Pa` LEFT JOIN `‚s‚Pb` USING (`‚b‚P`); +SELECT * FROM `‚s‚Pa` LEFT JOIN `‚s‚Pb` ON (`‚s‚Pa`.`‚b‚P` = `‚s‚Pb`.`‚b‚P`); +SELECT * FROM `‚s‚Pb` RIGHT JOIN `‚s‚Pa` USING (`‚b‚P`); +SELECT * FROM `‚s‚Pb` RIGHT JOIN `‚s‚Pa` ON (`‚s‚Pa`.`‚b‚P` = `‚s‚Pb`.`‚b‚P`); +SELECT * FROM `‚s‚Qa` JOIN `‚s‚Qb`; +SELECT * FROM `‚s‚Qa` INNER JOIN `‚s‚Qb`; +SELECT * FROM `‚s‚Qa` JOIN `‚s‚Qb` USING (`‚b‚P`); +SELECT * FROM `‚s‚Qa` INNER JOIN `‚s‚Qb` USING (`‚b‚P`); +SELECT * FROM `‚s‚Qa` CROSS JOIN `‚s‚Qb`; +SELECT * FROM `‚s‚Qa` LEFT JOIN `‚s‚Qb` USING (`‚b‚P`); +SELECT * FROM `‚s‚Qa` LEFT JOIN `‚s‚Qb` ON (`‚s‚Qa`.`‚b‚P` = `‚s‚Qb`.`‚b‚P`); +SELECT * FROM `‚s‚Qb` RIGHT JOIN `‚s‚Qa` USING (`‚b‚P`); +SELECT * FROM `‚s‚Qb` RIGHT JOIN `‚s‚Qa` ON (`‚s‚Qa`.`‚b‚P` = `‚s‚Qb`.`‚b‚P`); +SELECT * FROM `‚s‚Ra` JOIN `‚s‚Rb`; +SELECT * FROM `‚s‚Ra` INNER JOIN `‚s‚Rb`; +SELECT * FROM `‚s‚Ra` JOIN `‚s‚Rb` USING (`‚b‚P`); +SELECT * FROM `‚s‚Ra` INNER JOIN `‚s‚Rb` USING (`‚b‚P`); +SELECT * FROM `‚s‚Ra` CROSS JOIN `‚s‚Rb`; +SELECT * FROM `‚s‚Ra` LEFT JOIN `‚s‚Rb` USING (`‚b‚P`); +SELECT * FROM `‚s‚Ra` LEFT JOIN `‚s‚Rb` ON (`‚s‚Ra`.`‚b‚P` = `‚s‚Rb`.`‚b‚P`); +SELECT * FROM `‚s‚Rb` RIGHT JOIN `‚s‚Ra` USING (`‚b‚P`); +SELECT * FROM `‚s‚Rb` RIGHT JOIN `‚s‚Ra` ON (`‚s‚Ra`.`‚b‚P` = `‚s‚Rb`.`‚b‚P`); + +#Test for myisam +SELECT * FROM `‚s‚Sa` JOIN `‚s‚Sb`; +SELECT * FROM `‚s‚Sa` INNER JOIN `‚s‚Sb`; +SELECT * FROM `‚s‚Sa` JOIN `‚s‚Sb` USING (`‚b‚P`); +SELECT * FROM `‚s‚Sa` INNER JOIN `‚s‚Sb` USING (`‚b‚P`); +SELECT * FROM `‚s‚Sa` CROSS JOIN `‚s‚Sb`; +SELECT * FROM `‚s‚Sa` LEFT JOIN `‚s‚Sb` USING (`‚b‚P`); +SELECT * FROM `‚s‚Sa` LEFT JOIN `‚s‚Sb` ON (`‚s‚Sa`.`‚b‚P` = `‚s‚Sb`.`‚b‚P`); +SELECT * FROM `‚s‚Sb` RIGHT JOIN `‚s‚Sa` USING (`‚b‚P`); +SELECT * FROM `‚s‚Sb` RIGHT JOIN `‚s‚Sa` ON (`‚s‚Sa`.`‚b‚P` = `‚s‚Sb`.`‚b‚P`); +SELECT * FROM `‚s‚Ta` JOIN `‚s‚Tb`; +SELECT * FROM `‚s‚Ta` INNER JOIN `‚s‚Tb`; +SELECT * FROM `‚s‚Ta` JOIN `‚s‚Tb` USING (`‚b‚P`); +SELECT * FROM `‚s‚Ta` INNER JOIN `‚s‚Tb` USING (`‚b‚P`); +SELECT * FROM `‚s‚Ta` CROSS JOIN `‚s‚Tb`; +SELECT * FROM `‚s‚Ta` LEFT JOIN `‚s‚Tb` USING (`‚b‚P`); +SELECT * FROM `‚s‚Ta` LEFT JOIN `‚s‚Tb` ON (`‚s‚Ta`.`‚b‚P` = `‚s‚Tb`.`‚b‚P`); +SELECT * FROM `‚s‚Tb` RIGHT JOIN `‚s‚Ta` USING (`‚b‚P`); +SELECT * FROM `‚s‚Tb` RIGHT JOIN `‚s‚Ta` ON (`‚s‚Ta`.`‚b‚P` = `‚s‚Tb`.`‚b‚P`); +SELECT * FROM `‚s‚Ua` JOIN `‚s‚Ub`; +SELECT * FROM `‚s‚Ua` INNER JOIN `‚s‚Ub`; +SELECT * FROM `‚s‚Ua` JOIN `‚s‚Ub` USING (`‚b‚P`); +SELECT * FROM `‚s‚Ua` INNER JOIN `‚s‚Ub` USING (`‚b‚P`); +SELECT * FROM `‚s‚Ua` CROSS JOIN `‚s‚Ub`; +SELECT * FROM `‚s‚Ua` LEFT JOIN `‚s‚Ub` USING (`‚b‚P`); +SELECT * FROM `‚s‚Ua` LEFT JOIN `‚s‚Ub` ON (`‚s‚Ua`.`‚b‚P` = `‚s‚Ub`.`‚b‚P`); +SELECT * FROM `‚s‚Ub` RIGHT JOIN `‚s‚Ua` USING (`‚b‚P`); +SELECT * FROM `‚s‚Ub` RIGHT JOIN `‚s‚Ua` ON (`‚s‚Ua`.`‚b‚P` = `‚s‚Ub`.`‚b‚P`); + +#Test for heap +SELECT * FROM `‚s‚Va` JOIN `‚s‚Vb`; +SELECT * FROM `‚s‚Va` INNER JOIN `‚s‚Vb`; +SELECT * FROM `‚s‚Va` JOIN `‚s‚Vb` USING (`‚b‚P`); +SELECT * FROM `‚s‚Va` INNER JOIN `‚s‚Vb` USING (`‚b‚P`); +SELECT * FROM `‚s‚Va` CROSS JOIN `‚s‚Vb`; +SELECT * FROM `‚s‚Va` LEFT JOIN `‚s‚Vb` USING (`‚b‚P`); +SELECT * FROM `‚s‚Va` LEFT JOIN `‚s‚Vb` ON (`‚s‚Va`.`‚b‚P` = `‚s‚Vb`.`‚b‚P`); +SELECT * FROM `‚s‚Vb` RIGHT JOIN `‚s‚Va` USING (`‚b‚P`); +SELECT * FROM `‚s‚Vb` RIGHT JOIN `‚s‚Va` ON (`‚s‚Va`.`‚b‚P` = `‚s‚Vb`.`‚b‚P`); +SELECT * FROM `‚s‚Wa` JOIN `‚s‚Wb`; +SELECT * FROM `‚s‚Wa` INNER JOIN `‚s‚Wb`; +SELECT * FROM `‚s‚Wa` JOIN `‚s‚Wb` USING (`‚b‚P`); +SELECT * FROM `‚s‚Wa` INNER JOIN `‚s‚Wb` USING (`‚b‚P`); +SELECT * FROM `‚s‚Wa` CROSS JOIN `‚s‚Wb`; +SELECT * FROM `‚s‚Wa` LEFT JOIN `‚s‚Wb` USING (`‚b‚P`); +SELECT * FROM `‚s‚Wa` LEFT JOIN `‚s‚Wb` ON (`‚s‚Wa`.`‚b‚P` = `‚s‚Wb`.`‚b‚P`); +SELECT * FROM `‚s‚Wb` RIGHT JOIN `‚s‚Wa` USING (`‚b‚P`); +SELECT * FROM `‚s‚Wb` RIGHT JOIN `‚s‚Wa` ON (`‚s‚Wa`.`‚b‚P` = `‚s‚Wb`.`‚b‚P`); +SELECT * FROM `‚s‚Xa` JOIN `‚s‚Xb`; +SELECT * FROM `‚s‚Xa` INNER JOIN `‚s‚Xb`; +SELECT * FROM `‚s‚Xa` JOIN `‚s‚Xb` USING (`‚b‚P`); +SELECT * FROM `‚s‚Xa` INNER JOIN `‚s‚Xb` USING (`‚b‚P`); +SELECT * FROM `‚s‚Xa` CROSS JOIN `‚s‚Xb`; +SELECT * FROM `‚s‚Xa` LEFT JOIN `‚s‚Xb` USING (`‚b‚P`); +SELECT * FROM `‚s‚Xa` LEFT JOIN `‚s‚Xb` ON (`‚s‚Xa`.`‚b‚P` = `‚s‚Xb`.`‚b‚P`); +SELECT * FROM `‚s‚Xb` RIGHT JOIN `‚s‚Xa` USING (`‚b‚P`); +SELECT * FROM `‚s‚Xb` RIGHT JOIN `‚s‚Xa` ON (`‚s‚Xa`.`‚b‚P` = `‚s‚Xb`.`‚b‚P`); + +#Test for heap +SELECT * FROM `‚s‚P‚Oa` JOIN `‚s‚P‚Ob`; +SELECT * FROM `‚s‚P‚Oa` INNER JOIN `‚s‚P‚Ob`; +SELECT * FROM `‚s‚P‚Oa` JOIN `‚s‚P‚Ob` USING (`‚b‚P`); +SELECT * FROM `‚s‚P‚Oa` INNER JOIN `‚s‚P‚Ob` USING (`‚b‚P`); +SELECT * FROM `‚s‚P‚Oa` CROSS JOIN `‚s‚P‚Ob`; +SELECT * FROM `‚s‚P‚Oa` LEFT JOIN `‚s‚P‚Ob` USING (`‚b‚P`); +SELECT * FROM `‚s‚P‚Oa` LEFT JOIN `‚s‚P‚Ob` ON (`‚s‚P‚Oa`.`‚b‚P` = `‚s‚P‚Ob`.`‚b‚P`); +SELECT * FROM `‚s‚P‚Ob` RIGHT JOIN `‚s‚P‚Oa` USING (`‚b‚P`); +SELECT * FROM `‚s‚P‚Ob` RIGHT JOIN `‚s‚P‚Oa` ON (`‚s‚P‚Oa`.`‚b‚P` = `‚s‚P‚Ob`.`‚b‚P`); +SELECT * FROM `‚s‚P‚Pa` JOIN `‚s‚P‚Pb`; +SELECT * FROM `‚s‚P‚Pa` INNER JOIN `‚s‚P‚Pb`; +SELECT * FROM `‚s‚P‚Pa` JOIN `‚s‚P‚Pb` USING (`‚b‚P`); +SELECT * FROM `‚s‚P‚Pa` INNER JOIN `‚s‚P‚Pb` USING (`‚b‚P`); +SELECT * FROM `‚s‚P‚Pa` CROSS JOIN `‚s‚P‚Pb`; +SELECT * FROM `‚s‚P‚Pa` LEFT JOIN `‚s‚P‚Pb` USING (`‚b‚P`); +SELECT * FROM `‚s‚P‚Pa` LEFT JOIN `‚s‚P‚Pb` ON (`‚s‚P‚Pa`.`‚b‚P` = `‚s‚P‚Pb`.`‚b‚P`); +SELECT * FROM `‚s‚P‚Pb` RIGHT JOIN `‚s‚P‚Pa` USING (`‚b‚P`); +SELECT * FROM `‚s‚P‚Pb` RIGHT JOIN `‚s‚P‚Pa` ON (`‚s‚P‚Pa`.`‚b‚P` = `‚s‚P‚Pb`.`‚b‚P`); +SELECT * FROM `‚s‚P‚Qa` JOIN `‚s‚P‚Qb`; +SELECT * FROM `‚s‚P‚Qa` INNER JOIN `‚s‚P‚Qb`; +SELECT * FROM `‚s‚P‚Qa` JOIN `‚s‚P‚Qb` USING (`‚b‚P`); +SELECT * FROM `‚s‚P‚Qa` INNER JOIN `‚s‚P‚Qb` USING (`‚b‚P`); +SELECT * FROM `‚s‚P‚Qa` CROSS JOIN `‚s‚P‚Qb`; +SELECT * FROM `‚s‚P‚Qa` LEFT JOIN `‚s‚P‚Qb` USING (`‚b‚P`); +SELECT * FROM `‚s‚P‚Qa` LEFT JOIN `‚s‚P‚Qb` ON (`‚s‚P‚Qa`.`‚b‚P` = `‚s‚P‚Qb`.`‚b‚P`); +SELECT * FROM `‚s‚P‚Qb` RIGHT JOIN `‚s‚P‚Qa` USING (`‚b‚P`); +SELECT * FROM `‚s‚P‚Qb` RIGHT JOIN `‚s‚P‚Qa` ON (`‚s‚P‚Qa`.`‚b‚P` = `‚s‚P‚Qb`.`‚b‚P`); + +DROP TABLE `‚s‚Pa`; +DROP TABLE `‚s‚Pb`; +DROP TABLE `‚s‚Qa`; +DROP TABLE `‚s‚Qb`; +DROP TABLE `‚s‚Ra`; +DROP TABLE `‚s‚Rb`; +DROP TABLE `‚s‚Sa`; +DROP TABLE `‚s‚Sb`; +DROP TABLE `‚s‚Ta`; +DROP TABLE `‚s‚Tb`; +DROP TABLE `‚s‚Ua`; +DROP TABLE `‚s‚Ub`; +DROP TABLE `‚s‚Va`; +DROP TABLE `‚s‚Vb`; +DROP TABLE `‚s‚Wa`; +DROP TABLE `‚s‚Wb`; +DROP TABLE `‚s‚Xa`; +DROP TABLE `‚s‚Xb`; +DROP TABLE `‚s‚P‚Oa`; +DROP TABLE `‚s‚P‚Ob`; +DROP TABLE `‚s‚P‚Pa`; +DROP TABLE `‚s‚P‚Pb`; +DROP TABLE `‚s‚P‚Qa`; +DROP TABLE `‚s‚P‚Qb`; diff --git a/mysql-test/suite/jp/t/jp_join_ucs2.test b/mysql-test/suite/jp/t/jp_join_ucs2.test new file mode 100755 index 00000000000..27e49203dd2 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_join_ucs2.test @@ -0,0 +1,220 @@ +--source include/have_ucs2.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +--enable_warnings + +# +# Test table JOIN using Japanese characters +# + +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; + +CREATE TABLE `£Ô£±a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£±b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£µa` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£µb` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£¶a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£¶b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£·a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£·b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£¸a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£¸b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£¹a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£¹b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£±£°a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£±£°b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£±£±a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£±£±b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£±£²a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£±£²b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ucs2 engine = innodb; + +#insert the following data in each table +# jisx0201 hankaku-katakana data +# jisx0208 data +# jisx0212 supplemental character data + +INSERT INTO `£Ô£±a` VALUES ('ޱ'),('޶'),('Ž»'); +INSERT INTO `£Ô£±b` VALUES ('ޱ'); +INSERT INTO `£Ô£²a` VALUES ('¤¢'),('¤«'),('¤µ'); +INSERT INTO `£Ô£²b` VALUES ('¤¢'); +INSERT INTO `£Ô£³a` VALUES ('íÜ'),('íÝ'),('íÞ'); +INSERT INTO `£Ô£³b` VALUES ('íÜ'); +INSERT INTO `£Ô£´a` VALUES ('ޱ'),('޶'),('Ž»'); +INSERT INTO `£Ô£´b` VALUES ('ޱ'); +INSERT INTO `£Ô£µa` VALUES ('¤¢'),('¤«'),('¤µ'); +INSERT INTO `£Ô£µb` VALUES ('¤¢'); +INSERT INTO `£Ô£¶a` VALUES ('íÜ'),('íÝ'),('íÞ'); +INSERT INTO `£Ô£¶b` VALUES ('íÜ'); +INSERT INTO `£Ô£·a` VALUES ('ޱ'),('޶'),('Ž»'); +INSERT INTO `£Ô£·b` VALUES ('ޱ'); +INSERT INTO `£Ô£¸a` VALUES ('¤¢'),('¤«'),('¤µ'); +INSERT INTO `£Ô£¸b` VALUES ('¤¢'); +INSERT INTO `£Ô£¹a` VALUES ('íÜ'),('íÝ'),('íÞ'); +INSERT INTO `£Ô£¹b` VALUES ('íÜ'); +INSERT INTO `£Ô£±£°a` VALUES ('ޱ'),('޶'),('Ž»'); +INSERT INTO `£Ô£±£°b` VALUES ('ޱ'); +INSERT INTO `£Ô£±£±a` VALUES ('¤¢'),('¤«'),('¤µ'); +INSERT INTO `£Ô£±£±b` VALUES ('¤¢'); +INSERT INTO `£Ô£±£²a` VALUES ('íÜ'),('íÝ'),('íÞ'); +INSERT INTO `£Ô£±£²b` VALUES ('íÜ'); + +#Test for innodb +SELECT * FROM `£Ô£±a` JOIN `£Ô£±b`; +SELECT * FROM `£Ô£±a` INNER JOIN `£Ô£±b`; +SELECT * FROM `£Ô£±a` JOIN `£Ô£±b` USING (`£Ã£±`); +SELECT * FROM `£Ô£±a` INNER JOIN `£Ô£±b` USING (`£Ã£±`); +SELECT * FROM `£Ô£±a` CROSS JOIN `£Ô£±b`; +SELECT * FROM `£Ô£±a` LEFT JOIN `£Ô£±b` USING (`£Ã£±`); +SELECT * FROM `£Ô£±a` LEFT JOIN `£Ô£±b` ON (`£Ô£±a`.`£Ã£±` = `£Ô£±b`.`£Ã£±`); +SELECT * FROM `£Ô£±b` RIGHT JOIN `£Ô£±a` USING (`£Ã£±`); +SELECT * FROM `£Ô£±b` RIGHT JOIN `£Ô£±a` ON (`£Ô£±a`.`£Ã£±` = `£Ô£±b`.`£Ã£±`); +SELECT * FROM `£Ô£²a` JOIN `£Ô£²b`; +SELECT * FROM `£Ô£²a` INNER JOIN `£Ô£²b`; +SELECT * FROM `£Ô£²a` JOIN `£Ô£²b` USING (`£Ã£±`); +SELECT * FROM `£Ô£²a` INNER JOIN `£Ô£²b` USING (`£Ã£±`); +SELECT * FROM `£Ô£²a` CROSS JOIN `£Ô£²b`; +SELECT * FROM `£Ô£²a` LEFT JOIN `£Ô£²b` USING (`£Ã£±`); +SELECT * FROM `£Ô£²a` LEFT JOIN `£Ô£²b` ON (`£Ô£²a`.`£Ã£±` = `£Ô£²b`.`£Ã£±`); +SELECT * FROM `£Ô£²b` RIGHT JOIN `£Ô£²a` USING (`£Ã£±`); +SELECT * FROM `£Ô£²b` RIGHT JOIN `£Ô£²a` ON (`£Ô£²a`.`£Ã£±` = `£Ô£²b`.`£Ã£±`); +SELECT * FROM `£Ô£³a` JOIN `£Ô£³b`; +SELECT * FROM `£Ô£³a` INNER JOIN `£Ô£³b`; +SELECT * FROM `£Ô£³a` JOIN `£Ô£³b` USING (`£Ã£±`); +SELECT * FROM `£Ô£³a` INNER JOIN `£Ô£³b` USING (`£Ã£±`); +SELECT * FROM `£Ô£³a` CROSS JOIN `£Ô£³b`; +SELECT * FROM `£Ô£³a` LEFT JOIN `£Ô£³b` USING (`£Ã£±`); +SELECT * FROM `£Ô£³a` LEFT JOIN `£Ô£³b` ON (`£Ô£³a`.`£Ã£±` = `£Ô£³b`.`£Ã£±`); +SELECT * FROM `£Ô£³b` RIGHT JOIN `£Ô£³a` USING (`£Ã£±`); +SELECT * FROM `£Ô£³b` RIGHT JOIN `£Ô£³a` ON (`£Ô£³a`.`£Ã£±` = `£Ô£³b`.`£Ã£±`); + +#Test for myisam +SELECT * FROM `£Ô£´a` JOIN `£Ô£´b`; +SELECT * FROM `£Ô£´a` INNER JOIN `£Ô£´b`; +SELECT * FROM `£Ô£´a` JOIN `£Ô£´b` USING (`£Ã£±`); +SELECT * FROM `£Ô£´a` INNER JOIN `£Ô£´b` USING (`£Ã£±`); +SELECT * FROM `£Ô£´a` CROSS JOIN `£Ô£´b`; +SELECT * FROM `£Ô£´a` LEFT JOIN `£Ô£´b` USING (`£Ã£±`); +SELECT * FROM `£Ô£´a` LEFT JOIN `£Ô£´b` ON (`£Ô£´a`.`£Ã£±` = `£Ô£´b`.`£Ã£±`); +SELECT * FROM `£Ô£´b` RIGHT JOIN `£Ô£´a` USING (`£Ã£±`); +SELECT * FROM `£Ô£´b` RIGHT JOIN `£Ô£´a` ON (`£Ô£´a`.`£Ã£±` = `£Ô£´b`.`£Ã£±`); +SELECT * FROM `£Ô£µa` JOIN `£Ô£µb`; +SELECT * FROM `£Ô£µa` INNER JOIN `£Ô£µb`; +SELECT * FROM `£Ô£µa` JOIN `£Ô£µb` USING (`£Ã£±`); +SELECT * FROM `£Ô£µa` INNER JOIN `£Ô£µb` USING (`£Ã£±`); +SELECT * FROM `£Ô£µa` CROSS JOIN `£Ô£µb`; +SELECT * FROM `£Ô£µa` LEFT JOIN `£Ô£µb` USING (`£Ã£±`); +SELECT * FROM `£Ô£µa` LEFT JOIN `£Ô£µb` ON (`£Ô£µa`.`£Ã£±` = `£Ô£µb`.`£Ã£±`); +SELECT * FROM `£Ô£µb` RIGHT JOIN `£Ô£µa` USING (`£Ã£±`); +SELECT * FROM `£Ô£µb` RIGHT JOIN `£Ô£µa` ON (`£Ô£µa`.`£Ã£±` = `£Ô£µb`.`£Ã£±`); +SELECT * FROM `£Ô£¶a` JOIN `£Ô£¶b`; +SELECT * FROM `£Ô£¶a` INNER JOIN `£Ô£¶b`; +SELECT * FROM `£Ô£¶a` JOIN `£Ô£¶b` USING (`£Ã£±`); +SELECT * FROM `£Ô£¶a` INNER JOIN `£Ô£¶b` USING (`£Ã£±`); +SELECT * FROM `£Ô£¶a` CROSS JOIN `£Ô£¶b`; +SELECT * FROM `£Ô£¶a` LEFT JOIN `£Ô£¶b` USING (`£Ã£±`); +SELECT * FROM `£Ô£¶a` LEFT JOIN `£Ô£¶b` ON (`£Ô£¶a`.`£Ã£±` = `£Ô£¶b`.`£Ã£±`); +SELECT * FROM `£Ô£¶b` RIGHT JOIN `£Ô£¶a` USING (`£Ã£±`); +SELECT * FROM `£Ô£¶b` RIGHT JOIN `£Ô£¶a` ON (`£Ô£¶a`.`£Ã£±` = `£Ô£¶b`.`£Ã£±`); + +#Test for heap +SELECT * FROM `£Ô£·a` JOIN `£Ô£·b`; +SELECT * FROM `£Ô£·a` INNER JOIN `£Ô£·b`; +SELECT * FROM `£Ô£·a` JOIN `£Ô£·b` USING (`£Ã£±`); +SELECT * FROM `£Ô£·a` INNER JOIN `£Ô£·b` USING (`£Ã£±`); +SELECT * FROM `£Ô£·a` CROSS JOIN `£Ô£·b`; +SELECT * FROM `£Ô£·a` LEFT JOIN `£Ô£·b` USING (`£Ã£±`); +SELECT * FROM `£Ô£·a` LEFT JOIN `£Ô£·b` ON (`£Ô£·a`.`£Ã£±` = `£Ô£·b`.`£Ã£±`); +SELECT * FROM `£Ô£·b` RIGHT JOIN `£Ô£·a` USING (`£Ã£±`); +SELECT * FROM `£Ô£·b` RIGHT JOIN `£Ô£·a` ON (`£Ô£·a`.`£Ã£±` = `£Ô£·b`.`£Ã£±`); +SELECT * FROM `£Ô£¸a` JOIN `£Ô£¸b`; +SELECT * FROM `£Ô£¸a` INNER JOIN `£Ô£¸b`; +SELECT * FROM `£Ô£¸a` JOIN `£Ô£¸b` USING (`£Ã£±`); +SELECT * FROM `£Ô£¸a` INNER JOIN `£Ô£¸b` USING (`£Ã£±`); +SELECT * FROM `£Ô£¸a` CROSS JOIN `£Ô£¸b`; +SELECT * FROM `£Ô£¸a` LEFT JOIN `£Ô£¸b` USING (`£Ã£±`); +SELECT * FROM `£Ô£¸a` LEFT JOIN `£Ô£¸b` ON (`£Ô£¸a`.`£Ã£±` = `£Ô£¸b`.`£Ã£±`); +SELECT * FROM `£Ô£¸b` RIGHT JOIN `£Ô£¸a` USING (`£Ã£±`); +SELECT * FROM `£Ô£¸b` RIGHT JOIN `£Ô£¸a` ON (`£Ô£¸a`.`£Ã£±` = `£Ô£¸b`.`£Ã£±`); +SELECT * FROM `£Ô£¹a` JOIN `£Ô£¹b`; +SELECT * FROM `£Ô£¹a` INNER JOIN `£Ô£¹b`; +SELECT * FROM `£Ô£¹a` JOIN `£Ô£¹b` USING (`£Ã£±`); +SELECT * FROM `£Ô£¹a` INNER JOIN `£Ô£¹b` USING (`£Ã£±`); +SELECT * FROM `£Ô£¹a` CROSS JOIN `£Ô£¹b`; +SELECT * FROM `£Ô£¹a` LEFT JOIN `£Ô£¹b` USING (`£Ã£±`); +SELECT * FROM `£Ô£¹a` LEFT JOIN `£Ô£¹b` ON (`£Ô£¹a`.`£Ã£±` = `£Ô£¹b`.`£Ã£±`); +SELECT * FROM `£Ô£¹b` RIGHT JOIN `£Ô£¹a` USING (`£Ã£±`); +SELECT * FROM `£Ô£¹b` RIGHT JOIN `£Ô£¹a` ON (`£Ô£¹a`.`£Ã£±` = `£Ô£¹b`.`£Ã£±`); + +#Test for heap +SELECT * FROM `£Ô£±£°a` JOIN `£Ô£±£°b`; +SELECT * FROM `£Ô£±£°a` INNER JOIN `£Ô£±£°b`; +SELECT * FROM `£Ô£±£°a` JOIN `£Ô£±£°b` USING (`£Ã£±`); +SELECT * FROM `£Ô£±£°a` INNER JOIN `£Ô£±£°b` USING (`£Ã£±`); +SELECT * FROM `£Ô£±£°a` CROSS JOIN `£Ô£±£°b`; +SELECT * FROM `£Ô£±£°a` LEFT JOIN `£Ô£±£°b` USING (`£Ã£±`); +SELECT * FROM `£Ô£±£°a` LEFT JOIN `£Ô£±£°b` ON (`£Ô£±£°a`.`£Ã£±` = `£Ô£±£°b`.`£Ã£±`); +SELECT * FROM `£Ô£±£°b` RIGHT JOIN `£Ô£±£°a` USING (`£Ã£±`); +SELECT * FROM `£Ô£±£°b` RIGHT JOIN `£Ô£±£°a` ON (`£Ô£±£°a`.`£Ã£±` = `£Ô£±£°b`.`£Ã£±`); +SELECT * FROM `£Ô£±£±a` JOIN `£Ô£±£±b`; +SELECT * FROM `£Ô£±£±a` INNER JOIN `£Ô£±£±b`; +SELECT * FROM `£Ô£±£±a` JOIN `£Ô£±£±b` USING (`£Ã£±`); +SELECT * FROM `£Ô£±£±a` INNER JOIN `£Ô£±£±b` USING (`£Ã£±`); +SELECT * FROM `£Ô£±£±a` CROSS JOIN `£Ô£±£±b`; +SELECT * FROM `£Ô£±£±a` LEFT JOIN `£Ô£±£±b` USING (`£Ã£±`); +SELECT * FROM `£Ô£±£±a` LEFT JOIN `£Ô£±£±b` ON (`£Ô£±£±a`.`£Ã£±` = `£Ô£±£±b`.`£Ã£±`); +SELECT * FROM `£Ô£±£±b` RIGHT JOIN `£Ô£±£±a` USING (`£Ã£±`); +SELECT * FROM `£Ô£±£±b` RIGHT JOIN `£Ô£±£±a` ON (`£Ô£±£±a`.`£Ã£±` = `£Ô£±£±b`.`£Ã£±`); +SELECT * FROM `£Ô£±£²a` JOIN `£Ô£±£²b`; +SELECT * FROM `£Ô£±£²a` INNER JOIN `£Ô£±£²b`; +SELECT * FROM `£Ô£±£²a` JOIN `£Ô£±£²b` USING (`£Ã£±`); +SELECT * FROM `£Ô£±£²a` INNER JOIN `£Ô£±£²b` USING (`£Ã£±`); +SELECT * FROM `£Ô£±£²a` CROSS JOIN `£Ô£±£²b`; +SELECT * FROM `£Ô£±£²a` LEFT JOIN `£Ô£±£²b` USING (`£Ã£±`); +SELECT * FROM `£Ô£±£²a` LEFT JOIN `£Ô£±£²b` ON (`£Ô£±£²a`.`£Ã£±` = `£Ô£±£²b`.`£Ã£±`); +SELECT * FROM `£Ô£±£²b` RIGHT JOIN `£Ô£±£²a` USING (`£Ã£±`); +SELECT * FROM `£Ô£±£²b` RIGHT JOIN `£Ô£±£²a` ON (`£Ô£±£²a`.`£Ã£±` = `£Ô£±£²b`.`£Ã£±`); + +DROP TABLE `£Ô£±a`; +DROP TABLE `£Ô£±b`; +DROP TABLE `£Ô£²a`; +DROP TABLE `£Ô£²b`; +DROP TABLE `£Ô£³a`; +DROP TABLE `£Ô£³b`; +DROP TABLE `£Ô£´a`; +DROP TABLE `£Ô£´b`; +DROP TABLE `£Ô£µa`; +DROP TABLE `£Ô£µb`; +DROP TABLE `£Ô£¶a`; +DROP TABLE `£Ô£¶b`; +DROP TABLE `£Ô£·a`; +DROP TABLE `£Ô£·b`; +DROP TABLE `£Ô£¸a`; +DROP TABLE `£Ô£¸b`; +DROP TABLE `£Ô£¹a`; +DROP TABLE `£Ô£¹b`; +DROP TABLE `£Ô£±£°a`; +DROP TABLE `£Ô£±£°b`; +DROP TABLE `£Ô£±£±a`; +DROP TABLE `£Ô£±£±b`; +DROP TABLE `£Ô£±£²a`; +DROP TABLE `£Ô£±£²b`; diff --git a/mysql-test/suite/jp/t/jp_join_ujis.test b/mysql-test/suite/jp/t/jp_join_ujis.test new file mode 100755 index 00000000000..079f260cc26 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_join_ujis.test @@ -0,0 +1,219 @@ +--source include/have_ujis.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +--enable_warnings + +# +# Test table JOIN using Japanese characters +# + +SET NAMES ujis; +SET character_set_database = ujis; + +CREATE TABLE `£Ô£±a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£±b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£µa` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£µb` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£¶a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£¶b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£·a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£·b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£¸a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£¸b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£¹a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£¹b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£±£°a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£±£°b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£±£±a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£±£±b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£±£²a` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£±£²b` (`£Ã£±` char(1) PRIMARY KEY) DEFAULT CHARSET = ujis engine = innodb; + +#insert the following data in each table +# jisx0201 hankaku-katakana data +# jisx0208 data +# jisx0212 supplemental character data + +INSERT INTO `£Ô£±a` VALUES ('ޱ'),('޶'),('Ž»'); +INSERT INTO `£Ô£±b` VALUES ('ޱ'); +INSERT INTO `£Ô£²a` VALUES ('¤¢'),('¤«'),('¤µ'); +INSERT INTO `£Ô£²b` VALUES ('¤¢'); +INSERT INTO `£Ô£³a` VALUES ('íÜ'),('íÝ'),('íÞ'); +INSERT INTO `£Ô£³b` VALUES ('íÜ'); +INSERT INTO `£Ô£´a` VALUES ('ޱ'),('޶'),('Ž»'); +INSERT INTO `£Ô£´b` VALUES ('ޱ'); +INSERT INTO `£Ô£µa` VALUES ('¤¢'),('¤«'),('¤µ'); +INSERT INTO `£Ô£µb` VALUES ('¤¢'); +INSERT INTO `£Ô£¶a` VALUES ('íÜ'),('íÝ'),('íÞ'); +INSERT INTO `£Ô£¶b` VALUES ('íÜ'); +INSERT INTO `£Ô£·a` VALUES ('ޱ'),('޶'),('Ž»'); +INSERT INTO `£Ô£·b` VALUES ('ޱ'); +INSERT INTO `£Ô£¸a` VALUES ('¤¢'),('¤«'),('¤µ'); +INSERT INTO `£Ô£¸b` VALUES ('¤¢'); +INSERT INTO `£Ô£¹a` VALUES ('íÜ'),('íÝ'),('íÞ'); +INSERT INTO `£Ô£¹b` VALUES ('íÜ'); +INSERT INTO `£Ô£±£°a` VALUES ('ޱ'),('޶'),('Ž»'); +INSERT INTO `£Ô£±£°b` VALUES ('ޱ'); +INSERT INTO `£Ô£±£±a` VALUES ('¤¢'),('¤«'),('¤µ'); +INSERT INTO `£Ô£±£±b` VALUES ('¤¢'); +INSERT INTO `£Ô£±£²a` VALUES ('íÜ'),('íÝ'),('íÞ'); +INSERT INTO `£Ô£±£²b` VALUES ('íÜ'); + +#Test for innodb +SELECT * FROM `£Ô£±a` JOIN `£Ô£±b`; +SELECT * FROM `£Ô£±a` INNER JOIN `£Ô£±b`; +SELECT * FROM `£Ô£±a` JOIN `£Ô£±b` USING (`£Ã£±`); +SELECT * FROM `£Ô£±a` INNER JOIN `£Ô£±b` USING (`£Ã£±`); +SELECT * FROM `£Ô£±a` CROSS JOIN `£Ô£±b`; +SELECT * FROM `£Ô£±a` LEFT JOIN `£Ô£±b` USING (`£Ã£±`); +SELECT * FROM `£Ô£±a` LEFT JOIN `£Ô£±b` ON (`£Ô£±a`.`£Ã£±` = `£Ô£±b`.`£Ã£±`); +SELECT * FROM `£Ô£±b` RIGHT JOIN `£Ô£±a` USING (`£Ã£±`); +SELECT * FROM `£Ô£±b` RIGHT JOIN `£Ô£±a` ON (`£Ô£±a`.`£Ã£±` = `£Ô£±b`.`£Ã£±`); +SELECT * FROM `£Ô£²a` JOIN `£Ô£²b`; +SELECT * FROM `£Ô£²a` INNER JOIN `£Ô£²b`; +SELECT * FROM `£Ô£²a` JOIN `£Ô£²b` USING (`£Ã£±`); +SELECT * FROM `£Ô£²a` INNER JOIN `£Ô£²b` USING (`£Ã£±`); +SELECT * FROM `£Ô£²a` CROSS JOIN `£Ô£²b`; +SELECT * FROM `£Ô£²a` LEFT JOIN `£Ô£²b` USING (`£Ã£±`); +SELECT * FROM `£Ô£²a` LEFT JOIN `£Ô£²b` ON (`£Ô£²a`.`£Ã£±` = `£Ô£²b`.`£Ã£±`); +SELECT * FROM `£Ô£²b` RIGHT JOIN `£Ô£²a` USING (`£Ã£±`); +SELECT * FROM `£Ô£²b` RIGHT JOIN `£Ô£²a` ON (`£Ô£²a`.`£Ã£±` = `£Ô£²b`.`£Ã£±`); +SELECT * FROM `£Ô£³a` JOIN `£Ô£³b`; +SELECT * FROM `£Ô£³a` INNER JOIN `£Ô£³b`; +SELECT * FROM `£Ô£³a` JOIN `£Ô£³b` USING (`£Ã£±`); +SELECT * FROM `£Ô£³a` INNER JOIN `£Ô£³b` USING (`£Ã£±`); +SELECT * FROM `£Ô£³a` CROSS JOIN `£Ô£³b`; +SELECT * FROM `£Ô£³a` LEFT JOIN `£Ô£³b` USING (`£Ã£±`); +SELECT * FROM `£Ô£³a` LEFT JOIN `£Ô£³b` ON (`£Ô£³a`.`£Ã£±` = `£Ô£³b`.`£Ã£±`); +SELECT * FROM `£Ô£³b` RIGHT JOIN `£Ô£³a` USING (`£Ã£±`); +SELECT * FROM `£Ô£³b` RIGHT JOIN `£Ô£³a` ON (`£Ô£³a`.`£Ã£±` = `£Ô£³b`.`£Ã£±`); + +#Test for myisam +SELECT * FROM `£Ô£´a` JOIN `£Ô£´b`; +SELECT * FROM `£Ô£´a` INNER JOIN `£Ô£´b`; +SELECT * FROM `£Ô£´a` JOIN `£Ô£´b` USING (`£Ã£±`); +SELECT * FROM `£Ô£´a` INNER JOIN `£Ô£´b` USING (`£Ã£±`); +SELECT * FROM `£Ô£´a` CROSS JOIN `£Ô£´b`; +SELECT * FROM `£Ô£´a` LEFT JOIN `£Ô£´b` USING (`£Ã£±`); +SELECT * FROM `£Ô£´a` LEFT JOIN `£Ô£´b` ON (`£Ô£´a`.`£Ã£±` = `£Ô£´b`.`£Ã£±`); +SELECT * FROM `£Ô£´b` RIGHT JOIN `£Ô£´a` USING (`£Ã£±`); +SELECT * FROM `£Ô£´b` RIGHT JOIN `£Ô£´a` ON (`£Ô£´a`.`£Ã£±` = `£Ô£´b`.`£Ã£±`); +SELECT * FROM `£Ô£µa` JOIN `£Ô£µb`; +SELECT * FROM `£Ô£µa` INNER JOIN `£Ô£µb`; +SELECT * FROM `£Ô£µa` JOIN `£Ô£µb` USING (`£Ã£±`); +SELECT * FROM `£Ô£µa` INNER JOIN `£Ô£µb` USING (`£Ã£±`); +SELECT * FROM `£Ô£µa` CROSS JOIN `£Ô£µb`; +SELECT * FROM `£Ô£µa` LEFT JOIN `£Ô£µb` USING (`£Ã£±`); +SELECT * FROM `£Ô£µa` LEFT JOIN `£Ô£µb` ON (`£Ô£µa`.`£Ã£±` = `£Ô£µb`.`£Ã£±`); +SELECT * FROM `£Ô£µb` RIGHT JOIN `£Ô£µa` USING (`£Ã£±`); +SELECT * FROM `£Ô£µb` RIGHT JOIN `£Ô£µa` ON (`£Ô£µa`.`£Ã£±` = `£Ô£µb`.`£Ã£±`); +SELECT * FROM `£Ô£¶a` JOIN `£Ô£¶b`; +SELECT * FROM `£Ô£¶a` INNER JOIN `£Ô£¶b`; +SELECT * FROM `£Ô£¶a` JOIN `£Ô£¶b` USING (`£Ã£±`); +SELECT * FROM `£Ô£¶a` INNER JOIN `£Ô£¶b` USING (`£Ã£±`); +SELECT * FROM `£Ô£¶a` CROSS JOIN `£Ô£¶b`; +SELECT * FROM `£Ô£¶a` LEFT JOIN `£Ô£¶b` USING (`£Ã£±`); +SELECT * FROM `£Ô£¶a` LEFT JOIN `£Ô£¶b` ON (`£Ô£¶a`.`£Ã£±` = `£Ô£¶b`.`£Ã£±`); +SELECT * FROM `£Ô£¶b` RIGHT JOIN `£Ô£¶a` USING (`£Ã£±`); +SELECT * FROM `£Ô£¶b` RIGHT JOIN `£Ô£¶a` ON (`£Ô£¶a`.`£Ã£±` = `£Ô£¶b`.`£Ã£±`); + +#Test for heap +SELECT * FROM `£Ô£·a` JOIN `£Ô£·b`; +SELECT * FROM `£Ô£·a` INNER JOIN `£Ô£·b`; +SELECT * FROM `£Ô£·a` JOIN `£Ô£·b` USING (`£Ã£±`); +SELECT * FROM `£Ô£·a` INNER JOIN `£Ô£·b` USING (`£Ã£±`); +SELECT * FROM `£Ô£·a` CROSS JOIN `£Ô£·b`; +SELECT * FROM `£Ô£·a` LEFT JOIN `£Ô£·b` USING (`£Ã£±`); +SELECT * FROM `£Ô£·a` LEFT JOIN `£Ô£·b` ON (`£Ô£·a`.`£Ã£±` = `£Ô£·b`.`£Ã£±`); +SELECT * FROM `£Ô£·b` RIGHT JOIN `£Ô£·a` USING (`£Ã£±`); +SELECT * FROM `£Ô£·b` RIGHT JOIN `£Ô£·a` ON (`£Ô£·a`.`£Ã£±` = `£Ô£·b`.`£Ã£±`); +SELECT * FROM `£Ô£¸a` JOIN `£Ô£¸b`; +SELECT * FROM `£Ô£¸a` INNER JOIN `£Ô£¸b`; +SELECT * FROM `£Ô£¸a` JOIN `£Ô£¸b` USING (`£Ã£±`); +SELECT * FROM `£Ô£¸a` INNER JOIN `£Ô£¸b` USING (`£Ã£±`); +SELECT * FROM `£Ô£¸a` CROSS JOIN `£Ô£¸b`; +SELECT * FROM `£Ô£¸a` LEFT JOIN `£Ô£¸b` USING (`£Ã£±`); +SELECT * FROM `£Ô£¸a` LEFT JOIN `£Ô£¸b` ON (`£Ô£¸a`.`£Ã£±` = `£Ô£¸b`.`£Ã£±`); +SELECT * FROM `£Ô£¸b` RIGHT JOIN `£Ô£¸a` USING (`£Ã£±`); +SELECT * FROM `£Ô£¸b` RIGHT JOIN `£Ô£¸a` ON (`£Ô£¸a`.`£Ã£±` = `£Ô£¸b`.`£Ã£±`); +SELECT * FROM `£Ô£¹a` JOIN `£Ô£¹b`; +SELECT * FROM `£Ô£¹a` INNER JOIN `£Ô£¹b`; +SELECT * FROM `£Ô£¹a` JOIN `£Ô£¹b` USING (`£Ã£±`); +SELECT * FROM `£Ô£¹a` INNER JOIN `£Ô£¹b` USING (`£Ã£±`); +SELECT * FROM `£Ô£¹a` CROSS JOIN `£Ô£¹b`; +SELECT * FROM `£Ô£¹a` LEFT JOIN `£Ô£¹b` USING (`£Ã£±`); +SELECT * FROM `£Ô£¹a` LEFT JOIN `£Ô£¹b` ON (`£Ô£¹a`.`£Ã£±` = `£Ô£¹b`.`£Ã£±`); +SELECT * FROM `£Ô£¹b` RIGHT JOIN `£Ô£¹a` USING (`£Ã£±`); +SELECT * FROM `£Ô£¹b` RIGHT JOIN `£Ô£¹a` ON (`£Ô£¹a`.`£Ã£±` = `£Ô£¹b`.`£Ã£±`); + +#Test for heap +SELECT * FROM `£Ô£±£°a` JOIN `£Ô£±£°b`; +SELECT * FROM `£Ô£±£°a` INNER JOIN `£Ô£±£°b`; +SELECT * FROM `£Ô£±£°a` JOIN `£Ô£±£°b` USING (`£Ã£±`); +SELECT * FROM `£Ô£±£°a` INNER JOIN `£Ô£±£°b` USING (`£Ã£±`); +SELECT * FROM `£Ô£±£°a` CROSS JOIN `£Ô£±£°b`; +SELECT * FROM `£Ô£±£°a` LEFT JOIN `£Ô£±£°b` USING (`£Ã£±`); +SELECT * FROM `£Ô£±£°a` LEFT JOIN `£Ô£±£°b` ON (`£Ô£±£°a`.`£Ã£±` = `£Ô£±£°b`.`£Ã£±`); +SELECT * FROM `£Ô£±£°b` RIGHT JOIN `£Ô£±£°a` USING (`£Ã£±`); +SELECT * FROM `£Ô£±£°b` RIGHT JOIN `£Ô£±£°a` ON (`£Ô£±£°a`.`£Ã£±` = `£Ô£±£°b`.`£Ã£±`); +SELECT * FROM `£Ô£±£±a` JOIN `£Ô£±£±b`; +SELECT * FROM `£Ô£±£±a` INNER JOIN `£Ô£±£±b`; +SELECT * FROM `£Ô£±£±a` JOIN `£Ô£±£±b` USING (`£Ã£±`); +SELECT * FROM `£Ô£±£±a` INNER JOIN `£Ô£±£±b` USING (`£Ã£±`); +SELECT * FROM `£Ô£±£±a` CROSS JOIN `£Ô£±£±b`; +SELECT * FROM `£Ô£±£±a` LEFT JOIN `£Ô£±£±b` USING (`£Ã£±`); +SELECT * FROM `£Ô£±£±a` LEFT JOIN `£Ô£±£±b` ON (`£Ô£±£±a`.`£Ã£±` = `£Ô£±£±b`.`£Ã£±`); +SELECT * FROM `£Ô£±£±b` RIGHT JOIN `£Ô£±£±a` USING (`£Ã£±`); +SELECT * FROM `£Ô£±£±b` RIGHT JOIN `£Ô£±£±a` ON (`£Ô£±£±a`.`£Ã£±` = `£Ô£±£±b`.`£Ã£±`); +SELECT * FROM `£Ô£±£²a` JOIN `£Ô£±£²b`; +SELECT * FROM `£Ô£±£²a` INNER JOIN `£Ô£±£²b`; +SELECT * FROM `£Ô£±£²a` JOIN `£Ô£±£²b` USING (`£Ã£±`); +SELECT * FROM `£Ô£±£²a` INNER JOIN `£Ô£±£²b` USING (`£Ã£±`); +SELECT * FROM `£Ô£±£²a` CROSS JOIN `£Ô£±£²b`; +SELECT * FROM `£Ô£±£²a` LEFT JOIN `£Ô£±£²b` USING (`£Ã£±`); +SELECT * FROM `£Ô£±£²a` LEFT JOIN `£Ô£±£²b` ON (`£Ô£±£²a`.`£Ã£±` = `£Ô£±£²b`.`£Ã£±`); +SELECT * FROM `£Ô£±£²b` RIGHT JOIN `£Ô£±£²a` USING (`£Ã£±`); +SELECT * FROM `£Ô£±£²b` RIGHT JOIN `£Ô£±£²a` ON (`£Ô£±£²a`.`£Ã£±` = `£Ô£±£²b`.`£Ã£±`); + +DROP TABLE `£Ô£±a`; +DROP TABLE `£Ô£±b`; +DROP TABLE `£Ô£²a`; +DROP TABLE `£Ô£²b`; +DROP TABLE `£Ô£³a`; +DROP TABLE `£Ô£³b`; +DROP TABLE `£Ô£´a`; +DROP TABLE `£Ô£´b`; +DROP TABLE `£Ô£µa`; +DROP TABLE `£Ô£µb`; +DROP TABLE `£Ô£¶a`; +DROP TABLE `£Ô£¶b`; +DROP TABLE `£Ô£·a`; +DROP TABLE `£Ô£·b`; +DROP TABLE `£Ô£¸a`; +DROP TABLE `£Ô£¸b`; +DROP TABLE `£Ô£¹a`; +DROP TABLE `£Ô£¹b`; +DROP TABLE `£Ô£±£°a`; +DROP TABLE `£Ô£±£°b`; +DROP TABLE `£Ô£±£±a`; +DROP TABLE `£Ô£±£±b`; +DROP TABLE `£Ô£±£²a`; +DROP TABLE `£Ô£±£²b`; diff --git a/mysql-test/suite/jp/t/jp_join_utf8.test b/mysql-test/suite/jp/t/jp_join_utf8.test new file mode 100755 index 00000000000..0b2f033f8bb --- /dev/null +++ b/mysql-test/suite/jp/t/jp_join_utf8.test @@ -0,0 +1,217 @@ +--disable_warnings +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +drop table if exists `T11`; +drop table if exists `T12`; +--enable_warnings + +# +# Test table JOIN using Japanese characters in utf8 +# + +SET NAMES utf8; +SET character_set_database = utf8; + +CREATE TABLE `T1a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T1b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T5a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T5b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼–a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼–b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼—a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼—b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T8a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T8b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼™a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼™b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T1ï¼a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T1ï¼b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T11a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T11b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T12a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T12b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; + +#insert the following data in each table +# jisx0201 hankaku-katakana data +# jisx0208 data +# jisx0212 supplemental character data + +INSERT INTO `T1a` VALUES ('ï½±'),('ï½¶'),('ï½»'); +INSERT INTO `T1b` VALUES ('ï½±'); +INSERT INTO `ï¼´ï¼’a` VALUES ('ã‚'),('ã‹'),('ã•'); +INSERT INTO `ï¼´ï¼’b` VALUES ('ã‚'); +INSERT INTO `T3a` VALUES ('é¾”'),('é¾–'),('é¾—'); +INSERT INTO `T3b` VALUES ('é¾”'); +INSERT INTO `ï¼´ï¼”a` VALUES ('ï½±'),('ï½¶'),('ï½»'); +INSERT INTO `ï¼´ï¼”b` VALUES ('ï½±'); +INSERT INTO `T5a` VALUES ('ã‚'),('ã‹'),('ã•'); +INSERT INTO `T5b` VALUES ('ã‚'); +INSERT INTO `ï¼´ï¼–a` VALUES ('é¾”'),('é¾–'),('é¾—'); +INSERT INTO `ï¼´ï¼–b` VALUES ('é¾”'); +INSERT INTO `ï¼´ï¼—a` VALUES ('ï½±'),('ï½¶'),('ï½»'); +INSERT INTO `ï¼´ï¼—b` VALUES ('ï½±'); +INSERT INTO `T8a` VALUES ('ã‚'),('ã‹'),('ã•'); +INSERT INTO `T8b` VALUES ('ã‚'); +INSERT INTO `ï¼´ï¼™a` VALUES ('é¾”'),('é¾–'),('é¾—'); +INSERT INTO `ï¼´ï¼™b` VALUES ('é¾”'); +INSERT INTO `T1ï¼a` VALUES ('ï½±'),('ï½¶'),('ï½»'); +INSERT INTO `T1ï¼b` VALUES ('ï½±'); +INSERT INTO `T11a` VALUES ('ã‚'),('ã‹'),('ã•'); +INSERT INTO `T11b` VALUES ('ã‚'); +INSERT INTO `T12a` VALUES ('é¾”'),('é¾–'),('é¾—'); +INSERT INTO `T12b` VALUES ('é¾”'); + +#Test for innodb +SELECT * FROM `T1a` JOIN `T1b`; +SELECT * FROM `T1a` INNER JOIN `T1b`; +SELECT * FROM `T1a` JOIN `T1b` USING (`C1`); +SELECT * FROM `T1a` INNER JOIN `T1b` USING (`C1`); +SELECT * FROM `T1a` CROSS JOIN `T1b`; +SELECT * FROM `T1a` LEFT JOIN `T1b` USING (`C1`); +SELECT * FROM `T1a` LEFT JOIN `T1b` ON (`T1a`.`C1` = `T1b`.`C1`); +SELECT * FROM `T1b` RIGHT JOIN `T1a` USING (`C1`); +SELECT * FROM `T1b` RIGHT JOIN `T1a` ON (`T1a`.`C1` = `T1b`.`C1`); +SELECT * FROM `ï¼´ï¼’a` JOIN `ï¼´ï¼’b`; +SELECT * FROM `ï¼´ï¼’a` INNER JOIN `ï¼´ï¼’b`; +SELECT * FROM `ï¼´ï¼’a` JOIN `ï¼´ï¼’b` USING (`C1`); +SELECT * FROM `ï¼´ï¼’a` INNER JOIN `ï¼´ï¼’b` USING (`C1`); +SELECT * FROM `ï¼´ï¼’a` CROSS JOIN `ï¼´ï¼’b`; +SELECT * FROM `ï¼´ï¼’a` LEFT JOIN `ï¼´ï¼’b` USING (`C1`); +SELECT * FROM `ï¼´ï¼’a` LEFT JOIN `ï¼´ï¼’b` ON (`ï¼´ï¼’a`.`C1` = `ï¼´ï¼’b`.`C1`); +SELECT * FROM `ï¼´ï¼’b` RIGHT JOIN `ï¼´ï¼’a` USING (`C1`); +SELECT * FROM `ï¼´ï¼’b` RIGHT JOIN `ï¼´ï¼’a` ON (`ï¼´ï¼’a`.`C1` = `ï¼´ï¼’b`.`C1`); +SELECT * FROM `T3a` JOIN `T3b`; +SELECT * FROM `T3a` INNER JOIN `T3b`; +SELECT * FROM `T3a` JOIN `T3b` USING (`C1`); +SELECT * FROM `T3a` INNER JOIN `T3b` USING (`C1`); +SELECT * FROM `T3a` CROSS JOIN `T3b`; +SELECT * FROM `T3a` LEFT JOIN `T3b` USING (`C1`); +SELECT * FROM `T3a` LEFT JOIN `T3b` ON (`T3a`.`C1` = `T3b`.`C1`); +SELECT * FROM `T3b` RIGHT JOIN `T3a` USING (`C1`); +SELECT * FROM `T3b` RIGHT JOIN `T3a` ON (`T3a`.`C1` = `T3b`.`C1`); + +#Test for myisam +SELECT * FROM `ï¼´ï¼”a` JOIN `ï¼´ï¼”b`; +SELECT * FROM `ï¼´ï¼”a` INNER JOIN `ï¼´ï¼”b`; +SELECT * FROM `ï¼´ï¼”a` JOIN `ï¼´ï¼”b` USING (`C1`); +SELECT * FROM `ï¼´ï¼”a` INNER JOIN `ï¼´ï¼”b` USING (`C1`); +SELECT * FROM `ï¼´ï¼”a` CROSS JOIN `ï¼´ï¼”b`; +SELECT * FROM `ï¼´ï¼”a` LEFT JOIN `ï¼´ï¼”b` USING (`C1`); +SELECT * FROM `ï¼´ï¼”a` LEFT JOIN `ï¼´ï¼”b` ON (`ï¼´ï¼”a`.`C1` = `ï¼´ï¼”b`.`C1`); +SELECT * FROM `ï¼´ï¼”b` RIGHT JOIN `ï¼´ï¼”a` USING (`C1`); +SELECT * FROM `ï¼´ï¼”b` RIGHT JOIN `ï¼´ï¼”a` ON (`ï¼´ï¼”a`.`C1` = `ï¼´ï¼”b`.`C1`); +SELECT * FROM `T5a` JOIN `T5b`; +SELECT * FROM `T5a` INNER JOIN `T5b`; +SELECT * FROM `T5a` JOIN `T5b` USING (`C1`); +SELECT * FROM `T5a` INNER JOIN `T5b` USING (`C1`); +SELECT * FROM `T5a` CROSS JOIN `T5b`; +SELECT * FROM `T5a` LEFT JOIN `T5b` USING (`C1`); +SELECT * FROM `T5a` LEFT JOIN `T5b` ON (`T5a`.`C1` = `T5b`.`C1`); +SELECT * FROM `T5b` RIGHT JOIN `T5a` USING (`C1`); +SELECT * FROM `T5b` RIGHT JOIN `T5a` ON (`T5a`.`C1` = `T5b`.`C1`); +SELECT * FROM `ï¼´ï¼–a` JOIN `ï¼´ï¼–b`; +SELECT * FROM `ï¼´ï¼–a` INNER JOIN `ï¼´ï¼–b`; +SELECT * FROM `ï¼´ï¼–a` JOIN `ï¼´ï¼–b` USING (`C1`); +SELECT * FROM `ï¼´ï¼–a` INNER JOIN `ï¼´ï¼–b` USING (`C1`); +SELECT * FROM `ï¼´ï¼–a` CROSS JOIN `ï¼´ï¼–b`; +SELECT * FROM `ï¼´ï¼–a` LEFT JOIN `ï¼´ï¼–b` USING (`C1`); +SELECT * FROM `ï¼´ï¼–a` LEFT JOIN `ï¼´ï¼–b` ON (`ï¼´ï¼–a`.`C1` = `ï¼´ï¼–b`.`C1`); +SELECT * FROM `ï¼´ï¼–b` RIGHT JOIN `ï¼´ï¼–a` USING (`C1`); +SELECT * FROM `ï¼´ï¼–b` RIGHT JOIN `ï¼´ï¼–a` ON (`ï¼´ï¼–a`.`C1` = `ï¼´ï¼–b`.`C1`); + +#Test for heap +SELECT * FROM `ï¼´ï¼—a` JOIN `ï¼´ï¼—b`; +SELECT * FROM `ï¼´ï¼—a` INNER JOIN `ï¼´ï¼—b`; +SELECT * FROM `ï¼´ï¼—a` JOIN `ï¼´ï¼—b` USING (`C1`); +SELECT * FROM `ï¼´ï¼—a` INNER JOIN `ï¼´ï¼—b` USING (`C1`); +SELECT * FROM `ï¼´ï¼—a` CROSS JOIN `ï¼´ï¼—b`; +SELECT * FROM `ï¼´ï¼—a` LEFT JOIN `ï¼´ï¼—b` USING (`C1`); +SELECT * FROM `ï¼´ï¼—a` LEFT JOIN `ï¼´ï¼—b` ON (`ï¼´ï¼—a`.`C1` = `ï¼´ï¼—b`.`C1`); +SELECT * FROM `ï¼´ï¼—b` RIGHT JOIN `ï¼´ï¼—a` USING (`C1`); +SELECT * FROM `ï¼´ï¼—b` RIGHT JOIN `ï¼´ï¼—a` ON (`ï¼´ï¼—a`.`C1` = `ï¼´ï¼—b`.`C1`); +SELECT * FROM `T8a` JOIN `T8b`; +SELECT * FROM `T8a` INNER JOIN `T8b`; +SELECT * FROM `T8a` JOIN `T8b` USING (`C1`); +SELECT * FROM `T8a` INNER JOIN `T8b` USING (`C1`); +SELECT * FROM `T8a` CROSS JOIN `T8b`; +SELECT * FROM `T8a` LEFT JOIN `T8b` USING (`C1`); +SELECT * FROM `T8a` LEFT JOIN `T8b` ON (`T8a`.`C1` = `T8b`.`C1`); +SELECT * FROM `T8b` RIGHT JOIN `T8a` USING (`C1`); +SELECT * FROM `T8b` RIGHT JOIN `T8a` ON (`T8a`.`C1` = `T8b`.`C1`); +SELECT * FROM `ï¼´ï¼™a` JOIN `ï¼´ï¼™b`; +SELECT * FROM `ï¼´ï¼™a` INNER JOIN `ï¼´ï¼™b`; +SELECT * FROM `ï¼´ï¼™a` JOIN `ï¼´ï¼™b` USING (`C1`); +SELECT * FROM `ï¼´ï¼™a` INNER JOIN `ï¼´ï¼™b` USING (`C1`); +SELECT * FROM `ï¼´ï¼™a` CROSS JOIN `ï¼´ï¼™b`; +SELECT * FROM `ï¼´ï¼™a` LEFT JOIN `ï¼´ï¼™b` USING (`C1`); +SELECT * FROM `ï¼´ï¼™a` LEFT JOIN `ï¼´ï¼™b` ON (`ï¼´ï¼™a`.`C1` = `ï¼´ï¼™b`.`C1`); +SELECT * FROM `ï¼´ï¼™b` RIGHT JOIN `ï¼´ï¼™a` USING (`C1`); +SELECT * FROM `ï¼´ï¼™b` RIGHT JOIN `ï¼´ï¼™a` ON (`ï¼´ï¼™a`.`C1` = `ï¼´ï¼™b`.`C1`); + +#Test for heap +SELECT * FROM `T1ï¼a` JOIN `T1ï¼b`; +SELECT * FROM `T1ï¼a` INNER JOIN `T1ï¼b`; +SELECT * FROM `T1ï¼a` JOIN `T1ï¼b` USING (`C1`); +SELECT * FROM `T1ï¼a` INNER JOIN `T1ï¼b` USING (`C1`); +SELECT * FROM `T1ï¼a` CROSS JOIN `T1ï¼b`; +SELECT * FROM `T1ï¼a` LEFT JOIN `T1ï¼b` USING (`C1`); +SELECT * FROM `T1ï¼a` LEFT JOIN `T1ï¼b` ON (`T1ï¼a`.`C1` = `T1ï¼b`.`C1`); +SELECT * FROM `T1ï¼b` RIGHT JOIN `T1ï¼a` USING (`C1`); +SELECT * FROM `T1ï¼b` RIGHT JOIN `T1ï¼a` ON (`T1ï¼a`.`C1` = `T1ï¼b`.`C1`); +SELECT * FROM `T11a` JOIN `T11b`; +SELECT * FROM `T11a` INNER JOIN `T11b`; +SELECT * FROM `T11a` JOIN `T11b` USING (`C1`); +SELECT * FROM `T11a` INNER JOIN `T11b` USING (`C1`); +SELECT * FROM `T11a` CROSS JOIN `T11b`; +SELECT * FROM `T11a` LEFT JOIN `T11b` USING (`C1`); +SELECT * FROM `T11a` LEFT JOIN `T11b` ON (`T11a`.`C1` = `T11b`.`C1`); +SELECT * FROM `T11b` RIGHT JOIN `T11a` USING (`C1`); +SELECT * FROM `T11b` RIGHT JOIN `T11a` ON (`T11a`.`C1` = `T11b`.`C1`); +SELECT * FROM `T12a` JOIN `T12b`; +SELECT * FROM `T12a` INNER JOIN `T12b`; +SELECT * FROM `T12a` JOIN `T12b` USING (`C1`); +SELECT * FROM `T12a` INNER JOIN `T12b` USING (`C1`); +SELECT * FROM `T12a` CROSS JOIN `T12b`; +SELECT * FROM `T12a` LEFT JOIN `T12b` USING (`C1`); +SELECT * FROM `T12a` LEFT JOIN `T12b` ON (`T12a`.`C1` = `T12b`.`C1`); +SELECT * FROM `T12b` RIGHT JOIN `T12a` USING (`C1`); +SELECT * FROM `T12b` RIGHT JOIN `T12a` ON (`T12a`.`C1` = `T12b`.`C1`); + +DROP TABLE `T1a`; +DROP TABLE `T1b`; +DROP TABLE `ï¼´ï¼’a`; +DROP TABLE `ï¼´ï¼’b`; +DROP TABLE `T3a`; +DROP TABLE `T3b`; +DROP TABLE `ï¼´ï¼”a`; +DROP TABLE `ï¼´ï¼”b`; +DROP TABLE `T5a`; +DROP TABLE `T5b`; +DROP TABLE `ï¼´ï¼–a`; +DROP TABLE `ï¼´ï¼–b`; +DROP TABLE `ï¼´ï¼—a`; +DROP TABLE `ï¼´ï¼—b`; +DROP TABLE `T8a`; +DROP TABLE `T8b`; +DROP TABLE `ï¼´ï¼™a`; +DROP TABLE `ï¼´ï¼™b`; +DROP TABLE `T1ï¼a`; +DROP TABLE `T1ï¼b`; +DROP TABLE `T11a`; +DROP TABLE `T11b`; +DROP TABLE `T12a`; +DROP TABLE `T12b`; diff --git a/mysql-test/suite/jp/t/jp_left_sjis.test b/mysql-test/suite/jp/t/jp_left_sjis.test new file mode 100755 index 00000000000..5d69d9892e2 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_left_sjis.test @@ -0,0 +1,141 @@ +--character_set sjis +--disable_warnings +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +drop table if exists `‚s‚P‚P`; +drop table if exists `‚s‚P‚Q`; +--enable_warnings + +# +# Test LEFT() function with Japanese character in sjis encoding +# + +SET NAMES sjis; +SET character_set_database = sjis; + +CREATE TABLE `‚s‚P` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Q` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚R` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚S` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚T` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚U` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚V` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚W` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚X` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚O` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚P` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚Q` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; + +INSERT INTO `‚s‚P` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +INSERT INTO `‚s‚S` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +INSERT INTO `‚s‚V` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); + +#InnoDB +SELECT `‚b‚P`, LEFT(`‚b‚P`,0) FROM `‚s‚P`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,1) FROM `‚s‚P`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,2) FROM `‚s‚P`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,3) FROM `‚s‚P`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,4) FROM `‚s‚P`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,5) FROM `‚s‚P`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,0) FROM `‚s‚Q`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,1) FROM `‚s‚Q`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,2) FROM `‚s‚Q`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,3) FROM `‚s‚Q`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,4) FROM `‚s‚Q`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,5) FROM `‚s‚Q`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,0) FROM `‚s‚R`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,1) FROM `‚s‚R`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,2) FROM `‚s‚R`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,3) FROM `‚s‚R`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,4) FROM `‚s‚R`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,5) FROM `‚s‚R`; + +#MyISAM +SELECT `‚b‚P`, LEFT(`‚b‚P`,0) FROM `‚s‚S`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,1) FROM `‚s‚S`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,2) FROM `‚s‚S`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,3) FROM `‚s‚S`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,4) FROM `‚s‚S`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,5) FROM `‚s‚S`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,0) FROM `‚s‚T`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,1) FROM `‚s‚T`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,2) FROM `‚s‚T`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,3) FROM `‚s‚T`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,4) FROM `‚s‚T`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,5) FROM `‚s‚T`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,0) FROM `‚s‚U`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,1) FROM `‚s‚U`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,2) FROM `‚s‚U`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,3) FROM `‚s‚U`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,4) FROM `‚s‚U`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,5) FROM `‚s‚U`; + +#HEAP +SELECT `‚b‚P`, LEFT(`‚b‚P`,0) FROM `‚s‚V`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,1) FROM `‚s‚V`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,2) FROM `‚s‚V`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,3) FROM `‚s‚V`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,4) FROM `‚s‚V`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,5) FROM `‚s‚V`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,0) FROM `‚s‚W`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,1) FROM `‚s‚W`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,2) FROM `‚s‚W`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,3) FROM `‚s‚W`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,4) FROM `‚s‚W`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,5) FROM `‚s‚W`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,0) FROM `‚s‚X`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,1) FROM `‚s‚X`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,2) FROM `‚s‚X`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,3) FROM `‚s‚X`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,4) FROM `‚s‚X`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,5) FROM `‚s‚X`; + +#BDB +SELECT `‚b‚P`, LEFT(`‚b‚P`,0) FROM `‚s‚P‚O`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,1) FROM `‚s‚P‚O`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,2) FROM `‚s‚P‚O`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,3) FROM `‚s‚P‚O`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,4) FROM `‚s‚P‚O`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,5) FROM `‚s‚P‚O`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,0) FROM `‚s‚P‚P`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,1) FROM `‚s‚P‚P`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,2) FROM `‚s‚P‚P`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,3) FROM `‚s‚P‚P`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,4) FROM `‚s‚P‚P`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,5) FROM `‚s‚P‚P`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,0) FROM `‚s‚P‚Q`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,1) FROM `‚s‚P‚Q`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,2) FROM `‚s‚P‚Q`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,3) FROM `‚s‚P‚Q`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,4) FROM `‚s‚P‚Q`; +SELECT `‚b‚P`, LEFT(`‚b‚P`,5) FROM `‚s‚P‚Q`; + +DROP TABLE `‚s‚P`; +DROP TABLE `‚s‚Q`; +DROP TABLE `‚s‚R`; +DROP TABLE `‚s‚S`; +DROP TABLE `‚s‚T`; +DROP TABLE `‚s‚U`; +DROP TABLE `‚s‚V`; +DROP TABLE `‚s‚W`; +DROP TABLE `‚s‚X`; +DROP TABLE `‚s‚P‚O`; +DROP TABLE `‚s‚P‚P`; +DROP TABLE `‚s‚P‚Q`; diff --git a/mysql-test/suite/jp/t/jp_left_ucs2.test b/mysql-test/suite/jp/t/jp_left_ucs2.test new file mode 100755 index 00000000000..59d10b7d736 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_left_ucs2.test @@ -0,0 +1,143 @@ +--source include/have_ucs2.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +--enable_warnings + +# +# Test LEFT() function with Japanese character in ucs2 encoding +# + +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; + +CREATE TABLE `£Ô£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; + +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); + +#InnoDB +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£±`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£±`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£±`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£±`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£±`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£±`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£²`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£²`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£²`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£²`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£²`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£²`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£³`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£³`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£³`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£³`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£³`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£³`; + +#MyISAM +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£´`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£´`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£´`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£´`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£´`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£´`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£µ`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£µ`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£µ`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£µ`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£µ`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£µ`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£¶`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£¶`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£¶`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£¶`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£¶`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£¶`; + +#HEAP +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£·`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£·`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£·`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£·`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£·`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£·`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£¸`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£¸`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£¸`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£¸`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£¸`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£¸`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£¹`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£¹`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£¹`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£¹`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£¹`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£¹`; + +#BDB +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£±£°`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£±£°`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£±£°`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£±£°`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£±£°`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£±£°`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£±£±`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£±£±`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£±£±`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£±£±`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£±£±`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£±£±`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£±£²`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£±£²`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£±£²`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£±£²`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£±£²`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£±£²`; + +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/t/jp_left_ujis.test b/mysql-test/suite/jp/t/jp_left_ujis.test new file mode 100755 index 00000000000..718639cd8a4 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_left_ujis.test @@ -0,0 +1,142 @@ +--source include/have_ujis.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +--enable_warnings + +# +# Test LEFT() function with Japanese character in ujis encoding +# + +SET NAMES ujis; +SET character_set_database = ujis; + +CREATE TABLE `£Ô£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; + +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); + +#InnoDB +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£±`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£±`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£±`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£±`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£±`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£±`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£²`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£²`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£²`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£²`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£²`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£²`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£³`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£³`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£³`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£³`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£³`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£³`; + +#MyISAM +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£´`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£´`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£´`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£´`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£´`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£´`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£µ`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£µ`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£µ`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£µ`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£µ`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£µ`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£¶`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£¶`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£¶`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£¶`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£¶`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£¶`; + +#HEAP +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£·`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£·`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£·`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£·`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£·`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£·`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£¸`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£¸`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£¸`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£¸`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£¸`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£¸`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£¹`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£¹`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£¹`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£¹`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£¹`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£¹`; + +#BDB +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£±£°`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£±£°`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£±£°`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£±£°`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£±£°`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£±£°`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£±£±`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£±£±`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£±£±`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£±£±`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£±£±`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£±£±`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,0) FROM `£Ô£±£²`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,1) FROM `£Ô£±£²`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,2) FROM `£Ô£±£²`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,3) FROM `£Ô£±£²`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,4) FROM `£Ô£±£²`; +SELECT `£Ã£±`, LEFT(`£Ã£±`,5) FROM `£Ô£±£²`; + +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/t/jp_left_utf8.test b/mysql-test/suite/jp/t/jp_left_utf8.test new file mode 100755 index 00000000000..f9c99718e0f --- /dev/null +++ b/mysql-test/suite/jp/t/jp_left_utf8.test @@ -0,0 +1,140 @@ +--disable_warnings +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +drop table if exists `T11`; +drop table if exists `T12`; +--enable_warnings + +# +# Test LEFT() function with Japanese character in utf8 encoding +# + +SET NAMES utf8; +SET character_set_database = utf8; + +CREATE TABLE `T1` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T11` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T12` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; + +INSERT INTO `T1` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `T3` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +INSERT INTO `T1ï¼` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `T12` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); + +#InnoDB +SELECT `C1`, LEFT(`C1`,0) FROM `T1`; +SELECT `C1`, LEFT(`C1`,1) FROM `T1`; +SELECT `C1`, LEFT(`C1`,2) FROM `T1`; +SELECT `C1`, LEFT(`C1`,3) FROM `T1`; +SELECT `C1`, LEFT(`C1`,4) FROM `T1`; +SELECT `C1`, LEFT(`C1`,5) FROM `T1`; +SELECT `C1`, LEFT(`C1`,0) FROM `ï¼´ï¼’`; +SELECT `C1`, LEFT(`C1`,1) FROM `ï¼´ï¼’`; +SELECT `C1`, LEFT(`C1`,2) FROM `ï¼´ï¼’`; +SELECT `C1`, LEFT(`C1`,3) FROM `ï¼´ï¼’`; +SELECT `C1`, LEFT(`C1`,4) FROM `ï¼´ï¼’`; +SELECT `C1`, LEFT(`C1`,5) FROM `ï¼´ï¼’`; +SELECT `C1`, LEFT(`C1`,0) FROM `T3`; +SELECT `C1`, LEFT(`C1`,1) FROM `T3`; +SELECT `C1`, LEFT(`C1`,2) FROM `T3`; +SELECT `C1`, LEFT(`C1`,3) FROM `T3`; +SELECT `C1`, LEFT(`C1`,4) FROM `T3`; +SELECT `C1`, LEFT(`C1`,5) FROM `T3`; + +#MyISAM +SELECT `C1`, LEFT(`C1`,0) FROM `ï¼´ï¼”`; +SELECT `C1`, LEFT(`C1`,1) FROM `ï¼´ï¼”`; +SELECT `C1`, LEFT(`C1`,2) FROM `ï¼´ï¼”`; +SELECT `C1`, LEFT(`C1`,3) FROM `ï¼´ï¼”`; +SELECT `C1`, LEFT(`C1`,4) FROM `ï¼´ï¼”`; +SELECT `C1`, LEFT(`C1`,5) FROM `ï¼´ï¼”`; +SELECT `C1`, LEFT(`C1`,0) FROM `T5`; +SELECT `C1`, LEFT(`C1`,1) FROM `T5`; +SELECT `C1`, LEFT(`C1`,2) FROM `T5`; +SELECT `C1`, LEFT(`C1`,3) FROM `T5`; +SELECT `C1`, LEFT(`C1`,4) FROM `T5`; +SELECT `C1`, LEFT(`C1`,5) FROM `T5`; +SELECT `C1`, LEFT(`C1`,0) FROM `ï¼´ï¼–`; +SELECT `C1`, LEFT(`C1`,1) FROM `ï¼´ï¼–`; +SELECT `C1`, LEFT(`C1`,2) FROM `ï¼´ï¼–`; +SELECT `C1`, LEFT(`C1`,3) FROM `ï¼´ï¼–`; +SELECT `C1`, LEFT(`C1`,4) FROM `ï¼´ï¼–`; +SELECT `C1`, LEFT(`C1`,5) FROM `ï¼´ï¼–`; + +#HEAP +SELECT `C1`, LEFT(`C1`,0) FROM `ï¼´ï¼—`; +SELECT `C1`, LEFT(`C1`,1) FROM `ï¼´ï¼—`; +SELECT `C1`, LEFT(`C1`,2) FROM `ï¼´ï¼—`; +SELECT `C1`, LEFT(`C1`,3) FROM `ï¼´ï¼—`; +SELECT `C1`, LEFT(`C1`,4) FROM `ï¼´ï¼—`; +SELECT `C1`, LEFT(`C1`,5) FROM `ï¼´ï¼—`; +SELECT `C1`, LEFT(`C1`,0) FROM `T8`; +SELECT `C1`, LEFT(`C1`,1) FROM `T8`; +SELECT `C1`, LEFT(`C1`,2) FROM `T8`; +SELECT `C1`, LEFT(`C1`,3) FROM `T8`; +SELECT `C1`, LEFT(`C1`,4) FROM `T8`; +SELECT `C1`, LEFT(`C1`,5) FROM `T8`; +SELECT `C1`, LEFT(`C1`,0) FROM `ï¼´ï¼™`; +SELECT `C1`, LEFT(`C1`,1) FROM `ï¼´ï¼™`; +SELECT `C1`, LEFT(`C1`,2) FROM `ï¼´ï¼™`; +SELECT `C1`, LEFT(`C1`,3) FROM `ï¼´ï¼™`; +SELECT `C1`, LEFT(`C1`,4) FROM `ï¼´ï¼™`; +SELECT `C1`, LEFT(`C1`,5) FROM `ï¼´ï¼™`; + +#BDB +SELECT `C1`, LEFT(`C1`,0) FROM `T1ï¼`; +SELECT `C1`, LEFT(`C1`,1) FROM `T1ï¼`; +SELECT `C1`, LEFT(`C1`,2) FROM `T1ï¼`; +SELECT `C1`, LEFT(`C1`,3) FROM `T1ï¼`; +SELECT `C1`, LEFT(`C1`,4) FROM `T1ï¼`; +SELECT `C1`, LEFT(`C1`,5) FROM `T1ï¼`; +SELECT `C1`, LEFT(`C1`,0) FROM `T11`; +SELECT `C1`, LEFT(`C1`,1) FROM `T11`; +SELECT `C1`, LEFT(`C1`,2) FROM `T11`; +SELECT `C1`, LEFT(`C1`,3) FROM `T11`; +SELECT `C1`, LEFT(`C1`,4) FROM `T11`; +SELECT `C1`, LEFT(`C1`,5) FROM `T11`; +SELECT `C1`, LEFT(`C1`,0) FROM `T12`; +SELECT `C1`, LEFT(`C1`,1) FROM `T12`; +SELECT `C1`, LEFT(`C1`,2) FROM `T12`; +SELECT `C1`, LEFT(`C1`,3) FROM `T12`; +SELECT `C1`, LEFT(`C1`,4) FROM `T12`; +SELECT `C1`, LEFT(`C1`,5) FROM `T12`; + +DROP TABLE `T1`; +DROP TABLE `ï¼´ï¼’`; +DROP TABLE `T3`; +DROP TABLE `ï¼´ï¼”`; +DROP TABLE `T5`; +DROP TABLE `ï¼´ï¼–`; +DROP TABLE `ï¼´ï¼—`; +DROP TABLE `T8`; +DROP TABLE `ï¼´ï¼™`; +DROP TABLE `T1ï¼`; +DROP TABLE `T11`; +DROP TABLE `T12`; diff --git a/mysql-test/suite/jp/t/jp_length_sjis.test b/mysql-test/suite/jp/t/jp_length_sjis.test new file mode 100755 index 00000000000..7023891b7f0 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_length_sjis.test @@ -0,0 +1,81 @@ +--character_set sjis +--disable_warnings +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +drop table if exists `‚s‚P‚P`; +drop table if exists `‚s‚P‚Q`; +--enable_warnings + +# +# Test LENGTH() function with Japanese character in sjis encoding +# + +SET NAMES sjis; +SET character_set_database = sjis; + +CREATE TABLE `‚s‚P` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Q` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚R` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚S` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚T` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚U` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚V` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚W` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚X` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚O` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚P` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚Q` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; + +INSERT INTO `‚s‚P` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +INSERT INTO `‚s‚S` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +INSERT INTO `‚s‚V` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); + +#InnoDB +SELECT `‚b‚P`, LENGTH(`‚b‚P`) FROM `‚s‚P`; +SELECT `‚b‚P`, LENGTH(`‚b‚P`) FROM `‚s‚Q`; +SELECT `‚b‚P`, LENGTH(`‚b‚P`) FROM `‚s‚R`; + +#MyISAM +SELECT `‚b‚P`, LENGTH(`‚b‚P`) FROM `‚s‚S`; +SELECT `‚b‚P`, LENGTH(`‚b‚P`) FROM `‚s‚T`; +SELECT `‚b‚P`, LENGTH(`‚b‚P`) FROM `‚s‚U`; + +#HEAP +SELECT `‚b‚P`, LENGTH(`‚b‚P`) FROM `‚s‚V`; +SELECT `‚b‚P`, LENGTH(`‚b‚P`) FROM `‚s‚W`; +SELECT `‚b‚P`, LENGTH(`‚b‚P`) FROM `‚s‚X`; + +#BDB +SELECT `‚b‚P`, LENGTH(`‚b‚P`) FROM `‚s‚P‚O`; +SELECT `‚b‚P`, LENGTH(`‚b‚P`) FROM `‚s‚P‚P`; +SELECT `‚b‚P`, LENGTH(`‚b‚P`) FROM `‚s‚P‚Q`; + +DROP TABLE `‚s‚P`; +DROP TABLE `‚s‚Q`; +DROP TABLE `‚s‚R`; +DROP TABLE `‚s‚S`; +DROP TABLE `‚s‚T`; +DROP TABLE `‚s‚U`; +DROP TABLE `‚s‚V`; +DROP TABLE `‚s‚W`; +DROP TABLE `‚s‚X`; +DROP TABLE `‚s‚P‚O`; +DROP TABLE `‚s‚P‚P`; +DROP TABLE `‚s‚P‚Q`; diff --git a/mysql-test/suite/jp/t/jp_length_ucs2.test b/mysql-test/suite/jp/t/jp_length_ucs2.test new file mode 100755 index 00000000000..9951c9b6cd1 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_length_ucs2.test @@ -0,0 +1,83 @@ +--source include/have_ucs2.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +--enable_warnings + +# +# Test LENGTH() function with Japanese character in ucs2 encoding +# + +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; + +CREATE TABLE `£Ô£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; + +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); + +#InnoDB +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£±`; +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£²`; +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£³`; + +#MyISAM +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£´`; +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£µ`; +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£¶`; + +#HEAP +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£·`; +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£¸`; +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£¹`; + +#BDB +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£±£°`; +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£±£±`; +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£±£²`; + +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/t/jp_length_ujis.test b/mysql-test/suite/jp/t/jp_length_ujis.test new file mode 100755 index 00000000000..ac3aef2c768 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_length_ujis.test @@ -0,0 +1,82 @@ +--source include/have_ujis.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +--enable_warnings + +# +# Test LENGTH() function with Japanese character in ujis encoding +# + +SET NAMES ujis; +SET character_set_database = ujis; + +CREATE TABLE `£Ô£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; + +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); + +#InnoDB +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£±`; +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£²`; +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£³`; + +#MyISAM +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£´`; +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£µ`; +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£¶`; + +#HEAP +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£·`; +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£¸`; +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£¹`; + +#BDB +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£±£°`; +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£±£±`; +SELECT `£Ã£±`, LENGTH(`£Ã£±`) FROM `£Ô£±£²`; + +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/t/jp_length_utf8.test b/mysql-test/suite/jp/t/jp_length_utf8.test new file mode 100755 index 00000000000..5c5021f37be --- /dev/null +++ b/mysql-test/suite/jp/t/jp_length_utf8.test @@ -0,0 +1,80 @@ +--disable_warnings +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +drop table if exists `T11`; +drop table if exists `T12`; +--enable_warnings + +# +# Test LENGTH() function with Japanese character in utf8 encoding +# + +SET NAMES utf8; +SET character_set_database = utf8; + +CREATE TABLE `T1` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T11` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T12` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; + +INSERT INTO `T1` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `T3` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +INSERT INTO `T1ï¼` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `T12` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); + +#InnoDB +SELECT `C1`, LENGTH(`C1`) FROM `T1`; +SELECT `C1`, LENGTH(`C1`) FROM `ï¼´ï¼’`; +SELECT `C1`, LENGTH(`C1`) FROM `T3`; + +#MyISAM +SELECT `C1`, LENGTH(`C1`) FROM `ï¼´ï¼”`; +SELECT `C1`, LENGTH(`C1`) FROM `T5`; +SELECT `C1`, LENGTH(`C1`) FROM `ï¼´ï¼–`; + +#HEAP +SELECT `C1`, LENGTH(`C1`) FROM `ï¼´ï¼—`; +SELECT `C1`, LENGTH(`C1`) FROM `T8`; +SELECT `C1`, LENGTH(`C1`) FROM `ï¼´ï¼™`; + +#BDB +SELECT `C1`, LENGTH(`C1`) FROM `T1ï¼`; +SELECT `C1`, LENGTH(`C1`) FROM `T11`; +SELECT `C1`, LENGTH(`C1`) FROM `T12`; + +DROP TABLE `T1`; +DROP TABLE `ï¼´ï¼’`; +DROP TABLE `T3`; +DROP TABLE `ï¼´ï¼”`; +DROP TABLE `T5`; +DROP TABLE `ï¼´ï¼–`; +DROP TABLE `ï¼´ï¼—`; +DROP TABLE `T8`; +DROP TABLE `ï¼´ï¼™`; +DROP TABLE `T1ï¼`; +DROP TABLE `T11`; +DROP TABLE `T12`; diff --git a/mysql-test/suite/jp/t/jp_like_sjis.test b/mysql-test/suite/jp/t/jp_like_sjis.test new file mode 100755 index 00000000000..5c41b9ff7ef --- /dev/null +++ b/mysql-test/suite/jp/t/jp_like_sjis.test @@ -0,0 +1,168 @@ +--character_set sjis +--disable_warnings +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +drop table if exists `‚s‚P‚P`; +drop table if exists `‚s‚P‚Q`; +--enable_warnings + +# +# Test LIKE pattern matching using Japanese characters in sjis encoding +# + +SET NAMES sjis; +SET character_set_database = sjis; + +CREATE TABLE `‚s‚P` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Q` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚R` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚S` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚T` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚U` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚V` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚W` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚X` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚O` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚P` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚Q` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; + +#Load the following data in each table +# jisx0201 hankaku-katakana data +# jisx0208 data + +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `‚s‚P`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `‚s‚Q`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `‚s‚R`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `‚s‚S`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `‚s‚T`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `‚s‚U`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `‚s‚V`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `‚s‚W`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `‚s‚X`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `‚s‚P‚O`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `‚s‚P‚P`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `‚s‚P‚Q`; + +#InnoDB +SELECT * FROM `‚s‚P` WHERE `‚b‚P` LIKE ' %'; +SELECT * FROM `‚s‚P` WHERE `‚b‚P` LIKE '% %'; +SELECT * FROM `‚s‚P` WHERE `‚b‚P` LIKE '% '; +SELECT * FROM `‚s‚P` WHERE `‚b‚P` LIKE 'À%'; +SELECT * FROM `‚s‚P` WHERE `‚b‚P` LIKE '%ר%'; +SELECT * FROM `‚s‚P` WHERE `‚b‚P` LIKE '%¿'; +SELECT * FROM `‚s‚P` WHERE `‚b‚P` LIKE '°±²³´µ¶·¸¹º»¼½¾¿%'; +SELECT * FROM `‚s‚P` WHERE `‚b‚P` LIKE '%°±²³´µ¶·¸¹º»¼½¾¿%'; +SELECT * FROM `‚s‚P` WHERE `‚b‚P` LIKE '%°±²³´µ¶·¸¹º»¼½¾¿'; +SELECT * FROM `‚s‚Q` WHERE `‚b‚P` LIKE '@%'; +SELECT * FROM `‚s‚Q` WHERE `‚b‚P` LIKE '%@%'; +SELECT * FROM `‚s‚Q` WHERE `‚b‚P` LIKE '%@'; +SELECT * FROM `‚s‚Q` WHERE `‚b‚P` LIKE '‚Æ%'; +SELECT * FROM `‚s‚Q` WHERE `‚b‚P` LIKE '%‚ %'; +SELECT * FROM `‚s‚Q` WHERE `‚b‚P` LIKE '%‚í'; +SELECT * FROM `‚s‚Q` WHERE `‚b‚P` LIKE 'E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚­‚®‚¯‚°‚±%'; +SELECT * FROM `‚s‚Q` WHERE `‚b‚P` LIKE '%E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚­‚®‚¯‚°‚±%'; +SELECT * FROM `‚s‚Q` WHERE `‚b‚P` LIKE '%E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚­‚®‚¯‚°‚±'; +SELECT * FROM `‚s‚R` WHERE `‚b‚P` LIKE 'ƒ\%'; +SELECT * FROM `‚s‚R` WHERE `‚b‚P` LIKE '%–\%'; +SELECT * FROM `‚s‚R` WHERE `‚b‚P` LIKE '%ž\'; +SELECT * FROM `‚s‚R` WHERE `‚b‚P` LIKE 'ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\%'; +SELECT * FROM `‚s‚R` WHERE `‚b‚P` LIKE '%ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\%'; +SELECT * FROM `‚s‚R` WHERE `‚b‚P` LIKE '%ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\'; + +#MyISAM +SELECT * FROM `‚s‚S` WHERE `‚b‚P` LIKE ' %'; +SELECT * FROM `‚s‚S` WHERE `‚b‚P` LIKE '% %'; +SELECT * FROM `‚s‚S` WHERE `‚b‚P` LIKE '% '; +SELECT * FROM `‚s‚S` WHERE `‚b‚P` LIKE 'À%'; +SELECT * FROM `‚s‚S` WHERE `‚b‚P` LIKE '%ר%'; +SELECT * FROM `‚s‚S` WHERE `‚b‚P` LIKE '%¿'; +SELECT * FROM `‚s‚S` WHERE `‚b‚P` LIKE '°±²³´µ¶·¸¹º»¼½¾¿%'; +SELECT * FROM `‚s‚S` WHERE `‚b‚P` LIKE '%°±²³´µ¶·¸¹º»¼½¾¿%'; +SELECT * FROM `‚s‚S` WHERE `‚b‚P` LIKE '%°±²³´µ¶·¸¹º»¼½¾¿'; +SELECT * FROM `‚s‚T` WHERE `‚b‚P` LIKE '@%'; +SELECT * FROM `‚s‚T` WHERE `‚b‚P` LIKE '%@%'; +SELECT * FROM `‚s‚T` WHERE `‚b‚P` LIKE '%@'; +SELECT * FROM `‚s‚T` WHERE `‚b‚P` LIKE '‚Æ%'; +SELECT * FROM `‚s‚T` WHERE `‚b‚P` LIKE '%‚ %'; +SELECT * FROM `‚s‚T` WHERE `‚b‚P` LIKE '%‚í'; +SELECT * FROM `‚s‚T` WHERE `‚b‚P` LIKE 'E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚­‚®‚¯‚°‚±%'; +SELECT * FROM `‚s‚T` WHERE `‚b‚P` LIKE '%E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚­‚®‚¯‚°‚±%'; +SELECT * FROM `‚s‚T` WHERE `‚b‚P` LIKE '%E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚­‚®‚¯‚°‚±'; +SELECT * FROM `‚s‚U` WHERE `‚b‚P` LIKE 'ƒ\%'; +SELECT * FROM `‚s‚U` WHERE `‚b‚P` LIKE '%–\%'; +SELECT * FROM `‚s‚U` WHERE `‚b‚P` LIKE '%ž\'; +SELECT * FROM `‚s‚U` WHERE `‚b‚P` LIKE 'ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\%'; +SELECT * FROM `‚s‚U` WHERE `‚b‚P` LIKE '%ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\%'; +SELECT * FROM `‚s‚U` WHERE `‚b‚P` LIKE '%ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\'; + +#Heap +SELECT * FROM `‚s‚V` WHERE `‚b‚P` LIKE ' %'; +SELECT * FROM `‚s‚V` WHERE `‚b‚P` LIKE '% %'; +SELECT * FROM `‚s‚V` WHERE `‚b‚P` LIKE '% '; +SELECT * FROM `‚s‚V` WHERE `‚b‚P` LIKE 'À%'; +SELECT * FROM `‚s‚V` WHERE `‚b‚P` LIKE '%ר%'; +SELECT * FROM `‚s‚V` WHERE `‚b‚P` LIKE '%¿'; +SELECT * FROM `‚s‚V` WHERE `‚b‚P` LIKE '°±²³´µ¶·¸¹º»¼½¾¿%'; +SELECT * FROM `‚s‚V` WHERE `‚b‚P` LIKE '%°±²³´µ¶·¸¹º»¼½¾¿%'; +SELECT * FROM `‚s‚V` WHERE `‚b‚P` LIKE '%°±²³´µ¶·¸¹º»¼½¾¿'; +SELECT * FROM `‚s‚W` WHERE `‚b‚P` LIKE '@%'; +SELECT * FROM `‚s‚W` WHERE `‚b‚P` LIKE '%@%'; +SELECT * FROM `‚s‚W` WHERE `‚b‚P` LIKE '%@'; +SELECT * FROM `‚s‚W` WHERE `‚b‚P` LIKE '‚Æ%'; +SELECT * FROM `‚s‚W` WHERE `‚b‚P` LIKE '%‚ %'; +SELECT * FROM `‚s‚W` WHERE `‚b‚P` LIKE '%‚í'; +SELECT * FROM `‚s‚W` WHERE `‚b‚P` LIKE 'E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚­‚®‚¯‚°‚±%'; +SELECT * FROM `‚s‚W` WHERE `‚b‚P` LIKE '%E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚­‚®‚¯‚°‚±%'; +SELECT * FROM `‚s‚W` WHERE `‚b‚P` LIKE '%E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚­‚®‚¯‚°‚±'; +SELECT * FROM `‚s‚X` WHERE `‚b‚P` LIKE 'ƒ\%'; +SELECT * FROM `‚s‚X` WHERE `‚b‚P` LIKE '%–\%'; +SELECT * FROM `‚s‚X` WHERE `‚b‚P` LIKE '%ž\'; +SELECT * FROM `‚s‚X` WHERE `‚b‚P` LIKE 'ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\%'; +SELECT * FROM `‚s‚X` WHERE `‚b‚P` LIKE '%ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\%'; +SELECT * FROM `‚s‚X` WHERE `‚b‚P` LIKE '%ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\'; +#BDB +SELECT * FROM `‚s‚P‚O` WHERE `‚b‚P` LIKE ' %'; +SELECT * FROM `‚s‚P‚O` WHERE `‚b‚P` LIKE '% %'; +SELECT * FROM `‚s‚P‚O` WHERE `‚b‚P` LIKE '% '; +SELECT * FROM `‚s‚P‚O` WHERE `‚b‚P` LIKE 'À%'; +SELECT * FROM `‚s‚P‚O` WHERE `‚b‚P` LIKE '%ר%'; +SELECT * FROM `‚s‚P‚O` WHERE `‚b‚P` LIKE '%¿'; +#SELECT * FROM `‚s‚P‚O` WHERE `‚b‚P` LIKE '°±²³´µ¶·¸¹º»¼½¾¿%'; +#SELECT * FROM `‚s‚P‚O` WHERE `‚b‚P` LIKE '%°±²³´µ¶·¸¹º»¼½¾¿%'; +SELECT * FROM `‚s‚P‚O` WHERE `‚b‚P` LIKE '%°±²³´µ¶·¸¹º»¼½¾¿'; +SELECT * FROM `‚s‚P‚P` WHERE `‚b‚P` LIKE '@%'; +SELECT * FROM `‚s‚P‚P` WHERE `‚b‚P` LIKE '%@%'; +SELECT * FROM `‚s‚P‚P` WHERE `‚b‚P` LIKE '%@'; +SELECT * FROM `‚s‚P‚P` WHERE `‚b‚P` LIKE '‚Æ%'; +SELECT * FROM `‚s‚P‚P` WHERE `‚b‚P` LIKE '%‚ %'; +SELECT * FROM `‚s‚P‚P` WHERE `‚b‚P` LIKE '%‚í'; +#SELECT * FROM `‚s‚P‚P` WHERE `‚b‚P` LIKE 'E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚­‚®‚¯‚°‚±%'; +#SELECT * FROM `‚s‚P‚P` WHERE `‚b‚P` LIKE '%E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚­‚®‚¯‚°‚±%'; +#SELECT * FROM `‚s‚P‚P` WHERE `‚b‚P` LIKE '%E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚­‚®‚¯‚°‚±'; +SELECT * FROM `‚s‚P‚Q` WHERE `‚b‚P` LIKE 'ƒ\%'; +SELECT * FROM `‚s‚P‚Q` WHERE `‚b‚P` LIKE '%–\%'; +SELECT * FROM `‚s‚P‚Q` WHERE `‚b‚P` LIKE '%ž\'; +#SELECT * FROM `‚s‚P‚Q` WHERE `‚b‚P` LIKE 'ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\%'; +#SELECT * FROM `‚s‚P‚Q` WHERE `‚b‚P` LIKE '%ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\%'; +#SELECT * FROM `‚s‚P‚Q` WHERE `‚b‚P` LIKE '%ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\'; + +DROP TABLE `‚s‚P`; +DROP TABLE `‚s‚Q`; +DROP TABLE `‚s‚R`; +DROP TABLE `‚s‚S`; +DROP TABLE `‚s‚T`; +DROP TABLE `‚s‚U`; +DROP TABLE `‚s‚V`; +DROP TABLE `‚s‚W`; +DROP TABLE `‚s‚X`; +DROP TABLE `‚s‚P‚O`; +DROP TABLE `‚s‚P‚P`; +DROP TABLE `‚s‚P‚Q`; diff --git a/mysql-test/suite/jp/t/jp_like_ucs2.test b/mysql-test/suite/jp/t/jp_like_ucs2.test new file mode 100755 index 00000000000..feae40de49e --- /dev/null +++ b/mysql-test/suite/jp/t/jp_like_ucs2.test @@ -0,0 +1,271 @@ +--source include/have_ucs2.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +--enable_warnings + +# +# Test LIKE pattern matching using Japanese characters in ucs2 encoding +# + +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; + +CREATE TABLE `£Ô£±` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; + +#Insert the following data in each table +# jisx0201 hankaku-katakana data +# jisx0208 data +# jisx0212 supplemental character data + +INSERT INTO `£Ô£±` VALUES + ('PQRSTUVWXYZ[\\]^_') +,(' Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯') +,('Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿') +,('ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ') +,('ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß'); + +INSERT INTO `£Ô£²` VALUES + ('¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡­¡®¡¯¡°¡±¡²¡³') +,('¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç') +,('¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û') +,('¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³') +,('¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û') +,('¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï') +,('¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³') +,('¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³') +,('¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³') +,('¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³'); + +INSERT INTO `£Ô£³` VALUES + ('¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦') +,('°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç') +,('°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û') +,('°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï') +,('¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³') +,('í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ') +,('íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ'); + +INSERT INTO `£Ô£´` VALUES + ('PQRSTUVWXYZ[\\]^_') +,(' Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯') +,('Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿') +,('ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ') +,('ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß'); + +INSERT INTO `£Ô£µ` VALUES + ('¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡­¡®¡¯¡°¡±¡²¡³') +,('¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç') +,('¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û') +,('¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³') +,('¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û') +,('¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï') +,('¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³') +,('¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³') +,('¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³') +,('¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³'); + +INSERT INTO `£Ô£¶` VALUES + ('¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦') +,('°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç') +,('°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û') +,('°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï') +,('¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³') +,('í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ') +,('íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ'); + +INSERT INTO `£Ô£·` VALUES + ('PQRSTUVWXYZ[\\]^_') +,(' Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯') +,('Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿') +,('ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ') +,('ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß'); + +INSERT INTO `£Ô£¸` VALUES + ('¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡­¡®¡¯¡°¡±¡²¡³') +,('¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç') +,('¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û') +,('¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³') +,('¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û') +,('¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï') +,('¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³') +,('¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³') +,('¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³') +,('¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³'); + +INSERT INTO `£Ô£¹` VALUES + ('¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦') +,('°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç') +,('°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û') +,('°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï') +,('¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³') +,('í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ') +,('íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ'); + +INSERT INTO `£Ô£±£°` VALUES + ('PQRSTUVWXYZ[\\]^_') +,(' Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯') +,('Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿') +,('ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ') +,('ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß'); + +INSERT INTO `£Ô£±£±` VALUES + ('¡¡¡¡¡¢¡£¡¤¡¥¡¦¡§¡¨¡©¡ª¡«¡¬¡­¡®¡¯¡°¡±¡²¡³') +,('¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç') +,('¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û') +,('¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³') +,('¤È¤É¤Ê¤Ë¤Ì¤Í¤Î¤Ï¤Ð¤Ñ¤Ò¤Ó¤Ô¤Õ¤Ö¤×¤Ø¤Ù¤Ú¤Û') +,('¤Ü¤Ý¤Þ¤ß¤à¤á¤â¤ã¤ä¤å¤æ¤ç¤è¤é¤ê¤ë¤ì¤í¤î¤ï') +,('¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³') +,('¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³') +,('¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³') +,('¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³'); + +INSERT INTO `£Ô£±£²` VALUES + ('¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦') +,('°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç') +,('°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û') +,('°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï') +,('¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³') +,('í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ') +,('íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ'); + +#INNODB +SELECT * FROM `£Ô£±` WHERE `£Ã£±` LIKE ' %'; +SELECT * FROM `£Ô£±` WHERE `£Ã£±` LIKE '% %'; +SELECT * FROM `£Ô£±` WHERE `£Ã£±` LIKE '% '; +SELECT * FROM `£Ô£±` WHERE `£Ã£±` LIKE 'ŽÀ%'; +SELECT * FROM `£Ô£±` WHERE `£Ã£±` LIKE '%Ž×ŽØ%'; +SELECT * FROM `£Ô£±` WHERE `£Ã£±` LIKE '%Ž¿'; +SELECT * FROM `£Ô£±` WHERE `£Ã£±` LIKE 'Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿%'; +SELECT * FROM `£Ô£±` WHERE `£Ã£±` LIKE '%Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿%'; +SELECT * FROM `£Ô£±` WHERE `£Ã£±` LIKE '%Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿'; +SELECT * FROM `£Ô£²` WHERE `£Ã£±` LIKE '¡¡%'; +SELECT * FROM `£Ô£²` WHERE `£Ã£±` LIKE '%¡¡%'; +SELECT * FROM `£Ô£²` WHERE `£Ã£±` LIKE '%¡¡'; +SELECT * FROM `£Ô£²` WHERE `£Ã£±` LIKE '¤È%'; +SELECT * FROM `£Ô£²` WHERE `£Ã£±` LIKE '%¤¢%'; +SELECT * FROM `£Ô£²` WHERE `£Ã£±` LIKE '%¤ï'; +SELECT * FROM `£Ô£²` WHERE `£Ã£±` LIKE '¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³%'; +SELECT * FROM `£Ô£²` WHERE `£Ã£±` LIKE '%¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³%'; +SELECT * FROM `£Ô£²` WHERE `£Ã£±` LIKE '%¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³'; +SELECT * FROM `£Ô£³` WHERE `£Ã£±` LIKE 'í´%'; +SELECT * FROM `£Ô£³` WHERE `£Ã£±` LIKE '%í»%'; +SELECT * FROM `£Ô£³` WHERE `£Ã£±` LIKE '%íÇ'; +SELECT * FROM `£Ô£³` WHERE `£Ã£±` LIKE 'í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ%'; +SELECT * FROM `£Ô£³` WHERE `£Ã£±` LIKE '%í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ%'; +SELECT * FROM `£Ô£³` WHERE `£Ã£±` LIKE '%í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ'; + +#MyISAM +SELECT * FROM `£Ô£´` WHERE `£Ã£±` LIKE ' %'; +SELECT * FROM `£Ô£´` WHERE `£Ã£±` LIKE '% %'; +SELECT * FROM `£Ô£´` WHERE `£Ã£±` LIKE '% '; +SELECT * FROM `£Ô£´` WHERE `£Ã£±` LIKE 'ŽÀ%'; +SELECT * FROM `£Ô£´` WHERE `£Ã£±` LIKE '%Ž×ŽØ%'; +SELECT * FROM `£Ô£´` WHERE `£Ã£±` LIKE '%Ž¿'; +SELECT * FROM `£Ô£´` WHERE `£Ã£±` LIKE 'Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿%'; +SELECT * FROM `£Ô£´` WHERE `£Ã£±` LIKE '%Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿%'; +SELECT * FROM `£Ô£´` WHERE `£Ã£±` LIKE '%Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿'; +SELECT * FROM `£Ô£µ` WHERE `£Ã£±` LIKE '¡¡%'; +SELECT * FROM `£Ô£µ` WHERE `£Ã£±` LIKE '%¡¡%'; +SELECT * FROM `£Ô£µ` WHERE `£Ã£±` LIKE '%¡¡'; +SELECT * FROM `£Ô£µ` WHERE `£Ã£±` LIKE '¤È%'; +SELECT * FROM `£Ô£µ` WHERE `£Ã£±` LIKE '%¤¢%'; +SELECT * FROM `£Ô£µ` WHERE `£Ã£±` LIKE '%¤ï'; +SELECT * FROM `£Ô£µ` WHERE `£Ã£±` LIKE '¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³%'; +SELECT * FROM `£Ô£µ` WHERE `£Ã£±` LIKE '%¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³%'; +SELECT * FROM `£Ô£µ` WHERE `£Ã£±` LIKE '%¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³'; +SELECT * FROM `£Ô£¶` WHERE `£Ã£±` LIKE 'í´%'; +SELECT * FROM `£Ô£¶` WHERE `£Ã£±` LIKE '%í»%'; +SELECT * FROM `£Ô£¶` WHERE `£Ã£±` LIKE '%íÇ'; +SELECT * FROM `£Ô£¶` WHERE `£Ã£±` LIKE 'í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ%'; +SELECT * FROM `£Ô£¶` WHERE `£Ã£±` LIKE '%í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ%'; +SELECT * FROM `£Ô£¶` WHERE `£Ã£±` LIKE '%í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ'; + +#Heap +SELECT * FROM `£Ô£·` WHERE `£Ã£±` LIKE ' %'; +SELECT * FROM `£Ô£·` WHERE `£Ã£±` LIKE '% %'; +SELECT * FROM `£Ô£·` WHERE `£Ã£±` LIKE '% '; +SELECT * FROM `£Ô£·` WHERE `£Ã£±` LIKE 'ŽÀ%'; +SELECT * FROM `£Ô£·` WHERE `£Ã£±` LIKE '%Ž×ŽØ%'; +SELECT * FROM `£Ô£·` WHERE `£Ã£±` LIKE '%Ž¿'; +SELECT * FROM `£Ô£·` WHERE `£Ã£±` LIKE 'Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿%'; +SELECT * FROM `£Ô£·` WHERE `£Ã£±` LIKE '%Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿%'; +SELECT * FROM `£Ô£·` WHERE `£Ã£±` LIKE '%Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿'; +SELECT * FROM `£Ô£¸` WHERE `£Ã£±` LIKE '¡¡%'; +SELECT * FROM `£Ô£¸` WHERE `£Ã£±` LIKE '%¡¡%'; +SELECT * FROM `£Ô£¸` WHERE `£Ã£±` LIKE '%¡¡'; +SELECT * FROM `£Ô£¸` WHERE `£Ã£±` LIKE '¤È%'; +SELECT * FROM `£Ô£¸` WHERE `£Ã£±` LIKE '%¤¢%'; +SELECT * FROM `£Ô£¸` WHERE `£Ã£±` LIKE '%¤ï'; +SELECT * FROM `£Ô£¸` WHERE `£Ã£±` LIKE '¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³%'; +SELECT * FROM `£Ô£¸` WHERE `£Ã£±` LIKE '%¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³%'; +SELECT * FROM `£Ô£¸` WHERE `£Ã£±` LIKE '%¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³'; +SELECT * FROM `£Ô£¹` WHERE `£Ã£±` LIKE 'í´%'; +SELECT * FROM `£Ô£¹` WHERE `£Ã£±` LIKE '%í»%'; +SELECT * FROM `£Ô£¹` WHERE `£Ã£±` LIKE '%íÇ'; +SELECT * FROM `£Ô£¹` WHERE `£Ã£±` LIKE 'í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ%'; +SELECT * FROM `£Ô£¹` WHERE `£Ã£±` LIKE '%í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ%'; +SELECT * FROM `£Ô£¹` WHERE `£Ã£±` LIKE '%í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ'; + +#BDB +SELECT * FROM `£Ô£±£°` WHERE `£Ã£±` LIKE ' %'; +SELECT * FROM `£Ô£±£°` WHERE `£Ã£±` LIKE '% %'; +SELECT * FROM `£Ô£±£°` WHERE `£Ã£±` LIKE '% '; +SELECT * FROM `£Ô£±£°` WHERE `£Ã£±` LIKE 'ŽÀ%'; +SELECT * FROM `£Ô£±£°` WHERE `£Ã£±` LIKE '%Ž×ŽØ%'; +SELECT * FROM `£Ô£±£°` WHERE `£Ã£±` LIKE '%Ž¿'; +SELECT * FROM `£Ô£±£°` WHERE `£Ã£±` LIKE 'Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿%'; +SELECT * FROM `£Ô£±£°` WHERE `£Ã£±` LIKE '%Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿%'; +SELECT * FROM `£Ô£±£°` WHERE `£Ã£±` LIKE '%Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿'; +SELECT * FROM `£Ô£±£±` WHERE `£Ã£±` LIKE '¡¡%'; +SELECT * FROM `£Ô£±£±` WHERE `£Ã£±` LIKE '%¡¡%'; +SELECT * FROM `£Ô£±£±` WHERE `£Ã£±` LIKE '%¡¡'; +SELECT * FROM `£Ô£±£±` WHERE `£Ã£±` LIKE '¤È%'; +SELECT * FROM `£Ô£±£±` WHERE `£Ã£±` LIKE '%¤¢%'; +SELECT * FROM `£Ô£±£±` WHERE `£Ã£±` LIKE '%¤ï'; +SELECT * FROM `£Ô£±£±` WHERE `£Ã£±` LIKE '¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³%'; +SELECT * FROM `£Ô£±£±` WHERE `£Ã£±` LIKE '%¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³%'; +SELECT * FROM `£Ô£±£±` WHERE `£Ã£±` LIKE '%¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³'; +SELECT * FROM `£Ô£±£²` WHERE `£Ã£±` LIKE 'í´%'; +SELECT * FROM `£Ô£±£²` WHERE `£Ã£±` LIKE '%í»%'; +SELECT * FROM `£Ô£±£²` WHERE `£Ã£±` LIKE '%íÇ'; +SELECT * FROM `£Ô£±£²` WHERE `£Ã£±` LIKE 'í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ%'; +SELECT * FROM `£Ô£±£²` WHERE `£Ã£±` LIKE '%í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ%'; +SELECT * FROM `£Ô£±£²` WHERE `£Ã£±` LIKE '%í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ'; + +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/t/jp_like_ujis.test b/mysql-test/suite/jp/t/jp_like_ujis.test new file mode 100755 index 00000000000..29ef7c5d48b --- /dev/null +++ b/mysql-test/suite/jp/t/jp_like_ujis.test @@ -0,0 +1,170 @@ +--source include/have_ujis.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +--enable_warnings + +# +# Test LIKE pattern matching using Japanese characters in ujis encoding +# + +SET NAMES ujis; +SET character_set_database = ujis; + +CREATE TABLE `£Ô£±` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; + +#Load the following data in each table +# jisx0201 hankaku-katakana data +# jisx0208 data +# jisx0212 supplemental character data + +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_ujis.dat' INTO TABLE `£Ô£±`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_ujis.dat' INTO TABLE `£Ô£²`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_ujis.dat' INTO TABLE `£Ô£³`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_ujis.dat' INTO TABLE `£Ô£´`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_ujis.dat' INTO TABLE `£Ô£µ`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_ujis.dat' INTO TABLE `£Ô£¶`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_ujis.dat' INTO TABLE `£Ô£·`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_ujis.dat' INTO TABLE `£Ô£¸`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_ujis.dat' INTO TABLE `£Ô£¹`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_ujis.dat' INTO TABLE `£Ô£±£°`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_ujis.dat' INTO TABLE `£Ô£±£±`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_ujis.dat' INTO TABLE `£Ô£±£²`; + +#InnoDB +SELECT * FROM `£Ô£±` WHERE `£Ã£±` LIKE ' %'; +SELECT * FROM `£Ô£±` WHERE `£Ã£±` LIKE '% %'; +SELECT * FROM `£Ô£±` WHERE `£Ã£±` LIKE '% '; +SELECT * FROM `£Ô£±` WHERE `£Ã£±` LIKE 'ŽÀ%'; +SELECT * FROM `£Ô£±` WHERE `£Ã£±` LIKE '%Ž×ŽØ%'; +SELECT * FROM `£Ô£±` WHERE `£Ã£±` LIKE '%Ž¿'; +SELECT * FROM `£Ô£±` WHERE `£Ã£±` LIKE 'Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿%'; +SELECT * FROM `£Ô£±` WHERE `£Ã£±` LIKE '%Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿%'; +SELECT * FROM `£Ô£±` WHERE `£Ã£±` LIKE '%Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿'; +SELECT * FROM `£Ô£²` WHERE `£Ã£±` LIKE '¡¡%'; +SELECT * FROM `£Ô£²` WHERE `£Ã£±` LIKE '%¡¡%'; +SELECT * FROM `£Ô£²` WHERE `£Ã£±` LIKE '%¡¡'; +SELECT * FROM `£Ô£²` WHERE `£Ã£±` LIKE '¤È%'; +SELECT * FROM `£Ô£²` WHERE `£Ã£±` LIKE '%¤¢%'; +SELECT * FROM `£Ô£²` WHERE `£Ã£±` LIKE '%¤ï'; +SELECT * FROM `£Ô£²` WHERE `£Ã£±` LIKE '¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³%'; +SELECT * FROM `£Ô£²` WHERE `£Ã£±` LIKE '%¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³%'; +SELECT * FROM `£Ô£²` WHERE `£Ã£±` LIKE '%¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³'; +SELECT * FROM `£Ô£³` WHERE `£Ã£±` LIKE 'í´%'; +SELECT * FROM `£Ô£³` WHERE `£Ã£±` LIKE '%í»%'; +SELECT * FROM `£Ô£³` WHERE `£Ã£±` LIKE '%íÇ'; +SELECT * FROM `£Ô£³` WHERE `£Ã£±` LIKE 'í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ%'; +SELECT * FROM `£Ô£³` WHERE `£Ã£±` LIKE '%í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ%'; +SELECT * FROM `£Ô£³` WHERE `£Ã£±` LIKE '%í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ'; + +#MyISAM +SELECT * FROM `£Ô£´` WHERE `£Ã£±` LIKE ' %'; +SELECT * FROM `£Ô£´` WHERE `£Ã£±` LIKE '% %'; +SELECT * FROM `£Ô£´` WHERE `£Ã£±` LIKE '% '; +SELECT * FROM `£Ô£´` WHERE `£Ã£±` LIKE 'ŽÀ%'; +SELECT * FROM `£Ô£´` WHERE `£Ã£±` LIKE '%Ž×ŽØ%'; +SELECT * FROM `£Ô£´` WHERE `£Ã£±` LIKE '%Ž¿'; +SELECT * FROM `£Ô£´` WHERE `£Ã£±` LIKE 'Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿%'; +SELECT * FROM `£Ô£´` WHERE `£Ã£±` LIKE '%Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿%'; +SELECT * FROM `£Ô£´` WHERE `£Ã£±` LIKE '%Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿'; +SELECT * FROM `£Ô£µ` WHERE `£Ã£±` LIKE '¡¡%'; +SELECT * FROM `£Ô£µ` WHERE `£Ã£±` LIKE '%¡¡%'; +SELECT * FROM `£Ô£µ` WHERE `£Ã£±` LIKE '%¡¡'; +SELECT * FROM `£Ô£µ` WHERE `£Ã£±` LIKE '¤È%'; +SELECT * FROM `£Ô£µ` WHERE `£Ã£±` LIKE '%¤¢%'; +SELECT * FROM `£Ô£µ` WHERE `£Ã£±` LIKE '%¤ï'; +SELECT * FROM `£Ô£µ` WHERE `£Ã£±` LIKE '¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³%'; +SELECT * FROM `£Ô£µ` WHERE `£Ã£±` LIKE '%¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³%'; +SELECT * FROM `£Ô£µ` WHERE `£Ã£±` LIKE '%¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³'; +SELECT * FROM `£Ô£¶` WHERE `£Ã£±` LIKE 'í´%'; +SELECT * FROM `£Ô£¶` WHERE `£Ã£±` LIKE '%í»%'; +SELECT * FROM `£Ô£¶` WHERE `£Ã£±` LIKE '%íÇ'; +SELECT * FROM `£Ô£¶` WHERE `£Ã£±` LIKE 'í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ%'; +SELECT * FROM `£Ô£¶` WHERE `£Ã£±` LIKE '%í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ%'; +SELECT * FROM `£Ô£¶` WHERE `£Ã£±` LIKE '%í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ'; + +#Heap +SELECT * FROM `£Ô£·` WHERE `£Ã£±` LIKE ' %'; +SELECT * FROM `£Ô£·` WHERE `£Ã£±` LIKE '% %'; +SELECT * FROM `£Ô£·` WHERE `£Ã£±` LIKE '% '; +SELECT * FROM `£Ô£·` WHERE `£Ã£±` LIKE 'ŽÀ%'; +SELECT * FROM `£Ô£·` WHERE `£Ã£±` LIKE '%Ž×ŽØ%'; +SELECT * FROM `£Ô£·` WHERE `£Ã£±` LIKE '%Ž¿'; +SELECT * FROM `£Ô£·` WHERE `£Ã£±` LIKE 'Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿%'; +SELECT * FROM `£Ô£·` WHERE `£Ã£±` LIKE '%Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿%'; +SELECT * FROM `£Ô£·` WHERE `£Ã£±` LIKE '%Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿'; +SELECT * FROM `£Ô£¸` WHERE `£Ã£±` LIKE '¡¡%'; +SELECT * FROM `£Ô£¸` WHERE `£Ã£±` LIKE '%¡¡%'; +SELECT * FROM `£Ô£¸` WHERE `£Ã£±` LIKE '%¡¡'; +SELECT * FROM `£Ô£¸` WHERE `£Ã£±` LIKE '¤È%'; +SELECT * FROM `£Ô£¸` WHERE `£Ã£±` LIKE '%¤¢%'; +SELECT * FROM `£Ô£¸` WHERE `£Ã£±` LIKE '%¤ï'; +SELECT * FROM `£Ô£¸` WHERE `£Ã£±` LIKE '¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³%'; +SELECT * FROM `£Ô£¸` WHERE `£Ã£±` LIKE '%¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³%'; +SELECT * FROM `£Ô£¸` WHERE `£Ã£±` LIKE '%¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³'; +SELECT * FROM `£Ô£¹` WHERE `£Ã£±` LIKE 'í´%'; +SELECT * FROM `£Ô£¹` WHERE `£Ã£±` LIKE '%í»%'; +SELECT * FROM `£Ô£¹` WHERE `£Ã£±` LIKE '%íÇ'; +SELECT * FROM `£Ô£¹` WHERE `£Ã£±` LIKE 'í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ%'; +SELECT * FROM `£Ô£¹` WHERE `£Ã£±` LIKE '%í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ%'; +SELECT * FROM `£Ô£¹` WHERE `£Ã£±` LIKE '%í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ'; +#BDB +SELECT * FROM `£Ô£±£°` WHERE `£Ã£±` LIKE ' %'; +SELECT * FROM `£Ô£±£°` WHERE `£Ã£±` LIKE '% %'; +SELECT * FROM `£Ô£±£°` WHERE `£Ã£±` LIKE '% '; +SELECT * FROM `£Ô£±£°` WHERE `£Ã£±` LIKE 'ŽÀ%'; +SELECT * FROM `£Ô£±£°` WHERE `£Ã£±` LIKE '%Ž×ŽØ%'; +SELECT * FROM `£Ô£±£°` WHERE `£Ã£±` LIKE '%Ž¿'; +#SELECT * FROM `£Ô£±£°` WHERE `£Ã£±` LIKE 'Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿%'; +#SELECT * FROM `£Ô£±£°` WHERE `£Ã£±` LIKE '%Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿%'; +SELECT * FROM `£Ô£±£°` WHERE `£Ã£±` LIKE '%Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿'; +SELECT * FROM `£Ô£±£±` WHERE `£Ã£±` LIKE '¡¡%'; +SELECT * FROM `£Ô£±£±` WHERE `£Ã£±` LIKE '%¡¡%'; +SELECT * FROM `£Ô£±£±` WHERE `£Ã£±` LIKE '%¡¡'; +SELECT * FROM `£Ô£±£±` WHERE `£Ã£±` LIKE '¤È%'; +SELECT * FROM `£Ô£±£±` WHERE `£Ã£±` LIKE '%¤¢%'; +SELECT * FROM `£Ô£±£±` WHERE `£Ã£±` LIKE '%¤ï'; +#SELECT * FROM `£Ô£±£±` WHERE `£Ã£±` LIKE '¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³%'; +#SELECT * FROM `£Ô£±£±` WHERE `£Ã£±` LIKE '%¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³%'; +#SELECT * FROM `£Ô£±£±` WHERE `£Ã£±` LIKE '%¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³'; +SELECT * FROM `£Ô£±£²` WHERE `£Ã£±` LIKE 'í´%'; +SELECT * FROM `£Ô£±£²` WHERE `£Ã£±` LIKE '%í»%'; +SELECT * FROM `£Ô£±£²` WHERE `£Ã£±` LIKE '%íÇ'; +#SELECT * FROM `£Ô£±£²` WHERE `£Ã£±` LIKE 'í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ%'; +#SELECT * FROM `£Ô£±£²` WHERE `£Ã£±` LIKE '%í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ%'; +#SELECT * FROM `£Ô£±£²` WHERE `£Ã£±` LIKE '%í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ'; + +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/t/jp_like_utf8.test b/mysql-test/suite/jp/t/jp_like_utf8.test new file mode 100755 index 00000000000..4247242029d --- /dev/null +++ b/mysql-test/suite/jp/t/jp_like_utf8.test @@ -0,0 +1,168 @@ +--disable_warnings +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +drop table if exists `T11`; +drop table if exists `T12`; +--enable_warnings + +# +# Test LIKE pattern matching using Japanese characters in utf8 encoding +# + +SET NAMES utf8; +SET character_set_database = utf8; + +CREATE TABLE `T1` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T11` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T12` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; + +#Load the following data in each table +# jisx0201 hankaku-katakana data +# jisx0208 data +# jisx0212 supplemental character data + +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_utf8.dat' INTO TABLE `T1`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_utf8.dat' INTO TABLE `ï¼´ï¼’`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_utf8.dat' INTO TABLE `T3`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_utf8.dat' INTO TABLE `ï¼´ï¼”`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_utf8.dat' INTO TABLE `T5`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_utf8.dat' INTO TABLE `ï¼´ï¼–`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_utf8.dat' INTO TABLE `ï¼´ï¼—`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_utf8.dat' INTO TABLE `T8`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_utf8.dat' INTO TABLE `ï¼´ï¼™`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_utf8.dat' INTO TABLE `T1ï¼`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_utf8.dat' INTO TABLE `T11`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_utf8.dat' INTO TABLE `T12`; + +#InnoDB +SELECT * FROM `T1` WHERE `C1` LIKE ' %'; +SELECT * FROM `T1` WHERE `C1` LIKE '% %'; +SELECT * FROM `T1` WHERE `C1` LIKE '% '; +SELECT * FROM `T1` WHERE `C1` LIKE 'ï¾€%'; +SELECT * FROM `T1` WHERE `C1` LIKE '%ラリ%'; +SELECT * FROM `T1` WHERE `C1` LIKE '%ソ'; +SELECT * FROM `T1` WHERE `C1` LIKE 'ーアイウエオカキクケコサシスセソ%'; +SELECT * FROM `T1` WHERE `C1` LIKE '%ーアイウエオカキクケコサシスセソ%'; +SELECT * FROM `T1` WHERE `C1` LIKE '%ーアイウエオカキクケコサシスセソ'; +SELECT * FROM `ï¼´ï¼’` WHERE `C1` LIKE ' %'; +SELECT * FROM `ï¼´ï¼’` WHERE `C1` LIKE '% %'; +SELECT * FROM `ï¼´ï¼’` WHERE `C1` LIKE '% '; +SELECT * FROM `ï¼´ï¼’` WHERE `C1` LIKE 'ã¨%'; +SELECT * FROM `ï¼´ï¼’` WHERE `C1` LIKE '%ã‚%'; +SELECT * FROM `ï¼´ï¼’` WHERE `C1` LIKE '%ã‚'; +SELECT * FROM `ï¼´ï¼’` WHERE `C1` LIKE '・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“%'; +SELECT * FROM `ï¼´ï¼’` WHERE `C1` LIKE '%・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“%'; +SELECT * FROM `ï¼´ï¼’` WHERE `C1` LIKE '%・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“'; +SELECT * FROM `T3` WHERE `C1` LIKE '鼫%'; +SELECT * FROM `T3` WHERE `C1` LIKE '%鼺%'; +SELECT * FROM `T3` WHERE `C1` LIKE '%é½–'; +SELECT * FROM `T3` WHERE `C1` LIKE '鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖%'; +SELECT * FROM `T3` WHERE `C1` LIKE '%鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖%'; +SELECT * FROM `T3` WHERE `C1` LIKE '%鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖'; + +#MyISAM +SELECT * FROM `ï¼´ï¼”` WHERE `C1` LIKE ' %'; +SELECT * FROM `ï¼´ï¼”` WHERE `C1` LIKE '% %'; +SELECT * FROM `ï¼´ï¼”` WHERE `C1` LIKE '% '; +SELECT * FROM `ï¼´ï¼”` WHERE `C1` LIKE 'ï¾€%'; +SELECT * FROM `ï¼´ï¼”` WHERE `C1` LIKE '%ラリ%'; +SELECT * FROM `ï¼´ï¼”` WHERE `C1` LIKE '%ソ'; +SELECT * FROM `ï¼´ï¼”` WHERE `C1` LIKE 'ーアイウエオカキクケコサシスセソ%'; +SELECT * FROM `ï¼´ï¼”` WHERE `C1` LIKE '%ーアイウエオカキクケコサシスセソ%'; +SELECT * FROM `ï¼´ï¼”` WHERE `C1` LIKE '%ーアイウエオカキクケコサシスセソ'; +SELECT * FROM `T5` WHERE `C1` LIKE ' %'; +SELECT * FROM `T5` WHERE `C1` LIKE '% %'; +SELECT * FROM `T5` WHERE `C1` LIKE '% '; +SELECT * FROM `T5` WHERE `C1` LIKE 'ã¨%'; +SELECT * FROM `T5` WHERE `C1` LIKE '%ã‚%'; +SELECT * FROM `T5` WHERE `C1` LIKE '%ã‚'; +SELECT * FROM `T5` WHERE `C1` LIKE '・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“%'; +SELECT * FROM `T5` WHERE `C1` LIKE '%・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“%'; +SELECT * FROM `T5` WHERE `C1` LIKE '%・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“'; +SELECT * FROM `ï¼´ï¼–` WHERE `C1` LIKE '鼫%'; +SELECT * FROM `ï¼´ï¼–` WHERE `C1` LIKE '%鼺%'; +SELECT * FROM `ï¼´ï¼–` WHERE `C1` LIKE '%é½–'; +SELECT * FROM `ï¼´ï¼–` WHERE `C1` LIKE '鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖%'; +SELECT * FROM `ï¼´ï¼–` WHERE `C1` LIKE '%鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖%'; +SELECT * FROM `ï¼´ï¼–` WHERE `C1` LIKE '%鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖'; + +#Heap +SELECT * FROM `ï¼´ï¼—` WHERE `C1` LIKE ' %'; +SELECT * FROM `ï¼´ï¼—` WHERE `C1` LIKE '% %'; +SELECT * FROM `ï¼´ï¼—` WHERE `C1` LIKE '% '; +SELECT * FROM `ï¼´ï¼—` WHERE `C1` LIKE 'ï¾€%'; +SELECT * FROM `ï¼´ï¼—` WHERE `C1` LIKE '%ラリ%'; +SELECT * FROM `ï¼´ï¼—` WHERE `C1` LIKE '%ソ'; +SELECT * FROM `ï¼´ï¼—` WHERE `C1` LIKE 'ーアイウエオカキクケコサシスセソ%'; +SELECT * FROM `ï¼´ï¼—` WHERE `C1` LIKE '%ーアイウエオカキクケコサシスセソ%'; +SELECT * FROM `ï¼´ï¼—` WHERE `C1` LIKE '%ーアイウエオカキクケコサシスセソ'; +SELECT * FROM `T8` WHERE `C1` LIKE ' %'; +SELECT * FROM `T8` WHERE `C1` LIKE '% %'; +SELECT * FROM `T8` WHERE `C1` LIKE '% '; +SELECT * FROM `T8` WHERE `C1` LIKE 'ã¨%'; +SELECT * FROM `T8` WHERE `C1` LIKE '%ã‚%'; +SELECT * FROM `T8` WHERE `C1` LIKE '%ã‚'; +SELECT * FROM `T8` WHERE `C1` LIKE '・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“%'; +SELECT * FROM `T8` WHERE `C1` LIKE '%・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“%'; +SELECT * FROM `T8` WHERE `C1` LIKE '%・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“'; +SELECT * FROM `ï¼´ï¼™` WHERE `C1` LIKE '鼫%'; +SELECT * FROM `ï¼´ï¼™` WHERE `C1` LIKE '%鼺%'; +SELECT * FROM `ï¼´ï¼™` WHERE `C1` LIKE '%é½–'; +SELECT * FROM `ï¼´ï¼™` WHERE `C1` LIKE '鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖%'; +SELECT * FROM `ï¼´ï¼™` WHERE `C1` LIKE '%鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖%'; +SELECT * FROM `ï¼´ï¼™` WHERE `C1` LIKE '%鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖'; +#BDB +SELECT * FROM `T1ï¼` WHERE `C1` LIKE ' %'; +SELECT * FROM `T1ï¼` WHERE `C1` LIKE '% %'; +SELECT * FROM `T1ï¼` WHERE `C1` LIKE '% '; +SELECT * FROM `T1ï¼` WHERE `C1` LIKE 'ï¾€%'; +SELECT * FROM `T1ï¼` WHERE `C1` LIKE '%ラリ%'; +SELECT * FROM `T1ï¼` WHERE `C1` LIKE '%ソ'; +#SELECT * FROM `T1ï¼` WHERE `C1` LIKE 'ーアイウエオカキクケコサシスセソ%'; +#SELECT * FROM `T1ï¼` WHERE `C1` LIKE '%ーアイウエオカキクケコサシスセソ%'; +#SELECT * FROM `T1ï¼` WHERE `C1` LIKE '%ーアイウエオカキクケコサシスセソ'; +SELECT * FROM `T11` WHERE `C1` LIKE ' %'; +SELECT * FROM `T11` WHERE `C1` LIKE '% %'; +SELECT * FROM `T11` WHERE `C1` LIKE '% '; +SELECT * FROM `T11` WHERE `C1` LIKE 'ã¨%'; +SELECT * FROM `T11` WHERE `C1` LIKE '%ã‚%'; +SELECT * FROM `T11` WHERE `C1` LIKE '%ã‚'; +#SELECT * FROM `T11` WHERE `C1` LIKE '・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“%'; +#SELECT * FROM `T11` WHERE `C1` LIKE '%・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“%'; +#SELECT * FROM `T11` WHERE `C1` LIKE '%・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“'; +SELECT * FROM `T12` WHERE `C1` LIKE '鼫%'; +SELECT * FROM `T12` WHERE `C1` LIKE '%鼺%'; +SELECT * FROM `T12` WHERE `C1` LIKE '%é½–'; +#SELECT * FROM `T12` WHERE `C1` LIKE '鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖%'; +#SELECT * FROM `T12` WHERE `C1` LIKE '%鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖%'; +#SELECT * FROM `T12` WHERE `C1` LIKE '%鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖'; + +DROP TABLE `T1`; +DROP TABLE `ï¼´ï¼’`; +DROP TABLE `T3`; +DROP TABLE `ï¼´ï¼”`; +DROP TABLE `T5`; +DROP TABLE `ï¼´ï¼–`; +DROP TABLE `ï¼´ï¼—`; +DROP TABLE `T8`; +DROP TABLE `ï¼´ï¼™`; +DROP TABLE `T1ï¼`; +DROP TABLE `T11`; +DROP TABLE `T12`; diff --git a/mysql-test/suite/jp/t/jp_locate_sjis.test b/mysql-test/suite/jp/t/jp_locate_sjis.test new file mode 100755 index 00000000000..92c671199b6 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_locate_sjis.test @@ -0,0 +1,141 @@ +--character_set sjis +--disable_warnings +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +--enable_warnings + +# +# Test LOCATE() function with Japanese characters in sjis encoding +# + +SET NAMES sjis; +SET character_set_database = sjis; +CREATE TABLE `‚s‚P` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Q` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚R` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚S` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚T` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚U` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚V` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚W` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚X` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚O` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚P` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚Q` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; + +INSERT INTO `‚s‚P` VALUES ('±²³´µ'); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚S` VALUES ('±²³´µ'); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚V` VALUES ('±²³´µ'); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ'); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\'); + +#InnoDB +SELECT LOCATE('±',`‚b‚P`) from `‚s‚P`; +SELECT LOCATE('²',`‚b‚P`) from `‚s‚P`; +SELECT LOCATE('³',`‚b‚P`) from `‚s‚P`; +SELECT LOCATE('´',`‚b‚P`) from `‚s‚P`; +SELECT LOCATE('µ',`‚b‚P`) from `‚s‚P`; +SELECT LOCATE('Ý',`‚b‚P`) from `‚s‚P`; +SELECT LOCATE('‚ ',`‚b‚P`) from `‚s‚Q`; +SELECT LOCATE('‚¢',`‚b‚P`) from `‚s‚Q`; +SELECT LOCATE('‚¤',`‚b‚P`) from `‚s‚Q`; +SELECT LOCATE('‚¦',`‚b‚P`) from `‚s‚Q`; +SELECT LOCATE('‚¨',`‚b‚P`) from `‚s‚Q`; +SELECT LOCATE('‚ñ',`‚b‚P`) from `‚s‚Q`; +SELECT LOCATE('ƒ\',`‚b‚P`) from `‚s‚R`; +SELECT LOCATE('\',`‚b‚P`) from `‚s‚R`; +SELECT LOCATE('•\',`‚b‚P`) from `‚s‚R`; +SELECT LOCATE('—\',`‚b‚P`) from `‚s‚R`; +SELECT LOCATE('\',`‚b‚P`) from `‚s‚R`; +SELECT LOCATE('‰\',`‚b‚P`) from `‚s‚R`; + +#MyISAM +SELECT LOCATE('±',`‚b‚P`) from `‚s‚S`; +SELECT LOCATE('²',`‚b‚P`) from `‚s‚S`; +SELECT LOCATE('³',`‚b‚P`) from `‚s‚S`; +SELECT LOCATE('´',`‚b‚P`) from `‚s‚S`; +SELECT LOCATE('µ',`‚b‚P`) from `‚s‚S`; +SELECT LOCATE('Ý',`‚b‚P`) from `‚s‚S`; +SELECT LOCATE('‚ ',`‚b‚P`) from `‚s‚T`; +SELECT LOCATE('‚¢',`‚b‚P`) from `‚s‚T`; +SELECT LOCATE('‚¤',`‚b‚P`) from `‚s‚T`; +SELECT LOCATE('‚¦',`‚b‚P`) from `‚s‚T`; +SELECT LOCATE('‚¨',`‚b‚P`) from `‚s‚T`; +SELECT LOCATE('‚ñ',`‚b‚P`) from `‚s‚T`; +SELECT LOCATE('ƒ\',`‚b‚P`) from `‚s‚U`; +SELECT LOCATE('\',`‚b‚P`) from `‚s‚U`; +SELECT LOCATE('•\',`‚b‚P`) from `‚s‚U`; +SELECT LOCATE('—\',`‚b‚P`) from `‚s‚U`; +SELECT LOCATE('\',`‚b‚P`) from `‚s‚U`; +SELECT LOCATE('‰\',`‚b‚P`) from `‚s‚U`; + + +#HEAP +SELECT LOCATE('±',`‚b‚P`) from `‚s‚V`; +SELECT LOCATE('²',`‚b‚P`) from `‚s‚V`; +SELECT LOCATE('³',`‚b‚P`) from `‚s‚V`; +SELECT LOCATE('´',`‚b‚P`) from `‚s‚V`; +SELECT LOCATE('µ',`‚b‚P`) from `‚s‚V`; +SELECT LOCATE('Ý',`‚b‚P`) from `‚s‚V`; +SELECT LOCATE('‚ ',`‚b‚P`) from `‚s‚W`; +SELECT LOCATE('‚¢',`‚b‚P`) from `‚s‚W`; +SELECT LOCATE('‚¤',`‚b‚P`) from `‚s‚W`; +SELECT LOCATE('‚¦',`‚b‚P`) from `‚s‚W`; +SELECT LOCATE('‚¨',`‚b‚P`) from `‚s‚W`; +SELECT LOCATE('‚ñ',`‚b‚P`) from `‚s‚W`; +SELECT LOCATE('ƒ\',`‚b‚P`) from `‚s‚X`; +SELECT LOCATE('\',`‚b‚P`) from `‚s‚X`; +SELECT LOCATE('•\',`‚b‚P`) from `‚s‚X`; +SELECT LOCATE('—\',`‚b‚P`) from `‚s‚X`; +SELECT LOCATE('\',`‚b‚P`) from `‚s‚X`; +SELECT LOCATE('‰\',`‚b‚P`) from `‚s‚X`; + + +#BDB +SELECT LOCATE('±',`‚b‚P`) from `‚s‚P‚O`; +SELECT LOCATE('²',`‚b‚P`) from `‚s‚P‚O`; +SELECT LOCATE('³',`‚b‚P`) from `‚s‚P‚O`; +SELECT LOCATE('´',`‚b‚P`) from `‚s‚P‚O`; +SELECT LOCATE('µ',`‚b‚P`) from `‚s‚P‚O`; +SELECT LOCATE('Ý',`‚b‚P`) from `‚s‚P‚O`; +SELECT LOCATE('‚ ',`‚b‚P`) from `‚s‚P‚P`; +SELECT LOCATE('‚¢',`‚b‚P`) from `‚s‚P‚P`; +SELECT LOCATE('‚¤',`‚b‚P`) from `‚s‚P‚P`; +SELECT LOCATE('‚¦',`‚b‚P`) from `‚s‚P‚P`; +SELECT LOCATE('‚¨',`‚b‚P`) from `‚s‚P‚P`; +SELECT LOCATE('‚ñ',`‚b‚P`) from `‚s‚P‚P`; +SELECT LOCATE('ƒ\',`‚b‚P`) from `‚s‚P‚Q`; +SELECT LOCATE('\',`‚b‚P`) from `‚s‚P‚Q`; +SELECT LOCATE('•\',`‚b‚P`) from `‚s‚P‚Q`; +SELECT LOCATE('—\',`‚b‚P`) from `‚s‚P‚Q`; +SELECT LOCATE('\',`‚b‚P`) from `‚s‚P‚Q`; +SELECT LOCATE('‰\',`‚b‚P`) from `‚s‚P‚Q`; + + +DROP TABLE `‚s‚P`; +DROP TABLE `‚s‚Q`; +DROP TABLE `‚s‚R`; +DROP TABLE `‚s‚S`; +DROP TABLE `‚s‚T`; +DROP TABLE `‚s‚U`; +DROP TABLE `‚s‚V`; +DROP TABLE `‚s‚W`; +DROP TABLE `‚s‚X`; +DROP TABLE `‚s‚P‚O`; +DROP TABLE `‚s‚P‚P`; +DROP TABLE `‚s‚P‚Q`; diff --git a/mysql-test/suite/jp/t/jp_locate_ucs2.test b/mysql-test/suite/jp/t/jp_locate_ucs2.test new file mode 100755 index 00000000000..d00ad67235a --- /dev/null +++ b/mysql-test/suite/jp/t/jp_locate_ucs2.test @@ -0,0 +1,144 @@ +--source include/have_ucs2.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +--enable_warnings + +# +# Test LOCATE() function with Japanese characters in ucs2 encoding +# + +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; + +CREATE TABLE `£Ô£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; + +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'); + +#InnoDB +SELECT LOCATE('ޱ',`£Ã£±`) from `£Ô£±`; +SELECT LOCATE('޲',`£Ã£±`) from `£Ô£±`; +SELECT LOCATE('޳',`£Ã£±`) from `£Ô£±`; +SELECT LOCATE('Ž´',`£Ã£±`) from `£Ô£±`; +SELECT LOCATE('޵',`£Ã£±`) from `£Ô£±`; +SELECT LOCATE('ŽÝ',`£Ã£±`) from `£Ô£±`; +SELECT LOCATE('¤¢',`£Ã£±`) from `£Ô£²`; +SELECT LOCATE('¤¤',`£Ã£±`) from `£Ô£²`; +SELECT LOCATE('¤¦',`£Ã£±`) from `£Ô£²`; +SELECT LOCATE('¤¨',`£Ã£±`) from `£Ô£²`; +SELECT LOCATE('¤ª',`£Ã£±`) from `£Ô£²`; +SELECT LOCATE('¤ó',`£Ã£±`) from `£Ô£²`; +SELECT LOCATE('íÜ',`£Ã£±`) from `£Ô£³`; +SELECT LOCATE('íÝ',`£Ã£±`) from `£Ô£³`; +SELECT LOCATE('íÞ',`£Ã£±`) from `£Ô£³`; +SELECT LOCATE('íß',`£Ã£±`) from `£Ô£³`; +SELECT LOCATE('íà',`£Ã£±`) from `£Ô£³`; +SELECT LOCATE('°¡',`£Ã£±`) from `£Ô£³`; + +#MyISAM +SELECT LOCATE('ޱ',`£Ã£±`) from `£Ô£´`; +SELECT LOCATE('޲',`£Ã£±`) from `£Ô£´`; +SELECT LOCATE('޳',`£Ã£±`) from `£Ô£´`; +SELECT LOCATE('Ž´',`£Ã£±`) from `£Ô£´`; +SELECT LOCATE('޵',`£Ã£±`) from `£Ô£´`; +SELECT LOCATE('ŽÝ',`£Ã£±`) from `£Ô£´`; +SELECT LOCATE('¤¢',`£Ã£±`) from `£Ô£µ`; +SELECT LOCATE('¤¤',`£Ã£±`) from `£Ô£µ`; +SELECT LOCATE('¤¦',`£Ã£±`) from `£Ô£µ`; +SELECT LOCATE('¤¨',`£Ã£±`) from `£Ô£µ`; +SELECT LOCATE('¤ª',`£Ã£±`) from `£Ô£µ`; +SELECT LOCATE('¤ó',`£Ã£±`) from `£Ô£µ`; +SELECT LOCATE('íÜ',`£Ã£±`) from `£Ô£¶`; +SELECT LOCATE('íÝ',`£Ã£±`) from `£Ô£¶`; +SELECT LOCATE('íÞ',`£Ã£±`) from `£Ô£¶`; +SELECT LOCATE('íß',`£Ã£±`) from `£Ô£¶`; +SELECT LOCATE('íà',`£Ã£±`) from `£Ô£¶`; +SELECT LOCATE('°¡',`£Ã£±`) from `£Ô£¶`; + + +#HEAP +SELECT LOCATE('ޱ',`£Ã£±`) from `£Ô£·`; +SELECT LOCATE('޲',`£Ã£±`) from `£Ô£·`; +SELECT LOCATE('޳',`£Ã£±`) from `£Ô£·`; +SELECT LOCATE('Ž´',`£Ã£±`) from `£Ô£·`; +SELECT LOCATE('޵',`£Ã£±`) from `£Ô£·`; +SELECT LOCATE('ŽÝ',`£Ã£±`) from `£Ô£·`; +SELECT LOCATE('¤¢',`£Ã£±`) from `£Ô£¸`; +SELECT LOCATE('¤¤',`£Ã£±`) from `£Ô£¸`; +SELECT LOCATE('¤¦',`£Ã£±`) from `£Ô£¸`; +SELECT LOCATE('¤¨',`£Ã£±`) from `£Ô£¸`; +SELECT LOCATE('¤ª',`£Ã£±`) from `£Ô£¸`; +SELECT LOCATE('¤ó',`£Ã£±`) from `£Ô£¸`; +SELECT LOCATE('íÜ',`£Ã£±`) from `£Ô£¹`; +SELECT LOCATE('íÝ',`£Ã£±`) from `£Ô£¹`; +SELECT LOCATE('íÞ',`£Ã£±`) from `£Ô£¹`; +SELECT LOCATE('íß',`£Ã£±`) from `£Ô£¹`; +SELECT LOCATE('íà',`£Ã£±`) from `£Ô£¹`; +SELECT LOCATE('°¡',`£Ã£±`) from `£Ô£¹`; + + +#BDB +SELECT LOCATE('ޱ',`£Ã£±`) from `£Ô£±£°`; +SELECT LOCATE('޲',`£Ã£±`) from `£Ô£±£°`; +SELECT LOCATE('޳',`£Ã£±`) from `£Ô£±£°`; +SELECT LOCATE('Ž´',`£Ã£±`) from `£Ô£±£°`; +SELECT LOCATE('޵',`£Ã£±`) from `£Ô£±£°`; +SELECT LOCATE('ŽÝ',`£Ã£±`) from `£Ô£±£°`; +SELECT LOCATE('¤¢',`£Ã£±`) from `£Ô£±£±`; +SELECT LOCATE('¤¤',`£Ã£±`) from `£Ô£±£±`; +SELECT LOCATE('¤¦',`£Ã£±`) from `£Ô£±£±`; +SELECT LOCATE('¤¨',`£Ã£±`) from `£Ô£±£±`; +SELECT LOCATE('¤ª',`£Ã£±`) from `£Ô£±£±`; +SELECT LOCATE('¤ó',`£Ã£±`) from `£Ô£±£±`; +SELECT LOCATE('íÜ',`£Ã£±`) from `£Ô£±£²`; +SELECT LOCATE('íÝ',`£Ã£±`) from `£Ô£±£²`; +SELECT LOCATE('íÞ',`£Ã£±`) from `£Ô£±£²`; +SELECT LOCATE('íß',`£Ã£±`) from `£Ô£±£²`; +SELECT LOCATE('íà',`£Ã£±`) from `£Ô£±£²`; +SELECT LOCATE('°¡',`£Ã£±`) from `£Ô£±£²`; + + +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/t/jp_locate_ujis.test b/mysql-test/suite/jp/t/jp_locate_ujis.test new file mode 100755 index 00000000000..5375fad75db --- /dev/null +++ b/mysql-test/suite/jp/t/jp_locate_ujis.test @@ -0,0 +1,143 @@ +--source include/have_ujis.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +--enable_warnings + +# +# Test LOCATE() function with Japanese characters in ujis encoding +# + +SET NAMES ujis; +SET character_set_database = ujis; + +CREATE TABLE `£Ô£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; + +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'); + +#InnoDB +SELECT LOCATE('ޱ',`£Ã£±`) from `£Ô£±`; +SELECT LOCATE('޲',`£Ã£±`) from `£Ô£±`; +SELECT LOCATE('޳',`£Ã£±`) from `£Ô£±`; +SELECT LOCATE('Ž´',`£Ã£±`) from `£Ô£±`; +SELECT LOCATE('޵',`£Ã£±`) from `£Ô£±`; +SELECT LOCATE('ŽÝ',`£Ã£±`) from `£Ô£±`; +SELECT LOCATE('¤¢',`£Ã£±`) from `£Ô£²`; +SELECT LOCATE('¤¤',`£Ã£±`) from `£Ô£²`; +SELECT LOCATE('¤¦',`£Ã£±`) from `£Ô£²`; +SELECT LOCATE('¤¨',`£Ã£±`) from `£Ô£²`; +SELECT LOCATE('¤ª',`£Ã£±`) from `£Ô£²`; +SELECT LOCATE('¤ó',`£Ã£±`) from `£Ô£²`; +SELECT LOCATE('íÜ',`£Ã£±`) from `£Ô£³`; +SELECT LOCATE('íÝ',`£Ã£±`) from `£Ô£³`; +SELECT LOCATE('íÞ',`£Ã£±`) from `£Ô£³`; +SELECT LOCATE('íß',`£Ã£±`) from `£Ô£³`; +SELECT LOCATE('íà',`£Ã£±`) from `£Ô£³`; +SELECT LOCATE('°¡',`£Ã£±`) from `£Ô£³`; + +#MyISAM +SELECT LOCATE('ޱ',`£Ã£±`) from `£Ô£´`; +SELECT LOCATE('޲',`£Ã£±`) from `£Ô£´`; +SELECT LOCATE('޳',`£Ã£±`) from `£Ô£´`; +SELECT LOCATE('Ž´',`£Ã£±`) from `£Ô£´`; +SELECT LOCATE('޵',`£Ã£±`) from `£Ô£´`; +SELECT LOCATE('ŽÝ',`£Ã£±`) from `£Ô£´`; +SELECT LOCATE('¤¢',`£Ã£±`) from `£Ô£µ`; +SELECT LOCATE('¤¤',`£Ã£±`) from `£Ô£µ`; +SELECT LOCATE('¤¦',`£Ã£±`) from `£Ô£µ`; +SELECT LOCATE('¤¨',`£Ã£±`) from `£Ô£µ`; +SELECT LOCATE('¤ª',`£Ã£±`) from `£Ô£µ`; +SELECT LOCATE('¤ó',`£Ã£±`) from `£Ô£µ`; +SELECT LOCATE('íÜ',`£Ã£±`) from `£Ô£¶`; +SELECT LOCATE('íÝ',`£Ã£±`) from `£Ô£¶`; +SELECT LOCATE('íÞ',`£Ã£±`) from `£Ô£¶`; +SELECT LOCATE('íß',`£Ã£±`) from `£Ô£¶`; +SELECT LOCATE('íà',`£Ã£±`) from `£Ô£¶`; +SELECT LOCATE('°¡',`£Ã£±`) from `£Ô£¶`; + + +#HEAP +SELECT LOCATE('ޱ',`£Ã£±`) from `£Ô£·`; +SELECT LOCATE('޲',`£Ã£±`) from `£Ô£·`; +SELECT LOCATE('޳',`£Ã£±`) from `£Ô£·`; +SELECT LOCATE('Ž´',`£Ã£±`) from `£Ô£·`; +SELECT LOCATE('޵',`£Ã£±`) from `£Ô£·`; +SELECT LOCATE('ŽÝ',`£Ã£±`) from `£Ô£·`; +SELECT LOCATE('¤¢',`£Ã£±`) from `£Ô£¸`; +SELECT LOCATE('¤¤',`£Ã£±`) from `£Ô£¸`; +SELECT LOCATE('¤¦',`£Ã£±`) from `£Ô£¸`; +SELECT LOCATE('¤¨',`£Ã£±`) from `£Ô£¸`; +SELECT LOCATE('¤ª',`£Ã£±`) from `£Ô£¸`; +SELECT LOCATE('¤ó',`£Ã£±`) from `£Ô£¸`; +SELECT LOCATE('íÜ',`£Ã£±`) from `£Ô£¹`; +SELECT LOCATE('íÝ',`£Ã£±`) from `£Ô£¹`; +SELECT LOCATE('íÞ',`£Ã£±`) from `£Ô£¹`; +SELECT LOCATE('íß',`£Ã£±`) from `£Ô£¹`; +SELECT LOCATE('íà',`£Ã£±`) from `£Ô£¹`; +SELECT LOCATE('°¡',`£Ã£±`) from `£Ô£¹`; + + +#BDB +SELECT LOCATE('ޱ',`£Ã£±`) from `£Ô£±£°`; +SELECT LOCATE('޲',`£Ã£±`) from `£Ô£±£°`; +SELECT LOCATE('޳',`£Ã£±`) from `£Ô£±£°`; +SELECT LOCATE('Ž´',`£Ã£±`) from `£Ô£±£°`; +SELECT LOCATE('޵',`£Ã£±`) from `£Ô£±£°`; +SELECT LOCATE('ŽÝ',`£Ã£±`) from `£Ô£±£°`; +SELECT LOCATE('¤¢',`£Ã£±`) from `£Ô£±£±`; +SELECT LOCATE('¤¤',`£Ã£±`) from `£Ô£±£±`; +SELECT LOCATE('¤¦',`£Ã£±`) from `£Ô£±£±`; +SELECT LOCATE('¤¨',`£Ã£±`) from `£Ô£±£±`; +SELECT LOCATE('¤ª',`£Ã£±`) from `£Ô£±£±`; +SELECT LOCATE('¤ó',`£Ã£±`) from `£Ô£±£±`; +SELECT LOCATE('íÜ',`£Ã£±`) from `£Ô£±£²`; +SELECT LOCATE('íÝ',`£Ã£±`) from `£Ô£±£²`; +SELECT LOCATE('íÞ',`£Ã£±`) from `£Ô£±£²`; +SELECT LOCATE('íß',`£Ã£±`) from `£Ô£±£²`; +SELECT LOCATE('íà',`£Ã£±`) from `£Ô£±£²`; +SELECT LOCATE('°¡',`£Ã£±`) from `£Ô£±£²`; + + +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/t/jp_locate_utf8.test b/mysql-test/suite/jp/t/jp_locate_utf8.test new file mode 100755 index 00000000000..cbf6714e322 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_locate_utf8.test @@ -0,0 +1,141 @@ +--disable_warnings +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +--enable_warnings + +# +# Test LOCATE() function with Japanese characters in utf8 encoding +# + +SET NAMES utf8; +SET character_set_database = utf8; + +CREATE TABLE `T1` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T11` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T12` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; + +INSERT INTO `T1` VALUES ('アイウエオ'); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T3` VALUES ('龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオ'); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオ'); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡'); +INSERT INTO `T1ï¼` VALUES ('アイウエオ'); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T12` VALUES ('龔龖龗龞龡'); + +#InnoDB +SELECT LOCATE('ï½±',`C1`) from `T1`; +SELECT LOCATE('ï½²',`C1`) from `T1`; +SELECT LOCATE('ï½³',`C1`) from `T1`; +SELECT LOCATE('ï½´',`C1`) from `T1`; +SELECT LOCATE('ï½µ',`C1`) from `T1`; +SELECT LOCATE('ï¾',`C1`) from `T1`; +SELECT LOCATE('ã‚',`C1`) from `ï¼´ï¼’`; +SELECT LOCATE('ã„',`C1`) from `ï¼´ï¼’`; +SELECT LOCATE('ã†',`C1`) from `ï¼´ï¼’`; +SELECT LOCATE('ãˆ',`C1`) from `ï¼´ï¼’`; +SELECT LOCATE('ãŠ',`C1`) from `ï¼´ï¼’`; +SELECT LOCATE('ã‚“',`C1`) from `ï¼´ï¼’`; +SELECT LOCATE('é¾”',`C1`) from `T3`; +SELECT LOCATE('é¾–',`C1`) from `T3`; +SELECT LOCATE('é¾—',`C1`) from `T3`; +SELECT LOCATE('龞',`C1`) from `T3`; +SELECT LOCATE('龡',`C1`) from `T3`; +SELECT LOCATE('丂',`C1`) from `T3`; + +#MyISAM +SELECT LOCATE('ï½±',`C1`) from `ï¼´ï¼”`; +SELECT LOCATE('ï½²',`C1`) from `ï¼´ï¼”`; +SELECT LOCATE('ï½³',`C1`) from `ï¼´ï¼”`; +SELECT LOCATE('ï½´',`C1`) from `ï¼´ï¼”`; +SELECT LOCATE('ï½µ',`C1`) from `ï¼´ï¼”`; +SELECT LOCATE('ï¾',`C1`) from `ï¼´ï¼”`; +SELECT LOCATE('ã‚',`C1`) from `T5`; +SELECT LOCATE('ã„',`C1`) from `T5`; +SELECT LOCATE('ã†',`C1`) from `T5`; +SELECT LOCATE('ãˆ',`C1`) from `T5`; +SELECT LOCATE('ãŠ',`C1`) from `T5`; +SELECT LOCATE('ã‚“',`C1`) from `T5`; +SELECT LOCATE('é¾”',`C1`) from `ï¼´ï¼–`; +SELECT LOCATE('é¾–',`C1`) from `ï¼´ï¼–`; +SELECT LOCATE('é¾—',`C1`) from `ï¼´ï¼–`; +SELECT LOCATE('龞',`C1`) from `ï¼´ï¼–`; +SELECT LOCATE('龡',`C1`) from `ï¼´ï¼–`; +SELECT LOCATE('丂',`C1`) from `ï¼´ï¼–`; + + +#HEAP +SELECT LOCATE('ï½±',`C1`) from `ï¼´ï¼—`; +SELECT LOCATE('ï½²',`C1`) from `ï¼´ï¼—`; +SELECT LOCATE('ï½³',`C1`) from `ï¼´ï¼—`; +SELECT LOCATE('ï½´',`C1`) from `ï¼´ï¼—`; +SELECT LOCATE('ï½µ',`C1`) from `ï¼´ï¼—`; +SELECT LOCATE('ï¾',`C1`) from `ï¼´ï¼—`; +SELECT LOCATE('ã‚',`C1`) from `T8`; +SELECT LOCATE('ã„',`C1`) from `T8`; +SELECT LOCATE('ã†',`C1`) from `T8`; +SELECT LOCATE('ãˆ',`C1`) from `T8`; +SELECT LOCATE('ãŠ',`C1`) from `T8`; +SELECT LOCATE('ã‚“',`C1`) from `T8`; +SELECT LOCATE('é¾”',`C1`) from `ï¼´ï¼™`; +SELECT LOCATE('é¾–',`C1`) from `ï¼´ï¼™`; +SELECT LOCATE('é¾—',`C1`) from `ï¼´ï¼™`; +SELECT LOCATE('龞',`C1`) from `ï¼´ï¼™`; +SELECT LOCATE('龡',`C1`) from `ï¼´ï¼™`; +SELECT LOCATE('丂',`C1`) from `ï¼´ï¼™`; + + +#BDB +SELECT LOCATE('ï½±',`C1`) from `T1ï¼`; +SELECT LOCATE('ï½²',`C1`) from `T1ï¼`; +SELECT LOCATE('ï½³',`C1`) from `T1ï¼`; +SELECT LOCATE('ï½´',`C1`) from `T1ï¼`; +SELECT LOCATE('ï½µ',`C1`) from `T1ï¼`; +SELECT LOCATE('ï¾',`C1`) from `T1ï¼`; +SELECT LOCATE('ã‚',`C1`) from `T11`; +SELECT LOCATE('ã„',`C1`) from `T11`; +SELECT LOCATE('ã†',`C1`) from `T11`; +SELECT LOCATE('ãˆ',`C1`) from `T11`; +SELECT LOCATE('ãŠ',`C1`) from `T11`; +SELECT LOCATE('ã‚“',`C1`) from `T11`; +SELECT LOCATE('é¾”',`C1`) from `T12`; +SELECT LOCATE('é¾–',`C1`) from `T12`; +SELECT LOCATE('é¾—',`C1`) from `T12`; +SELECT LOCATE('龞',`C1`) from `T12`; +SELECT LOCATE('龡',`C1`) from `T12`; +SELECT LOCATE('丂',`C1`) from `T12`; + + +DROP TABLE `T1`; +DROP TABLE `ï¼´ï¼’`; +DROP TABLE `T3`; +DROP TABLE `ï¼´ï¼”`; +DROP TABLE `T5`; +DROP TABLE `ï¼´ï¼–`; +DROP TABLE `ï¼´ï¼—`; +DROP TABLE `T8`; +DROP TABLE `ï¼´ï¼™`; +DROP TABLE `T1ï¼`; +DROP TABLE `T11`; +DROP TABLE `T12`; diff --git a/mysql-test/suite/jp/t/jp_lpad_sjis.test b/mysql-test/suite/jp/t/jp_lpad_sjis.test new file mode 100755 index 00000000000..7038112cbc8 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_lpad_sjis.test @@ -0,0 +1,81 @@ +--character_set sjis +--disable_warnings +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +drop table if exists `‚s‚P‚P`; +drop table if exists `‚s‚P‚Q`; +--enable_warnings + +# +# Test LPAD() function with Japanese character in sjis encoding +# + +SET NAMES sjis; +SET character_set_database = sjis; + +CREATE TABLE `‚s‚P` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Q` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚R` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚S` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚T` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚U` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚V` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚W` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚X` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚O` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚P` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚Q` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; + +INSERT INTO `‚s‚P` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +INSERT INTO `‚s‚S` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +INSERT INTO `‚s‚V` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); + +#InnoDB +SELECT `‚b‚P`, LPAD(`‚b‚P`,5,'¡') FROM `‚s‚P`; +SELECT `‚b‚P`, LPAD(`‚b‚P`,5,'‚w') FROM `‚s‚Q`; +SELECT `‚b‚P`, LPAD(`‚b‚P`,5,'–\') FROM `‚s‚R`; + +#MyISAM +SELECT `‚b‚P`, LPAD(`‚b‚P`,5,'¡') FROM `‚s‚S`; +SELECT `‚b‚P`, LPAD(`‚b‚P`,5,'‚w') FROM `‚s‚T`; +SELECT `‚b‚P`, LPAD(`‚b‚P`,5,'–\' ) FROM `‚s‚U`; + +#HEAP +SELECT `‚b‚P`, LPAD(`‚b‚P`,5,'¡') FROM `‚s‚V`; +SELECT `‚b‚P`, LPAD(`‚b‚P`,5,'‚w') FROM `‚s‚W`; +SELECT `‚b‚P`, LPAD(`‚b‚P`,5,'–\' ) FROM `‚s‚X`; + +#BDB +SELECT `‚b‚P`, LPAD(`‚b‚P`,5,'¡') FROM `‚s‚P‚O`; +SELECT `‚b‚P`, LPAD(`‚b‚P`,5,'‚w') FROM `‚s‚P‚P`; +SELECT `‚b‚P`, LPAD(`‚b‚P`,5,'–\' ) FROM `‚s‚P‚Q`; + +DROP TABLE `‚s‚P`; +DROP TABLE `‚s‚Q`; +DROP TABLE `‚s‚R`; +DROP TABLE `‚s‚S`; +DROP TABLE `‚s‚T`; +DROP TABLE `‚s‚U`; +DROP TABLE `‚s‚V`; +DROP TABLE `‚s‚W`; +DROP TABLE `‚s‚X`; +DROP TABLE `‚s‚P‚O`; +DROP TABLE `‚s‚P‚P`; +DROP TABLE `‚s‚P‚Q`; diff --git a/mysql-test/suite/jp/t/jp_lpad_ucs2.test b/mysql-test/suite/jp/t/jp_lpad_ucs2.test new file mode 100755 index 00000000000..e3bead0855a --- /dev/null +++ b/mysql-test/suite/jp/t/jp_lpad_ucs2.test @@ -0,0 +1,83 @@ +--source include/have_ucs2.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +--enable_warnings + +# +# Test LPAD() function with Japanese character in ucs2 encoding +# + +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; + +CREATE TABLE `£Ô£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; + +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); + +#InnoDB +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'Ž¡') FROM `£Ô£±`; +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'£Ø') FROM `£Ô£²`; +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'°¢') FROM `£Ô£³`; + +#MyISAM +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'Ž¡') FROM `£Ô£´`; +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'£Ø') FROM `£Ô£µ`; +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'°¢' ) FROM `£Ô£¶`; + +#HEAP +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'Ž¡') FROM `£Ô£·`; +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'£Ø') FROM `£Ô£¸`; +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'°¢' ) FROM `£Ô£¹`; + +#BDB +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'Ž¡') FROM `£Ô£±£°`; +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'£Ø') FROM `£Ô£±£±`; +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'°¢' ) FROM `£Ô£±£²`; + +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/t/jp_lpad_ujis.test b/mysql-test/suite/jp/t/jp_lpad_ujis.test new file mode 100755 index 00000000000..eea4877ec3a --- /dev/null +++ b/mysql-test/suite/jp/t/jp_lpad_ujis.test @@ -0,0 +1,82 @@ +--source include/have_ujis.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +--enable_warnings + +# +# Test LPAD() function with Japanese character in ujis encoding +# + +SET NAMES ujis; +SET character_set_database = ujis; + +CREATE TABLE `£Ô£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; + +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); + +#InnoDB +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'Ž¡') FROM `£Ô£±`; +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'£Ø') FROM `£Ô£²`; +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'°¢') FROM `£Ô£³`; + +#MyISAM +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'Ž¡') FROM `£Ô£´`; +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'£Ø') FROM `£Ô£µ`; +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'°¢' ) FROM `£Ô£¶`; + +#HEAP +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'Ž¡') FROM `£Ô£·`; +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'£Ø') FROM `£Ô£¸`; +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'°¢' ) FROM `£Ô£¹`; + +#BDB +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'Ž¡') FROM `£Ô£±£°`; +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'£Ø') FROM `£Ô£±£±`; +SELECT `£Ã£±`, LPAD(`£Ã£±`,5,'°¢' ) FROM `£Ô£±£²`; + +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/t/jp_lpad_utf8.test b/mysql-test/suite/jp/t/jp_lpad_utf8.test new file mode 100755 index 00000000000..599bf5eba28 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_lpad_utf8.test @@ -0,0 +1,80 @@ +--disable_warnings +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +drop table if exists `T11`; +drop table if exists `T12`; +--enable_warnings + +# +# Test LPAD() function with Japanese character in utf8 encoding +# + +SET NAMES utf8; +SET character_set_database = utf8; + +CREATE TABLE `T1` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T11` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T12` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; + +INSERT INTO `T1` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `T3` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +INSERT INTO `T1ï¼` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `T12` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); + +#InnoDB +SELECT `C1`, LPAD(`C1`,5,'。') FROM `T1`; +SELECT `C1`, LPAD(`C1`,5,'X') FROM `ï¼´ï¼’`; +SELECT `C1`, LPAD(`C1`,5,'丄') FROM `T3`; + +#MyISAM +SELECT `C1`, LPAD(`C1`,5,'。') FROM `ï¼´ï¼”`; +SELECT `C1`, LPAD(`C1`,5,'X') FROM `T5`; +SELECT `C1`, LPAD(`C1`,5,'丄' ) FROM `ï¼´ï¼–`; + +#HEAP +SELECT `C1`, LPAD(`C1`,5,'。') FROM `ï¼´ï¼—`; +SELECT `C1`, LPAD(`C1`,5,'X') FROM `T8`; +SELECT `C1`, LPAD(`C1`,5,'丄' ) FROM `ï¼´ï¼™`; + +#BDB +SELECT `C1`, LPAD(`C1`,5,'。') FROM `T1ï¼`; +SELECT `C1`, LPAD(`C1`,5,'X') FROM `T11`; +SELECT `C1`, LPAD(`C1`,5,'丄' ) FROM `T12`; + +DROP TABLE `T1`; +DROP TABLE `ï¼´ï¼’`; +DROP TABLE `T3`; +DROP TABLE `ï¼´ï¼”`; +DROP TABLE `T5`; +DROP TABLE `ï¼´ï¼–`; +DROP TABLE `ï¼´ï¼—`; +DROP TABLE `T8`; +DROP TABLE `ï¼´ï¼™`; +DROP TABLE `T1ï¼`; +DROP TABLE `T11`; +DROP TABLE `T12`; diff --git a/mysql-test/suite/jp/t/jp_ltrim_sjis.test b/mysql-test/suite/jp/t/jp_ltrim_sjis.test new file mode 100755 index 00000000000..864238df07c --- /dev/null +++ b/mysql-test/suite/jp/t/jp_ltrim_sjis.test @@ -0,0 +1,163 @@ +--character_set sjis +--disable_warnings +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +--enable_warnings + +# +# Test LTRIM() function with Japanese characters in sjis encoding +# + +SET NAMES sjis; +SET character_set_database = sjis; + +CREATE TABLE `‚s‚P` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Q` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚R` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚S` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚T` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚U` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚V` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚W` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚X` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚O` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚P` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚Q` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; + +INSERT INTO `‚s‚P` VALUES ('±²³´µ'); +INSERT INTO `‚s‚P` VALUES (' ±²³´µ'); +INSERT INTO `‚s‚P` VALUES (' ±²³´µ'); +INSERT INTO `‚s‚P` VALUES (' ±²³´µ'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `‚s‚P` VALUES ('@±²³´µ'); +INSERT INTO `‚s‚P` VALUES ('@@±²³´µ'); +INSERT INTO `‚s‚P` VALUES ('@@@±²³´µ'); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚Q` VALUES (' ‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚Q` VALUES (' ‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚Q` VALUES (' ‚ ‚¢‚¤‚¦‚¨'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `‚s‚Q` VALUES ('@‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚Q` VALUES ('@@‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚Q` VALUES ('@@@‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚R` VALUES (' ƒ\\•\—\\'); +INSERT INTO `‚s‚R` VALUES (' ƒ\\•\—\\'); +INSERT INTO `‚s‚R` VALUES (' ƒ\\•\—\\'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `‚s‚R` VALUES ('@ƒ\\•\—\\'); +INSERT INTO `‚s‚R` VALUES ('@@ƒ\\•\—\\'); +INSERT INTO `‚s‚R` VALUES ('@@@ƒ\\•\—\\'); +INSERT INTO `‚s‚S` VALUES ('±²³´µ'); +INSERT INTO `‚s‚S` VALUES (' ±²³´µ'); +INSERT INTO `‚s‚S` VALUES (' ±²³´µ'); +INSERT INTO `‚s‚S` VALUES (' ±²³´µ'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `‚s‚S` VALUES ('@±²³´µ'); +INSERT INTO `‚s‚S` VALUES ('@@±²³´µ'); +INSERT INTO `‚s‚S` VALUES ('@@@±²³´µ'); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚T` VALUES (' ‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚T` VALUES (' ‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚T` VALUES (' ‚ ‚¢‚¤‚¦‚¨'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `‚s‚T` VALUES ('@‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚T` VALUES ('@@‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚T` VALUES ('@@@‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚U` VALUES (' ƒ\\•\—\\'); +INSERT INTO `‚s‚U` VALUES (' ƒ\\•\—\\'); +INSERT INTO `‚s‚U` VALUES (' ƒ\\•\—\\'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `‚s‚U` VALUES ('@ƒ\\•\—\\'); +INSERT INTO `‚s‚U` VALUES ('@@ƒ\\•\—\\'); +INSERT INTO `‚s‚U` VALUES ('@@@ƒ\\•\—\\'); +INSERT INTO `‚s‚V` VALUES ('±²³´µ'); +INSERT INTO `‚s‚V` VALUES (' ±²³´µ'); +INSERT INTO `‚s‚V` VALUES (' ±²³´µ'); +INSERT INTO `‚s‚V` VALUES (' ±²³´µ'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `‚s‚V` VALUES ('@±²³´µ'); +INSERT INTO `‚s‚V` VALUES ('@@±²³´µ'); +INSERT INTO `‚s‚V` VALUES ('@@@±²³´µ'); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚W` VALUES (' ‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚W` VALUES (' ‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚W` VALUES (' ‚ ‚¢‚¤‚¦‚¨'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `‚s‚W` VALUES ('@‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚W` VALUES ('@@‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚W` VALUES ('@@@‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚X` VALUES (' ƒ\\•\—\\'); +INSERT INTO `‚s‚X` VALUES (' ƒ\\•\—\\'); +INSERT INTO `‚s‚X` VALUES (' ƒ\\•\—\\'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `‚s‚X` VALUES ('@ƒ\\•\—\\'); +INSERT INTO `‚s‚X` VALUES ('@@ƒ\\•\—\\'); +INSERT INTO `‚s‚X` VALUES ('@@@ƒ\\•\—\\'); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ'); +INSERT INTO `‚s‚P‚O` VALUES (' ±²³´µ'); +INSERT INTO `‚s‚P‚O` VALUES (' ±²³´µ'); +INSERT INTO `‚s‚P‚O` VALUES (' ±²³´µ'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `‚s‚P‚O` VALUES ('@±²³´µ'); +INSERT INTO `‚s‚P‚O` VALUES ('@@±²³´µ'); +INSERT INTO `‚s‚P‚O` VALUES ('@@@±²³´µ'); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚P‚P` VALUES (' ‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚P‚P` VALUES (' ‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚P‚P` VALUES (' ‚ ‚¢‚¤‚¦‚¨'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `‚s‚P‚P` VALUES ('@‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚P‚P` VALUES ('@@‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚P‚P` VALUES ('@@@‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚P‚Q` VALUES (' ƒ\\•\—\\'); +INSERT INTO `‚s‚P‚Q` VALUES (' ƒ\\•\—\\'); +INSERT INTO `‚s‚P‚Q` VALUES (' ƒ\\•\—\\'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `‚s‚P‚Q` VALUES ('@ƒ\\•\—\\'); +INSERT INTO `‚s‚P‚Q` VALUES ('@@ƒ\\•\—\\'); +INSERT INTO `‚s‚P‚Q` VALUES ('@@@ƒ\\•\—\\'); + +#InnoDB +SELECT LTRIM(`‚b‚P`) from `‚s‚P`; +SELECT LTRIM(`‚b‚P`) from `‚s‚Q`; +SELECT LTRIM(`‚b‚P`) from `‚s‚R`; + +#MyISAM +SELECT LTRIM(`‚b‚P`) from `‚s‚S`; +SELECT LTRIM(`‚b‚P`) from `‚s‚T`; +SELECT LTRIM(`‚b‚P`) from `‚s‚U`; + +#HEAP +SELECT LTRIM(`‚b‚P`) from `‚s‚V`; +SELECT LTRIM(`‚b‚P`) from `‚s‚W`; +SELECT LTRIM(`‚b‚P`) from `‚s‚X`; + +#BDB +SELECT LTRIM(`‚b‚P`) from `‚s‚P‚O`; +SELECT LTRIM(`‚b‚P`) from `‚s‚P‚P`; +SELECT LTRIM(`‚b‚P`) from `‚s‚P‚Q`; + +DROP TABLE `‚s‚P`; +DROP TABLE `‚s‚Q`; +DROP TABLE `‚s‚R`; +DROP TABLE `‚s‚S`; +DROP TABLE `‚s‚T`; +DROP TABLE `‚s‚U`; +DROP TABLE `‚s‚V`; +DROP TABLE `‚s‚W`; +DROP TABLE `‚s‚X`; +DROP TABLE `‚s‚P‚O`; +DROP TABLE `‚s‚P‚P`; +DROP TABLE `‚s‚P‚Q`; diff --git a/mysql-test/suite/jp/t/jp_ltrim_ucs2.test b/mysql-test/suite/jp/t/jp_ltrim_ucs2.test new file mode 100755 index 00000000000..0ae647f5222 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_ltrim_ucs2.test @@ -0,0 +1,165 @@ +--source include/have_ucs2.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +--enable_warnings + +# +# Test LTRIM() function with Japanese characters in ucs2 encoding +# + +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; + +CREATE TABLE `£Ô£±` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; + +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±` VALUES (' ޱ޲޳޴޵'); +INSERT INTO `£Ô£±` VALUES (' ޱ޲޳޴޵'); +INSERT INTO `£Ô£±` VALUES (' ޱ޲޳޴޵'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£±` VALUES ('¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£±` VALUES ('¡¡¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£±` VALUES ('¡¡¡¡¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£²` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£²` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£²` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£²` VALUES ('¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£²` VALUES ('¡¡¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£²` VALUES ('¡¡¡¡¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£³` VALUES (' íÜíÝíÞíßíà'); +INSERT INTO `£Ô£³` VALUES (' íÜíÝíÞíßíà'); +INSERT INTO `£Ô£³` VALUES (' íÜíÝíÞíßíà'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£³` VALUES ('¡¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£³` VALUES ('¡¡¡¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£³` VALUES ('¡¡¡¡¡¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£´` VALUES (' ޱ޲޳޴޵'); +INSERT INTO `£Ô£´` VALUES (' ޱ޲޳޴޵'); +INSERT INTO `£Ô£´` VALUES (' ޱ޲޳޴޵'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£´` VALUES ('¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£´` VALUES ('¡¡¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£´` VALUES ('¡¡¡¡¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£µ` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£µ` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£µ` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£µ` VALUES ('¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£µ` VALUES ('¡¡¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£µ` VALUES ('¡¡¡¡¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¶` VALUES (' íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¶` VALUES (' íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¶` VALUES (' íÜíÝíÞíßíà'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£¶` VALUES ('¡¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¶` VALUES ('¡¡¡¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¶` VALUES ('¡¡¡¡¡¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£·` VALUES (' ޱ޲޳޴޵'); +INSERT INTO `£Ô£·` VALUES (' ޱ޲޳޴޵'); +INSERT INTO `£Ô£·` VALUES (' ޱ޲޳޴޵'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£·` VALUES ('¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£·` VALUES ('¡¡¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£·` VALUES ('¡¡¡¡¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¸` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¸` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¸` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£¸` VALUES ('¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¸` VALUES ('¡¡¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¸` VALUES ('¡¡¡¡¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¹` VALUES (' íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¹` VALUES (' íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¹` VALUES (' íÜíÝíÞíßíà'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£¹` VALUES ('¡¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¹` VALUES ('¡¡¡¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¹` VALUES ('¡¡¡¡¡¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£°` VALUES (' ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£°` VALUES (' ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£°` VALUES (' ޱ޲޳޴޵'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£±£°` VALUES ('¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£±£°` VALUES ('¡¡¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£±£°` VALUES ('¡¡¡¡¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£±` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£±` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£±` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£±£±` VALUES ('¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£±` VALUES ('¡¡¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£±` VALUES ('¡¡¡¡¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£²` VALUES (' íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£²` VALUES (' íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£²` VALUES (' íÜíÝíÞíßíà'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£±£²` VALUES ('¡¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£²` VALUES ('¡¡¡¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£²` VALUES ('¡¡¡¡¡¡íÜíÝíÞíßíà'); + +#InnoDB +SELECT LTRIM(`£Ã£±`) from `£Ô£±`; +SELECT LTRIM(`£Ã£±`) from `£Ô£²`; +SELECT LTRIM(`£Ã£±`) from `£Ô£³`; + +#MyISAM +SELECT LTRIM(`£Ã£±`) from `£Ô£´`; +SELECT LTRIM(`£Ã£±`) from `£Ô£µ`; +SELECT LTRIM(`£Ã£±`) from `£Ô£¶`; + +#HEAP +SELECT LTRIM(`£Ã£±`) from `£Ô£·`; +SELECT LTRIM(`£Ã£±`) from `£Ô£¸`; +SELECT LTRIM(`£Ã£±`) from `£Ô£¹`; + +#BDB +SELECT LTRIM(`£Ã£±`) from `£Ô£±£°`; +SELECT LTRIM(`£Ã£±`) from `£Ô£±£±`; +SELECT LTRIM(`£Ã£±`) from `£Ô£±£²`; + +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/t/jp_ltrim_ujis.test b/mysql-test/suite/jp/t/jp_ltrim_ujis.test new file mode 100755 index 00000000000..64363aa330b --- /dev/null +++ b/mysql-test/suite/jp/t/jp_ltrim_ujis.test @@ -0,0 +1,164 @@ +--source include/have_ujis.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +--enable_warnings + +# +# Test LTRIM() function with Japanese characters in ujis encoding +# + +SET NAMES ujis; +SET character_set_database = ujis; + +CREATE TABLE `£Ô£±` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; + +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±` VALUES (' ޱ޲޳޴޵'); +INSERT INTO `£Ô£±` VALUES (' ޱ޲޳޴޵'); +INSERT INTO `£Ô£±` VALUES (' ޱ޲޳޴޵'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£±` VALUES ('¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£±` VALUES ('¡¡¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£±` VALUES ('¡¡¡¡¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£²` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£²` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£²` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£²` VALUES ('¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£²` VALUES ('¡¡¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£²` VALUES ('¡¡¡¡¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£³` VALUES (' íÜíÝíÞíßíà'); +INSERT INTO `£Ô£³` VALUES (' íÜíÝíÞíßíà'); +INSERT INTO `£Ô£³` VALUES (' íÜíÝíÞíßíà'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£³` VALUES ('¡¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£³` VALUES ('¡¡¡¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£³` VALUES ('¡¡¡¡¡¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£´` VALUES (' ޱ޲޳޴޵'); +INSERT INTO `£Ô£´` VALUES (' ޱ޲޳޴޵'); +INSERT INTO `£Ô£´` VALUES (' ޱ޲޳޴޵'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£´` VALUES ('¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£´` VALUES ('¡¡¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£´` VALUES ('¡¡¡¡¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£µ` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£µ` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£µ` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£µ` VALUES ('¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£µ` VALUES ('¡¡¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£µ` VALUES ('¡¡¡¡¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¶` VALUES (' íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¶` VALUES (' íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¶` VALUES (' íÜíÝíÞíßíà'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£¶` VALUES ('¡¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¶` VALUES ('¡¡¡¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¶` VALUES ('¡¡¡¡¡¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£·` VALUES (' ޱ޲޳޴޵'); +INSERT INTO `£Ô£·` VALUES (' ޱ޲޳޴޵'); +INSERT INTO `£Ô£·` VALUES (' ޱ޲޳޴޵'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£·` VALUES ('¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£·` VALUES ('¡¡¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£·` VALUES ('¡¡¡¡¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¸` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¸` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¸` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£¸` VALUES ('¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¸` VALUES ('¡¡¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¸` VALUES ('¡¡¡¡¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¹` VALUES (' íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¹` VALUES (' íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¹` VALUES (' íÜíÝíÞíßíà'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£¹` VALUES ('¡¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¹` VALUES ('¡¡¡¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¹` VALUES ('¡¡¡¡¡¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£°` VALUES (' ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£°` VALUES (' ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£°` VALUES (' ޱ޲޳޴޵'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£±£°` VALUES ('¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£±£°` VALUES ('¡¡¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£±£°` VALUES ('¡¡¡¡¡¡Ž±Ž²Ž³Ž´Žµ'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£±` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£±` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£±` VALUES (' ¤¢¤¤¤¦¤¨¤ª'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£±£±` VALUES ('¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£±` VALUES ('¡¡¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£±` VALUES ('¡¡¡¡¡¡¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£²` VALUES (' íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£²` VALUES (' íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£²` VALUES (' íÜíÝíÞíßíà'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£±£²` VALUES ('¡¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£²` VALUES ('¡¡¡¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£²` VALUES ('¡¡¡¡¡¡íÜíÝíÞíßíà'); + +#InnoDB +SELECT LTRIM(`£Ã£±`) from `£Ô£±`; +SELECT LTRIM(`£Ã£±`) from `£Ô£²`; +SELECT LTRIM(`£Ã£±`) from `£Ô£³`; + +#MyISAM +SELECT LTRIM(`£Ã£±`) from `£Ô£´`; +SELECT LTRIM(`£Ã£±`) from `£Ô£µ`; +SELECT LTRIM(`£Ã£±`) from `£Ô£¶`; + +#HEAP +SELECT LTRIM(`£Ã£±`) from `£Ô£·`; +SELECT LTRIM(`£Ã£±`) from `£Ô£¸`; +SELECT LTRIM(`£Ã£±`) from `£Ô£¹`; + +#BDB +SELECT LTRIM(`£Ã£±`) from `£Ô£±£°`; +SELECT LTRIM(`£Ã£±`) from `£Ô£±£±`; +SELECT LTRIM(`£Ã£±`) from `£Ô£±£²`; + +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/t/jp_ltrim_utf8.test b/mysql-test/suite/jp/t/jp_ltrim_utf8.test new file mode 100755 index 00000000000..846ce11163b --- /dev/null +++ b/mysql-test/suite/jp/t/jp_ltrim_utf8.test @@ -0,0 +1,162 @@ +--disable_warnings +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +--enable_warnings + +# +# Test LTRIM() function with Japanese characters in utf8 encoding +# + +SET NAMES utf8; +SET character_set_database = utf8; + +CREATE TABLE `T1` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T11` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T12` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; + +INSERT INTO `T1` VALUES ('アイウエオ'); +INSERT INTO `T1` VALUES (' アイウエオ'); +INSERT INTO `T1` VALUES (' アイウエオ'); +INSERT INTO `T1` VALUES (' アイウエオ'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `T1` VALUES (' アイウエオ'); +INSERT INTO `T1` VALUES ('  アイウエオ'); +INSERT INTO `T1` VALUES ('   アイウエオ'); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼’` VALUES (' ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼’` VALUES (' ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼’` VALUES (' ã‚ã„ã†ãˆãŠ'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `ï¼´ï¼’` VALUES (' ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼’` VALUES ('  ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼’` VALUES ('   ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T3` VALUES ('龔龖龗龞龡'); +INSERT INTO `T3` VALUES (' 龔龖龗龞龡'); +INSERT INTO `T3` VALUES (' 龔龖龗龞龡'); +INSERT INTO `T3` VALUES (' 龔龖龗龞龡'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `T3` VALUES (' 龔龖龗龞龡'); +INSERT INTO `T3` VALUES ('  龔龖龗龞龡'); +INSERT INTO `T3` VALUES ('   龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオ'); +INSERT INTO `ï¼´ï¼”` VALUES (' アイウエオ'); +INSERT INTO `ï¼´ï¼”` VALUES (' アイウエオ'); +INSERT INTO `ï¼´ï¼”` VALUES (' アイウエオ'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `ï¼´ï¼”` VALUES (' アイウエオ'); +INSERT INTO `ï¼´ï¼”` VALUES ('  アイウエオ'); +INSERT INTO `ï¼´ï¼”` VALUES ('   アイウエオ'); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T5` VALUES (' ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T5` VALUES (' ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T5` VALUES (' ã‚ã„ã†ãˆãŠ'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `T5` VALUES (' ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T5` VALUES ('  ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T5` VALUES ('   ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼–` VALUES (' 龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼–` VALUES (' 龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼–` VALUES (' 龔龖龗龞龡'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `ï¼´ï¼–` VALUES (' 龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼–` VALUES ('  龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼–` VALUES ('   龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオ'); +INSERT INTO `ï¼´ï¼—` VALUES (' アイウエオ'); +INSERT INTO `ï¼´ï¼—` VALUES (' アイウエオ'); +INSERT INTO `ï¼´ï¼—` VALUES (' アイウエオ'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `ï¼´ï¼—` VALUES (' アイウエオ'); +INSERT INTO `ï¼´ï¼—` VALUES ('  アイウエオ'); +INSERT INTO `ï¼´ï¼—` VALUES ('   アイウエオ'); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T8` VALUES (' ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T8` VALUES (' ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T8` VALUES (' ã‚ã„ã†ãˆãŠ'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `T8` VALUES (' ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T8` VALUES ('  ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T8` VALUES ('   ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼™` VALUES (' 龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼™` VALUES (' 龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼™` VALUES (' 龔龖龗龞龡'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `ï¼´ï¼™` VALUES (' 龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼™` VALUES ('  龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼™` VALUES ('   龔龖龗龞龡'); +INSERT INTO `T1ï¼` VALUES ('アイウエオ'); +INSERT INTO `T1ï¼` VALUES (' アイウエオ'); +INSERT INTO `T1ï¼` VALUES (' アイウエオ'); +INSERT INTO `T1ï¼` VALUES (' アイウエオ'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `T1ï¼` VALUES (' アイウエオ'); +INSERT INTO `T1ï¼` VALUES ('  アイウエオ'); +INSERT INTO `T1ï¼` VALUES ('   アイウエオ'); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T11` VALUES (' ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T11` VALUES (' ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T11` VALUES (' ã‚ã„ã†ãˆãŠ'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `T11` VALUES (' ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T11` VALUES ('  ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T11` VALUES ('   ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T12` VALUES ('龔龖龗龞龡'); +INSERT INTO `T12` VALUES (' 龔龖龗龞龡'); +INSERT INTO `T12` VALUES (' 龔龖龗龞龡'); +INSERT INTO `T12` VALUES (' 龔龖龗龞龡'); +# Double byte spaces are not supposed to be trimed +INSERT INTO `T12` VALUES (' 龔龖龗龞龡'); +INSERT INTO `T12` VALUES ('  龔龖龗龞龡'); +INSERT INTO `T12` VALUES ('   龔龖龗龞龡'); + +#InnoDB +SELECT LTRIM(`C1`) from `T1`; +SELECT LTRIM(`C1`) from `ï¼´ï¼’`; +SELECT LTRIM(`C1`) from `T3`; + +#MyISAM +SELECT LTRIM(`C1`) from `ï¼´ï¼”`; +SELECT LTRIM(`C1`) from `T5`; +SELECT LTRIM(`C1`) from `ï¼´ï¼–`; + +#HEAP +SELECT LTRIM(`C1`) from `ï¼´ï¼—`; +SELECT LTRIM(`C1`) from `T8`; +SELECT LTRIM(`C1`) from `ï¼´ï¼™`; + +#BDB +SELECT LTRIM(`C1`) from `T1ï¼`; +SELECT LTRIM(`C1`) from `T11`; +SELECT LTRIM(`C1`) from `T12`; + +DROP TABLE `T1`; +DROP TABLE `ï¼´ï¼’`; +DROP TABLE `T3`; +DROP TABLE `ï¼´ï¼”`; +DROP TABLE `T5`; +DROP TABLE `ï¼´ï¼–`; +DROP TABLE `ï¼´ï¼—`; +DROP TABLE `T8`; +DROP TABLE `ï¼´ï¼™`; +DROP TABLE `T1ï¼`; +DROP TABLE `T11`; +DROP TABLE `T12`; diff --git a/mysql-test/suite/jp/t/jp_ps_sjis.test b/mysql-test/suite/jp/t/jp_ps_sjis.test new file mode 100755 index 00000000000..cc93dca2a79 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_ps_sjis.test @@ -0,0 +1,454 @@ +--character_set sjis +--disable_warnings +DROP TABLE IF EXISTS t1; +DROP TABLE IF EXISTS t2; +DROP TABLE IF EXISTS t3; +DROP TABLE IF EXISTS t4; +--enable_warnings + +# +# Test Prepares Statement with Japanese character in sjis encoding +# + +SET NAMES sjis; +SET character_set_database = sjis; + +### Test InnoDB ### +CREATE TABLE t1(c1 char(3)) DEFAULT CHARSET = sjis ENGINE = InnoDB; +CREATE TABLE t2(c1 char(3)) DEFAULT CHARSET = sjis ENGINE = InnoDB; +CREATE TABLE t3( + `±` char(1), + `‚ ` char(1), + `•\` char(1) +)DEFAULT CHARSET = sjis ENGINE = InnoDB; +CREATE TABLE t4(c1 char(1)) DEFAULT CHARSET = sjis ENGINE = InnoDB; + +INSERT INTO t1 VALUES ('xxx'); +INSERT INTO t2 VALUES ('±‚ •\'); +INSERT INTO t3 VALUES ('x','x','x'),('x','x','x'),('y','y','y'),('y','y','y'),('z','z','z'),('z','z','z'); +INSERT INTO t4 VALUES ('±'),('‚ '),('•\'); + +# Japanese parameter for column name +# the parameter for stmt is not interpreted as column name +PREPARE stmt1 FROM 'SELECT ? FROM t3'; +PREPARE stmt2 FROM 'SELECT * FROM t3 ORDER BY ?'; +PREPARE stmt3 FROM 'SELECT COUNT(*) FROM t3 GROUP BY ?'; +# Japanese parameter for function argument +PREPARE stmt4 FROM 'SELECT CHAR_LENGTH(?)'; +PREPARE stmt5 FROM 'SELECT CHARSET(?)'; +PREPARE stmt6 FROM 'SELECT INSERT(c1,1,1,?) FROM t1'; +PREPARE stmt7 FROM 'SELECT INSTR(c1,?) FROM t2'; +PREPARE stmt8 FROM 'SELECT LOCATE(?,c1) FROM t2'; +PREPARE stmt9 FROM 'SELECT LPAD(c1,10,?) FROM t1'; +PREPARE stmt10 FROM 'SELECT REPLACE(c1,?,\'x\') FROM t2'; +PREPARE stmt11 FROM 'SELECT REPLACE(c1,\'x\',?) FROM t1'; +PREPARE stmt12 FROM 'SELECT RPAD(c1,10,?) FROM t1'; +# Japanese parameter for UPDATE +PREPARE stmt13 FROM 'UPDATE t4 SET c1=\'x\' WHERE c1=?'; +PREPARE stmt14 FROM 'UPDATE t4 SET c1=? WHERE c1=\'x\''; + +## Test jisx0201 ## +SET @arg = '±'; +EXECUTE stmt1 USING @arg; +EXECUTE stmt2 USING @arg; +EXECUTE stmt3 USING @arg; +EXECUTE stmt4 USING @arg; +EXECUTE stmt5 USING @arg; +EXECUTE stmt6 USING @arg; +EXECUTE stmt7 USING @arg; +EXECUTE stmt8 USING @arg; +EXECUTE stmt9 USING @arg; +EXECUTE stmt10 USING @arg; +EXECUTE stmt11 USING @arg; +EXECUTE stmt12 USING @arg; +EXECUTE stmt13 USING @arg; +SELECT * FROM t4; +EXECUTE stmt14 USING @arg; +SELECT * FROM t4; + +## Test jisx0208 ## +SET @arg = '‚ '; +EXECUTE stmt1 USING @arg; +EXECUTE stmt2 USING @arg; +EXECUTE stmt3 USING @arg; +EXECUTE stmt4 USING @arg; +EXECUTE stmt5 USING @arg; +EXECUTE stmt6 USING @arg; +EXECUTE stmt7 USING @arg; +EXECUTE stmt8 USING @arg; +EXECUTE stmt9 USING @arg; +EXECUTE stmt10 USING @arg; +EXECUTE stmt11 USING @arg; +EXECUTE stmt12 USING @arg; +EXECUTE stmt13 USING @arg; +SELECT * FROM t4; +EXECUTE stmt14 USING @arg; +SELECT * FROM t4; + +# Test jisx0212 ## +SET @arg = '•\'; +EXECUTE stmt1 USING @arg; +EXECUTE stmt2 USING @arg; +EXECUTE stmt3 USING @arg; +EXECUTE stmt4 USING @arg; +EXECUTE stmt5 USING @arg; +EXECUTE stmt6 USING @arg; +EXECUTE stmt7 USING @arg; +EXECUTE stmt8 USING @arg; +EXECUTE stmt9 USING @arg; +EXECUTE stmt10 USING @arg; +EXECUTE stmt11 USING @arg; +EXECUTE stmt12 USING @arg; +EXECUTE stmt13 USING @arg; +SELECT * FROM t4; +EXECUTE stmt14 USING @arg; +SELECT * FROM t4; + +DEALLOCATE PREPARE stmt1; +DEALLOCATE PREPARE stmt2; +DEALLOCATE PREPARE stmt3; +DEALLOCATE PREPARE stmt4; +DEALLOCATE PREPARE stmt5; +DEALLOCATE PREPARE stmt6; +DEALLOCATE PREPARE stmt7; +DEALLOCATE PREPARE stmt8; +DEALLOCATE PREPARE stmt9; +DEALLOCATE PREPARE stmt10; +DEALLOCATE PREPARE stmt11; +DEALLOCATE PREPARE stmt12; +DEALLOCATE PREPARE stmt13; +DEALLOCATE PREPARE stmt14; + +DROP TABLE t1; +DROP TABLE t2; +DROP TABLE t3; +DROP TABLE t4; + +### Test MyISAM ### +CREATE TABLE t1(c1 char(3)) DEFAULT CHARSET = sjis ENGINE = MyISAM; +CREATE TABLE t2(c1 char(3)) DEFAULT CHARSET = sjis ENGINE = MyISAM; +CREATE TABLE t3( + `±` char(1), + `‚ ` char(1), + `•\` char(1) +)DEFAULT CHARSET = sjis ENGINE = MyISAM; +CREATE TABLE t4(c1 char(1)) DEFAULT CHARSET = sjis ENGINE = MyISAM; + +INSERT INTO t1 VALUES ('xxx'); +INSERT INTO t2 VALUES ('±‚ •\'); +INSERT INTO t3 VALUES ('x','x','x'),('x','x','x'),('y','y','y'),('y','y','y'),('z','z','z'),('z','z','z'); +INSERT INTO t4 VALUES ('±'),('‚ '),('•\' ); + +# Japanese parameter for column name +PREPARE stmt1 FROM 'SELECT ? FROM t3'; +PREPARE stmt2 FROM 'SELECT * FROM t3 ORDER BY ?'; +PREPARE stmt3 FROM 'SELECT COUNT(*) FROM t3 GROUP BY ?'; +# Japanese parameter for function argument +PREPARE stmt4 FROM 'SELECT CHAR_LENGTH(?)'; +PREPARE stmt5 FROM 'SELECT CHARSET(?)'; +PREPARE stmt6 FROM 'SELECT INSERT(c1,1,1,?) FROM t1'; +PREPARE stmt7 FROM 'SELECT INSTR(c1,?) FROM t2'; +PREPARE stmt8 FROM 'SELECT LOCATE(?,c1) FROM t2'; +PREPARE stmt9 FROM 'SELECT LPAD(c1,10,?) FROM t1'; +PREPARE stmt10 FROM 'SELECT REPLACE(c1,?,\'x\') FROM t2'; +PREPARE stmt11 FROM 'SELECT REPLACE(c1,\'x\',?) FROM t1'; +PREPARE stmt12 FROM 'SELECT RPAD(c1,10,?) FROM t1'; +# Japanese parameter for UPDATE +PREPARE stmt13 FROM 'UPDATE t4 SET c1=\'x\' WHERE c1=?'; +PREPARE stmt14 FROM 'UPDATE t4 SET c1=? WHERE c1=\'x\''; + +## Test jisx0201 ## +SET @arg = '±'; +EXECUTE stmt1 USING @arg; +EXECUTE stmt2 USING @arg; +EXECUTE stmt3 USING @arg; +EXECUTE stmt4 USING @arg; +EXECUTE stmt5 USING @arg; +EXECUTE stmt6 USING @arg; +EXECUTE stmt7 USING @arg; +EXECUTE stmt8 USING @arg; +EXECUTE stmt9 USING @arg; +EXECUTE stmt10 USING @arg; +EXECUTE stmt11 USING @arg; +EXECUTE stmt12 USING @arg; +EXECUTE stmt13 USING @arg; +SELECT * FROM t4; +EXECUTE stmt14 USING @arg; +SELECT * FROM t4; + +## Test jisx0208 ## +SET @arg = '‚ '; +EXECUTE stmt1 USING @arg; +EXECUTE stmt2 USING @arg; +EXECUTE stmt3 USING @arg; +EXECUTE stmt4 USING @arg; +EXECUTE stmt5 USING @arg; +EXECUTE stmt6 USING @arg; +EXECUTE stmt7 USING @arg; +EXECUTE stmt8 USING @arg; +EXECUTE stmt9 USING @arg; +EXECUTE stmt10 USING @arg; +EXECUTE stmt11 USING @arg; +EXECUTE stmt12 USING @arg; +EXECUTE stmt13 USING @arg; +SELECT * FROM t4; +EXECUTE stmt14 USING @arg; +SELECT * FROM t4; + +## Test jisx0212 ## +SET @arg = '•\'; +EXECUTE stmt1 USING @arg; +EXECUTE stmt2 USING @arg; +EXECUTE stmt3 USING @arg; +EXECUTE stmt4 USING @arg; +EXECUTE stmt5 USING @arg; +EXECUTE stmt6 USING @arg; +EXECUTE stmt7 USING @arg; +EXECUTE stmt8 USING @arg; +EXECUTE stmt9 USING @arg; +EXECUTE stmt10 USING @arg; +EXECUTE stmt11 USING @arg; +EXECUTE stmt12 USING @arg; +EXECUTE stmt13 USING @arg; +SELECT * FROM t4; +EXECUTE stmt14 USING @arg; +SELECT * FROM t4; + +DEALLOCATE PREPARE stmt1; +DEALLOCATE PREPARE stmt2; +DEALLOCATE PREPARE stmt3; +DEALLOCATE PREPARE stmt4; +DEALLOCATE PREPARE stmt5; +DEALLOCATE PREPARE stmt6; +DEALLOCATE PREPARE stmt7; +DEALLOCATE PREPARE stmt8; +DEALLOCATE PREPARE stmt9; +DEALLOCATE PREPARE stmt10; +DEALLOCATE PREPARE stmt11; +DEALLOCATE PREPARE stmt12; +DEALLOCATE PREPARE stmt13; +DEALLOCATE PREPARE stmt14; + +DROP TABLE t1; +DROP TABLE t2; +DROP TABLE t3; +DROP TABLE t4; + +### Test HEAP ### +CREATE TABLE t1(c1 char(3)) DEFAULT CHARSET = sjis ENGINE = HEAP; +CREATE TABLE t2(c1 char(3)) DEFAULT CHARSET = sjis ENGINE = HEAP; +CREATE TABLE t3( + `±` char(1), + `‚ ` char(1), + `•\` char(1) +)DEFAULT CHARSET = sjis ENGINE = HEAP; +CREATE TABLE t4(c1 char(1)) DEFAULT CHARSET = sjis ENGINE =HEAP; + +INSERT INTO t1 VALUES ('xxx'); +INSERT INTO t2 VALUES ('±‚ •\'); +INSERT INTO t3 VALUES ('x','x','x'),('x','x','x'),('y','y','y'),('y','y','y'),('z','z','z'),('z','z','z'); +INSERT INTO t4 VALUES ('±'),('‚ '),('•\' ); + +# Japanese parameter for column name +PREPARE stmt1 FROM 'SELECT ? FROM t3'; +PREPARE stmt2 FROM 'SELECT * FROM t3 ORDER BY ?'; +PREPARE stmt3 FROM 'SELECT COUNT(*) FROM t3 GROUP BY ?'; +# Japanese parameter for function argument +PREPARE stmt4 FROM 'SELECT CHAR_LENGTH(?)'; +PREPARE stmt5 FROM 'SELECT CHARSET(?)'; +PREPARE stmt6 FROM 'SELECT INSERT(c1,1,1,?) FROM t1'; +PREPARE stmt7 FROM 'SELECT INSTR(c1,?) FROM t2'; +PREPARE stmt8 FROM 'SELECT LOCATE(?,c1) FROM t2'; +PREPARE stmt9 FROM 'SELECT LPAD(c1,10,?) FROM t1'; +PREPARE stmt10 FROM 'SELECT REPLACE(c1,?,\'x\') FROM t2'; +PREPARE stmt11 FROM 'SELECT REPLACE(c1,\'x\',?) FROM t1'; +PREPARE stmt12 FROM 'SELECT RPAD(c1,10,?) FROM t1'; +# Japanese parameter for UPDATE +PREPARE stmt13 FROM 'UPDATE t4 SET c1=\'x\' WHERE c1=?'; +PREPARE stmt14 FROM 'UPDATE t4 SET c1=? WHERE c1=\'x\''; + +## Test jisx0201 ## +SET @arg = '±'; +EXECUTE stmt1 USING @arg; +EXECUTE stmt2 USING @arg; +EXECUTE stmt3 USING @arg; +EXECUTE stmt4 USING @arg; +EXECUTE stmt5 USING @arg; +EXECUTE stmt6 USING @arg; +EXECUTE stmt7 USING @arg; +EXECUTE stmt8 USING @arg; +EXECUTE stmt9 USING @arg; +EXECUTE stmt10 USING @arg; +EXECUTE stmt11 USING @arg; +EXECUTE stmt12 USING @arg; +EXECUTE stmt13 USING @arg; +SELECT * FROM t4; +EXECUTE stmt14 USING @arg; +SELECT * FROM t4; + +## Test jisx0208 ## +SET @arg = '‚ '; +EXECUTE stmt1 USING @arg; +EXECUTE stmt2 USING @arg; +EXECUTE stmt3 USING @arg; +EXECUTE stmt4 USING @arg; +EXECUTE stmt5 USING @arg; +EXECUTE stmt6 USING @arg; +EXECUTE stmt7 USING @arg; +EXECUTE stmt8 USING @arg; +EXECUTE stmt9 USING @arg; +EXECUTE stmt10 USING @arg; +EXECUTE stmt11 USING @arg; +EXECUTE stmt12 USING @arg; +EXECUTE stmt13 USING @arg; +SELECT * FROM t4; +EXECUTE stmt14 USING @arg; +SELECT * FROM t4; + +## Test jisx0212 ## +SET @arg = '•\'; +EXECUTE stmt1 USING @arg; +EXECUTE stmt2 USING @arg; +EXECUTE stmt3 USING @arg; +EXECUTE stmt4 USING @arg; +EXECUTE stmt5 USING @arg; +EXECUTE stmt6 USING @arg; +EXECUTE stmt7 USING @arg; +EXECUTE stmt8 USING @arg; +EXECUTE stmt9 USING @arg; +EXECUTE stmt10 USING @arg; +EXECUTE stmt11 USING @arg; +EXECUTE stmt12 USING @arg; +EXECUTE stmt13 USING @arg; +SELECT * FROM t4; +EXECUTE stmt14 USING @arg; +SELECT * FROM t4; + +DEALLOCATE PREPARE stmt1; +DEALLOCATE PREPARE stmt2; +DEALLOCATE PREPARE stmt3; +DEALLOCATE PREPARE stmt4; +DEALLOCATE PREPARE stmt5; +DEALLOCATE PREPARE stmt6; +DEALLOCATE PREPARE stmt7; +DEALLOCATE PREPARE stmt8; +DEALLOCATE PREPARE stmt9; +DEALLOCATE PREPARE stmt10; +DEALLOCATE PREPARE stmt11; +DEALLOCATE PREPARE stmt12; +DEALLOCATE PREPARE stmt13; +DEALLOCATE PREPARE stmt14; + +DROP TABLE t1; +DROP TABLE t2; +DROP TABLE t3; +DROP TABLE t4; + +### Test BDB ### +CREATE TABLE t1(c1 char(3)) DEFAULT CHARSET = sjis ENGINE = BDB; +CREATE TABLE t2(c1 char(3)) DEFAULT CHARSET = sjis ENGINE = BDB; +CREATE TABLE t3( + `±` char(1), + `‚ ` char(1), + `•\` char(1) +)DEFAULT CHARSET = sjis ENGINE = BDB; +CREATE TABLE t4(c1 char(1)) DEFAULT CHARSET = sjis ENGINE = BDB; +INSERT INTO t1 VALUES ('xxx'); +INSERT INTO t2 VALUES ('±‚ •\'); +INSERT INTO t3 VALUES ('x','x','x'),('x','x','x'),('y','y','y'),('y','y','y'),('z','z','z'),('z','z','z'); +INSERT INTO t4 VALUES ('±'),('‚ '),('•\' ); + +# Japanese parameter for column name +PREPARE stmt1 FROM 'SELECT ? FROM t3'; +PREPARE stmt2 FROM 'SELECT * FROM t3 ORDER BY ?'; +PREPARE stmt3 FROM 'SELECT COUNT(*) FROM t3 GROUP BY ?'; +# Japanese parameter for function argument +PREPARE stmt4 FROM 'SELECT CHAR_LENGTH(?)'; +PREPARE stmt5 FROM 'SELECT CHARSET(?)'; +PREPARE stmt6 FROM 'SELECT INSERT(c1,1,1,?) FROM t1'; +PREPARE stmt7 FROM 'SELECT INSTR(c1,?) FROM t2'; +PREPARE stmt8 FROM 'SELECT LOCATE(?,c1) FROM t2'; +PREPARE stmt9 FROM 'SELECT LPAD(c1,10,?) FROM t1'; +PREPARE stmt10 FROM 'SELECT REPLACE(c1,?,\'x\') FROM t2'; +PREPARE stmt11 FROM 'SELECT REPLACE(c1,\'x\',?) FROM t1'; +PREPARE stmt12 FROM 'SELECT RPAD(c1,10,?) FROM t1'; +# Japanese parameter for UPDATE +PREPARE stmt13 FROM 'UPDATE t4 SET c1=\'x\' WHERE c1=?'; +PREPARE stmt14 FROM 'UPDATE t4 SET c1=? WHERE c1=\'x\''; + +## Test jisx0201 ## +SET @arg = '±'; +EXECUTE stmt1 USING @arg; +EXECUTE stmt2 USING @arg; +EXECUTE stmt3 USING @arg; +EXECUTE stmt4 USING @arg; +EXECUTE stmt5 USING @arg; +EXECUTE stmt6 USING @arg; +EXECUTE stmt7 USING @arg; +EXECUTE stmt8 USING @arg; +EXECUTE stmt9 USING @arg; +EXECUTE stmt10 USING @arg; +EXECUTE stmt11 USING @arg; +EXECUTE stmt12 USING @arg; +EXECUTE stmt13 USING @arg; +SELECT * FROM t3; +EXECUTE stmt14 USING @arg; +SELECT * FROM t3; + +## Test jisx0208 ## +SET @arg = '‚ '; +EXECUTE stmt1 USING @arg; +EXECUTE stmt2 USING @arg; +EXECUTE stmt3 USING @arg; +EXECUTE stmt4 USING @arg; +EXECUTE stmt5 USING @arg; +EXECUTE stmt6 USING @arg; +EXECUTE stmt7 USING @arg; +EXECUTE stmt8 USING @arg; +EXECUTE stmt9 USING @arg; +EXECUTE stmt10 USING @arg; +EXECUTE stmt11 USING @arg; +EXECUTE stmt12 USING @arg; +EXECUTE stmt13 USING @arg; +SELECT * FROM t4; +EXECUTE stmt14 USING @arg; +SELECT * FROM t4; + +##Test jisx0212 ## +SET @arg = '•\'; +EXECUTE stmt1 USING @arg; +EXECUTE stmt2 USING @arg; +EXECUTE stmt3 USING @arg; +EXECUTE stmt4 USING @arg; +EXECUTE stmt5 USING @arg; +EXECUTE stmt6 USING @arg; +EXECUTE stmt7 USING @arg; +EXECUTE stmt8 USING @arg; +EXECUTE stmt9 USING @arg; +EXECUTE stmt10 USING @arg; +EXECUTE stmt11 USING @arg; +EXECUTE stmt12 USING @arg; +EXECUTE stmt13 USING @arg; +SELECT * FROM t4; +EXECUTE stmt14 USING @arg; +SELECT * FROM t4; + +DEALLOCATE PREPARE stmt1; +DEALLOCATE PREPARE stmt2; +DEALLOCATE PREPARE stmt3; +DEALLOCATE PREPARE stmt4; +DEALLOCATE PREPARE stmt5; +DEALLOCATE PREPARE stmt6; +DEALLOCATE PREPARE stmt7; +DEALLOCATE PREPARE stmt8; +DEALLOCATE PREPARE stmt9; +DEALLOCATE PREPARE stmt10; +DEALLOCATE PREPARE stmt11; +DEALLOCATE PREPARE stmt12; +DEALLOCATE PREPARE stmt13; +DEALLOCATE PREPARE stmt14; + +DROP TABLE t1; +DROP TABLE t2; +DROP TABLE t3; +DROP TABLE t4; diff --git a/mysql-test/suite/jp/t/jp_ps_ujis.test b/mysql-test/suite/jp/t/jp_ps_ujis.test new file mode 100755 index 00000000000..7d61c12e496 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_ps_ujis.test @@ -0,0 +1,455 @@ +--source include/have_ujis.inc + +--disable_warnings +DROP TABLE IF EXISTS t1; +DROP TABLE IF EXISTS t2; +DROP TABLE IF EXISTS t3; +DROP TABLE IF EXISTS t4; +--enable_warnings + +# +# Test Prepares Statement with Japanese character in ujis encoding +# + +SET NAMES ujis; +SET character_set_database = ujis; + +### Test InnoDB ### +CREATE TABLE t1(c1 char(3)) DEFAULT CHARSET = ujis ENGINE = InnoDB; +CREATE TABLE t2(c1 char(3)) DEFAULT CHARSET = ujis ENGINE = InnoDB; +CREATE TABLE t3( + `ޱ` char(1), + `¤¢` char(1), + `íÜ` char(1) +)DEFAULT CHARSET = ujis ENGINE = InnoDB; +CREATE TABLE t4(c1 char(1)) DEFAULT CHARSET = ujis ENGINE = InnoDB; + +INSERT INTO t1 VALUES ('xxx'); +INSERT INTO t2 VALUES ('ޱ¤¢íÜ'); +INSERT INTO t3 VALUES ('x','x','x'),('x','x','x'),('y','y','y'),('y','y','y'),('z','z','z'),('z','z','z'); +INSERT INTO t4 VALUES ('ޱ'),('¤¢'),('íÜ'); + +# Japanese parameter for column name +# the parameter for stmt is not interpreted as column name +PREPARE stmt1 FROM 'SELECT ? FROM t3'; +PREPARE stmt2 FROM 'SELECT * FROM t3 ORDER BY ?'; +PREPARE stmt3 FROM 'SELECT COUNT(*) FROM t3 GROUP BY ?'; +# Japanese parameter for function argument +PREPARE stmt4 FROM 'SELECT CHAR_LENGTH(?)'; +PREPARE stmt5 FROM 'SELECT CHARSET(?)'; +PREPARE stmt6 FROM 'SELECT INSERT(c1,1,1,?) FROM t1'; +PREPARE stmt7 FROM 'SELECT INSTR(c1,?) FROM t2'; +PREPARE stmt8 FROM 'SELECT LOCATE(?,c1) FROM t2'; +PREPARE stmt9 FROM 'SELECT LPAD(c1,9,?) FROM t1'; +PREPARE stmt10 FROM 'SELECT REPLACE(c1,?,\'x\') FROM t2'; +PREPARE stmt11 FROM 'SELECT REPLACE(c1,\'x\',?) FROM t1'; +PREPARE stmt12 FROM 'SELECT RPAD(c1,9,?) FROM t1'; +# Japanese parameter for UPDATE +PREPARE stmt13 FROM 'UPDATE t4 SET c1=\'x\' WHERE c1=?'; +PREPARE stmt14 FROM 'UPDATE t4 SET c1=? WHERE c1=\'x\''; + +## Test jisx0201 ## +SET @arg = 'ޱ'; +EXECUTE stmt1 USING @arg; +EXECUTE stmt2 USING @arg; +EXECUTE stmt3 USING @arg; +EXECUTE stmt4 USING @arg; +EXECUTE stmt5 USING @arg; +EXECUTE stmt6 USING @arg; +EXECUTE stmt7 USING @arg; +EXECUTE stmt8 USING @arg; +EXECUTE stmt9 USING @arg; +EXECUTE stmt10 USING @arg; +EXECUTE stmt11 USING @arg; +EXECUTE stmt12 USING @arg; +EXECUTE stmt13 USING @arg; +SELECT * FROM t4; +EXECUTE stmt14 USING @arg; +SELECT * FROM t4; + +## Test jisx0208 ## +SET @arg = '¤¢'; +EXECUTE stmt1 USING @arg; +EXECUTE stmt2 USING @arg; +EXECUTE stmt3 USING @arg; +EXECUTE stmt4 USING @arg; +EXECUTE stmt5 USING @arg; +EXECUTE stmt6 USING @arg; +EXECUTE stmt7 USING @arg; +EXECUTE stmt8 USING @arg; +EXECUTE stmt9 USING @arg; +EXECUTE stmt10 USING @arg; +EXECUTE stmt11 USING @arg; +EXECUTE stmt12 USING @arg; +EXECUTE stmt13 USING @arg; +SELECT * FROM t4; +EXECUTE stmt14 USING @arg; +SELECT * FROM t4; + +# Test jisx0212 ## +SET @arg = 'íÜ'; +EXECUTE stmt1 USING @arg; +EXECUTE stmt2 USING @arg; +EXECUTE stmt3 USING @arg; +EXECUTE stmt4 USING @arg; +EXECUTE stmt5 USING @arg; +EXECUTE stmt6 USING @arg; +EXECUTE stmt7 USING @arg; +EXECUTE stmt8 USING @arg; +EXECUTE stmt9 USING @arg; +EXECUTE stmt10 USING @arg; +EXECUTE stmt11 USING @arg; +EXECUTE stmt12 USING @arg; +EXECUTE stmt13 USING @arg; +SELECT * FROM t4; +EXECUTE stmt14 USING @arg; +SELECT * FROM t4; + +DEALLOCATE PREPARE stmt1; +DEALLOCATE PREPARE stmt2; +DEALLOCATE PREPARE stmt3; +DEALLOCATE PREPARE stmt4; +DEALLOCATE PREPARE stmt5; +DEALLOCATE PREPARE stmt6; +DEALLOCATE PREPARE stmt7; +DEALLOCATE PREPARE stmt8; +DEALLOCATE PREPARE stmt9; +DEALLOCATE PREPARE stmt10; +DEALLOCATE PREPARE stmt11; +DEALLOCATE PREPARE stmt12; +DEALLOCATE PREPARE stmt13; +DEALLOCATE PREPARE stmt14; + +DROP TABLE t1; +DROP TABLE t2; +DROP TABLE t3; +DROP TABLE t4; + +### Test MyISAM ### +CREATE TABLE t1(c1 char(3)) DEFAULT CHARSET = ujis ENGINE = MyISAM; +CREATE TABLE t2(c1 char(3)) DEFAULT CHARSET = ujis ENGINE = MyISAM; +CREATE TABLE t3( + `ޱ` char(1), + `¤¢` char(1), + `íÜ` char(1) +)DEFAULT CHARSET = ujis ENGINE = MyISAM; +CREATE TABLE t4(c1 char(1)) DEFAULT CHARSET = ujis ENGINE = MyISAM; + +INSERT INTO t1 VALUES ('xxx'); +INSERT INTO t2 VALUES ('ޱ¤¢íÜ'); +INSERT INTO t3 VALUES ('x','x','x'),('x','x','x'),('y','y','y'),('y','y','y'),('z','z','z'),('z','z','z'); +INSERT INTO t4 VALUES ('ޱ'),('¤¢'),('íÜ' ); + +# Japanese parameter for column name +PREPARE stmt1 FROM 'SELECT ? FROM t3'; +PREPARE stmt2 FROM 'SELECT * FROM t3 ORDER BY ?'; +PREPARE stmt3 FROM 'SELECT COUNT(*) FROM t3 GROUP BY ?'; +# Japanese parameter for function argument +PREPARE stmt4 FROM 'SELECT CHAR_LENGTH(?)'; +PREPARE stmt5 FROM 'SELECT CHARSET(?)'; +PREPARE stmt6 FROM 'SELECT INSERT(c1,1,1,?) FROM t1'; +PREPARE stmt7 FROM 'SELECT INSTR(c1,?) FROM t2'; +PREPARE stmt8 FROM 'SELECT LOCATE(?,c1) FROM t2'; +PREPARE stmt9 FROM 'SELECT LPAD(c1,9,?) FROM t1'; +PREPARE stmt10 FROM 'SELECT REPLACE(c1,?,\'x\') FROM t2'; +PREPARE stmt11 FROM 'SELECT REPLACE(c1,\'x\',?) FROM t1'; +PREPARE stmt12 FROM 'SELECT RPAD(c1,9,?) FROM t1'; +# Japanese parameter for UPDATE +PREPARE stmt13 FROM 'UPDATE t4 SET c1=\'x\' WHERE c1=?'; +PREPARE stmt14 FROM 'UPDATE t4 SET c1=? WHERE c1=\'x\''; + +## Test jisx0201 ## +SET @arg = 'ޱ'; +EXECUTE stmt1 USING @arg; +EXECUTE stmt2 USING @arg; +EXECUTE stmt3 USING @arg; +EXECUTE stmt4 USING @arg; +EXECUTE stmt5 USING @arg; +EXECUTE stmt6 USING @arg; +EXECUTE stmt7 USING @arg; +EXECUTE stmt8 USING @arg; +EXECUTE stmt9 USING @arg; +EXECUTE stmt10 USING @arg; +EXECUTE stmt11 USING @arg; +EXECUTE stmt12 USING @arg; +EXECUTE stmt13 USING @arg; +SELECT * FROM t4; +EXECUTE stmt14 USING @arg; +SELECT * FROM t4; + +## Test jisx0208 ## +SET @arg = '¤¢'; +EXECUTE stmt1 USING @arg; +EXECUTE stmt2 USING @arg; +EXECUTE stmt3 USING @arg; +EXECUTE stmt4 USING @arg; +EXECUTE stmt5 USING @arg; +EXECUTE stmt6 USING @arg; +EXECUTE stmt7 USING @arg; +EXECUTE stmt8 USING @arg; +EXECUTE stmt9 USING @arg; +EXECUTE stmt10 USING @arg; +EXECUTE stmt11 USING @arg; +EXECUTE stmt12 USING @arg; +EXECUTE stmt13 USING @arg; +SELECT * FROM t4; +EXECUTE stmt14 USING @arg; +SELECT * FROM t4; + +## Test jisx0212 ## +SET @arg = 'íÜ'; +EXECUTE stmt1 USING @arg; +EXECUTE stmt2 USING @arg; +EXECUTE stmt3 USING @arg; +EXECUTE stmt4 USING @arg; +EXECUTE stmt5 USING @arg; +EXECUTE stmt6 USING @arg; +EXECUTE stmt7 USING @arg; +EXECUTE stmt8 USING @arg; +EXECUTE stmt9 USING @arg; +EXECUTE stmt10 USING @arg; +EXECUTE stmt11 USING @arg; +EXECUTE stmt12 USING @arg; +EXECUTE stmt13 USING @arg; +SELECT * FROM t4; +EXECUTE stmt14 USING @arg; +SELECT * FROM t4; + +DEALLOCATE PREPARE stmt1; +DEALLOCATE PREPARE stmt2; +DEALLOCATE PREPARE stmt3; +DEALLOCATE PREPARE stmt4; +DEALLOCATE PREPARE stmt5; +DEALLOCATE PREPARE stmt6; +DEALLOCATE PREPARE stmt7; +DEALLOCATE PREPARE stmt8; +DEALLOCATE PREPARE stmt9; +DEALLOCATE PREPARE stmt10; +DEALLOCATE PREPARE stmt11; +DEALLOCATE PREPARE stmt12; +DEALLOCATE PREPARE stmt13; +DEALLOCATE PREPARE stmt14; + +DROP TABLE t1; +DROP TABLE t2; +DROP TABLE t3; +DROP TABLE t4; + +### Test HEAP ### +CREATE TABLE t1(c1 char(3)) DEFAULT CHARSET = ujis ENGINE = HEAP; +CREATE TABLE t2(c1 char(3)) DEFAULT CHARSET = ujis ENGINE = HEAP; +CREATE TABLE t3( + `ޱ` char(1), + `¤¢` char(1), + `íÜ` char(1) +)DEFAULT CHARSET = ujis ENGINE = HEAP; +CREATE TABLE t4(c1 char(1)) DEFAULT CHARSET = ujis ENGINE =HEAP; + +INSERT INTO t1 VALUES ('xxx'); +INSERT INTO t2 VALUES ('ޱ¤¢íÜ'); +INSERT INTO t3 VALUES ('x','x','x'),('x','x','x'),('y','y','y'),('y','y','y'),('z','z','z'),('z','z','z'); +INSERT INTO t4 VALUES ('ޱ'),('¤¢'),('íÜ' ); + +# Japanese parameter for column name +PREPARE stmt1 FROM 'SELECT ? FROM t3'; +PREPARE stmt2 FROM 'SELECT * FROM t3 ORDER BY ?'; +PREPARE stmt3 FROM 'SELECT COUNT(*) FROM t3 GROUP BY ?'; +# Japanese parameter for function argument +PREPARE stmt4 FROM 'SELECT CHAR_LENGTH(?)'; +PREPARE stmt5 FROM 'SELECT CHARSET(?)'; +PREPARE stmt6 FROM 'SELECT INSERT(c1,1,1,?) FROM t1'; +PREPARE stmt7 FROM 'SELECT INSTR(c1,?) FROM t2'; +PREPARE stmt8 FROM 'SELECT LOCATE(?,c1) FROM t2'; +PREPARE stmt9 FROM 'SELECT LPAD(c1,9,?) FROM t1'; +PREPARE stmt10 FROM 'SELECT REPLACE(c1,?,\'x\') FROM t2'; +PREPARE stmt11 FROM 'SELECT REPLACE(c1,\'x\',?) FROM t1'; +PREPARE stmt12 FROM 'SELECT RPAD(c1,9,?) FROM t1'; +# Japanese parameter for UPDATE +PREPARE stmt13 FROM 'UPDATE t4 SET c1=\'x\' WHERE c1=?'; +PREPARE stmt14 FROM 'UPDATE t4 SET c1=? WHERE c1=\'x\''; + +## Test jisx0201 ## +SET @arg = 'ޱ'; +EXECUTE stmt1 USING @arg; +EXECUTE stmt2 USING @arg; +EXECUTE stmt3 USING @arg; +EXECUTE stmt4 USING @arg; +EXECUTE stmt5 USING @arg; +EXECUTE stmt6 USING @arg; +EXECUTE stmt7 USING @arg; +EXECUTE stmt8 USING @arg; +EXECUTE stmt9 USING @arg; +EXECUTE stmt10 USING @arg; +EXECUTE stmt11 USING @arg; +EXECUTE stmt12 USING @arg; +EXECUTE stmt13 USING @arg; +SELECT * FROM t4; +EXECUTE stmt14 USING @arg; +SELECT * FROM t4; + +## Test jisx0208 ## +SET @arg = '¤¢'; +EXECUTE stmt1 USING @arg; +EXECUTE stmt2 USING @arg; +EXECUTE stmt3 USING @arg; +EXECUTE stmt4 USING @arg; +EXECUTE stmt5 USING @arg; +EXECUTE stmt6 USING @arg; +EXECUTE stmt7 USING @arg; +EXECUTE stmt8 USING @arg; +EXECUTE stmt9 USING @arg; +EXECUTE stmt10 USING @arg; +EXECUTE stmt11 USING @arg; +EXECUTE stmt12 USING @arg; +EXECUTE stmt13 USING @arg; +SELECT * FROM t4; +EXECUTE stmt14 USING @arg; +SELECT * FROM t4; + +## Test jisx0212 ## +SET @arg = 'íÜ'; +EXECUTE stmt1 USING @arg; +EXECUTE stmt2 USING @arg; +EXECUTE stmt3 USING @arg; +EXECUTE stmt4 USING @arg; +EXECUTE stmt5 USING @arg; +EXECUTE stmt6 USING @arg; +EXECUTE stmt7 USING @arg; +EXECUTE stmt8 USING @arg; +EXECUTE stmt9 USING @arg; +EXECUTE stmt10 USING @arg; +EXECUTE stmt11 USING @arg; +EXECUTE stmt12 USING @arg; +EXECUTE stmt13 USING @arg; +SELECT * FROM t4; +EXECUTE stmt14 USING @arg; +SELECT * FROM t4; + +DEALLOCATE PREPARE stmt1; +DEALLOCATE PREPARE stmt2; +DEALLOCATE PREPARE stmt3; +DEALLOCATE PREPARE stmt4; +DEALLOCATE PREPARE stmt5; +DEALLOCATE PREPARE stmt6; +DEALLOCATE PREPARE stmt7; +DEALLOCATE PREPARE stmt8; +DEALLOCATE PREPARE stmt9; +DEALLOCATE PREPARE stmt10; +DEALLOCATE PREPARE stmt11; +DEALLOCATE PREPARE stmt12; +DEALLOCATE PREPARE stmt13; +DEALLOCATE PREPARE stmt14; + +DROP TABLE t1; +DROP TABLE t2; +DROP TABLE t3; +DROP TABLE t4; + +### Test BDB ### +CREATE TABLE t1(c1 char(3)) DEFAULT CHARSET = ujis ENGINE = BDB; +CREATE TABLE t2(c1 char(3)) DEFAULT CHARSET = ujis ENGINE = BDB; +CREATE TABLE t3( + `ޱ` char(1), + `¤¢` char(1), + `íÜ` char(1) +)DEFAULT CHARSET = ujis ENGINE = BDB; +CREATE TABLE t4(c1 char(1)) DEFAULT CHARSET = ujis ENGINE = BDB; +INSERT INTO t1 VALUES ('xxx'); +INSERT INTO t2 VALUES ('ޱ¤¢íÜ'); +INSERT INTO t3 VALUES ('x','x','x'),('x','x','x'),('y','y','y'),('y','y','y'),('z','z','z'),('z','z','z'); +INSERT INTO t4 VALUES ('ޱ'),('¤¢'),('íÜ' ); + +# Japanese parameter for column name +PREPARE stmt1 FROM 'SELECT ? FROM t3'; +PREPARE stmt2 FROM 'SELECT * FROM t3 ORDER BY ?'; +PREPARE stmt3 FROM 'SELECT COUNT(*) FROM t3 GROUP BY ?'; +# Japanese parameter for function argument +PREPARE stmt4 FROM 'SELECT CHAR_LENGTH(?)'; +PREPARE stmt5 FROM 'SELECT CHARSET(?)'; +PREPARE stmt6 FROM 'SELECT INSERT(c1,1,1,?) FROM t1'; +PREPARE stmt7 FROM 'SELECT INSTR(c1,?) FROM t2'; +PREPARE stmt8 FROM 'SELECT LOCATE(?,c1) FROM t2'; +PREPARE stmt9 FROM 'SELECT LPAD(c1,9,?) FROM t1'; +PREPARE stmt10 FROM 'SELECT REPLACE(c1,?,\'x\') FROM t2'; +PREPARE stmt11 FROM 'SELECT REPLACE(c1,\'x\',?) FROM t1'; +PREPARE stmt12 FROM 'SELECT RPAD(c1,9,?) FROM t1'; +# Japanese parameter for UPDATE +PREPARE stmt13 FROM 'UPDATE t4 SET c1=\'x\' WHERE c1=?'; +PREPARE stmt14 FROM 'UPDATE t4 SET c1=? WHERE c1=\'x\''; + +## Test jisx0201 ## +SET @arg = 'ޱ'; +EXECUTE stmt1 USING @arg; +EXECUTE stmt2 USING @arg; +EXECUTE stmt3 USING @arg; +EXECUTE stmt4 USING @arg; +EXECUTE stmt5 USING @arg; +EXECUTE stmt6 USING @arg; +EXECUTE stmt7 USING @arg; +EXECUTE stmt8 USING @arg; +EXECUTE stmt9 USING @arg; +EXECUTE stmt10 USING @arg; +EXECUTE stmt11 USING @arg; +EXECUTE stmt12 USING @arg; +EXECUTE stmt13 USING @arg; +SELECT * FROM t3; +EXECUTE stmt14 USING @arg; +SELECT * FROM t3; + +## Test jisx0208 ## +SET @arg = '¤¢'; +EXECUTE stmt1 USING @arg; +EXECUTE stmt2 USING @arg; +EXECUTE stmt3 USING @arg; +EXECUTE stmt4 USING @arg; +EXECUTE stmt5 USING @arg; +EXECUTE stmt6 USING @arg; +EXECUTE stmt7 USING @arg; +EXECUTE stmt8 USING @arg; +EXECUTE stmt9 USING @arg; +EXECUTE stmt10 USING @arg; +EXECUTE stmt11 USING @arg; +EXECUTE stmt12 USING @arg; +EXECUTE stmt13 USING @arg; +SELECT * FROM t4; +EXECUTE stmt14 USING @arg; +SELECT * FROM t4; + +##Test jisx0212 ## +SET @arg = 'íÜ'; +EXECUTE stmt1 USING @arg; +EXECUTE stmt2 USING @arg; +EXECUTE stmt3 USING @arg; +EXECUTE stmt4 USING @arg; +EXECUTE stmt5 USING @arg; +EXECUTE stmt6 USING @arg; +EXECUTE stmt7 USING @arg; +EXECUTE stmt8 USING @arg; +EXECUTE stmt9 USING @arg; +EXECUTE stmt10 USING @arg; +EXECUTE stmt11 USING @arg; +EXECUTE stmt12 USING @arg; +EXECUTE stmt13 USING @arg; +SELECT * FROM t4; +EXECUTE stmt14 USING @arg; +SELECT * FROM t4; + +DEALLOCATE PREPARE stmt1; +DEALLOCATE PREPARE stmt2; +DEALLOCATE PREPARE stmt3; +DEALLOCATE PREPARE stmt4; +DEALLOCATE PREPARE stmt5; +DEALLOCATE PREPARE stmt6; +DEALLOCATE PREPARE stmt7; +DEALLOCATE PREPARE stmt8; +DEALLOCATE PREPARE stmt9; +DEALLOCATE PREPARE stmt10; +DEALLOCATE PREPARE stmt11; +DEALLOCATE PREPARE stmt12; +DEALLOCATE PREPARE stmt13; +DEALLOCATE PREPARE stmt14; + +DROP TABLE t1; +DROP TABLE t2; +DROP TABLE t3; +DROP TABLE t4; diff --git a/mysql-test/suite/jp/t/jp_replace_sjis.test b/mysql-test/suite/jp/t/jp_replace_sjis.test new file mode 100755 index 00000000000..811d3350a34 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_replace_sjis.test @@ -0,0 +1,129 @@ +--character_set sjis +--disable_warnings +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +drop table if exists `‚s‚P‚P`; +drop table if exists `‚s‚P‚Q`; +--enable_warnings + +# +# Test REPLACE() function with Japanese characters in sjis encoding +# + +SET NAMES sjis; +SET character_set_database = sjis; + +CREATE TABLE `‚s‚P` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Q` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚R` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚S` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚T` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚U` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚V` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚W` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚X` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚O` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚P` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚Q` (`‚b‚P` char(5)) DEFAULT CHARSET = sjis engine = bdb; + +INSERT INTO `‚s‚P` VALUES ('±²³´µ'); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚S` VALUES ('±²³´µ'); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚V` VALUES ('±²³´µ'); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ'); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\'); + +#InnoDB +SELECT REPLACE(`‚b‚P`,'±','±±') FROM `‚s‚P`; +SELECT REPLACE(`‚b‚P`,'²','²²') FROM `‚s‚P`; +SELECT REPLACE(`‚b‚P`,'³','³³') FROM `‚s‚P`; +SELECT REPLACE(`‚b‚P`,'´','´´') FROM `‚s‚P`; +SELECT REPLACE(`‚b‚P`,'µ','µµ') FROM `‚s‚P`; +SELECT REPLACE(`‚b‚P`,'‚ ','‚ ‚ ') FROM `‚s‚Q`; +SELECT REPLACE(`‚b‚P`,'‚¢','‚¢‚¢') FROM `‚s‚Q`; +SELECT REPLACE(`‚b‚P`,'‚¤','‚¤‚¤') FROM `‚s‚Q`; +SELECT REPLACE(`‚b‚P`,'‚¦','‚¦‚¦') FROM `‚s‚Q`; +SELECT REPLACE(`‚b‚P`,'‚¨','‚¨‚¨') FROM `‚s‚Q`; +SELECT REPLACE(`‚b‚P`,'ƒ\','ƒ\ƒ\') FROM `‚s‚R`; +SELECT REPLACE(`‚b‚P`,'\','\\') FROM `‚s‚R`; +SELECT REPLACE(`‚b‚P`,'•\','•\•\') FROM `‚s‚R`; +SELECT REPLACE(`‚b‚P`,'—\','—\—\') FROM `‚s‚R`; +SELECT REPLACE(`‚b‚P`,'\','\\') FROM `‚s‚R`; + +#MyISAM +SELECT REPLACE(`‚b‚P`,'±','±±') FROM `‚s‚S`; +SELECT REPLACE(`‚b‚P`,'²','²²') FROM `‚s‚S`; +SELECT REPLACE(`‚b‚P`,'³','³³') FROM `‚s‚S`; +SELECT REPLACE(`‚b‚P`,'´','´´') FROM `‚s‚S`; +SELECT REPLACE(`‚b‚P`,'µ','µµ') FROM `‚s‚S`; +SELECT REPLACE(`‚b‚P`,'‚ ','‚ ‚ ') FROM `‚s‚T`; +SELECT REPLACE(`‚b‚P`,'‚¢','‚¢‚¢') FROM `‚s‚T`; +SELECT REPLACE(`‚b‚P`,'‚¤','‚¤‚¤') FROM `‚s‚T`; +SELECT REPLACE(`‚b‚P`,'‚¦','‚¦‚¦') FROM `‚s‚T`; +SELECT REPLACE(`‚b‚P`,'‚¨','‚¨‚¨') FROM `‚s‚T`; +SELECT REPLACE(`‚b‚P`,'ƒ\','ƒ\ƒ\') FROM `‚s‚U`; +SELECT REPLACE(`‚b‚P`,'\','\\') FROM `‚s‚U`; +SELECT REPLACE(`‚b‚P`,'•\','•\•\') FROM `‚s‚U`; +SELECT REPLACE(`‚b‚P`,'—\','—\—\') FROM `‚s‚U`; +SELECT REPLACE(`‚b‚P`,'\','\\') FROM `‚s‚U`; + +#HEAP +SELECT REPLACE(`‚b‚P`,'±','±±') FROM `‚s‚V`; +SELECT REPLACE(`‚b‚P`,'²','²²') FROM `‚s‚V`; +SELECT REPLACE(`‚b‚P`,'³','³³') FROM `‚s‚V`; +SELECT REPLACE(`‚b‚P`,'´','´´') FROM `‚s‚V`; +SELECT REPLACE(`‚b‚P`,'µ','µµ') FROM `‚s‚V`; +SELECT REPLACE(`‚b‚P`,'‚ ','‚ ‚ ') FROM `‚s‚W`; +SELECT REPLACE(`‚b‚P`,'‚¢','‚¢‚¢') FROM `‚s‚W`; +SELECT REPLACE(`‚b‚P`,'‚¤','‚¤‚¤') FROM `‚s‚W`; +SELECT REPLACE(`‚b‚P`,'‚¦','‚¦‚¦') FROM `‚s‚W`; +SELECT REPLACE(`‚b‚P`,'‚¨','‚¨‚¨') FROM `‚s‚W`; +SELECT REPLACE(`‚b‚P`,'ƒ\','ƒ\ƒ\') FROM `‚s‚X`; +SELECT REPLACE(`‚b‚P`,'\','\\') FROM `‚s‚X`; +SELECT REPLACE(`‚b‚P`,'•\','•\•\') FROM `‚s‚X`; +SELECT REPLACE(`‚b‚P`,'—\','—\—\') FROM `‚s‚X`; +SELECT REPLACE(`‚b‚P`,'\','\\') FROM `‚s‚X`; + +#BDB +SELECT REPLACE(`‚b‚P`,'±','±±') FROM `‚s‚P‚O`; +SELECT REPLACE(`‚b‚P`,'²','²²') FROM `‚s‚P‚O`; +SELECT REPLACE(`‚b‚P`,'³','³³') FROM `‚s‚P‚O`; +SELECT REPLACE(`‚b‚P`,'´','´´') FROM `‚s‚P‚O`; +SELECT REPLACE(`‚b‚P`,'µ','µµ') FROM `‚s‚P‚O`; +SELECT REPLACE(`‚b‚P`,'‚ ','‚ ‚ ') FROM `‚s‚P‚P`; +SELECT REPLACE(`‚b‚P`,'‚¢','‚¢‚¢') FROM `‚s‚P‚P`; +SELECT REPLACE(`‚b‚P`,'‚¤','‚¤‚¤') FROM `‚s‚P‚P`; +SELECT REPLACE(`‚b‚P`,'‚¦','‚¦‚¦') FROM `‚s‚P‚P`; +SELECT REPLACE(`‚b‚P`,'‚¨','‚¨‚¨') FROM `‚s‚P‚P`; +SELECT REPLACE(`‚b‚P`,'ƒ\','ƒ\ƒ\') FROM `‚s‚P‚Q`; +SELECT REPLACE(`‚b‚P`,'\','\\') FROM `‚s‚P‚Q`; +SELECT REPLACE(`‚b‚P`,'•\','•\•\') FROM `‚s‚P‚Q`; +SELECT REPLACE(`‚b‚P`,'—\','—\—\') FROM `‚s‚P‚Q`; +SELECT REPLACE(`‚b‚P`,'\','\\') FROM `‚s‚P‚Q`; + +DROP TABLE `‚s‚P`; +DROP TABLE `‚s‚Q`; +DROP TABLE `‚s‚R`; +DROP TABLE `‚s‚S`; +DROP TABLE `‚s‚T`; +DROP TABLE `‚s‚U`; +DROP TABLE `‚s‚V`; +DROP TABLE `‚s‚W`; +DROP TABLE `‚s‚X`; +DROP TABLE `‚s‚P‚O`; +DROP TABLE `‚s‚P‚P`; +DROP TABLE `‚s‚P‚Q`; diff --git a/mysql-test/suite/jp/t/jp_replace_ucs2.test b/mysql-test/suite/jp/t/jp_replace_ucs2.test new file mode 100755 index 00000000000..7739a30cd9c --- /dev/null +++ b/mysql-test/suite/jp/t/jp_replace_ucs2.test @@ -0,0 +1,131 @@ +--source include/have_ucs2.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +--enable_warnings + +# +# Test REPLACE() function with Japanese characters in ucs2 encoding +# + +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; + +CREATE TABLE `£Ô£±` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5)) DEFAULT CHARSET = ucs2 engine = bdb; + +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'); + +#InnoDB +SELECT REPLACE(`£Ã£±`,'ޱ','ޱޱ') FROM `£Ô£±`; +SELECT REPLACE(`£Ã£±`,'޲','޲޲') FROM `£Ô£±`; +SELECT REPLACE(`£Ã£±`,'޳','޳޳') FROM `£Ô£±`; +SELECT REPLACE(`£Ã£±`,'Ž´','Ž´Ž´') FROM `£Ô£±`; +SELECT REPLACE(`£Ã£±`,'޵','޵޵') FROM `£Ô£±`; +SELECT REPLACE(`£Ã£±`,'¤¢','¤¢¤¢') FROM `£Ô£²`; +SELECT REPLACE(`£Ã£±`,'¤¤','¤¤¤¤') FROM `£Ô£²`; +SELECT REPLACE(`£Ã£±`,'¤¦','¤¦¤¦') FROM `£Ô£²`; +SELECT REPLACE(`£Ã£±`,'¤¨','¤¨¤¨') FROM `£Ô£²`; +SELECT REPLACE(`£Ã£±`,'¤ª','¤ª¤ª') FROM `£Ô£²`; +SELECT REPLACE(`£Ã£±`,'íÜ','íÜíÜ') FROM `£Ô£³`; +SELECT REPLACE(`£Ã£±`,'íÝ','íÝíÝ') FROM `£Ô£³`; +SELECT REPLACE(`£Ã£±`,'íÞ','íÞíÞ') FROM `£Ô£³`; +SELECT REPLACE(`£Ã£±`,'íß','íßíß') FROM `£Ô£³`; +SELECT REPLACE(`£Ã£±`,'íà','íàíà') FROM `£Ô£³`; + +#MyISAM +SELECT REPLACE(`£Ã£±`,'ޱ','ޱޱ') FROM `£Ô£´`; +SELECT REPLACE(`£Ã£±`,'޲','޲޲') FROM `£Ô£´`; +SELECT REPLACE(`£Ã£±`,'޳','޳޳') FROM `£Ô£´`; +SELECT REPLACE(`£Ã£±`,'Ž´','Ž´Ž´') FROM `£Ô£´`; +SELECT REPLACE(`£Ã£±`,'޵','޵޵') FROM `£Ô£´`; +SELECT REPLACE(`£Ã£±`,'¤¢','¤¢¤¢') FROM `£Ô£µ`; +SELECT REPLACE(`£Ã£±`,'¤¤','¤¤¤¤') FROM `£Ô£µ`; +SELECT REPLACE(`£Ã£±`,'¤¦','¤¦¤¦') FROM `£Ô£µ`; +SELECT REPLACE(`£Ã£±`,'¤¨','¤¨¤¨') FROM `£Ô£µ`; +SELECT REPLACE(`£Ã£±`,'¤ª','¤ª¤ª') FROM `£Ô£µ`; +SELECT REPLACE(`£Ã£±`,'íÜ','íÜíÜ') FROM `£Ô£¶`; +SELECT REPLACE(`£Ã£±`,'íÝ','íÝíÝ') FROM `£Ô£¶`; +SELECT REPLACE(`£Ã£±`,'íÞ','íÞíÞ') FROM `£Ô£¶`; +SELECT REPLACE(`£Ã£±`,'íß','íßíß') FROM `£Ô£¶`; +SELECT REPLACE(`£Ã£±`,'íà','íàíà') FROM `£Ô£¶`; + +#HEAP +SELECT REPLACE(`£Ã£±`,'ޱ','ޱޱ') FROM `£Ô£·`; +SELECT REPLACE(`£Ã£±`,'޲','޲޲') FROM `£Ô£·`; +SELECT REPLACE(`£Ã£±`,'޳','޳޳') FROM `£Ô£·`; +SELECT REPLACE(`£Ã£±`,'Ž´','Ž´Ž´') FROM `£Ô£·`; +SELECT REPLACE(`£Ã£±`,'޵','޵޵') FROM `£Ô£·`; +SELECT REPLACE(`£Ã£±`,'¤¢','¤¢¤¢') FROM `£Ô£¸`; +SELECT REPLACE(`£Ã£±`,'¤¤','¤¤¤¤') FROM `£Ô£¸`; +SELECT REPLACE(`£Ã£±`,'¤¦','¤¦¤¦') FROM `£Ô£¸`; +SELECT REPLACE(`£Ã£±`,'¤¨','¤¨¤¨') FROM `£Ô£¸`; +SELECT REPLACE(`£Ã£±`,'¤ª','¤ª¤ª') FROM `£Ô£¸`; +SELECT REPLACE(`£Ã£±`,'íÜ','íÜíÜ') FROM `£Ô£¹`; +SELECT REPLACE(`£Ã£±`,'íÝ','íÝíÝ') FROM `£Ô£¹`; +SELECT REPLACE(`£Ã£±`,'íÞ','íÞíÞ') FROM `£Ô£¹`; +SELECT REPLACE(`£Ã£±`,'íß','íßíß') FROM `£Ô£¹`; +SELECT REPLACE(`£Ã£±`,'íà','íàíà') FROM `£Ô£¹`; + +#BDB +SELECT REPLACE(`£Ã£±`,'ޱ','ޱޱ') FROM `£Ô£±£°`; +SELECT REPLACE(`£Ã£±`,'޲','޲޲') FROM `£Ô£±£°`; +SELECT REPLACE(`£Ã£±`,'޳','޳޳') FROM `£Ô£±£°`; +SELECT REPLACE(`£Ã£±`,'Ž´','Ž´Ž´') FROM `£Ô£±£°`; +SELECT REPLACE(`£Ã£±`,'޵','޵޵') FROM `£Ô£±£°`; +SELECT REPLACE(`£Ã£±`,'¤¢','¤¢¤¢') FROM `£Ô£±£±`; +SELECT REPLACE(`£Ã£±`,'¤¤','¤¤¤¤') FROM `£Ô£±£±`; +SELECT REPLACE(`£Ã£±`,'¤¦','¤¦¤¦') FROM `£Ô£±£±`; +SELECT REPLACE(`£Ã£±`,'¤¨','¤¨¤¨') FROM `£Ô£±£±`; +SELECT REPLACE(`£Ã£±`,'¤ª','¤ª¤ª') FROM `£Ô£±£±`; +SELECT REPLACE(`£Ã£±`,'íÜ','íÜíÜ') FROM `£Ô£±£²`; +SELECT REPLACE(`£Ã£±`,'íÝ','íÝíÝ') FROM `£Ô£±£²`; +SELECT REPLACE(`£Ã£±`,'íÞ','íÞíÞ') FROM `£Ô£±£²`; +SELECT REPLACE(`£Ã£±`,'íß','íßíß') FROM `£Ô£±£²`; +SELECT REPLACE(`£Ã£±`,'íà','íàíà') FROM `£Ô£±£²`; + +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/t/jp_replace_ujis.test b/mysql-test/suite/jp/t/jp_replace_ujis.test new file mode 100755 index 00000000000..3d8724e63d5 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_replace_ujis.test @@ -0,0 +1,130 @@ +--source include/have_ujis.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +--enable_warnings + +# +# Test REPLACE() function with Japanese characters in ujis encoding +# + +SET NAMES ujis; +SET character_set_database = ujis; + +CREATE TABLE `£Ô£±` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5)) DEFAULT CHARSET = ujis engine = bdb; + +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'); + +#InnoDB +SELECT REPLACE(`£Ã£±`,'ޱ','ޱޱ') FROM `£Ô£±`; +SELECT REPLACE(`£Ã£±`,'޲','޲޲') FROM `£Ô£±`; +SELECT REPLACE(`£Ã£±`,'޳','޳޳') FROM `£Ô£±`; +SELECT REPLACE(`£Ã£±`,'Ž´','Ž´Ž´') FROM `£Ô£±`; +SELECT REPLACE(`£Ã£±`,'޵','޵޵') FROM `£Ô£±`; +SELECT REPLACE(`£Ã£±`,'¤¢','¤¢¤¢') FROM `£Ô£²`; +SELECT REPLACE(`£Ã£±`,'¤¤','¤¤¤¤') FROM `£Ô£²`; +SELECT REPLACE(`£Ã£±`,'¤¦','¤¦¤¦') FROM `£Ô£²`; +SELECT REPLACE(`£Ã£±`,'¤¨','¤¨¤¨') FROM `£Ô£²`; +SELECT REPLACE(`£Ã£±`,'¤ª','¤ª¤ª') FROM `£Ô£²`; +SELECT REPLACE(`£Ã£±`,'íÜ','íÜíÜ') FROM `£Ô£³`; +SELECT REPLACE(`£Ã£±`,'íÝ','íÝíÝ') FROM `£Ô£³`; +SELECT REPLACE(`£Ã£±`,'íÞ','íÞíÞ') FROM `£Ô£³`; +SELECT REPLACE(`£Ã£±`,'íß','íßíß') FROM `£Ô£³`; +SELECT REPLACE(`£Ã£±`,'íà','íàíà') FROM `£Ô£³`; + +#MyISAM +SELECT REPLACE(`£Ã£±`,'ޱ','ޱޱ') FROM `£Ô£´`; +SELECT REPLACE(`£Ã£±`,'޲','޲޲') FROM `£Ô£´`; +SELECT REPLACE(`£Ã£±`,'޳','޳޳') FROM `£Ô£´`; +SELECT REPLACE(`£Ã£±`,'Ž´','Ž´Ž´') FROM `£Ô£´`; +SELECT REPLACE(`£Ã£±`,'޵','޵޵') FROM `£Ô£´`; +SELECT REPLACE(`£Ã£±`,'¤¢','¤¢¤¢') FROM `£Ô£µ`; +SELECT REPLACE(`£Ã£±`,'¤¤','¤¤¤¤') FROM `£Ô£µ`; +SELECT REPLACE(`£Ã£±`,'¤¦','¤¦¤¦') FROM `£Ô£µ`; +SELECT REPLACE(`£Ã£±`,'¤¨','¤¨¤¨') FROM `£Ô£µ`; +SELECT REPLACE(`£Ã£±`,'¤ª','¤ª¤ª') FROM `£Ô£µ`; +SELECT REPLACE(`£Ã£±`,'íÜ','íÜíÜ') FROM `£Ô£¶`; +SELECT REPLACE(`£Ã£±`,'íÝ','íÝíÝ') FROM `£Ô£¶`; +SELECT REPLACE(`£Ã£±`,'íÞ','íÞíÞ') FROM `£Ô£¶`; +SELECT REPLACE(`£Ã£±`,'íß','íßíß') FROM `£Ô£¶`; +SELECT REPLACE(`£Ã£±`,'íà','íàíà') FROM `£Ô£¶`; + +#HEAP +SELECT REPLACE(`£Ã£±`,'ޱ','ޱޱ') FROM `£Ô£·`; +SELECT REPLACE(`£Ã£±`,'޲','޲޲') FROM `£Ô£·`; +SELECT REPLACE(`£Ã£±`,'޳','޳޳') FROM `£Ô£·`; +SELECT REPLACE(`£Ã£±`,'Ž´','Ž´Ž´') FROM `£Ô£·`; +SELECT REPLACE(`£Ã£±`,'޵','޵޵') FROM `£Ô£·`; +SELECT REPLACE(`£Ã£±`,'¤¢','¤¢¤¢') FROM `£Ô£¸`; +SELECT REPLACE(`£Ã£±`,'¤¤','¤¤¤¤') FROM `£Ô£¸`; +SELECT REPLACE(`£Ã£±`,'¤¦','¤¦¤¦') FROM `£Ô£¸`; +SELECT REPLACE(`£Ã£±`,'¤¨','¤¨¤¨') FROM `£Ô£¸`; +SELECT REPLACE(`£Ã£±`,'¤ª','¤ª¤ª') FROM `£Ô£¸`; +SELECT REPLACE(`£Ã£±`,'íÜ','íÜíÜ') FROM `£Ô£¹`; +SELECT REPLACE(`£Ã£±`,'íÝ','íÝíÝ') FROM `£Ô£¹`; +SELECT REPLACE(`£Ã£±`,'íÞ','íÞíÞ') FROM `£Ô£¹`; +SELECT REPLACE(`£Ã£±`,'íß','íßíß') FROM `£Ô£¹`; +SELECT REPLACE(`£Ã£±`,'íà','íàíà') FROM `£Ô£¹`; + +#BDB +SELECT REPLACE(`£Ã£±`,'ޱ','ޱޱ') FROM `£Ô£±£°`; +SELECT REPLACE(`£Ã£±`,'޲','޲޲') FROM `£Ô£±£°`; +SELECT REPLACE(`£Ã£±`,'޳','޳޳') FROM `£Ô£±£°`; +SELECT REPLACE(`£Ã£±`,'Ž´','Ž´Ž´') FROM `£Ô£±£°`; +SELECT REPLACE(`£Ã£±`,'޵','޵޵') FROM `£Ô£±£°`; +SELECT REPLACE(`£Ã£±`,'¤¢','¤¢¤¢') FROM `£Ô£±£±`; +SELECT REPLACE(`£Ã£±`,'¤¤','¤¤¤¤') FROM `£Ô£±£±`; +SELECT REPLACE(`£Ã£±`,'¤¦','¤¦¤¦') FROM `£Ô£±£±`; +SELECT REPLACE(`£Ã£±`,'¤¨','¤¨¤¨') FROM `£Ô£±£±`; +SELECT REPLACE(`£Ã£±`,'¤ª','¤ª¤ª') FROM `£Ô£±£±`; +SELECT REPLACE(`£Ã£±`,'íÜ','íÜíÜ') FROM `£Ô£±£²`; +SELECT REPLACE(`£Ã£±`,'íÝ','íÝíÝ') FROM `£Ô£±£²`; +SELECT REPLACE(`£Ã£±`,'íÞ','íÞíÞ') FROM `£Ô£±£²`; +SELECT REPLACE(`£Ã£±`,'íß','íßíß') FROM `£Ô£±£²`; +SELECT REPLACE(`£Ã£±`,'íà','íàíà') FROM `£Ô£±£²`; + +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/t/jp_replace_utf8.test b/mysql-test/suite/jp/t/jp_replace_utf8.test new file mode 100755 index 00000000000..1d89a43648b --- /dev/null +++ b/mysql-test/suite/jp/t/jp_replace_utf8.test @@ -0,0 +1,128 @@ +--disable_warnings +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +drop table if exists `T11`; +drop table if exists `T12`; +--enable_warnings + +# +# Test REPLACE() function with Japanese characters in utf8 encoding +# + +SET NAMES utf8; +SET character_set_database = utf8; + +CREATE TABLE `T1` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T11` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T12` (`C1` char(5)) DEFAULT CHARSET = utf8 engine = bdb; + +INSERT INTO `T1` VALUES ('アイウエオ'); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T3` VALUES ('龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオ'); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオ'); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡'); +INSERT INTO `T1ï¼` VALUES ('アイウエオ'); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T12` VALUES ('龔龖龗龞龡'); + +#InnoDB +SELECT REPLACE(`C1`,'ï½±','アア') FROM `T1`; +SELECT REPLACE(`C1`,'ï½²','イイ') FROM `T1`; +SELECT REPLACE(`C1`,'ï½³','ウウ') FROM `T1`; +SELECT REPLACE(`C1`,'ï½´','ï½´ï½´') FROM `T1`; +SELECT REPLACE(`C1`,'ï½µ','オオ') FROM `T1`; +SELECT REPLACE(`C1`,'ã‚','ã‚ã‚') FROM `ï¼´ï¼’`; +SELECT REPLACE(`C1`,'ã„','ã„ã„') FROM `ï¼´ï¼’`; +SELECT REPLACE(`C1`,'ã†','ã†ã†') FROM `ï¼´ï¼’`; +SELECT REPLACE(`C1`,'ãˆ','ãˆãˆ') FROM `ï¼´ï¼’`; +SELECT REPLACE(`C1`,'ãŠ','ãŠãŠ') FROM `ï¼´ï¼’`; +SELECT REPLACE(`C1`,'é¾”','龔龔') FROM `T3`; +SELECT REPLACE(`C1`,'é¾–','é¾–é¾–') FROM `T3`; +SELECT REPLACE(`C1`,'é¾—','é¾—é¾—') FROM `T3`; +SELECT REPLACE(`C1`,'龞','龞龞') FROM `T3`; +SELECT REPLACE(`C1`,'龡','龡龡') FROM `T3`; + +#MyISAM +SELECT REPLACE(`C1`,'ï½±','アア') FROM `ï¼´ï¼”`; +SELECT REPLACE(`C1`,'ï½²','イイ') FROM `ï¼´ï¼”`; +SELECT REPLACE(`C1`,'ï½³','ウウ') FROM `ï¼´ï¼”`; +SELECT REPLACE(`C1`,'ï½´','ï½´ï½´') FROM `ï¼´ï¼”`; +SELECT REPLACE(`C1`,'ï½µ','オオ') FROM `ï¼´ï¼”`; +SELECT REPLACE(`C1`,'ã‚','ã‚ã‚') FROM `T5`; +SELECT REPLACE(`C1`,'ã„','ã„ã„') FROM `T5`; +SELECT REPLACE(`C1`,'ã†','ã†ã†') FROM `T5`; +SELECT REPLACE(`C1`,'ãˆ','ãˆãˆ') FROM `T5`; +SELECT REPLACE(`C1`,'ãŠ','ãŠãŠ') FROM `T5`; +SELECT REPLACE(`C1`,'é¾”','龔龔') FROM `ï¼´ï¼–`; +SELECT REPLACE(`C1`,'é¾–','é¾–é¾–') FROM `ï¼´ï¼–`; +SELECT REPLACE(`C1`,'é¾—','é¾—é¾—') FROM `ï¼´ï¼–`; +SELECT REPLACE(`C1`,'龞','龞龞') FROM `ï¼´ï¼–`; +SELECT REPLACE(`C1`,'龡','龡龡') FROM `ï¼´ï¼–`; + +#HEAP +SELECT REPLACE(`C1`,'ï½±','アア') FROM `ï¼´ï¼—`; +SELECT REPLACE(`C1`,'ï½²','イイ') FROM `ï¼´ï¼—`; +SELECT REPLACE(`C1`,'ï½³','ウウ') FROM `ï¼´ï¼—`; +SELECT REPLACE(`C1`,'ï½´','ï½´ï½´') FROM `ï¼´ï¼—`; +SELECT REPLACE(`C1`,'ï½µ','オオ') FROM `ï¼´ï¼—`; +SELECT REPLACE(`C1`,'ã‚','ã‚ã‚') FROM `T8`; +SELECT REPLACE(`C1`,'ã„','ã„ã„') FROM `T8`; +SELECT REPLACE(`C1`,'ã†','ã†ã†') FROM `T8`; +SELECT REPLACE(`C1`,'ãˆ','ãˆãˆ') FROM `T8`; +SELECT REPLACE(`C1`,'ãŠ','ãŠãŠ') FROM `T8`; +SELECT REPLACE(`C1`,'é¾”','龔龔') FROM `ï¼´ï¼™`; +SELECT REPLACE(`C1`,'é¾–','é¾–é¾–') FROM `ï¼´ï¼™`; +SELECT REPLACE(`C1`,'é¾—','é¾—é¾—') FROM `ï¼´ï¼™`; +SELECT REPLACE(`C1`,'龞','龞龞') FROM `ï¼´ï¼™`; +SELECT REPLACE(`C1`,'龡','龡龡') FROM `ï¼´ï¼™`; + +#BDB +SELECT REPLACE(`C1`,'ï½±','アア') FROM `T1ï¼`; +SELECT REPLACE(`C1`,'ï½²','イイ') FROM `T1ï¼`; +SELECT REPLACE(`C1`,'ï½³','ウウ') FROM `T1ï¼`; +SELECT REPLACE(`C1`,'ï½´','ï½´ï½´') FROM `T1ï¼`; +SELECT REPLACE(`C1`,'ï½µ','オオ') FROM `T1ï¼`; +SELECT REPLACE(`C1`,'ã‚','ã‚ã‚') FROM `T11`; +SELECT REPLACE(`C1`,'ã„','ã„ã„') FROM `T11`; +SELECT REPLACE(`C1`,'ã†','ã†ã†') FROM `T11`; +SELECT REPLACE(`C1`,'ãˆ','ãˆãˆ') FROM `T11`; +SELECT REPLACE(`C1`,'ãŠ','ãŠãŠ') FROM `T11`; +SELECT REPLACE(`C1`,'é¾”','龔龔') FROM `T12`; +SELECT REPLACE(`C1`,'é¾–','é¾–é¾–') FROM `T12`; +SELECT REPLACE(`C1`,'é¾—','é¾—é¾—') FROM `T12`; +SELECT REPLACE(`C1`,'龞','龞龞') FROM `T12`; +SELECT REPLACE(`C1`,'龡','龡龡') FROM `T12`; + +DROP TABLE `T1`; +DROP TABLE `ï¼´ï¼’`; +DROP TABLE `T3`; +DROP TABLE `ï¼´ï¼”`; +DROP TABLE `T5`; +DROP TABLE `ï¼´ï¼–`; +DROP TABLE `ï¼´ï¼—`; +DROP TABLE `T8`; +DROP TABLE `ï¼´ï¼™`; +DROP TABLE `T1ï¼`; +DROP TABLE `T11`; +DROP TABLE `T12`; diff --git a/mysql-test/suite/jp/t/jp_reverse_sjis.test b/mysql-test/suite/jp/t/jp_reverse_sjis.test new file mode 100755 index 00000000000..c1e2b2a17ca --- /dev/null +++ b/mysql-test/suite/jp/t/jp_reverse_sjis.test @@ -0,0 +1,81 @@ +--character_set sjis +--disable_warnings +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +drop table if exists `‚s‚P‚P`; +drop table if exists `‚s‚P‚Q`; +--enable_warnings + +# +# Test REVERSE() function with Japanese characters in sjis encoding +# + +SET NAMES sjis; +SET character_set_database = sjis; + +CREATE TABLE `‚s‚P` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Q` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚R` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚S` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚T` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚U` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚V` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚W` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚X` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚O` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚P` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚Q` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; + +INSERT INTO `‚s‚P` VALUES ('±²³´µ'); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚S` VALUES ('±²³´µ'); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚V` VALUES ('±²³´µ'); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ'); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\'); + +#InnoDB +SELECT REVERSE(`‚b‚P`) FROM `‚s‚P`; +SELECT REVERSE(`‚b‚P`) FROM `‚s‚Q`; +SELECT REVERSE(`‚b‚P`) FROM `‚s‚R`; + +#MyISAM +SELECT REVERSE(`‚b‚P`) FROM `‚s‚S`; +SELECT REVERSE(`‚b‚P`) FROM `‚s‚T`; +SELECT REVERSE(`‚b‚P`) FROM `‚s‚U`; + +#HEAP +SELECT REVERSE(`‚b‚P`) FROM `‚s‚V`; +SELECT REVERSE(`‚b‚P`) FROM `‚s‚W`; +SELECT REVERSE(`‚b‚P`) FROM `‚s‚X`; + +#BDB +SELECT REVERSE(`‚b‚P`) FROM `‚s‚P‚O`; +SELECT REVERSE(`‚b‚P`) FROM `‚s‚P‚P`; +SELECT REVERSE(`‚b‚P`) FROM `‚s‚P‚Q`; + +DROP TABLE `‚s‚P`; +DROP TABLE `‚s‚Q`; +DROP TABLE `‚s‚R`; +DROP TABLE `‚s‚S`; +DROP TABLE `‚s‚T`; +DROP TABLE `‚s‚U`; +DROP TABLE `‚s‚V`; +DROP TABLE `‚s‚W`; +DROP TABLE `‚s‚X`; +DROP TABLE `‚s‚P‚O`; +DROP TABLE `‚s‚P‚P`; +DROP TABLE `‚s‚P‚Q`; diff --git a/mysql-test/suite/jp/t/jp_reverse_ucs2.test b/mysql-test/suite/jp/t/jp_reverse_ucs2.test new file mode 100755 index 00000000000..d91ec7f70e8 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_reverse_ucs2.test @@ -0,0 +1,83 @@ +--source include/have_ucs2.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +--enable_warnings + +# +# Test REVERSE() function with Japanese characters in ucs2 encoding +# + +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; + +CREATE TABLE `£Ô£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; + +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'); + +#InnoDB +SELECT REVERSE(`£Ã£±`) FROM `£Ô£±`; +SELECT REVERSE(`£Ã£±`) FROM `£Ô£²`; +SELECT REVERSE(`£Ã£±`) FROM `£Ô£³`; + +#MyISAM +SELECT REVERSE(`£Ã£±`) FROM `£Ô£´`; +SELECT REVERSE(`£Ã£±`) FROM `£Ô£µ`; +SELECT REVERSE(`£Ã£±`) FROM `£Ô£¶`; + +#HEAP +SELECT REVERSE(`£Ã£±`) FROM `£Ô£·`; +SELECT REVERSE(`£Ã£±`) FROM `£Ô£¸`; +SELECT REVERSE(`£Ã£±`) FROM `£Ô£¹`; + +#BDB +SELECT REVERSE(`£Ã£±`) FROM `£Ô£±£°`; +SELECT REVERSE(`£Ã£±`) FROM `£Ô£±£±`; +SELECT REVERSE(`£Ã£±`) FROM `£Ô£±£²`; + +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/t/jp_reverse_ujis.test b/mysql-test/suite/jp/t/jp_reverse_ujis.test new file mode 100755 index 00000000000..d37d363f59a --- /dev/null +++ b/mysql-test/suite/jp/t/jp_reverse_ujis.test @@ -0,0 +1,82 @@ +--source include/have_ujis.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +--enable_warnings + +# +# Test REVERSE() function with Japanese characters in ujis encoding +# + +SET NAMES ujis; +SET character_set_database = ujis; + +CREATE TABLE `£Ô£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; + +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'); + +#InnoDB +SELECT REVERSE(`£Ã£±`) FROM `£Ô£±`; +SELECT REVERSE(`£Ã£±`) FROM `£Ô£²`; +SELECT REVERSE(`£Ã£±`) FROM `£Ô£³`; + +#MyISAM +SELECT REVERSE(`£Ã£±`) FROM `£Ô£´`; +SELECT REVERSE(`£Ã£±`) FROM `£Ô£µ`; +SELECT REVERSE(`£Ã£±`) FROM `£Ô£¶`; + +#HEAP +SELECT REVERSE(`£Ã£±`) FROM `£Ô£·`; +SELECT REVERSE(`£Ã£±`) FROM `£Ô£¸`; +SELECT REVERSE(`£Ã£±`) FROM `£Ô£¹`; + +#BDB +SELECT REVERSE(`£Ã£±`) FROM `£Ô£±£°`; +SELECT REVERSE(`£Ã£±`) FROM `£Ô£±£±`; +SELECT REVERSE(`£Ã£±`) FROM `£Ô£±£²`; + +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/t/jp_reverse_utf8.test b/mysql-test/suite/jp/t/jp_reverse_utf8.test new file mode 100755 index 00000000000..4e53d4be049 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_reverse_utf8.test @@ -0,0 +1,80 @@ +--disable_warnings +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +drop table if exists `T11`; +drop table if exists `T12`; +--enable_warnings + +# +# Test REVERSE() function with Japanese characters in utf8 encoding +# + +SET NAMES utf8; +SET character_set_database = utf8; + +CREATE TABLE `T1` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T11` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T12` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; + +INSERT INTO `T1` VALUES ('アイウエオ'); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T3` VALUES ('龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオ'); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオ'); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡'); +INSERT INTO `T1ï¼` VALUES ('アイウエオ'); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T12` VALUES ('龔龖龗龞龡'); + +#InnoDB +SELECT REVERSE(`C1`) FROM `T1`; +SELECT REVERSE(`C1`) FROM `ï¼´ï¼’`; +SELECT REVERSE(`C1`) FROM `T3`; + +#MyISAM +SELECT REVERSE(`C1`) FROM `ï¼´ï¼”`; +SELECT REVERSE(`C1`) FROM `T5`; +SELECT REVERSE(`C1`) FROM `ï¼´ï¼–`; + +#HEAP +SELECT REVERSE(`C1`) FROM `ï¼´ï¼—`; +SELECT REVERSE(`C1`) FROM `T8`; +SELECT REVERSE(`C1`) FROM `ï¼´ï¼™`; + +#BDB +SELECT REVERSE(`C1`) FROM `T1ï¼`; +SELECT REVERSE(`C1`) FROM `T11`; +SELECT REVERSE(`C1`) FROM `T12`; + +DROP TABLE `T1`; +DROP TABLE `ï¼´ï¼’`; +DROP TABLE `T3`; +DROP TABLE `ï¼´ï¼”`; +DROP TABLE `T5`; +DROP TABLE `ï¼´ï¼–`; +DROP TABLE `ï¼´ï¼—`; +DROP TABLE `T8`; +DROP TABLE `ï¼´ï¼™`; +DROP TABLE `T1ï¼`; +DROP TABLE `T11`; +DROP TABLE `T12`; diff --git a/mysql-test/suite/jp/t/jp_right_sjis.test b/mysql-test/suite/jp/t/jp_right_sjis.test new file mode 100755 index 00000000000..f481ec532ec --- /dev/null +++ b/mysql-test/suite/jp/t/jp_right_sjis.test @@ -0,0 +1,141 @@ +--character_set sjis +--disable_warnings +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +drop table if exists `‚s‚P‚P`; +drop table if exists `‚s‚P‚Q`; +--enable_warnings + +# +# Test RIGHT() function with Japanese character in sjis encoding +# + +SET NAMES sjis; +SET character_set_database = sjis; + +CREATE TABLE `‚s‚P` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Q` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚R` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚S` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚T` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚U` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚V` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚W` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚X` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚O` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚P` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚Q` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; + +INSERT INTO `‚s‚P` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +INSERT INTO `‚s‚S` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +INSERT INTO `‚s‚V` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); + +#InnoDB +SELECT `‚b‚P`, RIGHT(`‚b‚P`,0) FROM `‚s‚P`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,1) FROM `‚s‚P`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,2) FROM `‚s‚P`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,3) FROM `‚s‚P`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,4) FROM `‚s‚P`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,5) FROM `‚s‚P`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,0) FROM `‚s‚Q`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,1) FROM `‚s‚Q`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,2) FROM `‚s‚Q`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,3) FROM `‚s‚Q`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,4) FROM `‚s‚Q`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,5) FROM `‚s‚Q`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,0) FROM `‚s‚R`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,1) FROM `‚s‚R`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,2) FROM `‚s‚R`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,3) FROM `‚s‚R`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,4) FROM `‚s‚R`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,5) FROM `‚s‚R`; + +#MyISAM +SELECT `‚b‚P`, RIGHT(`‚b‚P`,0) FROM `‚s‚S`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,1) FROM `‚s‚S`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,2) FROM `‚s‚S`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,3) FROM `‚s‚S`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,4) FROM `‚s‚S`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,5) FROM `‚s‚S`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,0) FROM `‚s‚T`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,1) FROM `‚s‚T`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,2) FROM `‚s‚T`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,3) FROM `‚s‚T`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,4) FROM `‚s‚T`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,5) FROM `‚s‚T`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,0) FROM `‚s‚U`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,1) FROM `‚s‚U`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,2) FROM `‚s‚U`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,3) FROM `‚s‚U`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,4) FROM `‚s‚U`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,5) FROM `‚s‚U`; + +#HEAP +SELECT `‚b‚P`, RIGHT(`‚b‚P`,0) FROM `‚s‚V`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,1) FROM `‚s‚V`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,2) FROM `‚s‚V`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,3) FROM `‚s‚V`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,4) FROM `‚s‚V`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,5) FROM `‚s‚V`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,0) FROM `‚s‚W`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,1) FROM `‚s‚W`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,2) FROM `‚s‚W`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,3) FROM `‚s‚W`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,4) FROM `‚s‚W`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,5) FROM `‚s‚W`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,0) FROM `‚s‚X`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,1) FROM `‚s‚X`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,2) FROM `‚s‚X`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,3) FROM `‚s‚X`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,4) FROM `‚s‚X`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,5) FROM `‚s‚X`; + +#BDB +SELECT `‚b‚P`, RIGHT(`‚b‚P`,0) FROM `‚s‚P‚O`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,1) FROM `‚s‚P‚O`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,2) FROM `‚s‚P‚O`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,3) FROM `‚s‚P‚O`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,4) FROM `‚s‚P‚O`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,5) FROM `‚s‚P‚O`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,0) FROM `‚s‚P‚P`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,1) FROM `‚s‚P‚P`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,2) FROM `‚s‚P‚P`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,3) FROM `‚s‚P‚P`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,4) FROM `‚s‚P‚P`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,5) FROM `‚s‚P‚P`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,0) FROM `‚s‚P‚Q`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,1) FROM `‚s‚P‚Q`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,2) FROM `‚s‚P‚Q`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,3) FROM `‚s‚P‚Q`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,4) FROM `‚s‚P‚Q`; +SELECT `‚b‚P`, RIGHT(`‚b‚P`,5) FROM `‚s‚P‚Q`; + +DROP TABLE `‚s‚P`; +DROP TABLE `‚s‚Q`; +DROP TABLE `‚s‚R`; +DROP TABLE `‚s‚S`; +DROP TABLE `‚s‚T`; +DROP TABLE `‚s‚U`; +DROP TABLE `‚s‚V`; +DROP TABLE `‚s‚W`; +DROP TABLE `‚s‚X`; +DROP TABLE `‚s‚P‚O`; +DROP TABLE `‚s‚P‚P`; +DROP TABLE `‚s‚P‚Q`; diff --git a/mysql-test/suite/jp/t/jp_right_ucs2.test b/mysql-test/suite/jp/t/jp_right_ucs2.test new file mode 100755 index 00000000000..23ca2fa4fae --- /dev/null +++ b/mysql-test/suite/jp/t/jp_right_ucs2.test @@ -0,0 +1,143 @@ +--source include/have_ucs2.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +--enable_warnings + +# +# Test RIGHT() function with Japanese character in ucs2 encoding +# + +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; + +CREATE TABLE `£Ô£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; + +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); + +#InnoDB +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£±`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£±`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£±`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£±`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£±`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£±`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£²`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£²`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£²`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£²`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£²`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£²`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£³`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£³`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£³`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£³`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£³`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£³`; + +#MyISAM +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£´`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£´`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£´`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£´`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£´`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£´`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£µ`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£µ`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£µ`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£µ`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£µ`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£µ`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£¶`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£¶`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£¶`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£¶`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£¶`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£¶`; + +#HEAP +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£·`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£·`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£·`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£·`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£·`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£·`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£¸`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£¸`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£¸`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£¸`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£¸`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£¸`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£¹`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£¹`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£¹`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£¹`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£¹`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£¹`; + +#BDB +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£±£°`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£±£°`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£±£°`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£±£°`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£±£°`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£±£°`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£±£±`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£±£±`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£±£±`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£±£±`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£±£±`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£±£±`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£±£²`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£±£²`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£±£²`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£±£²`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£±£²`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£±£²`; + +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/t/jp_right_ujis.test b/mysql-test/suite/jp/t/jp_right_ujis.test new file mode 100755 index 00000000000..b5284489c7e --- /dev/null +++ b/mysql-test/suite/jp/t/jp_right_ujis.test @@ -0,0 +1,142 @@ +--source include/have_ujis.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +--enable_warnings + +# +# Test RIGHT() function with Japanese character in ujis encoding +# + +SET NAMES ujis; +SET character_set_database = ujis; + +CREATE TABLE `£Ô£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; + +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); + +#InnoDB +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£±`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£±`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£±`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£±`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£±`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£±`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£²`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£²`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£²`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£²`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£²`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£²`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£³`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£³`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£³`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£³`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£³`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£³`; + +#MyISAM +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£´`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£´`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£´`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£´`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£´`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£´`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£µ`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£µ`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£µ`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£µ`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£µ`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£µ`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£¶`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£¶`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£¶`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£¶`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£¶`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£¶`; + +#HEAP +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£·`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£·`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£·`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£·`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£·`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£·`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£¸`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£¸`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£¸`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£¸`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£¸`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£¸`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£¹`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£¹`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£¹`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£¹`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£¹`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£¹`; + +#BDB +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£±£°`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£±£°`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£±£°`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£±£°`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£±£°`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£±£°`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£±£±`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£±£±`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£±£±`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£±£±`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£±£±`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£±£±`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,0) FROM `£Ô£±£²`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,1) FROM `£Ô£±£²`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,2) FROM `£Ô£±£²`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,3) FROM `£Ô£±£²`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,4) FROM `£Ô£±£²`; +SELECT `£Ã£±`, RIGHT(`£Ã£±`,5) FROM `£Ô£±£²`; + +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/t/jp_right_utf8.test b/mysql-test/suite/jp/t/jp_right_utf8.test new file mode 100755 index 00000000000..863755c1dcf --- /dev/null +++ b/mysql-test/suite/jp/t/jp_right_utf8.test @@ -0,0 +1,140 @@ +--disable_warnings +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +drop table if exists `T11`; +drop table if exists `T12`; +--enable_warnings + +# +# Test RIGHT() function with Japanese character in utf8 encoding +# + +SET NAMES utf8; +SET character_set_database = utf8; + +CREATE TABLE `T1` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T11` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T12` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; + +INSERT INTO `T1` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `T3` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +INSERT INTO `T1ï¼` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `T12` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); + +#InnoDB +SELECT `C1`, RIGHT(`C1`,0) FROM `T1`; +SELECT `C1`, RIGHT(`C1`,1) FROM `T1`; +SELECT `C1`, RIGHT(`C1`,2) FROM `T1`; +SELECT `C1`, RIGHT(`C1`,3) FROM `T1`; +SELECT `C1`, RIGHT(`C1`,4) FROM `T1`; +SELECT `C1`, RIGHT(`C1`,5) FROM `T1`; +SELECT `C1`, RIGHT(`C1`,0) FROM `ï¼´ï¼’`; +SELECT `C1`, RIGHT(`C1`,1) FROM `ï¼´ï¼’`; +SELECT `C1`, RIGHT(`C1`,2) FROM `ï¼´ï¼’`; +SELECT `C1`, RIGHT(`C1`,3) FROM `ï¼´ï¼’`; +SELECT `C1`, RIGHT(`C1`,4) FROM `ï¼´ï¼’`; +SELECT `C1`, RIGHT(`C1`,5) FROM `ï¼´ï¼’`; +SELECT `C1`, RIGHT(`C1`,0) FROM `T3`; +SELECT `C1`, RIGHT(`C1`,1) FROM `T3`; +SELECT `C1`, RIGHT(`C1`,2) FROM `T3`; +SELECT `C1`, RIGHT(`C1`,3) FROM `T3`; +SELECT `C1`, RIGHT(`C1`,4) FROM `T3`; +SELECT `C1`, RIGHT(`C1`,5) FROM `T3`; + +#MyISAM +SELECT `C1`, RIGHT(`C1`,0) FROM `ï¼´ï¼”`; +SELECT `C1`, RIGHT(`C1`,1) FROM `ï¼´ï¼”`; +SELECT `C1`, RIGHT(`C1`,2) FROM `ï¼´ï¼”`; +SELECT `C1`, RIGHT(`C1`,3) FROM `ï¼´ï¼”`; +SELECT `C1`, RIGHT(`C1`,4) FROM `ï¼´ï¼”`; +SELECT `C1`, RIGHT(`C1`,5) FROM `ï¼´ï¼”`; +SELECT `C1`, RIGHT(`C1`,0) FROM `T5`; +SELECT `C1`, RIGHT(`C1`,1) FROM `T5`; +SELECT `C1`, RIGHT(`C1`,2) FROM `T5`; +SELECT `C1`, RIGHT(`C1`,3) FROM `T5`; +SELECT `C1`, RIGHT(`C1`,4) FROM `T5`; +SELECT `C1`, RIGHT(`C1`,5) FROM `T5`; +SELECT `C1`, RIGHT(`C1`,0) FROM `ï¼´ï¼–`; +SELECT `C1`, RIGHT(`C1`,1) FROM `ï¼´ï¼–`; +SELECT `C1`, RIGHT(`C1`,2) FROM `ï¼´ï¼–`; +SELECT `C1`, RIGHT(`C1`,3) FROM `ï¼´ï¼–`; +SELECT `C1`, RIGHT(`C1`,4) FROM `ï¼´ï¼–`; +SELECT `C1`, RIGHT(`C1`,5) FROM `ï¼´ï¼–`; + +#HEAP +SELECT `C1`, RIGHT(`C1`,0) FROM `ï¼´ï¼—`; +SELECT `C1`, RIGHT(`C1`,1) FROM `ï¼´ï¼—`; +SELECT `C1`, RIGHT(`C1`,2) FROM `ï¼´ï¼—`; +SELECT `C1`, RIGHT(`C1`,3) FROM `ï¼´ï¼—`; +SELECT `C1`, RIGHT(`C1`,4) FROM `ï¼´ï¼—`; +SELECT `C1`, RIGHT(`C1`,5) FROM `ï¼´ï¼—`; +SELECT `C1`, RIGHT(`C1`,0) FROM `T8`; +SELECT `C1`, RIGHT(`C1`,1) FROM `T8`; +SELECT `C1`, RIGHT(`C1`,2) FROM `T8`; +SELECT `C1`, RIGHT(`C1`,3) FROM `T8`; +SELECT `C1`, RIGHT(`C1`,4) FROM `T8`; +SELECT `C1`, RIGHT(`C1`,5) FROM `T8`; +SELECT `C1`, RIGHT(`C1`,0) FROM `ï¼´ï¼™`; +SELECT `C1`, RIGHT(`C1`,1) FROM `ï¼´ï¼™`; +SELECT `C1`, RIGHT(`C1`,2) FROM `ï¼´ï¼™`; +SELECT `C1`, RIGHT(`C1`,3) FROM `ï¼´ï¼™`; +SELECT `C1`, RIGHT(`C1`,4) FROM `ï¼´ï¼™`; +SELECT `C1`, RIGHT(`C1`,5) FROM `ï¼´ï¼™`; + +#BDB +SELECT `C1`, RIGHT(`C1`,0) FROM `T1ï¼`; +SELECT `C1`, RIGHT(`C1`,1) FROM `T1ï¼`; +SELECT `C1`, RIGHT(`C1`,2) FROM `T1ï¼`; +SELECT `C1`, RIGHT(`C1`,3) FROM `T1ï¼`; +SELECT `C1`, RIGHT(`C1`,4) FROM `T1ï¼`; +SELECT `C1`, RIGHT(`C1`,5) FROM `T1ï¼`; +SELECT `C1`, RIGHT(`C1`,0) FROM `T11`; +SELECT `C1`, RIGHT(`C1`,1) FROM `T11`; +SELECT `C1`, RIGHT(`C1`,2) FROM `T11`; +SELECT `C1`, RIGHT(`C1`,3) FROM `T11`; +SELECT `C1`, RIGHT(`C1`,4) FROM `T11`; +SELECT `C1`, RIGHT(`C1`,5) FROM `T11`; +SELECT `C1`, RIGHT(`C1`,0) FROM `T12`; +SELECT `C1`, RIGHT(`C1`,1) FROM `T12`; +SELECT `C1`, RIGHT(`C1`,2) FROM `T12`; +SELECT `C1`, RIGHT(`C1`,3) FROM `T12`; +SELECT `C1`, RIGHT(`C1`,4) FROM `T12`; +SELECT `C1`, RIGHT(`C1`,5) FROM `T12`; + +DROP TABLE `T1`; +DROP TABLE `ï¼´ï¼’`; +DROP TABLE `T3`; +DROP TABLE `ï¼´ï¼”`; +DROP TABLE `T5`; +DROP TABLE `ï¼´ï¼–`; +DROP TABLE `ï¼´ï¼—`; +DROP TABLE `T8`; +DROP TABLE `ï¼´ï¼™`; +DROP TABLE `T1ï¼`; +DROP TABLE `T11`; +DROP TABLE `T12`; diff --git a/mysql-test/suite/jp/t/jp_rpad_sjis.test b/mysql-test/suite/jp/t/jp_rpad_sjis.test new file mode 100755 index 00000000000..cc008631548 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_rpad_sjis.test @@ -0,0 +1,81 @@ +--character_set sjis +--disable_warnings +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +drop table if exists `‚s‚P‚P`; +drop table if exists `‚s‚P‚Q`; +--enable_warnings + +# +# Test RPAD() function with Japanese character in sjis encoding +# + +SET NAMES sjis; +SET character_set_database = sjis; + +CREATE TABLE `‚s‚P` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Q` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚R` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚S` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚T` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚U` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚V` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚W` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚X` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚O` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚P` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚Q` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; + +INSERT INTO `‚s‚P` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +INSERT INTO `‚s‚S` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +INSERT INTO `‚s‚V` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); + +#InnoDB +SELECT `‚b‚P`, RPAD(`‚b‚P`,5,'¡') FROM `‚s‚P`; +SELECT `‚b‚P`, RPAD(`‚b‚P`,5,'‚w') FROM `‚s‚Q`; +SELECT `‚b‚P`, RPAD(`‚b‚P`,5,'–\') FROM `‚s‚R`; + +#MyISAM +SELECT `‚b‚P`, RPAD(`‚b‚P`,5,'¡') FROM `‚s‚S`; +SELECT `‚b‚P`, RPAD(`‚b‚P`,5,'‚w') FROM `‚s‚T`; +SELECT `‚b‚P`, RPAD(`‚b‚P`,5,'–\' ) FROM `‚s‚U`; + +#HEAP +SELECT `‚b‚P`, RPAD(`‚b‚P`,5,'¡') FROM `‚s‚V`; +SELECT `‚b‚P`, RPAD(`‚b‚P`,5,'‚w') FROM `‚s‚W`; +SELECT `‚b‚P`, RPAD(`‚b‚P`,5,'–\' ) FROM `‚s‚X`; + +#BDB +SELECT `‚b‚P`, RPAD(`‚b‚P`,5,'¡') FROM `‚s‚P‚O`; +SELECT `‚b‚P`, RPAD(`‚b‚P`,5,'‚w') FROM `‚s‚P‚P`; +SELECT `‚b‚P`, RPAD(`‚b‚P`,5,'–\' ) FROM `‚s‚P‚Q`; + +DROP TABLE `‚s‚P`; +DROP TABLE `‚s‚Q`; +DROP TABLE `‚s‚R`; +DROP TABLE `‚s‚S`; +DROP TABLE `‚s‚T`; +DROP TABLE `‚s‚U`; +DROP TABLE `‚s‚V`; +DROP TABLE `‚s‚W`; +DROP TABLE `‚s‚X`; +DROP TABLE `‚s‚P‚O`; +DROP TABLE `‚s‚P‚P`; +DROP TABLE `‚s‚P‚Q`; diff --git a/mysql-test/suite/jp/t/jp_rpad_ucs2.test b/mysql-test/suite/jp/t/jp_rpad_ucs2.test new file mode 100755 index 00000000000..ca5059497d3 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_rpad_ucs2.test @@ -0,0 +1,83 @@ +--source include/have_ucs2.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +--enable_warnings + +# +# Test RPAD() function with Japanese character in ucs2 encoding +# + +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; + +CREATE TABLE `£Ô£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; + +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); + +#InnoDB +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'Ž¡') FROM `£Ô£±`; +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'£Ø') FROM `£Ô£²`; +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'°¢') FROM `£Ô£³`; + +#MyISAM +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'Ž¡') FROM `£Ô£´`; +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'£Ø') FROM `£Ô£µ`; +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'°¢' ) FROM `£Ô£¶`; + +#HEAP +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'Ž¡') FROM `£Ô£·`; +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'£Ø') FROM `£Ô£¸`; +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'°¢' ) FROM `£Ô£¹`; + +#BDB +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'Ž¡') FROM `£Ô£±£°`; +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'£Ø') FROM `£Ô£±£±`; +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'°¢' ) FROM `£Ô£±£²`; + +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/t/jp_rpad_ujis.test b/mysql-test/suite/jp/t/jp_rpad_ujis.test new file mode 100755 index 00000000000..d7725b80af7 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_rpad_ujis.test @@ -0,0 +1,82 @@ +--source include/have_ujis.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +--enable_warnings + +# +# Test RPAD() function with Japanese character in ujis encoding +# + +SET NAMES ujis; +SET character_set_database = ujis; + +CREATE TABLE `£Ô£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; + +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); + +#InnoDB +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'Ž¡') FROM `£Ô£±`; +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'£Ø') FROM `£Ô£²`; +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'°¢') FROM `£Ô£³`; + +#MyISAM +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'Ž¡') FROM `£Ô£´`; +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'£Ø') FROM `£Ô£µ`; +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'°¢' ) FROM `£Ô£¶`; + +#HEAP +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'Ž¡') FROM `£Ô£·`; +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'£Ø') FROM `£Ô£¸`; +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'°¢' ) FROM `£Ô£¹`; + +#BDB +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'Ž¡') FROM `£Ô£±£°`; +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'£Ø') FROM `£Ô£±£±`; +SELECT `£Ã£±`, RPAD(`£Ã£±`,5,'°¢' ) FROM `£Ô£±£²`; + +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/t/jp_rpad_utf8.test b/mysql-test/suite/jp/t/jp_rpad_utf8.test new file mode 100755 index 00000000000..b5a335bc6ce --- /dev/null +++ b/mysql-test/suite/jp/t/jp_rpad_utf8.test @@ -0,0 +1,80 @@ +--disable_warnings +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +drop table if exists `T11`; +drop table if exists `T12`; +--enable_warnings + +# +# Test RPAD() function with Japanese character in utf8 encoding +# + +SET NAMES utf8; +SET character_set_database = utf8; + +CREATE TABLE `T1` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T11` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T12` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; + +INSERT INTO `T1` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `T3` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +INSERT INTO `T1ï¼` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `T12` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); + +#InnoDB +SELECT `C1`, RPAD(`C1`,5,'。') FROM `T1`; +SELECT `C1`, RPAD(`C1`,5,'X') FROM `ï¼´ï¼’`; +SELECT `C1`, RPAD(`C1`,5,'丄') FROM `T3`; + +#MyISAM +SELECT `C1`, RPAD(`C1`,5,'。') FROM `ï¼´ï¼”`; +SELECT `C1`, RPAD(`C1`,5,'X') FROM `T5`; +SELECT `C1`, RPAD(`C1`,5,'丄' ) FROM `ï¼´ï¼–`; + +#HEAP +SELECT `C1`, RPAD(`C1`,5,'。') FROM `ï¼´ï¼—`; +SELECT `C1`, RPAD(`C1`,5,'X') FROM `T8`; +SELECT `C1`, RPAD(`C1`,5,'丄' ) FROM `ï¼´ï¼™`; + +#BDB +SELECT `C1`, RPAD(`C1`,5,'。') FROM `T1ï¼`; +SELECT `C1`, RPAD(`C1`,5,'X') FROM `T11`; +SELECT `C1`, RPAD(`C1`,5,'丄' ) FROM `T12`; + +DROP TABLE `T1`; +DROP TABLE `ï¼´ï¼’`; +DROP TABLE `T3`; +DROP TABLE `ï¼´ï¼”`; +DROP TABLE `T5`; +DROP TABLE `ï¼´ï¼–`; +DROP TABLE `ï¼´ï¼—`; +DROP TABLE `T8`; +DROP TABLE `ï¼´ï¼™`; +DROP TABLE `T1ï¼`; +DROP TABLE `T11`; +DROP TABLE `T12`; diff --git a/mysql-test/suite/jp/t/jp_rtrim_sjis.test b/mysql-test/suite/jp/t/jp_rtrim_sjis.test new file mode 100755 index 00000000000..c80cf9410f9 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_rtrim_sjis.test @@ -0,0 +1,163 @@ +--character_set sjis +--disable_warnings +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +--enable_warnings + +# +# Test RTRIM() function with Japanese characters in sjis encoding +# + +SET NAMES sjis; +SET character_set_database = sjis; + +CREATE TABLE `‚s‚P` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Q` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚R` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚S` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚T` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚U` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚V` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚W` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚X` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚O` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚P` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚Q` (`‚b‚P` char(8), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; + +INSERT INTO `‚s‚P` VALUES ('±²³´µ'); +INSERT INTO `‚s‚P` VALUES ('±²³´µ '); +INSERT INTO `‚s‚P` VALUES ('±²³´µ '); +INSERT INTO `‚s‚P` VALUES ('±²³´µ '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `‚s‚P` VALUES ('±²³´µ@'); +INSERT INTO `‚s‚P` VALUES ('±²³´µ@@'); +INSERT INTO `‚s‚P` VALUES ('±²³´µ@@@'); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨ '); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨ '); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨ '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨@'); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨@@'); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨@@@'); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\ '); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\ '); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\ '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\@'); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\@@'); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\@@@'); +INSERT INTO `‚s‚S` VALUES ('±²³´µ'); +INSERT INTO `‚s‚S` VALUES ('±²³´µ '); +INSERT INTO `‚s‚S` VALUES ('±²³´µ '); +INSERT INTO `‚s‚S` VALUES ('±²³´µ '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `‚s‚S` VALUES ('±²³´µ@'); +INSERT INTO `‚s‚S` VALUES ('±²³´µ@@'); +INSERT INTO `‚s‚S` VALUES ('±²³´µ@@@'); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨ '); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨ '); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨ '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨@'); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨@@'); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨@@@'); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\ '); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\ '); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\ '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\@'); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\@@'); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\@@@'); +INSERT INTO `‚s‚V` VALUES ('±²³´µ'); +INSERT INTO `‚s‚V` VALUES ('±²³´µ '); +INSERT INTO `‚s‚V` VALUES ('±²³´µ '); +INSERT INTO `‚s‚V` VALUES ('±²³´µ '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `‚s‚V` VALUES ('±²³´µ@'); +INSERT INTO `‚s‚V` VALUES ('±²³´µ@@'); +INSERT INTO `‚s‚V` VALUES ('±²³´µ@@@'); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨ '); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨ '); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨ '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨@'); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨@@'); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨@@@'); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\ '); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\ '); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\ '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\@'); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\@@'); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\@@@'); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ'); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ '); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ '); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ@'); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ@@'); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ@@@'); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨ '); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨ '); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨ '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨@'); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨@@'); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨@@@'); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\ '); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\ '); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\ '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\@'); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\@@'); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\@@@'); + +#InnoDB +SELECT RTRIM(`‚b‚P`) from `‚s‚P`; +SELECT RTRIM(`‚b‚P`) from `‚s‚Q`; +SELECT RTRIM(`‚b‚P`) from `‚s‚R`; + +#MyISAM +SELECT RTRIM(`‚b‚P`) from `‚s‚S`; +SELECT RTRIM(`‚b‚P`) from `‚s‚T`; +SELECT RTRIM(`‚b‚P`) from `‚s‚U`; + +#HEAP +SELECT RTRIM(`‚b‚P`) from `‚s‚V`; +SELECT RTRIM(`‚b‚P`) from `‚s‚W`; +SELECT RTRIM(`‚b‚P`) from `‚s‚X`; + +#BDB +SELECT RTRIM(`‚b‚P`) from `‚s‚P‚O`; +SELECT RTRIM(`‚b‚P`) from `‚s‚P‚P`; +SELECT RTRIM(`‚b‚P`) from `‚s‚P‚Q`; + +DROP TABLE `‚s‚P`; +DROP TABLE `‚s‚Q`; +DROP TABLE `‚s‚R`; +DROP TABLE `‚s‚S`; +DROP TABLE `‚s‚T`; +DROP TABLE `‚s‚U`; +DROP TABLE `‚s‚V`; +DROP TABLE `‚s‚W`; +DROP TABLE `‚s‚X`; +DROP TABLE `‚s‚P‚O`; +DROP TABLE `‚s‚P‚P`; +DROP TABLE `‚s‚P‚Q`; diff --git a/mysql-test/suite/jp/t/jp_rtrim_ucs2.test b/mysql-test/suite/jp/t/jp_rtrim_ucs2.test new file mode 100755 index 00000000000..0fac38d12d1 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_rtrim_ucs2.test @@ -0,0 +1,165 @@ +--source include/have_ucs2.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +--enable_warnings + +# +# Test RTRIM() function with Japanese characters in ucs2 encoding +# + +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; + +CREATE TABLE `£Ô£±` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; + +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵ '); +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵ '); +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵ '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵¡¡'); +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵¡¡¡¡'); +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵¡¡¡¡¡¡'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡¡¡'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡¡¡¡¡'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà '); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà '); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà¡¡'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà¡¡¡¡'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà¡¡¡¡¡¡'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵ '); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵ '); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵ '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵¡¡'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵¡¡¡¡'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵¡¡¡¡¡¡'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡¡¡'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡¡¡¡¡'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà '); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà '); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà¡¡'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà¡¡¡¡'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà¡¡¡¡¡¡'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵ '); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵ '); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵ '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵¡¡'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵¡¡¡¡'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵¡¡¡¡¡¡'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡¡¡'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡¡¡¡¡'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà '); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà '); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà¡¡'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà¡¡¡¡'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà¡¡¡¡¡¡'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵ '); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵ '); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵ '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵¡¡'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵¡¡¡¡'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵¡¡¡¡¡¡'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡¡¡'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡¡¡¡¡'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà '); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà '); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà¡¡'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà¡¡¡¡'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà¡¡¡¡¡¡'); + +#InnoDB +SELECT RTRIM(`£Ã£±`) from `£Ô£±`; +SELECT RTRIM(`£Ã£±`) from `£Ô£²`; +SELECT RTRIM(`£Ã£±`) from `£Ô£³`; + +#MyISAM +SELECT RTRIM(`£Ã£±`) from `£Ô£´`; +SELECT RTRIM(`£Ã£±`) from `£Ô£µ`; +SELECT RTRIM(`£Ã£±`) from `£Ô£¶`; + +#HEAP +SELECT RTRIM(`£Ã£±`) from `£Ô£·`; +SELECT RTRIM(`£Ã£±`) from `£Ô£¸`; +SELECT RTRIM(`£Ã£±`) from `£Ô£¹`; + +#BDB +SELECT RTRIM(`£Ã£±`) from `£Ô£±£°`; +SELECT RTRIM(`£Ã£±`) from `£Ô£±£±`; +SELECT RTRIM(`£Ã£±`) from `£Ô£±£²`; + +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/t/jp_rtrim_ujis.test b/mysql-test/suite/jp/t/jp_rtrim_ujis.test new file mode 100755 index 00000000000..46cda84dd55 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_rtrim_ujis.test @@ -0,0 +1,164 @@ +--source include/have_ujis.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +--enable_warnings + +# +# Test RTRIM() function with Japanese characters in ujis encoding +# + +SET NAMES ujis; +SET character_set_database = ujis; + +CREATE TABLE `£Ô£±` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(8), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; + +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵ '); +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵ '); +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵ '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵¡¡'); +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵¡¡¡¡'); +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵¡¡¡¡¡¡'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡¡¡'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡¡¡¡¡'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà '); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà '); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà¡¡'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà¡¡¡¡'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà¡¡¡¡¡¡'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵ '); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵ '); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵ '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵¡¡'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵¡¡¡¡'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵¡¡¡¡¡¡'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡¡¡'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡¡¡¡¡'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà '); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà '); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà¡¡'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà¡¡¡¡'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà¡¡¡¡¡¡'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵ '); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵ '); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵ '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵¡¡'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵¡¡¡¡'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵¡¡¡¡¡¡'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡¡¡'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡¡¡¡¡'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà '); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà '); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà¡¡'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà¡¡¡¡'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà¡¡¡¡¡¡'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵ '); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵ '); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵ '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵¡¡'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵¡¡¡¡'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵¡¡¡¡¡¡'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡¡¡'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª¡¡¡¡¡¡'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà '); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà '); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà¡¡'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà¡¡¡¡'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà¡¡¡¡¡¡'); + +#InnoDB +SELECT RTRIM(`£Ã£±`) from `£Ô£±`; +SELECT RTRIM(`£Ã£±`) from `£Ô£²`; +SELECT RTRIM(`£Ã£±`) from `£Ô£³`; + +#MyISAM +SELECT RTRIM(`£Ã£±`) from `£Ô£´`; +SELECT RTRIM(`£Ã£±`) from `£Ô£µ`; +SELECT RTRIM(`£Ã£±`) from `£Ô£¶`; + +#HEAP +SELECT RTRIM(`£Ã£±`) from `£Ô£·`; +SELECT RTRIM(`£Ã£±`) from `£Ô£¸`; +SELECT RTRIM(`£Ã£±`) from `£Ô£¹`; + +#BDB +SELECT RTRIM(`£Ã£±`) from `£Ô£±£°`; +SELECT RTRIM(`£Ã£±`) from `£Ô£±£±`; +SELECT RTRIM(`£Ã£±`) from `£Ô£±£²`; + +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/t/jp_rtrim_utf8.test b/mysql-test/suite/jp/t/jp_rtrim_utf8.test new file mode 100755 index 00000000000..4880a42db3e --- /dev/null +++ b/mysql-test/suite/jp/t/jp_rtrim_utf8.test @@ -0,0 +1,162 @@ +--disable_warnings +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +--enable_warnings + +# +# Test RTRIM() function with Japanese characters in utf8 encoding +# + +SET NAMES utf8; +SET character_set_database = utf8; + +CREATE TABLE `T1` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T11` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T12` (`C1` char(8), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; + +INSERT INTO `T1` VALUES ('アイウエオ'); +INSERT INTO `T1` VALUES ('アイウエオ '); +INSERT INTO `T1` VALUES ('アイウエオ '); +INSERT INTO `T1` VALUES ('アイウエオ '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `T1` VALUES ('アイウエオ '); +INSERT INTO `T1` VALUES ('アイウエオ  '); +INSERT INTO `T1` VALUES ('アイウエオ   '); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠ '); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠ '); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠ '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠã€€'); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠã€€ã€€'); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠã€€ã€€ã€€'); +INSERT INTO `T3` VALUES ('龔龖龗龞龡'); +INSERT INTO `T3` VALUES ('龔龖龗龞龡 '); +INSERT INTO `T3` VALUES ('龔龖龗龞龡 '); +INSERT INTO `T3` VALUES ('龔龖龗龞龡 '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `T3` VALUES ('龔龖龗龞龡 '); +INSERT INTO `T3` VALUES ('龔龖龗龞龡  '); +INSERT INTO `T3` VALUES ('龔龖龗龞龡   '); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオ'); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオ '); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオ '); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオ '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオ '); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオ  '); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオ   '); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠ '); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠ '); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠ '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠã€€'); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠã€€ã€€'); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠã€€ã€€ã€€'); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡 '); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡 '); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡 '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡 '); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡  '); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡   '); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオ'); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオ '); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオ '); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオ '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオ '); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオ  '); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオ   '); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠ '); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠ '); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠ '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠã€€'); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠã€€ã€€'); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠã€€ã€€ã€€'); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡 '); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡 '); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡 '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡 '); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡  '); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡   '); +INSERT INTO `T1ï¼` VALUES ('アイウエオ'); +INSERT INTO `T1ï¼` VALUES ('アイウエオ '); +INSERT INTO `T1ï¼` VALUES ('アイウエオ '); +INSERT INTO `T1ï¼` VALUES ('アイウエオ '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `T1ï¼` VALUES ('アイウエオ '); +INSERT INTO `T1ï¼` VALUES ('アイウエオ  '); +INSERT INTO `T1ï¼` VALUES ('アイウエオ   '); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠ '); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠ '); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠ '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠã€€'); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠã€€ã€€'); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠã€€ã€€ã€€'); +INSERT INTO `T12` VALUES ('龔龖龗龞龡'); +INSERT INTO `T12` VALUES ('龔龖龗龞龡 '); +INSERT INTO `T12` VALUES ('龔龖龗龞龡 '); +INSERT INTO `T12` VALUES ('龔龖龗龞龡 '); +# Double byte spaces are not supposed to be trimed +INSERT INTO `T12` VALUES ('龔龖龗龞龡 '); +INSERT INTO `T12` VALUES ('龔龖龗龞龡  '); +INSERT INTO `T12` VALUES ('龔龖龗龞龡   '); + +#InnoDB +SELECT RTRIM(`C1`) from `T1`; +SELECT RTRIM(`C1`) from `ï¼´ï¼’`; +SELECT RTRIM(`C1`) from `T3`; + +#MyISAM +SELECT RTRIM(`C1`) from `ï¼´ï¼”`; +SELECT RTRIM(`C1`) from `T5`; +SELECT RTRIM(`C1`) from `ï¼´ï¼–`; + +#HEAP +SELECT RTRIM(`C1`) from `ï¼´ï¼—`; +SELECT RTRIM(`C1`) from `T8`; +SELECT RTRIM(`C1`) from `ï¼´ï¼™`; + +#BDB +SELECT RTRIM(`C1`) from `T1ï¼`; +SELECT RTRIM(`C1`) from `T11`; +SELECT RTRIM(`C1`) from `T12`; + +DROP TABLE `T1`; +DROP TABLE `ï¼´ï¼’`; +DROP TABLE `T3`; +DROP TABLE `ï¼´ï¼”`; +DROP TABLE `T5`; +DROP TABLE `ï¼´ï¼–`; +DROP TABLE `ï¼´ï¼—`; +DROP TABLE `T8`; +DROP TABLE `ï¼´ï¼™`; +DROP TABLE `T1ï¼`; +DROP TABLE `T11`; +DROP TABLE `T12`; diff --git a/mysql-test/suite/jp/t/jp_select_sjis.test b/mysql-test/suite/jp/t/jp_select_sjis.test new file mode 100755 index 00000000000..d84ed7a4b2c --- /dev/null +++ b/mysql-test/suite/jp/t/jp_select_sjis.test @@ -0,0 +1,83 @@ +--character_set sjis +--disable_warnings +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +drop table if exists `‚s‚P‚P`; +drop table if exists `‚s‚P‚Q`; +--enable_warnings + +# +# Test Displaying Japanese charact in sjis encoding +# + +SET NAMES sjis; +SET character_set_database = sjis; + +CREATE TABLE `‚s‚P` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Q` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚R` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚S` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚T` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚U` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚V` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚W` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚X` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚O` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚P` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚Q` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; + +#Load the following data in each table +# jisx0201 hankaku-katakana data +# jisx0208 data +# jisx0212 supplemental character data + +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `‚s‚P`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `‚s‚Q`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `‚s‚R`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `‚s‚S`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `‚s‚T`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `‚s‚U`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `‚s‚V`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `‚s‚W`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `‚s‚X`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `‚s‚P‚O`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `‚s‚P‚P`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `‚s‚P‚Q`; + +#InnoDB +SELECT * FROM `‚s‚P`; +SELECT * FROM `‚s‚Q`; +SELECT * FROM `‚s‚R`; +#MyISAM +SELECT * FROM `‚s‚S`; +SELECT * FROM `‚s‚T`; +SELECT * FROM `‚s‚U`; +#Heap +SELECT * FROM `‚s‚V`; +SELECT * FROM `‚s‚W`; +SELECT * FROM `‚s‚X`; +#BDB +SELECT * FROM `‚s‚P‚O`; +SELECT * FROM `‚s‚P‚P`; +SELECT * FROM `‚s‚P‚Q`; + +drop table `‚s‚P`; +drop table `‚s‚Q`; +drop table `‚s‚R`; +drop table `‚s‚S`; +drop table `‚s‚T`; +drop table `‚s‚U`; +drop table `‚s‚V`; +drop table `‚s‚W`; +drop table `‚s‚X`; +drop table `‚s‚P‚O`; +drop table `‚s‚P‚P`; +drop table `‚s‚P‚Q`; diff --git a/mysql-test/suite/jp/t/jp_select_ucs2.test b/mysql-test/suite/jp/t/jp_select_ucs2.test new file mode 100755 index 00000000000..2e4602e7ea4 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_select_ucs2.test @@ -0,0 +1,172 @@ +--source include/have_ucs2.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +--enable_warnings + +# +# Test Displaying Japanese charact in ucs2 encoding +# + +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; + +CREATE TABLE `£Ô£±` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µ` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£±` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£²` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ucs2 engine = bdb; + +#INSERT the following data in each table +# jisx0201 hankaku-katakana data +# jisx0208 data +# jisx0212 supplemental character data + +INSERT INTO `£Ô£±` VALUES + ('PQRSTUVWXYZ[\\]^_') +,(' Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯') +,('Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿') +,('ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ') +,('ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß'); + +INSERT INTO `£Ô£²` VALUES + ('¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç') +,('¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û') +,('¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³') +,('¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³') +,('¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³') +,('¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³') +,('¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³'); + +INSERT INTO `£Ô£³` VALUES + ('¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦') +,('°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç') +,('°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û') +,('°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï') +,('¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³') +,('í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ') +,('íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ'); + +INSERT INTO `£Ô£´` VALUES + ('PQRSTUVWXYZ[\\]^_') +,(' Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯') +,('Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿') +,('ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ') +,('ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß'); + +INSERT INTO `£Ô£µ` VALUES + ('¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç') +,('¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û') +,('¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³') +,('¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³') +,('¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³') +,('¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³') +,('¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³'); + +INSERT INTO `£Ô£¶` VALUES + ('¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦') +,('°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç') +,('°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û') +,('°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï') +,('¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³') +,('í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ') +,('íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ'); + +INSERT INTO `£Ô£·` VALUES + ('PQRSTUVWXYZ[\\]^_') +,(' Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯') +,('Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿') +,('ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ') +,('ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß'); + +INSERT INTO `£Ô£¸` VALUES + ('¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç') +,('¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û') +,('¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³') +,('¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³') +,('¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³') +,('¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³') +,('¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³'); + +INSERT INTO `£Ô£¹` VALUES + ('¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦') +,('°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç') +,('°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û') +,('°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï') +,('¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³') +,('í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ') +,('íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ'); + +INSERT INTO `£Ô£±£°` VALUES + ('PQRSTUVWXYZ[\\]^_') +,(' Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯') +,('Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿') +,('ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ') +,('ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß'); + +INSERT INTO `£Ô£±£±` VALUES + ('¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç') +,('¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û') +,('¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³') +,('¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³') +,('¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³') +,('¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³') +,('¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³'); + +INSERT INTO `£Ô£±£²` VALUES + ('¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦') +,('°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç') +,('°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û') +,('°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï') +,('¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³') +,('í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ') +,('íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ'); + +#InnoDB +SELECT * FROM `£Ô£±`; +SELECT * FROM `£Ô£²`; +SELECT * FROM `£Ô£³`; +#MyISAM +SELECT * FROM `£Ô£´`; +SELECT * FROM `£Ô£µ`; +SELECT * FROM `£Ô£¶`; +#Heap +SELECT * FROM `£Ô£·`; +SELECT * FROM `£Ô£¸`; +SELECT * FROM `£Ô£¹`; +#BDB +SELECT * FROM `£Ô£±£°`; +SELECT * FROM `£Ô£±£±`; +SELECT * FROM `£Ô£±£²`; + +drop table `£Ô£±`; +drop table `£Ô£²`; +drop table `£Ô£³`; +drop table `£Ô£´`; +drop table `£Ô£µ`; +drop table `£Ô£¶`; +drop table `£Ô£·`; +drop table `£Ô£¸`; +drop table `£Ô£¹`; +drop table `£Ô£±£°`; +drop table `£Ô£±£±`; +drop table `£Ô£±£²`; diff --git a/mysql-test/suite/jp/t/jp_select_ujis.test b/mysql-test/suite/jp/t/jp_select_ujis.test new file mode 100755 index 00000000000..4ad9e581a92 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_select_ujis.test @@ -0,0 +1,84 @@ +--source include/have_ujis.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +--enable_warnings + +# +# Test Displaying Japanese charact in ujis encoding +# + +SET NAMES ujis; +SET character_set_database = ujis; + +CREATE TABLE `£Ô£±` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µ` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£±` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£²` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = ujis engine = bdb; + +#Load the following data in each table +# jisx0201 hankaku-katakana data +# jisx0208 data +# jisx0212 supplemental character data + +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_ujis.dat' INTO TABLE `£Ô£±`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_ujis.dat' INTO TABLE `£Ô£²`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_ujis.dat' INTO TABLE `£Ô£³`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_ujis.dat' INTO TABLE `£Ô£´`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_ujis.dat' INTO TABLE `£Ô£µ`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_ujis.dat' INTO TABLE `£Ô£¶`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_ujis.dat' INTO TABLE `£Ô£·`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_ujis.dat' INTO TABLE `£Ô£¸`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_ujis.dat' INTO TABLE `£Ô£¹`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_ujis.dat' INTO TABLE `£Ô£±£°`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_ujis.dat' INTO TABLE `£Ô£±£±`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_ujis.dat' INTO TABLE `£Ô£±£²`; + +#InnoDB +SELECT * FROM `£Ô£±`; +SELECT * FROM `£Ô£²`; +SELECT * FROM `£Ô£³`; +#MyISAM +SELECT * FROM `£Ô£´`; +SELECT * FROM `£Ô£µ`; +SELECT * FROM `£Ô£¶`; +#Heap +SELECT * FROM `£Ô£·`; +SELECT * FROM `£Ô£¸`; +SELECT * FROM `£Ô£¹`; +#BDB +SELECT * FROM `£Ô£±£°`; +SELECT * FROM `£Ô£±£±`; +SELECT * FROM `£Ô£±£²`; + +drop table `£Ô£±`; +drop table `£Ô£²`; +drop table `£Ô£³`; +drop table `£Ô£´`; +drop table `£Ô£µ`; +drop table `£Ô£¶`; +drop table `£Ô£·`; +drop table `£Ô£¸`; +drop table `£Ô£¹`; +drop table `£Ô£±£°`; +drop table `£Ô£±£±`; +drop table `£Ô£±£²`; diff --git a/mysql-test/suite/jp/t/jp_select_utf8.test b/mysql-test/suite/jp/t/jp_select_utf8.test new file mode 100755 index 00000000000..e614b9ccfb0 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_select_utf8.test @@ -0,0 +1,82 @@ +--disable_warnings +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +drop table if exists `T11`; +drop table if exists `T12`; +--enable_warnings + +# +# Test Displaying Japanese charact in utf8 encoding +# + +SET NAMES utf8; +SET character_set_database = utf8; + +CREATE TABLE `T1` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T11` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T12` (c1 char(20), INDEX(c1)) DEFAULT CHARSET = utf8 engine = bdb; + +#Load the following data in each table +# jisx0201 hankaku-katakana data +# jisx0208 data +# jisx0212 supplemental character data + +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_utf8.dat' INTO TABLE `T1`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_utf8.dat' INTO TABLE `ï¼´ï¼’`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_utf8.dat' INTO TABLE `T3`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_utf8.dat' INTO TABLE `ï¼´ï¼”`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_utf8.dat' INTO TABLE `T5`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_utf8.dat' INTO TABLE `ï¼´ï¼–`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_utf8.dat' INTO TABLE `ï¼´ï¼—`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_utf8.dat' INTO TABLE `T8`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_utf8.dat' INTO TABLE `ï¼´ï¼™`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_utf8.dat' INTO TABLE `T1ï¼`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_utf8.dat' INTO TABLE `T11`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_utf8.dat' INTO TABLE `T12`; + +#InnoDB +SELECT * FROM `T1`; +SELECT * FROM `ï¼´ï¼’`; +SELECT * FROM `T3`; +#MyISAM +SELECT * FROM `ï¼´ï¼”`; +SELECT * FROM `T5`; +SELECT * FROM `ï¼´ï¼–`; +#Heap +SELECT * FROM `ï¼´ï¼—`; +SELECT * FROM `T8`; +SELECT * FROM `ï¼´ï¼™`; +#BDB +SELECT * FROM `T1ï¼`; +SELECT * FROM `T11`; +SELECT * FROM `T12`; + +drop table `T1`; +drop table `ï¼´ï¼’`; +drop table `T3`; +drop table `ï¼´ï¼”`; +drop table `T5`; +drop table `ï¼´ï¼–`; +drop table `ï¼´ï¼—`; +drop table `T8`; +drop table `ï¼´ï¼™`; +drop table `T1ï¼`; +drop table `T11`; +drop table `T12`; diff --git a/mysql-test/suite/jp/t/jp_subquery_sjis.test b/mysql-test/suite/jp/t/jp_subquery_sjis.test new file mode 100755 index 00000000000..5292c7a2519 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_subquery_sjis.test @@ -0,0 +1,140 @@ +--character_set sjis +--disable_warnings +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +drop table if exists `‚s‚P‚P`; +drop table if exists `‚s‚P‚Q`; +--enable_warnings + +# +# Test subquery using Japanese characters in sjis encoding +# + +SET NAMES sjis; +SET character_set_database = sjis; + +CREATE TABLE `‚s‚Pa` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Pb` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Qa` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Qb` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Ra` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Rb` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Sa` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚Sb` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚Ta` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚Tb` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚Ua` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚Ub` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚Va` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚Vb` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚Wa` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚Wb` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚Xa` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚Xb` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚Oa` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚Ob` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚Pa` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚Pb` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚Qa` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚Qb` (`‚b‚P` char(1) PRIMARY KEY) DEFAULT CHARSET = sjis engine = heap; + +#insert the following data in each table +# jisx0201 hankaku-katakana data +# jisx0208 data +# jisx0212 supplemental character data + +INSERT INTO `‚s‚Pa` VALUES ('±'),('¶'),('»'); +INSERT INTO `‚s‚Pb` VALUES ('±'); +INSERT INTO `‚s‚Qa` VALUES ('‚ '),('‚©'),('‚³'); +INSERT INTO `‚s‚Qb` VALUES ('‚ '); +INSERT INTO `‚s‚Ra` VALUES ('ƒ\'),('\'),('•\'); +INSERT INTO `‚s‚Rb` VALUES ('ƒ\'); +INSERT INTO `‚s‚Sa` VALUES ('±'),('¶'),('»'); +INSERT INTO `‚s‚Sb` VALUES ('±'); +INSERT INTO `‚s‚Ta` VALUES ('‚ '),('‚©'),('‚³'); +INSERT INTO `‚s‚Tb` VALUES ('‚ '); +INSERT INTO `‚s‚Ua` VALUES ('ƒ\'),('\'),('•\'); +INSERT INTO `‚s‚Ub` VALUES ('ƒ\'); +INSERT INTO `‚s‚Va` VALUES ('±'),('¶'),('»'); +INSERT INTO `‚s‚Vb` VALUES ('±'); +INSERT INTO `‚s‚Wa` VALUES ('‚ '),('‚©'),('‚³'); +INSERT INTO `‚s‚Wb` VALUES ('‚ '); +INSERT INTO `‚s‚Xa` VALUES ('ƒ\'),('\'),('•\'); +INSERT INTO `‚s‚Xb` VALUES ('ƒ\'); +INSERT INTO `‚s‚P‚Oa` VALUES ('±'),('¶'),('»'); +INSERT INTO `‚s‚P‚Ob` VALUES ('±'); +INSERT INTO `‚s‚P‚Pa` VALUES ('‚ '),('‚©'),('‚³'); +INSERT INTO `‚s‚P‚Pb` VALUES ('‚ '); +INSERT INTO `‚s‚P‚Qa` VALUES ('ƒ\'),('\'),('•\'); +INSERT INTO `‚s‚P‚Qb` VALUES ('ƒ\'); + +#Test for innodb +SELECT `‚b‚P` FROM `‚s‚Pa` WHERE `‚b‚P` IN (SELECT `‚b‚P` FROM `‚s‚Pb`); +SELECT `‚b‚P` FROM `‚s‚Pa` WHERE EXISTS (SELECT `‚b‚P` FROM `‚s‚Pb` WHERE `‚s‚Pa`.`‚b‚P` = `‚s‚Pb`.`‚b‚P`); +SELECT `‚b‚P` FROM `‚s‚Pa` WHERE NOT EXISTS (SELECT `‚b‚P` FROM `‚s‚Pb` WHERE `‚s‚Pa`.`‚b‚P` = `‚s‚Pb`.`‚b‚P`); +SELECT `‚b‚P` FROM `‚s‚Qa` WHERE `‚b‚P` IN (SELECT `‚b‚P` FROM `‚s‚Qb`); +SELECT `‚b‚P` FROM `‚s‚Qa` WHERE EXISTS (SELECT `‚b‚P` FROM `‚s‚Qb` WHERE `‚s‚Qa`.`‚b‚P` = `‚s‚Qb`.`‚b‚P`); +SELECT `‚b‚P` FROM `‚s‚Qa` WHERE NOT EXISTS (SELECT `‚b‚P` FROM `‚s‚Qb` WHERE `‚s‚Qa`.`‚b‚P` = `‚s‚Qb`.`‚b‚P`); +SELECT `‚b‚P` FROM `‚s‚Ra` WHERE `‚b‚P` IN (SELECT `‚b‚P` FROM `‚s‚Rb`); +SELECT `‚b‚P` FROM `‚s‚Ra` WHERE EXISTS (SELECT `‚b‚P` FROM `‚s‚Rb` WHERE `‚s‚Ra`.`‚b‚P` = `‚s‚Rb`.`‚b‚P`); +SELECT `‚b‚P` FROM `‚s‚Ra` WHERE NOT EXISTS (SELECT `‚b‚P` FROM `‚s‚Rb` WHERE `‚s‚Ra`.`‚b‚P` = `‚s‚Rb`.`‚b‚P`); +SELECT `‚b‚P` FROM `‚s‚Sa` WHERE `‚b‚P` IN (SELECT `‚b‚P` FROM `‚s‚Sb`); +SELECT `‚b‚P` FROM `‚s‚Sa` WHERE EXISTS (SELECT `‚b‚P` FROM `‚s‚Sb` WHERE `‚s‚Sa`.`‚b‚P` = `‚s‚Sb`.`‚b‚P`); +SELECT `‚b‚P` FROM `‚s‚Sa` WHERE NOT EXISTS (SELECT `‚b‚P` FROM `‚s‚Sb` WHERE `‚s‚Sa`.`‚b‚P` = `‚s‚Sb`.`‚b‚P`); +SELECT `‚b‚P` FROM `‚s‚Ta` WHERE `‚b‚P` IN (SELECT `‚b‚P` FROM `‚s‚Tb`); +SELECT `‚b‚P` FROM `‚s‚Ta` WHERE EXISTS (SELECT `‚b‚P` FROM `‚s‚Tb` WHERE `‚s‚Ta`.`‚b‚P` = `‚s‚Tb`.`‚b‚P`); +SELECT `‚b‚P` FROM `‚s‚Ta` WHERE NOT EXISTS (SELECT `‚b‚P` FROM `‚s‚Tb` WHERE `‚s‚Ta`.`‚b‚P` = `‚s‚Tb`.`‚b‚P`); +SELECT `‚b‚P` FROM `‚s‚Ua` WHERE `‚b‚P` IN (SELECT `‚b‚P` FROM `‚s‚Ub`); +SELECT `‚b‚P` FROM `‚s‚Ua` WHERE EXISTS (SELECT `‚b‚P` FROM `‚s‚Ub` WHERE `‚s‚Ua`.`‚b‚P` = `‚s‚Ub`.`‚b‚P`); +SELECT `‚b‚P` FROM `‚s‚Ua` WHERE NOT EXISTS (SELECT `‚b‚P` FROM `‚s‚Ub` WHERE `‚s‚Ua`.`‚b‚P` = `‚s‚Ub`.`‚b‚P`); +SELECT `‚b‚P` FROM `‚s‚Va` WHERE `‚b‚P` IN (SELECT `‚b‚P` FROM `‚s‚Vb`); +SELECT `‚b‚P` FROM `‚s‚Va` WHERE EXISTS (SELECT `‚b‚P` FROM `‚s‚Vb` WHERE `‚s‚Va`.`‚b‚P` = `‚s‚Vb`.`‚b‚P`); +SELECT `‚b‚P` FROM `‚s‚Va` WHERE NOT EXISTS (SELECT `‚b‚P` FROM `‚s‚Vb` WHERE `‚s‚Va`.`‚b‚P` = `‚s‚Vb`.`‚b‚P`); +SELECT `‚b‚P` FROM `‚s‚Wa` WHERE `‚b‚P` IN (SELECT `‚b‚P` FROM `‚s‚Wb`); +SELECT `‚b‚P` FROM `‚s‚Wa` WHERE EXISTS (SELECT `‚b‚P` FROM `‚s‚Wb` WHERE `‚s‚Wa`.`‚b‚P` = `‚s‚Wb`.`‚b‚P`); +SELECT `‚b‚P` FROM `‚s‚Wa` WHERE NOT EXISTS (SELECT `‚b‚P` FROM `‚s‚Wb` WHERE `‚s‚Wa`.`‚b‚P` = `‚s‚Wb`.`‚b‚P`); +SELECT `‚b‚P` FROM `‚s‚Xa` WHERE `‚b‚P` IN (SELECT `‚b‚P` FROM `‚s‚Xb`); +SELECT `‚b‚P` FROM `‚s‚Xa` WHERE EXISTS (SELECT `‚b‚P` FROM `‚s‚Xb` WHERE `‚s‚Xa`.`‚b‚P` = `‚s‚Xb`.`‚b‚P`); +SELECT `‚b‚P` FROM `‚s‚Xa` WHERE NOT EXISTS (SELECT `‚b‚P` FROM `‚s‚Xb` WHERE `‚s‚Xa`.`‚b‚P` = `‚s‚Xb`.`‚b‚P`); +SELECT `‚b‚P` FROM `‚s‚P‚Oa` WHERE `‚b‚P` IN (SELECT `‚b‚P` FROM `‚s‚P‚Ob`); +SELECT `‚b‚P` FROM `‚s‚P‚Oa` WHERE EXISTS (SELECT `‚b‚P` FROM `‚s‚P‚Ob` WHERE `‚s‚P‚Oa`.`‚b‚P` = `‚s‚P‚Ob`.`‚b‚P`); +SELECT `‚b‚P` FROM `‚s‚P‚Oa` WHERE NOT EXISTS (SELECT `‚b‚P` FROM `‚s‚P‚Ob` WHERE `‚s‚P‚Oa`.`‚b‚P` = `‚s‚P‚Ob`.`‚b‚P`); +SELECT `‚b‚P` FROM `‚s‚P‚Pa` WHERE `‚b‚P` IN (SELECT `‚b‚P` FROM `‚s‚P‚Pb`); +SELECT `‚b‚P` FROM `‚s‚P‚Pa` WHERE EXISTS (SELECT `‚b‚P` FROM `‚s‚P‚Pb` WHERE `‚s‚P‚Pa`.`‚b‚P` = `‚s‚P‚Pb`.`‚b‚P`); +SELECT `‚b‚P` FROM `‚s‚P‚Pa` WHERE NOT EXISTS (SELECT `‚b‚P` FROM `‚s‚P‚Pb` WHERE `‚s‚P‚Pa`.`‚b‚P` = `‚s‚P‚Pb`.`‚b‚P`); +SELECT `‚b‚P` FROM `‚s‚P‚Qa` WHERE `‚b‚P` IN (SELECT `‚b‚P` FROM `‚s‚P‚Qb`); +SELECT `‚b‚P` FROM `‚s‚P‚Qa` WHERE EXISTS (SELECT `‚b‚P` FROM `‚s‚P‚Qb` WHERE `‚s‚P‚Qa`.`‚b‚P` = `‚s‚P‚Qb`.`‚b‚P`); +SELECT `‚b‚P` FROM `‚s‚P‚Qa` WHERE NOT EXISTS (SELECT `‚b‚P` FROM `‚s‚P‚Qb` WHERE `‚s‚P‚Qa`.`‚b‚P` = `‚s‚P‚Qb`.`‚b‚P`); + +DROP TABLE `‚s‚Pa`; +DROP TABLE `‚s‚Pb`; +DROP TABLE `‚s‚Qa`; +DROP TABLE `‚s‚Qb`; +DROP TABLE `‚s‚Ra`; +DROP TABLE `‚s‚Rb`; +DROP TABLE `‚s‚Sa`; +DROP TABLE `‚s‚Sb`; +DROP TABLE `‚s‚Ta`; +DROP TABLE `‚s‚Tb`; +DROP TABLE `‚s‚Ua`; +DROP TABLE `‚s‚Ub`; +DROP TABLE `‚s‚Va`; +DROP TABLE `‚s‚Vb`; +DROP TABLE `‚s‚Wa`; +DROP TABLE `‚s‚Wb`; +DROP TABLE `‚s‚Xa`; +DROP TABLE `‚s‚Xb`; +DROP TABLE `‚s‚P‚Oa`; +DROP TABLE `‚s‚P‚Ob`; +DROP TABLE `‚s‚P‚Pa`; +DROP TABLE `‚s‚P‚Pb`; +DROP TABLE `‚s‚P‚Qa`; +DROP TABLE `‚s‚P‚Qb`; diff --git a/mysql-test/suite/jp/t/jp_subquery_utf8.test b/mysql-test/suite/jp/t/jp_subquery_utf8.test new file mode 100755 index 00000000000..97c2df8ce30 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_subquery_utf8.test @@ -0,0 +1,139 @@ +--disable_warnings +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +drop table if exists `T11`; +drop table if exists `T12`; +--enable_warnings + +# +# Test subquery using Japanese characters in utf8 encoding +# + +SET NAMES utf8; +SET character_set_database = utf8; + +CREATE TABLE `T1a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T1b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼”b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼—b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T11a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T11b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T12a` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T12b` (`C1` char(1) PRIMARY KEY) DEFAULT CHARSET = utf8 engine = heap; + +#insert the following data in each table +# jisx0201 hankaku-katakana data +# jisx0208 data +# jisx0212 supplemental character data + +INSERT INTO `T1a` VALUES ('ï½±'),('ï½¶'),('ï½»'); +INSERT INTO `T1b` VALUES ('ï½±'); +INSERT INTO `ï¼´ï¼’a` VALUES ('ã‚'),('ã‹'),('ã•'); +INSERT INTO `ï¼´ï¼’b` VALUES ('ã‚'); +INSERT INTO `T3a` VALUES ('é¾”'),('é¾–'),('é¾—'); +INSERT INTO `T3b` VALUES ('é¾”'); +INSERT INTO `ï¼´ï¼”a` VALUES ('ï½±'),('ï½¶'),('ï½»'); +INSERT INTO `ï¼´ï¼”b` VALUES ('ï½±'); +INSERT INTO `T5a` VALUES ('ã‚'),('ã‹'),('ã•'); +INSERT INTO `T5b` VALUES ('ã‚'); +INSERT INTO `ï¼´ï¼–a` VALUES ('é¾”'),('é¾–'),('é¾—'); +INSERT INTO `ï¼´ï¼–b` VALUES ('é¾”'); +INSERT INTO `ï¼´ï¼—a` VALUES ('ï½±'),('ï½¶'),('ï½»'); +INSERT INTO `ï¼´ï¼—b` VALUES ('ï½±'); +INSERT INTO `T8a` VALUES ('ã‚'),('ã‹'),('ã•'); +INSERT INTO `T8b` VALUES ('ã‚'); +INSERT INTO `ï¼´ï¼™a` VALUES ('é¾”'),('é¾–'),('é¾—'); +INSERT INTO `ï¼´ï¼™b` VALUES ('é¾”'); +INSERT INTO `T1ï¼a` VALUES ('ï½±'),('ï½¶'),('ï½»'); +INSERT INTO `T1ï¼b` VALUES ('ï½±'); +INSERT INTO `T11a` VALUES ('ã‚'),('ã‹'),('ã•'); +INSERT INTO `T11b` VALUES ('ã‚'); +INSERT INTO `T12a` VALUES ('é¾”'),('é¾–'),('é¾—'); +INSERT INTO `T12b` VALUES ('é¾”'); + +#Test for innodb +SELECT `C1` FROM `T1a` WHERE `C1` IN (SELECT `C1` FROM `T1b`); +SELECT `C1` FROM `T1a` WHERE EXISTS (SELECT `C1` FROM `T1b` WHERE `T1a`.`C1` = `T1b`.`C1`); +SELECT `C1` FROM `T1a` WHERE NOT EXISTS (SELECT `C1` FROM `T1b` WHERE `T1a`.`C1` = `T1b`.`C1`); +SELECT `C1` FROM `ï¼´ï¼’a` WHERE `C1` IN (SELECT `C1` FROM `ï¼´ï¼’b`); +SELECT `C1` FROM `ï¼´ï¼’a` WHERE EXISTS (SELECT `C1` FROM `ï¼´ï¼’b` WHERE `ï¼´ï¼’a`.`C1` = `ï¼´ï¼’b`.`C1`); +SELECT `C1` FROM `ï¼´ï¼’a` WHERE NOT EXISTS (SELECT `C1` FROM `ï¼´ï¼’b` WHERE `ï¼´ï¼’a`.`C1` = `ï¼´ï¼’b`.`C1`); +SELECT `C1` FROM `T3a` WHERE `C1` IN (SELECT `C1` FROM `T3b`); +SELECT `C1` FROM `T3a` WHERE EXISTS (SELECT `C1` FROM `T3b` WHERE `T3a`.`C1` = `T3b`.`C1`); +SELECT `C1` FROM `T3a` WHERE NOT EXISTS (SELECT `C1` FROM `T3b` WHERE `T3a`.`C1` = `T3b`.`C1`); +SELECT `C1` FROM `ï¼´ï¼”a` WHERE `C1` IN (SELECT `C1` FROM `ï¼´ï¼”b`); +SELECT `C1` FROM `ï¼´ï¼”a` WHERE EXISTS (SELECT `C1` FROM `ï¼´ï¼”b` WHERE `ï¼´ï¼”a`.`C1` = `ï¼´ï¼”b`.`C1`); +SELECT `C1` FROM `ï¼´ï¼”a` WHERE NOT EXISTS (SELECT `C1` FROM `ï¼´ï¼”b` WHERE `ï¼´ï¼”a`.`C1` = `ï¼´ï¼”b`.`C1`); +SELECT `C1` FROM `T5a` WHERE `C1` IN (SELECT `C1` FROM `T5b`); +SELECT `C1` FROM `T5a` WHERE EXISTS (SELECT `C1` FROM `T5b` WHERE `T5a`.`C1` = `T5b`.`C1`); +SELECT `C1` FROM `T5a` WHERE NOT EXISTS (SELECT `C1` FROM `T5b` WHERE `T5a`.`C1` = `T5b`.`C1`); +SELECT `C1` FROM `ï¼´ï¼–a` WHERE `C1` IN (SELECT `C1` FROM `ï¼´ï¼–b`); +SELECT `C1` FROM `ï¼´ï¼–a` WHERE EXISTS (SELECT `C1` FROM `ï¼´ï¼–b` WHERE `ï¼´ï¼–a`.`C1` = `ï¼´ï¼–b`.`C1`); +SELECT `C1` FROM `ï¼´ï¼–a` WHERE NOT EXISTS (SELECT `C1` FROM `ï¼´ï¼–b` WHERE `ï¼´ï¼–a`.`C1` = `ï¼´ï¼–b`.`C1`); +SELECT `C1` FROM `ï¼´ï¼—a` WHERE `C1` IN (SELECT `C1` FROM `ï¼´ï¼—b`); +SELECT `C1` FROM `ï¼´ï¼—a` WHERE EXISTS (SELECT `C1` FROM `ï¼´ï¼—b` WHERE `ï¼´ï¼—a`.`C1` = `ï¼´ï¼—b`.`C1`); +SELECT `C1` FROM `ï¼´ï¼—a` WHERE NOT EXISTS (SELECT `C1` FROM `ï¼´ï¼—b` WHERE `ï¼´ï¼—a`.`C1` = `ï¼´ï¼—b`.`C1`); +SELECT `C1` FROM `T8a` WHERE `C1` IN (SELECT `C1` FROM `T8b`); +SELECT `C1` FROM `T8a` WHERE EXISTS (SELECT `C1` FROM `T8b` WHERE `T8a`.`C1` = `T8b`.`C1`); +SELECT `C1` FROM `T8a` WHERE NOT EXISTS (SELECT `C1` FROM `T8b` WHERE `T8a`.`C1` = `T8b`.`C1`); +SELECT `C1` FROM `ï¼´ï¼™a` WHERE `C1` IN (SELECT `C1` FROM `ï¼´ï¼™b`); +SELECT `C1` FROM `ï¼´ï¼™a` WHERE EXISTS (SELECT `C1` FROM `ï¼´ï¼™b` WHERE `ï¼´ï¼™a`.`C1` = `ï¼´ï¼™b`.`C1`); +SELECT `C1` FROM `ï¼´ï¼™a` WHERE NOT EXISTS (SELECT `C1` FROM `ï¼´ï¼™b` WHERE `ï¼´ï¼™a`.`C1` = `ï¼´ï¼™b`.`C1`); +SELECT `C1` FROM `T1ï¼a` WHERE `C1` IN (SELECT `C1` FROM `T1ï¼b`); +SELECT `C1` FROM `T1ï¼a` WHERE EXISTS (SELECT `C1` FROM `T1ï¼b` WHERE `T1ï¼a`.`C1` = `T1ï¼b`.`C1`); +SELECT `C1` FROM `T1ï¼a` WHERE NOT EXISTS (SELECT `C1` FROM `T1ï¼b` WHERE `T1ï¼a`.`C1` = `T1ï¼b`.`C1`); +SELECT `C1` FROM `T11a` WHERE `C1` IN (SELECT `C1` FROM `T11b`); +SELECT `C1` FROM `T11a` WHERE EXISTS (SELECT `C1` FROM `T11b` WHERE `T11a`.`C1` = `T11b`.`C1`); +SELECT `C1` FROM `T11a` WHERE NOT EXISTS (SELECT `C1` FROM `T11b` WHERE `T11a`.`C1` = `T11b`.`C1`); +SELECT `C1` FROM `T12a` WHERE `C1` IN (SELECT `C1` FROM `T12b`); +SELECT `C1` FROM `T12a` WHERE EXISTS (SELECT `C1` FROM `T12b` WHERE `T12a`.`C1` = `T12b`.`C1`); +SELECT `C1` FROM `T12a` WHERE NOT EXISTS (SELECT `C1` FROM `T12b` WHERE `T12a`.`C1` = `T12b`.`C1`); + +DROP TABLE `T1a`; +DROP TABLE `T1b`; +DROP TABLE `ï¼´ï¼’a`; +DROP TABLE `ï¼´ï¼’b`; +DROP TABLE `T3a`; +DROP TABLE `T3b`; +DROP TABLE `ï¼´ï¼”a`; +DROP TABLE `ï¼´ï¼”b`; +DROP TABLE `T5a`; +DROP TABLE `T5b`; +DROP TABLE `ï¼´ï¼–a`; +DROP TABLE `ï¼´ï¼–b`; +DROP TABLE `ï¼´ï¼—a`; +DROP TABLE `ï¼´ï¼—b`; +DROP TABLE `T8a`; +DROP TABLE `T8b`; +DROP TABLE `ï¼´ï¼™a`; +DROP TABLE `ï¼´ï¼™b`; +DROP TABLE `T1ï¼a`; +DROP TABLE `T1ï¼b`; +DROP TABLE `T11a`; +DROP TABLE `T11b`; +DROP TABLE `T12a`; +DROP TABLE `T12b`; diff --git a/mysql-test/suite/jp/t/jp_substring_sjis.test b/mysql-test/suite/jp/t/jp_substring_sjis.test new file mode 100755 index 00000000000..ac929114880 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_substring_sjis.test @@ -0,0 +1,413 @@ +--character_set sjis +--disable_warnings +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +drop table if exists `‚s‚P‚P`; +drop table if exists `‚s‚P‚Q`; +--enable_warnings + +# +# Test SUBSTRING() function with Japanese character in sjis encoding +# + +SET NAMES sjis; +SET character_set_database = sjis; + +CREATE TABLE `‚s‚P` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Q` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚R` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚S` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚T` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚U` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚V` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚W` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚X` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚O` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚P` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚Q` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; + +INSERT INTO `‚s‚P` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +INSERT INTO `‚s‚S` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +INSERT INTO `‚s‚V` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ'),('±²³´'),('±²³'),('±²'),('±'),(''); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨'),('‚ ‚¢‚¤‚¦'),('‚ ‚¢‚¤'),('‚ ‚¢'),('‚ '),(''); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\'),('ƒ\\•\—\'),('ƒ\\•\'),('ƒ\\'),('ƒ\'),(''); + +#InnoDB +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,0) FROM `‚s‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1) FROM `‚s‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,2) FROM `‚s‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,3) FROM `‚s‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,4) FROM `‚s‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,5) FROM `‚s‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,6) FROM `‚s‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 0) FROM `‚s‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1) FROM `‚s‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 2) FROM `‚s‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 3) FROM `‚s‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 4) FROM `‚s‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 5) FROM `‚s‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 6) FROM `‚s‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,0) FROM `‚s‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,1) FROM `‚s‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,2) FROM `‚s‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,3) FROM `‚s‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,4) FROM `‚s‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,5) FROM `‚s‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,6) FROM `‚s‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 0) FROM `‚s‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 1) FROM `‚s‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 2) FROM `‚s‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 3) FROM `‚s‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 4) FROM `‚s‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 5) FROM `‚s‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 6) FROM `‚s‚P`; + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,0) FROM `‚s‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1) FROM `‚s‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,2) FROM `‚s‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,3) FROM `‚s‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,4) FROM `‚s‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,5) FROM `‚s‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,6) FROM `‚s‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 0) FROM `‚s‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1) FROM `‚s‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 2) FROM `‚s‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 3) FROM `‚s‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 4) FROM `‚s‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 5) FROM `‚s‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 6) FROM `‚s‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,0) FROM `‚s‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,1) FROM `‚s‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,2) FROM `‚s‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,3) FROM `‚s‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,4) FROM `‚s‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,5) FROM `‚s‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,6) FROM `‚s‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 0) FROM `‚s‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 1) FROM `‚s‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 2) FROM `‚s‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 3) FROM `‚s‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 4) FROM `‚s‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 5) FROM `‚s‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 6) FROM `‚s‚Q`; + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,0) FROM `‚s‚R`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1) FROM `‚s‚R`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,2) FROM `‚s‚R`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,3) FROM `‚s‚R`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,4) FROM `‚s‚R`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,5) FROM `‚s‚R`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,6) FROM `‚s‚R`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 0) FROM `‚s‚R`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1) FROM `‚s‚R`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 2) FROM `‚s‚R`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 3) FROM `‚s‚R`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 4) FROM `‚s‚R`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 5) FROM `‚s‚R`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 6) FROM `‚s‚R`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,0) FROM `‚s‚R`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,1) FROM `‚s‚R`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,2) FROM `‚s‚R`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,3) FROM `‚s‚R`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,4) FROM `‚s‚R`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,5) FROM `‚s‚R`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,6) FROM `‚s‚R`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 0) FROM `‚s‚R`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 1) FROM `‚s‚R`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 2) FROM `‚s‚R`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 3) FROM `‚s‚R`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 4) FROM `‚s‚R`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 5) FROM `‚s‚R`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 6) FROM `‚s‚R`; + +#MyISAM +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,0) FROM `‚s‚S`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1) FROM `‚s‚S`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,2) FROM `‚s‚S`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,3) FROM `‚s‚S`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,4) FROM `‚s‚S`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,5) FROM `‚s‚S`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,6) FROM `‚s‚S`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 0) FROM `‚s‚S`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1) FROM `‚s‚S`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 2) FROM `‚s‚S`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 3) FROM `‚s‚S`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 4) FROM `‚s‚S`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 5) FROM `‚s‚S`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 6) FROM `‚s‚S`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,0) FROM `‚s‚S`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,1) FROM `‚s‚S`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,2) FROM `‚s‚S`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,3) FROM `‚s‚S`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,4) FROM `‚s‚S`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,5) FROM `‚s‚S`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,6) FROM `‚s‚S`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 0) FROM `‚s‚S`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 1) FROM `‚s‚S`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 2) FROM `‚s‚S`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 3) FROM `‚s‚S`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 4) FROM `‚s‚S`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 5) FROM `‚s‚S`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 6) FROM `‚s‚S`; + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,0) FROM `‚s‚T`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1) FROM `‚s‚T`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,2) FROM `‚s‚T`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,3) FROM `‚s‚T`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,4) FROM `‚s‚T`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,5) FROM `‚s‚T`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,6) FROM `‚s‚T`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 0) FROM `‚s‚T`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1) FROM `‚s‚T`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 2) FROM `‚s‚T`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 3) FROM `‚s‚T`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 4) FROM `‚s‚T`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 5) FROM `‚s‚T`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 6) FROM `‚s‚T`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,0) FROM `‚s‚T`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,1) FROM `‚s‚T`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,2) FROM `‚s‚T`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,3) FROM `‚s‚T`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,4) FROM `‚s‚T`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,5) FROM `‚s‚T`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,6) FROM `‚s‚T`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 0) FROM `‚s‚T`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 1) FROM `‚s‚T`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 2) FROM `‚s‚T`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 3) FROM `‚s‚T`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 4) FROM `‚s‚T`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 5) FROM `‚s‚T`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 6) FROM `‚s‚T`; + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,0) FROM `‚s‚U`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1) FROM `‚s‚U`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,2) FROM `‚s‚U`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,3) FROM `‚s‚U`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,4) FROM `‚s‚U`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,5) FROM `‚s‚U`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,6) FROM `‚s‚U`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 0) FROM `‚s‚U`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1) FROM `‚s‚U`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 2) FROM `‚s‚U`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 3) FROM `‚s‚U`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 4) FROM `‚s‚U`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 5) FROM `‚s‚U`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 6) FROM `‚s‚U`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,0) FROM `‚s‚U`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,1) FROM `‚s‚U`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,2) FROM `‚s‚U`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,3) FROM `‚s‚U`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,4) FROM `‚s‚U`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,5) FROM `‚s‚U`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,6) FROM `‚s‚U`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 0) FROM `‚s‚U`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 1) FROM `‚s‚U`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 2) FROM `‚s‚U`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 3) FROM `‚s‚U`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 4) FROM `‚s‚U`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 5) FROM `‚s‚U`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 6) FROM `‚s‚U`; + +#HEAP +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,0) FROM `‚s‚V`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1) FROM `‚s‚V`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,2) FROM `‚s‚V`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,3) FROM `‚s‚V`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,4) FROM `‚s‚V`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,5) FROM `‚s‚V`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,6) FROM `‚s‚V`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 0) FROM `‚s‚V`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1) FROM `‚s‚V`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 2) FROM `‚s‚V`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 3) FROM `‚s‚V`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 4) FROM `‚s‚V`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 5) FROM `‚s‚V`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 6) FROM `‚s‚V`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,0) FROM `‚s‚V`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,1) FROM `‚s‚V`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,2) FROM `‚s‚V`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,3) FROM `‚s‚V`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,4) FROM `‚s‚V`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,5) FROM `‚s‚V`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,6) FROM `‚s‚V`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 0) FROM `‚s‚V`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 1) FROM `‚s‚V`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 2) FROM `‚s‚V`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 3) FROM `‚s‚V`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 4) FROM `‚s‚V`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 5) FROM `‚s‚V`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 6) FROM `‚s‚V`; + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,0) FROM `‚s‚W`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1) FROM `‚s‚W`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,2) FROM `‚s‚W`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,3) FROM `‚s‚W`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,4) FROM `‚s‚W`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,5) FROM `‚s‚W`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,6) FROM `‚s‚W`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 0) FROM `‚s‚W`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1) FROM `‚s‚W`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 2) FROM `‚s‚W`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 3) FROM `‚s‚W`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 4) FROM `‚s‚W`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 5) FROM `‚s‚W`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 6) FROM `‚s‚W`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,0) FROM `‚s‚W`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,1) FROM `‚s‚W`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,2) FROM `‚s‚W`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,3) FROM `‚s‚W`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,4) FROM `‚s‚W`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,5) FROM `‚s‚W`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,6) FROM `‚s‚W`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 0) FROM `‚s‚W`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 1) FROM `‚s‚W`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 2) FROM `‚s‚W`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 3) FROM `‚s‚W`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 4) FROM `‚s‚W`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 5) FROM `‚s‚W`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 6) FROM `‚s‚W`; + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,0) FROM `‚s‚X`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1) FROM `‚s‚X`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,2) FROM `‚s‚X`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,3) FROM `‚s‚X`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,4) FROM `‚s‚X`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,5) FROM `‚s‚X`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,6) FROM `‚s‚X`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 0) FROM `‚s‚X`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1) FROM `‚s‚X`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 2) FROM `‚s‚X`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 3) FROM `‚s‚X`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 4) FROM `‚s‚X`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 5) FROM `‚s‚X`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 6) FROM `‚s‚X`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,0) FROM `‚s‚X`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,1) FROM `‚s‚X`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,2) FROM `‚s‚X`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,3) FROM `‚s‚X`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,4) FROM `‚s‚X`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,5) FROM `‚s‚X`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,6) FROM `‚s‚X`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 0) FROM `‚s‚X`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 1) FROM `‚s‚X`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 2) FROM `‚s‚X`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 3) FROM `‚s‚X`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 4) FROM `‚s‚X`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 5) FROM `‚s‚X`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 6) FROM `‚s‚X`; + +#BDB +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,0) FROM `‚s‚P‚O`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1) FROM `‚s‚P‚O`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,2) FROM `‚s‚P‚O`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,3) FROM `‚s‚P‚O`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,4) FROM `‚s‚P‚O`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,5) FROM `‚s‚P‚O`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,6) FROM `‚s‚P‚O`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 0) FROM `‚s‚P‚O`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1) FROM `‚s‚P‚O`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 2) FROM `‚s‚P‚O`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 3) FROM `‚s‚P‚O`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 4) FROM `‚s‚P‚O`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 5) FROM `‚s‚P‚O`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 6) FROM `‚s‚P‚O`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,0) FROM `‚s‚P‚O`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,1) FROM `‚s‚P‚O`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,2) FROM `‚s‚P‚O`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,3) FROM `‚s‚P‚O`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,4) FROM `‚s‚P‚O`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,5) FROM `‚s‚P‚O`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,6) FROM `‚s‚P‚O`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 0) FROM `‚s‚P‚O`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 1) FROM `‚s‚P‚O`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 2) FROM `‚s‚P‚O`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 3) FROM `‚s‚P‚O`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 4) FROM `‚s‚P‚O`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 5) FROM `‚s‚P‚O`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 6) FROM `‚s‚P‚O`; + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,0) FROM `‚s‚P‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1) FROM `‚s‚P‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,2) FROM `‚s‚P‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,3) FROM `‚s‚P‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,4) FROM `‚s‚P‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,5) FROM `‚s‚P‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,6) FROM `‚s‚P‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 0) FROM `‚s‚P‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1) FROM `‚s‚P‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 2) FROM `‚s‚P‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 3) FROM `‚s‚P‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 4) FROM `‚s‚P‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 5) FROM `‚s‚P‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 6) FROM `‚s‚P‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,0) FROM `‚s‚P‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,1) FROM `‚s‚P‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,2) FROM `‚s‚P‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,3) FROM `‚s‚P‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,4) FROM `‚s‚P‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,5) FROM `‚s‚P‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,6) FROM `‚s‚P‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 0) FROM `‚s‚P‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 1) FROM `‚s‚P‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 2) FROM `‚s‚P‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 3) FROM `‚s‚P‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 4) FROM `‚s‚P‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 5) FROM `‚s‚P‚P`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 6) FROM `‚s‚P‚P`; + +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,0) FROM `‚s‚P‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1) FROM `‚s‚P‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,2) FROM `‚s‚P‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,3) FROM `‚s‚P‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,4) FROM `‚s‚P‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,5) FROM `‚s‚P‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,6) FROM `‚s‚P‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 0) FROM `‚s‚P‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1) FROM `‚s‚P‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 2) FROM `‚s‚P‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 3) FROM `‚s‚P‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 4) FROM `‚s‚P‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 5) FROM `‚s‚P‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 6) FROM `‚s‚P‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,0) FROM `‚s‚P‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,1) FROM `‚s‚P‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,2) FROM `‚s‚P‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,3) FROM `‚s‚P‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,4) FROM `‚s‚P‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,5) FROM `‚s‚P‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P`,1,6) FROM `‚s‚P‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 0) FROM `‚s‚P‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 1) FROM `‚s‚P‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 2) FROM `‚s‚P‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 3) FROM `‚s‚P‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 4) FROM `‚s‚P‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 5) FROM `‚s‚P‚Q`; +SELECT `‚b‚P`, SUBSTRING(`‚b‚P` FROM 1 FOR 6) FROM `‚s‚P‚Q`; + +DROP TABLE `‚s‚P`; +DROP TABLE `‚s‚Q`; +DROP TABLE `‚s‚R`; +DROP TABLE `‚s‚S`; +DROP TABLE `‚s‚T`; +DROP TABLE `‚s‚U`; +DROP TABLE `‚s‚V`; +DROP TABLE `‚s‚W`; +DROP TABLE `‚s‚X`; +DROP TABLE `‚s‚P‚O`; +DROP TABLE `‚s‚P‚P`; +DROP TABLE `‚s‚P‚Q`; diff --git a/mysql-test/suite/jp/t/jp_substring_ucs2.test b/mysql-test/suite/jp/t/jp_substring_ucs2.test new file mode 100755 index 00000000000..f3cd5550072 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_substring_ucs2.test @@ -0,0 +1,418 @@ +--source include/have_ucs2.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +--enable_warnings + +# +# Test SUBSTRING() function with Japanese character in ucs2 encoding +# + +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; + +CREATE TABLE `£Ô£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; + +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); + +# Test of SUBSTRING(str,pos) and SUBSTRING(str FROM pos) +# is not available until the bug #5364 is fixed + +#InnoDB +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,0) FROM `£Ô£±`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1) FROM `£Ô£±`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,2) FROM `£Ô£±`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,3) FROM `£Ô£±`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,4) FROM `£Ô£±`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,5) FROM `£Ô£±`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,6) FROM `£Ô£±`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 0) FROM `£Ô£±`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1) FROM `£Ô£±`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 2) FROM `£Ô£±`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 3) FROM `£Ô£±`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 4) FROM `£Ô£±`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 5) FROM `£Ô£±`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 6) FROM `£Ô£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£±`; + +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,0) FROM `£Ô£²`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1) FROM `£Ô£²`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,2) FROM `£Ô£²`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,3) FROM `£Ô£²`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,4) FROM `£Ô£²`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,5) FROM `£Ô£²`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,6) FROM `£Ô£²`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 0) FROM `£Ô£²`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1) FROM `£Ô£²`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 2) FROM `£Ô£²`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 3) FROM `£Ô£²`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 4) FROM `£Ô£²`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 5) FROM `£Ô£²`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 6) FROM `£Ô£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£²`; + +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,0) FROM `£Ô£³`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1) FROM `£Ô£³`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,2) FROM `£Ô£³`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,3) FROM `£Ô£³`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,4) FROM `£Ô£³`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,5) FROM `£Ô£³`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,6) FROM `£Ô£³`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 0) FROM `£Ô£³`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1) FROM `£Ô£³`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 2) FROM `£Ô£³`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 3) FROM `£Ô£³`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 4) FROM `£Ô£³`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 5) FROM `£Ô£³`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 6) FROM `£Ô£³`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£³`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£³`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£³`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£³`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£³`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£³`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£³`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£³`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£³`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£³`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£³`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£³`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£³`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£³`; + +#MyISAM +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,0) FROM `£Ô£´`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1) FROM `£Ô£´`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,2) FROM `£Ô£´`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,3) FROM `£Ô£´`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,4) FROM `£Ô£´`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,5) FROM `£Ô£´`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,6) FROM `£Ô£´`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 0) FROM `£Ô£´`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1) FROM `£Ô£´`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 2) FROM `£Ô£´`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 3) FROM `£Ô£´`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 4) FROM `£Ô£´`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 5) FROM `£Ô£´`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 6) FROM `£Ô£´`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£´`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£´`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£´`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£´`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£´`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£´`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£´`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£´`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£´`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£´`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£´`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£´`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£´`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£´`; + +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,0) FROM `£Ô£µ`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1) FROM `£Ô£µ`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,2) FROM `£Ô£µ`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,3) FROM `£Ô£µ`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,4) FROM `£Ô£µ`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,5) FROM `£Ô£µ`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,6) FROM `£Ô£µ`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 0) FROM `£Ô£µ`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1) FROM `£Ô£µ`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 2) FROM `£Ô£µ`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 3) FROM `£Ô£µ`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 4) FROM `£Ô£µ`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 5) FROM `£Ô£µ`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 6) FROM `£Ô£µ`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£µ`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£µ`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£µ`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£µ`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£µ`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£µ`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£µ`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£µ`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£µ`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£µ`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£µ`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£µ`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£µ`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£µ`; + +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,0) FROM `£Ô£¶`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1) FROM `£Ô£¶`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,2) FROM `£Ô£¶`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,3) FROM `£Ô£¶`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,4) FROM `£Ô£¶`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,5) FROM `£Ô£¶`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,6) FROM `£Ô£¶`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 0) FROM `£Ô£¶`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1) FROM `£Ô£¶`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 2) FROM `£Ô£¶`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 3) FROM `£Ô£¶`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 4) FROM `£Ô£¶`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 5) FROM `£Ô£¶`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 6) FROM `£Ô£¶`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£¶`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£¶`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£¶`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£¶`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£¶`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£¶`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£¶`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£¶`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£¶`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£¶`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£¶`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£¶`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£¶`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£¶`; + +#HEAP +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,0) FROM `£Ô£·`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1) FROM `£Ô£·`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,2) FROM `£Ô£·`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,3) FROM `£Ô£·`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,4) FROM `£Ô£·`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,5) FROM `£Ô£·`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,6) FROM `£Ô£·`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 0) FROM `£Ô£·`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1) FROM `£Ô£·`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 2) FROM `£Ô£·`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 3) FROM `£Ô£·`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 4) FROM `£Ô£·`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 5) FROM `£Ô£·`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 6) FROM `£Ô£·`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£·`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£·`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£·`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£·`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£·`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£·`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£·`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£·`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£·`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£·`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£·`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£·`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£·`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£·`; + +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,0) FROM `£Ô£¸`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1) FROM `£Ô£¸`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,2) FROM `£Ô£¸`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,3) FROM `£Ô£¸`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,4) FROM `£Ô£¸`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,5) FROM `£Ô£¸`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,6) FROM `£Ô£¸`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 0) FROM `£Ô£¸`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1) FROM `£Ô£¸`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 2) FROM `£Ô£¸`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 3) FROM `£Ô£¸`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 4) FROM `£Ô£¸`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 5) FROM `£Ô£¸`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 6) FROM `£Ô£¸`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£¸`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£¸`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£¸`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£¸`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£¸`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£¸`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£¸`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£¸`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£¸`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£¸`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£¸`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£¸`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£¸`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£¸`; + +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,0) FROM `£Ô£¹`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1) FROM `£Ô£¹`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,2) FROM `£Ô£¹`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,3) FROM `£Ô£¹`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,4) FROM `£Ô£¹`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,5) FROM `£Ô£¹`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,6) FROM `£Ô£¹`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 0) FROM `£Ô£¹`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1) FROM `£Ô£¹`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 2) FROM `£Ô£¹`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 3) FROM `£Ô£¹`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 4) FROM `£Ô£¹`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 5) FROM `£Ô£¹`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 6) FROM `£Ô£¹`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£¹`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£¹`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£¹`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£¹`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£¹`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£¹`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£¹`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£¹`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£¹`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£¹`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£¹`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£¹`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£¹`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£¹`; + +#BDB +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,0) FROM `£Ô£±£°`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1) FROM `£Ô£±£°`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,2) FROM `£Ô£±£°`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,3) FROM `£Ô£±£°`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,4) FROM `£Ô£±£°`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,5) FROM `£Ô£±£°`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,6) FROM `£Ô£±£°`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 0) FROM `£Ô£±£°`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1) FROM `£Ô£±£°`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 2) FROM `£Ô£±£°`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 3) FROM `£Ô£±£°`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 4) FROM `£Ô£±£°`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 5) FROM `£Ô£±£°`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 6) FROM `£Ô£±£°`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£±£°`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£±£°`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£±£°`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£±£°`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£±£°`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£±£°`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£±£°`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£±£°`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£±£°`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£±£°`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£±£°`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£±£°`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£±£°`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£±£°`; + +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,0) FROM `£Ô£±£±`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1) FROM `£Ô£±£±`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,2) FROM `£Ô£±£±`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,3) FROM `£Ô£±£±`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,4) FROM `£Ô£±£±`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,5) FROM `£Ô£±£±`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,6) FROM `£Ô£±£±`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 0) FROM `£Ô£±£±`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1) FROM `£Ô£±£±`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 2) FROM `£Ô£±£±`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 3) FROM `£Ô£±£±`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 4) FROM `£Ô£±£±`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 5) FROM `£Ô£±£±`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 6) FROM `£Ô£±£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£±£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£±£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£±£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£±£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£±£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£±£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£±£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£±£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£±£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£±£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£±£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£±£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£±£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£±£±`; + +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,0) FROM `£Ô£±£²`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1) FROM `£Ô£±£²`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,2) FROM `£Ô£±£²`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,3) FROM `£Ô£±£²`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,4) FROM `£Ô£±£²`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,5) FROM `£Ô£±£²`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,6) FROM `£Ô£±£²`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 0) FROM `£Ô£±£²`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1) FROM `£Ô£±£²`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 2) FROM `£Ô£±£²`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 3) FROM `£Ô£±£²`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 4) FROM `£Ô£±£²`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 5) FROM `£Ô£±£²`; +#SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 6) FROM `£Ô£±£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£±£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£±£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£±£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£±£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£±£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£±£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£±£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£±£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£±£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£±£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£±£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£±£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£±£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£±£²`; + +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/t/jp_substring_ujis.test b/mysql-test/suite/jp/t/jp_substring_ujis.test new file mode 100755 index 00000000000..c201c7148da --- /dev/null +++ b/mysql-test/suite/jp/t/jp_substring_ujis.test @@ -0,0 +1,414 @@ +--source include/have_ujis.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +--enable_warnings + +# +# Test SUBSTRING() function with Japanese character in ujis encoding +# + +SET NAMES ujis; +SET character_set_database = ujis; + +CREATE TABLE `£Ô£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; + +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'),('ޱ޲޳޴'),('ޱ޲޳'),('ޱ޲'),('ޱ'),(''); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'),('¤¢¤¤¤¦¤¨'),('¤¢¤¤¤¦'),('¤¢¤¤'),('¤¢'),(''); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'),('íÜíÝíÞíß'),('íÜíÝíÞ'),('íÜíÝ'),('íÜ'),(''); + +#InnoDB +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,0) FROM `£Ô£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1) FROM `£Ô£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,2) FROM `£Ô£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,3) FROM `£Ô£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,4) FROM `£Ô£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,5) FROM `£Ô£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,6) FROM `£Ô£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 0) FROM `£Ô£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1) FROM `£Ô£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 2) FROM `£Ô£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 3) FROM `£Ô£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 4) FROM `£Ô£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 5) FROM `£Ô£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 6) FROM `£Ô£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£±`; + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,0) FROM `£Ô£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1) FROM `£Ô£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,2) FROM `£Ô£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,3) FROM `£Ô£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,4) FROM `£Ô£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,5) FROM `£Ô£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,6) FROM `£Ô£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 0) FROM `£Ô£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1) FROM `£Ô£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 2) FROM `£Ô£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 3) FROM `£Ô£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 4) FROM `£Ô£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 5) FROM `£Ô£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 6) FROM `£Ô£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£²`; + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,0) FROM `£Ô£³`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1) FROM `£Ô£³`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,2) FROM `£Ô£³`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,3) FROM `£Ô£³`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,4) FROM `£Ô£³`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,5) FROM `£Ô£³`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,6) FROM `£Ô£³`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 0) FROM `£Ô£³`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1) FROM `£Ô£³`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 2) FROM `£Ô£³`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 3) FROM `£Ô£³`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 4) FROM `£Ô£³`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 5) FROM `£Ô£³`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 6) FROM `£Ô£³`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£³`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£³`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£³`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£³`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£³`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£³`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£³`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£³`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£³`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£³`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£³`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£³`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£³`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£³`; + +#MyISAM +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,0) FROM `£Ô£´`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1) FROM `£Ô£´`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,2) FROM `£Ô£´`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,3) FROM `£Ô£´`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,4) FROM `£Ô£´`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,5) FROM `£Ô£´`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,6) FROM `£Ô£´`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 0) FROM `£Ô£´`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1) FROM `£Ô£´`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 2) FROM `£Ô£´`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 3) FROM `£Ô£´`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 4) FROM `£Ô£´`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 5) FROM `£Ô£´`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 6) FROM `£Ô£´`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£´`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£´`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£´`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£´`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£´`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£´`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£´`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£´`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£´`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£´`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£´`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£´`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£´`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£´`; + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,0) FROM `£Ô£µ`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1) FROM `£Ô£µ`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,2) FROM `£Ô£µ`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,3) FROM `£Ô£µ`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,4) FROM `£Ô£µ`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,5) FROM `£Ô£µ`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,6) FROM `£Ô£µ`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 0) FROM `£Ô£µ`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1) FROM `£Ô£µ`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 2) FROM `£Ô£µ`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 3) FROM `£Ô£µ`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 4) FROM `£Ô£µ`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 5) FROM `£Ô£µ`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 6) FROM `£Ô£µ`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£µ`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£µ`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£µ`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£µ`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£µ`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£µ`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£µ`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£µ`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£µ`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£µ`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£µ`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£µ`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£µ`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£µ`; + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,0) FROM `£Ô£¶`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1) FROM `£Ô£¶`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,2) FROM `£Ô£¶`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,3) FROM `£Ô£¶`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,4) FROM `£Ô£¶`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,5) FROM `£Ô£¶`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,6) FROM `£Ô£¶`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 0) FROM `£Ô£¶`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1) FROM `£Ô£¶`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 2) FROM `£Ô£¶`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 3) FROM `£Ô£¶`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 4) FROM `£Ô£¶`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 5) FROM `£Ô£¶`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 6) FROM `£Ô£¶`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£¶`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£¶`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£¶`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£¶`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£¶`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£¶`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£¶`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£¶`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£¶`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£¶`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£¶`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£¶`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£¶`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£¶`; + +#HEAP +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,0) FROM `£Ô£·`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1) FROM `£Ô£·`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,2) FROM `£Ô£·`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,3) FROM `£Ô£·`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,4) FROM `£Ô£·`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,5) FROM `£Ô£·`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,6) FROM `£Ô£·`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 0) FROM `£Ô£·`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1) FROM `£Ô£·`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 2) FROM `£Ô£·`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 3) FROM `£Ô£·`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 4) FROM `£Ô£·`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 5) FROM `£Ô£·`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 6) FROM `£Ô£·`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£·`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£·`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£·`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£·`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£·`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£·`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£·`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£·`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£·`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£·`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£·`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£·`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£·`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£·`; + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,0) FROM `£Ô£¸`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1) FROM `£Ô£¸`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,2) FROM `£Ô£¸`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,3) FROM `£Ô£¸`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,4) FROM `£Ô£¸`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,5) FROM `£Ô£¸`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,6) FROM `£Ô£¸`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 0) FROM `£Ô£¸`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1) FROM `£Ô£¸`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 2) FROM `£Ô£¸`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 3) FROM `£Ô£¸`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 4) FROM `£Ô£¸`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 5) FROM `£Ô£¸`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 6) FROM `£Ô£¸`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£¸`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£¸`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£¸`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£¸`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£¸`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£¸`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£¸`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£¸`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£¸`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£¸`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£¸`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£¸`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£¸`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£¸`; + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,0) FROM `£Ô£¹`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1) FROM `£Ô£¹`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,2) FROM `£Ô£¹`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,3) FROM `£Ô£¹`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,4) FROM `£Ô£¹`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,5) FROM `£Ô£¹`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,6) FROM `£Ô£¹`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 0) FROM `£Ô£¹`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1) FROM `£Ô£¹`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 2) FROM `£Ô£¹`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 3) FROM `£Ô£¹`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 4) FROM `£Ô£¹`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 5) FROM `£Ô£¹`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 6) FROM `£Ô£¹`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£¹`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£¹`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£¹`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£¹`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£¹`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£¹`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£¹`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£¹`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£¹`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£¹`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£¹`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£¹`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£¹`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£¹`; + +#BDB +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,0) FROM `£Ô£±£°`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1) FROM `£Ô£±£°`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,2) FROM `£Ô£±£°`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,3) FROM `£Ô£±£°`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,4) FROM `£Ô£±£°`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,5) FROM `£Ô£±£°`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,6) FROM `£Ô£±£°`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 0) FROM `£Ô£±£°`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1) FROM `£Ô£±£°`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 2) FROM `£Ô£±£°`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 3) FROM `£Ô£±£°`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 4) FROM `£Ô£±£°`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 5) FROM `£Ô£±£°`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 6) FROM `£Ô£±£°`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£±£°`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£±£°`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£±£°`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£±£°`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£±£°`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£±£°`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£±£°`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£±£°`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£±£°`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£±£°`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£±£°`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£±£°`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£±£°`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£±£°`; + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,0) FROM `£Ô£±£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1) FROM `£Ô£±£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,2) FROM `£Ô£±£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,3) FROM `£Ô£±£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,4) FROM `£Ô£±£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,5) FROM `£Ô£±£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,6) FROM `£Ô£±£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 0) FROM `£Ô£±£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1) FROM `£Ô£±£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 2) FROM `£Ô£±£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 3) FROM `£Ô£±£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 4) FROM `£Ô£±£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 5) FROM `£Ô£±£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 6) FROM `£Ô£±£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£±£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£±£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£±£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£±£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£±£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£±£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£±£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£±£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£±£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£±£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£±£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£±£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£±£±`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£±£±`; + +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,0) FROM `£Ô£±£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1) FROM `£Ô£±£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,2) FROM `£Ô£±£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,3) FROM `£Ô£±£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,4) FROM `£Ô£±£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,5) FROM `£Ô£±£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,6) FROM `£Ô£±£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 0) FROM `£Ô£±£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1) FROM `£Ô£±£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 2) FROM `£Ô£±£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 3) FROM `£Ô£±£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 4) FROM `£Ô£±£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 5) FROM `£Ô£±£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 6) FROM `£Ô£±£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,0) FROM `£Ô£±£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,1) FROM `£Ô£±£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,2) FROM `£Ô£±£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,3) FROM `£Ô£±£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,4) FROM `£Ô£±£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,5) FROM `£Ô£±£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±`,1,6) FROM `£Ô£±£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 0) FROM `£Ô£±£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 1) FROM `£Ô£±£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 2) FROM `£Ô£±£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 3) FROM `£Ô£±£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 4) FROM `£Ô£±£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 5) FROM `£Ô£±£²`; +SELECT `£Ã£±`, SUBSTRING(`£Ã£±` FROM 1 FOR 6) FROM `£Ô£±£²`; + +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/t/jp_substring_utf8.test b/mysql-test/suite/jp/t/jp_substring_utf8.test new file mode 100755 index 00000000000..9f88115c899 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_substring_utf8.test @@ -0,0 +1,412 @@ +--disable_warnings +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +drop table if exists `T11`; +drop table if exists `T12`; +--enable_warnings + +# +# Test SUBSTRING() function with Japanese character in utf8 encoding +# + +SET NAMES utf8; +SET character_set_database = utf8; + +CREATE TABLE `T1` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T11` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T12` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; + +INSERT INTO `T1` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `T3` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); +INSERT INTO `T1ï¼` VALUES ('アイウエオ'),('アイウエ'),('アイウ'),('アイ'),('ï½±'),(''); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠ'),('ã‚ã„ã†ãˆ'),('ã‚ã„ã†'),('ã‚ã„'),('ã‚'),(''); +INSERT INTO `T12` VALUES ('龔龖龗龞龡'),('龔龖龗龞'),('龔龖龗'),('龔龖'),('é¾”'),(''); + +#InnoDB +SELECT `C1`, SUBSTRING(`C1`,0) FROM `T1`; +SELECT `C1`, SUBSTRING(`C1`,1) FROM `T1`; +SELECT `C1`, SUBSTRING(`C1`,2) FROM `T1`; +SELECT `C1`, SUBSTRING(`C1`,3) FROM `T1`; +SELECT `C1`, SUBSTRING(`C1`,4) FROM `T1`; +SELECT `C1`, SUBSTRING(`C1`,5) FROM `T1`; +SELECT `C1`, SUBSTRING(`C1`,6) FROM `T1`; +SELECT `C1`, SUBSTRING(`C1` FROM 0) FROM `T1`; +SELECT `C1`, SUBSTRING(`C1` FROM 1) FROM `T1`; +SELECT `C1`, SUBSTRING(`C1` FROM 2) FROM `T1`; +SELECT `C1`, SUBSTRING(`C1` FROM 3) FROM `T1`; +SELECT `C1`, SUBSTRING(`C1` FROM 4) FROM `T1`; +SELECT `C1`, SUBSTRING(`C1` FROM 5) FROM `T1`; +SELECT `C1`, SUBSTRING(`C1` FROM 6) FROM `T1`; +SELECT `C1`, SUBSTRING(`C1`,1,0) FROM `T1`; +SELECT `C1`, SUBSTRING(`C1`,1,1) FROM `T1`; +SELECT `C1`, SUBSTRING(`C1`,1,2) FROM `T1`; +SELECT `C1`, SUBSTRING(`C1`,1,3) FROM `T1`; +SELECT `C1`, SUBSTRING(`C1`,1,4) FROM `T1`; +SELECT `C1`, SUBSTRING(`C1`,1,5) FROM `T1`; +SELECT `C1`, SUBSTRING(`C1`,1,6) FROM `T1`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 0) FROM `T1`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 1) FROM `T1`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 2) FROM `T1`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 3) FROM `T1`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 4) FROM `T1`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 5) FROM `T1`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 6) FROM `T1`; + +SELECT `C1`, SUBSTRING(`C1`,0) FROM `ï¼´ï¼’`; +SELECT `C1`, SUBSTRING(`C1`,1) FROM `ï¼´ï¼’`; +SELECT `C1`, SUBSTRING(`C1`,2) FROM `ï¼´ï¼’`; +SELECT `C1`, SUBSTRING(`C1`,3) FROM `ï¼´ï¼’`; +SELECT `C1`, SUBSTRING(`C1`,4) FROM `ï¼´ï¼’`; +SELECT `C1`, SUBSTRING(`C1`,5) FROM `ï¼´ï¼’`; +SELECT `C1`, SUBSTRING(`C1`,6) FROM `ï¼´ï¼’`; +SELECT `C1`, SUBSTRING(`C1` FROM 0) FROM `ï¼´ï¼’`; +SELECT `C1`, SUBSTRING(`C1` FROM 1) FROM `ï¼´ï¼’`; +SELECT `C1`, SUBSTRING(`C1` FROM 2) FROM `ï¼´ï¼’`; +SELECT `C1`, SUBSTRING(`C1` FROM 3) FROM `ï¼´ï¼’`; +SELECT `C1`, SUBSTRING(`C1` FROM 4) FROM `ï¼´ï¼’`; +SELECT `C1`, SUBSTRING(`C1` FROM 5) FROM `ï¼´ï¼’`; +SELECT `C1`, SUBSTRING(`C1` FROM 6) FROM `ï¼´ï¼’`; +SELECT `C1`, SUBSTRING(`C1`,1,0) FROM `ï¼´ï¼’`; +SELECT `C1`, SUBSTRING(`C1`,1,1) FROM `ï¼´ï¼’`; +SELECT `C1`, SUBSTRING(`C1`,1,2) FROM `ï¼´ï¼’`; +SELECT `C1`, SUBSTRING(`C1`,1,3) FROM `ï¼´ï¼’`; +SELECT `C1`, SUBSTRING(`C1`,1,4) FROM `ï¼´ï¼’`; +SELECT `C1`, SUBSTRING(`C1`,1,5) FROM `ï¼´ï¼’`; +SELECT `C1`, SUBSTRING(`C1`,1,6) FROM `ï¼´ï¼’`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 0) FROM `ï¼´ï¼’`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 1) FROM `ï¼´ï¼’`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 2) FROM `ï¼´ï¼’`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 3) FROM `ï¼´ï¼’`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 4) FROM `ï¼´ï¼’`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 5) FROM `ï¼´ï¼’`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 6) FROM `ï¼´ï¼’`; + +SELECT `C1`, SUBSTRING(`C1`,0) FROM `T3`; +SELECT `C1`, SUBSTRING(`C1`,1) FROM `T3`; +SELECT `C1`, SUBSTRING(`C1`,2) FROM `T3`; +SELECT `C1`, SUBSTRING(`C1`,3) FROM `T3`; +SELECT `C1`, SUBSTRING(`C1`,4) FROM `T3`; +SELECT `C1`, SUBSTRING(`C1`,5) FROM `T3`; +SELECT `C1`, SUBSTRING(`C1`,6) FROM `T3`; +SELECT `C1`, SUBSTRING(`C1` FROM 0) FROM `T3`; +SELECT `C1`, SUBSTRING(`C1` FROM 1) FROM `T3`; +SELECT `C1`, SUBSTRING(`C1` FROM 2) FROM `T3`; +SELECT `C1`, SUBSTRING(`C1` FROM 3) FROM `T3`; +SELECT `C1`, SUBSTRING(`C1` FROM 4) FROM `T3`; +SELECT `C1`, SUBSTRING(`C1` FROM 5) FROM `T3`; +SELECT `C1`, SUBSTRING(`C1` FROM 6) FROM `T3`; +SELECT `C1`, SUBSTRING(`C1`,1,0) FROM `T3`; +SELECT `C1`, SUBSTRING(`C1`,1,1) FROM `T3`; +SELECT `C1`, SUBSTRING(`C1`,1,2) FROM `T3`; +SELECT `C1`, SUBSTRING(`C1`,1,3) FROM `T3`; +SELECT `C1`, SUBSTRING(`C1`,1,4) FROM `T3`; +SELECT `C1`, SUBSTRING(`C1`,1,5) FROM `T3`; +SELECT `C1`, SUBSTRING(`C1`,1,6) FROM `T3`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 0) FROM `T3`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 1) FROM `T3`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 2) FROM `T3`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 3) FROM `T3`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 4) FROM `T3`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 5) FROM `T3`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 6) FROM `T3`; + +#MyISAM +SELECT `C1`, SUBSTRING(`C1`,0) FROM `ï¼´ï¼”`; +SELECT `C1`, SUBSTRING(`C1`,1) FROM `ï¼´ï¼”`; +SELECT `C1`, SUBSTRING(`C1`,2) FROM `ï¼´ï¼”`; +SELECT `C1`, SUBSTRING(`C1`,3) FROM `ï¼´ï¼”`; +SELECT `C1`, SUBSTRING(`C1`,4) FROM `ï¼´ï¼”`; +SELECT `C1`, SUBSTRING(`C1`,5) FROM `ï¼´ï¼”`; +SELECT `C1`, SUBSTRING(`C1`,6) FROM `ï¼´ï¼”`; +SELECT `C1`, SUBSTRING(`C1` FROM 0) FROM `ï¼´ï¼”`; +SELECT `C1`, SUBSTRING(`C1` FROM 1) FROM `ï¼´ï¼”`; +SELECT `C1`, SUBSTRING(`C1` FROM 2) FROM `ï¼´ï¼”`; +SELECT `C1`, SUBSTRING(`C1` FROM 3) FROM `ï¼´ï¼”`; +SELECT `C1`, SUBSTRING(`C1` FROM 4) FROM `ï¼´ï¼”`; +SELECT `C1`, SUBSTRING(`C1` FROM 5) FROM `ï¼´ï¼”`; +SELECT `C1`, SUBSTRING(`C1` FROM 6) FROM `ï¼´ï¼”`; +SELECT `C1`, SUBSTRING(`C1`,1,0) FROM `ï¼´ï¼”`; +SELECT `C1`, SUBSTRING(`C1`,1,1) FROM `ï¼´ï¼”`; +SELECT `C1`, SUBSTRING(`C1`,1,2) FROM `ï¼´ï¼”`; +SELECT `C1`, SUBSTRING(`C1`,1,3) FROM `ï¼´ï¼”`; +SELECT `C1`, SUBSTRING(`C1`,1,4) FROM `ï¼´ï¼”`; +SELECT `C1`, SUBSTRING(`C1`,1,5) FROM `ï¼´ï¼”`; +SELECT `C1`, SUBSTRING(`C1`,1,6) FROM `ï¼´ï¼”`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 0) FROM `ï¼´ï¼”`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 1) FROM `ï¼´ï¼”`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 2) FROM `ï¼´ï¼”`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 3) FROM `ï¼´ï¼”`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 4) FROM `ï¼´ï¼”`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 5) FROM `ï¼´ï¼”`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 6) FROM `ï¼´ï¼”`; + +SELECT `C1`, SUBSTRING(`C1`,0) FROM `T5`; +SELECT `C1`, SUBSTRING(`C1`,1) FROM `T5`; +SELECT `C1`, SUBSTRING(`C1`,2) FROM `T5`; +SELECT `C1`, SUBSTRING(`C1`,3) FROM `T5`; +SELECT `C1`, SUBSTRING(`C1`,4) FROM `T5`; +SELECT `C1`, SUBSTRING(`C1`,5) FROM `T5`; +SELECT `C1`, SUBSTRING(`C1`,6) FROM `T5`; +SELECT `C1`, SUBSTRING(`C1` FROM 0) FROM `T5`; +SELECT `C1`, SUBSTRING(`C1` FROM 1) FROM `T5`; +SELECT `C1`, SUBSTRING(`C1` FROM 2) FROM `T5`; +SELECT `C1`, SUBSTRING(`C1` FROM 3) FROM `T5`; +SELECT `C1`, SUBSTRING(`C1` FROM 4) FROM `T5`; +SELECT `C1`, SUBSTRING(`C1` FROM 5) FROM `T5`; +SELECT `C1`, SUBSTRING(`C1` FROM 6) FROM `T5`; +SELECT `C1`, SUBSTRING(`C1`,1,0) FROM `T5`; +SELECT `C1`, SUBSTRING(`C1`,1,1) FROM `T5`; +SELECT `C1`, SUBSTRING(`C1`,1,2) FROM `T5`; +SELECT `C1`, SUBSTRING(`C1`,1,3) FROM `T5`; +SELECT `C1`, SUBSTRING(`C1`,1,4) FROM `T5`; +SELECT `C1`, SUBSTRING(`C1`,1,5) FROM `T5`; +SELECT `C1`, SUBSTRING(`C1`,1,6) FROM `T5`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 0) FROM `T5`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 1) FROM `T5`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 2) FROM `T5`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 3) FROM `T5`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 4) FROM `T5`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 5) FROM `T5`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 6) FROM `T5`; + +SELECT `C1`, SUBSTRING(`C1`,0) FROM `ï¼´ï¼–`; +SELECT `C1`, SUBSTRING(`C1`,1) FROM `ï¼´ï¼–`; +SELECT `C1`, SUBSTRING(`C1`,2) FROM `ï¼´ï¼–`; +SELECT `C1`, SUBSTRING(`C1`,3) FROM `ï¼´ï¼–`; +SELECT `C1`, SUBSTRING(`C1`,4) FROM `ï¼´ï¼–`; +SELECT `C1`, SUBSTRING(`C1`,5) FROM `ï¼´ï¼–`; +SELECT `C1`, SUBSTRING(`C1`,6) FROM `ï¼´ï¼–`; +SELECT `C1`, SUBSTRING(`C1` FROM 0) FROM `ï¼´ï¼–`; +SELECT `C1`, SUBSTRING(`C1` FROM 1) FROM `ï¼´ï¼–`; +SELECT `C1`, SUBSTRING(`C1` FROM 2) FROM `ï¼´ï¼–`; +SELECT `C1`, SUBSTRING(`C1` FROM 3) FROM `ï¼´ï¼–`; +SELECT `C1`, SUBSTRING(`C1` FROM 4) FROM `ï¼´ï¼–`; +SELECT `C1`, SUBSTRING(`C1` FROM 5) FROM `ï¼´ï¼–`; +SELECT `C1`, SUBSTRING(`C1` FROM 6) FROM `ï¼´ï¼–`; +SELECT `C1`, SUBSTRING(`C1`,1,0) FROM `ï¼´ï¼–`; +SELECT `C1`, SUBSTRING(`C1`,1,1) FROM `ï¼´ï¼–`; +SELECT `C1`, SUBSTRING(`C1`,1,2) FROM `ï¼´ï¼–`; +SELECT `C1`, SUBSTRING(`C1`,1,3) FROM `ï¼´ï¼–`; +SELECT `C1`, SUBSTRING(`C1`,1,4) FROM `ï¼´ï¼–`; +SELECT `C1`, SUBSTRING(`C1`,1,5) FROM `ï¼´ï¼–`; +SELECT `C1`, SUBSTRING(`C1`,1,6) FROM `ï¼´ï¼–`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 0) FROM `ï¼´ï¼–`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 1) FROM `ï¼´ï¼–`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 2) FROM `ï¼´ï¼–`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 3) FROM `ï¼´ï¼–`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 4) FROM `ï¼´ï¼–`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 5) FROM `ï¼´ï¼–`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 6) FROM `ï¼´ï¼–`; + +#HEAP +SELECT `C1`, SUBSTRING(`C1`,0) FROM `ï¼´ï¼—`; +SELECT `C1`, SUBSTRING(`C1`,1) FROM `ï¼´ï¼—`; +SELECT `C1`, SUBSTRING(`C1`,2) FROM `ï¼´ï¼—`; +SELECT `C1`, SUBSTRING(`C1`,3) FROM `ï¼´ï¼—`; +SELECT `C1`, SUBSTRING(`C1`,4) FROM `ï¼´ï¼—`; +SELECT `C1`, SUBSTRING(`C1`,5) FROM `ï¼´ï¼—`; +SELECT `C1`, SUBSTRING(`C1`,6) FROM `ï¼´ï¼—`; +SELECT `C1`, SUBSTRING(`C1` FROM 0) FROM `ï¼´ï¼—`; +SELECT `C1`, SUBSTRING(`C1` FROM 1) FROM `ï¼´ï¼—`; +SELECT `C1`, SUBSTRING(`C1` FROM 2) FROM `ï¼´ï¼—`; +SELECT `C1`, SUBSTRING(`C1` FROM 3) FROM `ï¼´ï¼—`; +SELECT `C1`, SUBSTRING(`C1` FROM 4) FROM `ï¼´ï¼—`; +SELECT `C1`, SUBSTRING(`C1` FROM 5) FROM `ï¼´ï¼—`; +SELECT `C1`, SUBSTRING(`C1` FROM 6) FROM `ï¼´ï¼—`; +SELECT `C1`, SUBSTRING(`C1`,1,0) FROM `ï¼´ï¼—`; +SELECT `C1`, SUBSTRING(`C1`,1,1) FROM `ï¼´ï¼—`; +SELECT `C1`, SUBSTRING(`C1`,1,2) FROM `ï¼´ï¼—`; +SELECT `C1`, SUBSTRING(`C1`,1,3) FROM `ï¼´ï¼—`; +SELECT `C1`, SUBSTRING(`C1`,1,4) FROM `ï¼´ï¼—`; +SELECT `C1`, SUBSTRING(`C1`,1,5) FROM `ï¼´ï¼—`; +SELECT `C1`, SUBSTRING(`C1`,1,6) FROM `ï¼´ï¼—`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 0) FROM `ï¼´ï¼—`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 1) FROM `ï¼´ï¼—`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 2) FROM `ï¼´ï¼—`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 3) FROM `ï¼´ï¼—`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 4) FROM `ï¼´ï¼—`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 5) FROM `ï¼´ï¼—`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 6) FROM `ï¼´ï¼—`; + +SELECT `C1`, SUBSTRING(`C1`,0) FROM `T8`; +SELECT `C1`, SUBSTRING(`C1`,1) FROM `T8`; +SELECT `C1`, SUBSTRING(`C1`,2) FROM `T8`; +SELECT `C1`, SUBSTRING(`C1`,3) FROM `T8`; +SELECT `C1`, SUBSTRING(`C1`,4) FROM `T8`; +SELECT `C1`, SUBSTRING(`C1`,5) FROM `T8`; +SELECT `C1`, SUBSTRING(`C1`,6) FROM `T8`; +SELECT `C1`, SUBSTRING(`C1` FROM 0) FROM `T8`; +SELECT `C1`, SUBSTRING(`C1` FROM 1) FROM `T8`; +SELECT `C1`, SUBSTRING(`C1` FROM 2) FROM `T8`; +SELECT `C1`, SUBSTRING(`C1` FROM 3) FROM `T8`; +SELECT `C1`, SUBSTRING(`C1` FROM 4) FROM `T8`; +SELECT `C1`, SUBSTRING(`C1` FROM 5) FROM `T8`; +SELECT `C1`, SUBSTRING(`C1` FROM 6) FROM `T8`; +SELECT `C1`, SUBSTRING(`C1`,1,0) FROM `T8`; +SELECT `C1`, SUBSTRING(`C1`,1,1) FROM `T8`; +SELECT `C1`, SUBSTRING(`C1`,1,2) FROM `T8`; +SELECT `C1`, SUBSTRING(`C1`,1,3) FROM `T8`; +SELECT `C1`, SUBSTRING(`C1`,1,4) FROM `T8`; +SELECT `C1`, SUBSTRING(`C1`,1,5) FROM `T8`; +SELECT `C1`, SUBSTRING(`C1`,1,6) FROM `T8`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 0) FROM `T8`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 1) FROM `T8`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 2) FROM `T8`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 3) FROM `T8`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 4) FROM `T8`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 5) FROM `T8`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 6) FROM `T8`; + +SELECT `C1`, SUBSTRING(`C1`,0) FROM `ï¼´ï¼™`; +SELECT `C1`, SUBSTRING(`C1`,1) FROM `ï¼´ï¼™`; +SELECT `C1`, SUBSTRING(`C1`,2) FROM `ï¼´ï¼™`; +SELECT `C1`, SUBSTRING(`C1`,3) FROM `ï¼´ï¼™`; +SELECT `C1`, SUBSTRING(`C1`,4) FROM `ï¼´ï¼™`; +SELECT `C1`, SUBSTRING(`C1`,5) FROM `ï¼´ï¼™`; +SELECT `C1`, SUBSTRING(`C1`,6) FROM `ï¼´ï¼™`; +SELECT `C1`, SUBSTRING(`C1` FROM 0) FROM `ï¼´ï¼™`; +SELECT `C1`, SUBSTRING(`C1` FROM 1) FROM `ï¼´ï¼™`; +SELECT `C1`, SUBSTRING(`C1` FROM 2) FROM `ï¼´ï¼™`; +SELECT `C1`, SUBSTRING(`C1` FROM 3) FROM `ï¼´ï¼™`; +SELECT `C1`, SUBSTRING(`C1` FROM 4) FROM `ï¼´ï¼™`; +SELECT `C1`, SUBSTRING(`C1` FROM 5) FROM `ï¼´ï¼™`; +SELECT `C1`, SUBSTRING(`C1` FROM 6) FROM `ï¼´ï¼™`; +SELECT `C1`, SUBSTRING(`C1`,1,0) FROM `ï¼´ï¼™`; +SELECT `C1`, SUBSTRING(`C1`,1,1) FROM `ï¼´ï¼™`; +SELECT `C1`, SUBSTRING(`C1`,1,2) FROM `ï¼´ï¼™`; +SELECT `C1`, SUBSTRING(`C1`,1,3) FROM `ï¼´ï¼™`; +SELECT `C1`, SUBSTRING(`C1`,1,4) FROM `ï¼´ï¼™`; +SELECT `C1`, SUBSTRING(`C1`,1,5) FROM `ï¼´ï¼™`; +SELECT `C1`, SUBSTRING(`C1`,1,6) FROM `ï¼´ï¼™`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 0) FROM `ï¼´ï¼™`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 1) FROM `ï¼´ï¼™`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 2) FROM `ï¼´ï¼™`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 3) FROM `ï¼´ï¼™`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 4) FROM `ï¼´ï¼™`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 5) FROM `ï¼´ï¼™`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 6) FROM `ï¼´ï¼™`; + +#BDB +SELECT `C1`, SUBSTRING(`C1`,0) FROM `T1ï¼`; +SELECT `C1`, SUBSTRING(`C1`,1) FROM `T1ï¼`; +SELECT `C1`, SUBSTRING(`C1`,2) FROM `T1ï¼`; +SELECT `C1`, SUBSTRING(`C1`,3) FROM `T1ï¼`; +SELECT `C1`, SUBSTRING(`C1`,4) FROM `T1ï¼`; +SELECT `C1`, SUBSTRING(`C1`,5) FROM `T1ï¼`; +SELECT `C1`, SUBSTRING(`C1`,6) FROM `T1ï¼`; +SELECT `C1`, SUBSTRING(`C1` FROM 0) FROM `T1ï¼`; +SELECT `C1`, SUBSTRING(`C1` FROM 1) FROM `T1ï¼`; +SELECT `C1`, SUBSTRING(`C1` FROM 2) FROM `T1ï¼`; +SELECT `C1`, SUBSTRING(`C1` FROM 3) FROM `T1ï¼`; +SELECT `C1`, SUBSTRING(`C1` FROM 4) FROM `T1ï¼`; +SELECT `C1`, SUBSTRING(`C1` FROM 5) FROM `T1ï¼`; +SELECT `C1`, SUBSTRING(`C1` FROM 6) FROM `T1ï¼`; +SELECT `C1`, SUBSTRING(`C1`,1,0) FROM `T1ï¼`; +SELECT `C1`, SUBSTRING(`C1`,1,1) FROM `T1ï¼`; +SELECT `C1`, SUBSTRING(`C1`,1,2) FROM `T1ï¼`; +SELECT `C1`, SUBSTRING(`C1`,1,3) FROM `T1ï¼`; +SELECT `C1`, SUBSTRING(`C1`,1,4) FROM `T1ï¼`; +SELECT `C1`, SUBSTRING(`C1`,1,5) FROM `T1ï¼`; +SELECT `C1`, SUBSTRING(`C1`,1,6) FROM `T1ï¼`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 0) FROM `T1ï¼`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 1) FROM `T1ï¼`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 2) FROM `T1ï¼`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 3) FROM `T1ï¼`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 4) FROM `T1ï¼`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 5) FROM `T1ï¼`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 6) FROM `T1ï¼`; + +SELECT `C1`, SUBSTRING(`C1`,0) FROM `T11`; +SELECT `C1`, SUBSTRING(`C1`,1) FROM `T11`; +SELECT `C1`, SUBSTRING(`C1`,2) FROM `T11`; +SELECT `C1`, SUBSTRING(`C1`,3) FROM `T11`; +SELECT `C1`, SUBSTRING(`C1`,4) FROM `T11`; +SELECT `C1`, SUBSTRING(`C1`,5) FROM `T11`; +SELECT `C1`, SUBSTRING(`C1`,6) FROM `T11`; +SELECT `C1`, SUBSTRING(`C1` FROM 0) FROM `T11`; +SELECT `C1`, SUBSTRING(`C1` FROM 1) FROM `T11`; +SELECT `C1`, SUBSTRING(`C1` FROM 2) FROM `T11`; +SELECT `C1`, SUBSTRING(`C1` FROM 3) FROM `T11`; +SELECT `C1`, SUBSTRING(`C1` FROM 4) FROM `T11`; +SELECT `C1`, SUBSTRING(`C1` FROM 5) FROM `T11`; +SELECT `C1`, SUBSTRING(`C1` FROM 6) FROM `T11`; +SELECT `C1`, SUBSTRING(`C1`,1,0) FROM `T11`; +SELECT `C1`, SUBSTRING(`C1`,1,1) FROM `T11`; +SELECT `C1`, SUBSTRING(`C1`,1,2) FROM `T11`; +SELECT `C1`, SUBSTRING(`C1`,1,3) FROM `T11`; +SELECT `C1`, SUBSTRING(`C1`,1,4) FROM `T11`; +SELECT `C1`, SUBSTRING(`C1`,1,5) FROM `T11`; +SELECT `C1`, SUBSTRING(`C1`,1,6) FROM `T11`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 0) FROM `T11`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 1) FROM `T11`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 2) FROM `T11`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 3) FROM `T11`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 4) FROM `T11`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 5) FROM `T11`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 6) FROM `T11`; + +SELECT `C1`, SUBSTRING(`C1`,0) FROM `T12`; +SELECT `C1`, SUBSTRING(`C1`,1) FROM `T12`; +SELECT `C1`, SUBSTRING(`C1`,2) FROM `T12`; +SELECT `C1`, SUBSTRING(`C1`,3) FROM `T12`; +SELECT `C1`, SUBSTRING(`C1`,4) FROM `T12`; +SELECT `C1`, SUBSTRING(`C1`,5) FROM `T12`; +SELECT `C1`, SUBSTRING(`C1`,6) FROM `T12`; +SELECT `C1`, SUBSTRING(`C1` FROM 0) FROM `T12`; +SELECT `C1`, SUBSTRING(`C1` FROM 1) FROM `T12`; +SELECT `C1`, SUBSTRING(`C1` FROM 2) FROM `T12`; +SELECT `C1`, SUBSTRING(`C1` FROM 3) FROM `T12`; +SELECT `C1`, SUBSTRING(`C1` FROM 4) FROM `T12`; +SELECT `C1`, SUBSTRING(`C1` FROM 5) FROM `T12`; +SELECT `C1`, SUBSTRING(`C1` FROM 6) FROM `T12`; +SELECT `C1`, SUBSTRING(`C1`,1,0) FROM `T12`; +SELECT `C1`, SUBSTRING(`C1`,1,1) FROM `T12`; +SELECT `C1`, SUBSTRING(`C1`,1,2) FROM `T12`; +SELECT `C1`, SUBSTRING(`C1`,1,3) FROM `T12`; +SELECT `C1`, SUBSTRING(`C1`,1,4) FROM `T12`; +SELECT `C1`, SUBSTRING(`C1`,1,5) FROM `T12`; +SELECT `C1`, SUBSTRING(`C1`,1,6) FROM `T12`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 0) FROM `T12`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 1) FROM `T12`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 2) FROM `T12`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 3) FROM `T12`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 4) FROM `T12`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 5) FROM `T12`; +SELECT `C1`, SUBSTRING(`C1` FROM 1 FOR 6) FROM `T12`; + +DROP TABLE `T1`; +DROP TABLE `ï¼´ï¼’`; +DROP TABLE `T3`; +DROP TABLE `ï¼´ï¼”`; +DROP TABLE `T5`; +DROP TABLE `ï¼´ï¼–`; +DROP TABLE `ï¼´ï¼—`; +DROP TABLE `T8`; +DROP TABLE `ï¼´ï¼™`; +DROP TABLE `T1ï¼`; +DROP TABLE `T11`; +DROP TABLE `T12`; diff --git a/mysql-test/suite/jp/t/jp_trim_sjis.test b/mysql-test/suite/jp/t/jp_trim_sjis.test new file mode 100755 index 00000000000..0f6821605ed --- /dev/null +++ b/mysql-test/suite/jp/t/jp_trim_sjis.test @@ -0,0 +1,219 @@ +--character_set sjis +--disable_warnings +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +--enable_warnings + +# +# Test TRIM() function with Japanese characters sjis encoding +# + +SET NAMES sjis; +SET character_set_database = sjis; + +CREATE TABLE `‚s‚P` (`‚b‚P` char(12), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Q` (`‚b‚P` char(12), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚R` (`‚b‚P` char(12), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚S` (`‚b‚P` char(12), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚T` (`‚b‚P` char(12), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚U` (`‚b‚P` char(12), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚V` (`‚b‚P` char(12), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚W` (`‚b‚P` char(12), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚X` (`‚b‚P` char(12), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚O` (`‚b‚P` char(12), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚P` (`‚b‚P` char(12), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚Q` (`‚b‚P` char(12), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; + +# Nothing to trim +INSERT INTO `‚s‚P` VALUES ('±²³´µ'); +# Test data for TRIM(TRAILING [remstr] FROM str) +INSERT INTO `‚s‚P` VALUES ('±²³´µ¶'); +INSERT INTO `‚s‚P` VALUES ('±²³´µ¶¶'); +INSERT INTO `‚s‚P` VALUES ('±²³´µ¶¶¶'); +# Test data for TRIM(LEADING [remstr] FROM str) +INSERT INTO `‚s‚P` VALUES ('¶±²³´µ'); +INSERT INTO `‚s‚P` VALUES ('¶¶±²³´µ'); +INSERT INTO `‚s‚P` VALUES ('¶¶¶±²³´µ'); +# Test data for TRIM(BOTH [remstr] FROM str) +INSERT INTO `‚s‚P` VALUES ('¶¶¶±²³´µ¶¶¶'); +# Test data for TRIM without [remstr] (remove spaces) +INSERT INTO `‚s‚P` VALUES (' ±²³´µ '); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨‚©'); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨‚©‚©'); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨‚©‚©‚©'); +INSERT INTO `‚s‚Q` VALUES ('‚©‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚Q` VALUES ('‚©‚©‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚Q` VALUES ('‚©‚©‚©‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚Q` VALUES ('‚©‚©‚©‚ ‚¢‚¤‚¦‚¨‚©‚©‚©'); +INSERT INTO `‚s‚Q` VALUES (' ‚ ‚¢‚¤‚¦‚¨ '); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\–\'); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\–\–\'); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\–\–\–\'); +INSERT INTO `‚s‚R` VALUES ('–\ƒ\\•\—\\'); +INSERT INTO `‚s‚R` VALUES ('–\–\ƒ\\•\—\\'); +INSERT INTO `‚s‚R` VALUES ('–\–\–\ƒ\\•\—\\'); +INSERT INTO `‚s‚R` VALUES ('–\–\–\ƒ\\•\—\\–\–\–\'); +INSERT INTO `‚s‚R` VALUES (' ƒ\\•\—\\ '); + +INSERT INTO `‚s‚S` VALUES ('±²³´µ'); +INSERT INTO `‚s‚S` VALUES ('±²³´µ¶'); +INSERT INTO `‚s‚S` VALUES ('±²³´µ¶¶'); +INSERT INTO `‚s‚S` VALUES ('±²³´µ¶¶¶'); +INSERT INTO `‚s‚S` VALUES ('¶±²³´µ'); +INSERT INTO `‚s‚S` VALUES ('¶¶±²³´µ'); +INSERT INTO `‚s‚S` VALUES ('¶¶¶±²³´µ'); +INSERT INTO `‚s‚S` VALUES ('¶¶¶±²³´µ¶¶¶'); +INSERT INTO `‚s‚S` VALUES (' ±²³´µ '); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨‚©'); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨‚©‚©'); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨‚©‚©‚©'); +INSERT INTO `‚s‚T` VALUES ('‚©‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚T` VALUES ('‚©‚©‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚T` VALUES ('‚©‚©‚©‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚T` VALUES ('‚©‚©‚©‚ ‚¢‚¤‚¦‚¨‚©‚©‚©'); +INSERT INTO `‚s‚T` VALUES (' ‚ ‚¢‚¤‚¦‚¨ '); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\–\'); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\–\–\'); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\–\–\–\'); +INSERT INTO `‚s‚U` VALUES ('–\ƒ\\•\—\\'); +INSERT INTO `‚s‚U` VALUES ('–\–\ƒ\\•\—\\'); +INSERT INTO `‚s‚U` VALUES ('–\–\–\ƒ\\•\—\\'); +INSERT INTO `‚s‚U` VALUES ('–\–\–\ƒ\\•\—\\–\–\–\'); +INSERT INTO `‚s‚U` VALUES (' ƒ\\•\—\\ '); + +INSERT INTO `‚s‚V` VALUES ('±²³´µ'); +INSERT INTO `‚s‚V` VALUES ('±²³´µ¶'); +INSERT INTO `‚s‚V` VALUES ('±²³´µ¶¶'); +INSERT INTO `‚s‚V` VALUES ('±²³´µ¶¶¶'); +INSERT INTO `‚s‚V` VALUES ('¶±²³´µ'); +INSERT INTO `‚s‚V` VALUES ('¶¶±²³´µ'); +INSERT INTO `‚s‚V` VALUES ('¶¶¶±²³´µ'); +INSERT INTO `‚s‚V` VALUES ('¶¶¶±²³´µ¶¶¶'); +INSERT INTO `‚s‚V` VALUES (' ±²³´µ '); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨‚©'); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨‚©‚©'); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨‚©‚©‚©'); +INSERT INTO `‚s‚W` VALUES ('‚©‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚W` VALUES ('‚©‚©‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚W` VALUES ('‚©‚©‚©‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚W` VALUES ('‚©‚©‚©‚ ‚¢‚¤‚¦‚¨‚©‚©‚©'); +INSERT INTO `‚s‚W` VALUES (' ‚ ‚¢‚¤‚¦‚¨ '); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\–\'); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\–\–\'); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\–\–\–\'); +INSERT INTO `‚s‚X` VALUES ('–\ƒ\\•\—\\'); +INSERT INTO `‚s‚X` VALUES ('–\–\ƒ\\•\—\\'); +INSERT INTO `‚s‚X` VALUES ('–\–\–\ƒ\\•\—\\'); +INSERT INTO `‚s‚X` VALUES ('–\–\–\ƒ\\•\—\\–\–\–\'); +INSERT INTO `‚s‚X` VALUES (' ƒ\\•\—\\ '); + +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ'); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ¶'); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ¶¶'); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ¶¶¶'); +INSERT INTO `‚s‚P‚O` VALUES ('¶±²³´µ'); +INSERT INTO `‚s‚P‚O` VALUES ('¶¶±²³´µ'); +INSERT INTO `‚s‚P‚O` VALUES ('¶¶¶±²³´µ'); +INSERT INTO `‚s‚P‚O` VALUES ('¶¶¶±²³´µ¶¶¶'); +INSERT INTO `‚s‚P‚O` VALUES (' ±²³´µ '); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨‚©'); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨‚©‚©'); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨‚©‚©‚©'); +INSERT INTO `‚s‚P‚P` VALUES ('‚©‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚P‚P` VALUES ('‚©‚©‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚P‚P` VALUES ('‚©‚©‚©‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚P‚P` VALUES ('‚©‚©‚©‚ ‚¢‚¤‚¦‚¨‚©‚©‚©'); +INSERT INTO `‚s‚P‚P` VALUES (' ‚ ‚¢‚¤‚¦‚¨ '); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\–\'); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\–\–\'); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\–\–\–\'); +INSERT INTO `‚s‚P‚Q` VALUES ('–\ƒ\\•\—\\'); +INSERT INTO `‚s‚P‚Q` VALUES ('–\–\ƒ\\•\—\\'); +INSERT INTO `‚s‚P‚Q` VALUES ('–\–\–\ƒ\\•\—\\'); +INSERT INTO `‚s‚P‚Q` VALUES ('–\–\–\ƒ\\•\—\\–\–\–\'); +INSERT INTO `‚s‚P‚Q` VALUES (' ƒ\\•\—\\ '); + +#InnoDB +SELECT `‚b‚P`,TRIM(TRAILING '¶' FROM `‚b‚P`) FROM `‚s‚P`; +SELECT `‚b‚P`,TRIM(LEADING '¶' FROM `‚b‚P`) FROM `‚s‚P`; +SELECT `‚b‚P`,TRIM(BOTH '¶' FROM `‚b‚P`) FROM `‚s‚P`; +SELECT `‚b‚P`,TRIM(`‚b‚P`) FROM `‚s‚P`; +SELECT `‚b‚P`,TRIM(TRAILING '‚©' FROM `‚b‚P`) FROM `‚s‚Q`; +SELECT `‚b‚P`,TRIM(LEADING '‚©' FROM `‚b‚P`) FROM `‚s‚Q`; +SELECT `‚b‚P`,TRIM(BOTH '‚©' FROM `‚b‚P`) FROM `‚s‚Q`; +SELECT `‚b‚P`,TRIM(`‚b‚P`) FROM `‚s‚Q`; +SELECT `‚b‚P`,TRIM(TRAILING '–\'FROM `‚b‚P`) FROM `‚s‚R`; +SELECT `‚b‚P`,TRIM(LEADING '–\' FROM `‚b‚P`) FROM `‚s‚R`; +SELECT `‚b‚P`,TRIM(BOTH '–\' FROM `‚b‚P`) FROM `‚s‚R`; +SELECT `‚b‚P`,TRIM(`‚b‚P`) FROM `‚s‚R`; + +#MyISAM +SELECT `‚b‚P`,TRIM(TRAILING '¶' FROM `‚b‚P`) FROM `‚s‚S`; +SELECT `‚b‚P`,TRIM(LEADING '¶' FROM `‚b‚P`) FROM `‚s‚S`; +SELECT `‚b‚P`,TRIM(BOTH '¶' FROM `‚b‚P`) FROM `‚s‚S`; +SELECT `‚b‚P`,TRIM(`‚b‚P`) FROM `‚s‚S`; +SELECT `‚b‚P`,TRIM(TRAILING '‚©' FROM `‚b‚P`) FROM `‚s‚T`; +SELECT `‚b‚P`,TRIM(LEADING '‚©' FROM `‚b‚P`) FROM `‚s‚T`; +SELECT `‚b‚P`,TRIM(BOTH '‚©' FROM `‚b‚P`) FROM `‚s‚T`; +SELECT `‚b‚P`,TRIM(`‚b‚P`) FROM `‚s‚T`; +SELECT `‚b‚P`,TRIM(TRAILING '–\' FROM `‚b‚P`) FROM `‚s‚U`; +SELECT `‚b‚P`,TRIM(LEADING '–\' FROM `‚b‚P`) FROM `‚s‚U`; +SELECT `‚b‚P`,TRIM(BOTH '–\' FROM `‚b‚P`) FROM `‚s‚U`; +SELECT `‚b‚P`,TRIM(`‚b‚P`) FROM `‚s‚U`; + +#HEAP +SELECT `‚b‚P`,TRIM(TRAILING '¶' FROM `‚b‚P`) FROM `‚s‚V`; +SELECT `‚b‚P`,TRIM(LEADING '¶' FROM `‚b‚P`) FROM `‚s‚V`; +SELECT `‚b‚P`,TRIM(BOTH '¶' FROM `‚b‚P`) FROM `‚s‚V`; +SELECT `‚b‚P`,TRIM(`‚b‚P`) FROM `‚s‚V`; +SELECT `‚b‚P`,TRIM(TRAILING '‚©' FROM `‚b‚P`) FROM `‚s‚W`; +SELECT `‚b‚P`,TRIM(LEADING '‚©' FROM `‚b‚P`) FROM `‚s‚W`; +SELECT `‚b‚P`,TRIM(BOTH '‚©' FROM `‚b‚P`) FROM `‚s‚W`; +SELECT `‚b‚P`,TRIM(`‚b‚P`) FROM `‚s‚W`; +SELECT `‚b‚P`,TRIM(TRAILING '–\' FROM `‚b‚P`) FROM `‚s‚X`; +SELECT `‚b‚P`,TRIM(LEADING '–\' FROM `‚b‚P`) FROM `‚s‚X`; +SELECT `‚b‚P`,TRIM(BOTH '–\' FROM `‚b‚P`) FROM `‚s‚X`; +SELECT `‚b‚P`,TRIM(`‚b‚P`) FROM `‚s‚X`; + +#BDB +SELECT `‚b‚P`,TRIM(TRAILING '¶' FROM `‚b‚P`) FROM `‚s‚P‚O`; +SELECT `‚b‚P`,TRIM(LEADING '¶' FROM `‚b‚P`) FROM `‚s‚P‚O`; +SELECT `‚b‚P`,TRIM(BOTH '¶' FROM `‚b‚P`) FROM `‚s‚P‚O`; +SELECT `‚b‚P`,TRIM(`‚b‚P`) FROM `‚s‚P‚O`; +SELECT `‚b‚P`,TRIM(TRAILING '‚©' FROM `‚b‚P`) FROM `‚s‚P‚P`; +SELECT `‚b‚P`,TRIM(LEADING '‚©' FROM `‚b‚P`) FROM `‚s‚P‚P`; +SELECT `‚b‚P`,TRIM(BOTH '‚©' FROM `‚b‚P`) FROM `‚s‚P‚P`; +SELECT `‚b‚P`,TRIM(`‚b‚P`) FROM `‚s‚P‚P`; +SELECT `‚b‚P`,TRIM(TRAILING '–\' FROM `‚b‚P`) FROM `‚s‚P‚Q`; +SELECT `‚b‚P`,TRIM(LEADING '–\' FROM `‚b‚P`) FROM `‚s‚P‚Q`; +SELECT `‚b‚P`,TRIM(BOTH '–\' FROM `‚b‚P`) FROM `‚s‚P‚Q`; +SELECT `‚b‚P`,TRIM(`‚b‚P`) FROM `‚s‚P‚Q`; + +DROP TABLE `‚s‚P`; +DROP TABLE `‚s‚Q`; +DROP TABLE `‚s‚R`; +DROP TABLE `‚s‚S`; +DROP TABLE `‚s‚T`; +DROP TABLE `‚s‚U`; +DROP TABLE `‚s‚V`; +DROP TABLE `‚s‚W`; +DROP TABLE `‚s‚X`; +DROP TABLE `‚s‚P‚O`; +DROP TABLE `‚s‚P‚P`; +DROP TABLE `‚s‚P‚Q`; diff --git a/mysql-test/suite/jp/t/jp_trim_ucs2.test b/mysql-test/suite/jp/t/jp_trim_ucs2.test new file mode 100755 index 00000000000..1d8a12650e0 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_trim_ucs2.test @@ -0,0 +1,221 @@ +--source include/have_ucs2.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +--enable_warnings + +# +# Test TRIM() function with Japanese characters ucs2 encoding +# + +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; + +CREATE TABLE `£Ô£±` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; + +# Nothing to trim +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'); +# Test data for TRIM(TRAILING [remstr] FROM str) +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵޶'); +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵޶޶'); +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵޶޶޶'); +# Test data for TRIM(LEADING [remstr] FROM str) +INSERT INTO `£Ô£±` VALUES ('޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£±` VALUES ('޶޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£±` VALUES ('޶޶޶ޱ޲޳޴޵'); +# Test data for TRIM(BOTH [remstr] FROM str) +INSERT INTO `£Ô£±` VALUES ('޶޶޶ޱ޲޳޴޵޶޶޶'); +# Test data for TRIM without [remstr] (remove spaces) +INSERT INTO `£Ô£±` VALUES (' ޱ޲޳޴޵ '); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«¤«'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«¤«¤«'); +INSERT INTO `£Ô£²` VALUES ('¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£²` VALUES ('¤«¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£²` VALUES ('¤«¤«¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£²` VALUES ('¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤«'); +INSERT INTO `£Ô£²` VALUES (' ¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà°¡'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà°¡°¡'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà°¡°¡°¡'); +INSERT INTO `£Ô£³` VALUES ('°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£³` VALUES ('°¡°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£³` VALUES ('°¡°¡°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£³` VALUES ('°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡'); +INSERT INTO `£Ô£³` VALUES (' íÜíÝíÞíßíà '); + +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵޶'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵޶޶'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵޶޶޶'); +INSERT INTO `£Ô£´` VALUES ('޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£´` VALUES ('޶޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£´` VALUES ('޶޶޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£´` VALUES ('޶޶޶ޱ޲޳޴޵޶޶޶'); +INSERT INTO `£Ô£´` VALUES (' ޱ޲޳޴޵ '); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«¤«'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«¤«¤«'); +INSERT INTO `£Ô£µ` VALUES ('¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£µ` VALUES ('¤«¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£µ` VALUES ('¤«¤«¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£µ` VALUES ('¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤«'); +INSERT INTO `£Ô£µ` VALUES (' ¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà°¡'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà°¡°¡'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà°¡°¡°¡'); +INSERT INTO `£Ô£¶` VALUES ('°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¶` VALUES ('°¡°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¶` VALUES ('°¡°¡°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¶` VALUES ('°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡'); +INSERT INTO `£Ô£¶` VALUES (' íÜíÝíÞíßíà '); + +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵޶'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵޶޶'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵޶޶޶'); +INSERT INTO `£Ô£·` VALUES ('޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£·` VALUES ('޶޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£·` VALUES ('޶޶޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£·` VALUES ('޶޶޶ޱ޲޳޴޵޶޶޶'); +INSERT INTO `£Ô£·` VALUES (' ޱ޲޳޴޵ '); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«¤«'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«¤«¤«'); +INSERT INTO `£Ô£¸` VALUES ('¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¸` VALUES ('¤«¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¸` VALUES ('¤«¤«¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¸` VALUES ('¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤«'); +INSERT INTO `£Ô£¸` VALUES (' ¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà°¡'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà°¡°¡'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà°¡°¡°¡'); +INSERT INTO `£Ô£¹` VALUES ('°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¹` VALUES ('°¡°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¹` VALUES ('°¡°¡°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¹` VALUES ('°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡'); +INSERT INTO `£Ô£¹` VALUES (' íÜíÝíÞíßíà '); + +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵޶'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵޶޶'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵޶޶޶'); +INSERT INTO `£Ô£±£°` VALUES ('޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£°` VALUES ('޶޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£°` VALUES ('޶޶޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£°` VALUES ('޶޶޶ޱ޲޳޴޵޶޶޶'); +INSERT INTO `£Ô£±£°` VALUES (' ޱ޲޳޴޵ '); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«¤«'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«¤«¤«'); +INSERT INTO `£Ô£±£±` VALUES ('¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£±` VALUES ('¤«¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£±` VALUES ('¤«¤«¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£±` VALUES ('¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤«'); +INSERT INTO `£Ô£±£±` VALUES (' ¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà°¡'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà°¡°¡'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà°¡°¡°¡'); +INSERT INTO `£Ô£±£²` VALUES ('°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£²` VALUES ('°¡°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£²` VALUES ('°¡°¡°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£²` VALUES ('°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡'); +INSERT INTO `£Ô£±£²` VALUES (' íÜíÝíÞíßíà '); + +#InnoDB +SELECT `£Ã£±`,TRIM(TRAILING '޶' FROM `£Ã£±`) FROM `£Ô£±`; +SELECT `£Ã£±`,TRIM(LEADING '޶' FROM `£Ã£±`) FROM `£Ô£±`; +SELECT `£Ã£±`,TRIM(BOTH '޶' FROM `£Ã£±`) FROM `£Ô£±`; +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£±`; +SELECT `£Ã£±`,TRIM(TRAILING '¤«' FROM `£Ã£±`) FROM `£Ô£²`; +SELECT `£Ã£±`,TRIM(LEADING '¤«' FROM `£Ã£±`) FROM `£Ô£²`; +SELECT `£Ã£±`,TRIM(BOTH '¤«' FROM `£Ã£±`) FROM `£Ô£²`; +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£²`; +SELECT `£Ã£±`,TRIM(TRAILING '°¡'FROM `£Ã£±`) FROM `£Ô£³`; +SELECT `£Ã£±`,TRIM(LEADING '°¡' FROM `£Ã£±`) FROM `£Ô£³`; +SELECT `£Ã£±`,TRIM(BOTH '°¡' FROM `£Ã£±`) FROM `£Ô£³`; +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£³`; + +#MyISAM +SELECT `£Ã£±`,TRIM(TRAILING '޶' FROM `£Ã£±`) FROM `£Ô£´`; +SELECT `£Ã£±`,TRIM(LEADING '޶' FROM `£Ã£±`) FROM `£Ô£´`; +SELECT `£Ã£±`,TRIM(BOTH '޶' FROM `£Ã£±`) FROM `£Ô£´`; +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£´`; +SELECT `£Ã£±`,TRIM(TRAILING '¤«' FROM `£Ã£±`) FROM `£Ô£µ`; +SELECT `£Ã£±`,TRIM(LEADING '¤«' FROM `£Ã£±`) FROM `£Ô£µ`; +SELECT `£Ã£±`,TRIM(BOTH '¤«' FROM `£Ã£±`) FROM `£Ô£µ`; +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£µ`; +SELECT `£Ã£±`,TRIM(TRAILING '°¡' FROM `£Ã£±`) FROM `£Ô£¶`; +SELECT `£Ã£±`,TRIM(LEADING '°¡' FROM `£Ã£±`) FROM `£Ô£¶`; +SELECT `£Ã£±`,TRIM(BOTH '°¡' FROM `£Ã£±`) FROM `£Ô£¶`; +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£¶`; + +#HEAP +SELECT `£Ã£±`,TRIM(TRAILING '޶' FROM `£Ã£±`) FROM `£Ô£·`; +SELECT `£Ã£±`,TRIM(LEADING '޶' FROM `£Ã£±`) FROM `£Ô£·`; +SELECT `£Ã£±`,TRIM(BOTH '޶' FROM `£Ã£±`) FROM `£Ô£·`; +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£·`; +SELECT `£Ã£±`,TRIM(TRAILING '¤«' FROM `£Ã£±`) FROM `£Ô£¸`; +SELECT `£Ã£±`,TRIM(LEADING '¤«' FROM `£Ã£±`) FROM `£Ô£¸`; +SELECT `£Ã£±`,TRIM(BOTH '¤«' FROM `£Ã£±`) FROM `£Ô£¸`; +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£¸`; +SELECT `£Ã£±`,TRIM(TRAILING '°¡' FROM `£Ã£±`) FROM `£Ô£¹`; +SELECT `£Ã£±`,TRIM(LEADING '°¡' FROM `£Ã£±`) FROM `£Ô£¹`; +SELECT `£Ã£±`,TRIM(BOTH '°¡' FROM `£Ã£±`) FROM `£Ô£¹`; +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£¹`; + +#BDB +SELECT `£Ã£±`,TRIM(TRAILING '޶' FROM `£Ã£±`) FROM `£Ô£±£°`; +SELECT `£Ã£±`,TRIM(LEADING '޶' FROM `£Ã£±`) FROM `£Ô£±£°`; +SELECT `£Ã£±`,TRIM(BOTH '޶' FROM `£Ã£±`) FROM `£Ô£±£°`; +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£±£°`; +SELECT `£Ã£±`,TRIM(TRAILING '¤«' FROM `£Ã£±`) FROM `£Ô£±£±`; +SELECT `£Ã£±`,TRIM(LEADING '¤«' FROM `£Ã£±`) FROM `£Ô£±£±`; +SELECT `£Ã£±`,TRIM(BOTH '¤«' FROM `£Ã£±`) FROM `£Ô£±£±`; +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£±£±`; +SELECT `£Ã£±`,TRIM(TRAILING '°¡' FROM `£Ã£±`) FROM `£Ô£±£²`; +SELECT `£Ã£±`,TRIM(LEADING '°¡' FROM `£Ã£±`) FROM `£Ô£±£²`; +SELECT `£Ã£±`,TRIM(BOTH '°¡' FROM `£Ã£±`) FROM `£Ô£±£²`; +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£±£²`; + +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/t/jp_trim_ujis.test b/mysql-test/suite/jp/t/jp_trim_ujis.test new file mode 100755 index 00000000000..de401217fcf --- /dev/null +++ b/mysql-test/suite/jp/t/jp_trim_ujis.test @@ -0,0 +1,220 @@ +--source include/have_ujis.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +--enable_warnings + +# +# Test TRIM() function with Japanese characters ujis encoding +# + +SET NAMES ujis; +SET character_set_database = ujis; + +CREATE TABLE `£Ô£±` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(12), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; + +# Nothing to trim +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'); +# Test data for TRIM(TRAILING [remstr] FROM str) +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵޶'); +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵޶޶'); +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵޶޶޶'); +# Test data for TRIM(LEADING [remstr] FROM str) +INSERT INTO `£Ô£±` VALUES ('޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£±` VALUES ('޶޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£±` VALUES ('޶޶޶ޱ޲޳޴޵'); +# Test data for TRIM(BOTH [remstr] FROM str) +INSERT INTO `£Ô£±` VALUES ('޶޶޶ޱ޲޳޴޵޶޶޶'); +# Test data for TRIM without [remstr] (remove spaces) +INSERT INTO `£Ô£±` VALUES (' ޱ޲޳޴޵ '); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«¤«'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«¤«¤«'); +INSERT INTO `£Ô£²` VALUES ('¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£²` VALUES ('¤«¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£²` VALUES ('¤«¤«¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£²` VALUES ('¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤«'); +INSERT INTO `£Ô£²` VALUES (' ¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà°¡'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà°¡°¡'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà°¡°¡°¡'); +INSERT INTO `£Ô£³` VALUES ('°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£³` VALUES ('°¡°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£³` VALUES ('°¡°¡°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£³` VALUES ('°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡'); +INSERT INTO `£Ô£³` VALUES (' íÜíÝíÞíßíà '); + +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵޶'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵޶޶'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵޶޶޶'); +INSERT INTO `£Ô£´` VALUES ('޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£´` VALUES ('޶޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£´` VALUES ('޶޶޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£´` VALUES ('޶޶޶ޱ޲޳޴޵޶޶޶'); +INSERT INTO `£Ô£´` VALUES (' ޱ޲޳޴޵ '); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«¤«'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«¤«¤«'); +INSERT INTO `£Ô£µ` VALUES ('¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£µ` VALUES ('¤«¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£µ` VALUES ('¤«¤«¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£µ` VALUES ('¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤«'); +INSERT INTO `£Ô£µ` VALUES (' ¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà°¡'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà°¡°¡'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà°¡°¡°¡'); +INSERT INTO `£Ô£¶` VALUES ('°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¶` VALUES ('°¡°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¶` VALUES ('°¡°¡°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¶` VALUES ('°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡'); +INSERT INTO `£Ô£¶` VALUES (' íÜíÝíÞíßíà '); + +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵޶'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵޶޶'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵޶޶޶'); +INSERT INTO `£Ô£·` VALUES ('޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£·` VALUES ('޶޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£·` VALUES ('޶޶޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£·` VALUES ('޶޶޶ޱ޲޳޴޵޶޶޶'); +INSERT INTO `£Ô£·` VALUES (' ޱ޲޳޴޵ '); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«¤«'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«¤«¤«'); +INSERT INTO `£Ô£¸` VALUES ('¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¸` VALUES ('¤«¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¸` VALUES ('¤«¤«¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¸` VALUES ('¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤«'); +INSERT INTO `£Ô£¸` VALUES (' ¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà°¡'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà°¡°¡'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà°¡°¡°¡'); +INSERT INTO `£Ô£¹` VALUES ('°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¹` VALUES ('°¡°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¹` VALUES ('°¡°¡°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£¹` VALUES ('°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡'); +INSERT INTO `£Ô£¹` VALUES (' íÜíÝíÞíßíà '); + +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵޶'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵޶޶'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵޶޶޶'); +INSERT INTO `£Ô£±£°` VALUES ('޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£°` VALUES ('޶޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£°` VALUES ('޶޶޶ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£°` VALUES ('޶޶޶ޱ޲޳޴޵޶޶޶'); +INSERT INTO `£Ô£±£°` VALUES (' ޱ޲޳޴޵ '); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«¤«'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª¤«¤«¤«'); +INSERT INTO `£Ô£±£±` VALUES ('¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£±` VALUES ('¤«¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£±` VALUES ('¤«¤«¤«¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£±` VALUES ('¤«¤«¤«¤¢¤¤¤¦¤¨¤ª¤«¤«¤«'); +INSERT INTO `£Ô£±£±` VALUES (' ¤¢¤¤¤¦¤¨¤ª '); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà°¡'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà°¡°¡'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà°¡°¡°¡'); +INSERT INTO `£Ô£±£²` VALUES ('°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£²` VALUES ('°¡°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£²` VALUES ('°¡°¡°¡íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£²` VALUES ('°¡°¡°¡íÜíÝíÞíßíà°¡°¡°¡'); +INSERT INTO `£Ô£±£²` VALUES (' íÜíÝíÞíßíà '); + +#InnoDB +SELECT `£Ã£±`,TRIM(TRAILING '޶' FROM `£Ã£±`) FROM `£Ô£±`; +SELECT `£Ã£±`,TRIM(LEADING '޶' FROM `£Ã£±`) FROM `£Ô£±`; +SELECT `£Ã£±`,TRIM(BOTH '޶' FROM `£Ã£±`) FROM `£Ô£±`; +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£±`; +SELECT `£Ã£±`,TRIM(TRAILING '¤«' FROM `£Ã£±`) FROM `£Ô£²`; +SELECT `£Ã£±`,TRIM(LEADING '¤«' FROM `£Ã£±`) FROM `£Ô£²`; +SELECT `£Ã£±`,TRIM(BOTH '¤«' FROM `£Ã£±`) FROM `£Ô£²`; +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£²`; +SELECT `£Ã£±`,TRIM(TRAILING '°¡'FROM `£Ã£±`) FROM `£Ô£³`; +SELECT `£Ã£±`,TRIM(LEADING '°¡' FROM `£Ã£±`) FROM `£Ô£³`; +SELECT `£Ã£±`,TRIM(BOTH '°¡' FROM `£Ã£±`) FROM `£Ô£³`; +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£³`; + +#MyISAM +SELECT `£Ã£±`,TRIM(TRAILING '޶' FROM `£Ã£±`) FROM `£Ô£´`; +SELECT `£Ã£±`,TRIM(LEADING '޶' FROM `£Ã£±`) FROM `£Ô£´`; +SELECT `£Ã£±`,TRIM(BOTH '޶' FROM `£Ã£±`) FROM `£Ô£´`; +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£´`; +SELECT `£Ã£±`,TRIM(TRAILING '¤«' FROM `£Ã£±`) FROM `£Ô£µ`; +SELECT `£Ã£±`,TRIM(LEADING '¤«' FROM `£Ã£±`) FROM `£Ô£µ`; +SELECT `£Ã£±`,TRIM(BOTH '¤«' FROM `£Ã£±`) FROM `£Ô£µ`; +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£µ`; +SELECT `£Ã£±`,TRIM(TRAILING '°¡' FROM `£Ã£±`) FROM `£Ô£¶`; +SELECT `£Ã£±`,TRIM(LEADING '°¡' FROM `£Ã£±`) FROM `£Ô£¶`; +SELECT `£Ã£±`,TRIM(BOTH '°¡' FROM `£Ã£±`) FROM `£Ô£¶`; +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£¶`; + +#HEAP +SELECT `£Ã£±`,TRIM(TRAILING '޶' FROM `£Ã£±`) FROM `£Ô£·`; +SELECT `£Ã£±`,TRIM(LEADING '޶' FROM `£Ã£±`) FROM `£Ô£·`; +SELECT `£Ã£±`,TRIM(BOTH '޶' FROM `£Ã£±`) FROM `£Ô£·`; +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£·`; +SELECT `£Ã£±`,TRIM(TRAILING '¤«' FROM `£Ã£±`) FROM `£Ô£¸`; +SELECT `£Ã£±`,TRIM(LEADING '¤«' FROM `£Ã£±`) FROM `£Ô£¸`; +SELECT `£Ã£±`,TRIM(BOTH '¤«' FROM `£Ã£±`) FROM `£Ô£¸`; +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£¸`; +SELECT `£Ã£±`,TRIM(TRAILING '°¡' FROM `£Ã£±`) FROM `£Ô£¹`; +SELECT `£Ã£±`,TRIM(LEADING '°¡' FROM `£Ã£±`) FROM `£Ô£¹`; +SELECT `£Ã£±`,TRIM(BOTH '°¡' FROM `£Ã£±`) FROM `£Ô£¹`; +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£¹`; + +#BDB +SELECT `£Ã£±`,TRIM(TRAILING '޶' FROM `£Ã£±`) FROM `£Ô£±£°`; +SELECT `£Ã£±`,TRIM(LEADING '޶' FROM `£Ã£±`) FROM `£Ô£±£°`; +SELECT `£Ã£±`,TRIM(BOTH '޶' FROM `£Ã£±`) FROM `£Ô£±£°`; +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£±£°`; +SELECT `£Ã£±`,TRIM(TRAILING '¤«' FROM `£Ã£±`) FROM `£Ô£±£±`; +SELECT `£Ã£±`,TRIM(LEADING '¤«' FROM `£Ã£±`) FROM `£Ô£±£±`; +SELECT `£Ã£±`,TRIM(BOTH '¤«' FROM `£Ã£±`) FROM `£Ô£±£±`; +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£±£±`; +SELECT `£Ã£±`,TRIM(TRAILING '°¡' FROM `£Ã£±`) FROM `£Ô£±£²`; +SELECT `£Ã£±`,TRIM(LEADING '°¡' FROM `£Ã£±`) FROM `£Ô£±£²`; +SELECT `£Ã£±`,TRIM(BOTH '°¡' FROM `£Ã£±`) FROM `£Ô£±£²`; +SELECT `£Ã£±`,TRIM(`£Ã£±`) FROM `£Ô£±£²`; + +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/t/jp_trim_utf8.test b/mysql-test/suite/jp/t/jp_trim_utf8.test new file mode 100755 index 00000000000..0777de15c36 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_trim_utf8.test @@ -0,0 +1,218 @@ +--disable_warnings +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +--enable_warnings + +# +# Test TRIM() function with Japanese characters utf8 encoding +# + +SET NAMES utf8; +SET character_set_database = utf8; + +CREATE TABLE `T1` (`C1` char(12), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’` (`C1` char(12), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3` (`C1` char(12), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”` (`C1` char(12), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5` (`C1` char(12), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–` (`C1` char(12), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—` (`C1` char(12), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8` (`C1` char(12), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™` (`C1` char(12), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼` (`C1` char(12), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T11` (`C1` char(12), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T12` (`C1` char(12), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; + +# Nothing to trim +INSERT INTO `T1` VALUES ('アイウエオ'); +# Test data for TRIM(TRAILING [remstr] FROM str) +INSERT INTO `T1` VALUES ('アイウエオカ'); +INSERT INTO `T1` VALUES ('アイウエオカカ'); +INSERT INTO `T1` VALUES ('アイウエオカカカ'); +# Test data for TRIM(LEADING [remstr] FROM str) +INSERT INTO `T1` VALUES ('カアイウエオ'); +INSERT INTO `T1` VALUES ('カカアイウエオ'); +INSERT INTO `T1` VALUES ('カカカアイウエオ'); +# Test data for TRIM(BOTH [remstr] FROM str) +INSERT INTO `T1` VALUES ('カカカアイウエオカカカ'); +# Test data for TRIM without [remstr] (remove spaces) +INSERT INTO `T1` VALUES (' アイウエオ '); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠã‹'); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠã‹ã‹'); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠã‹ã‹ã‹'); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‹ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‹ã‹ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‹ã‹ã‹ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‹ã‹ã‹ã‚ã„ã†ãˆãŠã‹ã‹ã‹'); +INSERT INTO `ï¼´ï¼’` VALUES (' ã‚ã„ã†ãˆãŠ '); +INSERT INTO `T3` VALUES ('龔龖龗龞龡'); +INSERT INTO `T3` VALUES ('龔龖龗龞龡丂'); +INSERT INTO `T3` VALUES ('龔龖龗龞龡丂丂'); +INSERT INTO `T3` VALUES ('龔龖龗龞龡丂丂丂'); +INSERT INTO `T3` VALUES ('丂龔龖龗龞龡'); +INSERT INTO `T3` VALUES ('丂丂龔龖龗龞龡'); +INSERT INTO `T3` VALUES ('丂丂丂龔龖龗龞龡'); +INSERT INTO `T3` VALUES ('丂丂丂龔龖龗龞龡丂丂丂'); +INSERT INTO `T3` VALUES (' 龔龖龗龞龡 '); + +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオ'); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオカ'); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオカカ'); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオカカカ'); +INSERT INTO `ï¼´ï¼”` VALUES ('カアイウエオ'); +INSERT INTO `ï¼´ï¼”` VALUES ('カカアイウエオ'); +INSERT INTO `ï¼´ï¼”` VALUES ('カカカアイウエオ'); +INSERT INTO `ï¼´ï¼”` VALUES ('カカカアイウエオカカカ'); +INSERT INTO `ï¼´ï¼”` VALUES (' アイウエオ '); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠã‹'); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠã‹ã‹'); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠã‹ã‹ã‹'); +INSERT INTO `T5` VALUES ('ã‹ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T5` VALUES ('ã‹ã‹ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T5` VALUES ('ã‹ã‹ã‹ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T5` VALUES ('ã‹ã‹ã‹ã‚ã„ã†ãˆãŠã‹ã‹ã‹'); +INSERT INTO `T5` VALUES (' ã‚ã„ã†ãˆãŠ '); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡丂'); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡丂丂'); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡丂丂丂'); +INSERT INTO `ï¼´ï¼–` VALUES ('丂龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼–` VALUES ('丂丂龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼–` VALUES ('丂丂丂龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼–` VALUES ('丂丂丂龔龖龗龞龡丂丂丂'); +INSERT INTO `ï¼´ï¼–` VALUES (' 龔龖龗龞龡 '); + +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオ'); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオカ'); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオカカ'); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオカカカ'); +INSERT INTO `ï¼´ï¼—` VALUES ('カアイウエオ'); +INSERT INTO `ï¼´ï¼—` VALUES ('カカアイウエオ'); +INSERT INTO `ï¼´ï¼—` VALUES ('カカカアイウエオ'); +INSERT INTO `ï¼´ï¼—` VALUES ('カカカアイウエオカカカ'); +INSERT INTO `ï¼´ï¼—` VALUES (' アイウエオ '); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠã‹'); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠã‹ã‹'); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠã‹ã‹ã‹'); +INSERT INTO `T8` VALUES ('ã‹ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T8` VALUES ('ã‹ã‹ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T8` VALUES ('ã‹ã‹ã‹ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T8` VALUES ('ã‹ã‹ã‹ã‚ã„ã†ãˆãŠã‹ã‹ã‹'); +INSERT INTO `T8` VALUES (' ã‚ã„ã†ãˆãŠ '); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡丂'); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡丂丂'); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡丂丂丂'); +INSERT INTO `ï¼´ï¼™` VALUES ('丂龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼™` VALUES ('丂丂龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼™` VALUES ('丂丂丂龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼™` VALUES ('丂丂丂龔龖龗龞龡丂丂丂'); +INSERT INTO `ï¼´ï¼™` VALUES (' 龔龖龗龞龡 '); + +INSERT INTO `T1ï¼` VALUES ('アイウエオ'); +INSERT INTO `T1ï¼` VALUES ('アイウエオカ'); +INSERT INTO `T1ï¼` VALUES ('アイウエオカカ'); +INSERT INTO `T1ï¼` VALUES ('アイウエオカカカ'); +INSERT INTO `T1ï¼` VALUES ('カアイウエオ'); +INSERT INTO `T1ï¼` VALUES ('カカアイウエオ'); +INSERT INTO `T1ï¼` VALUES ('カカカアイウエオ'); +INSERT INTO `T1ï¼` VALUES ('カカカアイウエオカカカ'); +INSERT INTO `T1ï¼` VALUES (' アイウエオ '); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠã‹'); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠã‹ã‹'); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠã‹ã‹ã‹'); +INSERT INTO `T11` VALUES ('ã‹ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T11` VALUES ('ã‹ã‹ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T11` VALUES ('ã‹ã‹ã‹ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T11` VALUES ('ã‹ã‹ã‹ã‚ã„ã†ãˆãŠã‹ã‹ã‹'); +INSERT INTO `T11` VALUES (' ã‚ã„ã†ãˆãŠ '); +INSERT INTO `T12` VALUES ('龔龖龗龞龡'); +INSERT INTO `T12` VALUES ('龔龖龗龞龡丂'); +INSERT INTO `T12` VALUES ('龔龖龗龞龡丂丂'); +INSERT INTO `T12` VALUES ('龔龖龗龞龡丂丂丂'); +INSERT INTO `T12` VALUES ('丂龔龖龗龞龡'); +INSERT INTO `T12` VALUES ('丂丂龔龖龗龞龡'); +INSERT INTO `T12` VALUES ('丂丂丂龔龖龗龞龡'); +INSERT INTO `T12` VALUES ('丂丂丂龔龖龗龞龡丂丂丂'); +INSERT INTO `T12` VALUES (' 龔龖龗龞龡 '); + +#InnoDB +SELECT `C1`,TRIM(TRAILING 'ï½¶' FROM `C1`) FROM `T1`; +SELECT `C1`,TRIM(LEADING 'ï½¶' FROM `C1`) FROM `T1`; +SELECT `C1`,TRIM(BOTH 'ï½¶' FROM `C1`) FROM `T1`; +SELECT `C1`,TRIM(`C1`) FROM `T1`; +SELECT `C1`,TRIM(TRAILING 'ã‹' FROM `C1`) FROM `ï¼´ï¼’`; +SELECT `C1`,TRIM(LEADING 'ã‹' FROM `C1`) FROM `ï¼´ï¼’`; +SELECT `C1`,TRIM(BOTH 'ã‹' FROM `C1`) FROM `ï¼´ï¼’`; +SELECT `C1`,TRIM(`C1`) FROM `ï¼´ï¼’`; +SELECT `C1`,TRIM(TRAILING '丂'FROM `C1`) FROM `T3`; +SELECT `C1`,TRIM(LEADING '丂' FROM `C1`) FROM `T3`; +SELECT `C1`,TRIM(BOTH '丂' FROM `C1`) FROM `T3`; +SELECT `C1`,TRIM(`C1`) FROM `T3`; + +#MyISAM +SELECT `C1`,TRIM(TRAILING 'ï½¶' FROM `C1`) FROM `ï¼´ï¼”`; +SELECT `C1`,TRIM(LEADING 'ï½¶' FROM `C1`) FROM `ï¼´ï¼”`; +SELECT `C1`,TRIM(BOTH 'ï½¶' FROM `C1`) FROM `ï¼´ï¼”`; +SELECT `C1`,TRIM(`C1`) FROM `ï¼´ï¼”`; +SELECT `C1`,TRIM(TRAILING 'ã‹' FROM `C1`) FROM `T5`; +SELECT `C1`,TRIM(LEADING 'ã‹' FROM `C1`) FROM `T5`; +SELECT `C1`,TRIM(BOTH 'ã‹' FROM `C1`) FROM `T5`; +SELECT `C1`,TRIM(`C1`) FROM `T5`; +SELECT `C1`,TRIM(TRAILING '丂' FROM `C1`) FROM `ï¼´ï¼–`; +SELECT `C1`,TRIM(LEADING '丂' FROM `C1`) FROM `ï¼´ï¼–`; +SELECT `C1`,TRIM(BOTH '丂' FROM `C1`) FROM `ï¼´ï¼–`; +SELECT `C1`,TRIM(`C1`) FROM `ï¼´ï¼–`; + +#HEAP +SELECT `C1`,TRIM(TRAILING 'ï½¶' FROM `C1`) FROM `ï¼´ï¼—`; +SELECT `C1`,TRIM(LEADING 'ï½¶' FROM `C1`) FROM `ï¼´ï¼—`; +SELECT `C1`,TRIM(BOTH 'ï½¶' FROM `C1`) FROM `ï¼´ï¼—`; +SELECT `C1`,TRIM(`C1`) FROM `ï¼´ï¼—`; +SELECT `C1`,TRIM(TRAILING 'ã‹' FROM `C1`) FROM `T8`; +SELECT `C1`,TRIM(LEADING 'ã‹' FROM `C1`) FROM `T8`; +SELECT `C1`,TRIM(BOTH 'ã‹' FROM `C1`) FROM `T8`; +SELECT `C1`,TRIM(`C1`) FROM `T8`; +SELECT `C1`,TRIM(TRAILING '丂' FROM `C1`) FROM `ï¼´ï¼™`; +SELECT `C1`,TRIM(LEADING '丂' FROM `C1`) FROM `ï¼´ï¼™`; +SELECT `C1`,TRIM(BOTH '丂' FROM `C1`) FROM `ï¼´ï¼™`; +SELECT `C1`,TRIM(`C1`) FROM `ï¼´ï¼™`; + +#BDB +SELECT `C1`,TRIM(TRAILING 'ï½¶' FROM `C1`) FROM `T1ï¼`; +SELECT `C1`,TRIM(LEADING 'ï½¶' FROM `C1`) FROM `T1ï¼`; +SELECT `C1`,TRIM(BOTH 'ï½¶' FROM `C1`) FROM `T1ï¼`; +SELECT `C1`,TRIM(`C1`) FROM `T1ï¼`; +SELECT `C1`,TRIM(TRAILING 'ã‹' FROM `C1`) FROM `T11`; +SELECT `C1`,TRIM(LEADING 'ã‹' FROM `C1`) FROM `T11`; +SELECT `C1`,TRIM(BOTH 'ã‹' FROM `C1`) FROM `T11`; +SELECT `C1`,TRIM(`C1`) FROM `T11`; +SELECT `C1`,TRIM(TRAILING '丂' FROM `C1`) FROM `T12`; +SELECT `C1`,TRIM(LEADING '丂' FROM `C1`) FROM `T12`; +SELECT `C1`,TRIM(BOTH '丂' FROM `C1`) FROM `T12`; +SELECT `C1`,TRIM(`C1`) FROM `T12`; + +DROP TABLE `T1`; +DROP TABLE `ï¼´ï¼’`; +DROP TABLE `T3`; +DROP TABLE `ï¼´ï¼”`; +DROP TABLE `T5`; +DROP TABLE `ï¼´ï¼–`; +DROP TABLE `ï¼´ï¼—`; +DROP TABLE `T8`; +DROP TABLE `ï¼´ï¼™`; +DROP TABLE `T1ï¼`; +DROP TABLE `T11`; +DROP TABLE `T12`; diff --git a/mysql-test/suite/jp/t/jp_union_ujis.test b/mysql-test/suite/jp/t/jp_union_ujis.test new file mode 100755 index 00000000000..e36d18c85c0 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_union_ujis.test @@ -0,0 +1,129 @@ +--source include/have_ujis.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +--enable_warnings + +# +# Test UNION with Japanese characters in ujis encoding +# + +SET NAMES ujis; +SET character_set_database = ujis; + +#InnoDB +CREATE TABLE `£Ô£±` (`£Ã£±` char(1), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(1), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(1), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +INSERT INTO `£Ô£±` VALUES('ޱ'),('ޱ'),('¤¢'),('¤¢'),('íÜ'),('íÜ'); +INSERT INTO `£Ô£²` VALUES('޲'),('޲'),('¤¤'),('¤¤'),('íÝ'),('íÝ'); +INSERT INTO `£Ô£³` VALUES('޳'),('޳'),('¤¦'),('¤¦'),('íÞ'),('íÞ'); +SELECT * FROM `£Ô£±` UNION DISTINCT SELECT * FROM `£Ô£²` ORDER BY `£Ã£±`; +SELECT * FROM `£Ô£±` UNION ALL SELECT * FROM `£Ô£²` ORDER BY `£Ã£±`; +(SELECT * FROM `£Ô£±`) UNION (SELECT * FROM `£Ô£²`) UNION (SELECT '¤¦') ORDER BY `£Ã£±`; +(SELECT '¤¦' AS `£Ã£±`) UNION (SELECT * FROM `£Ô£±`) UNION (SELECT * FROM `£Ô£²`) ORDER BY `£Ã£±`; +SELECT `£Ã£±`, COUNT(*) FROM `£Ô£±` GROUP BY `£Ã£±` UNION +SELECT `£Ã£±`, COUNT(*) FROM `£Ô£²` GROUP BY `£Ã£±` ORDER BY `£Ã£±`; +SELECT * FROM `£Ô£±` UNION DISTINCT +SELECT * FROM `£Ô£²` UNION ALL +SELECT * FROM `£Ô£³` ORDER BY `£Ã£±`; +SELECT * FROM `£Ô£±` UNION ALL +SELECT * FROM `£Ô£²` UNION DISTINCT +SELECT * FROM `£Ô£³` ORDER BY `£Ã£±`; +SELECT * FROM `£Ô£±` UNION SELECT REPEAT(`£Ã£±`,5) FROM `£Ô£²` ORDER BY `£Ã£±`; +DROP TABLE `£Ô£±` ; +DROP TABLE `£Ô£²` ; +DROP TABLE `£Ô£³` ; + +#MyISAM +CREATE TABLE `£Ô£±` (`£Ã£±` char(1), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = MYISAM; +CREATE TABLE `£Ô£²` (`£Ã£±` char(1), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = MYISAM; +CREATE TABLE `£Ô£³` (`£Ã£±` char(1), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = MYISAM; +INSERT INTO `£Ô£±` VALUES('ޱ'),('ޱ'),('¤¢'),('¤¢'),('íÜ'),('íÜ'); +INSERT INTO `£Ô£²` VALUES('޲'),('޲'),('¤¤'),('¤¤'),('íÝ'),('íÝ'); +INSERT INTO `£Ô£³` VALUES('޳'),('޳'),('¤¦'),('¤¦'),('íÞ'),('íÞ'); +SELECT * FROM `£Ô£±` UNION DISTINCT SELECT * FROM `£Ô£²` ORDER BY `£Ã£±`; +SELECT * FROM `£Ô£±` UNION ALL SELECT * FROM `£Ô£²` ORDER BY `£Ã£±`; +(SELECT * FROM `£Ô£±`) UNION (SELECT * FROM `£Ô£²`) UNION (SELECT '¤¦') ORDER BY `£Ã£±`; +(SELECT '¤¦' AS `£Ã£±`) UNION (SELECT * FROM `£Ô£±`) UNION (SELECT * FROM `£Ô£²`) ORDER BY `£Ã£±`; +SELECT `£Ã£±`, COUNT(*) FROM `£Ô£±` GROUP BY `£Ã£±` UNION +SELECT `£Ã£±`, COUNT(*) FROM `£Ô£²` GROUP BY `£Ã£±` ORDER BY `£Ã£±`; +SELECT * FROM `£Ô£±` UNION DISTINCT +SELECT * FROM `£Ô£²` UNION ALL +SELECT * FROM `£Ô£³` ORDER BY `£Ã£±`; +SELECT * FROM `£Ô£±` UNION ALL +SELECT * FROM `£Ô£²` UNION DISTINCT +SELECT * FROM `£Ô£³` ORDER BY `£Ã£±`; +SELECT * FROM `£Ô£±` UNION SELECT REPEAT(`£Ã£±`,5) FROM `£Ô£²` ORDER BY `£Ã£±`; +DROP TABLE `£Ô£±` ; +DROP TABLE `£Ô£²` ; +DROP TABLE `£Ô£³` ; + +#HEAP +CREATE TABLE `£Ô£±` (`£Ã£±` char(1), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = HEAP; +CREATE TABLE `£Ô£²` (`£Ã£±` char(1), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = HEAP; +CREATE TABLE `£Ô£³` (`£Ã£±` char(1), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = HEAP; +INSERT INTO `£Ô£±` VALUES('ޱ'),('ޱ'),('¤¢'),('¤¢'),('íÜ'),('íÜ'); +INSERT INTO `£Ô£²` VALUES('޲'),('޲'),('¤¤'),('¤¤'),('íÝ'),('íÝ'); +INSERT INTO `£Ô£³` VALUES('޳'),('޳'),('¤¦'),('¤¦'),('íÞ'),('íÞ'); +SELECT * FROM `£Ô£±` UNION DISTINCT SELECT * FROM `£Ô£²` ORDER BY `£Ã£±`; +SELECT * FROM `£Ô£±` UNION ALL SELECT * FROM `£Ô£²` ORDER BY `£Ã£±`; +(SELECT * FROM `£Ô£±`) UNION (SELECT * FROM `£Ô£²`) UNION (SELECT '¤¦') ORDER BY `£Ã£±`; +(SELECT '¤¦' AS `£Ã£±`) UNION (SELECT * FROM `£Ô£±`) UNION (SELECT * FROM `£Ô£²`) ORDER BY `£Ã£±`; +SELECT `£Ã£±`, COUNT(*) FROM `£Ô£±` GROUP BY `£Ã£±` UNION +SELECT `£Ã£±`, COUNT(*) FROM `£Ô£²` GROUP BY `£Ã£±` ORDER BY `£Ã£±`; +SELECT * FROM `£Ô£±` UNION DISTINCT +SELECT * FROM `£Ô£²` UNION ALL +SELECT * FROM `£Ô£³` ORDER BY `£Ã£±`; +SELECT * FROM `£Ô£±` UNION ALL +SELECT * FROM `£Ô£²` UNION DISTINCT +SELECT * FROM `£Ô£³` ORDER BY `£Ã£±`; +SELECT * FROM `£Ô£±` UNION SELECT REPEAT(`£Ã£±`,5) FROM `£Ô£²` ORDER BY `£Ã£±`; +DROP TABLE `£Ô£±` ; +DROP TABLE `£Ô£²` ; +DROP TABLE `£Ô£³` ; + +#BDB +CREATE TABLE `£Ô£±` (`£Ã£±` char(1), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = BDB; +CREATE TABLE `£Ô£²` (`£Ã£±` char(1), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = BDB; +CREATE TABLE `£Ô£³` (`£Ã£±` char(1), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = BDB; +INSERT INTO `£Ô£±` VALUES('ޱ'),('ޱ'),('¤¢'),('¤¢'),('íÜ'),('íÜ'); +INSERT INTO `£Ô£²` VALUES('޲'),('޲'),('¤¤'),('¤¤'),('íÝ'),('íÝ'); +INSERT INTO `£Ô£³` VALUES('޳'),('޳'),('¤¦'),('¤¦'),('íÞ'),('íÞ'); +SELECT * FROM `£Ô£±` UNION DISTINCT SELECT * FROM `£Ô£²` ORDER BY `£Ã£±`; +SELECT * FROM `£Ô£±` UNION ALL SELECT * FROM `£Ô£²` ORDER BY `£Ã£±`; +(SELECT * FROM `£Ô£±`) UNION (SELECT * FROM `£Ô£²`) UNION (SELECT '¤¦') ORDER BY `£Ã£±`; +(SELECT '¤¦' AS `£Ã£±`) UNION (SELECT * FROM `£Ô£±`) UNION (SELECT * FROM `£Ô£²`) ORDER BY `£Ã£±`; +SELECT `£Ã£±`, COUNT(*) FROM `£Ô£±` GROUP BY `£Ã£±` UNION +SELECT `£Ã£±`, COUNT(*) FROM `£Ô£²` GROUP BY `£Ã£±` ORDER BY `£Ã£±`; +SELECT * FROM `£Ô£±` UNION DISTINCT +SELECT * FROM `£Ô£²` UNION ALL +SELECT * FROM `£Ô£³` ORDER BY `£Ã£±`; +SELECT * FROM `£Ô£±` UNION ALL +SELECT * FROM `£Ô£²` UNION DISTINCT +SELECT * FROM `£Ô£³` ORDER BY `£Ã£±`; +SELECT * FROM `£Ô£±` UNION SELECT REPEAT(`£Ã£±`,5) FROM `£Ô£²` ORDER BY `£Ã£±`; +DROP TABLE `£Ô£±` ; +DROP TABLE `£Ô£²` ; +DROP TABLE `£Ô£³` ; + +# Test mixed strage engine +CREATE TABLE `£Ô£±` (`£Ã£±` char(1), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = InnoDB; +CREATE TABLE `£Ô£²` (`£Ã£±` char(1), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = MyISAM; +INSERT INTO `£Ô£±` VALUES('ޱ'),('ޱ'),('¤¢'),('¤¢'),('íÜ'),('íÜ'); +INSERT INTO `£Ô£²` VALUES('޲'),('޲'),('¤¤'),('¤¤'),('íÝ'),('íÝ'); +SELECT * FROM `£Ô£±` UNION DISTINCT SELECT * FROM `£Ô£²` ORDER BY `£Ã£±`; +SELECT * FROM `£Ô£±` UNION ALL SELECT * FROM `£Ô£²` ORDER BY `£Ã£±`; +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; diff --git a/mysql-test/suite/jp/t/jp_update_sjis.test b/mysql-test/suite/jp/t/jp_update_sjis.test new file mode 100755 index 00000000000..0dc7372ae92 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_update_sjis.test @@ -0,0 +1,94 @@ +--character_set sjis +--disable_warnings +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +drop table if exists `‚s‚P‚P`; +drop table if exists `‚s‚P‚Q`; +--enable_warnings + +# +# Test Updating with Japanese characters in sjis encoding +# + +SET NAMES sjis; +SET character_set_database = sjis; + +CREATE TABLE `‚s‚P` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Q` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚R` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚S` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚T` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚U` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚V` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚W` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚X` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚O` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚P` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚Q` (`‚b‚P` char(5), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; + +INSERT INTO `‚s‚P` VALUES ('±²³´µ'); +INSERT INTO `‚s‚Q` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚R` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚S` VALUES ('±²³´µ'); +INSERT INTO `‚s‚T` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚U` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚V` VALUES ('±²³´µ'); +INSERT INTO `‚s‚W` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚X` VALUES ('ƒ\\•\—\\'); +INSERT INTO `‚s‚P‚O` VALUES ('±²³´µ'); +INSERT INTO `‚s‚P‚P` VALUES ('‚ ‚¢‚¤‚¦‚¨'); +INSERT INTO `‚s‚P‚Q` VALUES ('ƒ\\•\—\\'); + +UPDATE `‚s‚P` SET `‚b‚P` = ('¶·¸¹º'); +UPDATE `‚s‚Q` SET `‚b‚P` = ('‚©‚«‚­‚¯‚±'); +UPDATE `‚s‚R` SET `‚b‚P` = ('‰\Ž\\“\”\'); +UPDATE `‚s‚S` SET `‚b‚P` = ('¶·¸¹º'); +UPDATE `‚s‚T` SET `‚b‚P` = ('‚©‚«‚­‚¯‚±'); +UPDATE `‚s‚U` SET `‚b‚P` = ('‰\Ž\\“\”\'); +UPDATE `‚s‚V` SET `‚b‚P` = ('¶·¸¹º'); +UPDATE `‚s‚W` SET `‚b‚P` = ('‚©‚«‚­‚¯‚±'); +UPDATE `‚s‚X` SET `‚b‚P` = ('‰\Ž\\“\”\'); +UPDATE `‚s‚P‚O` SET `‚b‚P` = ('¶·¸¹º'); +UPDATE `‚s‚P‚P` SET `‚b‚P` = ('‚©‚«‚­‚¯‚±'); +UPDATE `‚s‚P‚Q` SET `‚b‚P` = ('‰\Ž\\“\”\'); + +#InnoDB +SELECT * FROM `‚s‚P`; +SELECT * FROM `‚s‚Q`; +SELECT * FROM `‚s‚R`; + +#MyISAM +SELECT * FROM `‚s‚S`; +SELECT * FROM `‚s‚T`; +SELECT * FROM `‚s‚U`; + +#HEAP +SELECT * FROM `‚s‚V`; +SELECT * FROM `‚s‚W`; +SELECT * FROM `‚s‚X`; + +#BDB +SELECT * FROM `‚s‚P‚O`; +SELECT * FROM `‚s‚P‚P`; +SELECT * FROM `‚s‚P‚Q`; + +DROP TABLE `‚s‚P`; +DROP TABLE `‚s‚Q`; +DROP TABLE `‚s‚R`; +DROP TABLE `‚s‚S`; +DROP TABLE `‚s‚T`; +DROP TABLE `‚s‚U`; +DROP TABLE `‚s‚V`; +DROP TABLE `‚s‚W`; +DROP TABLE `‚s‚X`; +DROP TABLE `‚s‚P‚O`; +DROP TABLE `‚s‚P‚P`; +DROP TABLE `‚s‚P‚Q`; diff --git a/mysql-test/suite/jp/t/jp_update_ucs2.test b/mysql-test/suite/jp/t/jp_update_ucs2.test new file mode 100755 index 00000000000..7a3c1233210 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_update_ucs2.test @@ -0,0 +1,96 @@ +--source include/have_ucs2.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +--enable_warnings + +# +# Test Updating with Japanese characters in ucs2 encoding +# + +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; + +CREATE TABLE `£Ô£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; + +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'); + +UPDATE `£Ô£±` SET `£Ã£±` = ('Ž¶Ž·Ž¸Ž¹Žº'); +UPDATE `£Ô£²` SET `£Ã£±` = ('¤«¤­¤¯¤±¤³'); +UPDATE `£Ô£³` SET `£Ã£±` = ('íÈíÉíÊíËíÌ'); +UPDATE `£Ô£´` SET `£Ã£±` = ('Ž¶Ž·Ž¸Ž¹Žº'); +UPDATE `£Ô£µ` SET `£Ã£±` = ('¤«¤­¤¯¤±¤³'); +UPDATE `£Ô£¶` SET `£Ã£±` = ('íÈíÉíÊíËíÌ'); +UPDATE `£Ô£·` SET `£Ã£±` = ('Ž¶Ž·Ž¸Ž¹Žº'); +UPDATE `£Ô£¸` SET `£Ã£±` = ('¤«¤­¤¯¤±¤³'); +UPDATE `£Ô£¹` SET `£Ã£±` = ('íÈíÉíÊíËíÌ'); +UPDATE `£Ô£±£°` SET `£Ã£±` = ('Ž¶Ž·Ž¸Ž¹Žº'); +UPDATE `£Ô£±£±` SET `£Ã£±` = ('¤«¤­¤¯¤±¤³'); +UPDATE `£Ô£±£²` SET `£Ã£±` = ('íÈíÉíÊíËíÌ'); + +#InnoDB +SELECT * FROM `£Ô£±`; +SELECT * FROM `£Ô£²`; +SELECT * FROM `£Ô£³`; + +#MyISAM +SELECT * FROM `£Ô£´`; +SELECT * FROM `£Ô£µ`; +SELECT * FROM `£Ô£¶`; + +#HEAP +SELECT * FROM `£Ô£·`; +SELECT * FROM `£Ô£¸`; +SELECT * FROM `£Ô£¹`; + +#BDB +SELECT * FROM `£Ô£±£°`; +SELECT * FROM `£Ô£±£±`; +SELECT * FROM `£Ô£±£²`; + +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/t/jp_update_ujis.test b/mysql-test/suite/jp/t/jp_update_ujis.test new file mode 100755 index 00000000000..852e45b9eeb --- /dev/null +++ b/mysql-test/suite/jp/t/jp_update_ujis.test @@ -0,0 +1,95 @@ +--source include/have_ujis.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +--enable_warnings + +# +# Test Updating with Japanese characters in ujis encoding +# + +SET NAMES ujis; +SET character_set_database = ujis; + +CREATE TABLE `£Ô£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(5), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; + +INSERT INTO `£Ô£±` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£²` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£³` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£´` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£µ` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¶` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£·` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£¸` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£¹` VALUES ('íÜíÝíÞíßíà'); +INSERT INTO `£Ô£±£°` VALUES ('ޱ޲޳޴޵'); +INSERT INTO `£Ô£±£±` VALUES ('¤¢¤¤¤¦¤¨¤ª'); +INSERT INTO `£Ô£±£²` VALUES ('íÜíÝíÞíßíà'); + +UPDATE `£Ô£±` SET `£Ã£±` = ('Ž¶Ž·Ž¸Ž¹Žº'); +UPDATE `£Ô£²` SET `£Ã£±` = ('¤«¤­¤¯¤±¤³'); +UPDATE `£Ô£³` SET `£Ã£±` = ('íÈíÉíÊíËíÌ'); +UPDATE `£Ô£´` SET `£Ã£±` = ('Ž¶Ž·Ž¸Ž¹Žº'); +UPDATE `£Ô£µ` SET `£Ã£±` = ('¤«¤­¤¯¤±¤³'); +UPDATE `£Ô£¶` SET `£Ã£±` = ('íÈíÉíÊíËíÌ'); +UPDATE `£Ô£·` SET `£Ã£±` = ('Ž¶Ž·Ž¸Ž¹Žº'); +UPDATE `£Ô£¸` SET `£Ã£±` = ('¤«¤­¤¯¤±¤³'); +UPDATE `£Ô£¹` SET `£Ã£±` = ('íÈíÉíÊíËíÌ'); +UPDATE `£Ô£±£°` SET `£Ã£±` = ('Ž¶Ž·Ž¸Ž¹Žº'); +UPDATE `£Ô£±£±` SET `£Ã£±` = ('¤«¤­¤¯¤±¤³'); +UPDATE `£Ô£±£²` SET `£Ã£±` = ('íÈíÉíÊíËíÌ'); + +#InnoDB +SELECT * FROM `£Ô£±`; +SELECT * FROM `£Ô£²`; +SELECT * FROM `£Ô£³`; + +#MyISAM +SELECT * FROM `£Ô£´`; +SELECT * FROM `£Ô£µ`; +SELECT * FROM `£Ô£¶`; + +#HEAP +SELECT * FROM `£Ô£·`; +SELECT * FROM `£Ô£¸`; +SELECT * FROM `£Ô£¹`; + +#BDB +SELECT * FROM `£Ô£±£°`; +SELECT * FROM `£Ô£±£±`; +SELECT * FROM `£Ô£±£²`; + +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/t/jp_update_utf8.test b/mysql-test/suite/jp/t/jp_update_utf8.test new file mode 100755 index 00000000000..b4b3d18ecab --- /dev/null +++ b/mysql-test/suite/jp/t/jp_update_utf8.test @@ -0,0 +1,93 @@ +--disable_warnings +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +drop table if exists `T11`; +drop table if exists `T12`; +--enable_warnings + +# +# Test Updating with Japanese characters in utf8 encoding +# + +SET NAMES utf8; +SET character_set_database = utf8; + +CREATE TABLE `T1` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T11` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T12` (`C1` char(5), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; + +INSERT INTO `T1` VALUES ('アイウエオ'); +INSERT INTO `ï¼´ï¼’` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T3` VALUES ('龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼”` VALUES ('アイウエオ'); +INSERT INTO `T5` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼–` VALUES ('龔龖龗龞龡'); +INSERT INTO `ï¼´ï¼—` VALUES ('アイウエオ'); +INSERT INTO `T8` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `ï¼´ï¼™` VALUES ('龔龖龗龞龡'); +INSERT INTO `T1ï¼` VALUES ('アイウエオ'); +INSERT INTO `T11` VALUES ('ã‚ã„ã†ãˆãŠ'); +INSERT INTO `T12` VALUES ('龔龖龗龞龡'); + +UPDATE `T1` SET `C1` = ('カキクケコ'); +UPDATE `ï¼´ï¼’` SET `C1` = ('ã‹ããã‘ã“'); +UPDATE `T3` SET `C1` = ('齗齘齚é½é½ž'); +UPDATE `ï¼´ï¼”` SET `C1` = ('カキクケコ'); +UPDATE `T5` SET `C1` = ('ã‹ããã‘ã“'); +UPDATE `ï¼´ï¼–` SET `C1` = ('齗齘齚é½é½ž'); +UPDATE `ï¼´ï¼—` SET `C1` = ('カキクケコ'); +UPDATE `T8` SET `C1` = ('ã‹ããã‘ã“'); +UPDATE `ï¼´ï¼™` SET `C1` = ('齗齘齚é½é½ž'); +UPDATE `T1ï¼` SET `C1` = ('カキクケコ'); +UPDATE `T11` SET `C1` = ('ã‹ããã‘ã“'); +UPDATE `T12` SET `C1` = ('齗齘齚é½é½ž'); + +#InnoDB +SELECT * FROM `T1`; +SELECT * FROM `ï¼´ï¼’`; +SELECT * FROM `T3`; + +#MyISAM +SELECT * FROM `ï¼´ï¼”`; +SELECT * FROM `T5`; +SELECT * FROM `ï¼´ï¼–`; + +#HEAP +SELECT * FROM `ï¼´ï¼—`; +SELECT * FROM `T8`; +SELECT * FROM `ï¼´ï¼™`; + +#BDB +SELECT * FROM `T1ï¼`; +SELECT * FROM `T11`; +SELECT * FROM `T12`; + +DROP TABLE `T1`; +DROP TABLE `ï¼´ï¼’`; +DROP TABLE `T3`; +DROP TABLE `ï¼´ï¼”`; +DROP TABLE `T5`; +DROP TABLE `ï¼´ï¼–`; +DROP TABLE `ï¼´ï¼—`; +DROP TABLE `T8`; +DROP TABLE `ï¼´ï¼™`; +DROP TABLE `T1ï¼`; +DROP TABLE `T11`; +DROP TABLE `T12`; diff --git a/mysql-test/suite/jp/t/jp_where_sjis.test b/mysql-test/suite/jp/t/jp_where_sjis.test new file mode 100755 index 00000000000..452d137f643 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_where_sjis.test @@ -0,0 +1,104 @@ +--character_set sjis +--disable_warnings +drop table if exists `‚s‚P`; +drop table if exists `‚s‚Q`; +drop table if exists `‚s‚R`; +drop table if exists `‚s‚S`; +drop table if exists `‚s‚T`; +drop table if exists `‚s‚U`; +drop table if exists `‚s‚V`; +drop table if exists `‚s‚W`; +drop table if exists `‚s‚X`; +drop table if exists `‚s‚P‚O`; +drop table if exists `‚s‚P‚P`; +drop table if exists `‚s‚P‚Q`; +--enable_warnings + +# +# Test Displaying Japanese charact using WHERE condtion in sjis encoding +# + +SET NAMES sjis; +SET character_set_database = sjis; + +CREATE TABLE `‚s‚P` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚Q` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚R` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = innodb; +CREATE TABLE `‚s‚S` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚T` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚U` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = myisam; +CREATE TABLE `‚s‚V` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚W` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚X` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = heap; +CREATE TABLE `‚s‚P‚O` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚P` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; +CREATE TABLE `‚s‚P‚Q` (`‚b‚P` char(20), INDEX(`‚b‚P`)) DEFAULT CHARSET = sjis engine = bdb; + +#Load the following data in each table +# jisx0201 hankaku-katakana data +# jisx0208 data +# jisx0212 supplemental character data + +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `‚s‚P`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `‚s‚Q`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `‚s‚R`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `‚s‚S`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `‚s‚T`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `‚s‚U`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `‚s‚V`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `‚s‚W`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `‚s‚X`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_sjis.dat' INTO TABLE `‚s‚P‚O`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis.dat' INTO TABLE `‚s‚P‚P`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_sjis2.dat' INTO TABLE `‚s‚P‚Q`; + +#InnoDB +SELECT * FROM `‚s‚P` WHERE `‚b‚P` = '°±²³´µ¶·¸¹º»¼½¾¿'; +SELECT * FROM `‚s‚Q` WHERE `‚b‚P` = 'E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚­‚®‚¯‚°‚±'; +SELECT * FROM `‚s‚R` WHERE `‚b‚P` = 'ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\'; + +#MyISAM +SELECT * FROM `‚s‚S` WHERE `‚b‚P` = '°±²³´µ¶·¸¹º»¼½¾¿'; +SELECT * FROM `‚s‚T` WHERE `‚b‚P` = 'E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚­‚®‚¯‚°‚±'; +SELECT * FROM `‚s‚U` WHERE `‚b‚P` = 'ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\'; + +#Heap +SELECT * FROM `‚s‚V` WHERE `‚b‚P` = '°±²³´µ¶·¸¹º»¼½¾¿'; +SELECT * FROM `‚s‚W` WHERE `‚b‚P` = 'E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚­‚®‚¯‚°‚±'; +SELECT * FROM `‚s‚X` WHERE `‚b‚P` = 'ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\'; + +#BDB +SELECT * FROM `‚s‚P‚O` WHERE `‚b‚P` = '°±²³´µ¶·¸¹º»¼½¾¿'; +SELECT * FROM `‚s‚P‚P` WHERE `‚b‚P` = 'E‚Ÿ‚ ‚¡‚¢‚£‚¤‚¥‚¦‚§‚¨‚©‚ª‚«‚¬‚­‚®‚¯‚°‚±'; +SELECT * FROM `‚s‚P‚Q` WHERE `‚b‚P` = 'ƒ\\•\—\\‰\Ž\\“\”\–\˜\‘\’\™\š\›\œ\\ž\'; + +#Test to distinguish 0x9353 and 0x9373 +CREATE TABLE t1(c1 char(1)) default charset = sjis engine=innodb; +CREATE TABLE t2(c1 char(1)) default charset = sjis engine=myisam; +CREATE TABLE t3(c1 char(1)) default charset = sjis engine=heap; +CREATE TABLE t4(c1 char(1)) default charset = sjis engine=bdb; +INSERT INTO t1 VALUES('“S'),('“s'); +INSERT INTO t2 VALUES('“S'),('“s'); +INSERT INTO t3 VALUES('“S'),('“s'); +INSERT INTO t4 VALUES('“S'),('“s'); +SELECT * FROM t1 WHERE c1 = '“S'; +SELECT * FROM t2 WHERE c1 = '“S'; +SELECT * FROM t3 WHERE c1 = '“S'; +SELECT * FROM t4 WHERE c1 = '“S'; +SELECT * FROM t1 WHERE c1 = '“s'; +SELECT * FROM t2 WHERE c1 = '“s'; +SELECT * FROM t3 WHERE c1 = '“s'; +SELECT * FROM t4 WHERE c1 = '“s'; + +DROP TABLE `‚s‚P`; +DROP TABLE `‚s‚Q`; +DROP TABLE `‚s‚R`; +DROP TABLE `‚s‚S`; +DROP TABLE `‚s‚T`; +DROP TABLE `‚s‚U`; +DROP TABLE `‚s‚V`; +DROP TABLE `‚s‚W`; +DROP TABLE `‚s‚X`; +DROP TABLE `‚s‚P‚O`; +DROP TABLE `‚s‚P‚P`; +DROP TABLE `‚s‚P‚Q`; diff --git a/mysql-test/suite/jp/t/jp_where_ucs2.test b/mysql-test/suite/jp/t/jp_where_ucs2.test new file mode 100755 index 00000000000..3b82eacd615 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_where_ucs2.test @@ -0,0 +1,175 @@ +--source include/have_ucs2.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +--enable_warnings + +# +# Test Displaying Japanese charact using WHERE condtion in ucs2 encoding +# + +SET NAMES ujis; +SET character_set_database = ucs2; +SET collation_connection = ucs2_general_ci; + +CREATE TABLE `£Ô£±` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ucs2 engine = bdb; + +#Insert the following data in each table +# jisx0201 hankaku-katakana data +# jisx0208 data +# jisx0212 supplemental character data + +INSERT INTO `£Ô£±` VALUES + ('PQRSTUVWXYZ[\\]^_') +,(' Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯') +,('Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿') +,('ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ') +,('ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß'); + +INSERT INTO `£Ô£²` VALUES + ('¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç') +,('¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û') +,('¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³') +,('¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³') +,('¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³') +,('¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³') +,('¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³'); + +INSERT INTO `£Ô£³` VALUES + ('¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦') +,('°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç') +,('°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û') +,('°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï') +,('¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³') +,('í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ') +,('íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ'); + +INSERT INTO `£Ô£´` VALUES + ('PQRSTUVWXYZ[\\]^_') +,(' Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯') +,('Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿') +,('ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ') +,('ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß'); + +INSERT INTO `£Ô£µ` VALUES + ('¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç') +,('¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û') +,('¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³') +,('¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³') +,('¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³') +,('¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³') +,('¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³'); + +INSERT INTO `£Ô£¶` VALUES + ('¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦') +,('°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç') +,('°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û') +,('°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï') +,('¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³') +,('í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ') +,('íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ'); + +INSERT INTO `£Ô£·` VALUES + ('PQRSTUVWXYZ[\\]^_') +,(' Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯') +,('Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿') +,('ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ') +,('ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß'); + +INSERT INTO `£Ô£¸` VALUES + ('¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç') +,('¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û') +,('¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³') +,('¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³') +,('¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³') +,('¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³') +,('¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³'); + +INSERT INTO `£Ô£¹` VALUES + ('¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦') +,('°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç') +,('°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û') +,('°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï') +,('¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³') +,('í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ') +,('íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ'); + +INSERT INTO `£Ô£±£°` VALUES + ('PQRSTUVWXYZ[\\]^_') +,(' Ž¡Ž¢Ž£Ž¤Ž¥Ž¦Ž§Ž¨Ž©ŽªŽ«Ž¬Ž­Ž®Ž¯') +,('Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿') +,('ŽÀŽÁŽÂŽÃŽÄŽÅŽÆŽÇŽÈŽÉŽÊŽËŽÌŽÍŽÎŽÏ') +,('ŽÐŽÑŽÒŽÓŽÔŽÕŽÖŽ×ŽØŽÙŽÚŽÛŽÜŽÝŽÞŽß'); + +INSERT INTO `£Ô£±£±` VALUES + ('¡´¡µ¡¶¡·¡¸¡¹¡º¡»¡¼¡½¡¾¡¿¡À¡Á¡Â¡Ã¡Ä¡Å¡Æ¡Ç') +,('¡È¡É¡Ê¡Ë¡Ì¡Í¡Î¡Ï¡Ð¡Ñ¡Ò¡Ó¡Ô¡Õ¡Ö¡×¡Ø¡Ù¡Ú¡Û') +,('¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³') +,('¡¦¥¡¥¢¥£¥¤¥¥¥¦¥§¥¨¥©¥ª¥«¥¬¥­¥®¥¯¥°¥±¥²¥³') +,('¡¦°¡°¢°£°¤°¥°¦°§°¨°©°ª°«°¬°­°®°¯°°°±°²°³') +,('¡¦Ð¡Ð¢Ð£Ð¤Ð¥Ð¦Ð§Ð¨Ð©ÐªÐ«Ð¬Ð­Ð®Ð¯Ð°Ð±Ð²Ð³') +,('¡¦ó¡ó¢ó£ó¤ó¥ó¦ó§ó¨ó©óªó«ó¬ó­ó®ó¯ó°ó±ó²ó³'); + +INSERT INTO `£Ô£±£²` VALUES + ('¡¦¢µ¢¶¢·¢¸¢¹¡¦¡¦¡¦¡¦¡¦¡¦¡¦¡¦¢Â¢Ã¢Ä¡¦¡¦¡¦') +,('°´°µ°¶°·°¸°¹°º°»°¼°½°¾°¿°À°Á°Â°Ã°Ä°Å°Æ°Ç') +,('°È°É°Ê°Ë°Ì°Í°Î°Ï°Ð°Ñ°Ò°Ó°Ô°Õ°Ö°×°Ø°Ù°Ú°Û') +,('°Ü°Ý°Þ°ß°à°á°â°ã°ä°å°æ°ç°è°é°ê°ë°ì°í°î°ï') +,('¡¦í¡í¢í£í¤í¥í¦í§í¨í©íªí«í¬í­í®í¯í°í±í²í³') +,('í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ') +,('íÈíÉíÊíËíÌíÍíÎíÏíÐíÑíÒíÓíÔíÕíÖí×íØíÙíÚíÛ'); + +#InnoDB +SELECT * FROM `£Ô£±` WHERE `£Ã£±` = 'Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿'; +SELECT * FROM `£Ô£²` WHERE `£Ã£±` = '¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³'; +SELECT * FROM `£Ô£³` WHERE `£Ã£±` = 'í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ'; + +#MyISAM +SELECT * FROM `£Ô£´` WHERE `£Ã£±` = 'Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿'; +SELECT * FROM `£Ô£µ` WHERE `£Ã£±` = '¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³'; +SELECT * FROM `£Ô£¶` WHERE `£Ã£±` = 'í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ'; + +#Heap +SELECT * FROM `£Ô£·` WHERE `£Ã£±` = 'Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿'; +SELECT * FROM `£Ô£¸` WHERE `£Ã£±` = '¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³'; +SELECT * FROM `£Ô£¹` WHERE `£Ã£±` = 'í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ'; + +#BDB +SELECT * FROM `£Ô£±£°` WHERE `£Ã£±` = 'Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿'; +SELECT * FROM `£Ô£±£±` WHERE `£Ã£±` = '¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³'; +SELECT * FROM `£Ô£±£²` WHERE `£Ã£±` = 'í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ'; + +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/t/jp_where_ujis.test b/mysql-test/suite/jp/t/jp_where_ujis.test new file mode 100755 index 00000000000..e96404fbb17 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_where_ujis.test @@ -0,0 +1,87 @@ +--source include/have_ujis.inc + +--disable_warnings +drop table if exists `£Ô£±`; +drop table if exists `£Ô£²`; +drop table if exists `£Ô£³`; +drop table if exists `£Ô£´`; +drop table if exists `£Ô£µ`; +drop table if exists `£Ô£¶`; +drop table if exists `£Ô£·`; +drop table if exists `£Ô£¸`; +drop table if exists `£Ô£¹`; +drop table if exists `£Ô£±£°`; +drop table if exists `£Ô£±£±`; +drop table if exists `£Ô£±£²`; +--enable_warnings + +# +# Test Displaying Japanese charact using WHERE condtion in ujis encoding +# + +SET NAMES ujis; +SET character_set_database = ujis; + +CREATE TABLE `£Ô£±` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£²` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£³` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = innodb; +CREATE TABLE `£Ô£´` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£µ` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£¶` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = myisam; +CREATE TABLE `£Ô£·` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¸` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£¹` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = heap; +CREATE TABLE `£Ô£±£°` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£±` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; +CREATE TABLE `£Ô£±£²` (`£Ã£±` char(20), INDEX(`£Ã£±`)) DEFAULT CHARSET = ujis engine = bdb; + +#Load the following data in each table +# jisx0201 hankaku-katakana data +# jisx0208 data +# jisx0212 supplemental character data + +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_ujis.dat' INTO TABLE `£Ô£±`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_ujis.dat' INTO TABLE `£Ô£²`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_ujis.dat' INTO TABLE `£Ô£³`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_ujis.dat' INTO TABLE `£Ô£´`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_ujis.dat' INTO TABLE `£Ô£µ`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_ujis.dat' INTO TABLE `£Ô£¶`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_ujis.dat' INTO TABLE `£Ô£·`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_ujis.dat' INTO TABLE `£Ô£¸`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_ujis.dat' INTO TABLE `£Ô£¹`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_ujis.dat' INTO TABLE `£Ô£±£°`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_ujis.dat' INTO TABLE `£Ô£±£±`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_ujis.dat' INTO TABLE `£Ô£±£²`; + +#InnoDB +SELECT * FROM `£Ô£±` WHERE `£Ã£±` = 'Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿'; +SELECT * FROM `£Ô£²` WHERE `£Ã£±` = '¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³'; +SELECT * FROM `£Ô£³` WHERE `£Ã£±` = 'í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ'; + +#MyISAM +SELECT * FROM `£Ô£´` WHERE `£Ã£±` = 'Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿'; +SELECT * FROM `£Ô£µ` WHERE `£Ã£±` = '¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³'; +SELECT * FROM `£Ô£¶` WHERE `£Ã£±` = 'í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ'; + +#Heap +SELECT * FROM `£Ô£·` WHERE `£Ã£±` = 'Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿'; +SELECT * FROM `£Ô£¸` WHERE `£Ã£±` = '¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³'; +SELECT * FROM `£Ô£¹` WHERE `£Ã£±` = 'í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ'; + +#BDB +SELECT * FROM `£Ô£±£°` WHERE `£Ã£±` = 'Ž°Ž±Ž²Ž³Ž´ŽµŽ¶Ž·Ž¸Ž¹ŽºŽ»Ž¼Ž½Ž¾Ž¿'; +SELECT * FROM `£Ô£±£±` WHERE `£Ã£±` = '¡¦¤¡¤¢¤£¤¤¤¥¤¦¤§¤¨¤©¤ª¤«¤¬¤­¤®¤¯¤°¤±¤²¤³'; +SELECT * FROM `£Ô£±£²` WHERE `£Ã£±` = 'í´íµí¶í·í¸í¹íºí»í¼í½í¾í¿íÀíÁíÂíÃíÄíÅíÆíÇ'; + +DROP TABLE `£Ô£±`; +DROP TABLE `£Ô£²`; +DROP TABLE `£Ô£³`; +DROP TABLE `£Ô£´`; +DROP TABLE `£Ô£µ`; +DROP TABLE `£Ô£¶`; +DROP TABLE `£Ô£·`; +DROP TABLE `£Ô£¸`; +DROP TABLE `£Ô£¹`; +DROP TABLE `£Ô£±£°`; +DROP TABLE `£Ô£±£±`; +DROP TABLE `£Ô£±£²`; diff --git a/mysql-test/suite/jp/t/jp_where_utf8.test b/mysql-test/suite/jp/t/jp_where_utf8.test new file mode 100755 index 00000000000..7280bc33f21 --- /dev/null +++ b/mysql-test/suite/jp/t/jp_where_utf8.test @@ -0,0 +1,85 @@ +--disable_warnings +drop table if exists `T1`; +drop table if exists `ï¼´ï¼’`; +drop table if exists `T3`; +drop table if exists `ï¼´ï¼”`; +drop table if exists `T5`; +drop table if exists `ï¼´ï¼–`; +drop table if exists `ï¼´ï¼—`; +drop table if exists `T8`; +drop table if exists `ï¼´ï¼™`; +drop table if exists `T1ï¼`; +drop table if exists `T11`; +drop table if exists `T12`; +--enable_warnings + +# +# Test Displaying Japanese charact using WHERE condtion in utf8 encoding +# + +SET NAMES utf8; +SET character_set_database = utf8; + +CREATE TABLE `T1` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼’` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `T3` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = innodb; +CREATE TABLE `ï¼´ï¼”` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `T5` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼–` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = myisam; +CREATE TABLE `ï¼´ï¼—` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T8` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `ï¼´ï¼™` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = heap; +CREATE TABLE `T1ï¼` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T11` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; +CREATE TABLE `T12` (`C1` char(20), INDEX(`C1`)) DEFAULT CHARSET = utf8 engine = bdb; + +#Load the following data in each table +# jisx0201 hankaku-katakana data +# jisx0208 data +# jisx0212 supplemental character data + +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_utf8.dat' INTO TABLE `T1`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_utf8.dat' INTO TABLE `ï¼´ï¼’`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_utf8.dat' INTO TABLE `T3`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_utf8.dat' INTO TABLE `ï¼´ï¼”`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_utf8.dat' INTO TABLE `T5`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_utf8.dat' INTO TABLE `ï¼´ï¼–`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_utf8.dat' INTO TABLE `ï¼´ï¼—`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_utf8.dat' INTO TABLE `T8`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_utf8.dat' INTO TABLE `ï¼´ï¼™`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0201_utf8.dat' INTO TABLE `T1ï¼`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0208_utf8.dat' INTO TABLE `T11`; +LOAD DATA LOCAL INFILE 'suite/jp/std_data/jisx0212_utf8.dat' INTO TABLE `T12`; + +#InnoDB +SELECT * FROM `T1` WHERE `C1` = 'ーアイウエオカキクケコサシスセソ'; +SELECT * FROM `ï¼´ï¼’` WHERE `C1` = '・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“'; +SELECT * FROM `T3` WHERE `C1` = '鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖'; + +#MyISAM +SELECT * FROM `ï¼´ï¼”` WHERE `C1` = 'ーアイウエオカキクケコサシスセソ'; +SELECT * FROM `T5` WHERE `C1` = '・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“'; +SELECT * FROM `ï¼´ï¼–` WHERE `C1` = '鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖'; + +#Heap +SELECT * FROM `ï¼´ï¼—` WHERE `C1` = 'ーアイウエオカキクケコサシスセソ'; +SELECT * FROM `T8` WHERE `C1` = '・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“'; +SELECT * FROM `ï¼´ï¼™` WHERE `C1` = '鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖'; + +#BDB +SELECT * FROM `T1ï¼` WHERE `C1` = 'ーアイウエオカキクケコサシスセソ'; +SELECT * FROM `T11` WHERE `C1` = '・ãã‚ãƒã„ã…ã†ã‡ãˆã‰ãŠã‹ãŒããŽããã‘ã’ã“'; +SELECT * FROM `T12` WHERE `C1` = '鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿é½é½ƒé½„齅齆齇齓齕齖'; + +DROP TABLE `T1`; +DROP TABLE `ï¼´ï¼’`; +DROP TABLE `T3`; +DROP TABLE `ï¼´ï¼”`; +DROP TABLE `T5`; +DROP TABLE `ï¼´ï¼–`; +DROP TABLE `ï¼´ï¼—`; +DROP TABLE `T8`; +DROP TABLE `ï¼´ï¼™`; +DROP TABLE `T1ï¼`; +DROP TABLE `T11`; +DROP TABLE `T12`; From b06480082c8085050eeb3750c56460895666a2b9 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 7 Jan 2005 11:47:01 +0100 Subject: [PATCH 0670/1063] bug#7690 - ndb startup with shm, use sigaction to escape SA_RESETHAND configure.in: Check for sigaction used in SHM_Transporter ndb/src/common/transporter/SHM_Transporter.cpp: remove unused variable ndb/src/common/transporter/TransporterRegistry.cpp: 1) remove unused variable 2) Use sigaction instead of signal to install signal handler This as signal uses SA_RESETHAND --- configure.in | 5 +++-- .../common/transporter/SHM_Transporter.cpp | 2 -- .../transporter/TransporterRegistry.cpp | 19 ++++++++++++++++--- 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/configure.in b/configure.in index 47447913168..f2184ed7be5 100644 --- a/configure.in +++ b/configure.in @@ -1924,7 +1924,7 @@ AC_CHECK_FUNCS(alarm bcmp bfill bmove bzero chsize cuserid fchmod fcntl \ pthread_key_delete pthread_rwlock_rdlock pthread_setprio \ pthread_setprio_np pthread_setschedparam pthread_sigmask readlink \ realpath rename rint rwlock_init setupterm \ - shmget shmat shmdt shmctl \ + shmget shmat shmdt shmctl sigaction \ sighold sigset sigthreadmask \ snprintf socket stpcpy strcasecmp strerror strnlen strpbrk strstr strtol \ strtoll strtoul strtoull tell tempnam thr_setconcurrency vidattr) @@ -3097,7 +3097,8 @@ ndb_transporter_opt_objs="" if test "$ac_cv_func_shmget" = "yes" && test "$ac_cv_func_shmat" = "yes" && test "$ac_cv_func_shmdt" = "yes" && - test "$ac_cv_func_shmctl" = "yes" + test "$ac_cv_func_shmctl" = "yes" && + test "$ac_cv_func_sigaction" = "yes" then AC_DEFINE([NDB_SHM_TRANSPORTER], [1], [Including Ndb Cluster DB shared memory transporter]) diff --git a/ndb/src/common/transporter/SHM_Transporter.cpp b/ndb/src/common/transporter/SHM_Transporter.cpp index ffb51bf1326..f0cbf822e53 100644 --- a/ndb/src/common/transporter/SHM_Transporter.cpp +++ b/ndb/src/common/transporter/SHM_Transporter.cpp @@ -26,8 +26,6 @@ #include #include -extern int g_shm_pid; - SHM_Transporter::SHM_Transporter(TransporterRegistry &t_reg, const char *lHostName, const char *rHostName, diff --git a/ndb/src/common/transporter/TransporterRegistry.cpp b/ndb/src/common/transporter/TransporterRegistry.cpp index 2eb81b2b35d..c80e6bc1489 100644 --- a/ndb/src/common/transporter/TransporterRegistry.cpp +++ b/ndb/src/common/transporter/TransporterRegistry.cpp @@ -50,8 +50,6 @@ #include extern EventLogger g_eventLogger; -int g_shm_pid = 0; - SocketServer::Session * TransporterService::newSession(NDB_SOCKET_TYPE sockfd) { DBUG_ENTER("SocketServer::Session * TransporterService::newSession"); @@ -1322,7 +1320,22 @@ TransporterRegistry::startReceiving() #ifdef NDB_SHM_TRANSPORTER m_shm_own_pid = getpid(); - signal(SIGUSR1, shm_sig_handler); + struct sigaction sa; + sa.sa_handler = shm_sig_handler; + sigemptyset(&sa.sa_mask); + sa.sa_flags = 0; + int ret; + while((ret = sigaction(SIGUSR1, &sa, 0)) == -1 && errno == EINTR); + if(ret != 0) + { + g_eventLogger.error("Failed to install signal handler for SHM transporter" + " errno: %d (%s)", errno, +#ifdef HAVE_STRERROR + strerror(errno)); +#else + ""); +#endif + } #endif } From 0ef65db5d7bba5d1d1aeed4bb11cbf96b226f534 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 7 Jan 2005 12:29:15 +0100 Subject: [PATCH 0671/1063] - Updated Do-pkg to include the MySQL Preference Pane into the Mac OS X installation disk images Build-tools/Do-pkg: - added code to include the MySQLPreferencePane into the installation disk image (can be skipped by using --skip-prefpane) --- Build-tools/Do-pkg | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Build-tools/Do-pkg b/Build-tools/Do-pkg index b9df444a4ba..38c1c47e2f3 100755 --- a/Build-tools/Do-pkg +++ b/Build-tools/Do-pkg @@ -31,6 +31,7 @@ $opt_help= undef; $opt_log= undef; $opt_mail= ""; $opt_skip_dmg= undef; +$opt_skip_prefpane= undef; $opt_skip_si= undef; $opt_suffix= undef; $opt_verbose= undef; @@ -41,6 +42,7 @@ GetOptions( "help|h", "log|l:s", "mail|m=s", + "skip-prefpane|p", "skip-dmg|skip-disk-image|s", "skip-si|skip-startup-item", "suffix=s", @@ -82,6 +84,7 @@ $HOST=~ /^([^.-]*)/; $HOST= $1; $LOGFILE= "$PWD/Logs/$HOST-$MAJOR.$MINOR$SUFFIX.log"; $BUILDDIR= "$PWD/$HOST"; +$PREFPANE= "$PWD/mysql-administrator/source/mac/PreferencePane/build/MySQL.prefPane"; $SRCBASEDIR= <$BUILDDIR/mysql*-$VERSION>; $SUPFILEDIR= <$SRCBASEDIR/support-files/MacOSX>; $TAR= <$BUILDDIR/$NAME-apple-darwin*-powerpc.tar.gz>; @@ -219,6 +222,19 @@ unless ($opt_skip_si) &run_command($command, "Error while building package $SI_NAME.pkg!"); } +# +# Include the MySQL Preference Pane +# +unless ($opt_skip_prefpane) +{ + &abort("Could not find PrefPane helper application. Did you compile and install it?") + unless (-f "$PREFPANE/Contents/Resources/mahelper"); + &logger("Including $PREFPANE in $PKGDEST"); + &run_command("mkdir $PKGDEST/MySQL.prefPane", "Could not create $PKGDEST/MySQL.prefPane!"); + &run_command("ditto $PREFPANE $PKGDEST/MySQL.prefPane", "Could not copy $PREFPANE into $PKGDEST!"); + &run_command("chown -R root:wheel $PKGDEST/MySQL.prefPane", "Cannot chown $PKGDEST/MySQL.prefPane!"); +} + if ($opt_skip_dmg) { &logger("SUCCESS: Package $PKGDEST/$NAME.pkg created"); @@ -254,6 +270,7 @@ chomp($mountpoint=`mount | grep "\/Volumes\/$NAME" | cut -f3 -d" "`) if (!$opt_d &logger("Copying $PKGDEST/$NAME.pkg to Disk image /Volumes/$NAME"); &run_command("ditto $PKGDEST /Volumes/$NAME", "Could not copy $PKGDEST to /Volumes/$NAME!"); &run_command("ditto $SUPFILEDIR/ReadMe.txt /Volumes/$NAME", "Could not copy $SPFILEDIR/ReadMe.txt to /Volumes/$NAME!"); +&run_command("chown root:wheel /Volumes/$NAME/ReadMe.txt", "Could not fix ownerships of /Volumes/$NAME/ReadMe.txt!"); chomp($mountpoint=`mount | grep "\/Volumes\/$NAME" | cut -f1 -d" "`) if (!$opt_dry_run); &abort("/Volumes/$NAME not attached!") if (!$mountpoint && !$opt_dry_run); &logger("Unmounting $mountpoint"); @@ -302,6 +319,7 @@ Options: if logging is enabled) Note that the \@-Sign needs to be quoted! Example: --mail=user\\\@domain.com +-p, --skip-prefpane Skip including the PreferencePane -s, --skip-disk-image, --skip-dmg Just build the PKGs, don't put it into a disk image afterwards --skip-startup-item, --skip-si Skip the creation of the StartupItem PKG From 9ad1b390fcf12ec7aa7b9fad157d6e0a61045b40 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 7 Jan 2005 14:32:05 +0200 Subject: [PATCH 0672/1063] Many files: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_alter_sjis.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_alter_ucs2.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_alter_ujis.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_alter_utf8.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_charlength_sjis.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_charlength_ucs2.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_charlength_ujis.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_charlength_utf8.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_charset_sjis.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_charset_ucs2.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_charset_ujis.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_charset_utf8.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_convert_sjis.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_convert_ucs2.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_convert_ujis.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_convert_utf8.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_create_db_sjis.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_create_db_ucs2.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_create_db_ujis.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_create_db_utf8.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_create_tbl_sjis.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_create_tbl_ucs2.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_create_tbl_ujis.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_create_tbl_utf8.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_enum_sjis.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_enum_ucs2.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_enum_ujis.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_enum_utf8.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_insert_sjis.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_insert_ucs2.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_insert_ujis.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_insert_utf8.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_instr_sjis.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_instr_ucs2.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_instr_ujis.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_instr_utf8.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_join_sjis.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_join_ucs2.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_join_ujis.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_join_utf8.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_left_sjis.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_left_ucs2.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_left_ujis.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_left_utf8.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_length_sjis.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_length_ucs2.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_length_ujis.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_length_utf8.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_like_sjis.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_like_ucs2.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_like_ujis.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_like_utf8.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_locate_sjis.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_locate_ucs2.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_locate_ujis.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_locate_utf8.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_lpad_sjis.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_lpad_ucs2.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_lpad_ujis.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_lpad_utf8.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_ltrim_sjis.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_ltrim_ucs2.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_ltrim_ujis.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_ltrim_utf8.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_ps_sjis.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_ps_ujis.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_replace_sjis.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_replace_ucs2.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_replace_ujis.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_replace_utf8.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_reverse_sjis.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_reverse_ucs2.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_reverse_ujis.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_reverse_utf8.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_right_sjis.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_right_ucs2.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_right_ujis.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_right_utf8.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_rpad_sjis.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_rpad_ucs2.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_rpad_ujis.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_rpad_utf8.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_rtrim_sjis.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_rtrim_ucs2.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_rtrim_ujis.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_rtrim_utf8.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_select_sjis.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_select_ucs2.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_select_ujis.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_select_utf8.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_subquery_sjis.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_subquery_ucs2.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_subquery_ujis.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_subquery_utf8.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_substring_sjis.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_substring_ucs2.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_substring_ujis.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_substring_utf8.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_trim_sjis.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_trim_ucs2.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_trim_ujis.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_trim_utf8.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_union_ujis.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_update_sjis.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_update_ucs2.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_update_ujis.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_update_utf8.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_where_sjis.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_where_ucs2.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_where_ujis.result: Change mode to -rw-rw---- mysql-test/suite/jp/r/jp_where_utf8.result: Change mode to -rw-rw---- mysql-test/suite/jp/std_data/jisx0201_sjis.dat: Change mode to -rw-rw---- mysql-test/suite/jp/std_data/jisx0201_ucs2.dat: Change mode to -rw-rw---- mysql-test/suite/jp/std_data/jisx0201_ujis.dat: Change mode to -rw-rw---- mysql-test/suite/jp/std_data/jisx0201_utf8.dat: Change mode to -rw-rw---- mysql-test/suite/jp/std_data/jisx0208_sjis.dat: Change mode to -rw-rw---- mysql-test/suite/jp/std_data/jisx0208_sjis2.dat: Change mode to -rw-rw---- mysql-test/suite/jp/std_data/jisx0208_sjis3.dat: Change mode to -rw-rw---- mysql-test/suite/jp/std_data/jisx0208_ucs2.dat: Change mode to -rw-rw---- mysql-test/suite/jp/std_data/jisx0208_ujis.dat: Change mode to -rw-rw---- mysql-test/suite/jp/std_data/jisx0208_utf8.dat: Change mode to -rw-rw---- mysql-test/suite/jp/std_data/jisx0212_ucs2.dat: Change mode to -rw-rw---- mysql-test/suite/jp/std_data/jisx0212_ujis.dat: Change mode to -rw-rw---- mysql-test/suite/jp/std_data/jisx0212_utf8.dat: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_alter_sjis.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_alter_ucs2.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_alter_ujis.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_alter_utf8.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_charlength_sjis.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_charlength_ucs2.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_charlength_ujis.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_charlength_utf8.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_charset_sjis.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_charset_ucs2.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_charset_ujis.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_charset_utf8.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_convert_sjis.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_convert_ucs2.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_convert_ujis.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_convert_utf8.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_create_db_sjis.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_create_db_ucs2.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_create_db_ujis.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_create_db_utf8.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_create_tbl_sjis.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_create_tbl_ucs2.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_create_tbl_ujis.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_create_tbl_utf8.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_enum_sjis.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_enum_ucs2.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_enum_ujis.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_enum_utf8.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_insert_sjis.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_insert_ucs2.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_insert_ujis.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_insert_utf8.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_instr_sjis.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_instr_ucs2.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_instr_ujis.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_instr_utf8.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_join_sjis.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_join_ucs2.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_join_ujis.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_join_utf8.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_left_sjis.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_left_ucs2.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_left_ujis.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_left_utf8.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_length_sjis.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_length_ucs2.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_length_ujis.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_length_utf8.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_like_sjis.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_like_ucs2.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_like_ujis.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_like_utf8.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_locate_sjis.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_locate_ucs2.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_locate_ujis.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_locate_utf8.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_lpad_sjis.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_lpad_ucs2.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_lpad_ujis.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_lpad_utf8.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_ltrim_sjis.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_ltrim_ucs2.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_ltrim_ujis.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_ltrim_utf8.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_ps_sjis.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_ps_ujis.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_replace_sjis.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_replace_ucs2.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_replace_ujis.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_replace_utf8.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_reverse_sjis.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_reverse_ucs2.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_reverse_ujis.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_reverse_utf8.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_right_sjis.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_right_ucs2.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_right_ujis.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_right_utf8.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_rpad_sjis.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_rpad_ucs2.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_rpad_ujis.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_rpad_utf8.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_rtrim_sjis.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_rtrim_ucs2.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_rtrim_ujis.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_rtrim_utf8.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_select_sjis.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_select_ucs2.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_select_ujis.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_select_utf8.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_subquery_sjis.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_subquery_ucs2.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_subquery_ujis.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_subquery_utf8.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_substring_sjis.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_substring_ucs2.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_substring_ujis.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_substring_utf8.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_trim_sjis.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_trim_ucs2.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_trim_ujis.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_trim_utf8.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_union_ujis.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_update_sjis.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_update_ucs2.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_update_ujis.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_update_utf8.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_where_sjis.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_where_ucs2.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_where_ujis.test: Change mode to -rw-rw---- mysql-test/suite/jp/t/jp_where_utf8.test: Change mode to -rw-rw---- --- mysql-test/suite/jp/r/jp_alter_sjis.result | 0 mysql-test/suite/jp/r/jp_alter_ucs2.result | 0 mysql-test/suite/jp/r/jp_alter_ujis.result | 0 mysql-test/suite/jp/r/jp_alter_utf8.result | 0 mysql-test/suite/jp/r/jp_charlength_sjis.result | 0 mysql-test/suite/jp/r/jp_charlength_ucs2.result | 0 mysql-test/suite/jp/r/jp_charlength_ujis.result | 0 mysql-test/suite/jp/r/jp_charlength_utf8.result | 0 mysql-test/suite/jp/r/jp_charset_sjis.result | 0 mysql-test/suite/jp/r/jp_charset_ucs2.result | 0 mysql-test/suite/jp/r/jp_charset_ujis.result | 0 mysql-test/suite/jp/r/jp_charset_utf8.result | 0 mysql-test/suite/jp/r/jp_convert_sjis.result | 0 mysql-test/suite/jp/r/jp_convert_ucs2.result | 0 mysql-test/suite/jp/r/jp_convert_ujis.result | 0 mysql-test/suite/jp/r/jp_convert_utf8.result | 0 mysql-test/suite/jp/r/jp_create_db_sjis.result | 0 mysql-test/suite/jp/r/jp_create_db_ucs2.result | 0 mysql-test/suite/jp/r/jp_create_db_ujis.result | 0 mysql-test/suite/jp/r/jp_create_db_utf8.result | 0 mysql-test/suite/jp/r/jp_create_tbl_sjis.result | 0 mysql-test/suite/jp/r/jp_create_tbl_ucs2.result | 0 mysql-test/suite/jp/r/jp_create_tbl_ujis.result | 0 mysql-test/suite/jp/r/jp_create_tbl_utf8.result | 0 mysql-test/suite/jp/r/jp_enum_sjis.result | 0 mysql-test/suite/jp/r/jp_enum_ucs2.result | 0 mysql-test/suite/jp/r/jp_enum_ujis.result | 0 mysql-test/suite/jp/r/jp_enum_utf8.result | 0 mysql-test/suite/jp/r/jp_insert_sjis.result | 0 mysql-test/suite/jp/r/jp_insert_ucs2.result | 0 mysql-test/suite/jp/r/jp_insert_ujis.result | 0 mysql-test/suite/jp/r/jp_insert_utf8.result | 0 mysql-test/suite/jp/r/jp_instr_sjis.result | 0 mysql-test/suite/jp/r/jp_instr_ucs2.result | 0 mysql-test/suite/jp/r/jp_instr_ujis.result | 0 mysql-test/suite/jp/r/jp_instr_utf8.result | 0 mysql-test/suite/jp/r/jp_join_sjis.result | 0 mysql-test/suite/jp/r/jp_join_ucs2.result | 0 mysql-test/suite/jp/r/jp_join_ujis.result | 0 mysql-test/suite/jp/r/jp_join_utf8.result | 0 mysql-test/suite/jp/r/jp_left_sjis.result | 0 mysql-test/suite/jp/r/jp_left_ucs2.result | 0 mysql-test/suite/jp/r/jp_left_ujis.result | 0 mysql-test/suite/jp/r/jp_left_utf8.result | 0 mysql-test/suite/jp/r/jp_length_sjis.result | 0 mysql-test/suite/jp/r/jp_length_ucs2.result | 0 mysql-test/suite/jp/r/jp_length_ujis.result | 0 mysql-test/suite/jp/r/jp_length_utf8.result | 0 mysql-test/suite/jp/r/jp_like_sjis.result | 0 mysql-test/suite/jp/r/jp_like_ucs2.result | 0 mysql-test/suite/jp/r/jp_like_ujis.result | 0 mysql-test/suite/jp/r/jp_like_utf8.result | 0 mysql-test/suite/jp/r/jp_locate_sjis.result | 0 mysql-test/suite/jp/r/jp_locate_ucs2.result | 0 mysql-test/suite/jp/r/jp_locate_ujis.result | 0 mysql-test/suite/jp/r/jp_locate_utf8.result | 0 mysql-test/suite/jp/r/jp_lpad_sjis.result | 0 mysql-test/suite/jp/r/jp_lpad_ucs2.result | 0 mysql-test/suite/jp/r/jp_lpad_ujis.result | 0 mysql-test/suite/jp/r/jp_lpad_utf8.result | 0 mysql-test/suite/jp/r/jp_ltrim_sjis.result | 0 mysql-test/suite/jp/r/jp_ltrim_ucs2.result | 0 mysql-test/suite/jp/r/jp_ltrim_ujis.result | 0 mysql-test/suite/jp/r/jp_ltrim_utf8.result | 0 mysql-test/suite/jp/r/jp_ps_sjis.result | 0 mysql-test/suite/jp/r/jp_ps_ujis.result | 0 mysql-test/suite/jp/r/jp_replace_sjis.result | 0 mysql-test/suite/jp/r/jp_replace_ucs2.result | 0 mysql-test/suite/jp/r/jp_replace_ujis.result | 0 mysql-test/suite/jp/r/jp_replace_utf8.result | 0 mysql-test/suite/jp/r/jp_reverse_sjis.result | 0 mysql-test/suite/jp/r/jp_reverse_ucs2.result | 0 mysql-test/suite/jp/r/jp_reverse_ujis.result | 0 mysql-test/suite/jp/r/jp_reverse_utf8.result | 0 mysql-test/suite/jp/r/jp_right_sjis.result | 0 mysql-test/suite/jp/r/jp_right_ucs2.result | 0 mysql-test/suite/jp/r/jp_right_ujis.result | 0 mysql-test/suite/jp/r/jp_right_utf8.result | 0 mysql-test/suite/jp/r/jp_rpad_sjis.result | 0 mysql-test/suite/jp/r/jp_rpad_ucs2.result | 0 mysql-test/suite/jp/r/jp_rpad_ujis.result | 0 mysql-test/suite/jp/r/jp_rpad_utf8.result | 0 mysql-test/suite/jp/r/jp_rtrim_sjis.result | 0 mysql-test/suite/jp/r/jp_rtrim_ucs2.result | 0 mysql-test/suite/jp/r/jp_rtrim_ujis.result | 0 mysql-test/suite/jp/r/jp_rtrim_utf8.result | 0 mysql-test/suite/jp/r/jp_select_sjis.result | 0 mysql-test/suite/jp/r/jp_select_ucs2.result | 0 mysql-test/suite/jp/r/jp_select_ujis.result | 0 mysql-test/suite/jp/r/jp_select_utf8.result | 0 mysql-test/suite/jp/r/jp_subquery_sjis.result | 0 mysql-test/suite/jp/r/jp_subquery_ucs2.result | 0 mysql-test/suite/jp/r/jp_subquery_ujis.result | 0 mysql-test/suite/jp/r/jp_subquery_utf8.result | 0 mysql-test/suite/jp/r/jp_substring_sjis.result | 0 mysql-test/suite/jp/r/jp_substring_ucs2.result | 0 mysql-test/suite/jp/r/jp_substring_ujis.result | 0 mysql-test/suite/jp/r/jp_substring_utf8.result | 0 mysql-test/suite/jp/r/jp_trim_sjis.result | 0 mysql-test/suite/jp/r/jp_trim_ucs2.result | 0 mysql-test/suite/jp/r/jp_trim_ujis.result | 0 mysql-test/suite/jp/r/jp_trim_utf8.result | 0 mysql-test/suite/jp/r/jp_union_ujis.result | 0 mysql-test/suite/jp/r/jp_update_sjis.result | 0 mysql-test/suite/jp/r/jp_update_ucs2.result | 0 mysql-test/suite/jp/r/jp_update_ujis.result | 0 mysql-test/suite/jp/r/jp_update_utf8.result | 0 mysql-test/suite/jp/r/jp_where_sjis.result | 0 mysql-test/suite/jp/r/jp_where_ucs2.result | 0 mysql-test/suite/jp/r/jp_where_ujis.result | 0 mysql-test/suite/jp/r/jp_where_utf8.result | 0 mysql-test/suite/jp/std_data/jisx0201_sjis.dat | 0 mysql-test/suite/jp/std_data/jisx0201_ucs2.dat | Bin mysql-test/suite/jp/std_data/jisx0201_ujis.dat | 0 mysql-test/suite/jp/std_data/jisx0201_utf8.dat | 0 mysql-test/suite/jp/std_data/jisx0208_sjis.dat | 0 mysql-test/suite/jp/std_data/jisx0208_sjis2.dat | 0 mysql-test/suite/jp/std_data/jisx0208_sjis3.dat | 0 mysql-test/suite/jp/std_data/jisx0208_ucs2.dat | Bin mysql-test/suite/jp/std_data/jisx0208_ujis.dat | 0 mysql-test/suite/jp/std_data/jisx0208_utf8.dat | 0 mysql-test/suite/jp/std_data/jisx0212_ucs2.dat | Bin mysql-test/suite/jp/std_data/jisx0212_ujis.dat | 0 mysql-test/suite/jp/std_data/jisx0212_utf8.dat | 0 mysql-test/suite/jp/t/jp_alter_sjis.test | 0 mysql-test/suite/jp/t/jp_alter_ucs2.test | 0 mysql-test/suite/jp/t/jp_alter_ujis.test | 0 mysql-test/suite/jp/t/jp_alter_utf8.test | 0 mysql-test/suite/jp/t/jp_charlength_sjis.test | 0 mysql-test/suite/jp/t/jp_charlength_ucs2.test | 0 mysql-test/suite/jp/t/jp_charlength_ujis.test | 0 mysql-test/suite/jp/t/jp_charlength_utf8.test | 0 mysql-test/suite/jp/t/jp_charset_sjis.test | 0 mysql-test/suite/jp/t/jp_charset_ucs2.test | 0 mysql-test/suite/jp/t/jp_charset_ujis.test | 0 mysql-test/suite/jp/t/jp_charset_utf8.test | 0 mysql-test/suite/jp/t/jp_convert_sjis.test | 0 mysql-test/suite/jp/t/jp_convert_ucs2.test | 0 mysql-test/suite/jp/t/jp_convert_ujis.test | 0 mysql-test/suite/jp/t/jp_convert_utf8.test | 0 mysql-test/suite/jp/t/jp_create_db_sjis.test | 0 mysql-test/suite/jp/t/jp_create_db_ucs2.test | 0 mysql-test/suite/jp/t/jp_create_db_ujis.test | 0 mysql-test/suite/jp/t/jp_create_db_utf8.test | 0 mysql-test/suite/jp/t/jp_create_tbl_sjis.test | 0 mysql-test/suite/jp/t/jp_create_tbl_ucs2.test | 0 mysql-test/suite/jp/t/jp_create_tbl_ujis.test | 0 mysql-test/suite/jp/t/jp_create_tbl_utf8.test | 0 mysql-test/suite/jp/t/jp_enum_sjis.test | 0 mysql-test/suite/jp/t/jp_enum_ucs2.test | 0 mysql-test/suite/jp/t/jp_enum_ujis.test | 0 mysql-test/suite/jp/t/jp_enum_utf8.test | 0 mysql-test/suite/jp/t/jp_insert_sjis.test | 0 mysql-test/suite/jp/t/jp_insert_ucs2.test | 0 mysql-test/suite/jp/t/jp_insert_ujis.test | 0 mysql-test/suite/jp/t/jp_insert_utf8.test | 0 mysql-test/suite/jp/t/jp_instr_sjis.test | 0 mysql-test/suite/jp/t/jp_instr_ucs2.test | 0 mysql-test/suite/jp/t/jp_instr_ujis.test | 0 mysql-test/suite/jp/t/jp_instr_utf8.test | 0 mysql-test/suite/jp/t/jp_join_sjis.test | 0 mysql-test/suite/jp/t/jp_join_ucs2.test | 0 mysql-test/suite/jp/t/jp_join_ujis.test | 0 mysql-test/suite/jp/t/jp_join_utf8.test | 0 mysql-test/suite/jp/t/jp_left_sjis.test | 0 mysql-test/suite/jp/t/jp_left_ucs2.test | 0 mysql-test/suite/jp/t/jp_left_ujis.test | 0 mysql-test/suite/jp/t/jp_left_utf8.test | 0 mysql-test/suite/jp/t/jp_length_sjis.test | 0 mysql-test/suite/jp/t/jp_length_ucs2.test | 0 mysql-test/suite/jp/t/jp_length_ujis.test | 0 mysql-test/suite/jp/t/jp_length_utf8.test | 0 mysql-test/suite/jp/t/jp_like_sjis.test | 0 mysql-test/suite/jp/t/jp_like_ucs2.test | 0 mysql-test/suite/jp/t/jp_like_ujis.test | 0 mysql-test/suite/jp/t/jp_like_utf8.test | 0 mysql-test/suite/jp/t/jp_locate_sjis.test | 0 mysql-test/suite/jp/t/jp_locate_ucs2.test | 0 mysql-test/suite/jp/t/jp_locate_ujis.test | 0 mysql-test/suite/jp/t/jp_locate_utf8.test | 0 mysql-test/suite/jp/t/jp_lpad_sjis.test | 0 mysql-test/suite/jp/t/jp_lpad_ucs2.test | 0 mysql-test/suite/jp/t/jp_lpad_ujis.test | 0 mysql-test/suite/jp/t/jp_lpad_utf8.test | 0 mysql-test/suite/jp/t/jp_ltrim_sjis.test | 0 mysql-test/suite/jp/t/jp_ltrim_ucs2.test | 0 mysql-test/suite/jp/t/jp_ltrim_ujis.test | 0 mysql-test/suite/jp/t/jp_ltrim_utf8.test | 0 mysql-test/suite/jp/t/jp_ps_sjis.test | 0 mysql-test/suite/jp/t/jp_ps_ujis.test | 0 mysql-test/suite/jp/t/jp_replace_sjis.test | 0 mysql-test/suite/jp/t/jp_replace_ucs2.test | 0 mysql-test/suite/jp/t/jp_replace_ujis.test | 0 mysql-test/suite/jp/t/jp_replace_utf8.test | 0 mysql-test/suite/jp/t/jp_reverse_sjis.test | 0 mysql-test/suite/jp/t/jp_reverse_ucs2.test | 0 mysql-test/suite/jp/t/jp_reverse_ujis.test | 0 mysql-test/suite/jp/t/jp_reverse_utf8.test | 0 mysql-test/suite/jp/t/jp_right_sjis.test | 0 mysql-test/suite/jp/t/jp_right_ucs2.test | 0 mysql-test/suite/jp/t/jp_right_ujis.test | 0 mysql-test/suite/jp/t/jp_right_utf8.test | 0 mysql-test/suite/jp/t/jp_rpad_sjis.test | 0 mysql-test/suite/jp/t/jp_rpad_ucs2.test | 0 mysql-test/suite/jp/t/jp_rpad_ujis.test | 0 mysql-test/suite/jp/t/jp_rpad_utf8.test | 0 mysql-test/suite/jp/t/jp_rtrim_sjis.test | 0 mysql-test/suite/jp/t/jp_rtrim_ucs2.test | 0 mysql-test/suite/jp/t/jp_rtrim_ujis.test | 0 mysql-test/suite/jp/t/jp_rtrim_utf8.test | 0 mysql-test/suite/jp/t/jp_select_sjis.test | 0 mysql-test/suite/jp/t/jp_select_ucs2.test | 0 mysql-test/suite/jp/t/jp_select_ujis.test | 0 mysql-test/suite/jp/t/jp_select_utf8.test | 0 mysql-test/suite/jp/t/jp_subquery_sjis.test | 0 mysql-test/suite/jp/t/jp_subquery_ucs2.test | 0 mysql-test/suite/jp/t/jp_subquery_ujis.test | 0 mysql-test/suite/jp/t/jp_subquery_utf8.test | 0 mysql-test/suite/jp/t/jp_substring_sjis.test | 0 mysql-test/suite/jp/t/jp_substring_ucs2.test | 0 mysql-test/suite/jp/t/jp_substring_ujis.test | 0 mysql-test/suite/jp/t/jp_substring_utf8.test | 0 mysql-test/suite/jp/t/jp_trim_sjis.test | 0 mysql-test/suite/jp/t/jp_trim_ucs2.test | 0 mysql-test/suite/jp/t/jp_trim_ujis.test | 0 mysql-test/suite/jp/t/jp_trim_utf8.test | 0 mysql-test/suite/jp/t/jp_union_ujis.test | 0 mysql-test/suite/jp/t/jp_update_sjis.test | 0 mysql-test/suite/jp/t/jp_update_ucs2.test | 0 mysql-test/suite/jp/t/jp_update_ujis.test | 0 mysql-test/suite/jp/t/jp_update_utf8.test | 0 mysql-test/suite/jp/t/jp_where_sjis.test | 0 mysql-test/suite/jp/t/jp_where_ucs2.test | 0 mysql-test/suite/jp/t/jp_where_ujis.test | 0 mysql-test/suite/jp/t/jp_where_utf8.test | 0 235 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 mysql-test/suite/jp/r/jp_alter_sjis.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_alter_ucs2.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_alter_ujis.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_alter_utf8.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_charlength_sjis.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_charlength_ucs2.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_charlength_ujis.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_charlength_utf8.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_charset_sjis.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_charset_ucs2.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_charset_ujis.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_charset_utf8.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_convert_sjis.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_convert_ucs2.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_convert_ujis.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_convert_utf8.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_create_db_sjis.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_create_db_ucs2.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_create_db_ujis.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_create_db_utf8.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_create_tbl_sjis.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_create_tbl_ucs2.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_create_tbl_ujis.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_create_tbl_utf8.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_enum_sjis.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_enum_ucs2.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_enum_ujis.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_enum_utf8.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_insert_sjis.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_insert_ucs2.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_insert_ujis.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_insert_utf8.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_instr_sjis.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_instr_ucs2.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_instr_ujis.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_instr_utf8.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_join_sjis.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_join_ucs2.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_join_ujis.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_join_utf8.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_left_sjis.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_left_ucs2.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_left_ujis.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_left_utf8.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_length_sjis.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_length_ucs2.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_length_ujis.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_length_utf8.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_like_sjis.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_like_ucs2.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_like_ujis.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_like_utf8.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_locate_sjis.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_locate_ucs2.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_locate_ujis.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_locate_utf8.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_lpad_sjis.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_lpad_ucs2.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_lpad_ujis.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_lpad_utf8.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_ltrim_sjis.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_ltrim_ucs2.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_ltrim_ujis.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_ltrim_utf8.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_ps_sjis.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_ps_ujis.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_replace_sjis.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_replace_ucs2.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_replace_ujis.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_replace_utf8.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_reverse_sjis.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_reverse_ucs2.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_reverse_ujis.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_reverse_utf8.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_right_sjis.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_right_ucs2.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_right_ujis.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_right_utf8.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_rpad_sjis.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_rpad_ucs2.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_rpad_ujis.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_rpad_utf8.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_rtrim_sjis.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_rtrim_ucs2.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_rtrim_ujis.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_rtrim_utf8.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_select_sjis.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_select_ucs2.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_select_ujis.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_select_utf8.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_subquery_sjis.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_subquery_ucs2.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_subquery_ujis.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_subquery_utf8.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_substring_sjis.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_substring_ucs2.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_substring_ujis.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_substring_utf8.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_trim_sjis.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_trim_ucs2.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_trim_ujis.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_trim_utf8.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_union_ujis.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_update_sjis.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_update_ucs2.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_update_ujis.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_update_utf8.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_where_sjis.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_where_ucs2.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_where_ujis.result mode change 100755 => 100644 mysql-test/suite/jp/r/jp_where_utf8.result mode change 100755 => 100644 mysql-test/suite/jp/std_data/jisx0201_sjis.dat mode change 100755 => 100644 mysql-test/suite/jp/std_data/jisx0201_ucs2.dat mode change 100755 => 100644 mysql-test/suite/jp/std_data/jisx0201_ujis.dat mode change 100755 => 100644 mysql-test/suite/jp/std_data/jisx0201_utf8.dat mode change 100755 => 100644 mysql-test/suite/jp/std_data/jisx0208_sjis.dat mode change 100755 => 100644 mysql-test/suite/jp/std_data/jisx0208_sjis2.dat mode change 100755 => 100644 mysql-test/suite/jp/std_data/jisx0208_sjis3.dat mode change 100755 => 100644 mysql-test/suite/jp/std_data/jisx0208_ucs2.dat mode change 100755 => 100644 mysql-test/suite/jp/std_data/jisx0208_ujis.dat mode change 100755 => 100644 mysql-test/suite/jp/std_data/jisx0208_utf8.dat mode change 100755 => 100644 mysql-test/suite/jp/std_data/jisx0212_ucs2.dat mode change 100755 => 100644 mysql-test/suite/jp/std_data/jisx0212_ujis.dat mode change 100755 => 100644 mysql-test/suite/jp/std_data/jisx0212_utf8.dat mode change 100755 => 100644 mysql-test/suite/jp/t/jp_alter_sjis.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_alter_ucs2.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_alter_ujis.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_alter_utf8.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_charlength_sjis.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_charlength_ucs2.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_charlength_ujis.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_charlength_utf8.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_charset_sjis.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_charset_ucs2.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_charset_ujis.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_charset_utf8.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_convert_sjis.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_convert_ucs2.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_convert_ujis.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_convert_utf8.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_create_db_sjis.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_create_db_ucs2.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_create_db_ujis.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_create_db_utf8.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_create_tbl_sjis.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_create_tbl_ucs2.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_create_tbl_ujis.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_create_tbl_utf8.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_enum_sjis.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_enum_ucs2.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_enum_ujis.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_enum_utf8.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_insert_sjis.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_insert_ucs2.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_insert_ujis.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_insert_utf8.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_instr_sjis.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_instr_ucs2.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_instr_ujis.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_instr_utf8.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_join_sjis.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_join_ucs2.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_join_ujis.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_join_utf8.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_left_sjis.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_left_ucs2.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_left_ujis.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_left_utf8.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_length_sjis.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_length_ucs2.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_length_ujis.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_length_utf8.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_like_sjis.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_like_ucs2.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_like_ujis.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_like_utf8.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_locate_sjis.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_locate_ucs2.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_locate_ujis.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_locate_utf8.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_lpad_sjis.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_lpad_ucs2.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_lpad_ujis.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_lpad_utf8.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_ltrim_sjis.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_ltrim_ucs2.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_ltrim_ujis.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_ltrim_utf8.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_ps_sjis.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_ps_ujis.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_replace_sjis.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_replace_ucs2.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_replace_ujis.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_replace_utf8.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_reverse_sjis.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_reverse_ucs2.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_reverse_ujis.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_reverse_utf8.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_right_sjis.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_right_ucs2.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_right_ujis.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_right_utf8.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_rpad_sjis.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_rpad_ucs2.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_rpad_ujis.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_rpad_utf8.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_rtrim_sjis.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_rtrim_ucs2.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_rtrim_ujis.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_rtrim_utf8.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_select_sjis.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_select_ucs2.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_select_ujis.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_select_utf8.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_subquery_sjis.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_subquery_ucs2.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_subquery_ujis.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_subquery_utf8.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_substring_sjis.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_substring_ucs2.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_substring_ujis.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_substring_utf8.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_trim_sjis.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_trim_ucs2.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_trim_ujis.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_trim_utf8.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_union_ujis.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_update_sjis.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_update_ucs2.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_update_ujis.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_update_utf8.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_where_sjis.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_where_ucs2.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_where_ujis.test mode change 100755 => 100644 mysql-test/suite/jp/t/jp_where_utf8.test diff --git a/mysql-test/suite/jp/r/jp_alter_sjis.result b/mysql-test/suite/jp/r/jp_alter_sjis.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_alter_ucs2.result b/mysql-test/suite/jp/r/jp_alter_ucs2.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_alter_ujis.result b/mysql-test/suite/jp/r/jp_alter_ujis.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_alter_utf8.result b/mysql-test/suite/jp/r/jp_alter_utf8.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_charlength_sjis.result b/mysql-test/suite/jp/r/jp_charlength_sjis.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_charlength_ucs2.result b/mysql-test/suite/jp/r/jp_charlength_ucs2.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_charlength_ujis.result b/mysql-test/suite/jp/r/jp_charlength_ujis.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_charlength_utf8.result b/mysql-test/suite/jp/r/jp_charlength_utf8.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_charset_sjis.result b/mysql-test/suite/jp/r/jp_charset_sjis.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_charset_ucs2.result b/mysql-test/suite/jp/r/jp_charset_ucs2.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_charset_ujis.result b/mysql-test/suite/jp/r/jp_charset_ujis.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_charset_utf8.result b/mysql-test/suite/jp/r/jp_charset_utf8.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_convert_sjis.result b/mysql-test/suite/jp/r/jp_convert_sjis.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_convert_ucs2.result b/mysql-test/suite/jp/r/jp_convert_ucs2.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_convert_ujis.result b/mysql-test/suite/jp/r/jp_convert_ujis.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_convert_utf8.result b/mysql-test/suite/jp/r/jp_convert_utf8.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_create_db_sjis.result b/mysql-test/suite/jp/r/jp_create_db_sjis.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_create_db_ucs2.result b/mysql-test/suite/jp/r/jp_create_db_ucs2.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_create_db_ujis.result b/mysql-test/suite/jp/r/jp_create_db_ujis.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_create_db_utf8.result b/mysql-test/suite/jp/r/jp_create_db_utf8.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_create_tbl_sjis.result b/mysql-test/suite/jp/r/jp_create_tbl_sjis.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_create_tbl_ucs2.result b/mysql-test/suite/jp/r/jp_create_tbl_ucs2.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_create_tbl_ujis.result b/mysql-test/suite/jp/r/jp_create_tbl_ujis.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_create_tbl_utf8.result b/mysql-test/suite/jp/r/jp_create_tbl_utf8.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_enum_sjis.result b/mysql-test/suite/jp/r/jp_enum_sjis.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_enum_ucs2.result b/mysql-test/suite/jp/r/jp_enum_ucs2.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_enum_ujis.result b/mysql-test/suite/jp/r/jp_enum_ujis.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_enum_utf8.result b/mysql-test/suite/jp/r/jp_enum_utf8.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_insert_sjis.result b/mysql-test/suite/jp/r/jp_insert_sjis.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_insert_ucs2.result b/mysql-test/suite/jp/r/jp_insert_ucs2.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_insert_ujis.result b/mysql-test/suite/jp/r/jp_insert_ujis.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_insert_utf8.result b/mysql-test/suite/jp/r/jp_insert_utf8.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_instr_sjis.result b/mysql-test/suite/jp/r/jp_instr_sjis.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_instr_ucs2.result b/mysql-test/suite/jp/r/jp_instr_ucs2.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_instr_ujis.result b/mysql-test/suite/jp/r/jp_instr_ujis.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_instr_utf8.result b/mysql-test/suite/jp/r/jp_instr_utf8.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_join_sjis.result b/mysql-test/suite/jp/r/jp_join_sjis.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_join_ucs2.result b/mysql-test/suite/jp/r/jp_join_ucs2.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_join_ujis.result b/mysql-test/suite/jp/r/jp_join_ujis.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_join_utf8.result b/mysql-test/suite/jp/r/jp_join_utf8.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_left_sjis.result b/mysql-test/suite/jp/r/jp_left_sjis.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_left_ucs2.result b/mysql-test/suite/jp/r/jp_left_ucs2.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_left_ujis.result b/mysql-test/suite/jp/r/jp_left_ujis.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_left_utf8.result b/mysql-test/suite/jp/r/jp_left_utf8.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_length_sjis.result b/mysql-test/suite/jp/r/jp_length_sjis.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_length_ucs2.result b/mysql-test/suite/jp/r/jp_length_ucs2.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_length_ujis.result b/mysql-test/suite/jp/r/jp_length_ujis.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_length_utf8.result b/mysql-test/suite/jp/r/jp_length_utf8.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_like_sjis.result b/mysql-test/suite/jp/r/jp_like_sjis.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_like_ucs2.result b/mysql-test/suite/jp/r/jp_like_ucs2.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_like_ujis.result b/mysql-test/suite/jp/r/jp_like_ujis.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_like_utf8.result b/mysql-test/suite/jp/r/jp_like_utf8.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_locate_sjis.result b/mysql-test/suite/jp/r/jp_locate_sjis.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_locate_ucs2.result b/mysql-test/suite/jp/r/jp_locate_ucs2.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_locate_ujis.result b/mysql-test/suite/jp/r/jp_locate_ujis.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_locate_utf8.result b/mysql-test/suite/jp/r/jp_locate_utf8.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_lpad_sjis.result b/mysql-test/suite/jp/r/jp_lpad_sjis.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_lpad_ucs2.result b/mysql-test/suite/jp/r/jp_lpad_ucs2.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_lpad_ujis.result b/mysql-test/suite/jp/r/jp_lpad_ujis.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_lpad_utf8.result b/mysql-test/suite/jp/r/jp_lpad_utf8.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_ltrim_sjis.result b/mysql-test/suite/jp/r/jp_ltrim_sjis.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_ltrim_ucs2.result b/mysql-test/suite/jp/r/jp_ltrim_ucs2.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_ltrim_ujis.result b/mysql-test/suite/jp/r/jp_ltrim_ujis.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_ltrim_utf8.result b/mysql-test/suite/jp/r/jp_ltrim_utf8.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_ps_sjis.result b/mysql-test/suite/jp/r/jp_ps_sjis.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_ps_ujis.result b/mysql-test/suite/jp/r/jp_ps_ujis.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_replace_sjis.result b/mysql-test/suite/jp/r/jp_replace_sjis.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_replace_ucs2.result b/mysql-test/suite/jp/r/jp_replace_ucs2.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_replace_ujis.result b/mysql-test/suite/jp/r/jp_replace_ujis.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_replace_utf8.result b/mysql-test/suite/jp/r/jp_replace_utf8.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_reverse_sjis.result b/mysql-test/suite/jp/r/jp_reverse_sjis.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_reverse_ucs2.result b/mysql-test/suite/jp/r/jp_reverse_ucs2.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_reverse_ujis.result b/mysql-test/suite/jp/r/jp_reverse_ujis.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_reverse_utf8.result b/mysql-test/suite/jp/r/jp_reverse_utf8.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_right_sjis.result b/mysql-test/suite/jp/r/jp_right_sjis.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_right_ucs2.result b/mysql-test/suite/jp/r/jp_right_ucs2.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_right_ujis.result b/mysql-test/suite/jp/r/jp_right_ujis.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_right_utf8.result b/mysql-test/suite/jp/r/jp_right_utf8.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_rpad_sjis.result b/mysql-test/suite/jp/r/jp_rpad_sjis.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_rpad_ucs2.result b/mysql-test/suite/jp/r/jp_rpad_ucs2.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_rpad_ujis.result b/mysql-test/suite/jp/r/jp_rpad_ujis.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_rpad_utf8.result b/mysql-test/suite/jp/r/jp_rpad_utf8.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_rtrim_sjis.result b/mysql-test/suite/jp/r/jp_rtrim_sjis.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_rtrim_ucs2.result b/mysql-test/suite/jp/r/jp_rtrim_ucs2.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_rtrim_ujis.result b/mysql-test/suite/jp/r/jp_rtrim_ujis.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_rtrim_utf8.result b/mysql-test/suite/jp/r/jp_rtrim_utf8.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_select_sjis.result b/mysql-test/suite/jp/r/jp_select_sjis.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_select_ucs2.result b/mysql-test/suite/jp/r/jp_select_ucs2.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_select_ujis.result b/mysql-test/suite/jp/r/jp_select_ujis.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_select_utf8.result b/mysql-test/suite/jp/r/jp_select_utf8.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_subquery_sjis.result b/mysql-test/suite/jp/r/jp_subquery_sjis.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_subquery_ucs2.result b/mysql-test/suite/jp/r/jp_subquery_ucs2.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_subquery_ujis.result b/mysql-test/suite/jp/r/jp_subquery_ujis.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_subquery_utf8.result b/mysql-test/suite/jp/r/jp_subquery_utf8.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_substring_sjis.result b/mysql-test/suite/jp/r/jp_substring_sjis.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_substring_ucs2.result b/mysql-test/suite/jp/r/jp_substring_ucs2.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_substring_ujis.result b/mysql-test/suite/jp/r/jp_substring_ujis.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_substring_utf8.result b/mysql-test/suite/jp/r/jp_substring_utf8.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_trim_sjis.result b/mysql-test/suite/jp/r/jp_trim_sjis.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_trim_ucs2.result b/mysql-test/suite/jp/r/jp_trim_ucs2.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_trim_ujis.result b/mysql-test/suite/jp/r/jp_trim_ujis.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_trim_utf8.result b/mysql-test/suite/jp/r/jp_trim_utf8.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_union_ujis.result b/mysql-test/suite/jp/r/jp_union_ujis.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_update_sjis.result b/mysql-test/suite/jp/r/jp_update_sjis.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_update_ucs2.result b/mysql-test/suite/jp/r/jp_update_ucs2.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_update_ujis.result b/mysql-test/suite/jp/r/jp_update_ujis.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_update_utf8.result b/mysql-test/suite/jp/r/jp_update_utf8.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_where_sjis.result b/mysql-test/suite/jp/r/jp_where_sjis.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_where_ucs2.result b/mysql-test/suite/jp/r/jp_where_ucs2.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_where_ujis.result b/mysql-test/suite/jp/r/jp_where_ujis.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/r/jp_where_utf8.result b/mysql-test/suite/jp/r/jp_where_utf8.result old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/std_data/jisx0201_sjis.dat b/mysql-test/suite/jp/std_data/jisx0201_sjis.dat old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/std_data/jisx0201_ucs2.dat b/mysql-test/suite/jp/std_data/jisx0201_ucs2.dat old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/std_data/jisx0201_ujis.dat b/mysql-test/suite/jp/std_data/jisx0201_ujis.dat old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/std_data/jisx0201_utf8.dat b/mysql-test/suite/jp/std_data/jisx0201_utf8.dat old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/std_data/jisx0208_sjis.dat b/mysql-test/suite/jp/std_data/jisx0208_sjis.dat old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/std_data/jisx0208_sjis2.dat b/mysql-test/suite/jp/std_data/jisx0208_sjis2.dat old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/std_data/jisx0208_sjis3.dat b/mysql-test/suite/jp/std_data/jisx0208_sjis3.dat old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/std_data/jisx0208_ucs2.dat b/mysql-test/suite/jp/std_data/jisx0208_ucs2.dat old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/std_data/jisx0208_ujis.dat b/mysql-test/suite/jp/std_data/jisx0208_ujis.dat old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/std_data/jisx0208_utf8.dat b/mysql-test/suite/jp/std_data/jisx0208_utf8.dat old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/std_data/jisx0212_ucs2.dat b/mysql-test/suite/jp/std_data/jisx0212_ucs2.dat old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/std_data/jisx0212_ujis.dat b/mysql-test/suite/jp/std_data/jisx0212_ujis.dat old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/std_data/jisx0212_utf8.dat b/mysql-test/suite/jp/std_data/jisx0212_utf8.dat old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_alter_sjis.test b/mysql-test/suite/jp/t/jp_alter_sjis.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_alter_ucs2.test b/mysql-test/suite/jp/t/jp_alter_ucs2.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_alter_ujis.test b/mysql-test/suite/jp/t/jp_alter_ujis.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_alter_utf8.test b/mysql-test/suite/jp/t/jp_alter_utf8.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_charlength_sjis.test b/mysql-test/suite/jp/t/jp_charlength_sjis.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_charlength_ucs2.test b/mysql-test/suite/jp/t/jp_charlength_ucs2.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_charlength_ujis.test b/mysql-test/suite/jp/t/jp_charlength_ujis.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_charlength_utf8.test b/mysql-test/suite/jp/t/jp_charlength_utf8.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_charset_sjis.test b/mysql-test/suite/jp/t/jp_charset_sjis.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_charset_ucs2.test b/mysql-test/suite/jp/t/jp_charset_ucs2.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_charset_ujis.test b/mysql-test/suite/jp/t/jp_charset_ujis.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_charset_utf8.test b/mysql-test/suite/jp/t/jp_charset_utf8.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_convert_sjis.test b/mysql-test/suite/jp/t/jp_convert_sjis.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_convert_ucs2.test b/mysql-test/suite/jp/t/jp_convert_ucs2.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_convert_ujis.test b/mysql-test/suite/jp/t/jp_convert_ujis.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_convert_utf8.test b/mysql-test/suite/jp/t/jp_convert_utf8.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_create_db_sjis.test b/mysql-test/suite/jp/t/jp_create_db_sjis.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_create_db_ucs2.test b/mysql-test/suite/jp/t/jp_create_db_ucs2.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_create_db_ujis.test b/mysql-test/suite/jp/t/jp_create_db_ujis.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_create_db_utf8.test b/mysql-test/suite/jp/t/jp_create_db_utf8.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_create_tbl_sjis.test b/mysql-test/suite/jp/t/jp_create_tbl_sjis.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_create_tbl_ucs2.test b/mysql-test/suite/jp/t/jp_create_tbl_ucs2.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_create_tbl_ujis.test b/mysql-test/suite/jp/t/jp_create_tbl_ujis.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_create_tbl_utf8.test b/mysql-test/suite/jp/t/jp_create_tbl_utf8.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_enum_sjis.test b/mysql-test/suite/jp/t/jp_enum_sjis.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_enum_ucs2.test b/mysql-test/suite/jp/t/jp_enum_ucs2.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_enum_ujis.test b/mysql-test/suite/jp/t/jp_enum_ujis.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_enum_utf8.test b/mysql-test/suite/jp/t/jp_enum_utf8.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_insert_sjis.test b/mysql-test/suite/jp/t/jp_insert_sjis.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_insert_ucs2.test b/mysql-test/suite/jp/t/jp_insert_ucs2.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_insert_ujis.test b/mysql-test/suite/jp/t/jp_insert_ujis.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_insert_utf8.test b/mysql-test/suite/jp/t/jp_insert_utf8.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_instr_sjis.test b/mysql-test/suite/jp/t/jp_instr_sjis.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_instr_ucs2.test b/mysql-test/suite/jp/t/jp_instr_ucs2.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_instr_ujis.test b/mysql-test/suite/jp/t/jp_instr_ujis.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_instr_utf8.test b/mysql-test/suite/jp/t/jp_instr_utf8.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_join_sjis.test b/mysql-test/suite/jp/t/jp_join_sjis.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_join_ucs2.test b/mysql-test/suite/jp/t/jp_join_ucs2.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_join_ujis.test b/mysql-test/suite/jp/t/jp_join_ujis.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_join_utf8.test b/mysql-test/suite/jp/t/jp_join_utf8.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_left_sjis.test b/mysql-test/suite/jp/t/jp_left_sjis.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_left_ucs2.test b/mysql-test/suite/jp/t/jp_left_ucs2.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_left_ujis.test b/mysql-test/suite/jp/t/jp_left_ujis.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_left_utf8.test b/mysql-test/suite/jp/t/jp_left_utf8.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_length_sjis.test b/mysql-test/suite/jp/t/jp_length_sjis.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_length_ucs2.test b/mysql-test/suite/jp/t/jp_length_ucs2.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_length_ujis.test b/mysql-test/suite/jp/t/jp_length_ujis.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_length_utf8.test b/mysql-test/suite/jp/t/jp_length_utf8.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_like_sjis.test b/mysql-test/suite/jp/t/jp_like_sjis.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_like_ucs2.test b/mysql-test/suite/jp/t/jp_like_ucs2.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_like_ujis.test b/mysql-test/suite/jp/t/jp_like_ujis.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_like_utf8.test b/mysql-test/suite/jp/t/jp_like_utf8.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_locate_sjis.test b/mysql-test/suite/jp/t/jp_locate_sjis.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_locate_ucs2.test b/mysql-test/suite/jp/t/jp_locate_ucs2.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_locate_ujis.test b/mysql-test/suite/jp/t/jp_locate_ujis.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_locate_utf8.test b/mysql-test/suite/jp/t/jp_locate_utf8.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_lpad_sjis.test b/mysql-test/suite/jp/t/jp_lpad_sjis.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_lpad_ucs2.test b/mysql-test/suite/jp/t/jp_lpad_ucs2.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_lpad_ujis.test b/mysql-test/suite/jp/t/jp_lpad_ujis.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_lpad_utf8.test b/mysql-test/suite/jp/t/jp_lpad_utf8.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_ltrim_sjis.test b/mysql-test/suite/jp/t/jp_ltrim_sjis.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_ltrim_ucs2.test b/mysql-test/suite/jp/t/jp_ltrim_ucs2.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_ltrim_ujis.test b/mysql-test/suite/jp/t/jp_ltrim_ujis.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_ltrim_utf8.test b/mysql-test/suite/jp/t/jp_ltrim_utf8.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_ps_sjis.test b/mysql-test/suite/jp/t/jp_ps_sjis.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_ps_ujis.test b/mysql-test/suite/jp/t/jp_ps_ujis.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_replace_sjis.test b/mysql-test/suite/jp/t/jp_replace_sjis.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_replace_ucs2.test b/mysql-test/suite/jp/t/jp_replace_ucs2.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_replace_ujis.test b/mysql-test/suite/jp/t/jp_replace_ujis.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_replace_utf8.test b/mysql-test/suite/jp/t/jp_replace_utf8.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_reverse_sjis.test b/mysql-test/suite/jp/t/jp_reverse_sjis.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_reverse_ucs2.test b/mysql-test/suite/jp/t/jp_reverse_ucs2.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_reverse_ujis.test b/mysql-test/suite/jp/t/jp_reverse_ujis.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_reverse_utf8.test b/mysql-test/suite/jp/t/jp_reverse_utf8.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_right_sjis.test b/mysql-test/suite/jp/t/jp_right_sjis.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_right_ucs2.test b/mysql-test/suite/jp/t/jp_right_ucs2.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_right_ujis.test b/mysql-test/suite/jp/t/jp_right_ujis.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_right_utf8.test b/mysql-test/suite/jp/t/jp_right_utf8.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_rpad_sjis.test b/mysql-test/suite/jp/t/jp_rpad_sjis.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_rpad_ucs2.test b/mysql-test/suite/jp/t/jp_rpad_ucs2.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_rpad_ujis.test b/mysql-test/suite/jp/t/jp_rpad_ujis.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_rpad_utf8.test b/mysql-test/suite/jp/t/jp_rpad_utf8.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_rtrim_sjis.test b/mysql-test/suite/jp/t/jp_rtrim_sjis.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_rtrim_ucs2.test b/mysql-test/suite/jp/t/jp_rtrim_ucs2.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_rtrim_ujis.test b/mysql-test/suite/jp/t/jp_rtrim_ujis.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_rtrim_utf8.test b/mysql-test/suite/jp/t/jp_rtrim_utf8.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_select_sjis.test b/mysql-test/suite/jp/t/jp_select_sjis.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_select_ucs2.test b/mysql-test/suite/jp/t/jp_select_ucs2.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_select_ujis.test b/mysql-test/suite/jp/t/jp_select_ujis.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_select_utf8.test b/mysql-test/suite/jp/t/jp_select_utf8.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_subquery_sjis.test b/mysql-test/suite/jp/t/jp_subquery_sjis.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_subquery_ucs2.test b/mysql-test/suite/jp/t/jp_subquery_ucs2.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_subquery_ujis.test b/mysql-test/suite/jp/t/jp_subquery_ujis.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_subquery_utf8.test b/mysql-test/suite/jp/t/jp_subquery_utf8.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_substring_sjis.test b/mysql-test/suite/jp/t/jp_substring_sjis.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_substring_ucs2.test b/mysql-test/suite/jp/t/jp_substring_ucs2.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_substring_ujis.test b/mysql-test/suite/jp/t/jp_substring_ujis.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_substring_utf8.test b/mysql-test/suite/jp/t/jp_substring_utf8.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_trim_sjis.test b/mysql-test/suite/jp/t/jp_trim_sjis.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_trim_ucs2.test b/mysql-test/suite/jp/t/jp_trim_ucs2.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_trim_ujis.test b/mysql-test/suite/jp/t/jp_trim_ujis.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_trim_utf8.test b/mysql-test/suite/jp/t/jp_trim_utf8.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_union_ujis.test b/mysql-test/suite/jp/t/jp_union_ujis.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_update_sjis.test b/mysql-test/suite/jp/t/jp_update_sjis.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_update_ucs2.test b/mysql-test/suite/jp/t/jp_update_ucs2.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_update_ujis.test b/mysql-test/suite/jp/t/jp_update_ujis.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_update_utf8.test b/mysql-test/suite/jp/t/jp_update_utf8.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_where_sjis.test b/mysql-test/suite/jp/t/jp_where_sjis.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_where_ucs2.test b/mysql-test/suite/jp/t/jp_where_ucs2.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_where_ujis.test b/mysql-test/suite/jp/t/jp_where_ujis.test old mode 100755 new mode 100644 diff --git a/mysql-test/suite/jp/t/jp_where_utf8.test b/mysql-test/suite/jp/t/jp_where_utf8.test old mode 100755 new mode 100644 From 0c57a67ce0434fa78e2b64f569a271d166371a32 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 7 Jan 2005 17:44:18 +0100 Subject: [PATCH 0673/1063] Correctly truncate integers inserted into field and double columns with a number of decimals specified. (Bug #7361) mysql-test/t/type_float.test: Add test for maximum values of float and double columns with number of decimals mysql-test/r/type_float.result: Add results for new test mysql-test/r/type_float.result.es: Add results for new test sql/field.cc: Use ::store(double nr) from ::store(longlong nr) so we get the same range checking --- mysql-test/r/type_float.result | 36 +++++++++++++++++++++++++++++++ mysql-test/r/type_float.result.es | 36 +++++++++++++++++++++++++++++++ mysql-test/t/type_float.test | 10 +++++++++ sql/field.cc | 36 ++----------------------------- 4 files changed, 84 insertions(+), 34 deletions(-) diff --git a/mysql-test/r/type_float.result b/mysql-test/r/type_float.result index 2f996382586..9dd92c13c98 100644 --- a/mysql-test/r/type_float.result +++ b/mysql-test/r/type_float.result @@ -143,3 +143,39 @@ drop table t1; create table t1 (f float(54)); ERROR 42000: Incorrect column specifier for column 'f' drop table if exists t1; +create table t1 (f float(4,3)); +insert into t1 values (-11.0),(-11),("-11"),(11.0),(11),("11"); +Warnings: +Warning 1264 Data truncated; out of range for column 'f' at row 1 +Warning 1264 Data truncated; out of range for column 'f' at row 2 +Warning 1264 Data truncated; out of range for column 'f' at row 3 +Warning 1264 Data truncated; out of range for column 'f' at row 4 +Warning 1264 Data truncated; out of range for column 'f' at row 5 +Warning 1264 Data truncated; out of range for column 'f' at row 6 +select * from t1; +f +-9.999 +-9.999 +-9.999 +9.999 +9.999 +9.999 +drop table if exists t1; +create table t1 (f double(4,3)); +insert into t1 values (-11.0),(-11),("-11"),(11.0),(11),("11"); +Warnings: +Warning 1264 Data truncated; out of range for column 'f' at row 1 +Warning 1264 Data truncated; out of range for column 'f' at row 2 +Warning 1264 Data truncated; out of range for column 'f' at row 3 +Warning 1264 Data truncated; out of range for column 'f' at row 4 +Warning 1264 Data truncated; out of range for column 'f' at row 5 +Warning 1264 Data truncated; out of range for column 'f' at row 6 +select * from t1; +f +-9.999 +-9.999 +-9.999 +9.999 +9.999 +9.999 +drop table if exists t1; diff --git a/mysql-test/r/type_float.result.es b/mysql-test/r/type_float.result.es index 4bfe644d7fb..64d9be7e30f 100644 --- a/mysql-test/r/type_float.result.es +++ b/mysql-test/r/type_float.result.es @@ -143,3 +143,39 @@ drop table t1; create table t1 (f float(54)); ERROR 42000: Incorrect column specifier for column 'f' drop table if exists t1; +create table t1 (f float(4,3)); +insert into t1 values (-11.0),(-11),("-11"),(11.0),(11),("11"); +Warnings: +Warning 1264 Data truncated; out of range for column 'f' at row 1 +Warning 1264 Data truncated; out of range for column 'f' at row 2 +Warning 1264 Data truncated; out of range for column 'f' at row 3 +Warning 1264 Data truncated; out of range for column 'f' at row 4 +Warning 1264 Data truncated; out of range for column 'f' at row 5 +Warning 1264 Data truncated; out of range for column 'f' at row 6 +select * from t1; +f +-9.999 +-9.999 +-9.999 +9.999 +9.999 +9.999 +drop table if exists t1; +create table t1 (f double(4,3)); +insert into t1 values (-11.0),(-11),("-11"),(11.0),(11),("11"); +Warnings: +Warning 1264 Data truncated; out of range for column 'f' at row 1 +Warning 1264 Data truncated; out of range for column 'f' at row 2 +Warning 1264 Data truncated; out of range for column 'f' at row 3 +Warning 1264 Data truncated; out of range for column 'f' at row 4 +Warning 1264 Data truncated; out of range for column 'f' at row 5 +Warning 1264 Data truncated; out of range for column 'f' at row 6 +select * from t1; +f +-9.999 +-9.999 +-9.999 +9.999 +9.999 +9.999 +drop table if exists t1; diff --git a/mysql-test/t/type_float.test b/mysql-test/t/type_float.test index 26ac272c6d4..3fe3afa3fac 100644 --- a/mysql-test/t/type_float.test +++ b/mysql-test/t/type_float.test @@ -93,3 +93,13 @@ create table t1 (f float(54)); # Should give an error drop table if exists t1; --enable_warnings +# Ensure that maximum values as the result of number of decimals +# being specified in table schema are enforced (Bug #7361) +create table t1 (f float(4,3)); +insert into t1 values (-11.0),(-11),("-11"),(11.0),(11),("11"); +select * from t1; +drop table if exists t1; +create table t1 (f double(4,3)); +insert into t1 values (-11.0),(-11),("-11"),(11.0),(11),("11"); +select * from t1; +drop table if exists t1; diff --git a/sql/field.cc b/sql/field.cc index b27a319b00e..e2c11cc7372 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -2395,23 +2395,7 @@ int Field_float::store(double nr) int Field_float::store(longlong nr) { - int error= 0; - float j= (float) nr; - if (unsigned_flag && j < 0) - { - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); - j=0; - error= 1; - } -#ifdef WORDS_BIGENDIAN - if (table->db_low_byte_first) - { - float4store(ptr,j); - } - else -#endif - memcpy_fixed(ptr,(byte*) &j,sizeof(j)); - return error; + return store((double)nr); } @@ -2690,23 +2674,7 @@ int Field_double::store(double nr) int Field_double::store(longlong nr) { - double j= (double) nr; - int error= 0; - if (unsigned_flag && j < 0) - { - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, 1); - error= 1; - j=0; - } -#ifdef WORDS_BIGENDIAN - if (table->db_low_byte_first) - { - float8store(ptr,j); - } - else -#endif - doublestore(ptr,j); - return error; + return store((double)nr); } From e167837a6325c388ecc09fb0ecbfbfac7d84a8a5 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 7 Jan 2005 14:17:08 -0600 Subject: [PATCH 0674/1063] set_var.cc: Reorder variables to properly alphabetize SHOW VARIABLES output. sql/set_var.cc: Reorder variables to properly alphabetize SHOW VARIABLES output. --- sql/set_var.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/set_var.cc b/sql/set_var.cc index 082c55db188..2a5242ece7e 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -711,11 +711,11 @@ struct show_var_st init_vars[]= { {"innodb_fast_shutdown", (char*) &innobase_fast_shutdown, SHOW_MY_BOOL}, {"innodb_file_io_threads", (char*) &innobase_file_io_threads, SHOW_LONG }, {"innodb_file_per_table", (char*) &innobase_file_per_table, SHOW_MY_BOOL}, - {"innodb_locks_unsafe_for_binlog", (char*) &innobase_locks_unsafe_for_binlog, SHOW_MY_BOOL}, {"innodb_flush_log_at_trx_commit", (char*) &innobase_flush_log_at_trx_commit, SHOW_INT}, {"innodb_flush_method", (char*) &innobase_unix_file_flush_method, SHOW_CHAR_PTR}, {"innodb_force_recovery", (char*) &innobase_force_recovery, SHOW_LONG }, {"innodb_lock_wait_timeout", (char*) &innobase_lock_wait_timeout, SHOW_LONG }, + {"innodb_locks_unsafe_for_binlog", (char*) &innobase_locks_unsafe_for_binlog, SHOW_MY_BOOL}, {"innodb_log_arch_dir", (char*) &innobase_log_arch_dir, SHOW_CHAR_PTR}, {"innodb_log_archive", (char*) &innobase_log_archive, SHOW_MY_BOOL}, {"innodb_log_buffer_size", (char*) &innobase_log_buffer_size, SHOW_LONG }, @@ -724,10 +724,10 @@ struct show_var_st init_vars[]= { {"innodb_log_group_home_dir", (char*) &innobase_log_group_home_dir, SHOW_CHAR_PTR}, {sys_innodb_max_dirty_pages_pct.name, (char*) &sys_innodb_max_dirty_pages_pct, SHOW_SYS}, {sys_innodb_max_purge_lag.name, (char*) &sys_innodb_max_purge_lag, SHOW_SYS}, - {sys_innodb_table_locks.name, (char*) &sys_innodb_table_locks, SHOW_SYS}, {sys_innodb_max_purge_lag.name, (char*) &sys_innodb_max_purge_lag, SHOW_SYS}, {"innodb_mirrored_log_groups", (char*) &innobase_mirrored_log_groups, SHOW_LONG}, {"innodb_open_files", (char*) &innobase_open_files, SHOW_LONG }, + {sys_innodb_table_locks.name, (char*) &sys_innodb_table_locks, SHOW_SYS}, {"innodb_thread_concurrency", (char*) &innobase_thread_concurrency, SHOW_LONG }, #endif {sys_interactive_timeout.name,(char*) &sys_interactive_timeout, SHOW_SYS}, From 00c4dfec19aba6c40d06e24fd71976226c225ea8 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 8 Jan 2005 05:32:47 +0100 Subject: [PATCH 0675/1063] Fix unportable 'tr' usage in libedit build process. (Bug #7669) cmd-line-utils/libedit/makelist.sh: Spell out the character range for braindead versions of tr (like /usr/xpg4/bin/tr on Sun Solaris 2.10) --- cmd-line-utils/libedit/makelist.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd-line-utils/libedit/makelist.sh b/cmd-line-utils/libedit/makelist.sh index fbce06fcc50..b2502d16ed1 100644 --- a/cmd-line-utils/libedit/makelist.sh +++ b/cmd-line-utils/libedit/makelist.sh @@ -145,7 +145,7 @@ case $FLAG in # -fh) cat $FILES | $AWK '/el_action_t/ { print $3 }' | \ - sort | tr '[a-z]' '[A-Z]' | $AWK ' + sort | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ | $AWK ' BEGIN { printf("/* Automatically generated file, do not edit */\n"); printf("#ifndef _h_fcns_c\n#define _h_fcns_c\n"); From 76266f19e8a1f3fd4ec019a07775e3c8edf699a4 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 8 Jan 2005 06:15:41 +0100 Subject: [PATCH 0676/1063] Show the index type even for indexes using the default index type in tables that support multiple index types. (Bug #7235) sql/sql_show.cc: Always output 'TYPE ' for indexes on tables with multiple index types mysql-test/r/ctype_utf8.result: Fix results for test --- mysql-test/r/ctype_utf8.result | 4 ++-- sql/sql_show.cc | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result index 599d49208e7..6140fd04c9c 100644 --- a/mysql-test/r/ctype_utf8.result +++ b/mysql-test/r/ctype_utf8.result @@ -412,7 +412,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `c` char(10) character set utf8 default NULL, - UNIQUE KEY `a` (`c`(1)) + UNIQUE KEY `a` TYPE HASH (`c`(1)) ) ENGINE=HEAP DEFAULT CHARSET=latin1 insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f'); insert into t1 values ('aa'); @@ -570,7 +570,7 @@ show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `c` char(10) character set utf8 collate utf8_bin default NULL, - UNIQUE KEY `a` (`c`(1)) + UNIQUE KEY `a` TYPE HASH (`c`(1)) ) ENGINE=HEAP DEFAULT CHARSET=latin1 insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f'); insert into t1 values ('aa'); diff --git a/sql/sql_show.cc b/sql/sql_show.cc index ba13dd1ff04..a3f497d71ae 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -1406,14 +1406,18 @@ store_create_info(THD *thd, TABLE *table, String *packet) if (!(thd->variables.sql_mode & MODE_NO_KEY_OPTIONS) && !limited_mysql_mode && !foreign_db_mode) { - if (table->db_type == DB_TYPE_HEAP && - key_info->algorithm == HA_KEY_ALG_BTREE) + if (key_info->algorithm == HA_KEY_ALG_BTREE) packet->append(" TYPE BTREE", 11); + if (key_info->algorithm == HA_KEY_ALG_HASH) + packet->append(" TYPE HASH", 10); + // +BAR: send USING only in non-default case: non-spatial rtree if ((key_info->algorithm == HA_KEY_ALG_RTREE) && !(key_info->flags & HA_SPATIAL)) packet->append(" TYPE RTREE", 11); + + // No need to send TYPE FULLTEXT, it is sent as FULLTEXT KEY } packet->append(" (", 2); From ce6de604c899167d930d01f8500bbd81d1f0e24b Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 8 Jan 2005 13:59:57 +0100 Subject: [PATCH 0677/1063] ndb - wl-1442 bug#7725 datetime ordering mysql-test/t/ndb_index_ordered.test: wl-1442 datetime ordering ndb/src/common/util/NdbSqlUtil.cpp: wl-1442 datetime ordering --- mysql-test/t/ndb_index_ordered.test | 29 +++++++++++++++++++++++++++++ ndb/src/common/util/NdbSqlUtil.cpp | 24 ++++++++++-------------- 2 files changed, 39 insertions(+), 14 deletions(-) diff --git a/mysql-test/t/ndb_index_ordered.test b/mysql-test/t/ndb_index_ordered.test index 53177511bc6..c5d3a83a3ab 100644 --- a/mysql-test/t/ndb_index_ordered.test +++ b/mysql-test/t/ndb_index_ordered.test @@ -172,3 +172,32 @@ SELECT s.SubscrID,l.SbclID FROM test1 s left JOIN test2 l ON l.SbcrID=s.SubscrID WHERE s.UsrID=224 order by 1, 2; drop table test1; drop table test2; + +# bug#7424 + bug#7725 + +create table t1 ( + pk int primary key, + dt datetime not null, + da date not null, + ye year not null, + ti time not null, + ts timestamp not null, + index(dt), + index(da), + index(ye), + index(ti), + index(ts) +) engine=ndb; + +insert into t1 (pk,dt,da,ye,ti) values + (1, '1901-05-05 23:00:59', '1901-05-05', '1901', '23:00:59'), + (2, '1955-12-31 00:00:00', '1955-12-31', '1955', '00:00:00'), + (3, '1999-06-06 06:06:06', '1999-06-06', '1999', '06:06:06'), + (4, '2001-01-01 10:11:11', '2001-01-01', '2001', '10:11:11'), + (5, '2005-01-31 23:59:59', '2005-01-31', '2005', '23:59:59'); + +# datetime +select count(*) from t1 use index (dt) where dt > '1900-01-01 00:00:00'; +select count(*) from t1 use index (dt) where dt > '1955-12-31 00:00:00'; +select count(*) from t1 use index (dt) where dt < '2001-01-01 10:11:11'; +select count(*) from t1 use index (dt) where dt < '2001-01-01 10:11:12'; diff --git a/ndb/src/common/util/NdbSqlUtil.cpp b/ndb/src/common/util/NdbSqlUtil.cpp index 5b2381df50a..8491fa3c4a0 100644 --- a/ndb/src/common/util/NdbSqlUtil.cpp +++ b/ndb/src/common/util/NdbSqlUtil.cpp @@ -469,21 +469,17 @@ int NdbSqlUtil::cmpDatetime(const void* info, const Uint32* p1, const Uint32* p2, Uint32 full, Uint32 size) { assert(full >= size && size > 0); - /* - * Datetime is CC YY MM DD hh mm ss \0 - * - * Not used via MySQL. - */ - union { const Uint32* p; const unsigned char* v; } u1, u2; - u1.p = p1; - u2.p = p2; - // no format check - int k = memcmp(u1.v, u2.v, 4); - if (k != 0) - return k < 0 ? -1 : +1; if (size >= 2) { - k = memcmp(u1.v + 4, u2.v + 4, 4); - return k < 0 ? -1 : k > 0 ? +1 : 0; + union { Uint32 p[2]; Int64 v; } u1, u2; + u1.p[0] = p1[0]; + u1.p[1] = p1[1]; + u2.p[0] = p2[0]; + u2.p[1] = p2[1]; + if (u1.v < u2.v) + return -1; + if (u1.v > u2.v) + return +1; + return 0; } return CmpUnknown; } From 2a3f285eb5a0c3156fc768f886e17d9cc7f1d195 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 8 Jan 2005 15:18:24 +0100 Subject: [PATCH 0678/1063] ndb - wl-1442 updated ndb_index_ordered.result mysql-test/r/ndb_index_ordered.result: wl-1442 missed result file --- mysql-test/r/ndb_index_ordered.result | 31 +++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/mysql-test/r/ndb_index_ordered.result b/mysql-test/r/ndb_index_ordered.result index 50f904af750..a3eb5630131 100644 --- a/mysql-test/r/ndb_index_ordered.result +++ b/mysql-test/r/ndb_index_ordered.result @@ -310,3 +310,34 @@ SubscrID SbclID 3 NULL drop table test1; drop table test2; +create table t1 ( +pk int primary key, +dt datetime not null, +da date not null, +ye year not null, +ti time not null, +ts timestamp not null, +index(dt), +index(da), +index(ye), +index(ti), +index(ts) +) engine=ndb; +insert into t1 (pk,dt,da,ye,ti) values +(1, '1901-05-05 23:00:59', '1901-05-05', '1901', '23:00:59'), +(2, '1955-12-31 00:00:00', '1955-12-31', '1955', '00:00:00'), +(3, '1999-06-06 06:06:06', '1999-06-06', '1999', '06:06:06'), +(4, '2001-01-01 10:11:11', '2001-01-01', '2001', '10:11:11'), +(5, '2005-01-31 23:59:59', '2005-01-31', '2005', '23:59:59'); +select count(*) from t1 use index (dt) where dt > '1900-01-01 00:00:00'; +count(*) +5 +select count(*) from t1 use index (dt) where dt > '1955-12-31 00:00:00'; +count(*) +3 +select count(*) from t1 use index (dt) where dt < '2001-01-01 10:11:11'; +count(*) +3 +select count(*) from t1 use index (dt) where dt < '2001-01-01 10:11:12'; +count(*) +4 From 633ee9b09994333dd4ccdd85daa6aec4594d9346 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 8 Jan 2005 16:57:51 +0100 Subject: [PATCH 0679/1063] ndb - wl-1442 fix Date ordering mysql-test/r/ndb_index_ordered.result: wl-1442 fix Date. reuses old unused Timespec type id mysql-test/t/ndb_index_ordered.test: wl-1442 fix Date. reuses old unused Timespec type id ndb/include/kernel/signaldata/DictTabInfo.hpp: wl-1442 fix Date. reuses old unused Timespec type id ndb/include/ndbapi/NdbDictionary.hpp: wl-1442 fix Date. reuses old unused Timespec type id ndb/include/util/NdbSqlUtil.hpp: wl-1442 fix Date. reuses old unused Timespec type id ndb/src/common/util/NdbSqlUtil.cpp: wl-1442 fix Date. reuses old unused Timespec type id ndb/src/ndbapi/NdbDictionary.cpp: wl-1442 fix Date. reuses old unused Timespec type id ndb/src/ndbapi/NdbDictionaryImpl.cpp: wl-1442 fix Date. reuses old unused Timespec type id ndb/test/include/NdbSchemaOp.hpp: wl-1442 fix Date. reuses old unused Timespec type id ndb/tools/restore/consumer.cpp: wl-1442 fix Date. reuses old unused Timespec type id sql/ha_ndbcluster.cc: wl-1442 fix Date. reuses old unused Timespec type id --- mysql-test/r/ndb_index_ordered.result | 66 ++++++++++++++----- mysql-test/t/ndb_index_ordered.test | 32 ++++++--- ndb/include/kernel/signaldata/DictTabInfo.hpp | 6 +- ndb/include/ndbapi/NdbDictionary.hpp | 2 +- ndb/include/util/NdbSqlUtil.hpp | 4 +- ndb/src/common/util/NdbSqlUtil.cpp | 52 +++++++-------- ndb/src/ndbapi/NdbDictionary.cpp | 4 +- ndb/src/ndbapi/NdbDictionaryImpl.cpp | 4 +- ndb/test/include/NdbSchemaOp.hpp | 2 +- ndb/tools/restore/consumer.cpp | 4 +- sql/ha_ndbcluster.cc | 9 ++- 11 files changed, 118 insertions(+), 67 deletions(-) diff --git a/mysql-test/r/ndb_index_ordered.result b/mysql-test/r/ndb_index_ordered.result index a3eb5630131..466523aafa7 100644 --- a/mysql-test/r/ndb_index_ordered.result +++ b/mysql-test/r/ndb_index_ordered.result @@ -325,19 +325,53 @@ index(ts) ) engine=ndb; insert into t1 (pk,dt,da,ye,ti) values (1, '1901-05-05 23:00:59', '1901-05-05', '1901', '23:00:59'), -(2, '1955-12-31 00:00:00', '1955-12-31', '1955', '00:00:00'), -(3, '1999-06-06 06:06:06', '1999-06-06', '1999', '06:06:06'), -(4, '2001-01-01 10:11:11', '2001-01-01', '2001', '10:11:11'), -(5, '2005-01-31 23:59:59', '2005-01-31', '2005', '23:59:59'); -select count(*) from t1 use index (dt) where dt > '1900-01-01 00:00:00'; -count(*) -5 -select count(*) from t1 use index (dt) where dt > '1955-12-31 00:00:00'; -count(*) -3 -select count(*) from t1 use index (dt) where dt < '2001-01-01 10:11:11'; -count(*) -3 -select count(*) from t1 use index (dt) where dt < '2001-01-01 10:11:12'; -count(*) -4 +(2, '1912-09-05 13:00:59', '1912-09-05', '1912', '13:00:59'), +(3, '1945-12-31 00:00:00', '1945-12-31', '1945', '00:00:00'), +(4, '1955-12-31 00:00:00', '1955-12-31', '1955', '00:00:00'), +(5, '1963-06-06 06:06:06', '1963-06-06', '1963', '06:06:06'), +(6, '1993-06-06 06:06:06', '1993-06-06', '1993', '06:06:06'), +(7, '2001-01-01 10:11:10', '2001-01-01', '2001', '10:11:10'), +(8, '2001-01-01 10:11:11', '2001-01-01', '2001', '10:11:11'), +(9, '2005-01-31 23:59:59', '2005-01-31', '2005', '23:59:59'); +select count(*)-9 from t1 use index (dt) where dt > '1900-01-01 00:00:00'; +count(*)-9 +0 +select count(*)-6 from t1 use index (dt) where dt >= '1955-12-31 00:00:00'; +count(*)-6 +0 +select count(*)-5 from t1 use index (dt) where dt > '1955-12-31 00:00:00'; +count(*)-5 +0 +select count(*)-5 from t1 use index (dt) where dt < '1970-03-03 22:22:22'; +count(*)-5 +0 +select count(*)-7 from t1 use index (dt) where dt < '2001-01-01 10:11:11'; +count(*)-7 +0 +select count(*)-8 from t1 use index (dt) where dt <= '2001-01-01 10:11:11'; +count(*)-8 +0 +select count(*)-9 from t1 use index (dt) where dt <= '2055-01-01 00:00:00'; +count(*)-9 +0 +select count(*)-9 from t1 use index (da) where da > '1900-01-01'; +count(*)-9 +0 +select count(*)-6 from t1 use index (da) where da >= '1955-12-31'; +count(*)-6 +0 +select count(*)-5 from t1 use index (da) where da > '1955-12-31'; +count(*)-5 +0 +select count(*)-5 from t1 use index (da) where da < '1970-03-03'; +count(*)-5 +0 +select count(*)-6 from t1 use index (da) where da < '2001-01-01'; +count(*)-6 +0 +select count(*)-8 from t1 use index (da) where da <= '2001-01-02'; +count(*)-8 +0 +select count(*)-9 from t1 use index (da) where da <= '2055-01-01'; +count(*)-9 +0 diff --git a/mysql-test/t/ndb_index_ordered.test b/mysql-test/t/ndb_index_ordered.test index c5d3a83a3ab..ae2f7db53fb 100644 --- a/mysql-test/t/ndb_index_ordered.test +++ b/mysql-test/t/ndb_index_ordered.test @@ -191,13 +191,29 @@ create table t1 ( insert into t1 (pk,dt,da,ye,ti) values (1, '1901-05-05 23:00:59', '1901-05-05', '1901', '23:00:59'), - (2, '1955-12-31 00:00:00', '1955-12-31', '1955', '00:00:00'), - (3, '1999-06-06 06:06:06', '1999-06-06', '1999', '06:06:06'), - (4, '2001-01-01 10:11:11', '2001-01-01', '2001', '10:11:11'), - (5, '2005-01-31 23:59:59', '2005-01-31', '2005', '23:59:59'); + (2, '1912-09-05 13:00:59', '1912-09-05', '1912', '13:00:59'), + (3, '1945-12-31 00:00:00', '1945-12-31', '1945', '00:00:00'), + (4, '1955-12-31 00:00:00', '1955-12-31', '1955', '00:00:00'), + (5, '1963-06-06 06:06:06', '1963-06-06', '1963', '06:06:06'), + (6, '1993-06-06 06:06:06', '1993-06-06', '1993', '06:06:06'), + (7, '2001-01-01 10:11:10', '2001-01-01', '2001', '10:11:10'), + (8, '2001-01-01 10:11:11', '2001-01-01', '2001', '10:11:11'), + (9, '2005-01-31 23:59:59', '2005-01-31', '2005', '23:59:59'); # datetime -select count(*) from t1 use index (dt) where dt > '1900-01-01 00:00:00'; -select count(*) from t1 use index (dt) where dt > '1955-12-31 00:00:00'; -select count(*) from t1 use index (dt) where dt < '2001-01-01 10:11:11'; -select count(*) from t1 use index (dt) where dt < '2001-01-01 10:11:12'; +select count(*)-9 from t1 use index (dt) where dt > '1900-01-01 00:00:00'; +select count(*)-6 from t1 use index (dt) where dt >= '1955-12-31 00:00:00'; +select count(*)-5 from t1 use index (dt) where dt > '1955-12-31 00:00:00'; +select count(*)-5 from t1 use index (dt) where dt < '1970-03-03 22:22:22'; +select count(*)-7 from t1 use index (dt) where dt < '2001-01-01 10:11:11'; +select count(*)-8 from t1 use index (dt) where dt <= '2001-01-01 10:11:11'; +select count(*)-9 from t1 use index (dt) where dt <= '2055-01-01 00:00:00'; + +# date +select count(*)-9 from t1 use index (da) where da > '1900-01-01'; +select count(*)-6 from t1 use index (da) where da >= '1955-12-31'; +select count(*)-5 from t1 use index (da) where da > '1955-12-31'; +select count(*)-5 from t1 use index (da) where da < '1970-03-03'; +select count(*)-6 from t1 use index (da) where da < '2001-01-01'; +select count(*)-8 from t1 use index (da) where da <= '2001-01-02'; +select count(*)-9 from t1 use index (da) where da <= '2055-01-01'; diff --git a/ndb/include/kernel/signaldata/DictTabInfo.hpp b/ndb/include/kernel/signaldata/DictTabInfo.hpp index ae78c023c2a..392b691ae1e 100644 --- a/ndb/include/kernel/signaldata/DictTabInfo.hpp +++ b/ndb/include/kernel/signaldata/DictTabInfo.hpp @@ -308,7 +308,7 @@ public: ExtBinary = NdbSqlUtil::Type::Binary, ExtVarbinary = NdbSqlUtil::Type::Varbinary, ExtDatetime = NdbSqlUtil::Type::Datetime, - ExtTimespec = NdbSqlUtil::Type::Timespec, + ExtDate = NdbSqlUtil::Type::Date, ExtBlob = NdbSqlUtil::Type::Blob, ExtText = NdbSqlUtil::Type::Text }; @@ -428,10 +428,10 @@ public: AttributeSize = DictTabInfo::an8Bit; AttributeArraySize = 8 * AttributeExtLength; return true; - case DictTabInfo::ExtTimespec: + case DictTabInfo::ExtDate: AttributeType = DictTabInfo::StringType; AttributeSize = DictTabInfo::an8Bit; - AttributeArraySize = 12 * AttributeExtLength; + AttributeArraySize = 3 * AttributeExtLength; return true; case DictTabInfo::ExtBlob: case DictTabInfo::ExtText: diff --git a/ndb/include/ndbapi/NdbDictionary.hpp b/ndb/include/ndbapi/NdbDictionary.hpp index f0c8a10f488..0ca3744a3d9 100644 --- a/ndb/include/ndbapi/NdbDictionary.hpp +++ b/ndb/include/ndbapi/NdbDictionary.hpp @@ -185,7 +185,7 @@ public: Binary, ///< Len Varbinary, ///< Max len Datetime, ///< Precision down to 1 sec (sizeof(Datetime) == 8 bytes ) - Timespec, ///< Precision down to 1 nsec(sizeof(Datetime) == 12 bytes ) + Date, ///< Precision down to 1 day(sizeof(Date) == 4 bytes ) Blob, ///< Binary large object (see NdbBlob) Text ///< Text blob }; diff --git a/ndb/include/util/NdbSqlUtil.hpp b/ndb/include/util/NdbSqlUtil.hpp index 3062d1e4e1b..47bb2157e1a 100644 --- a/ndb/include/util/NdbSqlUtil.hpp +++ b/ndb/include/util/NdbSqlUtil.hpp @@ -81,7 +81,7 @@ public: Binary, // Len Varbinary, // Max len Datetime, // Precision down to 1 sec (size 8 bytes) - Timespec, // Precision down to 1 nsec (size 12 bytes) + Date, // Precision down to 1 day (size 4 bytes) Blob, // Blob Text // Text blob }; @@ -132,7 +132,7 @@ private: static Cmp cmpBinary; static Cmp cmpVarbinary; static Cmp cmpDatetime; - static Cmp cmpTimespec; + static Cmp cmpDate; static Cmp cmpBlob; static Cmp cmpText; }; diff --git a/ndb/src/common/util/NdbSqlUtil.cpp b/ndb/src/common/util/NdbSqlUtil.cpp index 8491fa3c4a0..6f490c7f611 100644 --- a/ndb/src/common/util/NdbSqlUtil.cpp +++ b/ndb/src/common/util/NdbSqlUtil.cpp @@ -153,8 +153,8 @@ NdbSqlUtil::m_typeList[] = { cmpDatetime }, { - Type::Timespec, - cmpTimespec + Type::Date, + cmpDate }, { Type::Blob, @@ -485,36 +485,34 @@ NdbSqlUtil::cmpDatetime(const void* info, const Uint32* p1, const Uint32* p2, Ui } int -NdbSqlUtil::cmpTimespec(const void* info, const Uint32* p1, const Uint32* p2, Uint32 full, Uint32 size) +NdbSqlUtil::cmpDate(const void* info, const Uint32* p1, const Uint32* p2, Uint32 full, Uint32 size) { +#ifdef ndb_date_is_4_byte_native_int + assert(full >= size && size > 0); + union { Uint32 p[2]; Int32 v; } u1, u2; + u1.p[0] = p1[0]; + u2.p[0] = p2[0]; + if (u1.v < u2.v) + return -1; + if (u1.v > u2.v) + return +1; + return 0; +#else assert(full >= size && size > 0); - /* - * Timespec is CC YY MM DD hh mm ss \0 NN NN NN NN - * - * Not used via MySQL. - */ union { const Uint32* p; const unsigned char* v; } u1, u2; u1.p = p1; u2.p = p2; - // no format check - int k = memcmp(u1.v, u2.v, 4); - if (k != 0) - return k < 0 ? -1 : +1; - if (size >= 2) { - k = memcmp(u1.v + 4, u2.v + 4, 4); - if (k != 0) - return k < 0 ? -1 : +1; - if (size >= 3) { - Uint32 n1 = *(const Uint32*)(u1.v + 8); - Uint32 n2 = *(const Uint32*)(u2.v + 8); - if (n1 < n2) - return -1; - if (n2 > n1) - return +1; - return 0; - } - } - return CmpUnknown; + // from Field_newdate::val_int + Uint64 j1 = uint3korr(u1.v); + Uint64 j2 = uint3korr(u2.v); + j1 = (j1 % 32L)+(j1 / 32L % 16L)*100L + (j1/(16L*32L))*10000L; + j2 = (j2 % 32L)+(j2 / 32L % 16L)*100L + (j2/(16L*32L))*10000L; + if (j1 < j2) + return -1; + if (j1 > j2) + return +1; + return 0; +#endif } int diff --git a/ndb/src/ndbapi/NdbDictionary.cpp b/ndb/src/ndbapi/NdbDictionary.cpp index f88bbc907a6..b47f7d2c15c 100644 --- a/ndb/src/ndbapi/NdbDictionary.cpp +++ b/ndb/src/ndbapi/NdbDictionary.cpp @@ -936,8 +936,8 @@ operator<<(NdbOut& out, const NdbDictionary::Column& col) case NdbDictionary::Column::Datetime: out << "Datetime"; break; - case NdbDictionary::Column::Timespec: - out << "Timespec"; + case NdbDictionary::Column::Date: + out << "Date"; break; case NdbDictionary::Column::Blob: out << "Blob(" << col.getInlineSize() << "," << col.getPartSize() diff --git a/ndb/src/ndbapi/NdbDictionaryImpl.cpp b/ndb/src/ndbapi/NdbDictionaryImpl.cpp index 7a293463c94..195fdce7e3f 100644 --- a/ndb/src/ndbapi/NdbDictionaryImpl.cpp +++ b/ndb/src/ndbapi/NdbDictionaryImpl.cpp @@ -130,7 +130,7 @@ NdbColumnImpl::init(Type t) case Binary: case Varbinary: case Datetime: - case Timespec: + case Date: m_precision = 0; m_scale = 0; m_length = 1; @@ -1174,7 +1174,7 @@ columnTypeMapping[] = { { DictTabInfo::ExtBinary, NdbDictionary::Column::Binary }, { DictTabInfo::ExtVarbinary, NdbDictionary::Column::Varbinary }, { DictTabInfo::ExtDatetime, NdbDictionary::Column::Datetime }, - { DictTabInfo::ExtTimespec, NdbDictionary::Column::Timespec }, + { DictTabInfo::ExtDate, NdbDictionary::Column::Date }, { DictTabInfo::ExtBlob, NdbDictionary::Column::Blob }, { DictTabInfo::ExtText, NdbDictionary::Column::Text }, { -1, -1 } diff --git a/ndb/test/include/NdbSchemaOp.hpp b/ndb/test/include/NdbSchemaOp.hpp index ac859f8abe8..b54c011ae8b 100644 --- a/ndb/test/include/NdbSchemaOp.hpp +++ b/ndb/test/include/NdbSchemaOp.hpp @@ -576,7 +576,7 @@ convertColumnTypeToAttrType(NdbDictionary::Column::Type _type) case NdbDictionary::Column::Varbinary: return String; case NdbDictionary::Column::Datetime: - case NdbDictionary::Column::Timespec: + case NdbDictionary::Column::Date: case NdbDictionary::Column::Undefined: default: return NoAttrTypeDef; diff --git a/ndb/tools/restore/consumer.cpp b/ndb/tools/restore/consumer.cpp index e94c31b2666..dc0567803dd 100644 --- a/ndb/tools/restore/consumer.cpp +++ b/ndb/tools/restore/consumer.cpp @@ -71,8 +71,8 @@ BackupConsumer::create_table_string(const TableS & table, case NdbDictionary::Column::Datetime: pos += sprintf(buf+pos, "%s", "datetime"); break; - case NdbDictionary::Column::Timespec: - pos += sprintf(buf+pos, "%s", "time"); + case NdbDictionary::Column::Date: + pos += sprintf(buf+pos, "%s", "date"); break; case NdbDictionary::Column::Undefined: // pos += sprintf(buf+pos, "%s", "varchar binary"); diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 3c6cd83d5dc..e181b421e29 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -2259,9 +2259,9 @@ void ha_ndbcluster::print_results() fprintf(DBUG_FILE, "Datetime\t%llu", value); break; } - case NdbDictionary::Column::Timespec: { + case NdbDictionary::Column::Date: { Uint64 value= (Uint64) *field->ptr; - fprintf(DBUG_FILE, "Timespec\t%llu", value); + fprintf(DBUG_FILE, "Date\t%llu", value); break; } case NdbDictionary::Column::Blob: { @@ -3323,8 +3323,11 @@ static int create_ndb_column(NDBCOL &col, col.setType(NDBCOL::Datetime); col.setLength(1); break; - case MYSQL_TYPE_DATE: case MYSQL_TYPE_NEWDATE: + col.setType(NDBCOL::Date); + col.setLength(1); + break; + case MYSQL_TYPE_DATE: // ? case MYSQL_TYPE_TIME: case MYSQL_TYPE_YEAR: col.setType(NDBCOL::Char); From 3186b340da79252758a4b1c47ea0a3b8b1b0d2a8 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 8 Jan 2005 19:28:44 +0100 Subject: [PATCH 0680/1063] ndb - wl-1442 fix Time ordering mysql-test/r/ndb_index_ordered.result: wl-1442 fix Time. adds new type id 25 mysql-test/t/ndb_index_ordered.test: wl-1442 fix Time. adds new type id 25 ndb/include/kernel/signaldata/DictTabInfo.hpp: wl-1442 fix Time. adds new type id 25 ndb/include/ndbapi/NdbDictionary.hpp: wl-1442 fix Time. adds new type id 25 ndb/include/util/NdbSqlUtil.hpp: wl-1442 fix Time. adds new type id 25 ndb/src/common/util/NdbSqlUtil.cpp: wl-1442 fix Time. adds new type id 25 ndb/src/ndbapi/NdbDictionary.cpp: wl-1442 fix Time. adds new type id 25 ndb/src/ndbapi/NdbDictionaryImpl.cpp: wl-1442 fix Time. adds new type id 25 ndb/test/include/NdbSchemaOp.hpp: wl-1442 fix Time. adds new type id 25 ndb/tools/restore/consumer.cpp: wl-1442 fix Time. adds new type id 25 sql/ha_ndbcluster.cc: wl-1442 fix Time. adds new type id 25 --- mysql-test/r/ndb_index_ordered.result | 45 +++++++++++++++++++ mysql-test/t/ndb_index_ordered.test | 19 ++++++++ ndb/include/kernel/signaldata/DictTabInfo.hpp | 8 +++- ndb/include/ndbapi/NdbDictionary.hpp | 3 +- ndb/include/util/NdbSqlUtil.hpp | 4 +- ndb/src/common/util/NdbSqlUtil.cpp | 33 ++++++++++++++ ndb/src/ndbapi/NdbDictionary.cpp | 3 ++ ndb/src/ndbapi/NdbDictionaryImpl.cpp | 7 +++ ndb/test/include/NdbSchemaOp.hpp | 1 + ndb/tools/restore/consumer.cpp | 3 ++ sql/ha_ndbcluster.cc | 10 ++++- 11 files changed, 132 insertions(+), 4 deletions(-) diff --git a/mysql-test/r/ndb_index_ordered.result b/mysql-test/r/ndb_index_ordered.result index 466523aafa7..75a5e42732b 100644 --- a/mysql-test/r/ndb_index_ordered.result +++ b/mysql-test/r/ndb_index_ordered.result @@ -375,3 +375,48 @@ count(*)-8 select count(*)-9 from t1 use index (da) where da <= '2055-01-01'; count(*)-9 0 +select count(*)-9 from t1 use index (ye) where ye > '1900'; +count(*)-9 +0 +select count(*)-6 from t1 use index (ye) where ye >= '1955'; +count(*)-6 +0 +select count(*)-5 from t1 use index (ye) where ye > '1955'; +count(*)-5 +0 +select count(*)-5 from t1 use index (ye) where ye < '1970'; +count(*)-5 +0 +select count(*)-6 from t1 use index (ye) where ye < '2001'; +count(*)-6 +0 +select count(*)-8 from t1 use index (ye) where ye <= '2001'; +count(*)-8 +0 +select count(*)-9 from t1 use index (ye) where ye <= '2055'; +count(*)-9 +0 +select count(*)-9 from t1 use index (ti) where ti >= '00:00:00'; +count(*)-9 +0 +select count(*)-7 from t1 use index (ti) where ti > '00:00:00'; +count(*)-7 +0 +select count(*)-7 from t1 use index (ti) where ti > '05:05:05'; +count(*)-7 +0 +select count(*)-5 from t1 use index (ti) where ti > '06:06:06'; +count(*)-5 +0 +select count(*)-5 from t1 use index (ti) where ti < '10:11:11'; +count(*)-5 +0 +select count(*)-6 from t1 use index (ti) where ti <= '10:11:11'; +count(*)-6 +0 +select count(*)-8 from t1 use index (ti) where ti < '23:59:59'; +count(*)-8 +0 +select count(*)-9 from t1 use index (ti) where ti <= '23:59:59'; +count(*)-9 +0 diff --git a/mysql-test/t/ndb_index_ordered.test b/mysql-test/t/ndb_index_ordered.test index ae2f7db53fb..71635159604 100644 --- a/mysql-test/t/ndb_index_ordered.test +++ b/mysql-test/t/ndb_index_ordered.test @@ -217,3 +217,22 @@ select count(*)-5 from t1 use index (da) where da < '1970-03-03'; select count(*)-6 from t1 use index (da) where da < '2001-01-01'; select count(*)-8 from t1 use index (da) where da <= '2001-01-02'; select count(*)-9 from t1 use index (da) where da <= '2055-01-01'; + +# year +select count(*)-9 from t1 use index (ye) where ye > '1900'; +select count(*)-6 from t1 use index (ye) where ye >= '1955'; +select count(*)-5 from t1 use index (ye) where ye > '1955'; +select count(*)-5 from t1 use index (ye) where ye < '1970'; +select count(*)-6 from t1 use index (ye) where ye < '2001'; +select count(*)-8 from t1 use index (ye) where ye <= '2001'; +select count(*)-9 from t1 use index (ye) where ye <= '2055'; + +# time +select count(*)-9 from t1 use index (ti) where ti >= '00:00:00'; +select count(*)-7 from t1 use index (ti) where ti > '00:00:00'; +select count(*)-7 from t1 use index (ti) where ti > '05:05:05'; +select count(*)-5 from t1 use index (ti) where ti > '06:06:06'; +select count(*)-5 from t1 use index (ti) where ti < '10:11:11'; +select count(*)-6 from t1 use index (ti) where ti <= '10:11:11'; +select count(*)-8 from t1 use index (ti) where ti < '23:59:59'; +select count(*)-9 from t1 use index (ti) where ti <= '23:59:59'; diff --git a/ndb/include/kernel/signaldata/DictTabInfo.hpp b/ndb/include/kernel/signaldata/DictTabInfo.hpp index 392b691ae1e..3e73ae67ebe 100644 --- a/ndb/include/kernel/signaldata/DictTabInfo.hpp +++ b/ndb/include/kernel/signaldata/DictTabInfo.hpp @@ -310,7 +310,8 @@ public: ExtDatetime = NdbSqlUtil::Type::Datetime, ExtDate = NdbSqlUtil::Type::Date, ExtBlob = NdbSqlUtil::Type::Blob, - ExtText = NdbSqlUtil::Type::Text + ExtText = NdbSqlUtil::Type::Text, + ExtTime = NdbSqlUtil::Type::Time }; // Attribute data interpretation @@ -440,6 +441,11 @@ public: // head + inline part [ attr precision lower half ] AttributeArraySize = (NDB_BLOB_HEAD_SIZE << 2) + (AttributeExtPrecision & 0xFFFF); return true; + case DictTabInfo::ExtTime: + AttributeType = DictTabInfo::StringType; + AttributeSize = DictTabInfo::an8Bit; + AttributeArraySize = 3 * AttributeExtLength; + return true; }; return false; } diff --git a/ndb/include/ndbapi/NdbDictionary.hpp b/ndb/include/ndbapi/NdbDictionary.hpp index 0ca3744a3d9..454b267d1b0 100644 --- a/ndb/include/ndbapi/NdbDictionary.hpp +++ b/ndb/include/ndbapi/NdbDictionary.hpp @@ -187,7 +187,8 @@ public: Datetime, ///< Precision down to 1 sec (sizeof(Datetime) == 8 bytes ) Date, ///< Precision down to 1 day(sizeof(Date) == 4 bytes ) Blob, ///< Binary large object (see NdbBlob) - Text ///< Text blob + Text, ///< Text blob + Time = 25 ///< Time without date }; /** diff --git a/ndb/include/util/NdbSqlUtil.hpp b/ndb/include/util/NdbSqlUtil.hpp index 47bb2157e1a..10024d9b616 100644 --- a/ndb/include/util/NdbSqlUtil.hpp +++ b/ndb/include/util/NdbSqlUtil.hpp @@ -83,7 +83,8 @@ public: Datetime, // Precision down to 1 sec (size 8 bytes) Date, // Precision down to 1 day (size 4 bytes) Blob, // Blob - Text // Text blob + Text, // Text blob + Time = 25 // Time without date }; Enum m_typeId; Cmp* m_cmp; // comparison method @@ -135,6 +136,7 @@ private: static Cmp cmpDate; static Cmp cmpBlob; static Cmp cmpText; + static Cmp cmpTime; }; #endif diff --git a/ndb/src/common/util/NdbSqlUtil.cpp b/ndb/src/common/util/NdbSqlUtil.cpp index 6f490c7f611..233698ae52b 100644 --- a/ndb/src/common/util/NdbSqlUtil.cpp +++ b/ndb/src/common/util/NdbSqlUtil.cpp @@ -163,6 +163,22 @@ NdbSqlUtil::m_typeList[] = { { Type::Text, cmpText + }, + { + Type::Undefined, // 5.0 Bit + NULL + }, + { + Type::Undefined, // 5.0 Longvarchar + NULL + }, + { + Type::Undefined, // 5.0 Longvarbinary + NULL + }, + { + Type::Time, + cmpTime } }; @@ -559,6 +575,23 @@ NdbSqlUtil::cmpText(const void* info, const Uint32* p1, const Uint32* p2, Uint32 return CmpUnknown; } +int +NdbSqlUtil::cmpTime(const void* info, const Uint32* p1, const Uint32* p2, Uint32 full, Uint32 size) +{ + assert(full >= size && size > 0); + union { const Uint32* p; const unsigned char* v; } u1, u2; + u1.p = p1; + u2.p = p2; + // from Field_time::val_int + Int32 j1 = sint3korr(u1.v); + Int32 j2 = sint3korr(u2.v); + if (j1 < j2) + return -1; + if (j1 > j2) + return +1; + return 0; +} + // check charset bool diff --git a/ndb/src/ndbapi/NdbDictionary.cpp b/ndb/src/ndbapi/NdbDictionary.cpp index b47f7d2c15c..0508d8bf277 100644 --- a/ndb/src/ndbapi/NdbDictionary.cpp +++ b/ndb/src/ndbapi/NdbDictionary.cpp @@ -947,6 +947,9 @@ operator<<(NdbOut& out, const NdbDictionary::Column& col) out << "Text(" << col.getInlineSize() << "," << col.getPartSize() << ";" << col.getStripeSize() << ";" << csname << ")"; break; + case NdbDictionary::Column::Time: + out << "Time"; + break; case NdbDictionary::Column::Undefined: out << "Undefined"; break; diff --git a/ndb/src/ndbapi/NdbDictionaryImpl.cpp b/ndb/src/ndbapi/NdbDictionaryImpl.cpp index 195fdce7e3f..59474943f3b 100644 --- a/ndb/src/ndbapi/NdbDictionaryImpl.cpp +++ b/ndb/src/ndbapi/NdbDictionaryImpl.cpp @@ -148,6 +148,12 @@ NdbColumnImpl::init(Type t) m_length = 4; m_cs = default_cs; break; + case Time: + m_precision = 0; + m_scale = 0; + m_length = 1; + m_cs = NULL; + break; case Undefined: assert(false); break; @@ -1177,6 +1183,7 @@ columnTypeMapping[] = { { DictTabInfo::ExtDate, NdbDictionary::Column::Date }, { DictTabInfo::ExtBlob, NdbDictionary::Column::Blob }, { DictTabInfo::ExtText, NdbDictionary::Column::Text }, + { DictTabInfo::ExtTime, NdbDictionary::Column::Time }, { -1, -1 } }; diff --git a/ndb/test/include/NdbSchemaOp.hpp b/ndb/test/include/NdbSchemaOp.hpp index b54c011ae8b..e2fb4015b88 100644 --- a/ndb/test/include/NdbSchemaOp.hpp +++ b/ndb/test/include/NdbSchemaOp.hpp @@ -577,6 +577,7 @@ convertColumnTypeToAttrType(NdbDictionary::Column::Type _type) return String; case NdbDictionary::Column::Datetime: case NdbDictionary::Column::Date: + case NdbDictionary::Column::Time: case NdbDictionary::Column::Undefined: default: return NoAttrTypeDef; diff --git a/ndb/tools/restore/consumer.cpp b/ndb/tools/restore/consumer.cpp index dc0567803dd..4d228230423 100644 --- a/ndb/tools/restore/consumer.cpp +++ b/ndb/tools/restore/consumer.cpp @@ -74,6 +74,9 @@ BackupConsumer::create_table_string(const TableS & table, case NdbDictionary::Column::Date: pos += sprintf(buf+pos, "%s", "date"); break; + case NdbDictionary::Column::Time: + pos += sprintf(buf+pos, "%s", "time"); + break; case NdbDictionary::Column::Undefined: // pos += sprintf(buf+pos, "%s", "varchar binary"); return -1; diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index e181b421e29..e4c45490050 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -2264,6 +2264,11 @@ void ha_ndbcluster::print_results() fprintf(DBUG_FILE, "Date\t%llu", value); break; } + case NdbDictionary::Column::Time: { + Uint64 value= (Uint64) *field->ptr; + fprintf(DBUG_FILE, "Time\t%llu", value); + break; + } case NdbDictionary::Column::Blob: { Uint64 len= 0; ndb_blob->getLength(len); @@ -3327,8 +3332,11 @@ static int create_ndb_column(NDBCOL &col, col.setType(NDBCOL::Date); col.setLength(1); break; - case MYSQL_TYPE_DATE: // ? case MYSQL_TYPE_TIME: + col.setType(NDBCOL::Time); + col.setLength(1); + break; + case MYSQL_TYPE_DATE: // ? case MYSQL_TYPE_YEAR: col.setType(NDBCOL::Char); col.setLength(field->pack_length()); From 4c8d52aa80ce2a2131783bc2df5b02f21baa1c96 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 8 Jan 2005 21:25:31 +0100 Subject: [PATCH 0681/1063] few harmless warnings from automated code-checking tools fixed client/mysql.cc: few harmless warnings from automated code-checking tools fixed cleanup --- client/completion_hash.cc | 3 ++- client/mysql.cc | 9 ++++++--- cmd-line-utils/libedit/parse.c | 3 ++- pstack/pstack.c | 2 +- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/client/completion_hash.cc b/client/completion_hash.cc index 536e7f9373a..7a3b363c93c 100644 --- a/client/completion_hash.cc +++ b/client/completion_hash.cc @@ -79,7 +79,8 @@ int completion_hash_update(HashTable *ht, char *arKey, uint nKeyLength, if (!memcmp(p->arKey, arKey, nKeyLength)) { entry *n; - n = (entry *) alloc_root(&ht->mem_root,sizeof(entry)); + if (!(n = (entry *) alloc_root(&ht->mem_root,sizeof(entry)))) + return FAILURE; n->pNext = p->pData; n->str = str; p->pData = n; diff --git a/client/mysql.cc b/client/mysql.cc index 0ea0f10f5d7..bfa827a6e95 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -1502,7 +1502,10 @@ You can turn off this feature to get a quicker startup with -A\n\n"); if (!(field_names[i] = (char **) alloc_root(&hash_mem_root, sizeof(char *) * (num_fields*2+1)))) - break; + { + mysql_free_result(fields); + break; + } field_names[i][num_fields*2]= '\0'; j=0; while ((sql_field=mysql_fetch_field(fields))) @@ -2077,10 +2080,10 @@ print_table_data_html(MYSQL_RES *result) } while ((cur = mysql_fetch_row(result))) { + ulong *lengths=mysql_fetch_lengths(result); (void) tee_fputs("", PAGER); for (uint i=0; i < mysql_num_fields(result); i++) { - ulong *lengths=mysql_fetch_lengths(result); (void) tee_fputs("", PAGER); @@ -2106,10 +2109,10 @@ print_table_data_xml(MYSQL_RES *result) fields = mysql_fetch_fields(result); while ((cur = mysql_fetch_row(result))) { + ulong *lengths=mysql_fetch_lengths(result); (void) tee_fputs("\n \n", PAGER); for (uint i=0; i < mysql_num_fields(result); i++) { - ulong *lengths=mysql_fetch_lengths(result); tee_fprintf(PAGER, "\t<%s>", (fields[i].name ? (fields[i].name[0] ? fields[i].name : "   ") : "NULL")); diff --git a/cmd-line-utils/libedit/parse.c b/cmd-line-utils/libedit/parse.c index b113353d464..d09b890c1ab 100644 --- a/cmd-line-utils/libedit/parse.c +++ b/cmd-line-utils/libedit/parse.c @@ -87,7 +87,8 @@ parse_line(EditLine *el, const char *line) int argc; Tokenizer *tok; - tok = tok_init(NULL); + if (!(tok = tok_init(NULL))) + return -1; tok_line(tok, line, &argc, &argv); argc = el_parse(el, argc, argv); tok_end(tok); diff --git a/pstack/pstack.c b/pstack/pstack.c index 75869686e35..4cdd80d68b5 100644 --- a/pstack/pstack.c +++ b/pstack/pstack.c @@ -1663,7 +1663,7 @@ pr_tag_type (p, name, id, kind) { struct pr_handle *info = (struct pr_handle *) p; const char *t, *tag; - char idbuf[20]; + char idbuf[30]; switch (kind) { From fdadfe515f0dfd28c123433d38b19f04d2816b40 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 9 Jan 2005 02:19:42 +0100 Subject: [PATCH 0682/1063] Replace all sprintf() calls with my_snprintf() in client.c. All of the format strings (in all languages) already included field limits on the specifiers, so this is just protection against future mistakes. (Bug #7556) sql-common/client.c: Replace all sprintf() calls with my_snprintf() --- sql-common/client.c | 60 ++++++++++++++++++++++++++++----------------- 1 file changed, 38 insertions(+), 22 deletions(-) diff --git a/sql-common/client.c b/sql-common/client.c index b6813ee4cfc..7264605b247 100644 --- a/sql-common/client.c +++ b/sql-common/client.c @@ -321,8 +321,9 @@ HANDLE create_named_pipe(NET *net, uint connect_timeout, char **arg_host, { net->last_errno=CR_NAMEDPIPEOPEN_ERROR; strmov(net->sqlstate, unknown_sqlstate); - sprintf(net->last_error,ER(net->last_errno),host, unix_socket, - (ulong) GetLastError()); + my_snprintf(net->last_error, sizeof(net->last_error)-1, + ER(net->last_errno), host, unix_socket, + (ulong) GetLastError()); return INVALID_HANDLE_VALUE; } /* wait for for an other instance */ @@ -330,8 +331,9 @@ HANDLE create_named_pipe(NET *net, uint connect_timeout, char **arg_host, { net->last_errno=CR_NAMEDPIPEWAIT_ERROR; strmov(net->sqlstate, unknown_sqlstate); - sprintf(net->last_error,ER(net->last_errno),host, unix_socket, - (ulong) GetLastError()); + my_snprintf(net->last_error, sizeof(net->last_error)-1, + ER(net->last_errno), host, unix_socket, + (ulong) GetLastError()); return INVALID_HANDLE_VALUE; } } @@ -339,8 +341,9 @@ HANDLE create_named_pipe(NET *net, uint connect_timeout, char **arg_host, { net->last_errno=CR_NAMEDPIPEOPEN_ERROR; strmov(net->sqlstate, unknown_sqlstate); - sprintf(net->last_error,ER(net->last_errno),host, unix_socket, - (ulong) GetLastError()); + my_snprintf(net->last_error, sizeof(net->last_error)-1, + ER(net->last_errno), host, unix_socket, + (ulong) GetLastError()); return INVALID_HANDLE_VALUE; } dwMode = PIPE_READMODE_BYTE | PIPE_WAIT; @@ -349,8 +352,9 @@ HANDLE create_named_pipe(NET *net, uint connect_timeout, char **arg_host, CloseHandle( hPipe ); net->last_errno=CR_NAMEDPIPESETSTATE_ERROR; strmov(net->sqlstate, unknown_sqlstate); - sprintf(net->last_error,ER(net->last_errno),host, unix_socket, - (ulong) GetLastError()); + my_snprintf(net->last_error, sizeof(net->last_error)-1, + ER(net->last_errno),host, unix_socket, + (ulong) GetLastError()); return INVALID_HANDLE_VALUE; } *arg_host=host ; *arg_unix_socket=unix_socket; /* connect arg */ @@ -563,9 +567,11 @@ err: net->last_errno=error_allow; strmov(net->sqlstate, unknown_sqlstate); if (error_allow == CR_SHARED_MEMORY_EVENT_ERROR) - sprintf(net->last_error,ER(net->last_errno),suffix_pos,error_code); + my_snprintf(net->last_error,sizeof(net->last_error)-1, + ER(net->last_errno),suffix_pos,error_code); else - sprintf(net->last_error,ER(net->last_errno),error_code); + my_snprintf(net->last_error,sizeof(net->last_error)-1, + ER(net->last_errno),error_code); return(INVALID_HANDLE_VALUE); } return(handle_map); @@ -794,7 +800,8 @@ static int check_license(MYSQL *mysql) if (net->last_errno == ER_UNKNOWN_SYSTEM_VARIABLE) { net->last_errno= CR_WRONG_LICENSE; - sprintf(net->last_error, ER(net->last_errno), required_license); + my_snprintf(net->last_error, sizeof(net->last_error)-1, + ER(net->last_errno), required_license); } return 1; } @@ -811,7 +818,8 @@ static int check_license(MYSQL *mysql) strncmp(row[0], required_license, sizeof(required_license)))) { net->last_errno= CR_WRONG_LICENSE; - sprintf(net->last_error, ER(net->last_errno), required_license); + my_snprintf(net->last_error, sizeof(net->last_error)-1, + ER(net->last_errno), required_license); } mysql_free_result(res); return net->last_errno; @@ -1628,7 +1636,8 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user, sock=0; unix_socket = 0; host=mysql->options.shared_memory_base_name; - sprintf(host_info=buff, ER(CR_SHARED_MEMORY_CONNECTION), host); + my_snprintf(host_info=buff, sizeof(buff)-1, + ER(CR_SHARED_MEMORY_CONNECTION), host); } } #endif /* HAVE_SMEM */ @@ -1648,7 +1657,8 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user, { net->last_errno=CR_SOCKET_CREATE_ERROR; strmov(net->sqlstate, unknown_sqlstate); - sprintf(net->last_error,ER(net->last_errno),socket_errno); + my_snprintf(net->last_error,sizeof(net->last_error)-1, + ER(net->last_errno),socket_errno); goto error; } net->vio = vio_new(sock, VIO_TYPE_SOCKET, TRUE); @@ -1662,7 +1672,8 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user, socket_errno)); net->last_errno=CR_CONNECTION_ERROR; strmov(net->sqlstate, unknown_sqlstate); - sprintf(net->last_error,ER(net->last_errno),unix_socket,socket_errno); + my_snprintf(net->last_error,sizeof(net->last_error)-1, + ER(net->last_errno),unix_socket,socket_errno); goto error; } mysql->options.protocol=MYSQL_PROTOCOL_SOCKET; @@ -1692,7 +1703,8 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user, else { net->vio=vio_new_win32pipe(hPipe); - sprintf(host_info=buff, ER(CR_NAMEDPIPE_CONNECTION), unix_socket); + my_snprintf(host_info=buff, sizeof(buff)-1, + ER(CR_NAMEDPIPE_CONNECTION), unix_socket); } } #endif @@ -1705,7 +1717,7 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user, port=mysql_port; if (!host) host=LOCAL_HOST; - sprintf(host_info=buff,ER(CR_TCP_CONNECTION),host); + my_snprintf(host_info=buff,sizeof(buff)-1,ER(CR_TCP_CONNECTION),host); DBUG_PRINT("info",("Server name: '%s'. TCP sock: %d", host,port)); #ifdef MYSQL_SERVER thr_alarm_init(&alarmed); @@ -1720,7 +1732,8 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user, { net->last_errno=CR_IPSOCK_ERROR; strmov(net->sqlstate, unknown_sqlstate); - sprintf(net->last_error,ER(net->last_errno),socket_errno); + my_snprintf(net->last_error,sizeof(net->last_error)-1, + ER(net->last_errno),socket_errno); goto error; } net->vio = vio_new(sock,VIO_TYPE_TCPIP,FALSE); @@ -1747,7 +1760,8 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user, my_gethostbyname_r_free(); net->last_errno=CR_UNKNOWN_HOST; strmov(net->sqlstate, unknown_sqlstate); - sprintf(net->last_error, ER(CR_UNKNOWN_HOST), host, tmp_errno); + my_snprintf(net->last_error, sizeof(net->last_error)-1, + ER(CR_UNKNOWN_HOST), host, tmp_errno); goto error; } memcpy(&sock_addr.sin_addr, hp->h_addr, @@ -1762,7 +1776,8 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user, host)); net->last_errno= CR_CONN_HOST_ERROR; strmov(net->sqlstate, unknown_sqlstate); - sprintf(net->last_error ,ER(CR_CONN_HOST_ERROR), host, socket_errno); + my_snprintf(net->last_error, sizeof(net->last_error)-1, + ER(CR_CONN_HOST_ERROR), host, socket_errno); goto error; } } @@ -1815,8 +1830,9 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user, { strmov(net->sqlstate, unknown_sqlstate); net->last_errno= CR_VERSION_ERROR; - sprintf(net->last_error, ER(CR_VERSION_ERROR), mysql->protocol_version, - PROTOCOL_VERSION); + my_snprintf(net->last_error, sizeof(net->last_error)-1, + ER(CR_VERSION_ERROR), mysql->protocol_version, + PROTOCOL_VERSION); goto error; } end=strend((char*) net->read_pos+1); From f8f7888b5ce63d363907d3ddb66b9900af92cd10 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 8 Jan 2005 19:43:15 -0600 Subject: [PATCH 0683/1063] set_var.cc: Whack duplicate variable line. (Affects SHOW VARIABLES.) sql/set_var.cc: Whack duplicate variable line. (Affects SHOW VARIABLES.) --- sql/set_var.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/sql/set_var.cc b/sql/set_var.cc index 2a5242ece7e..e44ac742abe 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -724,7 +724,6 @@ struct show_var_st init_vars[]= { {"innodb_log_group_home_dir", (char*) &innobase_log_group_home_dir, SHOW_CHAR_PTR}, {sys_innodb_max_dirty_pages_pct.name, (char*) &sys_innodb_max_dirty_pages_pct, SHOW_SYS}, {sys_innodb_max_purge_lag.name, (char*) &sys_innodb_max_purge_lag, SHOW_SYS}, - {sys_innodb_max_purge_lag.name, (char*) &sys_innodb_max_purge_lag, SHOW_SYS}, {"innodb_mirrored_log_groups", (char*) &innobase_mirrored_log_groups, SHOW_LONG}, {"innodb_open_files", (char*) &innobase_open_files, SHOW_LONG }, {sys_innodb_table_locks.name, (char*) &sys_innodb_table_locks, SHOW_SYS}, From 1409b9d7ae030a80aec13939f008c50653b4a32a Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 10 Jan 2005 11:17:01 +0100 Subject: [PATCH 0684/1063] bug#7761 - ndb does not autocommit during alter table sql/sql_table.cc: Turn off transactions before locking (as locking will need to know) --- sql/sql_table.cc | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 43f466282b1..52f178946c4 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -3447,6 +3447,19 @@ copy_data_between_tables(TABLE *from,TABLE *to, if (!(copy= new Copy_field[to->fields])) DBUG_RETURN(-1); /* purecov: inspected */ + /* + Turn off recovery logging since rollback of an alter table is to + delete the new table so there is no need to log the changes to it. + + This needs to be done before external_lock + */ + error= ha_enable_transaction(thd,FALSE); + if (error) + { + DBUG_RETURN(-1); + } + + if (to->file->external_lock(thd, F_WRLCK)) DBUG_RETURN(-1); from->file->info(HA_STATUS_VARIABLE); @@ -3502,17 +3515,6 @@ copy_data_between_tables(TABLE *from,TABLE *to, goto err; }; - /* - Turn off recovery logging since rollback of an alter table is to - delete the new table so there is no need to log the changes to it. - */ - error= ha_enable_transaction(thd,FALSE); - if (error) - { - error= 1; - goto err; - } - /* Handler must be told explicitly to retrieve all columns, because this function does not set field->query_id in the columns to the current query id */ From 815f62223aa9892b19916724ca76514cb1d899b2 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 10 Jan 2005 11:33:08 +0100 Subject: [PATCH 0685/1063] bug#7761 - ndb does not autcommit - postreview fixes sql/sql_table.cc: Move ha_enable to before new Copy, to ensure no memory is leaked --- sql/sql_table.cc | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 52f178946c4..f9f635081cb 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -3444,21 +3444,18 @@ copy_data_between_tables(TABLE *from,TABLE *to, ulong save_sql_mode; DBUG_ENTER("copy_data_between_tables"); - if (!(copy= new Copy_field[to->fields])) - DBUG_RETURN(-1); /* purecov: inspected */ - /* Turn off recovery logging since rollback of an alter table is to delete the new table so there is no need to log the changes to it. This needs to be done before external_lock */ - error= ha_enable_transaction(thd,FALSE); + error= ha_enable_transaction(thd, FALSE); if (error) - { DBUG_RETURN(-1); - } - + + if (!(copy= new Copy_field[to->fields])) + DBUG_RETURN(-1); /* purecov: inspected */ if (to->file->external_lock(thd, F_WRLCK)) DBUG_RETURN(-1); From d8d9f79e09dfe822586742a62928ce37c44aaa90 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 10 Jan 2005 13:52:32 +0100 Subject: [PATCH 0686/1063] Fix for BUG#7658 "optimize crashes slave thread (1 in 1000)]": mysql_admin_table() attempted to write to a vio which was 0. I could have fixed mysql_admin_table() but fixing my_net_write() looked more future-proof. sql/net_serv.cc: If no VIO, no write. --- sql/net_serv.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sql/net_serv.cc b/sql/net_serv.cc index e5cb4d1e815..cad1f041005 100644 --- a/sql/net_serv.cc +++ b/sql/net_serv.cc @@ -227,6 +227,8 @@ int my_net_write(NET *net,const char *packet,ulong len) { uchar buff[NET_HEADER_SIZE]; + if (unlikely(!net->vio)) // nowhere to write + return 0; /* Big packets are handled by splitting them in packets of MAX_PACKET_LENGTH length. The last packet is always a packet that is < MAX_PACKET_LENGTH. From 2d3c55cd7be8ad9bd2647c3cd8484364d4aefc10 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 10 Jan 2005 15:26:33 +0200 Subject: [PATCH 0687/1063] os0file.c: Fix compiler error on those OS X platforms where Apple's special file flush trick with fcntl() is not defined innobase/os/os0file.c: Fix compiler error on those OS X platforms where Apple's special file flush trick with fcntl() is not defined --- innobase/os/os0file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/innobase/os/os0file.c b/innobase/os/os0file.c index f02b81b8fd8..60760d1f8b8 100644 --- a/innobase/os/os0file.c +++ b/innobase/os/os0file.c @@ -1763,7 +1763,7 @@ os_file_flush( #else int ret; -#ifdef HAVE_DARWIN_THREADS +#if defined(HAVE_DARWIN_THREADS) && defined(F_FULLFSYNC) /* Apple has disabled fsync() for internal disk drives in OS X. That caused corruption for a user when he tested a power outage. Let us in OS X use a nonstandard flush method recommended by an Apple From 87e1a296abe9e2962e7047b4f92e57425a858f70 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 10 Jan 2005 15:13:33 +0100 Subject: [PATCH 0688/1063] A test for the BUG#7658 just fixed in 4.0 (could not put it into 4.0 as in 4.0 we don't replicate OPTIMIZE TABLE). --- mysql-test/r/rpl_many_optimize.result | 9 +++++++++ mysql-test/t/rpl_many_optimize.test | 20 ++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 mysql-test/r/rpl_many_optimize.result create mode 100644 mysql-test/t/rpl_many_optimize.test diff --git a/mysql-test/r/rpl_many_optimize.result b/mysql-test/r/rpl_many_optimize.result new file mode 100644 index 00000000000..b2148892591 --- /dev/null +++ b/mysql-test/r/rpl_many_optimize.result @@ -0,0 +1,9 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +create table t1 (a int not null auto_increment primary key, b int, key(b)); +INSERT INTO t1 (a) VALUES (1),(2); +drop table t1; diff --git a/mysql-test/t/rpl_many_optimize.test b/mysql-test/t/rpl_many_optimize.test new file mode 100644 index 00000000000..525e23abe15 --- /dev/null +++ b/mysql-test/t/rpl_many_optimize.test @@ -0,0 +1,20 @@ +# Test for BUG#7658 "optimize crashes slave thread (1 in 1000)]" + +source include/master-slave.inc; + +create table t1 (a int not null auto_increment primary key, b int, key(b)); +INSERT INTO t1 (a) VALUES (1),(2); +# Now many OPTIMIZE to test if we crash (BUG#7658) +let $1=300; +disable_query_log; +disable_result_log; +while ($1) +{ + eval OPTIMIZE TABLE t1; + dec $1; +} +enable_result_log; +enable_query_log; +drop table t1; +# Bug was that slave segfaulted after ~ a hundred of OPTIMIZE (or ANALYZE) +sync_slave_with_master; From 345e51802d42cf42e794e4b69d5ee8a4e4f18aa8 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 10 Jan 2005 16:03:06 +0100 Subject: [PATCH 0689/1063] bad merge fixed --- sql/sql_show.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sql/sql_show.cc b/sql/sql_show.cc index ba13dd1ff04..88a56d26e35 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -817,6 +817,7 @@ mysqld_show_create(THD *thd, TABLE_LIST *table_list) DBUG_RETURN(1); } + buffer.length(0); if (store_create_info(thd, table, &buffer)) DBUG_RETURN(-1); @@ -830,9 +831,6 @@ mysqld_show_create(THD *thd, TABLE_LIST *table_list) DBUG_RETURN(1); protocol->prepare_for_resend(); protocol->store(table->table_name, system_charset_info); - buffer.length(0); - if (store_create_info(thd, table, &buffer)) - DBUG_RETURN(-1); protocol->store(buffer.ptr(), buffer.length(), buffer.charset()); if (protocol->write()) DBUG_RETURN(1); From cc1c4a99ef3f0f6b2bcd3861a91416f3e509d5d7 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 10 Jan 2005 16:19:01 +0100 Subject: [PATCH 0690/1063] - removed the mysql-test/suites/jp test suite and marked all files as gone --- BitKeeper/etc/gone | 235 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 235 insertions(+) diff --git a/BitKeeper/etc/gone b/BitKeeper/etc/gone index ad2ffda4d6e..63a759cf131 100644 --- a/BitKeeper/etc/gone +++ b/BitKeeper/etc/gone @@ -841,6 +841,241 @@ serg@serg.mysql.com|mysql-test/t/sel000027.test|20001211130731|23677|ab44bb57a58 serg@serg.mysql.com|mysql-test/t/sel000028.test|20001211130731|28317|db9bfc0a808fb629 serg@serg.mysql.com|mysql-test/t/sel000029.test|20001211130731|32917|6aae34dbb3ee86d9 serg@serg.mysql.com|mysql-test/t/sel000030.test|20001211130732|03110|a29683eac3e7b706 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_alter_sjis.result|20050107081527|04225|2ec1fd4929b5638e +shuichi@mysql.com|mysql-test/suite/jp/r/jp_alter_ucs2.result|20050107081527|11825|f3ac4ae77651d4f4 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_alter_ujis.result|20050107081528|17309|2c37b350cc1614b7 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_alter_utf8.result|20050107081528|57925|2916262ef0a8467c +shuichi@mysql.com|mysql-test/suite/jp/r/jp_charlength_sjis.result|20050107081528|32479|2d7cc0bab6a08fb7 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_charlength_ucs2.result|20050107081529|38657|a904397e286b018d +shuichi@mysql.com|mysql-test/suite/jp/r/jp_charlength_ujis.result|20050107081529|63265|a3e5fab4dda3f63 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_charlength_utf8.result|20050107081529|19050|8f33e213f34b75c4 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_charset_sjis.result|20050107081530|05840|92bcb5996a61c9bc +shuichi@mysql.com|mysql-test/suite/jp/r/jp_charset_ucs2.result|20050107081530|27322|9f3eb425f5a8a94e +shuichi@mysql.com|mysql-test/suite/jp/r/jp_charset_ujis.result|20050107081530|48971|ccce22a3ed33edb +shuichi@mysql.com|mysql-test/suite/jp/r/jp_charset_utf8.result|20050107081530|04766|6be23c27e03aaef +shuichi@mysql.com|mysql-test/suite/jp/r/jp_convert_sjis.result|20050107081530|26438|e16736c277401654 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_convert_ucs2.result|20050107081531|13914|845b174a4e12fdf5 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_convert_ujis.result|20050107081531|35726|ea4382cfe092a050 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_convert_utf8.result|20050107081531|58104|b90186d893390496 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_create_db_sjis.result|20050107081531|14644|d35a81ed738ce5ba +shuichi@mysql.com|mysql-test/suite/jp/r/jp_create_db_ucs2.result|20050107081532|01516|94fe34e7cf948cf4 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_create_db_ujis.result|20050107081532|23036|4d5552d56ab27619 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_create_db_utf8.result|20050107081532|44748|374e13cc2ae5b0fa +shuichi@mysql.com|mysql-test/suite/jp/r/jp_create_tbl_sjis.result|20050107081532|00620|eee512b72025128e +shuichi@mysql.com|mysql-test/suite/jp/r/jp_create_tbl_ucs2.result|20050107081532|22012|c0187e924a3b5cdc +shuichi@mysql.com|mysql-test/suite/jp/r/jp_create_tbl_ujis.result|20050107081533|09019|e8763bd889fa5d1 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_create_tbl_utf8.result|20050107081533|30411|b9afcd7fdbca71bf +shuichi@mysql.com|mysql-test/suite/jp/r/jp_enum_sjis.result|20050107081533|52491|68150e74f7d83182 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_enum_ucs2.result|20050107081533|08926|50375a296eea1a4c +shuichi@mysql.com|mysql-test/suite/jp/r/jp_enum_ujis.result|20050107081533|30516|26c8e1122bdac1f1 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_enum_utf8.result|20050107081534|17587|577e655491905344 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_insert_sjis.result|20050107081534|39290|67147bffbcee5282 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_insert_ucs2.result|20050107081534|61019|2a3faa20c3360cfb +shuichi@mysql.com|mysql-test/suite/jp/r/jp_insert_ujis.result|20050107081534|17136|5e7b2c0407b9eae +shuichi@mysql.com|mysql-test/suite/jp/r/jp_insert_utf8.result|20050107081535|04220|62fa831c2b8a02e9 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_instr_sjis.result|20050107081535|25969|abfcff6cbdae1925 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_instr_ucs2.result|20050107081535|47754|be297a9ec05c0e0a +shuichi@mysql.com|mysql-test/suite/jp/r/jp_instr_ujis.result|20050107081535|03623|f42e09a2a6736f23 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_instr_utf8.result|20050107081535|24952|8fc889df4669cd6 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_join_sjis.result|20050107081536|12369|396a43a5ac83bda3 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_join_ucs2.result|20050107081536|34440|f112f6b3a020dcb5 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_join_ujis.result|20050107081536|56149|dab3a2b2f5e31eb5 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_join_utf8.result|20050107081536|12246|6661d21d7c485970 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_left_sjis.result|20050107081536|33732|c4d6b2814e85710f +shuichi@mysql.com|mysql-test/suite/jp/r/jp_left_ucs2.result|20050107081537|20829|ebc1bcd92b01ba3 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_left_ujis.result|20050107081537|42728|c88e3ddf34290212 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_left_utf8.result|20050107081537|64357|702b2e408597f5ef +shuichi@mysql.com|mysql-test/suite/jp/r/jp_length_sjis.result|20050107081537|20201|ab84fe078f8c50e +shuichi@mysql.com|mysql-test/suite/jp/r/jp_length_ucs2.result|20050107081538|07211|f79c430972fe4242 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_length_ujis.result|20050107081538|28829|92e66a0d987080ab +shuichi@mysql.com|mysql-test/suite/jp/r/jp_length_utf8.result|20050107081538|50725|f3e1ec3c827572ef +shuichi@mysql.com|mysql-test/suite/jp/r/jp_like_sjis.result|20050107081538|07207|497ea317a9779e08 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_like_ucs2.result|20050107081538|29018|dff13e955936a635 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_like_ujis.result|20050107081539|16190|5aaf14c5cc0eb3d7 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_like_utf8.result|20050107081539|38032|e62cf43214334eaf +shuichi@mysql.com|mysql-test/suite/jp/r/jp_locate_sjis.result|20050107081539|59851|f5cd5bb0720f1388 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_locate_ucs2.result|20050107081539|16013|397f3c3ecc929da +shuichi@mysql.com|mysql-test/suite/jp/r/jp_locate_ujis.result|20050107081540|05016|a0746377dc240841 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_locate_utf8.result|20050107081540|26599|65816e1c9ea27fbc +shuichi@mysql.com|mysql-test/suite/jp/r/jp_lpad_sjis.result|20050107081540|48453|be23445a258c2efb +shuichi@mysql.com|mysql-test/suite/jp/r/jp_lpad_ucs2.result|20050107081540|04446|10797352d768da53 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_lpad_ujis.result|20050107081540|26224|75165c42c9da07e8 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_lpad_utf8.result|20050107081541|13606|36ad2d19941abede +shuichi@mysql.com|mysql-test/suite/jp/r/jp_ltrim_sjis.result|20050107081541|35572|2b3b542ec89a8440 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_ltrim_ucs2.result|20050107081541|57615|cab66782e2d918b7 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_ltrim_ujis.result|20050107081541|13734|5e405409e03dca3 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_ltrim_utf8.result|20050107081542|00849|5f64c2575080fb2e +shuichi@mysql.com|mysql-test/suite/jp/r/jp_ps_sjis.result|20050107081542|22464|194a85125571489c +shuichi@mysql.com|mysql-test/suite/jp/r/jp_ps_ujis.result|20050107081542|44552|1d31f04dc3869387 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_replace_sjis.result|20050107081542|00673|76b3f6fab7cce305 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_replace_ucs2.result|20050107081542|22178|40a5c69f7fb9ad70 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_replace_ujis.result|20050107081543|09299|ab8af1803ff6de87 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_replace_utf8.result|20050107081543|31103|34a42201cf18603f +shuichi@mysql.com|mysql-test/suite/jp/r/jp_reverse_sjis.result|20050107081543|53242|2fd638c1bbea9de +shuichi@mysql.com|mysql-test/suite/jp/r/jp_reverse_ucs2.result|20050107081543|09440|bcae1663ff14df06 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_reverse_ujis.result|20050107081543|31543|69792ccfb7d3b59b +shuichi@mysql.com|mysql-test/suite/jp/r/jp_reverse_utf8.result|20050107081544|19023|30e4181e77154299 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_right_sjis.result|20050107081544|40814|84b8e7d33c6cc088 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_right_ucs2.result|20050107081544|62694|20e50c73803406e0 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_right_ujis.result|20050107081544|18674|2bd13ccf7478f32b +shuichi@mysql.com|mysql-test/suite/jp/r/jp_right_utf8.result|20050107081545|06019|b26626fbc0c8fa25 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_rpad_sjis.result|20050107081545|47717|a6cb9a00a34d9280 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_rpad_ucs2.result|20050107081545|03933|6f310a21c6a3ad7f +shuichi@mysql.com|mysql-test/suite/jp/r/jp_rpad_ujis.result|20050107081545|25719|419271caa26c24cd +shuichi@mysql.com|mysql-test/suite/jp/r/jp_rpad_utf8.result|20050107081546|12990|e1cd2ebd6c0208ea +shuichi@mysql.com|mysql-test/suite/jp/r/jp_rtrim_sjis.result|20050107081546|34719|d23e6090f98e8fbc +shuichi@mysql.com|mysql-test/suite/jp/r/jp_rtrim_ucs2.result|20050107081546|56850|f2fe2a72c482aa49 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_rtrim_ujis.result|20050107081546|13304|1e865c1ccf400e23 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_rtrim_utf8.result|20050107081547|00440|8b2e0fffb1bc5cd4 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_select_sjis.result|20050107081547|22111|60535594c5605694 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_select_ucs2.result|20050107081547|44100|71c3558952cbc6ad +shuichi@mysql.com|mysql-test/suite/jp/r/jp_select_ujis.result|20050107081547|00264|f0e2860f90982398 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_select_utf8.result|20050107081547|21895|eeef381fbf2d9c95 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_subquery_sjis.result|20050107081548|09502|b652bee325136852 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_subquery_ucs2.result|20050107081548|31516|8a8aa66dad072fed +shuichi@mysql.com|mysql-test/suite/jp/r/jp_subquery_ujis.result|20050107081548|53490|8add4d2433058e8e +shuichi@mysql.com|mysql-test/suite/jp/r/jp_subquery_utf8.result|20050107081548|09693|cdeb3a8f901a6efb +shuichi@mysql.com|mysql-test/suite/jp/r/jp_substring_sjis.result|20050107081549|05596|fee80f00e654153 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_substring_ucs2.result|20050107081549|28016|238f41941bf1cde2 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_substring_ujis.result|20050107081549|50377|1d6072226dc693ac +shuichi@mysql.com|mysql-test/suite/jp/r/jp_substring_utf8.result|20050107081549|06796|2dba8103bf4ad46d +shuichi@mysql.com|mysql-test/suite/jp/r/jp_trim_sjis.result|20050107081549|28652|8a103fbcece5bf25 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_trim_ucs2.result|20050107081550|15970|ac4cba762dc14e28 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_trim_ujis.result|20050107081550|37865|4df912345aac10f1 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_trim_utf8.result|20050107081550|60045|79cba16887bf3b1f +shuichi@mysql.com|mysql-test/suite/jp/r/jp_union_ujis.result|20050107081550|16675|f0d464252c220c15 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_update_sjis.result|20050107081551|03970|13dc7639ad1ec6e5 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_update_ucs2.result|20050107081551|25688|8fc9b1f31d32a21f +shuichi@mysql.com|mysql-test/suite/jp/r/jp_update_ujis.result|20050107081551|47775|93f6c8b3f5622aff +shuichi@mysql.com|mysql-test/suite/jp/r/jp_update_utf8.result|20050107081551|04259|24a758ee1768afcc +shuichi@mysql.com|mysql-test/suite/jp/r/jp_where_sjis.result|20050107081551|26138|cb97323da2f50869 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_where_ucs2.result|20050107081552|13450|b3dad356facc16be +shuichi@mysql.com|mysql-test/suite/jp/r/jp_where_ujis.result|20050107081552|35250|4e3045c764bfa364 +shuichi@mysql.com|mysql-test/suite/jp/r/jp_where_utf8.result|20050107081552|57088|143422da49ad0cdb +shuichi@mysql.com|mysql-test/suite/jp/std_data/jisx0201_sjis.dat|20050107081552|13191|3b811e51d64f83c7 +shuichi@mysql.com|mysql-test/suite/jp/std_data/jisx0201_ucs2.dat|20050107083211|03894|85975a083dfb7a54 +shuichi@mysql.com|mysql-test/suite/jp/std_data/jisx0201_ujis.dat|20050107081605|05898|699c7c58964df90 +shuichi@mysql.com|mysql-test/suite/jp/std_data/jisx0201_utf8.dat|20050107081606|12116|74d43073bf069bc7 +shuichi@mysql.com|mysql-test/suite/jp/std_data/jisx0208_sjis.dat|20050107081606|52743|9e8273f37d55fc4 +shuichi@mysql.com|mysql-test/suite/jp/std_data/jisx0208_sjis2.dat|20050107083212|14086|38a382ad2316ccf0 +shuichi@mysql.com|mysql-test/suite/jp/std_data/jisx0208_sjis3.dat|20050107081608|13836|8661d7801d6d35c +shuichi@mysql.com|mysql-test/suite/jp/std_data/jisx0208_ucs2.dat|20050107081608|54705|269e953196baf762 +shuichi@mysql.com|mysql-test/suite/jp/std_data/jisx0208_ujis.dat|20050107081608|29492|e5d30a2aadd8062a +shuichi@mysql.com|mysql-test/suite/jp/std_data/jisx0208_utf8.dat|20050107081609|35613|db4e6eadc27ec29e +shuichi@mysql.com|mysql-test/suite/jp/std_data/jisx0212_ucs2.dat|20050107081609|10803|4fbb36024a7d47d0 +shuichi@mysql.com|mysql-test/suite/jp/std_data/jisx0212_ujis.dat|20050107081610|17128|bedeb2aa4cf2103d +shuichi@mysql.com|mysql-test/suite/jp/std_data/jisx0212_utf8.dat|20050107081610|58355|6f46c105f00e6da7 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_alter_sjis.test|20050107081610|33134|f7c41740399a114a +shuichi@mysql.com|mysql-test/suite/jp/t/jp_alter_ucs2.test|20050107081611|40070|8aded01010aa4027 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_alter_ujis.test|20050107081611|04428|ddd8a1d2c2b10744 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_alter_utf8.test|20050107081611|26011|749a0e3b6ba599d2 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_charlength_sjis.test|20050107081612|13318|38dc8c4a77af62a4 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_charlength_ucs2.test|20050107081612|35063|fe5674c6b12d2b1 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_charlength_ujis.test|20050107081612|57379|e901fbd29981385b +shuichi@mysql.com|mysql-test/suite/jp/t/jp_charlength_utf8.test|20050107081612|13800|36ef1b7b55dc4a1b +shuichi@mysql.com|mysql-test/suite/jp/t/jp_charset_sjis.test|20050107081613|01245|daf9bbe53b34f1a8 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_charset_ucs2.test|20050107081613|22978|ea01c4415d5ef4a4 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_charset_ujis.test|20050107081613|45096|ca893d3a1c4a5fab +shuichi@mysql.com|mysql-test/suite/jp/t/jp_charset_utf8.test|20050107081613|01406|9d3ffec1489a799b +shuichi@mysql.com|mysql-test/suite/jp/t/jp_convert_sjis.test|20050107081613|23086|a7fbf85ce0fc9591 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_convert_ucs2.test|20050107081614|10458|84828e6663159064 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_convert_ujis.test|20050107081614|32393|a64465e0725243 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_convert_utf8.test|20050107081614|54260|8f344fb86504b604 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_create_db_sjis.test|20050107081614|10489|40a1631cffd46fe +shuichi@mysql.com|mysql-test/suite/jp/t/jp_create_db_ucs2.test|20050107081614|32422|8f034f1fb0ae644b +shuichi@mysql.com|mysql-test/suite/jp/t/jp_create_db_ujis.test|20050107081615|20478|bbdb04d1a483939b +shuichi@mysql.com|mysql-test/suite/jp/t/jp_create_db_utf8.test|20050107081615|42908|1f4418fddb751c58 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_create_tbl_sjis.test|20050107081615|64880|448ff3eaff962456 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_create_tbl_ucs2.test|20050107081615|21081|b2bafda9e7a3f226 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_create_tbl_ujis.test|20050107081616|08589|1477760d458bb313 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_create_tbl_utf8.test|20050107081616|30689|a1d12ccab39f74f3 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_enum_sjis.test|20050107081616|53230|9b863b7e4728f82a +shuichi@mysql.com|mysql-test/suite/jp/t/jp_enum_ucs2.test|20050107081617|23149|f05f1cbbe3740670 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_enum_ujis.test|20050107081618|10643|ac136bedb31cf9a8 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_enum_utf8.test|20050107081618|46561|43460e3947ac3d24 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_insert_sjis.test|20050107081618|02948|b32f23f3f588ea9a +shuichi@mysql.com|mysql-test/suite/jp/t/jp_insert_ucs2.test|20050107081618|24774|783e8b896271e49e +shuichi@mysql.com|mysql-test/suite/jp/t/jp_insert_ujis.test|20050107081619|12298|3f9c8c41cd92faa3 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_insert_utf8.test|20050107081619|37128|e4ab71ff1f780509 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_instr_sjis.test|20050107081619|59453|25fc516136ca9159 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_instr_ucs2.test|20050107081619|15956|673e221671a2770d +shuichi@mysql.com|mysql-test/suite/jp/t/jp_instr_ujis.test|20050107081620|03773|75c1239ff59d928a +shuichi@mysql.com|mysql-test/suite/jp/t/jp_instr_utf8.test|20050107081620|26260|ed912ad48a1893a8 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_join_sjis.test|20050107081620|49077|59a36a82ee570052 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_join_ucs2.test|20050107081620|05668|7d8665f03f26863d +shuichi@mysql.com|mysql-test/suite/jp/t/jp_join_ujis.test|20050107081620|27737|ecdf5e86cbda74cb +shuichi@mysql.com|mysql-test/suite/jp/t/jp_join_utf8.test|20050107081621|15489|b98f58e8a4a65e7b +shuichi@mysql.com|mysql-test/suite/jp/t/jp_left_sjis.test|20050107081621|41478|91fcd07aaac68648 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_left_ucs2.test|20050107081621|63674|65929b80d0271c86 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_left_ujis.test|20050107081621|20110|2a5ce575491289f4 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_left_utf8.test|20050107081622|07679|932150eea8460d1 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_length_sjis.test|20050107081622|30138|22fc722d29faeb92 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_length_ucs2.test|20050107081622|52718|81dcde6618d6a22d +shuichi@mysql.com|mysql-test/suite/jp/t/jp_length_ujis.test|20050107081622|09451|d5be7e1b3b4fb88b +shuichi@mysql.com|mysql-test/suite/jp/t/jp_length_utf8.test|20050107081622|31964|cfd3ea368b652b5b +shuichi@mysql.com|mysql-test/suite/jp/t/jp_like_sjis.test|20050107081623|19721|1db71ef08ca802d0 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_like_ucs2.test|20050107081623|42415|55eee7f0b2b984cd +shuichi@mysql.com|mysql-test/suite/jp/t/jp_like_ujis.test|20050107081623|64766|4136ccd8cd83eee5 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_like_utf8.test|20050107081623|21529|556e575385ee58f +shuichi@mysql.com|mysql-test/suite/jp/t/jp_locate_sjis.test|20050107081624|09362|ac12c88e8477d736 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_locate_ucs2.test|20050107081624|31699|e6e0cc4752262b9f +shuichi@mysql.com|mysql-test/suite/jp/t/jp_locate_ujis.test|20050107081624|54042|afa7eadd28fa536e +shuichi@mysql.com|mysql-test/suite/jp/t/jp_locate_utf8.test|20050107081624|10934|307d85c4cd318e62 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_lpad_sjis.test|20050107081624|33252|29972178e7d58d93 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_lpad_ucs2.test|20050107081625|21025|b722d1ed662e03c8 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_lpad_ujis.test|20050107081625|44023|c1feeadebdfc0ff9 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_lpad_utf8.test|20050107081625|01097|2f3347de2a42b9d6 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_ltrim_sjis.test|20050107081625|23224|fb954f6d4b2a20ac +shuichi@mysql.com|mysql-test/suite/jp/t/jp_ltrim_ucs2.test|20050107081626|11079|998157355fe96143 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_ltrim_ujis.test|20050107081626|33500|aab63ba3302196a2 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_ltrim_utf8.test|20050107081626|55883|8193f90a6ed58d36 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_ps_sjis.test|20050107081626|12674|2f1450a52f147fec +shuichi@mysql.com|mysql-test/suite/jp/t/jp_ps_ujis.test|20050107081627|00495|7b0eb3ca59abb12 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_replace_sjis.test|20050107081627|23008|a74ce2aca0e5ac66 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_replace_ucs2.test|20050107081627|45674|71b7010127493fb +shuichi@mysql.com|mysql-test/suite/jp/t/jp_replace_ujis.test|20050107081627|02501|cfe2af6b3db381c0 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_replace_utf8.test|20050107081627|24683|57e905b35703072 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_reverse_sjis.test|20050107081628|12962|f40219e9e488fc23 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_reverse_ucs2.test|20050107081628|35555|2c0e7ad52ec9ca65 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_reverse_ujis.test|20050107081628|57942|c353d85f4e92f5df +shuichi@mysql.com|mysql-test/suite/jp/t/jp_reverse_utf8.test|20050107081628|14597|e2588c2a3dcf63a +shuichi@mysql.com|mysql-test/suite/jp/t/jp_right_sjis.test|20050107081629|02304|14af84f068332d50 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_right_ucs2.test|20050107081629|24565|729a8377aa8100e4 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_right_ujis.test|20050107081629|47409|a839209fac19b930 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_right_utf8.test|20050107081629|04400|ada246cab13f1811 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_rpad_sjis.test|20050107081629|26583|9ae895ba98c4d31 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_rpad_ucs2.test|20050107081630|14467|cc7b3b62ee6dae28 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_rpad_ujis.test|20050107081630|37003|9c869c17899db4c7 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_rpad_utf8.test|20050107081630|59835|a8ed7c9ff559c38d +shuichi@mysql.com|mysql-test/suite/jp/t/jp_rtrim_sjis.test|20050107081630|16798|82a8f174f2ac5988 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_rtrim_ucs2.test|20050107081631|04558|1f90bdf68ed4d6d0 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_rtrim_ujis.test|20050107081631|26878|1804ccc6518b5d9 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_rtrim_utf8.test|20050107081631|49568|74375ee1105781bd +shuichi@mysql.com|mysql-test/suite/jp/t/jp_select_sjis.test|20050107081631|06299|b1151637493de45 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_select_ucs2.test|20050107081632|27924|3364d51b3168f562 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_select_ujis.test|20050107081632|50639|721b5841964bf8e6 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_select_utf8.test|20050107081632|07426|37222d28b4cfe7c8 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_subquery_sjis.test|20050107081632|29631|c92ff81669eb652 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_subquery_ucs2.test|20050107084021|10337|4b920d28fc9dc5aa +shuichi@mysql.com|mysql-test/suite/jp/t/jp_subquery_ujis.test|20050107083216|33062|3f51b47de1fb0c17 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_subquery_utf8.test|20050107081637|15503|fe599c9515084385 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_substring_sjis.test|20050107081638|08555|305285c02185f498 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_substring_ucs2.test|20050107081638|36441|ddc58f642ca61418 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_substring_ujis.test|20050107081638|64337|2cc53c02a5cc4879 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_substring_utf8.test|20050107081638|26081|55bb4e11bc747e5d +shuichi@mysql.com|mysql-test/suite/jp/t/jp_trim_sjis.test|20050107081639|19046|ec18bf7845064d09 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_trim_ucs2.test|20050107081639|46660|583edc63a51fd799 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_trim_ujis.test|20050107081639|06910|87aad3c53be879fd +shuichi@mysql.com|mysql-test/suite/jp/t/jp_trim_utf8.test|20050107081639|29347|b35fcc89b5fa47c3 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_union_ujis.test|20050107081640|17665|1eb842f74190b3c1 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_update_sjis.test|20050107081640|40239|d21d19721f975c74 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_update_ucs2.test|20050107081640|62869|3dad27b824548037 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_update_ujis.test|20050107081640|19575|5c3da888e148065b +shuichi@mysql.com|mysql-test/suite/jp/t/jp_update_utf8.test|20050107081641|07967|bc3adabdd5ac865 +shuichi@mysql.com|mysql-test/suite/jp/t/jp_where_sjis.test|20050107081641|30584|e2886fcc8b23152f +shuichi@mysql.com|mysql-test/suite/jp/t/jp_where_ucs2.test|20050107081641|53233|b3c07768684ddfdb +shuichi@mysql.com|mysql-test/suite/jp/t/jp_where_ujis.test|20050107081641|10027|9e123ef3c645b66a +shuichi@mysql.com|mysql-test/suite/jp/t/jp_where_utf8.test|20050107081641|32217|59fb529f60d9d8bc tfr@sarvik.tfr.cafe.ee|Docs/Flags/costarica.eps|20020228162345|64529|31ade79a89683616 tfr@sarvik.tfr.cafe.ee|Docs/Flags/costarica.gif|20020228162348|36945|364ca7338682f71 tfr@sarvik.tfr.cafe.ee|Docs/Flags/costarica.txt|20020228162350|33044|e155c53c10374ff From 4bb238a0546b58cab1e8e2cb0efdc854dcc29752 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 10 Jan 2005 23:59:28 +0100 Subject: [PATCH 0691/1063] Fix double-initalization of mutex in archive storage engine. (Bug #7762) sql/examples/ha_archive.cc: Fix redundant initialization of share->mutex Fix error handling to always clean up correctly Fix a couple of warnings --- sql/examples/ha_archive.cc | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/sql/examples/ha_archive.cc b/sql/examples/ha_archive.cc index 771bf91d118..59024405bec 100644 --- a/sql/examples/ha_archive.cc +++ b/sql/examples/ha_archive.cc @@ -341,10 +341,8 @@ ARCHIVE_SHARE *ha_archive::get_share(const char *table_name, TABLE *table) if ((share->archive_write= gzopen(share->data_file_name, "ab")) == NULL) goto error2; if (my_hash_insert(&archive_open_tables, (byte*) share)) - goto error2; - thr_lock_init(&share->lock); - if (pthread_mutex_init(&share->mutex,MY_MUTEX_INIT_FAST)) goto error3; + thr_lock_init(&share->lock); } share->use_count++; pthread_mutex_unlock(&archive_mutex); @@ -352,14 +350,13 @@ ARCHIVE_SHARE *ha_archive::get_share(const char *table_name, TABLE *table) return share; error3: - VOID(pthread_mutex_destroy(&share->mutex)); - thr_lock_delete(&share->lock); /* We close, but ignore errors since we already have errors */ (void)gzclose(share->archive_write); error2: my_close(share->meta_file,MYF(0)); error: pthread_mutex_unlock(&archive_mutex); + VOID(pthread_mutex_destroy(&share->mutex)); my_free((gptr) share, MYF(0)); return NULL; @@ -493,23 +490,29 @@ int ha_archive::create(const char *name, TABLE *table_arg, if ((archive= gzdopen(create_file, "ab")) == NULL) { error= errno; - delete_table(name); - goto error; + goto error2; } if (write_data_header(archive)) { - gzclose(archive); + error= errno; + goto error3; + } + + if (gzclose(archive)) { + error= errno; goto error2; } - if (gzclose(archive)) - goto error2; + my_close(create_file, MYF(0)); DBUG_RETURN(0); +error3: + /* We already have an error, so ignore results of gzclose. */ + (void)gzclose(archive); error2: - error= errno; - delete_table(name); + my_close(create_file, MYF(0)); + delete_table(name); error: /* Return error number, if we got one */ DBUG_RETURN(error ? error : -1); @@ -736,7 +739,7 @@ int ha_archive::rebuild_meta_file(char *table_name, File meta_file) if ((rebuild_file= gzopen(data_file_name, "rb")) == NULL) DBUG_RETURN(errno ? errno : -1); - if (rc= read_data_header(rebuild_file)) + if ((rc= read_data_header(rebuild_file))) goto error; /* @@ -800,7 +803,7 @@ int ha_archive::optimize(THD* thd, HA_CHECK_OPT* check_opt) DBUG_RETURN(-1); } - while (read= gzread(reader, block, IO_SIZE)) + while ((read= gzread(reader, block, IO_SIZE))) gzwrite(writer, block, read); gzclose(reader); From 4bd2b5adc4789b76088be0ed202752dad7c64a86 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 11 Jan 2005 01:01:35 +0100 Subject: [PATCH 0692/1063] Fix style nit sql/examples/ha_archive.cc: Fix style --- sql/examples/ha_archive.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sql/examples/ha_archive.cc b/sql/examples/ha_archive.cc index 59024405bec..ef609513489 100644 --- a/sql/examples/ha_archive.cc +++ b/sql/examples/ha_archive.cc @@ -498,7 +498,8 @@ int ha_archive::create(const char *name, TABLE *table_arg, goto error3; } - if (gzclose(archive)) { + if (gzclose(archive)) + { error= errno; goto error2; } From ac606583ca57bf3e6431f6181158c30a8f73255a Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 11 Jan 2005 01:35:08 +0100 Subject: [PATCH 0693/1063] mtr_process.pl: Catch more fork() errors. Moved sleep_until_file_created() here from "mysql-test-run.pl". Improved debug output. mtr_io.pl: Improved mtr_get_opts_from_file(), try to mimic some sh. mysql-test-run.pl: Cleaned up the timeout handling. Created new function environment_setup(). Corrected time zone handling. Moved sleep_until_file_created() to "lib/mtr_process.pl". Improved debug output. mysql-test/mysql-test-run.pl: Cleaned up the timeout handling. Created new function environment_setup(). Corrected time zone handling. Moved sleep_until_file_created() to "lib/mtr_process.pl". Improved debug output. mysql-test/lib/mtr_io.pl: Improved mtr_get_opts_from_file(), try to mimic some sh. mysql-test/lib/mtr_process.pl: Catch more fork() errors. Moved sleep_until_file_created() here from "mysql-test-run.pl". Improved debug output. --- mysql-test/lib/mtr_io.pl | 63 +++++++++++++++- mysql-test/lib/mtr_process.pl | 79 ++++++++++++++----- mysql-test/mysql-test-run.pl | 138 ++++++++++++++++++---------------- 3 files changed, 192 insertions(+), 88 deletions(-) diff --git a/mysql-test/lib/mtr_io.pl b/mysql-test/lib/mtr_io.pl index 14ea37dbb75..017ba11645b 100644 --- a/mysql-test/lib/mtr_io.pl +++ b/mysql-test/lib/mtr_io.pl @@ -35,13 +35,72 @@ sub mtr_get_opts_from_file ($) { while ( ) { chomp; - s/\$MYSQL_TEST_DIR/$::glob_mysql_test_dir/g; - push(@args, split(' ', $_)); + + # --set-variable=init_connect=set @a='a\\0c' + s/^\s+//; # Remove leading space + s/\s+$//; # Remove ending space + + # This is strange, but we need to fill whitespace inside + # quotes with something, to remove later. We do this to + # be able to split on space. Else, we have trouble with + # options like + # + # --someopt="--insideopt1 --insideopt2" + # + # But still with this, we are not 100% sure it is right, + # we need a shell to do it right. + +# print STDERR "\n"; +# print STDERR "AAA: $_\n"; + + s/\'([^\'\"]*)\'/unspace($1,"\x0a")/ge; + s/\"([^\'\"]*)\"/unspace($1,"\x0b")/ge; + s/\'([^\'\"]*)\'/unspace($1,"\x0a")/ge; + s/\"([^\'\"]*)\"/unspace($1,"\x0b")/ge; + +# print STDERR "BBB: $_\n"; + +# foreach my $arg (/(--?\w.*?)(?=\s+--?\w|$)/) + + # FIXME ENV vars should be expanded!!!! + + foreach my $arg (split(/[ \t]+/)) + { + $arg =~ tr/\x11\x0a\x0b/ \'\"/; # Put back real chars + # The outermost quotes has to go + $arg =~ s/^([^\'\"]*)\'(.*)\'([^\'\"]*)$/$1$2$3/ + or $arg =~ s/^([^\'\"]*)\"(.*)\"([^\'\"]*)$/$1$2$3/; + $arg =~ s/\\\\/\\/g; + + $arg =~ s/\$\{(\w+)\}/envsubst($1)/ge; + $arg =~ s/\$(\w+)/envsubst($1)/ge; + +# print STDERR "ARG: $arg\n"; + push(@args, $arg); + } } close FILE; return \@args; } +sub envsubst { + my $string= shift; + + if ( ! defined $ENV{$string} ) + { + mtr_error("opt file referense \$$string that is unknown"); + } + + return $ENV{$string}; +} + +sub unspace { + my $string= shift; + my $quote= shift; + $string =~ s/[ \t]/\x11/g; + return "$quote$string$quote"; +} + sub mtr_fromfile ($) { my $file= shift; diff --git a/mysql-test/lib/mtr_process.pl b/mysql-test/lib/mtr_process.pl index 8c584802b8e..e832468d0cb 100644 --- a/mysql-test/lib/mtr_process.pl +++ b/mysql-test/lib/mtr_process.pl @@ -4,7 +4,7 @@ # and is part of the translation of the Bourne shell script with the # same name. -use Carp qw(cluck); +#use Carp qw(cluck); use strict; use POSIX ":sys_wait_h"; @@ -64,18 +64,6 @@ sub spawn_impl ($$$$$$$) { my $error= shift; my $pid_file= shift; # FIXME - # FIXME really needing a PATH??? - # $ENV{'PATH'}= "/bin:/usr/bin:/usr/local/bin:/usr/bsd:/usr/X11R6/bin:/usr/openwin/bin:/usr/bin/X11:$ENV{'PATH'}"; - - $ENV{'TZ'}= "GMT-3"; # for UNIX_TIMESTAMP tests to work - $ENV{'LC_COLLATE'}= "C"; - $ENV{'MYSQL_TEST_DIR'}= $::glob_mysql_test_dir; - $ENV{'MASTER_MYPORT'}= $::opt_master_myport; - $ENV{'SLAVE_MYPORT'}= $::opt_slave_myport; -# $ENV{'MYSQL_TCP_PORT'}= '@MYSQL_TCP_PORT@'; # FIXME - $ENV{'MYSQL_TCP_PORT'}= 3306; - $ENV{'MASTER_MYSOCK'}= $::master->[0]->{'path_mysock'}; - if ( $::opt_script_debug ) { print STDERR "\n"; @@ -85,17 +73,21 @@ sub spawn_impl ($$$$$$$) { print STDERR "#### ", "STDERR $error\n" if $error; if ( $join ) { - print STDERR "#### ", "run"; + print STDERR "#### ", "RUN "; } else { - print STDERR "#### ", "spawn"; + print STDERR "#### ", "SPAWN "; } print STDERR "$path ", join(" ",@$arg_list_t), "\n"; print STDERR "#### ", "-" x 78, "\n"; } my $pid= fork(); + if ( ! defined $pid ) + { + mtr_error("$path ($pid) can't be forked"); + } if ( $pid ) { @@ -104,17 +96,22 @@ sub spawn_impl ($$$$$$$) { { # We run a command and wait for the result # FIXME this need to be improved - waitpid($pid,0); + my $res= waitpid($pid,0); + + if ( $res == -1 ) + { + mtr_error("$path ($pid) got lost somehow"); + } my $exit_value= $? >> 8; my $signal_num= $? & 127; my $dumped_core= $? & 128; if ( $signal_num ) { - mtr_error("spawn got signal $signal_num"); + mtr_error("$path ($pid) got signal $signal_num"); } if ( $dumped_core ) { - mtr_error("spawn dumped core"); + mtr_error("$path ($pid) dumped core"); } return $exit_value; } @@ -326,7 +323,8 @@ sub mtr_stop_mysqld_servers ($$) { mtr_init_args(\$args); mtr_add_arg($args, "--no-defaults"); - mtr_add_arg($args, "-uroot"); + mtr_add_arg($args, "--user=%s", $::opt_user); + mtr_add_arg($args, "--password="); if ( -e $srv->{'sockfile'} ) { mtr_add_arg($args, "--socket=%s", $srv->{'sockfile'}); @@ -336,7 +334,8 @@ sub mtr_stop_mysqld_servers ($$) { mtr_add_arg($args, "--port=%s", $srv->{'port'}); } mtr_add_arg($args, "--connect_timeout=5"); - mtr_add_arg($args, "--shutdown_timeout=70"); + mtr_add_arg($args, "--shutdown_timeout=20"); + mtr_add_arg($args, "--protocol=tcp"); # FIXME new thing, will it help?! mtr_add_arg($args, "shutdown"); # We don't wait for termination of mysqladmin mtr_spawn($::exe_mysqladmin, $args, @@ -361,6 +360,10 @@ sub mtr_stop_mysqld_servers ($$) { { last PIDSOCKFILEREMOVED; } + if ( $loop % 20 == 1 ) + { + mtr_warning("Still processes alive after 10 seconds, retrying for $loop seconds..."); + } mtr_debug("Sleep for 1 second waiting for pid and socket file removal"); sleep(1); # One second } @@ -464,4 +467,40 @@ sub stop_reap_all { $SIG{CHLD}= 'DEFAULT'; } +############################################################################## +# +# Wait for a file to be created +# +############################################################################## + + +sub sleep_until_file_created ($$) { + my $pidfile= shift; + my $timeout= shift; + + my $loop= $timeout; + while ( $loop-- ) + { + if ( -r $pidfile ) + { + return; + } + mtr_debug("Sleep for 1 second waiting for creation of $pidfile"); + + if ( $loop % 20 == 1 ) + { + mtr_warning("Waiting for $pidfile to be created, still trying for $loop seconds..."); + } + + sleep(1); + } + + if ( ! -r $pidfile ) + { + mtr_error("No $pidfile was created"); + } +} + + + 1; diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 01729aa1018..3bbdb48d98a 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -232,6 +232,8 @@ our $opt_local_master; our $master; # Will be struct in C our $slave; +our $opt_master_myport; +our $opt_slave_myport; our $opt_ndbcluster_port; our $opt_ndbconnectstring; @@ -248,16 +250,10 @@ our $opt_skip_rpl; our $opt_skip_test; our $opt_sleep; - our $opt_ps_protocol; -# FIXME all of the sleep time handling needs cleanup -our $opt_sleep_time_after_restart= 1; -our $opt_sleep_time_for_delete= 10; -our $opt_sleep_time_for_first_master= 400; # enough time create innodb tables -our $opt_sleep_time_for_second_master= 400; -our $opt_sleep_time_for_first_slave= 400; -our $opt_sleep_time_for_second_slave= 30; +our $opt_sleep_time_after_restart= 1; +our $opt_sleep_time_for_delete= 10; our $opt_socket; @@ -270,7 +266,7 @@ our $opt_strace_client; our $opt_timer; - +our $opt_user; our $opt_user_test; our $opt_valgrind; @@ -299,6 +295,7 @@ sub main (); sub initial_setup (); sub command_line_setup (); sub executable_setup (); +sub environment_setup (); sub kill_and_cleanup (); sub collect_test_cases ($); sub sleep_until_file_created ($$); @@ -332,6 +329,7 @@ sub main () { initial_setup(); command_line_setup(); executable_setup(); + environment_setup(); signal_setup(); if ( $opt_gcov ) @@ -449,12 +447,9 @@ sub command_line_setup () { $path_manager_log= "$glob_mysql_test_dir/var/log/manager.log"; $opt_current_test= "$glob_mysql_test_dir/var/log/current_test"; - my $opt_master_myport= 9306; - my $opt_slave_myport= 9308; - $opt_ndbcluster_port= 9350; - $opt_sleep_time_for_delete= 10; - - my $opt_user; + $opt_master_myport= 9306; + $opt_slave_myport= 9308; + $opt_ndbcluster_port= 9350; # Read the command line # Note: Keep list, and the order, in sync with usage at end of this file @@ -545,6 +540,7 @@ sub command_line_setup () { $master->[0]->{'path_mypid'}= "$glob_mysql_test_dir/var/run/master.pid"; $master->[0]->{'path_mysock'}= "$opt_tmpdir/master.sock"; $master->[0]->{'path_myport'}= $opt_master_myport; + $master->[0]->{'start_timeout'}= 400; # enough time create innodb tables $master->[1]->{'path_myddir'}= "$glob_mysql_test_dir/var/master1-data"; $master->[1]->{'path_myerr'}= "$glob_mysql_test_dir/var/log/master1.err"; @@ -552,6 +548,7 @@ sub command_line_setup () { $master->[1]->{'path_mypid'}= "$glob_mysql_test_dir/var/run/master1.pid"; $master->[1]->{'path_mysock'}= "$opt_tmpdir/master1.sock"; $master->[1]->{'path_myport'}= $opt_master_myport + 1; + $master->[1]->{'start_timeout'}= 400; # enough time create innodb tables $slave->[0]->{'path_myddir'}= "$glob_mysql_test_dir/var/slave-data"; $slave->[0]->{'path_myerr'}= "$glob_mysql_test_dir/var/log/slave.err"; @@ -559,6 +556,7 @@ sub command_line_setup () { $slave->[0]->{'path_mypid'}= "$glob_mysql_test_dir/var/run/slave.pid"; $slave->[0]->{'path_mysock'}= "$opt_tmpdir/slave.sock"; $slave->[0]->{'path_myport'}= $opt_slave_myport; + $slave->[0]->{'start_timeout'}= 400; $slave->[1]->{'path_myddir'}= "$glob_mysql_test_dir/var/slave1-data"; $slave->[1]->{'path_myerr'}= "$glob_mysql_test_dir/var/log/slave1.err"; @@ -566,6 +564,7 @@ sub command_line_setup () { $slave->[1]->{'path_mypid'}= "$glob_mysql_test_dir/var/run/slave1.pid"; $slave->[1]->{'path_mysock'}= "$opt_tmpdir/slave1.sock"; $slave->[1]->{'path_myport'}= $opt_slave_myport + 1; + $slave->[1]->{'start_timeout'}= 30; $slave->[2]->{'path_myddir'}= "$glob_mysql_test_dir/var/slave2-data"; $slave->[2]->{'path_myerr'}= "$glob_mysql_test_dir/var/log/slave2.err"; @@ -573,6 +572,7 @@ sub command_line_setup () { $slave->[2]->{'path_mypid'}= "$glob_mysql_test_dir/var/run/slave2.pid"; $slave->[2]->{'path_mysock'}= "$opt_tmpdir/slave2.sock"; $slave->[2]->{'path_myport'}= $opt_slave_myport + 2; + $slave->[2]->{'start_timeout'}= 30; # Do sanity checks of command line arguments @@ -594,16 +594,6 @@ sub command_line_setup () { $master->[0]->{'path_mysock'}= $opt_socket; } - # -------------------------------------------------------------------------- - # Set LD_LIBRARY_PATH if we are using shared libraries - # -------------------------------------------------------------------------- - $ENV{'LD_LIBRARY_PATH'}= - "$glob_basedir/lib:$glob_basedir/libmysql/.libs" . - ($ENV{'LD_LIBRARY_PATH'} ? ":$ENV{'LD_LIBRARY_PATH'}" : ""); - $ENV{'DYLD_LIBRARY_PATH'}= - "$glob_basedir/lib:$glob_basedir/libmysql/.libs" . - ($ENV{'DYLD_LIBRARY_PATH'} ? ":$ENV{'DYLD_LIBRARY_PATH'}" : ""); - # -------------------------------------------------------------------------- # Look at the command line options and set script flags # -------------------------------------------------------------------------- @@ -741,7 +731,7 @@ sub executable_setup () { } else { - mtr_error("Cannot find embedded server 'mysqltest'"); + mtr_error("Can't find embedded server 'mysqltest'"); } $path_tests_bindir= "$glob_basedir/libmysqld/examples"; } @@ -831,6 +821,41 @@ sub executable_setup () { } +############################################################################## +# +# Set environment to be used by childs of this process +# +############################################################################## + +# Note that some env is setup in spawn/run, in "mtr_process.pl" + +sub environment_setup () { + + # -------------------------------------------------------------------------- + # Set LD_LIBRARY_PATH if we are using shared libraries + # -------------------------------------------------------------------------- + + $ENV{'LD_LIBRARY_PATH'}= + "$glob_basedir/lib:$glob_basedir/libmysql/.libs" . + ($ENV{'LD_LIBRARY_PATH'} ? ":$ENV{'LD_LIBRARY_PATH'}" : ""); + $ENV{'DYLD_LIBRARY_PATH'}= + "$glob_basedir/lib:$glob_basedir/libmysql/.libs" . + ($ENV{'DYLD_LIBRARY_PATH'} ? ":$ENV{'DYLD_LIBRARY_PATH'}" : ""); + + # -------------------------------------------------------------------------- + # Also command lines in .opt files may contain env vars + # -------------------------------------------------------------------------- + + $ENV{'LC_COLLATE'}= "C"; + $ENV{'MYSQL_TEST_DIR'}= $glob_mysql_test_dir; + $ENV{'MASTER_MYPORT'}= $opt_master_myport; + $ENV{'SLAVE_MYPORT'}= $opt_slave_myport; +# $ENV{'MYSQL_TCP_PORT'}= '@MYSQL_TCP_PORT@'; # FIXME + $ENV{'MYSQL_TCP_PORT'}= 3306; + $ENV{'MASTER_MYSOCK'}= $master->[0]->{'path_mysock'}; +} + + ############################################################################## # # If we get a ^C, we try to clean up before termination @@ -922,6 +947,7 @@ sub collect_test_cases ($) { # ---------------------------------------------------------------------- $tinfo->{'path'}= $path; + $tinfo->{'timezone'}= "GMT-3"; # for UNIX_TIMESTAMP tests to work if ( defined mtr_match_prefix($tname,"rpl") ) { @@ -967,7 +993,7 @@ sub collect_test_cases ($) { if ( defined $value ) { - $ENV{'TZ'}= $value; # FIXME pass this on somehow.... + $tinfo->{'timezone'}= $value; $extra_master_opt= []; $tinfo->{'master_restart'}= 0; last; @@ -1071,6 +1097,7 @@ sub kill_and_cleanup () { # leftovers from previous runs. mtr_report("Killing Possible Leftover Processes"); + mkpath("$glob_mysql_test_dir/var/log"); # Needed for mysqladmin log mtr_kill_leftovers(); } @@ -1092,52 +1119,28 @@ sub kill_and_cleanup () { mkpath("$glob_mysql_test_dir/var/tmp"); mkpath($opt_tmpdir); + # FIXME do we really need to create these all, or are they + # created for us when tables are created? + rmtree("$master->[0]->{'path_myddir'}"); - mkpath("$master->[0]->{'path_myddir'}/mysql"); # Need to create subdir?! + mkpath("$master->[0]->{'path_myddir'}/mysql"); mkpath("$master->[0]->{'path_myddir'}/test"); rmtree("$master->[1]->{'path_myddir'}"); - mkpath("$master->[1]->{'path_myddir'}/mysql"); # Need to create subdir?! + mkpath("$master->[1]->{'path_myddir'}/mysql"); mkpath("$master->[1]->{'path_myddir'}/test"); rmtree("$slave->[0]->{'path_myddir'}"); - mkpath("$slave->[0]->{'path_myddir'}/mysql"); # Need to create subdir?! + mkpath("$slave->[0]->{'path_myddir'}/mysql"); mkpath("$slave->[0]->{'path_myddir'}/test"); rmtree("$slave->[1]->{'path_myddir'}"); - mkpath("$slave->[1]->{'path_myddir'}/mysql"); # Need to create subdir?! + mkpath("$slave->[1]->{'path_myddir'}/mysql"); mkpath("$slave->[1]->{'path_myddir'}/test"); rmtree("$slave->[2]->{'path_myddir'}"); - mkpath("$slave->[2]->{'path_myddir'}/mysql"); # Need to create subdir?! + mkpath("$slave->[2]->{'path_myddir'}/mysql"); mkpath("$slave->[2]->{'path_myddir'}/test"); - - $opt_wait_for_master= $opt_sleep_time_for_first_master; - $opt_wait_for_slave= $opt_sleep_time_for_first_slave; -} - - -# FIXME - -sub sleep_until_file_created ($$) { - my $pidfile= shift; - my $timeout= shift; - - my $loop= $timeout * 2; - while ( $loop-- ) - { - if ( -r $pidfile ) - { - return; - } - mtr_debug("Sleep for 1 second waiting for creation of $pidfile"); - sleep(1); - } - - if ( ! -r $pidfile ) - { - mtr_error("No $pidfile was created"); - } } @@ -1251,11 +1254,11 @@ sub run_suite () { mtr_print_thick_line(); - mtr_report("Finding Tests in $suite suite"); + mtr_report("Finding Tests in the '$suite' suite"); my $tests= collect_test_cases($suite); - mtr_report("Starting Tests in $suite suite"); + mtr_report("Starting Tests in the '$suite' suite"); mtr_print_header(); @@ -1412,6 +1415,8 @@ sub run_testcase ($) { # the preparation. # ---------------------------------------------------------------------- + $ENV{'TZ'}= $tinfo->{'timezone'}; + mtr_report_test_name($tinfo); mtr_tofile($master->[0]->{'path_myerr'},"CURRENT_TEST: $tname\n"); @@ -1778,6 +1783,7 @@ sub mysqld_arguments ($$$$$) { } # FIXME strange,..... + # FIXME MYSQL_MYPORT is not set anythere?! if ( $opt_local_master ) { mtr_add_arg($args, "%s--host=127.0.0.1", $prefix); @@ -1888,8 +1894,7 @@ sub mysqld_start ($$$$) { $master->[$idx]->{'path_myerr'}, "") ) { sleep_until_file_created($master->[$idx]->{'path_mypid'}, - $opt_wait_for_master); - $opt_wait_for_master= $opt_sleep_time_for_second_master; + $master->[$idx]->{'start_timeout'}); return $pid; } } @@ -1901,8 +1906,7 @@ sub mysqld_start ($$$$) { $slave->[$idx]->{'path_myerr'}, "") ) { sleep_until_file_created($slave->[$idx]->{'path_mypid'}, - $opt_wait_for_slave); - $opt_wait_for_slave= $opt_sleep_time_for_second_slave; + $master->[$idx]->{'start_timeout'}); return $pid; } } @@ -1970,7 +1974,6 @@ sub run_mysqltest ($$) { my $tinfo= shift; my $master_opts= shift; - # FIXME set where???? my $cmdline_mysqldump= "$exe_mysqldump --no-defaults -uroot " . "--socket=$master->[0]->{'path_mysock'} --password="; if ( $opt_debug ) @@ -1992,6 +1995,9 @@ sub run_mysqltest ($$) { "$exe_mysql --host=localhost --port=$master->[0]->{'path_myport'} " . "--socket=$master->[0]->{'path_mysock'} --user=root --password="; + # FIXME really needing a PATH??? + # $ENV{'PATH'}= "/bin:/usr/bin:/usr/local/bin:/usr/bsd:/usr/X11R6/bin:/usr/openwin/bin:/usr/bin/X11:$ENV{'PATH'}"; + $ENV{'MYSQL'}= $exe_mysql; $ENV{'MYSQL_DUMP'}= $cmdline_mysqldump; $ENV{'MYSQL_BINLOG'}= $exe_mysqlbinlog; From 7535b07425b29a75effa543f51f25ddf7ac3646a Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 11 Jan 2005 10:02:31 +0100 Subject: [PATCH 0694/1063] bug#7765 - ndb startup on 64-bit, increase stack on 64-bit ndb/src/common/portlib/NdbThread.c: Use double stack for 64-bit --- ndb/src/common/portlib/NdbThread.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ndb/src/common/portlib/NdbThread.c b/ndb/src/common/portlib/NdbThread.c index 69e39994a9c..d4f6617d2f5 100644 --- a/ndb/src/common/portlib/NdbThread.c +++ b/ndb/src/common/portlib/NdbThread.c @@ -54,7 +54,11 @@ struct NdbThread* NdbThread_Create(NDB_THREAD_FUNC *p_thread_func, strnmov(tmpThread->thread_name,p_thread_name,sizeof(tmpThread->thread_name)); pthread_attr_init(&thread_attr); +#if (SIZEOF_CHARP == 8) + pthread_attr_setstacksize(&thread_attr, 2*thread_stack_size); +#else pthread_attr_setstacksize(&thread_attr, thread_stack_size); +#endif #ifdef USE_PTHREAD_EXTRAS /* Guard stack overflow with a 2k databuffer */ pthread_attr_setguardsize(&thread_attr, 2048); From 1ef48556bd29936095ddd1b59b835f1c8c6bd0b6 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 11 Jan 2005 10:34:36 +0100 Subject: [PATCH 0695/1063] Bug#7477 --- ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp | 29 ++++++----------------- 1 file changed, 7 insertions(+), 22 deletions(-) diff --git a/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp b/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp index a02bfd459b3..a01f094cffd 100644 --- a/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp +++ b/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp @@ -14,19 +14,11 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/** - * O_DIRECT - */ -#if 0 -//#ifdef NDB_LINUX -#ifndef _GNU_SOURCE -#define _GNU_SOURCE -#endif -#endif - #include +#include +#include -#include "Error.hpp" +#include #include "AsyncFile.hpp" #include @@ -35,15 +27,6 @@ #include #include -#if 0 -#ifdef HAVE_PREAD -// This is for pread and pwrite -#ifndef __USE_UNIX98 -#define __USE_UNIX98 -#endif -#endif -#endif - #if defined NDB_WIN32 || defined NDB_OSE || defined NDB_SOFTOSE #else // For readv and writev @@ -91,6 +74,7 @@ static int numAsyncFiles = 0; extern "C" void * runAsyncFile(void* arg) { + my_thread_init(); ((AsyncFile*)arg)->run(); return (NULL); } @@ -419,7 +403,7 @@ AsyncFile::readBuffer(char * buf, size_t size, off_t offset){ #elif defined NDB_OSE || defined NDB_SOFTOSE return_value = ::read(theFd, buf, size); #else // UNIX - return_value = ::pread(theFd, buf, size, offset); + return_value = my_pread(theFd, buf, size, offset,0); #endif #ifndef NDB_WIN32 if (return_value == -1 && errno == EINTR) { @@ -653,7 +637,7 @@ AsyncFile::writeBuffer(const char * buf, size_t size, off_t offset, #elif defined NDB_OSE || defined NDB_SOFTOSE return_value = ::write(theFd, buf, bytes_to_write); #else // UNIX - return_value = ::pwrite(theFd, buf, bytes_to_write, offset); + return_value = my_pwrite(theFd, buf, bytes_to_write, offset, 0); #endif #ifndef NDB_WIN32 if (return_value == -1 && errno == EINTR) { @@ -889,6 +873,7 @@ void AsyncFile::endReq() { // Thread is ended with return if (theWriteBuffer) NdbMem_Free(theWriteBuffer); + my_thread_end(); NdbThread_Exit(0); } From 489bd55741a663f1896fbe7fad5792ef41ed8913 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 11 Jan 2005 11:53:39 +0200 Subject: [PATCH 0696/1063] error of parsing can occur in any SELECT, so all SELECTs have to be checked --- sql/sql_lex.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index d2ac0df1472..f5a0fef6769 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -163,7 +163,8 @@ void lex_start(THD *thd, uchar *buf,uint length) void lex_end(LEX *lex) { - lex->select_lex.expr_list.delete_elements(); // If error when parsing sql-varargs + for(SELECT_LEX *sl= lex->all_selects_list; sl; sl= sl->next_select_in_list()) + sl->expr_list.delete_elements(); // If error when parsing sql-varargs x_free(lex->yacc_yyss); x_free(lex->yacc_yyvs); } From fe8c6a4a032195ae024cf4a8ede675299789a79b Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 11 Jan 2005 13:12:52 +0300 Subject: [PATCH 0697/1063] make it compile with -ansi -pedantic --- sql/net_serv.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/net_serv.cc b/sql/net_serv.cc index ca82c49b62d..5699b5a2f55 100644 --- a/sql/net_serv.cc +++ b/sql/net_serv.cc @@ -251,7 +251,7 @@ my_bool my_net_write(NET *net,const char *packet,ulong len) { uchar buff[NET_HEADER_SIZE]; - if (unlikely(!net->vio)) // nowhere to write + if (unlikely(!net->vio)) /* nowhere to write */ return 0; /* Big packets are handled by splitting them in packets of MAX_PACKET_LENGTH From 4801c2e62f25240d7c27818cbc46568b07709d68 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 11 Jan 2005 13:53:10 +0300 Subject: [PATCH 0698/1063] A fix for linking failure of MySQL client when linking with imap libraries (Bug#7428) (renamed: hash_reset -> my_hash_reset) mysys/hash.c: renamed: hash_reset -> my_hash_reset sql/sql_class.h: hash_reset -> my_hash_reset --- mysys/hash.c | 6 +++--- sql/sql_class.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/mysys/hash.c b/mysys/hash.c index 451bc1eb7f5..6091ef39a4e 100644 --- a/mysys/hash.c +++ b/mysys/hash.c @@ -122,13 +122,13 @@ void hash_free(HASH *hash) Delete all elements from the hash (the hash itself is to be reused). SYNOPSIS - hash_reset() + my_hash_reset() hash the hash to delete elements of */ -void hash_reset(HASH *hash) +void my_hash_reset(HASH *hash) { - DBUG_ENTER("hash_reset"); + DBUG_ENTER("my_hash_reset"); DBUG_PRINT("enter",("hash: 0x%lxd",hash)); hash_free_elements(hash); diff --git a/sql/sql_class.h b/sql/sql_class.h index 169835f3324..7978aec8f1d 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -648,8 +648,8 @@ public: /* Erase all statements (calls Statement destructor) */ void reset() { - hash_reset(&names_hash); - hash_reset(&st_hash); + my_hash_reset(&names_hash); + my_hash_reset(&st_hash); last_found_statement= 0; } From 194937169f340d35a36ef74def972e1699df477c Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 11 Jan 2005 13:57:07 +0300 Subject: [PATCH 0699/1063] Followup: rename the declaration (hash_reset -> my_hash_reset) --- include/hash.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/hash.h b/include/hash.h index cd7210a290c..9a6d91036e1 100644 --- a/include/hash.h +++ b/include/hash.h @@ -47,7 +47,7 @@ my_bool _hash_init(HASH *hash, CHARSET_INFO *charset, uint key_length, hash_get_key get_key, void (*free_element)(void*), uint flags CALLER_INFO_PROTO); void hash_free(HASH *tree); -void hash_reset(HASH *hash); +void my_hash_reset(HASH *hash); byte *hash_element(HASH *hash,uint idx); gptr hash_search(HASH *info,const byte *key,uint length); gptr hash_next(HASH *info,const byte *key,uint length); From 39ee25b3742188026dcc0bcee60951668a4a2275 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 11 Jan 2005 14:26:40 +0300 Subject: [PATCH 0700/1063] Fix for bug #7418 "TIMESTAMP not always converted to DATETIME in MAXDB mode". Changed grammar rule for "type" token. Now we have one branch with optional length specification for TIMESTAMP type instead of two separate branches. mysql-test/r/type_timestamp.result: Added test case for bug #7418 "TIMESTAMP not always converted to DATETIME in MAXDB mode". mysql-test/t/type_timestamp.test: Added test case for bug #7418 "TIMESTAMP not always converted to DATETIME in MAXDB mode". sql/sql_yacc.yy: Changed rule for "type" token. Now we have one branch with optional length specification for TIMESTAMP type instead of two separate branches. This also gives us consistent behavior for TIMETSAMP in MAXDB mode. --- mysql-test/r/type_timestamp.result | 10 ++++++++++ mysql-test/t/type_timestamp.test | 12 ++++++++++++ sql/sql_yacc.yy | 9 +-------- 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/mysql-test/r/type_timestamp.result b/mysql-test/r/type_timestamp.result index 42fdc7e50c6..6c46d308e7e 100644 --- a/mysql-test/r/type_timestamp.result +++ b/mysql-test/r/type_timestamp.result @@ -422,3 +422,13 @@ max(t) 2004-01-01 01:00:00 2004-02-01 00:00:00 drop table t1; +set sql_mode='maxdb'; +create table t1 (a timestamp, b timestamp(19)); +show create table t1; +Table Create Table +t1 CREATE TABLE "t1" ( + "a" datetime default NULL, + "b" datetime default NULL +) +set sql_mode=''; +drop table t1; diff --git a/mysql-test/t/type_timestamp.test b/mysql-test/t/type_timestamp.test index a8a0cf8703c..783e310f02d 100644 --- a/mysql-test/t/type_timestamp.test +++ b/mysql-test/t/type_timestamp.test @@ -286,3 +286,15 @@ insert into t1 values ('a', '2004-01-01 00:00:00'), ('a', '2004-01-01 01:00:00') ('b', '2004-02-01 00:00:00'); select max(t) from t1 group by a; drop table t1; + +# +# Test for bug #7418 "TIMESTAMP not always converted to DATETIME in MAXDB +# mode". TIMESTAMP columns should be converted DATETIME columns in MAXDB +# mode regardless of whether a display width is given. +# +set sql_mode='maxdb'; +create table t1 (a timestamp, b timestamp(19)); +show create table t1; +# restore default mode +set sql_mode=''; +drop table t1; diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index a09694ee1e6..66f7882c4e7 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -1415,7 +1415,7 @@ type: | YEAR_SYM opt_len field_options { $$=FIELD_TYPE_YEAR; } | DATE_SYM { $$=FIELD_TYPE_DATE; } | TIME_SYM { $$=FIELD_TYPE_TIME; } - | TIMESTAMP + | TIMESTAMP opt_len { if (YYTHD->variables.sql_mode & MODE_MAXDB) $$=FIELD_TYPE_DATETIME; @@ -1428,13 +1428,6 @@ type: $$=FIELD_TYPE_TIMESTAMP; } } - | TIMESTAMP '(' NUM ')' - { - LEX *lex= Lex; - lex->length= $3.str; - lex->type|= NOT_NULL_FLAG; - $$= FIELD_TYPE_TIMESTAMP; - } | DATETIME { $$=FIELD_TYPE_DATETIME; } | TINYBLOB { Lex->charset=&my_charset_bin; $$=FIELD_TYPE_TINY_BLOB; } From ae7169786e92929680f7b49bb86a2635be8729f9 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 11 Jan 2005 12:50:54 +0100 Subject: [PATCH 0701/1063] can't use my_pread,my_pwrite since it uses mutexes on the files --- ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp | 57 +++++++++++------------ 1 file changed, 27 insertions(+), 30 deletions(-) diff --git a/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp b/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp index a01f094cffd..ddf1681479c 100644 --- a/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp +++ b/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp @@ -27,6 +27,14 @@ #include #include +// use this to test broken pread code +//#define HAVE_BROKEN_PREAD + +#ifdef HAVE_BROKEN_PREAD +#undef HAVE_PWRITE +#undef HAVE_PREAD +#endif + #if defined NDB_WIN32 || defined NDB_OSE || defined NDB_SOFTOSE #else // For readv and writev @@ -379,9 +387,12 @@ AsyncFile::readBuffer(char * buf, size_t size, off_t offset){ if(dwSFP != offset) { return GetLastError(); } -#elif defined NDB_OSE || defined NDB_SOFTOSE - return_value = lseek(theFd, offset, SEEK_SET); - if (return_value != offset) { +#elif ! defined(HAVE_PREAD) + off_t seek_val; + while((seek_val= lseek(theFd, offset, SEEK_SET)) == (off_t)-1 + && errno == EINTR); + if(seek_val == (off_t)-1) + { return errno; } #endif @@ -400,10 +411,10 @@ AsyncFile::readBuffer(char * buf, size_t size, off_t offset){ return GetLastError(); } bytes_read = dwBytesRead; -#elif defined NDB_OSE || defined NDB_SOFTOSE +#elif ! defined(HAVE_PREAD) return_value = ::read(theFd, buf, size); #else // UNIX - return_value = my_pread(theFd, buf, size, offset,0); + return_value = ::pread(theFd, buf, size, offset); #endif #ifndef NDB_WIN32 if (return_value == -1 && errno == EINTR) { @@ -453,7 +464,7 @@ AsyncFile::readReq( Request * request) void AsyncFile::readvReq( Request * request) { -#if defined NDB_OSE || defined NDB_SOFTOSE +#if ! defined(HAVE_PREAD) readReq(request); return; #elif defined NDB_WIN32 @@ -483,7 +494,7 @@ AsyncFile::readvReq( Request * request) int AsyncFile::extendfile(Request* request) { -#if defined NDB_OSE || defined NDB_SOFTOSE +#if ! defined(HAVE_PWRITE) // Find max size of this file in this request int maxOffset = 0; int maxSize = 0; @@ -592,27 +603,13 @@ AsyncFile::writeBuffer(const char * buf, size_t size, off_t offset, if(dwSFP != offset) { return GetLastError(); } -#elif defined NDB_OSE || defined NDB_SOFTOSE - return_value = lseek(theFd, offset, SEEK_SET); - if (return_value != offset) { - DEBUG(ndbout_c("AsyncFile::writeReq, err1: return_value=%d, offset=%d\n", - return_value, chunk_offset)); - PRINT_ERRORANDFLAGS(0); - if (errno == 78) { - // Could not write beyond end of file, try to extend file - DEBUG(ndbout_c("AsyncFile::writeReq, Extend. file! filename=\"%s\" \n", - theFileName.c_str())); - return_value = extendfile(request); - if (return_value == -1) { - return errno; - } - return_value = lseek(theFd, offset, SEEK_SET); - if (return_value != offset) { - return errno; - } - } else { - return errno; - } +#elif ! defined(HAVE_PWRITE) + off_t seek_val; + while((seek_val= lseek(theFd, offset, SEEK_SET)) == (off_t)-1 + && errno == EINTR); + if(seek_val == (off_t)-1) + { + return errno; } #endif @@ -634,10 +631,10 @@ AsyncFile::writeBuffer(const char * buf, size_t size, off_t offset, DEBUG(ndbout_c("Warning partial write %d != %d", bytes_written, bytes_to_write)); } -#elif defined NDB_OSE || defined NDB_SOFTOSE +#elif ! defined(HAVE_PWRITE) return_value = ::write(theFd, buf, bytes_to_write); #else // UNIX - return_value = my_pwrite(theFd, buf, bytes_to_write, offset, 0); + return_value = ::pwrite(theFd, buf, bytes_to_write, offset); #endif #ifndef NDB_WIN32 if (return_value == -1 && errno == EINTR) { From d73a4de9b7e7a6e73f5b8e71d6c5e8611adf53cd Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 11 Jan 2005 13:30:11 +0100 Subject: [PATCH 0702/1063] bug#7798 - ndb - range scan with invalid table version could cause node failure mysql-test/r/ndb_index_ordered.result: Test scan with invalid table version mysql-test/t/ndb_index_ordered.test: Test scan with invalid table version ndb/src/kernel/blocks/dbtc/DbtcMain.cpp: Set apiConnectstate= CS_ABORTING when receving a scan req with invalid table version --- mysql-test/r/ndb_index_ordered.result | 16 ++++++++++++++ mysql-test/t/ndb_index_ordered.test | 18 ++++++++++++++++ ndb/src/kernel/blocks/dbtc/DbtcMain.cpp | 28 ++++++++++++++++++++----- 3 files changed, 57 insertions(+), 5 deletions(-) diff --git a/mysql-test/r/ndb_index_ordered.result b/mysql-test/r/ndb_index_ordered.result index 75a5e42732b..943571aa524 100644 --- a/mysql-test/r/ndb_index_ordered.result +++ b/mysql-test/r/ndb_index_ordered.result @@ -420,3 +420,19 @@ count(*)-8 select count(*)-9 from t1 use index (ti) where ti <= '23:59:59'; count(*)-9 0 +drop table t1; +create table t1(a int primary key, b int not null, index(b)); +insert into t1 values (1,1), (2,2); +set autocommit=0; +begin; +select count(*) from t1; +count(*) +2 +ALTER TABLE t1 ADD COLUMN c int; +select a from t1 where b = 2; +a +2 +show tables; +Tables_in_test +t1 +drop table t1; diff --git a/mysql-test/t/ndb_index_ordered.test b/mysql-test/t/ndb_index_ordered.test index 71635159604..89f1e5b7e9f 100644 --- a/mysql-test/t/ndb_index_ordered.test +++ b/mysql-test/t/ndb_index_ordered.test @@ -236,3 +236,21 @@ select count(*)-5 from t1 use index (ti) where ti < '10:11:11'; select count(*)-6 from t1 use index (ti) where ti <= '10:11:11'; select count(*)-8 from t1 use index (ti) where ti < '23:59:59'; select count(*)-9 from t1 use index (ti) where ti <= '23:59:59'; + +drop table t1; + +# bug#7798 +create table t1(a int primary key, b int not null, index(b)); +insert into t1 values (1,1), (2,2); +connect (con1,localhost,,,test); +connect (con2,localhost,,,test); +connection con1; +set autocommit=0; +begin; +select count(*) from t1; +connection con2; +ALTER TABLE t1 ADD COLUMN c int; +connection con1; +select a from t1 where b = 2; +show tables; +drop table t1; diff --git a/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp b/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp index dd1252b76b9..815d6c9d838 100644 --- a/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp +++ b/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp @@ -1879,7 +1879,6 @@ void Dbtc::packKeyData000Lab(Signal* signal, Uint32 totalLen) { CacheRecord * const regCachePtr = cachePtr.p; - UintR Tmp; jam(); Uint32 len = 0; @@ -8503,14 +8502,16 @@ void Dbtc::execSCAN_TABREQ(Signal* signal) apiConnectptr.i = scanTabReq->apiConnectPtr; tabptr.i = scanTabReq->tableId; - if (apiConnectptr.i >= capiConnectFilesize || - tabptr.i >= ctabrecFilesize) { + if (apiConnectptr.i >= capiConnectFilesize) + { jam(); warningHandlerLab(signal); return; }//if + ptrAss(apiConnectptr, apiConnectRecord); ApiConnectRecord * transP = apiConnectptr.p; + if (transP->apiConnectstate != CS_CONNECTED) { jam(); // could be left over from TCKEYREQ rollback @@ -8524,9 +8525,16 @@ void Dbtc::execSCAN_TABREQ(Signal* signal) } else { jam(); errCode = ZSTATE_ERROR; - goto SCAN_TAB_error; + goto SCAN_TAB_error_no_state_change; } } + + if(tabptr.i >= ctabrecFilesize) + { + errCode = ZUNKNOWN_TABLE_ERROR; + goto SCAN_TAB_error; + } + ptrAss(tabptr, tableRecord); if ((aiLength == 0) || (!tabptr.p->checkTable(schemaVersion)) || @@ -8621,8 +8629,18 @@ void Dbtc::execSCAN_TABREQ(Signal* signal) errCode = ZNO_SCANREC_ERROR; goto SCAN_TAB_error; - SCAN_TAB_error: +SCAN_TAB_error: jam(); + /** + * Prepare for up coming ATTRINFO/KEYINFO + */ + transP->apiConnectstate = CS_ABORTING; + transP->abortState = AS_IDLE; + transP->transid[0] = transid1; + transP->transid[1] = transid2; + +SCAN_TAB_error_no_state_change: + ScanTabRef * ref = (ScanTabRef*)&signal->theData[0]; ref->apiConnectPtr = transP->ndbapiConnect; ref->transId1 = transid1; From 927eef9ea196d7962f6c6ff0bdc750910d0f75b0 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 11 Jan 2005 14:49:35 +0100 Subject: [PATCH 0703/1063] Backup.cpp: bug#7660 ndb/src/kernel/blocks/backup/Backup.cpp: bug#7660 --- ndb/src/kernel/blocks/backup/Backup.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ndb/src/kernel/blocks/backup/Backup.cpp b/ndb/src/kernel/blocks/backup/Backup.cpp index 07aeb771c97..d72efdd0a52 100644 --- a/ndb/src/kernel/blocks/backup/Backup.cpp +++ b/ndb/src/kernel/blocks/backup/Backup.cpp @@ -992,7 +992,11 @@ Backup::execUTIL_SEQUENCE_CONF(Signal* signal) }//if ndbrequire(ptr.p->masterData.state.getState() == DEFINING); - ptr.p->backupId = conf->sequenceValue[0]; + { + Uint64 backupId; + memcpy(&backupId,conf->sequenceValue,8); + ptr.p->backupId= (Uint32)backupId; + } ptr.p->backupKey[0] = (getOwnNodeId() << 16) | (ptr.p->backupId & 0xFFFF); ptr.p->backupKey[1] = NdbTick_CurrentMillisecond(); From 5e6debe6b13cf09315b60281c4f665fa5c6c6971 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 11 Jan 2005 14:54:58 +0100 Subject: [PATCH 0704/1063] Suma.cpp: same as prev fix, wrong read of 64 bit value ndb/src/kernel/blocks/suma/Suma.cpp: same as prev fix, wrong read of 64 bit value --- ndb/src/kernel/blocks/suma/Suma.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ndb/src/kernel/blocks/suma/Suma.cpp b/ndb/src/kernel/blocks/suma/Suma.cpp index 88e6dea35ac..44ac054dd67 100644 --- a/ndb/src/kernel/blocks/suma/Suma.cpp +++ b/ndb/src/kernel/blocks/suma/Suma.cpp @@ -824,7 +824,8 @@ Suma::execUTIL_SEQUENCE_CONF(Signal* signal) return; } - Uint32 subId = conf->sequenceValue[0]; + Uint64 subId; + memcpy(&subId,conf->sequenceValue,8); Uint32 subData = conf->senderData; SubscriberPtr subbPtr; @@ -832,8 +833,8 @@ Suma::execUTIL_SEQUENCE_CONF(Signal* signal) CreateSubscriptionIdConf * subconf = (CreateSubscriptionIdConf*)conf; - subconf->subscriptionId = subId; - subconf->subscriptionKey =(getOwnNodeId() << 16) | (subId & 0xFFFF); + subconf->subscriptionId = (Uint32)subId; + subconf->subscriptionKey =(getOwnNodeId() << 16) | (Uint32)(subId & 0xFFFF); subconf->subscriberData = subbPtr.p->m_senderData; sendSignal(subbPtr.p->m_subscriberRef, GSN_CREATE_SUBID_CONF, signal, From c9079c1340b6d54be5e3e4323c71d54e264ba588 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 11 Jan 2005 15:38:03 +0100 Subject: [PATCH 0705/1063] - Housekeeping: removed a few unreferenced variables, noticed while doing Windows builds sql/sql_base.cc: - removed an unreferenced variable sql/strfunc.cc: - removed an unreferenced variable --- sql/sql_base.cc | 1 - sql/strfunc.cc | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 5c71049e565..2f2d9b290ac 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -2305,7 +2305,6 @@ int setup_wild(THD *thd, TABLE_LIST *tables, List &fields, List *sum_func_list, uint wild_num) { - bool is_stmt_prepare; DBUG_ENTER("setup_wild"); if (!wild_num) DBUG_RETURN(0); diff --git a/sql/strfunc.cc b/sql/strfunc.cc index 3ad6b1155d1..81aca092cec 100644 --- a/sql/strfunc.cc +++ b/sql/strfunc.cc @@ -147,7 +147,7 @@ uint find_type(TYPELIB *lib, const char *find, uint length, bool part_match) uint find_type2(TYPELIB *typelib, const char *x, uint length, CHARSET_INFO *cs) { - int find,pos,findpos; + int find,pos; const char *j; DBUG_ENTER("find_type2"); DBUG_PRINT("enter",("x: '%s' lib: 0x%lx",x,typelib)); @@ -157,7 +157,7 @@ uint find_type2(TYPELIB *typelib, const char *x, uint length, CHARSET_INFO *cs) DBUG_PRINT("exit",("no count")); DBUG_RETURN(0); } - LINT_INIT(findpos); + for (find=0, pos=0 ; (j=typelib->type_names[pos]) ; pos++) { if (!my_strnncoll(cs, (const uchar*) x, length, From 962512ad1b9c250bf87726a3d54c4705695cf7e1 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 11 Jan 2005 15:41:42 +0100 Subject: [PATCH 0706/1063] - Create the mysqld binaries with the correct file names during the build instead of renaming them in the packaging stage with Do-win-build later: mysqld-opt.exe -> mysqld.exe, mysqld.exe -> mysqld-debug.exe --- VC++Files/sql/mysqld.dsp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/VC++Files/sql/mysqld.dsp b/VC++Files/sql/mysqld.dsp index 9c642c08808..3508e6b31d0 100644 --- a/VC++Files/sql/mysqld.dsp +++ b/VC++Files/sql/mysqld.dsp @@ -58,7 +58,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_release\vio.lib ..\lib_release\isam.lib ..\lib_release\merge.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib /nologo /subsystem:console /pdb:none /machine:I386 /out:"../client_release/mysqld-opt.exe" +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_release\vio.lib ..\lib_release\isam.lib ..\lib_release\merge.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib /nologo /subsystem:console /pdb:none /machine:I386 /out:"../client_release/mysqld.exe" # SUBTRACT LINK32 /debug !ELSEIF "$(CFG)" == "mysqld - Win32 Debug" @@ -84,7 +84,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=xilink6.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_debug\dbug.lib ..\lib_debug\vio.lib ..\lib_debug\isam.lib ..\lib_debug\merge.lib ..\lib_debug\mysys.lib ..\lib_debug\strings.lib ..\lib_debug\regex.lib ..\lib_debug\heap.lib ..\lib_debug\bdb.lib ..\lib_debug\innodb.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../client_debug/mysqld.exe" /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_debug\dbug.lib ..\lib_debug\vio.lib ..\lib_debug\isam.lib ..\lib_debug\merge.lib ..\lib_debug\mysys.lib ..\lib_debug\strings.lib ..\lib_debug\regex.lib ..\lib_debug\heap.lib ..\lib_debug\bdb.lib ..\lib_debug\innodb.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../client_debug/mysqld-debug.exe" /pdbtype:sept !ELSEIF "$(CFG)" == "mysqld - Win32 nt" From a31c35022dcf780b9790e9fa7f935faa5b8501c5 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 11 Jan 2005 16:00:11 +0100 Subject: [PATCH 0707/1063] bug fixed parsing with comments on same line --- mysql-test/ndb/ndb_config_2_node.ini | 6 +++--- ndb/src/mgmsrv/InitConfigFileParser.cpp | 12 ++++++++++-- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/mysql-test/ndb/ndb_config_2_node.ini b/mysql-test/ndb/ndb_config_2_node.ini index 8c89d2aa2cc..c831a5c7ffa 100644 --- a/mysql-test/ndb/ndb_config_2_node.ini +++ b/mysql-test/ndb/ndb_config_2_node.ini @@ -9,13 +9,13 @@ DataDir= CHOOSE_FILESYSTEM MaxNoOfOrderedIndexes= CHOOSE_MaxNoOfOrderedIndexes [ndbd] -HostName= CHOOSE_HOSTNAME_1 +HostName= CHOOSE_HOSTNAME_1 # hostname is a valid network adress [ndbd] -HostName= CHOOSE_HOSTNAME_2 +HostName= CHOOSE_HOSTNAME_2 # hostname is a valid network adress [ndb_mgmd] -DataDir= CHOOSE_FILESYSTEM +DataDir= CHOOSE_FILESYSTEM # PortNumber= CHOOSE_PORT_MGM [mysqld] diff --git a/ndb/src/mgmsrv/InitConfigFileParser.cpp b/ndb/src/mgmsrv/InitConfigFileParser.cpp index 5cc5c3e9b32..822e10c89aa 100644 --- a/ndb/src/mgmsrv/InitConfigFileParser.cpp +++ b/ndb/src/mgmsrv/InitConfigFileParser.cpp @@ -228,13 +228,21 @@ bool InitConfigFileParser::parseNameValuePair(Context& ctx, const char* line) Vector tmp_string_split; if (BaseString(line).split(tmp_string_split, - BaseString("=:"), - 2) != 2) + "=:", 2) != 2) { ctx.reportError("Parse error"); return false; } + // ************************************* + // Remove all after # + // ************************************* + + Vector tmp_string_split2; + tmp_string_split[1].split(tmp_string_split2, + "#", 2); + tmp_string_split[1]=tmp_string_split2[0]; + // ************************************* // Remove leading and trailing chars // ************************************* From 62113c1011ac70b1cb9ad09b475e6e13074bf919 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 11 Jan 2005 18:02:44 +0300 Subject: [PATCH 0708/1063] A fix for Bug#7365 "embedded server for MacOS: problem with prepared statements": no test case, the test case is there already, libmysqld/examples/client_test.c, we just need to run it on a daily basis. libmysqld/lib_sql.cc: Convert statement id to least significant byte first format, uset for data transmission in MySQL protocol. It's assumed to be in this format by mysql_stmt_execute. --- libmysqld/lib_sql.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc index 26d97fa03c8..15fe3a03390 100644 --- a/libmysqld/lib_sql.cc +++ b/libmysqld/lib_sql.cc @@ -219,12 +219,13 @@ static my_bool emb_mysql_read_query_result(MYSQL *mysql) static int emb_stmt_execute(MYSQL_STMT *stmt) { DBUG_ENTER("emb_stmt_execute"); + char header[4]; + int4store(header, stmt->stmt_id); THD *thd= (THD*)stmt->mysql->thd; thd->client_param_count= stmt->param_count; thd->client_params= stmt->params; if (emb_advanced_command(stmt->mysql, COM_EXECUTE,0,0, - (const char*)&stmt->stmt_id,sizeof(stmt->stmt_id), - 1) || + header, sizeof(header), 1) || emb_mysql_read_query_result(stmt->mysql)) { NET *net= &stmt->mysql->net; From 7bb97a4ad8aee442d657de23093d1c9f4a2013d5 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 11 Jan 2005 19:58:53 +0400 Subject: [PATCH 0709/1063] Bug #7730 Server crash using soundex on an utf8 table Don't use my_tolower: it works only for 8bit charsets. --- mysql-test/r/ctype_utf8.result | 12 ++++++++++++ mysql-test/t/ctype_utf8.test | 9 +++++++++ sql/item_strfunc.cc | 15 ++++++++++----- 3 files changed, 31 insertions(+), 5 deletions(-) diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result index 599d49208e7..ebaa329891c 100644 --- a/mysql-test/r/ctype_utf8.result +++ b/mysql-test/r/ctype_utf8.result @@ -817,3 +817,15 @@ drop table t1; select 'c' like '\_' as want0; want0 0 +create table t1 (id integer, a varchar(100) character set utf8 collate utf8_unicode_ci); +insert into t1 values (1, 'Test'); +select * from t1 where soundex(a) = soundex('Test'); +id a +1 Test +select * from t1 where soundex(a) = soundex('TEST'); +id a +1 Test +select * from t1 where soundex(a) = soundex('test'); +id a +1 Test +drop table t1; diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test index 42031be8f3c..214c2712665 100644 --- a/mysql-test/t/ctype_utf8.test +++ b/mysql-test/t/ctype_utf8.test @@ -666,3 +666,12 @@ drop table t1; # select 'c' like '\_' as want0; +# +# Bug #7730 Server crash using soundex on an utf8 table +# +create table t1 (id integer, a varchar(100) character set utf8 collate utf8_unicode_ci); +insert into t1 values (1, 'Test'); +select * from t1 where soundex(a) = soundex('Test'); +select * from t1 where soundex(a) = soundex('TEST'); +select * from t1 where soundex(a) = soundex('test'); +drop table t1; diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 2a63c5355a4..d0190af042e 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -1562,9 +1562,14 @@ void Item_func_soundex::fix_length_and_dec() else return 0 */ -static char get_scode(CHARSET_INFO *cs,char *ptr) +static char soundex_toupper(char ch) { - uchar ch=my_toupper(cs,*ptr); + return (ch >= 'a' && ch <= 'z') ? ch - 'a' + 'A' : ch; +} + +static char get_scode(char *ptr) +{ + uchar ch= soundex_toupper(*ptr); if (ch < 'A' || ch > 'Z') { // Thread extended alfa (country spec) @@ -1594,8 +1599,8 @@ String *Item_func_soundex::val_str(String *str) from++; /* purecov: inspected */ if (from == end) return &my_empty_string; // No alpha characters. - *to++ = my_toupper(cs,*from); // Copy first letter - last_ch = get_scode(cs,from); // code of the first letter + *to++ = soundex_toupper(*from); // Copy first letter + last_ch = get_scode(from); // code of the first letter // for the first 'double-letter check. // Loop on input letters until // end of input (null) or output @@ -1604,7 +1609,7 @@ String *Item_func_soundex::val_str(String *str) { if (!my_isalpha(cs,*from)) continue; - ch=get_scode(cs,from); + ch=get_scode(from); if ((ch != '0') && (ch != last_ch)) // if not skipped or double { *to++ = ch; // letter, copy to output From 4eec8ab1f6547cf4b7fb4877928dfd6abd11a159 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 11 Jan 2005 18:55:53 +0200 Subject: [PATCH 0710/1063] Review of new pushed code Indentation cleanup client/mysqladmin.cc: Indentation cleanup --- client/mysqladmin.cc | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/client/mysqladmin.cc b/client/mysqladmin.cc index 24cd461b1fa..d390a152fc7 100644 --- a/client/mysqladmin.cc +++ b/client/mysqladmin.cc @@ -832,7 +832,8 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv) if (argv[1][0]) { char *pw= argv[1]; - bool old= find_type(argv[0], &command_typelib, 2) == ADMIN_OLD_PASSWORD; + bool old= (find_type(argv[0], &command_typelib, 2) == + ADMIN_OLD_PASSWORD); #ifdef __WIN__ uint pw_len= strlen(pw); if (pw_len > 1 && pw[0] == '\'' && pw[pw_len-1] == '\'') @@ -843,21 +844,29 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv) If we don't already know to use an old-style password, see what the server is using */ - if (!old) { - if (mysql_query(mysql, "SHOW VARIABLES LIKE 'old_passwords'")) { + if (!old) + { + if (mysql_query(mysql, "SHOW VARIABLES LIKE 'old_passwords'")) + { my_printf_error(0, "Could not determine old_passwords setting from server; error: '%s'", MYF(ME_BELL),mysql_error(mysql)); return -1; - } else { + } + else + { MYSQL_RES *res= mysql_store_result(mysql); - if (!res) { - my_printf_error(0, "Could not get old_passwords setting from server; error: '%s'", + if (!res) + { + my_printf_error(0, + "Could not get old_passwords setting from " + "server; error: '%s'", MYF(ME_BELL),mysql_error(mysql)); return -1; } - if (!mysql_num_rows(res)) { + if (!mysql_num_rows(res)) old= 1; - } else { + else + { MYSQL_ROW row= mysql_fetch_row(res); old= !strncmp(row[1], "ON", 2); } From 22de48855756432c954069d79e17940fae32b8e6 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 11 Jan 2005 19:40:33 +0200 Subject: [PATCH 0711/1063] Fixed Bug#2813, "analyse does not quot string values in enams from string". --- mysql-test/r/analyse.result | 6 ++++ mysql-test/t/analyse.test | 4 +++ sql/sql_analyse.cc | 59 ++++++++++++++++++++++++++++++++++++- 3 files changed, 68 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/analyse.result b/mysql-test/r/analyse.result index b51afab5b54..8013bc516bb 100644 --- a/mysql-test/r/analyse.result +++ b/mysql-test/r/analyse.result @@ -96,3 +96,9 @@ select * from t2; Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype test.t1.a 1 2 1 1 0 0 1.5000 0.5000 ENUM('1','2') NOT NULL drop table t1,t2; +create table t1 (v varchar(128)); +insert into t1 values ('abc'),('abc\'def\\hij\"klm\0opq'),('\''),('\"'),('\\'),('a\0'),('b\''),('c\"'),('d\\'),('\'b'),('\"c'),('\\d'),('a\0\0\0b'),('a\'\'\'\'b'),('a\"\"\"\"b'),('a\\\\\\\\b'),('\'\0\\\"'),('\'\''),('\"\"'),('\\\\'),('The\ZEnd'); +select * from t1 procedure analyse(); +Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype +test.t1.v " \\ 1 19 0 0 3.7619 NULL ENUM('"','""','"c','\'\0\\"','\'','\'\'','\'b','a\0\0\0b','a\0','a""""b','a\'\'\'\'b','abc','abc\'def\\hij"klm\0opq','a\\\\\\\\b','b\'','c"','d\\','The\ZEnd','\\','\\d','\\\\') NOT NULL +drop table t1; diff --git a/mysql-test/t/analyse.test b/mysql-test/t/analyse.test index 47f3473584b..34343c2b7bf 100644 --- a/mysql-test/t/analyse.test +++ b/mysql-test/t/analyse.test @@ -38,3 +38,7 @@ select * from t2; insert into t2 select * from t1 procedure analyse(); select * from t2; drop table t1,t2; +create table t1 (v varchar(128)); +insert into t1 values ('abc'),('abc\'def\\hij\"klm\0opq'),('\''),('\"'),('\\'),('a\0'),('b\''),('c\"'),('d\\'),('\'b'),('\"c'),('\\d'),('a\0\0\0b'),('a\'\'\'\'b'),('a\"\"\"\"b'),('a\\\\\\\\b'),('\'\0\\\"'),('\'\''),('\"\"'),('\\\\'),('The\ZEnd'); +select * from t1 procedure analyse(); +drop table t1; diff --git a/sql/sql_analyse.cc b/sql/sql_analyse.cc index 1e0aebbc1ec..5265857f3b1 100644 --- a/sql/sql_analyse.cc +++ b/sql/sql_analyse.cc @@ -59,6 +59,7 @@ int compare_ulonglong2(void* cmp_arg __attribute__((unused)), return compare_ulonglong(s,t); } +static bool append_escaped(String *to_str, String *from_str); Procedure * proc_analyse_init(THD *thd, ORDER *param, select_result *result, @@ -890,7 +891,8 @@ int collect_string(String *element, else info->found = 1; info->str->append('\''); - info->str->append(*element); + if (append_escaped(info->str, element)) + return 1; info->str->append('\''); return 0; } // collect_string @@ -1025,3 +1027,58 @@ uint check_ulonglong(const char *str, uint length) while (*cmp && *cmp++ == *str++) ; return ((uchar) str[-1] <= (uchar) cmp[-1]) ? smaller : bigger; } /* check_ulonlong */ + + + +/* + FUNCTION: append_escaped() + + DESCRIPTION + append_escaped() takes a String type variable, where it appends + escaped the second argument. Only characters that require escaping + will be escaped. + + ARGUMENTS + A pointer to a String variable, where results will be appended + A pointer to a String variable, which is appended to the result + String, escaping those characters that require it. + + RETURN VALUES + 0 Success + 1 Out of memory +*/ + +static bool append_escaped(String *to_str, String *from_str) +{ + char *from, *end, c; + + if (to_str->realloc(to_str->length() + from_str->length())) + return 1; + + from= (char*) from_str->ptr(); + end= from + from_str->length(); + for (; from < end; from++) + { + c= *from; + switch (c) { + case '\0': + c= '0'; + break; + case '\032': + c= 'Z'; + break; + case '\\': + case '\'': + break; + default: + goto normal_character; + } + if (to_str->append('\\')) + return 1; + + normal_character: + if (to_str->append(c)) + return 1; + } + return 0; +} From f214faa8adcb49ba2bd2bc4055d303e5e88404d3 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 11 Jan 2005 21:50:30 +0100 Subject: [PATCH 0712/1063] Replace ZLIB_LIBS in mysql_config. (Bug #6418) scripts/Makefile.am: Replace ZLIB_LIBS --- scripts/Makefile.am | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 4158b5a34dc..71b70fc0e4a 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -121,6 +121,7 @@ SUFFIXES = .sh -e 's!@''CXXFLAGS''@!@SAVE_CXXFLAGS@!'\ -e 's!@''LDFLAGS''@!@SAVE_LDFLAGS@!'\ -e 's!@''CLIENT_LIBS''@!@CLIENT_LIBS@!' \ + -e 's!@''ZLIB_LIBS''@!@ZLIB_LIBS@!' \ -e 's!@''LIBS''@!@LIBS@!' \ -e 's!@''WRAPLIBS''@!@WRAPLIBS@!' \ -e 's!@''innodb_system_libs''@!@innodb_system_libs@!' \ From d5a3f4a6e3782499f016dd1ca546af5585031b4a Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 11 Jan 2005 23:09:10 +0100 Subject: [PATCH 0713/1063] ndbcluster.sh: increased timeouts to see if more tests get started automatically mysql-test/ndb/ndbcluster.sh: increased timeouts to see if more tests get started automatically --- mysql-test/ndb/ndbcluster.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mysql-test/ndb/ndbcluster.sh b/mysql-test/ndb/ndbcluster.sh index 848223a091c..2d529f8fe0f 100644 --- a/mysql-test/ndb/ndbcluster.sh +++ b/mysql-test/ndb/ndbcluster.sh @@ -191,7 +191,7 @@ if ( cd "$fs_ndb" ; $exec_mgmtsrvr -f config.ini ) ; then :; else echo "Unable to start $exec_mgmtsrvr from `pwd`" exit 1 fi -if sleep_until_file_created $fs_ndb/ndb_3.pid 30 +if sleep_until_file_created $fs_ndb/ndb_3.pid 120 then :; else exit 1 fi @@ -201,7 +201,7 @@ cat `find "$fs_ndb" -name 'ndb_*.pid'` > "$fs_ndb/$pidfile" echo "Starting ndbd" ( cd "$fs_ndb" ; $exec_ndb $flags_ndb & ) -if sleep_until_file_created $fs_ndb/ndb_1.pid 30 +if sleep_until_file_created $fs_ndb/ndb_1.pid 120 then :; else stop_default_ndbcluster exit 1 @@ -212,7 +212,7 @@ cat `find "$fs_ndb" -name 'ndb_*.pid'` > "$fs_ndb/$pidfile" echo "Starting ndbd" ( cd "$fs_ndb" ; $exec_ndb $flags_ndb & ) -if sleep_until_file_created $fs_ndb/ndb_2.pid 30 +if sleep_until_file_created $fs_ndb/ndb_2.pid 120 then :; else stop_default_ndbcluster exit 1 From ca8fcc0026aa4dfcbb7b03f549bc02eb1abfdadd Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 12 Jan 2005 10:36:50 +0200 Subject: [PATCH 0714/1063] Take a shared record lock (LOCK_REC_NOT_GAP) for a matching record in the foreign key check because we can allow inserts into gaps (Support Issue #4317). innobase/row/row0ins.c: Take a shared record lock (LOCK_REC_NOT_GAP) for a matching record in the foreign key check because we can allow inserts into gaps. --- innobase/row/row0ins.c | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/innobase/row/row0ins.c b/innobase/row/row0ins.c index f8a98f74c09..15ffabf70cc 100644 --- a/innobase/row/row0ins.c +++ b/innobase/row/row0ins.c @@ -1105,7 +1105,6 @@ row_ins_check_foreign_constraint( dict_table_t* check_table; dict_index_t* check_index; ulint n_fields_cmp; - ibool unique_search; rec_t* rec; btr_pcur_t pcur; ibool moved; @@ -1223,14 +1222,6 @@ run_again: dtuple_set_n_fields_cmp(entry, foreign->n_fields); - if (dict_index_get_n_unique(check_index) <= foreign->n_fields) { - /* We can just set a LOCK_REC_NOT_GAP type lock */ - - unique_search = TRUE; - } else { - unique_search = FALSE; - } - btr_pcur_open(check_index, entry, PAGE_CUR_GE, BTR_SEARCH_LEAF, &pcur, &mtr); @@ -1268,17 +1259,13 @@ run_again: break; } } else { - /* Found a matching record */ + /* Found a matching record. Lock only + a record because we can allow inserts + into gaps */ - if (unique_search) { - err = row_ins_set_shared_rec_lock( - LOCK_REC_NOT_GAP, - rec, check_index, thr); - } else { - err = row_ins_set_shared_rec_lock( - LOCK_ORDINARY, - rec, check_index, thr); - } + err = row_ins_set_shared_rec_lock( + LOCK_REC_NOT_GAP, + rec, check_index, thr); if (err != DB_SUCCESS) { From d853e732b9f598671283064fef6d11ea9db1d8ca Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 12 Jan 2005 12:18:36 +0300 Subject: [PATCH 0715/1063] Fix for bug #7586 "TIMEDIFF for sec+microsec not working properly". mysql-test/r/func_sapdb.result: Added test for bug #7586 "TIMEDIFF for sec+microsec not working properly". Corrected previously wrong results of couple other statements. mysql-test/t/func_sapdb.test: Added test for bug #7586 "TIMEDIFF for sec+microsec not working properly". sql/item_timefunc.cc: Item_func_timediff::val_str(): Use simplier and less error-prone implementation. Now we are counting difference between time values in microseconds and convert it to time value (instead of using seconds and taking difference in "second_part"s into account). --- mysql-test/r/func_sapdb.result | 7 +++++-- mysql-test/t/func_sapdb.test | 1 + sql/item_timefunc.cc | 30 ++++++++++-------------------- 3 files changed, 16 insertions(+), 22 deletions(-) diff --git a/mysql-test/r/func_sapdb.result b/mysql-test/r/func_sapdb.result index cf2bd687115..c74d6fc5a4e 100644 --- a/mysql-test/r/func_sapdb.result +++ b/mysql-test/r/func_sapdb.result @@ -97,13 +97,16 @@ timediff("1997-12-31 23:59:59.000001","1997-12-30 01:01:01.000002") 46:58:57.999999 select timediff("1997-12-30 23:59:59.000001","1997-12-31 23:59:59.000002"); timediff("1997-12-30 23:59:59.000001","1997-12-31 23:59:59.000002") --23:59:59.999999 +-24:00:00.000001 select timediff("1997-12-31 23:59:59.000001","23:59:59.000001"); timediff("1997-12-31 23:59:59.000001","23:59:59.000001") NULL select timediff("2000:01:01 00:00:00", "2000:01:01 00:00:00.000001"); timediff("2000:01:01 00:00:00", "2000:01:01 00:00:00.000001") -00:00:00.000001 +select timediff("2005-01-11 15:48:49.999999", "2005-01-11 15:48:50"); +timediff("2005-01-11 15:48:49.999999", "2005-01-11 15:48:50") +-00:00:00.000001 select maketime(10,11,12); maketime(10,11,12) 10:11:12 @@ -175,7 +178,7 @@ f8 date YES NULL f9 time YES NULL select * from t1; f1 f2 f3 f4 f5 f6 f7 f8 f9 -1997-01-01 1998-01-02 01:01:00 49:01:01 46:58:57 -23:59:59 10:11:12 2001-12-01 01:01:01 1997-12-31 23:59:59 +1997-01-01 1998-01-02 01:01:00 49:01:01 46:58:57 -24:00:00 10:11:12 2001-12-01 01:01:01 1997-12-31 23:59:59 create table test(t1 datetime, t2 time, t3 time, t4 datetime); insert into test values ('2001-01-01 01:01:01', '01:01:01', null, '2001-02-01 01:01:01'), diff --git a/mysql-test/t/func_sapdb.test b/mysql-test/t/func_sapdb.test index 2ae3c438243..de433485fca 100644 --- a/mysql-test/t/func_sapdb.test +++ b/mysql-test/t/func_sapdb.test @@ -54,6 +54,7 @@ select timediff("1997-12-31 23:59:59.000001","1997-12-30 01:01:01.000002"); select timediff("1997-12-30 23:59:59.000001","1997-12-31 23:59:59.000002"); select timediff("1997-12-31 23:59:59.000001","23:59:59.000001"); select timediff("2000:01:01 00:00:00", "2000:01:01 00:00:00.000001"); +select timediff("2005-01-11 15:48:49.999999", "2005-01-11 15:48:50"); --enable_ps_protocol select maketime(10,11,12); diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index 0d652a431cb..f9c9d1f013d 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -2432,8 +2432,7 @@ void Item_func_add_time::print(String *str) String *Item_func_timediff::val_str(String *str) { DBUG_ASSERT(fixed == 1); - longlong seconds; - long microseconds; + longlong microseconds; long days; int l_sign= 1; TIME l_time1 ,l_time2, l_time3; @@ -2457,32 +2456,23 @@ String *Item_func_timediff::val_str(String *str) (uint) l_time2.month, (uint) l_time2.day)); - microseconds= l_time1.second_part - l_sign*l_time2.second_part; - seconds= ((longlong) days*86400L + l_time1.hour*3600L + - l_time1.minute*60L + l_time1.second + microseconds/1000000L - - (longlong)l_sign*(l_time2.hour*3600L+l_time2.minute*60L+ - l_time2.second)); + microseconds= ((longlong)days*86400L + + l_time1.hour*3600L + l_time1.minute*60L + l_time1.second - + (longlong)l_sign*(l_time2.hour*3600L + l_time2.minute*60L + + l_time2.second))*1000000 + + l_time1.second_part - l_sign*l_time2.second_part; l_time3.neg= 0; - if (seconds < 0) - { - seconds= -seconds; - l_time3.neg= 1; - } - else if (seconds == 0 && microseconds < 0) + if (microseconds < 0) { microseconds= -microseconds; l_time3.neg= 1; } - if (microseconds < 0) - { - microseconds+= 1000000L; - seconds--; - } - if ((l_time2.neg == l_time1.neg) && l_time1.neg) + if ((l_time2.neg == l_time1.neg) && l_time1.neg && microseconds) l_time3.neg= l_time3.neg ? 0 : 1; - calc_time_from_sec(&l_time3, (long) seconds, microseconds); + calc_time_from_sec(&l_time3, (long)(microseconds/1000000), + (long)(microseconds%1000000)); if (!make_datetime(l_time1.second_part || l_time2.second_part ? TIME_MICROSECOND : TIME_ONLY, From 7e36a0b7cbad8ff88ada96913b1b89f202cc3efb Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 12 Jan 2005 11:17:03 +0100 Subject: [PATCH 0716/1063] ndb - fix 64-bit problem in autotest ndb/test/src/CpcClient.cpp: Fix 64-bit problem --- ndb/test/src/CpcClient.cpp | 42 ++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/ndb/test/src/CpcClient.cpp b/ndb/test/src/CpcClient.cpp index 2ef23528360..1d1b4fcb977 100644 --- a/ndb/test/src/CpcClient.cpp +++ b/ndb/test/src/CpcClient.cpp @@ -30,7 +30,7 @@ 0, 0, \ 0, \ (desc), \ - (void *)(value) } + (value) } #define CPC_ARG(name, type, opt, desc) \ { (name), \ @@ -351,17 +351,12 @@ SimpleCpcClient::define_process(Process & p, Properties& reply){ int SimpleCpcClient::list_processes(Vector &procs, Properties& reply) { - enum Proclist { - Proclist_Start, - Proclist_End, - Proclist_Entry - }; + int start, end, entry; const ParserRow_t list_reply[] = { - CPC_CMD("start processes", Proclist_Start, ""), + CPC_CMD("start processes", &start, ""), + CPC_CMD("end processes", &end, ""), - CPC_CMD("end processes", Proclist_End, ""), - - CPC_CMD("process", Proclist_Entry, ""), + CPC_CMD("process", &entry, ""), CPC_ARG("id", Int, Mandatory, "Id of process."), CPC_ARG("name", String, Mandatory, "Name of process"), CPC_ARG("group", String, Mandatory, "Group of process"), @@ -390,26 +385,29 @@ SimpleCpcClient::list_processes(Vector &procs, Properties& reply) { bool done = false; while(!done) { const Properties *proc; - enum Proclist p; - cpc_recv(list_reply, &proc, (void **)&p); + void *p; + cpc_recv(list_reply, &proc, &p); - switch(p) { - case Proclist_Start: + if(p == &start) + { /* do nothing */ - break; - case Proclist_End: + } + else if(p == &end) + { done = true; - break; - case Proclist_Entry: + } + else if(p == &entry) + { if(proc != NULL){ Process p; convert(* proc, p); procs.push_back(p); } - break; - default: - /* ignore */ - break; + } + else + { + ndbout_c("internal error: %d", __LINE__); + return -1; } } return 0; From 0bcfc49b4bda7e9137f752ecb641db70b43e0273 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 12 Jan 2005 12:18:17 +0100 Subject: [PATCH 0717/1063] added missing Com_update_multi status variable --- sql/mysqld.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 768acd77c27..93b34464d5c 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -4496,6 +4496,7 @@ struct show_var_st status_vars[]= { {"Com_truncate", (char*) (com_stat+(uint) SQLCOM_TRUNCATE),SHOW_LONG}, {"Com_unlock_tables", (char*) (com_stat+(uint) SQLCOM_UNLOCK_TABLES),SHOW_LONG}, {"Com_update", (char*) (com_stat+(uint) SQLCOM_UPDATE),SHOW_LONG}, + {"Com_update_multi", (char*) (com_stat+(uint) SQLCOM_MULTI_UPDATE),SHOW_LONG}, {"Connections", (char*) &thread_id, SHOW_LONG_CONST}, {"Created_tmp_disk_tables", (char*) &created_tmp_disk_tables,SHOW_LONG}, {"Created_tmp_tables", (char*) &created_tmp_tables, SHOW_LONG}, From d862f846439ba582b704298f0f439abf36b88832 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 12 Jan 2005 13:06:06 +0100 Subject: [PATCH 0718/1063] - Modified Do-compile to run the test suite with ps-protocol and against the embedded server by default (if included). These additional steps can be skipped by providing "--skip-embedded-test" and "--skip-ps-test" Build-tools/Do-compile: - enabled running the test suite with ps-protocol and against the embedded server by default (if included). These additional steps can be skipped by providing "--skip-embedded-test" and "--skip-ps-test" --- Build-tools/Do-compile | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/Build-tools/Do-compile b/Build-tools/Do-compile index 78dcd634f7c..1e7041e8f7a 100755 --- a/Build-tools/Do-compile +++ b/Build-tools/Do-compile @@ -11,7 +11,7 @@ $opt_distribution=$opt_user=$opt_config_env=$opt_config_extra_env=""; $opt_dbd_options=$opt_perl_options=$opt_config_options=$opt_make_options=$opt_suffix=""; $opt_tmp=$opt_version_suffix=""; $opt_bundled_zlib=$opt_help=$opt_delete=$opt_debug=$opt_stage=$opt_no_test=$opt_no_perl=$opt_one_error=$opt_with_low_memory=$opt_fast_benchmark=$opt_static_client=$opt_static_server=$opt_static_perl=$opt_sur=$opt_with_small_disk=$opt_local_perl=$opt_tcpip=$opt_build_thread=$opt_use_old_distribution=$opt_enable_shared=$opt_no_crash_me=$opt_no_strip=$opt_with_archive=$opt_with_cluster=$opt_with_csv=$opt_with_example=$opt_with_debug=$opt_no_benchmark=$opt_no_mysqltest=$opt_without_embedded=$opt_readline=0; -$opt_embedded_test=$opt_ps_test=$opt_innodb=$opt_bdb=$opt_raid=$opt_libwrap=$opt_clearlogs=0; +$opt_skip_embedded_test=$opt_skip_ps_test=$opt_innodb=$opt_bdb=$opt_raid=$opt_libwrap=$opt_clearlogs=0; GetOptions( "bdb", @@ -25,7 +25,6 @@ GetOptions( "delete", "distribution=s", "enable-shared", - "embedded-test", "fast-benchmark", "help|Information", "innodb", @@ -41,9 +40,10 @@ GetOptions( "one-error", "perl-files=s", "perl-options=s", - "ps-test", "raid", "readline", + "skip-embedded-test", + "skip-ps-test", "stage=i", "static-client", "static-perl", @@ -57,8 +57,8 @@ GetOptions( "version-suffix=s", "with-archive", "with-cluster", - "with-csv", - "with-example", + "with-csv", + "with-example", "with-debug", "with-low-memory", "with-other-libc=s", @@ -278,7 +278,7 @@ if ($opt_stage <= 1) $opt_config_options.= " --with-libedit"; } $opt_config_options.= " --with-embedded-server" unless ($opt_without_embedded); - $opt_embedded_test= 0 if ($opt_without_embedded); + $opt_skip_embedded_test= 1 if ($opt_without_embedded); $opt_config_options.= " --with-archive-storage-engine" if ($opt_with_archive); $opt_config_options.= " --with-ndbcluster" if ($opt_with_cluster); $opt_config_options.= " --with-csv-storage-engine" if ($opt_with_csv); @@ -391,14 +391,14 @@ if ($opt_stage <= 5 && !$opt_no_test && !$opt_no_mysqltest) safe_cd("${test_dir}/mysql-test"); check_system("./mysql-test-run $flags --tmpdir=$bench_tmpdir --master_port=$mysql_tcp_port --slave_port=$slave_port --ndbcluster_port=$ndbcluster_port --manager-port=$manager_port --no-manager --sleep=10", "tests were successful"); - if ($opt_ps_test) + unless ($opt_skip_ps_test) { log_timestamp(); info("Running test suite using prepared statements"); check_system("./mysql-test-run $flags --ps-protocol --tmpdir=$bench_tmpdir --master_port=$mysql_tcp_port --slave_port=$slave_port --ndbcluster_port=$ndbcluster_port --manager-port=$manager_port --no-manager --sleep=10", "tests were successful"); } - if ($opt_embedded_test) + unless ($opt_skip_embedded_test) { log_timestamp(); info("Running embedded server test suite"); @@ -551,9 +551,6 @@ Delete the distribution file. --distribution= Name of the MySQL source distribution file. ---embedded-test -Run the test suite against the embedded server - --enable-shared Compile with shared libraries @@ -602,15 +599,18 @@ Compile and install the given perl modules. --perl-options= Build Perl modules with the additional options ---ps-test -Run an additional test run, using prepared statements - --raid Compile with RAID support --readline Compile against readline library instead of libedit +--skip-embedded-test +Skip running the test suite against the embedded server + +--skip-ps-test +Skip running the additional test run that uses the prepared statement protocol + --stage=[1-6] Start script from some specific point. From c65c72f01ada9fc168878ab1d7092c19b7d06b04 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 12 Jan 2005 15:24:49 +0200 Subject: [PATCH 0719/1063] InnoDB: Use system-supplied tmpfile() on Netware, as there is no open interface for setting the "delete-on-close" flag. innobase/os/os0file.c: Use system-supplied tmpfile() on Netware sql/ha_innodb.cc: Remove innobase_mysql_tmpfile() on Netware. --- innobase/os/os0file.c | 24 +++++++++++++++--------- sql/ha_innodb.cc | 2 ++ 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/innobase/os/os0file.c b/innobase/os/os0file.c index b8339134fb1..cadf1c0385f 100644 --- a/innobase/os/os0file.c +++ b/innobase/os/os0file.c @@ -375,7 +375,7 @@ os_io_init_simple(void) } } -#ifndef UNIV_HOTBACKUP +#if !defined(UNIV_HOTBACKUP) && !defined(__NETWARE__) /************************************************************************* Creates a temporary file. This function is defined in ha_innodb.cc. */ @@ -383,7 +383,7 @@ int innobase_mysql_tmpfile(void); /*========================*/ /* out: temporary file descriptor, or < 0 on error */ -#endif /* !UNIV_HOTBACKUP */ +#endif /* !UNIV_HOTBACKUP && !__NETWARE__ */ /*************************************************************************** Creates a temporary file. */ @@ -393,9 +393,12 @@ os_file_create_tmpfile(void) /*========================*/ /* out: temporary file handle, or NULL on error */ { +#ifdef __NETWARE__ + FILE* file = tmpfile(); +#else /* __NETWARE__ */ FILE* file = NULL; int fd = -1; -#ifdef UNIV_HOTBACKUP +# ifdef UNIV_HOTBACKUP int tries; for (tries = 10; tries--; ) { char* name = tempnam(fil_path_to_mysql_datadir, "ib"); @@ -404,15 +407,15 @@ os_file_create_tmpfile(void) } fd = open(name, -# ifdef __WIN__ +# ifdef __WIN__ O_SEQUENTIAL | O_SHORT_LIVED | O_TEMPORARY | -# endif /* __WIN__ */ +# endif /* __WIN__ */ O_CREAT | O_EXCL | O_RDWR, S_IREAD | S_IWRITE); if (fd >= 0) { -# ifndef __WIN__ +# ifndef __WIN__ unlink(name); -# endif /* !__WIN__ */ +# endif /* !__WIN__ */ free(name); break; } @@ -423,22 +426,25 @@ os_file_create_tmpfile(void) name); free(name); } -#else /* UNIV_HOTBACKUP */ +# else /* UNIV_HOTBACKUP */ fd = innobase_mysql_tmpfile(); -#endif /* UNIV_HOTBACKUP */ +# endif /* UNIV_HOTBACKUP */ if (fd >= 0) { file = fdopen(fd, "w+b"); } +#endif /* __NETWARE__ */ if (!file) { ut_print_timestamp(stderr); fprintf(stderr, " InnoDB: Error: unable to create temporary file;" " errno: %d\n", errno); +#ifndef __NETWARE__ if (fd >= 0) { close(fd); } +#endif /* !__NETWARE__ */ } return(file); diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index 69d9d885b8e..54d93783481 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -413,6 +413,7 @@ innobase_mysql_print_thd( putc('\n', f); } +#ifndef __NETWARE__ /************************************************************************* Creates a temporary file. */ extern "C" @@ -456,6 +457,7 @@ innobase_mysql_tmpfile(void) } return(fd2); } +#endif /* !__NETWARE__ */ /************************************************************************* Gets the InnoDB transaction handle for a MySQL handler object, creates From b692ca4fd5e8a455e408178ecb49d87a3a83f7f1 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 12 Jan 2005 17:04:45 +0300 Subject: [PATCH 0720/1063] A fix for Bug#6761 "mysql_list_fields() does not work": test case will be added to client_test in 4.1 sql/sql_parse.cc: A fix for bug #6761: "mysql_list_fields() does not work": init thd->query_length, which is used next line. Remove a stale comment. --- sql/sql_parse.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 6b3723d89c4..1aeb158dc11 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -1104,7 +1104,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd, thd->free_list=0; table_list.alias= table_list.real_name= thd->strdup(packet); packet=strend(packet)+1; - // command not cachable => no gap for data base name + thd->query_length= strlen(packet); // for simplicity: don't optimize if (!(thd->query=fields=thd->memdup(packet,thd->query_length+1))) break; mysql_log.write(thd,command,"%s %s",table_list.real_name,fields); From 55ad8626c46dfb6b05e6e476cf1dd2cf653e520c Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 12 Jan 2005 18:19:30 +0100 Subject: [PATCH 0721/1063] fix shm key --- ndb/src/mgmsrv/ConfigInfo.cpp | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/ndb/src/mgmsrv/ConfigInfo.cpp b/ndb/src/mgmsrv/ConfigInfo.cpp index 800ffe2e361..fa77bc14762 100644 --- a/ndb/src/mgmsrv/ConfigInfo.cpp +++ b/ndb/src/mgmsrv/ConfigInfo.cpp @@ -98,6 +98,7 @@ static bool fixDepricated(InitConfigFileParser::Context & ctx, const char *); static bool saveInConfigValues(InitConfigFileParser::Context & ctx, const char *); static bool fixFileSystemPath(InitConfigFileParser::Context & ctx, const char * data); static bool fixBackupDataDir(InitConfigFileParser::Context & ctx, const char * data); +static bool fixShmUniqueId(InitConfigFileParser::Context & ctx, const char * data); const ConfigInfo::SectionRule ConfigInfo::m_SectionRules[] = { @@ -111,6 +112,8 @@ ConfigInfo::m_SectionRules[] = { { "REP", transformNode, 0 }, { "EXTERNAL REP", transformExtNode, 0 }, + { MGM_TOKEN, fixShmUniqueId, 0 }, + { "TCP", checkConnectionSupport, 0 }, { "SHM", checkConnectionSupport, 0 }, { "SCI", checkConnectionSupport, 0 }, @@ -3155,19 +3158,39 @@ fixPortNumber(InitConfigFileParser::Context & ctx, const char * data){ DBUG_RETURN(true); } +static bool +fixShmUniqueId(InitConfigFileParser::Context & ctx, const char * data) +{ + DBUG_ENTER("fixShmUniqueId"); + Uint32 nodes= 0; + ctx.m_userProperties.get(ctx.fname, &nodes); + if (nodes == 1) // first management server + { + Uint32 portno= atoi(NDB_PORT); + ctx.m_currentSection->get("PortNumber", &portno); + ctx.m_userProperties.put("ShmUniqueId", portno); + } + DBUG_RETURN(true); +} + static bool fixShmKey(InitConfigFileParser::Context & ctx, const char *) { + DBUG_ENTER("fixShmKey"); Uint32 id1= 0, id2= 0, key= 0; require(ctx.m_currentSection->get("NodeId1", &id1)); require(ctx.m_currentSection->get("NodeId2", &id2)); if(ctx.m_currentSection->get("ShmKey", &key)) - return true; + { + DBUG_RETURN(true); + } - key= (id1 > id2 ? id1 << 16 | id2 : id2 << 16 | id1); + require(ctx.m_userProperties.get("ShmUniqueId", &key)); + key= key << 16 | (id1 > id2 ? id1 << 8 | id2 : id2 << 8 | id1); ctx.m_currentSection->put("ShmKey", key); - return true; + DBUG_PRINT("info",("Added ShmKey=0x%x", key)); + DBUG_RETURN(true); } /** From a3d3aef15786142094a04a17148a2f3a0166197b Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 12 Jan 2005 20:28:31 +0300 Subject: [PATCH 0722/1063] A test case for Bug#6761 "mysql_list_fields doesn't work" --- tests/client_test.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/tests/client_test.c b/tests/client_test.c index dc18929341c..beaff795d0e 100644 --- a/tests/client_test.c +++ b/tests/client_test.c @@ -11503,6 +11503,29 @@ static void test_rewind(void) rc= mysql_stmt_close(stmt); } + +/* Bug#6761 - mysql_list_fields doesn't work */ + +static void test_bug6761(void) +{ + const char *stmt_text; + MYSQL_RES *res; + int rc; + myheader("test_bug6761"); + + stmt_text= "CREATE TABLE t1 (a int, b char(255), c decimal)"; + rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text)); + myquery(rc); + + res= mysql_list_fields(mysql, "t1", "%"); + DIE_UNLESS(res && mysql_num_fields(res) == 3); + mysql_free_result(res); + + stmt_text= "DROP TABLE t1"; + rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text)); + myquery(rc); +} + /* Read and parse arguments and MySQL options from my.cnf */ @@ -11709,6 +11732,7 @@ static struct my_tests_st my_tests[]= { { "test_bug4172", test_bug4172 }, { "test_conversion", test_conversion }, { "test_rewind", test_rewind }, + { "test_bug6761", test_bug6761 }, { 0, 0 } }; From f5d30e0cac50677699d9fadfa540f4e900b679c3 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 12 Jan 2005 19:42:46 +0100 Subject: [PATCH 0723/1063] Fix for BUG#7793 "mysqlbinlog produces incorrect queries": when printing SET @var in mysqlbinlog, backtick the collation (as BINARY is a reserved word) mysql-test/r/ctype_ucs.result: backticks added mysql-test/r/user_var.result: backticks added mysql-test/t/user_var.test: testing a variable with BINARY collation, which needs the backticks sql/log_event.cc: when printing SET @var in mysqlbinlog, backtick the collation (as BINARY is a reserved word) --- mysql-test/r/ctype_ucs.result | 2 +- mysql-test/r/user_var.result | 13 ++++++++----- mysql-test/t/user_var.test | 3 ++- sql/log_event.cc | 2 +- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/mysql-test/r/ctype_ucs.result b/mysql-test/r/ctype_ucs.result index b1b83eb8b6c..5c47f8a4059 100644 --- a/mysql-test/r/ctype_ucs.result +++ b/mysql-test/r/ctype_ucs.result @@ -520,7 +520,7 @@ Log_name Pos Event_type Server_id Orig_log_pos Info master-bin.000001 79 User var 1 79 @`v`=_ucs2 0x006100620063 COLLATE ucs2_general_ci master-bin.000001 119 Query 1 119 use `test`; insert into t2 values (@v) /*!40019 SET @@session.max_insert_delayed_threads=0*/; -SET @`v`:=_ucs2 0x006100620063 COLLATE ucs2_general_ci; +SET @`v`:=_ucs2 0x006100620063 COLLATE `ucs2_general_ci`; use test; SET TIMESTAMP=10000; insert into t2 values (@v); diff --git a/mysql-test/r/user_var.result b/mysql-test/r/user_var.result index 4f521143d97..d46d6c7a78a 100644 --- a/mysql-test/r/user_var.result +++ b/mysql-test/r/user_var.result @@ -168,21 +168,24 @@ SET TIMESTAMP=10000; SET @`a b`='hello'; INSERT INTO t1 VALUES(@`a b`); set @var1= "';aaa"; -insert into t1 values (@var1); +SET @var2=char(ascii('a')); +insert into t1 values (@var1),(@var2); show binlog events from 79; Log_name Pos Event_type Server_id Orig_log_pos Info master-bin.000001 79 User var 1 79 @`a b`=_latin1 0x68656C6C6F COLLATE latin1_swedish_ci master-bin.000001 120 Query 1 120 use `test`; INSERT INTO t1 VALUES(@`a b`) master-bin.000001 184 User var 1 184 @`var1`=_latin1 0x273B616161 COLLATE latin1_swedish_ci -master-bin.000001 226 Query 1 226 use `test`; insert into t1 values (@var1) +master-bin.000001 226 User var 1 226 @`var2`=_binary 0x61 COLLATE binary +master-bin.000001 264 Query 1 264 use `test`; insert into t1 values (@var1),(@var2) /*!40019 SET @@session.max_insert_delayed_threads=0*/; -SET @`a b`:=_latin1 0x68656C6C6F COLLATE latin1_swedish_ci; +SET @`a b`:=_latin1 0x68656C6C6F COLLATE `latin1_swedish_ci`; use test; SET TIMESTAMP=10000; INSERT INTO t1 VALUES(@`a b`); -SET @`var1`:=_latin1 0x273B616161 COLLATE latin1_swedish_ci; +SET @`var1`:=_latin1 0x273B616161 COLLATE `latin1_swedish_ci`; +SET @`var2`:=_binary 0x61 COLLATE `binary`; SET TIMESTAMP=10000; -insert into t1 values (@var1); +insert into t1 values (@var1),(@var2); drop table t1; set @var= NULL ; select FIELD( @var,'1it','Hit') as my_column; diff --git a/mysql-test/t/user_var.test b/mysql-test/t/user_var.test index d985be05b94..81788ce8d73 100644 --- a/mysql-test/t/user_var.test +++ b/mysql-test/t/user_var.test @@ -107,7 +107,8 @@ SET TIMESTAMP=10000; SET @`a b`='hello'; INSERT INTO t1 VALUES(@`a b`); set @var1= "';aaa"; -insert into t1 values (@var1); +SET @var2=char(ascii('a')); +insert into t1 values (@var1),(@var2); show binlog events from 79; # more important than SHOW BINLOG EVENTS, mysqlbinlog (where we # absolutely need variables names to be quoted and strings to be diff --git a/sql/log_event.cc b/sql/log_event.cc index c027c3a8ee4..c86b67376ea 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -2459,7 +2459,7 @@ void User_var_log_event::print(FILE* file, bool short_form, char* last_db) */ fprintf(file, ":=???;\n"); else - fprintf(file, ":=_%s %s COLLATE %s;\n", cs->csname, hex_str, cs->name); + fprintf(file, ":=_%s %s COLLATE `%s`;\n", cs->csname, hex_str, cs->name); my_afree(hex_str); } break; From ec459b583b6281f6c918e8d56d7ca9316ddfa5c8 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 12 Jan 2005 22:55:10 +0200 Subject: [PATCH 0724/1063] Minor clean up. mysql-test/t/analyse.test: Added a note about the bug that this test case tests. sql/sql_analyse.cc: Changed function description to standard format. --- mysql-test/t/analyse.test | 5 +++++ sql/sql_analyse.cc | 15 +++++++-------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/mysql-test/t/analyse.test b/mysql-test/t/analyse.test index 34343c2b7bf..52e367769a2 100644 --- a/mysql-test/t/analyse.test +++ b/mysql-test/t/analyse.test @@ -38,6 +38,11 @@ select * from t2; insert into t2 select * from t1 procedure analyse(); select * from t2; drop table t1,t2; + +# +# Bug#2813 - analyse does not quote string values in enums from string +# + create table t1 (v varchar(128)); insert into t1 values ('abc'),('abc\'def\\hij\"klm\0opq'),('\''),('\"'),('\\'),('a\0'),('b\''),('c\"'),('d\\'),('\'b'),('\"c'),('\\d'),('a\0\0\0b'),('a\'\'\'\'b'),('a\"\"\"\"b'),('a\\\\\\\\b'),('\'\0\\\"'),('\'\''),('\"\"'),('\\\\'),('The\ZEnd'); select * from t1 procedure analyse(); diff --git a/sql/sql_analyse.cc b/sql/sql_analyse.cc index 5265857f3b1..33ce62bc5cf 100644 --- a/sql/sql_analyse.cc +++ b/sql/sql_analyse.cc @@ -1029,20 +1029,19 @@ uint check_ulonglong(const char *str, uint length) } /* check_ulonlong */ - /* - FUNCTION: append_escaped() - + Quote special characters in a string. + + SYNOPSIS + append_escaped(to_str, from_str) + to_str (in) A pointer to a String. + from_str (to) A pointer to an allocated string + DESCRIPTION append_escaped() takes a String type variable, where it appends escaped the second argument. Only characters that require escaping will be escaped. - ARGUMENTS - A pointer to a String variable, where results will be appended - A pointer to a String variable, which is appended to the result - String, escaping those characters that require it. - RETURN VALUES 0 Success 1 Out of memory From 4bdf479da07516fa13b63439f756c2d667e7acd6 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 12 Jan 2005 23:30:54 +0100 Subject: [PATCH 0725/1063] Symlink vulnerability fixed. reported by Javier Fernandez-Sanguino Pena and Debian Security Audit Team (http://www.debian.org/security/audit) --- scripts/mysqlaccess.sh | 39 +++++++++++++-------------------------- 1 file changed, 13 insertions(+), 26 deletions(-) diff --git a/scripts/mysqlaccess.sh b/scripts/mysqlaccess.sh index 75ef63ecdd0..b71f6847baf 100644 --- a/scripts/mysqlaccess.sh +++ b/scripts/mysqlaccess.sh @@ -2,7 +2,7 @@ # **************************** package MySQLaccess; #use strict; -use POSIX qw(tmpnam); +use File::Temp qw(tempfile tmpnam); use Fcntl; BEGIN { @@ -32,7 +32,6 @@ BEGIN { $ACCESS_U_BCK = 'user_backup'; $ACCESS_D_BCK = 'db_backup'; $DIFF = '/usr/bin/diff'; - $TMP_PATH = '/tmp'; #path to writable tmp-directory $MYSQLDUMP = '@bindir@/mysqldump'; #path to mysqldump executable @@ -432,7 +431,7 @@ use IPC::Open3; # no caching on STDOUT $|=1; - $MYSQL_CNF = POSIX::tmpnam(); + $MYSQL_CNF = tmpnam(); %MYSQL_CNF = (client => { }, mysql => { }, mysqldump => { }, @@ -577,8 +576,6 @@ if (!defined($Param{'host'})) { $Param{'host'}='localhost'; } push(@MySQLaccess::Grant::Error,'not_found_mysql') if !(-x $MYSQL); push(@MySQLaccess::Grant::Error,'not_found_diff') if !(-x $DIFF); push(@MySQLaccess::Grant::Error,'not_found_mysqldump') if !(-x $MYSQLDUMP); -push(@MySQLaccess::Grant::Error,'not_found_tmp') if !(-d $TMP_PATH); -push(@MySQLaccess::Grant::Error,'write_err_tmp') if !(-w $TMP_PATH); if (@MySQLaccess::Grant::Error) { MySQLaccess::Report::Print_Error_Messages() ; exit 0; @@ -1777,17 +1774,15 @@ sub Diff_Privileges { @before = sort(@before); @after = sort(@after); - $before = "$MySQLaccess::TMP_PATH/$MySQLaccess::script.before.$$"; - $after = "$MySQLaccess::TMP_PATH/$MySQLaccess::script.after.$$"; - #$after = "/tmp/t0"; - open(BEFORE,"> $before") || - push(@MySQLaccess::Report::Errors,"Can't open temporary file $before for writing"); - open(AFTER,"> $after") || - push(@MySQLaccess::Report::Errors,"Can't open temporary file $after for writing"); - print BEFORE join("\n",@before); - print AFTER join("\n",@after); - close(BEFORE); - close(AFTER); + ($hb, $before) = tempfile("$MySQLaccess::script.XXXXXX") or + push(@MySQLaccess::Report::Errors,"Can't create temporary file: $!"); + ($ha, $after) = tempfile("$MySQLaccess::script.XXXXXX") or + push(@MySQLaccess::Report::Errors,"Can't create temporary file: $!"); + + print $hb join("\n",@before); + print $ha join("\n",@after); + close $hb; + close $ha; # ---------------------------------- # compute difference @@ -1800,8 +1795,8 @@ sub Diff_Privileges { # ---------------------------------- # cleanup temp. files - unlink(BEFORE); - unlink(AFTER); + unlink($before); + unlink($after); return \@diffs; } @@ -2316,14 +2311,6 @@ BEGIN { => "The diff program <$MySQLaccess::DIFF> could not be found.\n" ."+ Check your path, or\n" ."+ edit the source of this script to point \$DIFF to the diff program.\n" - ,'not_found_tmp' - => "The temporary directory <$MySQLaccess::TMP_PATH> could not be found.\n" - ."+ create this directory (writeable!), or\n" - ."+ edit the source of this script to point \$TMP_PATH to the right directory.\n" - ,'write_err_tmp' - => "The temporary directory <$MySQLaccess::TMP_PATH> is not writable.\n" - ."+ make this directory writeable!, or\n" - ."+ edit the source of this script to point \$TMP_PATH to another directory.\n" ,'Unrecognized_option' => "Sorry,\n" ."You are using an old version of the mysql-program,\n" From 069d260b0ea1bd77d1f8c31f2b137dd809830858 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 13 Jan 2005 02:13:19 +0300 Subject: [PATCH 0726/1063] Add logging of COM_EXECUTE in the general query log. sql/sql_parse.cc: A shorter name for COM_EXECUTE command. --- sql/sql_parse.cc | 2 +- sql/sql_prepare.cc | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 2b273f4b84c..4d802ad4f34 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -64,7 +64,7 @@ const char *command_name[]={ "Drop DB", "Refresh", "Shutdown", "Statistics", "Processlist", "Connect","Kill","Debug","Ping","Time","Delayed insert","Change user", "Binlog Dump","Table Dump", "Connect Out", "Register Slave", - "Prepare", "Prepare Execute", "Long Data", "Close stmt", + "Prepare", "Execute", "Long Data", "Close stmt", "Reset stmt", "Set option", "Error" // Last command number }; diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index 20ebc23e240..ecf01824755 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -1592,7 +1592,7 @@ int mysql_stmt_prepare(THD *thd, char *packet, uint packet_length, DBUG_RETURN(1); } - mysql_log.write(thd, COM_PREPARE, "%s", packet); + mysql_log.write(thd, COM_PREPARE, "[%lu] %s", stmt->id, packet); thd->current_arena= stmt; mysql_init_query(thd, (uchar *) thd->query, thd->query_length); @@ -1792,6 +1792,9 @@ void mysql_stmt_execute(THD *thd, char *packet, uint packet_length) if (stmt->param_count && stmt->set_params_data(stmt, &expanded_query)) goto set_params_data_err; #endif + mysql_log.write(thd, COM_EXECUTE, "[%lu] %s", stmt->id, + expanded_query.length() ? expanded_query.c_ptr() : + stmt->query); thd->protocol= &thd->protocol_prep; // Switch to binary protocol execute_stmt(thd, stmt, &expanded_query, TRUE); thd->protocol= &thd->protocol_simple; // Use normal protocol From 8b077c2b9fb9fab697a5136db22e1695da3c6ccb Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 13 Jan 2005 00:41:45 +0100 Subject: [PATCH 0727/1063] Fix conversion of floating point values to character fields when the absolute value of the float is less than 1, and also fix calculation of length for negative values. (Bug #7774) sql/field.cc: Fix handling of negative values and fabs(values> < 1 in Field_str::store mysql-test/r/type_float.result: Add results mysql-test/r/type_float.result.es: Add results mysql-test/t/type_float.test: Add test for conversion of floats to character field --- mysql-test/r/type_float.result | 15 +++++++++++++++ mysql-test/r/type_float.result.es | 15 +++++++++++++++ mysql-test/t/type_float.test | 10 ++++++++++ sql/field.cc | 13 ++++++++++--- 4 files changed, 50 insertions(+), 3 deletions(-) diff --git a/mysql-test/r/type_float.result b/mysql-test/r/type_float.result index 9dd92c13c98..530eb32f77d 100644 --- a/mysql-test/r/type_float.result +++ b/mysql-test/r/type_float.result @@ -179,3 +179,18 @@ f 9.999 9.999 drop table if exists t1; +create table t1 (c char(20)); +insert into t1 values (5e-28); +select * from t1; +c +5e-28 +drop table t1; +create table t1 (c char(6)); +insert into t1 values (2e5),(2e6),(2e-4),(2e-5); +select * from t1; +c +200000 +2e+06 +0.0002 +2e-05 +drop table t1; diff --git a/mysql-test/r/type_float.result.es b/mysql-test/r/type_float.result.es index 64d9be7e30f..b93539b6bea 100644 --- a/mysql-test/r/type_float.result.es +++ b/mysql-test/r/type_float.result.es @@ -179,3 +179,18 @@ f 9.999 9.999 drop table if exists t1; +create table t1 (c char(20)); +insert into t1 values (5e-28); +select * from t1; +c +5e-28 +drop table t1; +create table t1 (c char(6)); +insert into t1 values (2e5),(2e6),(2e-4),(2e-5); +select * from t1; +c +200000 +2e+06 +0.0002 +2e-05 +drop table t1; diff --git a/mysql-test/t/type_float.test b/mysql-test/t/type_float.test index 3fe3afa3fac..69cdeaa32a9 100644 --- a/mysql-test/t/type_float.test +++ b/mysql-test/t/type_float.test @@ -103,3 +103,13 @@ create table t1 (f double(4,3)); insert into t1 values (-11.0),(-11),("-11"),(11.0),(11),("11"); select * from t1; drop table if exists t1; + +# Check conversion of floats to character field (Bug #7774) +create table t1 (c char(20)); +insert into t1 values (5e-28); +select * from t1; +drop table t1; +create table t1 (c char(6)); +insert into t1 values (2e5),(2e6),(2e-4),(2e-5); +select * from t1; +drop table t1; diff --git a/sql/field.cc b/sql/field.cc index e2c11cc7372..2f2115e55dd 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -4301,13 +4301,20 @@ int Field_str::store(double nr) char buff[DOUBLE_TO_STRING_CONVERSION_BUFFER_SIZE]; uint length; bool use_scientific_notation= TRUE; - use_scientific_notation= TRUE; - if (field_length < 32 && fabs(nr) < log_10[field_length]-1) + /* + Check fabs(nr) against longest value that can be stored in field, + which depends on whether the value is < 1 or not, and negative or not + */ + double anr= fabs(nr); + int neg= (nr < 0.0) ? 1 : 0; + if (field_length < 32 && + (anr < 1.0 ? anr > 1/(log_10[max(0,field_length-neg-2)]) /* -2 for "0." */ + : anr < log_10[field_length-neg]-1)) use_scientific_notation= FALSE; length= (uint) my_sprintf(buff, (buff, "%-.*g", (use_scientific_notation ? - max(0, (int)field_length-5) : + max(0, (int)field_length-neg-5) : field_length), nr)); /* From d62ca959512601c6f225be694009f8d1ecca4b7c Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 13 Jan 2005 00:44:13 +0100 Subject: [PATCH 0728/1063] Fix for BUG#7850: force the transaction isolation level to REPEATABLE READ when --single-transaction client/mysqldump.c: force the transaction isolation level to REPEATABLE READ when --single-transaction --- client/mysqldump.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/client/mysqldump.c b/client/mysqldump.c index d511dc3bbde..14ebe9ea8f7 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -2200,8 +2200,15 @@ static int start_transaction(MYSQL *mysql_con, my_bool consistent_read_now) We use BEGIN for old servers. --single-transaction --master-data will fail on old servers, but that's ok as it was already silently broken (it didn't do a consistent read, so better tell people frankly, with the error). + + We want the first consistent read to be used for all tables to dump so we + need the REPEATABLE READ level (not anything lower, for example READ + COMMITTED would give one new consistent read per dumped table). */ return (mysql_query_with_error_report(mysql_con, 0, + "SET SESSION TRANSACTION ISOLATION " + "LEVEL REPEATABLE READ") || + mysql_query_with_error_report(mysql_con, 0, consistent_read_now ? "START TRANSACTION " "WITH CONSISTENT SNAPSHOT" : From 7682d6c9cfa7081dc88b744d1a4f343367309c2b Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 13 Jan 2005 00:52:19 +0100 Subject: [PATCH 0729/1063] Small fix for Field_str::store() to avoid trying to read past beginning of log_10 array. sql/field.cc: Avoid pointless calculation for really short fields, and what could be an attempt to access outside the bounds of the log_10 array. --- sql/field.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/field.cc b/sql/field.cc index 2f2115e55dd..fec65438e4d 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -4307,7 +4307,7 @@ int Field_str::store(double nr) */ double anr= fabs(nr); int neg= (nr < 0.0) ? 1 : 0; - if (field_length < 32 && + if (field_length > 4 && field_length < 32 && (anr < 1.0 ? anr > 1/(log_10[max(0,field_length-neg-2)]) /* -2 for "0." */ : anr < log_10[field_length-neg]-1)) use_scientific_notation= FALSE; From d74020eb398a12893b7268fec3cc6885ef624852 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 12 Jan 2005 17:20:43 -0800 Subject: [PATCH 0730/1063] Fix small memory leak that occured when BerkeleyDB failed to initialize. sql/ha_berkeley.cc: Skip allocation of hash and lock on error --- sql/ha_berkeley.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sql/ha_berkeley.cc b/sql/ha_berkeley.cc index 2c7cce4bcd0..e33cd3fca1b 100644 --- a/sql/ha_berkeley.cc +++ b/sql/ha_berkeley.cc @@ -165,11 +165,13 @@ bool berkeley_init(void) { db_env->close(db_env,0); /* purecov: inspected */ db_env=0; /* purecov: inspected */ + goto err; } (void) hash_init(&bdb_open_tables,system_charset_info,32,0,0, (hash_get_key) bdb_get_key,0,0); pthread_mutex_init(&bdb_mutex,MY_MUTEX_INIT_FAST); +err: DBUG_RETURN(db_env == 0); } From c26f341bb97b80fbaaa796dddcd24e2ae9c21b4d Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 12 Jan 2005 19:56:49 -0600 Subject: [PATCH 0731/1063] libmysqld.def, libmysql.def: Add missing 'get_defaults_files' to fix linking error. libmysql/libmysql.def: Add missing 'get_defaults_files' to fix linking error. libmysqld/libmysqld.def: Add missing 'get_defaults_files' to fix linking error. --- libmysql/libmysql.def | 1 + libmysqld/libmysqld.def | 1 + 2 files changed, 2 insertions(+) diff --git a/libmysql/libmysql.def b/libmysql/libmysql.def index c9ff70f208d..6967b09b143 100644 --- a/libmysql/libmysql.def +++ b/libmysql/libmysql.def @@ -146,3 +146,4 @@ EXPORTS mysql_rpl_query_type mysql_slave_query mysql_embedded + get_defaults_files diff --git a/libmysqld/libmysqld.def b/libmysqld/libmysqld.def index 14c6725bcb5..5515f50a1de 100644 --- a/libmysqld/libmysqld.def +++ b/libmysqld/libmysqld.def @@ -157,3 +157,4 @@ EXPORTS mysql_stmt_attr_get mysql_stmt_attr_set mysql_stmt_field_count + get_defaults_files From 8191a28b9754eb145cd8c2556ae47a4399a8fe72 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 12 Jan 2005 21:04:31 -0600 Subject: [PATCH 0732/1063] libmysqld.def, libmysql.def: Use the invisible tabs (!) libmysql/libmysql.def: Use the invisible tabs (!) libmysqld/libmysqld.def: Use the invisible tabs (!) --- libmysql/libmysql.def | 2 +- libmysqld/libmysqld.def | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libmysql/libmysql.def b/libmysql/libmysql.def index 6967b09b143..c5579e9ec2b 100644 --- a/libmysql/libmysql.def +++ b/libmysql/libmysql.def @@ -146,4 +146,4 @@ EXPORTS mysql_rpl_query_type mysql_slave_query mysql_embedded - get_defaults_files + get_defaults_files diff --git a/libmysqld/libmysqld.def b/libmysqld/libmysqld.def index 5515f50a1de..ea3133594f5 100644 --- a/libmysqld/libmysqld.def +++ b/libmysqld/libmysqld.def @@ -157,4 +157,4 @@ EXPORTS mysql_stmt_attr_get mysql_stmt_attr_set mysql_stmt_field_count - get_defaults_files + get_defaults_files From fee822e41f03cbcdf527772a6729b83b6fddd9db Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 13 Jan 2005 10:28:26 +0100 Subject: [PATCH 0733/1063] bug#7864 - fix ndb limit 4.5G data memory due to truncation error ndb/src/kernel/blocks/dbtup/DbtupGen.cpp: remove 8k->32k conversion ndb/src/kernel/vm/Configuration.cpp: compute size in 32k pages directly --- ndb/src/kernel/blocks/dbtup/DbtupGen.cpp | 9 +++------ ndb/src/kernel/vm/Configuration.cpp | 2 +- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp b/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp index 8e1cba24359..0f0e6d61f41 100644 --- a/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp +++ b/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp @@ -632,14 +632,11 @@ void Dbtup::execREAD_CONFIG_REQ(Signal* signal) ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_TUP_FRAG, &cnoOfFragrec)); ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_TUP_OP_RECS, &cnoOfOprec)); - - // MemorySpaceTuples is specified in 8k pages, divide by 4 for 32k pages - Uint32 tmp; - ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_TUP_PAGE, &tmp)); - Uint64 pages = (tmp * 2048 + (ZWORDS_ON_PAGE - 1))/ (Uint64)ZWORDS_ON_PAGE; - cnoOfPage = (Uint32)pages; + + ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_TUP_PAGE, &cnoOfPage)); Uint32 noOfTriggers= 0; + Uint32 tmp= 0; ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_TUP_PAGE_RANGE, &tmp)); initPageRangeSize(tmp); ndbrequire(!ndb_mgm_get_int_parameter(p, CFG_TUP_TABLE, &cnoOfTablerec)); diff --git a/ndb/src/kernel/vm/Configuration.cpp b/ndb/src/kernel/vm/Configuration.cpp index 29255fc9837..4ad7050ce63 100644 --- a/ndb/src/kernel/vm/Configuration.cpp +++ b/ndb/src/kernel/vm/Configuration.cpp @@ -521,7 +521,7 @@ Configuration::calcSizeAlt(ConfigValues * ownConfig){ ERROR_SET(fatal, ERR_INVALID_CONFIG, msg, buf); } - noOfDataPages = (dataMem / 8192); + noOfDataPages = (dataMem / 32768); noOfIndexPages = (indexMem / 8192); for(unsigned j = 0; j Date: Thu, 13 Jan 2005 13:07:35 +0100 Subject: [PATCH 0734/1063] - added the 4.0 shared mysqlclient libraries to the 4.1 "shared-compat" RPM --- support-files/MySQL-shared-compat.spec.sh | 28 +++++++++++++++-------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/support-files/MySQL-shared-compat.spec.sh b/support-files/MySQL-shared-compat.spec.sh index 068daadab58..e3c88c9415f 100644 --- a/support-files/MySQL-shared-compat.spec.sh +++ b/support-files/MySQL-shared-compat.spec.sh @@ -26,7 +26,8 @@ # # Change this to match the version of the shared libs you want to include # -%define version4 @MYSQL_NO_DASH_VERSION@ +%define version41 @MYSQL_NO_DASH_VERSION@ +%define version40 4.0.23 %define version3 3.23.58 Name: MySQL-shared-compat @@ -36,26 +37,31 @@ License: GPL Group: Applications/Databases URL: http://www.mysql.com/ Autoreqprov: on -Version: %{version4} +Version: %{version41} Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build Obsoletes: MySQL-shared, mysql-shared Provides: MySQL-shared -Summary: MySQL shared libraries for MySQL %{version4} and %{version3} -Source0: MySQL-shared-%{version4}-0.%{_arch}.rpm -Source1: MySQL-shared-%{version3}-1.%{_arch}.rpm +Summary: MySQL shared client libraries for MySQL %{version41}, %{version40} and %{version3} +# We simply use the "MySQL-shared" subpackages as input sources instead of +# rebuilding all from source +Source0: MySQL-shared-%{version41}-0.%{_arch}.rpm +Source1: MySQL-shared-%{version40}-0.%{_arch}.rpm +Source2: MySQL-shared-%{version3}-1.%{_arch}.rpm # No need to include the RPMs once more - they can be downloaded seperately # if you want to rebuild this package NoSource: 0 NoSource: 1 +NoSource: 2 BuildRoot: %{_tmppath}/%{name}-%{version}-build %description -This package includes the shared libraries for both MySQL %{version3} and -MySQL %{version4}. Install this package instead of "MySQL-shared", if you -have applications installed that are dynamically linked against MySQL -3.23.xx but you want to upgrade to MySQL 4.0.xx without breaking the library -dependencies. +This package includes the shared libraries for both MySQL %{version3}, +MySQL %{version40} as well as MySQL %{version41}. +Install this package instead of "MySQL-shared", if you have applications +installed that are dynamically linked against older versions of the MySQL +client library but you want to upgrade to MySQL 4.1.xx without breaking the +library dependencies. %install [ "$RPM_BUILD_ROOT" != "/" ] && [ -d $RPM_BUILD_ROOT ] && rm -rf $RPM_BUILD_ROOT; @@ -63,6 +69,8 @@ mkdir -p $RPM_BUILD_ROOT cd $RPM_BUILD_ROOT rpm2cpio %{SOURCE0} | cpio -iv --make-directories rpm2cpio %{SOURCE1} | cpio -iv --make-directories +rpm2cpio %{SOURCE2} | cpio -iv --make-directories +/sbin/ldconfig -n $RPM_BUILD_ROOT%{_libdir} %clean [ "$RPM_BUILD_ROOT" != "/" ] && [ -d $RPM_BUILD_ROOT ] && rm -rf $RPM_BUILD_ROOT; From bcb3783c7c88b06a8417a5734103ae856a2f7dbc Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 13 Jan 2005 15:04:57 +0200 Subject: [PATCH 0735/1063] Fixed a problem with a test. Time could be 0 or 1 seconds, depending on whether running with or without valgrind. --- mysql-test/r/ps_1general.result | 2 +- mysql-test/t/ps_1general.test | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/ps_1general.result b/mysql-test/r/ps_1general.result index 25b9e2dcda4..ee3eca850f4 100644 --- a/mysql-test/r/ps_1general.result +++ b/mysql-test/r/ps_1general.result @@ -291,7 +291,7 @@ execute stmt4; prepare stmt4 from ' show full processlist '; execute stmt4; Id User Host db Command Time State Info -number root localhost test Query 0 NULL show full processlist +number root localhost test Query time NULL show full processlist prepare stmt4 from ' show grants for user '; prepare stmt4 from ' show create table t2 '; ERROR HY000: This command is not supported in the prepared statement protocol yet diff --git a/mysql-test/t/ps_1general.test b/mysql-test/t/ps_1general.test index 08c1ad85fb1..d9cc9de6ff1 100644 --- a/mysql-test/t/ps_1general.test +++ b/mysql-test/t/ps_1general.test @@ -317,7 +317,7 @@ prepare stmt4 from ' show engine bdb logs '; execute stmt4; --enable_result_log prepare stmt4 from ' show full processlist '; ---replace_column 1 number +--replace_column 1 number 6 time execute stmt4; prepare stmt4 from ' show grants for user '; --error 1295 From 4c84421bdff12a9d08ac5fd465d297c65ea74658 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 13 Jan 2005 14:57:51 +0100 Subject: [PATCH 0736/1063] - bumped up the version number in configure.in from 4.1.9 to 4.1.10 - tagged ChangeSet 1.2207 as "mysql-4.1.9" configure.in: - bumped up the version number from 4.1.9 to 4.1.10 --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index f2184ed7be5..45ca009123e 100644 --- a/configure.in +++ b/configure.in @@ -5,7 +5,7 @@ AC_INIT(sql/mysqld.cc) AC_CANONICAL_SYSTEM # The Docs Makefile.am parses this line! # remember to also change ndb version below and update version.c in ndb -AM_INIT_AUTOMAKE(mysql, 4.1.9) +AM_INIT_AUTOMAKE(mysql, 4.1.10) AM_CONFIG_HEADER(config.h) PROTOCOL_VERSION=10 From 9842aca3ef48bf56a6c3ee5b9e1159e4249ce346 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 13 Jan 2005 18:12:04 +0400 Subject: [PATCH 0737/1063] bug#7284: strnxfrm returns different results for equal strings --- mysql-test/include/ctype_filesort.inc | 15 +++++++++ mysql-test/r/ctype_big5.result | 21 +++++++++++++ mysql-test/r/ctype_latin1.result | 20 ++++++++++++ mysql-test/r/ctype_latin1_de.result | 9 ++++++ mysql-test/r/ctype_sjis.result | 20 ++++++++++++ mysql-test/r/ctype_tis620.result | 20 ++++++++++++ mysql-test/r/ctype_uca.result | 10 ++++++ mysql-test/r/ctype_ucs.result | 21 +++++++++++++ mysql-test/r/ctype_ujis.result | 20 ++++++++++++ mysql-test/r/ctype_utf8.result | 20 ++++++++++++ mysql-test/t/ctype_big5.test | 6 ++++ mysql-test/t/ctype_latin1.test | 6 ++++ mysql-test/t/ctype_latin1_de.test | 2 ++ mysql-test/t/ctype_sjis.test | 6 ++++ mysql-test/t/ctype_tis620.test | 6 ++++ mysql-test/t/ctype_uca.test | 3 ++ mysql-test/t/ctype_ucs.test | 6 ++++ mysql-test/t/ctype_ujis.test | 6 ++++ mysql-test/t/ctype_utf8.test | 6 ++++ sql/field.cc | 12 ++----- sql/filesort.cc | 5 +-- strings/ctype-big5.c | 5 ++- strings/ctype-bin.c | 26 ++++++++++++---- strings/ctype-czech.c | 8 +++-- strings/ctype-gbk.c | 5 ++- strings/ctype-latin1.c | 5 +-- strings/ctype-mb.c | 11 ++++--- strings/ctype-simple.c | 45 +++++++++++++++++++++++++-- strings/ctype-sjis.c | 4 ++- strings/ctype-tis620.c | 6 +++- strings/ctype-uca.c | 16 +++++++--- strings/ctype-ucs2.c | 9 ++++-- strings/ctype-utf8.c | 5 +-- strings/ctype-win1250ch.c | 4 ++- 34 files changed, 344 insertions(+), 45 deletions(-) create mode 100644 mysql-test/include/ctype_filesort.inc diff --git a/mysql-test/include/ctype_filesort.inc b/mysql-test/include/ctype_filesort.inc new file mode 100644 index 00000000000..2068463d4e2 --- /dev/null +++ b/mysql-test/include/ctype_filesort.inc @@ -0,0 +1,15 @@ +# +# Set desired charset_connection and collation_collation +# before including this file. +# + +# The next query creates a LONGTEXT column +# using the current character_set_connection +# and collation_connection. + +create table t1 select repeat('a',4000) a; +delete from t1; + +insert into t1 values ('a'), ('a '), ('a\t'); +select collation(a),hex(a) from t1 order by a; +drop table t1; diff --git a/mysql-test/r/ctype_big5.result b/mysql-test/r/ctype_big5.result index 9b9fcbccbe0..8f4ee3d0558 100644 --- a/mysql-test/r/ctype_big5.result +++ b/mysql-test/r/ctype_big5.result @@ -56,3 +56,24 @@ DROP DATABASE d1; USE test; SET character_set_server= @safe_character_set_server; SET collation_server= @safe_collation_server; +SET NAMES big5; +SET collation_connection='big5_chinese_ci'; +create table t1 select repeat('a',4000) a; +delete from t1; +insert into t1 values ('a'), ('a '), ('a\t'); +select collation(a),hex(a) from t1 order by a; +collation(a) hex(a) +big5_chinese_ci 6109 +big5_chinese_ci 61 +big5_chinese_ci 6120 +drop table t1; +SET collation_connection='big5_bin'; +create table t1 select repeat('a',4000) a; +delete from t1; +insert into t1 values ('a'), ('a '), ('a\t'); +select collation(a),hex(a) from t1 order by a; +collation(a) hex(a) +big5_bin 6109 +big5_bin 61 +big5_bin 6120 +drop table t1; diff --git a/mysql-test/r/ctype_latin1.result b/mysql-test/r/ctype_latin1.result index 355f53b63a5..cd804939a75 100644 --- a/mysql-test/r/ctype_latin1.result +++ b/mysql-test/r/ctype_latin1.result @@ -305,3 +305,23 @@ select 'a' regexp 'A' collate latin1_general_cs; select 'a' regexp 'A' collate latin1_bin; 'a' regexp 'A' collate latin1_bin 0 +SET collation_connection='latin1_swedish_ci'; +create table t1 select repeat('a',4000) a; +delete from t1; +insert into t1 values ('a'), ('a '), ('a\t'); +select collation(a),hex(a) from t1 order by a; +collation(a) hex(a) +latin1_swedish_ci 6109 +latin1_swedish_ci 61 +latin1_swedish_ci 6120 +drop table t1; +SET collation_connection='latin1_bin'; +create table t1 select repeat('a',4000) a; +delete from t1; +insert into t1 values ('a'), ('a '), ('a\t'); +select collation(a),hex(a) from t1 order by a; +collation(a) hex(a) +latin1_bin 6109 +latin1_bin 61 +latin1_bin 6120 +drop table t1; diff --git a/mysql-test/r/ctype_latin1_de.result b/mysql-test/r/ctype_latin1_de.result index 50af5464f54..6df9d963498 100644 --- a/mysql-test/r/ctype_latin1_de.result +++ b/mysql-test/r/ctype_latin1_de.result @@ -317,3 +317,12 @@ FIELD('ue',s1) FIELD(' 1 1 1 1 1 1 1 1 DROP TABLE t1; +create table t1 select repeat('a',4000) a; +delete from t1; +insert into t1 values ('a'), ('a '), ('a\t'); +select collation(a),hex(a) from t1 order by a; +collation(a) hex(a) +latin1_german2_ci 6109 +latin1_german2_ci 61 +latin1_german2_ci 6120 +drop table t1; diff --git a/mysql-test/r/ctype_sjis.result b/mysql-test/r/ctype_sjis.result index 944fa0602a9..1f414f89e20 100644 --- a/mysql-test/r/ctype_sjis.result +++ b/mysql-test/r/ctype_sjis.result @@ -71,3 +71,23 @@ B1 B2 B3 drop table t1; +SET collation_connection='sjis_japanese_ci'; +create table t1 select repeat('a',4000) a; +delete from t1; +insert into t1 values ('a'), ('a '), ('a\t'); +select collation(a),hex(a) from t1 order by a; +collation(a) hex(a) +sjis_japanese_ci 6109 +sjis_japanese_ci 61 +sjis_japanese_ci 6120 +drop table t1; +SET collation_connection='sjis_bin'; +create table t1 select repeat('a',4000) a; +delete from t1; +insert into t1 values ('a'), ('a '), ('a\t'); +select collation(a),hex(a) from t1 order by a; +collation(a) hex(a) +sjis_bin 6109 +sjis_bin 61 +sjis_bin 6120 +drop table t1; diff --git a/mysql-test/r/ctype_tis620.result b/mysql-test/r/ctype_tis620.result index fa99c2d1318..6d8bfe74c4b 100644 --- a/mysql-test/r/ctype_tis620.result +++ b/mysql-test/r/ctype_tis620.result @@ -2937,3 +2937,23 @@ Screensaver 2 2002-01-22 491 0 519 0 0 3 http://www.siamzone.com/download/download/000003-jasonx2(800x600).jpg Jaso n X Wallpapers 1 2002-05-31 579 0 1091 0 0 DROP TABLE t1; +SET collation_connection='tis620_thai_ci'; +create table t1 select repeat('a',4000) a; +delete from t1; +insert into t1 values ('a'), ('a '), ('a\t'); +select collation(a),hex(a) from t1 order by a; +collation(a) hex(a) +tis620_thai_ci 6109 +tis620_thai_ci 61 +tis620_thai_ci 6120 +drop table t1; +SET collation_connection='tis620_bin'; +create table t1 select repeat('a',4000) a; +delete from t1; +insert into t1 values ('a'), ('a '), ('a\t'); +select collation(a),hex(a) from t1 order by a; +collation(a) hex(a) +tis620_bin 6109 +tis620_bin 61 +tis620_bin 6120 +drop table t1; diff --git a/mysql-test/r/ctype_uca.result b/mysql-test/r/ctype_uca.result index 0573092e39b..dd5a7ebf6a4 100644 --- a/mysql-test/r/ctype_uca.result +++ b/mysql-test/r/ctype_uca.result @@ -2386,3 +2386,13 @@ a 1 b 0 c 0 drop table t1; +SET collation_connection='utf8_unicode_ci'; +create table t1 select repeat('a',4000) a; +delete from t1; +insert into t1 values ('a'), ('a '), ('a\t'); +select collation(a),hex(a) from t1 order by a; +collation(a) hex(a) +utf8_unicode_ci 6109 +utf8_unicode_ci 61 +utf8_unicode_ci 6120 +drop table t1; diff --git a/mysql-test/r/ctype_ucs.result b/mysql-test/r/ctype_ucs.result index b1b83eb8b6c..47211e67905 100644 --- a/mysql-test/r/ctype_ucs.result +++ b/mysql-test/r/ctype_ucs.result @@ -592,3 +592,24 @@ a NULL b NULL c NULL drop table t1; +SET collation_connection='ucs2_general_ci'; +create table t1 select repeat('a',4000) a; +delete from t1; +insert into t1 values ('a'), ('a '), ('a\t'); +select collation(a),hex(a) from t1 order by a; +collation(a) hex(a) +ucs2_general_ci 00610009 +ucs2_general_ci 0061 +ucs2_general_ci 00610020 +drop table t1; +SET NAMES latin1; +SET collation_connection='ucs2_bin'; +create table t1 select repeat('a',4000) a; +delete from t1; +insert into t1 values ('a'), ('a '), ('a\t'); +select collation(a),hex(a) from t1 order by a; +collation(a) hex(a) +ucs2_bin 00610009 +ucs2_bin 0061 +ucs2_bin 00610020 +drop table t1; diff --git a/mysql-test/r/ctype_ujis.result b/mysql-test/r/ctype_ujis.result index aa4c347d54f..fd6c501499b 100644 --- a/mysql-test/r/ctype_ujis.result +++ b/mysql-test/r/ctype_ujis.result @@ -2207,3 +2207,23 @@ F4FC F4FD F4FE DROP TABLE t1; +SET collation_connection='ujis_japanese_ci'; +create table t1 select repeat('a',4000) a; +delete from t1; +insert into t1 values ('a'), ('a '), ('a\t'); +select collation(a),hex(a) from t1 order by a; +collation(a) hex(a) +ujis_japanese_ci 6109 +ujis_japanese_ci 61 +ujis_japanese_ci 6120 +drop table t1; +SET collation_connection='ujis_bin'; +create table t1 select repeat('a',4000) a; +delete from t1; +insert into t1 values ('a'), ('a '), ('a\t'); +select collation(a),hex(a) from t1 order by a; +collation(a) hex(a) +ujis_bin 6109 +ujis_bin 61 +ujis_bin 6120 +drop table t1; diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result index ebaa329891c..6e375b53d35 100644 --- a/mysql-test/r/ctype_utf8.result +++ b/mysql-test/r/ctype_utf8.result @@ -829,3 +829,23 @@ select * from t1 where soundex(a) = soundex('test'); id a 1 Test drop table t1; +SET collation_connection='utf8_general_ci'; +create table t1 select repeat('a',4000) a; +delete from t1; +insert into t1 values ('a'), ('a '), ('a\t'); +select collation(a),hex(a) from t1 order by a; +collation(a) hex(a) +utf8_general_ci 6109 +utf8_general_ci 61 +utf8_general_ci 6120 +drop table t1; +SET collation_connection='utf8_bin'; +create table t1 select repeat('a',4000) a; +delete from t1; +insert into t1 values ('a'), ('a '), ('a\t'); +select collation(a),hex(a) from t1 order by a; +collation(a) hex(a) +utf8_bin 6109 +utf8_bin 61 +utf8_bin 6120 +drop table t1; diff --git a/mysql-test/t/ctype_big5.test b/mysql-test/t/ctype_big5.test index b1d71a6af15..8b75123ca32 100644 --- a/mysql-test/t/ctype_big5.test +++ b/mysql-test/t/ctype_big5.test @@ -10,3 +10,9 @@ drop table if exists t1; SET @test_character_set= 'big5'; SET @test_collation= 'big5_chinese_ci'; -- source include/ctype_common.inc + +SET NAMES big5; +SET collation_connection='big5_chinese_ci'; +-- source include/ctype_filesort.inc +SET collation_connection='big5_bin'; +-- source include/ctype_filesort.inc diff --git a/mysql-test/t/ctype_latin1.test b/mysql-test/t/ctype_latin1.test index 677acd9faa9..cee0324d12f 100644 --- a/mysql-test/t/ctype_latin1.test +++ b/mysql-test/t/ctype_latin1.test @@ -60,3 +60,9 @@ DROP TABLE t1; select 'a' regexp 'A' collate latin1_general_ci; select 'a' regexp 'A' collate latin1_general_cs; select 'a' regexp 'A' collate latin1_bin; + + +SET collation_connection='latin1_swedish_ci'; +-- source include/ctype_filesort.inc +SET collation_connection='latin1_bin'; +-- source include/ctype_filesort.inc diff --git a/mysql-test/t/ctype_latin1_de.test b/mysql-test/t/ctype_latin1_de.test index 1c9576c1c56..ce4fdc4e3c9 100644 --- a/mysql-test/t/ctype_latin1_de.test +++ b/mysql-test/t/ctype_latin1_de.test @@ -114,3 +114,5 @@ SELECT s1,COUNT(*) FROM t1 GROUP BY s1; SELECT COUNT(DISTINCT s1) FROM t1; SELECT FIELD('ue',s1), FIELD('Ü',s1), s1='ue', s1='Ü' FROM t1; DROP TABLE t1; + +-- source include/ctype_filesort.inc diff --git a/mysql-test/t/ctype_sjis.test b/mysql-test/t/ctype_sjis.test index a3a44789975..58ca3c6a997 100644 --- a/mysql-test/t/ctype_sjis.test +++ b/mysql-test/t/ctype_sjis.test @@ -62,3 +62,9 @@ CREATE TABLE t1 ( insert into t1 values(0xb1),(0xb2),(0xb3); select hex(c) from t1; drop table t1; + + +SET collation_connection='sjis_japanese_ci'; +-- source include/ctype_filesort.inc +SET collation_connection='sjis_bin'; +-- source include/ctype_filesort.inc diff --git a/mysql-test/t/ctype_tis620.test b/mysql-test/t/ctype_tis620.test index 21ec314dca7..87047db9b54 100644 --- a/mysql-test/t/ctype_tis620.test +++ b/mysql-test/t/ctype_tis620.test @@ -151,3 +151,9 @@ INSERT INTO t1 VALUES n X Wallpapers',1,'','2002-05-31','',579,0,'',1091,0,0,''); select * from t1 order by id; DROP TABLE t1; + + +SET collation_connection='tis620_thai_ci'; +-- source include/ctype_filesort.inc +SET collation_connection='tis620_bin'; +-- source include/ctype_filesort.inc diff --git a/mysql-test/t/ctype_uca.test b/mysql-test/t/ctype_uca.test index 8bca2a4b3c2..dfca82fa70a 100644 --- a/mysql-test/t/ctype_uca.test +++ b/mysql-test/t/ctype_uca.test @@ -452,3 +452,6 @@ create table t1 (a varchar(1)) character set utf8 collate utf8_estonian_ci; insert into t1 values ('A'),('B'),('C'),('a'),('b'),('c'); select a, a regexp '[a]' from t1 order by binary a; drop table t1; + +SET collation_connection='utf8_unicode_ci'; +-- source include/ctype_filesort.inc diff --git a/mysql-test/t/ctype_ucs.test b/mysql-test/t/ctype_ucs.test index b9f77505446..1a0ba82d6ff 100644 --- a/mysql-test/t/ctype_ucs.test +++ b/mysql-test/t/ctype_ucs.test @@ -384,3 +384,9 @@ alter table t1 add b char(1); show warnings; select * from t1 order by a; drop table t1; + +SET collation_connection='ucs2_general_ci'; +-- source include/ctype_filesort.inc +SET NAMES latin1; +SET collation_connection='ucs2_bin'; +-- source include/ctype_filesort.inc diff --git a/mysql-test/t/ctype_ujis.test b/mysql-test/t/ctype_ujis.test index 3f0e9882179..407287be30a 100644 --- a/mysql-test/t/ctype_ujis.test +++ b/mysql-test/t/ctype_ujis.test @@ -1141,3 +1141,9 @@ INSERT INTO t1 VALUES(0xF4FD); INSERT INTO t1 VALUES(0xF4FE); SELECT HEX(c) FROM t1 ORDER BY BINARY c; DROP TABLE t1; + + +SET collation_connection='ujis_japanese_ci'; +-- source include/ctype_filesort.inc +SET collation_connection='ujis_bin'; +-- source include/ctype_filesort.inc diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test index 214c2712665..a57db4455ab 100644 --- a/mysql-test/t/ctype_utf8.test +++ b/mysql-test/t/ctype_utf8.test @@ -675,3 +675,9 @@ select * from t1 where soundex(a) = soundex('Test'); select * from t1 where soundex(a) = soundex('TEST'); select * from t1 where soundex(a) = soundex('test'); drop table t1; + + +SET collation_connection='utf8_general_ci'; +-- source include/ctype_filesort.inc +SET collation_connection='utf8_bin'; +-- source include/ctype_filesort.inc diff --git a/sql/field.cc b/sql/field.cc index e2c11cc7372..86073072a64 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -4393,8 +4393,7 @@ void Field_string::sort_string(char *to,uint length) uint tmp=my_strnxfrm(field_charset, (unsigned char *) to, length, (unsigned char *) ptr, field_length); - if (tmp < length) - field_charset->cset->fill(field_charset, to + tmp, length - tmp, ' '); + DBUG_ASSERT(tmp == length); } @@ -4596,9 +4595,7 @@ void Field_varstring::sort_string(char *to,uint length) (uchar*) to, length, (uchar*) ptr+HA_KEY_BLOB_LENGTH, tot_length); - if (tot_length < length) - field_charset->cset->fill(field_charset, to+tot_length,length-tot_length, - binary() ? (char) 0 : ' '); + DBUG_ASSERT(tot_length == length); } @@ -5116,10 +5113,7 @@ void Field_blob::sort_string(char *to,uint length) blob_length=my_strnxfrm(field_charset, (uchar*) to, length, (uchar*) blob, blob_length); - if (blob_length < length) - field_charset->cset->fill(field_charset, to+blob_length, - length-blob_length, - binary() ? (char) 0 : ' '); + DBUG_ASSERT(blob_length == length); } } diff --git a/sql/filesort.cc b/sql/filesort.cc index bd0de022fd4..cb377070aaa 100644 --- a/sql/filesort.cc +++ b/sql/filesort.cc @@ -622,10 +622,7 @@ static void make_sortkey(register SORTPARAM *param, } uint tmp_length=my_strnxfrm(cs,to,sort_field->length, (unsigned char *) from, length); - if (tmp_length < sort_field->length) - cs->cset->fill(cs, (char*) to+tmp_length, - sort_field->length-tmp_length, - fill_char); + DBUG_ASSERT(tmp_length == sort_field->length); } else { diff --git a/strings/ctype-big5.c b/strings/ctype-big5.c index 8345c53202c..997b8ce93d6 100644 --- a/strings/ctype-big5.c +++ b/strings/ctype-big5.c @@ -298,6 +298,7 @@ static int my_strnxfrm_big5(CHARSET_INFO *cs __attribute__((unused)), const uchar * src, uint srclen) { uint16 e; + uint dstlen= len; len = srclen; while (len--) @@ -312,7 +313,9 @@ static int my_strnxfrm_big5(CHARSET_INFO *cs __attribute__((unused)), } else *dest++ = sort_order_big5[(uchar) *src++]; } - return srclen; + if (dstlen > srclen) + bfill(dest, dstlen - srclen, ' '); + return dstlen; } #if 0 diff --git a/strings/ctype-bin.c b/strings/ctype-bin.c index 7d17f62c8d0..95c52512243 100644 --- a/strings/ctype-bin.c +++ b/strings/ctype-bin.c @@ -341,13 +341,27 @@ static int my_wildcmp_bin(CHARSET_INFO *cs, static int my_strnxfrm_bin(CHARSET_INFO *cs __attribute__((unused)), - uchar * dest, uint len, - const uchar *src, - uint srclen __attribute__((unused))) + uchar * dest, uint dstlen, + const uchar *src, uint srclen) { if (dest != src) - memcpy(dest,src,len= min(len,srclen)); - return len; + memcpy(dest, src, min(dstlen,srclen)); + if (dstlen > srclen) + bfill(dest + srclen, dstlen - srclen, 0); + return dstlen; +} + + +static +int my_strnxfrm_8bit_bin(CHARSET_INFO *cs __attribute__((unused)), + uchar * dest, uint dstlen, + const uchar *src, uint srclen) +{ + if (dest != src) + memcpy(dest, src, min(dstlen,srclen)); + if (dstlen > srclen) + bfill(dest + srclen, dstlen - srclen, ' '); + return dstlen; } @@ -417,7 +431,7 @@ MY_COLLATION_HANDLER my_collation_8bit_bin_handler = NULL, /* init */ my_strnncoll_8bit_bin, my_strnncollsp_8bit_bin, - my_strnxfrm_bin, + my_strnxfrm_8bit_bin, my_like_range_simple, my_wildcmp_bin, my_strcasecmp_bin, diff --git a/strings/ctype-czech.c b/strings/ctype-czech.c index 2177a18504e..5725e81b15e 100644 --- a/strings/ctype-czech.c +++ b/strings/ctype-czech.c @@ -296,16 +296,18 @@ static int my_strnxfrm_czech(CHARSET_INFO *cs __attribute__((unused)), int value; const uchar * p, * store; int pass = 0; - int totlen = 0; + uint totlen = 0; p = src; store = src; do { NEXT_CMP_VALUE(src, p, store, pass, value, (int)srclen); - ADD_TO_RESULT(dest, (int)len, totlen, value); + ADD_TO_RESULT(dest, len, totlen, value); } while (value); - return totlen; + if (len > totlen) + bfill(dest + totlen, len - totlen, ' '); + return len; } #undef IS_END diff --git a/strings/ctype-gbk.c b/strings/ctype-gbk.c index 0be56e8d946..731ad58a2fb 100644 --- a/strings/ctype-gbk.c +++ b/strings/ctype-gbk.c @@ -2659,6 +2659,7 @@ static int my_strnxfrm_gbk(CHARSET_INFO *cs __attribute__((unused)), const uchar * src, uint srclen) { uint16 e; + uint dstlen= len; len = srclen; while (len--) @@ -2673,7 +2674,9 @@ static int my_strnxfrm_gbk(CHARSET_INFO *cs __attribute__((unused)), } else *dest++ = sort_order_gbk[(uchar) *src++]; } - return srclen; + if (dstlen > srclen) + bfill(dest, dstlen - srclen, ' '); + return dstlen; } diff --git a/strings/ctype-latin1.c b/strings/ctype-latin1.c index 5f1850b7772..32d9a227c2f 100644 --- a/strings/ctype-latin1.c +++ b/strings/ctype-latin1.c @@ -637,7 +637,6 @@ static int my_strnxfrm_latin1_de(CHARSET_INFO *cs __attribute__((unused)), uchar * dest, uint len, const uchar * src, uint srclen) { - const uchar *dest_orig = dest; const uchar *de = dest + len; const uchar *se = src + srclen; for ( ; src < se && dest < de ; src++) @@ -647,7 +646,9 @@ static int my_strnxfrm_latin1_de(CHARSET_INFO *cs __attribute__((unused)), if ((chr=combo2map[*src]) && dest < de) *dest++=chr; } - return (int) (dest - dest_orig); + if (dest < de) + bfill(dest, de - dest, ' '); + return (int) len; } diff --git a/strings/ctype-mb.c b/strings/ctype-mb.c index 3cdf7f460cd..bf69fe683ae 100644 --- a/strings/ctype-mb.c +++ b/strings/ctype-mb.c @@ -412,13 +412,14 @@ static int my_strnncollsp_mb_bin(CHARSET_INFO * cs __attribute__((unused)), static int my_strnxfrm_mb_bin(CHARSET_INFO *cs __attribute__((unused)), - uchar * dest, uint len, - const uchar *src, - uint srclen __attribute__((unused))) + uchar * dest, uint dstlen, + const uchar *src, uint srclen) { if (dest != src) - memcpy(dest,src,len= min(len,srclen)); - return len; + memcpy(dest, src, min(dstlen, srclen)); + if (dstlen > srclen) + bfill(dest + srclen, dstlen - srclen, ' '); + return dstlen; } diff --git a/strings/ctype-simple.c b/strings/ctype-simple.c index a019665a235..5bfa9e52595 100644 --- a/strings/ctype-simple.c +++ b/strings/ctype-simple.c @@ -21,27 +21,68 @@ #include "stdarg.h" +/* + Converts a string into its sort key. + + SYNOPSIS + my_strnxfrm_xxx() + + IMPLEMENTATION + + The my_strxfrm_xxx() function transforms a string pointed to by + 'src' with length 'srclen' according to the charset+collation + pair 'cs' and copies the result key into 'dest'. + + Comparing two strings using memcmp() after my_strnxfrm_xxx() + is equal to comparing two original strings with my_strnncollsp_xxx(). + + Not more than 'dstlen' bytes are written into 'dst'. + To garantee that the whole string is transformed, 'dstlen' must be + at least srclen*cs->strnxfrm_multiply bytes long. Otherwise, + consequent memcmp() may return a non-accurate result. + + If the source string is too short to fill whole 'dstlen' bytes, + then the 'dest' string is padded up to 'dstlen', ensuring that: + + "a" == "a " + "a\0" < "a" + "a\0" < "a " + + my_strnxfrm_simple() is implemented for 8bit charsets and + simple collations with one-to-one string->key transformation. + + See also implementations for various charsets/collations in + other ctype-xxx.c files. + + RETURN + + Target len 'dstlen'. + +*/ + int my_strnxfrm_simple(CHARSET_INFO * cs, uchar *dest, uint len, const uchar *src, uint srclen) { uchar *map= cs->sort_order; + uint dstlen= len; set_if_smaller(len, srclen); if (dest != src) { const uchar *end; for ( end=src+len; src < end ; ) *dest++= map[*src++]; - return len; } else { const uchar *end; for ( end=dest+len; dest < end ; dest++) *dest= (char) map[(uchar) *dest]; - return len; } + if (dstlen > len) + bfill(dest, dstlen - len, ' '); + return dstlen; } int my_strnncoll_simple(CHARSET_INFO * cs, const uchar *s, uint slen, diff --git a/strings/ctype-sjis.c b/strings/ctype-sjis.c index a8b5394f8c5..c0b33a13cdd 100644 --- a/strings/ctype-sjis.c +++ b/strings/ctype-sjis.c @@ -291,7 +291,9 @@ static int my_strnxfrm_sjis(CHARSET_INFO *cs __attribute__((unused)), else *dest++ = sort_order_sjis[(uchar)*src++]; } - return srclen; + if (len > srclen) + bfill(dest, len - srclen, ' '); + return len; } diff --git a/strings/ctype-tis620.c b/strings/ctype-tis620.c index 5d37aa965d9..3a43c556ac8 100644 --- a/strings/ctype-tis620.c +++ b/strings/ctype-tis620.c @@ -631,9 +631,13 @@ int my_strnxfrm_tis620(CHARSET_INFO *cs __attribute__((unused)), uchar * dest, uint len, const uchar * src, uint srclen) { + uint dstlen= len; len= (uint) (strmake((char*) dest, (char*) src, min(len, srclen)) - (char*) dest); - return (int) thai2sortable(dest, len); + len= thai2sortable(dest, len); + if (dstlen > len) + bfill(dest + len, dstlen - len, ' '); + return dstlen; } diff --git a/strings/ctype-uca.c b/strings/ctype-uca.c index 89c876ad10c..4992ef2dcd1 100644 --- a/strings/ctype-uca.c +++ b/strings/ctype-uca.c @@ -7214,8 +7214,7 @@ static int my_strnxfrm_uca(CHARSET_INFO *cs, uchar *dst, uint dstlen, const uchar *src, uint srclen) { - uchar *de = dst + dstlen; - const uchar *dst_orig = dst; + uchar *de = dst + (dstlen & (uint) ~1); // add even length for easier code int s_res; my_uca_scanner scanner; scanner_handler->init(&scanner, cs, src, srclen); @@ -7226,8 +7225,17 @@ static int my_strnxfrm_uca(CHARSET_INFO *cs, dst[1]= s_res & 0xFF; dst+= 2; } - for ( ; dst < de; *dst++='\0'); - return dst - dst_orig; + s_res= cs->sort_order_big[0][0x20 * cs->sort_order[0]]; + while (dst < de) + { + dst[0]= s_res >> 8; + dst[1]= s_res & 0xFF; + dst+= 2; + } + if (dstlen & 1) // if odd number then fill the last char + *dst= '\0'; + + return dstlen; } diff --git a/strings/ctype-ucs2.c b/strings/ctype-ucs2.c index 403d31aa15b..936e2b6fdce 100644 --- a/strings/ctype-ucs2.c +++ b/strings/ctype-ucs2.c @@ -347,7 +347,6 @@ static int my_strnxfrm_ucs2(CHARSET_INFO *cs, int plane; uchar *de = dst + dstlen; const uchar *se = src + srclen; - const uchar *dst_orig = dst; while( src < se && dst < de ) { @@ -367,7 +366,9 @@ static int my_strnxfrm_ucs2(CHARSET_INFO *cs, } dst+=res; } - return dst - dst_orig; + if (dst < de) + cs->cset->fill(cs, dst, de - dst, ' '); + return dstlen; } @@ -1377,7 +1378,9 @@ int my_strnxfrm_ucs2_bin(CHARSET_INFO *cs __attribute__((unused)), { if (dst != src) memcpy(dst,src,srclen= min(dstlen,srclen)); - return srclen; + if (dstlen > srclen) + cs->cset->fill(cs, dst + srclen, dstlen - srclen, ' '); + return dstlen; } diff --git a/strings/ctype-utf8.c b/strings/ctype-utf8.c index ce9346eb475..502d0ec285e 100644 --- a/strings/ctype-utf8.c +++ b/strings/ctype-utf8.c @@ -2228,7 +2228,6 @@ static int my_strnxfrm_utf8(CHARSET_INFO *cs, int plane; uchar *de = dst + dstlen; const uchar *se = src + srclen; - const uchar *dst_orig = dst; while( src < se && dst < de ) { @@ -2248,7 +2247,9 @@ static int my_strnxfrm_utf8(CHARSET_INFO *cs, } dst+=res; } - return dst - dst_orig; + if (dst < de) + bfill(dst, de - dst, ' '); + return dstlen; } static int my_ismbchar_utf8(CHARSET_INFO *cs,const char *b, const char *e) diff --git a/strings/ctype-win1250ch.c b/strings/ctype-win1250ch.c index 4ada3d47bf5..98389a9a5a4 100644 --- a/strings/ctype-win1250ch.c +++ b/strings/ctype-win1250ch.c @@ -503,7 +503,9 @@ static int my_strnxfrm_win1250ch(CHARSET_INFO * cs __attribute__((unused)), dest[totlen] = value; totlen++; } while (value) ; - return totlen; + if (len > totlen) + bfill(dest + totlen, len - totlen, ' '); + return len; } #undef IS_END From 8dc27f1ef94d909f063dd2fa3cea2619eae74518 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 13 Jan 2005 16:15:14 +0200 Subject: [PATCH 0738/1063] InnoDB: Detect the availability of the Mac OS X fsync() work-around at run-time, so that an executable compiled on Mac OS X 10.2 can be run on Mac OS X 10.2 (without the work-around) and Mac OS X 10.3 and later with the work-aroud enabled. innobase/include/srv0start.h: Mac OS X: Add srv_have_fullfsync innobase/os/os0file.c: os_file_flush(): Use F_FULLFSYNC on Mac OS X 10.3, but not on 10.2 innobase/srv/srv0start.c: innobase_start_or_create_for_mysql(): When compiled on OS X 10.2, detect if the binary is running on OS X 10.3 or later, and set srv_have_fullfsync accordingly. --- innobase/include/srv0start.h | 4 ++++ innobase/os/os0file.c | 24 ++++++++++++++++++------ innobase/srv/srv0start.c | 27 +++++++++++++++++++++++++++ 3 files changed, 49 insertions(+), 6 deletions(-) diff --git a/innobase/include/srv0start.h b/innobase/include/srv0start.h index 75af1a212b4..8df0f97c4ff 100644 --- a/innobase/include/srv0start.h +++ b/innobase/include/srv0start.h @@ -75,6 +75,10 @@ extern dulint srv_start_lsn; void set_panic_flag_for_netware(void); #endif +#ifdef HAVE_DARWIN_THREADS +extern ibool srv_have_fullfsync; +#endif + extern ulint srv_sizeof_trx_t_in_ha_innodb_cc; extern ibool srv_is_being_started; diff --git a/innobase/os/os0file.c b/innobase/os/os0file.c index 60760d1f8b8..6fb27346a37 100644 --- a/innobase/os/os0file.c +++ b/innobase/os/os0file.c @@ -1763,19 +1763,31 @@ os_file_flush( #else int ret; -#if defined(HAVE_DARWIN_THREADS) && defined(F_FULLFSYNC) +#if defined(HAVE_DARWIN_THREADS) +# ifndef F_FULLFSYNC + /* The following definition is from the Mac OS X 10.3 */ +# define F_FULLFSYNC 51 /* fsync + ask the drive to flush to the media */ +# elif F_FULLFSYNC != 51 +# error "F_FULLFSYNC != 51: ABI incompatibility with Mac OS X 10.3" +# endif /* Apple has disabled fsync() for internal disk drives in OS X. That caused corruption for a user when he tested a power outage. Let us in OS X use a nonstandard flush method recommended by an Apple engineer. */ - ret = fcntl(file, F_FULLFSYNC, NULL); - - if (ret) { - /* If we are not on a file system that supports this, then - fall back to a plain fsync. */ + if (!srv_have_fullfsync) { + /* If we are not on an operating system that supports this, + then fall back to a plain fsync. */ ret = fsync(file); + } else { + ret = fcntl(file, F_FULLFSYNC, NULL); + + if (ret) { + /* If we are not on a file system that supports this, + then fall back to a plain fsync. */ + ret = fsync(file); + } } #elif HAVE_FDATASYNC ret = fdatasync(file); diff --git a/innobase/srv/srv0start.c b/innobase/srv/srv0start.c index 7a61a885ef9..fe05f07df21 100644 --- a/innobase/srv/srv0start.c +++ b/innobase/srv/srv0start.c @@ -61,6 +61,11 @@ dulint srv_start_lsn; /* Log sequence number at shutdown */ dulint srv_shutdown_lsn; +#ifdef HAVE_DARWIN_THREADS +# include +ibool srv_have_fullfsync = FALSE; +#endif + ibool srv_start_raw_disk_in_use = FALSE; static ibool srv_start_has_been_called = FALSE; @@ -935,6 +940,28 @@ innobase_start_or_create_for_mysql(void) ulint i; ibool srv_file_per_table_original_value = srv_file_per_table; mtr_t mtr; +#ifdef HAVE_DARWIN_THREADS +# ifdef F_FULLFSYNC + /* This executable has been compiled on Mac OS X 10.3 or later. + Assume that F_FULLFSYNC is available at run-time. */ + srv_have_fullfsync = TRUE; +# else /* F_FULLFSYNC */ + /* This executable has been compiled on Mac OS X 10.2 + or earlier. Determine if the executable is running + on Mac OS X 10.3 or later. */ + struct utsname utsname; + if (uname(&utsname)) { + fputs("InnoDB: cannot determine Mac OS X version!\n", stderr); + } else { + srv_have_fullfsync = strcmp(utsname.release, "7.") >= 0; + } + if (!srv_have_fullfsync) { + fputs( +"InnoDB: On Mac OS X, fsync() may be broken on internal drives,\n" +"InnoDB: making transactions unsafe!\n", stderr); + } +# endif /* F_FULLFSYNC */ +#endif /* HAVE_DARWIN_THREADS */ if (sizeof(ulint) != sizeof(void*)) { fprintf(stderr, From 77bba943cb0f51d96acd92e90f38281e9b3f52d5 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 13 Jan 2005 09:05:23 -0800 Subject: [PATCH 0739/1063] Put flags for -max building in BUILD/SETUP.sh so they are consistent across all architectures, and in sync with the flags used to build the MySQL Max packages. Also back-port AMD64 build scripts from 5.0. BUILD/SETUP.sh: Add $max_configs (and variants) and amd64_* BUILD/compile-pentium-debug-max: Use $max_configs BUILD/compile-pentium-debug-max-no-embedded: Use $max_no_es_configs BUILD/compile-pentium-max: Use $max_configs BUILD/compile-pentium-valgrind-max: Use $max_leave_isam_configs BUILD/compile-ppc-debug-max: Use $max_configs BUILD/compile-ppc-max: Use $max_configs --- BUILD/SETUP.sh | 8 ++++++++ BUILD/compile-amd64-debug-max | 12 ++++++++++++ BUILD/compile-amd64-max | 12 ++++++++++++ BUILD/compile-pentium-debug-max | 2 +- BUILD/compile-pentium-debug-max-no-embedded | 2 +- BUILD/compile-pentium-max | 4 +--- BUILD/compile-pentium-valgrind-max | 2 +- BUILD/compile-ppc-debug-max | 2 +- BUILD/compile-ppc-max | 4 +--- 9 files changed, 38 insertions(+), 10 deletions(-) create mode 100755 BUILD/compile-amd64-debug-max create mode 100755 BUILD/compile-amd64-max diff --git a/BUILD/SETUP.sh b/BUILD/SETUP.sh index 5f4233b8371..9e2095cecfa 100644 --- a/BUILD/SETUP.sh +++ b/BUILD/SETUP.sh @@ -41,7 +41,13 @@ global_warnings="-Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wch c_warnings="$global_warnings -Wunused" cxx_warnings="$global_warnings -Woverloaded-virtual -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor" +base_max_configs="--with-innodb --with-bdb --with-ndbcluster --with-archive-storage-engine --with-raid --with-openssl --with-raid --with-vio" +max_leave_isam_configs="--with-innodb --with-bdb --with-ndbcluster --with-archive-storage-engine --with-raid --with-openssl --with-raid --with-vio --with-embedded-server" +max_no_es_configs="$max_leave_isam_configs --without-isam" +max_configs="$max_no_es_configs --with-embedded-server" + alpha_cflags="-mcpu=ev6 -Wa,-mev6" # Not used yet +amd64_cflags="-DBIG_TABLES" pentium_cflags="-mcpu=pentiumpro" ppc_cflags="-mpowerpc -mcpu=powerpc" sparc_cflags="" @@ -55,9 +61,11 @@ reckless_cflags="-O3 -fomit-frame-pointer " debug_cflags="-DUNIV_MUST_NOT_INLINE -DEXTRA_DEBUG -DFORCE_INIT_OF_VARS -DSAFEMALLOC -DPEDANTIC_SAFEMALLOC -DSAFE_MUTEX" base_cxxflags="-felide-constructors -fno-exceptions -fno-rtti" +amd64_cxxflags="-DBIG_TABLES" base_configs="--prefix=/usr/local/mysql --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --with-readline" static_link="--with-mysqld-ldflags=-all-static --with-client-ldflags=-all-static" +amd64_configs="" alpha_configs="" # Not used yet pentium_configs="" sparc_configs="" diff --git a/BUILD/compile-amd64-debug-max b/BUILD/compile-amd64-debug-max new file mode 100755 index 00000000000..466bea73179 --- /dev/null +++ b/BUILD/compile-amd64-debug-max @@ -0,0 +1,12 @@ +#! /bin/sh +path=`dirname $0` +. "$path/SETUP.sh" +base_cxxflags="$amd64_cxxflags $base_cxxflags" +extra_flags="$amd64_cflags $debug_cflags" +c_warnings="$c_warnings $debug_extra_warnings" +cxx_warnings="$cxx_warnings $debug_extra_warnings" +extra_configs="$amd64_configs $debug_configs" + +extra_configs="$extra_configs $max_configs" + +. "$path/FINISH.sh" diff --git a/BUILD/compile-amd64-max b/BUILD/compile-amd64-max new file mode 100755 index 00000000000..4a260859474 --- /dev/null +++ b/BUILD/compile-amd64-max @@ -0,0 +1,12 @@ +#! /bin/sh + +path=`dirname $0` +. "$path/SETUP.sh" +base_cxxflags="$amd64_cxxflags $base_cxxflags" +extra_flags="$amd64_cflags $fast_cflags -g" +extra_configs="$amd64_configs" +#strip=yes + +extra_configs="$extra_configs $max_configs" + +. "$path/FINISH.sh" diff --git a/BUILD/compile-pentium-debug-max b/BUILD/compile-pentium-debug-max index 8894782050c..6487c094cec 100755 --- a/BUILD/compile-pentium-debug-max +++ b/BUILD/compile-pentium-debug-max @@ -8,6 +8,6 @@ c_warnings="$c_warnings $debug_extra_warnings" cxx_warnings="$cxx_warnings $debug_extra_warnings" extra_configs="$pentium_configs $debug_configs" -extra_configs="$extra_configs --with-berkeley-db --with-innodb --without-isam --with-embedded-server --with-openssl --with-raid --with-vio --with-ndbcluster" +extra_configs="$extra_configs $max_configs" . "$path/FINISH.sh" diff --git a/BUILD/compile-pentium-debug-max-no-embedded b/BUILD/compile-pentium-debug-max-no-embedded index 4554e38fdc1..f7a9d966d6d 100755 --- a/BUILD/compile-pentium-debug-max-no-embedded +++ b/BUILD/compile-pentium-debug-max-no-embedded @@ -8,6 +8,6 @@ c_warnings="$c_warnings $debug_extra_warnings" cxx_warnings="$cxx_warnings $debug_extra_warnings" extra_configs="$pentium_configs $debug_configs" -extra_configs="$extra_configs --with-berkeley-db --with-innodb --without-isam --with-openssl --with-raid" +extra_configs="$extra_configs $max_no_es_configs" . "$path/FINISH.sh" diff --git a/BUILD/compile-pentium-max b/BUILD/compile-pentium-max index caf657a2049..de37f28582b 100755 --- a/BUILD/compile-pentium-max +++ b/BUILD/compile-pentium-max @@ -7,8 +7,6 @@ extra_flags="$pentium_cflags $fast_cflags -g" extra_configs="$pentium_configs" #strip=yes -extra_configs="$extra_configs --with-innodb --with-berkeley-db \ - --with-embedded-server --enable-thread-safe-client \ - --with-openssl --with-vio --with-raid --with-ndbcluster" +extra_configs="$extra_configs $max_configs" . "$path/FINISH.sh" diff --git a/BUILD/compile-pentium-valgrind-max b/BUILD/compile-pentium-valgrind-max index fd9543163d6..322b0735488 100755 --- a/BUILD/compile-pentium-valgrind-max +++ b/BUILD/compile-pentium-valgrind-max @@ -9,7 +9,7 @@ cxx_warnings="$cxx_warnings $debug_extra_warnings" extra_configs="$pentium_configs $debug_configs" # We want to test isam when building with valgrind -extra_configs="$extra_configs --with-berkeley-db --with-innodb --with-isam --with-embedded-server --with-openssl --with-vio --with-raid --with-ndbcluster" +extra_configs="$extra_configs $max_leave_isam_configs --with-isam" . "$path/FINISH.sh" diff --git a/BUILD/compile-ppc-debug-max b/BUILD/compile-ppc-debug-max index 9d67b46601a..004e821d722 100755 --- a/BUILD/compile-ppc-debug-max +++ b/BUILD/compile-ppc-debug-max @@ -8,6 +8,6 @@ c_warnings="$c_warnings $debug_extra_warnings" cxx_warnings="$cxx_warnings $debug_extra_warnings" extra_configs="$debug_configs" -extra_configs="$extra_configs --with-berkeley-db --with-innodb --without-isam --with-embedded-server --with-openssl --with-raid --with-vio --with-ndbcluster" +extra_configs="$extra_configs $max_configs" . "$path/FINISH.sh" diff --git a/BUILD/compile-ppc-max b/BUILD/compile-ppc-max index f7193eb8aca..632db7216e4 100755 --- a/BUILD/compile-ppc-max +++ b/BUILD/compile-ppc-max @@ -6,8 +6,6 @@ path=`dirname $0` extra_flags="$ppc_cflags $fast_cflags -g" #strip=yes -extra_configs="$extra_configs --with-innodb --with-berkeley-db \ - --with-embedded-server --enable-thread-safe-client \ - --with-openssl --with-vio --with-raid --with-ndbcluster" +extra_configs="$extra_configs $max_configs" . "$path/FINISH.sh" From d90e3b497f1f89155fdedcb9e3ee8a8ab4f8bf4b Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 13 Jan 2005 19:20:49 +0200 Subject: [PATCH 0740/1063] ha_innodb.cc: Fix a theoretical hang over the adaptive hash latch in InnoDB if one runs INSERT ... SELECT ... (binlog not enabled), or a multi-table UPDATE or DELETE, and only the read tables are InnoDB type, the rest are MyISAM; this also fixes bug #7879 for InnoDB type tables sql/ha_innodb.cc: Fix a theoretical hang over the adaptive hash latch in InnoDB if one runs INSERT ... SELECT ... (binlog not enabled), or a multi-table UPDATE or DELETE, and only the read tables are InnoDB type, the rest are MyISAM; this also fixes bug #7879 for InnoDB type tables --- sql/ha_innodb.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index 54d93783481..2e441b4f085 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -4927,7 +4927,9 @@ ha_innobase::store_lock( if ((lock_type == TL_READ && thd->in_lock_tables) || (lock_type == TL_READ_HIGH_PRIORITY && thd->in_lock_tables) || lock_type == TL_READ_WITH_SHARED_LOCKS || - lock_type == TL_READ_NO_INSERT) { + lock_type == TL_READ_NO_INSERT || + thd->lex.sql_command != SQLCOM_SELECT) { + /* The OR cases above are in this order: 1) MySQL is doing LOCK TABLES ... READ LOCAL, or 2) (we do not know when TL_READ_HIGH_PRIORITY is used), or @@ -4935,7 +4937,10 @@ ha_innobase::store_lock( 4) we are doing a complex SQL statement like INSERT INTO ... SELECT ... and the logical logging (MySQL binlog) requires the use of a locking read, or - MySQL is doing LOCK TABLES ... READ. */ + MySQL is doing LOCK TABLES ... READ. + 5) we let InnoDB do locking reads for all SQL statements that + are not simple SELECTs; note that select_lock_type in this + case may get strengthened in ::external_lock() to LOCK_X. */ prebuilt->select_lock_type = LOCK_S; prebuilt->stored_select_lock_type = LOCK_S; From a28f221f35622b799e34a6e05c66555a6ffe9b81 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 13 Jan 2005 18:22:35 +0100 Subject: [PATCH 0741/1063] Add test cases to verify that SHOW CREATE TABLE always outputs the key algorithm for keys where they were explicitly specified. mysql-test/r/show_check.result: Add results mysql-test/t/show_check.test: Add tests for preservation of key algorithm in SHOW CREATE TABLE output --- mysql-test/r/show_check.result | 70 ++++++++++++++++++++++++++++++++++ mysql-test/t/show_check.test | 32 ++++++++++++++++ 2 files changed, 102 insertions(+) diff --git a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result index 0afe45eb5e5..37531f05f43 100644 --- a/mysql-test/r/show_check.result +++ b/mysql-test/r/show_check.result @@ -405,3 +405,73 @@ where user='mysqltest_1' || user='mysqltest_2' || user='mysqltest_3'; delete from mysql.db where user='mysqltest_1' || user='mysqltest_2' || user='mysqltest_3'; flush privileges; +CREATE TABLE t1 (i int, KEY (i)) ENGINE=MEMORY; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `i` int(11) default NULL, + KEY `i` (`i`) +) ENGINE=HEAP DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (i int, KEY USING HASH (i)) ENGINE=MEMORY; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `i` int(11) default NULL, + KEY `i` TYPE HASH (`i`) +) ENGINE=HEAP DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (i int, KEY USING BTREE (i)) ENGINE=MEMORY; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `i` int(11) default NULL, + KEY `i` TYPE BTREE (`i`) +) ENGINE=HEAP DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (i int, KEY (i)) ENGINE=MyISAM; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `i` int(11) default NULL, + KEY `i` (`i`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (i int, KEY USING BTREE (i)) ENGINE=MyISAM; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `i` int(11) default NULL, + KEY `i` TYPE BTREE (`i`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (i int, KEY (i)) ENGINE=MyISAM; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `i` int(11) default NULL, + KEY `i` (`i`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +ALTER TABLE t1 ENGINE=MEMORY; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `i` int(11) default NULL, + KEY `i` (`i`) +) ENGINE=HEAP DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (i int, KEY USING BTREE (i)) ENGINE=MyISAM; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `i` int(11) default NULL, + KEY `i` TYPE BTREE (`i`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +ALTER TABLE t1 ENGINE=MEMORY; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `i` int(11) default NULL, + KEY `i` TYPE BTREE (`i`) +) ENGINE=HEAP DEFAULT CHARSET=latin1 +DROP TABLE t1; diff --git a/mysql-test/t/show_check.test b/mysql-test/t/show_check.test index 7788215dd27..cd8d4dba6ab 100644 --- a/mysql-test/t/show_check.test +++ b/mysql-test/t/show_check.test @@ -321,3 +321,35 @@ flush privileges; #--replace_column 7 # 8 # 9 # #show table status from `ä` LIKE 'ä'; #drop database `ä`; + +# Test that USING is always shown in SHOW CREATE TABLE when it was +# specified during table creation, but not otherwise. (Bug #7235) +CREATE TABLE t1 (i int, KEY (i)) ENGINE=MEMORY; +SHOW CREATE TABLE t1; +DROP TABLE t1; +CREATE TABLE t1 (i int, KEY USING HASH (i)) ENGINE=MEMORY; +SHOW CREATE TABLE t1; +DROP TABLE t1; +CREATE TABLE t1 (i int, KEY USING BTREE (i)) ENGINE=MEMORY; +SHOW CREATE TABLE t1; +DROP TABLE t1; +CREATE TABLE t1 (i int, KEY (i)) ENGINE=MyISAM; +SHOW CREATE TABLE t1; +DROP TABLE t1; +CREATE TABLE t1 (i int, KEY USING BTREE (i)) ENGINE=MyISAM; +SHOW CREATE TABLE t1; +DROP TABLE t1; +# Test that when an index is created with the default key algorithm and +# altered to another storage engine, it gets the default key algorithm +# for that storage engine, but when it is specified, the specified type is +# preserved. +CREATE TABLE t1 (i int, KEY (i)) ENGINE=MyISAM; +SHOW CREATE TABLE t1; +ALTER TABLE t1 ENGINE=MEMORY; +SHOW CREATE TABLE t1; +DROP TABLE t1; +CREATE TABLE t1 (i int, KEY USING BTREE (i)) ENGINE=MyISAM; +SHOW CREATE TABLE t1; +ALTER TABLE t1 ENGINE=MEMORY; +SHOW CREATE TABLE t1; +DROP TABLE t1; From 97f5b3260037f013918e71ab0c8f01494ae707e5 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 13 Jan 2005 20:08:28 +0200 Subject: [PATCH 0742/1063] ha_innodb.cc: Merge from 4.0: Fix a theoretical hang over the adaptive hash latch in InnoDB if one runs INSERT ... SELECT ... (binlog not enabled), or a multi-table UPDATE or DELETE, and only the read tables are InnoDB type, the rest are MyISAM; this also fixes bug #7879 for InnoDB type tables sql/ha_innodb.cc: Merge from 4.0: Fix a theoretical hang over the adaptive hash latch in InnoDB if one runs INSERT ... SELECT ... (binlog not enabled), or a multi-table UPDATE or DELETE, and only the read tables are InnoDB type, the rest are MyISAM; this also fixes bug #7879 for InnoDB type tables --- sql/ha_innodb.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index 14b143ca04b..4c13902c31e 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -5265,7 +5265,9 @@ ha_innobase::store_lock( if ((lock_type == TL_READ && thd->in_lock_tables) || (lock_type == TL_READ_HIGH_PRIORITY && thd->in_lock_tables) || lock_type == TL_READ_WITH_SHARED_LOCKS || - lock_type == TL_READ_NO_INSERT) { + lock_type == TL_READ_NO_INSERT || + thd->lex->sql_command != SQLCOM_SELECT) { + /* The OR cases above are in this order: 1) MySQL is doing LOCK TABLES ... READ LOCAL, or 2) (we do not know when TL_READ_HIGH_PRIORITY is used), or @@ -5273,7 +5275,10 @@ ha_innobase::store_lock( 4) we are doing a complex SQL statement like INSERT INTO ... SELECT ... and the logical logging (MySQL binlog) requires the use of a locking read, or - MySQL is doing LOCK TABLES ... READ. */ + MySQL is doing LOCK TABLES ... READ. + 5) we let InnoDB do locking reads for all SQL statements that + are not simple SELECTs; note that select_lock_type in this + case may get strengthened in ::external_lock() to LOCK_X. */ prebuilt->select_lock_type = LOCK_S; prebuilt->stored_select_lock_type = LOCK_S; From e667cf91daa8cc07ebbaf1484a5e5e1ab6590109 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 13 Jan 2005 11:58:10 -0800 Subject: [PATCH 0743/1063] Fix mysql_install_db to look for libexecdir relative to basedir when it has been specified. (Bug #7347) scripts/mysql_install_db.sh: When basedir is specified, look for libexecdir relative to that --- scripts/mysql_install_db.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index f9f3160d220..8d47d67792a 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -98,9 +98,9 @@ else if test -x "$basedir/libexec/mysqld" then execdir="$basedir/libexec" -elif test -x "@libexecdir@/mysqld" +elif test -x "$basedir/sbin/mysqld" then - execdir="@libexecdir@" + execdir="$basedir/sbin" else execdir="$basedir/bin" fi From 177e99f32719b9c20c55c19fbbc9cef09550d9e1 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 14 Jan 2005 00:09:15 +0200 Subject: [PATCH 0744/1063] Fix bug in INSERT DELAYED with prepared statements The bug was that if you have two TL_WRITE_DELAYED at the same time, mi_lock_databases() could be done in the wrong order and we could write the wrong header to the MyISAM index file. sql/mysql_priv.h: Fix bug in insert delayed with prepared statements sql/sql_base.cc: Fix bug in insert delayed with prepared statements sql/sql_prepare.cc: Fix bug in insert delayed with prepared statements The bug was that if you have two TL_WRITE_DELAYED at the same time, mi_lock_databases() could be done in the wrong order and we could write the wrong header to the MyISAM index file. --- sql/mysql_priv.h | 1 + sql/sql_base.cc | 28 ++++++++++++++++++++++++++++ sql/sql_prepare.cc | 6 +++++- 3 files changed, 34 insertions(+), 1 deletion(-) diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 204b319138e..4b785aafc5f 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -725,6 +725,7 @@ void wait_for_refresh(THD *thd); int open_tables(THD *thd, TABLE_LIST *tables, uint *counter); int simple_open_n_lock_tables(THD *thd,TABLE_LIST *tables); int open_and_lock_tables(THD *thd,TABLE_LIST *tables); +int open_normal_and_derived_tables(THD *thd, TABLE_LIST *tables); void relink_tables_for_derived(THD *thd); int lock_tables(THD *thd, TABLE_LIST *tables, uint counter); TABLE *open_temporary_table(THD *thd, const char *path, const char *db, diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 2f2d9b290ac..263c68a82b7 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -1702,6 +1702,34 @@ int open_and_lock_tables(THD *thd, TABLE_LIST *tables) } +/* + Open all tables in list and process derived tables + + SYNOPSIS + open_normal_and_derived_tables + thd - thread handler + tables - list of tables for open&locking + + RETURN + FALSE - ok + TRUE - error + + NOTE + This is to be used on prepare stage when you don't read any + data from the tables. +*/ + +int open_normal_and_derived_tables(THD *thd, TABLE_LIST *tables) +{ + uint counter; + DBUG_ENTER("open_normal_and_derived_tables"); + if (open_tables(thd, tables, &counter)) + DBUG_RETURN(-1); /* purecov: inspected */ + relink_tables_for_derived(thd); + DBUG_RETURN(mysql_handle_derived(thd->lex)); +} + + /* Let us propagate pointers to open tables from global table list to table lists in particular selects if needed. diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index ecf01824755..1dc46aef4da 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -897,8 +897,12 @@ static int mysql_test_insert(Prepared_statement *stmt, /* open temporary memory pool for temporary data allocated by derived tables & preparation procedure + Note that this is done without locks (should not be needed as we will not + access any data here) + If we would use locks, then we have to ensure we are not using + TL_WRITE_DELAYED as having two such locks can cause table corruption. */ - if (open_and_lock_tables(thd, table_list)) + if (open_normal_and_derived_tables(thd, table_list)) { DBUG_RETURN(-1); } From 653db58bee2755c80642549b4536832ddaa200eb Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 14 Jan 2005 01:59:03 +0300 Subject: [PATCH 0745/1063] fix C++ comments in C file (fixed in 5.0 already) strings/ctype-uca.c: fix C++ comments in C file --- strings/ctype-uca.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/strings/ctype-uca.c b/strings/ctype-uca.c index 4992ef2dcd1..452ca263433 100644 --- a/strings/ctype-uca.c +++ b/strings/ctype-uca.c @@ -7214,7 +7214,7 @@ static int my_strnxfrm_uca(CHARSET_INFO *cs, uchar *dst, uint dstlen, const uchar *src, uint srclen) { - uchar *de = dst + (dstlen & (uint) ~1); // add even length for easier code + uchar *de = dst + (dstlen & (uint) ~1); /* add even length for easier code */ int s_res; my_uca_scanner scanner; scanner_handler->init(&scanner, cs, src, srclen); @@ -7232,7 +7232,7 @@ static int my_strnxfrm_uca(CHARSET_INFO *cs, dst[1]= s_res & 0xFF; dst+= 2; } - if (dstlen & 1) // if odd number then fill the last char + if (dstlen & 1) /* if odd number then fill the last char */ *dst= '\0'; return dstlen; From b06801534a79d9cfe1e077f8ed0a4dfd3c779877 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 14 Jan 2005 16:23:32 +0300 Subject: [PATCH 0746/1063] Backport from 5.0 --- strings/ctype-mb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/strings/ctype-mb.c b/strings/ctype-mb.c index bf69fe683ae..731fc460cef 100644 --- a/strings/ctype-mb.c +++ b/strings/ctype-mb.c @@ -274,7 +274,7 @@ uint my_well_formed_len_mb(CHARSET_INFO *cs, my_wc_t wc; int mblen; - if ((mblen= cs->cset->mb_wc(cs, &wc, (uchar*) b, (uchar*) e)) <0) + if ((mblen= cs->cset->mb_wc(cs, &wc, (uchar*) b, (uchar*) e)) <= 0) break; b+= mblen; pos--; From 18df9d391fefd95b09c508aa161bae014a822353 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 14 Jan 2005 15:35:32 +0100 Subject: [PATCH 0747/1063] - make sure to enable "--without-ndb-debug" when both --debug and --with-cluster are provided. Yes, this sounds like a contradiction - enabling debugging in NBD enables code parts that may still reveal portability issues when compiled with non-gcc compilers. (request by TomasU) --- Build-tools/Do-compile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Build-tools/Do-compile b/Build-tools/Do-compile index 1e7041e8f7a..b431f9fc1c5 100755 --- a/Build-tools/Do-compile +++ b/Build-tools/Do-compile @@ -264,7 +264,8 @@ if ($opt_stage <= 1) $opt_config_options.= " --with-berkeley-db" if ($opt_bdb); $opt_config_options.= " --with-zlib-dir=bundled" if ($opt_bundled_zlib); $opt_config_options.= " --with-client-ldflags=-all-static" if ($opt_static_client); - $opt_config_options.= " --with-debug" if ($opt_with_debug); + $opt_config_options.= " --with-debug" if ($opt_with_debug); + $opt_config_options.= " --without-ndb-debug" if ($opt_with_debug && $opt_with_cluster); $opt_config_options.= " --with-libwrap" if ($opt_libwrap); $opt_config_options.= " --with-low-memory" if ($opt_with_low_memory); $opt_config_options.= " --with-mysqld-ldflags=-all-static" if ($opt_static_server); From b3c7c4d74cf38ed4a913031ead04c44e16db0d18 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 14 Jan 2005 16:14:50 +0100 Subject: [PATCH 0748/1063] bumped up ndb version compatible with 4.1.9 configure.in: bumped up ndb version --- configure.in | 2 +- ndb/src/common/util/version.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 45ca009123e..9f89c635e7f 100644 --- a/configure.in +++ b/configure.in @@ -16,7 +16,7 @@ SHARED_LIB_VERSION=14:0:0 # ndb version NDB_VERSION_MAJOR=4 NDB_VERSION_MINOR=1 -NDB_VERSION_BUILD=9 +NDB_VERSION_BUILD=10 NDB_VERSION_STATUS="" # Set all version vars based on $VERSION. How do we do this more elegant ? diff --git a/ndb/src/common/util/version.c b/ndb/src/common/util/version.c index 9bc3488b078..8cc6de0fc24 100644 --- a/ndb/src/common/util/version.c +++ b/ndb/src/common/util/version.c @@ -90,6 +90,7 @@ void ndbSetOwnVersion() {} #ifndef TEST_VERSION struct NdbUpGradeCompatible ndbCompatibleTable_full[] = { + { MAKE_VERSION(4,1,10), MAKE_VERSION(4,1,9), UG_Exact }, { MAKE_VERSION(4,1,9), MAKE_VERSION(4,1,8), UG_Exact }, { MAKE_VERSION(3,5,2), MAKE_VERSION(3,5,1), UG_Exact }, { 0, 0, UG_Null } From baf0a4418acad481796523e76f66f12706c262c0 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 14 Jan 2005 18:20:03 +0100 Subject: [PATCH 0749/1063] - replaced obsoleted "BuildPrereq" with "BuildRequires" in the RPM spec file support-files/mysql.spec.sh: - replaced obsoleted "BuildPrereq" with "BuildRequires" instead --- support-files/mysql.spec.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index 5afddee609b..99280385965 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -27,7 +27,7 @@ Packager: Lenz Grimmer Vendor: MySQL AB Requires: fileutils sh-utils Provides: msqlormysql MySQL-server mysql -BuildPrereq: ncurses-devel +BuildRequires: ncurses-devel Obsoletes: mysql # Think about what you use here since the first step is to @@ -607,6 +607,10 @@ fi # itself - note that they must be ordered by date (important when # merging BK trees) %changelog +* Fri Jan 14 2005 Lenz Grimmer + +- replaced obsoleted "BuildPrereq" with "BuildRequires" instead + * Thu Dec 31 2004 Lenz Grimmer - enabled the "Archive" storage engine for the max binary From b7efd8174a9e46ae89337b0364f132a574dc6c2f Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 14 Jan 2005 19:49:45 +0100 Subject: [PATCH 0750/1063] limit HEAP table size with max_heap_table_size, better estimation for mem_per_row heap/hp_create.c: limit HEAP table size with max_heap_table_size heap/hp_write.c: limit HEAP table size with max_heap_table_size include/heap.h: limit HEAP table size with max_heap_table_size sql/ha_heap.cc: limit HEAP table size with max_heap_table_size better estimation for mem_per_row --- heap/hp_create.c | 7 ++++--- heap/hp_write.c | 3 ++- include/heap.h | 7 ++++--- sql/ha_heap.cc | 24 ++++++++++++++++++------ 4 files changed, 28 insertions(+), 13 deletions(-) diff --git a/heap/hp_create.c b/heap/hp_create.c index fdfe78a1e09..af32fefea1b 100644 --- a/heap/hp_create.c +++ b/heap/hp_create.c @@ -123,15 +123,15 @@ int heap_create(const char *name, uint keys, HP_KEYDEF *keydef, keyseg->flag= 0; keyseg->null_bit= 0; keyseg++; - - init_tree(&keyinfo->rb_tree, 0, 0, sizeof(byte*), + + init_tree(&keyinfo->rb_tree, 0, 0, sizeof(byte*), (qsort_cmp2)keys_compare, 1, NULL, NULL); keyinfo->delete_key= hp_rb_delete_key; keyinfo->write_key= hp_rb_write_key; } else { - init_block(&keyinfo->block, sizeof(HASH_INFO), min_records, + init_block(&keyinfo->block, sizeof(HASH_INFO), min_records, max_records); keyinfo->delete_key= hp_delete_key; keyinfo->write_key= hp_write_key; @@ -140,6 +140,7 @@ int heap_create(const char *name, uint keys, HP_KEYDEF *keydef, } share->min_records= min_records; share->max_records= max_records; + share->max_table_size= create_info->max_table_size; share->data_length= share->index_length= 0; share->reclength= reclength; share->blength= 1; diff --git a/heap/hp_write.c b/heap/hp_write.c index 43cee67b39c..808fe6608b1 100644 --- a/heap/hp_write.c +++ b/heap/hp_write.c @@ -143,7 +143,8 @@ static byte *next_free_record_pos(HP_SHARE *info) } if (!(block_pos=(info->records % info->block.records_in_block))) { - if (info->records > info->max_records && info->max_records) + if ((info->records > info->max_records && info->max_records) || + (info->data_length + info->index_length >= info->max_table_size)) { my_errno=HA_ERR_RECORD_FILE_FULL; DBUG_RETURN(NULL); diff --git a/include/heap.h b/include/heap.h index 5e83a6e2cb5..ac2b38d1f2d 100644 --- a/include/heap.h +++ b/include/heap.h @@ -125,8 +125,8 @@ typedef struct st_hp_keydef /* Key definition with open */ TREE rb_tree; int (*write_key)(struct st_heap_info *info, struct st_hp_keydef *keyinfo, const byte *record, byte *recpos); - int (*delete_key)(struct st_heap_info *info, struct st_hp_keydef *keyinfo, - const byte *record, byte *recpos, int flag); + int (*delete_key)(struct st_heap_info *info, struct st_hp_keydef *keyinfo, + const byte *record, byte *recpos, int flag); uint (*get_key_length)(struct st_hp_keydef *keydef, const byte *key); } HP_KEYDEF; @@ -135,7 +135,7 @@ typedef struct st_heap_share HP_BLOCK block; HP_KEYDEF *keydef; ulong min_records,max_records; /* Params to open */ - ulong data_length,index_length; + ulong data_length,index_length,max_table_size; uint records; /* records */ uint blength; /* records rounded up to 2^n */ uint deleted; /* Deleted records in database */ @@ -185,6 +185,7 @@ typedef struct st_heap_create_info { uint auto_key; uint auto_key_type; + ulong max_table_size; ulonglong auto_increment; } HP_CREATE_INFO; diff --git a/sql/ha_heap.cc b/sql/ha_heap.cc index dbcf7bc9197..96c19ce0705 100644 --- a/sql/ha_heap.cc +++ b/sql/ha_heap.cc @@ -460,12 +460,24 @@ int ha_heap::create(const char *name, TABLE *table_arg, KEY_PART_INFO *key_part= pos->key_part; KEY_PART_INFO *key_part_end= key_part + pos->key_parts; - mem_per_row+= (pos->key_length + (sizeof(char*) * 2)); - keydef[key].keysegs= (uint) pos->key_parts; keydef[key].flag= (pos->flags & (HA_NOSAME | HA_NULL_ARE_EQUAL)); keydef[key].seg= seg; - keydef[key].algorithm= ((pos->algorithm == HA_KEY_ALG_UNDEF) ? + + switch (pos->algorithm) { + case HA_KEY_ALG_UNDEF: + case HA_KEY_ALG_HASH: + keydef[key].algorithm= HA_KEY_ALG_HASH; + mem_per_row+= sizeof(char*) * 2; // = sizeof(HASH_INFO) + break; + case HA_KEY_ALG_BTREE: + keydef[key].algorithm= HA_KEY_ALG_BTREE; + mem_per_row+=sizeof(TREE_ELEMENT)+pos->key_length+sizeof(char*); + break; + default: + DBUG_ASSERT(0); // cannot happen + } + keydef[key].algorithm= ((pos->algorithm == HA_KEY_ALG_UNDEF) ? HA_KEY_ALG_HASH : pos->algorithm); for (; key_part != key_part_end; key_part++, seg++) @@ -501,17 +513,17 @@ int ha_heap::create(const char *name, TABLE *table_arg, } } mem_per_row+= MY_ALIGN(table_arg->reclength + 1, sizeof(char*)); - max_rows = (ha_rows) (current_thd->variables.max_heap_table_size / - mem_per_row); HP_CREATE_INFO hp_create_info; hp_create_info.auto_key= auto_key; hp_create_info.auto_key_type= auto_key_type; hp_create_info.auto_increment= (create_info->auto_increment_value ? create_info->auto_increment_value - 1 : 0); + hp_create_info.max_table_size=current_thd->variables.max_heap_table_size; + max_rows = (ha_rows) (hp_create_info.max_table_size / mem_per_row); error= heap_create(fn_format(buff,name,"","",4+2), table_arg->keys,keydef, table_arg->reclength, (ulong) ((table_arg->max_rows < max_rows && - table_arg->max_rows) ? + table_arg->max_rows) ? table_arg->max_rows : max_rows), (ulong) table_arg->min_rows, &hp_create_info); my_free((gptr) keydef, MYF(0)); From 60c1541524d2cd8877162b3c9f3f98321d06fafd Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 14 Jan 2005 22:46:04 +0100 Subject: [PATCH 0751/1063] protect against malicious server trying to crash command-line client :) --- client/mysql.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/client/mysql.cc b/client/mysql.cc index 739cc77bd14..b9251361a01 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -172,7 +172,7 @@ static char *shared_memory_base_name=0; #endif static uint opt_protocol=0; static CHARSET_INFO *charset_info= &my_charset_latin1; - + #include "sslopt-vars.h" const char *default_dbug_option="d:t:o,/tmp/mysql.trace"; @@ -1520,7 +1520,7 @@ You can turn off this feature to get a quicker startup with -A\n\n"); j=0; while ((sql_field=mysql_fetch_field(fields))) { - sprintf(buf,"%s.%s",table_row[0],sql_field->name); + sprintf(buf,"%.64s.%.64s",table_row[0],sql_field->name); field_names[i][j] = strdup_root(&hash_mem_root,buf); add_word(&ht,field_names[i][j]); field_names[i][num_fields+j] = strdup_root(&hash_mem_root, @@ -1597,7 +1597,7 @@ int mysql_real_query_for_lazy(const char *buf, int length) for (uint retry=0;; retry++) { if (!mysql_real_query(&mysql,buf,length)) - return 0; + return 0; int error= put_error(&mysql); if (mysql_errno(&mysql) != CR_SERVER_GONE_ERROR || retry > 1 || !opt_reconnect) @@ -2526,7 +2526,7 @@ com_connect(String *buffer, char *line) { sprintf(buff,"Connection id: %lu",mysql_thread_id(&mysql)); put_info(buff,INFO_INFO); - sprintf(buff,"Current database: %s\n", + sprintf(buff,"Current database: %.128s\n", current_db ? current_db : "*** NONE ***"); put_info(buff,INFO_INFO); } From ae8cc9846f506ca28b91eb95144a0cd011d20346 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 15 Jan 2005 01:06:15 +0200 Subject: [PATCH 0752/1063] dict0load.c, dict0crea.c: Add diagnostic code to track corruption in mix_len; it was reported on the mailing list Jan 14, 2005 innobase/dict/dict0crea.c: Add diagnostic code to track corruption in mix_len; it was reported on the mailing list Jan 14, 2005 innobase/dict/dict0load.c: Add diagnostic code to track corruption in mix_len; it was reported on the mailing list Jan 14, 2005 --- innobase/dict/dict0crea.c | 11 +++++++++++ innobase/dict/dict0load.c | 17 +++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/innobase/dict/dict0crea.c b/innobase/dict/dict0crea.c index cbdc0aab53c..d9e89316613 100644 --- a/innobase/dict/dict0crea.c +++ b/innobase/dict/dict0crea.c @@ -81,6 +81,17 @@ dict_create_sys_tables_tuple( dfield_set_data(dfield, ptr, 8); /* 7: MIX_LEN --------------------------*/ + + /* Track corruption reported on mailing list Jan 14, 2005 */ + if (table->mix_len != 0 && table->mix_len != 0x80000000) { + fprintf(stderr, +"InnoDB: Error: mix_len is %lu in table %s\n", (ulong)table->mix_len, + table->name); + mem_analyze_corruption((byte*)&(table->mix_len)); + + ut_error; + } + dfield = dtuple_get_nth_field(entry, 5); ptr = mem_heap_alloc(heap, 4); diff --git a/innobase/dict/dict0load.c b/innobase/dict/dict0load.c index 61facc8818d..e52c81c82e8 100644 --- a/innobase/dict/dict0load.c +++ b/innobase/dict/dict0load.c @@ -729,6 +729,7 @@ dict_load_table( ulint space; ulint n_cols; ulint err; + ulint mix_len; mtr_t mtr; #ifdef UNIV_SYNC_DEBUG @@ -775,6 +776,22 @@ dict_load_table( return(NULL); } + /* Track a corruption bug reported on the MySQL mailing list Jan 14, + 2005: mix_id had a value different from 0 */ + + field = rec_get_nth_field(rec, 7, &len); + ut_a(len == 4); + + mix_len = mach_read_from_4(field); + + if (mix_len != 0 && mix_len != 0x80000000) { + ut_print_timestamp(stderr); + + fprintf(stderr, + " InnoDB: table %s has a nonsensical mix len %lu\n", + name, (ulong)mix_len); + } + #if MYSQL_VERSION_ID < 50300 /* Starting from MySQL 5.0.3, the high-order bit of MIX_LEN is the "compact format" flag. */ From 540f0541ddb6039f174dd14eaeb6ffd229ce8cf0 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 15 Jan 2005 01:10:40 +0200 Subject: [PATCH 0753/1063] dict0load.c: Correct typo in comment innobase/dict/dict0load.c: Correct typo in comment --- innobase/dict/dict0load.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/innobase/dict/dict0load.c b/innobase/dict/dict0load.c index e52c81c82e8..717c64c3963 100644 --- a/innobase/dict/dict0load.c +++ b/innobase/dict/dict0load.c @@ -777,7 +777,7 @@ dict_load_table( } /* Track a corruption bug reported on the MySQL mailing list Jan 14, - 2005: mix_id had a value different from 0 */ + 2005: mix_len had a value different from 0 */ field = rec_get_nth_field(rec, 7, &len); ut_a(len == 4); From deac81af88c0bc424126d3a9d3d4aaeca2a6770c Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 15 Jan 2005 03:47:06 +0200 Subject: [PATCH 0754/1063] Fixed possible access to unintialized memory in filesort when using many buffers include/my_sys.h: Added function to call if IO_CACHE is moved mysys/mf_iocache.c: Added function to call if IO_CACHE is moved sql/filesort.cc: Tell that io_cache is moved --- include/my_sys.h | 1 + mysys/mf_iocache.c | 51 ++++++++++++++++++++++++++++++++-------------- sql/filesort.cc | 2 ++ 3 files changed, 39 insertions(+), 15 deletions(-) diff --git a/include/my_sys.h b/include/my_sys.h index 9e43889d0e0..0fdb8d640e7 100644 --- a/include/my_sys.h +++ b/include/my_sys.h @@ -671,6 +671,7 @@ extern int init_io_cache(IO_CACHE *info,File file,uint cachesize, extern my_bool reinit_io_cache(IO_CACHE *info,enum cache_type type, my_off_t seek_offset,pbool use_async_io, pbool clear_cache); +extern void setup_io_cache(IO_CACHE* info); extern int _my_b_read(IO_CACHE *info,byte *Buffer,uint Count); #ifdef THREAD extern int _my_b_read_r(IO_CACHE *info,byte *Buffer,uint Count); diff --git a/mysys/mf_iocache.c b/mysys/mf_iocache.c index 8fb93dc4780..a7937da0cc2 100644 --- a/mysys/mf_iocache.c +++ b/mysys/mf_iocache.c @@ -71,9 +71,40 @@ static void my_aiowait(my_aio_result *result); #define IO_ROUND_UP(X) (((X)+IO_SIZE-1) & ~(IO_SIZE-1)) #define IO_ROUND_DN(X) ( (X) & ~(IO_SIZE-1)) -static void -init_functions(IO_CACHE* info, enum cache_type type) + +/* + Setup internal pointers inside IO_CACHE + + SYNOPSIS + setup_io_cache() + info IO_CACHE handler + + NOTES + This is called on automaticly on init or reinit of IO_CACHE + It must be called externally if one moves or copies an IO_CACHE + object. +*/ + +void setup_io_cache(IO_CACHE* info) { + /* Ensure that my_b_tell() and my_b_bytes_in_cache works */ + if (info->type == WRITE_CACHE) + { + info->current_pos= &info->write_pos; + info->current_end= &info->write_end; + } + else + { + info->current_pos= &info->read_pos; + info->current_end= &info->read_end; + } +} + + +static void +init_functions(IO_CACHE* info) +{ + enum cache_type type= info->type; switch (type) { case READ_NET: /* @@ -97,17 +128,7 @@ init_functions(IO_CACHE* info, enum cache_type type) info->write_function = _my_b_write; } - /* Ensure that my_b_tell() and my_b_bytes_in_cache works */ - if (type == WRITE_CACHE) - { - info->current_pos= &info->write_pos; - info->current_end= &info->write_end; - } - else - { - info->current_pos= &info->read_pos; - info->current_end= &info->read_end; - } + setup_io_cache(info); } /* @@ -211,7 +232,7 @@ int init_io_cache(IO_CACHE *info, File file, uint cachesize, /* End_of_file may be changed by user later */ info->end_of_file= end_of_file; info->error=0; - init_functions(info,type); + init_functions(info); #ifdef HAVE_AIOWAIT if (use_async_io && ! my_disable_async_io) { @@ -333,7 +354,7 @@ my_bool reinit_io_cache(IO_CACHE *info, enum cache_type type, } info->type=type; info->error=0; - init_functions(info,type); + init_functions(info); #ifdef HAVE_AIOWAIT if (use_async_io && ! my_disable_async_io && diff --git a/sql/filesort.cc b/sql/filesort.cc index ae6895b26b9..fe42f391007 100644 --- a/sql/filesort.cc +++ b/sql/filesort.cc @@ -680,6 +680,8 @@ int merge_many_buff(SORTPARAM *param, uchar *sort_buffer, if (flush_io_cache(to_file)) break; /* purecov: inspected */ temp=from_file; from_file=to_file; to_file=temp; + setup_io_cache(from_file); + setup_io_cache(to_file); *maxbuffer= (uint) (lastbuff-buffpek)-1; } close_cached_file(to_file); // This holds old result From 16f3170e7352b06a8b142bfef89bbcc383c2a676 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 15 Jan 2005 01:05:00 -0800 Subject: [PATCH 0755/1063] func_gconcat.result, func_gconcat.test: Added a test case for bug #7769. item_sum.h: Fixed bug #7769: a crash for queries with group_concat and having when the query table was empty. The bug was due an unsafe dereferencing. sql/item_sum.h: Fixed bug #7769: a crash for queries with group_concat and having when the query table was empty. The bug was due an unsafe dereferencing. mysql-test/t/func_gconcat.test: Added a test case for bug #7769. mysql-test/r/func_gconcat.result: Added a test case for bug #7769. --- mysql-test/r/func_gconcat.result | 5 +++++ mysql-test/t/func_gconcat.test | 7 +++++++ sql/item_sum.h | 5 +++-- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/func_gconcat.result b/mysql-test/r/func_gconcat.result index aa202823c77..390b33fdddc 100644 --- a/mysql-test/r/func_gconcat.result +++ b/mysql-test/r/func_gconcat.result @@ -457,3 +457,8 @@ group_concat(distinct b order by b) Warnings: Warning 1260 2 line(s) were cut by GROUP_CONCAT() drop table t1; +CREATE TABLE t1 (id int); +SELECT GROUP_CONCAT(id) AS gc FROM t1 HAVING gc IS NULL; +gc +NULL +DROP TABLE t1; diff --git a/mysql-test/t/func_gconcat.test b/mysql-test/t/func_gconcat.test index e0737a42221..6a91a7ac9c7 100644 --- a/mysql-test/t/func_gconcat.test +++ b/mysql-test/t/func_gconcat.test @@ -277,3 +277,10 @@ select group_concat(b order by b) from t1 group by a; select group_concat(distinct b order by b) from t1 group by a; drop table t1; + +# +# bug #7769: group_concat returning null is checked in having +# +CREATE TABLE t1 (id int); +SELECT GROUP_CONCAT(id) AS gc FROM t1 HAVING gc IS NULL; +DROP TABLE t1; diff --git a/sql/item_sum.h b/sql/item_sum.h index cec611b8854..d1e82387944 100644 --- a/sql/item_sum.h +++ b/sql/item_sum.h @@ -739,9 +739,10 @@ class Item_func_group_concat : public Item_sum String *res; char *end_ptr; int error; - res= val_str(&str_value); + if (!(res= val_str(&str_value))) + return (longlong) 0; end_ptr= (char*) res->ptr()+ res->length(); - return res ? my_strtoll10(res->ptr(), &end_ptr, &error) : (longlong) 0; + return my_strtoll10(res->ptr(), &end_ptr, &error); } String* val_str(String* str); Item *copy_or_same(THD* thd); From 0d98da70adcfd5f4963c9ba9a898a278f3df7d7f Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 15 Jan 2005 20:08:53 +0100 Subject: [PATCH 0756/1063] don't ignore errors in readlink --- myisam/mi_open.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/myisam/mi_open.c b/myisam/mi_open.c index 562227d2f03..442bf00b9d3 100644 --- a/myisam/mi_open.c +++ b/myisam/mi_open.c @@ -142,9 +142,8 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags) goto err; } /* Don't call realpath() if the name can't be a link */ - if (strcmp(name_buff, org_name)) - (void) my_readlink(index_name, org_name, MYF(0)); - else + if (strcmp(name_buff, org_name) || + my_readlink(index_name, org_name, MYF(0)) == -1) (void) strmov(index_name, org_name); (void) fn_format(data_name,org_name,"",MI_NAME_DEXT,2+4+16); From 31457a625861d4dc3a99990eb42c38a81b607aef Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 15 Jan 2005 23:19:34 -0600 Subject: [PATCH 0757/1063] Bug #7922 prompt \p fails on Windows for shared-memory connections Fixed bug by adding code that displays the contents of mysql.host when \p is added as part of the prompt. mysql.cc: Added code to display mysql.host as prompt when using shared memory client/mysql.cc: Added code to display mysql.host as prompt when using shared memory BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted --- BitKeeper/etc/logging_ok | 1 + client/mysql.cc | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok index d6ab5ae3180..aae5d908fe4 100644 --- a/BitKeeper/etc/logging_ok +++ b/BitKeeper/etc/logging_ok @@ -180,6 +180,7 @@ ram@mysql.r18.ru ram@ram.(none) ranger@regul.home.lan rburnett@build.mysql.com +reggie@bob.(none) root@home.(none) root@mc04.(none) root@x3.internalnet diff --git a/client/mysql.cc b/client/mysql.cc index 739cc77bd14..ebae8e636d2 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -3232,13 +3232,20 @@ static const char* construct_prompt() break; } case 'p': + { #ifndef EMBEDDED_LIBRARY if (!connected) { processed_prompt.append("not_connected"); break; } - if (strstr(mysql_get_host_info(&mysql),"TCP/IP") || + + const char *host_info = mysql_get_host_info(&mysql); + if (strstr(host_info, "memory")) + { + processed_prompt.append( mysql.host ); + } + else if (strstr(host_info,"TCP/IP") || !mysql.unix_socket) add_int_to_prompt(mysql.port); else @@ -3247,6 +3254,7 @@ static const char* construct_prompt() processed_prompt.append(pos ? pos+1 : mysql.unix_socket); } #endif + } break; case 'U': if (!full_username) From e4f887ad20db0fb16d6851acb05c0410c11f63e3 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 16 Jan 2005 16:38:38 +0100 Subject: [PATCH 0758/1063] initialize mysql->charset in mysql_init --- sql-common/client.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sql-common/client.c b/sql-common/client.c index 7264605b247..3de2483ef75 100644 --- a/sql-common/client.c +++ b/sql-common/client.c @@ -1422,6 +1422,7 @@ mysql_init(MYSQL *mysql) bzero((char*) (mysql),sizeof(*(mysql))); mysql->options.connect_timeout= CONNECT_TIMEOUT; mysql->last_used_con= mysql->next_slave= mysql->master = mysql; + mysql->charset=default_charset_info; strmov(mysql->net.sqlstate, not_error_sqlstate); /* By default, we are a replication pivot. The caller must reset it From 7f586778f33c9393c26c5c38e224a83d5e1837c6 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 16 Jan 2005 18:36:13 +0200 Subject: [PATCH 0759/1063] postreview changes sql/sql_lex.cc: layout fixed --- sql/sql_lex.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index f5a0fef6769..e3137bf3766 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -163,7 +163,9 @@ void lex_start(THD *thd, uchar *buf,uint length) void lex_end(LEX *lex) { - for(SELECT_LEX *sl= lex->all_selects_list; sl; sl= sl->next_select_in_list()) + for (SELECT_LEX *sl= lex->all_selects_list; + sl; + sl= sl->next_select_in_list()) sl->expr_list.delete_elements(); // If error when parsing sql-varargs x_free(lex->yacc_yyss); x_free(lex->yacc_yyvs); From 0de6a4268406720ba6d9be9d7905a89c6931b939 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 16 Jan 2005 21:39:19 +0100 Subject: [PATCH 0760/1063] Makefile.am: Bug#7721 ndb/docs/Makefile.am: Bug#7721 --- ndb/docs/Makefile.am | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ndb/docs/Makefile.am b/ndb/docs/Makefile.am index c7e344b3dee..1399ce3b6a5 100644 --- a/ndb/docs/Makefile.am +++ b/ndb/docs/Makefile.am @@ -38,7 +38,7 @@ ndbapidoc: ndbapi.pdf ndbapi.pdf: $(noinst_HEADERS) @set -x; \ - export NDB_RELEASE=$(NDB_RELEASE) \ + export NDB_RELEASE=$(NDB_RELEASE); \ @RM@ -f ndbapi.pdf ndbapi.html; \ @RM@ -rf $(DOXYTMP) $(DOXYOUT); \ mkdir -p $(DOXYTMP) $(DOXYOUT); \ @@ -62,7 +62,7 @@ mgmapidoc: mgmapi.pdf mgmapi.pdf: $(noinst_HEADERS) @set -x; \ - export NDB_RELEASE=$(NDB_RELEASE) \ + export NDB_RELEASE=$(NDB_RELEASE); \ @RM@ -f mgmapi.pdf mgmapi.html; \ @RM@ -rf $(DOXYTMP) $(DOXYOUT); \ mkdir -p $(DOXYTMP) $(DOXYOUT); \ From c72207e143ac491dc23bd52fd14ecdf04113a107 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 17 Jan 2005 09:27:24 +0400 Subject: [PATCH 0761/1063] libmysql.c: bug#7891: mysql_character_set_name() returns collation libmysql/libmysql.c: bug#7891: mysql_character_set_name() returns collation --- libmysql/libmysql.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index b180e86392d..10077e695f3 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -1504,7 +1504,7 @@ ulong STDCALL mysql_thread_id(MYSQL *mysql) const char * STDCALL mysql_character_set_name(MYSQL *mysql) { - return mysql->charset->name; + return mysql->charset->csname; } From 7f69f44f0ab52f1634d80033b8e28a77b74a853c Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 17 Jan 2005 00:09:47 -0600 Subject: [PATCH 0762/1063] mysqldump.c: Move out-of-order option. client/mysqldump.c: Move out-of-order option. --- client/mysqldump.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/mysqldump.c b/client/mysqldump.c index 14ebe9ea8f7..7280bea43f3 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -303,6 +303,9 @@ static struct my_option my_long_options[] = {"opt", OPT_OPTIMIZE, "Same as --add-drop-table, --add-locks, --create-options, --quick, --extended-insert, --lock-tables, --set-charset, and --disable-keys. Enabled by default, disable with --skip-opt.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"order-by-primary", OPT_ORDER_BY_PRIMARY, + "Sorts each table's rows by primary key, or first unique key, if such a key exists. Useful when dumping a MyISAM table to be loaded into an InnoDB table, but will make the dump itself take considerably longer.", + (gptr*) &opt_order_by_primary, (gptr*) &opt_order_by_primary, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, {"password", 'p', "Password to use when connecting to server. If password is not given it's solicited on the tty.", 0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, @@ -354,9 +357,6 @@ static struct my_option my_long_options[] = {"socket", 'S', "Socket file to use for connection.", (gptr*) &opt_mysql_unix_port, (gptr*) &opt_mysql_unix_port, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"order-by-primary", OPT_ORDER_BY_PRIMARY, - "Sorts each table's rows by primary key, or first unique key, if such a key exists. Useful when dumping a MyISAM table to be loaded into an InnoDB table, but will make the dump itself take considerably longer.", - (gptr*) &opt_order_by_primary, (gptr*) &opt_order_by_primary, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, #include {"tab",'T', "Creates tab separated textfile for each table to given path. (creates .sql and .txt files). NOTE: This only works if mysqldump is run on the same machine as the mysqld daemon.", From b25fcad4a7ee8c8b54610609dd989b1e8b9ce3c5 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 17 Jan 2005 10:38:35 +0400 Subject: [PATCH 0763/1063] user_var.result, func_str.result, item_strfunc.cc: bug#7839 ncorrect collation for char(ascii('a')) sql/item_strfunc.cc: bug#7839 ncorrect collation for char(ascii('a')) mysql-test/r/func_str.result: bug#7839 ncorrect collation for char(ascii('a')) mysql-test/r/user_var.result: bug#7839 ncorrect collation for char(ascii('a')) --- mysql-test/r/func_str.result | 2 +- mysql-test/r/user_var.result | 4 ++-- sql/item_strfunc.cc | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result index 8348ef12b0d..0db62b133e7 100644 --- a/mysql-test/r/func_str.result +++ b/mysql-test/r/func_str.result @@ -463,7 +463,7 @@ collation(hex(130)) coercibility(hex(130)) latin1_swedish_ci 3 select collation(char(130)), coercibility(hex(130)); collation(char(130)) coercibility(hex(130)) -binary 3 +latin1_swedish_ci 3 select collation(format(130,10)), coercibility(format(130,10)); collation(format(130,10)) coercibility(format(130,10)) latin1_swedish_ci 3 diff --git a/mysql-test/r/user_var.result b/mysql-test/r/user_var.result index d46d6c7a78a..81846391795 100644 --- a/mysql-test/r/user_var.result +++ b/mysql-test/r/user_var.result @@ -175,7 +175,7 @@ Log_name Pos Event_type Server_id Orig_log_pos Info master-bin.000001 79 User var 1 79 @`a b`=_latin1 0x68656C6C6F COLLATE latin1_swedish_ci master-bin.000001 120 Query 1 120 use `test`; INSERT INTO t1 VALUES(@`a b`) master-bin.000001 184 User var 1 184 @`var1`=_latin1 0x273B616161 COLLATE latin1_swedish_ci -master-bin.000001 226 User var 1 226 @`var2`=_binary 0x61 COLLATE binary +master-bin.000001 226 User var 1 226 @`var2`=_latin1 0x61 COLLATE latin1_swedish_ci master-bin.000001 264 Query 1 264 use `test`; insert into t1 values (@var1),(@var2) /*!40019 SET @@session.max_insert_delayed_threads=0*/; SET @`a b`:=_latin1 0x68656C6C6F COLLATE `latin1_swedish_ci`; @@ -183,7 +183,7 @@ use test; SET TIMESTAMP=10000; INSERT INTO t1 VALUES(@`a b`); SET @`var1`:=_latin1 0x273B616161 COLLATE `latin1_swedish_ci`; -SET @`var2`:=_binary 0x61 COLLATE `binary`; +SET @`var2`:=_latin1 0x61 COLLATE `latin1_swedish_ci`; SET TIMESTAMP=10000; insert into t1 values (@var1),(@var2); drop table t1; diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index d0190af042e..8341dda0a41 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -1888,6 +1888,7 @@ b1: str->append((char)(num>>8)); #endif str->append((char)num); } + str->set_charset(collation.collation); str->realloc(str->length()); // Add end 0 (for Purify) return str; } From a05bacb06ef33bf14439ee258c24dbeced10c3e4 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 17 Jan 2005 12:29:43 +0100 Subject: [PATCH 0764/1063] Bug#7937 --- ndb/tools/restore/Restore.hpp | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/ndb/tools/restore/Restore.hpp b/ndb/tools/restore/Restore.hpp index e0b06c1774c..d7f6e3b7799 100644 --- a/ndb/tools/restore/Restore.hpp +++ b/ndb/tools/restore/Restore.hpp @@ -187,28 +187,33 @@ public: }; void update_max_auto_val(const char *data, int size) { - Uint64 val= 0; + union { + Uint8 u8; + Uint16 u16; + Uint32 u32; + } val; + Uint64 v; switch(size){ - case 8: - val= *(Uint8*)data; - break; - case 16: - val= *(Uint16*)data; - break; - case 24: - val= (0xffffff)&*(Uint32*)data; + case 64: + memcpy(&v,data,8); break; case 32: - val= *(Uint32*)data; + memcpy(&val.u32,data,4); + v= val.u32; break; - case 64: - val= *(Uint64*)data; + case 16: + memcpy(&val.u16,data,2); + v= val.u16; + break; + case 8: + memcpy(&val.u8,data,1); + v= val.u8; break; default: return; }; - if(val > m_max_auto_val) - m_max_auto_val= val; + if(v > m_max_auto_val) + m_max_auto_val= v; }; /** * Get attribute descriptor From 4fc1801d08b08dbb86f82cf83c11f5b90aaca745 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 17 Jan 2005 19:21:01 +0300 Subject: [PATCH 0765/1063] Fixed memory leak in handle_local_infile() BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted --- BitKeeper/etc/logging_ok | 1 + libmysql/libmysql.c | 1 + 2 files changed, 2 insertions(+) diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok index d6ab5ae3180..7ff770e8fbb 100644 --- a/BitKeeper/etc/logging_ok +++ b/BitKeeper/etc/logging_ok @@ -93,6 +93,7 @@ joerg@mysql.com joreland@mysql.com jorge@linux.jorge.mysql.com jplindst@t41.(none) +kaa@polly.local kaj@work.mysql.com kent@mysql.com konstantin@mysql.com diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index 10077e695f3..206fd8f77b4 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -852,6 +852,7 @@ my_bool handle_local_infile(MYSQL *mysql, const char *net_filename) err: /* free up memory allocated with _init, usually */ (*options->local_infile_end)(li_ptr); + my_free(buf, MYF(0)); DBUG_RETURN(result); } From 57f7c497cf397452cce36f50f546f0f1f85a2269 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 17 Jan 2005 17:22:17 +0100 Subject: [PATCH 0766/1063] - Enabled the handling of architecture extensions e.g. "-64bit" when building Mac OS X PKGs with Do-pkg Build-tools/Do-pkg: - enable handling of architecture extensions e.g. "-64bit" --- Build-tools/Do-pkg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Build-tools/Do-pkg b/Build-tools/Do-pkg index 2fd1946ed0e..04d7ba021e5 100755 --- a/Build-tools/Do-pkg +++ b/Build-tools/Do-pkg @@ -84,7 +84,7 @@ $LOGFILE= "$PWD/Logs/$HOST-$MAJOR.$MINOR$SUFFIX.log"; $BUILDDIR= "$PWD/$HOST"; $SRCBASEDIR= <$BUILDDIR/mysql*-$VERSION>; $SUPFILEDIR= <$SRCBASEDIR/support-files/MacOSX>; -$TAR= <$BUILDDIR/$NAME-apple-darwin*-powerpc.tar.gz>; +$TAR= <$BUILDDIR/$NAME-apple-darwin*-powerpc*.tar.gz>; $TAR =~ /.*\/$NAME(.*)\.tar\.gz$/; $ARCH= $1; $NAME= $NAME . $ARCH; From f9bcb9ab5cb6582c9bfe4ce3759b97868c22aa2f Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 17 Jan 2005 19:52:07 +0200 Subject: [PATCH 0767/1063] backported from 5.0 patch initialization of main select for commands where subqueries are possible --- sql/sql_yacc.yy | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 4fcc72bc90e..1e51d8fb82d 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -4008,7 +4008,8 @@ insert: { LEX *lex= Lex; lex->sql_command= SQLCOM_INSERT; - lex->duplicates= DUP_ERROR; + lex->duplicates= DUP_ERROR; + mysql_init_select(lex); /* for subselects */ lex->lock_option= (using_update_log) ? TL_READ_NO_INSERT : TL_READ; lex->select_lex.resolve_mode= SELECT_LEX::INSERT_MODE; @@ -4028,6 +4029,7 @@ replace: LEX *lex=Lex; lex->sql_command = SQLCOM_REPLACE; lex->duplicates= DUP_REPLACE; + mysql_init_select(lex); lex->select_lex.resolve_mode= SELECT_LEX::INSERT_MODE; } replace_lock_option insert2 @@ -4229,6 +4231,7 @@ delete: { LEX *lex= Lex; lex->sql_command= SQLCOM_DELETE; + mysql_init_select(lex); lex->lock_option= lex->thd->update_lock_default; lex->ignore= 0; lex->select_lex.init_order(); @@ -5321,6 +5324,7 @@ set: { LEX *lex=Lex; lex->sql_command= SQLCOM_SET_OPTION; + mysql_init_select(lex); lex->option_type=OPT_SESSION; lex->var_list.empty(); lex->one_shot_set= 0; From f6f90e7dc1ae497ac25941fc6b709f18a5d46c46 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 17 Jan 2005 13:40:36 -0600 Subject: [PATCH 0768/1063] Bug #7966 query cache doesn't work properly with batch statements sql_lex.cc: Set query to not cacheable if we are using multistatements and there are multiple statements in this query sql/sql_lex.cc: Set query to not cacheable if we are using multistatements and there are multiple statements in this query --- sql/sql_lex.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index 5730073bd35..2783406e16a 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -912,6 +912,7 @@ int yylex(void *arg, void *yythd) if ((thd->client_capabilities & CLIENT_MULTI_STATEMENTS) && (thd->command != COM_PREPARE)) { + lex->safe_to_cache_query=0; lex->found_colon=(char*)lex->ptr; thd->server_status |= SERVER_MORE_RESULTS_EXISTS; lex->next_state=MY_LEX_END; From 3752c3b33bac1d6d647845ecd800183693a13cf9 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 17 Jan 2005 12:22:23 -0800 Subject: [PATCH 0769/1063] Print a warning when an old table (with no character set stored) is opened and the default character set is multi-byte, which will result in character column size changes. (Bug #6913) sql/table.cc: Print a warning when an old table is opened and the default character set is multi-byte that warns about character column sizes possibly getting changed --- sql/table.cc | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/sql/table.cc b/sql/table.cc index 5ede9c1e43d..4be69a40782 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -145,8 +145,19 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag, outparam->table_charset=get_charset((uint) head[38],MYF(0)); null_field_first=1; } - if (!outparam->table_charset) /* unknown charset in head[38] or pre-3.23 frm */ + if (!outparam->table_charset) + { + /* unknown charset in head[38] or pre-3.23 frm */ + if (use_mb(default_charset_info)) + { + /* Warn that we may be changing the size of character columns */ + sql_print_warning("'%s' had no or invalid character set, " + "and default character set is multi-byte, " + "so character column sizes may have changed", + name); + } outparam->table_charset=default_charset_info; + } outparam->db_record_offset=1; if (db_create_options & HA_OPTION_LONG_BLOB_PTR) outparam->blob_ptr_size=portable_sizeof_char_ptr; From 608729f7112ef031b94ddd5298f741515b4eb62a Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 17 Jan 2005 21:26:14 +0100 Subject: [PATCH 0770/1063] Fix for BUG#7965 "Slave_IO_State Stuck at 'Checking Master Version'": Working around hang of master < 3.23.50 on SELECT @@unknown_var (to enable 3.23.49->4.1.10 replication) sql/slave.cc: Working around hang of master < 3.23.50 on SELECT @@unknown_var (to enable 3.23.49->4.1.10 replication) --- sql/slave.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sql/slave.cc b/sql/slave.cc index ef9caa5f5b5..d85c44c915e 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -1243,7 +1243,11 @@ not always make sense; please check the manual before using it)."; values of these 2 are never used (new connections don't use them). We don't test equality of global collation_database either as it's is going to be deprecated (made read-only) in 4.1 very soon. + We don't do it for <3.23.57 because masters <3.23.50 hang on + SELECT @@unknown_var (BUG#7965 - see changelog of 3.23.50). */ + if (mi->old_format == BINLOG_FORMAT_323_LESS_57) + goto err; if (!mysql_real_query(mysql, "SELECT @@GLOBAL.COLLATION_SERVER", 32) && (master_res= mysql_store_result(mysql))) { @@ -1280,6 +1284,7 @@ be equal for replication to work"; mysql_free_result(master_res); } +err: if (errmsg) { sql_print_error(errmsg); From 77b8a94d7a767291f90d57f0e667b421c5f41037 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 17 Jan 2005 22:35:53 +0100 Subject: [PATCH 0771/1063] make the code to look safe, not only be safe --- ndb/src/common/util/strdup.c | 4 ++-- sql/log.cc | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ndb/src/common/util/strdup.c b/ndb/src/common/util/strdup.c index afe2306427e..d8f4d99bd28 100644 --- a/ndb/src/common/util/strdup.c +++ b/ndb/src/common/util/strdup.c @@ -21,8 +21,8 @@ char * strdup(const char *s){ void *p2; - p2 = malloc(strlen(s)+1); - strcpy(p2, s); + if ((p2 = malloc(strlen(s)+1))) + strcpy(p2, s); return p2; } #endif diff --git a/sql/log.cc b/sql/log.cc index 4504b286506..38844877f1b 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -2247,9 +2247,9 @@ void print_buffer_to_nt_eventlog(enum loglevel level, char *buff, DBUG_ENTER("print_buffer_to_nt_eventlog"); buffptr= buff; - if (length > (uint)(buffLen-4)) + if (length > (uint)(buffLen-5)) { - char *newBuff= new char[length + 4]; + char *newBuff= new char[length + 5]; strcpy(newBuff, buff); buffptr= newBuff; } From 896cdbe5df80f942a43e784336052cb2cce5871c Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 18 Jan 2005 02:04:41 +0200 Subject: [PATCH 0772/1063] Anoter fix for moved IO_CACHE object --- sql/filesort.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sql/filesort.cc b/sql/filesort.cc index fe42f391007..a53067ccd73 100644 --- a/sql/filesort.cc +++ b/sql/filesort.cc @@ -686,7 +686,10 @@ int merge_many_buff(SORTPARAM *param, uchar *sort_buffer, } close_cached_file(to_file); // This holds old result if (to_file == t_file) + { *t_file=t_file2; // Copy result file + setup_io_cache(t_file); + } DBUG_RETURN(*maxbuffer >= MERGEBUFF2); /* Return 1 if interrupted */ } /* merge_many_buff */ From dd68385435e0e7df27b26a8cc13c21195bedbcd9 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 17 Jan 2005 16:13:56 -0800 Subject: [PATCH 0773/1063] Fix over-optimization that could result in an unsigned double field being set to a negative value. (Bug #7700) sql/field_conv.cc: Don't treat real fields as identical when destination is unsigned and the source is not. mysql-test/t/type_float.test: Add test for setting double unsigned to a negative value from a signed double mysql-test/r/type_float.result: Add test results --- mysql-test/r/type_float.result | 7 +++++++ mysql-test/t/type_float.test | 6 ++++++ sql/field_conv.cc | 1 + 3 files changed, 14 insertions(+) diff --git a/mysql-test/r/type_float.result b/mysql-test/r/type_float.result index f4c5df353a3..4637a593e6c 100644 --- a/mysql-test/r/type_float.result +++ b/mysql-test/r/type_float.result @@ -120,3 +120,10 @@ drop table t1; create table t1 (f float(54)); Incorrect column specifier for column 'f' drop table if exists t1; +create table t1 (d1 double, d2 double unsigned); +insert into t1 set d1 = -1.0; +update t1 set d2 = d1; +select * from t1; +d1 d2 +-1 0 +drop table t1; diff --git a/mysql-test/t/type_float.test b/mysql-test/t/type_float.test index 084d4b815e5..2db6a79ff54 100644 --- a/mysql-test/t/type_float.test +++ b/mysql-test/t/type_float.test @@ -67,3 +67,9 @@ drop table t1; create table t1 (f float(54)); # Should give an error drop table if exists t1; +# Don't allow 'double unsigned' to be set to a negative value (Bug #7700) +create table t1 (d1 double, d2 double unsigned); +insert into t1 set d1 = -1.0; +update t1 set d2 = d1; +select * from t1; +drop table t1; diff --git a/sql/field_conv.cc b/sql/field_conv.cc index db0cc71c6bf..7aaabde4f55 100644 --- a/sql/field_conv.cc +++ b/sql/field_conv.cc @@ -537,6 +537,7 @@ void field_conv(Field *to,Field *from) if (to->real_type() == from->real_type()) { if (to->pack_length() == from->pack_length() && + !(to->flags & UNSIGNED_FLAG && !(from->flags & UNSIGNED_FLAG)) && to->real_type() != FIELD_TYPE_ENUM && to->real_type() != FIELD_TYPE_SET && to->table->db_low_byte_first == from->table->db_low_byte_first) From 96f64b4440daa411a887ded45d5cee1daca99360 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 18 Jan 2005 03:49:39 +0200 Subject: [PATCH 0774/1063] Fixed new bug that caused symlink test to fail mysys/my_symlink.c: More debugging --- myisam/mi_open.c | 2 +- mysys/my_symlink.c | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/myisam/mi_open.c b/myisam/mi_open.c index 442bf00b9d3..2a327e4bd35 100644 --- a/myisam/mi_open.c +++ b/myisam/mi_open.c @@ -142,7 +142,7 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags) goto err; } /* Don't call realpath() if the name can't be a link */ - if (strcmp(name_buff, org_name) || + if (!strcmp(name_buff, org_name) || my_readlink(index_name, org_name, MYF(0)) == -1) (void) strmov(index_name, org_name); (void) fn_format(data_name,org_name,"",MI_NAME_DEXT,2+4+16); diff --git a/mysys/my_symlink.c b/mysys/my_symlink.c index 045802c5e61..7be3fcd36f0 100644 --- a/mysys/my_symlink.c +++ b/mysys/my_symlink.c @@ -26,9 +26,11 @@ /* Reads the content of a symbolic link If the file is not a symbolic link, return the original file name in to. - Returns: 0 if table was a symlink, - 1 if table was a normal file - -1 on error. + + RETURN + 0 If filename was a symlink, (to will be set to value of symlink) + 1 If filename was a normal file (to will be set to filename) + -1 on error. */ int my_readlink(char *to, const char *filename, myf MyFlags) @@ -58,6 +60,7 @@ int my_readlink(char *to, const char *filename, myf MyFlags) } else to[length]=0; + DBUG_PRINT("exit" ,("result: %d", result)); DBUG_RETURN(result); #endif /* HAVE_READLINK */ } From ec0daa744fe6b1141e4d8815b574c2a1e38366e8 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 18 Jan 2005 10:42:29 +0400 Subject: [PATCH 0775/1063] #7874: CONCAT() gives wrong results mixing latin1 field and utf8 string literals We should not overwrite res if it is returned from a const item. --- mysql-test/r/ctype_utf8.result | 12 ++++++++++++ mysql-test/t/ctype_utf8.test | 12 ++++++++++++ sql/item_strfunc.cc | 3 ++- 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result index f62d754392b..415ed33ad40 100644 --- a/mysql-test/r/ctype_utf8.result +++ b/mysql-test/r/ctype_utf8.result @@ -849,3 +849,15 @@ utf8_bin 6109 utf8_bin 61 utf8_bin 6120 drop table t1; +CREATE TABLE t1 ( +user varchar(255) NOT NULL default '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1; +INSERT INTO t1 VALUES ('one'),('two'); +SELECT CHARSET('a'); +CHARSET('a') +utf8 +SELECT user, CONCAT('<', user, '>') AS c FROM t1; +user c +one +two +DROP TABLE t1; diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test index a57db4455ab..8e3eb71c3e5 100644 --- a/mysql-test/t/ctype_utf8.test +++ b/mysql-test/t/ctype_utf8.test @@ -681,3 +681,15 @@ SET collation_connection='utf8_general_ci'; -- source include/ctype_filesort.inc SET collation_connection='utf8_bin'; -- source include/ctype_filesort.inc + +# +# Bug #7874 CONCAT() gives wrong results mixing +# latin1 field and utf8 string literals +# +CREATE TABLE t1 ( + user varchar(255) NOT NULL default '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1; +INSERT INTO t1 VALUES ('one'),('two'); +SELECT CHARSET('a'); +SELECT user, CONCAT('<', user, '>') AS c FROM t1; +DROP TABLE t1; diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 8341dda0a41..f131d849d62 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -275,7 +275,8 @@ String *Item_func_concat::val_str(String *str) current_thd->variables.max_allowed_packet); goto null; } - if (res->alloced_length() >= res->length()+res2->length()) + if (!args[0]->const_item() && + res->alloced_length() >= res->length()+res2->length()) { // Use old buffer res->append(*res2); } From f003895df9f562018ba47e5f7af2eae03d937368 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 18 Jan 2005 11:27:38 +0100 Subject: [PATCH 0776/1063] myisam/ft_boolean_search.c -trunc* bug - don't increase yweaks in this case myisam/ft_boolean_search.c: -trunc* bug - don't increase yweaks in this case mysql-test/r/fulltext.result: -trunc* bug - don't increase yweaks in this case mysql-test/t/fulltext.test: -trunc* bug - don't increase yweaks in this case --- myisam/ft_boolean_search.c | 11 ++++++----- mysql-test/r/fulltext.result | 3 +++ mysql-test/t/fulltext.test | 1 + 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/myisam/ft_boolean_search.c b/myisam/ft_boolean_search.c index ffc7e1bf104..aab3854dd34 100644 --- a/myisam/ft_boolean_search.c +++ b/myisam/ft_boolean_search.c @@ -345,11 +345,12 @@ static void _ftb_init_index_search(FT_INFO *ftb) if (ftbe->flags & FTB_FLAG_NO || /* 2 */ ftbe->up->ythresh - ftbe->up->yweaks >1) /* 1 */ { - FTB_EXPR *top_ftbe=ftbe->up->up; + FTB_EXPR *top_ftbe=ftbe->up; ftbw->docid[0]=HA_OFFSET_ERROR; - for (ftbe=ftbw->up; ftbe != top_ftbe; ftbe=ftbe->up) - if (!(ftbe->flags & FTB_FLAG_NO)) - ftbe->yweaks++; + for (ftbe=(FTB_EXPR *)ftbw; + ftbe != top_ftbe && !(ftbe->flags & FTB_FLAG_NO); + ftbe=ftbe->up) + ftbe->up->yweaks++; ftbe=0; break; } @@ -363,7 +364,7 @@ static void _ftb_init_index_search(FT_INFO *ftb) else reset_tree(& ftb->no_dupes); } - + if (_ft2_search(ftb, ftbw, 1)) return; } diff --git a/mysql-test/r/fulltext.result b/mysql-test/r/fulltext.result index 7acc8a2d23f..a042248ba34 100644 --- a/mysql-test/r/fulltext.result +++ b/mysql-test/r/fulltext.result @@ -148,6 +148,9 @@ select * from t1 where MATCH a,b AGAINST ('+(support collections) +foobar*' IN B a b select * from t1 where MATCH a,b AGAINST ('+(+(support collections)) +foobar*' IN BOOLEAN MODE); a b +select * from t1 where MATCH a,b AGAINST ('+collections -supp* -foobar*' IN BOOLEAN MODE); +a b +Full-text indexes are called collections select * from t1 where MATCH a,b AGAINST ('"xt indexes"' IN BOOLEAN MODE); a b select * from t1 where MATCH a,b AGAINST('"space model' IN BOOLEAN MODE); diff --git a/mysql-test/t/fulltext.test b/mysql-test/t/fulltext.test index 008e965297f..62dcecaff68 100644 --- a/mysql-test/t/fulltext.test +++ b/mysql-test/t/fulltext.test @@ -67,6 +67,7 @@ select * from t1 where MATCH a,b AGAINST ('"xt indexes"' IN BOOLEAN MODE); select * from t1 where MATCH a,b AGAINST ('+(support collections) +foobar*' IN BOOLEAN MODE); select * from t1 where MATCH a,b AGAINST ('+(+(support collections)) +foobar*' IN BOOLEAN MODE); +select * from t1 where MATCH a,b AGAINST ('+collections -supp* -foobar*' IN BOOLEAN MODE); select * from t1 where MATCH a,b AGAINST ('"xt indexes"' IN BOOLEAN MODE); # bug#2708, bug#3870 crash From 1457163c97eb6eddc5d68f0b16239aec56e08d27 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 18 Jan 2005 16:23:10 +0300 Subject: [PATCH 0777/1063] Fix 'make distclean' goal. --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 9f89c635e7f..b1b8b128f46 100644 --- a/configure.in +++ b/configure.in @@ -3019,7 +3019,7 @@ AC_SUBST(server_scripts) sql_union_dirs=" $sql_server_dirs " for DIR in $sql_client_dirs do - if echo $sql_union_dirs | grep " $DIR " >/dev/null + if echo " $sql_union_dirs " | grep " $DIR " >/dev/null then : # already present, skip else From cd89ed9ab6ae511581471b1aaa640fadc3819f63 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 18 Jan 2005 17:41:06 +0400 Subject: [PATCH 0778/1063] 1. Item now uses my_charset_bin by default, not default_charset_into. It fixes the problem that in some cases numbers where treated as CHAR(N), not as BINARY(N), e.g. wrong 'charsetnr' when sent to the client side. 2. IFNULL didn't aggregate argument charsets and collations, so IFNULL(1,'a') produced a CHAR(N). Now produces a BINARY(N). 3. SELECT PROCEDURE ANALIZE now returns BINARY columns, which is much better than it worked previously: CHAR with the default character set. But in the future it's worth to fix the fields 'Field_name' and 'Optimal_fieldtype' to use UTF8, and 'Min_value' and 'Max_value' to inherit their charsets from the original items. But it is not important, and BINARY(N) is OK for now. 4. Tests were fixed accordingly. No new tests were made, as the old onces cover everything. mysql-test/r/analyse.result: SELECT PROCEDURE ANALIZE now returns BINARY columns, which is much better than it worked previously: CHAR with the default character set. But in the future it's worth to fix the fields 'Field_name' and 'Optimal_fieldtype' to use UTF8, and 'Min_value' and 'Max_value' to inherit their charsets from the original items. But it is not important, and BINARY(N) is OK for now. mysql-test/r/case.result: Test fix according to the changes mysql-test/r/metadata.result: Test fix according to the changes mysql-test/r/ps_1general.result: Test fix according to the changes mysql-test/r/ps_2myisam.result: Test fix according to the changes mysql-test/r/ps_3innodb.result: Test fix according to the changes mysql-test/r/ps_4heap.result: Test fix according to the changes mysql-test/r/ps_5merge.result: Test fix according to the changes mysql-test/r/ps_6bdb.result: Test fix according to the changes mysql-test/r/ps_7ndb.result: Test fix according to the changes mysql-test/r/union.result: Test fix according to the changes sql/item.cc: Item is now BINARY by default sql/item_cmpfunc.cc: IFNULL now collects arguments collations/charsets like other functions do. --- mysql-test/r/analyse.result | 36 ++++++++++++++++----------------- mysql-test/r/case.result | 12 +++++------ mysql-test/r/metadata.result | 6 +++--- mysql-test/r/ps_1general.result | 12 +++++------ mysql-test/r/ps_2myisam.result | 6 +++--- mysql-test/r/ps_3innodb.result | 6 +++--- mysql-test/r/ps_4heap.result | 6 +++--- mysql-test/r/ps_5merge.result | 12 +++++------ mysql-test/r/ps_6bdb.result | 6 +++--- mysql-test/r/ps_7ndb.result | 6 +++--- mysql-test/r/union.result | 2 +- sql/item.cc | 2 +- sql/item_cmpfunc.cc | 3 +++ 13 files changed, 59 insertions(+), 56 deletions(-) diff --git a/mysql-test/r/analyse.result b/mysql-test/r/analyse.result index 8013bc516bb..09c606b5a04 100644 --- a/mysql-test/r/analyse.result +++ b/mysql-test/r/analyse.result @@ -36,16 +36,16 @@ create table t2 select * from t1 where 0=1 procedure analyse(); show create table t2; Table Create Table t2 CREATE TABLE `t2` ( - `Field_name` char(255) NOT NULL default '', - `Min_value` char(255) default NULL, - `Max_value` char(255) default NULL, + `Field_name` binary(255) NOT NULL default '', + `Min_value` binary(255) default NULL, + `Max_value` binary(255) default NULL, `Min_length` bigint(11) NOT NULL default '0', `Max_length` bigint(11) NOT NULL default '0', `Empties_or_zeros` bigint(11) NOT NULL default '0', `Nulls` bigint(11) NOT NULL default '0', - `Avg_value_or_avg_length` char(255) NOT NULL default '', - `Std` char(255) default NULL, - `Optimal_fieldtype` char(64) NOT NULL default '' + `Avg_value_or_avg_length` binary(255) NOT NULL default '', + `Std` binary(255) default NULL, + `Optimal_fieldtype` binary(64) NOT NULL default '' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 select * from t1 where 0=1 procedure analyse(); Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype @@ -55,16 +55,16 @@ create table t2 select * from t1 where 0=1 procedure analyse(); show create table t2; Table Create Table t2 CREATE TABLE `t2` ( - `Field_name` char(255) NOT NULL default '', - `Min_value` char(255) default NULL, - `Max_value` char(255) default NULL, + `Field_name` binary(255) NOT NULL default '', + `Min_value` binary(255) default NULL, + `Max_value` binary(255) default NULL, `Min_length` bigint(11) NOT NULL default '0', `Max_length` bigint(11) NOT NULL default '0', `Empties_or_zeros` bigint(11) NOT NULL default '0', `Nulls` bigint(11) NOT NULL default '0', - `Avg_value_or_avg_length` char(255) NOT NULL default '', - `Std` char(255) default NULL, - `Optimal_fieldtype` char(64) NOT NULL default '' + `Avg_value_or_avg_length` binary(255) NOT NULL default '', + `Std` binary(255) default NULL, + `Optimal_fieldtype` binary(64) NOT NULL default '' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 select * from t2; Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype @@ -78,16 +78,16 @@ create table t2 select * from t1 where 0=1 procedure analyse(); show create table t2; Table Create Table t2 CREATE TABLE `t2` ( - `Field_name` char(255) NOT NULL default '', - `Min_value` char(255) default NULL, - `Max_value` char(255) default NULL, + `Field_name` binary(255) NOT NULL default '', + `Min_value` binary(255) default NULL, + `Max_value` binary(255) default NULL, `Min_length` bigint(11) NOT NULL default '0', `Max_length` bigint(11) NOT NULL default '0', `Empties_or_zeros` bigint(11) NOT NULL default '0', `Nulls` bigint(11) NOT NULL default '0', - `Avg_value_or_avg_length` char(255) NOT NULL default '', - `Std` char(255) default NULL, - `Optimal_fieldtype` char(64) NOT NULL default '' + `Avg_value_or_avg_length` binary(255) NOT NULL default '', + `Std` binary(255) default NULL, + `Optimal_fieldtype` binary(64) NOT NULL default '' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 select * from t2; Field_name Min_value Max_value Min_length Max_length Empties_or_zeros Nulls Avg_value_or_avg_length Std Optimal_fieldtype diff --git a/mysql-test/r/case.result b/mysql-test/r/case.result index 1aa838140fd..541560afd36 100644 --- a/mysql-test/r/case.result +++ b/mysql-test/r/case.result @@ -98,10 +98,10 @@ Table Create Table t1 CREATE TABLE `t1` ( `c1` char(1) character set latin1 collate latin1_danish_ci NOT NULL default '', `c2` char(1) character set latin1 collate latin1_danish_ci NOT NULL default '', - `c3` char(1) NOT NULL default '', - `c4` char(1) NOT NULL default '', - `c5` char(3) NOT NULL default '', - `c6` char(3) NOT NULL default '', + `c3` binary(1) NOT NULL default '', + `c4` binary(1) NOT NULL default '', + `c5` binary(3) NOT NULL default '', + `c6` binary(3) NOT NULL default '', `c7` double(3,1) NOT NULL default '0.0', `c8` double(3,1) NOT NULL default '0.0', `c9` double(3,1) default NULL @@ -149,8 +149,8 @@ t1 CREATE TABLE `t1` ( `COALESCE(1.0)` double(3,1) NOT NULL default '0.0', `COALESCE('a')` char(1) NOT NULL default '', `COALESCE(1,1.0)` double(3,1) NOT NULL default '0.0', - `COALESCE(1,'1')` char(1) NOT NULL default '', - `COALESCE(1.1,'1')` char(3) NOT NULL default '', + `COALESCE(1,'1')` binary(1) NOT NULL default '', + `COALESCE(1.1,'1')` binary(3) NOT NULL default '', `COALESCE('a' COLLATE latin1_bin,'b')` char(1) character set latin1 collate latin1_bin NOT NULL default '' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1; diff --git a/mysql-test/r/metadata.result b/mysql-test/r/metadata.result index 3c7cf60db7a..54b3f1e0466 100644 --- a/mysql-test/r/metadata.result +++ b/mysql-test/r/metadata.result @@ -1,9 +1,9 @@ drop table if exists t1,t2; select 1, 1.0, -1, "hello", NULL; Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def 1 8 1 1 N 32769 0 8 -def 1.0 5 3 3 N 32769 1 8 -def -1 8 2 2 N 32769 0 8 +def 1 8 1 1 N 32897 0 63 +def 1.0 5 3 3 N 32897 1 63 +def -1 8 2 2 N 32897 0 63 def hello 254 5 5 N 1 31 8 def NULL 6 0 0 Y 32896 0 63 1 1.0 -1 hello NULL diff --git a/mysql-test/r/ps_1general.result b/mysql-test/r/ps_1general.result index ee3eca850f4..2356989eaf6 100644 --- a/mysql-test/r/ps_1general.result +++ b/mysql-test/r/ps_1general.result @@ -468,15 +468,15 @@ ERROR HY000: This command is not supported in the prepared statement protocol ye prepare stmt1 from ' explain select a from t1 order by b '; execute stmt1; Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def id 8 3 1 N 32801 0 8 +def id 8 3 1 N 32929 0 63 def select_type 253 19 6 N 1 31 8 def table 253 64 2 N 1 31 8 def type 253 10 3 N 1 31 8 def possible_keys 253 4096 0 Y 0 31 8 def key 253 64 0 Y 0 31 8 -def key_len 8 3 0 Y 32800 0 8 +def key_len 8 3 0 Y 32928 0 63 def ref 253 1024 0 Y 0 31 8 -def rows 8 10 1 N 32801 0 8 +def rows 8 10 1 N 32929 0 63 def Extra 253 255 14 N 1 31 8 id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using filesort @@ -484,15 +484,15 @@ SET @arg00=1 ; prepare stmt1 from ' explain select a from t1 where a > ? order by b '; execute stmt1 using @arg00; Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def id 8 3 1 N 32801 0 8 +def id 8 3 1 N 32929 0 63 def select_type 253 19 6 N 1 31 8 def table 253 64 2 N 1 31 8 def type 253 10 5 N 1 31 8 def possible_keys 253 4096 7 Y 0 31 8 def key 253 64 7 Y 0 31 8 -def key_len 8 3 1 Y 32800 0 8 +def key_len 8 3 1 Y 32928 0 63 def ref 253 1024 0 Y 0 31 8 -def rows 8 10 1 N 32801 0 8 +def rows 8 10 1 N 32929 0 63 def Extra 253 255 27 N 1 31 8 id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 3 Using where; Using filesort diff --git a/mysql-test/r/ps_2myisam.result b/mysql-test/r/ps_2myisam.result index 3412f2fe00c..a27b8b996cd 100644 --- a/mysql-test/r/ps_2myisam.result +++ b/mysql-test/r/ps_2myisam.result @@ -1145,15 +1145,15 @@ test_sequence prepare stmt1 from ' explain select * from t9 ' ; execute stmt1; Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def id 8 3 1 N 32801 0 8 +def id 8 3 1 N 32929 0 63 def select_type 253 19 6 N 1 31 8 def table 253 64 2 N 1 31 8 def type 253 10 3 N 1 31 8 def possible_keys 253 4096 0 Y 0 31 8 def key 253 64 0 Y 0 31 8 -def key_len 8 3 0 Y 32800 0 8 +def key_len 8 3 0 Y 32928 0 63 def ref 253 1024 0 Y 0 31 8 -def rows 8 10 1 N 32801 0 8 +def rows 8 10 1 N 32929 0 63 def Extra 253 255 0 N 1 31 8 id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t9 ALL NULL NULL NULL NULL 2 diff --git a/mysql-test/r/ps_3innodb.result b/mysql-test/r/ps_3innodb.result index 99f45117c36..eb17d25e80c 100644 --- a/mysql-test/r/ps_3innodb.result +++ b/mysql-test/r/ps_3innodb.result @@ -1145,15 +1145,15 @@ test_sequence prepare stmt1 from ' explain select * from t9 ' ; execute stmt1; Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def id 8 3 1 N 32801 0 8 +def id 8 3 1 N 32929 0 63 def select_type 253 19 6 N 1 31 8 def table 253 64 2 N 1 31 8 def type 253 10 3 N 1 31 8 def possible_keys 253 4096 0 Y 0 31 8 def key 253 64 0 Y 0 31 8 -def key_len 8 3 0 Y 32800 0 8 +def key_len 8 3 0 Y 32928 0 63 def ref 253 1024 0 Y 0 31 8 -def rows 8 10 1 N 32801 0 8 +def rows 8 10 1 N 32929 0 63 def Extra 253 255 0 N 1 31 8 id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t9 ALL NULL NULL NULL NULL 2 diff --git a/mysql-test/r/ps_4heap.result b/mysql-test/r/ps_4heap.result index 1ec5c280523..b53ad7e2409 100644 --- a/mysql-test/r/ps_4heap.result +++ b/mysql-test/r/ps_4heap.result @@ -1146,15 +1146,15 @@ test_sequence prepare stmt1 from ' explain select * from t9 ' ; execute stmt1; Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def id 8 3 1 N 32801 0 8 +def id 8 3 1 N 32929 0 63 def select_type 253 19 6 N 1 31 8 def table 253 64 2 N 1 31 8 def type 253 10 3 N 1 31 8 def possible_keys 253 4096 0 Y 0 31 8 def key 253 64 0 Y 0 31 8 -def key_len 8 3 0 Y 32800 0 8 +def key_len 8 3 0 Y 32928 0 63 def ref 253 1024 0 Y 0 31 8 -def rows 8 10 1 N 32801 0 8 +def rows 8 10 1 N 32929 0 63 def Extra 253 255 0 N 1 31 8 id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t9 ALL NULL NULL NULL NULL 2 diff --git a/mysql-test/r/ps_5merge.result b/mysql-test/r/ps_5merge.result index 1f36d246da0..13227eb533b 100644 --- a/mysql-test/r/ps_5merge.result +++ b/mysql-test/r/ps_5merge.result @@ -1188,15 +1188,15 @@ test_sequence prepare stmt1 from ' explain select * from t9 ' ; execute stmt1; Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def id 8 3 1 N 32801 0 8 +def id 8 3 1 N 32929 0 63 def select_type 253 19 6 N 1 31 8 def table 253 64 2 N 1 31 8 def type 253 10 3 N 1 31 8 def possible_keys 253 4096 0 Y 0 31 8 def key 253 64 0 Y 0 31 8 -def key_len 8 3 0 Y 32800 0 8 +def key_len 8 3 0 Y 32928 0 63 def ref 253 1024 0 Y 0 31 8 -def rows 8 10 1 N 32801 0 8 +def rows 8 10 1 N 32929 0 63 def Extra 253 255 0 N 1 31 8 id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t9 ALL NULL NULL NULL NULL 2 @@ -4198,15 +4198,15 @@ test_sequence prepare stmt1 from ' explain select * from t9 ' ; execute stmt1; Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def id 8 3 1 N 32801 0 8 +def id 8 3 1 N 32929 0 63 def select_type 253 19 6 N 1 31 8 def table 253 64 2 N 1 31 8 def type 253 10 3 N 1 31 8 def possible_keys 253 4096 0 Y 0 31 8 def key 253 64 0 Y 0 31 8 -def key_len 8 3 0 Y 32800 0 8 +def key_len 8 3 0 Y 32928 0 63 def ref 253 1024 0 Y 0 31 8 -def rows 8 10 1 N 32801 0 8 +def rows 8 10 1 N 32929 0 63 def Extra 253 255 0 N 1 31 8 id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t9 ALL NULL NULL NULL NULL 2 diff --git a/mysql-test/r/ps_6bdb.result b/mysql-test/r/ps_6bdb.result index 1e7ef526d37..8630ba2db9b 100644 --- a/mysql-test/r/ps_6bdb.result +++ b/mysql-test/r/ps_6bdb.result @@ -1145,15 +1145,15 @@ test_sequence prepare stmt1 from ' explain select * from t9 ' ; execute stmt1; Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def id 8 3 1 N 32801 0 8 +def id 8 3 1 N 32929 0 63 def select_type 253 19 6 N 1 31 8 def table 253 64 2 N 1 31 8 def type 253 10 3 N 1 31 8 def possible_keys 253 4096 0 Y 0 31 8 def key 253 64 0 Y 0 31 8 -def key_len 8 3 0 Y 32800 0 8 +def key_len 8 3 0 Y 32928 0 63 def ref 253 1024 0 Y 0 31 8 -def rows 8 10 1 N 32801 0 8 +def rows 8 10 1 N 32929 0 63 def Extra 253 255 0 N 1 31 8 id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t9 ALL NULL NULL NULL NULL 3 diff --git a/mysql-test/r/ps_7ndb.result b/mysql-test/r/ps_7ndb.result index 13b6894e9b5..43ff9607c55 100644 --- a/mysql-test/r/ps_7ndb.result +++ b/mysql-test/r/ps_7ndb.result @@ -1145,15 +1145,15 @@ test_sequence prepare stmt1 from ' explain select * from t9 ' ; execute stmt1; Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr -def id 8 3 1 N 32801 0 8 +def id 8 3 1 N 32929 0 63 def select_type 253 19 6 N 1 31 8 def table 253 64 2 N 1 31 8 def type 253 10 3 N 1 31 8 def possible_keys 253 4096 0 Y 0 31 8 def key 253 64 0 Y 0 31 8 -def key_len 8 3 0 Y 32800 0 8 +def key_len 8 3 0 Y 32928 0 63 def ref 253 1024 0 Y 0 31 8 -def rows 8 10 1 N 32801 0 8 +def rows 8 10 1 N 32929 0 63 def Extra 253 255 0 N 1 31 8 id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t9 ALL NULL NULL NULL NULL 2 diff --git a/mysql-test/r/union.result b/mysql-test/r/union.result index 49a2907f571..1eb978b1bd6 100644 --- a/mysql-test/r/union.result +++ b/mysql-test/r/union.result @@ -554,7 +554,7 @@ aa show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` char(20) NOT NULL default '' + `a` binary(20) NOT NULL default '' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; create table t1 SELECT 12 as a UNION select 12.2 as a; diff --git a/sql/item.cc b/sql/item.cc index 92a15694e89..640cc17411f 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -45,7 +45,7 @@ Item::Item(): { marker= 0; maybe_null=null_value=with_sum_func=unsigned_flag=0; - collation.set(default_charset(), DERIVATION_COERCIBLE); + collation.set(&my_charset_bin, DERIVATION_COERCIBLE); name= 0; decimals= 0; max_length= 0; diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index 3d79c16b5d0..6ec98f2dcd4 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -1094,6 +1094,9 @@ Item_func_nullif::fix_length_and_dec() max_length=args[0]->max_length; decimals=args[0]->decimals; agg_result_type(&cached_result_type, args, 2); + if (cached_result_type == STRING_RESULT && + agg_arg_charsets(collation, args, arg_count, MY_COLL_CMP_CONV)) + return; } } From b1a0f67a03e782495e027588c7c7bc204f0a82b6 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 18 Jan 2005 17:04:16 +0300 Subject: [PATCH 0779/1063] Clean up in implementation of f_is_geom()/f_is_bitfield()/f_is_enum() macros. It does not fixes any bugs in 4.0. But it prevents from future error in any bugfixes that may use these macros. Also after merging into 4.1 tree this cleanup will fix bug #7884 "Able to add invalid unique index on TIMESTAMP prefix". sql/field.h: Since FIELDFLAG_INTERVAL, FIELDFLAG_BITFIELD, FIELDFLAG_BLOB and FIELDFLAG_GEOM flags occupy the same space as number of decimals for FIELDFLAG_NUMBER fields, it is safer to check in "f_is_geom()"-type macros that we have non-number field, like we already do in f_is_blob() macro. --- sql/field.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sql/field.h b/sql/field.h index c42f5f63f0c..87a9732b41e 100644 --- a/sql/field.h +++ b/sql/field.h @@ -1101,10 +1101,10 @@ bool test_if_int(const char *str,int length); #define FIELDFLAG_NUMBER 2 #define FIELDFLAG_ZEROFILL 4 #define FIELDFLAG_PACK 120 // Bits used for packing -#define FIELDFLAG_INTERVAL 256 -#define FIELDFLAG_BITFIELD 512 // mangled with dec! -#define FIELDFLAG_BLOB 1024 // mangled with dec! -#define FIELDFLAG_GEOM 2048 +#define FIELDFLAG_INTERVAL 256 // mangled with decimals! +#define FIELDFLAG_BITFIELD 512 // mangled with decimals! +#define FIELDFLAG_BLOB 1024 // mangled with decimals! +#define FIELDFLAG_GEOM 2048 // mangled with decimals! #define FIELDFLAG_LEFT_FULLSCREEN 8192 #define FIELDFLAG_RIGHT_FULLSCREEN 16384 #define FIELDFLAG_FORMAT_NUMBER 16384 // predit: ###,,## in output @@ -1128,10 +1128,10 @@ bool test_if_int(const char *str,int length); #define f_decimals(x) ((uint8) (((x) >> FIELDFLAG_DEC_SHIFT) & FIELDFLAG_MAX_DEC)) #define f_is_alpha(x) (!f_is_num(x)) #define f_is_binary(x) ((x) & FIELDFLAG_BINARY) -#define f_is_enum(x) ((x) & FIELDFLAG_INTERVAL) -#define f_is_bitfield(x) ((x) & FIELDFLAG_BITFIELD) +#define f_is_enum(x) (((x) & (FIELDFLAG_INTERVAL | FIELDFLAG_NUMBER)) == FIELDFLAG_INTERVAL) +#define f_is_bitfield(x) (((x) & (FIELDFLAG_BITFIELD | FIELDFLAG_NUMBER)) == FIELDFLAG_BITFIELD) #define f_is_blob(x) (((x) & (FIELDFLAG_BLOB | FIELDFLAG_NUMBER)) == FIELDFLAG_BLOB) -#define f_is_geom(x) ((x) & FIELDFLAG_GEOM) +#define f_is_geom(x) (((x) & (FIELDFLAG_GEOM | FIELDFLAG_NUMBER)) == FIELDFLAG_GEOM) #define f_is_equ(x) ((x) & (1+2+FIELDFLAG_PACK+31*256)) #define f_settype(x) (((int) x) << FIELDFLAG_PACK_SHIFT) #define f_maybe_null(x) (x & FIELDFLAG_MAYBE_NULL) From e46d235a08a35bdd5536b4b2b99ed3a5b6910cdf Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 18 Jan 2005 17:26:04 +0300 Subject: [PATCH 0780/1063] Cleanups in Makefile.ams client/Makefile.am: Remove explicit _DEPENDENCIES, they are not needed with automatic dependency tracking wich we started using several months ago. Don't use relative paths in makefiles. regex/Makefile.am: Remove explicit _DEPENDENCIES, they are not needed with automatic dependency tracking wich we started using several months ago. Don't use relative paths. strings/Makefile.am: Remove dead rule. --- client/Makefile.am | 18 ++++-------------- regex/Makefile.am | 3 +-- strings/Makefile.am | 1 - 3 files changed, 5 insertions(+), 17 deletions(-) diff --git a/client/Makefile.am b/client/Makefile.am index 0404aacb383..da13c3e9763 100644 --- a/client/Makefile.am +++ b/client/Makefile.am @@ -20,9 +20,8 @@ INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/regex \ $(openssl_includes) LIBS = @CLIENT_LIBS@ -DEPLIB= ../libmysql/libmysqlclient.la -REGEXLIB= ../regex/libregex.a -LDADD = @CLIENT_EXTRA_LDFLAGS@ $(DEPLIB) +LDADD= @CLIENT_EXTRA_LDFLAGS@ \ + $(top_builddir)/libmysql/libmysqlclient.la bin_PROGRAMS = mysql mysqladmin mysqlcheck mysqlshow \ mysqldump mysqlimport mysqltest mysqlbinlog mysqlmanagerc mysqlmanager-pwgen noinst_HEADERS = sql_string.h completion_hash.h my_readline.h \ @@ -31,19 +30,10 @@ mysql_SOURCES = mysql.cc readline.cc sql_string.cc completion_hash.cc mysqladmin_SOURCES = mysqladmin.cc mysql_LDADD = @readline_link@ @TERMCAP_LIB@ $(LDADD) $(CXXLDFLAGS) mysqlbinlog_LDADD = $(LDADD) $(CXXLDFLAGS) -mysql_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES) $(DEPLIB) -mysqladmin_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES) $(DEPLIB) -mysqlcheck_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES) $(DEPLIB) -mysqlshow_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES) $(DEPLIB) -mysqldump_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES) $(DEPLIB) -mysqlimport_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES) $(DEPLIB) -mysqltest_SOURCES= mysqltest.c ../mysys/my_getsystime.c -mysqltest_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES) $(REGEXLIB) $(DEPLIB) -mysqltest_LDADD = $(REGEXLIB) $(LDADD) +mysqltest_SOURCES= mysqltest.c $(top_srcdir)/mysys/my_getsystime.c +mysqltest_LDADD = $(top_builddir)/regex/libregex.a $(LDADD) mysqlbinlog_SOURCES = mysqlbinlog.cc ../mysys/mf_tempdir.c -mysqlbinlog_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES) $(DEPLIB) mysqlmanagerc_SOURCES = mysqlmanagerc.c -mysqlmanagerc_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES) $(DEPLIB) sql_src=log_event.h log_event.cc # Fix for mit-threads diff --git a/regex/Makefile.am b/regex/Makefile.am index 2e23efcbf2a..ee7fc5463b7 100644 --- a/regex/Makefile.am +++ b/regex/Makefile.am @@ -17,12 +17,11 @@ INCLUDES = @MT_INCLUDES@ -I$(top_srcdir)/include noinst_LIBRARIES = libregex.a -LDADD = libregex.a ../strings/libmystrings.a +LDADD= libregex.a $(top_builddir)/strings/libmystrings.a noinst_HEADERS = cclass.h cname.h regex2.h utils.h engine.c regex.h libregex_a_SOURCES = regerror.c regcomp.c regexec.c regfree.c reginit.c noinst_PROGRAMS = re re_SOURCES = split.c debug.c main.c -re_DEPENDENCIES= $(LIBRARIES) re_LDFLAGS= @NOINST_LDFLAGS@ EXTRA_DIST = tests CHANGES COPYRIGHT WHATSNEW regexp.c \ debug.ih engine.ih main.ih regcomp.ih regerror.ih \ diff --git a/strings/Makefile.am b/strings/Makefile.am index d17a4f598a6..83f935a3fd2 100644 --- a/strings/Makefile.am +++ b/strings/Makefile.am @@ -40,7 +40,6 @@ endif libmystrings_a_SOURCES = $(ASRCS) $(CSRCS) noinst_PROGRAMS = conf_to_src -DISTCLEANFILES = ctype_autoconf.c # Default charset definitions EXTRA_DIST = ctype-big5.c ctype-czech.c ctype-euc_kr.c ctype-win1250ch.c \ ctype-gb2312.c ctype-gbk.c ctype-sjis.c ctype-utf8.c \ From 2e50981af908bff71c330d4caff40338ee2356d8 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 18 Jan 2005 17:26:05 +0300 Subject: [PATCH 0781/1063] Fix for BUG#7885 mysql-test/r/subselect.result: Testcase for BUG#7885 mysql-test/t/subselect.test: Testcase for BUG#7885 sql/item_subselect.cc: Fix for BUG#7885: In Item_subselect::fix_fields, return error if engine->prepare fails. Also removed redundant code line. --- mysql-test/r/subselect.result | 8 ++++++++ mysql-test/t/subselect.test | 11 +++++++++++ sql/item_subselect.cc | 3 ++- 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index 9c442d8e3cb..02662f9900a 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -2152,3 +2152,11 @@ WHERE f1 <> ALL ( SELECT SUM(f1) AS sf1 FROM t2 HAVING sf1 > 10000); f1 NULL 1 +drop table t1,t2; +create table t1 (a1 int); +create table t2 (b1 int); +select * from t1 where a2 > any(select b1 from t2); +ERROR 42S22: Unknown column 'a2' in 'scalar IN/ALL/ANY subquery' +select * from t1 where a1 > any(select b1 from t2); +a1 +drop table t1,t2; diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test index 6e4c3a5d604..3ee498ee380 100644 --- a/mysql-test/t/subselect.test +++ b/mysql-test/t/subselect.test @@ -1412,3 +1412,14 @@ SELECT f1 FROM t1 SELECT f1 FROM t1 WHERE f1 <> ALL ( SELECT SUM(f1) AS sf1 FROM t2 HAVING sf1 > 10000); + +drop table t1,t2; +# Test for BUG#7885: Server crash when 'any' subselect compared to +# non-existant field. +create table t1 (a1 int); +create table t2 (b1 int); +--error 1054 +select * from t1 where a2 > any(select b1 from t2); +select * from t1 where a1 > any(select b1 from t2); +drop table t1,t2; + diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index e1a80941a52..8516ea76a7e 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -177,6 +177,8 @@ bool Item_subselect::fix_fields(THD *thd_param, TABLE_LIST *tables, Item **ref) } fix_length_and_dec(); } + else + return 1; uint8 uncacheable= engine->uncacheable(); if (uncacheable) { @@ -264,7 +266,6 @@ Item_singlerow_subselect::Item_singlerow_subselect(st_select_lex *select_lex) { DBUG_ENTER("Item_singlerow_subselect::Item_singlerow_subselect"); init(select_lex, new select_singlerow_subselect(this)); - max_columns= 1; maybe_null= 1; max_columns= UINT_MAX; DBUG_VOID_RETURN; From e2c869f2ff92b72917ecb4d16cf9408be174eb71 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 18 Jan 2005 17:45:49 +0300 Subject: [PATCH 0782/1063] Added test for bug #7884 "Able to add invalid unique index on TIMESTAMP prefix", which roots were fixed in 4.0 tree. mysql-test/r/alter_table.result: Added test for bug #7884 "Able to add invalid unique index on TIMESTAMP prefix". mysql-test/t/alter_table.test: Added test for bug #7884 "Able to add invalid unique index on TIMESTAMP prefix". --- mysql-test/r/alter_table.result | 4 ++++ mysql-test/t/alter_table.test | 11 +++++++++++ 2 files changed, 15 insertions(+) diff --git a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result index a7ae8bc310c..7d2b3f01ae6 100644 --- a/mysql-test/r/alter_table.result +++ b/mysql-test/r/alter_table.result @@ -493,3 +493,7 @@ select hex(a) from t1; hex(a) F2E5F1F2 drop table t1; +create table t1 ( a timestamp ); +alter table t1 add unique ( a(1) ); +ERROR HY000: Incorrect sub part key; the used key part isn't a string, the used length is longer than the key part, or the storage engine doesn't support unique sub keys +drop table t1; diff --git a/mysql-test/t/alter_table.test b/mysql-test/t/alter_table.test index 66a4adc90fe..c2277dc1755 100644 --- a/mysql-test/t/alter_table.test +++ b/mysql-test/t/alter_table.test @@ -336,3 +336,14 @@ select hex(a) from t1; alter table t1 convert to character set cp1251; select hex(a) from t1; drop table t1; + +# +# Test for bug #7884 "Able to add invalid unique index on TIMESTAMP prefix" +# MySQL should not think that packed field with non-zero decimals is +# geometry field and allow to create prefix index which is +# shorter than packed field length. +# +create table t1 ( a timestamp ); +--error 1089 +alter table t1 add unique ( a(1) ); +drop table t1; From c148946d03c17a996f6819af3e713af14ad17f23 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 18 Jan 2005 17:35:32 +0100 Subject: [PATCH 0783/1063] - small improvement for the logrotate config file (patch found in the SUSE source RPM): use "mysqladmin ping" instead of grepping the process list for the mysqld binary (should be more portable than relying on the "ps" options support-files/mysql-log-rotate.sh: - small improvement (patch found in the SUSE source RPM): use "mysqladmin ping" instead of grepping the process list for the mysqld binary (should be more portable than relying on the "ps" options --- support-files/mysql-log-rotate.sh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/support-files/mysql-log-rotate.sh b/support-files/mysql-log-rotate.sh index a1153c66f40..0ee78b0f7ca 100644 --- a/support-files/mysql-log-rotate.sh +++ b/support-files/mysql-log-rotate.sh @@ -1,4 +1,9 @@ -# This logname is set in mysql.server.sh that ends up in /etc/rc.d/init.d/mysql +# This logname can be set in /etc/my.cnf +# by setting the variable "err-log" +# in the [safe_mysqld] section as follows: +# +# [safe_mysqld] +# err-log=@localstatedir@/mysqld.log # # If the root user has a password you have to create a # /root/.my.cnf configuration file with the following @@ -22,8 +27,10 @@ compress postrotate # just if mysqld is really running - if test -n "`ps acx|grep mysqld`"; then - @bindir@/mysqladmin flush-logs + if test -x @bindir@/mysqladmin && \ + @bindir@/mysqladmin ping &>/dev/null + then + @bindir@/mysqladmin flush-logs fi endscript } From 08ea4df60b4e9546dd989afa29284970345c0ac5 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 18 Jan 2005 13:12:40 -0800 Subject: [PATCH 0784/1063] Update type_float test results after merge. mysql-test/r/type_float.result: Update test results (4.1 produces a warning that 4.0 did not, and they were merged into the wrong position). --- mysql-test/r/type_float.result | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/mysql-test/r/type_float.result b/mysql-test/r/type_float.result index 6e8275d5dac..1f5a34917d7 100644 --- a/mysql-test/r/type_float.result +++ b/mysql-test/r/type_float.result @@ -143,6 +143,15 @@ drop table t1; create table t1 (f float(54)); ERROR 42000: Incorrect column specifier for column 'f' drop table if exists t1; +create table t1 (d1 double, d2 double unsigned); +insert into t1 set d1 = -1.0; +update t1 set d2 = d1; +Warnings: +Warning 1264 Data truncated; out of range for column 'd2' at row 1 +select * from t1; +d1 d2 +-1 0 +drop table t1; create table t1 (f float(4,3)); insert into t1 values (-11.0),(-11),("-11"),(11.0),(11),("11"); Warnings: @@ -179,13 +188,6 @@ f 9.999 9.999 drop table if exists t1; -create table t1 (d1 double, d2 double unsigned); -insert into t1 set d1 = -1.0; -update t1 set d2 = d1; -select * from t1; -d1 d2 --1 0 -drop table t1; create table t1 (c char(20)); insert into t1 values (5e-28); select * from t1; From 59ef5bede94cb0955590b16ead9352c17a5fd7ac Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 18 Jan 2005 23:13:29 +0200 Subject: [PATCH 0785/1063] fixing wrong value for "examined rows" when UNION's are used. mysql-test/r/union.result: result for a test case for the wrong examined rows with UNION's mysql-test/t/union.test: test case for the wrong examined rows with UNION's sql/sql_union.cc: a patch for the wrong examined rows with UNION's --- mysql-test/r/union.result | 16 ++++++++++++++++ mysql-test/t/union.test | 4 ++++ sql/sql_union.cc | 11 +++++++---- 3 files changed, 27 insertions(+), 4 deletions(-) diff --git a/mysql-test/r/union.result b/mysql-test/r/union.result index 1eb978b1bd6..f07bdad9021 100644 --- a/mysql-test/r/union.result +++ b/mysql-test/r/union.result @@ -872,6 +872,22 @@ count(*) show status like 'Slow_queries'; Variable_name Value Slow_queries 3 +flush status; +select a from t1 where b not in (1,2,3) union select a from t1 where b not in (4,5,6); +a +4 +5 +3 +6 +7 +8 +9 +10 +1 +2 +show status like 'Slow_queries'; +Variable_name Value +Slow_queries 1 drop table t1; create table t1 ( RID int(11) not null default '0', IID int(11) not null default '0', nada varchar(50) not null,NAME varchar(50) not null,PHONE varchar(50) not null) engine=MyISAM; insert into t1 ( RID,IID,nada,NAME,PHONE) values (1, 1, 'main', 'a', '111'), (2, 1, 'main', 'b', '222'), (3, 1, 'main', 'c', '333'), (4, 1, 'main', 'd', '444'), (5, 1, 'main', 'e', '555'), (6, 2, 'main', 'c', '333'), (7, 2, 'main', 'd', '454'), (8, 2, 'main', 'e', '555'), (9, 2, 'main', 'f', '666'), (10, 2, 'main', 'g', '777'); diff --git a/mysql-test/t/union.test b/mysql-test/t/union.test index 468a88b83db..8682808f3f3 100644 --- a/mysql-test/t/union.test +++ b/mysql-test/t/union.test @@ -481,6 +481,10 @@ select count(*) from t1 where b=13 union select count(*) from t1 where a=7; show status like 'Slow_queries'; select count(*) from t1 where a=7 union select count(*) from t1 where b=13; show status like 'Slow_queries'; +# additional test for examined rows +flush status; +select a from t1 where b not in (1,2,3) union select a from t1 where b not in (4,5,6); +show status like 'Slow_queries'; drop table t1; # diff --git a/sql/sql_union.cc b/sql/sql_union.cc index f89b234f5b0..027a21db7ac 100644 --- a/sql/sql_union.cc +++ b/sql/sql_union.cc @@ -466,11 +466,14 @@ int st_select_lex_unit::exec() } res= sl->join->error; offset_limit_cnt= sl->offset_limit; - if (!res && union_result->flush()) + if (!res) { - examined_rows+= thd->examined_row_count; - thd->lex->current_select= lex_select_save; - DBUG_RETURN(1); + examined_rows+= thd->examined_row_count; + if (union_result->flush()) + { + thd->lex->current_select= lex_select_save; + DBUG_RETURN(1); + } } } if (res) From 395137e1b209ef5542a482274691959101d0a72a Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 18 Jan 2005 15:59:39 -0800 Subject: [PATCH 0786/1063] Fix query cache to not respond to old clients with a 4.1-protocol response. (Bug #6511) sql/mysql_priv.h: Add bit for storing client protocol info sql/sql_cache.cc: Record whether 4.1 or old protocol is used for query --- sql/mysql_priv.h | 1 + sql/sql_cache.cc | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 4b785aafc5f..314c6928c1c 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -377,6 +377,7 @@ Item *negate_expression(THD *thd, Item *expr); struct Query_cache_query_flags { unsigned int client_long_flag:1; + unsigned int client_protocol_41:1; uint character_set_client_num; uint character_set_results_num; uint collation_connection_num; diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc index bd42a2c1720..8491457179f 100644 --- a/sql/sql_cache.cc +++ b/sql/sql_cache.cc @@ -776,6 +776,8 @@ void Query_cache::store_query(THD *thd, TABLE_LIST *tables_used) bzero(&flags, QUERY_CACHE_FLAGS_SIZE); flags.client_long_flag= (thd->client_capabilities & CLIENT_LONG_FLAG ? 1 : 0); + flags.client_protocol_41= (thd->client_capabilities & CLIENT_PROTOCOL_41 ? + 1 : 0); flags.character_set_client_num= thd->variables.character_set_client->number; flags.character_set_results_num= @@ -968,6 +970,8 @@ Query_cache::send_result_to_client(THD *thd, char *sql, uint query_length) bzero(&flags, QUERY_CACHE_FLAGS_SIZE); flags.client_long_flag= (thd->client_capabilities & CLIENT_LONG_FLAG ? 1 : 0); + flags.client_protocol_41= (thd->client_capabilities & CLIENT_PROTOCOL_41 ? + 1 : 0); flags.character_set_client_num= thd->variables.character_set_client->number; flags.character_set_results_num= (thd->variables.character_set_results ? From 153160d1ffd9d118867c3e5c41474f435e5c981f Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 19 Jan 2005 07:23:20 +0100 Subject: [PATCH 0787/1063] bug#7693 - ndb when using shm transporter, set sigmask on each thread using pthread_sigmask configure.in: Add more functions needed for SHM ndb/src/common/portlib/NdbThread.c: 1) Create thread wrapper function 2) block SIGUSR1 #ifdef NDB_SHM_TRANSPORTER ndb/src/common/transporter/TransporterRegistry.cpp: (un)block SIGUSR1 #ifdef NDB_SHM_TRANSPORTER sql/ha_ndbcluster.cc: cast pointer to UintPtr before printout --- configure.in | 7 ++++-- ndb/src/common/portlib/NdbThread.c | 22 +++++++++++++++++-- .../transporter/TransporterRegistry.cpp | 16 ++++++++++++-- sql/ha_ndbcluster.cc | 4 ++-- 4 files changed, 41 insertions(+), 8 deletions(-) diff --git a/configure.in b/configure.in index b1b8b128f46..2d20a71f838 100644 --- a/configure.in +++ b/configure.in @@ -1924,7 +1924,7 @@ AC_CHECK_FUNCS(alarm bcmp bfill bmove bzero chsize cuserid fchmod fcntl \ pthread_key_delete pthread_rwlock_rdlock pthread_setprio \ pthread_setprio_np pthread_setschedparam pthread_sigmask readlink \ realpath rename rint rwlock_init setupterm \ - shmget shmat shmdt shmctl sigaction \ + shmget shmat shmdt shmctl sigaction sigemptyset sigaddset \ sighold sigset sigthreadmask \ snprintf socket stpcpy strcasecmp strerror strnlen strpbrk strstr strtol \ strtoll strtoul strtoull tell tempnam thr_setconcurrency vidattr) @@ -3098,7 +3098,10 @@ if test "$ac_cv_func_shmget" = "yes" && test "$ac_cv_func_shmat" = "yes" && test "$ac_cv_func_shmdt" = "yes" && test "$ac_cv_func_shmctl" = "yes" && - test "$ac_cv_func_sigaction" = "yes" + test "$ac_cv_func_sigaction" = "yes" && + test "$ac_cv_func_sigemptyset" = "yes" && + test "$ac_cv_func_sigaddset" = "yes" && + test "$ac_cv_func_pthread_sigmask" = "yes" then AC_DEFINE([NDB_SHM_TRANSPORTER], [1], [Including Ndb Cluster DB shared memory transporter]) diff --git a/ndb/src/common/portlib/NdbThread.c b/ndb/src/common/portlib/NdbThread.c index d4f6617d2f5..8cd6c306514 100644 --- a/ndb/src/common/portlib/NdbThread.c +++ b/ndb/src/common/portlib/NdbThread.c @@ -28,8 +28,24 @@ struct NdbThread { pthread_t thread; char thread_name[MAX_THREAD_NAME]; + NDB_THREAD_FUNC * func; + void * object; }; +static +void* +ndb_thread_wrapper(void* _ss){ + void * ret; + struct NdbThread * ss = (struct NdbThread *)_ss; +#ifdef NDB_SHM_TRANSPORTER + sigset_t mask; + sigemptyset(&mask); + sigaddset(&mask, SIGUSR1); + pthread_sigmask(SIG_BLOCK, &mask, 0); +#endif + ret= (* ss->func)(ss->object); + return ret; +} struct NdbThread* NdbThread_Create(NDB_THREAD_FUNC *p_thread_func, @@ -67,10 +83,12 @@ struct NdbThread* NdbThread_Create(NDB_THREAD_FUNC *p_thread_func, #ifdef PTHREAD_CREATE_JOINABLE /* needed on SCO */ pthread_attr_setdetachstate(&thread_attr, PTHREAD_CREATE_JOINABLE); #endif + tmpThread->func= p_thread_func; + tmpThread->object= p_thread_arg; result = pthread_create(&tmpThread->thread, &thread_attr, - p_thread_func, - p_thread_arg); + ndb_thread_wrapper, + tmpThread); assert(result==0); pthread_attr_destroy(&thread_attr); diff --git a/ndb/src/common/transporter/TransporterRegistry.cpp b/ndb/src/common/transporter/TransporterRegistry.cpp index c80e6bc1489..ddc01454205 100644 --- a/ndb/src/common/transporter/TransporterRegistry.cpp +++ b/ndb/src/common/transporter/TransporterRegistry.cpp @@ -153,8 +153,17 @@ TransporterRegistry::init(NodeId nodeId) { DEBUG("TransporterRegistry started node: " << localNodeId); - // return allocateLongSignalMemoryPool(nLargeSegments); - return true; +#ifdef NDB_SHM_TRANSPORTER + /** + * Make sure to block SIGUSR1 + * TransporterRegistry::init is run from "main" thread + */ + sigset_t mask; + sigemptyset(&mask); + sigaddset(&mask, SIGUSR1); + pthread_sigmask(SIG_BLOCK, &mask, 0); +#endif +return true; } bool @@ -1321,6 +1330,9 @@ TransporterRegistry::startReceiving() #ifdef NDB_SHM_TRANSPORTER m_shm_own_pid = getpid(); struct sigaction sa; + sigemptyset(&sa.sa_mask); + sigaddset(&sa.sa_mask, SIGUSR1); + pthread_sigmask(SIG_UNBLOCK, &sa.sa_mask, 0); sa.sa_handler = shm_sig_handler; sigemptyset(&sa.sa_mask); sa.sa_flags = 0; diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index e4c45490050..c2d12ddd316 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -583,7 +583,7 @@ int ha_ndbcluster::get_ndb_blobs_value(NdbBlob *last_ndb_blob) char *buf= m_blobs_buffer + offset; uint32 len= 0xffffffff; // Max uint32 DBUG_PRINT("value", ("read blob ptr=%x len=%u", - (uint)buf, (uint)blob_len)); + (UintPtr)buf, (uint)blob_len)); if (ndb_blob->readData(buf, len) != 0) DBUG_RETURN(-1); DBUG_ASSERT(len == blob_len); @@ -3169,7 +3169,7 @@ int ha_ndbcluster::start_stmt(THD *thd) NdbConnection *tablock_trans= (NdbConnection*)thd->transaction.all.ndb_tid; - DBUG_PRINT("info", ("tablock_trans: %x", (uint)tablock_trans)); + DBUG_PRINT("info", ("tablock_trans: %x", (UintPtr)tablock_trans)); DBUG_ASSERT(tablock_trans); // trans= ndb->hupp(tablock_trans); trans= ndb->startTransaction(); From ed327104b6803959f7f5acb4dc84afd117ad26b4 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 19 Jan 2005 09:15:34 +0100 Subject: [PATCH 0788/1063] bug#7777 - ndb compile on qnx remove usage of compiler supplied and instead impl. own inlined placement new ndb/include/kernel/AttributeHeader.hpp: remove usage ndb/include/ndb_global.h.in: remove usage instead impl. own ndb/src/kernel/blocks/backup/BackupInit.cpp: remove usage ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp: remove usage ndb/src/kernel/blocks/dbdih/DbdihInit.cpp: remove usage ndb/src/kernel/blocks/dblqh/DblqhInit.cpp: remove usage ndb/src/kernel/blocks/dbtc/DbtcInit.cpp: remove usage ndb/src/kernel/blocks/dbtup/DbtupGen.cpp: remove usage ndb/src/kernel/blocks/dbtux/Dbtux.hpp: remove usage ndb/src/kernel/blocks/grep/GrepInit.cpp: remove usage ndb/src/kernel/blocks/suma/SumaInit.cpp: remove usage ndb/src/kernel/vm/Emulator.cpp: remove usage ndb/src/kernel/vm/SimulatedBlock.hpp: remove usage ndb/src/mgmapi/mgmapi_configuration.cpp: remove usage --- ndb/include/kernel/AttributeHeader.hpp | 1 - ndb/include/ndb_global.h.in | 6 ++---- ndb/src/kernel/blocks/backup/BackupInit.cpp | 1 - ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp | 1 - ndb/src/kernel/blocks/dbdih/DbdihInit.cpp | 1 - ndb/src/kernel/blocks/dblqh/DblqhInit.cpp | 1 - ndb/src/kernel/blocks/dbtc/DbtcInit.cpp | 1 - ndb/src/kernel/blocks/dbtup/DbtupGen.cpp | 1 - ndb/src/kernel/blocks/dbtux/Dbtux.hpp | 1 - ndb/src/kernel/blocks/grep/GrepInit.cpp | 1 - ndb/src/kernel/blocks/suma/SumaInit.cpp | 1 - ndb/src/kernel/vm/Emulator.cpp | 1 - ndb/src/kernel/vm/SimulatedBlock.hpp | 1 - ndb/src/mgmapi/mgmapi_configuration.cpp | 1 - 14 files changed, 2 insertions(+), 17 deletions(-) diff --git a/ndb/include/kernel/AttributeHeader.hpp b/ndb/include/kernel/AttributeHeader.hpp index b807b4ef4f1..ed9085301be 100644 --- a/ndb/include/kernel/AttributeHeader.hpp +++ b/ndb/include/kernel/AttributeHeader.hpp @@ -17,7 +17,6 @@ #ifndef ATTRIBUTE_HEADER #define ATTRIBUTE_HEADER -#include /** * @class AttributeHeader * @brief Header passed in front of every attribute value in AttrInfo signal diff --git a/ndb/include/ndb_global.h.in b/ndb/include/ndb_global.h.in index d7a5cb1b1cf..eadd5e37b9b 100644 --- a/ndb/include/ndb_global.h.in +++ b/ndb/include/ndb_global.h.in @@ -138,10 +138,8 @@ static const char table_name_separator = '/'; #endif #ifdef __cplusplus -#include -#endif - -#ifdef __cplusplus +inline void* operator new(size_t, void* __p) { return __p; } +inline void* operator new[](size_t, void* __p) { return __p; } extern "C" { #endif diff --git a/ndb/src/kernel/blocks/backup/BackupInit.cpp b/ndb/src/kernel/blocks/backup/BackupInit.cpp index e0171c61eca..08fa089a9c0 100644 --- a/ndb/src/kernel/blocks/backup/BackupInit.cpp +++ b/ndb/src/kernel/blocks/backup/BackupInit.cpp @@ -22,7 +22,6 @@ //=========================================================================== #include "Backup.hpp" -#include #include #include diff --git a/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp b/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp index c1dca184466..dfae180ae71 100644 --- a/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp +++ b/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp @@ -39,7 +39,6 @@ #include #include -#include #include #include diff --git a/ndb/src/kernel/blocks/dbdih/DbdihInit.cpp b/ndb/src/kernel/blocks/dbdih/DbdihInit.cpp index b823dbcd952..9a5efebc56e 100644 --- a/ndb/src/kernel/blocks/dbdih/DbdihInit.cpp +++ b/ndb/src/kernel/blocks/dbdih/DbdihInit.cpp @@ -18,7 +18,6 @@ #define DBDIH_C #include "Dbdih.hpp" #include -#include #define DEBUG(x) { ndbout << "DIH::" << x << endl; } diff --git a/ndb/src/kernel/blocks/dblqh/DblqhInit.cpp b/ndb/src/kernel/blocks/dblqh/DblqhInit.cpp index 0577aa4d344..ec29489180c 100644 --- a/ndb/src/kernel/blocks/dblqh/DblqhInit.cpp +++ b/ndb/src/kernel/blocks/dblqh/DblqhInit.cpp @@ -19,7 +19,6 @@ #define DBLQH_C #include "Dblqh.hpp" #include -#include #define DEBUG(x) { ndbout << "LQH::" << x << endl; } diff --git a/ndb/src/kernel/blocks/dbtc/DbtcInit.cpp b/ndb/src/kernel/blocks/dbtc/DbtcInit.cpp index 5c66ba776b0..59c8237f20a 100644 --- a/ndb/src/kernel/blocks/dbtc/DbtcInit.cpp +++ b/ndb/src/kernel/blocks/dbtc/DbtcInit.cpp @@ -20,7 +20,6 @@ #include #include #include -#include #define DEBUG(x) { ndbout << "TC::" << x << endl; } diff --git a/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp b/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp index 0f0e6d61f41..0d7430e662d 100644 --- a/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp +++ b/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp @@ -31,7 +31,6 @@ #include #include -#include #define DEBUG(x) { ndbout << "TUP::" << x << endl; } diff --git a/ndb/src/kernel/blocks/dbtux/Dbtux.hpp b/ndb/src/kernel/blocks/dbtux/Dbtux.hpp index 8af83e3c056..2c96271eb5d 100644 --- a/ndb/src/kernel/blocks/dbtux/Dbtux.hpp +++ b/ndb/src/kernel/blocks/dbtux/Dbtux.hpp @@ -17,7 +17,6 @@ #ifndef DBTUX_H #define DBTUX_H -#include #include #include #include diff --git a/ndb/src/kernel/blocks/grep/GrepInit.cpp b/ndb/src/kernel/blocks/grep/GrepInit.cpp index 36855f86568..d764fb1f473 100644 --- a/ndb/src/kernel/blocks/grep/GrepInit.cpp +++ b/ndb/src/kernel/blocks/grep/GrepInit.cpp @@ -15,7 +15,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "Grep.hpp" -#include #include #include diff --git a/ndb/src/kernel/blocks/suma/SumaInit.cpp b/ndb/src/kernel/blocks/suma/SumaInit.cpp index 36217c313af..b5945db3811 100644 --- a/ndb/src/kernel/blocks/suma/SumaInit.cpp +++ b/ndb/src/kernel/blocks/suma/SumaInit.cpp @@ -16,7 +16,6 @@ #include "Suma.hpp" -#include #include #include diff --git a/ndb/src/kernel/vm/Emulator.cpp b/ndb/src/kernel/vm/Emulator.cpp index adf3c438945..068610b6778 100644 --- a/ndb/src/kernel/vm/Emulator.cpp +++ b/ndb/src/kernel/vm/Emulator.cpp @@ -33,7 +33,6 @@ #include #include #include -#include extern "C" { extern void (* ndb_new_handler)(); diff --git a/ndb/src/kernel/vm/SimulatedBlock.hpp b/ndb/src/kernel/vm/SimulatedBlock.hpp index cff19734368..787d14ca5cb 100644 --- a/ndb/src/kernel/vm/SimulatedBlock.hpp +++ b/ndb/src/kernel/vm/SimulatedBlock.hpp @@ -36,7 +36,6 @@ #include #include -#include #include "DLList.hpp" #include "ArrayPool.hpp" #include "DLHashTable.hpp" diff --git a/ndb/src/mgmapi/mgmapi_configuration.cpp b/ndb/src/mgmapi/mgmapi_configuration.cpp index 7bac2d10b92..80ab428c05a 100644 --- a/ndb/src/mgmapi/mgmapi_configuration.cpp +++ b/ndb/src/mgmapi/mgmapi_configuration.cpp @@ -1,7 +1,6 @@ #include #include #include "mgmapi_configuration.hpp" -#include ndb_mgm_configuration_iterator::ndb_mgm_configuration_iterator (const ndb_mgm_configuration & conf, unsigned type_of_section) From d374ed9c0444d690fc9f5eb979014e6e2efc9069 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 19 Jan 2005 10:00:41 +0100 Subject: [PATCH 0789/1063] added possibility to add extra opts to ndbd and ndb_mgmd in mysql-test-run --- mysql-test/mysql-test-run.sh | 9 ++++++++- mysql-test/ndb/ndbcluster.sh | 13 +++++++++++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index 9684a880510..722da516d9b 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -241,6 +241,9 @@ USE_EMBEDDED_SERVER="" RESULT_EXT="" TEST_MODE="default" +NDB_MGMD_EXTRA_OPTS= +NDBD_EXTRA_OPTS= + while test $# -gt 0; do case "$1" in --embedded-server) USE_EMBEDDED_SERVER=1 USE_MANAGER=0 NO_SLAVE=1 ; \ @@ -261,6 +264,10 @@ while test $# -gt 0; do --ndb-connectstring=*) USE_NDBCLUSTER="--ndbcluster" ; USE_RUNNING_NDBCLUSTER=`$ECHO "$1" | $SED -e "s;--ndb-connectstring=;;"` ;; + --ndb_mgmd-extra-opts=*) + NDB_MGMD_EXTRA_OPTS=`$ECHO "$1" | $SED -e "s;--ndb_mgmd-extra-opts=;;"` ;; + --ndbd-extra-opts=*) + NDBD_EXTRA_OPTS=`$ECHO "$1" | $SED -e "s;--ndbd-extra-opts=;;"` ;; --tmpdir=*) MYSQL_TMP_DIR=`$ECHO "$1" | $SED -e "s;--tmpdir=;;"` ;; --local-master) MASTER_MYPORT=3306; @@ -460,7 +467,7 @@ SMALL_SERVER="--key_buffer_size=1M --sort_buffer=256K --max_heap_table_size=1M" export MASTER_MYPORT MASTER_MYPORT1 SLAVE_MYPORT MYSQL_TCP_PORT MASTER_MYSOCK MASTER_MYSOCK1 NDBCLUSTER_BASE_PORT=`expr $NDBCLUSTER_PORT + 2` -NDBCLUSTER_OPTS="--port=$NDBCLUSTER_PORT --port-base=$NDBCLUSTER_BASE_PORT --data-dir=$MYSQL_TEST_DIR/var" +NDBCLUSTER_OPTS="--port=$NDBCLUSTER_PORT --port-base=$NDBCLUSTER_BASE_PORT --data-dir=$MYSQL_TEST_DIR/var --ndb_mgmd-extra-opts=\"$NDB_MGMD_EXTRA_OPTS\" --ndbd-extra-opts=\"$NDBD_EXTRA_OPTS\"" if [ x$SOURCE_DIST = x1 ] ; then MY_BASEDIR=$MYSQL_TEST_DIR diff --git a/mysql-test/ndb/ndbcluster.sh b/mysql-test/ndb/ndbcluster.sh index 2d529f8fe0f..a86e482b2ab 100644 --- a/mysql-test/ndb/ndbcluster.sh +++ b/mysql-test/ndb/ndbcluster.sh @@ -58,6 +58,9 @@ ndb_con_op=105000 ndb_dmem=80M ndb_imem=24M +NDB_MGMD_EXTRA_OPTS= +NDBD_EXTRA_OPTS= + while test $# -gt 0; do case "$1" in --test) @@ -94,6 +97,12 @@ while test $# -gt 0; do --port-base=*) port_base=`echo "$1" | sed -e "s;--port-base=;;"` ;; + --ndb_mgmd-extra-opts=*) + NDB_MGMD_EXTRA_OPTS=`echo "$1" | sed -e "s;--ndb_mgmd-extra-opts=;;"` + ;; + --ndbd-extra-opts=*) + NDBD_EXTRA_OPTS=`echo "$1" | sed -e "s;--ndbd-extra-opts=;;"` + ;; -- ) shift; break ;; --* ) $ECHO "Unrecognized option: $1"; exit 1 ;; * ) break ;; @@ -122,8 +131,8 @@ if [ ! -x "$exec_waiter" ]; then fi exec_mgmtclient="$exec_mgmtclient --no-defaults" -exec_mgmtsrvr="$exec_mgmtsrvr --no-defaults" -exec_ndb="$exec_ndb --no-defaults" +exec_mgmtsrvr="$exec_mgmtsrvr --no-defaults $NDB_MGMD_EXTRA_OPTS" +exec_ndb="$exec_ndb --no-defaults $NDBD_EXTRA_OPTS" exec_waiter="$exec_waiter --no-defaults" ndb_host="localhost" From 8e1e1e73d811d4090255b49128ffa697163b2e1d Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 19 Jan 2005 12:55:54 +0200 Subject: [PATCH 0790/1063] Final patch for BUG#4285. This patch collects all previous patches into one. The main problem was due to that there is are two variables - dflt_key_cache and sql_key_cache with have more or less duplicate function. The reson for the bug was that the default value in the key cache hash was set to dflt_key_cache, then sql_key_cache was set to a new key cache object, and then dflt_key_cache was set to sql_key_cache which was different from the dflt_key_cache_var. After sending SIGHUP, the server was using the original default value for the key cache hash, which was different from the actual key cache object used for the default key cache. include/keycache.h: Import patch 4285.diff mysys/mf_keycache.c: Import patch 4285.diff sql/mysql_priv.h: Import patch 4285.diff sql/mysqld.cc: Import patch 4285.diff sql/set_var.cc: Import patch 4285.diff sql/sql_parse.cc: Import patch 4285.diff sql/sql_show.cc: Import patch 4285.diff --- include/keycache.h | 5 ++++- mysys/mf_keycache.c | 35 +++++++++++++++++++++++++++++++++++ sql/mysql_priv.h | 1 - sql/mysqld.cc | 13 +++++-------- sql/set_var.cc | 4 ++-- sql/sql_parse.cc | 14 +++----------- sql/sql_show.cc | 2 +- 7 files changed, 50 insertions(+), 24 deletions(-) diff --git a/include/keycache.h b/include/keycache.h index 26ee0ccadb1..a292a69b0a3 100644 --- a/include/keycache.h +++ b/include/keycache.h @@ -88,12 +88,13 @@ typedef struct st_key_cache ulong param_division_limit; /* min. percentage of warm blocks */ ulong param_age_threshold; /* determines when hot block is downgraded */ - /* Statistics variables */ + /* Statistics variables. These are reset in reset_key_cache_counters(). */ ulong global_blocks_changed; /* number of currently dirty blocks */ ulong global_cache_w_requests;/* number of write requests (write hits) */ ulong global_cache_write; /* number of writes from the cache to files */ ulong global_cache_r_requests;/* number of read requests (read hits) */ ulong global_cache_read; /* number of reads from files to the cache */ + int blocks; /* max number of blocks in the cache */ my_bool in_init; /* Set to 1 in MySQL during init/resize */ } KEY_CACHE; @@ -132,5 +133,7 @@ extern my_bool multi_key_cache_set(const byte *key, uint length, KEY_CACHE *key_cache); extern void multi_key_cache_change(KEY_CACHE *old_data, KEY_CACHE *new_data); +extern int reset_key_cache_counters(const char *name, + KEY_CACHE *key_cache); C_MODE_END #endif /* _keycache_h */ diff --git a/mysys/mf_keycache.c b/mysys/mf_keycache.c index 052d6c79ab9..a1227989a4b 100644 --- a/mysys/mf_keycache.c +++ b/mysys/mf_keycache.c @@ -2444,6 +2444,41 @@ static int flush_all_key_blocks(KEY_CACHE *keycache) } +/* + Reset the counters of a key cache. + + SYNOPSIS + reset_key_cache_counters() + name the name of a key cache + key_cache pointer to the key kache to be reset + + DESCRIPTION + This procedure is used by process_key_caches() to reset the counters of all + currently used key caches, both the default one and the named ones. + + RETURN + 0 on success (always because it can't fail) +*/ + +int reset_key_cache_counters(const char *name, KEY_CACHE *key_cache) +{ + DBUG_ENTER("reset_key_cache_counters"); + if (!key_cache->key_cache_inited) + { + DBUG_PRINT("info", ("Key cache %s not initialized.", name)); + DBUG_RETURN(0); + } + DBUG_PRINT("info", ("Resetting counters for key cache %s.", name)); + + key_cache->global_blocks_changed= 0; /* Key_blocks_not_flushed */ + key_cache->global_cache_r_requests= 0; /* Key_read_requests */ + key_cache->global_cache_read= 0; /* Key_reads */ + key_cache->global_cache_w_requests= 0; /* Key_write_requests */ + key_cache->global_cache_write= 0; /* Key_writes */ + DBUG_RETURN(0); +} + + #ifndef DBUG_OFF /* Test if disk-cache is ok diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 4b785aafc5f..4f4aea66dd7 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -938,7 +938,6 @@ extern SHOW_COMP_OPTION have_ndbcluster; extern struct system_variables global_system_variables; extern struct system_variables max_system_variables; extern struct rand_struct sql_rand; -extern KEY_CACHE *sql_key_cache; extern const char *opt_date_time_formats[]; extern KNOWN_DATE_TIME_FORMAT known_date_time_formats[]; diff --git a/sql/mysqld.cc b/sql/mysqld.cc index d1fef3519bf..21b1cb7ffd0 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -383,7 +383,6 @@ struct system_variables max_system_variables; MY_TMPDIR mysql_tmpdir_list; MY_BITMAP temp_pool; -KEY_CACHE *sql_key_cache; CHARSET_INFO *system_charset_info, *files_charset_info ; CHARSET_INFO *national_charset_info, *table_alias_charset; @@ -1846,14 +1845,14 @@ We will try our best to scrape up some info that will hopefully help diagnose\n\ the problem, but since we have already crashed, something is definitely wrong\n\ and this may fail.\n\n"); fprintf(stderr, "key_buffer_size=%lu\n", - (ulong) sql_key_cache->key_cache_mem_size); + (ulong) dflt_key_cache->key_cache_mem_size); fprintf(stderr, "read_buffer_size=%ld\n", global_system_variables.read_buff_size); fprintf(stderr, "max_used_connections=%ld\n", max_used_connections); fprintf(stderr, "max_connections=%ld\n", max_connections); fprintf(stderr, "threads_connected=%d\n", thread_count); fprintf(stderr, "It is possible that mysqld could use up to \n\ key_buffer_size + (read_buffer_size + sort_buffer_size)*max_connections = %ld K\n\ -bytes of memory\n", ((ulong) sql_key_cache->key_cache_mem_size + +bytes of memory\n", ((ulong) dflt_key_cache->key_cache_mem_size + (global_system_variables.read_buff_size + global_system_variables.sortbuff_size) * max_connections)/ 1024); @@ -2120,12 +2119,12 @@ extern "C" void *signal_hand(void *arg __attribute__((unused))) case SIGHUP: if (!abort_loop) { + mysql_print_status((THD*) 0); // Print some debug info reload_acl_and_cache((THD*) 0, (REFRESH_LOG | REFRESH_TABLES | REFRESH_FAST | REFRESH_STATUS | REFRESH_GRANT | REFRESH_THREADS | REFRESH_HOSTS), (TABLE_LIST*) 0, NULL); // Flush logs - mysql_print_status((THD*) 0); // Send debug some info } break; #ifdef USE_ONE_SIGNAL_HAND @@ -2699,8 +2698,6 @@ server."); /* call ha_init_key_cache() on all key caches to init them */ process_key_caches(&ha_init_key_cache); - /* We must set dflt_key_cache in case we are using ISAM tables */ - dflt_key_cache= sql_key_cache; #if defined(HAVE_MLOCKALL) && defined(MCL_CURRENT) && !defined(EMBEDDED_LIBRARY) if (locked_in_memory && !getuid()) @@ -5598,10 +5595,10 @@ static void mysql_init_variables(void) threads.empty(); thread_cache.empty(); key_caches.empty(); - multi_keycache_init(); - if (!(sql_key_cache= get_or_create_key_cache(default_key_cache_base.str, + if (!(dflt_key_cache= get_or_create_key_cache(default_key_cache_base.str, default_key_cache_base.length))) exit(1); + multi_keycache_init(); /* set key_cache_hash.default_value = dflt_key_cache */ /* Initialize structures that is used when processing options */ replicate_rewrite_db.empty(); diff --git a/sql/set_var.cc b/sql/set_var.cc index e44ac742abe..1237c31075c 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -2174,7 +2174,7 @@ bool sys_var_key_buffer_size::update(THD *thd, set_var *var) if (!tmp) // Zero size means delete { - if (key_cache == sql_key_cache) + if (key_cache == dflt_key_cache) goto end; // Ignore default key cache if (key_cache->key_cache_inited) // If initied @@ -2188,7 +2188,7 @@ bool sys_var_key_buffer_size::update(THD *thd, set_var *var) base_name->length, &list); key_cache->in_init= 1; pthread_mutex_unlock(&LOCK_global_system_variables); - error= reassign_keycache_tables(thd, key_cache, sql_key_cache); + error= reassign_keycache_tables(thd, key_cache, dflt_key_cache); pthread_mutex_lock(&LOCK_global_system_variables); key_cache->in_init= 0; } diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index c81aefc9cea..9eb4019b5d7 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -4946,6 +4946,7 @@ void kill_one_thread(THD *thd, ulong id) net_printf(thd,error,id); } + /* Clear most status variables */ static void refresh_status(void) @@ -4955,18 +4956,9 @@ static void refresh_status(void) { if (ptr->type == SHOW_LONG) *(ulong*) ptr->value= 0; - else if (ptr->type == SHOW_KEY_CACHE_LONG) - { - /* - Reset value in 'default' key cache. - This needs to be recoded when we have thread specific key values - */ - char *value= (((char*) sql_key_cache) + - (uint) ((char*) (ptr->value) - - (char*) &dflt_key_cache_var)); - *(ulong*) value= 0; - } } + /* Reset the counters of all key caches (default and named). */ + process_key_caches(reset_key_cache_counters); pthread_mutex_unlock(&LOCK_status); } diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 8929872c466..d9acd47c5a6 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -2066,7 +2066,7 @@ int mysqld_show(THD *thd, const char *wild, show_var_st *variables, #endif /* HAVE_OPENSSL */ case SHOW_KEY_CACHE_LONG: case SHOW_KEY_CACHE_CONST_LONG: - value= (value-(char*) &dflt_key_cache_var)+ (char*) sql_key_cache; + value= (value-(char*) &dflt_key_cache_var)+ (char*) dflt_key_cache; end= int10_to_str(*(long*) value, buff, 10); break; case SHOW_UNDEF: // Show never happen From 4bd96dd11d1707589545c4f6ccd497490e647e63 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 19 Jan 2005 18:32:34 +0100 Subject: [PATCH 0791/1063] ndb - make sure scan recevier pointers are aligned ndb/src/ndbapi/NdbScanOperation.cpp: align pointers --- ndb/src/ndbapi/NdbScanOperation.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ndb/src/ndbapi/NdbScanOperation.cpp b/ndb/src/ndbapi/NdbScanOperation.cpp index a90c9f524a2..670a18f72a0 100644 --- a/ndb/src/ndbapi/NdbScanOperation.cpp +++ b/ndb/src/ndbapi/NdbScanOperation.cpp @@ -241,17 +241,17 @@ NdbScanOperation::fix_receivers(Uint32 parallel){ if(parallel > m_allocated_receivers){ const Uint32 sz = parallel * (4*sizeof(char*)+sizeof(Uint32)); - Uint32 * tmp = new Uint32[(sz+3)/4]; + Uint64 * tmp = new Uint64[(sz+7)/8]; // Save old receivers - memcpy(tmp+parallel, m_receivers, m_allocated_receivers*sizeof(char*)); + memcpy(tmp, m_receivers, m_allocated_receivers*sizeof(char*)); delete[] m_array; - m_array = tmp; + m_array = (Uint32*)tmp; - m_prepared_receivers = tmp; - m_receivers = (NdbReceiver**)(tmp + parallel); + m_receivers = (NdbReceiver**)tmp; m_api_receivers = m_receivers + parallel; m_conf_receivers = m_api_receivers + parallel; m_sent_receivers = m_conf_receivers + parallel; + m_prepared_receivers = (Uint32*)(m_sent_receivers + parallel); // Only get/init "new" receivers NdbReceiver* tScanRec; From 98713d6482bdd53169611ed374d1f8efcd810d95 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 19 Jan 2005 10:24:51 -0800 Subject: [PATCH 0792/1063] Fix all BUILD/*max* scripts to use -DBIG_TABLES, like our real Max builds do. (Simpler fix than last commit -- no need to mess with base_cxxflags.) BUILD/compile-amd64-max: use $max_cflags BUILD/compile-pentium-debug-max: use $max_cflags BUILD/compile-pentium-debug-max-no-embedded: use $max_cflags BUILD/compile-pentium-max: use $max_cflags BUILD/compile-pentium-valgrind-max: use $max_cflags BUILD/compile-ppc-debug-max: use $max_cflags BUILD/compile-ppc-max: use $max_cflags BUILD/compile-amd64-debug-max: use $max_cflags, remove unnecessary base_cxxflags stuff --- BUILD/compile-amd64-debug-max | 7 ++----- BUILD/compile-amd64-max | 8 ++------ BUILD/compile-pentium-debug-max | 6 ++---- BUILD/compile-pentium-debug-max-no-embedded | 6 ++---- BUILD/compile-pentium-max | 7 ++----- BUILD/compile-pentium-valgrind-max | 2 +- BUILD/compile-ppc-debug-max | 6 ++---- BUILD/compile-ppc-max | 4 +--- 8 files changed, 14 insertions(+), 32 deletions(-) diff --git a/BUILD/compile-amd64-debug-max b/BUILD/compile-amd64-debug-max index 466bea73179..530bdba009b 100755 --- a/BUILD/compile-amd64-debug-max +++ b/BUILD/compile-amd64-debug-max @@ -1,12 +1,9 @@ #! /bin/sh path=`dirname $0` . "$path/SETUP.sh" -base_cxxflags="$amd64_cxxflags $base_cxxflags" -extra_flags="$amd64_cflags $debug_cflags" +extra_flags="$amd64_cflags $debug_cflags $max_cflags" c_warnings="$c_warnings $debug_extra_warnings" cxx_warnings="$cxx_warnings $debug_extra_warnings" -extra_configs="$amd64_configs $debug_configs" - -extra_configs="$extra_configs $max_configs" +extra_configs="$amd64_configs $debug_configs $max_configs" . "$path/FINISH.sh" diff --git a/BUILD/compile-amd64-max b/BUILD/compile-amd64-max index 4a260859474..228448f6392 100755 --- a/BUILD/compile-amd64-max +++ b/BUILD/compile-amd64-max @@ -2,11 +2,7 @@ path=`dirname $0` . "$path/SETUP.sh" -base_cxxflags="$amd64_cxxflags $base_cxxflags" -extra_flags="$amd64_cflags $fast_cflags -g" -extra_configs="$amd64_configs" -#strip=yes - -extra_configs="$extra_configs $max_configs" +extra_flags="$amd64_cflags $fast_cflags $max_cflags -g" +extra_configs="$amd64_configs $max_configs" . "$path/FINISH.sh" diff --git a/BUILD/compile-pentium-debug-max b/BUILD/compile-pentium-debug-max index 6487c094cec..420657e0b73 100755 --- a/BUILD/compile-pentium-debug-max +++ b/BUILD/compile-pentium-debug-max @@ -3,11 +3,9 @@ path=`dirname $0` . "$path/SETUP.sh" -extra_flags="$pentium_cflags $debug_cflags" +extra_flags="$pentium_cflags $debug_cflags $max_cflags" c_warnings="$c_warnings $debug_extra_warnings" cxx_warnings="$cxx_warnings $debug_extra_warnings" -extra_configs="$pentium_configs $debug_configs" - -extra_configs="$extra_configs $max_configs" +extra_configs="$pentium_configs $debug_configs $max_configs" . "$path/FINISH.sh" diff --git a/BUILD/compile-pentium-debug-max-no-embedded b/BUILD/compile-pentium-debug-max-no-embedded index f7a9d966d6d..803a6a9d6d3 100755 --- a/BUILD/compile-pentium-debug-max-no-embedded +++ b/BUILD/compile-pentium-debug-max-no-embedded @@ -3,11 +3,9 @@ path=`dirname $0` . "$path/SETUP.sh" -extra_flags="$pentium_cflags $debug_cflags" +extra_flags="$pentium_cflags $debug_cflags $max_cflags" c_warnings="$c_warnings $debug_extra_warnings" cxx_warnings="$cxx_warnings $debug_extra_warnings" -extra_configs="$pentium_configs $debug_configs" - -extra_configs="$extra_configs $max_no_es_configs" +extra_configs="$pentium_configs $debug_configs $max_no_es_configs" . "$path/FINISH.sh" diff --git a/BUILD/compile-pentium-max b/BUILD/compile-pentium-max index de37f28582b..595581f604e 100755 --- a/BUILD/compile-pentium-max +++ b/BUILD/compile-pentium-max @@ -3,10 +3,7 @@ path=`dirname $0` . "$path/SETUP.sh" -extra_flags="$pentium_cflags $fast_cflags -g" -extra_configs="$pentium_configs" -#strip=yes - -extra_configs="$extra_configs $max_configs" +extra_flags="$pentium_cflags $fast_cflags $max_cflags -g" +extra_configs="$pentium_configs $max_configs" . "$path/FINISH.sh" diff --git a/BUILD/compile-pentium-valgrind-max b/BUILD/compile-pentium-valgrind-max index 322b0735488..f0dc92c2ffd 100755 --- a/BUILD/compile-pentium-valgrind-max +++ b/BUILD/compile-pentium-valgrind-max @@ -3,7 +3,7 @@ path=`dirname $0` . "$path/SETUP.sh" -extra_flags="$pentium_cflags $debug_cflags -USAFEMALLOC -UFORCE_INIT_OF_VARS -DHAVE_purify -DMYSQL_SERVER_SUFFIX=-valgrind-max" +extra_flags="$pentium_cflags $debug_cflags $max_cflags -USAFEMALLOC -UFORCE_INIT_OF_VARS -DHAVE_purify -DMYSQL_SERVER_SUFFIX=-valgrind-max" c_warnings="$c_warnings $debug_extra_warnings" cxx_warnings="$cxx_warnings $debug_extra_warnings" extra_configs="$pentium_configs $debug_configs" diff --git a/BUILD/compile-ppc-debug-max b/BUILD/compile-ppc-debug-max index 004e821d722..49d1442fd45 100755 --- a/BUILD/compile-ppc-debug-max +++ b/BUILD/compile-ppc-debug-max @@ -3,11 +3,9 @@ path=`dirname $0` . "$path/SETUP.sh" -extra_flags="$ppc_cflags $debug_cflags" +extra_flags="$ppc_cflags $debug_cflags $max_cflags" c_warnings="$c_warnings $debug_extra_warnings" cxx_warnings="$cxx_warnings $debug_extra_warnings" -extra_configs="$debug_configs" - -extra_configs="$extra_configs $max_configs" +extra_configs="$debug_configs $max_configs" . "$path/FINISH.sh" diff --git a/BUILD/compile-ppc-max b/BUILD/compile-ppc-max index 632db7216e4..1d89be81c9c 100755 --- a/BUILD/compile-ppc-max +++ b/BUILD/compile-ppc-max @@ -3,9 +3,7 @@ path=`dirname $0` . "$path/SETUP.sh" -extra_flags="$ppc_cflags $fast_cflags -g" -#strip=yes - +extra_flags="$ppc_cflags $fast_cflags $max_cflags -g" extra_configs="$extra_configs $max_configs" . "$path/FINISH.sh" From 353bc07096fae7fd74cb315e445bc4b253cea5b5 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 19 Jan 2005 21:13:30 +0100 Subject: [PATCH 0793/1063] BUG#6034 - Error code 124: Wrong medium type. Version for 4.0. Committed for merge. If the result table is one of the select tables in INSERT SELECT, we must not disable the result tables indexes before selecting. mysql_execute_command() detects the match for other reasons and adds the flag OPTION_BUFFER_RESULT to the 'select_options'. In this case the result is put into a temporary table first. Hence, we can defer the preparation of the insert table until the result is to be used. mysql-test/r/insert_select.result: BUG#6034 - Error code 124: Wrong medium type. The test results. mysql-test/t/insert_select.test: BUG#6034 - Error code 124: Wrong medium type. The test case. sql/sql_select.cc: BUG#6034 - Error code 124: Wrong medium type. With OPTION_BUFFER_RESULT in the 'select_options', defer the preparation of the insert table until the result is to be used. Unfortunately, this happens at several places. --- mysql-test/r/insert_select.result | 12 ++++++++++++ mysql-test/t/insert_select.test | 15 +++++++++++++++ sql/sql_select.cc | 26 +++++++++++++++++++++++++- 3 files changed, 52 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/insert_select.result b/mysql-test/r/insert_select.result index ecd26f2d9fb..506f95f61bb 100644 --- a/mysql-test/r/insert_select.result +++ b/mysql-test/r/insert_select.result @@ -632,3 +632,15 @@ No Field Count 0 1 100 0 2 100 drop table t1, t2; +CREATE TABLE t1 ( +ID int(11) NOT NULL auto_increment, +NO int(11) NOT NULL default '0', +SEQ int(11) NOT NULL default '0', +PRIMARY KEY (ID), +KEY t1$NO (SEQ,NO) +) TYPE=MyISAM; +INSERT INTO t1 (SEQ, NO) SELECT "1" AS SEQ, IF(MAX(NO) IS NULL, 0, MAX(NO)) + 1 AS NO FROM t1 WHERE (SEQ = 1); +select SQL_BUFFER_RESULT * from t1 WHERE (SEQ = 1); +ID NO SEQ +1 1 1 +drop table t1; diff --git a/mysql-test/t/insert_select.test b/mysql-test/t/insert_select.test index deb80dbcdbf..a54f8c4bfb5 100644 --- a/mysql-test/t/insert_select.test +++ b/mysql-test/t/insert_select.test @@ -176,3 +176,18 @@ insert into t2 Select null, Field, Count From t1 Where Month=20030901 and Type=2 select * from t2; drop table t1, t2; + +# +# BUG#6034 - Error code 124: Wrong medium type +# +CREATE TABLE t1 ( + ID int(11) NOT NULL auto_increment, + NO int(11) NOT NULL default '0', + SEQ int(11) NOT NULL default '0', + PRIMARY KEY (ID), + KEY t1$NO (SEQ,NO) +) TYPE=MyISAM; +INSERT INTO t1 (SEQ, NO) SELECT "1" AS SEQ, IF(MAX(NO) IS NULL, 0, MAX(NO)) + 1 AS NO FROM t1 WHERE (SEQ = 1); +select SQL_BUFFER_RESULT * from t1 WHERE (SEQ = 1); +drop table t1; + diff --git a/sql/sql_select.cc b/sql/sql_select.cc index eda4ce73186..0d7ee1eb125 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -223,6 +223,8 @@ mysql_select(THD *thd,TABLE_LIST *tables,List &fields,COND *conds, bool no_order; /* Is set if we have a GROUP BY and we have ORDER BY on a constant. */ bool skip_sort_order; + /* We cannot always prepare the result before selecting. */ + bool is_result_prepared; ha_rows select_limit; Item::cond_result cond_value; SQL_SELECT *select; @@ -360,7 +362,17 @@ mysql_select(THD *thd,TABLE_LIST *tables,List &fields,COND *conds, DBUG_RETURN(-1); } #endif - if (!procedure && result->prepare(fields)) + /* + We must not yet prepare the result table if it is the same as one of the + source tables (INSERT SELECT). This is checked in mysql_execute_command() + and OPTION_BUFFER_RESULT is added to the select_options. A temporary + table is then used to hold the result. The preparation may disable + indexes on the result table, which may be used during the select, if it + is the same table (Bug #6034). Do the preparation after the select phase. + */ + if ((is_result_prepared= (! procedure && + ! test(select_options & OPTION_BUFFER_RESULT))) && + result->prepare(fields)) { /* purecov: inspected */ DBUG_RETURN(-1); /* purecov: inspected */ } @@ -392,6 +404,8 @@ mysql_select(THD *thd,TABLE_LIST *tables,List &fields,COND *conds, } if (cond_value == Item::COND_FALSE || !thd->select_limit) { /* Impossible cond */ + if (! is_result_prepared && ! procedure && result->prepare(fields)) + goto err; error=return_zero_rows(&join, result, tables, fields, join.tmp_table_param.sum_func_count != 0 && !group, select_options,"Impossible WHERE",having, @@ -417,6 +431,8 @@ mysql_select(THD *thd,TABLE_LIST *tables,List &fields,COND *conds, } if (res < 0) { + if (! is_result_prepared && ! procedure && result->prepare(fields)) + goto err; error=return_zero_rows(&join, result, tables, fields, !group, select_options,"No matching min/max row", having,procedure); @@ -439,6 +455,8 @@ mysql_select(THD *thd,TABLE_LIST *tables,List &fields,COND *conds, describe_info(&join, "No tables used"); else { + if (! is_result_prepared && ! procedure && result->prepare(fields)) + goto err; result->send_fields(fields,1); if (!having || having->val_int()) { @@ -474,6 +492,8 @@ mysql_select(THD *thd,TABLE_LIST *tables,List &fields,COND *conds, if (join.const_table_map != join.found_const_table_map && !(select_options & SELECT_DESCRIBE)) { + if (! is_result_prepared && ! procedure && result->prepare(fields)) + goto err; error=return_zero_rows(&join,result,tables,fields, join.tmp_table_param.sum_func_count != 0 && !group,0,"no matching row in const table",having, @@ -520,6 +540,8 @@ mysql_select(THD *thd,TABLE_LIST *tables,List &fields,COND *conds, } if (make_join_select(&join,select,conds)) { + if (! is_result_prepared && ! procedure && result->prepare(fields)) + goto err; error=return_zero_rows(&join, result, tables, fields, join.tmp_table_param.sum_func_count != 0 && !group, select_options, @@ -926,6 +948,8 @@ mysql_select(THD *thd,TABLE_LIST *tables,List &fields,COND *conds, goto err; count_field_types(&join.tmp_table_param,all_fields,0); } + else if (! is_result_prepared && result->prepare(fields)) + goto err; if (join.group || join.tmp_table_param.sum_func_count || (procedure && (procedure->flags & PROC_GROUP))) { From 699a530a0a7915a50ed2e042ff7e5f088f9d359a Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 19 Jan 2005 21:16:27 +0100 Subject: [PATCH 0794/1063] BUG#6034 - Error code 124: Wrong medium type. Version for 4.1. Committed for merge. If the result table is one of the select tables in INSERT SELECT, we must not disable the result tables indexes before selecting. mysql_execute_command() detects the match for other reasons and adds the flag OPTION_BUFFER_RESULT to the 'select_options'. In this case the result is put into a temporary table first. Hence, we can defer the preparation of the insert table until the result is to be used. mysql-test/r/insert_select.result: BUG#6034 - Error code 124: Wrong medium type. The test results. mysql-test/t/insert_select.test: BUG#6034 - Error code 124: Wrong medium type. The test case. sql/sql_select.cc: BUG#6034 - Error code 124: Wrong medium type. With OPTION_BUFFER_RESULT in the 'select_options', defer the preparation of the insert table until the result is to be used. --- mysql-test/r/insert_select.result | 12 ++++++++++++ mysql-test/t/insert_select.test | 15 +++++++++++++++ sql/sql_select.cc | 18 +++++++++++++++++- 3 files changed, 44 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/insert_select.result b/mysql-test/r/insert_select.result index 0a6a34f9a58..f5ad0c87881 100644 --- a/mysql-test/r/insert_select.result +++ b/mysql-test/r/insert_select.result @@ -638,3 +638,15 @@ No Field Count 0 1 100 0 2 100 drop table t1, t2; +CREATE TABLE t1 ( +ID int(11) NOT NULL auto_increment, +NO int(11) NOT NULL default '0', +SEQ int(11) NOT NULL default '0', +PRIMARY KEY (ID), +KEY t1$NO (SEQ,NO) +) ENGINE=MyISAM; +INSERT INTO t1 (SEQ, NO) SELECT "1" AS SEQ, IF(MAX(NO) IS NULL, 0, MAX(NO)) + 1 AS NO FROM t1 WHERE (SEQ = 1); +select SQL_BUFFER_RESULT * from t1 WHERE (SEQ = 1); +ID NO SEQ +1 1 1 +drop table t1; diff --git a/mysql-test/t/insert_select.test b/mysql-test/t/insert_select.test index e1459310bb9..39b8bfcaaaa 100644 --- a/mysql-test/t/insert_select.test +++ b/mysql-test/t/insert_select.test @@ -182,3 +182,18 @@ insert into t2 Select null, Field, Count From t1 Where Month=20030901 and Type=2 select * from t2; drop table t1, t2; + +# +# BUG#6034 - Error code 124: Wrong medium type +# +CREATE TABLE t1 ( + ID int(11) NOT NULL auto_increment, + NO int(11) NOT NULL default '0', + SEQ int(11) NOT NULL default '0', + PRIMARY KEY (ID), + KEY t1$NO (SEQ,NO) +) ENGINE=MyISAM; +INSERT INTO t1 (SEQ, NO) SELECT "1" AS SEQ, IF(MAX(NO) IS NULL, 0, MAX(NO)) + 1 AS NO FROM t1 WHERE (SEQ = 1); +select SQL_BUFFER_RESULT * from t1 WHERE (SEQ = 1); +drop table t1; + diff --git a/sql/sql_select.cc b/sql/sql_select.cc index aea7cb9ed6d..7e48374a8e6 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -398,7 +398,16 @@ JOIN::prepare(Item ***rref_pointer_array, goto err; } #endif - if (!procedure && result && result->prepare(fields_list, unit_arg)) + /* + We must not yet prepare the result table if it is the same as one of the + source tables (INSERT SELECT). This is checked in mysql_execute_command() + and OPTION_BUFFER_RESULT is added to the select_options. A temporary + table is then used to hold the result. The preparation may disable + indexes on the result table, which may be used during the select, if it + is the same table (Bug #6034). Do the preparation after the select phase. + */ + if (! procedure && ! test(select_options & OPTION_BUFFER_RESULT) && + result && result->prepare(fields_list, unit_arg)) goto err; /* purecov: inspected */ if (select_lex->olap == ROLLUP_TYPE && rollup_init()) @@ -1043,6 +1052,13 @@ JOIN::exec() DBUG_VOID_RETURN; } } + else if (test(select_options & OPTION_BUFFER_RESULT) && + result && result->prepare(fields_list, unit)) + { + error= 1; + thd->limit_found_rows= thd->examined_row_count= 0; + DBUG_VOID_RETURN; + } if (!tables_list) { // Only test of functions From faff1cda2bd0c45daf32768f3c2daef9eb0b48a9 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 19 Jan 2005 12:23:24 -0800 Subject: [PATCH 0795/1063] Warn when mysqld starts up with lower_case_table_names=2 but datadir is on a case-sensitive filesystem. (Bug #7887) sql/mysqld.cc: Add warning when running with lower_case_table_names=2 and datadir is on a case-sensitive filesystem. --- sql/mysqld.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index d1fef3519bf..b21b84a34e7 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -2913,6 +2913,17 @@ You should consider changing lower_case_table_names to 1 or 2", lower_case_table_names= 2; } } + else if (lower_case_table_names == 2 && + (test_if_case_insensitive(mysql_real_data_home) == 0)) + { + if (global_system_variables.log_warnings) + sql_print_warning("\ +You have forced lower_case_table_names to 2 through a command-line \ +option, even though your file system '%s' is case sensitive. This means \ +that you can create a table that you can then no longer access. \ +You should consider changing lower_case_table_names to 0.", + mysql_real_data_home); + } select_thread=pthread_self(); select_thread_in_use=1; From 41e6f84d8a3b8a524e765fca9d387e149a9a4d72 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 20 Jan 2005 12:37:02 +0400 Subject: [PATCH 0796/1063] errmsg.txt: new file --- sql/share/japanese-sjis/errmsg.txt | 325 +++++++++++++++++++++++++++++ 1 file changed, 325 insertions(+) create mode 100644 sql/share/japanese-sjis/errmsg.txt diff --git a/sql/share/japanese-sjis/errmsg.txt b/sql/share/japanese-sjis/errmsg.txt new file mode 100644 index 00000000000..66284b22367 --- /dev/null +++ b/sql/share/japanese-sjis/errmsg.txt @@ -0,0 +1,325 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* + 3.22.10-beta euc-japanese (ujis) text +*/ + +character-set=ujis + +"hashchk", +"isamchk", +"NO", +"YES", +"'%-.64s' ƒtƒ@ƒCƒ‹‚ªì‚ê‚Ü‚¹‚ñ (errno: %d)", +"'%-.64s' ƒe[ƒuƒ‹‚ªì‚ê‚Ü‚¹‚ñ.(errno: %d)", +"'%-.64s' ƒf[ƒ^ƒx[ƒX‚ªì‚ê‚Ü‚¹‚ñ (errno: %d)", +"'%-.64s' ƒf[ƒ^ƒx[ƒX‚ªì‚ê‚Ü‚¹‚ñ.Šù‚É‚»‚̃f[ƒ^ƒx[ƒX‚ª‘¶Ý‚µ‚Ü‚·", +"'%-.64s' ƒf[ƒ^ƒx[ƒX‚ð”jŠü‚Å‚«‚Ü‚¹‚ñ. ‚»‚̃f[ƒ^ƒx[ƒX‚ª‚È‚¢‚̂ł·.", +"ƒf[ƒ^ƒx[ƒX”jŠüƒGƒ‰[ ('%-.64s' ‚ð휂ł«‚Ü‚¹‚ñ, errno: %d)", +"ƒf[ƒ^ƒx[ƒX”jŠüƒGƒ‰[ ('%-.64s' ‚ð rmdir ‚Å‚«‚Ü‚¹‚ñ, errno: %d)", +"'%-.64s' ‚Ì휂ªƒGƒ‰[ (errno: %d)", +"system table ‚̃ŒƒR[ƒh‚ð“ǂގ–‚ª‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½", +"'%-.64s' ‚̃XƒeƒCƒ^ƒX‚ª“¾‚ç‚ê‚Ü‚¹‚ñ. (errno: %d)", +"working directory ‚𓾂鎖‚ª‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½ (errno: %d)", +"ƒtƒ@ƒCƒ‹‚ðƒƒbƒN‚Å‚«‚Ü‚¹‚ñ (errno: %d)", +"'%-.64s' ƒtƒ@ƒCƒ‹‚ðŠJ‚­Ž–‚ª‚Å‚«‚Ü‚¹‚ñ (errno: %d)", +"'%-.64s' ƒtƒ@ƒCƒ‹‚ðŒ©•t‚¯‚鎖‚ª‚Å‚«‚Ü‚¹‚ñ.(errno: %d)", +"'%-.64s' ƒfƒBƒŒƒNƒgƒŠ‚ª“ǂ߂܂¹‚ñ.(errno: %d)", +"'%-.64s' ƒfƒBƒŒƒNƒgƒŠ‚É chdir ‚Å‚«‚Ü‚¹‚ñ.(errno: %d)", +"Record has changed since last read in table '%-.64s'", +"Disk full (%s). ’N‚©‚ª‰½‚©‚ðŒ¸‚ç‚·‚܂ł܂Á‚Ä‚­‚¾‚³‚¢...", +"table '%-.64s' ‚É key ‚ªd•¡‚µ‚Ä‚¢‚Ä‘‚«‚±‚߂܂¹‚ñ", +"Error on close of '%-.64s' (errno: %d)", +"'%-.64s' ƒtƒ@ƒCƒ‹‚̓ǂݞ‚݃Gƒ‰[ (errno: %d)", +"'%-.64s' ‚ð '%-.64s' ‚É rename ‚Å‚«‚Ü‚¹‚ñ (errno: %d)", +"'%-.64s' ƒtƒ@ƒCƒ‹‚ð‘‚­Ž–‚ª‚Å‚«‚Ü‚¹‚ñ (errno: %d)", +"'%-.64s' ‚̓ƒbƒN‚³‚ê‚Ä‚¢‚Ü‚·", +"Sort ’†’f", +"View '%-.64s' ‚ª '%-.64s' ‚É’è‹`‚³‚ê‚Ä‚¢‚Ü‚¹‚ñ", +"Got error %d from table handler", +"Table handler for '%-.64s' doesn't have this option", +"'%-.64s'‚̂Ȃ©‚ɃŒƒR[ƒh‚ªŒ©•t‚©‚è‚Ü‚¹‚ñ", +"ƒtƒ@ƒCƒ‹ '%-.64s' ‚Ì info ‚ªŠÔˆá‚Á‚Ä‚¢‚邿‚¤‚Å‚·", +"'%-.64s' ƒe[ƒuƒ‹‚Ì key file ‚ªŠÔˆá‚Á‚Ä‚¢‚邿‚¤‚Å‚·. C•œ‚ð‚µ‚Ä‚­‚¾‚³‚¢", +"'%-.64s' ƒe[ƒuƒ‹‚͌¢Œ`Ž®‚Ì key file ‚̂悤‚Å‚·; C•œ‚ð‚µ‚Ä‚­‚¾‚³‚¢", +"'%-.64s' ‚͓ǂݞ‚Ýê—p‚Å‚·", +"Out of memory. ƒf[ƒ‚ƒ“‚ðƒŠƒXƒ^[ƒg‚µ‚Ă݂Ă­‚¾‚³‚¢ (%d bytes •K—v)", +"Out of sort memory. sort buffer size ‚ª‘«‚è‚È‚¢‚悤‚Å‚·.", +"'%-.64s' ƒtƒ@ƒCƒ‹‚ð“ǂݞ‚Ý’†‚É EOF ‚ª—\Šú‚¹‚ÊŠ‚ÅŒ»‚ê‚Ü‚µ‚½. (errno: %d)", +"Ú‘±‚ª‘½‚·‚¬‚Ü‚·", +"Out of memory; mysqld ‚©‚»‚Ì‘¼‚̃vƒƒZƒX‚ªƒƒ‚ƒŠ[‚ð‘S‚ÄŽg‚Á‚Ä‚¢‚é‚©Šm”F‚µ‚Ä‚­‚¾‚³‚¢. ƒƒ‚ƒŠ[‚ðŽg‚¢Ø‚Á‚Ä‚¢‚È‚¢ê‡A'ulimit' ‚ðݒ肵‚Ä mysqld ‚̃ƒ‚ƒŠ[Žg—pŒÀŠE—ʂ𑽂­‚·‚é‚©Aswap space ‚ð‘‚₵‚Ă݂Ă­‚¾‚³‚¢", +"‚»‚Ì address ‚Ì hostname ‚ªˆø‚¯‚Ü‚¹‚ñ.", +"Bad handshake", +"ƒ†[ƒU[ '%-.32s'@'%-.64s' ‚Ì '%-.64s' ƒf[ƒ^ƒx[ƒX‚ւ̃AƒNƒZƒX‚ð‹‘”Û‚µ‚Ü‚·", +"ƒ†[ƒU[ '%-.32s'@'%-.64s' ‚ð‹‘”Û‚µ‚Ü‚·.uUsing password: %s)", +"ƒf[ƒ^ƒx[ƒX‚ª‘I‘ð‚³‚ê‚Ä‚¢‚Ü‚¹‚ñ.", +"‚»‚̃Rƒ}ƒ“ƒh‚͉½H", +"Column '%-.64s' ‚Í null ‚ɂ͂ł«‚È‚¢‚̂ł·", +"'%-.64s' ‚È‚ñ‚ăf[ƒ^ƒx[ƒX‚Í’m‚è‚Ü‚¹‚ñ.", +"Table '%-.64s' ‚ÍŠù‚É‚ ‚è‚Ü‚·", +"table '%-.64s' ‚Í‚ ‚è‚Ü‚¹‚ñ.", +"Column: '%-.64s' in %-.64s is ambiguous", +"Server ‚ð shutdown ’†...", +"'%-.64s' column ‚Í '%-.64s' ‚ɂ͂ ‚è‚Ü‚¹‚ñ.", +"'%-.64s' isn't in GROUP BY", +"Can't group on '%-.64s'", +"Statement has sum functions and columns in same statement", +"Column count doesn't match value count", +"Identifier name '%-.100s' ‚Í’·‚·‚¬‚Ü‚·", +"'%-.64s' ‚Æ‚¢‚¤ column –¼‚Íd•¡‚µ‚Ă܂·", +"'%-.64s' ‚Æ‚¢‚¤ key ‚Ì–¼‘O‚Íd•¡‚µ‚Ä‚¢‚Ü‚·", +"'%-.64s' ‚Í key %d ‚É‚¨‚¢‚Äd•¡‚µ‚Ä‚¢‚Ü‚·", +"Incorrect column specifier for column '%-.64s'", +"%s : '%-.80s' •t‹ß : %d s–Ú", +"Query ‚ª‹ó‚Å‚·.", +"'%-.64s' ‚͈êˆÓ‚Ì table/alias –¼‚ł͂ ‚è‚Ü‚¹‚ñ", +"Invalid default value for '%-.64s'", +"•¡”‚Ì primary key ‚ª’è‹`‚³‚ê‚Ü‚µ‚½", +"key ‚ÌŽw’肪‘½‚·‚¬‚Ü‚·. key ‚ÍÅ‘å %d ‚܂łł·", +"Too many key parts specified; max %d parts allowed", +"key ‚ª’·‚·‚¬‚Ü‚·. key ‚Ì’·‚³‚ÍÅ‘å %d ‚Å‚·", +"Key column '%-.64s' ‚ªƒe[ƒuƒ‹‚É‚ ‚è‚Ü‚¹‚ñ.", +"BLOB column '%-.64s' can't be used in key specification with the used table type", +"column '%-.64s' ‚Í,Šm•Û‚·‚é column ‚̑傫‚³‚ª‘½‚·‚¬‚Ü‚·. (Å‘å %d ‚Ü‚Å). BLOB ‚ð‚©‚í‚è‚ÉŽg—p‚µ‚Ä‚­‚¾‚³‚¢.", +"ƒe[ƒuƒ‹‚Ì’è‹`‚ªˆá‚¢‚Ü‚·; there can be only one auto column and it must be defined as a key", +"%s: €”õŠ®—¹", +"%s: Normal shutdown\n", +"%s: Got signal %d. ’†’f!\n", +"%s: Shutdown Š®—¹\n", +"%s: ƒXƒŒƒbƒh %ld ‹­§I—¹ user: '%-.64s'\n", +"IP socket ‚ªì‚ê‚Ü‚¹‚ñ", +"Table '%-.64s' ‚Í‚»‚̂悤‚È index ‚ðŽ‚Á‚Ä‚¢‚Ü‚¹‚ñ(CREATE INDEX ŽÀsŽž‚ÉŽw’肳‚ê‚Ä‚¢‚Ü‚¹‚ñ). ƒe[ƒuƒ‹‚ðì‚è’¼‚µ‚Ä‚­‚¾‚³‚¢", +"Field separator argument is not what is expected; check the manual", +"You can't use fixed rowlength with BLOBs; please use 'fields terminated by'.", +"ƒtƒ@ƒCƒ‹ '%-.64s' ‚Í databse ‚Ì directory ‚É‚ ‚é‚©‘S‚Ẵ†[ƒU[‚ª“Ç‚ß‚é‚æ‚¤‚É‹–‰Â‚³‚ê‚Ä‚¢‚È‚¯‚ê‚΂Ȃè‚Ü‚¹‚ñ.", +"File '%-.64s' ‚ÍŠù‚É‘¶Ý‚µ‚Ü‚·", +"ƒŒƒR[ƒh”: %ld íœ: %ld Skipped: %ld Warnings: %ld", +"ƒŒƒR[ƒh”: %ld d•¡: %ld", +"Incorrect sub part key; the used key part isn't a string or the used length is longer than the key part", +"ALTER TABLE ‚Å‘S‚Ä‚Ì column ‚Í휂ł«‚Ü‚¹‚ñ. DROP TABLE ‚ðŽg—p‚µ‚Ä‚­‚¾‚³‚¢", +"'%-.64s' ‚ð”jŠü‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½; check that column/key exists", +"ƒŒƒR[ƒh”: %ld d•¡”: %ld Warnings: %ld", +"You can't specify target table '%-.64s' for update in FROM clause", +"thread id: %lu ‚Í‚ ‚è‚Ü‚¹‚ñ", +"thread %lu ‚̃I[ƒi[‚ł͂ ‚è‚Ü‚¹‚ñ", +"No tables used", +"Too many strings for column %-.64s and SET", +"Can't generate a unique log-filename %-.64s.(1-999)\n", +"Table '%-.64s' ‚Í READ lock ‚ɂȂÁ‚Ä‚¢‚ÄAXV‚͂ł«‚Ü‚¹‚ñ", +"Table '%-.64s' ‚Í LOCK TABLES ‚É‚æ‚Á‚ăƒbƒN‚³‚ê‚Ä‚¢‚Ü‚¹‚ñ", +"BLOB column '%-.64s' can't have a default value", +"Žw’肵‚½ database –¼ '%-.100s' ‚ªŠÔˆá‚Á‚Ä‚¢‚Ü‚·", +"Žw’肵‚½ table –¼ '%-.100s' ‚͂܂¿‚ª‚Á‚Ä‚¢‚Ü‚·", +"The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay", +"Unknown error", +"Unknown procedure '%-.64s'", +"Incorrect parameter count to procedure '%-.64s'", +"Incorrect parameters to procedure '%-.64s'", +"Unknown table '%-.64s' in %s", +"Column '%-.64s' specified twice", +"Invalid use of group function", +"Table '%-.64s' uses an extension that doesn't exist in this MySQL version", +"ƒe[ƒuƒ‹‚ÍÅ’á 1 ŒÂ‚Ì column ‚ª•K—v‚Å‚·", +"table '%-.64s' ‚Í‚¢‚Á‚Ï‚¢‚Å‚·", +"character set '%-.64s' ‚̓Tƒ|[ƒg‚µ‚Ä‚¢‚Ü‚¹‚ñ", +"ƒe[ƒuƒ‹‚ª‘½‚·‚¬‚Ü‚·; MySQL can only use %d tables in a join", +"column ‚ª‘½‚·‚¬‚Ü‚·", +"row size ‚ª‘å‚«‚·‚¬‚Ü‚·. BLOB ‚ðŠÜ‚܂Ȃ¢ê‡‚Ì row size ‚ÌÅ‘å‚Í %d ‚Å‚·. ‚¢‚­‚‚©‚Ì field ‚ð BLOB ‚ɕς¦‚Ä‚­‚¾‚³‚¢.", +"Thread stack overrun: Used: %ld of a %ld stack. ƒXƒ^ƒbƒN—̈æ‚𑽂­‚Ƃ肽‚¢ê‡A'mysqld -O thread_stack=#' ‚ÆŽw’肵‚Ä‚­‚¾‚³‚¢", +"Cross dependency found in OUTER JOIN; examine your ON conditions", +"Column '%-.64s' ‚ª UNIQUE ‚© INDEX ‚ÅŽg—p‚³‚ê‚Ü‚µ‚½. ‚±‚̃Jƒ‰ƒ€‚Í NOT NULL ‚Æ’è‹`‚³‚ê‚Ä‚¢‚Ü‚¹‚ñ.", +"function '%-.64s' ‚ð ƒ[ƒh‚Å‚«‚Ü‚¹‚ñ", +"function '%-.64s' ‚ð‰Šú‰»‚Å‚«‚Ü‚¹‚ñ; %-.80s", +"shared library ‚ւ̃pƒX‚ª’Ê‚Á‚Ä‚¢‚Ü‚¹‚ñ", +"Function '%-.64s' ‚ÍŠù‚É’è‹`‚³‚ê‚Ä‚¢‚Ü‚·", +"shared library '%-.64s' ‚ðŠJ‚­Ž–‚ª‚Å‚«‚Ü‚¹‚ñ (errno: %d %s)", +"function '%-.64s' ‚ðƒ‰ƒCƒuƒ‰ƒŠ[’†‚ÉŒ©•t‚¯‚鎖‚ª‚Å‚«‚Ü‚¹‚ñ", +"Function '%-.64s' ‚Í’è‹`‚³‚ê‚Ä‚¢‚Ü‚¹‚ñ", +"Host '%-.64s' ‚Í many connection error ‚Ì‚½‚ßA‹‘”Û‚³‚ê‚Ü‚µ‚½. 'mysqladmin flush-hosts' ‚ʼn𜂵‚Ä‚­‚¾‚³‚¢", +"Host '%-.64s' ‚Í MySQL server ‚ÉÚ‘±‚ð‹–‰Â‚³‚ê‚Ä‚¢‚Ü‚¹‚ñ", +"MySQL ‚ð anonymous users ‚ÅŽg—p‚µ‚Ä‚¢‚éó‘Ô‚Å‚ÍAƒpƒXƒ[ƒh‚Ì•ÏX‚͂ł«‚Ü‚¹‚ñ", +"‘¼‚̃†[ƒU[‚̃pƒXƒ[ƒh‚ð•ÏX‚·‚邽‚߂ɂÍ, mysql ƒf[ƒ^ƒx[ƒX‚ɑ΂µ‚Ä update ‚Ì‹–‰Â‚ª‚È‚¯‚ê‚΂Ȃè‚Ü‚¹‚ñ.", +"Can't find any matching row in the user table", +"ˆê’v”(Rows matched): %ld •ÏX: %ld Warnings: %ld", +"V‹K‚ɃXƒŒƒbƒh‚ªì‚ê‚Ü‚¹‚ñ‚Å‚µ‚½ (errno %d). ‚à‚µÅ‘åŽg—p‹–‰Âƒƒ‚ƒŠ[”‚ð‰z‚¦‚Ä‚¢‚È‚¢‚̂ɃGƒ‰[‚ª”­¶‚µ‚Ä‚¢‚é‚È‚ç, ƒ}ƒjƒ…ƒAƒ‹‚Ì’†‚©‚ç 'possible OS-dependent bug' ‚Æ‚¢‚¤•¶Žš‚ð’T‚µ‚Ä‚­‚݂Ă¾‚³‚¢.", +"Column count doesn't match value count at row %ld", +"Can't reopen table: '%-.64s'", +"NULL ’l‚ÌŽg—p•û–@‚ª•s“K؂ł·", +"Got error '%-.64s' from regexp", +"Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause", +"ƒ†[ƒU[ '%-.32s' (ƒzƒXƒg '%-.64s' ‚̃†[ƒU[) ‚Í‹–‰Â‚³‚ê‚Ä‚¢‚Ü‚¹‚ñ", +"ƒRƒ}ƒ“ƒh %-.16s ‚Í ƒ†[ƒU[ '%-.32s'@'%-.64s' ,ƒe[ƒuƒ‹ '%-.64s' ‚ɑ΂µ‚Ä‹–‰Â‚³‚ê‚Ä‚¢‚Ü‚¹‚ñ", +"ƒRƒ}ƒ“ƒh %-.16s ‚Í ƒ†[ƒU[ '%-.32s'@'%-.64s'\n ƒJƒ‰ƒ€ '%-.64s' ƒe[ƒuƒ‹ '%-.64s' ‚ɑ΂µ‚Ä‹–‰Â‚³‚ê‚Ä‚¢‚Ü‚¹‚ñ", +"Illegal GRANT/REVOKE command; please consult the manual to see which privleges can be used.", +"The host or user argument to GRANT is too long", +"Table '%-.64s.%s' doesn't exist", +"There is no such grant defined for user '%-.32s' on host '%-.64s' on table '%-.64s'", +"The used command is not allowed with this MySQL version", +"Something is wrong in your syntax", +"Delayed insert thread couldn't get requested lock for table %-.64s", +"Too many delayed threads in use", +"Aborted connection %ld to db: '%-.64s' user: '%-.64s' (%s)", +"Got a packet bigger than 'max_allowed_packet' bytes", +"Got a read error from the connection pipe", +"Got an error from fcntl()", +"Got packets out of order", +"Couldn't uncompress communication packet", +"Got an error reading communication packets", +"Got timeout reading communication packets", +"Got an error writing communication packets", +"Got timeout writing communication packets", +"Result string is longer than 'max_allowed_packet' bytes", +"The used table type doesn't support BLOB/TEXT columns", +"The used table type doesn't support AUTO_INCREMENT columns", +"INSERT DELAYED can't be used with table '%-.64s', because it is locked with LOCK TABLES", +"Incorrect column name '%-.100s'", +"The used table handler can't index column '%-.64s'", +"All tables in the MERGE table are not defined identically", +"Can't write, because of unique constraint, to table '%-.64s'", +"BLOB column '%-.64s' used in key specification without a key length", +"All parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE instead", +"Result consisted of more than one row", +"This table type requires a primary key", +"This version of MySQL is not compiled with RAID support", +"You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column", +"Key '%-.64s' doesn't exist in table '%-.64s'", +"Can't open table", +"The handler for the table doesn't support %s", +"You are not allowed to execute this command in a transaction", +"Got error %d during COMMIT", +"Got error %d during ROLLBACK", +"Got error %d during FLUSH_LOGS", +"Got error %d during CHECKPOINT", +"Aborted connection %ld to db: '%-.64s' user: '%-.32s' host: `%-.64s' (%-.64s)", +"The handler for the table does not support binary table dump", +"Binlog closed while trying to FLUSH MASTER", +"Failed rebuilding the index of dumped table '%-.64s'", +"Error from master: '%-.64s'", +"Net error reading from master", +"Net error writing to master", +"Can't find FULLTEXT index matching the column list", +"Can't execute the given command because you have active locked tables or an active transaction", +"Unknown system variable '%-.64s'", +"Table '%-.64s' is marked as crashed and should be repaired", +"Table '%-.64s' is marked as crashed and last (automatic?) repair failed", +"Some non-transactional changed tables couldn't be rolled back", +"Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage; increase this mysqld variable and try again", +"This operation cannot be performed with a running slave; run STOP SLAVE first", +"This operation requires a running slave; configure slave and do START SLAVE", +"The server is not configured as slave; fix in config file or with CHANGE MASTER TO", +"Could not initialize master info structure; more error messages can be found in the MySQL error log", +"Could not create slave thread; check system resources", +"User %-.64s has already more than 'max_user_connections' active connections", +"You may only use constant expressions with SET", +"Lock wait timeout exceeded; try restarting transaction", +"The total number of locks exceeds the lock table size", +"Update locks cannot be acquired during a READ UNCOMMITTED transaction", +"DROP DATABASE not allowed while thread is holding global read lock", +"CREATE DATABASE not allowed while thread is holding global read lock", +"Incorrect arguments to %s", +"'%-.32s'@'%-.64s' is not allowed to create new users", +"Incorrect table definition; all MERGE tables must be in the same database", +"Deadlock found when trying to get lock; try restarting transaction", +"The used table type doesn't support FULLTEXT indexes", +"Cannot add foreign key constraint", +"Cannot add a child row: a foreign key constraint fails", +"Cannot delete a parent row: a foreign key constraint fails", +"Error connecting to master: %-.128s", +"Error running query on master: %-.128s", +"Error when executing command %s: %-.128s", +"Incorrect usage of %s and %s", +"The used SELECT statements have a different number of columns", +"Can't execute the query because you have a conflicting read lock", +"Mixing of transactional and non-transactional tables is disabled", +"Option '%s' used twice in statement", +"User '%-.64s' has exceeded the '%s' resource (current value: %ld)", +"Access denied; you need the %-.128s privilege for this operation", +"Variable '%-.64s' is a SESSION variable and can't be used with SET GLOBAL", +"Variable '%-.64s' is a GLOBAL variable and should be set with SET GLOBAL", +"Variable '%-.64s' doesn't have a default value", +"Variable '%-.64s' can't be set to the value of '%-.64s'", +"Incorrect argument type to variable '%-.64s'", +"Variable '%-.64s' can only be set, not read", +"Incorrect usage/placement of '%s'", +"This version of MySQL doesn't yet support '%s'", +"Got fatal error %d: '%-.128s' from master when reading data from binary log", +"Slave SQL thread ignored the query because of replicate-*-table rules", +"Variable '%-.64s' is a %s variable", +"Incorrect foreign key definition for '%-.64s': %s", +"Key reference and table reference don't match", +"Operand should contain %d column(s)", +"Subquery returns more than 1 row", +"Unknown prepared statement handler (%.*s) given to %s", +"Help database is corrupt or does not exist", +"Cyclic reference on subqueries", +"Converting column '%s' from %s to %s", +"Reference '%-.64s' not supported (%s)", +"Every derived table must have its own alias", +"Select %u was reduced during optimization", +"Table '%-.64s' from one of the SELECTs cannot be used in %-.32s", +"Client does not support authentication protocol requested by server; consider upgrading MySQL client", +"All parts of a SPATIAL index must be NOT NULL", +"COLLATION '%s' is not valid for CHARACTER SET '%s'", +"Slave is already running", +"Slave has already been stopped", +"Uncompressed data size too large; the maximum size is %d (probably, length of uncompressed data was corrupted)", +"ZLIB: Not enough memory", +"ZLIB: Not enough room in the output buffer (probably, length of uncompressed data was corrupted)", +"ZLIB: Input data corrupted", +"%d line(s) were cut by GROUP_CONCAT()", +"Row %ld doesn't contain data for all columns", +"Row %ld was truncated; it contained more data than there were input columns", +"Data truncated; NULL supplied to NOT NULL column '%s' at row %ld", +"Data truncated; out of range for column '%s' at row %ld", +"Data truncated for column '%s' at row %ld", +"Using storage engine %s for table '%s'", +"Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'", +"Can't drop one or more of the requested users", +"Can't revoke all privileges, grant for one or more of the requested users", +"Illegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'", +"Illegal mix of collations for operation '%s'", +"Variable '%-.64s' is not a variable component (can't be used as XXXX.variable_name)", +"Unknown collation: '%-.64s'", +"SSL parameters in CHANGE MASTER are ignored because this MySQL slave was compiled without SSL support; they can be used later if MySQL slave with SSL is started", +"Server is running in --secure-auth mode, but '%s'@'%s' has a password in the old format; please change the password to the new format", +"Field or reference '%-.64s%s%-.64s%s%-.64s' of SELECT #%d was resolved in SELECT #%d", +"Incorrect parameter or combination of parameters for START SLAVE UNTIL", +"It is recommended to run with --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL; otherwise, you are not safe in case of unexpected slave's mysqld restart", +"SQL thread is not to be started so UNTIL options are ignored", +"Incorrect index name '%-.100s'", +"Incorrect catalog name '%-.100s'", +"Query cache failed to set size %lu, new query cache size is %lu", +"Column '%-.64s' cannot be part of FULLTEXT index", +"Unknown key cache '%-.100s'", +"MySQL is started in --skip-name-resolve mode. You need to restart it without this switch for this grant to work", +"Unknown table engine '%s'", +"'%s' is deprecated, use '%s' instead", +"The target table %-.100s of the %s is not updateable", +"The '%s' feature was disabled; you need MySQL built with '%s' to have it working", +"The MySQL server is running with the %s option so it cannot execute this statement", +"Column '%-.100s' has duplicated value '%-.64s' in %s" +"Truncated wrong %-.32s value: '%-.128s'" +"Incorrect table definition; There can only be one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause" +"Invalid ON UPDATE clause for '%-.64s' column", +"This command is not supported in the prepared statement protocol yet", +"Got NDB error %d '%-.100s'", +"Got temporary NDB error %d '%-.100s'", +"Unknown or incorrect time zone: '%-.64s'", +"Invalid TIMESTAMP value in column '%s' at row %ld", +"Invalid %s character string: '%.64s'", +"Result of %s() was larger than max_allowed_packet (%ld) - truncated" +"Conflicting declarations: '%s%s' and '%s%s'" From 026bf61e9912d3165fe0592c44ae0128126b1b92 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 20 Jan 2005 12:39:46 +0400 Subject: [PATCH 0797/1063] configure.in: Add SJIS version of Japanese error messages. Windows version should include this new file, instead of the EUC-JP version. configure.in: Add SJIS version of Japanese error messages. Windows version should include this new file, instead of the EUC-JP version. --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 2d20a71f838..cc845a7bb8d 100644 --- a/configure.in +++ b/configure.in @@ -32,7 +32,7 @@ MYSQL_UNIX_ADDR_DEFAULT="/tmp/mysql.sock" # Remember to add a directory sql/share/LANGUAGE AVAILABLE_LANGUAGES="\ czech danish dutch english estonian french german greek hungarian \ -italian japanese korean norwegian norwegian-ny polish portuguese \ +italian japanese japanese-sjis korean norwegian norwegian-ny polish portuguese \ romanian russian serbian slovak spanish swedish ukrainian" # Generate make rules for all error messages From a242d574367192ef8698711f97e7bfc4cfb731b7 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 20 Jan 2005 13:08:16 +0400 Subject: [PATCH 0798/1063] errmsg.txt: Minor fix after character set conversion. sql/share/japanese-sjis/errmsg.txt: Minor fix after character set conversion. --- sql/share/japanese-sjis/errmsg.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/share/japanese-sjis/errmsg.txt b/sql/share/japanese-sjis/errmsg.txt index 66284b22367..a06723727b7 100644 --- a/sql/share/japanese-sjis/errmsg.txt +++ b/sql/share/japanese-sjis/errmsg.txt @@ -15,10 +15,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* - 3.22.10-beta euc-japanese (ujis) text + Shift-JIS Japanese */ -character-set=ujis +character-set=sjis "hashchk", "isamchk", From 89a24f933537f550844862d936ed57b44ec16069 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 20 Jan 2005 12:07:44 +0100 Subject: [PATCH 0799/1063] - Improved Do-rpm to perform RPM builds inside of a chrooted build environment (using "build" on SUSE Linux) Build-tools/Do-rpm: - added functionality to perform RPM builds inside of a chrooted build environment (using "build" on SUSE Linux) - see "--help" for more details --- Build-tools/Do-rpm | 266 +++++++++++++++++++++++++++++---------------- 1 file changed, 170 insertions(+), 96 deletions(-) diff --git a/Build-tools/Do-rpm b/Build-tools/Do-rpm index da06e1f58e4..23602debfb1 100755 --- a/Build-tools/Do-rpm +++ b/Build-tools/Do-rpm @@ -22,7 +22,6 @@ use Getopt::Long; Getopt::Long::Configure ("bundling"); use Sys::Hostname; -$opt_nobuild = undef; $opt_cc= undef; $opt_cflags= undef; $opt_clean= undef; @@ -33,6 +32,9 @@ $opt_help= undef; $opt_log= undef; $opt_mail= ""; $opt_verbose= undef; +$opt_susebuild= undef; +$opt_susebuildroot= undef; +$opt_suserpms= undef; # Set a dummy version until we know the correct one $VERSION= "x.y.z"; @@ -49,7 +51,9 @@ GetOptions( "help|h", "log|l:s", "mail|m=s", - "nobuild", + "susebuild|s", + "susebuildroot|r=s", + "suserpms=s", "verbose|v", ) || &print_help; @@ -57,6 +61,20 @@ GetOptions( defined($SPECFILE=$ARGV[0]) || print_help("Please provide the spec file name!"); +&print_help("Please define the location of the RPM repository!") if $opt_susebuild && !($opt_suserpms || $ENV{BUILD_RPMS}); + +unless ($opt_susebuildroot) +{ + if ($ENV{BUILD_ROOT}) + { + $opt_susebuildroot= $ENV{BUILD_ROOT}; + } + else + { + $opt_susebuildroot="/var/tmp/build-root"; + } +} + # Include helper functions $PWD= cwd(); $LOGGER= "$PWD/logger.pm"; @@ -72,7 +90,7 @@ else $subject= "RPM build for $SPECFILE failed" if $opt_mail; # Open the spec file and extract the version number -open(SPEC, $SPECFILE) or &abort("Unable to open \"$ARGV[0]\": $!"); +open(SPEC, $SPECFILE) or die "Unable to open \"$ARGV[0]\": $!"; @spec= ; close SPEC; @@ -94,7 +112,7 @@ $HOST= hostname(); $HOST=~ /^([^.-]*)/; $HOST= $1; $LOGFILE= "$PWD/Logs/Do-rpm-$HOST-$MAJOR.$MINOR.log"; -&logger("Using spec file for version: $VERSION"); +&logger("Logging to $LOGFILE"); # # Override predefined Log file name @@ -114,111 +132,157 @@ if (defined $opt_log) } } -# -# Newer RPM versions ship with a separate tool "rpmbuild" to build RPMs -# -if (-x "/usr/bin/rpmbuild") +&logger("Using spec file for version: $VERSION"); + +if ($opt_susebuild) { - $RPM= "/usr/bin/rpmbuild"; - $RMSOURCE= "--rmsource --rmspec"; + &susebuild; } else -{ - $RPM= "/bin/rpm"; - $RMSOURCE= "--rmspec"; +{ + &rpmbuild; } -if ($RPM) -{ - &logger("Found rpm binary: $RPM"); -} -else -{ - &abort("Unable to find RPM binary!"); -} - -# -# determine some RPM settings for this host -# -chomp($RPMARCH= `$RPM --eval "%{_arch}" 2> /dev/null`); -chomp($RPMDIR= `$RPM --eval "%{_rpmdir}" 2> /dev/null`); -chomp($SOURCEDIR= `$RPM --eval "%{_sourcedir}" 2> /dev/null`); -chomp($SPECDIR= `$RPM --eval "%{_specdir}" 2> /dev/null`); -chomp($SRCRPMDIR= `$RPM --eval "%{_srcrpmdir}" 2> /dev/null`); - -$SOURCEFILE= glob "mysql*-$VERSION.tar.gz"; - -unless($opt_nobuild) { - - &logger("Starting RPM build of MySQL-$VERSION on $HOST"); - - foreach $file ($SOURCEFILE, $SPECFILE) - { - &abort("Unable to find $file!") unless (-f "$file"); - } - -# -# Install source and spec file -# - &logger("Copying SOURCE and SPEC file to build directories."); - unless ($opt_dry_run) - { - copy($SOURCEFILE, $SOURCEDIR) - or &abort("Unable to copy $SOURCEFILE to $SOURCEDIR!"); - copy($SPECFILE, $SPECDIR) - or &abort("Unable to copy $SPECFILE to $SPECDIR!"); - } - -# -# Set environment variables - these are being used in the -# official MySQL RPM spec file -# - &logger("Setting special build environment variables") - if ($opt_cc) or ($opt_cflags) or ($opt_cxxflags) or ($opt_cxx); - $ENV{MYSQL_BUILD_CC}=$opt_cc if ($opt_cc); - $ENV{MYSQL_BUILD_CFLAGS}=$opt_cflags if ($opt_cflags); - $ENV{MYSQL_BUILD_CXXFLAGS}=$opt_cxxflags if ($opt_cxxflags); - $ENV{MYSQL_BUILD_CXX}=$opt_cxx if ($opt_cxx); - -# -# Build the RPMs -# - $command= "$RPM"; - $command.= " -v" if ($opt_verbose); - $command.= " -ba"; - $command.= " --clean $RMSOURCE" if $opt_clean; - $command.= " $SPECDIR/"; - $command.= basename($SPECFILE); - &logger("Building RPM."); - &run_command($command, "Error while building the RPMs!"); -} - -# -# Move the resulting RPMs into the pwd -# -$command= "mv"; -$command.= " -v " if ($opt_verbose); -$command.= " $SRCRPMDIR/MySQL*$VERSION_SRPM*.src.rpm $PWD"; -&logger("Moving source RPM to current dir."); -&run_command($command, "Error moving source RPM!"); - -$command= "mv"; -$command.= " -v " if ($opt_verbose); -# $command.= " $RPMDIR/$RPMARCH/MySQL*$VERSION*.$RPMARCH.rpm $PWD"; -$command.= " $RPMDIR/$RPMARCH/MySQL*$VERSION_SRPM*.$RPMARCH.rpm $PWD"; -&logger("Moving binary RPMs to current dir."); -&run_command($command, "Error moving binary RPMs!"); - &logger("SUCCESS: RPM files successfully created.") unless ($opt_dry_run); exit 0; +# +# Build using SUSE's "build" script +# +sub susebuild +{ + $BUILD= "/usr/bin/build"; + ( -x $BUILD) ? &logger("$BUILD found, proceeding.") : &abort("$BUILD could not be found!"); + $command= "sudo $BUILD --clean"; + $command.= " --root=$opt_susebuildroot"; + $command.= " --rpms=$opt_suserpms" if $opt_suserpms; + $command.= " $SPECFILE"; + &logger("Building RPMs using SUSE build."); + &run_command($command, "Error while running the SUSE RPM build!"); + + # + # Move the resulting RPMs into the pwd - we can use broad globs here + # as the build root has been cleaned up before so there should not be + # any residuals from previous build runs + # + $command= "cp"; + $command.= " -v " if ($opt_verbose); + $command.= " $opt_susebuildroot/usr/src/packages/SRPMS/MySQL*.src.rpm $PWD"; + &logger("Copying source RPM to current dir."); + &run_command($command, "Error moving source RPM!"); + + $command= "cp"; + $command.= " -v " if ($opt_verbose); + $command.= " $opt_susebuildroot/usr/src/packages/RPMS/*/MySQL*.rpm $PWD"; + &logger("Copying binary RPMs to current dir."); + &run_command($command, "Error moving binary RPMs!"); +} + +# +# Build using "plain" RPM +# +sub rpmbuild +{ + + # + # Newer RPM versions ship with a separate tool "rpmbuild" to build RPMs + # + if (-x "/usr/bin/rpmbuild") + { + $RPM= "/usr/bin/rpmbuild"; + $RMSOURCE= "--rmsource --rmspec"; + } + else + { + $RPM= "/bin/rpm"; + $RMSOURCE= "--rmspec"; + } + + if ($RPM) + { + &logger("Found rpm binary: $RPM"); + } + else + { + &abort("Unable to find RPM binary!"); + } + + # + # determine some RPM settings for this host + # + chomp($RPMARCH= `$RPM --eval "%{_arch}" 2> /dev/null`); + chomp($RPMDIR= `$RPM --eval "%{_rpmdir}" 2> /dev/null`); + chomp($SOURCEDIR= `$RPM --eval "%{_sourcedir}" 2> /dev/null`); + chomp($SPECDIR= `$RPM --eval "%{_specdir}" 2> /dev/null`); + chomp($SRCRPMDIR= `$RPM --eval "%{_srcrpmdir}" 2> /dev/null`); + + $SOURCEFILE= glob "mysql*-$VERSION.tar.gz"; + + &logger("Starting RPM build of MySQL-$VERSION on $HOST"); + + foreach $file ($SOURCEFILE, $SPECFILE) + { + &abort("Unable to find $file!") unless (-f "$file"); + } + + # + # Install source and spec file + # + &logger("Copying SOURCE and SPEC file to build directories."); + unless ($opt_dry_run) + { + copy($SOURCEFILE, $SOURCEDIR) + or &abort("Unable to copy $SOURCEFILE to $SOURCEDIR!"); + copy($SPECFILE, $SPECDIR) + or &abort("Unable to copy $SPECFILE to $SPECDIR!"); + } + + # + # Set environment variables - these are being used in the + # official MySQL RPM spec file + # + &logger("Setting special build environment variables") + if ($opt_cc) or ($opt_cflags) or ($opt_cxxflags) or ($opt_cxx); + $ENV{MYSQL_BUILD_CC}=$opt_cc if ($opt_cc); + $ENV{MYSQL_BUILD_CFLAGS}=$opt_cflags if ($opt_cflags); + $ENV{MYSQL_BUILD_CXXFLAGS}=$opt_cxxflags if ($opt_cxxflags); + $ENV{MYSQL_BUILD_CXX}=$opt_cxx if ($opt_cxx); + + # + # Build the RPMs + # + $command= "$RPM"; + $command.= " -v" if ($opt_verbose); + $command.= " -ba"; + $command.= " --clean $RMSOURCE" if $opt_clean; + $command.= " $SPECDIR/"; + $command.= basename($SPECFILE); + &logger("Building RPM."); + &run_command($command, "Error while building the RPMs!"); + + # + # Move the resulting RPMs into the pwd + # + $command= "mv"; + $command.= " -v " if ($opt_verbose); + $command.= " $SRCRPMDIR/MySQL*$VERSION_SRPM*.src.rpm $PWD"; + &logger("Moving source RPM to current dir."); + &run_command($command, "Error moving source RPM!"); + + $command= "mv"; + $command.= " -v " if ($opt_verbose); + $command.= " $RPMDIR/$RPMARCH/MySQL*$VERSION_SRPM*.$RPMARCH.rpm $PWD"; + &logger("Moving binary RPMs to current dir."); + &run_command($command, "Error moving binary RPMs!"); +} + sub print_help { my $message= $_[0]; if ($message ne "") { print "\n"; - print "ERROR: $message\n\n}"; + print "ERROR: $message\n\n"; } print <] Write a log file [to ] - (default is "$LOGFILE") -m, --mail=
Mail a failure report to the given address (and include a log file snippet, if logging is enabled) Note that the \@-Sign needs to be quoted! Example: --mail=user\\\@domain.com +-s, --susebuild Use the SUSE "build" script instead of RPM + directly (requires sudo privileges to run the + /usr/bin/build command) +-r, --susebuildroot= Use as the build root directory for the + SUSE "build" (default is /var/tmp/build-root + or defined by the BUILD_ROOT environment + variable) +--suserpms= Path to the SUSE RPM repository to build up + the build root (mandatory option when using + --susebuild and the BUILD_RPMS environment + variable is not set.) -v, --verbose Verbose execution Example: From 877ed48b3de43ffe1f1250593c061881e9c4106d Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 20 Jan 2005 12:19:48 +0100 Subject: [PATCH 0800/1063] bug#8010 - ndb release connections when last op was simple read ndb/src/kernel/blocks/dbtc/DbtcMain.cpp: bug#8010 release connections when last op was simple read --- ndb/src/kernel/blocks/dbtc/DbtcMain.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp b/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp index 815d6c9d838..c804fa32bd2 100644 --- a/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp +++ b/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp @@ -1271,7 +1271,10 @@ void Dbtc::execTCRELEASEREQ(Signal* signal) if (tapiBlockref == apiConnectptr.p->ndbapiBlockref) { if (apiConnectptr.p->apiConnectstate == CS_CONNECTED || (apiConnectptr.p->apiConnectstate == CS_ABORTING && - apiConnectptr.p->abortState == AS_IDLE)){ + apiConnectptr.p->abortState == AS_IDLE) || + (apiConnectptr.p->apiConnectstate == CS_STARTED && + apiConnectptr.p->firstTcConnect == RNIL)) + { jam(); /* JUST REPLY OK */ releaseApiCon(signal, apiConnectptr.i); signal->theData[0] = tuserpointer; From 9241e34593c94ec65920026d689b118355356c3a Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 20 Jan 2005 15:38:56 +0400 Subject: [PATCH 0801/1063] item_cmpfunc.cc: Bug#7834 Illegal mix of collations in IN operator IN was the first function supporting character set convertion. agg_arg_charsets() was written afterwards, which is more flexible. Now IN just reuses this function. sql/item_cmpfunc.cc: Bug#7834 Illegal mix of collations in IN operator IN was the first function supporting character set convertion. agg_arg_charsets() was written afterwards, which is more flexible. Now IN just reuses this function. --- mysql-test/r/func_in.result | 8 +++++ mysql-test/t/func_in.test | 5 ++++ sql/item_cmpfunc.cc | 59 +++---------------------------------- 3 files changed, 17 insertions(+), 55 deletions(-) diff --git a/mysql-test/r/func_in.result b/mysql-test/r/func_in.result index daeda51a12a..516d0a28a21 100644 --- a/mysql-test/r/func_in.result +++ b/mysql-test/r/func_in.result @@ -157,6 +157,14 @@ a bbbb цццц drop table t1; +create table t1 (a char(10) character set latin1 not null); +insert into t1 values ('a'),('b'),('c'); +select a from t1 where a IN ('a','b','c') order by a; +a +a +b +c +drop table t1; set names latin1; select '1.0' in (1,2); '1.0' in (1,2) diff --git a/mysql-test/t/func_in.test b/mysql-test/t/func_in.test index 3cd8c064817..6e0883b821f 100644 --- a/mysql-test/t/func_in.test +++ b/mysql-test/t/func_in.test @@ -80,6 +80,11 @@ create table t1 (a char(10) character set utf8 not null); insert into t1 values ('bbbb'),(_koi8r'ÃÃÃÃ'),(_latin1'ÄÄÄÄ'); select a from t1 where a in ('bbbb',_koi8r'ÃÃÃÃ',_latin1'ÄÄÄÄ') order by a; drop table t1; +# Bug#7834 Illegal mix of collations in IN operator +create table t1 (a char(10) character set latin1 not null); +insert into t1 values ('a'),('b'),('c'); +select a from t1 where a IN ('a','b','c') order by a; +drop table t1; set names latin1; select '1.0' in (1,2); diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index 6ec98f2dcd4..c5e6d520ab7 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -1749,64 +1749,13 @@ void Item_func_in::fix_length_and_dec() agg_cmp_type(&cmp_type, args, arg_count); + if (cmp_type == STRING_RESULT && + agg_arg_charsets(cmp_collation, args, arg_count, MY_COLL_CMP_CONV)) + return; + for (arg=args+1, arg_end=args+arg_count; arg != arg_end ; arg++) const_itm&= arg[0]->const_item(); - - if (cmp_type == STRING_RESULT) - { - /* - We allow consts character set conversion for - - item IN (const1, const2, const3, ...) - - if item is in a superset for all arguments, - and if it is a stong side according to coercibility rules. - - TODO: add covnersion for non-constant IN values - via creating Item_func_conv_charset(). - */ - - if (agg_arg_collations_for_comparison(cmp_collation, args, arg_count, - MY_COLL_ALLOW_SUPERSET_CONV)) - return; - if ((!my_charset_same(args[0]->collation.collation, - cmp_collation.collation) || !const_itm)) - { - if (agg_arg_collations_for_comparison(cmp_collation, args, arg_count)) - return; - } - else - { - /* - Conversion is possible: - All IN arguments are constants. - */ - Item_arena *arena, backup; - arena= thd->change_arena_if_needed(&backup); - - for (arg= args+1, arg_end= args+arg_count; arg < arg_end; arg++) - { - if (!arg[0]->null_value && - !my_charset_same(cmp_collation.collation, - arg[0]->collation.collation)) - { - Item_string *conv; - String tmp, cstr, *ostr= arg[0]->val_str(&tmp); - uint dummy_errors; - cstr.copy(ostr->ptr(), ostr->length(), ostr->charset(), - cmp_collation.collation, &dummy_errors); - conv= new Item_string(cstr.ptr(),cstr.length(), cstr.charset(), - arg[0]->collation.derivation); - conv->str_value.copy(); - arg[0]= conv; - } - } - if (arena) - thd->restore_backup_item_arena(arena, &backup); - } - } - /* Row item with NULLs inside can return NULL or FALSE => they can't be processed as static From b3cd49f3127f5cf41d2b4e42c6597262ca6a5376 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 20 Jan 2005 13:56:22 +0200 Subject: [PATCH 0802/1063] fixed problem with distinct select with grouping and subqueries (BUG#7946) mysql-test/r/derived.result: DISTINCT over grouped select on subquery in the FROM clause mysql-test/t/derived.test: DISTINCT over grouped select on subquery in the FROM clause sql/sql_select.cc: used current join copy for test --- mysql-test/r/derived.result | 9 +++++++++ mysql-test/t/derived.test | 10 ++++++++++ sql/sql_select.cc | 2 +- 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/derived.result b/mysql-test/r/derived.result index 7e6b9b44566..61d745d0236 100644 --- a/mysql-test/r/derived.result +++ b/mysql-test/r/derived.result @@ -330,3 +330,12 @@ SELECT MIN(price) min, MAX(price) max, AVG(price) avg FROM (SELECT SUBSTRING( MA min max avg 10.00 10.00 10 DROP TABLE t1; +create table t1 (a integer, b integer); +insert into t1 values (1,4), (2,2),(2,2), (4,1),(4,1),(4,1),(4,1); +select distinct sum(b) from t1 group by a; +sum(b) +4 +select distinct sum(b) from (select a,b from t1) y group by a; +sum(b) +4 +drop table t1; diff --git a/mysql-test/t/derived.test b/mysql-test/t/derived.test index 64e3fe8929b..8b322746ed6 100644 --- a/mysql-test/t/derived.test +++ b/mysql-test/t/derived.test @@ -214,3 +214,13 @@ CREATE TABLE `t1` ( `itemid` int(11) NOT NULL default '0', `grpid` varchar(15) N insert into t1 values (128, 'rozn', 2, now(), 10),(128, 'rozn', 1, now(), 10); SELECT MIN(price) min, MAX(price) max, AVG(price) avg FROM (SELECT SUBSTRING( MAX(concat(date_,";",price)), 12) price FROM t1 WHERE itemid=128 AND grpid='rozn' GROUP BY itemid, grpid, vendor) lastprices; DROP TABLE t1; + +# +# DISTINCT over grouped select on subquery in the FROM clause +# +create table t1 (a integer, b integer); +insert into t1 values (1,4), (2,2),(2,2), (4,1),(4,1),(4,1),(4,1); +select distinct sum(b) from t1 group by a; +select distinct sum(b) from (select a,b from t1) y group by a; +drop table t1; + diff --git a/sql/sql_select.cc b/sql/sql_select.cc index aea7cb9ed6d..b2fb7ec0275 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -1304,7 +1304,7 @@ JOIN::exec() curr_join->select_distinct=0; /* Each row is unique */ curr_join->join_free(0); /* Free quick selects */ - if (select_distinct && ! group_list) + if (curr_join->select_distinct && ! curr_join->group_list) { thd->proc_info="Removing duplicates"; if (curr_join->tmp_having) From c03aaf85f23f5c8f55a9b3182839b2e440431260 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 20 Jan 2005 16:25:38 +0100 Subject: [PATCH 0803/1063] - renamed client_test -> mysql_client_test - renamed the tests that use the embedded server (client_test -> mysql_client_test_embedded, mysqltest -> mysql_test_embedded and changed some Makefiles and scripts so they are installed in $bindir (required to be able to run the test suite against the embedded server) tests/mysql_client_test.c: Rename: tests/client_test.c -> tests/mysql_client_test.c libmysql/libmysql.c: - renamed client_test.c to mysql_client_test.c in a comment libmysqld/examples/Makefile.am: - renamed client_test -> mysql_client_test_embedded - renamed mysqltest -> mysqltest_embedded - both will be installed in $bindir scripts/make_binary_distribution.sh: - install mysql_client_test, mysql_client_test_embedded and mysqltest_embedded into bin directory tests/Makefile.am: - renamed client_test to mysql_client_test BitKeeper/etc/ignore: Added tests/mysql_client_test to the ignore list --- .bzrignore | 2 ++ libmysql/libmysql.c | 2 +- libmysqld/examples/Makefile.am | 17 +++++++++-------- scripts/make_binary_distribution.sh | 4 +++- tests/Makefile.am | 6 +++--- tests/{client_test.c => mysql_client_test.c} | 0 6 files changed, 18 insertions(+), 13 deletions(-) rename tests/{client_test.c => mysql_client_test.c} (100%) diff --git a/.bzrignore b/.bzrignore index 54a8c8fd03a..40b7668cb64 100644 --- a/.bzrignore +++ b/.bzrignore @@ -1002,3 +1002,5 @@ vio/test-ssl vio/test-sslclient vio/test-sslserver vio/viotest-ssl +tests/mysql_client_test +tests/mysql_client_test diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index 206fd8f77b4..3d84059e981 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -2978,7 +2978,7 @@ static my_bool int_is_null_false= 0; values and mysql_stmt_execute() the statement. See also: mysql_stmt_send_long_data() for sending long text/blob - data in pieces, examples in tests/client_test.c. + data in pieces, examples in tests/mysql_client_test.c. Next steps you might want to make: - execute statement with mysql_stmt_execute(), - reset statement using mysql_stmt_reset() or reprepare it with diff --git a/libmysqld/examples/Makefile.am b/libmysqld/examples/Makefile.am index 5b0a86e679c..c6759d99aab 100644 --- a/libmysqld/examples/Makefile.am +++ b/libmysqld/examples/Makefile.am @@ -1,6 +1,7 @@ -noinst_PROGRAMS = mysqltest mysql client_test -client_sources = $(mysqltest_SOURCES) $(mysql_SOURCES) -tests_sources= $(client_test_SOURCES) +noinst_PROGRAMS = mysql +bin_PROGRAMS = mysqltest_embedded mysql_client_test_embedded +client_sources = $(mysqltest_embedded_SOURCES) $(mysql_SOURCES) +tests_sources= $(mysql_client_test_SOURCES) link_sources: for f in $(client_sources); do \ @@ -19,16 +20,16 @@ INCLUDES = @MT_INCLUDES@ -I$(top_srcdir)/include -I$(srcdir) \ LIBS = @LIBS@ @WRAPLIBS@ @CLIENT_LIBS@ LDADD = @CLIENT_EXTRA_LDFLAGS@ ../libmysqld.a @innodb_system_libs@ @LIBDL@ $(CXXLDFLAGS) -mysqltest_LINK = $(CXXLINK) -mysqltest_SOURCES = mysqltest.c -mysqltest_LDADD = $(LDADD) $(top_builddir)/regex/libregex.a +mysqltest_embedded_LINK = $(CXXLINK) +mysqltest_embedded_SOURCES = mysqltest.c +mysqltest_embedded_LDADD = $(LDADD) $(top_builddir)/regex/libregex.a mysql_SOURCES = mysql.cc readline.cc completion_hash.cc \ my_readline.h sql_string.h completion_hash.h mysql_LDADD = @readline_link@ @TERMCAP_LIB@ $(LDADD) -client_test_LINK = $(CXXLINK) -client_test_SOURCES = client_test.c +mysql_client_test_embedded_LINK = $(CXXLINK) +mysql_client_test_embedded_SOURCES = mysql_client_test.c clean: rm -f $(client_sources) diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 281ef9bd469..22b51168c23 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -127,6 +127,8 @@ else client/.libs/mysqltest client/.libs/mysqlcheck \ client/.libs/mysqlbinlog client/.libs/mysqlmanagerc \ client/.libs/mysqlmanager-pwgen tools/.libs/mysqlmanager \ + tests/.libs/mysql_client_test libmysqld/examples/mysql_client_test_embedded \ + libmysqld/examples/mysqltest_embedded \ "; fi @@ -187,7 +189,7 @@ fi if [ $BASE_SYSTEM != "netware" ] ; then if [ -d tests ] ; then - $CP tests/client_test tests/*.res tests/*.tst tests/*.pl $BASE/tests + $CP tests/*.res tests/*.tst tests/*.pl $BASE/tests fi if [ -d man ] ; then $CP man/*.1 $BASE/man/man1 diff --git a/tests/Makefile.am b/tests/Makefile.am index df16ee789a5..de4fbb2a4f2 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -26,7 +26,7 @@ EXTRA_DIST = auto_increment.res auto_increment.tst \ pmail.pl mail_to_db.pl table_types.pl \ udf_test udf_test.res myisam-big-rows.tst -bin_PROGRAMS = client_test +bin_PROGRAMS = mysql_client_test noinst_PROGRAMS = insert_test select_test thread_test # @@ -35,8 +35,8 @@ noinst_PROGRAMS = insert_test select_test thread_test INCLUDES = -I$(top_srcdir)/include $(openssl_includes) LIBS = @CLIENT_LIBS@ LDADD = @CLIENT_EXTRA_LDFLAGS@ ../libmysql/libmysqlclient.la -client_test_LDADD= $(LDADD) $(CXXLDFLAGS) -client_test_SOURCES= client_test.c +mysql_client_test_LDADD= $(LDADD) $(CXXLDFLAGS) +mysql_client_test_SOURCES= mysql_client_test.c insert_test_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES) select_test_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES) diff --git a/tests/client_test.c b/tests/mysql_client_test.c similarity index 100% rename from tests/client_test.c rename to tests/mysql_client_test.c From 4e1e23a17438433bf498e038b60b024d345f9959 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 20 Jan 2005 17:00:30 +0100 Subject: [PATCH 0804/1063] - fixed one missing occasion from the mysql_client_test renaming libmysqld/examples/Makefile.am: - fixed a missing rename (mysql_client_test -> mysql_client_test_embedded) --- libmysqld/examples/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libmysqld/examples/Makefile.am b/libmysqld/examples/Makefile.am index c6759d99aab..51a7252440a 100644 --- a/libmysqld/examples/Makefile.am +++ b/libmysqld/examples/Makefile.am @@ -1,7 +1,7 @@ noinst_PROGRAMS = mysql bin_PROGRAMS = mysqltest_embedded mysql_client_test_embedded client_sources = $(mysqltest_embedded_SOURCES) $(mysql_SOURCES) -tests_sources= $(mysql_client_test_SOURCES) +tests_sources= $(mysql_client_test_embedded_SOURCES) link_sources: for f in $(client_sources); do \ From 7a3767fc5ebdf376280f4d0ecaa52e9e3aef9bf4 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 21 Jan 2005 07:53:02 +0100 Subject: [PATCH 0805/1063] Bug#8051 - ndb Make sure to ship error code in system error signal --- ndb/src/kernel/blocks/dbdih/DbdihMain.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp b/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp index a8ad4008a74..d6315ab259e 100644 --- a/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp +++ b/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp @@ -2976,6 +2976,8 @@ void Dbdih::execCOPY_FRAGREF(Signal* signal) SystemError * const sysErr = (SystemError*)&signal->theData[0]; sysErr->errorCode = SystemError::CopyFragRefError; sysErr->errorRef = reference(); + sysErr->data1 = errorCode; + sysErr->data2 = 0; sendSignal(cntrRef, GSN_SYSTEM_ERROR, signal, SystemError::SignalLength, JBB); return; @@ -4492,6 +4494,8 @@ void Dbdih::handleTakeOverNewMaster(Signal* signal, Uint32 takeOverPtrI) SystemError * const sysErr = (SystemError*)&signal->theData[0]; sysErr->errorCode = SystemError::CopyFragRefError; sysErr->errorRef = reference(); + signal->data1= 0; + signal->data2= __LINE__; sendSignal(cntrRef, GSN_SYSTEM_ERROR, signal, SystemError::SignalLength, JBB); } From 4bfad5aedb45d386a4449f70cf079357c297642c Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 21 Jan 2005 08:28:23 +0100 Subject: [PATCH 0806/1063] bug#8051 - ndb, typo, more info on crash ndb/src/kernel/blocks/dbdih/DbdihMain.cpp: typo --- ndb/src/kernel/blocks/dbdih/DbdihMain.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp b/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp index d6315ab259e..dba1efbba9a 100644 --- a/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp +++ b/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp @@ -4494,8 +4494,8 @@ void Dbdih::handleTakeOverNewMaster(Signal* signal, Uint32 takeOverPtrI) SystemError * const sysErr = (SystemError*)&signal->theData[0]; sysErr->errorCode = SystemError::CopyFragRefError; sysErr->errorRef = reference(); - signal->data1= 0; - signal->data2= __LINE__; + sysErr->data1= 0; + sysErr->data2= __LINE__; sendSignal(cntrRef, GSN_SYSTEM_ERROR, signal, SystemError::SignalLength, JBB); } From 9f7f6ed2c94d2e44bf5c5adf620a2b9e39887d67 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 21 Jan 2005 15:14:31 +0400 Subject: [PATCH 0807/1063] A fix (bug #7261: Alter table loses temp table with lower_case_table_names=2). --- sql/sql_table.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sql/sql_table.cc b/sql/sql_table.cc index c3bfbe086f1..e01df8a3fcd 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -3231,7 +3231,8 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name, } /* Remove link to old table and rename the new one */ close_temporary_table(thd,table->table_cache_key,table_name); - if (rename_temporary_table(thd, new_table, new_db, new_alias)) + /* Should pass the 'new_name' as we store table name in the cache */ + if (rename_temporary_table(thd, new_table, new_db, new_name)) { // Fatal error close_temporary_table(thd,new_db,tmp_name); my_free((gptr) new_table,MYF(0)); From f813e0dac0d9f31140b699f3903940b50c9481fc Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 21 Jan 2005 16:49:20 +0400 Subject: [PATCH 0808/1063] Bug#7943: Wrong prefix lengths reported on UTF-8 columns SHOW KEYS FROM t1 now displays number of characters in Sub_part, not number of bytes, to be compatible with SHOW CREATE TABLE. --- mysql-test/r/ctype_mb.result | 4 ++-- sql/sql_show.cc | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/mysql-test/r/ctype_mb.result b/mysql-test/r/ctype_mb.result index 5e273b3c800..dbdb9c1343c 100644 --- a/mysql-test/r/ctype_mb.result +++ b/mysql-test/r/ctype_mb.result @@ -33,7 +33,7 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 SHOW KEYS FROM t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment -t1 1 key_a 1 a A NULL 9 NULL YES BTREE +t1 1 key_a 1 a A NULL 3 NULL YES BTREE ALTER TABLE t1 CHANGE a a CHAR(4); SHOW CREATE TABLE t1; Table Create Table @@ -53,5 +53,5 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 SHOW KEYS FROM t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment -t1 1 key_a 1 a A NULL 9 NULL YES BTREE +t1 1 key_a 1 a A NULL 3 NULL YES BTREE DROP TABLE t1; diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 8929872c466..91cac29f3a3 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -1025,7 +1025,8 @@ mysqld_show_keys(THD *thd, TABLE_LIST *table_list) /* Check if we have a key part that only uses part of the field */ if (!(key_info->flags & HA_FULLTEXT) && (!key_part->field || key_part->length != table->field[key_part->fieldnr-1]->key_length())) - protocol->store_tiny((longlong) key_part->length); + protocol->store_tiny((longlong) key_part->length / + key_part->field->charset()->mbmaxlen); else protocol->store_null(); protocol->store_null(); // No pack_information yet From 56b1a854698e98412746164e764bf29bb435e55d Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 21 Jan 2005 17:51:24 +0400 Subject: [PATCH 0809/1063] A fix (Bug #8015: server refuses to start with long basedir path). --- sql/mysql_priv.h | 2 +- sql/mysqld.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 4b785aafc5f..85a54c69467 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -852,7 +852,7 @@ extern Gt_creator gt_creator; extern Lt_creator lt_creator; extern Ge_creator ge_creator; extern Le_creator le_creator; -extern char language[LIBLEN],reg_ext[FN_EXTLEN]; +extern char language[FN_REFLEN], reg_ext[FN_EXTLEN]; extern char glob_hostname[FN_REFLEN], mysql_home[FN_REFLEN]; extern char pidfile_name[FN_REFLEN], system_time_zone[30], *opt_init_file; extern char log_error_file[FN_REFLEN]; diff --git a/sql/mysqld.cc b/sql/mysqld.cc index d1fef3519bf..4c30ad51751 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -340,7 +340,7 @@ char *default_tz_name; char log_error_file[FN_REFLEN], glob_hostname[FN_REFLEN]; char* log_error_file_ptr= log_error_file; char mysql_real_data_home[FN_REFLEN], - language[LIBLEN],reg_ext[FN_EXTLEN], mysql_charsets_dir[FN_REFLEN], + language[FN_REFLEN], reg_ext[FN_EXTLEN], mysql_charsets_dir[FN_REFLEN], *mysqld_user,*mysqld_chroot, *opt_init_file, *opt_init_connect, *opt_init_slave, def_ft_boolean_syntax[sizeof(ft_boolean_syntax)]; From 5e98f462bed44f1f6e0bb541368685f51d63815a Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 21 Jan 2005 17:54:50 +0200 Subject: [PATCH 0810/1063] dict0dict.c: Fix bug #7831: ALTER TABLE ... ADD CONSTRAINT PRIMARY KEY ... complained about bad foreign key definition innobase/dict/dict0dict.c: Fix bug #7831: ALTER TABLE ... ADD CONSTRAINT PRIMARY KEY ... complained about bad foreign key definition --- innobase/dict/dict0dict.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/innobase/dict/dict0dict.c b/innobase/dict/dict0dict.c index 2e6504cac11..186f3be2f31 100644 --- a/innobase/dict/dict0dict.c +++ b/innobase/dict/dict0dict.c @@ -2895,9 +2895,9 @@ loop: constraint_name = NULL; if (ptr1 < ptr2) { - /* The user has specified a constraint name. Pick it so + /* The user may have specified a constraint name. Pick it so that we can store 'databasename/constraintname' as the id of - the id of the constraint to system tables. */ + of the constraint to system tables. */ ptr = ptr1; ptr = dict_accept(ptr, "CONSTRAINT", &success); @@ -2934,6 +2934,10 @@ loop: ptr = dict_accept(ptr, "FOREIGN", &success); + if (!success) { + goto loop; + } + if (!isspace(*ptr)) { goto loop; } From 6eecb8e4e206db57b3d01c07f0482e86af6b4e12 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 21 Jan 2005 17:59:23 +0200 Subject: [PATCH 0811/1063] fil0fil.c: Fix bug #8021 :Windows error number 87 with multiple tablespaces after mysqld restart; still has to be tested on Windows that this now works innobase/fil/fil0fil.c: Fix bug #8021 :Windows error number 87 with multiple tablespaces after mysqld restart; still has to be tested on Windows that this now works --- innobase/fil/fil0fil.c | 78 ++++++++++++++++++++++++++++-------------- 1 file changed, 53 insertions(+), 25 deletions(-) diff --git a/innobase/fil/fil0fil.c b/innobase/fil/fil0fil.c index d1a083fcd66..ea34b6ffd93 100644 --- a/innobase/fil/fil0fil.c +++ b/innobase/fil/fil0fil.c @@ -477,28 +477,33 @@ fil_node_open_file( ut_a(node->n_pending == 0); ut_a(node->open == FALSE); - /* printf("Opening file %s\n", node->name); */ - - if (space->purpose == FIL_LOG) { - node->handle = os_file_create(node->name, OS_FILE_OPEN, - OS_FILE_AIO, OS_LOG_FILE, &ret); - } else if (node->is_raw_disk) { - node->handle = os_file_create(node->name, - OS_FILE_OPEN_RAW, - OS_FILE_AIO, OS_DATA_FILE, &ret); - } else { - node->handle = os_file_create(node->name, OS_FILE_OPEN, - OS_FILE_AIO, OS_DATA_FILE, &ret); - } - - ut_a(ret); - - node->open = TRUE; - - system->n_open++; - if (node->size == 0) { + /* It must be a single-table tablespace and we do not know the + size of the file yet. First we open the file in the normal + mode, no async I/O here, for simplicity. Then do some checks, + and close the file again. + NOTE that we could not use the simple file read function + os_file_read() in Windows to read from a file opened for + async I/O! */ + + node->handle = os_file_create_simple_no_error_handling( + node->name, OS_FILE_OPEN, + OS_FILE_READ_ONLY, &success); + if (!success) { + /* The following call prints an error message */ + os_file_get_last_error(TRUE); + + ut_print_timestamp(stderr); + + fprintf(stderr, +" InnoDB: Fatal error: cannot open %s\n." +"InnoDB: Have you deleted .ibd files under a running mysqld server?\n", + node->name); + ut_a(0); + } + ut_a(space->purpose != FIL_LOG); + ut_a(space->id != 0); os_file_get_size(node->handle, &size_low, &size_high); @@ -508,11 +513,6 @@ fil_node_open_file( node->size = (ulint) (size_bytes / UNIV_PAGE_SIZE); #else - /* It must be a single-table tablespace and we do not know the - size of the file yet */ - - ut_a(space->id != 0); - if (size_bytes < FIL_IBD_FILE_INITIAL_SIZE * UNIV_PAGE_SIZE) { fprintf(stderr, "InnoDB: Error: the size of single-table tablespace file %s\n" @@ -536,6 +536,10 @@ fil_node_open_file( ut_free(buf2); + /* Close the file now that we have read the space id from it */ + + os_file_close(node->handle); + if (space_id == ULINT_UNDEFINED || space_id == 0) { fprintf(stderr, "InnoDB: Error: tablespace id %lu in file %s is not sensible\n", @@ -563,6 +567,30 @@ fil_node_open_file( space->size += node->size; } + /* printf("Opening file %s\n", node->name); */ + + /* Open the file for reading and writing, in Windows normally in the + unbuffered async I/O mode, though global variables may make + os_file_create() to fall back to the normal file I/O mode. */ + + if (space->purpose == FIL_LOG) { + node->handle = os_file_create(node->name, OS_FILE_OPEN, + OS_FILE_AIO, OS_LOG_FILE, &ret); + } else if (node->is_raw_disk) { + node->handle = os_file_create(node->name, + OS_FILE_OPEN_RAW, + OS_FILE_AIO, OS_DATA_FILE, &ret); + } else { + node->handle = os_file_create(node->name, OS_FILE_OPEN, + OS_FILE_AIO, OS_DATA_FILE, &ret); + } + + ut_a(ret); + + node->open = TRUE; + + system->n_open++; + if (space->purpose == FIL_TABLESPACE && space->id != 0) { /* Put the node to the LRU list */ UT_LIST_ADD_FIRST(LRU, system->LRU, node); From a3f7796dd93baebe835a98992c775a099da0b0b2 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 21 Jan 2005 17:57:44 +0100 Subject: [PATCH 0812/1063] Bug#8070 corrected possible unalignment in NdbRecAttr access methods --- ndb/include/ndbapi/NdbRecAttr.hpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/ndb/include/ndbapi/NdbRecAttr.hpp b/ndb/include/ndbapi/NdbRecAttr.hpp index da03df13027..29eab64a84f 100644 --- a/ndb/include/ndbapi/NdbRecAttr.hpp +++ b/ndb/include/ndbapi/NdbRecAttr.hpp @@ -304,7 +304,9 @@ inline Int64 NdbRecAttr::int64_value() const { - return *(Int64*)theRef; + Int64 val; + memcpy(&val,theRef,8); + return val; } inline @@ -332,7 +334,9 @@ inline Uint64 NdbRecAttr::u_64_value() const { - return *(Uint64*)theRef; + Uint64 val; + memcpy(&val,theRef,8); + return val; } inline @@ -360,14 +364,18 @@ inline float NdbRecAttr::float_value() const { - return *(float*)theRef; + float val; + memcpy(&val,theRef,sizeof(val)); + return val; } inline double NdbRecAttr::double_value() const { - return *(double*)theRef; + double val; + memcpy(&val,theRef,sizeof(val)); + return val; } inline From c695ccd27e753fe9ed67dc28443de7639203a4bc Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 22 Jan 2005 04:45:22 +0200 Subject: [PATCH 0813/1063] fil0fil.c: Fix a race condition that could cause the assertion space->n_pending_flushes == 0 to fail in fil0fil.c, in fil_space_free(), in DROP TABLE or in ALTER TABLE innobase/fil/fil0fil.c: Fix a race condition that could cause the assertion space->n_pending_flushes == 0 to fail in fil0fil.c, in fil_space_free() --- innobase/fil/fil0fil.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/innobase/fil/fil0fil.c b/innobase/fil/fil0fil.c index ea34b6ffd93..5f71c00aea6 100644 --- a/innobase/fil/fil0fil.c +++ b/innobase/fil/fil0fil.c @@ -4139,7 +4139,8 @@ fil_flush_file_spaces( space = UT_LIST_GET_FIRST(system->space_list); while (space) { - if (space->purpose == purpose) { + if (space->purpose == purpose && !space->is_being_deleted) { + space->n_pending_flushes++; /* prevent dropping of the space while we are flushing */ From 25c2d1adb09a3dd521a110013ab03eac3e1fc01a Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 22 Jan 2005 02:40:27 -0800 Subject: [PATCH 0814/1063] select_found.result, select_found.test: Added a test case for bug #7945. sql_select.cc: Fixed bug #7945. If DISTINCT is used only with constants in a query with GROUP BY, we can apply an optimization that set LIMIT to 1 only in the case when there is no SQL_CALC_FOUND_ROWS. sql/sql_select.cc: Fixed bug #7945. If DISTINCT is used only with constants in a query with GROUP BY, we can apply an optimization that set LIMIT to 1 only in the case when there is no SQL_CALC_FOUND_ROWS. mysql-test/t/select_found.test: Added a test case for bug #7945. mysql-test/r/select_found.result: Added a test case for bug #7945. --- mysql-test/r/select_found.result | 8 ++++++++ mysql-test/t/select_found.test | 9 +++++++++ sql/sql_select.cc | 13 ++++++++++--- 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/mysql-test/r/select_found.result b/mysql-test/r/select_found.result index 444124bcd67..11629addba4 100644 --- a/mysql-test/r/select_found.result +++ b/mysql-test/r/select_found.result @@ -223,3 +223,11 @@ SELECT FOUND_ROWS(); FOUND_ROWS() 0 DROP TABLE t1; +CREATE TABLE t1 (a int, b int); +INSERT INTO t1 VALUES (1,2), (1,3), (1,4), (1,5); +SELECT SQL_CALC_FOUND_ROWS DISTINCT 'a' FROM t1 GROUP BY b LIMIT 2; +a +a +SELECT FOUND_ROWS(); +FOUND_ROWS() +1 diff --git a/mysql-test/t/select_found.test b/mysql-test/t/select_found.test index 7599277a867..997cadc2992 100644 --- a/mysql-test/t/select_found.test +++ b/mysql-test/t/select_found.test @@ -146,3 +146,12 @@ INSERT INTO t1 VALUES (0), (0), (1), (2); SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a = 0 GROUP BY a HAVING a > 10; SELECT FOUND_ROWS(); DROP TABLE t1; + +# +# Bug #7945: group by + distinct with constant expression + limit +# + +CREATE TABLE t1 (a int, b int); +INSERT INTO t1 VALUES (1,2), (1,3), (1,4), (1,5); +SELECT SQL_CALC_FOUND_ROWS DISTINCT 'a' FROM t1 GROUP BY b LIMIT 2; +SELECT FOUND_ROWS(); diff --git a/sql/sql_select.cc b/sql/sql_select.cc index eda4ce73186..468cdf05d36 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -2114,9 +2114,15 @@ find_best(JOIN *join,table_map rest_tables,uint idx,double record_count, x = used key parts (1 <= x <= c) */ double rec_per_key; +#if 0 if (!(rec_per_key=(double) keyinfo->rec_per_key[keyinfo->key_parts-1])) rec_per_key=(double) s->records/rec+1; +#else + rec_per_key= keyinfo->rec_per_key[keyinfo->key_parts-1] ? + (double) keyinfo->rec_per_key[keyinfo->key_parts-1] : + (double) s->records/rec+1; +#endif if (!s->records) tmp=0; @@ -6276,13 +6282,14 @@ remove_duplicates(JOIN *join, TABLE *entry,List &fields, Item *having) field_count++; } - if (!field_count) - { // only const items + if (!field_count && !(join->select_options & OPTION_FOUND_ROWS)) + { // only const items with no OPTION_FOUND_ROWS join->thd->select_limit=1; // Only send first row DBUG_RETURN(0); } Field **first_field=entry->field+entry->fields - field_count; - offset=entry->field[entry->fields - field_count]->offset(); + offset= field_count ? + entry->field[entry->fields - field_count]->offset() : 0; reclength=entry->reclength-offset; free_io_cache(entry); // Safety From fdedd0fc5b75c98d3fb8a84448e14942309445d4 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 23 Jan 2005 12:12:50 +0100 Subject: [PATCH 0815/1063] backported from 5.0 extra option to ndb_waiter --- ndb/tools/waiter.cpp | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/ndb/tools/waiter.cpp b/ndb/tools/waiter.cpp index 4b86de36514..dfdb11524e3 100644 --- a/ndb/tools/waiter.cpp +++ b/ndb/tools/waiter.cpp @@ -31,11 +31,13 @@ waitClusterStatus(const char* _addr, ndb_mgm_node_status _status, unsigned int _timeout); enum ndb_waiter_options { - NDB_STD_OPTS_OPTIONS + NDB_STD_OPTS_OPTIONS, + OPT_WAIT_STATUS_NOT_STARTED }; NDB_STD_OPTS_VARS; static int _no_contact = 0; +static int _not_started = 0; static int _timeout = 120; static struct my_option my_long_options[] = { @@ -43,6 +45,9 @@ static struct my_option my_long_options[] = { "no-contact", 'n', "Wait for cluster no contact", (gptr*) &_no_contact, (gptr*) &_no_contact, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 }, + { "not-started", OPT_WAIT_STATUS_NOT_STARTED, "Wait for cluster not started", + (gptr*) &_not_started, (gptr*) &_not_started, 0, + GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 }, { "timeout", 't', "Timeout to wait", (gptr*) &_timeout, (gptr*) &_timeout, 0, GET_INT, REQUIRED_ARG, 120, 0, 0, 0, 0, 0 }, @@ -91,12 +96,22 @@ int main(int argc, char** argv){ if (_hostName == 0) _hostName= opt_connect_str; - if (_no_contact) { - if (waitClusterStatus(_hostName, NDB_MGM_NODE_STATUS_NO_CONTACT, _timeout) != 0) - return NDBT_ProgramExit(NDBT_FAILED); - } else if (waitClusterStatus(_hostName, NDB_MGM_NODE_STATUS_STARTED, _timeout) != 0) - return NDBT_ProgramExit(NDBT_FAILED); + enum ndb_mgm_node_status wait_status; + if (_no_contact) + { + wait_status= NDB_MGM_NODE_STATUS_NO_CONTACT; + } + else if (_not_started) + { + wait_status= NDB_MGM_NODE_STATUS_NOT_STARTED; + } + else + { + wait_status= NDB_MGM_NODE_STATUS_STARTED; + } + if (waitClusterStatus(_hostName, wait_status, _timeout) != 0) + return NDBT_ProgramExit(NDBT_FAILED); return NDBT_ProgramExit(NDBT_OK); } From fd5ea70eed911d5b1bcac1d887bb10b5937664fa Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 24 Jan 2005 13:04:52 +0400 Subject: [PATCH 0816/1063] Stick FN_REFLEN to PATH_MAX. --- include/my_global.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/my_global.h b/include/my_global.h index ff59f7bfc55..5b363addef2 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -530,7 +530,11 @@ typedef SOCKET_SIZE_TYPE size_socket; #define FN_LEN 256 /* Max file name len */ #define FN_HEADLEN 253 /* Max length of filepart of file name */ #define FN_EXTLEN 20 /* Max length of extension (part of FN_LEN) */ +#ifdef PATH_MAX +#define FN_REFLEN PATH_MAX/* Max length of full path-name */ +#else #define FN_REFLEN 512 /* Max length of full path-name */ +#endif #define FN_EXTCHAR '.' #define FN_HOMELIB '~' /* ~/ is used as abbrev for home dir */ #define FN_CURLIB '.' /* ./ is used as abbrev for current dir */ From 2f196ec77177209edc308b715e6fd61b119647ce Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 24 Jan 2005 10:33:39 +0100 Subject: [PATCH 0817/1063] remmoved inline in NdbRecAttr methods including memcpy --- ndb/include/ndbapi/NdbRecAttr.hpp | 36 ------------------------------- ndb/src/ndbapi/NdbRecAttr.cpp | 32 +++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 36 deletions(-) diff --git a/ndb/include/ndbapi/NdbRecAttr.hpp b/ndb/include/ndbapi/NdbRecAttr.hpp index 29eab64a84f..05635a99385 100644 --- a/ndb/include/ndbapi/NdbRecAttr.hpp +++ b/ndb/include/ndbapi/NdbRecAttr.hpp @@ -300,15 +300,6 @@ NdbRecAttr::arraySize() const return theArraySize; } -inline -Int64 -NdbRecAttr::int64_value() const -{ - Int64 val; - memcpy(&val,theRef,8); - return val; -} - inline Int32 NdbRecAttr::int32_value() const @@ -330,15 +321,6 @@ NdbRecAttr::char_value() const return *(char*)theRef; } -inline -Uint64 -NdbRecAttr::u_64_value() const -{ - Uint64 val; - memcpy(&val,theRef,8); - return val; -} - inline Uint32 NdbRecAttr::u_32_value() const @@ -360,24 +342,6 @@ NdbRecAttr::u_char_value() const return *(Uint8*)theRef; } -inline -float -NdbRecAttr::float_value() const -{ - float val; - memcpy(&val,theRef,sizeof(val)); - return val; -} - -inline -double -NdbRecAttr::double_value() const -{ - double val; - memcpy(&val,theRef,sizeof(val)); - return val; -} - inline void NdbRecAttr::release() diff --git a/ndb/src/ndbapi/NdbRecAttr.cpp b/ndb/src/ndbapi/NdbRecAttr.cpp index bcd91292fcd..f2427fb32e8 100644 --- a/ndb/src/ndbapi/NdbRecAttr.cpp +++ b/ndb/src/ndbapi/NdbRecAttr.cpp @@ -245,3 +245,35 @@ NdbOut& operator<<(NdbOut& out, const NdbRecAttr &r) return out; } + +Int64 +NdbRecAttr::int64_value() const +{ + Int64 val; + memcpy(&val,theRef,8); + return val; +} + +Uint64 +NdbRecAttr::u_64_value() const +{ + Uint64 val; + memcpy(&val,theRef,8); + return val; +} + +float +NdbRecAttr::float_value() const +{ + float val; + memcpy(&val,theRef,sizeof(val)); + return val; +} + +double +NdbRecAttr::double_value() const +{ + double val; + memcpy(&val,theRef,sizeof(val)); + return val; +} From 343e9bbd34ecd89deb7d28214e23171894b8b2a0 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 24 Jan 2005 10:47:51 +0100 Subject: [PATCH 0818/1063] mysql-test-run.sh: backported access to ndb_mgm from 5.0 mysql-test/mysql-test-run.sh: backported access to ndb_mgm from 5.0 --- mysql-test/mysql-test-run.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index 722da516d9b..5c4fe0577a2 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -537,6 +537,7 @@ if [ x$SOURCE_DIST = x1 ] ; then INSTALL_DB="./install_test_db" MYSQL_FIX_SYSTEM_TABLES="$BASEDIR/scripts/mysql_fix_privilege_tables" NDB_TOOLS_DIR="$BASEDIR/ndb/tools" + NDB_MGM="$BASEDIR/ndb/src/mgmclient/ndb_mgm" else if test -x "$BASEDIR/libexec/mysqld" then @@ -558,6 +559,7 @@ else INSTALL_DB="./install_test_db --bin" MYSQL_FIX_SYSTEM_TABLES="$CLIENT_BINDIR/mysql_fix_privilege_tables" NDB_TOOLS_DIR="$CLIENT_BINDIR" + NDB_MGM="$CLIENT_BINDIR/ndb_mgm" if test -d "$BASEDIR/share/mysql/english" then LANGUAGE="$BASEDIR/share/mysql/english/" @@ -607,6 +609,7 @@ MYSQL="$MYSQL --host=localhost --port=$MASTER_MYPORT --socket=$MASTER_MYSOCK --u export MYSQL MYSQL_DUMP MYSQL_BINLOG MYSQL_FIX_SYSTEM_TABLES export CLIENT_BINDIR TESTS_BINDIR CHARSETSDIR export NDB_TOOLS_DIR +export NDB_MGM MYSQL_TEST_ARGS="--no-defaults --socket=$MASTER_MYSOCK --database=$DB \ --user=$DBUSER --password=$DBPASSWD --silent -v --skip-safemalloc \ From 8827dbd4eb4aaaab769b4cc456319b24a1200d70 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 24 Jan 2005 13:06:27 +0100 Subject: [PATCH 0819/1063] ndb_restore.result, mysql-test-run.sh: added ndb_restore test ndb_restore.result, ndb_restore.test: new file mysql-test/mysql-test-run.sh: added ndb_restore test mysql-test/r/ndb_restore.result: added ndb_restore test --- mysql-test/mysql-test-run.sh | 2 + mysql-test/r/ndb_restore.result | 249 ++++++++++++++++++++++++++++++++ mysql-test/t/ndb_restore.test | 209 +++++++++++++++++++++++++++ 3 files changed, 460 insertions(+) create mode 100644 mysql-test/r/ndb_restore.result create mode 100644 mysql-test/t/ndb_restore.test diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index 5c4fe0577a2..1e1e288b198 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -468,6 +468,7 @@ export MASTER_MYPORT MASTER_MYPORT1 SLAVE_MYPORT MYSQL_TCP_PORT MASTER_MYSOCK MA NDBCLUSTER_BASE_PORT=`expr $NDBCLUSTER_PORT + 2` NDBCLUSTER_OPTS="--port=$NDBCLUSTER_PORT --port-base=$NDBCLUSTER_BASE_PORT --data-dir=$MYSQL_TEST_DIR/var --ndb_mgmd-extra-opts=\"$NDB_MGMD_EXTRA_OPTS\" --ndbd-extra-opts=\"$NDBD_EXTRA_OPTS\"" +NDB_BACKUP_DIR=$MYSQL_TEST_DIR/var/ndbcluster-$NDBCLUSTER_PORT if [ x$SOURCE_DIST = x1 ] ; then MY_BASEDIR=$MYSQL_TEST_DIR @@ -610,6 +611,7 @@ export MYSQL MYSQL_DUMP MYSQL_BINLOG MYSQL_FIX_SYSTEM_TABLES export CLIENT_BINDIR TESTS_BINDIR CHARSETSDIR export NDB_TOOLS_DIR export NDB_MGM +export NDB_BACKUP_DIR MYSQL_TEST_ARGS="--no-defaults --socket=$MASTER_MYSOCK --database=$DB \ --user=$DBUSER --password=$DBPASSWD --silent -v --skip-safemalloc \ diff --git a/mysql-test/r/ndb_restore.result b/mysql-test/r/ndb_restore.result new file mode 100644 index 00000000000..7a81e8cd802 --- /dev/null +++ b/mysql-test/r/ndb_restore.result @@ -0,0 +1,249 @@ +use test; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +drop table if exists t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c; +CREATE TABLE `t1` ( +`capgoaledatta` smallint(5) unsigned NOT NULL auto_increment, +`goaledatta` char(2) NOT NULL default '', +`maturegarbagefa` varchar(32) NOT NULL default '', +PRIMARY KEY (`capgoaledatta`,`goaledatta`,`maturegarbagefa`) +) ENGINE=ndbcluster DEFAULT CHARSET=latin1; +INSERT INTO `t1` VALUES (2,'3','q3plus.qt'),(4,'4','q3plus.qt'),(1,'3','q3.net'),(3,'4','q3.net'),(3,'20','threetrees.qt'); +CREATE TABLE `t2` ( +`capgotod` smallint(5) unsigned NOT NULL auto_increment, +`gotod` smallint(5) unsigned NOT NULL default '0', +`goaledatta` char(2) default NULL, +`maturegarbagefa` varchar(32) default NULL, +`descrpooppo` varchar(64) default NULL, +`svcutonsa` varchar(64) NOT NULL default '', +PRIMARY KEY (`capgotod`), +KEY `i_quadaddsvr` (`gotod`) +) ENGINE=ndbcluster DEFAULT CHARSET=latin1; +INSERT INTO `t2` VALUES (5,4,'','q3.net','addavp:MK_CASELECTOR=1','postorod rattoaa'),(2,1,'4','','addavp:MK_BRANDTAD=345','REDS Brandtad'),(3,2,'4','q3.net','execorder','fixedRatediPO REDS'),(1,1,'3','','addavp:MK_BRANDTAD=123','TEST Brandtad'),(6,5,'','told.q3.net','addavp:MK_BRANDTAD=123','Brandtad Toldzone'),(4,3,'3','q3.net','addavp:MK_POOLHINT=2','ratedi PO TEST'); +CREATE TABLE `t3` ( +`CapGoaledatta` smallint(5) unsigned NOT NULL default '0', +`capgotod` smallint(5) unsigned NOT NULL default '0', +PRIMARY KEY (`capgotod`,`CapGoaledatta`) +) ENGINE=ndbcluster DEFAULT CHARSET=latin1; +INSERT INTO `t3` VALUES (5,3),(2,4),(5,4),(1,3); +CREATE TABLE `t4` ( +`capfa` bigint(20) unsigned NOT NULL auto_increment, +`realm` varchar(32) NOT NULL default '', +`authpwchap` varchar(32) default NULL, +`fa` varchar(32) NOT NULL default '', +`payyingatta` tinyint(4) NOT NULL default '0', +`status` char(1) default NULL, +PRIMARY KEY (`fa`,`realm`), +KEY `capfa` (`capfa`), +KEY `i_quadentity` (`fa`,`realm`) +) ENGINE=ndbcluster DEFAULT CHARSET=latin1; +INSERT INTO `t4` VALUES (18,'john.smith','q3.net','dessjohn.smith',0,NULL),(21,'quad_katt_with_brandtad','q3.net','acne',0,NULL),(22,'quad_katt_carattoaa','q3.net','acne',0,NULL),(26,'436462612809','sqasdt.q3.net','N/A',0,'6'),(19,'john','smith.qt','dessjohn',0,NULL),(33,'436643196120','sqasdt.q3.net','N/A',1,'6'),(28,'436642900019','sqasdt.q3.net','N/A',0,'6'),(30,'436462900209','sqasdt.q3.net','N/A',0,'6'),(16,'436640006666','sqasdt.q3.net','',0,NULL),(19,'dette','el-redun.com','dessdette',0,NULL),(12,'quad_kattPP','q3.net','acne',2,NULL),(14,'436640008888','sqasdt.q3.net','',0,NULL),(29,'463624900028','sqasdt.q3.net','N/A',0,'6'),(15,'436640099099','sqasdt.q3.net','',0,NULL),(13,'pap','q3plus.qt','acne',1,NULL),(19,'436642612091','sqasdt.q3.net','N/A',0,'6'),(12,'quad_katt','q3.net','acne',0,NULL),(11,'quad_kattVK','q3.net','acne',1,NULL),(32,'463641969502','sqasdt.q3.net','N/A',1,'6'),(20,'joe','q3.net','joedesswd',0,NULL),(29,'436642900034','sqasdt.q3.net','N/A',0,'6'),(25,'contind','armerde.qt','acne',1,NULL); +CREATE TABLE `t5` ( +`capfa` bigint(20) unsigned NOT NULL default '0', +`gotod` smallint(5) unsigned NOT NULL default '0', +`orderutonsa` varchar(64) NOT NULL default '', +PRIMARY KEY (`capfa`,`gotod`,`orderutonsa`) +) ENGINE=ndbcluster DEFAULT CHARSET=latin1; +INSERT INTO `t5` VALUES (21,2,''),(21,1,''),(22,4,''); +CREATE TABLE `t6` ( +`capfa_parent` bigint(20) unsigned NOT NULL default '0', +`capfa_child` bigint(20) unsigned NOT NULL default '0', +`relatta` smallint(5) unsigned NOT NULL default '0', +PRIMARY KEY (`capfa_child`,`capfa_parent`,`relatta`) +) ENGINE=ndbcluster DEFAULT CHARSET=latin1; +INSERT INTO `t6` VALUES (15,16,0),(19,20,0),(18326932092909551615,30,0),(26,29,0),(18326932092909551615,29,0),(19,18,0),(26,28,0),(12,14,0); +CREATE TABLE `t7` ( +`dardpo` char(15) NOT NULL default '', +`dardtestard` tinyint(3) unsigned NOT NULL default '0', +`FastFA` char(5) NOT NULL default '', +`FastCode` char(6) NOT NULL default '', +`Fastca` char(1) NOT NULL default '', +`Fastmag` char(1) NOT NULL default '', +`Beareratta` char(2) NOT NULL default '', +PRIMARY KEY (`dardpo`,`dardtestard`) +) ENGINE=ndbcluster DEFAULT CHARSET=latin1; +INSERT INTO `t7` VALUES ('2.6.2.4',24,'CECHP','54545','0','0','5'),('2.2.5.4',26,'CANFA','33223','1','1','4'),('4.3.2.4',28,'ITALD','54222','1','0','5'),('129..0.0.eins',28,'G','99999','1','1','5'),('1.1.1.1',24,'AUTPT','32323','0','1','3'); +CREATE TABLE `t8` ( +`kattjame` varchar(32) NOT NULL default '', +`realm` varchar(32) NOT NULL default '', +`realm_entered` varchar(32) NOT NULL default '', +`maturegarbagefa` varchar(32) NOT NULL default '', +`hunderaaarbagefa_parent` varchar(32) NOT NULL default '', +`kattjame_entered` varchar(32) NOT NULL default '', +`hunderaaarbagefa` varchar(32) NOT NULL default '', +`gest` varchar(16) default NULL, +`hassetino` varchar(16) NOT NULL default '', +`aaaproxysessfa` varchar(255) default NULL, +`autologonallowed` char(1) default NULL, +`squardporoot` varchar(15) NOT NULL default '', +`naspo` varchar(15) default NULL, +`beareratta` char(2) default NULL, +`fastCode` varchar(6) default NULL, +`fastFA` varchar(5) default NULL, +`fastca` char(1) default NULL, +`fastmag` char(1) default NULL, +`lastupdate` datetime default NULL, +`hassetistart` datetime NOT NULL default '0000-00-00 00:00:00', +`accthassetitime` int(10) unsigned default NULL, +`acctoutputoctets` bigint(20) unsigned default NULL, +`acctinputoctets` bigint(20) unsigned default NULL, +PRIMARY KEY (`kattjame`,`hunderaaarbagefa`,`hassetistart`,`hassetino`), +KEY `squardporoot` (`squardporoot`) +) ENGINE=ndbcluster DEFAULT CHARSET=latin1; +INSERT INTO `t8` VALUES ('4tt45345235','pap','q3plus.qt','q3plus.qt','q3.net','436643196120','436643196929','8956234534568968','5524595699','uxasmt21.net.acne.qt/481889229462692422','','1.1.1.1','2.2.4.6','4','86989','34','x','x','2012-03-12 12:55:34','2012-12-05 11:20:04',3223433,3369,9565),('4545435545','john','q3.net','q3.net','acne.li','436643196120','436643196929','45345234568968','995696699','uxasmt21.net.acne.qt/481889229462692423','','1.1.1.1','2.2.9.8','2','86989','34','x','x','2012-03-12 11:35:03','2012-12-05 08:50:04',8821923,169,3565),('versteckter_q3net_katt','joe','q3.net','elredun.com','q3.net','436643196120','436643196939','91341234568968','695595699','uxasmt21.net.acne.qt/481889229462692421','','1.1.1.1','2.5.2.5','3','86989','34','x','x','2012-03-12 18:35:04','2012-12-05 12:35:04',1923123,9569,6565); +CREATE TABLE `t9` ( +`kattjame` varchar(32) NOT NULL default '', +`kattjame_entered` varchar(32) NOT NULL default '', +`realm` varchar(32) NOT NULL default '', +`realm_entered` varchar(32) NOT NULL default '', +`maturegarbagefa` varchar(32) NOT NULL default '', +`hunderaaarbagefa` varchar(32) NOT NULL default '', +`hunderaaarbagefa_parent` varchar(32) NOT NULL default '', +`gest` varchar(16) default NULL, +`hassetino` varchar(16) NOT NULL default '', +`squardporoot` varchar(15) NOT NULL default '', +`naspo` varchar(15) default NULL, +`beareratta` char(2) default NULL, +`fastCode` varchar(6) default NULL, +`fastFA` varchar(5) default NULL, +`fastca` char(1) default NULL, +`fastmag` char(1) default NULL, +`lastupdate` datetime default NULL, +`hassetistart` datetime NOT NULL default '0000-00-00 00:00:00', +`accthassetitime` int(10) unsigned default NULL, +`actcoutpuocttets` bigint(20) unsigned default NULL, +`actinputocctets` bigint(20) unsigned default NULL, +`terminateraste` tinyint(3) unsigned default NULL, +PRIMARY KEY (`kattjame`,`hunderaaarbagefa`,`hassetistart`,`hassetino`) +) ENGINE=ndbcluster DEFAULT CHARSET=latin1; +INSERT INTO `t9` VALUES ('3g4jh8gar2t','joe','q3.net','elredun.com','q3.net','436643316120','436643316939','91341234568968','695595699','1.1.1.1','2.2.6.2','3','86989','34','x','x','2012-03-12 18:35:04','2012-12-05 12:35:04',3123123,9569,6565,1),('4tt45345235','pap','q3plus.qt','q3plus.qt','q3.net','436643316120','436643316939','8956234534568968','5254595969','1.1.1.1','8.6.2.2','4','86989','34','x','x','2012-03-12 12:55:34','2012-12-05 11:20:04',3223433,3369,9565,2),('4545435545','john','q3.net','q3.net','acne.li','436643316120','436643316939','45345234568968','995696699','1.1.1.1','2.9.9.2','2','86998','34','x','x','2012-03-12 11:35:03','2012-12-05 08:50:04',8823123,169,3565,3); +create table t1_c engine=myisam as select * from t1; +create table t2_c engine=myisam as select * from t2; +create table t3_c engine=myisam as select * from t3; +create table t4_c engine=myisam as select * from t4; +create table t5_c engine=myisam as select * from t5; +create table t6_c engine=myisam as select * from t6; +create table t7_c engine=myisam as select * from t7; +create table t8_c engine=myisam as select * from t8; +create table t9_c engine=myisam as select * from t9; +drop table t1,t2,t3,t4,t5,t6,t7,t8,t9; +show tables; +Tables_in_test +t1_c +t2_c +t3_c +t4_c +t5_c +t6_c +t7_c +t8_c +t9_c +t9 +t4 +t1 +t2 +t7 +t8 +t5 +t6 +t3 +select count(*) from t1; +count(*) +5 +select count(*) from t1_c; +count(*) +5 +select count(*) +from (select * from t1 union +select * from t1_c) a; +count(*) +5 +select count(*) from t2; +count(*) +6 +select count(*) from t2_c; +count(*) +6 +select count(*) +from (select * from t2 union +select * from t2_c) a; +count(*) +6 +select count(*) from t3; +count(*) +4 +select count(*) from t3_c; +count(*) +4 +select count(*) +from (select * from t3 union +select * from t3_c) a; +count(*) +4 +select count(*) from t4; +count(*) +22 +select count(*) from t4_c; +count(*) +22 +select count(*) +from (select * from t4 union +select * from t4_c) a; +count(*) +22 +select count(*) from t5; +count(*) +3 +select count(*) from t5_c; +count(*) +3 +select count(*) +from (select * from t5 union +select * from t5_c) a; +count(*) +3 +select count(*) from t6; +count(*) +8 +select count(*) from t6_c; +count(*) +8 +select count(*) +from (select * from t6 union +select * from t6_c) a; +count(*) +8 +select count(*) from t7; +count(*) +5 +select count(*) from t7_c; +count(*) +5 +select count(*) +from (select * from t7 union +select * from t7_c) a; +count(*) +5 +select count(*) from t8; +count(*) +3 +select count(*) from t8_c; +count(*) +3 +select count(*) +from (select * from t8 union +select * from t8_c) a; +count(*) +3 +select count(*) from t9; +count(*) +3 +select count(*) from t9_c; +count(*) +3 +select count(*) +from (select * from t9 union +select * from t9_c) a; +count(*) +3 +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +drop table if exists t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c; diff --git a/mysql-test/t/ndb_restore.test b/mysql-test/t/ndb_restore.test new file mode 100644 index 00000000000..79a4f8a06d3 --- /dev/null +++ b/mysql-test/t/ndb_restore.test @@ -0,0 +1,209 @@ +-- source include/have_ndb.inc + +--disable_warnings +use test; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +drop table if exists t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c; +--enable_warnings + +CREATE TABLE `t1` ( + `capgoaledatta` smallint(5) unsigned NOT NULL auto_increment, + `goaledatta` char(2) NOT NULL default '', + `maturegarbagefa` varchar(32) NOT NULL default '', + PRIMARY KEY (`capgoaledatta`,`goaledatta`,`maturegarbagefa`) +) ENGINE=ndbcluster DEFAULT CHARSET=latin1; +INSERT INTO `t1` VALUES (2,'3','q3plus.qt'),(4,'4','q3plus.qt'),(1,'3','q3.net'),(3,'4','q3.net'),(3,'20','threetrees.qt'); + +CREATE TABLE `t2` ( + `capgotod` smallint(5) unsigned NOT NULL auto_increment, + `gotod` smallint(5) unsigned NOT NULL default '0', + `goaledatta` char(2) default NULL, + `maturegarbagefa` varchar(32) default NULL, + `descrpooppo` varchar(64) default NULL, + `svcutonsa` varchar(64) NOT NULL default '', + PRIMARY KEY (`capgotod`), + KEY `i_quadaddsvr` (`gotod`) +) ENGINE=ndbcluster DEFAULT CHARSET=latin1; +INSERT INTO `t2` VALUES (5,4,'','q3.net','addavp:MK_CASELECTOR=1','postorod rattoaa'),(2,1,'4','','addavp:MK_BRANDTAD=345','REDS Brandtad'),(3,2,'4','q3.net','execorder','fixedRatediPO REDS'),(1,1,'3','','addavp:MK_BRANDTAD=123','TEST Brandtad'),(6,5,'','told.q3.net','addavp:MK_BRANDTAD=123','Brandtad Toldzone'),(4,3,'3','q3.net','addavp:MK_POOLHINT=2','ratedi PO TEST'); + +CREATE TABLE `t3` ( + `CapGoaledatta` smallint(5) unsigned NOT NULL default '0', + `capgotod` smallint(5) unsigned NOT NULL default '0', + PRIMARY KEY (`capgotod`,`CapGoaledatta`) +) ENGINE=ndbcluster DEFAULT CHARSET=latin1; +INSERT INTO `t3` VALUES (5,3),(2,4),(5,4),(1,3); + +CREATE TABLE `t4` ( + `capfa` bigint(20) unsigned NOT NULL auto_increment, + `realm` varchar(32) NOT NULL default '', + `authpwchap` varchar(32) default NULL, + `fa` varchar(32) NOT NULL default '', + `payyingatta` tinyint(4) NOT NULL default '0', + `status` char(1) default NULL, + PRIMARY KEY (`fa`,`realm`), + KEY `capfa` (`capfa`), + KEY `i_quadentity` (`fa`,`realm`) +) ENGINE=ndbcluster DEFAULT CHARSET=latin1; +INSERT INTO `t4` VALUES (18,'john.smith','q3.net','dessjohn.smith',0,NULL),(21,'quad_katt_with_brandtad','q3.net','acne',0,NULL),(22,'quad_katt_carattoaa','q3.net','acne',0,NULL),(26,'436462612809','sqasdt.q3.net','N/A',0,'6'),(19,'john','smith.qt','dessjohn',0,NULL),(33,'436643196120','sqasdt.q3.net','N/A',1,'6'),(28,'436642900019','sqasdt.q3.net','N/A',0,'6'),(30,'436462900209','sqasdt.q3.net','N/A',0,'6'),(16,'436640006666','sqasdt.q3.net','',0,NULL),(19,'dette','el-redun.com','dessdette',0,NULL),(12,'quad_kattPP','q3.net','acne',2,NULL),(14,'436640008888','sqasdt.q3.net','',0,NULL),(29,'463624900028','sqasdt.q3.net','N/A',0,'6'),(15,'436640099099','sqasdt.q3.net','',0,NULL),(13,'pap','q3plus.qt','acne',1,NULL),(19,'436642612091','sqasdt.q3.net','N/A',0,'6'),(12,'quad_katt','q3.net','acne',0,NULL),(11,'quad_kattVK','q3.net','acne',1,NULL),(32,'463641969502','sqasdt.q3.net','N/A',1,'6'),(20,'joe','q3.net','joedesswd',0,NULL),(29,'436642900034','sqasdt.q3.net','N/A',0,'6'),(25,'contind','armerde.qt','acne',1,NULL); + +CREATE TABLE `t5` ( + `capfa` bigint(20) unsigned NOT NULL default '0', + `gotod` smallint(5) unsigned NOT NULL default '0', + `orderutonsa` varchar(64) NOT NULL default '', + PRIMARY KEY (`capfa`,`gotod`,`orderutonsa`) +) ENGINE=ndbcluster DEFAULT CHARSET=latin1; +INSERT INTO `t5` VALUES (21,2,''),(21,1,''),(22,4,''); + +CREATE TABLE `t6` ( + `capfa_parent` bigint(20) unsigned NOT NULL default '0', + `capfa_child` bigint(20) unsigned NOT NULL default '0', + `relatta` smallint(5) unsigned NOT NULL default '0', + PRIMARY KEY (`capfa_child`,`capfa_parent`,`relatta`) +) ENGINE=ndbcluster DEFAULT CHARSET=latin1; +INSERT INTO `t6` VALUES (15,16,0),(19,20,0),(18326932092909551615,30,0),(26,29,0),(18326932092909551615,29,0),(19,18,0),(26,28,0),(12,14,0); + +CREATE TABLE `t7` ( + `dardpo` char(15) NOT NULL default '', + `dardtestard` tinyint(3) unsigned NOT NULL default '0', + `FastFA` char(5) NOT NULL default '', + `FastCode` char(6) NOT NULL default '', + `Fastca` char(1) NOT NULL default '', + `Fastmag` char(1) NOT NULL default '', + `Beareratta` char(2) NOT NULL default '', + PRIMARY KEY (`dardpo`,`dardtestard`) +) ENGINE=ndbcluster DEFAULT CHARSET=latin1; +INSERT INTO `t7` VALUES ('2.6.2.4',24,'CECHP','54545','0','0','5'),('2.2.5.4',26,'CANFA','33223','1','1','4'),('4.3.2.4',28,'ITALD','54222','1','0','5'),('129..0.0.eins',28,'G','99999','1','1','5'),('1.1.1.1',24,'AUTPT','32323','0','1','3'); + +CREATE TABLE `t8` ( + `kattjame` varchar(32) NOT NULL default '', + `realm` varchar(32) NOT NULL default '', + `realm_entered` varchar(32) NOT NULL default '', + `maturegarbagefa` varchar(32) NOT NULL default '', + `hunderaaarbagefa_parent` varchar(32) NOT NULL default '', + `kattjame_entered` varchar(32) NOT NULL default '', + `hunderaaarbagefa` varchar(32) NOT NULL default '', + `gest` varchar(16) default NULL, + `hassetino` varchar(16) NOT NULL default '', + `aaaproxysessfa` varchar(255) default NULL, + `autologonallowed` char(1) default NULL, + `squardporoot` varchar(15) NOT NULL default '', + `naspo` varchar(15) default NULL, + `beareratta` char(2) default NULL, + `fastCode` varchar(6) default NULL, + `fastFA` varchar(5) default NULL, + `fastca` char(1) default NULL, + `fastmag` char(1) default NULL, + `lastupdate` datetime default NULL, + `hassetistart` datetime NOT NULL default '0000-00-00 00:00:00', + `accthassetitime` int(10) unsigned default NULL, + `acctoutputoctets` bigint(20) unsigned default NULL, + `acctinputoctets` bigint(20) unsigned default NULL, + PRIMARY KEY (`kattjame`,`hunderaaarbagefa`,`hassetistart`,`hassetino`), + KEY `squardporoot` (`squardporoot`) +) ENGINE=ndbcluster DEFAULT CHARSET=latin1; +INSERT INTO `t8` VALUES ('4tt45345235','pap','q3plus.qt','q3plus.qt','q3.net','436643196120','436643196929','8956234534568968','5524595699','uxasmt21.net.acne.qt/481889229462692422','','1.1.1.1','2.2.4.6','4','86989','34','x','x','2012-03-12 12:55:34','2012-12-05 11:20:04',3223433,3369,9565),('4545435545','john','q3.net','q3.net','acne.li','436643196120','436643196929','45345234568968','995696699','uxasmt21.net.acne.qt/481889229462692423','','1.1.1.1','2.2.9.8','2','86989','34','x','x','2012-03-12 11:35:03','2012-12-05 08:50:04',8821923,169,3565),('versteckter_q3net_katt','joe','q3.net','elredun.com','q3.net','436643196120','436643196939','91341234568968','695595699','uxasmt21.net.acne.qt/481889229462692421','','1.1.1.1','2.5.2.5','3','86989','34','x','x','2012-03-12 18:35:04','2012-12-05 12:35:04',1923123,9569,6565); + +CREATE TABLE `t9` ( + `kattjame` varchar(32) NOT NULL default '', + `kattjame_entered` varchar(32) NOT NULL default '', + `realm` varchar(32) NOT NULL default '', + `realm_entered` varchar(32) NOT NULL default '', + `maturegarbagefa` varchar(32) NOT NULL default '', + `hunderaaarbagefa` varchar(32) NOT NULL default '', + `hunderaaarbagefa_parent` varchar(32) NOT NULL default '', + `gest` varchar(16) default NULL, + `hassetino` varchar(16) NOT NULL default '', + `squardporoot` varchar(15) NOT NULL default '', + `naspo` varchar(15) default NULL, + `beareratta` char(2) default NULL, + `fastCode` varchar(6) default NULL, + `fastFA` varchar(5) default NULL, + `fastca` char(1) default NULL, + `fastmag` char(1) default NULL, + `lastupdate` datetime default NULL, + `hassetistart` datetime NOT NULL default '0000-00-00 00:00:00', + `accthassetitime` int(10) unsigned default NULL, + `actcoutpuocttets` bigint(20) unsigned default NULL, + `actinputocctets` bigint(20) unsigned default NULL, + `terminateraste` tinyint(3) unsigned default NULL, + PRIMARY KEY (`kattjame`,`hunderaaarbagefa`,`hassetistart`,`hassetino`) +) ENGINE=ndbcluster DEFAULT CHARSET=latin1; +INSERT INTO `t9` VALUES ('3g4jh8gar2t','joe','q3.net','elredun.com','q3.net','436643316120','436643316939','91341234568968','695595699','1.1.1.1','2.2.6.2','3','86989','34','x','x','2012-03-12 18:35:04','2012-12-05 12:35:04',3123123,9569,6565,1),('4tt45345235','pap','q3plus.qt','q3plus.qt','q3.net','436643316120','436643316939','8956234534568968','5254595969','1.1.1.1','8.6.2.2','4','86989','34','x','x','2012-03-12 12:55:34','2012-12-05 11:20:04',3223433,3369,9565,2),('4545435545','john','q3.net','q3.net','acne.li','436643316120','436643316939','45345234568968','995696699','1.1.1.1','2.9.9.2','2','86998','34','x','x','2012-03-12 11:35:03','2012-12-05 08:50:04',8823123,169,3565,3); + +create table t1_c engine=myisam as select * from t1; +create table t2_c engine=myisam as select * from t2; +create table t3_c engine=myisam as select * from t3; +create table t4_c engine=myisam as select * from t4; +create table t5_c engine=myisam as select * from t5; +create table t6_c engine=myisam as select * from t6; +create table t7_c engine=myisam as select * from t7; +create table t8_c engine=myisam as select * from t8; +create table t9_c engine=myisam as select * from t9; + + +--exec $NDB_MGM --no-defaults -e "start backup" > /dev/null +drop table t1,t2,t3,t4,t5,t6,t7,t8,t9; +--exec $NDB_TOOLS_DIR/ndb_restore --no-defaults -b 1 -n 1 -m -r --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-1 > /tmp/ndb_restore.out +--exec $NDB_TOOLS_DIR/ndb_restore --no-defaults -b 1 -n 2 -r --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-1 > /tmp/ndb_restore.out + +show tables; + + +select count(*) from t1; +select count(*) from t1_c; +select count(*) + from (select * from t1 union + select * from t1_c) a; + +select count(*) from t2; +select count(*) from t2_c; +select count(*) + from (select * from t2 union + select * from t2_c) a; + +select count(*) from t3; +select count(*) from t3_c; +select count(*) + from (select * from t3 union + select * from t3_c) a; + +select count(*) from t4; +select count(*) from t4_c; +select count(*) + from (select * from t4 union + select * from t4_c) a; + +select count(*) from t5; +select count(*) from t5_c; +select count(*) + from (select * from t5 union + select * from t5_c) a; + +select count(*) from t6; +select count(*) from t6_c; +select count(*) + from (select * from t6 union + select * from t6_c) a; + +select count(*) from t7; +select count(*) from t7_c; +select count(*) + from (select * from t7 union + select * from t7_c) a; + +select count(*) from t8; +select count(*) from t8_c; +select count(*) + from (select * from t8 union + select * from t8_c) a; + +select count(*) from t9; +select count(*) from t9_c; +select count(*) + from (select * from t9 union + select * from t9_c) a; + +--disable_warnings +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +drop table if exists t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c; +--enable_warnings From d514a06a86d689065590b0115799f06fa109a70b Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 24 Jan 2005 14:25:44 +0200 Subject: [PATCH 0820/1063] fixed column number fetchinmg for subqueries. (BUG#8020) fixed cols() method call (it have to be called only after fix_fields()) mysql-test/r/subselect.result: Comparison subquery with * and row mysql-test/t/subselect.test: Comparison subquery with * and row sql/item_cmpfunc.h: initialization allowed_arg_cols for autodetection sql/item_func.cc: support of allowed_arg_cols autodetection by first argument sql/item_func.h: commant sql/item_subselect.cc: correct column number fetching for subqueries sql/sql_lex.h: method to check that UNION is prepared --- mysql-test/r/subselect.result | 14 ++++++++++++++ mysql-test/t/subselect.test | 14 ++++++++++++++ sql/item_cmpfunc.h | 9 ++++++--- sql/item_func.cc | 18 ++++++++++++++++-- sql/item_func.h | 4 ++++ sql/item_subselect.cc | 6 ++++-- sql/sql_lex.h | 1 + 7 files changed, 59 insertions(+), 7 deletions(-) diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index 02662f9900a..a7186c6953b 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -2160,3 +2160,17 @@ ERROR 42S22: Unknown column 'a2' in 'scalar IN/ALL/ANY subquery' select * from t1 where a1 > any(select b1 from t2); a1 drop table t1,t2; +create table t1 (a integer, b integer); +select (select * from t1) = (select 1,2); +(select * from t1) = (select 1,2) +NULL +select (select 1,2) = (select * from t1); +(select 1,2) = (select * from t1) +NULL +select row(1,2) = ANY (select * from t1); +row(1,2) = ANY (select * from t1) +0 +select row(1,2) != ALL (select * from t1); +row(1,2) != ALL (select * from t1) +1 +drop table t1; diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test index 3ee498ee380..c8b44252139 100644 --- a/mysql-test/t/subselect.test +++ b/mysql-test/t/subselect.test @@ -1414,8 +1414,11 @@ SELECT f1 FROM t1 WHERE f1 <> ALL ( SELECT SUM(f1) AS sf1 FROM t2 HAVING sf1 > 10000); drop table t1,t2; + +# # Test for BUG#7885: Server crash when 'any' subselect compared to # non-existant field. +# create table t1 (a1 int); create table t2 (b1 int); --error 1054 @@ -1423,3 +1426,14 @@ select * from t1 where a2 > any(select b1 from t2); select * from t1 where a1 > any(select b1 from t2); drop table t1,t2; + +# +# Comparison subquery with * and row +# +create table t1 (a integer, b integer); +select (select * from t1) = (select 1,2); +select (select 1,2) = (select * from t1); +# queries whih can be converted to IN +select row(1,2) = ANY (select * from t1); +select row(1,2) != ALL (select * from t1); +drop table t1; diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h index 6834799688d..061ed468b78 100644 --- a/sql/item_cmpfunc.h +++ b/sql/item_cmpfunc.h @@ -213,7 +213,7 @@ class Item_bool_rowready_func2 :public Item_bool_func2 public: Item_bool_rowready_func2(Item *a, Item *b) :Item_bool_func2(a, b) { - allowed_arg_cols= a->cols(); + allowed_arg_cols= 0; // Fetch this value from first argument } Item *neg_transformer(THD *thd); virtual Item *negated_item(); @@ -390,7 +390,10 @@ class Item_func_interval :public Item_int_func double *intervals; public: Item_func_interval(Item_row *a) - :Item_int_func(a),row(a),intervals(0) { allowed_arg_cols= a->cols(); } + :Item_int_func(a),row(a),intervals(0) + { + allowed_arg_cols= 0; // Fetch this value from first argument + } longlong val_int(); void fix_length_and_dec(); const char *func_name() const { return "interval"; } @@ -743,7 +746,7 @@ class Item_func_in :public Item_int_func Item_func_in(List &list) :Item_int_func(list), array(0), in_item(0), have_null(0) { - allowed_arg_cols= args[0]->cols(); + allowed_arg_cols= 0; // Fetch this value from first argument } longlong val_int(); void fix_length_and_dec(); diff --git a/sql/item_func.cc b/sql/item_func.cc index 7125f4704b8..bff49541252 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -303,10 +303,24 @@ Item_func::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref) We can't yet set item to *arg as fix_fields may change *arg We shouldn't call fix_fields() twice, so check 'fixed' field first */ - if ((!(*arg)->fixed && (*arg)->fix_fields(thd, tables, arg)) || - (*arg)->check_cols(allowed_arg_cols)) + if ((!(*arg)->fixed && (*arg)->fix_fields(thd, tables, arg))) return 1; /* purecov: inspected */ + item= *arg; + + if (allowed_arg_cols) + { + if (item->check_cols(allowed_arg_cols)) + return 1; + } + else + { + /* we have to fetch allowed_arg_cols from first argument */ + DBUG_ASSERT(arg == args); // it is first argument + allowed_arg_cols= item->cols(); + DBUG_ASSERT(allowed_arg_cols); // Can't be 0 any more + } + if (item->maybe_null) maybe_null=1; diff --git a/sql/item_func.h b/sql/item_func.h index ce2b34499d6..8a5347d675e 100644 --- a/sql/item_func.h +++ b/sql/item_func.h @@ -32,6 +32,10 @@ class Item_func :public Item_result_field { protected: Item **args, *tmp_arg[2]; + /* + Allowed numbers of columns in result (usually 1, which means scalar value) + 0 means get this number from first argument + */ uint allowed_arg_cols; public: uint arg_count; diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index 8516ea76a7e..2597427253c 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -1421,13 +1421,15 @@ int subselect_indexsubquery_engine::exec() uint subselect_single_select_engine::cols() { - return select_lex->item_list.elements; + DBUG_ASSERT(select_lex->join); // should be called after fix_fields() + return select_lex->join->fields_list.elements; } uint subselect_union_engine::cols() { - return unit->first_select()->item_list.elements; + DBUG_ASSERT(unit->is_prepared()); // should be called after fix_fields() + return unit->types.elements; } diff --git a/sql/sql_lex.h b/sql/sql_lex.h index e2e0bc61c23..7cb71607edf 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -371,6 +371,7 @@ public: ulong init_prepare_fake_select_lex(THD *thd); int change_result(select_subselect *result, select_subselect *old_result); + inline bool is_prepared() { return prepared; } friend void lex_start(THD *thd, uchar *buf, uint length); friend int subselect_union_engine::exec(); From 9182786918011c6d77beee27c5deec2569f4b6c7 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 24 Jan 2005 15:56:57 +0200 Subject: [PATCH 0821/1063] check that row elements have the same dimention that SELECT list elements in comporison between rows and subqueries added (BUG#8022) mysql-test/r/subselect.result: Comparison subquery and row with nested rows mysql-test/t/subselect.test: Comparison subquery and row with nested rows sql/item_subselect.cc: check that row elements have the same dimention that SELECT list elements --- mysql-test/r/subselect.result | 8 ++++++++ mysql-test/t/subselect.test | 12 ++++++++++++ sql/item_subselect.cc | 4 ++++ 3 files changed, 24 insertions(+) diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index a7186c6953b..4a4cbcc38cd 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -2174,3 +2174,11 @@ select row(1,2) != ALL (select * from t1); row(1,2) != ALL (select * from t1) 1 drop table t1; +create table t1 (a integer, b integer); +select row(1,(2,2)) in (select * from t1 ); +ERROR 21000: Operand should contain 2 column(s) +select row(1,(2,2)) = (select * from t1 ); +ERROR 21000: Operand should contain 2 column(s) +select (select * from t1) = row(1,(2,2)); +ERROR 21000: Operand should contain 1 column(s) +drop table t1; diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test index c8b44252139..d8e58facaad 100644 --- a/mysql-test/t/subselect.test +++ b/mysql-test/t/subselect.test @@ -1437,3 +1437,15 @@ select (select 1,2) = (select * from t1); select row(1,2) = ANY (select * from t1); select row(1,2) != ALL (select * from t1); drop table t1; + +# +# Comparison subquery and row with nested rows +# +create table t1 (a integer, b integer); +-- error 1241 +select row(1,(2,2)) in (select * from t1 ); +-- error 1241 +select row(1,(2,2)) = (select * from t1 ); +-- error 1241 +select (select * from t1) = row(1,(2,2)); +drop table t1; diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index 2597427253c..659d67eaf37 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -995,6 +995,10 @@ Item_in_subselect::row_value_transformer(JOIN *join) List_iterator_fast li(select_lex->item_list); for (uint i= 0; i < n; i++) { + DBUG_ASSERT(left_expr->fixed && select_lex->ref_pointer_array[i]->fixed); + if (select_lex->ref_pointer_array[i]-> + check_cols(left_expr->el(i)->cols())) + goto err; Item *func= new Item_ref_null_helper(this, select_lex->ref_pointer_array+i, (char *) "", From 8bdb500105f97e3007e652f73d99c373d38f2aad Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 24 Jan 2005 15:48:25 +0100 Subject: [PATCH 0822/1063] fixes/cleanups according to Coverity report --- client/mysql.cc | 13 +++------- client/mysqlbinlog.cc | 6 +---- client/mysqldump.c | 5 ++-- client/mysqltest.c | 5 ++-- isam/sort.c | 3 +++ myisam/mi_packrec.c | 7 ----- myisam/rt_index.c | 7 +++-- myisam/sort.c | 3 +++ mysys/mf_keycache.c | 1 + mysys/thr_alarm.c | 2 +- sql/item.cc | 24 +++++------------- sql/item_create.cc | 13 ++++------ sql/item_strfunc.cc | 3 +++ sql/item_timefunc.cc | 23 ++++++++++------- sql/set_var.cc | 4 +-- sql/slave.cc | 11 ++++---- sql/sql_acl.cc | 14 ++++++---- sql/sql_acl.h | 2 +- sql/sql_analyse.cc | 59 +++++++++++++++++++++++-------------------- sql/sql_base.cc | 18 ++++++------- sql/sql_cache.cc | 10 ++++---- sql/sql_db.cc | 22 ++++++++-------- sql/sql_lex.cc | 3 --- sql/sql_parse.cc | 29 ++++++++++----------- sql/sql_table.cc | 4 +-- sql/sql_update.cc | 9 +++---- sql/table.cc | 10 +++++--- sql/tztime.cc | 2 +- tests/client_test.c | 6 +++++ 29 files changed, 156 insertions(+), 162 deletions(-) diff --git a/client/mysql.cc b/client/mysql.cc index 480a0deb347..635973e946c 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -1430,12 +1430,6 @@ static void build_completion_hash(bool rehash, bool write_info) if (status.batch || quick || !current_db) DBUG_VOID_RETURN; // We don't need completion in batches - if (tables) - { - mysql_free_result(tables); - tables=0; - } - /* hash SQL commands */ while (cmd->name) { add_word(&ht,(char*) cmd->name); @@ -1681,8 +1675,8 @@ static int com_server_help(String *buffer __attribute__((unused)), else if (num_fields >= 2 && num_rows) { init_pager(); - char last_char; - + char last_char= 0; + int num_name= 0, num_cat= 0; LINT_INIT(num_name); LINT_INIT(num_cat); @@ -1693,7 +1687,6 @@ static int com_server_help(String *buffer __attribute__((unused)), put_info("To make a more specific request, please type 'help ',\nwhere is one of the following", INFO_INFO); num_name= 0; num_cat= 1; - last_char= '_'; } else if ((cur= mysql_fetch_row(result))) { @@ -1703,7 +1696,7 @@ static int com_server_help(String *buffer __attribute__((unused)), num_cat= 2; print_help_item(&cur,1,2,&last_char); } - + while ((cur= mysql_fetch_row(result))) print_help_item(&cur,num_name,num_cat,&last_char); tee_fprintf(PAGER, "\n"); diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index de53831c43d..7ddb01d9ec8 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -717,11 +717,7 @@ static int check_master_version(MYSQL* mysql) if (mysql_query(mysql, "SELECT VERSION()") || !(res = mysql_store_result(mysql))) - { - mysql_close(mysql); - die("Error checking master version: %s", - mysql_error(mysql)); - } + die("Error checking master version: %s", mysql_error(mysql)); if (!(row = mysql_fetch_row(res))) { mysql_free_result(res); diff --git a/client/mysqldump.c b/client/mysqldump.c index 7280bea43f3..00f5272e3d7 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -2328,14 +2328,13 @@ static const char *check_if_ignore_table(const char *table_name) fprintf(stderr, "Error: Couldn't read status information for table %s (%s)\n", table_name, mysql_error(sock)); - if (res) - mysql_free_result(res); + mysql_free_result(res); return 0; /* assume table is ok */ } if (strcmp(row[1], (result= "MRG_MyISAM")) && strcmp(row[1], (result= "MRG_ISAM"))) result= 0; - mysql_free_result(res); + mysql_free_result(res); return result; } diff --git a/client/mysqltest.c b/client/mysqltest.c index abacd73d878..d81e199ab1f 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -715,9 +715,10 @@ VAR* var_get(const char* var_name, const char** var_name_end, my_bool raw, die("Empty variable"); } length= (uint) (var_name - save_var_name); + if (length >= MAX_VAR_NAME) + die("Too long variable name: %s", save_var_name); - if (!(v = (VAR*) hash_search(&var_hash, save_var_name, length)) && - length < MAX_VAR_NAME) + if (!(v = (VAR*) hash_search(&var_hash, save_var_name, length))) { char buff[MAX_VAR_NAME+1]; strmake(buff, save_var_name, length); diff --git a/isam/sort.c b/isam/sort.c index d22b0e648a0..5d13f8085d2 100644 --- a/isam/sort.c +++ b/isam/sort.c @@ -122,7 +122,10 @@ uint sortbuff_size; MYF(0)))) break; else + { my_free((gptr) sort_keys,MYF(0)); + sort_keys= 0; + } } old_memavl=memavl; if ((memavl=memavl/4*3) < MIN_SORT_MEMORY && old_memavl > MIN_SORT_MEMORY) diff --git a/myisam/mi_packrec.c b/myisam/mi_packrec.c index a277c2ca9d1..1a71d43a7f1 100644 --- a/myisam/mi_packrec.c +++ b/myisam/mi_packrec.c @@ -182,21 +182,14 @@ my_bool _mi_read_pack_info(MI_INFO *info, pbool fix_keys) my_malloc((length+OFFSET_TABLE_SIZE)*sizeof(uint16)+ (uint) (share->pack.header_length+7), MYF(MY_WME | MY_ZEROFILL)))) - { - my_free((gptr) share->decode_trees,MYF(0)); goto err1; - } tmp_buff=share->decode_tables+length; disk_cache=(byte*) (tmp_buff+OFFSET_TABLE_SIZE); if (my_read(file,disk_cache, (uint) (share->pack.header_length-sizeof(header)), MYF(MY_NABP))) - { - my_free((gptr) share->decode_trees,MYF(0)); - my_free((gptr) share->decode_tables,MYF(0)); goto err2; - } huff_tree_bits=max_bit(trees ? trees-1 : 0); init_bit_buffer(&bit_buff, (uchar*) disk_cache, diff --git a/myisam/rt_index.c b/myisam/rt_index.c index bdf5ee9c60f..97554dca4e6 100644 --- a/myisam/rt_index.c +++ b/myisam/rt_index.c @@ -948,15 +948,14 @@ int rtree_delete(MI_INFO *info, uint keynr, uchar *key, uint key_length) /* check for redundant root (not leaf, 1 child) and eliminate */ if ((old_root = info->s->state.key_root[keynr]) == HA_OFFSET_ERROR) goto err1; - if (!_mi_fetch_keypage(info, keyinfo, old_root, DFLT_INIT_HITS, + if (!_mi_fetch_keypage(info, keyinfo, old_root, DFLT_INIT_HITS, info->buff, 0)) goto err1; nod_flag = mi_test_if_nod(info->buff); page_size = mi_getint(info->buff); - if (nod_flag && (page_size == 2 + key_length + - (nod_flag ? nod_flag : info->s->base.rec_reflength))) + if (nod_flag && (page_size == 2 + key_length + nod_flag)) { - my_off_t new_root = _mi_kpos(nod_flag, + my_off_t new_root = _mi_kpos(nod_flag, rt_PAGE_FIRST_KEY(info->buff, nod_flag)); if (_mi_dispose(info, keyinfo, old_root, DFLT_INIT_HITS)) goto err1; diff --git a/myisam/sort.c b/myisam/sort.c index 39bde41e4c9..7c6efa9a05b 100644 --- a/myisam/sort.c +++ b/myisam/sort.c @@ -162,7 +162,10 @@ int _create_index_by_sort(MI_SORT_PARAM *info,my_bool no_messages, { if (my_init_dynamic_array(&buffpek, sizeof(BUFFPEK), maxbuffer, maxbuffer/2)) + { my_free((gptr) sort_keys,MYF(0)); + sort_keys= 0; + } else break; } diff --git a/mysys/mf_keycache.c b/mysys/mf_keycache.c index 052d6c79ab9..c246e9b320c 100644 --- a/mysys/mf_keycache.c +++ b/mysys/mf_keycache.c @@ -352,6 +352,7 @@ int init_key_cache(KEY_CACHE *keycache, uint key_cache_block_size, MYF(0)))) break; my_free_lock(keycache->block_mem, MYF(0)); + keycache->block_mem= 0; } if (blocks < 8) { diff --git a/mysys/thr_alarm.c b/mysys/thr_alarm.c index caef1caaf3d..19611a6027a 100644 --- a/mysys/thr_alarm.c +++ b/mysys/thr_alarm.c @@ -248,7 +248,7 @@ void thr_end_alarm(thr_alarm_t *alarmed) if (alarm_data->malloced) my_free((gptr) alarm_data,MYF(0)); found++; -#ifndef DBUG_OFF +#ifdef DBUG_OFF break; #endif } diff --git a/sql/item.cc b/sql/item.cc index 92a15694e89..eda569378be 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -1444,7 +1444,7 @@ bool Item_field::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref) ¬_used)) != (Item **) not_found_item) { - if (*refer && (*refer)->fixed) // Avoid crash in case of error + if (refer && (*refer)->fixed) // Avoid crash in case of error { prev_subselect_item->used_tables_cache|= (*refer)->used_tables(); prev_subselect_item->const_item_cache&= (*refer)->const_item(); @@ -2057,7 +2057,6 @@ bool Item_ref::fix_fields(THD *thd,TABLE_LIST *tables, Item **reference) if (!ref) { TABLE_LIST *where= 0, *table_list; - bool upward_lookup= 0; SELECT_LEX_UNIT *prev_unit= thd->lex->current_select->master_unit(); SELECT_LEX *sl= prev_unit->outer_select(); /* @@ -2078,7 +2077,6 @@ bool Item_ref::fix_fields(THD *thd,TABLE_LIST *tables, Item **reference) { Field *tmp= (Field*) not_found_field; SELECT_LEX *last= 0; - upward_lookup= 1; /* We can't find table field in select list of current select, consequently we have to find it in outer subselect(s). @@ -2098,7 +2096,7 @@ bool Item_ref::fix_fields(THD *thd,TABLE_LIST *tables, Item **reference) ¬_used)) != (Item **)not_found_item) { - if (*ref && (*ref)->fixed) // Avoid crash in case of error + if (ref && (*ref)->fixed) // Avoid crash in case of error { prev_subselect_item->used_tables_cache|= (*ref)->used_tables(); prev_subselect_item->const_item_cache&= (*ref)->const_item(); @@ -2142,20 +2140,10 @@ bool Item_ref::fix_fields(THD *thd,TABLE_LIST *tables, Item **reference) return -1; if (ref == (Item **)not_found_item && tmp == not_found_field) { - if (upward_lookup) - { - // We can't say exactly what absend (table or field) - my_printf_error(ER_BAD_FIELD_ERROR, ER(ER_BAD_FIELD_ERROR), MYF(0), - full_name(), thd->where); - } - else - { - // Call to report error - find_item_in_list(this, - *(thd->lex->current_select->get_item_list()), - &counter, REPORT_ALL_ERRORS, ¬_used); - } - ref= 0; // Safety + // We can't say exactly what absend (table or field) + my_printf_error(ER_BAD_FIELD_ERROR, ER(ER_BAD_FIELD_ERROR), MYF(0), + full_name(), thd->where); + ref= 0; // Safety return 1; } if (tmp != not_found_field) diff --git a/sql/item_create.cc b/sql/item_create.cc index 800489a6a72..99db184e71f 100644 --- a/sql/item_create.cc +++ b/sql/item_create.cc @@ -365,22 +365,19 @@ Item *create_func_sin(Item* a) Item *create_func_sha(Item* a) { - return new Item_func_sha(a); + return new Item_func_sha(a); } - + Item *create_func_space(Item *a) { CHARSET_INFO *cs= current_thd->variables.collation_connection; Item *sp; - + if (cs->mbminlen > 1) { + uint dummy_errors; sp= new Item_string("",0,cs); - if (sp) - { - uint dummy_errors; - sp->str_value.copy(" ", 1, &my_charset_latin1, cs, &dummy_errors); - } + sp->str_value.copy(" ", 1, &my_charset_latin1, cs, &dummy_errors); } else { diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index f131d849d62..cd98fb62818 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -2489,6 +2489,9 @@ String* Item_func_export_set::val_str(String* str) case 3: sep_buf.set(",", 1, default_charset()); sep = &sep_buf; + break; + default: + DBUG_ASSERT(0); // cannot happen } null_value=0; diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index f9c9d1f013d..39c88c8b0a3 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -2112,20 +2112,25 @@ void Item_char_typecast::print(String *str) String *Item_char_typecast::val_str(String *str) { DBUG_ASSERT(fixed == 1); - String *res, *res1; + String *res; uint32 length; - if (!charset_conversion && !(res= args[0]->val_str(str))) +#if 0 + if (!charset_conversion) { - null_value= 1; - return 0; + if (!(res= args[0]->val_str(str))) + { + null_value= 1; + return 0; + } } else +#endif { // Convert character set if differ uint dummy_errors; - if (!(res1= args[0]->val_str(&tmp_value)) || - str->copy(res1->ptr(), res1->length(), res1->charset(), + if (!(res= args[0]->val_str(&tmp_value)) || + str->copy(res->ptr(), res->length(), res->charset(), cast_cs, &dummy_errors)) { null_value= 1; @@ -2135,13 +2140,13 @@ String *Item_char_typecast::val_str(String *str) } res->set_charset(cast_cs); - + /* Cut the tail if cast with length and the result is longer than cast length, e.g. CAST('string' AS CHAR(1)) */ - if (cast_length >= 0 && + if (cast_length >= 0 && (res->length() > (length= (uint32) res->charpos(cast_length)))) { // Safe even if const arg if (!res->alloced_length()) @@ -2150,7 +2155,7 @@ String *Item_char_typecast::val_str(String *str) res= &str_value; } res->length((uint) length); - } + } null_value= 0; return res; } diff --git a/sql/set_var.cc b/sql/set_var.cc index e44ac742abe..3d21e6db069 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -2912,8 +2912,8 @@ int set_var_password::check(THD *thd) if (!user->host.str) user->host.str= (char*) thd->host_or_ip; /* Returns 1 as the function sends error to client */ - return check_change_password(thd, user->host.str, user->user.str, password) ? - 1 : 0; + return check_change_password(thd, user->host.str, user->user.str, + password, strlen(password)) ? 1 : 0; #else return 0; #endif diff --git a/sql/slave.cc b/sql/slave.cc index ef9caa5f5b5..75f51437d0c 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -2422,18 +2422,19 @@ int st_relay_log_info::wait_for_pos(THD* thd, String* log_name, init_abort_pos_wait= abort_pos_wait; /* - We'll need to + We'll need to handle all possible log names comparisons (e.g. 999 vs 1000). - We use ulong for string->number conversion ; this is no + We use ulong for string->number conversion ; this is no stronger limitation than in find_uniq_filename in sql/log.cc */ ulong log_name_extension; char log_name_tmp[FN_REFLEN]; //make a char[] from String - char *end= strmake(log_name_tmp, log_name->ptr(), min(log_name->length(), - FN_REFLEN-1)); + + strmake(log_name_tmp, log_name->ptr(), min(log_name->length(), FN_REFLEN-1)); + char *p= fn_ext(log_name_tmp); char *p_end; - if (!*p || log_pos<0) + if (!*p || log_pos<0) { error= -2; //means improper arguments goto err; diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 2c11d1c87ad..7c17a4ef275 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -438,7 +438,7 @@ void acl_free(bool end) SYNOPSIS acl_reload() - thd Thread handle + thd Thread handle (can be NULL) */ void acl_reload(THD *thd) @@ -1128,6 +1128,10 @@ bool acl_check_host(const char *host, const char *ip) thd THD host hostname for the user user user name + new_password new password + + NOTE: + new_password cannot be NULL RETURN VALUE 0 OK @@ -1135,7 +1139,7 @@ bool acl_check_host(const char *host, const char *ip) */ bool check_change_password(THD *thd, const char *host, const char *user, - char *new_password) + char *new_password, uint new_password_len) { if (!initialized) { @@ -1186,12 +1190,13 @@ bool check_change_password(THD *thd, const char *host, const char *user, bool change_password(THD *thd, const char *host, const char *user, char *new_password) { + uint new_password_len= strlen(new_password); DBUG_ENTER("change_password"); DBUG_PRINT("enter",("host: '%s' user: '%s' new_password: '%s'", host,user,new_password)); DBUG_ASSERT(host != 0); // Ensured by parent - if (check_change_password(thd, host, user, new_password)) + if (check_change_password(thd, host, user, new_password, new_password_len)) DBUG_RETURN(1); VOID(pthread_mutex_lock(&acl_cache->lock)); @@ -1203,7 +1208,6 @@ bool change_password(THD *thd, const char *host, const char *user, DBUG_RETURN(1); } /* update loaded acl entry: */ - uint new_password_len= new_password ? strlen(new_password) : 0; set_user_salt(acl_user, new_password, new_password_len); if (update_user_table(thd, @@ -2697,7 +2701,7 @@ end: SYNOPSIS grant_reload() - thd Thread handler + thd Thread handler (can be NULL) NOTES Locked tables are checked by acl_init and doesn't have to be checked here diff --git a/sql/sql_acl.h b/sql/sql_acl.h index 68cb1476eb5..dc1b04c063a 100644 --- a/sql/sql_acl.h +++ b/sql/sql_acl.h @@ -143,7 +143,7 @@ int acl_getroot(THD *thd, USER_RESOURCES *mqh, const char *passwd, uint passwd_len); bool acl_check_host(const char *host, const char *ip); bool check_change_password(THD *thd, const char *host, const char *user, - char *password); + char *password, uint password_len); bool change_password(THD *thd, const char *host, const char *user, char *password); int mysql_grant(THD *thd, const char *db, List &user_list, diff --git a/sql/sql_analyse.cc b/sql/sql_analyse.cc index 33ce62bc5cf..7ac9a0866df 100644 --- a/sql/sql_analyse.cc +++ b/sql/sql_analyse.cc @@ -70,6 +70,9 @@ proc_analyse_init(THD *thd, ORDER *param, select_result *result, field_info **f_info; DBUG_ENTER("proc_analyse_init"); + if (!pc) + DBUG_RETURN(0); + if (!(param = param->next)) { pc->max_tree_elements = MAX_TREE_ELEMENTS; @@ -81,33 +84,30 @@ proc_analyse_init(THD *thd, ORDER *param, select_result *result, if ((*param->item)->type() != Item::INT_ITEM || (*param->item)->val() < 0) { - delete pc; my_error(ER_WRONG_PARAMETERS_TO_PROCEDURE, MYF(0), proc_name); - DBUG_RETURN(0); + goto err; } pc->max_tree_elements = (uint) (*param->item)->val_int(); param = param->next; if (param->next) // no third parameter possible { my_error(ER_WRONG_PARAMCOUNT_TO_PROCEDURE, MYF(0), proc_name); - DBUG_RETURN(0); + goto err; } // second parameter if ((*param->item)->type() != Item::INT_ITEM || (*param->item)->val() < 0) { - delete pc; my_error(ER_WRONG_PARAMETERS_TO_PROCEDURE, MYF(0), proc_name); - DBUG_RETURN(0); + goto err; } pc->max_treemem = (uint) (*param->item)->val_int(); } else if ((*param->item)->type() != Item::INT_ITEM || (*param->item)->val() < 0) { - delete pc; my_error(ER_WRONG_PARAMETERS_TO_PROCEDURE, MYF(0), proc_name); - DBUG_RETURN(0); + goto err; } // if only one parameter was given, it will be the value of max_tree_elements else @@ -116,34 +116,39 @@ proc_analyse_init(THD *thd, ORDER *param, select_result *result, pc->max_treemem = MAX_TREEMEM; } - if (!pc || !(pc->f_info = (field_info**) - sql_alloc(sizeof(field_info*)*field_list.elements))) - DBUG_RETURN(0); + if (!(pc->f_info= + (field_info**)sql_alloc(sizeof(field_info*)*field_list.elements))) + goto err; pc->f_end = pc->f_info + field_list.elements; pc->fields = field_list; - List_iterator_fast it(pc->fields); - f_info = pc->f_info; - - Item *item; - while ((item = it++)) { - if (item->result_type() == INT_RESULT) + List_iterator_fast it(pc->fields); + f_info = pc->f_info; + + Item *item; + while ((item = it++)) { - // Check if fieldtype is ulonglong - if (item->type() == Item::FIELD_ITEM && - ((Item_field*) item)->field->type() == FIELD_TYPE_LONGLONG && - ((Field_longlong*) ((Item_field*) item)->field)->unsigned_flag) - *f_info++ = new field_ulonglong(item, pc); - else - *f_info++ = new field_longlong(item, pc); + if (item->result_type() == INT_RESULT) + { + // Check if fieldtype is ulonglong + if (item->type() == Item::FIELD_ITEM && + ((Item_field*) item)->field->type() == FIELD_TYPE_LONGLONG && + ((Field_longlong*) ((Item_field*) item)->field)->unsigned_flag) + *f_info++ = new field_ulonglong(item, pc); + else + *f_info++ = new field_longlong(item, pc); + } + if (item->result_type() == REAL_RESULT) + *f_info++ = new field_real(item, pc); + if (item->result_type() == STRING_RESULT) + *f_info++ = new field_str(item, pc); } - if (item->result_type() == REAL_RESULT) - *f_info++ = new field_real(item, pc); - if (item->result_type() == STRING_RESULT) - *f_info++ = new field_str(item, pc); } DBUG_RETURN(pc); +err: + delete pc; + DBUG_RETURN(0); } diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 263c68a82b7..7d26996856d 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -251,13 +251,19 @@ void free_io_cache(TABLE *table) DBUG_VOID_RETURN; } - /* Close all tables which aren't in use by any thread */ +/* + Close all tables which aren't in use by any thread + + THD can be NULL, but then if_wait_for_refresh must be FALSE + and tables must be NULL. +*/ bool close_cached_tables(THD *thd, bool if_wait_for_refresh, TABLE_LIST *tables) { bool result=0; DBUG_ENTER("close_cached_tables"); + DBUG_ASSERT(thd || (!if_wait_for_refresh && !tables)); VOID(pthread_mutex_lock(&LOCK_open)); if (!tables) @@ -333,7 +339,6 @@ bool close_cached_tables(THD *thd, bool if_wait_for_refresh, VOID(pthread_mutex_unlock(&LOCK_open)); if (if_wait_for_refresh) { - THD *thd=current_thd; pthread_mutex_lock(&thd->mysys_var->mutex); thd->mysys_var->current_mutex= 0; thd->mysys_var->current_cond= 0; @@ -2068,13 +2073,8 @@ find_field_in_tables(THD *thd, Item_ident *item, TABLE_LIST *tables, strxnmov(buff,sizeof(buff)-1,db,".",table_name,NullS); table_name=buff; } - if (report_error) - { - my_printf_error(ER_UNKNOWN_TABLE, ER(ER_UNKNOWN_TABLE), MYF(0), - table_name, thd->where); - } - else - return (Field*) not_found_field; + my_printf_error(ER_UNKNOWN_TABLE, ER(ER_UNKNOWN_TABLE), MYF(0), + table_name, thd->where); } else if (report_error) diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc index bd42a2c1720..55e96ec0c6d 100644 --- a/sql/sql_cache.cc +++ b/sql/sql_cache.cc @@ -1157,12 +1157,12 @@ void Query_cache::invalidate(THD *thd, TABLE_LIST *tables_used, DBUG_ASSERT(!using_transactions || tables_used->table!=0); if (tables_used->derived) continue; - if (using_transactions && - (tables_used->table->file->table_cache_type() == + if (using_transactions && + (tables_used->table->file->table_cache_type() == HA_CACHE_TBL_TRANSACT)) - /* + /* Tables_used->table can't be 0 in transaction. - Only 'drop' invalidate not opened table, but 'drop' + Only 'drop' invalidate not opened table, but 'drop' force transaction finish. */ thd->add_changed_table(tables_used->table); @@ -1210,7 +1210,7 @@ void Query_cache::invalidate(CHANGED_TABLE_LIST *tables_used) */ void Query_cache::invalidate_locked_for_write(TABLE_LIST *tables_used) { - DBUG_ENTER("Query_cache::invalidate (changed table list)"); + DBUG_ENTER("Query_cache::invalidate_locked_for_write"); if (query_cache_size > 0 && tables_used) { STRUCT_LOCK(&structure_guard_mutex); diff --git a/sql/sql_db.cc b/sql/sql_db.cc index 39c3f8586ed..407e2b23e38 100644 --- a/sql/sql_db.cc +++ b/sql/sql_db.cc @@ -225,7 +225,7 @@ void del_dbopt(const char *path) } -/* +/* Create database options file: DESCRIPTION @@ -244,10 +244,10 @@ static bool write_db_opt(THD *thd, const char *path, HA_CREATE_INFO *create) if (!create->default_table_charset) create->default_table_charset= thd->variables.collation_server; - + if (put_dbopt(path, create)) return 1; - + if ((file=my_create(path, CREATE_MODE,O_RDWR | O_TRUNC,MYF(MY_WME))) >= 0) { ulong length; @@ -523,14 +523,14 @@ int mysql_alter_db(THD *thd, const char *db, HA_CREATE_INFO *create_info) if ((error=write_db_opt(thd, path, create_info))) goto exit; - /* + /* Change options if current database is being altered TODO: Delete this code */ if (thd->db && !strcmp(thd->db,db)) { - thd->db_charset= (create_info && create_info->default_table_charset) ? - create_info->default_table_charset : + thd->db_charset= create_info->default_table_charset ? + create_info->default_table_charset : thd->variables.collation_server; thd->variables.collation_database= thd->db_charset; } @@ -538,7 +538,7 @@ int mysql_alter_db(THD *thd, const char *db, HA_CREATE_INFO *create_info) mysql_update_log.write(thd,thd->query, thd->query_length); if (mysql_bin_log.is_open()) { - Query_log_event qinfo(thd, thd->query, thd->query_length, 0, + Query_log_event qinfo(thd, thd->query, thd->query_length, 0, /* suppress_use */ TRUE); /* @@ -620,12 +620,12 @@ int mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent) pthread_mutex_lock(&LOCK_open); remove_db_from_cache(db); pthread_mutex_unlock(&LOCK_open); - + error= -1; if ((deleted= mysql_rm_known_files(thd, dirp, db, path, 0)) >= 0) { ha_drop_database(path); - query_cache_invalidate1(db); + query_cache_invalidate1(db); error = 0; } } @@ -636,7 +636,7 @@ int mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent) my_casedn_str(files_charset_info, tmp_db); db= tmp_db; } - if (!silent && deleted>=0 && thd) + if (!silent && deleted>=0) { const char *query; ulong query_length; @@ -686,7 +686,7 @@ exit: have 'if (data_buf) free(data_buf)' data_buf is !=0 so this makes a DOUBLE free(). Side effects of this double free() are, randomly (depends on the machine), - when the slave is replicating a DROP DATABASE: + when the slave is replicating a DROP DATABASE: - garbage characters in the error message: "Error 'Can't drop database 'test2'; database doesn't exist' on query 'h4zI©'" diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index 2783406e16a..e0cb43e093e 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -1685,9 +1685,6 @@ void st_select_lex::print_order(String *str, ORDER *order) void st_select_lex::print_limit(THD *thd, String *str) { - if (!thd) - thd= current_thd; - if (explicit_limit) { str->append(" limit ", 7); diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index c81aefc9cea..ca626539eb4 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -866,14 +866,16 @@ static int check_connection(THD *thd) char *user= end; char *passwd= strend(user)+1; char *db= passwd; - char db_buff[NAME_LEN+1]; // buffer to store db in utf8 + char db_buff[NAME_LEN+1]; // buffer to store db in utf8 char user_buff[USERNAME_LENGTH+1]; // buffer to store user in utf8 - /* + uint dummy_errors; + + /* Old clients send null-terminated string as password; new clients send the size (1 byte) + string (not null-terminated). Hence in case of empty password both send '\0'. */ - uint passwd_len= thd->client_capabilities & CLIENT_SECURE_CONNECTION ? + uint passwd_len= thd->client_capabilities & CLIENT_SECURE_CONNECTION ? *passwd++ : strlen(passwd); db= thd->client_capabilities & CLIENT_CONNECT_WITH_DB ? db + passwd_len + 1 : 0; @@ -881,7 +883,6 @@ static int check_connection(THD *thd) /* Since 4.1 all database names are stored in utf8 */ if (db) { - uint dummy_errors; db_buff[copy_and_convert(db_buff, sizeof(db_buff)-1, system_charset_info, db, strlen(db), @@ -889,14 +890,10 @@ static int check_connection(THD *thd) db= db_buff; } - if (user) - { - uint dummy_errors; - user_buff[copy_and_convert(user_buff, sizeof(user_buff)-1, - system_charset_info, user, strlen(user), - thd->charset(), &dummy_errors)]= '\0'; - user= user_buff; - } + user_buff[copy_and_convert(user_buff, sizeof(user_buff)-1, + system_charset_info, user, strlen(user), + thd->charset(), &dummy_errors)]= '\0'; + user= user_buff; if (thd->user) x_free(thd->user); @@ -3217,12 +3214,12 @@ purposes internal to the MySQL server", MYF(0)); /* If in a slave thread : ALTER DATABASE DB may not be preceded by USE DB. - For that reason, maybe db_ok() in sql/slave.cc did not check the + For that reason, maybe db_ok() in sql/slave.cc did not check the do_db/ignore_db. And as this query involves no tables, tables_ok() above was not called. So we have to check rules again here. */ #ifdef HAVE_REPLICATION - if (thd->slave_thread && + if (thd->slave_thread && (!db_ok(db, replicate_do_db, replicate_ignore_db) || !db_ok_with_wild_table(db))) { @@ -3309,9 +3306,9 @@ purposes internal to the MySQL server", MYF(0)); case SQLCOM_GRANT: { if (check_access(thd, lex->grant | lex->grant_tot_col | GRANT_ACL, - tables && tables->db ? tables->db : select_lex->db, + tables ? tables->db : select_lex->db, tables ? &tables->grant.privilege : 0, - tables ? 0 : 1,0)) + tables ? 0 : 1, 0)) goto error; /* diff --git a/sql/sql_table.cc b/sql/sql_table.cc index c3bfbe086f1..5d756653cdd 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -1897,9 +1897,9 @@ static int mysql_admin_table(THD* thd, TABLE_LIST* tables, for (table = tables; table; table = table->next) { char table_name[NAME_LEN*2+2]; - char* db = (table->db) ? table->db : thd->db; + char* db = table->db; bool fatal_error=0; - strxmov(table_name,db ? db : "",".",table->real_name,NullS); + strxmov(table_name, db, ".", table->real_name, NullS); thd->open_options|= extra_open_options; table->table = open_ltable(thd, table, lock_type); diff --git a/sql/sql_update.cc b/sql/sql_update.cc index 761e8d6de8b..c2894a0c86b 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -61,7 +61,7 @@ int mysql_update(THD *thd, bool safe_update= thd->options & OPTION_SAFE_UPDATES; bool used_key_is_modified, transactional_table, log_delayed; int error=0; - uint used_index; + uint used_index= MAX_KEY; #ifndef NO_EMBEDDED_ACCESS_CHECKS uint want_privilege; #endif @@ -75,7 +75,6 @@ int mysql_update(THD *thd, thd->lex->select_lex.table_list.first); DBUG_ENTER("mysql_update"); - LINT_INIT(used_index); LINT_INIT(timestamp_query_id); if ((open_and_lock_tables(thd, table_list))) @@ -175,7 +174,7 @@ int mysql_update(THD *thd, matching rows before updating the table! */ table->file->extra(HA_EXTRA_RETRIEVE_ALL_COLS); - if (old_used_keys.is_set(used_index)) + if (used_index < MAX_KEY && old_used_keys.is_set(used_index)) { table->key_read=1; table->file->extra(HA_EXTRA_KEYREAD); @@ -542,8 +541,8 @@ int mysql_multi_update(THD *thd, /* Unlock the tables in preparation for relocking */ if (!using_lock_tables) - { - mysql_unlock_tables(thd, thd->lock); + { + mysql_unlock_tables(thd, thd->lock); thd->lock= 0; } diff --git a/sql/table.cc b/sql/table.cc index 5ede9c1e43d..0d3f2545b20 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -99,11 +99,11 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag, *root_ptr= &outparam->mem_root; outparam->real_name=strdup_root(&outparam->mem_root, - name+dirname_length(name)); - *fn_ext(outparam->real_name)='\0'; // Remove extension + name+dirname_length(name)); outparam->table_name=my_strdup(alias,MYF(MY_WME)); if (!outparam->real_name || !outparam->table_name) goto err_end; + *fn_ext(outparam->real_name)='\0'; // Remove extension if ((file=my_open(fn_format(index_file,name,"",reg_ext,MY_UNPACK_FILENAME), O_RDONLY | O_SHARE, @@ -305,12 +305,14 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag, VOID(my_seek(file,pos,MY_SEEK_SET,MYF(0))); if (my_read(file,(byte*) head,288,MYF(MY_NABP))) goto err_not_open; +#ifdef HAVE_CRYPTED_FRM if (crypted) { crypted->decode((char*) head+256,288-256); if (sint2korr(head+284) != 0) // Should be 0 goto err_not_open; // Wrong password } +#endif outparam->fields= uint2korr(head+258); pos=uint2korr(head+260); /* Length of all screens */ @@ -339,12 +341,14 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag, pos+ (uint) (n_length+int_length+com_length)); if (read_string(file,(gptr*) &disk_buff,read_length)) goto err_not_open; /* purecov: inspected */ +#ifdef HAVE_CRYPTED_FRM if (crypted) { crypted->decode((char*) disk_buff,read_length); delete crypted; crypted=0; } +#endif strpos= disk_buff+pos; outparam->intervals= (TYPELIB*) (field_ptr+outparam->fields+1); @@ -1453,7 +1457,7 @@ bool check_column_name(const char *name) { const char *start= name; bool last_char_is_space= TRUE; - + while (*name) { #if defined(USE_MB) && defined(USE_MB_IDENT) diff --git a/sql/tztime.cc b/sql/tztime.cc index c2143b0d5dd..597389220f7 100644 --- a/sql/tztime.cc +++ b/sql/tztime.cc @@ -1825,7 +1825,7 @@ tz_load_from_open_tables(const String *tz_name, TABLE_LIST *tz_tables) { ttid= (uint)table->field[1]->val_int(); - if (ttid > TZ_MAX_TYPES) + if (ttid >= TZ_MAX_TYPES) { sql_print_error("Error while loading time zone description from " "mysql.time_zone_transition_type table: too big " diff --git a/tests/client_test.c b/tests/client_test.c index beaff795d0e..83f8f6ab143 100644 --- a/tests/client_test.c +++ b/tests/client_test.c @@ -10778,6 +10778,12 @@ static void test_bug5194() if (bind == 0 || query == 0 || param_str == 0) { fprintf(stderr, "Can't allocate enough memory for query structs\n"); + if (bind) + free(bind); + if (query) + free(query); + if (param_str) + free(param_str); return; } From 38e664cf6460c4bfe586ad9d12b9f421acf48ebc Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 24 Jan 2005 17:17:19 +0200 Subject: [PATCH 0823/1063] fixed way of forward reference detection to support literal constant (BUG#8025) mysql-test/r/subselect.result: Forward reference detection mysql-test/t/subselect.test: Forward reference detection sql/item.cc: now forward reference is detected via ref_pointer_array, because some literal constants are 'fixed' just after creation sql/sql_base.cc: fill ref_pointer_array with zerows for forward reference detection. --- mysql-test/r/subselect.result | 14 ++++++++++++++ mysql-test/t/subselect.test | 16 ++++++++++++++++ sql/item.cc | 6 ++++-- sql/sql_base.cc | 14 ++++++++++++++ 4 files changed, 48 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index 4a4cbcc38cd..03dcc23c919 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -2182,3 +2182,17 @@ ERROR 21000: Operand should contain 2 column(s) select (select * from t1) = row(1,(2,2)); ERROR 21000: Operand should contain 1 column(s) drop table t1; +create table t1 (a integer); +insert into t1 values (1); +select 1 = ALL (select 1 from t1 where 1 = xx ), 1 as xx ; +ERROR 42S22: Reference 'xx' not supported (forward reference in item list) +select 1 = ALL (select 1 from t1 where 1 = xx ), 1 as xx; +ERROR 42S22: Reference 'xx' not supported (forward reference in item list) +select 1 as xx, 1 = ALL ( select 1 from t1 where 1 = xx ); +xx 1 = ALL ( select 1 from t1 where 1 = xx ) +1 1 +select 1 = ALL (select 1 from t1 where 1 = xx ), 1 as xx; +ERROR 42S22: Reference 'xx' not supported (forward reference in item list) +select 1 = ALL (select 1 from t1 where 1 = xx ), 1 as xx from DUAL; +ERROR 42S22: Reference 'xx' not supported (forward reference in item list) +drop table t1; diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test index d8e58facaad..55400dae0be 100644 --- a/mysql-test/t/subselect.test +++ b/mysql-test/t/subselect.test @@ -1449,3 +1449,19 @@ select row(1,(2,2)) = (select * from t1 ); -- error 1241 select (select * from t1) = row(1,(2,2)); drop table t1; + +# +# Forward reference detection +# +create table t1 (a integer); +insert into t1 values (1); +-- error 1247 +select 1 = ALL (select 1 from t1 where 1 = xx ), 1 as xx ; +-- error 1247 +select 1 = ALL (select 1 from t1 where 1 = xx ), 1 as xx; +select 1 as xx, 1 = ALL ( select 1 from t1 where 1 = xx ); +-- error 1247 +select 1 = ALL (select 1 from t1 where 1 = xx ), 1 as xx; +-- error 1247 +select 1 = ALL (select 1 from t1 where 1 = xx ), 1 as xx from DUAL; +drop table t1; diff --git a/sql/item.cc b/sql/item.cc index 640cc17411f..412cf315d4a 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -1482,12 +1482,13 @@ bool Item_field::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref) } else if (refer != (Item **)not_found_item) { - if (!(*refer)->fixed) + if (!last->ref_pointer_array[counter]) { my_error(ER_ILLEGAL_REFERENCE, MYF(0), name, "forward reference in item list"); return -1; } + DBUG_ASSERT((*refer)->fixed); /* Here, a subset of actions performed by Item_ref::set_properties is not enough. So we pass ptr to NULL into Item_[direct]_ref @@ -2173,12 +2174,13 @@ bool Item_ref::fix_fields(THD *thd,TABLE_LIST *tables, Item **reference) mark_as_dependent(thd, last, thd->lex->current_select, fld); return 0; } - if (!(*ref)->fixed) + if (!last->ref_pointer_array[counter]) { my_error(ER_ILLEGAL_REFERENCE, MYF(0), name, "forward reference in item list"); return -1; } + DBUG_ASSERT((*ref)->fixed); mark_as_dependent(thd, last, thd->lex->current_select, this); if (place == IN_HAVING) diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 263c68a82b7..fc987ef09b2 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -2405,6 +2405,20 @@ int setup_fields(THD *thd, Item **ref_pointer_array, TABLE_LIST *tables, thd->allow_sum_func= allow_sum_func; thd->where="field list"; + /* + To prevent fail on forward lookup we fill it with zerows, + then if we got pointer on zero after find_item_in_list we will know + that it is forward lookup. + + There is other way to solve problem: fill array with pointers to list, + but it will be slower. + + TODO: remove it when (if) we made one list for allfields and + ref_pointer_array + */ + if (ref_pointer_array) + bzero(ref_pointer_array, sizeof(Item *) * fields.elements); + Item **ref= ref_pointer_array; while ((item= it++)) { From 0af8f701089edd8c73afe50d7ab88ed48b4eccee Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 24 Jan 2005 16:56:17 +0100 Subject: [PATCH 0824/1063] mysql_client_test.test, mysql-test-run.sh: Let MYSQL_CLIENT_TEST be set with command line from mysql-test-run script mysql-test-run.sh: Renamed client_test to mysql_client_test Support --embedded-server test on installed server mysql_client_test.test: Renamed client_test to mysql_client_test Use env var CLIENT_TEST with full name, it differs when run with --embedded-server Rename: mysql-test/t/client_test.test -> mysql-test/t/mysql_client_test.test mysql-test/mysql-test-run.sh: Let MYSQL_CLIENT_TEST be set with command line from mysql-test-run script mysql-test/t/mysql_client_test.test: Let MYSQL_CLIENT_TEST be set with command line from mysql-test-run script --- mysql-test/mysql-test-run.sh | 42 ++++++++++++++++++++++------- mysql-test/t/client_test.test | 4 --- mysql-test/t/mysql_client_test.test | 3 +++ 3 files changed, 35 insertions(+), 14 deletions(-) delete mode 100644 mysql-test/t/client_test.test create mode 100644 mysql-test/t/mysql_client_test.test diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index 722da516d9b..990adbcf4b8 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -493,13 +493,13 @@ DASH72=`$ECHO '-------------------------------------------------------'|$CUT -c # on binary, use what is installed if [ x$SOURCE_DIST = x1 ] ; then if [ "x$USE_EMBEDDED_SERVER" = "x1" ] ; then - if [ -f "$BASEDIR/libmysqld/examples/mysqltest" ] ; then - MYSQL_TEST="$VALGRIND $BASEDIR/libmysqld/examples/mysqltest" + if [ -f "$BASEDIR/libmysqld/examples/mysqltest_embedded" ] ; then + MYSQL_TEST="$VALGRIND $BASEDIR/libmysqld/examples/mysqltest_embedded" else - echo "Fatal error: Cannot find embedded server 'mysqltest'" 1>&2 + echo "Fatal error: Cannot find embedded server 'mysqltest_embedded'" 1>&2 exit 1 fi - TESTS_BINDIR="$BASEDIR/libmysqld/examples" + MYSQL_CLIENT_TEST="$BASEDIR/libmysqld/examples/mysql_client_test_embedded" else MYSQLD="$VALGRIND $BASEDIR/sql/mysqld" if [ -f "$BASEDIR/client/.libs/lt-mysqltest" ] ; then @@ -509,7 +509,7 @@ if [ x$SOURCE_DIST = x1 ] ; then else MYSQL_TEST="$BASEDIR/client/mysqltest" fi - TESTS_BINDIR="$BASEDIR/tests" + MYSQL_CLIENT_TEST="$BASEDIR/tests/mysql_client_test" fi if [ -f "$BASEDIR/client/.libs/mysqldump" ] ; then MYSQL_DUMP="$BASEDIR/client/.libs/mysqldump" @@ -538,6 +538,14 @@ if [ x$SOURCE_DIST = x1 ] ; then MYSQL_FIX_SYSTEM_TABLES="$BASEDIR/scripts/mysql_fix_privilege_tables" NDB_TOOLS_DIR="$BASEDIR/ndb/tools" else + + # We have a binary installation. Note that this can be both from + # unpacking a MySQL AB binary distribution (created using + # "scripts/make_binary_distribution", and from a "make install". + # Unfortunately the structure differs a bit, for a "make install" + # currently all binaries are in "bin", for a MySQL AB packaging + # some are in "tests". + if test -x "$BASEDIR/libexec/mysqld" then MYSQLD="$VALGRIND $BASEDIR/libexec/mysqld" @@ -545,8 +553,6 @@ else MYSQLD="$VALGRIND $BASEDIR/bin/mysqld" fi CLIENT_BINDIR="$BASEDIR/bin" - TESTS_BINDIR="$BASEDIR/tests" - MYSQL_TEST="$CLIENT_BINDIR/mysqltest" MYSQL_DUMP="$CLIENT_BINDIR/mysqldump" MYSQL_BINLOG="$CLIENT_BINDIR/mysqlbinlog" MYSQLADMIN="$CLIENT_BINDIR/mysqladmin" @@ -565,7 +571,23 @@ else else LANGUAGE="$BASEDIR/share/english/" CHARSETSDIR="$BASEDIR/share/charsets" - fi + fi + if [ "x$USE_EMBEDDED_SERVER" = "x1" ] ; then + if [ -f "$CLIENT_BINDIR/mysqltest_embedded" ] ; then + MYSQL_TEST="$VALGRIND $CLIENT_BINDIR/mysqltest_embedded" + else + echo "Fatal error: Cannot find embedded server 'mysqltest_embedded'" 1>&2 + exit 1 + fi + if [ -d "$BASEDIR/tests/mysql_client_test_embedded" ] ; then + MYSQL_CLIENT_TEST="$TESTS_BINDIR/mysql_client_test_embedded" + else + MYSQL_CLIENT_TEST="$CLIENT_BINDIR/mysql_client_test_embedded" + fi + else + MYSQL_TEST="$CLIENT_BINDIR/mysqltest" + MYSQL_CLIENT_TEST="$CLIENT_BINDIR/mysql_client_test" + fi fi if [ -z "$MASTER_MYSQLD" ] @@ -599,13 +621,13 @@ then EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT --user=root" fi - +MYSQL_CLIENT_TEST="$MYSQL_CLIENT_TEST --no-defaults --testcase --user=root --socket=$MASTER_MYSOCK --port=$MYSQL_TCP_PORT --silent" MYSQL_DUMP="$MYSQL_DUMP --no-defaults -uroot --socket=$MASTER_MYSOCK --password=$DBPASSWD $EXTRA_MYSQLDUMP_OPT" MYSQL_BINLOG="$MYSQL_BINLOG --no-defaults --local-load=$MYSQL_TMP_DIR $EXTRA_MYSQLBINLOG_OPT" MYSQL_FIX_SYSTEM_TABLES="$MYSQL_FIX_SYSTEM_TABLES --no-defaults --host=localhost --port=$MASTER_MYPORT --socket=$MASTER_MYSOCK --user=root --password=$DBPASSWD --basedir=$BASEDIR --bindir=$CLIENT_BINDIR --verbose" MYSQL="$MYSQL --host=localhost --port=$MASTER_MYPORT --socket=$MASTER_MYSOCK --user=root --password=$DBPASSWD" export MYSQL MYSQL_DUMP MYSQL_BINLOG MYSQL_FIX_SYSTEM_TABLES -export CLIENT_BINDIR TESTS_BINDIR CHARSETSDIR +export CLIENT_BINDIR MYSQL_CLIENT_TEST CHARSETSDIR export NDB_TOOLS_DIR MYSQL_TEST_ARGS="--no-defaults --socket=$MASTER_MYSOCK --database=$DB \ diff --git a/mysql-test/t/client_test.test b/mysql-test/t/client_test.test deleted file mode 100644 index 29e7c23ab35..00000000000 --- a/mysql-test/t/client_test.test +++ /dev/null @@ -1,4 +0,0 @@ -# Skip when testing the embedded server ---source include/not_embedded.inc ---disable_result_log ---exec $TESTS_BINDIR/client_test --no-defaults --testcase --user=root --socket=$MASTER_MYSOCK --port=$MYSQL_TCP_PORT --silent diff --git a/mysql-test/t/mysql_client_test.test b/mysql-test/t/mysql_client_test.test new file mode 100644 index 00000000000..86aecf43cbd --- /dev/null +++ b/mysql-test/t/mysql_client_test.test @@ -0,0 +1,3 @@ +# We run with different binaries for normal and --embedded-server +--disable_result_log +--exec $MYSQL_CLIENT_TEST From 2eabdaa2f773202ac90be9151deaf5d5b0744db1 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 24 Jan 2005 17:10:03 +0100 Subject: [PATCH 0825/1063] my_global.h: Bug#7145 Added cast to doublestore() and ARM include/my_global.h: Added cast to doublestore() and ARM --- include/my_global.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/my_global.h b/include/my_global.h index ff59f7bfc55..f54a18649c5 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -1072,7 +1072,7 @@ do { doubleget_union _tmp; \ #define float4store(V,M) memcpy_fixed((byte*) V,(byte*) (&M),sizeof(float)) #if defined(__FLOAT_WORD_ORDER) && (__FLOAT_WORD_ORDER == __BIG_ENDIAN) -#define doublestore(T,V) do { *(T)= ((byte *) &V)[4];\ +#define doublestore(T,V) do { *(((char*)T)+0)=(char) ((byte *) &V)[4];\ *(((char*)T)+1)=(char) ((byte *) &V)[5];\ *(((char*)T)+2)=(char) ((byte *) &V)[6];\ *(((char*)T)+3)=(char) ((byte *) &V)[7];\ From 7109999b92ec8541a61ca5babc5b06f4315478a8 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 24 Jan 2005 18:38:46 +0100 Subject: [PATCH 0826/1063] remove the entry from the list, before freeing --- mysys/mf_keycaches.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mysys/mf_keycaches.c b/mysys/mf_keycaches.c index fee3096de52..38fef31fdd4 100644 --- a/mysys/mf_keycaches.c +++ b/mysys/mf_keycaches.c @@ -275,7 +275,11 @@ static void safe_hash_change(SAFE_HASH *hash, byte *old_data, byte *new_data) if (entry->data == old_data) { if (new_data == hash->default_value) + { + if ((*entry->prev= entry->next)) + entry->next->prev= entry->prev; hash_delete(&hash->hash, (byte*) entry); + } else entry->data= new_data; } From 15f37ac2b43592063b27d9f02876d35bda05aa06 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 24 Jan 2005 12:31:14 -0800 Subject: [PATCH 0827/1063] Set lower_case_file_system when it is being tested to check if lower_case_tables_names=2 is sensible. Related to Bug #7887. sql/mysqld.cc: Set lower_case_file_system when it is being tested to check if lower_case_tables_names=2 is sensible. --- sql/mysqld.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index b21b84a34e7..425911570ef 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -2914,7 +2914,8 @@ You should consider changing lower_case_table_names to 1 or 2", } } else if (lower_case_table_names == 2 && - (test_if_case_insensitive(mysql_real_data_home) == 0)) + !(lower_case_file_system= + (test_if_case_insensitive(mysql_real_data_home) == 1))) { if (global_system_variables.log_warnings) sql_print_warning("\ From dc43c6ea4b2bd3c466049674b4c760cad9ad2979 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 25 Jan 2005 02:31:51 +0300 Subject: [PATCH 0828/1063] A fix for Bug#5787 "mysql_stmt_prepare is upto 8 times slower": it's crucial to disable Nagle algorithm on client for no-reply commands (like mysql_stmt_free) to always work fast. Nagle algorithm instructs the sender to buffer (store) data if any unacknowledged data is outstanding and the size of to-send data is less than the network segment. It was exactly the case with COM_STMT_CLOSE after COM_STMT_PREPARE, so the client was waiting for Nagle timer to expire or for ACK from the server, while the server was holding up ACK because of delayed acknowledgement algorithm. The tricky part is that we have been already disabling Nagle algorithm (by setting TCP_NODELAY) almost everywhere except Windows (and maybe Netware). It is the reason why the bug was repeatable only with Windows client. vio/viosocket.c: A fix for Bug#5787 "mysql_stmt_prepare is upto 8 times slower": if we disable Nagle algorithm, do it everywhere. --- vio/viosocket.c | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/vio/viosocket.c b/vio/viosocket.c index bcba05beef1..202d70b6c26 100644 --- a/vio/viosocket.c +++ b/vio/viosocket.c @@ -142,23 +142,29 @@ int vio_fastsend(Vio * vio __attribute__((unused))) int r=0; DBUG_ENTER("vio_fastsend"); -#ifdef IPTOS_THROUGHPUT +#if defined(IPTOS_THROUGHPUT) && !defined(__EMX__) { -#ifndef __EMX__ int tos = IPTOS_THROUGHPUT; - if (!setsockopt(vio->sd, IPPROTO_IP, IP_TOS, (void *) &tos, sizeof(tos))) -#endif /* !__EMX__ */ - { - int nodelay = 1; - if (setsockopt(vio->sd, IPPROTO_TCP, TCP_NODELAY, (void *) &nodelay, - sizeof(nodelay))) { - DBUG_PRINT("warning", - ("Couldn't set socket option for fast send")); - r= -1; - } - } + r= setsockopt(vio->sd, IPPROTO_IP, IP_TOS, (void *) &tos, sizeof(tos)); + } +#endif /* IPTOS_THROUGHPUT && !__EMX__ */ + if (!r) + { +#ifdef __WIN__ + BOOL nodelay= 1; + r= setsockopt(vio->sd, IPPROTO_TCP, TCP_NODELAY, (const char*) &nodelay, + sizeof(nodelay)); +#else + int nodelay = 1; + r= setsockopt(vio->sd, IPPROTO_TCP, TCP_NODELAY, (void*) &nodelay, + sizeof(nodelay)); +#endif /* __WIN__ */ + } + if (r) + { + DBUG_PRINT("warning", ("Couldn't set socket option for fast send")); + r= -1; } -#endif /* IPTOS_THROUGHPUT */ DBUG_PRINT("exit", ("%d", r)); DBUG_RETURN(r); } From b7b042689c566fc91a0c1ef2a2345ce964e6d191 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 25 Jan 2005 10:58:30 +0400 Subject: [PATCH 0829/1063] Test case (bug #7261: Alter table loses temp table with lower_case_table_names=2). --- mysql-test/r/lowercase_table2.result | 12 +++++++++++- mysql-test/t/lowercase_table2.test | 13 ++++++++++++- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/lowercase_table2.result b/mysql-test/r/lowercase_table2.result index 3be73f6cc6a..cfd8f78a77c 100644 --- a/mysql-test/r/lowercase_table2.result +++ b/mysql-test/r/lowercase_table2.result @@ -1,4 +1,4 @@ -DROP TABLE IF EXISTS t1,t2,T1,T2,t3,T3; +DROP TABLE IF EXISTS t1,t2,T1,T2,t3,T3,tT; DROP DATABASE IF EXISTS `TEST_$1`; DROP DATABASE IF EXISTS `test_$1`; CREATE TABLE T1 (a int); @@ -131,3 +131,13 @@ show tables like 't1%'; Tables_in_test (t1%) t1 drop table t1; +create temporary table tT(a int(11), b varchar(8)); +insert into tT values (1, 'abc'); +select * from tT; +a b +1 abc +alter table tT add index (a); +select * from tT; +a b +1 abc +drop table tT; diff --git a/mysql-test/t/lowercase_table2.test b/mysql-test/t/lowercase_table2.test index a4eaeac4ef4..237dcd29950 100644 --- a/mysql-test/t/lowercase_table2.test +++ b/mysql-test/t/lowercase_table2.test @@ -10,7 +10,7 @@ show variables like "lower_case_table_names"; enable_query_log; --disable_warnings -DROP TABLE IF EXISTS t1,t2,T1,T2,t3,T3; +DROP TABLE IF EXISTS t1,t2,T1,T2,t3,T3,tT; DROP DATABASE IF EXISTS `TEST_$1`; DROP DATABASE IF EXISTS `test_$1`; --enable_warnings @@ -100,3 +100,14 @@ show tables like 'T1%'; alter table t1 add index (A); show tables like 't1%'; drop table t1; + +# +# Bug #7261: Alter table loses temp table +# + +create temporary table tT(a int(11), b varchar(8)); +insert into tT values (1, 'abc'); +select * from tT; +alter table tT add index (a); +select * from tT; +drop table tT; From bb762b50a305b8ac5a67f0e63cf4e888cc55a98f Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 25 Jan 2005 10:03:27 +0100 Subject: [PATCH 0830/1063] backported ndb_mgm options from 5.0 changed ndb_restore test somewhat to fisrt make the tables in myisam mysql-test/mysql-test-run.sh: backported ndb_mgm options from 5.0 mysql-test/ndb/ndbcluster.sh: backported ndb_mgm options from 5.0 mysql-test/r/ndb_restore.result: changed ndb_restore test somewhat to fisrt make the tables in myisam mysql-test/t/ndb_restore.test: changed ndb_restore test somewhat to fisrt make the tables in myisam --- mysql-test/mysql-test-run.sh | 5 ++- mysql-test/ndb/ndbcluster.sh | 10 +++-- mysql-test/r/ndb_restore.result | 66 ++++++++++++++++----------------- mysql-test/t/ndb_restore.test | 38 +++++++++---------- 4 files changed, 63 insertions(+), 56 deletions(-) diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index 241e881cdfc..c2ac26217b9 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -241,6 +241,7 @@ USE_EMBEDDED_SERVER="" RESULT_EXT="" TEST_MODE="default" +NDB_MGM_EXTRA_OPTS= NDB_MGMD_EXTRA_OPTS= NDBD_EXTRA_OPTS= @@ -264,6 +265,8 @@ while test $# -gt 0; do --ndb-connectstring=*) USE_NDBCLUSTER="--ndbcluster" ; USE_RUNNING_NDBCLUSTER=`$ECHO "$1" | $SED -e "s;--ndb-connectstring=;;"` ;; + --ndb_mgm-extra-opts=*) + NDB_MGM_EXTRA_OPTS=`$ECHO "$1" | $SED -e "s;--ndb_mgm-extra-opts=;;"` ;; --ndb_mgmd-extra-opts=*) NDB_MGMD_EXTRA_OPTS=`$ECHO "$1" | $SED -e "s;--ndb_mgmd-extra-opts=;;"` ;; --ndbd-extra-opts=*) @@ -467,7 +470,7 @@ SMALL_SERVER="--key_buffer_size=1M --sort_buffer=256K --max_heap_table_size=1M" export MASTER_MYPORT MASTER_MYPORT1 SLAVE_MYPORT MYSQL_TCP_PORT MASTER_MYSOCK MASTER_MYSOCK1 NDBCLUSTER_BASE_PORT=`expr $NDBCLUSTER_PORT + 2` -NDBCLUSTER_OPTS="--port=$NDBCLUSTER_PORT --port-base=$NDBCLUSTER_BASE_PORT --data-dir=$MYSQL_TEST_DIR/var --ndb_mgmd-extra-opts=\"$NDB_MGMD_EXTRA_OPTS\" --ndbd-extra-opts=\"$NDBD_EXTRA_OPTS\"" +NDBCLUSTER_OPTS="--port=$NDBCLUSTER_PORT --port-base=$NDBCLUSTER_BASE_PORT --data-dir=$MYSQL_TEST_DIR/var --ndb_mgm-extra-opts=$NDB_MGM_EXTRA_OPTS --ndb_mgmd-extra-opts=$NDB_MGMD_EXTRA_OPTS --ndbd-extra-opts=$NDBD_EXTRA_OPTS" NDB_BACKUP_DIR=$MYSQL_TEST_DIR/var/ndbcluster-$NDBCLUSTER_PORT if [ x$SOURCE_DIST = x1 ] ; then diff --git a/mysql-test/ndb/ndbcluster.sh b/mysql-test/ndb/ndbcluster.sh index a86e482b2ab..16bb3a9b122 100644 --- a/mysql-test/ndb/ndbcluster.sh +++ b/mysql-test/ndb/ndbcluster.sh @@ -58,6 +58,7 @@ ndb_con_op=105000 ndb_dmem=80M ndb_imem=24M +NDB_MGM_EXTRA_OPTS= NDB_MGMD_EXTRA_OPTS= NDBD_EXTRA_OPTS= @@ -97,6 +98,9 @@ while test $# -gt 0; do --port-base=*) port_base=`echo "$1" | sed -e "s;--port-base=;;"` ;; + --ndb_mgm-extra-opts=*) + NDB_MGM_EXTRA_OPTS=`echo "$1" | sed -e "s;--ndb_mgm-extra-opts=;;"` + ;; --ndb_mgmd-extra-opts=*) NDB_MGMD_EXTRA_OPTS=`echo "$1" | sed -e "s;--ndb_mgmd-extra-opts=;;"` ;; @@ -130,7 +134,7 @@ if [ ! -x "$exec_waiter" ]; then exit 1 fi -exec_mgmtclient="$exec_mgmtclient --no-defaults" +exec_mgmtclient="$exec_mgmtclient --no-defaults $NDB_MGM_EXTRA_OPTS" exec_mgmtsrvr="$exec_mgmtsrvr --no-defaults $NDB_MGMD_EXTRA_OPTS" exec_ndb="$exec_ndb --no-defaults $NDBD_EXTRA_OPTS" exec_waiter="$exec_waiter --no-defaults" @@ -178,8 +182,8 @@ fi # Edit file system path and ports in config file if [ $initial_ndb ] ; then - rm -f $fs_ndb/ndb_* -sed \ + rm -f $fs_ndb/ndb_* 2>&1 | cat > /dev/null + sed \ -e s,"CHOOSE_MaxNoOfOrderedIndexes","$ndb_no_ord",g \ -e s,"CHOOSE_MaxNoOfConcurrentOperations","$ndb_con_op",g \ -e s,"CHOOSE_DataMemory","$ndb_dmem",g \ diff --git a/mysql-test/r/ndb_restore.result b/mysql-test/r/ndb_restore.result index 7a81e8cd802..8e4449b1996 100644 --- a/mysql-test/r/ndb_restore.result +++ b/mysql-test/r/ndb_restore.result @@ -6,7 +6,7 @@ CREATE TABLE `t1` ( `goaledatta` char(2) NOT NULL default '', `maturegarbagefa` varchar(32) NOT NULL default '', PRIMARY KEY (`capgoaledatta`,`goaledatta`,`maturegarbagefa`) -) ENGINE=ndbcluster DEFAULT CHARSET=latin1; +) ENGINE=myisam DEFAULT CHARSET=latin1; INSERT INTO `t1` VALUES (2,'3','q3plus.qt'),(4,'4','q3plus.qt'),(1,'3','q3.net'),(3,'4','q3.net'),(3,'20','threetrees.qt'); CREATE TABLE `t2` ( `capgotod` smallint(5) unsigned NOT NULL auto_increment, @@ -17,13 +17,13 @@ CREATE TABLE `t2` ( `svcutonsa` varchar(64) NOT NULL default '', PRIMARY KEY (`capgotod`), KEY `i_quadaddsvr` (`gotod`) -) ENGINE=ndbcluster DEFAULT CHARSET=latin1; +) ENGINE=myisam DEFAULT CHARSET=latin1; INSERT INTO `t2` VALUES (5,4,'','q3.net','addavp:MK_CASELECTOR=1','postorod rattoaa'),(2,1,'4','','addavp:MK_BRANDTAD=345','REDS Brandtad'),(3,2,'4','q3.net','execorder','fixedRatediPO REDS'),(1,1,'3','','addavp:MK_BRANDTAD=123','TEST Brandtad'),(6,5,'','told.q3.net','addavp:MK_BRANDTAD=123','Brandtad Toldzone'),(4,3,'3','q3.net','addavp:MK_POOLHINT=2','ratedi PO TEST'); CREATE TABLE `t3` ( `CapGoaledatta` smallint(5) unsigned NOT NULL default '0', `capgotod` smallint(5) unsigned NOT NULL default '0', PRIMARY KEY (`capgotod`,`CapGoaledatta`) -) ENGINE=ndbcluster DEFAULT CHARSET=latin1; +) ENGINE=myisam DEFAULT CHARSET=latin1; INSERT INTO `t3` VALUES (5,3),(2,4),(5,4),(1,3); CREATE TABLE `t4` ( `capfa` bigint(20) unsigned NOT NULL auto_increment, @@ -35,21 +35,21 @@ CREATE TABLE `t4` ( PRIMARY KEY (`fa`,`realm`), KEY `capfa` (`capfa`), KEY `i_quadentity` (`fa`,`realm`) -) ENGINE=ndbcluster DEFAULT CHARSET=latin1; +) ENGINE=myisam DEFAULT CHARSET=latin1; INSERT INTO `t4` VALUES (18,'john.smith','q3.net','dessjohn.smith',0,NULL),(21,'quad_katt_with_brandtad','q3.net','acne',0,NULL),(22,'quad_katt_carattoaa','q3.net','acne',0,NULL),(26,'436462612809','sqasdt.q3.net','N/A',0,'6'),(19,'john','smith.qt','dessjohn',0,NULL),(33,'436643196120','sqasdt.q3.net','N/A',1,'6'),(28,'436642900019','sqasdt.q3.net','N/A',0,'6'),(30,'436462900209','sqasdt.q3.net','N/A',0,'6'),(16,'436640006666','sqasdt.q3.net','',0,NULL),(19,'dette','el-redun.com','dessdette',0,NULL),(12,'quad_kattPP','q3.net','acne',2,NULL),(14,'436640008888','sqasdt.q3.net','',0,NULL),(29,'463624900028','sqasdt.q3.net','N/A',0,'6'),(15,'436640099099','sqasdt.q3.net','',0,NULL),(13,'pap','q3plus.qt','acne',1,NULL),(19,'436642612091','sqasdt.q3.net','N/A',0,'6'),(12,'quad_katt','q3.net','acne',0,NULL),(11,'quad_kattVK','q3.net','acne',1,NULL),(32,'463641969502','sqasdt.q3.net','N/A',1,'6'),(20,'joe','q3.net','joedesswd',0,NULL),(29,'436642900034','sqasdt.q3.net','N/A',0,'6'),(25,'contind','armerde.qt','acne',1,NULL); CREATE TABLE `t5` ( `capfa` bigint(20) unsigned NOT NULL default '0', `gotod` smallint(5) unsigned NOT NULL default '0', `orderutonsa` varchar(64) NOT NULL default '', PRIMARY KEY (`capfa`,`gotod`,`orderutonsa`) -) ENGINE=ndbcluster DEFAULT CHARSET=latin1; +) ENGINE=myisam DEFAULT CHARSET=latin1; INSERT INTO `t5` VALUES (21,2,''),(21,1,''),(22,4,''); CREATE TABLE `t6` ( `capfa_parent` bigint(20) unsigned NOT NULL default '0', `capfa_child` bigint(20) unsigned NOT NULL default '0', `relatta` smallint(5) unsigned NOT NULL default '0', PRIMARY KEY (`capfa_child`,`capfa_parent`,`relatta`) -) ENGINE=ndbcluster DEFAULT CHARSET=latin1; +) ENGINE=myisam DEFAULT CHARSET=latin1; INSERT INTO `t6` VALUES (15,16,0),(19,20,0),(18326932092909551615,30,0),(26,29,0),(18326932092909551615,29,0),(19,18,0),(26,28,0),(12,14,0); CREATE TABLE `t7` ( `dardpo` char(15) NOT NULL default '', @@ -60,7 +60,7 @@ CREATE TABLE `t7` ( `Fastmag` char(1) NOT NULL default '', `Beareratta` char(2) NOT NULL default '', PRIMARY KEY (`dardpo`,`dardtestard`) -) ENGINE=ndbcluster DEFAULT CHARSET=latin1; +) ENGINE=myisam DEFAULT CHARSET=latin1; INSERT INTO `t7` VALUES ('2.6.2.4',24,'CECHP','54545','0','0','5'),('2.2.5.4',26,'CANFA','33223','1','1','4'),('4.3.2.4',28,'ITALD','54222','1','0','5'),('129..0.0.eins',28,'G','99999','1','1','5'),('1.1.1.1',24,'AUTPT','32323','0','1','3'); CREATE TABLE `t8` ( `kattjame` varchar(32) NOT NULL default '', @@ -88,7 +88,7 @@ CREATE TABLE `t8` ( `acctinputoctets` bigint(20) unsigned default NULL, PRIMARY KEY (`kattjame`,`hunderaaarbagefa`,`hassetistart`,`hassetino`), KEY `squardporoot` (`squardporoot`) -) ENGINE=ndbcluster DEFAULT CHARSET=latin1; +) ENGINE=myisam DEFAULT CHARSET=latin1; INSERT INTO `t8` VALUES ('4tt45345235','pap','q3plus.qt','q3plus.qt','q3.net','436643196120','436643196929','8956234534568968','5524595699','uxasmt21.net.acne.qt/481889229462692422','','1.1.1.1','2.2.4.6','4','86989','34','x','x','2012-03-12 12:55:34','2012-12-05 11:20:04',3223433,3369,9565),('4545435545','john','q3.net','q3.net','acne.li','436643196120','436643196929','45345234568968','995696699','uxasmt21.net.acne.qt/481889229462692423','','1.1.1.1','2.2.9.8','2','86989','34','x','x','2012-03-12 11:35:03','2012-12-05 08:50:04',8821923,169,3565),('versteckter_q3net_katt','joe','q3.net','elredun.com','q3.net','436643196120','436643196939','91341234568968','695595699','uxasmt21.net.acne.qt/481889229462692421','','1.1.1.1','2.5.2.5','3','86989','34','x','x','2012-03-12 18:35:04','2012-12-05 12:35:04',1923123,9569,6565); CREATE TABLE `t9` ( `kattjame` varchar(32) NOT NULL default '', @@ -114,38 +114,38 @@ CREATE TABLE `t9` ( `actinputocctets` bigint(20) unsigned default NULL, `terminateraste` tinyint(3) unsigned default NULL, PRIMARY KEY (`kattjame`,`hunderaaarbagefa`,`hassetistart`,`hassetino`) -) ENGINE=ndbcluster DEFAULT CHARSET=latin1; +) ENGINE=myisam DEFAULT CHARSET=latin1; INSERT INTO `t9` VALUES ('3g4jh8gar2t','joe','q3.net','elredun.com','q3.net','436643316120','436643316939','91341234568968','695595699','1.1.1.1','2.2.6.2','3','86989','34','x','x','2012-03-12 18:35:04','2012-12-05 12:35:04',3123123,9569,6565,1),('4tt45345235','pap','q3plus.qt','q3plus.qt','q3.net','436643316120','436643316939','8956234534568968','5254595969','1.1.1.1','8.6.2.2','4','86989','34','x','x','2012-03-12 12:55:34','2012-12-05 11:20:04',3223433,3369,9565,2),('4545435545','john','q3.net','q3.net','acne.li','436643316120','436643316939','45345234568968','995696699','1.1.1.1','2.9.9.2','2','86998','34','x','x','2012-03-12 11:35:03','2012-12-05 08:50:04',8823123,169,3565,3); -create table t1_c engine=myisam as select * from t1; -create table t2_c engine=myisam as select * from t2; -create table t3_c engine=myisam as select * from t3; -create table t4_c engine=myisam as select * from t4; -create table t5_c engine=myisam as select * from t5; -create table t6_c engine=myisam as select * from t6; -create table t7_c engine=myisam as select * from t7; -create table t8_c engine=myisam as select * from t8; -create table t9_c engine=myisam as select * from t9; -drop table t1,t2,t3,t4,t5,t6,t7,t8,t9; +create table t1_c engine=ndbcluster as select * from t1; +create table t2_c engine=ndbcluster as select * from t2; +create table t3_c engine=ndbcluster as select * from t3; +create table t4_c engine=ndbcluster as select * from t4; +create table t5_c engine=ndbcluster as select * from t5; +create table t6_c engine=ndbcluster as select * from t6; +create table t7_c engine=ndbcluster as select * from t7; +create table t8_c engine=ndbcluster as select * from t8; +create table t9_c engine=ndbcluster as select * from t9; +drop table t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c; show tables; Tables_in_test -t1_c -t2_c -t3_c -t4_c -t5_c -t6_c -t7_c -t8_c -t9_c -t9 -t4 t1 t2 -t7 -t8 +t3 +t4 t5 t6 -t3 +t7 +t8 +t9 +t8_c +t9_c +t1_c +t7_c +t6_c +t5_c +t4_c +t3_c +t2_c select count(*) from t1; count(*) 5 diff --git a/mysql-test/t/ndb_restore.test b/mysql-test/t/ndb_restore.test index 79a4f8a06d3..09939ec119d 100644 --- a/mysql-test/t/ndb_restore.test +++ b/mysql-test/t/ndb_restore.test @@ -11,7 +11,7 @@ CREATE TABLE `t1` ( `goaledatta` char(2) NOT NULL default '', `maturegarbagefa` varchar(32) NOT NULL default '', PRIMARY KEY (`capgoaledatta`,`goaledatta`,`maturegarbagefa`) -) ENGINE=ndbcluster DEFAULT CHARSET=latin1; +) ENGINE=myisam DEFAULT CHARSET=latin1; INSERT INTO `t1` VALUES (2,'3','q3plus.qt'),(4,'4','q3plus.qt'),(1,'3','q3.net'),(3,'4','q3.net'),(3,'20','threetrees.qt'); CREATE TABLE `t2` ( @@ -23,14 +23,14 @@ CREATE TABLE `t2` ( `svcutonsa` varchar(64) NOT NULL default '', PRIMARY KEY (`capgotod`), KEY `i_quadaddsvr` (`gotod`) -) ENGINE=ndbcluster DEFAULT CHARSET=latin1; +) ENGINE=myisam DEFAULT CHARSET=latin1; INSERT INTO `t2` VALUES (5,4,'','q3.net','addavp:MK_CASELECTOR=1','postorod rattoaa'),(2,1,'4','','addavp:MK_BRANDTAD=345','REDS Brandtad'),(3,2,'4','q3.net','execorder','fixedRatediPO REDS'),(1,1,'3','','addavp:MK_BRANDTAD=123','TEST Brandtad'),(6,5,'','told.q3.net','addavp:MK_BRANDTAD=123','Brandtad Toldzone'),(4,3,'3','q3.net','addavp:MK_POOLHINT=2','ratedi PO TEST'); CREATE TABLE `t3` ( `CapGoaledatta` smallint(5) unsigned NOT NULL default '0', `capgotod` smallint(5) unsigned NOT NULL default '0', PRIMARY KEY (`capgotod`,`CapGoaledatta`) -) ENGINE=ndbcluster DEFAULT CHARSET=latin1; +) ENGINE=myisam DEFAULT CHARSET=latin1; INSERT INTO `t3` VALUES (5,3),(2,4),(5,4),(1,3); CREATE TABLE `t4` ( @@ -43,7 +43,7 @@ CREATE TABLE `t4` ( PRIMARY KEY (`fa`,`realm`), KEY `capfa` (`capfa`), KEY `i_quadentity` (`fa`,`realm`) -) ENGINE=ndbcluster DEFAULT CHARSET=latin1; +) ENGINE=myisam DEFAULT CHARSET=latin1; INSERT INTO `t4` VALUES (18,'john.smith','q3.net','dessjohn.smith',0,NULL),(21,'quad_katt_with_brandtad','q3.net','acne',0,NULL),(22,'quad_katt_carattoaa','q3.net','acne',0,NULL),(26,'436462612809','sqasdt.q3.net','N/A',0,'6'),(19,'john','smith.qt','dessjohn',0,NULL),(33,'436643196120','sqasdt.q3.net','N/A',1,'6'),(28,'436642900019','sqasdt.q3.net','N/A',0,'6'),(30,'436462900209','sqasdt.q3.net','N/A',0,'6'),(16,'436640006666','sqasdt.q3.net','',0,NULL),(19,'dette','el-redun.com','dessdette',0,NULL),(12,'quad_kattPP','q3.net','acne',2,NULL),(14,'436640008888','sqasdt.q3.net','',0,NULL),(29,'463624900028','sqasdt.q3.net','N/A',0,'6'),(15,'436640099099','sqasdt.q3.net','',0,NULL),(13,'pap','q3plus.qt','acne',1,NULL),(19,'436642612091','sqasdt.q3.net','N/A',0,'6'),(12,'quad_katt','q3.net','acne',0,NULL),(11,'quad_kattVK','q3.net','acne',1,NULL),(32,'463641969502','sqasdt.q3.net','N/A',1,'6'),(20,'joe','q3.net','joedesswd',0,NULL),(29,'436642900034','sqasdt.q3.net','N/A',0,'6'),(25,'contind','armerde.qt','acne',1,NULL); CREATE TABLE `t5` ( @@ -51,7 +51,7 @@ CREATE TABLE `t5` ( `gotod` smallint(5) unsigned NOT NULL default '0', `orderutonsa` varchar(64) NOT NULL default '', PRIMARY KEY (`capfa`,`gotod`,`orderutonsa`) -) ENGINE=ndbcluster DEFAULT CHARSET=latin1; +) ENGINE=myisam DEFAULT CHARSET=latin1; INSERT INTO `t5` VALUES (21,2,''),(21,1,''),(22,4,''); CREATE TABLE `t6` ( @@ -59,7 +59,7 @@ CREATE TABLE `t6` ( `capfa_child` bigint(20) unsigned NOT NULL default '0', `relatta` smallint(5) unsigned NOT NULL default '0', PRIMARY KEY (`capfa_child`,`capfa_parent`,`relatta`) -) ENGINE=ndbcluster DEFAULT CHARSET=latin1; +) ENGINE=myisam DEFAULT CHARSET=latin1; INSERT INTO `t6` VALUES (15,16,0),(19,20,0),(18326932092909551615,30,0),(26,29,0),(18326932092909551615,29,0),(19,18,0),(26,28,0),(12,14,0); CREATE TABLE `t7` ( @@ -71,7 +71,7 @@ CREATE TABLE `t7` ( `Fastmag` char(1) NOT NULL default '', `Beareratta` char(2) NOT NULL default '', PRIMARY KEY (`dardpo`,`dardtestard`) -) ENGINE=ndbcluster DEFAULT CHARSET=latin1; +) ENGINE=myisam DEFAULT CHARSET=latin1; INSERT INTO `t7` VALUES ('2.6.2.4',24,'CECHP','54545','0','0','5'),('2.2.5.4',26,'CANFA','33223','1','1','4'),('4.3.2.4',28,'ITALD','54222','1','0','5'),('129..0.0.eins',28,'G','99999','1','1','5'),('1.1.1.1',24,'AUTPT','32323','0','1','3'); CREATE TABLE `t8` ( @@ -100,7 +100,7 @@ CREATE TABLE `t8` ( `acctinputoctets` bigint(20) unsigned default NULL, PRIMARY KEY (`kattjame`,`hunderaaarbagefa`,`hassetistart`,`hassetino`), KEY `squardporoot` (`squardporoot`) -) ENGINE=ndbcluster DEFAULT CHARSET=latin1; +) ENGINE=myisam DEFAULT CHARSET=latin1; INSERT INTO `t8` VALUES ('4tt45345235','pap','q3plus.qt','q3plus.qt','q3.net','436643196120','436643196929','8956234534568968','5524595699','uxasmt21.net.acne.qt/481889229462692422','','1.1.1.1','2.2.4.6','4','86989','34','x','x','2012-03-12 12:55:34','2012-12-05 11:20:04',3223433,3369,9565),('4545435545','john','q3.net','q3.net','acne.li','436643196120','436643196929','45345234568968','995696699','uxasmt21.net.acne.qt/481889229462692423','','1.1.1.1','2.2.9.8','2','86989','34','x','x','2012-03-12 11:35:03','2012-12-05 08:50:04',8821923,169,3565),('versteckter_q3net_katt','joe','q3.net','elredun.com','q3.net','436643196120','436643196939','91341234568968','695595699','uxasmt21.net.acne.qt/481889229462692421','','1.1.1.1','2.5.2.5','3','86989','34','x','x','2012-03-12 18:35:04','2012-12-05 12:35:04',1923123,9569,6565); CREATE TABLE `t9` ( @@ -127,22 +127,22 @@ CREATE TABLE `t9` ( `actinputocctets` bigint(20) unsigned default NULL, `terminateraste` tinyint(3) unsigned default NULL, PRIMARY KEY (`kattjame`,`hunderaaarbagefa`,`hassetistart`,`hassetino`) -) ENGINE=ndbcluster DEFAULT CHARSET=latin1; +) ENGINE=myisam DEFAULT CHARSET=latin1; INSERT INTO `t9` VALUES ('3g4jh8gar2t','joe','q3.net','elredun.com','q3.net','436643316120','436643316939','91341234568968','695595699','1.1.1.1','2.2.6.2','3','86989','34','x','x','2012-03-12 18:35:04','2012-12-05 12:35:04',3123123,9569,6565,1),('4tt45345235','pap','q3plus.qt','q3plus.qt','q3.net','436643316120','436643316939','8956234534568968','5254595969','1.1.1.1','8.6.2.2','4','86989','34','x','x','2012-03-12 12:55:34','2012-12-05 11:20:04',3223433,3369,9565,2),('4545435545','john','q3.net','q3.net','acne.li','436643316120','436643316939','45345234568968','995696699','1.1.1.1','2.9.9.2','2','86998','34','x','x','2012-03-12 11:35:03','2012-12-05 08:50:04',8823123,169,3565,3); -create table t1_c engine=myisam as select * from t1; -create table t2_c engine=myisam as select * from t2; -create table t3_c engine=myisam as select * from t3; -create table t4_c engine=myisam as select * from t4; -create table t5_c engine=myisam as select * from t5; -create table t6_c engine=myisam as select * from t6; -create table t7_c engine=myisam as select * from t7; -create table t8_c engine=myisam as select * from t8; -create table t9_c engine=myisam as select * from t9; +create table t1_c engine=ndbcluster as select * from t1; +create table t2_c engine=ndbcluster as select * from t2; +create table t3_c engine=ndbcluster as select * from t3; +create table t4_c engine=ndbcluster as select * from t4; +create table t5_c engine=ndbcluster as select * from t5; +create table t6_c engine=ndbcluster as select * from t6; +create table t7_c engine=ndbcluster as select * from t7; +create table t8_c engine=ndbcluster as select * from t8; +create table t9_c engine=ndbcluster as select * from t9; --exec $NDB_MGM --no-defaults -e "start backup" > /dev/null -drop table t1,t2,t3,t4,t5,t6,t7,t8,t9; +drop table t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c; --exec $NDB_TOOLS_DIR/ndb_restore --no-defaults -b 1 -n 1 -m -r --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-1 > /tmp/ndb_restore.out --exec $NDB_TOOLS_DIR/ndb_restore --no-defaults -b 1 -n 2 -r --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-1 > /tmp/ndb_restore.out From 2ade7521b572e4f1b71f66a4d0d80c10b50c6229 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 25 Jan 2005 14:00:35 +0200 Subject: [PATCH 0831/1063] Add flags for Intel 64 bit --- BUILD/SETUP.sh | 3 +++ BUILD/compile-pentium64-debug | 13 +++++++++++++ 2 files changed, 16 insertions(+) create mode 100755 BUILD/compile-pentium64-debug diff --git a/BUILD/SETUP.sh b/BUILD/SETUP.sh index 5f4233b8371..d378276a0a3 100644 --- a/BUILD/SETUP.sh +++ b/BUILD/SETUP.sh @@ -1,3 +1,5 @@ +#!/bin/sh + if ! test -f sql/mysqld.cc then echo "You must run this script from the MySQL top-level directory" @@ -43,6 +45,7 @@ cxx_warnings="$global_warnings -Woverloaded-virtual -Wsign-promo -Wreorder -Wcto alpha_cflags="-mcpu=ev6 -Wa,-mev6" # Not used yet pentium_cflags="-mcpu=pentiumpro" +pentium64_cflags="-mcpu=nocona -m64" ppc_cflags="-mpowerpc -mcpu=powerpc" sparc_cflags="" diff --git a/BUILD/compile-pentium64-debug b/BUILD/compile-pentium64-debug new file mode 100755 index 00000000000..1bbca36d851 --- /dev/null +++ b/BUILD/compile-pentium64-debug @@ -0,0 +1,13 @@ +#! /bin/sh + +path=`dirname $0` +. "$path/SETUP.sh" + +extra_flags="$pentium64_cflags $debug_cflags" +c_warnings="$c_warnings $debug_extra_warnings" +cxx_warnings="$cxx_warnings $debug_extra_warnings" +extra_configs="$pentium_configs $debug_configs $static_link" + +extra_configs="$extra_configs " + +. "$path/FINISH.sh" From b7c59b9e2266f35dbaa60f8fd2ffa371bbfc46b6 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 25 Jan 2005 14:16:41 +0200 Subject: [PATCH 0832/1063] InnoDB: Enable ut_ad() assertions in MySQL debug builds. innobase/include/univ.i: InnoDB: Define UNIV_DEBUG when DBUG_ON (in MySQL) is defined. This enables InnoDB debug assertions in debug builds of mysqld. --- innobase/include/univ.i | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/innobase/include/univ.i b/innobase/include/univ.i index 4854e5a7b78..12846593977 100644 --- a/innobase/include/univ.i +++ b/innobase/include/univ.i @@ -86,8 +86,10 @@ memory is read outside the allocated blocks. */ /* Make a non-inline debug version */ +#ifdef DBUG_ON +# define UNIV_DEBUG +#endif /* DBUG_ON */ /* -#define UNIV_DEBUG #define UNIV_SYNC_DEBUG #define UNIV_MEM_DEBUG From f332605b1fea680dd6d7fa1ee55d35395baa6083 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 25 Jan 2005 16:42:16 +0400 Subject: [PATCH 0833/1063] tT replaced with T1 to be more predictable. --- mysql-test/r/lowercase_table2.result | 14 +++++++------- mysql-test/t/lowercase_table2.test | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/mysql-test/r/lowercase_table2.result b/mysql-test/r/lowercase_table2.result index cfd8f78a77c..a79b6b04063 100644 --- a/mysql-test/r/lowercase_table2.result +++ b/mysql-test/r/lowercase_table2.result @@ -1,4 +1,4 @@ -DROP TABLE IF EXISTS t1,t2,T1,T2,t3,T3,tT; +DROP TABLE IF EXISTS t1,t2,T1,T2,t3,T3; DROP DATABASE IF EXISTS `TEST_$1`; DROP DATABASE IF EXISTS `test_$1`; CREATE TABLE T1 (a int); @@ -131,13 +131,13 @@ show tables like 't1%'; Tables_in_test (t1%) t1 drop table t1; -create temporary table tT(a int(11), b varchar(8)); -insert into tT values (1, 'abc'); -select * from tT; +create temporary table T1(a int(11), b varchar(8)); +insert into T1 values (1, 'abc'); +select * from T1; a b 1 abc -alter table tT add index (a); -select * from tT; +alter table T1 add index (a); +select * from T1; a b 1 abc -drop table tT; +drop table T1; diff --git a/mysql-test/t/lowercase_table2.test b/mysql-test/t/lowercase_table2.test index 237dcd29950..a766e39abab 100644 --- a/mysql-test/t/lowercase_table2.test +++ b/mysql-test/t/lowercase_table2.test @@ -10,7 +10,7 @@ show variables like "lower_case_table_names"; enable_query_log; --disable_warnings -DROP TABLE IF EXISTS t1,t2,T1,T2,t3,T3,tT; +DROP TABLE IF EXISTS t1,t2,T1,T2,t3,T3; DROP DATABASE IF EXISTS `TEST_$1`; DROP DATABASE IF EXISTS `test_$1`; --enable_warnings @@ -105,9 +105,9 @@ drop table t1; # Bug #7261: Alter table loses temp table # -create temporary table tT(a int(11), b varchar(8)); -insert into tT values (1, 'abc'); -select * from tT; -alter table tT add index (a); -select * from tT; -drop table tT; +create temporary table T1(a int(11), b varchar(8)); +insert into T1 values (1, 'abc'); +select * from T1; +alter table T1 add index (a); +select * from T1; +drop table T1; From 984e7d29b2503b8d4a0a61c45beab07625da8ffa Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 25 Jan 2005 13:46:40 +0100 Subject: [PATCH 0834/1063] changed from using column names to column id in ndb setBound in ha_ndbcluster --- sql/ha_ndbcluster.cc | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index c2d12ddd316..c5bb4984f40 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -1476,10 +1476,7 @@ int ha_ndbcluster::set_bounds(NdbIndexScanOperation *op, // Set bound if not cancelled via type -1 if (p.bound_type != -1) { - char truncated_field_name[NDB_MAX_ATTR_NAME_SIZE]; - strnmov(truncated_field_name,field->field_name,sizeof(truncated_field_name)); - truncated_field_name[sizeof(truncated_field_name)-1]= '\0'; - if (op->setBound(truncated_field_name, p.bound_type, p.bound_ptr)) + if (op->setBound(i, p.bound_type, p.bound_ptr)) ERR_RETURN(op->getNdbError()); } } From 8fd38c7ab38bac89ca3d8addecec0e1cc19bcf28 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 25 Jan 2005 15:08:51 +0100 Subject: [PATCH 0835/1063] Fix for failing INSERT IGNORE in test ndb_insert --- sql/sql_insert.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 92c429bcfde..844e5e7dac2 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -241,7 +241,7 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list, error=0; id=0; thd->proc_info="update"; - if (duplic != DUP_ERROR) + if (duplic != DUP_ERROR || ignore) table->file->extra(HA_EXTRA_IGNORE_DUP_KEY); /* let's *try* to start bulk inserts. It won't necessary @@ -380,7 +380,7 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list, table->next_number_field=0; thd->count_cuted_fields= CHECK_FIELD_IGNORE; thd->next_insert_id=0; // Reset this if wrongly used - if (duplic != DUP_ERROR) + if (duplic != DUP_ERROR || ignore) table->file->extra(HA_EXTRA_NO_IGNORE_DUP_KEY); /* Reset value of LAST_INSERT_ID if no rows where inserted */ @@ -1345,7 +1345,7 @@ bool delayed_insert::handle_inserts(void) info.ignore= row->ignore; info.handle_duplicates= row->dup; if (info.ignore || - info.handle_duplicates == DUP_REPLACE) + info.handle_duplicates != DUP_ERROR) { table->file->extra(HA_EXTRA_IGNORE_DUP_KEY); using_ignore=1; @@ -1463,7 +1463,7 @@ select_insert::prepare(List &values, SELECT_LEX_UNIT *u) table->next_number_field=table->found_next_number_field; thd->cuted_fields=0; if (info.ignore || - info.handle_duplicates == DUP_REPLACE) + info.handle_duplicates != DUP_ERROR) table->file->extra(HA_EXTRA_IGNORE_DUP_KEY); table->file->start_bulk_insert((ha_rows) 0); DBUG_RETURN(0); @@ -1649,7 +1649,7 @@ select_create::prepare(List &values, SELECT_LEX_UNIT *u) restore_record(table,default_values); // Get empty record thd->cuted_fields=0; if (info.ignore || - info.handle_duplicates == DUP_REPLACE) + info.handle_duplicates != DUP_ERROR) table->file->extra(HA_EXTRA_IGNORE_DUP_KEY); table->file->start_bulk_insert((ha_rows) 0); DBUG_RETURN(0); From f35117ea34b679b0ac07593ab1cc7b14b7dc334b Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 25 Jan 2005 16:27:13 +0200 Subject: [PATCH 0836/1063] InnoDB: Backport innodb_autoextend_increment from 4.1 innobase/include/srv0srv.h: Add configuration variable srv_auto_extend_increment innobase/srv/srv0srv.c: Add configuration variable srv_auto_extend_increment sql/ha_innodb.h: Add configuration variable srv_auto_extend_increment sql/mysqld.cc: Add startup option innodb_autoextend_increment sql/set_var.cc: Add settable global variable innodb_autoextend_increment --- innobase/include/srv0srv.h | 4 +++- innobase/srv/srv0srv.c | 3 +++ sql/ha_innodb.h | 1 + sql/mysqld.cc | 6 ++++++ sql/set_var.cc | 4 ++++ 5 files changed, 17 insertions(+), 1 deletion(-) diff --git a/innobase/include/srv0srv.h b/innobase/include/srv0srv.h index c76a1917615..aa2fead53c2 100644 --- a/innobase/include/srv0srv.h +++ b/innobase/include/srv0srv.h @@ -27,7 +27,8 @@ extern os_event_t srv_lock_timeout_thread_event; /* If the last data file is auto-extended, we add this many pages to it at a time */ -#define SRV_AUTO_EXTEND_INCREMENT (8 * ((1024 * 1024) / UNIV_PAGE_SIZE)) +#define SRV_AUTO_EXTEND_INCREMENT \ + (srv_auto_extend_increment * ((1024 * 1024) / UNIV_PAGE_SIZE)) /* This is set to TRUE if the MySQL user has set it in MySQL */ extern ibool srv_lower_case_table_names; @@ -49,6 +50,7 @@ extern ulint* srv_data_file_is_raw_partition; extern ibool srv_auto_extend_last_data_file; extern ulint srv_last_file_size_max; +extern ulint srv_auto_extend_increment; extern ibool srv_created_new_raw; diff --git a/innobase/srv/srv0srv.c b/innobase/srv/srv0srv.c index d633c67cdf3..217a97d84a2 100644 --- a/innobase/srv/srv0srv.c +++ b/innobase/srv/srv0srv.c @@ -86,6 +86,9 @@ ulint srv_last_file_size_max = 0; /* if != 0, this tells the max size auto-extending may increase the last data file size */ +ulint srv_auto_extend_increment = 8; /* If the last data file is + auto-extended, we add this + many pages to it at a time */ ulint* srv_data_file_is_raw_partition = NULL; /* If the following is TRUE we do not allow inserts etc. This protects diff --git a/sql/ha_innodb.h b/sql/ha_innodb.h index 74acc0640c9..7bf20771680 100644 --- a/sql/ha_innodb.h +++ b/sql/ha_innodb.h @@ -208,6 +208,7 @@ extern my_bool innobase_log_archive, extern "C" { extern ulong srv_max_buf_pool_modified_pct; extern ulong srv_max_purge_lag; +extern ulong srv_auto_extend_increment; } extern TYPELIB innobase_lock_typelib; diff --git a/sql/mysqld.cc b/sql/mysqld.cc index c6ec942d0d9..f104e461d6a 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -3518,6 +3518,7 @@ enum options_mysqld { OPT_INNODB_FORCE_RECOVERY, OPT_INNODB_STATUS_FILE, OPT_INNODB_MAX_DIRTY_PAGES_PCT, + OPT_INNODB_AUTOEXTEND_INCREMENT, OPT_INNODB_TABLE_LOCKS, OPT_BDB_CACHE_SIZE, OPT_BDB_LOG_BUFFER_SIZE, @@ -3659,6 +3660,11 @@ struct my_option my_long_options[] = "Path to individual files and their sizes", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, #ifdef HAVE_INNOBASE_DB + {"innodb_autoextend_increment", OPT_INNODB_AUTOEXTEND_INCREMENT, + "Data file autoextend increment in megabytes", + (gptr*) &srv_auto_extend_increment, + (gptr*) &srv_auto_extend_increment, + 0, GET_LONG, REQUIRED_ARG, 8L, 1L, 1000L, 0, 1L, 0}, {"innodb_data_home_dir", OPT_INNODB_DATA_HOME_DIR, "The common part for Innodb table spaces", (gptr*) &innobase_data_home_dir, (gptr*) &innobase_data_home_dir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, diff --git a/sql/set_var.cc b/sql/set_var.cc index 122daa0ea95..aa6ddb63a04 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -265,6 +265,8 @@ sys_var_long_ptr sys_innodb_max_dirty_pages_pct("innodb_max_dirty_pages_p &srv_max_buf_pool_modified_pct); sys_var_long_ptr sys_innodb_max_purge_lag("innodb_max_purge_lag", &srv_max_purge_lag); +sys_var_long_ptr sys_innodb_autoextend_increment("innodb_autoextend_increment", + &srv_auto_extend_increment); sys_var_thd_bool sys_innodb_table_locks("innodb_table_locks", &SV::innodb_table_locks); #endif @@ -454,6 +456,7 @@ sys_var *sys_variables[]= #ifdef HAVE_INNOBASE_DB &sys_innodb_max_dirty_pages_pct, &sys_innodb_max_purge_lag, + &sys_innodb_autoextend_increment, &sys_innodb_table_locks, #endif &sys_unique_checks @@ -508,6 +511,7 @@ struct show_var_st init_vars[]= { {"init_file", (char*) &opt_init_file, SHOW_CHAR_PTR}, #ifdef HAVE_INNOBASE_DB {"innodb_additional_mem_pool_size", (char*) &innobase_additional_mem_pool_size, SHOW_LONG }, + {sys_innodb_autoextend_increment.name, (char*) &sys_innodb_autoextend_increment, SHOW_SYS}, {"innodb_buffer_pool_size", (char*) &innobase_buffer_pool_size, SHOW_LONG }, {"innodb_data_file_path", (char*) &innobase_data_file_path, SHOW_CHAR_PTR}, {"innodb_data_home_dir", (char*) &innobase_data_home_dir, SHOW_CHAR_PTR}, From e749259da6e32ee6035d41bc44b1ae8d4b30a443 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 25 Jan 2005 15:56:20 +0100 Subject: [PATCH 0837/1063] ndb - Move mysql-test-run & testBackup into "basic suite" ndb/test/run-test/atrt-mysql-test-run: Fix result handling ndb/test/run-test/daily-basic-tests.txt: Move mysql-test-run & testBackup into "basic" ndb/test/run-test/daily-devel-tests.txt: Move mysql-test-run & testBackup into "basic" --- ndb/test/run-test/atrt-mysql-test-run | 4 ++-- ndb/test/run-test/daily-basic-tests.txt | 8 ++++++++ ndb/test/run-test/daily-devel-tests.txt | 8 -------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/ndb/test/run-test/atrt-mysql-test-run b/ndb/test/run-test/atrt-mysql-test-run index dd7b709bd06..2ebc11b0070 100755 --- a/ndb/test/run-test/atrt-mysql-test-run +++ b/ndb/test/run-test/atrt-mysql-test-run @@ -5,8 +5,8 @@ p=`pwd` cd $MYSQL_BASE_DIR/mysql-test ./mysql-test-run --with-ndbcluster --ndb-connectstring=$NDB_CONNECTSTRING $* | tee $p/output.txt -f=`grep -c fail $p/output.txt` -o=`grep -c pass $p/output.txt` +f=`grep -c '\[ fail \]' $p/output.txt` +o=`grep -c '\[ pass \]' $p/output.txt` if [ $o -gt 0 -a $f -eq 0 ] then diff --git a/ndb/test/run-test/daily-basic-tests.txt b/ndb/test/run-test/daily-basic-tests.txt index 8a927b88194..87f86795370 100644 --- a/ndb/test/run-test/daily-basic-tests.txt +++ b/ndb/test/run-test/daily-basic-tests.txt @@ -1,3 +1,11 @@ +max-time: 25000 +cmd: atrt-mysql-test-run +args: --force + +max-time: 600 +cmd: atrt-testBackup +args: -n BackupOne T1 T6 T3 I3 + # BASIC FUNCTIONALITY max-time: 500 cmd: testBasic diff --git a/ndb/test/run-test/daily-devel-tests.txt b/ndb/test/run-test/daily-devel-tests.txt index 5c0b2821d85..5c9b36fb836 100644 --- a/ndb/test/run-test/daily-devel-tests.txt +++ b/ndb/test/run-test/daily-devel-tests.txt @@ -1,7 +1,3 @@ -max-time: 2500 -cmd: atrt-mysql-test-run -args: --do-test=ndb --force - # # INDEX # @@ -22,10 +18,6 @@ args: -n CreateLoadDrop T1 T10 # # BACKUP # -max-time: 600 -cmd: atrt-testBackup -args: -n BackupOne T1 T6 T3 I3 - max-time: 1000 cmd: atrt-testBackup args: -n BackupBank T6 From c2a2f5afb847b489cfddc88d8eb4b6309e298fe2 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 25 Jan 2005 21:27:51 +0200 Subject: [PATCH 0838/1063] Cleanups during review BitKeeper/etc/ignore: added libmysqld/examples/mysqltest_embedded client/mysqlbinlog.cc: Call mysql_close() before die() innobase/include/eval0eval.ic: Remove assert that fails on 64 bit machines (Tested with BUILD/compile-pentium64-valgrind-max on 64 bit Intel CPU) sql/mysqld.cc: Force lower_case_table_names to 0 if set to 2 on case insensitive file name sql/sql_select.cc: Remove #if 0 --- .bzrignore | 3 +++ client/mysqlbinlog.cc | 17 +++++++++++++---- innobase/include/eval0eval.ic | 2 -- sql/mysqld.cc | 9 ++++----- sql/sql_select.cc | 7 ------- 5 files changed, 20 insertions(+), 18 deletions(-) diff --git a/.bzrignore b/.bzrignore index 40b7668cb64..199da0dd558 100644 --- a/.bzrignore +++ b/.bzrignore @@ -1004,3 +1004,6 @@ vio/test-sslserver vio/viotest-ssl tests/mysql_client_test tests/mysql_client_test +libmysqld/examples/mysql_client_test.c +libmysqld/examples/mysql_client_test_embedded +libmysqld/examples/mysqltest_embedded diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index 7ddb01d9ec8..0b15ad893e2 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -687,7 +687,7 @@ static int parse_args(int *argc, char*** argv) static MYSQL* safe_connect() { - MYSQL *local_mysql = mysql_init(NULL); + MYSQL *local_mysql= mysql_init(NULL); if (!local_mysql) die("Failed on mysql_init"); @@ -695,8 +695,12 @@ static MYSQL* safe_connect() if (opt_protocol) mysql_options(local_mysql, MYSQL_OPT_PROTOCOL, (char*) &opt_protocol); if (!mysql_real_connect(local_mysql, host, user, pass, 0, port, sock, 0)) - die("failed on connect: %s", mysql_error(local_mysql)); - + { + char errmsg[256]; + strmake(errmsg, mysql_error(local_mysql), sizeof(errmsg)-1); + mysql_close(local_mysql); + die("failed on connect: %s", errmsg); + } return local_mysql; } @@ -717,7 +721,12 @@ static int check_master_version(MYSQL* mysql) if (mysql_query(mysql, "SELECT VERSION()") || !(res = mysql_store_result(mysql))) - die("Error checking master version: %s", mysql_error(mysql)); + { + char errmsg[256]; + strmake(errmsg, mysql_error(mysql), sizeof(errmsg)-1); + mysql_close(mysql); + die("Error checking master version: %s", errmsg); + } if (!(row = mysql_fetch_row(res))) { mysql_free_result(res); diff --git a/innobase/include/eval0eval.ic b/innobase/include/eval0eval.ic index 2530c869206..069cbfe5f37 100644 --- a/innobase/include/eval0eval.ic +++ b/innobase/include/eval0eval.ic @@ -205,8 +205,6 @@ eval_node_copy_and_alloc_val( { byte* data; - ut_ad(UNIV_SQL_NULL > ULINT_MAX); - if (len == UNIV_SQL_NULL) { dfield_set_len(que_node_get_val(node), len); diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 6d647b6edf0..c5ed516570a 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -2915,12 +2915,11 @@ You should consider changing lower_case_table_names to 1 or 2", (test_if_case_insensitive(mysql_real_data_home) == 1))) { if (global_system_variables.log_warnings) - sql_print_warning("\ -You have forced lower_case_table_names to 2 through a command-line \ -option, even though your file system '%s' is case sensitive. This means \ -that you can create a table that you can then no longer access. \ -You should consider changing lower_case_table_names to 0.", + sql_print_warning("lower_case_table_names was set to 2, even though your " + "the file system '%s' is case sensitive. Now setting " + "lower_case_table_names to 0 to avoid future problems.", mysql_real_data_home); + lower_case_table_names= 0; } select_thread=pthread_self(); diff --git a/sql/sql_select.cc b/sql/sql_select.cc index a53b878cf6c..e956d71a4be 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -2828,16 +2828,9 @@ find_best(JOIN *join,table_map rest_tables,uint idx,double record_count, x = used key parts (1 <= x <= c) */ double rec_per_key; -#if 0 - if (!(rec_per_key=(double) - keyinfo->rec_per_key[keyinfo->key_parts-1])) - rec_per_key=(double) s->records/rec+1; -#else rec_per_key= keyinfo->rec_per_key[keyinfo->key_parts-1] ? (double) keyinfo->rec_per_key[keyinfo->key_parts-1] : (double) s->records/rec+1; -#endif - if (!s->records) tmp=0; else if (rec_per_key/(double) s->records >= 0.01) From e1b8a004fea3aca320d3d8fa36dfd7932ab045ca Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 25 Jan 2005 12:06:55 -0800 Subject: [PATCH 0839/1063] Always call vio_in_addr() so that thd->remote is always initialized. (Bug #5569) vio/viosocket.c: Remove comment that is no longer correct sql/sql_parse.cc: Always call vio_in_addr() on successful connection, so that thd->remote always gets set vio/viossl.c: Remove comment that is no longer correct --- sql/sql_parse.cc | 5 +++-- vio/viosocket.c | 2 +- vio/viossl.c | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 1aeb158dc11..efb534ed439 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -501,6 +501,9 @@ check_connections(THD *thd) thd->thread_id)); DBUG_PRINT("info",("New connection received on %s", vio_description(net->vio))); + + vio_in_addr(net->vio,&thd->remote.sin_addr); + if (!thd->host) // If TCP/IP connection { char ip[30]; @@ -521,7 +524,6 @@ check_connections(THD *thd) #endif if (!(specialflag & SPECIAL_NO_RESOLVE)) { - vio_in_addr(net->vio,&thd->remote.sin_addr); thd->host=ip_to_hostname(&thd->remote.sin_addr,&connect_errors); /* Cut very long hostnames to avoid possible overflows */ if (thd->host) @@ -543,7 +545,6 @@ check_connections(THD *thd) DBUG_PRINT("info",("Host: %s",thd->host)); thd->host_or_ip= thd->host; thd->ip= 0; - bzero((char*) &thd->remote,sizeof(struct sockaddr)); } vio_keepalive(net->vio, TRUE); diff --git a/vio/viosocket.c b/vio/viosocket.c index ad156fc33bf..1b6f46c57cf 100644 --- a/vio/viosocket.c +++ b/vio/viosocket.c @@ -295,7 +295,7 @@ void vio_in_addr(Vio *vio, struct in_addr *in) { DBUG_ENTER("vio_in_addr"); if (vio->localhost) - bzero((char*) in, sizeof(*in)); /* This should never be executed */ + bzero((char*) in, sizeof(*in)); else *in=vio->remote.sin_addr; DBUG_VOID_RETURN; diff --git a/vio/viossl.c b/vio/viossl.c index a489cb98f98..07713c83763 100644 --- a/vio/viossl.c +++ b/vio/viossl.c @@ -259,7 +259,7 @@ void vio_ssl_in_addr(Vio *vio, struct in_addr *in) { DBUG_ENTER("vio_ssl_in_addr"); if (vio->localhost) - bzero((char*) in, sizeof(*in)); /* This should never be executed */ + bzero((char*) in, sizeof(*in)); else *in=vio->remote.sin_addr; DBUG_VOID_RETURN; From 7ff1db2d6262494380885d2a5b68d4e099f31c9e Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 25 Jan 2005 22:11:21 +0200 Subject: [PATCH 0840/1063] sql_class.h, set_var.cc, mysqld.cc: Add settable variables for semi-sync replication sql/mysqld.cc: Add settable variables for semi-sync replication sql/set_var.cc: Add settable variables for semi-sync replication sql/sql_class.h: Add settable variables for semi-sync replication --- sql/mysqld.cc | 21 ++++++++++++++++++++- sql/set_var.cc | 14 ++++++++++++++ sql/sql_class.h | 5 +++++ 3 files changed, 39 insertions(+), 1 deletion(-) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 21b1cb7ffd0..f7eab071808 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -4087,7 +4087,11 @@ enum options_mysqld OPT_RANGE_ALLOC_BLOCK_SIZE, OPT_QUERY_ALLOC_BLOCK_SIZE, OPT_QUERY_PREALLOC_SIZE, OPT_TRANS_ALLOC_BLOCK_SIZE, OPT_TRANS_PREALLOC_SIZE, - OPT_SYNC_FRM, OPT_SYNC_BINLOG, OPT_BDB_NOSYNC, + OPT_SYNC_FRM, OPT_SYNC_BINLOG, + OPT_SYNC_REPLICATION, + OPT_SYNC_REPLICATION_SLAVE_ID, + OPT_SYNC_REPLICATION_TIMEOUT, + OPT_BDB_NOSYNC, OPT_ENABLE_SHARED_MEMORY, OPT_SHARED_MEMORY_BASE_NAME, OPT_OLD_PASSWORDS, @@ -5200,6 +5204,21 @@ The minimum value for this variable is 4096.", (gptr*) &sync_binlog_period, (gptr*) &sync_binlog_period, 0, GET_ULONG, REQUIRED_ARG, 0, 0, ~0L, 0, 1, 0}, + {"sync-replication", OPT_SYNC_REPLICATION, + "Enable synchronous replication", + (gptr*) &global_system_variables.sync_replication, + (gptr*) &global_system_variables.sync_replication, + 0, GET_ULONG, REQUIRED_ARG, 0, 0, 1, 0, 1, 0}, + {"sync-replication-slave-id", OPT_SYNC_REPLICATION_SLAVE_ID, + "Synchronous replication is wished for this slave", + (gptr*) &global_system_variables.sync_replication_slave_id, + (gptr*) &global_system_variables.sync_replication_slave_id, + 0, GET_ULONG, REQUIRED_ARG, 0, 0, ~0L, 0, 1, 0}, + {"sync-replication-timeout", OPT_SYNC_REPLICATION_TIMEOUT, + "Synchronous replication timeout", + (gptr*) &global_system_variables.sync_replication_timeout, + (gptr*) &global_system_variables.sync_replication_timeout, + 0, GET_ULONG, REQUIRED_ARG, 10, 0, ~0L, 0, 1, 0}, {"sync-frm", OPT_SYNC_FRM, "Sync .frm to disk on create. Enabled by default", (gptr*) &opt_sync_frm, (gptr*) &opt_sync_frm, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, diff --git a/sql/set_var.cc b/sql/set_var.cc index 1237c31075c..1807e0efbed 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -333,6 +333,14 @@ sys_var_thd_storage_engine sys_storage_engine("storage_engine", &SV::table_type); #ifdef HAVE_REPLICATION sys_var_sync_binlog_period sys_sync_binlog_period("sync_binlog", &sync_binlog_period); +sys_var_thd_ulong sys_sync_replication("sync_replication", + &SV::sync_replication); +sys_var_thd_ulong sys_sync_replication_slave_id( + "sync_replication_slave_id", + &SV::sync_replication_slave_id); +sys_var_thd_ulong sys_sync_replication_timeout( + "sync_replication_timeout", + &SV::sync_replication_timeout); #endif sys_var_bool_ptr sys_sync_frm("sync_frm", &opt_sync_frm); sys_var_long_ptr sys_table_cache_size("table_cache", @@ -605,6 +613,9 @@ sys_var *sys_variables[]= &sys_storage_engine, #ifdef HAVE_REPLICATION &sys_sync_binlog_period, + &sys_sync_replication, + &sys_sync_replication_slave_id, + &sys_sync_replication_timeout, #endif &sys_sync_frm, &sys_table_cache_size, @@ -850,6 +861,9 @@ struct show_var_st init_vars[]= { {sys_storage_engine.name, (char*) &sys_storage_engine, SHOW_SYS}, #ifdef HAVE_REPLICATION {sys_sync_binlog_period.name,(char*) &sys_sync_binlog_period, SHOW_SYS}, + {sys_sync_replication.name, (char*) &sys_sync_replication, SHOW_SYS}, + {sys_sync_replication_slave_id.name, (char*) &sys_sync_replication_slave_id,SHOW_SYS}, + {sys_sync_replication_timeout.name, (char*) &sys_sync_replication_timeout,SHOW_SYS}, #endif {sys_sync_frm.name, (char*) &sys_sync_frm, SHOW_SYS}, #ifdef HAVE_TZNAME diff --git a/sql/sql_class.h b/sql/sql_class.h index ce60ed06cfd..8128690ab02 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -397,6 +397,11 @@ struct system_variables my_bool low_priority_updates; my_bool new_mode; my_bool query_cache_wlock_invalidate; +#ifdef HAVE_REPLICATION + ulong sync_replication; + ulong sync_replication_slave_id; + ulong sync_replication_timeout; +#endif /* HAVE_REPLICATION */ #ifdef HAVE_INNOBASE_DB my_bool innodb_table_locks; #endif /* HAVE_INNOBASE_DB */ From 577a20f0943006687059981949d3c93cb2ae58ab Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 25 Jan 2005 12:24:50 -0800 Subject: [PATCH 0841/1063] Add BUG# to subject and X-Bug header for all outgoing emails re: bug fixes, and update the URL for the manual page on installing from the source tree. Fake bug number for testing: Bug #1234 BitKeeper/triggers/post-commit: Update URL for docs page --- BitKeeper/triggers/post-commit | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/BitKeeper/triggers/post-commit b/BitKeeper/triggers/post-commit index 1c4608835d6..5dc351024e0 100755 --- a/BitKeeper/triggers/post-commit +++ b/BitKeeper/triggers/post-commit @@ -20,13 +20,19 @@ if [ "$BK_STATUS" = OK ] then CHANGESET=`bk -R prs -r+ -h -d':P:::I:' ChangeSet` -BUG=`bk -R prs -r+ -h -d':C:' ChangeSet | sed -ne 's/^.*[Bb][Uu][Gg] *# *\([0-9][0-9]*\).*$/ BUG#\1/p'` +BUG=`bk -R prs -r+ -h -d':C:' ChangeSet | sed -ne 's/^.*[Bb][Uu][Gg] *# *\([0-9][0-9]*\).*$/\1/p'` if [ "$BUG" = "" ] then TO=dev-public@mysql.com + BS="" + BH="" else TO=dev-bugs@mysql.com + BS=" BUG#$BUG" +# need newline here + BH="X-Bug: $BUG +" fi #++ # dev-public@ / dev-bugs@ @@ -37,8 +43,8 @@ fi List-ID: From: $FROM To: $TO -Subject: bk commit - $VERSION tree ($CHANGESET)$BUG - +Subject: bk commit - $VERSION tree ($CHANGESET)$BS +$BH EOF bk changes -v -r+ bk cset -r+ -d @@ -53,14 +59,15 @@ EOF List-ID: From: $FROM To: $INTERNALS -Subject: bk commit into $VERSION tree ($CHANGESET) +Subject: bk commit into $VERSION tree ($CHANGESET)$BS +$BH Below is the list of changes that have just been committed into a local $VERSION repository of $USER. When $USER 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://www.mysql.com/doc/I/n/Installing_source_tree.html +see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html EOF bk changes -v -r+ @@ -80,7 +87,7 @@ EOF List-ID: From: $FROM To: $DOCS -Subject: bk commit - $VERSION tree (Manual) ($CHANGESET) +Subject: bk commit - $VERSION tree (Manual) ($CHANGESET)$BS EOF bk changes -v -r+ From 7a220becd2905e1d198c296b0a5b790914340520 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 25 Jan 2005 22:42:50 +0200 Subject: [PATCH 0842/1063] buf0rea.c: Add more diagnostics about why page reads in recovery may hang: print the number of pending pread calls innobase/buf/buf0rea.c: Add more diagnostics about why page reads in recovery may hang: print the number of pending pread calls --- innobase/buf/buf0rea.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/innobase/buf/buf0rea.c b/innobase/buf/buf0rea.c index 58287d37387..055eede5c1a 100644 --- a/innobase/buf/buf0rea.c +++ b/innobase/buf/buf0rea.c @@ -679,7 +679,9 @@ buf_read_recv_pages( fprintf(stderr, "InnoDB: Error: InnoDB has waited for 50 seconds for pending\n" "InnoDB: reads to the buffer pool to be finished.\n" -"InnoDB: Number of pending reads %lu\n", (ulong) buf_pool->n_pend_reads); +"InnoDB: Number of pending reads %lu, pending pread calls %lu\n", + (ulong) buf_pool->n_pend_reads, + (ulong)os_file_n_pending_preads); os_aio_print_debug = TRUE; } From 8deafa8037b289d089ffeb8d6bdaee812113a9b0 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 25 Jan 2005 14:30:38 -0800 Subject: [PATCH 0843/1063] order_by.result, order_by.test: Added a test case for bug #7672. sql_yacc.yy: Fixed bug #7672. Made queries of the form (SELECT ...) ORDER BY ... to be equivalent to SELECT ... ORDER BY ... sql/sql_yacc.yy: Fixed bug #7672. Made queries of the form (SELECT ...) ORDER BY ... to be equivalent to SELECT ... ORDER BY ... mysql-test/t/order_by.test: Added a test case for bug #7672. mysql-test/r/order_by.result: Added a test case for bug #7672. --- mysql-test/r/order_by.result | 17 +++++++++++++++++ mysql-test/t/order_by.test | 13 ++++++++++++- sql/sql_yacc.yy | 13 ++++++++----- 3 files changed, 37 insertions(+), 6 deletions(-) diff --git a/mysql-test/r/order_by.result b/mysql-test/r/order_by.result index 859d9d4cab0..4ea638dbc19 100644 --- a/mysql-test/r/order_by.result +++ b/mysql-test/r/order_by.result @@ -554,3 +554,20 @@ explain select id,t from t1 force index (primary) order by id; table type possible_keys key key_len ref rows Extra t1 index NULL PRIMARY 4 NULL 1000 drop table t1; +CREATE TABLE t1 (a int); +INSERT INTO t1 VALUES (2), (1), (1), (2), (1); +SELECT a FROM t1 ORDER BY a; +a +1 +1 +1 +2 +2 +(SELECT a FROM t1) ORDER BY a; +a +1 +1 +1 +2 +2 +DROP TABLE t1; diff --git a/mysql-test/t/order_by.test b/mysql-test/t/order_by.test index 86ecc4aa70d..d65b2c257a1 100644 --- a/mysql-test/t/order_by.test +++ b/mysql-test/t/order_by.test @@ -363,4 +363,15 @@ while ($1) enable_query_log; explain select id,t from t1 order by id; explain select id,t from t1 force index (primary) order by id; -drop table t1; \ No newline at end of file +drop table t1; + +# +# Bug #7672 - a wrong result for a select query in braces followed by order by +# + +CREATE TABLE t1 (a int); +INSERT INTO t1 VALUES (2), (1), (1), (2), (1); +SELECT a FROM t1 ORDER BY a; +(SELECT a FROM t1) ORDER BY a; +DROP TABLE t1; + diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 7b72c73a915..6d0237f5615 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -4033,11 +4033,14 @@ optional_order_or_limit: send_error(&lex->thd->net, ER_SYNTAX_ERROR); YYABORT; } - if (mysql_new_select(lex)) - YYABORT; - mysql_init_select(lex); - lex->select->linkage=NOT_A_SELECT; - lex->select->select_limit=lex->thd->variables.select_limit; + if (lex->select != &lex->select_lex) + { + if (mysql_new_select(lex)) + YYABORT; + mysql_init_select(lex); + lex->select->linkage=NOT_A_SELECT; + lex->select->select_limit=lex->thd->variables.select_limit; + } } opt_order_clause limit_clause ; From 235edc214452a870745264adc3841fed12925d4b Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 25 Jan 2005 23:13:36 -0800 Subject: [PATCH 0844/1063] order_by.result, order_by.test: Added test case for bug #7672 that existed only in 4.0. mysql-test/t/order_by.test: Added test case for bug #7672 that existed only in 4.0. mysql-test/r/order_by.result: Added test case for bug #7672 that existed only in 4.0. --- mysql-test/r/order_by.result | 17 +++++++++++++++++ mysql-test/t/order_by.test | 10 ++++++++++ 2 files changed, 27 insertions(+) diff --git a/mysql-test/r/order_by.result b/mysql-test/r/order_by.result index ab71a6b53e6..ee8ca5f0328 100644 --- a/mysql-test/r/order_by.result +++ b/mysql-test/r/order_by.result @@ -771,3 +771,20 @@ sid wnid 39560 01019090000 37994 01019090000 drop table t1; +CREATE TABLE t1 (a int); +INSERT INTO t1 VALUES (2), (1), (1), (2), (1); +SELECT a FROM t1 ORDER BY a; +a +1 +1 +1 +2 +2 +(SELECT a FROM t1) ORDER BY a; +a +1 +1 +1 +2 +2 +DROP TABLE t1; diff --git a/mysql-test/t/order_by.test b/mysql-test/t/order_by.test index ab5e93603e4..c6a77c71b2f 100644 --- a/mysql-test/t/order_by.test +++ b/mysql-test/t/order_by.test @@ -534,3 +534,13 @@ explain select * from t1 where wnid like '0101%' order by wnid; select * from t1 where wnid like '0101%' order by wnid; drop table t1; + +# +# Bug #7672 - a wrong result for a select query in braces followed by order by +# + +CREATE TABLE t1 (a int); +INSERT INTO t1 VALUES (2), (1), (1), (2), (1); +SELECT a FROM t1 ORDER BY a; +(SELECT a FROM t1) ORDER BY a; +DROP TABLE t1; From ea2795025e4172437f69e6c5819671c5b93c8aae Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 26 Jan 2005 08:57:43 +0100 Subject: [PATCH 0845/1063] innobase/include/univ.i remove a change that broke the test innobase/include/univ.i: remove a change that broke the test sql/item_create.cc: better fix --- innobase/include/univ.i | 6 ++---- sql/item_create.cc | 5 +++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/innobase/include/univ.i b/innobase/include/univ.i index c6ab258d3b7..625978ffc38 100644 --- a/innobase/include/univ.i +++ b/innobase/include/univ.i @@ -80,10 +80,8 @@ memory is read outside the allocated blocks. */ /* Make a non-inline debug version */ -#ifdef DBUG_ON -# define UNIV_DEBUG -#endif /* DBUG_ON */ /* +#define UNIV_DEBUG #define UNIV_MEM_DEBUG #define UNIV_IBUF_DEBUG #define UNIV_SYNC_DEBUG @@ -121,7 +119,7 @@ by one. */ /* Definition for inline version */ #ifdef __WIN__ -#define UNIV_INLINE __inline +#define UNIV_INLINE __inline #else /* config.h contains the right def for 'inline' for the current compiler */ #if (__GNUC__ == 2) diff --git a/sql/item_create.cc b/sql/item_create.cc index 99db184e71f..d959a6f393a 100644 --- a/sql/item_create.cc +++ b/sql/item_create.cc @@ -377,13 +377,14 @@ Item *create_func_space(Item *a) { uint dummy_errors; sp= new Item_string("",0,cs); - sp->str_value.copy(" ", 1, &my_charset_latin1, cs, &dummy_errors); + if (sp) + sp->str_value.copy(" ", 1, &my_charset_latin1, cs, &dummy_errors); } else { sp= new Item_string(" ",1,cs); } - return new Item_func_repeat(sp, a); + return sp ? new Item_func_repeat(sp, a) : 0; } Item *create_func_soundex(Item* a) From d041ed2d8cddc67fe9dacbf2060927b84139f3f4 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 26 Jan 2005 11:31:46 +0100 Subject: [PATCH 0846/1063] Bug#8101 unique indexes which attribute are _not_ specified in the order of the table does not work --- mysql-test/r/ndb_index_unique.result | 14 ++++++++ mysql-test/t/ndb_index_unique.test | 21 +++++++++++ sql/ha_ndbcluster.cc | 54 +++++++++++++++++++++++++--- sql/ha_ndbcluster.h | 1 + 4 files changed, 85 insertions(+), 5 deletions(-) diff --git a/mysql-test/r/ndb_index_unique.result b/mysql-test/r/ndb_index_unique.result index f9cc89ee4cc..598b9dcccf7 100644 --- a/mysql-test/r/ndb_index_unique.result +++ b/mysql-test/r/ndb_index_unique.result @@ -612,3 +612,17 @@ a b c 3 NULL NULL 4 4 NULL drop table t1, t8; +create table t1( +id integer not null auto_increment, +month integer not null, +year integer not null, +code varchar( 2) not null, +primary key ( id), +unique idx_t1( month, code, year) +) engine=ndb; +INSERT INTO t1 (month, year, code) VALUES (4,2004,'12'); +INSERT INTO t1 (month, year, code) VALUES (5,2004,'12'); +select * from t1 where code = '12' and month = 4 and year = 2004 ; +id month year code +1 4 2004 12 +drop table t1; diff --git a/mysql-test/t/ndb_index_unique.test b/mysql-test/t/ndb_index_unique.test index f235d1ffc30..9bbea75028b 100644 --- a/mysql-test/t/ndb_index_unique.test +++ b/mysql-test/t/ndb_index_unique.test @@ -286,3 +286,24 @@ select * from t8 order by a; select * from t1 order by a; drop table t1, t8; +############################### +# Bug 8101 +# +# Unique index not specified in the same order as in table +# + +create table t1( + id integer not null auto_increment, + month integer not null, + year integer not null, + code varchar( 2) not null, + primary key ( id), + unique idx_t1( month, code, year) +) engine=ndb; + +INSERT INTO t1 (month, year, code) VALUES (4,2004,'12'); +INSERT INTO t1 (month, year, code) VALUES (5,2004,'12'); + +select * from t1 where code = '12' and month = 4 and year = 2004 ; + +drop table t1; diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index c5bb4984f40..437b5ebcdf7 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -765,6 +765,42 @@ int ha_ndbcluster::get_metadata(const char *path) DBUG_RETURN(build_index_list(table, ILBP_OPEN)); } +static int fix_unique_index_attr_order(NDB_INDEX_DATA &data, + const NDBINDEX *index, + KEY *key_info) +{ + DBUG_ENTER("fix_unique_index_attr_order"); + unsigned sz= index->getNoOfIndexColumns(); + + if (data.unique_index_attrid_map) + my_free((char*)data.unique_index_attrid_map, MYF(0)); + data.unique_index_attrid_map= (unsigned char*)my_malloc(sz,MYF(MY_WME)); + + KEY_PART_INFO* key_part= key_info->key_part; + KEY_PART_INFO* end= key_part+key_info->key_parts; + DBUG_ASSERT(key_info->key_parts == sz); + for (unsigned i= 0; key_part != end; key_part++, i++) + { + const char *field_name= key_part->field->field_name; + unsigned name_sz= strlen(field_name); + if (name_sz >= NDB_MAX_ATTR_NAME_SIZE) + name_sz= NDB_MAX_ATTR_NAME_SIZE-1; +#ifndef DBUG_OFF + data.unique_index_attrid_map[i]= 255; +#endif + for (unsigned j= 0; j < sz; j++) + { + const NdbDictionary::Column *c= index->getColumn(j); + if (strncmp(field_name, c->getName(), name_sz) == 0) + { + data.unique_index_attrid_map[i]= j; + break; + } + } + DBUG_ASSERT(data.unique_index_attrid_map[i] != 255); + } + DBUG_RETURN(0); +} int ha_ndbcluster::build_index_list(TABLE *tab, enum ILBP phase) { @@ -839,7 +875,8 @@ int ha_ndbcluster::build_index_list(TABLE *tab, enum ILBP phase) const NDBINDEX *index= dict->getIndex(unique_index_name, m_tabname); if (!index) DBUG_RETURN(1); m_index[i].unique_index= (void *) index; - } + error= fix_unique_index_attr_order(m_index[i], index, key_info); + } } DBUG_RETURN(error); @@ -897,6 +934,11 @@ void ha_ndbcluster::release_metadata() { m_index[i].unique_index= NULL; m_index[i].index= NULL; + if (m_index[i].unique_index_attrid_map) + { + my_free((char *)m_index[i].unique_index_attrid_map, MYF(0)); + m_index[i].unique_index_attrid_map= NULL; + } } DBUG_VOID_RETURN; @@ -1209,7 +1251,8 @@ int ha_ndbcluster::unique_index_read(const byte *key, for (i= 0; key_part != end; key_part++, i++) { - if (set_ndb_key(op, key_part->field, i, + if (set_ndb_key(op, key_part->field, + m_index[active_index].unique_index_attrid_map[i], key_part->null_bit ? key_ptr + 1 : key_ptr)) ERR_RETURN(trans->getNdbError()); key_ptr+= key_part->store_length; @@ -3836,9 +3879,10 @@ ha_ndbcluster::ha_ndbcluster(TABLE *table_arg): for (i= 0; i < MAX_KEY; i++) { - m_index[i].type= UNDEFINED_INDEX; - m_index[i].unique_index= NULL; - m_index[i].index= NULL; + m_index[i].type= UNDEFINED_INDEX; + m_index[i].unique_index= NULL; + m_index[i].index= NULL; + m_index[i].unique_index_attrid_map= NULL; } DBUG_VOID_RETURN; diff --git a/sql/ha_ndbcluster.h b/sql/ha_ndbcluster.h index 15e61a93574..07b305bad3e 100644 --- a/sql/ha_ndbcluster.h +++ b/sql/ha_ndbcluster.h @@ -52,6 +52,7 @@ typedef struct ndb_index_data { NDB_INDEX_TYPE type; void *index; void *unique_index; + unsigned char *unique_index_attrid_map; } NDB_INDEX_DATA; typedef struct st_ndbcluster_share { From d9274b337c4c1acf36c500df590b66e2fa30fafb Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 26 Jan 2005 12:55:35 +0200 Subject: [PATCH 0847/1063] Added -DDBUG_ON to CXXFLAGS when compiling with debugging This fixes a memory allocation bug in Innobase as structs was defined differently in .c and .cc files --- configure.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index cc845a7bb8d..3e9ea6eebe7 100644 --- a/configure.in +++ b/configure.in @@ -1681,12 +1681,12 @@ if test "$with_debug" = "yes" then # Medium debug. CFLAGS="$DEBUG_CFLAGS $DEBUG_OPTIMIZE_CC -DDBUG_ON -DSAFE_MUTEX $CFLAGS" - CXXFLAGS="$DEBUG_CXXFLAGS $DEBUG_OPTIMIZE_CXX -DSAFE_MUTEX $CXXFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $DEBUG_OPTIMIZE_CXX -DDBUG_ON -DSAFE_MUTEX $CXXFLAGS" elif test "$with_debug" = "full" then # Full debug. Very slow in some cases CFLAGS="$DEBUG_CFLAGS -DDBUG_ON -DSAFE_MUTEX -DSAFEMALLOC $CFLAGS" - CXXFLAGS="$DEBUG_CXXFLAGS -DSAFE_MUTEX -DSAFEMALLOC $CXXFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS -DDBUG_ON -DSAFE_MUTEX -DSAFEMALLOC $CXXFLAGS" else # Optimized version. No debug CFLAGS="$OPTIMIZE_CFLAGS -DDBUG_OFF $CFLAGS" From 755c9aabe27eaf0587b6f8331e1d688e855e6ed1 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 26 Jan 2005 15:27:45 +0200 Subject: [PATCH 0848/1063] fixed cleanup of result object of subqueries. (BUG#8125) mysql-test/r/subselect.result: cleaning up of results of subselects test mysql-test/t/subselect.test: cleaning up of results of subselects test sql/item_subselect.cc: call result object cleupup on engine cleunup sql/sql_class.cc: added cleanup of select_max_min_finder_subselect sql/sql_class.h: added cleanup of select_max_min_finder_subselect --- mysql-test/r/subselect.result | 12 ++++++++++++ mysql-test/t/subselect.test | 14 ++++++++++++++ sql/item_subselect.cc | 6 ++++++ sql/sql_class.cc | 8 ++++++++ sql/sql_class.h | 1 + 5 files changed, 41 insertions(+) diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index 03dcc23c919..437fd624ae1 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -2196,3 +2196,15 @@ ERROR 42S22: Reference 'xx' not supported (forward reference in item list) select 1 = ALL (select 1 from t1 where 1 = xx ), 1 as xx from DUAL; ERROR 42S22: Reference 'xx' not supported (forward reference in item list) drop table t1; +CREATE TABLE `t1` ( `a` char(3) NOT NULL default '', `b` char(3) NOT NULL default '', `c` char(3) NOT NULL default '', PRIMARY KEY (`a`,`b`,`c`)) ENGINE=InnoDB; +CREATE TABLE t2 LIKE t1; +INSERT INTO t1 VALUES (1,1,1); +INSERT INTO t2 VALUES (1,1,1); +PREPARE my_stmt FROM "SELECT t1.b, count(*) FROM t1 group by t1.b having +count(*) > ALL (SELECT COUNT(*) FROM t2 WHERE t2.a=1 GROUP By t2.b)"; +EXECUTE my_stmt; +b count(*) +EXECUTE my_stmt; +b count(*) +deallocate prepare my_stmt; +drop table t1,t2; diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test index 55400dae0be..cdec080611d 100644 --- a/mysql-test/t/subselect.test +++ b/mysql-test/t/subselect.test @@ -1465,3 +1465,17 @@ select 1 = ALL (select 1 from t1 where 1 = xx ), 1 as xx; -- error 1247 select 1 = ALL (select 1 from t1 where 1 = xx ), 1 as xx from DUAL; drop table t1; + +# +# cleaning up of results of subselects (BUG#8125) +# +CREATE TABLE `t1` ( `a` char(3) NOT NULL default '', `b` char(3) NOT NULL default '', `c` char(3) NOT NULL default '', PRIMARY KEY (`a`,`b`,`c`)) ENGINE=InnoDB; +CREATE TABLE t2 LIKE t1; +INSERT INTO t1 VALUES (1,1,1); +INSERT INTO t2 VALUES (1,1,1); +PREPARE my_stmt FROM "SELECT t1.b, count(*) FROM t1 group by t1.b having +count(*) > ALL (SELECT COUNT(*) FROM t2 WHERE t2.a=1 GROUP By t2.b)"; +EXECUTE my_stmt; +EXECUTE my_stmt; +deallocate prepare my_stmt; +drop table t1,t2; diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index 659d67eaf37..16186b1a6d3 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -1127,6 +1127,7 @@ void subselect_single_select_engine::cleanup() DBUG_ENTER("subselect_single_select_engine::cleanup"); prepared= optimized= executed= 0; join= 0; + result->cleanup(); DBUG_VOID_RETURN; } @@ -1135,6 +1136,7 @@ void subselect_union_engine::cleanup() { DBUG_ENTER("subselect_union_engine::cleanup"); unit->reinit_exec_mechanism(); + result->cleanup(); DBUG_VOID_RETURN; } @@ -1142,6 +1144,10 @@ void subselect_union_engine::cleanup() void subselect_uniquesubquery_engine::cleanup() { DBUG_ENTER("subselect_uniquesubquery_engine::cleanup"); + /* + subselect_uniquesubquery_engine have not 'result' assigbed, so we do not + cleanup() it + */ DBUG_VOID_RETURN; } diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 596097d9dc2..e11d8369f57 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -1240,6 +1240,14 @@ bool select_singlerow_subselect::send_data(List &items) } +void select_max_min_finder_subselect::cleanup() +{ + DBUG_ENTER("select_max_min_finder_subselect::cleanup"); + cache= 0; + DBUG_VOID_RETURN; +} + + bool select_max_min_finder_subselect::send_data(List &items) { DBUG_ENTER("select_max_min_finder_subselect::send_data"); diff --git a/sql/sql_class.h b/sql/sql_class.h index ce60ed06cfd..55099791ae0 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -1381,6 +1381,7 @@ public: select_max_min_finder_subselect(Item_subselect *item, bool mx) :select_subselect(item), cache(0), fmax(mx) {} + void cleanup(); bool send_data(List &items); bool cmp_real(); bool cmp_int(); From 3c3ca269ec47566ed9a588c52c3671ca4225e53a Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 26 Jan 2005 16:07:53 +0200 Subject: [PATCH 0849/1063] Only enable Innodb extra debugging when using the --debug=full configure option BUILD/SETUP.sh: Abort if wrong options BUILD/compile-pentium64-debug: Always use full debugging innobase/fil/fil0fil.c: Fixed wrong printf() format --- BUILD/SETUP.sh | 8 ++++++-- BUILD/compile-pentium64-debug | 2 +- configure.in | 4 ++-- innobase/fil/fil0fil.c | 6 +++--- innobase/include/univ.i | 4 ++++ 5 files changed, 16 insertions(+), 8 deletions(-) mode change 100644 => 100755 BUILD/SETUP.sh diff --git a/BUILD/SETUP.sh b/BUILD/SETUP.sh old mode 100644 new mode 100755 index 5fe898878b9..77fab948121 --- a/BUILD/SETUP.sh +++ b/BUILD/SETUP.sh @@ -25,7 +25,10 @@ Any other options will be passed directly to configure. Note: this script is intended for internal use by MySQL developers. EOF --with-debug=full ) full_debug="=full"; shift ;; - * ) break ;; + * ) + echo "Unknown option '$1'" + exit 1 + break ;; esac done @@ -62,6 +65,7 @@ fast_cflags="-O3 -fno-omit-frame-pointer" reckless_cflags="-O3 -fomit-frame-pointer " debug_cflags="-DUNIV_MUST_NOT_INLINE -DEXTRA_DEBUG -DFORCE_INIT_OF_VARS -DSAFEMALLOC -DPEDANTIC_SAFEMALLOC -DSAFE_MUTEX" +debug_extra_cflags="-O1 -Wuninitialized" base_cxxflags="-felide-constructors -fno-exceptions -fno-rtti" amd64_cxxflags="-DBIG_TABLES" @@ -80,7 +84,7 @@ local_infile_configs="--enable-local-infile" debug_configs="--with-debug$full_debug" if [ -z "$full_debug" ] then - debug_cflags="$debug_cflags -O1 -Wuninitialized" + debug_cflags="$debug_cflags $debug_extra_cflags" fi if gmake --version > /dev/null 2>&1 diff --git a/BUILD/compile-pentium64-debug b/BUILD/compile-pentium64-debug index 1bbca36d851..0299669f79a 100755 --- a/BUILD/compile-pentium64-debug +++ b/BUILD/compile-pentium64-debug @@ -1,7 +1,7 @@ #! /bin/sh path=`dirname $0` -. "$path/SETUP.sh" +. "$path/SETUP.sh" $@ --with-debug=full extra_flags="$pentium64_cflags $debug_cflags" c_warnings="$c_warnings $debug_extra_warnings" diff --git a/configure.in b/configure.in index 3e9ea6eebe7..985b5923c5c 100644 --- a/configure.in +++ b/configure.in @@ -1685,8 +1685,8 @@ then elif test "$with_debug" = "full" then # Full debug. Very slow in some cases - CFLAGS="$DEBUG_CFLAGS -DDBUG_ON -DSAFE_MUTEX -DSAFEMALLOC $CFLAGS" - CXXFLAGS="$DEBUG_CXXFLAGS -DDBUG_ON -DSAFE_MUTEX -DSAFEMALLOC $CXXFLAGS" + CFLAGS="$DEBUG_CFLAGS -DDBUG_ON -DSAFE_MUTEX -DSAFEMALLOC -DUNIV_DEBUG $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS -DDBUG_ON -DSAFE_MUTEX -DSAFEMALLOC -DUNIV_DEBUG $CXXFLAGS" else # Optimized version. No debug CFLAGS="$OPTIMIZE_CFLAGS -DDBUG_OFF $CFLAGS" diff --git a/innobase/fil/fil0fil.c b/innobase/fil/fil0fil.c index 5f71c00aea6..cc1c4a22983 100644 --- a/innobase/fil/fil0fil.c +++ b/innobase/fil/fil0fil.c @@ -685,9 +685,9 @@ fil_try_to_close_file_in_LRU( fputs("InnoDB: cannot close file ", stderr); ut_print_filename(stderr, node->name); fprintf(stderr, - ", because mod_count %lld != fl_count %lld\n", - node->modification_counter, - node->flush_counter); + ", because mod_count %ld != fl_count %ld\n", + (ulong) node->modification_counter, + (ulong) node->flush_counter); } node = UT_LIST_GET_PREV(LRU, node); diff --git a/innobase/include/univ.i b/innobase/include/univ.i index 625978ffc38..6ae4fe1c2ce 100644 --- a/innobase/include/univ.i +++ b/innobase/include/univ.i @@ -80,6 +80,10 @@ memory is read outside the allocated blocks. */ /* Make a non-inline debug version */ +#ifdef DBUG_ON +#define UNIV_DEBUG +#endif /* DBUG_ON */ + /* #define UNIV_DEBUG #define UNIV_MEM_DEBUG From b6e00331717eebcb6a48960db6b860c4c73c7054 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 26 Jan 2005 15:27:31 +0100 Subject: [PATCH 0850/1063] Test Bug: Memory leaks in the archive handler. Moved initialization code into a new init function. Added a new cleanup function. Added a call to close the meta file. mysql-test/t/archive.test: Test Bug: Memory leaks in the archive handler. Fixed a typo. sql/examples/ha_archive.h: Test Bug: Memory leaks in the archive handler. Added declarations for the new init/cleanup functions. sql/handler.cc: Test Bug: Memory leaks in the archive handler. Added calls of the new init/cleanup functions. --- mysql-test/t/archive.test | 2 +- sql/examples/ha_archive.cc | 59 ++++++++++++++++++++++++++------------ sql/examples/ha_archive.h | 4 +++ sql/handler.cc | 14 +++++++++ 4 files changed, 60 insertions(+), 19 deletions(-) diff --git a/mysql-test/t/archive.test b/mysql-test/t/archive.test index f55aea6e104..ee78b53f9c8 100644 --- a/mysql-test/t/archive.test +++ b/mysql-test/t/archive.test @@ -1,6 +1,6 @@ # # Simple test for archive example -# Taken fromm the select test +# Taken from the select test # -- source include/have_archive.inc diff --git a/sql/examples/ha_archive.cc b/sql/examples/ha_archive.cc index ef609513489..e8d07a99048 100644 --- a/sql/examples/ha_archive.cc +++ b/sql/examples/ha_archive.cc @@ -116,7 +116,6 @@ /* Variables for archive share methods */ pthread_mutex_t archive_mutex; static HASH archive_open_tables; -static int archive_init= 0; /* The file extension */ #define ARZ ".ARZ" // The data file @@ -142,6 +141,46 @@ static byte* archive_get_key(ARCHIVE_SHARE *share,uint *length, return (byte*) share->table_name; } + +/* + Initialize the archive handler. + + SYNOPSIS + archive_db_init() + void + + RETURN + FALSE OK + TRUE Error +*/ + +bool archive_db_init() +{ + VOID(pthread_mutex_init(&archive_mutex, MY_MUTEX_INIT_FAST)); + return (hash_init(&archive_open_tables, system_charset_info, 32, 0, 0, + (hash_get_key) archive_get_key, 0, 0)); +} + + +/* + Release the archive handler. + + SYNOPSIS + archive_db_end() + void + + RETURN + FALSE OK +*/ + +bool archive_db_end() +{ + hash_free(&archive_open_tables); + VOID(pthread_mutex_destroy(&archive_mutex)); + return FALSE; +} + + /* This method reads the header of a datafile and returns whether or not it was successful. */ @@ -269,23 +308,6 @@ ARCHIVE_SHARE *ha_archive::get_share(const char *table_name, TABLE *table) uint length; char *tmp_name; - if (!archive_init) - { - /* Hijack a mutex for init'ing the storage engine */ - pthread_mutex_lock(&LOCK_mysql_create_db); - if (!archive_init) - { - VOID(pthread_mutex_init(&archive_mutex,MY_MUTEX_INIT_FAST)); - if (hash_init(&archive_open_tables,system_charset_info,32,0,0, - (hash_get_key) archive_get_key,0,0)) - { - pthread_mutex_unlock(&LOCK_mysql_create_db); - return NULL; - } - archive_init++; - } - pthread_mutex_unlock(&LOCK_mysql_create_db); - } pthread_mutex_lock(&archive_mutex); length=(uint) strlen(table_name); @@ -379,6 +401,7 @@ int ha_archive::free_share(ARCHIVE_SHARE *share) (void)write_meta_file(share->meta_file, share->rows_recorded, FALSE); if (gzclose(share->archive_write) == Z_ERRNO) rc= 1; + my_close(share->meta_file,MYF(0)); my_free((gptr) share, MYF(0)); } pthread_mutex_unlock(&archive_mutex); diff --git a/sql/examples/ha_archive.h b/sql/examples/ha_archive.h index b619de5f6c1..855d756368d 100644 --- a/sql/examples/ha_archive.h +++ b/sql/examples/ha_archive.h @@ -125,3 +125,7 @@ public: THR_LOCK_DATA **store_lock(THD *thd, THR_LOCK_DATA **to, enum thr_lock_type lock_type); }; + +bool archive_db_init(void); +bool archive_db_end(void); + diff --git a/sql/handler.cc b/sql/handler.cc index 3200c6932e9..70ba236a5d5 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -277,6 +277,16 @@ int ha_init() else opt_using_transactions=1; } +#endif +#ifdef HAVE_ARCHIVE_DB + if (have_archive_db == SHOW_OPTION_YES) + { + if (archive_db_init()) + { + have_archive_db= SHOW_OPTION_DISABLED; + error= 1; + } + } #endif return error; } @@ -308,6 +318,10 @@ int ha_panic(enum ha_panic_function flag) #ifdef HAVE_NDBCLUSTER_DB if (have_ndbcluster == SHOW_OPTION_YES) error|=ndbcluster_end(); +#endif +#ifdef HAVE_ARCHIVE_DB + if (have_archive_db == SHOW_OPTION_YES) + error|= archive_db_end(); #endif return error; } /* ha_panic */ From 20bd0bd6fd693eec59ed1de47a27b46f2af6df3b Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 26 Jan 2005 22:25:02 +0300 Subject: [PATCH 0851/1063] Fix for bug #7899 "CREATE TABLE .. SELECT .. and CONVERT_TZ() function does not work well together". Now using simplier and more correct implementation of st_lex::unlink_first_table()/link_first_table_back() (It also nicely handles case when global table list is created because of implictly used time zone tables). (2nd attempt) Fix for bug #7705 "CONVERT_TZ() crashes with subquery/WHERE on index column". Implemented new approach for caching objects for constant time zone arguments. Now instead of determining whenever these arguments are constants and performing time zone lookup at fix_fields() stage, we do it on first get_date() invocation. Cleanup of global @@time_zone variable handling. mysql-test/r/timezone2.result: Added test for bugs #7705 "CONVERT_TZ() crashes with subquery/WHERE on index column" and #7899 "CREATE TABLE .. SELECT .. and CONVERT_TZ() function does not work well together". mysql-test/t/timezone2.test: Added test for bugs #7705 "CONVERT_TZ() crashes with subquery/WHERE on index column" and #7899 "CREATE TABLE .. SELECT .. and CONVERT_TZ() function does not work well together". sql/item_timefunc.cc: Item_func_convert_tz(): New approach for caching objects for constant time zone arguments. Now instead of determining whenever these arguments are constants and performing time zone lookup at fix_fields() stage, we do it on first get_date() invocation. This works better in cases when const_item() for these arguments returns true only on get_date() stage but not on fix_fields() stage (e.g. this happens in quries with joins or derived tables). sql/item_timefunc.h: Item_func_convert_tz(): Added from_tz_cached/to_tz_cached members indicating whenever we already have Time_zone object representing one of constant time zone arguments. sql/set_var.cc: Cleaned up global @@time_zone variable handling. Now we use proper locking when we are setting or reading its value. sql/set_var.h: Removed declaration of sys_var_thd_time_zone::get_tz_ptr() method, which no longer used. sql/sql_lex.cc: st_lex::unlink_first_table(), st_lex::link_first_table_back(): Simplify implementation according to Monty's suggestion. Instead doing something special if global and local table lists are the same, we simply save/restore pointers to first elements of both global and local lists (which works even when this lists are the same!). This handles nicely the case when we have separate global table list becuase time zone tables are implicitly used. sql/tztime.cc: Backport of Monty's fixes from 5.0, which give us nicer error messages if we haven't found time zone with such name or its description. --- mysql-test/r/timezone2.result | 8 ++++++++ mysql-test/t/timezone2.test | 17 +++++++++++++++++ sql/item_timefunc.cc | 30 +++++++++++++++++++----------- sql/item_timefunc.h | 8 ++++++-- sql/set_var.cc | 28 +++++++++++++++++----------- sql/set_var.h | 1 - sql/sql_lex.cc | 35 +++++++++++++---------------------- sql/tztime.cc | 10 ++++++++-- 8 files changed, 88 insertions(+), 49 deletions(-) diff --git a/mysql-test/r/timezone2.result b/mysql-test/r/timezone2.result index a1a2fec739f..206ff79e7ba 100644 --- a/mysql-test/r/timezone2.result +++ b/mysql-test/r/timezone2.result @@ -303,3 +303,11 @@ delete from mysql.db where user like 'mysqltest\_%'; delete from mysql.tables_priv where user like 'mysqltest\_%'; flush privileges; drop table t1, t2; +select convert_tz('2005-01-14 17:00:00', 'UTC', custTimeZone) from (select 'UTC' as custTimeZone) as tmp; +convert_tz('2005-01-14 17:00:00', 'UTC', custTimeZone) +2005-01-14 17:00:00 +create table t1 select convert_tz(NULL, NULL, NULL); +select * from t1; +convert_tz(NULL, NULL, NULL) +NULL +drop table t1; diff --git a/mysql-test/t/timezone2.test b/mysql-test/t/timezone2.test index d185a647921..32ed359a2db 100644 --- a/mysql-test/t/timezone2.test +++ b/mysql-test/t/timezone2.test @@ -266,3 +266,20 @@ delete from mysql.db where user like 'mysqltest\_%'; delete from mysql.tables_priv where user like 'mysqltest\_%'; flush privileges; drop table t1, t2; + +# +# Test for bug #7705 "CONVERT_TZ() crashes with subquery/WHERE on index +# column". Queries in which one of time zone arguments of CONVERT_TZ() is +# determined as constant only at val() stage (not at fix_fields() stage), +# should not crash server. +# +select convert_tz('2005-01-14 17:00:00', 'UTC', custTimeZone) from (select 'UTC' as custTimeZone) as tmp; + +# +# Test for bug #7899 "CREATE TABLE .. SELECT .. and CONVERT_TZ() function +# does not work well together". The following statement should return only +# one NULL row and not result of full join. +# +create table t1 select convert_tz(NULL, NULL, NULL); +select * from t1; +drop table t1; diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index 0d652a431cb..80563b9cc83 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -1656,6 +1656,7 @@ void Item_func_convert_tz::fix_length_and_dec() collation.set(&my_charset_bin); decimals= 0; max_length= MAX_DATETIME_WIDTH*MY_CHARSET_BIN_MB_MAXLEN; + maybe_null= 1; } @@ -1668,12 +1669,6 @@ Item_func_convert_tz::fix_fields(THD *thd_arg, TABLE_LIST *tables_arg, Item **re tz_tables= thd_arg->lex->time_zone_tables_used; - if (args[1]->const_item()) - from_tz= my_tz_find(args[1]->val_str(&str), tz_tables); - - if (args[2]->const_item()) - to_tz= my_tz_find(args[2]->val_str(&str), tz_tables); - return 0; } @@ -1713,13 +1708,19 @@ bool Item_func_convert_tz::get_date(TIME *ltime, my_time_t my_time_tmp; bool not_used; String str; - - if (!args[1]->const_item()) + + if (!from_tz_cached) + { from_tz= my_tz_find(args[1]->val_str(&str), tz_tables); - - if (!args[2]->const_item()) + from_tz_cached= args[1]->const_item(); + } + + if (!to_tz_cached) + { to_tz= my_tz_find(args[2]->val_str(&str), tz_tables); - + to_tz_cached= args[2]->const_item(); + } + if (from_tz==0 || to_tz==0 || get_arg0_date(ltime, 0)) { null_value= 1; @@ -1741,6 +1742,13 @@ bool Item_func_convert_tz::get_date(TIME *ltime, } +void Item_func_convert_tz::cleanup() +{ + from_tz_cached= to_tz_cached= 0; + Item_date_func::cleanup(); +} + + void Item_date_add_interval::fix_length_and_dec() { enum_field_types arg0_field_type; diff --git a/sql/item_timefunc.h b/sql/item_timefunc.h index df0b05d6d42..cc2709bf555 100644 --- a/sql/item_timefunc.h +++ b/sql/item_timefunc.h @@ -545,12 +545,15 @@ class Item_func_convert_tz :public Item_date_func TABLE_LIST *tz_tables; /* If time zone parameters are constants we are caching objects that - represent them. + represent them (we use separate from_tz_cached/to_tz_cached members + to indicate this fact, since NULL is legal value for from_tz/to_tz + members. */ + bool from_tz_cached, to_tz_cached; Time_zone *from_tz, *to_tz; public: Item_func_convert_tz(Item *a, Item *b, Item *c): - Item_date_func(a, b, c) {} + Item_date_func(a, b, c), from_tz_cached(0), to_tz_cached(0) {} longlong val_int(); double val() { return (double) val_int(); } String *val_str(String *str); @@ -558,6 +561,7 @@ class Item_func_convert_tz :public Item_date_func bool fix_fields(THD *, struct st_table_list *, Item **); void fix_length_and_dec(); bool get_date(TIME *res, uint fuzzy_date); + void cleanup(); }; diff --git a/sql/set_var.cc b/sql/set_var.cc index e44ac742abe..99032a29651 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -2438,8 +2438,15 @@ bool sys_var_thd_time_zone::check(THD *thd, set_var *var) bool sys_var_thd_time_zone::update(THD *thd, set_var *var) { - /* We are using Time_zone object found during check() phase */ - *get_tz_ptr(thd,var->type)= var->save_result.time_zone; + /* We are using Time_zone object found during check() phase. */ + if (var->type == OPT_GLOBAL) + { + pthread_mutex_lock(&LOCK_global_system_variables); + global_system_variables.time_zone= var->save_result.time_zone; + pthread_mutex_unlock(&LOCK_global_system_variables); + } + else + thd->variables.time_zone= var->save_result.time_zone; return 0; } @@ -2451,27 +2458,25 @@ byte *sys_var_thd_time_zone::value_ptr(THD *thd, enum_var_type type, We can use ptr() instead of c_ptr() here because String contaning time zone name is guaranteed to be zero ended. */ - return (byte *)((*get_tz_ptr(thd,type))->get_name()->ptr()); -} - - -Time_zone** sys_var_thd_time_zone::get_tz_ptr(THD *thd, - enum_var_type type) -{ if (type == OPT_GLOBAL) - return &global_system_variables.time_zone; + return (byte *)(global_system_variables.time_zone->get_name()->ptr()); else - return &thd->variables.time_zone; + return (byte *)(thd->variables.time_zone->get_name()->ptr()); } void sys_var_thd_time_zone::set_default(THD *thd, enum_var_type type) { + pthread_mutex_lock(&LOCK_global_system_variables); if (type == OPT_GLOBAL) { if (default_tz_name) { String str(default_tz_name, &my_charset_latin1); + /* + We are guaranteed to find this time zone since its existence + is checked during start-up. + */ global_system_variables.time_zone= my_tz_find(&str, thd->lex->time_zone_tables_used); } @@ -2480,6 +2485,7 @@ void sys_var_thd_time_zone::set_default(THD *thd, enum_var_type type) } else thd->variables.time_zone= global_system_variables.time_zone; + pthread_mutex_unlock(&LOCK_global_system_variables); } /* diff --git a/sql/set_var.h b/sql/set_var.h index 4a4e631d88c..df2fd41c7bd 100644 --- a/sql/set_var.h +++ b/sql/set_var.h @@ -736,7 +736,6 @@ public: bool update(THD *thd, set_var *var); byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base); virtual void set_default(THD *thd, enum_var_type type); - Time_zone **get_tz_ptr(THD *thd, enum_var_type type); }; /**************************************************************************** diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index d2ac0df1472..b52ebf12dd2 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -1719,8 +1719,8 @@ st_lex::st_lex() global_first Save first global table here local_first Save first local table here - NORES - global_first & local_first are used to save result for link_first_table_back + NOTES + This function assumes that outer select list is non-empty. RETURN global list without first table @@ -1730,25 +1730,25 @@ TABLE_LIST *st_lex::unlink_first_table(TABLE_LIST *tables, TABLE_LIST **global_first, TABLE_LIST **local_first) { + DBUG_ASSERT(select_lex.table_list.first != 0); + /* + Save pointers to first elements of global table list and list + of tables used in outer select. It does not harm if these lists + are the same. + */ *global_first= tables; *local_first= (TABLE_LIST*)select_lex.table_list.first; - /* - Exclude from global table list - */ + + /* Exclude first elements from these lists */ + select_lex.table_list.first= (byte*) (*local_first)->next; tables= tables->next; - /* - and from local list if it is not the same - */ - select_lex.table_list.first= ((&select_lex != all_selects_list) ? - (byte*) (*local_first)->next : - (byte*) tables); (*global_first)->next= 0; return tables; } /* - Link table back that was unlinked with unlink_first_table() + Link table which was unlinked with unlink_first_table() back. SYNOPSIS link_first_table_back() @@ -1764,16 +1764,7 @@ TABLE_LIST *st_lex::link_first_table_back(TABLE_LIST *tables, TABLE_LIST *local_first) { global_first->next= tables; - if (&select_lex != all_selects_list) - { - /* - we do not touch local table 'next' field => we need just - put the table in the list - */ - select_lex.table_list.first= (byte*) local_first; - } - else - select_lex.table_list.first= (byte*) global_first; + select_lex.table_list.first= (byte*) local_first; return global_first; } diff --git a/sql/tztime.cc b/sql/tztime.cc index c2143b0d5dd..fd24e1f15b2 100644 --- a/sql/tztime.cc +++ b/sql/tztime.cc @@ -1773,7 +1773,13 @@ tz_load_from_open_tables(const String *tz_name, TABLE_LIST *tz_tables) if (table->file->index_read(table->record[0], (byte*)table->field[0]->ptr, 0, HA_READ_KEY_EXACT)) { - sql_print_error("Can't find description of time zone."); +#ifdef EXTRA_DEBUG + /* + Most probably user has mistyped time zone name, so no need to bark here + unless we need it for debugging. + */ + sql_print_error("Can't find description of time zone '%s'", tz_name_buff); +#endif goto end; } @@ -1794,7 +1800,7 @@ tz_load_from_open_tables(const String *tz_name, TABLE_LIST *tz_tables) if (table->file->index_read(table->record[0], (byte*)table->field[0]->ptr, 0, HA_READ_KEY_EXACT)) { - sql_print_error("Can't find description of time zone."); + sql_print_error("Can't find description of time zone '%u'", tzid); goto end; } From 199a139da1cbbb8846c21e634fb9e4242372b67c Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 27 Jan 2005 14:51:16 +0400 Subject: [PATCH 0852/1063] item_timefunc.cc: CAST now always return a well-formed character string. sql/item_timefunc.cc: CAST now always return a well-formed character string. --- sql/item_timefunc.cc | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index 39c88c8b0a3..bc80131e4ad 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -2115,7 +2115,6 @@ String *Item_char_typecast::val_str(String *str) String *res; uint32 length; -#if 0 if (!charset_conversion) { if (!(res= args[0]->val_str(str))) @@ -2125,7 +2124,6 @@ String *Item_char_typecast::val_str(String *str) } } else -#endif { // Convert character set if differ uint dummy_errors; @@ -2163,9 +2161,18 @@ String *Item_char_typecast::val_str(String *str) void Item_char_typecast::fix_length_and_dec() { uint32 char_length; - charset_conversion= !my_charset_same(args[0]->collation.collation, cast_cs) && - args[0]->collation.collation != &my_charset_bin && - cast_cs != &my_charset_bin; + /* + We always force character set conversion if cast_cs + is a multi-byte character set. It garantees that the + result of CAST is a well-formed string. + For single-byte character sets we allow just to copy + from the argument. A single-byte character sets string + is always well-formed. + */ + charset_conversion= (cast_cs->mbmaxlen > 1) || + !my_charset_same(args[0]->collation.collation, cast_cs) && + args[0]->collation.collation != &my_charset_bin && + cast_cs != &my_charset_bin; collation.set(cast_cs, DERIVATION_IMPLICIT); char_length= (cast_length >= 0) ? cast_length : args[0]->max_length/args[0]->collation.collation->mbmaxlen; From a271a6c878ffe8245bd631888bfeee3cb5055005 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 27 Jan 2005 12:13:35 +0100 Subject: [PATCH 0853/1063] Re-enabled the use of --prefix. Adjusted the "Usage:" string. Ordered the option recognition in reverse order from "Usage:". --- BUILD/SETUP.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/BUILD/SETUP.sh b/BUILD/SETUP.sh index 77fab948121..e048ad723ab 100755 --- a/BUILD/SETUP.sh +++ b/BUILD/SETUP.sh @@ -6,12 +6,15 @@ then exit 1 fi +prefix_configs="--prefix=/usr/local/mysql" just_print= just_configure= full_debug= while test $# -gt 0 do case "$1" in + --prefix=* ) prefix_configs="$1"; shift ;; + --with-debug=full ) full_debug="=full"; shift ;; -c | --just-configure ) just_configure=1; shift ;; -n | --just-print | --print ) just_print=1; shift ;; -h | --help ) cat < Date: Thu, 27 Jan 2005 14:05:44 +0200 Subject: [PATCH 0854/1063] InnoDB: Tolerate negative return values from ftell(). sql/ha_innodb.cc: Tolerate negative return values from ftell(). --- sql/ha_innodb.cc | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index 2e441b4f085..1a870ce3abf 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -4346,12 +4346,12 @@ ha_innobase::update_table_comment( (ulong) innobase_get_free_space()); dict_print_info_on_foreign_keys(FALSE, file, prebuilt->table); flen = ftell(file); - if(length + flen + 3 > 64000) { + if (flen < 0) { + flen = 0; + } else if (length + flen + 3 > 64000) { flen = 64000 - 3 - length; } - ut_ad(flen > 0); - /* allocate buffer for the full string, and read the contents of the temporary file */ @@ -4414,12 +4414,12 @@ ha_innobase::get_foreign_key_create_info(void) prebuilt->trx->op_info = (char*)""; flen = ftell(file); - if(flen > 64000 - 1) { + if (flen < 0) { + flen = 0; + } else if(flen > 64000 - 1) { flen = 64000 - 1; } - ut_ad(flen >= 0); - /* allocate buffer for the string, and read the contents of the temporary file */ @@ -4800,12 +4800,12 @@ innodb_show_status( srv_printf_innodb_monitor(srv_monitor_file); flen = ftell(srv_monitor_file); os_file_set_eof(srv_monitor_file); - if(flen > 64000 - 1) { + if (flen < 0) { + flen = 0; + } else if (flen > 64000 - 1) { flen = 64000 - 1; } - ut_ad(flen > 0); - /* allocate buffer for the string, and read the contents of the temporary file */ From bde9e86041ed3cb80b26f5b3d5bb7168da031c5d Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 27 Jan 2005 17:12:21 +0200 Subject: [PATCH 0855/1063] configure.in: Add -DDBUG_ON to CXXFLAGS whenever it is added to CFLAGS. Thus, sql/ha_innodb.cc will be compiled with the same setting of UNIV_DEBUG as the rest of InnoDB, i.e., --with-debug enables InnoDB ut_ad() assertions everywhere. configure.in: Add -DDBUG_ON to CXXFLAGS whenever it is added to CFLAGS. Thus, sql/ha_innodb.cc will be compiled with the same setting of UNIV_DEBUG as the rest of InnoDB, i.e., --with-debug enables InnoDB ut_ad() assertions everywhere. --- configure.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index 65af867cbc0..8b8c0690a55 100644 --- a/configure.in +++ b/configure.in @@ -1632,12 +1632,12 @@ if test "$with_debug" = "yes" then # Medium debug. CFLAGS="$DEBUG_CFLAGS $DEBUG_OPTIMIZE_CC -DDBUG_ON -DSAFE_MUTEX $CFLAGS" - CXXFLAGS="$DEBUG_CXXFLAGS $DEBUG_OPTIMIZE_CXX -DSAFE_MUTEX $CXXFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS $DEBUG_OPTIMIZE_CXX -DDBUG_ON -DSAFE_MUTEX $CXXFLAGS" elif test "$with_debug" = "full" then # Full debug. Very slow in some cases CFLAGS="$DEBUG_CFLAGS -DDBUG_ON -DSAFE_MUTEX -DSAFEMALLOC $CFLAGS" - CXXFLAGS="$DEBUG_CXXFLAGS -DSAFE_MUTEX -DSAFEMALLOC $CXXFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS -DDBUG_ON -DSAFE_MUTEX -DSAFEMALLOC $CXXFLAGS" else # Optimized version. No debug CFLAGS="$OPTIMIZE_CFLAGS -DDBUG_OFF $CFLAGS" From 1ed40339e24296a51b4e22bbb434aa2752c19601 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 27 Jan 2005 17:33:35 +0100 Subject: [PATCH 0856/1063] ndb - make YEAR and TIMESTAMP into ndb types mysql-test/r/ndb_index_ordered.result: make YEAR and TIMESTAMP into ndb types mysql-test/t/ndb_index_ordered.test: make YEAR and TIMESTAMP into ndb types ndb/include/kernel/signaldata/DictTabInfo.hpp: make YEAR and TIMESTAMP into ndb types ndb/include/ndbapi/NdbDictionary.hpp: make YEAR and TIMESTAMP into ndb types ndb/include/util/NdbSqlUtil.hpp: make YEAR and TIMESTAMP into ndb types ndb/src/common/util/NdbSqlUtil.cpp: make YEAR and TIMESTAMP into ndb types ndb/src/ndbapi/NdbDictionary.cpp: make YEAR and TIMESTAMP into ndb types ndb/src/ndbapi/NdbDictionaryImpl.cpp: make YEAR and TIMESTAMP into ndb types ndb/src/ndbapi/NdbRecAttr.cpp: make YEAR and TIMESTAMP into ndb types ndb/test/include/NdbSchemaOp.hpp: make YEAR and TIMESTAMP into ndb types sql/ha_ndbcluster.cc: make YEAR and TIMESTAMP into ndb types --- mysql-test/r/ndb_index_ordered.result | 44 +++++++--- mysql-test/t/ndb_index_ordered.test | 30 ++++--- ndb/include/kernel/signaldata/DictTabInfo.hpp | 14 ++- ndb/include/ndbapi/NdbDictionary.hpp | 4 +- ndb/include/util/NdbSqlUtil.hpp | 6 +- ndb/src/common/util/NdbSqlUtil.cpp | 36 ++++++++ ndb/src/ndbapi/NdbDictionary.cpp | 6 ++ ndb/src/ndbapi/NdbDictionaryImpl.cpp | 4 + ndb/src/ndbapi/NdbRecAttr.cpp | 85 +++++++++++++++++-- ndb/test/include/NdbSchemaOp.hpp | 4 - sql/ha_ndbcluster.cc | 19 +++-- 11 files changed, 209 insertions(+), 43 deletions(-) diff --git a/mysql-test/r/ndb_index_ordered.result b/mysql-test/r/ndb_index_ordered.result index 943571aa524..12438f247c3 100644 --- a/mysql-test/r/ndb_index_ordered.result +++ b/mysql-test/r/ndb_index_ordered.result @@ -323,16 +323,16 @@ index(ye), index(ti), index(ts) ) engine=ndb; -insert into t1 (pk,dt,da,ye,ti) values -(1, '1901-05-05 23:00:59', '1901-05-05', '1901', '23:00:59'), -(2, '1912-09-05 13:00:59', '1912-09-05', '1912', '13:00:59'), -(3, '1945-12-31 00:00:00', '1945-12-31', '1945', '00:00:00'), -(4, '1955-12-31 00:00:00', '1955-12-31', '1955', '00:00:00'), -(5, '1963-06-06 06:06:06', '1963-06-06', '1963', '06:06:06'), -(6, '1993-06-06 06:06:06', '1993-06-06', '1993', '06:06:06'), -(7, '2001-01-01 10:11:10', '2001-01-01', '2001', '10:11:10'), -(8, '2001-01-01 10:11:11', '2001-01-01', '2001', '10:11:11'), -(9, '2005-01-31 23:59:59', '2005-01-31', '2005', '23:59:59'); +insert into t1 (pk,dt,da,ye,ti,ts) values +(1, '1901-05-05 23:00:59', '1901-05-05', '1901', '23:00:59', '2001-01-01 23:00:59'), +(2, '1912-09-05 13:00:59', '1912-09-05', '1912', '13:00:59', '2001-01-01 13:00:59'), +(3, '1945-12-31 00:00:00', '1945-12-31', '1945', '00:00:00', '2001-01-01 00:00:00'), +(4, '1955-12-31 00:00:00', '1955-12-31', '1955', '00:00:00', '2001-01-01 00:00:00'), +(5, '1963-06-06 06:06:06', '1963-06-06', '1963', '06:06:06', '2001-01-01 06:06:06'), +(6, '1993-06-06 06:06:06', '1993-06-06', '1993', '06:06:06', '2001-01-01 06:06:06'), +(7, '2001-01-01 10:11:10', '2001-01-01', '2001', '10:11:10', '2001-01-01 10:11:10'), +(8, '2001-01-01 10:11:11', '2001-01-01', '2001', '10:11:11', '2001-01-01 10:11:11'), +(9, '2005-01-31 23:59:59', '2005-01-31', '2005', '23:59:59', '2001-01-01 23:59:59'); select count(*)-9 from t1 use index (dt) where dt > '1900-01-01 00:00:00'; count(*)-9 0 @@ -420,6 +420,30 @@ count(*)-8 select count(*)-9 from t1 use index (ti) where ti <= '23:59:59'; count(*)-9 0 +select count(*)-9 from t1 use index (ts) where ts >= '2001-01-01 00:00:00'; +count(*)-9 +0 +select count(*)-7 from t1 use index (ts) where ts > '2001-01-01 00:00:00'; +count(*)-7 +0 +select count(*)-7 from t1 use index (ts) where ts > '2001-01-01 05:05:05'; +count(*)-7 +0 +select count(*)-5 from t1 use index (ts) where ts > '2001-01-01 06:06:06'; +count(*)-5 +0 +select count(*)-5 from t1 use index (ts) where ts < '2001-01-01 10:11:11'; +count(*)-5 +0 +select count(*)-6 from t1 use index (ts) where ts <= '2001-01-01 10:11:11'; +count(*)-6 +0 +select count(*)-8 from t1 use index (ts) where ts < '2001-01-01 23:59:59'; +count(*)-8 +0 +select count(*)-9 from t1 use index (ts) where ts <= '2001-01-01 23:59:59'; +count(*)-9 +0 drop table t1; create table t1(a int primary key, b int not null, index(b)); insert into t1 values (1,1), (2,2); diff --git a/mysql-test/t/ndb_index_ordered.test b/mysql-test/t/ndb_index_ordered.test index 89f1e5b7e9f..47e6b93eb81 100644 --- a/mysql-test/t/ndb_index_ordered.test +++ b/mysql-test/t/ndb_index_ordered.test @@ -189,16 +189,16 @@ create table t1 ( index(ts) ) engine=ndb; -insert into t1 (pk,dt,da,ye,ti) values - (1, '1901-05-05 23:00:59', '1901-05-05', '1901', '23:00:59'), - (2, '1912-09-05 13:00:59', '1912-09-05', '1912', '13:00:59'), - (3, '1945-12-31 00:00:00', '1945-12-31', '1945', '00:00:00'), - (4, '1955-12-31 00:00:00', '1955-12-31', '1955', '00:00:00'), - (5, '1963-06-06 06:06:06', '1963-06-06', '1963', '06:06:06'), - (6, '1993-06-06 06:06:06', '1993-06-06', '1993', '06:06:06'), - (7, '2001-01-01 10:11:10', '2001-01-01', '2001', '10:11:10'), - (8, '2001-01-01 10:11:11', '2001-01-01', '2001', '10:11:11'), - (9, '2005-01-31 23:59:59', '2005-01-31', '2005', '23:59:59'); +insert into t1 (pk,dt,da,ye,ti,ts) values + (1, '1901-05-05 23:00:59', '1901-05-05', '1901', '23:00:59', '2001-01-01 23:00:59'), + (2, '1912-09-05 13:00:59', '1912-09-05', '1912', '13:00:59', '2001-01-01 13:00:59'), + (3, '1945-12-31 00:00:00', '1945-12-31', '1945', '00:00:00', '2001-01-01 00:00:00'), + (4, '1955-12-31 00:00:00', '1955-12-31', '1955', '00:00:00', '2001-01-01 00:00:00'), + (5, '1963-06-06 06:06:06', '1963-06-06', '1963', '06:06:06', '2001-01-01 06:06:06'), + (6, '1993-06-06 06:06:06', '1993-06-06', '1993', '06:06:06', '2001-01-01 06:06:06'), + (7, '2001-01-01 10:11:10', '2001-01-01', '2001', '10:11:10', '2001-01-01 10:11:10'), + (8, '2001-01-01 10:11:11', '2001-01-01', '2001', '10:11:11', '2001-01-01 10:11:11'), + (9, '2005-01-31 23:59:59', '2005-01-31', '2005', '23:59:59', '2001-01-01 23:59:59'); # datetime select count(*)-9 from t1 use index (dt) where dt > '1900-01-01 00:00:00'; @@ -237,6 +237,16 @@ select count(*)-6 from t1 use index (ti) where ti <= '10:11:11'; select count(*)-8 from t1 use index (ti) where ti < '23:59:59'; select count(*)-9 from t1 use index (ti) where ti <= '23:59:59'; +# timestamp +select count(*)-9 from t1 use index (ts) where ts >= '2001-01-01 00:00:00'; +select count(*)-7 from t1 use index (ts) where ts > '2001-01-01 00:00:00'; +select count(*)-7 from t1 use index (ts) where ts > '2001-01-01 05:05:05'; +select count(*)-5 from t1 use index (ts) where ts > '2001-01-01 06:06:06'; +select count(*)-5 from t1 use index (ts) where ts < '2001-01-01 10:11:11'; +select count(*)-6 from t1 use index (ts) where ts <= '2001-01-01 10:11:11'; +select count(*)-8 from t1 use index (ts) where ts < '2001-01-01 23:59:59'; +select count(*)-9 from t1 use index (ts) where ts <= '2001-01-01 23:59:59'; + drop table t1; # bug#7798 diff --git a/ndb/include/kernel/signaldata/DictTabInfo.hpp b/ndb/include/kernel/signaldata/DictTabInfo.hpp index 3e73ae67ebe..ade6c22a5bd 100644 --- a/ndb/include/kernel/signaldata/DictTabInfo.hpp +++ b/ndb/include/kernel/signaldata/DictTabInfo.hpp @@ -311,7 +311,9 @@ public: ExtDate = NdbSqlUtil::Type::Date, ExtBlob = NdbSqlUtil::Type::Blob, ExtText = NdbSqlUtil::Type::Text, - ExtTime = NdbSqlUtil::Type::Time + ExtTime = NdbSqlUtil::Type::Time, + ExtYear = NdbSqlUtil::Type::Year, + ExtTimestamp = NdbSqlUtil::Type::Timestamp }; // Attribute data interpretation @@ -446,6 +448,16 @@ public: AttributeSize = DictTabInfo::an8Bit; AttributeArraySize = 3 * AttributeExtLength; return true; + case DictTabInfo::ExtYear: + AttributeType = DictTabInfo::StringType; + AttributeSize = DictTabInfo::an8Bit; + AttributeArraySize = 1 * AttributeExtLength; + return true; + case DictTabInfo::ExtTimestamp: + AttributeType = DictTabInfo::StringType; + AttributeSize = DictTabInfo::an8Bit; + AttributeArraySize = 4 * AttributeExtLength; + return true; }; return false; } diff --git a/ndb/include/ndbapi/NdbDictionary.hpp b/ndb/include/ndbapi/NdbDictionary.hpp index 454b267d1b0..0dca1c0f106 100644 --- a/ndb/include/ndbapi/NdbDictionary.hpp +++ b/ndb/include/ndbapi/NdbDictionary.hpp @@ -188,7 +188,9 @@ public: Date, ///< Precision down to 1 day(sizeof(Date) == 4 bytes ) Blob, ///< Binary large object (see NdbBlob) Text, ///< Text blob - Time = 25 ///< Time without date + Time = 25, ///< Time without date + Year = 26, ///< Year 1901-2155 (1 byte) + Timestamp = 27 ///< Unix time }; /** diff --git a/ndb/include/util/NdbSqlUtil.hpp b/ndb/include/util/NdbSqlUtil.hpp index 10024d9b616..3787814052a 100644 --- a/ndb/include/util/NdbSqlUtil.hpp +++ b/ndb/include/util/NdbSqlUtil.hpp @@ -84,7 +84,9 @@ public: Date, // Precision down to 1 day (size 4 bytes) Blob, // Blob Text, // Text blob - Time = 25 // Time without date + Time = 25, // Time without date + Year = 26, // Year (size 1 byte) + Timestamp = 27 // Unix seconds (uint32) }; Enum m_typeId; Cmp* m_cmp; // comparison method @@ -137,6 +139,8 @@ private: static Cmp cmpBlob; static Cmp cmpText; static Cmp cmpTime; + static Cmp cmpYear; + static Cmp cmpTimestamp; }; #endif diff --git a/ndb/src/common/util/NdbSqlUtil.cpp b/ndb/src/common/util/NdbSqlUtil.cpp index 233698ae52b..6b23da774af 100644 --- a/ndb/src/common/util/NdbSqlUtil.cpp +++ b/ndb/src/common/util/NdbSqlUtil.cpp @@ -179,6 +179,14 @@ NdbSqlUtil::m_typeList[] = { { Type::Time, cmpTime + }, + { + Type::Year, + cmpYear + }, + { + Type::Timestamp, + cmpTimestamp } }; @@ -592,6 +600,34 @@ NdbSqlUtil::cmpTime(const void* info, const Uint32* p1, const Uint32* p2, Uint32 return 0; } +int +NdbSqlUtil::cmpYear(const void* info, const Uint32* p1, const Uint32* p2, Uint32 full, Uint32 size) +{ + assert(full >= size && size > 0); + union { const Uint32* p; const unsigned char* v; } u1, u2; + u1.p = p1; + u2.p = p2; + if (u1.v[0] < u2.v[0]) + return -1; + if (u1.v[0] > u2.v[0]) + return +1; + return 0; +} + +int +NdbSqlUtil::cmpTimestamp(const void* info, const Uint32* p1, const Uint32* p2, Uint32 full, Uint32 size) +{ + assert(full >= size && size > 0); + union { Uint32 p[1]; Uint32 v; } u1, u2; + u1.v = p1[0]; + u2.v = p2[0]; + if (u1.v < u2.v) + return -1; + if (u1.v > u2.v) + return +1; + return 0; +} + // check charset bool diff --git a/ndb/src/ndbapi/NdbDictionary.cpp b/ndb/src/ndbapi/NdbDictionary.cpp index 0508d8bf277..58b35c6c306 100644 --- a/ndb/src/ndbapi/NdbDictionary.cpp +++ b/ndb/src/ndbapi/NdbDictionary.cpp @@ -950,6 +950,12 @@ operator<<(NdbOut& out, const NdbDictionary::Column& col) case NdbDictionary::Column::Time: out << "Time"; break; + case NdbDictionary::Column::Year: + out << "Year"; + break; + case NdbDictionary::Column::Timestamp: + out << "Timestamp"; + break; case NdbDictionary::Column::Undefined: out << "Undefined"; break; diff --git a/ndb/src/ndbapi/NdbDictionaryImpl.cpp b/ndb/src/ndbapi/NdbDictionaryImpl.cpp index 59474943f3b..9f6ed144fb0 100644 --- a/ndb/src/ndbapi/NdbDictionaryImpl.cpp +++ b/ndb/src/ndbapi/NdbDictionaryImpl.cpp @@ -149,6 +149,8 @@ NdbColumnImpl::init(Type t) m_cs = default_cs; break; case Time: + case Year: + case Timestamp: m_precision = 0; m_scale = 0; m_length = 1; @@ -1184,6 +1186,8 @@ columnTypeMapping[] = { { DictTabInfo::ExtBlob, NdbDictionary::Column::Blob }, { DictTabInfo::ExtText, NdbDictionary::Column::Text }, { DictTabInfo::ExtTime, NdbDictionary::Column::Time }, + { DictTabInfo::ExtYear, NdbDictionary::Column::Year }, + { DictTabInfo::ExtTimestamp, NdbDictionary::Column::Timestamp }, { -1, -1 } }; diff --git a/ndb/src/ndbapi/NdbRecAttr.cpp b/ndb/src/ndbapi/NdbRecAttr.cpp index f2427fb32e8..6749a0f04d9 100644 --- a/ndb/src/ndbapi/NdbRecAttr.cpp +++ b/ndb/src/ndbapi/NdbRecAttr.cpp @@ -156,10 +156,11 @@ NdbOut& operator<<(NdbOut& out, const NdbRecAttr &r) return out; } - if (r.arraySize() > 1) + uint length = r.getColumn()->getLength(); + if (length > 1) out << "["; - for (Uint32 j = 0; j < r.arraySize(); j++) + for (Uint32 j = 0; j < length; j++) { if (j > 0) out << " "; @@ -192,14 +193,14 @@ NdbOut& operator<<(NdbOut& out, const NdbRecAttr &r) break; case NdbDictionary::Column::Char: out.print("%.*s", r.arraySize(), r.aRef()); - j = r.arraySize(); + j = length; break; case NdbDictionary::Column::Varchar: { short len = ntohs(r.u_short_value()); out.print("%.*s", len, r.aRef()+2); } - j = r.arraySize(); + j = length; break; case NdbDictionary::Column::Float: out << r.float_value(); @@ -207,6 +208,74 @@ NdbOut& operator<<(NdbOut& out, const NdbRecAttr &r) case NdbDictionary::Column::Double: out << r.double_value(); break; + // for dates cut-and-paste from field.cc + case NdbDictionary::Column::Datetime: + { + ulonglong tmp=r.u_64_value(); + long part1,part2,part3; + part1=(long) (tmp/LL(1000000)); + part2=(long) (tmp - (ulonglong) part1*LL(1000000)); + char buf[40]; + char* pos=(char*) buf+19; + *pos--=0; + *pos--= (char) ('0'+(char) (part2%10)); part2/=10; + *pos--= (char) ('0'+(char) (part2%10)); part3= (int) (part2 / 10); + *pos--= ':'; + *pos--= (char) ('0'+(char) (part3%10)); part3/=10; + *pos--= (char) ('0'+(char) (part3%10)); part3/=10; + *pos--= ':'; + *pos--= (char) ('0'+(char) (part3%10)); part3/=10; + *pos--= (char) ('0'+(char) part3); + *pos--= '/'; + *pos--= (char) ('0'+(char) (part1%10)); part1/=10; + *pos--= (char) ('0'+(char) (part1%10)); part1/=10; + *pos--= '-'; + *pos--= (char) ('0'+(char) (part1%10)); part1/=10; + *pos--= (char) ('0'+(char) (part1%10)); part3= (int) (part1/10); + *pos--= '-'; + *pos--= (char) ('0'+(char) (part3%10)); part3/=10; + *pos--= (char) ('0'+(char) (part3%10)); part3/=10; + *pos--= (char) ('0'+(char) (part3%10)); part3/=10; + *pos=(char) ('0'+(char) part3); + out << buf; + } + break; + case NdbDictionary::Column::Date: + { + uint tmp=uint3korr(r.aRef()); + int year=(int) ((uint32) tmp/10000L % 10000); + int month=(int) ((uint32) tmp/100 % 100); + int day=(int) ((uint32) tmp % 100); + char buf[40]; + sprintf(buf, "%04d-%02d-%02d", year, month, day); + out << buf; + } + break; + case NdbDictionary::Column::Time: + { + long tmp=(long) sint3korr(r.aRef()); + int hour=(uint) (tmp/10000); + int minute=(uint) (tmp/100 % 100); + int second=(uint) (tmp % 100); + char buf[40]; + sprintf(buf, "%02d:%02d:%02d", hour, minute, second); + out << buf; + } + break; + case NdbDictionary::Column::Year: + { + uint year = 1900 + r.u_char_value(); + char buf[40]; + sprintf(buf, "%04d", year); + out << buf; + } + break; + case NdbDictionary::Column::Timestamp: + { + time_t time = r.u_32_value(); + out << (uint)time; + } + break; case NdbDictionary::Column::Blob: { const NdbBlob::Head* h = (const NdbBlob::Head*)r.aRef(); @@ -215,7 +284,7 @@ NdbOut& operator<<(NdbOut& out, const NdbRecAttr &r) unsigned n = r.arraySize() - sizeof(*h); for (unsigned k = 0; k < n && k < h->length; k++) out.print("%02X", (int)p[k]); - j = r.arraySize(); + j = length; } break; case NdbDictionary::Column::Text: @@ -226,19 +295,19 @@ NdbOut& operator<<(NdbOut& out, const NdbRecAttr &r) unsigned n = r.arraySize() - sizeof(*h); for (unsigned k = 0; k < n && k < h->length; k++) out.print("%c", (int)p[k]); - j = r.arraySize(); + j = length; } break; default: /* no print functions for the rest, just print type */ out << (int) r.getType(); - j = r.arraySize(); + j = length; if (j > 1) out << " " << j << " times"; break; } } - if (r.arraySize() > 1) + if (length > 1) { out << "]"; } diff --git a/ndb/test/include/NdbSchemaOp.hpp b/ndb/test/include/NdbSchemaOp.hpp index e2fb4015b88..77e704c0e5c 100644 --- a/ndb/test/include/NdbSchemaOp.hpp +++ b/ndb/test/include/NdbSchemaOp.hpp @@ -575,10 +575,6 @@ convertColumnTypeToAttrType(NdbDictionary::Column::Type _type) case NdbDictionary::Column::Binary: case NdbDictionary::Column::Varbinary: return String; - case NdbDictionary::Column::Datetime: - case NdbDictionary::Column::Date: - case NdbDictionary::Column::Time: - case NdbDictionary::Column::Undefined: default: return NoAttrTypeDef; } diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 437b5ebcdf7..a959cbaf434 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -3360,14 +3360,14 @@ static int create_ndb_column(NDBCOL &col, col.setLength(1); break; // Date types - case MYSQL_TYPE_TIMESTAMP: - col.setType(NDBCOL::Unsigned); - col.setLength(1); - break; case MYSQL_TYPE_DATETIME: col.setType(NDBCOL::Datetime); col.setLength(1); break; + case MYSQL_TYPE_DATE: // ? + col.setType(NDBCOL::Char); + col.setLength(field->pack_length()); + break; case MYSQL_TYPE_NEWDATE: col.setType(NDBCOL::Date); col.setLength(1); @@ -3376,10 +3376,13 @@ static int create_ndb_column(NDBCOL &col, col.setType(NDBCOL::Time); col.setLength(1); break; - case MYSQL_TYPE_DATE: // ? - case MYSQL_TYPE_YEAR: - col.setType(NDBCOL::Char); - col.setLength(field->pack_length()); + case MYSQL_TYPE_YEAR: + col.setType(NDBCOL::Year); + col.setLength(1); + break; + case MYSQL_TYPE_TIMESTAMP: + col.setType(NDBCOL::Timestamp); + col.setLength(1); break; // Char types case MYSQL_TYPE_STRING: From c84ff9867260dfb1a8a95b993aad459ce76b85c2 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 27 Jan 2005 22:00:36 +0200 Subject: [PATCH 0857/1063] fil0fil.c: We accidentally checked if the DIRECTORY is of type OS_FILE_TYPE_UNKNOWN; our intention was to check if the FILE is that; best to remove the check altogether, as in crash recovery it is safest to try to open also files whose type is unknown os0file.c: Fix a bug: in Windows, os_file_readdir_next_file() returned OS_FILE_TYPE_UNKNOWN as the type of a regular file; this did not break mysqld, but did break ibbackup on Windows innobase/os/os0file.c: Fix a bug: in Windows, os_file_readdir_next_file() returned OS_FILE_TYPE_UNKNOWN as the type of a regular file; this did not break mysqld, but did break ibbackup on Windows innobase/fil/fil0fil.c: We accidentally checked if the DIRECTORY is of type OS_FILE_TYPE_UNKNOWN; our intention was to check if the FILE is that; best to remove the check altogether, as in crash recovery it is safest to try to open also files whose type is unknown --- innobase/fil/fil0fil.c | 4 ++-- innobase/os/os0file.c | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/innobase/fil/fil0fil.c b/innobase/fil/fil0fil.c index cc1c4a22983..a8da074cab9 100644 --- a/innobase/fil/fil0fil.c +++ b/innobase/fil/fil0fil.c @@ -3002,8 +3002,8 @@ fil_load_single_table_tablespaces(void) /* printf( " Looking at file %s\n", fileinfo.name); */ - if (fileinfo.type == OS_FILE_TYPE_DIR - || dbinfo.type == OS_FILE_TYPE_UNKNOWN) { + if (fileinfo.type == OS_FILE_TYPE_DIR) { + goto next_file_item; } diff --git a/innobase/os/os0file.c b/innobase/os/os0file.c index 7090e8662f3..070096f4760 100644 --- a/innobase/os/os0file.c +++ b/innobase/os/os0file.c @@ -700,12 +700,12 @@ http://www.mysql.com/doc/en/Windows_symbolic_links.html */ } else if (lpFindFileData->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { info->type = OS_FILE_TYPE_DIR; - } else if (lpFindFileData->dwFileAttributes - & FILE_ATTRIBUTE_NORMAL) { -/* TODO: are FILE_ATTRIBUTE_NORMAL files really all normal files? */ - info->type = OS_FILE_TYPE_FILE; } else { - info->type = OS_FILE_TYPE_UNKNOWN; + /* It is probably safest to assume that all other + file types are normal. Better to check them rather + than blindly skip them. */ + + info->type = OS_FILE_TYPE_FILE; } } From b8cac714940514879ab3e61eb0d2ee473de9d5dc Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 27 Jan 2005 14:48:26 -0600 Subject: [PATCH 0858/1063] Bug #5185 mysqldump for windows database gets table names with different case Added the get_actual_table_name function that issues a SHOW TABLES LIKE '%s'. This will get the table name in the proper case. We use this table name rather than the one given on the command line. This will prevent problems when importing SQL on Linux that was generated on a Windows platform where case can be an issue. mysqldump.c: call get_actual_table_name to get the table name in the proper case client/mysqldump.c: call get_actual_table_name to get the table name in the proper case --- client/mysqldump.c | 37 +++++++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/client/mysqldump.c b/client/mysqldump.c index 00f5272e3d7..db86a3714c1 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -2082,6 +2082,34 @@ static int dump_all_tables_in_db(char *database) } /* dump_all_tables_in_db */ +/* + get_actual_table_name -- executes a SHOW TABLES LIKE '%s' to get the actual table name + from the server for the table name given on the command line. we do this because + the table name given on the command line may be a different case (e.g. T1 vs t1) + + RETURN + void +*/ +static void get_actual_table_name( const char *old_table_name, char *new_table_name, int buf_size ) +{ + MYSQL_RES *tableRes; + MYSQL_ROW row; + char query[ NAME_LEN*2+3 + 50 ]; + + DBUG_ENTER("get_actual_table_name"); + + sprintf( query, "SHOW TABLES LIKE '%s'", old_table_name ); + if (mysql_query_with_error_report(sock, 0, query)) + { + safe_exit(EX_MYSQLERR); + } + + tableRes = mysql_store_result( sock ); + row = mysql_fetch_row( tableRes ); + strncpy( new_table_name, row[0], buf_size ); + mysql_free_result(tableRes); +} /* get_actual_table_name */ + static int dump_selected_tables(char *db, char **table_names, int tables) { @@ -2116,9 +2144,14 @@ static int dump_selected_tables(char *db, char **table_names, int tables) print_xml_tag1(md_result_file, "", "database name=", db, "\n"); for (; tables > 0 ; tables-- , table_names++) { - numrows = getTableStructure(*table_names, db); + char new_table_name[NAME_LEN*+3]; + + /* the table name passed on commandline may be wrong case */ + get_actual_table_name( *table_names, new_table_name, sizeof(new_table_name) ); + + numrows = getTableStructure(new_table_name, db); if (!dFlag && numrows > 0) - dumpTable(numrows, *table_names); + dumpTable(numrows, new_table_name); my_free(order_by, MYF(MY_ALLOW_ZERO_PTR)); order_by= 0; } From b485ed7b49f25617efc7070032187335216b7a9c Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 28 Jan 2005 01:23:06 +0300 Subject: [PATCH 0859/1063] Remove unused configure.in name TOOLS_LIBS. configure.in: Remove unused TOOLS_LIBS: LIBS and CLIENT_LIBS should be enough for the global configure.in --- configure.in | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/configure.in b/configure.in index 985b5923c5c..98d060e660c 100644 --- a/configure.in +++ b/configure.in @@ -1536,14 +1536,11 @@ then fi fi -TOOLS_LIBS="$NON_THREADED_CLIENT_LIBS" - # Should we use named pthread library ? AC_MSG_CHECKING("named thread libs:") if test "$with_named_thread" != "no" then LIBS="$with_named_thread $LIBS $with_named_thread" - TOOLS_LIBS="$with_named_thread $TOOLS_LIBS $with_named_thread" with_posix_threads="yes" with_mit_threads="no" AC_MSG_RESULT("$with_named_thread") @@ -1562,9 +1559,7 @@ else then AC_MSG_CHECKING("for pthread_create in -lpthread"); ac_save_LIBS="$LIBS" - ac_save_TOOLS_LIBS="$TOOLS_LIBS" LIBS="$LIBS -lpthread" - TOOLS_LIBS="$TOOLS_LIBS -lpthread" AC_TRY_LINK( [#include ], [ (void) pthread_create((pthread_t*) 0,(pthread_attr_t*) 0, 0, 0); ], @@ -1573,7 +1568,6 @@ else if test "$with_posix_threads" = "no" then LIBS=" $ac_save_LIBS -lpthreads" - TOOLS_LIBS=" $ac_save_TOOLS_LIBS -lpthreads" AC_MSG_CHECKING("for pthread_create in -lpthreads"); AC_TRY_LINK( [#include ], @@ -1584,7 +1578,6 @@ else then # This is for FreeBSD LIBS="$ac_save_LIBS -pthread" - TOOLS_LIBS="$ac_save_TOOLS_LIBS -pthread" AC_MSG_CHECKING("for pthread_create in -pthread"); AC_TRY_LINK( [#include ], @@ -1595,7 +1588,6 @@ else then with_mit_threads="yes" LIBS="$ac_save_LIBS" - TOOLS_LIBS="$ac_save_TOOLS_LIBS" fi fi fi @@ -3037,8 +3029,6 @@ AC_SUBST(sql_union_dirs) # Some usefull subst AC_SUBST(CC) AC_SUBST(GXX) -#Remove TOOLS_LIBS, because this is included in LIBRARIES -#AC_SUBST(TOOLS_LIBS) # Set configuration options for make_binary_distribution case $SYSTEM_TYPE in From 7e1bc3d3b585e1eeb1985bdddbd3510c71af4aa8 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 28 Jan 2005 00:35:26 +0100 Subject: [PATCH 0860/1063] compile-solaris-sparc-purify: Added preparation of mysql_client_test(_embedded) and mysqltest(_embedded) Added --purify, --purecov, --quantify and --cxxfilt options mysql-test-run.sh: Report correctly combinations of embedded+ps-protocol etc Added initial Purify support mysql-test/mysql-test-run.sh: Report correctly combinations of embedded+ps-protocol etc Added initial Purify support BUILD/compile-solaris-sparc-purify: Added preparation of mysql_client_test(_embedded) and mysqltest(_embedded) Added --purify, --purecov, --quantify and --cxxfilt options --- BUILD/compile-solaris-sparc-purify | 101 ++++++++++++++++++++++++++--- mysql-test/mysql-test-run.sh | 81 ++++++++++++++++++++--- 2 files changed, 164 insertions(+), 18 deletions(-) diff --git a/BUILD/compile-solaris-sparc-purify b/BUILD/compile-solaris-sparc-purify index 71a60e45cb0..0e530f75b60 100755 --- a/BUILD/compile-solaris-sparc-purify +++ b/BUILD/compile-solaris-sparc-purify @@ -1,15 +1,35 @@ #! /bin/sh +mode="" +cxxfilt="" + +# For g++ 3.X, the PurifyPlus tools needs a program named "cxxfilt", +# "c++file" or similar. It is part of libtool. If not found, you can +# specify the path to it. + while test $# -gt 0 do case "$1" in - --debug) EXTRA_CONFIG_FLAGS=--with-debug; shift ;; - -h | --help ) cat < Path to cxxfilt/c++filt program + This program is needed for gcc 3.X EOF - *) echo "No such option '$1'" ; exit ;; + *) echo "No such option '$1'" ; exit 1 ;; esac + shift done gmake -k clean || true @@ -22,9 +42,70 @@ CFLAGS="-g -Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-sub gmake -j 4 -cd sql ; mv mysqld mysqld-org ; -make CXXLD="purify -best-effort g++" mysqld ; mv mysqld mysqld-purify -make CXXLD="quantify -best-effort g++" mysqld ; mv mysqld mysqld-quantify -make CXXLD="purecov -best-effort g++" mysqld ; mv mysqld mysqld-purecov -mv mysqld-org mysqld +# ---------------------------------------------------------------------- + +#set -x + +purifying_binaries () +{ + while test $1 + do + dir=$1 + shift + target=$1 + shift + binary=$1 + shift + + opts="" + if [ -n "$cxxfilt" ] ; then + opts="$opts -demangle-program=$cxxfilt" + fi + opts="$opts -best-effort g++" + + back=`pwd` + cd $dir + + # Because of libtool magic, the target and binary + # created might not be the same. To trigger rebuild, + # we need to move them both. + + mv $binary $binary-old + if [ -f $target ] ; then + mv $target $target-old + fi + + if [ -n "$mode" -a $mode = purify ] ; then + gmake CXXLD="purify $opts" $target + mv $binary $binary-purify + fi + + if [ -n "$mode" -a $mode = quantify ] ; then + gmake CXXLD="quantify $opts" $target + mv $binary $binary-quantify + fi + + if [ -n "$mode" -a $mode = purecov ] ; then + gmake CXXLD="purecov $opts" $target + mv $binary $binary-purecov + fi + + mv $binary-old $binary + if [ -f $target-old ] ; then + mv $target-old $target + fi + + cd $back + done +} + + +purifying_binaries \ + sql mysqld mysqld \ + client mysqltest .libs/mysqltest \ + tests mysql_client_test mysql_client_test \ + libmysqld/examples mysqltest_embedded mysqltest_embedded \ + libmysqld/examples mysql_client_test_embedded mysql_client_test_embedded + +# ---------------------------------------------------------------------- diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index c2ac26217b9..c2f1cebbe17 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -220,6 +220,8 @@ EXTRA_MYSQLBINLOG_OPT="" USE_RUNNING_SERVER="" USE_NDBCLUSTER="" USE_RUNNING_NDBCLUSTER="" +USE_PURIFY="" +PURIFY_LOGS="" DO_GCOV="" DO_GDB="" MANUAL_GDB="" @@ -239,7 +241,7 @@ MYSQL_TEST_SSL_OPTS="" USE_TIMER="" USE_EMBEDDED_SERVER="" RESULT_EXT="" -TEST_MODE="default" +TEST_MODE="" NDB_MGM_EXTRA_OPTS= NDB_MGMD_EXTRA_OPTS= @@ -247,8 +249,17 @@ NDBD_EXTRA_OPTS= while test $# -gt 0; do case "$1" in - --embedded-server) USE_EMBEDDED_SERVER=1 USE_MANAGER=0 NO_SLAVE=1 ; \ - USE_RUNNING_SERVER="" RESULT_EXT=".es" TEST_MODE="embedded" ;; + --embedded-server) + USE_EMBEDDED_SERVER=1 + USE_MANAGER=0 NO_SLAVE=1 + USE_RUNNING_SERVER="" + RESULT_EXT=".es" + TEST_MODE="$TEST_MODE embedded" ;; + --purify) + USE_PURIFY=1 + USE_MANAGER=0 + USE_RUNNING_SERVER="" + TEST_MODE="$TEST_MODE purify" ;; --user=*) DBUSER=`$ECHO "$1" | $SED -e "s;--user=;;"` ;; --force) FORCE=1 ;; --timer) USE_TIMER=1 ;; @@ -334,7 +345,7 @@ while test $# -gt 0; do SLEEP_TIME_AFTER_RESTART=`$ECHO "$1" | $SED -e "s;--sleep=;;"` ;; --ps-protocol) - TEST_MODE="ps-protocol" EXTRA_MYSQL_TEST_OPT="$EXTRA_MYSQL_TEST_OPT $1" ;; + TEST_MODE="$TEST_MODE ps-protocol" EXTRA_MYSQL_TEST_OPT="$EXTRA_MYSQL_TEST_OPT $1" ;; --user-test=*) USER_TEST=`$ECHO "$1" | $SED -e "s;--user-test=;;"` ;; @@ -444,6 +455,13 @@ while test $# -gt 0; do shift done +if [ -z "$TEST_MODE" ] ; then + TEST_MODE="default" +else + # Remove the leading space if any + TEST_MODE=`echo $TEST_MODE | sed 's/^ *//'` +fi + #++ # mysqld Environment Parameters #-- @@ -505,7 +523,10 @@ if [ x$SOURCE_DIST = x1 ] ; then fi MYSQL_CLIENT_TEST="$BASEDIR/libmysqld/examples/mysql_client_test_embedded" else - MYSQLD="$VALGRIND $BASEDIR/sql/mysqld" + MYSQLD="$BASEDIR/sql/mysqld" + if [ -n "$VALGRIND" ] ; then + MYSQLD="$VALGRIND $MYSQLD" + fi if [ -f "$BASEDIR/client/.libs/lt-mysqltest" ] ; then MYSQL_TEST="$BASEDIR/client/.libs/lt-mysqltest" elif [ -f "$BASEDIR/client/.libs/mysqltest" ] ; then @@ -542,6 +563,31 @@ if [ x$SOURCE_DIST = x1 ] ; then MYSQL_FIX_SYSTEM_TABLES="$BASEDIR/scripts/mysql_fix_privilege_tables" NDB_TOOLS_DIR="$BASEDIR/ndb/tools" NDB_MGM="$BASEDIR/ndb/src/mgmclient/ndb_mgm" + + if [ -n "$USE_PURIFY" ] ; then + PSUP="$MYSQL_TEST_DIR/purify.suppress" + echo "suppress UMR rw_read_held; mi_open; ha_myisam::open64; handler::ha_open; openfrm" > $PSUP + echo "suppress UMR my_end; main" >> $PSUP + echo "suppress UMR _doprnt; fprintf; my_end; main" >> $PSUP + PURIFYOPTIONS="-windows=no -log-file=%v.purifylog -append-logfile -add-suppression-files=$PSUP" + if [ -f "${MYSQL_TEST}-purify" ] ; then + MYSQL_TEST="${MYSQL_TEST}-purify" + PLOG="$MYSQL_TEST.purifylog" + if [ -f $PLOG ]; then + mv $PLOG $PLOG.$$ + fi + PURIFY_LOGS="$PLOG" + fi + if [ -f "${MYSQLD}-purify" ] ; then + MYSQLD="${MYSQLD}-purify" + PLOG="$MYSQLD.purifylog" + if [ -f $PLOG ]; then + mv $PLOG $PLOG.$$ + fi + PURIFY_LOGS="$PURIFY_LOGS $PLOG" + fi + fi + else # We have a binary installation. Note that this can be both from @@ -558,6 +604,13 @@ else MYSQLD="$VALGRIND $BASEDIR/bin/mysqld" fi CLIENT_BINDIR="$BASEDIR/bin" + if test -d "$BASEDIR/tests" + then + TESTS_BINDIR="$BASEDIR/tests" + else + TESTS_BINDIR="$BASEDIR/bin" + fi + MYSQL_TEST="$CLIENT_BINDIR/mysqltest" MYSQL_DUMP="$CLIENT_BINDIR/mysqldump" MYSQL_BINLOG="$CLIENT_BINDIR/mysqlbinlog" MYSQLADMIN="$CLIENT_BINDIR/mysqladmin" @@ -637,6 +690,7 @@ export CLIENT_BINDIR MYSQL_CLIENT_TEST CHARSETSDIR export NDB_TOOLS_DIR export NDB_MGM export NDB_BACKUP_DIR +export PURIFYOPTIONS MYSQL_TEST_ARGS="--no-defaults --socket=$MASTER_MYSOCK --database=$DB \ --user=$DBUSER --password=$DBPASSWD --silent -v --skip-safemalloc \ @@ -753,6 +807,17 @@ skip_test() { $ECHO "$RES$RES_SPACE [ skipped ]" } +report_current_test () { + tname=$1 + echo "CURRENT_TEST: $tname" >> $MASTER_MYERR + if [ -n "$PURIFY_LOGS" ] ; then + for log in $PURIFY_LOGS + do + echo "CURRENT_TEST: $tname" >> $log + done + fi +} + report_stats () { if [ $TOT_FAIL = 0 ]; then $ECHO "All $TOT_TEST tests were successful." @@ -1487,7 +1552,7 @@ run_testcase () esac stop_master stop_master 1 - echo "CURRENT_TEST: $tname" >> $MASTER_MYERR + report_current_test $tname start_master if [ -n "$USE_NDBCLUSTER" -a -z "$DO_BENCH" ] ; then start_master 1 @@ -1503,13 +1568,13 @@ run_testcase () EXTRA_MASTER_OPT="" stop_master stop_master 1 - echo "CURRENT_TEST: $tname" >> $MASTER_MYERR + report_current_test $tname start_master if [ -n "$USE_NDBCLUSTER" -a -z "$DO_BENCH" ] ; then start_master 1 fi else - echo "CURRENT_TEST: $tname" >> $MASTER_MYERR + report_current_test $tname fi fi From df7bb879cdbbf61e4c879cc6f13126a0be69dff7 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 28 Jan 2005 00:42:41 +0100 Subject: [PATCH 0861/1063] Bug#8167 signal usage clash between mysql server and ndb shared memory added shared memory config parameter, signum for use in signalling added global variable for holdign signum to be used for shared memory connection only fiddle with signals if it is set simplified common ndb client option handling ndb/include/Makefile.am: added common defaults file ndb/include/mgmapi/mgmapi_config_parameters.h: added shared memory config parameter, signum for use in signalling ndb/include/transporter/TransporterDefinitions.hpp: added shared memory config parameter, signum for use in signalling ndb/include/util/ndb_opts.h: simplified common ndb client option handling ndb/src/common/mgmcommon/IPCConfig.cpp: added shared memory config parameter, signum for use in signalling ndb/src/common/portlib/NdbThread.c: added global variable for holdign signum to be used for shared memory connection only block signals if shared memory is used ndb/src/common/transporter/SHM_Transporter.cpp: use signum in new global variable for shared memory signalling ndb/src/common/transporter/TransporterRegistry.cpp: use signum in new global variable for shared memory signalling only fiddle with signals if it is set ndb/src/cw/cpcd/main.cpp: ndb_opts not really used ndb/src/kernel/vm/Configuration.cpp: simplified common ndb client option handling ndb/src/mgmclient/main.cpp: simplified common ndb client option handling ndb/src/mgmsrv/ConfigInfo.cpp: added shared memory config parameter, signum for use in signalling ndb/src/mgmsrv/main.cpp: simplified common ndb client option handling ndb/tools/delete_all.cpp: simplified common ndb client option handling ndb/tools/desc.cpp: simplified common ndb client option handling ndb/tools/drop_index.cpp: simplified common ndb client option handling ndb/tools/drop_tab.cpp: simplified common ndb client option handling ndb/tools/listTables.cpp: simplified common ndb client option handling ndb/tools/restore/restore_main.cpp: simplified common ndb client option handling ndb/tools/select_all.cpp: simplified common ndb client option handling ndb/tools/select_count.cpp: simplified common ndb client option handling ndb/tools/waiter.cpp: simplified common ndb client option handling --- ndb/include/Makefile.am | 1 + ndb/include/mgmapi/mgmapi_config_parameters.h | 1 + ndb/include/ndbapi/ndb_opt_defaults.h | 27 +++++++ .../transporter/TransporterDefinitions.hpp | 1 + ndb/include/util/ndb_opts.h | 59 ++++++++++++--- ndb/src/common/mgmcommon/IPCConfig.cpp | 11 ++- ndb/src/common/portlib/NdbThread.c | 19 +++-- .../common/transporter/SHM_Transporter.cpp | 8 +- .../transporter/TransporterRegistry.cpp | 74 ++++++++++++------- ndb/src/cw/cpcd/main.cpp | 5 +- ndb/src/kernel/vm/Configuration.cpp | 23 +----- ndb/src/mgmclient/main.cpp | 23 +----- ndb/src/mgmsrv/ConfigInfo.cpp | 42 ++++++++--- ndb/src/mgmsrv/main.cpp | 32 ++------ ndb/tools/delete_all.cpp | 23 +----- ndb/tools/desc.cpp | 25 +------ ndb/tools/drop_index.cpp | 23 +----- ndb/tools/drop_tab.cpp | 23 +----- ndb/tools/listTables.cpp | 27 ++----- ndb/tools/restore/restore_main.cpp | 20 +---- ndb/tools/select_all.cpp | 23 +----- ndb/tools/select_count.cpp | 23 +----- ndb/tools/waiter.cpp | 25 ++----- 23 files changed, 236 insertions(+), 302 deletions(-) create mode 100644 ndb/include/ndbapi/ndb_opt_defaults.h diff --git a/ndb/include/Makefile.am b/ndb/include/Makefile.am index 38b9d870fbc..ef4e9552566 100644 --- a/ndb/include/Makefile.am +++ b/ndb/include/Makefile.am @@ -8,6 +8,7 @@ ndb_version.h ndbapiinclude_HEADERS = \ ndbapi/ndbapi_limits.h \ +ndbapi/ndb_opt_defaults.h \ ndbapi/Ndb.hpp \ ndbapi/NdbApi.hpp \ ndbapi/NdbConnection.hpp \ diff --git a/ndb/include/mgmapi/mgmapi_config_parameters.h b/ndb/include/mgmapi/mgmapi_config_parameters.h index 406bdb1a110..8a04ee2fe37 100644 --- a/ndb/include/mgmapi/mgmapi_config_parameters.h +++ b/ndb/include/mgmapi/mgmapi_config_parameters.h @@ -121,6 +121,7 @@ #define CFG_SHM_CHECKSUM 501 #define CFG_SHM_KEY 502 #define CFG_SHM_BUFFER_MEM 503 +#define CFG_SHM_SIGNUM 504 #define CFG_SCI_HOST1_ID_0 550 #define CFG_SCI_HOST1_ID_1 551 diff --git a/ndb/include/ndbapi/ndb_opt_defaults.h b/ndb/include/ndbapi/ndb_opt_defaults.h new file mode 100644 index 00000000000..63b673ed60d --- /dev/null +++ b/ndb/include/ndbapi/ndb_opt_defaults.h @@ -0,0 +1,27 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef NDB_OPT_DEFAULTS_H +#define NDB_OPT_DEFAULTS_H + +#ifdef SIGRTMIN +#define OPT_NDB_SHM_SIGNUM_DEFAULT SIGRTMIN+2 +#else +#define OPT_NDB_SHM_SIGNUM_DEFAULT 0 +#endif +#define OPT_NDB_SHM_DEFAULT 0 + +#endif diff --git a/ndb/include/transporter/TransporterDefinitions.hpp b/ndb/include/transporter/TransporterDefinitions.hpp index 4ff6b2073eb..d4763ba4c37 100644 --- a/ndb/include/transporter/TransporterDefinitions.hpp +++ b/ndb/include/transporter/TransporterDefinitions.hpp @@ -77,6 +77,7 @@ struct SHM_TransporterConfiguration { Uint32 shmKey; Uint32 shmSize; + int signum; }; /** diff --git a/ndb/include/util/ndb_opts.h b/ndb/include/util/ndb_opts.h index dc95149f706..aa7a02f58ae 100644 --- a/ndb/include/util/ndb_opts.h +++ b/ndb/include/util/ndb_opts.h @@ -22,24 +22,16 @@ #include #include #include +#include #define NDB_STD_OPTS_VARS \ const char *opt_connect_str= 0;\ -my_bool opt_ndb_shm;\ my_bool opt_ndb_optimized_node_selection -#define NDB_STD_OPTS_OPTIONS \ -OPT_NDB_SHM= 256,\ -OPT_NDB_OPTIMIZED_NODE_SELECTION +my_bool opt_ndb_shm; #define OPT_NDB_CONNECTSTRING 'c' -#if defined(NDB_SHM_TRANSPORTER) && MYSQL_VERSION_ID >= 50000 -#define OPT_NDB_SHM_DEFAULT 1 -#else -#define OPT_NDB_SHM_DEFAULT 0 -#endif - #define NDB_STD_OPTS_COMMON \ { "usage", '?', "Display this help and exit.", \ 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 }, \ @@ -75,4 +67,51 @@ OPT_NDB_OPTIMIZED_NODE_SELECTION #define NDB_STD_OPTS(prog_name) NDB_STD_OPTS_COMMON #endif +static void ndb_std_print_version() +{ + printf("MySQL distrib %s, for %s (%s)\n", + MYSQL_SERVER_VERSION,SYSTEM_TYPE,MACHINE_TYPE); +} + +static void usage(); + +enum ndb_std_options { + OPT_NDB_SHM= 256, + OPT_NDB_SHM_SIGNUM, + OPT_NDB_OPTIMIZED_NODE_SELECTION, + NDB_STD_OPTIONS_LAST /* should always be last in this enum */ +}; + +static my_bool +ndb_std_get_one_option(int optid, + const struct my_option *opt __attribute__((unused)), + const char *argument) +{ + switch (optid) { + case '#': + if (argument) + { + DBUG_PUSH(argument); + } + break; + case 'V': + ndb_std_print_version(); + exit(0); + case '?': + usage(); + exit(0); + case OPT_NDB_SHM: + if (opt_ndb_shm) + { +#ifndef NDB_SHM_TRANSPORTER + printf("Warning: binary not compiled with shared memory support,\n" + "Tcp connections will now be used instead\n"); + opt_ndb_shm= 0; +#endif + } + break; + } + return 0; +} + #endif /*_NDB_OPTS_H */ diff --git a/ndb/src/common/mgmcommon/IPCConfig.cpp b/ndb/src/common/mgmcommon/IPCConfig.cpp index 1da03e3eaf2..86791490863 100644 --- a/ndb/src/common/mgmcommon/IPCConfig.cpp +++ b/ndb/src/common/mgmcommon/IPCConfig.cpp @@ -14,7 +14,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "IPCConfig.hpp" +#include +#include +#include #include #include @@ -381,7 +383,12 @@ IPCConfig::configureTransporters(Uint32 nodeId, if(iter.get(CFG_SHM_KEY, &conf.shmKey)) break; if(iter.get(CFG_SHM_BUFFER_MEM, &conf.shmSize)) break; - + { + Uint32 tmp; + if(iter.get(CFG_SHM_SIGNUM, &tmp)) break; + conf.signum= tmp; + } + conf.port= server_port; conf.localHostName = localHostName; conf.remoteHostName = remoteHostName; diff --git a/ndb/src/common/portlib/NdbThread.c b/ndb/src/common/portlib/NdbThread.c index 8cd6c306514..d05fca7aeed 100644 --- a/ndb/src/common/portlib/NdbThread.c +++ b/ndb/src/common/portlib/NdbThread.c @@ -24,6 +24,10 @@ /*#define USE_PTHREAD_EXTRAS*/ +#ifdef NDB_SHM_TRANSPORTER +int g_ndb_shm_signum= 0; +#endif + struct NdbThread { pthread_t thread; @@ -35,16 +39,21 @@ struct NdbThread static void* ndb_thread_wrapper(void* _ss){ + DBUG_ENTER("ndb_thread_wrapper"); void * ret; struct NdbThread * ss = (struct NdbThread *)_ss; #ifdef NDB_SHM_TRANSPORTER - sigset_t mask; - sigemptyset(&mask); - sigaddset(&mask, SIGUSR1); - pthread_sigmask(SIG_BLOCK, &mask, 0); + if (g_ndb_shm_signum) + { + DBUG_PRINT("info",("Block signum %d",g_ndb_shm_signum)); + sigset_t mask; + sigemptyset(&mask); + sigaddset(&mask, g_ndb_shm_signum); + pthread_sigmask(SIG_BLOCK, &mask, 0); + } #endif ret= (* ss->func)(ss->object); - return ret; + DBUG_RETURN(ret); } diff --git a/ndb/src/common/transporter/SHM_Transporter.cpp b/ndb/src/common/transporter/SHM_Transporter.cpp index f0cbf822e53..eed3ad77be6 100644 --- a/ndb/src/common/transporter/SHM_Transporter.cpp +++ b/ndb/src/common/transporter/SHM_Transporter.cpp @@ -26,6 +26,8 @@ #include #include +extern int g_ndb_shm_signum; + SHM_Transporter::SHM_Transporter(TransporterRegistry &t_reg, const char *lHostName, const char *rHostName, @@ -62,7 +64,9 @@ SHM_Transporter::~SHM_Transporter(){ bool SHM_Transporter::initTransporter(){ - return true; + if (g_ndb_shm_signum) + return true; + return false; } void @@ -355,6 +359,6 @@ SHM_Transporter::doSend() if(m_last_signal) { m_last_signal = 0; - kill(m_remote_pid, SIGUSR1); + kill(m_remote_pid, g_ndb_shm_signum); } } diff --git a/ndb/src/common/transporter/TransporterRegistry.cpp b/ndb/src/common/transporter/TransporterRegistry.cpp index ddc01454205..462cde76740 100644 --- a/ndb/src/common/transporter/TransporterRegistry.cpp +++ b/ndb/src/common/transporter/TransporterRegistry.cpp @@ -38,6 +38,7 @@ #ifdef NDB_SHM_TRANSPORTER #include "SHM_Transporter.hpp" +extern int g_ndb_shm_signum; #endif #include "TransporterCallback.hpp" @@ -148,22 +149,13 @@ TransporterRegistry::disconnectAll(){ bool TransporterRegistry::init(NodeId nodeId) { + DBUG_ENTER("TransporterRegistry::init"); nodeIdSpecified = true; localNodeId = nodeId; DEBUG("TransporterRegistry started node: " << localNodeId); -#ifdef NDB_SHM_TRANSPORTER - /** - * Make sure to block SIGUSR1 - * TransporterRegistry::init is run from "main" thread - */ - sigset_t mask; - sigemptyset(&mask); - sigaddset(&mask, SIGUSR1); - pthread_sigmask(SIG_BLOCK, &mask, 0); -#endif -return true; + DBUG_RETURN(true); } bool @@ -402,6 +394,7 @@ TransporterRegistry::createTransporter(SCI_TransporterConfiguration *config) { bool TransporterRegistry::createTransporter(SHM_TransporterConfiguration *config) { + DBUG_ENTER("TransporterRegistry::createTransporter SHM"); #ifdef NDB_SHM_TRANSPORTER if(!nodeIdSpecified){ init(config->localNodeId); @@ -410,6 +403,22 @@ TransporterRegistry::createTransporter(SHM_TransporterConfiguration *config) { if(config->localNodeId != localNodeId) return false; + if (!g_ndb_shm_signum) { + g_ndb_shm_signum= config->signum; + DBUG_PRINT("info",("Block signum %d",g_ndb_shm_signum)); + /** + * Make sure to block g_ndb_shm_signum + * TransporterRegistry::init is run from "main" thread + */ + sigset_t mask; + sigemptyset(&mask); + sigaddset(&mask, g_ndb_shm_signum); + pthread_sigmask(SIG_BLOCK, &mask, 0); + } + + if(config->signum != g_ndb_shm_signum) + return false; + if(theTransporters[config->remoteNodeId] != NULL) return false; @@ -439,9 +448,9 @@ TransporterRegistry::createTransporter(SHM_TransporterConfiguration *config) { nTransporters++; nSHMTransporters++; - return true; + DBUG_RETURN(true); #else - return false; + DBUG_RETURN(false); #endif } @@ -1311,6 +1320,7 @@ shm_sig_handler(int signo) void TransporterRegistry::startReceiving() { + DBUG_ENTER("TransporterRegistry::startReceiving"); #ifdef NDB_OSE_TRANSPORTER if(theOSEReceiver != NULL){ theOSEReceiver->createPhantom(); @@ -1329,26 +1339,34 @@ TransporterRegistry::startReceiving() #ifdef NDB_SHM_TRANSPORTER m_shm_own_pid = getpid(); - struct sigaction sa; - sigemptyset(&sa.sa_mask); - sigaddset(&sa.sa_mask, SIGUSR1); - pthread_sigmask(SIG_UNBLOCK, &sa.sa_mask, 0); - sa.sa_handler = shm_sig_handler; - sigemptyset(&sa.sa_mask); - sa.sa_flags = 0; - int ret; - while((ret = sigaction(SIGUSR1, &sa, 0)) == -1 && errno == EINTR); - if(ret != 0) + if (g_ndb_shm_signum) { - g_eventLogger.error("Failed to install signal handler for SHM transporter" - " errno: %d (%s)", errno, + DBUG_PRINT("info",("Install signal handler for signum %d", + g_ndb_shm_signum)); + struct sigaction sa; + sigemptyset(&sa.sa_mask); + sigaddset(&sa.sa_mask, g_ndb_shm_signum); + pthread_sigmask(SIG_UNBLOCK, &sa.sa_mask, 0); + sa.sa_handler = shm_sig_handler; + sigemptyset(&sa.sa_mask); + sa.sa_flags = 0; + int ret; + while((ret = sigaction(g_ndb_shm_signum, &sa, 0)) == -1 && errno == EINTR); + if(ret != 0) + { + DBUG_PRINT("error",("Install failed")); + g_eventLogger.error("Failed to install signal handler for" + " SHM transporter errno: %d (%s)", errno, #ifdef HAVE_STRERROR - strerror(errno)); + strerror(errno) #else - ""); + "" #endif + ); + } } -#endif +#endif // NDB_SHM_TRANSPORTER + DBUG_VOID_RETURN; } void diff --git a/ndb/src/cw/cpcd/main.cpp b/ndb/src/cw/cpcd/main.cpp index 300b51d7b5a..25632f132e9 100644 --- a/ndb/src/cw/cpcd/main.cpp +++ b/ndb/src/cw/cpcd/main.cpp @@ -15,7 +15,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include /* Needed for mkdir(2) */ -#include +#include +#include +#include +#include #include "CPCD.hpp" #include "APIService.hpp" diff --git a/ndb/src/kernel/vm/Configuration.cpp b/ndb/src/kernel/vm/Configuration.cpp index 4ad7050ce63..f35a5859ff8 100644 --- a/ndb/src/kernel/vm/Configuration.cpp +++ b/ndb/src/kernel/vm/Configuration.cpp @@ -47,8 +47,7 @@ extern "C" { extern EventLogger g_eventLogger; enum ndbd_options { - NDB_STD_OPTS_OPTIONS, - OPT_INITIAL, + OPT_INITIAL = NDB_STD_OPTIONS_LAST, OPT_NODAEMON }; @@ -82,14 +81,10 @@ static void short_usage_sub(void) { printf("Usage: %s [OPTIONS]\n", my_progname); } -static void print_version() -{ - printf("MySQL distrib %s, for %s (%s)\n",MYSQL_SERVER_VERSION,SYSTEM_TYPE,MACHINE_TYPE); -} static void usage() { short_usage_sub(); - print_version(); + ndb_std_print_version(); my_print_help(my_long_options); my_print_variables(my_long_options); } @@ -97,18 +92,8 @@ static my_bool get_one_option(int optid, const struct my_option *opt __attribute__((unused)), char *argument) { - switch (optid) { - case '#': - DBUG_PUSH(argument ? argument : "d:t:O,/tmp/ndbd.trace"); - break; - case 'V': - print_version(); - exit(0); - case '?': - usage(); - exit(0); - } - return 0; + return ndb_std_get_one_option(optid, opt, + argument ? argument : "d:t:O,/tmp/ndbd.trace"); } bool diff --git a/ndb/src/mgmclient/main.cpp b/ndb/src/mgmclient/main.cpp index 9417c03805f..73f0bad86c0 100644 --- a/ndb/src/mgmclient/main.cpp +++ b/ndb/src/mgmclient/main.cpp @@ -56,9 +56,6 @@ handler(int sig){ } } -enum ndb_mgm_options { - NDB_STD_OPTS_OPTIONS -}; NDB_STD_OPTS_VARS; static const char default_prompt[]= "ndb_mgm> "; @@ -83,14 +80,10 @@ static void short_usage_sub(void) { printf("Usage: %s [OPTIONS] [hostname [port]]\n", my_progname); } -static void print_version() -{ - printf("MySQL distrib %s, for %s (%s)\n",MYSQL_SERVER_VERSION,SYSTEM_TYPE,MACHINE_TYPE); -} static void usage() { short_usage_sub(); - print_version(); + ndb_std_print_version(); my_print_help(my_long_options); my_print_variables(my_long_options); } @@ -98,18 +91,8 @@ static my_bool get_one_option(int optid, const struct my_option *opt __attribute__((unused)), char *argument) { - switch (optid) { - case '#': - DBUG_PUSH(argument ? argument : "d:t:O,/tmp/ndb_mgm.trace"); - break; - case 'V': - print_version(); - exit(0); - case '?': - usage(); - exit(0); - } - return 0; + return ndb_std_get_one_option(optid, opt, argument ? argument : + "d:t:O,/tmp/ndb_mgm.trace"); } static int diff --git a/ndb/src/mgmsrv/ConfigInfo.cpp b/ndb/src/mgmsrv/ConfigInfo.cpp index fa77bc14762..9be4af1b9b5 100644 --- a/ndb/src/mgmsrv/ConfigInfo.cpp +++ b/ndb/src/mgmsrv/ConfigInfo.cpp @@ -15,6 +15,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include +#include #include #include "ConfigInfo.hpp" @@ -1753,6 +1754,18 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { "0", STR_VALUE(MAX_INT_RNIL) }, + { + CFG_SHM_SIGNUM, + "Signum", + "SHM", + "Signum to be used for signalling", + ConfigInfo::CI_USED, + false, + ConfigInfo::CI_INT, + UNDEFINED, + "0", + STR_VALUE(MAX_INT_RNIL) }, + { CFG_CONNECTION_NODE_1, "NodeId1", @@ -3178,18 +3191,27 @@ bool fixShmKey(InitConfigFileParser::Context & ctx, const char *) { DBUG_ENTER("fixShmKey"); - Uint32 id1= 0, id2= 0, key= 0; - require(ctx.m_currentSection->get("NodeId1", &id1)); - require(ctx.m_currentSection->get("NodeId2", &id2)); - if(ctx.m_currentSection->get("ShmKey", &key)) { - DBUG_RETURN(true); + Uint32 signum; + if(!ctx.m_currentSection->get("Signum", &signum)) + { + signum= OPT_NDB_SHM_SIGNUM_DEFAULT; + ctx.m_currentSection->put("Signum", signum); + DBUG_PRINT("info",("Added Signum=%u", signum)); + } + } + { + Uint32 id1= 0, id2= 0, key= 0; + require(ctx.m_currentSection->get("NodeId1", &id1)); + require(ctx.m_currentSection->get("NodeId2", &id2)); + if(!ctx.m_currentSection->get("ShmKey", &key)) + { + require(ctx.m_userProperties.get("ShmUniqueId", &key)); + key= key << 16 | (id1 > id2 ? id1 << 8 | id2 : id2 << 8 | id1); + ctx.m_currentSection->put("ShmKey", key); + DBUG_PRINT("info",("Added ShmKey=0x%x", key)); + } } - - require(ctx.m_userProperties.get("ShmUniqueId", &key)); - key= key << 16 | (id1 > id2 ? id1 << 8 | id2 : id2 << 8 | id1); - ctx.m_currentSection->put("ShmKey", key); - DBUG_PRINT("info",("Added ShmKey=0x%x", key)); DBUG_RETURN(true); } diff --git a/ndb/src/mgmsrv/main.cpp b/ndb/src/mgmsrv/main.cpp index ce79ccb732b..61b83b86538 100644 --- a/ndb/src/mgmsrv/main.cpp +++ b/ndb/src/mgmsrv/main.cpp @@ -91,8 +91,7 @@ extern EventLogger g_eventLogger; extern int global_mgmt_server_check; enum ndb_mgmd_options { - NDB_STD_OPTS_OPTIONS, - OPT_INTERACTIVE, + OPT_INTERACTIVE = NDB_STD_OPTIONS_LAST, OPT_NO_NODEID_CHECKS, OPT_NO_DAEMON }; @@ -139,14 +138,10 @@ static void short_usage_sub(void) { printf("Usage: %s [OPTIONS]\n", my_progname); } -static void print_version() -{ - printf("MySQL distrib %s, for %s (%s)\n",MYSQL_SERVER_VERSION,SYSTEM_TYPE,MACHINE_TYPE); -} static void usage() { short_usage_sub(); - print_version(); + ndb_std_print_version(); my_print_help(my_long_options); my_print_variables(my_long_options); } @@ -154,30 +149,15 @@ static my_bool get_one_option(int optid, const struct my_option *opt __attribute__((unused)), char *argument) { - switch (optid) { - case '#': - DBUG_PUSH(argument ? argument : "d:t:O,/tmp/ndb_mgmd.trace"); - break; - case 'V': - print_version(); - exit(0); + ndb_std_get_one_option(optid, opt, argument ? argument : + "d:t:O,/tmp/ndb_mgmd.trace"); #if NDB_VERSION_MAJOR <= 4 + switch (optid) { case 'c': printf("Warning: -c will be removed in 5.0, use -f instead\n"); break; -#endif - case OPT_NDB_SHM: -#ifndef NDB_SHM_TRANSPORTER - printf("Warning: binary not compiled with shared memory support,\n" - "use configure option --with-ndb-shm to enable support.\n" - "Tcp connections will now be used instead\n"); - opt_ndb_shm= 0; -#endif - break; - case '?': - usage(); - exit(0); } +#endif return 0; } diff --git a/ndb/tools/delete_all.cpp b/ndb/tools/delete_all.cpp index cdfaf2134ff..21e0c2ac089 100644 --- a/ndb/tools/delete_all.cpp +++ b/ndb/tools/delete_all.cpp @@ -24,9 +24,6 @@ static int clear_table(Ndb* pNdb, const NdbDictionary::Table* pTab, int parallelism=240); -enum ndb_delete_all { - NDB_STD_OPTS_OPTIONS -}; NDB_STD_OPTS_VARS; static const char* _dbname = "TEST_DB"; @@ -38,16 +35,12 @@ static struct my_option my_long_options[] = GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} }; -static void print_version() -{ - printf("MySQL distrib %s, for %s (%s)\n",MYSQL_SERVER_VERSION,SYSTEM_TYPE,MACHINE_TYPE); -} static void usage() { char desc[] = "tabname\n"\ "This program will delete all records in the specified table using scan delete.\n"; - print_version(); + ndb_std_print_version(); my_print_help(my_long_options); my_print_variables(my_long_options); } @@ -55,18 +48,8 @@ static my_bool get_one_option(int optid, const struct my_option *opt __attribute__((unused)), char *argument) { - switch (optid) { - case '#': - DBUG_PUSH(argument ? argument : "d:t:O,/tmp/ndb_delete_all.trace"); - break; - case 'V': - print_version(); - exit(0); - case '?': - usage(); - exit(0); - } - return 0; + return ndb_std_get_one_option(optid, opt, argument ? argument : + "d:t:O,/tmp/ndb_delete_all.trace"); } int main(int argc, char** argv){ diff --git a/ndb/tools/desc.cpp b/ndb/tools/desc.cpp index 4bca51ee903..4287a771694 100644 --- a/ndb/tools/desc.cpp +++ b/ndb/tools/desc.cpp @@ -19,9 +19,6 @@ #include #include -enum ndb_desc_options { - NDB_STD_OPTS_OPTIONS -}; NDB_STD_OPTS_VARS; static const char* _dbname = "TEST_DB"; @@ -37,17 +34,13 @@ static struct my_option my_long_options[] = GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} }; -static void print_version() -{ - printf("MySQL distrib %s, for %s (%s)\n",MYSQL_SERVER_VERSION,SYSTEM_TYPE,MACHINE_TYPE); -} static void usage() { char desc[] = "tabname\n"\ "This program list all properties of table(s) in NDB Cluster.\n"\ - " ex: desc T1 T2 T4\n"; - print_version(); + " ex: desc T1 T2 T4\n"; + ndb_std_print_version(); my_print_help(my_long_options); my_print_variables(my_long_options); } @@ -55,18 +48,8 @@ static my_bool get_one_option(int optid, const struct my_option *opt __attribute__((unused)), char *argument) { - switch (optid) { - case '#': - DBUG_PUSH(argument ? argument : "d:t:O,/tmp/ndb_desc.trace"); - break; - case 'V': - print_version(); - exit(0); - case '?': - usage(); - exit(0); - } - return 0; + return ndb_std_get_one_option(optid, opt, argument ? argument : + "d:t:O,/tmp/ndb_desc.trace"); } int main(int argc, char** argv){ diff --git a/ndb/tools/drop_index.cpp b/ndb/tools/drop_index.cpp index 2b7f8c1bce9..2fcba41bd11 100644 --- a/ndb/tools/drop_index.cpp +++ b/ndb/tools/drop_index.cpp @@ -21,9 +21,6 @@ #include #include -enum ndb_drop_index_options { - NDB_STD_OPTS_OPTIONS -}; NDB_STD_OPTS_VARS; static const char* _dbname = "TEST_DB"; @@ -35,16 +32,12 @@ static struct my_option my_long_options[] = GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} }; -static void print_version() -{ - printf("MySQL distrib %s, for %s (%s)\n",MYSQL_SERVER_VERSION,SYSTEM_TYPE,MACHINE_TYPE); -} static void usage() { char desc[] = "+\n"\ "This program will drop index(es) in Ndb\n"; - print_version(); + ndb_std_print_version(); my_print_help(my_long_options); my_print_variables(my_long_options); } @@ -52,18 +45,8 @@ static my_bool get_one_option(int optid, const struct my_option *opt __attribute__((unused)), char *argument) { - switch (optid) { - case '#': - DBUG_PUSH(argument ? argument : "d:t:O,/tmp/ndb_drop_index.trace"); - break; - case 'V': - print_version(); - exit(0); - case '?': - usage(); - exit(0); - } - return 0; + return ndb_std_get_one_option(optid, opt, argument ? argument : + "d:t:O,/tmp/ndb_drop_index.trace"); } int main(int argc, char** argv){ diff --git a/ndb/tools/drop_tab.cpp b/ndb/tools/drop_tab.cpp index 2b0b6908449..091db5cc4b7 100644 --- a/ndb/tools/drop_tab.cpp +++ b/ndb/tools/drop_tab.cpp @@ -21,9 +21,6 @@ #include #include -enum ndb_drop_table_options { - NDB_STD_OPTS_OPTIONS -}; NDB_STD_OPTS_VARS; static const char* _dbname = "TEST_DB"; @@ -35,16 +32,12 @@ static struct my_option my_long_options[] = GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} }; -static void print_version() -{ - printf("MySQL distrib %s, for %s (%s)\n",MYSQL_SERVER_VERSION,SYSTEM_TYPE,MACHINE_TYPE); -} static void usage() { char desc[] = "tabname\n"\ "This program will drop one table in Ndb\n"; - print_version(); + ndb_std_print_version(); my_print_help(my_long_options); my_print_variables(my_long_options); } @@ -52,18 +45,8 @@ static my_bool get_one_option(int optid, const struct my_option *opt __attribute__((unused)), char *argument) { - switch (optid) { - case '#': - DBUG_PUSH(argument ? argument : "d:t:O,/tmp/ndb_drop_table.trace"); - break; - case 'V': - print_version(); - exit(0); - case '?': - usage(); - exit(0); - } - return 0; + return ndb_std_get_one_option(optid, opt, argument ? argument : + "d:t:O,/tmp/ndb_drop_table.trace"); } int main(int argc, char** argv){ diff --git a/ndb/tools/listTables.cpp b/ndb/tools/listTables.cpp index 710af66f4de..064ec299ef9 100644 --- a/ndb/tools/listTables.cpp +++ b/ndb/tools/listTables.cpp @@ -161,9 +161,6 @@ list(const char * tabname, } } -enum ndb_show_tables_options { - NDB_STD_OPTS_OPTIONS -}; NDB_STD_OPTS_VARS; static const char* _dbname = "TEST_DB"; @@ -186,20 +183,16 @@ static struct my_option my_long_options[] = GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} }; -static void print_version() -{ - printf("MySQL distrib %s, for %s (%s)\n",MYSQL_SERVER_VERSION,SYSTEM_TYPE,MACHINE_TYPE); -} static void usage() { char desc[] = "tabname\n"\ "This program list all system objects in NDB Cluster.\n"\ "Type of objects to display can be limited with -t option\n"\ - " ex: list_tables -t 2 would show all UserTables\n"\ + " ex: ndb_show_tables -t 2 would show all UserTables\n"\ "To show all indexes for a table write table name as final argument\n"\ - " ex: list_tables T1\n"; - print_version(); + " ex: ndb_show_tables T1\n"; + ndb_std_print_version(); my_print_help(my_long_options); my_print_variables(my_long_options); } @@ -207,18 +200,8 @@ static my_bool get_one_option(int optid, const struct my_option *opt __attribute__((unused)), char *argument) { - switch (optid) { - case '#': - DBUG_PUSH(argument ? argument : "d:t:O,/tmp/ndb_show_tables.trace"); - break; - case 'V': - print_version(); - exit(0); - case '?': - usage(); - exit(0); - } - return 0; + return ndb_std_get_one_option(optid, opt, argument ? argument : + "d:t:O,/tmp/ndb_show_tables.trace"); } int main(int argc, char** argv){ diff --git a/ndb/tools/restore/restore_main.cpp b/ndb/tools/restore/restore_main.cpp index c24ed620b71..84f9511fe2f 100644 --- a/ndb/tools/restore/restore_main.cpp +++ b/ndb/tools/restore/restore_main.cpp @@ -36,9 +36,6 @@ static Vector g_consumers; static const char* ga_backupPath = "." DIR_SEPARATOR; -enum ndb_restore_options { - NDB_STD_OPTS_OPTIONS -}; NDB_STD_OPTS_VARS; /** @@ -101,14 +98,10 @@ static void short_usage_sub(void) { printf("Usage: %s [OPTIONS] []\n", my_progname); } -static void print_version() -{ - printf("MySQL distrib %s, for %s (%s)\n",MYSQL_SERVER_VERSION,SYSTEM_TYPE,MACHINE_TYPE); -} static void usage() { short_usage_sub(); - print_version(); + ndb_std_print_version(); my_print_help(my_long_options); my_print_variables(my_long_options); } @@ -116,13 +109,9 @@ static my_bool get_one_option(int optid, const struct my_option *opt __attribute__((unused)), char *argument) { + ndb_std_get_one_option(optid, opt, argument ? argument : + "d:t:O,/tmp/ndb_restore.trace"); switch (optid) { - case '#': - DBUG_PUSH(argument ? argument : "d:t:O,/tmp/ndb_restore.trace"); - break; - case 'V': - print_version(); - exit(0); case 'n': if (ga_nodeId == 0) { @@ -137,9 +126,6 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), exit(1); } break; - case '?': - usage(); - exit(0); } return 0; } diff --git a/ndb/tools/select_all.cpp b/ndb/tools/select_all.cpp index 9c65750094b..23fd2290349 100644 --- a/ndb/tools/select_all.cpp +++ b/ndb/tools/select_all.cpp @@ -36,9 +36,6 @@ int scanReadRecords(Ndb*, char delim, bool orderby); -enum ndb_select_all_options { - NDB_STD_OPTS_OPTIONS -}; NDB_STD_OPTS_VARS; static const char* _dbname = "TEST_DB"; @@ -72,10 +69,6 @@ static struct my_option my_long_options[] = GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} }; -static void print_version() -{ - printf("MySQL distrib %s, for %s (%s)\n",MYSQL_SERVER_VERSION,SYSTEM_TYPE,MACHINE_TYPE); -} static void usage() { char desc[] = @@ -85,7 +78,7 @@ static void usage() "(It only print error messages if it encounters a permanent error.)\n"\ "It can also be used to dump the content of a table to file \n"\ " ex: select_all --no-header --delimiter=';' T4 > T4.data\n"; - print_version(); + ndb_std_print_version(); my_print_help(my_long_options); my_print_variables(my_long_options); } @@ -93,18 +86,8 @@ static my_bool get_one_option(int optid, const struct my_option *opt __attribute__((unused)), char *argument) { - switch (optid) { - case '#': - DBUG_PUSH(argument ? argument : "d:t:O,/tmp/ndb_select_all.trace"); - break; - case 'V': - print_version(); - exit(0); - case '?': - usage(); - exit(0); - } - return 0; + return ndb_std_get_one_option(optid, opt, argument ? argument : + "d:t:O,/tmp/ndb_select_all.trace"); } int main(int argc, char** argv){ diff --git a/ndb/tools/select_count.cpp b/ndb/tools/select_count.cpp index 516eebda91d..a9a3e71da67 100644 --- a/ndb/tools/select_count.cpp +++ b/ndb/tools/select_count.cpp @@ -32,9 +32,6 @@ select_count(Ndb* pNdb, const NdbDictionary::Table* pTab, int* count_rows, UtilTransactions::ScanLock lock); -enum ndb_select_count_options { - NDB_STD_OPTS_OPTIONS -}; NDB_STD_OPTS_VARS; static const char* _dbname = "TEST_DB"; @@ -54,16 +51,12 @@ static struct my_option my_long_options[] = GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} }; -static void print_version() -{ - printf("MySQL distrib %s, for %s (%s)\n",MYSQL_SERVER_VERSION,SYSTEM_TYPE,MACHINE_TYPE); -} static void usage() { char desc[] = "tabname1 ... tabnameN\n"\ "This program will count the number of records in tables\n"; - print_version(); + ndb_std_print_version(); my_print_help(my_long_options); my_print_variables(my_long_options); } @@ -71,18 +64,8 @@ static my_bool get_one_option(int optid, const struct my_option *opt __attribute__((unused)), char *argument) { - switch (optid) { - case '#': - DBUG_PUSH(argument ? argument : "d:t:O,/tmp/ndb_select_count.trace"); - break; - case 'V': - print_version(); - exit(0); - case '?': - usage(); - exit(0); - } - return 0; + return ndb_std_get_one_option(optid, opt, argument ? argument : + "d:t:O,/tmp/ndb_select_count.trace"); } int main(int argc, char** argv){ diff --git a/ndb/tools/waiter.cpp b/ndb/tools/waiter.cpp index dfdb11524e3..cc6a21428c8 100644 --- a/ndb/tools/waiter.cpp +++ b/ndb/tools/waiter.cpp @@ -31,8 +31,7 @@ waitClusterStatus(const char* _addr, ndb_mgm_node_status _status, unsigned int _timeout); enum ndb_waiter_options { - NDB_STD_OPTS_OPTIONS, - OPT_WAIT_STATUS_NOT_STARTED + OPT_WAIT_STATUS_NOT_STARTED = NDB_STD_OPTIONS_LAST }; NDB_STD_OPTS_VARS; @@ -53,32 +52,20 @@ static struct my_option my_long_options[] = GET_INT, REQUIRED_ARG, 120, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} }; -static void print_version() -{ - printf("MySQL distrib %s, for %s (%s)\n",MYSQL_SERVER_VERSION,SYSTEM_TYPE,MACHINE_TYPE); -} + static void usage() { - print_version(); + ndb_std_print_version(); my_print_help(my_long_options); my_print_variables(my_long_options); } + static my_bool get_one_option(int optid, const struct my_option *opt __attribute__((unused)), char *argument) { - switch (optid) { - case '#': - DBUG_PUSH(argument ? argument : "d:t:O,/tmp/ndb_drop_table.trace"); - break; - case 'V': - print_version(); - exit(0); - case '?': - usage(); - exit(0); - } - return 0; + return ndb_std_get_one_option(optid, opt, argument ? argument : + "d:t:O,/tmp/ndb_drop_table.trace"); } int main(int argc, char** argv){ From 418a06308b6abe8462f5942e0dcf4455fb2073b5 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 28 Jan 2005 02:06:27 +0100 Subject: [PATCH 0862/1063] Do-compile: ndbcluster requires more ports, this is the reason why builds will not start on multiple builds Build-tools/Do-compile: ndbcluster requires more ports, this is the reason why builds will not start on multiple builds --- Build-tools/Do-compile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Build-tools/Do-compile b/Build-tools/Do-compile index b431f9fc1c5..4034533f2eb 100755 --- a/Build-tools/Do-compile +++ b/Build-tools/Do-compile @@ -155,7 +155,7 @@ $ENV{'MYSQL_TCP_PORT'}= $mysql_tcp_port= 3334 + $opt_build_thread*2; $ENV{'MYSQL_UNIX_PORT'}=$mysql_unix_port="$opt_tmp/mysql$opt_suffix.build"; $ENV{"PERL5LIB"}="$pwd/$host/perl5:$pwd/$host/perl5/site_perl"; $slave_port=$mysql_tcp_port+16; -$ndbcluster_port= 9350 + $opt_build_thread*2; +$ndbcluster_port= 9350 + $opt_build_thread*4; $manager_port=$mysql_tcp_port+1; $mysqladmin_args="--no-defaults -u root --connect_timeout=5 --shutdown_timeout=20"; From bd556f0d709a324f7d33e2ae561164a90b0f04c9 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 28 Jan 2005 09:15:01 +0100 Subject: [PATCH 0863/1063] NdbThread.c: wrong order in c-file ndb/src/common/portlib/NdbThread.c: wrong order in c-file --- ndb/src/common/portlib/NdbThread.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ndb/src/common/portlib/NdbThread.c b/ndb/src/common/portlib/NdbThread.c index d05fca7aeed..5f2e6021c43 100644 --- a/ndb/src/common/portlib/NdbThread.c +++ b/ndb/src/common/portlib/NdbThread.c @@ -39,14 +39,14 @@ struct NdbThread static void* ndb_thread_wrapper(void* _ss){ - DBUG_ENTER("ndb_thread_wrapper"); void * ret; struct NdbThread * ss = (struct NdbThread *)_ss; + DBUG_ENTER("ndb_thread_wrapper"); #ifdef NDB_SHM_TRANSPORTER if (g_ndb_shm_signum) { - DBUG_PRINT("info",("Block signum %d",g_ndb_shm_signum)); sigset_t mask; + DBUG_PRINT("info",("Block signum %d",g_ndb_shm_signum)); sigemptyset(&mask); sigaddset(&mask, g_ndb_shm_signum); pthread_sigmask(SIG_BLOCK, &mask, 0); From 9b3bfa5f142d412e593134ceac184ededf990e97 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 28 Jan 2005 10:51:30 +0100 Subject: [PATCH 0864/1063] ndb - fix DATE printout ndb/src/ndbapi/NdbRecAttr.cpp: fix DATE printout --- ndb/src/ndbapi/NdbRecAttr.cpp | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/ndb/src/ndbapi/NdbRecAttr.cpp b/ndb/src/ndbapi/NdbRecAttr.cpp index 6749a0f04d9..9c9a9cea8da 100644 --- a/ndb/src/ndbapi/NdbRecAttr.cpp +++ b/ndb/src/ndbapi/NdbRecAttr.cpp @@ -242,12 +242,24 @@ NdbOut& operator<<(NdbOut& out, const NdbRecAttr &r) break; case NdbDictionary::Column::Date: { - uint tmp=uint3korr(r.aRef()); - int year=(int) ((uint32) tmp/10000L % 10000); - int month=(int) ((uint32) tmp/100 % 100); - int day=(int) ((uint32) tmp % 100); + uint32 tmp=(uint32) uint3korr(r.aRef()); + int part; char buf[40]; - sprintf(buf, "%04d-%02d-%02d", year, month, day); + char *pos=(char*) buf+10; + *pos--=0; + part=(int) (tmp & 31); + *pos--= (char) ('0'+part%10); + *pos--= (char) ('0'+part/10); + *pos--= '-'; + part=(int) (tmp >> 5 & 15); + *pos--= (char) ('0'+part%10); + *pos--= (char) ('0'+part/10); + *pos--= '-'; + part=(int) (tmp >> 9); + *pos--= (char) ('0'+part%10); part/=10; + *pos--= (char) ('0'+part%10); part/=10; + *pos--= (char) ('0'+part%10); part/=10; + *pos= (char) ('0'+part); out << buf; } break; From 3487cba72d6d6ddabd55e5d220cecffa28c6f9ce Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 28 Jan 2005 15:26:17 +0400 Subject: [PATCH 0865/1063] A fix (bug #6000: No "@%"-accounts after install). scripts/mysql_install_db.sh: A fix (bug #6000: No "@%"-accounts after install). Why do we need those REPLACE queries? Removed $hostname queries for windows builds. --- scripts/mysql_install_db.sh | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 8d47d67792a..40827f8b6ef 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -275,14 +275,16 @@ then c_u="$c_u )" c_u="$c_u comment='Users and global privileges';" - i_u="INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); - INSERT INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); - - REPLACE INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); - REPLACE INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); - - INSERT INTO user (host,user) values ('localhost',''); - INSERT INTO user (host,user) values ('$hostname','');" + if test "$windows" = 1 + then + i_u="INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); + INSERT INTO user (host,user) values ('localhost','');" + else + i_u="INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); + INSERT INTO user VALUES ('$hostname','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); + INSERT INTO user (host,user) values ('localhost',''); + INSERT INTO user (host,user) values ('$hostname','');" + fi fi if test ! -f $mdata/func.frm From c392de41b2ca3c19b3b9bfad0257dc32b6436f55 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 28 Jan 2005 20:58:16 +0200 Subject: [PATCH 0866/1063] os0file.c: Fix Windows porting bugs that broke ibbackup: 1) wrong error check in for CreateDirectory(), 2) wrong error check if the file did not exist in DeleteFile(), 3) too strict sharing restrictions in os_file_create_simple(): when ibbackup called that function, it would not allow mysqld to write to the file innobase/os/os0file.c: Fix Windows porting bugs that broke ibbackup: 1) wrong error check in for CreateDirectory(), 2) wrong error check if the file did not exist in DeleteFile(), 3) too strict sharing restrictions in os_file_create_simple(): when ibbackup called that function, it would not allow mysqld to write to the file --- innobase/os/os0file.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/innobase/os/os0file.c b/innobase/os/os0file.c index 070096f4760..cc743ffad41 100644 --- a/innobase/os/os0file.c +++ b/innobase/os/os0file.c @@ -823,7 +823,7 @@ os_file_create_directory( rcode = CreateDirectory(pathname, NULL); if (!(rcode != 0 || - (GetLastError() == ERROR_FILE_EXISTS && !fail_if_exists))) { + (GetLastError() == ERROR_ALREADY_EXISTS && !fail_if_exists))) { /* failure */ os_file_handle_error(pathname, "CreateDirectory"); @@ -907,8 +907,9 @@ try_again: file = CreateFile(name, access, - FILE_SHARE_READ,/* file can be read also by other - processes */ + FILE_SHARE_READ | FILE_SHARE_WRITE, + /* file can be read ansd written also + by other processes */ NULL, /* default security attributes */ create_flag, attributes, @@ -1013,7 +1014,7 @@ os_file_create_simple_no_error_handling( DWORD create_flag; DWORD access; DWORD attributes = 0; - DWORD share_mode = FILE_SHARE_READ; + DWORD share_mode = FILE_SHARE_READ | FILE_SHARE_WRITE; ut_a(name); @@ -1336,7 +1337,7 @@ loop: return(TRUE); } - if (GetLastError() == ERROR_PATH_NOT_FOUND) { + if (GetLastError() == ERROR_FILE_NOT_FOUND) { /* the file does not exist, this not an error */ return(TRUE); @@ -1397,7 +1398,7 @@ loop: return(TRUE); } - if (GetLastError() == ERROR_PATH_NOT_FOUND) { + if (GetLastError() == ERROR_FILE_NOT_FOUND) { /* If the file does not exist, we classify this as a 'mild' error and return */ From d848286e70a4e257ee7ebab5966cd33b40e12c03 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 28 Jan 2005 11:16:49 -0800 Subject: [PATCH 0867/1063] Use single quotes to set SQL_MODE in mysqldump output in case ANSI_QUOTES was already defined on the server the dump is loaded into. (Bug #8148) client/mysqldump.c: Use single quotes when setting SQL_MODE --- client/mysqldump.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/mysqldump.c b/client/mysqldump.c index 00f5272e3d7..fb83947346d 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -489,7 +489,7 @@ static void write_header(FILE *sql_file, char *db_name) "); } fprintf(sql_file, - "/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE=\"%s%s%s\" */;\n", + "/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='%s%s%s' */;\n", path?"":"NO_AUTO_VALUE_ON_ZERO",compatible_mode_normal_str[0]==0?"":",", compatible_mode_normal_str); check_io(sql_file); @@ -863,7 +863,7 @@ static int dbConnect(char *host, char *user,char *passwd) cannot reconnect. */ sock->reconnect= 0; - sprintf(buff, "/*!40100 SET @@SQL_MODE=\"%s\" */", + sprintf(buff, "/*!40100 SET @@SQL_MODE='%s' */", compatible_mode_normal_str); if (mysql_query_with_error_report(sock, 0, buff)) { From 47f15599e81f5e75599ac1574e6118a89d98c21e Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 28 Jan 2005 21:49:21 +0200 Subject: [PATCH 0868/1063] ut0ut.c: Use a 32-bit right-shift implementation through a 64-bit integer that should work ok for both gcc and Visual C++; the code depended on defining SIZEOF_LONG, and that is not set when compiling ibbackup innobase/ut/ut0ut.c: Use a 32-bit right-shift implementation through a 64-bit integer that should work ok for both gcc and Visual C++; the code depended on defining SIZEOF_LONG, and that is not set when compiling ibbackup --- innobase/ut/ut0ut.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/innobase/ut/ut0ut.c b/innobase/ut/ut0ut.c index 732380bcb1f..18722149a8f 100644 --- a/innobase/ut/ut0ut.c +++ b/innobase/ut/ut0ut.c @@ -44,13 +44,13 @@ ut_get_high32( /* out: a >> 32 */ ulint a) /* in: ulint */ { -#if SIZEOF_LONG == 4 - UT_NOT_USED(a); + ib_longlong i; - return 0; -#else - return(a >> 32); -#endif + i = (ib_longlong)a; + + i = i >> 32; + + return((ulint)i); } /************************************************************ From af68c169abb5720b482bcb5163b177473c8cea97 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 28 Jan 2005 12:13:01 -0800 Subject: [PATCH 0869/1063] Fix test results for mysqldump test. Part of Bug #8148. mysql-test/r/mysqldump.result: Update results --- mysql-test/r/mysqldump.result | 36 +++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index 623bd2a0f3c..8f2294caa48 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -60,7 +60,7 @@ INSERT INTO `t1` VALUES ('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456) /*!40101 SET NAMES utf8 */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; -/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; DROP TABLE IF EXISTS `t1`; CREATE TABLE `t1` ( `a` decimal(10,5) default NULL, @@ -83,7 +83,7 @@ UNLOCK TABLES; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; -/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; CREATE TABLE `t1` ( `a` decimal(10,5) default NULL, `b` float default NULL @@ -149,7 +149,7 @@ INSERT INTO t1 VALUES (_koi8r x'C1C2C3C4C5'), (NULL); /*!40101 SET NAMES utf8 */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; -/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; DROP TABLE IF EXISTS `t1`; CREATE TABLE `t1` ( `a` varchar(255) default NULL @@ -175,7 +175,7 @@ CREATE TABLE t1 (a int) ENGINE=MYISAM; INSERT INTO t1 VALUES (1), (2); /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; -/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE="NO_AUTO_VALUE_ON_ZERO,MYSQL40" */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL40' */; DROP TABLE IF EXISTS `t1`; CREATE TABLE `t1` ( `a` int(11) default NULL @@ -194,7 +194,7 @@ UNLOCK TABLES; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; -/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE="NO_AUTO_VALUE_ON_ZERO,MYSQL323" */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL323' */; DROP TABLE IF EXISTS `t1`; CREATE TABLE `t1` ( `a` int(11) default NULL @@ -225,7 +225,7 @@ create table t1(a int); /*!40101 SET NAMES utf8 */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; -/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; DROP TABLE IF EXISTS `t1`; CREATE TABLE `t1` ( `a` int(11) default NULL @@ -246,7 +246,7 @@ UNLOCK TABLES; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; -/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE="NO_AUTO_VALUE_ON_ZERO,ANSI" */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,ANSI' */; DROP TABLE IF EXISTS "t1"; CREATE TABLE "t1" ( "a" int(11) default NULL @@ -270,7 +270,7 @@ set global sql_mode='ANSI_QUOTES'; /*!40101 SET NAMES utf8 */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; -/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; DROP TABLE IF EXISTS `t1`; CREATE TABLE `t1` ( `a` int(11) default NULL @@ -291,7 +291,7 @@ UNLOCK TABLES; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; -/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE="NO_AUTO_VALUE_ON_ZERO,ANSI" */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,ANSI' */; DROP TABLE IF EXISTS "t1"; CREATE TABLE "t1" ( "a" int(11) default NULL @@ -316,7 +316,7 @@ insert into t1 values (1),(2),(3); /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; -/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE="" */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='' */; DROP TABLE IF EXISTS `t1`; CREATE TABLE `t1` ( `a` int(11) default NULL @@ -339,7 +339,7 @@ drop table t1; /*!40101 SET NAMES utf8 */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; -/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET latin1 */; @@ -360,7 +360,7 @@ create database mysqldump_test_db character set latin2 collate latin2_bin; /*!40101 SET NAMES utf8 */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; -/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqldump_test_db` /*!40100 DEFAULT CHARACTER SET latin2 COLLATE latin2_bin */; @@ -383,7 +383,7 @@ INSERT INTO t1 VALUES (_latin1 ' /*!40101 SET NAMES utf8 */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; -/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; DROP TABLE IF EXISTS `t1`; CREATE TABLE `t1` ( `a` char(10) default NULL @@ -405,7 +405,7 @@ UNLOCK TABLES; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; -/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE="NO_AUTO_VALUE_ON_ZERO,MYSQL323" */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL323' */; DROP TABLE IF EXISTS `t1`; CREATE TABLE `t1` ( `a` char(10) default NULL @@ -424,7 +424,7 @@ UNLOCK TABLES; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; -/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE="NO_AUTO_VALUE_ON_ZERO,MYSQL323" */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL323' */; DROP TABLE IF EXISTS `t1`; CREATE TABLE `t1` ( `a` char(10) default NULL @@ -443,7 +443,7 @@ UNLOCK TABLES; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; -/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE="NO_AUTO_VALUE_ON_ZERO,MYSQL323" */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL323' */; DROP TABLE IF EXISTS `t1`; CREATE TABLE `t1` ( `a` char(10) default NULL @@ -462,7 +462,7 @@ UNLOCK TABLES; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; -/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE="NO_AUTO_VALUE_ON_ZERO,MYSQL323" */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL323' */; DROP TABLE IF EXISTS `t1`; CREATE TABLE `t1` ( `a` char(10) default NULL @@ -491,7 +491,7 @@ INSERT INTO t2 VALUES (4),(5),(6); /*!40101 SET NAMES utf8 */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; -/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; DROP TABLE IF EXISTS `t2`; CREATE TABLE `t2` ( `a` int(11) default NULL From 96e4281f059cd6d534338c539a9e44caff984b93 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 28 Jan 2005 16:43:10 -0800 Subject: [PATCH 0870/1063] Cleanup for lost file descriptors on close table for ha_archive. sql/examples/ha_archive.cc: More comments, fixed issue with lost file descriptors. BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted --- BitKeeper/etc/logging_ok | 1 + sql/examples/ha_archive.cc | 26 +++++++++++++++----------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok index 52b8b0584bc..a579cac30bd 100644 --- a/BitKeeper/etc/logging_ok +++ b/BitKeeper/etc/logging_ok @@ -33,6 +33,7 @@ bk@mysql.r18.ru brian@avenger.(none) brian@brian-akers-computer.local brian@private-client-ip-101.oz.net +brian@zim.(none) carsten@tsort.bitbybit.dk davida@isil.mysql.com dellis@goetia.(none) diff --git a/sql/examples/ha_archive.cc b/sql/examples/ha_archive.cc index ef609513489..75fba96cad9 100644 --- a/sql/examples/ha_archive.cc +++ b/sql/examples/ha_archive.cc @@ -42,18 +42,20 @@ handle bulk inserts as well (that is if someone was trying to read at the same time since we would want to flush). - A "meta" file is kept. All this file does is contain information on - the number of rows. + A "meta" file is kept alongside the data file. This file serves two purpose. + The first purpose is to track the number of rows in the table. The second + purpose is to determine if the table was closed properly or not. When the + meta file is first opened it is marked as dirty. It is opened when the table + itself is opened for writing. When the table is closed the new count for rows + is written to the meta file and the file is marked as clean. If the meta file + is opened and it is marked as dirty, it is assumed that a crash occured. At + this point an error occurs and the user is told to rebuild the file. + A rebuild scans the rows and rewrites the meta file. If corruption is found + in the data file then the meta file is not repaired. - No attempts at durability are made. You can corrupt your data. A repair - method was added to repair the meta file that stores row information, - but if your data file gets corrupted I haven't solved that. I could - create a repair that would solve this, but do you want to take a - chance of loosing your data? + At some point a recovery method for such a drastic case needs to be divised. - Locks are row level, and you will get a consistant read. Transactions - will be added later (they are not that hard to add at this - stage). + Locks are row level, and you will get a consistant read. For performance as far as table scans go it is quite fast. I don't have good numbers but locally it has out performed both Innodb and MyISAM. For @@ -88,7 +90,6 @@ compression but may speed up ordered searches). Checkpoint the meta file to allow for faster rebuilds. Dirty open (right now the meta file is repaired if a crash occured). - Transactions. Option to allow for dirty reads, this would lower the sync calls, which would make inserts a lot faster, but would mean highly arbitrary reads. @@ -333,6 +334,7 @@ ARCHIVE_SHARE *ha_archive::get_share(const char *table_name, TABLE *table) opposite. */ (void)write_meta_file(share->meta_file, share->rows_recorded, TRUE); + /* It is expensive to open and close the data files and since you can't have a gzip file that can be both read and written we keep a writer open @@ -379,6 +381,8 @@ int ha_archive::free_share(ARCHIVE_SHARE *share) (void)write_meta_file(share->meta_file, share->rows_recorded, FALSE); if (gzclose(share->archive_write) == Z_ERRNO) rc= 1; + if (my_close(share->meta_file, MYF(0))) + rc= 1; my_free((gptr) share, MYF(0)); } pthread_mutex_unlock(&archive_mutex); From c2383412b243e05ec01434b8667aafa3559225b3 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 28 Jan 2005 17:18:35 -0800 Subject: [PATCH 0871/1063] Fix error in string comparisons with CHAR(31) against the space-padding of strings of unequal length. (Bug #8134) mysql-test/t/compare.test: Add new regression test strings/ctype-simple.c: Fix value used for swapping negative/positive values using XOR mysql-test/r/compare.result: Add new test result --- mysql-test/r/compare.result | 3 +++ mysql-test/t/compare.test | 3 +++ strings/ctype-simple.c | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/compare.result b/mysql-test/r/compare.result index bf8a5106044..49ec2dd85cc 100644 --- a/mysql-test/r/compare.result +++ b/mysql-test/r/compare.result @@ -36,3 +36,6 @@ hex(a) STRCMP(a,'a') STRCMP(a,'a ') 6109 -1 -1 61 0 0 DROP TABLE t1; +SELECT CHAR(31) = '', '' = CHAR(31); +CHAR(31) = '' '' = CHAR(31) +0 0 diff --git a/mysql-test/t/compare.test b/mysql-test/t/compare.test index b0cef48dd3f..e3c042e608a 100644 --- a/mysql-test/t/compare.test +++ b/mysql-test/t/compare.test @@ -30,3 +30,6 @@ CREATE TABLE t1 (a char(10) not null); INSERT INTO t1 VALUES ('a'),('a\0'),('a\t'),('a '); SELECT hex(a),STRCMP(a,'a'), STRCMP(a,'a ') FROM t1; DROP TABLE t1; + +# Bug #8134: Comparison against CHAR(31) at end of string +SELECT CHAR(31) = '', '' = CHAR(31); diff --git a/strings/ctype-simple.c b/strings/ctype-simple.c index 5bfa9e52595..4dc6a1be27b 100644 --- a/strings/ctype-simple.c +++ b/strings/ctype-simple.c @@ -153,7 +153,7 @@ int my_strnncollsp_simple(CHARSET_INFO * cs, const uchar *a, uint a_length, /* put shorter key in s */ a_length= b_length; a= b; - swap= -1; /* swap sign of result */ + swap= -1^1; /* swap sign of result */ } for (end= a + a_length-length; a < end ; a++) { From 79016ecb2c068effd0dee57e96c610988825c074 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 29 Jan 2005 09:25:56 -0600 Subject: [PATCH 0872/1063] Bug #5185 mysqldump for windows database gets table names with different case mysqldump.c: Trimmed some lines to be less than 80 chars. Using just NAME_LEN now for table name buffers client/mysqldump.c: Trimmed some lines to be less than 80 chars. Using just NAME_LEN now for table name buffers --- client/mysqldump.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/client/mysqldump.c b/client/mysqldump.c index db86a3714c1..3a93adf5b36 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -2083,18 +2083,21 @@ static int dump_all_tables_in_db(char *database) /* - get_actual_table_name -- executes a SHOW TABLES LIKE '%s' to get the actual table name - from the server for the table name given on the command line. we do this because - the table name given on the command line may be a different case (e.g. T1 vs t1) + get_actual_table_name -- executes a SHOW TABLES LIKE '%s' to get the actual + table name from the server for the table name given on the command line. + we do this because the table name given on the command line may be a + different case (e.g. T1 vs t1) RETURN void */ -static void get_actual_table_name( const char *old_table_name, char *new_table_name, int buf_size ) +static void get_actual_table_name( const char *old_table_name, + char *new_table_name, + int buf_size ) { MYSQL_RES *tableRes; MYSQL_ROW row; - char query[ NAME_LEN*2+3 + 50 ]; + char query[ NAME_LEN + 50 ]; DBUG_ENTER("get_actual_table_name"); @@ -2144,7 +2147,7 @@ static int dump_selected_tables(char *db, char **table_names, int tables) print_xml_tag1(md_result_file, "", "database name=", db, "\n"); for (; tables > 0 ; tables-- , table_names++) { - char new_table_name[NAME_LEN*+3]; + char new_table_name[NAME_LEN]; /* the table name passed on commandline may be wrong case */ get_actual_table_name( *table_names, new_table_name, sizeof(new_table_name) ); From a88ca8f548a2e7d2ce4f992620bff508d2b9236d Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 29 Jan 2005 22:56:00 +0200 Subject: [PATCH 0873/1063] Fix for a "table is full" bug in multi-table updates (Bug #7788) mysys/my_handler.c: Fix for a bug in multi table updates, when offset of one table is 5 bytes or more. This occured because in that case binary(5) indexed column is space packed, so it was hit by this bug in the function for binary comparison. Bug #7788 --- mysys/my_handler.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysys/my_handler.c b/mysys/my_handler.c index 00f25924e69..df1e9e55e0a 100644 --- a/mysys/my_handler.c +++ b/mysys/my_handler.c @@ -57,7 +57,7 @@ static int compare_bin(uchar *a, uint a_length, uchar *b, uint b_length, /* put shorter key in a */ a_length= b_length; a= b; - swap= -1; /* swap sign of result */ + swap= -1 ^ 1; /* swap sign of result */ } for (end= a + a_length-length; a < end ; a++) { From 934fde094cc092baa110dc3821e098d3d286e0c6 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 30 Jan 2005 10:24:03 +0000 Subject: [PATCH 0874/1063] Bug#7011 Fix replication for multi-update new test - rpl_multi_update2 sql/mysql_priv.h: Bug#7011 New function mysql_multi_update_lock() sql/sql_parse.cc: Bug#7011 New function check_multi_update_lock() For multi-update on slave, perform an early open&lock sql/sql_update.cc: Bug#7011 Split out multi-update locking into its own function, mysql_multi_update_lock() --- mysql-test/r/rpl_multi_update2.result | 42 ++++++++++++ mysql-test/t/rpl_multi_update2-slave.opt | 1 + mysql-test/t/rpl_multi_update2.test | 33 ++++++++++ sql/mysql_priv.h | 3 + sql/sql_parse.cc | 81 +++++++++++++++++++++++- sql/sql_update.cc | 51 +++++++++------ 6 files changed, 192 insertions(+), 19 deletions(-) create mode 100644 mysql-test/r/rpl_multi_update2.result create mode 100644 mysql-test/t/rpl_multi_update2-slave.opt create mode 100644 mysql-test/t/rpl_multi_update2.test diff --git a/mysql-test/r/rpl_multi_update2.result b/mysql-test/r/rpl_multi_update2.result new file mode 100644 index 00000000000..40193f43e49 --- /dev/null +++ b/mysql-test/r/rpl_multi_update2.result @@ -0,0 +1,42 @@ +slave stop; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +slave start; +CREATE TABLE t1 ( +a int unsigned not null auto_increment primary key, +b int unsigned +) TYPE=MyISAM; +CREATE TABLE t2 ( +a int unsigned not null auto_increment primary key, +b int unsigned +) TYPE=MyISAM; +INSERT INTO t1 VALUES (NULL, 0); +INSERT INTO t1 SELECT NULL, 0 FROM t1; +INSERT INTO t2 VALUES (NULL, 0), (NULL,1); +SELECT * FROM t1 ORDER BY a; +a b +1 0 +2 0 +SELECT * FROM t2 ORDER BY a; +a b +1 0 +2 1 +UPDATE t1, t2 SET t1.b = (t2.b+4) WHERE t1.a = t2.a; +SELECT * FROM t1 ORDER BY a; +a b +1 4 +2 5 +SELECT * FROM t2 ORDER BY a; +a b +1 0 +2 1 +SELECT * FROM t1 ORDER BY a; +a b +1 4 +2 5 +SELECT * FROM t2 ORDER BY a; +a b +1 0 +2 1 diff --git a/mysql-test/t/rpl_multi_update2-slave.opt b/mysql-test/t/rpl_multi_update2-slave.opt new file mode 100644 index 00000000000..17d4171af0e --- /dev/null +++ b/mysql-test/t/rpl_multi_update2-slave.opt @@ -0,0 +1 @@ +--replicate-ignore-table=nothing.sensible diff --git a/mysql-test/t/rpl_multi_update2.test b/mysql-test/t/rpl_multi_update2.test new file mode 100644 index 00000000000..8216056aca5 --- /dev/null +++ b/mysql-test/t/rpl_multi_update2.test @@ -0,0 +1,33 @@ +# Let's verify that multi-update is not always skipped by slave if +# some replicate-* rules exist. +# (BUG#7011) + +source include/master-slave.inc; + +CREATE TABLE t1 ( + a int unsigned not null auto_increment primary key, + b int unsigned +) TYPE=MyISAM; + +CREATE TABLE t2 ( + a int unsigned not null auto_increment primary key, + b int unsigned +) TYPE=MyISAM; + +INSERT INTO t1 VALUES (NULL, 0); +INSERT INTO t1 SELECT NULL, 0 FROM t1; + +INSERT INTO t2 VALUES (NULL, 0), (NULL,1); + +SELECT * FROM t1 ORDER BY a; +SELECT * FROM t2 ORDER BY a; + +UPDATE t1, t2 SET t1.b = (t2.b+4) WHERE t1.a = t2.a; +SELECT * FROM t1 ORDER BY a; +SELECT * FROM t2 ORDER BY a; + +save_master_pos; +connection slave; +sync_with_master; +SELECT * FROM t1 ORDER BY a; +SELECT * FROM t2 ORDER BY a; diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index b123927d09e..cbbf3b843d3 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -469,6 +469,9 @@ int mysql_update(THD *thd,TABLE_LIST *tables,List &fields, List &values,COND *conds, ORDER *order, ha_rows limit, enum enum_duplicates handle_duplicates); +int mysql_multi_update_lock(THD *thd, + TABLE_LIST *table_list, + List *fields); int mysql_multi_update(THD *thd, TABLE_LIST *table_list, List *fields, List *values, COND *conds, ulong options, diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 1aeb158dc11..275b76db177 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -56,6 +56,8 @@ static int check_for_max_user_connections(USER_CONN *uc); static void decrease_user_connections(USER_CONN *uc); static bool check_db_used(THD *thd,TABLE_LIST *tables); static bool check_merge_table_access(THD *thd, char *db, TABLE_LIST *tables); +static bool check_multi_update_lock(THD *thd, TABLE_LIST *tables, + List *fields); static void mysql_init_query(THD *thd); static void remove_escape(char *name); static void refresh_status(void); @@ -1338,10 +1340,28 @@ mysql_execute_command(void) LEX *lex= &thd->lex; TABLE_LIST *tables=(TABLE_LIST*) lex->select_lex.table_list.first; SELECT_LEX *select_lex = lex->select; + bool slave_fake_lock= 0; + MYSQL_LOCK *fake_prev_lock= 0; DBUG_ENTER("mysql_execute_command"); if (thd->slave_thread) { + if (lex->sql_command == SQLCOM_MULTI_UPDATE) + { + DBUG_PRINT("info",("need faked locked tables")); + + if (check_multi_update_lock(thd, tables, &select_lex->item_list)) + goto error; + + /* Fix for replication, the tables are opened and locked, + now we pretend that we have performed a LOCK TABLES action */ + + fake_prev_lock= thd->locked_tables; + if (thd->lock) + thd->locked_tables= thd->lock; + thd->lock= 0; + slave_fake_lock= 1; + } /* Skip if we are in the slave thread, some table rules have been given and the table list says the query should not be replicated @@ -1949,7 +1969,7 @@ mysql_execute_command(void) if (select_lex->item_list.elements != lex->value_list.elements) { send_error(&thd->net,ER_WRONG_VALUE_COUNT); - DBUG_VOID_RETURN; + goto error; } { const char *msg= 0; @@ -2641,6 +2661,14 @@ mysql_execute_command(void) send_error(&thd->net,thd->killed ? ER_SERVER_SHUTDOWN : 0); error: + if (unlikely(slave_fake_lock)) + { + DBUG_PRINT("info",("undoing faked lock")); + thd->lock= thd->locked_tables; + thd->locked_tables= fake_prev_lock; + if (thd->lock == thd->locked_tables) + thd->lock= 0; + } DBUG_VOID_RETURN; } @@ -3907,3 +3935,54 @@ bool check_simple_select() } return 0; } + +/* + Setup locking for multi-table updates. Used by the replication slave. + Replication slave SQL thread examines (all_tables_not_ok()) the + locking state of referenced tables to determine if the query has to + be executed or ignored. Since in multi-table update, the + 'default' lock is read-only, this lock is corrected early enough by + calling this function, before the slave decides to execute/ignore. + + SYNOPSIS + check_multi_update_lock() + thd Current thread + tables List of user-supplied tables + fields List of fields requiring update + + RETURN VALUES + 0 ok + 1 error +*/ +static bool check_multi_update_lock(THD *thd, TABLE_LIST *tables, + List *fields) +{ + bool res= 1; + TABLE_LIST *table; + DBUG_ENTER("check_multi_update_lock"); + + if (check_db_used(thd, tables)) + goto error; + + /* + Ensure that we have UPDATE or SELECT privilege for each table + The exact privilege is checked in mysql_multi_update() + */ + for (table= tables ; table ; table= table->next) + { + TABLE_LIST *save= table->next; + table->next= 0; + if (check_one_table_access(thd, UPDATE_ACL, table, 1) && + check_one_table_access(thd, SELECT_ACL, table, 0)) + goto error; + table->next= save; + } + + if (mysql_multi_update_lock(thd, tables, fields)) + goto error; + + res= 0; + +error: + DBUG_RETURN(res); +} diff --git a/sql/sql_update.cc b/sql/sql_update.cc index 4f7e34ec74f..b1b30a29639 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -403,26 +403,20 @@ static table_map get_table_map(List *items) } - /* - Setup multi-update handling and call SELECT to do the join + Prepare tables for multi-update + Analyse which tables need specific privileges and perform locking + as required */ -int mysql_multi_update(THD *thd, - TABLE_LIST *table_list, - List *fields, - List *values, - COND *conds, - ulong options, - enum enum_duplicates handle_duplicates) +int mysql_multi_update_lock(THD *thd, + TABLE_LIST *table_list, + List *fields) { int res; - multi_update *result; TABLE_LIST *tl; const bool using_lock_tables= thd->locked_tables != 0; - DBUG_ENTER("mysql_multi_update"); - - thd->select_limit= HA_POS_ERROR; + DBUG_ENTER("mysql_multi_update_lock"); for (;;) { @@ -490,7 +484,7 @@ int mysql_multi_update(THD *thd, (grant_option && check_grant(thd, wants, tl, 0, 0))) { tl->next= save; - DBUG_RETURN(0); + DBUG_RETURN(1); } tl->next= save; } @@ -498,11 +492,7 @@ int mysql_multi_update(THD *thd, /* Relock the tables with the correct modes */ res= lock_tables(thd,table_list); if (using_lock_tables) - { - if (res) - DBUG_RETURN(res); break; // Don't have to do setup_field() - } /* We must setup fields again as the file may have been reopened @@ -535,6 +525,31 @@ int mysql_multi_update(THD *thd, */ close_thread_tables(thd); } + + DBUG_RETURN(res); +} + +/* + Setup multi-update handling and call SELECT to do the join +*/ + +int mysql_multi_update(THD *thd, + TABLE_LIST *table_list, + List *fields, + List *values, + COND *conds, + ulong options, + enum enum_duplicates handle_duplicates) +{ + int res; + TABLE_LIST *tl; + multi_update *result; + DBUG_ENTER("mysql_multi_update"); + + thd->select_limit= HA_POS_ERROR; + + if ((res= mysql_multi_update_lock(thd, table_list, fields))) + DBUG_RETURN(res); /* Count tables and setup timestamp handling From 4faf77a9fe079dde6d9f8f563a5eb10fba44c87f Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 31 Jan 2005 11:47:10 +0100 Subject: [PATCH 0875/1063] BUG#8208 don't fsync unless something has been written + ion shutdown - don't close files that are not open + abort in debug - if closing a fd == -1 BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted --- BitKeeper/etc/logging_ok | 1 + ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp | 14 ++++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok index 52b8b0584bc..483f324d89c 100644 --- a/BitKeeper/etc/logging_ok +++ b/BitKeeper/etc/logging_ok @@ -224,6 +224,7 @@ tonu@x153.internalnet tonu@x3.internalnet tsmith@build.mysql.com tulin@build.mysql.com +tulin@mysql.com ulli@morbus.(none) venu@hundin.mysql.fi venu@myvenu.com diff --git a/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp b/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp index ddf1681479c..ad6c0fd5283 100644 --- a/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp +++ b/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp @@ -219,7 +219,8 @@ AsyncFile::run() rmrfReq(request, (char*)theFileName.c_str(), request->par.rmrf.own_directory); break; case Request:: end: - closeReq(request); + if (theFd > 0) + closeReq(request); endReq(); return; default: @@ -239,6 +240,7 @@ void AsyncFile::openReq(Request* request) { m_openedWithSync = false; m_syncFrequency = 0; + m_syncCount= 0; // for open.flags, see signal FSOPENREQ #ifdef NDB_WIN32 @@ -329,7 +331,6 @@ void AsyncFile::openReq(Request* request) } else { #endif m_openedWithSync = false; - m_syncCount = 0; m_syncFrequency = Global_syncFreq; #if 0 } @@ -656,6 +657,7 @@ AsyncFile::writeBuffer(const char * buf, size_t size, off_t offset, } #endif + m_syncCount+= bytes_written; buf += bytes_written; size -= bytes_written; offset += bytes_written; @@ -682,6 +684,10 @@ AsyncFile::closeReq(Request * request) hFile = INVALID_HANDLE_VALUE; #else if (-1 == ::close(theFd)) { +#ifndef DBUG_OFF + if (theFd == -1) + abort(); +#endif request->error = errno; } theFd = -1; @@ -700,7 +706,8 @@ bool AsyncFile::isOpen(){ void AsyncFile::syncReq(Request * request) { - if(m_openedWithSync){ + if(m_openedWithSync || + m_syncCount == 0){ return; } #ifdef NDB_WIN32 @@ -756,7 +763,6 @@ AsyncFile::appendReq(Request * request){ if(m_syncFrequency != 0 && m_syncCount > m_syncFrequency){ syncReq(request); - request->error = 0; } } From 0bd5c1e3b2a7166e5c5b81570a22af9463b52c46 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 31 Jan 2005 13:18:36 +0000 Subject: [PATCH 0876/1063] Bug#7011 Fix tests after merge from 4.0 --- mysql-test/r/rpl_multi_update2.result | 8 ++++---- mysql-test/t/rpl_multi_update2.test | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/mysql-test/r/rpl_multi_update2.result b/mysql-test/r/rpl_multi_update2.result index 40193f43e49..99356ebf970 100644 --- a/mysql-test/r/rpl_multi_update2.result +++ b/mysql-test/r/rpl_multi_update2.result @@ -1,17 +1,17 @@ -slave stop; +stop slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -slave start; +start slave; CREATE TABLE t1 ( a int unsigned not null auto_increment primary key, b int unsigned -) TYPE=MyISAM; +) ENGINE=MyISAM; CREATE TABLE t2 ( a int unsigned not null auto_increment primary key, b int unsigned -) TYPE=MyISAM; +) ENGINE=MyISAM; INSERT INTO t1 VALUES (NULL, 0); INSERT INTO t1 SELECT NULL, 0 FROM t1; INSERT INTO t2 VALUES (NULL, 0), (NULL,1); diff --git a/mysql-test/t/rpl_multi_update2.test b/mysql-test/t/rpl_multi_update2.test index 8216056aca5..bba7700a88e 100644 --- a/mysql-test/t/rpl_multi_update2.test +++ b/mysql-test/t/rpl_multi_update2.test @@ -7,12 +7,12 @@ source include/master-slave.inc; CREATE TABLE t1 ( a int unsigned not null auto_increment primary key, b int unsigned -) TYPE=MyISAM; +) ENGINE=MyISAM; CREATE TABLE t2 ( a int unsigned not null auto_increment primary key, b int unsigned -) TYPE=MyISAM; +) ENGINE=MyISAM; INSERT INTO t1 VALUES (NULL, 0); INSERT INTO t1 SELECT NULL, 0 FROM t1; From 5ebe0dd2315a1e6a93a621992349afe44ae45f3b Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 31 Jan 2005 19:18:06 +0500 Subject: [PATCH 0877/1063] WL#964 added client_test.dsp in project added CHARACTER SET in tables added 5th time zone included lstat in if() expanded ignore list for windows added directory slave1 and slave2 added options for mysqld and mysqltest fixed error in read_option() fixed and added enviroment variables for Linux and Windows rewrote str_tok() added replacment 3th column New BitKeeper file ``VC++Files/tests/client_test.dsp'' VC++Files/mysql.dsw: added client_test.dsp in project mysql-test/my_create_tables.c: added CHARACTER SET in tables added 5th time zone mysql-test/my_manage.c: included lstat in if() mysql-test/mysql_test_run_new.c: expanded ignore list for windows added directory slave1 and slave2 added options for mysqld and mysqltest fixed error in read_option() fixed and added enviroment variables for Linux and Windows rewrote str_tok() mysql-test/t/ps_1general.test: added replacment 3th column --- VC++Files/mysql.dsw | 39 ++-- VC++Files/tests/client_test.dsp | 94 ++++++++++ mysql-test/my_create_tables.c | 65 +++++-- mysql-test/my_manage.c | 9 +- mysql-test/mysql_test_run_new.c | 322 ++++++++++++++++++++------------ mysql-test/t/ps_1general.test | 2 +- 6 files changed, 370 insertions(+), 161 deletions(-) create mode 100644 VC++Files/tests/client_test.dsp diff --git a/VC++Files/mysql.dsw b/VC++Files/mysql.dsw index 0ce2acfed23..d6bf5819909 100644 --- a/VC++Files/mysql.dsw +++ b/VC++Files/mysql.dsw @@ -816,15 +816,14 @@ Package=<4> ############################################################################### -Project: "mysqltest"=.\client\mysqltest.dsp - Package Owner=<4> +Project: "mysqltest"=.\client\mysqltest.dsp - Package Owner=<4> + +Package=<5> +{{{ }}} -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency + +Package=<4> +{{{ Begin Project Dependency Project_Dep_Name libmysql End Project Dependency Begin Project Dependency @@ -835,24 +834,28 @@ Package=<4> End Project Dependency }}} -############################################################################### +############################################################################### Project: "client_test"=.\tests\client_test.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### -Project: "mysql_test_run_new"=".\mysql-test\mysql_test_run_new.dsp" - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency + +Project: "mysql_test_run_new"=".\mysql-test\mysql_test_run_new.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ Begin Project Dependency Project_Dep_Name mysqltest End Project Dependency Begin Project Dependency Project_Dep_Name mysqladmin End Project Dependency + Begin Project Dependency + Project_Dep_Name client_test + End Project Dependency }}} + ############################################################################### Global: diff --git a/VC++Files/tests/client_test.dsp b/VC++Files/tests/client_test.dsp new file mode 100644 index 00000000000..a095906b26e --- /dev/null +++ b/VC++Files/tests/client_test.dsp @@ -0,0 +1,94 @@ +# Microsoft Developer Studio Project File - Name="client_test" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=client_test - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "client_test.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "client_test.mak" CFG="client_test - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "client_test - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "client_test - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "client_test - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir ".\Debug" +# PROP BASE Intermediate_Dir ".\Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir ".\Debug" +# PROP Intermediate_Dir ".\Debug" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MTd /I "../include" /I "../" /Z7 /W3 /Od /G6 /D "_DEBUG" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /D "__WIN__" /D "_WIN32" /Fp".\Debug/client_test.pch" /Fo".\Debug/" /Fd".\Debug/" /GZ /c /GX +# ADD CPP /nologo /MTd /I "../include" /I "../" /Z7 /W3 /Od /G6 /D "_DEBUG" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /D "__WIN__" /D "_WIN32" /Fp".\Debug/client_test.pch" /Fo".\Debug/" /Fd".\Debug/" /GZ /c /GX +# ADD BASE MTL /nologo /tlb".\Debug\client_test.tlb" /win32 +# ADD MTL /nologo /tlb".\Debug\client_test.tlb" /win32 +# ADD BASE RSC /l 1033 +# ADD RSC /l 1033 +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib mysys.lib regex.lib /nologo /out:"..\tests\client_test.exe" /incremental:yes /libpath:"..\lib_debug\" /debug /pdb:".\Debug\client_test.pdb" /pdbtype:sept /map:".\Debug\client_test.map" /subsystem:console +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib mysys.lib regex.lib /nologo /out:"..\tests\client_test.exe" /incremental:yes /libpath:"..\lib_debug\" /debug /pdb:".\Debug\client_test.pdb" /pdbtype:sept /map:".\Debug\client_test.map" /subsystem:console + +!ELSEIF "$(CFG)" == "client_test - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir ".\Release" +# PROP BASE Intermediate_Dir ".\Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir ".\Release" +# PROP Intermediate_Dir ".\Release" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MTd /I "../include" /I "../" /W3 /Ob1 /G6 /D "DBUG_OFF" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /D "__WIN__" /D "_WIN32" /GF /Gy /Fp".\Release/client_test.pch" /Fo".\Release/" /Fd".\Release/" /c /GX +# ADD CPP /nologo /MTd /I "../include" /I "../" /W3 /Ob1 /G6 /D "DBUG_OFF" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /D "__WIN__" /D "_WIN32" /GF /Gy /Fp".\Release/client_test.pch" /Fo".\Release/" /Fd".\Release/" /c /GX +# ADD BASE MTL /nologo /tlb".\Release\client_test.tlb" /win32 +# ADD MTL /nologo /tlb".\Release\client_test.tlb" /win32 +# ADD BASE RSC /l 1033 +# ADD RSC /l 1033 +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib Ws2_32.lib /nologo /out:"..\tests\client_test.exe" /incremental:no /pdb:".\Release\client_test.pdb" /pdbtype:sept /subsystem:console +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib Ws2_32.lib /nologo /out:"..\tests\client_test.exe" /incremental:no /pdb:".\Release\client_test.pdb" /pdbtype:sept /subsystem:console + +!ENDIF + +# Begin Target + +# Name "client_test - Win32 Debug" +# Name "client_test - Win32 Release" +# Begin Source File + +SOURCE=mysql_client_test.c +# End Source File +# End Target +# End Project + diff --git a/mysql-test/my_create_tables.c b/mysql-test/my_create_tables.c index 405f66dc8df..06a6fabf022 100644 --- a/mysql-test/my_create_tables.c +++ b/mysql-test/my_create_tables.c @@ -96,6 +96,8 @@ bool create_system_files(const char *mdata,const char *output_file, bool test) "Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL," "PRIMARY KEY Host (Host,Db,User)," "KEY User (User))" + "engine=MyISAM " + "CHARACTER SET utf8 COLLATE utf8_bin " "comment='Database privileges';\n"); if (test) @@ -126,10 +128,12 @@ bool create_system_files(const char *mdata,const char *output_file, bool test) "Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL," "Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL," "PRIMARY KEY Host (Host,Db))" - "comment='Host privileges;" - " Merged with database privileges';\n"); + "engine=MyISAM " + "CHARACTER SET utf8 COLLATE utf8_bin " + "comment='Host privileges; Merged with database privileges';\n"); } + if (test_sys_file(mdata,"mysql/user.frm")) { #ifdef __WIN__ @@ -184,7 +188,10 @@ bool create_system_files(const char *mdata,const char *output_file, bool test) "max_updates int(11) unsigned DEFAULT 0 NOT NULL," "max_connections int(11) unsigned DEFAULT 0 NOT NULL," "PRIMARY KEY Host (Host,User)" - ") comment='Users and global privileges';\n"); + ") engine=MyISAM " + "CHARACTER SET utf8 COLLATE utf8_bin " + "comment='Users and global privileges';\n"); + if (test) { @@ -238,7 +245,9 @@ bool create_system_files(const char *mdata,const char *output_file, bool test) "dl char(128) DEFAULT '' NOT NULL," "type enum ('function','aggregate') NOT NULL," "PRIMARY KEY (name)" - ") comment='User defined functions';\n"); + ") engine=MyISAM " + "CHARACTER SET utf8 COLLATE utf8_bin " + "comment='User defined functions';\n"); } if (test_sys_file(mdata,"mysql/tables_priv.frm")) @@ -258,7 +267,9 @@ bool create_system_files(const char *mdata,const char *output_file, bool test) " DEFAULT '' NOT NULL," "PRIMARY KEY (Host,Db,User,Table_name)," "KEY Grantor (Grantor)" - ") comment='Table privileges';\n"); + ") engine=MyISAM " + "CHARACTER SET utf8 COLLATE utf8_bin " + "comment='Table privileges';\n"); } if (test_sys_file(mdata,"mysql/columns_priv.frm")) @@ -274,7 +285,9 @@ bool create_system_files(const char *mdata,const char *output_file, bool test) "Column_priv set('Select','Insert','Update','References')" " DEFAULT '' NOT NULL," "PRIMARY KEY (Host,Db,User,Table_name,Column_name)" - ") comment='Column privileges';\n"); + ") engine=MyISAM " + "CHARACTER SET utf8 COLLATE utf8_bin " + "comment='Column privileges';\n"); } if (test_sys_file(mdata,"mysql/help_topic.frm")) @@ -289,7 +302,9 @@ bool create_system_files(const char *mdata,const char *output_file, bool test) "url varchar(128) not null," "primary key (help_topic_id)," "unique index (name)" - ") comment='help topics';\n"); + ") engine=MyISAM " + "CHARACTER SET utf8 " + "comment='help topics';\n"); } if (test_sys_file(mdata,"mysql/help_category.frm")) @@ -302,7 +317,9 @@ bool create_system_files(const char *mdata,const char *output_file, bool test) "url varchar(128) not null," "primary key (help_category_id)," "unique index (name)" - ") comment='help categories';\n"); + ") engine=MyISAM " + "CHARACTER SET utf8 " + "comment='help categories';\n"); } if (test_sys_file(mdata,"mysql/help_keyword.frm")) @@ -313,7 +330,9 @@ bool create_system_files(const char *mdata,const char *output_file, bool test) "name varchar(64) not null," "primary key (help_keyword_id)," "unique index (name)" - ") comment='help keywords';\n"); + ") engine=MyISAM " + "CHARACTER SET utf8 " + "comment='help keywords';\n"); } if (test_sys_file(mdata,"mysql/help_relation.frm")) @@ -323,7 +342,9 @@ bool create_system_files(const char *mdata,const char *output_file, bool test) "help_topic_id int unsigned not null references help_topic," "help_keyword_id int unsigned not null references help_keyword," "primary key (help_keyword_id, help_topic_id)" - ") comment='keyword-topic relation';\n"); + ") engine=MyISAM " + "CHARACTER SET utf8 " + "comment='keyword-topic relation';\n"); } if (test_sys_file(mdata,"mysql/time_zone_name.frm")) @@ -333,7 +354,7 @@ bool create_system_files(const char *mdata,const char *output_file, bool test) "Name char(64) NOT NULL," "Time_zone_id int unsigned NOT NULL," "PRIMARY KEY Name (Name)" - ") DEFAULT CHARACTER SET latin1 " + ") engine=MyISAM CHARACTER SET utf8 " "comment='Time zone names';\n"); if (test) @@ -341,7 +362,9 @@ bool create_system_files(const char *mdata,const char *output_file, bool test) fprintf(out, "INSERT INTO time_zone_name (Name, Time_Zone_id) VALUES" "('MET', 1), ('UTC', 2), ('Universal', 2), " - "('Europe/Moscow',3), ('leap/Europe/Moscow',4);\n"); + "('Europe/Moscow',3), ('leap/Europe/Moscow',4)," + "('Japan', 5);\n"); + } } @@ -353,13 +376,13 @@ bool create_system_files(const char *mdata,const char *output_file, bool test) "Time_zone_id int unsigned NOT NULL auto_increment," "Use_leap_seconds enum('Y','N') DEFAULT 'N' NOT NULL," "PRIMARY KEY TzId (Time_zone_id)" - ") DEFAULT CHARACTER SET latin1 " + ") engine=MyISAM CHARACTER SET utf8 " "comment='Time zones';\n"); if (test) { fprintf(out,"INSERT INTO time_zone (Time_zone_id, Use_leap_seconds)" - "VALUES (1,'N'), (2,'N'), (3,'N'), (4,'Y');\n"); + "VALUES (1,'N'), (2,'N'), (3,'N'), (4,'Y'), (5,'N');\n"); } } @@ -371,7 +394,7 @@ bool create_system_files(const char *mdata,const char *output_file, bool test) "Transition_time bigint signed NOT NULL," "Transition_type_id int unsigned NOT NULL," "PRIMARY KEY TzIdTranTime (Time_zone_id, Transition_time)" - ") DEFAULT CHARACTER SET latin1 " + ") engine=MyISAM CHARACTER SET utf8 " "comment='Time zone transitions';\n"); if (test) @@ -576,7 +599,9 @@ bool create_system_files(const char *mdata,const char *output_file, bool test) ",(4, 2045689222, 8) ,(4, 2058390022, 9)" ",(4, 2077138822, 8) ,(4, 2090444422, 9)" ",(4, 2108588422, 8) ,(4, 2121894022, 9)" - ",(4, 2140038022, 8);\n"); + ",(4, 2140038022, 8), (5, -1009875600, 1);\n"); + + } } @@ -590,7 +615,7 @@ bool create_system_files(const char *mdata,const char *output_file, bool test) "Is_DST tinyint unsigned DEFAULT 0 NOT NULL," "Abbreviation char(8) DEFAULT '' NOT NULL," "PRIMARY KEY TzIdTrTId (Time_zone_id, Transition_type_id)" - ") DEFAULT CHARACTER SET latin1 " + ") engine=MyISAM CHARACTER SET utf8 " "comment='Time zone transition types';\n"); if (test) @@ -612,7 +637,9 @@ bool create_system_files(const char *mdata,const char *output_file, bool test) ",(4, 4, 10800, 0, 'MSK') ,(4, 5, 14400, 1, 'MSD')" ",(4, 6, 18000, 1, 'MSD') ,(4, 7, 7200, 0, 'EET')" ",(4, 8, 10800, 0, 'MSK') ,(4, 9, 14400, 1, 'MSD')" - ",(4, 10, 10800, 1, 'EEST') ,(4, 11, 7200, 0, 'EET');\n"); + ",(4, 10, 10800, 1, 'EEST') ,(4, 11, 7200, 0, 'EET')" + ",(5, 0, 32400, 0, 'CJT') ,(5, 1, 32400, 0, 'JST');\n"); + } } @@ -623,7 +650,7 @@ bool create_system_files(const char *mdata,const char *output_file, bool test) "Transition_time bigint signed NOT NULL," "Correction int signed NOT NULL," "PRIMARY KEY TranTime (Transition_time)" - ") DEFAULT CHARACTER SET latin1 " + ") engine=MyISAM CHARACTER SET utf8 " "comment='Leap seconds information for time zones';\n"); if (test) diff --git a/mysql-test/my_manage.c b/mysql-test/my_manage.c index 1f006f7ab90..5cd0013d7bb 100644 --- a/mysql-test/my_manage.c +++ b/mysql-test/my_manage.c @@ -122,7 +122,7 @@ void add_arg(arg_list_t *al, const char *format, ...) al->argv[al->argc]= malloc(strlen(temp)+1); ASSERT(al->argv[al->argc] != NULL); strcpy(al->argv[al->argc], temp); - + ++(al->argc); } else @@ -800,12 +800,7 @@ int removef(const char *format, ...) #ifndef STRUCT_DIRENT_HAS_D_TYPE struct stat st; - if (lstat(entry->d_name, &st) == -1) - { - return 1; - } - - if (!S_ISDIR(st.st_mode) && !fnmatch(p, entry->d_name,0)) + if (lstat(entry->d_name, &st) == -1 && !fnmatch(p, entry->d_name,0)) #else if (!S_ISDIR(entry->d_type) && !fnmatch(p, entry->d_name,0)) #endif diff --git a/mysql-test/mysql_test_run_new.c b/mysql-test/mysql_test_run_new.c index bdebe912b97..4e0e018f84b 100644 --- a/mysql-test/mysql_test_run_new.c +++ b/mysql-test/mysql_test_run_new.c @@ -132,7 +132,13 @@ static char skip_test[FN_REFLEN]= " repair ," " rpl_trunc_binlog ," " mysqldump ," -" rpl000001 "; +" rpl000001 ," + +" derived ," +" group_by ," +" select ," +" rpl000015 ," +" subselect "; #endif static char ignore_test[FN_REFLEN]= ""; @@ -143,6 +149,8 @@ static char mysql_tmp_dir[FN_REFLEN]; static char result_dir[FN_REFLEN]; static char master_dir[FN_REFLEN]; static char slave_dir[FN_REFLEN]; +static char slave1_dir[FN_REFLEN]; +static char slave2_dir[FN_REFLEN]; static char lang_dir[FN_REFLEN]; static char char_dir[FN_REFLEN]; @@ -190,6 +198,8 @@ int restarts= 0; FILE *log_fd= NULL; +static char argument[FN_REFLEN]; + /****************************************************************************** functions @@ -221,7 +231,7 @@ void log_info(const char *, ...); void log_error(const char *, ...); void log_errno(const char *, ...); void die(const char *); -char *str_tok(char *string, const char *delim); +char *str_tok(char* dest, char *string, const char *delim); #ifndef __WIN__ void run_init_script(const char *script_name); #endif @@ -289,11 +299,15 @@ void install_db(char *datadir) add_arg(&al, "--basedir=%s", base_dir); add_arg(&al, "--datadir=%s", datadir); add_arg(&al, "--skip-innodb"); + add_arg(&al, "--skip-ndbcluster"); add_arg(&al, "--skip-bdb"); #ifndef __NETWARE__ add_arg(&al, "--character-sets-dir=%s", char_dir); add_arg(&al, "--language=%s", lang_dir); #endif +// added + add_arg(&al, "--default-character-set=latin1"); + add_arg(&al, "--innodb_data_file_path=ibdata1:50M"); /* spawn */ if ((err= spawn(mysqld_file, &al, TRUE, input, output, error, NULL)) != 0) @@ -335,12 +349,27 @@ void mysql_install_db() mkdir(temp, S_IRWXU); snprintf(temp, FN_REFLEN, "%s/var/master-data/test", mysql_test_dir); mkdir(temp, S_IRWXU); + snprintf(temp, FN_REFLEN, "%s/var/slave-data", mysql_test_dir); mkdir(temp, S_IRWXU); snprintf(temp, FN_REFLEN, "%s/var/slave-data/mysql", mysql_test_dir); mkdir(temp, S_IRWXU); snprintf(temp, FN_REFLEN, "%s/var/slave-data/test", mysql_test_dir); mkdir(temp, S_IRWXU); + + snprintf(temp, FN_REFLEN, "%s/var/slave1-data", mysql_test_dir); + mkdir(temp, S_IRWXU); + snprintf(temp, FN_REFLEN, "%s/var/slave1-data/mysql", mysql_test_dir); + mkdir(temp, S_IRWXU); + snprintf(temp, FN_REFLEN, "%s/var/slave1-data/test", mysql_test_dir); + mkdir(temp, S_IRWXU); + + snprintf(temp, FN_REFLEN, "%s/var/slave2-data", mysql_test_dir); + mkdir(temp, S_IRWXU); + snprintf(temp, FN_REFLEN, "%s/var/slave2-data/mysql", mysql_test_dir); + mkdir(temp, S_IRWXU); + snprintf(temp, FN_REFLEN, "%s/var/slave2-data/test", mysql_test_dir); + mkdir(temp, S_IRWXU); #else mkdir(temp); /* create subdirectories */ @@ -368,6 +397,8 @@ void mysql_install_db() install_db(master_dir); mlog("Creating test databases for slave... \n"); install_db(slave_dir); + install_db(slave1_dir); + install_db(slave2_dir); } /****************************************************************************** @@ -384,7 +415,6 @@ void start_master() int err; char master_out[FN_REFLEN]; char master_err[FN_REFLEN]; -/* char temp[FN_REFLEN]; */ char temp2[FN_REFLEN]; /* remove old berkeley db log files that can confuse the server */ @@ -463,6 +493,11 @@ void start_master() add_arg(&al, "--character-sets-dir=%s", char_dir); add_arg(&al, "--tmpdir=%s", mysql_tmp_dir); add_arg(&al, "--language=%s", lang_dir); + + add_arg(&al, "--rpl-recovery-rank=1"); + add_arg(&al, "--init-rpl-role=master"); + add_arg(&al, "--default-character-set=latin1"); +// add_arg(&al, "--innodb_data_file_path=ibdata1:50M"); #ifdef DEBUG /* only for debug builds */ add_arg(&al, "--debug"); #endif @@ -491,13 +526,13 @@ void start_master() { char *p; - p= (char *)str_tok(master_opt, " \t"); + p= (char *)str_tok(argument, master_opt, " \t"); if (!strstr(master_opt, "timezone")) { while (p) { add_arg(&al, "%s", p); - p= (char *)str_tok(NULL, " \t"); + p= (char *)str_tok(argument, NULL, " \t"); } } } @@ -624,10 +659,10 @@ void start_slave() add_arg(&al, "--log-bin=slave-bin"); add_arg(&al, "--relay_log=slave-relay-bin"); add_arg(&al, "--basedir=%s", base_dir); - add_arg(&al, "--port=%u", slave_port); #if !defined(__NETWARE__) && !defined(__WIN__) add_arg(&al, "--socket=%s",slave_socket); #endif + add_arg(&al, "--port=%u", slave_port); add_arg(&al, "--datadir=%s", slave_dir); #ifndef __WIN__ add_arg(&al, "--pid-file=%s", slave_pid); @@ -651,10 +686,15 @@ void start_slave() add_arg(&al, "--master-retry-count=10"); add_arg(&al, "-O"); add_arg(&al, "slave_net_timeout=10"); + add_arg(&al, "--log-slave-updates"); + add_arg(&al, "--log=%s/var/log/slave.log", mysql_test_dir); + add_arg(&al, "--default-character-set=latin1"); + add_arg(&al, "--skip-ndbcluster"); + #ifdef DEBUG /* only for debug builds */ add_arg(&al, "--debug"); -#endif - +#endif + if (use_openssl) { add_arg(&al, "--ssl-ca=%s", ca_cert); @@ -667,12 +707,12 @@ void start_slave() { char *p; - p= (char *)str_tok(slave_master_info, " \t"); + p= (char *)str_tok(argument, slave_master_info, " \t"); while (p) { add_arg(&al, "%s", p); - p= (char *)str_tok(NULL, " \t"); + p= (char *)str_tok(argument, NULL, " \t"); } } else @@ -700,13 +740,13 @@ void start_slave() { char *p; - p= (char *)str_tok(slave_opt, " \t"); + p= (char *)str_tok(argument, slave_opt, " \t"); while (p) { add_arg(&al, "%s", p); - p= (char *)str_tok(NULL, " \t"); - } + p= (char *)str_tok(argument, NULL, " \t"); + } } /* remove the pid file if it exists */ @@ -753,9 +793,12 @@ void start_slave() void mysql_start() { -/* log_info("Starting the MySQL server(s): %u", ++restarts); */ + + + printf("loading master...\r"); start_master(); + printf("loading slave...\r"); start_slave(); /* activate the test screen */ @@ -853,6 +896,7 @@ void mysql_restart() mysql_stop(); mlog(DASH); + sleep(1); mysql_start(); } @@ -912,7 +956,7 @@ int read_option(char *opt_file, char *opt) if ((p= strstr(opt, "\\\\")) != NULL) { /* bmove is guranteed to work byte by byte */ - bmove(p, p+1, strlen(p+1)); + bmove(p, p+1, strlen(p)+1); } } else @@ -1045,9 +1089,6 @@ void run_test(char *test) if (!master_running) mysql_start(); else if (restart) mysql_restart(); - /* let the system stabalize */ - sleep(1); - /* show test */ mlog("%-46s ", test); @@ -1066,10 +1107,12 @@ void run_test(char *test) add_arg(&al, "--silent"); add_arg(&al, "--basedir=%s/", mysql_test_dir); add_arg(&al, "--host=127.0.0.1"); + add_arg(&al, "--skip-safemalloc"); add_arg(&al, "-v"); add_arg(&al, "-R"); add_arg(&al, "%s", result_file); - + + if (use_openssl) { add_arg(&al, "--ssl-ca=%s", ca_cert); @@ -1079,7 +1122,6 @@ void run_test(char *test) /* spawn */ err= spawn(mysqltest_file, &al, TRUE, test_file, out_file, err_file, NULL); - /* free args */ free_args(&al); @@ -1259,7 +1301,9 @@ void die(const char *msg) void setup(char *file __attribute__((unused))) { char temp[FN_REFLEN]; +#if defined(__WIN__) || defined(__NETWARE__) char file_path[FN_REFLEN*2]; +#endif char *p; int position; @@ -1361,6 +1405,8 @@ void setup(char *file __attribute__((unused))) snprintf(result_dir, FN_REFLEN, "%s/r", mysql_test_dir); snprintf(master_dir, FN_REFLEN, "%s/var/master-data", mysql_test_dir); snprintf(slave_dir, FN_REFLEN, "%s/var/slave-data", mysql_test_dir); + snprintf(slave1_dir, FN_REFLEN, "%s/var/slave1-data", mysql_test_dir); + snprintf(slave2_dir, FN_REFLEN, "%s/var/slave2-data", mysql_test_dir); snprintf(lang_dir, FN_REFLEN, "%s/sql/share/english", base_dir); snprintf(char_dir, FN_REFLEN, "%s/sql/share/charsets", base_dir); @@ -1413,30 +1459,108 @@ void setup(char *file __attribute__((unused))) snprintf(file_path,FN_REFLEN,"MYSQL_TEST_DIR=%s",mysql_test_dir); _putenv(file_path); snprintf(file_path, FN_REFLEN*2, - "MYSQL_DUMP=%s/mysqldump.exe --no-defaults -u root --port=%u", + "MYSQL_DUMP=%s/mysqldump.exe --no-defaults -uroot --port=%u", bin_dir, master_port); _putenv(file_path); snprintf(file_path, FN_REFLEN*2, - "MYSQL_BINLOG=%s/mysqlbinlog.exe --no-defaults --local-load=%s", + "MYSQL_BINLOG=%s/mysqlbinlog.exe --no-defaults --local-load=%s", bin_dir, mysql_tmp_dir); _putenv(file_path); + + snprintf(file_path, FN_REFLEN*2, + "TESTS_BINDIR=%s/tests", base_dir); + _putenv(file_path); + + snprintf(file_path, FN_REFLEN*2, + "CHARSETSDIR=%s/sql/share/charsets", base_dir); + _putenv(file_path); + + snprintf(file_path, FN_REFLEN*2, + "MYSQL=%s/mysql --port=%u ", + bin_dir, master_port); + _putenv(file_path); + + snprintf(file_path, FN_REFLEN*2, + "MYSQL_FIX_SYSTEM_TABLES=%s/scripts/mysql_fix_privilege_tables --no-defaults " + "--host=localhost --port=%u " + "--basedir=%s --bindir=%s --verbose", + base_dir,master_port, base_dir, bin_dir); + _putenv(file_path); + + snprintf(file_path, FN_REFLEN*2, + "NDB_TOOLS_DIR=%s/ndb/tools", base_dir); + _putenv(file_path); + + snprintf(file_path, FN_REFLEN*2, + "CLIENT_BINDIR=%s", bin_dir); + _putenv(file_path); #else - snprintf(file_path,FN_REFLEN,"MYSQL_TEST_DIR=%s",mysql_test_dir); - putenv(file_path); - snprintf(file_path, FN_REFLEN*2, - "MYSQL_DUMP=%s/mysqldump --no-defaults -u root --port=%u --socket=%s", - bin_dir, master_port, master_socket); - putenv(file_path); - snprintf(file_path, FN_REFLEN*2, - "MYSQL_BINLOG=%s/mysqlbinlog --no-defaults --local-load=%s", - bin_dir, mysql_tmp_dir); - putenv(file_path); + { + static char env_MYSQL_TEST_DIR[FN_REFLEN*2]; + static char env_MYSQL_DUMP[FN_REFLEN*2]; + static char env_MYSQL_BINLOG[FN_REFLEN*2]; + static char env_MASTER_MYSOCK[FN_REFLEN*2]; + static char env_TESTS_BINDIR[FN_REFLEN*2]; + static char env_CHARSETSDIR[FN_REFLEN*2]; + static char env_MYSQL[FN_REFLEN*2]; + static char env_MYSQL_FIX_SYSTEM_TABLES[FN_REFLEN*2]; + static char env_NDB_TOOLS_DIR[FN_REFLEN*2]; + static char env_CLIENT_BINDIR[FN_REFLEN*2]; + + snprintf(env_MYSQL_TEST_DIR,FN_REFLEN*2, + "MYSQL_TEST_DIR=%s",mysql_test_dir); + putenv(env_MYSQL_TEST_DIR); + + snprintf(env_MYSQL_DUMP, FN_REFLEN*2,"MYSQL_DUMP=%s/mysqldump --no-defaults " + "-uroot --port=%u --socket=%s ", + bin_dir, master_port, master_socket); + putenv(env_MYSQL_DUMP); + + snprintf(env_MYSQL_BINLOG, FN_REFLEN*2, + "MYSQL_BINLOG=%s/mysqlbinlog --no-defaults --local-load=%s -uroot ", + bin_dir, mysql_tmp_dir); + putenv(env_MYSQL_BINLOG); + + snprintf(env_MASTER_MYSOCK, FN_REFLEN*2, + "MASTER_MYSOCK=%s", master_socket); + putenv(env_MASTER_MYSOCK); + + snprintf(env_TESTS_BINDIR, FN_REFLEN*2, + "TESTS_BINDIR=%s/tests", base_dir); + putenv(env_TESTS_BINDIR); + + snprintf(env_CHARSETSDIR, FN_REFLEN*2, + "CHARSETSDIR=%s/sql/share/charsets", base_dir); + putenv(env_CHARSETSDIR); + + snprintf(env_MYSQL, FN_REFLEN*2, + "MYSQL=%s/mysql --port=%u --socket=%s -uroot ", + bin_dir, master_port, master_socket); + putenv(env_MYSQL); + + snprintf(env_MYSQL_FIX_SYSTEM_TABLES, FN_REFLEN*2, + "MYSQL_FIX_SYSTEM_TABLES=%s/scripts/mysql_fix_privilege_tables --no-defaults " + "--host=localhost --port=%u --socket=%s " + "--basedir=%s --bindir=%s --verbose -uroot ", + base_dir,master_port, master_socket, base_dir, bin_dir); + putenv(env_MYSQL_FIX_SYSTEM_TABLES); + + snprintf(env_NDB_TOOLS_DIR, FN_REFLEN*2, + "NDB_TOOLS_DIR=%s/ndb/tools", base_dir); + putenv(env_NDB_TOOLS_DIR); + + snprintf(env_CLIENT_BINDIR, FN_REFLEN*2, + "CLIENT_BINDIR=%s", bin_dir); + putenv(env_CLIENT_BINDIR); + } + #endif #ifndef __WIN__ putenv((char *)"MASTER_MYPORT=9306"); putenv((char *)"SLAVE_MYPORT=9307"); putenv((char *)"MYSQL_TCP_PORT=3306"); + #else _putenv("MASTER_MYPORT=9306"); _putenv("SLAVE_MYPORT=9307"); @@ -1484,7 +1608,8 @@ int main(int argc, char **argv) { char *temp, *token; temp= strdup(strchr(argv[1],'=') + 1); - for (token=str_tok(temp, ","); token != NULL; token=str_tok(NULL, ",")) + for (token=str_tok(argument, temp, ","); token != NULL; + token=str_tok(argument, NULL, ",")) { if (strlen(ignore_test) + strlen(token) + 2 <= FN_REFLEN-1) sprintf(ignore_test+strlen(ignore_test), " %s ", token); @@ -1671,105 +1796,70 @@ Arguments: Output: return the null terminated token of NULL. */ - -char *str_tok(char *string, const char *delim) +char *str_tok(char* dest, char *string, const char *delim) { - char *token; /* current token received from strtok */ - char *qt_token; /* token delimeted by the matching pair of quote */ - /* - if there are any quote chars found in the token then this variable - will hold the concatenated string to return to the caller - */ - char *ptr_token=NULL; - /* pointer to the quote character in the token from strtok */ - char *ptr_quote=NULL; + char *token; + char *ptr_end_token= NULL; + char *ptr_quote= NULL; + char *ptr_token= NULL; + int count_quotes= 0; - /* See if the delimeter contains any quote character */ + *dest = '\0'; if (strchr(delim,'\'') || strchr(delim,'\"')) return NULL; - /* repeate till we are getting some token from strtok */ - while ((token= (char*)strtok(string, delim) ) != NULL) + token= (char*)strtok(string, delim); + if (token) { - /* - make the input string NULL so that next time onward strtok can - be called with NULL input string. - */ - string= NULL; - /* We don't need to remove any quote character for Windows version */ + /* double quote is found */ + if (strchr(token,'\"')) + { + do + { + if (count_quotes & 1) + { + if (*dest == '\0') + sprintf(dest,"%s", ptr_token); + else + sprintf(dest,"%s %s", dest, ptr_token); + ptr_token= (char*)strtok(NULL, delim); + if (!ptr_token) + break; + } + else + { + ptr_token= token; + } + if (ptr_quote = strchr(ptr_token,'\"')) + { + ptr_end_token= ptr_token + strlen(ptr_token); + do + { #ifndef __WIN__ - /* check if the current token contain double quote character*/ - if ((ptr_quote= (char*)strchr(token,'\"')) != NULL) - { - /* - get the matching the matching double quote in the remaining - input string - */ - qt_token= (char*)strtok(NULL,"\""); - } - /* check if the current token contain single quote character*/ - else if ((ptr_quote= (char*)strchr(token,'\'')) != NULL) - { - /* - get the matching the matching single quote in the remaining - input string - */ - qt_token= (char*)strtok(NULL,"\'"); - } + bmove(ptr_quote, ptr_quote+1, ptr_end_token - ptr_quote); #endif - /* - if the current token does not contains any quote character then - return to the caller. - */ - if (ptr_quote == NULL) - { - /* - if there is any earlier token i.e. ptr_token then append the - current token in it and return it else return the current - token directly - */ - return ptr_token ? strcat(ptr_token,token) : token; - } - - /* - remove the quote character i.e. make NULL so that the token will - be devided in two part and later both part can be concatenated - and hence quote will be removed - */ - *ptr_quote= 0; - - /* check if ptr_token has been initialized or not */ - if (ptr_token == NULL) - { - /* initialize the ptr_token with current token */ - ptr_token= token; - /* copy entire string between matching pair of quote*/ - sprintf(ptr_token+strlen(ptr_token),"%s %s", ptr_quote+1, qt_token); + count_quotes++; + } while (ptr_quote != NULL && (ptr_quote = strchr(ptr_quote+1,'\"'))); + } + /* there are unpair quotes we have to search next quote*/ + } while (count_quotes & 1); + if (ptr_token != NULL) + { + if (*dest == '\0') + sprintf(dest,"%s", ptr_token); + else + sprintf(dest,"%s %s",dest,ptr_token); + } } else { - /* - copy the current token and entire string between matching pair - of quote - */ - if (qt_token == NULL) - { - sprintf(ptr_token+strlen(ptr_token),"%s%s", token, ptr_quote+1); - } - else - { - sprintf(ptr_token+strlen(ptr_token),"%s%s %s", token, ptr_quote+1, - qt_token ); - } + sprintf(dest,"%s",token); } } - - /* return the concatenated token */ - return ptr_token; + return token ? dest : NULL; } #ifndef __WIN__ - /* Synopsis: This function run scripts files on Linux and Netware diff --git a/mysql-test/t/ps_1general.test b/mysql-test/t/ps_1general.test index d9cc9de6ff1..5450512b959 100644 --- a/mysql-test/t/ps_1general.test +++ b/mysql-test/t/ps_1general.test @@ -317,7 +317,7 @@ prepare stmt4 from ' show engine bdb logs '; execute stmt4; --enable_result_log prepare stmt4 from ' show full processlist '; ---replace_column 1 number 6 time +--replace_column 1 number 6 time 3 localhost execute stmt4; prepare stmt4 from ' show grants for user '; --error 1295 From 0f7fae73d198a93956e81eb93af1cbf2d3506013 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 31 Jan 2005 17:33:01 +0100 Subject: [PATCH 0878/1063] - Bootstrap: Rename already existing build directories to something more useful than *.old. - use the mtime of configure.in instead. This gives us a time stamp of when this last build directory was created, e.g. "mysql-4.0.24-build-2005-01-31-16:47" Build-tools/Bootstrap: - Rename already existing build directories to something more useful than *.old. - use the mtime of configure.in instead. This gives us a time stamp of when this last build directory was created, e.g. "mysql-4.0.24-build-2005-01-31-16:47" --- Build-tools/Bootstrap | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Build-tools/Bootstrap b/Build-tools/Bootstrap index 10ebc5c2dd1..827eb4022d7 100755 --- a/Build-tools/Bootstrap +++ b/Build-tools/Bootstrap @@ -210,10 +210,16 @@ if (-d $target_dir) } else { - &logger("Renaming $target_dir to $target_dir.old." . $$); + # Get the time stamp of "configure.in" + @stat= stat("$target_dir/configure.in"); + my $mtime= $stat[9]; + my ($sec,$min,$hour,$mday,$mon,$year) = localtime($mtime); + my $mtime= sprintf("%04d%-02d-%02d-%02d:%02d", $year+1900, $mon+1, $mday, $hour, $min); + + &logger("Renaming $target_dir to $target_dir-$mtime"); $command= "mv "; $command.= "-v " if ($opt_verbose || defined $opt_log); - $command.= "$target_dir $target_dir.old." . $$; + $command.= "$target_dir $target_dir-$mtime"; &run_command($command, "Could not rename $target_dir!"); } } From 0a507d2cf1244d67dbe702343d34b3ff78089374 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 31 Jan 2005 18:11:26 +0100 Subject: [PATCH 0879/1063] Fixed a bug in the ndbd scheduler with send of packed signals. Fixing this bugs improves performance by 40% for very small read statements and with 12-13 % for very simple updating transactions (flexBench -o 10000) in single threaded application. Removes a fixed cost of around 100.000 cycles every time the ndbd process wakes up to execute some queries. ndb/src/kernel/vm/FastScheduler.cpp: Integrate sendPacked into doJob The lack of integration meant that several loops in ipControlLoop were executed each time the ndbd process woke up, also for reads it meant that response was divided in two TCP/IP packets Is necessary to integrate this with overload protection ndb/src/kernel/vm/ThreadConfig.cpp: Integrate sendPacked into doJob The lack of integration meant that several loops in ipControlLoop were executed each time the ndbd process woke up, also for reads it meant that response was divided in two TCP/IP packets Is necessary to integrate this with overload protection --- ndb/src/kernel/vm/FastScheduler.cpp | 33 +++++++++++++++++++---------- ndb/src/kernel/vm/ThreadConfig.cpp | 3 --- 2 files changed, 22 insertions(+), 14 deletions(-) diff --git a/ndb/src/kernel/vm/FastScheduler.cpp b/ndb/src/kernel/vm/FastScheduler.cpp index eca456d26dd..d05c02360a7 100644 --- a/ndb/src/kernel/vm/FastScheduler.cpp +++ b/ndb/src/kernel/vm/FastScheduler.cpp @@ -76,19 +76,26 @@ FastScheduler::activateSendPacked() globalData.loopMax = 2048; }//FastScheduler::activateSendPacked() +//------------------------------------------------------------------------ +// sendPacked is executed at the end of the loop. +// To ensure that we don't send any messages before executing all local +// packed signals we do another turn in the loop (unless we have already +// executed too many signals in the loop). +//------------------------------------------------------------------------ void FastScheduler::doJob() { + Uint32 init_loopCount = 0; + Uint32 TminLoops = getBOccupancy() + EXTRA_SIGNALS_PER_DO_JOB; + Uint32 TloopMax = (Uint32)globalData.loopMax; + if (TminLoops < TloopMax) { + TloopMax = TminLoops; + }//if + if (TloopMax < MIN_NUMBER_OF_SIG_PER_DO_JOB) { + TloopMax = MIN_NUMBER_OF_SIG_PER_DO_JOB; + }//if do{ - Uint32 loopCount = 0; - Uint32 TminLoops = getBOccupancy() + EXTRA_SIGNALS_PER_DO_JOB; - Uint32 TloopMax = (Uint32)globalData.loopMax; - if (TminLoops < TloopMax) { - TloopMax = TminLoops; - }//if - if (TloopMax < MIN_NUMBER_OF_SIG_PER_DO_JOB) { - TloopMax = MIN_NUMBER_OF_SIG_PER_DO_JOB; - }//if + Uint32 loopCount = init_loopCount; register Uint32 tHighPrio = globalData.highestAvailablePrio; register Signal* signal = getVMSignals(); while ((tHighPrio < LEVEL_IDLE) && (loopCount < TloopMax)) { @@ -151,7 +158,7 @@ FastScheduler::doJob() if (globalData.sendPackedActivated == 1) { Uint32 t1 = theDoJobTotalCounter; Uint32 t2 = theDoJobCallCounter; - t1 += loopCount; + t1 += (loopCount - init_loopCount); t2++; theDoJobTotalCounter = t1; theDoJobCallCounter = t2; @@ -161,7 +168,11 @@ FastScheduler::doJob() theDoJobTotalCounter = 0; }//if }//if - } while (getBOccupancy() > MAX_OCCUPANCY); + init_loopCount = loopCount; + sendPacked(); + } while ((getBOccupancy() > MAX_OCCUPANCY) || + ((init_loopCount < TloopMax) && + (globalData.highestAvailablePrio < LEVEL_IDLE))); }//FastScheduler::doJob() void FastScheduler::sendPacked() diff --git a/ndb/src/kernel/vm/ThreadConfig.cpp b/ndb/src/kernel/vm/ThreadConfig.cpp index 4844bb9a477..76fcc4ba84f 100644 --- a/ndb/src/kernel/vm/ThreadConfig.cpp +++ b/ndb/src/kernel/vm/ThreadConfig.cpp @@ -173,9 +173,6 @@ void ThreadConfig::ipControlLoop() // until all buffers are empty or until we have executed 2048 signals. //-------------------------------------------------------------------- globalScheduler.doJob(); - - globalScheduler.sendPacked(); - }//while globalData.incrementWatchDogCounter(6); From 0e2e3df2b4bbbcc6c7625a9d2c998fa3c2733417 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 31 Jan 2005 12:17:34 -0800 Subject: [PATCH 0880/1063] Removed duplicate close call and added archive to the debug build and test. BUILD/compile-ia64-debug-max: Added archive for this build. sql/examples/ha_archive.cc: Removed duplicate close call. --- BUILD/compile-ia64-debug-max | 2 +- sql/examples/ha_archive.cc | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/BUILD/compile-ia64-debug-max b/BUILD/compile-ia64-debug-max index 9cd54de428d..56c36059ea9 100755 --- a/BUILD/compile-ia64-debug-max +++ b/BUILD/compile-ia64-debug-max @@ -9,5 +9,5 @@ then (cd gemini && aclocal && autoheader && aclocal && automake && autoconf) fi -CC=ecc CFLAGS="-w1 -DEXTRA_DEBUG -DSAFEMALLOC -DSAFE_MUTEX -O2" CXX=ecc CXXFLAGS="-w1 -DEXTRA_DEBUG -DSAFEMALLOC -DSAFE_MUTEX -O2" ./configure --prefix=/usr/local/mysql --with-extra-charsets=complex --enable-thread-safe-client --with-mysqld-ldflags=-all-static --with-client-ldflags=-all-static --with-debug --with-innodb --with-embedded-server +CC=ecc CFLAGS="-w1 -DEXTRA_DEBUG -DSAFEMALLOC -DSAFE_MUTEX -O2" CXX=ecc CXXFLAGS="-w1 -DEXTRA_DEBUG -DSAFEMALLOC -DSAFE_MUTEX -O2" ./configure --prefix=/usr/local/mysql --with-extra-charsets=complex --enable-thread-safe-client --with-mysqld-ldflags=-all-static --with-client-ldflags=-all-static --with-debug --with-innodb --with-embedded-server --with-archive-storage-engine gmake diff --git a/sql/examples/ha_archive.cc b/sql/examples/ha_archive.cc index 6bf3d485575..491056d0e59 100644 --- a/sql/examples/ha_archive.cc +++ b/sql/examples/ha_archive.cc @@ -405,7 +405,6 @@ int ha_archive::free_share(ARCHIVE_SHARE *share) rc= 1; if (my_close(share->meta_file, MYF(0))) rc= 1; - my_close(share->meta_file,MYF(0)); my_free((gptr) share, MYF(0)); } pthread_mutex_unlock(&archive_mutex); From af39ee001d4c7dbae6aee384802ab0252d2244a1 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 31 Jan 2005 22:28:55 +0200 Subject: [PATCH 0881/1063] mem0pool.c: Fix an assertion failure in 64-bit computers if UNIV_MEM_DEBUG is defined innobase/mem/mem0pool.c: Fix an assertion failure in 64-bit computers if UNIV_MEM_DEBUG is defined --- innobase/mem/mem0pool.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/innobase/mem/mem0pool.c b/innobase/mem/mem0pool.c index cd75728c937..bb1f44d6fb7 100644 --- a/innobase/mem/mem0pool.c +++ b/innobase/mem/mem0pool.c @@ -597,8 +597,8 @@ mem_pool_validate( } } - ut_a(free + pool->reserved == pool->size - - (pool->size % MEM_AREA_MIN_SIZE)); + ut_a(free + pool->reserved == pool->size); + mutex_exit(&(pool->mutex)); return(TRUE); From 4b88e07159d297dfa3a3e89f988e65e86610a9bd Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 31 Jan 2005 17:24:18 -0600 Subject: [PATCH 0882/1063] Bug #6607 Create table... LIKE... with Windows Symlinks sql_table.cc: use fn_format to resolve symlinks in mysql_create_like_table sql/sql_table.cc: use fn_format to resolve symlinks in mysql_create_like_table --- sql/sql_table.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 423a309767b..f3c107c2696 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -2272,8 +2272,7 @@ int mysql_create_like_table(THD* thd, TABLE_LIST* table, strxmov(src_path, (*tmp_table)->path, reg_ext, NullS); else { - strxmov(src_path, mysql_data_home, "/", src_db, "/", src_table, - reg_ext, NullS); + fn_format( src_path, src_table, src_db, reg_ext, MYF(MY_UNPACK_FILENAME)); if (access(src_path, F_OK)) { my_error(ER_BAD_TABLE_ERROR, MYF(0), src_table); @@ -2300,8 +2299,7 @@ int mysql_create_like_table(THD* thd, TABLE_LIST* table, } else { - strxmov(dst_path, mysql_data_home, "/", db, "/", table_name, - reg_ext, NullS); + fn_format( dst_path, table_name, db, reg_ext, MYF(MY_UNPACK_FILENAME)); if (!access(dst_path, F_OK)) goto table_exists; } From 68baa2ac2e6e72b0b36ffa4e5c36c0965fdfc6d1 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 31 Jan 2005 18:22:52 -0800 Subject: [PATCH 0883/1063] Fix bug in bundled GNU readline library, based on similar report for GNU bash (http://lists.gnu.org/archive/html/bug-bash/2002-08/msg00042.html) and current code from GNU readline 5.0. (Bug #5672) cmd-line-utils/readline/bind.c: Import fix from readline-5.0 for endless recursion problem with some misunderstood key codes --- cmd-line-utils/readline/bind.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd-line-utils/readline/bind.c b/cmd-line-utils/readline/bind.c index 7e8ca04e0d6..fd01049f09f 100644 --- a/cmd-line-utils/readline/bind.c +++ b/cmd-line-utils/readline/bind.c @@ -311,7 +311,7 @@ rl_generic_bind (type, keyseq, data, map) mapped to something, `abc' to be mapped to something else, and the function bound to `a' to be executed when the user types `abx', leaving `bx' in the input queue. */ - if (k.function /* && k.type == ISFUNC */) + if (k.function && ((k.type == ISFUNC && k.function != rl_do_lowercase_version) || k.type == ISMACR)) { map[ANYOTHERKEY] = k; k.function = 0; From 77cdf79fb4e19b6fceba93596f7ce786620c83a6 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 31 Jan 2005 19:35:12 -0800 Subject: [PATCH 0884/1063] Add 'debug' to mysqladmin --help output. (Bug #8207) client/mysqladmin.cc: Add documentation for 'debug' command --- client/mysqladmin.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/client/mysqladmin.cc b/client/mysqladmin.cc index d390a152fc7..0da7d5b3acf 100644 --- a/client/mysqladmin.cc +++ b/client/mysqladmin.cc @@ -1008,6 +1008,7 @@ static void usage(void) print_defaults("my",load_default_groups); puts("\nWhere command is a one or more of: (Commands may be shortened)\n\ create databasename Create a new database\n\ + debug Instruct server to write debug information to log\n\ drop databasename Delete a database and all its tables\n\ extended-status Gives an extended status message from the server\n\ flush-hosts Flush all cached hosts\n\ From 199375cbc94eda3d60b9c038037e19a7e9cdf8f4 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 31 Jan 2005 23:02:32 -0600 Subject: [PATCH 0885/1063] Bug #7390 perror.exe doesn't work perror.c: Copy output of strerr to temp buffer to prevent system overwrite on Windows extra/perror.c: Copy output of strerr to temp buffer to prevent system overwrite on Windows --- extra/perror.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/extra/perror.c b/extra/perror.c index 1bd4b203120..fc10d8eaecc 100644 --- a/extra/perror.c +++ b/extra/perror.c @@ -184,6 +184,7 @@ int main(int argc,char *argv[]) { int error,code,found; const char *msg; + char *unknown_error = 0; MY_INIT(argv[0]); if (get_options(&argc,&argv)) @@ -212,7 +213,12 @@ int main(int argc,char *argv[]) string 'Unknown Error'. To avoid printing it we try to find the error string by asking for an impossible big error message. */ - const char *unknown_error= strerror(10000); + msg = strerror(10000); + + /* allocate a buffer for unknown_error since strerror always returns the same pointer + on some platforms such as Windows */ + unknown_error = malloc( strlen(msg)+1 ); + strcpy( unknown_error, msg ); for ( ; argc-- > 0 ; argv++) { @@ -262,6 +268,11 @@ int main(int argc,char *argv[]) } } } + + /* if we allocated a buffer for unknown_error, free it now */ + if (unknown_error) + free(unknown_error); + exit(error); return error; } From 7da72c932e302386beb243ab9cf61ed61a13f4d9 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 1 Feb 2005 15:36:48 +0200 Subject: [PATCH 0886/1063] Remove #if 0 as this only confuses the code withing adding anything --- sql/sql_select.cc | 6 ------ 1 file changed, 6 deletions(-) diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 8dcae9a24b7..29c15741347 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -2138,15 +2138,9 @@ find_best(JOIN *join,table_map rest_tables,uint idx,double record_count, x = used key parts (1 <= x <= c) */ double rec_per_key; -#if 0 - if (!(rec_per_key=(double) - keyinfo->rec_per_key[keyinfo->key_parts-1])) - rec_per_key=(double) s->records/rec+1; -#else rec_per_key= keyinfo->rec_per_key[keyinfo->key_parts-1] ? (double) keyinfo->rec_per_key[keyinfo->key_parts-1] : (double) s->records/rec+1; -#endif if (!s->records) tmp=0; From c53184ebb775290d2e0f8397815832f1c84a8a5c Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 1 Feb 2005 16:27:08 +0200 Subject: [PATCH 0887/1063] Proper fix for comparision with ' ' (Bug #7788 "Table is full" occurs during a multitable update") client/mysqldump.c: Style fixes innobase/include/univ.i: UNIV_DEBUG should not depend on configure --debug but on --debug=full mysql-test/r/compare.result: Added test to find bug in previous bugfix mysql-test/t/compare.test: Added test to find bug in previous bugfix mysys/my_handler.c: Proper fix for comparision with ' ' strings/ctype-big5.c: Proper fix for comparision with ' ' strings/ctype-bin.c: Proper fix for comparision with ' ' strings/ctype-gbk.c: Proper fix for comparision with ' ' strings/ctype-latin1.c: Proper fix for comparision with ' ' strings/ctype-mb.c: Proper fix for comparision with ' ' strings/ctype-simple.c: Proper fix for comparision with ' ' strings/ctype-sjis.c: Proper fix for comparision with ' ' strings/ctype-tis620.c: Proper fix for comparision with ' ' strings/ctype-ucs2.c: Proper fix for comparision with ' ' strings/ctype-utf8.c: Proper fix for comparision with ' ' --- client/mysqldump.c | 36 ++++++++++++++++++------------------ innobase/include/univ.i | 4 ---- mysql-test/r/compare.result | 3 +++ mysql-test/t/compare.test | 2 ++ mysys/my_handler.c | 6 +++--- strings/ctype-big5.c | 4 ++-- strings/ctype-bin.c | 4 ++-- strings/ctype-gbk.c | 4 ++-- strings/ctype-latin1.c | 4 ++-- strings/ctype-mb.c | 4 ++-- strings/ctype-simple.c | 6 +++--- strings/ctype-sjis.c | 4 ++-- strings/ctype-tis620.c | 4 ++-- strings/ctype-ucs2.c | 4 ++-- strings/ctype-utf8.c | 4 ++-- 15 files changed, 47 insertions(+), 46 deletions(-) diff --git a/client/mysqldump.c b/client/mysqldump.c index afaa2dc5a6d..52255ccb896 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -2091,27 +2091,27 @@ static int dump_all_tables_in_db(char *database) RETURN void */ -static void get_actual_table_name( const char *old_table_name, - char *new_table_name, - int buf_size ) + +static void get_actual_table_name(const char *old_table_name, + char *new_table_name, + int buf_size) { - MYSQL_RES *tableRes; - MYSQL_ROW row; - char query[ NAME_LEN + 50 ]; + MYSQL_RES *tableRes; + MYSQL_ROW row; + char query[ NAME_LEN + 50 ]; + DBUG_ENTER("get_actual_table_name"); - DBUG_ENTER("get_actual_table_name"); + sprintf( query, "SHOW TABLES LIKE '%s'", old_table_name); + if (mysql_query_with_error_report(sock, 0, query)) + { + safe_exit(EX_MYSQLERR); + } - sprintf( query, "SHOW TABLES LIKE '%s'", old_table_name ); - if (mysql_query_with_error_report(sock, 0, query)) - { - safe_exit(EX_MYSQLERR); - } - - tableRes = mysql_store_result( sock ); - row = mysql_fetch_row( tableRes ); - strncpy( new_table_name, row[0], buf_size ); - mysql_free_result(tableRes); -} /* get_actual_table_name */ + tableRes= mysql_store_result( sock ); + row= mysql_fetch_row( tableRes ); + strmake(new_table_name, row[0], buf_size-1); + mysql_free_result(tableRes); +} static int dump_selected_tables(char *db, char **table_names, int tables) diff --git a/innobase/include/univ.i b/innobase/include/univ.i index 6ae4fe1c2ce..625978ffc38 100644 --- a/innobase/include/univ.i +++ b/innobase/include/univ.i @@ -80,10 +80,6 @@ memory is read outside the allocated blocks. */ /* Make a non-inline debug version */ -#ifdef DBUG_ON -#define UNIV_DEBUG -#endif /* DBUG_ON */ - /* #define UNIV_DEBUG #define UNIV_MEM_DEBUG diff --git a/mysql-test/r/compare.result b/mysql-test/r/compare.result index 49ec2dd85cc..6f667aabac0 100644 --- a/mysql-test/r/compare.result +++ b/mysql-test/r/compare.result @@ -39,3 +39,6 @@ DROP TABLE t1; SELECT CHAR(31) = '', '' = CHAR(31); CHAR(31) = '' '' = CHAR(31) 0 0 +SELECT CHAR(30) = '', '' = CHAR(30); +CHAR(30) = '' '' = CHAR(30) +0 0 diff --git a/mysql-test/t/compare.test b/mysql-test/t/compare.test index e3c042e608a..bc20786227b 100644 --- a/mysql-test/t/compare.test +++ b/mysql-test/t/compare.test @@ -33,3 +33,5 @@ DROP TABLE t1; # Bug #8134: Comparison against CHAR(31) at end of string SELECT CHAR(31) = '', '' = CHAR(31); +# Extra test +SELECT CHAR(30) = '', '' = CHAR(30); diff --git a/mysys/my_handler.c b/mysys/my_handler.c index df1e9e55e0a..5ee181ca78e 100644 --- a/mysys/my_handler.c +++ b/mysys/my_handler.c @@ -43,7 +43,7 @@ static int compare_bin(uchar *a, uint a_length, uchar *b, uint b_length, return 0; if (skip_end_space && a_length != b_length) { - int swap= 0; + int swap= 1; /* We are using space compression. We have to check if longer key has next character < ' ', in which case it's less than the shorter @@ -57,12 +57,12 @@ static int compare_bin(uchar *a, uint a_length, uchar *b, uint b_length, /* put shorter key in a */ a_length= b_length; a= b; - swap= -1 ^ 1; /* swap sign of result */ + swap= -1; /* swap sign of result */ } for (end= a + a_length-length; a < end ; a++) { if (*a != ' ') - return ((int) *a - (int) ' ') ^ swap; + return (*a < ' ') ? -swap : swap; } return 0; } diff --git a/strings/ctype-big5.c b/strings/ctype-big5.c index 997b8ce93d6..270b02212af 100644 --- a/strings/ctype-big5.c +++ b/strings/ctype-big5.c @@ -271,7 +271,7 @@ static int my_strnncollsp_big5(CHARSET_INFO * cs __attribute__((unused)), if (!res && a_length != b_length) { const uchar *end; - int swap= 0; + int swap= 1; /* Check the next not space character of the longer key. If it's < ' ', then it's smaller than the other key. @@ -286,7 +286,7 @@ static int my_strnncollsp_big5(CHARSET_INFO * cs __attribute__((unused)), for (end= a + a_length-length; a < end ; a++) { if (*a != ' ') - return ((int) *a - (int) ' ') ^ swap; + return (*a < ' ') ? -swap : swap; } } return res; diff --git a/strings/ctype-bin.c b/strings/ctype-bin.c index 95c52512243..618879607ec 100644 --- a/strings/ctype-bin.c +++ b/strings/ctype-bin.c @@ -157,7 +157,7 @@ static int my_strnncollsp_8bit_bin(CHARSET_INFO * cs __attribute__((unused)), } if (a_length != b_length) { - int swap= 0; + int swap= 1; /* Check the next not space character of the longer key. If it's < ' ', then it's smaller than the other key. @@ -172,7 +172,7 @@ static int my_strnncollsp_8bit_bin(CHARSET_INFO * cs __attribute__((unused)), for (end= a + a_length-length; a < end ; a++) { if (*a != ' ') - return ((int) *a - (int) ' ') ^ swap; + return (*a < ' ') ? -swap : swap; } } return 0; diff --git a/strings/ctype-gbk.c b/strings/ctype-gbk.c index 731ad58a2fb..9daa9f90f3c 100644 --- a/strings/ctype-gbk.c +++ b/strings/ctype-gbk.c @@ -2632,7 +2632,7 @@ static int my_strnncollsp_gbk(CHARSET_INFO * cs __attribute__((unused)), if (!res && a_length != b_length) { const uchar *end; - int swap= 0; + int swap= 1; /* Check the next not space character of the longer key. If it's < ' ', then it's smaller than the other key. @@ -2647,7 +2647,7 @@ static int my_strnncollsp_gbk(CHARSET_INFO * cs __attribute__((unused)), for (end= a + a_length-length; a < end ; a++) { if (*a != ' ') - return ((int) *a - (int) ' ') ^ swap; + return (*a < ' ') ? -swap : swap; } } return res; diff --git a/strings/ctype-latin1.c b/strings/ctype-latin1.c index 32d9a227c2f..4ab101add5b 100644 --- a/strings/ctype-latin1.c +++ b/strings/ctype-latin1.c @@ -611,7 +611,7 @@ static int my_strnncollsp_latin1_de(CHARSET_INFO *cs __attribute__((unused)), if (a != a_end || b != b_end) { - int swap= 0; + int swap= 1; /* Check the next not space character of the longer key. If it's < ' ', then it's smaller than the other key. @@ -626,7 +626,7 @@ static int my_strnncollsp_latin1_de(CHARSET_INFO *cs __attribute__((unused)), for ( ; a < a_end ; a++) { if (*a != ' ') - return ((int) *a - (int) ' ') ^ swap; + return (*a < ' ') ? -swap : swap; } } return 0; diff --git a/strings/ctype-mb.c b/strings/ctype-mb.c index 731fc460cef..6cf48291c91 100644 --- a/strings/ctype-mb.c +++ b/strings/ctype-mb.c @@ -389,7 +389,7 @@ static int my_strnncollsp_mb_bin(CHARSET_INFO * cs __attribute__((unused)), } if (a_length != b_length) { - int swap= 0; + int swap= 1; /* Check the next not space character of the longer key. If it's < ' ', then it's smaller than the other key. @@ -404,7 +404,7 @@ static int my_strnncollsp_mb_bin(CHARSET_INFO * cs __attribute__((unused)), for (end= a + a_length-length; a < end ; a++) { if (*a != ' ') - return ((int) *a - (int) ' ') ^ swap; + return (*a < ' ') ? -swap : swap; } } return 0; diff --git a/strings/ctype-simple.c b/strings/ctype-simple.c index 4dc6a1be27b..1a09b16a264 100644 --- a/strings/ctype-simple.c +++ b/strings/ctype-simple.c @@ -143,7 +143,7 @@ int my_strnncollsp_simple(CHARSET_INFO * cs, const uchar *a, uint a_length, } if (a_length != b_length) { - int swap= 0; + int swap= 1; /* Check the next not space character of the longer key. If it's < ' ', then it's smaller than the other key. @@ -153,12 +153,12 @@ int my_strnncollsp_simple(CHARSET_INFO * cs, const uchar *a, uint a_length, /* put shorter key in s */ a_length= b_length; a= b; - swap= -1^1; /* swap sign of result */ + swap= -1; /* swap sign of result */ } for (end= a + a_length-length; a < end ; a++) { if (*a != ' ') - return ((int) *a - (int) ' ') ^ swap; + return (*a < ' ') ? -swap : swap; } } return 0; diff --git a/strings/ctype-sjis.c b/strings/ctype-sjis.c index c0b33a13cdd..0cb30a9b6ee 100644 --- a/strings/ctype-sjis.c +++ b/strings/ctype-sjis.c @@ -251,7 +251,7 @@ static int my_strnncollsp_sjis(CHARSET_INFO *cs __attribute__((unused)), int res= my_strnncoll_sjis_internal(cs, &a, a_length, &b, b_length); if (!res && (a != a_end || b != b_end)) { - int swap= 0; + int swap= 1; /* Check the next not space character of the longer key. If it's < ' ', then it's smaller than the other key. @@ -266,7 +266,7 @@ static int my_strnncollsp_sjis(CHARSET_INFO *cs __attribute__((unused)), for (; a < a_end ; a++) { if (*a != ' ') - return ((int) *a - (int) ' ') ^ swap; + return (*a < ' ') ? -swap : swap; } } return res; diff --git a/strings/ctype-tis620.c b/strings/ctype-tis620.c index 3a43c556ac8..6a6c55d214e 100644 --- a/strings/ctype-tis620.c +++ b/strings/ctype-tis620.c @@ -589,7 +589,7 @@ int my_strnncollsp_tis620(CHARSET_INFO * cs __attribute__((unused)), } if (a_length != b_length) { - int swap= 0; + int swap= 1; /* Check the next not space character of the longer key. If it's < ' ', then it's smaller than the other key. @@ -605,7 +605,7 @@ int my_strnncollsp_tis620(CHARSET_INFO * cs __attribute__((unused)), { if (*a != ' ') { - res= ((int) *a - (int) ' ') ^ swap; + res= (*a < ' ') ? -swap : swap; goto ret; } } diff --git a/strings/ctype-ucs2.c b/strings/ctype-ucs2.c index 936e2b6fdce..ea11f8816a5 100644 --- a/strings/ctype-ucs2.c +++ b/strings/ctype-ucs2.c @@ -275,7 +275,7 @@ static int my_strnncollsp_ucs2(CHARSET_INFO *cs __attribute__((unused)), if (slen != tlen) { - int swap= 0; + int swap= 1; if (slen < tlen) { s= t; @@ -286,7 +286,7 @@ static int my_strnncollsp_ucs2(CHARSET_INFO *cs __attribute__((unused)), for ( ; s < se ; s+= 2) { if (s[0] || s[1] != ' ') - return (((int)s[0] << 8) + (int) s[1] - (int) ' ') ^ swap; + return (s[0] == 0 && s[1] < ' ') ? -swap : swap; } } return 0; diff --git a/strings/ctype-utf8.c b/strings/ctype-utf8.c index 502d0ec285e..486d428bf1d 100644 --- a/strings/ctype-utf8.c +++ b/strings/ctype-utf8.c @@ -2077,7 +2077,7 @@ static int my_strnncollsp_utf8(CHARSET_INFO *cs, if (slen != tlen) { - int swap= 0; + int swap= 1; if (slen < tlen) { slen= tlen; @@ -2098,7 +2098,7 @@ static int my_strnncollsp_utf8(CHARSET_INFO *cs, for ( ; s < se; s++) { if (*s != ' ') - return ((int)*s - (int) ' ') ^ swap; + return (*s < ' ') ? -swap : swap; } } return 0; From bdecd73e1a795cfc227e94f9a1b05089dd9f7f5b Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 1 Feb 2005 18:35:09 +0400 Subject: [PATCH 0888/1063] A fix (bug #7971: set_bit/clear_bit names conflict w/Linux kernel headers >= 2.6.9-rcxx) extra/replace.c: A fix (bug #7971: set_bit/clear_bit names conflict w/Linux kernel headers >= 2.6.9-rcxx) set_bit replaced with internal_set_bit clear_bit replaced with internal_clear_bit --- extra/replace.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/extra/replace.c b/extra/replace.c index 5444f443382..706d4941768 100644 --- a/extra/replace.c +++ b/extra/replace.c @@ -376,8 +376,8 @@ static REP_SET *make_new_set(REP_SETS *sets); static void make_sets_invisible(REP_SETS *sets); static void free_last_set(REP_SETS *sets); static void free_sets(REP_SETS *sets); -static void set_bit(REP_SET *set, uint bit); -static void clear_bit(REP_SET *set, uint bit); +static void internal_set_bit(REP_SET *set, uint bit); +static void internal_clear_bit(REP_SET *set, uint bit); static void or_bits(REP_SET *to,REP_SET *from); static void copy_bits(REP_SET *to,REP_SET *from); static int cmp_bits(REP_SET *set1,REP_SET *set2); @@ -454,7 +454,7 @@ REPLACE *init_replace(my_string *from, my_string *to,uint count, { if (from[i][0] == '\\' && from[i][1] == '^') { - set_bit(start_states,states+1); + internal_set_bit(start_states,states+1); if (!from[i][2]) { start_states->table_offset=i; @@ -463,8 +463,8 @@ REPLACE *init_replace(my_string *from, my_string *to,uint count, } else if (from[i][0] == '\\' && from[i][1] == '$') { - set_bit(start_states,states); - set_bit(word_states,states); + internal_set_bit(start_states,states); + internal_set_bit(word_states,states); if (!from[i][2] && start_states->table_offset == (uint) ~0) { start_states->table_offset=i; @@ -473,11 +473,11 @@ REPLACE *init_replace(my_string *from, my_string *to,uint count, } else { - set_bit(word_states,states); + internal_set_bit(word_states,states); if (from[i][0] == '\\' && (from[i][1] == 'b' && from[i][2])) - set_bit(start_states,states+1); + internal_set_bit(start_states,states+1); else - set_bit(start_states,states); + internal_set_bit(start_states,states); } for (pos=from[i], len=0; *pos ; pos++) { @@ -583,9 +583,9 @@ REPLACE *init_replace(my_string *from, my_string *to,uint count, follow[i].len > found_end) found_end=follow[i].len; if (chr && follow[i].chr) - set_bit(new_set,i+1); /* To next set */ + internal_set_bit(new_set,i+1); /* To next set */ else - set_bit(new_set,i); + internal_set_bit(new_set,i); } } if (found_end) @@ -602,7 +602,7 @@ REPLACE *init_replace(my_string *from, my_string *to,uint count, if (follow[bit_nr-1].len < found_end || (new_set->found_len && (chr == 0 || !follow[bit_nr].chr))) - clear_bit(new_set,i); + internal_clear_bit(new_set,i); else { if (chr == 0 || !follow[bit_nr].chr) @@ -751,13 +751,13 @@ static void free_sets(REP_SETS *sets) return; } -static void set_bit(REP_SET *set, uint bit) +static void internal_set_bit(REP_SET *set, uint bit) { set->bits[bit / WORD_BIT] |= 1 << (bit % WORD_BIT); return; } -static void clear_bit(REP_SET *set, uint bit) +static void internal_clear_bit(REP_SET *set, uint bit) { set->bits[bit / WORD_BIT] &= ~ (1 << (bit % WORD_BIT)); return; From 3a890c8a874fe52dcac99864b6c4785de0210549 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 1 Feb 2005 16:49:23 +0100 Subject: [PATCH 0889/1063] ndb - 1) New testcase Check every combination of ins/upd/del of length 5 Check reading savepoint's 2) Fix 1 liner in acc wrt committing read ndb/include/ndbapi/NdbConnection.hpp: Make testcase friend ndb/src/kernel/blocks/dbacc/DbaccMain.cpp: Fix so that committing a READ can _not_ result in setting elementIsDisappeared ndb/test/include/NDBT_Test.hpp: Make copy of testcase name ndb/test/ndbapi/testOperations.cpp: New testcase Check every combination of ins/upd/del of length 5 Check reading savepoint's ndb/test/src/HugoOperations.cpp: Close transaction in destructor ndb/test/src/NDBT_Test.cpp: Make copy of testcase name --- ndb/include/ndbapi/NdbConnection.hpp | 2 + ndb/src/kernel/blocks/dbacc/DbaccMain.cpp | 3 +- ndb/test/include/NDBT_Test.hpp | 4 +- ndb/test/ndbapi/testOperations.cpp | 283 ++++++++++++++++++++++ ndb/test/src/HugoOperations.cpp | 4 + ndb/test/src/NDBT_Test.cpp | 12 +- 6 files changed, 302 insertions(+), 6 deletions(-) diff --git a/ndb/include/ndbapi/NdbConnection.hpp b/ndb/include/ndbapi/NdbConnection.hpp index 166355cae17..f173cd8ac6e 100644 --- a/ndb/include/ndbapi/NdbConnection.hpp +++ b/ndb/include/ndbapi/NdbConnection.hpp @@ -687,6 +687,8 @@ private: void remove_list(NdbOperation*& head, NdbOperation*); void define_scan_op(NdbIndexScanOperation*); + + friend int runOperations(class NDBT_Context*, class NDBT_Step*); }; inline diff --git a/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp b/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp index 5c7cc597672..a82c96beebd 100644 --- a/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp +++ b/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp @@ -5704,7 +5704,8 @@ void Dbacc::commitOperation(Signal* signal) Uint32 tmp2Olq; if ((operationRecPtr.p->commitDeleteCheckFlag == ZFALSE) && - (operationRecPtr.p->operation != ZSCAN_OP)) { + (operationRecPtr.p->operation != ZSCAN_OP) && + (operationRecPtr.p->operation != ZREAD)) { jam(); /* This method is used to check whether the end result of the transaction will be to delete the tuple. In this case all operation will be marked diff --git a/ndb/test/include/NDBT_Test.hpp b/ndb/test/include/NDBT_Test.hpp index 8b69faebde8..a60228c1a5d 100644 --- a/ndb/test/include/NDBT_Test.hpp +++ b/ndb/test/include/NDBT_Test.hpp @@ -188,7 +188,7 @@ public: NDBT_TestCase(NDBT_TestSuite* psuite, const char* name, const char* comment); - virtual ~NDBT_TestCase(){} + virtual ~NDBT_TestCase() {} // This is the default executor of a test case // When a test case is executed it will need to be suplied with a number of @@ -225,6 +225,8 @@ protected: void stopTimer(NDBT_Context*); void printTimer(NDBT_Context*); + BaseString _name; + BaseString _comment; const char* name; const char* comment; NDBT_TestSuite* suite; diff --git a/ndb/test/ndbapi/testOperations.cpp b/ndb/test/ndbapi/testOperations.cpp index 949f08281a5..92cc3e81b1a 100644 --- a/ndb/test/ndbapi/testOperations.cpp +++ b/ndb/test/ndbapi/testOperations.cpp @@ -98,6 +98,11 @@ OperationTestCase matrix[] = { result = NDBT_FAILED; \ break; } +#define C3(b) if (!(b)) { \ + g_err << "ERR: "<< step->getName() \ + << " failed on line " << __LINE__ << endl; \ + abort(); return NDBT_FAILED; } + int runOp(HugoOperations & hugoOps, Ndb * pNdb, @@ -228,11 +233,287 @@ runClearTable(NDBT_Context* ctx, NDBT_Step* step){ return NDBT_OK; } +enum OPS { o_DONE= 0, o_INS= 1, o_UPD= 2, o_DEL= 3 }; +typedef Vector Sequence; + +static +bool +valid(const Sequence& s) +{ + if(s.size() == 0) + return false; + + for(size_t i = 1; i>= 2; + } +} + +static +void +generate(Vector& out, size_t len) +{ + int max= 1; + while(len) + { + max <<= 2; + len--; + } + + len= 1; + for(int i = 0; i= len && valid(tmp)) + { + out.push_back(i); + len= tmp.size(); + } + else + { + //ndbout << "DISCARD: " << tmp << endl; + } + } +} + +int +runOperations(NDBT_Context* ctx, NDBT_Step* step) +{ + const Uint32 DUMMY = 0; + const Uint32 ROW = 1; + + int tmp; + Ndb* pNdb = GETNDB(step); + + Uint32 seqNo = ctx->getProperty("Sequence", (Uint32)0); + Uint32 no_wait = NdbOperation::LM_CommittedRead* + ctx->getProperty("NoWait", (Uint32)1); + + if(seqNo == 0) + { + return NDBT_FAILED; + } + + Sequence seq; + generate(seq, seqNo); + + { + // Dummy row + HugoOperations hugoOps(*ctx->getTab()); + C3(hugoOps.startTransaction(pNdb) == 0); + C3(hugoOps.pkInsertRecord(pNdb, DUMMY, 1, 0) == 0); + C3(hugoOps.execute_Commit(pNdb) == 0); + } + + const bool inital_row= (seq[0] != o_INS); + if(inital_row) + { + HugoOperations hugoOps(*ctx->getTab()); + C3(hugoOps.startTransaction(pNdb) == 0); + C3(hugoOps.pkInsertRecord(pNdb, ROW, 1, 0) == 0); + C3(hugoOps.execute_Commit(pNdb) == 0); + } + + HugoOperations trans1(*ctx->getTab()); + C3(trans1.startTransaction(pNdb) == 0); + for(size_t i = 0; igetTab()); + C3(other.startTransaction(pNdb) == 0); + C3(other.pkReadRecord(pNdb, ROW, 1, (NdbOperation::LockMode)j) == 0); + tmp= other.execute_Commit(pNdb); + if(j == NdbOperation::LM_CommittedRead) + { + C3(inital_row? tmp==0 && other.verifyUpdatesValue(0) == 0 : tmp==626); + } + else + { + C3(tmp == 266); + } + } + + /** + * Verify savepoint read + */ + Uint64 transactionId= trans1.getTransaction()->getTransactionId(); + for(size_t k=0; k<=i+1; k++) + { + for(size_t j = 0; j<3; j++) + { + const NdbOperation::LockMode lm= (NdbOperation::LockMode)j; + + HugoOperations same(*ctx->getTab()); + C3(same.startTransaction(pNdb) == 0); + same.getTransaction()->setTransactionId(transactionId); // Cheat + + /** + * Increase savepoint to k + */ + for(size_t l = 1; l<=k; l++) + { + C3(same.pkReadRecord(pNdb, DUMMY, 1, lm) == 0); // Read dummy row + C3(same.execute_NoCommit(pNdb) == 0); + g_info << "savepoint: " << l << endl; + } + + g_info << "op(" << k << ", " << i << "): " + << " lock mode " << lm << endl; + + C3(same.pkReadRecord(pNdb, ROW, 1, lm) == 0); // Read real row + tmp= same.execute_Commit(pNdb); + if(k == 0) + { + if(inital_row) + { + C3(tmp == 0 && same.verifyUpdatesValue(0) == 0); + } else + { + C3(tmp == 626); + } + } + else + { + switch(seq[k-1]){ + case o_INS: + case o_UPD: + C3(tmp == 0 && same.verifyUpdatesValue(k) == 0); + break; + case o_DEL: + C3(tmp == 626); + break; + case o_DONE: + abort(); + } + } + } + } + } + C3(trans1.execute_Commit(pNdb) == 0); + + return NDBT_OK; +} + int main(int argc, const char** argv){ ndb_init(); + Vector tmp; + generate(tmp, 5); + NDBT_TestSuite ts("testOperations"); + for(size_t i = 0; isetProperty("Sequence", tmp[i]); + pt->addInitializer(new NDBT_Initializer(pt, + "runClearTable", + runClearTable)); + + pt->addStep(new NDBT_ParallelStep(pt, + name.c_str()+1, + runOperations)); + + pt->addFinalizer(new NDBT_Finalizer(pt, + "runClearTable", + runClearTable)); + + ts.addTest(pt); + } + for(Uint32 i = 0; i; +template class Vector; diff --git a/ndb/test/src/HugoOperations.cpp b/ndb/test/src/HugoOperations.cpp index e8e2d992345..caaa3a3a0ee 100644 --- a/ndb/test/src/HugoOperations.cpp +++ b/ndb/test/src/HugoOperations.cpp @@ -401,6 +401,10 @@ HugoOperations::HugoOperations(const NdbDictionary::Table& _tab): HugoOperations::~HugoOperations(){ deallocRows(); + if (pTrans != NULL){ + pTrans->close(); + pTrans = NULL; + } } diff --git a/ndb/test/src/NDBT_Test.cpp b/ndb/test/src/NDBT_Test.cpp index bbbde008938..0e5f744d5ea 100644 --- a/ndb/test/src/NDBT_Test.cpp +++ b/ndb/test/src/NDBT_Test.cpp @@ -327,13 +327,17 @@ NDBT_Finalizer::NDBT_Finalizer(NDBT_TestCase* ptest, NDBT_TestCase::NDBT_TestCase(NDBT_TestSuite* psuite, const char* pname, const char* pcomment) : - name(pname) , - comment(pcomment), - suite(psuite){ + name(strdup(pname)) , + comment(strdup(pcomment)), + suite(psuite) +{ + _name.assign(pname); + _comment.assign(pcomment); + name= _name.c_str(); + comment= _comment.c_str(); assert(suite != NULL); } - NDBT_TestCaseImpl1::NDBT_TestCaseImpl1(NDBT_TestSuite* psuite, const char* pname, const char* pcomment) : From 9d548d7f2253ea5dd1f78960f61ba2f0822db177 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 1 Feb 2005 17:08:39 +0100 Subject: [PATCH 0890/1063] ndb - Put all output from ndb tools during mysql-test-run into log file mysql-test/mysql-test-run.sh: Put all output from ndb_tool into log file mysql-test/t/ndb_autodiscover.test: Put all output from ndb_tool into log file mysql-test/t/ndb_restore.test: Put all output from ndb_tool into log file --- mysql-test/mysql-test-run.sh | 3 +++ mysql-test/t/ndb_autodiscover.test | 10 +++++----- mysql-test/t/ndb_restore.test | 6 +++--- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index c2ac26217b9..44d08d65759 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -472,6 +472,7 @@ export MASTER_MYPORT MASTER_MYPORT1 SLAVE_MYPORT MYSQL_TCP_PORT MASTER_MYSOCK MA NDBCLUSTER_BASE_PORT=`expr $NDBCLUSTER_PORT + 2` NDBCLUSTER_OPTS="--port=$NDBCLUSTER_PORT --port-base=$NDBCLUSTER_BASE_PORT --data-dir=$MYSQL_TEST_DIR/var --ndb_mgm-extra-opts=$NDB_MGM_EXTRA_OPTS --ndb_mgmd-extra-opts=$NDB_MGMD_EXTRA_OPTS --ndbd-extra-opts=$NDBD_EXTRA_OPTS" NDB_BACKUP_DIR=$MYSQL_TEST_DIR/var/ndbcluster-$NDBCLUSTER_PORT +NDB_TOOLS_OUTPUT=$MYSQL_TEST_DIR/var/log/ndb_tools.log if [ x$SOURCE_DIST = x1 ] ; then MY_BASEDIR=$MYSQL_TEST_DIR @@ -637,6 +638,7 @@ export CLIENT_BINDIR MYSQL_CLIENT_TEST CHARSETSDIR export NDB_TOOLS_DIR export NDB_MGM export NDB_BACKUP_DIR +export NDB_TOOLS_OUTPUT MYSQL_TEST_ARGS="--no-defaults --socket=$MASTER_MYSOCK --database=$DB \ --user=$DBUSER --password=$DBPASSWD --silent -v --skip-safemalloc \ @@ -978,6 +980,7 @@ start_ndbcluster() { if [ ! -z "$USE_NDBCLUSTER" ] then + rm -f $NDBAPI_OUTPUT if [ -z "$USE_RUNNING_NDBCLUSTER" ] then echo "Starting ndbcluster" diff --git a/mysql-test/t/ndb_autodiscover.test b/mysql-test/t/ndb_autodiscover.test index 6551732adba..037115f5e82 100644 --- a/mysql-test/t/ndb_autodiscover.test +++ b/mysql-test/t/ndb_autodiscover.test @@ -199,7 +199,7 @@ insert into t4 values (1, "Automatic"); select * from t4; # Remove the table from NDB -system exec $NDB_TOOLS_DIR/ndb_drop_table --no-defaults -d test t4 > /dev/null ; +system exec $NDB_TOOLS_DIR/ndb_drop_table --no-defaults -d test t4 >> $NDB_TOOLS_OUTPUT ; # # Test that correct error is returned @@ -230,7 +230,7 @@ select * from t4; flush tables; # Remove the table from NDB -system exec $NDB_TOOLS_DIR/ndb_drop_table --no-defaults -d test t4 > /dev/null ; +system exec $NDB_TOOLS_DIR/ndb_drop_table --no-defaults -d test t4 >> $NDB_TOOLS_OUTPUT ; SHOW TABLES; @@ -264,8 +264,8 @@ insert into t8 values (8, "myisam table 8"); insert into t9 values (9); # Remove t3, t5 from NDB -system exec $NDB_TOOLS_DIR/ndb_drop_table --no-defaults -d test t3 > /dev/null ; -system exec $NDB_TOOLS_DIR/ndb_drop_table --no-defaults -d test t5 > /dev/null ; +system exec $NDB_TOOLS_DIR/ndb_drop_table --no-defaults -d test t3 >> $NDB_TOOLS_OUTPUT ; +system exec $NDB_TOOLS_DIR/ndb_drop_table --no-defaults -d test t5 >> $NDB_TOOLS_OUTPUT ; # Remove t6, t7 from disk system rm var/master-data/test/t6.frm > /dev/null ; system rm var/master-data/test/t7.frm > /dev/null ; @@ -479,4 +479,4 @@ create table t10 ( insert into t10 values (1, 'kalle'); ---exec $NDB_TOOLS_DIR/ndb_drop_table --no-defaults -d test `$NDB_TOOLS_DIR/ndb_show_tables --no-defaults | grep BLOB` > /dev/null 2>&1 || true +--exec $NDB_TOOLS_DIR/ndb_drop_table --no-defaults -d test `$NDB_TOOLS_DIR/ndb_show_tables --no-defaults | grep BLOB` >> $NDB_TOOLS_OUTPUT 2>&1 || true diff --git a/mysql-test/t/ndb_restore.test b/mysql-test/t/ndb_restore.test index 09939ec119d..d413453fb0e 100644 --- a/mysql-test/t/ndb_restore.test +++ b/mysql-test/t/ndb_restore.test @@ -141,10 +141,10 @@ create table t8_c engine=ndbcluster as select * from t8; create table t9_c engine=ndbcluster as select * from t9; ---exec $NDB_MGM --no-defaults -e "start backup" > /dev/null +--exec $NDB_MGM --no-defaults -e "start backup" >> $NDB_TOOLS_OUTPUT drop table t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c; ---exec $NDB_TOOLS_DIR/ndb_restore --no-defaults -b 1 -n 1 -m -r --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-1 > /tmp/ndb_restore.out ---exec $NDB_TOOLS_DIR/ndb_restore --no-defaults -b 1 -n 2 -r --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-1 > /tmp/ndb_restore.out +--exec $NDB_TOOLS_DIR/ndb_restore --no-defaults -b 1 -n 1 -m -r --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-1 >> $NDB_TOOLS_OUTPUT +--exec $NDB_TOOLS_DIR/ndb_restore --no-defaults -b 1 -n 2 -r --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-1 >> $NDB_TOOLS_OUTPUT show tables; From cf660b001ef6ba154b1d8d15b534a253dcfc14e0 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 1 Feb 2005 19:01:37 +0100 Subject: [PATCH 0891/1063] cleanup and streamlining of thread create/exit in ndb --- ndb/include/portlib/NdbThread.h | 2 +- ndb/src/common/portlib/NdbPortLibTest.cpp | 16 ++------ ndb/src/common/portlib/NdbThread.c | 40 +++++++++++-------- .../transporter/TransporterRegistry.cpp | 5 +-- ndb/src/common/util/SocketServer.cpp | 9 ----- ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp | 3 -- .../MemoryChannelTest/MemoryChannelTest.cpp | 4 -- ndb/src/kernel/vm/WatchDog.cpp | 3 -- ndb/src/mgmclient/CommandInterpreter.cpp | 6 +-- ndb/src/mgmsrv/MgmtSrvr.cpp | 10 ----- ndb/src/ndbapi/ClusterMgr.cpp | 4 -- ndb/src/ndbapi/TransporterFacade.cpp | 10 +---- ndb/src/ndbapi/ndb_cluster_connection.cpp | 3 -- ndb/test/ndbapi/benchronja.cpp | 4 +- ndb/test/ndbapi/flexAsynch.cpp | 3 +- ndb/test/ndbapi/flexBench.cpp | 5 +-- ndb/test/ndbapi/flexHammer.cpp | 5 +-- ndb/test/ndbapi/flexScan.cpp | 3 +- ndb/test/ndbapi/flexTT.cpp | 3 +- ndb/test/ndbapi/flexTimedAsynch.cpp | 3 +- ndb/test/ndbapi/flex_bench_mysql.cpp | 29 +++++++------- ndb/test/ndbapi/mainAsyncGenerator.cpp | 2 - ndb/test/src/NDBT_Test.cpp | 1 - ndb/test/tools/transproxy.cpp | 2 - 24 files changed, 55 insertions(+), 120 deletions(-) diff --git a/ndb/include/portlib/NdbThread.h b/ndb/include/portlib/NdbThread.h index 212f7de9384..e86deee4354 100644 --- a/ndb/include/portlib/NdbThread.h +++ b/ndb/include/portlib/NdbThread.h @@ -76,7 +76,7 @@ int NdbThread_WaitFor(struct NdbThread* p_wait_thread, void** status); * * * status: exit code */ -void NdbThread_Exit(int status); +void NdbThread_Exit(void *status); /** * Set thread concurrency level diff --git a/ndb/src/common/portlib/NdbPortLibTest.cpp b/ndb/src/common/portlib/NdbPortLibTest.cpp index 55b9ccec5f2..d7892411851 100644 --- a/ndb/src/common/portlib/NdbPortLibTest.cpp +++ b/ndb/src/common/portlib/NdbPortLibTest.cpp @@ -54,10 +54,7 @@ extern "C" void* thread1func(void* arg) if (arg1 != 7) fail("TEST1", "Wrong arg"); - NdbThread_Exit(returnvalue); - - return NULL; - + return returnvalue; } // test 2 variables and funcs @@ -80,10 +77,7 @@ extern "C" void* test2func(void* arg) fail("TEST2", "Failed to unlock mutex"); int returnvalue = arg1; - NdbThread_Exit(returnvalue); - - return NULL; - + return returnvalue; } @@ -129,8 +123,7 @@ extern "C" void* testfunc(void* arg) } while(tmpVar<100); - NdbThread_Exit(0); - return NULL; + return 0; } extern "C" void* testTryLockfunc(void* arg) @@ -169,8 +162,7 @@ extern "C" void* testTryLockfunc(void* arg) } while(tmpVar<100); - NdbThread_Exit(0); - return NULL; + return 0; } diff --git a/ndb/src/common/portlib/NdbThread.c b/ndb/src/common/portlib/NdbThread.c index 5f2e6021c43..c1137efdb41 100644 --- a/ndb/src/common/portlib/NdbThread.c +++ b/ndb/src/common/portlib/NdbThread.c @@ -17,7 +17,7 @@ #include #include -#include +#include #include #define MAX_THREAD_NAME 16 @@ -39,21 +39,29 @@ struct NdbThread static void* ndb_thread_wrapper(void* _ss){ - void * ret; - struct NdbThread * ss = (struct NdbThread *)_ss; - DBUG_ENTER("ndb_thread_wrapper"); -#ifdef NDB_SHM_TRANSPORTER - if (g_ndb_shm_signum) + my_thread_init(); { - sigset_t mask; - DBUG_PRINT("info",("Block signum %d",g_ndb_shm_signum)); - sigemptyset(&mask); - sigaddset(&mask, g_ndb_shm_signum); - pthread_sigmask(SIG_BLOCK, &mask, 0); - } + DBUG_ENTER("ndb_thread_wrapper"); +#ifdef NDB_SHM_TRANSPORTER + if (g_ndb_shm_signum) + { + sigset_t mask; + DBUG_PRINT("info",("Block signum %d",g_ndb_shm_signum)); + sigemptyset(&mask); + sigaddset(&mask, g_ndb_shm_signum); + pthread_sigmask(SIG_BLOCK, &mask, 0); + } #endif - ret= (* ss->func)(ss->object); - DBUG_RETURN(ret); + { + void *ret; + struct NdbThread * ss = (struct NdbThread *)_ss; + ret= (* ss->func)(ss->object); + my_thread_end(); + NdbThread_Exit(ret); + } + /* will never be reached */ + DBUG_RETURN(0); + } } @@ -130,9 +138,9 @@ int NdbThread_WaitFor(struct NdbThread* p_wait_thread, void** status) } -void NdbThread_Exit(int status) +void NdbThread_Exit(void *status) { - pthread_exit(&status); + pthread_exit(status); } diff --git a/ndb/src/common/transporter/TransporterRegistry.cpp b/ndb/src/common/transporter/TransporterRegistry.cpp index 462cde76740..439730435ec 100644 --- a/ndb/src/common/transporter/TransporterRegistry.cpp +++ b/ndb/src/common/transporter/TransporterRegistry.cpp @@ -1104,11 +1104,8 @@ TransporterRegistry::setIOState(NodeId nodeId, IOState state) { static void * run_start_clients_C(void * me) { - my_thread_init(); ((TransporterRegistry*) me)->start_clients_thread(); - my_thread_end(); - NdbThread_Exit(0); - return me; + return 0; } // Run by kernel thread diff --git a/ndb/src/common/util/SocketServer.cpp b/ndb/src/common/util/SocketServer.cpp index 8bee256684d..da06389b5df 100644 --- a/ndb/src/common/util/SocketServer.cpp +++ b/ndb/src/common/util/SocketServer.cpp @@ -186,11 +186,7 @@ extern "C" void* socketServerThread_C(void* _ss){ SocketServer * ss = (SocketServer *)_ss; - - my_thread_init(); ss->doRun(); - my_thread_end(); - NdbThread_Exit(0); return 0; } @@ -309,11 +305,8 @@ void* sessionThread_C(void* _sc){ SocketServer::Session * si = (SocketServer::Session *)_sc; - my_thread_init(); if(!transfer(si->m_socket)){ si->m_stopped = true; - my_thread_end(); - NdbThread_Exit(0); return 0; } @@ -325,8 +318,6 @@ sessionThread_C(void* _sc){ } si->m_stopped = true; - my_thread_end(); - NdbThread_Exit(0); return 0; } diff --git a/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp b/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp index ad6c0fd5283..f76440a462a 100644 --- a/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp +++ b/ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp @@ -82,7 +82,6 @@ static int numAsyncFiles = 0; extern "C" void * runAsyncFile(void* arg) { - my_thread_init(); ((AsyncFile*)arg)->run(); return (NULL); } @@ -876,8 +875,6 @@ void AsyncFile::endReq() { // Thread is ended with return if (theWriteBuffer) NdbMem_Free(theWriteBuffer); - my_thread_end(); - NdbThread_Exit(0); } diff --git a/ndb/src/kernel/blocks/ndbfs/MemoryChannelTest/MemoryChannelTest.cpp b/ndb/src/kernel/blocks/ndbfs/MemoryChannelTest/MemoryChannelTest.cpp index aeab9f7828d..b98c60693f4 100644 --- a/ndb/src/kernel/blocks/ndbfs/MemoryChannelTest/MemoryChannelTest.cpp +++ b/ndb/src/kernel/blocks/ndbfs/MemoryChannelTest/MemoryChannelTest.cpp @@ -40,7 +40,6 @@ extern "C" void* runProducer(void*arg) NdbSleep_MilliSleep(i); i++; } - NdbThread_Exit(0); return NULL; } @@ -58,7 +57,6 @@ extern "C" void* runConsumer(void* arg) delete p; } - NdbThread_Exit(0); return NULL; } @@ -92,7 +90,6 @@ extern "C" void* runProducer2(void*arg) NdbSleep_MilliSleep(i); i++; } - NdbThread_Exit(0); return NULL; } @@ -111,7 +108,6 @@ extern "C" void* runConsumer2(void* arg) delete p; } ndbout << "Consumer2: " << count << " received" << endl; - NdbThread_Exit(0); return NULL; } diff --git a/ndb/src/kernel/vm/WatchDog.cpp b/ndb/src/kernel/vm/WatchDog.cpp index 4e07dc1df90..23475a478d3 100644 --- a/ndb/src/kernel/vm/WatchDog.cpp +++ b/ndb/src/kernel/vm/WatchDog.cpp @@ -27,10 +27,7 @@ extern "C" void* runWatchDog(void* w){ - my_thread_init(); ((WatchDog*)w)->run(); - my_thread_end(); - NdbThread_Exit(0); return NULL; } diff --git a/ndb/src/mgmclient/CommandInterpreter.cpp b/ndb/src/mgmclient/CommandInterpreter.cpp index cbf7776fe06..025bed2bc09 100644 --- a/ndb/src/mgmclient/CommandInterpreter.cpp +++ b/ndb/src/mgmclient/CommandInterpreter.cpp @@ -457,8 +457,6 @@ event_thread_run(void* m) { NdbMgmHandle handle= *(NdbMgmHandle*)m; - my_thread_init(); - int filter[] = { 15, NDB_MGM_EVENT_CATEGORY_BACKUP, 0 }; int fd = ndb_mgm_listen_event(handle, filter); if (fd > 0) @@ -478,9 +476,7 @@ event_thread_run(void* m) do_event_thread= -1; } - my_thread_end(); - NdbThread_Exit(0); - return 0; + return NULL; } bool diff --git a/ndb/src/mgmsrv/MgmtSrvr.cpp b/ndb/src/mgmsrv/MgmtSrvr.cpp index f698099141a..66c9a6448aa 100644 --- a/ndb/src/mgmsrv/MgmtSrvr.cpp +++ b/ndb/src/mgmsrv/MgmtSrvr.cpp @@ -70,12 +70,7 @@ void * MgmtSrvr::logLevelThread_C(void* m) { MgmtSrvr *mgm = (MgmtSrvr*)m; - my_thread_init(); mgm->logLevelThreadRun(); - - my_thread_end(); - NdbThread_Exit(0); - /* NOTREACHED */ return 0; } @@ -83,12 +78,7 @@ void * MgmtSrvr::signalRecvThread_C(void *m) { MgmtSrvr *mgm = (MgmtSrvr*)m; - my_thread_init(); mgm->signalRecvThreadRun(); - - my_thread_end(); - NdbThread_Exit(0); - /* NOTREACHED */ return 0; } diff --git a/ndb/src/ndbapi/ClusterMgr.cpp b/ndb/src/ndbapi/ClusterMgr.cpp index e10b2e1d82c..1fe0cedbd6c 100644 --- a/ndb/src/ndbapi/ClusterMgr.cpp +++ b/ndb/src/ndbapi/ClusterMgr.cpp @@ -54,7 +54,6 @@ runClusterMgr_C(void * me) #ifdef NDB_OSE NdbSleep_MilliSleep(50); #endif - NdbThread_Exit(0); return NULL; } @@ -560,10 +559,7 @@ extern "C" void* runArbitMgr_C(void* me) { - my_thread_init(); ((ArbitMgr*) me)->threadMain(); - my_thread_end(); - NdbThread_Exit(0); return NULL; } diff --git a/ndb/src/ndbapi/TransporterFacade.cpp b/ndb/src/ndbapi/TransporterFacade.cpp index 031ee6315e8..5582143be44 100644 --- a/ndb/src/ndbapi/TransporterFacade.cpp +++ b/ndb/src/ndbapi/TransporterFacade.cpp @@ -405,11 +405,8 @@ extern "C" void* runSendRequest_C(void * me) { - my_thread_init(); ((TransporterFacade*) me)->threadMainSend(); - my_thread_end(); - NdbThread_Exit(0); - return me; + return 0; } void TransporterFacade::threadMainSend(void) @@ -443,11 +440,8 @@ extern "C" void* runReceiveResponse_C(void * me) { - my_thread_init(); ((TransporterFacade*) me)->threadMainReceive(); - my_thread_end(); - NdbThread_Exit(0); - return me; + return 0; } void TransporterFacade::threadMainReceive(void) diff --git a/ndb/src/ndbapi/ndb_cluster_connection.cpp b/ndb/src/ndbapi/ndb_cluster_connection.cpp index 5df707e211d..ab32d6abb8e 100644 --- a/ndb/src/ndbapi/ndb_cluster_connection.cpp +++ b/ndb/src/ndbapi/ndb_cluster_connection.cpp @@ -87,11 +87,8 @@ const char *Ndb_cluster_connection::get_connectstring(char *buf, extern "C" pthread_handler_decl(run_ndb_cluster_connection_connect_thread, me) { - my_thread_init(); g_run_connect_thread= 1; ((Ndb_cluster_connection_impl*) me)->connect_thread(); - my_thread_end(); - NdbThread_Exit(0); return me; } diff --git a/ndb/test/ndbapi/benchronja.cpp b/ndb/test/ndbapi/benchronja.cpp index 91b2a041186..a7523e8e416 100644 --- a/ndb/test/ndbapi/benchronja.cpp +++ b/ndb/test/ndbapi/benchronja.cpp @@ -984,7 +984,6 @@ void* ThreadExec(void* ThreadData){ delete pMyNdb; pMyNdb = NULL ; ThreadReady[thread_no] = 1; - NdbThread_Exit(0) ; return 0 ; }//if @@ -1197,7 +1196,6 @@ void* ThreadExec(void* ThreadData){ } // for(;;) delete pMyNdb ; - NdbThread_Exit(0) ; - return 0 ; // Compiler is happy now + return 0 ; } diff --git a/ndb/test/ndbapi/flexAsynch.cpp b/ndb/test/ndbapi/flexAsynch.cpp index 1953444d640..4b87b2c70ed 100644 --- a/ndb/test/ndbapi/flexAsynch.cpp +++ b/ndb/test/ndbapi/flexAsynch.cpp @@ -494,8 +494,7 @@ threadLoop(void* ThreadData) delete localNdb; ThreadReady[threadNo] = 1; - NdbThread_Exit(0); - return NULL; // Just to keep compiler happy + return NULL; }//threadLoop() static diff --git a/ndb/test/ndbapi/flexBench.cpp b/ndb/test/ndbapi/flexBench.cpp index 2a2388109a1..cc2bfb391da 100644 --- a/ndb/test/ndbapi/flexBench.cpp +++ b/ndb/test/ndbapi/flexBench.cpp @@ -617,7 +617,7 @@ static void* flexBenchThread(void* pArg) free(attrRefValue) ; free(pOps) ; delete pNdb ; - NdbThread_Exit(0) ; + return 0; // thread exits } pNdb->init(); @@ -934,8 +934,7 @@ static void* flexBenchThread(void* pArg) free(longKeyAttrValue); } // if - NdbThread_Exit(0); - return NULL; // Just to keep compiler happy + return NULL; // Thread exits } diff --git a/ndb/test/ndbapi/flexHammer.cpp b/ndb/test/ndbapi/flexHammer.cpp index 688e70d501a..13cd2d5e561 100644 --- a/ndb/test/ndbapi/flexHammer.cpp +++ b/ndb/test/ndbapi/flexHammer.cpp @@ -612,10 +612,7 @@ flexHammerThread(void* pArg) flexHammerErrorData->resetErrorCounters(); - // And exit using NDBT - NdbThread_Exit(0); - - return NULL; + return NULL; // thread exits } // flexHammerThread diff --git a/ndb/test/ndbapi/flexScan.cpp b/ndb/test/ndbapi/flexScan.cpp index c7f4041a525..4d2c85d6955 100644 --- a/ndb/test/ndbapi/flexScan.cpp +++ b/ndb/test/ndbapi/flexScan.cpp @@ -701,8 +701,7 @@ flexScanThread(void* ThreadData) free(pkValue); } // if - NdbThread_Exit(0); - return NULL; + return NULL; // thread exits } // flexScanThread diff --git a/ndb/test/ndbapi/flexTT.cpp b/ndb/test/ndbapi/flexTT.cpp index 3b976f9f87e..8d5be2bb399 100644 --- a/ndb/test/ndbapi/flexTT.cpp +++ b/ndb/test/ndbapi/flexTT.cpp @@ -389,8 +389,7 @@ threadLoop(void* ThreadData) delete localNdb; ThreadReady[loc_threadNo] = 1; - NdbThread_Exit(0); - return NULL; // Just to keep compiler happy + return NULL; // Thread exits }//threadLoop() static diff --git a/ndb/test/ndbapi/flexTimedAsynch.cpp b/ndb/test/ndbapi/flexTimedAsynch.cpp index 27380cc79fd..2b8c0bdd5f8 100644 --- a/ndb/test/ndbapi/flexTimedAsynch.cpp +++ b/ndb/test/ndbapi/flexTimedAsynch.cpp @@ -406,9 +406,8 @@ threadLoop(void* ThreadData) delete localNdb; ThreadReady[threadNo] = 1; - NdbThread_Exit(0); - return NULL; + return NULL; // thread exits } void executeThread(StartType aType, Ndb* aNdbObject, ThreadNdb* threadInfo) diff --git a/ndb/test/ndbapi/flex_bench_mysql.cpp b/ndb/test/ndbapi/flex_bench_mysql.cpp index c8d4d85bedf..c15175bfb00 100644 --- a/ndb/test/ndbapi/flex_bench_mysql.cpp +++ b/ndb/test/ndbapi/flex_bench_mysql.cpp @@ -710,7 +710,7 @@ static void* flexBenchThread(void* pArg) the_socket_name, 0) == NULL ) { ndbout << "failed" << endl; - NdbThread_Exit(0) ; + return 0; } ndbout << "ok" << endl; @@ -722,7 +722,7 @@ static void* flexBenchThread(void* pArg) if (r) { ndbout << "autocommit on/off failed" << endl; - NdbThread_Exit(0) ; + return 0; } } #endif @@ -741,7 +741,7 @@ static void* flexBenchThread(void* pArg) ndbout << threadNo << endl ; ndbout << "Thread #" << threadNo << " will now exit" << endl ; tResult = 13 ; - NdbThread_Exit(0) ; + return 0; } if (use_ndb) { @@ -750,7 +750,7 @@ static void* flexBenchThread(void* pArg) ndbout << "Failed to get an NDB object" << endl; ndbout << "Thread #" << threadNo << " will now exit" << endl ; tResult = 13; - NdbThread_Exit(0) ; + return 0; } pNdb->waitUntilReady(); return_ndb_object(pNdb, ndb_id); @@ -900,11 +900,11 @@ static void* flexBenchThread(void* pArg) prep_insert[i] = mysql_prepare(&mysql, buf, pos); if (prep_insert[i] == 0) { ndbout << "mysql_prepare: " << mysql_error(&mysql) << endl; - NdbThread_Exit(0) ; + return 0; } if (mysql_bind_param(prep_insert[i], bind_insert)) { ndbout << "mysql_bind_param: " << mysql_error(&mysql) << endl; - NdbThread_Exit(0) ; + return 0; } } @@ -926,11 +926,11 @@ static void* flexBenchThread(void* pArg) prep_update[i] = mysql_prepare(&mysql, buf, pos); if (prep_update[i] == 0) { ndbout << "mysql_prepare: " << mysql_error(&mysql) << endl; - NdbThread_Exit(0) ; + return 0; } if (mysql_bind_param(prep_update[i], bind_update)) { ndbout << "mysql_bind_param: " << mysql_error(&mysql) << endl; - NdbThread_Exit(0) ; + return 0; } } @@ -953,15 +953,15 @@ static void* flexBenchThread(void* pArg) prep_read[i] = mysql_prepare(&mysql, buf, pos); if (prep_read[i] == 0) { ndbout << "mysql_prepare: " << mysql_error(&mysql) << endl; - NdbThread_Exit(0) ; + return 0; } if (mysql_bind_param(prep_read[i], bind_read)) { ndbout << "mysql_bind_param: " << mysql_error(&mysql) << endl; - NdbThread_Exit(0) ; + return 0; } if (mysql_bind_result(prep_read[i], &bind_read[1])) { ndbout << "mysql_bind_result: " << mysql_error(&mysql) << endl; - NdbThread_Exit(0) ; + return 0; } } @@ -978,11 +978,11 @@ static void* flexBenchThread(void* pArg) prep_delete[i] = mysql_prepare(&mysql, buf, pos); if (prep_delete[i] == 0) { ndbout << "mysql_prepare: " << mysql_error(&mysql) << endl; - NdbThread_Exit(0) ; + return 0; } if (mysql_bind_param(prep_delete[i], bind_delete)) { ndbout << "mysql_bind_param: " << mysql_error(&mysql) << endl; - NdbThread_Exit(0) ; + return 0; } } } @@ -1431,8 +1431,7 @@ static void* flexBenchThread(void* pArg) ndbout << "I got here " << endl; return_ndb_object(pNdb, ndb_id); } - NdbThread_Exit(0); - return NULL; // Just to keep compiler happy + return NULL; } diff --git a/ndb/test/ndbapi/mainAsyncGenerator.cpp b/ndb/test/ndbapi/mainAsyncGenerator.cpp index 16cb50e160f..73a8b98ab57 100644 --- a/ndb/test/ndbapi/mainAsyncGenerator.cpp +++ b/ndb/test/ndbapi/mainAsyncGenerator.cpp @@ -274,8 +274,6 @@ threadRoutine(void *arg) asyncDbDisconnect(pNDB); - NdbThread_Exit(0); - return NULL; } diff --git a/ndb/test/src/NDBT_Test.cpp b/ndb/test/src/NDBT_Test.cpp index bbbde008938..17e46bf33e5 100644 --- a/ndb/test/src/NDBT_Test.cpp +++ b/ndb/test/src/NDBT_Test.cpp @@ -475,7 +475,6 @@ void * runStep_C(void * s) { runStep(s); - NdbThread_Exit(0); return NULL; } diff --git a/ndb/test/tools/transproxy.cpp b/ndb/test/tools/transproxy.cpp index 88267801172..28a621fa584 100644 --- a/ndb/test/tools/transproxy.cpp +++ b/ndb/test/tools/transproxy.cpp @@ -291,7 +291,6 @@ extern "C" void* copyrun_C(void* copy) { ((Copy*) copy)->run(); - NdbThread_Exit(0); return 0; } @@ -322,7 +321,6 @@ extern "C" void* connrun_C(void* conn) { ((Conn*) conn)->run(); - NdbThread_Exit(0); return 0; } From eca1f04aa43a9c02a6af1ed9ba9f666a5b684607 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 1 Feb 2005 11:59:44 -0800 Subject: [PATCH 0892/1063] Make sure mysql_client_test and embedded test clients get added to binary distribution on all platforms. scripts/make_binary_distribution.sh: Add mysql_client_test and embedded versions to basic list of binaries and only list libtool-produced '.libs/' versions as non-netware binaries --- scripts/make_binary_distribution.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 22b51168c23..33d4794e4f7 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -107,8 +107,11 @@ BIN_FILES="extra/comp_err$BS extra/replace$BS extra/perror$BS \ client/mysql$BS client/mysqlshow$BS client/mysqladmin$BS \ client/mysqldump$BS client/mysqlimport$BS \ client/mysqltest$BS client/mysqlcheck$BS \ - client/mysqlbinlog$BS -"; + client/mysqlbinlog$BS \ + tests/mysql_client_test$BS \ + libmysqld/examples/mysql_client_test_embedded$BS \ + libmysqld/examples/mysqltest_embedded$BS \ + "; # Platform-specific bin dir files: if [ $BASE_SYSTEM = "netware" ] ; then @@ -127,8 +130,9 @@ else client/.libs/mysqltest client/.libs/mysqlcheck \ client/.libs/mysqlbinlog client/.libs/mysqlmanagerc \ client/.libs/mysqlmanager-pwgen tools/.libs/mysqlmanager \ - tests/.libs/mysql_client_test libmysqld/examples/mysql_client_test_embedded \ - libmysqld/examples/mysqltest_embedded \ + tests/.libs/mysql_client_test \ + libmysqld/examples/.libs/mysql_client_test_embedded \ + libmysqld/examples/.libs/mysqltest_embedded \ "; fi From 3c04bddb04774237acd11a7ef2c0207a49149a0e Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 2 Feb 2005 00:31:06 +0200 Subject: [PATCH 0893/1063] rem0rec.ic: Fix a debug assertion in rem0rec.ic on AMD64; 4.1 was already fixed innobase/include/rem0rec.ic: Fix a debug assertion in rem0rec.ic on AMD64; 4.1 was already fixed --- innobase/include/rem0rec.ic | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/innobase/include/rem0rec.ic b/innobase/include/rem0rec.ic index 75a8bdfd6bd..b28c17dc121 100644 --- a/innobase/include/rem0rec.ic +++ b/innobase/include/rem0rec.ic @@ -29,41 +29,41 @@ significant bytes and bits are written below less significant. and the shift needed to obtain each bit-field of the record. */ #define REC_NEXT 2 -#define REC_NEXT_MASK 0xFFFF +#define REC_NEXT_MASK 0xFFFFUL #define REC_NEXT_SHIFT 0 #define REC_SHORT 3 /* This is single byte bit-field */ -#define REC_SHORT_MASK 0x1 +#define REC_SHORT_MASK 0x1UL #define REC_SHORT_SHIFT 0 #define REC_N_FIELDS 4 -#define REC_N_FIELDS_MASK 0x7FE +#define REC_N_FIELDS_MASK 0x7FEUL #define REC_N_FIELDS_SHIFT 1 #define REC_HEAP_NO 5 -#define REC_HEAP_NO_MASK 0xFFF8 +#define REC_HEAP_NO_MASK 0xFFF8UL #define REC_HEAP_NO_SHIFT 3 #define REC_N_OWNED 6 /* This is single byte bit-field */ -#define REC_N_OWNED_MASK 0xF +#define REC_N_OWNED_MASK 0xFUL #define REC_N_OWNED_SHIFT 0 -#define REC_INFO_BITS_MASK 0xF0 +#define REC_INFO_BITS_MASK 0xF0UL #define REC_INFO_BITS_SHIFT 0 /* The deleted flag in info bits */ -#define REC_INFO_DELETED_FLAG 0x20 /* when bit is set to 1, it means the +#define REC_INFO_DELETED_FLAG 0x20UL /* when bit is set to 1, it means the record has been delete marked */ /* The following masks are used to filter the SQL null bit from one-byte and two-byte offsets */ -#define REC_1BYTE_SQL_NULL_MASK 0x80 -#define REC_2BYTE_SQL_NULL_MASK 0x8000 +#define REC_1BYTE_SQL_NULL_MASK 0x80UL +#define REC_2BYTE_SQL_NULL_MASK 0x8000UL /* In a 2-byte offset the second most significant bit denotes a field stored to another page: */ -#define REC_2BYTE_EXTERN_MASK 0x4000 +#define REC_2BYTE_EXTERN_MASK 0x4000UL /**************************************************************** Return field length or UNIV_SQL_NULL. */ @@ -133,7 +133,7 @@ rec_set_bit_field_1( ut_ad(rec); ut_ad(offs <= REC_N_EXTRA_BYTES); ut_ad(mask); - ut_ad(mask <= 0xFF); + ut_ad(mask <= 0xFFUL); ut_ad(((mask >> shift) << shift) == mask); ut_ad(((val << shift) & mask) == (val << shift)); @@ -172,8 +172,8 @@ rec_set_bit_field_2( { ut_ad(rec); ut_ad(offs <= REC_N_EXTRA_BYTES); - ut_ad(mask > 0xFF); - ut_ad(mask <= 0xFFFF); + ut_ad(mask > 0xFFUL); + ut_ad(mask <= 0xFFFFUL); ut_ad((mask >> shift) & 1); ut_ad(0 == ((mask >> shift) & ((mask >> shift) + 1))); ut_ad(((mask >> shift) << shift) == mask); @@ -189,7 +189,7 @@ rec_set_bit_field_2( + (REC_HEAP_NO_MASK << (8 * (REC_HEAP_NO - 4))) + (REC_N_OWNED_MASK << (8 * (REC_N_OWNED - 3))) + (REC_INFO_BITS_MASK << (8 * (REC_INFO_BITS - 3)))); - if (m != ut_dbg_zero + 0xFFFFFFFF) { + if (m != ut_dbg_zero + 0xFFFFFFFFUL) { fprintf(stderr, "Sum of masks %lx\n", m); ut_error; } From 6162c4a6eb22b413a477bb6b9b0f08ec9b98a193 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 1 Feb 2005 15:08:31 -0800 Subject: [PATCH 0894/1063] Fix value of YEAR field when set from a non-numeric string. (Bug #6067) mysql-test/t/type_date.test: Add new regression test mysql-test/r/type_date.result: Add result sql/field.cc: Set YEAR to 0 when set to a non-numeric string, not 2000, and issue a warning. --- mysql-test/r/type_date.result | 8 ++++++++ mysql-test/t/type_date.test | 7 +++++++ sql/field.cc | 12 ++++++++++-- 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/type_date.result b/mysql-test/r/type_date.result index 71d1b9ad381..3428b5969d9 100644 --- a/mysql-test/r/type_date.result +++ b/mysql-test/r/type_date.result @@ -96,3 +96,11 @@ f2 19781126 19781126 DROP TABLE t1, t2, t3; +CREATE TABLE t1 (y YEAR); +INSERT INTO t1 VALUES ('abc'); +Warnings: +Warning 1265 Data truncated for column 'y' at row 1 +SELECT * FROM t1; +y +0000 +DROP TABLE t1; diff --git a/mysql-test/t/type_date.test b/mysql-test/t/type_date.test index 64420a85189..304ed19b971 100644 --- a/mysql-test/t/type_date.test +++ b/mysql-test/t/type_date.test @@ -107,3 +107,10 @@ SELECT * FROM t2; SELECT * FROM t3; DROP TABLE t1, t2, t3; + +# Test that setting YEAR to invalid string results in default value, not +# 2000. (Bug #6067) +CREATE TABLE t1 (y YEAR); +INSERT INTO t1 VALUES ('abc'); +SELECT * FROM t1; +DROP TABLE t1; diff --git a/sql/field.cc b/sql/field.cc index 7357bc06f11..a2b749257df 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -3511,9 +3511,17 @@ void Field_time::sql_type(String &res) const int Field_year::store(const char *from, uint len,CHARSET_INFO *cs) { - int not_used; // We can ignore result from str2int + int err; char *end; - long nr= my_strntol(cs, from, len, 10, &end, ¬_used); + long nr= my_strntol(cs, from, len, 10, &end, &err); + + if (err) + { + if (table->in_use->count_cuted_fields) + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED, 1); + *ptr= 0; + return 0; + } if (nr < 0 || nr >= 100 && nr <= 1900 || nr > 2155) { From d5311abe2cd50c5ea017044941cb1e9eae231442 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 2 Feb 2005 01:43:25 +0200 Subject: [PATCH 0895/1063] eval0eval.ic: Remove wrong assertion that fails on 64 bits innobase/include/eval0eval.ic: Remove wrong assertion that fails on 64 bits --- innobase/include/eval0eval.ic | 2 -- 1 file changed, 2 deletions(-) diff --git a/innobase/include/eval0eval.ic b/innobase/include/eval0eval.ic index 2530c869206..069cbfe5f37 100644 --- a/innobase/include/eval0eval.ic +++ b/innobase/include/eval0eval.ic @@ -205,8 +205,6 @@ eval_node_copy_and_alloc_val( { byte* data; - ut_ad(UNIV_SQL_NULL > ULINT_MAX); - if (len == UNIV_SQL_NULL) { dfield_set_len(que_node_get_val(node), len); From 6d0d03dab9a74fb512f03ea0275d84d34657ce2a Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 1 Feb 2005 18:29:10 -0800 Subject: [PATCH 0896/1063] Fix QUOTE() to not reuse the input field for output, which resulted in incorrect results when the input was a constant across a multi-row SELECT statement. (Bug #8248) sql/item_strfunc.h: Add tmp_value member sql/item_strfunc.cc: Always allocate a new string for QUOTE(), in case the field is being reused for multiple rows. mysql-test/t/func_str.test: Add regression test mysql-test/r/func_str.result: Add test results --- mysql-test/r/func_str.result | 7 +++++++ mysql-test/t/func_str.test | 5 +++++ sql/item_strfunc.cc | 15 +++++---------- sql/item_strfunc.h | 1 + 4 files changed, 18 insertions(+), 10 deletions(-) diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result index 278cd4dd935..9392f152bb4 100644 --- a/mysql-test/r/func_str.result +++ b/mysql-test/r/func_str.result @@ -297,3 +297,10 @@ quote(ltrim(concat(' ', 'a'))) select quote(trim(concat(' ', 'a'))); quote(trim(concat(' ', 'a'))) 'a' +CREATE TABLE t1 SELECT 1 UNION SELECT 2 UNION SELECT 3; +SELECT QUOTE('A') FROM t1; +QUOTE('A') +'A' +'A' +'A' +DROP TABLE t1; diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test index 79a996e7e78..6c2abd27551 100644 --- a/mysql-test/t/func_str.test +++ b/mysql-test/t/func_str.test @@ -193,3 +193,8 @@ select trim(leading 'foo' from 'foo'); select quote(ltrim(concat(' ', 'a'))); select quote(trim(concat(' ', 'a'))); + +# Bad results from QUOTE(). Bug #8248 +CREATE TABLE t1 SELECT 1 UNION SELECT 2 UNION SELECT 3; +SELECT QUOTE('A') FROM t1; +DROP TABLE t1; diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index a852906ee2c..aeb63d6af00 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -2183,18 +2183,13 @@ String *Item_func_quote::val_str(String *str) for (from= (char*) arg->ptr(), end= from + arg_length; from < end; from++) new_length+= get_esc_bit(escmask, (uchar) *from); - /* - We have to use realloc() instead of alloc() as we want to keep the - old result in arg - */ - if (arg->realloc(new_length)) + if (tmp_value.alloc(new_length)) goto null; /* - As 'arg' and 'str' may be the same string, we must replace characters - from the end to the beginning + We replace characters from the end to the beginning */ - to= (char*) arg->ptr() + new_length - 1; + to= (char*) tmp_value.ptr() + new_length - 1; *to--= '\''; for (start= (char*) arg->ptr(),end= start + arg_length; end-- != start; to--) { @@ -2222,9 +2217,9 @@ String *Item_func_quote::val_str(String *str) } } *to= '\''; - arg->length(new_length); + tmp_value.length(new_length); null_value= 0; - return arg; + return &tmp_value; null: null_value= 1; diff --git a/sql/item_strfunc.h b/sql/item_strfunc.h index fc98ebfe67d..ece15484fd9 100644 --- a/sql/item_strfunc.h +++ b/sql/item_strfunc.h @@ -535,6 +535,7 @@ public: class Item_func_quote :public Item_str_func { + String tmp_value; public: Item_func_quote(Item *a) :Item_str_func(a) {} const char *func_name() const { return "quote"; } From 1a2ef2be00e8cbe8ec7f043cb8ce50717bf024cf Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 2 Feb 2005 03:58:43 +0100 Subject: [PATCH 0897/1063] ndb - backup fix, found on powermacg4 ndb/src/kernel/blocks/backup/Backup.cpp: index typo overwrote attribute array, found on powermacg4 --- ndb/src/kernel/blocks/backup/Backup.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ndb/src/kernel/blocks/backup/Backup.cpp b/ndb/src/kernel/blocks/backup/Backup.cpp index d72efdd0a52..2e62979ce8e 100644 --- a/ndb/src/kernel/blocks/backup/Backup.cpp +++ b/ndb/src/kernel/blocks/backup/Backup.cpp @@ -3201,7 +3201,7 @@ Backup::execSTART_BACKUP_REQ(Signal* signal) return; }//if - tabPtr.p->triggerAllocated[i] = true; + tabPtr.p->triggerAllocated[j] = true; trigPtr.p->backupPtr = ptr.i; trigPtr.p->tableId = tabPtr.p->tableId; trigPtr.p->tab_ptr_i = tabPtr.i; From 01e1ca9f67ce9fbc23ba37b804a3c81d4ae0b4f5 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 2 Feb 2005 07:38:11 +0100 Subject: [PATCH 0898/1063] ndb - (backport from 4.1) Fix weird link error on sol9x86 - use incremental linker configure.in: Fix weird link error on sol9x86 - use incremental linker --- configure.in | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/configure.in b/configure.in index 98d060e660c..caa42004736 100644 --- a/configure.in +++ b/configure.in @@ -2954,6 +2954,15 @@ EOF AC_CONFIG_SUBDIRS(innobase) fi +case $SYSTEM_TYPE-$MACHINE_TYPE-$ac_cv_prog_gcc-$have_ndbcluster in + *solaris*-i?86-no-yes) + # ndb fail for whatever strange reason to link Sun Forte/x86 + # unless using incremental linker + CXXFLAGS="$CXXFLAGS -xildon" + ;; + *) ;; +esac + if test X"$have_ndbcluster" = Xyes then if test X"$mysql_cv_compress" != Xyes From d81a0bede23ca74222252b6f43bd85ead5d7be2a Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 2 Feb 2005 08:38:24 +0200 Subject: [PATCH 0899/1063] Fix for BUG#8023. Allow LIMIT clause after DUAL. mysql-test/r/limit.result: Added test result for BUG#8023. mysql-test/t/limit.test: Added test for BUG#8023. sql/sql_yacc.yy: Allow the specification of a LIMIT clause after DUAL. This is needed for queries as: select a from t1 union all select 1 from dual limit 1; In this query LIMIT is applied to the whole UNION, so it makes sense, however, the current parser did not allow any clause after DUAL. --- mysql-test/r/limit.result | 9 +++++++++ mysql-test/t/limit.test | 10 ++++++++++ sql/sql_yacc.yy | 9 +++++---- 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/mysql-test/r/limit.result b/mysql-test/r/limit.result index c82105e6a49..6a3d2bffab0 100644 --- a/mysql-test/r/limit.result +++ b/mysql-test/r/limit.result @@ -67,3 +67,12 @@ SELECT * FROM t1; id id2 3 0 DROP TABLE t1; +create table t1 (a integer); +insert into t1 values (1); +select 1 as a from t1 union all select 1 from dual limit 1; +a +1 +(select 1 as a from t1) union all (select 1 from dual) limit 1; +a +1 +drop table t1; diff --git a/mysql-test/t/limit.test b/mysql-test/t/limit.test index 61c57c9b468..28b287a5d4a 100644 --- a/mysql-test/t/limit.test +++ b/mysql-test/t/limit.test @@ -49,3 +49,13 @@ SELECT * FROM t1; DELETE FROM t1 WHERE id2 = 0 ORDER BY id desc LIMIT 1; SELECT * FROM t1; DROP TABLE t1; + +# +# Bug#8023 - limit on UNION with from DUAL, causes syntax error +# +create table t1 (a integer); +insert into t1 values (1); +# both queries must return one row +select 1 as a from t1 union all select 1 from dual limit 1; +(select 1 as a from t1) union all (select 1 from dual) limit 1; +drop table t1; diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 1e51d8fb82d..e70efe14557 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -2455,10 +2455,11 @@ select_into: select_from: FROM join_table_list where_clause group_clause having_clause opt_order_clause opt_limit_clause procedure_clause - | FROM DUAL_SYM /* oracle compatibility: oracle always requires FROM - clause, and DUAL is system table without fields. - Is "SELECT 1 FROM DUAL" any better than - "SELECT 1" ? Hmmm :) */ + | FROM DUAL_SYM opt_limit_clause + /* oracle compatibility: oracle always requires FROM clause, + and DUAL is system table without fields. + Is "SELECT 1 FROM DUAL" any better than "SELECT 1" ? + Hmmm :) */ ; select_options: From 4c76152b356893c74bca0b57de7b48dca8ecd0f1 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 1 Feb 2005 23:34:31 -0800 Subject: [PATCH 0900/1063] func_str.result, func_str.test: Added a test case for bug #7751. item_strfunc.cc: Fixed bug #7751. The function Item_func_conv::val_str did not update the unsigned_flag value. sql/item_strfunc.cc: Fixed bug #7751. The function Item_func_conv::val_str did not update the unsigned_flag value. mysql-test/t/func_str.test: Added a test case for bug #7751. mysql-test/r/func_str.result: Added a test case for bug #7751. --- mysql-test/r/func_str.result | 23 +++++++++++++++++++++++ mysql-test/t/func_str.test | 27 +++++++++++++++++++++++++++ sql/item_strfunc.cc | 1 + 3 files changed, 51 insertions(+) diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result index 0db62b133e7..58d66c7f712 100644 --- a/mysql-test/r/func_str.result +++ b/mysql-test/r/func_str.result @@ -703,3 +703,26 @@ NULL select trim('xyz' from null) as "must_be_null"; must_be_null NULL +CREATE TABLE t1 ( +id int(11) NOT NULL auto_increment, +a bigint(20) unsigned default NULL, +PRIMARY KEY (id) +) ENGINE=MyISAM; +INSERT INTO t1 VALUES +('0','16307858876001849059'); +SELECT CONV('e251273eb74a8ee3', 16, 10); +CONV('e251273eb74a8ee3', 16, 10) +16307858876001849059 +EXPLAIN +SELECT id +FROM t1 +WHERE a = 16307858876001849059; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 system NULL NULL NULL NULL 1 +EXPLAIN +SELECT id +FROM t1 +WHERE a = CONV('e251273eb74a8ee3', 16, 10); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 system NULL NULL NULL NULL 1 +DROP TABLE t1; diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test index a5d95332caa..34bbb2bab0f 100644 --- a/mysql-test/t/func_str.test +++ b/mysql-test/t/func_str.test @@ -443,3 +443,30 @@ select quote(trim(concat(' ', 'a'))); # select trim(null from 'kate') as "must_be_null"; select trim('xyz' from null) as "must_be_null"; + +# +# Bug #7751 - conversion for a bigint unsigned constant +# + +CREATE TABLE t1 ( + id int(11) NOT NULL auto_increment, + a bigint(20) unsigned default NULL, + PRIMARY KEY (id) +) ENGINE=MyISAM; + +INSERT INTO t1 VALUES +('0','16307858876001849059'); + +SELECT CONV('e251273eb74a8ee3', 16, 10); + +EXPLAIN +SELECT id + FROM t1 + WHERE a = 16307858876001849059; + +EXPLAIN + SELECT id + FROM t1 + WHERE a = CONV('e251273eb74a8ee3', 16, 10); + +DROP TABLE t1; diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index cd98fb62818..cee3316886a 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -2171,6 +2171,7 @@ String *Item_func_conv::val_str(String *str) return 0; } null_value=0; + unsigned_flag= !(from_base < 0); if (from_base < 0) dec= my_strntoll(res->charset(),res->ptr(),res->length(),-from_base,&endptr,&err); else From e7ff7469897e1022c55c68117e3a49625be9d1ab Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 2 Feb 2005 10:50:33 +0100 Subject: [PATCH 0901/1063] backported configure flag from 5.0 workaround for HPUX signal.h error, missing extern "C" moved my_thread_end to NdbThreadExit more checks for shared memory transporter signum setup acinclude.m4: backported configure flag from 5.0 include/my_global.h: workaround for HPUX signal.h error, missing extern "C" ndb/src/common/portlib/NdbThread.c: moved my_thread_end to NdbThreadExit ndb/src/mgmsrv/ConfigInfo.cpp: more checks for shared memory transporter signum setup --- acinclude.m4 | 7 ++++++- include/my_global.h | 6 ++++++ ndb/src/common/portlib/NdbThread.c | 2 +- ndb/src/mgmsrv/ConfigInfo.cpp | 14 ++++++++++++++ 4 files changed, 27 insertions(+), 2 deletions(-) diff --git a/acinclude.m4 b/acinclude.m4 index 4f2ad8daf91..d7e22332655 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -1624,7 +1624,12 @@ AC_DEFUN([MYSQL_CHECK_NDB_OPTIONS], [ --without-ndb-debug Disable special ndb debug features], [ndb_debug="$withval"], [ndb_debug="default"]) - + AC_ARG_WITH([ndb-ccflags], + [ + --with-ndb-ccflags Extra CC options for ndb compile], + [ndb_cxxflags_fix="$ndb_cxxflags_fix $withval"], + [ndb_cxxflags_fix=$ndb_cxxflags_fix]) + AC_MSG_CHECKING([for NDB Cluster options]) AC_MSG_RESULT([]) diff --git a/include/my_global.h b/include/my_global.h index 3263d079853..7ca3d5e1e58 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -135,7 +135,13 @@ #ifdef HAVE_UNIXWARE7_THREADS #include #else +#if defined(HPUX10) || defined(HPUX11) +C_MODE_START /* HPUX needs this, signal.h bug */ +#include +C_MODE_END +#else #include /* AIX must have this included first */ +#endif #endif /* HAVE_UNIXWARE7_THREADS */ #endif /* HAVE_mit_thread */ #if !defined(SCO) && !defined(_REENTRANT) diff --git a/ndb/src/common/portlib/NdbThread.c b/ndb/src/common/portlib/NdbThread.c index c1137efdb41..aaee9b45069 100644 --- a/ndb/src/common/portlib/NdbThread.c +++ b/ndb/src/common/portlib/NdbThread.c @@ -56,7 +56,6 @@ ndb_thread_wrapper(void* _ss){ void *ret; struct NdbThread * ss = (struct NdbThread *)_ss; ret= (* ss->func)(ss->object); - my_thread_end(); NdbThread_Exit(ret); } /* will never be reached */ @@ -140,6 +139,7 @@ int NdbThread_WaitFor(struct NdbThread* p_wait_thread, void** status) void NdbThread_Exit(void *status) { + my_thread_end(); pthread_exit(status); } diff --git a/ndb/src/mgmsrv/ConfigInfo.cpp b/ndb/src/mgmsrv/ConfigInfo.cpp index 9be4af1b9b5..07310e3a8b8 100644 --- a/ndb/src/mgmsrv/ConfigInfo.cpp +++ b/ndb/src/mgmsrv/ConfigInfo.cpp @@ -3192,13 +3192,27 @@ fixShmKey(InitConfigFileParser::Context & ctx, const char *) { DBUG_ENTER("fixShmKey"); { + static int last_signum= -1; Uint32 signum; if(!ctx.m_currentSection->get("Signum", &signum)) { signum= OPT_NDB_SHM_SIGNUM_DEFAULT; + if (signum <= 0) + { + ctx.reportError("Unable to set default parameter for [SHM]Signum" + " please specify [SHM DEFAULT]Signum"); + return false; + } ctx.m_currentSection->put("Signum", signum); DBUG_PRINT("info",("Added Signum=%u", signum)); } + if ( last_signum != (int)signum && last_signum >= 0 ) + { + ctx.reportError("All shared memory transporters must have same [SHM]Signum defined." + " Use [SHM DEFAULT]Signum"); + return false; + } + last_signum= (int)signum; } { Uint32 id1= 0, id2= 0, key= 0; From c83412f7059f54b8e7065d63fc544125ebf30aaa Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 2 Feb 2005 12:08:20 +0100 Subject: [PATCH 0902/1063] configure.in don't define UNIV_DEBUG in CFLAGS/CXXFLAGS anymore sql/mysqld.cc hide from the user options that do nothing sql/sql_update.cc better fix for uninitialized used_index configure.in: don't define UNIV_DEBUG in CFLAGS/CXXFLAGS anymore sql/mysqld.cc: hide from the user options that do nothing sql/sql_update.cc: better fix for uninitialized used_index --- configure.in | 4 ++-- sql/mysqld.cc | 2 ++ sql/sql_update.cc | 13 +++++++------ 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/configure.in b/configure.in index 98d060e660c..e57cdabad25 100644 --- a/configure.in +++ b/configure.in @@ -1677,8 +1677,8 @@ then elif test "$with_debug" = "full" then # Full debug. Very slow in some cases - CFLAGS="$DEBUG_CFLAGS -DDBUG_ON -DSAFE_MUTEX -DSAFEMALLOC -DUNIV_DEBUG $CFLAGS" - CXXFLAGS="$DEBUG_CXXFLAGS -DDBUG_ON -DSAFE_MUTEX -DSAFEMALLOC -DUNIV_DEBUG $CXXFLAGS" + CFLAGS="$DEBUG_CFLAGS -DDBUG_ON -DSAFE_MUTEX -DSAFEMALLOC $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS -DDBUG_ON -DSAFE_MUTEX -DSAFEMALLOC $CXXFLAGS" else # Optimized version. No debug CFLAGS="$OPTIMIZE_CFLAGS -DDBUG_OFF $CFLAGS" diff --git a/sql/mysqld.cc b/sql/mysqld.cc index c364b408f28..503fb5bfb99 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -5215,6 +5215,7 @@ The minimum value for this variable is 4096.", (gptr*) &sync_binlog_period, (gptr*) &sync_binlog_period, 0, GET_ULONG, REQUIRED_ARG, 0, 0, ~0L, 0, 1, 0}, +#ifdef DOES_NOTHING_YET {"sync-replication", OPT_SYNC_REPLICATION, "Enable synchronous replication", (gptr*) &global_system_variables.sync_replication, @@ -5230,6 +5231,7 @@ The minimum value for this variable is 4096.", (gptr*) &global_system_variables.sync_replication_timeout, (gptr*) &global_system_variables.sync_replication_timeout, 0, GET_ULONG, REQUIRED_ARG, 10, 0, ~0L, 0, 1, 0}, +#endif {"sync-frm", OPT_SYNC_FRM, "Sync .frm to disk on create. Enabled by default", (gptr*) &opt_sync_frm, (gptr*) &opt_sync_frm, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, diff --git a/sql/sql_update.cc b/sql/sql_update.cc index 6ca794283f1..0ec71bdfba3 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -57,11 +57,11 @@ int mysql_update(THD *thd, enum enum_duplicates handle_duplicates, bool ignore) { - bool using_limit=limit != HA_POS_ERROR; + bool using_limit=limit != HA_POS_ERROR; bool safe_update= thd->options & OPTION_SAFE_UPDATES; bool used_key_is_modified, transactional_table, log_delayed; int error=0; - uint used_index= MAX_KEY; + uint used_index; #ifndef NO_EMBEDDED_ACCESS_CHECKS uint want_privilege; #endif @@ -71,7 +71,7 @@ int mysql_update(THD *thd, TABLE *table; SQL_SELECT *select; READ_RECORD info; - TABLE_LIST *update_table_list= ((TABLE_LIST*) + TABLE_LIST *update_table_list= ((TABLE_LIST*) thd->lex->select_lex.table_list.first); DBUG_ENTER("mysql_update"); @@ -159,10 +159,11 @@ int mysql_update(THD *thd, init_ftfuncs(thd, &thd->lex->select_lex, 1); /* Check if we are modifying a key that we are used to search with */ if (select && select->quick) + { + used_index=select->quick->index; used_key_is_modified= (!select->quick->unique_key_range() && - check_if_key_used(table, - (used_index=select->quick->index), - fields)); + check_if_key_used(table, used_index, fields)); + } else if ((used_index=table->file->key_used_on_scan) < MAX_KEY) used_key_is_modified=check_if_key_used(table, used_index, fields); else From 935585a3369c7cf6f47edc71399c0c146178ea48 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 2 Feb 2005 15:52:19 +0400 Subject: [PATCH 0903/1063] After review fixes client/mysql.cc: check for "error" added sql/sql_db.cc: typo fixed --- client/mysql.cc | 3 ++- sql/sql_db.cc | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/client/mysql.cc b/client/mysql.cc index a799027542b..d48e937023b 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -1921,7 +1921,8 @@ com_go(String *buffer,char *line __attribute__((unused))) if (err >= 1) error= put_error(&mysql); - if (!status.batch && (mysql.server_status & SERVER_STATUS_DB_DROPPED)) + if (!error && !status.batch && + (mysql.server_status & SERVER_STATUS_DB_DROPPED)) get_current_db(); return error; /* New command follows */ diff --git a/sql/sql_db.cc b/sql/sql_db.cc index 731ca1d781e..c918480812c 100644 --- a/sql/sql_db.cc +++ b/sql/sql_db.cc @@ -670,7 +670,7 @@ int mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent) } thd->server_status|= SERVER_STATUS_DB_DROPPED; send_ok(thd, (ulong) deleted); - thd->server_status&= !SERVER_STATUS_DB_DROPPED; + thd->server_status&= ~SERVER_STATUS_DB_DROPPED; } exit: From d2784c988f3511f08fd2d51ee8bc6a7f2dda1e3b Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 2 Feb 2005 13:40:17 +0100 Subject: [PATCH 0904/1063] Small Do-compile improvements: - added Option "--comment" to be able to override the default compilation comment - improved the abort subroutine to not rely on an external "tail" command (the default /usr/bin/tail on Solaris does not understand the "-n" notation). Get rid of a "useless use of cat" case in the process. Build-tools/Do-compile: - added Option "--comment" to be able to override the default compilation comment - improved the abort subroutine to not rely on an external "tail" command (the default /usr/bin/tail on Solaris does not understand the "-n" notation). Get rid of a "useless use of cat" case in the process. --- Build-tools/Do-compile | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/Build-tools/Do-compile b/Build-tools/Do-compile index 4034533f2eb..1c3ff01796f 100755 --- a/Build-tools/Do-compile +++ b/Build-tools/Do-compile @@ -7,7 +7,7 @@ use Sys::Hostname; @config_options= (); @make_options= (); -$opt_distribution=$opt_user=$opt_config_env=$opt_config_extra_env=""; +$opt_comment=$opt_distribution=$opt_user=$opt_config_env=$opt_config_extra_env=""; $opt_dbd_options=$opt_perl_options=$opt_config_options=$opt_make_options=$opt_suffix=""; $opt_tmp=$opt_version_suffix=""; $opt_bundled_zlib=$opt_help=$opt_delete=$opt_debug=$opt_stage=$opt_no_test=$opt_no_perl=$opt_one_error=$opt_with_low_memory=$opt_fast_benchmark=$opt_static_client=$opt_static_server=$opt_static_perl=$opt_sur=$opt_with_small_disk=$opt_local_perl=$opt_tcpip=$opt_build_thread=$opt_use_old_distribution=$opt_enable_shared=$opt_no_crash_me=$opt_no_strip=$opt_with_archive=$opt_with_cluster=$opt_with_csv=$opt_with_example=$opt_with_debug=$opt_no_benchmark=$opt_no_mysqltest=$opt_without_embedded=$opt_readline=0; @@ -17,6 +17,7 @@ GetOptions( "bdb", "build-thread=i", "bundled-zlib", + "comment=s", "config-env=s" => \@config_env, "config-extra-env=s" => \@config_extra_env, "config-options=s" => \@config_options, @@ -110,6 +111,7 @@ $log="$pwd/Logs/$host-$major.$minor$opt_version_suffix.log"; $opt_distribution =~ /(mysql[^\/]*)\.tar/; $ver=$1; $gcc_version=which("gcc"); +$opt_comment= "Official MySQL$opt_version_suffix binary" unless $opt_comment; if (defined($gcc_version) && ! $opt_config_env) { $tmp=`$gcc_version -v 2>&1`; @@ -303,7 +305,7 @@ if ($opt_stage <= 1) } $prefix="/usr/local/mysql"; - check_system("$opt_config_env ./configure --prefix=$prefix --localstatedir=$prefix/data --libexecdir=$prefix/bin --with-comment=\"Official MySQL$opt_version_suffix binary\" --with-extra-charsets=complex --with-server-suffix=\"$opt_version_suffix\" --enable-thread-safe-client --enable-local-infile $opt_config_options","Thank you for choosing MySQL"); + check_system("$opt_config_env ./configure --prefix=$prefix --localstatedir=$prefix/data --libexecdir=$prefix/bin --with-comment=\"$opt_comment\" --with-extra-charsets=complex --with-server-suffix=\"$opt_version_suffix\" --enable-thread-safe-client --enable-local-infile $opt_config_options","Thank you for choosing MySQL"); if (-d "$pwd/$host/include-mysql") { safe_system("cp -r $pwd/$host/include-mysql/* $pwd/$host/$ver/include"); @@ -530,6 +532,10 @@ When running several Do-compile runs in parallel, each build should have its own thread ID, so running the test suites does not cause conflicts with duplicate TCP port numbers. +--comment= +Replace the default compilation comment that is embedded into +the mysqld binary. + --config-env= To set up the environment, like 'CC=cc CXX=gcc CXXFLAGS=-O3' @@ -684,16 +690,20 @@ sub abort if ($opt_user) { - $mail_header_file="$opt_tmp/do-command.$$"; - open(TMP,">$mail_header_file"); + # Take the last 40 lines of the build log + open(LOG, "$log") or die $!; + my @log= ; + close LOG; + splice @log => 0, -40; + my $mail_file="$opt_tmp/do-command.$$"; + open(TMP,">$mail_file") or die $!; print TMP "From: mysqldev\@$full_host_name\n"; print TMP "To: $email\n"; print TMP "Subject: $host($uname): $ver$opt_version_suffix compilation failed\n\n"; + print TMP @log; close TMP; - system("tail -n 40 $log > $log.mail"); - system("cat $mail_header_file $log.mail | $sendmail -t -f $email"); - unlink($mail_header_file); - unlink("$log.mail"); + system("$sendmail -t -f $email < $mail_file"); + unlink($mail_file); } exit 1; } From 5de673901f291668fa577a55faeb57d06016eb8b Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 2 Feb 2005 19:53:49 +0500 Subject: [PATCH 0905/1063] WL#964 renamed client_test to mysql_client_test fixed name for lstat in removef() added mysql-debug.exe for Windows added enviroment variable MYSQL_CLIENT_TEST added cleaning directory before tests New BitKeeper file ``VC++Files/tests/mysql_client_test.dsp'' Delete: VC++Files/tests/client_test.dsp BitKeeper/deleted/.del-client_test.dsp~659d0237a4c12ea1: Delete: VC++Files/tests/client_test.dsp VC++Files/mysql.dsw: renamed client_test to mysql_client_test mysql-test/my_manage.c: fixed name for lstat in removef() mysql-test/mysql_test_run_new.c: added mysql-debug.exe for Windows added enviroment variable MYSQL_CLIENT_TEST added cleaning directory before tests --- VC++Files/mysql.dsw | 21 +++++++++--- ...{client_test.dsp => mysql_client_test.dsp} | 34 +++++++++---------- mysql-test/my_manage.c | 12 +++++-- mysql-test/mysql_test_run_new.c | 34 ++++++++++++++----- 4 files changed, 69 insertions(+), 32 deletions(-) rename VC++Files/tests/{client_test.dsp => mysql_client_test.dsp} (68%) diff --git a/VC++Files/mysql.dsw b/VC++Files/mysql.dsw index d6bf5819909..d36cbc7a031 100644 --- a/VC++Files/mysql.dsw +++ b/VC++Files/mysql.dsw @@ -819,8 +819,9 @@ Package=<4> Project: "mysqltest"=.\client\mysqltest.dsp - Package Owner=<4> Package=<5> -{{{ }}} - +{{{ + }}} + Package=<4> {{{ Begin Project Dependency @@ -834,7 +835,19 @@ Package=<4> End Project Dependency }}} -############################################################################### Project: "client_test"=.\tests\client_test.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### +############################################################################### + +Project: "mysql_client_test"=.\tests\mysql_client_test.dsp - Package Owner=<4> + + Package=<5> +{{{ + }}} + + Package=<4> + {{{ + }}} + + ############################################################################### Project: "mysql_test_run_new"=".\mysql-test\mysql_test_run_new.dsp" - Package Owner=<4> @@ -851,7 +864,7 @@ Package=<4> Project_Dep_Name mysqladmin End Project Dependency Begin Project Dependency - Project_Dep_Name client_test + Project_Dep_Name mysql_client_test End Project Dependency }}} diff --git a/VC++Files/tests/client_test.dsp b/VC++Files/tests/mysql_client_test.dsp similarity index 68% rename from VC++Files/tests/client_test.dsp rename to VC++Files/tests/mysql_client_test.dsp index a095906b26e..07014487bd1 100644 --- a/VC++Files/tests/client_test.dsp +++ b/VC++Files/tests/mysql_client_test.dsp @@ -1,24 +1,24 @@ -# Microsoft Developer Studio Project File - Name="client_test" - Package Owner=<4> +# Microsoft Developer Studio Project File - Name="mysql_client_test" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 -CFG=client_test - Win32 Debug +CFG=mysql_client_test - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE -!MESSAGE NMAKE /f "client_test.mak". +!MESSAGE NMAKE /f "mysql_client_test.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE -!MESSAGE NMAKE /f "client_test.mak" CFG="client_test - Win32 Debug" +!MESSAGE NMAKE /f "mysql_client_test.mak" CFG="mysql_client_test - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE -!MESSAGE "client_test - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE "client_test - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "mysql_client_test - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "mysql_client_test - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE # Begin Project @@ -29,7 +29,7 @@ CPP=cl.exe MTL=midl.exe RSC=rc.exe -!IF "$(CFG)" == "client_test - Win32 Debug" +!IF "$(CFG)" == "mysql_client_test - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 @@ -41,20 +41,20 @@ RSC=rc.exe # PROP Output_Dir ".\Debug" # PROP Intermediate_Dir ".\Debug" # PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /I "../include" /I "../" /Z7 /W3 /Od /G6 /D "_DEBUG" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /D "__WIN__" /D "_WIN32" /Fp".\Debug/client_test.pch" /Fo".\Debug/" /Fd".\Debug/" /GZ /c /GX -# ADD CPP /nologo /MTd /I "../include" /I "../" /Z7 /W3 /Od /G6 /D "_DEBUG" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /D "__WIN__" /D "_WIN32" /Fp".\Debug/client_test.pch" /Fo".\Debug/" /Fd".\Debug/" /GZ /c /GX -# ADD BASE MTL /nologo /tlb".\Debug\client_test.tlb" /win32 -# ADD MTL /nologo /tlb".\Debug\client_test.tlb" /win32 +# ADD BASE CPP /nologo /MTd /I "../include" /I "../" /Z7 /W3 /Od /G6 /D "_DEBUG" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /D "__WIN__" /D "_WIN32" /Fp".\Debug/mysql_client_test.pch" /Fo".\Debug/" /Fd".\Debug/" /GZ /c /GX +# ADD CPP /nologo /MTd /I "../include" /I "../" /Z7 /W3 /Od /G6 /D "_DEBUG" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /D "__WIN__" /D "_WIN32" /Fp".\Debug/mysql_client_test.pch" /Fo".\Debug/" /Fd".\Debug/" /GZ /c /GX +# ADD BASE MTL /nologo /tlb".\Debug\mysql_client_test.tlb" /win32 +# ADD MTL /nologo /tlb".\Debug\mysql_client_test.tlb" /win32 # ADD BASE RSC /l 1033 # ADD RSC /l 1033 BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib mysys.lib regex.lib /nologo /out:"..\tests\client_test.exe" /incremental:yes /libpath:"..\lib_debug\" /debug /pdb:".\Debug\client_test.pdb" /pdbtype:sept /map:".\Debug\client_test.map" /subsystem:console -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib mysys.lib regex.lib /nologo /out:"..\tests\client_test.exe" /incremental:yes /libpath:"..\lib_debug\" /debug /pdb:".\Debug\client_test.pdb" /pdbtype:sept /map:".\Debug\client_test.map" /subsystem:console +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib mysys.lib regex.lib /nologo /out:"..\tests\mysql_client_test.exe" /incremental:yes /libpath:"..\lib_debug\" /debug /pdb:".\Debug\mysql_client_test.pdb" /pdbtype:sept /map:".\Debug\mysql_client_test.map" /subsystem:console +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib mysys.lib regex.lib /nologo /out:"..\tests\mysql_client_test.exe" /incremental:yes /libpath:"..\lib_debug\" /debug /pdb:".\Debug\mysql_client_test.pdb" /pdbtype:sept /map:".\Debug\mysql_client_test.map" /subsystem:console -!ELSEIF "$(CFG)" == "client_test - Win32 Release" +!ELSEIF "$(CFG)" == "mysql_client_test - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 @@ -83,11 +83,11 @@ LINK32=link.exe # Begin Target -# Name "client_test - Win32 Debug" -# Name "client_test - Win32 Release" +# Name "mysql_client_test - Win32 Debug" +# Name "mysql_client_test - Win32 Release" # Begin Source File -SOURCE=mysql_client_test.c +SOURCE=tests\mysql_client_test.c # End Source File # End Target # End Project diff --git a/mysql-test/my_manage.c b/mysql-test/my_manage.c index 5cd0013d7bb..88e68dfc27e 100644 --- a/mysql-test/my_manage.c +++ b/mysql-test/my_manage.c @@ -644,7 +644,7 @@ void del_tree(char *dir) if (lstat(entry->d_name, &st) == -1) { /* FIXME error */ - return; + return; } if (S_ISDIR(st.st_mode)) #else @@ -800,7 +800,15 @@ int removef(const char *format, ...) #ifndef STRUCT_DIRENT_HAS_D_TYPE struct stat st; - if (lstat(entry->d_name, &st) == -1 && !fnmatch(p, entry->d_name,0)) + /* create long name */ + snprintf(temp, FN_REFLEN, "%s/%s", path, entry->d_name); + + if (lstat(temp, &st) == -1) + { + return 1; /* Error couldn't lstat file */ + } + + if (!S_ISDIR(st.st_mode) && !fnmatch(p, entry->d_name,0)) #else if (!S_ISDIR(entry->d_type) && !fnmatch(p, entry->d_name,0)) #endif diff --git a/mysql-test/mysql_test_run_new.c b/mysql-test/mysql_test_run_new.c index 4e0e018f84b..40e45a92851 100644 --- a/mysql-test/mysql_test_run_new.c +++ b/mysql-test/mysql_test_run_new.c @@ -1021,14 +1021,6 @@ void run_test(char *test) char err_file[FN_REFLEN]; int err; arg_list_t al; -#ifdef __WIN__ - /* Clean test database */ - removef("%s/test/*.*", master_dir); - removef("%s/test/*.*", slave_dir); - removef("%s/mysqltest/*.*", master_dir); - removef("%s/mysqltest/*.*", slave_dir); - -#endif /* skip slave? */ flag= skip_slave; skip_slave= (strncmp(test, "rpl", 3) != 0); @@ -1393,7 +1385,11 @@ void setup(char *file __attribute__((unused))) snprintf(client_key, FN_REFLEN, "%s/SSL/client-key.pem", base_dir); /* setup files */ +#ifdef _DEBUG + snprintf(mysqld_file, FN_REFLEN, "%s/mysqld-debug.exe", bin_dir); +#else snprintf(mysqld_file, FN_REFLEN, "%s/mysqld.exe", bin_dir); +#endif snprintf(mysqltest_file, FN_REFLEN, "%s/mysqltest.exe", bin_dir); snprintf(mysqladmin_file, FN_REFLEN, "%s/mysqladmin.exe", bin_dir); #else @@ -1494,6 +1490,13 @@ void setup(char *file __attribute__((unused))) snprintf(file_path, FN_REFLEN*2, "CLIENT_BINDIR=%s", bin_dir); _putenv(file_path); + + snprintf(file_path, FN_REFLEN*2, + "MYSQL_CLIENT_TEST=%s/tests/mysql_client_test --no-defaults --testcase " + "--user=root --port=%u --silent", + base_dir, master_port); + _putenv(file_path); + #else { static char env_MYSQL_TEST_DIR[FN_REFLEN*2]; @@ -1506,6 +1509,7 @@ void setup(char *file __attribute__((unused))) static char env_MYSQL_FIX_SYSTEM_TABLES[FN_REFLEN*2]; static char env_NDB_TOOLS_DIR[FN_REFLEN*2]; static char env_CLIENT_BINDIR[FN_REFLEN*2]; + static char env_MYSQL_CLIENT_TEST[FN_REFLEN*2]; snprintf(env_MYSQL_TEST_DIR,FN_REFLEN*2, "MYSQL_TEST_DIR=%s",mysql_test_dir); @@ -1552,6 +1556,13 @@ void setup(char *file __attribute__((unused))) snprintf(env_CLIENT_BINDIR, FN_REFLEN*2, "CLIENT_BINDIR=%s", bin_dir); putenv(env_CLIENT_BINDIR); + + snprintf(env_MYSQL_CLIENT_TEST, FN_REFLEN*2, + "MYSQL_CLIENT_TEST=%s/tests/mysql_client_test --no-defaults --testcase " + "--user=root --socket=%s --port=%u --silent", + base_dir, master_socket, master_port); + putenv(env_MYSQL_CLIENT_TEST); + } #endif @@ -1592,8 +1603,13 @@ int main(int argc, char **argv) char **testes= 0; int name_index; int index; + char var_dir[FN_REFLEN]; /* setup */ setup(argv[0]); + + /* delete all file in var */ + snprintf(var_dir,FN_REFLEN,"%s/var",mysql_test_dir); + del_tree(var_dir); /* The --ignore option is comma saperated list of test cases to skip and @@ -1633,7 +1649,7 @@ int main(int argc, char **argv) /* install test databases */ mysql_install_db(); - + mlog("Starting Tests...\n"); mlog("\n"); From 8ecae2e65cd09568bdfcedd9b22b5fe41cf6144c Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 2 Feb 2005 09:05:52 -0800 Subject: [PATCH 0906/1063] Fix merge of func_str tests (accidently duplicated a test). mysql-test/t/func_str.test: Remove duplicated test that crept in during merge mysql-test/r/func_str.result: Update results --- mysql-test/r/func_str.result | 26 +++++++++++++------------- mysql-test/t/func_str.test | 7 +------ 2 files changed, 14 insertions(+), 19 deletions(-) diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result index a8a7ad0e349..88b1a5ea743 100644 --- a/mysql-test/r/func_str.result +++ b/mysql-test/r/func_str.result @@ -325,6 +325,19 @@ trim(trailing 'foo' from 'foo') select trim(leading 'foo' from 'foo'); trim(leading 'foo' from 'foo') +select quote(ltrim(concat(' ', 'a'))); +quote(ltrim(concat(' ', 'a'))) +'a' +select quote(trim(concat(' ', 'a'))); +quote(trim(concat(' ', 'a'))) +'a' +CREATE TABLE t1 SELECT 1 UNION SELECT 2 UNION SELECT 3; +SELECT QUOTE('A') FROM t1; +QUOTE('A') +'A' +'A' +'A' +DROP TABLE t1; select 1=_latin1'1'; 1=_latin1'1' 1 @@ -691,19 +704,6 @@ select count(*) as total, left(c,10) as reg from t1 group by reg order by reg de total reg 10 2004-12-10 drop table t1; -select quote(ltrim(concat(' ', 'a'))); -quote(ltrim(concat(' ', 'a'))) -'a' -select quote(trim(concat(' ', 'a'))); -quote(trim(concat(' ', 'a'))) -'a' -CREATE TABLE t1 SELECT 1 UNION SELECT 2 UNION SELECT 3; -SELECT QUOTE('A') FROM t1; -QUOTE('A') -'A' -'A' -'A' -DROP TABLE t1; select trim(null from 'kate') as "must_be_null"; must_be_null NULL diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test index 2bf130d1538..6d5974ca5ed 100644 --- a/mysql-test/t/func_str.test +++ b/mysql-test/t/func_str.test @@ -206,6 +206,7 @@ select quote(trim(concat(' ', 'a'))); CREATE TABLE t1 SELECT 1 UNION SELECT 2 UNION SELECT 3; SELECT QUOTE('A') FROM t1; DROP TABLE t1; + # Test collation and coercibility # @@ -440,12 +441,6 @@ create table t1 (a int not null primary key, b varchar(40), c datetime); insert into t1 (a,b,c) values (1,'Tom','2004-12-10 12:13:14'),(2,'ball games','2004-12-10 12:13:14'), (3,'Basil','2004-12-10 12:13:14'), (4,'Dean','2004-12-10 12:13:14'),(5,'Ellis','2004-12-10 12:13:14'), (6,'Serg','2004-12-10 12:13:14'), (7,'Sergei','2004-12-10 12:13:14'),(8,'Georg','2004-12-10 12:13:14'),(9,'Salle','2004-12-10 12:13:14'),(10,'Sinisa','2004-12-10 12:13:14'); select count(*) as total, left(c,10) as reg from t1 group by reg order by reg desc limit 0,12; drop table t1; -# crashing bug with QUOTE() and LTRIM() or TRIM() fixed -# Bug #7495 -# - -select quote(ltrim(concat(' ', 'a'))); -select quote(trim(concat(' ', 'a'))); # # Bug#7455 unexpected result: TRIM( FROM ) gives NOT NULL From 785049c67867f502618584770e2d6c320a73aac1 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 2 Feb 2005 18:30:33 +0100 Subject: [PATCH 0907/1063] fix linkerror on sol9x86 configure.in: fix linkerror on sol9x86 --- configure.in | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/configure.in b/configure.in index e57cdabad25..2ad8cb2ac68 100644 --- a/configure.in +++ b/configure.in @@ -2954,6 +2954,15 @@ EOF AC_CONFIG_SUBDIRS(innobase) fi +case $SYSTEM_TYPE-$MACHINE_TYPE-$ac_cv_prog_gcc-$have_ndbcluster in + *solaris*-i?86-no-yes) + # ndb fail for whatever strange reason to link Sun Forte/x86 + # unless using incremental linker + CXXFLAGS="$CXXFLAGS -xildon" + ;; + *) ;; +esac + if test X"$have_ndbcluster" = Xyes then if test X"$mysql_cv_compress" != Xyes From d4ac4cb112076cb9f79674f46591c3608cc10318 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 2 Feb 2005 19:23:24 +0100 Subject: [PATCH 0908/1063] - typo fix... --- Build-tools/Bootstrap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Build-tools/Bootstrap b/Build-tools/Bootstrap index 827eb4022d7..8b769dca3c4 100755 --- a/Build-tools/Bootstrap +++ b/Build-tools/Bootstrap @@ -214,7 +214,7 @@ if (-d $target_dir) @stat= stat("$target_dir/configure.in"); my $mtime= $stat[9]; my ($sec,$min,$hour,$mday,$mon,$year) = localtime($mtime); - my $mtime= sprintf("%04d%-02d-%02d-%02d:%02d", $year+1900, $mon+1, $mday, $hour, $min); + my $mtime= sprintf("%04d-%02d-%02d-%02d:%02d", $year+1900, $mon+1, $mday, $hour, $min); &logger("Renaming $target_dir to $target_dir-$mtime"); $command= "mv "; From 3d0f9d96d7236af2c4dc4bf844233e27497d59dc Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 2 Feb 2005 20:28:01 +0200 Subject: [PATCH 0909/1063] Fixed during review of new pulled code extra/perror.c: Use strmov() instead of strcpy() Indentation fixes sql/sql_table.cc: Revert back part of the old code as the new code didn't use mysql_data_home, which would have caused problems in the embedded server sql/sql_update.cc: Ensure that used_index is always set (It has to be set because it's value is tested if order != 0) --- extra/perror.c | 14 ++++++++------ sql/sql_table.cc | 9 +++++++-- sql/sql_update.cc | 3 +++ 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/extra/perror.c b/extra/perror.c index fc10d8eaecc..27027520cbe 100644 --- a/extra/perror.c +++ b/extra/perror.c @@ -213,12 +213,14 @@ int main(int argc,char *argv[]) string 'Unknown Error'. To avoid printing it we try to find the error string by asking for an impossible big error message. */ - msg = strerror(10000); + msg= strerror(10000); - /* allocate a buffer for unknown_error since strerror always returns the same pointer - on some platforms such as Windows */ - unknown_error = malloc( strlen(msg)+1 ); - strcpy( unknown_error, msg ); + /* + Allocate a buffer for unknown_error since strerror always returns + the same pointer on some platforms such as Windows + */ + unknown_error= malloc(strlen(msg)+1); + strmov(unknown_error, msg); for ( ; argc-- > 0 ; argv++) { @@ -271,7 +273,7 @@ int main(int argc,char *argv[]) /* if we allocated a buffer for unknown_error, free it now */ if (unknown_error) - free(unknown_error); + free(unknown_error); exit(error); return error; diff --git a/sql/sql_table.cc b/sql/sql_table.cc index f3c107c2696..5f3875ba934 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -2272,7 +2272,10 @@ int mysql_create_like_table(THD* thd, TABLE_LIST* table, strxmov(src_path, (*tmp_table)->path, reg_ext, NullS); else { - fn_format( src_path, src_table, src_db, reg_ext, MYF(MY_UNPACK_FILENAME)); + strxmov(src_path, mysql_data_home, "/", src_db, "/", src_table, + reg_ext, NullS); + /* Resolve symlinks (for windows) */ + fn_format(src_path, src_path, "", "", MYF(MY_UNPACK_FILENAME)); if (access(src_path, F_OK)) { my_error(ER_BAD_TABLE_ERROR, MYF(0), src_table); @@ -2299,7 +2302,9 @@ int mysql_create_like_table(THD* thd, TABLE_LIST* table, } else { - fn_format( dst_path, table_name, db, reg_ext, MYF(MY_UNPACK_FILENAME)); + strxmov(dst_path, mysql_data_home, "/", db, "/", table_name, + reg_ext, NullS); + fn_format(dst_path, dst_path, "", "", MYF(MY_UNPACK_FILENAME)); if (!access(dst_path, F_OK)) goto table_exists; } diff --git a/sql/sql_update.cc b/sql/sql_update.cc index 0ec71bdfba3..663f2d2be34 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -167,7 +167,10 @@ int mysql_update(THD *thd, else if ((used_index=table->file->key_used_on_scan) < MAX_KEY) used_key_is_modified=check_if_key_used(table, used_index, fields); else + { used_key_is_modified=0; + used_index= MAX_KEY; + } if (used_key_is_modified || order) { /* From 1bbfa6f75fcbe8514d5c494972f50f43dba0f7e0 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 2 Feb 2005 21:03:46 +0100 Subject: [PATCH 0910/1063] ndb - add abort to multi op test case ndb/include/ndbapi/NdbConnection.hpp: Add aborts to test case ndb/test/include/HugoOperations.hpp: Add aborts to test case ndb/test/ndbapi/testOperations.cpp: Add aborts to test case ndb/test/src/HugoOperations.cpp: Add aborts to test case ndb/test/src/HugoTransactions.cpp: Add aborts to test case --- ndb/include/ndbapi/NdbConnection.hpp | 2 +- ndb/test/include/HugoOperations.hpp | 2 + ndb/test/ndbapi/testOperations.cpp | 240 ++++++++++++++++++--------- ndb/test/src/HugoOperations.cpp | 7 + ndb/test/src/HugoTransactions.cpp | 122 +++++++------- 5 files changed, 234 insertions(+), 139 deletions(-) diff --git a/ndb/include/ndbapi/NdbConnection.hpp b/ndb/include/ndbapi/NdbConnection.hpp index f173cd8ac6e..53830dd93c5 100644 --- a/ndb/include/ndbapi/NdbConnection.hpp +++ b/ndb/include/ndbapi/NdbConnection.hpp @@ -688,7 +688,7 @@ private: void remove_list(NdbOperation*& head, NdbOperation*); void define_scan_op(NdbIndexScanOperation*); - friend int runOperations(class NDBT_Context*, class NDBT_Step*); + friend class HugoOperations; }; inline diff --git a/ndb/test/include/HugoOperations.hpp b/ndb/test/include/HugoOperations.hpp index fe22e4b5649..9ca2772e768 100644 --- a/ndb/test/include/HugoOperations.hpp +++ b/ndb/test/include/HugoOperations.hpp @@ -30,6 +30,8 @@ public: int closeTransaction(Ndb*); NdbConnection* getTransaction(); void refresh(); + + void setTransactionId(Uint64); int pkInsertRecord(Ndb*, int recordNo, diff --git a/ndb/test/ndbapi/testOperations.cpp b/ndb/test/ndbapi/testOperations.cpp index 92cc3e81b1a..e254aff58dc 100644 --- a/ndb/test/ndbapi/testOperations.cpp +++ b/ndb/test/ndbapi/testOperations.cpp @@ -103,6 +103,10 @@ OperationTestCase matrix[] = { << " failed on line " << __LINE__ << endl; \ abort(); return NDBT_FAILED; } +#define C3(b) if (!(b)) { \ + g_err << "ERR: failed on line " << __LINE__ << endl; \ + return NDBT_FAILED; } + int runOp(HugoOperations & hugoOps, Ndb * pNdb, @@ -326,18 +330,122 @@ generate(Vector& out, size_t len) } } +static const Uint32 DUMMY = 0; +static const Uint32 ROW = 1; + +int +verify_other(NDBT_Context* ctx, + Ndb* pNdb, int seq, OPS latest, bool initial_row, bool commit) +{ + Uint32 no_wait = NdbOperation::LM_CommittedRead* + ctx->getProperty("NoWait", (Uint32)1); + + for(size_t j = no_wait; j<3; j++) + { + HugoOperations other(*ctx->getTab()); + C3(other.startTransaction(pNdb) == 0); + C3(other.pkReadRecord(pNdb, ROW, 1, (NdbOperation::LockMode)j) == 0); + int tmp= other.execute_Commit(pNdb); + if(seq == 0){ + if(j == NdbOperation::LM_CommittedRead) + { + C3(initial_row? tmp==0 && other.verifyUpdatesValue(0) == 0 : tmp==626); + } + else + { + C3(tmp == 266); + } + } + else if(commit) + { + switch(latest){ + case o_INS: + case o_UPD: + C3(tmp == 0 && other.verifyUpdatesValue(seq) == 0); + break; + case o_DEL: + C3(tmp == 626); + break; + case o_DONE: + abort(); + } + } + else + { + // rollback + C3(initial_row? tmp==0 && other.verifyUpdatesValue(0) == 0 : tmp==626); + } + } + + return NDBT_OK; +} + +int +verify_savepoint(NDBT_Context* ctx, + Ndb* pNdb, int seq, OPS latest, + Uint64 transactionId) +{ + bool initial_row= (seq == 0) && latest == o_INS; + + for(size_t j = 0; j<3; j++) + { + const NdbOperation::LockMode lm= (NdbOperation::LockMode)j; + + HugoOperations same(*ctx->getTab()); + C3(same.startTransaction(pNdb) == 0); + same.setTransactionId(transactionId); // Cheat + + /** + * Increase savepoint to k + */ + for(size_t l = 1; l<=seq; l++) + { + C3(same.pkReadRecord(pNdb, DUMMY, 1, lm) == 0); // Read dummy row + C3(same.execute_NoCommit(pNdb) == 0); + g_info << "savepoint: " << l << endl; + } + + g_info << "op(" << seq << "): " + << " lock mode " << lm << endl; + + C3(same.pkReadRecord(pNdb, ROW, 1, lm) == 0); // Read real row + int tmp= same.execute_Commit(pNdb); + if(seq == 0) + { + if(initial_row) + { + C3(tmp == 0 && same.verifyUpdatesValue(0) == 0); + } else + { + C3(tmp == 626); + } + } + else + { + switch(latest){ + case o_INS: + case o_UPD: + C3(tmp == 0 && same.verifyUpdatesValue(seq) == 0); + break; + case o_DEL: + C3(tmp == 626); + break; + case o_DONE: + abort(); + } + } + } + return NDBT_OK; +} + int runOperations(NDBT_Context* ctx, NDBT_Step* step) { - const Uint32 DUMMY = 0; - const Uint32 ROW = 1; - int tmp; Ndb* pNdb = GETNDB(step); Uint32 seqNo = ctx->getProperty("Sequence", (Uint32)0); - Uint32 no_wait = NdbOperation::LM_CommittedRead* - ctx->getProperty("NoWait", (Uint32)1); + Uint32 commit= ctx->getProperty("Commit", (Uint32)1); if(seqNo == 0) { @@ -355,8 +463,8 @@ runOperations(NDBT_Context* ctx, NDBT_Step* step) C3(hugoOps.execute_Commit(pNdb) == 0); } - const bool inital_row= (seq[0] != o_INS); - if(inital_row) + const bool initial_row= (seq[0] != o_INS); + if(initial_row) { HugoOperations hugoOps(*ctx->getTab()); C3(hugoOps.startTransaction(pNdb) == 0); @@ -389,80 +497,36 @@ runOperations(NDBT_Context* ctx, NDBT_Step* step) /** * Verify other transaction */ - for(size_t j = no_wait; j<3; j++) - { - HugoOperations other(*ctx->getTab()); - C3(other.startTransaction(pNdb) == 0); - C3(other.pkReadRecord(pNdb, ROW, 1, (NdbOperation::LockMode)j) == 0); - tmp= other.execute_Commit(pNdb); - if(j == NdbOperation::LM_CommittedRead) - { - C3(inital_row? tmp==0 && other.verifyUpdatesValue(0) == 0 : tmp==626); - } - else - { - C3(tmp == 266); - } - } - + if(verify_other(ctx, pNdb, 0, seq[0], initial_row, commit) != NDBT_OK) + return NDBT_FAILED; + /** * Verify savepoint read */ Uint64 transactionId= trans1.getTransaction()->getTransactionId(); + for(size_t k=0; k<=i+1; k++) { - for(size_t j = 0; j<3; j++) - { - const NdbOperation::LockMode lm= (NdbOperation::LockMode)j; - - HugoOperations same(*ctx->getTab()); - C3(same.startTransaction(pNdb) == 0); - same.getTransaction()->setTransactionId(transactionId); // Cheat - - /** - * Increase savepoint to k - */ - for(size_t l = 1; l<=k; l++) - { - C3(same.pkReadRecord(pNdb, DUMMY, 1, lm) == 0); // Read dummy row - C3(same.execute_NoCommit(pNdb) == 0); - g_info << "savepoint: " << l << endl; - } - - g_info << "op(" << k << ", " << i << "): " - << " lock mode " << lm << endl; - - C3(same.pkReadRecord(pNdb, ROW, 1, lm) == 0); // Read real row - tmp= same.execute_Commit(pNdb); - if(k == 0) - { - if(inital_row) - { - C3(tmp == 0 && same.verifyUpdatesValue(0) == 0); - } else - { - C3(tmp == 626); - } - } - else - { - switch(seq[k-1]){ - case o_INS: - case o_UPD: - C3(tmp == 0 && same.verifyUpdatesValue(k) == 0); - break; - case o_DEL: - C3(tmp == 626); - break; - case o_DONE: - abort(); - } - } - } - } + if(verify_savepoint(ctx, pNdb, k, + k>0 ? seq[k-1] : initial_row ? o_INS : o_DONE, + transactionId) != NDBT_OK) + return NDBT_FAILED; + } + } + + if(commit) + { + C3(trans1.execute_Commit(pNdb) == 0); + } + else + { + C3(trans1.execute_Rollback(pNdb) == 0); } - C3(trans1.execute_Commit(pNdb) == 0); + if(verify_other(ctx, pNdb, seq.size(), seq.back(), + initial_row, commit) != NDBT_OK) + return NDBT_FAILED; + return NDBT_OK; } @@ -495,16 +559,20 @@ main(int argc, const char** argv){ } } + BaseString n1; + n1.append(name); + n1.append("_COMMIT"); + NDBT_TestCaseImpl1 *pt = new NDBT_TestCaseImpl1(&ts, - name.c_str()+1, ""); - + n1.c_str()+1, ""); + pt->setProperty("Sequence", tmp[i]); pt->addInitializer(new NDBT_Initializer(pt, "runClearTable", runClearTable)); pt->addStep(new NDBT_ParallelStep(pt, - name.c_str()+1, + "run", runOperations)); pt->addFinalizer(new NDBT_Finalizer(pt, @@ -512,8 +580,26 @@ main(int argc, const char** argv){ runClearTable)); ts.addTest(pt); - } + name.append("_ABORT"); + pt = new NDBT_TestCaseImpl1(&ts, name.c_str()+1, ""); + pt->setProperty("Sequence", tmp[i]); + pt->setProperty("Commit", (Uint32)0); + pt->addInitializer(new NDBT_Initializer(pt, + "runClearTable", + runClearTable)); + + pt->addStep(new NDBT_ParallelStep(pt, + "run", + runOperations)); + + pt->addFinalizer(new NDBT_Finalizer(pt, + "runClearTable", + runClearTable)); + + ts.addTest(pt); + } + for(Uint32 i = 0; isetTransactionId(id); + } +} + int HugoOperations::closeTransaction(Ndb* pNdb){ if (pTrans != NULL){ diff --git a/ndb/test/src/HugoTransactions.cpp b/ndb/test/src/HugoTransactions.cpp index 096f5406bbf..a2ed9c77db7 100644 --- a/ndb/test/src/HugoTransactions.cpp +++ b/ndb/test/src/HugoTransactions.cpp @@ -92,7 +92,7 @@ HugoTransactions::scanReadRecords(Ndb* pNdb, if((row.attributeStore(a) = pOp->getValue(tab.getColumn(a)->getName())) == 0) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } } @@ -102,13 +102,13 @@ HugoTransactions::scanReadRecords(Ndb* pNdb, const NdbError err = pTrans->getNdbError(); if (err.status == NdbError::TemporaryError){ ERR(err); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); NdbSleep_MilliSleep(50); retryAttempt++; continue; } ERR(err); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } @@ -127,7 +127,7 @@ HugoTransactions::scanReadRecords(Ndb* pNdb, while((eof = rs->nextResult(true)) == 0){ rows++; if (calc.verifyRowValues(&row) != 0){ - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } @@ -137,11 +137,11 @@ HugoTransactions::scanReadRecords(Ndb* pNdb, rs->close(); if( check == -1 ) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_OK; } } @@ -150,7 +150,7 @@ HugoTransactions::scanReadRecords(Ndb* pNdb, if (err.status == NdbError::TemporaryError){ ERR_INFO(err); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); NdbSleep_MilliSleep(50); switch (err.code){ case 488: @@ -164,17 +164,17 @@ HugoTransactions::scanReadRecords(Ndb* pNdb, continue; } ERR(err); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); g_info << rows << " rows have been read" << endl; if (records != 0 && rows != records){ g_err << "Check expected number of records failed" << endl - << " expected=" << records <<", " << endl - << " read=" << rows << endl; + << " expected=" << records <<", " << endl + << " read=" << rows << endl; return NDBT_FAILED; } @@ -248,7 +248,7 @@ HugoTransactions::scanReadRecords(Ndb* pNdb, if((row.attributeStore(a) = pOp->getValue(tab.getColumn(a)->getName())) == 0) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } } @@ -258,13 +258,13 @@ HugoTransactions::scanReadRecords(Ndb* pNdb, const NdbError err = pTrans->getNdbError(); if (err.status == NdbError::TemporaryError){ ERR(err); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); NdbSleep_MilliSleep(50); retryAttempt++; continue; } ERR(err); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } @@ -283,7 +283,7 @@ HugoTransactions::scanReadRecords(Ndb* pNdb, while((eof = rs->nextResult(true)) == 0){ rows++; if (calc.verifyRowValues(&row) != 0){ - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } @@ -293,11 +293,11 @@ HugoTransactions::scanReadRecords(Ndb* pNdb, rs->close(); if( check == -1 ) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_OK; } } @@ -306,7 +306,7 @@ HugoTransactions::scanReadRecords(Ndb* pNdb, if (err.status == NdbError::TemporaryError){ ERR_INFO(err); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); NdbSleep_MilliSleep(50); switch (err.code){ case 488: @@ -320,17 +320,17 @@ HugoTransactions::scanReadRecords(Ndb* pNdb, continue; } ERR(err); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); g_info << rows << " rows have been read" << endl; if (records != 0 && rows != records){ g_err << "Check expected number of records failed" << endl - << " expected=" << records <<", " << endl - << " read=" << rows << endl; + << " expected=" << records <<", " << endl + << " read=" << rows << endl; return NDBT_FAILED; } @@ -344,9 +344,9 @@ HugoTransactions::scanReadRecords(Ndb* pNdb, int HugoTransactions::scanUpdateRecords(Ndb* pNdb, - int records, - int abortPercent, - int parallelism){ + int records, + int abortPercent, + int parallelism){ if(m_defaultScanUpdateMethod == 1){ return scanUpdateRecords1(pNdb, records, abortPercent, parallelism); } else if(m_defaultScanUpdateMethod == 2){ @@ -707,7 +707,7 @@ HugoTransactions::scanUpdateRecords3(Ndb* pNdb, while (true){ - restart: +restart: if (retryAttempt++ >= retryMax){ g_info << "ERROR: has retried this operation " << retryAttempt << " times, failing!" << endl; @@ -743,7 +743,7 @@ HugoTransactions::scanUpdateRecords3(Ndb* pNdb, for(a=0; agetValue(tab.getColumn(a)->getName())) == NULL){ ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } } @@ -752,7 +752,7 @@ HugoTransactions::scanUpdateRecords3(Ndb* pNdb, if( check == -1 ) { const NdbError err = pTrans->getNdbError(); ERR(err); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); if (err.status == NdbError::TemporaryError){ NdbSleep_MilliSleep(50); continue; @@ -777,7 +777,7 @@ HugoTransactions::scanUpdateRecords3(Ndb* pNdb, NdbOperation* pUp = rs->updateTuple(); if(pUp == 0){ ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } const int updates = calc.getUpdatesValue(&row) + 1; @@ -786,7 +786,7 @@ HugoTransactions::scanUpdateRecords3(Ndb* pNdb, if (tab.getColumn(a)->getPrimaryKey() == false){ if(setValueForAttr(pUp, a, r, updates ) != 0){ ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } } @@ -795,7 +795,7 @@ HugoTransactions::scanUpdateRecords3(Ndb* pNdb, if (rows == abortCount && abortTrans == true){ g_info << "Scan is aborted" << endl; // This scan should be aborted - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_OK; } } while((check = rs->nextResult(false)) == 0); @@ -807,7 +807,7 @@ HugoTransactions::scanUpdateRecords3(Ndb* pNdb, const NdbError err = pTrans->getNdbError(); if( check == -1 ) { - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); ERR(err); if (err.status == NdbError::TemporaryError){ NdbSleep_MilliSleep(50); @@ -819,7 +819,7 @@ HugoTransactions::scanUpdateRecords3(Ndb* pNdb, const NdbError err = pTrans->getNdbError(); if( check == -1 ) { - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); ERR(err); if (err.status == NdbError::TemporaryError){ NdbSleep_MilliSleep(50); @@ -828,7 +828,7 @@ HugoTransactions::scanUpdateRecords3(Ndb* pNdb, return NDBT_FAILED; } - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); g_info << rows << " rows have been updated" << endl; return NDBT_OK; @@ -1772,7 +1772,7 @@ HugoTransactions::pkInterpretedUpdateRecords(Ndb* pNdb, pUpdOp = pTrans->getNdbOperation(tab.getName()); if (pUpdOp == NULL) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } @@ -1788,7 +1788,7 @@ HugoTransactions::pkInterpretedUpdateRecords(Ndb* pNdb, if (tab.getColumn(a)->getPrimaryKey() == true){ if(equalForAttr(pUpdOp, a, r) != 0){ ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } } @@ -1805,7 +1805,7 @@ HugoTransactions::pkInterpretedUpdateRecords(Ndb* pNdb, check = pUpdOp->incValue(attr->getName(), valToIncWith); if( check == -1 ) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } } @@ -1817,7 +1817,7 @@ HugoTransactions::pkInterpretedUpdateRecords(Ndb* pNdb, (calc.isUpdateCol(a) == false)){ if(setValueForAttr(pUpdOp, a, r, updates ) != 0){ ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } } @@ -1846,7 +1846,7 @@ HugoTransactions::pkInterpretedUpdateRecords(Ndb* pNdb, } - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); r++; // Read next record @@ -1900,7 +1900,7 @@ HugoTransactions::pkDelRecords(Ndb* pNdb, pOp = pTrans->getNdbOperation(tab.getName()); if (pOp == NULL) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } @@ -1928,7 +1928,7 @@ HugoTransactions::pkDelRecords(Ndb* pNdb, switch(err.status){ case NdbError::TemporaryError: ERR(err); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); NdbSleep_MilliSleep(50); retryAttempt++; continue; @@ -2066,18 +2066,18 @@ HugoTransactions::lockRecords(Ndb* pNdb, if (err.status == NdbError::TemporaryError){ ERR(err); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); NdbSleep_MilliSleep(50); retryAttempt++; continue; } ERR(err); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } for (int b=0; (bcloseTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } } @@ -2178,7 +2178,7 @@ HugoTransactions::indexReadRecords(Ndb* pNdb, pOp = pTrans->getNdbIndexOperation(idxName, tab.getName()); if (pOp == NULL) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } check = pOp->readTuple(); @@ -2186,7 +2186,7 @@ HugoTransactions::indexReadRecords(Ndb* pNdb, pOp = sOp = pTrans->getNdbIndexScanOperation(idxName, tab.getName()); if (sOp == NULL) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } @@ -2196,7 +2196,7 @@ HugoTransactions::indexReadRecords(Ndb* pNdb, if( check == -1 ) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } @@ -2205,7 +2205,7 @@ HugoTransactions::indexReadRecords(Ndb* pNdb, if (tab.getColumn(a)->getPrimaryKey() == true){ if(equalForAttr(pOp, a, r+b) != 0){ ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } } @@ -2216,7 +2216,7 @@ HugoTransactions::indexReadRecords(Ndb* pNdb, if((rows[b]->attributeStore(a) = pOp->getValue(tab.getColumn(a)->getName())) == 0) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } } @@ -2257,11 +2257,11 @@ HugoTransactions::indexReadRecords(Ndb* pNdb, if(ordered && rs->nextResult(true) == 0){ ndbout << "Error when comparing records " << " - index op next_result to many" << endl; - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } } - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); } deallocRows(); g_info << reads << " records read" << endl; @@ -2322,21 +2322,21 @@ HugoTransactions::indexUpdateRecords(Ndb* pNdb, pOp = pTrans->getNdbIndexOperation(idxName, tab.getName()); if (pOp == NULL) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } check = pOp->readTupleExclusive(); if( check == -1 ) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } } else { pOp = sOp = pTrans->getNdbIndexScanOperation(idxName, tab.getName()); if (pOp == NULL) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } @@ -2349,7 +2349,7 @@ HugoTransactions::indexUpdateRecords(Ndb* pNdb, if (tab.getColumn(a)->getPrimaryKey() == true){ if(equalForAttr(pOp, a, r+b) != 0){ ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } } @@ -2371,7 +2371,7 @@ HugoTransactions::indexUpdateRecords(Ndb* pNdb, if( check == -1 ) { const NdbError err = pTrans->getNdbError(); ERR(err); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); if (err.status == NdbError::TemporaryError){ NdbSleep_MilliSleep(50); @@ -2405,13 +2405,13 @@ HugoTransactions::indexUpdateRecords(Ndb* pNdb, if (pUpdOp == NULL) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } if( check == -1 ) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } @@ -2420,7 +2420,7 @@ HugoTransactions::indexUpdateRecords(Ndb* pNdb, if (tab.getColumn(a)->getPrimaryKey() == true){ if(equalForAttr(pUpdOp, a, r+b) != 0){ ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } } @@ -2431,7 +2431,7 @@ HugoTransactions::indexUpdateRecords(Ndb* pNdb, if (tab.getColumn(a)->getPrimaryKey() == false){ if(setValueForAttr(pUpdOp, a, r+b, updates ) != 0){ ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } } @@ -2455,7 +2455,7 @@ HugoTransactions::indexUpdateRecords(Ndb* pNdb, updated += batchsize; } - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); r+= batchsize; // Read next record } From ad21db5e0727704ee0527c08410bafff4d3150f4 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 2 Feb 2005 22:35:36 +0200 Subject: [PATCH 0911/1063] Use -DUNIV_DEBUG (extra debugging for InnoDB) when configuring with --debug=full --- configure.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index e57cdabad25..98d060e660c 100644 --- a/configure.in +++ b/configure.in @@ -1677,8 +1677,8 @@ then elif test "$with_debug" = "full" then # Full debug. Very slow in some cases - CFLAGS="$DEBUG_CFLAGS -DDBUG_ON -DSAFE_MUTEX -DSAFEMALLOC $CFLAGS" - CXXFLAGS="$DEBUG_CXXFLAGS -DDBUG_ON -DSAFE_MUTEX -DSAFEMALLOC $CXXFLAGS" + CFLAGS="$DEBUG_CFLAGS -DDBUG_ON -DSAFE_MUTEX -DSAFEMALLOC -DUNIV_DEBUG $CFLAGS" + CXXFLAGS="$DEBUG_CXXFLAGS -DDBUG_ON -DSAFE_MUTEX -DSAFEMALLOC -DUNIV_DEBUG $CXXFLAGS" else # Optimized version. No debug CFLAGS="$OPTIMIZE_CFLAGS -DDBUG_OFF $CFLAGS" From ba51652c2cd753566d768ccdf02f2de92a17a4b2 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 2 Feb 2005 15:03:34 -0800 Subject: [PATCH 0912/1063] Fix 'mysqlcheck --help' to not specify what storage engines are supported, rather than give incorrect information. (Bug #8029) client/mysqlcheck.c: Make usage message more general as to what storage engines are supported. --- client/mysqlcheck.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/mysqlcheck.c b/client/mysqlcheck.c index c670b84db44..babf4de0c3d 100644 --- a/client/mysqlcheck.c +++ b/client/mysqlcheck.c @@ -195,7 +195,7 @@ static void usage(void) puts("and you are welcome to modify and redistribute it under the GPL license.\n"); puts("This program can be used to CHECK (-c,-m,-C), REPAIR (-r), ANALYZE (-a)"); puts("or OPTIMIZE (-o) tables. Some of the options (like -e or -q) can be"); - puts("used at the same time. It works on MyISAM and in some cases on BDB tables."); + puts("used at the same time. Not all options are supported by all storage engines."); puts("Please consult the MySQL manual for latest information about the"); puts("above. The options -c,-r,-a and -o are exclusive to each other, which"); puts("means that the last option will be used, if several was specified.\n"); From a6cb0e5ff1c5160f60ebc5303f5c0d898d28dcda Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 3 Feb 2005 17:10:46 +0100 Subject: [PATCH 0913/1063] ndb - use hugo methods all the way in hugo more test program fixes replace pNdb->closeTransaction with closeTransaction(pNdb) ndb/test/src/HugoTransactions.cpp: more test program fixes replace pNdb->closeTransaction with closeTransaction(pNdb) --- ndb/test/src/HugoTransactions.cpp | 188 +++++++++++++++--------------- 1 file changed, 94 insertions(+), 94 deletions(-) diff --git a/ndb/test/src/HugoTransactions.cpp b/ndb/test/src/HugoTransactions.cpp index a2ed9c77db7..85c96ef0f7f 100644 --- a/ndb/test/src/HugoTransactions.cpp +++ b/ndb/test/src/HugoTransactions.cpp @@ -68,7 +68,7 @@ HugoTransactions::scanReadRecords(Ndb* pNdb, pOp = pTrans->getNdbScanOperation(tab.getName()); if (pOp == NULL) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } @@ -77,14 +77,14 @@ HugoTransactions::scanReadRecords(Ndb* pNdb, if( rs == 0 ) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } check = pOp->interpret_exit_ok(); if( check == -1 ) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } @@ -224,7 +224,7 @@ HugoTransactions::scanReadRecords(Ndb* pNdb, pOp = pTrans->getNdbIndexScanOperation(pIdx->getName(), tab.getName()); if (pOp == NULL) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } @@ -233,14 +233,14 @@ HugoTransactions::scanReadRecords(Ndb* pNdb, if( rs == 0 ) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } check = pOp->interpret_exit_ok(); if( check == -1 ) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } @@ -398,21 +398,21 @@ HugoTransactions::scanUpdateRecords1(Ndb* pNdb, pOp = pTrans->getNdbOperation(tab.getName()); if (pOp == NULL) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } check = pOp->openScanExclusive(parallelism); if( check == -1 ) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } check = pOp->interpret_exit_ok(); if( check == -1 ) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } @@ -420,7 +420,7 @@ HugoTransactions::scanUpdateRecords1(Ndb* pNdb, for(a=0; agetValue(tab.getColumn(a)->getName())) == NULL){ ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } } @@ -430,13 +430,13 @@ HugoTransactions::scanUpdateRecords1(Ndb* pNdb, const NdbError err = pTrans->getNdbError(); if (err.status == NdbError::TemporaryError){ ERR(err); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); NdbSleep_MilliSleep(50); retryAttempt++; continue; } ERR(err); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } @@ -464,11 +464,11 @@ HugoTransactions::scanUpdateRecords1(Ndb* pNdb, check = pTrans->stopScan(); if( check == -1 ) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_OK; } int res = takeOverAndUpdateRecord(pNdb, pOp); @@ -477,7 +477,7 @@ HugoTransactions::scanUpdateRecords1(Ndb* pNdb, continue; } if (res != 0){ - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return res; } @@ -501,18 +501,18 @@ HugoTransactions::scanUpdateRecords1(Ndb* pNdb, continue; } ERR(err); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } if(eof == -2){ - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); NdbSleep_MilliSleep(50); retryAttempt++; continue; } - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); g_info << rows << " rows have been updated" << endl; return NDBT_OK; @@ -565,21 +565,21 @@ HugoTransactions::scanUpdateRecords2(Ndb* pNdb, pOp = pTrans->getNdbOperation(tab.getName()); if (pOp == NULL) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } check = pOp->openScanExclusive(parallelism); if( check == -1 ) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } check = pOp->interpret_exit_ok(); if( check == -1 ) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } @@ -587,7 +587,7 @@ HugoTransactions::scanUpdateRecords2(Ndb* pNdb, for(a=0; agetValue(tab.getColumn(a)->getName())) == NULL){ ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } } @@ -597,13 +597,13 @@ HugoTransactions::scanUpdateRecords2(Ndb* pNdb, const NdbError err = pTrans->getNdbError(); if (err.status == NdbError::TemporaryError){ ERR(err); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); NdbSleep_MilliSleep(50); retryAttempt++; continue; } ERR(err); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } @@ -639,7 +639,7 @@ HugoTransactions::scanUpdateRecords2(Ndb* pNdb, rows++; if (addRowToUpdate(pNdb, pUpTrans, pOp) != 0){ pNdb->closeTransaction(pUpTrans); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } } while((eof = pTrans->nextScanResult(false)) == 0); @@ -650,12 +650,12 @@ HugoTransactions::scanUpdateRecords2(Ndb* pNdb, check = pTrans->stopScan(); if( check == -1 ) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); pNdb->closeTransaction(pUpTrans); return NDBT_FAILED; } - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); pNdb->closeTransaction(pUpTrans); return NDBT_OK; } @@ -665,7 +665,7 @@ HugoTransactions::scanUpdateRecords2(Ndb* pNdb, const NdbError err = pUpTrans->getNdbError(); ERR(err); pNdb->closeTransaction(pUpTrans); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } pNdb->closeTransaction(pUpTrans); @@ -675,17 +675,17 @@ HugoTransactions::scanUpdateRecords2(Ndb* pNdb, if (err.status == NdbError::TemporaryError){ ERR(err); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); NdbSleep_MilliSleep(50); retryAttempt++; continue; } ERR(err); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); g_info << rows << " rows have been updated" << endl; return NDBT_OK; @@ -728,14 +728,14 @@ restart: pOp = pTrans->getNdbScanOperation(tab.getName()); if (pOp == NULL) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } NdbResultSet *rs = pOp->readTuplesExclusive(parallelism); if( rs == 0 ) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } @@ -899,14 +899,14 @@ HugoTransactions::loadTable(Ndb* pNdb, pOp = pTrans->getNdbOperation(tab.getName()); if (pOp == NULL) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } check = pOp->insertTuple(); if( check == -1 ) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } @@ -914,7 +914,7 @@ HugoTransactions::loadTable(Ndb* pNdb, for (a = 0; agetNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } } @@ -932,7 +932,7 @@ HugoTransactions::loadTable(Ndb* pNdb, } if(check == -1 ) { const NdbError err = pTrans->getNdbError(); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); pTrans= 0; switch(err.status){ case NdbError::Success: @@ -974,7 +974,7 @@ HugoTransactions::loadTable(Ndb* pNdb, } else{ if (closeTrans) { - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); pTrans= 0; } } @@ -1025,14 +1025,14 @@ HugoTransactions::fillTable(Ndb* pNdb, pOp = pTrans->getNdbOperation(tab.getName()); if (pOp == NULL) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } check = pOp->insertTuple(); if( check == -1 ) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } @@ -1040,7 +1040,7 @@ HugoTransactions::fillTable(Ndb* pNdb, for (a = 0; agetNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } } @@ -1050,7 +1050,7 @@ HugoTransactions::fillTable(Ndb* pNdb, check = pTrans->execute( Commit, CommitAsMuchAsPossible ); if(check == -1 ) { const NdbError err = pTrans->getNdbError(); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); switch(err.status){ case NdbError::Success: @@ -1102,7 +1102,7 @@ HugoTransactions::fillTable(Ndb* pNdb, } } else{ - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); } // Step to next record @@ -1419,7 +1419,7 @@ HugoTransactions::pkReadRecords(Ndb* pNdb, pOp = pTrans->getNdbOperation(tab.getName()); if (pOp == NULL) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } @@ -1441,7 +1441,7 @@ HugoTransactions::pkReadRecords(Ndb* pNdb, if( check == -1 ) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } @@ -1450,7 +1450,7 @@ HugoTransactions::pkReadRecords(Ndb* pNdb, if (tab.getColumn(a)->getPrimaryKey() == true){ if(equalForAttr(pOp, a, r+b) != 0){ ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } } @@ -1461,7 +1461,7 @@ HugoTransactions::pkReadRecords(Ndb* pNdb, if((rows[b]->attributeStore(a) = pOp->getValue(tab.getColumn(a)->getName())) == 0) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } } @@ -1474,7 +1474,7 @@ HugoTransactions::pkReadRecords(Ndb* pNdb, if (err.status == NdbError::TemporaryError){ ERR(err); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); NdbSleep_MilliSleep(50); retryAttempt++; continue; @@ -1487,13 +1487,13 @@ HugoTransactions::pkReadRecords(Ndb* pNdb, default: ERR(err); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } } else{ for (int b=0; (bcloseTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } reads++; @@ -1501,7 +1501,7 @@ HugoTransactions::pkReadRecords(Ndb* pNdb, } } - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); } deallocRows(); @@ -1556,14 +1556,14 @@ HugoTransactions::pkUpdateRecords(Ndb* pNdb, pOp = pTrans->getNdbOperation(tab.getName()); if (pOp == NULL) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } check = pOp->readTupleExclusive(); if( check == -1 ) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } @@ -1572,7 +1572,7 @@ HugoTransactions::pkUpdateRecords(Ndb* pNdb, if (tab.getColumn(a)->getPrimaryKey() == true){ if(equalForAttr(pOp, a, r+b) != 0){ ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } } @@ -1583,7 +1583,7 @@ HugoTransactions::pkUpdateRecords(Ndb* pNdb, if((rows[b]->attributeStore(a) = pOp->getValue(tab.getColumn(a)->getName())) == 0) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } } @@ -1595,19 +1595,19 @@ HugoTransactions::pkUpdateRecords(Ndb* pNdb, if (err.status == NdbError::TemporaryError){ ERR(err); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); NdbSleep_MilliSleep(50); retryAttempt++; continue; } ERR(err); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } for(b = 0; bcloseTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } @@ -1617,14 +1617,14 @@ HugoTransactions::pkUpdateRecords(Ndb* pNdb, pUpdOp = pTrans->getNdbOperation(tab.getName()); if (pUpdOp == NULL) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } check = pUpdOp->updateTuple(); if( check == -1 ) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } @@ -1632,7 +1632,7 @@ HugoTransactions::pkUpdateRecords(Ndb* pNdb, if (tab.getColumn(a)->getPrimaryKey() == true){ if(equalForAttr(pUpdOp, a, r+b) != 0){ ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } } @@ -1642,7 +1642,7 @@ HugoTransactions::pkUpdateRecords(Ndb* pNdb, if (tab.getColumn(a)->getPrimaryKey() == false){ if(setValueForAttr(pUpdOp, a, r+b, updates ) != 0){ ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } } @@ -1655,14 +1655,14 @@ HugoTransactions::pkUpdateRecords(Ndb* pNdb, if (err.status == NdbError::TemporaryError){ ERR(err); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); NdbSleep_MilliSleep(50); retryAttempt++; continue; } ERR(err); ndbout << "r = " << r << endl; - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } else{ @@ -1670,7 +1670,7 @@ HugoTransactions::pkUpdateRecords(Ndb* pNdb, } - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); r += batch; // Read next record } @@ -1716,14 +1716,14 @@ HugoTransactions::pkInterpretedUpdateRecords(Ndb* pNdb, NdbOperation* pOp = pTrans->getNdbOperation(tab.getName()); if (pOp == NULL) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } check = pOp->readTupleExclusive(); if( check == -1 ) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } @@ -1732,7 +1732,7 @@ HugoTransactions::pkInterpretedUpdateRecords(Ndb* pNdb, if (tab.getColumn(a)->getPrimaryKey() == true){ if(equalForAttr(pOp, a, r) != 0){ ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } } @@ -1744,7 +1744,7 @@ HugoTransactions::pkInterpretedUpdateRecords(Ndb* pNdb, if((row.attributeStore(a) = pOp->getValue(tab.getColumn(a)->getName())) == 0) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } } @@ -1756,13 +1756,13 @@ HugoTransactions::pkInterpretedUpdateRecords(Ndb* pNdb, if (err.status == NdbError::TemporaryError){ ERR(err); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); NdbSleep_MilliSleep(50); retryAttempt++; continue; } ERR(err); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } @@ -1779,7 +1779,7 @@ HugoTransactions::pkInterpretedUpdateRecords(Ndb* pNdb, check = pUpdOp->interpretedUpdateTuple(); if( check == -1 ) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } @@ -1831,14 +1831,14 @@ HugoTransactions::pkInterpretedUpdateRecords(Ndb* pNdb, if (err.status == NdbError::TemporaryError){ ERR(err); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); NdbSleep_MilliSleep(50); retryAttempt++; continue; } ERR(err); ndbout << "r = " << r << endl; - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } else{ @@ -1907,7 +1907,7 @@ HugoTransactions::pkDelRecords(Ndb* pNdb, check = pOp->deleteTuple(); if( check == -1 ) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } @@ -1916,7 +1916,7 @@ HugoTransactions::pkDelRecords(Ndb* pNdb, if (tab.getColumn(a)->getPrimaryKey() == true){ if(equalForAttr(pOp, a, r) != 0){ ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } } @@ -1947,20 +1947,20 @@ HugoTransactions::pkDelRecords(Ndb* pNdb, } } ERR(err); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; break; default: ERR(err); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } } else { deleted++; } - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); r++; // Read next record @@ -2023,14 +2023,14 @@ HugoTransactions::lockRecords(Ndb* pNdb, pOp = pTrans->getNdbOperation(tab.getName()); if (pOp == NULL) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } check = pOp->readTupleExclusive(); if( check == -1 ) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } @@ -2039,7 +2039,7 @@ HugoTransactions::lockRecords(Ndb* pNdb, if (tab.getColumn(a)->getPrimaryKey() == true){ if(equalForAttr(pOp, a, r+b) != 0){ ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } } @@ -2050,7 +2050,7 @@ HugoTransactions::lockRecords(Ndb* pNdb, if((rows[b]->attributeStore(a) = pOp->getValue(tab.getColumn(a)->getName())) == 0) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } } @@ -2092,26 +2092,26 @@ HugoTransactions::lockRecords(Ndb* pNdb, if (err.status == NdbError::TemporaryError){ ERR(err); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); NdbSleep_MilliSleep(50); retryAttempt++; continue; } ERR(err); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } else{ for (int b=0; (bcloseTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } r++; // Read next record } } - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); } @@ -2229,7 +2229,7 @@ HugoTransactions::indexReadRecords(Ndb* pNdb, if (err.status == NdbError::TemporaryError){ ERR(err); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); NdbSleep_MilliSleep(50); retryAttempt++; continue; @@ -2242,13 +2242,13 @@ HugoTransactions::indexReadRecords(Ndb* pNdb, default: ERR(err); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } } else{ for (int b=0; (bcloseTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } reads++; @@ -2360,7 +2360,7 @@ HugoTransactions::indexUpdateRecords(Ndb* pNdb, if((rows[b]->attributeStore(a) = pOp->getValue(tab.getColumn(a)->getName())) == 0) { ERR(pTrans->getNdbError()); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } } @@ -2383,13 +2383,13 @@ HugoTransactions::indexUpdateRecords(Ndb* pNdb, if(ordered && check != 0){ g_err << "Row: " << r << " not found!!" << endl; - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } for(b = 0; bcloseTransaction(pTrans); + closeTransaction(pNdb); return NDBT_FAILED; } @@ -2442,7 +2442,7 @@ HugoTransactions::indexUpdateRecords(Ndb* pNdb, if( check == -1 ) { const NdbError err = pTrans->getNdbError(); ERR(err); - pNdb->closeTransaction(pTrans); + closeTransaction(pNdb); if (err.status == NdbError::TemporaryError){ NdbSleep_MilliSleep(50); From 12a0a21c5ee7d4dec9c6199873933b65964c7ef2 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 3 Feb 2005 17:53:03 +0100 Subject: [PATCH 0914/1063] ndbcluster rpms --- support-files/mysql.spec.sh | 94 +++++++++++++++++++++++++++++ support-files/ndb-config-2-node.ini | 43 +++++++++++++ 2 files changed, 137 insertions(+) create mode 100644 support-files/ndb-config-2-node.ini diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index 99280385965..0d72356731c 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -104,6 +104,53 @@ This package contains the standard MySQL clients and administration tools. %description client -l pt_BR Este pacote contém os clientes padrão para o MySQL. +%package ndb-storage +Release: %{release} +Summary: MySQL - ndbcluster storage engine +Group: Applications/Databases + +%description ndb-storage +This package contains the ndbcluster storage engine. +It is necessary to have this package installed on all +computers that should store ndbcluster table data. +Note that this storage engine can only be used in conjunction +with the MySQL Max server. + +%{see_base} + +%package ndb-management +Release: %{release} +Summary: MySQL - ndbcluster storage engine management +Group: Applications/Databases + +%description ndb-management +This package contains ndbcluster storage engine management. +It is necessary to have this package installed on at least +one computer in the cluster. + +%{see_base} + +%package ndb-tools +Release: %{release} +Summary: MySQL - ndbcluster storage engine basic tools +Group: Applications/Databases + +%description ndb-tools +This package contains ndbcluster storage engine basic tools. + +%{see_base} + +%package ndb-extra +Release: %{release} +Summary: MySQL - ndbcluster storage engine extra tools +Group: Applications/Databases + +%description ndb-extra +This package contains some extra ndbcluster storage engine tools for the advanced user. +They should be used with caution. + +%{see_base} + %package bench Release: %{release} Requires: %{name}-client perl-DBI perl @@ -162,6 +209,7 @@ Requires: MySQL-server >= 4.0 Optional MySQL server binary that supports additional features like: - Berkeley DB Storage Engine + - Ndbcluster Storage Engine interface - Archive Storage Engine - CSV Storage Engine - Example Storage Engine @@ -279,6 +327,7 @@ BuildMySQL "--enable-shared \ --without-openssl \ --with-berkeley-db \ --with-innodb \ + --with-ndbcluster \ --with-raid \ --with-archive \ --with-csv-storage-engine \ @@ -293,6 +342,9 @@ BuildMySQL "--enable-shared \ mv sql/mysqld sql/mysqld-max nm --numeric-sort sql/mysqld-max > sql/mysqld-max.sym +# Install the ndb binaries +(cd ndb; make install DESTDIR=$RBR) + # Install embedded server library in the build root install -m 644 libmysqld/libmysqld.a $RBR%{_libdir}/mysql/ @@ -435,6 +487,21 @@ chmod -R og-rw $mysql_datadir/mysql # Allow safe_mysqld to start mysqld and print a message before we exit sleep 2 + +%pre ndb-storage +mysql_clusterdir=/var/lib/mysql-cluster + +# Create cluster directory if needed +if test ! -d $mysql_clusterdir; then mkdir -m755 $mysql_clusterdir; fi + + +%pre ndb-storage +mysql_clusterdir=/var/lib/mysql-cluster + +# Create cluster directory if needed +if test ! -d $mysql_clusterdir; then mkdir -m755 $mysql_clusterdir; fi + + %post Max # Restart mysqld, to use the new binary. echo "Restarting mysqld." @@ -475,6 +542,7 @@ fi %doc Docs/manual.{html,ps,texi,txt} %doc Docs/manual_toc.html %doc support-files/my-*.cnf +%doc support-files/ndb-*.ini %doc %attr(644, root, root) %{_infodir}/mysql.info* @@ -556,6 +624,32 @@ fi %postun shared /sbin/ldconfig +%files ndb-storage +%defattr(-,root,root,0755) +%attr(755, root, root) %{_sbindir}/ndbd + +%files ndb-management +%defattr(-,root,root,0755) +%attr(755, root, root) %{_sbindir}/ndb_mgmd +%attr(755, root, root) %{_bindir}/ndb_mgm + +%files ndb-tools +%defattr(-,root,root,0755) +%attr(755, root, root) %{_bindir}/ndb_mgm +%attr(755, root, root) %{_bindir}/ndb_restore +%attr(755, root, root) %{_bindir}/ndb_waiter +%attr(755, root, root) %{_bindir}/ndb_select_all +%attr(755, root, root) %{_bindir}/ndb_select_count +%attr(755, root, root) %{_bindir}/ndb_desc +%attr(755, root, root) %{_bindir}/ndb_show_tables +%attr(755, root, root) %{_bindir}/ndb_test_platform + +%files ndb-extra +%defattr(-,root,root,0755) +%attr(755, root, root) %{_bindir}/ndb_drop_index +%attr(755, root, root) %{_bindir}/ndb_drop_table +%attr(755, root, root) %{_bindir}/ndb_delete_all + %files devel %defattr(-, root, root, 0755) %doc EXCEPTIONS-CLIENT diff --git a/support-files/ndb-config-2-node.ini b/support-files/ndb-config-2-node.ini new file mode 100644 index 00000000000..be80f1dd0b3 --- /dev/null +++ b/support-files/ndb-config-2-node.ini @@ -0,0 +1,43 @@ +# Example Ndbcluster storage engine config file. +# +[ndbd default] +NoOfReplicas= 2 +MaxNoOfConcurrentOperations= 10000 +DataMemory= 80M +IndexMemory= 24M +TimeBetweenWatchDogCheck= 30000 +DataDir= /var/lib/mysql-cluster +MaxNoOfOrderedIndexes= 512 + +[ndb_mgmd default] +DataDir= /var/lib/mysql-cluster + +[ndb_mgmd] +Id=1 +HostName= localhost + +[ndbd] +Id= 2 +HostName= localhost + +[ndbd] +Id= 3 +HostName= localhost + +[mysqld] +Id= 4 + +[mysqld] +Id= 5 + +[mysqld] +Id= 6 + +[mysqld] +Id= 7 + +# choose an unused port number +# in this configuration 63132, 63133, and 63134 +# will be used +[tcp default] +PortNumber= 63132 From e244a3a9b4a9d9fd9dad63338ead667cf4b9a959 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 3 Feb 2005 17:58:02 +0100 Subject: [PATCH 0915/1063] made an .sh file of ndb-config-2-node.ini instead support-files/ndb-config-2-node.ini.sh: Rename: support-files/ndb-config-2-node.ini -> support-files/ndb-config-2-node.ini.sh --- support-files/Makefile.am | 9 ++++++--- .../{ndb-config-2-node.ini => ndb-config-2-node.ini.sh} | 0 2 files changed, 6 insertions(+), 3 deletions(-) rename support-files/{ndb-config-2-node.ini => ndb-config-2-node.ini.sh} (100%) diff --git a/support-files/Makefile.am b/support-files/Makefile.am index 7ae1071f9ec..0a6077f0efc 100644 --- a/support-files/Makefile.am +++ b/support-files/Makefile.am @@ -27,7 +27,8 @@ EXTRA_DIST = mysql.spec.sh \ mysql.server.sh \ binary-configure.sh \ magic \ - MySQL-shared-compat.spec.sh + MySQL-shared-compat.spec.sh \ + ndb-config-2-node.ini.sh SUBDIRS = MacOSX @@ -38,7 +39,8 @@ pkgdata_DATA = my-small.cnf \ my-innodb-heavy-4G.cnf \ mysql-log-rotate \ mysql-@VERSION@.spec \ - MySQL-shared-compat.spec + MySQL-shared-compat.spec \ + ndb-config-2-node.ini pkgdata_SCRIPTS = mysql.server @@ -52,7 +54,8 @@ CLEANFILES = my-small.cnf \ mysql-log-rotate \ mysql.server \ binary-configure \ - MySQL-shared-compat.spec + MySQL-shared-compat.spec \ + ndb-config-2-node.ini mysql-@VERSION@.spec: mysql.spec rm -f $@ diff --git a/support-files/ndb-config-2-node.ini b/support-files/ndb-config-2-node.ini.sh similarity index 100% rename from support-files/ndb-config-2-node.ini rename to support-files/ndb-config-2-node.ini.sh From 567055363e69843feb8215c8cef0e832ceb472cf Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 3 Feb 2005 18:26:59 +0000 Subject: [PATCH 0916/1063] Bug#7310 Fix test for classic builds mysql-test/t/multi_update.test: Bug#7310 Ignore warnings for Bug#5837 test --- mysql-test/t/multi_update.test | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mysql-test/t/multi_update.test b/mysql-test/t/multi_update.test index 2d6770f77ed..2fc4ebcb275 100644 --- a/mysql-test/t/multi_update.test +++ b/mysql-test/t/multi_update.test @@ -340,8 +340,10 @@ drop table t1, t2; # Test for BUG#5837 - delete with outer join and const tables drop table if exists t2, t1; +--disable_warnings create table t1(aclid bigint not null primary key, status tinyint(1) not null ) type = innodb; create table t2(refid bigint not null primary key, aclid bigint, index idx_acl(aclid) )type = innodb; +--enable_warnings insert into t2 values(1,null); delete t2, t1 from t2 as a left join t1 as b on (a.aclid=b.aclid) where a.refid='1'; drop table t1, t2; From 044f9e8227d1aa1e41e83a3a89e162b429a6646b Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 3 Feb 2005 21:13:27 +0100 Subject: [PATCH 0917/1063] mysql-test-run.pl: Let --start-and-exit actually start a server Added that test case names can be specified on the comman line Added embedded server support Added environment variables UMASK, UMASK_DIR Added missing MASTER_MYSOCK1, MASTER_MYPORT1, USE_RUNNING_SERVER Added missing CHARSETSDIR, MYSQL_FIX_SYSTEM_TABLES, MYSQL_CLIENT_TEST Pass on return value from sleep_until_file_created(), to fail test Fail test if early termination of mysqld servers Create intial databases for the second master, and two additional slaves mtr_process.pl: Find out if port is still in use, using simple TCP connect Use non blocking waitpid() to catch terminations early Make a special case spawning the 'mysqltest' application Redo the fork() if it returns EAGAIN Make sure to record if master or slave terminated Improved debugging output Improved code that remove PID files to avoid race Abort if we can't stop all mysqld servers using our ports Many improvements in killing mysqld servers Let sleep_until_file_created() catch if server died early mtr_report.pl: Added option to disable test cases using .disabled file If --timer, only try to open file with time data if it exists mtr_io.pl: Remove starting/ending space reading server options from file mysql-test/lib/mtr_io.pl: Remove starting/ending space reading server options from file mysql-test/lib/mtr_report.pl: Added option to disable test cases using .disabled file If --timer, only try to open file with time data if it exists mysql-test/lib/mtr_process.pl: Find out if port is still in use, using simple TCP connect Use non blocking waitpid() to catch terminations early Make a special case spawning the 'mysqltest' application Redo the fork() if it returns EAGAIN Make sure to record if master or slave terminated Improved debugging output Improved code that remove PID files to avoid race Abort if we can't stop all mysqld servers using our ports Many improvements in killing mysqld servers Let sleep_until_file_created() catch if server died early mysql-test/mysql-test-run.pl: Let --start-and-exit actually start a server Added that test case names can be specified on the comman line Added embedded server support Added environment variables UMASK, UMASK_DIR Added missing MASTER_MYSOCK1, MASTER_MYPORT1, USE_RUNNING_SERVER Added missing CHARSETSDIR, MYSQL_FIX_SYSTEM_TABLES, MYSQL_CLIENT_TEST Pass on return value from sleep_until_file_created(), to fail test Fail test if early termination of mysqld servers Create intial databases for the second master, and two additional slaves --- mysql-test/lib/mtr_io.pl | 3 + mysql-test/lib/mtr_process.pl | 728 +++++++++++++++++++++++----------- mysql-test/lib/mtr_report.pl | 25 +- mysql-test/mysql-test-run.pl | 459 +++++++++------------ 4 files changed, 696 insertions(+), 519 deletions(-) diff --git a/mysql-test/lib/mtr_io.pl b/mysql-test/lib/mtr_io.pl index 017ba11645b..b3da6d97664 100644 --- a/mysql-test/lib/mtr_io.pl +++ b/mysql-test/lib/mtr_io.pl @@ -8,6 +8,7 @@ use strict; sub mtr_get_pid_from_file ($); sub mtr_get_opts_from_file ($); +sub mtr_fromfile ($); sub mtr_tofile ($@); sub mtr_tonewfile($@); @@ -107,6 +108,8 @@ sub mtr_fromfile ($) { open(FILE,"<",$file) or mtr_error("can't open file \"$file\": $!"); my $text= join('', ); close FILE; + $text =~ s/^\s+//; # Remove starting space, incl newlines + $text =~ s/\s+$//; # Remove ending space, incl newlines return $text; } diff --git a/mysql-test/lib/mtr_process.pl b/mysql-test/lib/mtr_process.pl index e832468d0cb..e1461a9730c 100644 --- a/mysql-test/lib/mtr_process.pl +++ b/mysql-test/lib/mtr_process.pl @@ -5,14 +5,19 @@ # same name. #use Carp qw(cluck); +use Socket; +use Errno; use strict; -use POSIX ":sys_wait_h"; +#use POSIX ":sys_wait_h"; +use POSIX 'WNOHANG'; sub mtr_run ($$$$$$); sub mtr_spawn ($$$$$$); -sub mtr_stop_mysqld_servers ($$); +sub mtr_stop_mysqld_servers ($); sub mtr_kill_leftovers (); +sub mtr_record_dead_children (); +sub sleep_until_file_created ($$$); # static in C sub spawn_impl ($$$$$$$); @@ -34,7 +39,18 @@ sub mtr_run ($$$$$$) { my $error= shift; my $pid_file= shift; - return spawn_impl($path,$arg_list_t,1,$input,$output,$error,$pid_file); + return spawn_impl($path,$arg_list_t,'run',$input,$output,$error,$pid_file); +} + +sub mtr_run_test ($$$$$$) { + my $path= shift; + my $arg_list_t= shift; + my $input= shift; + my $output= shift; + my $error= shift; + my $pid_file= shift; + + return spawn_impl($path,$arg_list_t,'test',$input,$output,$error,$pid_file); } sub mtr_spawn ($$$$$$) { @@ -45,7 +61,7 @@ sub mtr_spawn ($$$$$$) { my $error= shift; my $pid_file= shift; - return spawn_impl($path,$arg_list_t,0,$input,$output,$error,$pid_file); + return spawn_impl($path,$arg_list_t,'spawn',$input,$output,$error,$pid_file); } @@ -58,7 +74,7 @@ sub mtr_spawn ($$$$$$) { sub spawn_impl ($$$$$$$) { my $path= shift; my $arg_list_t= shift; - my $join= shift; + my $mode= shift; my $input= shift; my $output= shift; my $error= shift; @@ -71,107 +87,203 @@ sub spawn_impl ($$$$$$$) { print STDERR "#### ", "STDIN $input\n" if $input; print STDERR "#### ", "STDOUT $output\n" if $output; print STDERR "#### ", "STDERR $error\n" if $error; - if ( $join ) - { - print STDERR "#### ", "RUN "; - } - else - { - print STDERR "#### ", "SPAWN "; - } - print STDERR "$path ", join(" ",@$arg_list_t), "\n"; + print STDERR "#### ", "$mode : $path ", join(" ",@$arg_list_t), "\n"; print STDERR "#### ", "-" x 78, "\n"; } - my $pid= fork(); - if ( ! defined $pid ) + FORK: { - mtr_error("$path ($pid) can't be forked"); - } + my $pid= fork(); - if ( $pid ) - { - # Parent, i.e. the main script - if ( $join ) + if ( ! defined $pid ) { - # We run a command and wait for the result - # FIXME this need to be improved - my $res= waitpid($pid,0); + if ( $! == $!{EAGAIN} ) # See "perldoc Errno" + { + mtr_debug("Got EAGAIN from fork(), sleep 1 second and redo"); + sleep(1); + redo FORK; + } + else + { + mtr_error("$path ($pid) can't be forked"); + } + } - if ( $res == -1 ) + if ( $pid ) + { + spawn_parent_impl($pid,$mode,$path); + } + else + { + # Child, redirect output and exec + # FIXME I tried POSIX::setsid() here to detach and, I hoped, + # avoid zombies. But everything went wild, somehow the parent + # became a deamon as well, and was hard to kill ;-) + # Need to catch SIGCHLD and do waitpid or something instead...... + + $SIG{INT}= 'DEFAULT'; # Parent do some stuff, we don't + + if ( $output ) + { + if ( ! open(STDOUT,">",$output) ) + { + mtr_error("can't redirect STDOUT to \"$output\": $!"); + } + } + if ( $error ) + { + if ( $output eq $error ) + { + if ( ! open(STDERR,">&STDOUT") ) + { + mtr_error("can't dup STDOUT: $!"); + } + } + else + { + if ( ! open(STDERR,">",$error) ) + { + mtr_error("can't redirect STDERR to \"$output\": $!"); + } + } + } + if ( $input ) + { + if ( ! open(STDIN,"<",$input) ) + { + mtr_error("can't redirect STDIN to \"$input\": $!"); + } + } + exec($path,@$arg_list_t); + } + } +} + + +sub spawn_parent_impl { + my $pid= shift; + my $mode= shift; + my $path= shift; + + if ( $mode eq 'run' or $mode eq 'test' ) + { + my $exit_value= -1; + my $signal_num= 0; + my $dumped_core= 0; + + if ( $mode eq 'run' ) + { + # Simple run of command, we wait for it to return + my $ret_pid= waitpid($pid,0); + + if ( $ret_pid <= 0 ) { mtr_error("$path ($pid) got lost somehow"); } - my $exit_value= $? >> 8; - my $signal_num= $? & 127; - my $dumped_core= $? & 128; - if ( $signal_num ) - { - mtr_error("$path ($pid) got signal $signal_num"); - } - if ( $dumped_core ) - { - mtr_error("$path ($pid) dumped core"); - } + + $exit_value= $? >> 8; + $signal_num= $? & 127; + $dumped_core= $? & 128; + return $exit_value; } else { - # We spawned a process we don't wait for - return $pid; + # We run mysqltest and wait for it to return. But we try to + # catch dying mysqld processes as well. + # + # We do blocking waitpid() until we get the return from the + # "mysqltest" call. But if a mysqld process dies that we + # started, we take this as an error, and kill mysqltest. + # + # FIXME is this as it should be? Can't mysqld terminate + # normally from running a test case? + + my $ret_pid; # What waitpid() returns + + while ( ($ret_pid= waitpid(-1,0)) != -1 ) + { + # Someone terminated, don't know who. Collect + # status info first before $? is lost, + # but not $exit_value, this is flagged from + # + + if ( $ret_pid == $pid ) + { + # We got termination of mysqltest, we are done + $exit_value= $? >> 8; + $signal_num= $? & 127; + $dumped_core= $? & 128; + last; + } + + # If one of the mysqld processes died, we want to + # mark this, and kill the mysqltest process. + + foreach my $idx (0..1) + { + if ( $::master->[$idx]->{'pid'} eq $ret_pid ) + { + mtr_debug("child $ret_pid was master[$idx], " . + "exit during mysqltest run"); + $::master->[$idx]->{'pid'}= 0; + last; + } + } + + foreach my $idx (0..2) + { + if ( $::slave->[$idx]->{'pid'} eq $ret_pid ) + { + mtr_debug("child $ret_pid was slave[$idx], " . + "exit during mysqltest run"); + $::slave->[$idx]->{'pid'}= 0; + last; + } + } + + mtr_debug("waitpid() catched exit of unknown child $ret_pid, " . + "exit during mysqltest run"); + } + + if ( $ret_pid != $pid ) + { + # We terminated the waiting because a "mysqld" process died. + # Kill the mysqltest process. + + kill(9,$pid); + + $ret_pid= waitpid($pid,0); + + if ( $ret_pid == -1 ) + { + mtr_error("$path ($pid) got lost somehow"); + } + } + + return $exit_value; } } else { - # Child, redirect output and exec - # FIXME I tried POSIX::setsid() here to detach and, I hoped, - # avoid zombies. But everything went wild, somehow the parent - # became a deamon as well, and was hard to kill ;-) - # Need to catch SIGCHLD and do waitpid or something instead...... - - $SIG{INT}= 'DEFAULT'; # Parent do some stuff, we don't - - if ( $output ) - { - if ( ! open(STDOUT,">",$output) ) - { - mtr_error("can't redirect STDOUT to \"$output\": $!"); - } - } - if ( $error ) - { - if ( $output eq $error ) - { - if ( ! open(STDERR,">&STDOUT") ) - { - mtr_error("can't dup STDOUT: $!"); - } - } - else - { - if ( ! open(STDERR,">",$error) ) - { - mtr_error("can't redirect STDERR to \"$output\": $!"); - } - } - } - if ( $input ) - { - if ( ! open(STDIN,"<",$input) ) - { - mtr_error("can't redirect STDIN to \"$input\": $!"); - } - } - exec($path,@$arg_list_t); + # We spawned a process we don't wait for + return $pid; } } + + ############################################################################## # # Kill processes left from previous runs # ############################################################################## +# We just "ping" on the ports, and if we can't do a socket connect +# we assume the server is dead. So we don't *really* know a server +# is dead, we just hope that it after letting the listen port go, +# it is dead enough for us to start a new server. + sub mtr_kill_leftovers () { # First, kill all masters and slaves that would conflict with @@ -199,10 +311,23 @@ sub mtr_kill_leftovers () { }); } - mtr_stop_mysqld_servers(\@args, 1); + mtr_mysqladmin_shutdown(\@args); + + # We now have tried to terminate nice. We have waited for the listen + # port to be free, but can't really tell if the mysqld process died + # or not. We now try to find the process PID from the PID file, and + # send a kill to that process. Note that Perl let kill(0,@pids) be + # a way to just return the numer of processes the kernel can send + # signals to. So this can be used (except on Cygwin) to determine + # if there are processes left running that we cound out might exists. + # + # But still after all this work, all we know is that we have + # the ports free. # We scan the "var/run/" directory for other process id's to kill - my $rundir= "$::glob_mysql_test_dir/var/run"; # FIXME $path_run_dir or something + + # FIXME $path_run_dir or something + my $rundir= "$::glob_mysql_test_dir/var/run"; if ( -d $rundir ) { @@ -218,193 +343,157 @@ sub mtr_kill_leftovers () { if ( -f $pidfile ) { my $pid= mtr_get_pid_from_file($pidfile); - if ( ! unlink($pidfile) ) + + # Race, could have been removed between I tested with -f + # and the unlink() below, so I better check again with -f + + if ( ! unlink($pidfile) and -f $pidfile ) { mtr_error("can't remove $pidfile"); } - push(@pids, $pid); + + if ( $::glob_cygwin_perl or kill(0, $pid) ) + { + push(@pids, $pid); # We know (cygwin guess) it exists + } } } closedir(RUNDIR); - start_reap_all(); - - if ( $::glob_cygwin_perl ) + if ( @pids ) { - # We have no (easy) way of knowing the Cygwin controlling - # process, in the PID file we only have the Windows process id. - system("kill -f " . join(" ",@pids)); # Hope for the best.... - } - else - { - my $retries= 10; # 10 seconds - do + if ( $::glob_cygwin_perl ) { - kill(9, @pids); - } while ( $retries-- and kill(0, @pids) ); + # We have no (easy) way of knowing the Cygwin controlling + # process, in the PID file we only have the Windows process id. + system("kill -f " . join(" ",@pids)); # Hope for the best.... + mtr_debug("Sleep 5 seconds waiting for processes to die"); + sleep(5); + } + else + { + my $retries= 10; # 10 seconds + do + { + kill(9, @pids); + mtr_debug("Sleep 1 second waiting for processes to die"); + sleep(1) # Wait one second + } while ( $retries-- and kill(0, @pids) ); - if ( kill(0, @pids) ) - { - mtr_error("can't kill processes " . join(" ", @pids)); + if ( kill(0, @pids) ) # Check if some left + { + # FIXME maybe just mtr_warning() ? + mtr_error("can't kill process(es) " . join(" ", @pids)); + } } } + } - stop_reap_all(); + # We may have failed everything, bug we now check again if we have + # the listen ports free to use, and if they are free, just go for it. + + foreach my $srv ( @args ) + { + if ( mtr_ping_mysqld_server($srv->{'port'}, $srv->{'sockfile'}) ) + { + mtr_error("can't kill old mysqld holding port $srv->{'port'}"); + } } } ############################################################################## # -# Shut down mysqld servers +# Shut down mysqld servers we have started from this run of this script # ############################################################################## -# To speed things we kill servers in parallel. -# The argument is a list of 'pidfiles' and 'socketfiles'. -# We use the pidfiles and socketfiles to try to terminate the servers. -# This is not perfect, there could still be other server processes -# left. +# To speed things we kill servers in parallel. The argument is a list +# of 'ports', 'pids', 'pidfiles' and 'socketfiles'. -# Force flag is to be set only for killing mysqld servers this script -# didn't create in this run, i.e. initial cleanup before we start working. -# If force flag is set, we try to kill all with mysqladmin, and -# give up if we have no PIDs. +# FIXME On Cygwin, and maybe some other platforms, $srv->{'pid'} and +# $srv->{'pidfile'} will not be the same PID. We need to try to kill +# both I think. -# FIXME On some operating systems, $srv->{'pid'} and $srv->{'pidfile'} -# will not be the same PID. We need to try to kill both I think. - -sub mtr_stop_mysqld_servers ($$) { +sub mtr_stop_mysqld_servers ($) { my $spec= shift; - my $force= shift; # ---------------------------------------------------------------------- - # If the process was not started from this file, we got no PID, - # we try to find it in the PID file. + # First try nice normal shutdown using 'mysqladmin' # ---------------------------------------------------------------------- - my $any_pid= 0; # If we have any PIDs + mtr_mysqladmin_shutdown($spec); + + # ---------------------------------------------------------------------- + # We loop with waitpid() nonblocking to see how many of the ones we + # are to kill, actually got killed by mtr_mysqladmin_shutdown(). + # Note that we don't rely on this, the mysqld server might have stop + # listening to the port, but still be alive. But it is a start. + # ---------------------------------------------------------------------- foreach my $srv ( @$spec ) { - if ( ! $srv->{'pid'} and -f $srv->{'pidfile'} ) + if ( $srv->{'pid'} and (waitpid($srv->{'pid'},&WNOHANG) == $srv->{'pid'}) ) { - $srv->{'pid'}= mtr_get_pid_from_file($srv->{'pidfile'}); - } - if ( $srv->{'pid'} ) - { - $any_pid= 1; + $srv->{'pid'}= 0; } } - # If the processes where started from this script, and we know - # no PIDs, then we don't have to do anything. + # ---------------------------------------------------------------------- + # We know the process was started from this file, so there is a PID + # saved, or else we have nothing to do. + # Might be that is is recorded to be missing, but we failed to + # take away the PID file earlier, then we do it now. + # ---------------------------------------------------------------------- - if ( ! $any_pid and ! $force ) + my %mysqld_pids; + + foreach my $srv ( @$spec ) + { + if ( $srv->{'pid'} ) + { + $mysqld_pids{$srv->{'pid'}}= 1; + } + else + { + # Race, could have been removed between I tested with -f + # and the unlink() below, so I better check again with -f + + if ( -f $srv->{'pidfile'} and ! unlink($srv->{'pidfile'}) and + -f $srv->{'pidfile'} ) + { + mtr_error("can't remove $srv->{'pidfile'}"); + } + } + } + + # ---------------------------------------------------------------------- + # If the processes where started from this script, and we had no PIDS + # then we don't have to do anything. + # ---------------------------------------------------------------------- + + if ( ! keys %mysqld_pids ) { # cluck "This is how we got here!"; return; } # ---------------------------------------------------------------------- - # First try nice normal shutdown using 'mysqladmin' - # ---------------------------------------------------------------------- - - start_reap_all(); # Don't require waitpid() of children - - foreach my $srv ( @$spec ) - { - if ( -e $srv->{'sockfile'} or $srv->{'port'} ) - { - # FIXME wrong log..... - # FIXME, stderr..... - # Shutdown time must be high as slave may be in reconnect - my $args; - - mtr_init_args(\$args); - - mtr_add_arg($args, "--no-defaults"); - mtr_add_arg($args, "--user=%s", $::opt_user); - mtr_add_arg($args, "--password="); - if ( -e $srv->{'sockfile'} ) - { - mtr_add_arg($args, "--socket=%s", $srv->{'sockfile'}); - } - if ( $srv->{'port'} ) - { - mtr_add_arg($args, "--port=%s", $srv->{'port'}); - } - mtr_add_arg($args, "--connect_timeout=5"); - mtr_add_arg($args, "--shutdown_timeout=20"); - mtr_add_arg($args, "--protocol=tcp"); # FIXME new thing, will it help?! - mtr_add_arg($args, "shutdown"); - # We don't wait for termination of mysqladmin - mtr_spawn($::exe_mysqladmin, $args, - "", $::path_manager_log, $::path_manager_log, ""); - } - } - - # Wait for them all to remove their pid and socket file - - PIDSOCKFILEREMOVED: - for (my $loop= $::opt_sleep_time_for_delete; $loop; $loop--) - { - my $pidsockfiles_left= 0; - foreach my $srv ( @$spec ) - { - if ( -e $srv->{'sockfile'} or -f $srv->{'pidfile'} ) - { - $pidsockfiles_left++; # Could be that pidfile is left - } - } - if ( ! $pidsockfiles_left ) - { - last PIDSOCKFILEREMOVED; - } - if ( $loop % 20 == 1 ) - { - mtr_warning("Still processes alive after 10 seconds, retrying for $loop seconds..."); - } - mtr_debug("Sleep for 1 second waiting for pid and socket file removal"); - sleep(1); # One second - } - - # ---------------------------------------------------------------------- - # If no known PIDs, we have nothing more to try - # ---------------------------------------------------------------------- - - if ( ! $any_pid ) - { - stop_reap_all(); - return; - } - - # ---------------------------------------------------------------------- - # We may have killed all that left a socket, but we are not sure we got - # them all killed. If we suspect it lives, try nice kill with SIG_TERM. - # Note that for true Win32 processes, kill(0,$pid) will not return 1. + # In mtr_mysqladmin_shutdown() we only waited for the mysqld servers + # not to listen to the port. But we are not sure we got them all + # killed. If we suspect it lives, try nice kill with SIG_TERM. Note + # that for true Win32 processes, kill(0,$pid) will not return 1. # ---------------------------------------------------------------------- SIGNAL: foreach my $sig (15,9) { - my $process_left= 0; - foreach my $srv ( @$spec ) + my $retries= 10; # 10 seconds + kill($sig, keys %mysqld_pids); + while ( $retries-- and kill(0, keys %mysqld_pids) ) { - if ( $srv->{'pid'} and - ( -f $srv->{'pidfile'} or kill(0,$srv->{'pid'}) ) ) - { - $process_left++; - mtr_warning("process $srv->{'pid'} not cooperating, " . - "will send signal $sig to process"); - kill($sig,$srv->{'pid'}); # SIG_TERM - } - if ( ! $process_left ) - { - last SIGNAL; - } + mtr_debug("Sleep 1 second waiting for processes to die"); + sleep(1) # Wait one second } - mtr_debug("Sleep for 5 seconds waiting for processes to die"); - sleep(5); # We wait longer than usual } # ---------------------------------------------------------------------- @@ -437,8 +526,8 @@ sub mtr_stop_mysqld_servers ($$) { foreach my $file ($srv->{'pidfile'}, $srv->{'sockfile'}) { - unlink($file); - if ( -e $file ) + # Know it is dead so should be no race, careful anyway + if ( -f $file and ! unlink($file) and -f $file ) { $errors++; mtr_warning("couldn't delete $file"); @@ -454,9 +543,147 @@ sub mtr_stop_mysqld_servers ($$) { } } - stop_reap_all(); + # FIXME We just assume they are all dead, for Cygwin we are not + # really sure + +} - # FIXME We just assume they are all dead, we don't know.... + +############################################################################## +# +# Shut down mysqld servers using "mysqladmin ... shutdown". +# To speed this up, we start them in parallel and use waitpid() to +# catch their termination. Note that this doesn't say the servers +# are terminated, just that 'mysqladmin' is terminated. +# +# Note that mysqladmin will ask the server about what PID file it uses, +# and mysqladmin will wait for it to be removed before it terminates +# (unless passes timeout). +# +# This function will take at most about 20 seconds, and we still are not +# sure we killed them all. If none is responding to ping, we return 1, +# else we return 0. +# +############################################################################## + +sub mtr_mysqladmin_shutdown () { + my $spec= shift; + + my @mysql_admin_pids; + my @to_kill_specs; + + foreach my $srv ( @$spec ) + { + if ( mtr_ping_mysqld_server($srv->{'port'}, $srv->{'sockfile'}) ) + { + push(@to_kill_specs, $srv); + } + } + + + foreach my $srv ( @to_kill_specs ) + { + # FIXME wrong log..... + # FIXME, stderr..... + # Shutdown time must be high as slave may be in reconnect + my $args; + + mtr_init_args(\$args); + + mtr_add_arg($args, "--no-defaults"); + mtr_add_arg($args, "--user=%s", $::opt_user); + mtr_add_arg($args, "--password="); + if ( -e $srv->{'sockfile'} ) + { + mtr_add_arg($args, "--socket=%s", $srv->{'sockfile'}); + } + if ( $srv->{'port'} ) + { + mtr_add_arg($args, "--port=%s", $srv->{'port'}); + } + if ( $srv->{'port'} and ! -e $srv->{'sockfile'} ) + { + mtr_add_arg($args, "--protocol=tcp"); # Needed if no --socket + } + mtr_add_arg($args, "--connect_timeout=5"); + mtr_add_arg($args, "--shutdown_timeout=20"); + mtr_add_arg($args, "shutdown"); + # We don't wait for termination of mysqladmin + my $pid= mtr_spawn($::exe_mysqladmin, $args, + "", $::path_manager_log, $::path_manager_log, ""); + push(@mysql_admin_pids, $pid); + } + + # We wait blocking, we wait for the last one anyway + foreach my $pid (@mysql_admin_pids) + { + waitpid($pid,0); # FIXME no need to check -1 or 0? + } + + # If we trusted "mysqladmin --shutdown_timeout= ..." we could just + # terminate now, but we don't (FIXME should be debugged). + # So we try again to ping and at least wait the same amount of time + # mysqladmin would for all to die. + + my $timeout= 20; # 20 seconds max + my $res= 1; # If we just fall through, we are done + + TIME: + while ( $timeout-- ) + { + foreach my $srv ( @to_kill_specs ) + { + $res= 1; # We are optimistic + if ( mtr_ping_mysqld_server($srv->{'port'}, $srv->{'sockfile'}) ) + { + mtr_debug("Sleep 1 second waiting for processes to stop using port"); + sleep(1); # One second + $res= 0; + next TIME; + } + } + last; # If we got here, we are done + } + + return $res; +} + +############################################################################## +# +# The operating system will keep information about dead children, +# we read this information here, and if we have records the process +# is alive, we mark it as dead. +# +############################################################################## + +sub mtr_record_dead_children () { + + my $ret_pid; + + # FIXME the man page says to wait for -1 to terminate, + # but on OS X we get '0' all the time... + while ( ($ret_pid= waitpid(-1,&WNOHANG)) > 0 ) + { + mtr_debug("waitpid() catched exit of child $ret_pid"); + foreach my $idx (0..1) + { + if ( $::master->[$idx]->{'pid'} eq $ret_pid ) + { + mtr_debug("child $ret_pid was master[$idx]"); + $::master->[$idx]->{'pid'}= 0; + } + } + + foreach my $idx (0..2) + { + if ( $::slave->[$idx]->{'pid'} eq $ret_pid ) + { + mtr_debug("child $ret_pid was slave[$idx]"); + $::slave->[$idx]->{'pid'}= 0; + last; + } + } + } } sub start_reap_all { @@ -467,6 +694,32 @@ sub stop_reap_all { $SIG{CHLD}= 'DEFAULT'; } +sub mtr_ping_mysqld_server () { + my $port= shift; + + my $remote= "localhost"; + my $iaddr= inet_aton($remote); + if ( ! $iaddr ) + { + mtr_error("can't find IP number for $remote"); + } + my $paddr= sockaddr_in($port, $iaddr); + my $proto= getprotobyname('tcp'); + if ( ! socket(SOCK, PF_INET, SOCK_STREAM, $proto) ) + { + mtr_error("can't create socket: $!"); + } + if ( connect(SOCK, $paddr) ) + { + close(SOCK); # FIXME check error? + return 1; + } + else + { + return 0; + } +} + ############################################################################## # # Wait for a file to be created @@ -474,33 +727,38 @@ sub stop_reap_all { ############################################################################## -sub sleep_until_file_created ($$) { +sub sleep_until_file_created ($$$) { my $pidfile= shift; my $timeout= shift; + my $pid= shift; - my $loop= $timeout; - while ( $loop-- ) + for ( my $loop= 1; $loop <= $timeout; $loop++ ) { if ( -r $pidfile ) { - return; + return 1; } - mtr_debug("Sleep for 1 second waiting for creation of $pidfile"); - if ( $loop % 20 == 1 ) + # Check if it died after the fork() was successful + if ( waitpid($pid,&WNOHANG) == $pid ) { - mtr_warning("Waiting for $pidfile to be created, still trying for $loop seconds..."); + return 0; + } + + mtr_debug("Sleep 1 second waiting for creation of $pidfile"); + + if ( $loop % 60 == 0 ) + { + my $left= $timeout - $loop; + mtr_warning("Waited $loop seconds for $pidfile to be created, " . + "still waiting for $left seconds..."); } sleep(1); } - if ( ! -r $pidfile ) - { - mtr_error("No $pidfile was created"); - } + return 0; } - 1; diff --git a/mysql-test/lib/mtr_report.pl b/mysql-test/lib/mtr_report.pl index 0f75fc1341a..c45bb1601ce 100644 --- a/mysql-test/lib/mtr_report.pl +++ b/mysql-test/lib/mtr_report.pl @@ -10,6 +10,7 @@ sub mtr_report_test_name($); sub mtr_report_test_passed($); sub mtr_report_test_failed($); sub mtr_report_test_skipped($); +sub mtr_report_test_disabled($); sub mtr_show_failed_diff ($); sub mtr_report_stats ($); @@ -72,7 +73,14 @@ sub mtr_report_test_skipped ($) { my $tinfo= shift; $tinfo->{'result'}= 'MTR_RES_SKIPPED'; - print "[ skipped ]\n"; + if ( $tinfo->{'disable'} ) + { + print "[ disabled ] $tinfo->{'comment'}\n"; + } + else + { + print "[ skipped ]\n"; + } } sub mtr_report_test_passed ($) { @@ -95,9 +103,18 @@ sub mtr_report_test_failed ($) { $tinfo->{'result'}= 'MTR_RES_FAILED'; print "[ fail ]\n"; - print "Errors are (from $::path_timefile) :\n"; - print mtr_fromfile($::path_timefile); # FIXME print_file() instead - print "\n(the last lines may be the most important ones)\n"; + # FIXME Instead of this test, and meaningless error message in 'else' + # we should write out into $::path_timefile when the error occurs. + if ( -f $::path_timefile ) + { + print "Errors are (from $::path_timefile) :\n"; + print mtr_fromfile($::path_timefile); # FIXME print_file() instead + print "\n(the last lines may be the most important ones)\n"; + } + else + { + print "Unexpected termination, probably when starting mysqld\n"; + } } sub mtr_report_stats ($) { diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 3bbdb48d98a..3dd6f5803d7 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -84,10 +84,11 @@ use Sys::Hostname; #use Carp; use IO::Socket; use IO::Socket::INET; -use Data::Dumper; +#use Data::Dumper; use strict; #use diagnostics; +require "lib/mtr_cases.pl"; require "lib/mtr_process.pl"; require "lib/mtr_io.pl"; require "lib/mtr_gcov.pl"; @@ -165,14 +166,12 @@ our $glob_user= 'test'; our $glob_use_embedded_server= 0; our $glob_basedir; -our $glob_do_test; # The total result our $path_charsetsdir; our $path_client_bindir; our $path_language; -our $path_tests_bindir; our $path_timefile; our $path_manager_log; # Used by mysqldadmin our $path_slave_load_tmpdir; # What is this?! @@ -192,8 +191,10 @@ our $exe_master_mysqld; our $exe_mysql; our $exe_mysqladmin; our $exe_mysqlbinlog; +our $exe_mysql_client_test; our $exe_mysqld; our $exe_mysqldump; # Called from test case +our $exe_mysql_fix_system_tables; our $exe_mysqltest; our $exe_slave_mysqld; @@ -208,6 +209,7 @@ our $opt_current_test; our $opt_ddd; our $opt_debug; our $opt_do_test; +our @opt_cases; # The test cases names in argv our $opt_embedded_server; our $opt_extern; our $opt_fast; @@ -232,8 +234,6 @@ our $opt_local_master; our $master; # Will be struct in C our $slave; -our $opt_master_myport; -our $opt_slave_myport; our $opt_ndbcluster_port; our $opt_ndbconnectstring; @@ -297,8 +297,6 @@ sub command_line_setup (); sub executable_setup (); sub environment_setup (); sub kill_and_cleanup (); -sub collect_test_cases ($); -sub sleep_until_file_created ($$); sub ndbcluster_start (); sub ndbcluster_stop (); sub run_benchmarks ($); @@ -306,6 +304,7 @@ sub run_tests (); sub mysql_install_db (); sub install_db ($$); sub run_testcase ($); +sub report_failure_and_restart ($); sub do_before_start_master ($$); sub do_before_start_slave ($$); sub mysqld_start ($$$$); @@ -358,7 +357,15 @@ sub main () { if ( $opt_start_and_exit ) { - mtr_report("Servers started, exiting"); + # FIXME what about ndb? + if ( mysqld_start('master',0,[],[]) ) + { + mtr_report("Servers started, exiting"); + } + else + { + mtr_error("Can't start the mysqld server"); + } } else { @@ -447,8 +454,8 @@ sub command_line_setup () { $path_manager_log= "$glob_mysql_test_dir/var/log/manager.log"; $opt_current_test= "$glob_mysql_test_dir/var/log/current_test"; - $opt_master_myport= 9306; - $opt_slave_myport= 9308; + my $opt_master_myport= 9306; + my $opt_slave_myport= 9308; $opt_ndbcluster_port= 9350; # Read the command line @@ -532,6 +539,8 @@ sub command_line_setup () { usage(""); } + @opt_cases= @ARGV; + # Put this into a hash, will be a C struct $master->[0]->{'path_myddir'}= "$glob_mysql_test_dir/var/master-data"; @@ -598,7 +607,7 @@ sub command_line_setup () { # Look at the command line options and set script flags # -------------------------------------------------------------------------- - if ( $opt_record and ! @ARGV) + if ( $opt_record and ! @opt_cases ) { mtr_error("Will not run in record mode without a specific test case"); } @@ -733,7 +742,8 @@ sub executable_setup () { { mtr_error("Can't find embedded server 'mysqltest'"); } - $path_tests_bindir= "$glob_basedir/libmysqld/examples"; + $exe_mysql_client_test= + "$glob_basedir/libmysqld/examples/mysql_client_test_embedded"; } else { @@ -749,7 +759,8 @@ sub executable_setup () { { $exe_mysqltest= "$glob_basedir/client/mysqltest"; } - $path_tests_bindir= "$glob_basedir/tests"; + $exe_mysql_client_test= + "$glob_basedir/tests/mysql_client_test"; } if ( -f "$glob_basedir/client/.libs/mysqldump" ) { @@ -768,22 +779,26 @@ sub executable_setup () { $exe_mysqlbinlog= "$glob_basedir/client/mysqlbinlog"; } - $exe_mysqld= "$glob_basedir/sql/mysqld"; - $path_client_bindir= "$glob_basedir/client"; - $exe_mysqladmin= "$path_client_bindir/mysqladmin"; - $exe_mysql= "$path_client_bindir/mysql"; - $path_language= "$glob_basedir/sql/share/english/"; - $path_charsetsdir= "$glob_basedir/sql/share/charsets"; + $path_client_bindir= "$glob_basedir/client"; + $exe_mysqld= "$glob_basedir/sql/mysqld"; + $exe_mysqladmin= "$path_client_bindir/mysqladmin"; + $exe_mysql= "$path_client_bindir/mysql"; + $exe_mysql_fix_system_tables= "$glob_basedir/scripts/mysql_fix_privilege_tables"; + $path_language= "$glob_basedir/sql/share/english/"; + $path_charsetsdir= "$glob_basedir/sql/share/charsets"; } else { - $path_client_bindir= "$glob_basedir/bin"; - $path_tests_bindir= "$glob_basedir/tests"; - $exe_mysqltest= "$path_client_bindir/mysqltest"; - $exe_mysqldump= "$path_client_bindir/mysqldump"; - $exe_mysqlbinlog= "$path_client_bindir/mysqlbinlog"; - $exe_mysqladmin= "$path_client_bindir/mysqladmin"; - $exe_mysql= "$path_client_bindir/mysql"; + my $path_tests_bindir= "$glob_basedir/tests"; + + $path_client_bindir= "$glob_basedir/bin"; + $exe_mysqltest= "$path_client_bindir/mysqltest"; + $exe_mysqldump= "$path_client_bindir/mysqldump"; + $exe_mysqlbinlog= "$path_client_bindir/mysqlbinlog"; + $exe_mysqladmin= "$path_client_bindir/mysqladmin"; + $exe_mysql= "$path_client_bindir/mysql"; + $exe_mysql_fix_system_tables= "$path_client_bindir/scripts/mysql_fix_privilege_tables"; + if ( -d "$glob_basedir/share/mysql/english" ) { $path_language ="$glob_basedir/share/mysql/english/"; @@ -804,6 +819,33 @@ sub executable_setup () { $exe_mysqld= "$glob_basedir/bin/mysqld"; } + if ( $glob_use_embedded_server ) + { + if ( -f "$path_client_bindir/mysqltest_embedded" ) + { + # FIXME valgrind? + $exe_mysqltest="$path_client_bindir/mysqltest_embedded"; + } + else + { + error("Cannot find embedded server 'mysqltest_embedded'"); + } + if ( -d "$path_tests_bindir/mysql_client_test_embedded" ) + { + $exe_mysql_client_test= + "$path_tests_bindir/mysql_client_test_embedded"; + } + else + { + $exe_mysql_client_test= + "$path_client_bindir/mysql_client_test_embedded"; + } + } + else + { + $exe_mysqltest="$path_client_bindir/mysqltest"; + $exe_mysql_client_test="$path_client_bindir/mysql_client_test"; + } } # FIXME special $exe_master_mysqld and $exe_slave_mysqld @@ -846,13 +888,18 @@ sub environment_setup () { # Also command lines in .opt files may contain env vars # -------------------------------------------------------------------------- - $ENV{'LC_COLLATE'}= "C"; - $ENV{'MYSQL_TEST_DIR'}= $glob_mysql_test_dir; - $ENV{'MASTER_MYPORT'}= $opt_master_myport; - $ENV{'SLAVE_MYPORT'}= $opt_slave_myport; -# $ENV{'MYSQL_TCP_PORT'}= '@MYSQL_TCP_PORT@'; # FIXME - $ENV{'MYSQL_TCP_PORT'}= 3306; - $ENV{'MASTER_MYSOCK'}= $master->[0]->{'path_mysock'}; + $ENV{'UMASK'}= "0660"; # The octal *string* + $ENV{'UMASK_DIR'}= "0770"; # The octal *string* + $ENV{'LC_COLLATE'}= "C"; + $ENV{'USE_RUNNING_SERVER'}= $glob_use_running_server; + $ENV{'MYSQL_TEST_DIR'}= $glob_mysql_test_dir; + $ENV{'MASTER_MYSOCK'}= $master->[0]->{'path_mysock'}; + $ENV{'MASTER_MYSOCK1'}= $master->[1]->{'path_mysock'}; + $ENV{'MASTER_MYPORT'}= $master->[0]->{'path_myport'}; + $ENV{'MASTER_MYPORT1'}= $master->[1]->{'path_myport'}; + $ENV{'SLAVE_MYPORT'}= $slave->[0]->{'path_myport'}; +# $ENV{'MYSQL_TCP_PORT'}= '@MYSQL_TCP_PORT@'; # FIXME + $ENV{'MYSQL_TCP_PORT'}= 3306; } @@ -875,203 +922,6 @@ sub handle_int_signal () { } -############################################################################## -# -# Collect information about test cases we are to run -# -############################################################################## - -sub collect_test_cases ($) { - my $suite= shift; # Test suite name - - my $testdir; - my $resdir; - - if ( $suite eq "main" ) - { - $testdir= "$glob_mysql_test_dir/t"; - $resdir= "$glob_mysql_test_dir/r"; - } - else - { - $testdir= "$glob_mysql_test_dir/suite/$suite/t"; - $resdir= "$glob_mysql_test_dir/suite/$suite/r"; - } - - my @tests; # Array of hash, will be array of C struct - - opendir(TESTDIR, $testdir) or mtr_error("Can't open dir \"$testdir\": $!"); - - foreach my $elem ( sort readdir(TESTDIR) ) { - my $tname= mtr_match_extension($elem,"test"); - next if ! defined $tname; - next if $opt_do_test and ! defined mtr_match_prefix($elem,$opt_do_test); - my $path= "$testdir/$elem"; - - # ---------------------------------------------------------------------- - # Skip some tests silently - # ---------------------------------------------------------------------- - - if ( $opt_start_from and $tname lt $opt_start_from ) - { - next; - } - - # ---------------------------------------------------------------------- - # Skip some tests but include in list, just mark them to skip - # ---------------------------------------------------------------------- - - my $tinfo= {}; - $tinfo->{'name'}= $tname; - $tinfo->{'result_file'}= "$resdir/$tname.result"; - push(@tests, $tinfo); - - if ( $opt_skip_test and defined mtr_match_prefix($tname,$opt_skip_test) ) - { - $tinfo->{'skip'}= 1; - next; - } - - # FIXME temporary solution, we have a hard coded list of test cases to - # skip if we are using the embedded server - - if ( $glob_use_embedded_server and - mtr_match_any_exact($tname,\@skip_if_embedded_server) ) - { - $tinfo->{'skip'}= 1; - next; - } - - # ---------------------------------------------------------------------- - # Collect information about test case - # ---------------------------------------------------------------------- - - $tinfo->{'path'}= $path; - $tinfo->{'timezone'}= "GMT-3"; # for UNIX_TIMESTAMP tests to work - - if ( defined mtr_match_prefix($tname,"rpl") ) - { - if ( $opt_skip_rpl ) - { - $tinfo->{'skip'}= 1; - next; - } - - # FIXME currently we always restart slaves - $tinfo->{'slave_restart'}= 1; - - if ( $tname eq 'rpl_failsafe' or $tname eq 'rpl_chain_temp_table' ) - { - $tinfo->{'slave_num'}= 3; - } - else - { - $tinfo->{'slave_num'}= 1; - } - } - - # FIXME what about embedded_server + ndbcluster, skip ?! - - my $master_opt_file= "$testdir/$tname-master.opt"; - my $slave_opt_file= "$testdir/$tname-slave.opt"; - my $slave_mi_file= "$testdir/$tname.slave-mi"; - my $master_sh= "$testdir/$tname-master.sh"; - my $slave_sh= "$testdir/$tname-slave.sh"; - - if ( -f $master_opt_file ) - { - $tinfo->{'master_restart'}= 1; # We think so for now - # This is a dirty hack from old mysql-test-run, we use the opt file - # to flag other things as well, it is not a opt list at all - my $extra_master_opt= mtr_get_opts_from_file($master_opt_file); - - foreach my $opt (@$extra_master_opt) - { - my $value; - - $value= mtr_match_prefix($opt, "--timezone="); - - if ( defined $value ) - { - $tinfo->{'timezone'}= $value; - $extra_master_opt= []; - $tinfo->{'master_restart'}= 0; - last; - } - - $value= mtr_match_prefix($opt, "--result-file="); - - if ( defined $value ) - { - $tinfo->{'result_file'}= "r/$value.result"; - if ( $opt_result_ext and $opt_record or - -f "$tinfo->{'result_file'}$opt_result_ext") - { - $tinfo->{'result_file'}.= $opt_result_ext; - } - $extra_master_opt= []; - $tinfo->{'master_restart'}= 0; - last; - } - } - - $tinfo->{'master_opt'}= $extra_master_opt; - } - - if ( -f $slave_opt_file ) - { - $tinfo->{'slave_opt'}= mtr_get_opts_from_file($slave_opt_file); - $tinfo->{'slave_restart'}= 1; - } - - if ( -f $slave_mi_file ) - { - $tinfo->{'slave_mi'}= mtr_get_opts_from_file($slave_mi_file); - $tinfo->{'slave_restart'}= 1; - } - - if ( -f $master_sh ) - { - if ( $glob_win32_perl ) - { - $tinfo->{'skip'}= 1; - } - else - { - $tinfo->{'master_sh'}= $master_sh; - $tinfo->{'master_restart'}= 1; - } - } - - if ( -f $slave_sh ) - { - if ( $glob_win32_perl ) - { - $tinfo->{'skip'}= 1; - } - else - { - $tinfo->{'slave_sh'}= $slave_sh; - $tinfo->{'slave_restart'}= 1; - } - } - - # We can't restart a running server that may be in use - - if ( $glob_use_running_server and - ( $tinfo->{'master_restart'} or $tinfo->{'slave_restart'} ) ) - { - $tinfo->{'skip'}= 1; - } - - } - - closedir TESTDIR; - - return \@tests; -} - - ############################################################################## # # Handle left overs from previous runs @@ -1189,6 +1039,10 @@ sub run_benchmarks ($) { if ( ! $glob_use_embedded_server and ! $opt_local_master ) { $master->[0]->{'pid'}= mysqld_start('master',0,[],[]); + if ( ! $master->[0]->{'pid'} ) + { + mtr_error("Can't start the mysqld server"); + } } mtr_init_args(\$args); @@ -1254,7 +1108,7 @@ sub run_suite () { mtr_print_thick_line(); - mtr_report("Finding Tests in the '$suite' suite"); + mtr_report("Finding Tests in the '$suite' suite"); my $tests= collect_test_cases($suite); @@ -1301,10 +1155,12 @@ sub run_suite () { sub mysql_install_db () { - mtr_report("Installing Test Databases"); - + # FIXME not exactly true I think, needs improvements install_db('master', $master->[0]->{'path_myddir'}); + install_db('master', $master->[1]->{'path_myddir'}); install_db('slave', $slave->[0]->{'path_myddir'}); + install_db('slave', $slave->[1]->{'path_myddir'}); + install_db('slave', $slave->[2]->{'path_myddir'}); return 0; } @@ -1422,6 +1278,12 @@ sub run_testcase ($) { mtr_tofile($master->[0]->{'path_myerr'},"CURRENT_TEST: $tname\n"); do_before_start_master($tname,$tinfo->{'master_sh'}); + # ---------------------------------------------------------------------- + # If any mysqld servers running died, we have to know + # ---------------------------------------------------------------------- + + mtr_record_dead_children(); + # ---------------------------------------------------------------------- # Start masters # ---------------------------------------------------------------------- @@ -1439,14 +1301,24 @@ sub run_testcase ($) { { $master->[0]->{'pid'}= mysqld_start('master',0,$tinfo->{'master_opt'},[]); + if ( ! $master->[0]->{'pid'} ) + { + report_failure_and_restart($tinfo); + return; + } } if ( $opt_with_ndbcluster and ! $master->[1]->{'pid'} ) { $master->[1]->{'pid'}= mysqld_start('master',1,$tinfo->{'master_opt'},[]); + if ( ! $master->[1]->{'pid'} ) + { + report_failure_and_restart($tinfo); + return; + } } - if ( $tinfo->{'master_opt'} ) + if ( @{$tinfo->{'master_opt'}} ) { $master->[0]->{'uses_special_flags'}= 1; } @@ -1469,6 +1341,11 @@ sub run_testcase ($) { $slave->[$idx]->{'pid'}= mysqld_start('slave',$idx, $tinfo->{'slave_opt'}, $tinfo->{'slave_mi'}); + if ( ! $slave->[$idx]->{'pid'} ) + { + report_failure_and_restart($tinfo); + return; + } } } } @@ -1502,33 +1379,40 @@ sub run_testcase ($) { "mysqltest returned unexpected code $res, " . "it has probably crashed"); } - mtr_report_test_failed($tinfo); - mtr_show_failed_diff($tname); - print "\n"; - if ( ! $opt_force ) - { - print "Aborting: $tname failed. To continue, re-run with '--force'."; - print "\n"; - if ( ! $opt_gdb and ! $glob_use_running_server and - ! $opt_ddd and ! $glob_use_embedded_server ) - { - stop_masters_slaves(); - } - exit(1); - } - - # FIXME always terminate on failure?! - if ( ! $opt_gdb and ! $glob_use_running_server and - ! $opt_ddd and ! $glob_use_embedded_server ) - { - stop_masters_slaves(); - } - print "Resuming Tests\n\n"; + report_failure_and_restart($tinfo); } } } +sub report_failure_and_restart ($) { + my $tinfo= shift; + + mtr_report_test_failed($tinfo); + mtr_show_failed_diff($tinfo->{'name'}); + print "\n"; + if ( ! $opt_force ) + { + print "Aborting: $tinfo->{'name'} failed. To continue, re-run with '--force'."; + print "\n"; + if ( ! $opt_gdb and ! $glob_use_running_server and + ! $opt_ddd and ! $glob_use_embedded_server ) + { + stop_masters_slaves(); + } + exit(1); + } + + # FIXME always terminate on failure?! + if ( ! $opt_gdb and ! $glob_use_running_server and + ! $opt_ddd and ! $glob_use_embedded_server ) + { + stop_masters_slaves(); + } + print "Resuming Tests\n\n"; +} + + ############################################################################## # # Start and stop servers @@ -1603,11 +1487,13 @@ sub do_before_start_slave ($$) { } sub mysqld_arguments ($$$$$) { - my $args= shift; - my $type= shift; # master/slave/bootstrap - my $idx= shift; - my $extra_opt= shift; - my $slave_master_info= shift; + my $args= shift; + my $type= shift; # master/slave/bootstrap + my $idx= shift; + my $extra_opt= shift; + my $slave_master_info= shift; + +# print STDERR Dumper($extra_opt); my $sidx= ""; # Index as string, 0 is empty string if ( $idx > 0 ) @@ -1835,10 +1721,10 @@ sub mysqld_arguments ($$$$$) { ############################################################################## sub mysqld_start ($$$$) { - my $type= shift; # master/slave/bootstrap - my $idx= shift; - my $extra_opt= shift; - my $slave_master_info= shift; + my $type= shift; # master/slave/bootstrap + my $idx= shift; + my $extra_opt= shift; + my $slave_master_info= shift; my $args; # Arg vector my $exe; @@ -1893,9 +1779,8 @@ sub mysqld_start ($$$$) { $master->[$idx]->{'path_myerr'}, $master->[$idx]->{'path_myerr'}, "") ) { - sleep_until_file_created($master->[$idx]->{'path_mypid'}, - $master->[$idx]->{'start_timeout'}); - return $pid; + return sleep_until_file_created($master->[$idx]->{'path_mypid'}, + $master->[$idx]->{'start_timeout'}, $pid); } } @@ -1905,13 +1790,12 @@ sub mysqld_start ($$$$) { $slave->[$idx]->{'path_myerr'}, $slave->[$idx]->{'path_myerr'}, "") ) { - sleep_until_file_created($slave->[$idx]->{'path_mypid'}, - $master->[$idx]->{'start_timeout'}); - return $pid; + return sleep_until_file_created($slave->[$idx]->{'path_mypid'}, + $master->[$idx]->{'start_timeout'}, $pid); } } - mtr_error("Can't start mysqld FIXME"); + return 0; } sub stop_masters_slaves () { @@ -1944,7 +1828,7 @@ sub stop_masters () { } } - mtr_stop_mysqld_servers(\@args, 0); + mtr_stop_mysqld_servers(\@args); } sub stop_slaves () { @@ -1966,7 +1850,7 @@ sub stop_slaves () { } } - mtr_stop_mysqld_servers(\@args, 0); + mtr_stop_mysqld_servers(\@args); } @@ -1992,17 +1876,32 @@ sub run_mysqltest ($$) { } my $cmdline_mysql= - "$exe_mysql --host=localhost --port=$master->[0]->{'path_myport'} " . - "--socket=$master->[0]->{'path_mysock'} --user=root --password="; + "$exe_mysql --host=localhost --user=root --password= " . + "--port=$master->[0]->{'path_myport'} " . + "--socket=$master->[0]->{'path_mysock'}"; + + my $cmdline_mysql_client_test= + "$exe_mysql_client_test --no-defaults --testcase --user=root --silent " . + "--port=$master->[0]->{'path_myport'} " . + "--socket=$master->[0]->{'path_mysock'}"; + + my $cmdline_mysql_fix_system_tables= + "$exe_mysql_fix_system_tables --no-defaults --host=localhost --user=root --password= " . + "--basedir=$glob_basedir --bindir=$path_client_bindir --verbose " . + "--port=$master->[0]->{'path_myport'} " . + "--socket=$master->[0]->{'path_mysock'}"; + + # FIXME really needing a PATH??? # $ENV{'PATH'}= "/bin:/usr/bin:/usr/local/bin:/usr/bsd:/usr/X11R6/bin:/usr/openwin/bin:/usr/bin/X11:$ENV{'PATH'}"; - $ENV{'MYSQL'}= $exe_mysql; + $ENV{'MYSQL'}= $cmdline_mysql; $ENV{'MYSQL_DUMP'}= $cmdline_mysqldump; - $ENV{'MYSQL_BINLOG'}= $exe_mysqlbinlog; - $ENV{'CLIENT_BINDIR'}= $path_client_bindir; - $ENV{'TESTS_BINDIR'}= $path_tests_bindir; + $ENV{'MYSQL_BINLOG'}= $cmdline_mysqlbinlog; + $ENV{'MYSQL_FIX_SYSTEM_TABLES'}= $cmdline_mysql_fix_system_tables; + $ENV{'MYSQL_CLIENT_TEST'}= $cmdline_mysql_client_test; + $ENV{'CHARSETSDIR'}= $path_charsetsdir; my $exe= $exe_mysqltest; my $args; From c2e9e15e9f44b2149286a9b6b784f93fe9b2938e Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 3 Feb 2005 21:50:56 +0100 Subject: [PATCH 0918/1063] mtr_cases.pl: new file --- mysql-test/lib/mtr_cases.pl | 270 ++++++++++++++++++++++++++++++++++++ 1 file changed, 270 insertions(+) create mode 100644 mysql-test/lib/mtr_cases.pl diff --git a/mysql-test/lib/mtr_cases.pl b/mysql-test/lib/mtr_cases.pl new file mode 100644 index 00000000000..5977bb380cf --- /dev/null +++ b/mysql-test/lib/mtr_cases.pl @@ -0,0 +1,270 @@ +# -*- cperl -*- + +# This is a library file used by the Perl version of mysql-test-run, +# and is part of the translation of the Bourne shell script with the +# same name. + +use strict; + +sub collect_test_cases ($); +sub collect_one_test_case ($$$$$); + +############################################################################## +# +# Collect information about test cases we are to run +# +############################################################################## + +sub collect_test_cases ($) { + my $suite= shift; # Test suite name + + my $testdir; + my $resdir; + + if ( $suite eq "main" ) + { + $testdir= "$::glob_mysql_test_dir/t"; + $resdir= "$::glob_mysql_test_dir/r"; + } + else + { + $testdir= "$::glob_mysql_test_dir/suite/$suite/t"; + $resdir= "$::glob_mysql_test_dir/suite/$suite/r"; + } + + my $cases = []; # Array of hash, will be array of C struct + + opendir(TESTDIR, $testdir) or mtr_error("Can't open dir \"$testdir\": $!"); + + if ( @::opt_cases ) + { + foreach my $tname ( @::opt_cases ) { # Run in specified order, no sort + my $elem= "$tname.test"; + if ( ! -f "$testdir/$elem") + { + mtr_error("Test case $tname ($testdir/$elem) is not found"); + } + collect_one_test_case($testdir,$resdir,$tname,$elem,$cases); + } + closedir TESTDIR; + } + else + { + foreach my $elem ( sort readdir(TESTDIR) ) { + my $tname= mtr_match_extension($elem,"test"); + next if ! defined $tname; + next if $::opt_do_test and ! defined mtr_match_prefix($elem,$::opt_do_test); + + collect_one_test_case($testdir,$resdir,$tname,$elem,$cases); + } + closedir TESTDIR; + } + + # To speed things up, we sort first in if the test require a restart + # or not, second in alphanumeric order. + +# @$cases = sort { +# if ( $a->{'master_restart'} and $b->{'master_restart'} or +# ! $a->{'master_restart'} and ! $b->{'master_restart'} ) +# { +# return $a->{'name'} cmp $b->{'name'}; +# } +# if ( $a->{'master_restart'} ) +# { +# return 1; # Is greater +# } +# else +# { +# return -1; # Is less +# } +# } @$cases; + + return $cases; +} + + +############################################################################## +# +# Collect information about a single test case +# +############################################################################## + + +sub collect_one_test_case($$$$$) { + my $testdir= shift; + my $resdir= shift; + my $tname= shift; + my $elem= shift; + my $cases= shift; + + my $path= "$testdir/$elem"; + + # ---------------------------------------------------------------------- + # Skip some tests silently + # ---------------------------------------------------------------------- + + if ( $::opt_start_from and $tname lt $::opt_start_from ) + { + return; + } + + # ---------------------------------------------------------------------- + # Skip some tests but include in list, just mark them to skip + # ---------------------------------------------------------------------- + + my $tinfo= {}; + $tinfo->{'name'}= $tname; + $tinfo->{'result_file'}= "$resdir/$tname.result"; + push(@$cases, $tinfo); + + if ( $::opt_skip_test and defined mtr_match_prefix($tname,$::opt_skip_test) ) + { + $tinfo->{'skip'}= 1; + return; + } + + # FIXME temporary solution, we have a hard coded list of test cases to + # skip if we are using the embedded server + + if ( $::glob_use_embedded_server and + mtr_match_any_exact($tname,\@::skip_if_embedded_server) ) + { + $tinfo->{'skip'}= 1; + return; + } + + # ---------------------------------------------------------------------- + # Collect information about test case + # ---------------------------------------------------------------------- + + $tinfo->{'path'}= $path; + $tinfo->{'timezone'}= "GMT-3"; # for UNIX_TIMESTAMP tests to work + + if ( defined mtr_match_prefix($tname,"rpl") ) + { + if ( $::opt_skip_rpl ) + { + $tinfo->{'skip'}= 1; + return; + } + + $tinfo->{'slave_num'}= 1; # Default, use one slave + + # FIXME currently we always restart slaves + $tinfo->{'slave_restart'}= 1; + + if ( $tname eq 'rpl_failsafe' or $tname eq 'rpl_chain_temp_table' ) + { +# $tinfo->{'slave_num'}= 3; # Not 3 ? Check old code, strange + } + } + + # FIXME what about embedded_server + ndbcluster, skip ?! + + my $master_opt_file= "$testdir/$tname-master.opt"; + my $slave_opt_file= "$testdir/$tname-slave.opt"; + my $slave_mi_file= "$testdir/$tname.slave-mi"; + my $master_sh= "$testdir/$tname-master.sh"; + my $slave_sh= "$testdir/$tname-slave.sh"; + my $disabled= "$testdir/$tname.disabled"; + + $tinfo->{'master_opt'}= []; + $tinfo->{'slave_opt'}= []; + $tinfo->{'slave_mi'}= []; + + if ( -f $master_opt_file ) + { + $tinfo->{'master_restart'}= 1; # We think so for now + # This is a dirty hack from old mysql-test-run, we use the opt file + # to flag other things as well, it is not a opt list at all + my $extra_master_opt= mtr_get_opts_from_file($master_opt_file); + + foreach my $opt (@$extra_master_opt) + { + my $value; + + $value= mtr_match_prefix($opt, "--timezone="); + + if ( defined $value ) + { + $tinfo->{'timezone'}= $value; + $extra_master_opt= []; + $tinfo->{'master_restart'}= 0; + last; + } + + $value= mtr_match_prefix($opt, "--result-file="); + + if ( defined $value ) + { + $tinfo->{'result_file'}= "r/$value.result"; + if ( $::opt_result_ext and $::opt_record or + -f "$tinfo->{'result_file'}$::opt_result_ext") + { + $tinfo->{'result_file'}.= $::opt_result_ext; + } + $extra_master_opt= []; + $tinfo->{'master_restart'}= 0; + last; + } + } + + $tinfo->{'master_opt'}= $extra_master_opt; + } + + if ( -f $slave_opt_file ) + { + $tinfo->{'slave_opt'}= mtr_get_opts_from_file($slave_opt_file); + $tinfo->{'slave_restart'}= 1; + } + + if ( -f $slave_mi_file ) + { + $tinfo->{'slave_mi'}= mtr_get_opts_from_file($slave_mi_file); + $tinfo->{'slave_restart'}= 1; + } + + if ( -f $master_sh ) + { + if ( $::glob_win32_perl ) + { + $tinfo->{'skip'}= 1; + } + else + { + $tinfo->{'master_sh'}= $master_sh; + $tinfo->{'master_restart'}= 1; + } + } + + if ( -f $slave_sh ) + { + if ( $::glob_win32_perl ) + { + $tinfo->{'skip'}= 1; + } + else + { + $tinfo->{'slave_sh'}= $slave_sh; + $tinfo->{'slave_restart'}= 1; + } + } + + if ( -f $disabled ) + { + $tinfo->{'skip'}= 1; + $tinfo->{'disable'}= 1; # Sub type of 'skip' + $tinfo->{'comment'}= mtr_fromfile($disabled); + } + + # We can't restart a running server that may be in use + + if ( $::glob_use_running_server and + ( $tinfo->{'master_restart'} or $tinfo->{'slave_restart'} ) ) + { + $tinfo->{'skip'}= 1; + } +} + + +1; From 3c925ee0f1b3387e6df952de8f86c618f11c1a8d Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 3 Feb 2005 21:11:12 +0000 Subject: [PATCH 0919/1063] Bug#8057 Fix crash with LAST_INSERT_ID() in UPDATE, Tests included, mysql-test/r/update.result: Bug#8057 Test for bug mysql-test/t/update.test: Bug#8057 Test for bug sql/item_func.cc: Bug#8057 Don't create new Item in val_int() --- mysql-test/r/update.result | 7 +++++++ mysql-test/t/update.test | 9 +++++++++ sql/item_func.cc | 8 ++------ 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/mysql-test/r/update.result b/mysql-test/r/update.result index beab6105f79..ac370db9ecc 100644 --- a/mysql-test/r/update.result +++ b/mysql-test/r/update.result @@ -212,3 +212,10 @@ insert into t1 values (1, "t1c2-1", 10), (2, "t1c2-2", 20); update t1 left join t2 on t1.c1 = t2.c1 set t2.c2 = "t2c2-1"; update t1 left join t2 on t1.c1 = t2.c1 set t2.c2 = "t2c2-1" where t1.c3 = 10; drop table t1, t2; +create table t1 (id int not null auto_increment primary key, id_str varchar(32)); +insert into t1 (id_str) values ("test"); +update t1 set id_str = concat(id_str, id) where id = last_insert_id(); +select * from t1; +id id_str +1 test1 +drop table t1; diff --git a/mysql-test/t/update.test b/mysql-test/t/update.test index 704263b1216..04192f25ac8 100644 --- a/mysql-test/t/update.test +++ b/mysql-test/t/update.test @@ -170,3 +170,12 @@ insert into t1 values (1, "t1c2-1", 10), (2, "t1c2-2", 20); update t1 left join t2 on t1.c1 = t2.c1 set t2.c2 = "t2c2-1"; update t1 left join t2 on t1.c1 = t2.c1 set t2.c2 = "t2c2-1" where t1.c3 = 10; drop table t1, t2; + +# +# Bug #8057 +# +create table t1 (id int not null auto_increment primary key, id_str varchar(32)); +insert into t1 (id_str) values ("test"); +update t1 set id_str = concat(id_str, id) where id = last_insert_id(); +select * from t1; +drop table t1; diff --git a/sql/item_func.cc b/sql/item_func.cc index 7125f4704b8..03b5688efc2 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -2284,14 +2284,10 @@ longlong Item_func_last_insert_id::val_int() longlong value=args[0]->val_int(); current_thd->insert_id(value); null_value=args[0]->null_value; - return value; } else - { - Item *it= get_system_var(current_thd, OPT_SESSION, "last_insert_id", 14, - "last_insert_id()"); - return it->val_int(); - } + current_thd->lex->uncacheable(UNCACHEABLE_SIDEEFFECT); + return current_thd->insert_id(); } /* This function is just used to test speed of different functions */ From a3efbf47c80bf6896c6a9fceecd761b757f76971 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 3 Feb 2005 14:21:16 -0800 Subject: [PATCH 0920/1063] Copy *.result.es files for binary distribution so embedded tests can be run scripts/make_binary_distribution.sh: Make sure to copy result.es files --- scripts/make_binary_distribution.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 33d4794e4f7..910aa38c33f 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -220,7 +220,7 @@ $CP mysql-test/include/*.inc $BASE/mysql-test/include $CP mysql-test/std_data/*.dat mysql-test/std_data/*.*001 $BASE/mysql-test/std_data $CP mysql-test/std_data/des_key_file $BASE/mysql-test/std_data $CP mysql-test/t/*test mysql-test/t/*.opt mysql-test/t/*.slave-mi mysql-test/t/*.sh $BASE/mysql-test/t -$CP mysql-test/r/*result mysql-test/r/*.require $BASE/mysql-test/r +$CP mysql-test/r/*result mysql-test/r/*result.es mysql-test/r/*.require $BASE/mysql-test/r if [ $BASE_SYSTEM != "netware" ] ; then chmod a+x $BASE/bin/* From 9f7c9aa7d5eed311e3d40c8f7d1a55abb7d4566c Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 3 Feb 2005 23:56:13 +0100 Subject: [PATCH 0921/1063] ndb - sol9x86: cc -xO3: fix optimizer error. ndb/src/common/util/NdbSqlUtil.cpp: sol9x86: cc -xO3: fix optimizer error. Note: same expression remains in Field_newdate::val_int(). --- ndb/src/common/util/NdbSqlUtil.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/ndb/src/common/util/NdbSqlUtil.cpp b/ndb/src/common/util/NdbSqlUtil.cpp index 6b23da774af..53fa5d69215 100644 --- a/ndb/src/common/util/NdbSqlUtil.cpp +++ b/ndb/src/common/util/NdbSqlUtil.cpp @@ -526,6 +526,7 @@ NdbSqlUtil::cmpDate(const void* info, const Uint32* p1, const Uint32* p2, Uint32 union { const Uint32* p; const unsigned char* v; } u1, u2; u1.p = p1; u2.p = p2; +#ifdef ndb_date_sol9x86_cc_xO3_madness // from Field_newdate::val_int Uint64 j1 = uint3korr(u1.v); Uint64 j2 = uint3korr(u2.v); @@ -536,6 +537,33 @@ NdbSqlUtil::cmpDate(const void* info, const Uint32* p1, const Uint32* p2, Uint32 if (j1 > j2) return +1; return 0; +#else + uint j1 = uint3korr(u1.v); + uint j2 = uint3korr(u2.v); + uint d1 = (j1 & 31); + uint d2 = (j2 & 31); + j1 = (j1 >> 5); + j2 = (j2 >> 5); + uint m1 = (j1 & 15); + uint m2 = (j2 & 15); + j1 = (j1 >> 4); + j2 = (j2 >> 4); + uint y1 = j1; + uint y2 = j2; + if (y1 < y2) + return -1; + if (y1 > y2) + return +1; + if (m1 < m2) + return -1; + if (m1 > m2) + return +1; + if (d1 < d2) + return -1; + if (d1 > d2) + return +1; + return 0; +#endif #endif } From d41473f3c63c4f770f1bb28f1729331d4f780ada Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 3 Feb 2005 16:07:32 -0800 Subject: [PATCH 0922/1063] Fix error in parsing string literals containing a backslash followed by a multi-byte character with a second byte of 0x5c (\). (Bug #8903) sql/sql_lex.cc: Fix lex error when multi-byte character containing 0x5c (\) follows a backslash mysql-test/t/ctype_sjis.test: Add regression test for Bug #8303 mysql-test/r/ctype_sjis.result: Add test results --- mysql-test/r/ctype_sjis.result | 4 ++++ mysql-test/t/ctype_sjis.test | 7 +++++++ sql/sql_lex.cc | 32 ++++++++++++++++++++++++++------ 3 files changed, 37 insertions(+), 6 deletions(-) diff --git a/mysql-test/r/ctype_sjis.result b/mysql-test/r/ctype_sjis.result index 1f414f89e20..98e5992f374 100644 --- a/mysql-test/r/ctype_sjis.result +++ b/mysql-test/r/ctype_sjis.result @@ -91,3 +91,7 @@ sjis_bin 6109 sjis_bin 61 sjis_bin 6120 drop table t1; +SET NAMES sjis; +SELECT HEX('²“‘@\Œ\') FROM DUAL; +HEX('²“‘@_Œ\') +8DB2939181408C5C diff --git a/mysql-test/t/ctype_sjis.test b/mysql-test/t/ctype_sjis.test index 58ca3c6a997..50d286f28b9 100644 --- a/mysql-test/t/ctype_sjis.test +++ b/mysql-test/t/ctype_sjis.test @@ -68,3 +68,10 @@ SET collation_connection='sjis_japanese_ci'; -- source include/ctype_filesort.inc SET collation_connection='sjis_bin'; -- source include/ctype_filesort.inc + +# Check parsing of string literals in SJIS with multibyte characters that +# have an embedded \ in them. (Bug #8303) + +--character_set sjis +SET NAMES sjis; +SELECT HEX('²“‘@\Œ\') FROM DUAL; diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index ed974a48ad3..d6dcd9ce9ae 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -295,7 +295,18 @@ static char *get_text(LEX *lex) found_escape=1; if (lex->ptr == lex->end_of_query) return 0; - yySkip(); +#ifdef USE_MB + int l; + if (use_mb(cs) && + (l = my_ismbchar(cs, + (const char *)lex->ptr, + (const char *)lex->end_of_query))) { + lex->ptr += l; + continue; + } + else +#endif + yySkip(); } else if (c == sep) { @@ -323,6 +334,10 @@ static char *get_text(LEX *lex) else { uchar *to; + + /* Re-use found_escape for tracking state of escapes */ + found_escape= 0; + for (to=start ; str != end ; str++) { #ifdef USE_MB @@ -336,7 +351,7 @@ static char *get_text(LEX *lex) continue; } #endif - if (*str == '\\' && str+1 != end) + if (!found_escape && *str == '\\' && str+1 != end) { switch(*++str) { case 'n': @@ -362,15 +377,20 @@ static char *get_text(LEX *lex) *to++= '\\'; // remember prefix for wildcard /* Fall through */ default: - *to++ = *str; + found_escape= 1; + str--; break; } } - else if (*str == sep) - *to++= *str++; // Two ' or " + else if (!found_escape && *str == sep) + { + found_escape= 1; + } else + { *to++ = *str; - + found_escape= 0; + } } *to=0; lex->yytoklen=(uint) (to-start); From ebda548d0d26f49a05d424f186e0b1d92c90925e Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 4 Feb 2005 09:14:22 +0300 Subject: [PATCH 0923/1063] Fix for BUG#7716: in in_string::set() take into account that the value returned by item->val_str() may be a substring of the passed string. Disallow string=its_substring assignment in String::operator=(). mysql-test/r/func_misc.result: Testcase for BUG#7716 mysql-test/t/func_misc.test: Testcase for BUG#7716 sql/item_cmpfunc.cc: Fix for BUG#7716: in in_string::set() take into account that the string returned by item->val_str(S) may be not S but use the buffer owned by S. sql/sql_string.h: * Added assert: String& String::operator=(const String&) may not be used to do assignments like str = string_that_uses_buffer_owned_by_str * Added String::uses_buffer_owned_by(). --- mysql-test/r/func_misc.result | 21 +++++++++++++++++++++ mysql-test/t/func_misc.test | 15 +++++++++++++++ sql/item_cmpfunc.cc | 4 ++++ sql/sql_string.h | 10 ++++++++++ 4 files changed, 50 insertions(+) diff --git a/mysql-test/r/func_misc.result b/mysql-test/r/func_misc.result index 5a9f0f68228..2d464c891bf 100644 --- a/mysql-test/r/func_misc.result +++ b/mysql-test/r/func_misc.result @@ -28,3 +28,24 @@ length(format('nan', 2)) > 0 select concat("$",format(2500,2)); concat("$",format(2500,2)) $2,500.00 +create table t1 ( a timestamp ); +insert into t1 values ( '2004-01-06 12:34' ); +select a from t1 where left(a+0,6) in ( left(20040106,6) ); +a +2004-01-06 12:34:00 +select a from t1 where left(a+0,6) = ( left(20040106,6) ); +a +2004-01-06 12:34:00 +select a from t1 where right(a+0,6) in ( right(20040106123400,6) ); +a +2004-01-06 12:34:00 +select a from t1 where right(a+0,6) = ( right(20040106123400,6) ); +a +2004-01-06 12:34:00 +select a from t1 where mid(a+0,6,3) in ( mid(20040106123400,6,3) ); +a +2004-01-06 12:34:00 +select a from t1 where mid(a+0,6,3) = ( mid(20040106123400,6,3) ); +a +2004-01-06 12:34:00 +drop table t1; diff --git a/mysql-test/t/func_misc.test b/mysql-test/t/func_misc.test index e73f2a1b26c..89aba7ee583 100644 --- a/mysql-test/t/func_misc.test +++ b/mysql-test/t/func_misc.test @@ -23,3 +23,18 @@ select length(format('nan', 2)) > 0; # Test for bug #628 # select concat("$",format(2500,2)); + +# Test for BUG#7716 +create table t1 ( a timestamp ); +insert into t1 values ( '2004-01-06 12:34' ); +select a from t1 where left(a+0,6) in ( left(20040106,6) ); +select a from t1 where left(a+0,6) = ( left(20040106,6) ); + +select a from t1 where right(a+0,6) in ( right(20040106123400,6) ); +select a from t1 where right(a+0,6) = ( right(20040106123400,6) ); + +select a from t1 where mid(a+0,6,3) in ( mid(20040106123400,6,3) ); +select a from t1 where mid(a+0,6,3) = ( mid(20040106123400,6,3) ); + +drop table t1; + diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index c5e6d520ab7..46ef3281dd1 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -1503,7 +1503,11 @@ void in_string::set(uint pos,Item *item) String *str=((String*) base)+pos; String *res=item->val_str(str); if (res && res != str) + { + if (res->uses_buffer_owned_by(str)) + res->copy(); *str= *res; + } if (!str->charset()) { CHARSET_INFO *cs; diff --git a/sql/sql_string.h b/sql/sql_string.h index a8fb9574c0b..9136dddbbf2 100644 --- a/sql/sql_string.h +++ b/sql/sql_string.h @@ -182,6 +182,11 @@ public: { if (&s != this) { + /* + It is forbidden to do assignments like + some_string = substring_of_that_string + */ + DBUG_ASSERT(!s.uses_buffer_owned_by(this)); free(); Ptr=s.Ptr ; str_length=s.str_length ; Alloced_length=s.Alloced_length; alloced=0; @@ -313,4 +318,9 @@ public: /* Swap two string objects. Efficient way to exchange data without memcpy. */ void swap(String &s); + + inline bool uses_buffer_owned_by(const String *s) const + { + return (s->alloced && Ptr >= s->Ptr && Ptr < s->Ptr + s->str_length); + } }; From 4c69539827f69a693236eca0a2f512b1618e80a1 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 4 Feb 2005 15:35:08 +0400 Subject: [PATCH 0924/1063] type_float.result.es updated. mysql-test/r/type_float.result.es: Updated. BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted --- BitKeeper/etc/logging_ok | 1 + mysql-test/r/type_float.result.es | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok index 6ccc886e161..bf88e38a780 100644 --- a/BitKeeper/etc/logging_ok +++ b/BitKeeper/etc/logging_ok @@ -180,6 +180,7 @@ ram@gw.mysql.r18.ru ram@gw.udmsearch.izhnet.ru ram@mysql.r18.ru ram@ram.(none) +ramil@mysql.com ranger@regul.home.lan rburnett@build.mysql.com reggie@bob.(none) diff --git a/mysql-test/r/type_float.result.es b/mysql-test/r/type_float.result.es index b93539b6bea..5fcf9213f83 100644 --- a/mysql-test/r/type_float.result.es +++ b/mysql-test/r/type_float.result.es @@ -143,6 +143,15 @@ drop table t1; create table t1 (f float(54)); ERROR 42000: Incorrect column specifier for column 'f' drop table if exists t1; +create table t1 (d1 double, d2 double unsigned); +insert into t1 set d1 = -1.0; +update t1 set d2 = d1; +Warnings: +Warning 1264 Data truncated; out of range for column 'd2' at row 1 +select * from t1; +d1 d2 +-1 0 +drop table t1; create table t1 (f float(4,3)); insert into t1 values (-11.0),(-11),("-11"),(11.0),(11),("11"); Warnings: From 66eb71f3fc13fefaa6d72532b521a28c09138aa3 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 4 Feb 2005 15:31:36 +0300 Subject: [PATCH 0925/1063] A fix: bug#6931: Date Type column problem when using UNION-Table bug#7833: Wrong datatype of aggregate column is returned mysql-test/r/func_group.result: Test case for bug 7833: Wrong datatype of aggregate column is returned mysql-test/r/union.result: Test case for bug 6931: Date Type column problem when using UNION-Table. mysql-test/t/func_group.test: Test case for bug 7833: Wrong datatype of aggregate column is returned mysql-test/t/union.test: Test case for bug 6931: Date Type column problem when using UNION-Table. --- mysql-test/r/func_group.result | 12 +++++++ mysql-test/r/union.result | 36 +++++++++++++++++++ mysql-test/t/func_group.test | 14 ++++++++ mysql-test/t/union.test | 35 ++++++++++++++++++ sql/field.cc | 35 ++++++++++++++++++ sql/field.h | 1 + sql/item.cc | 65 +++++++++++++++++++++++++++------- sql/item.h | 4 +-- sql/sql_union.cc | 14 ++++++-- 9 files changed, 200 insertions(+), 16 deletions(-) diff --git a/mysql-test/r/func_group.result b/mysql-test/r/func_group.result index 4bb79a1cb41..fa645700875 100644 --- a/mysql-test/r/func_group.result +++ b/mysql-test/r/func_group.result @@ -733,3 +733,15 @@ one 2 two 2 three 1 drop table t1; +create table t1(f1 datetime); +insert into t1 values (now()); +create table t2 select f2 from (select max(now()) f2 from t1) a; +show columns from t2; +Field Type Null Key Default Extra +f2 datetime 0000-00-00 00:00:00 +drop table t2; +create table t2 select f2 from (select now() f2 from t1) a; +show columns from t2; +Field Type Null Key Default Extra +f2 datetime 0000-00-00 00:00:00 +drop table t2, t1; diff --git a/mysql-test/r/union.result b/mysql-test/r/union.result index f07bdad9021..115ef6a47f9 100644 --- a/mysql-test/r/union.result +++ b/mysql-test/r/union.result @@ -1137,3 +1137,39 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; drop table t2; +create table t1(a1 int, f1 char(10)); +create table t2 +select f2,a1 from (select a1, CAST('2004-12-31' AS DATE) f2 from t1) a +union +select f2,a1 from (select a1, CAST('2004-12-31' AS DATE) f2 from t1) a +order by f2, a1; +show columns from t2; +Field Type Null Key Default Extra +f2 date YES NULL +a1 int(11) YES NULL +drop table t1, t2; +create table t1 (f1 int); +create table t2 (f1 int, f2 int ,f3 date); +create table t3 (f1 int, f2 char(10)); +create table t4 +( +select t2.f3 as sdate +from t1 +left outer join t2 on (t1.f1 = t2.f1) +inner join t3 on (t2.f2 = t3.f1) +order by t1.f1, t3.f1, t2.f3 +) +union +( +select cast('2004-12-31' as date) as sdate +from t1 +left outer join t2 on (t1.f1 = t2.f1) +inner join t3 on (t2.f2 = t3.f1) +group by t1.f1 +order by t1.f1, t3.f1, t2.f3 +) +order by sdate; +show columns from t4; +Field Type Null Key Default Extra +sdate date YES NULL +drop table t1, t2, t3, t4; diff --git a/mysql-test/t/func_group.test b/mysql-test/t/func_group.test index 79d6112e6de..465611a5ebb 100644 --- a/mysql-test/t/func_group.test +++ b/mysql-test/t/func_group.test @@ -473,3 +473,17 @@ INSERT INTO t1 VALUES select val, count(*) from t1 group by val; drop table t1; + + +# +# Bug 7833: Wrong datatype of aggregate column is returned +# + +create table t1(f1 datetime); +insert into t1 values (now()); +create table t2 select f2 from (select max(now()) f2 from t1) a; +show columns from t2; +drop table t2; +create table t2 select f2 from (select now() f2 from t1) a; +show columns from t2; +drop table t2, t1; diff --git a/mysql-test/t/union.test b/mysql-test/t/union.test index 8682808f3f3..90b2197603b 100644 --- a/mysql-test/t/union.test +++ b/mysql-test/t/union.test @@ -664,3 +664,38 @@ show create table t1; drop table t1; drop table t2; +# +# Bug 6931: Date Type column problem when using UNION-Table. +# +create table t1(a1 int, f1 char(10)); +create table t2 +select f2,a1 from (select a1, CAST('2004-12-31' AS DATE) f2 from t1) a +union +select f2,a1 from (select a1, CAST('2004-12-31' AS DATE) f2 from t1) a +order by f2, a1; +show columns from t2; +drop table t1, t2; + +create table t1 (f1 int); +create table t2 (f1 int, f2 int ,f3 date); +create table t3 (f1 int, f2 char(10)); +create table t4 +( + select t2.f3 as sdate + from t1 + left outer join t2 on (t1.f1 = t2.f1) + inner join t3 on (t2.f2 = t3.f1) + order by t1.f1, t3.f1, t2.f3 +) +union +( + select cast('2004-12-31' as date) as sdate + from t1 + left outer join t2 on (t1.f1 = t2.f1) + inner join t3 on (t2.f2 = t3.f1) + group by t1.f1 + order by t1.f1, t3.f1, t2.f3 +) +order by sdate; +show columns from t4; +drop table t1, t2, t3, t4; diff --git a/sql/field.cc b/sql/field.cc index 7357bc06f11..9965cb792be 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -245,6 +245,7 @@ static Field::field_cast_enum field_cast_date[]= Field::FIELD_CAST_BLOB, Field::FIELD_CAST_STOP}; static Field::field_cast_enum field_cast_newdate[]= {Field::FIELD_CAST_NEWDATE, + Field::FIELD_CAST_DATE, Field::FIELD_CAST_DATETIME, Field::FIELD_CAST_STRING, Field::FIELD_CAST_VARSTRING, Field::FIELD_CAST_BLOB, Field::FIELD_CAST_STOP}; @@ -6024,6 +6025,40 @@ Field *make_field(char *ptr, uint32 field_length, } +/* + Check if field_type is appropriate field type + to create field for tmp table using + item->tmp_table_field() method + + SYNOPSIS + field_types_to_be_kept() + field_type - field type + + NOTE + it is used in function get_holder_example_field() + from item.cc + + RETURN + 1 - can use item->tmp_table_field() method + 0 - can not use item->tmp_table_field() method + +*/ + +bool field_types_to_be_kept(enum_field_types field_type) +{ + switch (field_type) + { + case FIELD_TYPE_DATE: + case FIELD_TYPE_NEWDATE: + case FIELD_TYPE_TIME: + case FIELD_TYPE_DATETIME: + return 1; + default: + return 0; + } +} + + /* Create a field suitable for create of table */ create_field::create_field(Field *old_field,Field *orig_field) diff --git a/sql/field.h b/sql/field.h index 27a01a69273..fd0f2f9c2f1 100644 --- a/sql/field.h +++ b/sql/field.h @@ -1265,6 +1265,7 @@ int set_field_to_null(Field *field); int set_field_to_null_with_conversions(Field *field, bool no_conversions); bool test_if_int(const char *str, int length, const char *int_end, CHARSET_INFO *cs); +bool field_types_to_be_kept(enum_field_types field_type); /* The following are for the interface with the .frm file diff --git a/sql/item.cc b/sql/item.cc index ab29c147dfb..d61d628e8fa 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -2639,7 +2639,53 @@ void Item_cache_row::bring_value() } -Item_type_holder::Item_type_holder(THD *thd, Item *item) +/* + Returns field for temporary table dependind on item type + + SYNOPSIS + get_holder_example_field() + thd - thread handler + item - pointer to item + table - empty table object + + NOTE + It is possible to return field for Item_func + items only if field type of this item is + date or time or datetime type. + also see function field_types_to_be_kept() from + field.cc + + RETURN + # - field + 0 - no field +*/ + +Field *get_holder_example_field(THD *thd, Item *item, TABLE *table) +{ + DBUG_ASSERT(table); + + Item_func *tmp_item= 0; + if (item->type() == Item::FIELD_ITEM) + return (((Item_field*) item)->field); + if (item->type() == Item::FUNC_ITEM) + tmp_item= (Item_func *) item; + else if (item->type() == Item::SUM_FUNC_ITEM) + { + Item_sum *item_sum= (Item_sum *) item; + if (item_sum->keep_field_type()) + { + if (item_sum->args[0]->type() == Item::FIELD_ITEM) + return (((Item_field*) item_sum->args[0])->field); + if (item_sum->args[0]->type() == Item::FUNC_ITEM) + tmp_item= (Item_func *) item_sum->args[0]; + } + } + return (tmp_item && field_types_to_be_kept(tmp_item->field_type()) ? + tmp_item->tmp_table_field(table) : 0); +} + + +Item_type_holder::Item_type_holder(THD *thd, Item *item, TABLE *table) :Item(thd, item), item_type(item->result_type()), orig_type(item_type) { @@ -2649,10 +2695,7 @@ Item_type_holder::Item_type_holder(THD *thd, Item *item) It is safe assign pointer on field, because it will be used just after all JOIN::prepare calls and before any SELECT execution */ - if (item->type() == Item::FIELD_ITEM) - field_example= ((Item_field*) item)->field; - else - field_example= 0; + field_example= get_holder_example_field(thd, item, table); max_length= real_length(item); maybe_null= item->maybe_null; collation.set(item->collation); @@ -2692,25 +2735,23 @@ inline bool is_attr_compatible(Item *from, Item *to) (to->maybe_null || !from->maybe_null) && (to->result_type() != STRING_RESULT || from->result_type() != STRING_RESULT || - my_charset_same(from->collation.collation, - to->collation.collation))); + (from->collation.collation == to->collation.collation))); } -bool Item_type_holder::join_types(THD *thd, Item *item) +bool Item_type_holder::join_types(THD *thd, Item *item, TABLE *table) { uint32 new_length= real_length(item); bool use_new_field= 0, use_expression_type= 0; Item_result new_result_type= type_convertor[item_type][item->result_type()]; - bool item_is_a_field= item->type() == Item::FIELD_ITEM; - + Field *field= get_holder_example_field(thd, item, table); + bool item_is_a_field= field; /* Check if both items point to fields: in this case we can adjust column types of result table in the union smartly. */ if (field_example && item_is_a_field) { - Field *field= ((Item_field *)item)->field; /* Can 'field_example' field store data of the column? */ if ((use_new_field= (!field->field_cast_compatible(field_example->field_cast_type()) || @@ -2751,7 +2792,7 @@ bool Item_type_holder::join_types(THD *thd, Item *item) It is safe to assign a pointer to field here, because it will be used before any table is closed. */ - field_example= ((Item_field*) item)->field; + field_example= field; } old_cs= collation.collation->name; diff --git a/sql/item.h b/sql/item.h index 237a8f7efac..e0de7452eec 100644 --- a/sql/item.h +++ b/sql/item.h @@ -1321,14 +1321,14 @@ protected: Item_result orig_type; Field *field_example; public: - Item_type_holder(THD*, Item*); + Item_type_holder(THD*, Item*, TABLE *); Item_result result_type () const { return item_type; } enum Type type() const { return TYPE_HOLDER; } double val(); longlong val_int(); String *val_str(String*); - bool join_types(THD *thd, Item *); + bool join_types(THD *thd, Item *, TABLE *); Field *example() { return field_example; } static uint32 real_length(Item *item); void cleanup() diff --git a/sql/sql_union.cc b/sql/sql_union.cc index 027a21db7ac..882316d57d7 100644 --- a/sql/sql_union.cc +++ b/sql/sql_union.cc @@ -148,6 +148,7 @@ int st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result, SELECT_LEX *sl, *first_select; select_result *tmp_result; bool is_union; + TABLE *empty_table= 0; DBUG_ENTER("st_select_lex_unit::prepare"); describe= test(additional_options & SELECT_DESCRIBE); @@ -239,13 +240,21 @@ int st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result, goto err; if (sl == first_select) { + /* + We need to create an empty table object. It is used + to create tmp_table fields in Item_type_holder. + The main reason of this is that we can't create + field object without table. + */ + DBUG_ASSERT(!empty_table); + empty_table= (TABLE*) thd->calloc(sizeof(TABLE)); types.empty(); List_iterator_fast it(sl->item_list); Item *item_tmp; while ((item_tmp= it++)) { /* Error's in 'new' will be detected after loop */ - types.push_back(new Item_type_holder(thd_arg, item_tmp)); + types.push_back(new Item_type_holder(thd_arg, item_tmp, empty_table)); } if (thd_arg->is_fatal_error) @@ -264,7 +273,8 @@ int st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result, Item *type, *item_tmp; while ((type= tp++, item_tmp= it++)) { - if (((Item_type_holder*)type)->join_types(thd_arg, item_tmp)) + if (((Item_type_holder*)type)->join_types(thd_arg, item_tmp, + empty_table)) DBUG_RETURN(-1); } } From 48e2d224047ddb5a70dcca3abd7f4f828ee0b5bd Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 4 Feb 2005 14:25:08 +0100 Subject: [PATCH 0926/1063] added test to trigger drifferent fragmentations in ndb corrected documentation on fragmentation set "fragmentation medium" to mean 2 fragments per node instead of 1 set default fragmentation to small instead of medium bug#8284 adjust fragmentation to max_rows mysql-test/r/ndb_basic.result: added test to trigger drifferent fragmentations in ndb mysql-test/t/ndb_basic.test: added test to trigger drifferent fragmentations in ndb ndb/include/ndbapi/NdbDictionary.hpp: corrected documentation on fragmentation ndb/src/kernel/blocks/dbdih/DbdihMain.cpp: set "fragmentation medium" to mean 2 fragments per node instead of 1 ndb/src/ndbapi/NdbDictionaryImpl.cpp: set default fragmentation to small instead of medium sql/ha_ndbcluster.cc: bug#8284 adjust fragmentation to max_rows --- mysql-test/r/ndb_basic.result | 34 +++++++++++++++++ mysql-test/t/ndb_basic.test | 38 +++++++++++++++++++ ndb/include/ndbapi/NdbDictionary.hpp | 6 +-- ndb/src/kernel/blocks/dbdih/DbdihMain.cpp | 2 +- ndb/src/ndbapi/NdbDictionaryImpl.cpp | 2 +- sql/ha_ndbcluster.cc | 45 ++++++++++++++++++++++- 6 files changed, 121 insertions(+), 6 deletions(-) diff --git a/mysql-test/r/ndb_basic.result b/mysql-test/r/ndb_basic.result index 6ec5338acbe..a6396080ef0 100644 --- a/mysql-test/r/ndb_basic.result +++ b/mysql-test/r/ndb_basic.result @@ -573,3 +573,37 @@ select * from t1 where a12345678901234567890123456789a1234567890=2; a1234567890123456789012345678901234567890 a12345678901234567890123456789a1234567890 5 2 drop table t1; +create table t1 +(a bigint, b bigint, c bigint, d bigint, +primary key (a,b,c,d)) +engine=ndb +max_rows=200000000; +Warnings: +Warning 1105 Ndb might have problems storing the max amount of rows specified +insert into t1 values +(1,2,3,4),(2,3,4,5),(3,4,5,6), +(3,2,3,4),(1,3,4,5),(2,4,5,6), +(1,2,3,5),(2,3,4,8),(3,4,5,9), +(3,2,3,5),(1,3,4,8),(2,4,5,9), +(1,2,3,6),(2,3,4,6),(3,4,5,7), +(3,2,3,6),(1,3,4,6),(2,4,5,7), +(1,2,3,7),(2,3,4,7),(3,4,5,8), +(3,2,3,7),(1,3,4,7),(2,4,5,8), +(1,3,3,4),(2,4,4,5),(3,5,5,6), +(3,3,3,4),(1,4,4,5),(2,5,5,6), +(1,3,3,5),(2,4,4,8),(3,5,5,9), +(3,3,3,5),(1,4,4,8),(2,5,5,9), +(1,3,3,6),(2,4,4,6),(3,5,5,7), +(3,3,3,6),(1,4,4,6),(2,5,5,7), +(1,3,3,7),(2,4,4,7),(3,5,5,8), +(3,3,3,7),(1,4,4,7),(2,5,5,8); +select count(*) from t1; +count(*) +48 +drop table t1; +create table t1 +(a bigint, b bigint, c bigint, d bigint, +primary key (a)) +engine=ndb +max_rows=1; +drop table t1; diff --git a/mysql-test/t/ndb_basic.test b/mysql-test/t/ndb_basic.test index 2671223ada8..f460c573a9d 100644 --- a/mysql-test/t/ndb_basic.test +++ b/mysql-test/t/ndb_basic.test @@ -539,3 +539,41 @@ insert into t1 values (1,1),(2,1),(3,1),(4,1),(5,2),(6,1),(7,1); explain select * from t1 where a12345678901234567890123456789a1234567890=2; select * from t1 where a12345678901234567890123456789a1234567890=2; drop table t1; + +# +# test fragment creation +# +# first a table with _many_ fragments per node group +# then a table with just one fragment per node group +# +create table t1 + (a bigint, b bigint, c bigint, d bigint, + primary key (a,b,c,d)) + engine=ndb + max_rows=200000000; +insert into t1 values + (1,2,3,4),(2,3,4,5),(3,4,5,6), + (3,2,3,4),(1,3,4,5),(2,4,5,6), + (1,2,3,5),(2,3,4,8),(3,4,5,9), + (3,2,3,5),(1,3,4,8),(2,4,5,9), + (1,2,3,6),(2,3,4,6),(3,4,5,7), + (3,2,3,6),(1,3,4,6),(2,4,5,7), + (1,2,3,7),(2,3,4,7),(3,4,5,8), + (3,2,3,7),(1,3,4,7),(2,4,5,8), + (1,3,3,4),(2,4,4,5),(3,5,5,6), + (3,3,3,4),(1,4,4,5),(2,5,5,6), + (1,3,3,5),(2,4,4,8),(3,5,5,9), + (3,3,3,5),(1,4,4,8),(2,5,5,9), + (1,3,3,6),(2,4,4,6),(3,5,5,7), + (3,3,3,6),(1,4,4,6),(2,5,5,7), + (1,3,3,7),(2,4,4,7),(3,5,5,8), + (3,3,3,7),(1,4,4,7),(2,5,5,8); +select count(*) from t1; +drop table t1; + +create table t1 + (a bigint, b bigint, c bigint, d bigint, + primary key (a)) + engine=ndb + max_rows=1; +drop table t1; diff --git a/ndb/include/ndbapi/NdbDictionary.hpp b/ndb/include/ndbapi/NdbDictionary.hpp index 0dca1c0f106..49afbd695c9 100644 --- a/ndb/include/ndbapi/NdbDictionary.hpp +++ b/ndb/include/ndbapi/NdbDictionary.hpp @@ -141,9 +141,9 @@ public: enum FragmentType { FragUndefined = 0, ///< Fragmentation type undefined or default FragSingle = 1, ///< Only one fragment - FragAllSmall = 2, ///< One fragment per node group - FragAllMedium = 3, ///< Default value. Two fragments per node group. - FragAllLarge = 4 ///< Eight fragments per node group. + FragAllSmall = 2, ///< One fragment per node, default + FragAllMedium = 3, ///< two fragments per node + FragAllLarge = 4 ///< Four fragments per node. }; }; diff --git a/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp b/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp index dba1efbba9a..0bc8351a9db 100644 --- a/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp +++ b/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp @@ -6178,7 +6178,7 @@ void Dbdih::execCREATE_FRAGMENTATION_REQ(Signal * signal){ break; case DictTabInfo::AllNodesMediumTable: jam(); - noOfFragments = csystemnodes; + noOfFragments = 2 * csystemnodes; break; case DictTabInfo::AllNodesLargeTable: jam(); diff --git a/ndb/src/ndbapi/NdbDictionaryImpl.cpp b/ndb/src/ndbapi/NdbDictionaryImpl.cpp index 9f6ed144fb0..530f15d3a2e 100644 --- a/ndb/src/ndbapi/NdbDictionaryImpl.cpp +++ b/ndb/src/ndbapi/NdbDictionaryImpl.cpp @@ -284,7 +284,7 @@ void NdbTableImpl::init(){ clearNewProperties(); m_frm.clear(); - m_fragmentType = NdbDictionary::Object::FragAllMedium; + m_fragmentType = NdbDictionary::Object::FragAllSmall; m_logging = true; m_kvalue = 6; m_minLoadFactor = 78; diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index a959cbaf434..9f0da616289 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -3503,6 +3503,47 @@ static int create_ndb_column(NDBCOL &col, Create a table in NDB Cluster */ +static void ndb_set_fragmentation(NDBTAB &tab, TABLE *form, uint pk_length) +{ + if (form->max_rows == 0) /* default setting, don't set fragmentation */ + return; + /** + * get the number of fragments right + */ + uint no_fragments; + { +#if MYSQL_VERSION_ID >= 50000 + uint acc_row_size= 25+2; +#else + uint acc_row_size= pk_length*4; + /* add acc overhead */ + if (pk_length <= 8) + acc_row_size+= 25+2; /* main page will set the limit */ + else + acc_row_size+= 4+4; /* overflow page will set the limit */ +#endif + ulonglong acc_fragment_size= 512*1024*1024; + ulonglong max_rows= form->max_rows; + no_fragments= (max_rows*acc_row_size)/acc_fragment_size+1; + } + { + uint no_nodes= g_ndb_cluster_connection->no_db_nodes(); + NDBTAB::FragmentType ftype; + if (no_fragments > 2*no_nodes) + { + ftype= NDBTAB::FragAllLarge; + if (no_fragments > 4*no_nodes) + push_warning(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN, ER_UNKNOWN_ERROR, + "Ndb might have problems storing the max amount of rows specified"); + } + else if (no_fragments > no_nodes) + ftype= NDBTAB::FragAllMedium; + else + ftype= NDBTAB::FragAllSmall; + tab.setFragmentType(ftype); + } +} + int ha_ndbcluster::create(const char *name, TABLE *form, HA_CREATE_INFO *info) @@ -3605,7 +3646,9 @@ int ha_ndbcluster::create(const char *name, break; } } - + + ndb_set_fragmentation(tab, form, pk_length); + if ((my_errno= check_ndb_connection())) DBUG_RETURN(my_errno); From 8c750c466b0109723233e93aea85a39673409b40 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 4 Feb 2005 15:24:06 +0100 Subject: [PATCH 0927/1063] indexless boolean fulltext search was depending on default_charset_info - Bug#8159 ftbw->off wasn't cleared on reinit - Bug#8234 include/ft_global.h: get rid of default_charset_info in indexless fulltext searches myisam/ft_boolean_search.c: get rid of default_charset_info in indexless fulltext searches clear ftbw->off on reinits myisam/ft_static.c: get rid of default_charset_info in indexless fulltext searches myisam/ftdefs.h: get rid of default_charset_info in indexless fulltext searches sql/ha_myisam.h: get rid of default_charset_info in indexless fulltext searches sql/handler.h: get rid of default_charset_info in indexless fulltext searches sql/item_func.cc: get rid of default_charset_info in indexless fulltext searches --- include/ft_global.h | 2 +- myisam/ft_boolean_search.c | 7 ++++--- myisam/ft_static.c | 5 +++-- myisam/ftdefs.h | 2 +- sql/ha_myisam.h | 8 ++++++-- sql/handler.h | 3 +-- sql/item_func.cc | 8 +++----- 7 files changed, 19 insertions(+), 16 deletions(-) diff --git a/include/ft_global.h b/include/ft_global.h index 94f6ad9ef51..c3f60d13a7a 100644 --- a/include/ft_global.h +++ b/include/ft_global.h @@ -62,7 +62,7 @@ void ft_free_stopwords(void); #define FT_SORTED 2 #define FT_EXPAND 4 /* query expansion */ -FT_INFO *ft_init_search(uint,void *, uint, byte *, uint, byte *); +FT_INFO *ft_init_search(uint,void *, uint, byte *, uint,CHARSET_INFO *, byte *); my_bool ft_boolean_check_syntax_string(const byte *); #ifdef __cplusplus diff --git a/myisam/ft_boolean_search.c b/myisam/ft_boolean_search.c index aab3854dd34..4253b5ff96f 100644 --- a/myisam/ft_boolean_search.c +++ b/myisam/ft_boolean_search.c @@ -365,6 +365,7 @@ static void _ftb_init_index_search(FT_INFO *ftb) reset_tree(& ftb->no_dupes); } + ftbw->off=0; /* in case of reinit */ if (_ft2_search(ftb, ftbw, 1)) return; } @@ -373,7 +374,7 @@ static void _ftb_init_index_search(FT_INFO *ftb) FT_INFO * ft_init_boolean_search(MI_INFO *info, uint keynr, byte *query, - uint query_len) + uint query_len, CHARSET_INFO *cs) { FTB *ftb; FTB_EXPR *ftbe; @@ -385,8 +386,8 @@ FT_INFO * ft_init_boolean_search(MI_INFO *info, uint keynr, byte *query, ftb->state=UNINITIALIZED; ftb->info=info; ftb->keynr=keynr; - ftb->charset= ((keynr==NO_SUCH_KEY) ? - default_charset_info : info->s->keyinfo[keynr].seg->charset); + ftb->charset=cs; + DBUG_ASSERT(keynr==NO_SUCH_KEY || cs == info->s->keyinfo[keynr].seg->charset); ftb->with_scan=0; ftb->lastpos=HA_OFFSET_ERROR; bzero(& ftb->no_dupes, sizeof(TREE)); diff --git a/myisam/ft_static.c b/myisam/ft_static.c index 7168406d027..994a94d0c49 100644 --- a/myisam/ft_static.c +++ b/myisam/ft_static.c @@ -55,11 +55,12 @@ const struct _ft_vft _ft_vft_boolean = { FT_INFO *ft_init_search(uint flags, void *info, uint keynr, - byte *query, uint query_len, byte *record) + byte *query, uint query_len, CHARSET_INFO *cs, + byte *record) { FT_INFO *res; if (flags & FT_BOOL) - res= ft_init_boolean_search((MI_INFO *)info, keynr, query, query_len); + res= ft_init_boolean_search((MI_INFO *)info, keynr, query, query_len,cs); else res= ft_init_nlq_search((MI_INFO *)info, keynr, query, query_len, flags, record); diff --git a/myisam/ftdefs.h b/myisam/ftdefs.h index e7a0829e140..ddb9fbfead2 100644 --- a/myisam/ftdefs.h +++ b/myisam/ftdefs.h @@ -131,7 +131,7 @@ FT_WORD * _mi_ft_parserecord(MI_INFO *, uint, const byte *); uint _mi_ft_parse(TREE *, MI_INFO *, uint, const byte *, my_bool); FT_INFO *ft_init_nlq_search(MI_INFO *, uint, byte *, uint, uint, byte *); -FT_INFO *ft_init_boolean_search(MI_INFO *, uint, byte *, uint); +FT_INFO *ft_init_boolean_search(MI_INFO *, uint, byte *, uint, CHARSET_INFO *); extern const struct _ft_vft _ft_vft_nlq; int ft_nlq_read_next(FT_INFO *, char *); diff --git a/sql/ha_myisam.h b/sql/ha_myisam.h index 972d6b18e19..1e6cf2f4ada 100644 --- a/sql/ha_myisam.h +++ b/sql/ha_myisam.h @@ -88,8 +88,12 @@ class ha_myisam: public handler ft_handler->please->reinit_search(ft_handler); return 0; } - FT_INFO *ft_init_ext(uint flags, uint inx,const byte *key, uint keylen) - { return ft_init_search(flags,file,inx,(byte*) key,keylen, table->record[0]); } + FT_INFO *ft_init_ext(uint flags, uint inx,String *key) + { + return ft_init_search(flags,file,inx, + (byte *)key->ptr(), key->length(), key->charset(), + table->record[0]); + } int ft_read(byte *buf); int rnd_init(bool scan); int rnd_next(byte *buf); diff --git a/sql/handler.h b/sql/handler.h index 245defe61e0..0426312f404 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -373,8 +373,7 @@ public: int compare_key(key_range *range); virtual int ft_init() { return HA_ERR_WRONG_COMMAND; } void ft_end() { ft_handler=NULL; } - virtual FT_INFO *ft_init_ext(uint flags,uint inx,const byte *key, - uint keylen) + virtual FT_INFO *ft_init_ext(uint flags, uint inx,String *key) { return NULL; } virtual int ft_read(byte *buf) { return HA_ERR_WRONG_COMMAND; } virtual int rnd_next(byte *buf)=0; diff --git a/sql/item_func.cc b/sql/item_func.cc index bff49541252..85cd1c693b7 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -3047,9 +3047,7 @@ void Item_func_match::init_search(bool no_order) if (join_key && !no_order) flags|=FT_SORTED; - ft_handler=table->file->ft_init_ext(flags, key, - (byte*) ft_tmp->ptr(), - ft_tmp->length()); + ft_handler=table->file->ft_init_ext(flags, key, ft_tmp); if (join_key) table->file->ft_handler=ft_handler; @@ -3091,12 +3089,12 @@ bool Item_func_match::fix_fields(THD *thd, TABLE_LIST *tlist, Item **ref) } /* Check that all columns come from the same table. - We've already checked that columns in MATCH are fields so + We've already checked that columns in MATCH are fields so PARAM_TABLE_BIT can only appear from AGAINST argument. */ if ((used_tables_cache & ~PARAM_TABLE_BIT) != item->used_tables()) key=NO_SUCH_KEY; - + if (key == NO_SUCH_KEY && !(flags & FT_BOOL)) { my_error(ER_WRONG_ARGUMENTS,MYF(0),"MATCH"); From 8ed40c4b09bb4c56f17a1432fc9024a5dfc4e04a Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 4 Feb 2005 19:12:15 +0400 Subject: [PATCH 0928/1063] Embedded version of test fixed mysql-test/r/insert_select.result.es: Test.es fixed --- mysql-test/r/insert_select.result.es | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/mysql-test/r/insert_select.result.es b/mysql-test/r/insert_select.result.es index 9e11402733d..9cac6d31b8f 100644 --- a/mysql-test/r/insert_select.result.es +++ b/mysql-test/r/insert_select.result.es @@ -633,3 +633,15 @@ No Field Count 0 1 100 0 2 100 drop table t1, t2; +CREATE TABLE t1 ( +ID int(11) NOT NULL auto_increment, +NO int(11) NOT NULL default '0', +SEQ int(11) NOT NULL default '0', +PRIMARY KEY (ID), +KEY t1$NO (SEQ,NO) +) ENGINE=MyISAM; +INSERT INTO t1 (SEQ, NO) SELECT "1" AS SEQ, IF(MAX(NO) IS NULL, 0, MAX(NO)) + 1 AS NO FROM t1 WHERE (SEQ = 1); +select SQL_BUFFER_RESULT * from t1 WHERE (SEQ = 1); +ID NO SEQ +1 1 1 +drop table t1; From ededf83143df115f5feaabbbcfeea2494d7d65d5 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 4 Feb 2005 22:43:54 +0100 Subject: [PATCH 0929/1063] Fix for BUG#8055 "Trouble with replication from temporary tables and ignores": when we close the session's temp tables at session end, we automatically write to binlog *one* DROP TEMPORARY TABLE *per tmp table*. mysql-test/r/drop_temp_table.result: result update (note: one DROP TEMPORARY TABLE per tmp table) mysql-test/t/drop_temp_table.test: checking that we have one DROP TEMPORARY TABLE per tmp table now, not one multi-table DROP. Hiding columns Log_pos/End_log_pos per Monty's request. sql/sql_base.cc: When we close the session's temp tables at session end, we automatically write to binlog one DROP TEMPORARY TABLE per tmp table, not one single multi-table DROP TEMPORARY TABLE (because it causes problems if slave has --replicate*table rules). --- mysql-test/r/drop_temp_table.result | 16 ++++--- mysql-test/t/drop_temp_table.test | 3 ++ sql/sql_base.cc | 66 ++++++++++++++--------------- 3 files changed, 45 insertions(+), 40 deletions(-) diff --git a/mysql-test/r/drop_temp_table.result b/mysql-test/r/drop_temp_table.result index 266196877c8..a486964feb2 100644 --- a/mysql-test/r/drop_temp_table.result +++ b/mysql-test/r/drop_temp_table.result @@ -1,7 +1,9 @@ reset master; create database `drop-temp+table-test`; use `drop-temp+table-test`; +create temporary table shortn1 (a int); create temporary table `table:name` (a int); +create temporary table shortn2 (a int); select get_lock("a",10); get_lock("a",10) 1 @@ -10,9 +12,13 @@ get_lock("a",10) 1 show binlog events; Log_name Pos Event_type Server_id Orig_log_pos Info -master-bin.000001 4 Start 1 4 Server ver: VERSION, Binlog ver: 3 -master-bin.000001 79 Query 1 79 create database `drop-temp+table-test` -master-bin.000001 168 Query 1 168 use `drop-temp+table-test`; create temporary table `table:name` (a int) -master-bin.000001 262 Query 1 262 use `drop-temp+table-test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `drop-temp+table-test`.`table:name` -master-bin.000001 391 Query 1 391 use `drop-temp+table-test`; DO RELEASE_LOCK("a") +master-bin.000001 # Start 1 # Server ver: VERSION, Binlog ver: 3 +master-bin.000001 # Query 1 # create database `drop-temp+table-test` +master-bin.000001 # Query 1 # use `drop-temp+table-test`; create temporary table shortn1 (a int) +master-bin.000001 # Query 1 # use `drop-temp+table-test`; create temporary table `table:name` (a int) +master-bin.000001 # Query 1 # use `drop-temp+table-test`; create temporary table shortn2 (a int) +master-bin.000001 # Query 1 # use `drop-temp+table-test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `drop-temp+table-test`.`shortn2` +master-bin.000001 # Query 1 # use `drop-temp+table-test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `drop-temp+table-test`.`table:name` +master-bin.000001 # Query 1 # use `drop-temp+table-test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `drop-temp+table-test`.`shortn1` +master-bin.000001 # Query 1 # use `drop-temp+table-test`; DO RELEASE_LOCK("a") drop database `drop-temp+table-test`; diff --git a/mysql-test/t/drop_temp_table.test b/mysql-test/t/drop_temp_table.test index 1a7d8796bb3..dcd95721179 100644 --- a/mysql-test/t/drop_temp_table.test +++ b/mysql-test/t/drop_temp_table.test @@ -4,7 +4,9 @@ connection con1; reset master; create database `drop-temp+table-test`; use `drop-temp+table-test`; +create temporary table shortn1 (a int); create temporary table `table:name` (a int); +create temporary table shortn2 (a int); select get_lock("a",10); disconnect con1; @@ -15,5 +17,6 @@ connection con2; select get_lock("a",10); let $VERSION=`select version()`; --replace_result $VERSION VERSION +--replace_column 2 # 5 # show binlog events; drop database `drop-temp+table-test`; diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 7434897ab90..fe1f268e277 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -485,62 +485,58 @@ void close_temporary(TABLE *table,bool delete_table) void close_temporary_tables(THD *thd) { TABLE *table,*next; - char *query, *end; - uint query_buf_size; - bool found_user_tables = 0; + char *query, *name_in_query, *end; + uint greatest_key_length= 0; if (!thd->temporary_tables) return; + /* + We write a DROP TEMPORARY TABLE for each temp table left, so that our + replication slave can clean them up. Not one multi-table DROP TABLE binlog + event: this would cause problems if slave uses --replicate-*-table. + */ LINT_INIT(end); - query_buf_size= 50; // Enough for DROP ... TABLE IF EXISTS + /* We'll re-use always same buffer so make it big enough for longest name */ for (table=thd->temporary_tables ; table ; table=table->next) - /* - We are going to add 4 ` around the db/table names, so 1 does not look - enough; indeed it is enough, because table->key_length is greater (by 8, - because of server_id and thread_id) than db||table. - */ - query_buf_size+= table->key_length+1; + greatest_key_length= max(greatest_key_length, table->key_length); - if ((query = alloc_root(thd->mem_root, query_buf_size))) + if ((query = alloc_root(thd->mem_root, greatest_key_length+50))) // Better add "if exists", in case a RESET MASTER has been done - end=strmov(query, "DROP /*!40005 TEMPORARY */ TABLE IF EXISTS "); + name_in_query= strmov(query, "DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `"); for (table=thd->temporary_tables ; table ; table=next) { - if (query) // we might be out of memory, but this is not fatal + /* + In we are OOM for 'query' this is not fatal. We skip temporary tables + not created directly by the user. + */ + if (query && mysql_bin_log.is_open() && (table->real_name[0] != '#')) { - // skip temporary tables not created directly by the user - if (table->real_name[0] != '#') - found_user_tables = 1; /* Here we assume table_cache_key always starts with \0 terminated db name */ - end = strxmov(end,"`",table->table_cache_key,"`.`", - table->real_name,"`,", NullS); + end = strxmov(name_in_query, table->table_cache_key, "`.`", + table->real_name, "`", NullS); + Query_log_event qinfo(thd, query, (ulong)(end-query), 0, FALSE); + /* + Imagine the thread had created a temp table, then was doing a SELECT, and + the SELECT was killed. Then it's not clever to mark the statement above as + "killed", because it's not really a statement updating data, and there + are 99.99% chances it will succeed on slave. And, if thread is + killed now, it's not clever either. + If a real update (one updating a persistent table) was killed on the + master, then this real update will be logged with error_code=killed, + rightfully causing the slave to stop. + */ + qinfo.error_code= 0; + mysql_bin_log.write(&qinfo); } next=table->next; close_temporary(table); } - if (query && found_user_tables && mysql_bin_log.is_open()) - { - /* The -1 is to remove last ',' */ - thd->clear_error(); - Query_log_event qinfo(thd, query, (ulong)(end-query)-1, 0, FALSE); - /* - Imagine the thread had created a temp table, then was doing a SELECT, and - the SELECT was killed. Then it's not clever to mark the statement above as - "killed", because it's not really a statement updating data, and there - are 99.99% chances it will succeed on slave. - If a real update (one updating a persistent table) was killed on the - master, then this real update will be logged with error_code=killed, - rightfully causing the slave to stop. - */ - qinfo.error_code= 0; - mysql_bin_log.write(&qinfo); - } thd->temporary_tables=0; } From 987e620d6376ae3b9047d1185dca7141585173ac Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 4 Feb 2005 23:07:10 +0100 Subject: [PATCH 0930/1063] Backport of ChangeSet 1.1845 05/02/04 13:53:16 guilhem@mysql.com +1 -0 from 5.0. Proposal to fix this problem: when using libmysqlclient, you must call mysql_server_end() to nicely free memory at the end of your program; it however sounds weird to call a function named *SERVER_end* when you're the CLIENT (you're not ending the server, you're ending your ability to talk to servers). So here I add two defines which should be more generic names. Our manual mentions these functions only for libmysqld API so needs some fixing, and then we can close BUG#8099 and BUG#6149. include/mysql.h: Creating synonyms (defines): mysql_library_init for mysql_server_init, mysql_library_end for mysql_server_end; these new names are more generic, so suitable when using libmysqlclient as well as libmysqld. --- include/mysql.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/include/mysql.h b/include/mysql.h index 2c0197e2300..d8a56126756 100644 --- a/include/mysql.h +++ b/include/mysql.h @@ -334,6 +334,17 @@ typedef struct st_mysql_parameters */ int STDCALL mysql_server_init(int argc, char **argv, char **groups); void STDCALL mysql_server_end(void); +/* + mysql_server_init/end need to be called when using libmysqld or + libmysqlclient (exactly, mysql_server_init() is called by mysql_init() so + you don't need to call it explicitely; but you need to call + mysql_server_end() to free memory). The names are a bit misleading + (mysql_SERVER* to be used when using libmysqlCLIENT). So we add more general + names which suit well whether you're using libmysqld or libmysqlclient. We + intend to promote these aliases over the mysql_server* ones. +*/ +#define mysql_library_init mysql_server_init +#define mysql_library_end mysql_server_end MYSQL_PARAMETERS *STDCALL mysql_get_parameters(void); From fe83a1938d51c2fe780631911282902aeae1c0a9 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 5 Feb 2005 01:21:16 +0300 Subject: [PATCH 0931/1063] A fix for Bug#6273 "building fails on link": we should not use CLIENT_LIBS in mysql_config as CLIENT_LIBS point to builddir when we use the bundled zlib. acinclude.m4: Extend MYSQL_CHECK_ZLIB_WITH_COMPRESS m4 macro to substitute ZLIB_DEPS - this is a special version of ZLIB_LIBS to use in mysql_config configure.in: Remove NON_THREADED_CLIENT_LIBS which weren't really NON_THREADED_CLIENT_LIBS and use NON_THREADED_LIBS instead. AC_SUBST NON_THREADED_LIBS and STATIC_NSS_FLAGS as they're now needed inside mysql_config.sh scripts/Makefile.am: Add STATIC_NSS_FLAGS, NON_THREADED_LIBS and ZLIB_DEPS to sed substitution list. scripts/mysql_config.sh: We can't use CLIENT_LIBS as in case when we use the bundled zlib it has a reference to $(top_builddir)/zlib. libs and libs_r now need to be specified explicitly. zlib/Makefile.am: Install libz.la in case it's used by MySQL: this way we guarantee that paths printed by mysql_config are valid in all cases. --- acinclude.m4 | 16 +++++++++++++--- configure.in | 16 ++++++++++------ scripts/Makefile.am | 3 +++ scripts/mysql_config.sh | 7 ++++--- zlib/Makefile.am | 2 +- 5 files changed, 31 insertions(+), 13 deletions(-) diff --git a/acinclude.m4 b/acinclude.m4 index d7e22332655..5ddd8952c42 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -194,6 +194,8 @@ dnl Define zlib paths to point at bundled zlib AC_DEFUN([MYSQL_USE_BUNDLED_ZLIB], [ ZLIB_INCLUDES="-I\$(top_srcdir)/zlib" ZLIB_LIBS="\$(top_builddir)/zlib/libz.la" +dnl Omit -L$pkglibdir as it's always in the list of mysql_config deps. +ZLIB_DEPS="-lz" zlib_dir="zlib" AC_SUBST([zlib_dir]) mysql_cv_compress="yes" @@ -235,8 +237,13 @@ dnl $prefix/lib. If zlib headers or binaries weren't found at $prefix, the dnl macro bails out with error. dnl dnl If the library was found, this function #defines HAVE_COMPRESS -dnl and configure variables ZLIB_INCLUDES (i.e. -I/path/to/zlib/include) and -dnl ZLIB_LIBS (i. e. -L/path/to/zlib/lib -lz). +dnl and configure variables ZLIB_INCLUDES (i.e. -I/path/to/zlib/include), +dnl ZLIB_LIBS (i. e. -L/path/to/zlib/lib -lz) and ZLIB_DEPS which is +dnl used in mysql_config and is always the same as ZLIB_LIBS except to +dnl when we use the bundled zlib. In the latter case ZLIB_LIBS points to the +dnl build dir ($top_builddir/zlib), while mysql_config must point to the +dnl installation dir ($pkglibdir), so ZLIB_DEPS is set to point to +dnl $pkglibdir. AC_DEFUN([MYSQL_CHECK_ZLIB_WITH_COMPRESS], [ AC_MSG_CHECKING([for zlib compression library]) @@ -285,7 +292,11 @@ case $SYSTEM_TYPE in ;; esac if test "$mysql_cv_compress" = "yes"; then + if test "x$ZLIB_DEPS" = "x"; then + ZLIB_DEPS="$ZLIB_LIBS" + fi AC_SUBST([ZLIB_LIBS]) + AC_SUBST([ZLIB_DEPS]) AC_SUBST([ZLIB_INCLUDES]) AC_DEFINE([HAVE_COMPRESS], [1], [Define to enable compression support]) fi @@ -1039,7 +1050,6 @@ AC_MSG_CHECKING(for OpenSSL) echo "You can't use the --all-static link option when using openssl." exit 1 fi - NON_THREADED_CLIENT_LIBS="$NON_THREADED_CLIENT_LIBS $openssl_libs" else AC_MSG_RESULT(no) if test ! -z "$openssl_includes" diff --git a/configure.in b/configure.in index caa42004736..665029accb3 100644 --- a/configure.in +++ b/configure.in @@ -924,9 +924,11 @@ if test "$ac_cv_header_termio_h" = "no" -a "$ac_cv_header_termios_h" = "no" then AC_CHECK_FUNC(gtty, , AC_CHECK_LIB(compat, gtty)) fi -# We make a special variable for client library's to avoid including -# thread libs in the client. -NON_THREADED_CLIENT_LIBS="$LIBS $ZLIB_LIBS" + +# We make a special variable for non-threaded version of LIBS to avoid +# including thread libs into non-threaded version of MySQL client library. +# Later in this script LIBS will be augmented with a threads library. +NON_THREADED_LIBS="$LIBS" AC_MSG_CHECKING([for int8]) case $SYSTEM_TYPE in @@ -1502,7 +1504,7 @@ then if test -f /usr/lib/libxnet.so -a "$SYSTEM_TYPE" = "sni-sysv4" then LIBS="-lxnet $LIBS" - NON_THREADED_CLIENT_LIBS="$NON_THREADED_CLIENT_LIBS -lxnet" + NON_THREADED_LIBS="-lxnet $NON_THREADED_LIBS" with_named_thread="-Kthread $LDFLAGS -lxnet" LD_FLAGS="" CFLAGS="-Kthread $CFLAGS" @@ -2826,7 +2828,7 @@ dnl This probably should be cleaned up more - for now the threaded dnl client is just using plain-old libs. sql_client_dirs="libmysql strings regex client" linked_client_targets="linked_libmysql_sources" -CLIENT_LIBS=$NON_THREADED_CLIENT_LIBS + if test "$THREAD_SAFE_CLIENT" != "no" then sql_client_dirs="libmysql_r $sql_client_dirs" @@ -2834,9 +2836,11 @@ then AC_DEFINE([THREAD_SAFE_CLIENT], [1], [Should be client be thread safe]) fi -CLIENT_LIBS="$CLIENT_LIBS $STATIC_NSS_FLAGS" +CLIENT_LIBS="$NON_THREADED_LIBS $openssl_libs $ZLIB_LIBS $STATIC_NSS_FLAGS" AC_SUBST(CLIENT_LIBS) +AC_SUBST(NON_THREADED_LIBS) +AC_SUBST(STATIC_NSS_FLAGS) AC_SUBST(sql_client_dirs) AC_SUBST(linked_client_targets) diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 71b70fc0e4a..d5337df35b1 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -140,6 +140,9 @@ SUFFIXES = .sh -e 's!@''IS_LINUX''@!@IS_LINUX@!' \ -e "s!@""CONF_COMMAND""@!@CONF_COMMAND@!" \ -e 's!@''MYSQLD_USER''@!@MYSQLD_USER@!' \ + -e 's!@''STATIC_NSS_FLAGS''@!@STATIC_NSS_FLAGS@!' \ + -e 's!@''NON_THREADED_LIBS''@!@NON_THREADED_LIBS@!' \ + -e 's!@''ZLIB_DEPS''@!@ZLIB_DEPS@!' \ -e "s!@MAKE@!$(MAKE)!" \ $< > $@-t @CHMOD@ +x $@-t diff --git a/scripts/mysql_config.sh b/scripts/mysql_config.sh index 90418de3d1d..a5c8af5ecb2 100644 --- a/scripts/mysql_config.sh +++ b/scripts/mysql_config.sh @@ -82,13 +82,14 @@ version='@VERSION@' socket='@MYSQL_UNIX_ADDR@' port='@MYSQL_TCP_PORT@' ldflags='@LDFLAGS@' -client_libs='@CLIENT_LIBS@' # Create options -libs="$ldflags -L$pkglibdir -lmysqlclient $client_libs" +libs="$ldflags -L$pkglibdir -lmysqlclient @ZLIB_DEPS@ @NON_THREADED_LIBS@" +libs="$libs @openssl_libs@ @STATIC_NSS_FLAGS@" libs=`echo "$libs" | sed -e 's; \+; ;g' | sed -e 's;^ *;;' | sed -e 's; *\$;;'` -libs_r="$ldflags -L$pkglibdir -lmysqlclient_r @LIBS@ @ZLIB_LIBS@ @openssl_libs@" + +libs_r="$ldflags -L$pkglibdir -lmysqlclient_r @ZLIB_DEPS@ @LIBS@ @openssl_libs@" libs_r=`echo "$libs_r" | sed -e 's; \+; ;g' | sed -e 's;^ *;;' | sed -e 's; *\$;;'` cflags="-I$pkgincludedir @CFLAGS@ " #note: end space! include="-I$pkgincludedir" diff --git a/zlib/Makefile.am b/zlib/Makefile.am index 58d3811cd7c..e94d184a841 100644 --- a/zlib/Makefile.am +++ b/zlib/Makefile.am @@ -16,7 +16,7 @@ # Process this file with automake to create Makefile.in -noinst_LTLIBRARIES=libz.la +pkglib_LTLIBRARIES=libz.la noinst_HEADERS= crc32.h deflate.h inffast.h inffixed.h inflate.h \ inftrees.h trees.h zconf.h zlib.h zutil.h From 37b4b89ebe3beb834bcea3b4481204f7bb4d0ade Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 6 Feb 2005 10:00:29 +0100 Subject: [PATCH 0932/1063] bug8262 - ndb crash if scan is poped from queue before all attrinfo has arrived ndb/src/kernel/blocks/dblqh/DblqhMain.cpp: only restart scan if all attrinfo has arrived otherwise just set remove from queue and set state ndb/src/kernel/blocks/dbtc/DbtcMain.cpp: new error insert - force send attrinfo ndb/test/ndbapi/testScan.cpp: new test bug8262 many threads - scanning small tables ndb/test/run-test/daily-basic-tests.txt: run new test case in autotest --- ndb/src/kernel/blocks/dblqh/DblqhMain.cpp | 19 ++++++++++---- ndb/src/kernel/blocks/dbtc/DbtcMain.cpp | 4 +++ ndb/test/ndbapi/testScan.cpp | 30 ++++++++++++++++++++--- ndb/test/run-test/daily-basic-tests.txt | 4 +++ 4 files changed, 49 insertions(+), 8 deletions(-) diff --git a/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp b/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp index 8bbbc72a38d..c79f4dfc6c7 100644 --- a/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp +++ b/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp @@ -8719,13 +8719,14 @@ void Dblqh::finishScanrec(Signal* signal) return; } + ndbrequire(restart.p->scanState == ScanRecord::IN_QUEUE); + ScanRecordPtr tmpScan = scanptr; TcConnectionrecPtr tmpTc = tcConnectptr; tcConnectptr.i = restart.p->scanTcrec; ptrCheckGuard(tcConnectptr, ctcConnectrecFileSize, tcConnectionrec); restart.p->scanNumber = scanNumber; - restart.p->scanState = ScanRecord::WAIT_ACC_SCAN; queue.remove(restart); scans.add(restart); @@ -8740,10 +8741,18 @@ void Dblqh::finishScanrec(Signal* signal) ndbout_c("adding-r (%d %d)", restart.p->scanNumber, restart.p->fragPtrI); #endif } - - scanptr = restart; - continueAfterReceivingAllAiLab(signal); - + + restart.p->scanState = ScanRecord::SCAN_FREE; // set in initScanRec + if(tcConnectptr.p->transactionState == TcConnectionrec::SCAN_STATE_USED) + { + jam(); + scanptr = restart; + continueAfterReceivingAllAiLab(signal); + } + else + { + ndbrequire(tcConnectptr.p->transactionState == TcConnectionrec::WAIT_SCAN_AI); + } scanptr = tmpScan; tcConnectptr = tmpTc; }//Dblqh::finishScanrec() diff --git a/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp b/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp index c804fa32bd2..97931041e2a 100644 --- a/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp +++ b/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp @@ -9028,6 +9028,8 @@ void Dbtc::execDIGETPRIMCONF(Signal* signal) scanFragptr.p->lqhBlockref = ref; scanFragptr.p->m_connectCount = getNodeInfo(tnodeid).m_connectCount; sendScanFragReq(signal, scanptr.p, scanFragptr.p); + if(ERROR_INSERTED(8035)) + globalTransporterRegistry.performSend(); attrbufptr.i = cachePtr.p->firstAttrbuf; while (attrbufptr.i != RNIL) { jam(); @@ -9037,6 +9039,8 @@ void Dbtc::execDIGETPRIMCONF(Signal* signal) attrbufptr.p, ref); attrbufptr.i = attrbufptr.p->attrbuf[ZINBUF_NEXT]; + if(ERROR_INSERTED(8035)) + globalTransporterRegistry.performSend(); }//while scanFragptr.p->scanFragState = ScanFragRec::LQH_ACTIVE; scanFragptr.p->startFragTimer(ctcTimer); diff --git a/ndb/test/ndbapi/testScan.cpp b/ndb/test/ndbapi/testScan.cpp index 22ec3fff327..f1018d29846 100644 --- a/ndb/test/ndbapi/testScan.cpp +++ b/ndb/test/ndbapi/testScan.cpp @@ -35,7 +35,8 @@ getTable(Ndb* pNdb, int i){ int runLoadTable(NDBT_Context* ctx, NDBT_Step* step){ - int records = ctx->getNumRecords(); + int records = ctx->getProperty("Rows", ctx->getNumRecords()); + HugoTransactions hugoTrans(*ctx->getTab()); if (hugoTrans.loadTable(GETNDB(step), records) != 0){ return NDBT_FAILED; @@ -264,7 +265,7 @@ int runVerifyTable(NDBT_Context* ctx, NDBT_Step* step){ int runScanRead(NDBT_Context* ctx, NDBT_Step* step){ int loops = ctx->getNumLoops(); - int records = ctx->getNumRecords(); + int records = ctx->getProperty("Rows", ctx->getNumRecords()); int parallelism = ctx->getProperty("Parallelism", 240); int abort = ctx->getProperty("AbortProb", 5); @@ -375,7 +376,20 @@ int runScanReadError(NDBT_Context* ctx, NDBT_Step* step){ restarter.insertErrorInAllNodes(0); return result; } - + +int +runInsertError(NDBT_Context* ctx, NDBT_Step* step){ + int error = ctx->getProperty("ErrorCode"); + NdbRestarter restarter; + + ctx->setProperty("ErrorCode", (Uint32)0); + if (restarter.insertErrorInAllNodes(error) != 0){ + ndbout << "Could not insert error in all nodes "<getNumLoops(); @@ -1221,6 +1235,16 @@ TESTCASE("ScanRead100", STEPS(runScanRead, 100); FINALIZER(runClearTable); } +TESTCASE("Scan-bug8262", + ""){ + TC_PROPERTY("Rows", 1); + TC_PROPERTY("ErrorCode", 8035); + INITIALIZER(runLoadTable); + INITIALIZER(runInsertError); // Will reset error code + STEPS(runScanRead, 25); + FINALIZER(runInsertError); + FINALIZER(runClearTable); +} TESTCASE("ScanRead40RandomTable", "Verify scan requirement: Scan with 40 simultaneous threads. "\ "Use random table for the scan"){ diff --git a/ndb/test/run-test/daily-basic-tests.txt b/ndb/test/run-test/daily-basic-tests.txt index 87f86795370..c62908ae999 100644 --- a/ndb/test/run-test/daily-basic-tests.txt +++ b/ndb/test/run-test/daily-basic-tests.txt @@ -378,6 +378,10 @@ max-time: 500 cmd: testScan args: -n ScanRestart T1 +max-time: 500 +cmd: testScan +args: -l 100 -n Scan-bug8262 T7 + # OLD FLEX max-time: 500 cmd: flexBench From 3455bc53988cad19cabf204e2d0f4d3477f67b35 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 6 Feb 2005 13:06:12 +0200 Subject: [PATCH 0933/1063] fixed test 'subselect' in case when innodb is not compiled in (thanks HF who niticed it) mysql-test/r/subselect.result: test depends on innodb moved from 'subselect' to 'subselect_innodb' mysql-test/r/subselect_innodb.result: test depends on innodb moved from 'subselect' to 'subselect_innodb' mysql-test/t/subselect.test: test depends on innodb moved from 'subselect' to 'subselect_innodb' mysql-test/t/subselect_innodb.test: test depends on innodb moved from 'subselect' to 'subselect_innodb' --- mysql-test/r/subselect.result | 12 ------------ mysql-test/r/subselect_innodb.result | 12 ++++++++++++ mysql-test/t/subselect.test | 14 -------------- mysql-test/t/subselect_innodb.test | 14 ++++++++++++++ 4 files changed, 26 insertions(+), 26 deletions(-) diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index 437fd624ae1..03dcc23c919 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -2196,15 +2196,3 @@ ERROR 42S22: Reference 'xx' not supported (forward reference in item list) select 1 = ALL (select 1 from t1 where 1 = xx ), 1 as xx from DUAL; ERROR 42S22: Reference 'xx' not supported (forward reference in item list) drop table t1; -CREATE TABLE `t1` ( `a` char(3) NOT NULL default '', `b` char(3) NOT NULL default '', `c` char(3) NOT NULL default '', PRIMARY KEY (`a`,`b`,`c`)) ENGINE=InnoDB; -CREATE TABLE t2 LIKE t1; -INSERT INTO t1 VALUES (1,1,1); -INSERT INTO t2 VALUES (1,1,1); -PREPARE my_stmt FROM "SELECT t1.b, count(*) FROM t1 group by t1.b having -count(*) > ALL (SELECT COUNT(*) FROM t2 WHERE t2.a=1 GROUP By t2.b)"; -EXECUTE my_stmt; -b count(*) -EXECUTE my_stmt; -b count(*) -deallocate prepare my_stmt; -drop table t1,t2; diff --git a/mysql-test/r/subselect_innodb.result b/mysql-test/r/subselect_innodb.result index 0b813a07a1d..0666fd76661 100644 --- a/mysql-test/r/subselect_innodb.result +++ b/mysql-test/r/subselect_innodb.result @@ -140,3 +140,15 @@ id date1 coworkerid description sum_used sum_remaining comments 6 2004-01-01 1 test 22 33 comment 7 2004-01-01 1 test 22 33 comment drop table t1; +CREATE TABLE `t1` ( `a` char(3) NOT NULL default '', `b` char(3) NOT NULL default '', `c` char(3) NOT NULL default '', PRIMARY KEY (`a`,`b`,`c`)) ENGINE=InnoDB; +CREATE TABLE t2 LIKE t1; +INSERT INTO t1 VALUES (1,1,1); +INSERT INTO t2 VALUES (1,1,1); +PREPARE my_stmt FROM "SELECT t1.b, count(*) FROM t1 group by t1.b having +count(*) > ALL (SELECT COUNT(*) FROM t2 WHERE t2.a=1 GROUP By t2.b)"; +EXECUTE my_stmt; +b count(*) +EXECUTE my_stmt; +b count(*) +deallocate prepare my_stmt; +drop table t1,t2; diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test index cdec080611d..55400dae0be 100644 --- a/mysql-test/t/subselect.test +++ b/mysql-test/t/subselect.test @@ -1465,17 +1465,3 @@ select 1 = ALL (select 1 from t1 where 1 = xx ), 1 as xx; -- error 1247 select 1 = ALL (select 1 from t1 where 1 = xx ), 1 as xx from DUAL; drop table t1; - -# -# cleaning up of results of subselects (BUG#8125) -# -CREATE TABLE `t1` ( `a` char(3) NOT NULL default '', `b` char(3) NOT NULL default '', `c` char(3) NOT NULL default '', PRIMARY KEY (`a`,`b`,`c`)) ENGINE=InnoDB; -CREATE TABLE t2 LIKE t1; -INSERT INTO t1 VALUES (1,1,1); -INSERT INTO t2 VALUES (1,1,1); -PREPARE my_stmt FROM "SELECT t1.b, count(*) FROM t1 group by t1.b having -count(*) > ALL (SELECT COUNT(*) FROM t2 WHERE t2.a=1 GROUP By t2.b)"; -EXECUTE my_stmt; -EXECUTE my_stmt; -deallocate prepare my_stmt; -drop table t1,t2; diff --git a/mysql-test/t/subselect_innodb.test b/mysql-test/t/subselect_innodb.test index aa7fe138876..5d796988178 100644 --- a/mysql-test/t/subselect_innodb.test +++ b/mysql-test/t/subselect_innodb.test @@ -145,3 +145,17 @@ SELECT DISTINCT FROM t1; select * from t1; drop table t1; + +# +# cleaning up of results of subselects (BUG#8125) +# +CREATE TABLE `t1` ( `a` char(3) NOT NULL default '', `b` char(3) NOT NULL default '', `c` char(3) NOT NULL default '', PRIMARY KEY (`a`,`b`,`c`)) ENGINE=InnoDB; +CREATE TABLE t2 LIKE t1; +INSERT INTO t1 VALUES (1,1,1); +INSERT INTO t2 VALUES (1,1,1); +PREPARE my_stmt FROM "SELECT t1.b, count(*) FROM t1 group by t1.b having +count(*) > ALL (SELECT COUNT(*) FROM t2 WHERE t2.a=1 GROUP By t2.b)"; +EXECUTE my_stmt; +EXECUTE my_stmt; +deallocate prepare my_stmt; +drop table t1,t2; From b19ff40dda17c7ee6cfd3c7019c59cdb77fdbd6f Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 7 Feb 2005 00:12:46 -0600 Subject: [PATCH 0934/1063] Do-solaris-pkg: Perl script to create Solaris installation packages. --- Build-tools/Do-solaris-pkg | 180 +++++++++++++++++++++++++++++++++++++ 1 file changed, 180 insertions(+) create mode 100644 Build-tools/Do-solaris-pkg diff --git a/Build-tools/Do-solaris-pkg b/Build-tools/Do-solaris-pkg new file mode 100644 index 00000000000..5b7326f78e2 --- /dev/null +++ b/Build-tools/Do-solaris-pkg @@ -0,0 +1,180 @@ +#!/usr/bin/perl +# +# Script to create Solaris packages +# +$INTERACTIVE= 0; +$find = "/usr/bin/find"; +$pkgproto = "/usr/bin/pkgproto"; +$pkgmk = "/usr/bin/pkgmk -o"; +$pkgtrans = "/usr/bin/pkgtrans"; +$temp = "/tmp/prototype$$"; +$prototype = "prototype"; +$pkginfo = "pkginfo"; +($gid ,$pkg ,$uid ,$userInfo ,$email ,$quota ,$group ,$passwd +,$category ,$userHome ,$vendor ,$loginShell ,$pstamp ,$basedir)=(); + +$fullname = shift @ARGV; +$fullname or die "No package name was specified"; +-d $fullname or die "That directory is not present!"; + +$fullname =~ s,/+$,,; # Remove ending slash if any + +$pkgdir = `cd ../pkgs; pwd`; +$pwd = `pwd`; +if ($pwd =~ '\/usr\/local') { + $pwd = $`; +} +die "Wrong location, please cd to /usr/local/ and run again.\n" + if ($pwd eq ""); + +system ("$find . -print | $pkgproto > $temp"); +open (PREPROTO,"<$temp") or die "Unable to read prototype information ($!)\n"; +open (PROTO,">$prototype") or die "Unable to write file prototype ($!)\n"; +print PROTO "i pkginfo=./$pkginfo\n"; +while () { + # Read the prototype information from /tmp/prototype$$ + chomp; + $thisline = $_; + if ($thisline =~ " prototype " + or $thisline =~ " pkginfo ") { + # We don't need that line + } elsif ($thisline =~ "^[fd] ") { + # Change the ownership for files and directories + ($dir, $none, $file, $mode, $user, $group) = split / /,$thisline; + print PROTO "$dir $none $file $mode bin bin\n"; + } else { + # Symlinks and other stuff should be printed as well ofcourse + print PROTO "$thisline\n"; + } +} +close PROTO; +close PREPROTO; + +# Clean up +unlink $temp or warn "Unable to remove tempfile ($!)\n"; + +# Now we can start building the package +# +# First get some info + +$fullname =~ /^((mysql)-.+)-([\d\.]+)-.+$/ + or die "This name is not what I expected - \"$fullname\""; + +$default{"name"}= $2; +$default{"version"}= $3; +$default{"pkg"}= $1; +$default{"arch"} = `uname -m`; +chomp $default{"arch"}; +$default{"category"}= "application"; +$default{"vendor"}= "MySQL AB"; +$default{"email"}= "build\@mysql.com"; +$default{"pstamp"}= "MySQL AB Build Engineers"; +$os = `uname -r`; +$os =~ '\.'; +$os = "sol$'"; +chomp $os; +$default{"basedir"}= "/usr/local"; +$default{"packagename"}= $fullname; + +# Check for correctness of guessed values by userinput + +%questions = ( + pkg => "Please give the name for this package", + name => "Now enter the real name for this package", + arch => "What architecture did you build the package on?", + version => "Enter the version number of the package", + category => "What category does this package belong to?", + vendor => "Who is the vendor of this package?", + email => "Enter the email adress for contact", + pstamp => "Enter your own name", + basedir => "What is the basedir this package will install into?", + packagename => "How should I call the packagefile?", +); + +@vars = qw(pkg name arch version category vendor email pstamp basedir + packagename); +foreach $varname (@vars) { + getvar_noq($varname); +} + +if ($INTERACTIVE) { + while (!&chkvar()) { + print "\n"; + foreach $varname (@vars) { + getvar($varname); + } + @vars = qw(pkg name arch version category vendor email pstamp basedir + packagename); + } +} +$classes = "none"; + +# Create the pkginfo file + +print "\nNow creating $pkginfo file\n"; +open (PKGINFO,">$pkginfo") || die "Unable to open $pkginfo for writing ($!)\n"; +print PKGINFO "PKG=\"$pkg\"\n"; +print PKGINFO "NAME=\"$name\"\n"; +print PKGINFO "ARCH=\"$arch\"\n"; +print PKGINFO "VERSION=\"$version\"\n"; +print PKGINFO "CATEGORY=\"$category\"\n"; +print PKGINFO "VENDOR=\"$vendor\"\n"; +print PKGINFO "EMAIL=\"$email\"\n"; +print PKGINFO "PSTAMP=\"$pstamp\"\n"; +print PKGINFO "BASEDIR=\"$basedir\"\n"; +print PKGINFO "CLASSES=\"$classes\"\n"; +close PKGINFO; +print "Done.\n"; + +# Build and zip the package + +print "Building package\n"; +system ("$pkgmk -r `pwd`"); +system ("(cd /var/spool/pkg; $pkgtrans -s -o `pwd` /tmp/$packagename $pkg)"); +system ("gzip /tmp/$packagename"); + +# Clean-up the spool area +system ("(cd /var/spool/pkg; rm -rf $pkg)"); +unlink $pkginfo; +unlink $prototype; +system ("mv /tmp/${packagename}.gz $pkgdir"); +print "Done. (~/packaging/pkgs/$packagename.gz)\n"; +# The subroutines +sub chkvar { + print "\n"; + + print "PKG=$pkg\n"; + print "NAME=$name\n"; + print "ARCH=$arch\n"; + print "VERSION=$version\n"; + print "CATEGORY=$category\n"; + print "VENDOR=$vendor\n"; + print "EMAIL=$email\n"; + print "PSTAMP=$pstamp\n"; + print "BASEDIR=$basedir\n"; + print "PACKAGENAME=$packagename\n"; + + + print "\nIs this information correct? [Y/n]: "; + my $answer= ; + chomp $answer; + $answer= 'Y' if ($answer eq ""); + $answer= uc $answer; + my $res= ($answer eq 'Y')? 1 : 0; + return($res); +} + +sub getvar_noq { + my $questionname = "@_"; + $$questionname = $default{$questionname}; +} + +sub getvar { + my $questionname = "@_"; + my $ucquestionname= uc $questionname; + print "$ucquestionname: $questions{$questionname} [$default{\"$questionname\"}]: "; + my $answer = ; + chomp $answer; + $$questionname = $answer; + $$questionname = $default{$questionname} if ($$questionname eq ""); +} From d3a6f130e212d3a306c624ee777704b30f9ceef8 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 7 Feb 2005 01:27:58 -0600 Subject: [PATCH 0935/1063] Do-solaris-pkg: Deposit the new .pkg.gz into the ~/$hostname/ directory Build-tools/Do-solaris-pkg: Deposit the new .pkg.gz into the ~/$hostname/ directory --- Build-tools/Do-solaris-pkg | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Build-tools/Do-solaris-pkg b/Build-tools/Do-solaris-pkg index 5b7326f78e2..374113b28a1 100644 --- a/Build-tools/Do-solaris-pkg +++ b/Build-tools/Do-solaris-pkg @@ -3,6 +3,7 @@ # Script to create Solaris packages # $INTERACTIVE= 0; +$hostname= `hostname`; $find = "/usr/bin/find"; $pkgproto = "/usr/bin/pkgproto"; $pkgmk = "/usr/bin/pkgmk -o"; @@ -19,7 +20,7 @@ $fullname or die "No package name was specified"; $fullname =~ s,/+$,,; # Remove ending slash if any -$pkgdir = `cd ../pkgs; pwd`; +$pkgdir= `cd ../$hostname; pwd`; $pwd = `pwd`; if ($pwd =~ '\/usr\/local') { $pwd = $`; @@ -74,7 +75,7 @@ $os =~ '\.'; $os = "sol$'"; chomp $os; $default{"basedir"}= "/usr/local"; -$default{"packagename"}= $fullname; +$default{"packagename"}= $fullname . '.pkg'; # Check for correctness of guessed values by userinput @@ -138,7 +139,7 @@ system ("(cd /var/spool/pkg; rm -rf $pkg)"); unlink $pkginfo; unlink $prototype; system ("mv /tmp/${packagename}.gz $pkgdir"); -print "Done. (~/packaging/pkgs/$packagename.gz)\n"; +print "Done. (~/$hostname/$packagename.gz)\n"; # The subroutines sub chkvar { print "\n"; From 4fd3b1cf41dc92dbd99a71b67beeae53eb3ec133 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 7 Feb 2005 08:51:27 +0100 Subject: [PATCH 0936/1063] Corrected fragmentation calculation to take into account that LQH creates "2 fragments per fragment" in 4.1 and 5.0 +added some comments to ndb fragmentation calulation --- sql/ha_ndbcluster.cc | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 9f0da616289..b4e05ace27b 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -3513,18 +3513,23 @@ static void ndb_set_fragmentation(NDBTAB &tab, TABLE *form, uint pk_length) uint no_fragments; { #if MYSQL_VERSION_ID >= 50000 - uint acc_row_size= 25+2; + uint acc_row_size= 25 + /*safety margin*/ 2; #else uint acc_row_size= pk_length*4; /* add acc overhead */ - if (pk_length <= 8) - acc_row_size+= 25+2; /* main page will set the limit */ - else - acc_row_size+= 4+4; /* overflow page will set the limit */ + if (pk_length <= 8) /* main page will set the limit */ + acc_row_size+= 25 + /*safety margin*/ 2; + else /* overflow page will set the limit */ + acc_row_size+= 4 + /*safety margin*/ 4; #endif ulonglong acc_fragment_size= 512*1024*1024; ulonglong max_rows= form->max_rows; +#if MYSQL_VERSION_ID >= 50100 + no_fragments= ((max_rows*acc_row_size)/acc_fragment_size+1 + +1/*correct rounding*/)/2; +#else no_fragments= (max_rows*acc_row_size)/acc_fragment_size+1; +#endif } { uint no_nodes= g_ndb_cluster_connection->no_db_nodes(); From e4add35d34b3d727067fee63ae409b20b641b1b2 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 7 Feb 2005 02:18:12 -0600 Subject: [PATCH 0937/1063] Do-solaris-pkg: Minor tweaks to work properly Build-tools/Do-solaris-pkg: Minor tweaks to work properly --- Build-tools/Do-solaris-pkg | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Build-tools/Do-solaris-pkg b/Build-tools/Do-solaris-pkg index 374113b28a1..685a1f0923b 100644 --- a/Build-tools/Do-solaris-pkg +++ b/Build-tools/Do-solaris-pkg @@ -3,7 +3,7 @@ # Script to create Solaris packages # $INTERACTIVE= 0; -$hostname= `hostname`; +chomp ($hostname= `hostname`); $find = "/usr/bin/find"; $pkgproto = "/usr/bin/pkgproto"; $pkgmk = "/usr/bin/pkgmk -o"; @@ -75,7 +75,7 @@ $os =~ '\.'; $os = "sol$'"; chomp $os; $default{"basedir"}= "/usr/local"; -$default{"packagename"}= $fullname . '.pkg'; +$default{"packagename"}= "${fullname}.pkg"; # Check for correctness of guessed values by userinput @@ -136,6 +136,8 @@ system ("gzip /tmp/$packagename"); # Clean-up the spool area system ("(cd /var/spool/pkg; rm -rf $pkg)"); +# Clean-up the ~/packaging/ area +system ("(rm -rf mysql*)"); unlink $pkginfo; unlink $prototype; system ("mv /tmp/${packagename}.gz $pkgdir"); From aa2ac91c975d77f2ea020849a4e24c1fc97db1bf Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 7 Feb 2005 09:58:37 +0100 Subject: [PATCH 0938/1063] ha_ndbcluster.cc: corrected typo in previous changeset sql/ha_ndbcluster.cc: corrected typo in previous changeset --- sql/ha_ndbcluster.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index b4e05ace27b..9e34baae198 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -3525,10 +3525,10 @@ static void ndb_set_fragmentation(NDBTAB &tab, TABLE *form, uint pk_length) ulonglong acc_fragment_size= 512*1024*1024; ulonglong max_rows= form->max_rows; #if MYSQL_VERSION_ID >= 50100 + no_fragments= (max_rows*acc_row_size)/acc_fragment_size+1; +#else no_fragments= ((max_rows*acc_row_size)/acc_fragment_size+1 +1/*correct rounding*/)/2; -#else - no_fragments= (max_rows*acc_row_size)/acc_fragment_size+1; #endif } { From f3f2ec2f91abc1c6a6486e5ca4f6e2fdbe20343d Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 7 Feb 2005 13:25:03 +0100 Subject: [PATCH 0939/1063] compile-solaris-sparc-purify: Set CCLD as well BUILD/compile-solaris-sparc-purify: Set CCLD as well --- BUILD/compile-solaris-sparc-purify | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/BUILD/compile-solaris-sparc-purify b/BUILD/compile-solaris-sparc-purify index 0e530f75b60..5f5ba81396f 100755 --- a/BUILD/compile-solaris-sparc-purify +++ b/BUILD/compile-solaris-sparc-purify @@ -61,7 +61,7 @@ purifying_binaries () if [ -n "$cxxfilt" ] ; then opts="$opts -demangle-program=$cxxfilt" fi - opts="$opts -best-effort g++" + opts="$opts -best-effort" back=`pwd` cd $dir @@ -76,17 +76,17 @@ purifying_binaries () fi if [ -n "$mode" -a $mode = purify ] ; then - gmake CXXLD="purify $opts" $target + gmake CCLD="purify $opts gcc" CXXLD="purify $opts g++" $target mv $binary $binary-purify fi if [ -n "$mode" -a $mode = quantify ] ; then - gmake CXXLD="quantify $opts" $target + gmake CCLD="quantify $opts gcc" CXXLD="quantify $opts g++" $target mv $binary $binary-quantify fi if [ -n "$mode" -a $mode = purecov ] ; then - gmake CXXLD="purecov $opts" $target + gmake CCLD="purecov $opts gcc" CXXLD="purecov $opts g++" $target mv $binary $binary-purecov fi From e7119f62a8452678c9ab99bb1b57905dbbeb2978 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 7 Feb 2005 16:25:07 +0100 Subject: [PATCH 0940/1063] mysql.spec.sh: removed typo moved pre to post for directory creation add changelog comments support-files/mysql.spec.sh: removed typo moved pre to post for directory creation add changelog comments --- support-files/mysql.spec.sh | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index 0d72356731c..b06ba462b26 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -488,14 +488,7 @@ chmod -R og-rw $mysql_datadir/mysql sleep 2 -%pre ndb-storage -mysql_clusterdir=/var/lib/mysql-cluster - -# Create cluster directory if needed -if test ! -d $mysql_clusterdir; then mkdir -m755 $mysql_clusterdir; fi - - -%pre ndb-storage +%post ndb-storage mysql_clusterdir=/var/lib/mysql-cluster # Create cluster directory if needed @@ -701,6 +694,12 @@ fi # itself - note that they must be ordered by date (important when # merging BK trees) %changelog +* Monday Feb 7 2005 Tomas Ulin + +- enabled the "Ndbcluster" storage engine for the max binary +- added extra make install in ndb subdir after Max build to get ndb binaries +- added packages for ndbcluster storage engine + * Fri Jan 14 2005 Lenz Grimmer - replaced obsoleted "BuildPrereq" with "BuildRequires" instead From d6ed8cd7097391b55936a1dfec248da65e7f64f9 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 7 Feb 2005 18:13:57 +0200 Subject: [PATCH 0941/1063] Fixed bug in HAVING when refering to RAND() through alias (BUG 8216) mysql-test/r/group_by.result: New test case mysql-test/r/user_var.result: Test changed (to be more correct) with bug fix mysql-test/t/group_by.test: Added test for HAVING bug sql/item_cmpfunc.cc: Fixed bug in HAVING when refering to RAND() sql/item_func.cc: Fixed bug in HAVING when refering to RAND() sql/item_row.cc: Fixed bug in HAVING when refering to RAND() sql/item_strfunc.cc: Fixed bug in HAVING when refering to RAND() sql/unireg.h: Added PSEUDO_TABLES_BITS for easy testing of real table reference --- mysql-test/r/group_by.result | 45 ++++++++++++++++++++++++++++------- mysql-test/r/user_var.result | 4 ++-- mysql-test/t/group_by.test | 32 ++++++++++++++++++------- sql/item_cmpfunc.cc | 46 ++++++++++++++++++++++++++++++++++-- sql/item_func.cc | 8 +++++-- sql/item_row.cc | 11 ++++++--- sql/item_strfunc.cc | 7 ++++-- sql/unireg.h | 2 ++ 8 files changed, 126 insertions(+), 29 deletions(-) diff --git a/mysql-test/r/group_by.result b/mysql-test/r/group_by.result index f92b3ea4f4d..17b1bb03d1d 100644 --- a/mysql-test/r/group_by.result +++ b/mysql-test/r/group_by.result @@ -629,15 +629,6 @@ explain SELECT i, COUNT(DISTINCT(i)) FROM t1 GROUP BY j ORDER BY NULL; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 6 Using filesort DROP TABLE t1; -create table t1 ( col1 int, col2 int ); -insert into t1 values (1,1),(1,2),(1,3),(2,1),(2,2); -select group_concat( distinct col1 ) as alias from t1 -group by col2 having alias like '%'; -alias -1,2 -1,2 -1 -drop table t1; create table t1 (a int); insert into t1 values(null); select min(a) is null from t1; @@ -650,3 +641,39 @@ select 1 and min(a) is null from t1; 1 and min(a) is null 1 drop table t1; +create table t1 ( col1 int, col2 int ); +insert into t1 values (1,1),(1,2),(1,3),(2,1),(2,2); +select group_concat( distinct col1 ) as alias from t1 +group by col2 having alias like '%'; +alias +1,2 +1,2 +1 +drop table t1; +create table t1 (a integer, b integer, c integer); +insert into t1 (a,b) values (1,2),(1,3),(2,5); +select a, 0.1*0+1 r2, sum(1) r1 from t1 where a = 1 group by a having r1>1 and r2=1; +a r2 r1 +1 1.0 2 +select a, rand()*0+1 r2, sum(1) r1 from t1 where a = 1 group by a having r1>1 and r2=1; +a r2 r1 +1 1 2 +select a,sum(b) from t1 where a=1 group by c; +a sum(b) +1 5 +select a*sum(b) from t1 where a=1 group by c; +a*sum(b) +5 +select sum(a)*sum(b) from t1 where a=1 group by c; +sum(a)*sum(b) +10 +select a,sum(b) from t1 where a=1 group by c having a=1; +a sum(b) +1 5 +select a as d,sum(b) from t1 where a=1 group by c having d=1; +d sum(b) +1 5 +select sum(a)*sum(b) as d from t1 where a=1 group by c having d > 0; +d +10 +drop table t1; diff --git a/mysql-test/r/user_var.result b/mysql-test/r/user_var.result index 81846391795..041d1b836b7 100644 --- a/mysql-test/r/user_var.result +++ b/mysql-test/r/user_var.result @@ -109,8 +109,8 @@ select @a:=0; select @a, @a:=@a+count(*), count(*), @a from t1 group by i; @a @a:=@a+count(*) count(*) @a 0 1 1 0 -0 2 2 0 -0 3 3 0 +0 3 2 0 +0 6 3 0 select @a:=0; @a:=0 0 diff --git a/mysql-test/t/group_by.test b/mysql-test/t/group_by.test index c0447b06303..379f668df1a 100644 --- a/mysql-test/t/group_by.test +++ b/mysql-test/t/group_by.test @@ -457,15 +457,6 @@ SELECT i, COUNT(DISTINCT(i)) FROM t1 GROUP BY j ORDER BY NULL; explain SELECT i, COUNT(DISTINCT(i)) FROM t1 GROUP BY j ORDER BY NULL; DROP TABLE t1; -# Test for BUG#5400: GROUP_CONCAT returns everything twice. -create table t1 ( col1 int, col2 int ); -insert into t1 values (1,1),(1,2),(1,3),(2,1),(2,2); -select group_concat( distinct col1 ) as alias from t1 - group by col2 having alias like '%'; - -drop table t1; - - #Test for BUG#6976: Aggregate functions have incorrect NULL-ness create table t1 (a int); insert into t1 values(null); @@ -474,3 +465,26 @@ select min(a) is null or null from t1; select 1 and min(a) is null from t1; drop table t1; +# Test for BUG#5400: GROUP_CONCAT returns everything twice. +create table t1 ( col1 int, col2 int ); +insert into t1 values (1,1),(1,2),(1,3),(2,1),(2,2); +select group_concat( distinct col1 ) as alias from t1 + group by col2 having alias like '%'; + +drop table t1; + +# +# Test BUG#8216 when referring in HAVING to n alias which is rand() function +# + +create table t1 (a integer, b integer, c integer); +insert into t1 (a,b) values (1,2),(1,3),(2,5); +select a, 0.1*0+1 r2, sum(1) r1 from t1 where a = 1 group by a having r1>1 and r2=1; +select a, rand()*0+1 r2, sum(1) r1 from t1 where a = 1 group by a having r1>1 and r2=1; +select a,sum(b) from t1 where a=1 group by c; +select a*sum(b) from t1 where a=1 group by c; +select sum(a)*sum(b) from t1 where a=1 group by c; +select a,sum(b) from t1 where a=1 group by c having a=1; +select a as d,sum(b) from t1 where a=1 group by c having d=1; +select sum(a)*sum(b) as d from t1 where a=1 group by c having d > 0; +drop table t1; diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index c5e6d520ab7..213286878a8 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -1960,6 +1960,36 @@ bool Item_cond::walk(Item_processor processor, byte *arg) return Item_func::walk(processor, arg); } + +/* + Move SUM items out from item tree and replace with reference + + SYNOPSIS + split_sum_func() + thd Thread handler + ref_pointer_array Pointer to array of reference fields + fields All fields in select + + NOTES + This function is run on all expression (SELECT list, WHERE, HAVING etc) + that have or refer (HAVING) to a SUM expression. + + The split is done to get an unique item for each SUM function + so that we can easily find and calculate them. + (Calculation done by update_sum_func() and copy_sum_funcs() in + sql_select.cc) + + All found SUM items are added FIRST in the fields list and + we replace the item with a reference. + + We also replace all functions without side effects (like RAND() or UDF's) + that uses columns as arguments. + For functions with side effects, we just remember any fields referred + by the function to ensure that we get a copy of the field value for the + first accepted row. This ensures that we can do things like + SELECT a*SUM(b) FROM t1 WHERE a=1 +*/ + void Item_cond::split_sum_func(THD *thd, Item **ref_pointer_array, List &fields) { @@ -1969,10 +1999,22 @@ void Item_cond::split_sum_func(THD *thd, Item **ref_pointer_array, const_item_cache=0; while ((item=li++)) { - if (item->with_sum_func && item->type() != SUM_FUNC_ITEM) + /* with_sum_func is set for items that contains a SUM expression */ + if (item->type() != SUM_FUNC_ITEM && + (item->with_sum_func || + (item->used_tables() & PSEUDO_TABLE_BITS))) item->split_sum_func(thd, ref_pointer_array, fields); - else if (item->used_tables() || item->type() == SUM_FUNC_ITEM) + else if (item->type() == SUM_FUNC_ITEM || + (item->used_tables() && item->type() != REF_ITEM)) { + /* + Replace item with a reference so that we can easily calculate + it (in case of sum functions) or copy it (in case of fields) + + The test above is to ensure we don't do a reference for things + that are constants or are not yet calculated as in: + SELECT RAND() as r1, SUM(a) as r2 FROM t1 HAVING r1 > 1 AND r2 > 0 + */ Item **ref= li.ref(); uint el= fields.elements; ref_pointer_array[el]= item; diff --git a/sql/item_func.cc b/sql/item_func.cc index bff49541252..c67ddfa179e 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -351,6 +351,7 @@ bool Item_func::walk (Item_processor processor, byte *argument) return (this->*processor)(argument); } + void Item_func::split_sum_func(THD *thd, Item **ref_pointer_array, List &fields) { @@ -358,9 +359,12 @@ void Item_func::split_sum_func(THD *thd, Item **ref_pointer_array, for (arg= args, arg_end= args+arg_count; arg != arg_end ; arg++) { Item *item=* arg; - if (item->with_sum_func && item->type() != SUM_FUNC_ITEM) + if (item->type() != SUM_FUNC_ITEM && + (item->with_sum_func || + (item->used_tables() & PSEUDO_TABLE_BITS))) item->split_sum_func(thd, ref_pointer_array, fields); - else if (item->used_tables() || item->type() == SUM_FUNC_ITEM) + else if (item->type() == SUM_FUNC_ITEM || + (item->used_tables() && item->type() != REF_ITEM)) { uint el= fields.elements; ref_pointer_array[el]= item; diff --git a/sql/item_row.cc b/sql/item_row.cc index 4e4957b980e..0ace0fc0451 100644 --- a/sql/item_row.cc +++ b/sql/item_row.cc @@ -84,15 +84,20 @@ bool Item_row::fix_fields(THD *thd, TABLE_LIST *tabl, Item **ref) return 0; } + void Item_row::split_sum_func(THD *thd, Item **ref_pointer_array, List &fields) { Item **arg, **arg_end; for (arg= items, arg_end= items+arg_count; arg != arg_end ; arg++) { - if ((*arg)->with_sum_func && (*arg)->type() != SUM_FUNC_ITEM) - (*arg)->split_sum_func(thd, ref_pointer_array, fields); - else if ((*arg)->used_tables() || (*arg)->type() == SUM_FUNC_ITEM) + Item *item= *arg; + if (item->type() != SUM_FUNC_ITEM && + (item->with_sum_func || + (item->used_tables() & PSEUDO_TABLE_BITS))) + item->split_sum_func(thd, ref_pointer_array, fields); + else if (item->type() == SUM_FUNC_ITEM || + (item->used_tables() && item->type() != REF_ITEM)) { uint el= fields.elements; ref_pointer_array[el]=*arg; diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 1fb68561374..b22b65eddd0 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -1758,9 +1758,12 @@ String *Item_func_elt::val_str(String *str) void Item_func_make_set::split_sum_func(THD *thd, Item **ref_pointer_array, List &fields) { - if (item->with_sum_func && item->type() != SUM_FUNC_ITEM) + if (item->type() != SUM_FUNC_ITEM && + (item->with_sum_func || + (item->used_tables() & PSEUDO_TABLE_BITS))) item->split_sum_func(thd, ref_pointer_array, fields); - else if (item->used_tables() || item->type() == SUM_FUNC_ITEM) + else if (item->type() == SUM_FUNC_ITEM || + (item->used_tables() && item->type() != REF_ITEM)) { uint el= fields.elements; ref_pointer_array[el]=item; diff --git a/sql/unireg.h b/sql/unireg.h index 4ab2ba26b15..70df9a89c8f 100644 --- a/sql/unireg.h +++ b/sql/unireg.h @@ -72,6 +72,8 @@ #define PARAM_TABLE_BIT (((table_map) 1) << (sizeof(table_map)*8-3)) #define OUTER_REF_TABLE_BIT (((table_map) 1) << (sizeof(table_map)*8-2)) #define RAND_TABLE_BIT (((table_map) 1) << (sizeof(table_map)*8-1)) +#define PSEUDO_TABLE_BITS (PARAM_TABLE_BIT | OUTER_REF_TABLE_BIT | \ + RAND_TABLE_BIT) #define MAX_FIELDS 4096 /* Limit in the .frm file */ #define MAX_SORT_MEMORY (2048*1024-MALLOC_OVERHEAD) From ac630383f4c32565a50095115e088e6076ec5898 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 7 Feb 2005 17:46:52 +0100 Subject: [PATCH 0942/1063] have test suite continue even if ndbcluster fails to start if --force flag is set --- mysql-test/include/have_ndb.inc | 1 + mysql-test/mysql-test-run.sh | 12 +++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/mysql-test/include/have_ndb.inc b/mysql-test/include/have_ndb.inc index 84e60657876..9b85197abe8 100644 --- a/mysql-test/include/have_ndb.inc +++ b/mysql-test/include/have_ndb.inc @@ -1,3 +1,4 @@ +--exec test x$NDB_STATUS_OK = x1 -- require r/have_ndb.require disable_query_log; show variables like "have_ndbcluster"; diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index bc3a266208a..0c3d3dcdf0f 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -693,6 +693,8 @@ export NDB_MGM export NDB_BACKUP_DIR export NDB_TOOLS_OUTPUT export PURIFYOPTIONS +NDB_STATUS_OK=1 +export NDB_STATUS_OK MYSQL_TEST_ARGS="--no-defaults --socket=$MASTER_MYSOCK --database=$DB \ --user=$DBUSER --password=$DBPASSWD --silent -v --skip-safemalloc \ @@ -1055,7 +1057,15 @@ start_ndbcluster() else NDBCLUSTER_EXTRA_OPTS="--small" fi - ./ndb/ndbcluster $NDBCLUSTER_OPTS $NDBCLUSTER_EXTRA_OPTS --initial || exit 1 + ./ndb/ndbcluster $NDBCLUSTER_OPTS $NDBCLUSTER_EXTRA_OPTS --initial || NDB_STATUS_OK=0 + if [ x$NDB_STATUS_OK != x1 ] ; then + if [ x$FORCE != x1 ] ; then + exit 1 + fi + USE_NDBCLUSTER= + return + fi + NDB_CONNECTSTRING="host=localhost:$NDBCLUSTER_PORT" else NDB_CONNECTSTRING="$USE_RUNNING_NDBCLUSTER" From 41dffbb150a7f3080d66b394d2f244bd91ab8b90 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 7 Feb 2005 17:59:46 +0100 Subject: [PATCH 0943/1063] mysql-test-run.sh: fixed start-and-exit flag mysql-test/mysql-test-run.sh: fixed start-and-exit flag --- mysql-test/mysql-test-run.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index 0c3d3dcdf0f..39d3f0492c2 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -1630,6 +1630,12 @@ run_testcase () fi fi fi + + if [ "x$START_AND_EXIT" = "x1" ] ; then + echo "Servers started, exiting" + exit + fi + cd $MYSQL_TEST_DIR if [ -f $tf ] ; then @@ -1767,11 +1773,6 @@ then mysql_loadstd fi -if [ "x$START_AND_EXIT" = "x1" ] ; then - echo "Servers started, exiting" - exit -fi - $ECHO "Starting Tests" # From 4ddeaf265f67c2c251239c2aaf4a6d55fed51ccb Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 7 Feb 2005 20:32:56 +0100 Subject: [PATCH 0944/1063] mysql-test-run.pl: Corrected user name passing Honor the --master-binary and --slave-binary options Insert the host name into 'user' table Added --udiff option, to get unified diff output Call special mtr_run_test() for running "mysqltest" mtr_report.pl: Added --udiff option, to get unified diff output init_db.sql: Insert the host name into 'user' table mysql-test/lib/init_db.sql: Insert the host name into 'user' table mysql-test/lib/mtr_report.pl: Added --udiff option, to get unified diff output mysql-test/mysql-test-run.pl: Corrected user name passing Honor the --master-binary and --slave-binary options Insert the host name into 'user' table Added --udiff option, to get unified diff output Call special mtr_run_test() for running "mysqltest" --- mysql-test/lib/init_db.sql | 10 ++-- mysql-test/lib/mtr_report.pl | 4 +- mysql-test/mysql-test-run.pl | 109 +++++++++++++++++++++-------------- 3 files changed, 76 insertions(+), 47 deletions(-) diff --git a/mysql-test/lib/init_db.sql b/mysql-test/lib/init_db.sql index f42f7ca6b5f..54591e9b9ff 100644 --- a/mysql-test/lib/init_db.sql +++ b/mysql-test/lib/init_db.sql @@ -10,9 +10,11 @@ CREATE TABLE host (Host char(60) binary DEFAULT '' NOT NULL,Db char(64) binary D CREATE TABLE user (Host char(60) binary DEFAULT '' NOT NULL,User char(16) binary DEFAULT '' NOT NULL,Password char(41) binary DEFAULT '' NOT NULL,Select_priv enum('N','Y') DEFAULT 'N' NOT NULL,Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL,Update_priv enum('N','Y') DEFAULT 'N' NOT NULL,Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL,Create_priv enum('N','Y') DEFAULT 'N' NOT NULL,Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL,Reload_priv enum('N','Y') DEFAULT 'N' NOT NULL,Shutdown_priv enum('N','Y') DEFAULT 'N' NOT NULL,Process_priv enum('N','Y') DEFAULT 'N' NOT NULL,File_priv enum('N','Y') DEFAULT 'N' NOT NULL,Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL,References_priv enum('N','Y') DEFAULT 'N' NOT NULL,Index_priv enum('N','Y') DEFAULT 'N' NOT NULL,Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL,Show_db_priv enum('N','Y') DEFAULT 'N' NOT NULL,Super_priv enum('N','Y') DEFAULT 'N' NOT NULL,Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL,Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL,Execute_priv enum('N','Y') DEFAULT 'N' NOT NULL,Repl_slave_priv enum('N','Y') DEFAULT 'N' NOT NULL,Repl_client_priv enum('N','Y') DEFAULT 'N' NOT NULL,ssl_type enum('','ANY','X509', 'SPECIFIED') DEFAULT '' NOT NULL,ssl_cipher BLOB NOT NULL,x509_issuer BLOB NOT NULL,x509_subject BLOB NOT NULL,max_questions int(11) unsigned DEFAULT 0 NOT NULL,max_updates int(11) unsigned DEFAULT 0 NOT NULL,max_connections int(11) unsigned DEFAULT 0 NOT NULL,PRIMARY KEY Host (Host,User)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Users and global privileges'; -INSERT INTO user VALUES ('%','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); -INSERT INTO user VALUES ('localhost','','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); -INSERT INTO user VALUES ('%','','','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','','','','',0,0,0); +INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); +INSERT INTO user VALUES ('g4%' ,'root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); +REPLACE INTO user VALUES ('127.0.0.1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); +INSERT INTO user (host,user) VALUES ('localhost',''); +INSERT INTO user (host,user) VALUES ('g4%',''); CREATE TABLE func (name char(64) binary DEFAULT '' NOT NULL,ret tinyint(1) DEFAULT '0' NOT NULL,dl char(128) DEFAULT '' NOT NULL,type enum ('function','aggregate') NOT NULL,PRIMARY KEY (name)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='User defined functions'; @@ -40,7 +42,7 @@ INSERT INTO time_zone (Time_zone_id, Use_leap_seconds) VALUES (1,'N'), (2,'N'), CREATE TABLE time_zone_transition (Time_zone_id int unsigned NOT NULL,Transition_time bigint signed NOT NULL,Transition_type_id int unsigned NOT NULL,PRIMARY KEY TzIdTranTime (Time_zone_id, Transition_time)) engine=MyISAM CHARACTER SET utf8 comment='Time zone transitions'; -INSERT INTO time_zone_transition (Time_zone_id, Transition_time, Transition_type_id) VALUES (1, -1693706400, 0) ,(1, -1680483600, 1),(1, -1663455600, 2) ,(1, -1650150000, 3),(1, -1632006000, 2) ,(1, -1618700400, 3),(1, -938905200, 2) ,(1, -857257200, 3),(1, -844556400, 2) ,(1, -828226800, 3),(1, -812502000, 2) ,(1, -796777200, 3),(1, 228877200, 2) ,(1, 243997200, 3),(1, 260326800, 2) ,(1, 276051600, 3),(1, 291776400, 2) ,(1, 307501200, 3),(1, 323830800, 2) ,(1, 338950800, 3),(1, 354675600, 2) ,(1, 370400400, 3),(1, 386125200, 2) ,(1, 401850000, 3),(1, 417574800, 2) ,(1, 433299600, 3),(1, 449024400, 2) ,(1, 465354000, 3),(1, 481078800, 2) ,(1, 496803600, 3),(1, 512528400, 2) ,(1, 528253200, 3),(1, 543978000, 2) ,(1, 559702800, 3),(1, 575427600, 2) ,(1, 591152400, 3),(1, 606877200, 2) ,(1, 622602000, 3),(1, 638326800, 2) ,(1, 654656400, 3),(1, 670381200, 2) ,(1, 686106000, 3),(1, 701830800, 2) ,(1, 717555600, 3),(1, 733280400, 2) ,(1, 749005200, 3),(1, 764730000, 2) ,(1, 780454800, 3),(1, 796179600, 2) ,(1, 811904400, 3),(1, 828234000, 2) ,(1, 846378000, 3),(1, 859683600, 2) ,(1, 877827600, 3),(1, 891133200, 2) ,(1, 909277200, 3),(1, 922582800, 2) ,(1, 941331600, 3),(1, 954032400, 2) ,(1, 972781200, 3),(1, 985482000, 2) ,(1, 1004230800, 3),(1, 1017536400, 2) ,(1, 1035680400, 3),(1, 1048986000, 2) ,(1, 1067130000, 3),(1, 1080435600, 2) ,(1, 1099184400, 3),(1, 1111885200, 2) ,(1, 1130634000, 3),(1, 1143334800, 2) ,(1, 1162083600, 3),(1, 1174784400, 2) ,(1, 1193533200, 3),(1, 1206838800, 2) ,(1, 1224982800, 3),(1, 1238288400, 2) ,(1, 1256432400, 3),(1, 1269738000, 2) ,(1, 1288486800, 3),(1, 1301187600, 2) ,(1, 1319936400, 3),(1, 1332637200, 2) ,(1, 1351386000, 3),(1, 1364691600, 2) ,(1, 1382835600, 3),(1, 1396141200, 2) ,(1, 1414285200, 3),(1, 1427590800, 2) ,(1, 1445734800, 3),(1, 1459040400, 2) ,(1, 1477789200, 3),(1, 1490490000, 2) ,(1, 1509238800, 3),(1, 1521939600, 2) ,(1, 1540688400, 3),(1, 1553994000, 2) ,(1, 1572138000, 3),(1, 1585443600, 2) ,(1, 1603587600, 3),(1, 1616893200, 2) ,(1, 1635642000, 3),(1, 1648342800, 2) ,(1, 1667091600, 3),(1, 1679792400, 2) ,(1, 1698541200, 3),(1, 1711846800, 2) ,(1, 1729990800, 3),(1, 1743296400, 2) ,(1, 1761440400, 3),(1, 1774746000, 2) ,(1, 1792890000, 3),(1, 1806195600, 2) ,(1, 1824944400, 3),(1, 1837645200, 2) ,(1, 1856394000, 3),(1, 1869094800, 2) ,(1, 1887843600, 3),(1, 1901149200, 2) ,(1, 1919293200, 3),(1, 1932598800, 2) ,(1, 1950742800, 3),(1, 1964048400, 2) ,(1, 1982797200, 3),(1, 1995498000, 2) ,(1, 2014246800, 3),(1, 2026947600, 2) ,(1, 2045696400, 3),(1, 2058397200, 2) ,(1, 2077146000, 3),(1, 2090451600, 2) ,(1, 2108595600, 3),(1, 2121901200, 2) ,(1, 2140045200, 3),(3, -1688265000, 2) ,(3, -1656819048, 1),(3, -1641353448, 2) ,(3, -1627965048, 3),(3, -1618716648, 1) ,(3, -1596429048, 3),(3, -1593829848, 5) ,(3, -1589860800, 4),(3, -1542427200, 5) ,(3, -1539493200, 6),(3, -1525323600, 5) ,(3, -1522728000, 4),(3, -1491188400, 7) ,(3, -1247536800, 4),(3, 354920400, 5) ,(3, 370728000, 4),(3, 386456400, 5) ,(3, 402264000, 4),(3, 417992400, 5) ,(3, 433800000, 4),(3, 449614800, 5) ,(3, 465346800, 8),(3, 481071600, 9) ,(3, 496796400, 8),(3, 512521200, 9) ,(3, 528246000, 8),(3, 543970800, 9) ,(3, 559695600, 8),(3, 575420400, 9) ,(3, 591145200, 8),(3, 606870000, 9) ,(3, 622594800, 8),(3, 638319600, 9) ,(3, 654649200, 8),(3, 670374000, 10) ,(3, 686102400, 11),(3, 695779200, 8) ,(3, 701812800, 5),(3, 717534000, 4) ,(3, 733273200, 9),(3, 748998000, 8) ,(3, 764722800, 9),(3, 780447600, 8) ,(3, 796172400, 9),(3, 811897200, 8) ,(3, 828226800, 9),(3, 846370800, 8) ,(3, 859676400, 9),(3, 877820400, 8) ,(3, 891126000, 9),(3, 909270000, 8) ,(3, 922575600, 9),(3, 941324400, 8) ,(3, 954025200, 9),(3, 972774000, 8) ,(3, 985474800, 9),(3, 1004223600, 8) ,(3, 1017529200, 9),(3, 1035673200, 8) ,(3, 1048978800, 9),(3, 1067122800, 8) ,(3, 1080428400, 9),(3, 1099177200, 8) ,(3, 1111878000, 9),(3, 1130626800, 8) ,(3, 1143327600, 9),(3, 1162076400, 8) ,(3, 1174777200, 9),(3, 1193526000, 8) ,(3, 1206831600, 9),(3, 1224975600, 8) ,(3, 1238281200, 9),(3, 1256425200, 8) ,(3, 1269730800, 9),(3, 1288479600, 8) ,(3, 1301180400, 9),(3, 1319929200, 8) ,(3, 1332630000, 9),(3, 1351378800, 8) ,(3, 1364684400, 9),(3, 1382828400, 8) ,(3, 1396134000, 9),(3, 1414278000, 8) ,(3, 1427583600, 9),(3, 1445727600, 8) ,(3, 1459033200, 9),(3, 1477782000, 8) ,(3, 1490482800, 9),(3, 1509231600, 8) ,(3, 1521932400, 9),(3, 1540681200, 8) ,(3, 1553986800, 9),(3, 1572130800, 8) ,(3, 1585436400, 9),(3, 1603580400, 8) ,(3, 1616886000, 9),(3, 1635634800, 8) ,(3, 1648335600, 9),(3, 1667084400, 8) ,(3, 1679785200, 9),(3, 1698534000, 8) ,(3, 1711839600, 9),(3, 1729983600, 8) ,(3, 1743289200, 9),(3, 1761433200, 8) ,(3, 1774738800, 9),(3, 1792882800, 8) ,(3, 1806188400, 9),(3, 1824937200, 8) ,(3, 1837638000, 9),(3, 1856386800, 8) ,(3, 1869087600, 9),(3, 1887836400, 8) ,(3, 1901142000, 9),(3, 1919286000, 8) ,(3, 1932591600, 9),(3, 1950735600, 8) ,(3, 1964041200, 9),(3, 1982790000, 8) ,(3, 1995490800, 9),(3, 2014239600, 8) ,(3, 2026940400, 9),(3, 2045689200, 8) ,(3, 2058390000, 9),(3, 2077138800, 8) ,(3, 2090444400, 9),(3, 2108588400, 8) ,(3, 2121894000, 9),(3, 2140038000, 8),(4, -1688265000, 2) ,(4, -1656819048, 1),(4, -1641353448, 2) ,(4, -1627965048, 3),(4, -1618716648, 1) ,(4, -1596429048, 3),(4, -1593829848, 5) ,(4, -1589860800, 4),(4, -1542427200, 5) ,(4, -1539493200, 6),(4, -1525323600, 5) ,(4, -1522728000, 4),(4, -1491188400, 7) ,(4, -1247536800, 4),(4, 354920409, 5) ,(4, 370728010, 4),(4, 386456410, 5) ,(4, 402264011, 4),(4, 417992411, 5) ,(4, 433800012, 4),(4, 449614812, 5) ,(4, 465346812, 8),(4, 481071612, 9) ,(4, 496796413, 8),(4, 512521213, 9) ,(4, 528246013, 8),(4, 543970813, 9) ,(4, 559695613, 8),(4, 575420414, 9) ,(4, 591145214, 8),(4, 606870014, 9) ,(4, 622594814, 8),(4, 638319615, 9) ,(4, 654649215, 8),(4, 670374016, 10) ,(4, 686102416, 11),(4, 695779216, 8) ,(4, 701812816, 5),(4, 717534017, 4) ,(4, 733273217, 9),(4, 748998018, 8) ,(4, 764722818, 9),(4, 780447619, 8) ,(4, 796172419, 9),(4, 811897219, 8) ,(4, 828226820, 9),(4, 846370820, 8) ,(4, 859676420, 9),(4, 877820421, 8) ,(4, 891126021, 9),(4, 909270021, 8) ,(4, 922575622, 9),(4, 941324422, 8) ,(4, 954025222, 9),(4, 972774022, 8) ,(4, 985474822, 9),(4, 1004223622, 8) ,(4, 1017529222, 9),(4, 1035673222, 8) ,(4, 1048978822, 9),(4, 1067122822, 8) ,(4, 1080428422, 9),(4, 1099177222, 8) ,(4, 1111878022, 9),(4, 1130626822, 8) ,(4, 1143327622, 9),(4, 1162076422, 8) ,(4, 1174777222, 9),(4, 1193526022, 8) ,(4, 1206831622, 9),(4, 1224975622, 8) ,(4, 1238281222, 9),(4, 1256425222, 8) ,(4, 1269730822, 9),(4, 1288479622, 8) ,(4, 1301180422, 9),(4, 1319929222, 8) ,(4, 1332630022, 9),(4, 1351378822, 8) ,(4, 1364684422, 9),(4, 1382828422, 8) ,(4, 1396134022, 9),(4, 1414278022, 8) ,(4, 1427583622, 9),(4, 1445727622, 8) ,(4, 1459033222, 9),(4, 1477782022, 8) ,(4, 1490482822, 9),(4, 1509231622, 8) ,(4, 1521932422, 9),(4, 1540681222, 8) ,(4, 1553986822, 9),(4, 1572130822, 8) ,(4, 1585436422, 9),(4, 1603580422, 8) ,(4, 1616886022, 9),(4, 1635634822, 8) ,(4, 1648335622, 9),(4, 1667084422, 8) ,(4, 1679785222, 9),(4, 1698534022, 8) ,(4, 1711839622, 9),(4, 1729983622, 8) ,(4, 1743289222, 9),(4, 1761433222, 8) ,(4, 1774738822, 9),(4, 1792882822, 8) ,(4, 1806188422, 9),(4, 1824937222, 8) ,(4, 1837638022, 9),(4, 1856386822, 8) ,(4, 1869087622, 9),(4, 1887836422, 8) ,(4, 1901142022, 9),(4, 1919286022, 8) ,(4, 1932591622, 9),(4, 1950735622, 8) ,(4, 1964041222, 9),(4, 1982790022, 8) ,(4, 1995490822, 9),(4, 2014239622, 8) ,(4, 2026940422, 9),(4, 2045689222, 8) ,(4, 2058390022, 9),(4, 2077138822, 8) ,(4, 2090444422, 9),(4, 2108588422, 8) ,(4, 2121894022, 9),(4, 2140038022, 8); +INSERT INTO time_zone_transition (Time_zone_id, Transition_time, Transition_type_id) VALUES (1, -1693706400, 0) ,(1, -1680483600, 1),(1, -1663455600, 2) ,(1, -1650150000, 3),(1, -1632006000, 2) ,(1, -1618700400, 3),(1, -938905200, 2) ,(1, -857257200, 3),(1, -844556400, 2) ,(1, -828226800, 3),(1, -812502000, 2) ,(1, -796777200, 3),(1, 228877200, 2) ,(1, 243997200, 3),(1, 260326800, 2) ,(1, 276051600, 3),(1, 291776400, 2) ,(1, 307501200, 3),(1, 323830800, 2) ,(1, 338950800, 3),(1, 354675600, 2) ,(1, 370400400, 3),(1, 386125200, 2) ,(1, 401850000, 3),(1, 417574800, 2) ,(1, 433299600, 3),(1, 449024400, 2) ,(1, 465354000, 3),(1, 481078800, 2) ,(1, 496803600, 3),(1, 512528400, 2) ,(1, 528253200, 3),(1, 543978000, 2) ,(1, 559702800, 3),(1, 575427600, 2) ,(1, 591152400, 3),(1, 606877200, 2) ,(1, 622602000, 3),(1, 638326800, 2) ,(1, 654656400, 3),(1, 670381200, 2) ,(1, 686106000, 3),(1, 701830800, 2) ,(1, 717555600, 3),(1, 733280400, 2) ,(1, 749005200, 3),(1, 764730000, 2) ,(1, 780454800, 3),(1, 796179600, 2) ,(1, 811904400, 3),(1, 828234000, 2) ,(1, 846378000, 3),(1, 859683600, 2) ,(1, 877827600, 3),(1, 891133200, 2) ,(1, 909277200, 3),(1, 922582800, 2) ,(1, 941331600, 3),(1, 954032400, 2) ,(1, 972781200, 3),(1, 985482000, 2) ,(1, 1004230800, 3),(1, 1017536400, 2) ,(1, 1035680400, 3),(1, 1048986000, 2) ,(1, 1067130000, 3),(1, 1080435600, 2) ,(1, 1099184400, 3),(1, 1111885200, 2) ,(1, 1130634000, 3),(1, 1143334800, 2) ,(1, 1162083600, 3),(1, 1174784400, 2) ,(1, 1193533200, 3),(1, 1206838800, 2) ,(1, 1224982800, 3),(1, 1238288400, 2) ,(1, 1256432400, 3),(1, 1269738000, 2) ,(1, 1288486800, 3),(1, 1301187600, 2) ,(1, 1319936400, 3),(1, 1332637200, 2) ,(1, 1351386000, 3),(1, 1364691600, 2) ,(1, 1382835600, 3),(1, 1396141200, 2) ,(1, 1414285200, 3),(1, 1427590800, 2) ,(1, 1445734800, 3),(1, 1459040400, 2) ,(1, 1477789200, 3),(1, 1490490000, 2) ,(1, 1509238800, 3),(1, 1521939600, 2) ,(1, 1540688400, 3),(1, 1553994000, 2) ,(1, 1572138000, 3),(1, 1585443600, 2) ,(1, 1603587600, 3),(1, 1616893200, 2) ,(1, 1635642000, 3),(1, 1648342800, 2) ,(1, 1667091600, 3),(1, 1679792400, 2) ,(1, 1698541200, 3),(1, 1711846800, 2) ,(1, 1729990800, 3),(1, 1743296400, 2) ,(1, 1761440400, 3),(1, 1774746000, 2) ,(1, 1792890000, 3),(1, 1806195600, 2) ,(1, 1824944400, 3),(1, 1837645200, 2) ,(1, 1856394000, 3),(1, 1869094800, 2) ,(1, 1887843600, 3),(1, 1901149200, 2) ,(1, 1919293200, 3),(1, 1932598800, 2) ,(1, 1950742800, 3),(1, 1964048400, 2) ,(1, 1982797200, 3),(1, 1995498000, 2) ,(1, 2014246800, 3),(1, 2026947600, 2) ,(1, 2045696400, 3),(1, 2058397200, 2) ,(1, 2077146000, 3),(1, 2090451600, 2) ,(1, 2108595600, 3),(1, 2121901200, 2) ,(1, 2140045200, 3),(3, -1688265000, 2) ,(3, -1656819048, 1),(3, -1641353448, 2) ,(3, -1627965048, 3),(3, -1618716648, 1) ,(3, -1596429048, 3),(3, -1593829848, 5) ,(3, -1589860800, 4),(3, -1542427200, 5) ,(3, -1539493200, 6),(3, -1525323600, 5) ,(3, -1522728000, 4),(3, -1491188400, 7) ,(3, -1247536800, 4),(3, 354920400, 5) ,(3, 370728000, 4),(3, 386456400, 5) ,(3, 402264000, 4),(3, 417992400, 5) ,(3, 433800000, 4),(3, 449614800, 5) ,(3, 465346800, 8),(3, 481071600, 9) ,(3, 496796400, 8),(3, 512521200, 9) ,(3, 528246000, 8),(3, 543970800, 9) ,(3, 559695600, 8),(3, 575420400, 9) ,(3, 591145200, 8),(3, 606870000, 9) ,(3, 622594800, 8),(3, 638319600, 9) ,(3, 654649200, 8),(3, 670374000, 10) ,(3, 686102400, 11),(3, 695779200, 8) ,(3, 701812800, 5),(3, 717534000, 4) ,(3, 733273200, 9),(3, 748998000, 8) ,(3, 764722800, 9),(3, 780447600, 8) ,(3, 796172400, 9),(3, 811897200, 8) ,(3, 828226800, 9),(3, 846370800, 8) ,(3, 859676400, 9),(3, 877820400, 8) ,(3, 891126000, 9),(3, 909270000, 8) ,(3, 922575600, 9),(3, 941324400, 8) ,(3, 954025200, 9),(3, 972774000, 8) ,(3, 985474800, 9),(3, 1004223600, 8) ,(3, 1017529200, 9),(3, 1035673200, 8) ,(3, 1048978800, 9),(3, 1067122800, 8) ,(3, 1080428400, 9),(3, 1099177200, 8) ,(3, 1111878000, 9),(3, 1130626800, 8) ,(3, 1143327600, 9),(3, 1162076400, 8) ,(3, 1174777200, 9),(3, 1193526000, 8) ,(3, 1206831600, 9),(3, 1224975600, 8) ,(3, 1238281200, 9),(3, 1256425200, 8) ,(3, 1269730800, 9),(3, 1288479600, 8) ,(3, 1301180400, 9),(3, 1319929200, 8) ,(3, 1332630000, 9),(3, 1351378800, 8) ,(3, 1364684400, 9),(3, 1382828400, 8) ,(3, 1396134000, 9),(3, 1414278000, 8) ,(3, 1427583600, 9),(3, 1445727600, 8) ,(3, 1459033200, 9),(3, 1477782000, 8) ,(3, 1490482800, 9),(3, 1509231600, 8) ,(3, 1521932400, 9),(3, 1540681200, 8) ,(3, 1553986800, 9),(3, 1572130800, 8) ,(3, 1585436400, 9),(3, 1603580400, 8) ,(3, 1616886000, 9),(3, 1635634800, 8) ,(3, 1648335600, 9),(3, 1667084400, 8) ,(3, 1679785200, 9),(3, 1698534000, 8) ,(3, 1711839600, 9),(3, 1729983600, 8) ,(3, 1743289200, 9),(3, 1761433200, 8) ,(3, 1774738800, 9),(3, 1792882800, 8) ,(3, 1806188400, 9),(3, 1824937200, 8) ,(3, 1837638000, 9),(3, 1856386800, 8) ,(3, 1869087600, 9),(3, 1887836400, 8) ,(3, 1901142000, 9),(3, 1919286000, 8) ,(3, 1932591600, 9),(3, 1950735600, 8) ,(3, 1964041200, 9),(3, 1982790000, 8) ,(3, 1995490800, 9),(3, 2014239600, 8) ,(3, 2026940400, 9),(3, 2045689200, 8) ,(3, 2058390000, 9),(3, 2077138800, 8) ,(3, 2090444400, 9),(3, 2108588400, 8) ,(3, 2121894000, 9),(3, 2140038000, 8),(4, -1688265000, 2) ,(4, -1656819048, 1),(4, -1641353448, 2) ,(4, -1627965048, 3),(4, -1618716648, 1) ,(4, -1596429048, 3),(4, -1593829848, 5) ,(4, -1589860800, 4),(4, -1542427200, 5) ,(4, -1539493200, 6),(4, -1525323600, 5) ,(4, -1522728000, 4),(4, -1491188400, 7) ,(4, -1247536800, 4),(4, 354920409, 5) ,(4, 370728010, 4),(4, 386456410, 5) ,(4, 402264011, 4),(4, 417992411, 5) ,(4, 433800012, 4),(4, 449614812, 5) ,(4, 465346812, 8),(4, 481071612, 9) ,(4, 496796413, 8),(4, 512521213, 9) ,(4, 528246013, 8),(4, 543970813, 9) ,(4, 559695613, 8),(4, 575420414, 9) ,(4, 591145214, 8),(4, 606870014, 9) ,(4, 622594814, 8),(4, 638319615, 9) ,(4, 654649215, 8),(4, 670374016, 10) ,(4, 686102416, 11),(4, 695779216, 8) ,(4, 701812816, 5),(4, 717534017, 4) ,(4, 733273217, 9),(4, 748998018, 8) ,(4, 764722818, 9),(4, 780447619, 8) ,(4, 796172419, 9),(4, 811897219, 8) ,(4, 828226820, 9),(4, 846370820, 8) ,(4, 859676420, 9),(4, 877820421, 8) ,(4, 891126021, 9),(4, 909270021, 8) ,(4, 922575622, 9),(4, 941324422, 8) ,(4, 954025222, 9),(4, 972774022, 8) ,(4, 985474822, 9),(4, 1004223622, 8) ,(4, 1017529222, 9),(4, 1035673222, 8) ,(4, 1048978822, 9),(4, 1067122822, 8) ,(4, 1080428422, 9),(4, 1099177222, 8) ,(4, 1111878022, 9),(4, 1130626822, 8) ,(4, 1143327622, 9),(4, 1162076422, 8) ,(4, 1174777222, 9),(4, 1193526022, 8) ,(4, 1206831622, 9),(4, 1224975622, 8) ,(4, 1238281222, 9),(4, 1256425222, 8) ,(4, 1269730822, 9),(4, 1288479622, 8) ,(4, 1301180422, 9),(4, 1319929222, 8) ,(4, 1332630022, 9),(4, 1351378822, 8) ,(4, 1364684422, 9),(4, 1382828422, 8) ,(4, 1396134022, 9),(4, 1414278022, 8) ,(4, 1427583622, 9),(4, 1445727622, 8) ,(4, 1459033222, 9),(4, 1477782022, 8) ,(4, 1490482822, 9),(4, 1509231622, 8) ,(4, 1521932422, 9),(4, 1540681222, 8) ,(4, 1553986822, 9),(4, 1572130822, 8) ,(4, 1585436422, 9),(4, 1603580422, 8) ,(4, 1616886022, 9),(4, 1635634822, 8) ,(4, 1648335622, 9),(4, 1667084422, 8) ,(4, 1679785222, 9),(4, 1698534022, 8) ,(4, 1711839622, 9),(4, 1729983622, 8) ,(4, 1743289222, 9),(4, 1761433222, 8) ,(4, 1774738822, 9),(4, 1792882822, 8) ,(4, 1806188422, 9),(4, 1824937222, 8) ,(4, 1837638022, 9),(4, 1856386822, 8) ,(4, 1869087622, 9),(4, 1887836422, 8) ,(4, 1901142022, 9),(4, 1919286022, 8) ,(4, 1932591622, 9),(4, 1950735622, 8) ,(4, 1964041222, 9),(4, 1982790022, 8) ,(4, 1995490822, 9),(4, 2014239622, 8) ,(4, 2026940422, 9),(4, 2045689222, 8) ,(4, 2058390022, 9),(4, 2077138822, 8) ,(4, 2090444422, 9),(4, 2108588422, 8) ,(4, 2121894022, 9),(4, 2140038022, 8),(5, -1009875600, 1); CREATE TABLE time_zone_transition_type (Time_zone_id int unsigned NOT NULL,Transition_type_id int unsigned NOT NULL,Offset int signed DEFAULT 0 NOT NULL,Is_DST tinyint unsigned DEFAULT 0 NOT NULL,Abbreviation char(8) DEFAULT '' NOT NULL,PRIMARY KEY TzIdTrTId (Time_zone_id, Transition_type_id)) engine=MyISAM CHARACTER SET utf8 comment='Time zone transition types'; diff --git a/mysql-test/lib/mtr_report.pl b/mysql-test/lib/mtr_report.pl index c45bb1601ce..3729ff512ee 100644 --- a/mysql-test/lib/mtr_report.pl +++ b/mysql-test/lib/mtr_report.pl @@ -50,12 +50,14 @@ sub mtr_show_failed_diff ($) { $result_file= "$result_file$::opt_result_ext"; } + my $diffopts= $::opt_udiff ? "-u" : "-c"; + if ( -f $reject_file ) { print "Below are the diffs between actual and expected results:\n"; print "-------------------------------------------------------\n"; # FIXME check result code?! - mtr_run("diff",["-c",$result_file,$reject_file], "", "", "", ""); + mtr_run("diff",[$diffopts,$result_file,$reject_file], "", "", "", ""); print "-------------------------------------------------------\n"; print "Please follow the instructions outlined at\n"; print "http://www.mysql.com/doc/en/Reporting_mysqltest_bugs.html\n"; diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 3dd6f5803d7..8c6706dded5 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -156,13 +156,13 @@ our @mysqld_src_dirs= our $glob_win32= 0; # OS and native Win32 executables our $glob_win32_perl= 0; # ActiveState Win32 Perl our $glob_cygwin_perl= 0; # Cygwin Perl +our $glob_cygwin_shell= undef; our $glob_mysql_test_dir= undef; our $glob_mysql_bench_dir= undef; our $glob_hostname= undef; our $glob_scriptname= undef; our $glob_use_running_server= 0; our $glob_use_running_ndbcluster= 0; -our $glob_user= 'test'; our $glob_use_embedded_server= 0; our $glob_basedir; @@ -281,6 +281,8 @@ our $opt_wait_timeout= 10; our $opt_warnings; +our $opt_udiff; + our $opt_with_ndbcluster; our $opt_with_openssl; @@ -422,7 +424,9 @@ sub initial_setup () { { # Windows programs like 'mysqld' needs Windows paths $glob_mysql_test_dir= `cygpath -m $glob_mysql_test_dir`; + $glob_cygwin_shell= `cygpath -w $ENV{'SHELL'}`; # The Windows path c:\... chomp($glob_mysql_test_dir); + chomp($glob_cygwin_shell); } $glob_basedir= dirname($glob_mysql_test_dir); $glob_mysql_bench_dir= "$glob_basedir/mysql-bench"; # FIXME make configurable @@ -524,6 +528,7 @@ sub command_line_setup () { 'start-from=s' => \$opt_start_from, 'timer' => \$opt_timer, 'tmpdir=s' => \$opt_tmpdir, + 'unified-diff|udiff' => \$opt_udiff, 'user-test=s' => \$opt_user_test, 'user=s' => \$opt_user, 'verbose' => \$opt_verbose, @@ -706,17 +711,16 @@ sub command_line_setup () { # } #} - if ( $opt_user ) + if ( ! $opt_user ) { - $glob_user= $opt_user; - } - elsif ( $glob_use_running_server ) - { - $glob_user= "test"; - } - else - { - $glob_user= "root"; # We want to do FLUSH xxx commands + if ( $glob_use_running_server ) + { + $opt_user= "test"; + } + else + { + $opt_user= "root"; # We want to do FLUSH xxx commands + } } } @@ -828,7 +832,7 @@ sub executable_setup () { } else { - error("Cannot find embedded server 'mysqltest_embedded'"); + mtr_error("Cannot find embedded server 'mysqltest_embedded'"); } if ( -d "$path_tests_bindir/mysql_client_test_embedded" ) { @@ -848,9 +852,6 @@ sub executable_setup () { } } - # FIXME special $exe_master_mysqld and $exe_slave_mysqld - # are not used that much.... - if ( ! $exe_master_mysqld ) { $exe_master_mysqld= $exe_mysqld; @@ -1048,7 +1049,7 @@ sub run_benchmarks ($) { mtr_init_args(\$args); mtr_add_arg($args, "--socket=%s", $master->[0]->{'path_mysock'}); - mtr_add_arg($args, "--user=root"); + mtr_add_arg($args, "--user=%s", $opt_user); if ( $opt_small_bench ) { @@ -1170,11 +1171,36 @@ sub install_db ($$) { my $type= shift; my $data_dir= shift; - my $init_db_sql= "lib/init_db.sql"; # FIXME this is too simple maybe + my $init_db_sql= "lib/init_db.sql"; + my $init_db_sql_tmp= "/tmp/init_db.sql$$"; my $args; mtr_report("Installing \u$type Databases"); + open(IN, $init_db_sql) + or error("Can't open $init_db_sql: $!"); + open(OUT, ">", $init_db_sql_tmp) + or error("Can't write to $init_db_sql_tmp: $!"); + while () + { + chomp; + s/\@HOSTNAME\@/$glob_hostname/; + if ( /^\s*$/ ) + { + print OUT "\n"; + } + elsif (/;$/) + { + print OUT "$_\n"; + } + else + { + print OUT $_; + } + } + close OUT; + close IN; + mtr_init_args(\$args); mtr_add_arg($args, "--no-defaults"); @@ -1192,12 +1218,14 @@ sub install_db ($$) { mtr_add_arg($args, "--character-sets-dir=%s", $path_charsetsdir); } - if ( mtr_run($exe_mysqld, $args, $init_db_sql, + if ( mtr_run($exe_mysqld, $args, $init_db_sql_tmp, $path_manager_log, $path_manager_log, "") != 0 ) { + unlink($init_db_sql_tmp); mtr_error("Error executing mysqld --bootstrap\n" . "Could not install $type test DBs"); } + unlink($init_db_sql_tmp); } @@ -1434,8 +1462,8 @@ sub do_before_start_master ($$) { $tname ne "rpl_crash_binlog_ib_3b") { # FIXME we really want separate dir for binlogs - `rm -fr $glob_mysql_test_dir/var/log/master-bin.*`; -# unlink("$glob_mysql_test_dir/var/log/master-bin.*"); + `rm -f $glob_mysql_test_dir/var/log/master-bin*`; +# unlink("$glob_mysql_test_dir/var/log/master-bin*"); } # Remove old master.info and relay-log.info files @@ -1444,8 +1472,7 @@ sub do_before_start_master ($$) { unlink("$glob_mysql_test_dir/var/master1-data/master.info"); unlink("$glob_mysql_test_dir/var/master1-data/relay-log.info"); - #run master initialization shell script if one exists - + # Run master initialization shell script if one exists if ( $master_init_script and mtr_run($master_init_script, [], "", "", "", "") != 0 ) { @@ -1459,9 +1486,6 @@ sub do_before_start_slave ($$) { my $tname= shift; my $slave_init_script= shift; - # When testing fail-safe replication, we will have more than one slave - # in this case, we start secondary slaves with an argument - # Remove stale binary logs and old master.info files # except for too tests which need them if ( $tname ne "rpl_crash_binlog_ib_1b" and @@ -1476,14 +1500,15 @@ sub do_before_start_slave ($$) { unlink("$glob_mysql_test_dir/var/slave-data/relay-log.info"); } - #run slave initialization shell script if one exists + # Run slave initialization shell script if one exists if ( $slave_init_script and mtr_run($slave_init_script, [], "", "", "", "") != 0 ) { mtr_error("Can't run $slave_init_script"); } - unlink("$glob_mysql_test_dir/var/slave-data/log.*"); + `rm -f $glob_mysql_test_dir/var/slave-data/log.*`; +# unlink("$glob_mysql_test_dir/var/slave-data/log.*"); } sub mysqld_arguments ($$$$$) { @@ -1601,12 +1626,12 @@ sub mysqld_arguments ($$$$$) { { if ( $type eq 'master' ) { - mtr_add_arg($args, "--debug=d:t:i:A,%s/var/log/master%s.trace", + mtr_add_arg($args, "%s--debug=d:t:i:A,%s/var/log/master%s.trace", $prefix, $glob_mysql_test_dir, $sidx); } if ( $type eq 'slave' ) { - mtr_add_arg($args, "--debug=d:t:i:A,%s/var/log/slave%s.trace", + mtr_add_arg($args, "%s--debug=d:t:i:A,%s/var/log/slave%s.trace", $prefix, $glob_mysql_test_dir, $sidx); } } @@ -1617,12 +1642,12 @@ sub mysqld_arguments ($$$$$) { if ( $glob_use_running_ndbcluster ) { - mtr_add_arg($args,"--ndb-connectstring=%s", $prefix, - $opt_ndbconnectstring); + mtr_add_arg($args,"%s--ndb-connectstring=%s", + $prefix, $opt_ndbconnectstring); } else { - mtr_add_arg($args,"--ndb-connectstring=host=localhost:%d", + mtr_add_arg($args,"%s--ndb-connectstring=host=localhost:%d", $prefix, $opt_ndbcluster_port); } } @@ -1730,18 +1755,17 @@ sub mysqld_start ($$$$) { my $exe; my $pid; - # FIXME code duplication, make up your mind.... - if ( $opt_source_dist ) + if ( $type eq 'master' ) { - $exe= "$glob_basedir/sql/mysqld"; + $exe= $exe_master_mysqld; + } + elsif ( $type eq 'slave' ) + { + $exe= $exe_slave_mysqld; } else { - $exe ="$glob_basedir/libexec/mysqld"; - if ( ! -x $exe ) - { - $exe ="$glob_basedir/bin/mysqld"; - } + $exe= $exe_mysqld; } mtr_init_args(\$args); @@ -1911,7 +1935,7 @@ sub run_mysqltest ($$) { mtr_add_arg($args, "--no-defaults"); mtr_add_arg($args, "--socket=%s", $master->[0]->{'path_mysock'}); mtr_add_arg($args, "--database=test"); - mtr_add_arg($args, "--user=%s", $glob_user); + mtr_add_arg($args, "--user=%s", $opt_user); mtr_add_arg($args, "--password="); mtr_add_arg($args, "--silent"); mtr_add_arg($args, "-v"); @@ -1982,7 +2006,7 @@ sub run_mysqltest ($$) { mysqld_arguments($args,'master',0,$tinfo->{'master_opt'},[]); } - return mtr_run($exe_mysqltest,$args,$tinfo->{'path'},"",$path_timefile,""); + return mtr_run_test($exe_mysqltest,$args,$tinfo->{'path'},"",$path_timefile,""); } ############################################################################## @@ -2064,6 +2088,7 @@ Misc options start-and-exit Only initiate and start the "mysqld" servers fast Don't try to cleanup from earlier runs help Get this help text + unified-diff | udiff When presenting differences, use unified diff Options not yet described, or that I want to look into more From eb75a7a5e21186fccaefd7503dc2a07da6c7f989 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 7 Feb 2005 15:17:30 -0800 Subject: [PATCH 0945/1063] Add the zlib .libs directory to LD_LIBRARY_PATH in mysql-test-run.sh, which fixes running the tests when using the bundled zlib. mysql-test/mysql-test-run.sh: Add zlib .libs dir to LD_LIBRARY_PATH --- mysql-test/mysql-test-run.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index 39d3f0492c2..af432f37868 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -194,8 +194,8 @@ MY_LOG_DIR="$MYSQL_TEST_DIR/var/log" # # Set LD_LIBRARY_PATH if we are using shared libraries # -LD_LIBRARY_PATH="$BASEDIR/lib:$BASEDIR/libmysql/.libs:$LD_LIBRARY_PATH" -DYLD_LIBRARY_PATH="$BASEDIR/lib:$BASEDIR/libmysql/.libs:$DYLD_LIBRARY_PATH" +LD_LIBRARY_PATH="$BASEDIR/lib:$BASEDIR/libmysql/.libs:$BASEDIR/zlib/.libs:$LD_LIBRARY_PATH" +DYLD_LIBRARY_PATH="$BASEDIR/lib:$BASEDIR/libmysql/.libs:$BASEDIR/zlib/.libs:$DYLD_LIBRARY_PATH" export LD_LIBRARY_PATH DYLD_LIBRARY_PATH MASTER_RUNNING=0 From 6a1e75621155f700bc6912f9669a5a374342b712 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 8 Feb 2005 06:11:05 +0100 Subject: [PATCH 0946/1063] ndbcluster now runs clean in 4.1, 5.0 may still need some work --- mysql-test/mysql-test-run.pl | 152 ++++++++++++++++++++++++++--------- 1 file changed, 112 insertions(+), 40 deletions(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 3dd6f5803d7..f204fee50ed 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -284,6 +284,11 @@ our $opt_warnings; our $opt_with_ndbcluster; our $opt_with_openssl; +our $exe_ndb_mgm; +our $path_ndb_tools_dir; +our $path_ndb_backup_dir; +our $file_ndb_testrun_log; +our $flag_ndb_status_ok= 1; ###################################################################### # @@ -297,6 +302,7 @@ sub command_line_setup (); sub executable_setup (); sub environment_setup (); sub kill_and_cleanup (); +sub ndbcluster_install (); sub ndbcluster_start (); sub ndbcluster_stop (); sub run_benchmarks ($); @@ -346,18 +352,12 @@ sub main () { kill_and_cleanup(); mysql_install_db(); - if ( $opt_with_ndbcluster and ! $glob_use_running_ndbcluster ) - { - ndbcluster_start(); # We start the cluster storage engine - } - # mysql_loadstd(); FIXME copying from "std_data" .frm and # .MGR but there are none?! } if ( $opt_start_and_exit ) { - # FIXME what about ndb? if ( mysqld_start('master',0,[],[]) ) { mtr_report("Servers started, exiting"); @@ -551,6 +551,8 @@ sub command_line_setup () { $master->[0]->{'path_myport'}= $opt_master_myport; $master->[0]->{'start_timeout'}= 400; # enough time create innodb tables + $master->[0]->{'ndbcluster'}= 1; # ndbcluster not started + $master->[1]->{'path_myddir'}= "$glob_mysql_test_dir/var/master1-data"; $master->[1]->{'path_myerr'}= "$glob_mysql_test_dir/var/log/master1.err"; $master->[1]->{'path_mylog'}= "$glob_mysql_test_dir/var/log/master1.log"; @@ -681,6 +683,10 @@ sub command_line_setup () { $glob_use_running_ndbcluster= 1; $opt_with_ndbcluster= 1; } + else + { + $opt_ndbconnectstring= "host=localhost:$opt_ndbcluster_port"; + } # FIXME @@ -786,6 +792,9 @@ sub executable_setup () { $exe_mysql_fix_system_tables= "$glob_basedir/scripts/mysql_fix_privilege_tables"; $path_language= "$glob_basedir/sql/share/english/"; $path_charsetsdir= "$glob_basedir/sql/share/charsets"; + + $path_ndb_tools_dir= "$glob_basedir/ndb/tools"; + $exe_ndb_mgm= "$glob_basedir/ndb/src/mgmclient/ndb_mgm"; } else { @@ -846,6 +855,9 @@ sub executable_setup () { $exe_mysqltest="$path_client_bindir/mysqltest"; $exe_mysql_client_test="$path_client_bindir/mysql_client_test"; } + + $path_ndb_tools_dir= "$glob_basedir/bin"; + $exe_ndb_mgm= "$glob_basedir/bin/ndb_mgm"; } # FIXME special $exe_master_mysqld and $exe_slave_mysqld @@ -860,6 +872,10 @@ sub executable_setup () { { $exe_slave_mysqld= $exe_mysqld; } + + $path_ndb_backup_dir= + "$glob_mysql_test_dir/var/ndbcluster-$opt_ndbcluster_port"; + $file_ndb_testrun_log= "$glob_mysql_test_dir/var/log/ndb_testrun.log"; } @@ -949,22 +965,19 @@ sub kill_and_cleanup () { mtr_report("Killing Possible Leftover Processes"); mkpath("$glob_mysql_test_dir/var/log"); # Needed for mysqladmin log mtr_kill_leftovers(); - } - if ( $opt_with_ndbcluster and ! $glob_use_running_ndbcluster ) - { ndbcluster_stop(); + $master->[0]->{'ndbcluster'}= 1; } mtr_report("Removing Stale Files"); rmtree("$glob_mysql_test_dir/var/log"); - rmtree("$glob_mysql_test_dir/var/ndbcluster"); + rmtree("$glob_mysql_test_dir/var/ndbcluster-$opt_ndbcluster_port"); rmtree("$glob_mysql_test_dir/var/run"); rmtree("$glob_mysql_test_dir/var/tmp"); mkpath("$glob_mysql_test_dir/var/log"); - mkpath("$glob_mysql_test_dir/var/ndbcluster"); mkpath("$glob_mysql_test_dir/var/run"); mkpath("$glob_mysql_test_dir/var/tmp"); mkpath($opt_tmpdir); @@ -1002,26 +1015,67 @@ sub kill_and_cleanup () { # FIXME why is there a different start below?! +sub ndbcluster_install () { + + if ( ! $opt_with_ndbcluster or $glob_use_running_ndbcluster ) + { + return 0; + } + mtr_report("Install ndbcluster"); + my $ndbcluster_opts= $opt_bench ? "" : "--small"; + my $ndbcluster_port_base= $opt_ndbcluster_port + 2; + if ( mtr_run("$glob_mysql_test_dir/ndb/ndbcluster", + ["--port=$opt_ndbcluster_port", + "--port-base=$ndbcluster_port_base", + "--data-dir=$glob_mysql_test_dir/var", + $ndbcluster_opts, + "--initial"], + "", "", "", "") ) + { + mtr_error("Error ndbcluster_install"); + return 1; + } + + ndbcluster_stop(); + $master->[0]->{'ndbcluster'}= 1; + + return 0; +} + sub ndbcluster_start () { - mtr_report("Starting ndbcluster"); - my $ndbcluster_opts= $opt_bench ? "" : "--small"; - # FIXME check result code?! - mtr_run("$glob_mysql_test_dir/ndb/ndbcluster", - ["--port-base=$opt_ndbcluster_port", - $ndbcluster_opts, - "--diskless", - "--initial", - "--data-dir=$glob_mysql_test_dir/var"], - "", "", "", ""); + if ( ! $opt_with_ndbcluster or $glob_use_running_ndbcluster ) + { + return 0; + } + # FIXME, we want to _append_ output to file $file_ndb_testrun_log instead of /dev/null + if ( mtr_run("$glob_mysql_test_dir/ndb/ndbcluster", + ["--port=$opt_ndbcluster_port", + "--data-dir=$glob_mysql_test_dir/var"], + "", "/dev/null", "", "") ) + { + mtr_error("Error ndbcluster_install"); + return 1; + } + + return 0; } sub ndbcluster_stop () { + + if ( ! $opt_with_ndbcluster or $glob_use_running_ndbcluster ) + { + return; + } + my $ndbcluster_port_base= $opt_ndbcluster_port + 2; + # FIXME, we want to _append_ output to file $file_ndb_testrun_log instead of /dev/null mtr_run("$glob_mysql_test_dir/ndb/ndbcluster", - ["--data-dir=$glob_mysql_test_dir/var", - "--port-base=$opt_ndbcluster_port", + ["--port=$opt_ndbcluster_port", + "--data-dir=$glob_mysql_test_dir/var", "--stop"], - "", "", "", ""); + "", "/dev/null", "", ""); + + return; } @@ -1129,11 +1183,6 @@ sub run_suite () { stop_masters_slaves(); } - if ( $opt_with_ndbcluster and ! $glob_use_running_ndbcluster ) - { - ndbcluster_stop(); - } - if ( $opt_gcov ) { gcov_collect(); # collect coverage information @@ -1162,6 +1211,13 @@ sub mysql_install_db () { install_db('slave', $slave->[1]->{'path_myddir'}); install_db('slave', $slave->[2]->{'path_myddir'}); + if ( ndbcluster_install() ) + { + # failed to install, disable usage but flag that its no ok + $opt_with_ndbcluster= 0; + $flag_ndb_status_ok= 0; + } + return 0; } @@ -1224,6 +1280,9 @@ sub run_testcase ($) { mtr_tonewfile($opt_current_test,"$tname\n"); # Always tell where we are + # output current test to ndbcluster log file to enable diagnostics + mtr_tofile($file_ndb_testrun_log,"CURRENT TEST $tname\n"); + # ---------------------------------------------------------------------- # If marked to skip, just print out and return. # Note that a test case not marked as 'skip' can still be @@ -1297,6 +1356,15 @@ sub run_testcase ($) { if ( ! $opt_local_master ) { + if ( $master->[0]->{'ndbcluster'} ) + { + $master->[0]->{'ndbcluster'}= ndbcluster_start(); + if ( $master->[0]->{'ndbcluster'} ) + { + report_failure_and_restart($tinfo); + return; + } + } if ( ! $master->[0]->{'pid'} ) { $master->[0]->{'pid'}= @@ -1614,17 +1682,8 @@ sub mysqld_arguments ($$$$$) { if ( $opt_with_ndbcluster ) { mtr_add_arg($args, "%s--ndbcluster", $prefix); - - if ( $glob_use_running_ndbcluster ) - { - mtr_add_arg($args,"--ndb-connectstring=%s", $prefix, - $opt_ndbconnectstring); - } - else - { - mtr_add_arg($args,"--ndb-connectstring=host=localhost:%d", - $prefix, $opt_ndbcluster_port); - } + mtr_add_arg($args, "%s--ndb-connectstring=%s", $prefix, + $opt_ndbconnectstring); } # FIXME always set nowdays??? SMALL_SERVER @@ -1828,6 +1887,12 @@ sub stop_masters () { } } + if ( ! $master->[0]->{'ndbcluster'} ) + { + ndbcluster_stop(); + $master->[0]->{'ndbcluster'}= 1; + } + mtr_stop_mysqld_servers(\@args); } @@ -1903,6 +1968,13 @@ sub run_mysqltest ($$) { $ENV{'MYSQL_CLIENT_TEST'}= $cmdline_mysql_client_test; $ENV{'CHARSETSDIR'}= $path_charsetsdir; + $ENV{'NDB_STATUS_OK'}= $flag_ndb_status_ok; + $ENV{'NDB_MGM'}= $exe_ndb_mgm; + $ENV{'NDB_BACKUP_DIR'}= $path_ndb_backup_dir; + $ENV{'NDB_TOOLS_DIR'}= $path_ndb_tools_dir; + $ENV{'NDB_TOOLS_OUTPUT'}= $file_ndb_testrun_log; + $ENV{'NDB_CONNECTSTRING'}= $opt_ndbconnectstring; + my $exe= $exe_mysqltest; my $args; From 6cee60ea260384763fb54b6cf651f518726488d2 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 8 Feb 2005 09:36:36 +0200 Subject: [PATCH 0947/1063] Relaxed locking in INSERT...SELECT, single table UPDATE...SELECT and single table DELETE...SELECT clauses when innobase_locks_unsafe_for_binlog is used and isolation level of the transaction is not serializable. InnoDB uses consistent read in these cases for a selected table. Backported from 5.0.x. sql/ha_innodb.cc: Relaxed locking in INSERT...SELECT, single table UPDATE...SELECT and single table DELETE...SELECT clauses when innobase_locks_unsafe_for_binlog is used and isolation level of the transaction is not serializable. InnoDB uses consistent read in these cases for a selected table. --- sql/ha_innodb.cc | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index 1d75ce99aee..702139624ff 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -5282,8 +5282,27 @@ ha_innobase::store_lock( are not simple SELECTs; note that select_lock_type in this case may get strengthened in ::external_lock() to LOCK_X. */ - prebuilt->select_lock_type = LOCK_S; - prebuilt->stored_select_lock_type = LOCK_S; + if (srv_locks_unsafe_for_binlog && + prebuilt->trx->isolation_level != TRX_ISO_SERIALIZABLE && + (lock_type == TL_READ || lock_type == TL_READ_NO_INSERT) && + thd->lex->sql_command != SQLCOM_SELECT && + thd->lex->sql_command != SQLCOM_UPDATE_MULTI && + thd->lex->sql_command != SQLCOM_DELETE_MULTI ) { + + /* In case we have innobase_locks_unsafe_for_binlog + option set and isolation level of the transaction + is not set to serializable and MySQL is doing + INSERT INTO...SELECT without FOR UPDATE or IN + SHARE MODE we use consistent read for select. + Similarly, in case of DELETE...SELECT and + UPDATE...SELECT when these are not multi table.*/ + + prebuilt->select_lock_type = LOCK_NONE; + prebuilt->stored_select_lock_type = LOCK_NONE; + } else { + prebuilt->select_lock_type = LOCK_S; + prebuilt->stored_select_lock_type = LOCK_S; + } } else if (lock_type != TL_IGNORE) { From 63982db93ceac93bf6dd72f8cae41f8ea06cda0a Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 8 Feb 2005 14:41:09 +0200 Subject: [PATCH 0948/1063] Better bugfix for "HAVING when refering to RAND()" (Bug #8216) Ensure that references in HAVING, ORDER BY or GROUP BY are calculated after fields in SELECT. This will ensure that any reference to these has a valid value. Generalized the code for split_sum_func() BitKeeper/etc/ignore: added support-files/ndb-config-2-node.ini mysql-test/r/group_by.result: More complicated test to assure that rand() is only calulated once mysql-test/r/user_var.result: Back to old results :( (ok but not perfect) mysql-test/t/group_by.test: More complicated test to assure that rand() is only calulated once sql/item.cc: Better bugfix for "HAVING when refering to RAND()" This will ensure that when refering to things like RAND() in HAVING through an alias we will not recalculate that rand() value in the HAVING part but use the value in the row Generalize split_sum_func() sql/item.h: Better bugfix for "HAVING when refering to RAND()" T sql/item_cmpfunc.cc: Better bugfix for "HAVING when refering to RAND()" Use generalized split_sum_func2() function sql/item_func.cc: Better bugfix for "HAVING when refering to RAND()" Use generalized split_sum_func2() function sql/item_row.cc: Better bugfix for "HAVING when refering to RAND()" Use generalized split_sum_func2() function sql/item_strfunc.cc: Better bugfix for "HAVING when refering to RAND()" Use generalized split_sum_func2() function sql/sql_list.h: Add functions to concatenate lists sql/sql_select.cc: Better bugfix for "HAVING when refering to RAND()" Ensure that references in HAVING, ORDER BY or GROUP BY are calculated after fields in SELECT. This will ensure that any reference to these has a valid value. --- .bzrignore | 1 + mysql-test/r/group_by.result | 4 +-- mysql-test/r/user_var.result | 4 +-- mysql-test/t/group_by.test | 3 ++- sql/item.cc | 52 ++++++++++++++++++++++++++++++++++++ sql/item.h | 3 +++ sql/item_cmpfunc.cc | 52 +++++------------------------------- sql/item_func.cc | 20 +++----------- sql/item_row.cc | 19 ++----------- sql/item_strfunc.cc | 15 +---------- sql/sql_list.h | 9 +++++++ sql/sql_select.cc | 14 +++++++++- 12 files changed, 96 insertions(+), 100 deletions(-) diff --git a/.bzrignore b/.bzrignore index 199da0dd558..f43a67af883 100644 --- a/.bzrignore +++ b/.bzrignore @@ -1007,3 +1007,4 @@ tests/mysql_client_test libmysqld/examples/mysql_client_test.c libmysqld/examples/mysql_client_test_embedded libmysqld/examples/mysqltest_embedded +support-files/ndb-config-2-node.ini diff --git a/mysql-test/r/group_by.result b/mysql-test/r/group_by.result index 17b1bb03d1d..7f365eac58a 100644 --- a/mysql-test/r/group_by.result +++ b/mysql-test/r/group_by.result @@ -655,9 +655,9 @@ insert into t1 (a,b) values (1,2),(1,3),(2,5); select a, 0.1*0+1 r2, sum(1) r1 from t1 where a = 1 group by a having r1>1 and r2=1; a r2 r1 1 1.0 2 -select a, rand()*0+1 r2, sum(1) r1 from t1 where a = 1 group by a having r1>1 and r2=1; +select a, round(rand(100)*10) r2, sum(1) r1 from t1 where a = 1 group by a having r1>1 and r2<=2; a r2 r1 -1 1 2 +1 2 2 select a,sum(b) from t1 where a=1 group by c; a sum(b) 1 5 diff --git a/mysql-test/r/user_var.result b/mysql-test/r/user_var.result index 041d1b836b7..81846391795 100644 --- a/mysql-test/r/user_var.result +++ b/mysql-test/r/user_var.result @@ -109,8 +109,8 @@ select @a:=0; select @a, @a:=@a+count(*), count(*), @a from t1 group by i; @a @a:=@a+count(*) count(*) @a 0 1 1 0 -0 3 2 0 -0 6 3 0 +0 2 2 0 +0 3 3 0 select @a:=0; @a:=0 0 diff --git a/mysql-test/t/group_by.test b/mysql-test/t/group_by.test index 379f668df1a..afd479c520e 100644 --- a/mysql-test/t/group_by.test +++ b/mysql-test/t/group_by.test @@ -480,7 +480,8 @@ drop table t1; create table t1 (a integer, b integer, c integer); insert into t1 (a,b) values (1,2),(1,3),(2,5); select a, 0.1*0+1 r2, sum(1) r1 from t1 where a = 1 group by a having r1>1 and r2=1; -select a, rand()*0+1 r2, sum(1) r1 from t1 where a = 1 group by a having r1>1 and r2=1; +# rand(100)*10 will be < 2 only for the first row (of 6) +select a, round(rand(100)*10) r2, sum(1) r1 from t1 where a = 1 group by a having r1>1 and r2<=2; select a,sum(b) from t1 where a=1 group by c; select a*sum(b) from t1 where a=1 group by c; select sum(a)*sum(b) from t1 where a=1 group by c; diff --git a/sql/item.cc b/sql/item.cc index d61d628e8fa..17d41fda677 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -295,6 +295,58 @@ CHARSET_INFO *Item::default_charset() } +/* + Move SUM items out from item tree and replace with reference + + SYNOPSIS + split_sum_func2() + thd Thread handler + ref_pointer_array Pointer to array of reference fields + fields All fields in select + ref Pointer to item + + NOTES + This is from split_sum_func2() for items that should be split + + All found SUM items are added FIRST in the fields list and + we replace the item with a reference. + + thd->fatal_error() may be called if we are out of memory +*/ + + +void Item::split_sum_func2(THD *thd, Item **ref_pointer_array, + List &fields, Item **ref) +{ + if (type() != SUM_FUNC_ITEM && with_sum_func) + { + /* Will split complicated items and ignore simple ones */ + split_sum_func(thd, ref_pointer_array, fields); + } + else if ((type() == SUM_FUNC_ITEM || + (used_tables() & ~PARAM_TABLE_BIT)) && + type() != REF_ITEM) + { + /* + Replace item with a reference so that we can easily calculate + it (in case of sum functions) or copy it (in case of fields) + + The test above is to ensure we don't do a reference for things + that are constants (PARAM_TABLE_BIT is in effect a constant) + or already referenced (for example an item in HAVING) + */ + uint el= fields.elements; + Item *new_item; + ref_pointer_array[el]= this; + if (!(new_item= new Item_ref(ref_pointer_array + el, 0, name))) + return; // fatal_error is set + fields.push_front(this); + ref_pointer_array[el]= this; + thd->change_item_tree(ref, new_item); + } +} + + /* Aggregate two collations together taking into account their coercibility (aka derivation): diff --git a/sql/item.h b/sql/item.h index e0de7452eec..a8b892292d3 100644 --- a/sql/item.h +++ b/sql/item.h @@ -262,6 +262,9 @@ public: virtual void update_used_tables() {} virtual void split_sum_func(THD *thd, Item **ref_pointer_array, List &fields) {} + /* Called for items that really have to be split */ + void split_sum_func2(THD *thd, Item **ref_pointer_array, List &fields, + Item **ref); virtual bool get_date(TIME *ltime,uint fuzzydate); virtual bool get_time(TIME *ltime); virtual bool get_date_result(TIME *ltime,uint fuzzydate) diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index 2b9a612da18..a827f316ec1 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -1969,10 +1969,10 @@ bool Item_cond::walk(Item_processor processor, byte *arg) Move SUM items out from item tree and replace with reference SYNOPSIS - split_sum_func() - thd Thread handler - ref_pointer_array Pointer to array of reference fields - fields All fields in select + split_sum_func() + thd Thread handler + ref_pointer_array Pointer to array of reference fields + fields All fields in select NOTES This function is run on all expression (SELECT list, WHERE, HAVING etc) @@ -1982,16 +1982,6 @@ bool Item_cond::walk(Item_processor processor, byte *arg) so that we can easily find and calculate them. (Calculation done by update_sum_func() and copy_sum_funcs() in sql_select.cc) - - All found SUM items are added FIRST in the fields list and - we replace the item with a reference. - - We also replace all functions without side effects (like RAND() or UDF's) - that uses columns as arguments. - For functions with side effects, we just remember any fields referred - by the function to ensure that we get a copy of the field value for the - first accepted row. This ensures that we can do things like - SELECT a*SUM(b) FROM t1 WHERE a=1 */ void Item_cond::split_sum_func(THD *thd, Item **ref_pointer_array, @@ -1999,38 +1989,8 @@ void Item_cond::split_sum_func(THD *thd, Item **ref_pointer_array, { List_iterator li(list); Item *item; - used_tables_cache=0; - const_item_cache=0; - while ((item=li++)) - { - /* with_sum_func is set for items that contains a SUM expression */ - if (item->type() != SUM_FUNC_ITEM && - (item->with_sum_func || - (item->used_tables() & PSEUDO_TABLE_BITS))) - item->split_sum_func(thd, ref_pointer_array, fields); - else if (item->type() == SUM_FUNC_ITEM || - (item->used_tables() && item->type() != REF_ITEM)) - { - /* - Replace item with a reference so that we can easily calculate - it (in case of sum functions) or copy it (in case of fields) - - The test above is to ensure we don't do a reference for things - that are constants or are not yet calculated as in: - SELECT RAND() as r1, SUM(a) as r2 FROM t1 HAVING r1 > 1 AND r2 > 0 - */ - Item **ref= li.ref(); - uint el= fields.elements; - ref_pointer_array[el]= item; - Item *new_item= new Item_ref(ref_pointer_array + el, 0, item->name); - fields.push_front(item); - ref_pointer_array[el]= item; - thd->change_item_tree(ref, new_item); - } - item->update_used_tables(); - used_tables_cache|=item->used_tables(); - const_item_cache&=item->const_item(); - } + while ((item= li++)) + item->split_sum_func2(thd, ref_pointer_array, fields, li.ref()); } diff --git a/sql/item_func.cc b/sql/item_func.cc index d5d0ac8cd49..34c8732a9f2 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -352,28 +352,14 @@ bool Item_func::walk (Item_processor processor, byte *argument) } +/* See comments in Item_cmp_func::split_sum_func() */ + void Item_func::split_sum_func(THD *thd, Item **ref_pointer_array, List &fields) { Item **arg, **arg_end; for (arg= args, arg_end= args+arg_count; arg != arg_end ; arg++) - { - Item *item=* arg; - if (item->type() != SUM_FUNC_ITEM && - (item->with_sum_func || - (item->used_tables() & PSEUDO_TABLE_BITS))) - item->split_sum_func(thd, ref_pointer_array, fields); - else if (item->type() == SUM_FUNC_ITEM || - (item->used_tables() && item->type() != REF_ITEM)) - { - uint el= fields.elements; - ref_pointer_array[el]= item; - Item *new_item= new Item_ref(ref_pointer_array + el, 0, item->name); - fields.push_front(item); - ref_pointer_array[el]= item; - thd->change_item_tree(arg, new_item); - } - } + (*arg)->split_sum_func2(thd, ref_pointer_array, fields, arg); } diff --git a/sql/item_row.cc b/sql/item_row.cc index 0ace0fc0451..12d202a1699 100644 --- a/sql/item_row.cc +++ b/sql/item_row.cc @@ -90,25 +90,10 @@ void Item_row::split_sum_func(THD *thd, Item **ref_pointer_array, { Item **arg, **arg_end; for (arg= items, arg_end= items+arg_count; arg != arg_end ; arg++) - { - Item *item= *arg; - if (item->type() != SUM_FUNC_ITEM && - (item->with_sum_func || - (item->used_tables() & PSEUDO_TABLE_BITS))) - item->split_sum_func(thd, ref_pointer_array, fields); - else if (item->type() == SUM_FUNC_ITEM || - (item->used_tables() && item->type() != REF_ITEM)) - { - uint el= fields.elements; - ref_pointer_array[el]=*arg; - Item *new_item= new Item_ref(ref_pointer_array + el, 0, (*arg)->name); - fields.push_front(*arg); - ref_pointer_array[el]= *arg; - thd->change_item_tree(arg, new_item); - } - } + (*arg)->split_sum_func2(thd, ref_pointer_array, fields, arg); } + void Item_row::update_used_tables() { used_tables_cache= 0; diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index b22b65eddd0..a92c4e94c87 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -1758,20 +1758,7 @@ String *Item_func_elt::val_str(String *str) void Item_func_make_set::split_sum_func(THD *thd, Item **ref_pointer_array, List &fields) { - if (item->type() != SUM_FUNC_ITEM && - (item->with_sum_func || - (item->used_tables() & PSEUDO_TABLE_BITS))) - item->split_sum_func(thd, ref_pointer_array, fields); - else if (item->type() == SUM_FUNC_ITEM || - (item->used_tables() && item->type() != REF_ITEM)) - { - uint el= fields.elements; - ref_pointer_array[el]=item; - Item *new_item= new Item_ref(ref_pointer_array + el, 0, item->name); - fields.push_front(item); - ref_pointer_array[el]= item; - thd->change_item_tree(&item, new_item); - } + item->split_sum_func2(thd, ref_pointer_array, fields, &item); Item_str_func::split_sum_func(thd, ref_pointer_array, fields); } diff --git a/sql/sql_list.h b/sql/sql_list.h index 38c5af2a4f7..a607b31d60c 100644 --- a/sql/sql_list.h +++ b/sql/sql_list.h @@ -134,6 +134,15 @@ public: if (!--elements) last= &first; } + inline void concat(base_list *list) + { + if (!list->is_empty()) + { + *last= list->first; + last= list->last; + elements+= list->elements; + } + } inline void *pop(void) { if (first == &end_of_list) return 0; diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 8353ca9333d..7bb60fe8e79 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -8502,6 +8502,7 @@ setup_copy_fields(THD *thd, TMP_TABLE_PARAM *param, res_selected_fields.empty(); res_all_fields.empty(); List_iterator_fast itr(res_all_fields); + List extra_funcs; uint i, border= all_fields.elements - elements; DBUG_ENTER("setup_copy_fields"); @@ -8563,7 +8564,12 @@ setup_copy_fields(THD *thd, TMP_TABLE_PARAM *param, */ if (!(pos=new Item_copy_string(pos))) goto err; - if (param->copy_funcs.push_back(pos)) + if (i < border) // HAVING, ORDER and GROUP BY + { + if (extra_funcs.push_back(pos)) + goto err; + } + else if (param->copy_funcs.push_back(pos)) goto err; } res_all_fields.push_back(pos); @@ -8575,6 +8581,12 @@ setup_copy_fields(THD *thd, TMP_TABLE_PARAM *param, for (i= 0; i < border; i++) itr++; itr.sublist(res_selected_fields, elements); + /* + Put elements from HAVING, ORDER BY and GROUP BY last to ensure that any + reference used in these will resolve to a item that is already calculated + */ + param->copy_funcs.concat(&extra_funcs); + DBUG_RETURN(0); err: From f899de1d9d14cd466077e8de7c06c4d2cc85b5a3 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 8 Feb 2005 17:22:26 +0100 Subject: [PATCH 0949/1063] Makefile.am: added noinst_HEADERS to get all things for the src dist ndb/test/run-test/Makefile.am: added noinst_HEADERS to get all things for the src dist --- ndb/test/run-test/Makefile.am | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ndb/test/run-test/Makefile.am b/ndb/test/run-test/Makefile.am index 83dcb3dbbcf..127ef22f37c 100644 --- a/ndb/test/run-test/Makefile.am +++ b/ndb/test/run-test/Makefile.am @@ -21,6 +21,8 @@ LDADD_LOC = $(top_builddir)/ndb/test/src/libNDBT.a \ wrappersdir=$(prefix)/bin wrappers_SCRIPTS=atrt-testBackup atrt-mysql-test-run +noinst_HEADERS = run-test.hpp $(test_DATA) $(test_SCRIPTS) $(wrappers_SCRIPTS) README.ATRT + # Don't update the files from bitkeeper %::SCCS/s.% From ffe417fddeb68274166153a357d9d534675d1823 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 8 Feb 2005 19:49:40 +0200 Subject: [PATCH 0950/1063] Applied a patch for Netware. --- client/mysqltest.c | 5 +++++ extra/my_print_defaults.c | 5 +++++ extra/perror.c | 5 +++++ extra/resolve_stack_dump.c | 5 +++++ include/help_end.h | 1 + include/help_start.h | 2 ++ isam/pack_isam.c | 4 ++++ myisam/myisamlog.c | 2 ++ mysys/my_rename.c | 2 +- netware/BUILD/nwbootstrap | 8 +------- netware/mysql_test_run.c | 5 +++-- scripts/make_binary_distribution.sh | 8 ++++++-- sql/mysqld.cc | 8 +++++++- 13 files changed, 47 insertions(+), 13 deletions(-) diff --git a/client/mysqltest.c b/client/mysqltest.c index d81e199ab1f..042f84dfb9e 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -2169,6 +2169,9 @@ static struct my_option my_long_options[] = { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} }; + +#include + static void print_version(void) { printf("%s Ver %s Distrib %s, for %s (%s)\n",my_progname,MTEST_VERSION, @@ -2187,6 +2190,8 @@ void usage() my_print_variables(my_long_options); } +#include + static my_bool get_one_option(int optid, const struct my_option *opt __attribute__((unused)), diff --git a/extra/my_print_defaults.c b/extra/my_print_defaults.c index f4da839f8e2..2ec6f8b406f 100644 --- a/extra/my_print_defaults.c +++ b/extra/my_print_defaults.c @@ -55,6 +55,9 @@ static struct my_option my_long_options[] = {0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} }; + +#include + static void usage(my_bool version) { printf("%s Ver 1.6 for %s at %s\n",my_progname,SYSTEM_TYPE, @@ -69,6 +72,8 @@ static void usage(my_bool version) printf("\nExample usage:\n%s --config-file=my client mysql\n", my_progname); } +#include + static my_bool get_one_option(int optid, const struct my_option *opt __attribute__((unused)), diff --git a/extra/perror.c b/extra/perror.c index 27027520cbe..b377b360b5c 100644 --- a/extra/perror.c +++ b/extra/perror.c @@ -113,12 +113,15 @@ static HA_ERRORS ha_errlist[]= }; +#include + static void print_version(void) { printf("%s Ver %s, for %s (%s)\n",my_progname,PERROR_VERSION, SYSTEM_TYPE,MACHINE_TYPE); } + static void usage(void) { print_version(); @@ -130,6 +133,8 @@ static void usage(void) my_print_variables(my_long_options); } +#include + static my_bool get_one_option(int optid, const struct my_option *opt __attribute__((unused)), diff --git a/extra/resolve_stack_dump.c b/extra/resolve_stack_dump.c index 06a670b935d..666125990d2 100644 --- a/extra/resolve_stack_dump.c +++ b/extra/resolve_stack_dump.c @@ -65,12 +65,16 @@ static struct my_option my_long_options[] = static void verify_sort(); + +#include + static void print_version(void) { printf("%s Ver %s Distrib %s, for %s (%s)\n",my_progname,DUMP_VERSION, MYSQL_SERVER_VERSION,SYSTEM_TYPE,MACHINE_TYPE); } + static void usage() { print_version(); @@ -87,6 +91,7 @@ The numeric-dump-file should contain a numeric stack trace from mysqld.\n\ If the numeric-dump-file is not given, the stack trace is read from stdin.\n"); } +#include static void die(const char* fmt, ...) diff --git a/include/help_end.h b/include/help_end.h index a63d9e7ca9f..3bd16c09e3b 100644 --- a/include/help_end.h +++ b/include/help_end.h @@ -2,5 +2,6 @@ #undef printf #undef puts #undef fputs +#undef fputc #undef putchar #endif diff --git a/include/help_start.h b/include/help_start.h index 38bb91f7655..7ffde1ab803 100644 --- a/include/help_start.h +++ b/include/help_start.h @@ -4,4 +4,6 @@ #define printf consoleprintf #define puts(s) consoleprintf("%s\n",s) #define fputs(s,f) puts(s) +#define fputc(s,f) consoleprintf("%c", s) +#define putchar(s) consoleprintf("%c", s) #endif diff --git a/isam/pack_isam.c b/isam/pack_isam.c index aa83b2b2a96..0134e0411b2 100644 --- a/isam/pack_isam.c +++ b/isam/pack_isam.c @@ -260,6 +260,8 @@ static struct my_option my_long_options[] = }; +#include + static void print_version(void) { printf("%s Ver 5.10 for %s on %s\n", my_progname, SYSTEM_TYPE, MACHINE_TYPE); @@ -283,6 +285,8 @@ static void usage(void) my_print_variables(my_long_options); } +#include + static my_bool get_one_option(int optid, const struct my_option *opt __attribute__((unused)), diff --git a/myisam/myisamlog.c b/myisam/myisamlog.c index 6679510227e..dc98d813266 100644 --- a/myisam/myisamlog.c +++ b/myisam/myisamlog.c @@ -247,6 +247,7 @@ static void get_options(register int *argc, register char ***argv) /* Fall through */ case 'I': case '?': +#include printf("%s Ver 1.4 for %s at %s\n",my_progname,SYSTEM_TYPE, MACHINE_TYPE); puts("By Monty, for your professional use\n"); @@ -268,6 +269,7 @@ static void get_options(register int *argc, register char ***argv) puts("If a recover is done all writes and all possibly updates and deletes is done\nand errors are only counted."); puts("If one gives table names as arguments only these tables will be updated\n"); help=1; +#include break; default: printf("illegal option: \"-%c\"\n",*pos); diff --git a/mysys/my_rename.c b/mysys/my_rename.c index d4f99e83247..b5d813ad787 100644 --- a/mysys/my_rename.c +++ b/mysys/my_rename.c @@ -45,7 +45,7 @@ int my_rename(const char *from, const char *to, myf MyFlags) } #endif #if defined(HAVE_RENAME) -#ifdef __WIN__ +#if defined(__WIN__) || defined(__NETWARE__) /* On windows we can't rename over an existing file: Remove any conflicting files: diff --git a/netware/BUILD/nwbootstrap b/netware/BUILD/nwbootstrap index 25e843c87e3..2bd7150ec0d 100755 --- a/netware/BUILD/nwbootstrap +++ b/netware/BUILD/nwbootstrap @@ -171,15 +171,9 @@ do rm $file.org done -# create the libmysql.imp file in netware folder from libmysql/libmysql.def -# file -echo "generating llibmysql.imp file..." -awk 'BEGIN{x=0;} x==1 {print $1;next} /EXPORTS/{x=1}' libmysql/libmysql.def > netware/libmysql.imp - # create the libmysql.imp file in netware folder from libmysql/libmysql.def file echo "generating llibmysql.imp file..." -awk 'BEGIN{x=0;} x==1 {print $1;next} /EXPORTS/{x=1}' libmysql/libmysql.def > netware/libmysql.imp - +awk 'BEGIN{x=0;} END{printf("\n");} x==1 {printf(" %s",$1); x++; next} x>1 {printf(",\n %s", $1);next} /EXPORTS/{x=1}' libmysql/libmysql.def > netware/libmysql.imp # build linux tools echo "compiling linux tools..." diff --git a/netware/mysql_test_run.c b/netware/mysql_test_run.c index fd5725a6414..d8cfb79c1cb 100644 --- a/netware/mysql_test_run.c +++ b/netware/mysql_test_run.c @@ -192,7 +192,7 @@ void install_db(char *datadir) char error[PATH_MAX]; // input file - snprintf(input, PATH_MAX, "%s/bin/init_db.sql", base_dir); + snprintf(input, PATH_MAX, "%s/bin/test_db.sql", base_dir); snprintf(output, PATH_MAX, "%s/install.out", datadir); snprintf(error, PATH_MAX, "%s/install.err", datadir); @@ -1160,7 +1160,8 @@ void setup(char *file) setenv("MASTER_MYPORT", "9306", 1); setenv("SLAVE_MYPORT", "9307", 1); setenv("MYSQL_TCP_PORT", "3306", 1); - + snprintf(file_path, PATH_MAX*2, "%s/mysql_client_test --no-defaults --testcase--user=root --port=%u ", bin_dir, master_port); + setenv("MYSQL_CLIENT_TEST",file_path,1); } /****************************************************************************** diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 910aa38c33f..7a6e052f5c7 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -242,8 +242,12 @@ rm -f $BASE/bin/Makefile* $BASE/bin/*.in $BASE/bin/*.sh $BASE/bin/mysql_install_ # Copy system dependent files # if [ $BASE_SYSTEM = "netware" ] ; then - cp ./netware/static_init_db.sql ./netware/init_db.sql - ./scripts/fill_help_tables < ./Docs/manual.texi >> ./netware/init_db.sql +echo "CREATE DATABASE mysql;" > $BASE/bin/init_db.sql + echo "CREATE DATABASE test;" >> $BASE/bin/init_db.sql + sh ./scripts/mysql_create_system_tables.sh real "" "%" 0 >> $BASE/bin/init_db.sql + sh ./scripts/mysql_create_system_tables.sh test "" "%" 0 > $BASE/bin/test_db.sql +# cp ./netware/static_init_db.sql ./netware/init_db.sql +# ./scripts/fill_help_tables < ./Docs/manual.texi >> ./netware/init_db.sql fi # diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 503fb5bfb99..53dca59bc92 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -147,6 +147,10 @@ int deny_severity = LOG_WARNING; #include #endif +#define zVOLSTATE_ACTIVE 6 +#define zVOLSTATE_DEACTIVE 2 +#define zVOLSTATE_MAINTENANCE 3 + #ifdef __NETWARE__ #include #include @@ -1667,7 +1671,9 @@ ulong neb_event_callback(struct EventBlock *eblock) voldata= (EventChangeVolStateEnter_s *)eblock->EBEventData; /* Deactivation of a volume */ - if ((voldata->oldState == 6 && voldata->newState == 2)) + if ((voldata->oldState == zVOLSTATE_ACTIVE && + voldata->newState == zVOLSTATE_DEACTIVE || + voldata->newState == zVOLSTATE_MAINTENANCE)) { /* Ensure that we bring down MySQL server only for MySQL data From 37e2873fe38db47548ecac5bd3afaac23b8791be Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 8 Feb 2005 23:44:51 +0300 Subject: [PATCH 0951/1063] Fix for BUG#8371: wrong rec_per_key value for hash index on temporary table mysql-test/r/heap_hash.result: Testcase for BUG#8371: wrong rec_per_key value for hash index on temporary table mysql-test/t/heap_hash.test: Testcase for BUG#8371: wrong rec_per_key value for hash index on temporary table sql/ha_heap.cc: Fix for BUG#8371: wrong rec_per_key value for hash index on temporary table: Don't assume that table->rec_per_key==NULL if table->tmp_table != NO_TMP_TABLE, this is not true for tables created with "CREATE TEMPORARY TABLE" (while it holds for temporary tables created during query execution) sql/sql_select.cc: Initialize rec_per_key for all keys in temporary table. --- mysql-test/r/heap_hash.result | 10 ++++++++++ mysql-test/t/heap_hash.test | 6 ++++++ sql/ha_heap.cc | 13 +++++++------ sql/sql_select.cc | 1 + 4 files changed, 24 insertions(+), 6 deletions(-) diff --git a/mysql-test/r/heap_hash.result b/mysql-test/r/heap_hash.result index 4f5de197858..d3673cd2a63 100644 --- a/mysql-test/r/heap_hash.result +++ b/mysql-test/r/heap_hash.result @@ -355,3 +355,13 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ref heap_idx heap_idx 20 const 7 Using where 1 SIMPLE t3 ref a a 40 func,const 6 Using where drop table t1, t2, t3; +create temporary table t1 ( a int, index (a) ) engine=memory; +insert into t1 values (1),(2),(3),(4),(5); +select a from t1 where a in (1,3); +a +1 +3 +explain select a from t1 where a in (1,3); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range a a 5 NULL 2 Using where +drop table t1; diff --git a/mysql-test/t/heap_hash.test b/mysql-test/t/heap_hash.test index 6d8fdec4b9e..6d27f19dfad 100644 --- a/mysql-test/t/heap_hash.test +++ b/mysql-test/t/heap_hash.test @@ -251,3 +251,9 @@ explain select * from t1 ignore key(btree_idx), t3 where t1.name='matt' and t3.a drop table t1, t2, t3; +# Fix for BUG#8371: wrong rec_per_key value for hash index on temporary table +create temporary table t1 ( a int, index (a) ) engine=memory; +insert into t1 values (1),(2),(3),(4),(5); +select a from t1 where a in (1,3); +explain select a from t1 where a in (1,3); +drop table t1; diff --git a/sql/ha_heap.cc b/sql/ha_heap.cc index 96c19ce0705..3c2249ce281 100644 --- a/sql/ha_heap.cc +++ b/sql/ha_heap.cc @@ -60,8 +60,7 @@ int ha_heap::open(const char *name, int mode, uint test_if_locked) { /* Initialize variables for the opened table */ set_keys_for_scanning(); - if (table->tmp_table == NO_TMP_TABLE) - update_key_stats(); + update_key_stats(); } return (file ? 0 : 1); } @@ -103,6 +102,8 @@ void ha_heap::update_key_stats() for (uint i= 0; i < table->keys; i++) { KEY *key=table->key_info+i; + if (!key->rec_per_key) + continue; if (key->algorithm != HA_KEY_ALG_BTREE) { ha_rows hash_buckets= file->s->keydef[i].hash_buckets; @@ -122,8 +123,8 @@ int ha_heap::write_row(byte * buf) if (table->next_number_field && buf == table->record[0]) update_auto_increment(); res= heap_write(file,buf); - if (!res && table->tmp_table == NO_TMP_TABLE && - ++records_changed*HEAP_STATS_UPDATE_THRESHOLD > file->s->records) + if (!res && ++records_changed*HEAP_STATS_UPDATE_THRESHOLD > + file->s->records) update_key_stats(); return res; } @@ -135,8 +136,8 @@ int ha_heap::update_row(const byte * old_data, byte * new_data) if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_UPDATE) table->timestamp_field->set_time(); res= heap_update(file,old_data,new_data); - if (!res && table->tmp_table == NO_TMP_TABLE && - ++records_changed*HEAP_STATS_UPDATE_THRESHOLD > file->s->records) + if (!res && ++records_changed*HEAP_STATS_UPDATE_THRESHOLD > + file->s->records) update_key_stats(); return res; } diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 8353ca9333d..96265a96386 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -5289,6 +5289,7 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List &fields, keyinfo->key_length=(uint16) reclength; keyinfo->name=(char*) "tmp"; keyinfo->algorithm= HA_KEY_ALG_UNDEF; + keyinfo->rec_per_key=0; if (null_pack_length) { key_part_info->null_bit=0; From 1de817e9c467178b82690618223cf320d48a4b0b Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 8 Feb 2005 15:14:14 -0800 Subject: [PATCH 0952/1063] Fix removal of tables from cache when the database they are contained within is dropped and lower_case_table_names is set. (Bug #8355) mysql-test/t/lowercase_table2.test: Add new regression test mysql-test/r/lowercase_table2.result: Add results for regression test sql/mysql_priv.h: Change remove_db_from_cache() to use char* instead of my_string sql/sql_base.cc: Lowercase database name in remove_db_from_cache so that all of the correct entries are removed. --- mysql-test/r/lowercase_table2.result | 18 ++++++++++++++++++ mysql-test/t/lowercase_table2.test | 17 +++++++++++++++++ sql/mysql_priv.h | 2 +- sql/sql_base.cc | 12 +++++++++++- 4 files changed, 47 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/lowercase_table2.result b/mysql-test/r/lowercase_table2.result index a79b6b04063..8361b66817a 100644 --- a/mysql-test/r/lowercase_table2.result +++ b/mysql-test/r/lowercase_table2.result @@ -141,3 +141,21 @@ select * from T1; a b 1 abc drop table T1; +create database mysqltest_LC2; +use mysqltest_LC2; +create table myUC (i int); +insert into myUC values (1),(2),(3); +select * from myUC; +i +1 +2 +3 +use test; +drop database mysqltest_LC2; +create database mysqltest_LC2; +use mysqltest_LC2; +create table myUC (i int); +select * from myUC; +i +use test; +drop database mysqltest_LC2; diff --git a/mysql-test/t/lowercase_table2.test b/mysql-test/t/lowercase_table2.test index a766e39abab..eff5f2a99ec 100644 --- a/mysql-test/t/lowercase_table2.test +++ b/mysql-test/t/lowercase_table2.test @@ -111,3 +111,20 @@ select * from T1; alter table T1 add index (a); select * from T1; drop table T1; + +# +# Bug #8355: Tables not dropped from table cache on drop db +# +create database mysqltest_LC2; +use mysqltest_LC2; +create table myUC (i int); +insert into myUC values (1),(2),(3); +select * from myUC; +use test; +drop database mysqltest_LC2; +create database mysqltest_LC2; +use mysqltest_LC2; +create table myUC (i int); +select * from myUC; +use test; +drop database mysqltest_LC2; diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 6218bc49f53..f851e36dcad 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -750,7 +750,7 @@ bool close_temporary_table(THD *thd, const char *db, const char *table_name); void close_temporary(TABLE *table, bool delete_table=1); bool rename_temporary_table(THD* thd, TABLE *table, const char *new_db, const char *table_name); -void remove_db_from_cache(const my_string db); +void remove_db_from_cache(const char *db); void flush_tables(); bool remove_table_from_cache(THD *thd, const char *db, const char *table, bool return_if_owned_by_thd=0); diff --git a/sql/sql_base.cc b/sql/sql_base.cc index fe1f268e277..7ff5a02f05a 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -2864,8 +2864,18 @@ static void mysql_rm_tmp_tables(void) ** and afterwards delete those marked unused. */ -void remove_db_from_cache(const my_string db) +void remove_db_from_cache(const char *db) { + char name_buff[NAME_LEN+1]; + if (db && lower_case_table_names) + { + /* + convert database to lower case for comparision. + */ + strmake(name_buff, db, sizeof(name_buff)-1); + my_casedn_str(files_charset_info, name_buff); + db= name_buff; + } for (uint idx=0 ; idx < open_cache.records ; idx++) { TABLE *table=(TABLE*) hash_element(&open_cache,idx); From 71acf51498d61ec509e532f5c76efaae841b96f0 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 8 Feb 2005 18:43:27 -0800 Subject: [PATCH 0953/1063] Fix per-hour user connection limits by making sure that the number of connections is actually reset after an hour, and also fix (unlikely) conditions under which the per-hour query and connection limits could be exceeded. (Bug #8350) sql/sql_parse.cc: Add time_out_user_resource_limits() function to reset the user resource limits before they are checked, and add locking to check_mqh() because not doing so isn't as safe as the old comment explaining its absence said it is. --- sql/sql_parse.cc | 60 +++++++++++++++++++++++++++++++++--------------- 1 file changed, 42 insertions(+), 18 deletions(-) diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index cd0abafc0c9..bc7d71d8eaa 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -52,7 +52,8 @@ extern "C" pthread_mutex_t THR_LOCK_keycache; extern "C" int gethostname(char *name, int namelen); #endif -static int check_for_max_user_connections(USER_CONN *uc); +static void time_out_user_resource_limits(THD *thd, USER_CONN *uc); +static int check_for_max_user_connections(THD *thd, USER_CONN *uc); static void decrease_user_connections(USER_CONN *uc); static bool check_db_used(THD *thd,TABLE_LIST *tables); static bool check_merge_table_access(THD *thd, char *db, TABLE_LIST *tables); @@ -272,7 +273,7 @@ static bool check_user(THD *thd,enum_server_command command, const char *user, return -1; if (thd->user_connect && (thd->user_connect->user_resources.connections || max_user_connections) && - check_for_max_user_connections(thd->user_connect)) + check_for_max_user_connections(thd, thd->user_connect)) return -1; if (db && db[0]) { @@ -312,7 +313,7 @@ void init_max_user_conn(void) } -static int check_for_max_user_connections(USER_CONN *uc) +static int check_for_max_user_connections(THD *thd, USER_CONN *uc) { int error=0; DBUG_ENTER("check_for_max_user_connections"); @@ -325,6 +326,7 @@ static int check_for_max_user_connections(USER_CONN *uc) error=1; goto end; } + time_out_user_resource_limits(thd, uc); if (uc->user_resources.connections && uc->user_resources.connections <= uc->conn_per_hour) { @@ -397,14 +399,41 @@ void init_update_queries(void) /* - Check if maximum queries per hour limit has been reached - returns 0 if OK. + Reset per-hour user resource limits when it has been more than + an hour since they were last checked - In theory we would need a mutex in the USER_CONN structure for this to - be 100 % safe, but as the worst scenario is that we would miss counting - a couple of queries, this isn't critical. + SYNOPSIS: + time_out_user_resource_limits() + thd Thread handler + uc User connection details + + NOTE: + This assumes that the LOCK_user_conn mutex has been acquired, so it is + safe to test and modify members of the USER_CONN structure. */ +void time_out_user_resource_limits(THD *thd, USER_CONN *uc) +{ + time_t check_time = thd->start_time ? thd->start_time : time(NULL); + DBUG_ENTER("time_out_user_resource_limits"); + + /* If more than a hour since last check, reset resource checking */ + if (check_time - uc->intime >= 3600) + { + uc->questions=1; + uc->updates=0; + uc->conn_per_hour=0; + uc->intime=check_time; + } + + DBUG_VOID_RETURN; +} + + +/* + Check if maximum queries per hour limit has been reached + returns 0 if OK. +*/ static bool check_mqh(THD *thd, uint check_command) { @@ -414,16 +443,10 @@ static bool check_mqh(THD *thd, uint check_command) DBUG_ENTER("check_mqh"); DBUG_ASSERT(uc != 0); - /* If more than a hour since last check, reset resource checking */ - if (check_time - uc->intime >= 3600) - { - (void) pthread_mutex_lock(&LOCK_user_conn); - uc->questions=1; - uc->updates=0; - uc->conn_per_hour=0; - uc->intime=check_time; - (void) pthread_mutex_unlock(&LOCK_user_conn); - } + (void) pthread_mutex_lock(&LOCK_user_conn); + + time_out_user_resource_limits(thd, uc); + /* Check that we have not done too many questions / hour */ if (uc->user_resources.questions && uc->questions++ >= uc->user_resources.questions) @@ -446,6 +469,7 @@ static bool check_mqh(THD *thd, uint check_command) } } end: + (void) pthread_mutex_unlock(&LOCK_user_conn); DBUG_RETURN(error); } From 8c3d70e208563202d592827d6b4228ec9baff135 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 9 Feb 2005 14:24:25 +0100 Subject: [PATCH 0954/1063] ndb - Fix bug in bug fix in FastScheduler remove possibility of endless loop resulting in APZJobBuffer overflow due to statistics reporting ndb/src/kernel/vm/FastScheduler.cpp: Fix bug in bug fix in FastScheduler remove possibility of endless loop resulting in APZJobBuffer overflow due to statistics reporting --- ndb/src/kernel/vm/FastScheduler.cpp | 42 +++++++++++++++-------------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/ndb/src/kernel/vm/FastScheduler.cpp b/ndb/src/kernel/vm/FastScheduler.cpp index d05c02360a7..d0b7af27463 100644 --- a/ndb/src/kernel/vm/FastScheduler.cpp +++ b/ndb/src/kernel/vm/FastScheduler.cpp @@ -85,7 +85,7 @@ FastScheduler::activateSendPacked() void FastScheduler::doJob() { - Uint32 init_loopCount = 0; + Uint32 loopCount = 0; Uint32 TminLoops = getBOccupancy() + EXTRA_SIGNALS_PER_DO_JOB; Uint32 TloopMax = (Uint32)globalData.loopMax; if (TminLoops < TloopMax) { @@ -94,10 +94,9 @@ FastScheduler::doJob() if (TloopMax < MIN_NUMBER_OF_SIG_PER_DO_JOB) { TloopMax = MIN_NUMBER_OF_SIG_PER_DO_JOB; }//if + register Signal* signal = getVMSignals(); + register Uint32 tHighPrio= globalData.highestAvailablePrio; do{ - Uint32 loopCount = init_loopCount; - register Uint32 tHighPrio = globalData.highestAvailablePrio; - register Signal* signal = getVMSignals(); while ((tHighPrio < LEVEL_IDLE) && (loopCount < TloopMax)) { // signal->garbage_register(); // To ensure we find bugs quickly @@ -155,24 +154,27 @@ FastScheduler::doJob() }//if loopCount++; }//while - if (globalData.sendPackedActivated == 1) { - Uint32 t1 = theDoJobTotalCounter; - Uint32 t2 = theDoJobCallCounter; - t1 += (loopCount - init_loopCount); - t2++; - theDoJobTotalCounter = t1; - theDoJobCallCounter = t2; - if (t2 == 8192) { - reportDoJobStatistics(t1 >> 13); - theDoJobCallCounter = 0; - theDoJobTotalCounter = 0; - }//if - }//if - init_loopCount = loopCount; sendPacked(); + tHighPrio = globalData.highestAvailablePrio; + if(getBOccupancy() > MAX_OCCUPANCY) + { + if(loopCount != TloopMax) + abort(); + assert( loopCount == TloopMax ); + TloopMax += 512; + } } while ((getBOccupancy() > MAX_OCCUPANCY) || - ((init_loopCount < TloopMax) && - (globalData.highestAvailablePrio < LEVEL_IDLE))); + ((loopCount < TloopMax) && + (tHighPrio < LEVEL_IDLE))); + + theDoJobCallCounter ++; + theDoJobTotalCounter += loopCount; + if (theDoJobCallCounter == 8192) { + reportDoJobStatistics(theDoJobTotalCounter >> 13); + theDoJobCallCounter = 0; + theDoJobTotalCounter = 0; + }//if + }//FastScheduler::doJob() void FastScheduler::sendPacked() From 5c12bc88b9de85f54ab15b22fe57fcc722f0c918 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 9 Feb 2005 15:20:38 +0100 Subject: [PATCH 0955/1063] use EXTRA_DIST instead of noinst_HEADERS --- ndb/test/run-test/Makefile.am | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ndb/test/run-test/Makefile.am b/ndb/test/run-test/Makefile.am index 127ef22f37c..6b3ba0bff09 100644 --- a/ndb/test/run-test/Makefile.am +++ b/ndb/test/run-test/Makefile.am @@ -10,7 +10,7 @@ test_DATA=daily-basic-tests.txt daily-devel-tests.txt test_SCRIPTS=atrt-analyze-result.sh atrt-gather-result.sh atrt-setup.sh \ atrt-clear-result.sh make-config.sh make-index.sh make-html-reports.sh -atrt_SOURCES = main.cpp +atrt_SOURCES = main.cpp run-test.hpp INCLUDES_LOC = -I$(top_srcdir)/ndb/test/include LDADD_LOC = $(top_builddir)/ndb/test/src/libNDBT.a \ $(top_builddir)/ndb/src/libndbclient.la \ @@ -21,7 +21,7 @@ LDADD_LOC = $(top_builddir)/ndb/test/src/libNDBT.a \ wrappersdir=$(prefix)/bin wrappers_SCRIPTS=atrt-testBackup atrt-mysql-test-run -noinst_HEADERS = run-test.hpp $(test_DATA) $(test_SCRIPTS) $(wrappers_SCRIPTS) README.ATRT +EXTRA_DIST = $(test_DATA) $(test_SCRIPTS) $(wrappers_SCRIPTS) README.ATRT # Don't update the files from bitkeeper %::SCCS/s.% From 4ebc8efc91caa480227d1f38f2fc5550041c4214 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 9 Feb 2005 17:40:10 +0100 Subject: [PATCH 0956/1063] - added copyright header on top of the fill_help_tables.sql file (BUG#5772) - updated mysql-copyright-2 to properly convert this new header from GPL to commercial for the commercial distribution Build-tools/mysql-copyright-2: - added functionality to replace a copyright header in .sql files, too (needed for updating scripts/fill_help_tables.sql in the commercial source distribution) scripts/fill_help_tables.sh: - added copyright header on top of the fill_help_tables.sql file (BUG#5772) --- Build-tools/mysql-copyright-2 | 6 ++++++ scripts/fill_help_tables.sh | 18 ++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/Build-tools/mysql-copyright-2 b/Build-tools/mysql-copyright-2 index 2ea2e8ef441..972d5483d54 100755 --- a/Build-tools/mysql-copyright-2 +++ b/Build-tools/mysql-copyright-2 @@ -109,6 +109,12 @@ sub add_copyright $line_copyright= "! "; $end_copyright= ""; } + elsif ($ARGV =~ /\.sql$/) + { + $start_copyright="-- "; + $line_copyright= "-- "; + $end_copyright= ""; + } elsif ($ARGV =~ /\.asm$/) { $start_copyright="; "; diff --git a/scripts/fill_help_tables.sh b/scripts/fill_help_tables.sh index fbe7c597b34..fc0c684c2dc 100644 --- a/scripts/fill_help_tables.sh +++ b/scripts/fill_help_tables.sh @@ -493,6 +493,24 @@ sub print_insert_header } } +print < Date: Wed, 9 Feb 2005 17:49:43 +0100 Subject: [PATCH 0957/1063] - make sure to include the embedded test results in the source distribution --- mysql-test/Makefile.am | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mysql-test/Makefile.am b/mysql-test/Makefile.am index d718935cca8..9426b20d09c 100644 --- a/mysql-test/Makefile.am +++ b/mysql-test/Makefile.am @@ -47,7 +47,7 @@ dist-hook: $(distdir)/std_data $(INSTALL_DATA) $(srcdir)/t/*.test $(srcdir)/t/*.opt $(srcdir)/t/*.sh $(srcdir)/t/*.slave-mi $(distdir)/t $(INSTALL_DATA) $(srcdir)/include/*.inc $(distdir)/include - $(INSTALL_DATA) $(srcdir)/r/*.result $(srcdir)/r/*.require $(distdir)/r + $(INSTALL_DATA) $(srcdir)/r/*.result $(srcdir)/r/*.result.es $(srcdir)/r/*.require $(distdir)/r $(INSTALL_DATA) $(srcdir)/std_data/Moscow_leap $(distdir)/std_data $(INSTALL_DATA) $(srcdir)/std_data/*.dat $(srcdir)/std_data/*.000001 $(distdir)/std_data $(INSTALL_DATA) $(srcdir)/std_data/des_key_file $(distdir)/std_data @@ -65,7 +65,7 @@ install-data-local: $(INSTALL_DATA) $(srcdir)/t/*.opt $(DESTDIR)$(testdir)/t $(INSTALL_DATA) $(srcdir)/t/*.sh $(DESTDIR)$(testdir)/t $(INSTALL_DATA) $(srcdir)/t/*.slave-mi $(DESTDIR)$(testdir)/t - $(INSTALL_DATA) $(srcdir)/r/*.result $(DESTDIR)$(testdir)/r + $(INSTALL_DATA) $(srcdir)/r/*.result $(srcdir)/r/*.result.es $(DESTDIR)$(testdir)/r $(INSTALL_DATA) $(srcdir)/r/*.require $(DESTDIR)$(testdir)/r $(INSTALL_DATA) $(srcdir)/include/*.inc $(DESTDIR)$(testdir)/include $(INSTALL_DATA) $(srcdir)/std_data/*.dat $(DESTDIR)$(testdir)/std_data From 86d5bfc42b11773d74aa04b014e4304e5a1b9440 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 9 Feb 2005 21:08:08 +0200 Subject: [PATCH 0958/1063] reverted patch for BUG#7351 (because of performance ussie) --- mysql-test/r/subselect.result | 38 +++++------------------------------ mysql-test/t/subselect.test | 30 +-------------------------- sql/item_cmpfunc.cc | 5 ++--- sql/item_subselect.cc | 13 ++++-------- 4 files changed, 12 insertions(+), 74 deletions(-) diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index 03dcc23c919..3018726e6a1 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -1425,7 +1425,7 @@ Note 1003 (select test.t1.s1 AS `s1` from test.t1) s1 tttt drop table t1; -create table t1 (s1 char(5) not null, index s1(s1)); +create table t1 (s1 char(5), index s1(s1)); create table t2 (s1 char(5), index s1(s1)); insert into t1 values ('a1'),('a2'),('a3'); insert into t2 values ('a1'),('a2'); @@ -1451,25 +1451,25 @@ a2 1 a3 1 explain extended select s1, s1 NOT IN (SELECT s1 FROM t2) from t1; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 index NULL s1 5 NULL 3 Using index +1 PRIMARY t1 index NULL s1 6 NULL 3 Using index 2 DEPENDENT SUBQUERY t2 index_subquery s1 s1 6 func 2 Using index Warnings: Note 1003 select test.t1.s1 AS `s1`,not((test.t1.s1,(((test.t1.s1) in t2 on s1 chicking NULL)))) AS `s1 NOT IN (SELECT s1 FROM t2)` from test.t1 explain extended select s1, s1 = ANY (SELECT s1 FROM t2) from t1; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 index NULL s1 5 NULL 3 Using index +1 PRIMARY t1 index NULL s1 6 NULL 3 Using index 2 DEPENDENT SUBQUERY t2 index_subquery s1 s1 6 func 2 Using index Warnings: Note 1003 select test.t1.s1 AS `s1`,(test.t1.s1,(((test.t1.s1) in t2 on s1 chicking NULL))) AS `s1 = ANY (SELECT s1 FROM t2)` from test.t1 explain extended select s1, s1 <> ALL (SELECT s1 FROM t2) from t1; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 index NULL s1 5 NULL 3 Using index +1 PRIMARY t1 index NULL s1 6 NULL 3 Using index 2 DEPENDENT SUBQUERY t2 index_subquery s1 s1 6 func 2 Using index Warnings: Note 1003 select test.t1.s1 AS `s1`,not((test.t1.s1,(((test.t1.s1) in t2 on s1 chicking NULL)))) AS `s1 <> ALL (SELECT s1 FROM t2)` from test.t1 explain extended select s1, s1 NOT IN (SELECT s1 FROM t2 WHERE s1 < 'a2') from t1; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 index NULL s1 5 NULL 3 Using index +1 PRIMARY t1 index NULL s1 6 NULL 3 Using index 2 DEPENDENT SUBQUERY t2 index_subquery s1 s1 6 func 1 Using index; Using where Warnings: Note 1003 select test.t1.s1 AS `s1`,not((test.t1.s1,(((test.t1.s1) in t2 on s1 chicking NULL where (test.t2.s1 < _latin1'a2'))))) AS `s1 NOT IN (SELECT s1 FROM t2 WHERE s1 < 'a2')` from test.t1 @@ -2125,34 +2125,6 @@ SELECT DISTINCT Continent AS c FROM t1 WHERE Code <> SOME ( SELECT Code FROM t1 c Oceania drop table t1; -CREATE TABLE t1 ( f1 BIGINT ); -INSERT INTO t1 SET f1= NULL; -INSERT INTO t1 SET f1= 1; -CREATE TABLE t2 ( f1 BIGINT ); -SELECT f1 FROM t1 -WHERE f1 <> ALL ( SELECT f1 FROM t2 ); -f1 -NULL -1 -INSERT INTO t2 VALUES (1), (2); -SELECT f1 FROM t1 -WHERE f1 <> ALL ( SELECT f1 FROM t2 WHERE f1 > 2 ); -f1 -NULL -1 -SELECT f1 FROM t1 -WHERE f1 <> ALL ( SELECT f1 FROM t2 WHERE f1 > 2 -UNION -SELECT f1 FROM t2 WHERE f1 > 3); -f1 -NULL -1 -SELECT f1 FROM t1 -WHERE f1 <> ALL ( SELECT SUM(f1) AS sf1 FROM t2 HAVING sf1 > 10000); -f1 -NULL -1 -drop table t1,t2; create table t1 (a1 int); create table t2 (b1 int); select * from t1 where a2 > any(select b1 from t2); diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test index 55400dae0be..cb4f2eab923 100644 --- a/mysql-test/t/subselect.test +++ b/mysql-test/t/subselect.test @@ -889,7 +889,7 @@ drop table t1; # # IN optimisation test results # -create table t1 (s1 char(5) not null, index s1(s1)); +create table t1 (s1 char(5), index s1(s1)); create table t2 (s1 char(5), index s1(s1)); insert into t1 values ('a1'),('a2'),('a3'); insert into t2 values ('a1'),('a2'); @@ -1387,34 +1387,6 @@ INSERT INTO t1 VALUES ('UMI','United States Minor Outlying Islands','Oceania','M SELECT DISTINCT Continent AS c FROM t1 WHERE Code <> SOME ( SELECT Code FROM t1 WHERE Continent = c AND Population < 200); drop table t1; -# -# Test cases for bug #7351: -# quantified predicate with subquery returning empty result set -# - -CREATE TABLE t1 ( f1 BIGINT ); -INSERT INTO t1 SET f1= NULL; -INSERT INTO t1 SET f1= 1; -CREATE TABLE t2 ( f1 BIGINT ); - -SELECT f1 FROM t1 - WHERE f1 <> ALL ( SELECT f1 FROM t2 ); - -INSERT INTO t2 VALUES (1), (2); - -SELECT f1 FROM t1 - WHERE f1 <> ALL ( SELECT f1 FROM t2 WHERE f1 > 2 ); - -SELECT f1 FROM t1 - WHERE f1 <> ALL ( SELECT f1 FROM t2 WHERE f1 > 2 - UNION - SELECT f1 FROM t2 WHERE f1 > 3); - -SELECT f1 FROM t1 - WHERE f1 <> ALL ( SELECT SUM(f1) AS sf1 FROM t2 HAVING sf1 > 10000); - -drop table t1,t2; - # # Test for BUG#7885: Server crash when 'any' subselect compared to # non-existant field. diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index 2b9a612da18..79295eb90b0 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -636,13 +636,12 @@ longlong Item_in_optimizer::val_int() { DBUG_ASSERT(fixed == 1); cache->store(args[0]); - longlong tmp= args[1]->val_int_result(); if (cache->null_value) { - if (tmp) - null_value= 1; + null_value= 1; return 0; } + longlong tmp= args[1]->val_int_result(); null_value= args[1]->null_value; return tmp; } diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index 16186b1a6d3..3a1e1918e55 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -825,8 +825,6 @@ Item_in_subselect::single_value_transformer(JOIN *join, select_lex->ref_pointer_array, (char *)"", this->full_name())); - if (!abort_on_null && left_expr->maybe_null) - item= new Item_cond_or(new Item_func_isnull(left_expr), item); /* AND and comparison functions can't be changed during fix_fields() we can assign select_lex->having here, and pass 0 as last @@ -872,8 +870,6 @@ Item_in_subselect::single_value_transformer(JOIN *join, select_lex->having_fix_field= 0; item= new Item_cond_or(item, new Item_func_isnull(orig_item)); - if (left_expr->maybe_null) - item= new Item_cond_or(new Item_func_isnull(left_expr), item); } item->name= (char *)in_additional_cond; /* @@ -894,13 +890,12 @@ Item_in_subselect::single_value_transformer(JOIN *join, we can assign select_lex->having here, and pass 0 as last argument (reference) to fix_fields() */ - item= func->create(expr, - new Item_null_helper(this, item, + select_lex->having= + join->having= + func->create(expr, + new Item_null_helper(this, item, (char *)"", (char *)"")); - if (!abort_on_null && left_expr->maybe_null) - item= new Item_cond_or(new Item_func_isnull(left_expr), item); - select_lex->having= join->having= item; select_lex->having_fix_field= 1; if (join->having->fix_fields(thd, join->tables_list, 0)) From ae14393e7487f3c8a97f3dc44cab7a2c19cdd0a9 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 9 Feb 2005 16:14:13 -0800 Subject: [PATCH 0959/1063] When escaping a string in a multi-byte character set, escape all bytes of a character that appears to be a multi-byte character based on its first byte, but is not actually a valid multi-byte character. (Bug #8378) tests/mysql_client_test.c: Add test for Bug #8317 mysys/charset.c: Properly escape invalid multibyte characters. --- mysys/charset.c | 20 ++++++++++++++++ tests/mysql_client_test.c | 49 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+) diff --git a/mysys/charset.c b/mysys/charset.c index cb2379f8723..934125ead4a 100644 --- a/mysys/charset.c +++ b/mysys/charset.c @@ -581,6 +581,26 @@ ulong escape_string_for_mysql(CHARSET_INFO *charset_info, char *to, from--; continue; } + /* + If the next character appears to begin a multi-byte character, we + escape all of the bytes of that apparent character. (The character just + looks like a multi-byte character -- if it were actually a multi-byte + character, it would have been passed through in the test above.) + + Without this check, we can create a problem by converting an invalid + multi-byte character into a valid one. For example, 0xbf27 is not + a valid GBK character, but 0xbf5c is. (0x27 = ', 0x5c = \) + */ + if (use_mb_flag && (l= my_mbcharlen(charset_info, *from)) > 1) + { + while (l--) + { + *to++= '\\'; + *to++= *from++; + } + from--; + continue; + } #endif switch (*from) { case 0: /* Must be escaped for 'mysql' */ diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index 83f8f6ab143..b7e3e1b3469 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -11532,6 +11532,54 @@ static void test_bug6761(void) myquery(rc); } +/* + Test mysql_real_escape_string() with gbk charset + + The important part is that 0x27 (') is the second-byte in a invvalid + two-byte GBK character here. But 0xbf5c is a valid GBK character, so + it needs to be escaped as 0x5cbf5c27 +*/ +#define TEST_BUG8317_IN "\xef\xbb\xbf\x27" +#define TEST_BUG8317_OUT "\xef\xbb\x5c\xbf\x5c\x27" + +static void test_bug8317() +{ + MYSQL *lmysql; + char out[9]; /* strlen(TEST_BUG8317)*2+1 */ + int len; + + myheader("test_bug8317"); + + if (!opt_silent) + fprintf(stdout, "\n Establishing a test connection ..."); + if (!(lmysql= mysql_init(NULL))) + { + myerror("mysql_init() failed"); + exit(1); + } + if (mysql_options(lmysql, MYSQL_SET_CHARSET_NAME, "gbk")) + { + myerror("mysql_options() failed"); + exit(1); + } + if (!(mysql_real_connect(lmysql, opt_host, opt_user, + opt_password, current_db, opt_port, + opt_unix_socket, 0))) + { + myerror("connection failed"); + exit(1); + } + if (!opt_silent) + fprintf(stdout, " OK"); + + len= mysql_real_escape_string(lmysql, out, TEST_BUG8317_IN, 4); + + /* No escaping should have actually happened. */ + DIE_UNLESS(memcmp(out, TEST_BUG8317_OUT, len) == 0); + + mysql_close(lmysql); +} + /* Read and parse arguments and MySQL options from my.cnf */ @@ -11739,6 +11787,7 @@ static struct my_tests_st my_tests[]= { { "test_conversion", test_conversion }, { "test_rewind", test_rewind }, { "test_bug6761", test_bug6761 }, + { "test_bug8317", test_bug8317 }, { 0, 0 } }; From cf5816096d8b16d0db56e2a6f291cf91eac5ae42 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 10 Feb 2005 11:40:32 +0100 Subject: [PATCH 0960/1063] ndb - Reenable old benchmark ndb/test/ndbapi/Makefile.am: Reenable old benchmark --- ndb/test/ndbapi/Makefile.am | 5 +- ndb/test/ndbapi/bench/asyncGenerator.cpp | 571 ++++++++++++ ndb/test/ndbapi/bench/dbGenerator.h | 63 ++ ndb/test/ndbapi/bench/dbPopulate.cpp | 244 ++++++ ndb/test/ndbapi/bench/dbPopulate.h | 59 ++ ndb/test/ndbapi/bench/macros.h | 51 ++ ndb/test/ndbapi/bench/mainAsyncGenerator.cpp | 503 +++++++++++ ndb/test/ndbapi/bench/mainPopulate.cpp | 84 ++ ndb/test/ndbapi/bench/ndb_async1.cpp | 647 ++++++++++++++ ndb/test/ndbapi/bench/ndb_async2.cpp | 757 ++++++++++++++++ ndb/test/ndbapi/bench/ndb_error.hpp | 81 ++ ndb/test/ndbapi/bench/ndb_schema.hpp | 78 ++ .../ndbapi/bench/ndb_user_transaction.cpp | 825 ++++++++++++++++++ .../ndbapi/bench/ndb_user_transaction2.cpp | 825 ++++++++++++++++++ .../ndbapi/bench/ndb_user_transaction3.cpp | 793 +++++++++++++++++ .../ndbapi/bench/ndb_user_transaction4.cpp | 770 ++++++++++++++++ .../ndbapi/bench/ndb_user_transaction5.cpp | 769 ++++++++++++++++ .../ndbapi/bench/ndb_user_transaction6.cpp | 561 ++++++++++++ ndb/test/ndbapi/bench/testData.h | 156 ++++ ndb/test/ndbapi/bench/testDefinitions.h | 90 ++ ndb/test/ndbapi/bench/userInterface.cpp | 745 ++++++++++++++++ ndb/test/ndbapi/bench/userInterface.h | 151 ++++ 22 files changed, 8827 insertions(+), 1 deletion(-) create mode 100644 ndb/test/ndbapi/bench/asyncGenerator.cpp create mode 100644 ndb/test/ndbapi/bench/dbGenerator.h create mode 100644 ndb/test/ndbapi/bench/dbPopulate.cpp create mode 100644 ndb/test/ndbapi/bench/dbPopulate.h create mode 100644 ndb/test/ndbapi/bench/macros.h create mode 100644 ndb/test/ndbapi/bench/mainAsyncGenerator.cpp create mode 100644 ndb/test/ndbapi/bench/mainPopulate.cpp create mode 100644 ndb/test/ndbapi/bench/ndb_async1.cpp create mode 100644 ndb/test/ndbapi/bench/ndb_async2.cpp create mode 100644 ndb/test/ndbapi/bench/ndb_error.hpp create mode 100644 ndb/test/ndbapi/bench/ndb_schema.hpp create mode 100644 ndb/test/ndbapi/bench/ndb_user_transaction.cpp create mode 100644 ndb/test/ndbapi/bench/ndb_user_transaction2.cpp create mode 100644 ndb/test/ndbapi/bench/ndb_user_transaction3.cpp create mode 100644 ndb/test/ndbapi/bench/ndb_user_transaction4.cpp create mode 100644 ndb/test/ndbapi/bench/ndb_user_transaction5.cpp create mode 100644 ndb/test/ndbapi/bench/ndb_user_transaction6.cpp create mode 100644 ndb/test/ndbapi/bench/testData.h create mode 100644 ndb/test/ndbapi/bench/testDefinitions.h create mode 100644 ndb/test/ndbapi/bench/userInterface.cpp create mode 100644 ndb/test/ndbapi/bench/userInterface.h diff --git a/ndb/test/ndbapi/Makefile.am b/ndb/test/ndbapi/Makefile.am index 33744cc0f51..0c84db8c068 100644 --- a/ndb/test/ndbapi/Makefile.am +++ b/ndb/test/ndbapi/Makefile.am @@ -30,7 +30,8 @@ testSystemRestart \ testTimeout \ testTransactions \ testDeadlock \ -test_event ndbapi_slow_select testReadPerf testLcp +test_event ndbapi_slow_select testReadPerf testLcp \ +DbCreate DbAsyncGenerator #flexTimedAsynch #testBlobs @@ -69,6 +70,8 @@ test_event_SOURCES = test_event.cpp ndbapi_slow_select_SOURCES = slow_select.cpp testReadPerf_SOURCES = testReadPerf.cpp testLcp_SOURCES = testLcp.cpp +DbCreate_SOURCES= bench/mainPopulate.cpp bench/dbPopulate.cpp bench/userInterface.cpp +DbAsyncGenerator_SOURCES= bench/mainAsyncGenerator.cpp bench/asyncGenerator.cpp bench/ndb_async2.cpp INCLUDES_LOC = -I$(top_srcdir)/ndb/include/kernel diff --git a/ndb/test/ndbapi/bench/asyncGenerator.cpp b/ndb/test/ndbapi/bench/asyncGenerator.cpp new file mode 100644 index 00000000000..d91e38dff1a --- /dev/null +++ b/ndb/test/ndbapi/bench/asyncGenerator.cpp @@ -0,0 +1,571 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/*************************************************************** +* I N C L U D E D F I L E S * +***************************************************************/ + +#include + +#include "dbGenerator.h" +#include +#include +#include + +/*************************************************************** +* L O C A L C O N S T A N T S * +***************************************************************/ + +/*************************************************************** +* L O C A L D A T A S T R U C T U R E S * +***************************************************************/ + +/*************************************************************** +* L O C A L F U N C T I O N S * +***************************************************************/ + +static void getRandomSubscriberNumber(SubscriberNumber number); +static void getRandomServerId(ServerId *serverId); +static void getRandomChangedBy(ChangedBy changedBy); +static void getRandomChangedTime(ChangedTime changedTime); + +static void clearTransaction(TransactionDefinition *trans); +static void initGeneratorStatistics(GeneratorStatistics *gen); + +static void doOneTransaction(ThreadData * td, + int parallellism, + int millisSendPoll, + int minEventSendPoll, + int forceSendPoll); +static void doTransaction_T1(Ndb * pNDB, ThreadData * td, int async); +static void doTransaction_T2(Ndb * pNDB, ThreadData * td, int async); +static void doTransaction_T3(Ndb * pNDB, ThreadData * td, int async); +static void doTransaction_T4(Ndb * pNDB, ThreadData * td, int async); +static void doTransaction_T5(Ndb * pNDB, ThreadData * td, int async); + +/*************************************************************** +* L O C A L D A T A * +***************************************************************/ + +static SequenceValues transactionDefinition[] = { + {25, 1}, + {25, 2}, + {20, 3}, + {15, 4}, + {15, 5}, + {0, 0} +}; + +static SequenceValues rollbackDefinition[] = { + {98, 0}, + {2 , 1}, + {0, 0} +}; + +static int maxsize = 0; + +/*************************************************************** +* P U B L I C D A T A * +***************************************************************/ + +/*************************************************************** +**************************************************************** +* L O C A L F U N C T I O N S C O D E S E C T I O N * +**************************************************************** +***************************************************************/ + +static void getRandomSubscriberNumber(SubscriberNumber number) +{ + uint32 tmp; + char sbuf[SUBSCRIBER_NUMBER_LENGTH + 1]; + tmp = myRandom48(NO_OF_SUBSCRIBERS); + sprintf(sbuf, "%.*d", SUBSCRIBER_NUMBER_LENGTH, tmp); + memcpy(number, sbuf, SUBSCRIBER_NUMBER_LENGTH); +} + +static void getRandomServerId(ServerId *serverId) +{ + *serverId = myRandom48(NO_OF_SERVERS); +} + +static void getRandomChangedBy(ChangedBy changedBy) +{ + memset(changedBy, myRandom48(26)+'A', CHANGED_BY_LENGTH); + changedBy[CHANGED_BY_LENGTH] = 0; +} + +static void getRandomChangedTime(ChangedTime changedTime) +{ + memset(changedTime, myRandom48(26)+'A', CHANGED_TIME_LENGTH); + changedTime[CHANGED_TIME_LENGTH] = 0; +} + +static void clearTransaction(TransactionDefinition *trans) +{ + trans->count = 0; + trans->branchExecuted = 0; + trans->rollbackExecuted = 0; + trans->latencyCounter = myRandom48(127); + trans->latency.reset(); +} + +static int listFull(SessionList *list) +{ + return(list->numberInList == SESSION_LIST_LENGTH); +} + +static int listEmpty(SessionList *list) +{ + return(list->numberInList == 0); +} + +static void insertSession(SessionList *list, + SubscriberNumber number, + ServerId serverId) +{ + SessionElement *e; + if( listFull(list) ) return; + + e = &list->list[list->writeIndex]; + + strcpy(e->subscriberNumber, number); + e->serverId = serverId; + + list->writeIndex = (list->writeIndex + 1) % SESSION_LIST_LENGTH; + list->numberInList++; + + if( list->numberInList > maxsize ) + maxsize = list->numberInList; +} + +static SessionElement *getNextSession(SessionList *list) +{ + if( listEmpty(list) ) return(0); + + return(&list->list[list->readIndex]); +} + +static void deleteSession(SessionList *list) +{ + if( listEmpty(list) ) return; + + list->readIndex = (list->readIndex + 1) % SESSION_LIST_LENGTH; + list->numberInList--; +} + +static void initGeneratorStatistics(GeneratorStatistics *gen) +{ + int i; + + if( initSequence(&gen->transactionSequence, + transactionDefinition) != 0 ) { + ndbout_c("could not set the transaction types"); + exit(0); + } + + if( initSequence(&gen->rollbackSequenceT4, + rollbackDefinition) != 0 ) { + ndbout_c("could not set the rollback sequence"); + exit(0); + } + + if( initSequence(&gen->rollbackSequenceT5, + rollbackDefinition) != 0 ) { + ndbout_c("could not set the rollback sequence"); + exit(0); + } + + for(i = 0; i < NUM_TRANSACTION_TYPES; i++ ) + clearTransaction(&gen->transactions[i]); + + gen->totalTransactions = 0; + + gen->activeSessions.numberInList = 0; + gen->activeSessions.readIndex = 0; + gen->activeSessions.writeIndex = 0; +} + + +static +void +doOneTransaction(ThreadData * td, int p, int millis, int minEvents, int force) +{ + int i; + unsigned int transactionType; + int async = 1; + if (p == 1) { + async = 0; + }//if + for(i = 0; isendPollNdb(millis, minEvents, force); + }//if +} + +static +void +doTransaction_T1(Ndb * pNDB, ThreadData * td, int async) +{ + /*----------------*/ + /* Init arguments */ + /*----------------*/ + getRandomSubscriberNumber(td->transactionData.number); + getRandomChangedBy(td->transactionData.changed_by); + BaseString::snprintf(td->transactionData.changed_time, + sizeof(td->transactionData.changed_time), + "%ld - %d", td->changedTime++, myRandom48(65536*1024)); + //getRandomChangedTime(td->transactionData.changed_time); + td->transactionData.location = td->transactionData.changed_by[0]; + + /*-----------------*/ + /* Run transaction */ + /*-----------------*/ + td->runState = Running; + td->generator.transactions[0].startLatency(); + + start_T1(pNDB, td, async); +} + +static +void +doTransaction_T2(Ndb * pNDB, ThreadData * td, int async) +{ + /*----------------*/ + /* Init arguments */ + /*----------------*/ + getRandomSubscriberNumber(td->transactionData.number); + + /*-----------------*/ + /* Run transaction */ + /*-----------------*/ + td->runState = Running; + td->generator.transactions[1].startLatency(); + + start_T2(pNDB, td, async); +} + +static +void +doTransaction_T3(Ndb * pNDB, ThreadData * td, int async) +{ + SessionElement *se; + + /*----------------*/ + /* Init arguments */ + /*----------------*/ + se = getNextSession(&td->generator.activeSessions); + if( se ) { + strcpy(td->transactionData.number, se->subscriberNumber); + td->transactionData.server_id = se->serverId; + td->transactionData.sessionElement = 1; + } else { + getRandomSubscriberNumber(td->transactionData.number); + getRandomServerId(&td->transactionData.server_id); + td->transactionData.sessionElement = 0; + } + + td->transactionData.server_bit = (1 << td->transactionData.server_id); + + /*-----------------*/ + /* Run transaction */ + /*-----------------*/ + td->runState = Running; + td->generator.transactions[2].startLatency(); + start_T3(pNDB, td, async); +} + +static +void +doTransaction_T4(Ndb * pNDB, ThreadData * td, int async) +{ + /*----------------*/ + /* Init arguments */ + /*----------------*/ + getRandomSubscriberNumber(td->transactionData.number); + getRandomServerId(&td->transactionData.server_id); + + td->transactionData.server_bit = (1 << td->transactionData.server_id); + td->transactionData.do_rollback = + getNextRandom(&td->generator.rollbackSequenceT4); + +#if 0 + memset(td->transactionData.session_details, + myRandom48(26)+'A', SESSION_DETAILS_LENGTH); +#endif + td->transactionData.session_details[SESSION_DETAILS_LENGTH] = 0; + + /*-----------------*/ + /* Run transaction */ + /*-----------------*/ + td->runState = Running; + td->generator.transactions[3].startLatency(); + start_T4(pNDB, td, async); +} + +static +void +doTransaction_T5(Ndb * pNDB, ThreadData * td, int async) +{ + SessionElement * se; + se = getNextSession(&td->generator.activeSessions); + if( se ) { + strcpy(td->transactionData.number, se->subscriberNumber); + td->transactionData.server_id = se->serverId; + td->transactionData.sessionElement = 1; + } + else { + getRandomSubscriberNumber(td->transactionData.number); + getRandomServerId(&td->transactionData.server_id); + td->transactionData.sessionElement = 0; + } + + td->transactionData.server_bit = (1 << td->transactionData.server_id); + td->transactionData.do_rollback + = getNextRandom(&td->generator.rollbackSequenceT5); + + /*-----------------*/ + /* Run transaction */ + /*-----------------*/ + td->runState = Running; + td->generator.transactions[4].startLatency(); + start_T5(pNDB, td, async); +} + +void +complete_T1(ThreadData * data){ + data->generator.transactions[0].stopLatency(); + data->generator.transactions[0].count++; + + data->runState = Runnable; + data->generator.totalTransactions++; +} + +void +complete_T2(ThreadData * data){ + data->generator.transactions[1].stopLatency(); + data->generator.transactions[1].count++; + + data->runState = Runnable; + data->generator.totalTransactions++; +} + +void +complete_T3(ThreadData * data){ + + data->generator.transactions[2].stopLatency(); + data->generator.transactions[2].count++; + + if(data->transactionData.branchExecuted) + data->generator.transactions[2].branchExecuted++; + + data->runState = Runnable; + data->generator.totalTransactions++; +} + +void +complete_T4(ThreadData * data){ + + data->generator.transactions[3].stopLatency(); + data->generator.transactions[3].count++; + + if(data->transactionData.branchExecuted) + data->generator.transactions[3].branchExecuted++; + if(data->transactionData.do_rollback) + data->generator.transactions[3].rollbackExecuted++; + + if(data->transactionData.branchExecuted && + !data->transactionData.do_rollback){ + insertSession(&data->generator.activeSessions, + data->transactionData.number, + data->transactionData.server_id); + } + + data->runState = Runnable; + data->generator.totalTransactions++; + +} +void +complete_T5(ThreadData * data){ + + data->generator.transactions[4].stopLatency(); + data->generator.transactions[4].count++; + + if(data->transactionData.branchExecuted) + data->generator.transactions[4].branchExecuted++; + if(data->transactionData.do_rollback) + data->generator.transactions[4].rollbackExecuted++; + + if(data->transactionData.sessionElement && + !data->transactionData.do_rollback){ + deleteSession(&data->generator.activeSessions); + } + + data->runState = Runnable; + data->generator.totalTransactions++; +} + +/*************************************************************** +**************************************************************** +* P U B L I C F U N C T I O N S C O D E S E C T I O N * +**************************************************************** +***************************************************************/ +void +asyncGenerator(ThreadData *data, + int parallellism, + int millisSendPoll, + int minEventSendPoll, + int forceSendPoll) +{ + ThreadData * startUp; + + GeneratorStatistics *st; + double periodStop; + double benchTimeStart; + double benchTimeEnd; + int i, j, done; + + myRandom48Init(data->randomSeed); + + for(i = 0; isendPollNdb(); + } + } + ndbout_c("Benchmark period starts"); + + /*-------------------------*/ + /* normal benchmark period */ + /*-------------------------*/ + benchTimeStart = userGetTime(); + + periodStop = benchTimeStart + (double)data[0].testSeconds; + while(userGetTime() < periodStop) + doOneTransaction(data, parallellism, + millisSendPoll, minEventSendPoll, forceSendPoll); + + benchTimeEnd = userGetTime(); + + ndbout_c("Benchmark period done"); + + /** + * Wait for all transactions + */ + done = 0; + while(!done){ + done = 1; + for(i = 0; isendPollNdb(); + } + } + + /*------------------*/ + /* cool down period */ + /*------------------*/ + periodStop = userGetTime() + (double)data[0].coolDownSeconds; + while(userGetTime() < periodStop){ + doOneTransaction(startUp, parallellism, + millisSendPoll, minEventSendPoll, forceSendPoll); + } + + done = 0; + while(!done){ + done = 1; + for(i = 0; isendPollNdb(); + } + } + + + /*---------------------------------------------------------*/ + /* add the times for all transaction for inner loop timing */ + /*---------------------------------------------------------*/ + for(j = 0; jouterLoopTime = benchTimeEnd - benchTimeStart; + st->outerTps = getTps(st->totalTransactions, st->outerLoopTime); + } + /* ndbout_c("maxsize = %d\n",maxsize); */ + + free(startUp); +} + diff --git a/ndb/test/ndbapi/bench/dbGenerator.h b/ndb/test/ndbapi/bench/dbGenerator.h new file mode 100644 index 00000000000..2256498e151 --- /dev/null +++ b/ndb/test/ndbapi/bench/dbGenerator.h @@ -0,0 +1,63 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef DBGENERATOR_H +#define DBGENERATOR_H + +/*************************************************************** +* I N C L U D E D F I L E S * +***************************************************************/ + +#include "testData.h" +#include "userInterface.h" + +/*************************************************************** +* M A C R O S * +***************************************************************/ + +/***************************************************************/ +/* C O N S T A N T S */ +/***************************************************************/ + +/*************************************************************** +* D A T A S T R U C T U R E S * +***************************************************************/ + +/*************************************************************** +* P U B L I C F U N C T I O N S * +***************************************************************/ + +#ifdef __cplusplus +extern "C" { +#endif + +extern void asyncGenerator(ThreadData *d, int parallellism, + int millisSendPoll, + int minEventSendPoll, + int forceSendPoll); + +#ifdef __cplusplus +} +#endif + +/*************************************************************** +* E X T E R N A L D A T A * +***************************************************************/ + + + +#endif /* DBGENERATOR_H */ + diff --git a/ndb/test/ndbapi/bench/dbPopulate.cpp b/ndb/test/ndbapi/bench/dbPopulate.cpp new file mode 100644 index 00000000000..42fbb52f3b2 --- /dev/null +++ b/ndb/test/ndbapi/bench/dbPopulate.cpp @@ -0,0 +1,244 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/*************************************************************** +* I N C L U D E D F I L E S * +***************************************************************/ + +#include + +#include "userInterface.h" + +#include "dbPopulate.h" +#include +#include + +/*************************************************************** +* L O C A L C O N S T A N T S * +***************************************************************/ + +/*************************************************************** +* L O C A L D A T A S T R U C T U R E S * +***************************************************************/ + +/*************************************************************** +* L O C A L F U N C T I O N S * +***************************************************************/ + +static void getRandomSubscriberData(int subscriberNo, + SubscriberNumber number, + SubscriberName name); + +static void populate(char *title, + int count, + void (*func)(UserHandle*,int), + UserHandle *uh); + +static void populateServers(UserHandle *uh, int count); +static void populateSubscribers(UserHandle *uh, int count); +static void populateGroups(UserHandle *uh, int count); + +/*************************************************************** +* L O C A L D A T A * +***************************************************************/ + +static SequenceValues permissionsDefinition[] = { + {90, 1}, + {10, 0}, + {0, 0} +}; + +/*************************************************************** +* P U B L I C D A T A * +***************************************************************/ + + +/*************************************************************** +**************************************************************** +* L O C A L F U N C T I O N S C O D E S E C T I O N * +**************************************************************** +***************************************************************/ + +static void getRandomSubscriberData(int subscriberNo, + SubscriberNumber number, + SubscriberName name) +{ + char sbuf[SUBSCRIBER_NUMBER_LENGTH + 1]; + sprintf(sbuf, "%.*d", SUBSCRIBER_NUMBER_LENGTH, subscriberNo); + memcpy(number, sbuf, SUBSCRIBER_NUMBER_LENGTH); + + memset(name, myRandom48(26)+'A', SUBSCRIBER_NAME_LENGTH); +} + +static void populate(char *title, + int count, + void (*func)(UserHandle*, int), + UserHandle *uh) +{ + ndbout_c("Populating %d '%s' ... ",count, title); + /* fflush(stdout); */ + func(uh,count); + ndbout_c("done"); +} + +static void populateServers(UserHandle *uh, int count) +{ + int i, j; + int len; + char tmp[80]; + int suffix_length = 1; + ServerName serverName; + SubscriberSuffix suffix; + + int commitCount = 0; + + for(i = 0; i < SUBSCRIBER_NUMBER_SUFFIX_LENGTH; i++) + suffix_length *= 10; + + for(i = 0; i < count; i++) { + sprintf(tmp, "-Server %d-", i); + + len = strlen(tmp); + for(j = 0; j < SERVER_NAME_LENGTH; j++){ + serverName[j] = tmp[j % len]; + } + /* serverName[j] = 0; not null-terminated */ + + for(j = 0; j < suffix_length; j++){ + char sbuf[SUBSCRIBER_NUMBER_SUFFIX_LENGTH + 1]; + sprintf(sbuf, "%.*d", SUBSCRIBER_NUMBER_SUFFIX_LENGTH, j); + memcpy(suffix, sbuf, SUBSCRIBER_NUMBER_SUFFIX_LENGTH); + userDbInsertServer(uh, i, suffix, serverName); + commitCount ++; + if((commitCount % OP_PER_TRANS) == 0) + userDbCommit(uh); + } + } + if((commitCount % OP_PER_TRANS) != 0) + userDbCommit(uh); +} + +static void populateSubscribers(UserHandle *uh, int count) +{ + SubscriberNumber number; + SubscriberName name; + int i, j, k; + int res; + + SequenceValues values[NO_OF_GROUPS+1]; + RandomSequence seq; + + for(i = 0; i < NO_OF_GROUPS; i++) { + values[i].length = 1; + values[i].value = i; + } + + values[i].length = 0; + values[i].value = 0; + + if( initSequence(&seq, values) != 0 ) { + ndbout_c("could not set the sequence of random groups"); + exit(0); + } + +#define RETRIES 25 + + for(i = 0; i < count; i+= OP_PER_TRANS) { + for(j = 0; j +#include + +#define ERROR(x) {ndbout_c((x));} +#define ERROR1(x,y) {ndbout_c((x), (y));} +#define ERROR2(x,y,z) {ndbout_c((x), (y), (z));} +#define ERROR3(x,y,z,u) {ndbout_c((x), (y), (z), (u));} +#define ERROR4(x,y,z,u,w) {ndbout_c((x), (y), (z), (u), (w));} + +#define INIT_RANDOM(x) srand48((x)) +#define UI_RANDOM(x) ((unsigned int)(lrand48()%(x))) + +#define ASSERT(cond, message) \ + { if(!(cond)) { ERROR(message); exit(-1); }} + +#ifdef DEBUG_ON +#define DEBUG(x) {ndbout_c((x));} +#define DEBUG1(x,y) {ndbout_c((x), (y));} +#define DEBUG2(x,y,z) {ndbout_c((x), (y), (z));} +#define DEBUG3(x,y,z,u) {ndbout_c((x), (y), (z), (u));} +#define DEBUG4(x,y,z,u,w) {ndbout_c((x), (y), (z), (u), (w));} +#define DEBUG5(x,y,z,u,w, v) {ndbout_c((x), (y), (z), (u), (w), (v));} +#else +#define DEBUG(x) +#define DEBUG1(x,y) +#define DEBUG2(x,y,z) +#define DEBUG3(x,y,z,u) +#define DEBUG4(x,y,z,u,w) +#define DEBUG5(x,y,z,u,w, v) +#endif + +#endif diff --git a/ndb/test/ndbapi/bench/mainAsyncGenerator.cpp b/ndb/test/ndbapi/bench/mainAsyncGenerator.cpp new file mode 100644 index 00000000000..828b924582f --- /dev/null +++ b/ndb/test/ndbapi/bench/mainAsyncGenerator.cpp @@ -0,0 +1,503 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "userInterface.h" +#include "dbGenerator.h" + +static int numProcesses; +static int numSeconds; +static int numWarmSeconds; +static int parallellism; +static int millisSendPoll; +static int minEventSendPoll; +static int forceSendPoll; + +static ThreadData *data; +static Ndb_cluster_connection *g_cluster_connection= 0; + + +static void usage(const char *prog) +{ + const char *progname; + + /*--------------------------------------------*/ + /* Get the name of the program (without path) */ + /*--------------------------------------------*/ + progname = strrchr(prog, '/'); + + if (progname == 0) + progname = prog; + else + ++progname; + + ndbout_c( + "Usage: %s [-proc ] [-warm ] [-time ] [ -p ] " + "[-t ] [ -e ] [ -f ] \n" + " -proc Specifies that is the number of\n" + " threads. The default is 1.\n" + " -time Specifies that the test will run for sec.\n" + " The default is 10 sec\n" + " -warm Specifies the warm-up/cooldown period of " + "sec.\n" + " The default is 10 sec\n" + " -p The no of parallell transactions started by " + "one thread\n" + " -e Minimum no of events before wake up in call to " + "sendPoll\n" + " Default is 1\n" + " -f force parameter to sendPoll\n" + " Default is 0\n", + progname); +} + +static +int +parse_args(int argc, const char **argv) +{ + int i; + + numProcesses = 1; + numSeconds = 10; + numWarmSeconds = 10; + parallellism = 1; + millisSendPoll = 10000; + minEventSendPoll = 1; + forceSendPoll = 0; + + + i = 1; + while (i < argc){ + if (strcmp("-proc",argv[i]) == 0) { + if (i + 1 >= argc) { + return 1; + } + if (sscanf(argv[i+1], "%d", &numProcesses) == -1 || + numProcesses <= 0 || numProcesses > 127) { + ndbout_c("-proc flag requires a positive integer argument [1..127]"); + return 1; + } + i += 2; + } else if (strcmp("-p", argv[i]) == 0){ + if(i + 1 >= argc){ + usage(argv[0]); + return 1; + } + if (sscanf(argv[i+1], "%d", ¶llellism) == -1 || + parallellism <= 0){ + ndbout_c("-p flag requires a positive integer argument"); + return 1; + } + i += 2; + } + else if (strcmp("-time",argv[i]) == 0) { + if (i + 1 >= argc) { + return 1; + } + if (sscanf(argv[i+1], "%d", &numSeconds) == -1 || + numSeconds < 0) { + ndbout_c("-time flag requires a positive integer argument"); + return 1; + } + i += 2; + } + else if (strcmp("-warm",argv[i]) == 0) { + if (i + 1 >= argc) { + return 1; + } + if (sscanf(argv[i+1], "%d", &numWarmSeconds) == -1 || + numWarmSeconds < 0) { + ndbout_c("-warm flag requires a positive integer argument"); + return 1; + } + i += 2; + } + else if (strcmp("-e",argv[i]) == 0) { + if (i + 1 >= argc) { + return 1; + } + if (sscanf(argv[i+1], "%d", &minEventSendPoll) == -1 || + minEventSendPoll < 0) { + ndbout_c("-e flag requires a positive integer argument"); + return 1; + } + i += 2; + } + else if (strcmp("-f",argv[i]) == 0) { + if (i + 1 >= argc) { + usage(argv[0]); + return 1; + } + if (sscanf(argv[i+1], "%d", &forceSendPoll) == -1 || + forceSendPoll < 0) { + ndbout_c("-f flag requires a positive integer argument"); + return 1; + } + i += 2; + } + else { + return 1; + } + } + + if(minEventSendPoll > parallellism){ + ndbout_c("minEventSendPoll(%d) > parallellism(%d)", + minEventSendPoll, parallellism); + ndbout_c("not very good..."); + ndbout_c("very bad..."); + ndbout_c("exiting..."); + return 1; + } + return 0; +} + +static +void +print_transaction(const char *header, + unsigned long totalCount, + TransactionDefinition *trans, + unsigned int printBranch, + unsigned int printRollback) +{ + double f; + + ndbout_c(" %s: %d (%.2f%%) " + "Latency(ms) avg: %d min: %d max: %d std: %d n: %d", + header, + trans->count, + (double)trans->count / (double)totalCount * 100.0, + (int)trans->latency.getMean(), + (int)trans->latency.getMin(), + (int)trans->latency.getMax(), + (int)trans->latency.getStddev(), + (int)trans->latency.getCount() + ); + + if( printBranch ){ + if( trans->count == 0 ) + f = 0.0; + else + f = (double)trans->branchExecuted / (double)trans->count * 100.0; + ndbout_c(" Branches Executed: %d (%.2f%%)", trans->branchExecuted, f); + } + + if( printRollback ){ + if( trans->count == 0 ) + f = 0.0; + else + f = (double)trans->rollbackExecuted / (double)trans->count * 100.0; + ndbout_c(" Rollback Executed: %d (%.2f%%)",trans->rollbackExecuted,f); + } +} + +void +print_stats(const char *title, + unsigned int length, + unsigned int transactionFlag, + GeneratorStatistics *gen, + int numProc, int parallellism) +{ + int i; + char buf[10]; + char name[MAXHOSTNAMELEN]; + + name[0] = 0; + NdbHost_GetHostName(name); + + ndbout_c("\n------ %s ------",title); + ndbout_c("Length : %d %s", + length, + transactionFlag ? "Transactions" : "sec"); + ndbout_c("Processor : %s", name); + ndbout_c("Number of Proc: %d",numProc); + ndbout_c("Parallellism : %d", parallellism); + ndbout_c("\n"); + + if( gen->totalTransactions == 0 ) { + ndbout_c(" No Transactions for this test"); + } + else { + for(i = 0; i < 5; i++) { + sprintf(buf, "T%d",i+1); + print_transaction(buf, + gen->totalTransactions, + &gen->transactions[i], + i >= 2, + i >= 3 ); + } + + ndbout_c("\n"); + ndbout_c(" Overall Statistics:"); + ndbout_c(" Transactions: %d", gen->totalTransactions); + ndbout_c(" Outer : %.0f TPS",gen->outerTps); + ndbout_c("\n"); + } +} + +static +void * +threadRoutine(void *arg) +{ + int i; + ThreadData *data = (ThreadData *)arg; + Ndb * pNDB; + + pNDB = asyncDbConnect(parallellism); + /* NdbSleep_MilliSleep(rand() % 10); */ + + for(i = 0; ipThread = pThread; + } else { + perror("Failed to create thread"); + rc = NDBT_FAILED; + } + } + + showTime(); + + /*--------------------------------*/ + /* Wait for all processes to exit */ + /*--------------------------------*/ + for(i = 0; i < numProcesses; i++) { + NdbThread_WaitFor(data[i*parallellism].pThread, &tmp); + NdbThread_Destroy(&data[i*parallellism].pThread); + } + + ndbout_c("All threads have finished"); + + /*-------------------------------------------*/ + /* Clear all structures for total statistics */ + /*-------------------------------------------*/ + stats.totalTransactions = 0; + stats.outerTps = 0.0; + + for(i = 0; i < NUM_TRANSACTION_TYPES; i++ ) { + stats.transactions[i].count = 0; + stats.transactions[i].branchExecuted = 0; + stats.transactions[i].rollbackExecuted = 0; + stats.transactions[i].latency.reset(); + } + + /*--------------------------------*/ + /* Add the values for all Threads */ + /*--------------------------------*/ + for(i = 0; i < numProcesses; i++) { + for(k = 0; ktotalTransactions; + stats.outerTps += p->outerTps; + + for(j = 0; j < NUM_TRANSACTION_TYPES; j++ ) { + stats.transactions[j].count += + p->transactions[j].count; + stats.transactions[j].branchExecuted += + p->transactions[j].branchExecuted; + stats.transactions[j].rollbackExecuted += + p->transactions[j].rollbackExecuted; + stats.transactions[j].latency += + p->transactions[j].latency; + } + } + } + + print_stats("Test Results", + numSeconds, + 0, + &stats, + numProcesses, + parallellism); + + free(data); + + NDBT_ProgramExit(rc); +} +/*************************************************************** +* I N C L U D E D F I L E S * +***************************************************************/ + +#include +#include +#include +#include + +#include "ndb_schema.hpp" +#include "ndb_error.hpp" +#include "userInterface.h" +#include +#include +#include +#include +#include + +/*************************************************************** +* L O C A L C O N S T A N T S * +***************************************************************/ + +/*************************************************************** +* L O C A L D A T A S T R U C T U R E S * +***************************************************************/ + +/*************************************************************** +* L O C A L F U N C T I O N S * +***************************************************************/ + +#ifndef NDB_WIN32 +#include +#endif + +Ndb* +asyncDbConnect(int parallellism){ + Ndb * pNDB = new Ndb(g_cluster_connection, "TEST_DB"); + + pNDB->init(parallellism + 1); + + while(pNDB->waitUntilReady() != 0){ + } + + return pNDB; +} + +void +asyncDbDisconnect(Ndb* pNDB) +{ + delete pNDB; +} + +double +userGetTime(void) +{ + static bool initialized = false; + static NDB_TICKS initSecs = 0; + static Uint32 initMicros = 0; + double timeValue = 0; + + if ( !initialized ) { + initialized = true; + NdbTick_CurrentMicrosecond(&initSecs, &initMicros); + timeValue = 0.0; + } else { + NDB_TICKS secs = 0; + Uint32 micros = 0; + + NdbTick_CurrentMicrosecond(&secs, µs); + double s = (double)secs - (double)initSecs; + double us = (double)micros - (double)initMicros; + + timeValue = s + (us / 1000000.0); + } + return timeValue; +} + +void showTime() +{ + char buf[128]; + struct tm* tm_now; + time_t now; + now = ::time((time_t*)NULL); + tm_now = ::gmtime(&now); + + ::snprintf(buf, 128, + "%d-%.2d-%.2d %.2d:%.2d:%.2d", + tm_now->tm_year + 1900, + tm_now->tm_mon, + tm_now->tm_mday, + tm_now->tm_hour, + tm_now->tm_min, + tm_now->tm_sec); + + ndbout_c("Time: %s", buf); +} + diff --git a/ndb/test/ndbapi/bench/mainPopulate.cpp b/ndb/test/ndbapi/bench/mainPopulate.cpp new file mode 100644 index 00000000000..5f4b73a3eff --- /dev/null +++ b/ndb/test/ndbapi/bench/mainPopulate.cpp @@ -0,0 +1,84 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include +#include + +#include "userInterface.h" +#include "dbPopulate.h" +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif +int useTableLogging; +int useIndexTables; +#ifdef __cplusplus +} +#endif + + +static void usage() +{ +} + +static +void usage(const char *prog) +{ + + ndbout_c( + "Usage: %s [-l]\n" + " -l Use logging and checkpointing on tables\n", + " -i Use index tables\n", + prog); + + exit(1); +} + +NDB_STD_OPTS_VARS; + +NDB_COMMAND(DbCreate, "DbCreate", "DbCreate", "DbCreate", 16384) +{ + int i; + UserHandle *uh; + + useTableLogging = useIndexTables = 0; + NDB_INIT(argv[0]); + + for(i = 1; i + +inline +NdbConnection * +startTransaction(Ndb * pNDB, + ServerId inServerId, + const SubscriberNumber inNumber){ + + const int keyDataLenBytes = sizeof(ServerId)+SUBSCRIBER_NUMBER_LENGTH; + const int keyDataLen_64Words = keyDataLenBytes >> 3; + + Uint64 keyDataBuf[keyDataLen_64Words+1]; // The "+1" is for rounding... + + char * keyDataBuf_charP = (char *)&keyDataBuf[0]; + Uint32 * keyDataBuf_wo32P = (Uint32 *)&keyDataBuf[0]; + + // Server Id comes first + keyDataBuf_wo32P[0] = inServerId; + // Then subscriber number + memcpy(&keyDataBuf_charP[sizeof(ServerId)], inNumber, + SUBSCRIBER_NUMBER_LENGTH); + + return pNDB->startTransaction(0, keyDataBuf_charP, keyDataLenBytes); +} + +void T1_Callback(int result, NdbConnection * pCon, void * threadData); +void T2_Callback(int result, NdbConnection * pCon, void * threadData); +void T3_Callback_1(int result, NdbConnection * pCon, void * threadData); +void T3_Callback_2(int result, NdbConnection * pCon, void * threadData); +void T3_Callback_3(int result, NdbConnection * pCon, void * threadData); +void T4_Callback_1(int result, NdbConnection * pCon, void * threadData); +void T4_Callback_2(int result, NdbConnection * pCon, void * threadData); +void T4_Callback_3(int result, NdbConnection * pCon, void * threadData); +void T5_Callback_1(int result, NdbConnection * pCon, void * threadData); +void T5_Callback_2(int result, NdbConnection * pCon, void * threadData); +void T5_Callback_3(int result, NdbConnection * pCon, void * threadData); + +/** + * Transaction 1 - T1 + * + * Update location and changed by/time on a subscriber + * + * Input: + * SubscriberNumber, + * Location, + * ChangedBy, + * ChangedTime + * + * Output: + */ +void +start_T1(Ndb * pNDB, ThreadData * td){ + + DEBUG2("T1(%.*s): - Starting\n", SUBSCRIBER_NUMBER_LENGTH, + td->transactionData.number); + + int check; + NdbConnection * pCON = pNDB->startTransaction(); + if (pCON != NULL) { + NdbOperation *MyOp = pCON->getNdbOperation(SUBSCRIBER_TABLE); + if (MyOp != NULL) { + MyOp->updateTuple(); + MyOp->equal(IND_SUBSCRIBER_NUMBER, + td->transactionData.number); + MyOp->setValue(IND_SUBSCRIBER_LOCATION, + (char *)&td->transactionData.location); + MyOp->setValue(IND_SUBSCRIBER_CHANGED_BY, + td->transactionData.changed_by); + MyOp->setValue(IND_SUBSCRIBER_CHANGED_TIME, + td->transactionData.changed_time); + pCON->executeAsynchPrepare( Commit , T1_Callback, td); + } else { + CHECK_NULL(MyOp, "T1: getNdbOperation", pCON); + }//if + } else { + error_handler("T1-1: startTranscation", + pNDB->getNdbErrorString(), + pNDB->getNdbError()); + }//if +} + +void +T1_Callback(int result, NdbConnection * pCON, void * threadData){ + ThreadData * td = (ThreadData *)threadData; + + DEBUG2("T1(%.*s): - Completing\n", SUBSCRIBER_NUMBER_LENGTH, + td->transactionData.number); + + CHECK_MINUS_ONE(result, "T1: Commit", + pCON); + td->pNDB->closeTransaction(pCON); + complete_T1(td); +} + +/** + * Transaction 2 - T2 + * + * Read from Subscriber: + * + * Input: + * SubscriberNumber + * + * Output: + * Location + * Changed by + * Changed Timestamp + * Name + */ +void +start_T2(Ndb * pNDB, ThreadData * td){ + + DEBUG3("T2(%.*s, %p): - Starting\n", SUBSCRIBER_NUMBER_LENGTH, + td->transactionData.number, + td->transactionData.location); + + int check; + NdbRecAttr * check2; + + NdbConnection * pCON = pNDB->startTransaction(); + if (pCON == NULL) + error_handler("T2-1: startTransaction", + pNDB->getNdbErrorString(), + pNDB->getNdbError()); + + NdbOperation *MyOp= pCON->getNdbOperation(SUBSCRIBER_TABLE); + CHECK_NULL(MyOp, "T2: getNdbOperation", + pCON); + + MyOp->readTuple(); + MyOp->equal(IND_SUBSCRIBER_NUMBER, + td->transactionData.number); + MyOp->getValue(IND_SUBSCRIBER_LOCATION, + (char *)&td->transactionData.location); + MyOp->getValue(IND_SUBSCRIBER_CHANGED_BY, + td->transactionData.changed_by); + MyOp->getValue(IND_SUBSCRIBER_CHANGED_TIME, + td->transactionData.changed_time); + MyOp->getValue(IND_SUBSCRIBER_NAME, + td->transactionData.name); + pCON->executeAsynchPrepare( Commit, T2_Callback, td ); +} + +void +T2_Callback(int result, NdbConnection * pCON, void * threadData){ + ThreadData * td = (ThreadData *)threadData; + DEBUG3("T2(%.*s, %p): - Completing\n", SUBSCRIBER_NUMBER_LENGTH, + td->transactionData.number, + td->transactionData.location); + + CHECK_MINUS_ONE(result, "T2: Commit", pCON); + td->pNDB->closeTransaction(pCON); + complete_T2(td); +} + +/** + * Transaction 3 - T3 + * + * Read session details + * + * Input: + * SubscriberNumber + * ServerId + * ServerBit + * + * Output: + * BranchExecuted + * SessionDetails + * ChangedBy + * ChangedTime + * Location + */ +void +start_T3(Ndb * pNDB, ThreadData * td){ + + DEBUG3("T3(%.*s, %.2d): - Starting\n", SUBSCRIBER_NUMBER_LENGTH, + td->transactionData.number, + td->transactionData.server_id); + + int check; + NdbRecAttr * check2; + + NdbConnection * pCON = startTransaction(pNDB, + td->transactionData.server_id, + td->transactionData.number); + if (pCON == NULL) + error_handler("T3-1: startTranscation", + pNDB->getNdbErrorString(), + pNDB->getNdbError()); + + NdbOperation *MyOp= pCON->getNdbOperation(SUBSCRIBER_TABLE); + CHECK_NULL(MyOp, "T3-1: getNdbOperation", + pCON); + + MyOp->readTuple(); + MyOp->equal(IND_SUBSCRIBER_NUMBER, + td->transactionData.number); + MyOp->getValue(IND_SUBSCRIBER_LOCATION, + (char *)&td->transactionData.location); + MyOp->getValue(IND_SUBSCRIBER_CHANGED_BY, + td->transactionData.changed_by); + MyOp->getValue(IND_SUBSCRIBER_CHANGED_TIME, + td->transactionData.changed_time); + MyOp->getValue(IND_SUBSCRIBER_GROUP, + (char *)&td->transactionData.group_id); + MyOp->getValue(IND_SUBSCRIBER_SESSIONS, + (char *)&td->transactionData.sessions); + pCON->executeAsynchPrepare( NoCommit , T3_Callback_1, td); +} + +void +T3_Callback_1(int result, NdbConnection * pCON, void * threadData){ + ThreadData * td = (ThreadData *)threadData; + DEBUG3("T3(%.*s, %.2d): - Callback 1\n", SUBSCRIBER_NUMBER_LENGTH, + td->transactionData.number, + td->transactionData.server_id); + + CHECK_MINUS_ONE(result, "T3-1: NoCommit", pCON); + + NdbOperation * MyOp = pCON->getNdbOperation(GROUP_TABLE); + CHECK_NULL(MyOp, "T3-2: getNdbOperation", + pCON); + + MyOp->readTuple(); + MyOp->equal(IND_GROUP_ID, + (char*)&td->transactionData.group_id); + MyOp->getValue(IND_GROUP_ALLOW_READ, + (char *)&td->transactionData.permission); + pCON->executeAsynchPrepare( NoCommit, T3_Callback_2, td ); +} + +void +T3_Callback_2(int result, NdbConnection * pCON, void * threadData){ + ThreadData * td = (ThreadData *)threadData; + + CHECK_MINUS_ONE(result, "T3-2: NoCommit", pCON); + + Uint32 permission = td->transactionData.permission; + Uint32 sessions = td->transactionData.sessions; + Uint32 server_bit = td->transactionData.server_bit; + + if(((permission & server_bit) == server_bit) && + ((sessions & server_bit) == server_bit)){ + + memcpy(td->transactionData.suffix, + &td->transactionData.number + [SUBSCRIBER_NUMBER_LENGTH-SUBSCRIBER_NUMBER_SUFFIX_LENGTH], + SUBSCRIBER_NUMBER_SUFFIX_LENGTH); + DEBUG5("T3(%.*s, %.2d): - Callback 2 - reading(%.*s)\n", + SUBSCRIBER_NUMBER_LENGTH, + td->transactionData.number, + td->transactionData.server_id, + SUBSCRIBER_NUMBER_SUFFIX_LENGTH, + td->transactionData.suffix); + + /* Operation 3 */ + NdbOperation * MyOp = pCON->getNdbOperation(SESSION_TABLE); + CHECK_NULL(MyOp, "T3-3: getNdbOperation", + pCON); + + MyOp->simpleRead(); + MyOp->equal(IND_SESSION_SUBSCRIBER, + (char*)td->transactionData.number); + MyOp->equal(IND_SESSION_SERVER, + (char*)&td->transactionData.server_id); + MyOp->getValue(IND_SESSION_DATA, + (char *)td->transactionData.session_details); + + /* Operation 4 */ + MyOp = pCON->getNdbOperation(SERVER_TABLE); + CHECK_NULL(MyOp, "T3-4: getNdbOperation", + pCON); + + MyOp->interpretedUpdateTuple(); + MyOp->equal(IND_SERVER_ID, + (char*)&td->transactionData.server_id); + MyOp->equal(IND_SERVER_SUBSCRIBER_SUFFIX, + (char*)td->transactionData.suffix); + MyOp->incValue(IND_SERVER_READS, (uint32)1); + td->transactionData.branchExecuted = 1; + } else { + DEBUG3("T3(%.*s, %.2d): - Callback 2 - no read\n", + SUBSCRIBER_NUMBER_LENGTH, + td->transactionData.number, + td->transactionData.server_id); + td->transactionData.branchExecuted = 0; + } + pCON->executeAsynchPrepare( Commit, T3_Callback_3, td ); +} + +void +T3_Callback_3(int result, NdbConnection * pCON, void * threadData){ + ThreadData * td = (ThreadData *)threadData; + DEBUG3("T3(%.*s, %.2d): - Completing\n", SUBSCRIBER_NUMBER_LENGTH, + td->transactionData.number, + td->transactionData.server_id); + + CHECK_MINUS_ONE(result, "T3-3: Commit", pCON); + + td->pNDB->closeTransaction(pCON); + complete_T3(td); +} + +/** + * Transaction 4 - T4 + * + * Create session + * + * Input: + * SubscriberNumber + * ServerId + * ServerBit + * SessionDetails, + * DoRollback + * Output: + * ChangedBy + * ChangedTime + * Location + * BranchExecuted + */ +void +start_T4(Ndb * pNDB, ThreadData * td){ + + DEBUG3("T4(%.*s, %.2d): - Starting\n", SUBSCRIBER_NUMBER_LENGTH, + td->transactionData.number, + td->transactionData.server_id); + + int check; + NdbRecAttr * check2; + + NdbConnection * pCON = startTransaction(pNDB, + td->transactionData.server_id, + td->transactionData.number); + if (pCON == NULL) + error_handler("T4-1: startTranscation", + pNDB->getNdbErrorString(), + pNDB->getNdbError()); + + NdbOperation *MyOp= pCON->getNdbOperation(SUBSCRIBER_TABLE); + CHECK_NULL(MyOp, "T4-1: getNdbOperation", + pCON); + + MyOp->interpretedUpdateTuple(); + MyOp->equal(IND_SUBSCRIBER_NUMBER, + td->transactionData.number); + MyOp->getValue(IND_SUBSCRIBER_LOCATION, + (char *)&td->transactionData.location); + MyOp->getValue(IND_SUBSCRIBER_CHANGED_BY, + td->transactionData.changed_by); + MyOp->getValue(IND_SUBSCRIBER_CHANGED_TIME, + td->transactionData.changed_time); + MyOp->getValue(IND_SUBSCRIBER_GROUP, + (char *)&td->transactionData.group_id); + MyOp->getValue(IND_SUBSCRIBER_SESSIONS, + (char *)&td->transactionData.sessions); + MyOp->incValue(IND_SUBSCRIBER_SESSIONS, + (uint32)td->transactionData.server_bit); + pCON->executeAsynchPrepare( NoCommit , T4_Callback_1, td); +} + +void +T4_Callback_1(int result, NdbConnection * pCON, void * threadData){ + CHECK_MINUS_ONE(result, "T4-1: NoCommit", pCON); + ThreadData * td = (ThreadData *)threadData; + + DEBUG3("T4(%.*s, %.2d): - Callback 1\n", + SUBSCRIBER_NUMBER_LENGTH, + td->transactionData.number, + td->transactionData.server_id); + + + NdbOperation * MyOp = pCON->getNdbOperation(GROUP_TABLE); + CHECK_NULL(MyOp, "T4-2: getNdbOperation", + pCON); + + MyOp->readTuple(); + MyOp->equal(IND_GROUP_ID, + (char*)&td->transactionData.group_id); + MyOp->getValue(IND_GROUP_ALLOW_INSERT, + (char *)&td->transactionData.permission); + pCON->executeAsynchPrepare( NoCommit , T4_Callback_2, td); +} + +void +T4_Callback_2(int result, NdbConnection * pCON, void * threadData){ + CHECK_MINUS_ONE(result, "T4-2: NoCommit", pCON); + ThreadData * td = (ThreadData *)threadData; + + Uint32 permission = td->transactionData.permission; + Uint32 sessions = td->transactionData.sessions; + Uint32 server_bit = td->transactionData.server_bit; + + if(((permission & server_bit) == server_bit) && + ((sessions & server_bit) == 0)){ + + memcpy(td->transactionData.suffix, + &td->transactionData.number + [SUBSCRIBER_NUMBER_LENGTH-SUBSCRIBER_NUMBER_SUFFIX_LENGTH], + SUBSCRIBER_NUMBER_SUFFIX_LENGTH); + + DEBUG5("T4(%.*s, %.2d): - Callback 2 - inserting(%.*s)\n", + SUBSCRIBER_NUMBER_LENGTH, + td->transactionData.number, + td->transactionData.server_id, + SUBSCRIBER_NUMBER_SUFFIX_LENGTH, + td->transactionData.suffix); + + /* Operation 3 */ + + NdbOperation * MyOp = pCON->getNdbOperation(SESSION_TABLE); + CHECK_NULL(MyOp, "T4-3: getNdbOperation", + pCON); + + MyOp->insertTuple(); + MyOp->equal(IND_SESSION_SUBSCRIBER, + (char*)td->transactionData.number); + MyOp->equal(IND_SESSION_SERVER, + (char*)&td->transactionData.server_id); + MyOp->setValue(SESSION_DATA, + (char *)td->transactionData.session_details); + /* Operation 4 */ + + /* Operation 5 */ + MyOp = pCON->getNdbOperation(SERVER_TABLE); + CHECK_NULL(MyOp, "T4-5: getNdbOperation", + pCON); + + MyOp->interpretedUpdateTuple(); + MyOp->equal(IND_SERVER_ID, + (char*)&td->transactionData.server_id); + MyOp->equal(IND_SERVER_SUBSCRIBER_SUFFIX, + (char*)td->transactionData.suffix); + MyOp->incValue(IND_SERVER_INSERTS, (uint32)1); + td->transactionData.branchExecuted = 1; + } else { + td->transactionData.branchExecuted = 0; + DEBUG5("T4(%.*s, %.2d): - Callback 2 - %s %s\n", + SUBSCRIBER_NUMBER_LENGTH, + td->transactionData.number, + td->transactionData.server_id, + ((permission & server_bit) ? + "permission - " : "no permission - "), + ((sessions & server_bit) ? + "in session - " : "no in session - ")); + } + + if(!td->transactionData.do_rollback && td->transactionData.branchExecuted){ + pCON->executeAsynchPrepare(Commit, T4_Callback_3, td); + } else { + pCON->executeAsynchPrepare(Rollback, T4_Callback_3, td); + } +} + +void +T4_Callback_3(int result, NdbConnection * pCON, void * threadData){ + CHECK_MINUS_ONE(result, "T4-3: Commit", pCON); + ThreadData * td = (ThreadData *)threadData; + + DEBUG3("T4(%.*s, %.2d): - Completing\n", + SUBSCRIBER_NUMBER_LENGTH, + td->transactionData.number, + td->transactionData.server_id); + + td->pNDB->closeTransaction(pCON); + complete_T4(td); +} + +/** + * Transaction 5 - T5 + * + * Delete session + * + * Input: + * SubscriberNumber + * ServerId + * ServerBit + * DoRollback + * Output: + * ChangedBy + * ChangedTime + * Location + * BranchExecuted + */ +void +start_T5(Ndb * pNDB, ThreadData * td){ + + DEBUG3("T5(%.*s, %.2d): - Starting\n", SUBSCRIBER_NUMBER_LENGTH, + td->transactionData.number, + td->transactionData.server_id); + + int check; + NdbRecAttr * check2; + + NdbConnection * pCON = pNDB->startTransaction(); + if (pCON == NULL) + error_handler("T5-1: startTranscation", + pNDB->getNdbErrorString(), + pNDB->getNdbError()); + + NdbOperation * MyOp= pCON->getNdbOperation(SUBSCRIBER_TABLE); + CHECK_NULL(MyOp, "T5-1: getNdbOperation", + pCON); + + MyOp->interpretedUpdateTuple(); + MyOp->equal(IND_SUBSCRIBER_NUMBER, + td->transactionData.number); + MyOp->getValue(IND_SUBSCRIBER_LOCATION, + (char *)&td->transactionData.location); + MyOp->getValue(IND_SUBSCRIBER_CHANGED_BY, + td->transactionData.changed_by); + MyOp->getValue(IND_SUBSCRIBER_CHANGED_TIME, + td->transactionData.changed_time); + MyOp->getValue(IND_SUBSCRIBER_GROUP, + (char *)&td->transactionData.group_id); + MyOp->getValue(IND_SUBSCRIBER_SESSIONS, + (char *)&td->transactionData.sessions); + MyOp->subValue(IND_SUBSCRIBER_SESSIONS, + (uint32)td->transactionData.server_bit); + pCON->executeAsynchPrepare( NoCommit, T5_Callback_1, td ); +} + +void +T5_Callback_1(int result, NdbConnection * pCON, void * threadData){ + CHECK_MINUS_ONE(result, "T5-1: NoCommit", pCON); + ThreadData * td = (ThreadData *)threadData; + + DEBUG3("T5(%.*s, %.2d): - Callback 1\n", + SUBSCRIBER_NUMBER_LENGTH, + td->transactionData.number, + td->transactionData.server_id); + + NdbOperation * MyOp = pCON->getNdbOperation(GROUP_TABLE); + CHECK_NULL(MyOp, "T5-2: getNdbOperation", + pCON); + + MyOp->readTuple(); + MyOp->equal(IND_GROUP_ID, + (char*)&td->transactionData.group_id); + MyOp->getValue(IND_GROUP_ALLOW_DELETE, + (char *)&td->transactionData.permission); + pCON->executeAsynchPrepare( NoCommit, T5_Callback_2, td ); +} + +void +T5_Callback_2(int result, NdbConnection * pCON, void * threadData){ + CHECK_MINUS_ONE(result, "T5-2: NoCommit", pCON); + ThreadData * td = (ThreadData *)threadData; + + Uint32 permission = td->transactionData.permission; + Uint32 sessions = td->transactionData.sessions; + Uint32 server_bit = td->transactionData.server_bit; + + if(((permission & server_bit) == server_bit) && + ((sessions & server_bit) == server_bit)){ + + memcpy(td->transactionData.suffix, + &td->transactionData.number + [SUBSCRIBER_NUMBER_LENGTH-SUBSCRIBER_NUMBER_SUFFIX_LENGTH], + SUBSCRIBER_NUMBER_SUFFIX_LENGTH); + + DEBUG5("T5(%.*s, %.2d): - Callback 2 - deleting(%.*s)\n", + SUBSCRIBER_NUMBER_LENGTH, + td->transactionData.number, + td->transactionData.server_id, + SUBSCRIBER_NUMBER_SUFFIX_LENGTH, + td->transactionData.suffix); + + /* Operation 3 */ + NdbOperation * MyOp = pCON->getNdbOperation(SESSION_TABLE); + CHECK_NULL(MyOp, "T5-3: getNdbOperation", + pCON); + + MyOp->deleteTuple(); + MyOp->equal(IND_SESSION_SUBSCRIBER, + (char*)td->transactionData.number); + MyOp->equal(IND_SESSION_SERVER, + (char*)&td->transactionData.server_id); + /* Operation 4 */ + + /* Operation 5 */ + MyOp = pCON->getNdbOperation(SERVER_TABLE); + CHECK_NULL(MyOp, "T5-5: getNdbOperation", + pCON); + + MyOp->interpretedUpdateTuple(); + MyOp->equal(IND_SERVER_ID, + (char*)&td->transactionData.server_id); + MyOp->equal(IND_SERVER_SUBSCRIBER_SUFFIX, + (char*)td->transactionData.suffix); + MyOp->incValue(IND_SERVER_DELETES, (uint32)1); + td->transactionData.branchExecuted = 1; + } else { + td->transactionData.branchExecuted = 0; + + DEBUG5("T5(%.*s, %.2d): - Callback 2 - no delete - %s %s\n", + SUBSCRIBER_NUMBER_LENGTH, + td->transactionData.number, + td->transactionData.server_id, + ((permission & server_bit) ? + "permission - " : "no permission - "), + ((sessions & server_bit) ? + "in session - " : "no in session - ")); + } + + if(!td->transactionData.do_rollback && td->transactionData.branchExecuted){ + pCON->executeAsynchPrepare(Commit, T5_Callback_3, td); + } else { + pCON->executeAsynchPrepare(Rollback, T5_Callback_3, td); + } +} + +void +T5_Callback_3(int result, NdbConnection * pCON, void * threadData){ + CHECK_MINUS_ONE(result, "T5-3: Commit", pCON); + ThreadData * td = (ThreadData *)threadData; + + DEBUG3("T5(%.*s, %.2d): - Completing\n", + SUBSCRIBER_NUMBER_LENGTH, + td->transactionData.number, + td->transactionData.server_id); + + td->pNDB->closeTransaction(pCON); + complete_T5(td); +} diff --git a/ndb/test/ndbapi/bench/ndb_async2.cpp b/ndb/test/ndbapi/bench/ndb_async2.cpp new file mode 100644 index 00000000000..31cf1d8310a --- /dev/null +++ b/ndb/test/ndbapi/bench/ndb_async2.cpp @@ -0,0 +1,757 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +//#define DEBUG_ON + +#include +#include "userInterface.h" + +#include "macros.h" +#include "ndb_schema.hpp" +#include "ndb_error.hpp" +#include + +#include + +void T1_Callback(int result, NdbConnection * pCon, void * threadData); +void T2_Callback(int result, NdbConnection * pCon, void * threadData); +void T3_Callback_1(int result, NdbConnection * pCon, void * threadData); +void T3_Callback_2(int result, NdbConnection * pCon, void * threadData); +void T3_Callback_3(int result, NdbConnection * pCon, void * threadData); +void T4_Callback_1(int result, NdbConnection * pCon, void * threadData); +void T4_Callback_2(int result, NdbConnection * pCon, void * threadData); +void T4_Callback_3(int result, NdbConnection * pCon, void * threadData); +void T5_Callback_1(int result, NdbConnection * pCon, void * threadData); +void T5_Callback_2(int result, NdbConnection * pCon, void * threadData); +void T5_Callback_3(int result, NdbConnection * pCon, void * threadData); + +static int stat_async = 0; + +/** + * Transaction 1 - T1 + * + * Update location and changed by/time on a subscriber + * + * Input: + * SubscriberNumber, + * Location, + * ChangedBy, + * ChangedTime + * + * Output: + */ + +#define SFX_START (SUBSCRIBER_NUMBER_LENGTH - SUBSCRIBER_NUMBER_SUFFIX_LENGTH) + +inline +NdbConnection * +startTransaction(Ndb * pNDB, ThreadData * td){ + return pNDB->startTransaction(); +#ifdef OLD_CODE + return pNDB->startTransactionDGroup (0, + &td->transactionData.number[SFX_START], + 1); +#endif +} + +void +start_T1(Ndb * pNDB, ThreadData * td, int async){ + + DEBUG2("T1(%.*s): - Starting", SUBSCRIBER_NUMBER_LENGTH, + td->transactionData.number); + + NdbConnection * pCON = 0; + while((pCON = startTransaction(pNDB, td)) == 0){ + CHECK_ALLOWED_ERROR("T1: startTransaction", td, pNDB->getNdbError()); + NdbSleep_MilliSleep(10); + } + + NdbOperation *MyOp = pCON->getNdbOperation(SUBSCRIBER_TABLE); + if (MyOp != NULL) { + MyOp->updateTuple(); + MyOp->equal(IND_SUBSCRIBER_NUMBER, + td->transactionData.number); + MyOp->setValue(IND_SUBSCRIBER_LOCATION, + (char *)&td->transactionData.location); + MyOp->setValue(IND_SUBSCRIBER_CHANGED_BY, + td->transactionData.changed_by); + MyOp->setValue(IND_SUBSCRIBER_CHANGED_TIME, + td->transactionData.changed_time); + if (async == 1) { + pCON->executeAsynchPrepare( Commit , T1_Callback, td); + } else { + int result = pCON->execute(Commit); + T1_Callback(result, pCON, (void*)td); + return; + }//if + } else { + CHECK_NULL(MyOp, "T1: getNdbOperation", td, pCON->getNdbError()); + }//if +} + +void +T1_Callback(int result, NdbConnection * pCON, void * threadData) { + ThreadData * td = (ThreadData *)threadData; + + DEBUG2("T1(%.*s): - Completing", SUBSCRIBER_NUMBER_LENGTH, + td->transactionData.number); + + if (result == -1) { + CHECK_ALLOWED_ERROR("T1: Commit", td, pCON->getNdbError()); + td->pNDB->closeTransaction(pCON); + start_T1(td->pNDB, td, stat_async); + return; + }//if + td->pNDB->closeTransaction(pCON); + complete_T1(td); +} + +/** + * Transaction 2 - T2 + * + * Read from Subscriber: + * + * Input: + * SubscriberNumber + * + * Output: + * Location + * Changed by + * Changed Timestamp + * Name + */ +void +start_T2(Ndb * pNDB, ThreadData * td, int async){ + + DEBUG3("T2(%.*s, %d): - Starting", SUBSCRIBER_NUMBER_LENGTH, + td->transactionData.number, + td->transactionData.location); + + NdbConnection * pCON = 0; + + while((pCON = startTransaction(pNDB, td)) == 0){ + CHECK_ALLOWED_ERROR("T2-1: startTransaction", td, pNDB->getNdbError()); + NdbSleep_MilliSleep(10); + } + + NdbOperation *MyOp= pCON->getNdbOperation(SUBSCRIBER_TABLE); + CHECK_NULL(MyOp, "T2: getNdbOperation", td, + pCON->getNdbError()); + + MyOp->readTuple(); + MyOp->equal(IND_SUBSCRIBER_NUMBER, + td->transactionData.number); + MyOp->getValue(IND_SUBSCRIBER_LOCATION, + (char *)&td->transactionData.location); + MyOp->getValue(IND_SUBSCRIBER_CHANGED_BY, + td->transactionData.changed_by); + MyOp->getValue(IND_SUBSCRIBER_CHANGED_TIME, + td->transactionData.changed_time); + MyOp->getValue(IND_SUBSCRIBER_NAME, + td->transactionData.name); + if (async == 1) { + pCON->executeAsynchPrepare( Commit , T2_Callback, td); + } else { + int result = pCON->execute(Commit); + T2_Callback(result, pCON, (void*)td); + return; + }//if +} + +void +T2_Callback(int result, NdbConnection * pCON, void * threadData){ + ThreadData * td = (ThreadData *)threadData; + DEBUG3("T2(%.*s, %d): - Completing", SUBSCRIBER_NUMBER_LENGTH, + td->transactionData.number, + td->transactionData.location); + + if (result == -1) { + CHECK_ALLOWED_ERROR("T2: Commit", td, pCON->getNdbError()); + td->pNDB->closeTransaction(pCON); + start_T2(td->pNDB, td, stat_async); + return; + }//if + td->pNDB->closeTransaction(pCON); + complete_T2(td); +} + +/** + * Transaction 3 - T3 + * + * Read session details + * + * Input: + * SubscriberNumber + * ServerId + * ServerBit + * + * Output: + * BranchExecuted + * SessionDetails + * ChangedBy + * ChangedTime + * Location + */ +void +start_T3(Ndb * pNDB, ThreadData * td, int async){ + + DEBUG3("T3(%.*s, %.2d): - Starting", SUBSCRIBER_NUMBER_LENGTH, + td->transactionData.number, + td->transactionData.server_id); + + NdbConnection * pCON = 0; + + while((pCON = startTransaction(pNDB, td)) == 0){ + CHECK_ALLOWED_ERROR("T3-1: startTransaction", td, pNDB->getNdbError()); + NdbSleep_MilliSleep(10); + } + + NdbOperation *MyOp= pCON->getNdbOperation(SUBSCRIBER_TABLE); + CHECK_NULL(MyOp, "T3-1: getNdbOperation", td, + pCON->getNdbError()); + + MyOp->readTuple(); + MyOp->equal(IND_SUBSCRIBER_NUMBER, + td->transactionData.number); + MyOp->getValue(IND_SUBSCRIBER_LOCATION, + (char *)&td->transactionData.location); + MyOp->getValue(IND_SUBSCRIBER_CHANGED_BY, + td->transactionData.changed_by); + MyOp->getValue(IND_SUBSCRIBER_CHANGED_TIME, + td->transactionData.changed_time); + MyOp->getValue(IND_SUBSCRIBER_GROUP, + (char *)&td->transactionData.group_id); + MyOp->getValue(IND_SUBSCRIBER_SESSIONS, + (char *)&td->transactionData.sessions); + stat_async = async; + if (async == 1) { + pCON->executeAsynchPrepare( NoCommit , T3_Callback_1, td); + } else { + int result = pCON->execute( NoCommit ); + T3_Callback_1(result, pCON, (void*)td); + return; + }//if +} + +void +T3_Callback_1(int result, NdbConnection * pCON, void * threadData){ + ThreadData * td = (ThreadData *)threadData; + DEBUG3("T3(%.*s, %.2d): - Callback 1", SUBSCRIBER_NUMBER_LENGTH, + td->transactionData.number, + td->transactionData.server_id); + + if (result == -1) { + CHECK_ALLOWED_ERROR("T3-1: execute", td, pCON->getNdbError()); + td->pNDB->closeTransaction(pCON); + start_T3(td->pNDB, td, stat_async); + return; + }//if + + NdbOperation * MyOp = pCON->getNdbOperation(GROUP_TABLE); + CHECK_NULL(MyOp, "T3-2: getNdbOperation", td, + pCON->getNdbError()); + + MyOp->readTuple(); + MyOp->equal(IND_GROUP_ID, + (char*)&td->transactionData.group_id); + MyOp->getValue(IND_GROUP_ALLOW_READ, + (char *)&td->transactionData.permission); + if (stat_async == 1) { + pCON->executeAsynchPrepare( NoCommit , T3_Callback_2, td); + } else { + int result = pCON->execute( NoCommit ); + T3_Callback_2(result, pCON, (void*)td); + return; + }//if +} + +void +T3_Callback_2(int result, NdbConnection * pCON, void * threadData){ + ThreadData * td = (ThreadData *)threadData; + + if (result == -1) { + CHECK_ALLOWED_ERROR("T3-2: execute", td, pCON->getNdbError()); + td->pNDB->closeTransaction(pCON); + start_T3(td->pNDB, td, stat_async); + return; + }//if + + Uint32 permission = td->transactionData.permission; + Uint32 sessions = td->transactionData.sessions; + Uint32 server_bit = td->transactionData.server_bit; + + if(((permission & server_bit) == server_bit) && + ((sessions & server_bit) == server_bit)){ + + memcpy(td->transactionData.suffix, + &td->transactionData.number[SFX_START], + SUBSCRIBER_NUMBER_SUFFIX_LENGTH); + DEBUG5("T3(%.*s, %.2d): - Callback 2 - reading(%.*s)", + SUBSCRIBER_NUMBER_LENGTH, + td->transactionData.number, + td->transactionData.server_id, + SUBSCRIBER_NUMBER_SUFFIX_LENGTH, + td->transactionData.suffix); + + /* Operation 3 */ + NdbOperation * MyOp = pCON->getNdbOperation(SESSION_TABLE); + CHECK_NULL(MyOp, "T3-3: getNdbOperation", td, + pCON->getNdbError()); + + MyOp->simpleRead(); + MyOp->equal(IND_SESSION_SUBSCRIBER, + (char*)td->transactionData.number); + MyOp->equal(IND_SESSION_SERVER, + (char*)&td->transactionData.server_id); + MyOp->getValue(IND_SESSION_DATA, + (char *)td->transactionData.session_details); + + /* Operation 4 */ + MyOp = pCON->getNdbOperation(SERVER_TABLE); + CHECK_NULL(MyOp, "T3-4: getNdbOperation", td, + pCON->getNdbError()); + + MyOp->interpretedUpdateTuple(); + MyOp->equal(IND_SERVER_ID, + (char*)&td->transactionData.server_id); + MyOp->equal(IND_SERVER_SUBSCRIBER_SUFFIX, + (char*)td->transactionData.suffix); + MyOp->incValue(IND_SERVER_READS, (uint32)1); + td->transactionData.branchExecuted = 1; + } else { + DEBUG3("T3(%.*s, %.2d): - Callback 2 - no read", + SUBSCRIBER_NUMBER_LENGTH, + td->transactionData.number, + td->transactionData.server_id); + td->transactionData.branchExecuted = 0; + } + if (stat_async == 1) { + pCON->executeAsynchPrepare( Commit , T3_Callback_3, td); + } else { + int result = pCON->execute( Commit ); + T3_Callback_3(result, pCON, (void*)td); + return; + }//if +} + +void +T3_Callback_3(int result, NdbConnection * pCON, void * threadData){ + ThreadData * td = (ThreadData *)threadData; + DEBUG3("T3(%.*s, %.2d): - Completing", SUBSCRIBER_NUMBER_LENGTH, + td->transactionData.number, + td->transactionData.server_id); + + if (result == -1) { + CHECK_ALLOWED_ERROR("T3-3: Commit", td, pCON->getNdbError()); + td->pNDB->closeTransaction(pCON); + start_T3(td->pNDB, td, stat_async); + return; + }//if + td->pNDB->closeTransaction(pCON); + complete_T3(td); +} + +/** + * Transaction 4 - T4 + * + * Create session + * + * Input: + * SubscriberNumber + * ServerId + * ServerBit + * SessionDetails, + * DoRollback + * Output: + * ChangedBy + * ChangedTime + * Location + * BranchExecuted + */ +void +start_T4(Ndb * pNDB, ThreadData * td, int async){ + + DEBUG3("T4(%.*s, %.2d): - Starting", SUBSCRIBER_NUMBER_LENGTH, + td->transactionData.number, + td->transactionData.server_id); + + NdbConnection * pCON = 0; + while((pCON = startTransaction(pNDB, td)) == 0){ + CHECK_ALLOWED_ERROR("T4-1: startTransaction", td, pNDB->getNdbError()); + NdbSleep_MilliSleep(10); + } + + NdbOperation *MyOp= pCON->getNdbOperation(SUBSCRIBER_TABLE); + CHECK_NULL(MyOp, "T4-1: getNdbOperation", td, + pCON->getNdbError()); + + MyOp->interpretedUpdateTuple(); + MyOp->equal(IND_SUBSCRIBER_NUMBER, + td->transactionData.number); + MyOp->getValue(IND_SUBSCRIBER_LOCATION, + (char *)&td->transactionData.location); + MyOp->getValue(IND_SUBSCRIBER_CHANGED_BY, + td->transactionData.changed_by); + MyOp->getValue(IND_SUBSCRIBER_CHANGED_TIME, + td->transactionData.changed_time); + MyOp->getValue(IND_SUBSCRIBER_GROUP, + (char *)&td->transactionData.group_id); + MyOp->getValue(IND_SUBSCRIBER_SESSIONS, + (char *)&td->transactionData.sessions); + MyOp->incValue(IND_SUBSCRIBER_SESSIONS, + (uint32)td->transactionData.server_bit); + stat_async = async; + if (async == 1) { + pCON->executeAsynchPrepare( NoCommit , T4_Callback_1, td); + } else { + int result = pCON->execute( NoCommit ); + T4_Callback_1(result, pCON, (void*)td); + return; + }//if +} + +void +T4_Callback_1(int result, NdbConnection * pCON, void * threadData){ + ThreadData * td = (ThreadData *)threadData; + if (result == -1) { + CHECK_ALLOWED_ERROR("T4-1: execute", td, pCON->getNdbError()); + td->pNDB->closeTransaction(pCON); + start_T4(td->pNDB, td, stat_async); + return; + }//if + + DEBUG3("T4(%.*s, %.2d): - Callback 1", + SUBSCRIBER_NUMBER_LENGTH, + td->transactionData.number, + td->transactionData.server_id); + + + NdbOperation * MyOp = pCON->getNdbOperation(GROUP_TABLE); + CHECK_NULL(MyOp, "T4-2: getNdbOperation", td, + pCON->getNdbError()); + + MyOp->readTuple(); + MyOp->equal(IND_GROUP_ID, + (char*)&td->transactionData.group_id); + MyOp->getValue(IND_GROUP_ALLOW_INSERT, + (char *)&td->transactionData.permission); + if (stat_async == 1) { + pCON->executeAsynchPrepare( NoCommit , T4_Callback_2, td); + } else { + int result = pCON->execute( NoCommit ); + T4_Callback_2(result, pCON, (void*)td); + return; + }//if +} + +void +T4_Callback_2(int result, NdbConnection * pCON, void * threadData){ + ThreadData * td = (ThreadData *)threadData; + if (result == -1) { + CHECK_ALLOWED_ERROR("T4-2: execute", td, pCON->getNdbError()); + td->pNDB->closeTransaction(pCON); + start_T4(td->pNDB, td, stat_async); + return; + }//if + + Uint32 permission = td->transactionData.permission; + Uint32 sessions = td->transactionData.sessions; + Uint32 server_bit = td->transactionData.server_bit; + + if(((permission & server_bit) == server_bit) && + ((sessions & server_bit) == 0)){ + + memcpy(td->transactionData.suffix, + &td->transactionData.number[SFX_START], + SUBSCRIBER_NUMBER_SUFFIX_LENGTH); + + DEBUG5("T4(%.*s, %.2d): - Callback 2 - inserting(%.*s)", + SUBSCRIBER_NUMBER_LENGTH, + td->transactionData.number, + td->transactionData.server_id, + SUBSCRIBER_NUMBER_SUFFIX_LENGTH, + td->transactionData.suffix); + + /* Operation 3 */ + + NdbOperation * MyOp = pCON->getNdbOperation(SESSION_TABLE); + CHECK_NULL(MyOp, "T4-3: getNdbOperation", td, + pCON->getNdbError()); + + MyOp->insertTuple(); + MyOp->equal(IND_SESSION_SUBSCRIBER, + (char*)td->transactionData.number); + MyOp->equal(IND_SESSION_SERVER, + (char*)&td->transactionData.server_id); + MyOp->setValue(SESSION_DATA, + (char *)td->transactionData.session_details); + /* Operation 4 */ + + /* Operation 5 */ + MyOp = pCON->getNdbOperation(SERVER_TABLE); + CHECK_NULL(MyOp, "T4-5: getNdbOperation", td, + pCON->getNdbError()); + + MyOp->interpretedUpdateTuple(); + MyOp->equal(IND_SERVER_ID, + (char*)&td->transactionData.server_id); + MyOp->equal(IND_SERVER_SUBSCRIBER_SUFFIX, + (char*)td->transactionData.suffix); + MyOp->incValue(IND_SERVER_INSERTS, (uint32)1); + td->transactionData.branchExecuted = 1; + } else { + td->transactionData.branchExecuted = 0; + DEBUG5("T4(%.*s, %.2d): - Callback 2 - %s %s", + SUBSCRIBER_NUMBER_LENGTH, + td->transactionData.number, + td->transactionData.server_id, + ((permission & server_bit) ? + "permission - " : "no permission - "), + ((sessions & server_bit) ? + "in session - " : "no in session - ")); + } + + if(!td->transactionData.do_rollback && td->transactionData.branchExecuted){ + if (stat_async == 1) { + pCON->executeAsynchPrepare( Commit , T4_Callback_3, td); + } else { + int result = pCON->execute( Commit ); + T4_Callback_3(result, pCON, (void*)td); + return; + }//if + } else { + if (stat_async == 1) { + pCON->executeAsynchPrepare( Rollback , T4_Callback_3, td); + } else { + int result = pCON->execute( Rollback ); + T4_Callback_3(result, pCON, (void*)td); + return; + }//if + } +} + +void +T4_Callback_3(int result, NdbConnection * pCON, void * threadData){ + ThreadData * td = (ThreadData *)threadData; + if (result == -1) { + CHECK_ALLOWED_ERROR("T4-3: Commit", td, pCON->getNdbError()); + td->pNDB->closeTransaction(pCON); + start_T4(td->pNDB, td, stat_async); + return; + }//if + + DEBUG3("T4(%.*s, %.2d): - Completing", + SUBSCRIBER_NUMBER_LENGTH, + td->transactionData.number, + td->transactionData.server_id); + + td->pNDB->closeTransaction(pCON); + complete_T4(td); +} + +/** + * Transaction 5 - T5 + * + * Delete session + * + * Input: + * SubscriberNumber + * ServerId + * ServerBit + * DoRollback + * Output: + * ChangedBy + * ChangedTime + * Location + * BranchExecuted + */ +void +start_T5(Ndb * pNDB, ThreadData * td, int async){ + + DEBUG3("T5(%.*s, %.2d): - Starting", SUBSCRIBER_NUMBER_LENGTH, + td->transactionData.number, + td->transactionData.server_id); + + NdbConnection * pCON = 0; + while((pCON = startTransaction(pNDB, td)) == 0){ + CHECK_ALLOWED_ERROR("T5-1: startTransaction", td, pNDB->getNdbError()); + NdbSleep_MilliSleep(10); + } + + NdbOperation * MyOp= pCON->getNdbOperation(SUBSCRIBER_TABLE); + CHECK_NULL(MyOp, "T5-1: getNdbOperation", td, + pCON->getNdbError()); + + MyOp->interpretedUpdateTuple(); + MyOp->equal(IND_SUBSCRIBER_NUMBER, + td->transactionData.number); + MyOp->getValue(IND_SUBSCRIBER_LOCATION, + (char *)&td->transactionData.location); + MyOp->getValue(IND_SUBSCRIBER_CHANGED_BY, + td->transactionData.changed_by); + MyOp->getValue(IND_SUBSCRIBER_CHANGED_TIME, + td->transactionData.changed_time); + MyOp->getValue(IND_SUBSCRIBER_GROUP, + (char *)&td->transactionData.group_id); + MyOp->getValue(IND_SUBSCRIBER_SESSIONS, + (char *)&td->transactionData.sessions); + MyOp->subValue(IND_SUBSCRIBER_SESSIONS, + (uint32)td->transactionData.server_bit); + stat_async = async; + if (async == 1) { + pCON->executeAsynchPrepare( NoCommit , T5_Callback_1, td); + } else { + int result = pCON->execute( NoCommit ); + T5_Callback_1(result, pCON, (void*)td); + return; + }//if +} + +void +T5_Callback_1(int result, NdbConnection * pCON, void * threadData){ + ThreadData * td = (ThreadData *)threadData; + if (result == -1) { + CHECK_ALLOWED_ERROR("T5-1: execute", td, pCON->getNdbError()); + td->pNDB->closeTransaction(pCON); + start_T5(td->pNDB, td, stat_async); + return; + }//if + + DEBUG3("T5(%.*s, %.2d): - Callback 1", + SUBSCRIBER_NUMBER_LENGTH, + td->transactionData.number, + td->transactionData.server_id); + + NdbOperation * MyOp = pCON->getNdbOperation(GROUP_TABLE); + CHECK_NULL(MyOp, "T5-2: getNdbOperation", td, + pCON->getNdbError()); + + MyOp->readTuple(); + MyOp->equal(IND_GROUP_ID, + (char*)&td->transactionData.group_id); + MyOp->getValue(IND_GROUP_ALLOW_DELETE, + (char *)&td->transactionData.permission); + if (stat_async == 1) { + pCON->executeAsynchPrepare( NoCommit , T5_Callback_2, td); + } else { + int result = pCON->execute( NoCommit ); + T5_Callback_2(result, pCON, (void*)td); + return; + }//if +} + +void +T5_Callback_2(int result, NdbConnection * pCON, void * threadData){ + ThreadData * td = (ThreadData *)threadData; + if (result == -1) { + CHECK_ALLOWED_ERROR("T5-2: execute", td, pCON->getNdbError()); + td->pNDB->closeTransaction(pCON); + start_T5(td->pNDB, td, stat_async); + return; + }//if + + Uint32 permission = td->transactionData.permission; + Uint32 sessions = td->transactionData.sessions; + Uint32 server_bit = td->transactionData.server_bit; + + if(((permission & server_bit) == server_bit) && + ((sessions & server_bit) == server_bit)){ + + memcpy(td->transactionData.suffix, + &td->transactionData.number[SFX_START], + SUBSCRIBER_NUMBER_SUFFIX_LENGTH); + + DEBUG5("T5(%.*s, %.2d): - Callback 2 - deleting(%.*s)", + SUBSCRIBER_NUMBER_LENGTH, + td->transactionData.number, + td->transactionData.server_id, + SUBSCRIBER_NUMBER_SUFFIX_LENGTH, + td->transactionData.suffix); + + /* Operation 3 */ + NdbOperation * MyOp = pCON->getNdbOperation(SESSION_TABLE); + CHECK_NULL(MyOp, "T5-3: getNdbOperation", td, + pCON->getNdbError()); + + MyOp->deleteTuple(); + MyOp->equal(IND_SESSION_SUBSCRIBER, + (char*)td->transactionData.number); + MyOp->equal(IND_SESSION_SERVER, + (char*)&td->transactionData.server_id); + /* Operation 4 */ + + /* Operation 5 */ + MyOp = pCON->getNdbOperation(SERVER_TABLE); + CHECK_NULL(MyOp, "T5-5: getNdbOperation", td, + pCON->getNdbError()); + + MyOp->interpretedUpdateTuple(); + MyOp->equal(IND_SERVER_ID, + (char*)&td->transactionData.server_id); + MyOp->equal(IND_SERVER_SUBSCRIBER_SUFFIX, + (char*)td->transactionData.suffix); + MyOp->incValue(IND_SERVER_DELETES, (uint32)1); + td->transactionData.branchExecuted = 1; + } else { + td->transactionData.branchExecuted = 0; + + DEBUG5("T5(%.*s, %.2d): - Callback 2 - no delete - %s %s", + SUBSCRIBER_NUMBER_LENGTH, + td->transactionData.number, + td->transactionData.server_id, + ((permission & server_bit) ? + "permission - " : "no permission - "), + ((sessions & server_bit) ? + "in session - " : "no in session - ")); + } + + if(!td->transactionData.do_rollback && td->transactionData.branchExecuted){ + if (stat_async == 1) { + pCON->executeAsynchPrepare( Commit , T5_Callback_3, td); + } else { + int result = pCON->execute( Commit ); + T5_Callback_3(result, pCON, (void*)td); + return; + }//if + } else { + if (stat_async == 1) { + pCON->executeAsynchPrepare( Rollback , T5_Callback_3, td); + } else { + int result = pCON->execute( Rollback ); + T5_Callback_3(result, pCON, (void*)td); + return; + }//if + } +} + +void +T5_Callback_3(int result, NdbConnection * pCON, void * threadData){ + ThreadData * td = (ThreadData *)threadData; + if (result == -1) { + CHECK_ALLOWED_ERROR("T5-3: Commit", td, pCON->getNdbError()); + td->pNDB->closeTransaction(pCON); + start_T5(td->pNDB, td, stat_async); + return; + }//if + + DEBUG3("T5(%.*s, %.2d): - Completing", + SUBSCRIBER_NUMBER_LENGTH, + td->transactionData.number, + td->transactionData.server_id); + + td->pNDB->closeTransaction(pCON); + complete_T5(td); +} diff --git a/ndb/test/ndbapi/bench/ndb_error.hpp b/ndb/test/ndbapi/bench/ndb_error.hpp new file mode 100644 index 00000000000..d90f5506813 --- /dev/null +++ b/ndb/test/ndbapi/bench/ndb_error.hpp @@ -0,0 +1,81 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef NDB_ERROR_H +#define NDB_ERROR_H + +#include +#include +#include "userInterface.h" +#include +#include + +#define error_handler(x,y, z) { \ + ndbout << x << " " << y << endl; \ + exit(-1); } + +#define CHECK_MINUS_ONE(x, y, z) if(x == -1) \ + error_handler(y,(z->getNdbError()), 0) + +inline +void +CHECK_ALLOWED_ERROR(const char * str, + const ThreadData * td, + const struct NdbError & error){ + + char buf[100]; + snprintf(buf, sizeof(buf), "subscriber = %.*s ", + SUBSCRIBER_NUMBER_LENGTH, + td->transactionData.number); + ndbout << str << " " << error << endl + << buf; + showTime(); + + switch(error.classification) { + case NdbError::TimeoutExpired: + case NdbError::OverloadError: + case NdbError::TemporaryResourceError: + case NdbError::NodeRecoveryError: + break; + default: + if(error.status != NdbError::TemporaryError) + exit(-1); + } +} + +inline +void +CHECK_NULL(void * null, + const char * str, + const ThreadData * td, + const struct NdbError & err){ + if(null == 0){ + CHECK_ALLOWED_ERROR(str, td, err); + exit(-1); + } +} + +inline +void +CHECK_NULL(void * null, const char* msg, NdbConnection* obj) +{ + if(null == 0) + { + error_handler(msg, obj->getNdbError(), 0); + } +} + +#endif diff --git a/ndb/test/ndbapi/bench/ndb_schema.hpp b/ndb/test/ndbapi/bench/ndb_schema.hpp new file mode 100644 index 00000000000..af08bc2eecd --- /dev/null +++ b/ndb/test/ndbapi/bench/ndb_schema.hpp @@ -0,0 +1,78 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef NDB_SCHEMA_H +#define NDB_SCHEMA_H + +#include "testDefinitions.h" + +#define SUBSCRIBER_TABLE "SUBSCRIBER" +#define SUBSCRIBER_NUMBER "NUMBER" +#define SUBSCRIBER_LOCATION "LOCATION" +#define SUBSCRIBER_NAME "NAME" +#define SUBSCRIBER_GROUP "GROUP_ID" +#define SUBSCRIBER_SESSIONS "SESSIONS" +#define SUBSCRIBER_CHANGED_BY "CHANGED_BY" +#define SUBSCRIBER_CHANGED_TIME "CHANGED_TIME" + +#define SERVER_TABLE "SERVER" +#define SERVER_ID "SERVER_ID" +#define SERVER_SUBSCRIBER_SUFFIX "SUFFIX" +#define SERVER_NAME "NAME" +#define SERVER_READS "NO_OF_READ" +#define SERVER_INSERTS "NO_OF_INSERT" +#define SERVER_DELETES "NO_OF_DELETE" + +#define GROUP_TABLE "GROUP" +#define GROUP_ID "GROUP_ID" +#define GROUP_NAME "GROUP_NAME" +#define GROUP_ALLOW_READ "ALLOW_READ" +#define GROUP_ALLOW_INSERT "ALLOW_INSERT" +#define GROUP_ALLOW_DELETE "ALLOW_DELETE" + +#define SESSION_TABLE "SESSION" +#define SESSION_SERVER "SERVER_ID" +#define SESSION_SUBSCRIBER "NUMBER" +#define SESSION_DATA "DATA" + +/** Numbers */ + +#define IND_SUBSCRIBER_NUMBER (unsigned)0 +#define IND_SUBSCRIBER_NAME (unsigned)1 +#define IND_SUBSCRIBER_GROUP (unsigned)2 +#define IND_SUBSCRIBER_LOCATION (unsigned)3 +#define IND_SUBSCRIBER_SESSIONS (unsigned)4 +#define IND_SUBSCRIBER_CHANGED_BY (unsigned)5 +#define IND_SUBSCRIBER_CHANGED_TIME (unsigned)6 + +#define IND_SERVER_SUBSCRIBER_SUFFIX (unsigned)0 +#define IND_SERVER_ID (unsigned)1 +#define IND_SERVER_NAME (unsigned)2 +#define IND_SERVER_READS (unsigned)3 +#define IND_SERVER_INSERTS (unsigned)4 +#define IND_SERVER_DELETES (unsigned)5 + +#define IND_GROUP_ID (unsigned)0 +#define IND_GROUP_NAME (unsigned)1 +#define IND_GROUP_ALLOW_READ (unsigned)2 +#define IND_GROUP_ALLOW_INSERT (unsigned)3 +#define IND_GROUP_ALLOW_DELETE (unsigned)4 + +#define IND_SESSION_SUBSCRIBER (unsigned)0 +#define IND_SESSION_SERVER (unsigned)1 +#define IND_SESSION_DATA (unsigned)2 + +#endif diff --git a/ndb/test/ndbapi/bench/ndb_user_transaction.cpp b/ndb/test/ndbapi/bench/ndb_user_transaction.cpp new file mode 100644 index 00000000000..182f1f99586 --- /dev/null +++ b/ndb/test/ndbapi/bench/ndb_user_transaction.cpp @@ -0,0 +1,825 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +//#define DEBUG_ON + +extern "C" { +#include "user_transaction.h" +}; + +#include "macros.h" +#include "ndb_schema.hpp" +#include "ndb_error.hpp" + +#include +#include + +/** + * Transaction 1 - T1 + * + * Update location and changed by/time on a subscriber + * + * Input: + * SubscriberNumber, + * Location, + * ChangedBy, + * ChangedTime + * + * Output: + */ +int +T1(void * obj, + const SubscriberNumber number, + const Location new_location, + const ChangedBy changed_by, + const ChangedTime changed_time, + BenchmarkTime * transaction_time){ + + Ndb * pNDB = (Ndb *) obj; + + BenchmarkTime start; + get_time(&start); + + int check; + NdbRecAttr * check2; + + NdbConnection * MyTransaction = pNDB->startTransaction(); + if (MyTransaction == NULL) + error_handler("T1: startTranscation", pNDB->getNdbErrorString(), 0); + + NdbOperation *MyOperation = MyTransaction->getNdbOperation(SUBSCRIBER_TABLE); + CHECK_NULL(MyOperation, "T1: getNdbOperation", MyTransaction); + + check = MyOperation->updateTuple(); + CHECK_MINUS_ONE(check, "T1: updateTuple", + MyTransaction); + + check = MyOperation->equal(SUBSCRIBER_NUMBER, + number); + CHECK_MINUS_ONE(check, "T1: equal subscriber", + MyTransaction); + + check = MyOperation->setValue(SUBSCRIBER_LOCATION, + (char *)&new_location); + CHECK_MINUS_ONE(check, "T1: setValue location", + MyTransaction); + + check = MyOperation->setValue(SUBSCRIBER_CHANGED_BY, + changed_by); + CHECK_MINUS_ONE(check, "T1: setValue changed_by", + MyTransaction); + + check = MyOperation->setValue(SUBSCRIBER_CHANGED_TIME, + changed_time); + CHECK_MINUS_ONE(check, "T1: setValue changed_time", + MyTransaction); + + check = MyTransaction->execute( Commit ); + CHECK_MINUS_ONE(check, "T1: Commit", + MyTransaction); + + pNDB->closeTransaction(MyTransaction); + + get_time(transaction_time); + time_diff(transaction_time, &start); + return 0; +} + +/** + * Transaction 2 - T2 + * + * Read from Subscriber: + * + * Input: + * SubscriberNumber + * + * Output: + * Location + * Changed by + * Changed Timestamp + * Name + */ +int +T2(void * obj, + const SubscriberNumber number, + Location * readLocation, + ChangedBy changed_by, + ChangedTime changed_time, + SubscriberName subscriberName, + BenchmarkTime * transaction_time){ + + Ndb * pNDB = (Ndb *) obj; + + BenchmarkTime start; + get_time(&start); + + int check; + NdbRecAttr * check2; + + NdbConnection * MyTransaction = pNDB->startTransaction(); + if (MyTransaction == NULL) + error_handler("T2: startTranscation", pNDB->getNdbErrorString(), 0); + + NdbOperation *MyOperation= MyTransaction->getNdbOperation(SUBSCRIBER_TABLE); + CHECK_NULL(MyOperation, "T2: getNdbOperation", + MyTransaction); + + + check = MyOperation->readTuple(); + CHECK_MINUS_ONE(check, "T2: readTuple", + MyTransaction); + + check = MyOperation->equal(SUBSCRIBER_NUMBER, + number); + CHECK_MINUS_ONE(check, "T2: equal subscriber", + MyTransaction); + + check2 = MyOperation->getValue(SUBSCRIBER_LOCATION, + (char *)readLocation); + CHECK_NULL(check2, "T2: getValue location", + MyTransaction); + + check2 = MyOperation->getValue(SUBSCRIBER_CHANGED_BY, + changed_by); + CHECK_NULL(check2, "T2: getValue changed_by", + MyTransaction); + + check2 = MyOperation->getValue(SUBSCRIBER_CHANGED_TIME, + changed_time); + CHECK_NULL(check2, "T2: getValue changed_time", + MyTransaction); + + check2 = MyOperation->getValue(SUBSCRIBER_NAME, + subscriberName); + CHECK_NULL(check2, "T2: getValue name", + MyTransaction); + + check = MyTransaction->execute( Commit ); + CHECK_MINUS_ONE(check, "T2: Commit", + MyTransaction); + + pNDB->closeTransaction(MyTransaction); + + get_time(transaction_time); + time_diff(transaction_time, &start); + return 0; +} + +/** + * Transaction 3 - T3 + * + * Read session details + * + * Input: + * SubscriberNumber + * ServerId + * ServerBit + * + * Output: + * BranchExecuted + * SessionDetails + * ChangedBy + * ChangedTime + * Location + */ +int +T3(void * obj, + const SubscriberNumber inNumber, + const SubscriberSuffix inSuffix, + const ServerId inServerId, + const ServerBit inServerBit, + SessionDetails outSessionDetails, + ChangedBy outChangedBy, + ChangedTime outChangedTime, + Location * outLocation, + BranchExecuted * outBranchExecuted, + BenchmarkTime * outTransactionTime){ + + Ndb * pNDB = (Ndb *) obj; + + GroupId groupId; + ActiveSessions sessions; + Permission permission; + + BenchmarkTime start; + get_time(&start); + + int check; + NdbRecAttr * check2; + + NdbConnection * MyTransaction = pNDB->startTransaction(); + if (MyTransaction == NULL) + error_handler("T3-1: startTranscation", pNDB->getNdbErrorString(), 0); + + NdbOperation *MyOperation= MyTransaction->getNdbOperation(SUBSCRIBER_TABLE); + CHECK_NULL(MyOperation, "T3-1: getNdbOperation", + MyTransaction); + + + check = MyOperation->readTuple(); + CHECK_MINUS_ONE(check, "T3-1: readTuple", + MyTransaction); + + check = MyOperation->equal(SUBSCRIBER_NUMBER, + inNumber); + CHECK_MINUS_ONE(check, "T3-1: equal subscriber", + MyTransaction); + + check2 = MyOperation->getValue(SUBSCRIBER_LOCATION, + (char *)outLocation); + CHECK_NULL(check2, "T3-1: getValue location", + MyTransaction); + + check2 = MyOperation->getValue(SUBSCRIBER_CHANGED_BY, + outChangedBy); + CHECK_NULL(check2, "T3-1: getValue changed_by", + MyTransaction); + + check2 = MyOperation->getValue(SUBSCRIBER_CHANGED_TIME, + outChangedTime); + CHECK_NULL(check2, "T3-1: getValue changed_time", + MyTransaction); + + check2 = MyOperation->getValue(SUBSCRIBER_GROUP, + (char *)&groupId); + CHECK_NULL(check2, "T3-1: getValue group", + MyTransaction); + + check2 = MyOperation->getValue(SUBSCRIBER_SESSIONS, + (char *)&sessions); + CHECK_NULL(check2, "T3-1: getValue sessions", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T3-1: NoCommit", + MyTransaction); + + /* Operation 2 */ + + MyOperation = MyTransaction->getNdbOperation(GROUP_TABLE); + CHECK_NULL(MyOperation, "T3-2: getNdbOperation", + MyTransaction); + + + check = MyOperation->readTuple(); + CHECK_MINUS_ONE(check, "T3-2: readTuple", + MyTransaction); + + check = MyOperation->equal(GROUP_ID, + (char*)&groupId); + CHECK_MINUS_ONE(check, "T3-2: equal group", + MyTransaction); + + check2 = MyOperation->getValue(GROUP_ALLOW_READ, + (char *)&permission); + CHECK_NULL(check2, "T3-2: getValue allow_read", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T3-2: NoCommit", + MyTransaction); + + DEBUG3("T3(%.*s, %.2d): ", SUBSCRIBER_NUMBER_LENGTH, inNumber, inServerId); + + if(((permission & inServerBit) == inServerBit) && + ((sessions & inServerBit) == inServerBit)){ + + DEBUG("reading - "); + + /* Operation 3 */ + + MyOperation = MyTransaction->getNdbOperation(SESSION_TABLE); + CHECK_NULL(MyOperation, "T3-3: getNdbOperation", + MyTransaction); + + check = MyOperation->readTuple(); + CHECK_MINUS_ONE(check, "T3-3: readTuple", + MyTransaction); + + check = MyOperation->equal(SESSION_SUBSCRIBER, + (char*)inNumber); + CHECK_MINUS_ONE(check, "T3-3: equal number", + MyTransaction); + + check = MyOperation->equal(SESSION_SERVER, + (char*)&inServerId); + CHECK_MINUS_ONE(check, "T3-3: equal server id", + MyTransaction); + + check2 = MyOperation->getValue(SESSION_DATA, + (char *)outSessionDetails); + CHECK_NULL(check2, "T3-3: getValue session details", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T3-3: NoCommit", + MyTransaction); + + /* Operation 4 */ + + MyOperation = MyTransaction->getNdbOperation(SERVER_TABLE); + CHECK_NULL(MyOperation, "T3-4: getNdbOperation", + MyTransaction); + + check = MyOperation->interpretedUpdateTuple(); + CHECK_MINUS_ONE(check, "T3-4: interpretedUpdateTuple", + MyTransaction); + + check = MyOperation->equal(SERVER_ID, + (char*)&inServerId); + CHECK_MINUS_ONE(check, "T3-4: equal serverId", + MyTransaction); + + check = MyOperation->equal(SERVER_SUBSCRIBER_SUFFIX, + (char*)inSuffix); + CHECK_MINUS_ONE(check, "T3-4: equal suffix", + MyTransaction); + + check = MyOperation->incValue(SERVER_READS, (uint32)1); + CHECK_MINUS_ONE(check, "T3-4: inc value", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T3-4: NoCommit", + MyTransaction); + + (* outBranchExecuted) = 1; + } else { + (* outBranchExecuted) = 0; + } + DEBUG("commit\n"); + check = MyTransaction->execute( Commit ); + CHECK_MINUS_ONE(check, "T3: Commit", + MyTransaction); + + pNDB->closeTransaction(MyTransaction); + + get_time(outTransactionTime); + time_diff(outTransactionTime, &start); + return 0; +} + + +/** + * Transaction 4 - T4 + * + * Create session + * + * Input: + * SubscriberNumber + * ServerId + * ServerBit + * SessionDetails, + * DoRollback + * Output: + * ChangedBy + * ChangedTime + * Location + * BranchExecuted + */ +int +T4(void * obj, + const SubscriberNumber inNumber, + const SubscriberSuffix inSuffix, + const ServerId inServerId, + const ServerBit inServerBit, + const SessionDetails inSessionDetails, + ChangedBy outChangedBy, + ChangedTime outChangedTime, + Location * outLocation, + DoRollback inDoRollback, + BranchExecuted * outBranchExecuted, + BenchmarkTime * outTransactionTime){ + + Ndb * pNDB = (Ndb *) obj; + + GroupId groupId; + ActiveSessions sessions; + Permission permission; + + BenchmarkTime start; + get_time(&start); + + int check; + NdbRecAttr * check2; + + NdbConnection * MyTransaction = pNDB->startTransaction(); + if (MyTransaction == NULL) + error_handler("T4-1: startTranscation", pNDB->getNdbErrorString(), 0); + + DEBUG3("T4(%.*s, %.2d): ", SUBSCRIBER_NUMBER_LENGTH, inNumber, inServerId); + + NdbOperation * MyOperation = 0; + + MyOperation= MyTransaction->getNdbOperation(SUBSCRIBER_TABLE); + CHECK_NULL(MyOperation, "T4-1: getNdbOperation", + MyTransaction); + + check = MyOperation->readTupleExclusive(); + CHECK_MINUS_ONE(check, "T4-1: readTuple", + MyTransaction); + + check = MyOperation->equal(SUBSCRIBER_NUMBER, + inNumber); + CHECK_MINUS_ONE(check, "T4-1: equal subscriber", + MyTransaction); + + check2 = MyOperation->getValue(SUBSCRIBER_LOCATION, + (char *)outLocation); + CHECK_NULL(check2, "T4-1: getValue location", + MyTransaction); + + check2 = MyOperation->getValue(SUBSCRIBER_CHANGED_BY, + outChangedBy); + CHECK_NULL(check2, "T4-1: getValue changed_by", + MyTransaction); + + check2 = MyOperation->getValue(SUBSCRIBER_CHANGED_TIME, + outChangedTime); + CHECK_NULL(check2, "T4-1: getValue changed_time", + MyTransaction); + + check2 = MyOperation->getValue(SUBSCRIBER_GROUP, + (char *)&groupId); + CHECK_NULL(check2, "T4-1: getValue group", + MyTransaction); + + check2 = MyOperation->getValue(SUBSCRIBER_SESSIONS, + (char *)&sessions); + CHECK_NULL(check2, "T4-1: getValue sessions", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T4-1: NoCommit", + MyTransaction); + + /* Operation 2 */ + MyOperation = MyTransaction->getNdbOperation(GROUP_TABLE); + CHECK_NULL(MyOperation, "T4-2: getNdbOperation", + MyTransaction); + + check = MyOperation->readTuple(); + CHECK_MINUS_ONE(check, "T4-2: readTuple", + MyTransaction); + + check = MyOperation->equal(GROUP_ID, + (char*)&groupId); + CHECK_MINUS_ONE(check, "T4-2: equal group", + MyTransaction); + + check2 = MyOperation->getValue(GROUP_ALLOW_INSERT, + (char *)&permission); + CHECK_NULL(check2, "T4-2: getValue allow_insert", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T4-2: NoCommit", + MyTransaction); + + if(((permission & inServerBit) == inServerBit) && + ((sessions & inServerBit) == 0)){ + + DEBUG("inserting - "); + + /* Operation 3 */ + MyOperation = MyTransaction->getNdbOperation(SESSION_TABLE); + CHECK_NULL(MyOperation, "T4-3: getNdbOperation", + MyTransaction); + + check = MyOperation->insertTuple(); + CHECK_MINUS_ONE(check, "T4-3: insertTuple", + MyTransaction); + + check = MyOperation->equal(SESSION_SUBSCRIBER, + (char*)inNumber); + CHECK_MINUS_ONE(check, "T4-3: equal number", + MyTransaction); + + check = MyOperation->equal(SESSION_SERVER, + (char*)&inServerId); + CHECK_MINUS_ONE(check, "T4-3: equal server id", + MyTransaction); + + check = MyOperation->setValue(SESSION_DATA, + (char *)inSessionDetails); + CHECK_MINUS_ONE(check, "T4-3: setValue session details", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T4-3: NoCommit", + MyTransaction); + + /* Operation 4 */ + MyOperation = MyTransaction->getNdbOperation(SUBSCRIBER_TABLE); + CHECK_NULL(MyOperation, "T4-4: getNdbOperation", + MyTransaction); + + check = MyOperation->interpretedUpdateTuple(); + CHECK_MINUS_ONE(check, "T4-4: interpretedUpdateTuple", + MyTransaction); + + check = MyOperation->equal(SUBSCRIBER_NUMBER, + (char*)inNumber); + CHECK_MINUS_ONE(check, "T4-4: equal number", + MyTransaction); + + check = MyOperation->incValue(SUBSCRIBER_SESSIONS, + (uint32)inServerBit); + CHECK_MINUS_ONE(check, "T4-4: inc value", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T4-4: NoCommit", + MyTransaction); + + /* Operation 5 */ + MyOperation = MyTransaction->getNdbOperation(SERVER_TABLE); + CHECK_NULL(MyOperation, "T4-5: getNdbOperation", + MyTransaction); + + check = MyOperation->interpretedUpdateTuple(); + CHECK_MINUS_ONE(check, "T4-5: interpretedUpdateTuple", + MyTransaction); + + check = MyOperation->equal(SERVER_ID, + (char*)&inServerId); + CHECK_MINUS_ONE(check, "T4-5: equal serverId", + MyTransaction); + + check = MyOperation->equal(SERVER_SUBSCRIBER_SUFFIX, + (char*)inSuffix); + CHECK_MINUS_ONE(check, "T4-5: equal suffix", + MyTransaction); + + check = MyOperation->incValue(SERVER_INSERTS, (uint32)1); + CHECK_MINUS_ONE(check, "T4-5: inc value", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T4-5: NoCommit", + MyTransaction); + + (* outBranchExecuted) = 1; + } else { + DEBUG1("%s", ((permission & inServerBit) ? "permission - " : "no permission - ")); + DEBUG1("%s", ((sessions & inServerBit) ? "in session - " : "no in session - ")); + (* outBranchExecuted) = 0; + } + + if(!inDoRollback){ + DEBUG("commit\n"); + check = MyTransaction->execute( Commit ); + CHECK_MINUS_ONE(check, "T4: Commit", + MyTransaction); + } else { + DEBUG("rollback\n"); + check = MyTransaction->execute(Rollback); + CHECK_MINUS_ONE(check, "T4:Rollback", + MyTransaction); + + } + + pNDB->closeTransaction(MyTransaction); + + get_time(outTransactionTime); + time_diff(outTransactionTime, &start); + return 0; +} + + +/** + * Transaction 5 - T5 + * + * Delete session + * + * Input: + * SubscriberNumber + * ServerId + * ServerBit + * DoRollback + * Output: + * ChangedBy + * ChangedTime + * Location + * BranchExecuted + */ +int +T5(void * obj, + const SubscriberNumber inNumber, + const SubscriberSuffix inSuffix, + const ServerId inServerId, + const ServerBit inServerBit, + ChangedBy outChangedBy, + ChangedTime outChangedTime, + Location * outLocation, + DoRollback inDoRollback, + BranchExecuted * outBranchExecuted, + BenchmarkTime * outTransactionTime){ + + Ndb * pNDB = (Ndb *) obj; + NdbConnection * MyTransaction = 0; + NdbOperation * MyOperation = 0; + + GroupId groupId; + ActiveSessions sessions; + Permission permission; + + BenchmarkTime start; + get_time(&start); + + int check; + NdbRecAttr * check2; + + MyTransaction = pNDB->startTransaction(); + if (MyTransaction == NULL) + error_handler("T5-1: startTranscation", pNDB->getNdbErrorString(), 0); + + MyOperation= MyTransaction->getNdbOperation(SUBSCRIBER_TABLE); + CHECK_NULL(MyOperation, "T5-1: getNdbOperation", + MyTransaction); + + + check = MyOperation->readTupleExclusive(); + CHECK_MINUS_ONE(check, "T5-1: readTuple", + MyTransaction); + + check = MyOperation->equal(SUBSCRIBER_NUMBER, + inNumber); + CHECK_MINUS_ONE(check, "T5-1: equal subscriber", + MyTransaction); + + check2 = MyOperation->getValue(SUBSCRIBER_LOCATION, + (char *)outLocation); + CHECK_NULL(check2, "T5-1: getValue location", + MyTransaction); + + check2 = MyOperation->getValue(SUBSCRIBER_CHANGED_BY, + outChangedBy); + CHECK_NULL(check2, "T5-1: getValue changed_by", + MyTransaction); + + check2 = MyOperation->getValue(SUBSCRIBER_CHANGED_TIME, + outChangedTime); + CHECK_NULL(check2, "T5-1: getValue changed_time", + MyTransaction); + + check2 = MyOperation->getValue(SUBSCRIBER_GROUP, + (char *)&groupId); + CHECK_NULL(check2, "T5-1: getValue group", + MyTransaction); + + check2 = MyOperation->getValue(SUBSCRIBER_SESSIONS, + (char *)&sessions); + CHECK_NULL(check2, "T5-1: getValue sessions", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T5-1: NoCommit", + MyTransaction); + + /* Operation 2 */ + + MyOperation = MyTransaction->getNdbOperation(GROUP_TABLE); + CHECK_NULL(MyOperation, "T5-2: getNdbOperation", + MyTransaction); + + + check = MyOperation->readTuple(); + CHECK_MINUS_ONE(check, "T5-2: readTuple", + MyTransaction); + + check = MyOperation->equal(GROUP_ID, + (char*)&groupId); + CHECK_MINUS_ONE(check, "T5-2: equal group", + MyTransaction); + + check2 = MyOperation->getValue(GROUP_ALLOW_DELETE, + (char *)&permission); + CHECK_NULL(check2, "T5-2: getValue allow_delete", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T5-2: NoCommit", + MyTransaction); + + DEBUG3("T5(%.*s, %.2d): ", SUBSCRIBER_NUMBER_LENGTH, inNumber, inServerId); + + if(((permission & inServerBit) == inServerBit) && + ((sessions & inServerBit) == inServerBit)){ + + DEBUG("deleting - "); + + /* Operation 3 */ + MyOperation = MyTransaction->getNdbOperation(SESSION_TABLE); + CHECK_NULL(MyOperation, "T5-3: getNdbOperation", + MyTransaction); + + check = MyOperation->deleteTuple(); + CHECK_MINUS_ONE(check, "T5-3: deleteTuple", + MyTransaction); + + check = MyOperation->equal(SESSION_SUBSCRIBER, + (char*)inNumber); + CHECK_MINUS_ONE(check, "T5-3: equal number", + MyTransaction); + + check = MyOperation->equal(SESSION_SERVER, + (char*)&inServerId); + CHECK_MINUS_ONE(check, "T5-3: equal server id", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T5-3: NoCommit", + MyTransaction); + + /* Operation 4 */ + MyOperation = MyTransaction->getNdbOperation(SUBSCRIBER_TABLE); + CHECK_NULL(MyOperation, "T5-4: getNdbOperation", + MyTransaction); + + check = MyOperation->interpretedUpdateTuple(); + CHECK_MINUS_ONE(check, "T5-4: interpretedUpdateTuple", + MyTransaction); + + check = MyOperation->equal(SUBSCRIBER_NUMBER, + (char*)inNumber); + CHECK_MINUS_ONE(check, "T5-4: equal number", + MyTransaction); + + check = MyOperation->subValue(SUBSCRIBER_SESSIONS, + (uint32)inServerBit); + CHECK_MINUS_ONE(check, "T5-4: dec value", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T5-4: NoCommit", + MyTransaction); + + /* Operation 5 */ + MyOperation = MyTransaction->getNdbOperation(SERVER_TABLE); + CHECK_NULL(MyOperation, "T5-5: getNdbOperation", + MyTransaction); + + + check = MyOperation->interpretedUpdateTuple(); + CHECK_MINUS_ONE(check, "T5-5: interpretedUpdateTuple", + MyTransaction); + + check = MyOperation->equal(SERVER_ID, + (char*)&inServerId); + CHECK_MINUS_ONE(check, "T5-5: equal serverId", + MyTransaction); + + check = MyOperation->equal(SERVER_SUBSCRIBER_SUFFIX, + (char*)inSuffix); + CHECK_MINUS_ONE(check, "T5-5: equal suffix", + MyTransaction); + + check = MyOperation->incValue(SERVER_DELETES, (uint32)1); + CHECK_MINUS_ONE(check, "T5-5: inc value", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T5-5: NoCommit", + MyTransaction); + + (* outBranchExecuted) = 1; + } else { + DEBUG1("%s", ((permission & inServerBit) ? "permission - " : "no permission - ")); + DEBUG1("%s", ((sessions & inServerBit) ? "in session - " : "no in session - ")); + (* outBranchExecuted) = 0; + } + + if(!inDoRollback){ + DEBUG("commit\n"); + check = MyTransaction->execute( Commit ); + CHECK_MINUS_ONE(check, "T5: Commit", + MyTransaction); + } else { + DEBUG("rollback\n"); + check = MyTransaction->execute(Rollback); + CHECK_MINUS_ONE(check, "T5:Rollback", + MyTransaction); + + } + + pNDB->closeTransaction(MyTransaction); + + get_time(outTransactionTime); + time_diff(outTransactionTime, &start); + return 0; +} + diff --git a/ndb/test/ndbapi/bench/ndb_user_transaction2.cpp b/ndb/test/ndbapi/bench/ndb_user_transaction2.cpp new file mode 100644 index 00000000000..df3c7a7989e --- /dev/null +++ b/ndb/test/ndbapi/bench/ndb_user_transaction2.cpp @@ -0,0 +1,825 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +//#define DEBUG_ON + +extern "C" { +#include "user_transaction.h" +}; + +#include "macros.h" +#include "ndb_schema.hpp" +#include "ndb_error.hpp" + +#include +#include + +/** + * Transaction 1 - T1 + * + * Update location and changed by/time on a subscriber + * + * Input: + * SubscriberNumber, + * Location, + * ChangedBy, + * ChangedTime + * + * Output: + */ +int +T1(void * obj, + const SubscriberNumber number, + const Location new_location, + const ChangedBy changed_by, + const ChangedTime changed_time, + BenchmarkTime * transaction_time){ + + Ndb * pNDB = (Ndb *) obj; + + BenchmarkTime start; + get_time(&start); + + int check; + NdbRecAttr * check2; + + NdbConnection * MyTransaction = pNDB->startTransaction(); + if (MyTransaction == NULL) + error_handler("T1: startTranscation", pNDB->getNdbErrorString(), 0); + + NdbOperation *MyOperation = MyTransaction->getNdbOperation(SUBSCRIBER_TABLE); + CHECK_NULL(MyOperation, "T1: getNdbOperation", MyTransaction); + + check = MyOperation->updateTuple(); + CHECK_MINUS_ONE(check, "T1: updateTuple", + MyTransaction); + + check = MyOperation->equal(IND_SUBSCRIBER_NUMBER, + number); + CHECK_MINUS_ONE(check, "T1: equal subscriber", + MyTransaction); + + check = MyOperation->setValue(IND_SUBSCRIBER_LOCATION, + (char *)&new_location); + CHECK_MINUS_ONE(check, "T1: setValue location", + MyTransaction); + + check = MyOperation->setValue(IND_SUBSCRIBER_CHANGED_BY, + changed_by); + CHECK_MINUS_ONE(check, "T1: setValue changed_by", + MyTransaction); + + check = MyOperation->setValue(IND_SUBSCRIBER_CHANGED_TIME, + changed_time); + CHECK_MINUS_ONE(check, "T1: setValue changed_time", + MyTransaction); + + check = MyTransaction->execute( Commit ); + CHECK_MINUS_ONE(check, "T1: Commit", + MyTransaction); + + pNDB->closeTransaction(MyTransaction); + + get_time(transaction_time); + time_diff(transaction_time, &start); + return 0; +} + +/** + * Transaction 2 - T2 + * + * Read from Subscriber: + * + * Input: + * SubscriberNumber + * + * Output: + * Location + * Changed by + * Changed Timestamp + * Name + */ +int +T2(void * obj, + const SubscriberNumber number, + Location * readLocation, + ChangedBy changed_by, + ChangedTime changed_time, + SubscriberName subscriberName, + BenchmarkTime * transaction_time){ + + Ndb * pNDB = (Ndb *) obj; + + BenchmarkTime start; + get_time(&start); + + int check; + NdbRecAttr * check2; + + NdbConnection * MyTransaction = pNDB->startTransaction(); + if (MyTransaction == NULL) + error_handler("T2: startTranscation", pNDB->getNdbErrorString(), 0); + + NdbOperation *MyOperation= MyTransaction->getNdbOperation(SUBSCRIBER_TABLE); + CHECK_NULL(MyOperation, "T2: getNdbOperation", + MyTransaction); + + + check = MyOperation->readTuple(); + CHECK_MINUS_ONE(check, "T2: readTuple", + MyTransaction); + + check = MyOperation->equal(IND_SUBSCRIBER_NUMBER, + number); + CHECK_MINUS_ONE(check, "T2: equal subscriber", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_LOCATION, + (char *)readLocation); + CHECK_NULL(check2, "T2: getValue location", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_CHANGED_BY, + changed_by); + CHECK_NULL(check2, "T2: getValue changed_by", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_CHANGED_TIME, + changed_time); + CHECK_NULL(check2, "T2: getValue changed_time", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_NAME, + subscriberName); + CHECK_NULL(check2, "T2: getValue name", + MyTransaction); + + check = MyTransaction->execute( Commit ); + CHECK_MINUS_ONE(check, "T2: Commit", + MyTransaction); + + pNDB->closeTransaction(MyTransaction); + + get_time(transaction_time); + time_diff(transaction_time, &start); + return 0; +} + +/** + * Transaction 3 - T3 + * + * Read session details + * + * Input: + * SubscriberNumber + * ServerId + * ServerBit + * + * Output: + * BranchExecuted + * SessionDetails + * ChangedBy + * ChangedTime + * Location + */ +int +T3(void * obj, + const SubscriberNumber inNumber, + const SubscriberSuffix inSuffix, + const ServerId inServerId, + const ServerBit inServerBit, + SessionDetails outSessionDetails, + ChangedBy outChangedBy, + ChangedTime outChangedTime, + Location * outLocation, + BranchExecuted * outBranchExecuted, + BenchmarkTime * outTransactionTime){ + + Ndb * pNDB = (Ndb *) obj; + + GroupId groupId; + ActiveSessions sessions; + Permission permission; + + BenchmarkTime start; + get_time(&start); + + int check; + NdbRecAttr * check2; + + NdbConnection * MyTransaction = pNDB->startTransaction(); + if (MyTransaction == NULL) + error_handler("T3-1: startTranscation", pNDB->getNdbErrorString(), 0); + + NdbOperation *MyOperation= MyTransaction->getNdbOperation(SUBSCRIBER_TABLE); + CHECK_NULL(MyOperation, "T3-1: getNdbOperation", + MyTransaction); + + + check = MyOperation->readTuple(); + CHECK_MINUS_ONE(check, "T3-1: readTuple", + MyTransaction); + + check = MyOperation->equal(IND_SUBSCRIBER_NUMBER, + inNumber); + CHECK_MINUS_ONE(check, "T3-1: equal subscriber", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_LOCATION, + (char *)outLocation); + CHECK_NULL(check2, "T3-1: getValue location", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_CHANGED_BY, + outChangedBy); + CHECK_NULL(check2, "T3-1: getValue changed_by", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_CHANGED_TIME, + outChangedTime); + CHECK_NULL(check2, "T3-1: getValue changed_time", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_GROUP, + (char *)&groupId); + CHECK_NULL(check2, "T3-1: getValue group", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_SESSIONS, + (char *)&sessions); + CHECK_NULL(check2, "T3-1: getValue sessions", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T3-1: NoCommit", + MyTransaction); + + /* Operation 2 */ + + MyOperation = MyTransaction->getNdbOperation(GROUP_TABLE); + CHECK_NULL(MyOperation, "T3-2: getNdbOperation", + MyTransaction); + + + check = MyOperation->readTuple(); + CHECK_MINUS_ONE(check, "T3-2: readTuple", + MyTransaction); + + check = MyOperation->equal(IND_GROUP_ID, + (char*)&groupId); + CHECK_MINUS_ONE(check, "T3-2: equal group", + MyTransaction); + + check2 = MyOperation->getValue(IND_GROUP_ALLOW_READ, + (char *)&permission); + CHECK_NULL(check2, "T3-2: getValue allow_read", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T3-2: NoCommit", + MyTransaction); + + DEBUG3("T3(%.*s, %.2d): ", SUBSCRIBER_NUMBER_LENGTH, inNumber, inServerId); + + if(((permission & inServerBit) == inServerBit) && + ((sessions & inServerBit) == inServerBit)){ + + DEBUG("reading - "); + + /* Operation 3 */ + + MyOperation = MyTransaction->getNdbOperation(SESSION_TABLE); + CHECK_NULL(MyOperation, "T3-3: getNdbOperation", + MyTransaction); + + check = MyOperation->readTuple(); + CHECK_MINUS_ONE(check, "T3-3: readTuple", + MyTransaction); + + check = MyOperation->equal(IND_SESSION_SUBSCRIBER, + (char*)inNumber); + CHECK_MINUS_ONE(check, "T3-3: equal number", + MyTransaction); + + check = MyOperation->equal(IND_SESSION_SERVER, + (char*)&inServerId); + CHECK_MINUS_ONE(check, "T3-3: equal server id", + MyTransaction); + + check2 = MyOperation->getValue(IND_SESSION_DATA, + (char *)outSessionDetails); + CHECK_NULL(check2, "T3-3: getValue session details", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T3-3: NoCommit", + MyTransaction); + + /* Operation 4 */ + + MyOperation = MyTransaction->getNdbOperation(SERVER_TABLE); + CHECK_NULL(MyOperation, "T3-4: getNdbOperation", + MyTransaction); + + check = MyOperation->interpretedUpdateTuple(); + CHECK_MINUS_ONE(check, "T3-4: interpretedUpdateTuple", + MyTransaction); + + check = MyOperation->equal(IND_SERVER_ID, + (char*)&inServerId); + CHECK_MINUS_ONE(check, "T3-4: equal serverId", + MyTransaction); + + check = MyOperation->equal(IND_SERVER_SUBSCRIBER_SUFFIX, + (char*)inSuffix); + CHECK_MINUS_ONE(check, "T3-4: equal suffix", + MyTransaction); + + check = MyOperation->incValue(IND_SERVER_READS, (uint32)1); + CHECK_MINUS_ONE(check, "T3-4: inc value", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T3-4: NoCommit", + MyTransaction); + + (* outBranchExecuted) = 1; + } else { + (* outBranchExecuted) = 0; + } + DEBUG("commit\n"); + check = MyTransaction->execute( Commit ); + CHECK_MINUS_ONE(check, "T3: Commit", + MyTransaction); + + pNDB->closeTransaction(MyTransaction); + + get_time(outTransactionTime); + time_diff(outTransactionTime, &start); + return 0; +} + + +/** + * Transaction 4 - T4 + * + * Create session + * + * Input: + * SubscriberNumber + * ServerId + * ServerBit + * SessionDetails, + * DoRollback + * Output: + * ChangedBy + * ChangedTime + * Location + * BranchExecuted + */ +int +T4(void * obj, + const SubscriberNumber inNumber, + const SubscriberSuffix inSuffix, + const ServerId inServerId, + const ServerBit inServerBit, + const SessionDetails inSessionDetails, + ChangedBy outChangedBy, + ChangedTime outChangedTime, + Location * outLocation, + DoRollback inDoRollback, + BranchExecuted * outBranchExecuted, + BenchmarkTime * outTransactionTime){ + + Ndb * pNDB = (Ndb *) obj; + + GroupId groupId; + ActiveSessions sessions; + Permission permission; + + BenchmarkTime start; + get_time(&start); + + int check; + NdbRecAttr * check2; + + NdbConnection * MyTransaction = pNDB->startTransaction(); + if (MyTransaction == NULL) + error_handler("T4-1: startTranscation", pNDB->getNdbErrorString(), 0); + + DEBUG3("T4(%.*s, %.2d): ", SUBSCRIBER_NUMBER_LENGTH, inNumber, inServerId); + + NdbOperation * MyOperation = 0; + + MyOperation= MyTransaction->getNdbOperation(SUBSCRIBER_TABLE); + CHECK_NULL(MyOperation, "T4-1: getNdbOperation", + MyTransaction); + + check = MyOperation->readTupleExclusive(); + CHECK_MINUS_ONE(check, "T4-1: readTuple", + MyTransaction); + + check = MyOperation->equal(IND_SUBSCRIBER_NUMBER, + inNumber); + CHECK_MINUS_ONE(check, "T4-1: equal subscriber", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_LOCATION, + (char *)outLocation); + CHECK_NULL(check2, "T4-1: getValue location", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_CHANGED_BY, + outChangedBy); + CHECK_NULL(check2, "T4-1: getValue changed_by", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_CHANGED_TIME, + outChangedTime); + CHECK_NULL(check2, "T4-1: getValue changed_time", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_GROUP, + (char *)&groupId); + CHECK_NULL(check2, "T4-1: getValue group", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_SESSIONS, + (char *)&sessions); + CHECK_NULL(check2, "T4-1: getValue sessions", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T4-1: NoCommit", + MyTransaction); + + /* Operation 2 */ + MyOperation = MyTransaction->getNdbOperation(GROUP_TABLE); + CHECK_NULL(MyOperation, "T4-2: getNdbOperation", + MyTransaction); + + check = MyOperation->readTuple(); + CHECK_MINUS_ONE(check, "T4-2: readTuple", + MyTransaction); + + check = MyOperation->equal(IND_GROUP_ID, + (char*)&groupId); + CHECK_MINUS_ONE(check, "T4-2: equal group", + MyTransaction); + + check2 = MyOperation->getValue(IND_GROUP_ALLOW_INSERT, + (char *)&permission); + CHECK_NULL(check2, "T4-2: getValue allow_insert", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T4-2: NoCommit", + MyTransaction); + + if(((permission & inServerBit) == inServerBit) && + ((sessions & inServerBit) == 0)){ + + DEBUG("inserting - "); + + /* Operation 3 */ + MyOperation = MyTransaction->getNdbOperation(SESSION_TABLE); + CHECK_NULL(MyOperation, "T4-3: getNdbOperation", + MyTransaction); + + check = MyOperation->insertTuple(); + CHECK_MINUS_ONE(check, "T4-3: insertTuple", + MyTransaction); + + check = MyOperation->equal(IND_SESSION_SUBSCRIBER, + (char*)inNumber); + CHECK_MINUS_ONE(check, "T4-3: equal number", + MyTransaction); + + check = MyOperation->equal(IND_SESSION_SERVER, + (char*)&inServerId); + CHECK_MINUS_ONE(check, "T4-3: equal server id", + MyTransaction); + + check = MyOperation->setValue(SESSION_DATA, + (char *)inSessionDetails); + CHECK_MINUS_ONE(check, "T4-3: setValue session details", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T4-3: NoCommit", + MyTransaction); + + /* Operation 4 */ + MyOperation = MyTransaction->getNdbOperation(SUBSCRIBER_TABLE); + CHECK_NULL(MyOperation, "T4-4: getNdbOperation", + MyTransaction); + + check = MyOperation->interpretedUpdateTuple(); + CHECK_MINUS_ONE(check, "T4-4: interpretedUpdateTuple", + MyTransaction); + + check = MyOperation->equal(IND_SUBSCRIBER_NUMBER, + (char*)inNumber); + CHECK_MINUS_ONE(check, "T4-4: equal number", + MyTransaction); + + check = MyOperation->incValue(IND_SUBSCRIBER_SESSIONS, + (uint32)inServerBit); + CHECK_MINUS_ONE(check, "T4-4: inc value", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T4-4: NoCommit", + MyTransaction); + + /* Operation 5 */ + MyOperation = MyTransaction->getNdbOperation(SERVER_TABLE); + CHECK_NULL(MyOperation, "T4-5: getNdbOperation", + MyTransaction); + + check = MyOperation->interpretedUpdateTuple(); + CHECK_MINUS_ONE(check, "T4-5: interpretedUpdateTuple", + MyTransaction); + + check = MyOperation->equal(IND_SERVER_ID, + (char*)&inServerId); + CHECK_MINUS_ONE(check, "T4-5: equal serverId", + MyTransaction); + + check = MyOperation->equal(IND_SERVER_SUBSCRIBER_SUFFIX, + (char*)inSuffix); + CHECK_MINUS_ONE(check, "T4-5: equal suffix", + MyTransaction); + + check = MyOperation->incValue(IND_SERVER_INSERTS, (uint32)1); + CHECK_MINUS_ONE(check, "T4-5: inc value", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T4-5: NoCommit", + MyTransaction); + + (* outBranchExecuted) = 1; + } else { + DEBUG1("%s", ((permission & inServerBit) ? "permission - " : "no permission - ")); + DEBUG1("%s", ((sessions & inServerBit) ? "in session - " : "no in session - ")); + (* outBranchExecuted) = 0; + } + + if(!inDoRollback){ + DEBUG("commit\n"); + check = MyTransaction->execute( Commit ); + CHECK_MINUS_ONE(check, "T4: Commit", + MyTransaction); + } else { + DEBUG("rollback\n"); + check = MyTransaction->execute(Rollback); + CHECK_MINUS_ONE(check, "T4:Rollback", + MyTransaction); + + } + + pNDB->closeTransaction(MyTransaction); + + get_time(outTransactionTime); + time_diff(outTransactionTime, &start); + return 0; +} + + +/** + * Transaction 5 - T5 + * + * Delete session + * + * Input: + * SubscriberNumber + * ServerId + * ServerBit + * DoRollback + * Output: + * ChangedBy + * ChangedTime + * Location + * BranchExecuted + */ +int +T5(void * obj, + const SubscriberNumber inNumber, + const SubscriberSuffix inSuffix, + const ServerId inServerId, + const ServerBit inServerBit, + ChangedBy outChangedBy, + ChangedTime outChangedTime, + Location * outLocation, + DoRollback inDoRollback, + BranchExecuted * outBranchExecuted, + BenchmarkTime * outTransactionTime){ + + Ndb * pNDB = (Ndb *) obj; + NdbConnection * MyTransaction = 0; + NdbOperation * MyOperation = 0; + + GroupId groupId; + ActiveSessions sessions; + Permission permission; + + BenchmarkTime start; + get_time(&start); + + int check; + NdbRecAttr * check2; + + MyTransaction = pNDB->startTransaction(); + if (MyTransaction == NULL) + error_handler("T5-1: startTranscation", pNDB->getNdbErrorString(), 0); + + MyOperation= MyTransaction->getNdbOperation(SUBSCRIBER_TABLE); + CHECK_NULL(MyOperation, "T5-1: getNdbOperation", + MyTransaction); + + + check = MyOperation->readTupleExclusive(); + CHECK_MINUS_ONE(check, "T5-1: readTuple", + MyTransaction); + + check = MyOperation->equal(IND_SUBSCRIBER_NUMBER, + inNumber); + CHECK_MINUS_ONE(check, "T5-1: equal subscriber", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_LOCATION, + (char *)outLocation); + CHECK_NULL(check2, "T5-1: getValue location", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_CHANGED_BY, + outChangedBy); + CHECK_NULL(check2, "T5-1: getValue changed_by", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_CHANGED_TIME, + outChangedTime); + CHECK_NULL(check2, "T5-1: getValue changed_time", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_GROUP, + (char *)&groupId); + CHECK_NULL(check2, "T5-1: getValue group", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_SESSIONS, + (char *)&sessions); + CHECK_NULL(check2, "T5-1: getValue sessions", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T5-1: NoCommit", + MyTransaction); + + /* Operation 2 */ + + MyOperation = MyTransaction->getNdbOperation(GROUP_TABLE); + CHECK_NULL(MyOperation, "T5-2: getNdbOperation", + MyTransaction); + + + check = MyOperation->readTuple(); + CHECK_MINUS_ONE(check, "T5-2: readTuple", + MyTransaction); + + check = MyOperation->equal(IND_GROUP_ID, + (char*)&groupId); + CHECK_MINUS_ONE(check, "T5-2: equal group", + MyTransaction); + + check2 = MyOperation->getValue(IND_GROUP_ALLOW_DELETE, + (char *)&permission); + CHECK_NULL(check2, "T5-2: getValue allow_delete", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T5-2: NoCommit", + MyTransaction); + + DEBUG3("T5(%.*s, %.2d): ", SUBSCRIBER_NUMBER_LENGTH, inNumber, inServerId); + + if(((permission & inServerBit) == inServerBit) && + ((sessions & inServerBit) == inServerBit)){ + + DEBUG("deleting - "); + + /* Operation 3 */ + MyOperation = MyTransaction->getNdbOperation(SESSION_TABLE); + CHECK_NULL(MyOperation, "T5-3: getNdbOperation", + MyTransaction); + + check = MyOperation->deleteTuple(); + CHECK_MINUS_ONE(check, "T5-3: deleteTuple", + MyTransaction); + + check = MyOperation->equal(IND_SESSION_SUBSCRIBER, + (char*)inNumber); + CHECK_MINUS_ONE(check, "T5-3: equal number", + MyTransaction); + + check = MyOperation->equal(IND_SESSION_SERVER, + (char*)&inServerId); + CHECK_MINUS_ONE(check, "T5-3: equal server id", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T5-3: NoCommit", + MyTransaction); + + /* Operation 4 */ + MyOperation = MyTransaction->getNdbOperation(SUBSCRIBER_TABLE); + CHECK_NULL(MyOperation, "T5-4: getNdbOperation", + MyTransaction); + + check = MyOperation->interpretedUpdateTuple(); + CHECK_MINUS_ONE(check, "T5-4: interpretedUpdateTuple", + MyTransaction); + + check = MyOperation->equal(IND_SUBSCRIBER_NUMBER, + (char*)inNumber); + CHECK_MINUS_ONE(check, "T5-4: equal number", + MyTransaction); + + check = MyOperation->subValue(IND_SUBSCRIBER_SESSIONS, + (uint32)inServerBit); + CHECK_MINUS_ONE(check, "T5-4: dec value", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T5-4: NoCommit", + MyTransaction); + + /* Operation 5 */ + MyOperation = MyTransaction->getNdbOperation(SERVER_TABLE); + CHECK_NULL(MyOperation, "T5-5: getNdbOperation", + MyTransaction); + + + check = MyOperation->interpretedUpdateTuple(); + CHECK_MINUS_ONE(check, "T5-5: interpretedUpdateTuple", + MyTransaction); + + check = MyOperation->equal(IND_SERVER_ID, + (char*)&inServerId); + CHECK_MINUS_ONE(check, "T5-5: equal serverId", + MyTransaction); + + check = MyOperation->equal(IND_SERVER_SUBSCRIBER_SUFFIX, + (char*)inSuffix); + CHECK_MINUS_ONE(check, "T5-5: equal suffix", + MyTransaction); + + check = MyOperation->incValue(IND_SERVER_DELETES, (uint32)1); + CHECK_MINUS_ONE(check, "T5-5: inc value", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T5-5: NoCommit", + MyTransaction); + + (* outBranchExecuted) = 1; + } else { + DEBUG1("%s", ((permission & inServerBit) ? "permission - " : "no permission - ")); + DEBUG1("%s", ((sessions & inServerBit) ? "in session - " : "no in session - ")); + (* outBranchExecuted) = 0; + } + + if(!inDoRollback){ + DEBUG("commit\n"); + check = MyTransaction->execute( Commit ); + CHECK_MINUS_ONE(check, "T5: Commit", + MyTransaction); + } else { + DEBUG("rollback\n"); + check = MyTransaction->execute(Rollback); + CHECK_MINUS_ONE(check, "T5:Rollback", + MyTransaction); + + } + + pNDB->closeTransaction(MyTransaction); + + get_time(outTransactionTime); + time_diff(outTransactionTime, &start); + return 0; +} + diff --git a/ndb/test/ndbapi/bench/ndb_user_transaction3.cpp b/ndb/test/ndbapi/bench/ndb_user_transaction3.cpp new file mode 100644 index 00000000000..d2c92ecd424 --- /dev/null +++ b/ndb/test/ndbapi/bench/ndb_user_transaction3.cpp @@ -0,0 +1,793 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +//#define DEBUG_ON + +extern "C" { +#include "user_transaction.h" +}; + +#include "macros.h" +#include "ndb_schema.hpp" +#include "ndb_error.hpp" + +#include +#include + +/** + * Transaction 1 - T1 + * + * Update location and changed by/time on a subscriber + * + * Input: + * SubscriberNumber, + * Location, + * ChangedBy, + * ChangedTime + * + * Output: + */ +int +T1(void * obj, + const SubscriberNumber number, + const Location new_location, + const ChangedBy changed_by, + const ChangedTime changed_time, + BenchmarkTime * transaction_time){ + + Ndb * pNDB = (Ndb *) obj; + + BenchmarkTime start; + get_time(&start); + + int check; + NdbRecAttr * check2; + + NdbConnection * MyTransaction = pNDB->startTransaction(); + if (MyTransaction == NULL) + error_handler("T1: startTranscation", pNDB->getNdbErrorString(), 0); + + NdbOperation *MyOperation = MyTransaction->getNdbOperation(SUBSCRIBER_TABLE); + CHECK_NULL(MyOperation, "T1: getNdbOperation", MyTransaction); + + check = MyOperation->updateTuple(); + CHECK_MINUS_ONE(check, "T1: updateTuple", + MyTransaction); + + check = MyOperation->equal(IND_SUBSCRIBER_NUMBER, + number); + CHECK_MINUS_ONE(check, "T1: equal subscriber", + MyTransaction); + + check = MyOperation->setValue(IND_SUBSCRIBER_LOCATION, + (char *)&new_location); + CHECK_MINUS_ONE(check, "T1: setValue location", + MyTransaction); + + check = MyOperation->setValue(IND_SUBSCRIBER_CHANGED_BY, + changed_by); + CHECK_MINUS_ONE(check, "T1: setValue changed_by", + MyTransaction); + + check = MyOperation->setValue(IND_SUBSCRIBER_CHANGED_TIME, + changed_time); + CHECK_MINUS_ONE(check, "T1: setValue changed_time", + MyTransaction); + + check = MyTransaction->execute( Commit ); + CHECK_MINUS_ONE(check, "T1: Commit", + MyTransaction); + + pNDB->closeTransaction(MyTransaction); + + get_time(transaction_time); + time_diff(transaction_time, &start); + return 0; +} + +/** + * Transaction 2 - T2 + * + * Read from Subscriber: + * + * Input: + * SubscriberNumber + * + * Output: + * Location + * Changed by + * Changed Timestamp + * Name + */ +int +T2(void * obj, + const SubscriberNumber number, + Location * readLocation, + ChangedBy changed_by, + ChangedTime changed_time, + SubscriberName subscriberName, + BenchmarkTime * transaction_time){ + + Ndb * pNDB = (Ndb *) obj; + + BenchmarkTime start; + get_time(&start); + + int check; + NdbRecAttr * check2; + + NdbConnection * MyTransaction = pNDB->startTransaction(); + if (MyTransaction == NULL) + error_handler("T2: startTranscation", pNDB->getNdbErrorString(), 0); + + NdbOperation *MyOperation= MyTransaction->getNdbOperation(SUBSCRIBER_TABLE); + CHECK_NULL(MyOperation, "T2: getNdbOperation", + MyTransaction); + + + check = MyOperation->readTuple(); + CHECK_MINUS_ONE(check, "T2: readTuple", + MyTransaction); + + check = MyOperation->equal(IND_SUBSCRIBER_NUMBER, + number); + CHECK_MINUS_ONE(check, "T2: equal subscriber", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_LOCATION, + (char *)readLocation); + CHECK_NULL(check2, "T2: getValue location", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_CHANGED_BY, + changed_by); + CHECK_NULL(check2, "T2: getValue changed_by", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_CHANGED_TIME, + changed_time); + CHECK_NULL(check2, "T2: getValue changed_time", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_NAME, + subscriberName); + CHECK_NULL(check2, "T2: getValue name", + MyTransaction); + + check = MyTransaction->execute( Commit ); + CHECK_MINUS_ONE(check, "T2: Commit", + MyTransaction); + + pNDB->closeTransaction(MyTransaction); + + get_time(transaction_time); + time_diff(transaction_time, &start); + return 0; +} + +/** + * Transaction 3 - T3 + * + * Read session details + * + * Input: + * SubscriberNumber + * ServerId + * ServerBit + * + * Output: + * BranchExecuted + * SessionDetails + * ChangedBy + * ChangedTime + * Location + */ +int +T3(void * obj, + const SubscriberNumber inNumber, + const SubscriberSuffix inSuffix, + const ServerId inServerId, + const ServerBit inServerBit, + SessionDetails outSessionDetails, + ChangedBy outChangedBy, + ChangedTime outChangedTime, + Location * outLocation, + BranchExecuted * outBranchExecuted, + BenchmarkTime * outTransactionTime){ + + Ndb * pNDB = (Ndb *) obj; + + GroupId groupId; + ActiveSessions sessions; + Permission permission; + + BenchmarkTime start; + get_time(&start); + + int check; + NdbRecAttr * check2; + + NdbConnection * MyTransaction = pNDB->startTransaction(); + if (MyTransaction == NULL) + error_handler("T3-1: startTranscation", pNDB->getNdbErrorString(), 0); + + NdbOperation *MyOperation= MyTransaction->getNdbOperation(SUBSCRIBER_TABLE); + CHECK_NULL(MyOperation, "T3-1: getNdbOperation", + MyTransaction); + + + check = MyOperation->readTuple(); + CHECK_MINUS_ONE(check, "T3-1: readTuple", + MyTransaction); + + check = MyOperation->equal(IND_SUBSCRIBER_NUMBER, + inNumber); + CHECK_MINUS_ONE(check, "T3-1: equal subscriber", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_LOCATION, + (char *)outLocation); + CHECK_NULL(check2, "T3-1: getValue location", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_CHANGED_BY, + outChangedBy); + CHECK_NULL(check2, "T3-1: getValue changed_by", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_CHANGED_TIME, + outChangedTime); + CHECK_NULL(check2, "T3-1: getValue changed_time", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_GROUP, + (char *)&groupId); + CHECK_NULL(check2, "T3-1: getValue group", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_SESSIONS, + (char *)&sessions); + CHECK_NULL(check2, "T3-1: getValue sessions", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T3-1: NoCommit", + MyTransaction); + + /* Operation 2 */ + + MyOperation = MyTransaction->getNdbOperation(GROUP_TABLE); + CHECK_NULL(MyOperation, "T3-2: getNdbOperation", + MyTransaction); + + + check = MyOperation->readTuple(); + CHECK_MINUS_ONE(check, "T3-2: readTuple", + MyTransaction); + + check = MyOperation->equal(IND_GROUP_ID, + (char*)&groupId); + CHECK_MINUS_ONE(check, "T3-2: equal group", + MyTransaction); + + check2 = MyOperation->getValue(IND_GROUP_ALLOW_READ, + (char *)&permission); + CHECK_NULL(check2, "T3-2: getValue allow_read", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T3-2: NoCommit", + MyTransaction); + + DEBUG3("T3(%.*s, %.2d): ", SUBSCRIBER_NUMBER_LENGTH, inNumber, inServerId); + + if(((permission & inServerBit) == inServerBit) && + ((sessions & inServerBit) == inServerBit)){ + + DEBUG("reading - "); + + /* Operation 3 */ + + MyOperation = MyTransaction->getNdbOperation(SESSION_TABLE); + CHECK_NULL(MyOperation, "T3-3: getNdbOperation", + MyTransaction); + + check = MyOperation->readTuple(); + CHECK_MINUS_ONE(check, "T3-3: readTuple", + MyTransaction); + + check = MyOperation->equal(IND_SESSION_SUBSCRIBER, + (char*)inNumber); + CHECK_MINUS_ONE(check, "T3-3: equal number", + MyTransaction); + + check = MyOperation->equal(IND_SESSION_SERVER, + (char*)&inServerId); + CHECK_MINUS_ONE(check, "T3-3: equal server id", + MyTransaction); + + check2 = MyOperation->getValue(IND_SESSION_DATA, + (char *)outSessionDetails); + CHECK_NULL(check2, "T3-3: getValue session details", + MyTransaction); + + /* Operation 4 */ + + MyOperation = MyTransaction->getNdbOperation(SERVER_TABLE); + CHECK_NULL(MyOperation, "T3-4: getNdbOperation", + MyTransaction); + + check = MyOperation->interpretedUpdateTuple(); + CHECK_MINUS_ONE(check, "T3-4: interpretedUpdateTuple", + MyTransaction); + + check = MyOperation->equal(IND_SERVER_ID, + (char*)&inServerId); + CHECK_MINUS_ONE(check, "T3-4: equal serverId", + MyTransaction); + + check = MyOperation->equal(IND_SERVER_SUBSCRIBER_SUFFIX, + (char*)inSuffix); + CHECK_MINUS_ONE(check, "T3-4: equal suffix", + MyTransaction); + + check = MyOperation->incValue(IND_SERVER_READS, (uint32)1); + CHECK_MINUS_ONE(check, "T3-4: inc value", + MyTransaction); + + (* outBranchExecuted) = 1; + } else { + (* outBranchExecuted) = 0; + } + DEBUG("commit\n"); + check = MyTransaction->execute( Commit ); + CHECK_MINUS_ONE(check, "T3: Commit", + MyTransaction); + + pNDB->closeTransaction(MyTransaction); + + get_time(outTransactionTime); + time_diff(outTransactionTime, &start); + return 0; +} + + +/** + * Transaction 4 - T4 + * + * Create session + * + * Input: + * SubscriberNumber + * ServerId + * ServerBit + * SessionDetails, + * DoRollback + * Output: + * ChangedBy + * ChangedTime + * Location + * BranchExecuted + */ +int +T4(void * obj, + const SubscriberNumber inNumber, + const SubscriberSuffix inSuffix, + const ServerId inServerId, + const ServerBit inServerBit, + const SessionDetails inSessionDetails, + ChangedBy outChangedBy, + ChangedTime outChangedTime, + Location * outLocation, + DoRollback inDoRollback, + BranchExecuted * outBranchExecuted, + BenchmarkTime * outTransactionTime){ + + Ndb * pNDB = (Ndb *) obj; + + GroupId groupId; + ActiveSessions sessions; + Permission permission; + + BenchmarkTime start; + get_time(&start); + + int check; + NdbRecAttr * check2; + + NdbConnection * MyTransaction = pNDB->startTransaction(); + if (MyTransaction == NULL) + error_handler("T4-1: startTranscation", pNDB->getNdbErrorString(), 0); + + DEBUG3("T4(%.*s, %.2d): ", SUBSCRIBER_NUMBER_LENGTH, inNumber, inServerId); + + NdbOperation * MyOperation = 0; + + MyOperation= MyTransaction->getNdbOperation(SUBSCRIBER_TABLE); + CHECK_NULL(MyOperation, "T4-1: getNdbOperation", + MyTransaction); + + check = MyOperation->readTupleExclusive(); + CHECK_MINUS_ONE(check, "T4-1: readTuple", + MyTransaction); + + check = MyOperation->equal(IND_SUBSCRIBER_NUMBER, + inNumber); + CHECK_MINUS_ONE(check, "T4-1: equal subscriber", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_LOCATION, + (char *)outLocation); + CHECK_NULL(check2, "T4-1: getValue location", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_CHANGED_BY, + outChangedBy); + CHECK_NULL(check2, "T4-1: getValue changed_by", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_CHANGED_TIME, + outChangedTime); + CHECK_NULL(check2, "T4-1: getValue changed_time", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_GROUP, + (char *)&groupId); + CHECK_NULL(check2, "T4-1: getValue group", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_SESSIONS, + (char *)&sessions); + CHECK_NULL(check2, "T4-1: getValue sessions", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T4-1: NoCommit", + MyTransaction); + + /* Operation 2 */ + MyOperation = MyTransaction->getNdbOperation(GROUP_TABLE); + CHECK_NULL(MyOperation, "T4-2: getNdbOperation", + MyTransaction); + + check = MyOperation->readTuple(); + CHECK_MINUS_ONE(check, "T4-2: readTuple", + MyTransaction); + + check = MyOperation->equal(IND_GROUP_ID, + (char*)&groupId); + CHECK_MINUS_ONE(check, "T4-2: equal group", + MyTransaction); + + check2 = MyOperation->getValue(IND_GROUP_ALLOW_INSERT, + (char *)&permission); + CHECK_NULL(check2, "T4-2: getValue allow_insert", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T4-2: NoCommit", + MyTransaction); + + if(((permission & inServerBit) == inServerBit) && + ((sessions & inServerBit) == 0)){ + + DEBUG("inserting - "); + + /* Operation 3 */ + MyOperation = MyTransaction->getNdbOperation(SESSION_TABLE); + CHECK_NULL(MyOperation, "T4-3: getNdbOperation", + MyTransaction); + + check = MyOperation->insertTuple(); + CHECK_MINUS_ONE(check, "T4-3: insertTuple", + MyTransaction); + + check = MyOperation->equal(IND_SESSION_SUBSCRIBER, + (char*)inNumber); + CHECK_MINUS_ONE(check, "T4-3: equal number", + MyTransaction); + + check = MyOperation->equal(IND_SESSION_SERVER, + (char*)&inServerId); + CHECK_MINUS_ONE(check, "T4-3: equal server id", + MyTransaction); + + check = MyOperation->setValue(SESSION_DATA, + (char *)inSessionDetails); + CHECK_MINUS_ONE(check, "T4-3: setValue session details", + MyTransaction); + + /* Operation 4 */ + MyOperation = MyTransaction->getNdbOperation(SUBSCRIBER_TABLE); + CHECK_NULL(MyOperation, "T4-4: getNdbOperation", + MyTransaction); + + check = MyOperation->interpretedUpdateTuple(); + CHECK_MINUS_ONE(check, "T4-4: interpretedUpdateTuple", + MyTransaction); + + check = MyOperation->equal(IND_SUBSCRIBER_NUMBER, + (char*)inNumber); + CHECK_MINUS_ONE(check, "T4-4: equal number", + MyTransaction); + + check = MyOperation->incValue(IND_SUBSCRIBER_SESSIONS, + (uint32)inServerBit); + CHECK_MINUS_ONE(check, "T4-4: inc value", + MyTransaction); + + /* Operation 5 */ + MyOperation = MyTransaction->getNdbOperation(SERVER_TABLE); + CHECK_NULL(MyOperation, "T4-5: getNdbOperation", + MyTransaction); + + check = MyOperation->interpretedUpdateTuple(); + CHECK_MINUS_ONE(check, "T4-5: interpretedUpdateTuple", + MyTransaction); + + check = MyOperation->equal(IND_SERVER_ID, + (char*)&inServerId); + CHECK_MINUS_ONE(check, "T4-5: equal serverId", + MyTransaction); + + check = MyOperation->equal(IND_SERVER_SUBSCRIBER_SUFFIX, + (char*)inSuffix); + CHECK_MINUS_ONE(check, "T4-5: equal suffix", + MyTransaction); + + check = MyOperation->incValue(IND_SERVER_INSERTS, (uint32)1); + CHECK_MINUS_ONE(check, "T4-5: inc value", + MyTransaction); + + (* outBranchExecuted) = 1; + } else { + DEBUG1("%s", ((permission & inServerBit) ? "permission - " : "no permission - ")); + DEBUG1("%s", ((sessions & inServerBit) ? "in session - " : "no in session - ")); + (* outBranchExecuted) = 0; + } + + if(!inDoRollback){ + DEBUG("commit\n"); + check = MyTransaction->execute( Commit ); + CHECK_MINUS_ONE(check, "T4: Commit", + MyTransaction); + } else { + DEBUG("rollback\n"); + check = MyTransaction->execute(Rollback); + CHECK_MINUS_ONE(check, "T4:Rollback", + MyTransaction); + + } + + pNDB->closeTransaction(MyTransaction); + + get_time(outTransactionTime); + time_diff(outTransactionTime, &start); + return 0; +} + + +/** + * Transaction 5 - T5 + * + * Delete session + * + * Input: + * SubscriberNumber + * ServerId + * ServerBit + * DoRollback + * Output: + * ChangedBy + * ChangedTime + * Location + * BranchExecuted + */ +int +T5(void * obj, + const SubscriberNumber inNumber, + const SubscriberSuffix inSuffix, + const ServerId inServerId, + const ServerBit inServerBit, + ChangedBy outChangedBy, + ChangedTime outChangedTime, + Location * outLocation, + DoRollback inDoRollback, + BranchExecuted * outBranchExecuted, + BenchmarkTime * outTransactionTime){ + + Ndb * pNDB = (Ndb *) obj; + NdbConnection * MyTransaction = 0; + NdbOperation * MyOperation = 0; + + GroupId groupId; + ActiveSessions sessions; + Permission permission; + + BenchmarkTime start; + get_time(&start); + + int check; + NdbRecAttr * check2; + + MyTransaction = pNDB->startTransaction(); + if (MyTransaction == NULL) + error_handler("T5-1: startTranscation", pNDB->getNdbErrorString(), 0); + + MyOperation= MyTransaction->getNdbOperation(SUBSCRIBER_TABLE); + CHECK_NULL(MyOperation, "T5-1: getNdbOperation", + MyTransaction); + + + check = MyOperation->readTupleExclusive(); + CHECK_MINUS_ONE(check, "T5-1: readTuple", + MyTransaction); + + check = MyOperation->equal(IND_SUBSCRIBER_NUMBER, + inNumber); + CHECK_MINUS_ONE(check, "T5-1: equal subscriber", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_LOCATION, + (char *)outLocation); + CHECK_NULL(check2, "T5-1: getValue location", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_CHANGED_BY, + outChangedBy); + CHECK_NULL(check2, "T5-1: getValue changed_by", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_CHANGED_TIME, + outChangedTime); + CHECK_NULL(check2, "T5-1: getValue changed_time", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_GROUP, + (char *)&groupId); + CHECK_NULL(check2, "T5-1: getValue group", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_SESSIONS, + (char *)&sessions); + CHECK_NULL(check2, "T5-1: getValue sessions", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T5-1: NoCommit", + MyTransaction); + + /* Operation 2 */ + + MyOperation = MyTransaction->getNdbOperation(GROUP_TABLE); + CHECK_NULL(MyOperation, "T5-2: getNdbOperation", + MyTransaction); + + + check = MyOperation->readTuple(); + CHECK_MINUS_ONE(check, "T5-2: readTuple", + MyTransaction); + + check = MyOperation->equal(IND_GROUP_ID, + (char*)&groupId); + CHECK_MINUS_ONE(check, "T5-2: equal group", + MyTransaction); + + check2 = MyOperation->getValue(IND_GROUP_ALLOW_DELETE, + (char *)&permission); + CHECK_NULL(check2, "T5-2: getValue allow_delete", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T5-2: NoCommit", + MyTransaction); + + DEBUG3("T5(%.*s, %.2d): ", SUBSCRIBER_NUMBER_LENGTH, inNumber, inServerId); + + if(((permission & inServerBit) == inServerBit) && + ((sessions & inServerBit) == inServerBit)){ + + DEBUG("deleting - "); + + /* Operation 3 */ + MyOperation = MyTransaction->getNdbOperation(SESSION_TABLE); + CHECK_NULL(MyOperation, "T5-3: getNdbOperation", + MyTransaction); + + check = MyOperation->deleteTuple(); + CHECK_MINUS_ONE(check, "T5-3: deleteTuple", + MyTransaction); + + check = MyOperation->equal(IND_SESSION_SUBSCRIBER, + (char*)inNumber); + CHECK_MINUS_ONE(check, "T5-3: equal number", + MyTransaction); + + check = MyOperation->equal(IND_SESSION_SERVER, + (char*)&inServerId); + CHECK_MINUS_ONE(check, "T5-3: equal server id", + MyTransaction); + + /* Operation 4 */ + MyOperation = MyTransaction->getNdbOperation(SUBSCRIBER_TABLE); + CHECK_NULL(MyOperation, "T5-4: getNdbOperation", + MyTransaction); + + check = MyOperation->interpretedUpdateTuple(); + CHECK_MINUS_ONE(check, "T5-4: interpretedUpdateTuple", + MyTransaction); + + check = MyOperation->equal(IND_SUBSCRIBER_NUMBER, + (char*)inNumber); + CHECK_MINUS_ONE(check, "T5-4: equal number", + MyTransaction); + + check = MyOperation->subValue(IND_SUBSCRIBER_SESSIONS, + (uint32)inServerBit); + CHECK_MINUS_ONE(check, "T5-4: dec value", + MyTransaction); + + /* Operation 5 */ + MyOperation = MyTransaction->getNdbOperation(SERVER_TABLE); + CHECK_NULL(MyOperation, "T5-5: getNdbOperation", + MyTransaction); + + + check = MyOperation->interpretedUpdateTuple(); + CHECK_MINUS_ONE(check, "T5-5: interpretedUpdateTuple", + MyTransaction); + + check = MyOperation->equal(IND_SERVER_ID, + (char*)&inServerId); + CHECK_MINUS_ONE(check, "T5-5: equal serverId", + MyTransaction); + + check = MyOperation->equal(IND_SERVER_SUBSCRIBER_SUFFIX, + (char*)inSuffix); + CHECK_MINUS_ONE(check, "T5-5: equal suffix", + MyTransaction); + + check = MyOperation->incValue(IND_SERVER_DELETES, (uint32)1); + CHECK_MINUS_ONE(check, "T5-5: inc value", + MyTransaction); + + (* outBranchExecuted) = 1; + } else { + DEBUG1("%s", ((permission & inServerBit) ? "permission - " : "no permission - ")); + DEBUG1("%s", ((sessions & inServerBit) ? "in session - " : "no in session - ")); + (* outBranchExecuted) = 0; + } + + if(!inDoRollback){ + DEBUG("commit\n"); + check = MyTransaction->execute( Commit ); + CHECK_MINUS_ONE(check, "T5: Commit", + MyTransaction); + } else { + DEBUG("rollback\n"); + check = MyTransaction->execute(Rollback); + CHECK_MINUS_ONE(check, "T5:Rollback", + MyTransaction); + + } + + pNDB->closeTransaction(MyTransaction); + + get_time(outTransactionTime); + time_diff(outTransactionTime, &start); + return 0; +} + diff --git a/ndb/test/ndbapi/bench/ndb_user_transaction4.cpp b/ndb/test/ndbapi/bench/ndb_user_transaction4.cpp new file mode 100644 index 00000000000..e652c7bfed8 --- /dev/null +++ b/ndb/test/ndbapi/bench/ndb_user_transaction4.cpp @@ -0,0 +1,770 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +//#define DEBUG_ON + +extern "C" { +#include "user_transaction.h" +}; + +#include "macros.h" +#include "ndb_schema.hpp" +#include "ndb_error.hpp" + +#include +#include + +/** + * Transaction 1 - T1 + * + * Update location and changed by/time on a subscriber + * + * Input: + * SubscriberNumber, + * Location, + * ChangedBy, + * ChangedTime + * + * Output: + */ +int +T1(void * obj, + const SubscriberNumber number, + const Location new_location, + const ChangedBy changed_by, + const ChangedTime changed_time, + BenchmarkTime * transaction_time){ + + Ndb * pNDB = (Ndb *) obj; + + DEBUG2("T1(%.*s):\n", SUBSCRIBER_NUMBER_LENGTH, number); + + BenchmarkTime start; + get_time(&start); + + int check; + NdbRecAttr * check2; + + NdbConnection * MyTransaction = pNDB->startTransaction(); + if (MyTransaction == NULL) + error_handler("T1-1: startTranscation", pNDB->getNdbErrorString(), 0); + + NdbOperation *MyOperation = MyTransaction->getNdbOperation(SUBSCRIBER_TABLE); + CHECK_NULL(MyOperation, "T1: getNdbOperation", MyTransaction); + + check = MyOperation->updateTuple(); + CHECK_MINUS_ONE(check, "T1: updateTuple", + MyTransaction); + + check = MyOperation->equal(IND_SUBSCRIBER_NUMBER, + number); + CHECK_MINUS_ONE(check, "T1: equal subscriber", + MyTransaction); + + check = MyOperation->setValue(IND_SUBSCRIBER_LOCATION, + (char *)&new_location); + CHECK_MINUS_ONE(check, "T1: setValue location", + MyTransaction); + + check = MyOperation->setValue(IND_SUBSCRIBER_CHANGED_BY, + changed_by); + CHECK_MINUS_ONE(check, "T1: setValue changed_by", + MyTransaction); + + check = MyOperation->setValue(IND_SUBSCRIBER_CHANGED_TIME, + changed_time); + CHECK_MINUS_ONE(check, "T1: setValue changed_time", + MyTransaction); + + check = MyTransaction->execute( Commit ); + CHECK_MINUS_ONE(check, "T1: Commit", + MyTransaction); + + pNDB->closeTransaction(MyTransaction); + + get_time(transaction_time); + time_diff(transaction_time, &start); + return 0; +} + +/** + * Transaction 2 - T2 + * + * Read from Subscriber: + * + * Input: + * SubscriberNumber + * + * Output: + * Location + * Changed by + * Changed Timestamp + * Name + */ +int +T2(void * obj, + const SubscriberNumber number, + Location * readLocation, + ChangedBy changed_by, + ChangedTime changed_time, + SubscriberName subscriberName, + BenchmarkTime * transaction_time){ + + Ndb * pNDB = (Ndb *) obj; + + DEBUG2("T2(%.*s):\n", SUBSCRIBER_NUMBER_LENGTH, number); + + BenchmarkTime start; + get_time(&start); + + int check; + NdbRecAttr * check2; + + NdbConnection * MyTransaction = pNDB->startTransaction(); + if (MyTransaction == NULL) + error_handler("T2-1: startTranscation", pNDB->getNdbErrorString(), 0); + + NdbOperation *MyOperation= MyTransaction->getNdbOperation(SUBSCRIBER_TABLE); + CHECK_NULL(MyOperation, "T2: getNdbOperation", + MyTransaction); + + + check = MyOperation->readTuple(); + CHECK_MINUS_ONE(check, "T2: readTuple", + MyTransaction); + + check = MyOperation->equal(IND_SUBSCRIBER_NUMBER, + number); + CHECK_MINUS_ONE(check, "T2: equal subscriber", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_LOCATION, + (char *)readLocation); + CHECK_NULL(check2, "T2: getValue location", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_CHANGED_BY, + changed_by); + CHECK_NULL(check2, "T2: getValue changed_by", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_CHANGED_TIME, + changed_time); + CHECK_NULL(check2, "T2: getValue changed_time", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_NAME, + subscriberName); + CHECK_NULL(check2, "T2: getValue name", + MyTransaction); + + check = MyTransaction->execute( Commit ); + CHECK_MINUS_ONE(check, "T2: Commit", + MyTransaction); + + pNDB->closeTransaction(MyTransaction); + + get_time(transaction_time); + time_diff(transaction_time, &start); + return 0; +} + +/** + * Transaction 3 - T3 + * + * Read session details + * + * Input: + * SubscriberNumber + * ServerId + * ServerBit + * + * Output: + * BranchExecuted + * SessionDetails + * ChangedBy + * ChangedTime + * Location + */ +int +T3(void * obj, + const SubscriberNumber inNumber, + const SubscriberSuffix inSuffix, + const ServerId inServerId, + const ServerBit inServerBit, + SessionDetails outSessionDetails, + ChangedBy outChangedBy, + ChangedTime outChangedTime, + Location * outLocation, + BranchExecuted * outBranchExecuted, + BenchmarkTime * outTransactionTime){ + + DEBUG3("T3(%.*s, %.2d): ", SUBSCRIBER_NUMBER_LENGTH, inNumber, inServerId); + + Ndb * pNDB = (Ndb *) obj; + + GroupId groupId; + ActiveSessions sessions; + Permission permission; + + BenchmarkTime start; + get_time(&start); + + int check; + NdbRecAttr * check2; + + NdbConnection * MyTransaction = pNDB->startTransaction(); + if (MyTransaction == NULL) + error_handler("T3-1: startTranscation", pNDB->getNdbErrorString(), 0); + + NdbOperation *MyOperation= MyTransaction->getNdbOperation(SUBSCRIBER_TABLE); + CHECK_NULL(MyOperation, "T3-1: getNdbOperation", + MyTransaction); + + check = MyOperation->readTuple(); + CHECK_MINUS_ONE(check, "T3-1: readTuple", + MyTransaction); + + check = MyOperation->equal(IND_SUBSCRIBER_NUMBER, + inNumber); + CHECK_MINUS_ONE(check, "T3-1: equal subscriber", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_LOCATION, + (char *)outLocation); + CHECK_NULL(check2, "T3-1: getValue location", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_CHANGED_BY, + outChangedBy); + CHECK_NULL(check2, "T3-1: getValue changed_by", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_CHANGED_TIME, + outChangedTime); + CHECK_NULL(check2, "T3-1: getValue changed_time", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_GROUP, + (char *)&groupId); + CHECK_NULL(check2, "T3-1: getValue group", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_SESSIONS, + (char *)&sessions); + CHECK_NULL(check2, "T3-1: getValue sessions", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T3-1: NoCommit", + MyTransaction); + + /* Operation 2 */ + + MyOperation = MyTransaction->getNdbOperation(GROUP_TABLE); + CHECK_NULL(MyOperation, "T3-2: getNdbOperation", + MyTransaction); + + + check = MyOperation->readTuple(); + CHECK_MINUS_ONE(check, "T3-2: readTuple", + MyTransaction); + + check = MyOperation->equal(IND_GROUP_ID, + (char*)&groupId); + CHECK_MINUS_ONE(check, "T3-2: equal group", + MyTransaction); + + check2 = MyOperation->getValue(IND_GROUP_ALLOW_READ, + (char *)&permission); + CHECK_NULL(check2, "T3-2: getValue allow_read", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T3-2: NoCommit", + MyTransaction); + + if(((permission & inServerBit) == inServerBit) && + ((sessions & inServerBit) == inServerBit)){ + + DEBUG("reading - "); + + /* Operation 3 */ + + MyOperation = MyTransaction->getNdbOperation(SESSION_TABLE); + CHECK_NULL(MyOperation, "T3-3: getNdbOperation", + MyTransaction); + + check = MyOperation->readTuple(); + CHECK_MINUS_ONE(check, "T3-3: readTuple", + MyTransaction); + + check = MyOperation->equal(IND_SESSION_SUBSCRIBER, + (char*)inNumber); + CHECK_MINUS_ONE(check, "T3-3: equal number", + MyTransaction); + + check = MyOperation->equal(IND_SESSION_SERVER, + (char*)&inServerId); + CHECK_MINUS_ONE(check, "T3-3: equal server id", + MyTransaction); + + check2 = MyOperation->getValue(IND_SESSION_DATA, + (char *)outSessionDetails); + CHECK_NULL(check2, "T3-3: getValue session details", + MyTransaction); + + /* Operation 4 */ + MyOperation = MyTransaction->getNdbOperation(SERVER_TABLE); + CHECK_NULL(MyOperation, "T3-4: getNdbOperation", + MyTransaction); + + check = MyOperation->interpretedUpdateTuple(); + CHECK_MINUS_ONE(check, "T3-4: interpretedUpdateTuple", + MyTransaction); + + check = MyOperation->equal(IND_SERVER_ID, + (char*)&inServerId); + CHECK_MINUS_ONE(check, "T3-4: equal serverId", + MyTransaction); + + check = MyOperation->equal(IND_SERVER_SUBSCRIBER_SUFFIX, + (char*)inSuffix); + CHECK_MINUS_ONE(check, "T3-4: equal suffix", + MyTransaction); + + check = MyOperation->incValue(IND_SERVER_READS, (uint32)1); + CHECK_MINUS_ONE(check, "T3-4: inc value", + MyTransaction); + (* outBranchExecuted) = 1; + } else { + (* outBranchExecuted) = 0; + } + DEBUG("commit..."); + check = MyTransaction->execute( Commit ); + CHECK_MINUS_ONE(check, "T3: Commit", + MyTransaction); + + pNDB->closeTransaction(MyTransaction); + + DEBUG("done\n"); + get_time(outTransactionTime); + time_diff(outTransactionTime, &start); + return 0; +} + + +/** + * Transaction 4 - T4 + * + * Create session + * + * Input: + * SubscriberNumber + * ServerId + * ServerBit + * SessionDetails, + * DoRollback + * Output: + * ChangedBy + * ChangedTime + * Location + * BranchExecuted + */ +int +T4(void * obj, + const SubscriberNumber inNumber, + const SubscriberSuffix inSuffix, + const ServerId inServerId, + const ServerBit inServerBit, + const SessionDetails inSessionDetails, + ChangedBy outChangedBy, + ChangedTime outChangedTime, + Location * outLocation, + DoRollback inDoRollback, + BranchExecuted * outBranchExecuted, + BenchmarkTime * outTransactionTime){ + + DEBUG3("T4(%.*s, %.2d): ", SUBSCRIBER_NUMBER_LENGTH, inNumber, inServerId); + + Ndb * pNDB = (Ndb *) obj; + + GroupId groupId; + ActiveSessions sessions; + Permission permission; + + BenchmarkTime start; + get_time(&start); + + int check; + NdbRecAttr * check2; + + NdbConnection * MyTransaction = pNDB->startTransaction(); + if (MyTransaction == NULL) + error_handler("T4-1: startTranscation", pNDB->getNdbErrorString(), 0); + + NdbOperation *MyOperation= MyTransaction->getNdbOperation(SUBSCRIBER_TABLE); + CHECK_NULL(MyOperation, "T4-1: getNdbOperation", + MyTransaction); + + check = MyOperation->interpretedUpdateTuple(); + CHECK_MINUS_ONE(check, "T4-1: readTuple", + MyTransaction); + + check = MyOperation->equal(IND_SUBSCRIBER_NUMBER, + inNumber); + CHECK_MINUS_ONE(check, "T4-1: equal subscriber", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_LOCATION, + (char *)outLocation); + CHECK_NULL(check2, "T4-1: getValue location", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_CHANGED_BY, + outChangedBy); + CHECK_NULL(check2, "T4-1: getValue changed_by", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_CHANGED_TIME, + outChangedTime); + CHECK_NULL(check2, "T4-1: getValue changed_time", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_GROUP, + (char *)&groupId); + CHECK_NULL(check2, "T4-1: getValue group", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_SESSIONS, + (char *)&sessions); + CHECK_NULL(check2, "T4-1: getValue sessions", + MyTransaction); + + check = MyOperation->incValue(IND_SUBSCRIBER_SESSIONS, + (uint32)inServerBit); + CHECK_MINUS_ONE(check, "T4-4: inc value", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T4-1: NoCommit", + MyTransaction); + + /* Operation 2 */ + + MyOperation = MyTransaction->getNdbOperation(GROUP_TABLE); + CHECK_NULL(MyOperation, "T4-2: getNdbOperation", + MyTransaction); + + check = MyOperation->readTuple(); + CHECK_MINUS_ONE(check, "T4-2: readTuple", + MyTransaction); + + check = MyOperation->equal(IND_GROUP_ID, + (char*)&groupId); + CHECK_MINUS_ONE(check, "T4-2: equal group", + MyTransaction); + + check2 = MyOperation->getValue(IND_GROUP_ALLOW_INSERT, + (char *)&permission); + CHECK_NULL(check2, "T4-2: getValue allow_insert", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T4-2: NoCommit", + MyTransaction); + + if(((permission & inServerBit) == inServerBit) && + ((sessions & inServerBit) == 0)){ + + DEBUG("inserting - "); + + /* Operation 3 */ + + MyOperation = MyTransaction->getNdbOperation(SESSION_TABLE); + CHECK_NULL(MyOperation, "T4-3: getNdbOperation", + MyTransaction); + + check = MyOperation->insertTuple(); + CHECK_MINUS_ONE(check, "T4-3: insertTuple", + MyTransaction); + + check = MyOperation->equal(IND_SESSION_SUBSCRIBER, + (char*)inNumber); + CHECK_MINUS_ONE(check, "T4-3: equal number", + MyTransaction); + + check = MyOperation->equal(IND_SESSION_SERVER, + (char*)&inServerId); + CHECK_MINUS_ONE(check, "T4-3: equal server id", + MyTransaction); + + check = MyOperation->setValue(SESSION_DATA, + (char *)inSessionDetails); + CHECK_MINUS_ONE(check, "T4-3: setValue session details", + MyTransaction); + + /* Operation 4 */ + + /* Operation 5 */ + MyOperation = MyTransaction->getNdbOperation(SERVER_TABLE); + CHECK_NULL(MyOperation, "T4-5: getNdbOperation", + MyTransaction); + + check = MyOperation->interpretedUpdateTuple(); + CHECK_MINUS_ONE(check, "T4-5: interpretedUpdateTuple", + MyTransaction); + + check = MyOperation->equal(IND_SERVER_ID, + (char*)&inServerId); + CHECK_MINUS_ONE(check, "T4-5: equal serverId", + MyTransaction); + + check = MyOperation->equal(IND_SERVER_SUBSCRIBER_SUFFIX, + (char*)inSuffix); + CHECK_MINUS_ONE(check, "T4-5: equal suffix", + MyTransaction); + + check = MyOperation->incValue(IND_SERVER_INSERTS, (uint32)1); + CHECK_MINUS_ONE(check, "T4-5: inc value", + MyTransaction); + + (* outBranchExecuted) = 1; + } else { + DEBUG1("%s", ((permission & inServerBit) ? "permission - " : "no permission - ")); + DEBUG1("%s", ((sessions & inServerBit) ? "in session - " : "no in session - ")); + (* outBranchExecuted) = 0; + } + + if(!inDoRollback && (* outBranchExecuted)){ + DEBUG("commit\n"); + check = MyTransaction->execute( Commit ); + CHECK_MINUS_ONE(check, "T4: Commit", + MyTransaction); + } else { + DEBUG("rollback\n"); + check = MyTransaction->execute(Rollback); + CHECK_MINUS_ONE(check, "T4:Rollback", + MyTransaction); + + } + + pNDB->closeTransaction(MyTransaction); + + get_time(outTransactionTime); + time_diff(outTransactionTime, &start); + return 0; +} + + +/** + * Transaction 5 - T5 + * + * Delete session + * + * Input: + * SubscriberNumber + * ServerId + * ServerBit + * DoRollback + * Output: + * ChangedBy + * ChangedTime + * Location + * BranchExecuted + */ +int +T5(void * obj, + const SubscriberNumber inNumber, + const SubscriberSuffix inSuffix, + const ServerId inServerId, + const ServerBit inServerBit, + ChangedBy outChangedBy, + ChangedTime outChangedTime, + Location * outLocation, + DoRollback inDoRollback, + BranchExecuted * outBranchExecuted, + BenchmarkTime * outTransactionTime){ + + DEBUG3("T5(%.*s, %.2d): ", SUBSCRIBER_NUMBER_LENGTH, inNumber, inServerId); + + Ndb * pNDB = (Ndb *) obj; + NdbConnection * MyTransaction = 0; + NdbOperation * MyOperation = 0; + + GroupId groupId; + ActiveSessions sessions; + Permission permission; + + BenchmarkTime start; + get_time(&start); + + int check; + NdbRecAttr * check2; + + MyTransaction = pNDB->startTransaction(); + if (MyTransaction == NULL) + error_handler("T5-1: startTranscation", pNDB->getNdbErrorString(), 0); + + MyOperation= MyTransaction->getNdbOperation(SUBSCRIBER_TABLE); + CHECK_NULL(MyOperation, "T5-1: getNdbOperation", + MyTransaction); + + check = MyOperation->interpretedUpdateTuple(); + CHECK_MINUS_ONE(check, "T5-1: readTuple", + MyTransaction); + + check = MyOperation->equal(IND_SUBSCRIBER_NUMBER, + inNumber); + CHECK_MINUS_ONE(check, "T5-1: equal subscriber", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_LOCATION, + (char *)outLocation); + CHECK_NULL(check2, "T5-1: getValue location", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_CHANGED_BY, + outChangedBy); + CHECK_NULL(check2, "T5-1: getValue changed_by", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_CHANGED_TIME, + outChangedTime); + CHECK_NULL(check2, "T5-1: getValue changed_time", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_GROUP, + (char *)&groupId); + CHECK_NULL(check2, "T5-1: getValue group", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_SESSIONS, + (char *)&sessions); + CHECK_NULL(check2, "T5-1: getValue sessions", + MyTransaction); + + check = MyOperation->subValue(IND_SUBSCRIBER_SESSIONS, + (uint32)inServerBit); + CHECK_MINUS_ONE(check, "T5-4: dec value", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T5-1: NoCommit", + MyTransaction); + + /* Operation 2 */ + + MyOperation = MyTransaction->getNdbOperation(GROUP_TABLE); + CHECK_NULL(MyOperation, "T5-2: getNdbOperation", + MyTransaction); + + + check = MyOperation->readTuple(); + CHECK_MINUS_ONE(check, "T5-2: readTuple", + MyTransaction); + + check = MyOperation->equal(IND_GROUP_ID, + (char*)&groupId); + CHECK_MINUS_ONE(check, "T5-2: equal group", + MyTransaction); + + check2 = MyOperation->getValue(IND_GROUP_ALLOW_DELETE, + (char *)&permission); + CHECK_NULL(check2, "T5-2: getValue allow_delete", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T5-2: NoCommit", + MyTransaction); + + if(((permission & inServerBit) == inServerBit) && + ((sessions & inServerBit) == inServerBit)){ + + DEBUG("deleting - "); + + /* Operation 3 */ + MyOperation = MyTransaction->getNdbOperation(SESSION_TABLE); + CHECK_NULL(MyOperation, "T5-3: getNdbOperation", + MyTransaction); + + check = MyOperation->deleteTuple(); + CHECK_MINUS_ONE(check, "T5-3: deleteTuple", + MyTransaction); + + check = MyOperation->equal(IND_SESSION_SUBSCRIBER, + (char*)inNumber); + CHECK_MINUS_ONE(check, "T5-3: equal number", + MyTransaction); + + check = MyOperation->equal(IND_SESSION_SERVER, + (char*)&inServerId); + CHECK_MINUS_ONE(check, "T5-3: equal server id", + MyTransaction); + + /* Operation 4 */ + + /* Operation 5 */ + MyOperation = MyTransaction->getNdbOperation(SERVER_TABLE); + CHECK_NULL(MyOperation, "T5-5: getNdbOperation", + MyTransaction); + + + check = MyOperation->interpretedUpdateTuple(); + CHECK_MINUS_ONE(check, "T5-5: interpretedUpdateTuple", + MyTransaction); + + check = MyOperation->equal(IND_SERVER_ID, + (char*)&inServerId); + CHECK_MINUS_ONE(check, "T5-5: equal serverId", + MyTransaction); + + check = MyOperation->equal(IND_SERVER_SUBSCRIBER_SUFFIX, + (char*)inSuffix); + CHECK_MINUS_ONE(check, "T5-5: equal suffix", + MyTransaction); + + check = MyOperation->incValue(IND_SERVER_DELETES, (uint32)1); + CHECK_MINUS_ONE(check, "T5-5: inc value", + MyTransaction); + + (* outBranchExecuted) = 1; + } else { + DEBUG1("%s", ((permission & inServerBit) ? "permission - " : "no permission - ")); + DEBUG1("%s", ((sessions & inServerBit) ? "in session - " : "no in session - ")); + (* outBranchExecuted) = 0; + } + + if(!inDoRollback && (* outBranchExecuted)){ + DEBUG("commit\n"); + check = MyTransaction->execute( Commit ); + CHECK_MINUS_ONE(check, "T5: Commit", + MyTransaction); + } else { + DEBUG("rollback\n"); + check = MyTransaction->execute(Rollback); + CHECK_MINUS_ONE(check, "T5:Rollback", + MyTransaction); + + } + + pNDB->closeTransaction(MyTransaction); + + get_time(outTransactionTime); + time_diff(outTransactionTime, &start); + return 0; +} + diff --git a/ndb/test/ndbapi/bench/ndb_user_transaction5.cpp b/ndb/test/ndbapi/bench/ndb_user_transaction5.cpp new file mode 100644 index 00000000000..86580008d10 --- /dev/null +++ b/ndb/test/ndbapi/bench/ndb_user_transaction5.cpp @@ -0,0 +1,769 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +//#define DEBUG_ON + +extern "C" { +#include "user_transaction.h" +}; + +#include "macros.h" +#include "ndb_schema.hpp" +#include "ndb_error.hpp" + +#include +#include + +/** + * Transaction 1 - T1 + * + * Update location and changed by/time on a subscriber + * + * Input: + * SubscriberNumber, + * Location, + * ChangedBy, + * ChangedTime + * + * Output: + */ +int +T1(void * obj, + const SubscriberNumber number, + const Location new_location, + const ChangedBy changed_by, + const ChangedTime changed_time, + BenchmarkTime * transaction_time){ + + Ndb * pNDB = (Ndb *) obj; + + DEBUG2("T1(%.*s):\n", SUBSCRIBER_NUMBER_LENGTH, number); + + BenchmarkTime start; + get_time(&start); + + int check; + NdbRecAttr * check2; + + NdbConnection * MyTransaction = pNDB->startTransaction(); + if (MyTransaction == NULL) + error_handler("T1-1: startTranscation", pNDB->getNdbErrorString(), 0); + + NdbOperation *MyOperation = MyTransaction->getNdbOperation(SUBSCRIBER_TABLE); + CHECK_NULL(MyOperation, "T1: getNdbOperation", MyTransaction); + + check = MyOperation->updateTuple(); + CHECK_MINUS_ONE(check, "T1: updateTuple", + MyTransaction); + + check = MyOperation->equal(IND_SUBSCRIBER_NUMBER, + number); + CHECK_MINUS_ONE(check, "T1: equal subscriber", + MyTransaction); + + check = MyOperation->setValue(IND_SUBSCRIBER_LOCATION, + (char *)&new_location); + CHECK_MINUS_ONE(check, "T1: setValue location", + MyTransaction); + + check = MyOperation->setValue(IND_SUBSCRIBER_CHANGED_BY, + changed_by); + CHECK_MINUS_ONE(check, "T1: setValue changed_by", + MyTransaction); + + check = MyOperation->setValue(IND_SUBSCRIBER_CHANGED_TIME, + changed_time); + CHECK_MINUS_ONE(check, "T1: setValue changed_time", + MyTransaction); + + check = MyTransaction->execute( Commit ); + CHECK_MINUS_ONE(check, "T1: Commit", + MyTransaction); + + pNDB->closeTransaction(MyTransaction); + + get_time(transaction_time); + time_diff(transaction_time, &start); + return 0; +} + +/** + * Transaction 2 - T2 + * + * Read from Subscriber: + * + * Input: + * SubscriberNumber + * + * Output: + * Location + * Changed by + * Changed Timestamp + * Name + */ +int +T2(void * obj, + const SubscriberNumber number, + Location * readLocation, + ChangedBy changed_by, + ChangedTime changed_time, + SubscriberName subscriberName, + BenchmarkTime * transaction_time){ + + Ndb * pNDB = (Ndb *) obj; + + DEBUG2("T2(%.*s):\n", SUBSCRIBER_NUMBER_LENGTH, number); + + BenchmarkTime start; + get_time(&start); + + int check; + NdbRecAttr * check2; + + NdbConnection * MyTransaction = pNDB->startTransaction(); + if (MyTransaction == NULL) + error_handler("T2-1: startTranscation", pNDB->getNdbErrorString(), 0); + + NdbOperation *MyOperation= MyTransaction->getNdbOperation(SUBSCRIBER_TABLE); + CHECK_NULL(MyOperation, "T2: getNdbOperation", + MyTransaction); + + + check = MyOperation->readTuple(); + CHECK_MINUS_ONE(check, "T2: readTuple", + MyTransaction); + + check = MyOperation->equal(IND_SUBSCRIBER_NUMBER, + number); + CHECK_MINUS_ONE(check, "T2: equal subscriber", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_LOCATION, + (char *)readLocation); + CHECK_NULL(check2, "T2: getValue location", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_CHANGED_BY, + changed_by); + CHECK_NULL(check2, "T2: getValue changed_by", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_CHANGED_TIME, + changed_time); + CHECK_NULL(check2, "T2: getValue changed_time", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_NAME, + subscriberName); + CHECK_NULL(check2, "T2: getValue name", + MyTransaction); + + check = MyTransaction->execute( Commit ); + CHECK_MINUS_ONE(check, "T2: Commit", + MyTransaction); + + pNDB->closeTransaction(MyTransaction); + + get_time(transaction_time); + time_diff(transaction_time, &start); + return 0; +} + +/** + * Transaction 3 - T3 + * + * Read session details + * + * Input: + * SubscriberNumber + * ServerId + * ServerBit + * + * Output: + * BranchExecuted + * SessionDetails + * ChangedBy + * ChangedTime + * Location + */ +int +T3(void * obj, + const SubscriberNumber inNumber, + const SubscriberSuffix inSuffix, + const ServerId inServerId, + const ServerBit inServerBit, + SessionDetails outSessionDetails, + ChangedBy outChangedBy, + ChangedTime outChangedTime, + Location * outLocation, + BranchExecuted * outBranchExecuted, + BenchmarkTime * outTransactionTime){ + + Ndb * pNDB = (Ndb *) obj; + + GroupId groupId; + ActiveSessions sessions; + Permission permission; + + BenchmarkTime start; + get_time(&start); + + int check; + NdbRecAttr * check2; + + NdbConnection * MyTransaction = pNDB->startTransaction(); + if (MyTransaction == NULL) + error_handler("T3-1: startTranscation", pNDB->getNdbErrorString(), 0); + + NdbOperation *MyOperation= MyTransaction->getNdbOperation(SUBSCRIBER_TABLE); + CHECK_NULL(MyOperation, "T3-1: getNdbOperation", + MyTransaction); + + check = MyOperation->readTuple(); + CHECK_MINUS_ONE(check, "T3-1: readTuple", + MyTransaction); + + check = MyOperation->equal(IND_SUBSCRIBER_NUMBER, + inNumber); + CHECK_MINUS_ONE(check, "T3-1: equal subscriber", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_LOCATION, + (char *)outLocation); + CHECK_NULL(check2, "T3-1: getValue location", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_CHANGED_BY, + outChangedBy); + CHECK_NULL(check2, "T3-1: getValue changed_by", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_CHANGED_TIME, + outChangedTime); + CHECK_NULL(check2, "T3-1: getValue changed_time", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_GROUP, + (char *)&groupId); + CHECK_NULL(check2, "T3-1: getValue group", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_SESSIONS, + (char *)&sessions); + CHECK_NULL(check2, "T3-1: getValue sessions", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T3-1: NoCommit", + MyTransaction); + + /* Operation 2 */ + + MyOperation = MyTransaction->getNdbOperation(GROUP_TABLE); + CHECK_NULL(MyOperation, "T3-2: getNdbOperation", + MyTransaction); + + + check = MyOperation->readTuple(); + CHECK_MINUS_ONE(check, "T3-2: readTuple", + MyTransaction); + + check = MyOperation->equal(IND_GROUP_ID, + (char*)&groupId); + CHECK_MINUS_ONE(check, "T3-2: equal group", + MyTransaction); + + check2 = MyOperation->getValue(IND_GROUP_ALLOW_READ, + (char *)&permission); + CHECK_NULL(check2, "T3-2: getValue allow_read", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T3-2: NoCommit", + MyTransaction); + + DEBUG3("T3(%.*s, %.2d): ", SUBSCRIBER_NUMBER_LENGTH, inNumber, inServerId); + + if(((permission & inServerBit) == inServerBit) && + ((sessions & inServerBit) == inServerBit)){ + + DEBUG("reading - "); + + /* Operation 3 */ + MyOperation = MyTransaction->getNdbOperation(SESSION_TABLE); + CHECK_NULL(MyOperation, "T3-3: getNdbOperation", + MyTransaction); + + check = MyOperation->simpleRead(); + CHECK_MINUS_ONE(check, "T3-3: readTuple", + MyTransaction); + + check = MyOperation->equal(IND_SESSION_SUBSCRIBER, + (char*)inNumber); + CHECK_MINUS_ONE(check, "T3-3: equal number", + MyTransaction); + + check = MyOperation->equal(IND_SESSION_SERVER, + (char*)&inServerId); + CHECK_MINUS_ONE(check, "T3-3: equal server id", + MyTransaction); + + check2 = MyOperation->getValue(IND_SESSION_DATA, + (char *)outSessionDetails); + CHECK_NULL(check2, "T3-3: getValue session details", + MyTransaction); + + /* Operation 4 */ + MyOperation = MyTransaction->getNdbOperation(SERVER_TABLE); + CHECK_NULL(MyOperation, "T3-4: getNdbOperation", + MyTransaction); + + check = MyOperation->interpretedUpdateTuple(); + CHECK_MINUS_ONE(check, "T3-4: interpretedUpdateTuple", + MyTransaction); + + check = MyOperation->equal(IND_SERVER_ID, + (char*)&inServerId); + CHECK_MINUS_ONE(check, "T3-4: equal serverId", + MyTransaction); + + check = MyOperation->equal(IND_SERVER_SUBSCRIBER_SUFFIX, + (char*)inSuffix); + CHECK_MINUS_ONE(check, "T3-4: equal suffix", + MyTransaction); + + check = MyOperation->incValue(IND_SERVER_READS, (uint32)1); + CHECK_MINUS_ONE(check, "T3-4: inc value", + MyTransaction); + (* outBranchExecuted) = 1; + } else { + (* outBranchExecuted) = 0; + } + DEBUG("commit..."); + check = MyTransaction->execute( Commit ); + CHECK_MINUS_ONE(check, "T3: Commit", + MyTransaction); + + pNDB->closeTransaction(MyTransaction); + + DEBUG("done\n"); + get_time(outTransactionTime); + time_diff(outTransactionTime, &start); + return 0; +} + + +/** + * Transaction 4 - T4 + * + * Create session + * + * Input: + * SubscriberNumber + * ServerId + * ServerBit + * SessionDetails, + * DoRollback + * Output: + * ChangedBy + * ChangedTime + * Location + * BranchExecuted + */ +int +T4(void * obj, + const SubscriberNumber inNumber, + const SubscriberSuffix inSuffix, + const ServerId inServerId, + const ServerBit inServerBit, + const SessionDetails inSessionDetails, + ChangedBy outChangedBy, + ChangedTime outChangedTime, + Location * outLocation, + DoRollback inDoRollback, + BranchExecuted * outBranchExecuted, + BenchmarkTime * outTransactionTime){ + + Ndb * pNDB = (Ndb *) obj; + + GroupId groupId; + ActiveSessions sessions; + Permission permission; + + BenchmarkTime start; + get_time(&start); + + int check; + NdbRecAttr * check2; + + NdbConnection * MyTransaction = pNDB->startTransaction(); + if (MyTransaction == NULL) + error_handler("T4-1: startTranscation", pNDB->getNdbErrorString(), 0); + + NdbOperation *MyOperation= MyTransaction->getNdbOperation(SUBSCRIBER_TABLE); + CHECK_NULL(MyOperation, "T4-1: getNdbOperation", + MyTransaction); + + check = MyOperation->interpretedUpdateTuple(); + CHECK_MINUS_ONE(check, "T4-1: readTuple", + MyTransaction); + + check = MyOperation->equal(IND_SUBSCRIBER_NUMBER, + inNumber); + CHECK_MINUS_ONE(check, "T4-1: equal subscriber", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_LOCATION, + (char *)outLocation); + CHECK_NULL(check2, "T4-1: getValue location", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_CHANGED_BY, + outChangedBy); + CHECK_NULL(check2, "T4-1: getValue changed_by", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_CHANGED_TIME, + outChangedTime); + CHECK_NULL(check2, "T4-1: getValue changed_time", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_GROUP, + (char *)&groupId); + CHECK_NULL(check2, "T4-1: getValue group", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_SESSIONS, + (char *)&sessions); + CHECK_NULL(check2, "T4-1: getValue sessions", + MyTransaction); + + check = MyOperation->incValue(IND_SUBSCRIBER_SESSIONS, + (uint32)inServerBit); + CHECK_MINUS_ONE(check, "T4-4: inc value", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T4-1: NoCommit", + MyTransaction); + + /* Operation 2 */ + + MyOperation = MyTransaction->getNdbOperation(GROUP_TABLE); + CHECK_NULL(MyOperation, "T4-2: getNdbOperation", + MyTransaction); + + check = MyOperation->readTuple(); + CHECK_MINUS_ONE(check, "T4-2: readTuple", + MyTransaction); + + check = MyOperation->equal(IND_GROUP_ID, + (char*)&groupId); + CHECK_MINUS_ONE(check, "T4-2: equal group", + MyTransaction); + + check2 = MyOperation->getValue(IND_GROUP_ALLOW_INSERT, + (char *)&permission); + CHECK_NULL(check2, "T4-2: getValue allow_insert", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T4-2: NoCommit", + MyTransaction); + + DEBUG3("T4(%.*s, %.2d): ", SUBSCRIBER_NUMBER_LENGTH, inNumber, inServerId); + + if(((permission & inServerBit) == inServerBit) && + ((sessions & inServerBit) == 0)){ + + DEBUG("inserting - "); + + /* Operation 3 */ + + MyOperation = MyTransaction->getNdbOperation(SESSION_TABLE); + CHECK_NULL(MyOperation, "T4-3: getNdbOperation", + MyTransaction); + + check = MyOperation->insertTuple(); + CHECK_MINUS_ONE(check, "T4-3: insertTuple", + MyTransaction); + + check = MyOperation->equal(IND_SESSION_SUBSCRIBER, + (char*)inNumber); + CHECK_MINUS_ONE(check, "T4-3: equal number", + MyTransaction); + + check = MyOperation->equal(IND_SESSION_SERVER, + (char*)&inServerId); + CHECK_MINUS_ONE(check, "T4-3: equal server id", + MyTransaction); + + check = MyOperation->setValue(SESSION_DATA, + (char *)inSessionDetails); + CHECK_MINUS_ONE(check, "T4-3: setValue session details", + MyTransaction); + + /* Operation 4 */ + + /* Operation 5 */ + MyOperation = MyTransaction->getNdbOperation(SERVER_TABLE); + CHECK_NULL(MyOperation, "T4-5: getNdbOperation", + MyTransaction); + + check = MyOperation->interpretedUpdateTuple(); + CHECK_MINUS_ONE(check, "T4-5: interpretedUpdateTuple", + MyTransaction); + + check = MyOperation->equal(IND_SERVER_ID, + (char*)&inServerId); + CHECK_MINUS_ONE(check, "T4-5: equal serverId", + MyTransaction); + + check = MyOperation->equal(IND_SERVER_SUBSCRIBER_SUFFIX, + (char*)inSuffix); + CHECK_MINUS_ONE(check, "T4-5: equal suffix", + MyTransaction); + + check = MyOperation->incValue(IND_SERVER_INSERTS, (uint32)1); + CHECK_MINUS_ONE(check, "T4-5: inc value", + MyTransaction); + + (* outBranchExecuted) = 1; + } else { + DEBUG1("%s", ((permission & inServerBit) ? "permission - " : "no permission - ")); + DEBUG1("%s", ((sessions & inServerBit) ? "in session - " : "no in session - ")); + (* outBranchExecuted) = 0; + } + + if(!inDoRollback && (* outBranchExecuted)){ + DEBUG("commit\n"); + check = MyTransaction->execute( Commit ); + CHECK_MINUS_ONE(check, "T4: Commit", + MyTransaction); + } else { + DEBUG("rollback\n"); + check = MyTransaction->execute(Rollback); + CHECK_MINUS_ONE(check, "T4:Rollback", + MyTransaction); + + } + + pNDB->closeTransaction(MyTransaction); + + get_time(outTransactionTime); + time_diff(outTransactionTime, &start); + return 0; +} + + +/** + * Transaction 5 - T5 + * + * Delete session + * + * Input: + * SubscriberNumber + * ServerId + * ServerBit + * DoRollback + * Output: + * ChangedBy + * ChangedTime + * Location + * BranchExecuted + */ +int +T5(void * obj, + const SubscriberNumber inNumber, + const SubscriberSuffix inSuffix, + const ServerId inServerId, + const ServerBit inServerBit, + ChangedBy outChangedBy, + ChangedTime outChangedTime, + Location * outLocation, + DoRollback inDoRollback, + BranchExecuted * outBranchExecuted, + BenchmarkTime * outTransactionTime){ + + Ndb * pNDB = (Ndb *) obj; + NdbConnection * MyTransaction = 0; + NdbOperation * MyOperation = 0; + + GroupId groupId; + ActiveSessions sessions; + Permission permission; + + BenchmarkTime start; + get_time(&start); + + int check; + NdbRecAttr * check2; + + MyTransaction = pNDB->startTransaction(); + if (MyTransaction == NULL) + error_handler("T5-1: startTranscation", pNDB->getNdbErrorString(), 0); + + MyOperation= MyTransaction->getNdbOperation(SUBSCRIBER_TABLE); + CHECK_NULL(MyOperation, "T5-1: getNdbOperation", + MyTransaction); + + check = MyOperation->interpretedUpdateTuple(); + CHECK_MINUS_ONE(check, "T5-1: readTuple", + MyTransaction); + + check = MyOperation->equal(IND_SUBSCRIBER_NUMBER, + inNumber); + CHECK_MINUS_ONE(check, "T5-1: equal subscriber", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_LOCATION, + (char *)outLocation); + CHECK_NULL(check2, "T5-1: getValue location", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_CHANGED_BY, + outChangedBy); + CHECK_NULL(check2, "T5-1: getValue changed_by", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_CHANGED_TIME, + outChangedTime); + CHECK_NULL(check2, "T5-1: getValue changed_time", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_GROUP, + (char *)&groupId); + CHECK_NULL(check2, "T5-1: getValue group", + MyTransaction); + + check2 = MyOperation->getValue(IND_SUBSCRIBER_SESSIONS, + (char *)&sessions); + CHECK_NULL(check2, "T5-1: getValue sessions", + MyTransaction); + + check = MyOperation->subValue(IND_SUBSCRIBER_SESSIONS, + (uint32)inServerBit); + CHECK_MINUS_ONE(check, "T5-4: dec value", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T5-1: NoCommit", + MyTransaction); + + /* Operation 2 */ + + MyOperation = MyTransaction->getNdbOperation(GROUP_TABLE); + CHECK_NULL(MyOperation, "T5-2: getNdbOperation", + MyTransaction); + + + check = MyOperation->readTuple(); + CHECK_MINUS_ONE(check, "T5-2: readTuple", + MyTransaction); + + check = MyOperation->equal(IND_GROUP_ID, + (char*)&groupId); + CHECK_MINUS_ONE(check, "T5-2: equal group", + MyTransaction); + + check2 = MyOperation->getValue(IND_GROUP_ALLOW_DELETE, + (char *)&permission); + CHECK_NULL(check2, "T5-2: getValue allow_delete", + MyTransaction); + + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T5-2: NoCommit", + MyTransaction); + + DEBUG3("T5(%.*s, %.2d): ", SUBSCRIBER_NUMBER_LENGTH, inNumber, inServerId); + + if(((permission & inServerBit) == inServerBit) && + ((sessions & inServerBit) == inServerBit)){ + + DEBUG("deleting - "); + + /* Operation 3 */ + MyOperation = MyTransaction->getNdbOperation(SESSION_TABLE); + CHECK_NULL(MyOperation, "T5-3: getNdbOperation", + MyTransaction); + + check = MyOperation->deleteTuple(); + CHECK_MINUS_ONE(check, "T5-3: deleteTuple", + MyTransaction); + + check = MyOperation->equal(IND_SESSION_SUBSCRIBER, + (char*)inNumber); + CHECK_MINUS_ONE(check, "T5-3: equal number", + MyTransaction); + + check = MyOperation->equal(IND_SESSION_SERVER, + (char*)&inServerId); + CHECK_MINUS_ONE(check, "T5-3: equal server id", + MyTransaction); + + /* Operation 4 */ + + /* Operation 5 */ + MyOperation = MyTransaction->getNdbOperation(SERVER_TABLE); + CHECK_NULL(MyOperation, "T5-5: getNdbOperation", + MyTransaction); + + + check = MyOperation->interpretedUpdateTuple(); + CHECK_MINUS_ONE(check, "T5-5: interpretedUpdateTuple", + MyTransaction); + + check = MyOperation->equal(IND_SERVER_ID, + (char*)&inServerId); + CHECK_MINUS_ONE(check, "T5-5: equal serverId", + MyTransaction); + + check = MyOperation->equal(IND_SERVER_SUBSCRIBER_SUFFIX, + (char*)inSuffix); + CHECK_MINUS_ONE(check, "T5-5: equal suffix", + MyTransaction); + + check = MyOperation->incValue(IND_SERVER_DELETES, (uint32)1); + CHECK_MINUS_ONE(check, "T5-5: inc value", + MyTransaction); + + (* outBranchExecuted) = 1; + } else { + DEBUG1("%s", ((permission & inServerBit) ? "permission - " : "no permission - ")); + DEBUG1("%s", ((sessions & inServerBit) ? "in session - " : "no in session - ")); + (* outBranchExecuted) = 0; + } + + if(!inDoRollback && (* outBranchExecuted)){ + DEBUG("commit\n"); + check = MyTransaction->execute( Commit ); + CHECK_MINUS_ONE(check, "T5: Commit", + MyTransaction); + } else { + DEBUG("rollback\n"); + check = MyTransaction->execute(Rollback); + CHECK_MINUS_ONE(check, "T5:Rollback", + MyTransaction); + + } + + pNDB->closeTransaction(MyTransaction); + + get_time(outTransactionTime); + time_diff(outTransactionTime, &start); + return 0; +} + diff --git a/ndb/test/ndbapi/bench/ndb_user_transaction6.cpp b/ndb/test/ndbapi/bench/ndb_user_transaction6.cpp new file mode 100644 index 00000000000..262f38e9ffb --- /dev/null +++ b/ndb/test/ndbapi/bench/ndb_user_transaction6.cpp @@ -0,0 +1,561 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +//#define DEBUG_ON + +#include +#include "userHandle.h" +#include "userInterface.h" + +#include "macros.h" +#include "ndb_schema.hpp" +#include "ndb_error.hpp" + +#include + + +void +userCheckpoint(UserHandle *uh){ +} + +inline +NdbConnection * +startTransaction(Ndb * pNDB, ServerId inServerId, const SubscriberNumber inNumber){ + + const int keyDataLenBytes = sizeof(ServerId)+SUBSCRIBER_NUMBER_LENGTH; + const int keyDataLen_64Words = keyDataLenBytes >> 3; + + Uint64 keyDataBuf[keyDataLen_64Words+1]; // The "+1" is for rounding... + + char * keyDataBuf_charP = (char *)&keyDataBuf[0]; + Uint32 * keyDataBuf_wo32P = (Uint32 *)&keyDataBuf[0]; + + // Server Id comes first + keyDataBuf_wo32P[0] = inServerId; + // Then subscriber number + memcpy(&keyDataBuf_charP[sizeof(ServerId)], inNumber, SUBSCRIBER_NUMBER_LENGTH); + + return pNDB->startTransaction(0, keyDataBuf_charP, keyDataLenBytes); +} + +/** + * Transaction 1 - T1 + * + * Update location and changed by/time on a subscriber + * + * Input: + * SubscriberNumber, + * Location, + * ChangedBy, + * ChangedTime + * + * Output: + */ +void +userTransaction_T1(UserHandle * uh, + SubscriberNumber number, + Location new_location, + ChangedBy changed_by, + ChangedTime changed_time){ + Ndb * pNDB = uh->pNDB; + + DEBUG2("T1(%.*s):\n", SUBSCRIBER_NUMBER_LENGTH, number); + + int check; + NdbRecAttr * check2; + + NdbConnection * MyTransaction = pNDB->startTransaction(); + if (MyTransaction != NULL) { + NdbOperation *MyOperation = MyTransaction->getNdbOperation(SUBSCRIBER_TABLE); + if (MyOperation != NULL) { + MyOperation->updateTuple(); + MyOperation->equal(IND_SUBSCRIBER_NUMBER, + number); + MyOperation->setValue(IND_SUBSCRIBER_LOCATION, + (char *)&new_location); + MyOperation->setValue(IND_SUBSCRIBER_CHANGED_BY, + changed_by); + MyOperation->setValue(IND_SUBSCRIBER_CHANGED_TIME, + changed_time); + check = MyTransaction->execute( Commit ); + if (check != -1) { + pNDB->closeTransaction(MyTransaction); + return; + } else { + CHECK_MINUS_ONE(check, "T1: Commit", + MyTransaction); + }//if + } else { + CHECK_NULL(MyOperation, "T1: getNdbOperation", MyTransaction); + }//if + } else { + error_handler("T1-1: startTranscation", pNDB->getNdbErrorString(), pNDB->getNdbError()); + }//if +} + +/** + * Transaction 2 - T2 + * + * Read from Subscriber: + * + * Input: + * SubscriberNumber + * + * Output: + * Location + * Changed by + * Changed Timestamp + * Name + */ +void +userTransaction_T2(UserHandle * uh, + SubscriberNumber number, + Location * readLocation, + ChangedBy changed_by, + ChangedTime changed_time, + SubscriberName subscriberName){ + Ndb * pNDB = uh->pNDB; + + DEBUG2("T2(%.*s):\n", SUBSCRIBER_NUMBER_LENGTH, number); + + int check; + NdbRecAttr * check2; + + NdbConnection * MyTransaction = pNDB->startTransaction(); + if (MyTransaction == NULL) + error_handler("T2-1: startTransaction", pNDB->getNdbErrorString(), pNDB->getNdbError()); + + NdbOperation *MyOperation= MyTransaction->getNdbOperation(SUBSCRIBER_TABLE); + CHECK_NULL(MyOperation, "T2: getNdbOperation", + MyTransaction); + + MyOperation->readTuple(); + MyOperation->equal(IND_SUBSCRIBER_NUMBER, + number); + MyOperation->getValue(IND_SUBSCRIBER_LOCATION, + (char *)readLocation); + MyOperation->getValue(IND_SUBSCRIBER_CHANGED_BY, + changed_by); + MyOperation->getValue(IND_SUBSCRIBER_CHANGED_TIME, + changed_time); + MyOperation->getValue(IND_SUBSCRIBER_NAME, + subscriberName); + check = MyTransaction->execute( Commit ); + CHECK_MINUS_ONE(check, "T2: Commit", + MyTransaction); + pNDB->closeTransaction(MyTransaction); +} + +/** + * Transaction 3 - T3 + * + * Read session details + * + * Input: + * SubscriberNumber + * ServerId + * ServerBit + * + * Output: + * BranchExecuted + * SessionDetails + * ChangedBy + * ChangedTime + * Location + */ +void +userTransaction_T3(UserHandle * uh, + SubscriberNumber inNumber, + ServerId inServerId, + ServerBit inServerBit, + SessionDetails outSessionDetails, + BranchExecuted * outBranchExecuted){ + Ndb * pNDB = uh->pNDB; + + char outChangedBy [sizeof(ChangedBy) +(4-(sizeof(ChangedBy) & 3))]; + char outChangedTime [sizeof(ChangedTime)+(4-(sizeof(ChangedTime) & 3))]; + Location outLocation; + GroupId groupId; + ActiveSessions sessions; + Permission permission; + SubscriberSuffix inSuffix; + + DEBUG3("T3(%.*s, %.2d): ", SUBSCRIBER_NUMBER_LENGTH, inNumber, inServerId); + + int check; + NdbRecAttr * check2; + + NdbConnection * MyTransaction = startTransaction(pNDB, inServerId, inNumber); + if (MyTransaction == NULL) + error_handler("T3-1: startTranscation", pNDB->getNdbErrorString(), pNDB->getNdbError()); + + NdbOperation *MyOperation= MyTransaction->getNdbOperation(SUBSCRIBER_TABLE); + CHECK_NULL(MyOperation, "T3-1: getNdbOperation", + MyTransaction); + + MyOperation->readTuple(); + MyOperation->equal(IND_SUBSCRIBER_NUMBER, + inNumber); + MyOperation->getValue(IND_SUBSCRIBER_LOCATION, + (char *)&outLocation); + MyOperation->getValue(IND_SUBSCRIBER_CHANGED_BY, + outChangedBy); + MyOperation->getValue(IND_SUBSCRIBER_CHANGED_TIME, + outChangedTime); + MyOperation->getValue(IND_SUBSCRIBER_GROUP, + (char *)&groupId); + MyOperation->getValue(IND_SUBSCRIBER_SESSIONS, + (char *)&sessions); + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T3-1: NoCommit", + MyTransaction); + + /* Operation 2 */ + + MyOperation = MyTransaction->getNdbOperation(GROUP_TABLE); + CHECK_NULL(MyOperation, "T3-2: getNdbOperation", + MyTransaction); + + + MyOperation->readTuple(); + MyOperation->equal(IND_GROUP_ID, + (char*)&groupId); + MyOperation->getValue(IND_GROUP_ALLOW_READ, + (char *)&permission); + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T3-2: NoCommit", + MyTransaction); + + if(((permission & inServerBit) == inServerBit) && + ((sessions & inServerBit) == inServerBit)){ + + memcpy(inSuffix, + &inNumber[SUBSCRIBER_NUMBER_LENGTH-SUBSCRIBER_NUMBER_SUFFIX_LENGTH], SUBSCRIBER_NUMBER_SUFFIX_LENGTH); + DEBUG2("reading(%.*s) - ", SUBSCRIBER_NUMBER_SUFFIX_LENGTH, inSuffix); + + /* Operation 3 */ + MyOperation = MyTransaction->getNdbOperation(SESSION_TABLE); + CHECK_NULL(MyOperation, "T3-3: getNdbOperation", + MyTransaction); + + MyOperation->simpleRead(); + + MyOperation->equal(IND_SESSION_SUBSCRIBER, + (char*)inNumber); + MyOperation->equal(IND_SESSION_SERVER, + (char*)&inServerId); + MyOperation->getValue(IND_SESSION_DATA, + (char *)outSessionDetails); + /* Operation 4 */ + MyOperation = MyTransaction->getNdbOperation(SERVER_TABLE); + CHECK_NULL(MyOperation, "T3-4: getNdbOperation", + MyTransaction); + + MyOperation->interpretedUpdateTuple(); + MyOperation->equal(IND_SERVER_ID, + (char*)&inServerId); + MyOperation->equal(IND_SERVER_SUBSCRIBER_SUFFIX, + (char*)inSuffix); + MyOperation->incValue(IND_SERVER_READS, (uint32)1); + (* outBranchExecuted) = 1; + } else { + (* outBranchExecuted) = 0; + } + DEBUG("commit..."); + check = MyTransaction->execute( Commit ); + CHECK_MINUS_ONE(check, "T3: Commit", + MyTransaction); + + pNDB->closeTransaction(MyTransaction); + + DEBUG("done\n"); +} + + +/** + * Transaction 4 - T4 + * + * Create session + * + * Input: + * SubscriberNumber + * ServerId + * ServerBit + * SessionDetails, + * DoRollback + * Output: + * ChangedBy + * ChangedTime + * Location + * BranchExecuted + */ +void +userTransaction_T4(UserHandle * uh, + SubscriberNumber inNumber, + ServerId inServerId, + ServerBit inServerBit, + SessionDetails inSessionDetails, + DoRollback inDoRollback, + BranchExecuted * outBranchExecuted){ + + Ndb * pNDB = uh->pNDB; + + char outChangedBy [sizeof(ChangedBy) +(4-(sizeof(ChangedBy) & 3))]; + char outChangedTime [sizeof(ChangedTime)+(4-(sizeof(ChangedTime) & 3))]; + Location outLocation; + GroupId groupId; + ActiveSessions sessions; + Permission permission; + SubscriberSuffix inSuffix; + + DEBUG3("T4(%.*s, %.2d): ", SUBSCRIBER_NUMBER_LENGTH, inNumber, inServerId); + + int check; + NdbRecAttr * check2; + + NdbConnection * MyTransaction = startTransaction(pNDB, inServerId, inNumber); + if (MyTransaction == NULL) + error_handler("T4-1: startTranscation", pNDB->getNdbErrorString(), pNDB->getNdbError()); + + NdbOperation *MyOperation= MyTransaction->getNdbOperation(SUBSCRIBER_TABLE); + CHECK_NULL(MyOperation, "T4-1: getNdbOperation", + MyTransaction); + + MyOperation->interpretedUpdateTuple(); + MyOperation->equal(IND_SUBSCRIBER_NUMBER, + inNumber); + MyOperation->getValue(IND_SUBSCRIBER_LOCATION, + (char *)&outLocation); + MyOperation->getValue(IND_SUBSCRIBER_CHANGED_BY, + outChangedBy); + MyOperation->getValue(IND_SUBSCRIBER_CHANGED_TIME, + outChangedTime); + MyOperation->getValue(IND_SUBSCRIBER_GROUP, + (char *)&groupId); + MyOperation->getValue(IND_SUBSCRIBER_SESSIONS, + (char *)&sessions); + MyOperation->incValue(IND_SUBSCRIBER_SESSIONS, + (uint32)inServerBit); + check = MyTransaction->execute( NoCommit ); + + /* Operation 2 */ + + MyOperation = MyTransaction->getNdbOperation(GROUP_TABLE); + CHECK_NULL(MyOperation, "T4-2: getNdbOperation", + MyTransaction); + + MyOperation->readTuple(); + MyOperation->equal(IND_GROUP_ID, + (char*)&groupId); + MyOperation->getValue(IND_GROUP_ALLOW_INSERT, + (char *)&permission); + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T4-2: NoCommit", + MyTransaction); + + if(((permission & inServerBit) == inServerBit) && + ((sessions & inServerBit) == 0)){ + + memcpy(inSuffix, + &inNumber[SUBSCRIBER_NUMBER_LENGTH-SUBSCRIBER_NUMBER_SUFFIX_LENGTH], SUBSCRIBER_NUMBER_SUFFIX_LENGTH); + + DEBUG2("inserting(%.*s) - ", SUBSCRIBER_NUMBER_SUFFIX_LENGTH, inSuffix); + + /* Operation 3 */ + + MyOperation = MyTransaction->getNdbOperation(SESSION_TABLE); + CHECK_NULL(MyOperation, "T4-3: getNdbOperation", + MyTransaction); + + MyOperation->insertTuple(); + MyOperation->equal(IND_SESSION_SUBSCRIBER, + (char*)inNumber); + MyOperation->equal(IND_SESSION_SERVER, + (char*)&inServerId); + MyOperation->setValue(SESSION_DATA, + (char *)inSessionDetails); + /* Operation 4 */ + + /* Operation 5 */ + MyOperation = MyTransaction->getNdbOperation(SERVER_TABLE); + CHECK_NULL(MyOperation, "T4-5: getNdbOperation", + MyTransaction); + + MyOperation->interpretedUpdateTuple(); + MyOperation->equal(IND_SERVER_ID, + (char*)&inServerId); + MyOperation->equal(IND_SERVER_SUBSCRIBER_SUFFIX, + (char*)inSuffix); + MyOperation->incValue(IND_SERVER_INSERTS, (uint32)1); + (* outBranchExecuted) = 1; + } else { + (* outBranchExecuted) = 0; + DEBUG1("%s", ((permission & inServerBit) ? "permission - " : "no permission - ")); + DEBUG1("%s", ((sessions & inServerBit) ? "in session - " : "no in session - ")); + } + + if(!inDoRollback && (* outBranchExecuted)){ + DEBUG("commit\n"); + check = MyTransaction->execute( Commit ); + CHECK_MINUS_ONE(check, "T4: Commit", + MyTransaction); + } else { + DEBUG("rollback\n"); + check = MyTransaction->execute(Rollback); + CHECK_MINUS_ONE(check, "T4:Rollback", + MyTransaction); + + } + + pNDB->closeTransaction(MyTransaction); +} + + +/** + * Transaction 5 - T5 + * + * Delete session + * + * Input: + * SubscriberNumber + * ServerId + * ServerBit + * DoRollback + * Output: + * ChangedBy + * ChangedTime + * Location + * BranchExecuted + */ +void +userTransaction_T5(UserHandle * uh, + SubscriberNumber inNumber, + ServerId inServerId, + ServerBit inServerBit, + DoRollback inDoRollback, + BranchExecuted * outBranchExecuted){ + Ndb * pNDB = uh->pNDB; + + DEBUG3("T5(%.*s, %.2d): ", SUBSCRIBER_NUMBER_LENGTH, inNumber, inServerId); + + NdbConnection * MyTransaction = 0; + NdbOperation * MyOperation = 0; + + char outChangedBy [sizeof(ChangedBy) +(4-(sizeof(ChangedBy) & 3))]; + char outChangedTime [sizeof(ChangedTime)+(4-(sizeof(ChangedTime) & 3))]; + Location outLocation; + GroupId groupId; + ActiveSessions sessions; + Permission permission; + SubscriberSuffix inSuffix; + + int check; + NdbRecAttr * check2; + + MyTransaction = pNDB->startTransaction(); + if (MyTransaction == NULL) + error_handler("T5-1: startTranscation", pNDB->getNdbErrorString(), pNDB->getNdbError()); + + MyOperation= MyTransaction->getNdbOperation(SUBSCRIBER_TABLE); + CHECK_NULL(MyOperation, "T5-1: getNdbOperation", + MyTransaction); + + MyOperation->interpretedUpdateTuple(); + MyOperation->equal(IND_SUBSCRIBER_NUMBER, + inNumber); + MyOperation->getValue(IND_SUBSCRIBER_LOCATION, + (char *)&outLocation); + MyOperation->getValue(IND_SUBSCRIBER_CHANGED_BY, + &outChangedBy[0]); + MyOperation->getValue(IND_SUBSCRIBER_CHANGED_TIME, + &outChangedTime[0]); + MyOperation->getValue(IND_SUBSCRIBER_GROUP, + (char *)&groupId); + MyOperation->getValue(IND_SUBSCRIBER_SESSIONS, + (char *)&sessions); + MyOperation->subValue(IND_SUBSCRIBER_SESSIONS, + (uint32)inServerBit); + MyTransaction->execute( NoCommit ); + /* Operation 2 */ + + MyOperation = MyTransaction->getNdbOperation(GROUP_TABLE); + CHECK_NULL(MyOperation, "T5-2: getNdbOperation", + MyTransaction); + + MyOperation->readTuple(); + MyOperation->equal(IND_GROUP_ID, + (char*)&groupId); + MyOperation->getValue(IND_GROUP_ALLOW_DELETE, + (char *)&permission); + check = MyTransaction->execute( NoCommit ); + CHECK_MINUS_ONE(check, "T5-2: NoCommit", + MyTransaction); + + if(((permission & inServerBit) == inServerBit) && + ((sessions & inServerBit) == inServerBit)){ + + memcpy(inSuffix, + &inNumber[SUBSCRIBER_NUMBER_LENGTH-SUBSCRIBER_NUMBER_SUFFIX_LENGTH], SUBSCRIBER_NUMBER_SUFFIX_LENGTH); + + DEBUG2("deleting(%.*s) - ", SUBSCRIBER_NUMBER_SUFFIX_LENGTH, inSuffix); + + /* Operation 3 */ + MyOperation = MyTransaction->getNdbOperation(SESSION_TABLE); + CHECK_NULL(MyOperation, "T5-3: getNdbOperation", + MyTransaction); + + MyOperation->deleteTuple(); + MyOperation->equal(IND_SESSION_SUBSCRIBER, + (char*)inNumber); + MyOperation->equal(IND_SESSION_SERVER, + (char*)&inServerId); + /* Operation 4 */ + + /* Operation 5 */ + MyOperation = MyTransaction->getNdbOperation(SERVER_TABLE); + CHECK_NULL(MyOperation, "T5-5: getNdbOperation", + MyTransaction); + + + MyOperation->interpretedUpdateTuple(); + MyOperation->equal(IND_SERVER_ID, + (char*)&inServerId); + MyOperation->equal(IND_SERVER_SUBSCRIBER_SUFFIX, + (char*)inSuffix); + MyOperation->incValue(IND_SERVER_DELETES, (uint32)1); + (* outBranchExecuted) = 1; + } else { + (* outBranchExecuted) = 0; + DEBUG1("%s", ((permission & inServerBit) ? "permission - " : "no permission - ")); + DEBUG1("%s", ((sessions & inServerBit) ? "in session - " : "no in session - ")); + } + + if(!inDoRollback && (* outBranchExecuted)){ + DEBUG("commit\n"); + check = MyTransaction->execute( Commit ); + CHECK_MINUS_ONE(check, "T5: Commit", + MyTransaction); + } else { + DEBUG("rollback\n"); + check = MyTransaction->execute(Rollback); + CHECK_MINUS_ONE(check, "T5:Rollback", + MyTransaction); + + } + + pNDB->closeTransaction(MyTransaction); +} + diff --git a/ndb/test/ndbapi/bench/testData.h b/ndb/test/ndbapi/bench/testData.h new file mode 100644 index 00000000000..3db85e7342e --- /dev/null +++ b/ndb/test/ndbapi/bench/testData.h @@ -0,0 +1,156 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef TESTDATA_H +#define TESTDATA_H + +/*************************************************************** +* I N C L U D E D F I L E S * +***************************************************************/ +#include +#include +#include +#include +#include "testDefinitions.h" + +/*************************************************************** +* M A C R O S * +***************************************************************/ + +/***************************************************************/ +/* C O N S T A N T S */ +/***************************************************************/ + +#define NUM_TRANSACTION_TYPES 5 +#define SESSION_LIST_LENGTH 1000 + +/*************************************************************** +* D A T A S T R U C T U R E S * +***************************************************************/ + +typedef struct { + SubscriberNumber subscriberNumber; + ServerId serverId; +} SessionElement; + +typedef struct { + SessionElement list[SESSION_LIST_LENGTH]; + unsigned int readIndex; + unsigned int writeIndex; + unsigned int numberInList; +} SessionList; + +typedef struct { + unsigned int count; + unsigned int branchExecuted; + unsigned int rollbackExecuted; + + /** + * Latency measures + */ + NDB_TICKS startTime; + NDBT_Stats latency; + unsigned int latencyCounter; + + inline void startLatency(){ + if((latencyCounter & 127) == 127) + startTime = NdbTick_CurrentMillisecond(); + } + + inline void stopLatency(){ + if((latencyCounter & 127) == 127){ + const NDB_TICKS tmp = NdbTick_CurrentMillisecond() - startTime; + latency.addObservation(tmp); + } + latencyCounter++; + } +} TransactionDefinition; + +typedef struct { + RandomSequence transactionSequence; + RandomSequence rollbackSequenceT4; + RandomSequence rollbackSequenceT5; + + TransactionDefinition transactions[NUM_TRANSACTION_TYPES]; + + unsigned int totalTransactions; + + double outerLoopTime; + double outerTps; + + SessionList activeSessions; + +} GeneratorStatistics; + +typedef enum{ + Runnable, + Running +} RunState ; + +typedef struct { + SubscriberNumber number; + SubscriberSuffix suffix; + SubscriberName name; + Location location; + ChangedBy changed_by; + ChangedTime changed_time; + ServerId server_id; + ServerBit server_bit; + SessionDetails session_details; + + GroupId group_id; + ActiveSessions sessions; + Permission permission; + + unsigned int do_rollback; + + unsigned int branchExecuted; + unsigned int sessionElement; +} TransactionData ; + +typedef struct { + struct NdbThread* pThread; + + unsigned long randomSeed; + unsigned long changedTime; + + unsigned int warmUpSeconds; + unsigned int testSeconds; + unsigned int coolDownSeconds; + + GeneratorStatistics generator; + + /** + * For async execution + */ + RunState runState; + double startTime; + TransactionData transactionData; + struct Ndb * pNDB; +} ThreadData; + +/*************************************************************** + * P U B L I C F U N C T I O N S * + ***************************************************************/ + +/*************************************************************** + * E X T E R N A L D A T A * + ***************************************************************/ + + + +#endif /* TESTDATA_H */ + diff --git a/ndb/test/ndbapi/bench/testDefinitions.h b/ndb/test/ndbapi/bench/testDefinitions.h new file mode 100644 index 00000000000..2f4aeb30975 --- /dev/null +++ b/ndb/test/ndbapi/bench/testDefinitions.h @@ -0,0 +1,90 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef TESTDEFINITIONS_H +#define TESTDEFINITIONS_H + +/***************************************************************/ +/* I N C L U D E D F I L E S */ +/***************************************************************/ + +#include + +/***************************************************************/ +/* C O N S T A N T S */ +/***************************************************************/ + +#define OP_PER_TRANS 200 +#define NO_OF_SUBSCRIBERS 500000 +#define NO_OF_GROUPS 100 +#define NO_OF_SERVERS 20 + +#define SUBSCRIBER_NUMBER_LENGTH 12 +#define SUBSCRIBER_NUMBER_SUFFIX_LENGTH 2 + +#define SUBSCRIBER_NAME_LENGTH 32 +#define CHANGED_BY_LENGTH 32 +#define CHANGED_TIME_LENGTH 32 +#define SESSION_DETAILS_LENGTH 2000 +#define SERVER_NAME_LENGTH 32 +#define GROUP_NAME_LENGTH 32 + +/*************************************************************** +* D A T A S T R U C T U R E S * +***************************************************************/ + +#define PADDING 4 + +typedef char SubscriberNumber[SUBSCRIBER_NUMBER_LENGTH]; +typedef char SubscriberSuffix[SUBSCRIBER_NUMBER_SUFFIX_LENGTH + 2]; +typedef char SubscriberName[SUBSCRIBER_NAME_LENGTH]; +typedef char ServerName[SERVER_NAME_LENGTH]; +typedef char GroupName[GROUP_NAME_LENGTH]; +typedef char ChangedBy[CHANGED_BY_LENGTH]; +typedef char ChangedTime[CHANGED_TIME_LENGTH]; +typedef char SessionDetails[SESSION_DETAILS_LENGTH]; +typedef Uint32 ServerId; +typedef Uint32 ServerBit; +typedef Uint32 GroupId; +typedef Uint32 Location; +typedef Uint32 Permission; + +typedef Uint32 Counter; +typedef Uint32 ActiveSessions; +typedef unsigned int BranchExecuted; +typedef unsigned int DoRollback; + +/*************************************************************** +* P U B L I C F U N C T I O N S * +***************************************************************/ + +#ifdef __cplusplus +extern "C" { +#endif + + +#ifdef __cplusplus +} +#endif + +/*************************************************************** +* E X T E R N A L D A T A * +***************************************************************/ + + + +#endif /* TESTDEFINITIONS_H */ + diff --git a/ndb/test/ndbapi/bench/userInterface.cpp b/ndb/test/ndbapi/bench/userInterface.cpp new file mode 100644 index 00000000000..128d20dc9bb --- /dev/null +++ b/ndb/test/ndbapi/bench/userInterface.cpp @@ -0,0 +1,745 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/*************************************************************** +* I N C L U D E D F I L E S * +***************************************************************/ + +#include +#ifndef NDB_WIN32 +#include +#endif + +#include "ndb_error.hpp" +#include "userInterface.h" +#include +#include +#include +#include +#include "ndb_schema.hpp" +#include +#include + +/*************************************************************** +* L O C A L C O N S T A N T S * +***************************************************************/ + +/*************************************************************** +* L O C A L D A T A S T R U C T U R E S * +***************************************************************/ + +/*************************************************************** +* L O C A L F U N C T I O N S * +***************************************************************/ + +extern int localDbPrepare(UserHandle *uh); + +static int dbCreate(UserHandle *uh); + +/*************************************************************** +* L O C A L D A T A * +***************************************************************/ + +/*************************************************************** +* P U B L I C D A T A * +***************************************************************/ + + +/*************************************************************** +**************************************************************** +* L O C A L F U N C T I O N S C O D E S E C T I O N * +**************************************************************** +***************************************************************/ + +/*************************************************************** +**************************************************************** +* P U B L I C F U N C T I O N S C O D E S E C T I O N * +**************************************************************** +***************************************************************/ + +/*-----------------------------------*/ +/* Time related Functions */ +/* */ +/* Returns a double value in seconds */ +/*-----------------------------------*/ +double userGetTimeSync(void) +{ + static int initialized = 0; + static NDB_TICKS initSecs = 0; + static Uint32 initMicros = 0; + double timeValue = 0; + + if ( !initialized ) { + initialized = 1; + NdbTick_CurrentMicrosecond(&initSecs, &initMicros); + timeValue = 0.0; + } else { + NDB_TICKS secs = 0; + Uint32 micros = 0; + + NdbTick_CurrentMicrosecond(&secs, µs); + + double s = (double)secs - (double)initSecs; + double us = (double)secs - (double)initMicros; + + timeValue = s + (us / 1000000.0); + } + + return timeValue; +} + +// 0 - OK +// 1 - Retry transaction +// 2 - Permanent +int +userDbCommit(UserHandle *uh){ + if(uh->pCurrTrans != 0){ + int check = uh->pCurrTrans->execute( Commit ); + NdbError err = uh->pCurrTrans->getNdbError(); + uh->pNDB->closeTransaction(uh->pCurrTrans); + uh->pCurrTrans = 0; + + if(err.status != NdbError::Success) + ndbout << err << endl; + + if(err.status == NdbError::TemporaryError && + err.classification == NdbError::OverloadError){ + NdbSleep_SecSleep(3); + } + + return err.status; + } + return 2; +} + +/** + * TRUE - Normal table + * FALSE - Table w.o. checkpoing and logging + */ + +#ifdef __cplusplus +extern "C" { +#endif +extern int useTableLogging; +extern int useIndexTables; +#ifdef __cplusplus +} +#endif + + +int +create_table_server(Ndb * pNdb){ + int check; + NdbSchemaCon * MySchemaTransaction = NdbSchemaCon::startSchemaTrans(pNdb); + if( MySchemaTransaction == NULL ) + error_handler("startSchemaTransaction", pNdb->getNdbError(), 0); + + NdbSchemaOp * MySchemaOp = MySchemaTransaction->getNdbSchemaOp(); + if( MySchemaOp == NULL ) + error_handler("getNdbSchemaOp", MySchemaTransaction->getNdbError(), 0); + + // Create table + check = MySchemaOp->createTable( SERVER_TABLE, + 8, // Table size + TupleKey, // Key Type + 1 // Nr of Pages + ,DistributionGroup, + 6, + 78, + 80, + 1, + useTableLogging + ); + if( check == -1 ) + error_handler("createTable", MySchemaTransaction->getNdbError(), 0); + + check = MySchemaOp->createAttribute + ( SERVER_SUBSCRIBER_SUFFIX, + TupleKey, + sizeof(char) << 3, + SUBSCRIBER_NUMBER_SUFFIX_LENGTH, + String, + MMBased, + NotNullAttribute, + NormalStorageAttribute, + 0, + 1, + 16); + if( check == -1 ) + error_handler("createAttribute (subscriber suffix)", + MySchemaTransaction->getNdbError(), 0); + + // Create first column, primary key + check = MySchemaOp->createAttribute( SERVER_ID, + TupleKey, + sizeof(ServerId) << 3, + 1, + UnSigned, + MMBased, + NotNullAttribute ); + if( check == -1 ) + error_handler("createAttribute (serverid)", + MySchemaTransaction->getNdbError(), 0); + + + check = MySchemaOp->createAttribute( SERVER_NAME, + NoKey, + sizeof(char) << 3, + SERVER_NAME_LENGTH, + String, + MMBased, + NotNullAttribute ); + if( check == -1 ) + error_handler("createAttribute (server name)", + MySchemaTransaction->getNdbError(), 0); + + + check = MySchemaOp->createAttribute( SERVER_READS, + NoKey, + sizeof(Counter) << 3, + 1, + UnSigned, + MMBased, + NotNullAttribute ); + if( check == -1 ) + error_handler("createAttribute (server reads)", + MySchemaTransaction->getNdbError(), 0); + + check = MySchemaOp->createAttribute( SERVER_INSERTS, + NoKey, + sizeof(Counter) << 3, + 1, + UnSigned, + MMBased, + NotNullAttribute ); + if( check == -1 ) + error_handler("createAttribute (server inserts)", + MySchemaTransaction->getNdbError(), 0); + + check = MySchemaOp->createAttribute( SERVER_DELETES, + NoKey, + sizeof(Counter) << 3, + 1, + UnSigned, + MMBased, + NotNullAttribute ); + if( check == -1 ) + error_handler("createAttribute (server deletes)", + MySchemaTransaction->getNdbError(), 0); + + if( MySchemaTransaction->execute() == -1 ) { + error_handler("schemaTransaction->execute()", + MySchemaTransaction->getNdbError(), 0); + } + NdbSchemaCon::closeSchemaTrans(MySchemaTransaction); + return 0; +} + +int +create_table_group(Ndb * pNdb){ + int check; + + NdbSchemaCon * MySchemaTransaction = NdbSchemaCon::startSchemaTrans(pNdb); + if( MySchemaTransaction == NULL ) + error_handler("startSchemaTransaction", pNdb->getNdbError(), 0); + + NdbSchemaOp * MySchemaOp = MySchemaTransaction->getNdbSchemaOp(); + if( MySchemaOp == NULL ) + error_handler("getNdbSchemaOp", MySchemaTransaction->getNdbError(), 0); + + // Create table + check = MySchemaOp->createTable( GROUP_TABLE, + 8, // Table size + TupleKey, // Key Type + 1 // Nr of Pages + ,All, + 6, + 78, + 80, + 1, + useTableLogging + ); + + if( check == -1 ) + error_handler("createTable", MySchemaTransaction->getNdbError(), 0); + + // Create first column, primary key + check = MySchemaOp->createAttribute( GROUP_ID, + TupleKey, + sizeof(GroupId) << 3, + 1, + UnSigned, + MMBased, + NotNullAttribute ); + if( check == -1 ) + error_handler("createAttribute (group id)", + MySchemaTransaction->getNdbError(), 0); + + check = MySchemaOp->createAttribute( GROUP_NAME, + NoKey, + sizeof(char) << 3, + GROUP_NAME_LENGTH, + String, + MMBased, + NotNullAttribute ); + if( check == -1 ) + error_handler("createAttribute (group name)", + MySchemaTransaction->getNdbError(), 0); + + + check = MySchemaOp->createAttribute( GROUP_ALLOW_READ, + NoKey, + sizeof(Permission) << 3, + 1, + String, + MMBased, + NotNullAttribute ); + if( check == -1 ) + error_handler("createAttribute (group read)", + MySchemaTransaction->getNdbError(), 0); + + + check = MySchemaOp->createAttribute( GROUP_ALLOW_INSERT, + NoKey, + sizeof(Permission) << 3, + 1, + UnSigned, + MMBased, + NotNullAttribute ); + if( check == -1 ) + error_handler("createAttribute (group insert)", + MySchemaTransaction->getNdbError(), 0); + + check = MySchemaOp->createAttribute( GROUP_ALLOW_DELETE, + NoKey, + sizeof(Permission) << 3, + 1, + UnSigned, + MMBased, + NotNullAttribute ); + if( check == -1 ) + error_handler("createAttribute (group delete)", + MySchemaTransaction->getNdbError(), 0); + + if( MySchemaTransaction->execute() == -1 ) { + error_handler("schemaTransaction->execute()", + MySchemaTransaction->getNdbError(), 0); + } + NdbSchemaCon::closeSchemaTrans(MySchemaTransaction); + return 0; +} + +int +create_table_subscriber(Ndb * pNdb){ + int check; + NdbSchemaCon * MySchemaTransaction = NdbSchemaCon::startSchemaTrans(pNdb); + if( MySchemaTransaction == NULL ) + error_handler("startSchemaTransaction", pNdb->getNdbError(), 0); + + NdbSchemaOp * MySchemaOp = MySchemaTransaction->getNdbSchemaOp(); + if( MySchemaOp == NULL ) + error_handler("getNdbSchemaOp", MySchemaTransaction->getNdbError(), 0); + + // Create table + check = MySchemaOp->createTable( SUBSCRIBER_TABLE, + 8, // Table size + TupleKey, // Key Type + 1 // Nr of Pages + ,DistributionGroup, + 6, + 78, + 80, + 1, + useTableLogging + ); + if( check == -1 ) + error_handler("createTable", MySchemaTransaction->getNdbError(), 0); + + // Create first column, primary key + check = MySchemaOp->createAttribute + ( SUBSCRIBER_NUMBER, + TupleKey, + sizeof(char) << 3, + SUBSCRIBER_NUMBER_LENGTH, + String, + MMBased, + NotNullAttribute, + (useIndexTables ? IndexStorageAttribute : NormalStorageAttribute), + 0, + 1, + 16); + if( check == -1 ) + error_handler("createAttribute (subscriber number)", + MySchemaTransaction->getNdbError(), 0); + + check = MySchemaOp->createAttribute( SUBSCRIBER_NAME, + NoKey, + sizeof(char) << 3, + SUBSCRIBER_NAME_LENGTH, + String, + MMBased, + NotNullAttribute ); + if( check == -1 ) + error_handler("createAttribute (subscriber name)", + MySchemaTransaction->getNdbError(), 0); + + + check = MySchemaOp->createAttribute( SUBSCRIBER_GROUP, + NoKey, + sizeof(GroupId) << 3, + 1, + UnSigned, + MMBased, + NotNullAttribute ); + if( check == -1 ) + error_handler("createAttribute (subscriber_group)", + MySchemaTransaction->getNdbError(), 0); + + + check = MySchemaOp->createAttribute( SUBSCRIBER_LOCATION, + NoKey, + sizeof(Location) << 3, + 1, + UnSigned, + MMBased, + NotNullAttribute ); + if( check == -1 ) + error_handler("createAttribute (server reads)", + MySchemaTransaction->getNdbError(), 0); + + check = MySchemaOp->createAttribute( SUBSCRIBER_SESSIONS, + NoKey, + sizeof(ActiveSessions) << 3, + 1, + UnSigned, + MMBased, + NotNullAttribute ); + if( check == -1 ) + error_handler("createAttribute (subscriber_sessions)", + MySchemaTransaction->getNdbError(), 0); + + check = MySchemaOp->createAttribute( SUBSCRIBER_CHANGED_BY, + NoKey, + sizeof(char) << 3, + CHANGED_BY_LENGTH, + String, + MMBased, + NotNullAttribute ); + if( check == -1 ) + error_handler("createAttribute (subscriber_changed_by)", + MySchemaTransaction->getNdbError(), 0); + + check = MySchemaOp->createAttribute( SUBSCRIBER_CHANGED_TIME, + NoKey, + sizeof(char) << 3, + CHANGED_TIME_LENGTH, + String, + MMBased, + NotNullAttribute ); + if( check == -1 ) + error_handler("createAttribute (subscriber_changed_time)", + MySchemaTransaction->getNdbError(), 0); + + if( MySchemaTransaction->execute() == -1 ) { + error_handler("schemaTransaction->execute()", + MySchemaTransaction->getNdbError(), 0); + } + NdbSchemaCon::closeSchemaTrans(MySchemaTransaction); + return 0; +} + +int +create_table_session(Ndb * pNdb){ + int check; + NdbSchemaCon * MySchemaTransaction = NdbSchemaCon::startSchemaTrans(pNdb); + if( MySchemaTransaction == NULL ) + error_handler("startSchemaTransaction", pNdb->getNdbError(), 0); + + NdbSchemaOp * MySchemaOp = MySchemaTransaction->getNdbSchemaOp(); + if( MySchemaOp == NULL ) + error_handler("getNdbSchemaOp", + MySchemaTransaction->getNdbError(), 0); + + // Create table + check = MySchemaOp->createTable( SESSION_TABLE, + 8, // Table size + TupleKey, // Key Type + 1 // Nr of Pages + ,DistributionGroup, + 6, + 78, + 80, + 1, + useTableLogging + ); + if( check == -1 ) + error_handler("createTable", MySchemaTransaction->getNdbError(), 0); + + check = MySchemaOp->createAttribute( SESSION_SUBSCRIBER, + TupleKey, + sizeof(char) << 3, + SUBSCRIBER_NUMBER_LENGTH, + String, + MMBased, + NotNullAttribute, + NormalStorageAttribute, + 0, + 1, + 16); + if( check == -1 ) + error_handler("createAttribute (session_subscriber)", + MySchemaTransaction->getNdbError(), 0); + + // Create first column, primary key + check = MySchemaOp->createAttribute( SESSION_SERVER, + TupleKey, + sizeof(ServerId) << 3, + 1, + UnSigned, + MMBased, + NotNullAttribute ); + if( check == -1 ) + error_handler("createAttribute (session_server)", + MySchemaTransaction->getNdbError(), 0); + + + check = MySchemaOp->createAttribute( SESSION_DATA, + NoKey, + sizeof(char) << 3, + SESSION_DETAILS_LENGTH, + String, + MMBased, + NotNullAttribute ); + if( check == -1 ) + error_handler("createAttribute (session_data)", + MySchemaTransaction->getNdbError(), 0); + + if( MySchemaTransaction->execute() == -1 ) { + error_handler("schemaTransaction->execute()", + MySchemaTransaction->getNdbError(), 0); + } + NdbSchemaCon::closeSchemaTrans(MySchemaTransaction); + return 0; +} + +void +create_table(const char * name, int (* function)(Ndb * pNdb), Ndb* pNdb){ + printf("creating table %s...", name); + if(pNdb->getDictionary()->getTable(name) != 0){ + printf(" it already exists\n"); + return; + } else { + printf("\n"); + } + function(pNdb); + printf("creating table %s... done\n", name); +} + +static int dbCreate(Ndb * pNdb) +{ + create_table(SUBSCRIBER_TABLE, create_table_subscriber, pNdb); + create_table(GROUP_TABLE , create_table_group, pNdb); + create_table(SESSION_TABLE , create_table_session, pNdb); + create_table(SERVER_TABLE , create_table_server, pNdb); + return 0; +} + +#ifndef NDB_WIN32 +#include +#endif + +UserHandle* +userDbConnect(uint32 createDb, char *dbName) +{ + Ndb_cluster_connection *con= new Ndb_cluster_connection(); + if(con->connect(12, 5, 1) != 0) + { + ndbout << "Unable to connect to management server." << endl; + return 0; + } + if (con->wait_until_ready(30,0) < 0) + { + ndbout << "Cluster nodes not ready in 30 seconds." << endl; + return 0; + } + + Ndb * pNdb = new Ndb(con, dbName); + + //printf("Initializing...\n"); + pNdb->init(); + + //printf("Waiting..."); + while(pNdb->waitUntilReady() != 0){ + //printf("..."); + } + // printf("done\n"); + + if( createDb ) + dbCreate(pNdb); + + + UserHandle * uh = new UserHandle; + uh->pNCC = con; + uh->pNDB = pNdb; + uh->pCurrTrans = 0; + + return uh; +} + +void userDbDisconnect(UserHandle *uh) +{ + delete uh; +} + +int userDbInsertServer(UserHandle *uh, + ServerId serverId, + SubscriberSuffix suffix, + ServerName name) +{ + int check; + + uint32 noOfRead = 0; + uint32 noOfInsert = 0; + uint32 noOfDelete = 0; + + NdbConnection * MyTransaction = 0; + if(uh->pCurrTrans != 0){ + MyTransaction = uh->pCurrTrans; + } else { + uh->pCurrTrans = MyTransaction = uh->pNDB->startTransaction(); + } + if (MyTransaction == NULL) + error_handler("startTranscation", uh->pNDB->getNdbError(), 0); + + NdbOperation *MyOperation = MyTransaction->getNdbOperation(SERVER_TABLE); + CHECK_NULL(MyOperation, "getNdbOperation", MyTransaction); + + check = MyOperation->insertTuple(); + CHECK_MINUS_ONE(check, "insert tuple", MyTransaction); + + check = MyOperation->equal(SERVER_ID, (char*)&serverId); + CHECK_MINUS_ONE(check, "setValue id", MyTransaction); + + check = MyOperation->setValue(SERVER_SUBSCRIBER_SUFFIX, suffix); + CHECK_MINUS_ONE(check, "setValue suffix", MyTransaction); + + check = MyOperation->setValue(SERVER_NAME, name); + CHECK_MINUS_ONE(check, "setValue name", MyTransaction); + + check = MyOperation->setValue(SERVER_READS, (char*)&noOfRead); + CHECK_MINUS_ONE(check, "setValue reads", MyTransaction); + + check = MyOperation->setValue(SERVER_INSERTS, (char*)&noOfInsert); + CHECK_MINUS_ONE(check, "setValue inserts", MyTransaction); + + check = MyOperation->setValue(SERVER_DELETES, (char*)&noOfDelete); + CHECK_MINUS_ONE(check, "setValue deletes", MyTransaction); + + return 0; +} + +int userDbInsertSubscriber(UserHandle *uh, + SubscriberNumber number, + uint32 groupId, + SubscriberName name) +{ + int check; + uint32 activeSessions = 0; + Location l = 0; + ChangedBy changedBy; snprintf(changedBy, sizeof(changedBy), "ChangedBy"); + ChangedTime changedTime; snprintf(changedTime, sizeof(changedTime), "ChangedTime"); + + NdbConnection * MyTransaction = 0; + if(uh->pCurrTrans != 0){ + MyTransaction = uh->pCurrTrans; + } else { + uh->pCurrTrans = MyTransaction = uh->pNDB->startTransaction(); + } + if (MyTransaction == NULL) + error_handler("startTranscation", uh->pNDB->getNdbError(), 0); + + NdbOperation *MyOperation = MyTransaction->getNdbOperation(SUBSCRIBER_TABLE); + CHECK_NULL(MyOperation, "getNdbOperation", MyTransaction); + + check = MyOperation->insertTuple(); + CHECK_MINUS_ONE(check, "insertTuple", MyTransaction); + + check = MyOperation->equal(SUBSCRIBER_NUMBER, number); + CHECK_MINUS_ONE(check, "equal", MyTransaction); + + check = MyOperation->setValue(SUBSCRIBER_NAME, name); + CHECK_MINUS_ONE(check, "setValue name", MyTransaction); + + check = MyOperation->setValue(SUBSCRIBER_GROUP, (char*)&groupId); + CHECK_MINUS_ONE(check, "setValue group", MyTransaction); + + check = MyOperation->setValue(SUBSCRIBER_LOCATION, (char*)&l); + CHECK_MINUS_ONE(check, "setValue location", MyTransaction); + + check = MyOperation->setValue(SUBSCRIBER_SESSIONS, (char*)&activeSessions); + CHECK_MINUS_ONE(check, "setValue sessions", MyTransaction); + + check = MyOperation->setValue(SUBSCRIBER_CHANGED_BY, changedBy); + CHECK_MINUS_ONE(check, "setValue changedBy", MyTransaction); + + check = MyOperation->setValue(SUBSCRIBER_CHANGED_TIME, changedTime); + CHECK_MINUS_ONE(check, "setValue changedTime", MyTransaction); + + return 0; +} + +int userDbInsertGroup(UserHandle *uh, + GroupId groupId, + GroupName name, + Permission allowRead, + Permission allowInsert, + Permission allowDelete) +{ + int check; + + NdbConnection * MyTransaction = 0; + if(uh->pCurrTrans != 0){ + MyTransaction = uh->pCurrTrans; + } else { + uh->pCurrTrans = MyTransaction = uh->pNDB->startTransaction(); + } + if (MyTransaction == NULL) + error_handler("startTranscation", uh->pNDB->getNdbError(), 0); + + NdbOperation *MyOperation = MyTransaction->getNdbOperation(GROUP_TABLE); + CHECK_NULL(MyOperation, "getNdbOperation", MyTransaction); + + check = MyOperation->insertTuple(); + CHECK_MINUS_ONE(check, "insertTuple", MyTransaction); + + check = MyOperation->equal(GROUP_ID, (char*)&groupId); + CHECK_MINUS_ONE(check, "equal", MyTransaction); + + check = MyOperation->setValue(GROUP_NAME, name); + CHECK_MINUS_ONE(check, "setValue name", MyTransaction); + + check = MyOperation->setValue(GROUP_ALLOW_READ, (char*)&allowRead); + CHECK_MINUS_ONE(check, "setValue allowRead", MyTransaction); + + check = MyOperation->setValue(GROUP_ALLOW_INSERT, (char*)&allowInsert); + CHECK_MINUS_ONE(check, "setValue allowInsert", MyTransaction); + + check = MyOperation->setValue(GROUP_ALLOW_DELETE, (char*)&allowDelete); + CHECK_MINUS_ONE(check, "setValue allowDelete", MyTransaction); + + return 0; +} + diff --git a/ndb/test/ndbapi/bench/userInterface.h b/ndb/test/ndbapi/bench/userInterface.h new file mode 100644 index 00000000000..9e3b6f8f2a5 --- /dev/null +++ b/ndb/test/ndbapi/bench/userInterface.h @@ -0,0 +1,151 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef DBINTERFACE_H +#define DBINTERFACE_H + +/***************************************************************/ +/* I N C L U D E D F I L E S */ +/***************************************************************/ + +#include "testDefinitions.h" +#include "testData.h" + +/*************************************************************** +* M A C R O S * +***************************************************************/ + +/***************************************************************/ +/* C O N S T A N T S */ +/***************************************************************/ + +/*-----------------------*/ +/* Default Database Name */ +/*-----------------------*/ +#define DEFAULTDB "TestDbClient" + +/*************************************************************** +* D A T A S T R U C T U R E S * +***************************************************************/ + +/*************************************************************** +* P U B L I C F U N C T I O N S * +***************************************************************/ + +typedef struct Ndb Ndb; + +#ifdef __cplusplus +extern "C" { +#endif + extern void showTime(); + extern double userGetTime(void); + extern Ndb *asyncDbConnect(int parallellism); + extern void asyncDbDisconnect(Ndb* pNDB); + + extern void start_T1(Ndb * uh, ThreadData * data, int async); + extern void start_T2(Ndb * uh, ThreadData * data, int async); + extern void start_T3(Ndb * uh, ThreadData * data, int async); + extern void start_T4(Ndb * uh, ThreadData * data, int async); + extern void start_T5(Ndb * uh, ThreadData * data, int async); + + extern void complete_T1(ThreadData * data); + extern void complete_T2(ThreadData * data); + extern void complete_T3(ThreadData * data); + extern void complete_T4(ThreadData * data); + extern void complete_T5(ThreadData * data); + + + +#ifdef __cplusplus +} +#endif + + + +/***************************************************************/ +/* I N C L U D E D F I L E S */ +/***************************************************************/ + +#include "testDefinitions.h" + +/*************************************************************** +* M A C R O S * +***************************************************************/ + +/***************************************************************/ +/* C O N S T A N T S */ +/***************************************************************/ + +/*-----------------------*/ +/* Default Database Name */ +/*-----------------------*/ +#define DEFAULTDB "TestDbClient" + +/*************************************************************** +* D A T A S T R U C T U R E S * +***************************************************************/ + +typedef struct { + struct Ndb_cluster_connection* pNCC; + struct Ndb * pNDB; + struct NdbConnection * pCurrTrans; +} UserHandle; + +/*************************************************************** +* P U B L I C F U N C T I O N S * +***************************************************************/ + +#ifdef __cplusplus +extern "C" { +#endif + +extern double userGetTimeSync(void); + +extern void userCheckpoint(UserHandle *uh); + +extern UserHandle *userDbConnect(uint32 createDb, char *dbName); +extern void userDbDisconnect(UserHandle *uh); + +extern int userDbInsertServer(UserHandle *uh, + ServerId serverId, + SubscriberSuffix suffix, + ServerName name); + +extern int userDbInsertSubscriber(UserHandle *uh, + SubscriberNumber number, + uint32 groupId, + SubscriberName name); + +extern int userDbInsertGroup(UserHandle *uh, + GroupId groupId, + GroupName name, + Permission allowRead, + Permission allowInsert, + Permission allowDelete); + + extern int userDbCommit(UserHandle *uh); + extern int userDbRollback(UserHandle *uh); + +#ifdef __cplusplus +} +#endif + +/*************************************************************** +* E X T E R N A L D A T A * +***************************************************************/ + +#endif /* DBINTERFACE_H */ + From fca90750dfa0a2bee85a4824aba7c2197d45587c Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 10 Feb 2005 14:56:20 +0300 Subject: [PATCH 0961/1063] A fix and test case for Bug#8330 "mysql_stmt_execute crashes" (libmysql). libmysql/libmysql.c: Fix for bug#8330 "mysql_stmt_execute crashes": we need to bail out from mysql_stmt_execute if mysql->net is occupied with a result set of another statement. Otherwise on the next attempt to use net we get a crash, as it's freed in case of error. tests/mysql_client_test.c: A test case for Bug#8330 "mysql_stmt_execute craches" (libmysql) --- libmysql/libmysql.c | 5 ++++ tests/mysql_client_test.c | 54 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+) diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index 3d84059e981..24a7fa5f929 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -2467,6 +2467,11 @@ int cli_stmt_execute(MYSQL_STMT *stmt) set_stmt_error(stmt, CR_PARAMS_NOT_BOUND, unknown_sqlstate); DBUG_RETURN(1); } + if (stmt->mysql->status != MYSQL_STATUS_READY) + { + set_stmt_error(stmt, CR_COMMANDS_OUT_OF_SYNC, unknown_sqlstate); + DBUG_RETURN(1); + } net_clear(net); /* Sets net->write_pos */ /* Reserve place for null-marker bytes */ diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index 83f8f6ab143..e4bdd1d350a 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include @@ -11532,6 +11533,58 @@ static void test_bug6761(void) myquery(rc); } + +/* Bug#8330 - Bug #8330 mysql_stmt_execute crashes (libmysql) */ + +static void test_bug8330() +{ + const char *stmt_text; + MYSQL_STMT *stmt[2]; + int i, rc; + char *query= "select a,b from t1 where a=?"; + MYSQL_BIND bind[2]; + long lval[2]; + + myheader("test_bug8330"); + + stmt_text= "drop table if exists t1"; + /* in case some previos test failed */ + rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text)); + myquery(rc); + stmt_text= "create table t1 (a int, b int)"; + rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text)); + myquery(rc); + + bzero(bind, sizeof(bind)); + for (i=0; i < 2; i++) + { + stmt[i]= mysql_stmt_init(mysql); + rc= mysql_stmt_prepare(stmt[i], query, strlen(query)); + check_execute(stmt[i], rc); + + bind[i].buffer_type= MYSQL_TYPE_LONG; + bind[i].buffer= (void*) &lval[i]; + bind[i].is_null= 0; + mysql_stmt_bind_param(stmt[i], &bind[i]); + } + + rc= mysql_stmt_execute(stmt[0]); + check_execute(stmt[0], rc); + + rc= mysql_stmt_execute(stmt[1]); + DIE_UNLESS(rc && mysql_stmt_errno(stmt[1]) == CR_COMMANDS_OUT_OF_SYNC); + rc= mysql_stmt_execute(stmt[0]); + check_execute(stmt[0], rc); + + mysql_stmt_close(stmt[0]); + mysql_stmt_close(stmt[1]); + + stmt_text= "drop table t1"; + rc= mysql_real_query(mysql, stmt_text, strlen(stmt_text)); + myquery(rc); +} + + /* Read and parse arguments and MySQL options from my.cnf */ @@ -11739,6 +11792,7 @@ static struct my_tests_st my_tests[]= { { "test_conversion", test_conversion }, { "test_rewind", test_rewind }, { "test_bug6761", test_bug6761 }, + { "test_bug8330", test_bug8330 }, { 0, 0 } }; From 2e480773c87c52ba0eb0a5ba9acdf75414f75059 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 10 Feb 2005 14:33:27 +0100 Subject: [PATCH 0962/1063] Change 'Build-tools/Do-compile' from 'system("rm -f ...");' to 'unlink()' to ensure it also works on file names with special characters. Build-tools/Do-compile: Ever and again, some test creates a file name with special characters that need to be escaped when passed to the shell; as this is not done, 'system("rm -f ...");' fails on them, the old test tree is not deleted, and the build fails. Prevent this by changing to Perl 'unlink()' which does not need escaping. --- Build-tools/Do-compile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Build-tools/Do-compile b/Build-tools/Do-compile index af03f3209aa..1f83a9a37e1 100755 --- a/Build-tools/Do-compile +++ b/Build-tools/Do-compile @@ -729,7 +729,7 @@ sub find sub rm_all { my(@rm_files)=@_; - my($dir,$current_dir,@files,@dirs); + my($dir,$current_dir,@files,@dirs,$removed); $current_dir = `pwd`; chomp($current_dir); foreach $dir (@rm_files) @@ -753,7 +753,9 @@ sub rm_all } if ($#files >= 0) { - system("rm -f " . join(" ",@files)) && abort("Can't remove files from $dir"); + $removed= unlink @files; + print "rm_all : removed $removed files in $current_dir/$dir\n" if ($opt_debug); + abort("Can't remove all $#files+1 from $current_dir/$dir, just $removed") if $removed != $#files+1; } foreach $dir (@dirs) { From a26ce94f7adf0fb992045dfdf9d9401a36a6c31c Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 10 Feb 2005 17:41:54 +0300 Subject: [PATCH 0963/1063] A fix and test case for Bug#7990 "mysql_stmt_close doesn't reset mysql->net.last_error": the solution is to clear MYSQL->net error before performing COM_CLOSE: if the call succeeds, the connection is usable for other statements. More comprehensive fix is to clear MYSQL->net for all recoverable errors at the time they happen, it will be implemented in 5.0 as it introduces incompatibility in behavior. libmysql/libmysql.c: A simple fix for Bug#7990 "mysql_stmt_close doesn't reset mysql->net.last_error" tests/mysql_client_test.c: A test case for Bug#7990 " mysql_stmt_close doesn't reset mysql->net.last_error" --- libmysql/libmysql.c | 17 +++++++++++++++++ tests/mysql_client_test.c | 22 +++++++++++++++++++++- 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index 24a7fa5f929..76cf5c3913c 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -1788,6 +1788,18 @@ static my_bool my_realloc_str(NET *net, ulong length) } +/* Clear possible error statee of struct NET */ + +static void net_clear_error(NET *net) +{ + if (net->last_errno) + { + net->last_errno= 0; + net->last_error[0]= '\0'; + strmov(net->sqlstate, not_error_sqlstate); + } +} + /* Set statement error code, sqlstate, and error message from given errcode and sqlstate. @@ -4512,6 +4524,11 @@ my_bool STDCALL mysql_stmt_close(MYSQL_STMT *stmt) if (mysql->unbuffered_fetch_owner == &stmt->unbuffered_fetch_cancelled) mysql->unbuffered_fetch_owner= 0; + /* + Clear NET error state: if the following commands come through + successfully, connection will still be usable for other commands. + */ + net_clear_error(&mysql->net); if (mysql->status != MYSQL_STATUS_READY) { /* diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index e4bdd1d350a..2c7a8fdb635 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -11534,7 +11534,7 @@ static void test_bug6761(void) } -/* Bug#8330 - Bug #8330 mysql_stmt_execute crashes (libmysql) */ +/* Bug#8330 - mysql_stmt_execute crashes (libmysql) */ static void test_bug8330() { @@ -11585,6 +11585,26 @@ static void test_bug8330() } +/* Bug#7990 - mysql_stmt_close doesn't reset mysql->net.last_error */ + +static void test_bug7990() +{ + MYSQL_STMT *stmt; + int rc; + myheader("test_bug7990"); + + stmt= mysql_stmt_init(mysql); + rc= mysql_stmt_prepare(stmt, "foo", 3); + /* + XXX: the fact that we store errno both in STMT and in + MYSQL is not documented and is subject to change in 5.0 + */ + DIE_UNLESS(rc && mysql_stmt_errno(stmt) && mysql_errno(mysql)); + mysql_stmt_close(stmt); + DIE_UNLESS(!mysql_errno(mysql)); +} + + /* Read and parse arguments and MySQL options from my.cnf */ From d9039e8718d9268297568bb996f1b0672db94ae4 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 10 Feb 2005 18:24:26 +0300 Subject: [PATCH 0964/1063] Follow-up for bug#7990 libmysql/libmysql.c: And now put it to the proper place and make it work (Bug#7990) tests/mysql_client_test.c: Enable the test for bug#7990 --- libmysql/libmysql.c | 10 +++++----- tests/mysql_client_test.c | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index 76cf5c3913c..9c49c7eb15b 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -4518,17 +4518,17 @@ my_bool STDCALL mysql_stmt_close(MYSQL_STMT *stmt) if (mysql) { mysql->stmts= list_delete(mysql->stmts, &stmt->list); + /* + Clear NET error state: if the following commands come through + successfully, connection will still be usable for other commands. + */ + net_clear_error(&mysql->net); if ((int) stmt->state > (int) MYSQL_STMT_INIT_DONE) { char buff[MYSQL_STMT_HEADER]; /* 4 bytes - stmt id */ if (mysql->unbuffered_fetch_owner == &stmt->unbuffered_fetch_cancelled) mysql->unbuffered_fetch_owner= 0; - /* - Clear NET error state: if the following commands come through - successfully, connection will still be usable for other commands. - */ - net_clear_error(&mysql->net); if (mysql->status != MYSQL_STATUS_READY) { /* diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index 2c7a8fdb635..14b3ddbf8b2 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -11813,6 +11813,7 @@ static struct my_tests_st my_tests[]= { { "test_rewind", test_rewind }, { "test_bug6761", test_bug6761 }, { "test_bug8330", test_bug8330 }, + { "test_bug7990", test_bug7990 }, { 0, 0 } }; From 8abafe3535367c20c892441b79ea527d099d7186 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 10 Feb 2005 16:56:57 +0100 Subject: [PATCH 0965/1063] Bug#8391 - "merge" fails on Linux/IA64 It was a thread stack overrun. IA64 had its own stack size section already. Enlarged its default stack size from 192K to 256K. --- include/my_pthread.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/my_pthread.h b/include/my_pthread.h index c4138a47b3c..f8cd3e0de71 100644 --- a/include/my_pthread.h +++ b/include/my_pthread.h @@ -637,7 +637,7 @@ extern int pthread_dummy(int); MySQL can survive with 32K, but some glibc libraries require > 128K stack To resolve hostnames */ -#define DEFAULT_THREAD_STACK (192*1024L) +#define DEFAULT_THREAD_STACK (256*1024L) #else #define DEFAULT_THREAD_STACK (192*1024) #endif From d4574b91af1943e3ace89d0961e507675eeeccb0 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 10 Feb 2005 18:15:15 +0100 Subject: [PATCH 0966/1063] ndb - add more tests to autotest ndb/test/run-test/daily-basic-tests.txt: run mysql-test-run for max 1 hour (normally 30 minutes) ndb/test/run-test/daily-devel-tests.txt: Add benchmark to devel suite ndb/test/run-test/main.cpp: Add bench mode. always produce report ndb/test/run-test/run-test.hpp: Add bench mode. always produce report --- ndb/test/run-test/daily-basic-tests.txt | 2 +- ndb/test/run-test/daily-devel-tests.txt | 29 +++++++++++++++++++++++++ ndb/test/run-test/main.cpp | 9 ++++++-- ndb/test/run-test/run-test.hpp | 1 + 4 files changed, 38 insertions(+), 3 deletions(-) diff --git a/ndb/test/run-test/daily-basic-tests.txt b/ndb/test/run-test/daily-basic-tests.txt index c62908ae999..453fe1ad7ae 100644 --- a/ndb/test/run-test/daily-basic-tests.txt +++ b/ndb/test/run-test/daily-basic-tests.txt @@ -1,4 +1,4 @@ -max-time: 25000 +max-time: 3600 cmd: atrt-mysql-test-run args: --force diff --git a/ndb/test/run-test/daily-devel-tests.txt b/ndb/test/run-test/daily-devel-tests.txt index 5c9b36fb836..69c27ca229f 100644 --- a/ndb/test/run-test/daily-devel-tests.txt +++ b/ndb/test/run-test/daily-devel-tests.txt @@ -204,3 +204,32 @@ max-time: 2500 cmd: test_event args: -n BasicEventOperation T1 T6 +max-time: 300 +cmd: DbCreate +args: + +max-time: 180 +cmd: DbAsyncGenerator +args: -t 60 -p 1 +type: bench + +max-time: 180 +cmd: DbAsyncGenerator +args: -t 60 -p 25 +type: bench + +max-time: 180 +cmd: DbAsyncGenerator +args: -t 60 -p 100 +type: bench + +max-time: 180 +cmd: DbAsyncGenerator +args: -t 60 -p 200 +type: bench + +max-time: 180 +cmd: DbAsyncGenerator +args: -t 60 -p 1 -proc 25 +type: bench + diff --git a/ndb/test/run-test/main.cpp b/ndb/test/run-test/main.cpp index fb6754dae7a..02c2cc862a3 100644 --- a/ndb/test/run-test/main.cpp +++ b/ndb/test/run-test/main.cpp @@ -219,7 +219,7 @@ main(int argc, const char ** argv){ fflush(g_report_file); } - if(g_mode_bench || (g_mode_regression && result)){ + if(test_case.m_report || g_mode_bench || (g_mode_regression && result)){ BaseString tmp; tmp.assfmt("result.%d", test_no); if(rename("result", tmp.c_str()) != 0){ @@ -228,7 +228,7 @@ main(int argc, const char ** argv){ goto end; } } - + if(g_mode_interactive && result){ g_logger.info ("Encountered failed test in interactive mode - terminating"); @@ -908,6 +908,11 @@ read_test_case(FILE * file, atrt_testcase& tc, int& line){ tc.m_max_time = 60000; else tc.m_max_time = atoi(mt); + + if(p.get("type", &mt) && strcmp(mt, "bench") == 0) + tc.m_report= true; + else + tc.m_report= false; return true; } diff --git a/ndb/test/run-test/run-test.hpp b/ndb/test/run-test/run-test.hpp index 8d00a7b6a55..ff7f916d4ef 100644 --- a/ndb/test/run-test/run-test.hpp +++ b/ndb/test/run-test/run-test.hpp @@ -68,6 +68,7 @@ struct atrt_config { }; struct atrt_testcase { + bool m_report; time_t m_max_time; BaseString m_command; BaseString m_args; From 9f4f798049fabca4ef4441ce9583b5c145d572f3 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 10 Feb 2005 21:23:48 +0100 Subject: [PATCH 0967/1063] BUG#6749: If there is no current database, then nothing should be binlogged if binlog-do-db or binlog-ignore-db are in effect. (In the future 5.1? 5.0? I think each statement should be verified against the filtering criteria based on the database it *uses* and not the *current* one. But, right now the *current* database is what counts according to the semantics of the manual.) sql/log.cc: BUG#6749: If there is no current database, then nothing should be binlogged if binlog-do-db or binlog-ignore-db are in effect. (In the future I think that each statement should be verified against the filtering criteria based on the database it *uses* and not the *current* one. But, right now the *current* database is what counts according to the semantics of the manual.) --- sql/log.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/log.cc b/sql/log.cc index 38844877f1b..46b44837e0f 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -1274,7 +1274,7 @@ bool MYSQL_LOG::write(Log_event* event_info) binlog_[wild_]{do|ignore}_table?" (WL#1049)" */ if ((thd && !(thd->options & OPTION_BIN_LOG)) || - (local_db && !db_ok(local_db, binlog_do_db, binlog_ignore_db))) + (!db_ok(local_db, binlog_do_db, binlog_ignore_db))) { VOID(pthread_mutex_unlock(&LOCK_log)); DBUG_PRINT("error",("!db_ok('%s')", local_db)); From f59911fc1ce9abd93775a64e7e8988cfcbd0677f Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 10 Feb 2005 19:04:38 -0800 Subject: [PATCH 0968/1063] Set of fixes requested by Kent in IRC. Tested (except the windows changes since I am trusting Kent...). No windows compiles here folks... VC++Files/tests/mysql_client_test.dsp: fix request by Kent sql/item.cc: fix requested by kent --- VC++Files/tests/mysql_client_test.dsp | 12 ++++++------ sql/item.cc | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/VC++Files/tests/mysql_client_test.dsp b/VC++Files/tests/mysql_client_test.dsp index 07014487bd1..3d1e6728181 100644 --- a/VC++Files/tests/mysql_client_test.dsp +++ b/VC++Files/tests/mysql_client_test.dsp @@ -66,18 +66,18 @@ LINK32=link.exe # PROP Output_Dir ".\Release" # PROP Intermediate_Dir ".\Release" # PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /I "../include" /I "../" /W3 /Ob1 /G6 /D "DBUG_OFF" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /D "__WIN__" /D "_WIN32" /GF /Gy /Fp".\Release/client_test.pch" /Fo".\Release/" /Fd".\Release/" /c /GX -# ADD CPP /nologo /MTd /I "../include" /I "../" /W3 /Ob1 /G6 /D "DBUG_OFF" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /D "__WIN__" /D "_WIN32" /GF /Gy /Fp".\Release/client_test.pch" /Fo".\Release/" /Fd".\Release/" /c /GX -# ADD BASE MTL /nologo /tlb".\Release\client_test.tlb" /win32 -# ADD MTL /nologo /tlb".\Release\client_test.tlb" /win32 +# ADD BASE CPP /nologo /MTd /I "../include" /I "../" /W3 /Ob1 /G6 /D "DBUG_OFF" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /D "__WIN__" /D "_WIN32" /GF /Gy /Fp".\Release/mysql_client_test.pch" /Fo".\Release/" /Fd".\Release/" /c /GX +# ADD CPP /nologo /MTd /I "../include" /I "../" /W3 /Ob1 /G6 /D "DBUG_OFF" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /D "__WIN__" /D "_WIN32" /GF /Gy /Fp".\Release/mysql_client_test.pch" /Fo".\Release/" /Fd".\Release/" /c /GX +# ADD BASE MTL /nologo /tlb".\Release\mysql_client_test.tlb" /win32 +# ADD MTL /nologo /tlb".\Release\mysql_client_test.tlb" /win32 # ADD BASE RSC /l 1033 # ADD RSC /l 1033 BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib Ws2_32.lib /nologo /out:"..\tests\client_test.exe" /incremental:no /pdb:".\Release\client_test.pdb" /pdbtype:sept /subsystem:console -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib Ws2_32.lib /nologo /out:"..\tests\client_test.exe" /incremental:no /pdb:".\Release\client_test.pdb" /pdbtype:sept /subsystem:console +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib Ws2_32.lib /nologo /out:"..\tests\mysql_client_test.exe" /incremental:no /pdb:".\Release\mysql_client_test.pdb" /pdbtype:sept /subsystem:console +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib Ws2_32.lib /nologo /out:"..\tests\mysql_client_test.exe" /incremental:no /pdb:".\Release\mysql_client_test.pdb" /pdbtype:sept /subsystem:console !ENDIF diff --git a/sql/item.cc b/sql/item.cc index 17d41fda677..4b3acbe5a3c 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -2797,7 +2797,7 @@ bool Item_type_holder::join_types(THD *thd, Item *item, TABLE *table) bool use_new_field= 0, use_expression_type= 0; Item_result new_result_type= type_convertor[item_type][item->result_type()]; Field *field= get_holder_example_field(thd, item, table); - bool item_is_a_field= field; + bool item_is_a_field= (field != NULL); /* Check if both items point to fields: in this case we can adjust column types of result table in the union smartly. From 2a9b8f589ee332908065a4750e9363afd0bc4b22 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 10 Feb 2005 20:25:14 -0800 Subject: [PATCH 0969/1063] Fix all of the enum and set columns in privilege tables to be case-insensitive. (Bug #7989) mysql-test/r/system_mysql_db.result: Update results scripts/mysql_create_system_tables.sh: Need to create enum and set columns with case-insensitive collation scripts/mysql_fix_privilege_tables.sql: Modify all enum and set columns to be case-insensitive (and re-order some of the fix-ups to make it all happen smoothly). --- mysql-test/r/system_mysql_db.result | 100 +++++++------- scripts/mysql_create_system_tables.sh | 102 +++++++------- scripts/mysql_fix_privilege_tables.sql | 178 +++++++++++++++++-------- 3 files changed, 224 insertions(+), 156 deletions(-) diff --git a/mysql-test/r/system_mysql_db.result b/mysql-test/r/system_mysql_db.result index ebb24159373..141878a7bf6 100644 --- a/mysql-test/r/system_mysql_db.result +++ b/mysql-test/r/system_mysql_db.result @@ -21,18 +21,18 @@ db CREATE TABLE `db` ( `Host` char(60) collate utf8_bin NOT NULL default '', `Db` char(64) collate utf8_bin NOT NULL default '', `User` char(16) collate utf8_bin NOT NULL default '', - `Select_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', - `Insert_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', - `Update_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', - `Delete_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', - `Create_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', - `Drop_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', - `Grant_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', - `References_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', - `Index_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', - `Alter_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', - `Create_tmp_table_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', - `Lock_tables_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', + `Select_priv` enum('N','Y') character set utf8 NOT NULL default 'N', + `Insert_priv` enum('N','Y') character set utf8 NOT NULL default 'N', + `Update_priv` enum('N','Y') character set utf8 NOT NULL default 'N', + `Delete_priv` enum('N','Y') character set utf8 NOT NULL default 'N', + `Create_priv` enum('N','Y') character set utf8 NOT NULL default 'N', + `Drop_priv` enum('N','Y') character set utf8 NOT NULL default 'N', + `Grant_priv` enum('N','Y') character set utf8 NOT NULL default 'N', + `References_priv` enum('N','Y') character set utf8 NOT NULL default 'N', + `Index_priv` enum('N','Y') character set utf8 NOT NULL default 'N', + `Alter_priv` enum('N','Y') character set utf8 NOT NULL default 'N', + `Create_tmp_table_priv` enum('N','Y') character set utf8 NOT NULL default 'N', + `Lock_tables_priv` enum('N','Y') character set utf8 NOT NULL default 'N', PRIMARY KEY (`Host`,`Db`,`User`), KEY `User` (`User`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Database privileges' @@ -41,18 +41,18 @@ Table Create Table host CREATE TABLE `host` ( `Host` char(60) collate utf8_bin NOT NULL default '', `Db` char(64) collate utf8_bin NOT NULL default '', - `Select_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', - `Insert_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', - `Update_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', - `Delete_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', - `Create_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', - `Drop_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', - `Grant_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', - `References_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', - `Index_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', - `Alter_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', - `Create_tmp_table_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', - `Lock_tables_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', + `Select_priv` enum('N','Y') character set utf8 NOT NULL default 'N', + `Insert_priv` enum('N','Y') character set utf8 NOT NULL default 'N', + `Update_priv` enum('N','Y') character set utf8 NOT NULL default 'N', + `Delete_priv` enum('N','Y') character set utf8 NOT NULL default 'N', + `Create_priv` enum('N','Y') character set utf8 NOT NULL default 'N', + `Drop_priv` enum('N','Y') character set utf8 NOT NULL default 'N', + `Grant_priv` enum('N','Y') character set utf8 NOT NULL default 'N', + `References_priv` enum('N','Y') character set utf8 NOT NULL default 'N', + `Index_priv` enum('N','Y') character set utf8 NOT NULL default 'N', + `Alter_priv` enum('N','Y') character set utf8 NOT NULL default 'N', + `Create_tmp_table_priv` enum('N','Y') character set utf8 NOT NULL default 'N', + `Lock_tables_priv` enum('N','Y') character set utf8 NOT NULL default 'N', PRIMARY KEY (`Host`,`Db`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Host privileges; Merged with database privileges' show create table user; @@ -61,28 +61,28 @@ user CREATE TABLE `user` ( `Host` varchar(60) collate utf8_bin NOT NULL default '', `User` varchar(16) collate utf8_bin NOT NULL default '', `Password` varchar(41) collate utf8_bin NOT NULL default '', - `Select_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', - `Insert_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', - `Update_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', - `Delete_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', - `Create_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', - `Drop_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', - `Reload_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', - `Shutdown_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', - `Process_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', - `File_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', - `Grant_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', - `References_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', - `Index_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', - `Alter_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', - `Show_db_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', - `Super_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', - `Create_tmp_table_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', - `Lock_tables_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', - `Execute_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', - `Repl_slave_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', - `Repl_client_priv` enum('N','Y') collate utf8_bin NOT NULL default 'N', - `ssl_type` enum('','ANY','X509','SPECIFIED') collate utf8_bin NOT NULL default '', + `Select_priv` enum('N','Y') character set utf8 NOT NULL default 'N', + `Insert_priv` enum('N','Y') character set utf8 NOT NULL default 'N', + `Update_priv` enum('N','Y') character set utf8 NOT NULL default 'N', + `Delete_priv` enum('N','Y') character set utf8 NOT NULL default 'N', + `Create_priv` enum('N','Y') character set utf8 NOT NULL default 'N', + `Drop_priv` enum('N','Y') character set utf8 NOT NULL default 'N', + `Reload_priv` enum('N','Y') character set utf8 NOT NULL default 'N', + `Shutdown_priv` enum('N','Y') character set utf8 NOT NULL default 'N', + `Process_priv` enum('N','Y') character set utf8 NOT NULL default 'N', + `File_priv` enum('N','Y') character set utf8 NOT NULL default 'N', + `Grant_priv` enum('N','Y') character set utf8 NOT NULL default 'N', + `References_priv` enum('N','Y') character set utf8 NOT NULL default 'N', + `Index_priv` enum('N','Y') character set utf8 NOT NULL default 'N', + `Alter_priv` enum('N','Y') character set utf8 NOT NULL default 'N', + `Show_db_priv` enum('N','Y') character set utf8 NOT NULL default 'N', + `Super_priv` enum('N','Y') character set utf8 NOT NULL default 'N', + `Create_tmp_table_priv` enum('N','Y') character set utf8 NOT NULL default 'N', + `Lock_tables_priv` enum('N','Y') character set utf8 NOT NULL default 'N', + `Execute_priv` enum('N','Y') character set utf8 NOT NULL default 'N', + `Repl_slave_priv` enum('N','Y') character set utf8 NOT NULL default 'N', + `Repl_client_priv` enum('N','Y') character set utf8 NOT NULL default 'N', + `ssl_type` enum('','ANY','X509','SPECIFIED') character set utf8 NOT NULL default '', `ssl_cipher` blob NOT NULL, `x509_issuer` blob NOT NULL, `x509_subject` blob NOT NULL, @@ -97,7 +97,7 @@ func CREATE TABLE `func` ( `name` char(64) collate utf8_bin NOT NULL default '', `ret` tinyint(1) NOT NULL default '0', `dl` char(128) collate utf8_bin NOT NULL default '', - `type` enum('function','aggregate') collate utf8_bin NOT NULL default 'function', + `type` enum('function','aggregate') character set utf8 NOT NULL default 'function', PRIMARY KEY (`name`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='User defined functions' show create table tables_priv; @@ -109,8 +109,8 @@ tables_priv CREATE TABLE `tables_priv` ( `Table_name` char(64) collate utf8_bin NOT NULL default '', `Grantor` char(77) collate utf8_bin NOT NULL default '', `Timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, - `Table_priv` set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') collate utf8_bin NOT NULL default '', - `Column_priv` set('Select','Insert','Update','References') collate utf8_bin NOT NULL default '', + `Table_priv` set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') character set utf8 NOT NULL default '', + `Column_priv` set('Select','Insert','Update','References') character set utf8 NOT NULL default '', PRIMARY KEY (`Host`,`Db`,`User`,`Table_name`), KEY `Grantor` (`Grantor`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Table privileges' @@ -123,7 +123,7 @@ columns_priv CREATE TABLE `columns_priv` ( `Table_name` char(64) collate utf8_bin NOT NULL default '', `Column_name` char(64) collate utf8_bin NOT NULL default '', `Timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, - `Column_priv` set('Select','Insert','Update','References') collate utf8_bin NOT NULL default '', + `Column_priv` set('Select','Insert','Update','References') character set utf8 NOT NULL default '', PRIMARY KEY (`Host`,`Db`,`User`,`Table_name`,`Column_name`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Column privileges' show tables; diff --git a/scripts/mysql_create_system_tables.sh b/scripts/mysql_create_system_tables.sh index f524b322388..7f4a1105201 100644 --- a/scripts/mysql_create_system_tables.sh +++ b/scripts/mysql_create_system_tables.sh @@ -54,18 +54,18 @@ then c_d="$c_d Host char(60) binary DEFAULT '' NOT NULL," c_d="$c_d Db char(64) binary DEFAULT '' NOT NULL," c_d="$c_d User char(16) binary DEFAULT '' NOT NULL," - c_d="$c_d Select_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_d="$c_d Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_d="$c_d Update_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_d="$c_d Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_d="$c_d Create_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_d="$c_d Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_d="$c_d Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_d="$c_d References_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_d="$c_d Index_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_d="$c_d Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_d="$c_d Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_d="$c_d Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_d="$c_d Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_d="$c_d Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_d="$c_d Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_d="$c_d Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_d="$c_d Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_d="$c_d Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_d="$c_d Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_d="$c_d References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_d="$c_d Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_d="$c_d Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_d="$c_d Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_d="$c_d Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," c_d="$c_d PRIMARY KEY Host (Host,Db,User)," c_d="$c_d KEY User (User)" c_d="$c_d ) engine=MyISAM" @@ -85,18 +85,18 @@ then c_h="$c_h CREATE TABLE host (" c_h="$c_h Host char(60) binary DEFAULT '' NOT NULL," c_h="$c_h Db char(64) binary DEFAULT '' NOT NULL," - c_h="$c_h Select_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_h="$c_h Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_h="$c_h Update_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_h="$c_h Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_h="$c_h Create_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_h="$c_h Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_h="$c_h Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_h="$c_h References_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_h="$c_h Index_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_h="$c_h Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_h="$c_h Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_h="$c_h Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL," + c_h="$c_h Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_h="$c_h Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_h="$c_h Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_h="$c_h Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_h="$c_h Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_h="$c_h Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_h="$c_h Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_h="$c_h References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_h="$c_h Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_h="$c_h Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_h="$c_h Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_h="$c_h Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," c_h="$c_h PRIMARY KEY Host (Host,Db)" c_h="$c_h ) engine=MyISAM" c_h="$c_h CHARACTER SET utf8 COLLATE utf8_bin" @@ -113,28 +113,28 @@ then c_u="$c_u Host char(60) binary DEFAULT '' NOT NULL," c_u="$c_u User char(16) binary DEFAULT '' NOT NULL," c_u="$c_u Password char(41) binary DEFAULT '' NOT NULL," - c_u="$c_u Select_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_u="$c_u Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_u="$c_u Update_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_u="$c_u Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_u="$c_u Create_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_u="$c_u Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_u="$c_u Reload_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_u="$c_u Shutdown_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_u="$c_u Process_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_u="$c_u File_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_u="$c_u Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_u="$c_u References_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_u="$c_u Index_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_u="$c_u Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_u="$c_u Show_db_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_u="$c_u Super_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_u="$c_u Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_u="$c_u Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_u="$c_u Execute_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_u="$c_u Repl_slave_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_u="$c_u Repl_client_priv enum('N','Y') DEFAULT 'N' NOT NULL," - c_u="$c_u ssl_type enum('','ANY','X509', 'SPECIFIED') DEFAULT '' NOT NULL," + c_u="$c_u Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_u="$c_u Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_u="$c_u Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_u="$c_u Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_u="$c_u Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_u="$c_u Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_u="$c_u Reload_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_u="$c_u Shutdown_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_u="$c_u Process_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_u="$c_u File_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_u="$c_u Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_u="$c_u References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_u="$c_u Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_u="$c_u Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_u="$c_u Show_db_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_u="$c_u Super_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_u="$c_u Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_u="$c_u Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_u="$c_u Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_u="$c_u Repl_slave_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_u="$c_u Repl_client_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," + c_u="$c_u ssl_type enum('','ANY','X509', 'SPECIFIED') COLLATE utf8_general_ci DEFAULT '' NOT NULL," c_u="$c_u ssl_cipher BLOB NOT NULL," c_u="$c_u x509_issuer BLOB NOT NULL," c_u="$c_u x509_subject BLOB NOT NULL," @@ -180,7 +180,7 @@ then c_f="$c_f name char(64) binary DEFAULT '' NOT NULL," c_f="$c_f ret tinyint(1) DEFAULT '0' NOT NULL," c_f="$c_f dl char(128) DEFAULT '' NOT NULL," - c_f="$c_f type enum ('function','aggregate') NOT NULL," + c_f="$c_f type enum ('function','aggregate') COLLATE utf8_general_ci NOT NULL," c_f="$c_f PRIMARY KEY (name)" c_f="$c_f ) engine=MyISAM" c_f="$c_f CHARACTER SET utf8 COLLATE utf8_bin" @@ -200,8 +200,8 @@ then c_t="$c_t Table_name char(64) binary DEFAULT '' NOT NULL," c_t="$c_t Grantor char(77) DEFAULT '' NOT NULL," c_t="$c_t Timestamp timestamp(14)," - c_t="$c_t Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') DEFAULT '' NOT NULL," - c_t="$c_t Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL," + c_t="$c_t Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') COLLATE utf8_general_ci DEFAULT '' NOT NULL," + c_t="$c_t Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL," c_t="$c_t PRIMARY KEY (Host,Db,User,Table_name)," c_t="$c_t KEY Grantor (Grantor)" c_t="$c_t ) engine=MyISAM" @@ -222,7 +222,7 @@ then c_c="$c_c Table_name char(64) binary DEFAULT '' NOT NULL," c_c="$c_c Column_name char(64) binary DEFAULT '' NOT NULL," c_c="$c_c Timestamp timestamp(14)," - c_c="$c_c Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL," + c_c="$c_c Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL," c_c="$c_c PRIMARY KEY (Host,Db,User,Table_name,Column_name)" c_c="$c_c ) engine=MyISAM" c_c="$c_c CHARACTER SET utf8 COLLATE utf8_bin" @@ -330,7 +330,7 @@ then c_tz="$c_tz CREATE TABLE time_zone (" c_tz="$c_tz Time_zone_id int unsigned NOT NULL auto_increment," - c_tz="$c_tz Use_leap_seconds enum('Y','N') DEFAULT 'N' NOT NULL," + c_tz="$c_tz Use_leap_seconds enum('Y','N') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL," c_tz="$c_tz PRIMARY KEY TzId (Time_zone_id)" c_tz="$c_tz ) engine=MyISAM CHARACTER SET utf8" c_tz="$c_tz comment='Time zones';" diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql index 536b263f7bd..8f398689bd9 100644 --- a/scripts/mysql_fix_privilege_tables.sql +++ b/scripts/mysql_fix_privilege_tables.sql @@ -9,54 +9,23 @@ -- this sql script. -- On windows you should do 'mysql --force mysql < mysql_fix_privilege_tables.sql' --- Convert all tables to UTF-8 with binary collation --- and reset all char columns to correct width -ALTER TABLE user - MODIFY Host char(60) NOT NULL default '', - MODIFY User char(16) NOT NULL default '', - MODIFY Password char(41) NOT NULL default '', - ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; -ALTER TABLE db - MODIFY Host char(60) NOT NULL default '', - MODIFY Db char(64) NOT NULL default '', - MODIFY User char(16) NOT NULL default '', - ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; -ALTER TABLE host - MODIFY Host char(60) NOT NULL default '', - MODIFY Db char(64) NOT NULL default '', - ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; -ALTER TABLE func - ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; -ALTER TABLE columns_priv - MODIFY Host char(60) NOT NULL default '', - MODIFY Db char(64) NOT NULL default '', - MODIFY User char(16) NOT NULL default '', - MODIFY Table_name char(64) NOT NULL default '', - MODIFY Column_name char(64) NOT NULL default '', - ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; -ALTER TABLE tables_priv - MODIFY Host char(60) NOT NULL default '', - MODIFY Db char(64) NOT NULL default '', - MODIFY User char(16) NOT NULL default '', - MODIFY Table_name char(64) NOT NULL default '', - MODIFY Grantor char(77) NOT NULL default '', - ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; -ALTER TABLE user add File_priv enum('N','Y') NOT NULL; CREATE TABLE IF NOT EXISTS func ( name char(64) binary DEFAULT '' NOT NULL, ret tinyint(1) DEFAULT '0' NOT NULL, dl char(128) DEFAULT '' NOT NULL, - type enum ('function','aggregate') NOT NULL, + type enum ('function','aggregate') COLLATE utf8_general_ci NOT NULL, PRIMARY KEY (name) ) CHARACTER SET utf8 COLLATE utf8_bin; +ALTER TABLE user add File_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL; + -- Detect whether or not we had the Grant_priv column SET @hadGrantPriv:=0; SELECT @hadGrantPriv:=1 FROM user WHERE Grant_priv LIKE '%'; -ALTER TABLE user add Grant_priv enum('N','Y') NOT NULL,add References_priv enum('N','Y') NOT NULL,add Index_priv enum('N','Y') NOT NULL,add Alter_priv enum('N','Y') NOT NULL; -ALTER TABLE host add Grant_priv enum('N','Y') NOT NULL,add References_priv enum('N','Y') NOT NULL,add Index_priv enum('N','Y') NOT NULL,add Alter_priv enum('N','Y') NOT NULL; -ALTER TABLE db add Grant_priv enum('N','Y') NOT NULL,add References_priv enum('N','Y') NOT NULL,add Index_priv enum('N','Y') NOT NULL,add Alter_priv enum('N','Y') NOT NULL; +ALTER TABLE user add Grant_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add References_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add Index_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add Alter_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL; +ALTER TABLE host add Grant_priv enum('N','Y') NOT NULL,add References_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add Index_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add Alter_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL; +ALTER TABLE db add Grant_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add References_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add Index_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL,add Alter_priv enum('N','Y') COLLATE utf8_general_ci NOT NULL; --- Fix privileges for old tables UPDATE user SET Grant_priv=File_priv,References_priv=Create_priv,Index_priv=Create_priv,Alter_priv=Create_priv WHERE @hadGrantPriv = 0; @@ -68,7 +37,7 @@ UPDATE host SET References_priv=Create_priv,Index_priv=Create_priv,Alter_priv=Cr -- Adding columns needed by GRANT .. REQUIRE (openssl)" ALTER TABLE user -ADD ssl_type enum('','ANY','X509', 'SPECIFIED') NOT NULL, +ADD ssl_type enum('','ANY','X509', 'SPECIFIED') COLLATE utf8_general_ci NOT NULL, ADD ssl_cipher BLOB NOT NULL, ADD x509_issuer BLOB NOT NULL, ADD x509_subject BLOB NOT NULL; @@ -85,10 +54,14 @@ CREATE TABLE IF NOT EXISTS tables_priv ( Table_name char(64) binary DEFAULT '' NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Timestamp timestamp(14), - Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') DEFAULT '' NOT NULL, - Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL, + Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') COLLATE utf8_general_ci DEFAULT '' NOT NULL, + Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name) ) CHARACTER SET utf8 COLLATE utf8_bin; +-- Fix collation of set fields +ALTER TABLE tables_priv + modify Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') COLLATE utf8_general_ci DEFAULT '' NOT NULL, + modify Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL; CREATE TABLE IF NOT EXISTS columns_priv ( Host char(60) DEFAULT '' NOT NULL, @@ -97,22 +70,25 @@ CREATE TABLE IF NOT EXISTS columns_priv ( Table_name char(60) DEFAULT '' NOT NULL, Column_name char(59) DEFAULT '' NOT NULL, Timestamp timestamp(14), - Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL, + Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name,Column_name) ) CHARACTER SET utf8 COLLATE utf8_bin; +-- Fix collation of set fields +ALTER TABLE columns_priv + MODIFY Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL; -- -- Name change of Type -> Column_priv from MySQL 3.22.12 -- -ALTER TABLE columns_priv change Type Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL; +ALTER TABLE columns_priv change Type Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL; -- -- Add the new 'type' column to the func table. -- -ALTER TABLE func add type enum ('function','aggregate') NOT NULL; +ALTER TABLE func add type enum ('function','aggregate') COLLATE utf8_general_ci NOT NULL; -- -- Change the user,db and host tables to MySQL 4.0 format @@ -123,13 +99,13 @@ SET @hadShowDbPriv:=0; SELECT @hadShowDbPriv:=1 FROM user WHERE Show_db_priv LIKE '%'; ALTER TABLE user -ADD Show_db_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Alter_priv, -ADD Super_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Show_db_priv, -ADD Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Super_priv, -ADD Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Create_tmp_table_priv, -ADD Execute_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Lock_tables_priv, -ADD Repl_slave_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Execute_priv, -ADD Repl_client_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Repl_slave_priv; +ADD Show_db_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Alter_priv, +ADD Super_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Show_db_priv, +ADD Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Super_priv, +ADD Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Create_tmp_table_priv, +ADD Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Lock_tables_priv, +ADD Repl_slave_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Execute_priv, +ADD Repl_client_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL AFTER Repl_slave_priv; -- Convert privileges so that users have similar privileges as before @@ -150,11 +126,11 @@ ADD max_connections int(11) unsigned NOT NULL AFTER max_updates; -- ALTER TABLE db -ADD Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, -ADD Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL; +ADD Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, +ADD Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL; ALTER TABLE host -ADD Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, -ADD Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL; +ADD Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, +ADD Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL; alter table db change Db Db char(64) binary DEFAULT '' NOT NULL; alter table host change Db Db char(64) binary DEFAULT '' NOT NULL; @@ -170,6 +146,95 @@ alter table func comment='User defined functions'; alter table tables_priv comment='Table privileges'; alter table columns_priv comment='Column privileges'; +-- Convert all tables to UTF-8 with binary collation +-- and reset all char columns to correct width +ALTER TABLE user + MODIFY Host char(60) NOT NULL default '', + MODIFY User char(16) NOT NULL default '', + MODIFY Password char(41) NOT NULL default '', + ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; +ALTER TABLE user + MODIFY Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Reload_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Shutdown_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Process_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY File_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Show_db_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Super_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Repl_slave_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Repl_client_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY ssl_type enum('','ANY','X509', 'SPECIFIED') COLLATE utf8_general_ci DEFAULT '' NOT NULL; +ALTER TABLE db + MODIFY Host char(60) NOT NULL default '', + MODIFY Db char(64) NOT NULL default '', + MODIFY User char(16) NOT NULL default '', + ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; +ALTER TABLE db + MODIFY Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL; +ALTER TABLE host + MODIFY Host char(60) NOT NULL default '', + MODIFY Db char(64) NOT NULL default '', + ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; +ALTER TABLE host + MODIFY Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, + MODIFY Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL; +ALTER TABLE func + ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; +ALTER TABLE func + MODIFY type enum ('function','aggregate') COLLATE utf8_general_ci NOT NULL; +ALTER TABLE columns_priv + MODIFY Host char(60) NOT NULL default '', + MODIFY Db char(64) NOT NULL default '', + MODIFY User char(16) NOT NULL default '', + MODIFY Table_name char(64) NOT NULL default '', + MODIFY Column_name char(64) NOT NULL default '', + ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; +ALTER TABLE columns_priv + MODIFY Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL; +ALTER TABLE tables_priv + MODIFY Host char(60) NOT NULL default '', + MODIFY Db char(64) NOT NULL default '', + MODIFY User char(16) NOT NULL default '', + MODIFY Table_name char(64) NOT NULL default '', + MODIFY Grantor char(77) NOT NULL default '', + ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; +ALTER TABLE tables_priv + MODIFY Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') COLLATE utf8_general_ci DEFAULT '' NOT NULL, + MODIFY Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL; + # # Create some possible missing tables # @@ -217,9 +282,12 @@ PRIMARY KEY Name (Name) CREATE TABLE IF NOT EXISTS time_zone ( Time_zone_id int unsigned NOT NULL auto_increment, -Use_leap_seconds enum('Y','N') DEFAULT 'N' NOT NULL, +Use_leap_seconds enum('Y','N') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, PRIMARY KEY TzId (Time_zone_id) ) CHARACTER SET utf8 comment='Time zones'; +-- Make enum field case-insensitive +ALTER TABLE time_zone + MODIFY Use_leap_seconds enum('Y','N') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL; CREATE TABLE IF NOT EXISTS time_zone_transition ( Time_zone_id int unsigned NOT NULL, From cb754b989ae94454ca14cc0ba7bcb107f4a307d2 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 10 Feb 2005 20:31:23 -0800 Subject: [PATCH 0970/1063] Fix extra blank line in emails sent by post-commit trigger. BitKeeper/triggers/post-commit: Remove extra blank link --- BitKeeper/triggers/post-commit | 1 - 1 file changed, 1 deletion(-) diff --git a/BitKeeper/triggers/post-commit b/BitKeeper/triggers/post-commit index 5dc351024e0..a38b1f5a068 100755 --- a/BitKeeper/triggers/post-commit +++ b/BitKeeper/triggers/post-commit @@ -61,7 +61,6 @@ From: $FROM To: $INTERNALS Subject: bk commit into $VERSION tree ($CHANGESET)$BS $BH - Below is the list of changes that have just been committed into a local $VERSION repository of $USER. When $USER does a push these changes will be propagated to the main repository and, within 24 hours after the From 38e71e3ab8ac20dcf821acf277bc4b1f849d6891 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 11 Feb 2005 06:39:00 +0100 Subject: [PATCH 0971/1063] ndb - old bench rescue ndb/test/ndbapi/bench/mainPopulate.cpp: return correct ndb/test/ndbapi/bench/userInterface.cpp: remove NA setting ndb/test/run-test/daily-devel-tests.txt: set correct args --- ndb/test/ndbapi/bench/mainPopulate.cpp | 15 ++++++--------- ndb/test/ndbapi/bench/userInterface.cpp | 3 +-- ndb/test/run-test/daily-devel-tests.txt | 10 +++++----- 3 files changed, 12 insertions(+), 16 deletions(-) diff --git a/ndb/test/ndbapi/bench/mainPopulate.cpp b/ndb/test/ndbapi/bench/mainPopulate.cpp index 5f4b73a3eff..d017c2a3f4b 100644 --- a/ndb/test/ndbapi/bench/mainPopulate.cpp +++ b/ndb/test/ndbapi/bench/mainPopulate.cpp @@ -22,12 +22,12 @@ #include #include #include +#include #ifdef __cplusplus extern "C" { #endif int useTableLogging; -int useIndexTables; #ifdef __cplusplus } #endif @@ -44,7 +44,6 @@ void usage(const char *prog) ndbout_c( "Usage: %s [-l]\n" " -l Use logging and checkpointing on tables\n", - " -i Use index tables\n", prog); exit(1); @@ -57,28 +56,26 @@ NDB_COMMAND(DbCreate, "DbCreate", "DbCreate", "DbCreate", 16384) int i; UserHandle *uh; - useTableLogging = useIndexTables = 0; + useTableLogging = 0; NDB_INIT(argv[0]); for(i = 1; i Date: Thu, 10 Feb 2005 22:15:38 -0800 Subject: [PATCH 0972/1063] select.result, select.test: Added a test case for bug #7520. table.cc: Fixed bug #7520. The bug was caused by a wrong calculation of the field max_key_length for a TABLE structure when there was an index on a blob field. sql/table.cc: Fixed bug #7520. The bug was caused by a wrong calculation of the field max_key_length for a TABLE structure when there was an index on a blob field. mysql-test/t/select.test: Added a test case for bug #7520. mysql-test/r/select.result: Added a test case for bug #7520. --- mysql-test/r/select.result | 13 +++++++++++++ mysql-test/t/select.test | 15 +++++++++++++++ sql/table.cc | 1 + 3 files changed, 29 insertions(+) diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result index cc90547722f..4c6ad1c34f0 100644 --- a/mysql-test/r/select.result +++ b/mysql-test/r/select.result @@ -2364,3 +2364,16 @@ EXPLAIN SELECT i FROM t1 WHERE i=1; table type possible_keys key key_len ref rows Extra t1 const PRIMARY PRIMARY 4 const 1 Using index DROP TABLE t1; +CREATE TABLE t1 ( a BLOB, INDEX (a(20)) ); +CREATE TABLE t2 ( a BLOB, INDEX (a(20)) ); +INSERT INTO t1 VALUES ('one'),('two'),('three'),('four'),('five'); +INSERT INTO t2 VALUES ('one'),('two'),('three'),('four'),('five'); +EXPLAIN SELECT * FROM t1 LEFT JOIN t2 USE INDEX (a) ON t1.a=t2.a; +table type possible_keys key key_len ref rows Extra +t1 ALL NULL NULL NULL NULL 5 +t2 ref a a 23 t1.a 5 +EXPLAIN SELECT * FROM t1 LEFT JOIN t2 FORCE INDEX (a) ON t1.a=t2.a; +table type possible_keys key key_len ref rows Extra +t1 ALL NULL NULL NULL NULL 5 +t2 ref a a 23 t1.a 5 +DROP TABLE t1, t2; diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test index e6b1ffbe8d7..9be08b8390b 100644 --- a/mysql-test/t/select.test +++ b/mysql-test/t/select.test @@ -1909,3 +1909,18 @@ EXPLAIN SELECT i FROM t1 WHERE i=1; EXPLAIN SELECT i FROM t1 WHERE i=1; DROP TABLE t1; + +# +# Test case for bug 7520: a wrong cost of the index for a BLOB field +# + +CREATE TABLE t1 ( a BLOB, INDEX (a(20)) ); +CREATE TABLE t2 ( a BLOB, INDEX (a(20)) ); + +INSERT INTO t1 VALUES ('one'),('two'),('three'),('four'),('five'); +INSERT INTO t2 VALUES ('one'),('two'),('three'),('four'),('five'); + +EXPLAIN SELECT * FROM t1 LEFT JOIN t2 USE INDEX (a) ON t1.a=t2.a; +EXPLAIN SELECT * FROM t1 LEFT JOIN t2 FORCE INDEX (a) ON t1.a=t2.a; + +DROP TABLE t1, t2; diff --git a/sql/table.cc b/sql/table.cc index 573fa11a4c4..244c7fa94f3 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -486,6 +486,7 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag, if (!(field->flags & BINARY_FLAG)) keyinfo->flags|= HA_END_SPACE_KEY; } + set_if_bigger(outparam->max_key_length, keyinfo->key_length); if (i == 0 && key != primary_key) field->flags |= ((keyinfo->flags & HA_NOSAME) && From 4f53f70f721012d867b827a23e570de476922306 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 11 Feb 2005 08:09:47 +0100 Subject: [PATCH 0973/1063] ndb - fix compiler warning (error using gcc-3.4.3) ndb/test/ndbapi/bench/mainPopulate.cpp: compiler warning (error using gcc-3.4.3) --- ndb/test/ndbapi/bench/mainPopulate.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ndb/test/ndbapi/bench/mainPopulate.cpp b/ndb/test/ndbapi/bench/mainPopulate.cpp index d017c2a3f4b..5ab1a5b015d 100644 --- a/ndb/test/ndbapi/bench/mainPopulate.cpp +++ b/ndb/test/ndbapi/bench/mainPopulate.cpp @@ -53,11 +53,11 @@ NDB_STD_OPTS_VARS; NDB_COMMAND(DbCreate, "DbCreate", "DbCreate", "DbCreate", 16384) { + ndb_init(); int i; UserHandle *uh; useTableLogging = 0; - NDB_INIT(argv[0]); for(i = 1; i Date: Thu, 10 Feb 2005 23:47:57 -0800 Subject: [PATCH 0974/1063] select.result: Adjusted results of the test case for bug #7520 for 4.1. mysql-test/r/select.result: Adjusted results of the test case for bug #7520 for 4.1. --- mysql-test/r/select.result | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result index 607cd11f089..70ac33964ad 100644 --- a/mysql-test/r/select.result +++ b/mysql-test/r/select.result @@ -2392,11 +2392,11 @@ CREATE TABLE t2 ( a BLOB, INDEX (a(20)) ); INSERT INTO t1 VALUES ('one'),('two'),('three'),('four'),('five'); INSERT INTO t2 VALUES ('one'),('two'),('three'),('four'),('five'); EXPLAIN SELECT * FROM t1 LEFT JOIN t2 USE INDEX (a) ON t1.a=t2.a; -table type possible_keys key key_len ref rows Extra -t1 ALL NULL NULL NULL NULL 5 -t2 ref a a 23 t1.a 5 +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 5 +1 SIMPLE t2 ref a a 23 test.t1.a 2 EXPLAIN SELECT * FROM t1 LEFT JOIN t2 FORCE INDEX (a) ON t1.a=t2.a; -table type possible_keys key key_len ref rows Extra -t1 ALL NULL NULL NULL NULL 5 -t2 ref a a 23 t1.a 5 +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 5 +1 SIMPLE t2 ref a a 23 test.t1.a 2 DROP TABLE t1, t2; From aa3727d7dc294e82b6e9ba81db0b86c56b804e5d Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 11 Feb 2005 10:39:26 -0800 Subject: [PATCH 0975/1063] select.result: After revision of the fix for bug #7520. table.cc: Revised the fix for bug #7520. Made it compliant with 5.0 code where the bug does not exist. sql/table.cc: Revised the fix for bug #7520. Made it compliant with 5.0 code where the bug does not exist. mysql-test/r/select.result: After revision of the fix for bug #7520. --- mysql-test/r/select.result | 2 +- sql/table.cc | 13 ++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result index 4c6ad1c34f0..17897b2f549 100644 --- a/mysql-test/r/select.result +++ b/mysql-test/r/select.result @@ -2371,7 +2371,7 @@ INSERT INTO t2 VALUES ('one'),('two'),('three'),('four'),('five'); EXPLAIN SELECT * FROM t1 LEFT JOIN t2 USE INDEX (a) ON t1.a=t2.a; table type possible_keys key key_len ref rows Extra t1 ALL NULL NULL NULL NULL 5 -t2 ref a a 23 t1.a 5 +t2 ALL a NULL NULL NULL 4 EXPLAIN SELECT * FROM t1 LEFT JOIN t2 FORCE INDEX (a) ON t1.a=t2.a; table type possible_keys key key_len ref rows Extra t1 ALL NULL NULL NULL NULL 5 diff --git a/sql/table.cc b/sql/table.cc index 244c7fa94f3..43ac122c7f3 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -143,7 +143,6 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag, goto err_not_open; /* purecov: inspected */ bzero((char*) keyinfo,n_length); outparam->key_info=keyinfo; - outparam->max_key_length= outparam->total_key_length= 0; key_part= my_reinterpret_cast(KEY_PART_INFO*) (keyinfo+keys); strpos=disk_buff+6; @@ -199,11 +198,6 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag, } key_part->store_length=key_part->length; } - set_if_bigger(outparam->max_key_length,keyinfo->key_length+ - keyinfo->key_parts); - outparam->total_key_length+= keyinfo->key_length; - if (keyinfo->flags & HA_NOSAME) - set_if_bigger(outparam->max_unique_length,keyinfo->key_length); } keynames=(char*) key_part; strpos+= (strmov(keynames, (char *) strpos) - keynames)+1; @@ -486,7 +480,6 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag, if (!(field->flags & BINARY_FLAG)) keyinfo->flags|= HA_END_SPACE_KEY; } - set_if_bigger(outparam->max_key_length, keyinfo->key_length); if (i == 0 && key != primary_key) field->flags |= ((keyinfo->flags & HA_NOSAME) && @@ -547,6 +540,12 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag, } } keyinfo->usable_key_parts=usable_parts; // Filesort + + set_if_bigger(outparam->max_key_length,keyinfo->key_length+ + keyinfo->key_parts); + outparam->total_key_length+= keyinfo->key_length; + if (keyinfo->flags & HA_NOSAME) + set_if_bigger(outparam->max_unique_length,keyinfo->key_length); } if (primary_key < MAX_KEY && (outparam->keys_in_use & ((key_map) 1 << primary_key))) From 537531f0e8990debfb82bdbaac2f237d46098fb1 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 11 Feb 2005 21:57:37 +0200 Subject: [PATCH 0976/1063] Fixed mistyping (thnx to Konstantin) sql/sql_cache.cc: Fixed mistyping --- sql/sql_cache.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc index f503a63e752..d729a6cc301 100644 --- a/sql/sql_cache.cc +++ b/sql/sql_cache.cc @@ -1337,7 +1337,7 @@ ulong Query_cache::init_cache() init(); approx_additional_data_size = (sizeof(Query_cache) + sizeof(gptr)*(def_query_hash_size+ - def_query_hash_size)); + def_table_hash_size)); if (query_cache_size < approx_additional_data_size) goto err; From cf78ff694732aa3e11a8bd82c25df64664fff18a Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 11 Feb 2005 13:44:54 -0800 Subject: [PATCH 0977/1063] distinct.result: Adjustment of the result file after the revision of the fix for bug #7520. mysql-test/r/distinct.result: Adjustment of the result file after the revision of the fix for bug #7520. --- mysql-test/r/distinct.result | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/r/distinct.result b/mysql-test/r/distinct.result index a0343f13394..d37c1e518fa 100644 --- a/mysql-test/r/distinct.result +++ b/mysql-test/r/distinct.result @@ -190,7 +190,7 @@ insert into t3 select * from t4; explain select distinct t1.a from t1,t3 where t1.a=t3.a; table type possible_keys key key_len ref rows Extra t1 index PRIMARY PRIMARY 4 NULL 4 Using index; Using temporary -t3 ref a a 5 t1.a 10 Using where; Using index; Distinct +t3 ref a a 5 t1.a 12 Using where; Using index; Distinct select distinct t1.a from t1,t3 where t1.a=t3.a; a 1 From bae820dc664a70e2c9cc26a9ded324260a53d671 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 12 Feb 2005 00:05:13 +0100 Subject: [PATCH 0978/1063] make LOAD INDEX to work --- myisam/mi_preload.c | 8 ++++---- mysql-test/r/preload.result | 28 ++++++++++++++-------------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/myisam/mi_preload.c b/myisam/mi_preload.c index 5e03d489efe..317ab4ad7fe 100644 --- a/myisam/mi_preload.c +++ b/myisam/mi_preload.c @@ -71,15 +71,15 @@ int mi_preload(MI_INFO *info, ulonglong key_map, my_bool ignore_leaves) if (flush_key_blocks(share->key_cache,share->kfile, FLUSH_RELEASE)) goto err; - + do { /* Read the next block of index file into the preload buffer */ if ((my_off_t) length > (key_file_length-pos)) length= (ulong) (key_file_length-pos); - if (my_pread(share->kfile, (byte*) buff, length, pos, MYF(MY_FAE))) + if (my_pread(share->kfile, (byte*) buff, length, pos, MYF(MY_FAE|MY_FNABP))) goto err; - + if (ignore_leaves) { uchar *end= buff+length; @@ -88,7 +88,7 @@ int mi_preload(MI_INFO *info, ulonglong key_map, my_bool ignore_leaves) if (mi_test_if_nod(buff)) { if (key_cache_insert(share->key_cache, - share->kfile, pos, DFLT_INIT_HITS, + share->kfile, pos, DFLT_INIT_HITS, (byte*) buff, block_length)) goto err; } diff --git a/mysql-test/r/preload.result b/mysql-test/r/preload.result index f0b99a8d6f1..7237a0da7e0 100644 --- a/mysql-test/r/preload.result +++ b/mysql-test/r/preload.result @@ -74,15 +74,15 @@ Table Op Msg_type Msg_text test.t1 preload_keys status OK show status like "key_read%"; Variable_name Value -Key_read_requests 0 -Key_reads 0 +Key_read_requests 581 +Key_reads 581 select count(*) from t1 where b = 'test1'; count(*) 4181 show status like "key_read%"; Variable_name Value -Key_read_requests 217 -Key_reads 45 +Key_read_requests 798 +Key_reads 581 flush tables; flush status; show status like "key_read%"; @@ -98,15 +98,15 @@ Table Op Msg_type Msg_text test.t1 preload_keys status OK show status like "key_read%"; Variable_name Value -Key_read_requests 0 -Key_reads 0 +Key_read_requests 10 +Key_reads 10 select count(*) from t1 where b = 'test1'; count(*) 4181 show status like "key_read%"; Variable_name Value -Key_read_requests 217 -Key_reads 45 +Key_read_requests 227 +Key_reads 52 flush tables; flush status; show status like "key_read%"; @@ -123,8 +123,8 @@ test.t1 preload_keys status OK test.t2 preload_keys status OK show status like "key_read%"; Variable_name Value -Key_read_requests 0 -Key_reads 0 +Key_read_requests 587 +Key_reads 587 select count(*) from t1 where b = 'test1'; count(*) 4181 @@ -133,8 +133,8 @@ count(*) 2584 show status like "key_read%"; Variable_name Value -Key_read_requests 351 -Key_reads 73 +Key_read_requests 938 +Key_reads 613 flush tables; flush status; show status like "key_read%"; @@ -147,8 +147,8 @@ test.t3 preload_keys error Table 'test.t3' doesn't exist test.t2 preload_keys status OK show status like "key_read%"; Variable_name Value -Key_read_requests 0 -Key_reads 0 +Key_read_requests 355 +Key_reads 355 flush tables; flush status; show status like "key_read%"; From 2d619d7cadf45348614884d4cde7ded316e47412 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 12 Feb 2005 16:27:22 +0400 Subject: [PATCH 0979/1063] Bug#8235 Connection collation change & table create with default result in crash mysql-test/r/ctype_ucs.result: Test case mysql-test/t/ctype_ucs.test: Test case sql/field.cc: Fixed minus check to be UCS2-compatible strings/ctype-ucs2.c: Missing my_scan_ucs2() was added. --- mysql-test/r/ctype_ucs.result | 14 ++++++++++++++ mysql-test/t/ctype_ucs.test | 21 +++++++++++++++++++++ sql/field.cc | 12 ++++++++++-- strings/ctype-ucs2.c | 25 ++++++++++++++++++++++++- 4 files changed, 69 insertions(+), 3 deletions(-) diff --git a/mysql-test/r/ctype_ucs.result b/mysql-test/r/ctype_ucs.result index 3f50d9dfa1b..0807cfabf2a 100644 --- a/mysql-test/r/ctype_ucs.result +++ b/mysql-test/r/ctype_ucs.result @@ -613,3 +613,17 @@ ucs2_bin 00610009 ucs2_bin 0061 ucs2_bin 00610020 drop table t1; +SET NAMES latin1; +SET collation_connection='ucs2_swedish_ci'; +CREATE TABLE t1 (Field1 int(10) default '0'); +INSERT INTO t1 VALUES ('-1'); +SELECT * FROM t1; +Field1 +-1 +DROP TABLE t1; +CREATE TABLE t1 (Field1 int(10) unsigned default '0'); +INSERT INTO t1 VALUES ('-1'); +Warnings: +Warning 1265 Data truncated for column 'Field1' at row 1 +DROP TABLE t1; +SET NAMES latin1; diff --git a/mysql-test/t/ctype_ucs.test b/mysql-test/t/ctype_ucs.test index 1a0ba82d6ff..38956e12a3b 100644 --- a/mysql-test/t/ctype_ucs.test +++ b/mysql-test/t/ctype_ucs.test @@ -390,3 +390,24 @@ SET collation_connection='ucs2_general_ci'; SET NAMES latin1; SET collation_connection='ucs2_bin'; -- source include/ctype_filesort.inc + +SET NAMES latin1; +# +# Bug#8235 +# +# This bug also helped to find another problem that +# INSERT of a UCS2 string containing a negative number +# into a unsigned int column didn't produce warnings. +# This test covers both problems. +# +SET collation_connection='ucs2_swedish_ci'; +CREATE TABLE t1 (Field1 int(10) default '0'); +# no warnings, negative numbers are allowed +INSERT INTO t1 VALUES ('-1'); +SELECT * FROM t1; +DROP TABLE t1; +CREATE TABLE t1 (Field1 int(10) unsigned default '0'); +# this should generate a "Data truncated" warning +INSERT INTO t1 VALUES ('-1'); +DROP TABLE t1; +SET NAMES latin1; diff --git a/sql/field.cc b/sql/field.cc index e2f75034e52..fa0e202d513 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -1777,6 +1777,14 @@ void Field_medium::sql_type(String &res) const ****************************************************************************/ +static bool test_if_minus(CHARSET_INFO *cs, + const char *s, const char *e) +{ + my_wc_t wc; + return cs->cset->mb_wc(cs, &wc, (uchar*) s, (uchar*) e) > 0 && wc == '-'; +} + + int Field_long::store(const char *from,uint len,CHARSET_INFO *cs) { long tmp; @@ -1790,7 +1798,7 @@ int Field_long::store(const char *from,uint len,CHARSET_INFO *cs) if (unsigned_flag) { - if (!len || *from == '-') + if (!len || test_if_minus(cs, from, from + len)) { tmp=0; // Set negative to 0 my_errno=ERANGE; @@ -2086,7 +2094,7 @@ int Field_longlong::store(const char *from,uint len,CHARSET_INFO *cs) my_errno=0; if (unsigned_flag) { - if (!len || *from == '-') + if (!len || test_if_minus(cs, from, from + len)) { tmp=0; // Set negative to 0 my_errno= ERANGE; diff --git a/strings/ctype-ucs2.c b/strings/ctype-ucs2.c index ea11f8816a5..e92704b83d7 100644 --- a/strings/ctype-ucs2.c +++ b/strings/ctype-ucs2.c @@ -1480,6 +1480,29 @@ my_bool my_like_range_ucs2(CHARSET_INFO *cs, return 0; } + +ulong my_scan_ucs2(CHARSET_INFO *cs __attribute__((unused)), + const char *str, const char *end, int sequence_type) +{ + const char *str0= str; + end--; /* for easier loop condition, because of two bytes per character */ + + switch (sequence_type) + { + case MY_SEQ_SPACES: + for ( ; str < end; str+= 2) + { + if (str[0] != '\0' || str[1] != ' ') + break; + } + return str - str0; + default: + return 0; + } +} + + + static MY_COLLATION_HANDLER my_collation_ucs2_general_ci_handler = { NULL, /* init */ @@ -1534,7 +1557,7 @@ MY_CHARSET_HANDLER my_charset_ucs2_handler= my_strntoull_ucs2, my_strntod_ucs2, my_strtoll10_ucs2, - my_scan_8bit + my_scan_ucs2 }; From 3ca04269c93487f6c41f849e5cbc3e43677cd52e Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 12 Feb 2005 15:05:33 +0100 Subject: [PATCH 0980/1063] wl1292 - ndb autotest link to log if it exists, regardless of test result ndb/test/run-test/make-html-reports.sh: link to log if it exists, regardless of test result --- ndb/test/run-test/make-html-reports.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ndb/test/run-test/make-html-reports.sh b/ndb/test/run-test/make-html-reports.sh index 89f13a4b62a..6278b835dea 100755 --- a/ndb/test/run-test/make-html-reports.sh +++ b/ndb/test/run-test/make-html-reports.sh @@ -154,9 +154,13 @@ do ts=`time_spec $time` res_txt="" case $res in - 0) pass; res_txt="PASSED"; res_dir=" ";; + 0) pass; res_txt="PASSED";; *) fail; res_txt="FAILED";; esac + + if [ ! -d "result.$no" ]; then res_dir=" "; fi + + total=`expr $total + $time` ( From e03b7bd8798eba3d6de2835e3a73c99ea0a08d6e Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 12 Feb 2005 15:12:53 +0100 Subject: [PATCH 0981/1063] wl1292 - ndb autotest Fix 4.1 memleak in Hugo ndb/test/include/HugoOperations.hpp: Fix mem leak in Hugo ndb/test/src/HugoTransactions.cpp: Fix mem leak in Hugo --- ndb/test/include/HugoOperations.hpp | 2 +- ndb/test/src/HugoTransactions.cpp | 15 --------------- 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/ndb/test/include/HugoOperations.hpp b/ndb/test/include/HugoOperations.hpp index 9ca2772e768..a23d3018f47 100644 --- a/ndb/test/include/HugoOperations.hpp +++ b/ndb/test/include/HugoOperations.hpp @@ -100,7 +100,7 @@ protected: struct RsPair { NdbResultSet* m_result_set; int records; }; Vector m_result_sets; Vector m_executed_result_sets; -private: + NdbConnection* pTrans; }; diff --git a/ndb/test/src/HugoTransactions.cpp b/ndb/test/src/HugoTransactions.cpp index 85c96ef0f7f..5d5b2fa99df 100644 --- a/ndb/test/src/HugoTransactions.cpp +++ b/ndb/test/src/HugoTransactions.cpp @@ -40,7 +40,6 @@ HugoTransactions::scanReadRecords(Ndb* pNdb, int retryAttempt = 0; const int retryMax = 100; int check, a; - NdbConnection *pTrans; NdbScanOperation *pOp; while (true){ @@ -196,7 +195,6 @@ HugoTransactions::scanReadRecords(Ndb* pNdb, int retryAttempt = 0; const int retryMax = 100; int check, a; - NdbConnection *pTrans; NdbIndexScanOperation *pOp; while (true){ @@ -369,7 +367,6 @@ HugoTransactions::scanUpdateRecords1(Ndb* pNdb, int retryAttempt = 0; const int retryMax = 100; int check, a; - NdbConnection *pTrans; NdbOperation *pOp; @@ -536,7 +533,6 @@ HugoTransactions::scanUpdateRecords2(Ndb* pNdb, int retryAttempt = 0; const int retryMax = 100; int check, a; - NdbConnection *pTrans; NdbOperation *pOp; @@ -619,7 +615,6 @@ HugoTransactions::scanUpdateRecords2(Ndb* pNdb, int eof; int rows = 0; - NdbConnection* pUpTrans; while((eof = pTrans->nextScanResult(true)) == 0){ pUpTrans = pNdb->startTransaction(); @@ -702,7 +697,6 @@ HugoTransactions::scanUpdateRecords3(Ndb* pNdb, int retryAttempt = 0; const int retryMax = 100; int check, a; - NdbConnection *pTrans; NdbScanOperation *pOp; @@ -846,7 +840,6 @@ HugoTransactions::loadTable(Ndb* pNdb, int check, a; int retryAttempt = 0; int retryMax = 5; - NdbConnection *pTrans; NdbOperation *pOp; bool first_batch = true; @@ -992,7 +985,6 @@ HugoTransactions::fillTable(Ndb* pNdb, int check, a, b; int retryAttempt = 0; int retryMax = 5; - NdbConnection *pTrans; NdbOperation *pOp; g_info << "|- Inserting records..." << endl; @@ -1384,7 +1376,6 @@ HugoTransactions::pkReadRecords(Ndb* pNdb, int retryAttempt = 0; const int retryMax = 100; int check, a; - NdbConnection *pTrans; NdbOperation *pOp; if (batchsize == 0) { @@ -1521,7 +1512,6 @@ HugoTransactions::pkUpdateRecords(Ndb* pNdb, int retryAttempt = 0; const int retryMax = 100; int check, a, b; - NdbConnection *pTrans; NdbOperation *pOp; allocRows(batch); @@ -1689,7 +1679,6 @@ HugoTransactions::pkInterpretedUpdateRecords(Ndb* pNdb, int retryAttempt = 0; const int retryMax = 100; int check, a; - NdbConnection *pTrans; while (r < records){ @@ -1868,7 +1857,6 @@ HugoTransactions::pkDelRecords(Ndb* pNdb, int retryAttempt = 0; const int retryMax = 100; int check, a; - NdbConnection *pTrans; NdbOperation *pOp; g_info << "|- Deleting records..." << endl; @@ -1983,7 +1971,6 @@ HugoTransactions::lockRecords(Ndb* pNdb, int retryAttempt = 0; const int retryMax = 100; int check, a, b; - NdbConnection *pTrans; NdbOperation *pOp; // Calculate how many records to lock in each batch @@ -2130,7 +2117,6 @@ HugoTransactions::indexReadRecords(Ndb* pNdb, int retryAttempt = 0; const int retryMax = 100; int check, a; - NdbConnection *pTrans; NdbOperation *pOp; NdbIndexScanOperation *sOp; NdbResultSet * rs; @@ -2281,7 +2267,6 @@ HugoTransactions::indexUpdateRecords(Ndb* pNdb, int retryAttempt = 0; const int retryMax = 100; int check, a, b; - NdbConnection *pTrans; NdbOperation *pOp; NdbScanOperation * sOp; NdbResultSet * rs; From 4810f300d29a81db4c96d6cfc0185927eddb2568 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 12 Feb 2005 20:09:40 +0400 Subject: [PATCH 0982/1063] Fix for bug #8477 (Embedded query_cache test crashes) libmysqld/emb_qcache.cc: Querycahce data transition fixed --- libmysqld/emb_qcache.cc | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/libmysqld/emb_qcache.cc b/libmysqld/emb_qcache.cc index 7d83023abd5..2d3d82b7952 100644 --- a/libmysqld/emb_qcache.cc +++ b/libmysqld/emb_qcache.cc @@ -71,9 +71,11 @@ void Querycache_stream::store_int(uint i) cur_data+= 4; return; } - memcpy(cur_data, &i, rest_len); + char buf[4]; + int4store(buf, i); + memcpy(cur_data, buf, rest_len); use_next_block(); - memcpy(cur_data, ((byte*)&i)+rest_len, 4-rest_len); + memcpy(cur_data, buf+rest_len, 4-rest_len); cur_data+= 4-rest_len; } @@ -186,10 +188,12 @@ uint Querycache_stream::load_int() cur_data+= 4; return result; } - memcpy(&result, cur_data, rest_len); + char buf[4]; + memcpy(buf, cur_data, rest_len); use_next_block(); - memcpy(((byte*)&result)+rest_len, cur_data, 4-rest_len); + memcpy(buf+rest_len, cur_data, 4-rest_len); cur_data+= 4-rest_len; + result= uint4korr(buf); return result; } @@ -270,10 +274,10 @@ int Querycache_stream::load_column(MEM_ROOT *alloc, char** column) return 0; } len--; - if (!(*column= (char *)alloc_root(alloc, len + 4 + 1))) + if (!(*column= (char *)alloc_root(alloc, len + sizeof(uint) + 1))) return 1; - int4store(*column, len); - (*column)+= 4; + *((uint*)*column)= len; + (*column)+= sizeof(uint); load_str_only(*column, len); return 1; } From a8b9f30eb3e5f68a49c6db4476c0ef759ca52157 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 12 Feb 2005 19:17:33 +0100 Subject: [PATCH 0983/1063] new static archive_inited variable, so that archive_db_end() will do something only if archive_db_init() was run before (protection against destroying uninited mutex in the case where mysqld fails early at startup (before archive_db_init() was called) and then calls archive_db_end() to clean up). sql/examples/ha_archive.cc: new static archive_inited variable, so that archive_db_end() will do something only if archive_db_init() was run before. --- sql/examples/ha_archive.cc | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/sql/examples/ha_archive.cc b/sql/examples/ha_archive.cc index 491056d0e59..bc4af0c7dc7 100644 --- a/sql/examples/ha_archive.cc +++ b/sql/examples/ha_archive.cc @@ -114,6 +114,8 @@ data - The data is stored in a "row +blobs" format. */ +/* If the archive storage engine has been inited */ +static bool archive_inited= 0; /* Variables for archive share methods */ pthread_mutex_t archive_mutex; static HASH archive_open_tables; @@ -157,6 +159,7 @@ static byte* archive_get_key(ARCHIVE_SHARE *share,uint *length, bool archive_db_init() { + archive_inited= 1; VOID(pthread_mutex_init(&archive_mutex, MY_MUTEX_INIT_FAST)); return (hash_init(&archive_open_tables, system_charset_info, 32, 0, 0, (hash_get_key) archive_get_key, 0, 0)); @@ -176,8 +179,12 @@ bool archive_db_init() bool archive_db_end() { - hash_free(&archive_open_tables); - VOID(pthread_mutex_destroy(&archive_mutex)); + if (archive_inited) + { + hash_free(&archive_open_tables); + VOID(pthread_mutex_destroy(&archive_mutex)); + } + archive_inited= 0; return FALSE; } From 84d1199692f6619657df7824b30c58a967605206 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 12 Feb 2005 22:58:54 +0300 Subject: [PATCH 0984/1063] Fix for BUG#8218: Remove TMP_TABLE_PARAM::copy_funcs_it. TMP_TABLE_PARAM is a member of JOIN which is copied via memcpy, and List_iterator_fast TMP_TABLE_PARAM::copy_funcs_it ends up pointing to the wrong List. mysql-test/r/subselect.result: Testcase for BUG#8218 mysql-test/t/subselect.test: Testcase for BUG#8218 sql/sql_select.cc: Fix for BUG#8218: Create/use own iterator since TMP_TABLE_PARAM::copy_funcs_it is removed. --- mysql-test/r/subselect.result | 107 ++++++++++++++++++++++++++++++++++ mysql-test/t/subselect.test | 102 ++++++++++++++++++++++++++++++++ sql/sql_class.h | 9 ++- sql/sql_select.cc | 3 +- 4 files changed, 216 insertions(+), 5 deletions(-) diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index 03dcc23c919..1a192602bdc 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -2196,3 +2196,110 @@ ERROR 42S22: Reference 'xx' not supported (forward reference in item list) select 1 = ALL (select 1 from t1 where 1 = xx ), 1 as xx from DUAL; ERROR 42S22: Reference 'xx' not supported (forward reference in item list) drop table t1; +drop table if exists t1, t2, t3, t4, t5; +Warnings: +Note 1051 Unknown table 't1' +Note 1051 Unknown table 't2' +Note 1051 Unknown table 't3' +Note 1051 Unknown table 't4' +Note 1051 Unknown table 't5' +CREATE TABLE t1 ( +categoryId int(11) NOT NULL, +courseId int(11) NOT NULL, +startDate datetime NOT NULL, +endDate datetime NOT NULL, +createDate datetime NOT NULL, +modifyDate timestamp NOT NULL, +attributes text NOT NULL +); +INSERT INTO t1 VALUES (1,41,'2004-02-09','2010-01-01','2004-02-09','2004-02-09',''), +(1,86,'2004-08-16','2004-08-16','2004-08-16','2004-08-16',''), +(1,87,'2004-08-16','2004-08-16','2004-08-16','2004-08-16',''), +(2,52,'2004-03-15','2004-10-01','2004-03-15','2004-09-17',''), +(2,53,'2004-03-16','2004-10-01','2004-03-16','2004-09-17',''), +(2,88,'2004-08-16','2004-08-16','2004-08-16','2004-08-16',''), +(2,89,'2004-08-16','2004-08-16','2004-08-16','2004-08-16',''), +(3,51,'2004-02-09','2010-01-01','2004-02-09','2004-02-09',''), +(5,12,'2004-02-18','2010-01-01','2004-02-18','2004-02-18',''); +CREATE TABLE t2 ( +userId int(11) NOT NULL, +courseId int(11) NOT NULL, +date datetime NOT NULL +); +INSERT INTO t2 VALUES (5141,71,'2003-11-18'), +(5141,72,'2003-11-25'),(5141,41,'2004-08-06'), +(5141,52,'2004-08-06'),(5141,53,'2004-08-06'), +(5141,12,'2004-08-06'),(5141,86,'2004-10-21'), +(5141,87,'2004-10-21'),(5141,88,'2004-10-21'), +(5141,89,'2004-10-22'),(5141,51,'2004-10-26'); +CREATE TABLE t3 ( +groupId int(11) NOT NULL, +parentId int(11) NOT NULL, +startDate datetime NOT NULL, +endDate datetime NOT NULL, +createDate datetime NOT NULL, +modifyDate timestamp NOT NULL, +ordering int(11) +); +INSERT INTO t3 VALUES (12,9,'1000-01-01','3999-12-31','2004-01-29','2004-01-29',NULL); +CREATE TABLE t4 ( +id int(11) NOT NULL, +groupTypeId int(11) NOT NULL, +groupKey varchar(50) NOT NULL, +name text, +ordering int(11), +description text, +createDate datetime NOT NULL, +modifyDate timestamp NOT NULL +); +INSERT INTO t4 VALUES (9,5,'stationer','stationer',0,'Stationer','2004-01-29','2004-01-29'), +(12,5,'group2','group2',0,'group2','2004-01-29','2004-01-29'); +CREATE TABLE t5 ( +userId int(11) NOT NULL, +groupId int(11) NOT NULL, +createDate datetime NOT NULL, +modifyDate timestamp NOT NULL +); +INSERT INTO t5 VALUES (5141,12,'2004-08-06','2004-08-06'); +select +count(distinct t2.userid) pass, +groupstuff.*, +count(t2.courseid) crse, +t1.categoryid, +t2.courseid, +date_format(date, '%b%y') as colhead +from t2 +join t1 on t2.courseid=t1.courseid +join +( +select +t5.userid, +parentid, +parentgroup, +childid, +groupname, +grouptypeid +from t5 +join +( +select t4.id as parentid, +t4.name as parentgroup, +t4.id as childid, +t4.name as groupname, +t4.grouptypeid +from t4 +) as gin on t5.groupid=gin.childid +) as groupstuff on t2.userid = groupstuff.userid +group by +groupstuff.groupname, colhead , t2.courseid; +pass userid parentid parentgroup childid groupname grouptypeid crse categoryid courseid colhead +1 5141 12 group2 12 group2 5 1 5 12 Aug04 +1 5141 12 group2 12 group2 5 1 1 41 Aug04 +1 5141 12 group2 12 group2 5 1 2 52 Aug04 +1 5141 12 group2 12 group2 5 1 2 53 Aug04 +1 5141 12 group2 12 group2 5 1 3 51 Oct04 +1 5141 12 group2 12 group2 5 1 1 86 Oct04 +1 5141 12 group2 12 group2 5 1 1 87 Oct04 +1 5141 12 group2 12 group2 5 1 2 88 Oct04 +1 5141 12 group2 12 group2 5 1 2 89 Oct04 +drop table if exists t1, t2, t3, t4, t5; diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test index 55400dae0be..f72f855f477 100644 --- a/mysql-test/t/subselect.test +++ b/mysql-test/t/subselect.test @@ -1465,3 +1465,105 @@ select 1 = ALL (select 1 from t1 where 1 = xx ), 1 as xx; -- error 1247 select 1 = ALL (select 1 from t1 where 1 = xx ), 1 as xx from DUAL; drop table t1; + +# Test for BUG#8218 +drop table if exists t1, t2, t3, t4, t5; + +CREATE TABLE t1 ( + categoryId int(11) NOT NULL, + courseId int(11) NOT NULL, + startDate datetime NOT NULL, + endDate datetime NOT NULL, + createDate datetime NOT NULL, + modifyDate timestamp NOT NULL, + attributes text NOT NULL +); +INSERT INTO t1 VALUES (1,41,'2004-02-09','2010-01-01','2004-02-09','2004-02-09',''), +(1,86,'2004-08-16','2004-08-16','2004-08-16','2004-08-16',''), +(1,87,'2004-08-16','2004-08-16','2004-08-16','2004-08-16',''), +(2,52,'2004-03-15','2004-10-01','2004-03-15','2004-09-17',''), +(2,53,'2004-03-16','2004-10-01','2004-03-16','2004-09-17',''), +(2,88,'2004-08-16','2004-08-16','2004-08-16','2004-08-16',''), +(2,89,'2004-08-16','2004-08-16','2004-08-16','2004-08-16',''), +(3,51,'2004-02-09','2010-01-01','2004-02-09','2004-02-09',''), +(5,12,'2004-02-18','2010-01-01','2004-02-18','2004-02-18',''); + +CREATE TABLE t2 ( + userId int(11) NOT NULL, + courseId int(11) NOT NULL, + date datetime NOT NULL +); +INSERT INTO t2 VALUES (5141,71,'2003-11-18'), +(5141,72,'2003-11-25'),(5141,41,'2004-08-06'), +(5141,52,'2004-08-06'),(5141,53,'2004-08-06'), +(5141,12,'2004-08-06'),(5141,86,'2004-10-21'), +(5141,87,'2004-10-21'),(5141,88,'2004-10-21'), +(5141,89,'2004-10-22'),(5141,51,'2004-10-26'); + + +CREATE TABLE t3 ( + groupId int(11) NOT NULL, + parentId int(11) NOT NULL, + startDate datetime NOT NULL, + endDate datetime NOT NULL, + createDate datetime NOT NULL, + modifyDate timestamp NOT NULL, + ordering int(11) +); +INSERT INTO t3 VALUES (12,9,'1000-01-01','3999-12-31','2004-01-29','2004-01-29',NULL); + +CREATE TABLE t4 ( + id int(11) NOT NULL, + groupTypeId int(11) NOT NULL, + groupKey varchar(50) NOT NULL, + name text, + ordering int(11), + description text, + createDate datetime NOT NULL, + modifyDate timestamp NOT NULL +); +INSERT INTO t4 VALUES (9,5,'stationer','stationer',0,'Stationer','2004-01-29','2004-01-29'), +(12,5,'group2','group2',0,'group2','2004-01-29','2004-01-29'); + +CREATE TABLE t5 ( + userId int(11) NOT NULL, + groupId int(11) NOT NULL, + createDate datetime NOT NULL, + modifyDate timestamp NOT NULL +); +INSERT INTO t5 VALUES (5141,12,'2004-08-06','2004-08-06'); + +select + count(distinct t2.userid) pass, + groupstuff.*, + count(t2.courseid) crse, + t1.categoryid, + t2.courseid, + date_format(date, '%b%y') as colhead +from t2 +join t1 on t2.courseid=t1.courseid +join +( + select + t5.userid, + parentid, + parentgroup, + childid, + groupname, + grouptypeid + from t5 + join + ( + select t4.id as parentid, + t4.name as parentgroup, + t4.id as childid, + t4.name as groupname, + t4.grouptypeid + from t4 + ) as gin on t5.groupid=gin.childid +) as groupstuff on t2.userid = groupstuff.userid +group by + groupstuff.groupname, colhead , t2.courseid; + +drop table if exists t1, t2, t3, t4, t5; + diff --git a/sql/sql_class.h b/sql/sql_class.h index 657a92b394c..703bb030ab9 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -1295,7 +1295,11 @@ public: #include -/* Param to create temporary tables when doing SELECT:s */ +/* + Param to create temporary tables when doing SELECT:s + NOTE + This structure is copied using memcpy as a part of JOIN. +*/ class TMP_TABLE_PARAM :public Sql_alloc { @@ -1307,7 +1311,6 @@ private: public: List copy_funcs; List save_copy_funcs; - List_iterator_fast copy_funcs_it; Copy_field *copy_field, *copy_field_end; Copy_field *save_copy_field, *save_copy_field_end; byte *group_buff; @@ -1324,7 +1327,7 @@ public: uint convert_blob_length; TMP_TABLE_PARAM() - :copy_funcs_it(copy_funcs), copy_field(0), group_parts(0), + :copy_field(0), group_parts(0), group_length(0), group_null_parts(0), convert_blob_length(0) {} ~TMP_TABLE_PARAM() diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 8353ca9333d..d2c5e9f4ee6 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -8601,8 +8601,7 @@ copy_fields(TMP_TABLE_PARAM *param) for (; ptr != end; ptr++) (*ptr->do_copy)(ptr); - List_iterator_fast &it=param->copy_funcs_it; - it.rewind(); + List_iterator_fast it(param->copy_funcs); Item_copy_string *item; while ((item = (Item_copy_string*) it++)) item->copy(); From 4c21a10f27c6a15690b5640352d23f1c111ac729 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 13 Feb 2005 21:00:07 +0200 Subject: [PATCH 0985/1063] row0mysql.c: Backport the column prefix memory corruption fix from 5.0 innobase/row/row0mysql.c: Backport the column prefix memory corruption fix from 5.0 --- innobase/row/row0mysql.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/innobase/row/row0mysql.c b/innobase/row/row0mysql.c index 1ab7bb1deb0..a915200161f 100644 --- a/innobase/row/row0mysql.c +++ b/innobase/row/row0mysql.c @@ -399,7 +399,7 @@ row_create_prebuilt( prebuilt->sel_graph = NULL; prebuilt->search_tuple = dtuple_create(heap, - dict_table_get_n_cols(table)); + 2 * dict_table_get_n_cols(table)); clust_index = dict_table_get_first_index(table); From a8d2152f973dc56897725356cd0f88310a7689b8 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 13 Feb 2005 22:35:52 +0000 Subject: [PATCH 0986/1063] Bug#2435 Alter handling for UNION syntax Tests for UNION and parentheses mysql-test/r/union.result: Bug#2435 Tests for UNION and parentheses mysql-test/t/union.test: Bug#2435 Tests for UNION and parentheses sql/sql_yacc.yy: Bug#2435 Amend handling of UNION with parentheses. --- mysql-test/r/union.result | 22 ++++++++++++++++++++++ mysql-test/t/union.test | 12 ++++++++++++ sql/sql_yacc.yy | 35 ++++++++++++++++++++++++++++------- 3 files changed, 62 insertions(+), 7 deletions(-) diff --git a/mysql-test/r/union.result b/mysql-test/r/union.result index 115ef6a47f9..f58f0f5b0ac 100644 --- a/mysql-test/r/union.result +++ b/mysql-test/r/union.result @@ -1173,3 +1173,25 @@ show columns from t4; Field Type Null Key Default Extra sdate date YES NULL drop table t1, t2, t3, t4; +create table t1 (a int not null, b char (10) not null); +insert into t1 values(1,'a'),(2,'b'),(3,'c'),(3,'c'); +select * from ((select * from t1 limit 1)) a; +a b +1 a +select * from ((select * from t1 limit 1) union (select * from t1 limit 1)) a; +a b +1 a +select * from ((select * from t1 limit 1) union (select * from t1 limit 1) union (select * from t1 limit 1)) a; +a b +1 a +select * from ((((select * from t1))) union (select * from t1) union (select * from t1)) a; +a b +1 a +2 b +3 c +select * from ((select * from t1) union (((select * from t1))) union (select * from t1)) a; +a b +1 a +2 b +3 c +drop table t1; diff --git a/mysql-test/t/union.test b/mysql-test/t/union.test index 90b2197603b..82f26f63254 100644 --- a/mysql-test/t/union.test +++ b/mysql-test/t/union.test @@ -699,3 +699,15 @@ union order by sdate; show columns from t4; drop table t1, t2, t3, t4; + +# +# Bug #2435 UNION with parentheses not supported +# +create table t1 (a int not null, b char (10) not null); +insert into t1 values(1,'a'),(2,'b'),(3,'c'),(3,'c'); +select * from ((select * from t1 limit 1)) a; +select * from ((select * from t1 limit 1) union (select * from t1 limit 1)) a; +select * from ((select * from t1 limit 1) union (select * from t1 limit 1) union (select * from t1 limit 1)) a; +select * from ((((select * from t1))) union (select * from t1) union (select * from t1)) a; +select * from ((select * from t1) union (((select * from t1))) union (select * from t1)) a; +drop table t1; diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index e70efe14557..988323811ac 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -2389,7 +2389,10 @@ select: select_init: SELECT_SYM select_init2 | - '(' SELECT_SYM select_part2 ')' + '(' select_paren ')' union_opt; + +select_paren: + SELECT_SYM select_part2 { LEX *lex= Lex; SELECT_LEX * sel= lex->current_select; @@ -2408,7 +2411,8 @@ select_init: if (sel->master_unit()->fake_select_lex) sel->master_unit()->global_parameters= sel->master_unit()->fake_select_lex; - } union_opt; + } + | '(' select_paren ')'; select_init2: select_part2 @@ -3404,8 +3408,7 @@ when_list2: }; join_table_list: - '(' join_table_list ')' { $$=$2; } - | join_table { $$=$1; } + join_table { $$=$1; } | join_table_list ',' join_table_list { $$=$3; } | join_table_list normal_join join_table_list { $$=$3; } | join_table_list STRAIGHT_JOIN join_table_list @@ -3482,7 +3485,7 @@ join_table: } | '{' ident join_table LEFT OUTER JOIN_SYM join_table ON expr '}' { add_join_on($7,$9); $7->outer_join|=JOIN_TYPE_LEFT; $$=$7; } - | '(' SELECT_SYM select_derived ')' opt_table_alias + | '(' select_derived union_opt ')' opt_table_alias { LEX *lex=Lex; SELECT_LEX_UNIT *unit= lex->current_select->master_unit(); @@ -3493,9 +3496,27 @@ join_table: (List *)0))) YYABORT; - }; + } + | '(' join_table_list ')' { $$=$2; }; select_derived: + SELECT_SYM select_derived2 + | '(' select_derived ')' + { + LEX *lex= Lex; + SELECT_LEX * sel= lex->current_select; + if (sel->set_braces(1)) + { + yyerror(ER(ER_SYNTAX_ERROR)); + YYABORT; + } + /* select in braces, can't contain global parameters */ + if (sel->master_unit()->fake_select_lex) + sel->master_unit()->global_parameters= + sel->master_unit()->fake_select_lex; + }; + +select_derived2: { LEX *lex= Lex; lex->derived_tables= 1; @@ -3517,7 +3538,7 @@ select_derived: { Select->parsing_place= NO_MATTER; } - opt_select_from union_opt + opt_select_from ; opt_outer: From f048032c6843548ca6c04d78b2dd77ff5eddbe9e Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 14 Feb 2005 02:06:21 +0200 Subject: [PATCH 0987/1063] removed wrong distinct UNION detection (BUG#6565) mysql-test/r/derived.result: test of union subquery in the FROM clause with complex distinct/all mysql-test/t/derived.test: test of union subquery in the FROM clause with complex distinct/all sql/sql_derived.cc: removed wrong distinct UNION detection --- mysql-test/r/derived.result | 19 +++++++++++++++++++ mysql-test/t/derived.test | 12 ++++++++++++ sql/sql_derived.cc | 10 ++++++++-- 3 files changed, 39 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/derived.result b/mysql-test/r/derived.result index 61d745d0236..b4d9a921178 100644 --- a/mysql-test/r/derived.result +++ b/mysql-test/r/derived.result @@ -339,3 +339,22 @@ select distinct sum(b) from (select a,b from t1) y group by a; sum(b) 4 drop table t1; +create table t1(a int); +create table t2(a int); +create table t3(a int); +insert into t1 values(1),(1); +insert into t2 values(2),(2); +insert into t3 values(3),(3); +select * from t1 union distinct select * from t2 union all select * from t3; +a +1 +2 +3 +3 +select * from (select * from t1 union distinct select * from t2 union all select * from t3) X; +a +1 +2 +3 +3 +drop table t1, t2, t3; diff --git a/mysql-test/t/derived.test b/mysql-test/t/derived.test index 8b322746ed6..bd27e0654e0 100644 --- a/mysql-test/t/derived.test +++ b/mysql-test/t/derived.test @@ -224,3 +224,15 @@ select distinct sum(b) from t1 group by a; select distinct sum(b) from (select a,b from t1) y group by a; drop table t1; +# +# test of union subquery in the FROM clause with complex distinct/all (BUG#6565) +# +create table t1(a int); +create table t2(a int); +create table t3(a int); +insert into t1 values(1),(1); +insert into t2 values(2),(2); +insert into t3 values(3),(3); +select * from t1 union distinct select * from t2 union all select * from t3; +select * from (select * from t1 union distinct select * from t2 union all select * from t3) X; +drop table t1, t2, t3; diff --git a/sql/sql_derived.cc b/sql/sql_derived.cc index 9475ec08c96..3e627243b9f 100644 --- a/sql/sql_derived.cc +++ b/sql/sql_derived.cc @@ -132,10 +132,16 @@ static int mysql_derived(THD *thd, LEX *lex, SELECT_LEX_UNIT *unit, /* Temp table is created so that it hounours if UNION without ALL is to be processed + + As 'distinct' parameter we always pass FALSE (0), because underlying + query will control distinct condition by itself. Correct test of + distinct underlying query will be is_union && + !unit->union_distinct->next_select() (i.e. it is union and last distinct + SELECT is last SELECT of UNION). */ if (!(table= create_tmp_table(thd, &derived_result->tmp_table_param, - unit->types, (ORDER*) 0, - is_union && unit->union_distinct, 1, + unit->types, (ORDER*) 0, + FALSE, 1, (first_select->options | thd->options | TMP_TABLE_ALL_COLUMNS), HA_POS_ERROR, From 9f2240b47908a53c3559592ce4b54a51846e16f3 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 14 Feb 2005 08:28:47 +0100 Subject: [PATCH 0988/1063] wl1292 - ndb autotest fix log reports ndb/test/run-test/make-html-reports.sh: fix log reports --- ndb/test/run-test/make-html-reports.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ndb/test/run-test/make-html-reports.sh b/ndb/test/run-test/make-html-reports.sh index 6278b835dea..67395ceba47 100755 --- a/ndb/test/run-test/make-html-reports.sh +++ b/ndb/test/run-test/make-html-reports.sh @@ -158,8 +158,7 @@ do *) fail; res_txt="FAILED";; esac - if [ ! -d "result.$no" ]; then res_dir=" "; fi - + if [ ! -d "$src_dir/result.$no" ]; then res_dir=" "; fi total=`expr $total + $time` From 35a4a58481489d85958a4cc7f83c9ed34e6e3eec Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 14 Feb 2005 11:12:39 +0100 Subject: [PATCH 0989/1063] - fixed the compilation comments - fixed a broken changelog entry --- support-files/mysql.spec.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index b06ba462b26..1829daeab5b 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -276,7 +276,6 @@ sh -c "PATH=\"${MYSQL_BUILD_PATH:-$PATH}\" \ --includedir=%{_includedir} \ --mandir=%{_mandir} \ --enable-thread-safe-client \ - --with-comment=\"Official MySQL RPM\" \ --with-readline ; # Add this for more debugging support # --with-debug @@ -333,6 +332,7 @@ BuildMySQL "--enable-shared \ --with-csv-storage-engine \ --with-example-storage-engine \ --with-embedded-server \ + --with-comment=\"MySQL Community Edition - Max (GPL)\" \ --with-server-suffix='-Max'" # Save everything for debug @@ -379,6 +379,7 @@ BuildMySQL "--disable-shared \ --with-client-ldflags='-all-static' \ $USE_OTHER_LIBC_DIR \ %endif + --with-comment=\"MySQL Community Edition - Standard (GPL)\" \ --with-server-suffix='%{server_suffix}' \ --without-embedded-server \ --without-berkeley-db \ @@ -694,7 +695,12 @@ fi # itself - note that they must be ordered by date (important when # merging BK trees) %changelog -* Monday Feb 7 2005 Tomas Ulin +* Mon Feb 14 2005 Tomas Ulin + +* Fixed the compilation comments and moved them into the separate build sections + for Max and Standard + +* Mon Feb 7 2005 Tomas Ulin - enabled the "Ndbcluster" storage engine for the max binary - added extra make install in ndb subdir after Max build to get ndb binaries From e2b6480162743d7eaa62bf7b64e92778191b25d9 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 14 Feb 2005 11:14:04 +0100 Subject: [PATCH 0990/1063] remove passwordless remote accounts from windows distro --- scripts/mysql_create_system_tables.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/scripts/mysql_create_system_tables.sh b/scripts/mysql_create_system_tables.sh index f524b322388..83fdc0639ce 100644 --- a/scripts/mysql_create_system_tables.sh +++ b/scripts/mysql_create_system_tables.sh @@ -163,9 +163,7 @@ then INSERT INTO user (host,user) values ('localhost','');" else i_u="$i_u - INSERT INTO user VALUES ('%','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); - INSERT INTO user VALUES ('localhost','','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); - INSERT INTO user VALUES ('%','','','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','','','','',0,0,0);" + INSERT INTO user VALUES ('localhost','','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0);" fi fi fi From de3f93c6ff8e59490db22d1b0781601bf30a4039 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 14 Feb 2005 18:54:12 +0400 Subject: [PATCH 0991/1063] Bug#8351 Fix for crash when using a double quote in boolean fulltext query. mysql-test/r/fulltext.result: Added a test case for bug #8351. mysql-test/t/fulltext.test: Added a test case for bug #8351. BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted --- BitKeeper/etc/logging_ok | 1 + myisam/ft_boolean_search.c | 36 ++++++++++++++---------------------- mysql-test/r/fulltext.result | 7 +++++++ mysql-test/t/fulltext.test | 8 ++++++++ 4 files changed, 30 insertions(+), 22 deletions(-) diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok index 59882283d5d..b88eb69544d 100644 --- a/BitKeeper/etc/logging_ok +++ b/BitKeeper/etc/logging_ok @@ -203,6 +203,7 @@ serg@sergbook.mysql.com sergefp@mysql.com sinisa@rhols221.adsl.netsonic.fi stewart@mysql.com +svoj@mysql.com tfr@beta.frontier86.ee tfr@indrek.tfr.cafe.ee tfr@sarvik.tfr.cafe.ee diff --git a/myisam/ft_boolean_search.c b/myisam/ft_boolean_search.c index 4253b5ff96f..62c68322595 100644 --- a/myisam/ft_boolean_search.c +++ b/myisam/ft_boolean_search.c @@ -435,32 +435,24 @@ static int _ftb_strstr(const byte *s0, const byte *e0, const byte *s1, const byte *e1, CHARSET_INFO *cs) { - const byte *p0, *p1; - my_bool s_after, e_before; - - s_after=true_word_char(cs, s1[0]); - e_before=true_word_char(cs, e1[-1]); - p0=s0; + const byte *p0= s0; + my_bool s_after= true_word_char(cs, s1[0]); + my_bool e_before= true_word_char(cs, e1[-1]); + uint p0_len; + my_match_t m[2]; while (p0 < e0) { - while (p0 < e0 && cs->to_upper[(uint) (uchar) *p0++] != - cs->to_upper[(uint) (uchar) *s1]) - /* no-op */; - if (p0 >= e0) - return 0; - - if (s_after && p0-1 > s0 && true_word_char(cs, p0[-2])) - continue; - - p1=s1+1; - while (p0 < e0 && p1 < e1 && cs->to_upper[(uint) (uchar) *p0] == - cs->to_upper[(uint) (uchar) *p1]) - p0++, p1++; - if (p1 == e1 && (!e_before || p0 == e0 || !true_word_char(cs, p0[0]))) - return 1; + if (cs->coll->instr(cs, p0, e0 - p0, s1, e1 - s1, m, 2) != 2) + return(0); + if ((!s_after || p0 + m[1].beg == s0 || !true_word_char(cs, p0[m[1].beg-1])) && + (!e_before || p0 + m[1].end == e0 || !true_word_char(cs, p0[m[1].end]))) + return(1); + p0+= m[1].beg; + p0+= (p0_len= my_mbcharlen(cs, *(uchar *)p0)) ? p0_len : 1; } - return 0; + + return(0); } diff --git a/mysql-test/r/fulltext.result b/mysql-test/r/fulltext.result index a042248ba34..67644a68598 100644 --- a/mysql-test/r/fulltext.result +++ b/mysql-test/r/fulltext.result @@ -408,3 +408,10 @@ insert t1 values (1, "aaaa"), (2, "bbbb"); insert t2 values (10, "aaaa"), (2, "cccc"); replace t1 select * from t2; drop table t1, t2; +CREATE TABLE t1 (t VARCHAR(200) CHARACTER SET utf8 COLLATE utf8_unicode_ci, FULLTEXT (t)); +SET NAMES latin1; +INSERT INTO t1 VALUES('Mit freundlichem Grüß aus Osnabrück'); +SELECT COUNT(*) FROM t1 WHERE MATCH(t) AGAINST ('"osnabrück"' IN BOOLEAN MODE); +COUNT(*) +1 +DROP TABLE t1; diff --git a/mysql-test/t/fulltext.test b/mysql-test/t/fulltext.test index 62dcecaff68..50d01da080f 100644 --- a/mysql-test/t/fulltext.test +++ b/mysql-test/t/fulltext.test @@ -322,3 +322,11 @@ insert t2 values (10, "aaaa"), (2, "cccc"); replace t1 select * from t2; drop table t1, t2; +# +# bug#8351 +# +CREATE TABLE t1 (t VARCHAR(200) CHARACTER SET utf8 COLLATE utf8_unicode_ci, FULLTEXT (t)); +SET NAMES latin1; +INSERT INTO t1 VALUES('Mit freundlichem Grüß aus Osnabrück'); +SELECT COUNT(*) FROM t1 WHERE MATCH(t) AGAINST ('"osnabrück"' IN BOOLEAN MODE); +DROP TABLE t1; From 8a8d476453437b27df0bc7ff63d138c743df11f1 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 14 Feb 2005 18:39:33 +0100 Subject: [PATCH 0992/1063] Bug#8412: For replication to work correctly, the prologue and epilogue to an SQL statement should not have an error code even when the SQL statement itself has an error code. mysql-test/r/rpl_insert_id.result: Adding test to ensure that slave handles error statement gracefully. mysql-test/t/rpl_insert_id.test: Adding test to ensure that slave handles error statement gracefully. sql/log.cc: Setting error code to 0 for SQL statement prologue and epilogue. --- mysql-test/r/rpl_insert_id.result | 5 +++++ mysql-test/t/rpl_insert_id.test | 16 ++++++++++++++++ sql/log.cc | 15 ++++++++++++++- 3 files changed, 35 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/rpl_insert_id.result b/mysql-test/r/rpl_insert_id.result index d2dfbb05675..da815241bbe 100644 --- a/mysql-test/r/rpl_insert_id.result +++ b/mysql-test/r/rpl_insert_id.result @@ -69,3 +69,8 @@ b c 9 13 drop table t1; drop table t2; +SET TIMESTAMP=1000000000; +CREATE TABLE t1 ( a INT UNIQUE ); +SET FOREIGN_KEY_CHECKS=0; +INSERT INTO t1 VALUES (1),(1); +Duplicate entry '1' for key 1 diff --git a/mysql-test/t/rpl_insert_id.test b/mysql-test/t/rpl_insert_id.test index a6da44de456..33d6516632a 100644 --- a/mysql-test/t/rpl_insert_id.test +++ b/mysql-test/t/rpl_insert_id.test @@ -62,3 +62,19 @@ drop table t2; save_master_pos; connection slave; sync_with_master; + +# +# Bug#8412: Error codes reported in binary log for CHARACTER SET, +# FOREIGN_KEY_CHECKS +# +connection master; +SET TIMESTAMP=1000000000; +CREATE TABLE t1 ( a INT UNIQUE ); +SET FOREIGN_KEY_CHECKS=0; +--error 1062 +INSERT INTO t1 VALUES (1),(1); +sync_slave_with_master; + + + + diff --git a/sql/log.cc b/sql/log.cc index b46a8de056e..18c644473f1 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -1182,6 +1182,7 @@ bool MYSQL_LOG::write(Log_event* event_info) p= strmov(strmov(buf, "SET CHARACTER SET "), thd->variables.convert_set->name); Query_log_event e(thd, buf, (ulong) (p - buf), 0); + e.error_code = 0; // This statement cannot fail (see [1]). e.set_log_pos(this); if (e.write(file)) goto err; @@ -1199,12 +1200,22 @@ bool MYSQL_LOG::write(Log_event* event_info) { Query_log_event e(thd, "SET FOREIGN_KEY_CHECKS=0", 24, 0); e.set_log_pos(this); + e.error_code = 0; // This statement cannot fail (see [1]). if (e.write(file)) goto err; } } - /* Write the SQL command */ + /* + Write the SQL command + + [1] If this statement has an error code, the slave is required to fail + with the same error code or stop. The preamble and epilogue should + *not* have this error code since the execution of those is + guaranteed *not* to produce any error code. This would therefore + stop the slave even if the execution of the real statement can be + handled gracefully by the slave. + */ event_info->set_log_pos(this); if (event_info->write(file)) @@ -1218,6 +1229,7 @@ bool MYSQL_LOG::write(Log_event* event_info) { Query_log_event e(thd, "SET FOREIGN_KEY_CHECKS=1", 24, 0); e.set_log_pos(this); + e.error_code = 0; // This statement cannot fail (see [1]). if (e.write(file)) goto err; } @@ -1226,6 +1238,7 @@ bool MYSQL_LOG::write(Log_event* event_info) { Query_log_event e(thd, "SET CHARACTER SET DEFAULT", 25, 0); e.set_log_pos(this); + e.error_code = 0; // This statement cannot fail (see [1]). if (e.write(file)) goto err; } From 4173610bd23f07545843e0671f402cfcb6eadc32 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 14 Feb 2005 23:45:48 +0300 Subject: [PATCH 0993/1063] Remove redundant DROP TABLE from test case --- mysql-test/r/subselect.result | 7 ------- mysql-test/t/subselect.test | 1 - 2 files changed, 8 deletions(-) diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index 1a192602bdc..5d5b11d629d 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -2196,13 +2196,6 @@ ERROR 42S22: Reference 'xx' not supported (forward reference in item list) select 1 = ALL (select 1 from t1 where 1 = xx ), 1 as xx from DUAL; ERROR 42S22: Reference 'xx' not supported (forward reference in item list) drop table t1; -drop table if exists t1, t2, t3, t4, t5; -Warnings: -Note 1051 Unknown table 't1' -Note 1051 Unknown table 't2' -Note 1051 Unknown table 't3' -Note 1051 Unknown table 't4' -Note 1051 Unknown table 't5' CREATE TABLE t1 ( categoryId int(11) NOT NULL, courseId int(11) NOT NULL, diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test index f72f855f477..2e2c8753daf 100644 --- a/mysql-test/t/subselect.test +++ b/mysql-test/t/subselect.test @@ -1467,7 +1467,6 @@ select 1 = ALL (select 1 from t1 where 1 = xx ), 1 as xx from DUAL; drop table t1; # Test for BUG#8218 -drop table if exists t1, t2, t3, t4, t5; CREATE TABLE t1 ( categoryId int(11) NOT NULL, From 4cead8c8a500f45952e6f9956293320d36ed505c Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 14 Feb 2005 23:47:17 +0100 Subject: [PATCH 0994/1063] 1) undoing my fix for BUG#8055 "Trouble with replication from temporary tables and ignores" and fixing it another way (per Monty; a simpler solution which does not increase the number of binlog events is to always execute DROP TEMPORARY TABLE IF EXISTS on slave). A new test rpl_drop_temp. 2) fixing BUG#8436 "Multiple "stacked" SQL statements cause replication to stop" by setting thd->query_length to the length of the query being executed, not counting the next queries if this is a multi-query. Should also improve display of SHOW PROCESSLIST. A new test rpl_multi_query. mysql-test/r/drop_temp_table.result: back to one single DROP sql/sql_base.cc: undoing the fix I had made some days ago: we are back to one single DROP TEMPORARY TABLE for all temp tables. sql/sql_parse.cc: 1) set thd->query_length to the length of the query being executed, excluding the other next queries if this is a multi-query. The setting happens ASAP, ie. just after we know it's a multi-query, ie. just after yyparse(). Don't include the ';' in thd->query_length, because this is not good for storage in binlog. 2) always execute a DROP TEMPORARY TABLE IF EXISTS on slave, don't skip it even if --replicate-ignore-table --- mysql-test/r/drop_temp_table.result | 4 +- mysql-test/r/rpl_drop_temp.result | 12 +++++ mysql-test/r/rpl_multi_query.result | 32 ++++++++++++++ mysql-test/t/rpl_drop_temp-slave.opt | 2 + mysql-test/t/rpl_drop_temp.test | 13 ++++++ mysql-test/t/rpl_multi_query.test | 26 +++++++++++ sql/sql_base.cc | 66 +++++++++++++++------------- sql/sql_parse.cc | 26 +++++++++-- 8 files changed, 144 insertions(+), 37 deletions(-) create mode 100644 mysql-test/r/rpl_drop_temp.result create mode 100644 mysql-test/r/rpl_multi_query.result create mode 100644 mysql-test/t/rpl_drop_temp-slave.opt create mode 100644 mysql-test/t/rpl_drop_temp.test create mode 100644 mysql-test/t/rpl_multi_query.test diff --git a/mysql-test/r/drop_temp_table.result b/mysql-test/r/drop_temp_table.result index a486964feb2..5f1f142cde5 100644 --- a/mysql-test/r/drop_temp_table.result +++ b/mysql-test/r/drop_temp_table.result @@ -17,8 +17,6 @@ master-bin.000001 # Query 1 # create database `drop-temp+table-test` master-bin.000001 # Query 1 # use `drop-temp+table-test`; create temporary table shortn1 (a int) master-bin.000001 # Query 1 # use `drop-temp+table-test`; create temporary table `table:name` (a int) master-bin.000001 # Query 1 # use `drop-temp+table-test`; create temporary table shortn2 (a int) -master-bin.000001 # Query 1 # use `drop-temp+table-test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `drop-temp+table-test`.`shortn2` -master-bin.000001 # Query 1 # use `drop-temp+table-test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `drop-temp+table-test`.`table:name` -master-bin.000001 # Query 1 # use `drop-temp+table-test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `drop-temp+table-test`.`shortn1` +master-bin.000001 # Query 1 # use `drop-temp+table-test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `drop-temp+table-test`.`shortn2`,`drop-temp+table-test`.`table:name`,`drop-temp+table-test`.`shortn1` master-bin.000001 # Query 1 # use `drop-temp+table-test`; DO RELEASE_LOCK("a") drop database `drop-temp+table-test`; diff --git a/mysql-test/r/rpl_drop_temp.result b/mysql-test/r/rpl_drop_temp.result new file mode 100644 index 00000000000..e00309cac8f --- /dev/null +++ b/mysql-test/r/rpl_drop_temp.result @@ -0,0 +1,12 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +create database if not exists mysqltest; +create temporary table mysqltest.t1 (n int); +create temporary table mysqltest.t2 (n int); +show status like 'Slave_open_temp_tables'; +Variable_name Value +Slave_open_temp_tables 0 diff --git a/mysql-test/r/rpl_multi_query.result b/mysql-test/r/rpl_multi_query.result new file mode 100644 index 00000000000..2521dbe1ed9 --- /dev/null +++ b/mysql-test/r/rpl_multi_query.result @@ -0,0 +1,32 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +drop database if exists mysqltest; +create database mysqltest; +create table mysqltest.t1 ( n int); +insert into mysqltest.t1 values(1)/ +insert into mysqltest.t1 values(2); +insert into mysqltest.t1 values(3); +insert into mysqltest.t1 values(4); +insert into mysqltest.t1 values(5)/ +select * from mysqltest.t1; +n +1 +2 +3 +4 +5 +show binlog events from 79; +Log_name Pos Event_type Server_id Orig_log_pos Info +master-bin.000001 # Query 1 # drop database if exists mysqltest +master-bin.000001 # Query 1 # create database mysqltest +master-bin.000001 # Query 1 # use `test`; create table mysqltest.t1 ( n int) +master-bin.000001 # Query 1 # use `test`; insert into mysqltest.t1 values(1) +master-bin.000001 # Query 1 # use `test`; insert into mysqltest.t1 values(2) +master-bin.000001 # Query 1 # use `test`; insert into mysqltest.t1 values(3) +master-bin.000001 # Query 1 # use `test`; insert into mysqltest.t1 values(4) +master-bin.000001 # Query 1 # use `test`; insert into mysqltest.t1 values(5) +drop database mysqltest; diff --git a/mysql-test/t/rpl_drop_temp-slave.opt b/mysql-test/t/rpl_drop_temp-slave.opt new file mode 100644 index 00000000000..2f9244c65ff --- /dev/null +++ b/mysql-test/t/rpl_drop_temp-slave.opt @@ -0,0 +1,2 @@ +--replicate-ignore-table=mysqltest.t2 + diff --git a/mysql-test/t/rpl_drop_temp.test b/mysql-test/t/rpl_drop_temp.test new file mode 100644 index 00000000000..73d691d9d90 --- /dev/null +++ b/mysql-test/t/rpl_drop_temp.test @@ -0,0 +1,13 @@ +source include/master-slave.inc; +--disable_warnings +create database if not exists mysqltest; +--enable_warnings + +create temporary table mysqltest.t1 (n int); +create temporary table mysqltest.t2 (n int); +sync_slave_with_master; +connection master; +disconnect master; +connection slave; +--real_sleep 3; # time for DROP to be written +show status like 'Slave_open_temp_tables'; diff --git a/mysql-test/t/rpl_multi_query.test b/mysql-test/t/rpl_multi_query.test new file mode 100644 index 00000000000..15f5d288759 --- /dev/null +++ b/mysql-test/t/rpl_multi_query.test @@ -0,0 +1,26 @@ +# Test for BUG#8436: verify that a multi-query (i.e. one query +# containing several queries (assuming client has +# CLIENT_MULTI_STATEMENTS) will be binlogged ONE-query-per-event (not +# one binlog event containing all queries) + +source include/master-slave.inc; +--disable_warnings +drop database if exists mysqltest; +--enable_warnings +create database mysqltest; + +delimiter /; +create table mysqltest.t1 ( n int); +insert into mysqltest.t1 values(1)/ +insert into mysqltest.t1 values(2); +insert into mysqltest.t1 values(3); +insert into mysqltest.t1 values(4); +insert into mysqltest.t1 values(5)/ +delimiter ;/ +sync_slave_with_master; +select * from mysqltest.t1; +connection master; +--replace_column 2 # 5 # +show binlog events from 79; +drop database mysqltest; +sync_slave_with_master; diff --git a/sql/sql_base.cc b/sql/sql_base.cc index fe1f268e277..7434897ab90 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -485,58 +485,62 @@ void close_temporary(TABLE *table,bool delete_table) void close_temporary_tables(THD *thd) { TABLE *table,*next; - char *query, *name_in_query, *end; - uint greatest_key_length= 0; + char *query, *end; + uint query_buf_size; + bool found_user_tables = 0; if (!thd->temporary_tables) return; - /* - We write a DROP TEMPORARY TABLE for each temp table left, so that our - replication slave can clean them up. Not one multi-table DROP TABLE binlog - event: this would cause problems if slave uses --replicate-*-table. - */ LINT_INIT(end); + query_buf_size= 50; // Enough for DROP ... TABLE IF EXISTS - /* We'll re-use always same buffer so make it big enough for longest name */ for (table=thd->temporary_tables ; table ; table=table->next) - greatest_key_length= max(greatest_key_length, table->key_length); + /* + We are going to add 4 ` around the db/table names, so 1 does not look + enough; indeed it is enough, because table->key_length is greater (by 8, + because of server_id and thread_id) than db||table. + */ + query_buf_size+= table->key_length+1; - if ((query = alloc_root(thd->mem_root, greatest_key_length+50))) + if ((query = alloc_root(thd->mem_root, query_buf_size))) // Better add "if exists", in case a RESET MASTER has been done - name_in_query= strmov(query, "DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `"); + end=strmov(query, "DROP /*!40005 TEMPORARY */ TABLE IF EXISTS "); for (table=thd->temporary_tables ; table ; table=next) { - /* - In we are OOM for 'query' this is not fatal. We skip temporary tables - not created directly by the user. - */ - if (query && mysql_bin_log.is_open() && (table->real_name[0] != '#')) + if (query) // we might be out of memory, but this is not fatal { + // skip temporary tables not created directly by the user + if (table->real_name[0] != '#') + found_user_tables = 1; /* Here we assume table_cache_key always starts with \0 terminated db name */ - end = strxmov(name_in_query, table->table_cache_key, "`.`", - table->real_name, "`", NullS); - Query_log_event qinfo(thd, query, (ulong)(end-query), 0, FALSE); - /* - Imagine the thread had created a temp table, then was doing a SELECT, and - the SELECT was killed. Then it's not clever to mark the statement above as - "killed", because it's not really a statement updating data, and there - are 99.99% chances it will succeed on slave. And, if thread is - killed now, it's not clever either. - If a real update (one updating a persistent table) was killed on the - master, then this real update will be logged with error_code=killed, - rightfully causing the slave to stop. - */ - qinfo.error_code= 0; - mysql_bin_log.write(&qinfo); + end = strxmov(end,"`",table->table_cache_key,"`.`", + table->real_name,"`,", NullS); } next=table->next; close_temporary(table); } + if (query && found_user_tables && mysql_bin_log.is_open()) + { + /* The -1 is to remove last ',' */ + thd->clear_error(); + Query_log_event qinfo(thd, query, (ulong)(end-query)-1, 0, FALSE); + /* + Imagine the thread had created a temp table, then was doing a SELECT, and + the SELECT was killed. Then it's not clever to mark the statement above as + "killed", because it's not really a statement updating data, and there + are 99.99% chances it will succeed on slave. + If a real update (one updating a persistent table) was killed on the + master, then this real update will be logged with error_code=killed, + rightfully causing the slave to stop. + */ + qinfo.error_code= 0; + mysql_bin_log.write(&qinfo); + } thd->temporary_tables=0; } diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index e66eeb279d2..f25255ac455 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -1472,6 +1472,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd, { if (alloc_query(thd, packet, packet_length)) break; // fatal error is set + char *packet_end= thd->query + thd->query_length; mysql_log.write(thd,command,"%s",thd->query); DBUG_PRINT("query",("%-.4096s",thd->query)); mysql_parse(thd,thd->query, thd->query_length); @@ -1487,7 +1488,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd, if (thd->lock || thd->open_tables || thd->derived_tables) close_thread_tables(thd); #endif - ulong length= thd->query_length-(ulong)(packet-thd->query); + ulong length= (ulong)(packet_end-packet); /* Remove garbage at start of query */ while (my_isspace(thd->charset(), *packet) && length > 0) @@ -1924,9 +1925,14 @@ mysql_execute_command(THD *thd) } /* Skip if we are in the slave thread, some table rules have been - given and the table list says the query should not be replicated + given and the table list says the query should not be replicated. + Exception is DROP TEMPORARY TABLE IF EXISTS: we always execute it + (otherwise we have stale files on slave caused by exclusion of one tmp + table). */ - if (all_tables_not_ok(thd,tables)) + if (!(lex->sql_command == SQLCOM_DROP_TABLE && + lex->drop_temporary && lex->drop_if_exists) && + all_tables_not_ok(thd,tables)) { /* we warn the slave SQL thread */ my_error(ER_SLAVE_IGNORED_TABLE, MYF(0)); @@ -4118,6 +4124,20 @@ void mysql_parse(THD *thd, char *inBuf, uint length) send_error(thd, 0, NullS); else { + /* + Binlog logs a string starting from thd->query and having length + thd->query_length; so we set thd->query_length correctly (to not + log several statements in one event, when we executed only first). + We set it to not see the ';' (otherwise it would get into binlog + and Query_log_event::print() would give ';;' output). + This also helps display only the current query in SHOW + PROCESSLIST. + Note that we don't need LOCK_thread_count to modify query_length. + */ + if (lex->found_colon && + (thd->query_length= (ulong)(lex->found_colon - thd->query))) + thd->query_length--; + /* Actually execute the query */ mysql_execute_command(thd); query_cache_end_of_result(thd); } From de109e463bb699305bdcf116280c412dc7da2566 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 15 Feb 2005 03:55:44 +0300 Subject: [PATCH 0995/1063] Fix signatures of placement operator delete in places where placement delete is declared. As we don't use exceptions placement delete is never called and the fix only affects numerous warnings when compiling with MS Visual C++. For more info see http://www.gotw.ca/gotw/010.htm. sql/item.h: Fix the signature of placement operator delete for class Item. sql/sql_class.cc: Add placement delete operator to suppress a warning under Windows. sql/sql_lex.h: Fix the signature of placement operator delete for class LEX sql/sql_list.h: Fix the signature of placement operator delete for class Sql_alloc sql/sql_string.h: Fix the signature of placement operator delete for class Sql_string --- sql/item.h | 2 +- sql/sql_class.cc | 2 ++ sql/sql_lex.h | 2 +- sql/sql_list.h | 4 ++-- sql/sql_string.h | 2 +- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/sql/item.h b/sql/item.h index a8b892292d3..db5010799fa 100644 --- a/sql/item.h +++ b/sql/item.h @@ -119,7 +119,7 @@ public: static void *operator new(size_t size, MEM_ROOT *mem_root) { return (void*) alloc_root(mem_root, (uint) size); } static void operator delete(void *ptr,size_t size) {} - static void operator delete(void *ptr,size_t size, MEM_ROOT *mem_root) {} + static void operator delete(void *ptr, MEM_ROOT *mem_root) {} enum Type {FIELD_ITEM, FUNC_ITEM, SUM_FUNC_ITEM, STRING_ITEM, INT_ITEM, REAL_ITEM, NULL_ITEM, VARBIN_ITEM, diff --git a/sql/sql_class.cc b/sql/sql_class.cc index e11d8369f57..918e70fbc84 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -707,6 +707,8 @@ struct Item_change_record: public ilink Item *old_value; /* Placement new was hidden by `new' in ilink (TODO: check): */ static void *operator new(size_t size, void *mem) { return mem; } + static void operator delete(void *ptr, size_t size) {} + static void operator delete(void *ptr, void *mem) { /* never called */ } }; diff --git a/sql/sql_lex.h b/sql/sql_lex.h index 7cb71607edf..3e2f6a3f2b5 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -241,7 +241,7 @@ public: static void *operator new(size_t size, MEM_ROOT *mem_root) { return (void*) alloc_root(mem_root, (uint) size); } static void operator delete(void *ptr,size_t size) {} - static void operator delete(void *ptr,size_t size, MEM_ROOT *mem_root) {} + static void operator delete(void *ptr, MEM_ROOT *mem_root) {} st_select_lex_node(): linkage(UNSPECIFIED_TYPE) {} virtual ~st_select_lex_node() {} inline st_select_lex_node* get_master() { return master; } diff --git a/sql/sql_list.h b/sql/sql_list.h index a607b31d60c..be3e29b0c62 100644 --- a/sql/sql_list.h +++ b/sql/sql_list.h @@ -41,8 +41,8 @@ public: static void *operator new(size_t size, MEM_ROOT *mem_root) { return (void*) alloc_root(mem_root, (uint) size); } static void operator delete(void *ptr, size_t size) { TRASH(ptr, size); } - static void operator delete(void *ptr, size_t size, MEM_ROOT *mem_root) - { TRASH(ptr, size); } + static void operator delete(void *ptr, MEM_ROOT *mem_root) + { /* never called */ } static void operator delete[](void *ptr, size_t size) { TRASH(ptr, size); } #ifdef HAVE_purify bool dummy; diff --git a/sql/sql_string.h b/sql/sql_string.h index 9136dddbbf2..3ad4689cf36 100644 --- a/sql/sql_string.h +++ b/sql/sql_string.h @@ -73,7 +73,7 @@ public: { return (void*) alloc_root(mem_root, (uint) size); } static void operator delete(void *ptr_arg,size_t size) {} - static void operator delete(void *ptr_arg,size_t size, MEM_ROOT *mem_root) + static void operator delete(void *ptr_arg, MEM_ROOT *mem_root) {} ~String() { free(); } From ddcb947ff73d89233093fb696212a8f788c952df Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 14 Feb 2005 20:33:14 -0800 Subject: [PATCH 0996/1063] Allow hostnames that are IP addresses with a netmask even when running with --skip-name-resolve. (Bug #8471) sql/sql_acl.cc: Add '/' to list of characters that doesn't trigger a need for resolving the hostname, so that the IP mask syntax works with skip-name-resolve. --- mysql-test/r/skip_name_resolve.result | 7 +++++++ mysql-test/t/skip_name_resolve-master.opt | 1 + mysql-test/t/skip_name_resolve.test | 5 +++++ sql/sql_acl.cc | 2 +- 4 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 mysql-test/r/skip_name_resolve.result create mode 100644 mysql-test/t/skip_name_resolve-master.opt create mode 100644 mysql-test/t/skip_name_resolve.test diff --git a/mysql-test/r/skip_name_resolve.result b/mysql-test/r/skip_name_resolve.result new file mode 100644 index 00000000000..d8d873699a5 --- /dev/null +++ b/mysql-test/r/skip_name_resolve.result @@ -0,0 +1,7 @@ +GRANT ALL ON test.* TO mysqltest_1@'127.0.0.1/255.255.255.255'; +SHOW GRANTS FOR mysqltest_1@'127.0.0.1/255.255.255.255'; +Grants for mysqltest_1@127.0.0.1/255.255.255.255 +GRANT USAGE ON *.* TO 'mysqltest_1'@'127.0.0.1/255.255.255.255' +GRANT ALL PRIVILEGES ON `test`.* TO 'mysqltest_1'@'127.0.0.1/255.255.255.255' +REVOKE ALL ON test.* FROM mysqltest_1@'127.0.0.1/255.255.255.255'; +DROP USER mysqltest_1@'127.0.0.1/255.255.255.255'; diff --git a/mysql-test/t/skip_name_resolve-master.opt b/mysql-test/t/skip_name_resolve-master.opt new file mode 100644 index 00000000000..ab6ca1731f5 --- /dev/null +++ b/mysql-test/t/skip_name_resolve-master.opt @@ -0,0 +1 @@ +--skip-name-resolve diff --git a/mysql-test/t/skip_name_resolve.test b/mysql-test/t/skip_name_resolve.test new file mode 100644 index 00000000000..68dcf329427 --- /dev/null +++ b/mysql-test/t/skip_name_resolve.test @@ -0,0 +1,5 @@ +# Bug #8471: IP address with mask fail when skip-name-resolve is on +GRANT ALL ON test.* TO mysqltest_1@'127.0.0.1/255.255.255.255'; +SHOW GRANTS FOR mysqltest_1@'127.0.0.1/255.255.255.255'; +REVOKE ALL ON test.* FROM mysqltest_1@'127.0.0.1/255.255.255.255'; +DROP USER mysqltest_1@'127.0.0.1/255.255.255.255'; diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 7c17a4ef275..f437a432921 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -1339,7 +1339,7 @@ bool hostname_requires_resolving(const char *hostname) return FALSE; for (; (cur=*hostname); hostname++) { - if ((cur != '%') && (cur != '_') && (cur != '.') && + if ((cur != '%') && (cur != '_') && (cur != '.') && (cur != '/') && ((cur < '0') || (cur > '9'))) return TRUE; } From 658bac84bf8fcc8d57c94e65e2097164af88eb50 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 15 Feb 2005 11:16:17 +0200 Subject: [PATCH 0997/1063] InnoDB: Create temporary files in the MySQL tmpdir instead of $TMPDIR. (Bug #5822) sql/ha_innodb.cc: innobase_mysql_tmpfile(): pass mysql_tmpdir to create_temp_file(), so that the MySQL startup option tmpdir will be honored instead of the environment variable TMPDIR. (Bug #5822) --- sql/ha_innodb.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index 1a870ce3abf..81a803e36b9 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -424,7 +424,7 @@ innobase_mysql_tmpfile(void) { char filename[FN_REFLEN]; int fd2 = -1; - File fd = create_temp_file(filename, NullS, "ib", + File fd = create_temp_file(filename, mysql_tmpdir, "ib", #ifdef __WIN__ O_BINARY | O_TRUNC | O_SEQUENTIAL | O_TEMPORARY | O_SHORT_LIVED | From 95dec435c2c2b0d2dff54adb5d46b1d766efa3b7 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 15 Feb 2005 11:02:01 +0100 Subject: [PATCH 0998/1063] Bug#7879: Using TL_READ_NO_INSERT locks instead of TL_READ locks when reading tables in "complex" SQL statements. If inserts happen in a table being read, the statements have no serialization order and the change can therefore not be reproduced on the slave. sql/sql_update.cc: Switching to using T_READ_NO_INSERT when the binlog is used. sql/sql_yacc.yy: Switching to using T_READ_NO_INSERT when the binlog is used. --- sql/sql_update.cc | 5 ++++- sql/sql_yacc.yy | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/sql/sql_update.cc b/sql/sql_update.cc index 4f7e34ec74f..bff360d02dc 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -479,7 +479,10 @@ int mysql_multi_update(THD *thd, else { DBUG_PRINT("info",("setting table `%s` for read-only", tl->alias)); - tl->lock_type= TL_READ; + // If we are using the binary log, we need TL_READ_NO_INSERT to get + // correct order of statements. Otherwise, we use a TL_READ lock to + // improve performance. + tl->lock_type= using_update_log ? TL_READ_NO_INSERT : TL_READ; tl->updating= 0; wants= SELECT_ACL; } diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 7b72c73a915..3e45e35c618 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -822,7 +822,7 @@ create_select: SELECT_SYM { LEX *lex=Lex; - lex->lock_option= (using_update_log) ? TL_READ_NO_INSERT : TL_READ; + lex->lock_option= using_update_log ? TL_READ_NO_INSERT : TL_READ; if (lex->sql_command == SQLCOM_INSERT) lex->sql_command= SQLCOM_INSERT_SELECT; else if (lex->sql_command == SQLCOM_REPLACE) @@ -1532,7 +1532,7 @@ select_part2: { LEX *lex=Lex; lex->lock_option=TL_READ; - mysql_init_select(lex); + mysql_init_select(lex); } select_options select_item_list select_into select_lock_type; From 1d633f645a7c2c8186a5b605dc1bcaf95787cc7a Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 15 Feb 2005 15:01:20 +0400 Subject: [PATCH 0999/1063] A fix. "(int) var" type cast doesn't work correctly for uint32 var on some 64-bit platforms (e.g. IRIX, non-debug build). --- sql/item_strfunc.cc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index a92c4e94c87..bbbcadbb071 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -1645,7 +1645,8 @@ String *Item_func_format::val_str(String *str) { DBUG_ASSERT(fixed == 1); double nr =args[0]->val(); - uint32 diff,length,str_length; + int diff; + uint32 length, str_length; uint dec; if ((null_value=args[0]->null_value)) return 0; /* purecov: inspected */ @@ -1670,9 +1671,12 @@ String *Item_func_format::val_str(String *str) pos[0]= pos[-(int) diff]; while (diff) { - pos[0]=pos[-(int) diff]; pos--; - pos[0]=pos[-(int) diff]; pos--; - pos[0]=pos[-(int) diff]; pos--; + *pos= *(pos - diff); + pos--; + *pos= *(pos - diff); + pos--; + *pos= *(pos - diff); + pos--; pos[0]=','; pos--; diff--; From 358cfd6c4220d3d1d1f596f6313fcba1819ff1a6 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 15 Feb 2005 14:42:13 +0200 Subject: [PATCH 1000/1063] Better bug fix for #5569: "Incorrect "Access Denied" error with SAME login DIFFERENT host" This fixes also the reverse lookup bug introduced by the previous patch mysql-test/t/group_by.test: Remove empty line vio/viosocket.c: Added function comment --- mysql-test/t/group_by.test | 1 - sql/sql_parse.cc | 23 +++++++++++++---------- vio/viosocket.c | 12 ++++++++++++ 3 files changed, 25 insertions(+), 11 deletions(-) diff --git a/mysql-test/t/group_by.test b/mysql-test/t/group_by.test index 5af78b924f8..2e5446c2d92 100644 --- a/mysql-test/t/group_by.test +++ b/mysql-test/t/group_by.test @@ -455,4 +455,3 @@ select min(a) is null from t1; select min(a) is null or null from t1; select 1 and min(a) is null from t1; drop table t1; - diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index cd0abafc0c9..613484ebf50 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -504,8 +504,6 @@ check_connections(THD *thd) DBUG_PRINT("info",("New connection received on %s", vio_description(net->vio))); - vio_in_addr(net->vio,&thd->remote.sin_addr); - if (!thd->host) // If TCP/IP connection { char ip[30]; @@ -515,6 +513,7 @@ check_connections(THD *thd) if (!(thd->ip = my_strdup(ip,MYF(0)))) return (ER_OUT_OF_RESOURCES); thd->host_or_ip=thd->ip; + vio_in_addr(net->vio, &thd->remote.sin_addr); #if !defined(HAVE_SYS_UN_H) || defined(HAVE_mit_thread) /* Fast local hostname resolve for Win32 */ if (!strcmp(thd->ip,"127.0.0.1")) @@ -524,17 +523,19 @@ check_connections(THD *thd) } else #endif - if (!(specialflag & SPECIAL_NO_RESOLVE)) { - thd->host=ip_to_hostname(&thd->remote.sin_addr,&connect_errors); - /* Cut very long hostnames to avoid possible overflows */ - if (thd->host) + if (!(specialflag & SPECIAL_NO_RESOLVE)) { - thd->host[min(strlen(thd->host), HOSTNAME_LENGTH)]= 0; - thd->host_or_ip= thd->host; + thd->host=ip_to_hostname(&thd->remote.sin_addr,&connect_errors); + /* Cut very long hostnames to avoid possible overflows */ + if (thd->host) + { + thd->host[min(strlen(thd->host), HOSTNAME_LENGTH)]= 0; + thd->host_or_ip= thd->host; + } + if (connect_errors > max_connect_errors) + return(ER_HOST_IS_BLOCKED); } - if (connect_errors > max_connect_errors) - return(ER_HOST_IS_BLOCKED); } DBUG_PRINT("info",("Host: %s ip: %s", thd->host ? thd->host : "unknown host", @@ -547,6 +548,8 @@ check_connections(THD *thd) DBUG_PRINT("info",("Host: %s",thd->host)); thd->host_or_ip= thd->host; thd->ip= 0; + /* Reset sin_addr */ + bzero((char*) &thd->remote, sizeof(thd->remote)); } vio_keepalive(net->vio, TRUE); diff --git a/vio/viosocket.c b/vio/viosocket.c index 1b6f46c57cf..f45c9dd98c4 100644 --- a/vio/viosocket.c +++ b/vio/viosocket.c @@ -291,6 +291,18 @@ my_bool vio_peer_addr(Vio * vio, char *buf, uint16 *port) } +/* + Get in_addr for a TCP/IP connection + + SYNOPSIS + vio_in_addr() + vio vio handle + in put in_addr here + + NOTES + one must call vio_peer_addr() before calling this one +*/ + void vio_in_addr(Vio *vio, struct in_addr *in) { DBUG_ENTER("vio_in_addr"); From f9982066a37d05976be3ab30feb7c029e2a511b4 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 15 Feb 2005 14:13:18 +0100 Subject: [PATCH 1001/1063] 1) Tag the 4.1.10 released version: bk tag -r 1.2159.8.1 "mysql-4.1.10" 2) Raise the version number to 4.1.11. configure.in: Raise the version number from 4.1.10 to 4.1.11. --- configure.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index 665029accb3..f3e93afb72e 100644 --- a/configure.in +++ b/configure.in @@ -5,7 +5,7 @@ AC_INIT(sql/mysqld.cc) AC_CANONICAL_SYSTEM # The Docs Makefile.am parses this line! # remember to also change ndb version below and update version.c in ndb -AM_INIT_AUTOMAKE(mysql, 4.1.10) +AM_INIT_AUTOMAKE(mysql, 4.1.11) AM_CONFIG_HEADER(config.h) PROTOCOL_VERSION=10 @@ -16,7 +16,7 @@ SHARED_LIB_VERSION=14:0:0 # ndb version NDB_VERSION_MAJOR=4 NDB_VERSION_MINOR=1 -NDB_VERSION_BUILD=10 +NDB_VERSION_BUILD=11 NDB_VERSION_STATUS="" # Set all version vars based on $VERSION. How do we do this more elegant ? From 9dad64a129a18e8b9d64edcd5947e9eba88f3c41 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 15 Feb 2005 11:31:01 -0800 Subject: [PATCH 1002/1063] Only escape the first character in a sequence of bytes that appears to be a multibyte character, but was not a valid multibyte character. Refinement of fix for Bug #8378. tests/mysql_client_test.c: Fix test (and fix number) for Bug #8378 mysys/charset.c: Fix to only escape the first character in a sequence that appears to be a multibyte character, but was not a valid one. --- mysys/charset.c | 15 ++++++--------- tests/mysql_client_test.c | 20 ++++++++++---------- 2 files changed, 16 insertions(+), 19 deletions(-) diff --git a/mysys/charset.c b/mysys/charset.c index 934125ead4a..5587a6d685f 100644 --- a/mysys/charset.c +++ b/mysys/charset.c @@ -583,9 +583,10 @@ ulong escape_string_for_mysql(CHARSET_INFO *charset_info, char *to, } /* If the next character appears to begin a multi-byte character, we - escape all of the bytes of that apparent character. (The character just - looks like a multi-byte character -- if it were actually a multi-byte - character, it would have been passed through in the test above.) + escape that first byte of that apparent multi-byte character. (The + character just looks like a multi-byte character -- if it were actually + a multi-byte character, it would have been passed through in the test + above.) Without this check, we can create a problem by converting an invalid multi-byte character into a valid one. For example, 0xbf27 is not @@ -593,12 +594,8 @@ ulong escape_string_for_mysql(CHARSET_INFO *charset_info, char *to, */ if (use_mb_flag && (l= my_mbcharlen(charset_info, *from)) > 1) { - while (l--) - { - *to++= '\\'; - *to++= *from++; - } - from--; + *to++= '\\'; + *to++= *from; continue; } #endif diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index b7e3e1b3469..7886e0c1884 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -11535,20 +11535,20 @@ static void test_bug6761(void) /* Test mysql_real_escape_string() with gbk charset - The important part is that 0x27 (') is the second-byte in a invvalid + The important part is that 0x27 (') is the second-byte in a invalid two-byte GBK character here. But 0xbf5c is a valid GBK character, so - it needs to be escaped as 0x5cbf5c27 + it needs to be escaped as 0x5cbf27 */ -#define TEST_BUG8317_IN "\xef\xbb\xbf\x27" -#define TEST_BUG8317_OUT "\xef\xbb\x5c\xbf\x5c\x27" +#define TEST_BUG8378_IN "\xef\xbb\xbf\x27\xbf\x10" +#define TEST_BUG8378_OUT "\xef\xbb\x5c\xbf\x5c\x27\x5c\xbf\x10" -static void test_bug8317() +static void test_bug8378() { MYSQL *lmysql; - char out[9]; /* strlen(TEST_BUG8317)*2+1 */ + char out[9]; /* strlen(TEST_BUG8378)*2+1 */ int len; - myheader("test_bug8317"); + myheader("test_bug8378"); if (!opt_silent) fprintf(stdout, "\n Establishing a test connection ..."); @@ -11572,10 +11572,10 @@ static void test_bug8317() if (!opt_silent) fprintf(stdout, " OK"); - len= mysql_real_escape_string(lmysql, out, TEST_BUG8317_IN, 4); + len= mysql_real_escape_string(lmysql, out, TEST_BUG8378_IN, 4); /* No escaping should have actually happened. */ - DIE_UNLESS(memcmp(out, TEST_BUG8317_OUT, len) == 0); + DIE_UNLESS(memcmp(out, TEST_BUG8378_OUT, len) == 0); mysql_close(lmysql); } @@ -11787,7 +11787,7 @@ static struct my_tests_st my_tests[]= { { "test_conversion", test_conversion }, { "test_rewind", test_rewind }, { "test_bug6761", test_bug6761 }, - { "test_bug8317", test_bug8317 }, + { "test_bug8378", test_bug8378 }, { 0, 0 } }; From 2d2d4df7d28bc1826858b69d93a60cad76fe80d3 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 15 Feb 2005 13:36:46 -0800 Subject: [PATCH 1003/1063] Always lowercase database names from 'host' and 'db' grant tables when they are loaded and lower_case_table_names is set, but issue a warning when it is done. (Bug #7989) sql/sql_acl.cc: Lowercase database names in 'host' and 'db' grant tables when loading, but issue a warning to the log about them. --- mysql-test/r/lowercase_table_grant.result | 23 ++++++++++++ mysql-test/t/lowercase_table_grant-master.opt | 1 + mysql-test/t/lowercase_table_grant.test | 25 +++++++++++++ sql/sql_acl.cc | 37 +++++++++++++++++++ 4 files changed, 86 insertions(+) create mode 100644 mysql-test/r/lowercase_table_grant.result create mode 100644 mysql-test/t/lowercase_table_grant-master.opt create mode 100644 mysql-test/t/lowercase_table_grant.test diff --git a/mysql-test/r/lowercase_table_grant.result b/mysql-test/r/lowercase_table_grant.result new file mode 100644 index 00000000000..3889bd418db --- /dev/null +++ b/mysql-test/r/lowercase_table_grant.result @@ -0,0 +1,23 @@ +use mysql; +create database MYSQLtest; +grant all on MySQLtest.* to mysqltest_1@localhost; +show grants for mysqltest_1@localhost; +Grants for mysqltest_1@localhost +GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' +GRANT ALL PRIVILEGES ON `mysqltest`.* TO 'mysqltest_1'@'localhost' +select * from db where user = 'mysqltest_1'; +Host Db User Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Grant_priv References_priv Index_priv Alter_priv Create_tmp_table_priv Lock_tables_priv +localhost mysqltest mysqltest_1 Y Y Y Y Y Y N Y Y Y Y Y +update db set db = 'MYSQLtest' where db = 'mysqltest' and user = 'mysqltest_1' and host = 'localhost'; +flush privileges; +show grants for mysqltest_1@localhost; +Grants for mysqltest_1@localhost +GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' +GRANT ALL PRIVILEGES ON `mysqltest`.* TO 'mysqltest_1'@'localhost' +select * from db where user = 'mysqltest_1'; +Host Db User Select_priv Insert_priv Update_priv Delete_priv Create_priv Drop_priv Grant_priv References_priv Index_priv Alter_priv Create_tmp_table_priv Lock_tables_priv +localhost MYSQLtest mysqltest_1 Y Y Y Y Y Y N Y Y Y Y Y +delete from db where db = 'MYSQLtest' and user = 'mysqltest_1' and host = 'localhost'; +flush privileges; +drop user mysqltest_1@localhost; +drop database MYSQLtest; diff --git a/mysql-test/t/lowercase_table_grant-master.opt b/mysql-test/t/lowercase_table_grant-master.opt new file mode 100644 index 00000000000..c718e2feb1b --- /dev/null +++ b/mysql-test/t/lowercase_table_grant-master.opt @@ -0,0 +1 @@ +--lower_case_table_names diff --git a/mysql-test/t/lowercase_table_grant.test b/mysql-test/t/lowercase_table_grant.test new file mode 100644 index 00000000000..5ac35c81c21 --- /dev/null +++ b/mysql-test/t/lowercase_table_grant.test @@ -0,0 +1,25 @@ +# Test of grants when lower_case_table_names is on +use mysql; + +# mixed-case database name for testing +create database MYSQLtest; + +# check that database name gets forced to lowercase +grant all on MySQLtest.* to mysqltest_1@localhost; +show grants for mysqltest_1@localhost; + +# now force it to mixed case, but see that it is lowercased in the acl cache +select * from db where user = 'mysqltest_1'; +update db set db = 'MYSQLtest' where db = 'mysqltest' and user = 'mysqltest_1' and host = 'localhost'; +flush privileges; +show grants for mysqltest_1@localhost; +select * from db where user = 'mysqltest_1'; + +# clear out the user we created +# +# can't use REVOKE because of the mixed-case database name +delete from db where db = 'MYSQLtest' and user = 'mysqltest_1' and host = 'localhost'; +flush privileges; +drop user mysqltest_1@localhost; + +drop database MYSQLtest; diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 7c17a4ef275..92d6f471a1e 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -139,6 +139,7 @@ my_bool acl_init(THD *org_thd, bool dont_read_acl_tables) MYSQL_LOCK *lock; my_bool return_val=1; bool check_no_resolve= specialflag & SPECIAL_NO_RESOLVE; + char tmp_name[NAME_LEN+1]; DBUG_ENTER("acl_init"); @@ -197,6 +198,24 @@ my_bool acl_init(THD *org_thd, bool dont_read_acl_tables) ACL_HOST host; update_hostname(&host.host,get_field(&mem, table->field[0])); host.db= get_field(&mem, table->field[1]); + if (lower_case_table_names) + { + /* + We make a temporary copy of the database, force it to lower case, + and then copy it back over the original name. We can't just update + the host.db pointer, because tmp_name is allocated on the stack. + */ + (void)strmov(tmp_name, host.db); + my_casedn_str(files_charset_info, tmp_name); + if (strcmp(host.db, tmp_name) != 0) + { + sql_print_warning("'host' entry '%s|%s' had database in mixed " + "case that has been forced to lowercase because " + "lower_case_table_names is set.", + host.host.hostname, host.db); + (void)strmov(host.db, tmp_name); + } + } host.access= get_access(table,2); host.access= fix_rights_for_db(host.access); host.sort= get_sort(2,host.host.hostname,host.db); @@ -380,6 +399,24 @@ my_bool acl_init(THD *org_thd, bool dont_read_acl_tables) } db.access=get_access(table,3); db.access=fix_rights_for_db(db.access); + if (lower_case_table_names) + { + /* + We make a temporary copy of the database, force it to lower case, + and then copy it back over the original name. We can't just update + the db.db pointer, because tmp_name is allocated on the stack. + */ + (void)strmov(tmp_name, db.db); + my_casedn_str(files_charset_info, tmp_name); + if (strcmp(db.db, tmp_name) != 0) + { + sql_print_warning("'db' entry '%s %s@%s' had database in mixed " + "case that has been forced to lowercase because " + "lower_case_table_names is set.", + db.db, db.user, db.host.hostname, db.host.hostname); + (void)strmov(db.db, tmp_name); + } + } db.sort=get_sort(3,db.host.hostname,db.db,db.user); #ifndef TO_BE_REMOVED if (table->fields <= 9) From 3be01953d123eb200a5c8bb85b7bbb0c50ffda47 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 15 Feb 2005 17:27:23 -0600 Subject: [PATCH 1004/1063] ft_nlq_search.c: Added bounds check to avoid accessing unallocated FT_DOC array. (BUG #8522) myisam/ft_nlq_search.c: Added bounds check to avoid accessing unallocated FT_DOC array. (BUG #8522) BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted --- BitKeeper/etc/logging_ok | 1 + myisam/ft_nlq_search.c | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok index 9465991bc17..f8621170f64 100644 --- a/BitKeeper/etc/logging_ok +++ b/BitKeeper/etc/logging_ok @@ -24,6 +24,7 @@ bk@admin.bk brian@brian-akers-computer.local carsten@tsort.bitbybit.dk davida@isil.mysql.com +dean@mysql.com dellis@goetia.(none) dlenev@brandersnatch.localdomain dlenev@build.mysql.com diff --git a/myisam/ft_nlq_search.c b/myisam/ft_nlq_search.c index 3ad983f0a37..13cbf24b3f7 100644 --- a/myisam/ft_nlq_search.c +++ b/myisam/ft_nlq_search.c @@ -205,6 +205,10 @@ FT_INFO *ft_init_nlq_search(MI_INFO *info, uint keynr, byte *query, left_root_right)) goto err2; + /* + If ndocs == 0, this will not allocate RAM for FT_INFO.doc[], + so if ndocs == 0, FT_INFO.doc[] must not be accessed. + */ dlist=(FT_INFO *)my_malloc(sizeof(FT_INFO)+ sizeof(FT_DOC)*(aio.dtree.elements_in_tree-1), MYF(0)); @@ -275,7 +279,8 @@ float ft_nlq_find_relevance(FT_INFO *handler, else a=c; } - if (docs[a].dpos == docid) + /* bounds check to avoid accessing unallocated handler->doc */ + if (a < handler->ndocs && docs[a].dpos == docid) return (float) docs[a].weight; else return 0.0; From f1a97c0c49d1193bf37f36b27e968b4185165645 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 15 Feb 2005 18:45:42 -0800 Subject: [PATCH 1005/1063] delete.result, delete.test: Added a test case for bug #8392. sql_delete.cc: Fixed bug #8392. The bug caused a crash for a delete statement with ORDER BY that explicitly referred to the modified table. sql/sql_delete.cc: Fixed bug #8392. The bug caused a crash for a delete statement with ORDER BY that explicitly referred to the modified table. mysql-test/t/delete.test: Added a test case for bug #8392. mysql-test/r/delete.result: Added a test case for bug #8392. --- mysql-test/r/delete.result | 9 +++++++++ mysql-test/t/delete.test | 11 +++++++++++ sql/sql_delete.cc | 1 + 3 files changed, 21 insertions(+) diff --git a/mysql-test/r/delete.result b/mysql-test/r/delete.result index 7353e687ae7..378371f2982 100644 --- a/mysql-test/r/delete.result +++ b/mysql-test/r/delete.result @@ -61,3 +61,12 @@ select * from t1; a b 1 apple drop table t1; +CREATE TABLE t1 ( a int PRIMARY KEY ); +DELETE FROM t1 WHERE t1.a > 0 ORDER BY t1.a; +INSERT INTO t1 VALUES (0),(1),(2); +DELETE FROM t1 WHERE t1.a > 0 ORDER BY t1.a LIMIT 1; +SELECT * FROM t1; +a +0 +2 +DROP TABLE t1; diff --git a/mysql-test/t/delete.test b/mysql-test/t/delete.test index 07cb9155b3f..5fcdd6263ed 100644 --- a/mysql-test/t/delete.test +++ b/mysql-test/t/delete.test @@ -71,3 +71,14 @@ select * from t1; delete t1 from t1, t1 as t2 where t1.b = t2.b and t1.a > t2.a; select * from t1; drop table t1; + +# +# Bug #8392: delete with ORDER BY containing a direct reference to the table +# + +CREATE TABLE t1 ( a int PRIMARY KEY ); +DELETE FROM t1 WHERE t1.a > 0 ORDER BY t1.a; +INSERT INTO t1 VALUES (0),(1),(2); +DELETE FROM t1 WHERE t1.a > 0 ORDER BY t1.a LIMIT 1; +SELECT * FROM t1; +DROP TABLE t1; diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc index 92193e3abf2..475df34dc4f 100644 --- a/sql/sql_delete.cc +++ b/sql/sql_delete.cc @@ -111,6 +111,7 @@ int mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds, ORDER *order, bzero((char*) &tables,sizeof(tables)); tables.table = table; + tables.alias = table_list->alias; table->io_cache = (IO_CACHE *) my_malloc(sizeof(IO_CACHE), MYF(MY_FAE | MY_ZEROFILL)); From 9ffac369d596e5005e5daf534c791cc23a62e308 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 16 Feb 2005 10:01:05 +0100 Subject: [PATCH 1006/1063] rpl_multi_query.test: disable ps-protocol as PS don't support multi-queries mysql-test/t/rpl_multi_query.test: disable ps-protocol as PS don't support multi-queries --- mysql-test/t/rpl_multi_query.test | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mysql-test/t/rpl_multi_query.test b/mysql-test/t/rpl_multi_query.test index 15f5d288759..482a2679e7a 100644 --- a/mysql-test/t/rpl_multi_query.test +++ b/mysql-test/t/rpl_multi_query.test @@ -3,6 +3,9 @@ # CLIENT_MULTI_STATEMENTS) will be binlogged ONE-query-per-event (not # one binlog event containing all queries) +# PS doesn't support multi-statements +--disable_ps_protocol + source include/master-slave.inc; --disable_warnings drop database if exists mysqltest; From cb17889f47b0d128a192709840bb1c403715768f Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 16 Feb 2005 03:13:29 -0600 Subject: [PATCH 1007/1063] fulltext.test, fulltext.result: Test case for bug#8522, to test for out of bounds memory access in ft_nlq_find_relevance(). mysql-test/r/fulltext.result: Test case for bug#8522, to test for out of bounds memory access in ft_nlq_find_relevance(). mysql-test/t/fulltext.test: Test case for bug#8522, to test for out of bounds memory access in ft_nlq_find_relevance(). --- mysql-test/r/fulltext.result | 6 ++++++ mysql-test/t/fulltext.test | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/mysql-test/r/fulltext.result b/mysql-test/r/fulltext.result index 50f0a1dc120..ce1703fca0e 100644 --- a/mysql-test/r/fulltext.result +++ b/mysql-test/r/fulltext.result @@ -315,3 +315,9 @@ select count(*) from t1; count(*) 1 drop table t1; +CREATE TABLE t1 ( a TEXT, FULLTEXT (a) ); +INSERT INTO t1 VALUES ('testing ft_nlq_find_relevance'); +SELECT MATCH(a) AGAINST ('nosuchword') FROM t1; +MATCH(a) AGAINST ('nosuchword') +0 +DROP TABLE t1; diff --git a/mysql-test/t/fulltext.test b/mysql-test/t/fulltext.test index b44854860f9..90020e9468e 100644 --- a/mysql-test/t/fulltext.test +++ b/mysql-test/t/fulltext.test @@ -252,3 +252,11 @@ REPAIR TABLE t1; select count(*) from t1; drop table t1; +# +# testing out of bounds memory access in ft_nlq_find_relevance() +# (bug#8522); visible in valgrind. +# +CREATE TABLE t1 ( a TEXT, FULLTEXT (a) ); +INSERT INTO t1 VALUES ('testing ft_nlq_find_relevance'); +SELECT MATCH(a) AGAINST ('nosuchword') FROM t1; +DROP TABLE t1; From dbff1150c5195cd4ae8c76bf9b7c6234af57df7e Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 16 Feb 2005 12:45:59 +0100 Subject: [PATCH 1008/1063] ndb - fix old decimal type mysql vs ndb mysql-test/r/ndb_index_ordered.result: fix old decimal type mysql vs ndb (re-commit 3) mysql-test/t/ndb_index_ordered.test: fix old decimal type mysql vs ndb (re-commit 3) ndb/include/kernel/signaldata/DictTabInfo.hpp: fix old decimal type mysql vs ndb (re-commit 3) ndb/include/ndbapi/NdbDictionary.hpp: fix old decimal type mysql vs ndb (re-commit 3) ndb/include/util/NdbSqlUtil.hpp: fix old decimal type mysql vs ndb (re-commit 3) ndb/src/common/util/NdbSqlUtil.cpp: fix old decimal type mysql vs ndb (re-commit 3) ndb/src/ndbapi/NdbDictionary.cpp: fix old decimal type mysql vs ndb (re-commit 3) ndb/src/ndbapi/NdbDictionaryImpl.cpp: fix old decimal type mysql vs ndb (re-commit 3) ndb/src/ndbapi/NdbRecAttr.cpp: fix old decimal type mysql vs ndb (re-commit 3) ndb/test/include/NdbSchemaOp.hpp: fix old decimal type mysql vs ndb (re-commit 3) ndb/tools/restore/consumer.cpp: fix old decimal type mysql vs ndb (re-commit 3) sql/ha_ndbcluster.cc: fix old decimal type mysql vs ndb (re-commit 3) --- mysql-test/r/ndb_index_ordered.result | 83 +++++++++++++ mysql-test/t/ndb_index_ordered.test | 52 ++++++++ ndb/include/kernel/signaldata/DictTabInfo.hpp | 20 ++- ndb/include/ndbapi/NdbDictionary.hpp | 13 +- ndb/include/util/NdbSqlUtil.hpp | 13 +- ndb/src/common/util/NdbSqlUtil.cpp | 114 ++++++++++++------ ndb/src/ndbapi/NdbDictionary.cpp | 7 +- ndb/src/ndbapi/NdbDictionaryImpl.cpp | 6 +- ndb/src/ndbapi/NdbRecAttr.cpp | 15 ++- ndb/test/include/NdbSchemaOp.hpp | 3 +- ndb/tools/restore/consumer.cpp | 5 +- sql/ha_ndbcluster.cc | 34 ++++-- 12 files changed, 304 insertions(+), 61 deletions(-) diff --git a/mysql-test/r/ndb_index_ordered.result b/mysql-test/r/ndb_index_ordered.result index 12438f247c3..f5794d477f3 100644 --- a/mysql-test/r/ndb_index_ordered.result +++ b/mysql-test/r/ndb_index_ordered.result @@ -445,6 +445,89 @@ select count(*)-9 from t1 use index (ts) where ts <= '2001-01-01 23:59:59'; count(*)-9 0 drop table t1; +create table t1 ( +a int primary key, +s decimal(12), +t decimal(12, 5), +u decimal(12) unsigned, +v decimal(12, 5) unsigned, +key (s), +key (t), +key (u), +key (v) +) engine=ndb; +insert into t1 values +( 0, -000000000007, -0000061.00003, 000000000061, 0000965.00042), +( 1, -000000000007, -0000061.00042, 000000000061, 0000965.00003), +( 2, -071006035767, 4210253.00024, 000000000001, 0000001.84488), +( 3, 000000007115, 0000000.77607, 000077350625, 0000018.00013), +( 4, -000000068391, -0346486.00000, 000000005071, 0005334.00002), +( 5, -521579890459, -1936874.00001, 000000000154, 0000003.00018), +( 6, -521579890459, -1936874.00018, 000000000154, 0000003.00001), +( 7, 000000000333, 0000051.39140, 000000907958, 0788643.08374), +( 8, 000042731229, 0000009.00000, 000000000009, 6428667.00000), +( 9, -000008159769, 0000918.00004, 000096951421, 7607730.00008); +select count(*)- 5 from t1 use index (s) where s < -000000000007; +count(*)- 5 +0 +select count(*)- 7 from t1 use index (s) where s <= -000000000007; +count(*)- 7 +0 +select count(*)- 2 from t1 use index (s) where s = -000000000007; +count(*)- 2 +0 +select count(*)- 5 from t1 use index (s) where s >= -000000000007; +count(*)- 5 +0 +select count(*)- 3 from t1 use index (s) where s > -000000000007; +count(*)- 3 +0 +select count(*)- 4 from t1 use index (t) where t < -0000061.00003; +count(*)- 4 +0 +select count(*)- 5 from t1 use index (t) where t <= -0000061.00003; +count(*)- 5 +0 +select count(*)- 1 from t1 use index (t) where t = -0000061.00003; +count(*)- 1 +0 +select count(*)- 6 from t1 use index (t) where t >= -0000061.00003; +count(*)- 6 +0 +select count(*)- 5 from t1 use index (t) where t > -0000061.00003; +count(*)- 5 +0 +select count(*)- 2 from t1 use index (u) where u < 000000000061; +count(*)- 2 +0 +select count(*)- 4 from t1 use index (u) where u <= 000000000061; +count(*)- 4 +0 +select count(*)- 2 from t1 use index (u) where u = 000000000061; +count(*)- 2 +0 +select count(*)- 8 from t1 use index (u) where u >= 000000000061; +count(*)- 8 +0 +select count(*)- 6 from t1 use index (u) where u > 000000000061; +count(*)- 6 +0 +select count(*)- 5 from t1 use index (v) where v < 0000965.00042; +count(*)- 5 +0 +select count(*)- 6 from t1 use index (v) where v <= 0000965.00042; +count(*)- 6 +0 +select count(*)- 1 from t1 use index (v) where v = 0000965.00042; +count(*)- 1 +0 +select count(*)- 5 from t1 use index (v) where v >= 0000965.00042; +count(*)- 5 +0 +select count(*)- 4 from t1 use index (v) where v > 0000965.00042; +count(*)- 4 +0 +drop table t1; create table t1(a int primary key, b int not null, index(b)); insert into t1 values (1,1), (2,2); set autocommit=0; diff --git a/mysql-test/t/ndb_index_ordered.test b/mysql-test/t/ndb_index_ordered.test index 47e6b93eb81..010060a694d 100644 --- a/mysql-test/t/ndb_index_ordered.test +++ b/mysql-test/t/ndb_index_ordered.test @@ -249,6 +249,58 @@ select count(*)-9 from t1 use index (ts) where ts <= '2001-01-01 23:59:59'; drop table t1; +# decimal (not the new 5.0 thing) + +create table t1 ( + a int primary key, + s decimal(12), + t decimal(12, 5), + u decimal(12) unsigned, + v decimal(12, 5) unsigned, + key (s), + key (t), + key (u), + key (v) +) engine=ndb; +# +insert into t1 values + ( 0, -000000000007, -0000061.00003, 000000000061, 0000965.00042), + ( 1, -000000000007, -0000061.00042, 000000000061, 0000965.00003), + ( 2, -071006035767, 4210253.00024, 000000000001, 0000001.84488), + ( 3, 000000007115, 0000000.77607, 000077350625, 0000018.00013), + ( 4, -000000068391, -0346486.00000, 000000005071, 0005334.00002), + ( 5, -521579890459, -1936874.00001, 000000000154, 0000003.00018), + ( 6, -521579890459, -1936874.00018, 000000000154, 0000003.00001), + ( 7, 000000000333, 0000051.39140, 000000907958, 0788643.08374), + ( 8, 000042731229, 0000009.00000, 000000000009, 6428667.00000), + ( 9, -000008159769, 0000918.00004, 000096951421, 7607730.00008); +# +select count(*)- 5 from t1 use index (s) where s < -000000000007; +select count(*)- 7 from t1 use index (s) where s <= -000000000007; +select count(*)- 2 from t1 use index (s) where s = -000000000007; +select count(*)- 5 from t1 use index (s) where s >= -000000000007; +select count(*)- 3 from t1 use index (s) where s > -000000000007; +# +select count(*)- 4 from t1 use index (t) where t < -0000061.00003; +select count(*)- 5 from t1 use index (t) where t <= -0000061.00003; +select count(*)- 1 from t1 use index (t) where t = -0000061.00003; +select count(*)- 6 from t1 use index (t) where t >= -0000061.00003; +select count(*)- 5 from t1 use index (t) where t > -0000061.00003; +# +select count(*)- 2 from t1 use index (u) where u < 000000000061; +select count(*)- 4 from t1 use index (u) where u <= 000000000061; +select count(*)- 2 from t1 use index (u) where u = 000000000061; +select count(*)- 8 from t1 use index (u) where u >= 000000000061; +select count(*)- 6 from t1 use index (u) where u > 000000000061; +# +select count(*)- 5 from t1 use index (v) where v < 0000965.00042; +select count(*)- 6 from t1 use index (v) where v <= 0000965.00042; +select count(*)- 1 from t1 use index (v) where v = 0000965.00042; +select count(*)- 5 from t1 use index (v) where v >= 0000965.00042; +select count(*)- 4 from t1 use index (v) where v > 0000965.00042; + +drop table t1; + # bug#7798 create table t1(a int primary key, b int not null, index(b)); insert into t1 values (1,1), (2,2); diff --git a/ndb/include/kernel/signaldata/DictTabInfo.hpp b/ndb/include/kernel/signaldata/DictTabInfo.hpp index ade6c22a5bd..a2f9fcc9799 100644 --- a/ndb/include/kernel/signaldata/DictTabInfo.hpp +++ b/ndb/include/kernel/signaldata/DictTabInfo.hpp @@ -302,7 +302,8 @@ public: ExtBigunsigned = NdbSqlUtil::Type::Bigunsigned, ExtFloat = NdbSqlUtil::Type::Float, ExtDouble = NdbSqlUtil::Type::Double, - ExtDecimal = NdbSqlUtil::Type::Decimal, + ExtOlddecimal = NdbSqlUtil::Type::Olddecimal, + ExtOlddecimalunsigned = NdbSqlUtil::Type::Olddecimalunsigned, ExtChar = NdbSqlUtil::Type::Char, ExtVarchar = NdbSqlUtil::Type::Varchar, ExtBinary = NdbSqlUtil::Type::Binary, @@ -411,9 +412,20 @@ public: AttributeSize = DictTabInfo::a64Bit; AttributeArraySize = AttributeExtLength; return true; - case DictTabInfo::ExtDecimal: - // not yet implemented anywhere - break; + case DictTabInfo::ExtOlddecimal: + AttributeType = DictTabInfo::StringType; + AttributeSize = DictTabInfo::an8Bit; + AttributeArraySize = + (1 + AttributeExtPrecision + (int(AttributeExtScale) > 0)) * + AttributeExtLength; + return true; + case DictTabInfo::ExtOlddecimalunsigned: + AttributeType = DictTabInfo::StringType; + AttributeSize = DictTabInfo::an8Bit; + AttributeArraySize = + (0 + AttributeExtPrecision + (int(AttributeExtScale) > 0)) * + AttributeExtLength; + return true; case DictTabInfo::ExtChar: case DictTabInfo::ExtBinary: AttributeType = DictTabInfo::StringType; diff --git a/ndb/include/ndbapi/NdbDictionary.hpp b/ndb/include/ndbapi/NdbDictionary.hpp index 49afbd695c9..6aa675a2319 100644 --- a/ndb/include/ndbapi/NdbDictionary.hpp +++ b/ndb/include/ndbapi/NdbDictionary.hpp @@ -179,7 +179,7 @@ public: Bigunsigned, ///< 64 Bit. 8 byte signed integer, can be used in array Float, ///< 32-bit float. 4 bytes float, can be used in array Double, ///< 64-bit float. 8 byte float, can be used in array - Decimal, ///< Precision, Scale are applicable + Olddecimal, ///< MySQL < 5.0 signed decimal, Precision, Scale Char, ///< Len. A fixed array of 1-byte chars Varchar, ///< Max len Binary, ///< Len @@ -190,7 +190,8 @@ public: Text, ///< Text blob Time = 25, ///< Time without date Year = 26, ///< Year 1901-2155 (1 byte) - Timestamp = 27 ///< Unix time + Timestamp = 27, ///< Unix time + Olddecimalunsigned = 28 }; /** @@ -276,25 +277,25 @@ public: /** * Set precision of column. - * @note Only applicable for builtin type Decimal + * @note Only applicable for decimal types */ void setPrecision(int); /** * Get precision of column. - * @note Only applicable for builtin type Decimal + * @note Only applicable for decimal types */ int getPrecision() const; /** * Set scale of column. - * @note Only applicable for builtin type Decimal + * @note Only applicable for decimal types */ void setScale(int); /** * Get scale of column. - * @note Only applicable for builtin type Decimal + * @note Only applicable for decimal types */ int getScale() const; diff --git a/ndb/include/util/NdbSqlUtil.hpp b/ndb/include/util/NdbSqlUtil.hpp index 3787814052a..5b27bd4e0c4 100644 --- a/ndb/include/util/NdbSqlUtil.hpp +++ b/ndb/include/util/NdbSqlUtil.hpp @@ -75,7 +75,7 @@ public: Bigunsigned, // 64 Bit Float, // 32-bit float Double, // 64-bit float - Decimal, // Precision, Scale + Olddecimal, // Precision, Scale Char, // Len Varchar, // Max len Binary, // Len @@ -86,7 +86,8 @@ public: Text, // Text blob Time = 25, // Time without date Year = 26, // Year (size 1 byte) - Timestamp = 27 // Unix seconds (uint32) + Timestamp = 27, // Unix seconds (uint32) + Olddecimalunsigned = 28 }; Enum m_typeId; Cmp* m_cmp; // comparison method @@ -109,6 +110,11 @@ public: static bool usable_in_hash_index(Uint32 typeId, const void* cs); static bool usable_in_ordered_index(Uint32 typeId, const void* cs); + /** + * Compare decimal numbers. + */ + static int cmp_olddecimal(const uchar* s1, const uchar* s2, unsigned n); + private: /** * List of all types. Must match Type::Enum. @@ -129,7 +135,7 @@ private: static Cmp cmpBigunsigned; static Cmp cmpFloat; static Cmp cmpDouble; - static Cmp cmpDecimal; + static Cmp cmpOlddecimal; static Cmp cmpChar; static Cmp cmpVarchar; static Cmp cmpBinary; @@ -141,6 +147,7 @@ private: static Cmp cmpTime; static Cmp cmpYear; static Cmp cmpTimestamp; + static Cmp cmpOlddecimalunsigned; }; #endif diff --git a/ndb/src/common/util/NdbSqlUtil.cpp b/ndb/src/common/util/NdbSqlUtil.cpp index 53fa5d69215..c4114ad5ffa 100644 --- a/ndb/src/common/util/NdbSqlUtil.cpp +++ b/ndb/src/common/util/NdbSqlUtil.cpp @@ -76,117 +76,121 @@ NdbSqlUtil::char_like(const char* s1, unsigned n1, const NdbSqlUtil::Type NdbSqlUtil::m_typeList[] = { - { + { // 0 Type::Undefined, NULL }, - { + { // 1 Type::Tinyint, cmpTinyint }, - { + { // 2 Type::Tinyunsigned, cmpTinyunsigned }, - { + { // 3 Type::Smallint, cmpSmallint }, - { + { // 4 Type::Smallunsigned, cmpSmallunsigned }, - { + { // 5 Type::Mediumint, cmpMediumint }, - { + { // 6 Type::Mediumunsigned, cmpMediumunsigned }, - { + { // 7 Type::Int, cmpInt }, - { + { // 8 Type::Unsigned, cmpUnsigned }, - { + { // 9 Type::Bigint, cmpBigint }, - { + { // 10 Type::Bigunsigned, cmpBigunsigned }, - { + { // 11 Type::Float, cmpFloat }, - { + { // 12 Type::Double, cmpDouble }, - { - Type::Decimal, - NULL // cmpDecimal + { // 13 + Type::Olddecimal, + cmpOlddecimal }, - { + { // 14 Type::Char, cmpChar }, - { + { // 15 Type::Varchar, cmpVarchar }, - { + { // 16 Type::Binary, cmpBinary }, - { + { // 17 Type::Varbinary, cmpVarbinary }, - { + { // 18 Type::Datetime, cmpDatetime }, - { + { // 19 Type::Date, cmpDate }, - { + { // 20 Type::Blob, cmpBlob }, - { + { // 21 Type::Text, cmpText }, - { + { // 22 Type::Undefined, // 5.0 Bit NULL }, - { + { // 23 Type::Undefined, // 5.0 Longvarchar NULL }, - { + { // 24 Type::Undefined, // 5.0 Longvarbinary NULL }, - { + { // 25 Type::Time, cmpTime }, - { + { // 26 Type::Year, cmpYear }, - { + { // 27 Type::Timestamp, cmpTimestamp + }, + { // 28 + Type::Olddecimalunsigned, + cmpOlddecimalunsigned } }; @@ -411,12 +415,54 @@ NdbSqlUtil::cmpDouble(const void* info, const Uint32* p1, const Uint32* p2, Uint } int -NdbSqlUtil::cmpDecimal(const void* info, const Uint32* p1, const Uint32* p2, Uint32 full, Uint32 size) +NdbSqlUtil::cmp_olddecimal(const uchar* s1, const uchar* s2, unsigned n) +{ + int sgn = +1; + unsigned i = 0; + while (i < n) { + int c1 = s1[i]; + int c2 = s2[i]; + if (c1 == c2) { + if (c1 == '-') + sgn = -1; + } else if (c1 == '-') { + return -1; + } else if (c2 == '-') { + return +1; + } else if (c1 < c2) { + return -1 * sgn; + } else { + return +1 * sgn; + } + i++; + } + return 0; +} + +int +NdbSqlUtil::cmpOlddecimal(const void* info, const Uint32* p1, const Uint32* p2, Uint32 full, Uint32 size) { assert(full >= size && size > 0); - // not used by MySQL or NDB - assert(false); - return 0; + if (full == size) { + union { const Uint32* p; const uchar* v; } u1, u2; + u1.p = p1; + u2.p = p2; + return cmp_olddecimal(u1.v, u2.v, full << 2); + } + return CmpUnknown; +} + +int +NdbSqlUtil::cmpOlddecimalunsigned(const void* info, const Uint32* p1, const Uint32* p2, Uint32 full, Uint32 size) +{ + assert(full >= size && size > 0); + if (full == size) { + union { const Uint32* p; const uchar* v; } u1, u2; + u1.p = p1; + u2.p = p2; + return cmp_olddecimal(u1.v, u2.v, full << 2); + } + return CmpUnknown; } int diff --git a/ndb/src/ndbapi/NdbDictionary.cpp b/ndb/src/ndbapi/NdbDictionary.cpp index 58b35c6c306..00db5704949 100644 --- a/ndb/src/ndbapi/NdbDictionary.cpp +++ b/ndb/src/ndbapi/NdbDictionary.cpp @@ -918,8 +918,11 @@ operator<<(NdbOut& out, const NdbDictionary::Column& col) case NdbDictionary::Column::Double: out << "Double"; break; - case NdbDictionary::Column::Decimal: - out << "Decimal(" << col.getScale() << "," << col.getPrecision() << ")"; + case NdbDictionary::Column::Olddecimal: + out << "Olddecimal(" << col.getPrecision() << "," << col.getScale() << ")"; + break; + case NdbDictionary::Column::Olddecimalunsigned: + out << "Olddecimalunsigned(" << col.getPrecision() << "," << col.getScale() << ")"; break; case NdbDictionary::Column::Char: out << "Char(" << col.getLength() << ";" << csname << ")"; diff --git a/ndb/src/ndbapi/NdbDictionaryImpl.cpp b/ndb/src/ndbapi/NdbDictionaryImpl.cpp index 530f15d3a2e..b9ae13a93ec 100644 --- a/ndb/src/ndbapi/NdbDictionaryImpl.cpp +++ b/ndb/src/ndbapi/NdbDictionaryImpl.cpp @@ -114,7 +114,8 @@ NdbColumnImpl::init(Type t) m_length = 1; m_cs = NULL; break; - case Decimal: + case Olddecimal: + case Olddecimalunsigned: m_precision = 10; m_scale = 0; m_length = 1; @@ -1176,7 +1177,8 @@ columnTypeMapping[] = { { DictTabInfo::ExtBigunsigned, NdbDictionary::Column::Bigunsigned }, { DictTabInfo::ExtFloat, NdbDictionary::Column::Float }, { DictTabInfo::ExtDouble, NdbDictionary::Column::Double }, - { DictTabInfo::ExtDecimal, NdbDictionary::Column::Decimal }, + { DictTabInfo::ExtOlddecimal, NdbDictionary::Column::Olddecimal }, + { DictTabInfo::ExtOlddecimalunsigned, NdbDictionary::Column::Olddecimalunsigned }, { DictTabInfo::ExtChar, NdbDictionary::Column::Char }, { DictTabInfo::ExtVarchar, NdbDictionary::Column::Varchar }, { DictTabInfo::ExtBinary, NdbDictionary::Column::Binary }, diff --git a/ndb/src/ndbapi/NdbRecAttr.cpp b/ndb/src/ndbapi/NdbRecAttr.cpp index 9c9a9cea8da..db83e9c5fcf 100644 --- a/ndb/src/ndbapi/NdbRecAttr.cpp +++ b/ndb/src/ndbapi/NdbRecAttr.cpp @@ -156,7 +156,8 @@ NdbOut& operator<<(NdbOut& out, const NdbRecAttr &r) return out; } - uint length = r.getColumn()->getLength(); + const NdbDictionary::Column* c = r.getColumn(); + uint length = c->getLength(); if (length > 1) out << "["; @@ -208,6 +209,18 @@ NdbOut& operator<<(NdbOut& out, const NdbRecAttr &r) case NdbDictionary::Column::Double: out << r.double_value(); break; + case NdbDictionary::Column::Olddecimal: + { + short len = 1 + c->getPrecision() + (c->getScale() > 0); + out.print("%.*s", len, r.aRef()); + } + break; + case NdbDictionary::Column::Olddecimalunsigned: + { + short len = 0 + c->getPrecision() + (c->getScale() > 0); + out.print("%.*s", len, r.aRef()); + } + break; // for dates cut-and-paste from field.cc case NdbDictionary::Column::Datetime: { diff --git a/ndb/test/include/NdbSchemaOp.hpp b/ndb/test/include/NdbSchemaOp.hpp index 77e704c0e5c..e8ab542b00a 100644 --- a/ndb/test/include/NdbSchemaOp.hpp +++ b/ndb/test/include/NdbSchemaOp.hpp @@ -567,7 +567,8 @@ convertColumnTypeToAttrType(NdbDictionary::Column::Type _type) case NdbDictionary::Column::Unsigned: return UnSigned; case NdbDictionary::Column::Float: - case NdbDictionary::Column::Decimal: + case NdbDictionary::Column::Olddecimal: + case NdbDictionary::Column::Olddecimalunsigned: case NdbDictionary::Column::Double: return Float; case NdbDictionary::Column::Char: diff --git a/ndb/tools/restore/consumer.cpp b/ndb/tools/restore/consumer.cpp index 4d228230423..ecbdbbf8f4e 100644 --- a/ndb/tools/restore/consumer.cpp +++ b/ndb/tools/restore/consumer.cpp @@ -44,9 +44,12 @@ BackupConsumer::create_table_string(const TableS & table, case NdbDictionary::Column::Float: pos += sprintf(buf+pos, "%s", "float"); break; - case NdbDictionary::Column::Decimal: + case NdbDictionary::Column::Olddecimal: pos += sprintf(buf+pos, "%s", "decimal"); break; + case NdbDictionary::Column::Olddecimalunsigned: + pos += sprintf(buf+pos, "%s", "decimal unsigned"); + break; case NdbDictionary::Column::Char: pos += sprintf(buf+pos, "%s", "char"); break; diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 9e34baae198..47cca937544 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -2276,10 +2276,14 @@ void ha_ndbcluster::print_results() fprintf(DBUG_FILE, "Double\t%f", value); break; } - case NdbDictionary::Column::Decimal: { + case NdbDictionary::Column::Olddecimal: { char *value= field->ptr; - - fprintf(DBUG_FILE, "Decimal\t'%-*s'", field->pack_length(), value); + fprintf(DBUG_FILE, "Olddecimal\t'%-*s'", field->pack_length(), value); + break; + } + case NdbDictionary::Column::Olddecimalunsigned: { + char *value= field->ptr; + fprintf(DBUG_FILE, "Olddecimalunsigned\t'%-*s'", field->pack_length(), value); break; } case NdbDictionary::Column::Char:{ @@ -3312,10 +3316,6 @@ static int create_ndb_column(NDBCOL &col, const enum enum_field_types mysql_type= field->real_type(); switch (mysql_type) { // Numeric types - case MYSQL_TYPE_DECIMAL: - col.setType(NDBCOL::Char); - col.setLength(field->pack_length()); - break; case MYSQL_TYPE_TINY: if (field->flags & UNSIGNED_FLAG) col.setType(NDBCOL::Tinyunsigned); @@ -3359,6 +3359,26 @@ static int create_ndb_column(NDBCOL &col, col.setType(NDBCOL::Double); col.setLength(1); break; + case MYSQL_TYPE_DECIMAL: + { + Field_decimal *f= (Field_decimal*)field; + uint precision= f->pack_length(); + uint scale= f->decimals(); + if (field->flags & UNSIGNED_FLAG) + { + col.setType(NDBCOL::Olddecimalunsigned); + precision-= (scale > 0); + } + else + { + col.setType(NDBCOL::Olddecimal); + precision-= 1 + (scale > 0); + } + col.setPrecision(precision); + col.setScale(scale); + col.setLength(1); + } + break; // Date types case MYSQL_TYPE_DATETIME: col.setType(NDBCOL::Datetime); From eab44eaaca1f0f7cb1b88cc979591fa21cbed78f Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 16 Feb 2005 16:05:18 +0000 Subject: [PATCH 1009/1063] Bug#4445 Make a more informative platform info for Windows --- include/config-win.h | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/include/config-win.h b/include/config-win.h index 152e85c8e68..42aa23c3afe 100644 --- a/include/config-win.h +++ b/include/config-win.h @@ -23,18 +23,25 @@ #include #include -#if defined(__NT__) -#define SYSTEM_TYPE "NT" -#elif defined(__WIN2000__) -#define SYSTEM_TYPE "WIN2000" +#if defined(_WIN64) || defined(WIN64) +#define SYSTEM_TYPE "Win64" +#elif defined(_WIN32) || defined(WIN32) +#define SYSTEM_TYPE "Win32" #else -#define SYSTEM_TYPE "Win95/Win98" +#define SYSTEM_TYPE "Windows" #endif -#if defined(_WIN64) || defined(WIN64) -#define MACHINE_TYPE "ia64" /* Define to machine type name */ +#if defined(_M_IA64) +#define MACHINE_TYPE "ia64" +#elif defined(_M_IX86) +#define MACHINE_TYPE "ia32" +#elif defined(_M_ALPHA) +#define MACHINE_TYPE "axp" #else -#define MACHINE_TYPE "i32" /* Define to machine type name */ +#define MACHINE_TYPE "unknown" /* Define to machine type name */ +#endif + +#if !(defined(_WIN64) || defined(WIN64)) #ifndef _WIN32 #define _WIN32 /* Compatible with old source */ #endif From 2eb2383ed022ec8ec591f4dde9565b7415f11351 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 16 Feb 2005 20:46:34 +0100 Subject: [PATCH 1010/1063] reuse nodeid if ndbd is restarted mysql-test/mysql-test-run.pl: start and exit fix for ndbcluster --- mysql-test/mysql-test-run.pl | 6 +++++- ndb/include/mgmapi/mgmapi.h | 1 + ndb/include/mgmcommon/ConfigRetriever.hpp | 2 ++ ndb/src/common/mgmcommon/ConfigRetriever.cpp | 6 ++++++ ndb/src/kernel/vm/Configuration.cpp | 9 +++++++++ ndb/src/mgmapi/mgmapi.cpp | 9 +++++++++ 6 files changed, 32 insertions(+), 1 deletion(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index f204fee50ed..ec163529ffb 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -358,6 +358,10 @@ sub main () { if ( $opt_start_and_exit ) { + if ( ndbcluster_start() ) + { + mtr_error("Can't start ndbcluster"); + } if ( mysqld_start('master',0,[],[]) ) { mtr_report("Servers started, exiting"); @@ -1054,7 +1058,7 @@ sub ndbcluster_start () { "--data-dir=$glob_mysql_test_dir/var"], "", "/dev/null", "", "") ) { - mtr_error("Error ndbcluster_install"); + mtr_error("Error ndbcluster_start"); return 1; } diff --git a/ndb/include/mgmapi/mgmapi.h b/ndb/include/mgmapi/mgmapi.h index 3d4a34d6488..fa0774afa06 100644 --- a/ndb/include/mgmapi/mgmapi.h +++ b/ndb/include/mgmapi/mgmapi.h @@ -376,6 +376,7 @@ extern "C" { int ndb_mgm_set_connectstring(NdbMgmHandle handle, const char *connect_string); + int ndb_mgm_set_configuration_nodeid(NdbMgmHandle handle, int nodeid); int ndb_mgm_get_configuration_nodeid(NdbMgmHandle handle); int ndb_mgm_get_connected_port(NdbMgmHandle handle); const char *ndb_mgm_get_connected_host(NdbMgmHandle handle); diff --git a/ndb/include/mgmcommon/ConfigRetriever.hpp b/ndb/include/mgmcommon/ConfigRetriever.hpp index 8461658748e..be6d656e1a5 100644 --- a/ndb/include/mgmcommon/ConfigRetriever.hpp +++ b/ndb/include/mgmcommon/ConfigRetriever.hpp @@ -55,6 +55,8 @@ public: */ Uint32 allocNodeId(int no_retries, int retry_delay_in_seconds); + int setNodeId(Uint32 nodeid); + /** * Get config using socket */ diff --git a/ndb/src/common/mgmcommon/ConfigRetriever.cpp b/ndb/src/common/mgmcommon/ConfigRetriever.cpp index db00cc1510f..fd04ad393eb 100644 --- a/ndb/src/common/mgmcommon/ConfigRetriever.cpp +++ b/ndb/src/common/mgmcommon/ConfigRetriever.cpp @@ -316,6 +316,12 @@ ConfigRetriever::verifyConfig(const struct ndb_mgm_configuration * conf, Uint32 return true; } +int +ConfigRetriever::setNodeId(Uint32 nodeid) +{ + return ndb_mgm_set_configuration_nodeid(m_handle, nodeid); +} + Uint32 ConfigRetriever::allocNodeId(int no_retries, int retry_delay_in_seconds) { diff --git a/ndb/src/kernel/vm/Configuration.cpp b/ndb/src/kernel/vm/Configuration.cpp index f35a5859ff8..de78a4e927c 100644 --- a/ndb/src/kernel/vm/Configuration.cpp +++ b/ndb/src/kernel/vm/Configuration.cpp @@ -141,6 +141,8 @@ Configuration::init(int argc, char** argv) else _programName = strdup(""); + globalData.ownId= 0; + return true; } @@ -215,6 +217,13 @@ Configuration::fetch_configuration(){ ConfigRetriever &cr= *m_config_retriever; + /** + * if we have a nodeid set (e.g in a restart situation) + * reuse it + */ + if (globalData.ownId) + cr.setNodeId(globalData.ownId); + globalData.ownId = cr.allocNodeId(2 /*retry*/,3 /*delay*/); if(globalData.ownId == 0){ diff --git a/ndb/src/mgmapi/mgmapi.cpp b/ndb/src/mgmapi/mgmapi.cpp index 5a95c6e9ac1..68106c4689d 100644 --- a/ndb/src/mgmapi/mgmapi.cpp +++ b/ndb/src/mgmapi/mgmapi.cpp @@ -1720,6 +1720,15 @@ ndb_mgm_destroy_configuration(struct ndb_mgm_configuration *cfg) } } +extern "C" +int +ndb_mgm_set_configuration_nodeid(NdbMgmHandle handle, int nodeid) +{ + CHECK_HANDLE(handle, -1); + handle->cfg._ownNodeId= nodeid; + return 0; +} + extern "C" int ndb_mgm_get_configuration_nodeid(NdbMgmHandle handle) From 5edc77beb87e47d977a22945bfd82485d1707239 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 16 Feb 2005 11:58:35 -0800 Subject: [PATCH 1011/1063] When calling initgroups(), set a flag that the segfault handler checks in order to output a special warning about a particular case of segfaults due to a mix of static binaries, NSS, and LDAP. (Bug #4872) sql/mysqld.cc: Add code to output a special message when we get a segfault when calling initgroups() to explain the problem. --- sql/mysqld.cc | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index f104e461d6a..0585b5840d3 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -308,6 +308,9 @@ my_bool opt_readonly = 0, opt_sync_bdb_logs, opt_sync_frm; volatile bool mqh_used = 0; FILE *bootstrap_file=0; int segfaulted = 0; // ensure we do not enter SIGSEGV handler twice +#ifdef HAVE_INITGROUPS +static bool calling_initgroups= FALSE; /* Used in SIGSEGV handler. */ +#endif /* If sql_bin_update is true, SQL_LOG_UPDATE and SQL_LOG_BIN are kept in sync, @@ -1086,7 +1089,15 @@ static void set_user(const char *user, struct passwd *user_info) #if !defined(__WIN__) && !defined(OS2) && !defined(__NETWARE__) DBUG_ASSERT(user_info); #ifdef HAVE_INITGROUPS + /* + We can get a SIGSEGV when calling initgroups() on some systems when NSS + is configured to use LDAP and the server is statically linked. We set + calling_initgroups as a flag to the SIGSEGV handler that is then used to + output a specific message to help the user resolve this problem. + */ + calling_initgroups= TRUE; initgroups((char*) user, user_info->pw_gid); + calling_initgroups= FALSE; #endif if (setgid(user_info->pw_gid) == -1) { @@ -1807,6 +1818,17 @@ information that should help you find out what is causing the crash.\n"); fflush(stderr); #endif /* HAVE_STACKTRACE */ +#ifdef HAVE_INITGROUPS + if (calling_initgroups) + fprintf(stderr, "\n\ +This crash occured while the server was calling initgroups(). This is\n\ +often due to the use of a mysqld that is statically linked against glibc\n\ +and configured to use LDAP in /etc/nsswitch.conf. You will need to either\n\ +upgrade to a version of glibc that does not have this problem (2.3.4 or\n\ +later when used with nscd), disable LDAP in your nsswitch.conf, or use a\n\ +mysqld that is not statically linked.\n"); +#endif + if (test_flags & TEST_CORE_ON_SIGNAL) { fprintf(stderr, "Writing a core file\n"); From 600e432143664fb90593b934123a538070a8f8a3 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 16 Feb 2005 21:54:35 +0100 Subject: [PATCH 1012/1063] bug #8556 corrupt ndb_mgm show printout for certain configurations --- ndb/src/mgmclient/CommandInterpreter.cpp | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/ndb/src/mgmclient/CommandInterpreter.cpp b/ndb/src/mgmclient/CommandInterpreter.cpp index 025bed2bc09..c3b0ee7fe97 100644 --- a/ndb/src/mgmclient/CommandInterpreter.cpp +++ b/ndb/src/mgmclient/CommandInterpreter.cpp @@ -1069,16 +1069,19 @@ print_nodes(ndb_mgm_cluster_state *state, ndb_mgm_configuration_iterator *it, } ndbout << ")" << endl; } else { - if(ndb_mgm_find(it, CFG_NODE_ID, node_id) != 0){ - ndbout_c("Unable to find node with id: %d", node_id); - return; + ndb_mgm_first(it); + if(ndb_mgm_find(it, CFG_NODE_ID, node_id) == 0){ + const char *config_hostname= 0; + ndb_mgm_get_string_parameter(it, CFG_NODE_HOST, &config_hostname); + if (config_hostname == 0 || config_hostname[0] == 0) + config_hostname= "any host"; + ndbout_c(" (not connected, accepting connect from %s)", + config_hostname); + } + else + { + ndbout_c("Unable to find node with id: %d", node_id); } - const char *config_hostname= 0; - ndb_mgm_get_string_parameter(it, CFG_NODE_HOST, &config_hostname); - if (config_hostname == 0 || config_hostname[0] == 0) - config_hostname= "any host"; - ndbout << " (not connected, accepting connect from " - << config_hostname << ")" << endl; } } } From 7770f8f9614b9d0950e0f9f1da3fb4500fb3f29a Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 16 Feb 2005 14:03:16 -0800 Subject: [PATCH 1013/1063] Make post-commit trigger not send emails when the message would not contain any actual changes. (Often the case in merges where the only change involves renumbering ChangeSet entries.) BitKeeper/triggers/post-commit: Suppress emails when there's no changes actually reported --- BitKeeper/triggers/post-commit | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/BitKeeper/triggers/post-commit b/BitKeeper/triggers/post-commit index a38b1f5a068..d2a4f9153b2 100755 --- a/BitKeeper/triggers/post-commit +++ b/BitKeeper/triggers/post-commit @@ -19,6 +19,13 @@ BK_STATUS=$BK_STATUS$BK_COMMIT if [ "$BK_STATUS" = OK ] then +HAS_ACTUAL_CHANGES=`bk cset -r+ -d | grep -v "^#"` +if [ "$HAS_ACTUAL_CHANGES" = "" ] +then + echo ChangeSet had no real changes, not sending emails + exit +fi + CHANGESET=`bk -R prs -r+ -h -d':P:::I:' ChangeSet` BUG=`bk -R prs -r+ -h -d':C:' ChangeSet | sed -ne 's/^.*[Bb][Uu][Gg] *# *\([0-9][0-9]*\).*$/\1/p'` From a2d622b0571e707c36d953f7a1153337e6d421d0 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 17 Feb 2005 00:28:04 +0100 Subject: [PATCH 1014/1063] BUG#8297: If query is filtered on slave, do not put it in general log. sql/log_event.cc: If query is filtered on slave, do not put info in general log. --- sql/log_event.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sql/log_event.cc b/sql/log_event.cc index 19113a3b97e..37072d7845b 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -1016,7 +1016,6 @@ int Query_log_event::exec_event(struct st_relay_log_info* rli) VOID(pthread_mutex_unlock(&LOCK_thread_count)); thd->variables.pseudo_thread_id= thread_id; // for temp tables - mysql_log.write(thd,COM_QUERY,"%s",thd->query); DBUG_PRINT("query",("%s",thd->query)); if (ignored_error_code((expected_error= error_code)) || !check_expected_error(thd,rli,expected_error)) @@ -1046,6 +1045,10 @@ START SLAVE; . Query: '%s'", expected_error, thd->query); goto end; } + /* If the query was not ignored, it is printed to the general log */ + if (thd->net.last_errno != ER_SLAVE_IGNORED_TABLE) + mysql_log.write(thd,COM_QUERY,"%s",thd->query); + /* If we expected a non-zero error code, and we don't get the same error code, and none of them should be ignored. From 6078fcc1f05bb159928a1e09bacbbc57b3ae07cf Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 17 Feb 2005 01:33:59 +0000 Subject: [PATCH 1015/1063] Bug#8147 Fix ambigious table error for INSERT..SELECT..UPDATE mysql-test/r/insert_update.result: Bug#8147 Alter test for bug mysql-test/t/insert_update.test: Bug#8147 Alter test for bug sql/sql_parse.cc: Bug#8147 Change order of code - skip insert table before calling mysql_prepare_insert() --- mysql-test/r/insert_update.result | 6 +++--- mysql-test/t/insert_update.test | 7 ++++--- sql/sql_parse.cc | 22 ++++++++++++++-------- 3 files changed, 21 insertions(+), 14 deletions(-) diff --git a/mysql-test/r/insert_update.result b/mysql-test/r/insert_update.result index 753dc2cd749..ff7ec1ba73f 100644 --- a/mysql-test/r/insert_update.result +++ b/mysql-test/r/insert_update.result @@ -140,10 +140,10 @@ a b c 5 6 130 TRUNCATE TABLE t1; INSERT t1 VALUES (1,2,10), (3,4,20); -CREATE TABLE t2 (x INT, y INT, z INT, d INT); +CREATE TABLE t2 (a INT, b INT, c INT, d INT); INSERT t2 VALUES (5,6,30,1), (7,4,40,1), (8,9,60,1); INSERT t2 VALUES (2,1,11,2), (7,4,40,2); -INSERT t1 SELECT x,y,z FROM t2 WHERE d=1 ON DUPLICATE KEY UPDATE c=c+100; +INSERT t1 SELECT a,b,c FROM t2 WHERE d=1 ON DUPLICATE KEY UPDATE c=c+100; SELECT * FROM t1; a b c 1 2 10 @@ -157,7 +157,7 @@ a b c 3 4 120 5 0 30 8 9 60 -INSERT t1 SELECT x,y,z FROM t2 WHERE d=2 ON DUPLICATE KEY UPDATE c=c+VALUES(a); +INSERT t1 SELECT a,b,c FROM t2 WHERE d=2 ON DUPLICATE KEY UPDATE c=c+VALUES(a); SELECT *, VALUES(a) FROM t1; a b c VALUES(a) 1 2 10 NULL diff --git a/mysql-test/t/insert_update.test b/mysql-test/t/insert_update.test index 182baa641da..188de8a5379 100644 --- a/mysql-test/t/insert_update.test +++ b/mysql-test/t/insert_update.test @@ -68,14 +68,15 @@ INSERT t1 SELECT 1,9,70 FROM DUAL ON DUPLICATE KEY UPDATE c=c+100000, b=4; SELECT * FROM t1; TRUNCATE TABLE t1; INSERT t1 VALUES (1,2,10), (3,4,20); -CREATE TABLE t2 (x INT, y INT, z INT, d INT); +CREATE TABLE t2 (a INT, b INT, c INT, d INT); +# column names deliberately clash with columns in t1 (Bug#8147) INSERT t2 VALUES (5,6,30,1), (7,4,40,1), (8,9,60,1); INSERT t2 VALUES (2,1,11,2), (7,4,40,2); -INSERT t1 SELECT x,y,z FROM t2 WHERE d=1 ON DUPLICATE KEY UPDATE c=c+100; +INSERT t1 SELECT a,b,c FROM t2 WHERE d=1 ON DUPLICATE KEY UPDATE c=c+100; SELECT * FROM t1; INSERT t1 SET a=5 ON DUPLICATE KEY UPDATE b=0; SELECT * FROM t1; -INSERT t1 SELECT x,y,z FROM t2 WHERE d=2 ON DUPLICATE KEY UPDATE c=c+VALUES(a); +INSERT t1 SELECT a,b,c FROM t2 WHERE d=2 ON DUPLICATE KEY UPDATE c=c+VALUES(a); SELECT *, VALUES(a) FROM t1; DROP TABLE t1; DROP TABLE t2; diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index e66eeb279d2..329c29b9b75 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -2768,18 +2768,23 @@ unsent_create_error: select_lex->options |= OPTION_BUFFER_RESULT; } - if (!(res= open_and_lock_tables(thd, tables)) && - !(res= mysql_prepare_insert(thd, tables, first_local_table, - tables->table, lex->field_list, 0, + if ((res= open_and_lock_tables(thd, tables))) + break; + + TABLE *table= tables->table; + /* Skip first table, which is the table we are inserting in */ + tables= (TABLE_LIST *) + lex->select_lex.table_list.first= (byte*) first_local_table->next; + first_local_table->next= 0; + + if (!(res= mysql_prepare_insert(thd, tables, first_local_table, + table, lex->field_list, 0, lex->update_list, lex->value_list, lex->duplicates)) && - (result= new select_insert(tables->table, &lex->field_list, + (result= new select_insert(table, &lex->field_list, &lex->update_list, &lex->value_list, lex->duplicates, lex->ignore))) { - TABLE *table= tables->table; - /* Skip first table, which is the table we are inserting in */ - lex->select_lex.table_list.first= (byte*) first_local_table->next; /* insert/replace from SELECT give its SELECT_LEX for SELECT, and item_list belong to SELECT @@ -2787,7 +2792,6 @@ unsent_create_error: lex->select_lex.resolve_mode= SELECT_LEX::SELECT_MODE; res= handle_select(thd, lex, result); /* revert changes for SP */ - lex->select_lex.table_list.first= (byte*) first_local_table; lex->select_lex.resolve_mode= SELECT_LEX::INSERT_MODE; delete result; table->insert_values= 0; @@ -2796,6 +2800,8 @@ unsent_create_error: } else res= -1; + first_local_table->next= tables; + lex->select_lex.table_list.first= (byte*) first_local_table; break; } case SQLCOM_TRUNCATE: From 3ece905301621e8e8b5742a30e82f2e8b2fa59fa Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 16 Feb 2005 17:37:56 -0800 Subject: [PATCH 1016/1063] Fix output of perror to include whether the error message corresponds to an OS or MySQL error. (Bug #8517) extra/perror.c: Don't report OS errors that start with 'Unknown Error', and always make clear whether we are reporting an OS or MySQL error message. --- extra/perror.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/extra/perror.c b/extra/perror.c index b377b360b5c..6e632b20d96 100644 --- a/extra/perror.c +++ b/extra/perror.c @@ -245,16 +245,17 @@ int main(int argc,char *argv[]) msg = strerror(code); /* - Don't print message for not existing error messages or for - unknown errors. We test for 'Uknown Errors' just as an - extra safety for Netware + We don't print the OS error message if it is the same as the + unknown_error message we retrieved above, or it starts with + 'Unknown Error' (without regard to case). */ - if (msg && strcmp(msg, "Unknown Error") && + if (msg && + my_strnncoll(&my_charset_latin1, msg, 13, "Unknown Error", 13) && (!unknown_error || strcmp(msg, unknown_error))) { found=1; if (verbose) - printf("Error code %3d: %s\n",code,msg); + printf("OS error code %3d: %s\n",code,msg); else puts(msg); } @@ -269,7 +270,7 @@ int main(int argc,char *argv[]) else { if (verbose) - printf("MySQL error: %3d = %s\n",code,msg); + printf("MySQL error code %3d: %s\n",code,msg); else puts(msg); } From 3f808996794b5ed83f646fd08946a5499bbb665c Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 17 Feb 2005 02:59:39 +0100 Subject: [PATCH 1017/1063] Windows compatibility changes of the 'rpl_delete_all', 'ps_1general' and 'fulltext_cache' test cases. mysql-test/r/fulltext_cache.result: To pass on Windows, round to less digits mysql-test/t/fulltext_cache.test: To pass on Windows, round to less digits mysql-test/t/ps_1general.test: To pass on Windows, change \\ to / in result mysql-test/t/rpl_delete_all.test: To pass on Windows, change \\ to / in result mysql-test/mysql-test-run.pl: Pass mysqld --console to catch output on Windows mysql-test/lib/mtr_process.pl: Check error from exec() to avoid becoming a fork() bomb --- mysql-test/lib/mtr_process.pl | 33 ++++++++++++++++++++++----- mysql-test/mysql-test-run.pl | 2 ++ mysql-test/r/fulltext_cache.result | 36 +++++++++++++++--------------- mysql-test/t/fulltext_cache.test | 4 ++-- mysql-test/t/ps_1general.test | 1 + mysql-test/t/rpl_delete_all.test | 2 +- 6 files changed, 52 insertions(+), 26 deletions(-) diff --git a/mysql-test/lib/mtr_process.pl b/mysql-test/lib/mtr_process.pl index e1461a9730c..8aefc235d72 100644 --- a/mysql-test/lib/mtr_process.pl +++ b/mysql-test/lib/mtr_process.pl @@ -123,6 +123,17 @@ sub spawn_impl ($$$$$$$) { $SIG{INT}= 'DEFAULT'; # Parent do some stuff, we don't + if ( $::glob_cygwin_shell and $mode eq 'test' ) + { + # Programs started from mysqltest under Cygwin, are to + # execute them within Cygwin. Else simple things in test + # files like + # --system "echo 1 > file" + # will fail. + # FIXME not working :-( +# $ENV{'COMSPEC'}= "$::glob_cygwin_shell -c"; + } + if ( $output ) { if ( ! open(STDOUT,">",$output) ) @@ -130,6 +141,7 @@ sub spawn_impl ($$$$$$$) { mtr_error("can't redirect STDOUT to \"$output\": $!"); } } + if ( $error ) { if ( $output eq $error ) @@ -147,6 +159,7 @@ sub spawn_impl ($$$$$$$) { } } } + if ( $input ) { if ( ! open(STDIN,"<",$input) ) @@ -154,7 +167,11 @@ sub spawn_impl ($$$$$$$) { mtr_error("can't redirect STDIN to \"$input\": $!"); } } - exec($path,@$arg_list_t); + + if ( ! exec($path,@$arg_list_t) ) + { + mtr_error("failed to execute \"$path\": $!"); + } } } } @@ -569,7 +586,7 @@ sub mtr_stop_mysqld_servers ($) { sub mtr_mysqladmin_shutdown () { my $spec= shift; - my @mysql_admin_pids; + my %mysql_admin_pids; my @to_kill_specs; foreach my $srv ( @$spec ) @@ -611,13 +628,19 @@ sub mtr_mysqladmin_shutdown () { # We don't wait for termination of mysqladmin my $pid= mtr_spawn($::exe_mysqladmin, $args, "", $::path_manager_log, $::path_manager_log, ""); - push(@mysql_admin_pids, $pid); + $mysql_admin_pids{$pid}= 1; } # We wait blocking, we wait for the last one anyway - foreach my $pid (@mysql_admin_pids) + while (keys %mysql_admin_pids) { - waitpid($pid,0); # FIXME no need to check -1 or 0? + foreach my $pid (keys %mysql_admin_pids) + { + if ( waitpid($pid,0) > 0 ) + { + delete $mysql_admin_pids{$pid}; + } + } } # If we trusted "mysqladmin --shutdown_timeout= ..." we could just diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index ed67e316bef..07216f0afe3 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -1261,6 +1261,7 @@ sub install_db ($$) { mtr_add_arg($args, "--no-defaults"); mtr_add_arg($args, "--bootstrap"); + mtr_add_arg($args, "--console"); mtr_add_arg($args, "--skip-grant-tables"); mtr_add_arg($args, "--basedir=%s", $path_my_basedir); mtr_add_arg($args, "--datadir=%s", $data_dir); @@ -1604,6 +1605,7 @@ sub mysqld_arguments ($$$$$) { mtr_add_arg($args, "%s--no-defaults", $prefix); } + mtr_add_arg($args, "%s--console", $prefix); mtr_add_arg($args, "%s--basedir=%s", $prefix, $path_my_basedir); mtr_add_arg($args, "%s--character-sets-dir=%s", $prefix, $path_charsetsdir); mtr_add_arg($args, "%s--core", $prefix); diff --git a/mysql-test/r/fulltext_cache.result b/mysql-test/r/fulltext_cache.result index 6a94189d8b4..80c101357c5 100644 --- a/mysql-test/r/fulltext_cache.result +++ b/mysql-test/r/fulltext_cache.result @@ -21,17 +21,17 @@ INSERT INTO t2 VALUES (5,2,'um copo de Vodka'); INSERT INTO t2 VALUES (6,2,'um chocolate Snickers'); INSERT INTO t2 VALUES (7,1,'Bife'); INSERT INTO t2 VALUES (8,1,'Pizza de Salmao'); -SELECT t1.q, t2.item, t2.id, round(MATCH t2.item AGAINST ('sushi'),8) +SELECT t1.q, t2.item, t2.id, round(MATCH t2.item AGAINST ('sushi'),6) as x FROM t1, t2 WHERE (t2.id2 = t1.id) ORDER BY x DESC,t2.id; q item id x -aaaaaaaaa dsaass de sushi 1 1.92378664 -aaaaaaaaa dsaass de Bolo de Chocolate 2 0.00000000 -aaaaaaaaa dsaass de Feijoada 3 0.00000000 -aaaaaaaaa dsaass de Mousse de Chocolate 4 0.00000000 -ssde df s fsda sad er um copo de Vodka 5 0.00000000 -ssde df s fsda sad er um chocolate Snickers 6 0.00000000 -aaaaaaaaa dsaass de Bife 7 0.00000000 -aaaaaaaaa dsaass de Pizza de Salmao 8 0.00000000 +aaaaaaaaa dsaass de sushi 1 1.923787 +aaaaaaaaa dsaass de Bolo de Chocolate 2 0.000000 +aaaaaaaaa dsaass de Feijoada 3 0.000000 +aaaaaaaaa dsaass de Mousse de Chocolate 4 0.000000 +ssde df s fsda sad er um copo de Vodka 5 0.000000 +ssde df s fsda sad er um chocolate Snickers 6 0.000000 +aaaaaaaaa dsaass de Bife 7 0.000000 +aaaaaaaaa dsaass de Pizza de Salmao 8 0.000000 SELECT t1.q, t2.item, t2.id, MATCH t2.item AGAINST ('sushi' IN BOOLEAN MODE) as x FROM t1, t2 WHERE (t2.id2 = t1.id) ORDER BY x DESC,t2.id; q item id x @@ -43,17 +43,17 @@ ssde df s fsda sad er um copo de Vodka 5 0 ssde df s fsda sad er um chocolate Snickers 6 0 aaaaaaaaa dsaass de Bife 7 0 aaaaaaaaa dsaass de Pizza de Salmao 8 0 -SELECT t1.q, t2.item, t2.id, round(MATCH t2.item AGAINST ('sushi'),8) +SELECT t1.q, t2.item, t2.id, round(MATCH t2.item AGAINST ('sushi'),6) as x FROM t2, t1 WHERE (t2.id2 = t1.id) ORDER BY x DESC,t2.id; q item id x -aaaaaaaaa dsaass de sushi 1 1.92378664 -aaaaaaaaa dsaass de Bolo de Chocolate 2 0.00000000 -aaaaaaaaa dsaass de Feijoada 3 0.00000000 -aaaaaaaaa dsaass de Mousse de Chocolate 4 0.00000000 -ssde df s fsda sad er um copo de Vodka 5 0.00000000 -ssde df s fsda sad er um chocolate Snickers 6 0.00000000 -aaaaaaaaa dsaass de Bife 7 0.00000000 -aaaaaaaaa dsaass de Pizza de Salmao 8 0.00000000 +aaaaaaaaa dsaass de sushi 1 1.923787 +aaaaaaaaa dsaass de Bolo de Chocolate 2 0.000000 +aaaaaaaaa dsaass de Feijoada 3 0.000000 +aaaaaaaaa dsaass de Mousse de Chocolate 4 0.000000 +ssde df s fsda sad er um copo de Vodka 5 0.000000 +ssde df s fsda sad er um chocolate Snickers 6 0.000000 +aaaaaaaaa dsaass de Bife 7 0.000000 +aaaaaaaaa dsaass de Pizza de Salmao 8 0.000000 SELECT t1.q, t2.item, t2.id, MATCH t2.item AGAINST ('sushi' IN BOOLEAN MODE) as x FROM t2, t1 WHERE (t2.id2 = t1.id) ORDER BY x DESC,t2.id; q item id x diff --git a/mysql-test/t/fulltext_cache.test b/mysql-test/t/fulltext_cache.test index 234deab91e6..b01f0d18b76 100644 --- a/mysql-test/t/fulltext_cache.test +++ b/mysql-test/t/fulltext_cache.test @@ -29,13 +29,13 @@ INSERT INTO t2 VALUES (6,2,'um chocolate Snickers'); INSERT INTO t2 VALUES (7,1,'Bife'); INSERT INTO t2 VALUES (8,1,'Pizza de Salmao'); -SELECT t1.q, t2.item, t2.id, round(MATCH t2.item AGAINST ('sushi'),8) +SELECT t1.q, t2.item, t2.id, round(MATCH t2.item AGAINST ('sushi'),6) as x FROM t1, t2 WHERE (t2.id2 = t1.id) ORDER BY x DESC,t2.id; SELECT t1.q, t2.item, t2.id, MATCH t2.item AGAINST ('sushi' IN BOOLEAN MODE) as x FROM t1, t2 WHERE (t2.id2 = t1.id) ORDER BY x DESC,t2.id; -SELECT t1.q, t2.item, t2.id, round(MATCH t2.item AGAINST ('sushi'),8) +SELECT t1.q, t2.item, t2.id, round(MATCH t2.item AGAINST ('sushi'),6) as x FROM t2, t1 WHERE (t2.id2 = t1.id) ORDER BY x DESC,t2.id; SELECT t1.q, t2.item, t2.id, MATCH t2.item AGAINST ('sushi' IN BOOLEAN MODE) diff --git a/mysql-test/t/ps_1general.test b/mysql-test/t/ps_1general.test index 5450512b959..4ab81dfcac5 100644 --- a/mysql-test/t/ps_1general.test +++ b/mysql-test/t/ps_1general.test @@ -599,6 +599,7 @@ drop table t2; prepare stmt1 from ' rename table t5 to t6, t7 to t8 ' ; create table t5 (a int) ; # rename must fail, t7 does not exist +--replace_result \\ / --error 1017 execute stmt1 ; create table t7 (a int) ; diff --git a/mysql-test/t/rpl_delete_all.test b/mysql-test/t/rpl_delete_all.test index 23848720107..ad2ce29c610 100644 --- a/mysql-test/t/rpl_delete_all.test +++ b/mysql-test/t/rpl_delete_all.test @@ -6,7 +6,7 @@ connection master; drop database if exists mysqltest; sync_slave_with_master; # can't read dir ---replace_result "Errcode: 1" "Errcode: X" "Errcode: 2" "Errcode: X" +--replace_result "Errcode: 1" "Errcode: X" "Errcode: 2" "Errcode: X" \\ / --error 12 show tables from mysqltest; From 000255ee9d24eeb9f6cc29f0d4e3e92fe0ac8caa Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 17 Feb 2005 05:22:14 +0100 Subject: [PATCH 1018/1063] init_db.sql: Make SQL more readable, substitute hostname at runtime mysql-test-run.pl: Run init scripts with /bin/sh, ignore return code mysql-test/mysql-test-run.pl: Run init scripts with /bin/sh, ignore return code mysql-test/lib/init_db.sql: Make SQL more readable, substitute hostname at runtime --- mysql-test/lib/init_db.sql | 468 +++++++++++++++++++++++++++++++++-- mysql-test/mysql-test-run.pl | 22 +- 2 files changed, 452 insertions(+), 38 deletions(-) diff --git a/mysql-test/lib/init_db.sql b/mysql-test/lib/init_db.sql index 54591e9b9ff..cc44165405f 100644 --- a/mysql-test/lib/init_db.sql +++ b/mysql-test/lib/init_db.sql @@ -1,56 +1,470 @@ USE mysql; -CREATE TABLE db (Host char(60) binary DEFAULT '' NOT NULL,Db char(64) binary DEFAULT '' NOT NULL,User char(16) binary DEFAULT '' NOT NULL,Select_priv enum('N','Y') DEFAULT 'N' NOT NULL,Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL,Update_priv enum('N','Y') DEFAULT 'N' NOT NULL,Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL,Create_priv enum('N','Y') DEFAULT 'N' NOT NULL,Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL,Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL,References_priv enum('N','Y') DEFAULT 'N' NOT NULL,Index_priv enum('N','Y') DEFAULT 'N' NOT NULL,Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL,Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL,Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL,PRIMARY KEY Host (Host,Db,User),KEY User (User)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Database privileges'; +CREATE TABLE db ( + Host char(60) binary DEFAULT '' NOT NULL, + Db char(64) binary DEFAULT '' NOT NULL, + User char(16) binary DEFAULT '' NOT NULL, + Select_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Update_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Create_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL, + References_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Index_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL, + PRIMARY KEY Host (Host,Db,User), + KEY User (User) +) engine=MyISAM +CHARACTER SET utf8 COLLATE utf8_bin +comment='Database privileges'; + -INSERT INTO db VALUES ('%','test','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y'); +INSERT INTO db VALUES ('%','test' ,'','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y'); INSERT INTO db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y','N','Y','Y','Y','Y','Y'); -CREATE TABLE host (Host char(60) binary DEFAULT '' NOT NULL,Db char(64) binary DEFAULT '' NOT NULL,Select_priv enum('N','Y') DEFAULT 'N' NOT NULL,Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL,Update_priv enum('N','Y') DEFAULT 'N' NOT NULL,Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL,Create_priv enum('N','Y') DEFAULT 'N' NOT NULL,Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL,Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL,References_priv enum('N','Y') DEFAULT 'N' NOT NULL,Index_priv enum('N','Y') DEFAULT 'N' NOT NULL,Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL,Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL,Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL,PRIMARY KEY Host (Host,Db)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Host privileges; Merged with database privileges'; +CREATE TABLE host ( + Host char(60) binary DEFAULT '' NOT NULL, + Db char(64) binary DEFAULT '' NOT NULL, + Select_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Update_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Create_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL, + References_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Index_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL, + PRIMARY KEY Host (Host,Db) +) engine=MyISAM +CHARACTER SET utf8 COLLATE utf8_bin +comment='Host privileges; Merged with database privileges'; -CREATE TABLE user (Host char(60) binary DEFAULT '' NOT NULL,User char(16) binary DEFAULT '' NOT NULL,Password char(41) binary DEFAULT '' NOT NULL,Select_priv enum('N','Y') DEFAULT 'N' NOT NULL,Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL,Update_priv enum('N','Y') DEFAULT 'N' NOT NULL,Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL,Create_priv enum('N','Y') DEFAULT 'N' NOT NULL,Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL,Reload_priv enum('N','Y') DEFAULT 'N' NOT NULL,Shutdown_priv enum('N','Y') DEFAULT 'N' NOT NULL,Process_priv enum('N','Y') DEFAULT 'N' NOT NULL,File_priv enum('N','Y') DEFAULT 'N' NOT NULL,Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL,References_priv enum('N','Y') DEFAULT 'N' NOT NULL,Index_priv enum('N','Y') DEFAULT 'N' NOT NULL,Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL,Show_db_priv enum('N','Y') DEFAULT 'N' NOT NULL,Super_priv enum('N','Y') DEFAULT 'N' NOT NULL,Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL,Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL,Execute_priv enum('N','Y') DEFAULT 'N' NOT NULL,Repl_slave_priv enum('N','Y') DEFAULT 'N' NOT NULL,Repl_client_priv enum('N','Y') DEFAULT 'N' NOT NULL,ssl_type enum('','ANY','X509', 'SPECIFIED') DEFAULT '' NOT NULL,ssl_cipher BLOB NOT NULL,x509_issuer BLOB NOT NULL,x509_subject BLOB NOT NULL,max_questions int(11) unsigned DEFAULT 0 NOT NULL,max_updates int(11) unsigned DEFAULT 0 NOT NULL,max_connections int(11) unsigned DEFAULT 0 NOT NULL,PRIMARY KEY Host (Host,User)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Users and global privileges'; -INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); -INSERT INTO user VALUES ('g4%' ,'root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); -REPLACE INTO user VALUES ('127.0.0.1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); +CREATE TABLE user ( + Host char(60) binary DEFAULT '' NOT NULL, + User char(16) binary DEFAULT '' NOT NULL, + Password char(41) binary DEFAULT '' NOT NULL, + Select_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Update_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Create_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Reload_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Shutdown_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Process_priv enum('N','Y') DEFAULT 'N' NOT NULL, + File_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Grant_priv enum('N','Y') DEFAULT 'N' NOT NULL, + References_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Index_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Alter_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Show_db_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Super_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Execute_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Repl_slave_priv enum('N','Y') DEFAULT 'N' NOT NULL, + Repl_client_priv enum('N','Y') DEFAULT 'N' NOT NULL, + ssl_type enum('','ANY','X509', 'SPECIFIED') DEFAULT '' NOT NULL, + ssl_cipher BLOB NOT NULL, + x509_issuer BLOB NOT NULL, + x509_subject BLOB NOT NULL, + max_questions int(11) unsigned DEFAULT 0 NOT NULL, + max_updates int(11) unsigned DEFAULT 0 NOT NULL, + max_connections int(11) unsigned DEFAULT 0 NOT NULL, + PRIMARY KEY Host (Host,User) +) engine=MyISAM +CHARACTER SET utf8 COLLATE utf8_bin +comment='Users and global privileges'; + + +INSERT INTO user VALUES ('localhost' ,'root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); +INSERT INTO user VALUES ('@HOSTNAME@%','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); +REPLACE INTO user VALUES ('127.0.0.1' ,'root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0); INSERT INTO user (host,user) VALUES ('localhost',''); -INSERT INTO user (host,user) VALUES ('g4%',''); +INSERT INTO user (host,user) VALUES ('@HOSTNAME@%',''); -CREATE TABLE func (name char(64) binary DEFAULT '' NOT NULL,ret tinyint(1) DEFAULT '0' NOT NULL,dl char(128) DEFAULT '' NOT NULL,type enum ('function','aggregate') NOT NULL,PRIMARY KEY (name)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='User defined functions'; -CREATE TABLE tables_priv (Host char(60) binary DEFAULT '' NOT NULL,Db char(64) binary DEFAULT '' NOT NULL,User char(16) binary DEFAULT '' NOT NULL,Table_name char(64) binary DEFAULT '' NOT NULL,Grantor char(77) DEFAULT '' NOT NULL,Timestamp timestamp(14),Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') DEFAULT '' NOT NULL,Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL,PRIMARY KEY (Host,Db,User,Table_name),KEY Grantor (Grantor)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Table privileges'; +CREATE TABLE func ( + name char(64) binary DEFAULT '' NOT NULL, + ret tinyint(1) DEFAULT '0' NOT NULL, + dl char(128) DEFAULT '' NOT NULL, + type enum ('function','aggregate') NOT NULL, + PRIMARY KEY (name) +) engine=MyISAM +CHARACTER SET utf8 COLLATE utf8_bin +comment='User defined functions'; -CREATE TABLE columns_priv (Host char(60) binary DEFAULT '' NOT NULL,Db char(64) binary DEFAULT '' NOT NULL,User char(16) binary DEFAULT '' NOT NULL,Table_name char(64) binary DEFAULT '' NOT NULL,Column_name char(64) binary DEFAULT '' NOT NULL,Timestamp timestamp(14),Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL,PRIMARY KEY (Host,Db,User,Table_name,Column_name)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Column privileges'; -CREATE TABLE help_topic (help_topic_id int unsigned not null,name varchar(64) not null,help_category_id smallint unsigned not null,description text not null,example text not null,url varchar(128) not null,primary key (help_topic_id),unique index (name)) engine=MyISAM CHARACTER SET utf8 comment='help topics'; +CREATE TABLE tables_priv ( + Host char(60) binary DEFAULT '' NOT NULL, + Db char(64) binary DEFAULT '' NOT NULL, + User char(16) binary DEFAULT '' NOT NULL, + Table_name char(64) binary DEFAULT '' NOT NULL, + Grantor char(77) DEFAULT '' NOT NULL, + Timestamp timestamp(14), + Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') DEFAULT '' NOT NULL, + Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL, + PRIMARY KEY (Host,Db,User,Table_name),KEY Grantor (Grantor) +) engine=MyISAM +CHARACTER SET utf8 COLLATE utf8_bin +comment='Table privileges'; + + +CREATE TABLE columns_priv ( + Host char(60) binary DEFAULT '' NOT NULL, + Db char(64) binary DEFAULT '' NOT NULL, + User char(16) binary DEFAULT '' NOT NULL, + Table_name char(64) binary DEFAULT '' NOT NULL, + Column_name char(64) binary DEFAULT '' NOT NULL, + Timestamp timestamp(14), + Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL, + PRIMARY KEY (Host,Db,User,Table_name,Column_name) +) engine=MyISAM +CHARACTER SET utf8 COLLATE utf8_bin +comment='Column privileges'; + + +CREATE TABLE help_topic ( + help_topic_id int unsigned not null, + name varchar(64) not null, + help_category_id smallint unsigned not null, + description text not null, + example text not null, + url varchar(128) not null, + primary key (help_topic_id), + unique index (name) +) engine=MyISAM +CHARACTER SET utf8 +comment='help topics'; + -CREATE TABLE help_category (help_category_id smallint unsigned not null,name varchar(64) not null,parent_category_id smallint unsigned null,url varchar(128) not null,primary key (help_category_id),unique index (name)) engine=MyISAM CHARACTER SET utf8 comment='help categories'; +CREATE TABLE help_category ( + help_category_id smallint unsigned not null, + name varchar(64) not null, + parent_category_id smallint unsigned null, + url varchar(128) not null, + primary key (help_category_id),unique index (name) +) engine=MyISAM +CHARACTER SET utf8 +comment='help categories'; -CREATE TABLE help_keyword (help_keyword_id int unsigned not null,name varchar(64) not null,primary key (help_keyword_id),unique index (name)) engine=MyISAM CHARACTER SET utf8 comment='help keywords'; -CREATE TABLE help_relation (help_topic_id int unsigned not null references help_topic,help_keyword_id int unsigned not null references help_keyword,primary key (help_keyword_id, help_topic_id)) engine=MyISAM CHARACTER SET utf8 comment='keyword-topic relation'; +CREATE TABLE help_keyword ( + help_keyword_id int unsigned not null, + name varchar(64) not null, + primary key (help_keyword_id),unique index (name) +) engine=MyISAM +CHARACTER SET utf8 +comment='help keywords'; + + +CREATE TABLE help_relation ( + help_topic_id int unsigned not null references help_topic, + help_keyword_id int unsigned not null references help_keyword, + primary key (help_keyword_id, help_topic_id) +) engine=MyISAM +CHARACTER SET utf8 +comment='keyword-topic relation'; + + +CREATE TABLE time_zone_name ( + Name char(64) NOT NULL, + Time_zone_id int unsigned NOT NULL, + PRIMARY KEY Name (Name) +) engine=MyISAM +CHARACTER SET utf8 +comment='Time zone names'; -CREATE TABLE time_zone_name (Name char(64) NOT NULL,Time_zone_id int unsigned NOT NULL,PRIMARY KEY Name (Name)) engine=MyISAM CHARACTER SET utf8 comment='Time zone names'; -INSERT INTO time_zone_name (Name, Time_Zone_id) VALUES ('MET', 1), ('UTC', 2), ('Universal', 2), ('Europe/Moscow',3), ('leap/Europe/Moscow',4), ('Japan', 5); +INSERT INTO time_zone_name (Name, Time_Zone_id) VALUES + ('MET', 1), ('UTC', 2), ('Universal', 2), + ('Europe/Moscow',3), ('leap/Europe/Moscow',4), + ('Japan', 5); -CREATE TABLE time_zone (Time_zone_id int unsigned NOT NULL auto_increment,Use_leap_seconds enum('Y','N') DEFAULT 'N' NOT NULL,PRIMARY KEY TzId (Time_zone_id)) engine=MyISAM CHARACTER SET utf8 comment='Time zones'; +CREATE TABLE time_zone ( + Time_zone_id int unsigned NOT NULL auto_increment, + Use_leap_seconds enum('Y','N') DEFAULT 'N' NOT NULL, + PRIMARY KEY TzId (Time_zone_id) +) engine=MyISAM +CHARACTER SET utf8 +comment='Time zones'; + -INSERT INTO time_zone (Time_zone_id, Use_leap_seconds) VALUES (1,'N'), (2,'N'), (3,'N'), (4,'Y'), (5,'N'); +INSERT INTO time_zone (Time_zone_id, Use_leap_seconds) + VALUES (1,'N'), (2,'N'), (3,'N'), (4,'Y'), (5,'N'); -CREATE TABLE time_zone_transition (Time_zone_id int unsigned NOT NULL,Transition_time bigint signed NOT NULL,Transition_type_id int unsigned NOT NULL,PRIMARY KEY TzIdTranTime (Time_zone_id, Transition_time)) engine=MyISAM CHARACTER SET utf8 comment='Time zone transitions'; +CREATE TABLE time_zone_transition ( + Time_zone_id int unsigned NOT NULL, + Transition_time bigint signed NOT NULL, + Transition_type_id int unsigned NOT NULL, + PRIMARY KEY TzIdTranTime (Time_zone_id, Transition_time) +) engine=MyISAM +CHARACTER SET utf8 +comment='Time zone transitions'; + -INSERT INTO time_zone_transition (Time_zone_id, Transition_time, Transition_type_id) VALUES (1, -1693706400, 0) ,(1, -1680483600, 1),(1, -1663455600, 2) ,(1, -1650150000, 3),(1, -1632006000, 2) ,(1, -1618700400, 3),(1, -938905200, 2) ,(1, -857257200, 3),(1, -844556400, 2) ,(1, -828226800, 3),(1, -812502000, 2) ,(1, -796777200, 3),(1, 228877200, 2) ,(1, 243997200, 3),(1, 260326800, 2) ,(1, 276051600, 3),(1, 291776400, 2) ,(1, 307501200, 3),(1, 323830800, 2) ,(1, 338950800, 3),(1, 354675600, 2) ,(1, 370400400, 3),(1, 386125200, 2) ,(1, 401850000, 3),(1, 417574800, 2) ,(1, 433299600, 3),(1, 449024400, 2) ,(1, 465354000, 3),(1, 481078800, 2) ,(1, 496803600, 3),(1, 512528400, 2) ,(1, 528253200, 3),(1, 543978000, 2) ,(1, 559702800, 3),(1, 575427600, 2) ,(1, 591152400, 3),(1, 606877200, 2) ,(1, 622602000, 3),(1, 638326800, 2) ,(1, 654656400, 3),(1, 670381200, 2) ,(1, 686106000, 3),(1, 701830800, 2) ,(1, 717555600, 3),(1, 733280400, 2) ,(1, 749005200, 3),(1, 764730000, 2) ,(1, 780454800, 3),(1, 796179600, 2) ,(1, 811904400, 3),(1, 828234000, 2) ,(1, 846378000, 3),(1, 859683600, 2) ,(1, 877827600, 3),(1, 891133200, 2) ,(1, 909277200, 3),(1, 922582800, 2) ,(1, 941331600, 3),(1, 954032400, 2) ,(1, 972781200, 3),(1, 985482000, 2) ,(1, 1004230800, 3),(1, 1017536400, 2) ,(1, 1035680400, 3),(1, 1048986000, 2) ,(1, 1067130000, 3),(1, 1080435600, 2) ,(1, 1099184400, 3),(1, 1111885200, 2) ,(1, 1130634000, 3),(1, 1143334800, 2) ,(1, 1162083600, 3),(1, 1174784400, 2) ,(1, 1193533200, 3),(1, 1206838800, 2) ,(1, 1224982800, 3),(1, 1238288400, 2) ,(1, 1256432400, 3),(1, 1269738000, 2) ,(1, 1288486800, 3),(1, 1301187600, 2) ,(1, 1319936400, 3),(1, 1332637200, 2) ,(1, 1351386000, 3),(1, 1364691600, 2) ,(1, 1382835600, 3),(1, 1396141200, 2) ,(1, 1414285200, 3),(1, 1427590800, 2) ,(1, 1445734800, 3),(1, 1459040400, 2) ,(1, 1477789200, 3),(1, 1490490000, 2) ,(1, 1509238800, 3),(1, 1521939600, 2) ,(1, 1540688400, 3),(1, 1553994000, 2) ,(1, 1572138000, 3),(1, 1585443600, 2) ,(1, 1603587600, 3),(1, 1616893200, 2) ,(1, 1635642000, 3),(1, 1648342800, 2) ,(1, 1667091600, 3),(1, 1679792400, 2) ,(1, 1698541200, 3),(1, 1711846800, 2) ,(1, 1729990800, 3),(1, 1743296400, 2) ,(1, 1761440400, 3),(1, 1774746000, 2) ,(1, 1792890000, 3),(1, 1806195600, 2) ,(1, 1824944400, 3),(1, 1837645200, 2) ,(1, 1856394000, 3),(1, 1869094800, 2) ,(1, 1887843600, 3),(1, 1901149200, 2) ,(1, 1919293200, 3),(1, 1932598800, 2) ,(1, 1950742800, 3),(1, 1964048400, 2) ,(1, 1982797200, 3),(1, 1995498000, 2) ,(1, 2014246800, 3),(1, 2026947600, 2) ,(1, 2045696400, 3),(1, 2058397200, 2) ,(1, 2077146000, 3),(1, 2090451600, 2) ,(1, 2108595600, 3),(1, 2121901200, 2) ,(1, 2140045200, 3),(3, -1688265000, 2) ,(3, -1656819048, 1),(3, -1641353448, 2) ,(3, -1627965048, 3),(3, -1618716648, 1) ,(3, -1596429048, 3),(3, -1593829848, 5) ,(3, -1589860800, 4),(3, -1542427200, 5) ,(3, -1539493200, 6),(3, -1525323600, 5) ,(3, -1522728000, 4),(3, -1491188400, 7) ,(3, -1247536800, 4),(3, 354920400, 5) ,(3, 370728000, 4),(3, 386456400, 5) ,(3, 402264000, 4),(3, 417992400, 5) ,(3, 433800000, 4),(3, 449614800, 5) ,(3, 465346800, 8),(3, 481071600, 9) ,(3, 496796400, 8),(3, 512521200, 9) ,(3, 528246000, 8),(3, 543970800, 9) ,(3, 559695600, 8),(3, 575420400, 9) ,(3, 591145200, 8),(3, 606870000, 9) ,(3, 622594800, 8),(3, 638319600, 9) ,(3, 654649200, 8),(3, 670374000, 10) ,(3, 686102400, 11),(3, 695779200, 8) ,(3, 701812800, 5),(3, 717534000, 4) ,(3, 733273200, 9),(3, 748998000, 8) ,(3, 764722800, 9),(3, 780447600, 8) ,(3, 796172400, 9),(3, 811897200, 8) ,(3, 828226800, 9),(3, 846370800, 8) ,(3, 859676400, 9),(3, 877820400, 8) ,(3, 891126000, 9),(3, 909270000, 8) ,(3, 922575600, 9),(3, 941324400, 8) ,(3, 954025200, 9),(3, 972774000, 8) ,(3, 985474800, 9),(3, 1004223600, 8) ,(3, 1017529200, 9),(3, 1035673200, 8) ,(3, 1048978800, 9),(3, 1067122800, 8) ,(3, 1080428400, 9),(3, 1099177200, 8) ,(3, 1111878000, 9),(3, 1130626800, 8) ,(3, 1143327600, 9),(3, 1162076400, 8) ,(3, 1174777200, 9),(3, 1193526000, 8) ,(3, 1206831600, 9),(3, 1224975600, 8) ,(3, 1238281200, 9),(3, 1256425200, 8) ,(3, 1269730800, 9),(3, 1288479600, 8) ,(3, 1301180400, 9),(3, 1319929200, 8) ,(3, 1332630000, 9),(3, 1351378800, 8) ,(3, 1364684400, 9),(3, 1382828400, 8) ,(3, 1396134000, 9),(3, 1414278000, 8) ,(3, 1427583600, 9),(3, 1445727600, 8) ,(3, 1459033200, 9),(3, 1477782000, 8) ,(3, 1490482800, 9),(3, 1509231600, 8) ,(3, 1521932400, 9),(3, 1540681200, 8) ,(3, 1553986800, 9),(3, 1572130800, 8) ,(3, 1585436400, 9),(3, 1603580400, 8) ,(3, 1616886000, 9),(3, 1635634800, 8) ,(3, 1648335600, 9),(3, 1667084400, 8) ,(3, 1679785200, 9),(3, 1698534000, 8) ,(3, 1711839600, 9),(3, 1729983600, 8) ,(3, 1743289200, 9),(3, 1761433200, 8) ,(3, 1774738800, 9),(3, 1792882800, 8) ,(3, 1806188400, 9),(3, 1824937200, 8) ,(3, 1837638000, 9),(3, 1856386800, 8) ,(3, 1869087600, 9),(3, 1887836400, 8) ,(3, 1901142000, 9),(3, 1919286000, 8) ,(3, 1932591600, 9),(3, 1950735600, 8) ,(3, 1964041200, 9),(3, 1982790000, 8) ,(3, 1995490800, 9),(3, 2014239600, 8) ,(3, 2026940400, 9),(3, 2045689200, 8) ,(3, 2058390000, 9),(3, 2077138800, 8) ,(3, 2090444400, 9),(3, 2108588400, 8) ,(3, 2121894000, 9),(3, 2140038000, 8),(4, -1688265000, 2) ,(4, -1656819048, 1),(4, -1641353448, 2) ,(4, -1627965048, 3),(4, -1618716648, 1) ,(4, -1596429048, 3),(4, -1593829848, 5) ,(4, -1589860800, 4),(4, -1542427200, 5) ,(4, -1539493200, 6),(4, -1525323600, 5) ,(4, -1522728000, 4),(4, -1491188400, 7) ,(4, -1247536800, 4),(4, 354920409, 5) ,(4, 370728010, 4),(4, 386456410, 5) ,(4, 402264011, 4),(4, 417992411, 5) ,(4, 433800012, 4),(4, 449614812, 5) ,(4, 465346812, 8),(4, 481071612, 9) ,(4, 496796413, 8),(4, 512521213, 9) ,(4, 528246013, 8),(4, 543970813, 9) ,(4, 559695613, 8),(4, 575420414, 9) ,(4, 591145214, 8),(4, 606870014, 9) ,(4, 622594814, 8),(4, 638319615, 9) ,(4, 654649215, 8),(4, 670374016, 10) ,(4, 686102416, 11),(4, 695779216, 8) ,(4, 701812816, 5),(4, 717534017, 4) ,(4, 733273217, 9),(4, 748998018, 8) ,(4, 764722818, 9),(4, 780447619, 8) ,(4, 796172419, 9),(4, 811897219, 8) ,(4, 828226820, 9),(4, 846370820, 8) ,(4, 859676420, 9),(4, 877820421, 8) ,(4, 891126021, 9),(4, 909270021, 8) ,(4, 922575622, 9),(4, 941324422, 8) ,(4, 954025222, 9),(4, 972774022, 8) ,(4, 985474822, 9),(4, 1004223622, 8) ,(4, 1017529222, 9),(4, 1035673222, 8) ,(4, 1048978822, 9),(4, 1067122822, 8) ,(4, 1080428422, 9),(4, 1099177222, 8) ,(4, 1111878022, 9),(4, 1130626822, 8) ,(4, 1143327622, 9),(4, 1162076422, 8) ,(4, 1174777222, 9),(4, 1193526022, 8) ,(4, 1206831622, 9),(4, 1224975622, 8) ,(4, 1238281222, 9),(4, 1256425222, 8) ,(4, 1269730822, 9),(4, 1288479622, 8) ,(4, 1301180422, 9),(4, 1319929222, 8) ,(4, 1332630022, 9),(4, 1351378822, 8) ,(4, 1364684422, 9),(4, 1382828422, 8) ,(4, 1396134022, 9),(4, 1414278022, 8) ,(4, 1427583622, 9),(4, 1445727622, 8) ,(4, 1459033222, 9),(4, 1477782022, 8) ,(4, 1490482822, 9),(4, 1509231622, 8) ,(4, 1521932422, 9),(4, 1540681222, 8) ,(4, 1553986822, 9),(4, 1572130822, 8) ,(4, 1585436422, 9),(4, 1603580422, 8) ,(4, 1616886022, 9),(4, 1635634822, 8) ,(4, 1648335622, 9),(4, 1667084422, 8) ,(4, 1679785222, 9),(4, 1698534022, 8) ,(4, 1711839622, 9),(4, 1729983622, 8) ,(4, 1743289222, 9),(4, 1761433222, 8) ,(4, 1774738822, 9),(4, 1792882822, 8) ,(4, 1806188422, 9),(4, 1824937222, 8) ,(4, 1837638022, 9),(4, 1856386822, 8) ,(4, 1869087622, 9),(4, 1887836422, 8) ,(4, 1901142022, 9),(4, 1919286022, 8) ,(4, 1932591622, 9),(4, 1950735622, 8) ,(4, 1964041222, 9),(4, 1982790022, 8) ,(4, 1995490822, 9),(4, 2014239622, 8) ,(4, 2026940422, 9),(4, 2045689222, 8) ,(4, 2058390022, 9),(4, 2077138822, 8) ,(4, 2090444422, 9),(4, 2108588422, 8) ,(4, 2121894022, 9),(4, 2140038022, 8),(5, -1009875600, 1); +INSERT INTO time_zone_transition + (Time_zone_id, Transition_time, Transition_type_id) +VALUES + (1, -1693706400, 0) ,(1, -1680483600, 1) + ,(1, -1663455600, 2) ,(1, -1650150000, 3) + ,(1, -1632006000, 2) ,(1, -1618700400, 3) + ,(1, -938905200, 2) ,(1, -857257200, 3) + ,(1, -844556400, 2) ,(1, -828226800, 3) + ,(1, -812502000, 2) ,(1, -796777200, 3) + ,(1, 228877200, 2) ,(1, 243997200, 3) + ,(1, 260326800, 2) ,(1, 276051600, 3) + ,(1, 291776400, 2) ,(1, 307501200, 3) + ,(1, 323830800, 2) ,(1, 338950800, 3) + ,(1, 354675600, 2) ,(1, 370400400, 3) + ,(1, 386125200, 2) ,(1, 401850000, 3) + ,(1, 417574800, 2) ,(1, 433299600, 3) + ,(1, 449024400, 2) ,(1, 465354000, 3) + ,(1, 481078800, 2) ,(1, 496803600, 3) + ,(1, 512528400, 2) ,(1, 528253200, 3) + ,(1, 543978000, 2) ,(1, 559702800, 3) + ,(1, 575427600, 2) ,(1, 591152400, 3) + ,(1, 606877200, 2) ,(1, 622602000, 3) + ,(1, 638326800, 2) ,(1, 654656400, 3) + ,(1, 670381200, 2) ,(1, 686106000, 3) + ,(1, 701830800, 2) ,(1, 717555600, 3) + ,(1, 733280400, 2) ,(1, 749005200, 3) + ,(1, 764730000, 2) ,(1, 780454800, 3) + ,(1, 796179600, 2) ,(1, 811904400, 3) + ,(1, 828234000, 2) ,(1, 846378000, 3) + ,(1, 859683600, 2) ,(1, 877827600, 3) + ,(1, 891133200, 2) ,(1, 909277200, 3) + ,(1, 922582800, 2) ,(1, 941331600, 3) + ,(1, 954032400, 2) ,(1, 972781200, 3) + ,(1, 985482000, 2) ,(1, 1004230800, 3) + ,(1, 1017536400, 2) ,(1, 1035680400, 3) + ,(1, 1048986000, 2) ,(1, 1067130000, 3) + ,(1, 1080435600, 2) ,(1, 1099184400, 3) + ,(1, 1111885200, 2) ,(1, 1130634000, 3) + ,(1, 1143334800, 2) ,(1, 1162083600, 3) + ,(1, 1174784400, 2) ,(1, 1193533200, 3) + ,(1, 1206838800, 2) ,(1, 1224982800, 3) + ,(1, 1238288400, 2) ,(1, 1256432400, 3) + ,(1, 1269738000, 2) ,(1, 1288486800, 3) + ,(1, 1301187600, 2) ,(1, 1319936400, 3) + ,(1, 1332637200, 2) ,(1, 1351386000, 3) + ,(1, 1364691600, 2) ,(1, 1382835600, 3) + ,(1, 1396141200, 2) ,(1, 1414285200, 3) + ,(1, 1427590800, 2) ,(1, 1445734800, 3) + ,(1, 1459040400, 2) ,(1, 1477789200, 3) + ,(1, 1490490000, 2) ,(1, 1509238800, 3) + ,(1, 1521939600, 2) ,(1, 1540688400, 3) + ,(1, 1553994000, 2) ,(1, 1572138000, 3) + ,(1, 1585443600, 2) ,(1, 1603587600, 3) + ,(1, 1616893200, 2) ,(1, 1635642000, 3) + ,(1, 1648342800, 2) ,(1, 1667091600, 3) + ,(1, 1679792400, 2) ,(1, 1698541200, 3) + ,(1, 1711846800, 2) ,(1, 1729990800, 3) + ,(1, 1743296400, 2) ,(1, 1761440400, 3) + ,(1, 1774746000, 2) ,(1, 1792890000, 3) + ,(1, 1806195600, 2) ,(1, 1824944400, 3) + ,(1, 1837645200, 2) ,(1, 1856394000, 3) + ,(1, 1869094800, 2) ,(1, 1887843600, 3) + ,(1, 1901149200, 2) ,(1, 1919293200, 3) + ,(1, 1932598800, 2) ,(1, 1950742800, 3) + ,(1, 1964048400, 2) ,(1, 1982797200, 3) + ,(1, 1995498000, 2) ,(1, 2014246800, 3) + ,(1, 2026947600, 2) ,(1, 2045696400, 3) + ,(1, 2058397200, 2) ,(1, 2077146000, 3) + ,(1, 2090451600, 2) ,(1, 2108595600, 3) + ,(1, 2121901200, 2) ,(1, 2140045200, 3) + ,(3, -1688265000, 2) ,(3, -1656819048, 1) + ,(3, -1641353448, 2) ,(3, -1627965048, 3) + ,(3, -1618716648, 1) ,(3, -1596429048, 3) + ,(3, -1593829848, 5) ,(3, -1589860800, 4) + ,(3, -1542427200, 5) ,(3, -1539493200, 6) + ,(3, -1525323600, 5) ,(3, -1522728000, 4) + ,(3, -1491188400, 7) ,(3, -1247536800, 4) + ,(3, 354920400, 5) ,(3, 370728000, 4) + ,(3, 386456400, 5) ,(3, 402264000, 4) + ,(3, 417992400, 5) ,(3, 433800000, 4) + ,(3, 449614800, 5) ,(3, 465346800, 8) + ,(3, 481071600, 9) ,(3, 496796400, 8) + ,(3, 512521200, 9) ,(3, 528246000, 8) + ,(3, 543970800, 9) ,(3, 559695600, 8) + ,(3, 575420400, 9) ,(3, 591145200, 8) + ,(3, 606870000, 9) ,(3, 622594800, 8) + ,(3, 638319600, 9) ,(3, 654649200, 8) + ,(3, 670374000, 10) ,(3, 686102400, 11) + ,(3, 695779200, 8) ,(3, 701812800, 5) + ,(3, 717534000, 4) ,(3, 733273200, 9) + ,(3, 748998000, 8) ,(3, 764722800, 9) + ,(3, 780447600, 8) ,(3, 796172400, 9) + ,(3, 811897200, 8) ,(3, 828226800, 9) + ,(3, 846370800, 8) ,(3, 859676400, 9) + ,(3, 877820400, 8) ,(3, 891126000, 9) + ,(3, 909270000, 8) ,(3, 922575600, 9) + ,(3, 941324400, 8) ,(3, 954025200, 9) + ,(3, 972774000, 8) ,(3, 985474800, 9) + ,(3, 1004223600, 8) ,(3, 1017529200, 9) + ,(3, 1035673200, 8) ,(3, 1048978800, 9) + ,(3, 1067122800, 8) ,(3, 1080428400, 9) + ,(3, 1099177200, 8) ,(3, 1111878000, 9) + ,(3, 1130626800, 8) ,(3, 1143327600, 9) + ,(3, 1162076400, 8) ,(3, 1174777200, 9) + ,(3, 1193526000, 8) ,(3, 1206831600, 9) + ,(3, 1224975600, 8) ,(3, 1238281200, 9) + ,(3, 1256425200, 8) ,(3, 1269730800, 9) + ,(3, 1288479600, 8) ,(3, 1301180400, 9) + ,(3, 1319929200, 8) ,(3, 1332630000, 9) + ,(3, 1351378800, 8) ,(3, 1364684400, 9) + ,(3, 1382828400, 8) ,(3, 1396134000, 9) + ,(3, 1414278000, 8) ,(3, 1427583600, 9) + ,(3, 1445727600, 8) ,(3, 1459033200, 9) + ,(3, 1477782000, 8) ,(3, 1490482800, 9) + ,(3, 1509231600, 8) ,(3, 1521932400, 9) + ,(3, 1540681200, 8) ,(3, 1553986800, 9) + ,(3, 1572130800, 8) ,(3, 1585436400, 9) + ,(3, 1603580400, 8) ,(3, 1616886000, 9) + ,(3, 1635634800, 8) ,(3, 1648335600, 9) + ,(3, 1667084400, 8) ,(3, 1679785200, 9) + ,(3, 1698534000, 8) ,(3, 1711839600, 9) + ,(3, 1729983600, 8) ,(3, 1743289200, 9) + ,(3, 1761433200, 8) ,(3, 1774738800, 9) + ,(3, 1792882800, 8) ,(3, 1806188400, 9) + ,(3, 1824937200, 8) ,(3, 1837638000, 9) + ,(3, 1856386800, 8) ,(3, 1869087600, 9) + ,(3, 1887836400, 8) ,(3, 1901142000, 9) + ,(3, 1919286000, 8) ,(3, 1932591600, 9) + ,(3, 1950735600, 8) ,(3, 1964041200, 9) + ,(3, 1982790000, 8) ,(3, 1995490800, 9) + ,(3, 2014239600, 8) ,(3, 2026940400, 9) + ,(3, 2045689200, 8) ,(3, 2058390000, 9) + ,(3, 2077138800, 8) ,(3, 2090444400, 9) + ,(3, 2108588400, 8) ,(3, 2121894000, 9) + ,(3, 2140038000, 8) + ,(4, -1688265000, 2) ,(4, -1656819048, 1) + ,(4, -1641353448, 2) ,(4, -1627965048, 3) + ,(4, -1618716648, 1) ,(4, -1596429048, 3) + ,(4, -1593829848, 5) ,(4, -1589860800, 4) + ,(4, -1542427200, 5) ,(4, -1539493200, 6) + ,(4, -1525323600, 5) ,(4, -1522728000, 4) + ,(4, -1491188400, 7) ,(4, -1247536800, 4) + ,(4, 354920409, 5) ,(4, 370728010, 4) + ,(4, 386456410, 5) ,(4, 402264011, 4) + ,(4, 417992411, 5) ,(4, 433800012, 4) + ,(4, 449614812, 5) ,(4, 465346812, 8) + ,(4, 481071612, 9) ,(4, 496796413, 8) + ,(4, 512521213, 9) ,(4, 528246013, 8) + ,(4, 543970813, 9) ,(4, 559695613, 8) + ,(4, 575420414, 9) ,(4, 591145214, 8) + ,(4, 606870014, 9) ,(4, 622594814, 8) + ,(4, 638319615, 9) ,(4, 654649215, 8) + ,(4, 670374016, 10) ,(4, 686102416, 11) + ,(4, 695779216, 8) ,(4, 701812816, 5) + ,(4, 717534017, 4) ,(4, 733273217, 9) + ,(4, 748998018, 8) ,(4, 764722818, 9) + ,(4, 780447619, 8) ,(4, 796172419, 9) + ,(4, 811897219, 8) ,(4, 828226820, 9) + ,(4, 846370820, 8) ,(4, 859676420, 9) + ,(4, 877820421, 8) ,(4, 891126021, 9) + ,(4, 909270021, 8) ,(4, 922575622, 9) + ,(4, 941324422, 8) ,(4, 954025222, 9) + ,(4, 972774022, 8) ,(4, 985474822, 9) + ,(4, 1004223622, 8) ,(4, 1017529222, 9) + ,(4, 1035673222, 8) ,(4, 1048978822, 9) + ,(4, 1067122822, 8) ,(4, 1080428422, 9) + ,(4, 1099177222, 8) ,(4, 1111878022, 9) + ,(4, 1130626822, 8) ,(4, 1143327622, 9) + ,(4, 1162076422, 8) ,(4, 1174777222, 9) + ,(4, 1193526022, 8) ,(4, 1206831622, 9) + ,(4, 1224975622, 8) ,(4, 1238281222, 9) + ,(4, 1256425222, 8) ,(4, 1269730822, 9) + ,(4, 1288479622, 8) ,(4, 1301180422, 9) + ,(4, 1319929222, 8) ,(4, 1332630022, 9) + ,(4, 1351378822, 8) ,(4, 1364684422, 9) + ,(4, 1382828422, 8) ,(4, 1396134022, 9) + ,(4, 1414278022, 8) ,(4, 1427583622, 9) + ,(4, 1445727622, 8) ,(4, 1459033222, 9) + ,(4, 1477782022, 8) ,(4, 1490482822, 9) + ,(4, 1509231622, 8) ,(4, 1521932422, 9) + ,(4, 1540681222, 8) ,(4, 1553986822, 9) + ,(4, 1572130822, 8) ,(4, 1585436422, 9) + ,(4, 1603580422, 8) ,(4, 1616886022, 9) + ,(4, 1635634822, 8) ,(4, 1648335622, 9) + ,(4, 1667084422, 8) ,(4, 1679785222, 9) + ,(4, 1698534022, 8) ,(4, 1711839622, 9) + ,(4, 1729983622, 8) ,(4, 1743289222, 9) + ,(4, 1761433222, 8) ,(4, 1774738822, 9) + ,(4, 1792882822, 8) ,(4, 1806188422, 9) + ,(4, 1824937222, 8) ,(4, 1837638022, 9) + ,(4, 1856386822, 8) ,(4, 1869087622, 9) + ,(4, 1887836422, 8) ,(4, 1901142022, 9) + ,(4, 1919286022, 8) ,(4, 1932591622, 9) + ,(4, 1950735622, 8) ,(4, 1964041222, 9) + ,(4, 1982790022, 8) ,(4, 1995490822, 9) + ,(4, 2014239622, 8) ,(4, 2026940422, 9) + ,(4, 2045689222, 8) ,(4, 2058390022, 9) + ,(4, 2077138822, 8) ,(4, 2090444422, 9) + ,(4, 2108588422, 8) ,(4, 2121894022, 9) + ,(4, 2140038022, 8) + ,(5, -1009875600, 1); -CREATE TABLE time_zone_transition_type (Time_zone_id int unsigned NOT NULL,Transition_type_id int unsigned NOT NULL,Offset int signed DEFAULT 0 NOT NULL,Is_DST tinyint unsigned DEFAULT 0 NOT NULL,Abbreviation char(8) DEFAULT '' NOT NULL,PRIMARY KEY TzIdTrTId (Time_zone_id, Transition_type_id)) engine=MyISAM CHARACTER SET utf8 comment='Time zone transition types'; +CREATE TABLE time_zone_transition_type ( + Time_zone_id int unsigned NOT NULL, + Transition_type_id int unsigned NOT NULL, + Offset int signed DEFAULT 0 NOT NULL, + Is_DST tinyint unsigned DEFAULT 0 NOT NULL, + Abbreviation char(8) DEFAULT '' NOT NULL, + PRIMARY KEY TzIdTrTId (Time_zone_id, Transition_type_id) +) engine=MyISAM +CHARACTER SET utf8 +comment='Time zone transition types'; + -INSERT INTO time_zone_transition_type (Time_zone_id,Transition_type_id, Offset, Is_DST, Abbreviation) VALUES (1, 0, 7200, 1, 'MEST') ,(1, 1, 3600, 0, 'MET') ,(1, 2, 7200, 1, 'MEST') ,(1, 3, 3600, 0, 'MET') ,(2, 0, 0, 0, 'UTC') ,(3, 0, 9000, 0, 'MMT') ,(3, 1, 12648, 1, 'MST') ,(3, 2, 9048, 0, 'MMT') ,(3, 3, 16248, 1, 'MDST') ,(3, 4, 10800, 0, 'MSK') ,(3, 5, 14400, 1, 'MSD') ,(3, 6, 18000, 1, 'MSD') ,(3, 7, 7200, 0, 'EET') ,(3, 8, 10800, 0, 'MSK') ,(3, 9, 14400, 1, 'MSD') ,(3, 10, 10800, 1, 'EEST') ,(3, 11, 7200, 0, 'EET') ,(4, 0, 9000, 0, 'MMT') ,(4, 1, 12648, 1, 'MST') ,(4, 2, 9048, 0, 'MMT') ,(4, 3, 16248, 1, 'MDST') ,(4, 4, 10800, 0, 'MSK') ,(4, 5, 14400, 1, 'MSD') ,(4, 6, 18000, 1, 'MSD') ,(4, 7, 7200, 0, 'EET') ,(4, 8, 10800, 0, 'MSK') ,(4, 9, 14400, 1, 'MSD') ,(4, 10, 10800, 1, 'EEST') ,(4, 11, 7200, 0, 'EET') ,(5, 0, 32400, 0, 'CJT') ,(5, 1, 32400, 0, 'JST'); +INSERT INTO time_zone_transition_type ( + Time_zone_id,Transition_type_id, Offset, Is_DST, Abbreviation) VALUES + (1, 0, 7200, 1, 'MEST') ,(1, 1, 3600, 0, 'MET') + ,(1, 2, 7200, 1, 'MEST') ,(1, 3, 3600, 0, 'MET') + ,(2, 0, 0, 0, 'UTC') + ,(3, 0, 9000, 0, 'MMT') ,(3, 1, 12648, 1, 'MST') + ,(3, 2, 9048, 0, 'MMT') ,(3, 3, 16248, 1, 'MDST') + ,(3, 4, 10800, 0, 'MSK') ,(3, 5, 14400, 1, 'MSD') + ,(3, 6, 18000, 1, 'MSD') ,(3, 7, 7200, 0, 'EET') + ,(3, 8, 10800, 0, 'MSK') ,(3, 9, 14400, 1, 'MSD') + ,(3, 10, 10800, 1, 'EEST') ,(3, 11, 7200, 0, 'EET') + ,(4, 0, 9000, 0, 'MMT') ,(4, 1, 12648, 1, 'MST') + ,(4, 2, 9048, 0, 'MMT') ,(4, 3, 16248, 1, 'MDST') + ,(4, 4, 10800, 0, 'MSK') ,(4, 5, 14400, 1, 'MSD') + ,(4, 6, 18000, 1, 'MSD') ,(4, 7, 7200, 0, 'EET') + ,(4, 8, 10800, 0, 'MSK') ,(4, 9, 14400, 1, 'MSD') + ,(4, 10, 10800, 1, 'EEST') ,(4, 11, 7200, 0, 'EET') + ,(5, 0, 32400, 0, 'CJT') ,(5, 1, 32400, 0, 'JST'); + + +CREATE TABLE time_zone_leap_second ( + Transition_time bigint signed NOT NULL, + Correction int signed NOT NULL, + PRIMARY KEY TranTime (Transition_time) +) engine=MyISAM +CHARACTER SET utf8 +comment='Leap seconds information for time zones'; -CREATE TABLE time_zone_leap_second (Transition_time bigint signed NOT NULL,Correction int signed NOT NULL,PRIMARY KEY TranTime (Transition_time)) engine=MyISAM CHARACTER SET utf8 comment='Leap seconds information for time zones'; -INSERT INTO time_zone_leap_second (Transition_time, Correction) VALUES (78796800, 1) ,(94694401, 2) ,(126230402, 3) ,(157766403, 4) ,(189302404, 5) ,(220924805, 6) ,(252460806, 7) ,(283996807, 8) ,(315532808, 9) ,(362793609, 10) ,(394329610, 11) ,(425865611, 12) ,(489024012, 13) ,(567993613, 14) ,(631152014, 15) ,(662688015, 16) ,(709948816, 17) ,(741484817, 18) ,(773020818, 19) ,(820454419, 20) ,(867715220, 21) ,(915148821, 22); - - +INSERT INTO time_zone_leap_second ( + Transition_time, Correction) VALUES + (78796800, 1) ,(94694401, 2) ,(126230402, 3) + ,(157766403, 4) ,(189302404, 5) ,(220924805, 6) + ,(252460806, 7) ,(283996807, 8) ,(315532808, 9) + ,(362793609, 10) ,(394329610, 11) ,(425865611, 12) + ,(489024012, 13) ,(567993613, 14) ,(631152014, 15) + ,(662688015, 16) ,(709948816, 17) ,(741484817, 18) + ,(773020818, 19) ,(820454419, 20) ,(867715220, 21) + ,(915148821, 22); diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 07216f0afe3..d70c207b035 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -1251,7 +1251,7 @@ sub install_db ($$) { } else { - print OUT $_; + print OUT "$_ "; } } close OUT; @@ -1520,8 +1520,8 @@ sub report_failure_and_restart ($) { # but stop before actually running mysqld or anything. sub do_before_start_master ($$) { - my $tname= shift; - my $master_init_script= shift; + my $tname= shift; + my $init_script= shift; # FIXME what about second master..... @@ -1542,18 +1542,18 @@ sub do_before_start_master ($$) { unlink("$glob_mysql_test_dir/var/master1-data/relay-log.info"); # Run master initialization shell script if one exists - if ( $master_init_script and - mtr_run($master_init_script, [], "", "", "", "") != 0 ) + if ( $init_script ) { - mtr_error("Can't run $master_init_script"); + # We ignore the return code + mtr_run("/bin/sh", ["-c",$init_script], "", "", "", ""); } # for gcov FIXME needed? If so we need more absolute paths # chdir($glob_basedir); } sub do_before_start_slave ($$) { - my $tname= shift; - my $slave_init_script= shift; + my $tname= shift; + my $init_script= shift; # Remove stale binary logs and old master.info files # except for too tests which need them @@ -1570,10 +1570,10 @@ sub do_before_start_slave ($$) { } # Run slave initialization shell script if one exists - if ( $slave_init_script and - mtr_run($slave_init_script, [], "", "", "", "") != 0 ) + if ( $init_script ) { - mtr_error("Can't run $slave_init_script"); + # We ignore the return code + mtr_run("/bin/sh", ["-c",$init_script], "", "", "", ""); } `rm -f $glob_mysql_test_dir/var/slave-data/log.*`; From 7f905da3d835307b8bc0ab8df864486e3c2e1c18 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 16 Feb 2005 21:17:20 -0800 Subject: [PATCH 1019/1063] select.result, select.test: Added a test case for bug #7098. sql_select.cc: Fixed bug #7098. When a string field was substituted for an equal constant the collation of the constant was changed by mistake for the binary collation. sql/sql_select.cc: Fixed bug #7098. When a string field was substituted for an equal constant the collation of the constant was changed by mistake for the binary collation. mysql-test/t/select.test: Added a test case for bug #7098. mysql-test/r/select.result: Added a test case for bug #7098. --- mysql-test/r/select.result | 22 ++++++++++++++++++++++ mysql-test/t/select.test | 19 +++++++++++++++++++ sql/sql_select.cc | 4 ++++ 3 files changed, 45 insertions(+) diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result index 70ac33964ad..1a3b2ab22e6 100644 --- a/mysql-test/r/select.result +++ b/mysql-test/r/select.result @@ -2400,3 +2400,25 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 5 1 SIMPLE t2 ref a a 23 test.t1.a 2 DROP TABLE t1, t2; +CREATE TABLE t1 ( city char(30) ); +INSERT INTO t1 VALUES ('London'); +INSERT INTO t1 VALUES ('Paris'); +SELECT * FROM t1 WHERE city='London'; +city +London +SELECT * FROM t1 WHERE city='london'; +city +London +EXPLAIN SELECT * FROM t1 WHERE city='London' AND city='london'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where +SELECT * FROM t1 WHERE city='London' AND city='london'; +city +London +EXPLAIN SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where +SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London'; +city +London +DROP TABLE t1; diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test index c00395d95e7..53f569c773e 100644 --- a/mysql-test/t/select.test +++ b/mysql-test/t/select.test @@ -1945,3 +1945,22 @@ EXPLAIN SELECT * FROM t1 LEFT JOIN t2 USE INDEX (a) ON t1.a=t2.a; EXPLAIN SELECT * FROM t1 LEFT JOIN t2 FORCE INDEX (a) ON t1.a=t2.a; DROP TABLE t1, t2; + + +# +# Test case for bug 7098: substitution of a constant for a string field +# + +CREATE TABLE t1 ( city char(30) ); +INSERT INTO t1 VALUES ('London'); +INSERT INTO t1 VALUES ('Paris'); + +SELECT * FROM t1 WHERE city='London'; +SELECT * FROM t1 WHERE city='london'; +EXPLAIN SELECT * FROM t1 WHERE city='London' AND city='london'; +SELECT * FROM t1 WHERE city='London' AND city='london'; +EXPLAIN SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London'; +SELECT * FROM t1 WHERE city LIKE '%london%' AND city='London'; + +DROP TABLE t1; + diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 05314097ca3..21e197d432b 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -4230,6 +4230,8 @@ change_cond_ref_to_const(THD *thd, I_List *save_list, Item *tmp=value->new_item(); if (tmp) { + tmp->collation.set(value->collation.collation, + value->collation.derivation); thd->change_item_tree(args + 1, tmp); func->update_used_tables(); if ((functype == Item_func::EQ_FUNC || functype == Item_func::EQUAL_FUNC) @@ -4251,6 +4253,8 @@ change_cond_ref_to_const(THD *thd, I_List *save_list, Item *tmp=value->new_item(); if (tmp) { + tmp->collation.set(value->collation.collation, + value->collation.derivation); thd->change_item_tree(args, tmp); value= tmp; func->update_used_tables(); From 41c0945096fe6f6074e7a994e6784432d60211f1 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 16 Feb 2005 22:51:32 -0800 Subject: [PATCH 1020/1063] item.h: Revised the fix for bug #7098. Corrected the method Item_string::new_item. sql_select.cc: Revised the fix for bug #7098. Aborted the previous modifications. sql/sql_select.cc: Revised the fix for bug #7098. Aborted the previous modifications. sql/item.h: Revised the fix for bug #7098. Corrected the method Item_string::new_item. --- sql/item.h | 2 +- sql/sql_select.cc | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/sql/item.h b/sql/item.h index db5010799fa..dd06d4ce61a 100644 --- a/sql/item.h +++ b/sql/item.h @@ -742,7 +742,7 @@ public: Item *new_item() { return new Item_string(name, str_value.ptr(), - str_value.length(), &my_charset_bin); + str_value.length(), collation.collation); } Item *safe_charset_converter(CHARSET_INFO *tocs); String *const_string() { return &str_value; } diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 21e197d432b..05314097ca3 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -4230,8 +4230,6 @@ change_cond_ref_to_const(THD *thd, I_List *save_list, Item *tmp=value->new_item(); if (tmp) { - tmp->collation.set(value->collation.collation, - value->collation.derivation); thd->change_item_tree(args + 1, tmp); func->update_used_tables(); if ((functype == Item_func::EQ_FUNC || functype == Item_func::EQUAL_FUNC) @@ -4253,8 +4251,6 @@ change_cond_ref_to_const(THD *thd, I_List *save_list, Item *tmp=value->new_item(); if (tmp) { - tmp->collation.set(value->collation.collation, - value->collation.derivation); thd->change_item_tree(args, tmp); value= tmp; func->update_used_tables(); From a20f2382876fdd0e36a24b666025aeaf166412d8 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 17 Feb 2005 02:57:40 -0600 Subject: [PATCH 1021/1063] Do-hpux-depot: Perl script to create HP depot packages. --- Build-tools/Do-hpux-depot | 85 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100755 Build-tools/Do-hpux-depot diff --git a/Build-tools/Do-hpux-depot b/Build-tools/Do-hpux-depot new file mode 100755 index 00000000000..f7e8e2c020d --- /dev/null +++ b/Build-tools/Do-hpux-depot @@ -0,0 +1,85 @@ +#!/usr/bin/perl + +# +# By Matt Wagner 2005 +# +# This script generates HP Depot packages for MySQL Server. +# It basically repackages a binary tarball as a depot. +# +# Usage: ./Do-hpux-depot +# + +$fullname = shift @ARGV; +$fullname or die "No package name was specified"; +-d $fullname or die "That directory is not present!"; + +$fullname =~ s,/+$,,; # Remove ending slash if any + +chomp($pwd= `pwd`); + +%title= ( + "mysql-standard" => "MySQL Community Edition - Standard (GPL)", + "mysql-debug" => "MySQL Community Edition - Debug (GPL)", + "mysql-max" => "MySQL Community Edition - Experimental (GPL)", + "mysql-pro" => "MySQL Pro (Commercial)", + "mysql-classic" => "MySQL Classic (Commercial)", + "mysql-cluster" => "MySQL Cluster (Commercial)", +); + +%architecture= ( + "hpux11.23" => "HP-UX_B.11.23", + "hpux11.11" => "HP-UX_B.11.11", + "hpux11.00" => "HP-UX_B.11.00", +); + +%os_release= ( + "hpux11.23" => "?.11.2?", + "hpux11.11" => "?.11.1?", + "hpux11.00" => "?.11.0?", +); + +%machine_type= ( + "ia64" => "ia64*", + "hppa2.0w" => "9000/*", +); + +$fullname =~ m/^(mysql-\w+)-([\d\.]+)-hp-(hpux11\.\d\d)-(hppa2\.0w|(ia64))-?(64bit)?$/; + +# print "title: $1\n"; +# print "version: $2\n"; +# print "os: $3\n"; +# print "cpu: $4\n"; +# print "64: $6\n"; + +$cpu64= ($6 ne "") ? "_64" : ""; + +open (PSF,">${fullname}.psf") or die "Unable to write PSF file ($!)\n"; + +print PSF < $fullname.depot.gz\" -x target_type=tape -s ${pwd}/${fullname}.psf"); + From 6889864bbb09c2461013057133691fe2df6a88dc Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 17 Feb 2005 11:07:33 +0100 Subject: [PATCH 1022/1063] - fixed a changelog entry in the RPM spec file (wrong author) support-files/mysql.spec.sh: - fixed a changelog entry (wrong author) --- support-files/mysql.spec.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index 1829daeab5b..07c8e6a46fb 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -695,7 +695,7 @@ fi # itself - note that they must be ordered by date (important when # merging BK trees) %changelog -* Mon Feb 14 2005 Tomas Ulin +* Mon Feb 14 2005 Lenz Grimmer * Fixed the compilation comments and moved them into the separate build sections for Max and Standard From 23f786b0ad106282387de0e0d82fec4f30037008 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 17 Feb 2005 15:04:04 +0400 Subject: [PATCH 1023/1063] bug#6958 Fixed that negative arguments to certain integer options wrap around. mysql-test/r/variables.result: Added a test case for bug#6958. mysql-test/t/variables.test: Added a test case for bug#6958. sql/set_var.cc: sys_var_long_ptr::check function was added. sql/set_var.h: Use sys_var_long_ptr::check function for sys_var_long_ptr class. --- mysql-test/r/variables.result | 5 +++++ mysql-test/t/variables.test | 8 ++++++++ sql/set_var.cc | 6 ++++++ sql/set_var.h | 1 + 4 files changed, 20 insertions(+) diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result index 6b700f7f6a2..633f7c139fd 100644 --- a/mysql-test/r/variables.result +++ b/mysql-test/r/variables.result @@ -482,3 +482,8 @@ SET GLOBAL MYISAM_DATA_POINTER_SIZE= 8; SHOW VARIABLES LIKE 'MYISAM_DATA_POINTER_SIZE'; Variable_name Value myisam_data_pointer_size 8 +SET GLOBAL table_cache=-1; +SHOW VARIABLES LIKE 'table_cache'; +Variable_name Value +table_cache 1 +SET GLOBAL table_cache=DEFAULT; diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test index 3a76ae5136e..f80ca6378a1 100644 --- a/mysql-test/t/variables.test +++ b/mysql-test/t/variables.test @@ -362,3 +362,11 @@ drop table t1; SET GLOBAL MYISAM_DATA_POINTER_SIZE= 8; SHOW VARIABLES LIKE 'MYISAM_DATA_POINTER_SIZE'; + +# +# Bug #6958: negative arguments to integer options wrap around +# + +SET GLOBAL table_cache=-1; +SHOW VARIABLES LIKE 'table_cache'; +SET GLOBAL table_cache=DEFAULT; diff --git a/sql/set_var.cc b/sql/set_var.cc index ca7987d2636..7f393363ed6 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -1223,6 +1223,12 @@ static void fix_server_id(THD *thd, enum_var_type type) server_id_supplied = 1; } +bool sys_var_long_ptr::check(THD *thd, set_var *var) +{ + longlong v= var->value->val_int(); + var->save_result.ulonglong_value= v < 0 ? 0 : v; + return 0; +} bool sys_var_long_ptr::update(THD *thd, set_var *var) { diff --git a/sql/set_var.h b/sql/set_var.h index df2fd41c7bd..080a2a95ae0 100644 --- a/sql/set_var.h +++ b/sql/set_var.h @@ -93,6 +93,7 @@ public: sys_var_long_ptr(const char *name_arg, ulong *value_ptr, sys_after_update_func func) :sys_var(name_arg,func), value(value_ptr) {} + bool check(THD *thd, set_var *var); bool update(THD *thd, set_var *var); void set_default(THD *thd, enum_var_type type); SHOW_TYPE type() { return SHOW_LONG; } From ae9166cd65ab10b21c92befa8cfe4a8e87bed0cb Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 17 Feb 2005 11:48:44 -0800 Subject: [PATCH 1024/1063] Log each slow query in a multi-statement query to the slow query log. (Bug #8475) sql/sql_parse.cc: Reset the start time before each statement before each statement in a multi-statement query, and check whether each statement should be logged to the slow query log independently. mysql-test/r/multi_statement.result: Add new results mysql-test/t/multi_statement.test: Add new regression test --- mysql-test/r/multi_statement.result | 17 +++++++++++++ mysql-test/t/multi_statement-master.opt | 2 ++ mysql-test/t/multi_statement.test | 15 +++++++++++ sql/sql_parse.cc | 33 ++++++++++++++++--------- 4 files changed, 56 insertions(+), 11 deletions(-) create mode 100644 mysql-test/t/multi_statement-master.opt diff --git a/mysql-test/r/multi_statement.result b/mysql-test/r/multi_statement.result index 4451b0a355e..3a8d86bf349 100644 --- a/mysql-test/r/multi_statement.result +++ b/mysql-test/r/multi_statement.result @@ -31,3 +31,20 @@ select 5'abcd' select 'finish'; finish finish +flush status; +create table t1 (i int); +insert into t1 values (1); +select * from t1 where i = 1; +insert into t1 values (2),(3),(4); +select * from t1 where i = 2; +select * from t1 where i = 3|||| +i +1 +i +2 +i +3 +show status like 'Slow_queries'|||| +Variable_name Value +Slow_queries 2 +drop table t1|||| diff --git a/mysql-test/t/multi_statement-master.opt b/mysql-test/t/multi_statement-master.opt new file mode 100644 index 00000000000..b30df037531 --- /dev/null +++ b/mysql-test/t/multi_statement-master.opt @@ -0,0 +1,2 @@ +--log-slow-queries=slow.log +--log-queries-not-using-indexes diff --git a/mysql-test/t/multi_statement.test b/mysql-test/t/multi_statement.test index 862f2294641..2abec332878 100644 --- a/mysql-test/t/multi_statement.test +++ b/mysql-test/t/multi_statement.test @@ -14,3 +14,18 @@ select "abcd'";'abcd'select "'abcd";'abcd' select 5'abcd' delimiter ;'abcd' select 'finish'; + +# Bug #8475: Make sure every statement that is a slow query in +# a multi-statement query gets logged as a slow query. +flush status; +delimiter ||||; +create table t1 (i int); +insert into t1 values (1); +select * from t1 where i = 1; +insert into t1 values (2),(3),(4); +select * from t1 where i = 2; +select * from t1 where i = 3|||| +show status like 'Slow_queries'|||| +drop table t1|||| + +delimiter ;|||| diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 1329a6cd732..54cc555e48c 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -58,6 +58,7 @@ static void remove_escape(char *name); static void refresh_status(void); static bool append_file_to_dir(THD *thd, const char **filename_ptr, const char *table_name); +static void log_slow_query(THD *thd); const char *any_db="*any*"; // Special symbol for check_access @@ -1491,6 +1492,8 @@ bool dispatch_command(enum enum_server_command command, THD *thd, #endif ulong length= (ulong)(packet_end-packet); + log_slow_query(thd); + /* Remove garbage at start of query */ while (my_isspace(thd->charset(), *packet) && length > 0) { @@ -1501,6 +1504,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd, thd->query_length= length; thd->query= packet; thd->query_id= query_id++; + thd->set_time(); /* Reset the query start time. */ /* TODO: set thd->lex->sql_command to SQLCOM_END here */ VOID(pthread_mutex_unlock(&LOCK_thread_count)); #ifndef EMBEDDED_LIBRARY @@ -1797,6 +1801,24 @@ bool dispatch_command(enum enum_server_command command, THD *thd, if (thd->is_fatal_error) send_error(thd,0); // End of memory ? + log_slow_query(thd); + + thd->proc_info="cleaning up"; + VOID(pthread_mutex_lock(&LOCK_thread_count)); // For process list + thd->proc_info=0; + thd->command=COM_SLEEP; + thd->query=0; + thd->query_length=0; + thread_running--; + VOID(pthread_mutex_unlock(&LOCK_thread_count)); + thd->packet.shrink(thd->variables.net_buffer_length); // Reclaim some memory + free_root(thd->mem_root,MYF(MY_KEEP_PREALLOC)); + DBUG_RETURN(error); +} + + +static void log_slow_query(THD *thd) +{ time_t start_of_query=thd->start_time; thd->end_time(); // Set start time @@ -1815,17 +1837,6 @@ bool dispatch_command(enum enum_server_command command, THD *thd, mysql_slow_log.write(thd, thd->query, thd->query_length, start_of_query); } } - thd->proc_info="cleaning up"; - VOID(pthread_mutex_lock(&LOCK_thread_count)); // For process list - thd->proc_info=0; - thd->command=COM_SLEEP; - thd->query=0; - thd->query_length=0; - thread_running--; - VOID(pthread_mutex_unlock(&LOCK_thread_count)); - thd->packet.shrink(thd->variables.net_buffer_length); // Reclaim some memory - free_root(thd->mem_root,MYF(MY_KEEP_PREALLOC)); - DBUG_RETURN(error); } From 29fb8728e45d22241a6d225d787cd5b19e2053cb Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 18 Feb 2005 12:58:16 +0400 Subject: [PATCH 1025/1063] A way not to compile UCA collations --- configure.in | 18 ++++++++++++++++++ mysys/charset-def.c | 8 ++++++++ mysys/charset.c | 2 +- strings/ctype-uca.c | 5 ++++- 4 files changed, 31 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index f3e93afb72e..d6acef071a6 100644 --- a/configure.in +++ b/configure.in @@ -2811,6 +2811,24 @@ AC_DEFINE_UNQUOTED([MYSQL_DEFAULT_CHARSET_NAME], ["$default_charset"], AC_DEFINE_UNQUOTED([MYSQL_DEFAULT_COLLATION_NAME], ["$default_collation"], [Define the default charset name]) + +# Shall we build the UCA-based Unicode collations +AC_ARG_WITH(uca, + [ --without-uca Skip building of the national Unicode collations.], + [with_uca=$withval], + [with_uca=yes] +) + +AC_MSG_CHECKING([whether to compile national Unicode collations]) + +if test "$with_uca" = "yes" +then + AC_MSG_RESULT(yes) + AC_DEFINE([HAVE_UCA_COLLATIONS], [1], [national Unicode collations]) +else + AC_MSG_RESULT(no) +fi + MYSQL_CHECK_ISAM MYSQL_CHECK_BDB MYSQL_CHECK_INNODB diff --git a/mysys/charset-def.c b/mysys/charset-def.c index 3dcd2a2d116..3278566788c 100644 --- a/mysys/charset-def.c +++ b/mysys/charset-def.c @@ -22,6 +22,8 @@ init_compiled_charsets() that only adds those that he wants */ +#ifdef HAVE_UCA_COLLATIONS + #ifdef HAVE_CHARSET_ucs2 extern CHARSET_INFO my_charset_ucs2_general_uca; extern CHARSET_INFO my_charset_ucs2_icelandic_uca_ci; @@ -62,6 +64,8 @@ extern CHARSET_INFO my_charset_utf8_roman_uca_ci; extern CHARSET_INFO my_charset_utf8_persian_uca_ci; #endif +#endif /* HAVE_UCA_COLLATIONS */ + my_bool init_compiled_charsets(myf flags __attribute__((unused))) { CHARSET_INFO *cs; @@ -113,6 +117,7 @@ my_bool init_compiled_charsets(myf flags __attribute__((unused))) #ifdef HAVE_CHARSET_ucs2 add_compiled_collation(&my_charset_ucs2_general_ci); add_compiled_collation(&my_charset_ucs2_bin); +#ifdef HAVE_UCA_COLLATIONS add_compiled_collation(&my_charset_ucs2_general_uca); add_compiled_collation(&my_charset_ucs2_icelandic_uca_ci); add_compiled_collation(&my_charset_ucs2_latvian_uca_ci); @@ -131,6 +136,7 @@ my_bool init_compiled_charsets(myf flags __attribute__((unused))) add_compiled_collation(&my_charset_ucs2_roman_uca_ci); add_compiled_collation(&my_charset_ucs2_persian_uca_ci); #endif +#endif #ifdef HAVE_CHARSET_ujis add_compiled_collation(&my_charset_ujis_japanese_ci); @@ -140,6 +146,7 @@ my_bool init_compiled_charsets(myf flags __attribute__((unused))) #ifdef HAVE_CHARSET_utf8 add_compiled_collation(&my_charset_utf8_general_ci); add_compiled_collation(&my_charset_utf8_bin); +#ifdef HAVE_UCA_COLLATIONS add_compiled_collation(&my_charset_utf8_general_uca_ci); add_compiled_collation(&my_charset_utf8_icelandic_uca_ci); add_compiled_collation(&my_charset_utf8_latvian_uca_ci); @@ -157,6 +164,7 @@ my_bool init_compiled_charsets(myf flags __attribute__((unused))) add_compiled_collation(&my_charset_utf8_spanish2_uca_ci); add_compiled_collation(&my_charset_utf8_roman_uca_ci); add_compiled_collation(&my_charset_utf8_persian_uca_ci); +#endif #endif /* Copy compiled charsets */ diff --git a/mysys/charset.c b/mysys/charset.c index 5587a6d685f..bb8f2d178b9 100644 --- a/mysys/charset.c +++ b/mysys/charset.c @@ -215,7 +215,7 @@ static int add_collation(CHARSET_INFO *cs) if (!strcmp(cs->csname,"ucs2") ) { -#ifdef HAVE_CHARSET_ucs2 +#if defined(HAVE_CHARSET_ucs2) && defined(HAVE_UCA_COLLATIONS) new->cset= my_charset_ucs2_general_uca.cset; new->coll= my_charset_ucs2_general_uca.coll; new->strxfrm_multiply= my_charset_ucs2_general_uca.strxfrm_multiply; diff --git a/strings/ctype-uca.c b/strings/ctype-uca.c index 452ca263433..7678ee05120 100644 --- a/strings/ctype-uca.c +++ b/strings/ctype-uca.c @@ -36,6 +36,7 @@ #include "m_string.h" #include "m_ctype.h" +#ifdef HAVE_UCA_COLLATIONS #define MY_UCA_NPAGES 256 #define MY_UCA_NCHARS 256 @@ -8990,4 +8991,6 @@ CHARSET_INFO my_charset_utf8_persian_uca_ci= &my_collation_any_uca_handler }; -#endif +#endif /* HAVE_CHARSET_utf8 */ + +#endif /* HAVE_UCA_COLLATIONS */ From d76b88b65c37e84260f26249cd5a162cb91e328a Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 18 Feb 2005 15:51:55 +0400 Subject: [PATCH 1026/1063] Fix for the bug #7344 (multiple server_init/server_end lead to crash) Some variable wasn't moved to the initial state during mysql_server_end myisam/ft_stopwords.c: resetting ft_stopword_file sql/mysqld.cc: free_charsets() call added --- myisam/ft_stopwords.c | 1 + sql/mysqld.cc | 1 + 2 files changed, 2 insertions(+) diff --git a/myisam/ft_stopwords.c b/myisam/ft_stopwords.c index 112af87d201..a4bce6ad4e8 100644 --- a/myisam/ft_stopwords.c +++ b/myisam/ft_stopwords.c @@ -125,4 +125,5 @@ void ft_free_stopwords() my_free((char*) stopwords3,MYF(0)); stopwords3=0; } + ft_stopword_file= 0; } diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 53dca59bc92..a4a2fd5e1ef 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -950,6 +950,7 @@ void clean_up(bool print_message) item_user_lock_free(); lex_free(); /* Free some memory */ set_var_free(); + free_charsets(); #ifdef HAVE_DLOPEN if (!opt_noacl) udf_free(); From cfa78c2645d3a0c3eaf02a256f63d2d284ed2b3b Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 18 Feb 2005 16:10:12 +0400 Subject: [PATCH 1027/1063] Bug #7878 with utf_general_ci, equals (=) has problem with accent insensitivity Backporting Monty's fix for 5.0 into 4.1. --- include/my_base.h | 1 + myisam/mi_rnext_same.c | 8 ++++++-- mysql-test/r/ctype_latin1_de.result | 12 ++++++++++++ mysql-test/t/ctype_latin1_de.test | 16 ++++++++++++++++ 4 files changed, 35 insertions(+), 2 deletions(-) diff --git a/include/my_base.h b/include/my_base.h index 7290d0da09b..d702ec45140 100644 --- a/include/my_base.h +++ b/include/my_base.h @@ -340,6 +340,7 @@ enum ha_base_keytype { #define HA_STATE_BUFF_SAVED 512 /* If current keybuff is info->buff */ #define HA_STATE_ROW_CHANGED 1024 /* To invalide ROW cache */ #define HA_STATE_EXTEND_BLOCK 2048 +#define HA_STATE_RNEXT_SAME 4096 /* rnext_same was called */ enum en_fieldtype { FIELD_LAST=-1,FIELD_NORMAL,FIELD_SKIP_ENDSPACE,FIELD_SKIP_PRESPACE, diff --git a/myisam/mi_rnext_same.c b/myisam/mi_rnext_same.c index a50c578e081..06408f57a3f 100644 --- a/myisam/mi_rnext_same.c +++ b/myisam/mi_rnext_same.c @@ -57,7 +57,11 @@ int mi_rnext_same(MI_INFO *info, byte *buf) #endif case HA_KEY_ALG_BTREE: default: - memcpy(info->lastkey2,info->lastkey,info->last_rkey_length); + if (!(info->update & HA_STATE_RNEXT_SAME)) + { + /* First rnext_same; Store old key */ + memcpy(info->lastkey2,info->lastkey,info->last_rkey_length); + } for (;;) { if ((error=_mi_search_next(info,keyinfo,info->lastkey, @@ -81,7 +85,7 @@ int mi_rnext_same(MI_INFO *info, byte *buf) rw_unlock(&info->s->key_root_lock[inx]); /* Don't clear if database-changed */ info->update&= (HA_STATE_CHANGED | HA_STATE_ROW_CHANGED); - info->update|= HA_STATE_NEXT_FOUND; + info->update|= HA_STATE_NEXT_FOUND | HA_STATE_RNEXT_SAME; if (error) { diff --git a/mysql-test/r/ctype_latin1_de.result b/mysql-test/r/ctype_latin1_de.result index 6df9d963498..f57d8c191bf 100644 --- a/mysql-test/r/ctype_latin1_de.result +++ b/mysql-test/r/ctype_latin1_de.result @@ -326,3 +326,15 @@ latin1_german2_ci 6109 latin1_german2_ci 61 latin1_german2_ci 6120 drop table t1; +SET NAMES latin1; +CREATE TABLE t1 ( +col1 varchar(255) NOT NULL default '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 collate latin1_german2_ci; +INSERT INTO t1 VALUES ('ß'),('ss'),('ss'); +ALTER TABLE t1 ADD KEY ifword(col1); +SELECT * FROM t1 WHERE col1='ß' ORDER BY col1, BINARY col1; +col1 +ss +ss +ß +DROP TABLE t1; diff --git a/mysql-test/t/ctype_latin1_de.test b/mysql-test/t/ctype_latin1_de.test index ce4fdc4e3c9..512ae88a445 100644 --- a/mysql-test/t/ctype_latin1_de.test +++ b/mysql-test/t/ctype_latin1_de.test @@ -116,3 +116,19 @@ SELECT FIELD('ue',s1), FIELD(' DROP TABLE t1; -- source include/ctype_filesort.inc + +# +# Bug#7878 with utf8_general_ci, equals (=) has problem with +# accent insensitivity. +# Although originally this problem was found with UTF8 character set, +# '=' behaved wrong for latin1_german2_ci as well. +# Let's check it does not work incorrect anymore. +# +SET NAMES latin1; +CREATE TABLE t1 ( + col1 varchar(255) NOT NULL default '' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 collate latin1_german2_ci; +INSERT INTO t1 VALUES ('ß'),('ss'),('ss'); +ALTER TABLE t1 ADD KEY ifword(col1); +SELECT * FROM t1 WHERE col1='ß' ORDER BY col1, BINARY col1; +DROP TABLE t1; From cfad792e747733b655963510ec4d7c985df544ca Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 18 Feb 2005 12:47:33 -0800 Subject: [PATCH 1028/1063] Clean up fix for Bug #7989 by avoiding extra memory copy, and adding some more information to the error message. sql/sql_acl.cc: Change strmov() call to strnmov(), and don't do redundant copy. Add to warning message that privilege can't be removed with REVOKE. --- sql/sql_acl.cc | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 92d6f471a1e..252a2af7134 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -202,18 +202,17 @@ my_bool acl_init(THD *org_thd, bool dont_read_acl_tables) { /* We make a temporary copy of the database, force it to lower case, - and then copy it back over the original name. We can't just update - the host.db pointer, because tmp_name is allocated on the stack. + and then check it against the original name. */ - (void)strmov(tmp_name, host.db); - my_casedn_str(files_charset_info, tmp_name); + (void)strnmov(tmp_name, host.db, sizeof(tmp_name)); + my_casedn_str(files_charset_info, host.db); if (strcmp(host.db, tmp_name) != 0) { sql_print_warning("'host' entry '%s|%s' had database in mixed " "case that has been forced to lowercase because " - "lower_case_table_names is set.", + "lower_case_table_names is set. It will not be " + "possible to remove this privilege using REVOKE.", host.host.hostname, host.db); - (void)strmov(host.db, tmp_name); } } host.access= get_access(table,2); @@ -403,18 +402,17 @@ my_bool acl_init(THD *org_thd, bool dont_read_acl_tables) { /* We make a temporary copy of the database, force it to lower case, - and then copy it back over the original name. We can't just update - the db.db pointer, because tmp_name is allocated on the stack. + and then check it against the original name. */ - (void)strmov(tmp_name, db.db); - my_casedn_str(files_charset_info, tmp_name); + (void)strnmov(tmp_name, db.db, sizeof(tmp_name)); + my_casedn_str(files_charset_info, db.db); if (strcmp(db.db, tmp_name) != 0) { sql_print_warning("'db' entry '%s %s@%s' had database in mixed " "case that has been forced to lowercase because " - "lower_case_table_names is set.", + "lower_case_table_names is set. It will not be " + "possible to remove this privilege using REVOKE.", db.db, db.user, db.host.hostname, db.host.hostname); - (void)strmov(db.db, tmp_name); } } db.sort=get_sort(3,db.host.hostname,db.db,db.user); From 97e6e780063e464b7ec1ec2b8204fb3ec3831a20 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 19 Feb 2005 19:51:47 +0200 Subject: [PATCH 1029/1063] fix for a bug with my_print_defaults with --defaults-extra-file= option --- extra/my_print_defaults.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/extra/my_print_defaults.c b/extra/my_print_defaults.c index 2ec6f8b406f..d5836cb0dc8 100644 --- a/extra/my_print_defaults.c +++ b/extra/my_print_defaults.c @@ -120,25 +120,33 @@ int main(int argc, char **argv) int count, error; char **load_default_groups, *tmp_arguments[2], **argument, **arguments; + char *defaults, *extra_defaults; MY_INIT(argv[0]); + get_defaults_files(argc, argv, &defaults, &extra_defaults); + /* ** Check out the args */ - if (get_options(&argc,&argv)) - exit(1); if (!(load_default_groups=(char**) my_malloc((argc+2)*sizeof(char*), MYF(MY_WME)))) exit(1); + if (get_options(&argc,&argv)) + exit(1); for (count=0; *argv ; argv++,count++) load_default_groups[count]= *argv; load_default_groups[count]=0; - count=1; + count=0; arguments=tmp_arguments; - arguments[0]=my_progname; - arguments[1]=0; + arguments[count++]=my_progname; + if (extra_defaults) + arguments[count++]= extra_defaults; + if (defaults) + arguments[count++]= defaults; + arguments[count]= 0; + if ((error= load_defaults(config_file, (const char **) load_default_groups, &count, &arguments))) { From afdfb1935f5f5257f027b620b98e34fd880c8eb2 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 21 Feb 2005 10:52:29 +0100 Subject: [PATCH 1030/1063] bug #8611, ndb includes in lib dir instead of include dir --- scripts/make_binary_distribution.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index 910aa38c33f..c3c16c8bf41 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -278,7 +278,7 @@ if [ x$NDBCLUSTER = x1 ]; then $CP $BASE/ndb-stage@bindir@/* $BASE/bin/. $CP $BASE/ndb-stage@libexecdir@/* $BASE/bin/. $CP $BASE/ndb-stage@pkglibdir@/* $BASE/lib/. - $CP -r $BASE/ndb-stage@pkgincludedir@/ndb $BASE/lib/. + $CP -r $BASE/ndb-stage@pkgincludedir@/ndb $BASE/include $CP -r $BASE/ndb-stage@prefix@/mysql-test/ndb $BASE/mysql-test/. || exit 1 rm -rf $BASE/ndb-stage fi From e8f888a52593988b642046c162edca6e45270f57 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 21 Feb 2005 15:43:25 +0400 Subject: [PATCH 1031/1063] mysql.cc: bug#7571: Server & Client characterset are shown under different decriptions Switch them into the correct order. client/mysql.cc: bug#7571: Server & Client characterset are shown under different decriptions Switch them into the correct order. --- client/mysql.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/mysql.cc b/client/mysql.cc index 635973e946c..4004757359b 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -2914,9 +2914,9 @@ com_status(String *buffer __attribute__((unused)), MYSQL_ROW cur=mysql_fetch_row(result); if (cur) { - tee_fprintf(stdout, "Server characterset:\t%s\n", cur[0] ? cur[0] : ""); + tee_fprintf(stdout, "Server characterset:\t%s\n", cur[0] ? cur[2] : ""); tee_fprintf(stdout, "Db characterset:\t%s\n", cur[3] ? cur[3] : ""); - tee_fprintf(stdout, "Client characterset:\t%s\n", cur[2] ? cur[2] : ""); + tee_fprintf(stdout, "Client characterset:\t%s\n", cur[2] ? cur[0] : ""); tee_fprintf(stdout, "Conn. characterset:\t%s\n", cur[1] ? cur[1] : ""); } mysql_free_result(result); From 65410bd0a15f42a0f0858524ba98ad92d88bcdc6 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 21 Feb 2005 17:17:30 +0400 Subject: [PATCH 1032/1063] ctype_utf8.result, ctype_utf8.test, ctype-utf8.c: Bugs: #8385: utf8_general_ci treats cyrillic letters I and SHORT I as the same strings/ctype-utf8.c: Bugs: #8385: utf8_general_ci treats cyrillic letters I and SHORT I as the same mysql-test/t/ctype_utf8.test: Bugs: #8385: utf8_general_ci treats cyrillic letters I and SHORT I as the same mysql-test/r/ctype_utf8.result: Bugs: #8385: utf8_general_ci treats cyrillic letters I and SHORT I as the same --- mysql-test/r/ctype_utf8.result | 3 +++ mysql-test/t/ctype_utf8.test | 5 +++++ strings/ctype-utf8.c | 4 ++-- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result index 415ed33ad40..13105e2276c 100644 --- a/mysql-test/r/ctype_utf8.result +++ b/mysql-test/r/ctype_utf8.result @@ -861,3 +861,6 @@ user c one two DROP TABLE t1; +select convert(_koi8r'É' using utf8) < convert(_koi8r'Ê' using utf8); +convert(_koi8r'É' using utf8) < convert(_koi8r'Ê' using utf8) +1 diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test index 8e3eb71c3e5..35f2b2642be 100644 --- a/mysql-test/t/ctype_utf8.test +++ b/mysql-test/t/ctype_utf8.test @@ -693,3 +693,8 @@ INSERT INTO t1 VALUES ('one'),('two'); SELECT CHARSET('a'); SELECT user, CONCAT('<', user, '>') AS c FROM t1; DROP TABLE t1; + +# +# Bug#8385: utf8_general_ci treats Cyrillic letters I and SHORT I as the same +# +select convert(_koi8r'É' using utf8) < convert(_koi8r'Ê' using utf8); diff --git a/strings/ctype-utf8.c b/strings/ctype-utf8.c index 486d428bf1d..69371aa38c2 100644 --- a/strings/ctype-utf8.c +++ b/strings/ctype-utf8.c @@ -578,7 +578,7 @@ static MY_UNICASE_INFO plane04[]={ {0x0412,0x0432,0x0412}, {0x0413,0x0433,0x0413}, {0x0414,0x0434,0x0414}, {0x0415,0x0435,0x0415}, {0x0416,0x0436,0x0416}, {0x0417,0x0437,0x0417}, - {0x0418,0x0438,0x0418}, {0x0419,0x0439,0x0418}, + {0x0418,0x0438,0x0418}, {0x0419,0x0439,0x0419}, {0x041A,0x043A,0x041A}, {0x041B,0x043B,0x041B}, {0x041C,0x043C,0x041C}, {0x041D,0x043D,0x041D}, {0x041E,0x043E,0x041E}, {0x041F,0x043F,0x041F}, @@ -594,7 +594,7 @@ static MY_UNICASE_INFO plane04[]={ {0x0412,0x0432,0x0412}, {0x0413,0x0433,0x0413}, {0x0414,0x0434,0x0414}, {0x0415,0x0435,0x0415}, {0x0416,0x0436,0x0416}, {0x0417,0x0437,0x0417}, - {0x0418,0x0438,0x0418}, {0x0419,0x0439,0x0418}, + {0x0418,0x0438,0x0418}, {0x0419,0x0439,0x0419}, {0x041A,0x043A,0x041A}, {0x041B,0x043B,0x041B}, {0x041C,0x043C,0x041C}, {0x041D,0x043D,0x041D}, {0x041E,0x043E,0x041E}, {0x041F,0x043F,0x041F}, From c596940e3c31a57daa115e9813041d5af7a203c1 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 21 Feb 2005 15:22:01 +0100 Subject: [PATCH 1033/1063] bug#8645 - ndb - ndb_mgmd nodeid handling (not to be merged as code has changed in 5.0) ndb/src/mgmapi/LocalConfig.cpp: Allow connecstring = "nodeid=X" ndb/src/mgmsrv/MgmtSrvr.cpp: remove incorrect asserts --- ndb/src/mgmapi/LocalConfig.cpp | 8 +++++++- ndb/src/mgmsrv/MgmtSrvr.cpp | 3 --- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/ndb/src/mgmapi/LocalConfig.cpp b/ndb/src/mgmapi/LocalConfig.cpp index 1dc805557ee..0265f982df3 100644 --- a/ndb/src/mgmapi/LocalConfig.cpp +++ b/ndb/src/mgmapi/LocalConfig.cpp @@ -226,7 +226,13 @@ LocalConfig::parseString(const char * connectString, BaseString &err){ return false; } - if (!found_other) { + if (b_nodeId && !found_other) + { + BaseString tmp; + tmp.assfmt("host=localhost:%s", NDB_PORT); + if(parseHostName(tmp.c_str())) + return true; + err.appfmt("Missing host/file name extry in \"%s\"", connectString); return false; } diff --git a/ndb/src/mgmsrv/MgmtSrvr.cpp b/ndb/src/mgmsrv/MgmtSrvr.cpp index 66c9a6448aa..3bc00b18f50 100644 --- a/ndb/src/mgmsrv/MgmtSrvr.cpp +++ b/ndb/src/mgmsrv/MgmtSrvr.cpp @@ -2229,9 +2229,6 @@ MgmtSrvr::alloc_node_id(NodeId * nodeId, id_found= tmp; break; } - assert(no_mgm > 1); - assert(*nodeId != 0); - assert(type != NDB_MGM_NODE_TYPE_MGM); if (id_found) { // mgmt server may only have one match error_string.appfmt("Ambiguous node id's %d and %d.\n" "Suggest specifying node id in connectstring,\n" From ae8c3e130a91687839b570f82f6694f81c21dbaf Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 21 Feb 2005 17:27:36 +0300 Subject: [PATCH 1034/1063] Fix -ansi -pedantic compilation failure. --- sql/sql_parse.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 0dcb59f689d..a22feda7d89 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -2780,8 +2780,8 @@ unsent_create_error: TABLE *table= tables->table; /* Skip first table, which is the table we are inserting in */ - tables= (TABLE_LIST *) - lex->select_lex.table_list.first= (byte*) first_local_table->next; + lex->select_lex.table_list.first= (byte*) first_local_table->next; + tables= (TABLE_LIST *) lex->select_lex.table_list.first; first_local_table->next= 0; if (!(res= mysql_prepare_insert(thd, tables, first_local_table, From aef137bc810d8c4cbe13651f9fe14c1a8ea0f2df Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 21 Feb 2005 09:15:43 -0600 Subject: [PATCH 1035/1063] sql_parse.cc: Fix compiler complaint. sql/sql_parse.cc: Fix compiler complaint. --- sql/sql_parse.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 0dcb59f689d..41705fb82e7 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -2781,7 +2781,7 @@ unsent_create_error: TABLE *table= tables->table; /* Skip first table, which is the table we are inserting in */ tables= (TABLE_LIST *) - lex->select_lex.table_list.first= (byte*) first_local_table->next; + (lex->select_lex.table_list.first= (byte*) first_local_table->next); first_local_table->next= 0; if (!(res= mysql_prepare_insert(thd, tables, first_local_table, From df1b674a695c6cba3228a94a556f97c707e732fc Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 21 Feb 2005 16:26:04 +0100 Subject: [PATCH 1036/1063] BUG#6676: Derivation of user variables should be of derivation "IMPLICIT" --- mysql-test/r/rpl_charset.result | 7 +++++++ mysql-test/t/rpl_charset.test | 13 +++++++++++++ sql/log_event.cc | 2 +- 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/rpl_charset.result b/mysql-test/r/rpl_charset.result index cab41344238..292cfb19175 100644 --- a/mysql-test/r/rpl_charset.result +++ b/mysql-test/r/rpl_charset.result @@ -207,3 +207,10 @@ select hex(c1), hex(c2) from t1; hex(c1) hex(c2) CDF32C20E7E020F0FBE1E0EBEAF3 CDF32C20E7E020F0FBE1E0EBEAF3 drop table t1; +create table `t1` ( +`pk` varchar(10) not null default '', +primary key (`pk`) +) engine=myisam default charset=latin1; +set @p=_latin1 'test'; +update t1 set pk='test' where pk=@p; +drop table t1; diff --git a/mysql-test/t/rpl_charset.test b/mysql-test/t/rpl_charset.test index 68036ae49f1..3f7eabfa434 100644 --- a/mysql-test/t/rpl_charset.test +++ b/mysql-test/t/rpl_charset.test @@ -169,3 +169,16 @@ select hex(c1), hex(c2) from t1; connection master; drop table t1; sync_slave_with_master; + +# +# BUG#6676: Derivation of variables must be correct on slave +# +connection master; +create table `t1` ( + `pk` varchar(10) not null default '', + primary key (`pk`) +) engine=myisam default charset=latin1; +set @p=_latin1 'test'; +update t1 set pk='test' where pk=@p; +drop table t1; +sync_slave_with_master; diff --git a/sql/log_event.cc b/sql/log_event.cc index 19113a3b97e..7d2848700f6 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -2528,7 +2528,7 @@ int User_var_log_event::exec_event(struct st_relay_log_info* rli) 0 can be passed as last argument (reference on item) */ e.fix_fields(thd, 0, 0); - e.update_hash(val, val_len, type, charset, DERIVATION_NONE); + e.update_hash(val, val_len, type, charset, DERIVATION_IMPLICIT); free_root(thd->mem_root,0); rli->inc_event_relay_log_pos(get_event_len()); From 25b205cec8d634220677f633c015ce8c7bde6c51 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 21 Feb 2005 17:52:15 +0100 Subject: [PATCH 1037/1063] BUG#6676: Added comment for the fix --- sql/log_event.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sql/log_event.cc b/sql/log_event.cc index 7d2848700f6..fabc6718826 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -2528,6 +2528,11 @@ int User_var_log_event::exec_event(struct st_relay_log_info* rli) 0 can be passed as last argument (reference on item) */ e.fix_fields(thd, 0, 0); + /* + A variable can just be considered as a table with + a single record and with a single column. Thus, like + a column value, it could always have IMPLICIT derivation. + */ e.update_hash(val, val_len, type, charset, DERIVATION_IMPLICIT); free_root(thd->mem_root,0); From edaf33a14e922571e8e80910bba6693b72e2db83 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 21 Feb 2005 18:40:28 +0100 Subject: [PATCH 1038/1063] BUG#6662: Importing mysqldumps should not show any warnings of level "notes". --- client/mysqldump.c | 4 +++ mysql-test/r/mysqldump.result | 54 +++++++++++++++++++++++------------ sql/mysql_priv.h | 4 +++ sql/mysqld.cc | 3 +- sql/set_var.cc | 4 +++ sql/sql_error.cc | 4 +++ 6 files changed, 54 insertions(+), 19 deletions(-) diff --git a/client/mysqldump.c b/client/mysqldump.c index 52255ccb896..2a6d9adf8bd 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -492,6 +492,8 @@ static void write_header(FILE *sql_file, char *db_name) "/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='%s%s%s' */;\n", path?"":"NO_AUTO_VALUE_ON_ZERO",compatible_mode_normal_str[0]==0?"":",", compatible_mode_normal_str); + fprintf(sql_file, + "/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;\n"); check_io(sql_file); } } /* write_header */ @@ -518,6 +520,8 @@ static void write_footer(FILE *sql_file) "/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;\n" "/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;\n" "/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;\n"); + fprintf(sql_file, + "/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;"); fputs("\n", sql_file); check_io(sql_file); } diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index 8f2294caa48..754d1458eac 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -61,6 +61,7 @@ INSERT INTO `t1` VALUES ('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456) /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; DROP TABLE IF EXISTS `t1`; CREATE TABLE `t1` ( `a` decimal(10,5) default NULL, @@ -80,10 +81,11 @@ UNLOCK TABLES; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; - +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; CREATE TABLE `t1` ( `a` decimal(10,5) default NULL, `b` float default NULL @@ -94,7 +96,7 @@ INSERT INTO `t1` VALUES ('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456) /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; - +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; DROP TABLE t1; CREATE TABLE t1(a int, b text, c varchar(3)); INSERT INTO t1 VALUES (1, "test", "tes"), (2, "TEST", "TES"); @@ -150,6 +152,7 @@ INSERT INTO t1 VALUES (_koi8r x'C1C2C3C4C5'), (NULL); /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; DROP TABLE IF EXISTS `t1`; CREATE TABLE `t1` ( `a` varchar(255) default NULL @@ -169,13 +172,14 @@ UNLOCK TABLES; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; - +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; DROP TABLE t1; CREATE TABLE t1 (a int) ENGINE=MYISAM; INSERT INTO t1 VALUES (1), (2); /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL40' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; DROP TABLE IF EXISTS `t1`; CREATE TABLE `t1` ( `a` int(11) default NULL @@ -191,10 +195,11 @@ UNLOCK TABLES; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; - +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL323' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; DROP TABLE IF EXISTS `t1`; CREATE TABLE `t1` ( `a` int(11) default NULL @@ -210,7 +215,7 @@ UNLOCK TABLES; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; - +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; DROP TABLE t1; create table ```a` (i int); CREATE TABLE ```a` ( @@ -226,6 +231,7 @@ create table t1(a int); /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; DROP TABLE IF EXISTS `t1`; CREATE TABLE `t1` ( `a` int(11) default NULL @@ -243,10 +249,11 @@ UNLOCK TABLES; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; - +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,ANSI' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; DROP TABLE IF EXISTS "t1"; CREATE TABLE "t1" ( "a" int(11) default NULL @@ -261,7 +268,7 @@ UNLOCK TABLES; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; - +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; set global sql_mode='ANSI_QUOTES'; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; @@ -271,6 +278,7 @@ set global sql_mode='ANSI_QUOTES'; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; DROP TABLE IF EXISTS `t1`; CREATE TABLE `t1` ( `a` int(11) default NULL @@ -288,10 +296,11 @@ UNLOCK TABLES; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; - +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,ANSI' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; DROP TABLE IF EXISTS "t1"; CREATE TABLE "t1" ( "a" int(11) default NULL @@ -306,7 +315,7 @@ UNLOCK TABLES; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; - +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; set global sql_mode=''; drop table t1; create table t1(a int); @@ -317,6 +326,7 @@ insert into t1 values (1),(2),(3); /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; DROP TABLE IF EXISTS `t1`; CREATE TABLE `t1` ( `a` int(11) default NULL @@ -327,7 +337,7 @@ CREATE TABLE `t1` ( /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; - +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; 1 2 3 @@ -340,6 +350,7 @@ drop table t1; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET latin1 */; @@ -351,7 +362,7 @@ USE `test`; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; - +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; create database mysqldump_test_db character set latin2 collate latin2_bin; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; @@ -361,6 +372,7 @@ create database mysqldump_test_db character set latin2 collate latin2_bin; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mysqldump_test_db` /*!40100 DEFAULT CHARACTER SET latin2 COLLATE latin2_bin */; @@ -372,7 +384,7 @@ USE `mysqldump_test_db`; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; - +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; drop database mysqldump_test_db; CREATE TABLE t1 (a CHAR(10)); INSERT INTO t1 VALUES (_latin1 'ÄÖÜß'); @@ -384,6 +396,7 @@ INSERT INTO t1 VALUES (_latin1 ' /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; DROP TABLE IF EXISTS `t1`; CREATE TABLE `t1` ( `a` char(10) default NULL @@ -402,10 +415,11 @@ UNLOCK TABLES; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; - +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL323' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; DROP TABLE IF EXISTS `t1`; CREATE TABLE `t1` ( `a` char(10) default NULL @@ -421,10 +435,11 @@ UNLOCK TABLES; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; - +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL323' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; DROP TABLE IF EXISTS `t1`; CREATE TABLE `t1` ( `a` char(10) default NULL @@ -440,10 +455,11 @@ UNLOCK TABLES; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; - +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL323' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; DROP TABLE IF EXISTS `t1`; CREATE TABLE `t1` ( `a` char(10) default NULL @@ -459,10 +475,11 @@ UNLOCK TABLES; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; - +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL323' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; DROP TABLE IF EXISTS `t1`; CREATE TABLE `t1` ( `a` char(10) default NULL @@ -478,7 +495,7 @@ UNLOCK TABLES; /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; - +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; DROP TABLE t1; CREATE TABLE t1 (a int); CREATE TABLE t2 (a int); @@ -492,6 +509,7 @@ INSERT INTO t2 VALUES (4),(5),(6); /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; DROP TABLE IF EXISTS `t2`; CREATE TABLE `t2` ( `a` int(11) default NULL @@ -510,6 +528,6 @@ UNLOCK TABLES; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; - +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; DROP TABLE t1; DROP TABLE t2; diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 6218bc49f53..3cb5eba8efa 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -212,6 +212,10 @@ extern CHARSET_INFO *national_charset_info, *table_alias_charset; #define OPTION_RELAXED_UNIQUE_CHECKS (1L << 27) #define SELECT_NO_UNLOCK (1L << 28) +/* If set to 0, then the thread will ignore all warnings with level notes. + Set by executing SET SHOW_NOTES=1 */ +#define OPTION_NOTES (1L << 31) + /* Bits for different SQL modes modes (including ANSI mode) */ #define MODE_REAL_AS_FLOAT 1 #define MODE_PIPES_AS_CONCAT 2 diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 53dca59bc92..3e4d0593a85 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -5622,7 +5622,8 @@ static void mysql_init_variables(void) language_ptr= language; mysql_data_home= mysql_real_data_home; thd_startup_options= (OPTION_UPDATE_LOG | OPTION_AUTO_IS_NULL | - OPTION_BIN_LOG | OPTION_QUOTE_SHOW_CREATE); + OPTION_BIN_LOG | OPTION_QUOTE_SHOW_CREATE | + OPTION_NOTES); protocol_version= PROTOCOL_VERSION; what_to_log= ~ (1L << (uint) COM_TIME); refresh_version= flush_version= 1L; /* Increments on each reload */ diff --git a/sql/set_var.cc b/sql/set_var.cc index ca7987d2636..00ab4658f30 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -423,6 +423,9 @@ static sys_var_thd_bit sys_log_binlog("sql_log_bin", static sys_var_thd_bit sys_sql_warnings("sql_warnings", 0, set_option_bit, OPTION_WARNINGS); +static sys_var_thd_bit sys_sql_notes("sql_notes", 0, + set_option_bit, + OPTION_NOTES); static sys_var_thd_bit sys_auto_is_null("sql_auto_is_null", 0, set_option_bit, OPTION_AUTO_IS_NULL); @@ -610,6 +613,7 @@ sys_var *sys_variables[]= &sys_sql_max_join_size, &sys_sql_mode, &sys_sql_warnings, + &sys_sql_notes, &sys_storage_engine, #ifdef HAVE_REPLICATION &sys_sync_binlog_period, diff --git a/sql/sql_error.cc b/sql/sql_error.cc index eab5ec890df..e04c2843c93 100644 --- a/sql/sql_error.cc +++ b/sql/sql_error.cc @@ -104,6 +104,10 @@ MYSQL_ERROR *push_warning(THD *thd, MYSQL_ERROR::enum_warning_level level, { MYSQL_ERROR *err= 0; DBUG_ENTER("push_warning"); + + if (level == MYSQL_ERROR::WARN_LEVEL_NOTE && !(thd->options & OPTION_NOTES)) + return(0); + if (thd->query_id != thd->warn_id) mysql_reset_errors(thd); From 1329f063c052e70fa71c7aaacb08e49357d108f5 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 22 Feb 2005 08:35:15 +0400 Subject: [PATCH 1039/1063] field.cc: optimize test_if_minus() when not UCS2 support is compiled. sql/field.cc: optimize test_if_minus() when not UCS2 support is compiled. --- sql/field.cc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/sql/field.cc b/sql/field.cc index fa0e202d513..34c5d572526 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -1776,13 +1776,23 @@ void Field_medium::sql_type(String &res) const ** long int ****************************************************************************/ - +/* + A helper function to check whether the next character + in the string "s" is MINUS SIGN. +*/ +#ifdef HAVE_CHARSET_ucs2 static bool test_if_minus(CHARSET_INFO *cs, const char *s, const char *e) { my_wc_t wc; return cs->cset->mb_wc(cs, &wc, (uchar*) s, (uchar*) e) > 0 && wc == '-'; } +#else +/* + If not UCS2 support is compiled then it is easier +*/ +#define test_if_minus(cs, s, e) (*s == '-') +#endif int Field_long::store(const char *from,uint len,CHARSET_INFO *cs) From 14707d71c388375817b4ffb74df189bbe14a709d Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 22 Feb 2005 09:56:07 +0400 Subject: [PATCH 1040/1063] ctype_latin1.result, ctype_latin1.test, charset.c: Treat unknown characters straight in a query as syntax error, rather skipping it as a space character. mysys/charset.c: Treat unknown characters straight in a query as syntax error, rather skipping it as a space character. mysql-test/t/ctype_latin1.test: Treat unknown characters straight in a query as syntax error, rather skipping it as a space character. mysql-test/r/ctype_latin1.result: Treat unknown characters straight in a query as syntax error, rather skipping it as a space character. --- mysql-test/r/ctype_latin1.result | 5 +++++ mysql-test/t/ctype_latin1.test | 9 +++++++++ mysys/charset.c | 2 +- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/ctype_latin1.result b/mysql-test/r/ctype_latin1.result index cd804939a75..21c40e24fe2 100644 --- a/mysql-test/r/ctype_latin1.result +++ b/mysql-test/r/ctype_latin1.result @@ -325,3 +325,8 @@ latin1_bin 6109 latin1_bin 61 latin1_bin 6120 drop table t1; +CREATE TABLE „a (a int); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '„a (a int)' at line 1 +SELECT '„a' as str; +str +„a diff --git a/mysql-test/t/ctype_latin1.test b/mysql-test/t/ctype_latin1.test index cee0324d12f..6006ee4c527 100644 --- a/mysql-test/t/ctype_latin1.test +++ b/mysql-test/t/ctype_latin1.test @@ -66,3 +66,12 @@ SET collation_connection='latin1_swedish_ci'; -- source include/ctype_filesort.inc SET collation_connection='latin1_bin'; -- source include/ctype_filesort.inc + +# +# Bug#8041 +# An unknown character (e.g. 0x84) should result in ERROR, +# It was treated like a space character earlier. +# Howerver, it should still work fine as a string part. +--error 1064 +CREATE TABLE „a (a int); +SELECT '„a' as str; diff --git a/mysys/charset.c b/mysys/charset.c index bb8f2d178b9..5840c885e40 100644 --- a/mysys/charset.c +++ b/mysys/charset.c @@ -64,7 +64,7 @@ static my_bool init_state_maps(CHARSET_INFO *cs) else if (my_mbcharlen(cs, i)>1) state_map[i]=(uchar) MY_LEX_IDENT; #endif - else if (!my_isgraph(cs,i)) + else if (my_isspace(cs,i)) state_map[i]=(uchar) MY_LEX_SKIP; else state_map[i]=(uchar) MY_LEX_CHAR; From 029f10dd85ebe9f3bfe29e2de9bbcec9d01743e7 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 22 Feb 2005 10:18:38 +0100 Subject: [PATCH 1041/1063] wl1292 - ndb autotest scripts split into script/conf for easier deployment --- ndb/test/run-test/example.conf | 10 ++ ndb/test/run-test/ndb-autotest.sh | 226 ++++++++++++++++++++++++++++++ 2 files changed, 236 insertions(+) create mode 100644 ndb/test/run-test/example.conf create mode 100755 ndb/test/run-test/ndb-autotest.sh diff --git a/ndb/test/run-test/example.conf b/ndb/test/run-test/example.conf new file mode 100644 index 00000000000..1e152da332d --- /dev/null +++ b/ndb/test/run-test/example.conf @@ -0,0 +1,10 @@ +target=pc-linux-i686 +base_dir=/ndb +src_clone_base=mysqldev@bk-internal.mysql.com:/home/bk/mysql +run_dir=/space/autotest +build_dir=/ndb +hosts="ndb01 ndb02 ndb03 ndb04 ndb05 ndb06 ndb07 ndb08 ndb09 ndb10 ndb11 ndb12" +result_host="ndb.mysql.com" +result_path="public_html" +configure='CC=gcc CXX=gcc CFLAGS="-Wall -pedantic -Wno-long-long" CXXFLAGS="-Wall -pedantic -Wno-long-long" ./configure --with-ndbcluster --with-ndb-test --with-ndbcc-flags="-g -DERROR_INSERT"' + diff --git a/ndb/test/run-test/ndb-autotest.sh b/ndb/test/run-test/ndb-autotest.sh new file mode 100755 index 00000000000..039f1bf914e --- /dev/null +++ b/ndb/test/run-test/ndb-autotest.sh @@ -0,0 +1,226 @@ +#!/bin/sh + +save_args=$* +VERSION="ndb-autotest.sh version 1.0" + +DATE=`date '+%Y-%m-%d'` +export DATE + +set -e +ulimit -Sc unlimited + +echo "`date` starting: $*" + +RSYNC_RSH=ssh +export RSYNC_RSH + +do_clone=yes +build=yes +deploy=yes + +clone=5.0-ndb +RUN="daily-basic daily-devel" +conf=autotest.conf + +while [ "$1" ] +do + case "$1" in + --no-clone) do_clone="";; + --no-build) build="";; + --no-deploy) deploy="";; + --clone=*) clone=`echo $1 | sed s/--clone=//`;; + --conf=*) conf=`echo $1 | sed s/--conf=//`;; + --version) echo $VERSION; exit;; + *) RUN=$*;; + esac + shift +done + +if [ -f $conf ] +then + . $conf +else + echo "Can't find config file: $conf" + exit +fi + +env + +LOCK=$HOME/.autotest-lock +src_clone=$src_clone_base-$clone + +if [ -f $LOCK ] +then + echo "Lock file exists: $LOCK" + exit 1 +fi + +echo "$DATE $RUN" > $LOCK +trap "rm -f $LOCK" ERR + +dst_place=${build_dir}/clone-mysql-$clone-$DATE + +if [ "$do_clone" ] +then + rm -rf $dst_place + bk clone $src_clone $dst_place +fi + +if [ "$build" ] +then + cd $dst_place + rm -rf $run_dir/* + aclocal; autoheader; autoconf; automake + (cd innobase; aclocal; autoheader; autoconf; automake) + (cd bdb/dist; sh s_all) + eval $configure --prefix=$run_dir + make + make install +fi + +### +# check script version +# +script=$run_dir/mysql-test/ndb/ndb-autotest.sh +if [ -x $script ] +then + $script --version > /tmp/version.$$ +else + echo $VERSION > /tmp/version.$$ +fi +match=`grep -c "$VERSION" /tmp/version.$$` +rm -f /tmp/version.$$ +if [ $match -eq 0 ] +then + echo "Incorrect script version...restarting" + cp $run_dir/mysql-test/ndb/ndb-autotest.sh /tmp/at.$$.sh + rm -rf $run_dir $dst_place + sh /tmp/at.$$.sh $save_args + exit +fi + +# Check that all interesting files are present +test_dir=$run_dir/mysql-test/ndb +atrt=$test_dir/atrt +html=$test_dir/make-html-reports.sh +PATH=$test_dir:$PATH +export PATH + +filter(){ + neg=$1 + shift + while [ $# -gt 0 ] + do + if [ `grep -c $1 $neg` -eq 0 ] ; then echo $1; fi + shift + done +} + +### +# check ndb_cpcc fail hosts +# +ndb_cpcc $hosts | awk '{ if($1=="Failed"){ print;}}' > /tmp/failed.$DATE +filter /tmp/failed.$DATE $hosts > /tmp/hosts.$DATE +hosts=`cat /tmp/hosts.$DATE` + +if [ "$deploy" ] +then + (cd / && tar cfz /tmp/build.$DATE.tgz $run_dir ) + for i in $hosts + do + ok=0 + scp /tmp/build.$DATE.tgz $i:/tmp/build.$DATE.$$.tgz && \ + ssh $i "rm -rf /space/autotest/*" && \ + ssh $i "cd / && tar xfz /tmp/build.$DATE.$$.tgz" && \ + ssh $i "rm /tmp/build.$DATE.$$.tgz" && ok=1 + if [ $ok -eq 0 ] + then + echo "$i failed during scp/ssh, excluding" + echo $i >> /tmp/failed.$DATE + fi + done +fi +rm -f /tmp/build.$DATE.tgz + +### +# handle scp failed hosts +# +filter /tmp/failed.$DATE $hosts > /tmp/hosts.$DATE +hosts=`cat /tmp/hosts.$DATE` +cat /tmp/failed.$DATE > /tmp/filter_hosts.$$ + +### +# functions for running atrt +# +choose(){ + SRC=$1 + TMP1=/tmp/choose.$$ + TMP2=/tmp/choose.$$.$$ + shift + + cp $SRC $TMP1 + i=1 + while [ $# -gt 0 ] + do + sed -e s,"CHOOSE_host$i",$1,g < $TMP1 > $TMP2 + mv $TMP2 $TMP1 + shift + i=`expr $i + 1` + done + cat $TMP1 + rm -f $TMP1 +} +start(){ + rm -rf report.txt result* log.txt + $atrt -v -v -r -R --log-file=log.txt --testcase-file=$test_dir/$2-tests.txt & + pid=$! + echo $pid > run.pid + wait $pid + rm run.pid + [ -f log.txt ] && mv log.txt $3 + [ -f report.txt ] && mv report.txt $3 + [ "`find . -name 'result*'`" ] && mv result* $3 + cd $3 + sh $html . $1 $DATE + cd ../.. + tar cvz /tmp/res.$$.tgz `basename $3`/$DATE + scp /tmp/res.$$.tgz $result_host:$result_path + ssh $result_host "cd $result_path && tar xfz res.$$.tgz && rm -f res.$$.tgz" + rm -f /tmp/res.$$.tgz +} + +p=`pwd` +for dir in $RUN +do + echo "Fixing hosts for $dir" + + run_dir=$base_dir/run-$dir-mysql-$clone-$target + res_dir=$base_dir/result-$dir-mysql-$clone-$target/$DATE + + mkdir -p $res_dir + rm -rf $res_dir/* + + count=`grep -c "COMPUTER" $run_dir/1.ndb_mgmd/initconfig.template` + avail_hosts=`filter /tmp/filter_hosts.$$ $hosts` + avail=`echo $avail_hosts | wc -w` + if [ $count -gt $avail ] + then + echo "Not enough hosts" + echo "Needs: $count available: $avail ($avail_hosts)" + break; + fi + + run_hosts=`echo $avail_hosts| awk '{for(i=1;i<='$count';i++)print $i;}'` + choose $run_dir/d.template $run_hosts > $run_dir/d.txt + choose $run_dir/1.ndb_mgmd/initconfig.template $run_hosts > $run_dir/1.ndb_mgmd/config.ini + echo $run_hosts >> /tmp/filter_hosts.$$ + + cd $run_dir + start $dir-mysql-$clone-$target $dir $res_dir & +done +cd $p +rm /tmp/filter_hosts.$$ + +wait + +rm -f $LOCK From cb8d9c3ad40f00018cff05168e731ff2547d6144 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 22 Feb 2005 12:51:23 +0200 Subject: [PATCH 1042/1063] Backport my_strntod() from 5.0 Change string->float conversion to delay division as long as possible. This gives us more exact integer->float conversion for numbers of type '123.45E+02' (Bug #7740) client/mysql.cc: Fix wront usage of charset (found during review of pushed code) include/m_string.h: Backported my_strtod() from 5.0 mysql-test/mysql-test-run.sh: Run also mysql_client_test with --debug mysql-test/r/ps_1general.result: Safety fix (if mysql_client_test.test fails) mysql-test/r/type_float.result: More test mysql-test/t/mysql_client_test.test: Comments for what to do if this test fails mysql-test/t/ps_1general.test: Safety fix (if mysql_client_test.test fails) mysql-test/t/type_float.test: More test to better test new strtod() function Test also bug #7740 (wrong comparsion between integer and float-in-integer-range) sql/field.cc: Backport my_strntod() from 5.0 sql/item.cc: Backport my_strntod() from 5.0 sql/item.h: Backport my_strntod() from 5.0 sql/item_func.h: Backport my_strntod() from 5.0 sql/item_strfunc.cc: Backport my_strntod() from 5.0 sql/item_sum.cc: Backport my_strntod() from 5.0 sql/item_sum.h: Backport my_strntod() from 5.0 sql/procedure.h: Backport my_strntod() from 5.0 strings/ctype-simple.c: Backport my_strntod() from 5.0 strings/ctype-ucs2.c: Backport my_strntod() from 5.0 strings/strtod.c: Backport my_strntod() from 5.0 Change conversion to delay division as long as possible. This gives us more exact integer-> float conversion for numbers of type '123.45E+02' --- client/mysql.cc | 4 +- include/m_string.h | 2 +- mysql-test/mysql-test-run.sh | 3 +- mysql-test/r/ps_1general.result | 1 + mysql-test/r/type_float.result | 34 +++++- mysql-test/t/mysql_client_test.test | 7 ++ mysql-test/t/ps_1general.test | 1 + mysql-test/t/type_float.test | 26 ++++- sql/field.cc | 14 ++- sql/item.cc | 11 +- sql/item.h | 6 +- sql/item_func.h | 7 +- sql/item_strfunc.cc | 3 +- sql/item_sum.cc | 3 +- sql/item_sum.h | 6 +- sql/procedure.h | 11 +- strings/ctype-simple.c | 27 +---- strings/ctype-ucs2.c | 9 +- strings/strtod.c | 175 +++++++++++++++++++--------- 19 files changed, 243 insertions(+), 107 deletions(-) diff --git a/client/mysql.cc b/client/mysql.cc index 4004757359b..1bbab75434c 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -2914,9 +2914,9 @@ com_status(String *buffer __attribute__((unused)), MYSQL_ROW cur=mysql_fetch_row(result); if (cur) { - tee_fprintf(stdout, "Server characterset:\t%s\n", cur[0] ? cur[2] : ""); + tee_fprintf(stdout, "Server characterset:\t%s\n", cur[2] ? cur[2] : ""); tee_fprintf(stdout, "Db characterset:\t%s\n", cur[3] ? cur[3] : ""); - tee_fprintf(stdout, "Client characterset:\t%s\n", cur[2] ? cur[0] : ""); + tee_fprintf(stdout, "Client characterset:\t%s\n", cur[0] ? cur[0] : ""); tee_fprintf(stdout, "Conn. characterset:\t%s\n", cur[1] ? cur[1] : ""); } mysql_free_result(result); diff --git a/include/m_string.h b/include/m_string.h index 97d34421537..d3465363beb 100644 --- a/include/m_string.h +++ b/include/m_string.h @@ -215,7 +215,7 @@ extern char *strstr(const char *, const char *); extern int is_prefix(const char *, const char *); /* Conversion routines */ -double my_strtod(const char *str, char **end); +double my_strtod(const char *str, char **end, int *error); double my_atof(const char *nptr); extern char *llstr(longlong value,char *buff); diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index af432f37868..8c484d2ddb1 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -444,6 +444,7 @@ while test $# -gt 0; do --debug=d:t:A,$MYSQL_TEST_DIR/var/log/mysqldump.trace" EXTRA_MYSQLBINLOG_OPT="$EXTRA_MYSQLBINLOG_OPT \ --debug=d:t:A,$MYSQL_TEST_DIR/var/log/mysqlbinlog.trace" + EXTRA_MYSQL_CLIENT_TEST_OPT="--debug=d:t:A,$MYSQL_TEST_DIR/var/log/mysql_client_test.trace" ;; --fast) FAST_START=1 @@ -681,7 +682,7 @@ then EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT --user=root" fi -MYSQL_CLIENT_TEST="$MYSQL_CLIENT_TEST --no-defaults --testcase --user=root --socket=$MASTER_MYSOCK --port=$MYSQL_TCP_PORT --silent" +MYSQL_CLIENT_TEST="$MYSQL_CLIENT_TEST --no-defaults --testcase --user=root --socket=$MASTER_MYSOCK --port=$MYSQL_TCP_PORT --silent $EXTRA_MYSQL_CLIENT_TEST_OPT" MYSQL_DUMP="$MYSQL_DUMP --no-defaults -uroot --socket=$MASTER_MYSOCK --password=$DBPASSWD $EXTRA_MYSQLDUMP_OPT" MYSQL_BINLOG="$MYSQL_BINLOG --no-defaults --local-load=$MYSQL_TMP_DIR $EXTRA_MYSQLBINLOG_OPT" MYSQL_FIX_SYSTEM_TABLES="$MYSQL_FIX_SYSTEM_TABLES --no-defaults --host=localhost --port=$MASTER_MYPORT --socket=$MASTER_MYSOCK --user=root --password=$DBPASSWD --basedir=$BASEDIR --bindir=$CLIENT_BINDIR --verbose" diff --git a/mysql-test/r/ps_1general.result b/mysql-test/r/ps_1general.result index 2356989eaf6..ec4aa528a7f 100644 --- a/mysql-test/r/ps_1general.result +++ b/mysql-test/r/ps_1general.result @@ -1,5 +1,6 @@ drop table if exists t5, t6, t7, t8; drop database if exists mysqltest ; +drop database if exists client_test_db; test_sequence ------ basic tests ------ drop table if exists t1, t9 ; diff --git a/mysql-test/r/type_float.result b/mysql-test/r/type_float.result index 1f5a34917d7..c1cefe4b35d 100644 --- a/mysql-test/r/type_float.result +++ b/mysql-test/r/type_float.result @@ -1,4 +1,4 @@ -drop table if exists t1; +drop table if exists t1,t2; SELECT 10,10.0,10.,.1e+2,100.0e-1; 10 10.0 10. .1e+2 100.0e-1 10 10.0 10 10 10 @@ -8,6 +8,15 @@ SELECT 6e-05, -6e-05, --6e-05, -6e-05+1.000000; SELECT 1e1,1.e1,1.0e1,1e+1,1.e+1,1.0e+1,1e-1,1.e-1,1.0e-1; 1e1 1.e1 1.0e1 1e+1 1.e+1 1.0e+1 1e-1 1.e-1 1.0e-1 10 10 10 10 10 10 0.1 0.1 0.1 +SELECT 0.001e+1,0.001e-1, -0.001e+01,-0.001e-01; +0.001e+1 0.001e-1 -0.001e+01 -0.001e-01 +0.01 0.0001 -0.01 -0.0001 +SELECT 123.23E+02,-123.23E-02,"123.23E+02"+0.0,"-123.23E-02"+0.0; +123.23E+02 -123.23E-02 "123.23E+02"+0.0 "-123.23E-02"+0.0 +12323 -1.2323 12323 -1.2323 +SELECT 2147483647E+02,21474836.47E+06; +2147483647E+02 21474836.47E+06 +214748364700 21474836470000 create table t1 (f1 float(24),f2 float(52)); show full columns from t1; Field Type Collation Null Key Default Extra Privileges Comment @@ -139,6 +148,9 @@ create table t1 (c20 char); insert into t1 values (5000.0); Warnings: Warning 1265 Data truncated for column 'c20' at row 1 +insert into t1 values (0.5e4); +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 drop table t1; create table t1 (f float(54)); ERROR 42000: Incorrect column specifier for column 'f' @@ -203,3 +215,23 @@ c 0.0002 2e-05 drop table t1; +CREATE TABLE t1 ( +reckey int unsigned NOT NULL, +recdesc varchar(50) NOT NULL, +PRIMARY KEY (reckey) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; +INSERT INTO t1 VALUES (108, 'Has 108 as key'); +INSERT INTO t1 VALUES (109, 'Has 109 as key'); +select * from t1 where reckey=108; +reckey recdesc +108 Has 108 as key +select * from t1 where reckey=1.08E2; +reckey recdesc +108 Has 108 as key +select * from t1 where reckey=109; +reckey recdesc +109 Has 109 as key +select * from t1 where reckey=1.09E2; +reckey recdesc +109 Has 109 as key +drop table t1; diff --git a/mysql-test/t/mysql_client_test.test b/mysql-test/t/mysql_client_test.test index 86aecf43cbd..3639fc2e262 100644 --- a/mysql-test/t/mysql_client_test.test +++ b/mysql-test/t/mysql_client_test.test @@ -1,3 +1,10 @@ # We run with different binaries for normal and --embedded-server +# +# If this test fails with "command "$MYSQL_CLIENT_TEST" failed", +# you should either run mysql_client_test separartely against a running +# server or run mysql-test-run --debug mysql_client_test and check +# var/log/mysql_client_test.trace + --disable_result_log +--exec echo $MYSQL_CLIENT_TEST --exec $MYSQL_CLIENT_TEST diff --git a/mysql-test/t/ps_1general.test b/mysql-test/t/ps_1general.test index 4ab81dfcac5..b3ce6d7fd82 100644 --- a/mysql-test/t/ps_1general.test +++ b/mysql-test/t/ps_1general.test @@ -11,6 +11,7 @@ --disable_warnings drop table if exists t5, t6, t7, t8; drop database if exists mysqltest ; +drop database if exists client_test_db; --enable_warnings --disable_query_log diff --git a/mysql-test/t/type_float.test b/mysql-test/t/type_float.test index 5b106d242de..6e991dc53d4 100644 --- a/mysql-test/t/type_float.test +++ b/mysql-test/t/type_float.test @@ -3,7 +3,7 @@ # Numeric floating point. --disable_warnings -drop table if exists t1; +drop table if exists t1,t2; --enable_warnings --replace_result e-0 e- e+0 e+ @@ -11,6 +11,9 @@ SELECT 10,10.0,10.,.1e+2,100.0e-1; --replace_result e-00 e-0 SELECT 6e-05, -6e-05, --6e-05, -6e-05+1.000000; SELECT 1e1,1.e1,1.0e1,1e+1,1.e+1,1.0e+1,1e-1,1.e-1,1.0e-1; +SELECT 0.001e+1,0.001e-1, -0.001e+01,-0.001e-01; +SELECT 123.23E+02,-123.23E-02,"123.23E+02"+0.0,"-123.23E-02"+0.0; +SELECT 2147483647E+02,21474836.47E+06; create table t1 (f1 float(24),f2 float(52)); show full columns from t1; @@ -83,6 +86,7 @@ drop table t1; # create table t1 (c20 char); insert into t1 values (5000.0); +insert into t1 values (0.5e4); drop table t1; # Errors @@ -120,3 +124,23 @@ create table t1 (c char(6)); insert into t1 values (2e5),(2e6),(2e-4),(2e-5); select * from t1; drop table t1; + +# +# Test of comparison of integer with float-in-range (Bug #7840) +# This is needed because some ODBC applications (like Foxpro) uses +# floats for everything. +# + +CREATE TABLE t1 ( + reckey int unsigned NOT NULL, + recdesc varchar(50) NOT NULL, + PRIMARY KEY (reckey) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +INSERT INTO t1 VALUES (108, 'Has 108 as key'); +INSERT INTO t1 VALUES (109, 'Has 109 as key'); +select * from t1 where reckey=108; +select * from t1 where reckey=1.08E2; +select * from t1 where reckey=109; +select * from t1 where reckey=1.09E2; +drop table t1; diff --git a/sql/field.cc b/sql/field.cc index fa0e202d513..ca923d723bc 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -968,7 +968,9 @@ int Field_decimal::store(longlong nr) double Field_decimal::val_real(void) { int not_used; - return my_strntod(&my_charset_bin, ptr, field_length, NULL, ¬_used); + char *end_not_used; + return my_strntod(&my_charset_bin, ptr, field_length, &end_not_used, + ¬_used); } longlong Field_decimal::val_int(void) @@ -4360,8 +4362,9 @@ int Field_string::store(longlong nr) double Field_string::val_real(void) { int not_used; + char *end_not_used; CHARSET_INFO *cs=charset(); - return my_strntod(cs,ptr,field_length,(char**)0,¬_used); + return my_strntod(cs, ptr, field_length, &end_not_used, ¬_used); } @@ -4577,7 +4580,9 @@ double Field_varstring::val_real(void) int not_used; uint length=uint2korr(ptr)+HA_KEY_BLOB_LENGTH; CHARSET_INFO *cs=charset(); - return my_strntod(cs, ptr+HA_KEY_BLOB_LENGTH, length, (char**)0, ¬_used); + char *end_not_used; + return my_strntod(cs, ptr+HA_KEY_BLOB_LENGTH, length, &end_not_used, + ¬_used); } @@ -4955,12 +4960,13 @@ double Field_blob::val_real(void) { int not_used; char *blob; + char *end_not_used; memcpy_fixed(&blob,ptr+packlength,sizeof(char*)); if (!blob) return 0.0; uint32 length=get_length(ptr); CHARSET_INFO *cs=charset(); - return my_strntod(cs,blob,length,(char**)0, ¬_used); + return my_strntod(cs,blob,length, &end_not_used, ¬_used); } diff --git a/sql/item.cc b/sql/item.cc index 4b3acbe5a3c..76cbaa99029 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -1140,8 +1140,9 @@ double Item_param::val() case LONG_DATA_VALUE: { int dummy_err; + char *end_not_used; return my_strntod(str_value.charset(), (char*) str_value.ptr(), - str_value.length(), (char**) 0, &dummy_err); + str_value.length(), &end_not_used, &dummy_err); } case TIME_VALUE: /* @@ -2585,10 +2586,12 @@ double Item_cache_str::val() DBUG_ASSERT(fixed == 1); int err; if (value) + { + char *end_not_used; return my_strntod(value->charset(), (char*) value->ptr(), - value->length(), (char**) 0, &err); - else - return (double)0; + value->length(), &end_not_used, &err); + } + return (double)0; } diff --git a/sql/item.h b/sql/item.h index dd06d4ce61a..97e2b0c0945 100644 --- a/sql/item.h +++ b/sql/item.h @@ -719,8 +719,9 @@ public: { DBUG_ASSERT(fixed == 1); int err; + char *end_not_used; return my_strntod(str_value.charset(), (char*) str_value.ptr(), - str_value.length(), (char**) 0, &err); + str_value.length(), &end_not_used, &err); } longlong val_int() { @@ -1044,9 +1045,10 @@ public: double val() { int err; + char *end_not_used; return (null_value ? 0.0 : my_strntod(str_value.charset(), (char*) str_value.ptr(), - str_value.length(),NULL,&err)); + str_value.length(), &end_not_used, &err)); } longlong val_int() { diff --git a/sql/item_func.h b/sql/item_func.h index 8a5347d675e..2738c7419ca 100644 --- a/sql/item_func.h +++ b/sql/item_func.h @@ -828,8 +828,11 @@ public: double val() { int err; - String *res; res=val_str(&str_value); - return res ? my_strntod(res->charset(),(char*) res->ptr(),res->length(),0,&err) : 0.0; + String *res; + char *end_not_used; + res=val_str(&str_value); + return res ? my_strntod(res->charset(), (char*) res->ptr(), res->length(), + &end_not_used, &err) : 0.0; } longlong val_int() { diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index bbbcadbb071..8bd1da4e15f 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -63,10 +63,11 @@ double Item_str_func::val() DBUG_ASSERT(fixed == 1); int err; char buff[64]; + char *end_not_used; String *res, tmp(buff,sizeof(buff), &my_charset_bin); res= val_str(&tmp); return res ? my_strntod(res->charset(), (char*) res->ptr(),res->length(), - NULL, &err) : 0.0; + &end_not_used, &err) : 0.0; } longlong Item_str_func::val_int() diff --git a/sql/item_sum.cc b/sql/item_sum.cc index 029a1fd6c48..6bd2cc00b3e 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -471,13 +471,14 @@ double Item_sum_hybrid::val() { DBUG_ASSERT(fixed == 1); int err; + char *end_not_used; if (null_value) return 0.0; switch (hybrid_type) { case STRING_RESULT: String *res; res=val_str(&str_value); return (res ? my_strntod(res->charset(), (char*) res->ptr(),res->length(), - (char**) 0, &err) : 0.0); + &end_not_used, &err) : 0.0); case INT_RESULT: if (unsigned_flag) return ulonglong2double(sum_int); diff --git a/sql/item_sum.h b/sql/item_sum.h index d1e82387944..dab136e4716 100644 --- a/sql/item_sum.h +++ b/sql/item_sum.h @@ -600,9 +600,11 @@ public: double val() { int err; - String *res; res=val_str(&str_value); + char *end_not_used; + String *res; + res=val_str(&str_value); return res ? my_strntod(res->charset(),(char*) res->ptr(),res->length(), - (char**) 0, &err) : 0.0; + &end_not_used, &err) : 0.0; } longlong val_int() { diff --git a/sql/procedure.h b/sql/procedure.h index 5365b2e1102..abe50bdc0a0 100644 --- a/sql/procedure.h +++ b/sql/procedure.h @@ -59,7 +59,11 @@ public: void set(double nr) { value=nr; } void set(longlong nr) { value=(double) nr; } void set(const char *str,uint length,CHARSET_INFO *cs) - { int err; value=my_strntod(cs,(char*) str,length,(char**)0,&err); } + { + int err; + char *end_not_used; + value= my_strntod(cs, (char*) str, length, &end_not_used, &err); + } double val() { return value; } longlong val_int() { return (longlong) value; } String *val_str(String *s) { s->set(value,decimals,default_charset()); return s; } @@ -99,9 +103,10 @@ public: double val() { int err; - CHARSET_INFO *cs=str_value.charset(); + CHARSET_INFO *cs= str_value.charset(); + char *end_not_used; return my_strntod(cs, (char*) str_value.ptr(), str_value.length(), - (char**) 0, &err); + &end_not_used, &err); } longlong val_int() { diff --git a/strings/ctype-simple.c b/strings/ctype-simple.c index 1a09b16a264..c2a6aa4e17f 100644 --- a/strings/ctype-simple.c +++ b/strings/ctype-simple.c @@ -773,31 +773,10 @@ double my_strntod_8bit(CHARSET_INFO *cs __attribute__((unused)), char *str, uint length, char **end, int *err) { - char end_char; - double result; - - errno= 0; /* Safety */ - - /* - The following define is to avoid warnings from valgrind as str[length] - may not be defined (which is not fatal in real life) - */ - -#ifdef HAVE_purify if (length == INT_MAX32) -#else - if (length == INT_MAX32 || str[length] == 0) -#endif - result= my_strtod(str, end); - else - { - end_char= str[length]; - str[length]= 0; - result= my_strtod(str, end); - str[length]= end_char; /* Restore end char */ - } - *err= errno; - return result; + length= 65535; /* Should be big enough */ + *end= str + length; + return my_strtod(str, end, err); } diff --git a/strings/ctype-ucs2.c b/strings/ctype-ucs2.c index e92704b83d7..9c67d1b7846 100644 --- a/strings/ctype-ucs2.c +++ b/strings/ctype-ucs2.c @@ -946,13 +946,10 @@ double my_strntod_ucs2(CHARSET_INFO *cs __attribute__((unused)), break; /* Can't be part of double */ *b++= (char) wc; } - *b= 0; - errno= 0; - res=my_strtod(buf, endptr); - *err= errno; - if (endptr) - *endptr=(char*) (*endptr-buf+nptr); + *endptr= b; + res= my_strtod(buf, endptr, err); + *endptr= nptr + (uint) (*endptr- buf); return res; } diff --git a/strings/strtod.c b/strings/strtod.c index bc8105b8040..61f2c107abe 100644 --- a/strings/strtod.c +++ b/strings/strtod.c @@ -2,7 +2,7 @@ An alternative implementation of "strtod()" that is both simplier, and thread-safe. - From mit-threads as bundled with MySQL 3.23 + Original code from mit-threads as bundled with MySQL 3.23 SQL:2003 specifies a number as @@ -29,6 +29,8 @@ #include "my_base.h" /* Includes errno.h */ #include "m_ctype.h" +#define MAX_DBL_EXP 308 +#define MAX_RESULT_FOR_MAX_EXP 1.79769313486232 static double scaler10[] = { 1.0, 1e10, 1e20, 1e30, 1e40, 1e50, 1e60, 1e70, 1e80, 1e90 }; @@ -37,89 +39,157 @@ static double scaler1[] = { }; -double my_strtod(const char *str, char **end) +/* + Convert string to double (string doesn't have to be null terminated) + + SYNOPSIS + my_strtod() + str String to convert + end_ptr Pointer to pointer that points to end of string + Will be updated to point to end of double. + error Will contain error number in case of error (else 0) + + RETURN + value of str as double +*/ + +double my_strtod(const char *str, char **end_ptr, int *error) { double result= 0.0; - int negative, ndigits; - const char *old_str; + uint negative= 0, ndigits, dec_digits= 0, neg_exp= 0; + int exp= 0, digits_after_dec_point= 0; + const char *old_str, *end= *end_ptr, *start_of_number; + char next_char; my_bool overflow=0; - while (my_isspace(&my_charset_latin1, *str)) - str++; + *error= 0; + if (str >= end) + goto done; + while (my_isspace(&my_charset_latin1, *str)) + { + if (++str == end) + goto done; + } + + start_of_number= str; if ((negative= (*str == '-')) || *str=='+') - str++; + { + if (++str == end) + goto done; /* Could be changed to error */ + } + + /* Skip pre-zero for easier calculation of overflows */ + while (*str == '0') + { + if (++str == end) + goto done; + start_of_number= 0; /* Found digit */ + } old_str= str; - while (my_isdigit (&my_charset_latin1, *str)) + while ((next_char= *str) >= '0' && next_char <= '9') { - result= result*10.0 + (*str - '0'); - str++; - } - ndigits= str-old_str; - - if (*str == '.') - { - double p10=10; - str++; - old_str= str; - while (my_isdigit (&my_charset_latin1, *str)) + result= result*10.0 + (next_char - '0'); + if (++str == end) { - result+= (*str++ - '0')/p10; - p10*=10; + next_char= 0; /* Found end of string */ + break; } - ndigits+= str-old_str; - if (!ndigits) str--; + start_of_number= 0; /* Found digit */ } - if (ndigits && (*str=='e' || *str=='E')) + ndigits= (uint) (str-old_str); + + if (next_char == '.' && str < end-1) + { + /* + Continue to add numbers after decimal point to the result, as if there + was no decimal point. We will later (in the exponent handling) shift + the number down with the required number of fractions. We do it this + way to be able to get maximum precision for numbers like 123.45E+02, + which are normal for some ODBC applications. + */ + old_str= ++str; + while (my_isdigit(&my_charset_latin1, (next_char= *str))) + { + result= result*10.0 + (next_char - '0'); + digits_after_dec_point++; + if (++str == end) + { + next_char= 0; + break; + } + } + /* If we found just '+.' or '.' then point at first character */ + if (!(dec_digits= (uint) (str-old_str)) && start_of_number) + str= start_of_number; /* Point at '+' or '.' */ + } + if ((next_char == 'e' || next_char == 'E') && + dec_digits + ndigits != 0 && str < end-1) { - int exp= 0; - int neg= 0; const char *old_str= str++; - if ((neg= (*str == '-')) || *str == '+') + if ((neg_exp= (*str == '-')) || *str == '+') str++; - if (!my_isdigit (&my_charset_latin1, *str)) + if (str == end || !my_isdigit(&my_charset_latin1, *str)) str= old_str; else { - double scaler= 1.0; - while (my_isdigit (&my_charset_latin1, *str)) + do { - if (exp < 9999) /* protection against exp overflow */ - exp= exp*10 + *str - '0'; + if (exp < 9999) /* prot. against exp overfl. */ + exp= exp*10 + (*str - '0'); str++; - } - if (exp >= 1000) + } while (str < end && my_isdigit(&my_charset_latin1, *str)); + } + } + if ((exp= (neg_exp ? exp + digits_after_dec_point : + exp - digits_after_dec_point))) + { + double scaler; + if (exp < 0) + { + exp= -exp; + neg_exp= 1; /* neg_exp was 0 before */ + } + if (exp + ndigits >= MAX_DBL_EXP + 1 && result) + { + /* + This is not 100 % as we actually will give an owerflow for + 17E307 but not for 1.7E308 but lets cut some corners to make life + simpler + */ + if (exp + ndigits > MAX_DBL_EXP + 1 || + result >= MAX_RESULT_FOR_MAX_EXP) { - if (neg) - result= 0.0; - else + if (neg_exp) + result= 0.0; + else overflow= 1; goto done; } - while (exp >= 100) - { - scaler*= 1.0e100; - exp-= 100; - } - scaler*= scaler10[exp/10]*scaler1[exp%10]; - if (neg) - result/= scaler; - else - result*= scaler; } + scaler= 1.0; + while (exp >= 100) + { + scaler*= 1.0e100; + exp-= 100; + } + scaler*= scaler10[exp/10]*scaler1[exp%10]; + if (neg_exp) + result/= scaler; + else + result*= scaler; } done: - if (end) - *end = (char *)str; + *end_ptr= (char*) str; /* end of number */ if (overflow || isinf(result)) { result= DBL_MAX; - errno= EOVERFLOW; + *error= EOVERFLOW; } return negative ? -result : result; @@ -127,6 +197,7 @@ done: double my_atof(const char *nptr) { - return (my_strtod(nptr, 0)); + int error; + const char *end= nptr+65535; /* Should be enough */ + return (my_strtod(nptr, (char**) &end, &error)); } - From bf88db5c2036f6194d710a3a2faca7ab6fb4a77b Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 22 Feb 2005 12:15:27 +0100 Subject: [PATCH 1043/1063] wl1292 - ndb autotest - fix html reporting bug ndb/test/run-test/ndb-autotest.sh: use correct path when packing result tar ball --- ndb/test/run-test/ndb-autotest.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ndb/test/run-test/ndb-autotest.sh b/ndb/test/run-test/ndb-autotest.sh index 039f1bf914e..397df97d52f 100755 --- a/ndb/test/run-test/ndb-autotest.sh +++ b/ndb/test/run-test/ndb-autotest.sh @@ -182,8 +182,10 @@ start(){ [ "`find . -name 'result*'`" ] && mv result* $3 cd $3 sh $html . $1 $DATE - cd ../.. - tar cvz /tmp/res.$$.tgz `basename $3`/$DATE + cd .. + p2=`pwd` + cd .. + tar cfz /tmp/res.$$.tgz `basename $p2`/$DATE scp /tmp/res.$$.tgz $result_host:$result_path ssh $result_host "cd $result_path && tar xfz res.$$.tgz && rm -f res.$$.tgz" rm -f /tmp/res.$$.tgz From 7d766fdbeb1418488f99125b510dce5942b7f79f Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 22 Feb 2005 12:40:31 +0100 Subject: [PATCH 1044/1063] BUG#6662: Changes after Guilhems and Sergs review --- client/mysqldump.c | 7 +++---- mysql-test/r/mysqldump.result | 18 ++++++++++++++++++ sql/mysql_priv.h | 4 ++-- sql/mysqld.cc | 2 +- sql/set_var.cc | 4 +++- sql/sql_error.cc | 2 +- 6 files changed, 28 insertions(+), 9 deletions(-) diff --git a/client/mysqldump.c b/client/mysqldump.c index 2a6d9adf8bd..c2c44024cf4 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -489,11 +489,10 @@ static void write_header(FILE *sql_file, char *db_name) "); } fprintf(sql_file, - "/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='%s%s%s' */;\n", + "/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='%s%s%s' */;\n" + "/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;\n", path?"":"NO_AUTO_VALUE_ON_ZERO",compatible_mode_normal_str[0]==0?"":",", compatible_mode_normal_str); - fprintf(sql_file, - "/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;\n"); check_io(sql_file); } } /* write_header */ @@ -521,7 +520,7 @@ static void write_footer(FILE *sql_file) "/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;\n" "/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;\n"); fprintf(sql_file, - "/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;"); + "/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;\n"); fputs("\n", sql_file); check_io(sql_file); } diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index 754d1458eac..f763a16836f 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -82,6 +82,7 @@ UNLOCK TABLES; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; @@ -97,6 +98,7 @@ INSERT INTO `t1` VALUES ('1.23450',2.3456),('1.23450',2.3456),('1.23450',2.3456) /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + DROP TABLE t1; CREATE TABLE t1(a int, b text, c varchar(3)); INSERT INTO t1 VALUES (1, "test", "tes"), (2, "TEST", "TES"); @@ -173,6 +175,7 @@ UNLOCK TABLES; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + DROP TABLE t1; CREATE TABLE t1 (a int) ENGINE=MYISAM; INSERT INTO t1 VALUES (1), (2); @@ -196,6 +199,7 @@ UNLOCK TABLES; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL323' */; @@ -216,6 +220,7 @@ UNLOCK TABLES; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + DROP TABLE t1; create table ```a` (i int); CREATE TABLE ```a` ( @@ -250,6 +255,7 @@ UNLOCK TABLES; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,ANSI' */; @@ -269,6 +275,7 @@ UNLOCK TABLES; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + set global sql_mode='ANSI_QUOTES'; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; @@ -297,6 +304,7 @@ UNLOCK TABLES; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,ANSI' */; @@ -316,6 +324,7 @@ UNLOCK TABLES; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + set global sql_mode=''; drop table t1; create table t1(a int); @@ -338,6 +347,7 @@ CREATE TABLE `t1` ( /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + 1 2 3 @@ -363,6 +373,7 @@ USE `test`; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + create database mysqldump_test_db character set latin2 collate latin2_bin; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; @@ -385,6 +396,7 @@ USE `mysqldump_test_db`; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + drop database mysqldump_test_db; CREATE TABLE t1 (a CHAR(10)); INSERT INTO t1 VALUES (_latin1 'ÄÖÜß'); @@ -416,6 +428,7 @@ UNLOCK TABLES; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL323' */; @@ -436,6 +449,7 @@ UNLOCK TABLES; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL323' */; @@ -456,6 +470,7 @@ UNLOCK TABLES; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL323' */; @@ -476,6 +491,7 @@ UNLOCK TABLES; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO,MYSQL323' */; @@ -496,6 +512,7 @@ UNLOCK TABLES; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + DROP TABLE t1; CREATE TABLE t1 (a int); CREATE TABLE t2 (a int); @@ -529,5 +546,6 @@ UNLOCK TABLES; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + DROP TABLE t1; DROP TABLE t2; diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 3cb5eba8efa..3f7262283b4 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -213,8 +213,8 @@ extern CHARSET_INFO *national_charset_info, *table_alias_charset; #define SELECT_NO_UNLOCK (1L << 28) /* If set to 0, then the thread will ignore all warnings with level notes. - Set by executing SET SHOW_NOTES=1 */ -#define OPTION_NOTES (1L << 31) + Set by executing SET SQL_NOTES=1 */ +#define OPTION_SQL_NOTES (1L << 31) /* Bits for different SQL modes modes (including ANSI mode) */ #define MODE_REAL_AS_FLOAT 1 diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 3e4d0593a85..fd3c26c6175 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -5623,7 +5623,7 @@ static void mysql_init_variables(void) mysql_data_home= mysql_real_data_home; thd_startup_options= (OPTION_UPDATE_LOG | OPTION_AUTO_IS_NULL | OPTION_BIN_LOG | OPTION_QUOTE_SHOW_CREATE | - OPTION_NOTES); + OPTION_SQL_NOTES); protocol_version= PROTOCOL_VERSION; what_to_log= ~ (1L << (uint) COM_TIME); refresh_version= flush_version= 1L; /* Increments on each reload */ diff --git a/sql/set_var.cc b/sql/set_var.cc index 00ab4658f30..5fdb3de3178 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -425,7 +425,7 @@ static sys_var_thd_bit sys_sql_warnings("sql_warnings", 0, OPTION_WARNINGS); static sys_var_thd_bit sys_sql_notes("sql_notes", 0, set_option_bit, - OPTION_NOTES); + OPTION_SQL_NOTES); static sys_var_thd_bit sys_auto_is_null("sql_auto_is_null", 0, set_option_bit, OPTION_AUTO_IS_NULL); @@ -863,6 +863,8 @@ struct show_var_st init_vars[]= { {sys_sort_buffer.name, (char*) &sys_sort_buffer, SHOW_SYS}, {sys_sql_mode.name, (char*) &sys_sql_mode, SHOW_SYS}, {sys_storage_engine.name, (char*) &sys_storage_engine, SHOW_SYS}, + {"sql_notes", (char*) &sys_sql_notes, SHOW_BOOL}, + {"sql_warnings", (char*) &sys_sql_warnings, SHOW_BOOL}, #ifdef HAVE_REPLICATION {sys_sync_binlog_period.name,(char*) &sys_sync_binlog_period, SHOW_SYS}, {sys_sync_replication.name, (char*) &sys_sync_replication, SHOW_SYS}, diff --git a/sql/sql_error.cc b/sql/sql_error.cc index e04c2843c93..d19e9fbdb09 100644 --- a/sql/sql_error.cc +++ b/sql/sql_error.cc @@ -105,7 +105,7 @@ MYSQL_ERROR *push_warning(THD *thd, MYSQL_ERROR::enum_warning_level level, MYSQL_ERROR *err= 0; DBUG_ENTER("push_warning"); - if (level == MYSQL_ERROR::WARN_LEVEL_NOTE && !(thd->options & OPTION_NOTES)) + if (level == MYSQL_ERROR::WARN_LEVEL_NOTE && !(thd->options & OPTION_SQL_NOTES)) return(0); if (thd->query_id != thd->warn_id) From 2fb807d1d0a817c177e02cee7b508b6122ce832e Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 22 Feb 2005 15:55:40 +0400 Subject: [PATCH 1045/1063] A user variable are now always have IMPLICIT coercibility, independently from the expression it is initialized from. In other words, this change treats a user variable like a table with one column and one record. Discussed with PeterG, Serg and Lars. This change also simplifies replication allowing not to replicate variables' coercibility. mysql-test/r/user_var.result: Test changes accordintly mysql-test/t/user_var.test: Test changes accordintly --- mysql-test/r/user_var.result | 16 +++++++++------- mysql-test/t/user_var.test | 2 -- sql/item_func.cc | 10 +++++----- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/mysql-test/r/user_var.result b/mysql-test/r/user_var.result index 81846391795..d82c17b0fe0 100644 --- a/mysql-test/r/user_var.result +++ b/mysql-test/r/user_var.result @@ -123,7 +123,7 @@ drop table t1; set @a=_latin2'test'; select charset(@a),collation(@a),coercibility(@a); charset(@a) collation(@a) coercibility(@a) -latin2 latin2_general_ci 3 +latin2 latin2_general_ci 2 select @a=_latin2'TEST'; @a=_latin2'TEST' 1 @@ -133,12 +133,13 @@ select @a=_latin2'TEST' collate latin2_bin; set @a=_latin2'test' collate latin2_general_ci; select charset(@a),collation(@a),coercibility(@a); charset(@a) collation(@a) coercibility(@a) -latin2 latin2_general_ci 0 +latin2 latin2_general_ci 2 select @a=_latin2'TEST'; @a=_latin2'TEST' 1 select @a=_latin2'TEST' collate latin2_bin; -ERROR HY000: Illegal mix of collations (latin2_general_ci,EXPLICIT) and (latin2_bin,EXPLICIT) for operation '=' +@a=_latin2'TEST' collate latin2_bin +0 select charset(@a:=_latin2'test'); charset(@a:=_latin2'test') latin2 @@ -147,21 +148,22 @@ collation(@a:=_latin2'test') latin2_general_ci select coercibility(@a:=_latin2'test'); coercibility(@a:=_latin2'test') -3 +2 select collation(@a:=_latin2'test' collate latin2_bin); collation(@a:=_latin2'test' collate latin2_bin) latin2_bin select coercibility(@a:=_latin2'test' collate latin2_bin); coercibility(@a:=_latin2'test' collate latin2_bin) -0 +2 select (@a:=_latin2'test' collate latin2_bin) = _latin2'TEST'; (@a:=_latin2'test' collate latin2_bin) = _latin2'TEST' 0 select charset(@a),collation(@a),coercibility(@a); charset(@a) collation(@a) coercibility(@a) -latin2 latin2_bin 0 +latin2 latin2_bin 2 select (@a:=_latin2'test' collate latin2_bin) = _latin2'TEST' collate latin2_general_ci; -ERROR HY000: Illegal mix of collations (latin2_bin,EXPLICIT) and (latin2_general_ci,EXPLICIT) for operation '=' +(@a:=_latin2'test' collate latin2_bin) = _latin2'TEST' collate latin2_general_ci +1 create table t1 (a varchar(50)); reset master; SET TIMESTAMP=10000; diff --git a/mysql-test/t/user_var.test b/mysql-test/t/user_var.test index 81788ce8d73..2f526dc9a46 100644 --- a/mysql-test/t/user_var.test +++ b/mysql-test/t/user_var.test @@ -84,7 +84,6 @@ select @a=_latin2'TEST' collate latin2_bin; set @a=_latin2'test' collate latin2_general_ci; select charset(@a),collation(@a),coercibility(@a); select @a=_latin2'TEST'; ---error 1267 select @a=_latin2'TEST' collate latin2_bin; # @@ -97,7 +96,6 @@ select collation(@a:=_latin2'test' collate latin2_bin); select coercibility(@a:=_latin2'test' collate latin2_bin); select (@a:=_latin2'test' collate latin2_bin) = _latin2'TEST'; select charset(@a),collation(@a),coercibility(@a); ---error 1267 select (@a:=_latin2'test' collate latin2_bin) = _latin2'TEST' collate latin2_general_ci; # Check that user variables are binlogged correctly (BUG#3875) diff --git a/sql/item_func.cc b/sql/item_func.cc index 34c8732a9f2..895740d2e5e 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -2361,7 +2361,7 @@ static user_var_entry *get_variable(HASH *hash, LEX_STRING &name, entry->value=0; entry->length=0; entry->update_query_id=0; - entry->collation.set(NULL, DERIVATION_NONE); + entry->collation.set(NULL, DERIVATION_IMPLICIT); /* If we are here, we were called from a SET or a query which sets a variable. Imagine it is this: @@ -2419,8 +2419,8 @@ bool Item_func_set_user_var::fix_fields(THD *thd, TABLE_LIST *tables, and the variable has previously been initialized. */ if (!entry->collation.collation || !args[0]->null_value) - entry->collation.set(args[0]->collation); - collation.set(entry->collation); + entry->collation.set(args[0]->collation.collation, DERIVATION_IMPLICIT); + collation.set(entry->collation.collation, DERIVATION_IMPLICIT); cached_result_type= args[0]->result_type(); return 0; } @@ -2432,7 +2432,7 @@ Item_func_set_user_var::fix_length_and_dec() maybe_null=args[0]->maybe_null; max_length=args[0]->max_length; decimals=args[0]->decimals; - collation.set(args[0]->collation); + collation.set(args[0]->collation.collation, DERIVATION_IMPLICIT); } @@ -2659,7 +2659,7 @@ Item_func_set_user_var::update() res= update_hash((void*) save_result.vstr->ptr(), save_result.vstr->length(), STRING_RESULT, save_result.vstr->charset(), - args[0]->collation.derivation); + DERIVATION_IMPLICIT); break; } case ROW_RESULT: From 209b24473cd04a16d1cc548f5e7d0a5f1ebfefe2 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 22 Feb 2005 16:37:25 +0400 Subject: [PATCH 1046/1063] Bug#8349 myisamchk: --set-charset does not work What we need to be able to set in myisamchk is actually a collation, not a character set. This fix just changes to display the proper error message. include/mysys_err.h: New mysys error message "unknown collation". mysys/charset.c: Display more proper error when a collation is not found. mysys/errors.c: New "unknown collation" error. --- include/mysys_err.h | 3 ++- myisam/myisamchk.c | 24 +++++++++++++----------- mysys/charset.c | 2 +- mysys/errors.c | 2 ++ 4 files changed, 18 insertions(+), 13 deletions(-) diff --git a/include/mysys_err.h b/include/mysys_err.h index 230be5f4720..19106dc3553 100644 --- a/include/mysys_err.h +++ b/include/mysys_err.h @@ -21,7 +21,7 @@ extern "C" { #endif #define GLOB 0 /* Error maps */ -#define GLOBERRS 28 /* Max number of error messages in map's */ +#define GLOBERRS 29 /* Max number of error messages in map's */ #define EE(X) globerrs[ X ] /* Defines to add error to right map */ extern const char * NEAR globerrs[]; /* my_error_messages is here */ @@ -54,6 +54,7 @@ extern const char * NEAR globerrs[]; /* my_error_messages is here */ #define EE_CANT_SYMLINK 25 #define EE_REALPATH 26 #define EE_SYNC 27 +#define EE_UNKNOWN_COLLATION 28 /* exit codes for all MySQL programs */ diff --git a/myisam/myisamchk.c b/myisam/myisamchk.c index c89abca9cad..21b56669ea6 100644 --- a/myisam/myisamchk.c +++ b/myisam/myisamchk.c @@ -41,8 +41,8 @@ SET_STACK_SIZE(9000) /* Minimum stack size for program */ static uint decode_bits; static char **default_argv; static const char *load_default_groups[]= { "myisamchk", 0 }; -static const char *set_charset_name, *opt_tmpdir; -static CHARSET_INFO *set_charset; +static const char *set_collation_name, *opt_tmpdir; +static CHARSET_INFO *set_collation; static long opt_myisam_block_size; static long opt_key_cache_block_size; static const char *my_progname_short; @@ -149,7 +149,7 @@ int main(int argc, char **argv) } /* main */ enum options_mc { - OPT_CHARSETS_DIR=256, OPT_SET_CHARSET,OPT_START_CHECK_POS, + OPT_CHARSETS_DIR=256, OPT_SET_COLLATION,OPT_START_CHECK_POS, OPT_CORRECT_CHECKSUM, OPT_KEY_BUFFER_SIZE, OPT_KEY_CACHE_BLOCK_SIZE, OPT_MYISAM_BLOCK_SIZE, OPT_READ_BUFFER_SIZE, OPT_WRITE_BUFFER_SIZE, OPT_SORT_BUFFER_SIZE, @@ -252,9 +252,9 @@ static struct my_option my_long_options[] = (gptr*) &check_param.auto_increment_value, (gptr*) &check_param.auto_increment_value, 0, GET_ULL, OPT_ARG, 0, 0, 0, 0, 0, 0}, - {"set-character-set", OPT_SET_CHARSET, - "Change the character set used by the index", - (gptr*) &set_charset_name, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"set-collation", OPT_SET_COLLATION, + "Change the collation used by the index", + (gptr*) &set_collation_name, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"set-variable", 'O', "Change the value of a variable. Please note that this option is deprecated; you can set variables directly with --variable-name=value.", 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, @@ -739,8 +739,9 @@ static void get_options(register int *argc,register char ***argv) check_param.tmpdir=&myisamchk_tmpdir; check_param.key_cache_block_size= opt_key_cache_block_size; - if (set_charset_name) - if (!(set_charset=get_charset_by_name(set_charset_name, MYF(MY_WME)))) + if (set_collation_name) + if (!(set_collation= get_charset_by_name(set_collation_name, + MYF(MY_WME)))) exit(1); myisam_block_size=(uint) 1 << my_bit_log2(opt_myisam_block_size); @@ -874,11 +875,12 @@ static int myisamchk(MI_CHECK *param, my_string filename) (((ulonglong) 1L << share->base.keys)-1)) || test_if_almost_full(info) || info->s->state.header.file_version[3] != myisam_file_magic[3] || - (set_charset && set_charset->number != share->state.header.language) || + (set_collation && + set_collation->number != share->state.header.language) || myisam_block_size != MI_KEY_BLOCK_LENGTH)) { - if (set_charset) - param->language=set_charset->number; + if (set_collation) + param->language= set_collation->number; if (recreate_table(param, &info,filename)) { VOID(fprintf(stderr, diff --git a/mysys/charset.c b/mysys/charset.c index 5840c885e40..4b7ad3e59f4 100644 --- a/mysys/charset.c +++ b/mysys/charset.c @@ -530,7 +530,7 @@ CHARSET_INFO *get_charset_by_name(const char *cs_name, myf flags) { char index_file[FN_REFLEN]; strmov(get_charsets_dir(index_file),MY_CHARSET_INDEX); - my_error(EE_UNKNOWN_CHARSET, MYF(ME_BELL), cs_name, index_file); + my_error(EE_UNKNOWN_COLLATION, MYF(ME_BELL), cs_name, index_file); } return cs; diff --git a/mysys/errors.c b/mysys/errors.c index 5401c2b3cc6..05436c9a212 100644 --- a/mysys/errors.c +++ b/mysys/errors.c @@ -49,6 +49,7 @@ const char * NEAR globerrs[GLOBERRS]= "Can't create symlink '%s' pointing at '%s' (Error %d)", "Error on realpath() on '%s' (Error %d)", "Can't sync file '%s' to disk (Errcode: %d)", + "Collation '%s' is not a compiled collation and is not specified in the '%s' file", }; void init_glob_errs(void) @@ -89,5 +90,6 @@ void init_glob_errs() EE(EE_CANT_SYMLINK)= "Can't create symlink '%s' pointing at '%s' (Error %d)"; EE(EE_REALPATH)= "Error on realpath() on '%s' (Error %d)"; EE(EE_SYNC)= "Can't sync file '%s' to disk (Errcode: %d)"; + EE(EE_UNKNOWN_COLLATION)= "Collation '%s' is not a compiled collation and is not specified in the %s file"; } #endif From 2ae6eb094bb02a3e41ab611c9e9f27982a2ef9c3 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 22 Feb 2005 15:08:12 +0200 Subject: [PATCH 1047/1063] Fix errors in my last changeset --- libmysql/libmysql.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index 9c49c7eb15b..16dda115ee9 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -3390,14 +3390,17 @@ static void fetch_string_with_conversion(MYSQL_BIND *param, char *value, } case MYSQL_TYPE_FLOAT: { + char *end_not_used; float data = (float) my_strntod(&my_charset_latin1, value, length, - NULL, &err); + &end_not_used, &err); floatstore(buffer, data); break; } case MYSQL_TYPE_DOUBLE: { - double data= my_strntod(&my_charset_latin1, value, length, NULL, &err); + char *end_not_used; + double data= my_strntod(&my_charset_latin1, value, length, &end_not_used, + &err); doublestore(buffer, data); break; } From d9f6581f259d859c3b87cd1b93481b10a2c47011 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 22 Feb 2005 21:05:17 +0200 Subject: [PATCH 1048/1063] row0sel.c: Fix bug #8677: if one used LOCK TABLES, created an InnoDB temp table, and did a multi-table update where a MyISAM table was the update table and the temp table was a read table, then InnoDB aserted in row0sel.c because n_mysql_tables_in_use was 0. Also, we remove the assertion altogether and just print an error to the .err log if this important consistency check fails. Then it is up to the user to read the .err log and notice the problem if there still are errors in MySQL's table locking. innobase/row/row0sel.c: Fix bug #8677: if one used LOCK TABLES, created an InnoDB temp table, and did a multi-table update where a MyISAM table was the update table and the temp table was a read table, then InnoDB aserted in row0sel.c because n_mysql_tables_in_use was 0. Also, we remove the assertion altogether and just print an error to the .err log if this important consistency check fails. Then it is up to the user to read the .err log and notice the problem if there still are errors in MySQL's table locking. --- innobase/row/row0sel.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/innobase/row/row0sel.c b/innobase/row/row0sel.c index 52228caccb0..2de02081176 100644 --- a/innobase/row/row0sel.c +++ b/innobase/row/row0sel.c @@ -2912,14 +2912,19 @@ row_search_for_mysql( ut_error; } - if (trx->n_mysql_tables_in_use == 0) { + if (trx->n_mysql_tables_in_use == 0 + && prebuilt->select_lock_type == LOCK_NONE) { + /* Note that if MySQL uses an InnoDB temp table that it + created inside LOCK TABLES, then n_mysql_tables_in_use can + be zero; in that case select_lock_type is set to LOCK_X in + ::start_stmt. */ + fputs( "InnoDB: Error: MySQL is trying to perform a SELECT\n" "InnoDB: but it has not locked any tables in ::external_lock()!\n", stderr); trx_print(stderr, trx); fputc('\n', stderr); - ut_a(0); } /* fprintf(stderr, "Match mode %lu\n search tuple ", (ulong) match_mode); From e1d76d166304c96b8f35fc782aafd374a42bc8c5 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 23 Feb 2005 10:12:26 +0100 Subject: [PATCH 1049/1063] removed printout "- Repeated 1 times" make sure transporter connections are close early in shutdown ndb/src/common/logger/LogHandler.cpp: removed printout "- Repeated 1 times" ndb/src/kernel/main.cpp: make sure transporter connections are close early in shutdown ndb/src/kernel/vm/Emulator.cpp: make sure transporter connections are close early in shutdown ndb/src/kernel/vm/Emulator.hpp: make sure transporter connections are close early in shutdown --- ndb/src/common/logger/LogHandler.cpp | 4 ++-- ndb/src/kernel/main.cpp | 11 ++--------- ndb/src/kernel/vm/Emulator.cpp | 18 +++++++++++++++++- ndb/src/kernel/vm/Emulator.hpp | 3 ++- 4 files changed, 23 insertions(+), 13 deletions(-) diff --git a/ndb/src/common/logger/LogHandler.cpp b/ndb/src/common/logger/LogHandler.cpp index e038b05401e..ec4137297f1 100644 --- a/ndb/src/common/logger/LogHandler.cpp +++ b/ndb/src/common/logger/LogHandler.cpp @@ -76,15 +76,15 @@ LogHandler::append_impl(const char* pCategory, Logger::LoggerLevel level, const char* pMsg) { writeHeader(pCategory, level); - if (m_count_repeated_messages == 0) + if (m_count_repeated_messages <= 1) writeMessage(pMsg); else { BaseString str(pMsg); str.appfmt(" - Repeated %d times", m_count_repeated_messages); writeMessage(str.c_str()); - m_count_repeated_messages= 0; } + m_count_repeated_messages= 0; writeFooter(); } diff --git a/ndb/src/kernel/main.cpp b/ndb/src/kernel/main.cpp index 448bdd9a1fa..e6e0a7ca877 100644 --- a/ndb/src/kernel/main.cpp +++ b/ndb/src/kernel/main.cpp @@ -180,11 +180,9 @@ int main(int argc, char** argv) assert("Illegal state globalData.theRestartFlag" == 0); } - SocketServer socket_server; - globalTransporterRegistry.startSending(); globalTransporterRegistry.startReceiving(); - if (!globalTransporterRegistry.start_service(socket_server)){ + if (!globalTransporterRegistry.start_service(*globalEmulatorData.m_socket_server)){ ndbout_c("globalTransporterRegistry.start_service() failed"); exit(-1); } @@ -196,7 +194,7 @@ int main(int argc, char** argv) globalEmulatorData.theWatchDog->doStart(); - socket_server.startServer(); + globalEmulatorData.m_socket_server->startServer(); // theConfig->closeConfiguration(); @@ -204,11 +202,6 @@ int main(int argc, char** argv) NdbShutdown(NST_Normal); - socket_server.stopServer(); - socket_server.stopSessions(); - - globalTransporterRegistry.stop_clients(); - return NRT_Default; } diff --git a/ndb/src/kernel/vm/Emulator.cpp b/ndb/src/kernel/vm/Emulator.cpp index 068610b6778..d6ed6c0dafd 100644 --- a/ndb/src/kernel/vm/Emulator.cpp +++ b/ndb/src/kernel/vm/Emulator.cpp @@ -68,6 +68,7 @@ EmulatorData::EmulatorData(){ theThreadConfig = 0; theSimBlockList = 0; theShutdownMutex = 0; + m_socket_server = 0; } void @@ -83,6 +84,7 @@ EmulatorData::create(){ theWatchDog = new WatchDog(); theThreadConfig = new ThreadConfig(); theSimBlockList = new SimBlockList(); + m_socket_server = new SocketServer(); theShutdownMutex = NdbMutex_Create(); @@ -99,7 +101,8 @@ EmulatorData::destroy(){ delete theThreadConfig; theThreadConfig = 0; if(theSimBlockList) delete theSimBlockList; theSimBlockList = 0; - + if(m_socket_server) + delete m_socket_server; m_socket_server = 0; NdbMem_Destroy(); } @@ -195,9 +198,22 @@ NdbShutdown(NdbShutdownType type, fclose(outputStream); #endif + /** + * Stop all transporter connection attempts and accepts + */ + globalEmulatorData.m_socket_server->stopServer(); + globalEmulatorData.m_socket_server->stopSessions(); + globalTransporterRegistry.stop_clients(); + + /** + * Stop transporter communication with other nodes + */ globalTransporterRegistry.stopSending(); globalTransporterRegistry.stopReceiving(); + /** + * Remove all transporters + */ globalTransporterRegistry.removeAll(); #ifdef VM_TRACE diff --git a/ndb/src/kernel/vm/Emulator.hpp b/ndb/src/kernel/vm/Emulator.hpp index b3c64830802..dba8cb3ab9b 100644 --- a/ndb/src/kernel/vm/Emulator.hpp +++ b/ndb/src/kernel/vm/Emulator.hpp @@ -55,7 +55,8 @@ struct EmulatorData { class WatchDog * theWatchDog; class ThreadConfig * theThreadConfig; class SimBlockList * theSimBlockList; - + class SocketServer * m_socket_server; + /** * Constructor * From 990d937de254cc1c92cb45e3866fff414d2bdd7e Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 23 Feb 2005 16:28:10 +0400 Subject: [PATCH 1050/1063] config-win.h: Activate Unicode collations in Windows version. include/config-win.h: Activate Unicode collations in Windows version. --- include/config-win.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/config-win.h b/include/config-win.h index 66a441ec339..472190e53ca 100644 --- a/include/config-win.h +++ b/include/config-win.h @@ -402,4 +402,5 @@ inline double ulonglong2double(ulonglong value) #define HAVE_CHARSET_ucs2 1 #define HAVE_CHARSET_ujis 1 #define HAVE_CHARSET_utf8 1 +#define HAVE_UCA_COLLATIONS 1 From f443992e66f6eb32a0b841a3005f44f5ad77faff Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 23 Feb 2005 18:15:45 +0300 Subject: [PATCH 1051/1063] Fix for bug#6317: string function CHAR, parameter is NULL, wrong result --- mysql-test/r/func_str.result | 6 ++++++ mysql-test/t/func_str.test | 6 ++++++ sql/item_strfunc.cc | 2 ++ 3 files changed, 14 insertions(+) diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result index 88b1a5ea743..f238915d3b9 100644 --- a/mysql-test/r/func_str.result +++ b/mysql-test/r/func_str.result @@ -733,3 +733,9 @@ WHERE a = CONV('e251273eb74a8ee3', 16, 10); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 system NULL NULL NULL NULL 1 DROP TABLE t1; +SELECT CHAR(NULL,121,83,81,'76') as my_column; +my_column +ySQL +SELECT CHAR_LENGTH(CHAR(NULL,121,83,81,'76')) as my_column; +my_column +4 diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test index 6d5974ca5ed..b1f144cbca2 100644 --- a/mysql-test/t/func_str.test +++ b/mysql-test/t/func_str.test @@ -476,3 +476,9 @@ EXPLAIN WHERE a = CONV('e251273eb74a8ee3', 16, 10); DROP TABLE t1; + +# +# Bug #6317: string function CHAR, parameter is NULL, wrong result +# +SELECT CHAR(NULL,121,83,81,'76') as my_column; +SELECT CHAR_LENGTH(CHAR(NULL,121,83,81,'76')) as my_column; diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 8bd1da4e15f..0023d7b1f20 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -1868,6 +1868,7 @@ String *Item_func_char::val_str(String *str) { int32 num=(int32) args[i]->val_int(); if (!args[i]->null_value) + { #ifdef USE_MB if (use_mb(collation.collation)) { @@ -1883,6 +1884,7 @@ b1: str->append((char)(num>>8)); } #endif str->append((char)num); + } } str->set_charset(collation.collation); str->realloc(str->length()); // Add end 0 (for Purify) From 5941f19bbdf1d321dcdab5adff857be486387d30 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 23 Feb 2005 17:38:51 +0100 Subject: [PATCH 1052/1063] FIx for BUG#8682 "flush_block_commit test hangs on HPUX": start_waiting_global_read_lock() should wake up all those who are waiting for protect_against_global_read_lock to go down to 0: those registered in waiting_for_read_lock AND those registered in global_read_lock_blocks_commit. sql/lock.cc: start_waiting_global_read_lock() should wake up all those who are waiting for protect_against_global_read_lock to go down to 0: those registered in waiting_for_read_lock AND those registered in global_read_lock_blocks_commit. --- sql/lock.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sql/lock.cc b/sql/lock.cc index 7cfa2aebe7b..8f1cd080db7 100644 --- a/sql/lock.cc +++ b/sql/lock.cc @@ -715,7 +715,7 @@ static void print_lock_error(int error) least the first step above) global_read_lock_blocks_commit count of threads which have the global read lock and block - commits (i.e. have completed the second step above) + commits (i.e. are in or have completed the second step above) waiting_for_read_lock count of threads which want to take a global read lock but cannot protect_against_global_read_lock @@ -886,7 +886,8 @@ void start_waiting_global_read_lock(THD *thd) if (unlikely(thd->global_read_lock)) DBUG_VOID_RETURN; (void) pthread_mutex_lock(&LOCK_open); - tmp= (!--protect_against_global_read_lock && waiting_for_read_lock); + tmp= (!--protect_against_global_read_lock && + (waiting_for_read_lock || global_read_lock_blocks_commit)); (void) pthread_mutex_unlock(&LOCK_open); if (tmp) pthread_cond_broadcast(&COND_refresh); From 262dadccf112eae2381def6e6e144da2ffa9036f Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 23 Feb 2005 20:18:21 +0300 Subject: [PATCH 1053/1063] Fix for bug #6572: SHOW ERRORS doesn't --- mysql-test/r/warnings.result | 27 +++++++++++++++++++++++++++ mysql-test/t/warnings.test | 13 +++++++++++++ sql/protocol.cc | 6 ++++++ 3 files changed, 46 insertions(+) diff --git a/mysql-test/r/warnings.result b/mysql-test/r/warnings.result index d883feb7ce2..e03d72351d1 100644 --- a/mysql-test/r/warnings.result +++ b/mysql-test/r/warnings.result @@ -1,6 +1,33 @@ drop table if exists t1, t2; SET SQL_WARNINGS=1; create table t1 (a int); +create table t1 (a int); +ERROR 42S01: Table 't1' already exists +show count(*) errors; +@@session.error_count +1 +show errors; +Level Code Message +Error 1050 Table 't1' already exists +show warnings; +Level Code Message +Error 1050 Table 't1' already exists +create table t2(a int) default charset qwerty; +ERROR 42000: Unknown character set: 'qwerty' +show count(*) errors; +@@session.error_count +1 +show errors; +Level Code Message +Error 1115 Unknown character set: 'qwerty' +create table t (i); +ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1 +show count(*) errors; +@@session.error_count +1 +show errors; +Level Code Message +Error 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1 insert into t1 values (1); insert into t1 values ("hej"); Warnings: diff --git a/mysql-test/t/warnings.test b/mysql-test/t/warnings.test index 4bd659606f6..23ab5aa1f05 100644 --- a/mysql-test/t/warnings.test +++ b/mysql-test/t/warnings.test @@ -7,6 +7,19 @@ drop table if exists t1, t2; SET SQL_WARNINGS=1; create table t1 (a int); +--error 1050 +create table t1 (a int); +show count(*) errors; +show errors; +show warnings; +--error 1115 +create table t2(a int) default charset qwerty; +show count(*) errors; +show errors; +--error 1064 +create table t (i); +show count(*) errors; +show errors; insert into t1 values (1); insert into t1 values ("hej"); insert into t1 values ("hej"),("då"); diff --git a/sql/protocol.cc b/sql/protocol.cc index 95cd8415c85..4cecd016553 100644 --- a/sql/protocol.cc +++ b/sql/protocol.cc @@ -58,6 +58,7 @@ void send_error(THD *thd, uint sql_errno, const char *err) uint length; char buff[MYSQL_ERRMSG_SIZE+2], *pos; #endif + const char *orig_err= err; NET *net= &thd->net; DBUG_ENTER("send_error"); DBUG_PRINT("enter",("sql_errno: %d err: %s", sql_errno, @@ -82,6 +83,7 @@ void send_error(THD *thd, uint sql_errno, const char *err) err=ER(sql_errno); /* purecov: inspected */ } } + orig_err= err; } #ifdef EMBEDDED_LIBRARY @@ -120,6 +122,8 @@ void send_error(THD *thd, uint sql_errno, const char *err) } VOID(net_write_command(net,(uchar) 255, "", 0, (char*) err,length)); #endif /* EMBEDDED_LIBRARY*/ + push_warning(thd, MYSQL_ERROR::WARN_LEVEL_ERROR, sql_errno, + orig_err ? orig_err : ER(sql_errno)); thd->is_fatal_error=0; // Error message is given thd->net.report_error= 0; @@ -247,6 +251,8 @@ net_printf(THD *thd, uint errcode, ...) strmake(net->last_error, text_pos, length); strmake(net->sqlstate, mysql_errno_to_sqlstate(errcode), SQLSTATE_LENGTH); #endif + push_warning(thd, MYSQL_ERROR::WARN_LEVEL_ERROR, errcode, + text_pos ? text_pos : ER(errcode)); thd->is_fatal_error=0; // Error message is given DBUG_VOID_RETURN; } From 7f1384543202edfe2a16702a484502eb7dcbac67 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 23 Feb 2005 20:59:00 +0100 Subject: [PATCH 1054/1063] Bug#8412: Setting error code to 0 on statements that cannot fail. sql/log.cc: Setting error code to 0 on SQL statements that cannot fail. --- sql/log.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sql/log.cc b/sql/log.cc index 32574ca4a0d..c8a3b512b6d 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -1322,6 +1322,7 @@ COLLATION_CONNECTION=%u,COLLATION_DATABASE=%u,COLLATION_SERVER=%u", (uint) thd->variables.collation_server->number); Query_log_event e(thd, buf, written, 0, FALSE); e.set_log_pos(this); + e.error_code = 0; // This statement cannot fail (see [1]). if (e.write(file)) goto err; } @@ -1338,6 +1339,7 @@ COLLATION_CONNECTION=%u,COLLATION_DATABASE=%u,COLLATION_SERVER=%u", "'", NullS); Query_log_event e(thd, buf, buf_end - buf, 0, FALSE); e.set_log_pos(this); + e.error_code = 0; // This statement cannot fail (see [1]). if (e.write(file)) goto err; } @@ -1389,8 +1391,8 @@ COLLATION_CONNECTION=%u,COLLATION_DATABASE=%u,COLLATION_SERVER=%u", p= strmov(strmov(buf, "SET CHARACTER SET "), thd->variables.convert_set->name); Query_log_event e(thd, buf, (ulong) (p - buf), 0); - e.error_code = 0; // This statement cannot fail (see [1]). e.set_log_pos(this); + e.error_code = 0; // This statement cannot fail (see [1]). if (e.write(file)) goto err; } From 6294c68ee4403065f42d05006b06d29e335e6bc4 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 23 Feb 2005 23:44:13 -0600 Subject: [PATCH 1055/1063] Bootstrap: Add new manual.texi include files Build-tools/Bootstrap: Add new manual.texi include files --- Build-tools/Bootstrap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Build-tools/Bootstrap b/Build-tools/Bootstrap index 8b769dca3c4..64f865362ca 100755 --- a/Build-tools/Bootstrap +++ b/Build-tools/Bootstrap @@ -278,7 +278,7 @@ if (defined $opt_changelog) unless ($opt_skip_manual) { &logger("Updating manual files"); - foreach $file qw/internals manual reservedwords/ + foreach $file qw/internals manual reservedwords errmsg-table cl-errmsg-table/ { system ("bk cat $opt_docdir/Docs/$file.texi > $target_dir/Docs/$file.texi") == 0 or &abort("Could not update $file.texi in $target_dir/Docs/!"); From abd8200f77a0b5c8463628fa921f998cbf7498f9 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 24 Feb 2005 17:25:06 +0100 Subject: [PATCH 1056/1063] Fix of an incorrect merge --- mysql-test/r/rpl_insert_id.result | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/r/rpl_insert_id.result b/mysql-test/r/rpl_insert_id.result index 514ab60dafe..8482f631553 100644 --- a/mysql-test/r/rpl_insert_id.result +++ b/mysql-test/r/rpl_insert_id.result @@ -72,4 +72,4 @@ SET TIMESTAMP=1000000000; CREATE TABLE t1 ( a INT UNIQUE ); SET FOREIGN_KEY_CHECKS=0; INSERT INTO t1 VALUES (1),(1); -Duplicate entry '1' for key 1 +ERROR 23000: Duplicate entry '1' for key 1 From 6b38100d6146cae344aaf90d77c0f4475ea30bb8 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 24 Feb 2005 18:58:56 +0100 Subject: [PATCH 1057/1063] bug#8786 - ndb autodiscover, sometimes fails remove dict forwarding add api retries on NotMaster ndb/include/kernel/signaldata/AlterIndx.hpp: Add NotMaster error code ndb/include/kernel/signaldata/BuildIndx.hpp: Add NotMaster error code ndb/include/kernel/signaldata/CreateIndx.hpp: Add NotMaster error code ndb/include/kernel/signaldata/CreateTrig.hpp: Add NotMaster error code ndb/include/kernel/signaldata/DropIndx.hpp: Add NotMaster error code ndb/src/kernel/blocks/dbdict/Dbdict.cpp: Never forward requests, instead REF to API who will retry towards correct node ndb/src/ndbapi/NdbDictionaryImpl.cpp: 1) Set error code for timeout 2) Handle NotMaster with retry in all DICT requests ndb/src/ndbapi/ndb_cluster_connection.cpp: Fix so that input values is in seconds and not 100ms's sql/ha_ndbcluster.cc: Wait 3 sec for all nodes to connect... --- ndb/include/kernel/signaldata/AlterIndx.hpp | 1 + ndb/include/kernel/signaldata/BuildIndx.hpp | 1 + ndb/include/kernel/signaldata/CreateIndx.hpp | 3 +- ndb/include/kernel/signaldata/CreateTrig.hpp | 1 + ndb/include/kernel/signaldata/DropIndx.hpp | 4 +- ndb/src/kernel/blocks/dbdict/Dbdict.cpp | 62 ++++++++++++++------ ndb/src/ndbapi/NdbDictionaryImpl.cpp | 18 ++++-- ndb/src/ndbapi/ndb_cluster_connection.cpp | 3 +- sql/ha_ndbcluster.cc | 2 +- 9 files changed, 68 insertions(+), 27 deletions(-) diff --git a/ndb/include/kernel/signaldata/AlterIndx.hpp b/ndb/include/kernel/signaldata/AlterIndx.hpp index 1f464ded010..4c8bb465cf1 100644 --- a/ndb/include/kernel/signaldata/AlterIndx.hpp +++ b/ndb/include/kernel/signaldata/AlterIndx.hpp @@ -181,6 +181,7 @@ public: enum ErrorCode { NoError = 0, Busy = 701, + NotMaster = 702, IndexNotFound = 4243, IndexExists = 4244, BadRequestType = 4247, diff --git a/ndb/include/kernel/signaldata/BuildIndx.hpp b/ndb/include/kernel/signaldata/BuildIndx.hpp index 29dfaeb79a6..e8eca03ea81 100644 --- a/ndb/include/kernel/signaldata/BuildIndx.hpp +++ b/ndb/include/kernel/signaldata/BuildIndx.hpp @@ -234,6 +234,7 @@ public: enum ErrorCode { NoError = 0, Busy = 701, + NotMaster = 702, BadRequestType = 4247, InvalidPrimaryTable = 4249, InvalidIndexType = 4250, diff --git a/ndb/include/kernel/signaldata/CreateIndx.hpp b/ndb/include/kernel/signaldata/CreateIndx.hpp index 3e277b38dea..2751cfbbbfa 100644 --- a/ndb/include/kernel/signaldata/CreateIndx.hpp +++ b/ndb/include/kernel/signaldata/CreateIndx.hpp @@ -184,7 +184,7 @@ public: /** * CreateIndxRef. */ -class CreateIndxRef { +struct CreateIndxRef { friend bool printCREATE_INDX_REF(FILE*, const Uint32*, Uint32, Uint16); public: @@ -210,7 +210,6 @@ public: InvalidAttributeOrder = 4255 }; -private: CreateIndxConf m_conf; //Uint32 m_userRef; //Uint32 m_connectionPtr; diff --git a/ndb/include/kernel/signaldata/CreateTrig.hpp b/ndb/include/kernel/signaldata/CreateTrig.hpp index a8de9e50dd4..4af9cb57f68 100644 --- a/ndb/include/kernel/signaldata/CreateTrig.hpp +++ b/ndb/include/kernel/signaldata/CreateTrig.hpp @@ -288,6 +288,7 @@ public: enum ErrorCode { NoError = 0, Busy = 701, + NotMaster = 702, TriggerNameTooLong = 4236, TooManyTriggers = 4237, TriggerNotFound = 4238, diff --git a/ndb/include/kernel/signaldata/DropIndx.hpp b/ndb/include/kernel/signaldata/DropIndx.hpp index 0c0cf31aec8..247fbdf914e 100644 --- a/ndb/include/kernel/signaldata/DropIndx.hpp +++ b/ndb/include/kernel/signaldata/DropIndx.hpp @@ -160,7 +160,7 @@ public: /** * DropIndxRef. */ -class DropIndxRef { +struct DropIndxRef { friend bool printDROP_INDX_REF(FILE*, const Uint32*, Uint32, Uint16); public: @@ -168,6 +168,7 @@ public: NoError = 0, InvalidIndexVersion = 241, Busy = 701, + NotMaster = 702, IndexNotFound = 4243, BadRequestType = 4247, InvalidName = 4248, @@ -175,7 +176,6 @@ public: }; STATIC_CONST( SignalLength = DropIndxConf::SignalLength + 3 ); -private: DropIndxConf m_conf; //Uint32 m_userRef; //Uint32 m_connectionPtr; diff --git a/ndb/src/kernel/blocks/dbdict/Dbdict.cpp b/ndb/src/kernel/blocks/dbdict/Dbdict.cpp index 432b2617f65..2b2748eb165 100644 --- a/ndb/src/kernel/blocks/dbdict/Dbdict.cpp +++ b/ndb/src/kernel/blocks/dbdict/Dbdict.cpp @@ -6053,11 +6053,21 @@ Dbdict::execCREATE_INDX_REQ(Signal* signal) jam(); if (getOwnNodeId() != c_masterNodeId) { jam(); - // forward to DICT master - sendSignal(calcDictBlockRef(c_masterNodeId), GSN_CREATE_INDX_REQ, - signal, signal->getLength(), JBB); - return; + + releaseSections(signal); + OpCreateIndex opBusy; + opPtr.p = &opBusy; + opPtr.p->save(req); + opPtr.p->m_isMaster = (senderRef == reference()); + opPtr.p->key = 0; + opPtr.p->m_requestType = CreateIndxReq::RT_DICT_PREPARE; + opPtr.p->m_errorCode = CreateIndxRef::NotMaster; + opPtr.p->m_errorLine = __LINE__; + opPtr.p->m_errorNode = c_masterNodeId; + createIndex_sendReply(signal, opPtr, true); + return; } + // forward initial request plus operation key to all req->setOpKey(++c_opRecordSequence); NodeReceiverGroup rg(DBDICT, c_aliveNodes); @@ -6588,10 +6598,9 @@ Dbdict::execDROP_INDX_REQ(Signal* signal) jam(); if (getOwnNodeId() != c_masterNodeId) { jam(); - // forward to DICT master - sendSignal(calcDictBlockRef(c_masterNodeId), GSN_DROP_INDX_REQ, - signal, signal->getLength(), JBB); - return; + + err = DropIndxRef::NotMaster; + goto error; } // forward initial request plus operation key to all Uint32 indexId= req->getIndexId(); @@ -6679,6 +6688,7 @@ error: opPtr.p->save(req); opPtr.p->m_errorCode = (DropIndxRef::ErrorCode)err; opPtr.p->m_errorLine = __LINE__; + opPtr.p->m_errorNode = c_masterNodeId; dropIndex_sendReply(signal, opPtr, true); } @@ -9117,9 +9127,15 @@ Dbdict::execALTER_INDX_REQ(Signal* signal) jam(); if (! isLocal && getOwnNodeId() != c_masterNodeId) { jam(); - // forward to DICT master - sendSignal(calcDictBlockRef(c_masterNodeId), GSN_ALTER_INDX_REQ, - signal, signal->getLength(), JBB); + + releaseSections(signal); + OpAlterIndex opBad; + opPtr.p = &opBad; + opPtr.p->save(req); + opPtr.p->m_errorCode = AlterIndxRef::NotMaster; + opPtr.p->m_errorLine = __LINE__; + opPtr.p->m_errorNode = c_masterNodeId; + alterIndex_sendReply(signal, opPtr, true); return; } // forward initial request plus operation key to all @@ -9797,9 +9813,15 @@ Dbdict::execBUILDINDXREQ(Signal* signal) jam(); if (getOwnNodeId() != c_masterNodeId) { jam(); - // forward to DICT master - sendSignal(calcDictBlockRef(c_masterNodeId), GSN_BUILDINDXREQ, - signal, signal->getLength(), JBB); + + releaseSections(signal); + OpBuildIndex opBad; + opPtr.p = &opBad; + opPtr.p->save(req); + opPtr.p->m_errorCode = BuildIndxRef::NotMaster; + opPtr.p->m_errorLine = __LINE__; + opPtr.p->m_errorNode = c_masterNodeId; + buildIndex_sendReply(signal, opPtr, true); return; } // forward initial request plus operation key to all @@ -10263,9 +10285,15 @@ Dbdict::execCREATE_TRIG_REQ(Signal* signal) jam(); if (! isLocal && getOwnNodeId() != c_masterNodeId) { jam(); - // forward to DICT master - sendSignal(calcDictBlockRef(c_masterNodeId), GSN_CREATE_TRIG_REQ, - signal, signal->getLength(), JBB); + + releaseSections(signal); + OpCreateTrigger opBad; + opPtr.p = &opBad; + opPtr.p->save(req); + opPtr.p->m_errorCode = CreateTrigRef::NotMaster; + opPtr.p->m_errorLine = __LINE__; + opPtr.p->m_errorNode = c_masterNodeId; + createTrigger_sendReply(signal, opPtr, true); return; } // forward initial request plus operation key to all diff --git a/ndb/src/ndbapi/NdbDictionaryImpl.cpp b/ndb/src/ndbapi/NdbDictionaryImpl.cpp index 9f6ed144fb0..3d92f0e010f 100644 --- a/ndb/src/ndbapi/NdbDictionaryImpl.cpp +++ b/ndb/src/ndbapi/NdbDictionaryImpl.cpp @@ -945,6 +945,12 @@ NdbDictInterface::dictSignal(NdbApiSignal* signal, if(m_waiter.m_state == WAIT_NODE_FAILURE) continue; + if(m_waiter.m_state == WST_WAIT_TIMEOUT) + { + m_error.code = 4008; + DBUG_RETURN(-1); + } + if ( (temporaryMask & m_error.code) != 0 ) { continue; } @@ -2091,8 +2097,8 @@ int NdbDictInterface::createIndex(NdbApiSignal* signal, LinearSectionPtr ptr[3]) { - const int noErrCodes = 1; - int errCodes[noErrCodes] = {CreateIndxRef::Busy}; + const int noErrCodes = 2; + int errCodes[noErrCodes] = {CreateIndxRef::Busy, CreateIndxRef::NotMaster}; return dictSignal(signal,ptr,2, 1 /*use masternode id*/, 100, @@ -2116,6 +2122,8 @@ NdbDictInterface::execCREATE_INDX_REF(NdbApiSignal * signal, { const CreateIndxRef* const ref = CAST_CONSTPTR(CreateIndxRef, signal->getDataPtr()); m_error.code = ref->getErrorCode(); + if(m_error.code == ref->NotMaster) + m_masterNodeId= ref->m_errorNode; m_waiter.signal(NO_WAIT); } @@ -2212,8 +2220,8 @@ NdbDictInterface::dropIndex(const NdbIndexImpl & impl, int NdbDictInterface::dropIndex(NdbApiSignal* signal, LinearSectionPtr ptr[3]) { - const int noErrCodes = 1; - int errCodes[noErrCodes] = {DropIndxRef::Busy}; + const int noErrCodes = 2; + int errCodes[noErrCodes] = {DropIndxRef::Busy, DropIndxRef::NotMaster}; int r = dictSignal(signal,NULL,0, 1/*Use masternode id*/, 100, @@ -2240,6 +2248,8 @@ NdbDictInterface::execDROP_INDX_REF(NdbApiSignal * signal, { const DropIndxRef* const ref = CAST_CONSTPTR(DropIndxRef, signal->getDataPtr()); m_error.code = ref->getErrorCode(); + if(m_error.code == ref->NotMaster) + m_masterNodeId= ref->m_errorNode; m_waiter.signal(NO_WAIT); } diff --git a/ndb/src/ndbapi/ndb_cluster_connection.cpp b/ndb/src/ndbapi/ndb_cluster_connection.cpp index 5df707e211d..4650a719542 100644 --- a/ndb/src/ndbapi/ndb_cluster_connection.cpp +++ b/ndb/src/ndbapi/ndb_cluster_connection.cpp @@ -222,7 +222,8 @@ Ndb_cluster_connection::wait_until_ready(int timeout, else if (foundAliveNode > 0) { noChecksSinceFirstAliveFound++; - if (noChecksSinceFirstAliveFound > timeout_after_first_alive) + // 100 ms delay -> 10* + if (noChecksSinceFirstAliveFound > 10*timeout_after_first_alive) DBUG_RETURN(1); } else if (secondsCounter >= timeout) diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index a959cbaf434..1b771d7cfc8 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -4339,7 +4339,7 @@ bool ndbcluster_init() DBUG_PRINT("info",("NDBCLUSTER storage engine at %s on port %d", g_ndb_cluster_connection->get_connected_host(), g_ndb_cluster_connection->get_connected_port())); - g_ndb_cluster_connection->wait_until_ready(10,0); + g_ndb_cluster_connection->wait_until_ready(10,3); } else if(res == 1) { From b89feadf56d074161acdacacd01a1f95f6d60e8d Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 25 Feb 2005 09:10:35 +0100 Subject: [PATCH 1058/1063] BUG#8786 - ndb_autodiscover, post review More explicit naming of variables ndb/include/kernel/signaldata/AlterIndx.hpp: Add union to indicate where master node is passed in ref ndb/include/kernel/signaldata/BuildIndx.hpp: Add union to indicate where master node is passed in ref ndb/include/kernel/signaldata/CreateIndx.hpp: Add union to indicate where master node is passed in ref ndb/include/kernel/signaldata/CreateTrig.hpp: Add union to indicate where master node is passed in ref ndb/include/kernel/signaldata/DropIndx.hpp: Add union to indicate where master node is passed in ref ndb/src/kernel/blocks/dbdict/Dbdict.cpp: Set error/master node also on BuildIndxRef ndb/src/ndbapi/NdbDictionaryImpl.cpp: Use masterNodeId instead of errornode --- ndb/include/kernel/signaldata/AlterIndx.hpp | 6 ++++-- ndb/include/kernel/signaldata/BuildIndx.hpp | 4 ++-- ndb/include/kernel/signaldata/CreateIndx.hpp | 6 ++++-- ndb/include/kernel/signaldata/CreateTrig.hpp | 6 ++++-- ndb/include/kernel/signaldata/DropIndx.hpp | 6 ++++-- ndb/src/kernel/blocks/dbdict/Dbdict.cpp | 1 + ndb/src/ndbapi/NdbDictionaryImpl.cpp | 4 ++-- 7 files changed, 21 insertions(+), 12 deletions(-) diff --git a/ndb/include/kernel/signaldata/AlterIndx.hpp b/ndb/include/kernel/signaldata/AlterIndx.hpp index 4c8bb465cf1..f5ad835b6f3 100644 --- a/ndb/include/kernel/signaldata/AlterIndx.hpp +++ b/ndb/include/kernel/signaldata/AlterIndx.hpp @@ -201,8 +201,10 @@ private: //Uint32 m_indexVersion; Uint32 m_errorCode; Uint32 m_errorLine; - Uint32 m_errorNode; - + union { + Uint32 m_errorNode; + Uint32 masterNodeId; // if NotMaster + }; public: AlterIndxConf* getConf() { return &m_conf; diff --git a/ndb/include/kernel/signaldata/BuildIndx.hpp b/ndb/include/kernel/signaldata/BuildIndx.hpp index e8eca03ea81..a6ea84c5ea0 100644 --- a/ndb/include/kernel/signaldata/BuildIndx.hpp +++ b/ndb/include/kernel/signaldata/BuildIndx.hpp @@ -242,9 +242,8 @@ public: AllocationFailure = 4252, InternalError = 4346 }; - STATIC_CONST( SignalLength = BuildIndxConf::SignalLength + 1 ); + STATIC_CONST( SignalLength = BuildIndxConf::SignalLength + 2 ); -private: //Uint32 m_userRef; //Uint32 m_connectionPtr; //Uint32 m_requestInfo; @@ -253,6 +252,7 @@ private: //Uint32 m_indexId; BuildIndxConf m_conf; Uint32 m_errorCode; + Uint32 masterNodeId; public: BuildIndxConf* getConf() { diff --git a/ndb/include/kernel/signaldata/CreateIndx.hpp b/ndb/include/kernel/signaldata/CreateIndx.hpp index 2751cfbbbfa..5563f80a555 100644 --- a/ndb/include/kernel/signaldata/CreateIndx.hpp +++ b/ndb/include/kernel/signaldata/CreateIndx.hpp @@ -220,8 +220,10 @@ public: //Uint32 m_indexVersion; Uint32 m_errorCode; Uint32 m_errorLine; - Uint32 m_errorNode; - + union { + Uint32 m_errorNode; + Uint32 masterNodeId; // If NotMaster + }; public: CreateIndxConf* getConf() { return &m_conf; diff --git a/ndb/include/kernel/signaldata/CreateTrig.hpp b/ndb/include/kernel/signaldata/CreateTrig.hpp index 4af9cb57f68..62627256dcf 100644 --- a/ndb/include/kernel/signaldata/CreateTrig.hpp +++ b/ndb/include/kernel/signaldata/CreateTrig.hpp @@ -311,8 +311,10 @@ private: //Uint32 m_triggerInfo; Uint32 m_errorCode; Uint32 m_errorLine; - Uint32 m_errorNode; - + union { + Uint32 m_errorNode; + Uint32 masterNodeId; // When NotMaster + }; public: CreateTrigConf* getConf() { return &m_conf; diff --git a/ndb/include/kernel/signaldata/DropIndx.hpp b/ndb/include/kernel/signaldata/DropIndx.hpp index 247fbdf914e..fd2ea7f0b7b 100644 --- a/ndb/include/kernel/signaldata/DropIndx.hpp +++ b/ndb/include/kernel/signaldata/DropIndx.hpp @@ -185,8 +185,10 @@ public: //Uint32 m_indexVersion; Uint32 m_errorCode; Uint32 m_errorLine; - Uint32 m_errorNode; - + union { + Uint32 m_errorNode; + Uint32 masterNodeId; + }; public: DropIndxConf* getConf() { return &m_conf; diff --git a/ndb/src/kernel/blocks/dbdict/Dbdict.cpp b/ndb/src/kernel/blocks/dbdict/Dbdict.cpp index 2b2748eb165..b1e573e1cc8 100644 --- a/ndb/src/kernel/blocks/dbdict/Dbdict.cpp +++ b/ndb/src/kernel/blocks/dbdict/Dbdict.cpp @@ -10237,6 +10237,7 @@ Dbdict::buildIndex_sendReply(Signal* signal, OpBuildIndexPtr opPtr, rep->setIndexId(opPtr.p->m_request.getIndexId()); if (sendRef) { rep->setErrorCode(opPtr.p->m_errorCode); + rep->masterNodeId = opPtr.p->m_errorNode; gsn = GSN_BUILDINDXREF; length = BuildIndxRef::SignalLength; } diff --git a/ndb/src/ndbapi/NdbDictionaryImpl.cpp b/ndb/src/ndbapi/NdbDictionaryImpl.cpp index 3d92f0e010f..222db6060c7 100644 --- a/ndb/src/ndbapi/NdbDictionaryImpl.cpp +++ b/ndb/src/ndbapi/NdbDictionaryImpl.cpp @@ -2123,7 +2123,7 @@ NdbDictInterface::execCREATE_INDX_REF(NdbApiSignal * signal, const CreateIndxRef* const ref = CAST_CONSTPTR(CreateIndxRef, signal->getDataPtr()); m_error.code = ref->getErrorCode(); if(m_error.code == ref->NotMaster) - m_masterNodeId= ref->m_errorNode; + m_masterNodeId= ref->masterNodeId; m_waiter.signal(NO_WAIT); } @@ -2249,7 +2249,7 @@ NdbDictInterface::execDROP_INDX_REF(NdbApiSignal * signal, const DropIndxRef* const ref = CAST_CONSTPTR(DropIndxRef, signal->getDataPtr()); m_error.code = ref->getErrorCode(); if(m_error.code == ref->NotMaster) - m_masterNodeId= ref->m_errorNode; + m_masterNodeId= ref->masterNodeId; m_waiter.signal(NO_WAIT); } From 5c15cc5c3537941602d34174cb8b51e3d026555c Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 25 Feb 2005 11:47:27 +0100 Subject: [PATCH 1059/1063] add auto generated ndb dsp-files (for msvc++ 6.0) to ignore file BitKeeper/etc/ignore: added ndb/src/common/debugger/signaldata/libsignaldataprint.dsp ndb/src/common/debugger/libtrace.dsp ndb/src/common/logger/liblogger.dsp ndb/src/common/mgmcommon/libmgmsrvcommon.dsp ndb/src/common/portlib/libportlib.dsp ndb/src/common/transporter/libtransporter.dsp ndb/src/common/util/libgeneral.dsp ndb/src/kernel/blocks/backup/libbackup.dsp ndb/src/kernel/blocks/cmvmi/libcmvmi.dsp ndb/src/kernel/blocks/dbacc/libdbacc.dsp ndb/src/kernel/blocks/dbdict/libdbdict.dsp ndb/src/kernel/blocks/dbdih/libdbdih.dsp ndb/src/kernel/blocks/dblqh/libdblqh.dsp ndb/src/kernel/blocks/dbtc/libdbtc.dsp ndb/src/kernel/blocks/dbtup/libdbtup.dsp ndb/src/kernel/blocks/dbtux/libdbtux.dsp ndb/src/kernel/blocks/dbutil/libdbutil.dsp ndb/src/kernel/blocks/grep/libgrep.dsp ndb/src/kernel/blocks/ndbcntr/libndbcntr.dsp ndb/src/kernel/blocks/ndbfs/libndbfs.dsp ndb/src/kernel/blocks/qmgr/libqmgr.dsp ndb/src/kernel/blocks/suma/libsuma.dsp ndb/src/kernel/blocks/trix/libtrix.dsp ndb/src/kernel/error/liberror.dsp ndb/src/kernel/vm/libkernel.d sp ndb/src/kernel/ndbd.dsp ndb/src/mgmapi/libmgmapi.dsp ndb/src/mgmclient/ndb_mgm.dsp ndb/src/mgmclient/libndbmgmclient.dsp ndb/src/mgmsrv/ndb_mgmd.dsp ndb/src/ndbapi/libndbapi.dsp ndb/src/libndbclient.dsp ndb/test/ndbapi/flexBench.dsp ndb/test/ndbapi/testBasic.dsp ndb/test/ndbapi/testBlobs.dsp ndb/test/ndbapi/testScan.dsp ndb/test/src/libNDBT.dsp ndb/tools/ndb_waiter.dsp ndb/tools/ndb_drop_table.dsp ndb/tools/ndb_delete_all.dsp ndb/tools/ndb_desc.dsp ndb/tools/ndb_drop_index.dsp ndb/tools/ndb_show_tables.dsp ndb/tools/ndb_select_all.dsp ndb/tools/ndb_select_count.dsp --- .bzrignore | 46 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) diff --git a/.bzrignore b/.bzrignore index f43a67af883..faedfa2b48e 100644 --- a/.bzrignore +++ b/.bzrignore @@ -1007,4 +1007,48 @@ tests/mysql_client_test libmysqld/examples/mysql_client_test.c libmysqld/examples/mysql_client_test_embedded libmysqld/examples/mysqltest_embedded -support-files/ndb-config-2-node.ini +ndb/src/common/debugger/signaldata/libsignaldataprint.dsp +ndb/src/common/debugger/libtrace.dsp +ndb/src/common/logger/liblogger.dsp +ndb/src/common/mgmcommon/libmgmsrvcommon.dsp +ndb/src/common/portlib/libportlib.dsp +ndb/src/common/transporter/libtransporter.dsp +ndb/src/common/util/libgeneral.dsp +ndb/src/kernel/blocks/backup/libbackup.dsp +ndb/src/kernel/blocks/cmvmi/libcmvmi.dsp +ndb/src/kernel/blocks/dbacc/libdbacc.dsp +ndb/src/kernel/blocks/dbdict/libdbdict.dsp +ndb/src/kernel/blocks/dbdih/libdbdih.dsp +ndb/src/kernel/blocks/dblqh/libdblqh.dsp +ndb/src/kernel/blocks/dbtc/libdbtc.dsp +ndb/src/kernel/blocks/dbtup/libdbtup.dsp +ndb/src/kernel/blocks/dbtux/libdbtux.dsp +ndb/src/kernel/blocks/dbutil/libdbutil.dsp +ndb/src/kernel/blocks/grep/libgrep.dsp +ndb/src/kernel/blocks/ndbcntr/libndbcntr.dsp +ndb/src/kernel/blocks/ndbfs/libndbfs.dsp +ndb/src/kernel/blocks/qmgr/libqmgr.dsp +ndb/src/kernel/blocks/suma/libsuma.dsp +ndb/src/kernel/blocks/trix/libtrix.dsp +ndb/src/kernel/error/liberror.dsp +ndb/src/kernel/vm/libkernel.dsp +ndb/src/kernel/ndbd.dsp +ndb/src/mgmapi/libmgmapi.dsp +ndb/src/mgmclient/ndb_mgm.dsp +ndb/src/mgmclient/libndbmgmclient.dsp +ndb/src/mgmsrv/ndb_mgmd.dsp +ndb/src/ndbapi/libndbapi.dsp +ndb/src/libndbclient.dsp +ndb/test/ndbapi/flexBench.dsp +ndb/test/ndbapi/testBasic.dsp +ndb/test/ndbapi/testBlobs.dsp +ndb/test/ndbapi/testScan.dsp +ndb/test/src/libNDBT.dsp +ndb/tools/ndb_waiter.dsp +ndb/tools/ndb_drop_table.dsp +ndb/tools/ndb_delete_all.dsp +ndb/tools/ndb_desc.dsp +ndb/tools/ndb_drop_index.dsp +ndb/tools/ndb_show_tables.dsp +ndb/tools/ndb_select_all.dsp +ndb/tools/ndb_select_count.dsp From 3c5b16eebed40cf72d9deaa800229266bdf75f9a Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 25 Feb 2005 18:12:53 +0400 Subject: [PATCH 1060/1063] mysqldump.c: Bug#7997 Add implicit --skip-set-charset when mysqldump from 4.0 server w/ 4.1 client client/mysqldump.c: Bug#7997 Add implicit --skip-set-charset when mysqldump from 4.0 server w/ 4.1 client --- client/mysqldump.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/client/mysqldump.c b/client/mysqldump.c index c2c44024cf4..2c0bdf9a7a9 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -861,6 +861,11 @@ static int dbConnect(char *host, char *user,char *passwd) DBerror(&mysql_connection, "when trying to connect"); return 1; } + /* + Don't dump SET NAMES with a pre-4.1 server (bug#7997). + */ + if (mysql_get_server_version(&mysql_connection) < 40100) + opt_set_charset= 0; /* As we're going to set SQL_MODE, it would be lost on reconnect, so we cannot reconnect. From 46a8c5221750f4f0b5baf870d4f131d8f3de2821 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 25 Feb 2005 22:16:14 +0200 Subject: [PATCH 1061/1063] fil0fil.c: Check if node == NULL, which means we are outside tablespace bounds, and print a big fatal error message innobase/fil/fil0fil.c: Check if node == NULL, which means we are outside tablespace bounds, and print a big fatal error message --- innobase/fil/fil0fil.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/innobase/fil/fil0fil.c b/innobase/fil/fil0fil.c index a8da074cab9..16ae8e6e228 100644 --- a/innobase/fil/fil0fil.c +++ b/innobase/fil/fil0fil.c @@ -3800,13 +3800,6 @@ fil_io( node = UT_LIST_GET_FIRST(space->chain); for (;;) { - if (space->id != 0 && node->size == 0) { - /* We do not know the size of a single-table tablespace - before we open the file */ - - break; - } - if (node == NULL) { fprintf(stderr, "InnoDB: Error: trying to access page number %lu in space %lu,\n" @@ -3820,6 +3813,13 @@ fil_io( ut_error; } + if (space->id != 0 && node->size == 0) { + /* We do not know the size of a single-table tablespace + before we open the file */ + + break; + } + if (node->size > block_offset) { /* Found! */ break; From 1a72e219f206fbf20691baaf2d1fbdb2dd73e13c Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 26 Feb 2005 17:15:04 +0300 Subject: [PATCH 1062/1063] Fix for BUG#8560: Set max_sort_char for any 8-bit charset with binary collation. max_sort_char is needed by my_like_range_simple to produce upper bound constants for LIKE "str_%" and similar expressions. mysql-test/r/ctype_cp1251.result: Test for BUG#8560 mysql-test/t/ctype_cp1251.test: Test for BUG#8560 --- mysql-test/r/ctype_cp1251.result | 16 ++++++++++++++++ mysql-test/t/ctype_cp1251.test | 14 ++++++++++++++ strings/ctype-bin.c | 9 ++++++++- 3 files changed, 38 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/ctype_cp1251.result b/mysql-test/r/ctype_cp1251.result index 3793e962d40..647f8c6236c 100644 --- a/mysql-test/r/ctype_cp1251.result +++ b/mysql-test/r/ctype_cp1251.result @@ -54,3 +54,19 @@ select collation(a), collation(b), collation(binary 'ccc') from t1 limit 1; collation(a) collation(b) collation(binary 'ccc') cp1251_bin binary binary drop table t1; +create table t1 ( +a varchar(16) character set cp1251 collate cp1251_bin not null, +b int(10) default null, +primary key(a) +) charset=cp1251; +insert into t1 (a) values ('air'), +('we'),('g'),('we_toshko'), ('s0urce'),('we_ivo'),('we_iliyan'), +('we_martin'),('vw_grado'),('vw_vasko'),('tn_vili'),('tn_kalina'), +('tn_fakira'),('vw_silvia'),('vw_starshi'),('vw_geo'),('vw_b0x1'); +select * from t1 where a like 'we_%'; +a b +we_iliyan NULL +we_ivo NULL +we_martin NULL +we_toshko NULL +drop table t1; diff --git a/mysql-test/t/ctype_cp1251.test b/mysql-test/t/ctype_cp1251.test index 66a8a5aa909..2d670ec3607 100644 --- a/mysql-test/t/ctype_cp1251.test +++ b/mysql-test/t/ctype_cp1251.test @@ -32,3 +32,17 @@ select * from t1 where lower(b)='bbb'; select charset(a), charset(b), charset(binary 'ccc') from t1 limit 1; select collation(a), collation(b), collation(binary 'ccc') from t1 limit 1; drop table t1; + +# Test for BUG#8560 +create table t1 ( + a varchar(16) character set cp1251 collate cp1251_bin not null, + b int(10) default null, + primary key(a) +) charset=cp1251; +insert into t1 (a) values ('air'), + ('we'),('g'),('we_toshko'), ('s0urce'),('we_ivo'),('we_iliyan'), + ('we_martin'),('vw_grado'),('vw_vasko'),('tn_vili'),('tn_kalina'), + ('tn_fakira'),('vw_silvia'),('vw_starshi'),('vw_geo'),('vw_b0x1'); + +select * from t1 where a like 'we_%'; +drop table t1; diff --git a/strings/ctype-bin.c b/strings/ctype-bin.c index 618879607ec..425985e6bc1 100644 --- a/strings/ctype-bin.c +++ b/strings/ctype-bin.c @@ -67,6 +67,13 @@ static uchar bin_char_array[] = }; +static my_bool +my_coll_init_8bit_bin(CHARSET_INFO *cs, + void *(*alloc)(uint) __attribute__((unused))) +{ + cs->max_sort_char=255; + return FALSE; +} static int my_strnncoll_binary(CHARSET_INFO * cs __attribute__((unused)), const uchar *s, uint slen, @@ -428,7 +435,7 @@ skip: MY_COLLATION_HANDLER my_collation_8bit_bin_handler = { - NULL, /* init */ + my_coll_init_8bit_bin, my_strnncoll_8bit_bin, my_strnncollsp_8bit_bin, my_strnxfrm_8bit_bin, From 8b8c9452ddc734c42301f64e625c31779968232a Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 28 Feb 2005 11:59:46 +0200 Subject: [PATCH 1063/1063] Fixed wrong memory references found by purify (No really critical errors found, but a few possible wrong results) innobase/dict/dict0dict.c: Replace memcmp with comparison of characters to avoid warnings from purify when 'sptr' points to a very short string mysql-test/r/select_found.result: Add missing drop table mysql-test/r/type_set.result: More tests mysql-test/t/select_found.test: Add missing drop table mysql-test/t/type_set.test: More tests mysys/my_init.c: Avoid warning from purify (purify doesn't handle getrusage() properly) sql/field.h: enum & set are sorted as numbers. This fixes an access to uninitialized memory when enum/set are multi-byte characters sql/filesort.cc: enum & set are sorted as numbers. This fixes an access to uninitialized memory when enum/set are multi-byte characters sql/item_cmpfunc.cc: Fixed warning from purify. (Not critical as the arguments are passed to a function but not used) Allocate Arg_comparator() with 'new' instead of sql_alloc() to ensure proper initialization sql/mysqld.cc: Wait for signal handler to stop when running --bootstrap (Fixes warning from purify) sql/sql_insert.cc: Initialize slot used by innodb.cc (not critical) sql/sql_lex.h: Better comments sql/sql_repl.cc: memcmp -> bcmp() to avoid warning from purify sql/sql_select.cc: Fix for out-of-bound memory reference when doing DISTINCT on const expressions strings/ctype-simple.c: Fixes to not access uninitialized memory (Not critical) --- innobase/dict/dict0dict.c | 3 +- mysql-test/r/select_found.result | 1 + mysql-test/r/type_set.result | 18 ++++++++ mysql-test/t/select_found.test | 1 + mysql-test/t/type_set.test | 2 + mysys/my_init.c | 4 ++ sql/field.h | 3 ++ sql/filesort.cc | 2 +- sql/item_cmpfunc.cc | 8 +++- sql/mysqld.cc | 42 +++++++++++------- sql/sql_insert.cc | 3 +- sql/sql_lex.h | 73 ++++++++++++++++++++++---------- sql/sql_repl.cc | 2 +- sql/sql_select.cc | 33 ++++++++++----- strings/ctype-simple.c | 9 ++-- 15 files changed, 148 insertions(+), 56 deletions(-) diff --git a/innobase/dict/dict0dict.c b/innobase/dict/dict0dict.c index 186f3be2f31..a73dd8b9dd9 100644 --- a/innobase/dict/dict0dict.c +++ b/innobase/dict/dict0dict.c @@ -2671,7 +2671,8 @@ scan_more: /* Starting quote: remember the quote character. */ quote = *sptr; } else if (*sptr == '#' - || (0 == memcmp("-- ", sptr, 3))) { + || (sptr[0] == '-' && sptr[1] == '-' && + sptr[2] == ' ')) { for (;;) { /* In Unix a newline is 0x0A while in Windows it is 0x0D followed by 0x0A */ diff --git a/mysql-test/r/select_found.result b/mysql-test/r/select_found.result index 665277f68f2..39a949ef86b 100644 --- a/mysql-test/r/select_found.result +++ b/mysql-test/r/select_found.result @@ -254,3 +254,4 @@ a SELECT FOUND_ROWS(); FOUND_ROWS() 1 +DROP TABLE t1; diff --git a/mysql-test/r/type_set.result b/mysql-test/r/type_set.result index 9c82f59fc69..5aedefda283 100644 --- a/mysql-test/r/type_set.result +++ b/mysql-test/r/type_set.result @@ -29,6 +29,12 @@ a A a,A a,A +select s from t1 order by concat(s); +s +A +a +a,A +a,A drop table t1; CREATE TABLE t1 (c set('ae','oe','ue','ss') collate latin1_german2_ci); INSERT INTO t1 VALUES ('ä'),('ö'),('ü'),('ß'); @@ -47,4 +53,16 @@ ss ss ae,oe,ue,ss ae,oe,ue,ss +SELECT c FROM t1 ORDER BY concat(c); +c +ae +ae +ae,oe,ue,ss +ae,oe,ue,ss +oe +oe +ss +ss +ue +ue DROP TABLE t1; diff --git a/mysql-test/t/select_found.test b/mysql-test/t/select_found.test index d31d7d0b02e..5bd068eb0e6 100644 --- a/mysql-test/t/select_found.test +++ b/mysql-test/t/select_found.test @@ -175,3 +175,4 @@ CREATE TABLE t1 (a int, b int); INSERT INTO t1 VALUES (1,2), (1,3), (1,4), (1,5); SELECT SQL_CALC_FOUND_ROWS DISTINCT 'a' FROM t1 GROUP BY b LIMIT 2; SELECT FOUND_ROWS(); +DROP TABLE t1; diff --git a/mysql-test/t/type_set.test b/mysql-test/t/type_set.test index e4aeecb2c79..b6410a9ea3d 100644 --- a/mysql-test/t/type_set.test +++ b/mysql-test/t/type_set.test @@ -23,6 +23,7 @@ create table t1 (s set ('a','A') character set latin1 collate latin1_bin); show create table t1; insert into t1 values ('a'),('a,A'),('A,a'),('A'); select s from t1 order by s; +select s from t1 order by concat(s); drop table t1; # @@ -34,4 +35,5 @@ INSERT INTO t1 VALUES ('ae'),('oe'),('ue'),('ss'); INSERT INTO t1 VALUES ('ä,ö,ü,ß'); INSERT INTO t1 VALUES ('ae,oe,ue,ss'); SELECT c FROM t1 ORDER BY c; +SELECT c FROM t1 ORDER BY concat(c); DROP TABLE t1; diff --git a/mysys/my_init.c b/mysys/my_init.c index c32fcfe6a09..bee485c3bed 100644 --- a/mysys/my_init.c +++ b/mysys/my_init.c @@ -145,6 +145,10 @@ void my_end(int infoflag) { #ifdef HAVE_GETRUSAGE struct rusage rus; +#ifdef HAVE_purify + /* Purify assumes that rus is uninitialized after getrusage call */ + bzero((char*) &rus, sizeof(rus)); +#endif if (!getrusage(RUSAGE_SELF, &rus)) fprintf(info_file,"\n\ User time %.2f, System time %.2f\n\ diff --git a/sql/field.h b/sql/field.h index fd0f2f9c2f1..b5d88504939 100644 --- a/sql/field.h +++ b/sql/field.h @@ -277,6 +277,7 @@ public: virtual bool get_date(TIME *ltime,uint fuzzydate); virtual bool get_time(TIME *ltime); virtual CHARSET_INFO *charset(void) const { return &my_charset_bin; } + virtual CHARSET_INFO *sort_charset(void) const { return charset(); } virtual bool has_charset(void) const { return FALSE; } virtual void set_charset(CHARSET_INFO *charset) { } bool set_warning(const unsigned int level, const unsigned int code, @@ -1152,6 +1153,8 @@ public: bool optimize_range(uint idx, uint part) { return 0; } bool eq_def(Field *field); bool has_charset(void) const { return TRUE; } + /* enum and set are sorted as integers */ + CHARSET_INFO *sort_charset(void) const { return &my_charset_bin; } field_cast_enum field_cast_type() { return FIELD_CAST_ENUM; } }; diff --git a/sql/filesort.cc b/sql/filesort.cc index 24088210f1a..76ce9ac4ce2 100644 --- a/sql/filesort.cc +++ b/sql/filesort.cc @@ -1127,7 +1127,7 @@ sortlength(SORT_FIELD *sortorder, uint s_length, bool *multi_byte_charset) else { sortorder->length=sortorder->field->pack_length(); - if (use_strnxfrm((cs=sortorder->field->charset()))) + if (use_strnxfrm((cs=sortorder->field->sort_charset()))) { sortorder->need_strxnfrm= 1; *multi_byte_charset= 1; diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index aff11ac7b25..690da1be18c 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -265,7 +265,7 @@ int Arg_comparator::set_compare_func(Item_bool_func2 *item, Item_result type) comparators= 0; return 1; } - if (!(comparators= (Arg_comparator *) sql_alloc(sizeof(Arg_comparator)*n))) + if (!(comparators= new Arg_comparator[n])) return 1; for (uint i=0; i < n; i++) { @@ -1528,6 +1528,12 @@ in_row::in_row(uint elements, Item * item) size= sizeof(cmp_item_row); compare= (qsort2_cmp) cmp_row; tmp.store_value(item); + /* + We need to reset these as otherwise we will call sort() with + uninitialized (even if not used) elements + */ + used_count= elements; + collation= 0; } in_row::~in_row() diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 1591b205d46..f1b1d8a7d86 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -530,6 +530,7 @@ extern "C" pthread_handler_decl(handle_slave,arg); static ulong find_bit_type(const char *x, TYPELIB *bit_lib); static void clean_up(bool print_message); static void clean_up_mutexes(void); +static void wait_for_signal_thread_to_end(void); static int test_if_case_insensitive(const char *dir_name); static void create_pid_file(); @@ -918,6 +919,7 @@ extern "C" void unireg_abort(int exit_code) sql_print_error("Aborting\n"); clean_up(exit_code || !opt_bootstrap); /* purecov: inspected */ DBUG_PRINT("quit",("done with cleanup in unireg_abort")); + wait_for_signal_thread_to_end(); clean_up_mutexes(); my_end(opt_endinfo ? MY_CHECK_ERROR | MY_GIVE_INFO : 0); exit(exit_code); /* purecov: inspected */ @@ -1023,6 +1025,29 @@ void clean_up(bool print_message) } /* clean_up */ +/* + This is mainly needed when running with purify, but it's still nice to + know that all child threads have died when mysqld exits +*/ + +static void wait_for_signal_thread_to_end() +{ +#ifndef __NETWARE__ + uint i; + /* + Wait up to 10 seconds for signal thread to die. We use this mainly to + avoid getting warnings that my_thread_end has not been called + */ + for (i= 0 ; i < 100 && signal_thread_in_use; i++) + { + if (pthread_kill(signal_thread, MYSQL_KILL_SIGNAL)) + break; + my_sleep(100); // Give it time to die + } +#endif +} + + static void clean_up_mutexes() { (void) pthread_mutex_destroy(&LOCK_mysql_create_db); @@ -2117,6 +2142,7 @@ extern "C" void *signal_hand(void *arg __attribute__((unused))) while ((error=my_sigwait(&set,&sig)) == EINTR) ; if (cleanup_done) { + DBUG_PRINT("quit",("signal_handler: calling my_thread_end()")); my_thread_end(); signal_thread_in_use= 0; pthread_exit(0); // Safety @@ -3111,21 +3137,7 @@ we force server id to 2, but this MySQL server will not act as a slave."); CloseHandle(hEventShutdown); } #endif -#ifndef __NETWARE__ - { - uint i; - /* - Wait up to 10 seconds for signal thread to die. We use this mainly to - avoid getting warnings that my_thread_end has not been called - */ - for (i= 0 ; i < 100 && signal_thread_in_use; i++) - { - if (pthread_kill(signal_thread, MYSQL_KILL_SIGNAL)) - break; - my_sleep(100); // Give it time to die - } - } -#endif + wait_for_signal_thread_to_end(); clean_up_mutexes(); my_end(opt_endinfo ? MY_CHECK_ERROR | MY_GIVE_INFO : 0); diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 844e5e7dac2..1f190a450de 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -688,7 +688,8 @@ public: thd.current_tablenr=0; thd.version=refresh_version; thd.command=COM_DELAYED_INSERT; - thd.lex->current_select= 0; /* for my_message_sql */ + thd.lex->current_select= 0; // for my_message_sql + thd.lex->sql_command= SQLCOM_INSERT; // For innodb::store_lock() bzero((char*) &thd.net, sizeof(thd.net)); // Safety bzero((char*) &table_list, sizeof(table_list)); // Safety diff --git a/sql/sql_lex.h b/sql/sql_lex.h index 3e2f6a3f2b5..f48ff42bbf8 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -125,27 +125,46 @@ enum tablespace_op_type /* The state of the lex parsing for selects - All select describing structures linked with following pointers: - - list of neighbors (next/prev) (prev of first element point to slave - pointer of upper structure) - - one level units for unit (union) structure - - member of one union(unit) for ordinary select_lex - - pointer to master - - outer select_lex for unit (union) - - unit structure for ordinary select_lex - - pointer to slave - - first list element of select_lex belonged to this unit for unit - - first unit in list of units that belong to this select_lex (as - subselects or derived tables) for ordinary select_lex - - list of all select_lex (for group operation like correcting list of opened - tables) - - if unit contain several selects (union) then it have special - select_lex called fake_select_lex. It used for storing global parameters - and executing union. subqueries of global ORDER BY clause will be - attached to this fake_select_lex, which will allow them correctly - resolve fields of 'upper' union and other more outer selects. + master and slaves are pointers to select_lex. + master is pointer to upper level node. + slave is pointer to lower level node + select_lex is a SELECT without union + unit is container of either + - One SELECT + - UNION of selects + select_lex and unit are both inherited form select_lex_node + neighbors are two select_lex or units on the same level - for example for following query: + All select describing structures linked with following pointers: + - list of neighbors (next/prev) (prev of first element point to slave + pointer of upper structure) + - For select this is a list of UNION's (or one element list) + - For units this is a list of sub queries for the upper level select + + - pointer to master (master), which is + If this is a unit + - pointer to outer select_lex + If this is a select_lex + - pointer to outer unit structure for select + + - pointer to slave (slave), which is either: + If this is a unit: + - first SELECT that belong to this unit + If this is a select_lex + - first unit that belong to this SELECT (subquries or derived tables) + + - list of all select_lex (link_next/link_prev) + This is to be used for things like derived tables creation, where we + go through this list and create the derived tables. + + If unit contain several selects (UNION now, INTERSECT etc later) + then it have special select_lex called fake_select_lex. It used for + storing global parameters (like ORDER BY, LIMIT) and executing union. + Subqueries used in global ORDER BY clause will be attached to this + fake_select_lex, which will allow them correctly resolve fields of + 'upper' UNION and outer selects. + + For example for following query: select * from table1 @@ -163,6 +182,11 @@ enum tablespace_op_type we will have following structure: + select1: (select * from table1 ...) + select2: (select * from table2 ...) + select3: (select * from table3) + select1.1.1: (select * from table1_1_1) + ... main unit fake0 @@ -185,7 +209,12 @@ enum tablespace_op_type relation in main unit will be following: - + (bigger picture for: + main unit + fake0 + select1 select2 select3 + in the above picture) + main unit |^^^^|fake_select_lex |||||+--------------------------------------------+ @@ -382,7 +411,7 @@ private: typedef class st_select_lex_unit SELECT_LEX_UNIT; /* - SELECT_LEX - store information of parsed SELECT_LEX statment + SELECT_LEX - store information of parsed SELECT statment */ class st_select_lex: public st_select_lex_node { diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc index fd165ad1fa5..d02bb5ff0a3 100644 --- a/sql/sql_repl.cc +++ b/sql/sql_repl.cc @@ -246,7 +246,7 @@ bool log_in_use(const char* log_name) if ((linfo = tmp->current_linfo)) { pthread_mutex_lock(&linfo->lock); - result = !memcmp(log_name, linfo->log_file_name, log_name_len); + result = !bcmp(log_name, linfo->log_file_name, log_name_len); pthread_mutex_unlock(&linfo->lock); if (result) break; diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 05314097ca3..a210fbbbe02 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -7622,8 +7622,8 @@ static int remove_dup_with_hash_index(THD *thd, TABLE *table, { byte *key_buffer, *key_pos, *record=table->record[0]; int error; - handler *file=table->file; - ulong extra_length=ALIGN_SIZE(key_length)-key_length; + handler *file= table->file; + ulong extra_length= ALIGN_SIZE(key_length)-key_length; uint *field_lengths,*field_length; HASH hash; DBUG_ENTER("remove_dup_with_hash_index"); @@ -7637,22 +7637,34 @@ static int remove_dup_with_hash_index(THD *thd, TABLE *table, NullS)) DBUG_RETURN(1); + { + Field **ptr; + ulong total_length= 0; + for (ptr= first_field, field_length=field_lengths ; *ptr ; ptr++) + { + uint length= (*ptr)->pack_length(); + (*field_length++)= length; + total_length+= length; + } + DBUG_PRINT("info",("field_count: %u key_length: %lu total_length: %lu", + field_count, key_length, total_length)); + DBUG_ASSERT(total_length <= key_length); + key_length= total_length; + extra_length= ALIGN_SIZE(key_length)-key_length; + } + if (hash_init(&hash, &my_charset_bin, (uint) file->records, 0, - key_length,(hash_get_key) 0, 0, 0)) + key_length, (hash_get_key) 0, 0, 0)) { my_free((char*) key_buffer,MYF(0)); DBUG_RETURN(1); } - { - Field **ptr; - for (ptr= first_field, field_length=field_lengths ; *ptr ; ptr++) - (*field_length++)= (*ptr)->pack_length(); - } file->ha_rnd_init(1); key_pos=key_buffer; for (;;) { + byte *org_key_pos; if (thd->killed) { my_error(ER_SERVER_SHUTDOWN,MYF(0)); @@ -7675,6 +7687,7 @@ static int remove_dup_with_hash_index(THD *thd, TABLE *table, } /* copy fields to key buffer */ + org_key_pos= key_pos; field_length=field_lengths; for (Field **ptr= first_field ; *ptr ; ptr++) { @@ -7682,14 +7695,14 @@ static int remove_dup_with_hash_index(THD *thd, TABLE *table, key_pos+= *field_length++; } /* Check if it exists before */ - if (hash_search(&hash,key_pos-key_length,key_length)) + if (hash_search(&hash, org_key_pos, key_length)) { /* Duplicated found ; Remove the row */ if ((error=file->delete_row(record))) goto err; } else - (void) my_hash_insert(&hash, key_pos-key_length); + (void) my_hash_insert(&hash, org_key_pos); key_pos+=extra_length; } my_free((char*) key_buffer,MYF(0)); diff --git a/strings/ctype-simple.c b/strings/ctype-simple.c index c2a6aa4e17f..080e0b780b7 100644 --- a/strings/ctype-simple.c +++ b/strings/ctype-simple.c @@ -518,7 +518,6 @@ longlong my_strntoll_8bit(CHARSET_INFO *cs __attribute__((unused)), register unsigned int cutlim; register ulonglong i; register const char *s, *e; - register unsigned char c; const char *save; int overflow; @@ -581,8 +580,9 @@ longlong my_strntoll_8bit(CHARSET_INFO *cs __attribute__((unused)), overflow = 0; i = 0; - for (c = *s; s != e; c = *++s) + for ( ; s != e; s++) { + register unsigned char c= *s; if (c>='0' && c<='9') c -= '0'; else if (c>='A' && c<='Z') @@ -641,7 +641,6 @@ ulonglong my_strntoull_8bit(CHARSET_INFO *cs, register unsigned int cutlim; register ulonglong i; register const char *s, *e; - register unsigned char c; const char *save; int overflow; @@ -704,8 +703,10 @@ ulonglong my_strntoull_8bit(CHARSET_INFO *cs, overflow = 0; i = 0; - for (c = *s; s != e; c = *++s) + for ( ; s != e; s++) { + register unsigned char c= *s; + if (c>='0' && c<='9') c -= '0'; else if (c>='A' && c<='Z')
", PAGER); safe_put_field(cur[i],lengths[i]); (void) tee_fputs("